(function(){var d,aa=this;function n(a){return void 0!==a}
function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function p(a){return"array"==ba(a)}function q(a){return"string"==typeof a}function r(a){return"function"==ba(a)}function ca(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function da(a,b,c){return a.call.apply(a.bind,arguments)}
function ea(a,b,c){if(!a)throw Error();if(2<arguments.length){var e=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,e);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function fa(a,b,c){fa=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?da:ea;return fa.apply(null,arguments)}
function ga(a,b){var c=a.split("."),e=aa;c[0]in e||!e.execScript||e.execScript("var "+c[0]);for(var f;c.length&&(f=c.shift());)!c.length&&n(b)?e[f]=b:e[f]?e=e[f]:e=e[f]={}}function t(a,b){function c(){}c.prototype=b.prototype;a.dk=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.sk=function(a,c,g){for(var h=Array(arguments.length-2),k=2;k<arguments.length;k++)h[k-2]=arguments[k];return b.prototype[c].apply(a,h)}};window.console||(window.console={});window.console.log||(window.console.log=function(){});window.console.info||(window.console.info=function(){});window.console.error||(window.console.error=function(){});window.console.warn||(window.console.warn=function(){});window.console.trace||(window.console.trace=function(){});window.console.trace||(window.console.trace=function(){});window.console.time||(window.console.time=function(){});window.console.timeEnd||(window.console.timeEnd=function(){});
window.console.profile||(window.console.profile=function(){});window.console.profileEnd||(window.console.profileEnd=function(){});var ha=KJS_VERSION,$=jQuery,t=function(a,b){function c(){}c.prototype=b.prototype;a.b=b.prototype;a.dk=b.prototype;a.prototype=new c;a.prototype.constructor=a};
function ia(a,b){if(!ja(a,b)){var c;b instanceof Function?c=b.prototype?b.prototype:{}:c=b instanceof Object?b:{};for(var e in c){var f=c[e],g=a.prototype[e];g&&g instanceof Function||(a.prototype[e]=f)}a.Ud=a.Ud||[];a.Ud.push(b)}}function ja(a,b){var c;if(a)r(a)?c=a:c=a.constructor;else return!1;if(!c)return!1;if(c.Ud)for(var e=0;e<c.Ud.length;e++)if(c.Ud[e]===b)return!0;return c.b?ja(c.b,b):!1}
function ka(a,b,c,e){b=b||window;return function(){var f=c||arguments;!0===e?(f=Array.prototype.slice.call(arguments,0),f=f.concat(c)):"number"==typeof e&&(f=Array.prototype.slice.call(arguments,0),Array.prototype.splice.apply(f,[e,0].concat(c)));return a.apply(b||window,f)}}Function.prototype.defer=function(a,b,c,e){return setTimeout(ka(this,b,c,e),a)};function la(a){return!isNaN(parseFloat(a))&&isFinite(a)}function ma(a){return"[object Date]"===Object.prototype.toString.call(a)}
function w(a){return"undefined"!==typeof a}function na(a,b){return null===a||void 0===a||p(a)&&!a.length||(b?!1:""===a)}function oa(a){return"object"===typeof HTMLElement?a instanceof HTMLElement:"object"===typeof a&&1===a.nodeType&&"string"===typeof a.nodeName}var pa=function(){var a=0;return function(b){return(b||"go_")+(a++).toString(36)}}();function x(a,b,c){a=a||{};c&&x(a,c);if(a&&b&&"object"==typeof b)for(var e in b)a[e]=b[e];return a}
function qa(){var a=Array.prototype.slice.apply(arguments);a.splice(0,0,!0);return $.extend.apply($,a)}function z(a,b){a=a||{};for(var c in b)void 0===a[c]&&(a[c]=b[c]);return a}function A(a,b){return na(a)?b:a}function B(a){a&&(r(a.bd)?a.bd():a instanceof jQuery?(a.remove(),a.splice(0,a.length),delete a.context):oa(a)&&$(a).remove())}function ra(){}function sa(a,b){function c(){}c.prototype=a.prototype;var e=new c;a.prototype.constructor.apply(e,b);return e}ga("kjs.deferredReload",function(){});
$(window).unload(function(){});function ta(){}ta.prototype.N=!1;ta.prototype.Ge=!1;ta.prototype.i=function(){};ta.prototype.bd=function(){this.N||(this.Ge=!0,this.i(),this.Ge=!1,this.N=!0)};function va(a,b,c){this.type=a+"";this.currentTarget=this.target=b;this.sg=c;this.gg=[]}d=va.prototype;d.type=null;d.target=null;d.currentTarget=null;d.gg=null;d.sg=!1;d.Xg=!1;d.Wg=!1;d.stopPropagation=function(){this.Xg=!0};d.stopImmediatePropagation=function(){this.Wg=!0;this.stopPropagation()};d.bubbles=function(){return this.sg};var wa={};function xa(a){r(aa.setImmediate)?aa.setImmediate(a):(ya||(ya=za()),ya(a))}var ya;
function za(){var a=aa.MessageChannel;"undefined"===typeof a&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&(a=function(){var a=document.createElement("iframe");a.style.display="none";a.src="";document.documentElement.appendChild(a);var b=a.contentWindow,a=b.document;a.open();a.write("");a.close();var c="callImmediate"+Math.random(),e=b.location.protocol+"//"+b.location.host,a=fa(function(a){if(a.origin==e||a.data==c)this.port1.onmessage()},this);b.addEventListener("message",
a,!1);this.port1={};this.port2={postMessage:function(){b.postMessage(c,e)}}});if("undefined"!==typeof a){var b=new a,c={},e=c;b.port1.onmessage=function(){c=c.next;var a=c.yh;c.yh=null;a()};return function(a){e.next={yh:a};e=e.next;b.port2.postMessage(0)}}return"undefined"!==typeof document&&"onreadystatechange"in document.createElement("script")?function(a){var b=document.createElement("script");b.onreadystatechange=function(){b.onreadystatechange=null;b.parentNode.removeChild(b);b=null;a();a=null};
document.documentElement.appendChild(b)}:function(a){aa.setTimeout(a,0)}};function Aa(a){this.c=Ba(a);this.o=this.N=0;Ca(this)}function Ba(a){"number"!==typeof a?a=16:(a=Math.min(Math.max(16,a),1073741824),a=(a>>>0)-1,a|=a>>1,a|=a>>2,a|=a>>4,a|=a>>8,a|=a>>16,a=a+1);return a}d=Aa.prototype;d.push=function(a){var b=this.Pa()+1;if(this.c<b)b=this.Pa(),Da(this,b+1),this[this.o+b&this.c-1]=a,this.N=b+1;else{var c=this.o+b-1;Da(this,b);this[c+0&this.c-1]=a;this.N=b}};d.shift=function(){var a=this.o,b=this[a];this[a]=void 0;this.o=a+1&this.c-1;this.N--;return b};
d.clear=function(){0<this.N&&(this.c=Ba(0),this.o=this.N=0,Ca(this))};d.contains=function(a){a:{for(var b=this.o,c=this.o+this.N;b<c;b++)if(this[b]===a){a=b;break a}a=-1}return 0<=a};d.Pa=function(){return this.N};function Ca(a){for(var b=a.c,c=0;c<b;++c)a[c]=void 0}function Da(a,b){if(a.c<b){var c=a.o,e=a.c,f=Array(e),g=a.Pa();Ea(a,0,f,0,e);a.c=Ba(b);Ca(a);a.o=0;c+g<=e?Ea(f,c,a,0,g):(e=g-(c+g&e-1),Ea(f,c,a,0,e),Ea(f,0,a,e,g-e))}};function Fa(){this.c=new Aa(25E3*Ga)}var Ga=3;Fa.prototype.o=!1;Fa.prototype.c=null;function Ha(a,b,c){var e=Ia;c=c||window;b=b||[];e.c.push(a);e.c.push(c);e.c.push(b);Ja(e)}function Ja(a){a.o||(xa(function(){for(var b=a.c;0<b.Pa();){var c=b.shift(),e=b.shift(),f=b.shift();c.apply(e,f)}a.o=!1;a.c.clear()}),a.o=!0)};function Ka(a){return 3==a||4==a};function C(){this.P=pa("promise_");this.U=1;this.gf=[];this.sf=[];this.qf=[];this.Sc=La?La:this}var La=null,Ia=new Fa;function Ma(){var a=new C;a.Ca.call(a,void 0);return a}function Na(a){var b=new C;b.ha.call(b,a);return b}
function Oa(a){var b,c=arguments.length,e=[];e.length=c;var f=[];f.length=c;var g=0,h=!1;if(0==c)b=Ma();else{b=new C;for(var k=0;k<c;k++){var l=arguments[k];l instanceof C?(l.Lc(function(a){e[this.index]=a;g++;g==c&&(h?b.ha(f):b.Ca(e))},{index:k}),l.Nc(function(a){f[this.index]=a;g++;h=!0;g==c&&b.ha(f)},{index:k}),l.Mc(function(a){var e=[];e.length=c;e[this.index]=a;b.dc(e)},{index:k})):(g++,g==c&&(h?b.ha(f):b.Ca(e)))}}return b}d=C.prototype;d.P=null;d.Sc=null;d.U=null;d.gf=null;d.sf=null;d.qf=null;
d.lc=void 0;d.Lf=function(a){return this.P===a.P};d.Oh=function(){return this.U};d.Ca=function(a){if(1==this.U){this.U=3;this.lc=[a];a=this.gf;for(var b=0,c=a.length;b<c;b++){var e=a[b];Ha(e.fn,this.lc,e.scope)}}};d.ha=function(a){if(1==this.U){this.U=4;var b=[a];this.lc=b;for(var c=this.sf,e=0,f=c.length;e<f;e++){var g=c[e];Ha(g.fn,b,g.scope)}Ha(function(){0==c.length&&console.error("Uncaught rejection: %o",a)})}};
d.dc=function(a){if(1==this.U){this.lc=[a];a=this.qf;for(var b=0,c=a.length;b<c;b++){var e=a[b];Ha(e.fn,this.lc,e.scope)}}};function Pa(a,b,c){return function(){La=a.Sc;try{b.apply(c,arguments)}catch(e){console.warn("unexpected code path"),console.error(e)}La=null}}d.Lc=function(a,b){if(a){b=b||this;var c=Pa(this,a,b);this.gf.push({fn:c,scope:b});3==this.U&&Ha(c,this.lc,b)}return this};d.Nc=function(a,b){if(a){b=b||this;var c=Pa(this,a,b);this.sf.push({fn:c,scope:b});4==this.U&&Ha(c,this.lc,b)}return this};
d.Mc=function(a,b){a&&(b=b||this,this.qf.push({fn:Pa(this,a,b),scope:b}));return this};function Qa(a,b,c,e,f){a.Lc(b,f);a.Nc(c,f);a.Mc(e,f)}function Ra(a,b,c){return a.then(b,b,null,c)}
d.then=function(a,b,c,e){var f=arguments.length;1<f&&4>f&&ca(arguments[f-1])&&(e=arguments[f-1]);e=e||this;var g=new C;g.Sc=this.Sc;if(!r(a)&&!r(b)&&!r(c))return console.info("EMPTY! ALLOW_RETURN_SELF = true"),this;r(a)?this.Lc(function(){try{var b=a.apply(e,arguments);b instanceof C?(b==this&&g.ha(new TypeError("Promise handlers can not return self.")),Qa(b,g.Ca,g.ha,g.dc,g)):n(b)?g.Ca(b):this.Lc(g.Ca,g)}catch(c){g.ha(c)}}):this.Lc(g.Ca,g);r(b)?this.Nc(function(){try{var a=b.apply(e,arguments);a instanceof
C?(a==this&&g.ha(new TypeError("Promise handlers can not return self.")),Qa(a,g.Ca,g.ha,g.dc,g)):n(a)?g.ha(a):this.Nc(g.Ca,g)}catch(c){g.ha(c)}}):this.Nc(g.ha,g);r(c)?this.Mc(function(){try{var a=c.apply(e,arguments);a instanceof C?(a==this&&g.ha(new TypeError("Promise handlers can not return self.")),Qa(a,g.Ca,g.ha,g.dc,g)):n(a)?g.dc(a):this.Mc(g.dc,g)}catch(b){g.ha(b)}}):this.Mc(g.dc,g);return g};function Sa(a,b,c){c=c||a;return r(b)?Ra(Ra(a,b,c),function(){return a}):Ra(a)}
function D(a,b,c){var e;r(c)||(e=c,c=b,b=void 0);c||(c=function(){});return b?a.then(null,function(a){return a instanceof b?c.apply(this,arguments):Na.apply(null,arguments)},null,e):a.then(null,c,null,e)}d.promise=function(){return this};function Ta(){Ta.b.constructor.call(this)}t(Ta,C);d=Ta.prototype;d.rf=null;d.xb=function(a){this.Ca(a)};d.success=Ta.prototype.xb;d.reject=function(a){this.ha(a)};d.promise=function(){this.rf||(this.rf=Ua(this));return this.rf};
function Ua(a){var b=new C;b.Sc=a.Sc;b.P=a.P;b.Oh=function(){return a.Oh()};b.Lc=function(b,e){return a.Lc(b,e)};b.Nc=function(b,e){return a.Nc(b,e)};b.Mc=function(b,e){return a.Mc(b,e)};return b};function Va(a){var b;window.XMLHttpRequest?b=new XMLHttpRequest:b=-1!=navigator.userAgent.toLowerCase().indexOf("msie 5")?new ActiveXObject("Microsoft.XMLHTTP"):new ActiveXObject("Msxml2.XMLHTTP");if(!b)throw Error("Your browser doesn't do Ajax. Unable to support external language files.");b.open("GET",a,!1);try{b.send(null)}catch(c){return}a=b.status;if(200==a||0==a)return b.responseText;a=b.statusText+" (Error "+b.status+")";b.responseText.length&&(a+="\n"+b.responseText);throw a;}
function Wa(a){var b=new Ta;delete a.complete;delete a.success;delete a.error;delete a.jsonpCallback;jQuery.ajax(a).done(function(a,e,f){b.xb.apply(b,arguments)}).fail(function(a,e,f){b.reject.apply(b,arguments)});return b.promise()};function E(a){a=a||{};q(a)&&(a={tag:a});a.tag=a.tag||"div";var b=$(document.createElement(a.tag)),c;for(c in a.attributes)b.attr(c,a.attributes[c]);a.da&&b.addClass(a.da);a.css&&b.css(a.css);a.html&&b.html(a.html);return b}function Xa(){return E({da:"kjs-clear"})}
function Ya(a,b){var c;w(b)||(b=!1);c=b?a.css("paddingTop borderTopWidth marginTop paddingRight borderRightWidth marginRight paddingBottom borderBottomWidth marginBottom paddingLeft borderLeftWidth marginLeft".split(" ")):a.css("paddingTop borderTopWidth paddingRight borderRightWidth paddingBottom borderBottomWidth paddingLeft borderLeftWidth".split(" "));return{top:(parseInt(c.paddingTop)||0)+(parseInt(c.borderTopWidth)||0)+(b&&(parseInt(c.marginTop)||0)),right:(parseInt(c.paddingRight)||0)+(parseInt(c.borderRightWidth)||
0)+(b&&(parseInt(c.marginRight)||0)),bottom:(parseInt(c.paddingBottom)||0)+(parseInt(c.borderBottomWidth)||0)+(b&&(parseInt(c.marginBottom)||0)),left:(parseInt(a.css("paddingLeft"))||0)+(parseInt(a.css("borderLeftWidth"))||0)+(b&&(parseInt(c.marginLeft)||0))}}function Za(a,b){var c;w(c)||(c=!1);null!==b?(c=Ya(a,c),c=b-c.left-c.right):c=null;a.width(c);return c}function $a(a,b){var c;w(c)||(c=!1);null!==b?(c=Ya(a,c),c=b-c.top-c.bottom):c=null;a.height(c);return c}
function ab(a,b){w(b)||(b=!1);if(w(void 0)){var c=Ya(a,b);return void 0+c.left+c.right}return a.outerWidth(b)}function F(a,b){w(b)||(b=!1);if(w(void 0)){var c=Ya(a,b);return void 0+c.top+c.bottom}return a.outerHeight(b)}function bb(a){var b;w(b)||(b=!1);return w(void 0)?(a=Ya(a,b),NaN-a.left-a.right):a.width()}function cb(a,b){var c=a.offset(),e=b.offset();return{x:c.left-e.left,y:c.top-e.top}}
function db(a){a=(a||"").split(" ");switch(a.length){case 1:return{top:parseInt(a[0])||0,right:parseInt(a[0])||0,bottom:parseInt(a[0])||0,left:parseInt(a[0])||0};case 2:return{top:parseInt(a[0])||0,right:parseInt(a[1])||0,bottom:parseInt(a[0])||0,left:parseInt(a[1])||0};case 3:return{top:parseInt(a[0])||0,right:parseInt(a[1])||0,bottom:parseInt(a[2])||0,left:parseInt(a[1])||0};case 4:return{top:parseInt(a[0])||0,right:parseInt(a[1])||0,bottom:parseInt(a[2])||0,left:parseInt(a[3])||0}}}
function eb(a,b){for(var c=(a.css("animationName")||a.css("animation-name")||a.css("-webkit-animation-name")||a.css("-ms-animation-name")||a.css("-moz-animation-name")||a.css("-o-animation-name")||"").replace(/ /g,"").split(","),e=0;e<c.length;e++)if(c[e]==b)return!0;return!1}
var fb=function(){var a=["","webkit","moz","MS","o"];return function(b){for(var c="",e=0;e<a.length;e++)c+=a[e]+(""==a[e]?b.toLowerCase():b)+" ";return c}}(),gb=document.createElement("div"),hb=" Moz Webkit ms O Khtml".split(" "),ib={borderRadius:!1,boxShadow:!1,textShadow:!1,boxSizing:!1},jb;for(jb in ib)if(void 0!==gb.style[jb])ib[jb]=!0;else for(var kb=jb.charAt(0).toUpperCase()+jb.slice(1),lb,mb=0;mb<hb.length;mb++)lb=hb[mb]+kb,void 0!==gb.style[lb]&&(ib[jb]=!0);
$(document).ready(function(){var a=document.createElement("div");a.className="kjs-scrollbar-measure";document.body.appendChild(a);document.body.removeChild(a)});var nb;ua=navigator.userAgent.toLowerCase();var ob=/(msie) ([\w.]+)/.exec(ua)||/(edge)[ \/]([\w.]+)/.exec(ua)||/(trident)[ \/]([\w.]+)/.exec(ua)||/(webkit)[ \/]([\w.]+)/.exec(ua)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua)||0>ua.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua)||[];nb={name:ob[1]||"",version:ob[2]||"0"};function G(){G.b.constructor.call(this);this.Oa={};this.$b={}}t(G,ta);d=G.prototype;d.Oa=null;d.$b=null;d.hc=null;
function pb(a,b,c,e){function f(a){var c=arguments.callee.scope;if(qb){var f;a instanceof jQuery.Event&&$(a.target).attr("name");f=$(a.target).attr("name");console.log(a.type+" event caught at: "+c.P+" with name: "+f+". %o",c)}if(a instanceof jQuery.Event&&a.target.disabled)return a.preventDefault(),a.stopImmediatePropagation(),!1;e.ni&&a.target instanceof G&&a.target.kb(a.type,b,c);if(!rb)return b.apply(c,arguments)}c=c||a;e=e||{};z(e,{ni:!1});f.scope=c;c=null;return f}
d.Lh=function(a,b,c,e){c=c||this;if(this.N)console.warn("addListener called on destroyed EventDispatcher");else{a=a.split(" ");for(var f=0;f<a.length;f++){var g=a[f];this.Oa[g]||(this.Oa[g]=[]);for(var h=0;h<this.Oa[g].length;h++)if(this.Oa[g][h].listener==b&&this.Oa[g][h].Ra.scope==c)return;h=pb(this,b,c,e);this.Oa[g].push({listener:b,Ra:h,wb:g})}}};d.Lb=function(a,b,c,e){e=x({},e,{ni:!0});this.Lh(a,b,c,e)};G.prototype.once=G.prototype.Lb;
G.prototype.ui=function(a,b,c){if(!this.N){var e=!1;a=a.split(" ");for(var f=0;f<a.length;f++){var g=a[f],h=this.Oa[g];if(h){for(var k=0,l=0;l<h.length;l++){var u=h[l];b&&u.listener!=b||c&&u.Ra.scope!=c||(delete u.Ra.scope,this.Oa[g].splice(l,1),e=!0,k++)}1<k&&console.warn("REMOVED MORE THAN ONE OF THE SAME LISTENERS ON A SINGLE CALL OF .removeListener, DID YOU FORGET TO SPECIFY A SCOPE TO TARGET?!")}}return e}};
function H(a,b,c,e,f){f=f||a;if(!c)throw Error("EventTypes can not be empty");c=c.split(" ");for(var g=0;g<c.length;g++){var h=c[g];a.$b[h]=a.$b[h]||[];var k=a.$b[h];if(b instanceof G)b.on(h,e,f,void 0),k.push({Kc:b,wb:h,listener:e,scope:f,Ra:null});else{b instanceof jQuery||(b=$(b));for(var l=pb(a,e,f,void 0),u=0;u<b.length;u++){var y=b.eq(u);y.bind(h+"."+sb,l);k.push({Kc:y,wb:h,listener:e,scope:f,Ra:l})}}}}
function I(a,b,c,e){var f;f=f||a;var g,h;if(!c)throw Error("EventTypes can not be empty");c=c.split(" ");for(var k=0;k<c.length;k++)if(h=a.$b[c[k]])if(b instanceof G)for(var l=0;l<h.length;++l){if(g=h[l],b===g.Kc)if(e===g.listener&&g.scope==f){b.kb(g.wb,g.listener,g.scope);h.splice(l,1);break}else e?e===g.listener&&(console.warn("REMOVING LISTENER WITH MISMATCHING SCOPE"),b.kb(g.wb,g.listener),h.splice(l,1),l--):(b.kb(g.wb,g.listener,g.scope),h.splice(l,1),l--)}else{b instanceof jQuery||(b=$(b));
for(var u=0;u<b.length;u++)for(var y=b.eq(u),l=0;l<h.length;++l)if(g=h[l],g.Kc instanceof jQuery&&y.get(0)===g.Kc.get(0))if(e===g.listener&&g.scope==f){y.unbind(g.wb+"."+sb,g.Ra);delete g.Ra.scope;h.splice(l,1);break}else e?e==g.listener&&(console.warn("REMOVING LISTENER WITH MISMATCHING SCOPE SIGNATURE BECAUSE NO SCOPE PARAMETER WAS PROVIDED."),b.kb(g.wb,g.listener),h.splice(l,1),l--):(y.unbind(g.wb+"."+sb,g.Ra),delete g.Ra.scope,h.splice(l,1),l--)}}
G.prototype.kg=function(a){var b;a instanceof va?b=a:"string"==typeof a?b=new va(a,this,!0):(b=new va(a.type,a.target||this,!0),delete a.type,delete a.bubbles,x(b,a));var c=Array.prototype.slice.apply(arguments);c[0]=b;this.dispatchEvent.apply(this,c)};
G.prototype.dispatchEvent=function(a){if(this.N)console.warn("dispatchEvent called on destroyed EventDispatcher",arguments);else if(!rb){var b;a instanceof va?b=a:"string"==typeof a?b=new va(a,this,!1):(b=new va(a.type,a.target||this,a.bubbles||!1),delete a.type,delete a.bubbles,z(b,a));b.currentTarget=this;b.gg.unshift(this);var c=b.type;if(1<c.split(" ").length)throw Error("Event type can not contain a space");var e=Array.prototype.slice.call(arguments,0);e.shift();e.unshift(b);if(c=this.Oa[c])for(var f=
0,g=c[f],h=0;g;){var k=g.Ra.apply(this,e);b.result=k;if(!1===k||b.Wg)break;!c[f]||g!=c[f]&&g.listener!=c[f].listener||f++;g=c[f];h++;if(100<h){console.error("EventDispatcher::dispatchEvent exceeded MAX_COUNT [100]");break}}!1===b.result||!0!==b.bubbles()||b.Xg||(c=this.hc)&&c!=this&&c.dispatchEvent.apply(c,e);return b.result}};
G.prototype.i=function(){this.dispatchEvent("destroy");for(var a in this.$b)for(var b=this.$b[a],c=0;c<b.length;c++){var e=b[c];e.Kc instanceof G?e.Kc.kb(e.wb,e.listener,e.scope):(e.Kc.unbind(e.wb+"."+sb,e.Ra),delete e.Ra.scope)}this.$b={};for(var f in this.Oa){a=this.Oa[f];for(b=0;b<a.length;b++)delete a[b].Ra.scope;this.Oa[f]=[]}this.hc=null;G.b.i.call(this)};var sb="KJS_EVENT",rb=!1,qb=!1;G.prototype.on=G.prototype.Lh;G.prototype.on=G.prototype.on;G.prototype.kb=G.prototype.ui;G.prototype.un=G.prototype.kb;function tb(a,b){a&&(this.o=a);b?(this.N=!0,this.c=b):(this.N=!1,this.c={})}tb.prototype.o=null;tb.prototype.N=!0;tb.prototype.c=null;tb.prototype.Nd=function(a){if(this.N)for(var b in this.c)if(this.c.hasOwnProperty(b)&&this.c[b]===a)return b;return null};function J(a,b,c){n(c)?(a.N=!0,a.c[c]=b):a.o=b}
function ub(a,b,c){var e=null,f=null;p(b)&&(c=b,b=null);a.N?b?(e=a.c[b],e||(e=a.o)):e=a.o:e=a.o;if(e)c?f=sa(e,c):f=new e;else throw a="Matching constructor was not found",b&&(a+=" for id: "+b),Error(a);return f};var vb=new tb;function wb(a,b){b=Array.prototype.slice.call(arguments);b.splice(0,1);return ub(vb,a,b)};function Ea(a,b,c,e,f){for(var g=0;g<f;++g)c[g+e]=a[g+b]}function K(a,b){for(var c=0,e=a.length;c<e;c++)if(a[c]===b)return c;return-1}function xb(a,b){if(a.length!=b.length)return!1;for(var c=0,e=a.length;c<e;c++)if(a[c]!==b[c])return!1;return!0}function yb(a){for(var b=Array.prototype.concat.apply([],arguments),c=b.length,e=0;e<c;++e)for(var f=e+1;f<c;++f)b[e]===b[f]&&b.splice(e,1);return b}function zb(a,b,c){if(!na(a,!0))for(var e=0,f=a.length;e<f&&!1!==b.call(c||a[e],a[e],e,a);e++);};function Ab(a,b,c){if("object"==typeof a)return Bb(a);this.status=n(a)?a:1;this.text=b||"";this.data=c||{}}function Bb(a){var b=new Ab(a.status,a.text,a.data);x(b,a);return b}Ab.prototype.status=1;Ab.prototype.text="";Ab.prototype.data=null;Ab.prototype.ka=function(){return 1==this.status};function Cb(a,b,c){Cb.b.constructor.call(this,a,b,c)}t(Cb,Ab);Cb.prototype.ka=function(){return 0<this.status||!0===this.status};function Db(a,b,c){var e=!1,f="";c=Array.prototype.slice.call(arguments,2);try{e=c.length?a.apply(b,c):a.call(b),q(e)?(f=e,e=!1):e instanceof Ab&&(f=e.text,e=e.ka())}catch(g){f=g.message,e=!1}return new Cb(!1!==e,f)}function Eb(a,b){b=b||{};return new Cb(Fb,a||"",b)}var Fb=1;function Gb(a){q(a)&&(a={name:a});this.Te=Eb();z(a,Hb[a.type||this.type]);x(this,a)}
var Hb={all:{ib:function(a){return void 0===a||null===a||""===a||"number"==typeof a&&isNaN(a)?null:a}},bool:{ib:function(a){return void 0===a||null===a||""===a||isNaN(a)?null:!(!1===a||"false"===a||0==a)}},date:{ib:function(a){return a?ma(a)?a:la(a)?new Date(parseInt(a,10)):(a=Date.parse(a))?new Date(a):null:null}},"float":{ib:function(a){return void 0===a||null===a||""===a?null:parseFloat(a,10)}},"int":{ib:function(a){return void 0===a||null===a||""===a||isNaN(a)?null:parseInt(a,10)}},string:{ib:function(a){return void 0===
a||null===a?null:a+""}},array:{ib:function(a){return void 0==a?[]:p(a)?a:[a]}},model:{ib:function(a){return a instanceof Ib?a:a?wb(this.defaultValue,a):a}},modelCollection:{defaultValue:"BaseModel",ti:!1},object:{ib:function(a){return ca(a)?a:null}}};d=Gb.prototype;d.type="all";d.name=void 0;d.defaultValue=void 0;d.Xj=!0;d.ti=!0;d.ib=null;d.uj=!1;d.mj=!0;d.compare=null;d.Wd=!0;d.Te=null;d.Z=null;function Jb(a,b,c){Jb.b.constructor.call(this,a,b,c)}t(Jb,va);Jb.prototype.o=null;Jb.prototype.c=null;function Ib(a,b){a=a||{};Ib.b.constructor.call(this);this.Aa=pa("go_model_");this.ya={};this.cd={};this.uc={};this.sb={};this.Sd=Eb();var c,e,f;b=this.Ma=x(this.Ma,b);for(c in b)e=b[c],e=new Gb(e),b[c]=e,f=e.type,this.sb[f]=this.sb[f]||[],this.sb[f].push(c),void 0===a[c]&&(a[e.name]=e.defaultValue);Kb(this,a,void 0,!0);this.Ph=!0;this.ic=!1;this.uc={}}t(Ib,G);var Lb=Ib;Lb.prototype.td="Model";J(vb,Lb,"Model");d=Ib.prototype;d.Aa=null;d.ic=!1;d.Sd=null;d.Va=0;d.Qh=0;d.Ph=!1;d.uc=null;d.cd=null;
d.ya=null;d.Ma={};d.sb=null;d.Sf=!0;d.get=function(a){var b=this.Ma[a];if(b&&!b.Xj)throw Error("Property is not readable");return this.ya[a]};d.set=function(a,b,c){if(ca(a))for(var e in a)a.hasOwnProperty(e)&&this.set(e,a[e],c);else{if((e=this.Ma[a])&&!e.ti)throw Error("Property is not writeable");Kb(this,a,b,c)}};
function Kb(a,b,c,e){if(ca(b))for(var f in b)b.hasOwnProperty(f)&&Kb(a,f,b[f],e);else{(f=a.Ma[b])&&f.ib&&(c=f.ib(c));var g=a.ya[b];Mb(g,c,f)||(a.cd[b]=c,f&&f.Wd&&(a.uc[b]=g));if(!a.Va){f=a.cd;var h,k,l;b=a.Aa;c=[];for(h in f)if(f.hasOwnProperty(h)){g=f[h];k=a.ya[h];l=a.Ma[h];changed=!0;a.ya[h]=g;delete f[h];if(l){if("model"==l.type||"modelCollection"==l.type)g&&(g.hc=a,l.Wd&&H(a,g,"dirty",a.Gj)),k&&(k.hc=null,l.Wd&&I(a,k,"dirty"))}else g instanceof Ib&&(g.hc=a),k instanceof Ib&&(k.hc=null);c.push({name:h,
Vj:g,Wj:k});e||a.dispatchEvent("propertyChange",h,g,k);l&&l.Wd&&(a.uc[h]=k,a.ic=!0)}for(h=0;h<c.length;h++)f=c[h],a.Ce("change",f.name,f.Vj,f.Wj);c.length&&(h=a.Aa,h!=b&&(p(h)&&p(b)?xb(h,b)||a.dispatchEvent("keyChange"):a.dispatchEvent("keyChange")),e||a.kg("change"),a.Z(!0,e));!a.Qh&&a.Ph&&!e&&Nb(a)&&a.dispatchEvent("dirty");a.cd={}}}}
function Mb(a,b,c){if(c&&c.compare&&r(c.compare))return c.compare(a,b);if(c&&c.uj)return!1;if(a===b)return!0;if(ma(a)&&ma(b))return a.getTime()===b.getTime();if(p(a)&&p(b)){if(c&&!c.mj||a.length!=b.length)return!1;c=0;for(var e=a.length;c<e;c++)if(a[c]!==b[c])return!1;return!0}return ca(a)&&r(a.Lf)?a.Lf(b):!1}d.each=function(a,b){var c=this.ya,e;for(e in c)if(!1===a.call(b||this,c[e],e))break};
d.Ce=function(a,b,c){var e=Array.prototype.slice.call(arguments,0);e.splice(0,1);var f=new Jb(a+"."+b,this,!1);f.c=b;f.o=this.Ma[b];e[0]=f;this.dispatchEvent.apply(this,e)};d.bind=function(a,b,c,e,f){this.on(a+"."+b,c,e,f)};d.unbind=function(a,b,c){this.kb(a+"."+b,c)};d.Gj=function(){this.ic||(this.ic=!0,!this.Sf||this.Va||this.dispatchEvent("dirty"))};
function Nb(a){if(a.Sf){if(a.ic)return!0;for(var b=[].concat(a.sb.model||[]).concat(a.sb.modelCollection||[]),c=0,e=b.length;c<e;c++){var f=b[c],g=a.ya[f];if(a.Ma[f].Wd&&g&&Nb(g))return!0}}return!1}d.reject=function(a){var b,c,e=!1;this.Va&&(this.Va=0,this.ic=this.o,this.ya=this.c,delete this.o,delete this.c,delete this.f,this.cd={});this.ic=!1;b=this.uc;for(c in b)b.hasOwnProperty(c)&&(e=this.ya[c],this.ya[c]=b[c],a||this.Ce("change",c,b[c],e),e=!0);this.uc={};e&&(a||this.kg("change"),this.Z(a))};
d.Ib=function(a){if(!this.Sd.ka())return!1;if(!a){a=[].concat(this.sb.model||[]).concat(this.sb.modelCollection||[]);for(var b=0,c=a.length;b<c;b++){var e=this.get(a[b]);if(e&&!e.Ib())return!1}}return!0};
d.Z=function(a,b){var c=!0,e;for(e in this.Ma){if(c){var c=e,f=b,g=void 0,h=this.Ma[c];h&&h.Z?(g=Db(h.Z,this,this.ya[c]),f||(!g.ka()&&h.Te.ka()?this.Ce("invalid",c,this.ya[c],g):g.ka()&&!h.Te.ka()&&this.Ce("valid",c,this.ya[c],g)),h.Te=g):g=Eb();c=g.ka()}f=this.ya[e];!a&&f instanceof Ib&&f.Z(!1,b)}e=Db(this.Hj,this);e.status=e.status&&c;b||(!e.ka()&&this.Sd.ka()?this.dispatchEvent("invalid",e):e.ka()&&!this.Sd.ka()&&this.dispatchEvent("valid",e));return this.Sd=e};d.Hj=function(){};
d.i=function(){this.ic=!1;this.Qh=this.Va=0;this.Sf=!1;this.uc={};this.cd={};for(var a=[].concat(this.sb.model||[]).concat(this.sb.modelCollection||[]),b=0,c=a.length;b<c;b++){var e=this.get(a[b]);B(e)}this.ya={};this.Ma={};Ib.b.i.call(this)};function Ob(){Ob.b.constructor.call(this)}t(Ob,Ib);var Pb=Ob;Pb.prototype.td="EmuModel";J(vb,Pb,"EmuModel");
var Qb=Ob.prototype,Rb=[{name:"scenarioList",type:"array"},{name:"modelFilter",type:"string"},{name:"hasBuddyFilter",type:"bool"},{name:"selectedScenarioId",type:"int"},{name:"replayProtectionEnabled",type:"bool"},{name:"sessionId",type:"string"},{name:"sessionState",type:"int"},{name:"queuePosition",type:"int"},{name:"expiryTimer",type:"int"},{name:"scenarioId",type:"string"},{name:"scenarioName",type:"string"},{name:"scenarioSeries",type:"string"},{name:"ports.web",type:"int"},{name:"ports.control",
type:"int"},{name:"ports.health",type:"int"},{name:"ports.data",type:"int"}],Sb,Tb,L,Ub={};if(p(Rb))for(Sb=0;Sb<Rb.length;Sb++)L=Rb[Sb],q(L)&&(L={name:L}),Ub[L.name]=L;else if(Gg.Fk(Rb))for(Tb in Rb)L=Rb[Tb],q(L)&&(L={name:L}),L.name=L.name||Tb,Ub[L.name]=L;else Gg.Gk(Rb)&&(L={name:L},Ub[L.name]=L);Qb.Ma=Ub;var Vb=null,M=null;function Wb(){}d=Wb.prototype;d.Ic=!1;d.ga=function(a){this.Ic?console.warn("Setup called on controller that is already set up"):(this.mc=[],this.ja.apply(this,arguments),this.Ic=!0)};d.ja=function(){};d.wa=function(){if(this.Ic){for(var a=0;a<this.mc.length;a++)B(this.mc[a]),this.mc[a]=null;this.mc=null;this.ta();this.Ic=!1}};d.ta=function(){};d.mc=null;function Xb(a,b){0<=K(a.mc,b)||(a.mc.push(b),b.Fe())};var N=new tb;N.create=function(a,b){b=b||{};var c;try{c=ub(this,a,[b])}catch(e){console.error(e)}return c};N.f=function(a){return n(a)&&this.N?this.c[a]:this.o};N.register=function(a,b){b.prototype.td=a;J(this,b,a)};var O={};function Yb(a){if(O.hasOwnProperty(a)){a=O[a];if(n(a)){var b=a.toLowerCase();return"false"==b||"null"==b||0===parseInt(a)?!1:!0}return!0}return!1}O=function(a){var b={};if(!a||0==a.length)return b;"/"==a[a.length-1]&&(a=a.slice(0,a.length-1));a=a.substring(a.indexOf("?")+1);if(0==a.length)return b;a=a.split("&");for(var c=0;c<a.length;c++){var e=a[c],e=e.split("=");b[e[0]]=e[1]}return b}(window.location.search);function P(a){a=a||{};this.yf=n(a.tag)?a.tag:"div";this.kf=a.html||null;this.rb=a.Pd||null;this.ri=a.Hk||null;this.Fg=n(a.J)?a.J:"";this.fa=n(a.M)?a.M:"kjs-element";this.xg=n(a.jj)?a.jj:"kjs-style-default";this.Gg=n(a.Hc)?a.Hc:{};this.Ha=a.Ha||{};this.Ka=a.va||null;this.Tb=n(a.I)?a.I:"default";this.rc=n(a.K)?a.K:!1;this.ua=a.width||null;this.na=a.height||null;this.za=a.minWidth||null;this.Yc=a.maxWidth||null;this.Db=a.minHeight||null;this.me=a.maxHeight||null;this.gb=a.innerWidth||null;this.Zb=a.innerHeight||
null;this.V=n(a.enabled)?a.enabled:!0;this.ia=n(a.hidden)?a.hidden:!1;this.name=a.name||null;this.P=a.id||null;this.element=a.element||null;this.a=a.nk||null;this.element&&(this.a=$(this.element));this.a&&0!=this.a.length||(this.a=this.yf?E({tag:this.yf}):E());this.a?this.P=this.a.attr("id"):this.P&&(this.a=$("#"+this.P));this.P||(this.P=Zb(this.td+"_"));this.a.attr("id",this.P);this.name||(this.name=this.td);this.a.attr("name",this.name);this.mb=E({da:"kjs-mask"});this.ri&&this.mb.html(this.ri);
if($b[this.P])throw"Duplicate Component ID: "+this.P;$b[this.P]=this;this.Cb=[];this.Ka&&q(this.Ka)&&(this.Ka=db(this.Ka));P.b.constructor.call(this);this.kf&&this.a.html(this.kf);this.yb("click");this.yb("dblclick");this.yb("mousedown");this.yb("mouseup");this.yb("mouseenter");this.yb("mouseleave");this.yb("scroll");this.on("beforeRender",this.vi);this.on("afterRender",this.Xe)}t(P,G);N.register("Component",P);ia(P,Wb);d=P.prototype;d.yf="div";d.kf=null;d.P="";d.rb=null;d.Fg="";d.fa="kjs-element";
d.xg="kjs-style-default";d.Gg=null;d.Tb="default";d.name=null;d.V=!0;d.ia=!1;d.Ha=null;d.Ka=null;d.rc=!1;d.ua=null;d.na=null;d.za=null;d.Yc=null;d.Db=null;d.me=null;d.gb=null;d.Zb=null;d.Dc=!1;d.Qg=!1;d.Xc=!1;d.Ja=!1;d.g=!1;d.Qc=!1;var ac=[];d=P.prototype;d.Cb=null;d.a=null;d.mb=null;d.parent=null;d.yb=function(a){H(this,this.a,a,this.zd)};d.fg=function(a){I(this,this.a,a,this.zd)};
d.zd=function(a){var b=a.originalEvent;a instanceof va||!b||0<=K(ac,b)||(ac.push(a.originalEvent),a.target=this,this.dispatchEvent(a),setTimeout(function(){var a=K(ac,b);0<=a&&ac.splice(a,1)},1))};function bc(a,b){a.parent&&a.parent instanceof Q&&!a.Xc?a.parent.remove(a,b):cc(a,b)}
function cc(a,b){a.a.addClass("kjs-removing");if(eb(a.a,"removing")&&!a.Qc)H(a,a.a,fb("AnimationEnd"),a.gh),b&&(a.Ee=!0);else{a.a.detach();a.a.removeClass("kjs-removing");if(a.Xc){var c=a.parent,e=K(c.Cb,a);0<=e&&(c.Cb.splice(e,1),a.Xc=!1,dc(a))}else dc(a);b&&a.bd()}}d.gh=function(){this.a.detach();this.a.removeClass("kjs-removing");I(this,this.a,fb("AnimationEnd"),this.gh);dc(this);this.Ee&&(delete this.Ee,this.bd())};
function ec(a,b){a.parent=b;a.hc=b;a.dispatchEvent("added",b);a.a.addClass("kjs-adding");a.o&&eb(a.a,"adding")&&!a.Qc?H(a,a.a,fb("AnimationEnd"),a.mg):(a.a.removeClass("kjs-adding"),a.dispatchEvent("afterAdding"))}d.mg=function(){this.a.detach();this.a.removeClass("kjs-removing");I(this,this.a,fb("AnimationEnd"),this.mg);dc(this);this.Ee&&(delete this.Ee,this.bd())};d.hh=function(){I(this,this.a,fb("AnimationEnd"),this.hh);this.a.removeClass("kjs-rendering");this.dispatchEvent("afterRendering")};
function dc(a){a.dispatchEvent("removed",a.parent);delete a.parent;delete a.hc}
function fc(a){if(!a.g){a.dispatchEvent("beforeRender");Yb("profile")&&console.time(a.P+" rendering time");a.g=!0;a.a.addClass("kjs-component");a.a.addClass(a.fa);a.a.addClass(a.td);a.a.addClass(a.Fg);a.a.addClass(a.xg);a.a.css(a.Gg);a.Ka&&(a.a.css("margin-top",a.Ka.top),a.a.css("margin-right",a.Ka.right),a.a.css("margin-bottom",a.Ka.bottom),a.a.css("margin-left",a.Ka.left));a.rc&&a.addClass("kjs-inline-block");a.j();null!==a.ua&&a.L(a.ua);null!==a.na&&a.H(a.na);a.Oc(a.Db);a.Pc(a.za);a.me=a.me;if(a.g)if(null==
a.me)a.a.css("max-height",""),a.H(a.na);else{var b=Ya(a.a);a.a.css("max-height",b.top+b.bottom)}b=a.Yc;a.Yc=b;if(a.g)if(null==a.Yc)a.a.css("max-width",""),a.si=null,a.L(a.ua);else{var c=Ya(a.a),c=c.left+c.right;a.si=b-c;a.a.css("max-width",a.si);a.gb=gc(a)-c}a.ia&&a.hide(!0);a.V||a.disable(!0);a.$d(a.rb);b=0;for(c=a.Cb.length;b<c;b++)fc(a.Cb[b]);a.dispatchEvent("render");Yb("profile")&&console.timeEnd(a.P+" rendering time");a.a.addClass("kjs-rendering");eb(a.a,"rendering")&&!a.Qc?H(a,a.a,fb("AnimationEnd"),
a.hh):(a.a.removeClass("kjs-rendering"),a.dispatchEvent("afterRendering"));a.o=!0;a.dispatchEvent("afterRender")}}d.vi=ra;d.j=ra;d.Xe=ra;d.addClass=function(a){this.a.addClass(a)};d.removeClass=function(a){this.a.removeClass(a)};d.hasClass=function(a){return this.a.hasClass(a)};d.Nd=function(){return this.P};d.getName=function(){return this.name};
d.hide=function(a){this.ia&&this.o||(this.ia=!0,this.g&&!this.o&&(this.a.hide(),this.a.addClass("kjs-hidden")),a||this.dispatchEvent("hide"),this.o&&(this.a.removeClass("kjs-showing"),this.a.addClass("kjs-hiding"),eb(this.a,"hiding")&&!this.Qc&&this.o?H(this,this.a,fb("AnimationEnd"),this.Rg):(this.a.hide(),this.a.removeClass("kjs-hiding"),this.a.addClass("kjs-hidden"),this.dispatchEvent("afterHiding"))))};
d.Rg=function(){I(this,this.a,fb("AnimationEnd"),this.Rg);this.a.removeClass("kjs-hiding");this.ia&&(this.a.addClass("kjs-hidden"),this.a.hide());this.dispatchEvent("afterHiding")};
d.show=function(a){if(this.ia||!this.o)this.ia=!1,this.g&&this.a.removeClass("kjs-hidden"),this.o&&(this.a.removeClass("kjs-hiding"),this.a.addClass("kjs-showing"),eb(this.a,"showing")&&!this.Qc?H(this,this.a,fb("AnimationEnd"),this.lh):(this.a.removeClass("kjs-showing"),this.dispatchEvent("afterShowing")),this.a.show()),a||this.dispatchEvent("show")};d.lh=function(){I(this,this.a,fb("AnimationEnd"),this.lh);this.a.removeClass("kjs-showing");this.dispatchEvent("afterShowing")};
d.$d=function(a){this.rb=a;na(this.rb)?this.a.removeAttr("title"):this.a.attr("title",this.rb)};d.find=function(){var a,b;2==arguments.length?(b=arguments[0],a=arguments[1]):a=arguments[0];b=b||"*";if("string"==typeof a)b+="[name="+a+"]";else if("object"==typeof a)for(var c in a)b+="["+c+"="+a[c]+"]";return $(b,this.a)};function hc(a,b){a.Cb.push(b);b.Xc=!0;ec(b,a);a.g&&fc(b)}
d.L=function(a){var b=null,c=null;this.ua!=a&&(c={width:gc(this),height:ic(this)},b=this.ua);this.ua=a;this.g&&(null==this.ua?(this.a.css("width",""),this.gb=null):this.gb=Za(this.a,a),null!==b&&this.dispatchEvent("resize",{width:gc(this),height:ic(this)},c));null!==b&&this.dispatchEvent("widthChange",this.ua,b)};
d.H=function(a){var b=null,c=null;this.na!=a&&(c={width:gc(this),height:ic(this)},b=this.na);this.na=a;this.g&&(null==this.na?(this.a.css("height",""),this.Zb=null):this.Zb=$a(this.a,a),null!==b&&this.dispatchEvent("resize",{width:gc(this),height:ic(this)},c));null!==b&&this.dispatchEvent("heightChange",this.na,b)};
d.Pc=function(a){this.za=a;if(this.g)if(null==this.za)this.a.css("min-width",""),this.Md=null,this.L(this.ua);else{var b=Ya(this.a),b=b.left+b.right;this.Md=a-b;this.a.css("min-width",this.Md);this.gb=gc(this)-b}};d.Oc=function(a){this.Db=a;if(this.g)if(null==this.Db)this.a.css("min-height",""),this.Pe=null,this.H(this.na);else{var b=Ya(this.a),b=b.top+b.bottom;this.a.css("min-height",b);this.Pe=a-b}};function jc(a,b){var c;return null==a.ua&&b?gc(a,c):c?(c=kc(a),a.ua+c.left+c.right):a.ua}
function lc(a,b){var c;return null==a.na&&b?ic(a,c):c?(c=kc(a),a.na+c.top+c.bottom):a.na}function gc(a,b){return a.g?ab(a.a,b):null}function ic(a,b){return a.g?F(a.a,b):null}function kc(a){a.Ka=a.Ka||db(a.a.css("margins"));return a.Ka}d.enable=function(a){this.V=!0;this.a.removeClass("kjs-state-disabled");a||this.dispatchEvent("enabled")};d.disable=function(a){this.V=!1;this.a.addClass("kjs-state-disabled");a||this.dispatchEvent("disabled")};
function mc(){var a=nc;a.addClass("kjs-animations-suspended");a.Qc=!0}d.i=function(){delete $b[this.P];this.wa();for(var a=0;a<this.Cb.length;a++){var b=this.Cb[a];b.Xc=!1;dc(b);B(b)}this.Cb=[];I(this,this.a,"click");I(this,this.a,"dblclick");I(this,this.a,"mousedown");I(this,this.a,"mouseup");I(this,this.a,"mouseenter");I(this,this.a,"mouseleave");bc(this);B(this.a);this.a=null;B(this.mb);this.mb=null;P.b.i.call(this)};function oc(a){a.g&&a.a.append(a.mb)}var $b={};
ga("kjs.ui.Component.Instances",$b);var Zb=pa;function pc(a){pc.b.constructor.call(this);this.D=a||[];this.nb={}}t(pc,G);d=pc.prototype;d.D=null;d.nb=null;d.add=function(a){this.ab(a,this.D.length)};d.remove=function(a){for(var b=!1,c=0;c<this.D.length;c++)if(a===this.D[c]){this.D.splice(c,1);for(var e in this.nb){var b=this.nb[e],f;for(f in b)a.kb(f,b[f])}b=!0;I(this,a,"destroy");this.dispatchEvent("componentRemoved",a);break}return b};
d.ab=function(a,b){this.D.splice(b,0,a);for(var c in this.nb){var e=this.nb[c],f;for(f in e)a.on(f,e[f],this)}H(this,a,"destroy",function(){this.remove(a)},this);this.dispatchEvent("componentAdded",a)};d.get=function(a){return this.D[a]};d.Pa=function(){return this.D.length};d.each=function(a,b){zb(this.D,a,b||this)};function qc(a,b){for(var c=0;c<a.D.length;c++)if(a.D[c].P==b)return a.D[c]}
d.addBehavior=function(a,b,c,e){var f=this.nb[a]=this.nb[a]||{},g=f[b];g&&rc(this,a,b);g=f[b]=sc(a,c,e);a=0;for(c=this.D.length;a<c;a++)e=this.D[a],e.on(b,g,this)};d.indexOf=function(a){var b=this.D;if(b.indexOf)return b.indexOf(a);var c,e=b.length;for(c=0;c<e;c++)if(b[c]===a)return c;return-1};function rc(a,b,c){if(b=a.nb[b])if(b=b[c])for(var e=0,f=a.D.length;e<f;e++)a.D[e].kb(c,b)}function tc(a,b){b?a.D.sort(b):a.D.sort()}
function sc(a,b,c){switch(a){case uc:a=function(a){a.currentTarget=a.target;b.apply(c||a.target,arguments)};break;case vc:a=function(a){for(var f=0,g=this.D.length;f<g;f++){var h=this.D[f];a.currentTarget=h;b.apply(c||h,arguments)}};break;default:a=function(a){for(var f=0,g=this.D.length;f<g;f++){var h=this.D[f];a.currentTarget=h;var k=c||h;h!=a.target&&b.apply(k,arguments)}}}return a}d.i=function(){for(var a in this.nb){var b=this.nb[a],c;for(c in b)rc(this,a,c)}pc.b.i.call(this)};
var vc="ALL",uc="ONE";function wc(a){this.s=new pc;a instanceof P?this.Xf=a.a:this.Xf=a instanceof jQuery?a:$(document.body)}d=wc.prototype;d.oe=1E3;d.s=null;d.Xf=null;function xc(a){tc(a.s,function(a,b){return yc(a)-yc(b)});var b=1E3;a.s.each(function(a){zc(a,b);b++},a);a.oe=b}d.add=function(a){qc(this.s,a.Nd())||(zc(a,this.oe),a.on("removed",function(){this.s.remove()},this),this.s.add(a),this.Xf.append(a.a),this.oe==Number.MAX_VALUE?xc(this):this.oe++,a.Lb("removed",function(){this.s.remove(a)},this))};
d.remove=function(a){qc(this.s,a.Nd())&&bc(a)};d.Hf=function(a,b){var c=-999999999,e=yc(a);this.s.each(function(a){if(a instanceof b){var g=yc(a);g>c&&(c=g);g>e&&zc(a,g-1)}},this);zc(a,c)};Vb=new wc($(document.body));function Ac(a){this.Gf=n(a.lk)?a.lk:Vb;this.target=n(a.target)?a.target:null;this.af=n(a.kj)?a.kj:!1;this.ef=n(a.qj)?a.qj:!0;this.Ae=n(a.vAlign)?a.vAlign:Bc;this.he=n(a.Ga)?a.Ga:Cc;this.oc=n(a.fj)?a.fj:!1;this.la=a.uk||null;this.ug=n(a.gj)?a.gj:Dc;this.a.addClass("kjs-floatable");this.a.css("position","absolute");(this.R=n(a.R)?a.R:M)&&this.R instanceof P?(this.ba=this.R.a,H(this,this.R,"resize",this.yg),this.ef&&(this.target||this.la)&&this.Lb("afterRender",function(){for(var a=this.target?this.target.parent:
this.la.parent;a;)a instanceof Q&&H(this,a,"scroll",function(){this.align()}),a=a.parent})):this.R&&this.R instanceof jQuery?(console.warn("%s is a floating component, and it cannot listen for a resize event on a constrainer that is soley a jQuery object. Try passing in a real component.",this.P),this.ba=this.R):(this.ba=$(document.body),H(this,$(window),"resize",this.yg));Ec(this,this.target);this.oc&&Fc(this,this.la);this.Gf.add(this)}var Bc="none",Cc="none",Dc="right";d=Ac.prototype;d.R=null;
d.target=null;d.ba=null;d.Rd=null;d.pj=!0;d.Gf=null;d.Ec=null;d.Fc=null;d.Ae=null;d.he=null;d.Bg=null;d.Ag=null;d.af=!1;d.ef=!1;d.oc=!1;d.la=null;d.zb=null;d.ug=Dc;d.yg=function(a){this.g&&(this.ef?a.target==this.R&&(this.R instanceof Q?this.R.Lb("afterLayout",function(){this.align()},this):this.align()):this.align())};function Gc(a){a.ba.append(a.a);ab(a.ba);F(a.ba)}
function Hc(a){a.a.addClass("kjs-floatable");a.oc&&(a.w=E({da:"kjs-callout"}),a.w.css("position","absolute"),a.zb=a.la instanceof jQuery?a.la:a.la.a,a.a.addClass("kjs-floatable-callout"));Gc(a);a.Rd&&a.Lb("afterRender",function(){this.oc&&this.a.append(this.w);this.align()},a)}d.align=function(a){this.oc?this.se(this.ug):Ic(this,a)};
function Ic(a,b){b=z(b,{jc:a.Rd,vAlign:a.Ae,Ga:a.he,be:0,ce:0});a.Bg!=b.vAlign&&(a.removeClass("kjs-valign-top-inside"),a.removeClass("kjs-valign-top-outside"),a.removeClass("kjs-valign-bottom-inside"),a.removeClass("kjs-valign-bottom-outside"),a.removeClass("kjs-valign-middle"));a.Ag!=b.Ga&&(a.removeClass("kjs-halign-left-inside"),a.removeClass("kjs-halign-left-outside"),a.removeClass("kjs-halign-right-inside"),a.removeClass("kjs-halign-right-outside"),a.removeClass("kjs-halign-middle"));var c=cb(b.jc,
a.ba),e=ab(b.jc),f=F(b.jc),g=e/2+c.x,h=f/2+c.y,k=lc(a)||F(a.a),l=jc(a)||ab(a.a),u={x:a.Ec,y:a.Fc};switch(b.vAlign){case "topinside":u.y=c.y;a.addClass("kjs-valign-top-inside");break;case "topoutside":u.y=c.y-k;a.addClass("kjs-valign-top-outside");break;case "bottominside":u.y=c.y+f-k;a.addClass("kjs-valign-bottom-inside");break;case "bottomoutside":u.y=c.y+f;a.addClass("kjs-valign-bottom-outside");break;case "middle":u.y=h-k/2,a.addClass("kjs-valign-middle")}switch(b.Ga){case "leftinside":u.x=c.x;
a.addClass("kjs-halign-left-inside");break;case "leftinside":u.x=c.x-l;a.addClass("kjs-halign-left-outside");break;case "rightinside":u.x=c.x+e-l;a.addClass("kjs-halign-right-inside");break;case "rightoutside":u.x=c.x+e;a.addClass("kjs-halign-right-outside");break;case "middle":u.x=g-l/2,a.addClass("kjs-halign-middle")}a.Bg=b.vAlign;a.Ag=b.Ga;null!==u.x&&null!==u.y&&(u.x+=b.be,u.y+=b.ce,a.setPosition(u))}
d.se=function(a){var b,c;this.w.removeClass("kjs-callout-location-top");this.w.removeClass("kjs-callout-location-bottom");this.w.removeClass("kjs-callout-location-left");this.w.removeClass("kjs-callout-location-right");this.xd=a||this.xd;c=lc(this)||F(this.a);b=jc(this)||ab(this.a);var e=F(this.zb),f=ab(this.zb),g=cb(this.zb,this.ba),f=f/2+g.x,e=e/2+g.y,h=g=0;switch(a){default:case "top":this.w.addClass("kjs-callout-location-top");h=this.w.height();g=this.w.width();Ic(this,{vAlign:"topoutside",Ga:this.he&&
this.target!=this.la?Cc:"middle",ce:-h,jc:this.zb});calloutCenterOffset=g/2;b=this.Ec;b=f-calloutCenterOffset-b;this.w.css({width:"",height:"",top:c+"px",right:"",bottom:"",left:b+"px"});break;case Dc:this.w.addClass("kjs-callout-location-right");g=this.w.width();h=this.w.height();Ic(this,{vAlign:this.Ae&&this.target!=this.la?Cc:"middle",Ga:"rightoutside",be:g,jc:this.zb});calloutCenterOffset=h/2;c=this.Fc;c=e-calloutCenterOffset-c;this.w.css({width:"",height:"",top:c+"px",right:b+"px",bottom:"",
left:""});break;case "bottom":this.w.addClass("kjs-callout-location-bottom");g=this.w.width();h=this.w.height();Ic(this,{vAlign:"bottomoutside",Ga:this.he&&this.target!=this.la?Cc:"middle",ce:h,jc:this.zb});calloutCenterOffset=g/2;b=this.Ec;b=f-calloutCenterOffset-b;this.w.css({width:"",height:"",top:"",right:"",bottom:c+"px",left:b+"px"});break;case "left":this.w.addClass("kjs-callout-location-left"),g=this.w.width(),Ic(this,{vAlign:this.Ae&&this.target!=this.la?Cc:"middle",Ga:"leftinside",be:-g,
jc:this.zb}),calloutCenterOffset=h/2,c=this.Fc,c=e-calloutCenterOffset-c,this.w.css({width:"",height:"",top:c+"px",right:"",bottom:"",left:b+"px"})}};function zc(a,b){a.a.css("z-index",b)}function yc(a){return parseInt(a.a.css("z-index"))}function Ec(a,b){b&&a.target==a.la&&Fc(a,b,!0);a.target=b;a.target&&a.target instanceof P?a.Rd=a.target.a:a.target&&a.target instanceof jQuery?a.Rd=a.target:a.Rd=a.ba;a.g&&a.align()}
function Fc(a,b,c){a.la=b||a.target;a.la&&(a.zb=a.la instanceof jQuery?a.la:a.la.a,a.g&&(c||a.align()))}d.setPosition=function(a){var b;!0===this.af?b={top:!0,bottom:!0,right:!0,left:!0}:b=this.af;if(b){var c=lc(this)||F(this.a),e=jc(this)||ab(this.a),f=this.ba.width(),g=this.ba.height();b.top&&0>a.y&&(a.y=0);b.bottom&&a.y+c>g&&(a.y=g-c);b.right&&a.x+e>f&&(a.x=f-e);b.left&&0>a.x&&(a.x=0)}this.Ec=Math.round(a.x);this.Fc=Math.round(a.y);this.a.css({top:this.Fc,left:this.Ec})};
d.Hf=function(a){this.Gf.Hf(this,a)};function R(a){a=z(a,{tag:"button",M:"kjs-button",K:!0});R.b.constructor.call(this,a);this.nc=a.Kd||null;this.ye=a.split||null;this.Ug=a.Dk||Jc;this.Dd=n(a.yj)?a.yj:!1;this.ie=a.Ck||null;this.Gd=a.Ek||null;this.Fd=a.Bk||null;this.fb=a.Cj||"";this.ie&&!this.fb&&(this.fb="kjs-icon kjs-icon-"+this.ie);this.fb||(this.fb="kjs-icon");this.dd=a.text||"";this.Og=n(a.zj)?a.zj:!1;this.xf=a.Lk||null;this.Hg=n(a.Dh)?a.Dh:!1;this.gc=n(a.gk)?a.gk:!1;this.zf=a.Nk||"";this.Bf=a.Qk||this.dd;this.nh=a.ek||this.rb;this.oh=
this.rb;this.Af=a.Pk||this.ie;this.Cc=a.fk||null;this.Af&&!this.Cc&&(this.Cc="kjs-icon kjs-icon-"+this.Af);this.Cc||(this.Cc=this.fb);this.ze=a.Ok||null;this.Mg=n(a.wj)?a.wj:"click";this.hf=a.jb||null;this.Rh=a.scope||null;this.O=this.a;this.on("click",this.Ki);this.on("mousedown",this.Li);this.on("mouseup",this.pf);this.on("mouseenter",this.Mi);this.on("mouseleave",this.Ni);if(this.hf)this.on(this.Mg,this.hf,this.Rh)}t(R,P);N.register("Button",R);var Jc="left";d=R.prototype;d.ye=null;d.nh=null;
d.oh=null;d.Ug=Jc;d.O=null;d.ca=null;d.G=null;d.Ve=null;d.gc=!1;d.Hg=null;d.dd="";d.xf=null;d.Og=!1;d.Bf=null;d.ie="";d.Gd=null;d.Fd=null;d.ze=null;d.Af="";d.fb="";d.Cc="";d.zf="";d.Vc=!1;d.hf=null;d.Mg=null;d.Rh=null;d.nc=null;d.Dd=!1;d.wi=function(a){13!=a.which&&32!=a.which||this.a.addClass("kjs-state-push")};d.xi=function(a){13!=a.which&&32!=a.which||this.a.removeClass("kjs-state-push")};
d.Li=function(){this.V&&(clearTimeout(null),this.V&&(this.a.addClass("kjs-state-push"),this.Vc=!0,H(this,M,"mouseup",this.pf)),this.O.blur())};d.pf=function(){clearTimeout(null);this.a.removeClass("kjs-state-push");this.Vc=!1;I(this,M,"mouseup",this.pf)};d.Mi=function(){if(!this.V)return!1;this.Vc&&this.addClass("kjs-state-push");this.a.addClass("kjs-state-hover");this.dispatchEvent("enter")};
d.Ni=function(){if(!this.V)return!1;this.Vc&&this.removeClass("kjs-state-push");this.a.removeClass("kjs-state-hover");this.dispatchEvent("leave")};d.Ki=function(){if(!this.V)return!1;this.Hg&&Kc(this)};
function Lc(a){a.gc?(a.a.addClass("kjs-state-toggle"),a.a.addClass(a.zf),a.Dd&&(a.ca.removeClass(a.fb).addClass(a.Cc),a.ze&&a.ca.css("background-image",'url("'+a.ze+'")')),a.G.text(a.Bf),a.$d(a.nh)):(a.a.removeClass("kjs-state-toggle"),a.a.removeClass(a.zf),a.Dd&&(a.ze&&a.ca.css("background-image",'url("'+a.Fd+'")'),a.ca.removeClass(a.Cc).addClass(a.fb)),a.G.text(a.dd),a.$d(a.oh))}
d.j=function(){R.b.j.apply(this,arguments);this.nc&&Mc(this,this.nc);this.a.addClass("kjs-unselectable");H(this,this.O,"keydown",this.wi);H(this,this.O,"keyup",this.xi);this.dd||this.a.addClass("kjs-button-no-text");this.G=E({tag:"span",da:"kjs-button-text"});this.O.append(this.G);this.Og&&(this.G.addClass("kjs-bold"),this.G.addClass("kjs-text-big"),this.Ve=E({tag:"span",da:"kjs-button-text"}),this.O.append(Xa()),this.O.append(this.Ve),this.xf&&this.Ve.text(this.xf));if(this.fb||this.Gd||this.Fd||
this.Dd){this.ca=E({da:"kjs-button-icon"});this.fb&&this.ca.addClass(this.fb);this.Gd&&(this.ca.width(this.Gd.width),this.ca.height(this.Gd.height));this.Fd&&this.ca.css("background-image","url("+this.Fd+")");switch(this.Ug){case "top":this.ca.addClass("kjs-element-center");this.O.prepend(this.ca);break;case "right":this.ca.addClass("kjs-inline-block");this.O.append(this.ca);this.O.append(Xa());break;case "bottom":this.ca.addClass("kjs-element-center");this.O.append(this.ca);break;case "left":this.ca.addClass("kjs-inline-block");
this.O.prepend(this.ca);this.O.append(Xa());break;default:this.ca.addClass("kjs-inline-block"),this.O.prepend(this.ca),this.O.append(Xa())}this.Dd=!0}else this.a.addClass("kjs-button-no-icon");"left"==this.ye?this.a.addClass(this.fa+"-split-left"):"right"==this.ye?this.a.addClass(this.fa+"-split-right"):"center"==this.ye&&this.a.addClass(this.fa+"-split-center");Lc(this)};
function Kc(a,b,c){b=w(b)?b:!a.gc;if(b!=a.gc){var e=!0;a.gc=b;!0===c||(e=a.dispatchEvent("toggle",b));!1===e?a.gc=!a.gc:a.g&&Lc(a)}}d.ra=function(a){this.dd=a;!this.g||this.gc&&this.Bf||(this.G.text(this.dd),""==a?this.a.addClass("kjs-button-no-text"):this.a.removeClass("kjs-button-no-text"))};d.show=function(){R.b.show.apply(this,arguments)};d.disable=function(){clearTimeout(null);R.b.disable.call(this);this.O.prop("disabled",!0)};
d.enable=function(){R.b.enable.call(this);this.O.prop("disabled",!1)};function Mc(a,b){a.g&&(a.a.removeClass(a.nc),a.a.addClass("kjs-"+a.nc));a.nc=b}d.L=function(a){R.b.L.call(this,a);Za(this.O,this.gb)};d.H=function(a){R.b.H.call(this,a);$a(this.O,this.Zb)};d.i=function(){B(this.O);B(this.ca);B(this.G);this.G=this.ca=this.O=null;R.b.i.call(this)};function Nc(a){a=a||{};a=z(a,{M:"kjs-input"});Nc.b.constructor.call(this,a);this.C=n(a.value)?a.value:null;this.Th=a.title||"";this.ff=a.Ak||null}t(Nc,P);N.register("PropertyView",Nc);d=Nc.prototype;d.C=null;d.Th="";d.ff=null;d.format=function(a){return null!==this.ff?this.ff(a):a};d.setValue=function(a,b){var c=this.C;this.C=a;this.g&&this.ub(this.C);c==this.C||b||this.dispatchEvent("change",this.C,c)};d.ub=function(){};
d.j=function(){Nc.b.j.apply(this,arguments);this.Lb("afterRender",function(){w(this.C)&&!na(this.C)&&this.setValue(this.C,!0)})};d.getValue=function(){return this.C};d.ra=function(a,b){this.setValue(a+"",b)};d.Ih=function(){return this.Th};function Pc(a){a=z(a,{M:"kjs-statuslabel",K:!0,I:Qc});Pc.b.constructor.call(this,a);this.Uf=a.text||"";this.Uh=n(a.bold)?a.bold:!0;this.Ie=n(a.status)?a.status:Rc;this.on("change",this.yi,this)}t(Pc,Nc);N.register("StatusLabel",Pc);var Rc=0,Qc="left";d=Pc.prototype;d.Uf="";d.Uh=!0;d.Ie=Rc;d.yi=function(){this.ra(this.format(this.c))};
function Sc(a,b){if(1==a.g){switch(a.Ie){case Rc:a.a.removeClass("kjs-statuslabel-neutral");break;case 1:a.a.removeClass("kjs-statuslabel-good");break;case 2:a.a.removeClass("kjs-statuslabel-warning");break;case 3:a.a.removeClass("kjs-statuslabel-error");break;default:a.a.removeClass("kjs-status-"+oldVal)}switch(b){case Rc:a.a.addClass("kjs-statuslabel-neutral");break;case 1:a.a.addClass("kjs-statuslabel-good");break;case 2:a.a.addClass("kjs-statuslabel-warning");break;case 3:a.a.addClass("kjs-statuslabel-error");
break;default:a.a.addClass("kjs-status-"+newVal)}}a.Ie=b}d.ra=function(a){this.Uf=a;this.g&&this.G.html(a)};d.j=function(){Pc.b.j.call(this);this.G=E({tag:"span",da:"kjs-statuslabel-text"});this.a.append(this.G);this.ra(this.Uf);Sc(this,this.Ie);this.Uh&&this.a.addClass("kjs-bold");"right"==this.Tb&&this.a.addClass("kjs-statuslabel-right");"center"==this.Tb&&this.a.addClass("kjs-statuslabel-center")};var Tc=new tb;function Uc(a){a=a||{};Uc.b.constructor.call(this);this.ma=a.vk||null;this.tf=n(a.Ob)?a.Ob:!1;this.xe=n(a.ck)?a.ck:!1}t(Uc,G);d=Uc.prototype;d.ma=null;d.tf=!1;d.xe=!1;d.Ba=function(a){var b=this.ma.xa,c=this.ma,e=this.ma.a.get(0),f=e.offsetWidth-e.clientWidth;this.xe=a;this.nf(c,b);if(a=e.offsetWidth-e.clientWidth-f)for(c.Ta&&(c.Ta+=b.width()+a),b=c.s.D,c=0;c<b.length;c++)a=b[c],a.F&&!this.xe&&a.F()};d.nf=function(a,b){return this.re.call(this,a,b)};
d.re=function(a,b){for(var c=a.s.D,e=0;e<c.length;e++){var f=c[e];this.La(f,e,b);this.yc(f);if(f.Ha&&f.Ha.Gc&!f.rc){var g=f.a,h=b.width(),f=ab(f.a);g.css("position","relative");g.css("left",Math.floor(h/2-f/2)+"px")}}};d.La=function(a,b,c){a=a.a;var e=c.children(".kjs-component");e.index(a)!=b&&(e.length<=b?c.append(a):(c=E(),$(e.get(b)).before(c),c.replaceWith(a)))};d.yc=function(a){a.g||fc(a);a.F&&!this.xe&&a.F()};d.Ob=function(){return this.tf};d.i=function(){this.ma=null;Uc.b.i.call(this)};
J(Tc,Uc,"SimpleLayout");function Vc(a){a=z(a,{Ob:!0});Vc.b.constructor.call(this,a)}t(Vc,Uc);
Vc.prototype.re=function(a,b){for(var c=contentsWidth=a.Ta||0||a.Wb||0,e=contentsHeight=a.qb||0||a.pc||0,f=eastWidth=westWidth=southHeight=0,g=!1,h=a.s.D,k=0;k<h.length;k++){var l=h[k],u=lc(l)||0,y=jc(l)||0,v=kc(l);switch(l.Ha.Zj){case "north":f+=u+v.top+v.bottom;e-=f;break;case "east":eastWidth+=y+v.left+v.right;c-=eastWidth;break;case "south":southHeight+=u+v.top+v.bottom;e-=southHeight;break;case "west":westWidth+=y+v.left+v.right;c-=westWidth;break;case "center":g=!0}}if(!g)throw"Border layout requires center element!";
for(k=0;k<h.length;k++){l=h[k];u=lc(l)||0;y=jc(l)||0;v=kc(l);g={};switch(l.Ha.Zj){case "north":g.top=0;g.left=0;l.H(u);l.L(contentsWidth-v.right-v.left);break;case "east":g.top=f;g.right=0;l.L(y);l.H(e-v.top-v.bottom);break;case "south":g.bottom=0;g.left=0;l.L(contentsWidth-v.right-v.left);l.H(u);break;case "west":g.top=f;g.left=0;l.L(y);l.H(e-v.top-v.bottom);break;case "center":g.top=f,g.left=westWidth,l.L(c-v.left-v.right),l.H(e-v.top-v.bottom)}this.La(l,k,b,g);this.yc(l)}b.width(a.Ta||0);b.height(a.qb||
0)};Vc.prototype.La=function(a,b,c,e){Vc.b.La.call(this,a,b,c);a.a.css("position","absolute");w(e.top)&&a.a.css("top",e.top+"px");w(e.right)&&a.a.css("right",e.right+"px");w(e.bottom)&&a.a.css("bottom",e.bottom+"px");w(e.left)&&a.a.css("left",e.left+"px")};J(Tc,Vc,"BorderLayout");function Wc(a){a=z(a,{Ob:!0});Wc.b.constructor.call(this,a)}t(Wc,Uc);Wc.prototype.La=function(a,b,c){if(0==b){a.Dc=!0;a.Qg=!0;a.a.css("position","absolute");var e,f;f=kc(a);e=(this.ma.Ta||0||this.ma.Wb||0)-(f.left+f.right);f=(this.ma.qb||0||this.ma.Wb||0)-(f.top+f.bottom);a.L(e);a.H(f);Wc.b.La.call(this,a,b,c)}else a.hide()};J(Tc,Wc,"FillLayout");function Xc(a){a=z(a,{Ob:!0});Xc.b.constructor.call(this,a);this.I=n(a.I)?a.I:Yc;this.Hb=n(a.Hb)?a.Hb:Zc}t(Xc,Uc);var Yc="top",Zc="left";d=Xc.prototype;d.I=Yc;d.Hb=Zc;d.Vb=null;d.Sa=null;d.tf=!0;d.jf=!1;d.Bd=null;d.Ub=null;d.cf=null;d.wd=null;d.Xb=0;d.Hd=0;
d.re=function(a,b){var c=a.s.D;this.cf=a.Ta||0||bb(b);this.wd=a.qb||0;this.Vb=[];this.Sa=[];this.Ub=this.cf;this.jf=!1;for(var e=this.Bd=0;e<c.length;e++){var f=c[e],g,h,k;f.Ha=f.Ha||{};g=f.Ha.Eh;h=0;k=f.ia?{top:0,bottom:0,left:0,right:0}:kc(f);this.Vb.push({});this.Sa.push({});!g&&null!==jc(f)||f.rc||(f.Dc=!0);this.wd&&"stretch"==this.I&&(f.Qg=!0,f.H(this.wd-(k.top+k.bottom)));f.Dc&&!f.ia?(g=f.Ha.Eh?f.Ha.Eh:1,this.Bd+=g,this.jf=!0):(jc(f)&&!f.ia&&(h=jc(f)),f.rc&&!f.ia&&(f.a.css("left","0px"),this.La(f,
e,b),this.yc(f),h=jc(f,!0)),h=Math.floor(h),this.Ub-=h+k.left+k.right);this.Sa[e].flex=g;this.Sa[e].width=h;this.Sa[e].margins=k}for(e=0;e<c.length;e++)f=c[e],f.Dc&&null!==f.za&&(g=this.Sa[e].flex,h=g/this.Bd*this.Ub,h<f.za&&(this.Ub-=f.za-h));switch(this.Hb){case "right":this.Xb=this.cf;break;case "center":this.Xb=!0!==this.jf?this.Ub/2:0;break;default:this.Xb=0}for(f=this.Hd=0;f<c.length;f++){g=c[f];e=this.Sa[f].flex;h=this.Sa[f].margins;k=this.Sa[f].width;g.Dc&&!g.ia&&(k=e/this.Bd*this.Ub,null!==
g.za&&(k=Math.max(g.za,k)),null!==g.Yc&&(k=Math.min(g.Yc,k)),k-=h.left+h.right,k=Math.floor(k),g.L(k));"right"==this.Hb&&(this.Xb-=k+h.left+h.right);this.Vb[f].left=Math.floor(this.Xb)+"px";if(this.Hb==Zc||"center"==this.Hb)this.Xb+=k+h.left+h.right;this.La(g,f,b);this.yc(g);e=0;g.ia||(e=lc(g,!0));this.Sa[f].height=e;e+=h.top+h.bottom;this.Hd=e>this.Hd?e:this.Hd}f=this.wd?this.wd:this.Hd;g=a.a.css("min-height");g="auto"==g?0:parseInt(g,10);f=Math.max(f,a.Db||g);b.height(f);for(g=0;g<c.length;g++){h=
c[g];e=this.Sa[g].height;k=this.Sa[g].margins;e+=k.top+k.bottom;switch(this.I){case Yc:this.Vb[g].top="0px";break;case "middle":this.Vb[g].top=(f-e)/2+"px";break;case "bottom":this.Vb[g].bottom=k.bottom+"px";break;case "stretch":this.Vb[g].top="0px"}h.a.css(this.Vb[g])}};d.La=function(a,b,c){a.a.css("position","absolute");Xc.b.La.call(this,a,b,c)};J(Tc,Xc,"HorizontalLayout");function Q(a){a=z(a,{vj:!1});Q.b.constructor.call(this,a);this.s=new pc;this.fe=a.content||null;this.xa=a.mk||null;this.vd=a.W||null;this.Cg=n(a.Kf)?a.Kf:"Component";this.bf=a.wk||null;this.Ea=a.Ba||null;this.Fb=a.padding||null;this.S=a.S||{};this.xa||(this.xa=E().addClass("container-content"));this.a.append(this.xa);this.Ea?q(this.Ea)&&(this.Ea=ub(Tc,this.Ea,[this.S])):this.Ea=new Uc(this.S);this.Ea.ma=this;if(this.fe){var b=this.fe;this.fe=b;$c(this);if(b instanceof P)this.add(b);else if(q(b))this.add(new P({html:$("<div>"+
b+"</div>")}));else if(b instanceof jQuery)this.add(new P({element:b}));else throw Error("Content not a compatible object type for the Container.");}this.vd&&this.vd.length&&this.add(this.vd);q(this.Fb)&&(this.Fb=db(this.Fb));a.vj&&(this.mb=E({da:"kjs-container-gray-mask"}));H(this,this.De(),"scroll",this.zd);this.on("reveal",this.ve,this)}t(Q,P);N.register("Container",Q);d=Q.prototype;d.fe=null;d.xa=null;d.s=null;d.vd=null;d.Ta=null;d.qb=null;d.Wb=null;d.pc=null;d.bf=null;d.Wa=!1;d.hb=0;d.Cg="Component";
d.S=null;d.Ea=null;d.sc=!1;d.Fb=null;d.ve=function(a,b){if(1<a.gg.length){for(var c=a.target,e=this.De(),f=c.a.parent();f.length&&f.get(0)!=e.get(0);)f=f.parent();if(f.get(0)==e.get(0)){var g=c.a,c=this.De(),e=c.height(),f=F(g),g=g.offset(),h=c.offset(),g=g.top-h.top,h=g+f,k=c.scrollTop();b?c.scrollTop(k-(e/2-(g+f/2))):h>e?c.scrollTop(k-(e-h)):0>g&&c.scrollTop(k+g)}}};
d.j=function(){ad(this,!1);this.Fb&&(this.xa.css("padding-top",this.Fb.top),this.xa.css("padding-right",this.Fb.right),this.xa.css("padding-bottom",this.Fb.bottom),this.xa.css("padding-left",this.Fb.left));Q.b.j.apply(this,arguments);bd(this);null!==this.bf&&this.xa.css(this.bf)};d.Xe=function(){Q.b.Xe.call(this);(!this.parent||this.Xc||this.pj)&&this.F()};d.De=function(){return this.a};d.ga=function(a){ad(this);Q.b.ga.apply(this,arguments);bd(this)};
d.wa=function(){ad(this);Q.b.wa.apply(this,arguments);bd(this)};d.F=function(a){if(this.g&&!1!==this.dispatchEvent("layout",a)&&!this.Ge)if(0<cd(this)){a=this;for(var b=0<this.hb?this:null;a.parent;)a=a.parent,0<a.hb&&(b=a);this.Wa&&(b.Wa=!0)}else this.ia||this.pb?this.Wa=!0:(this.sc=!0,this.Ea&&this.Ea.Ba(a),this.sc=this.Wa=!1,this.dispatchEvent("afterLayout",a))};function ad(a,b){a.Wa=w(b)?b:!0;a.hb++}
function bd(a){0<a.hb&&a.hb--;if(0==a.hb&&a.Wa||0>a.hb)a.hb=0,(a.parent&&a.parent instanceof Q&&!a.parent.sc||a==M)&&a.F()}function cd(a){return a.parent?a.hb+cd(a.parent):a.hb}function dd(a,b){var c;if(b instanceof P)c=b;else if(oa(b))c=new P({element:b});else if(jQuery.isPlainObject(b))c=b.type?N.create(b.type,b):N.create(a.Cg,b);else if(q(b))c=N.create(b);else throw"Invalid component, must provide a component or a means to construct a component. (String name, Config Obj, )";return c}
d.add=function(a){this.ab(a,this.s.Pa())};d.ab=function(a,b){p(a)?(ad(this),zb(a,function(a){this.ab(a,b);b++},this),this.F(),bd(this)):a instanceof P?(a.parent&&a.parent.remove(a,!1),this.s.ab(a,b),a.Ja=!0,ec(a,this),this.dispatchEvent({type:"add",bubbles:!0},a,b),this.F()):this.ab(dd(this,a),b)};
d.remove=function(a,b){if(p(a))ad(this),zb(a,function(a){this.remove(a,b)},this),bd(this),this.g&&this.F();else{if(!this.s.remove(a))return!1;ad(this);a.Lb("removed",function(){this.F();bd(this)},this);a.Ja=!1;cc(a,b);this.dispatchEvent({type:"remove",bubbles:!0},a);return!0}};function $c(a,b){for(var c;c=a.s.get(0);)a.s.remove(c),c.Lb("removed",function(){this.s.Pa()||this.F()},a),c.Ja=!1,cc(c,b)}d.contains=function(a){return-1!=this.s.indexOf(a)?!0:!1};
d.show=function(){Q.b.show.call(this);this.Wa&&this.F()};d.L=function(a){Q.b.L.call(this,a);this.Ta=this.gb;this.Ea.Ob()&&this.o&&(this.Ja&&this.parent.sc||this.F())};d.H=function(a){Q.b.H.call(this,a);this.qb=this.Zb;this.Ea.Ob()&&this.o&&(this.Ja&&this.parent.sc||this.F())};d.Pc=function(a){Q.b.Pc.call(this,a);this.Wb=this.Md;this.Ea.Ob()&&this.o&&(this.Ja&&this.parent.sc||this.F())};d.Oc=function(a){Q.b.Oc.call(this,a);this.pc=this.Pe;this.Ea.Ob()&&this.o&&(this.Ja&&this.parent.sc||this.F())};
d.disable=function(){Q.b.disable.call(this);oc(this)};d.enable=function(){Q.b.enable.call(this);this.g&&this.mb.remove()};d.i=function(){$c(this,!0);this.kb("reveal",this.ve);B(this.s);B(this.Ea);Q.b.i.call(this)};function ed(a){a=x(a,{M:"kjs-callout-container"});ed.b.constructor.call(this,a);Ac.call(this,a);this.on("afterLayout",this.Ij,this)}t(ed,Q);ia(ed,Ac);N.register("CalloutContainer",ed);d=ed.prototype;d.Ec=0;d.Fc=0;d.xd=null;
d.j=function(){if(null==this.ba)throw Error("A target element can not be the constrainer for a callout label");ed.b.j.call(this);Hc(this);this.a.css("position","absolute");this.w=E({da:"kjs-callout-container-callout"});this.w.css("position","absolute");this.a.append(this.w);this.Df();H(this,this.ba,"scroll",function(){this.Df();this.se(this.xd)});H(this,window,"resize",function(){this.Df();this.se(this.xd)})};d.Ij=function(){};
d.se=function(a){this.xd=a;var b=lc(this)||F(this.a),c=jc(this)||ab(this.a),e=0,e=0;this.a.removeClass("kjs-callout-label-location-top");this.a.removeClass("kjs-callout-label-location-bottom");this.a.removeClass("kjs-callout-label-location-left");this.a.removeClass("kjs-callout-label-location-right");switch(a){default:case "top":this.a.addClass("kjs-callout-label-location-top");this.w.css({width:c+"px",height:"",top:b+"px",right:"",bottom:"",left:"0px"});e=this.w.height();this.align({vAlign:"topoutside",
Ga:"middle",ce:-e});break;case "right":this.a.addClass("kjs-callout-label-location-right");this.w.css({width:"",height:b+"px",top:"0px",right:c+"px",bottom:"",left:""});e=this.w.width();this.align({vAlign:"middle",Ga:"rightoutside",be:e});break;case "bottom":this.a.addClass("kjs-callout-label-location-bottom");this.w.css("height","auto");this.w.css({width:c+"px",height:"",top:"",right:"",bottom:b+"px",left:"0px"});e=this.w.height();this.align({vAlign:"bottomoutside",Ga:"middle",ce:e});break;case "left":this.a.addClass("kjs-callout-label-location-left"),
this.w.css({width:"",height:b+"px",top:"0px",right:"",bottom:"",left:c+"px"}),e=this.w.width(),this.align({vAlign:"middle",Ga:"leftinside",be:-e})}};d.show=function(){ed.b.show.call(this);this.f||fc(this);this.Df()};d.i=function(){ed.b.i.call(this)};function fd(a){a=z(a,{M:"kjs-toolbar",Kf:"Button"});fd.b.constructor.call(this,a);this.vg=n(a.Gc)?a.Gc:!1}t(fd,Q);N.register("Toolbar",fd);d=fd.prototype;d.vg=!1;d.jd=null;d.kd=null;d.nd=null;d.ld=null;d.od=null;d.md=null;d.pd=null;
d.j=function(){this.xa=$("<table><tbody><tr></tr></tbody></table>").addClass("kjs-toolbar-content");this.jd=this.xa.find("tr");this.kd=$('<td align="left"></td>').addClass("kjs-toolbar-left");this.nd=$('<td align="right"></td>').addClass("kjs-toolbar-right");this.ld=$("<table><tbody><tr></tr></tbody></table>").addClass("kjs-toolbar-left-items");this.od=$("<table><tbody><tr></tr></tbody></table>").addClass("kjs-toolbar-right-items");this.md=this.ld.find("tr");this.pd=this.od.find("tr");this.a.append(this.xa);
this.kd.append(this.ld);this.nd.append(this.od);this.jd.append(this.kd);this.jd.append(this.nd);this.vg&&this.a.addClass("kjs-toolbar-centered");fd.b.j.apply(this,arguments)};
d.F=function(a){if(this.g&&!1!==this.dispatchEvent("layout",a)&&!this.Ge)if(0<this.hb)this.pk&&(this.Wa=!0);else if(this.ia||this.pb)this.Wa=!0;else{for(var b=this.s.D,c=this.md,e=0;e<b.length;e++){var f=b[e],g=f.a;f instanceof gd&&(c=this.pd);var h=$("<td></td>").addClass("kjs-toolbar-item");h.append(g);c.append(h);f.g||fc(f);!a&&f.F&&f.F(a)}this.md.find("td:empty").remove();this.pd.find("td:empty").remove();this.Wa=!1;this.dispatchEvent("afterLayout",a)}};
d.H=function(a){fd.b.H.call(this,a);this.g&&this.na&&this.xa.height(this.Zb)};d.ab=function(a){a instanceof R&&(a.nc||Mc(a,"toolbar-button"));fd.b.ab.apply(this,arguments)};d.i=function(){B(this.jd);B(this.kd);B(this.nd);B(this.ld);B(this.od);B(this.md);B(this.pd);this.pd=this.md=this.od=this.ld=this.nd=this.kd=this.jd=null;fd.b.i.call(this)};function gd(a){gd.b.constructor.call(this,a)}t(gd,P);N.register("RightDelimeter",gd);N.register(">",gd);function hd(a,b){if(!id.hasOwnProperty(arguments[0])){for(var c=id,e=arguments[0],f=arguments[0],g=[],h=[],k=0;f;){if(null!==(g=/^[^\x25]+/.exec(f)))h.push(g[0]);else if(null!==(g=/^\x25{2}/.exec(f)))h.push("%");else if(null!==(g=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(f))){if(g[2]){var k=k|1,l=[],u=g[2],y=[];if(null!==(y=/^([a-z_][a-z_\d]*)/i.exec(u)))for(l.push(y[1]);""!==(u=u.substring(y[0].length));)if(null!==(y=/^\.([a-z_][a-z_\d]*)/i.exec(u)))l.push(y[1]);
else if(null!==(y=/^\[(\d+)\]/.exec(u)))l.push(y[1]);else throw Error("Unexpected error");else throw Error("Unexpected error");g[2]=l}else k|=2;if(3===k)throw Error("Mixing positional and named placeholders is not (yet) supported");h.push(g)}else throw Error("Unexpected error");f=f.substring(g[0].length)}c[e]=h}return jd.call(null,id[arguments[0]],arguments)}var id={};
function jd(a,b){var c=1,e=a.length,f="",g=[],h,k,l,u;for(h=0;h<e;h++)if(f=ba(a[h]),"string"===f)g.push(a[h]);else if("array"===f){l=a[h];if(l[2])for(f=b[c],k=0;k<l[2].length;k++){if(!f.hasOwnProperty(l[2][k]))throw hd('Property "%s" does not exist',l[2][k]);f=f[l[2][k]]}else f=l[1]?b[l[1]]:b[c++];if(/[^s]/.test(l[8])&&"number"!=ba(f))throw hd("Expecting number but found %s",ba(f));switch(l[8]){case "b":f=f.toString(2);break;case "c":f=String.fromCharCode(f);break;case "d":f=parseInt(f,10);break;
case "e":f=l[7]?f.toExponential(l[7]):f.toExponential();break;case "f":f=l[7]?parseFloat(f).toFixed(l[7]):parseFloat(f);break;case "o":f=f.toString(8);break;case "s":f=(f=String(f))&&l[7]?f.substring(0,l[7]):f;break;case "u":f=Math.abs(f);break;case "x":f=f.toString(16);break;case "X":f=f.toString(16).toUpperCase()}f=/[def]/.test(l[8])&&l[3]&&0<=f?"+"+f:f;k=l[4]?"0"==l[4]?"0":l[4].charAt(1):" ";u=l[6]-String(f).length;if(l[6]){for(var y=[];0<u;y[--u]=k);k=y.join("")}else k="";g.push(l[5]?f+k:k+f)}return g.join("")}
;function S(a){a=z(a,{M:"kjs-panel"});S.b.constructor.call(this,a);this.Ed=n(a.Od)?a.Od:!0;this.Na=a.toolbar||null;this.qc=a.rj||!1;this.Me=n(a.title)?a.title:null;this.Ac=a.Kk||null;this.Gb=n(a.selected)?a.selected:!1;this.vf=n(a.mi)?a.mi:!1;this.Tc=n(a.ij)?a.ij:!1;this.Pg=n(a.Aj)?a.Aj:!1;this.pb=n(a.collapsed)?a.collapsed:!1;this.Yb=n(a.Gh)?a.Gh:!0;this.qe=n(a.ki)?a.ki:!0;this.de=n(a.dj)?a.dj:!1;this.$e=n(a.ej)?a.ej:0;this.Ze=a.tk||null;this.eb=a.zk||null;this.Ig=a.Nf||null;this.Jg=n(a.Fh)?a.Fh:
"HorizontalLayout";this.Kg=a.sj||{};p(this.Na)?(this.Na=new fd({W:this.Na,height:null,Gc:!1}),hc(this,this.Na)):this.Na instanceof fd&&hc(this,this.Na);H(this,this.a,"click",this.Ji,this);this.on("afterLayout",this.Jj,this);E({da:this.fa+"-body-mask kjs-mask"})}t(S,Q);N.register("Panel",S);d=S.prototype;d.Me=null;d.Ac=null;d.vf=!1;d.Gb=!1;d.Pg=!1;d.Tc=!1;d.pb=!1;d.Ed=!0;d.Na=null;d.qc=!1;d.Yb=!0;d.qe=!0;d.de=!1;d.$e=0;d.Ze=null;d.aa=null;d.Qb=null;d.lb=null;d.Rb=null;d.rd=null;d.sd=null;d.qd=null;
d.lg=null;d.Sb=null;d.ob=null;d.eb=null;d.Ig=null;d.Kg=null;d.Jg="HorizontalLayout";d.ve=function(a){this.Tc&&this.expand(!0);S.b.ve.apply(this,arguments)};d.Ji=function(a){if(this.ob&&this.ob.a.get(0)===a.target)return!1;var b;this.vf&&!this.Gb?(this.Gb=!0,this.g&&this.a.addClass("kjs-selected"),b=!0):b=!1;b&&this.dispatchEvent({type:"panelSelected",Ik:a,bubbles:!0})};d.zi=function(a,b){b?this.expand():this.collapse()};
d.j=function(){S.b.j.apply(this,arguments);this.qe&&("boolean"==typeof this.qe?this.a.addClass(this.fa+"-bordered"):this.a.css("border",this.qe));this.aa=E().addClass(this.fa+"-body");this.de&&("boolean"==typeof this.de?this.aa.addClass(this.fa+"-body-bordered"):this.aa.css("border",this.de));this.Ze&&this.aa.addClass(this.Ze);this.$e&&this.aa.css("padding",this.$e);this.aa.append(this.xa);this.Qb=E().addClass(this.fa+"-body-wrap");this.Qb.append(this.aa);this.a.append(this.Qb);this.Yb?(this.a.addClass("kjs-framed"),
this.f=Ya(this.aa)):this.a.addClass("kjs-not-framed");this.Na&&(this.Sb=this.Na.a,this.Yb?this.Yb?this.Qb.prepend(this.Sb):this.aa.prepend(this.Sb):this.Qb.prepend(this.Sb),fc(this.Na));this.Tc&&(this.a.addClass("kjs-collapsible"),this.aa.addClass("kjs-collapsible-content"),this.pb&&this.a.addClass("kjs-collapsed"));if(this.Ed){this.lb=E().addClass(this.fa+"-header");this.Rb=E().addClass(this.fa+"-header-wrap");this.rd=E().addClass(this.fa+"-title");this.sd=$("<span/>").addClass(this.fa+"-title-text").addClass("kjs-unselectable");
this.Ac&&(this.qd=this.Ac.a,this.qd.addClass(this.fa+"-status-title").addClass("kjs-unselectable"));this.rd.append(this.sd);this.lb.append(this.rd);this.Ac&&this.lb.append(this.qd);this.Rb.append(this.lb);this.a.prepend(this.Rb);this.Ac&&fc(this.Ac);if(this.Tc)if(this.ob=new R({Dh:!0,J:this.fa+"-collapse-button",Cj:"kjs-button-collapse",fk:"kjs-button-expand",ek:T("Collapse"),Pd:T("Expand")}),this.lb.append(this.ob.a),fc(this.ob),this.pb||Kc(this.ob,!0,!0),this.Pg)H(this,this.Rb,"click",function(){this.pb?
this.expand():this.collapse()}),this.a.addClass(this.fa+"-header-controls-collapse");else this.ob.on("toggle",this.zi,this);this.vf&&(this.addClass("kjs-selectable"),this.Gb&&this.addClass("kjs-selected"));kd(this,this.Me)}else this.a.addClass(this.fa+"-no-header");this.qc&&(this.eb=new Q({J:this.fa+"-footer",W:this.Ig,Ba:this.Jg,S:this.Kg}),this.Qb.append(this.eb.a),hc(this,this.eb));this.V||(oc(this),this.u&&this.u.disable())};d.Jj=function(){this.qc&&this.eb.F()};
function kd(a,b){a.g&&a.sd.html(b);a.Me=b}d.Ih=function(){return this.Me};d.collapse=function(){this.pb||(this.pb=!0,this.g&&(this.Tc&&Kc(this.ob,!1,!0),this.a.addClass("kjs-collapsed")),this.dispatchEvent("collapse"))};d.expand=function(){this.pb&&(this.pb=!1,this.g&&(this.a.removeClass("kjs-collapsed"),this.Tc&&Kc(this.ob,!0,!0)),this.Wa&&this.F(!1),this.dispatchEvent("expand"))};d.De=function(){return this.aa};d.Ej=function(){return this.Gb};
d.disable=function(){!0===this.V&&!0===this.g&&oc(this);S.b.disable.call(this)};d.enable=function(){!1===this.V&&!0===this.g&&this.g&&this.mb.remove();S.b.enable.call(this)};d.i=function(){B(this.ob);B(this.u);B(this.Na);B(this.Ac);B(this.aa);B(this.Qb);B(this.lb);B(this.Rb);B(this.rd);B(this.sd);B(this.qd);B(this.lg);B(this.Sb);this.Sb=this.lg=this.qd=this.sd=this.rd=this.Rb=this.lb=this.Qb=this.aa=null;S.b.i.call(this)};
d.L=function(a){ad(this,!0);S.b.L.call(this,a);this.g&&null!=this.ua?(this.Yb&&(this.Ta-=this.f.left+this.f.right),this.aa.width(this.Ta),this.qc&&(this.eb.L(this.gb),this.eb.F())):this.g&&null==this.ua&&this.aa.css("width","");bd(this)};
d.H=function(a){ad(this,!0);S.b.H.call(this,a);if(this.g&&null!=this.na){var b=a=0,c=0;this.Na&&(a=this.Sb.outerHeight(!0));this.Ed&&(b=this.Rb.outerHeight(!0));this.qc&&(c=this.eb.a.outerHeight(!0));this.qb=this.Yb?this.qb-a-b-c-(this.f.top+this.f.bottom):this.qb-a-b-c;this.aa.height(this.qb)}else this.g&&null==this.na&&this.aa.css("height","");bd(this)};
d.Pc=function(a){ad(this,!0);S.b.Pc.call(this,a);this.g&&null!=this.za?(this.Yb&&(this.Wb-=this.f.left+this.f.right),this.aa.css("min-width",this.Wb),this.qc&&(this.eb.L(this.gb),this.eb.F())):this.g&&null==this.za&&this.aa.css("min-width","");bd(this)};
d.Oc=function(a){ad(this,!0);S.b.Oc.call(this,a);if(this.g&&null!=this.Db){var b=a=0,c=0;this.Na&&(a=this.Sb.outerHeight(!0));this.Ed&&(b=this.Rb.outerHeight(!0));this.qc&&(c=this.eb.a.outerHeight(!0));this.pc=this.Yb?this.pc-a-b-c-(this.f.top+this.f.bottom):this.pc-a-b-c;this.aa.css("min-height",this.pc)}else this.g&&null==this.Db&&this.aa.css("min-height","");bd(this)};function ld(a){a=z(a,{M:"kjs-window"});ld.b.constructor.call(this,a);this.Eg=n(a.draggable)?a.draggable:!1;this.ci=n(a.$a)?a.$a:!0;this.te=n(a.li)?a.li:!0;this.df=n(a.Ch)?a.Ch:!0;this.Zc=n(a.hi)?a.hi:!1;this.wg=n(a.hj)?a.hj:!1;Ac.call(this,a);this.on("mousedown",function(){this.Hf(ld)},this)}t(ld,S);ia(ld,Ac);N.register("Window",ld);d=ld.prototype;d.Eg=!0;d.ci=!0;d.te=!0;d.df=!0;d.Zc=!1;d.wg=!1;d.cb=null;d.ud=null;d.of=null;d.ac=!1;
d.j=function(){Hc(this);ld.b.j.call(this);this.Ed&&(this.Eg&&(H(this,this.lb,"mousedown",this.Fi),this.lb.addClass("kjs-draggable")),this.ci&&(this.ud=new R({J:this.fa+"-button-close",Pd:T("Close")}),this.lb.append(this.ud.a),hc(this,this.ud),fc(this.ud),this.ud.on("click",function(){this.close()},this)));this.Zc&&(this.cb=E({da:"kjs-window-modal-mask",attributes:{style:"position: absolute; top:0px; left:0px; z-index:1;"}}),this.ba.append(this.cb),this.cb.width(ab(this.ba)),this.cb.height(F(this.ba)),
this.Lb("afterRender",function(){md(this)},this),this.a.attr({tabIndex:-1,role:"dialog"}));this.Zc&&H(this,this.R,"resize",function(){this.cb.width(ab(this.ba));this.cb.height(F(this.ba))});this.wg&&H(this,this.R,"mouseup",function(a){if(this.ac){a=a.target.a.get(0);var b=this.a.get(0);$.contains(b,a)||b==a||this.close()}})};d.show=function(){var a=this.ia;ld.b.show.call(this);a&&this.R&&this.R.dispatchEvent("windowShow",this)};
d.hide=function(){var a=this.ia;ld.b.hide.call(this);!a&&this.R&&this.R.dispatchEvent("windowHide",this);this.Zc&&$(document.activeElement).blur()};d.open=function(){this.ac||(this.g?0==this.ac&&1==this.te&&0==this.N?Gc(this):0==this.ac&&0==this.te&&0==this.N&&1==this.ia&&ld.b.show.call(this):fc(this),this.ac=!0,this.Zc&&(this.cb.width(ab(this.ba)),this.cb.height(F(this.ba)),this.ba.append(this.cb),nd(this)),this.R&&this.R.dispatchEvent("windowOpen",this),this.dispatchEvent("open"))};
d.close=function(){this.ac&&!this.N&&(od(this),this.te||this.df?bc(this,this.df):ld.b.hide.call(this))};
function md(a){H(a,a.a,"keydown",function(a){if(9==a.keyCode){var c=this.a.find("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), *[tabindex], *[contenteditable]");$first=c.filter(":first");$last=c.filter(":last");target=a.target;target!=$last[0]&&target!=this.a[0]||a.shiftKey?target!=$first[0]&&target!=this.a[0]||!a.shiftKey||($last.focus(1),a.preventDefault()):($first.focus(1),a.preventDefault())}});H(a,a.cb,"mousedown",function(a){function c(){var a=
document.activeElement;this.a[0]===a||$.contains(this.a[0],a)||nd(this)}a.preventDefault();c.call(this);c.defer(1,this)})}function nd(a){var b=a.a.find("[autofocus]");b.length||(b=a.a.find("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), *[tabindex], *[contenteditable]"));b.length||(b=a.a);b.eq(0).focus()}function od(a){a.ac&&(a.ac=!1,a.Zc&&a.cb.detach(),a.R&&a.R.dispatchEvent("windowClose",a),a.dispatchEvent("close",a))}
d.Fi=function(a){M.yb("mousemove");H(this,M,"mousemove",this.$g);H(this,M,"mouseup",this.di);this.of={x:a.pageX,y:a.pageY};this.Y={x:this.Ec,y:this.Fc};M.addClass("kjs-unselectable")};d.$g=function(a){this.setPosition({x:this.Y.x+(a.pageX-this.of.x),y:this.Y.y+(a.pageY-this.of.y)})};d.di=function(){I(this,M,"mousemove",this.$g);I(this,M,"mouseup",this.di);M.fg("mousemove");M.removeClass("kjs-unselectable")};d.i=function(){od(this);ld.b.i.call(this);this.R.dispatchEvent("windowDestroy",this)};
function pd(a){a=z(a,{zh:T("Confirm"),wh:T("Cancel"),Jf:ra,If:function(){nc.close()},Ah:this,xh:this});var b=x(b,a);delete b.zh;delete b.wh;delete b.Jf;delete b.If;delete b.Ah;delete b.xh;b=z(b,{type:"info",buttons:[{text:a.zh,jb:a.Jf,scope:a.Ah,va:"0 10 0 0"},{text:a.wh,jb:a.If,scope:a.xh,va:"0 0 0 0"}]});return U(b)}
function U(a){q(a)&&(a={text:a,type:"info"});if(!a.title)switch(a.type){case "info":a.title=T("Information");break;case "warning":a.title=T("Warning");break;case "error":a.title=T("Error");break;default:a.title=T("Message")}a=z(a,{buttons:[],hi:!0,Fh:"HorizontalLayout",sj:{I:"middle",Hb:"center"},width:330,minHeight:120,vAlign:"middle",Ga:"middle",rj:!0,li:!0,Ch:!0,jb:function(){nc.close()},type:"info"});if("none"!==a.buttons){var b=a.jb||ra;delete a.jb;a.buttons.length||a.buttons.push({text:T("OK"),
jb:b});a.Nf=[]}a.text&&(a.content=new P({html:a.text,K:!0,va:"5",Hc:{"text-align":"left"},M:"kjs-message"}),a.Ba="CardLayout",a.S={Kb:"centered"},delete a.text);for(b=0;b<a.buttons.length;b++)if(a.buttons[b]instanceof R)a.Nf.push(a.buttons[b]);else if(jQuery.isPlainObject(a.buttons[b])){var c=a.buttons[b];c.Kd="push-button";c.type=c.type||"Button";a.Nf.push(c)}nc&&(mc(),bc(nc,!0),B(nc));nc=new ld(a);nc.addClass("kjs-message-window");nc.on("destroy",function(){nc=null});nc.open();return nc}
var nc=null;var qd=!!{}.hasOwnProperty,rd=function(){var a=null;return function(){null===a&&(a=window.JSON&&"[object JSON]"==JSON.toString());return a}}();function sd(a){return 10>a?"0"+a:a}function td(a){return eval("("+a+")")}
function ud(a){if(w(a)&&null!==a){if(p(a)){var b=["["],c,e,f=a.length,g;for(e=0;e<f;e+=1)switch(g=a[e],typeof g){case "undefined":case "function":case "unknown":break;default:c&&b.push(","),b.push(null===g?"null":vd(g)),c=!0}b.push("]");return b.join("")}if(ma(a))return'"'+a.getFullYear()+"-"+sd(a.getMonth()+1)+"-"+sd(a.getDate())+"T"+sd(a.getHours())+":"+sd(a.getMinutes())+":"+sd(a.getSeconds())+'"';if(q(a))return wd(a);if("number"==typeof a)return isFinite(a)?String(a):"null";if("boolean"==typeof a)return String(a);
c=["{"];for(e in a)if(!a.getElementsByTagName&&(!qd||a.hasOwnProperty(e)))switch(f=a[e],typeof f){case "undefined":case "function":case "unknown":break;default:b&&c.push(","),c.push(ud(e),":",null===f?"null":ud(f)),b=!0}c.push("}");return c.join("")}return"null"}function wd(a){return/["\\\x00-\x1f]/.test(a)?'"'+a.replace(/([\x00-\x1f\\"])/g,function(a,c){var e=m[c];if(e)return e;e=c.charCodeAt();return"\\u00"+Math.floor(e/16).toString(16)+(e%16).toString(16)})+'"':'"'+a+'"'}
var vd=function(){var a;return function(b){a||(a=rd()?JSON.stringify:ud);return a(b)}}(),xd=function(){var a;return function(b){a||(a=rd()?JSON.parse:td);return a(b)}}();function yd(){var a=window.location.protocol+"//"+zd();return D(Wa({type:"GET",url:a+"/api/1/scenarios",dataType:"json",contentType:"application/json",timeout:15E3,cache:!1}).then(function(a){V.X().set("scenarioList",a)}),function(a){-988!=a.status&&U({type:"error",text:T("Cannot cache scenario list!")})})}
function Ad(a){var b=window.location.protocol+"//"+zd();a=vd({scenarioId:a});var c=U({type:"info",text:T("Starting Emulation..."),draggable:!1,$a:!1,buttons:"none"});Sa(D(Wa({type:"POST",url:b+"/api/1/sessions",dataType:"json",contentType:"application/json",data:a}).then(function(a){var b=!0,b=!1,c=Bd(),c="http://localhost"==c?c+"/Trunk/Gocator/GoWeb/EmulatorUI/status-dev.html":c+"/status.html",h=Cd();a="session=%session".replace("%session",a.sessionId);c=h?c+h+"&"+a:c+"?"+a;b&&(b="offline=%offline".replace("%offline",
!0),c=c+"&"+b);window.open(c,"_parent")}),function(a){-988!=a.status&&U({type:"error",text:T("Failed to start emulation!")})}),function(){c.close()})}function Dd(a){Ed(a);return D(Fd(a),function(a){-988!=a.status&&U({type:"error",text:T("Failed to add the scenario!")})})}function Fd(a){return Sa(a.then(function(a){V.X().set("selectedScenarioId",a.id);console.log("new id"+a.id)}),function(){console.log(V.X().get("selectedScenarioId"));return yd()})}
function Ed(a){var b=U({type:"info",text:T("Uploading..."),draggable:!1,$a:!1,buttons:"none"});Sa(a,function(){b.close()})}function Gd(a){var b=window.location.protocol+"//"+zd();return Sa(D(Wa({type:"DELETE",url:b+"/api/1/scenarios/"+a,dataType:"json",contentType:"application/json",timeout:15E3}),function(a){-988!=a.status&&U({type:"error",text:T("Failed to delete scenario!")})}),function(){return yd()})}
function Hd(a,b){var c=window.location.protocol+"//"+zd(),e=vd({name:b});return D(Wa({type:"PUT",url:c+"/api/1/scenarios/"+a,dataType:"json",contentType:"application/json",data:e,jsonp:!1}),function(a){-988!=a.status&&(a=-987==a.status?T("Scenario name already exists!"):T("Failed to rename scenario!"),U({type:"error",text:a}))})}
function Id(a,b){var c=window.location.protocol+"//"+zd(),e=vd({description:b});return D(Wa({type:"PUT",url:c+"/api/1/scenarios/"+a,dataType:"json",contentType:"application/json",data:e,jsonp:!1}),function(a){-988!=a.status&&U({type:"error",text:T("Failed to change scenario description!")})})}
function Jd(){Kd("deferredReload");var a=window.location.protocol+"//"+zd(),b=O.session;Yb("offline");var c=U({type:"info",text:T("Stopping Emulation..."),draggable:!1,$a:!1,buttons:"none"});return Sa(D(Wa({type:"DELETE",url:a+"/api/1/sessions/"+b,dataType:"json",contentType:"application/json",timeout:15E3}).then(function(){U({type:"info",text:T("Emulation stopped."),draggable:!1,$a:!1,buttons:[{text:T("OK"),jb:function(){window.open(a,"_parent")}}]})}),function(b){-988!=b.status&&U({type:"error",
text:T("Failed to stop emulation!"),draggable:!1,$a:!1,buttons:[{text:T("OK"),jb:function(){window.open(a,"_parent")}}]})}),function(){c.close()})}ga("emulator.op.stop",Jd);
function Ld(){Kd("deferredReload");var a=window.location.protocol+"//"+zd(),b=O.session,c=vd({command:"restart"}),e=U({type:"info",text:T("Restarting Emulation..."),draggable:!1,$a:!1,buttons:"none"});return Sa(D(Wa({type:"POST",url:a+"/api/1/sessions/"+b+"/command",dataType:"json",contentType:"application/json",timeout:15E3,data:c}).then(function(){window.open(Md(),"_parent")}),function(b){-988!=b.status&&U({type:"error",text:T("Failed to restart emulation!"),draggable:!1,$a:!1,buttons:[{text:T("OK"),
jb:function(){window.open(a,"_parent")}}]})}),function(){e.close()})}ga("emulator.op.restart",Ld);
function Nd(){var a=O.session,b=window.location.protocol+"//"+zd();return D(Wa({type:"GET",url:b+"/api/1/sessions/"+a,dataType:"json",contentType:"application/json",timeout:15E3,cache:!1}).then(function(a){var b=V.X();b.set("scenarioId",a.scenarioId);b.set("sessionState",a.state);b.set("queuePosition",a.queuePosition);a.state==Od&&(b.set("expiryTimer",a.expiryTimer),b.set("ports.web",a.ports.web),b.set("ports.control",a.ports.control),b.set("ports.health",a.ports.health),b.set("ports.data",a.ports.privateData))}),
function(a){-988!=a.status&&V.X().set("sessionState",Pd)})}function Qd(a){var b=window.location.protocol+"//"+zd();return D(Wa({type:"GET",url:b+"/api/1/scenarios/"+a,dataType:"json",contentType:"application/json",timeout:15E3,cache:!1}).then(function(a){var b=V.X();b.set("scenarioName",a.name);b.set("scenarioSeries",a.series)}),function(a){-988!=a.status&&U({type:"error",text:T("Failed to retrieve scenario information!")})})}
function Rd(){var a=O.session,b=window.location.protocol+"//"+zd();return D(Wa({type:"GET",url:b+"/api/1/sessions/"+a+"/config",dataType:"json",contentType:"application/json",timeout:15E3,cache:!1}).then(function(a){V.X().set("replayProtectionEnabled",a.replayProtectionEnabled)}),function(a){-988!=a.status&&U({type:"error",text:T("Failed to retrieve session configuration!")})})}
function Sd(a,b){var c=window.location.protocol+"//"+zd(),e=vd({replayProtectionEnabled:b});D(Wa({type:"PUT",url:c+"/api/1/sessions/"+a+"/config",dataType:"json",contentType:"application/json",data:e,jsonp:!1}).then(function(){V.X().set("replayProtectionEnabled",b)}),function(a){-988!=a.status&&U({type:"error",text:T("Failed to set replay protection.")})})};function Td(a,b){Td.b.constructor.call(this);this.Ef=a||function(){};this.Rf=b;this.He=!1}t(Td,G);d=Td.prototype;d.Ef=null;d.Rf=null;d.He=!1;d.Fe=function(){this.He||(this.Eb(),this.He=!0)};d.Eb=function(){this.Ef.call(this.Rf)};function Ud(a,b,c){var e;e="change";n(c)?H(a,b,e+"."+c,a.ii):H(a,b,e,a.ii);return a}d.ii=function(){this.Ef.call(this.Rf)};d.i=function(){Td.b.i.call(this);this.He=!1};function Vd(a,b){this.c="messages";W(a)&&(this.c=a);W(b)&&Wd(b);return this}var X={};
function Wd(a){"undefined"==typeof X&&(X={});for(var b in a)if(a.hasOwnProperty(b)&&W(a[b])){var c=!1,e;for(e in a[b]){c=!0;break}if(c){c=a[b];""==b&&(b="messages");W(X[b])||(X[b]={});W(X[b].head)||(X[b].head={});W(X[b].Vd)||(X[b].Vd={});for(var f in c)if(""==f){var g=c[f],h;for(h in g)X[b].head[h.toLowerCase()]=g[h]}else X[b].Vd[f]=c[f]}}for(b in X)if(W(X[b].head["plural-forms"])&&"undefined"==typeof X[b].head.Xd)if(a=X[b].head["plural-forms"],/^(\s*nplurals\s*=\s*[0-9]+\s*;\s*plural\s*=\s*(?:\s|[-\?\|&=!<>+*/%:;a-zA-Z0-9_()])+)/m.test(a))a=
X[b].head["plural-forms"],/;\s*$/.test(a)||(a=a.concat(";")),X[b].head.Xd=new Function("n","var plural; var nplurals; "+a+' return { "nplural" : nplurals, "plural" : (plural === true ? 1 : plural ? plural : 0) };');else throw Error("Syntax error in language file. Plural-Forms header is invalid ["+a+"]");else"undefined"==typeof X[b].head.Xd&&(X[b].head.Xd=function(a){return{nplural:2,plural:1!=a?1:0}})}
function Xd(a,b){for(var c={},e={},f="",g=[],h=a.split("\n"),k=0;k<h.length;k++){h[k]=h[k].replace(/(\n|\r)+$/,"");var l;if(/^$/.test(h[k])){if("undefined"!=typeof e.msgid){var f="undefined"!=typeof e.msgctxt&&e.msgctxt.length?e.msgctxt+"\u0004"+e.msgid:e.msgid,u="undefined"!=typeof e.msgidPlural&&e.msgidPlural.length?e.msgidPlural:null,y=[],v;for(v in e)if(l=v.match(/^msgstr_(\d+)/))y[parseInt(l[1])]=e[v];y.unshift(u);1<y.length&&(c[f]=y);e={};f=""}}else/^#/.test(h[k])||((l=h[k].match(/^msgctxt\s+(.*)/))?
(f="msgctxt",e[f]=Yd(l[1])):(l=h[k].match(/^msgid\s+(.*)/))?(f="msgid",e[f]=Yd(l[1])):(l=h[k].match(/^msgid_plural\s+(.*)/))?(f="msgid_plural",e[f]=Yd(l[1])):(l=h[k].match(/^msgstr\s+(.*)/))?(f="msgstr_0",e[f]=Yd(l[1])):(l=h[k].match(/^msgstr\[0\]\s+(.*)/))?(f="msgstr_0",e[f]=Yd(l[1])):(l=h[k].match(/^msgstr\[(\d+)\]\s+(.*)/))?(f="msgstr_"+l[1],e[f]=Yd(l[2])):/^"/.test(h[k])?e[f]+=Yd(h[k]):g.push("Strange line ["+k+"] : "+h[k]))}if("undefined"!=typeof e.msgid){f="undefined"!=typeof e.msgctxt&&e.msgctxt.length?
e.msgctxt+"\u0004"+e.msgid:e.msgid;u="undefined"!=typeof e.msgidPlural&&e.msgidPlural.length?e.msgidPlural:null;y=[];for(v in e)if(l=v.match(/^msgstr_(\d+)/))y[parseInt(l[1])]=e[v];y.unshift(u);1<y.length&&(c[f]=y)}if(c[""]&&c[""][1]){e={};h=c[""][1].split(/\\n/);for(k=0;k<h.length;k++)h.length&&(v=h[k].indexOf(":",0),-1!=v?(l=h[k].substring(v+1),v=h[k].substring(0,v).toLowerCase(),e[v]&&e[v].length?g.push("SKIPPING DUPLICATE HEADER LINE: "+h[k]):/#-#-#-#-#/.test(v)?g.push("SKIPPING ERROR MARKER IN HEADER: "+
h[k]):(l=l.replace(/^\s+/,""),e[v]=l)):(g.push("PROBLEM LINE IN HEADER: "+h[k]),e[h[k]]=""));c[""]=e}else c[""]={};g={};c&&(c[""]||(c[""]={}),c[""].domain||(c[""].domain=b||""),b=c[""].domain,g[b]=c,Wd(g))}function Yd(a){var b;if(b=a.match(/^"(.*)"/))a=b[1];return a=a.replace(/\\"/g,'"')}function W(a){return null==a?!1:"undefined"==typeof a?!1:!0}Vd.prototype.c=void 0;
function Y(a,b){var c=Zd;if(!W(b))return"";var e=W(void 0),f=W(a)?a+"\u0004"+b:b,g=W(null)?null:W(c.c)?c.c:"messages",c=[];if("undefined"!=typeof X&&W(X[g]))c.push(X[g]);else if("undefined"!=typeof X)for(var h in X)c.push(X[h]);h=[];var g=!1,k;if(c.length)for(var l=0;l<c.length;l++){var u=c[l];if(W(u.Vd[f])){for(k=0;k<u.Vd[f].length;k++)h[k]=u.Vd[f][k];h.shift();k=u;g=!0;if(0<h.length&&0!=h[0].length)break}}if(0==h.length||0==h[0].length)h=[b,void 0];f=h[0];e&&(g&&W(k.head.Xd)?(e=k.head.Xd(void 0),
e.Qe||(e.Qe=0),e.ji||(e.ji=0),e.ji<=e.Qe&&(e.Qe=0),e=e.Qe):e=1,W(h[e])&&(f=h[e]));return f};function $d(a,b,c,e,f,g,h){if(/[;=\s]/.test(a))throw Error('Invalid cookie name "'+a+'"');if(!navigator.cookieEnabled)throw Error("Cookies are not enabled");b=a+"="+escape(b);var k=f?";domain="+f:"",l=e?";path="+e:"",u=g?";secure":"",y=!1,v;void 0==c?v="":(0>=c?(y=!0,v=new Date,v.setTime(v.getTime()-1)):(v=new Date,v.setTime(v.getTime()+1E3*c)),v=";expires="+v.toUTCString());var Oc=ae(a);document.cookie=b+k+l+v+u;if(!h&&!y&&4093<document.cookie.length+10)throw n(Oc)?$d(a,Oc,c,e,f,g,!0):(ae(a),$d(a,
"",0,e,f)),Error("Total cookie string length exceeds max size");}function ae(a){if(a=document.cookie.match("(^|;) ?"+a+"=([^;]*)(;|$)"))return unescape(a[2])};var be="application",ce=null,de=null,Zd=null;function ee(){var a=fe,b=be,c;c=null;for(var e=0;e<de.length;e++)a==de[e].locale&&(c=de[e]);if(c){a=c.href+"/"+b+".po?version="+ha;c=c.href+"/i18n.js?version="+ha;var e=Va(c),f=Va(a);if(!e)throw Error("Loading 'locale info file' failed. Unable to exec xmlhttprequest for link ["+c+"]");ce=xd(e);if(!f)throw Error("Loading 'locale langauge file' failed. Unable to exec xmlhttprequest for link ["+a+"]");Xd(f,b)}}
function ge(){return null!=ce?ce.language+"-"+ce.country:"en-US"}function T(a){return Y(void 0,a)}
for(var he=[],ie=document.getElementsByTagName("link"),je=0;je<ie.length;je++){var ke=ie[je];if("i18n"==ke.rel){var le=ke.getAttribute("name");if(!le)throw Error("LINK tag found with rel=i18n but no name attribute found");if("Domain"==le)be=ke.getAttribute("data-domain");else{var me=ke.getAttribute("locale");if(!me)throw Error("LINK tag found with rel=i18n but no locale attribute found");if(!ke.href)throw Error("LINK tag found with rel=i18n but no href attribute found");if(ke.hasAttribute("shortname")){var ne=
ke.getAttribute("shortname");he.push({locale:me,name:le,shortname:ne,href:ke.href})}else he.push({locale:me,name:le,href:ke.href})}}}var de=he,Zd=new Vd(be),fe=O.l;if("custom"==fe&&window.sessionStorage){var oe;var pe=be,qe;(qe=sessionStorage.getItem("customPo"))?(ce={language:"custom",country:"custom"},Xd(qe,pe),console.log("we loaded from session"),oe=!0):oe=!1;oe||((fe=ae("locale"))||(fe="en-US"),ee())}else fe||(fe=ae("locale")),fe||(fe="en-US"),ee();function re(a){a=z(a,{K:!0,M:"kjs-label",I:se});re.b.constructor.call(this,a);this.Tf=a.text||"";this.Sh=n(a.bold)?a.bold:!1;this.Cd=a.tj||null}t(re,P);N.register("Label",re);var se="left";d=re.prototype;d.Sh=!1;d.Cd=null;d.Tf="";
d.j=function(){re.b.j.call(this);this.c=E({tag:"label"});this.Sh&&this.a.addClass("kjs-bold");"right"==this.Tb&&this.a.addClass("kjs-text-right");"center"==this.Tb&&this.a.addClass("kjs-text-center");this.Cd&&(this.on("click",function(){$b[this.Cd].dispatchEvent("labelClick")},this),this.on("mousedown",function(){$b[this.Cd].dispatchEvent("labelMousedown")},this),this.on("mouseup",function(){$b[this.Cd].dispatchEvent("labelMouseup")},this));this.a.append(this.c);this.ra(this.Tf)};
d.H=function(a){re.b.H.call(this,a);this.g&&this.c.css("height",a+"px")};d.ra=function(a){this.g&&this.c.html(a);this.Tf=a};function te(a){a=a||{};a=z(a,{M:"kjs-formitem",Jc:{},Se:{},Qd:!0,S:{},cg:"left",ig:"left",Bj:"middle"});this.Lg=a.Ld||[];this.mf=a.label||null;this.Yf=a.Oe||null;this.ed=a.Jc||null;this.Cf=a.Rk||null;this.$f=a.hk||null;this.fd=a.Se||null;this.Wh=a.Qd||null;this.Zf=a.S||null;this.Xh=a.cg||null;this.Tg=a.Bj||null;this.Yh=a.ig||null;var b=[];if(this.mf||this.Yf||this.ed){var c={text:A(this.ed.text,this.mf),width:A(this.ed.width,this.Yf),I:A(this.ed.I,this.Xh)},c=z(c,this.ed);if(c.text||c.width)this.Zg=
new re(c),b.push(this.Zg)}b.push(this.Lg);if(this.Cf||this.$f||this.fd)if(c={text:A(this.fd.text,this.Cf),width:A(this.fd.width,this.$f),I:A(this.fd.I,this.Yh)},c=z(c,this.fd),c.text||c.width)this.ph=new re(c),b.push(this.ph);var e;this.Wh?(c="HorizontalLayout",e={I:this.Tg}):(c="SimpleLayout",e={});this.Zf&&(e=z(e,this.Zf));a=qa(a,{Ba:c,S:e,J:"kjs-formitem",W:b});te.b.constructor.call(this,a)}t(te,Q);N.register("FormItem",te);d=te.prototype;d.Lg=null;d.mf=null;d.Yf=null;d.ed=null;d.Zg=null;
d.Cf=null;d.$f=null;d.fd=null;d.ph=null;d.Wh=null;d.Zf=null;d.Xh=null;d.Yh=null;d.Tg=null;var ue=new tb;function ve(){}ve.prototype.Z=function(){};function we(a,b,c){w(c)&&null!==c||(c="");return 0<b||!0===b?Eb(c,a):new Cb(b,c,a)}J(ue,ve,"BaseValidator");function xe(){xe.b.constructor.call(this);this.c=[]}t(xe,ve);xe.prototype.c=null;xe.prototype.Z=function(a){xe.b.Z(a);for(var b=0;b<this.c.length;b++){var c=this.c[b];if(!a.match(c.Yj))return we(this,0,c.message)}return we(this,Fb,"")};function ye(a,b,c){a.c.push({Yj:b,message:c})}J(ue,xe,"RegExValidator");function ze(){ze.b.constructor.call(this);ye(this,Ae,Y("ValidationMessage","Please choose only alphanumeric characters - [a-z] OR [0-9]."))}t(ze,xe);var Ae=/^[a-zA-Z0-9]*$/;J(ue,ze,"AlphanumericValidator");function Be(){Be.b.constructor.call(this);ye(this,Ce,Y("ValidationMessage","Your input does not match the format of an IP address: [0-255].[0-255].[0-255].[0-255]."));ye(this,De,Y("ValidationMessage","Your input does not match the format of an IP address: [0-255].[0-255].[0-255].[0-255]."))}t(Be,xe);var Ce=/^((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})$/,De=/^[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*/;J(ue,Be,"IpAddressValidator");function Ee(a,b){this.min=A(a,this.min);this.max=A(b,this.max);Ee.b.constructor.call(this)}t(Ee,ve);Ee.prototype.max=null;Ee.prototype.min=null;Ee.prototype.Z=function(a){Ee.b.Z(a);var b=1,c="";na(a)&&(b=Fe,c=Ge);la(a)||(b=He,c=Ie);a=parseFloat(a);null!=this.min&&a<this.min&&(b=Je,c=Ke.replace("%min",this.min));null!=this.max&&a>this.max&&(b=Le,c=Me.replace("%max",this.max));return we(this,b,c)};
var Fe=-1,Le=-2,Je=-3,He=-4,Ge=Y("ValidationMessage","A value is required."),Me=Y("ValidationMessage","Your input value has exceeded the maximum of %max"),Ke=Y("ValidationMessage","Your input value is less than the minimum of %min."),Ie=Y("ValidationMessage","Your input value is not numeric. Please enter a numeric value for your input.");J(ue,Ee,"MinMaxValidator");function Ne(a,b,c,e){this.Qf=A(a,this.Qf);this.dg=A(b,this.dg);this.Pf=A(c,this.Pf);this.Be=A(e,this.Be);Ne.b.constructor.call(this)}t(Ne,ve);d=Ne.prototype;d.Qf=!1;d.dg=!1;d.Pf=!1;d.Be=!1;d.Z=function(a){var b=1,c="";Ne.b.Z(a);this.Be||null!==a||(b=Oe,c=Pe.qk);null===a||this.Be||(na(a)&&(b=Qe,c=Re),la(a)||(b=Se,c=Te),this.Qf&&/\./.test(a.toString())&&la(a)&&(b=Ue,c=Ve),this.dg&&0>parseFloat(a)&&(b=We,c=Xe),!this.Pf&&a.toString().match(/^0(?!\.)[0-9]/)&&(b=Ye,c=Ze));return we(this,b,c)};
var Oe=-1,Qe=-2,Se=-3,Ue=-4,We=-5,Ye=-6,Te=Y("ValidationMessage","Your input value is not numeric. Please enter a numeric value for your input."),Ve=Y("ValidationMessage","Your input value is not an integer. Please enter a whole number for an input."),Xe=Y("ValidationMessage","Your input value is negative. Please enter a number greater than or equal to 0."),Re=Y("ValidationMessage","A value is required."),Ze=Y("ValidationMessage","Input cannot contain leading zeros."),Pe={};J(ue,Ne,"NumericValidator");function $e(a){a=z(a,{M:"kjs-input"});$e.b.constructor.call(this,a);this.sa=a.sa||null;this.Uc=a.xk||null;this.Ne=n(a.jk)?a.jk:!0;this.sa||(this.sa=[]);p(this.sa)||(this.sa=[this.sa]);this.Uc&&(p(this.Uc)||(this.Uc=[this.Uc]),this.sa=this.sa.concat(this.Uc));for(a=0;a<this.sa.length;a++){var b=this.sa[a];if(q(b))this.sa[a]=ub(ue,b);else if(jQuery.isPlainObject(b)&&b.type)this.sa[a]=ub(ue,b.type,b.rk);else if(!(b instanceof Function||b instanceof ve))throw"Invalid validator "+(a+1)+" of "+(this.sa.length+
1);}}t($e,Nc);N.register("Input",$e);d=$e.prototype;d.sa=null;d.Ne=!0;d.Uc=null;d.ag=null;d.setValue=function(a,b){var c=this.C;this.C=a;this.g&&this.ub(this.C);c!==this.C&&this.Ne&&this.Z(b);c===this.C||b||this.dispatchEvent("change",this.C,c)};
d.Z=function(a){var b=Eb();if(this.sa)for(var c=this.getValue(),e=0;e<this.sa.length;e++)if(b=this.sa[e],b instanceof Function){if(b=b(c),!(b instanceof Cb))if(!1===b)var f=b=void 0,b=b||"",f=f||{},b=new Cb(0,b,f);else b=Eb()}else if(b=b.Z(c),!b.ka())break;c=b;e=this.Ib();this.ag=c;(f=this.Ib())?(this.a.removeClass("kjs-state-error"),e==f||a||this.dispatchEvent({type:"valid",bubbles:!0},c)):(this.a.removeClass("kjs-state-error"),this.a.addClass("kjs-state-error"),a||this.dispatchEvent({type:"invalid",
bubbles:!0},c));return b.ka()};d.Ib=function(){return!this.Ne||!this.ag||this.ag.ka()};function af(a){a=z(a,{M:"kjs-checkbox",K:!0,value:!1});af.b.constructor.call(this,a);this.Jb=E({tag:"button",da:"kjs-checkbox-focusable",attributes:{type:"text"}});this.Jb.css({position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px","z-index":"-1"});this.on("click",this.ee);this.on("mousedown",this.ah);this.on("labelClick",this.ee);this.on("labelMousedown",this.ah)}t(af,$e);N.register("Checkbox",af);d=af.prototype;d.Jb=null;
d.j=function(){af.b.j.call(this);H(this,this.Jb,"focus",this.Lj);H(this,this.Jb,"blur",this.Kj);H(this,this.Jb,"keydown",this.Mj);H(this,this.Jb,"keyup",this.Ei);this.a.append(this.Jb)};d.Lj=function(){this.addClass("kjs-focus")};d.Kj=function(){this.removeClass("kjs-focus")};d.Mj=function(a){13!=a.which&&32!=a.which||this.a.addClass("kjs-state-push")};d.Ei=function(a){13!=a.which&&32!=a.which||this.a.removeClass("kjs-state-push")};
d.ee=function(){this.V&&this.setValue(!this.a.hasClass("kjs-state-checked"),void 0)};d.ah=function(){this.V&&(this.Vc=!0,this.addClass("kjs-state-push"),H(this,M,"mouseup",this.bh))};d.bh=function(){this.V&&(this.Vc=!1,this.removeClass("kjs-state-push"),I(this,M,"mouseup",this.bh))};d.ub=function(a){a?this.a.addClass("kjs-state-checked"):this.a.removeClass("kjs-state-checked")};d.disable=function(){af.b.disable.call(this);this.o&&this.Jb.prop("disabled",!0)};
d.enable=function(){af.b.enable.call(this);this.o&&this.Jb.prop("disabled",!1)};function bf(a){a=z(a,{name:"Emulation Control Toolbar",id:"ControlToolbar",J:"emulator-control-toolbar",S:{I:"middle"}});bf.b.constructor.call(this,a);this.jg=new re({text:T("Gocator Emulator"),J:"gocator-model-label",K:!1,va:"0 0 0 0"});this.f=new Pc({va:"0 5 0 0"});a=new re({text:T("Replay Protection"),K:!1,bold:!0});this.u=new af({va:"0 5 0 0"});this.hg=new Q({width:150,Ba:"HorizontalLayout",S:{I:"middle",Hb:Zc},W:[this.u,a]});this.Y=new R({Kd:"push-button",J:"emulator-restart-button",text:T("Restart Emulation"),
Pd:T("Restart Emulation")});this.Pb=new R({Kd:"push-button",J:"emulator-stop-button",text:T("Stop Emulation"),Pd:T("Stop Emulation"),va:"0 0 0 5"});this.add([this.jg,">",this.f,this.hg,this.Y,this.Pb]);Sc(this.f,3);this.f.hide()}t(bf,fd);N.register("ControlToolbar",bf);d=bf.prototype;d.i=function(){B(this.jg);B(this.f);B(this.u);B(this.Pb);B(this.Y);bf.b.i.call(this)};
d.ja=function(){this.h=V.X();H(this,this.u,"change",this.Oi);this.hg.hide();cf(this);df(this);H(this,this.h,"change.replayProtectionEnabled",function(){df(this)});H(this,this.Pb,"click",function(){Jd()});H(this,this.Y,"click",function(){Ld()});Xb(this,Ud(new Td(this.aj,this),this.h,"expiryTimer"))};d.ta=function(){I(this,this.u,"change");I(this,this.h,"change.replayProtectionEnabled");I(this,this.Pb,"click");I(this,this.Y,"click");this.h=null};
function df(a){var b=a.h.get("replayProtectionEnabled");a.u.setValue(!!b,!0)}d.Oi=function(){var a=O.session,b=this.h.get("replayProtectionEnabled"),c=new Ta;if(b)var e=pd({text:T("Replay protection prevents replay data being cleared by changes. Are you sure you want to disable it?"),Jf:function(){c.xb();e.close()},If:function(){c.reject(new Ab(-988));e.close()},$a:!1,draggable:!1});else c.xb();D(c.then(function(){Sd(a,!b)},this),function(){df(this)},this)};
d.aj=function(){var a=this.h.get("expiryTimer");if(-1!=a)if(0<=a&&300>=a){var b=Math.floor(a/60),c=a%60,b=T("Time Remaining")+": "+(10>b?"0"+b:b)+":"+(10>c?"0"+c:c);this.f.ra(b);this.f.show();60==a&&U({type:"warning",text:hd(T("Your session is about to expire in %s seconds due to inactivity."),a)});if(0==a){Kd("deferredReload");var e=window.location.protocol+"//"+zd();U({type:"warning",text:hd(T("Session expired due to inactivity."),a),draggable:!1,$a:!1,buttons:[{text:T("OK"),jb:function(){window.open(e,
"_parent")}}]})}}else this.f.hide()};function cf(a){window.addEventListener("message",function(b){console.warn("post from Gocator "+b.origin);switch(b.data){case "showReplayProtect":a.hg.show()}},!1)};function ef(a){a=x(a,{tag:"iframe"});ef.b.constructor.call(this,a);this.c=a.url||""}t(ef,P);N.register("Iframe",ef);ef.prototype.c=null;ef.prototype.j=function(){ef.b.j.call(this);this.a.attr("src",this.c)};function ff(a){a=x(a,{name:"Emulation Control Container",id:"ControlContainer",Ba:"FillLayout"});ff.b.constructor.call(this,a);this.f=new bf;var b=V.X().get("ports.web");a=V.X().get("ports.control");var c=V.X().get("ports.health"),e=V.X().get("ports.data"),b=window.location.protocol+"//"+window.location.hostname+":"+b;a="control=%control".replace("%control",a);var c="health=%health".replace("%health",c),e="data=%data".replace("%data",e),f="emuhost=%emuhost".replace("%emuhost",window.location.port),
g="l=%lang".replace("%lang",ge()),h="firstPage=%firstPage".replace("%firstPage","measure"),k="ui=%ui".replace("%ui",1),b=b+"/?"+g+"&"+h+"&"+k+"&"+a+"&"+c+"&"+e+"&"+f;(a=gf())&&(b=b+"&"+a);a=new ef({width:window.innerWidth||document.documentElement.clientWidth,va:"0 0 0 0",url:b});c=new S({name:"Main Panel",id:"MainPanel",Gh:!1,ki:!1,Od:!1,J:"main-panel",toolbar:this.f,Ba:"FillLayout"});c.add(a);this.add(c)}t(ff,Q);N.register("ControlContainer",ff);ff.prototype.i=function(){B(this.f);ff.b.i.call(this)};
ff.prototype.ja=function(){this.f.ga()};ff.prototype.ta=function(){this.f.wa()};function hf(a){a=z(a,{M:"kjs-form",Kf:"FormItem",S:{},W:[]});this.$h=a.Oe||null;this.Ke=a.Jc||{};this.bi=a.hk||null;this.Le=a.Se||{};this.Je=n(a.Qd)?a.Qd:!0;this.Pb=a.S||{};this.Zh=n(a.cg)?a.cg:"left";this.ai=n(a.ig)?a.ig:"left";this.vd=a.W||[];this.Ke=z(this.Ke,{width:this.$h,K:this.Je,I:this.Zh});this.Le=z(this.Le,{width:this.bi,K:this.Je,I:this.ai});for(var b=0;b<a.W.length;b++){var c=a.W[b];jQuery.isPlainObject(c)&&(componenent=jf(this,c))}hf.b.constructor.call(this,a)}t(hf,Q);
N.register("Form",hf);d=hf.prototype;d.Je=!0;d.$h=null;d.bi=null;d.Zh=null;d.ai=null;d.Ke=null;d.Le=null;d.j=function(){hf.b.j.call(this)};function jf(a,b){b=z(b,{minHeight:null,Jc:{},Se:{},Qd:a.Je,S:{}});z(b.Jc,a.Ke);z(b.Se,a.Le);z(b.S,a.Pb);return b}d.ab=function(a,b){!jQuery.isPlainObject(a)||a.type&&"FormItem"!=a.type||(a=jf(this,a));hf.b.ab.call(this,a,b)};function kf(a,b){if("object"==typeof a)return lf(a);this.title=A(a,"");this.value=A(b,"")}function lf(a){var b=new kf(a.title,a.value);return b=$.extend(b,a)}kf.prototype.title=null;kf.prototype.value=null;kf.prototype.Lf=function(a){return this==a||this.title==a.title&&this.value==a.value};function mf(a){a=a||{};mf.b.constructor.call(this,a);this.v=a.options||[];this.Fa=a.Jk||null;for(a=0;a<this.v.length;a++)this.v[a]instanceof kf||(this.v[a]=lf(this.v[a]));this.C||!this.v.length||this.Fa||(this.Fa=null)}t(mf,$e);N.register("OptionsInput",mf);d=mf.prototype;d.Ya="title";d.Za="value";d.oa=null;d.bg=null;d.v=null;d.Fa=null;d.ja=function(a,b){mf.b.ja.apply(this,arguments);!this.bg&&b&&nf(this,b)};
function nf(a,b){a.oa=a.oa||{};a.bg=b;H(a,b,"add",a.Nj);H(a,b,"remove",a.Oj);a.bg.each(function(a){this.oa[a.Aa]=this.ad({title:a.get(this.Ya),value:a.get(this.Za)});H(this,a,"change."+this.Ya,this.bc);H(this,a,"change."+this.Za,this.cc)},a)}d.Nj=function(a,b,c){this.oa[c.Aa]=this.bb({title:c.get(this.Ya),value:c.get(this.Za)},b);H(this,c,"change."+this.Ya,this.bc);H(this,c,"change."+this.Za,this.cc)};
d.Oj=function(a,b){this.Nb(this.oa[b.Aa]);delete this.oa[b.Aa];I(this,b,"change."+this.Ya,this.bc);I(this,b,"change."+this.Za,this.cc)};d.bc=function(a,b){this.oa[a.target.Aa].title=b};d.cc=function(a,b){this.oa[a.target.Aa].value=b};d.j=function(){mf.b.j.call(this)};d.getOption=function(a){return this.v[a]};d.Hh=function(){return this.v};d.Of=function(a){for(var b=0;b<this.v.length;b++)if(this.v[b].value==a)return this.v[b]};d.ae=function(a,b){this.Mb(b);for(var c=0;c<a.length;c++)this.ad(a[c])};
d.ad=function(a){return this.bb(a,this.v.length)};d.Nb=function(a){for(var b,c=0;c<this.v.length;c++)if(this.v[c]==a){this.v.splice(c,1);b=c;break}this.Fa==a&&(this.Fa=null,this.setValue(null));return b};d.bb=function(a,b){if(b>this.v.length||0>b)throw"Index out of range.";var c=a;c instanceof kf||(c=lf(c));this.v.splice(b,0,c);return c};d.Mb=function(a){this.v=[];this.setValue(null,a)};d.Zd=function(a,b){0<=K(this.v,a)&&(this.Fa=a,this.setValue(a.value,b))};
d.setValue=function(a,b){if(!this.Fa||this.Fa.value!=a){this.Fa=null;for(var c=0;c<this.v.length;c++)if(this.v[c].value==a){this.Fa=this.v[c];break}}c=this.C;this.C=a;this.g&&this.ub(this.Fa||this.C);c!=this.C&&this.Ne&&this.Z(b);c==this.C||b||this.dispatchEvent("change",this.C,c)};function of(a){a=z(a,{M:"kjs-radiobutton"});of.b.constructor.call(this,a);this.Da=n(a.Jh)?a.Jh:"kjs-default-radiobutton-group";this.Vg=a.Dj||null;(this.pg=n(a.th)?a.th:!0)&&pf(this)}t(of,af);N.register("RadioButton",of);var qf={},rf={};
function pf(a,b,c,e,f){qf[a.Da]||(b?qf[a.Da]=b:(qf[a.Da]=new pc,qf[a.Da].We=!0),c?rf[a.Da]=c:(rf[a.Da]=new mf,rf[a.Da].We=!0),b=qf[a.Da],c=rf[a.Da],b.on("componentRemoved",function(){b.Pa()||(b.We&&B(b),c.We&&B(c),delete qf[a.Da],delete rf[a.Da])}),b.addBehavior("ALL_BUT","change",function(a,b){!1!==b&&this.setValue(!1,!0)}),b.addBehavior(uc,"change",function(a,e){if(!1!==e){var f=c.getOption(b.indexOf(this));c.Zd(f)}}),c.on("change",function(){var a;a=K(c.Hh(),c.Fa);-1!=a&&(a=b.get(a),a.setValue(!0))}));
b=qf[a.Da];c=rf[a.Da];e=e||b.Pa();b.ab(a,e);f||c.bb({title:a.Ih(),value:a.Vg||b.Pa()},e);null!==a.getValue()&&0!=a.getValue()&&c.setValue(a.getValue())}d=of.prototype;d.Da=null;d.Vg=null;d.pg=!0;d.j=function(){of.b.j.call(this)};d.ee=function(a){this.a.hasClass("kjs-state-checked")||of.b.ee.call(this,a)};function sf(a){a=z(a,{M:"kjs-radiogroup"});sf.b.constructor.call(this,a);this.Sg=n(a.Kh)?a.Kh:!1;this.Yg=n(a.Tj)?a.Tj:!1;this.tb=new pc;this.xc=[]}t(sf,mf);N.register("RadioGroup",sf);d=sf.prototype;d.Sg=!1;d.Yg=!1;d.xc=null;d.tb=null;d.j=function(){for(var a=0;a<this.v.length;a++)tf(this,this.v[a],a);sf.b.j.call(this)};
function tf(a,b,c){var e=new of({Jh:a.P,Dj:b.value,th:!1,enabled:a.V}),f=new re({text:b.title,K:!0,tj:e.Nd()}),g=new P({K:a.Sg,J:"kjs-radiogroup-wrapper"});pf(e,a.tb,a,c,b);g.a.append(e.a);a.Yg?g.a.prepend(f.a):g.a.append(f.a);a.xc.splice(c,0,{label:f,Yd:e,eg:g});a.g&&(a.a.children().length<=c?a.a.append(g.a):(b=E(),$(a.a.children().get(c)).before(b),b.replaceWith(g.a)),a.Ja&&a.parent.F(),a.o&&(fc(g),fc(e),fc(f)));hc(a,g);hc(a,f);hc(a,e)}
d.Nb=function(a){a=sf.b.Nb.call(this,a);a=this.xc.splice(a,1)[0];this.tb.remove(a.Yd);bc(a.label,!0);bc(a.Yd,!0);bc(a.eg,!0);this.g&&this.Ja&&this.parent.F()};d.bb=function(a,b){var c=sf.b.bb.call(this,a,b);this.o&&tf(this,c,b);return c};d.Mb=function(a){for(sf.b.Mb.call(this,a);this.xc.length;)a=this.xc.splice(0,1)[0],this.tb.remove(a.Yd),bc(a.label,!0),bc(a.Yd,!0),bc(a.eg,!0);this.g&&this.Ja&&this.parent.F()};
d.ub=function(a){this.tb.each(function(a){a.setValue(!1,!0)},this);a&&a instanceof kf&&(a=this.tb.get(K(this.v,a)))&&a.setValue(!0,!0)};function uf(a){a.tb.each(function(a){a.setValue(!1,!0)},a)}d.disable=function(){sf.b.disable.apply(this,arguments);this.tb.each(function(a){a.disable()},this)};d.enable=function(){sf.b.enable.apply(this,arguments);this.tb.each(function(a){a.enable()},this)};
d.i=function(){sf.b.i.call(this);for(var a=this.tb,b;b=a.get(0);)a.remove(b);for(;this.xc.length;)a=this.xc.splice(0,1)[0],B(a.label),B(a.Yd),B(a.eg)};function Z(a){a=z(a,{M:"kjs-selectbox",K:!0});Z.b.constructor.call(this,a);this.T=E({tag:"Select"});vf(this);H(this,this.T,"change",this.Qi);H(this,this.T,"focus",this.Ri);H(this,this.T,"blur",this.Pi);H(this,this.T,"keydown",this.Si)}t(Z,mf);N.register("SelectBox",Z);d=Z.prototype;d.T=null;d.Jd=null;d.Ri=function(){this.a.addClass("kjs-focus")};d.Pi=function(){this.a.removeClass("kjs-focus")};
d.Si=function(a){a=a.which;var b=null,c=K(this.v,this.Fa);-1!=c&&(40==a?b=Math.min(this.v.length-1,c+1):38==a&&(b=Math.max(0,c-1)),this.Zd(this.v[b]))};
d.j=function(){this.c=E();this.c.addClass("kjs-selectbox-facade");this.G=E();this.G.addClass("kjs-selectbox-text");this.O=E();this.O.addClass("kjs-selectbox-button");this.c.append(this.G);this.c.append(this.O);vf(this);Z.b.j.call(this);this.T.css("position","relative");var a=0;if(0!==this.a.height()){var a=this.a,b;w(b)||(b=!1);w(void 0)?(a=Ya(a,b),a=NaN-a.top-a.bottom):a=a.height()}this.a.append(this.c);this.a.append(this.T);0!==a&&(b=F(this.T),this.T.css("top",a/2-b/2+"px"))};
d.Qi=function(a){a.stopImmediatePropagation();a=this.Jd[this.T.val()];this.Zd(a)};d.ae=function(a,b){Z.b.ae.call(this,a,b);vf(this);this.v.length&&this.Zd(this.v[0],b)};d.Nb=function(a,b){Z.b.Nb.call(this,a,b);vf(this)};d.Mb=function(a){Z.b.Mb.call(this,a);vf(this)};d.bb=function(a,b){var c=Z.b.bb.call(this,a,b);vf(this);return c};
function vf(a){a.T.get(0).options.length=0;a.Jd={};for(var b,c=0;c<a.v.length;c++)b=pa("go_selectbox_option_"),a.Jd[b]=a.v[c],a.T.get(0).options[c]=new Option(a.v[c].title,b),a.Fa==a.v[c]&&(a.T.get(0).options.selectedIndex=c)}d.ub=function(a){if(a)if(a instanceof kf)for(var b in this.Jd)this.Jd[b]==a&&(this.T.val(b),a.title?this.G.text(a.title):this.G.text(this.format(a.value)));else this.G.text(this.format(a));else this.G.text("")};d.L=function(a){Z.b.L.call(this,a);this.T.width(this.gb)};
d.H=function(a){Z.b.H.call(this,a);if(this.g&&a){a=this.Zb;var b=F(this.T);this.T.css("top",a/2-b/2+"px")}};d.Pc=function(a){Z.b.Pc.call(this,a);this.g&&(null==this.Md?this.T.css("min-width",""):this.T.css("min-width",this.Md))};d.Oc=function(a){Z.b.Oc.call(this,a);this.g&&(null==this.Pe?this.T.css("min-height",""):this.T.css("min-height",a-this.Pe))};d.disable=function(){Z.b.disable.apply(this,arguments);this.T.prop("disabled",!0)};
d.enable=function(){Z.b.enable.apply(this,arguments);this.T.prop("disabled",!1)};d.setValue=function(a,b){Z.b.setValue.apply(this,arguments)};d.Re=function(a){a?this.disable():this.enable()};function wf(a){this.$c=new Z({va:"0 0 0 0",options:[],K:!1});this.Rc=new sf({Kh:!0,J:"emulator-radiogroup",options:[{title:T("Standalone"),value:!1},{title:T("Buddy"),value:!0}]});a=x(a,{Oe:315,W:[{label:T("Model")+":",Jc:{},va:"0 0 15 0",Ld:this.$c},this.Rc]});wf.b.constructor.call(this,a)}t(wf,hf);N.register("ModelSelectionForm",wf);wf.prototype.i=function(){B(this.$c);B(this.Rc);wf.b.i.call(this)};
wf.prototype.ja=function(){this.h=V.X();H(this,this.h,"change.scenarioList",function(){xf(this);yf(this)});H(this,this.h,"change.modelFilter",function(a,b){this.$c.setValue(b,!0)});H(this,this.$c,"change",function(a,b){this.h.set("modelFilter",b)});H(this,this.h,"change.hasBuddyFilter",function(a,b){null==b?uf(this.Rc):this.Rc.setValue(b,!0)});H(this,this.Rc,"change",function(a,b){this.h.set("hasBuddyFilter",b)});xf(this);yf(this)};
wf.prototype.ta=function(){this.h=null;I(this,this.h,"change.scenarioList");I(this,this.h,"change.modelFilter");I(this,this.$c,"change");I(this,this.h,"change.hasBuddyFilter");I(this,this.Rc,"change")};function xf(a){for(var b=a.h.get("scenarioList"),c,e=[],f=[],g=0;g<b.length;g++)c=b[g].series,-1==K(e,c)&&e.push(c);1<e.length&&(e.sort(),f.push(zf[0]));for(g=0;g<e.length;g++)f.push({title:"Gocator "+e[g],value:e[g]});a.$c.ae(f,!0);var h;1<e.length?h=0:h=e[0];a.h.set("modelFilter",h)}
function yf(a){for(var b=a.h.get("scenarioList"),c,e=[],f=0;f<b.length;f++)c=b[f].hasBuddy,-1==K(e,c)&&e.push(c);1==e.length?a.h.set("hasBuddyFilter",e[0]):a.h.set("hasBuddyFilter",null)}var zf={};zf[0]={title:T("All Models"),value:0};function Af(a){a=z(a,{M:"kjs-selectlistitem"});Af.b.constructor.call(this,a);this.f=a.text||""}t(Af,P);ia(Af,{Fe:function(){this.a.addClass("kjs-selectable")},select:function(){this.a.addClass("kjs-selected");this.Gb=!0},nj:function(){this.a.removeClass("kjs-selected");this.Gb=!1},Ej:function(){return this.Gb},mi:!0,Gb:!1});N.register("SelectListItem",Af);Af.prototype.f=null;Af.prototype.j=function(){Af.b.j.call(this);this.G=E({da:"kjs-selectlistitem-text"});this.a.append(this.G);this.ra(this.f)};
Af.prototype.ra=function(a){this.f=a;this.g&&this.G.text(a)};function Bf(a){a=x(a,{J:"emulator-selectitem"});this.kh=a.bk;this.Ng=a.xj;this.uf=a.ak;this.ne=a.Uj;Bf.b.constructor.call(this,a);this.u=new R({J:"delete-button"});this.ne&&(hc(this,this.u),H(this,this.u,"click",this.Ai),H(this,this.u,"mousedown",this.Bi));this.on("mousedown mouseup click",this.oj)}t(Bf,Af);N.register("ScenarioSelectListItem",Bf);d=Bf.prototype;d.kh="";d.Ng=null;d.uf=null;d.ne=!1;d.Va=null;d.Ai=function(){D(Gd(this.uf))};
d.Bi=function(a){a.stopPropagation();a.stopImmediatePropagation();a.preventDefault()};d.oj=function(a){this.Va&&(a.stopPropagation(),a.stopImmediatePropagation())};
d.j=function(){Bf.b.j.call(this);this.c=E({tag:"input",da:"name-input-text",attributes:{type:"text"}});this.c.hide();this.Pb=E({da:"series-text"});this.Y=E({da:"hasBuddy-text"});this.a.append(this.c);this.a.append(this.Pb);this.a.append(this.Y);this.ne&&this.a.append(this.u.a);this.Pb.html(this.kh);this.Ng?this.Y.html(T("Buddy")):this.Y.html(T("Standalone"));this.on("dblclick",function(){this.ne&&this.V&&!this.Va&&Cf(this)},this);H(this,this.c,"keyup",function(a){13==a.which&&Df(this)});H(this,this.c,
"blur",function(){this.Va&&Df(this)})};function Cf(a){a.Va?(a.Va=!1,a.G.show(),a.c.hide(),a.c.blur()):(a.Va=!0,a.G.hide(),a.c.val(a.f),a.c.show(),a.c.focus(),a=a.c.get(0),"number"==typeof a.selectionStart?a.selectionStart=a.selectionEnd=a.value.length:"undefined"!=typeof a.createTextRange&&(a=a.createTextRange(),a.collapse(!1),a.select()))}function Df(a){var b=a.c.val();Cf(a);b!=a.f&&Hd(a.uf,b).then(function(a){1==a.status&&this.ra(b)},a)};function Ef(a){a=a||{};Ef.b.constructor.call(this,a);this.m=a.options||[];for(var b=0;b<this.m.length;b++)this.m[b]instanceof kf||(this.m[b]=lf(this.m[b]));this.B=[];this.C=[];this.Ff=n(a.kk)?a.kk:!1}t(Ef,$e);N.register("MultipleOptionsInput",Ef);d=Ef.prototype;d.Ya="title";d.Za="value";d.oa=null;d.gd=null;d.m=null;d.B=null;d.Ff=!1;d.ja=function(a,b){Ef.b.ja.apply(this,arguments);!this.gd&&b&&Ff(this,b)};d.ta=function(){Ef.b.ta.apply(this,arguments);this.gd&&Gf(this)};
function Ff(a,b){a.oa=a.oa||{};a.gd=b;H(a,b,"add",a.ei);H(a,b,"remove",a.fi);a.gd.each(function(a){this.oa[a.Aa]=this.ad({title:a.get(this.Ya),value:a.get(this.Za)});H(this,a,"change."+this.Ya,this.bc);H(this,a,"change."+this.Za,this.cc)},a)}function Gf(a){a.gd=null;I(a,optionModelCollection,"add",a.ei);I(a,optionModelCollection,"remove",a.fi);a.gd.each(function(a){I(this,a,"change."+this.Ya,this.bc);I(this,a,"change."+this.Za,this.cc)},a)}
d.ei=function(a,b,c){this.oa[c.Aa]=this.bb({title:c.get(this.Ya),value:c.get(this.Za)},b);H(this,c,"change."+this.Ya,this.bc);H(this,c,"change."+this.Za,this.cc)};d.fi=function(a,b){this.Nb(this.oa[b.Aa]);delete this.oa[b.Aa];I(this,b,"change."+this.Ya,this.bc);I(this,b,"change."+this.Za,this.cc)};d.bc=function(a,b){this.oa[a.target.Aa].title=b};d.cc=function(a,b){this.oa[a.target.Aa].value=b};d.j=function(){Ef.b.j.call(this)};
function Hf(a){var b;if(a.Ff){b=[];for(var c=0;c<a.m.length;c++)0<=K(a.B,a.m[c])?b.push(a.m[c].value):b.push(!1)}else for(b=[],c=0;c<a.m.length;c++)0<=K(a.B,a.m[c])&&b.push(a.m[c].value);return b}d.getOption=function(a){return this.m[a]};d.Pa=function(){return this.m.length};d.Hh=function(){return this.m};d.Of=function(a){for(var b=0;b<this.m.length;b++)if(this.m[b].value==a)return this.m[b];return null};d.ae=function(a,b){this.Mb(b);for(var c=0;c<a.length;c++)this.ad(a[c])};
d.ad=function(a){return this.bb(a,this.m.length)};d.Nb=function(a,b){for(var c,e=0;e<this.m.length;e++)if(this.m[e]==a){this.m.splice(e,1);c=e;break}e=K(this.B,a);-1!=e&&(this.B.splice(e,1),If(this,this.B,!1,b));return c};d.bb=function(a,b){if(b>this.m.length||0>b)throw"Index out of range.";var c=a;c instanceof kf||(c=lf(c));this.m.splice(b,0,c);return c};d.Mb=function(a){this.m=[];this.setValue(null,a)};function If(a,b,c,e){c?a.B=yb(a.B,b):a.B=b;a.setValue(Hf(a),e)}
d.Zd=function(a,b){!(0<=K(this.B,a))&&0<=K(this.m,a)&&(this.B.push(a),this.setValue(Hf(this),b))};
d.setValue=function(a,b){a=a||[];if(this.Ff)for(var c=a,e=this.B.length=0;e<c.length;e++)!1===c[e]||!0!==c[e]&&c[e]!=this.m[e].value||this.B.push(options[e]);else{var c=a,e=!1,f=Hf(this);if(f.length==c.length)for(var g=0;g<c.length;g++){if(f[g]!==c[g]){e=!0;break}}else e=!0;if(e)for(e=this.B.length=0;e<this.m.length;e++)0<=K(c,this.m[e].value)&&this.B.push(this.m[e])}xb(this.C,a)&&(a=this.C);c=this.C;this.C=a;this.g&&this.ub(this.B);b||this.dispatchEvent("selectionChange",this.C,c);c==this.C||b||
this.dispatchEvent("change",this.C,c)};function Jf(a){a=z(a,{M:"kjs-selectlist"});this.qa=new pc;Jf.b.constructor.call(this,a);this.dh=n(a.multiple)?a.multiple:!1;this.og=n(a.cj)?a.cj:!1;this.zg=n(a.lj)?a.lj:!1;this.Dg=n(a.Bh)?a.Bh:"SelectListItem";this.lf=a.Fj||null;this.vb=[];this.ea=E({tag:"textarea",da:"kjs-selectlist-focusable"});this.ea.css({opacity:"0",top:"0px",left:"0px",width:"0px",height:"0px","z-index":"-1",position:"fixed",overflow:"hidden"});for(a=0;a<this.m.length;a++)Kf(this,Lf(this,this.m[a]),a,this.m[a]);this.on("mousedown",
this.jh);this.on("click",this.ih)}t(Jf,Ef);N.register("SelectList",Jf);d=Jf.prototype;d.ea=null;d.og=!1;d.dh=!1;d.qa=null;d.hd=!1;d.zg=!1;d.vb=null;d.fc=null;d.Bc=null;d.Dg="SelectListItem";d.lf=null;function Lf(a,b){return a.lf?a.lf(b):N.create(a.Dg,{text:b.title})}
function Kf(a,b,c,e){a.qa.ab(b,c);e.unselectable||H(a,b,"mousedown",a.Ii);a.g&&(a.a.children().length<=c?a.a.append(b.a):(e=E(),$(a.a.children().get(c)).before(e),e.replaceWith(b.a)),a.Ja&&a.parent.F());hc(a,b);a.og&&b.a[0].scrollIntoView()}
d.Ii=function(a){var b=a.currentTarget;if(this.V&&b.V){var c=this.m[this.qa.indexOf(b)],e=this.B[this.B.length-1];H(this,M,"mouseup",this.gi);this.Bc=this.fc=null;this.vb=[];if(this.dh)if(a.metaKey||a.ctrlKey)0<=K(this.B,c)?this.Bc=c:this.vb.push(c);else if(a.shiftKey&&this.B.length)if(e=this.B[this.B.length-1],a=K(this.m,e),c=K(this.m,c),a<c)for(;a<=c;a++)this.m[a].unselectable||(this.vb.push(this.m[a]),this.qa.get(a).select());else for(;a>=c;a--)this.m[a].unselectable||(this.vb.push(this.m[a]),
this.qa.get(a).select());else this.fc=c,Mf(this);else this.fc=c,Mf(this);b.select()}};d.gi=function(){I(this,M,"mouseup",this.gi);if(this.fc)If(this,[this.fc]);else if(this.vb.length)If(this,this.vb,!0);else if(this.Bc){var a=K(this.B,this.Bc);-1!=a&&this.B.splice(a,1);this.setValue(Hf(this),void 0)}};function Mf(a){a.qa.each(function(a){a.nj()})}
d.j=function(){Jf.b.j.call(this);this.qa.each(function(a){this.a.append(a.a)},this);H(this,this.ea,"focus",this.Qj);H(this,this.ea,"blur",this.Pj);H(this,this.ea,"keydown",this.Rj);H(this,this.ea,"copy",this.Di);this.a.append(this.ea)};d.Qj=function(){this.hd=!0;this.addClass("kjs-focus")};d.Pj=function(){this.c?this.c=!1:(this.removeClass("kjs-focus"),this.hd=!1)};
d.Rj=function(a){var b=K(this.m,this.B[this.B.length-1]);switch(a.which||a.keyCode){case 38:a=Math.max(0,b-1);If(this,[this.m[a]]);break;case 40:a=Math.min(this.m.length-1,b+1);If(this,[this.m[a]]);break;case 67:if(a.metaKey||a.ctrlKey&&this.zg){this.ea.get(0).value="";for(b=0;b<this.B.length;b++)a=this.B[b],this.ea.get(0).value+=a.title,this.ea.get(0).value+="\n";this.ea.get(0).select()}}};
d.Di=function(){var a;this.ea.get(0).value="";for(var b=0;b<this.B.length;b++)a=this.B[b],this.ea.get(0).value+=a.title||a.value,this.ea.get(0).value+="\n";this.ea.get(0).select()};d.jh=function(){this.V&&(this.c=!0,this.ea.focus())};d.ih=function(){this.V&&this.ea.focus()};d.ub=function(a){Mf(this);for(var b=0;b<a.length;b++){var c=K(this.m,a[b]);-1!==c&&this.qa.get(c).select()}};
d.Nb=function(a,b){var c=Jf.b.Nb.call(this,a,b),c=this.qa.get(c);this.qa.remove(c);bc(c,!0);-1!==K(this.vb,a)&&this.vb.splice(index,1);this.fc==a&&(this.fc=null);this.Bc==a&&(this.Bc=null);this.g&&this.Ja&&this.parent.F()};d.bb=function(a,b){var c=Jf.b.bb.call(this,a,b);Kf(this,Lf(this,c),b,c);return c};d.Mb=function(a){for(Jf.b.Mb.call(this,a);this.qa.Pa();)a=this.qa.get(0),this.qa.remove(a),bc(a,!0);this.vb=[];this.Bc=this.fc=null;this.g&&this.Ja&&this.parent.F()};
d.getItem=function(a){a=K(this.m,a);return-1!==a?this.qa.get(a):null};d.focus=function(){0==this.hd&&(this.hd=!0,this.ea.focus(),this.dispatchEvent("focus"))};d.blur=function(){1==this.hd&&(this.hd=!1,this.ea.blur(),this.dispatchEvent("blur"))};d.disable=function(){Jf.b.disable.call(this);this.ea.prop("disabled",!0);this.blur();oc(this)};d.enable=function(){Jf.b.enable.call(this);this.ea.prop("disabled",!1);this.g&&this.mb.remove()};
d.i=function(){for(;this.qa.Pa();){var a=this.qa.get(0);this.qa.remove(a);bc(a,!0)}Jf.b.i.call(this)};function Nf(a){a=a||{};Nf.b.constructor.call(this,a)}t(Nf,Jf);N.register("SelectListWithScroll",Nf);Nf.prototype.jh=function(){this.V&&(this.c=!0)};Nf.prototype.ih=function(){};function Of(a){a=z(a,{Bh:"ScenarioSelectListItem"});Of.b.constructor.call(this,a)}t(Of,Nf);N.register("ScenarioSelectList",Of);function Pf(a){var b="";a.path&&(b+=a.path+"/");a.prefix&&(b+=a.prefix);a.Mf&&(b+="."+a.Mf);return b};function Qf(a){this.c=a||[];Qf.b.constructor.call(this)}t(Qf,ve);Qf.prototype.c=null;Qf.prototype.Z=function(a){Qf.b.Z(a);var b=1,c="";!this.c.length||0<=K(this.c,a.Mf)||(a=this.c.join(", "),b=Rf,c=Sf.replace("%exts",a));return we(this,b,c)};var Rf=-1,Sf=Y("ValidationMessage","The selected file does not have a valid extension [%exts].");J(ue,Qf,"ExtensionValidator");function Tf(a){a=z(a,{tag:"div"});Tf.b.constructor.call(this,a);this.je=pa(this.name+"_iframe");this.Vh=a.url||null;this.qg=n(a.uh)?a.uh:!1;this.rh=a.ik||[];this.Ad=new Qf(this.rh)}t(Tf,R);N.register("UploadButton",Tf);d=Tf.prototype;d.Ia=null;d.Ue=null;d.kc=null;d.Ab=null;d.Vh=null;d.je=null;d.qg=!1;d.rh=null;d.Ad=null;d.Ua=null;d.Wf=null;
d.j=function(){Tf.b.j.call(this);this.a.addClass("kjs-uploadbutton");this.Ia=E({tag:"input",da:"kjs-uploadbutton-input",attributes:{type:"file",name:"data",title:this.rb}});this.Ue=E({tag:"input",attributes:{type:"hidden",name:"name"}});if(this.Ad.c.length){for(var a=[],b=0;b<this.Ad.c.length;b++)a.push("."+this.Ad.c[b]);this.Ia.attr("accept",a.join(","))}this.kc=E({tag:"form",attributes:{target:this.je,action:this.Vh,method:"post",enctype:"multipart/form-data",encoding:"multipart/form-data"}});this.Ia.css({position:"absolute",
top:"0",right:"0",margin:"0",padding:"0","font-size":"99px",opacity:"0",filter:"alpha(opacity=0)"});this.kc.append(this.Ia);this.kc.append(this.Ue);this.a.append(this.kc);H(this,this.Ia,"change",this.Ci)};
d.Ci=function(){this.Z();this.a.addClass("kjs-uploadbutton-fileselected");this.Ib()&&this.qg?na(this.Ia.val())?wa.promise.reject():(this.Ab=E({tag:"iframe",attributes:{src:"javascript:false;",name:this.je,id:this.je,style:"display:none"}}),H(this,this.Ab,"load",this.Gi,this),this.Ua=new Ta,$("body").append(this.Ab),this.Ua.promise()):this.dispatchEvent("change",Pf(this.getValue()))};
d.Gi=function(){I(this,this.Ab,"load");H(this,this.Ab,"load",this.Hi,this);var a=this.Ia.val();na(a)?this.Ua.reject():(a=a.replace(/^.*[\\\/]/,""),this.Ue.val(a),this.kc.get(0).submit());this.Ua?this.dispatchEvent("submit",this.Ua.promise(),this.Ia.val()):console.trace()};
d.Hi=function(){I(this,this.Ab,"load");try{var a=this.Ab.contents().find("body").text(),b=xd(a),b=Bb(b);this.dispatchEvent("complete",b);b.ka()?this.Ua.xb(b):this.Ua.reject(b)}catch(c){c instanceof DOMException&&c.code==DOMException.SECURITY_ERR?this.Ua.xb():this.Ua.reject(c)}Uf(this)};function Uf(a){B(a.Ab);a.Ab=null;a.kc&&a.kc.get(0).reset();a.a.removeClass("kjs-uploadbutton-fileselected");a.Ua=null}
d.$d=function(a){Tf.b.$d.call(this,a);this.o&&(na(this.rb)?this.Ia.removeAttr("title"):this.Ia.attr("title",this.rb))};d.disable=function(){Tf.b.disable.call(this);this.g&&this.Ia.prop("disabled",!0)};d.enable=function(){Tf.b.enable.call(this);this.g&&this.Ia.prop("disabled",!1)};d.i=function(){Uf(this);null!=this.Ua&&this.Ua.reject(result);Tf.b.i.call(this)};
d.getValue=function(){var a=this.Ia.val().split("/"),b=a.slice(0,a.length-1).join("/"),c=a[a.length-1].split(".");0==c.length?c=a="":1==c.length?(a=c[0].trim(),c=""):(a=c.slice(0,c.length-1).join(".").trim(),c=c[c.length-1].trim());return{path:b,prefix:a,Mf:c}};
d.Z=function(a){var b=this.Ad.Z(this.getValue()),c=this.Ib();this.Wf=b;var e=this.Ib();this.Ib()?(this.a.removeClass("kjs-state-error"),c==e||a||this.dispatchEvent({type:"valid",bubbles:!0},b)):(this.a.removeClass("kjs-state-error"),this.a.addClass("kjs-state-error"),a||this.dispatchEvent({type:"invalid",bubbles:!0},b));return b.ka()};d.Ib=function(){return!this.Wf||this.Wf.ka()};function Vf(a){a=x(a,{toolbar:!1});a=z(a,{M:"kjs-fieldset",Od:!0});Vf.b.constructor.call(this,a);this.mb=E({da:"kjs-fieldset-mask"})}t(Vf,S);N.register("Fieldset",Vf);function Wf(a){a=z(a,{M:"kjs-textarea",value:""});Wf.b.constructor.apply(this,arguments);this.wf=a.size||null;this.sh=a.wrap||Xf;this.Tb=a.I||Yf;this.Qa=n(a.focused)?a.focused:!1;this.Td=n(a.readOnly)?a.readOnly:!1;this.c=E({tag:"textarea",attributes:{wrap:this.sh}});this.a.append(this.c);H(this,this.c,"change",this.Vi);H(this,this.c,"blur",this.Ui);H(this,this.c,"focus",this.Wi);H(this,this.c,"mousedown mouseup click",this.Sj)}t(Wf,$e);N.register("TextArea",Wf);var Yf="left",Xf="soft";d=Wf.prototype;
d.Qa=!1;d.wf=null;d.Td=!1;d.sh=!1;d.Ti=Yf;d.i=function(){B(this.c);Wf.b.i.call(this)};d.Vi=function(a){a instanceof va||(a.stopPropagation(),a.stopImmediatePropagation(),this.setValue(this.c.val()))};d.Ui=function(){1==this.Qa?(this.Qa=!1,this.dispatchEvent("blur")):this.Qa=!1;this.removeClass("kjs-focus")};d.Wi=function(){this.Td||(0==this.Qa?(this.Qa=!0,this.dispatchEvent("focus")):this.Qa=!0,this.addClass("kjs-focus"))};
d.Sj=function(a){this.Td&&(a.stopPropagation(),a.stopImmediatePropagation(),a.preventDefault())};d.ub=function(a){a=this.format(a);this.c.val(a)};d.j=function(){Wf.b.j.apply(this,arguments);this.wf&&this.c.attr("size",this.wf);this.Td&&(this.c.prop("readonly",!0),this.a.addClass("kjs-state-readonly"));"right"==this.Ti&&this.a.addClass("kjs-text-right");document.activeElement==this.c.get(0)&&(this.focused=!0)};d.disable=function(){Wf.b.disable.apply(this,arguments);this.c.prop("disabled",!0);this.a.addClass("kjs-state-disabled")};
d.enable=function(){Wf.b.enable.apply(this,arguments);this.c.prop("disabled",!1);this.a.removeClass("kjs-state-disabled")};d.Re=function(a){(this.Td=a)?(this.c.prop("readonly",!0),this.a.addClass("kjs-state-readonly")):this.f||(this.c.prop("readonly",!1),this.a.removeClass("kjs-state-readonly"))};d.L=function(a){Wf.b.L.call(this,a);this.g&&this.ua&&this.c.width(this.gb)};d.H=function(a){Wf.b.H.call(this,a);this.g&&this.na&&this.c.height(this.Zb)};
d.focus=function(){0==this.Qa?(this.Qa=!0,this.c.focus(),this.dispatchEvent("focus")):this.Qa=!0};d.blur=function(){1==this.Qa?(this.Qa=!1,this.c.blur(),this.dispatchEvent("blur")):this.Qa=!1};function Zf(a){var b=window.location.protocol+"//"+zd();this.f=new Tf({text:T("Add"),Kd:"push-button",I:"right",K:!1,uh:!0,ik:["gs"],name:"Add Scenario",Pd:T("Add Scenario"),url:b+"/api/1/scenarios",J:"emulator-add-button"});b=new te({label:T("Available Scenarios"),Oe:325,Jc:{M:"emu-title-label"},Ld:this.f});this.Xa=new Of({height:168,va:"5 0 5 0",multiple:!1,Fj:function(a){return new Bf({text:a.title,bk:a.value.series,xj:a.value.hasBuddy,ak:a.value.id,Uj:a.value.modifiable})}});this.Bb=new Wf({text:"",
height:85,va:"10 0",readOnly:!0,J:"emulator-description-div"});this.zc=new R({Kd:"push-button",width:220,text:T("Start"),J:"emulator-start-button",Ha:{Gc:!0},K:!1});this.zc.disable();var c=new Q({Hc:{overflow:"hidden"},W:[this.zc]});a=x(a,{va:"20 0 0 0",W:[b,this.Xa,this.Bb,c]});Zf.b.constructor.call(this,a)}t(Zf,Q);N.register("EdgeContainer",Zf);Zf.prototype.i=function(){B(this.f);B(this.Xa);B(this.Bb);B(this.zc);Zf.b.i.call(this)};
Zf.prototype.ja=function(){this.h=V.X();$f(this);H(this,this.h,"change.scenarioList",function(){$f(this)});H(this,this.h,"change.modelFilter",function(){$f(this)});H(this,this.h,"change.hasBuddyFilter",function(){$f(this)});H(this,this.f,"submit",function(a,b){Dd(b).then(function(){for(var a=this.h.get("scenarioList"),b=this.h.get("selectedScenarioId"),f,g=0;g<a.length;g++)if(a[g].id==b){f=a[g];break}this.h.set("modelFilter",f.series);this.h.set("hasBuddyFilter",f.hasBuddy);If(this.Xa,[this.Xa.Of(f)],
!1,!1)},this)});H(this,this.Xa,"change",function(a,b){0<b.length?(this.zc.enable(),this.Bb.setValue(b[0].description,!0),b[0].modifiable?this.Bb.Re(!1):this.Bb.Re(!0)):(this.zc.disable(),this.Bb.setValue("",!0),this.Bb.Re(!0))});H(this,this.Bb,"change",function(a,b){var c=this.Xa.getValue()[0].id;Id(c,b).then(function(a){1==a.status&&(this.Xa.B[0].value.description=b)},this)});H(this,this.zc,"click",function(){var a=this.Xa.getValue()[0].id;Ad(a)})};
Zf.prototype.ta=function(){this.h=null;I(this,this.h,"change.scenarioList");I(this,this.h,"change.modelFilter");I(this,this.h,"change.hasBuddyFilter");I(this,this.f,"submit");I(this,this.Xa,"change");I(this,this.Bb,"change");I(this,this.zc,"click")};
function $f(a){var b,c=[];b=a.h.get("scenarioList");var e=a.h.get("modelFilter"),f=[];if(0==e)f=b;else for(var g=0;g<b.length;g++)b[g].series==e&&f.push(b[g]);b=f;e=a.h.get("hasBuddyFilter");f=[];if(null==e)f=b;else for(g=0;g<b.length;g++)b[g].hasBuddy==e&&f.push(b[g]);b=f;for(e=0;e<b.length;e++)c.push({title:b[e].name,value:b[e]});a.Xa.ae(c);1==c.length&&If(a.Xa,[a.Xa.Of(c[0].value)],!1,!1)};function ag(a){a=x(a,{padding:"20 25 25 25",J:"fieldsetContainer"});ag.b.constructor.call(this,a);this.f=new wf;a=new Vf({title:T("Filter"),padding:"15 10",W:[this.f]});this.u=new Zf;this.add([a,this.u])}t(ag,Q);N.register("SetupContainer",ag);ag.prototype.i=function(){B(this.f);B(this.u);ag.b.i.call(this)};ag.prototype.ja=function(){this.f.ga();this.u.ga()};ag.prototype.ta=function(){this.f.wa();this.u.wa()};function bg(a){a=x(a,{width:700});bg.b.constructor.call(this,a);this.u=new R({J:"gocator-logo-button",Ha:{Gc:!0},K:!1});this.Y=new re({J:"gocator-model-label",K:!1,I:"center",text:T("Gocator Emulator")});this.tc=new Z({va:"10 0 20 0",width:210,Ha:{Gc:!0},K:!1});this.f=new ag({Od:!1,width:700});a=new Q({width:700,Hc:{overflow:"hidden"},W:[this.u,this.Y,this.tc]});var b=new Q({Ba:"HorizontalLayout",S:{I:"middle"},Hc:{overflow:"hidden"},W:[this.f]});this.add([a,b])}t(bg,Q);
N.register("LaunchContainer",bg);bg.prototype.i=function(){B(this.u);B(this.Y);B(this.tc);B(this.f);bg.b.i.call(this)};
bg.prototype.ja=function(){this.f.ga();for(var a=de,b=0;b<a.length;b++)this.tc.ad({title:a[b].name,value:a[b].locale});this.tc.setValue(ge(),!0);H(this,this.tc,"change",function(){var a=this.tc.getValue();$d("locale",a,2592E3);if(O.hasOwnProperty("l"))window.location.search=window.location.search.replace(/(\?l=|&l=)([^&#]*)/,"$1"+a);else{var b;b=escape("l");var a=escape(a),f=window.location.search.substr(1).split("&");if(""==f)window.location.search="?"+b+"="+a;else{for(var g=f.length,h;g--;)if(h=
f[g].split("="),h[0]==b){h[1]=a;f[g]=h.join("=");break}0>g&&(f[f.length]=[b,a].join("="));window.location.search=f.join("&")}}})};bg.prototype.ta=function(){this.f.wa();I(this,this.tc,"change",null)};var Pd=-1,Od=2;function cg(a){switch(a){case 0:a=T("Please wait for the emulation to start. You will be automatically redirected when it is ready.");break;case 1:a=T("Starting emulation...");break;case Od:a=T("Emulation has already started.");break;case 3:a=T("Stopping emulation.");break;case 4:a=T("Session is closed.");break;case Pd:a=T("Invalid session.");break;default:a=T("Session is not available.")}return a}
function zd(){return O.hasOwnProperty("emuhost")?window.location.hostname+":"+O.emuhost:window.location.host}function Bd(){return window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")}
function dg(){U({text:T('The application failed to initialize correctly. Please click "Reload" to restart the application and try again.'),type:T("Error"),$a:!1,draggable:!1,buttons:[{text:T("Reload"),jb:function(){window.location.reload(!0)}}]})}
function eg(){if(!Yb("forceBrowser")){var a,b,c;switch(nb.name){case "edge":a="1";b=T("The Gocator web interface requires IE8 and higher. We recommend using the latest version of Firefox or Chrome for an optimal experience.");c=T("Unsupported Version");break;case "trident":a="4";b=T("The Gocator web interface requires IE8 and higher. We recommend using the latest version of Firefox or Chrome for an optimal experience.");c=T("Unsupported Version");break;case "msie":a="8";b=T("The Gocator web interface requires IE8 and higher. We recommend using the latest version of Firefox or Chrome for an optimal experience.");
c=T("Unsupported Version");break;case "mozilla":a="1.9";b=T("The Gocator web interface requires Firefox 3 and higher. We recommend using the latest version for an optimal experience.");c=T("Unsupported Version");break;case "webkit":a="533";b=T("This browser's webkit engine is out of date. Please update your browser to the latest version.");c=T("Unsupported Version");break;case "opera":a="10";b=T("The Opera web browser is not supported by the Gocator web interface.");c=T("Unsupported Browser");break;
default:b=T("Only IE8 and higher, FireFox and Chrome browsers are supported by the Gocator web interface."),c=T("Unsupported Browser")}var e;if(!(e=!a)){a:{e=nb.version.split(".");a=a.split(".");for(var f=Math.max(e.length,a.length),g=0;g<f;g++){var h;h=g<e.length?parseInt(e[g]):0;var k;k=g<a.length?parseInt(a[g]):0;if(h>k){e=1;break a}if(h<k){e=-1;break a}}e=0}e=0>e}e&&(U({text:b,type:"error",title:c,$a:!1,draggable:!1,buttons:"none"}),$(window).trigger("resize"))}}
function gf(){var a=window.location.search;if(!a||0==a.length)return"";"/"==a[a.length-1]&&(a=a.substring(0,a.length-1));a=a.substring(a.indexOf("?")+1);if(0==a.length)return"";for(var a=a.split("&"),b=[],c=0;c<a.length;c++){var e=a[c];"s_"==e.substring(0,2)&&(e=e.slice(2),b.push(e))}return b.join("&")}function Md(){var a=Bd();return a=("http://localhost"==a?a+"/Trunk/Gocator/GoWeb/EmulatorUI/emulation-dev.html":a+"/emulation.html")+Cd()}
function Cd(){var a=window.location.search;0<a.length&&"/"==a[a.length-1]&&(a=a.substring(0,a.length-1));return a}function Kd(a){var b=V.X().get("ports.web");window.frames[0].postMessage(a,window.location.protocol+"//"+window.location.hostname+":"+b)};function fg(a){a=z(a,{K:!0,M:"kjs-text",I:gg});fg.b.constructor.call(this,a);this.Vf=a.text||"";this.mh=a.Mk||"span"}t(fg,Nc);N.register("Text",fg);var gg="left";d=fg.prototype;d.Vf="";d.mh="span";d.ub=function(a){this.ra(this.format(a))};d.ra=function(a){this.Vf=a;this.g&&this.G.html(a)};d.j=function(){this.G=E({tag:this.mh,da:"kjs-text-text"});fg.b.j.call(this);this.a.append(this.G);this.ra(this.Vf);"right"==this.Tb&&this.a.addClass("kjs-text-right");"center"==this.Tb&&this.a.addClass("kjs-text-center")};function hg(a){this.u=new fg({J:"gocator-model-label",K:!1});this.Y=new fg({J:"gocator-model-label",K:!1});this.f=new fg({J:"gocator-model-label",K:!1});a=x(a,{Oe:245,Jc:{K:!1},Qd:"middle",W:[{label:Y("Label","Place in Line")+":",Ld:this.u},{label:Y("Label","Selected Scenario")+":",Ld:this.Y},{label:Y("Label","Sensor Model")+":",Ld:this.f}]});hg.b.constructor.call(this,a)}t(hg,hf);N.register("SessionInfoForm",hg);d=hg.prototype;d.i=function(){B(this.u);B(this.Y);B(this.f);hg.b.i.call(this)};
d.ja=function(){this.h=V.X();Xb(this,Ud(new Td(this.Xi,this),this.h,"queuePosition"));Xb(this,Ud(new Td(this.Yi,this),this.h,"scenarioName"));Xb(this,Ud(new Td(this.Zi,this),this.h,"scenarioSeries"))};d.ta=function(){this.h=null};d.Xi=function(){var a=this.h.get("queuePosition");this.u.ra(a)};d.Yi=function(){var a=this.h.get("scenarioName");this.Y.ra(a)};d.Zi=function(){var a=this.h.get("scenarioSeries");this.f.ra(a)};function ig(a){a=z(a,{M:"kjs-statuscontainer"});ig.b.constructor.call(this,a);this.f=n(a.status)?a.status:jg}t(ig,Q);N.register("StatusContainer",ig);var jg=0;ig.prototype.f=jg;
function kg(a,b){if(1==a.g){switch(a.f){case jg:a.a.removeClass("kjs-statuscontainer-neutral");break;case 1:a.a.removeClass("kjs-statuscontainer-good");break;case 2:a.a.removeClass("kjs-statuscontainer-warning");break;case 3:a.a.removeClass("kjs-statuscontainer-error")}switch(b){case jg:a.a.addClass("kjs-statuscontainer-neutral");break;case 1:a.a.addClass("kjs-statuscontainer-good");break;case 2:a.a.addClass("kjs-statuscontainer-warning");break;case 3:a.a.addClass("kjs-statuscontainer-error")}}a.f=
b}ig.prototype.j=function(){ig.b.j.call(this);kg(this,this.f)};function lg(a){a=x(a,{va:"20 0 0 0",padding:"20 25 25 25",J:"fieldsetContainer"});lg.b.constructor.call(this,a);this.Y=new fg({J:"gocator-model-label",K:!1});this.f=new ig({padding:"15 10",W:[this.Y]});a=new Vf({title:T("Status"),W:[this.f]});this.u=new hg({va:"20 0"});this.add([a,this.u])}t(lg,Q);N.register("SessionInfoContainer",lg);d=lg.prototype;d.i=function(){B(this.f);B(this.Y);B(this.u);lg.b.i.call(this)};d.j=function(){lg.b.j.call(this);this.qh()};
d.ja=function(){this.h=V.X();this.u.ga();Xb(this,Ud(new Td(this.$i,this),this.h,"sessionState"));Xb(this,Ud(new Td(this.qh,this),this.h,"sessionState"))};d.ta=function(){this.h=null;this.u.wa()};d.$i=function(){var a=this.h.get("sessionState"),a=cg(a);this.Y.ra(a)};d.qh=function(){if(1==this.g)switch(this.h.get("sessionState")){case 0:case 1:case Od:case 3:case 4:kg(this.f,1);break;case Pd:kg(this.f,3);break;default:kg(this.f,jg)}};function mg(a){a=x(a,{width:700});mg.b.constructor.call(this,a);this.u=new re({J:"gocator-model-label",K:!1,I:"center",text:T("Gocator Emulator")});this.f=new lg({Od:!1,width:700});a=new Q({width:700,Hc:{overflow:"hidden"},W:[this.u]});var b=new Q({Ba:"HorizontalLayout",S:{I:"middle"},Hc:{overflow:"hidden"},W:[this.f]});this.add([a,b])}t(mg,Q);N.register("StatusContainer",mg);mg.prototype.i=function(){B(this.u);B(this.f);mg.b.i.call(this)};mg.prototype.ja=function(){this.f.ga()};mg.prototype.ta=function(){this.f.wa()};function ng(a){if(og)return og;og=this;M=this;a=z(a,{M:"kjs-viewport",minWidth:800,minHeight:600});ng.b.constructor.call(this,a);this.rg=n(a.vh)?a.vh:!0;H(this,$(window),"resize",this.bj)}t(ng,Q);N.register("Viewport",ng);ng.prototype.u=null;var og=ng.prototype.f=null;d=ng.prototype;d.rg=!1;d.yd=0;d.yb=function(a){ng.b.yb.call(this,a);H(this,$(document),a,this.zd)};d.fg=function(a){ng.b.fg.call(this,a);I(this,$(document),a,this.zd)};
d.j=function(){this.rg&&$(document.body).append(this.a);var a=this.Db||0,b=window.innerHeight||document.documentElement.clientHeight;this.L(Math.max(this.za||0,window.innerWidth||document.documentElement.clientWidth));this.H(Math.max(a,b));ng.b.j.call(this);$(document.body).css("overflow","hidden")};
d.bj=function(){var a=this.Db||0,b=window.innerHeight||document.documentElement.clientHeight,c=Math.max(this.za||0,window.innerWidth||document.documentElement.clientWidth),a=Math.max(a,b);this.f&&clearTimeout(this.f);this.f=this.$j.defer(100,this,[c,a])};d.$j=function(a,b){this.f=null;ad(this,!0);this.L(a);this.H(b);bd(this)};d.disable=function(){this.yd||(ng.b.disable.call(this),pg(this));this.yd++};
d.enable=function(){this.yd&&(1==this.yd&&(ng.b.enable.call(this),clearTimeout(this.u),this.removeClass("kjs-cursor-wait")),this.yd--)};function pg(a){a.u=setTimeout(function(){a.addClass("kjs-cursor-wait")},500)};function qg(a){a=a||{};qg.b.constructor.call(this,a);this.Kb=n(a.Kb)?a.Kb:rg}t(qg,Uc);var rg="default";d=qg.prototype;d.Kb=rg;d.nf=function(a,b){a.c?sg(this,a.c):a.s.D.length&&sg(this,0);qg.b.nf.call(this,a,b)};function sg(a,b){var c;if(b instanceof P)qc(a.ma.s,b.Nd())&&(c=b);else if(q(b)){if(b=qc(a.ma.s,b))c=b}else if("number"==typeof b){if(b=a.ma.s.get(b))c=b}else return;c&&a.c!=c&&(a.c=c,a.ma.c=c,zb(a.ma.s.D,function(a){a.hide()},a),a.c instanceof Q&&(a.c.Wa=!1),a.c.show(),a.ma.g&&a.Ba())}
d.yc=function(a){this.c==a&&qg.b.yc.call(this,a)};d.re=function(a,b){for(var c=a.s.D,e=0;e<c.length;e++)this.La(c[e],e,b)};
d.La=function(a,b,c){qg.b.La.call(this,a,b,c);var e=this.ma;this.yc(a);if(this.c==a){var f=e.Ta||0||e.Wb||0||bb(c);b=e.qb||0;var g=jc(a)||a.za;if(null===g&&!a.rc)a.Dc=!0;else if(a.za||a.rc)g=ab(a.a);a.Dc&&(g=null);var h=a.a,k=F(h),l=kc(a);if("fit"===this.Kb||a.S&&!0===a.S.yk)a.L(f-(l.left+l.right)),h.css("position","absolute"),h.css("left","0px"),b?(a.H(b-(l.top+l.bottom)),h.css("top","0px")):(h.css("top","0px"),c.height(k+l.top+l.bottom));else if("centered"===this.Kb||a.S&&!0===a.S.Gc){h.css("position",
"absolute");var u=g+l.left+l.right,k=k+l.top+l.bottom,e=e.pc||0,y=0;g?(a=Math.floor((f-u)/2),h.css("left",a+"px")):f>u&&(a.L(f-(l.left+l.right)),h.css("left","0px"),a instanceof Q&&a.F());b?y=b:e?e>k?y=e:y=k:y=k;a=Math.floor((y-k)/2);h.css("top",a+"px");c.height(y)}}};J(Tc,qg,"CardLayout");function tg(a){a=x(a,{Ba:"FillLayout",vh:!0,minWidth:1E3,minHeight:660});tg.b.constructor.call(this,a)}t(tg,ng);d=tg.prototype;d.i=function(){tg.b.i.call(this);this.A&&(this.remove(this.A),B(this.A))};d.Wc=null;d.A=null;d.h=null;d.ja=function(){switch(this.Wc){case "application":this.A.s.get(0).ga();break;case "status":this.A.s.get(0).ga();break;case "gocator":this.A.ga()}};d.ta=function(){switch(this.Wc){case "application":this.A.s.get(0).wa();break;case "status":this.A.s.get(0).wa();break;case "gocator":this.A.wa()}};
d.j=function(){tg.b.j.call(this)};function ug(a){a.Wc="loading";a.A&&(a.remove(a.A),B(a.A));a.A=new Q({Ba:"CardLayout",S:{Kb:"centered"},W:[new P({html:'<div class="gocator-loading-gif"><div class="gocator-loading-gif"></div></div>'})]});a.addClass("gocator-show-loading");a.removeClass("gocator-show-application gocator-show-gocator");a.add(a.A)};function vg(a,b){vg.b.constructor.call(this);this.U=0;this.c=a;this.o=b||this}t(vg,C);vg.prototype.c=null;vg.prototype.o=null;vg.prototype.N=function(a){if(0==this.U)if(this.U=1,r(this.c))try{var b=this.c.apply(this.o,arguments);b instanceof C?(b==this&&this.ha(new TypeError("Promise handlers can not return self.")),Qa(b,this.Ca,this.ha,this.dc,this)):n(b)?this.Ca(b):this.Ca()}catch(c){this.ha(c)}else this.f()};function wg(){wg.b.constructor.call(this,function(a){var b=new Ta,c=new Image;c.onload=function(){if(xg){if(0===c.naturalHeight+c.naturalWidth){b.reject(new Ab(0));return}}else if(0==c.width+c.height){b.reject(new Ab(0));return}b.xb(c)};c.onerror=function(){b.reject(new Ab(0))};c.onabort=function(){b.reject(new Ab(-988))};c.src=a;return b.promise()},this)}t(wg,vg);var xg="naturalHeight"in new Image;function yg(){this.ue={};this.Id={};this.U=0}d=yg.prototype;d.ue=null;d.Id=null;d.U=null;d.ge=0;function zg(a){if(Ka(a.U))throw Error("Must unload before loading again");if(0!=a.U)throw Error("Can't load while load in progress");a.U=1;a.ge=0;var b=+new Date,c=[],e;for(e in a.Id){var f=a.Id[e];f.N(e);c.push(f)}return Oa.apply(null,c).then(function(){this.ge=+new Date-b;this.U=3},function(){this.ge=+new Date-b;this.U=4},a)}
d.unload=function(){if(!Ka(state)&&0!=this.U)throw Error("Can't unload while load in progress");this.ue={};this.Id={};this.U=0};
function Ag(a){if(0!=a.U)throw Error("Must unload before loading again");for(var b={},c=document.styleSheets,e=0;e<c.length;e++){var f=c[e],g=f.href,h="";g&&(h=g.replace(/[\\\/][^\\\/]+\.css/,"/"));var k;f.rules?k=f.rules:k=f.cssRules;if(!k)break;f=0;for(g=k.length;f<g;f++)for(var l=k[f].style?k[f].style.cssText:k[f].cssText,u=/url\(\s*['"]?\s*(.*?)\s*['"]?\s*\)/gi,y=/.+\.((jpg)|(jpeg)|(gif)|(png))/i,v;v=u.exec(l);)v=/^([\\\/]|[a-zA-Z]+:\/\/).*/.test(v[1])?v[1]:h+v[1],y.test(v)&&(b[v]=!0)}for(var Oc in b)Bg(a,
Oc)}function Bg(a,b){if(0!=a.U)throw Error("Must unload before loading again");var c=new wg;a.Id[b]=c;c.then(function(a){this.ue[b]=a},function(){this.ue[b]=null},a)};function Cg(){Cg.b.constructor.call(this)}t(Cg,G);ia(Cg,Wb);Cg.prototype.i=function(){this.wa();Cg.b.i.call(this)};var Dg=null,V=null;ga("APP",V);ga("kjs.app.createMainApplication",function(a,b){var c;if(Dg)throw Error("Main application already exists");a=a||Eg;b=b||[];c=sa(a,b);if(!(c instanceof Eg))throw Error("Main application not an instance of kjs.app.App");V=Dg=c;ga("APP",V);return c});ga("kjs.app.getMainApp",function(){return Dg});function Eg(a,b){Eg.b.constructor.call(this);this.ng=n(b)?b:!0;this.le=new yg;this.pa=a||new ng;this.ng&&this.Fe()}t(Eg,Cg);d=Eg.prototype;d.ng=!0;d.le=null;d.pa=null;d.Mh=!1;
d.ke=!1;d.Fe=function(){if(!this.Mh&&!this.ke){this.ke=!0;var a=this;$(document).ready(function(){D(Ma().then(function(){var a=this.Eb();if(!(a instanceof C))throw Error("App._onInit must return a Promise");return a},a).then(a.vc,a),a.wc,a)})}};
d.Eb=function(){console.log("App init called");Ag(this.le);var a=Sa(D(zg(this.le),function(){console.warn("CSS pre-load failed, likely due to missing resources");return Ma()},this),function(){console.log("CSS pre-load finished in "+this.le.ge/1E3+" seconds")},this);fc(this.pa);var b=this;$(window).unload(function(){b.bd()});return a};d.vc=function(){this.ke=!1;this.Mh=!0};d.wc=function(a){this.ke=!1;console.error(a)};function Fg(a,b){this.tg=a;this.Nh=b||null}d=Fg.prototype;d.tg=null;d.Nh=null;d.we=!1;d.Ye=!1;d.fh=0;d.eh=0;d.start=function(a,b){function c(){if(e.we){if(!e.Ye){var a=e.tg.apply(e.Nh,b||[]);a instanceof C&&(e.Ye=!0,Sa(a,function(){e.Ye=!1}))}e.we&&(e.fh=window.setTimeout(c,e.eh))}}this.eh=a;this.we=!0;var e=this;xa(c)};d.stop=function(){window.clearTimeout(this.fh);this.we=!1};function Hg(){this.h=new Ob;var a=new tg;this.ec=new Fg(function(){return Nd()},this);Hg.b.constructor.call(this,a,!0)}t(Hg,Eg);ga("emulator.Emulation",Hg);d=Hg.prototype;d.h=null;d.ec=null;d.i=function(){Hg.b.i.call(this)};d.X=function(){return this.h};
d.Eb=function(){eg();var a=Hg.b.Eb.call(this),b=new Ta;O.hasOwnProperty("session")?Nd().then(function(){return Rd()},this).then(function(){this.oi();b.xb()},this):(console.warn("Session ID is missing from the URL"),b.reject());ug(this.pa);this.pe=0;H(this,this.pa,"windowOpen windowShow",function(a,b){ja(b,Ac)&&!b.oc&&(0==this.pe&&Kd("hideFlash"),this.pe++)});H(this,this.pa,"windowClose windowHide",function(a,b){ja(b,Ac)&&!b.oc&&(this.pe--,0==this.pe&&Kd("showFlash"))});H(this,this.h,"change.sessionState",
function(){var a=this.h.get("change.sessionState");a!=Pd&&4!=a||this.pi().then(function(b){-988!=b.status&&U({type:"warning",text:cg(a)})},this)});return Oa(a,b)};d.wc=function(a){Hg.b.wc.call(this,a);dg()};d.vc=function(){Hg.b.vc.call(this);this.ga();var a=this.pa;a.Wc="gocator";a.A&&(a.remove(a.A),B(a.A));a.removeClass("gocator-show-loading");a.addClass("gocator-show-gocator");a.A=new ff;a.Ic&&a.A.ga();try{a.add(a.A)}catch(b){console.error(b)}};d.ja=function(){this.pa.ga()};
d.ta=function(){this.pa.wa();this.h=null};d.oi=function(){this.ec.start(1E3)};Hg.prototype.startPoll=Hg.prototype.oi;Hg.prototype.pi=function(){this.ec.stop()};Hg.prototype.stopPoll=Hg.prototype.pi;function Ig(){this.h=new Ob;var a=new tg;this.ec=new Fg(function(){return Nd()},this);Ig.b.constructor.call(this,a,!0)}t(Ig,Eg);ga("emulator.Status",Ig);d=Ig.prototype;d.i=function(){Ig.b.i.call(this)};d.h=null;d.X=function(){return this.h};
d.Eb=function(){eg();var a=Ig.b.Eb.call(this),b=new Ta;O.hasOwnProperty("session")?Sa(Nd().then(function(){var a=V.X().get("sessionState");if(0==a||1==a)return a=V.X().get("scenarioId"),Qd(a)}),function(){b.xb()}):(console.warn("Session ID is missing from the URL"),b.xb());ug(this.pa);H(this,this.h,"change.sessionState",function(){switch(this.h.get("sessionState")){case Pd:case 4:this.ec.stop();break;case 0:this.ec.start(5E3);break;case 1:this.ec.stop();this.ec.start(1E3);break;case Od:window.open(Md(),
"_parent")}});return Oa(a,b)};d.wc=function(a){Ig.b.wc.call(this,a);dg()};d.vc=function(){Ig.b.vc.call(this);this.ga();if(1==this.h.get("sessionState"))ug(this.pa);else{var a=this.pa;a.Wc="status";a.A&&(a.remove(a.A),B(a.A));a.removeClass("gocator-show-loading");a.addClass("gocator-show-application");var b=new mg;a.A=new Q({Ba:"CardLayout",S:{Kb:"centered"},W:[b]});a.Ic&&a.A.s.get(0).ga();try{a.add(a.A)}catch(c){console.error(c)}}};d.ja=function(){this.pa.ga()};
d.ta=function(){this.pa.wa();this.h=null};function Jg(){this.h=new Ob;var a=new tg;Jg.b.constructor.call(this,a,!0)}t(Jg,Eg);ga("emulator.App",Jg);d=Jg.prototype;d.i=function(){Jg.b.i.call(this)};d.h=null;d.X=function(){return this.h};d.Eb=function(){eg();var a=Jg.b.Eb.call(this),b=yd();ug(this.pa);return Oa(a,b)};d.wc=function(a){Jg.b.wc.call(this,a);dg()};
d.vc=function(){Jg.b.vc.call(this);this.ga();var a=this.pa;a.Wc="application";a.A&&(a.remove(a.A),B(a.A));a.removeClass("gocator-show-loading");a.addClass("gocator-show-application");var b=new bg;a.A=new Q({Ba:"CardLayout",S:{Kb:"centered"},W:[b]});a.Ic&&a.A.s.get(0).ga();try{a.add(a.A)}catch(c){console.error(c)}};d.ja=function(){this.pa.ga()};d.ta=function(){this.pa.wa();this.h=null};}).call(this);
 //# sourceMappingURL=./application.js.map
