(function(GLOBAL,jQuery,undefined,define){if(GLOBAL["wr"]){return};(function(b){function h(k){k.each(function(){var k=n(this);if(k){var r=b(this),g=m.call(r);b.each(d(k),function(a,e){(!g||!g.hasOwnProperty(a))&&m.call(r,a,e)});b(k).remove()}})}function i(d){d.each(function(){var d=n(this);d&&b(d).remove()})}function n(b){return(b=b.nextSibling)&&8===b.nodeType&&0===(""+b.nodeValue).indexOf("[data]")?b:null}function d(d){d=d.nodeValue;return 0===d.indexOf("[data]")?(d=d.substring(6).replace(/^\s+|\s+$/g,""),b.parseJSON(d)):{}}var m=b.fn.data,k=b.fn.removeData;b.fn.data=
function(){h(this);return m.apply(this,arguments)};b.fn.removeData=function(){0<arguments.length?h(this):i(this);return k.apply(this,arguments)}})(jQuery);(function(b){var h={maximize:!1,minimize:!1,dblclick:!1,titlebar:!1,icons:{maximize:"ui-icon-extlink",minimize:"ui-icon-minus",restore:"ui-icon-newwin"},events:{load:null,beforeCollapse:null,beforeMaximize:null,beforeMinimize:null,beforeRestore:null,collapse:null,maximize:null,minimize:null,restore:null}},i,n={init:function(d){b(this).dialog||b.error("jQuery.dialogExtend Error : Only jQuery UI Dialog element is accepted");d=d||{};d.icons=d.icons||{};d.events=d.events||{};i=b.extend({},h,d);i.icons=
b.extend({},h.icons,d.icons);i.events=b.extend({},h.events,d.events);b(this).each(function(){b(this).data("dialog-state","normal").dialogExtend("_verifySettings").dialogExtend("_initEvents").dialogExtend("_initStyles").dialogExtend("_initButtons").dialogExtend("_initTitleBar").dialogExtend("_trigger","load")});return this},collapse:function(){var d=b(this).dialog("widget").find(".ui-dialog-titlebar").height()+15;b(this).dialogExtend("_trigger","beforeCollapse").dialogExtend("_saveSnapshot").data("dialog-state",
"collapsed").dialog("option",{height:d,maxHeight:d}).hide().dialog("widget").find(".ui-dialog-buttonpane:visible").hide().end().find(".ui-dialog-titlebar").css("white-space","nowrap").end().find(".ui-dialog-content").dialogExtend("_trigger","collapse");return this},maximize:function(){var d=b(window).height()-11,m=b(window).width()-11;b(this).dialogExtend("_trigger","beforeMaximize").dialogExtend("_saveSnapshot").data("dialog-state","maximized").dialogExtend("_toggleButtons").dialog("widget").css("position",
"fixed").find(".ui-dialog-content").show().dialog("widget").find(".ui-dialog-buttonpane").show().end().find(".ui-dialog-content").dialog("option",{resizable:!1,draggable:!1,height:d,width:m,position:[1,1]}).dialog("widget").draggable("option","handle",null).find(".ui-dialog-draggable-handle").css("cursor","text").end().find(".ui-dialog-content").dialogExtend("_trigger","maximize");return this},minimize:function(){var d=b(this).dialog("widget").find(".ui-dialog-titlebar").height()+15;b("#minimized-dialog-container").length||
b("<div />").attr("id","#minimized-dialog-container".replace("#","")).css({left:1,bottom:1,position:"fixed"}).appendTo("body");b(this).dialogExtend("_trigger","beforeMinimize").dialogExtend("_saveSnapshot").data("dialog-state","minimized").dialogExtend("_toggleButtons").dialog("widget").css({"float":"left",margin:1,position:"static"}).appendTo("#minimized-dialog-container").find(".ui-dialog-content").dialog("option",{resizable:!1,draggable:!1,height:d,width:200}).hide().dialog("widget").find(".ui-dialog-buttonpane:visible").hide().end().find(".ui-dialog-titlebar").css("white-space",
"nowrap").end().find(".ui-dialog-content").dialog("widget").draggable("option","handle",null).find(".ui-dialog-draggable-handle").css("cursor","text").end().find(".ui-dialog-content").dialogExtend("_trigger","minimize");return this},restore:function(){var d=b(this).data("dialog-state");b(this).dialogExtend("_trigger","beforeRestore").data("dialog-state","normal").dialogExtend("_toggleButtons").dialogExtend("maximized"==d?"_restoreFromMaximized":"minimized"==d?"_restoreFromMinimized":"collapsed"==
d?"_restoreFromCollapsed":b.error("jQuery.dialogExtend Error : Cannot restore dialog from unknown state '"+d+"'")).dialogExtend("_trigger","restore");return this},_initButtons:function(){var d=this,m=b(d).dialog("widget").find(".ui-dialog-titlebar");b(m).append('<a class="ui-dialog-titlebar-maximize ui-corner-all" href="#"><span class="ui-icon '+i.icons.maximize+'">maximize</span></a>').append('<a class="ui-dialog-titlebar-minimize ui-corner-all" href="#"><span class="ui-icon '+i.icons.minimize+'">minimize</span></a>').append('<a class="ui-dialog-titlebar-restore ui-corner-all" href="#"><span class="ui-icon '+
i.icons.restore+'">restore</span></a>').find(".ui-dialog-titlebar-maximize,.ui-dialog-titlebar-minimize,.ui-dialog-titlebar-restore").attr("role","button").mouseover(function(){b(this).addClass("ui-state-hover")}).mouseout(function(){b(this).removeClass("ui-state-hover")}).focus(function(){b(this).addClass("ui-state-focus")}).blur(function(){b(this).removeClass("ui-state-focus")}).end().find(".ui-dialog-titlebar-maximize").toggle(i.maximize).css({right:i.maximize?"1.4em":"-9999em"}).click(function(k){k.preventDefault();
b(d).dialogExtend("maximize")}).end().find(".ui-dialog-titlebar-minimize").toggle(i.minimize).css({right:i.maximize?"2.5em":i.minimize?"1.4em":"-9999em"}).click(function(k){k.preventDefault();b(d).dialogExtend("minimize")}).end().find(".ui-dialog-titlebar-restore").hide().css({right:"-9999em"}).click(function(k){k.preventDefault();b(d).dialogExtend("restore")}).end().dblclick(function(){i.dblclick&&i.dblclick.length&&b(d).dialogExtend("normal"!=b(d).data("dialog-state")?"restore":i.dblclick)}).each(function(){b(this).select(function(){return!1})});
return d},_initEvents:function(){var d=this;b.each(i.events,function(m){b.isFunction(i.events[m])&&b(d).bind(m+".dialogExtend",i.events[m])});return d},_initStyles:function(){var d;b('<style type="text/css">.ui-dialog .ui-dialog-titlebar-maximize,.ui-dialog .ui-dialog-titlebar-minimize,.ui-dialog .ui-dialog-titlebar-restore { position: absolute; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }.ui-dialog .ui-dialog-titlebar-maximize span,.ui-dialog .ui-dialog-titlebar-minimize span,.ui-dialog .ui-dialog-titlebar-restore span { display: block; margin: 1px; }.ui-dialog .ui-dialog-titlebar-maximize:hover,.ui-dialog .ui-dialog-titlebar-maximize:focus,.ui-dialog .ui-dialog-titlebar-minimize:hover,.ui-dialog .ui-dialog-titlebar-minimize:focus,.ui-dialog .ui-dialog-titlebar-restore:hover,.ui-dialog .ui-dialog-titlebar-restore:focus { padding: 0; }.ui-dialog .ui-dialog-titlebar ::selection { background-color: transparent; }</style>').appendTo("body");
return this},_initTitleBar:function(){switch(i.titlebar){case !1:break;case "none":if(b(this).dialog("option","draggable")){var d=b("<div />").addClass("ui-dialog-draggable-handle").css("cursor","move").height(5);b(this).dialog("widget").prepend(d).draggable("option","handle",d)}b(this).dialog("widget").find(".ui-dialog-titlebar").find(".ui-dialog-title").html("\ufffd").end().css({"background-color":"transparent","background-image":"none",border:0,position:"absolute",right:0,top:0,"z-index":9999}).end();
break;case "transparent":b(this).dialog("widget").find(".ui-dialog-titlebar").css({"background-color":"transparent","background-image":"none",border:0});break;default:b.error("jQuery.dialogExtend Error : Invalid <titlebar> value '"+i.titlebar+"'")}return this},_loadSnapshot:function(){return{config:{resizable:b(this).data("original-config-resizable"),draggable:b(this).data("original-config-draggable")},size:{height:b(this).data("original-size-height"),width:b(this).data("original-size-width"),maxHeight:b(this).data("original-size-maxHeight")},
position:{mode:b(this).data("original-position-mode"),left:b(this).data("original-position-left"),top:b(this).data("original-position-top")},titlebar:{wrap:b(this).data("original-titlebar-wrap")}}},_restoreFromCollapsed:function(){var d=b(this).dialogExtend("_loadSnapshot");b(this).show().dialog("widget").find(".ui-dialog-buttonpane:hidden").show().end().find(".ui-dialog-titlebar").css("white-space",d.titlebar.wrap).end().find(".ui-dialog-content").dialog("option",{height:d.size.height,maxHeight:d.size.maxHeight});
return this},_restoreFromMaximized:function(){var d=b(this).dialogExtend("_loadSnapshot");b(this).dialog("widget").css("position",d.position.mode).find(".ui-dialog-titlebar").css("white-space",d.titlebar.wrap).end().find(".ui-dialog-content").dialog("option",{resizable:d.config.resizable,draggable:d.config.draggable,height:d.size.height,width:d.size.width,maxHeight:d.size.maxHeight,position:[d.position.left,d.position.top]}).dialog("widget").draggable("option","handle",b(this).find(".ui-dialog-draggable-handle")).find(".ui-dialog-draggable-handle").css("cursor",
"move");return this},_restoreFromMinimized:function(){var d=b(this).dialogExtend("_loadSnapshot");b(this).dialog("widget").appendTo("body").css({"float":"none",margin:0,position:d.position.mode}).find(".ui-dialog-content").show().dialog("widget").find(".ui-dialog-buttonpane:hidden").show().end().find(".ui-dialog-titlebar").css("white-space",d.titlebar.wrap).end().find(".ui-dialog-content").dialog("option",{resizable:d.config.resizable,draggable:d.config.draggable,height:d.size.height,width:d.size.width,
maxHeight:d.size.maxHeight,position:[d.position.left,d.position.top]}).dialog("widget").draggable("option","handle",b(this).find(".ui-dialog-draggable-handle")).find(".ui-dialog-draggable-handle").css("cursor","move");return this},_saveSnapshot:function(){"normal"==b(this).data("dialog-state")&&b(this).data("original-config-resizable",b(this).dialog("option","resizable")).data("original-config-draggable",b(this).dialog("option","draggable")).data("original-size-height",b(this).dialog("widget").height()).data("original-size-width",
b(this).dialog("option","width")).data("original-size-maxHeight",b(this).dialog("option","maxHeight")).data("original-position-mode",b(this).dialog("widget").css("position")).data("original-position-left",b(this).dialog("widget").offset().left).data("original-position-top",b(this).dialog("widget").offset().top).data("original-titlebar-wrap",b(this).dialog("widget").find(".ui-dialog-titlebar").css("white-space"));return this},_toggleButtons:function(){b(this).dialog("widget").find(".ui-dialog-titlebar-maximize").toggle("maximized"!=
b(this).data("dialog-state")&&i.maximize).end().find(".ui-dialog-titlebar-minimize").toggle("minimized"!=b(this).data("dialog-state")&&i.minimize).end().find(".ui-dialog-titlebar-restore").toggle("normal"!=b(this).data("dialog-state")&&(i.maximize||i.minimize)).css({right:"maximized"==b(this).data("dialog-state")?"1.4em":"minimized"==b(this).data("dialog-state")?!i.maximize?"1.4em":"2.5em":"-9999em"}).end();return this},_trigger:function(d){b(this).triggerHandler(d+".dialogExtend",this);return this},
_verifySettings:function(){if(i.dblclick&&"maximize"!=i.dblclick&&"minimize"!=i.dblclick&&"collapse"!=i.dblclick)b.error("jQuery.dialogExtend Error : Invalid <dblclick> value '"+i.dblclick+"'"),i.dblclick=!1;if(i.titlebar&&"none"!=i.titlebar&&"transparent"!=i.titlebar)b.error("jQuery.dialogExtend Error : Invalid <titlebar> value '"+i.titlebar+"'"),i.titlebar=!1;return this}};b.fn.dialogExtend=function(d){if(n[d])return n[d].apply(this,Array.prototype.slice.call(arguments,1));if("object"===typeof d||
!d)return n.init.apply(this,arguments);b.error("jQuery.dialogExtend Error : Method <"+d+"> does not exist")}})(jQuery);(function(b,h){function i(c){return"string"===typeof c}function n(c){var a=q.call(arguments,1);return function(){return c.apply(this,a.concat(q.call(arguments)))}}function d(a,l,d,j,k){var m;j!==r?(l=d.match(a?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/),d=l[3]||"",2===k&&i(j)?j=j.replace(a?x:A,""):(m=e(l[2]),j=i(j)?e[a?v:y](j):j,j=2===k?j:1===k?b.extend({},j,m):b.extend({},m,j),j=g(j),a&&(j=j.replace(B,o))),a=l[1]+(a?"#":j||!l[1]?"?":"")+j+d):a=l(d!==r?d:h[c][t]);return a}function m(a,c,l){c===
r||"boolean"===typeof c?(l=c,c=g[a?v:y]()):c=i(c)?c.replace(a?x:A,""):c;return e(c,l)}function k(c,a,l,e){!i(l)&&"object"!==typeof l&&(e=l,l=a,a=r);return this.each(function(){var j=b(this),d=a||z()[(this.nodeName||"").toLowerCase()]||"",k=d&&j.attr(d)||"";j.attr(d,g[c](k,l,e))})}var r,q=Array.prototype.slice,o=decodeURIComponent,g=b.param,a,e,j,p=b.bbq=b.bbq||{},s,C,z,F=b.event.special,y="querystring",v="fragment",c="location",t="href",A=/^.*\?|#.*$/g,x=/^.*\#/,B,l={};g[y]=n(d,0,function(c){return c.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,
"$1")});g[v]=a=n(d,1,function(c){return c.replace(/^[^#]*#?(.*)$/,"$1")});a.noEscape=function(c){c=b.map((c||"").split(""),encodeURIComponent);B=RegExp(c.join("|"),"g")};a.noEscape(",/");b.deparam=e=function(c,a){var l={},e={"true":!0,"false":!1,"null":null};b.each(c.replace(/\+/g," ").split("&"),function(c,u){var E;var j=u.split("="),d=o(j[0]),f=l,G=0,w=d.split("]["),D=w.length-1;/\[/.test(w[0])&&/\]$/.test(w[D])?(w[D]=w[D].replace(/\]$/,""),w=w.shift().split("[").concat(w),D=w.length-1):D=0;if(2===
j.length)if(j=o(j[1]),a&&(j=j&&!isNaN(j)?+j:"undefined"===j?r:e[j]!==r?e[j]:j),D)for(;G<=D;G++)d=""===w[G]?f.length:w[G],E=f[d]=G<D?f[d]||(w[G+1]&&isNaN(w[G+1])?{}:[]):j,f=E;else b.isArray(l[d])?l[d].push(j):l[d]=l[d]!==r?[l[d],j]:j;else d&&(l[d]=a?r:"")});return l};e[y]=n(m,0);e[v]=j=n(m,1);b.elemUrlAttr||(b.elemUrlAttr=function(c){return b.extend(l,c)})({a:t,base:t,iframe:"src",img:"src",input:"src",form:"action",link:t,script:"src"});z=b.elemUrlAttr;b.fn[y]=n(k,y);b.fn[v]=n(k,v);p.pushState=s=
function(l,e){i(l)&&/^#/.test(l)&&e===r&&(e=2);var b=l!==r,b=a(h[c][t],b?l:{},b?e:2);h[c][t]=b+(/#/.test(b)?"":"#")};p.getState=C=function(c,a){return c===r||"boolean"===typeof c?j(c):j(a)[c]};p.removeState=function(c){var a={};c!==r&&(a=C(),b.each(b.isArray(c)?c:arguments,function(c,l){delete a[l]}));s(a,2)};F.hashchange=b.extend(F.hashchange,{add:function(c){function l(c){var b=c[v]=a();c.getState=function(c,a){return c===r||"boolean"===typeof c?e(b,c):e(b,a)[c]};j.apply(this,arguments)}var j;if(b.isFunction(c))return j=
c,l;j=c.handler;c.handler=l}})})(jQuery,this);
(function(b,h,i){function n(a){a=a||h[k][r];return a.replace(/^[^#]*#?(.*)$/,"$1")}var d,m=b.event.special,k="location",r="href",q=document.documentMode,o=b.browser.msie&&(q===i||8>q),g="onhashchange"in h&&!o;b.hashchangeDelay=100;m.hashchange=b.extend(m.hashchange,{setup:function(){if(g)return!1;b(d.start)},teardown:function(){if(g)return!1;b(d.stop)}});d=function(){function a(){g=m=function(a){return a};if(o)d=b('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow,m=function(){return n(d.document[k][r])},
g=function(a,e){if(a!==e){var b=d.document;b.open().close();b[k].hash="#"+a}},g(n())}var e={},j,d,g,m;e.start=function(){if(!j){var e=n();g||a();(function y(){var a=n(),c=m(e);a!==e?(g(e=a,c),b(h).trigger("hashchange")):c!==e&&(h[k][r]=h[k][r].replace(/#.*/,"")+"#"+c);j=setTimeout(y,b.hashchangeDelay)})()}};e.stop=function(){d||(j&&clearTimeout(j),j=0)};return e}()})(jQuery,this);(function(b,h,i){function n(b){return b}function d(b){b=decodeURIComponent(b.replace(m," "));0===b.indexOf('"')&&(b=b.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));return b}var m=/\+/g,k=b.cookie=function(m,q,o){if(q!==i){o=b.extend({},k.defaults,o);if(null===q)o.expires=-1;if("number"===typeof o.expires){var g=o.expires,a=o.expires=new Date;a.setDate(a.getDate()+g)}q=k.json?JSON.stringify(q):""+q;return h.cookie=[encodeURIComponent(m),"=",k.raw?q:encodeURIComponent(q),o.expires?"; expires="+
o.expires.toUTCString():"",o.path?"; path="+o.path:"",o.domain?"; domain="+o.domain:"",o.secure?"; secure":""].join("")}for(var q=k.raw?n:d,o=h.cookie.split("; "),g=m?null:{},a=0,e=o.length;a<e;a++){var j=o[a].split("="),p=q(j.shift()),j=q(j.join("="));if(m&&m===p){g=k.json?JSON.parse(j):j;break}m||(g[p]=k.json?JSON.parse(j):j)}return g};k.defaults={};b.removeCookie=function(d,k){return null!==b.cookie(d)?(b.cookie(d,null,k),!0):!1}})(jQuery,document);var jsDump;
(function(){function b(b){return'"'+b.toString().replace(/"/g,'\\"')+'"'}function h(b){return b+""}function i(b,d,i){var h=jsDump.separator(),o=jsDump.indent();inner=jsDump.indent(1);d.join&&(d=d.join(","+h+inner));return!d?b+i:[b,inner+d,o+i].join(h)}function n(b){var d=b.length,r=Array(d);for(this.up();d--;)r[d]=this.parse(b[d]);this.down();return i("[",r,"]")}var d=/^function (\w+)/;jsDump={parse:function(b,d){var i=this.parsers[d||this.typeOf(b)],d=typeof i;return"function"==d?i.call(this,b):
"string"==d?i:this.parsers.error},typeOf:function(b){var d=typeof b;return"object"!=d&&"function"!=d?d:!b?"null":b.exec?"regexp":b.getHours?"date":b.scrollBy?"window":"#document"==b.nodeName?"document":b.nodeName?"node":b.item?"nodelist":b.callee?"arguments":b.call||b.constructor!=Array&&-1!=(b+"").indexOf("function")?"function":"length"in b?"array":d},separator:function(){return this.multiline?this.HTML?"<br />":"\n":this.HTML?"&nbsp;":" "},indent:function(b){if(!this.multiline)return"";var d=this.indentChar;
this.HTML&&(d=d.replace(/\t/g,"   ").replace(/ /g,"&nbsp;"));return Array(this._depth_+(b||0)).join(d)},up:function(b){this._depth_+=b||1},down:function(b){this._depth_-=b||1},setParser:function(b,d){this.parsers[b]=d},quote:b,literal:h,join:i,_depth_:1,parsers:{window:"[Window]",document:"[Document]",error:"[ERROR]",unknown:"[Unknown]","null":"null",undefined:"undefined","function":function(b){var k="function",h="name"in b?b.name:(d.exec(b)||[])[1];h&&(k+=" "+h);k=[k+"(",this.parse(b,"functionArgs"),
"){"].join("");return i(k,this.parse(b,"functionCode"),"}")},array:n,nodelist:n,arguments:n,object:function(b){var d=[];this.up();for(var h in b)d.push(this.parse(h,"key")+": "+this.parse(b[h]));this.down();return i("{",d,"}")},node:function(b){var d=this.HTML?"&lt;":"<",i=this.HTML?"&gt;":">",h=b.nodeName.toLowerCase(),o=d+h,g;for(g in this.DOMAttrs){var a=b[this.DOMAttrs[g]];a&&(o+=" "+g+"="+this.parse(a,"attribute"))}return o+i+d+"/"+h+i},functionArgs:function(b){b=b.length;if(!b)return"";for(var d=
Array(b);b--;)d[b]=String.fromCharCode(97+b);return" "+d.join(", ")+" "},key:b,functionCode:"[code]",attribute:b,string:b,date:b,regexp:h,number:h,"boolean":h},DOMAttrs:{id:"id",name:"name","class":"className"},HTML:!1,indentChar:"   ",multiline:!0}})();var Hashtable=function(){function b(a){if("string"==typeof a)return a;return typeof a.hashCode==o?(a=a.hashCode(),"string"==typeof a?a:b(a)):typeof a.toString==o?a.toString():""+a}function h(a,b){return a.equals(b)}function i(a,b){return typeof b.equals==o?b.equals(a):a===b}function n(a){return function(b){if(null===b)throw Error("null is not a valid "+a);if("undefined"==typeof b)throw Error(a+" must not be undefined");}}function d(a,b,e,d){this[0]=a;this.entries=[];this.addEntry(b,e);if(null!==d)this.getEqualityFunction=
function(){return d}}function m(a){return function(b){for(var e=this.entries.length,d,g=this.getEqualityFunction(b);e--;)if(d=this.entries[e],g(b,d[0]))switch(a){case j:return!0;case p:return d;case s:return[e,d[1]]}return!1}}function k(a){return function(b){for(var e=b.length,d=0,j=this.entries.length;d<j;++d)b[e+d]=this.entries[d][a]}}function r(a,b){var e=a[b];return e&&e instanceof d?e:null}function q(j,p){var k=this,i=[],s={},c=typeof j==o?j:b,h=typeof p==o?p:null;this.put=function(b,j){a(b);
e(j);var l=c(b),u,g=null;(u=r(s,l))?(l=u.getEntryForKey(b))?(g=l[1],l[1]=j):u.addEntry(b,j):(u=new d(l,b,j,h),i[i.length]=u,s[l]=u);return g};this.get=function(b){a(b);var e=c(b);if(e=r(s,e))if(b=e.getEntryForKey(b))return b[1];return null};this.containsKey=function(b){a(b);var e=c(b);return(e=r(s,e))?e.containsKey(b):!1};this.containsValue=function(a){e(a);for(var c=i.length;c--;)if(i[c].containsValue(a))return!0;return!1};this.clear=function(){i.length=0;s={}};this.isEmpty=function(){return!i.length};
var m=function(a){return function(){for(var c=[],b=i.length;b--;)i[b][a](c);return c}};this.keys=m("keys");this.values=m("values");this.entries=m("getEntries");this.remove=function(b){a(b);var e=c(b),l=null,d=r(s,e);if(d&&(l=d.removeEntryForKey(b),null!==l&&!d.entries.length)){a:{for(b=i.length;b--;)if(d=i[b],e===d[0])break a;b=null}g(i,b);delete s[e]}return l};this.size=function(){for(var a=0,b=i.length;b--;)a+=i[b].entries.length;return a};this.each=function(a){for(var b=k.entries(),c=b.length,
e;c--;)e=b[c],a(e[0],e[1])};this.putAll=function(a,b){for(var c=a.entries(),e,d,j,g=c.length,i=typeof b==o;g--;){e=c[g];d=e[0];e=e[1];if(i&&(j=k.get(d)))e=b(d,j,e);k.put(d,e)}};this.clone=function(){var a=new q(j,p);a.putAll(k);return a}}var o="function",g=typeof Array.prototype.splice==o?function(a,b){a.splice(b,1)}:function(a,b){var e,d,j;if(b===a.length-1)a.length=b;else{e=a.slice(b+1);a.length=b;for(d=0,j=e.length;d<j;++d)a[b+d]=e[d]}},a=n("key"),e=n("value"),j=0,p=1,s=2;d.prototype={getEqualityFunction:function(a){return typeof a.equals==
o?h:i},getEntryForKey:m(p),getEntryAndIndexForKey:m(s),removeEntryForKey:function(a){return(a=this.getEntryAndIndexForKey(a))?(g(this.entries,a[0]),a[1]):null},addEntry:function(a,b){this.entries[this.entries.length]=[a,b]},keys:k(0),values:k(1),getEntries:function(a){for(var b=a.length,e=0,d=this.entries.length;e<d;++e)a[b+e]=this.entries[e].slice(0)},containsKey:m(j),containsValue:function(a){for(var b=this.entries.length;b--;)if(a===this.entries[b][1])return!0;return!1}};return q}();function parseUri(b){for(var h=parseUri.options,b=h.parser[h.strictMode?"strict":"loose"].exec(b),i={},n=14;n--;)i[h.key[n]]=b[n]||"";i[h.q.name]={};i[h.key[12]].replace(h.q.parser,function(b,m,k){m&&(i[h.q.name][m]=k)});return i}
parseUri.options={strictMode:!1,key:"source,protocol,authority,userInfo,user,password,host,port,relative,path,directory,file,query,anchor".split(","),q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};(function(){function b(f,a,e){if(f===a)return 0!==f||1/f==1/a;if(null==f||null==a)return f===a;f._chain&&(f=f._wrapped);a._chain&&(a=a._wrapped);if(f.isEqual&&c.isFunction(f.isEqual))return f.isEqual(a);if(a.isEqual&&c.isFunction(a.isEqual))return a.isEqual(f);var l=q.call(f);if(l!=q.call(a))return!1;switch(l){case "[object String]":return f==""+a;case "[object Number]":return f!=+f?a!=+a:0==f?1/f==1/a:f==+a;case "[object Date]":case "[object Boolean]":return+f==+a;case "[object RegExp]":return f.source==
a.source&&f.global==a.global&&f.multiline==a.multiline&&f.ignoreCase==a.ignoreCase}if("object"!=typeof f||"object"!=typeof a)return!1;for(var d=e.length;d--;)if(e[d]==f)return!0;e.push(f);var d=0,j=!0;if("[object Array]"==l){if(d=f.length,j=d==a.length)for(;d--&&(j=d in f==d in a&&b(f[d],a[d],e)););}else{if("constructor"in f!="constructor"in a||f.constructor!=a.constructor)return!1;for(var g in f)if(c.has(f,g)&&(d++,!(j=c.has(a,g)&&b(f[g],a[g],e))))break;if(j){for(g in a)if(c.has(a,g)&&!d--)break;
j=!d}}e.pop();return j}var h=this,i=h._,n={},d=Array.prototype,m=Object.prototype,k=d.slice,r=d.unshift,q=m.toString,o=m.hasOwnProperty,g=d.forEach,a=d.map,e=d.reduce,j=d.reduceRight,p=d.filter,s=d.every,C=d.some,z=d.indexOf,F=d.lastIndexOf,m=Array.isArray,y=Object.keys,v=Function.prototype.bind,c=function(f){return new E(f)};"undefined"!==typeof exports?("undefined"!==typeof module&&module.exports&&(exports=module.exports=c),exports._=c):h._=c;c.VERSION="1.3.3";var t=c.each=c.forEach=function(f,
a,b){if(null!=f)if(g&&f.forEach===g)f.forEach(a,b);else if(f.length===+f.length)for(var e=0,d=f.length;e<d&&!(e in f&&a.call(b,f[e],e,f)===n);e++);else for(e in f)if(c.has(f,e)&&a.call(b,f[e],e,f)===n)break};c.map=c.collect=function(f,b,c){var e=[];if(null==f)return e;if(a&&f.map===a)return f.map(b,c);t(f,function(f,a,d){e[e.length]=b.call(c,f,a,d)});if(f.length===+f.length)e.length=f.length;return e};c.reduce=c.foldl=c.inject=function(f,a,b,d){var l=2<arguments.length;null==f&&(f=[]);if(e&&f.reduce===
e)return d&&(a=c.bind(a,d)),l?f.reduce(a,b):f.reduce(a);t(f,function(f,c,e){l?b=a.call(d,b,f,c,e):(b=f,l=!0)});if(!l)throw new TypeError("Reduce of empty array with no initial value");return b};c.reduceRight=c.foldr=function(f,a,b,e){var d=2<arguments.length;null==f&&(f=[]);if(j&&f.reduceRight===j)return e&&(a=c.bind(a,e)),d?f.reduceRight(a,b):f.reduceRight(a);var l=c.toArray(f).reverse();e&&!d&&(a=c.bind(a,e));return d?c.reduce(l,a,b,e):c.reduce(l,a)};c.find=c.detect=function(f,a,b){var c;A(f,function(f,
e,d){if(a.call(b,f,e,d))return c=f,!0});return c};c.filter=c.select=function(f,a,b){var c=[];if(null==f)return c;if(p&&f.filter===p)return f.filter(a,b);t(f,function(f,e,d){a.call(b,f,e,d)&&(c[c.length]=f)});return c};c.reject=function(f,a,b){var c=[];if(null==f)return c;t(f,function(f,e,d){a.call(b,f,e,d)||(c[c.length]=f)});return c};c.every=c.all=function(f,a,b){var c=!0;if(null==f)return c;if(s&&f.every===s)return f.every(a,b);t(f,function(f,e,d){if(!(c=c&&a.call(b,f,e,d)))return n});return!!c};
var A=c.some=c.any=function(f,a,b){a||(a=c.identity);var e=!1;if(null==f)return e;if(C&&f.some===C)return f.some(a,b);t(f,function(f,c,d){if(e||(e=a.call(b,f,c,d)))return n});return!!e};c.include=c.contains=function(f,a){var b;return null==f?!1:z&&f.indexOf===z?-1!=f.indexOf(a):b=A(f,function(f){return f===a})};c.invoke=function(f,a){var b=k.call(arguments,2);return c.map(f,function(f){return(c.isFunction(a)?a||f:f[a]).apply(f,b)})};c.pluck=function(f,a){return c.map(f,function(f){return f[a]})};
c.max=function(f,a,b){if(!a&&c.isArray(f)&&f[0]===+f[0])return Math.max.apply(Math,f);if(!a&&c.isEmpty(f))return-Infinity;var e={computed:-Infinity};t(f,function(f,c,d){c=a?a.call(b,f,c,d):f;c>=e.computed&&(e={value:f,computed:c})});return e.value};c.min=function(a,b,e){if(!b&&c.isArray(a)&&a[0]===+a[0])return Math.min.apply(Math,a);if(!b&&c.isEmpty(a))return Infinity;var d={computed:Infinity};t(a,function(a,f,c){f=b?b.call(e,a,f,c):a;f<d.computed&&(d={value:a,computed:f})});return d.value};c.shuffle=
function(a){var b=[],c;t(a,function(a,f){c=Math.floor(Math.random()*(f+1));b[f]=b[c];b[c]=a});return b};c.sortBy=function(a,b,e){var d=c.isFunction(b)?b:function(a){return a[b]};return c.pluck(c.map(a,function(a,f,b){return{value:a,criteria:d.call(e,a,f,b)}}).sort(function(a,f){var b=a.criteria,c=f.criteria;return void 0===b?1:void 0===c?-1:b<c?-1:b>c?1:0}),"value")};c.groupBy=function(a,b){var e={},d=c.isFunction(b)?b:function(a){return a[b]};t(a,function(a,f){var b=d(a,f);(e[b]||(e[b]=[])).push(a)});
return e};c.sortedIndex=function(a,b,e){e||(e=c.identity);for(var d=0,l=a.length;d<l;){var j=d+l>>1;e(a[j])<e(b)?d=j+1:l=j}return d};c.toArray=function(a){return!a?[]:c.isArray(a)||c.isArguments(a)?k.call(a):a.toArray&&c.isFunction(a.toArray)?a.toArray():c.values(a)};c.size=function(a){return c.isArray(a)?a.length:c.keys(a).length};c.first=c.head=c.take=function(a,b,c){return null!=b&&!c?k.call(a,0,b):a[0]};c.initial=function(a,b,c){return k.call(a,0,a.length-(null==b||c?1:b))};c.last=function(a,
b,c){return null!=b&&!c?k.call(a,Math.max(a.length-b,0)):a[a.length-1]};c.rest=c.tail=function(a,b,c){return k.call(a,null==b||c?1:b)};c.compact=function(a){return c.filter(a,function(a){return!!a})};c.flatten=function(a,b){return c.reduce(a,function(a,f){if(c.isArray(f))return a.concat(b?f:c.flatten(f));a[a.length]=f;return a},[])};c.without=function(a){return c.difference(a,k.call(arguments,1))};c.uniq=c.unique=function(a,b,e){var e=e?c.map(a,e):a,d=[];3>a.length&&(b=!0);c.reduce(e,function(e,l,
j){if(b?c.last(e)!==l||!e.length:!c.include(e,l))e.push(l),d.push(a[j]);return e},[]);return d};c.union=function(){return c.uniq(c.flatten(arguments,!0))};c.intersection=c.intersect=function(a){var b=k.call(arguments,1);return c.filter(c.uniq(a),function(a){return c.every(b,function(b){return 0<=c.indexOf(b,a)})})};c.difference=function(a){var b=c.flatten(k.call(arguments,1),!0);return c.filter(a,function(a){return!c.include(b,a)})};c.zip=function(){for(var a=k.call(arguments),b=c.max(c.pluck(a,"length")),
e=Array(b),d=0;d<b;d++)e[d]=c.pluck(a,""+d);return e};c.indexOf=function(a,b,e){if(null==a)return-1;var d;if(e)return e=c.sortedIndex(a,b),a[e]===b?e:-1;if(z&&a.indexOf===z)return a.indexOf(b);e=0;for(d=a.length;e<d;e++)if(e in a&&a[e]===b)return e;return-1};c.lastIndexOf=function(a,b){if(null==a)return-1;if(F&&a.lastIndexOf===F)return a.lastIndexOf(b);for(var c=a.length;c--;)if(c in a&&a[c]===b)return c;return-1};c.range=function(a,b,c){1>=arguments.length&&(b=a||0,a=0);for(var c=arguments[2]||1,
e=Math.max(Math.ceil((b-a)/c),0),d=0,l=Array(e);d<e;)l[d++]=a,a+=c;return l};var x=function(){};c.bind=function(a,b){var e,d;if(a.bind===v&&v)return v.apply(a,k.call(arguments,1));if(!c.isFunction(a))throw new TypeError;d=k.call(arguments,2);return e=function(){if(!(this instanceof e))return a.apply(b,d.concat(k.call(arguments)));x.prototype=a.prototype;var c=new x,l=a.apply(c,d.concat(k.call(arguments)));return Object(l)===l?l:c}};c.bindAll=function(a){var b=k.call(arguments,1);0==b.length&&(b=c.functions(a));
t(b,function(b){a[b]=c.bind(a[b],a)});return a};c.memoize=function(a,b){var e={};b||(b=c.identity);return function(){var d=b.apply(this,arguments);return c.has(e,d)?e[d]:e[d]=a.apply(this,arguments)}};c.delay=function(a,b){var c=k.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)};c.defer=function(a){return c.delay.apply(c,[a,1].concat(k.call(arguments,1)))};c.throttle=function(a,b){var e,d,l,j,g,u,i=c.debounce(function(){g=j=!1},b);return function(){e=this;d=arguments;l||
(l=setTimeout(function(){l=null;g&&a.apply(e,d);i()},b));j?g=!0:u=a.apply(e,d);i();j=!0;return u}};c.debounce=function(a,b,c){var e;return function(){var d=this,l=arguments;c&&!e&&a.apply(d,l);clearTimeout(e);e=setTimeout(function(){e=null;c||a.apply(d,l)},b)}};c.once=function(a){var b=!1,c;return function(){if(b)return c;b=!0;return c=a.apply(this,arguments)}};c.wrap=function(a,b){return function(){var c=[a].concat(k.call(arguments,0));return b.apply(this,c)}};c.compose=function(){var a=arguments;
return function(){for(var b=arguments,c=a.length-1;0<=c;c--)b=[a[c].apply(this,b)];return b[0]}};c.after=function(a,b){return 0>=a?b():function(){if(1>--a)return b.apply(this,arguments)}};c.keys=y||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[],e;for(e in a)c.has(a,e)&&(b[b.length]=e);return b};c.values=function(a){return c.map(a,c.identity)};c.functions=c.methods=function(a){var b=[],e;for(e in a)c.isFunction(a[e])&&b.push(e);return b.sort()};c.extend=function(a){t(k.call(arguments,
1),function(b){for(var c in b)a[c]=b[c]});return a};c.pick=function(a){var b={};t(c.flatten(k.call(arguments,1)),function(c){c in a&&(b[c]=a[c])});return b};c.defaults=function(a){t(k.call(arguments,1),function(b){for(var c in b)null==a[c]&&(a[c]=b[c])});return a};c.clone=function(a){return!c.isObject(a)?a:c.isArray(a)?a.slice():c.extend({},a)};c.tap=function(a,b){b(a);return a};c.isEqual=function(a,c){return b(a,c,[])};c.isEmpty=function(a){if(null==a)return!0;if(c.isArray(a)||c.isString(a))return 0===
a.length;for(var b in a)if(c.has(a,b))return!1;return!0};c.isElement=function(a){return!!(a&&1==a.nodeType)};c.isArray=m||function(a){return"[object Array]"==q.call(a)};c.isObject=function(a){return a===Object(a)};c.isArguments=function(a){return"[object Arguments]"==q.call(a)};c.isArguments(arguments)||(c.isArguments=function(a){return!(!a||!c.has(a,"callee"))});c.isFunction=function(a){return"[object Function]"==q.call(a)};c.isString=function(a){return"[object String]"==q.call(a)};c.isNumber=function(a){return"[object Number]"==
q.call(a)};c.isFinite=function(a){return c.isNumber(a)&&isFinite(a)};c.isNaN=function(a){return a!==a};c.isBoolean=function(a){return!0===a||!1===a||"[object Boolean]"==q.call(a)};c.isDate=function(a){return"[object Date]"==q.call(a)};c.isRegExp=function(a){return"[object RegExp]"==q.call(a)};c.isNull=function(a){return null===a};c.isUndefined=function(a){return void 0===a};c.has=function(a,b){return o.call(a,b)};c.noConflict=function(){h._=i;return this};c.identity=function(a){return a};c.times=
function(a,b,c){for(var e=0;e<a;e++)b.call(c,e)};c.escape=function(a){return(""+a).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")};c.result=function(a,b){if(null==a)return null;var e=a[b];return c.isFunction(e)?e.call(a):e};c.mixin=function(a){t(c.functions(a),function(b){M(b,c[b]=a[b])})};var B=0;c.uniqueId=function(a){var b=B++;return a?a+b:b};c.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,
escape:/<%-([\s\S]+?)%>/g};var l=/.^/,u={"\\":"\\","'":"'",r:"\r",n:"\n",t:"\t",u2028:"\u2028",u2029:"\u2029"},H;for(H in u)u[u[H]]=H;var I=/\\|'|\r|\n|\t|\u2028|\u2029/g,L=/\\(\\|'|r|n|t|u2028|u2029)/g,J=function(a){return a.replace(L,function(a,b){return u[b]})};c.template=function(a,b,e){e=c.defaults(e||{},c.templateSettings);a="__p+='"+a.replace(I,function(a){return"\\"+u[a]}).replace(e.escape||l,function(a,b){return"'+\n_.escape("+J(b)+")+\n'"}).replace(e.interpolate||l,function(a,b){return"'+\n("+
J(b)+")+\n'"}).replace(e.evaluate||l,function(a,b){return"';\n"+J(b)+"\n;__p+='"})+"';\n";e.variable||(a="with(obj||{}){\n"+a+"}\n");var a="var __p='';var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n"+a+"return __p;\n",d=new Function(e.variable||"obj","_",a);if(b)return d(b,c);b=function(a){return d.call(this,a,c)};b.source="function("+(e.variable||"obj")+"){\n"+a+"}";return b};c.chain=function(a){return c(a).chain()};var E=function(a){this._wrapped=a};c.prototype=E.prototype;
var K=function(a,b){return b?c(a).chain():a},M=function(a,b){E.prototype[a]=function(){var a=k.call(arguments);r.call(a,this._wrapped);return K(b.apply(c,a),this._chain)}};c.mixin(c);t("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=d[a];E.prototype[a]=function(){var c=this._wrapped;b.apply(c,arguments);var e=c.length;("shift"==a||"splice"==a)&&0===e&&delete c[0];return K(c,this._chain)}});t(["concat","join","slice"],function(a){var b=d[a];E.prototype[a]=function(){return K(b.apply(this._wrapped,
arguments),this._chain)}});E.prototype.chain=function(){this._chain=!0;return this};E.prototype.value=function(){return this._wrapped}}).call(this);(function(b){var h=String.prototype.trim,i=String.prototype.trimRight,n=String.prototype.trimLeft,d=function(a,b,d){a+="";b=~~b;for(var g=[];0<b;g[--b]=a);return g.join(null==d?"":d)},m=function(a){return null!=a?"["+g.escapeRegExp(a)+"]":"\\s"},k={lt:"<",gt:">",quot:'"',apos:"'",amp:"&"},r={},q;for(q in k)r[k[q]]=q;var o=function(){function a(a){return Object.prototype.toString.call(a).slice(8,-1).toLowerCase()}var b=function(){return b.cache.hasOwnProperty(arguments[0])||(b.cache[arguments[0]]=
b.parse(arguments[0])),b.format.call(null,b.cache[arguments[0]],arguments)};return b.format=function(b,e){var g=1,i=b.length,k="",h,m=[],n,c,q,r,x;for(n=0;n<i;n++)if(k=a(b[n]),"string"===k)m.push(b[n]);else if("array"===k){c=b[n];if(c[2]){h=e[g];for(k=0;k<c[2].length;k++){if(!h.hasOwnProperty(c[2][k]))throw Error(o('[_.sprintf] property "%s" does not exist',c[2][k]));h=h[c[2][k]]}}else c[1]?h=e[c[1]]:h=e[g++];if(/[^s]/.test(c[8])&&"number"!=a(h))throw Error(o("[_.sprintf] expecting number but found %s",
a(h)));switch(c[8]){case "b":h=h.toString(2);break;case "c":h=String.fromCharCode(h);break;case "d":h=parseInt(h,10);break;case "e":h=c[7]?h.toExponential(c[7]):h.toExponential();break;case "f":h=c[7]?parseFloat(h).toFixed(c[7]):parseFloat(h);break;case "o":h=h.toString(8);break;case "s":h=(h=""+h)&&c[7]?h.substring(0,c[7]):h;break;case "u":h=Math.abs(h);break;case "x":h=h.toString(16);break;case "X":h=h.toString(16).toUpperCase()}h=/[def]/.test(c[8])&&c[3]&&0<=h?"+"+h:h;r=c[4]?"0"==c[4]?"0":c[4].charAt(1):
" ";x=c[6]-(""+h).length;q=c[6]?d(r,x):"";m.push(c[5]?h+q:q+h)}return m.join("")},b.cache={},b.parse=function(a){for(var b=[],e=[],d=0;a;){if(null!==(b=/^[^\x25]+/.exec(a)))e.push(b[0]);else if(null!==(b=/^\x25{2}/.exec(a)))e.push("%");else{if(null===(b=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(a)))throw Error("[_.sprintf] huh?");if(b[2]){var d=d|1,g=[],h=b[2],i=[];if(null===(i=/^([a-z_][a-z_\d]*)/i.exec(h)))throw Error("[_.sprintf] huh?");for(g.push(i[1]);""!==
(h=h.substring(i[0].length));){if(null===(i=/^\.([a-z_][a-z_\d]*)/i.exec(h)))if(null===(i=/^\[(\d+)\]/.exec(h)))throw Error("[_.sprintf] huh?");g.push(i[1])}b[2]=g}else d|=2;if(3===d)throw Error("[_.sprintf] mixing positional and named placeholders is not (yet) supported");e.push(b)}a=a.substring(b[0].length)}return e},b}(),g={VERSION:"2.2.0rc",isBlank:function(a){return/^\s*$/.test(a)},stripTags:function(a){return(""+a).replace(/<\/?[^>]+>/g,"")},capitalize:function(a){return a+="",a.charAt(0).toUpperCase()+
a.substr(1)},chop:function(a,b){return a+="",b=~~b,0<b?a.match(RegExp(".{1,"+b+"}","g")):[a]},clean:function(a){return g.strip(a).replace(/\s+/g," ")},count:function(a,b){return a+="",b+="",a.split(b).length-1},chars:function(a){return(""+a).split("")},escapeHTML:function(a){return(""+a).replace(/[&<>"']/g,function(a){return"&"+r[a]+";"})},unescapeHTML:function(a){return(""+a).replace(/\&([^;]+);/g,function(a,b){var d;return b in k?k[b]:(d=b.match(/^#x([\da-fA-F]+)$/))?String.fromCharCode(parseInt(d[1],
16)):(d=b.match(/^#(\d+)$/))?String.fromCharCode(~~d[1]):a})},escapeRegExp:function(a){return(""+a).replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},insert:function(a,b,d){a=g.chars(a);return a.splice(~~b,0,""+d),a.join("")},include:function(a,b){return!!~(""+a).indexOf(b)},join:function(){var a=Array.prototype.slice.call(arguments);return a.join(a.shift())},lines:function(a){return(""+a).split("\n")},reverse:function(a){return g.chars(a).reverse().join("")},splice:function(a,b,d,h){a=g.chars(a);return a.splice(~~b,
~~d,h),a.join("")},startsWith:function(a,b){return a+="",b+="",a.length>=b.length&&a.substr(0,b.length)===b},endsWith:function(a,b){return a+="",b+="",a.length>=b.length&&a.substr(a.length-b.length)===b},succ:function(a){var a=a+"",b=g.chars(a);return b.splice(a.length-1,1,String.fromCharCode(a.charCodeAt(a.length-1)+1)),b.join("")},titleize:function(a){return(""+a).replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()})},camelize:function(a){return g.trim(a).replace(/[-_\s]+(.)?/g,function(a,
b){return b.toUpperCase()})},underscored:function(a){return g.trim(a).replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase()},dasherize:function(a){return g.trim(a).replace(/([A-Z])/g,"-$1").replace(/[-_\s]+/g,"-").toLowerCase()},classify:function(a){return g.titleize((""+a).replace(/_/g," ")).replace(/\s/g,"")},humanize:function(a){return g.capitalize(g.underscored(a).replace(/_id$/,"").replace(/_/g," "))},trim:function(a,b){return a+="",!b&&h?h.call(a):(b=m(b),a.replace(RegExp("^"+
b+"+|"+b+"+$","g"),""))},ltrim:function(a,b){return a+="",!b&&n?n.call(a):(b=m(b),a.replace(RegExp("^"+b+"+"),""))},rtrim:function(a,b){return a+="",!b&&i?i.call(a):(b=m(b),a.replace(RegExp(b+"+$"),""))},truncate:function(a,b,d){return a+="",d=d||"...",b=~~b,a.length>b?a.slice(0,b)+d:a},prune:function(a,b,d){a+="";b=~~b;d=null!=d?""+d:"...";var h,i,k=a.replace(/\W/g,function(a){return a.toUpperCase()!==a.toLowerCase()?"A":" "});return i=k.charAt(b),h=k.slice(0,b),i&&i.match(/\S/)&&(h=h.replace(/\s\S+$/,
"")),h=g.rtrim(h),(h+d).length>a.length?a:a.substr(0,h.length)+d},words:function(a,b){return g.trim(a,b).split(b||/\s+/)},pad:function(a,b,j,g){var a=a+"",h=0;b=~~b;j?1<j.length&&(j=j.charAt(0)):j=" ";switch(g){case "right":return h=b-a.length,a+d(j,h);case "both":return h=b-a.length,d(j,Math.ceil(h/2))+a+d(j,Math.floor(h/2));default:return h=b-a.length,d(j,h)+a}},lpad:function(a,b,d){return g.pad(a,b,d)},rpad:function(a,b,d){return g.pad(a,b,d,"right")},lrpad:function(a,b,d){return g.pad(a,b,d,"both")},
sprintf:o,vsprintf:function(a,b){return b.unshift(a),o.apply(null,b)},toNumber:function(a,b){var a=a+"",d;d=1*(1*a||0).toFixed(~~b)||0;return 0===d&&!a.match(/^0+$/)?Number.NaN:d},strRight:function(a,b){a+="";b=null!=b?""+b:b;var d=b?a.indexOf(b):-1;return~d?a.slice(d+b.length,a.length):a},strRightBack:function(a,b){a+="";b=null!=b?""+b:b;var d=b?a.lastIndexOf(b):-1;return~d?a.slice(d+b.length,a.length):a},strLeft:function(a,b){a+="";b=null!=b?""+b:b;var d=b?a.indexOf(b):-1;return~d?a.slice(0,d):
a},strLeftBack:function(a,b){a+="";b=null!=b?""+b:b;var d=a.lastIndexOf(b);return~d?a.slice(0,d):a},toSentence:function(a,b,d){b||(b=", ");d||(d=" and ");for(var g=a.length,h="",i=0;i<g;i++)h+=a[i],i===g-2?h+=d:i<g-1&&(h+=b);return h},slugify:function(a){var b=RegExp(m("\u0105\u00e0\u00e1\u00e4\u00e2\u00e3\u0107\u0119\u00e8\u00e9\u00eb\u00ea\u00ec\u00ed\u00ef\u00ee\u0142\u0144\u00f2\u00f3\u00f6\u00f4\u00f5\u00f9\u00fa\u00fc\u00fb\u00f1\u00e7\u017c\u017a"),"g");return a=(""+a).toLowerCase(),a=a.replace(b,
function(a){return"aaaaaaceeeeeiiiilnooooouuuunczz".charAt("\u0105\u00e0\u00e1\u00e4\u00e2\u00e3\u0107\u0119\u00e8\u00e9\u00eb\u00ea\u00ec\u00ed\u00ef\u00ee\u0142\u0144\u00f2\u00f3\u00f6\u00f4\u00f5\u00f9\u00fa\u00fc\u00fb\u00f1\u00e7\u017c\u017a".indexOf(a))||"-"}),g.dasherize(a.replace(/[^\w\s-]/g,""))},surround:function(a,b){return[b,a,b].join("")},quote:function(a){return g.surround(a,'"')},exports:function(){var a={},b;for(b in this)this.hasOwnProperty(b)&&!b.match(/^(?:include|contains|reverse)$/)&&
(a[b]=this[b]);return a},repeat:d,levenshtein:function(a,b){a+="";b+="";for(var d=[],g,h,i=0;i<=b.length;i++)for(var k=0;k<=a.length;k++)i&&k?a.charAt(k-1)===b.charAt(i-1)?h=g:h=Math.min(d[k],d[k-1],g)+1:h=i+k,g=d[k],d[k]=h;return d.pop()}};g.strip=g.trim;g.lstrip=g.ltrim;g.rstrip=g.rtrim;g.center=g.lrpad;g.rjust=g.lpad;g.ljust=g.rpad;g.contains=g.include;g.q=g.quote;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(module.exports=g),exports._s=g):"function"==typeof define&&
define.amd?define("underscore.string",function(){return g}):(b._=b._||{},b._.string=b._.str=g)})(this);var XRegExp;
XRegExp=XRegExp||function(b){function h(a,b,c){for(var d in g.prototype)g.prototype.hasOwnProperty(d)&&(a[d]=g.prototype[d]);a.xregexp={captureNames:b,isNative:!!c};return a}function i(a){return(a.global?"g":"")+(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.extended?"x":"")+(a.sticky?"y":"")}function n(a,b,c){if(!g.isRegExp(a))throw new TypeError("type RegExp expected");b=p.replace.call(i(a)+(b||""),v,"");c&&(b=p.replace.call(b,RegExp("["+c+"]+","g"),""));return a=a.xregexp&&!a.xregexp.isNative?h(g(a.source,
b),a.xregexp.captureNames?a.xregexp.captureNames.slice(0):null):h(RegExp(a.source,b),null,!0)}function d(a,b){var c=a.length;if(Array.prototype.lastIndexOf)return a.lastIndexOf(b);for(;c--;)if(a[c]===b)return c;return-1}function m(a,b){return Object.prototype.toString.call(a).toLowerCase()==="[object "+b+"]"}function k(a){a=a||{};"all"===a||a.all?a={natives:!0,extensibility:!0}:m(a,"string")&&(a=g.forEach(a,/[^\s,]+/,function(a){this[a]=!0},{}));return a}function r(a,b,c,d){var e=z.length,g=null,
h,i;x=!0;try{for(;e--;)if(i=z[e],("all"===i.scope||i.scope===c)&&(!i.trigger||i.trigger.call(d)))if(i.pattern.lastIndex=b,(h=s.exec.call(i.pattern,a))&&h.index===b){g={output:i.handler.call(d,h,c),match:h};break}}catch(j){throw j;}finally{x=!1}return g}function q(b){g.addToken=a[b?"on":"off"];j.extensibility=b}function o(a){RegExp.prototype.exec=(a?s:p).exec;RegExp.prototype.test=(a?s:p).test;String.prototype.match=(a?s:p).match;String.prototype.replace=(a?s:p).replace;String.prototype.split=(a?s:
p).split;j.natives=a}var g,a,e,j={natives:!1,extensibility:!1},p={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},s={},C={},z=[],F={"default":/^(?:\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??)/,"class":/^(?:\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S]))/},y=/\$(?:{([\w$]+)}|(\d\d?|[\s\S]))/g,
v=/([\s\S])(?=[\s\S]*\1)/g,c=/^(?:[?*+]|{\d+(?:,\d*)?})\??/,t=p.exec.call(/()??/,"")[1]===b,A=RegExp.prototype.sticky!==b,x=!1,B="gim"+(A?"y":"");g=function(a,c){if(g.isRegExp(a)){if(c!==b)throw new TypeError("can't supply flags when constructing one RegExp from another");return n(a)}if(x)throw Error("can't call the XRegExp constructor within token definition functions");var d=[],e="default",i={hasNamedCapture:!1,captureNames:[],hasFlag:function(a){return-1<c.indexOf(a)}},j=0,k,a=a===b?"":""+a,c=
c===b?"":""+c;if(p.match.call(c,v))throw new SyntaxError("invalid duplicate regular expression flag");a=p.replace.call(a,/^\(\?([\w$]+)\)/,function(a,b){if(p.test.call(/[gy]/,b))throw new SyntaxError("can't use flag g or y in mode modifier");c=p.replace.call(c+b,v,"");return""});for(g.forEach(c,/[\s\S]/,function(a){if(0>B.indexOf(a[0]))throw new SyntaxError("invalid regular expression flag "+a[0]);});j<a.length;)(k=r(a,j,e,i))?(d.push(k.output),j+=k.match[0].length||1):(k=p.exec.call(F[e],a.slice(j)))?
(d.push(k[0]),j+=k[0].length):(k=a.charAt(j),"["===k?e="class":"]"===k&&(e="default"),d.push(k),++j);return h(RegExp(d.join(""),p.replace.call(c,/[^gimy]+/g,"")),i.hasNamedCapture?i.captureNames:null)};a={on:function(a,b,c){c=c||{};a&&z.push({pattern:n(a,"g"+(A?"y":"")),handler:b,scope:c.scope||"default",trigger:c.trigger||null});c.customFlags&&(B=p.replace.call(B+c.customFlags,v,""))},off:function(){throw Error("extensibility must be installed before using addToken");}};g.addToken=a.off;g.cache=
function(a,b){var c=a+"/"+(b||"");return C[c]||(C[c]=g(a,b))};g.escape=function(a){return p.replace.call(a,/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")};g.exec=function(a,b,c,d){var e=n(b,"g"+(d&&A?"y":""),!1===d?"y":"");e.lastIndex=c=c||0;a=s.exec.call(e,a);d&&a&&a.index!==c&&(a=null);if(b.global)b.lastIndex=a?e.lastIndex:0;return a};g.forEach=function(a,b,c,d){for(var e=0,h=-1;e=g.exec(a,b,e);)c.call(d,e,++h,a,b),e=e.index+(e[0].length||1);return d};g.globalize=function(a){return n(a,"g")};g.install=function(a){a=
k(a);!j.natives&&a.natives&&o(!0);!j.extensibility&&a.extensibility&&q(!0)};g.isInstalled=function(a){return!!j[a]};g.isRegExp=function(a){return m(a,"regexp")};g.matchChain=function(a,b){return function I(a,c){var d=b[c].regex?b[c]:{regex:b[c]},e=[],l=function(a){e.push(d.backref?a[d.backref]||"":a[0])},f;for(f=0;f<a.length;++f)g.forEach(a[f],d.regex,l);return c===b.length-1||!e.length?e:I(e,c+1)}([a],0)};g.replace=function(a,c,d,e){var h=g.isRegExp(c),i=c;h?(e===b&&c.global&&(e="all"),i=n(c,"all"===
e?"g":"","all"===e?"":"g")):"all"===e&&(i=RegExp(g.escape(""+c),"g"));a=s.replace.call(""+a,i,d);if(h&&c.global)c.lastIndex=0;return a};g.split=function(a,b,c){return s.split.call(a,b,c)};g.test=function(a,b,c,d){return!!g.exec(a,b,c,d)};g.uninstall=function(a){a=k(a);j.natives&&a.natives&&o(!1);j.extensibility&&a.extensibility&&q(!1)};g.union=function(a,b){var c=/(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*]/g,d=0,e,h,i=function(a,b,c){var f=h[d-e];if(b){if(++d,f)return"(?<"+f+">"}else if(c)return"\\"+
(+c+e);return a},j=[],k,f;if(!m(a,"array")||!a.length)throw new TypeError("patterns must be a nonempty array");for(f=0;f<a.length;++f)k=a[f],g.isRegExp(k)?(e=d,h=k.xregexp&&k.xregexp.captureNames||[],j.push(g(k.source).source.replace(c,i))):j.push(g.escape(k));return g(j.join("|"),b)};g.version="2.0.0";s.exec=function(a){var c,e,g,h;if(!this.global)g=this.lastIndex;if(c=p.exec.apply(this,arguments)){!t&&1<c.length&&-1<d(c,"")&&(e=RegExp(this.source,p.replace.call(i(this),"g","")),p.replace.call((""+
a).slice(c.index),e,function(){var a;for(a=1;a<arguments.length-2;++a)arguments[a]===b&&(c[a]=b)}));if(this.xregexp&&this.xregexp.captureNames)for(h=1;h<c.length;++h)(e=this.xregexp.captureNames[h-1])&&(c[e]=c[h]);if(this.global&&!c[0].length&&this.lastIndex>c.index)this.lastIndex=c.index}if(!this.global)this.lastIndex=g;return c};s.test=function(a){return!!s.exec.call(this,a)};s.match=function(a){if(g.isRegExp(a)){if(a.global){var b=p.match.apply(this,arguments);a.lastIndex=0;return b}}else a=RegExp(a);
return s.exec.call(a,this)};s.replace=function(a,b){var c=g.isRegExp(a),e,h,i;if(c){if(a.xregexp)e=a.xregexp.captureNames;if(!a.global)i=a.lastIndex}else a+="";h=m(b,"function")?p.replace.call(""+this,a,function(){var d=arguments,g;if(e){d[0]=new String(d[0]);for(g=0;g<e.length;++g)e[g]&&(d[0][e[g]]=d[g+1])}if(c&&a.global)a.lastIndex=d[d.length-2]+d[0].length;return b.apply(null,d)}):p.replace.call(""+this,a,function(){var a=arguments;return p.replace.call(""+b,y,function(b,c,f){if(c){f=+c;if(f<=
a.length-3)return a[f]||"";f=e?d(e,c):-1;if(0>f)throw new SyntaxError("backreference to undefined group "+b);return a[f+1]||""}if("$"===f)return"$";if("&"===f||0===+f)return a[0];if("`"===f)return a[a.length-1].slice(0,a[a.length-2]);if("'"===f)return a[a.length-1].slice(a[a.length-2]+a[0].length);f=+f;if(!isNaN(f)){if(f>a.length-3)throw new SyntaxError("backreference to undefined group "+b);return a[f]||""}throw new SyntaxError("invalid token "+b);})});if(c)a.lastIndex=a.global?0:i;return h};s.split=
function(a,c){if(!g.isRegExp(a))return p.split.apply(this,arguments);var d=""+this,e=a.lastIndex,h=[],i=0,j,c=(c===b?-1:c)>>>0;g.forEach(d,a,function(a){if(a.index+a[0].length>i)h.push(d.slice(i,a.index)),1<a.length&&a.index<d.length&&Array.prototype.push.apply(h,a.slice(1)),j=a[0].length,i=a.index+j});i===d.length?(!p.test.call(a,"")||j)&&h.push(""):h.push(d.slice(i));a.lastIndex=e;return h.length>c?h.slice(0,c):h};e=a.on;e(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4})|x(?![\dA-Fa-f]{2}))/,
function(a,b){if("B"===a[1]&&"default"===b)return a[0];throw new SyntaxError("invalid escape "+a[0]);},{scope:"all"});e(/\[(\^?)]/,function(a){return a[1]?"[\\s\\S]":"\\b\\B"});e(/(?:\(\?#[^)]*\))+/,function(a){return p.test.call(c,a.input.slice(a.index+a[0].length))?"":"(?:)"});e(/\\k<([\w$]+)>/,function(a){var b=isNaN(a[1])?d(this.captureNames,a[1])+1:+a[1],c=a.index+a[0].length;if(!b||b>this.captureNames.length)throw new SyntaxError("backreference to undefined group "+a[0]);return"\\"+b+(c===a.input.length||
isNaN(a.input.charAt(c))?"":"(?:)")});e(/(?:\s+|#.*)+/,function(a){return p.test.call(c,a.input.slice(a.index+a[0].length))?"":"(?:)"},{trigger:function(){return this.hasFlag("x")},customFlags:"x"});e(/\./,function(){return"[\\s\\S]"},{trigger:function(){return this.hasFlag("s")},customFlags:"s"});e(/\(\?P?<([\w$]+)>/,function(a){if(!isNaN(a[1]))throw new SyntaxError("can't use integer as capture name "+a[0]);this.captureNames.push(a[1]);this.hasNamedCapture=!0;return"("});e(/\\(\d+)/,function(a,
b){if(!("default"===b&&/^[1-9]/.test(a[1])&&+a[1]<=this.captureNames.length)&&"0"!==a[1])throw new SyntaxError("can't use octal escape or backreference to undefined group "+a[0]);return a[0]},{scope:"all"});e(/\((?!\?)/,function(){if(this.hasFlag("n"))return"(?:";this.captureNames.push(null);return"("},{customFlags:"n"});if("undefined"!==typeof exports)exports.XRegExp=g;return g}();;(function(){"use strict";function f(a){throw a;}var i=void 0,j=!0,k=null,l=!1;function aa(){return function(a){return a}}function ba(){return function(){}}function ca(a){return function(b){this[a]=b}}function n(a){return function(){return this[a]}}function da(a){return function(){return a}}var o;function p(a,b){for(var c=a.split("."),d=GLOBAL,e;c.length&&(e=c.shift());)!c.length&&b!==i?d[e]=b:d=d[e]?d[e]:d[e]={}};jQuery.find.matchesSelector=function(){var a=jQuery.find.matchesSelector;return function(b,c){return/^[A-Za-z]+$/.test(c)?1===b.nodeType&&b.nodeName===(jQuery.isXMLDoc(b)?c:c.toUpperCase()):a.call(this,b,c)}}();parseUri.options.strictMode=j;jQuery.cookie.raw=j;var _=GLOBAL._.noConflict();function ea(){}function q(){f(Error("Unimplemented abstract method"))}function fa(){f(new ga("Unsupported operation"))}function ha(a,b){var c;a?(c=ba(),c.prototype=a,c=new c):c={};b&&jQuery.extend(c,b);return c}function s(a,b){a._super=b.prototype;a.prototype=ha(b.prototype);a.prototype.constructor=a}
function ia(a,b,c){function d(e){var e=e||a,g=b.call(this,e);jQuery.extend(this,g);this.name=a;this.message=g.message;"function"===typeof Error.captureStackTrace&&Error.captureStackTrace(g,d);if(g.stack!==i)this.stack=g.stack.split(/\n+/).slice(1).join("\n");c&&c.apply(this,jQuery.makeArray(arguments))}b=b||GLOBAL.Error;s(d,b);return d}
function ja(a,b){if("undefined"===typeof a||a===k)return"Object is null or undefined";var c;c="function"===typeof b?b.prototype:b;var d,e,g;for(g in c){d=typeof c[g];e=typeof a[g];if("undefined"===e)return"Missing property '"+g+"'";if("function"===d&&"function"!==e||"function"!==d&&"function"===e)return"Property '"+g+"' "+("function"===d?"should be":"should not be")+" a function"}return k}function ka(a){try{return jsDump.parse(a)}catch(b){return"[Error dumping object: "+b+"]"}};function la(){}var ma=function(){var a=k;return function(){return a||(a=new la)}}();o=la.prototype;o.getInfo=function(){var a=GLOBAL.navigator;return a?a.userAgent||k:k};o.supportsStack=function(){var a="stack"in Error();la.prototype.supportsStack=function(){return a};return a};o.supportsStackLineNumbers=function(){return na().lines};o.supportsStackCharNumbers=function(){return na().chars};o.supportsStackParameters=function(){return na().params};
function na(){var a=oa();la.prototype.supportsStackLineNumbers=function(){return a.lines};la.prototype.supportsStackCharNumbers=function(){return a.chars};la.prototype.supportsStackParameters=function(){return a.params};return a}
function oa(){function a(a){var b=[];XRegExp.forEach(a,r,function(a){b.push(Number(a[0]))});return b}var b={params:l,lines:l,chars:l},c=l;if(c=function(){var a=k;Error.prepareStackTrace=function(b,c){a=c[0]||k};var c=Error().stack;delete Error.prepareStackTrace;return a?(b.lines="getLineNumber"in a,b.chars="getColumnNumber"in a,c===c):l}())return b;var c=new Function("function x(x1,x2) {\n    function y(y1,y2) {\n        throw new RangeError();\n    }\n    y(x1,x2);\n}\nx('par_one','par_two');"),
d=[["par_one","par_two"],["par_one","par_two"],[]],e=[2,2],g=[-10,-4],h=k;try{c()}catch(m){"string"===typeof m.stack&&(h=m.stack.split(/\n+/))}var r=/\b\d+\b/g;if(h){0<=h[0].indexOf("RangeError")&&h.shift();var R=[],I=[],Ba=j;jQuery(h).slice(0,d.length).each(function(b){var c=a(this),e;if(0<b){e=I.length;for(var g=R[b-1];0<=e--;)I[e].push((c[e]||0)-(g[e]||0))}else for(e=c.length;0<=e--;)I[e]=[];R.push(c);var h=[];jQuery.each(d[b],function(){h.push(XRegExp.escape(this))});b=XRegExp("\\b"+h.join("\\b.+?\\b")+
"\\b","");Ba&&!b.test(this)&&(Ba=l)});var Jd=function(a,b){if(a.length!==b.length)return l;for(var c=-1,d=a.length;++c<d;)if(a[c]!==b[c])return l;return j};jQuery.each(I,function(){if(Jd(this,e))b.lines=j;if(Jd(this,g))b.chars=j});b.params=Ba}return b}
o.supportsPropertyDefinition=function(){var a=l;if("function"===typeof Object.defineProperty){var b=document.createElement("test"),c={};try{var d={get:da("_test_value")};Object.defineProperty(b,"_test_property",d);Object.defineProperty(c,"_test_property",d);a="_test_value"===b._test_property&&"_test_value"===c._test_property}catch(e){}finally{b=k}}la.prototype.supportsPropertyDefinition=function(){return a};return a};var pa=ia("internal.ui.html.EvalError",GLOBAL.Error,function(a,b,c){this.cause=b;this.sourceCode=c});function qa(a){a=a||"0";ra.test(a)||f(Error("Invalid hexadecimal number: "+a));for(var b=a.length,c=4*b,d=Math.ceil(c/28),e=[],g=0;g<d;g++)e.push(parseInt(a.substring(b-7*(g+1),b-7*g),16));this._bitSize=c;this._chunks=e}var ra=/[0-9A-Fa-f]+/;qa.prototype.toString=function(){for(var a=[],b=this._chunks.length-1;0<=b;b--)a.push(_.str.lpad(this._chunks[b].toString(16),7,"0"));a=a.join("");return a.substring(a.length-this._bitSize/4)};function sa(){this._table=new Hashtable(ta,ua)}var va=0;function ta(a){if(a===k)return"l";if(a===i)return"u";if("function"===typeof a.hashCode)return"_"+ta(a.hashCode());var b=typeof a;return"object"===b||"function"===b?(b=a.__wr_map_hash,b===i&&(b=va++,wa(a,"__wr_map_hash",{value:b})),"o"+b):b.substring(0,1)+a.toString()}function ua(a,b){return a&&a.equals!==i?a.equals(b):b&&b.equals!==i?b.equals(a):a===b}var xa={};function ya(a){return a===xa?k:a}o=sa.prototype;
o.put=function(a,b){var a=a===k?xa:a,b=b===k?xa:b,c=this._table.put(a,b);return c===k?i:ya(c)};o.remove=function(a){a=a===k?xa:a;a=this._table.remove(a);return a===k?i:ya(a)};o.clear=function(){this._table.clear()};o.getSize=function(){return this._table.size()};o.get=function(a){a=a===k?xa:a;a=this._table.get(a);return a===k?i:ya(a)};o.getValues=function(){for(var a=this._table.values(),b=-1,c=a.length;++b<c;)a[b]=ya(a[b]);return a};
o.each=function(a){a&&this._table.each(function(b,c){b=ya(b);c=ya(c);a(b,c)})};function za(a,b){for(var c=-1,d=a.length;++c<d;)if(a[c]===b){a.splice(c,1);break}};function Aa(a,b){if(!a)return b;if(!b)return a;var c=parseUri(b);if(c.authority)return b;var d=parseUri(a);if(c.path)d.path=Ca(_.str.startsWith(c.path,"/")?c.path:d.path+"/"+c.path);if(c.path||c.query)d.query=c.query;if(c.path||c.query||c.anchor)d.anchor=c.anchor;return Da(d)}
function Ca(a){var b;0===a.indexOf("/")?(b=j,a=a.substring(1)):b=l;var c=[],d=0;jQuery.each(a.split("/"),function(a,g){g&&"."!==g&&(".."===g?0<d?(c.pop(),d--):(b&&f(Error("Attempt to go up above root directory")),c.push("..")):(c.push(g),d++))});return(b?"/":"")+c.join("/")}
function Da(a){function b(a){var b=[],c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];b.push(c+(d?"="+d:""))}return b.join("&")}var c=parseUri(a.source);if(a.user!==c.user||a.password!==c.password)a.userInfo=a.user?a.user+(a.password?":"+a.password:""):"";if(a.userInfo!==c.userInfo||a.host!==c.host||a.port!==c.port)a.authority=a.host?(a.userInfo?a.userInfo+"@":"")+a.host+(a.port?":"+a.port:""):"";if(a.file!==c.file||a.directory!==c.directory)a.path=a.file?(a.directory?a.directory+"/":"")+a.file:"";
var d=b(a.queryKey),e=b(c.queryKey);if(d!==e)a.query=d;if(a.path!==c.path||a.query!==c.query||a.anchor!==c.anchor)a.relative=a.path?a.path+(a.query?"?"+a.query:"")+(a.anchor?"#"+a.anchor:""):"";return a.protocol!==c.protocol||a.authority!==c.authority||a.relative!==c.relative?(a.protocol?a.protocol+"://":"")+(a.authority||"")+(a.relative||""):a.source}
function Ea(a,b){if(!b)return a;var c="string"===typeof b?b:jQuery.param(b);if(!c)return a;var d=parseUri(a);d.query=d.query?d.query+"&"+c:c;return Da(d)};function Fa(){}p("wr.Disposable",Fa);Fa.prototype.dispose=q;Fa.prototype.dispose=Fa.prototype.dispose;function Ga(){}p("wr.Initializable",Ga);Ga.prototype.init=q;Ga.prototype.init=Ga.prototype.init;function Ha(){}p("wr.Platform",Ha);Ha.prototype.getInfo=q;Ha.prototype.getInfo=Ha.prototype.getInfo;Ha.prototype.supportsStack=q;Ha.prototype.supportsStack=Ha.prototype.supportsStack;Ha.prototype.supportsStackLineNumbers=q;Ha.prototype.supportsStackLineNumbers=Ha.prototype.supportsStackLineNumbers;Ha.prototype.supportsStackCharNumbers=q;Ha.prototype.supportsStackCharNumbers=Ha.prototype.supportsStackCharNumbers;Ha.prototype.supportsStackParameters=q;Ha.prototype.supportsStackParameters=Ha.prototype.supportsStackParameters;
Ha.prototype.supportsPropertyDefinition=q;Ha.prototype.supportsPropertyDefinition=Ha.prototype.supportsPropertyDefinition;function Ia(){}p("wr.Startable",Ia);Ia.prototype.start=q;Ia.prototype.start=Ia.prototype.start;var t=ia("wr.StateError");p("wr.StateError",t);function Ja(){}p("wr.Stoppable",Ja);Ja.prototype.stop=q;Ja.prototype.stop=Ja.prototype.stop;var ga=ia("wr.UnsupportedError");p("wr.UnsupportedError",ga);function Ka(){this._app=k}p("wr.app.AbstractPlugin",Ka);Ka.prototype.getApp=n("_app");Ka.prototype.getApp=Ka.prototype.getApp;Ka.prototype.setApp=ca("_app");Ka.prototype.setApp=Ka.prototype.setApp;Ka.prototype.configure=ea;Ka.prototype.configure=Ka.prototype.configure;
Ka.prototype.configureObjectsList=function(a,b,c,d){var e=this,g=a[b];return this._app.getConfigPlugin().readInstanceListFactory(g||[]).newInstance().chain(function(a){var b=_.isArray(g)&&g.length===a.length?g:k;c.call(e);for(var r=-1,R=a.length;++r<R;){var I=b&&b[r];I&&(I=jQuery.extend({},I),delete I.name,delete I.url);d.call(e,a[r],I)}})};Ka.prototype.configureObjectsList=Ka.prototype.configureObjectsList;function La(){}p("wr.app.AppAware",La);La.prototype.setApp=q;La.prototype.setApp=La.prototype.setApp;p("wr.app.ResourceType",{SCRIPT:"script"});var Ma={config:{implementation:"wr.config.ConfigPlugin",handlers:["wr.config.ObjectConfigHandler","wr.config.JsonConfigHandler"]}};p("wr.app.defaultConfig",Ma);function u(a,b){var c=this;this._size=b.length;this._results=[];this._sortedResults=[];this._errors=[];this._result=new v;jQuery.each(b,function(b){this.onSuccess(function(e){c._results.push(e);c._sortedResults[b]=e;c._result.isResolved()||a.call(c,c._result)}).onFailure(function(b){c._errors.push(b);c._result.isResolved()||a.call(c,c._result)})});this._result.isResolved()||a.call(this,this._result)}p("wr.async.Condition",u);u.prototype.getSize=n("_size");u.prototype.getSize=u.prototype.getSize;
u.prototype.getResults=n("_results");u.prototype.getResults=u.prototype.getResults;u.prototype.getSortedResults=n("_sortedResults");u.prototype.getSortedResults=u.prototype.getSortedResults;u.prototype.getErrors=n("_errors");u.prototype.getErrors=u.prototype.getErrors;u.prototype.onSuccess=function(a){return this._result._promise.onSuccess(a)};u.prototype.onSuccess=u.prototype.onSuccess;u.prototype.onFailure=function(a){return this._result._promise.onFailure(a)};u.prototype.onFailure=u.prototype.onFailure;
u.prototype.onComplete=function(a){return this._result._promise.onComplete(a)};u.prototype.onComplete=u.prototype.onComplete;u.prototype.chain=function(a,b){return this._result._promise.chain(a,b)};u.prototype.chain=u.prototype.chain;function Na(a){return new u(function(a){var c=this._errors;0<c.length?a.failure(c[0]):this._results.length===this.getSize()&&a.success(this._sortedResults)},jQuery.makeArray(arguments))}u.allSuccess=Na;function Oa(){}p("wr.async.Promise",Oa);Oa.prototype.onSuccess=q;Oa.prototype.onSuccess=Oa.prototype.onSuccess;Oa.prototype.onFailure=q;Oa.prototype.onFailure=Oa.prototype.onFailure;Oa.prototype.onComplete=q;Oa.prototype.onComplete=Oa.prototype.onComplete;Oa.prototype.chain=q;Oa.prototype.chain=Oa.prototype.chain;function Pa(a){return ja(a,Oa)===k}p("wr.async.isPromise",Pa);function Qa(a,b,c){var d=jQuery.makeArray(arguments);d.shift();d.shift();return Ra(a,b,d)}p("wr.async.call",Qa);function Ra(a,b,c){var d;try{var e=a.apply(b||GLOBAL,c||[]);d=Pa(e)?e:new Sa(e)}catch(g){d=new Sa(g)}return d}p("wr.async.apply",Ra);function Ta(){}Ta.prototype.onSuccess=q;Ta.prototype.onFailure=q;Ta.prototype.onComplete=q;Ta.prototype.chain=function(a,b){function c(a){a.onSuccess(function(a){d.resolve(a)}).onFailure(function(a){d.reject(a)})}if(!a)return this;var d=jQuery.Deferred();this.onSuccess(function(b){b=a(b);Pa(b)?c(b):d.resolve(b)});if(b)this.onFailure(function(a){a=b(a);Pa(a)?c(a):d.reject(a)});else this.onFailure(function(a){d.reject(a)});return new Ua(d)};function Ua(a){this._deferred=a}s(Ua,Ta);Ua.prototype.onSuccess=function(a){this._deferred.done(a);return this};Ua.prototype.onFailure=function(a){this._deferred.fail(a);return this};Ua.prototype.onComplete=function(a){this._deferred.always(a);return this};function Va(a){this._deferred=a}s(Va,Ua);Va.prototype.onFailure=function(a){return Va._super.onFailure.call(this,function(b){a(Error(b.status+" "+b.statusText))})};Va.prototype.onComplete=function(a){var b=this;return Va._super.onComplete.call(b,function(c){b._deferred.isRejected()?a(Error(c.status+" "+c.statusText)):b._deferred.isResolved()&&a(c)})};function Sa(a){this._result=a}s(Sa,Ta);p("wr.async.FixedPromise",Sa);Sa.prototype.onSuccess=function(a){a&&!(this._result instanceof Error)&&a(this._result);return this};Sa.prototype.onSuccess=Sa.prototype.onSuccess;Sa.prototype.onFailure=function(a){a&&this._result instanceof Error&&a(this._result);return this};Sa.prototype.onFailure=Sa.prototype.onFailure;Sa.prototype.onComplete=function(a){a&&a(this._result);return this};Sa.prototype.onComplete=Sa.prototype.onComplete;var Wa=new Sa(i);
Sa.UNDEFINED=Wa;function v(){this._deferred=new jQuery.Deferred;this._resolved=l;this._promise=new Ua(this._deferred)}p("wr.async.Result",v);v.prototype.isResolved=n("_resolved");v.prototype.isResolved=v.prototype.isResolved;v.prototype.getPromise=n("_promise");v.prototype.getPromise=v.prototype.getPromise;v.prototype.success=function(a){this._resolved&&f(new t("Result already resolved"));this._resolved=j;this._deferred.resolve(a!==i?a:i)};v.prototype.success=v.prototype.success;
v.prototype.failure=function(a){this._resolved&&f(new t("Result already resolved"));this._resolved=j;this._deferred.reject(a)};v.prototype.failure=v.prototype.failure;function Xa(){}p("wr.config.ConfigHandler",Xa);Xa.prototype.accept=q;Xa.prototype.accept=Xa.prototype.accept;Xa.prototype.getRequiredFiles=q;Xa.prototype.getRequiredFiles=Xa.prototype.getRequiredFiles;Xa.prototype.merge=q;Xa.prototype.merge=Xa.prototype.merge;function Ya(){}p("wr.config.Configurable",Ya);Ya.prototype.configure=q;Ya.prototype.configure=Ya.prototype.configure;function Za(){}p("wr.app.Plugin",Za);Za.prototype.setApp=q;Za.prototype.setApp=Za.prototype.setApp;Za.prototype.getApp=q;Za.prototype.getApp=Za.prototype.getApp;function $a(){}p("wr.config.ObjectConfigHandler",$a);$a.prototype.accept=function(a){return a instanceof Object};$a.prototype.accept=$a.prototype.accept;$a.prototype.getRequiredFiles=function(a){a instanceof Object||f(Error("Invalid new configuration provided"));var b=[];if(a=a._require)jQuery.isArray(a)||(a=[a]),jQuery.each(a,function(a,d){"string"===typeof d&&1<d.length||f(Error("Invalid configuration file"));b.push(d)});return b};$a.prototype.getRequiredFiles=$a.prototype.getRequiredFiles;
$a.prototype.merge=function(a,b){b instanceof Object||f(Error("Invalid new configuration provided"));ab(this,a,b,"")};$a.prototype.merge=$a.prototype.merge;
function ab(a,b,c,d){for(var e in c)if(c.hasOwnProperty(e)&&"_require"!==e){var g,h;"+"===e.charAt(e.length-1)?(g=j,h=e.slice(0,-1)):(g=l,h=e);var m=c[e],r=b[h];if(g)if(r instanceof Object)if(jQuery.isArray(r))if(g=r,jQuery.isArray(m)){h=0;for(r=m.length;h<r;h++)g.push(m[h])}else g.push(m);else m instanceof Object?ab(a,r,m,d+"."+h):f(Error("Unable to merge a primitive value into object value of property '"+h+"'"+(d?" in '"+d+"'":"")));else f(Error("Unable to merge a new value into primitive or missing value of property '"+
h+"'"+(d?" in '"+d+"'":"")));else b[h]=m}};function bb(){this._objConfigHandler=new $a}p("wr.config.JsonConfigHandler",bb);bb.prototype.accept=function(a,b){if(b){var c=b.substring(b.lastIndexOf(".")+1);return"string"===typeof a&&"json"===c}return l};bb.prototype.accept=bb.prototype.accept;bb.prototype.getRequiredFiles=function(a,b){"string"!==typeof a&&f(Error("Invalid new configuration provided"));return this._objConfigHandler.getRequiredFiles(jQuery.parseJSON(a),b)};bb.prototype.getRequiredFiles=bb.prototype.getRequiredFiles;
bb.prototype.merge=function(a,b,c){"string"!==typeof b&&f(Error("Invalid new configuration provided"));b=jQuery.parseJSON(b);this._objConfigHandler.merge(a,b,c)};bb.prototype.merge=bb.prototype.merge;function cb(a,b,c){var d,e;"string"===typeof a?(d=a,e=k):"object"===typeof a&&a!==k?(d=a.name,e=a.url):f(Error("Invalid instance factory configuration"));return new db(d,b,e,c)}p("wr.config.readInstanceFactory",cb);function eb(a,b,c){if("string"===typeof a||"object"===typeof a&&a!==k){var d=[];jQuery.isArray(a)||(a=[a]);jQuery.each(a,function(a,g){d.push(cb(g,b,c))});return new fb(d)}f(Error("Invalid instance list factory configuration"))}p("wr.config.readInstanceListFactory",eb);function gb(a,b,c){this._type=a;this._sourceObject=b;this._property=c}p("wr.data.Event",gb);gb.prototype.getType=n("_type");gb.prototype.getType=gb.prototype.getType;gb.prototype.getSourceObject=n("_sourceObject");gb.prototype.getSourceObject=gb.prototype.getSourceObject;gb.prototype.getProperty=n("_property");gb.prototype.getProperty=gb.prototype.getProperty;p("wr.data.EventType",{ADD:"add",CHANGE:"change",REMOVE:"remove"});function hb(){}p("wr.data.Object",hb);hb.prototype.get=q;hb.prototype.get=hb.prototype.get;hb.prototype.set=q;hb.prototype.set=hb.prototype.set;hb.prototype.remove=q;hb.prototype.remove=hb.prototype.remove;hb.prototype.toObject=q;hb.prototype.toObject=hb.prototype.toObject;hb.prototype.addEventListener=q;hb.prototype.addEventListener=hb.prototype.addEventListener;hb.prototype.removeEventListener=q;hb.prototype.removeEventListener=hb.prototype.removeEventListener;hb.prototype.triggerEvent=q;
hb.prototype.triggerEvent=hb.prototype.triggerEvent;p("wr.data.Type",{BLOB:"blob",BOOLEAN:"boolean",DATE:"date",DECIMAL:"decimal",FLOAT:"float",INTEGER:"integer",PASSWORD:"password",STRING:"string",TEXT:"text",TIME:"time",TIMESTAMP:"timestamp",URL:"url"});var ib={ERROR:1,WARN:2,INFO:3,DEBUG:4};p("wr.log.Level",ib);function jb(){this._level=4}p("wr.log.AbstractAppender",jb);jb.prototype.setup=function(a){if(a=a&&a.level)this._level=a};jb.prototype.setup=jb.prototype.setup;jb.prototype.append=function(a){a.getLevel()<=this._level&&this.appendFiltered(a)};jb.prototype.append=jb.prototype.append;jb.prototype.appendFiltered=q;jb.prototype.appendFiltered=jb.prototype.appendFiltered;function kb(){}p("wr.log.Appender",kb);kb.prototype.setup=q;kb.prototype.setup=kb.prototype.setup;kb.prototype.append=q;kb.prototype.append=kb.prototype.append;function w(){}p("wr.log.Log",w);w.prototype.isErrorEnabled=q;w.prototype.isErrorEnabled=w.prototype.isErrorEnabled;w.prototype.error=q;w.prototype.error=w.prototype.error;w.prototype.isWarnEnabled=q;w.prototype.isWarnEnabled=w.prototype.isWarnEnabled;w.prototype.warn=q;w.prototype.warn=w.prototype.warn;w.prototype.isInfoEnabled=q;w.prototype.isInfoEnabled=w.prototype.isInfoEnabled;w.prototype.info=q;w.prototype.info=w.prototype.info;w.prototype.isDebugEnabled=q;w.prototype.isDebugEnabled=w.prototype.isDebugEnabled;
w.prototype.debug=q;w.prototype.debug=w.prototype.debug;function lb(){}p("wr.log.LogEvent",lb);lb.prototype.getTimestamp=q;lb.prototype.getTimestamp=lb.prototype.getTimestamp;lb.prototype.getCategory=q;lb.prototype.getCategory=lb.prototype.getCategory;lb.prototype.getLevel=q;lb.prototype.getLevel=lb.prototype.getLevel;lb.prototype.getMessage=q;lb.prototype.getMessage=lb.prototype.getMessage;lb.prototype.getErrorInfo=q;lb.prototype.getErrorInfo=lb.prototype.getErrorInfo;function mb(){}p("wr.logic.AbstractActor",mb);mb.prototype.execute=q;mb.prototype.execute=mb.prototype.execute;mb.prototype.setup=ba();mb.prototype.setup=mb.prototype.setup;mb.prototype.destroy=ba();mb.prototype.destroy=mb.prototype.destroy;function nb(){}p("wr.logic.Actor",nb);nb.prototype.setup=q;nb.prototype.setup=nb.prototype.setup;nb.prototype.destroy=q;nb.prototype.destroy=nb.prototype.destroy;nb.prototype.execute=q;nb.prototype.execute=nb.prototype.execute;function ob(a,b,c){!b&&c===i&&f(Error("Either source name or source value is required"));this._targetName=a;this._sourceName=b;this._sourceValue=c}p("wr.logic.Coupling",ob);ob.prototype.getTargetName=n("_targetName");ob.prototype.getTargetName=ob.prototype.getTargetName;ob.prototype.getSourceName=n("_sourceName");ob.prototype.getSourceName=ob.prototype.getSourceName;ob.prototype.getSourceValue=n("_sourceValue");ob.prototype.getSourceValue=ob.prototype.getSourceValue;function pb(){}p("wr.nav.AbstractRouter",pb);pb.prototype.route=function(a){var b=this.isRequestImplemented(a);this.alterRequest(a);b&&this.implementRequest(a)};pb.prototype.route=pb.prototype.route;pb.prototype.precompute=function(a){var b=this.isRequestImplemented(a);this.alterRequest(a);return b};pb.prototype.precompute=pb.prototype.precompute;pb.prototype.alterRequest=ba();pb.prototype.alterRequest=pb.prototype.alterRequest;pb.prototype.isRequestImplemented=da(l);
pb.prototype.isRequestImplemented=pb.prototype.isRequestImplemented;pb.prototype.implementRequest=fa;pb.prototype.implementRequest=pb.prototype.implementRequest;function x(){}p("wr.nav.NavListener",x);x.prototype.requestEnqueue=q;x.prototype.requestEnqueue=x.prototype.requestEnqueue;x.prototype.requestCancel=q;x.prototype.requestCancel=x.prototype.requestCancel;x.prototype.requestBeforeServe=q;x.prototype.requestBeforeServe=x.prototype.requestBeforeServe;x.prototype.requestServe=q;x.prototype.requestServe=x.prototype.requestServe;x.prototype.requestRoute=q;x.prototype.requestRoute=x.prototype.requestRoute;x.prototype.requestStart=q;
x.prototype.requestStart=x.prototype.requestStart;x.prototype.requestSuccess=q;x.prototype.requestSuccess=x.prototype.requestSuccess;x.prototype.requestFailure=q;x.prototype.requestFailure=x.prototype.requestFailure;p("wr.nav.ResponseType",{HTML:"html",JSON:"json",XML:"xml"});function qb(){}p("wr.nav.Router",qb);qb.prototype.route=q;qb.prototype.route=qb.prototype.route;qb.prototype.precompute=q;qb.prototype.precompute=qb.prototype.precompute;p("wr.ui.Attribute",{ENABLED:"enabled",VISIBLE:"visible",FOCUSED:"focused",SHOW_EFFECT:"showEffect",HIDE_EFFECT:"hideEffect",WIDTH:"width",HEIGHT:"height",RESIZABLE:"resizable",AUTO_RESIZE:"autoResize",DRAGGABLE:"draggable",CURSOR_TYPE:"cursorType",OPEN:"open",MODAL:"modal",MAXIMIZABLE:"maximizable",MINIMIZABLE:"minimizable",CLOSABLE:"closable"});function rb(){}p("wr.ui.ContextRegistry",rb);rb.prototype.addContext=q;rb.prototype.addContext=rb.prototype.addContext;rb.prototype.removeContext=q;rb.prototype.removeContext=rb.prototype.removeContext;function sb(){}p("wr.ui.ControlFactory",sb);sb.prototype.create=q;sb.prototype.create=sb.prototype.create;sb.prototype.destroy=q;sb.prototype.destroy=sb.prototype.destroy;p("wr.ui.CursorType",{POINTER:"pointer",WAIT:"wait"});p("wr.ui.EffectType",{FADE:"fade",BLIND:"blind",SLIDE:"slide",SCALE:"scale"});function tb(a,b,c){this._type=a;this._sourceControl=b;this._sourceView=c}p("wr.ui.Event",tb);tb.prototype.getType=n("_type");tb.prototype.getType=tb.prototype.getType;tb.prototype.getSourceControl=n("_sourceControl");tb.prototype.getSourceControl=tb.prototype.getSourceControl;tb.prototype.getSourceView=n("_sourceView");tb.prototype.getSourceView=tb.prototype.getSourceView;tb.prototype.toString=function(){return"Event:"+this._type+":("+this._sourceControl+","+this._sourceView+")"};
tb.prototype.toString=tb.prototype.toString;var ub={FOCUS:"focus",BLUR:"blur",CLICK:"click",KEYPRESS:"keypress",KEYDOWN:"keydown",KEYUP:"keyup",CHANGE:"change",OPEN:"open",CLOSE:"close",CONTENT_CHANGE:"contentchange"};p("wr.ui.EventType",ub);function y(){}p("wr.ui.Viewer",y);y.prototype.getView=q;y.prototype.getView=y.prototype.getView;y.prototype.getIndexes=q;y.prototype.getIndexes=y.prototype.getIndexes;y.prototype.setup=q;y.prototype.setup=y.prototype.setup;y.prototype.destroy=q;y.prototype.destroy=y.prototype.destroy;y.prototype.isContextProvider=q;y.prototype.isContextProvider=y.prototype.isContextProvider;y.prototype.setContextRegistry=q;y.prototype.setContextRegistry=y.prototype.setContextRegistry;
y.prototype.getContextRegistry=q;y.prototype.getContextRegistry=y.prototype.getContextRegistry;y.prototype.refreshSubViews=q;y.prototype.refreshSubViews=y.prototype.refreshSubViews;y.prototype.writeAttributes=q;y.prototype.writeAttributes=y.prototype.writeAttributes;y.prototype.readAttributes=q;y.prototype.readAttributes=y.prototype.readAttributes;y.prototype.writeData=q;y.prototype.writeData=y.prototype.writeData;y.prototype.readData=q;y.prototype.readData=y.prototype.readData;
y.prototype.addEventListener=q;y.prototype.addEventListener=y.prototype.addEventListener;y.prototype.removeEventListener=q;y.prototype.removeEventListener=y.prototype.removeEventListener;var vb={fade:"fade",blind:"blind",slide:"slide",scale:"scale"},wb={fade:"fade",blind:"blind",slide:"slide",scale:"scale"};function xb(a){return(a=vb[a])?{effect:a,duration:150}:k}p("wr.ui.jquery.getJQueryEffect",xb);function yb(a){return wb[a.effect||a]}p("wr.ui.jquery.getEffectType",yb);function zb(a){this._error=a;this._name=a.name.valueOf();this._message=a.message?""+a.message.valueOf():k}p("wr.util.ErrorInfo",zb);zb.prototype.getError=n("_error");zb.prototype.getError=zb.prototype.getError;zb.prototype.getName=n("_name");zb.prototype.getName=zb.prototype.getName;zb.prototype.getMessage=n("_message");zb.prototype.getMessage=zb.prototype.getMessage;
zb.prototype.getStack=function(){if(this._stack===i){var a=this._error.stack;if(!a)return k;var b=Ab,c=[];jQuery.each([Bb,Cb],function(){XRegExp.forEach(a,this,function(a){var e=b(a,"line"),g=b(a,"char"),h=b(a,"params")||k,m=b(a,"name")||"",a=b(a,"url"),h=h!==k?h.split(/,/):k;c.push(new Db(m,h,a,e!==k?Number(e):k,g!==k?Number(g):k))})});this._stack=0<c.length?c:k}return this._stack};zb.prototype.getStack=zb.prototype.getStack;
var Bb=new XRegExp("^ +at (?:(?<name0>\\S+) \\((?:unknown source|(?<url0>[^)]+?):(?<line0>\\d+):(?<char0>\\d+))\\)|(?:unknown source|(?<url1>[^)]+?):(?<line1>\\d+):(?<char1>\\d+)))$","mg"),Cb=new XRegExp("^(?<name0>[^(@]*)(?:\\((?<params0>[^)]+)\\))?@(?<url0>.+?):(?<line0>\\d+)$","mg");function Ab(a,b){for(var c=0,d=b+c;a.hasOwnProperty(d);c++,d=b+c)if(d=a[d],"string"===typeof d)return d;return k}
zb.prototype.toString=function(){var a=this._name+": "+this._message,b=this.getStack();return a=b===k?a+"\n\t[stack trace not available]":a+("\n"+b.join("\n"))};zb.prototype.toString=zb.prototype.toString;function Db(a,b,c,d,e){this._name=a;this._params=b;this._url=c;this._lineNumber=d;this._charNumber=e}o=Db.prototype;o.getName=n("_name");o.getParams=n("_params");o.getURL=n("_url");o.getLineNumber=n("_lineNumber");o.getCharNumber=n("_charNumber");
o.toString=function(){var a="\tat "+(this._name||"<anonymous>"),a=a+(this._params?"("+this._params.join(",")+")":"");return a=this._url?a+("("+this._url+(this._lineNumber?":"+this._lineNumber:"")+(this._charNumber?":"+this._charNumber:"")+")"):a+"(<unknown location>)"};function Eb(a){var b;Eb=b="function"===typeof GLOBAL.msSetImmediate?function(a){return GLOBAL.msSetImmediate(a)}:function(a){return GLOBAL.setTimeout(a,25)};b(a)}function Fb(a){var b;Fb=b="function"===typeof GLOBAL.msClearImmediate?function(a){GLOBAL.msClearImmediate(a)}:function(a){GLOBAL.clearTimeout(a)};b(a)};function Gb(a,b,c){this._postCallback=a;this._stepCallback=b;this._completeCallback=c||k;this._timer=this._state=k}Gb.prototype.post=function(a){a=this._postCallback.call(this,this._state,a);a=a===i?k:a;a!==k&&this._state===k&&(this.handleStart(),Hb(this));this._state=a};function Hb(a){a._timer=Eb(function(){a._timer=k;for(var b=(new Date).valueOf();a._state!==k&&100>(new Date).valueOf()-b;){var c=a._stepCallback.call(a,a._state);a._state=c===i?k:c}a._state!==k?Hb(a):a.handleComplete()})}
Gb.prototype.handleStart=ea;Gb.prototype.handleComplete=ea;function Ib(){var a=this;Gb.call(this,function(a,c){if(c)return a=a||[],a.unshift([c]),a},function(a){for(var c=a[0],d=10,e;0<d--&&(e=c.pop());){var g=e.childNodes;if(0==g.length)Jb(e,j);else{c.push(e);for(var h=0,m=g.length;h<m;h++)c.push(g[h])}}for(;c&&0>=c.length;)a.shift(),c=a[0];if(0<a.length)return a},function(a){for(var c;c=a.shift();)Jb(c[0],l)});this._unloadListener=function(){if(a._timer!==k){Fb(a._timer);if(a._completeCallback)a._completeCallback.call(a,a._state),a._state=k;else for(;a._state!==
k;){var b=a._completeCallback.call(a,a._state);a._state=b===i?k:b}a.handleComplete()}}}s(Ib,Gb);Ib.prototype.handleStart=function(){Ib._super.handleStart.call(this);jQuery(GLOBAL).one("unload",this._unloadListener)};Ib.prototype.handleComplete=function(){jQuery(GLOBAL).off("unload",this._unloadListener);Ib._super.handleComplete.call(this)};
function Jb(a,b){if(a){jQuery(a).remove();if(!b)try{a.innerHTML=""}catch(c){for(var d;d=a.lastChild;)Jb(d,l)}a.canHaveChildren&&"removeNode"in a&&a.removeNode(l)}};function Kb(a){Jb(a,l)}var Lb=k;function Mb(a,b){Nb(b,function(){jQuery(a).append(b)})}function Ob(a,b,c){Nb(b,function(){c?jQuery(c).before(b):jQuery(a).append(b)})}
function Nb(a,b){if(a){var c=[];_.each(a,function(a){1===a.nodeType&&("script"===a.tagName.toLowerCase()?c.push(a):c.push.apply(c,jQuery.makeArray(a.getElementsByTagName("script"))))});_.each(c,function(a){a.type=(jQuery(a).attr("type")!==i)+"/"+a.type.replace("script","-script")});b();_.each(c,function(a){var b=/^true\/(.*)/.exec(a.type);b?a.type=b[1].replace("-script","script"):a.removeAttribute("type")});_.each(c,function(a){if((!a.type||/\/(java|ecma)script/i.test(a.type))&&!jQuery.data(a,"wr-executed"))a.src?
jQuery.ajax({type:"GET",global:l,url:a.src,async:l,dataType:"script"}):jQuery.globalEval((a.text||a.textContent||a.innerHTML||"").replace(/^\s*<!(?:\[CDATA\[|\-\-)/,"/*$0*/")),jQuery.data(a,"wr-executed",j)})}}function Pb(){if(!jQuery.globalEval._wr_orig){var a=jQuery.globalEval,b=function(b){try{return a.call(this,b)}catch(d){f(new pa(d.message,d,b))}};b._wr_orig=a;jQuery.globalEval=b}}function Qb(){var a=jQuery.globalEval._wr_orig;if(a)jQuery.globalEval=a}var Rb=[];
function Sb(){function a(a,b){if(Object.prototype.hasOwnProperty.call(a,b))return a[b]}var b=GLOBAL.document,c={openFunc:a(b,"open"),closeFunc:a(b,"close"),writeFunc:a(b,"write"),written:[]};Rb.push(c);b.open=ba();b.close=ba();b.write=function(a){c.written.push(a)}}function Tb(){var a=GLOBAL.document,b=Rb.pop();if(!b)return[];b.openFunc!==i?a.open=b.openFunc:delete a.open;b.closeFunc!==i?a.close=b.closeFunc:delete a.close;b.writeFunc!==i?a.write=b.writeFunc:delete a.write;return b.written};var Ub=[];Ub.push({accept:function(a){return GLOBAL.CKEDITOR&&!!GLOBAL.CKEDITOR.instances[a.name]},getter:function(a){return GLOBAL.CKEDITOR.instances[a.name].getData()},beforeRequest:function(){if(GLOBAL.CKEDITOR){var a=[];_.each(GLOBAL.CKEDITOR.instances,function(b){b instanceof GLOBAL.CKEDITOR.editor&&a.push(b)});_.each(a,function(a){jQuery(a.element.$).closest("html")[0]||a.destroy(j)})}}});
function Vb(a,b,c,d){function e(){var a=h[0],d={},e=[];if(b)d.action=g.attr("action")||k,g.attr("action",Ea(d.action||"",a.extraActionParams));c&&_.each(c,function(a,b){var c=jQuery("<input/>").attr("type","hidden").attr("name",b).val(a);c.appendTo(g);e.push(c[0])});if(a.target)d.target=g.attr("target")||k,g.attr("target",a.target);g[0].submit();Eb(function(){var a=h.shift();_.each(d,function(a,b){a!==k?g.attr(b,a):g.removeAttr(b)});_.each(e,function(a){Kb(a)});a.result.success()})}var g=jQuery(a),
a={extraActionParams:b,extraInputs:c,target:d,result:new v},h=g.data("wr-hijacks");h||g.data("wr-hijacks",h=[]);h.push(a);if(d=1<h.length?h[h.length-2]:k)d.result._promise.onComplete(e);else e();return a.result._promise};function Wb(a,b){this._maxSize="number"===typeof b?b:Number.MAX_VALUE;this._timeout=1E4;this._ensureDispatch=l;this._objects=[];this._objectAvailableCondition=jQuery.proxy(function(){return 0<this._objects.length},this);this._timeoutCommand=jQuery.proxy(function(){this._ensureDispatch&&f(Error("No object available to dispatch to"));return k},this)}o=Wb.prototype;o.getSize=function(){return this._objects.length};o.setTimeout=ca("_timeout");
o.add=function(a,b){var b=b||0,c=-1,d=-1;jQuery.each(this._objects,function(e,g){0>c&&g.priority>b&&(c=e);0>d&&g.object===a&&(d=e)});0<=d||(this._objects.length>=this._maxSize&&f(new RangeError("Unable to add more than "+this._maxSize+" object(s)")),this._objects.splice(0>c?this._objects.length:c,0,{object:a,priority:b}))};o.remove=function(a){var b=this;jQuery.each(this._objects,function(c,d){if(d.object===a)return b._objects.splice(c,1),l})};o.clear=function(){this._objects=[]};
function Xb(a,b,c){var b=b||i,c=c||k,d;d=c!==k?_.find(a._objects,function(a){return c.apply(a.object)}):0<a._objects.length?a._objects[0]:k;return!d?a._timeoutCommand():b.apply(d.object)}function Yb(a,b){var c,b=b||i;c=c||k;var d=l,e=[];(c!==k||0<a._objects.length)&&jQuery.each(a._objects,function(a,h){if(c===k||c.apply(h.object)){var m=b.apply(h.object);"undefined"!==typeof m&&e.push(m);d=j}});!d&&a._timeoutCommand()}
o.find=function(a){var a=a||k,b;b=a!==k?_.find(this._objects,function(b){return a.apply(b.object)}):0<this._objects.length?this._objects[0]:k;return!b?this._timeoutCommand():b.object};p("wr.DEBUG",l);p("wr.VERSION","7.2.12.20160224141936");var Zb;p("wr.getBase",function(){return Zb});var $b;p("wr.getBootParams",function(){return $b});function ac(){"function"!==typeof jQuery&&f(Error("JQuery library not loaded. Please ensure that jQuery JavaScript file is fully loaded before loading the WebRatio Runtime."));var a=jQuery.fn.jquery;0>bc(a,"1.7.1")&&f(Error("Incompatible JQuery library version found: "+a+". The WebRatio Runtime requires JQuery 1.7.1 or later."))}
p("wr.checkEnvironment",ac);p("wr.getPlatform",function(){return ma()});function cc(){}p("wr.util.LifecycleListener",cc);cc.prototype.init=q;cc.prototype.init=cc.prototype.init;cc.prototype.start=q;cc.prototype.start=cc.prototype.start;cc.prototype.stop=q;cc.prototype.stop=cc.prototype.stop;cc.prototype.dispose=q;cc.prototype.dispose=cc.prototype.dispose;function dc(){}p("wr.util.StackEntry",dc);dc.prototype.getName=q;dc.prototype.getName=dc.prototype.getName;dc.prototype.getParams=q;dc.prototype.getParams=dc.prototype.getParams;dc.prototype.getURL=q;dc.prototype.getURL=dc.prototype.getURL;dc.prototype.getLineNumber=q;dc.prototype.getLineNumber=dc.prototype.getLineNumber;dc.prototype.getCharNumber=q;dc.prototype.getCharNumber=dc.prototype.getCharNumber;var ec=new XRegExp("(?<num>[0-9]+)|(?<str>[^\\.\\s0-9]+)");function bc(a,b){function c(a){var b=[];XRegExp.forEach(""+(a||""),ec,function(a){a.num?b.push(Number(a.num)):b.push(a.str)});return b}for(var d=c(a),e=c(b),g=0,h=Math.max(d.length,e.length);g<h;g++){var m=d[g],r=e[g];m===i&&(m="number"===typeof r?0:"");r===i&&(r="number"===typeof m?0:"");if(m>r)return 1;if(m<r)return-1}return 0}p("wr.util.compareVersions",bc);var fc=new sa;p("wr.util.emptyFunction",ea);
function gc(a){if(a===i)return ea;var b=fc.get(a);b||(b=function(){return a},fc.put(a,b));return b}p("wr.util.valueFunction",gc);p("wr.util.errorFunction",function(a,b){if("function"!==typeof a)a=GLOBAL.Error;var c=b?[b]:[];return function(){var b=ha(a.prototype);a.apply(b,c);f(b)}});function hc(a){a&&(a=a.replace(/([^a-zA-Z0-9\-_])/g,"\\$1"));return a}p("wr.util.escapeCss",hc);function ic(a){a&&(a=a.replace(/(['"\\])/g,"\\$1"));return a}p("wr.util.escapeCssString",ic);function jc(a){this._appenders=new Wb;this._rethrowErrors=l;this._categoryLevels={};this._preservedEvents=a?[]:k;this.setLevel("",1)}p("wr.log.Manager",jc);jc.prototype.addAppender=function(a){this._appenders.add(a);if(this._preservedEvents!==k){var b=this;jQuery.each(this._preservedEvents,function(){kc(b,this)});this._preservedEvents=k}};jc.prototype.addAppender=jc.prototype.addAppender;jc.prototype.removeAppender=function(a){this._appenders.remove(a)};jc.prototype.removeAppender=jc.prototype.removeAppender;
jc.prototype.setRethrowErrors=ca("_rethrowErrors");jc.prototype.setRethrowErrors=jc.prototype.setRethrowErrors;jc.prototype.stopPreserving=function(){this._preservedEvents=k};jc.prototype.stopPreserving=jc.prototype.stopPreserving;jc.prototype.setLevel=function(a,b){a=a||"";b?this._categoryLevels[a]=b:(""===a&&f(new t("Root category logging level cannot be removed")),delete this._categoryLevels[a])};jc.prototype.setLevel=jc.prototype.setLevel;
jc.prototype.getLog=function(a){var a=a||"",b=this;return{isErrorEnabled:function(){return lc(b,a,1)},error:function(c,d){b._log(a,1,c,d)},isWarnEnabled:function(){return lc(b,a,2)},warn:function(c,d){b._log(a,2,c,d)},isInfoEnabled:function(){return lc(b,a,3)},info:function(c,d){b._log(a,3,c,d)},isDebugEnabled:function(){return lc(b,a,4)},debug:function(c,d){b._log(a,4,c,d)}}};jc.prototype.getLog=jc.prototype.getLog;
jc.prototype._log=function(a,b,c,d){try{var e=new mc(a,b,c,d?new zb(d):k);if(this._preservedEvents!==k){this._preservedEvents.push(e);return}kc(this,e)}catch(g){}d&&this._rethrowErrors&&f(d)};function kc(a,b){try{var c=nc(a,b.getCategory());b.getLevel()<=c&&Yb(a._appenders,function(){this.append(b)})}catch(d){}}function lc(a,b,c){a=nc(a,b);return c<=a?j:l}function nc(a,b){for(;;){var c=a._categoryLevels[b];if(c)return c;b=b.substring(0,b.lastIndexOf("."))}}
function mc(a,b,c,d){this._timestamp=new Date;this._category=a;this._level=b;this._message=c;this._errorInfo=d}o=mc.prototype;o.getTimestamp=n("_timestamp");o.getCategory=n("_category");o.getLevel=n("_level");o.getMessage=n("_message");o.getErrorInfo=n("_errorInfo");p("wr.log.ROOT_CATEGORY","");p("wr.log.CATEGORY_SEPARATOR",".");var oc={isErrorEnabled:gc(l),isWarnEnabled:gc(l),isInfoEnabled:gc(l),isDebugEnabled:gc(l),error:ea,warn:ea,info:ea,debug:ea};p("wr.log.NULL_LOG",oc);var z=new jc(j);p("wr.log.getManager",function(){return z});function pc(a){this._iframe=a;this._usePseudoXML=l;this._contents=this._contentType=k}pc.prototype._log=z.getLog("internal.util.IFrameAccessor");function qc(a){if(!a._contentType)a._contentType=rc(a,a._iframe);return a._contentType}
function sc(a){var b=qc(a),c=tc(a._iframe);"text/html"===b?(a=uc(c),a={value:a,text:a.documentElement.outerHTML?a.documentElement.outerHTML:"<"+a.documentElement.tagName+">"+a.documentElement.innerHTML+"</"+a.documentElement.tagName+">"}):"text/xml"===b||"application/xml"===b?(a=uc(c.XMLDocument||c),b=GLOBAL.XMLSerializer?(new GLOBAL.XMLSerializer).serializeToString(a):""+a.xml,a={value:a,text:b}):"text/x-pseudo-xml"===b?(b=c.documentElement.textContent||c.documentElement.innerText,a._log.debug("Parsing pseudo-XML"),
b="<"+b.substr(1),GLOBAL.DOMParser?a=(new GLOBAL.DOMParser).parseFromString(b,"text/xml"):(a=new GLOBAL.ActiveXObject("Microsoft.XMLDOM"),a.async="false",a.loadXML(b)),a={value:a,text:b}):"text/plain"===b?(a=c.documentElement.textContent||c.documentElement.innerText,a={value:a,text:a}):a={value:k,text:k};return a}var vc=/^<head><\/head>\s*<body><pre[^>]*>[^><]+<\/pre><\/body>$/i;
function rc(a,b){var c=tc(b),d=c.documentElement;if(c.contentType)return a._usePseudoXML&&"text/plain"===c.contentType&&0===(d.textContent||d.innerText).indexOf("#?xml")?"text/x-pseudo-xml":c.contentType;if(c.xmlVersion||c.XMLDocument)return"text/xml";if(a._usePseudoXML&&0===(d.textContent||d.innerText).indexOf("#?xml"))return"text/x-pseudo-xml";if(a._usePseudoXML)c=c.documentMode,"number"===typeof c&&6>Number(c)&&a._log.warn("A frame is using IE Qurks Mode, possibly resulting in XML parse errors. This may be caused by an X-UA-Compatible header or meta tag");
return vc.test(d.innerHTML)?"text/plain":"text/html"}function tc(a){var b=a.contentDocument;if(!b)b=a.contentWindow.document;return b}function uc(a){var b=a.cloneNode(j);b||(b=a.implementation.createDocument(a.documentElement.namespaceURI,a.documentElement.nodeName),b.replaceChild(b.importNode(a.documentElement,j),b.documentElement));return b};var zc=function(){function a(a,b){var c={};_.each(b.useless||[],function(b){c[b]=function(){g.warn("Calling "+a+"."+b+" - Method has no more use")}});_.each(b.gone||[],function(b){c[b]=function(){g.warn("Calling "+a+"."+b+" - Method is no longer available")}});jQuery.extend(c,b.impl||{});return c}function b(a){"toObject"in a&&(a=a.toObject());return a||{}}function c(a,b){var c=GLOBAL.$H,d=GLOBAL.ajaxRequest;"function"!==typeof c||"function"!==typeof d?g.error("Functions '$H' and 'ajaxRequest' are required for using legacy utilities."):
(c=c(b||{}),d(a,c))}function d(a){return wc(function(b){var c=this,d=jQuery.makeArray(arguments),e=xc();e.isStarted()?a.apply(c,d):(g.debug("Delaying "+b.type+" handler fire to application startup"),e.addLifecycleListener({start:function(){e.removeLifecycleListener(this);a.apply(c,d)}}))})}function e(a){yc.fireWith(GLOBAL,[a]);return a.isPropagationStopped()?(g.debug("Handling of "+a.type+" halted by custom interceptor"),j):l}var g=z.getLog("wr.LegacyUtils"),h=a("WRAjax",{useless:[],gone:["FrameRequest",
"XMLFrameTransport"],impl:{onReady:function(a){jQuery(GLOBAL.document).ready(wc(function(){var b=xc();b.isStarted()?a():b.addLifecycleListener({start:wc(a)})}))}}}),m=a("WRAjaxRequestQueue",{useless:[],gone:"add,submitForm,start,sendRequest,remove,DTO".split(","),impl:{}}),r=a("WRAjaxRequestUtils",{useless:[],gone:"addRequest,removeRequest,startRequest,changeCursor,getResponsePage,computeRequest,processElement,processElementContent,updateElement,addFieldHandler,showNotification,clearNotification,addDroppable".split(","),
impl:{requestsQueue:m}}),R=a("WREvent",{useless:[],gone:["doEvent"],impl:{observe:function(){function a(g,h,m,r){var r=b(r),R=jQuery(g.target),I=g.type;if(!(d[I]===j&&e[I]===j)){if(R.data("ui-wrAutocomplete")){if("change"===I)return;"wrautocompletechange"===I&&(I="change")}(function(){e[I]=j;c(h+"FormBean",jQuery.extend({sourcePage:h,isForm:j,pressedLink:"button:"+m},{onCompleteCallBack:function(){e[I]=l}},r))})()}}var d={focus:j,blur:j,focusin:j,focusout:j},e={};a.bindAsEventListener=function(a){var b=
this,c=jQuery.makeArray(arguments).slice(1);return function(d){return b.apply(a,[d].concat(c))}};return a}()}}),I=a("WREventUtils",{useless:["updateFocusedElement","getFocusedElement","getLastFocusedField","forgetForm","saveFieldValue"],gone:["fieldValueChanged","getActiveAutocompleter"],impl:{observe:function(a,b,c){a=jQuery("#"+hc(a));"change"===b&&a.is(":text, :password")&&(b+=" wrautocompletechange");a.on(b,d(function(a){return e(a)?i:c(a)}))}}}),Ba=a("Form",{useless:[],gone:[],impl:{Element:a("Form.Element",
{useless:[],gone:[],impl:function(){function a(b,c,g,h){jQuery("#"+hc(c)).find(b+"[name='"+ic(g)+"']").each(function(){var a=jQuery(this);a.click(d(function(b){e(b)||h(a[0],a.val())}))})}return{RadioEventObserver:function(b,c,d){a(":radio",b,c,d)},CheckboxEventObserver:function(b,c,d){a(":checkbox",b,c,d)}}}()})}});return{WRAjax:h,WRAjaxRequestUtils:r,WRAjaxRequestQueue:m,WREvent:R,WREventUtils:I,Form:Ba}}();p("wr.LegacyUtils",zc);var yc=jQuery.Callbacks("unique");function Ac(){}p("wr.app.Loader",Ac);Ac.prototype._log=z.getLog("wr.app.Loader");var Bc={};Ac.prototype.load=function(a,b){var c=this._log,d=Cc[b];d||f(Error("Invalid type "+b));var e=Bc[a];if(!e){c.debug("Loading resource "+a);d=d(a);e=new Va(d);if(c.isDebugEnabled())e.onSuccess(function(){c.debug("Loaded resource "+a)}).onFailure(function(b){c.error("Failed to load resource "+a,b)});Bc[a]=e}return e};Ac.prototype.load=Ac.prototype.load;
var Cc={script:function(a){return jQuery.ajax({url:a,dataType:"script",mimeType:"text/plain"})}};function A(){this._app=k;this._config={};this._handlers=new Wb;this._handlers._ensureDispatch=j;this._savedFiles={}}s(A,Ka);p("wr.config.ConfigPlugin",A);A.prototype._log=z.getLog("wr.config.ConfigPlugin");A.prototype.getConfig=n("_config");A.prototype.getConfig=A.prototype.getConfig;A.prototype.setConfig=ca("_config");A.prototype.setConfig=A.prototype.setConfig;A.prototype.configure=function(a){return this.configureObjectsList(a,"handlers",function(){this._handlers.clear()},function(a){this.addHandler(a)})};
A.prototype.configure=A.prototype.configure;A.prototype.addHandler=function(a){this._handlers.add(a)};A.prototype.addHandler=A.prototype.addHandler;A.prototype.removeHandler=function(a){this._handlers.remove(a)};A.prototype.removeHandler=A.prototype.removeHandler;
A.prototype.merge=function(a){var b=this._log,c=this,d=new v;try{var e=Dc(c,a,k),g=e.getRequiredFiles(a,k);if(0<g.length)c.mergeFiles.apply(c,g).onSuccess(function(){try{e.merge(c._config,a,k),d.success()}catch(b){d.failure(b)}}).onFailure(function(a){d.failure(a)});else e.merge(c._config,a,k),d.success()}catch(h){b.error("Error merging new configuration ",h),d.failure(h)}return d._promise};A.prototype.merge=A.prototype.merge;
A.prototype.mergeFiles=function(a){var b=this._log,c=this,d=jQuery.makeArray(arguments),e=[];b.debug("Loading files "+d);jQuery.each(d,function(a,d){var m=c._savedFiles[d];if(m)e.push(m);else{var r=new v,m=r._promise;c._savedFiles[d]=m;e.push(m);b.debug("Downloading file "+d);m=jQuery.ajax({url:d,mimeType:"text/plain"});(new Va(m)).onSuccess(function(a){try{var e=Dc(c,a,d),g=e.getRequiredFiles(a,d);if(0<g.length){var m=Aa(d,"..");jQuery.each(g,function(a,b){g[a]=Aa(m,b)});c.mergeFiles.apply(c,g).onSuccess(function(){b.debug("Merging file "+
d);try{e.merge(c._config,a,d),r.success()}catch(g){b.error("Error merging file "+d,g),r.failure(g)}}).onFailure(function(a){b.error("Error loading file "+d,a);r.failure(a)})}else b.debug("Merging file "+d),e.merge(c._config,a,d),r.success()}catch(Id){b.error("Error loading file "+d,Id),r.failure(Id)}}).onFailure(function(a){b.error("Error downloading file "+d,a);r.failure(a)})}});return Na.apply(u,e)};A.prototype.mergeFiles=A.prototype.mergeFiles;
function Dc(a,b,c){return Xb(a._handlers,function(){return this},function(){return this.accept(b,c)})}A.prototype.readInstanceFactory=function(a,b){return cb(a,b||k,this.getApp()._loader)};A.prototype.readInstanceFactory=A.prototype.readInstanceFactory;A.prototype.readInstanceListFactory=function(a,b){return eb(a,b||k,this.getApp()._loader)};A.prototype.readInstanceListFactory=A.prototype.readInstanceListFactory;function Ec(){this._appenders=[]}s(Ec,Ka);p("wr.log.LogPlugin",Ec);Ec.prototype.configure=function(a){var b=a.categories||{},c=this.getLogManager();b[""]||(b[""]=1);B(b,function(a,b){c.setLevel(b,a)});return this.configureObjectsList(a,"appenders",function(){for(var a=-1,b=this._appenders.length;++a<b;)this.removeAppender(this._appenders[a])},function(a,b){a.setup(b);this.addAppender(a)})};Ec.prototype.configure=Ec.prototype.configure;Ec.prototype.init=function(){this.getLogManager().stopPreserving()};
Ec.prototype.init=Ec.prototype.init;Ec.prototype.addAppender=function(a){this.getLogManager().addAppender(a);this._appenders.push(a)};Ec.prototype.addAppender=Ec.prototype.addAppender;Ec.prototype.removeAppender=function(a){this.getLogManager().removeAppender(a);za(this._appenders,a)};Ec.prototype.removeAppender=Ec.prototype.removeAppender;Ec.prototype.getLog=function(a){return this.getLogManager().getLog(a)};Ec.prototype.getLog=Ec.prototype.getLog;Ec.prototype.getLogManager=function(){return z};
Ec.prototype.getLogManager=Ec.prototype.getLogManager;function C(){this._routers=new Wb;this._requests=[];this._serving=l;this._listeners=[]}s(C,Ka);p("wr.nav.NavPlugin",C);C.prototype._log=z.getLog("wr.nav.NavPlugin");C.prototype.configure=function(a){return this.configureObjectsList(a,"routers",function(){this._routers.clear()},function(a,c){this.addRouter(a,Number(c.priority)||i)})};C.prototype.configure=C.prototype.configure;C.DEFAULT_PRIORITY=0;C.prototype.addRouter=function(a,b){this._routers.add(a,-b||0)};C.prototype.addRouter=C.prototype.addRouter;
C.prototype.removeRouter=function(a){this._routers.remove(a)};C.prototype.removeRouter=C.prototype.removeRouter;C.prototype.navigate=function(a){var b=new v;this._requests.push({request:a,result:b});this._triggerListeners("requestEnqueue",a);if(!this._serving)this._serving=j,Fc(this);return b._promise};C.prototype.navigate=C.prototype.navigate;
C.prototype.cancel=function(a){var b=this;_.find(this._requests,function(c,d){if(c.request===a)return b._requests.splice(d,1),b._log.debug("Canceling "+a),b._triggerListeners("requestCancel",a),c.result.failure(Error("Canceled")),j})};C.prototype.cancel=C.prototype.cancel;C.prototype.precompute=function(a){var b=l;Yb(this._routers,function(){b||(b=this.precompute(a))});b||f(Error("Found no router implementing "+a))};C.prototype.precompute=C.prototype.precompute;
function Fc(a){var b;do(b=a._requests[0])&&a._triggerListeners("requestBeforeServe",b.request);while(b&&b!==a._requests[0]);if(b){a._requests.shift();var c=b.request,d=b.result;a._log.isDebugEnabled()&&a._log.debug("Serving "+c);a._triggerListeners("requestServe",c);b=function(b,e,g){a._triggerListeners("requestSuccess",c,b,e,g);d.success(g);Fc(a)};var e=function(b,e){a._triggerListeners("requestFailure",c,b,e);d.failure(Error(b||"Failed"));Fc(a)};c.addSuccessListener(b);c.addFailureListener(e);try{var g=
l;Yb(a._routers,function(){g||(a._triggerListeners("requestRoute",c,this),this.route(c),g=c.isStarted())});g||(a._log.error("Found no router implementing "+c),c.removeSuccessListener(b),c.removeFailureListener(e),f(Error("Not routed")));a._triggerListeners("requestStart",c)}catch(h){a._log.error("Error serving "+c,h),d.failure(h)}}else a._serving=l}C.prototype.addListener=function(a){a&&0>_.indexOf(this._listeners,a)&&this._listeners.push(a)};C.prototype.addListener=C.prototype.addListener;
C.prototype.removeListener=function(a){za(this._listeners,a)};C.prototype.removeListener=C.prototype.removeListener;C.prototype._triggerListeners=function(a,b){var c=this,d=jQuery.makeArray(arguments);d.shift();_.each(this._listeners,function(b){var g=b[a];if(g)try{g.apply(b,d)}catch(h){c._log.error("Error invoking '"+a+"' of navigation listener",h)}})};function D(a,b,c,d){a=Gc(a);this._url=a.url;this._params=jQuery.extend({},a.params)||{};jQuery.extend(this._params,b);this._inputs=jQuery.makeArray(c)||[];this._target=d;this._responseTypes=k;this._listeners={};this._completed=this._started=l}p("wr.nav.Request",D);D.prototype._log=z.getLog("wr.nav.Request");D.prototype.getURL=n("_url");D.prototype.getURL=D.prototype.getURL;D.prototype.setURL=function(a){a=Gc(a);this._url=a.url;jQuery.extend(this._params,a.params)};D.prototype.setURL=D.prototype.setURL;
function Gc(a){var a=parseUri(a),b=jQuery.deparam.querystring(a.query);a.query="";return{url:Da(a),params:b}}D.prototype.getParams=n("_params");D.prototype.getParams=D.prototype.getParams;D.prototype.getInputs=n("_inputs");D.prototype.getInputs=D.prototype.getInputs;D.prototype.isDeparting=function(){return this._target!==i};D.prototype.isDeparting=D.prototype.isDeparting;D.prototype.getTarget=n("_target");D.prototype.getTarget=D.prototype.getTarget;
D.prototype.setTarget=function(a){this.isDeparting()||f(new t("Cannot change target of non-departing requests"));this._target=a!==i?a:k};D.prototype.setTarget=D.prototype.setTarget;D.prototype.getResponseTypes=function(){return this._responseTypes&&this._responseTypes.slice()};D.prototype.getResponseTypes=D.prototype.getResponseTypes;D.prototype.setResponseTypes=function(a){this._responseTypes=0<arguments.length?jQuery.makeArray(arguments):k};D.prototype.setResponseTypes=D.prototype.setResponseTypes;
D.prototype.isStarted=n("_started");D.prototype.isStarted=D.prototype.isStarted;D.prototype.addStartListener=function(a){Hc(this,"start",a)};D.prototype.addStartListener=D.prototype.addStartListener;D.prototype.removeStartListener=function(a){Ic(this,"start",a)};D.prototype.removeStartListener=D.prototype.removeStartListener;D.prototype.start=function(){Jc(this,l,k);this._started=j;this._triggerListeners("start")};D.prototype.start=D.prototype.start;D.prototype.isCompleted=n("_completed");
D.prototype.isCompleted=D.prototype.isCompleted;D.prototype.addSuccessListener=function(a){Hc(this,"success",a)};D.prototype.addSuccessListener=D.prototype.addSuccessListener;D.prototype.removeSuccessListener=function(a){Ic(this,"success",a)};D.prototype.removeSuccessListener=D.prototype.removeSuccessListener;D.prototype.success=function(a,b,c){Jc(this,j,l);this._completed=j;this._triggerListeners("success",[a,b,c])};D.prototype.success=D.prototype.success;
D.prototype.addFailureListener=function(a){Hc(this,"failure",a)};D.prototype.addFailureListener=D.prototype.addFailureListener;D.prototype.removeFailureListener=function(a){Ic(this,"failure",a)};D.prototype.removeFailureListener=D.prototype.removeFailureListener;D.prototype.failure=function(a,b){Jc(this,j,l);this._completed=j;this._triggerListeners("failure",[a,b])};D.prototype.failure=D.prototype.failure;function Hc(a,b,c){"function"===typeof c&&(a=a._getCallbacks(b,j),a.add(c),a._count++)}
function Ic(a,b,c){var d=a._getCallbacks(b);d&&(c&&(d.remove(c),d._count--),(!c||0>=d._count)&&a._removeCallbacks(b))}D.prototype._triggerListeners=function(a,b){var c=this._getCallbacks(a);if(c)try{c.fireWith(this,b)}catch(d){this._log.error("Error handling "+a+" of request "+this,d)}};D.prototype._getCallbacks=function(a,b){var c=this._listeners,d=c[a];if(!d&&b)c[a]=d=jQuery.Callbacks("unique"),d._count=0;return d};
D.prototype._removeCallbacks=function(a){var b=this._listeners,c=b[a];c&&(c.empty(),delete b[a])};function Jc(a,b,c){b!==k&&a._started!==b&&f(new t("Request "+(b?"not":"already")+" started"));c!==k&&a._completed!==c&&f(new t("Request "+(c?"not":"already")+" completed"))};var Kc=z.getLog("wr.ui.html"),Lc={blob:k,"boolean":"boolean",date:"Date",decimal:"number","float":"number",integer:"number",password:"string",string:"string",text:"string",time:"Date",timestamp:"Date",url:"string"};p("wr.ui.html.getScriptType",function(a){return Lc[a]});
function Mc(a){function b(a){return!jQuery(a).parents().andSelf().filter(function(){var a=jQuery(this);return!(a.is("div")&&"inline"===a.css("display"))&&("hidden"===a.attr("type")||a.is(":hidden"))}).length}var c=!isNaN(jQuery(a).attr("tabindex")),d=a.nodeName.toLowerCase();if("area"===d){c=a.parentNode;d=c.name;if(!a.href||!d||"map"!==c.nodeName.toLowerCase())return l;a=jQuery("img[usemap=#"+d+"]")[0];return!!a&&b(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||
c:c)&&b(a)}p("wr.ui.html.isFocusable",Mc);function Nc(a){Kc.isDebugEnabled()&&Kc.debug("Focusing element "+ka(a));try{a.focus()}catch(b){Kc.warn("Element "+ka(a)+" is not currently focusable")}}p("wr.ui.html.focus",Nc);
function Oc(a){var b=Pc(a);try{if("number"===typeof a.selectionStart)return{start:a.selectionStart};if("undefined"!==typeof b.selection&&"string"===typeof a.value){var c=b.selection.createRange();if(c&&c.parentElement()===a)return c.moveStart("character",-a.value.length),{start:c.text.length}}}catch(d){}return k}p("wr.ui.html.getSelectedRange",Oc);
function Qc(a,b){var c=Pc(a);try{if("number"===typeof a.selectionStart)a.setSelectionRange(b.start,b.start);else if("undefined"!==typeof c.selection&&"string"===typeof a.value){var d=c.selection.createRange();d&&d.parentElement()===a&&(d.move("character",-a.value.length),d.move("character",b.start),d.select())}}catch(e){}}p("wr.ui.html.setSelectedRange",Qc);
var Rc=function(){var a=/\W/g;return function(b,c,d){if(c.replace(a,"")!==d.replace(a,""))return b;for(var e=0,g=Math.min(b.start,c.length,d.length),h=0,m=0;h<=g&&m<=g;h++,m++){var r=a.test(c[h]),R=a.test(d[m]);r!==R&&(r&&!R?(m--,h<b.start&&e--):(h--,e++))}return{start:Math.max(0,b.start+e)}}}();p("wr.ui.html.recomputeRange",Rc);p("wr.ui.html.addRemoveListener",function(a,b){var c=GLOBAL.setInterval(function(){jQuery.contains(GLOBAL.document.documentElement,a)||(GLOBAL.clearInterval(c),b(a))},500)});
function Pc(a){a=a&&a.ownerDocument;(!a||9!==a.nodeType)&&f(Error("Element must be part of a document"));return a};var Sc=z.getLog("wr.ui.html.resx");function Tc(a,b){var c=jQuery(a),d=c.attr("src")||c.attr("href"),e=c.data("wr-resname");return e?(d=c.data("wr-resver")||k,{name:e,version:d!==k?""+d:k,unloadable:Uc(c)}):b&&d?{name:"_path-"+d,version:k,unloadable:Uc(c)}:k}p("wr.ui.html.resx.getInfo",Tc);function Uc(a){var b=a[0].nodeName.toLowerCase();return"style"===b?j:"link"===b?"stylesheet"===a.attr("rel"):l}
p("wr.ui.html.resx.getLoaded",function(a){var b=_.clone(Vc());a||_.each(_.keys(Wc),function(a){delete b[a]});return b});
function Xc(a){var b=Vc(),c=b[a.name];if(c)return c.version===a.version?Sc.debug("Skipping loading of resource '"+a.name+"' (version "+(a.version||"unknown")+") since it is already loaded"):Sc.warn("Blocked loading of conflicting resource '"+a.name+"': version "+(a.version||"unknown")+" was incoming, but version "+(c.version||"unknown")+" is already loaded"),l;b[a.name]=jQuery.extend({unloadable:l},a);return Wc[a.name]=j}p("wr.ui.html.resx.registerLoading",Xc);
function Yc(a){Wc[a]!==j&&f(new t);delete Wc[a];Zc(a)}p("wr.ui.html.resx.registerLoaded",Yc);function $c(){Vc(j)}p("wr.ui.html.resx.refreshLoaded",$c);
var Vc=function(){var a=k;return function(b){if(!a||b){a||(a={});var c=_.clone(a);jQuery("script, link, style").each(function(){var d=Tc(this,j);if(d){if(!b||!a.hasOwnProperty(d.name))a[d.name]=d,Zc(d.name);delete c[d.name]}});_.each(c,function(b){b.unloadable&&(Sc.debug("Unloading resource '"+b.name+"' (version "+(b.version||"unknown")+") which is no longer in the document"),delete a[b.name])})}return a}}(),Wc={},ad={};
p("wr.ui.html.resx.addListener",function(a,b,c){(ad[a]||(ad[a]=jQuery.Callbacks("unique"))).add(b);c&&Zc(a,b)});p("wr.ui.html.resx.removeListener",function(a,b){var c=ad[a];c&&c.remove(b)});function Zc(a,b){var c,d=Vc()[a];d&&(b?b.apply(GLOBAL,[d]):(c=ad[a])&&c.fireWith(GLOBAL,[d]))};function E(a){this._owner=a;this._objects=[];this._runningPhase=this._completedPhase=k;this._listeners=[]}p("wr.util.LifecycleManager",E);E.prototype._log=z.getLog("wr.util.LifecycleManager");E.prototype.getOwner=n("_owner");E.prototype.getOwner=E.prototype.getOwner;var bd={};bd[k]=["init"];bd.init=["start","dispose"];bd.start=["stop"];bd.stop=["dispose","start"];bd.dispose=[];
var cd={init:["init"],start:["init","start"],stop:["init"],dispose:[]},dd={init:["dispose"],start:["stop","dispose"],stop:["dispose"],dispose:[]};function ed(a,b){0>_.indexOf(bd[a._completedPhase],b)&&f(new t("Unable to transition to "+b+" phase after "+a._completedPhase+" phase"));a._log.debug("Running phase "+b);a._runningPhase=b;var c=a._objects.slice(0);return fd(a,[b],c).chain(function(){a._runningPhase=k;a._completedPhase=b;gd(a,b);a._log.debug("Completed phase "+b)})}
function hd(a,b){var c=[b],d=Wa,e=cd[a._completedPhase];e&&(d=d.chain(function(){a._log.debug("Applying completed phases "+e+" to "+b);return fd(a,e,c)},i));a._runningPhase!==k&&(d=d.chain(function(){a._log.debug("Applying running phase "+a._runningPhase+" to "+b);return fd(a,[a._runningPhase],c)}));return d}function id(a,b){var c=dd[a._completedPhase];return c?(a._log.debug("Applying future phases "+c+" to "+b),fd(a,c,[b])):Wa}
function fd(a,b,c){for(var d=[],e=-1,g=c.length;++e<g;){for(var h=c[e],m=Wa,r=-1,R=b.length;++r<R;){var I=b[r],Ba=h[I];"function"===typeof Ba&&(m=m.chain(function(){return Ra(Ba,h)}).onFailure(function(b){a._log.error("Error during "+I+" of "+h,b)}))}d.push(m)}return Na.apply(u,d)}E.prototype.register=function(a){var b=this;if(!a)return Wa;var c=l;jQuery.each(this._objects,function(b,e){if(e===a)return c=j,l});return c?Wa:hd(this,a).chain(function(){b._objects.push(a)})};E.prototype.register=E.prototype.register;
E.prototype.unregister=function(a){var b=this;if(!a)return Wa;var c=k;jQuery.each(this._objects,function(d,e){if(e===a)return b._objects.splice(d,1),c=a,l});return!c?Wa:id(this,c)};E.prototype.unregister=E.prototype.unregister;E.prototype.addListener=function(a,b){if(a&&!_.contains(this._listeners,a)&&(this._listeners.push(a),b)){var c=cd[this._completedPhase];c&&_.each(c,function(b){jd(this,a,b)},this)}};E.prototype.addListener=E.prototype.addListener;
E.prototype.removeListener=function(a){a&&za(this._listeners,a)};E.prototype.removeListener=E.prototype.removeListener;function gd(a,b){_.each(a._listeners,function(a){jd(this,a,b)},a)}function jd(a,b,c){c=b[c];if("function"===typeof c)try{c.call(b,a._owner)}catch(d){a._log.error("Error in lifecycle listener",d)}}E.prototype.init=function(){return ed(this,"init")};E.prototype.init=E.prototype.init;E.prototype.start=function(){return ed(this,"start")};E.prototype.start=E.prototype.start;
E.prototype.stop=function(){return ed(this,"stop")};E.prototype.stop=E.prototype.stop;E.prototype.dispose=function(){return ed(this,"dispose")};E.prototype.dispose=E.prototype.dispose;function F(a){this._data={};this._size=0;a!==i&&this.setRootData(a)}p("wr.util.coll.DataTree",F);F.prototype.getSize=n("_size");F.prototype.getSize=F.prototype.getSize;F.prototype.getData=function(a){return this._data[(a?a+".":"")+"__"]};F.prototype.getData=F.prototype.getData;F.prototype.setData=function(a,b){var c=(a?a+".":"")+"__",d=this._data.hasOwnProperty(c);b!==i?(this._data[c]=b,d||this._size++):d&&(delete this._data[c],this._size--)};F.prototype.setData=F.prototype.setData;
F.prototype.getRootData=function(){return this.getData(k)};F.prototype.getRootData=F.prototype.getRootData;F.prototype.setRootData=function(a){this.setData(k,a)};F.prototype.setRootData=F.prototype.setRootData;F.prototype.getTree=function(a){var b=(a||"")+".",c=b.length,d=this._data,a={},e=0,g;for(g in d)d.hasOwnProperty(g)&&kd(d,g)&&0===g.indexOf(b)&&(a[g.substring(c)]=d[g],e++);g=new F;g._data=a;g._size=e;return g};F.prototype.getTree=F.prototype.getTree;
F.prototype.setTree=function(a,b){var c=(a||"")+".",d=this._data,e;for(e in d)d.hasOwnProperty(e)&&kd(d,e)&&0===e.indexOf(c)&&(delete d[e],this._size--);if(b){var g=b._data;for(e in g)g.hasOwnProperty(e)&&kd(g,e)&&(d[c+e]=g[e],this._size++)}};F.prototype.setTree=F.prototype.setTree;function ld(a,b){function c(a){var b=d.get(a);b||(b={o:[],n:[]},d.put(a,b));return b}var a=a||[],b=b||[],d=new sa;jQuery.each(a,function(a,b){c(b).o.push(a)});jQuery.each(b,function(a,b){c(b).n.push(a)});var e=[],g=[];d.each(function(a,b){for(;b.n.length>b.o.length;){var c=b.n.pop();e.push({value:a,newIndex:c})}for(;b.o.length>b.n.length;)c=b.o.pop(),g.push({value:a,oldIndex:c})});return{added:e,removed:g}}p("wr.util.coll.computeArrayDiffs",ld);
function md(a,b,c,d){if(c||d){var a=ld(a,b),e,g;if(c)for(b=-1,e=a.removed.length;++b<e;)g=a.removed[b],c(g.value,g.oldIndex);if(d)for(b=-1,e=a.added.length;++b<e;)g=a.added[b],d(g.value,g.newIndex)}}p("wr.util.coll.walkArrayDiffs",md);p("wr.util.coll.unmodifiableArray",function(a){return a||[]});function G(a,b,c){this._view=a;this._lastSubViews=k;this._indexes=b;this._subViewsSupported=c;this._eventListeners=this._contextRegistry=k}p("wr.ui.AbstractViewer",G);G.prototype.getView=n("_view");G.prototype.getView=G.prototype.getView;G.prototype.getIndexes=function(){return this._indexes||[]};G.prototype.getIndexes=G.prototype.getIndexes;G.prototype.setup=q;G.prototype.setup=G.prototype.setup;G.prototype.destroy=function(){this._contextRegistry=k};G.prototype.destroy=G.prototype.destroy;
G.prototype.isContextProvider=n("_subViewsSupported");G.prototype.isContextProvider=G.prototype.isContextProvider;G.prototype.setContextRegistry=function(a){this.isContextProvider()||f(new ga("Not a context provider"));this._contextRegistry=a};G.prototype.setContextRegistry=G.prototype.setContextRegistry;G.prototype.getContextRegistry=n("_contextRegistry");G.prototype.getContextRegistry=G.prototype.getContextRegistry;G.prototype.refreshSubViews=ba();G.prototype.refreshSubViews=G.prototype.refreshSubViews;
G.prototype.collectSubViewsDiffs=function(a){var a=a||this.getView().getViews(),b=[],c=[];md(this._lastSubViews,a,function(a){c.push(a)},function(a){b.push(a)});this._lastSubViews=a.slice();return{added:b,removed:c}};G.prototype.collectSubViewsDiffs=G.prototype.collectSubViewsDiffs;G.prototype.writeAttributes=ba();G.prototype.writeAttributes=G.prototype.writeAttributes;G.prototype.readAttributes=function(){return{}};G.prototype.readAttributes=G.prototype.readAttributes;G.prototype.writeData=ba();
G.prototype.writeData=G.prototype.writeData;G.prototype.readData=ba();G.prototype.readData=G.prototype.readData;G.prototype.addEventListener=function(a){if(a)(this._eventListeners||(this._eventListeners=jQuery.Callbacks("unique"))).add(a)};G.prototype.addEventListener=G.prototype.addEventListener;G.prototype.removeEventListener=function(a){this._eventListeners&&(a?this._eventListeners.remove(a):this._eventListeners.empty())};G.prototype.removeEventListener=G.prototype.removeEventListener;
G.prototype.raiseEvent=function(a,b){a&&this._eventListeners&&(b=b||this._view,this._eventListeners.fireWith(this,[a,b]))};G.prototype.raiseEvent=G.prototype.raiseEvent;function nd(a,b){G.call(this,a,b,j)}s(nd,G);p("wr.ui.AbstractDisplayViewer",nd);nd.prototype.setup=function(){od(this)};nd.prototype.setup=nd.prototype.setup;nd.prototype.destroy=function(){od(this);nd._super.destroy.call(this)};nd.prototype.destroy=nd.prototype.destroy;nd.prototype.refreshSubViews=function(){od(this)};nd.prototype.refreshSubViews=nd.prototype.refreshSubViews;
function od(a){var b=a.collectSubViewsDiffs();jQuery.each(b.removed,function(b,d){a.destroyWindow(d)});jQuery.each(b.added,function(b,d){a.createWindow(d)})}nd.prototype.createWindow=q;nd.prototype.createWindow=nd.prototype.createWindow;nd.prototype.destroyWindow=q;nd.prototype.destroyWindow=nd.prototype.destroyWindow;function pd(a,b){this._id=a;this._config=b;this._parent=k;this._views=[]}p("wr.ui.View",pd);pd.prototype.getId=n("_id");pd.prototype.getId=pd.prototype.getId;pd.prototype.getConfig=n("_config");pd.prototype.getConfig=pd.prototype.getConfig;pd.prototype.getParent=n("_parent");pd.prototype.getParent=pd.prototype.getParent;
pd.prototype.setParent=function(a){if(this._parent!==a&&!this._guard_setParent){this._guard_setParent=j;try{if(this._parent)this._parent.removeView(this),this._parent=k;if(a)a.addView(this),this._parent=a}finally{delete this._guard_setParent}}};pd.prototype.setParent=pd.prototype.setParent;pd.prototype.getViews=function(){return this._views||[]};pd.prototype.getViews=pd.prototype.getViews;
pd.prototype.addView=function(a){if(a&&!this._guard_addView){this._guard_addView=j;try{var b=a.getParent();b!==this&&(b&&f(new t("View has been already added to another view")),a.setParent(this),this._views.push(a))}finally{delete this._guard_addView}}};pd.prototype.addView=pd.prototype.addView;
pd.prototype.removeView=function(a){if(a&&!this._guard_removeView){this._guard_removeView=j;try{var b=a.getParent();if(b)b!==this&&f(new t("View is not part of this view")),a.setParent(k),this._views=jQuery.grep(this._views,function(b){return b!==a})||[]}finally{delete this._guard_removeView}}};pd.prototype.removeView=pd.prototype.removeView;function qd(a,b){G.call(this,a,b,j);this._box=k}s(qd,G);p("wr.ui.web.BoxViewer",qd);qd.prototype.setup=function(a,b){jQuery.isWindow(b)||f(Error("Context must be a browser window"));var c;var d=a.boxSelector,e=jQuery(b.document);e.find("html")[0]?(c=e.find(d).eq(0),c[0]||f(Error("No box element found")),c=c[0]):f(Error("Document type not supported"));this._box=c;this._refreshContexts(l)};qd.prototype.setup=qd.prototype.setup;qd.prototype.destroy=function(){this._refreshContexts(j);this._box=k};
qd.prototype.destroy=qd.prototype.destroy;qd.prototype._refreshContexts=function(){var a=this.getContextRegistry(),b=this._box,c=this.collectSubViewsDiffs(!b?[]:i);a&&($.each(c.removed,function(b,c){a.removeContext(c)}),b&&$.each(c.added,function(c,e){a.addContext(e,k,b)}))};qd.prototype.readAttributes=function(){var a=qd._super.readAttributes.call(this);a.open=!!this._box;return a};qd.prototype.readAttributes=qd.prototype.readAttributes;
qd.prototype.writeData=function(a){var b=this._box;if(b){var c=a&&a.title;c!==i&&jQuery(b).attr("title",c)}qd._super.writeData.call(this,a)};qd.prototype.writeData=qd.prototype.writeData;qd.prototype.readData=function(){var a=qd._super.readData.call(this)||{},b=this._box;b&&(a.title=jQuery(b).attr("title"));return a};qd.prototype.readData=qd.prototype.readData;function rd(a,b){nd.call(this,a,b);this._window=k}s(rd,nd);p("wr.ui.web.BrowserViewer",rd);rd.prototype.setup=function(a,b){jQuery.isWindow(b)||f(Error("Context must be a browser window"));this._window=b;rd._super.setup.call(this,a,b)};rd.prototype.setup=rd.prototype.setup;rd.prototype.destroy=function(){this._window=k;rd._super.destroy.call(this)};rd.prototype.destroy=rd.prototype.destroy;rd.prototype.createWindow=function(a){var b=this.getContextRegistry();b&&b.addContext(a,k,window)};
rd.prototype.createWindow=rd.prototype.createWindow;rd.prototype.destroyWindow=function(a){var b=this.getContextRegistry();b&&b.removeContext(a)};rd.prototype.destroyWindow=rd.prototype.destroyWindow;function H(a,b){G.call(this,a,b,j);this._pendingAttributes=this._window=k;this._autoResize=l}s(H,G);p("wr.ui.web.WindowViewer",H);H.prototype.setup=function(a,b){jQuery.isWindow(b)||f(Error("Context must be a browser window"));this._window=b;this._refreshContexts(l)};H.prototype.setup=H.prototype.setup;H.prototype.destroy=function(){sd(this,l);this._refreshContexts(j);this._window=k;H._super.destroy.call(this)};H.prototype.destroy=H.prototype.destroy;
H.prototype._refreshContexts=function(a){var b=this.getContextRegistry(),c=this.getWindow(),d=this.collectSubViewsDiffs(!c?[]:i);if(b){jQuery.each(d.removed,function(a,c){b.removeContext(c)});var e=!a&&c&&c.document;e&&jQuery.each(d.added,function(a,c){b.addContext(c,k,e)})}};
H.prototype.writeAttributes=function(a){var b=this.getWindow(),c=a&&a.open;c!==i&&(sd(this,c),b=this.getWindow());if(b&&a){var c=a.width,d=a.height;if(c!==i||d!==i)b.resizeTo(c||b.outerWidth,d||b.outerHeight);b=a.autoResize;if(b!==i)this._autoResize=b}else if(a)this._pendingAttributes=this._pendingAttributes||{},jQuery.extend(this._pendingAttributes,a),delete this._pendingAttributes.open;H._super.writeAttributes.call(this,a)};H.prototype.writeAttributes=H.prototype.writeAttributes;
H.prototype.readAttributes=function(){var a=H._super.readAttributes.call(this),b=this.getWindow();b?(a.width=b.outerWidth,a.height=b.outerHeight,a.autoResize=this._autoResize):this._pendingAttributes&&jQuery.extend(a,this._pendingAttributes);a.open=!!b;return a};H.prototype.readAttributes=H.prototype.readAttributes;
H.prototype.writeData=function(a){var b=this.getWindow();if(b){var c=a&&a.title;if(c!==i){var d=b&&b.document;if(d&&"string"===typeof d.title)d.title=c||""}}H._super.writeData.call(this,a);this._autoResize&&"function"===typeof b.sizeToContent&&b.sizeToContent()};H.prototype.writeData=H.prototype.writeData;H.prototype.readData=function(){var a=H._super.readData.call(this)||{},b=this.getWindow();if(b)b=b&&b.document,a.title=b&&b.title||k;return a};H.prototype.readData=H.prototype.readData;
H.prototype.getWindow=n("_window");H.prototype.getWindow=H.prototype.getWindow;function sd(a,b){var c=!!a.getWindow();if(b!==c){if(b){if(a.openWindow(),a._pendingAttributes)a.writeAttributes(a._pendingAttributes),a._pendingAttributes=k}else a._pendingAttributes=a.readAttributes(),delete a._pendingAttributes.open,a.closeWindow();a._refreshContexts(l)}}H.prototype.openWindow=ba();H.prototype.openWindow=H.prototype.openWindow;H.prototype.closeWindow=ba();H.prototype.closeWindow=H.prototype.closeWindow;function J(a,b){G.call(this,a,b,j);this._name=[a._id,"_",b?b.join(","):"","_"].join("");this._$dialog=k;this._autoResize=this._focused=l}s(J,G);p("wr.ui.jquery.AbstractDialogViewer",J);J.prototype.setup=function(a,b){jQuery.isWindow(b)||f(Error("Context must be a browser window"));this._$dialog=this.createDialog();this._refreshContexts(l);this._$dialog.parent(".ui-dialog").on("focusin.wr focusout.wr",jQuery.proxy(this._stopEvent,this))};J.prototype.setup=J.prototype.setup;
J.prototype.destroy=function(){this.closeDialog();this._$dialog.parent(".ui-dialog").off("focusin.wr focusout.wr",this._stopEvent);this._refreshContexts(j);this._$dialog.dialog("destroy");Kb(this._$dialog[0]);this._$dialog=k};J.prototype.destroy=J.prototype.destroy;J.prototype.refreshSubViews=function(){this._refreshContexts(l)};J.prototype.refreshSubViews=J.prototype.refreshSubViews;
J.prototype._refreshContexts=function(a){var b=this.getContextRegistry(),c=this.getDialog(),d=this.collectSubViewsDiffs(!c.dialog("isOpen")?[]:i);if(b){jQuery.each(d.removed,function(a,c){b.removeContext(c)});var e=!a?c[0]:k;e&&jQuery.each(d.added,function(a,c){b.addContext(c,k,e)})}};J.prototype._stopEvent=function(a){a.stopPropagation()};J.prototype.getDialog=function(){this._$dialog||f(new t("Dialog not available"));return this._$dialog};J.prototype.getDialog=J.prototype.getDialog;
J.prototype.createDialog=function(){var a=this;return jQuery("<div/>").dialog({autoOpen:l,open:function(){a.raiseEvent("open")},close:function(){a.raiseEvent("close");a.closeDialog()},focus:function(){if(!a._focused)a._focused=j,a.raiseEvent("focus")}})};J.prototype.createDialog=J.prototype.createDialog;J.prototype.openDialog=function(){var a=this.getDialog();jQuery(a[0].ownerDocument).on("focusin.wr"+this._name+" click.wr"+this._name,jQuery.proxy(this._handleDocumentInteraction,this));a.dialog("open")};
J.prototype.openDialog=J.prototype.openDialog;J.prototype.closeDialog=function(){var a=this._$dialog;if(a)a.dialog("isOpen")&&a.dialog("close"),jQuery(a[0].ownerDocument).off("focusin.wr"+this._name+" click.wr"+this._name,this._handleDocumentInteraction),a.empty(),this._focused=l,this.raiseEvent("blur")};J.prototype.closeDialog=J.prototype.closeDialog;
J.prototype._handleDocumentInteraction=function(a){if(this._focused&&jQuery(a.target).closest(".ui-dialog")[0]!==this.getDialog().closest(".ui-dialog")[0])this._focused=l,this.raiseEvent("blur")};
J.prototype.writeAttributes=function(a){var b=this.getDialog(),c=a&&a.open;if(c!==i){var d=b.dialog("isOpen");c&&!d?this.openDialog():!c&&d&&this.closeDialog();this._refreshContexts(l)}c=a&&a.modal;c!==i&&b.dialog("option","modal",!!c);c=a&&a.showEffect;c!==i&&b.dialog("option","show",xb(c));c=a&&a.hideEffect;c!==i&&b.dialog("option","hide",xb(c));c=a&&a.autoResize;if(c!==i)this._autoResize=c,td(this);this._autoResize||(c=a&&a.width,c!==i&&b.dialog("option","width",Number(c)),c=a&&a.height,c!==i&&
b.dialog("option","height",Number(c)));c=a&&a.resizable;c!==i&&b.dialog("option","resizable",!!c);c=a&&a.draggable;c!==i&&b.dialog("option","draggable",!!c);c=a&&a.className;c!=i&&b.dialog("option","dialogClass",c);J._super.writeAttributes.call(this,a)};J.prototype.writeAttributes=J.prototype.writeAttributes;
J.prototype.readAttributes=function(){var a=J._super.readAttributes.call(this),b=this.getDialog();a.open=!!b.dialog("isOpen");a.modal=b.dialog("option","modal");a.showEffect=yb(""+b.dialog("option","show"));a.hideEffect=yb(""+b.dialog("option","hide"));a.autoResize=this._autoResize;a.width=Number(b.dialog("option","width"));a.height=Number(b.dialog("option","height"));a.resizable=b.dialog("option","resizable");a.draggable=b.dialog("option","draggable");a.className=b.dialog("option","dialogClass");
return a};J.prototype.readAttributes=J.prototype.readAttributes;J.prototype.writeData=function(a){J._super.writeData(a);if(a){var b=this.getDialog(),c=a.title;c!==i&&b.dialog("option","title",c);a=a.content;a!==i&&(b.html(a),td(this))}};J.prototype.writeData=J.prototype.writeData;J.prototype.readData=function(){var a=J._super.readData()||{},b=this.getDialog();a.title=b.dialog("option","title");return a};J.prototype.readData=J.prototype.readData;
function td(a){if(a._autoResize){var b=a.getDialog();b.dialog("option",{width:10,height:"auto"});b.find("img").filter(function(){return!this.complete}).one("load",function(){td(a)});for(var c=b.outerWidth()-b.width(),d=jQuery(GLOBAL).width(),e,g;;){e=b[0].scrollWidth;g=b.width();var h=Math.min(d,e+c);if(Math.abs(e-g)<=c||h>=d)break;b.dialog("option",{width:h,height:"auto"})}c=b.dialog("option","position");b.dialog("option","position",c)}};function ud(a,b){J.call(this,a,b);this._extendedAttributes={maximize:l,minimize:l}}s(ud,J);p("wr.ui.jquery.DialogViewer",ud);ud.prototype.createDialog=function(){var a=ud._super.createDialog.call(this);a.dialog("option",{width:200,height:300,resizable:l,draggable:l,closeOnEscape:l});a=a.dialogExtend(this._extendedAttributes);vd(a);wd(a).hide();return a};ud.prototype.createDialog=ud.prototype.createDialog;
function vd(a){var b=new function(a){function b(d){return a.test(d)?i:e.call(this,d)}var e=jQuery.error;this.enable=function(){jQuery.error=b};this.disable=function(){jQuery.error=e}}(/^cannot call methods on draggable prior to initialization\b.+$/);a.on("beforeMaximize.dialogExtend",jQuery.proxy(b.enable,b));a.on("maximize.dialogExtend",jQuery.proxy(b.disable,b));a.on("beforeMinimize.dialogExtend",jQuery.proxy(b.enable,b));a.on("minimize.dialogExtend",jQuery.proxy(b.disable,b))}
function wd(a){return a.parents(".ui-dialog").find(".ui-dialog-titlebar-close")}ud.prototype.writeAttributes=function(a){var b=this.getDialog(),c=a&&a.maximizable,d=a&&a.minimizable;if(c!==i||d!==i)c!==i&&(this._extendedAttributes.maximize=!!c),d!==i&&(this._extendedAttributes.minimize=!!d),b.dialogExtend(this._extendedAttributes);c=a&&a.closable;c!==i&&(d=wd(b),c?d.show():d.hide(),b.dialog("option","closeOnEscape",!!c));ud._super.writeAttributes.call(this,a)};ud.prototype.writeAttributes=ud.prototype.writeAttributes;
ud.prototype.readAttributes=function(){var a=ud._super.readAttributes.call(this),b=this.getDialog();a.maximizable=this._extendedAttributes.maximize;a.minimizable=this._extendedAttributes.minimize;a.closable=wd(b).is(":visible");return a};ud.prototype.readAttributes=ud.prototype.readAttributes;function xd(a,b){J.call(this,a,b)}s(xd,J);p("wr.ui.jquery.WaitDialogViewer",xd);xd.prototype.createDialog=function(){var a=xd._super.createDialog.call(this);a.siblings(".ui-dialog-titlebar").hide();a.prepend(jQuery("<div/>").addClass("progress"));a.dialog("option",{closeOnEscape:l,draggable:l,resizable:l,modal:j});return a};xd.prototype.createDialog=xd.prototype.createDialog;xd.prototype.writeData=function(a){xd._super.writeData.call(this,a);a&&a&&a.content&&this.getDialog().append(jQuery("<div/>").addClass("progress"))};
xd.prototype.writeData=xd.prototype.writeData;function yd(a,b){H.call(this,a,b);this._secondaryWindowName=[a._id,"[",b?b.join(","):"","]"].join("");this._fixedAttributes=this._secondaryWindow=k;this.writeAttributes({width:200,height:300})}s(yd,H);p("wr.ui.web.SecondaryWindowViewer",yd);yd.prototype.getWindow=n("_secondaryWindow");yd.prototype.getWindow=yd.prototype.getWindow;
yd.prototype.openWindow=function(){var a=this,b=yd._super.getWindow.call(this),c=this.readAttributes(),d=[];d.push("left=200");d.push("top=100");c.width&&d.push("width="+c.width);c.height&&d.push("height="+c.height);d.push("resizable="+(c.resizable?"yes":"no"));d.push("dialog="+(c.maximizable?"no":"yes"));d.push("minimizable="+(c.minimizable?"yes":"no"));this._fixedAttributes={};this._fixedAttributes.resizable=c.resizable;this._fixedAttributes.minimizable=c.minimizable;this._fixedAttributes.maximizable=
c.maximizable;var e=b.open(k,this._secondaryWindowName,d.join(","));jQuery(e).on("unload",function(){Eb(function(){if(e.closed)a.raiseEvent("close"),a._secondaryWindow=k,a._fixedAttributes=k})});jQuery(e).focus(function(){a.raiseEvent("focus")});this.raiseEvent("open");this._secondaryWindow=e};yd.prototype.openWindow=yd.prototype.openWindow;yd.prototype.closeWindow=function(){this._secondaryWindow&&this._secondaryWindow.close()};yd.prototype.closeWindow=yd.prototype.closeWindow;
yd.prototype.writeAttributes=function(a){a&&this._fixedAttributes&&B(this._fixedAttributes,function(b,c){var d=a&&a[c];d!==i&&d!==b&&f(new t("Cannot change attribute '"+c+"' at this time"))});yd._super.writeAttributes.call(this,a)};yd.prototype.writeAttributes=yd.prototype.writeAttributes;yd.prototype.readAttributes=function(){var a=yd._super.readAttributes.call(this);this._fixedAttributes&&jQuery.extend(a,this._fixedAttributes);return a};yd.prototype.readAttributes=yd.prototype.readAttributes;function zd(a){return 9===a.nodeType?j:l}p("wr.util.dom.isDocument",zd);function Ad(a){return 1===a.nodeType?j:l}p("wr.util.dom.isElement",Ad);function Bd(a,b){var c=jQuery(a);return b?(c=c.find(b),c.not(c.find(b))):c.children()}p("wr.util.dom.findImmediateDescendants",Bd);function Cd(){sa.call(this);this._id="wr:"+Dd++ +":safeMap";this._elementKeys=[]}s(Cd,sa);var Dd=0;o=Cd.prototype;o.put=function(a,b){if(Ad(a)){var c=jQuery.data(a);"undefined"===typeof c[this._id]&&this._elementKeys.push(a);var d=c[this._id];c[this._id]=b;return d}return Cd._super.put.call(this,a,b)};
o.remove=function(a){if(Ad(a)){var b=jQuery.data(a,this._id);jQuery.removeData(a,this._id);this._elementKeys=jQuery.grep(this._elementKeys,function(b){return b!==a});return b}return Cd._super.remove.call(this,a)};o.clear=function(){for(var a=-1,b=this._elementKeys.length;++a<b;)jQuery.removeData(this._elementKeys[a],this._id);this._elementKeys=[];Cd._super.clear.call(this)};o.getSize=function(){return this._elementKeys.length+Cd._super.getSize.call(this)};
o.get=function(a){return Ad(a)?jQuery.data(a,this._id):Cd._super.get.call(this,a)};o.getValues=function(){for(var a=[],b=-1,c=this._elementKeys.length;++b<c;){var d=jQuery.data(this._elementKeys[b],this._id);a.push(d)}Array.prototype.push.apply(a,Cd._super.getValues.call(this));return a||[]};o.each=function(a){if(a){for(var b=-1,c=this._elementKeys.length;++b<c;){var d=this._elementKeys[b],e=jQuery.data(d,this._id);a(d,e)}Cd._super.each.call(this,a)}};function K(a,b,c){G.call(this,a,b,c);this._lastFocusedElementId=this._context=k;this._focused=l}s(K,G);p("wr.ui.html.AbstractHtmlViewer",K);K.prototype._log=z.getLog("wr.ui.html.AbstractHtmlViewer");K.prototype.setup=function(a,b){Ad(b)||f(Error("Context must be an HTML DOM element"));this._context=b;jQuery(this._context).on("focusin focusout click keypress",jQuery.proxy(this._handleFocusEvents,this))};K.prototype.setup=K.prototype.setup;
K.prototype.destroy=function(){jQuery(this._context).off("focusin focusout click keypress",this._handleFocusEvents);this._context=k;K._super.destroy.call(this)};K.prototype.destroy=K.prototype.destroy;K.prototype.getContext=function(){this._context||f(new t("Context not available"));return this._context};K.prototype.getContext=K.prototype.getContext;K.prototype.raiseEventForHtmlEvent=function(a,b,c){c&&Ed(c,"uiEventRaised")&&this.raiseEvent(a,b)};K.prototype.raiseEventForHtmlEvent=K.prototype.raiseEventForHtmlEvent;
function Ed(a,b){function c(a,b){var c=a.originalEvent||a;"string"===typeof c.data?c.data=(c.data?c.data+",":"")+b:(c.__wr_eventTags||(c.__wr_eventTags={}))[b]=j}return!function(a,b){var c=a.originalEvent||a;return"string"===typeof c.data?0<=_.indexOf(c.data.split(","),b):(c.__wr_eventTags||(c.__wr_eventTags={}))[b]===j}(a,b)?(c(a,b),j):l}
K.prototype._handleFocusEvents=function(a){if(Ed(a,"focusTracked")){var b=jQuery(a.target),c=b.attr("id")||k,d="click"===a.type||"keypress"===a.type||"focusin"===a.type,e="focusin"==a.type||"focusout"==a.type;if(e||Mc(b[0]))if(this._focused=!!d,d)this._lastFocusedElementId=c||k,e?this.raiseEventForHtmlEvent("focus",this.getView(),a):this.raiseEvent("focus",this.getView())}};
K.prototype.getLastFocusedElement=function(){var a;if(this._lastFocusedElementId){a=jQuery("#"+hc(this._lastFocusedElementId));if(0<a.length)return a[0];this._lastFocusedElementId=k}return k};K.prototype.getLastFocusedElement=K.prototype.getLastFocusedElement;K.prototype.isFocused=n("_focused");K.prototype.isFocused=K.prototype.isFocused;
K.prototype.writeAttributes=function(a){if((a&&a.focused)===j){var b=this.getLastFocusedElement();b||jQuery(this._context).find(":input:not(:submit)").each(function(){if(Mc(this))return b=this,l});b&&Nc(b)}K._super.writeAttributes.call(this,a)};K.prototype.writeAttributes=K.prototype.writeAttributes;K.prototype.readAttributes=function(){var a=K._super.readAttributes.call(this);a.focused=this.isFocused();return a};K.prototype.readAttributes=K.prototype.readAttributes;function wa(a,b,c){var d;wa=d=ma().supportsPropertyDefinition()?function(a,b,c){(c.get||c.set)&&f(new TypeError("Accessor properties not supported"));Object.defineProperty(a,b,c)}:function(a,b,c){(!a||!c)&&f(new ReferenceError);(c.get||c.set)&&f(new TypeError("Accessor properties not supported"));var d=a.__wr_property_definitions;d||(a.__wr_property_definitions=d={});var r=d[b];r?r.configurable||f(new TypeError("Property is not configurable")):d[b]=r={writable:l,enumerable:l,configurable:l};jQuery.extend(r,
c);a[b]=r.value};d(a,b,c)}p("wr.util.obj.defineProperty",wa);function Fd(a,b){if(a===k||a===i||b===k||b===i)return j;b=""+b;if(!Object.prototype.hasOwnProperty.call(a,b))return j;var c;try{if(c=delete a[b],c!==Object.prototype.hasOwnProperty.call(a,b))return c}catch(d){}try{return a[b]=i,j}catch(e){return l}}p("wr.util.obj.deleteProperty",Fd);
function kd(a,b){var c;kd=c=ma().supportsPropertyDefinition()?da(j):function(a,b){if("__wr_property_definitions"===b)return l;var c=a&&a.__wr_property_definitions;return(c=c&&c[b])?!!c.enumerable:j};return c(a,b)}p("wr.util.obj.isLoopedPropertyEnumerable",kd);function Gd(a,b){if(a){var c=a.split("."),d=b||GLOBAL;try{for(var e;c.length&&(e=c.shift());)d=d[e]}catch(g){g instanceof TypeError&&(g=new TypeError(""+a+" is undefined")),f(g)}return d}}p("wr.util.obj.lookup",Gd);
function Hd(a){var b;Hd=b="function"===typeof Object.keys?Object.keys:function(a){("object"!==typeof a&&"function"!==typeof a||a===k)&&f(new TypeError);var b=[],e;for(e in a)Object.prototype.hasOwnProperty.call(a,e)&&kd(a,e)&&b.push(e);return b};return b(a)}p("wr.util.obj.keys",Hd);function B(a,b){var c;B=c=ma().supportsPropertyDefinition()?function(a,b){_.each(a,b)}:function(a,b){for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&kd(a,c)&&b(a[c],c)};c(a,b)}p("wr.util.obj.each",B);
function Kd(a,b,c){if(!a||!b||!jQuery.isPlainObject(a)||!jQuery.isPlainObject(b))return a;c===j?jQuery.extend(j,a,b):0<c?B(b,function(b,e){"undefined"!==typeof b&&(jQuery.isPlainObject(a[e])&&jQuery.isPlainObject(b)?Kd(a[e],b,c-1):a[e]=b)}):jQuery.extend(a,b);return a}p("wr.util.obj.extend",Kd);var Ld=new sa,Md={names:[],values:[],namesByValue:new sa};
function Nd(a){if(!a)return Md;var b=Ld.get(a);if(!b){var b=[],c=[],d=new sa,e;for(e in a)if(Object.prototype.hasOwnProperty.call(a,e)&&kd(a,e)){var g=a[e];"function"!==typeof g&&(b.push(e),c.push(g),d.put(g,e))}b={names:b,values:c,namesByValue:d};Ld.put(a,b)}return b}function Od(a){return Nd(a).values}p("wr.util.obj.getEnumValues",Od);p("wr.util.obj.getEnumNames",function(a){return Nd(a).names});function Pd(a,b){return Nd(a).namesByValue.get(b)||k}p("wr.util.obj.getEnumName",Pd);function Qd(a,b){this.readyState=0;this.onreadystatechange=k;this.status=0;this.statusText="";this.responseXML=this.responseText=k;this._$form=jQuery(a);this._formInputs=b;this._accessor=this._$iframe=k;this._error=this._complete=this._sending=l;this._responseHeaders=k;this._log.isDebugEnabled()&&this._log.debug("Constructed for form "+ka(a))}Qd.prototype._log=z.getLog("internal.logic.AjaxFrameTransport");
Qd.prototype.open=function(){var a=jQuery,b;b=jQuery("#wr-ajaxFramesDiv");0===b.length&&(b=jQuery("<div>",{id:"wr-ajaxFramesDiv"}).css({position:"absolute",display:"none",height:"0",width:"0"}).prependTo(GLOBAL.document.body));var c="wr-ajaxRequest"+Math.floor(2147483647*Math.random());b=jQuery(this._createFrame(c)).attr({name:c,id:c}).css({display:"none",height:"0",width:"0"}).appendTo(b)[0];this._$iframe=a(b);this._accessor=new pc(this._$iframe[0]);Rd(this,1,j)};
Qd.prototype._createFrame=function(a){var b=k;try{b=GLOBAL.document.createElement('<div name="__test">')}catch(c){}b=b&&"DIV"===b.tagName.toUpperCase()&&"__test"===b.name?function(a){return GLOBAL.document.createElement('<iframe name="'+a+'">')}:function(a){return jQuery("<iframe>",{name:a})[0]};Qd.prototype._createFrame=b;return b(a)};Qd.prototype.setRequestHeader=ba();
Qd.prototype.send=function(a){var b=this._$iframe,c=this._accessor,d=this._$form;if(!this._sending){this._complete=l;this._sending=j;this._responseHeaders=k;for(var e=[],g={},h=/([^=&]+)=([^&]*)/g,m;m=h.exec(a);){var r=m[1];(g[r]||(g[r]=[])).push(m[2])}var R=this._formInputs;B(g,function(a,b){var c=R[b],d=c?c.values:[],g=c&&c.element;if(!(!g?0:_.find(Ub,function(a){return!!a.accept(g)})))c=Sd(a),d=Sd(d),d!=c&&jQuery.each(a,function(a,c){e.push(b+"="+c)})});if("undefined"===typeof GLOBAL.DOMParser)e.push("pxml=true"),
c._usePseudoXML=j;b.one("complete load",jQuery.proxy(this._onComplete,this,l));b.one("abort error",jQuery.proxy(this._onComplete,this,j));b.one("load",jQuery.proxy(this._destroyFrame,this));Vb(d[0],0<e.length?e.join("&"):k,k,b.prop("name"))}};function Sd(a){return a.sort().join("&").replace(/%0D%0A/gi,"%0A").replace(/\+/g,"%20")}Qd.prototype.abort=function(){this._finish(j);Rd(this,4,j);Rd(this,0,l)};
Qd.prototype._onComplete=function(a){if(!this._complete)this._complete=j,this._error=a,this._finish(l),Rd(this,4,j)};
Qd.prototype._finish=function(a){if(a)this._log.debug("Aborted"),this.status=0,this.responseText=this.statusText="",this._responseHeaders=this.responseXML=k;else{this._log.debug("Finished: extracting result");this.status=200;this.statusText="OK";var a=qc(this._accessor),a="text/x-pseudo-xml"===a?"text/xml":a,b=this._accessor;if(!b._contents)b._contents=sc(b);this.responseText=b._contents.text;if("text/xml"===a||"application/xml"===a){b=this._accessor;if(!b._contents)b._contents=sc(b);b=b._contents.value}else b=
k;this.responseXML=b;this._responseHeaders={"content-type":a}}this._sending=l};Qd.prototype._destroyFrame=function(){this._sending?Eb(jQuery.proxy(this._destroyFrame,this)):GLOBAL.setTimeout(jQuery.proxy(function(){this._$iframe&&(this._$iframe.off(),Kb(this._$iframe[0]));this._accessor=this._$iframe=k},this),5E3)};Qd.prototype.getResponseHeader=function(a){return this._responseHeaders&&this._responseHeaders[a.toLowerCase()]||k};
Qd.prototype.getAllResponseHeaders=function(){if(this._responseHeaders){var a=[];B(this._responseHeaders,function(b,c){a.push(c);a.push(": ");a.push(b);a.push("\r\n")});return a.join("")}return k};function Rd(a,b,c){a._log.isDebugEnabled()&&a._log.debug("Ready state "+b);a.readyState=b;c&&(a.onreadystatechange||ea)()};function Td(a,b){this._callback=a;this._finishOnInteraction=b;this._uniqueId=this._done=k;Ud(this)}var Vd=[];
function Ud(a){a._done!==k&&f(new t("Already started waiting"));a._done=l;Vd.push(a);if(1===Vd.length){if(a._finishOnInteraction)jQuery(GLOBAL).on("click focusin","a, area, :submit",Wd);jQuery(GLOBAL).on("unload",Wd)}a._uniqueId=0<Xd.length?Xd.shift():(""+(new Date).valueOf()).slice(-3)+(""+Math.floor(100*Math.random()));var b="wrReq"+a._uniqueId;jQuery.cookie(b,"waiting",{path:"/"});Yd(b,function(b,d){(!d||"done"===d)&&a._finish()})}
Td.prototype._finish=function(){this._done===k&&f(new t("Not waiting"));this._done=j;za(Vd,this);0===Vd.length&&(jQuery(GLOBAL).off("unload",Wd),this._finishOnInteraction&&jQuery(GLOBAL).off("click focusin","a, area, :submit",Wd));if(this._uniqueId){var a="wrReq"+this._uniqueId;Zd.hasOwnProperty(a)&&(delete Zd[a],0===--$d&&GLOBAL.clearInterval(ae));jQuery.removeCookie(a,{path:"/"});Xd.push(this._uniqueId);this._uniqueId=k}this._callback.call(GLOBAL)};
function Wd(){_.each(Vd,function(a){a._finish()})}var Zd={},$d=0,ae=k;function Yd(a,b){Zd.hasOwnProperty(a)&&f(new t("Already observing"));0===$d++&&(ae=GLOBAL.setInterval(be,100));Zd[a]={lastValue:jQuery.cookie(a)||k,callback:b}}function be(){B(Zd,function(a,b){var c=jQuery.cookie(b)||k,d=a.lastValue!==c;a.lastValue=c;d&&a.callback.call(GLOBAL,b,c)})}var Xd=[];function ce(){this._level=4;this._queue=[]}s(ce,jb);p("wr.log.ConsoleAppender",ce);var de={1:["error"],2:["warn"],3:["info"],4:["debug","log"]};ce.prototype.appendFiltered=function(a){var b=this;this._queue.push(a);1<=this._queue.length&&Eb(function(){for(var a;a=b._queue.shift();)ee(a)})};ce.prototype.appendFiltered=ce.prototype.appendFiltered;
function ee(a){var b=GLOBAL.console;if(b){var c=a.getLevel(),d=a.getErrorInfo(),e=[];e.push(fe(a.getTimestamp()));e.push(Pd(ib,c));e.push("["+a.getCategory()+"]");e.push(a.getMessage());d&&e.push(""+d);for(var g=e.join(" "),a=d&&1>=c?ha(d._error,{toString:function(){return g}}):g,c=de[c],d=0;d<c.length;d++)if(e=b[c[d]]){"function"===typeof e?e.call(b,a):Function.prototype.call.call(e,b,a);break}}}
function fe(a){var b=_.str.lpad,c=[];c.push(""+a.getFullYear());c.push("-");c.push(b(""+(a.getMonth()+1),2,"0"));c.push("-");c.push(b(""+a.getDate(),2,"0"));c.push(" ");c.push(b(""+a.getHours(),2,"0"));c.push(":");c.push(b(""+a.getMinutes(),2,"0"));c.push(":");c.push(b(""+a.getSeconds(),2,"0"));c.push(".");c.push(b(""+a.getMilliseconds(),3,"0"));return c.join("")};function ge(){this._level=4;this._autoShowLevel=2;this._historyVisible=this._loggerVisible=l;this._follow=j;this._highestLevel=4}s(ge,jb);p("wr.log.HtmlAppender",ge);
ge.prototype.appendFiltered=function(a){var b=a.getLevel(),c=a.getErrorInfo(),d,e=this._getStripe();if(e){var g=e.find(".wr-log-message"),h=e.find(".wr-log-history");d=[];d.push(he(a.getTimestamp()));d.push(Pd(ib,b));d.push("["+a.getCategory()+"]");d.push(a.getMessage());c&&d.push(""+c);c=d.join(" ");if(b<=this._highestLevel){if(b<this._highestLevel)this._highestLevel=b,this._setColors(e,this._highestLevel);g.text(a.getMessage())}e.css({"z-index":this._getMaxZIndex(".ui-dialog")+1});b<=this._autoShowLevel&&
!this._loggerVisible&&this._toggleLogger();a=jQuery("<div/>").addClass("wr-log-entry");a.attr("data-loglevel",Pd(ib,b).toLowerCase());this._setColors(a,b,j);a.text(c).appendTo(h);this._follow&&h.scrollTop(h[0].scrollHeight)}};ge.prototype.appendFiltered=ge.prototype.appendFiltered;
function he(a){var b=_.str.lpad,c=[];c.push(""+a.getFullYear());c.push("-");c.push(b(""+(a.getMonth()+1),2,"0"));c.push("-");c.push(b(""+a.getDate(),2,"0"));c.push(" ");c.push(b(""+a.getHours(),2,"0"));c.push(":");c.push(b(""+a.getMinutes(),2,"0"));c.push(":");c.push(b(""+a.getSeconds(),2,"0"));c.push(".");c.push(b(""+a.getMilliseconds(),3,"0"));return c.join("")}
var ie={1:["#FF0000","#FFFFFF"],2:["#FFFF00","#000000"],3:["#0000FF","#FFFFFF"],4:["#808080","#FFFFFF"]},je={1:["#FFB2B2","#000000"],2:["#FFFFB2","#000000"],3:["#B2B2FF","#000000"],4:["#D8D8D8","#000000"]},ke={thickness:"1.5em",toggleShow:"<<",toggleHide:">>"},le="#wr-log { position: fixed; top: 0; right: 0; overflow: hidden; text-align: center; font: 12px sans-serif; },.wr-log-toggle { float: right; width: ${thickness}; line-height: ${thickness}; text-align: center; font-weight: bold; cursor: pointer; },.wr-log-message { height: ${thickness}; margin-right: ${thickness}; line-height: ${thickness}; margin: 0; overflow: hidden; font-weight: bold; -moz-user-select: none; -ms-user-select: none; },.wr-log-history { max-height: 300px; margin: 5px; border: 3px solid #222222; border-bottom: 0; overflow: auto; background-color: #EEEEEE; text-align: left; white-space: pre-wrap; font: 90% monospace; },.wr-log-historyLinks { padding: 0 3px; margin: -5px 5px 5px; background-color: #111111; text-align: left; font-size: 80%; },.wr-log-historyLinks a { cursor: pointer; color: #FFFFFF; text-decoration: none; },.wr-log-historyLinks a ~ a { margin-left: 2em; },.wr-log-entry { border-bottom: 1px solid #222222; }".split(",");
o=ge.prototype;o._toggleLogger=function(){var a=this._getStripe();this._loggerVisible=!this._loggerVisible;a.animate({width:this._loggerVisible?"100%":ke.thickness},200);a.find(".wr-log-toggle").text(this._loggerVisible?ke.toggleHide:ke.toggleShow);!this._loggerVisible&&this._historyVisible&&this._toggleHistory()};
o._toggleHistory=function(){var a=this._getStripe();this._historyVisible=!this._historyVisible;a.css({height:this._historyVisible?"auto":ke.thickness});this._historyVisible&&a.find(".wr-log-history").each(function(){this.scrollTop=this.scrollHeight})};
o._getStripe=function(){var a=this,b=GLOBAL.document.body,c=k,d=k;b&&(d=jQuery("#wr-log-style"),d[0]||(c=le.join("\r\n").replace(/\$\{([^}]+)}/g,function(a,b){return ke[b]}),d=jQuery("<style id='wr-log-style'>"+c+"</style>").prependTo(b)),c=jQuery("#wr-log"),c[0]||(c=jQuery("<div id='wr-log'/>").css({width:ke.thickness,height:ke.thickness}).on("click keydown keyup keypress",l).prependTo(b).fadeIn(),jQuery("<div/>").addClass("wr-log-toggle").attr("title","Click to show/hide logger").text(ke.toggleShow).appendTo(c),
jQuery("<p/>").addClass("wr-log-message").attr("title","Double-click to show/hide log history").appendTo(c),jQuery("<div/>").addClass("wr-log-history").appendTo(c),b=jQuery("<div/>").addClass("wr-log-historyLinks").appendTo(c),jQuery("<a/>").text("SELECT ALL").click(function(){a._selectText(jQuery(this).parent().siblings(".wr-log-history")[0])}).attr("title","Selects all log entries").appendTo(b),jQuery("<a/>").text("FOLLOW:"+(a._follow?"ON":"OFF")).click(function(){a._follow=!a._follow;jQuery(this).text("FOLLOW:"+
(a._follow?"ON":"OFF"))}).attr("title","Toggles automatic scrolling to the last log entry").appendTo(b),jQuery("<a/>").text("RETHROW").click(function(){var a=l;return function(){a=!a;z.setRethrowErrors(a);jQuery(this).text("RETHROW:"+(a?"ON":"OFF"))}}()).attr("title","Toggles re-throwing of errors, allowing browser tools to detect them").appendTo(b),this._setColors(c,this._highestLevel),c.find(".wr-log-toggle").click(jQuery.proxy(this._toggleLogger,this)),c.find(".wr-log-message").dblclick(jQuery.proxy(this._toggleHistory,
this))));return c};o._getMaxZIndex=function(a){if(!jQuery.fn.zIndex)return 999;var b=Number.MIN_VALUE;jQuery(a||"*").each(function(){b=Math.max(b,jQuery(this).zIndex())});return b>Number.MIN_VALUE?b:999};o._setColors=function(a,b,c){b=(c?je:ie)[b];a.css({"background-color":b[0],color:b[1]})};
o._selectText=function(a){var b;b=GLOBAL.getSelection?function(a){var b=GLOBAL.getSelection(),e=a.ownerDocument.createRange();e.selectNodeContents(a);b.removeAllRanges();b.addRange(e)}:a.ownerDocument.createTextRange?function(a){var b=a.ownerDocument.body.createTextRange();b.moveToElementText(a);b.select()}:function(){GLOBAL.alert("Text selection not supported")};ge.prototype._selectText=b;return b(a)};function me(){this._level=4;this._useNotifies=j;this._notifyMessage="<strong>Log Status</strong>";this._notifyStats=j;this._notifyLevel=2;this._notifying=l;this._highestLevel=4;this._tempStats={};this._tempLines=[];this._refreshTimeout=k;this._maxSize=512E3;this._viewer=k;ne(this,_.str.repeat("=",80));ne(this,""+GLOBAL.document.location);ne(this,""+new Date);ne(this,""+GLOBAL.navigator.userAgent);ne(this,_.str.repeat("=",80));var a=this;jQuery(GLOBAL).on("unload",function(){a._viewer&&a._viewer.w.close()});
oe.push(this)}s(me,jb);p("wr.log.LocalAppender",me);var oe=[];me.prototype.setup=function(a){me._super.setup.call(this,a);this._useNotifies="boolean"===typeof a.notify?a.notify:j;this._notifyMessage=a.notifyMessage||"<strong>Log Status</strong>";this._notifyStats="boolean"===typeof a.notifyStats?a.notifyStats:j;this._notifyLevel=a.notifyLevel||2;this._maxSize=a.maxSize||512E3};me.prototype.setup=me.prototype.setup;
me.prototype.appendFiltered=function(a){var b=a.getLevel(),c=a.getErrorInfo();if(b<this._highestLevel)this._highestLevel=b;if(b<=this._notifyLevel&&!this._notifying)this._notifying=j;var d=[];d.push(pe(a.getTimestamp()));d.push(Pd(ib,b));d.push("["+a.getCategory()+"]");d.push(a.getMessage());c&&d.push(""+c);ne(this,d.join(" "),qe[b])};me.prototype.appendFiltered=me.prototype.appendFiltered;
function pe(a){var b=_.str.lpad,c=[];c.push(""+a.getFullYear());c.push("-");c.push(b(""+(a.getMonth()+1),2,"0"));c.push("-");c.push(b(""+a.getDate(),2,"0"));c.push(" ");c.push(b(""+a.getHours(),2,"0"));c.push(":");c.push(b(""+a.getMinutes(),2,"0"));c.push(":");c.push(b(""+a.getSeconds(),2,"0"));c.push(".");c.push(b(""+a.getMilliseconds(),3,"0"));return c.join("")}function ne(a,b,c){try{a._tempLines.push(re(b)),c&&(a._tempStats[c]=(a._tempStats[c]||0)+1),se(a)}catch(d){te(d)}}
function re(a){return a.replace(/[\u0000-\u0008\u000B-\u000C\u000E-\u001F]/g,function(a){return"[0x"+a.charCodeAt(0)+"]"})}function ue(a){a._highestLevel=4;a._tempLines=[];a._tempStats={};ve()&&(GLOBAL.localStorage.removeItem("wr.clientLog.text"),GLOBAL.localStorage.removeItem("wr.clientLog.stats"));se(a)}function se(a){if(!a._refreshTimeout)a._refreshTimeout=GLOBAL.setTimeout(jQuery.proxy(a._refreshNow,a),100)}
me.prototype._refreshNow=function(){this._refreshTimeout=k;try{var a=we();a&&this._tempLines.unshift(a);a=this._tempLines.join("\n");if(a.length>this._maxSize)var b=a.indexOf("\n",a.length-this._maxSize),a=a.substring(0<=b?b+1:a.length);ve()&&GLOBAL.localStorage.setItem("wr.clientLog.text",a);this._tempLines=[];var c=xe(),d;for(d in this._tempStats)this._tempStats.hasOwnProperty(d)&&(c[d]=(c[d]||0)+this._tempStats[d]);ve()&&GLOBAL.localStorage.setItem("wr.clientLog.stats",GLOBAL.JSON.stringify(c));
this._tempStats={};ye(this);ze(this)}catch(e){te(e)}};function te(a){var b=GLOBAL.console;"function"===typeof b.error&&b.error(a)}function we(){if(ve())return GLOBAL.localStorage.getItem("wr.clientLog.text")||""}function xe(){if(ve())return GLOBAL.JSON.parse(GLOBAL.localStorage.getItem("wr.clientLog.stats")||"{}")}function ve(){return!!GLOBAL.localStorage&&!!GLOBAL.JSON}me.openViewer=function(){_.each(oe,function(a){Ae(a)})};
function ye(a){if(a._viewer){var b=jQuery(a._viewer.history),c=we();b.text(c||"");a._viewer.follow&&b.scrollTop(b[0].scrollHeight)}}
function Ae(a){if(a._viewer)a._viewer.w.focus();else{var b=GLOBAL.open();b||f(Error("Unable to open viewer window: this may be caused by popup blocking."));var c=b.document;c.open("text/html","replace");c.write('<html><head><title></title><meta http-equiv="X-UA-Compatible" content="IE=8"></head><body></body></html>');c.close();var d=GLOBAL.document.location;c.title="Log - "+d.protocol+"//"+d.host;var e={};e.w=b;e.follow=j;e.history=jQuery(c.createElement("PRE")).css({position:"absolute",top:10,left:10,
right:10,bottom:25,padding:5,margin:0,overflow:"scroll",border:"3px solid #222222","background-color":"#EEEEEE"}).appendTo(c.body)[0];d=jQuery(c.createElement("DIV")).css({position:"absolute",left:10,right:10,bottom:5,height:16,padding:"2px 4px","background-color":"#111111","font-size":"14px","line-height":"16px"}).appendTo(c.body)[0];jQuery(c.createElement("A")).text("Follow:"+(e.follow?"ON":"OFF")).attr({title:"Toggles automatic scrolling to the last log entry"}).css({color:"#FFFFFF",cursor:"pointer"}).click(function(){e.follow=
!e.follow;jQuery(this).text("Follow:"+(e.follow?"ON":"OFF"))}).appendTo(d);jQuery(c.createElement("A")).text("Clear").attr({title:"Clears all recorded log entries"}).css({color:"#FFFFFF",cursor:"pointer","margin-left":"2em"}).click(function(){ue(a)}).appendTo(d);a._viewer=e;jQuery(b).on("unload",function(){a._viewer=k});ye(a)}}
var Be={1:["#FF0000","#FFFFFF"],2:["#FFFF00","#000000"],3:["#0000FF","#FFFFFF"],4:["#808080","#FFFFFF"]},qe={1:"Error",2:"Warn",3:"Info",4:"Debug"},Ce={thickness:"1.5em",dismiss:"X"},De="#wr-clientLog { position: fixed; top: 0; right: 0; max-width: 16em; padding: 0 5px 5px; overflow: hidden; box-shadow: 0 0 5px #000000; -ms-user-select: none; -moz-user-select: none; -webkit-user-select: none; cursor: default; text-align: left; font: 12px sans-serif; },.wr-clientLog-dismiss { float: right; width: ${thickness}; margin: 0 -5px 0 10px; line-height: ${thickness}; text-align: center; font-weight: bold; cursor: pointer; background-color: #111111; color: #FFFFFF; },.wr-clientLog-stats { width: 100%; margin-top: 5px; font-weight: normal; },.wr-clientLog-stats th { text-align: left; background-color: inherit !important; color: inherit !important; },.wr-clientLog-stats td { text-align: right; background-color: inherit !important; color: inherit !important; },.wr-clientLog-links { padding: 0 3px; margin-top: 5px; background-color: #111111; font-size: 80%; font-weight: normal; },.wr-clientLog-links a { cursor: pointer; color: #FFFFFF; text-decoration: none; },.wr-clientLog-links a ~ a { margin-left: 2em; }".split(",");
function ze(a){var b=a._getStripe();if(b){a._setColors(b,a._highestLevel);b.css({"z-index":a._getMaxZIndex(".ui-dialog")+1});a._notifying&&b.show();var c=b.find(".wr-clientLog-stats");if(c[0]){var d=xe(),e=qe;_.each(Od(ib),function(b){if(b<=a._notifyLevel){var h=e[b],b=c.find(".wr-clientLog-stats-"+b);b.find("th").text(h);b.find("td").text(d[h]||0)}})}}}
me.prototype._getStripe=function(){var a=this;if(!this._useNotifies)return k;var b=GLOBAL.document.body,c=k,d=k,e;b&&(d=jQuery("#wr-clientLog-style"),d[0]||(d=De.join("\r\n").replace(/\$\{([^}]+)}/g,function(a,b){return Ce[b]}),d=jQuery("<style id='wr-clientLog-style'>"+d+"</style>").prependTo(b)),c=jQuery("#wr-clientLog"),c[0]||(c=jQuery("<div id='wr-clientLog'/>").html(this._notifyMessage).css({display:"none"}).on("click keydown keyup keypress",l).prependTo(b),jQuery("<div/>").addClass("wr-clientLog-dismiss").text(Ce.dismiss).click(function(){a._notifying=
l;c.hide()}).attr("title","Click to dismiss").prependTo(c),this._notifyStats&&(e=jQuery("<table/>").addClass("wr-clientLog-stats").appendTo(c),_.each(Od(ib),function(a){jQuery("<tr><th></th><td></td></tr>").addClass("wr-clientLog-stats-"+a).appendTo(e)})),b=jQuery("<div/>").addClass("wr-clientLog-links").appendTo(c),jQuery("<a/>").text("SHOW").click(function(){Ae(a)}).attr("title","Shows the full log").appendTo(b),jQuery("<a/>").text("CLEAR").click(function(){ue(a);a._notifying=l;c.hide()}).attr("title",
"Clears the log and dismisses this notification").appendTo(b),this._setColors(c,this._highestLevel)));return c};me.prototype._getMaxZIndex=function(a){if(!jQuery.fn.zIndex)return 999;var b=Number.MIN_VALUE;jQuery(a||"*").each(function(){b=Math.max(b,jQuery(this).zIndex())});return b>Number.MIN_VALUE?b:999};me.prototype._setColors=function(a,b){var c=Be[b];a.css({"background-color":c[0],color:c[1]})};function Ee(){this._lastDepartureWaiter=k}s(Ee,pb);p("wr.nav.HttpWebRouter",Ee);Ee.prototype._log=z.getLog("wr.nav.HttpWebRouter");Ee.prototype.isRequestImplemented=function(){return Fe(j)!=k};Ee.prototype.isRequestImplemented=Ee.prototype.isRequestImplemented;
Ee.prototype.implementRequest=function(a){Fe();var b=a.getURL();if((b=b&&parseUri(b))&&(b.protocol||b.host||b.path||b.query))a.isDeparting()?0<a._inputs.length?Ge(this,a):He(this,a):Ie(this,a);else{var b=a.getURL(),c=a._target;a.start();this._log.debug("Request to "+b+" with target "+c+" - Consumed");a.success("Consumed",k,k)}};Ee.prototype.implementRequest=Ee.prototype.implementRequest;function Fe(a){var b=GLOBAL.document;a!==j&&!b&&f(Error("Document DOM not available"));return b}
function Ie(a,b){var c=Je(a,b),d=c[0]?c[0].form:k,e={};_.each(c,function(a){var b=encodeURIComponent(a.name);(e[b]||(e[b]={element:a,values:[]})).values.push(encodeURIComponent(a.value))});var g=b.getURL(),h={};h.xhr=Ke(d,e)||i;h.type="POST";h.data=Le(b.getParams(),c);h.dataType=Me(b.getResponseTypes())||i;var m=k;h.beforeSend=function(){a._log.debug("Request to "+g+" - Started");Ne();b.start();m=(new Date).valueOf()};h.success=function(c,d,h){var Ba=(new Date).valueOf()-m;a._log.isDebugEnabled()&&
a._log.debug("Request to "+g+" - Succeeded in "+Ba+" ms");b.success(d,h&&h.responseText,c);b=e=k};h.error=function(c,d,h){var Ba=(new Date).valueOf()-m,h=h&&(h.message||h),d=_.str.capitalize(d||"Generic error")+(h?" - "+h:"");a._log.isDebugEnabled()&&a._log.debug("Request to "+g+" - Failed in "+Ba+"ms, "+d);b.failure(d,c&&c.responseText);b=e=k};a._log.isDebugEnabled()&&a._log.debug("Request to "+g+" - Underway\nType: "+h.type+"\nData: "+ka(h.data)+"\nData type: "+h.dataType);jQuery.ajax(g,h)}
function Ne(){jQuery.each(Ub,function(a,b){b.beforeRequest()})}function Ke(a,b){return a&&_.any(b,function(a){return jQuery(a.element).is(":file")})?function(){return new Qd(a,b)}:k}
function Le(a,b){var c=[];c.push(jQuery.param(a));var d=jQuery(b),e={};d.each(function(a,b){var c=k;jQuery.each(Ub,function(a,d){if(d.accept(b))return c=d,l});if(c)e[b.id]=c.getter});d=d.filter(function(){return"submit"!=this.type&&"file"!=this.type&&"image"!=this.type&&!e[this.id]});c.push(d.serialize());B(e,function(a,b){var d=a(jQuery("#"+hc(b))[0]);c.push(encodeURIComponent(b)+"="+encodeURIComponent(d))});return _.filter(c,function(a){return!!a}).join("&")}var Oe={html:"html",json:"json",xml:"xml"};
function Me(a){return!a?k:_.map(a,function(a){return Oe[a]}).join(" ")}
function Ge(a,b){var c=jQuery(Je(a,b)),d=jQuery(c[0].form);Pe(a,b,l,function(){a._log.debug("Request to "+g+" - Form post complete");b.success("Form post complete",k,k)});var e={};jQuery.extend(e,b.getParams());c.filter(":submit").each(function(){var a=jQuery(this);e[a.prop("name")]=a.val()});var g=b.getURL(),c=b._target,h=Qe(),c=c||h.target;a._log.isDebugEnabled()&&a._log.debug("Request to "+g+" - Form submit underway\nForm: "+ka(d[0])+"\nExtra parameters: "+ka(e)+"\nTarget: "+c);b.start();Vb(d[0],
k,e,c).onComplete(function(){a._log.debug("Request to "+g+" - Form submitted")})}
function He(a,b){var c=b.getURL(),d=b._target,e=Re(c),g=Pe(a,b,e,function(){a._log.debug("Request to "+c+" - Location get complete");b.success("Location get complete",k,k)}),c=Ea(c,b.getParams()),c=_.str.strLeftBack(c,"#"),h=Qe(),c=Aa(h.href,c),d=d||h.target;a._log.isDebugEnabled()&&a._log.debug("Request to "+c+" - Location change underway\nTarget: "+d);b.start();(h=Se(d))?(d=h.location,d.href===c?d.reload(j):d.assign(c),a._log.debug("Request to "+c+" - Location changed"),(e||h!==GLOBAL)&&g._done===
l&&g._finish()):b.failure("Unable to open window for target "+d,k)}function Je(a,b){var c=[];_.each(b._inputs,function(b){if(jQuery(b).is(":input")){var e;var g=jQuery(b);!g.prop("disabled")&&!Te(b)?e=b:(e=g.data("wr-originalId")||g.attr("id"),g=g.data("wr-originalName")||g.attr("name"),e=(e?jQuery("#"+hc(e))[0]:g?jQuery(":input[name='"+ic(g)+"']:not(:disabled)")[0]:k)||k);e?c.push(e):a._log.debug("No replacement found for input "+ka(b))}});return c}
function Te(a){var b=a&&a.ownerDocument;if(!b)return j;do if(a===b)return l;while(a=a.parentNode);return j}function Re(a){var b=Qe().href,c=parseUri(Aa(b,".")),a=parseUri(Aa(b,a));return c.authority!==a.authority}function Qe(){var a=jQuery(Fe()).find("base").eq(0),b=GLOBAL.location.href,b=a[0]&&a.attr("href")||Aa(b,".."),a=a[0]&&a.attr("target")||"_self";return{href:b,target:a}}function Se(a){var b=GLOBAL;return!a||"_self"===a?b:"_parent"===a?b.parent:"_top"===a?b.top:b.open("about:blank",a)}
Ee.CALLBACK_COOKIE_PARAM="cbck";function Pe(a,b,c,d){if(a._lastDepartureWaiter){var e=a._lastDepartureWaiter;e._done===l&&e._finish();a._lastDepartureWaiter=k}a=new Td(d,j);c||(b.getParams().cbck=a._uniqueId?"wrReq"+a._uniqueId:k);return a};function L(){}s(L,pb);p("wr.nav.PropagationRouter",L);L.prototype._log=z.getLog("wr.nav.PropagationRouter");L.HASH_PARAMETER="CRC";L.linkInfosSelective={};L.linkInfos={};var Ue={},Ve={},We={};function Xe(a,b){var c=Ue,d=c[a]||(c[a]={}),e=Ve[a]!==l?We[a]||(We[a]={}):k;B(b,function(a,b){var c;if(a){if(c="object"===typeof a?{value:a.value,hash:a.hash}:{value:a,hash:k},d[b]=c,e&&c.hash)(e[b]||(e[b]={}))[c.value]=c.hash}else delete d[b]})}L.mergeLinkData=Xe;function Ye(a){a?delete Ue[a]:Ue={}}
L.clearLinkData=Ye;L.getLinkData=function(){return Ue};L.setKeepHashes=function(a,b){Ve[a]=!!b};L.extendParameters=function(a,b,c){if(c){var d=k;B(L.linkInfos,function(a,b){a[c]&&(d=b)});if(d){var e=a.CRC?new qa(a.CRC):k,g={},h=We[d];if(b)B(b,function(b,c){g[c]={value:b};e=Ze(a,c,g,h,e)}),e&&(a.CRC=e.toString())}}};
L.prototype.alterRequest=function(a){L._super.alterRequest.call(this,a);var b=$e(a);if(b){var c=k,d=k,e="true"===a.getParams().ajaxRefresh?L.linkInfosSelective:L.linkInfos;B(e,function(a,e){a[b]&&(c=a[b],d=e)});if(c&&d){var g=a.getParams(),h=g.CRC?new qa(g.CRC):k,m=Ue[d],r=We[d];if(m)this._log.isDebugEnabled()&&this._log.debug("Propagating link "+b),_.each(c,function(a){h=Ze(g,a,m,r,h)}),h&&(g.CRC=h.toString())}}};L.prototype.alterRequest=L.prototype.alterRequest;
function Ze(a,b,c,d,e){function g(a){if(e||a)if(a)if(a=new qa(a),e){var b=e;if(a){var c=a._bitSize;if(!(c<=b._bitSize)){for(var d=Math.ceil(c/28);b._chunks.length<d;)b._chunks.push(0);b._bitSize=c}for(c=0;c<b._chunks.length;c++)b._chunks[c]^=a._chunks[c]||0}}else e=a;else h.warn("Found missing hashes: request may fail validation")}var h=L.prototype._log,m=(c=c[b])&&c.value;if(m===i||m===k)return e;var r=a[b];r!==m&&(h.isDebugEnabled()&&h.debug("Propagating parameter "+b+" (old value: "+r+"): "+ka(c)),
r!==k&&r!==i&&g(d&&d[b]&&d[b][r]),g(c.hash));a[b]=m;return e}var af=new XRegExp("^!(?<fparams>.+)"),bf=new XRegExp("^button:(?<id>.+)$");function $e(a){var b=parseUri(a.getURL()),b=XRegExp.exec(b.anchor,af),c=(b?jQuery.deparam.querystring(b.fparams):{}).link||a.getParams().link;c||B(a.getParams(),function(a,b){var g=XRegExp.exec(b,bf);g&&(c=g.id)});c||jQuery.each(a._inputs,function(a,b){var g=jQuery(b);if(g.is(":input")&&(g=g.attr("name"),g=XRegExp.exec(g,bf)))return c=g.id,l});return c||k};function M(){this._app=k}s(M,mb);p("wr.logic.AjaxRequestActor",M);M.prototype._log=z.getLog("wr.logic.AjaxRequestActor");M.prototype._responseLog=z.getLog("wr.logic.AjaxRequestActor._response");M.prototype.setApp=ca("_app");M.prototype.setApp=M.prototype.setApp;M.prototype.setup=function(a){M._super.setup.call(this,a);this._defaults=a};M.prototype.setup=M.prototype.setup;
M.prototype.execute=function(a,b,c){var d=this,e=c.getDisplay(),g;jQuery.extend(a,this._defaults);g=cf(this,a,e);g=g.chain(function(){try{df(e);try{return ef(d,a)}finally{ff(e)}}catch(b){return d._log.error("Error in core request execution",b),new Sa(b)}});g=g.chain(function(a){var b=(a="object"===typeof a?a:k)&&a.getElementsByTagName("parsererror")[0];if(!a||b)f(Error("Received a non-XML response from server (see log for full text)"+(b?"\r\n"+b.textContent:"")));return gf(d,a,c)});b=function(b){hf(d,
a,e);return b};return g=g.chain(b,b)};M.prototype.execute=M.prototype.execute;function cf(a,b,c){var d=b.waitWin,e=b.indicator,a=d&&d.id?jf(a,d,c):Wa;e&&Ad(e)&&(a=a.chain(function(){jQuery(e).show()}));return a}function hf(a,b,c){var d=b.waitWin;(b=b.indicator)&&Ad(b)&&jQuery(b).hide();if(d&&d.id)d=d.id,a._log.debug("Closing waiting window "+d),c.closeWindow(d);return Wa}
function jf(a,b,c){var d=b.id,e={},g;a._log.debug("Opening waiting window "+d);b=jQuery.extend({},{width:200,height:100},b)||{};a=c.getWindow(d);e={};e.width=b.width;e.height=b.height;e.className="wr-waitDialog "+(b.className||"");a.setAttributes(e);kf(a,b.message);a.open();g=new v;GLOBAL.setTimeout(function(){g.success()},b.duration);return g._promise}function df(a){a.getOpenWindows()[0].getControls()[0].setAttribute("cursorType","wait")}
function ff(a){a.getOpenWindows()[0].getControls()[0].setAttribute("cursorType",k)}function ef(a,b){var c=lf(a,b.url,b.formPost,b.allowIgnoreFields||l);c.setResponseTypes("xml");var d=new v;c.addSuccessListener(function(b,c,h){try{d.success(h)}catch(m){mf(a,"Error at request success ("+b+")",c,m)}});c.addFailureListener(function(b,c){d.failure(mf(a,"Server request "+b,c,k))});a._app.getPlugin("nav").navigate(c);return d._promise}
function gf(a,b,c){var d=c.getDisplay();_.each(b.getElementsByTagName("CloseWindow"),function(b){var b=b.getAttribute("name"),c;a._log.debug("Closing window "+b);(c=d.getWindow(b))?(kf(c,""),c.close()):a._log.warn("Window "+b+" not found for closing")});_.each(b.getElementsByTagName("OpenWindow"),function(b){var c=b.getElementsByTagName("UIConfig")[0],c=jQuery.parseJSON(c.textContent||c.text),e=b.getElementsByTagName("Params")[0],r=[];e&&_.each(e.attributes,function(a){r[a.name]=a.value});nf(a,b.getAttribute("name"),
c,r,d)});var b=jQuery(b).find("Content").eq(0),e=b.attr("location");return e?of(a,e):pf(a,b,c)}function of(a,b){var c=new D(b,i,i,k);c.addFailureListener(function(b,c){mf(a,"External content request "+b,c,k)});return a._app.getPlugin("nav").navigate(c)}
function pf(a,b,c){var d=c.getDisplay(),e=c._state,c=b.attr("window");(d=d.getWindow(c))||f(Error("Unable to find window "+c+" to update"));c=b.children("PageRefresh").eq(0);c[0]?(c.find("HiddenFields").each(function(){var a=jQuery(this);e.set(a.attr("page")+"HiddenFields",a.text())}),c.find("LinkData").each(function(){var b=jQuery.parseJSON(_.str.trim(jQuery(this).text()));B(b,function(a,b){Xe(b,a)});a._log.isDebugEnabled()&&a._log.debug("Received new link data: "+ka(b))}),c.find("ControlData").each(function(){var a=
jQuery(this);e.set(a.attr("control"),a.text())})):(kf(d,b.text()),d.triggerEvent("contentchange"),d.setAttribute("autoResize",d.getAttribute("autoResize")));d.focus();return Wa}function mf(a,b,c,d){var e=d&&(d.message||d),b=b+(e?" - "+e:""),d=d instanceof Error?d:k;a._log.error(b,d);a._responseLog.isDebugEnabled()&&a._responseLog.debug("Server response was"+(c?":\r\n"+c:" still to be received"));return d||Error(b)}
function lf(a,b,c,d){var e={},g=[];e.ajax=j;if(c){Array.prototype.push.apply(g,jQuery(c.form).find(":input").filter(function(){var a=jQuery(this).attr("ignore");return!a&&a!=d}).get());e[c.button]="link";c.selectiveRefresh&&(e.ajaxRefresh="true");var h=_.str.strRight(c.button,"button:")+(c.selectiveRefresh?"_sr":""),h=jQuery(c.form).find(":input:hidden[name='"+hc(h)+"']")[0];0>_.indexOf(g,h)&&a._log.warn("Action URL input associated with button '"+c.button+"' was not sent along the request: this may disrupt application state")}return new D(b,
e,g)}
function nf(a,b,c,d,e){var g={};a._log.debug("Opening window "+b);a._app.getPlugin("ui").configureViews(k,c);c=e.getWindow(b);g={};g.modal="true"===d.modal;g.closable="true"===d.closable;g.draggable="true"===d.draggable;g.width=Number(d.width||"200");g.height=Number(d.height||"300");g.resizable="true"===d.resizable;g.autoResize="true"===d.autoResizing;g.maximizable="true"===d.maximizable;g.minimizable="true"===d.minimizable;g.showEffect=d.showEffect||k;g.hideEffect=d.hideEffect||k;g.className=d.className;
c.setAttributes(g);c.setData({title:d.title});c.isOpen()?a._log.warn("Window "+b+" is already open"):c.open()}function kf(a,b){var c=a.getControls()[0];c?c.setData({html:b}):a.setData({content:b})}M.prototype.precomputeRequest=function(a){jQuery.extend(a,this._defaults);var b=lf(this,a.url,a.formPost,a.allowIgnoreFields||l),a=_.str.strLeft(b.getURL(),"#"),b=jQuery.param(b.getParams());return{url:a,params:b}};M.prototype.precomputeRequest=M.prototype.precomputeRequest;
M.prototype.startFullWaitUX=function(a,b){return cf(this,a,b)};M.prototype.startFullWaitUX=M.prototype.startFullWaitUX;M.prototype.stopFullWaitUX=function(a,b){return hf(this,a,b)};M.prototype.stopFullWaitUX=M.prototype.stopFullWaitUX;M.prototype.startSendWaitUX=function(a,b){df(b)};M.prototype.startSendWaitUX=M.prototype.startSendWaitUX;M.prototype.stopSendWaitUX=function(a,b){ff(b)};M.prototype.stopSendWaitUX=M.prototype.stopSendWaitUX;M.prototype.processResponse=function(a,b){gf(this,a,b)};
M.prototype.processResponse=M.prototype.processResponse;function N(a,b){this._id=a;this._viewer=b;this._viewerListener=this._listeners=this._parent=k;this.addViewerListener()}p("wr.ui.Control",N);N.prototype._log=z.getLog("wr.ui.Control");N.prototype.destroy=function(){if(this._viewer){this.removeEventListener(k,k);this.removeViewerListener();this.setParent(k);try{this._viewer.destroy()}catch(a){this._log.error("Error destroying viewer",a)}this._viewer=k}};N.prototype.destroy=N.prototype.destroy;N.prototype.getId=n("_id");N.prototype.getId=N.prototype.getId;
N.prototype.getViewer=n("_viewer");N.prototype.getViewer=N.prototype.getViewer;N.prototype.getParent=n("_parent");N.prototype.getParent=N.prototype.getParent;N.prototype.setParent=function(a){if(this._parent!==a&&!this._guard_setParent){this._guard_setParent=j;try{if(this._parent)this._parent.removeControl(this),this._parent=k;if(a)a.addControl(this),this._parent=a}finally{delete this._guard_setParent}}};N.prototype.setParent=N.prototype.setParent;
N.prototype.addEventListener=function(a,b){var c=this;if("function"===typeof b)if(a){var d=this._getCallbacks(a,j);d.add(b);d._count++}else jQuery.each(Od(ub),function(a,d){c.addEventListener(d,b)})};N.prototype.addEventListener=N.prototype.addEventListener;N.prototype.removeEventListener=function(a,b){var c=this;if(a){var d=this._getCallbacks(a);d&&(b&&(d.remove(b),d._count--),(!b||0>=d._count)&&this._removeCallbacks(a))}else jQuery.each(Od(ub),function(a,d){c.removeEventListener(d,b)})};
N.prototype.removeEventListener=N.prototype.removeEventListener;N.prototype.triggerEvent=function(a){qf(this,a,k)};N.prototype.triggerEvent=N.prototype.triggerEvent;function qf(a,b,c){b&&(c=c||a._viewer.getView(),rf(a,new tb(b,a,c)))}function rf(a,b){if(b){a._log.isDebugEnabled()&&a._log.debug("Dispatching "+b+" to "+a);var c=a._getCallbacks(b._type);if(c)try{c.fireWith(a,[b])}catch(d){a._log.error("Error handling "+b+" on "+a,d)}a._parent&&rf(a._parent,b)}}
N.prototype._getCallbacks=function(a,b){var c=this._eventListeners;if(!c&&b)this._eventListeners=c={};var d=c&&c[a];if(!d&&b)c[a]=d=jQuery.Callbacks("unique"),d._count=0,this.addViewerListener();return d};N.prototype._removeCallbacks=function(a){var b=this._eventListeners,c=b&&b[a];c&&(c.empty(),delete b[a],this.removeViewerListener())};
N.prototype.addViewerListener=function(){var a=this,b=this._eventListeners;if(!b)this._eventListeners=b={};var c=b._count||0;if(0===c){var d=function(b,c){qf(a,b,c)};this._viewer.addEventListener(d);this._viewerListener=d}b._count=c+1};N.prototype.addViewerListener=N.prototype.addViewerListener;
N.prototype.removeViewerListener=function(){var a=this._eventListeners,b=a._count;if(0<b)a._count=b-1;else{if(this._viewerListener)this._viewer.removeEventListener(this._viewerListener),this._viewerListener=k;delete a._count}};N.prototype.removeViewerListener=N.prototype.removeViewerListener;N.prototype.isVisible=function(){return this.getAttribute("visible")!==l};N.prototype.isVisible=N.prototype.isVisible;N.prototype.setVisible=function(a){this.setAttribute("visible",a)};
N.prototype.setVisible=N.prototype.setVisible;N.prototype.isEnabled=function(){return this.getAttribute("enabled")!==l};N.prototype.isEnabled=N.prototype.isEnabled;N.prototype.setEnabled=function(a){this.setAttribute("enabled",a)};N.prototype.setEnabled=N.prototype.setEnabled;N.prototype.isFocused=function(){return this.getAttribute("focused")===j};N.prototype.isFocused=N.prototype.isFocused;N.prototype.focus=function(){this.setAttribute("focused",j)};N.prototype.focus=N.prototype.focus;
N.prototype.setAttribute=function(a,b){var c={};c[a]=b;this.writeAttributes(c)};N.prototype.setAttribute=N.prototype.setAttribute;N.prototype.setAttributes=function(a){this.writeAttributes(a)};N.prototype.setAttributes=N.prototype.setAttributes;N.prototype.writeAttributes=function(a){this._viewer.writeAttributes(a)};N.prototype.writeAttributes=N.prototype.writeAttributes;N.prototype.getAttribute=function(a){var b=this.readAttributes();return b?b[a]:i};N.prototype.getAttribute=N.prototype.getAttribute;
N.prototype.getAttributes=function(){return this.readAttributes()};N.prototype.getAttributes=N.prototype.getAttributes;N.prototype.readAttributes=function(){return this._viewer.readAttributes()};N.prototype.readAttributes=N.prototype.readAttributes;N.prototype.setData=function(a){a!==i&&this._viewer.writeData(a)};N.prototype.setData=N.prototype.setData;N.prototype.getData=function(){var a=this._viewer.readData();a===i&&f(new ga);return a};N.prototype.getData=N.prototype.getData;
N.prototype.setDataTree=function(a){this.setData(a?a.getRootData():k)};N.prototype.setDataTree=N.prototype.setDataTree;N.prototype.getDataTree=function(){var a=this._viewer.readData();return new F(a)};N.prototype.getDataTree=N.prototype.getDataTree;function O(a,b){N.call(this,a,b);this._controls=[];this._controlsById={}}s(O,N);p("wr.ui.Container",O);O.prototype.destroy=function(){_.each(this.getControls(),function(a){a.destroy()});O._super.destroy.call(this)};O.prototype.destroy=O.prototype.destroy;O.prototype.getControls=function(){return this._controls||[]};O.prototype.getControls=O.prototype.getControls;
O.prototype.addControl=function(a){if(a&&!this._guard_addControl){this._guard_addControl=j;try{var b=a.getParent();b!==this&&(b&&f(new t("Control has been already added to a container")),a.setParent(this),this._controls.push(a),this._controlsById[a._id]=a)}finally{delete this._guard_addControl}}};O.prototype.addControl=O.prototype.addControl;
O.prototype.removeControl=function(a){if(a&&!this._guard_removeControl){this._guard_removeControl=j;try{var b=a.getParent();if(b)b!==this&&f(new t("Control is not part of this container")),a.setParent(k),this._controls=jQuery.grep(this._controls,function(b){return b!==a})||[],delete this._controlsById[a._id]}finally{delete this._guard_removeControl}}};O.prototype.removeControl=O.prototype.removeControl;
O.prototype.getControl=function(a){return this._controlsById.hasOwnProperty(a)?this._controlsById[a]||k:k};O.prototype.getControl=O.prototype.getControl;O.prototype.lookupControl=function(a){var b=k;if(b=this.getControl(a))return b;jQuery.each(this._controls,function(c,d){if(d instanceof O&&(b=d.lookupControl(a)))return l});return b};O.prototype.lookupControl=O.prototype.lookupControl;
O.prototype.setAttributes=function(a){O._super.setAttributes.call(this,a);jQuery.each(this.getControls(),function(b,c){c.setAttributes(a)})};O.prototype.setAttributes=O.prototype.setAttributes;O.prototype.setDataTree=function(a){O._super.setDataTree.call(this,a);jQuery.each(this.getControls(),function(b,c){var d=a.getTree(c._id);c.setDataTree(d)})};O.prototype.setDataTree=O.prototype.setDataTree;
O.prototype.getDataTree=function(){var a=O._super.getDataTree.call(this);jQuery.each(this.getControls(),function(b,c){var d=c._id,e=c.getDataTree(d);e&&a.setTree(d,e)});return a};O.prototype.getDataTree=O.prototype.getDataTree;function sf(a,b){this._rootContainer=a;this._factoryProvider=b;this._contexts={}}p("wr.ui.ControlTreeBuilder",sf);sf.prototype._log=z.getLog("wr.ui.ControlTreeBuilder");sf.prototype.getRootContainer=n("_rootContainer");sf.prototype.getRootContainer=sf.prototype.getRootContainer;
sf.prototype.addContext=function(a,b,c){var d=this,e=a._id,g=b===k?"":b.join("_"),h=b===k?0:b.length,m=this._contexts[e];m||(this._contexts[e]=m={rank:h,ctxs:{},ctrls:{}});m.rank!==h&&f(new t("View '"+e+"' already has a context added with a different number of indexes"));var h=m.ctxs,r=m.ctrls;h.hasOwnProperty(g)&&f(new t("View '"+e+"' already has a context added with indexes "+ka(b)));h[g]=c;if(a=tf(this,a,b,c))if(r[g]=a,Pa(a))a.onSuccess(function(a){r[g]=a}).onFailure(function(a){d._log.error("Error creating '"+
e+"' control",a)})};sf.prototype.addContext=sf.prototype.addContext;sf.prototype.removeContext=function(a,b){var c=this,d=a._id,e=this._contexts[d];if(e){var g=e.ctxs,e=e.ctrls;if(b!==i){var h=b===k?"":b.join("_");if(g.hasOwnProperty(h)){var m=e[h];if(m)if(Pa(m))m.onSuccess(function(d){uf(c,a,b,d)});else uf(this,a,b,m);delete g[h]}}else{for(h in g)if(g.hasOwnProperty(h)&&kd(g,h)){if(m=e[h])if(Pa(m))m.onSuccess(function(b){uf(c,a,vf(h),b)});else uf(this,a,vf(h),m);delete g[h]}delete this._contexts[d]}}};
sf.prototype.removeContext=sf.prototype.removeContext;function vf(a){return a?jQuery.map(a.split("_"),function(a){return Number(a)}):k}function tf(a,b,c,d){var e=a._factoryProvider(b);if(!e)return k;b=e.create(b,c,d,a._factoryProvider);Pa(b)?b=b.chain(function(b){a._rootContainer.addControl(b);return b}):a._rootContainer.addControl(b);return b}function uf(a,b,c,d){var e=a._factoryProvider(b);a._rootContainer.removeControl(d);e?e.destroy(b,c,d):d.destroy()};function P(a,b){O.call(this,a,b)}s(P,O);p("wr.ui.Display",P);P.prototype.setParent=function(a){a!==k&&f(new ga("Cannot set display parent"))};P.prototype.setParent=P.prototype.setParent;P.prototype.readAttributes=function(){var a=P._super.readAttributes.call(this);a.visible=j;a.enabled=j;a.focused=j;return a};P.prototype.readAttributes=P.prototype.readAttributes;
P.prototype.writeAttributes=function(a){a.visible!==i&&f(new ga("Cannot set display 'visible' attribute"));a.enabled!==i&&f(new ga("Cannot set display 'enabled' attribute"));a.focused!==i&&f(new ga("Cannot set display 'focused' attribute"));P._super.writeAttributes.call(this,a)};P.prototype.writeAttributes=P.prototype.writeAttributes;P.prototype.getWindows=function(){return this.getControls()};P.prototype.getWindows=P.prototype.getWindows;P.prototype.getWindow=function(a){return this.getControl(a)};
P.prototype.getWindow=P.prototype.getWindow;P.prototype.getOpenWindows=function(){var a=[];jQuery.each(this.getWindows(),function(b,c){c.isOpen()&&a.push(c)});return a||[]};P.prototype.getOpenWindows=P.prototype.getOpenWindows;P.prototype.openWindow=function(a){(a=a&&this.getWindow(a))&&a.open()};P.prototype.openWindow=P.prototype.openWindow;P.prototype.closeWindow=function(a){(a=a&&this.getWindow(a))&&a.close()};P.prototype.closeWindow=P.prototype.closeWindow;function wf(a,b){this._display=a;this._state=b}p("wr.logic.Context",wf);wf.prototype.getDisplay=n("_display");wf.prototype.getDisplay=wf.prototype.getDisplay;wf.prototype.getState=n("_state");wf.prototype.getState=wf.prototype.getState;function Q(a,b){this._id=a;this._actor=b;this._failureLink=this._successLinks=this._transportLinks=k}p("wr.logic.Action",Q);Q.prototype._log=z.getLog("wr.logic.Action");Q.prototype.destroy=function(){this._failureLink=this._successLinks=this._transportLinks=k;try{this._actor.destroy()}catch(a){this._log.error("Error destroying actor",a)}this._actor=k};Q.prototype.destroy=Q.prototype.destroy;Q.prototype.getId=n("_id");Q.prototype.getId=Q.prototype.getId;Q.prototype.getActor=n("_actor");
Q.prototype.getActor=Q.prototype.getActor;Q.prototype.addTransport=function(a,b){if(a)this._transportLinks?jQuery.each(this._transportLinks,function(b,d){d.action===a&&f(new t("Propagation for "+a+" already added"))}):this._transportLinks=[],this._transportLinks.push({action:a,couplings:b||k})};Q.prototype.addTransport=Q.prototype.addTransport;
Q.prototype.removeTransport=function(a){var b=this;a&&this._transportLinks&&jQuery.each(this._transportLinks,function(c,d){if(d.action===a)return b._transportLinks.splice(c,1),l})};Q.prototype.removeTransport=Q.prototype.removeTransport;Q.prototype.addSuccessHop=function(a,b,c){if(b)a=a||k,this._successLinks?this._successLinks.hasOwnProperty(a)&&f(new t("Success hop for '"+a+"' already added")):this._successLinks={},this._successLinks[a]={action:b,couplings:c||k}};Q.prototype.addSuccessHop=Q.prototype.addSuccessHop;
Q.prototype.removeSuccessHop=function(a){this._successLinks&&delete this._successLinks[a||k]};Q.prototype.removeSuccessHop=Q.prototype.removeSuccessHop;Q.prototype.addFailureHop=function(a,b){if(a)this._failureLink&&f(new t("Failure hop already added")),this._failureLink={action:a,couplings:b||k}};Q.prototype.addFailureHop=Q.prototype.addFailureHop;Q.prototype.removeFailureHop=function(){this._failureLink=k};Q.prototype.removeFailureHop=Q.prototype.removeFailureHop;
Q.prototype.execute=function(a,b){return xf(this,a,{},b)};Q.prototype.execute=Q.prototype.execute;function xf(a,b,c,d){var e={},b=Qa(a._actor.execute,a._actor,b||{},e,d);return b=b.chain(function(b){var h=a._successLinks&&a._successLinks[b||k];return h?yf(a,h,e,c,d):b},function(b){var h=a._failureLink;return h?yf(a,h,e,c,d):b})}function yf(a,b,c,d,e){a._transportLinks&&jQuery.each(a._transportLinks,function(a,b){zf(b,c,d)});zf(b,c,d);return xf(b.action,d[b.action._id]||{},d,e)}
function zf(a,b,c){var d=a.action._id,a=a.couplings,e;(e=c[d])||(e=c[d]={});jQuery.each(a,function(a,c){var d=i,r=c._sourceName,R=c._sourceValue;r&&(d=b[r]);d===i&&(d=R);d!==i&&(e[c._targetName]=d)})};function Af(){this._actions=this._app=k}s(Af,Ka);p("wr.logic.LogicPlugin",Af);Af.prototype._log=z.getLog("wr.logic.LogicPlugin");Af.prototype.configure=function(a){Bf(this);if(a.actions)return Cf(this,a.actions)};Af.prototype.configure=Af.prototype.configure;Af.prototype.dispose=function(){Bf(this)};Af.prototype.dispose=Af.prototype.dispose;
function Cf(a,b){var c=a.getApp().getConfigPlugin(),d={},e=[],g={};B(b,function(b,e){var g=Df(a,e,b,c);d[e]=g});B(b,function(a,b){var c=d[b],c=c.chain(function(b){return Ef(b,a,d)}),c=c.chain(function(a){g[b]=a});e.push(c)});return Na.apply(u,e).chain(function(){a._actions=g},i)}function Bf(a){if(a._actions)B(a._actions,function(a){a.destroy()}),a._actions=k}
function Df(a,b,c,d){var e,d=d.readInstanceFactory(c.actor);e=c.actorConfig||{};return d.newInstance().chain(function(c){ja(c,La)===k&&c.setApp(a.getApp());c.setup(e);return new Q(b,c)})}
function Ef(a,b,c){var d=[];B(b,function(b,g){var h,m,r;if(h=/^(transport|success|failure)(?:_(.+))?$/.exec(g))m=h[1],r=h[2],B(b,function(b,e){var g=[],h;(h=c[e])||f(Error("Invalid target action '"+e+"'"));B(b,function(a,b){var c=k,d=i;"string"===typeof a?c=a:"object"===typeof a&&(d=a.value||i);g.push(new ob(b,c,d))});h=h.chain(function(b){"success"===m?a.addSuccessHop(r,b,g):"failure"===m?a.addFailureHop(b,g):"transport"===m&&a.addTransport(b,g)});d.push(h)})});return Na.apply(u,d).chain(function(){return a},
i)}Af.prototype.getAction=function(a){this._actions||f(new t("Actions are not available"));return this._actions[a]||k};Af.prototype.getAction=Af.prototype.getAction;Af.prototype.executeAction=function(a,b,c){var d=this.getAction(a);d||f(Error("Action '"+a+"' not found"));return d.execute(b,c)};Af.prototype.executeAction=Af.prototype.executeAction;function Ff(){this._app=k}p("wr.ui.ViewerBasedControlFactory",Ff);Ff.prototype.setApp=ca("_app");Ff.prototype.setApp=Ff.prototype.setApp;
Ff.prototype.create=function(a,b,c,d){var e=this;this._app||f(new t("Application not set"));var g=this._app.getConfigPlugin().readInstanceFactory(a._config.viewer,[a,b]),h=a._config.viewerConfig||{};g||f(Error("View does not have a configured viewer"));return g.newInstance().chain(function(g){var r;a.getViews();ja(g,La)===k&&g.setApp(e._app);g.isContextProvider()?(r=e.newContainer(a,b,g),d&&g.setContextRegistry(e.newContextRegistry(r,0,d))):r=e.newControl(a,b,g);g.setup(h,c,k);return r})};
Ff.prototype.create=Ff.prototype.create;Ff.prototype.destroy=function(a,b,c){c.destroy()};Ff.prototype.destroy=Ff.prototype.destroy;Ff.prototype.newContextRegistry=function(a,b,c){return new sf(a,c)};Ff.prototype.newContextRegistry=Ff.prototype.newContextRegistry;Ff.prototype.newControl=function(a,b,c){return new N(this.makeControlId(a,b),c)};Ff.prototype.newControl=Ff.prototype.newControl;Ff.prototype.newContainer=function(a,b,c){return new O(this.makeControlId(a,b),c)};
Ff.prototype.newContainer=Ff.prototype.newContainer;Ff.prototype.makeControlId=function(a,b){var c=[a._id];b&&jQuery.each(b,function(a,b){jQuery.merge(c,["[",b,"]"])});return c.join("")};Ff.prototype.makeControlId=Ff.prototype.makeControlId;function Gf(){this._app=k}s(Gf,Ff);p("wr.ui.DisplayControlFactory",Gf);Gf.prototype.newControl=function(a,b,c){return new P(this.makeControlId(a,b),c)};Gf.prototype.newControl=Gf.prototype.newControl;Gf.prototype.newContainer=function(a,b,c){return new P(this.makeControlId(a,b),c)};Gf.prototype.newContainer=Gf.prototype.newContainer;function S(a,b){O.call(this,a,b);this._lastFocusedControlId=k;this.addEventListener("focus",jQuery.proxy(this._handleFocus,this))}s(S,O);p("wr.ui.Window",S);S.prototype.open=function(){this.setAttribute("open",j)};S.prototype.open=S.prototype.open;S.prototype.close=function(){this.setAttribute("open",l)};S.prototype.close=S.prototype.close;S.prototype.isOpen=function(){return this.getAttribute("open")===j};S.prototype.isOpen=S.prototype.isOpen;S.prototype.setTitle=function(a){this.setData({title:a})};
S.prototype.setTitle=S.prototype.setTitle;S.prototype.getTitle=function(){return this.getData().title||k};S.prototype.getTitle=S.prototype.getTitle;S.prototype.readAttributes=function(){var a=S._super.readAttributes.call(this);a.visible=a.open;a.enabled=j;return a};S.prototype.readAttributes=S.prototype.readAttributes;
S.prototype.writeAttributes=function(a){a.visible!==i&&f(new ga("Cannot set window 'visible' attribute directly"));a.enabled!==i&&f(new ga("Cannot set window 'enabled' attribute"));S._super.writeAttributes.call(this,a);a.focused===j&&Hf(this)};S.prototype.writeAttributes=S.prototype.writeAttributes;S.prototype._handleFocus=function(a){a=a._sourceControl;a===this?Hf(this):this._lastFocusedControlId=a._id};
function Hf(a){var b;(b=a._lastFocusedControlId?a.lookupControl(a._lastFocusedControlId):a.getControls()[0]||k)?b.focus():a._lastFocusedControlId=k};function If(){this._app=k}s(If,Ff);p("wr.ui.WindowControlFactory",If);If.prototype.newControl=function(a,b,c){return new S(this.makeControlId(a,b),c)};If.prototype.newControl=If.prototype.newControl;If.prototype.newContainer=function(a,b,c){return new S(this.makeControlId(a,b),c)};If.prototype.newContainer=If.prototype.newContainer;function T(a,b,c){K.call(this,a,b,c)}s(T,K);p("wr.ui.html.ElementViewer",T);T.prototype._log2=z.getLog("wr.ui.html.ElementViewer");T.prototype._codeLog=z.getLog("wr.ui.html.ElementViewer._code");T.prototype.setup=function(a,b){T._super.setup.call(this,a,b);jQuery(this.getContext()).on(Jf,jQuery.proxy(this.handleEvent,this))};T.prototype.setup=T.prototype.setup;T.prototype.destroy=function(){jQuery(this.getContext()).off(Jf,this.handleEvent);T._super.destroy.call(this)};T.prototype.destroy=T.prototype.destroy;
var Kf={focusin:"focus",focusout:"blur",click:"click",keypress:"keypress",keydown:"keydown",keyup:"keyup"},Jf=function(){var a=[];B(Kf,function(b,c){a.push(c+".wr")});return a.join(" ")}();T.prototype.handleEvent=function(a){var b=Kf[a.type];b&&this.raiseEventForHtmlEvent(b,k,a)};T.prototype.handleEvent=T.prototype.handleEvent;var Lf={pointer:"pointer",wait:"wait"},Mf={pointer:"pointer",wait:"wait"};
T.prototype.writeAttributes=function(a){var b=jQuery(this.getContext()),c=a&&a.visible;c!==i&&(c?b.show():b.hide());c=a&&a.cursorType;if(c!==i)b[0].style.cursor=Mf[c]||"";T._super.writeAttributes.call(this,a)};T.prototype.writeAttributes=T.prototype.writeAttributes;T.prototype.readAttributes=function(){var a=T._super.readAttributes.call(this),b=jQuery(this.getContext());a.visible=b.is(":visible");a.cursorType=Lf[b[0].style.cursor]||i;return a};T.prototype.readAttributes=T.prototype.readAttributes;
T.prototype.writeData=function(a){var b=a.html;if(b!==i){var c=jQuery(this.getContext()),d=jQuery(this.getLastFocusedElement()),e=this.isFocused()?d.attr("id"):i,a=d[0]&&Oc(d[0]),d=d.is(":text")?d.val():k;this.updateContent(b);e&&(b=c.find("#"+hc(e)),0<b.length?(Nc(b[0]),a&&(e=b.is(":text")?b.val():k,d&&e&&d!==e&&(a=Rc(a,d,e)),Qc(b[0],a))):this._log2.debug("["+this.getView()._id+"] "+("Focus not restored to disappeared element '"+e+"'")))}};T.prototype.writeData=T.prototype.writeData;
T.prototype.sanitizeHTML=function(a){var b,c;return(b=/<body(?:\s[^>]+)?>/i.exec(a))&&(c=/<\/body>/i.exec(a))?a.substring(b.index+b[0].length,c.index):a};T.prototype.sanitizeHTML=T.prototype.sanitizeHTML;T.prototype.extractResourceElements=function(a){var b,c,d=k;if((b=/<head[^>]*>/i.exec(a))&&(c=/<\/head>/i.exec(a)))d=_.str.trim(a.substring(b.index+b[0].length,c.index));return d?jQuery(d).filter("script, link, style").get():[]};T.prototype.extractResourceElements=T.prototype.extractResourceElements;
function Nf(a,b){"string"===typeof b&&(/<\/?html[\s>]/.test(b)||/<\/?head[\s>]/.test(b)||/<\/?body[\s>]/.test(b))&&a._log2.warn("HTML fragment appears to contain elements forbidden in document body: this may cripple UI behavior");var c=jQuery("<div/>")[0];if("string"===typeof b)a._setInnerHTML(c,b);else for(var d;d=b[0];)c.insertBefore(d,k);return c}
T.prototype._setInnerHTML=function(a,b){var c=l,d=jQuery("<div/>")[0];d.innerHTML='<script>"test";<\/script>';if(0>d.innerHTML.toLowerCase().indexOf("<script"))d.innerHTML='<form></form><script>"test";<\/script>',c=0<d.innerHTML.toLowerCase().indexOf("<script");Kb(d);c=c?function(a,b){a.innerHTML="<form id='_hack_form'></form>"+b;var c=a.firstChild;"_hack_form"===c.id&&Kb(c)}:function(a,b){a.innerHTML=b};T.prototype._setInnerHTML=c;return c(a,b)};
T.prototype.updateContent=function(a){var b=this.createOldContentFragment(),c=this.createNewContentFragment(this.sanitizeHTML(a)),a=jQuery(this.extractResourceElements(a)).filter(function(){var a=Tc(this,j);return a?Xc(a):j}),d=c.firstChild;a.each(function(){c.insertBefore(this,d)});Pb();try{this.replaceContent(b,c)}catch(e){e instanceof pa?(this._log2.error("["+this.getView()._id+"] Error caused by inline scripts in updated content (see log for full code)",e.cause||e),this._codeLog.isDebugEnabled()&&
this._codeLog.debug("["+this.getView()._id+"] "+("Executed code was:\r\n"+e.sourceCode))):this._log2.error("["+this.getView()._id+"] Error during content update",e)}finally{Qb()}a.each(function(){var a=Tc(this,j);a&&Yc(a.name)});this.destroyFragments(b,c)};T.prototype.updateContent=T.prototype.updateContent;T.prototype.createOldContentFragment=function(){return Nf(this,this.getContext().childNodes)};T.prototype.createOldContentFragment=T.prototype.createOldContentFragment;
T.prototype.createNewContentFragment=function(a){return Nf(this,a)};T.prototype.createNewContentFragment=T.prototype.createNewContentFragment;T.prototype.destroyFragments=function(a,b){Lb||(Lb=new Ib);Lb.post(a);Lb||(Lb=new Ib);Lb.post(b)};T.prototype.destroyFragments=T.prototype.destroyFragments;
T.prototype.replaceContent=function(a,b){var c=jQuery(this.getContext());c.empty();Sb();try{Mb(c[0],jQuery.makeArray(b.childNodes))}finally{var d=Tb();0<d.length&&(d=jQuery("<div>"+d.join("")+"</div>")[0],Mb(c[0],jQuery.makeArray(d.childNodes)))}};T.prototype.replaceContent=T.prototype.replaceContent;function Of(a,b){K.call(this,a,b,j);this._containersFilter=k;this._availableViews={}}s(Of,T);p("wr.ui.html.ContainerElementViewer",Of);Of.prototype.setup=function(a,b){if(zd(b))b=b.body,b==k&&f(Error("DOM Document context must contain a HTML body"));a.containersFilter||f(Error("Containers filter not specified"));this._containersFilter=a.containersFilter;Of._super.setup.call(this,a,b);this._refreshContexts(k,Pf(this),l)};Of.prototype.setup=Of.prototype.setup;
Of.prototype.destroy=function(){this._refreshContexts(Pf(this),k,j);Of._super.destroy.call(this)};Of.prototype.destroy=Of.prototype.destroy;
Of.prototype.replaceContent=function(a,b){function c(a){var b=[];jQuery.each(a,function(a,c){b.push(c.value)});return jQuery(b)}var d=Pf(this,a),e=Pf(this,b),e=e.map(function(){var a=jQuery(this),b=a.attr("id");return b&&a.is(":empty")&&(b=d.filter("#"+hc(b)).eq(0),b[0]&&a[0]!==b[0])?(a[0].parentNode.replaceChild(b[0],a[0]),b.find("script").filter(function(){return/^$|\/(?:java|ecma)script/i.test(this.type)}).each(function(){Kb(this)}),b[0]):k});jQuery(this.getContext()).is("body")&&(Qf(jQuery(b)),
Rf(jQuery(a),jQuery(b)));Of._super.replaceContent.call(this,a,b);e=ld(d,e);this._refreshContexts(c(e.removed),c(e.added),l)};Of.prototype.replaceContent=Of.prototype.replaceContent;function Qf(a){a.children().each(function(){jQuery.data(this,"wr-initial",j)})}function Rf(a,b){var c=a.children(),d=[],e=[],g;for(g=0;g<c.length&&!jQuery.data(c[g],"wr-initial");g++)d.push(c[g]);for(g=c.length-1;0<g&&!jQuery.data(c[g],"wr-initial");g--)e.unshift(c[g]);b.prepend(jQuery(d)).append(jQuery(e))}
jQuery(function(){var a=jQuery("body");a[0]&&Qf(a)});Of.prototype.refreshSubViews=function(){this._refreshContexts(k,k,l)};Of.prototype.refreshSubViews=Of.prototype.refreshSubViews;
Of.prototype._refreshContexts=function(a,b,c){var d=this,e=this.getContextRegistry(),g=this.collectSubViewsDiffs();jQuery.each(g.removed,function(a,b){var c=b._id;e&&e.removeContext(b);delete d._availableViews[c]});e&&a&&a.each(function(){var a=d._availableViews[jQuery(this).attr("id")];a&&e.removeContext(a)});jQuery.each(g.added,function(a,b){d._availableViews[b._id]=b});!c&&b&&b.each(function(){var a=d._availableViews[jQuery(this).attr("id")];a&&e.addContext(a,k,this)})};
function Pf(a,b){return(b=b||a.getContext())&&a._containersFilter?jQuery(Bd(b,a._containersFilter)):k};function U(){this._app=k;var a=this;this._context=this._requestAction=this._containersFilter=k;this._windowKeys=new Sf;this._controlCloseListener=function(b){b=b._sourceControl;b instanceof S&&Tf(a,b)};this._navListener={requestEnqueue:function(a){var c=a._inputs[0];a._wr_enqueuedForm=c&&c.form},requestBeforeServe:function(b){var c=b._wr_enqueuedForm;c&&!jQuery.contains(GLOBAL.document.documentElement,c)&&(a._log.isDebugEnabled()&&a._log.debug("Canceling request bound to post a removed form "+ka(c)),
a.getApp().getPlugin("nav").cancel(b))}};this._startListeners=[];this._started=l}s(U,Ka);p("wr.LegacyAjaxPlugin",U);U.prototype._log=z.getLog("wr.LegacyAjaxPlugin");U.prototype.configure=function(a){a.containersFilter||f(Error("Containers filter not specified"));this._containersFilter=a.containersFilter};U.prototype.configure=U.prototype.configure;
U.prototype.start=function(){var a=this,b=jQuery(GLOBAL.document),c=this.getApp().getPlugin("ui").getDisplay(),d=new Uf(c,this);this._requestAction=Vf(this);this._context=new wf(c,d);this.getApp().getPlugin("nav").addListener(this._navListener);this._hyperlinkActivationListener=Wf(this,this._handleHyperlinkActivation);this._hyperlinkNavigationListener=Wf(this,this._handleHyperlinkNavigation);this._formButtonActivationListener=Wf(this,this._handleFormButtonActivation);this._formSubmissionListener=
Wf(this,this._handleFormSubmission);b.on("focusin mouseenter","a, area",jQuery.proxy(this._hyperlinkActivationListener,this));b.on("click","a, area",jQuery.proxy(this._hyperlinkNavigationListener,this));b.on("click submit",":submit",jQuery.proxy(this._formButtonActivationListener,this));b.on("submit","form",jQuery.proxy(this._formSubmissionListener,this));c.addEventListener("contentchange",Xf);c.addEventListener("close",this._controlCloseListener);Yf(this,this._context.getDisplay());Zf(this,c.getWindows()[0]);
$f(this);_.each(this._startListeners,function(b){try{b()}catch(c){a.error("Error invoking start listener",c)}});this._started=j};U.prototype.start=U.prototype.start;
U.prototype.stop=function(){var a=jQuery(GLOBAL.document),b=this.getApp().getPlugin("ui").getDisplay(),c=this.getApp()._externalExecutionScope;c.deleteGlobal("WRAjaxRequest");c.deleteGlobal("ajaxRequest");ag(this,"Prototype")?this._log.debug("Skipping deletion of global $H Prototype's function"):c.deleteGlobal("$H");this._log.info("Compatibility interface disabled");this._windowKeys.clear();L.linkInfos={};L.linkInfosSelective={};this._log.debug("Cleared link information");Ye();this._log.debug("Cleared link data");
b.removeEventListener("close",this._controlCloseListener);b.removeEventListener("contentchange",Xf);a.off("focusin mouseenter","a, area",this._hyperlinkActivationListener);a.off("click","a, area",this._hyperlinkNavigationListener);a.off("click",":submit",this._formButtonActivationListener);a.off("submit","form",this._formSubmissionListener);this.getApp().getPlugin("nav").removeListener(this._navListener);this._context=k;if(this._requestAction)this._requestAction.destroy(),this._requestAction=k;this._started=
l};U.prototype.stop=U.prototype.stop;U.prototype.addStartListener=function(a){if(a&&(this._startListeners.push(a),this._started))try{a()}catch(b){this.error("Error invoking start listener",b)}};U.prototype.addStartListener=U.prototype.addStartListener;U.prototype.removeStartListener=function(a){if(a)this._startListeners=_.without(this._startListeners,a)};U.prototype.removeStartListener=U.prototype.removeStartListener;U.addEventInterceptor=function(a){a&&yc.add(a)};
U.removeEventInterceptor=function(a){a&&yc.remove(a)};var bg=[];U.addContentUpdateHandler=function(a){a&&bg.push(a)};U.removeContentUpdateHandler=function(a){a&&(bg=_.without(bg,a))};var cg=jQuery.Callbacks("unique");U.addContentUpdateListener=function(a){a&&cg.add(a)};U.removeContentUpdateListener=function(a){a&&cg.remove(a)};function Xf(a){var b;a=a._sourceControl;a instanceof S&&(b=(a=a.getControls()[0])&&a._viewer,a=b,a instanceof K&&cg.fireWith(GLOBAL,[a.getContext()]))}
U.navigateLocation=function(a,b){var c=xc().getPlugin("oldajax");dg(a)&&(!b||"_self"===b)?(c._log.isDebugEnabled()&&c._log.debug("Firing AJAX request for location change to "+a),c._compatAjaxRequest(a,c._compatNewHash({}))):(c._log.isDebugEnabled()&&c._log.debug("Queuing request for location change to "+a),c.getApp().getPlugin("nav").navigate(new D(a,k,k,b)))};U.exit=function(){var a=xc(),b=a.getPlugin("ui").getDisplay().getOpenWindows(),c;for(c=b.length-1;0<=c;c--)b[c].close();return a.stop().chain(function(){a.dispose()})};
function $f(a){function b(){d.setGlobal("$H",jQuery.proxy(c._compatNewHash,c))}var c=a,d=a.getApp()._externalExecutionScope;ag(a,"$H")?ag(a,"Prototype")?a._log.debug("Skipping re-definition of global $H Prototype's function"):(a._log.warn("Overwriting existing global $H function"),b()):b();(ag(a,"ajaxRequest")||ag(a,"WRAjaxRequest"))&&f(Error("Legacy interface conflict: check that WebRatio 6.x and earlier client runtime is not loaded"));d.setGlobal("ajaxRequest",jQuery.proxy(a._compatAjaxRequest,
a));d.setGlobal("WRAjaxRequest",jQuery.proxy(a._compatAjaxRequestCtor,a));a._log.info("Compatibility interface enabled")}function ag(a,b){return"undefined"!==typeof a.getApp()._externalExecutionScope.getGlobal(b)||"undefined"!==typeof GLOBAL[b]}o=U.prototype;o._compatNewHash=function(a){a=a||{};return{get:function(b){return a[b]},toObject:function(){return a}}};
o._compatAjaxRequest=function(a,b){var c=this;try{this._log.debug("Queuing AJAX request to "+a);var d=eg(this,b),e=fg(a,d);$c();var g=this._context,h=g.getDisplay(),m=this._requestAction.execute(e,g),r=[],R=function(a){a._sourceControl instanceof S&&r.push(a._sourceControl)};h.addEventListener("open",R);h.addEventListener("contentchange",R);var e=function(){h.removeEventListener("open",R);h.removeEventListener("contentchange",R);0<r.length&&_.each(r,function(a){var b=a.getControls()[0],b=b&&b._viewer;
(b=b instanceof K?b.getContext():k)&&jQuery(b).data("wr-appid",c.getApp()._id);Zf(c,a);Yf(c,a)})},m=m.chain(e,e),e=function(){$c()},m=m.chain(e,e),I=ba(),m=m.chain(I,I);if(d.onFailureCallBack)m.onFailure(function(){GLOBAL.eval(d.onFailureCallBack+"()")});if(d.onCompleteCallBack)m.onComplete(function(){d.onCompleteCallBack()})}catch(Ba){this._log.error("Error preparing request",Ba)}if((m=GLOBAL.event)&&("click"===m.type||"keypress"===m.type))if(jQuery(m.target||m.srcElement).closest("[href], :submit")[0])GLOBAL.event.returnValue=
l;return l};
o._compatAjaxRequestCtor=function(a,b){var c=this;this._log.debug("Legacy precomputed request to "+a);var d=eg(this,b),d=fg(a,d),e=this._requestAction._actor,g=this._context;d.allowIgnoreFields=l;var h=e.precomputeRequest(d);d.allowIgnoreFields=j;var m=e.precomputeRequest(d);return function(a,b){var d={};_.each(b.useless||[],function(b){d[b]=function(){c._log.warn("Calling "+a+"."+b+" - Method has no more use")}});_.each(b.gone||[],function(b){d[b]=function(){c._log.warn("Calling "+a+"."+b+" - Method is no longer available")}});
jQuery.extend(d,b.impl||{});return d}("WRAjaxRequest",{useless:["updateWindowSize"],gone:["sendRequest","openInfoDialog","createAndPrepareWindow"],impl:{getUrl:function(a){return c._compatNewHash(a===l?h:m)},computeResponse:function(a){e.processResponse(a,g)}}})};
function eg(a,b){var c={};if(b){c.isForm=b.get("isForm");c.pressedLink=b.get("pressedLink");c.selectiveRefresh=b.get("selectiveRefresh");c.onFailureCallBack=b.get("onFailureCallBack");c.onCompleteCallBack=b.get("onCompleteCallBack");c.extraQuery=b.get("extraQuery");c.sourcePage=b.get("sourcePage");b.get("window")!==i&&a._log.warn("Setting request window option - Option has no more use");b.get("closeWindow")!==i&&a._log.warn("Setting request closeWindow option - Option has no more use");var d=b.get("waitingWindow");
c.openWaitingWindow=!!d;c.waitWin={};if(c.openWaitingWindow)c.waitWin.message=d.get("message"),c.waitWin.width=d.get("width"),c.waitWin.height=d.get("height"),c.waitWin.duration=d.get("duration"),c.waitWin.className=d.get("className");c.indicator=b.get("indicator")}return c}
function fg(a,b){var c,d;b.isForm?((d=jQuery("#"+hc(a))[0]||jQuery("form[name='"+ic(a)+"']")[0])||f(Error("Form '"+a+"' not found for posting")),c=jQuery(d).attr("action"),d={form:d,button:b.pressedLink,selectiveRefresh:"boolean"===typeof b.selectiveRefresh?b.selectiveRefresh:j}):(c=a,d=k);b.extraQuery&&(c=c+(0>c.indexOf("?")?"?":"")+b.extraQuery);var e={};e.url=c;d&&(e.formPost={button:d.button,form:d.form,selectiveRefresh:d.selectiveRefresh});b.openWaitingWindow&&(e.waitWin={id:"_oldajax_ww",duration:b.waitWin.duration,
width:b.waitWin.width,height:b.waitWin.height,className:b.waitWin.className,message:b.waitWin.message});b.indicator&&(e.indicator="string"===typeof b.indicator?jQuery("#"+hc(b.indicator))[0]:b.indicator);return e}function Vf(a){var b=new M;ja(b,La)===k&&b.setApp(a.getApp());b.setup({});return new Q("oldajax",b)}
o._handleHyperlinkActivation=function(a){a=jQuery(a.currentTarget);if(a.attr("href")){var b=this.getApp().getPlugin("nav"),c=gg(a);b.precompute(c);b=c.getURL();b=parseUri(b);(!b.protocol||"http"===b.protocol||"https"===b.protocol)&&a.attr("href",Ea(c.getURL(),c.getParams()))}};
o._handleHyperlinkNavigation=function(a){if(!a.isDefaultPrevented()){var b=jQuery(a.currentTarget);if(b.attr("href")&&hg(b.attr("href"))){a.preventDefault();var a=b.attr("href"),c=b.attr("target")||k;dg(a)&&(!c||"_self"===c)?(this._log.isDebugEnabled()&&this._log.debug("Firing AJAX request for hyperlink "+ka(b[0])),this._compatAjaxRequest(a,this._compatNewHash({}))):(this._log.isDebugEnabled()&&this._log.debug("Queuing request for hyperlink "+ka(b[0])),this.getApp().getPlugin("nav").navigate(gg(b)))}}};
function gg(a){var b=a.attr("href"),a=a.attr("target")||k;return new D(b,k,k,a)}o._handleFormButtonActivation=function(a){var a=jQuery(a.currentTarget),b=jQuery(a[0].form);b[0]&&b.data("_wr_submitButton",a.prop("name"))};
o._handleFormSubmission=function(a){if(!a.isDefaultPrevented()){var b=jQuery(a.currentTarget),c=b.data("_wr_submitButton");if(c&&(b.removeData("_wr_submitButton"),c=b.find(":submit[name='"+hc(c)+"']"),hg(b.attr("action")||""))){a.preventDefault();var a=b.attr("action")||"",d=b.attr("target")||k,e=c.attr("name"),g=_.str.strRight(e,"button:");(g=b.find(":input:hidden[name='"+hc(g)+"']").attr("value"))||this._log.warn("Cannot find action URL associated with button '"+e+"'");dg(g)&&(!d||"_self"===d)?
(this._log.isDebugEnabled()&&this._log.debug("Firing AJAX request for submit of form "+ka(b[0])),(b=b.attr("id")||b.attr("name"))?this._compatAjaxRequest(b,this._compatNewHash({isForm:j,pressedLink:e,selectiveRefresh:l})):this._log.error("Cannot submit a form lacking both 'id' and 'name' attributes")):(this._log.isDebugEnabled()&&this._log.debug("Queuing request for submit of form "+ka(b[0])),b=b.find(":input:not(:submit)").add(c).get(),b=new D(a,k,b,d),this.getApp().getPlugin("nav").navigate(b))}}};
var ig=new XRegExp("^!(?<fparams>.+)");function dg(a){a=parseUri(a);a=XRegExp.exec(a.anchor,ig);return"true"===(a?jQuery.deparam.querystring(a.fparams):{}).ajax}function Wf(a,b){var c=a.getApp()._id;return function(a){if(""+(jQuery(a.target).parents().filter(function(){return jQuery(this).data("wr-appid")}).data("wr-appid")||"default")===c)return b.call(this,a)}}
function hg(a){(a=parseUri(a).protocol.toLowerCase())||(a=parseUri(GLOBAL.document.location.href).protocol.toLowerCase());return"http"===a||"https"===a}function Uf(a,b){this._display=a;this._parent=b}o=Uf.prototype;o.get=da(k);o.set=function(a,b){var c=this._display.lookupControl(a);c?(this._parent._log.debug("Updating HTML data of control '"+a+"'"),c.setData({html:b}),Yf(this._parent,c)):_.str.trim(""+b)&&this._parent._log.warn("Control '"+a+"' not found")};o.remove=ba();o.toObject=function(){return{}};
o.addEventListener=ba();o.removeEventListener=ba();o.triggerEvent=ba();function Yf(a,b){if(b instanceof O){var c;c=b instanceof P?b:a.getApp().getPlugin("ui").getDisplay();b===c?_.each(c.getWindows(),function(b){jg(a,b)}):b instanceof S?jg(a,b):(c=b._viewer,c instanceof K&&kg(a,b,c.getContext(),k))}}
function jg(a,b){var c=a._containersFilter,d=b.getControls()[0],e=d&&d._viewer;if(e instanceof K){var d=b.getParent(),g=d.getWindows()[0],h=[];b===g&&_.each(d.getWindows(),function(a){var b=a.getControls()[0],b=b&&b._viewer;a!==g&&b instanceof K&&Array.prototype.push.apply(h,jQuery.makeArray(Bd(b.getContext(),c)))});d=b.getControls()[0];b===g?kg(a,d,e.getContext(),h):kg(a,d,e.getContext(),k)}}
function kg(a,b,c,d){var e=a._containersFilter,g=_.map(b.getControls(),function(a){return a._viewer.getContext()}),h=[];e&&(h=_.map(jQuery(Bd(c,e)).not(jQuery(d)),aa()));c=ld(g,h);_.each(c.removed,function(c){var c=c.value.id,d=b.getControl(c);a._log.debug("Removing control for removed container '"+c+"'");d&&(b.removeControl(d),d.destroy())});_.each(b.getControls(),function(b){var c=jQuery("#"+hc(b._id))[0];kg(a,b,c,k)});_.each(c.added,function(c){var c=c.value,d=c.id,g;a._log.debug("Adding control for added container '"+
d+"'");g=new lg(new pd(d,{}),k);d=new O(d,g);g.setup({containersFilter:e},c);b.addControl(d);kg(a,d,c,k)})}function lg(a,b){Of.call(this,a,b)}s(lg,Of);o=lg.prototype;o.setup=function(a,b){lg._super.setup.call(this,a,b);this._lazyRemove=!!jQuery(this.getContext()).children(".wr-ajaxContent")[0]};
o.updateContent=function(a){function b(a){if(0<=a){var d=b(a-1);return function(b,c){e[a](b,c,d)}}return function(a,b){g.call(c,b)}}var c=this,d=this.getContext(),e=bg,g=lg._super.updateContent;b(e.length-1)(d,a);cg.fireWith(GLOBAL,[d])};o.createOldContentFragment=function(){return this._lazyRemove?jQuery(this.getContext()).children(".wr-ajaxContent").hide()[0]:lg._super.createOldContentFragment.call(this)};
o.createNewContentFragment=function(a){a=lg._super.createNewContentFragment.call(this,a);if(this._lazyRemove){var b=jQuery(a).children(".wr-ajaxContent")[0];b||f(Error("Content holder element missing in new HTML."));b["wr-fragRoot"]=a;a=b}return a};
o.destroyFragments=function(a,b){function c(a){if(a.id)jQuery.data(a,"wr-originalId",a.id),a.id="___"+a.id;if(a.name)jQuery.data(a,"wr-originalName",a.name),a.name="___"+a.name;if(a.form)a.disabled=j;for(var b=0,a=a.childNodes,d=a.length;b<d;b++){var e=a[b];1==e.nodeType&&e.nodeName&&"SELECT"!=e.nodeName.toUpperCase()&&c(e)}}if(this._lazyRemove){c(a);var d=b["wr-fragRoot"];try{delete b["wr-fragRoot"]}catch(e){try{b.removeAttribute("wr-fragRoot")}catch(g){b["wr-fragRoot"]=k}}b=d}lg._super.destroyFragments.call(this,
a,b)};o.replaceContent=function(a,b){var c=[];jQuery(b).find(".ajaxPreservedMarkup script").each(function(){c.unshift({script:this,parent:this.parentNode,next:this.nextSibling})});if(this._lazyRemove){var d=this.getContext();Sb();try{Ob(d,[b],a)}finally{var e=Tb();0<e.length&&(e=jQuery("<div>"+e.join("")+"</div>")[0],Mb(d,jQuery.makeArray(e.childNodes)))}}else lg._super.replaceContent.call(this,a,b);_.each(c,function(a){a.parent.insertBefore(a.script,a.next)})};
function Zf(a,b){var c=b.getControls()[0],c=c&&c._viewer;if(c=c instanceof K?c.getContext():k){var d=a._windowKeys,e=mg(c,"linkInfos");e&&(ng(d,b,"info",Hd(e)),Kd(L.linkInfos,e,1),a._log.isDebugEnabled()&&a._log.debug("Received new link information: "+ka(e)));if(e=mg(c,"linkInfosSelective"))ng(d,b,"infoSel",Hd(e)),Kd(L.linkInfosSelective,e,1),a._log.isDebugEnabled()&&a._log.debug("Received new selective link information: "+ka(e));if(c=mg(c,"linkData"))B(c,function(a,c){ng(d,b,"data",[c]);Xe(c,a)}),
a._log.isDebugEnabled()&&a._log.debug("Received new link data: "+ka(c))}}function Tf(a,b){var c=a._windowKeys,d=og(c,b,"info"),e=og(c,b,"infoSel"),c=og(c,b,"data");0>=d.length&&0>=c.length||(_.each(d,function(a){delete L.linkInfos[a]}),a._log.debug("Cleared link information: "+ka(d)),_.each(e,function(a){delete L.linkInfosSelective[a]}),a._log.debug("Cleared selective link information: "+ka(e)),_.each(c,function(a){Ye(a)}),a._log.debug("Cleared link data: "+ka(c)))}
function mg(a,b){if(!a||!b)return k;var c=jQuery(a).find("script[type='application/json'].wr-"+hc(b)).eq(0),c=_.str.trim(c.text()||c.html()||"");return!c?k:jQuery.parseJSON(c)}function Sf(){this._usageKeys={};this._keyUsages={}}function ng(a,b,c,d){var e=b._id+"."+c,b=a._usageKeys[e]||(a._usageKeys[e]=[]);b.push.apply(b,d);var g=a._keyUsages;_.each(d,function(a){(g[a]||(g[a]=[])).push(e)})}
function og(a,b,c){var d=b._id+"."+c,b=a._usageKeys[d]||[];delete a._usageKeys[d];var e=a._keyUsages;_.each(b,function(a){var a=e[a],b=-1;a&&0<=(b=_.indexOf(a,d))&&a.splice(b,1)});return b=_.filter(b,function(a){return!pg(this,c,a)},a)}Sf.prototype.clear=function(){this._usageKeys={};this._keyUsages={}};function pg(a,b,c){return _.some(a._keyUsages[c]||[],function(a){return _.str.endsWith(a,"."+b)})};function qg(a,b){K.call(this,a,b,j)}s(qg,T);p("wr.ui.html.OverloadedElementViewer",qg);qg.prototype.setup=function(a,b){qg._super.setup.call(this,a,b);this._refreshContexts(l)};qg.prototype.setup=qg.prototype.setup;qg.prototype.destroy=function(){this._refreshContexts(j);qg._super.destroy.call(this)};qg.prototype.destroy=qg.prototype.destroy;qg.prototype.refreshSubViews=function(){this._refreshContexts(l)};qg.prototype.refreshSubViews=qg.prototype.refreshSubViews;
qg.prototype._refreshContexts=function(a){var b=this.getContextRegistry();if(b){var c=this.getContext(),d=this.collectSubViewsDiffs();if(a)d.added=[],d.removed=this.getView().getViews();jQuery.each(d.removed,function(a,c){b.removeContext(c)});jQuery.each(d.added,function(a,d){b.addContext(d,k,c)})}};function db(a,b,c,d){this._ctorName=a;this._ctorArgs=b||[];this._scriptURL=c?c:k;this._loader=c?d:k;this._loadPromise=k}p("wr.util.InstanceFactory",db);db.prototype.getConstructorName=n("_ctorName");db.prototype.getConstructorName=db.prototype.getConstructorName;
db.prototype.newInstance=function(){function a(){try{var a=Gd(b._ctorName);"function"!==typeof a&&f(new ReferenceError("Unable to find constructor '"+b._ctorName+"'"));var e=ha(a.prototype);a.apply(e,b._ctorArgs);c.success(e)}catch(g){c.failure(g)}}var b=this,c=new v;if(this._scriptURL&&this._loadPromise===k)this._loadPromise=this._loader.load(this._scriptURL,"script"),this._loader=this._scriptURL=k;if(this._loadPromise!==k)this._loadPromise.onSuccess(function(){a()}).onFailure(function(a){c.failure(a)});
else a();return c._promise};db.prototype.newInstance=db.prototype.newInstance;function fb(a){this._factories=a||[]}p("wr.util.InstanceListFactory",fb);fb.prototype.getSize=function(){return this._factories.length};fb.prototype.getSize=fb.prototype.getSize;fb.prototype.newInstance=function(){var a=[];jQuery.each(this._factories,function(b,c){a.push(c.newInstance())});return Na.apply(Na,a)};fb.prototype.newInstance=fb.prototype.newInstance;function V(){this._displayFactory=this._display=this._rootView=this._factoriesPromise=this._app=k;this._autoFocusFirstWindow=l}s(V,Ka);p("wr.ui.UIPlugin",V);V.prototype._log=z.getLog("wr.ui.UIPlugin");V.prototype.configure=function(a){rg(this);this._autoFocusFirstWindow=!!a.autoFocusFirstWindow;this._factoriesPromise=sg(this,a.factories);if(a.display)return tg(this,a.display).chain(function(a){(a=a.getWindows()[0])&&a.open()})};V.prototype.configure=V.prototype.configure;
V.prototype.start=function(){var a;if(this._autoFocusFirstWindow&&(a=this._display&&this._display.getWindows()[0]))this._log.debug("Automatically focusing the first window"),a.focus()};V.prototype.start=V.prototype.start;V.prototype.dispose=function(){rg(this)};V.prototype.dispose=V.prototype.dispose;V.prototype.getViewTree=function(){this._rootView||f(new t("View tree is not available"));return this._rootView};V.prototype.getViewTree=V.prototype.getViewTree;
V.prototype.configureViews=function(a,b){var c=this,d={};this.unconfigureViews(a,b);ug(this,a,function(a){B(b,function(b,h){var m=vg(c,h,b,d);a.addView(m);c._log.debug("Added view "+m+" to "+a)})})};V.prototype.configureViews=V.prototype.configureViews;V.prototype.unconfigureViews=function(a,b){var c=this;ug(this,a,function(a){_.each(_.filter(a.getViews(),function(a){return b.hasOwnProperty(a._id)}),function(b){a.removeView(b);c._log.debug("Removed view "+b+" from "+a)})})};
V.prototype.unconfigureViews=V.prototype.unconfigureViews;function ug(a,b,c){var d;b?(d=a.lookupControl(b))||f(Error("Parent control '"+b+"' not found")):d=a.getDisplay();b=d._viewer.getView();c.call(a,b);d._viewer.refreshSubViews()}V.prototype.getDisplay=function(){this._display||f(new t("Display is not available"));return this._display};V.prototype.getDisplay=V.prototype.getDisplay;V.prototype.getWindows=function(){return this.getDisplay().getControls()};V.prototype.getWindows=V.prototype.getWindows;
V.prototype.getMainWindow=function(){return this.getDisplay().getWindows()[0]||k};V.prototype.getMainWindow=V.prototype.getMainWindow;V.prototype.getWindow=function(a){return this.getDisplay().getControl(a)};V.prototype.getWindow=V.prototype.getWindow;V.prototype.lookupControl=function(a){var b=this.getDisplay();return a===b._id?b:b.lookupControl(a)};V.prototype.lookupControl=V.prototype.lookupControl;
function tg(a,b){var c=k,c=vg(a,"display",b,{});return a._factoriesPromise.chain(function(b){function e(a){var c=b[a._config.factory||"default"];c||f(Error("Missing factory for view "+a));return c}var g,h;g=a.getDisplayContext();h=e(c);return Qa(h.create,h,c,k,g,e).chain(function(b){a._rootView=c;a._display=b;a._displayFactory=h;return b})})}
function rg(a){if(a._display)a._displayFactory&&a._rootView?a._displayFactory.destroy(a._rootView,k,a._display):a._display.destroy(),a._displayFactory=k,a._display=k;a._rootView=k}V.prototype.getDisplayContext=function(){return GLOBAL};V.prototype.getDisplayContext=V.prototype.getDisplayContext;
function sg(a,b){var c=a.getApp().getConfigPlugin(),d=[],e=[];B(b,function(a,b){d.push(b);e.push(c.readInstanceFactory(a))});return(new fb(e)).newInstance().chain(function(b){var c={};jQuery.each(b,function(b,e){ja(e,La)===k&&e.setApp(a.getApp());c[d[b]]=e});return c})}function vg(a,b,c,d){var e,g=c.views;e=wg(b,c);g&&B(g,function(b,c){var g=vg(a,c,b,d);e.addView(g)});d[b]&&f(Error("Duplicate view id '"+b+"'"));d[b]=c;return e}
function wg(a,b){var c=/^views$/,d={};B(b,function(a,b){c.test(b)||(d[b]=a)});return new pd(a,d)};function W(){this._globals={};this._active=l;this._savedGlobals=k}p("wr.util.obj.ExecutionScope",W);W.prototype.isActive=n("_active");W.prototype.isActive=W.prototype.isActive;W.prototype.activate=function(){this._active&&f(new t("Already active"));this._active=j;var a=this._savedGlobals={};_.each(this._globals,function(b,c){a[c]=GLOBAL[c];b!==i?GLOBAL[c]=b:Fd(GLOBAL,c)})};W.prototype.activate=W.prototype.activate;
W.prototype.deactivate=function(){this._active||f(new t("Not active"));this._active=l;var a=this._savedGlobals||{};_.each(this._globals,function(b,c,d){b=a[c];d[c]=GLOBAL[c];b!==i?GLOBAL[c]=b:Fd(GLOBAL,c)});this._savedGlobals=k};W.prototype.deactivate=W.prototype.deactivate;W.prototype.run=function(a){if(this._active)return xg(a);try{return this.activate(),xg(a)}finally{this.deactivate()}};W.prototype.run=W.prototype.run;
function xg(a){var b=yg(a),c=[];_.each(b,function(a){c.push(Object.prototype.hasOwnProperty.call(GLOBAL,a)?GLOBAL[a]:i)});return a.apply(GLOBAL,c)}W.prototype.getGlobal=function(a){return this._globals[""+a]};W.prototype.getGlobal=W.prototype.getGlobal;W.prototype.setGlobal=function(a,b){var a=""+a,c=this._globals.hasOwnProperty(a);this._globals[a]=b;this._active&&this._savedGlobals&&(c||(this._savedGlobals[a]=GLOBAL[a]),GLOBAL[a]=b)};W.prototype.setGlobal=W.prototype.setGlobal;
W.prototype.deleteGlobal=function(a){var a=""+a,b=this._globals.hasOwnProperty(a);delete this._globals[a];this._active&&this._savedGlobals&&(b||(this._savedGlobals[a]=GLOBAL[a]),Fd(GLOBAL,a))};W.prototype.deleteGlobal=W.prototype.deleteGlobal;function yg(a){return(a=/^function[^(]*\(\s*([^)]*?)\s*\)/.exec(Function.prototype.toString.call(a))[1])?a.split(/\s*,\s*/):[]};function zg(a,b){W.call(this);this._includeSelector=a;this._excludeSelector=b;this._combinedSelector=a+", "+b;this._elements=k}s(zg,W);zg.prototype.activate=function(){zg._super.activate.call(this);GLOBAL.document.getElementById=jQuery.proxy(this._getElementByScopedId,this)};zg.prototype.deactivate=function(){zg._super.deactivate.call(this);delete GLOBAL.document.getElementById;this._elements=k};
zg.prototype._getElementByScopedId=function(a){var b=GLOBAL.document,b=(GLOBAL.HTMLDocument?GLOBAL.HTMLDocument.prototype:GLOBAL.Object.getPrototypeOf(b)).getElementById.call(b,a);if(!b)return k;var c=jQuery(b).closest(this._combinedSelector);return!c[0]||c.is(this._includeSelector)?b:jQuery(this._includeSelector).find("#"+hc(a))[0]||k};function X(a){this._id=a;this._plugins={};this._lifecycle=new E(this);this._configured=k;this._earlyConfigResult=new v;this._disposed=this._started=this._inited=k;var b=".wr-appui-"+hc(a);this._externalExecutionScope=jQuery(b)[0]?new zg(b,".wr-appui"):new W;a in X._instances&&f(new t("There is already a known application with id '"+a+"'"));X._instances[a]=this;this._log.info("Creating application '"+a+"'");this._loader=new Ac;this._lifecycle.register(this._loader);var c=this._externalExecutionScope;
_.each(zc,function(a,b){c.setGlobal(b,a)});_.each(Ag,function(a){this.addLifecycleListener(a)},this)}p("wr.app.App",X);X.prototype._log=z.getLog("wr.App");X._instances={};function Bg(){return _.values(X._instances)}X.getAll=Bg;function Cg(a){return X._instances[a]||k}X.get=Cg;X.prototype.getId=n("_id");X.prototype.getId=X.prototype.getId;
X.prototype.init=function(){var a=this;this._configured!==j&&f(new t("Application not configured"));this._inited!==k&&f(new t("Application already initialized or initializing"));this._inited=l;this._log.info("Application lifecycle: init");var b=Dg(this,this.getConfigPlugin()._config).onFailure(function(b){a._log.error("Error applying final configuration",b)}),b=b.chain(function(){return a._lifecycle.init()}).onFailure(function(b){a._log.error("Error during lifecycle init",b)});return b.onSuccess(function(){a._inited=
j})};X.prototype.init=X.prototype.init;X.prototype.start=function(){var a=this;this._inited!==j&&f(new t("Application not initialized"));this._started!==k&&f(new t("Application already started or starting"));this._started=l;this._log.info("Application lifecycle: start");return this._lifecycle.start().onSuccess(function(){a._started=j;a._log.info("Application '"+a._id+"' started")}).onFailure(function(b){a._log.error("Error during lifecycle start",b)})};X.prototype.start=X.prototype.start;
X.prototype.stop=function(){var a=this;this._started!==j&&f(new t("Application not started or stopping"));this._started=l;this._log.info("Application lifecycle: stop");return this._lifecycle.stop().onSuccess(function(){a._started=k;a._log.info("Application '"+a._id+"' stopped")}).onFailure(function(b){a._log.error("Error during lifecycle stop",b)})};X.prototype.stop=X.prototype.stop;
X.prototype.dispose=function(){var a=this;this._started!==k&&f(new t("Application still started"));if(this._disposed!==k)return Wa;this._disposed=l;var b;this._inited===k?b=Wa:(this._log.info("Application lifecycle: dispose"),b=this._lifecycle.dispose().onSuccess(function(){a._disposed=j}).onFailure(function(b){a._log.error("Error during lifecycle dispose",b)}));b.onComplete(function(){delete X._instances[a._id]});return b};X.prototype.dispose=X.prototype.dispose;
X.prototype.isInitialized=function(){return this._inited===j};X.prototype.isInitialized=X.prototype.isInitialized;X.prototype.isStarted=function(){return this._started===j};X.prototype.isStarted=X.prototype.isStarted;X.prototype.addLifecycleListener=function(a,b){this._lifecycle.addListener(a,b)};X.prototype.addLifecycleListener=X.prototype.addLifecycleListener;X.prototype.removeLifecycleListener=function(a){this._lifecycle.removeListener(a)};X.prototype.removeLifecycleListener=X.prototype.removeLifecycleListener;
X.prototype.getLoader=n("_loader");X.prototype.getLoader=X.prototype.getLoader;X.prototype.registerPlugin=function(a,b){a in this._plugins&&f(new t("Plugin already registered with id '"+a+"'"));b.getApp()&&f(new t("Plugin instance already registered with an application"));this._plugins[a]=b;b.setApp(this);this._lifecycle.register(b);try{this.handlePluginRegistration()}catch(c){b.setApp(k),this._lifecycle.unregister(b),delete this._plugins[a],f(c)}};X.prototype.registerPlugin=X.prototype.registerPlugin;
X.prototype.unregisterPlugin=function(a){var b=this.getPlugin(a);this.handlePluginUnregistration(a);this._lifecycle.unregister(b);b.setApp(k);delete this._plugins[a]};X.prototype.unregisterPlugin=X.prototype.unregisterPlugin;X.prototype.getPlugin=function(a){var b=this._plugins[a];(b=this.handlePluginLookup(a,b))||f(new t("No plugin registered with id '"+a+"'"));return b};X.prototype.getPlugin=X.prototype.getPlugin;X.prototype.handlePluginRegistration=ba();X.prototype.handlePluginRegistration=X.prototype.handlePluginRegistration;
X.prototype.handlePluginUnregistration=function(a){"log"===a&&this._log.warn("Log plugin is being unregistered: it might not be possible to continue logging on some components")};X.prototype.handlePluginUnregistration=X.prototype.handlePluginUnregistration;X.prototype.handlePluginLookup=function(a,b){if(!b&&"config"===a)b=this._bootConfigManager;return b};X.prototype.handlePluginLookup=X.prototype.handlePluginLookup;X.PLUGIN_LOG="log";X.prototype.getLogPlugin=function(){return this.getPlugin("log")};
X.prototype.getLogPlugin=X.prototype.getLogPlugin;X.PLUGIN_CONFIG="config";X.prototype.getConfigPlugin=function(){return this._bootConfigManager||this.getPlugin("config")};X.prototype.getConfigPlugin=X.prototype.getConfigPlugin;
X.prototype.configure=function(a){var b=this;this._configured!==k&&f(new t("Application initial configuration already provided"));this._configured=l;this._bootConfigManager=new A;this._bootConfigManager.setApp(this);this._bootConfigManager.addHandler(new $a);this._bootConfigManager.addHandler(new bb);var c=jQuery.extend({},this.getDefaultConfig()||{},a=a||{})||{},a=Dg(this,c);return a=a.chain(function(){b._bootConfigManager=k;b.getConfigPlugin().merge(c);b._earlyConfigResult.success();b._earlyConfigResult=
k;b._configured=j},function(a){b._log.error("Error applying default configuration",a);b._earlyConfigResult.failure(a);return a})};X.prototype.configure=X.prototype.configure;X.prototype.getDefaultConfig=function(){return Ma};X.prototype.getDefaultConfig=X.prototype.getDefaultConfig;X.prototype.mergeConfig=function(a){return Eg(this,function(){return this.merge(a)})};X.prototype.mergeConfig=X.prototype.mergeConfig;
X.prototype.mergeConfigFiles=function(a){var b=arguments;return Eg(this,function(){return this.mergeFiles.apply(this,b)})};X.prototype.mergeConfigFiles=X.prototype.mergeConfigFiles;X.prototype.isConfigurable=function(){return this._inited===k};X.prototype.isConfigurable=X.prototype.isConfigurable;
function Eg(a,b){a._inited!==k&&f(new t("Unable to modify configuration at this time"));return a._earlyConfigResult?a._earlyConfigResult._promise.chain(function(){return Ra(b,a.getConfigPlugin())}):Ra(b,a.getConfigPlugin())}function Dg(a,b){if(!b)return Wa;var c=[],d;for(d in b)b.hasOwnProperty(d)&&c.push(Fg(a,d,b[d]));return Na.apply(u,c)}
function Fg(a,b,c){var d=a.getConfigPlugin().readInstanceFactory(c.implementation,k),e=new v,g=a._plugins[b];if(g){var h;try{h=Gd(d._ctorName)}catch(m){h=k}h!==g.constructor?e.failure(new t("A different implementation of '"+b+"' is already registered")):e.success(g)}else d.newInstance().onSuccess(function(c){try{a.registerPlugin(b,c),e.success(c)}catch(d){e.failure(d)}}).onFailure(function(a){e.failure(a)});return e._promise.chain(function(a){var b=jQuery.extend({},c);delete b.implementation;return Qa(a.configure,
a,b)})}var Ag=[];X.addLifecycleListener=function(a,b){a&&!_.contains(Ag,a)&&(Ag.push(a),_.each(Bg(),function(c){c.addLifecycleListener(a,b)}))};X.removeLifecycleListener=function(a){if(a){var b=_.indexOf(Ag,a);0<=b&&(Ag.splice(b,1),_.each(Bg(),function(b){b.removeLifecycleListener(a)}))}};X.prototype.getExternalExecutionScope=n("_externalExecutionScope");X.prototype.getExternalExecutionScope=X.prototype.getExternalExecutionScope;var Gg=k;function xc(){var a=Gg||Cg("default");a||f(new t("Default application not available"));return a}p("wr.getApp",xc);p("wr.runScoped",function(a,b){var c=Hg(a),d=Cg(c);d||f(Error("Application '"+c+"' not found"));return Ig(d,b)});function wc(a){var b=Gg;return b?Jg(b._id,a):a}p("wr.keepScoped",wc);function Jg(a,b){var c=Hg(a);return function(){var a=this,e=jQuery.makeArray(arguments),g=Cg(c);g||f(Error("Application '"+c+"' not found"));return Ig(g,function(){return b.apply(a,e)})}}
p("wr.makeScoped",Jg);function Hg(a){"string"!==typeof a&&(a=""+(jQuery(a).parents().filter(function(){return jQuery(this).data("wr-appid")}).data("wr-appid")||""));return""+(a||"default")}function Ig(a,b){var c=Gg;try{return Gg=a,a._externalExecutionScope.run(b)}finally{Gg=c}}
(function(){ac();var a=jQuery("script").filter(function(){return"wr.js"===/^(.+?)(?:;jsessionid=[0-9A-Fa-f]+)?$/.exec(parseUri(jQuery(this).attr("src")).file)[1]});if(a[0]){a=parseUri(a.attr("src"));$b=jQuery.deparam.querystring(a.query);var b=parseUri(GLOBAL.location.href);Zb=b.protocol+"://"+b.authority+b.directory+a.directory}a=z.getLog("wr");a.info("WebRatio Runtime (7.2.12.20160224141936, wr.js)");a.info("Platform: "+ma().getInfo()||"Unknown")})();
$b&&"true"===$b.createDocumentApp&&function(){var a=z.getLog("wr"),b=new X("default");window.onerror=function(b,c,d){a.error("Unexpected error occurred: "+b+"\n\tat <unknown>("+c+":"+d+")")};b._externalExecutionScope.activate();var c=new v;Eb(function(){b.configure({}).onSuccess(function(){c.success()}).onFailure(function(a){c.failure(a)})});var d=c._promise,e=$b,g=e.configFiles?e.configFiles.split(","):[];0<g.length&&(d=d.chain(function(){return b.mergeConfigFiles.apply(b,g)}));var h=new v;jQuery(GLOBAL.document).ready(function(){try{ac(),
h.success()}catch(b){a.error("Final environemnt check failed",b),h.failure(b)}});h._promise.onSuccess(function(){$c()});Na(h._promise,d).chain(function(){return Qa(b.init,b)},function(b){a.error("Error during default application init",b);return b}).chain(function(){return Qa(b.start,b)},function(b){a.error("Error during default application start",b);return b});jQuery(GLOBAL).one("unload",function(){Wa.chain(function(){return Qa(b.stop,b)},i).chain(function(){return Qa(b.dispose,b)}).onFailure(function(b){a.error("Error during default application stop and dispose",
b)}).onComplete(function(){window.onerror=k})})}();function Kg(a){if(a===k)return k;"boolean"!==typeof a&&f(new TypeError("Not a boolean value"));return a?"true":"false"}p("wr.util.str.formatBoolean",Kg);function Lg(a){if(a===k)return k;if("true"===a)return j;if("false"===a)return l;f(new TypeError("Invalid boolean string '"+a+"'"))}p("wr.util.str.parseBoolean",Lg);function Mg(a){"number"===typeof a&&0!==a%1&&f(new TypeError("Not a finite integral number"));return Ng(a)}p("wr.util.str.formatInteger",Mg);
function Og(a){var b=Pg(a);b!==k&&0!==b%1&&f(new TypeError("Invalid integral number string '"+a+"'"));return b}p("wr.util.str.parseInteger",Og);function Ng(a){if(a===k)return k;("number"!==typeof a||!isFinite(a))&&f(new TypeError("Not a finite number"));return""+a}p("wr.util.str.formatDecimal",Ng);function Pg(a){if(a===k)return k;var b=Number(""+a);isFinite(b)||f(new TypeError("Invalid number string '"+a+"'"));return b}p("wr.util.str.parseDecimal",Pg);var Qg=new XRegExp("^(?<y>\\d{4})-(?<M>\\d{2})-(?<d>\\d{2})$");
function Rg(a){if(a===k)return k;a instanceof Date||f(new TypeError("Not a Date"));var b=[];b.push(""+a.getFullYear());b.push("-");b.push(_.str.lpad(""+(a.getMonth()+1),2,"0"));b.push("-");b.push(_.str.lpad(""+a.getDate(),2,"0"));return b.join("")}p("wr.util.str.formatDate",Rg);function Sg(a){if(a===k)return k;var b;if(b=XRegExp.exec(a,Qg))return new Date(b.y,b.M-1,b.d,0,0,0,0);f(new TypeError("Invalid date string '"+a+"'"))}p("wr.util.str.parseDate",Sg);var Tg=new XRegExp("^(?<H>\\d{2}):(?<m>\\d{2}):(?<s>\\d{2})(?<S>\\.\\d{3})?$");
function Ug(a){if(a===k)return k;a instanceof Date||f(new TypeError("Not a Date"));var b=[];b.push(_.str.lpad(""+a.getHours(),2,"0"));b.push(":");b.push(_.str.lpad(""+a.getMinutes(),2,"0"));b.push(":");b.push(_.str.lpad(""+a.getSeconds(),2,"0"));a=a.getMilliseconds();0<a&&(b.push("."),b.push(_.str.lpad(""+a,3,"0")));return b.join("")}p("wr.util.str.formatTime",Ug);
function Vg(a){if(a===k)return k;var b;if(b=XRegExp.exec(a,Tg))return new Date(1970,0,1,b.H,b.m,b.s,b.S||"0");f(new TypeError("Invalid time string '"+a+"'"))}p("wr.util.str.parseTime",Vg);function Wg(a){if(a===k)return k;a instanceof Date||f(new TypeError("Not a date"));return[Rg(a),Ug(a)].join("T")}p("wr.util.str.formatTimestamp",Wg);
function Xg(a){if(a===k)return k;var b=a.split("T",2);if(2===b.length){var c=XRegExp.exec(b[0],Qg),b=XRegExp.exec(b[1],Tg);if(c&&b)return new Date(c.y,c.M-1,c.d,b.H,b.m,b.s,b.S||"0")}f(new TypeError("Invalid timestamp string '"+a+"'"))}p("wr.util.str.parseTimestamp",Xg);function Y(a,b,c,d,e){K.call(this,a,b,c);this._idAttribute=d;this._filterSelector=e;this._selector=k}s(Y,K);p("wr.ui.html.DynamicElementsViewer",Y);
Y.prototype.setup=function(a,b){Y._super.setup.call(this,a,b);var c=this.getView()._id;this._selector="id"===this._idAttribute?"#"+hc(c):"["+hc(this._idAttribute)+"='"+ic(c)+"']";(c=this.findElements())||f(Error("No elements found for selectors "+this._selector+", "+this._filterSelector));this.validateElements(c);var c=jQuery(this.getContext()),d=c.data("__wr_ui_html_created");d?c.data("__wr_ui_html_created",d++):(this.bindListeners(c[0]),c.data("__wr_ui_html_created",1))};Y.prototype.setup=Y.prototype.setup;
Y.prototype.validateElements=ba();Y.prototype.validateElements=Y.prototype.validateElements;Y.prototype.destroy=function(){if(this._selector){var a=jQuery(this.getContext()),b=a.data("__wr_ui_html_created");1===b?(this.unbindListeners(a[0]),a.removeData("__wr_ui_html_created")):a.data("__wr_ui_html_created",b--);this._selector=k;Y._super.destroy.call(this)}};Y.prototype.destroy=Y.prototype.destroy;
var Yg={focusin:"focus",focusout:"blur",click:"click",keypress:"keypress",keydown:"keydown",keyup:"keyup"},Zg=function(){var a=[];B(Yg,function(b,c){a.push(c+".wr")});return a.join(" ")}();Y.prototype.bindListeners=function(a){var b=this,c=this.newListenerProxy(a,function(a){var c=Yg[a.type];c&&jQuery(a.target).is(b._selector)&&b.raiseEventForHtmlEvent(c,k,a)});jQuery(a).on(Zg,this._filterSelector,c)};Y.prototype.bindListeners=Y.prototype.bindListeners;
Y.prototype.unbindListeners=function(a){jQuery.each(this.getListenerProxies(a),function(b,c){jQuery(a).off(Zg,this._filterSelector,c)});this.destroyListenerProxies(a)};Y.prototype.unbindListeners=Y.prototype.unbindListeners;var $g=new Cd;Y.prototype.newListenerProxy=function(a,b){function c(a){return b.call(this,a)}var d=$g.get(a);d||$g.put(a,d=new sa);d.put(b,c);return c};Y.prototype.newListenerProxy=Y.prototype.newListenerProxy;
Y.prototype.getListenerProxies=function(a){return(a=$g.get(a))?a.getValues():[]};Y.prototype.getListenerProxies=Y.prototype.getListenerProxies;Y.prototype.destroyListenerProxies=function(a){$g.remove(a)};Y.prototype.destroyListenerProxies=Y.prototype.destroyListenerProxies;Y.prototype.writeAttributes=function(a){var b=jQuery(this.findElements()),c=a&&a.visible;c!==i&&(c?b.show():b.hide());b.is(":input")&&(c=a&&a.enabled,c!==i&&b.prop("disabled",!c));Y._super.writeAttributes.call(this,a)};
Y.prototype.writeAttributes=Y.prototype.writeAttributes;Y.prototype.readAttributes=function(){var a=Y._super.readAttributes.call(this),b=jQuery(this.findElements());a.visible=b.is(":visible");b.is(":input")&&(a.enabled=!b.prop("disabled"));return a};Y.prototype.readAttributes=Y.prototype.readAttributes;
Y.prototype.findElements=function(){this._selector||f(new t("Cannot access elements before setup"));var a=jQuery(this._selector,this.getContext());this._filterSelector&&(a=a.filter(this._filterSelector));return 0<a.length?a:k};Y.prototype.findElements=Y.prototype.findElements;function ah(a,b){Y.call(this,a,b,l,"id","a")}s(ah,Y);p("wr.ui.html.DynamicAnchorViewer",ah);function bh(a,b){Y.call(this,a,b,l,"name",":button, :submit")}s(bh,Y);p("wr.ui.html.DynamicButtonViewer",bh);function Z(a,b,c,d){Y.call(this,a,b,l,"name",c);this._supportsOptions=d;this._valueType=k}s(Z,Y);p("wr.ui.html.DynamicFieldViewer",Z);Z.prototype.setup=function(a,b){a.valueType||f(Error("Value type not specified"));this._valueType=a.valueType;Z._super.setup.call(this,a,b)};Z.prototype.setup=Z.prototype.setup;Z.prototype.getValueType=function(){this._valueType||f(new t("Cannot access value type before setup"));return this._valueType};Z.prototype.getValueType=Z.prototype.getValueType;
Z.prototype.writeData=function(a){var b=this;Z._super.writeData.call(this,a);if(a){var c=this.findElements();if(c&&this._valueType){var d=a.value;if(d!==i){var e;jQuery.isArray(d)?(e=[],jQuery.each(d,function(a,c){e.push(b.formatValue(c,b._valueType))})):e=this.formatValue(d,this._valueType);this.writeRawValue(c,e)}a=a.valueOptions;if(a!==i&&this._supportsOptions){var g=[];jQuery.each(a,function(a,c){g.push(b.formatValue(c,b._valueType))});md(this.readOptionRawValues(c),g,function(a){b.removeOptionRawValue(c,
a)},function(a){b.addOptionRawValue(c,a)})}}}};Z.prototype.writeData=Z.prototype.writeData;
Z.prototype.readData=function(){var a=this,b=Z._super.readData.call(this)||{},c=this.findElements();if(c&&this._valueType){var d,e=this.readRawValue(c);jQuery.isArray(e)?(d=[],jQuery.each(e,function(b,c){d.push(a.parseValue(c,a._valueType))})):d=this.parseValue(e,this._valueType);var g;this._supportsOptions?(c=this.readOptionRawValues(c),g=[],jQuery.each(c,function(b,c){g.push(a.parseValue(c,a._valueType))})):g="boolean"===this._valueType?[l,j]:i;b.value=d;b.valueOptions=g}return b};
Z.prototype.readData=Z.prototype.readData;Z.prototype.readRawValue=fa;Z.prototype.readRawValue=Z.prototype.readRawValue;Z.prototype.writeRawValue=fa;Z.prototype.writeRawValue=Z.prototype.writeRawValue;Z.prototype.readOptionRawValues=fa;Z.prototype.readOptionRawValues=Z.prototype.readOptionRawValues;Z.prototype.addOptionRawValue=fa;Z.prototype.addOptionRawValue=Z.prototype.addOptionRawValue;Z.prototype.removeOptionRawValue=fa;Z.prototype.removeOptionRawValue=Z.prototype.removeOptionRawValue;
Z.prototype.parseValue=function(a,b){if(a===k)return k;var c=ch[b];if(c=c&&c.parse)return c(a);f(new ga("Value of type '"+b+"' not supported"))};Z.prototype.parseValue=Z.prototype.parseValue;Z.prototype.formatValue=function(a,b){if(a===k)return k;var c=ch[b];if(c=c&&c.format)return c(a);f(new ga("Value of type '"+b+"' not supported"))};Z.prototype.formatValue=Z.prototype.formatValue;var dh={format:aa(),parse:aa()},ch={};ch["boolean"]={format:Kg,parse:Lg};ch.date={format:Rg,parse:Sg};
ch.decimal={format:Ng,parse:Pg};ch["float"]={format:Ng,parse:Pg};ch.integer={format:Mg,parse:Og};ch.password=dh;ch.string=dh;ch.text=dh;ch.time={format:Ug,parse:Vg};ch.timestamp={format:Wg,parse:Xg};ch.url=dh;function eh(a,b){Z.call(this,a,b,":checkbox",j)}s(eh,Z);p("wr.ui.html.DynamicCheckboxViewer",eh);eh.prototype.validateElements=function(a){fh._super.validateElements.call(this,a);var b=this.getValueType();("blob"===b||1===a.length&&"boolean"!==b)&&f(Error("Type "+b+" not supported"))};eh.prototype.validateElements=eh.prototype.validateElements;
eh.prototype.readRawValue=function(a){a=jQuery(a);if(1===a.length)return Kg(!!a.prop("checked"));var b=[];a.filter(":checked").each(function(a,d){b.push(jQuery(d).val())});return 0<b.length?b:k};eh.prototype.readRawValue=eh.prototype.readRawValue;
eh.prototype.writeRawValue=function(a,b){var c=jQuery(a);if(1===c.length){jQuery.isArray(b)&&f(new TypeError("Value cannot be an array"));var d=Lg(b)===j;c.prop("checked",d)}else{var e={};b!=k&&(jQuery.isArray(b)||f(new TypeError("Value must be an array")),jQuery.each(b,function(a,b){e[b]=(e[b]||0)+1}));c.each(function(a,b){var c=jQuery(b),d=c.val(),R=l,I=e[d];0<I&&(R=j,e[d]=I-1);c.prop("checked",R)})}};eh.prototype.writeRawValue=eh.prototype.writeRawValue;
eh.prototype.readOptionRawValues=function(a){if(1===a.length)return[Kg(l),Kg(j)];var b=[];jQuery(a).each(function(a,d){b.push(jQuery(d).val())});return b};eh.prototype.readOptionRawValues=eh.prototype.readOptionRawValues;eh.prototype.addOptionRawValue=function(a,b){1===a.length&&f(new ga);var c=jQuery(a),d=c.eq(0).clone().removeAttr("id");d.val(b);c.parent().append(d)};eh.prototype.addOptionRawValue=eh.prototype.addOptionRawValue;
eh.prototype.removeOptionRawValue=function(a,b){1===a.length&&f(new ga);jQuery(jQuery(a).get().reverse()).each(function(a,d){var e=jQuery(d);if(e.val()===b)return Kb(e[0]),l})};eh.prototype.removeOptionRawValue=eh.prototype.removeOptionRawValue;function gh(a,b){Z.call(this,a,b,":file",l)}s(gh,Z);p("wr.ui.html.DynamicFileViewer",gh);gh.prototype.validateElements=function(a){gh._super.validateElements.call(this,a);a=this.getValueType();"blob"!==a&&f(Error("Type "+a+" not supported"))};gh.prototype.validateElements=gh.prototype.validateElements;gh.prototype.readData=ba();gh.prototype.readData=gh.prototype.readData;gh.prototype.writeData=ba();gh.prototype.writeData=gh.prototype.writeData;function hh(a,b){Z.call(this,a,b,":radio",j)}s(hh,Z);p("wr.ui.html.DynamicRadioViewer",hh);hh.prototype.validateElements=function(a){hh._super.validateElements.call(this,a);var b=this.getValueType();"blob"===b&&f(Error("Type "+b+" not supported"));1>=a.length&&f(Error("At least two radio inputs are required"))};hh.prototype.validateElements=hh.prototype.validateElements;hh.prototype.readRawValue=function(a){a=jQuery(a).filter(":checked");return 0<a.length?a.val():k};hh.prototype.readRawValue=hh.prototype.readRawValue;
hh.prototype.writeRawValue=function(a,b){jQuery.isArray(b)&&f(new TypeError("Value cannot be an array"));var c=l;jQuery(a).each(function(a,e){var g=jQuery(e),h=l;!c&&g.val()===b&&(h=c=j);g.prop("checked",h)})};hh.prototype.writeRawValue=hh.prototype.writeRawValue;hh.prototype.readOptionRawValues=function(a){var b=[];jQuery(a).each(function(a,d){b.push(jQuery(d).val())});return b};hh.prototype.readOptionRawValues=hh.prototype.readOptionRawValues;
hh.prototype.addOptionRawValue=function(a,b){var c=jQuery(a),d=c.eq(0).clone().removeAttr("id");d.val(b);c.parent().append(d)};hh.prototype.addOptionRawValue=hh.prototype.addOptionRawValue;hh.prototype.removeOptionRawValue=function(a,b){jQuery(jQuery(a).get().reverse()).each(function(a,d){var e=jQuery(d);if(e.val()===b)return Kb(e[0]),l})};hh.prototype.removeOptionRawValue=hh.prototype.removeOptionRawValue;function ih(a,b){Z.call(this,a,b,"select",j)}s(ih,Z);p("wr.ui.html.DynamicSelectViewer",ih);ih.prototype.validateElements=function(a){ih._super.validateElements.call(this,a);a=this.getValueType();"blob"===a&&f(Error("Type "+a+" not supported"))};ih.prototype.validateElements=ih.prototype.validateElements;ih.prototype.readRawValue=function(a){return jQuery(a).val()};ih.prototype.readRawValue=ih.prototype.readRawValue;
ih.prototype.writeRawValue=function(a,b){var c=jQuery(a),d=c.attr("multiple")!==i,e={};b!=k&&(d?(jQuery.isArray(b)||f(new TypeError("Value must be an array")),jQuery.each(b,function(a,b){e[b]=(e[b]||0)+1})):(jQuery.isArray(b)&&f(new TypeError("Value cannot be an array")),e[b]=1));c.find("option").each(function(a,b){var c=jQuery(b),d=c.val(),R=l,I=e[d];0<I&&(R=j,e[d]=I-1);c.prop("selected",R)})};ih.prototype.writeRawValue=ih.prototype.writeRawValue;
ih.prototype.readOptionRawValues=function(a){var b=[];jQuery(a).find("option").each(function(a,d){b.push(jQuery(d).val())});return b};ih.prototype.readOptionRawValues=ih.prototype.readOptionRawValues;ih.prototype.addOptionRawValue=function(a,b){var c=jQuery(a).find("option"),d=c.eq(0).clone().removeAttr("id");d.val(b);c.parent().append(d)};ih.prototype.addOptionRawValue=ih.prototype.addOptionRawValue;
ih.prototype.removeOptionRawValue=function(a,b){jQuery(jQuery(a).find("option").get().reverse()).each(function(a,d){var e=jQuery(d);if(e.val()===b)return Kb(e[0]),l})};ih.prototype.removeOptionRawValue=ih.prototype.removeOptionRawValue;function fh(a,b){Z.call(this,a,b,":text, :password, textarea",l)}s(fh,Z);p("wr.ui.html.DynamicTextViewer",fh);fh.prototype.validateElements=function(a){fh._super.validateElements.call(this,a);a=this.getValueType();"blob"===a&&f(Error("Type "+a+" not supported"))};fh.prototype.validateElements=fh.prototype.validateElements;fh.prototype.writeAttributes=function(a){var b=jQuery(this.findElements()),c=a&&a.editable;c!==i&&b.prop("readOnly",!c);fh._super.writeAttributes.call(this,a)};
fh.prototype.writeAttributes=fh.prototype.writeAttributes;fh.prototype.readAttributes=function(){var a=fh._super.readAttributes.call(this),b=jQuery(this.findElements());a.editable=!b.prop("readOnly");return a};fh.prototype.readAttributes=fh.prototype.readAttributes;fh.prototype.readRawValue=function(a){a=jQuery(a).val();return""===a?k:a};fh.prototype.readRawValue=fh.prototype.readRawValue;
fh.prototype.writeRawValue=function(a,b){jQuery.isArray(b)&&f(new TypeError("Value cannot be an array"));jQuery(a).val(b||"")};fh.prototype.writeRawValue=fh.prototype.writeRawValue;})();})(this,jQuery);