/*
 RequireJS text 0.24.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/jrburke/requirejs for details
 RequireJS i18n 0.24.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/jrburke/requirejs for details
*/
(function(){function e(a,c,f){(function(){if(typeof this.loadFirebugConsole=="function")this.loadFirebugConsole();else{this.console=this.console||{};for(var g=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","profile","profileEnd","time","timeEnd","trace","warn","log"],i=0,j;j=g[i++];)console[j]||function(){var r=j+"";console[r]="log"in console?function(){var t=Array.apply({},arguments);t.unshift(r+":");console.log(t.join(" "))}:function(){};console[r]._fake=true}()}if(typeof a==
"undefined")a={_scopeName:"dojo",_scopePrefix:"",_scopePrefixArgs:"",_scopeSuffix:"",_scopeMap:{},_scopeMapRev:{}};var l=a;if(typeof c=="undefined")c={_scopeName:"dijit"};if(typeof f=="undefined")f={_scopeName:"dojox"};if(!l._scopeArgs)l._scopeArgs=[a,c,f];l.global=this;l.config={isDebug:false,debugAtAllCosts:false};if(g=typeof djConfig!="undefined"?djConfig:typeof dojoConfig!="undefined"?dojoConfig:null)for(var h in g)l.config[h]=g[h];a.locale=l.config.locale;h="$Rev: 24595 $".match(/\d+/);a.version=
{major:1,minor:6,patch:1,flag:"",revision:h?+h[0]:NaN,toString:function(){with(l.version)return major+"."+minor+"."+patch+flag+" ("+revision+")"}};typeof OpenAjax!="undefined"&&OpenAjax.hub.registerLibrary(a._scopeName,"http://dojotoolkit.org",l.version.toString());var k,q,u={};for(i in{toString:1}){k=[];break}a._extraNames=k=k||["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];q=k.length;a._mixin=function(r,t){var v,A,x;for(v in t){A=t[v];
if(!(v in r)||r[v]!==A&&(!(v in u)||u[v]!==A))r[v]=A}if(q&&t)for(x=0;x<q;++x){v=k[x];A=t[v];if(!(v in r)||r[v]!==A&&(!(v in u)||u[v]!==A))r[v]=A}return r};a.mixin=function(r){r||(r={});for(var t=1,v=arguments.length;t<v;t++)l._mixin(r,arguments[t]);return r};a._getProp=function(r,t,v){v=v||l.global;for(var A=0,x;v&&(x=r[A]);A++){if(A==0&&l._scopeMap[x])x=l._scopeMap[x];v=x in v?v[x]:t?(v[x]={}):undefined}return v};a.setObject=function(r,t,v){var A=r.split(".");r=A.pop();return(v=l._getProp(A,true,
v))&&r?(v[r]=t):undefined};a.getObject=function(r,t,v){return l._getProp(r.split("."),t,v)};a.exists=function(r,t){return l.getObject(r,false,t)!==undefined};a.eval=function(r){return l.global.eval?l.global.eval(r):eval(r)};l.deprecated=l.experimental=function(){}})();return{dojo:a,dijit:c,dojox:f}}if(this.define)define("dojo/_base/_loader/bootstrap",[],function(){var a=e();a.dojo._dijit=a.dijit;a.dojo._dojox=a.dojox;return a.dojo});else{var d=e();dojo=d.dojo;dijit=d.dijit;dojox=d.dojox}})();
define("dojo/lib/backCompat",["require","dojo/_base/_loader/bootstrap"],function(e,d){var a=["_moduleHasPrefix","_loadPath","_loadUri","_loadUriAndCheck","loaded","_callLoaded","_getModuleSymbols","_loadModule","require","provide","platformRequire","requireIf","requireAfterIf","registerModulePath"],c,f;for(c=0;c<a.length;){f=a[c++];d[f]=function(r){return function(){console.warn("dojo."+r+" not available when using an AMD loader.")}}(f)}var g=function(r){var t=[],v;for(v=0;v<r.length;)t.push(r[v++]);
return t},i=function(r,t){return t?typeof t=="string"?function(){r[t]()}:function(){t.call(r)}:r};d.ready=d.addOnLoad=function(r,t){e.ready(t?i(r,t):r)};d.addOnLoad(function(){d.postLoad=d.config.afterOnLoad=true});if(a=d.config.addOnLoad)d.addOnLoad[a instanceof Array?"apply":"call"](d,a);var j=d._loaders=[],l=function(){var r=j.slice(0);for(Array.prototype.splice.apply(j,[0,j.length]);r.length;)r.shift().call()};j.unshift=function(){Array.prototype.unshift.apply(j,g(arguments));e.ready(l)};j.splice=
function(){Array.prototype.splice.apply(j,g(arguments));e.ready(l)};var h=d._unloaders=[];d.unloaded=function(){for(;h.length;)h.pop().call()};d._onto=function(r,t,v){r.push(v?i(t,v):t)};d._modulesLoaded=function(){};d.loadInit=function(r){r()};var k=function(r){return r.replace(/\./g,"/")};d.getL10nName=function(r,t,v){v=v?v.toLowerCase():d.locale;r="i18n!"+k(r);return/root/i.test(v)?r+"/nls/"+t:r+"/nls/"+v+"/"+t};d.requireLocalization=function(r,t,v){if(e.vendor!="altoviso.com")v=!v||v.toLowerCase()===
d.locale?"root":v;return e(d.getL10nName(r,t,v))};d.i18n={getLocalization:d.requireLocalization,normalizeLocale:function(r){r=r?r.toLowerCase():d.locale;if(r=="root")r="ROOT";return r}};var q=/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/,u=/^((([^\[:]+):)?([^@]+)@)?(\[([^\]]+)\]|([^\[:]*))(:([0-9]+))?$/;d._Url=function(){for(var r=arguments,t=[r[0]],v=1;v<r.length;v++)if(r[v]){var A=new d._Url(r[v]+"");t=new d._Url(t[0]+"");if(A.path==""&&!A.scheme&&!A.authority&&!A.query){if(A.fragment!=
null)t.fragment=A.fragment;A=t}else if(!A.scheme){A.scheme=t.scheme;if(!A.authority){A.authority=t.authority;if(A.path.charAt(0)!="/"){t=(t.path.substring(0,t.path.lastIndexOf("/")+1)+A.path).split("/");for(var x=0;x<t.length;x++)if(t[x]==".")if(x==t.length-1)t[x]="";else{t.splice(x,1);x--}else if(x>0&&!(x==1&&t[0]=="")&&t[x]==".."&&t[x-1]!="..")if(x==t.length-1){t.splice(x,1);t[x-1]=""}else{t.splice(x-1,2);x-=2}A.path=t.join("/")}}}t=[];A.scheme&&t.push(A.scheme,":");A.authority&&t.push("//",A.authority);
t.push(A.path);A.query&&t.push("?",A.query);A.fragment&&t.push("#",A.fragment)}this.uri=t.join("");v=this.uri.match(q);this.scheme=v[2]||(v[1]?"":null);this.authority=v[4]||(v[3]?"":null);this.path=v[5];this.query=v[7]||(v[6]?"":null);this.fragment=v[9]||(v[8]?"":null);if(this.authority!=null){v=this.authority.match(u);this.user=v[3]||null;this.password=v[4]||null;this.host=v[6]||v[7];this.port=v[9]||null}};d._Url.prototype.toString=function(){return this.uri};d.moduleUrl=function(r,t){if(!r)return null;
r=k(r)+(t?"/"+t:"");t="";var v=r.match(/(.+)(\.[^\/]*)$/);if(v){r=v[1];t=v[2]}return new d._Url(e.nameToUrl(r,t))};return d});
define("dojo/_base/_loader/hostenv_browser",["dojo/lib/backCompat"],function(e){if(typeof window!="undefined"){e.isBrowser=true;e._name="browser";(function(){var a=e;if(document&&document.getElementsByTagName)for(var c=document.getElementsByTagName("script"),f=/dojo(\.xd)?\.js(\W|$)/i,g=0;g<c.length;g++){var i=c[g].getAttribute("src");if(i){var j=i.match(f);if(j){if(!a.config.baseUrl)a.config.baseUrl=i.substring(0,j.index);if(c=c[g].getAttribute("djConfig")||c[g].getAttribute("data-dojo-config")){c=
eval("({ "+c+" })");for(var l in c)e.config[l]=c[l]}break}}}a.baseUrl=a.config.baseUrl;l=navigator;c=l.userAgent;f=l.appVersion;g=parseFloat(f);if(c.indexOf("Opera")>=0)a.isOpera=g;if(c.indexOf("AdobeAIR")>=0)a.isAIR=1;a.isKhtml=f.indexOf("Konqueror")>=0?g:0;a.isWebKit=parseFloat(c.split("WebKit/")[1])||undefined;a.isChrome=parseFloat(c.split("Chrome/")[1])||undefined;a.isMac=f.indexOf("Macintosh")>=0;if((i=Math.max(f.indexOf("WebKit"),f.indexOf("Safari"),0))&&!e.isChrome){a.isSafari=parseFloat(f.split("Version/")[1]);
if(!a.isSafari||parseFloat(f.substr(i+7))<=419.3)a.isSafari=2}if(c.indexOf("Gecko")>=0&&!a.isKhtml&&!a.isWebKit)a.isMozilla=a.isMoz=g;if(a.isMoz)a.isFF=parseFloat(c.split("Firefox/")[1]||c.split("Minefield/")[1])||undefined;if(document.all&&!a.isOpera){a.isIE=parseFloat(f.split("MSIE ")[1])||undefined;if((c=document.documentMode)&&c!=5&&Math.floor(a.isIE)!=c)a.isIE=c}if(e.isIE&&window.location.protocol==="file:")e.config.ieForceActiveXXhr=true;a.isQuirks=document.compatMode=="BackCompat";a.locale=
e.config.locale||(a.isIE?l.userLanguage:l.language).toLowerCase();a._XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];a._xhrObj=function(){var v,A;if(!e.isIE||!e.config.ieForceActiveXXhr)try{v=new XMLHttpRequest}catch(x){}if(!v)for(var m=0;m<3;++m){var o=a._XMLHTTP_PROGIDS[m];try{v=new ActiveXObject(o)}catch(p){A=p}if(v){a._XMLHTTP_PROGIDS=[o];break}}if(!v)throw new Error("XMLHTTP not available: "+A);return v};a._isDocumentOk=function(v){v=v.status||0;var A=location.protocol;
return v>=200&&v<300||v==304||v==1223||!v&&(A=="file:"||A=="chrome:"||A=="chrome-extension:"||A=="app:")};var h=window.location+"";var k=(l=document.getElementsByTagName("base"))&&l.length>0;a._getText=function(v,A){var x=a._xhrObj();if(!k&&e._Url)v=(new e._Url(h,v)).toString();if(a.config.cacheBust){v+="";v+=(v.indexOf("?")==-1?"?":"&")+String(a.config.cacheBust).replace(/\W+/g,"")}x.open("GET",v,false);try{x.send(null);if(!a._isDocumentOk(x)){var m=Error("Unable to load "+v+" status:"+x.status);
m.status=x.status;m.responseText=x.responseText;throw m;}}catch(o){if(A)return null;throw o;}return x.responseText};var q=window,u=function(v,A){var x=q.attachEvent||q.addEventListener;v=q.attachEvent?v:v.substring(2);x(v,function(){A.apply(q,arguments)},false)};a._windowUnloaders=[];a.windowUnloaded=function(){for(var v=a._windowUnloaders;v.length;)v.pop()();a=null};var r=0;a.addOnWindowUnload=function(v,A){a._onto(a._windowUnloaders,v,A);if(!r){r=1;u("onunload",a.windowUnloaded)}};var t=0;a.addOnUnload=
function(v,A){a._onto(a._unloaders,v,A);if(!t){t=1;u("onbeforeunload",e.unloaded)}}})();e._initFired=false;e._loadInit=function(){if(e._scrollIntervalId){clearInterval(e._scrollIntervalId);e._scrollIntervalId=0}if(!e._initFired){e._initFired=true;!e.config.afterOnLoad&&window.detachEvent&&window.detachEvent("onload",e._loadInit);e._inFlightCount==0&&e._modulesLoaded()}};if(!e.config.afterOnLoad)if(document.addEventListener){document.addEventListener("DOMContentLoaded",e._loadInit,false);window.addEventListener("load",
e._loadInit,false)}else if(window.attachEvent){window.attachEvent("onload",e._loadInit);if(!e.config.skipIeDomLoaded&&self===self.top)e._scrollIntervalId=setInterval(function(){try{if(document.body){document.documentElement.doScroll("left");e._loadInit()}}catch(a){}},30)}if(e.isIE)try{(function(){document.namespaces.add("v","urn:schemas-microsoft-com:vml");var a=["*","group","roundrect","oval","shape","rect","imagedata","path","textpath","text"],c=0,f=1,g=document.createStyleSheet();if(e.isIE>=8){c=
1;f=a.length}for(;c<f;++c)g.addRule("v\\:"+a[c],"behavior:url(#default#VML); display:inline-block")})()}catch(d){}}(function(){var a=e.config.modulePaths;if(a)for(var c in a)e.registerModulePath(c,a[c])})();e.config.isDebug&&e.require("dojo._firebug.firebug");if(e.config.debugAtAllCosts){e.require("dojo._base._loader.loader_debug");e.require("dojo.i18n")}return e});define("dojo/lib/kernel",["dojo/_base/_loader/hostenv_browser"],function(e){return dojo=e});
define("dojo/_base/lang",["dojo/lib/kernel"],function(e){(function(){var d=Object.prototype.toString;e.isString=function(l){return typeof l=="string"||l instanceof String};e.isArray=function(l){return l&&(l instanceof Array||typeof l=="array")};e.isFunction=function(l){return d.call(l)==="[object Function]"};e.isObject=function(l){return l!==undefined&&(l===null||typeof l=="object"||e.isArray(l)||e.isFunction(l))};e.isArrayLike=function(l){return l&&l!==undefined&&!e.isString(l)&&!e.isFunction(l)&&
!(l.tagName&&l.tagName.toLowerCase()=="form")&&(e.isArray(l)||isFinite(l.length))};e.isAlien=function(l){return l&&!e.isFunction(l)&&/\{\s*\[native code\]\s*\}/.test(String(l))};e.extend=function(l){for(var h=1,k=arguments.length;h<k;h++)e._mixin(l.prototype,arguments[h]);return l};e._hitchArgs=function(l,h){var k=e._toArray(arguments,2),q=e.isString(h);return function(){var u=e._toArray(arguments),r=q?(l||e.global)[h]:h;return r&&r.apply(l||this,k.concat(u))}};e.hitch=function(l,h){if(arguments.length>
2)return e._hitchArgs.apply(e,arguments);if(!h){h=l;l=null}if(e.isString(h)){l=l||e.global;if(!l[h])throw['dojo.hitch: scope["',h,'"] is null (scope="',l,'")'].join("");return function(){return l[h].apply(l,arguments||[])}}return!l?h:function(){return h.apply(l,arguments||[])}};e.delegate=e._delegate=function(){function l(){}return function(h,k){l.prototype=h;h=new l;l.prototype=null;k&&e._mixin(h,k);return h}}();var a=function(l,h,k){return(k||[]).concat(Array.prototype.slice.call(l,h||0))},c=function(l,
h,k){k=k||[];for(h=h||0;h<l.length;h++)k.push(l[h]);return k};e._toArray=e.isIE?function(l){return(l.item?c:a).apply(this,arguments)}:a;e.partial=function(){return e.hitch.apply(e,[null].concat(e._toArray(arguments)))};var f=e._extraNames,g=f.length,i={};e.clone=function(l){if(!l||typeof l!="object"||e.isFunction(l))return l;if(l.nodeType&&"cloneNode"in l)return l.cloneNode(true);if(l instanceof Date)return new Date(l.getTime());if(l instanceof RegExp)return new RegExp(l);var h,k,q,u;if(e.isArray(l)){h=
[];k=0;for(q=l.length;k<q;++k)k in l&&h.push(e.clone(l[k]))}else h=l.constructor?new l.constructor:{};for(u in l){q=l[u];if(!(u in h)||h[u]!==q&&(!(u in i)||i[u]!==q))h[u]=e.clone(q)}if(g)for(k=0;k<g;++k){u=f[k];q=l[u];if(!(u in h)||h[u]!==q&&(!(u in i)||i[u]!==q))h[u]=q}return h};e.trim=String.prototype.trim?function(l){return l.trim()}:function(l){return l.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};var j=/\{([^\}]+)\}/g;e.replace=function(l,h,k){return l.replace(k||j,e.isFunction(h)?h:function(q,
u){return e.getObject(u,false,h)})}})();return e});
define("dojo/_base/array",["dojo/lib/kernel","dojo/_base/lang"],function(e){(function(){var d=function(c,f,g){return[typeof c=="string"?c.split(""):c,f||e.global,typeof g=="string"?new Function("item","index","array",g):g]},a=function(c,f,g,i){var j=d(f,i,g);f=j[0];g=0;for(i=f.length;g<i;++g){var l=!!j[2].call(j[1],f[g],g,f);if(c^l)return l}return c};e.mixin(e,{indexOf:function(c,f,g,i){var j=1,l=c.length||0,h=0;if(i){h=l-1;j=l=-1}if(g!=undefined)h=g;if(i&&h>l||h<l)for(;h!=l;h+=j)if(c[h]==f)return h;
return-1},lastIndexOf:function(c,f,g){return e.indexOf(c,f,g,true)},forEach:function(c,f,g){if(c&&c.length){var i=d(c,g,f);c=i[0];f=0;for(g=c.length;f<g;++f)i[2].call(i[1],c[f],f,c)}},every:function(c,f,g){return a(true,c,f,g)},some:function(c,f,g){return a(false,c,f,g)},map:function(c,f,g,i){var j=d(c,g,f);c=j[0];f=i?new i:[];g=0;for(i=c.length;g<i;++g)f.push(j[2].call(j[1],c[g],g,c));return f},filter:function(c,f,g){var i=d(c,g,f);c=i[0];f=[];g=0;for(var j=c.length;g<j;++g)i[2].call(i[1],c[g],g,
c)&&f.push(c[g]);return f}})})();return e});
define("dojo/_base/declare",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array"],function(e){(function(){function d(s,y){throw new Error("declare"+(y?" "+y:"")+": "+s);}function a(s,y){for(var w=[],z=[{cls:0,refs:[]}],B={},D=1,E=s.length,F=0,I,L,M,R,Q;F<E;++F){if(I=s[F])m.call(I)!="[object Function]"&&d("mixin #"+F+" is not a callable constructor.",y);else d("mixin #"+F+" is unknown. Did you use dojo.require to pull it in?",y);L=I._meta?I._meta.bases:[I];M=0;for(I=L.length-1;I>=0;--I){R=L[I].prototype;
if(!R.hasOwnProperty("declaredClass"))R.declaredClass="uniqName_"+p++;R=R.declaredClass;if(!B.hasOwnProperty(R)){B[R]={count:0,refs:[],cls:L[I]};++D}R=B[R];if(M&&M!==R){R.refs.push(M);++M.count}M=R}++M.count;z[0].refs.push(M)}for(;z.length;){M=z.pop();w.push(M.cls);for(--D;Q=M.refs,Q.length==1;){M=Q[0];if(!M||--M.count){M=0;break}w.push(M.cls);--D}if(M){F=0;for(E=Q.length;F<E;++F){M=Q[F];--M.count||z.push(M)}}}D&&d("can't build consistent linearization",y);I=s[0];w[0]=I?I._meta&&I===w[w.length-I._meta.bases.length]?
I._meta.bases.length:1:0;return w}function c(s,y,w){var z,B,D,E,F,I,L,M=this._inherited=this._inherited||{};if(typeof s=="string"){z=s;s=y;y=w}w=0;E=s.callee;(z=z||E.nom)||d("can't deduce a name to call inherited()",this.declaredClass);F=this.constructor._meta;D=F.bases;L=M.p;if(z!=n){if(M.c!==E){L=0;I=D[0];F=I._meta;if(F.hidden[z]!==E){(B=F.chains)&&typeof B[z]=="string"&&d("calling chained method with inherited: "+z,this.declaredClass);do{F=I._meta;B=I.prototype;if(F&&(B[z]===E&&B.hasOwnProperty(z)||
F.hidden[z]===E))break}while(I=D[++L]);L=I?L:-1}}if(I=D[++L]){B=I.prototype;if(I._meta&&B.hasOwnProperty(z))w=B[z];else{E=x[z];do{B=I.prototype;if((w=B[z])&&(I._meta?B.hasOwnProperty(z):w!==E))break}while(I=D[++L])}}w=I&&w||x[z]}else{if(M.c!==E){L=0;if((F=D[0]._meta)&&F.ctor!==E){B=F.chains;if(!B||B.constructor!=="manual")d("calling chained constructor with inherited",this.declaredClass);for(;I=D[++L];)if((F=I._meta)&&F.ctor===E)break;L=I?L:-1}}for(;I=D[++L];)if(w=(F=I._meta)?F.ctor:I)break;w=I&&
w}M.c=w;M.p=L;if(w)return y===true?w:w.apply(this,y||s)}function f(s,y){if(typeof s=="string")return this.inherited(s,y,true);return this.inherited(s,true)}function g(s){for(var y=this.constructor._meta.bases,w=0,z=y.length;w<z;++w)if(y[w]===s)return true;return this instanceof s}function i(s,y){var w,z=0,B=v._extraNames.length;for(w in y)if(w!=n&&y.hasOwnProperty(w))s[w]=y[w];for(;z<B;++z){w=v._extraNames[z];if(w!=n&&y.hasOwnProperty(w))s[w]=y[w]}}function j(s,y){var w,z,B=0,D=v._extraNames.length;
for(w in y){z=y[w];if((z!==x[w]||!(w in x))&&w!=n){if(m.call(z)=="[object Function]")z.nom=w;s[w]=z}}for(;B<D;++B){w=v._extraNames[B];z=y[w];if((z!==x[w]||!(w in x))&&w!=n){if(m.call(z)=="[object Function]")z.nom=w;s[w]=z}}return s}function l(s){j(this.prototype,s);return this}function h(s,y){return function(){var w=arguments,z=w,B=w[0],D,E;E=s.length;var F;if(!(this instanceof w.callee))return t(w);if(y&&(B&&B.preamble||this.preamble)){F=new Array(s.length);F[0]=w;for(D=0;;){if(B=w[0])if(B=B.preamble)w=
B.apply(this,w)||w;B=s[D].prototype;if(B=B.hasOwnProperty("preamble")&&B.preamble)w=B.apply(this,w)||w;if(++D==E)break;F[D]=w}}for(D=E-1;D>=0;--D){B=s[D];if(B=(E=B._meta)?E.ctor:B)B.apply(this,F?F[D]:w)}(B=this.postscript)&&B.apply(this,z)}}function k(s,y){return function(){var w=arguments,z=w,B=w[0];if(!(this instanceof w.callee))return t(w);if(y){if(B)if(B=B.preamble)z=B.apply(this,z)||z;(B=this.preamble)&&B.apply(this,z)}s&&s.apply(this,w);(B=this.postscript)&&B.apply(this,w)}}function q(s){return function(){var y=
arguments,w=0,z,B;if(!(this instanceof y.callee))return t(y);for(;z=s[w];++w)if(z=(B=z._meta)?B.ctor:z){z.apply(this,y);break}(z=this.postscript)&&z.apply(this,y)}}function u(s,y,w){return function(){var z,B,D=0,E=1;if(w){D=y.length-1;E=-1}for(;z=y[D];D+=E){B=z._meta;(z=(B?B.hidden:z.prototype)[s])&&z.apply(this,arguments)}}}function r(s){o.prototype=s.prototype;s=new o;o.prototype=null;return s}function t(s){var y=s.callee,w=r(y);y.apply(w,s);return w}var v=e,A=v._mixin,x=Object.prototype,m=x.toString,
o=new Function,p=0,n="constructor";v.declare=function(s,y,w){if(typeof s!="string"){w=y;y=s;s=""}w=w||{};var z,B,D,E,F,I,L,M=1,R=y;if(m.call(y)=="[object Array]"){I=a(y,s);D=I[0];M=I.length-D;y=I[M]}else{I=[0];if(y)if(m.call(y)=="[object Function]"){D=y._meta;I=I.concat(D?D.bases:y)}else d("base class is not a callable constructor.",s);else y!==null&&d("unknown base class. Did you use dojo.require to pull it in?",s)}if(y)for(B=M-1;;--B){z=r(y);if(!B)break;D=I[B];(D._meta?i:A)(z,D.prototype);E=new Function;
E.superclass=y;E.prototype=z;y=z.constructor=E}else z={};j(z,w);D=w.constructor;if(D!==x.constructor){D.nom=n;z.constructor=D}for(B=M-1;B;--B)if((D=I[B]._meta)&&D.chains)L=A(L||{},D.chains);if(z["-chains-"])L=A(L||{},z["-chains-"]);D=!L||!L.hasOwnProperty(n);I[0]=E=L&&L.constructor==="manual"?q(I):I.length==1?k(w.constructor,D):h(I,D);E._meta={bases:I,hidden:w,chains:L,parents:R,ctor:w.constructor};E.superclass=y&&y.prototype;E.extend=l;E.prototype=z;z.constructor=E;z.getInherited=f;z.inherited=c;
z.isInstanceOf=g;if(s){z.declaredClass=s;v.setObject(s,E)}if(L)for(F in L)if(z[F]&&typeof L[F]=="string"&&F!=n){D=z[F]=u(F,I,L[F]==="after");D.nom=F}return E};v.safeMixin=j})();return e.declare});
define("dojo/_base/connect",["dojo/lib/kernel","dojo/_base/lang"],function(e){e._listener={getDispatcher:function(){return function(){var d=Array.prototype,a=arguments.callee,c=a._listeners;a=(a=a.target)&&a.apply(this,arguments);var f;c=[].concat(c);for(f in c)f in d||c[f].apply(this,arguments);return a}},add:function(d,a,c){d=d||e.global;var f=d[a];if(!f||!f._listeners){var g=e._listener.getDispatcher();g.target=f;g._listeners=[];f=d[a]=g}return f._listeners.push(c)},remove:function(d,a,c){(d=(d||
e.global)[a])&&d._listeners&&c--&&delete d._listeners[c]}};e.connect=function(){var d=arguments,a=[],c=0;a.push(e.isString(d[0])?null:d[c++],d[c++]);var f=d[c+1];a.push(e.isString(f)||e.isFunction(f)?d[c++]:null,d[c++]);for(f=d.length;c<f;c++)a.push(d[c]);return e._connect.apply(this,a)};e._connect=function(d,a,c,f){var g=e._listener;c=g.add(d,a,e.hitch(c,f));return[d,a,c,g]};e.disconnect=function(d){if(d&&d[0]!==undefined){e._disconnect.apply(this,d);delete d[0]}};e._disconnect=function(d,a,c,f){f.remove(d,
a,c)};e._topics={};e.subscribe=function(d,a,c){return[d,e._listener.add(e._topics,d,e.hitch(a,c))]};e.unsubscribe=function(d){d&&e._listener.remove(e._topics,d[0],d[1])};e.publish=function(d,a){if(d=e._topics[d])d.apply(this,a||[])};e.connectPublisher=function(d,a,c){var f=function(){e.publish(d,arguments)};return c?e.connect(a,c,f):e.connect(a,f)};return e.connect});
define("dojo/_base/Deferred",["dojo/lib/kernel","dojo/_base/lang"],function(e){(function(){var d=function(){},a=Object.freeze||function(){};e.Deferred=function(c){function f(r){if(j)throw new Error("This deferred has already been resolved");i=r;j=true;g()}function g(){for(var r;!r&&k;){var t=k;k=k.next;if(r=t.progress==d)j=false;var v=l?t.error:t.resolved;if(v)try{var A=v(i);if(A&&typeof A.then==="function")A.then(e.hitch(t.deferred,"resolve"),e.hitch(t.deferred,"reject"),e.hitch(t.deferred,"progress"));
else{v=r&&A===undefined;if(r&&!v)l=A instanceof Error;t.deferred[v&&l?"reject":"resolve"](v?i:A)}}catch(x){t.deferred.reject(x)}else l?t.deferred.reject(i):t.deferred.resolve(i)}}var i,j,l,h,k,q=this.promise={};this.resolve=this.callback=function(r){this.fired=0;this.results=[r,null];f(r)};this.reject=this.errback=function(r){l=true;this.fired=1;f(r);this.results=[null,r];if(!r||r.log!==false)(e.config.deferredOnError||function(t){console.error(t)})(r)};this.progress=function(r){for(var t=k;t;){var v=
t.progress;v&&v(r);t=t.next}};this.addCallbacks=function(r,t){this.then(r,t,d);return this};this.then=q.then=function(r,t,v){var A=v==d?this:new e.Deferred(q.cancel);r={resolved:r,error:t,progress:v,deferred:A};if(k)h=h.next=r;else k=h=r;j&&g();return A.promise};var u=this;this.cancel=q.cancel=function(){if(!j){var r=c&&c(u);if(!j){r instanceof Error||(r=new Error(r));r.log=false;u.reject(r)}}};a(q)};e.extend(e.Deferred,{addCallback:function(){return this.addCallbacks(e.hitch.apply(e,arguments))},
addErrback:function(){return this.addCallbacks(null,e.hitch.apply(e,arguments))},addBoth:function(){var c=e.hitch.apply(e,arguments);return this.addCallbacks(c,c)},fired:-1})})();e.when=function(d,a,c,f){if(d&&typeof d.then==="function")return d.then(a,c,f);return a(d)};return e.Deferred});
define("dojo/_base/json",["dojo/lib/kernel"],function(e){e.fromJson=function(d){return eval("("+d+")")};e._escapeString=function(d){return('"'+d.replace(/(["\\])/g,"\\$1")+'"').replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")};e.toJsonIndentStr="\t";e.toJson=function(d,a,c){if(d===undefined)return"undefined";var f=typeof d;if(f=="number"||f=="boolean")return d+"";if(d===null)return"null";if(e.isString(d))return e._escapeString(d);var g=
arguments.callee,i;c=c||"";var j=a?c+e.toJsonIndentStr:"";i=d.__json__||d.json;if(e.isFunction(i)){i=i.call(d);if(d!==i)return g(i,a,j)}if(d.nodeType&&d.cloneNode)throw new Error("Can't serialize DOM nodes");i=a?" ":"";var l=a?"\n":"";if(e.isArray(d))return"["+e.map(d,function(u){u=g(u,a,j);if(typeof u!="string")u="undefined";return l+j+u}).join(","+i)+l+c+"]";if(f=="function")return null;f=[];var h;for(h in d){var k,q;if(typeof h=="number")k='"'+h+'"';else if(typeof h=="string")k=e._escapeString(h);
else continue;q=g(d[h],a,j);typeof q=="string"&&f.push(l+j+k+":"+i+q)}return"{"+f.join(","+i)+l+c+"}"};return e});
define("dojo/_base/Color",["dojo/lib/kernel","dojo/_base/array","dojo/_base/lang"],function(e){(function(){e.Color=function(d){d&&this.setColor(d)};e.Color.named={black:[0,0,0],silver:[192,192,192],gray:[128,128,128],white:[255,255,255],maroon:[128,0,0],red:[255,0,0],purple:[128,0,128],fuchsia:[255,0,255],green:[0,128,0],lime:[0,255,0],olive:[128,128,0],yellow:[255,255,0],navy:[0,0,128],blue:[0,0,255],teal:[0,128,128],aqua:[0,255,255],transparent:e.config.transparentColor||[255,255,255]};e.extend(e.Color,
{r:255,g:255,b:255,a:1,_set:function(d,a,c,f){this.r=d;this.g=a;this.b=c;this.a=f},setColor:function(d){if(e.isString(d))e.colorFromString(d,this);else if(e.isArray(d))e.colorFromArray(d,this);else{this._set(d.r,d.g,d.b,d.a);d instanceof e.Color||this.sanitize()}return this},sanitize:function(){return this},toRgb:function(){return[this.r,this.g,this.b]},toRgba:function(){return[this.r,this.g,this.b,this.a]},toHex:function(){return"#"+e.map(["r","g","b"],function(d){d=this[d].toString(16);return d.length<
2?"0"+d:d},this).join("")},toCss:function(d){var a=this.r+", "+this.g+", "+this.b;return(d?"rgba("+a+", "+this.a:"rgb("+a)+")"},toString:function(){return this.toCss(true)}});e.blendColors=function(d,a,c,f){var g=f||new e.Color;e.forEach(["r","g","b","a"],function(i){g[i]=d[i]+(a[i]-d[i])*c;if(i!="a")g[i]=Math.round(g[i])});return g.sanitize()};e.colorFromRgb=function(d,a){return(d=d.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/))&&e.colorFromArray(d[1].split(/\s*,\s*/),a)};e.colorFromHex=function(d,
a){var c=a||new e.Color,f=d.length==4?4:8,g=(1<<f)-1;d=Number("0x"+d.substr(1));if(isNaN(d))return null;e.forEach(["b","g","r"],function(i){var j=d&g;d>>=f;c[i]=f==4?17*j:j});c.a=1;return c};e.colorFromArray=function(d,a){a=a||new e.Color;a._set(Number(d[0]),Number(d[1]),Number(d[2]),Number(d[3]));if(isNaN(a.a))a.a=1;return a.sanitize()};e.colorFromString=function(d,a){var c=e.Color.named[d];return c&&e.colorFromArray(c,a)||e.colorFromRgb(d,a)||e.colorFromHex(d,a)}})();return e.Color});
define("dojo/_base/window",["dojo/lib/kernel"],function(e){e.doc=window.document||null;e.body=function(){return e.doc.body||e.doc.getElementsByTagName("body")[0]};e.setContext=function(d,a){e.global=d;e.doc=a};e.withGlobal=function(d,a,c,f){var g=e.global;try{e.global=d;return e.withDoc.call(null,d.document,a,c,f)}finally{e.global=g}};e.withDoc=function(d,a,c,f){var g=e.doc,i=e._bodyLtr,j=e.isQuirks;try{e.doc=d;delete e._bodyLtr;e.isQuirks=e.doc.compatMode=="BackCompat";if(c&&typeof a=="string")a=
c[a];return a.apply(c,f||[])}finally{e.doc=g;delete e._bodyLtr;if(i!==undefined)e._bodyLtr=i;e.isQuirks=j}};return e});
define("dojo/_base/event",["dojo/lib/kernel","dojo/_base/connect"],function(e){(function(){var d=e._event_listener={add:function(l,h,k){if(l){h=d._normalizeEventName(h);k=d._fixCallback(h,k);if(!e.isIE&&(h=="mouseenter"||h=="mouseleave")){var q=k;h=h=="mouseenter"?"mouseover":"mouseout";k=function(u){if(!e.isDescendant(u.relatedTarget,l))return q.call(this,u)}}l.addEventListener(h,k,false);return k}},remove:function(l,h,k){if(l){h=d._normalizeEventName(h);if(!e.isIE&&(h=="mouseenter"||h=="mouseleave"))h=
h=="mouseenter"?"mouseover":"mouseout";l.removeEventListener(h,k,false)}},_normalizeEventName:function(l){return l.slice(0,2)=="on"?l.slice(2):l},_fixCallback:function(l,h){return l!="keypress"?h:function(k){return h.call(this,d._fixEvent(k,this))}},_fixEvent:function(l){switch(l.type){case "keypress":d._setKeyChar(l);break}return l},_setKeyChar:function(l){l.keyChar=l.charCode>=32?String.fromCharCode(l.charCode):"";l.charOrCode=l.keyChar||l.keyCode},_punctMap:{106:42,111:47,186:59,187:43,188:44,
189:45,190:46,191:47,192:96,219:91,220:92,221:93,222:39}};e.fixEvent=function(l,h){return d._fixEvent(l,h)};e.stopEvent=function(l){l.preventDefault();l.stopPropagation()};var a=e._listener;e._connect=function(l,h,k,q,u){u=l&&(l.nodeType||l.attachEvent||l.addEventListener)?u?2:1:0;k=[e._listener,d,a][u].add(l,h,e.hitch(k,q));return[l,h,k,u]};e._disconnect=function(l,h,k,q){[e._listener,d,a][q].remove(l,h,k)};e.keys={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,META:e.isSafari?91:224,
PAUSE:19,CAPS_LOCK:20,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,INSERT:45,DELETE:46,HELP:47,LEFT_WINDOW:91,RIGHT_WINDOW:92,SELECT:93,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,NUMPAD_MULTIPLY:106,NUMPAD_PLUS:107,NUMPAD_ENTER:108,NUMPAD_MINUS:109,NUMPAD_PERIOD:110,NUMPAD_DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,
F11:122,F12:123,F13:124,F14:125,F15:126,NUM_LOCK:144,SCROLL_LOCK:145,copyKey:e.isMac&&!e.isAIR?e.isSafari?91:224:17};var c=e.isMac?"metaKey":"ctrlKey";e.isCopyKey=function(l){return l[c]};e.mouseButtons=e.isIE<9||e.isIE&&e.isQuirks?{LEFT:1,MIDDLE:4,RIGHT:2,isButton:function(l,h){return l.button&h},isLeft:function(l){return l.button&1},isMiddle:function(l){return l.button&4},isRight:function(l){return l.button&2}}:{LEFT:0,MIDDLE:1,RIGHT:2,isButton:function(l,h){return l.button==h},isLeft:function(l){return l.button==
0},isMiddle:function(l){return l.button==1},isRight:function(l){return l.button==2}};if(e.isIE){var f=function(l,h){try{return l.keyCode=h}catch(k){return 0}},g=e._listener,i=e._ieListenersName="_"+e._scopeName+"_listeners";if(!e.config._allow_leaks){a=g=e._ie_listener={handlers:[],add:function(l,h,k){l=l||e.global;var q=l[h];if(!q||!q[i]){var u=e._getIeDispatcher();u.target=q&&j.push(q)-1;u[i]=[];q=l[h]=u}return q[i].push(j.push(k)-1)},remove:function(l,h,k){h=(l=(l||e.global)[h])&&l[i];if(l&&h&&
k--){delete j[h[k]];delete h[k]}}};var j=g.handlers}e.mixin(d,{add:function(l,h,k){if(l){h=d._normalizeEventName(h);if(h=="onkeypress"){var q=l.onkeydown;if(!q||!q[i]||!q._stealthKeydownHandle){var u=d.add(l,"onkeydown",d._stealthKeyDown);q=l.onkeydown;q._stealthKeydownHandle=u;q._stealthKeydownRefs=1}else q._stealthKeydownRefs++}return g.add(l,h,d._fixCallback(k))}},remove:function(l,h,k){h=d._normalizeEventName(h);g.remove(l,h,k);if(h=="onkeypress"){h=l.onkeydown;if(--h._stealthKeydownRefs<=0){g.remove(l,
"onkeydown",h._stealthKeydownHandle);delete h._stealthKeydownHandle}}},_normalizeEventName:function(l){return l.slice(0,2)!="on"?"on"+l:l},_nop:function(){},_fixEvent:function(l,h){if(!l)l=(h&&(h.ownerDocument||h.document||h).parentWindow||window).event;if(!l)return l;l.target=l.srcElement;l.currentTarget=h||l.srcElement;l.layerX=l.offsetX;l.layerY=l.offsetY;h=(h=l.srcElement)&&h.ownerDocument||document;h=e.isIE<6||h.compatMode=="BackCompat"?h.body:h.documentElement;var k=e._getIeDocumentElementOffset();
l.pageX=l.clientX+e._fixIeBiDiScrollLeft(h.scrollLeft||0)-k.x;l.pageY=l.clientY+(h.scrollTop||0)-k.y;if(l.type=="mouseover")l.relatedTarget=l.fromElement;if(l.type=="mouseout")l.relatedTarget=l.toElement;if(e.isIE<9||e.isQuirks){l.stopPropagation=d._stopPropagation;l.preventDefault=d._preventDefault}return d._fixKeys(l)},_fixKeys:function(l){switch(l.type){case "keypress":var h="charCode"in l?l.charCode:l.keyCode;if(h==10){h=0;l.keyCode=13}else if(h==13||h==27)h=0;else if(h==3)h=99;l.charCode=h;d._setKeyChar(l);
break}return l},_stealthKeyDown:function(l){var h=l.currentTarget.onkeypress;if(h&&h[i]){var k=l.keyCode,q=(k!=13||e.isIE>=9&&!e.isQuirks)&&k!=32&&k!=27&&(k<48||k>90)&&(k<96||k>111)&&(k<186||k>192)&&(k<219||k>222);if(q||l.ctrlKey){q=q?0:k;if(l.ctrlKey)if(k==3||k==13)return;else if(q>95&&q<106)q-=48;else if(!l.shiftKey&&q>=65&&q<=90)q+=32;else q=d._punctMap[q]||q;k=d._synthesizeEvent(l,{type:"keypress",faux:true,charCode:q});h.call(l.currentTarget,k);if(e.isIE<9||e.isIE&&e.isQuirks)l.cancelBubble=
k.cancelBubble;l.returnValue=k.returnValue;f(l,k.keyCode)}}},_stopPropagation:function(){this.cancelBubble=true},_preventDefault:function(){this.bubbledKeyCode=this.keyCode;this.ctrlKey&&f(this,0);this.returnValue=false}});e.stopEvent=e.isIE<9||e.isQuirks?function(l){l=l||window.event;d._stopPropagation.call(l);d._preventDefault.call(l)}:e.stopEvent}d._synthesizeEvent=function(l,h){h=e.mixin({},l,h);d._setKeyChar(h);h.preventDefault=function(){l.preventDefault()};h.stopPropagation=function(){l.stopPropagation()};
return h};e.isOpera&&e.mixin(d,{_fixEvent:function(l){switch(l.type){case "keypress":var h=l.which;if(h==3)h=99;h=h<41&&!l.shiftKey?0:h;if(l.ctrlKey&&!l.shiftKey&&h>=65&&h<=90)h+=32;return d._synthesizeEvent(l,{charCode:h})}return l}});if(e.isWebKit){d._add=d.add;d._remove=d.remove;e.mixin(d,{add:function(l,h,k){if(l){var q=d._add(l,h,k);if(d._normalizeEventName(h)=="keypress")q._stealthKeyDownHandle=d._add(l,"keydown",function(u){var r=u.keyCode,t=r!=13&&r!=32&&(r<48||r>90)&&(r<96||r>111)&&(r<186||
r>192)&&(r<219||r>222);if(t||u.ctrlKey){t=t?0:r;if(u.ctrlKey)if(r==3||r==13)return;else if(t>95&&t<106)t-=48;else if(!u.shiftKey&&t>=65&&t<=90)t+=32;else t=d._punctMap[t]||t;r=d._synthesizeEvent(u,{type:"keypress",faux:true,charCode:t});k.call(u.currentTarget,r)}});return q}},remove:function(l,h,k){if(l){k._stealthKeyDownHandle&&d._remove(l,"keydown",k._stealthKeyDownHandle);d._remove(l,h,k)}},_fixEvent:function(l){switch(l.type){case "keypress":if(l.faux)return l;var h=l.charCode;h=h>=32?h:0;return d._synthesizeEvent(l,
{charCode:h,faux:true})}return l}})}})();if(e.isIE){e._ieDispatcher=function(d,a){var c=Array.prototype,f=e._ie_listener.handlers,g=d.callee,i=g[e._ieListenersName];g=(g=f[g.target])&&g.apply(a,d);i=[].concat(i);for(var j in i){var l=f[i[j]];!(j in c)&&l&&l.apply(a,d)}return g};e._getIeDispatcher=function(){return new Function(e._scopeName+"._ieDispatcher(arguments, this)")};e._event_listener._fixCallback=function(d){var a=e._event_listener._fixEvent;return function(c){return d.call(this,a(c,this))}}}return e.connect});
define("dojo/_base/html",["dojo/lib/kernel","dojo/_base/lang"],function(e){try{document.execCommand("BackgroundImageCache",false,true)}catch(d){}e.byId=e.isIE?function(a,c){if(typeof a!="string")return a;var f=c||e.doc;if((c=f.getElementById(a))&&(c.attributes.id.value==a||c.id==a))return c;else{var g=f.all[a];if(!g||g.nodeName)g=[g];for(var i=0;c=g[i++];)if(c.attributes&&c.attributes.id&&c.attributes.id.value==a||c.id==a)return c}}:function(a,c){return(typeof a=="string"?(c||e.doc).getElementById(a):
a)||null};(function(){var a=e.byId,c=null,f;e.addOnWindowUnload(function(){c=null});e._destroyElement=e.destroy=function(C){C=a(C);try{var G=C.ownerDocument;if(!c||f!=G){c=G.createElement("div");f=G}c.appendChild(C.parentNode?C.parentNode.removeChild(C):C);c.innerHTML=""}catch(J){}};e.isDescendant=function(C,G){try{C=a(C);for(G=a(G);C;){if(C==G)return true;C=C.parentNode}}catch(J){}return false};e.setSelectable=function(C,G){C=a(C);if(e.isMozilla)C.style.MozUserSelect=G?"":"none";else if(e.isKhtml||
e.isWebKit)C.style.KhtmlUserSelect=G?"auto":"none";else if(e.isIE){G=C.unselectable=G?"":"on";e.query("*",C).forEach("item.unselectable = '"+G+"'")}};var g=function(C,G){var J=G.parentNode;J&&J.insertBefore(C,G)},i=function(C,G){var J=G.parentNode;if(J)J.lastChild==G?J.appendChild(C):J.insertBefore(C,G.nextSibling)};e.place=function(C,G,J){G=a(G);if(typeof C=="string")C=/^\s*</.test(C)?e._toDom(C,G.ownerDocument):a(C);if(typeof J=="number"){var P=G.childNodes;!P.length||P.length<=J?G.appendChild(C):
g(C,P[J<0?0:J])}else switch(J){case "before":g(C,G);break;case "after":i(C,G);break;case "replace":G.parentNode.replaceChild(C,G);break;case "only":e.empty(G);G.appendChild(C);break;case "first":if(G.firstChild){g(C,G.firstChild);break}default:G.appendChild(C)}return C};e.boxModel="content-box";if(e.isIE)e.boxModel=document.compatMode=="BackCompat"?"border-box":"content-box";var j;j=e.isWebKit?function(C){var G;if(C.nodeType==1){var J=C.ownerDocument.defaultView;G=J.getComputedStyle(C,null);if(!G&&
C.style){C.style.display="";G=J.getComputedStyle(C,null)}}return G||{}}:e.isIE?function(C){return C.nodeType==1?C.currentStyle:{}}:function(C){return C.nodeType==1?C.ownerDocument.defaultView.getComputedStyle(C,null):{}};e.getComputedStyle=j;e._toPixelValue=e.isIE?function(C,G){if(!G)return 0;if(G=="medium")return 4;if(G.slice&&G.slice(-2)=="px")return parseFloat(G);with(C){C=style.left;var J=runtimeStyle.left;runtimeStyle.left=currentStyle.left;try{style.left=G;G=style.pixelLeft}catch(P){G=0}style.left=
C;runtimeStyle.left=J}return G}:function(C,G){return parseFloat(G)||0};var l=e._toPixelValue,h=function(C,G){try{return C.filters.item("DXImageTransform.Microsoft.Alpha")}catch(J){return G?{}:null}};e._getOpacity=e.isIE<9?function(C){try{return h(C).Opacity/100}catch(G){return 1}}:function(C){return j(C).opacity};e._setOpacity=e.isIE<9?function(C,G){var J=G*100,P=G==1;C.style.zoom=P?"":1;if(h(C))h(C,1).Opacity=J;else{if(P)return G;C.style.filter+=" progid:DXImageTransform.Microsoft.Alpha(Opacity="+
J+")"}h(C,1).Enabled=!P;C.nodeName.toLowerCase()=="tr"&&e.query("> td",C).forEach(function(T){e._setOpacity(T,G)});return G}:function(C,G){return C.style.opacity=G};var k={left:true,top:true},q=/margin|padding|width|height|max|min|offset/,u=function(C,G,J){G=G.toLowerCase();if(e.isIE){if(J=="auto"){if(G=="height")return C.offsetHeight;if(G=="width")return C.offsetWidth}if(G=="fontweight")switch(J){case 700:return"bold";case 400:default:return"normal"}}G in k||(k[G]=q.test(G));return k[G]?l(C,J):J},
r=e.isIE?"styleFloat":"cssFloat",t={cssFloat:r,styleFloat:r,"float":r};e.style=function(C,G,J){var P=a(C),T=arguments.length,U=G=="opacity";G=t[G]||G;if(T==3)return U?e._setOpacity(P,J):(P.style[G]=J);if(T==2&&U)return e._getOpacity(P);U=j(P);if(T==2&&typeof G!="string"){for(var Y in G)e.style(C,Y,G[Y]);return U}return T==1?U:u(P,G,U[G]||P.style[G])};e._getPadExtents=function(C,G){G=G||j(C);var J=l(C,G.paddingLeft),P=l(C,G.paddingTop);return{l:J,t:P,w:J+l(C,G.paddingRight),h:P+l(C,G.paddingBottom)}};
e._getBorderExtents=function(C,G){G=G||j(C);var J=G.borderLeftStyle!="none"?l(C,G.borderLeftWidth):0,P=G.borderTopStyle!="none"?l(C,G.borderTopWidth):0;return{l:J,t:P,w:J+(G.borderRightStyle!="none"?l(C,G.borderRightWidth):0),h:P+(G.borderBottomStyle!="none"?l(C,G.borderBottomWidth):0)}};e._getPadBorderExtents=function(C,G){var J=G||j(C);G=e._getPadExtents(C,J);C=e._getBorderExtents(C,J);return{l:G.l+C.l,t:G.t+C.t,w:G.w+C.w,h:G.h+C.h}};e._getMarginExtents=function(C,G){G=G||j(C);var J=l(C,G.marginLeft),
P=l(C,G.marginTop),T=l(C,G.marginRight);C=l(C,G.marginBottom);if(e.isWebKit&&G.position!="absolute")T=J;return{l:J,t:P,w:J+T,h:P+C}};e._getMarginBox=function(C,G){var J=G||j(C);G=e._getMarginExtents(C,J);var P=C.offsetLeft-G.l,T=C.offsetTop-G.t,U=C.parentNode;if(e.isMoz){var Y=parseFloat(J.left);J=parseFloat(J.top);if(!isNaN(Y)&&!isNaN(J)){P=Y;T=J}else if(U&&U.style){Y=j(U);if(Y.overflow!="visible"){U=e._getBorderExtents(U,Y);P+=U.l;T+=U.t}}}else if(e.isOpera||e.isIE>7&&!e.isQuirks)if(U){U=e._getBorderExtents(U);
P-=U.l;T-=U.t}return{l:P,t:T,w:C.offsetWidth+G.w,h:C.offsetHeight+G.h}};e._getMarginSize=function(C,G){C=a(C);G=e._getMarginExtents(C,G||j(C));C=C.getBoundingClientRect();return{w:C.right-C.left+G.w,h:C.bottom-C.top+G.h}};e._getContentBox=function(C,G){var J=G||j(C);G=e._getPadExtents(C,J);J=e._getBorderExtents(C,J);var P=C.clientWidth;if(P){C=C.clientHeight;J.w=J.h=0}else{P=C.offsetWidth;C=C.offsetHeight}if(e.isOpera){G.l+=J.l;G.t+=J.t}return{l:G.l,t:G.t,w:P-G.w-J.w,h:C-G.h-J.h}};e._getBorderBox=
function(C,G){var J=G||j(C);G=e._getPadExtents(C,J);C=e._getContentBox(C,J);return{l:C.l-G.l,t:C.t-G.t,w:C.w+G.w,h:C.h+G.h}};e._setBox=function(C,G,J,P,T,U){U=U||"px";C=C.style;if(!isNaN(G))C.left=G+U;if(!isNaN(J))C.top=J+U;if(P>=0)C.width=P+U;if(T>=0)C.height=T+U};e._isButtonTag=function(C){return C.tagName=="BUTTON"||C.tagName=="INPUT"&&(C.getAttribute("type")||"").toUpperCase()=="BUTTON"};e._usesBorderBox=function(C){var G=C.tagName;return e.boxModel=="border-box"||G=="TABLE"||e._isButtonTag(C)};
e._setContentSize=function(C,G,J,P){if(e._usesBorderBox(C)){P=e._getPadBorderExtents(C,P);if(G>=0)G+=P.w;if(J>=0)J+=P.h}e._setBox(C,NaN,NaN,G,J)};e._setMarginBox=function(C,G,J,P,T,U){var Y=U||j(C);U=e._usesBorderBox(C)?v:e._getPadBorderExtents(C,Y);if(e.isWebKit)if(e._isButtonTag(C)){var ea=C.style;if(P>=0&&!ea.width)ea.width="4px";if(T>=0&&!ea.height)ea.height="4px"}Y=e._getMarginExtents(C,Y);if(P>=0)P=Math.max(P-U.w-Y.w,0);if(T>=0)T=Math.max(T-U.h-Y.h,0);e._setBox(C,G,J,P,T)};var v={l:0,t:0,w:0,
h:0};e.marginBox=function(C,G){C=a(C);var J=j(C);return!G?e._getMarginBox(C,J):e._setMarginBox(C,G.l,G.t,G.w,G.h,J)};e.contentBox=function(C,G){C=a(C);var J=j(C);return!G?e._getContentBox(C,J):e._setContentSize(C,G.w,G.h,J)};e._docScroll=function(){var C=e.global;return"pageXOffset"in C?{x:C.pageXOffset,y:C.pageYOffset}:(C=e.isQuirks?e.doc.body:e.doc.documentElement,{x:e._fixIeBiDiScrollLeft(C.scrollLeft||0),y:C.scrollTop||0})};e._isBodyLtr=function(){return"_bodyLtr"in e?e._bodyLtr:(e._bodyLtr=(e.body().dir||
e.doc.documentElement.dir||"ltr").toLowerCase()=="ltr")};e._getIeDocumentElementOffset=function(){var C=e.doc.documentElement;if(e.isIE<8){var G=C.getBoundingClientRect(),J=G.left;G=G.top;if(e.isIE<7){J+=C.clientLeft;G+=C.clientTop}return{x:J<0?0:J,y:G<0?0:G}}else return{x:0,y:0}};e._fixIeBiDiScrollLeft=function(C){var G=e.isIE;if(G&&!e._isBodyLtr()){var J=e.isQuirks,P=J?e.doc.body:e.doc.documentElement;if(G==6&&!J&&e.global.frameElement&&P.scrollHeight>P.clientHeight)C+=P.clientLeft;return G<8||
J?C+P.clientWidth-P.scrollWidth:-C}return C};e._abs=e.position=function(C,G){C=a(C);var J=e.body(),P=J.parentNode;C=C.getBoundingClientRect();C={x:C.left,y:C.top,w:C.right-C.left,h:C.bottom-C.top};if(e.isIE){P=e._getIeDocumentElementOffset();C.x-=P.x+(e.isQuirks?J.clientLeft+J.offsetLeft:0);C.y-=P.y+(e.isQuirks?J.clientTop+J.offsetTop:0)}else if(e.isFF==3){J=j(P);C.x-=l(P,J.marginLeft)+l(P,J.borderLeftWidth);C.y-=l(P,J.marginTop)+l(P,J.borderTopWidth)}if(G){G=e._docScroll();C.x+=G.x;C.y+=G.y}return C};
e.coords=function(C,G){C=a(C);var J=j(C);J=e._getMarginBox(C,J);G=e.position(C,G);J.x=G.x;J.y=G.y;return J};var A={"class":"className","for":"htmlFor",tabindex:"tabIndex",readonly:"readOnly",colspan:"colSpan",frameborder:"frameBorder",rowspan:"rowSpan",valuetype:"valueType"},x={classname:"class",htmlfor:"for",tabindex:"tabIndex",readonly:"readOnly"},m={innerHTML:1,className:1,htmlFor:e.isIE,value:1},o=function(C){return x[C.toLowerCase()]||C},p=function(C,G){return(C=C.getAttributeNode&&C.getAttributeNode(G))&&
C.specified};e.hasAttr=function(C,G){var J=G.toLowerCase();return m[A[J]||G]||p(a(C),x[J]||G)};var n={},s=0,y=e._scopeName+"attrid",w={col:1,colgroup:1,table:1,tbody:1,tfoot:1,thead:1,tr:1,title:1};e.attr=function(C,G,J){C=a(C);var P=arguments.length;if(P==2&&typeof G!="string"){for(var T in G)e.attr(C,T,G[T]);return C}var U=G.toLowerCase();T=A[U]||G;var Y=m[T];U=x[U]||G;if(P==3){if(T=="style"&&typeof J!="string")e.style(C,J);else if(T=="innerHTML")if(e.isIE&&C.tagName.toLowerCase()in w){e.empty(C);
C.appendChild(e._toDom(J,C.ownerDocument))}else C[T]=J;else if(e.isFunction(J)){P=e.attr(C,y);if(!P){P=s++;e.attr(C,y,P)}n[P]||(n[P]={});if(Y=n[P][T])e.disconnect(Y);else try{delete C[T]}catch(ea){}n[P][T]=e.connect(C,T,J)}else if(Y||typeof J=="boolean")C[T]=J;else C.setAttribute(U,J);return C}J=C[T];if(Y&&typeof J!="undefined")return J;if(T!="href"&&(typeof J=="boolean"||e.isFunction(J)))return J;return p(C,U)?C.getAttribute(U):null};e.removeAttr=function(C,G){a(C).removeAttribute(o(G))};e.getNodeProp=
function(C,G){C=a(C);var J=G.toLowerCase(),P=A[J]||G;if(P in C&&P!="href")return C[P];G=x[J]||G;return p(C,G)?C.getAttribute(G):null};e.create=function(C,G,J,P){var T=e.doc;if(J){J=a(J);T=J.ownerDocument}if(typeof C=="string")C=T.createElement(C);G&&e.attr(C,G);J&&e.place(C,J,P);return C};e.empty=e.isIE?function(C){C=a(C);for(var G;G=C.lastChild;)e.destroy(G)}:function(C){a(C).innerHTML=""};var z={option:["select"],tbody:["table"],thead:["table"],tfoot:["table"],tr:["table","tbody"],td:["table","tbody",
"tr"],th:["table","thead","tr"],legend:["fieldset"],caption:["table"],colgroup:["table"],col:["table","colgroup"],li:["ul"]},B=/<\s*([\w\:]+)/,D={},E=0,F="__"+e._scopeName+"ToDomId";for(var I in z)if(z.hasOwnProperty(I)){var L=z[I];L.pre=I=="option"?'<select multiple="multiple">':"<"+L.join("><")+">";L.post="</"+L.reverse().join("></")+">"}e._toDom=function(C,G){G=G||e.doc;var J=G[F];if(!J){G[F]=J=++E+"";D[J]=G.createElement("div")}C+="";var P=C.match(B),T=P?P[1].toLowerCase():"";J=D[J];if(P&&z[T]){P=
z[T];J.innerHTML=P.pre+C+P.post;for(C=P.length;C;--C)J=J.firstChild}else J.innerHTML=C;if(J.childNodes.length==1)return J.removeChild(J.firstChild);for(C=G.createDocumentFragment();G=J.firstChild;)C.appendChild(G);return C};var M="className";e.hasClass=function(C,G){return(" "+a(C)[M]+" ").indexOf(" "+G+" ")>=0};var R=/\s+/,Q=[""],S={},aa=function(C){if(typeof C=="string"||C instanceof String)if(C.indexOf(" ")<0){Q[0]=C;return Q}else return C.split(R);return C||""};e.addClass=function(C,G){C=a(C);
G=aa(G);var J=C[M],P;J=J?" "+J+" ":" ";P=J.length;for(var T=0,U=G.length,Y;T<U;++T)if((Y=G[T])&&J.indexOf(" "+Y+" ")<0)J+=Y+" ";if(P<J.length)C[M]=J.substr(1,J.length-2)};e.removeClass=function(C,G){C=a(C);var J;if(G!==undefined){G=aa(G);J=" "+C[M]+" ";for(var P=0,T=G.length;P<T;++P)J=J.replace(" "+G[P]+" "," ");J=e.trim(J)}else J="";if(C[M]!=J)C[M]=J};e.replaceClass=function(C,G,J){C=a(C);S.className=C.className;e.removeClass(S,J);e.addClass(S,G);if(C.className!==S.className)C.className=S.className};
e.toggleClass=function(C,G,J){if(J===undefined)J=!e.hasClass(C,G);e[J?"addClass":"removeClass"](C,G)}})();return e});
define("dojo/_base/NodeList",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array","dojo/_base/connect","dojo/_base/html"],function(e){(function(){var d=Array.prototype,a=d.slice,c=d.concat,f=function(r,t,v){r.sort||(r=a.call(r,0));v=v||this._NodeListCtor||e._NodeListCtor;r.constructor=v;e._mixin(r,v.prototype);r._NodeListCtor=v;return t?r._stash(t):r},g=function(r,t,v){t=[0].concat(a.call(t,0));v=v||e.global;return function(A){t[0]=A;return r.apply(v,t)}},i=function(r,t){return function(){this.forEach(g(r,
arguments,t));return this}},j=function(r,t){return function(){return this.map(g(r,arguments,t))}},l=function(r,t,v){return function(){var A=arguments,x=g(r,A,v);if(t.call(v||e.global,A))return this.map(x);this.forEach(x);return this}},h=function(r){return r.length==1&&typeof r[0]=="string"},k=function(r){var t=r.parentNode;t&&t.removeChild(r)};e.NodeList=function(){return f(Array.apply(null,arguments))};var q=e._NodeListCtor=e.NodeList,u=q.prototype;q._wrap=u._wrap=f;q._adaptAsMap=j;q._adaptAsForEach=
i;q._adaptAsFilter=function(r,t){return function(){return this.filter(g(r,arguments,t))}};q._adaptWithCondition=l;e.forEach(["slice","splice"],function(r){var t=d[r];u[r]=function(){return this._wrap(t.apply(this,arguments),r=="slice"?this:null)}});e.forEach(["indexOf","lastIndexOf","every","some"],function(r){var t=e[r];u[r]=function(){return t.apply(e,[this].concat(a.call(arguments,0)))}});e.forEach(["attr","style"],function(r){u[r]=l(e[r],h)});e.forEach(["connect","addClass","removeClass","replaceClass",
"toggleClass","empty","removeAttr"],function(r){u[r]=i(e[r])});e.extend(e.NodeList,{_normalize:function(r,t){var v=r.parse===true?true:false;if(typeof r.template=="string"){var A=r.templateFunc||e.string&&e.string.substitute;r=A?A(r.template,r):r}A=typeof r;if(A=="string"||A=="number"){r=e._toDom(r,t&&t.ownerDocument);r=r.nodeType==11?e._toArray(r.childNodes):[r]}else if(e.isArrayLike(r))e.isArray(r)||(r=e._toArray(r));else r=[r];if(v)r._runParse=true;return r},_cloneNode:function(r){return r.cloneNode(true)},
_place:function(r,t,v,A){if(!(t.nodeType!=1&&v=="only")){t=t;for(var x,m=r.length,o=m-1;o>=0;o--){var p=A?this._cloneNode(r[o]):r[o];if(r._runParse&&e.parser&&e.parser.parse){x||(x=t.ownerDocument.createElement("div"));x.appendChild(p);e.parser.parse(x);for(p=x.firstChild;x.firstChild;)x.removeChild(x.firstChild)}o==m-1?e.place(p,t,v):t.parentNode.insertBefore(p,t);t=p}}},_stash:function(r){this._parent=r;return this},end:function(){return this._parent?this._parent:new this._NodeListCtor},concat:function(){var r=
e.isArray(this)?this:a.call(this,0),t=e.map(arguments,function(v){return v&&!e.isArray(v)&&(typeof NodeList!="undefined"&&v.constructor===NodeList||v.constructor===this._NodeListCtor)?a.call(v,0):v});return this._wrap(c.apply(r,t),this)},map:function(r,t){return this._wrap(e.map(this,r,t),this)},forEach:function(r,t){e.forEach(this,r,t);return this},coords:j(e.coords),position:j(e.position),place:function(r,t){var v=e.query(r)[0];return this.forEach(function(A){e.place(A,v,t)})},orphan:function(r){return(r?
e._filterQueryResult(this,r):this).forEach(k)},adopt:function(r,t){return e.query(r).place(this[0],t)._stash(this)},query:function(r){if(!r)return this;var t=this.map(function(v){return e.query(r,v).filter(function(A){return A!==undefined})});return this._wrap(c.apply([],t),this)},filter:function(r){var t=arguments,v=this,A=0;if(typeof r=="string"){v=e._filterQueryResult(this,t[0]);if(t.length==1)return v._stash(this);A=1}return this._wrap(e.filter(v,t[A],t[A+1]),this)},addContent:function(r,t){r=
this._normalize(r,this[0]);for(var v=0,A;A=this[v];v++)this._place(r,A,t,v>0);return this},instantiate:function(r,t){var v=e.isFunction(r)?r:e.getObject(r);t=t||{};return this.forEach(function(A){new v(t,A)})},at:function(){var r=new this._NodeListCtor;e.forEach(arguments,function(t){if(t<0)t=this.length+t;this[t]&&r.push(this[t])},this);return r._stash(this)}});q.events=["blur","focus","change","click","error","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mousemove",
"mouseout","mouseover","mouseup","submit"];e.forEach(q.events,function(r){var t="on"+r;u[t]=function(v,A){return this.connect(t,v,A)}})})();return e.NodeList});
(function(){var e=function(a){var c=a.trim,f=a.forEach,g=a._NodeListCtor=a.NodeList,i=function(){return a.doc},j=(a.isWebKit||a.isMozilla)&&i().compatMode=="BackCompat",l=i().firstChild.children?"children":"childNodes",h=false,k=function(){return true},q=function(H){H+=">~+".indexOf(H.slice(-1))>=0?" * ":" ";for(var K=function(na,oa){return c(H.slice(na,oa))},N=[],O=-1,V=-1,X=-1,Z=-1,W=-1,$=-1,da=-1,ha="",fa="",ja,ca=0,pa=H.length,ba=null,ia=null,qa=function(){if(da>=0){var na=da==ca?null:K(da,ca);
ba[">~+".indexOf(na)<0?"tag":"oper"]=na;da=-1}},ra=function(){if($>=0){ba.id=K($,ca).replace(/\\/g,"");$=-1}},sa=function(){if(W>=0){ba.classes.push(K(W+1,ca).replace(/\\/g,""));W=-1}},ma=function(){ra();qa();sa()},ta=function(){ma();Z>=0&&ba.pseudos.push({name:K(Z+1,ca)});ba.loops=ba.pseudos.length||ba.attrs.length||ba.classes.length;ba.oquery=ba.query=K(ja,ca);ba.otag=ba.tag=ba.oper?null:ba.tag||"*";if(ba.tag)ba.tag=ba.tag.toUpperCase();if(N.length&&N[N.length-1].oper){ba.infixOper=N.pop();ba.query=
ba.infixOper.query+" "+ba.query}N.push(ba);ba=null};ha=fa,fa=H.charAt(ca),ca<pa;ca++)if(ha!="\\"){if(!ba){ja=ca;ba={query:null,pseudos:[],attrs:[],classes:[],tag:null,oper:null,id:null,getTag:function(){return h?this.otag:this.tag}};da=ca}if(O>=0)if(fa=="]"){if(ia.attr)ia.matchFor=K(X||O+1,ca);else ia.attr=K(O+1,ca);if(O=ia.matchFor)if(O.charAt(0)=='"'||O.charAt(0)=="'")ia.matchFor=O.slice(1,-1);ba.attrs.push(ia);ia=null;O=X=-1}else{if(fa=="="){X="|~^$*".indexOf(ha)>=0?ha:"";ia.type=X+fa;ia.attr=
K(O+1,ca-X.length);X=ca+1}}else if(V>=0){if(fa==")"){if(Z>=0)ia.value=K(V+1,ca);Z=V=-1}}else if(fa=="#"){ma();$=ca+1}else if(fa=="."){ma();W=ca}else if(fa==":"){ma();Z=ca}else if(fa=="["){ma();O=ca;ia={}}else if(fa=="("){if(Z>=0){ia={name:K(Z+1,ca),value:null};ba.pseudos.push(ia)}V=ca}else fa==" "&&ha!=fa&&ta()}return N},u=function(H,K){if(!H)return K;if(!K)return H;return function(){return H.apply(window,arguments)&&K.apply(window,arguments)}},r=function(H,K){K=K||[];H&&K.push(H);return K},t=function(H){return 1==
H.nodeType},v=function(H,K){if(!H)return"";if(K=="class")return H.className||"";if(K=="for")return H.htmlFor||"";if(K=="style")return H.style.cssText||"";return(h?H.getAttribute(K):H.getAttribute(K,2))||""},A={"*=":function(H,K){return function(N){return v(N,H).indexOf(K)>=0}},"^=":function(H,K){return function(N){return v(N,H).indexOf(K)==0}},"$=":function(H,K){return function(N){N=" "+v(N,H);return N.lastIndexOf(K)==N.length-K.length}},"~=":function(H,K){var N=" "+K+" ";return function(O){return(" "+
v(O,H)+" ").indexOf(N)>=0}},"|=":function(H,K){var N=" "+K+"-";return function(O){O=" "+v(O,H);return O==K||O.indexOf(N)==0}},"=":function(H,K){return function(N){return v(N,H)==K}}},x=typeof i().firstChild.nextElementSibling=="undefined",m=!x?"nextElementSibling":"nextSibling",o=!x?"previousElementSibling":"previousSibling",p=x?t:k,n=function(H){for(;H=H[o];)if(p(H))return false;return true},s=function(H){for(;H=H[m];)if(p(H))return false;return true},y=function(H){var K=H.parentNode,N=0,O=K[l],
V=H._i||-1,X=K._l||-1;if(!O)return-1;O=O.length;if(X==O&&V>=0&&X>=0)return V;K._l=O;V=-1;for(K=K.firstElementChild||K.firstChild;K;K=K[m])if(p(K)){K._i=++N;if(H===K)V=N}return V},w=function(H){return!(y(H)%2)},z=function(H){return y(H)%2},B={checked:function(){return function(H){return!!("checked"in H?H.checked:H.selected)}},"first-child":function(){return n},"last-child":function(){return s},"only-child":function(){return function(H){if(!n(H))return false;if(!s(H))return false;return true}},empty:function(){return function(H){var K=
H.childNodes;for(H=H.childNodes.length-1;H>=0;H--){var N=K[H].nodeType;if(N===1||N==3)return false}return true}},contains:function(H,K){H=K.charAt(0);if(H=='"'||H=="'")K=K.slice(1,-1);return function(N){return N.innerHTML.indexOf(K)>=0}},not:function(H,K){H=q(K)[0];K={el:1};if(H.tag!="*")K.tag=1;if(!H.classes.length)K.classes=1;var N=E(H,K);return function(O){return!N(O)}},"nth-child":function(H,K){H=parseInt;if(K=="odd")return z;else if(K=="even")return w;if(K.indexOf("n")!=-1){K=K.split("n",2);
var N=K[0]?K[0]=="-"?-1:H(K[0]):1,O=K[1]?H(K[1]):0,V=0,X=-1;if(N>0)if(O<0)O=O%N&&N+O%N;else{if(O>0){if(O>=N)V=O-O%N;O%=N}}else if(N<0){N*=-1;if(O>0){X=O;O%=N}}if(N>0)return function(W){W=y(W);return W>=V&&(X<0||W<=X)&&W%N==O};else K=O}var Z=H(K);return function(W){return y(W)==Z}}},D=a.isIE<9||dojo.isIE&&dojo.isQuirks?function(H){var K=H.toLowerCase();if(K=="class")H="className";return function(N){return h?N.getAttribute(H):N[H]||N[K]}}:function(H){return function(K){return K&&K.getAttribute&&K.hasAttribute(H)}},
E=function(H,K){if(!H)return k;K=K||{};var N=null;"el"in K||(N=u(N,t));if(!("tag"in K))if(H.tag!="*")N=u(N,function(O){return O&&O.tagName==H.getTag()});"classes"in K||f(H.classes,function(O,V){var X=new RegExp("(?:^|\\s)"+O+"(?:\\s|$)");N=u(N,function(Z){return X.test(Z.className)});N.count=V});"pseudos"in K||f(H.pseudos,function(O){var V=O.name;if(B[V])N=u(N,B[V](V,O.value))});"attrs"in K||f(H.attrs,function(O){var V,X=O.attr;if(O.type&&A[O.type])V=A[O.type](X,O.matchFor);else if(X.length)V=D(X);
if(V)N=u(N,V)});if(!("id"in K))if(H.id)N=u(N,function(O){return!!O&&O.id==H.id});N||"default"in K||(N=k);return N},F=function(H){return function(K,N,O){for(;K=K[m];)if(!(x&&!t(K))){if((!O||ka(K,O))&&H(K))N.push(K);break}return N}},I=function(H){return function(K,N,O){for(K=K[m];K;){if(p(K)){if(O&&!ka(K,O))break;H(K)&&N.push(K)}K=K[m]}return N}},L=function(H){H=H||k;return function(K,N,O){for(var V=0,X=K[l];K=X[V++];)if(p(K)&&(!O||ka(K,O))&&H(K,V))N.push(K);return N}},M=function(H,K){for(H=H.parentNode;H;){if(H==
K)break;H=H.parentNode}return!!H},R={},Q=function(H){var K=R[H.query];if(K)return K;var N=H.infixOper;N=N?N.oper:"";var O=E(H,{el:1}),V="*"==H.tag,X=i().getElementsByClassName;if(N){X={el:1};if(V)X.tag=1;O=E(H,X);if("+"==N)K=F(O);else if("~"==N)K=I(O);else if(">"==N)K=L(O)}else if(H.id){O=!H.loops&&V?k:E(H,{el:1,id:1});K=function(W,$){var da=a.byId(H.id,W.ownerDocument||W);if(da&&O(da))if(9==W.nodeType)return r(da,$);else if(M(da,W))return r(da,$)}}else if(X&&/\{\s*\[native code\]\s*\}/.test(String(X))&&
H.classes.length&&!j){O=E(H,{el:1,classes:1,id:1});var Z=H.classes.join(" ");K=function(W,$,da){$=r(0,$);for(var ha,fa=0,ja=W.getElementsByClassName(Z);ha=ja[fa++];)O(ha,W)&&ka(ha,da)&&$.push(ha);return $}}else if(!V&&!H.loops)K=function(W,$,da){$=r(0,$);for(var ha=0,fa=W.getElementsByTagName(H.getTag());W=fa[ha++];)ka(W,da)&&$.push(W);return $};else{O=E(H,{el:1,tag:1,id:1});K=function(W,$,da){$=r(0,$);for(var ha,fa=0,ja=W.getElementsByTagName(H.getTag());ha=ja[fa++];)O(ha,W)&&ka(ha,da)&&$.push(ha);
return $}}return R[H.query]=K},S=function(H,K){H=r(H);for(var N,O,V=K.length,X,Z,W=0;W<V;W++){Z=[];N=K[W];O=H.length-1;if(O>0){X={};Z.nozip=true}O=Q(N);for(var $=0;N=H[$];$++)O(N,Z,X);if(!Z.length)break;H=Z}return Z},aa={},C={},G=function(H){var K=q(c(H));if(K.length==1){var N=Q(K[0]);return function(O){if(O=N(O,new g))O.nozip=true;return O}}return function(O){return S(O,K)}},J=navigator.userAgent;J=a.isWebKit&&J.indexOf("WebKit/")>0&&parseFloat(J.split("WebKit/")[1])>528;var P=a.isIE?"commentStrip":
"nozip",T=!!i().querySelectorAll&&(!a.isSafari||a.isSafari>3.1||J),U=/n\+\d|([^ ])?([>~+])([^ =])?/g,Y=function(H,K,N,O){return N?(K?K+" ":"")+N+(O?" "+O:""):H},ea=function(H,K){H=H.replace(U,Y);if(T){var N=C[H];if(N&&!K)return N}if(N=aa[H])return N;N=H.charAt(0);var O=-1==H.indexOf(" ");if(H.indexOf("#")>=0&&O)K=true;if(T&&!K&&">~+".indexOf(N)==-1&&(!a.isIE||H.indexOf(":")==-1)&&!(j&&H.indexOf(".")>=0)&&H.indexOf(":contains")==-1&&H.indexOf(":checked")==-1&&H.indexOf("|=")==-1){var V=">~+".indexOf(H.charAt(H.length-
1))>=0?H+" *":H;return C[H]=function(Z){try{if(!(9==Z.nodeType||O))throw"";var W=Z.querySelectorAll(V);W[P]=true;return W}catch($){return ea(H,true)(Z)}}}else{var X=H.split(/\s*,\s*/);return aa[H]=X.length<2?G(H):function(Z){for(var W=0,$=[],da;da=X[W++];)$=$.concat(G(da)(Z));return $}}},ga=0,ua=a.isIE?function(H){return h?H.getAttribute("_uid")||H.setAttribute("_uid",++ga)||ga:H.uniqueID}:function(H){return H._uid||(H._uid=++ga)},ka=function(H,K){if(!K)return 1;H=ua(H);if(!K[H])return K[H]=1;return 0},
la="_zipIdx",va=function(H){if(H&&H.nozip)return g._wrap?g._wrap(H):H;var K=new g;if(!H||!H.length)return K;H[0]&&K.push(H[0]);if(H.length<2)return K;ga++;if(a.isIE&&h){var N=ga+"";H[0].setAttribute(la,N);for(var O=1,V;V=H[O];O++){H[O].getAttribute(la)!=N&&K.push(V);V.setAttribute(la,N)}}else if(a.isIE&&H.commentStrip)try{for(O=1;V=H[O];O++)t(V)&&K.push(V)}catch(X){}else{if(H[0])H[0][la]=ga;for(O=1;V=H[O];O++){H[O][la]!=ga&&K.push(V);V[la]=ga}}return K};a.query=function(H,K){g=a._NodeListCtor;if(!H)return new g;
if(H.constructor==g)return H;if(typeof H!="string")return new g(H);if(typeof K=="string"){K=a.byId(K);if(!K)return new g}K=K||i();var N=K.ownerDocument||K.documentElement;h=K.contentType&&K.contentType=="application/xml"||a.isOpera&&(K.doctype||N.toString()=="[object XMLDocument]")||!!N&&(a.isIE?N.xml:K.xmlVersion||N.xmlVersion);if((H=ea(H)(K))&&H.nozip&&!g._wrap)return H;return va(H)};a.query.pseudos=B;a._filterQueryResult=function(H,K,N){var O=new a._NodeListCtor,V=q(K);V=V.length==1&&!/[^\w#\.]/.test(K)?
E(V[0]):function(W){return dojo.query(K,N).indexOf(W)!=-1};for(var X=0,Z;Z=H[X];X++)V(Z)&&O.push(Z);return O}},d=function(){acme={trim:function(g){g=g.replace(/^\s+/,"");for(var i=g.length-1;i>=0;i--)if(/\S/.test(g.charAt(i))){g=g.substring(0,i+1);break}return g},forEach:function(g,i,j){if(g&&g.length)for(var l=0,h=g.length;l<h;++l)i.call(j||window,g[l],l,g)},byId:function(g,i){return typeof g=="string"?(i||document).getElementById(g):g},doc:document,NodeList:Array};var a=navigator,c=a.userAgent;
a=a.appVersion;var f=parseFloat(a);acme.isOpera=c.indexOf("Opera")>=0?f:undefined;acme.isKhtml=a.indexOf("Konqueror")>=0?f:undefined;acme.isWebKit=parseFloat(c.split("WebKit/")[1])||undefined;acme.isChrome=parseFloat(c.split("Chrome/")[1])||undefined;if((c=Math.max(a.indexOf("WebKit"),a.indexOf("Safari"),0))&&!acme.isChrome){acme.isSafari=parseFloat(a.split("Version/")[1]);if(!acme.isSafari||parseFloat(a.substr(c+7))<=419.3)acme.isSafari=2}if(document.all&&!acme.isOpera)acme.isIE=parseFloat(a.split("MSIE ")[1])||
undefined;Array._wrap=function(g){return g};return acme};typeof define=="function"&&define("dojo/_base/query",["dojo/lib/kernel","dojo/_base/NodeList","dojo/_base/lang","dojo/_base/window"],function(a){e(this.queryPortability||this.acme||a)});if(typeof define!="function")if(this.dojo){dojo.provide("dojo._base.query");dojo.require("dojo._base.NodeList");dojo.require("dojo._base.lang");e(this.queryPortability||this.acme||dojo)}else e(this.queryPortability||this.acme||d())})();
define("dojo/_base/xhr",["dojo/lib/kernel","dojo/_base/Deferred","dojo/_base/json","dojo/_base/lang","dojo/_base/query"],function(e){(function(){function d(x,m,o){if(o!==null){var p=x[m];if(typeof p=="string")x[m]=[p,o];else if(a.isArray(p))p.push(o);else x[m]=o}}var a=e,c=a.config;e.fieldToObject=function(x){var m=null;if(x=a.byId(x)){var o=x.name,p=(x.type||"").toLowerCase();if(o&&p&&!x.disabled)if(p=="radio"||p=="checkbox"){if(x.checked)m=x.value}else if(x.multiple){m=[];a.query("option",x).forEach(function(n){n.selected&&
m.push(n.value)})}else m=x.value}return m};e.formToObject=function(x){var m={};a.forEach(e.byId(x).elements,function(o){var p=o.name,n=(o.type||"").toLowerCase();if(p&&n&&"file|submit|image|reset|button|".indexOf(n)==-1&&!o.disabled){d(m,p,a.fieldToObject(o));if(n=="image")m[p+".x"]=m[p+".y"]=m[p].x=m[p].y=0}});return m};e.objectToQuery=function(x){var m=encodeURIComponent,o=[],p={};for(var n in x){var s=x[n];if(s!=p[n]){var y=m(n)+"=";if(a.isArray(s))for(var w=0;w<s.length;w++)o.push(y+m(s[w]));
else o.push(y+m(s))}}return o.join("&")};e.formToQuery=function(x){return a.objectToQuery(a.formToObject(x))};e.formToJson=function(x,m){return a.toJson(a.formToObject(x),m)};e.queryToObject=function(x){var m={};x=x.split("&");var o=decodeURIComponent;a.forEach(x,function(p){if(p.length){var n=p.split("=");p=o(n.shift());n=o(n.join("="));if(typeof m[p]=="string")m[p]=[m[p]];if(a.isArray(m[p]))m[p].push(n);else m[p]=n}});return m};e._blockAsync=false;var f=a._contentHandlers=e.contentHandlers={text:function(x){return x.responseText},
json:function(x){return a.fromJson(x.responseText||null)},"json-comment-filtered":function(x){e.config.useCommentedJson||console.warn("Consider using the standard mimetype:application/json. json-commenting can introduce security issues. To decrease the chances of hijacking, use the standard the 'json' handler and prefix your json with: {}&&\nUse djConfig.useCommentedJson=true to turn off this message.");x=x.responseText;var m=x.indexOf("/*"),o=x.lastIndexOf("*/");if(m==-1||o==-1)throw new Error("JSON was not comment filtered");
return a.fromJson(x.substring(m+2,o))},javascript:function(x){return a.eval(x.responseText)},xml:function(x){var m=x.responseXML;if(a.isIE&&(!m||!m.documentElement)){var o=function(p){return"MSXML"+p+".DOMDocument"};o=["Microsoft.XMLDOM",o(6),o(4),o(3),o(2)];a.some(o,function(p){try{var n=new ActiveXObject(p);n.async=false;n.loadXML(x.responseText);m=n}catch(s){return false}return true})}return m},"json-comment-optional":function(x){return x.responseText&&/^[^{\[]*\/\*/.test(x.responseText)?f["json-comment-filtered"](x):
f.json(x)}};e._ioSetArgs=function(x,m,o,p){var n={args:x,url:x.url},s=null;if(x.form){s=a.byId(x.form);var y=s.getAttributeNode("action");n.url=n.url||(y?y.value:null);s=a.formToObject(s)}y=[{}];s&&y.push(s);x.content&&y.push(x.content);x.preventCache&&y.push({"dojo.preventCache":(new Date).valueOf()});n.query=a.objectToQuery(a.mixin.apply(null,y));n.handleAs=x.handleAs||"text";var w=new a.Deferred(m);w.addCallbacks(o,function(E){return p(E,w)});var z=x.load;z&&a.isFunction(z)&&w.addCallback(function(E){return z.call(x,
E,n)});var B=x.error;B&&a.isFunction(B)&&w.addErrback(function(E){return B.call(x,E,n)});var D=x.handle;D&&a.isFunction(D)&&w.addBoth(function(E){return D.call(x,E,n)});if(c.ioPublish&&a.publish&&n.args.ioPublish!==false){w.addCallbacks(function(E){a.publish("/dojo/io/load",[w,E]);return E},function(E){a.publish("/dojo/io/error",[w,E]);return E});w.addBoth(function(E){a.publish("/dojo/io/done",[w,E]);return E})}w.ioArgs=n;return w};var g=function(x){x.canceled=true;var m=x.ioArgs.xhr,o=typeof m.abort;
if(o=="function"||o=="object"||o=="unknown")m.abort();x=x.ioArgs.error;if(!x){x=new Error("xhr cancelled");x.dojoType="cancel"}return x},i=function(x){x=f[x.ioArgs.handleAs](x.ioArgs.xhr);return x===undefined?null:x},j=function(x,m){m.ioArgs.args.failOk||console.error(x);return x},l=null,h=[],k=0,q=function(x){if(k<=0){k=0;if(c.ioPublish&&a.publish&&(!x||x&&x.ioArgs.args.ioPublish!==false))a.publish("/dojo/io/stop")}},u=function(){var x=(new Date).getTime();if(!a._blockAsync)for(var m=0,o;m<h.length&&
(o=h[m]);m++){var p=o.dfd,n=function(){if(!p||p.canceled||!o.validCheck(p)){h.splice(m--,1);k-=1}else if(o.ioCheck(p)){h.splice(m--,1);o.resHandle(p);k-=1}else if(p.startTime)if(p.startTime+(p.ioArgs.args.timeout||0)<x){h.splice(m--,1);var y=new Error("timeout exceeded");y.dojoType="timeout";p.errback(y);p.cancel();k-=1}};if(e.config.debugAtAllCosts)n.call(this);else try{n.call(this)}catch(s){p.errback(s)}}q(p);if(!h.length){clearInterval(l);l=null}};e._ioCancelAll=function(){try{a.forEach(h,function(m){try{m.dfd.cancel()}catch(o){}})}catch(x){}};
a.isIE&&a.addOnWindowUnload(a._ioCancelAll);a._ioNotifyStart=function(x){if(c.ioPublish&&a.publish&&x.ioArgs.args.ioPublish!==false){k||a.publish("/dojo/io/start");k+=1;a.publish("/dojo/io/send",[x])}};a._ioWatch=function(x,m,o,p){var n=x.ioArgs.args;if(n.timeout)x.startTime=(new Date).getTime();h.push({dfd:x,validCheck:m,ioCheck:o,resHandle:p});l||(l=setInterval(u,50));n.sync&&u()};var r="application/x-www-form-urlencoded",t=function(x){return x.ioArgs.xhr.readyState},v=function(x){return 4==x.ioArgs.xhr.readyState},
A=function(x){var m=x.ioArgs.xhr;if(a._isDocumentOk(m))x.callback(x);else{var o=new Error("Unable to load "+x.ioArgs.url+" status:"+m.status);o.status=m.status;o.responseText=m.responseText;x.errback(o)}};e._ioAddQueryToUrl=function(x){if(x.query.length){x.url+=(x.url.indexOf("?")==-1?"?":"&")+x.query;x.query=null}};e.xhr=function(x,m,o){var p=a._ioSetArgs(m,g,i,j),n=p.ioArgs,s=n.xhr=a._xhrObj(n.args);if(!s){p.cancel();return p}if("postData"in m)n.query=m.postData;else if("putData"in m)n.query=m.putData;
else if("rawBody"in m)n.query=m.rawBody;else if(arguments.length>2&&!o||"POST|PUT".indexOf(x.toUpperCase())==-1)a._ioAddQueryToUrl(n);s.open(x,n.url,m.sync!==true,m.user||undefined,m.password||undefined);if(m.headers)for(var y in m.headers)if(y.toLowerCase()==="content-type"&&!m.contentType)m.contentType=m.headers[y];else m.headers[y]&&s.setRequestHeader(y,m.headers[y]);s.setRequestHeader("Content-Type",m.contentType||r);if(!m.headers||!("X-Requested-With"in m.headers))s.setRequestHeader("X-Requested-With",
"XMLHttpRequest");a._ioNotifyStart(p);if(e.config.debugAtAllCosts)s.send(n.query);else try{s.send(n.query)}catch(w){n.error=w;p.cancel()}a._ioWatch(p,t,v,A);return p};e.xhrGet=function(x){return a.xhr("GET",x)};e.rawXhrPost=e.xhrPost=function(x){return a.xhr("POST",x,true)};e.rawXhrPut=e.xhrPut=function(x){return a.xhr("PUT",x,true)};e.xhrDelete=function(x){return a.xhr("DELETE",x)}})();return e.xhr});
define("dojo/_base/fx",["dojo/lib/kernel","dojo/_base/Color","dojo/_base/connect","dojo/_base/lang","dojo/_base/html"],function(e){(function(){var d=e._mixin;e._Line=function(j,l){this.start=j;this.end=l};e._Line.prototype.getValue=function(j){return(this.end-this.start)*j+this.start};e.Animation=function(j){d(this,j);if(e.isArray(this.curve))this.curve=new e._Line(this.curve[0],this.curve[1])};e._Animation=e.Animation;e.extend(e.Animation,{duration:350,repeat:0,rate:20,_percent:0,_startRepeatCount:0,
_getStep:function(){var j=this._percent,l=this.easing;return l?l(j):j},_fire:function(j,l){l=l||[];if(this[j])if(e.config.debugAtAllCosts)this[j].apply(this,l);else try{this[j].apply(this,l)}catch(h){console.error("exception in animation handler for:",j);console.error(h)}return this},play:function(j,l){var h=this;h._delayTimer&&h._clearTimer();if(l){h._stopTimer();h._active=h._paused=false;h._percent=0}else if(h._active&&!h._paused)return h;h._fire("beforeBegin",[h.node]);j=j||h.delay;var k=e.hitch(h,
"_play",l);if(j>0){h._delayTimer=setTimeout(k,j);return h}k();return h},_play:function(){var j=this;j._delayTimer&&j._clearTimer();j._startTime=(new Date).valueOf();if(j._paused)j._startTime-=j.duration*j._percent;j._active=true;j._paused=false;var l=j.curve.getValue(j._getStep());if(!j._percent){if(!j._startRepeatCount)j._startRepeatCount=j.repeat;j._fire("onBegin",[l])}j._fire("onPlay",[l]);j._cycle();return j},pause:function(){var j=this;j._delayTimer&&j._clearTimer();j._stopTimer();if(!j._active)return j;
j._paused=true;j._fire("onPause",[j.curve.getValue(j._getStep())]);return j},gotoPercent:function(j,l){var h=this;h._stopTimer();h._active=h._paused=true;h._percent=j;l&&h.play();return h},stop:function(j){var l=this;l._delayTimer&&l._clearTimer();if(!l._timer)return l;l._stopTimer();if(j)l._percent=1;l._fire("onStop",[l.curve.getValue(l._getStep())]);l._active=l._paused=false;return l},status:function(){if(this._active)return this._paused?"paused":"playing";return"stopped"},_cycle:function(){var j=
this;if(j._active){var l=((new Date).valueOf()-j._startTime)/j.duration;if(l>=1)l=1;j._percent=l;if(j.easing)l=j.easing(l);j._fire("onAnimate",[j.curve.getValue(l)]);if(j._percent<1)j._startTimer();else{j._active=false;if(j.repeat>0){j.repeat--;j.play(null,true)}else if(j.repeat==-1)j.play(null,true);else if(j._startRepeatCount){j.repeat=j._startRepeatCount;j._startRepeatCount=0}j._percent=0;j._fire("onEnd",[j.node]);!j.repeat&&j._stopTimer()}}return j},_clearTimer:function(){clearTimeout(this._delayTimer);
delete this._delayTimer}});var a=0,c=null,f={run:function(){}};e.extend(e.Animation,{_startTimer:function(){if(!this._timer){this._timer=e.connect(f,"run",this,"_cycle");a++}c||(c=setInterval(e.hitch(f,"run"),this.rate))},_stopTimer:function(){if(this._timer){e.disconnect(this._timer);this._timer=null;a--}if(a<=0){clearInterval(c);c=null;a=0}}});var g=e.isIE?function(j){var l=j.style;if(!l.width.length&&e.style(j,"width")=="auto")l.width="auto"}:function(){};e._fade=function(j){j.node=e.byId(j.node);
var l=d({properties:{}},j);j=l.properties.opacity={};j.start=!("start"in l)?function(){return+e.style(l.node,"opacity")||0}:l.start;j.end=l.end;j=e.animateProperty(l);e.connect(j,"beforeBegin",e.partial(g,l.node));return j};e.fadeIn=function(j){return e._fade(d({end:1},j))};e.fadeOut=function(j){return e._fade(d({end:0},j))};e._defaultEasing=function(j){return 0.5+Math.sin((j+1.5)*Math.PI)/2};var i=function(j){this._properties=j;for(var l in j){var h=j[l];if(h.start instanceof e.Color)h.tempColor=
new e.Color}};i.prototype.getValue=function(j){var l={};for(var h in this._properties){var k=this._properties[h],q=k.start;if(q instanceof e.Color)l[h]=e.blendColors(q,k.end,j,k.tempColor).toCss();else e.isArray(q)||(l[h]=(k.end-q)*j+q+(h!="opacity"?k.units||"px":0))}return l};e.animateProperty=function(j){var l=j.node=e.byId(j.node);if(!j.easing)j.easing=e._defaultEasing;j=new e.Animation(j);e.connect(j,"beforeBegin",j,function(){var h={};for(var k in this.properties){if(k=="width"||k=="height")this.node.display=
"block";var q=this.properties[k];if(e.isFunction(q))q=q(l);q=h[k]=d({},e.isObject(q)?q:{end:q});if(e.isFunction(q.start))q.start=q.start(l);if(e.isFunction(q.end))q.end=q.end(l);var u=k.toLowerCase().indexOf("color")>=0,r=function(t,v){var A={height:t.offsetHeight,width:t.offsetWidth}[v];if(A!==undefined)return A;A=e.style(t,v);return v=="opacity"?+A:u?A:parseFloat(A)};if("end"in q){if(!("start"in q))q.start=r(l,k)}else q.end=r(l,k);if(u){q.start=new e.Color(q.start);q.end=new e.Color(q.end)}else q.start=
k=="opacity"?+q.start:parseFloat(q.start)}this.curve=new i(h)});e.connect(j,"onAnimate",e.hitch(e,"style",j.node));return j};e.anim=function(j,l,h,k,q,u){return e.animateProperty({node:j,duration:h||e.Animation.prototype.duration,properties:l,easing:k,onEnd:q}).play(u||0)}})();return e.animateProperty});
define("dojo",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array","dojo/_base/declare","dojo/_base/connect","dojo/_base/Deferred","dojo/_base/json","dojo/_base/Color","dojo/_base/window","dojo/_base/event","dojo/_base/html","dojo/_base/NodeList","dojo/_base/query","dojo/_base/xhr","dojo/_base/fx"],function(e){return e});
define("orion/serviceregistry",["dojo"],function(e){function d(i,j,l){this.serviceId=i;this.name=j;this.properties=l}function a(i,j,l){this.serviceId=i;this.serviceReference=j;this.internalRegistry=l}function c(i,j,l){this.serviceId=i;this.implementation=j;this.internalRegistry=l;var h;for(h in j)if(typeof j[h]==="function")this[h]=function(k){return function(){if(l.isRegistered(i)){var q=new e.Deferred;try{var u=j[k].apply(j,Array.prototype.slice.call(arguments));e.when(u,e.hitch(q,q.resolve),e.hitch(q,
q.reject),e.hitch(q,q.progress))}catch(r){q.reject(r)}return q}throw new Error("Service was unregistered");}}(h)}function f(){this._namedlisteners={}}function g(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new f;var i=this;this.internalRegistry={isRegistered:function(j){return i._entries[j]?true:false},unregisterService:function(j){var l=i._entries[j];if(l){for(var h=l.reference,k=i._namedReferences[h.getName()],q=0;q<k.length;q++)if(k[q]===h){if(k.length===1)delete i._namedReferences[h.getName()];
else k.splice(q,1);break}i._entries[j]=null;i._serviceEventTarget.dispatchEvent("serviceRemoved",h,l.service)}},dispatchEvent:function(j,l){var h=i._entries[j];h&&h.eventTarget.dispatchEvent.apply(h.eventTarget,[l].concat(Array.prototype.slice.call(arguments,2)))},addEventListener:function(j,l,h){(j=i._entries[j])&&j.eventTarget.addEventListener(l,h)},removeEventListener:function(j,l,h){(j=i._entries[j])&&j.eventTarget.removeEventListener(l,h)}}}d.prototype={getServiceId:function(){return this.serviceId},
getName:function(){return this.name},getPropertyNames:function(){var i=[],j;for(j in this.properties)this.properties.hasOwnProperty(j)&&i.push(j);return i},getProperty:function(i){return this.properties[i]}};d.prototype.constructor=d;a.prototype={unregister:function(){this.internalRegistry.unregisterService(this.serviceId)},dispatchEvent:function(i){this.internalRegistry.dispatchEvent.apply(this.internalRegistry,[this.serviceId,i].concat(Array.prototype.slice.call(arguments,1)))},getServiceReference:function(){return this.serviceReference}};
a.prototype.constructor=a;c.prototype={addEventListener:function(i,j){this.internalRegistry.addEventListener(this.serviceId,i,j)},removeEventListener:function(i,j){this.internalRegistry.removeEventListener(this.serviceId,i,j)}};c.prototype.constructor=c;f.prototype={dispatchEvent:function(i){var j=this._namedlisteners[i];if(j)for(var l=0;l<j.length;l++)try{var h=Array.prototype.slice.call(arguments,1);j[l].apply(null,h)}catch(k){console.log(k)}},addEventListener:function(i,j){this._namedlisteners[i]=
this._namedlisteners[i]||[];this._namedlisteners[i].push(j)},removeEventListener:function(i,j){var l=this._namedlisteners[i];if(l)for(var h=0;h<l.length;h++)if(l[h]===j){if(l.length===1)delete this._namedlisteners[i];else l.splice(h,1);break}}};f.prototype.constructor=f;g.prototype={getService:function(i,j){var l,h=new e.Deferred;if(typeof i==="string"){if(this._namedReferences[i])for(var k=0;k<this._namedReferences[i].length;k++)if(l=this._entries[this._namedReferences[i][k].getServiceId()].service)break}else l=
this._entries[i.getServiceId()].service;if(l)h.resolve(l);else if(j===0)h.reject(new Error("timeout: getService"));else{var q=this,u=function(r,t){if(i===r||i===r.getName()){h.resolve(t);q._serviceEventTarget.removeEventListener("serviceAdded",u)}};this._serviceEventTarget.addEventListener("serviceAdded",u)}return h.promise},getServiceReferences:function(i){if(i)return this._namedReferences[i]?this._namedReferences[i]:[];i=[];for(var j=0;j<this._entries.length;j++)this._entries[j]&&i.push(this._entries[j].reference);
return i},registerService:function(i,j,l){var h=this._entries.length;l=new d(h,i,l);j=new c(h,j,this.internalRegistry);this._namedReferences[i]=this._namedReferences[i]||[];this._namedReferences[i].push(l);this._entries.push({reference:l,service:j,eventTarget:new f});this._serviceEventTarget.dispatchEvent("serviceAdded",l,j);return new a(h,l,this.internalRegistry)},addEventListener:function(i,j){this._serviceEventTarget.addEventListener(i,j)},removeEventListener:function(i,j){this._serviceEventTarget.removeEventListener(i,
j)}};g.prototype.constructor=g;return{ServiceReference:d,ServiceRegistration:a,Service:c,EventTarget:f,ServiceRegistry:g}});define("dijit",["dojo"],function(e){return dijit=e._dijit||{}});
define("dojo/hash",["dojo"],function(e){(function(){function d(q,u){u=q.indexOf(u);return u>=0?q.substring(u+1):""}function a(){return d(location.href,"#")}function c(){e.publish("/dojo/hashchange",[a()])}function f(){if(a()!==j){j=a();c()}}function g(q){if(l)if(l.isTransitioning())setTimeout(e.hitch(null,g,q),k);else{var u=l.iframe.location.href,r=u.indexOf("?");l.iframe.location.replace(u.substring(0,r)+"?"+q)}else{location.replace("#"+q);!h&&f()}}function i(){function q(){j=a();t=m?j:d(o.href,
"?");v=false;A=null}var u=document.createElement("iframe"),r=e.config.dojoBlankHtmlUrl||e.moduleUrl("dojo","resources/blank.html");e.config.useXDomain&&!e.config.dojoBlankHtmlUrl&&console.warn("dojo.hash: When using cross-domain Dojo builds, please save dojo/resources/blank.html to your domain and set djConfig.dojoBlankHtmlUrl to the path on your domain to blank.html");u.id="dojo-hash-iframe";u.src=r+"?"+a();u.style.display="none";document.body.appendChild(u);this.iframe=e.global["dojo-hash-iframe"];
var t,v,A,x,m,o=this.iframe.location;this.isTransitioning=function(){return v};this.pollLocation=function(){if(!m)try{var p=d(o.href,"?");if(document.title!=x)x=this.iframe.document.title=document.title}catch(n){m=true;console.error("dojo.hash: Error adding history entry. Server unreachable.")}var s=a();if(v&&j===s)if(m||p===A){q();c()}else{setTimeout(e.hitch(this,this.pollLocation),0);return}else if(!(j===s&&(m||t===p)))if(j!==s){j=s;v=true;A=s;u.src=r+"?"+A;m=false;setTimeout(e.hitch(this,this.pollLocation),
0);return}else if(!m){location.href="#"+o.search.substring(1);q();c()}setTimeout(e.hitch(this,this.pollLocation),k)};q();setTimeout(e.hitch(this,this.pollLocation),k)}e.hash=function(q,u){if(!arguments.length)return a();if(q.charAt(0)=="#")q=q.substring(1);if(u)g(q);else location.href="#"+q;return q};var j,l,h,k=e.config.hashPollFrequency||100;e.addOnLoad(function(){if("onhashchange"in e.global&&(!e.isIE||e.isIE>=8&&document.compatMode!="BackCompat"))h=e.connect(e.global,"onhashchange",c);else if(document.addEventListener){j=
a();setInterval(f,k)}else if(document.attachEvent)l=new i})})();return e.hash});
(function(){var e=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],d=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,a=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,c=[];define("text",["require","exports","module"],function(){var f,g,i;if(typeof window!=="undefined"&&window.navigator&&window.document)g=function(j,l){var h=f.createXhr();h.open("GET",j,true);h.onreadystatechange=function(){h.readyState===4&&l(h.responseText)};h.send(null)};else if(typeof process!=="undefined"&&process.versions&&
process.versions.node){i=require.nodeRequire("fs");g=function(j,l){l(i.readFileSync(j,"utf8"))}}else if(typeof Packages!=="undefined")g=function(j,l){var h=new java.io.File(j);j=java.lang.System.getProperty("line.separator");h=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(h),"utf-8"));var k,q,u="";try{k=new java.lang.StringBuffer;if((q=h.readLine())&&q.length()&&q.charAt(0)===65279)q=q.substring(1);for(k.append(q);(q=h.readLine())!==null;){k.append(j);k.append(q)}u=
String(k.toString())}finally{h.close()}l(u)};return f={version:"0.24.0",strip:function(j){if(j){j=j.replace(d,"");var l=j.match(a);if(l)j=l[1]}else j="";return j},jsEscape:function(j){return j.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")},createXhr:function(){var j,l,h;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else for(l=0;l<3;l++){h=e[l];try{j=new ActiveXObject(h)}catch(k){}if(j){e=
[h];break}}if(!j)throw new Error("require.getXhr(): XMLHttpRequest not available");return j},get:g,load:function(j,l,h,k){var q=false,u=j.indexOf("."),r=j.substring(0,u),t=j.substring(u+1,j.length);u=t.indexOf("!");if(u!==-1){q=t.substring(u+1,t.length);q=q==="strip";t=t.substring(0,u)}l=l.nameToUrl(r,"."+t);f.get(l,function(v){v=q?f.strip(v):v;if(k.isBuild&&k.inlineText)c[j]=v;h(v)})},write:function(j,l,h){if(l in c){var k=f.jsEscape(c[l]);h("define('"+j+"!"+l+"', function () { return '"+k+"';});\n")}}}})})();
define("text!dijit/form/templates/ValidationTextBox.html",function(){return'<div class="dijit dijitReset dijitInlineTable dijitLeft"\n\tid="widget_${id}" role="presentation"\n\t><div class=\'dijitReset dijitValidationContainer\'\n\t\t><input class="dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value="&#935; " type="text" tabIndex="-1" readonly="readonly" role="presentation"\n\t/></div\n\t><div class="dijitReset dijitInputField dijitInputContainer"\n\t\t><input class="dijitReset dijitInputInner" dojoAttachPoint=\'textbox,focusNode\' autocomplete="off"\n\t\t\t${!nameAttrSetting} type=\'${type}\'\n\t/></div\n></div>'});
define("dojo/i18n",["require","dojo"],function(e,d){d.getObject("i18n",true,d);d.i18n.getLocalization=d.i18n.getLocalization||function(a,c,f){f=d.i18n.normalizeLocale(f);var g=f.split("-"),i=[a,"nls",c].join(".");if(typeof d.global.require!=="undefined"){var j=e("i18n!"+[a.replace(/\./g,"/"),"nls",c].join("/"));(d._loadedModules[i]=d._loadedModules[i]||{})[g.join("_")]=j.root||j}if(i=d._loadedModules[i]){var l;for(j=g.length;j>0;j--){var h=g.slice(0,j).join("_");if(i[h]){l=i[h];break}}if(!l)l=i.ROOT;
if(l){a=function(){};a.prototype=l;return new a}}throw new Error("Bundle not found: "+c+" in "+a+" , locale="+f);};d.i18n.normalizeLocale=function(a){a=a?a.toLowerCase():d.locale;if(a=="root")a="ROOT";return a};d.i18n._requireLocalization=function(a,c,f,g){f=d.i18n.normalizeLocale(f);var i=[a,"nls",c].join("."),j="";if(g){for(var l=g.split(","),h=0;h<l.length;h++)if(f.indexOf(l[h])==0)if(l[h].length>j.length)j=l[h];j||(j="ROOT")}l=g?j:f;var k=d._loadedModules[i];h=null;if(k){if(d.config.localizationComplete&&
k._built)return;h=l.replace(/-/g,"_");h=d._loadedModules[i+"."+h]}if(!h){k=d.provide(i);var q=d._getModuleSymbols(a).concat("nls").join("/"),u;d.i18n._searchLocalePath(l,g,function(r){var t=r.replace(/-/g,"_"),v=i+"."+t,A=false;if(d._loadedModules[v])A=true;else{d.provide(v);v=[q];r!="ROOT"&&v.push(r);v.push(c);r=v.join("/")+".js";A=d._loadPath(r,null,function(x){x=x.root||x;var m=function(){};m.prototype=u;k[t]=new m;for(var o in x)k[t][o]=x[o]})}if(A&&k[t])u=k[t];else k[t]=u;if(g)return true})}if(g&&
f!=j)k[f.replace(/-/g,"_")]=k[j.replace(/-/g,"_")]};(function(){var a=d.config.extraLocale;if(a){if(!a instanceof Array)a=[a];var c=d.i18n._requireLocalization;d.i18n._requireLocalization=function(f,g,i,j){c(f,g,i,j);if(!i)for(i=0;i<a.length;i++)c(f,g,a[i],j)}}})();d.i18n._searchLocalePath=function(a,c,f){a=d.i18n.normalizeLocale(a);var g=a.split("-");a=[];for(var i=g.length;i>0;i--)a.push(g.slice(0,i).join("-"));a.push(false);c&&a.reverse();for(c=a.length-1;c>=0;c--)if(f(a[c]||"ROOT"))break};d.i18n._preloadLocalizations=
function(a,c){function f(j){j=d.i18n.normalizeLocale(j);d.i18n._searchLocalePath(j,true,function(l){for(var h=0;h<c.length;h++)if(c[h]==l){d.require(a+"_"+l);return true}return false})}f();for(var g=d.config.extraLocale||[],i=0;i<g.length;i++)f(g[i])};return d.i18n});define("text!dijit/form/templates/TextBox.html",function(){return'<div class="dijit dijitReset dijitInline dijitLeft" id="widget_${id}" role="presentation"\n\t><div class="dijitReset dijitInputField dijitInputContainer"\n\t\t><input class="dijitReset dijitInputInner" dojoAttachPoint=\'textbox,focusNode\' autocomplete="off"\n\t\t\t${!nameAttrSetting} type=\'${type}\'\n\t/></div\n></div>'});
define("dojo/window",["dojo"],function(e){e.getObject("window",true,e);e.window.getBox=function(){var d=e.doc.compatMode=="BackCompat"?e.body():e.doc.documentElement,a=e._docScroll();return{w:d.clientWidth,h:d.clientHeight,l:a.x,t:a.y}};e.window.get=function(d){if(e.isIE&&window!==document.parentWindow){d.parentWindow.execScript("document._parentWindow = window;","Javascript");var a=d._parentWindow;d._parentWindow=null;return a}return d.parentWindow||d.defaultView};e.window.scrollIntoView=function(d,
a){try{d=e.byId(d);var c=d.ownerDocument||e.doc,f=c.body||e.body(),g=c.documentElement||f.parentNode,i=e.isIE,j=e.isWebKit;if((!(e.isMoz||i||j||e.isOpera)||d==f||d==g)&&typeof d.scrollIntoView!="undefined")d.scrollIntoView(false);else{var l=c.compatMode=="BackCompat",h=i>=9&&d.ownerDocument.parentWindow.frameElement?g.clientHeight>0&&g.clientWidth>0&&(f.clientHeight==0||f.clientWidth==0||f.clientHeight>g.clientHeight||f.clientWidth>g.clientWidth)?g:f:l?f:g;c=j?f:h;var k=h.clientWidth,q=h.clientHeight,
u=!e._isBodyLtr(),r=a||e.position(d),t=d.parentNode;a=function(B){return i<=6||i&&l?false:e.style(B,"position").toLowerCase()=="fixed"};if(!a(d))for(;t;){if(t==f)t=c;var v=e.position(t),A=a(t);if(t==c){v.w=k;v.h=q;if(c==g&&i&&u)v.x+=c.offsetWidth-v.w;if(v.x<0||!i)v.x=0;if(v.y<0||!i)v.y=0}else{var x=e._getPadBorderExtents(t);v.w-=x.w;v.h-=x.h;v.x+=x.l;v.y+=x.t;var m=t.clientWidth,o=v.w-m;if(m>0&&o>0){v.w=m;v.x+=u&&(i||t.clientLeft>x.l)?o:0}m=t.clientHeight;o=v.h-m;if(m>0&&o>0)v.h=m}if(A){if(v.y<0){v.h+=
v.y;v.y=0}if(v.x<0){v.w+=v.x;v.x=0}if(v.y+v.h>q)v.h=q-v.y;if(v.x+v.w>k)v.w=k-v.x}var p=r.x-v.x,n=r.y-Math.max(v.y,0),s=p+r.w-v.w,y=n+r.h-v.h;if(s*p>0){var w=Math[p<0?"max":"min"](p,s);if(u&&(i==8&&!l||i>=9))w=-w;r.x+=t.scrollLeft;t.scrollLeft+=w;r.x-=t.scrollLeft}if(y*n>0){r.y+=t.scrollTop;t.scrollTop+=Math[n<0?"max":"min"](n,y);r.y-=t.scrollTop}t=t!=c&&!A&&t.parentNode}}}catch(z){console.error("scrollIntoView: "+z);d.scrollIntoView(false)}};return e.window});
define("dijit/_base/manager",["dojo","dijit"],function(e,d){e.declare("dijit.WidgetSet",null,{constructor:function(){this._hash={};this.length=0},add:function(a){if(this._hash[a.id])throw new Error("Tried to register widget with id=="+a.id+" but that id is already registered");this._hash[a.id]=a;this.length++},remove:function(a){if(this._hash[a]){delete this._hash[a];this.length--}},forEach:function(a,c){c=c||e.global;var f=0,g;for(g in this._hash)a.call(c,this._hash[g],f++,this._hash);return this},
filter:function(a,c){c=c||e.global;var f=new d.WidgetSet,g=0,i;for(i in this._hash){var j=this._hash[i];a.call(c,j,g++,this._hash)&&f.add(j)}return f},byId:function(a){return this._hash[a]},byClass:function(a){var c=new d.WidgetSet,f,g;for(f in this._hash){g=this._hash[f];g.declaredClass==a&&c.add(g)}return c},toArray:function(){var a=[];for(var c in this._hash)a.push(this._hash[c]);return a},map:function(a,c){return e.map(this.toArray(),a,c)},every:function(a,c){c=c||e.global;var f=0,g;for(g in this._hash)if(!a.call(c,
this._hash[g],f++,this._hash))return false;return true},some:function(a,c){c=c||e.global;var f=0,g;for(g in this._hash)if(a.call(c,this._hash[g],f++,this._hash))return true;return false}});(function(){d.registry=new d.WidgetSet;var a=d.registry._hash,c=e.attr,f=e.hasAttr,g=e.style;d.byId=function(h){return typeof h=="string"?a[h]:h};var i={};d.getUniqueId=function(h){var k;do k=h+"_"+(h in i?++i[h]:(i[h]=0));while(a[k]);return d._scopeName=="dijit"?k:d._scopeName+"_"+k};d.findWidgets=function(h){function k(u){for(u=
u.firstChild;u;u=u.nextSibling)if(u.nodeType==1){var r=u.getAttribute("widgetId");if(r)(r=a[r])&&q.push(r);else k(u)}}var q=[];k(h);return q};d._destroyAll=function(){d._curFocus=null;d._prevFocus=null;d._activeStack=[];e.forEach(d.findWidgets(e.body()),function(h){if(!h._destroyed)if(h.destroyRecursive)h.destroyRecursive();else h.destroy&&h.destroy()})};e.isIE&&e.addOnWindowUnload(function(){d._destroyAll()});d.byNode=function(h){return a[h.getAttribute("widgetId")]};d.getEnclosingWidget=function(h){for(;h;){var k=
h.getAttribute&&h.getAttribute("widgetId");if(k)return a[k];h=h.parentNode}return null};var j=d._isElementShown=function(h){var k=g(h);return k.visibility!="hidden"&&k.visibility!="collapsed"&&k.display!="none"&&c(h,"type")!="hidden"};d.hasDefaultTabStop=function(h){switch(h.nodeName.toLowerCase()){case "a":return f(h,"href");case "area":case "button":case "input":case "object":case "select":case "textarea":return true;case "iframe":var k;try{var q=h.contentDocument;if("designMode"in q&&q.designMode==
"on")return true;k=q.body}catch(u){try{k=h.contentWindow.document.body}catch(r){return false}}return k.contentEditable=="true"||k.firstChild&&k.firstChild.contentEditable=="true";default:return h.contentEditable=="true"}};var l=d.isTabNavigable=function(h){return c(h,"disabled")?false:f(h,"tabIndex")?c(h,"tabIndex")>=0:d.hasDefaultTabStop(h)};d._getTabNavigable=function(h){function k(p){return p&&p.tagName.toLowerCase()=="input"&&p.type&&p.type.toLowerCase()=="radio"&&p.name&&p.name.toLowerCase()}
function q(p){return m[k(p)]||p}var u,r,t,v,A,x,m={},o=function(p){e.query("> *",p).forEach(function(n){if(!(e.isIE&&n.scopeName!=="HTML"||!j(n))){if(l(n)){var s=c(n,"tabIndex");if(!f(n,"tabIndex")||s==0){u||(u=n);r=n}else if(s>0){if(!t||s<v){v=s;t=n}if(!A||s>=x){x=s;A=n}}s=k(n);if(e.attr(n,"checked")&&s)m[s]=n}n.nodeName.toUpperCase()!="SELECT"&&o(n)}})};j(h)&&o(h);return{first:q(u),last:q(r),lowest:q(t),highest:q(A)}};d.getFirstInTabbingOrder=function(h){h=d._getTabNavigable(e.byId(h));return h.lowest?
h.lowest:h.first};d.getLastInTabbingOrder=function(h){h=d._getTabNavigable(e.byId(h));return h.last?h.last:h.highest};d.defaultDuration=e.config.defaultDuration||200})();return d});
define("dojo/Stateful",["dojo"],function(e){e.declare("dojo.Stateful",null,{postscript:function(d){d&&e.mixin(this,d)},get:function(d){return this[d]},set:function(d,a){if(typeof d==="object"){for(var c in d)this.set(c,d[c]);return this}c=this[d];this[d]=a;this._watchCallbacks&&this._watchCallbacks(d,c,a);return this},watch:function(d,a){var c=this._watchCallbacks;if(!c){var f=this;c=this._watchCallbacks=function(i,j,l,h){var k=function(q){if(q){q=q.slice();for(var u=0,r=q.length;u<r;u++)try{q[u].call(f,
i,j,l)}catch(t){console.error(t)}}};k(c["_"+i]);h||k(c["*"])}}if(!a&&typeof d==="function"){a=d;d="*"}else d="_"+d;var g=c[d];if(typeof g!=="object")g=c[d]=[];g.push(a);return{unwatch:function(){g.splice(e.indexOf(g,a),1)}}}});return e.Stateful});
define("dijit/_WidgetBase",["dojo","dijit","dijit/_base/manager","dojo/Stateful"],function(e,d){(function(){e.declare("dijit._WidgetBase",e.Stateful,{id:"",lang:"",dir:"","class":"",style:"",title:"",tooltip:"",baseClass:"",srcNodeRef:null,domNode:null,containerNode:null,attributeMap:{id:"",dir:"",lang:"","class":"",style:"",title:""},_blankGif:(e.config.blankGif||e.moduleUrl("dojo","resources/blank.gif")).toString(),postscript:function(a,c){this.create(a,c)},create:function(a,c){this.srcNodeRef=
e.byId(c);this._connects=[];this._subscribes=[];if(this.srcNodeRef&&typeof this.srcNodeRef.id=="string")this.id=this.srcNodeRef.id;if(a){this.params=a;e._mixin(this,a)}this.postMixInProperties();if(!this.id)this.id=d.getUniqueId(this.declaredClass.replace(/\./g,"_"));d.registry.add(this);this.buildRendering();if(this.domNode){this._applyAttributes();(a=this.srcNodeRef)&&a.parentNode&&this.domNode!==a&&a.parentNode.replaceChild(this.domNode,a)}this.domNode&&this.domNode.setAttribute("widgetId",this.id);
this.postCreate();this.srcNodeRef&&!this.srcNodeRef.parentNode&&delete this.srcNodeRef;this._created=true},_applyAttributes:function(){var a=function(f,g){if(g.params&&f in g.params||g[f])g.set(f,g[f])};for(var c in this.attributeMap)a(c,this);e.forEach(this._getSetterAttributes(),function(f){f in this.attributeMap||a(f,this)},this)},_getSetterAttributes:function(){var a=this.constructor;if(!a._setterAttrs){var c=a._setterAttrs=[],f,g=a.prototype;for(var i in g)if(e.isFunction(g[i])&&(f=i.match(/^_set([a-zA-Z]*)Attr$/))&&
f[1])c.push(f[1].charAt(0).toLowerCase()+f[1].substr(1))}return a._setterAttrs},postMixInProperties:function(){},buildRendering:function(){if(!this.domNode)this.domNode=this.srcNodeRef||e.create("div");if(this.baseClass){var a=this.baseClass.split(" ");this.isLeftToRight()||(a=a.concat(e.map(a,function(c){return c+"Rtl"})));e.addClass(this.domNode,a)}},postCreate:function(){},startup:function(){this._started=true},destroyRecursive:function(a){this._beingDestroyed=true;this.destroyDescendants(a);this.destroy(a)},
destroy:function(a){this._beingDestroyed=true;this.uninitialize();var c=e.forEach,f=e.unsubscribe;c(this._connects,function(g){c(g,e.disconnect)});c(this._subscribes,function(g){f(g)});c(this._supportingWidgets||[],function(g){if(g.destroyRecursive)g.destroyRecursive();else g.destroy&&g.destroy()});this.destroyRendering(a);d.registry.remove(this.id);this._destroyed=true},destroyRendering:function(a){if(this.bgIframe){this.bgIframe.destroy(a);delete this.bgIframe}if(this.domNode){a?e.removeAttr(this.domNode,
"widgetId"):e.destroy(this.domNode);delete this.domNode}if(this.srcNodeRef){a||e.destroy(this.srcNodeRef);delete this.srcNodeRef}},destroyDescendants:function(a){e.forEach(this.getChildren(),function(c){c.destroyRecursive&&c.destroyRecursive(a)})},uninitialize:function(){return false},_setClassAttr:function(a){e.replaceClass(this[this.attributeMap["class"]||"domNode"],a,this["class"]);this._set("class",a)},_setStyleAttr:function(a){var c=this[this.attributeMap.style||"domNode"];if(e.isObject(a))e.style(c,
a);else if(c.style.cssText)c.style.cssText+="; "+a;else c.style.cssText=a;this._set("style",a)},_attrToDom:function(a,c){var f=this.attributeMap[a];e.forEach(e.isArray(f)?f:[f],function(g){var i=this[g.node||g||"domNode"];switch(g.type||"attribute"){case "attribute":if(e.isFunction(c))c=e.hitch(this,c);g=g.attribute?g.attribute:/^on[A-Z][a-zA-Z]*$/.test(a)?a.toLowerCase():a;e.attr(i,g,c);break;case "innerText":i.innerHTML="";i.appendChild(e.doc.createTextNode(c));break;case "innerHTML":i.innerHTML=
c;break;case "class":e.replaceClass(i,c,this[a]);break}},this)},get:function(a){var c=this._getAttrNames(a);return this[c.g]?this[c.g]():this[a]},set:function(a,c){if(typeof a==="object"){for(var f in a)this.set(f,a[f]);return this}f=this._getAttrNames(a);if(this[f.s])var g=this[f.s].apply(this,Array.prototype.slice.call(arguments,1));else{a in this.attributeMap&&this._attrToDom(a,c);this._set(a,c)}return g||this},_attrPairNames:{},_getAttrNames:function(a){var c=this._attrPairNames;if(c[a])return c[a];
var f=a.charAt(0).toUpperCase()+a.substr(1);return c[a]={n:a+"Node",s:"_set"+f+"Attr",g:"_get"+f+"Attr"}},_set:function(a,c){var f=this[a];this[a]=c;this._watchCallbacks&&this._created&&c!==f&&this._watchCallbacks(a,f,c)},toString:function(){return"[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]"},getDescendants:function(){return this.containerNode?e.query("[widgetId]",this.containerNode).map(d.byNode):[]},getChildren:function(){return this.containerNode?d.findWidgets(this.containerNode):
[]},connect:function(a,c,f){a=[e._connect(a,c,this,f)];this._connects.push(a);return a},disconnect:function(a){for(var c=0;c<this._connects.length;c++)if(this._connects[c]==a){e.forEach(a,e.disconnect);this._connects.splice(c,1);return}},subscribe:function(a,c){a=e.subscribe(a,this,c);this._subscribes.push(a);return a},unsubscribe:function(a){for(var c=0;c<this._subscribes.length;c++)if(this._subscribes[c]==a){e.unsubscribe(a);this._subscribes.splice(c,1);return}},isLeftToRight:function(){return this.dir?
this.dir=="ltr":e._isBodyLtr()},placeAt:function(a,c){a.declaredClass&&a.addChild?a.addChild(this,c):e.place(this.domNode,a,c);return this}})})();return d._WidgetBase});
define("dijit/_base/focus",["dojo","dijit","dojo/window","dijit/_base/manager"],function(e,d){e.mixin(d,{_curFocus:null,_prevFocus:null,isCollapsed:function(){return d.getBookmark().isCollapsed},getBookmark:function(){var a,c,f=e.doc.selection,g=d._curFocus;if(e.global.getSelection){if(f=e.global.getSelection())if(f.isCollapsed){if(a=g?g.tagName:""){a=a.toLowerCase();if(a=="textarea"||a=="input"&&(!g.type||g.type.toLowerCase()=="text")){f={start:g.selectionStart,end:g.selectionEnd,node:g,pRange:true};
return{isCollapsed:f.end<=f.start,mark:f}}}a={isCollapsed:true};if(f.rangeCount)a.mark=f.getRangeAt(0).cloneRange()}else{c=f.getRangeAt(0);a={isCollapsed:false,mark:c.cloneRange()}}}else if(f){a=g?g.tagName:"";a=a.toLowerCase();if(g&&a&&(a=="button"||a=="textarea"||a=="input"))if(f.type&&f.type.toLowerCase()=="none")return{isCollapsed:true,mark:null};else{c=f.createRange();return{isCollapsed:c.text&&c.text.length?false:true,mark:{range:c,pRange:true}}}a={};try{c=f.createRange();a.isCollapsed=!(f.type==
"Text"?c.htmlText.length:c.length)}catch(i){a.isCollapsed=true;return a}if(f.type.toUpperCase()=="CONTROL")if(c.length){a.mark=[];f=0;for(g=c.length;f<g;)a.mark.push(c.item(f++))}else{a.isCollapsed=true;a.mark=null}else a.mark=c.getBookmark()}else console.warn("No idea how to store the current selection for this browser!");return a},moveToBookmark:function(a){var c=e.doc;if(a=a.mark)if(e.global.getSelection){var f=e.global.getSelection();if(f&&f.removeAllRanges)if(a.pRange){f=a.node;f.selectionStart=
a.start;f.selectionEnd=a.end}else{f.removeAllRanges();f.addRange(a)}else console.warn("No idea how to restore selection for this browser!")}else if(c.selection&&a){var g;if(a.pRange)g=a.range;else if(e.isArray(a)){g=c.body.createControlRange();e.forEach(a,function(i){g.addElement(i)})}else{g=c.body.createTextRange();g.moveToBookmark(a)}g.select()}},getFocus:function(a,c){a=!d._curFocus||a&&e.isDescendant(d._curFocus,a.domNode)?d._prevFocus:d._curFocus;return{node:a,bookmark:a==d._curFocus&&e.withGlobal(c||
e.global,d.getBookmark),openedForWindow:c}},focus:function(a){if(a){var c="node"in a?a.node:a,f=a.bookmark;a=a.openedForWindow;var g=f?f.isCollapsed:false;if(c){var i=c.tagName.toLowerCase()=="iframe"?c.contentWindow:c;if(i&&i.focus)try{i.focus()}catch(j){}d._onFocusNode(c)}if(f&&e.withGlobal(a||e.global,d.isCollapsed)&&!g){a&&a.focus();try{e.withGlobal(a||e.global,d.moveToBookmark,null,[f])}catch(l){}}}},_activeStack:[],registerIframe:function(a){return d.registerWin(a.contentWindow,a)},unregisterIframe:function(a){d.unregisterWin(a)},
registerWin:function(a,c){var f=function(k){d._justMouseDowned=true;setTimeout(function(){d._justMouseDowned=false},0);e.isIE&&k&&k.srcElement&&k.srcElement.parentNode==null||d._onTouchNode(c||k.target||k.srcElement,"mouse")},g=e.isIE?a.document.documentElement:a.document;if(g)if(e.isIE){a.document.body.attachEvent("onmousedown",f);var i=function(k){k.srcElement.tagName.toLowerCase()!="#document"&&d.isTabNavigable(k.srcElement)?d._onFocusNode(c||k.srcElement):d._onTouchNode(c||k.srcElement)};g.attachEvent("onactivate",
i);var j=function(k){d._onBlurNode(c||k.srcElement)};g.attachEvent("ondeactivate",j);return function(){a.document.detachEvent("onmousedown",f);g.detachEvent("onactivate",i);g.detachEvent("ondeactivate",j);g=null}}else{g.body.addEventListener("mousedown",f,true);var l=function(k){d._onFocusNode(c||k.target)};g.addEventListener("focus",l,true);var h=function(k){d._onBlurNode(c||k.target)};g.addEventListener("blur",h,true);return function(){g.body.removeEventListener("mousedown",f,true);g.removeEventListener("focus",
l,true);g.removeEventListener("blur",h,true);g=null}}},unregisterWin:function(a){a&&a()},_onBlurNode:function(){d._prevFocus=d._curFocus;d._curFocus=null;if(!d._justMouseDowned){d._clearActiveWidgetsTimer&&clearTimeout(d._clearActiveWidgetsTimer);d._clearActiveWidgetsTimer=setTimeout(function(){delete d._clearActiveWidgetsTimer;d._setStack([]);d._prevFocus=null},100)}},_onTouchNode:function(a,c){if(d._clearActiveWidgetsTimer){clearTimeout(d._clearActiveWidgetsTimer);delete d._clearActiveWidgetsTimer}var f=
[];try{for(;a;){var g=e.attr(a,"dijitPopupParent");if(g)a=d.byId(g).domNode;else if(a.tagName&&a.tagName.toLowerCase()=="body"){if(a===e.body())break;a=e.window.get(a.ownerDocument).frameElement}else{var i=a.getAttribute&&a.getAttribute("widgetId"),j=i&&d.byId(i);j&&!(c=="mouse"&&j.get("disabled"))&&f.unshift(i);a=a.parentNode}}}catch(l){}d._setStack(f,c)},_onFocusNode:function(a){if(a)if(a.nodeType!=9){d._onTouchNode(a);if(a!=d._curFocus){if(d._curFocus)d._prevFocus=d._curFocus;d._curFocus=a;e.publish("focusNode",
[a])}}},_setStack:function(a,c){var f=d._activeStack;d._activeStack=a;for(var g=0;g<Math.min(f.length,a.length);g++)if(f[g]!=a[g])break;for(var i,j=f.length-1;j>=g;j--)if(i=d.byId(f[j])){i._focused=false;i.set("focused",false);i._hasBeenBlurred=true;i._onBlur&&i._onBlur(c);e.publish("widgetBlur",[i,c])}for(j=g;j<a.length;j++)if(i=d.byId(a[j])){i._focused=true;i.set("focused",true);i._onFocus&&i._onFocus(c);e.publish("widgetFocus",[i,c])}}});e.addOnLoad(function(){var a=d.registerWin(window);e.isIE&&
e.addOnWindowUnload(function(){d.unregisterWin(a);a=null})});return d});
define("dojo/AdapterRegistry",["dojo"],function(e){e.AdapterRegistry=function(d){this.pairs=[];this.returnWrappers=d||false};e.extend(e.AdapterRegistry,{register:function(d,a,c,f,g){this.pairs[g?"unshift":"push"]([d,a,c,f])},match:function(){for(var d=0;d<this.pairs.length;d++){var a=this.pairs[d];if(a[1].apply(this,arguments))return a[3]||this.returnWrappers?a[2]:a[2].apply(this,arguments)}throw new Error("No match found");},unregister:function(d){for(var a=0;a<this.pairs.length;a++)if(this.pairs[a][0]==
d){this.pairs.splice(a,1);return true}return false}});return e.AdapterRegistry});
define("dijit/_base/place",["dojo","dijit","dojo/window","dojo/AdapterRegistry"],function(e,d){d.getViewport=function(){return e.window.getBox()};d.placeOnScreen=function(a,c,f,g){f=e.map(f,function(i){var j={corner:i,pos:{x:c.x,y:c.y}};if(g){j.pos.x+=i.charAt(1)=="L"?g.x:-g.x;j.pos.y+=i.charAt(0)=="T"?g.y:-g.y}return j});return d._place(a,f)};d._place=function(a,c,f,g){var i=e.window.getBox();if(!a.parentNode||String(a.parentNode.tagName).toLowerCase()!="body")e.body().appendChild(a);var j=null;
e.some(c,function(h){var k=h.corner,q=h.pos,u=0,r={w:k.charAt(1)=="L"?i.l+i.w-q.x:q.x-i.l,h:k.charAt(1)=="T"?i.t+i.h-q.y:q.y-i.t};if(f){u=f(a,h.aroundCorner,k,r,g);u=typeof u=="undefined"?0:u}var t=a.style,v=t.display,A=t.visibility;t.visibility="hidden";t.display="";var x=e.marginBox(a);t.display=v;t.visibility=A;t=Math.max(i.l,k.charAt(1)=="L"?q.x:q.x-x.w);v=Math.max(i.t,k.charAt(0)=="T"?q.y:q.y-x.h);A=Math.min(i.l+i.w,k.charAt(1)=="L"?t+x.w:q.x);q=Math.min(i.t+i.h,k.charAt(0)=="T"?v+x.h:q.y);A=
A-t;q=q-v;u+=x.w-A+(x.h-q);if(j==null||u<j.overflow)j={corner:k,aroundCorner:h.aroundCorner,x:t,y:v,w:A,h:q,overflow:u,spaceAvailable:r};return!u});j.overflow&&f&&f(a,j.aroundCorner,j.corner,j.spaceAvailable,g);c=e._isBodyLtr();var l=a.style;l.top=j.y+"px";l[c?"left":"right"]=(c?j.x:i.w-j.x-j.w)+"px";return j};d.placeOnScreenAroundNode=function(a,c,f,g){c=e.byId(c);c=e.position(c,true);return d._placeOnScreenAroundRect(a,c.x,c.y,c.w,c.h,f,g)};d.placeOnScreenAroundRectangle=function(a,c,f,g){return d._placeOnScreenAroundRect(a,
c.x,c.y,c.width,c.height,f,g)};d._placeOnScreenAroundRect=function(a,c,f,g,i,j,l){var h=[];for(var k in j)h.push({aroundCorner:k,corner:j[k],pos:{x:c+(k.charAt(1)=="L"?0:g),y:f+(k.charAt(0)=="T"?0:i)}});return d._place(a,h,l,{w:g,h:i})};d.placementRegistry=new e.AdapterRegistry;d.placementRegistry.register("node",function(a,c){return typeof c=="object"&&typeof c.offsetWidth!="undefined"&&typeof c.offsetHeight!="undefined"},d.placeOnScreenAroundNode);d.placementRegistry.register("rect",function(a,
c){return typeof c=="object"&&"x"in c&&"y"in c&&"width"in c&&"height"in c},d.placeOnScreenAroundRectangle);d.placeOnScreenAroundElement=function(){return d.placementRegistry.match.apply(d.placementRegistry,arguments)};d.getPopupAroundAlignment=function(a,c){var f={};e.forEach(a,function(g){switch(g){case "after":f[c?"BR":"BL"]=c?"BL":"BR";break;case "before":f[c?"BL":"BR"]=c?"BR":"BL";break;case "below-alt":c=!c;case "below":f[c?"BL":"BR"]=c?"TL":"TR";f[c?"BR":"BL"]=c?"TR":"TL";break;case "above-alt":c=
!c;case "above":default:f[c?"TL":"TR"]=c?"BL":"BR";f[c?"TR":"TL"]=c?"BR":"BL";break}});return f};return d});define("dijit/_base/window",["dojo","dijit","dojo/window"],function(e,d){d.getDocumentWindow=function(a){return e.window.get(a)};return d});
define("dijit/_base/popup",["dojo","dijit","dijit/_base/focus","dijit/_base/place","dijit/_base/window"],function(e,d){d.popup={_stack:[],_beginZIndex:1E3,_idGen:1,_createWrapper:function(a){var c=a.declaredClass?a._popupWrapper:a.parentNode&&e.hasClass(a.parentNode,"dijitPopup"),f=a.domNode||a;if(!c){c=e.create("div",{"class":"dijitPopup",style:{display:"none"},role:"presentation"},e.body());c.appendChild(f);f=f.style;f.display="";f.visibility="";f.position="";f.top="0px";if(a.declaredClass){a._popupWrapper=
c;e.connect(a,"destroy",function(){e.destroy(c);delete a._popupWrapper})}}return c},moveOffScreen:function(a){a=this._createWrapper(a);e.style(a,{visibility:"hidden",top:"-9999px",display:""})},hide:function(a){a=this._createWrapper(a);e.style(a,"display","none")},getTopPopup:function(){for(var a=this._stack,c=a.length-1;c>0&&a[c].parent===a[c-1].widget;c--);return a[c]},open:function(a){for(var c=this._stack,f=a.popup,g=a.orient||((a.parent?a.parent.isLeftToRight():e._isBodyLtr())?{BL:"TL",BR:"TR",
TL:"BL",TR:"BR"}:{BR:"TR",BL:"TL",TR:"BR",TL:"BL"}),i=a.around,j=a.around&&a.around.id?a.around.id+"_dropdown":"popup_"+this._idGen++;c.length&&(!a.parent||!e.isDescendant(a.parent.domNode,c[c.length-1].widget.domNode));)d.popup.close(c[c.length-1].widget);var l=this._createWrapper(f);e.attr(l,{id:j,style:{zIndex:this._beginZIndex+c.length},"class":"dijitPopup "+(f.baseClass||f["class"]||"").split(" ")[0]+"Popup",dijitPopupParent:a.parent?a.parent.id:""});if(e.isIE||e.isMoz)if(!f.bgIframe)f.bgIframe=
new d.BackgroundIframe(l);g=i?d.placeOnScreenAroundElement(l,i,g,f.orient?e.hitch(f,"orient"):null):d.placeOnScreen(l,a,g=="R"?["TR","BR","TL","BL"]:["TL","BL","TR","BR"],a.padding);l.style.display="";l.style.visibility="visible";f.domNode.style.visibility="visible";i=[];i.push(e.connect(l,"onkeypress",this,function(h){if(h.charOrCode==e.keys.ESCAPE&&a.onCancel){e.stopEvent(h);a.onCancel()}else if(h.charOrCode===e.keys.TAB){e.stopEvent(h);(h=this.getTopPopup())&&h.onCancel&&h.onCancel()}}));f.onCancel&&
i.push(e.connect(f,"onCancel",a.onCancel));i.push(e.connect(f,f.onExecute?"onExecute":"onChange",this,function(){var h=this.getTopPopup();h&&h.onExecute&&h.onExecute()}));c.push({widget:f,parent:a.parent,onExecute:a.onExecute,onCancel:a.onCancel,onClose:a.onClose,handlers:i});f.onOpen&&f.onOpen(g);return g},close:function(a){for(var c=this._stack;a&&e.some(c,function(j){return j.widget==a})||!a&&c.length;){var f=c.pop(),g=f.widget,i=f.onClose;g.onClose&&g.onClose();e.forEach(f.handlers,e.disconnect);
g&&g.domNode&&this.hide(g);i&&i()}}};d._frames=new (function(){var a=[];this.pop=function(){var c;if(a.length){c=a.pop();c.style.display=""}else{if(e.isIE<9){c="<iframe src='"+(e.config.dojoBlankHtmlUrl||e.moduleUrl("dojo","resources/blank.html")+""||'javascript:""')+"' style='position: absolute; left: 0px; top: 0px;z-index: -1; filter:Alpha(Opacity=\"0\");'>";c=e.doc.createElement(c)}else{c=e.create("iframe");c.src='javascript:""';c.className="dijitBackgroundIframe";e.style(c,"opacity",0.1)}c.tabIndex=
-1;d.setWaiRole(c,"presentation")}return c};this.push=function(c){c.style.display="none";a.push(c)}});d.BackgroundIframe=function(a){if(!a.id)throw new Error("no id");if(e.isIE||e.isMoz){var c=this.iframe=d._frames.pop();a.appendChild(c);if(e.isIE<7||e.isQuirks){this.resize(a);this._conn=e.connect(a,"onresize",this,function(){this.resize(a)})}else e.style(c,{width:"100%",height:"100%"})}};e.extend(d.BackgroundIframe,{resize:function(a){this.iframe&&e.style(this.iframe,{width:a.offsetWidth+"px",height:a.offsetHeight+
"px"})},destroy:function(){if(this._conn){e.disconnect(this._conn);this._conn=null}if(this.iframe){d._frames.push(this.iframe);delete this.iframe}}});return d.popup});define("dijit/_base/scroll",["dojo","dijit","dojo/window"],function(e,d){d.scrollIntoView=function(a,c){e.window.scrollIntoView(a,c)};return d.scrollIntoView});
define("dojo/uacss",["dojo"],function(e){(function(){var d=e.doc.documentElement,a=e.isIE,c=e.isOpera,f=Math.floor,g=e.isFF,i=e.boxModel.replace(/-/,"");a={dj_ie:a,dj_ie6:f(a)==6,dj_ie7:f(a)==7,dj_ie8:f(a)==8,dj_ie9:f(a)==9,dj_quirks:e.isQuirks,dj_iequirks:a&&e.isQuirks,dj_opera:c,dj_khtml:e.isKhtml,dj_webkit:e.isWebKit,dj_safari:e.isSafari,dj_chrome:e.isChrome,dj_gecko:e.isMozilla,dj_ff3:f(g)==3};a["dj_"+i]=true;var j="";for(var l in a)if(a[l])j+=l+" ";d.className=e.trim(d.className+" "+j);e._loaders.unshift(function(){if(!e._isBodyLtr()){var h=
"dj_rtl dijitRtl "+j.replace(/ /g,"-rtl ");d.className=e.trim(d.className+" "+h)}})})();return e});define("dijit/_base/sniff",["dojo","dijit","dojo/uacss"],function(e,d){return d});
define("dijit/_base/typematic",["dojo","dijit"],function(e,d){d.typematic={_fireEventAndReload:function(){this._timer=null;this._callback(++this._count,this._node,this._evt);this._currentTimeout=Math.max(this._currentTimeout<0?this._initialDelay:this._subsequentDelay>1?this._subsequentDelay:Math.round(this._currentTimeout*this._subsequentDelay),this._minDelay);this._timer=setTimeout(e.hitch(this,"_fireEventAndReload"),this._currentTimeout)},trigger:function(a,c,f,g,i,j,l,h){if(i!=this._obj){this.stop();
this._initialDelay=l||500;this._subsequentDelay=j||0.9;this._minDelay=h||10;this._obj=i;this._evt=a;this._node=f;this._count=this._currentTimeout=-1;this._callback=e.hitch(c,g);this._fireEventAndReload();this._evt=e.mixin({faux:true},a)}},stop:function(){if(this._timer){clearTimeout(this._timer);this._timer=null}if(this._obj){this._callback(-1,this._node,this._evt);this._obj=null}},addKeyListener:function(a,c,f,g,i,j,l){if(c.keyCode){c.charOrCode=c.keyCode;e.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.",
"","2.0")}else if(c.charCode){c.charOrCode=String.fromCharCode(c.charCode);e.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0")}return[e.connect(a,"onkeypress",this,function(h){if(h.charOrCode==c.charOrCode&&(c.ctrlKey===undefined||c.ctrlKey==h.ctrlKey)&&(c.altKey===undefined||c.altKey==h.altKey)&&(c.metaKey===undefined||c.metaKey==(h.metaKey||false))&&(c.shiftKey===undefined||c.shiftKey==h.shiftKey)){e.stopEvent(h);d.typematic.trigger(h,
f,a,g,c,i,j,l)}else d.typematic._obj==c&&d.typematic.stop()}),e.connect(a,"onkeyup",this,function(){d.typematic._obj==c&&d.typematic.stop()})]},addMouseListener:function(a,c,f,g,i,j){var l=e.connect;return[l(a,"mousedown",this,function(h){e.stopEvent(h);d.typematic.trigger(h,c,a,f,a,g,i,j)}),l(a,"mouseup",this,function(h){e.stopEvent(h);d.typematic.stop()}),l(a,"mouseout",this,function(h){e.stopEvent(h);d.typematic.stop()}),l(a,"mousemove",this,function(h){h.preventDefault()}),l(a,"dblclick",this,
function(h){e.stopEvent(h);if(e.isIE){d.typematic.trigger(h,c,a,f,a,g,i,j);setTimeout(e.hitch(this,d.typematic.stop),50)}})]},addListener:function(a,c,f,g,i,j,l,h){return this.addKeyListener(c,f,g,i,j,l,h).concat(this.addMouseListener(a,g,i,j,l,h))}};return d.typematic});
define("dijit/_base/wai",["dojo","dijit"],function(e,d){d.wai={onload:function(){var a=e.create("div",{id:"a11yTestNode",style:{cssText:'border: 1px solid;border-color:red green;position: absolute;height: 5px;top: -999px;background-image: url("'+(e.config.blankGif||e.moduleUrl("dojo","resources/blank.gif"))+'");'}},e.body()),c=e.getComputedStyle(a);if(c){var f=c.backgroundImage;e[c.borderTopColor==c.borderRightColor||f!=null&&(f=="none"||f=="url(invalid-url:)")?"addClass":"removeClass"](e.body(),
"dijit_a11y");if(e.isIE)a.outerHTML="";else e.body().removeChild(a)}}};if(e.isIE||e.isMoz)e._loaders.unshift(d.wai.onload);e.mixin(d,{hasWaiRole:function(a,c){a=this.getWaiRole(a);return c?a.indexOf(c)>-1:a.length>0},getWaiRole:function(a){return e.trim((e.attr(a,"role")||"").replace("wairole:",""))},setWaiRole:function(a,c){e.attr(a,"role",c)},removeWaiRole:function(a,c){var f=e.attr(a,"role");if(f)if(c){c=e.trim((" "+f+" ").replace(" "+c+" "," "));e.attr(a,"role",c)}else a.removeAttribute("role")},
hasWaiState:function(a,c){return a.hasAttribute?a.hasAttribute("aria-"+c):!!a.getAttribute("aria-"+c)},getWaiState:function(a,c){return a.getAttribute("aria-"+c)||""},setWaiState:function(a,c,f){a.setAttribute("aria-"+c,f)},removeWaiState:function(a,c){a.removeAttribute("aria-"+c)}});return d});
define("dijit/_base",["dojo","dijit","dijit/_base/focus","dijit/_base/manager","dijit/_base/place","dijit/_base/popup","dijit/_base/scroll","dijit/_base/sniff","dijit/_base/typematic","dijit/_base/wai","dijit/_base/window"],function(e,d){return d._base});
define("dijit/_Widget",["dojo","dijit","dijit/_WidgetBase","dijit/_base"],function(e,d){e.connect(e,"_connect",function(a,c){a&&e.isFunction(a._onConnect)&&a._onConnect(c)});d._connectOnUseEventHandler=function(){};d._lastKeyDownNode=null;e.isIE?function(){var a=function(c){d._lastKeyDownNode=c.srcElement};e.doc.attachEvent("onkeydown",a);e.addOnWindowUnload(function(){e.doc.detachEvent("onkeydown",a)})}():e.doc.addEventListener("keydown",function(a){d._lastKeyDownNode=a.target},true);(function(){e.declare("dijit._Widget",
d._WidgetBase,{_deferredConnects:{onClick:"",onDblClick:"",onKeyDown:"",onKeyPress:"",onKeyUp:"",onMouseMove:"",onMouseDown:"",onMouseOut:"",onMouseOver:"",onMouseLeave:"",onMouseEnter:"",onMouseUp:""},onClick:d._connectOnUseEventHandler,onDblClick:d._connectOnUseEventHandler,onKeyDown:d._connectOnUseEventHandler,onKeyPress:d._connectOnUseEventHandler,onKeyUp:d._connectOnUseEventHandler,onMouseDown:d._connectOnUseEventHandler,onMouseMove:d._connectOnUseEventHandler,onMouseOut:d._connectOnUseEventHandler,
onMouseOver:d._connectOnUseEventHandler,onMouseLeave:d._connectOnUseEventHandler,onMouseEnter:d._connectOnUseEventHandler,onMouseUp:d._connectOnUseEventHandler,create:function(){this._deferredConnects=e.clone(this._deferredConnects);for(var a in this.attributeMap)delete this._deferredConnects[a];for(a in this._deferredConnects)this[a]!==d._connectOnUseEventHandler&&delete this._deferredConnects[a];this.inherited(arguments);if(this.domNode)for(a in this.params)this._onConnect(a)},_onConnect:function(a){if(a in
this._deferredConnects){this.connect(this[this._deferredConnects[a]||"domNode"],a.toLowerCase(),a);delete this._deferredConnects[a]}},focused:false,isFocusable:function(){return this.focus&&e.style(this.domNode,"display")!="none"},onFocus:function(){},onBlur:function(){},_onFocus:function(){this.onFocus()},_onBlur:function(){this.onBlur()},setAttribute:function(a,c){e.deprecated(this.declaredClass+"::setAttribute(attr, value) is deprecated. Use set() instead.","","2.0");this.set(a,c)},attr:function(a){if(e.config.isDebug){var c=
arguments.callee._ach||(arguments.callee._ach={}),f=(arguments.callee.caller||"unknown caller").toString();if(!c[f]){e.deprecated(this.declaredClass+"::attr() is deprecated. Use get() or set() instead, called from "+f,"","2.0");c[f]=true}}return arguments.length>=2||typeof a==="object"?this.set.apply(this,arguments):this.get(a)},nodesWithKeyClick:["input","button"],connect:function(a,c,f){var g=e._connect,i=this.inherited(arguments,[a,c=="ondijitclick"?"onclick":c,f]);if(c=="ondijitclick")if(e.indexOf(this.nodesWithKeyClick,
a.nodeName.toLowerCase())==-1){var j=e.hitch(this,f);i.push(g(a,"onkeydown",this,function(l){if((l.keyCode==e.keys.ENTER||l.keyCode==e.keys.SPACE)&&!l.ctrlKey&&!l.shiftKey&&!l.altKey&&!l.metaKey){d._lastKeyDownNode=l.target;"openDropDown"in this&&a==this._buttonNode||l.preventDefault()}}),g(a,"onkeyup",this,function(l){if((l.keyCode==e.keys.ENTER||l.keyCode==e.keys.SPACE)&&l.target==d._lastKeyDownNode&&!l.ctrlKey&&!l.shiftKey&&!l.altKey&&!l.metaKey){d._lastKeyDownNode=null;return j(l)}}))}return i},
_onShow:function(){this.onShow()},onShow:function(){},onHide:function(){},onClose:function(){return true}})})();return d._Widget});
define("dojo/string",["dojo"],function(e){e.getObject("string",true,e);e.string.rep=function(d,a){if(a<=0||!d)return"";for(var c=[];;){a&1&&c.push(d);if(!(a>>=1))break;d+=d}return c.join("")};e.string.pad=function(d,a,c,f){c||(c="0");d=String(d);a=e.string.rep(c,Math.ceil((a-d.length)/c.length));return f?d+a:a+d};e.string.substitute=function(d,a,c,f){f=f||e.global;c=c?e.hitch(f,c):function(g){return g};return d.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,function(g,i,j){g=e.getObject(i,false,
a);if(j)g=e.getObject(j,false,f).call(f,g,i);return c(g,i).toString()})};e.string.trim=String.prototype.trim?e.trim:function(d){d=d.replace(/^\s+/,"");for(var a=d.length-1;a>=0;a--)if(/\S/.test(d.charAt(a))){d=d.substring(0,a+1);break}return d};return e.string});
define("dojo/date/stamp",["dojo"],function(e){e.getObject("date.stamp",true,e);e.date.stamp.fromISOString=function(d,a){if(!e.date.stamp._isoRegExp)e.date.stamp._isoRegExp=/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;var c=e.date.stamp._isoRegExp.exec(d);d=null;if(c){c.shift();c[1]&&c[1]--;if(c[6])c[6]*=1E3;if(a){a=new Date(a);e.forEach(e.map(["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"],function(i){return a["get"+
i]()}),function(i,j){c[j]=c[j]||i})}d=new Date(c[0]||1970,c[1]||0,c[2]||1,c[3]||0,c[4]||0,c[5]||0,c[6]||0);if(c[0]<100)d.setFullYear(c[0]||1970);var f=0,g=c[7]&&c[7].charAt(0);if(g!="Z"){f=(c[8]||0)*60+(Number(c[9])||0);if(g!="-")f*=-1}if(g)f-=d.getTimezoneOffset();f&&d.setTime(d.getTime()+f*6E4)}return d};e.date.stamp.toISOString=function(d,a){var c=function(j){return j<10?"0"+j:j};a=a||{};var f=[],g=a.zulu?"getUTC":"get",i="";if(a.selector!="time"){i=d[g+"FullYear"]();i=["0000".substr((i+"").length)+
i,c(d[g+"Month"]()+1),c(d[g+"Date"]())].join("-")}f.push(i);if(a.selector!="date"){i=[c(d[g+"Hours"]()),c(d[g+"Minutes"]()),c(d[g+"Seconds"]())].join(":");g=d[g+"Milliseconds"]();if(a.milliseconds)i+="."+(g<100?"0":"")+c(g);if(a.zulu)i+="Z";else if(a.selector!="time"){d=d.getTimezoneOffset();a=Math.abs(d);i+=(d>0?"-":"+")+c(Math.floor(a/60))+":"+c(a%60)}f.push(i)}return f.join("T")};return e.date.stamp});
define("dojo/parser",["dojo","dojo/date/stamp"],function(e){e.parser=new (function(){function d(l){if(g.isString(l))return"string";if(typeof l=="number")return"number";if(typeof l=="boolean")return"boolean";if(g.isFunction(l))return"function";if(g.isArray(l))return"array";if(l instanceof Date)return"date";if(l instanceof g._Url)return"url";return"object"}function a(l,h){switch(h){case "string":return l;case "number":return l.length?Number(l):NaN;case "boolean":return typeof l=="boolean"?l:l.toLowerCase()!=
"false";case "function":if(g.isFunction(l)){l=l.toString();l=g.trim(l.substring(l.indexOf("{")+1,l.length-1))}try{return l===""||l.search(/[^\w\.]+/i)!=-1?new Function(l):g.getObject(l,false)||new Function(l)}catch(k){return new Function}case "array":return l?l.split(/\s*,\s*/):[];case "date":switch(l){case "":return new Date("");case "now":return new Date;default:return g.date.stamp.fromISOString(l)}case "url":return g.baseUrl+l;default:return g.fromJson(l)}}function c(l,h){for(var k in l)if(k.charAt(0)!=
"_")k in i||(h[k]=d(l[k]));return h}function f(l,h){var k=j[l];if(k){if(!h&&!k.params)k.params=c(k.cls.prototype,{})}else{l=g.getObject(l);k=null;if(!l)return null;h||(k=c(l.prototype,{}));k={cls:l,params:k}}return k}var g=e,i={},j={};g.connect(g,"extend",function(){j={}});this._functionFromScript=function(l,h){var k="",q="";(h=l.getAttribute(h+"args")||l.getAttribute("args"))&&g.forEach(h.split(/\s*,\s*/),function(u,r){k+="var "+u+" = arguments["+r+"]; "});(h=l.getAttribute("with"))&&h.length&&g.forEach(h.split(/\s*,\s*/),
function(u){k+="with("+u+"){";q+="}"});return new Function(k+l.innerHTML+q)};this.instantiate=function(l,h,k){var q=[];h=h||{};k=k||{};var u=(k.scope||g._scopeName)+"Type",r="data-"+(k.scope||g._scopeName)+"-";g.forEach(l,function(t){if(t){var v,A,x,m,o,p;if(t.node){v=t.node;A=t.type;p=t.fastpath;m=(x=t.clsInfo||A&&f(A,p))&&x.cls;o=t.scripts}else{v=t;o=(m=(x=(A=u in h?h[u]:v.getAttribute(u))&&f(A))&&x.cls)&&(m._noScript||m.prototype._noScript)?[]:g.query("> script[type^='dojo/']",v)}if(!x)throw new Error("Could not load class '"+
A);var n={};k.defaults&&g._mixin(n,k.defaults);t.inherited&&g._mixin(n,t.inherited);if(p){if((x=v.getAttribute(r+"props"))&&x.length)try{x=g.fromJson.call(k.propsThis,"{"+x+"}");g._mixin(n,x)}catch(s){throw new Error(s.toString()+" in data-dojo-props='"+x+"'");}if(x=v.getAttribute(r+"attach-point"))n.dojoAttachPoint=x;if(x=v.getAttribute(r+"attach-event"))n.dojoAttachEvent=x;e.mixin(n,h)}else{t=v.attributes;for(var y in x.params){A=y in h?{value:h[y],specified:true}:t.getNamedItem(y);if(!(!A||!A.specified&&
(!e.isIE||y.toLowerCase()!="value"))){A=A.value;switch(y){case "class":A="className"in h?h.className:v.className;break;case "style":A="style"in h?h.style:v.style&&v.style.cssText}var w=x.params[y];n[y]=typeof A=="string"?a(A,w):A}}}var z=[],B=[];g.forEach(o,function(E){v.removeChild(E);var F=E.getAttribute(r+"event")||E.getAttribute("event"),I=E.getAttribute("type");E=g.parser._functionFromScript(E,r);if(F)if(I=="dojo/connect")z.push({event:F,func:E});else n[F]=E;else B.push(E)});var D=(o=m.markupFactory||
m.prototype&&m.prototype.markupFactory)?o(n,v,m):new m(n,v);q.push(D);(m=v.getAttribute(r+"id")||v.getAttribute("jsId"))&&g.setObject(m,D);g.forEach(z,function(E){g.connect(D,E.event,null,E.func)});g.forEach(B,function(E){E.call(D)})}});h._started||g.forEach(q,function(t){if(!k.noStart&&t&&e.isFunction(t.startup)&&!t._started&&(!t.getParent||!t.getParent()))t.startup()});return q};this.parse=function(l,h){function k(v,A){var x=e.clone(v.inherited);e.forEach(["dir","lang"],function(y){var w=v.node.getAttribute(y);
if(w)x[y]=w});for(var m=v.clsInfo&&!v.clsInfo.cls.prototype._noScript?v.scripts:null,o=!v.clsInfo||!v.clsInfo.cls.prototype.stopParser||h&&h.template,p=v.node.firstChild;p;p=p.nextSibling)if(p.nodeType==1){var n,s=o&&p.getAttribute(u+"type");n=s?s:o&&p.getAttribute(q);s=s==n;if(n){n={type:n,fastpath:s,clsInfo:f(n,s),node:p,scripts:[],inherited:x};A.push(n);k(n,A)}else if(m&&p.nodeName.toLowerCase()=="script")(n=p.getAttribute("type"))&&/^dojo\/\w/i.test(n)&&m.push(p);else o&&k({node:p,inherited:x},
A)}}if(!h&&l&&l.rootNode){h=l;l=h.rootNode}else l=l;l=l?e.byId(l):e.body();h=h||{};var q=(h.scope||g._scopeName)+"Type",u="data-"+(h.scope||g._scopeName)+"-",r={};if(h&&h.inherited)for(var t in h.inherited)if(h.inherited[t])r[t]=h.inherited[t];t=[];k({node:l,inherited:r},t);return this.instantiate(t,h&&h.template?{template:true}:null,h)}});(function(){var d=function(){e.config.parseOnLoad&&e.parser.parse()};e.getObject("dijit.wai.onload")===e._loaders[0]?e._loaders.splice(1,0,d):e._loaders.unshift(d)})();
return e.parser});
define("dojo/cache",["dojo"],function(e){var d={};e.cache=function(a,c,f){if(typeof a=="string")var g=e.moduleUrl(a,c);else{g=a;f=c}g=g.toString();var i=f;if(f!=undefined&&!e.isString(f))i="value"in f?f.value:undefined;f=f&&f.sanitize?true:false;if(typeof i=="string")i=d[g]=f?e.cache._sanitize(i):i;else if(i===null)delete d[g];else{if(!(g in d)){i=undefined;if(e.isFunction(require)&&e.isString(a))try{var j=(a?a.replace(/\./g,"/")+"/":"")+c;i=require("text!"+j)}catch(l){}if(typeof i==="undefined")i=
e._getText(g);d[g]=f?e.cache._sanitize(i):i}i=d[g]}return i};e.cache._sanitize=function(a){if(a){a=a.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,"");var c=a.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(c)a=c[1]}else a="";return a};return e.cache});
define("dijit/_Templated",["dojo","dijit","dijit/_Widget","dojo/string","dojo/parser","dojo/cache"],function(e,d){e.declare("dijit._Templated",null,{templateString:null,templatePath:null,widgetsInTemplate:false,_skipNodeCache:false,_earlyTemplatedStartup:false,constructor:function(){this._attachPoints=[];this._attachEvents=[]},_stringRepl:function(a){var c=this.declaredClass,f=this;return e.string.substitute(a,this,function(g,i){if(i.charAt(0)=="!")g=e.getObject(i.substr(1),false,f);if(typeof g==
"undefined")throw new Error(c+" template:"+i);if(g==null)return"";return i.charAt(0)=="!"?g:g.toString().replace(/"/g,"&quot;")},this)},buildRendering:function(){var a=d._Templated.getCachedTemplate(this.templatePath,this.templateString,this._skipNodeCache),c;if(e.isString(a)){c=e._toDom(this._stringRepl(a));if(c.nodeType!=1)throw new Error("Invalid template: "+a);}else c=a.cloneNode(true);this.domNode=c;this.inherited(arguments);this._attachTemplateNodes(c);if(this.widgetsInTemplate){a=this._startupWidgets=
e.parser.parse(c,{noStart:!this._earlyTemplatedStartup,template:true,inherited:{dir:this.dir,lang:this.lang},propsThis:this,scope:"dojo"});this._supportingWidgets=d.findWidgets(c);this._attachTemplateNodes(a,function(f,g){return f[g]})}this._fillContent(this.srcNodeRef)},_fillContent:function(a){var c=this.containerNode;if(a&&c)for(;a.hasChildNodes();)c.appendChild(a.firstChild)},_attachTemplateNodes:function(a,c){c=c||function(q,u){return q.getAttribute(u)};for(var f=e.isArray(a)?a:a.all||a.getElementsByTagName("*"),
g=e.isArray(a)?0:-1;g<f.length;g++){var i=g==-1?a:f[g];if(!(this.widgetsInTemplate&&(c(i,"dojoType")||c(i,"data-dojo-type")))){var j=c(i,"dojoAttachPoint")||c(i,"data-dojo-attach-point");if(j)for(var l=j.split(/\s*,\s*/);j=l.shift();){if(e.isArray(this[j]))this[j].push(i);else this[j]=i;this._attachPoints.push(j)}if(j=c(i,"dojoAttachEvent")||c(i,"data-dojo-attach-event")){l=j.split(/\s*,\s*/);for(var h=e.trim;j=l.shift();)if(j){var k=null;if(j.indexOf(":")!=-1){k=j.split(":");j=h(k[0]);k=h(k[1])}else j=
h(j);k||(k=j);this._attachEvents.push(this.connect(i,j,k))}}(j=c(i,"waiRole"))&&d.setWaiRole(i,j);(j=c(i,"waiState"))&&e.forEach(j.split(/\s*,\s*/),function(q){if(q.indexOf("-")!=-1){q=q.split("-");d.setWaiState(i,q[0],q[1])}})}}},startup:function(){e.forEach(this._startupWidgets,function(a){a&&!a._started&&a.startup&&a.startup()});this.inherited(arguments)},destroyRendering:function(){e.forEach(this._attachPoints,function(a){delete this[a]},this);this._attachPoints=[];e.forEach(this._attachEvents,
this.disconnect,this);this._attachEvents=[];this.inherited(arguments)}});d._Templated._templateCache={};d._Templated.getCachedTemplate=function(a,c,f){var g=d._Templated._templateCache,i=c||a,j=g[i];if(j){try{if(!j.ownerDocument||j.ownerDocument==e.doc)return j}catch(l){}e.destroy(j)}c||(c=e.cache(a,{sanitize:true}));c=e.string.trim(c);if(f||c.match(/\$\{([^\}]+)\}/g))return g[i]=c;else{a=e._toDom(c);if(a.nodeType!=1)throw new Error("Invalid template: "+c);return g[i]=a}};e.isIE&&e.addOnWindowUnload(function(){var a=
d._Templated._templateCache;for(var c in a){var f=a[c];typeof f=="object"&&e.destroy(f);delete a[c]}});e.extend(d._Widget,{dojoAttachEvent:"",dojoAttachPoint:"",waiRole:"",waiState:""});return d._Templated});
define("dijit/_CssStateMixin",["dojo","dijit"],function(e,d){e.declare("dijit._CssStateMixin",[],{cssStateNodes:{},hovering:false,active:false,_applyAttributes:function(){this.inherited(arguments);e.forEach(["onmouseenter","onmouseleave","onmousedown"],function(c){this.connect(this.domNode,c,"_cssMouseEvent")},this);e.forEach(["disabled","readOnly","checked","selected","focused","state","hovering","active"],function(c){this.watch(c,e.hitch(this,"_setStateClass"))},this);for(var a in this.cssStateNodes)this._trackMouseState(this[a],
this.cssStateNodes[a]);this._setStateClass()},_cssMouseEvent:function(a){if(!this.disabled)switch(a.type){case "mouseenter":case "mouseover":this._set("hovering",true);this._set("active",this._mouseDown);break;case "mouseleave":case "mouseout":this._set("hovering",false);this._set("active",false);break;case "mousedown":this._set("active",true);this._mouseDown=true;var c=this.connect(e.body(),"onmouseup",function(){this._mouseDown=false;this._set("active",false);this.disconnect(c)});break}},_setStateClass:function(){function a(l){c=
c.concat(e.map(c,function(h){return h+l}),"dijit"+l)}var c=this.baseClass.split(" ");this.isLeftToRight()||a("Rtl");this.checked&&a("Checked");this.state&&a(this.state);this.selected&&a("Selected");if(this.disabled)a("Disabled");else if(this.readOnly)a("ReadOnly");else if(this.active)a("Active");else this.hovering&&a("Hover");this._focused&&a("Focused");var f=this.stateNode||this.domNode,g={};e.forEach(f.className.split(" "),function(l){g[l]=true});"_stateClasses"in this&&e.forEach(this._stateClasses,
function(l){delete g[l]});e.forEach(c,function(l){g[l]=true});var i=[];for(var j in g)i.push(j);f.className=i.join(" ");this._stateClasses=c},_trackMouseState:function(a,c){function f(){var k="disabled"in l&&l.disabled||"readonly"in l&&l.readonly;e.toggleClass(a,c+"Hover",g&&!i&&!k);e.toggleClass(a,c+"Active",i&&!k);e.toggleClass(a,c+"Focused",j&&!k)}var g=false,i=false,j=false,l=this,h=e.hitch(this,"connect",a);h("onmouseenter",function(){g=true;f()});h("onmouseleave",function(){i=g=false;f()});
h("onmousedown",function(){i=true;f()});h("onmouseup",function(){i=false;f()});h("onfocus",function(){j=true;f()});h("onblur",function(){j=false;f()});this.watch("disabled",f);this.watch("readOnly",f)}});return d._CssStateMixin});
define("dijit/form/_FormWidget",["dojo","dijit","dojo/window","dijit/_Widget","dijit/_Templated","dijit/_CssStateMixin"],function(e,d){e.declare("dijit.form._FormWidget",[d._Widget,d._Templated,d._CssStateMixin],{name:"",alt:"",value:"",type:"text",tabIndex:"0",disabled:false,intermediateChanges:false,scrollOnFocus:true,attributeMap:e.delegate(d._Widget.prototype.attributeMap,{value:"focusNode",id:"focusNode",tabIndex:"focusNode",alt:"focusNode",title:"focusNode"}),postMixInProperties:function(){this.nameAttrSetting=
this.name?'name="'+this.name.replace(/'/g,"&quot;")+'"':"";this.inherited(arguments)},postCreate:function(){this.inherited(arguments);this.connect(this.domNode,"onmousedown","_onMouseDown")},_setDisabledAttr:function(a){this._set("disabled",a);e.attr(this.focusNode,"disabled",a);this.valueNode&&e.attr(this.valueNode,"disabled",a);d.setWaiState(this.focusNode,"disabled",a);if(a){this._set("hovering",false);this._set("active",false);a="tabIndex"in this.attributeMap?this.attributeMap.tabIndex:"focusNode";
e.forEach(e.isArray(a)?a:[a],function(c){c=this[c];e.isWebKit||d.hasDefaultTabStop(c)?c.setAttribute("tabIndex","-1"):c.removeAttribute("tabIndex")},this)}else this.tabIndex!=""&&this.focusNode.setAttribute("tabIndex",this.tabIndex)},setDisabled:function(a){e.deprecated("setDisabled("+a+") is deprecated. Use set('disabled',"+a+") instead.","","2.0");this.set("disabled",a)},_onFocus:function(){this.scrollOnFocus&&e.window.scrollIntoView(this.domNode);this.inherited(arguments)},isFocusable:function(){return!this.disabled&&
this.focusNode&&e.style(this.domNode,"display")!="none"},focus:function(){this.disabled||d.focus(this.focusNode)},compare:function(a,c){return typeof a=="number"&&typeof c=="number"?isNaN(a)&&isNaN(c)?0:a-c:a>c?1:a<c?-1:0},onChange:function(){},_onChangeActive:false,_handleOnChange:function(a,c){if(this._lastValueReported==undefined&&(c===null||!this._onChangeActive))this._resetValue=this._lastValueReported=a;this._pendingOnChange=this._pendingOnChange||typeof a!=typeof this._lastValueReported||this.compare(a,
this._lastValueReported)!=0;if((this.intermediateChanges||c||c===undefined)&&this._pendingOnChange){this._lastValueReported=a;this._pendingOnChange=false;if(this._onChangeActive){this._onChangeHandle&&clearTimeout(this._onChangeHandle);this._onChangeHandle=setTimeout(e.hitch(this,function(){this._onChangeHandle=null;this.onChange(a)}),0)}}},create:function(){this.inherited(arguments);this._onChangeActive=true},destroy:function(){if(this._onChangeHandle){clearTimeout(this._onChangeHandle);this.onChange(this._lastValueReported)}this.inherited(arguments)},
setValue:function(a){e.deprecated("dijit.form._FormWidget:setValue("+a+") is deprecated.  Use set('value',"+a+") instead.","","2.0");this.set("value",a)},getValue:function(){e.deprecated(this.declaredClass+"::getValue() is deprecated. Use get('value') instead.","","2.0");return this.get("value")},_onMouseDown:function(a){if(!a.ctrlKey&&e.mouseButtons.isLeft(a)&&this.isFocusable())var c=this.connect(e.body(),"onmouseup",function(){this.isFocusable()&&this.focus();this.disconnect(c)})}});e.declare("dijit.form._FormValueWidget",
d.form._FormWidget,{readOnly:false,attributeMap:e.delegate(d.form._FormWidget.prototype.attributeMap,{value:"",readOnly:"focusNode"}),_setReadOnlyAttr:function(a){e.attr(this.focusNode,"readOnly",a);d.setWaiState(this.focusNode,"readonly",a);this._set("readOnly",a)},postCreate:function(){this.inherited(arguments);if(e.isIE<9||e.isIE&&e.isQuirks)this.connect(this.focusNode||this.domNode,"onkeydown",this._onKeyDown);if(this._resetValue===undefined)this._lastValueReported=this._resetValue=this.value},
_setValueAttr:function(a,c){this._handleOnChange(a,c)},_handleOnChange:function(a){this._set("value",a);this.inherited(arguments)},undo:function(){this._setValueAttr(this._lastValueReported,false)},reset:function(){this._hasBeenBlurred=false;this._setValueAttr(this._resetValue,true)},_onKeyDown:function(a){if(a.keyCode==e.keys.ESCAPE&&!(a.ctrlKey||a.altKey||a.metaKey)){var c;if(e.isIE){a.preventDefault();c=document.createEventObject();c.keyCode=e.keys.ESCAPE;c.shiftKey=a.shiftKey;a.srcElement.fireEvent("onkeypress",
c)}}},_layoutHackIE7:function(){if(e.isIE==7)for(var a=this.domNode,c=a.parentNode,f=a.firstChild||a,g=f.style.filter,i=this;c&&c.clientHeight==0;){(function(){var j=i.connect(c,"onscroll",function(){i.disconnect(j);f.style.filter=(new Date).getMilliseconds();setTimeout(function(){f.style.filter=g},0)})})();c=c.parentNode}}});return d.form._FormWidget});
define("dijit/form/TextBox",["dojo","dijit","text!dijit/form/templates/TextBox.html","dijit/form/_FormWidget"],function(e,d){e.declare("dijit.form.TextBox",d.form._FormValueWidget,{trim:false,uppercase:false,lowercase:false,propercase:false,maxLength:"",selectOnClick:false,placeHolder:"",templateString:e.cache("dijit.form","templates/TextBox.html"),_singleNodeTemplate:'<input class="dijit dijitReset dijitLeft dijitInputField" dojoAttachPoint="textbox,focusNode" autocomplete="off" type="${type}" ${!nameAttrSetting} />',
_buttonInputDisabled:e.isIE?"disabled":"",baseClass:"dijitTextBox",attributeMap:e.delegate(d.form._FormValueWidget.prototype.attributeMap,{maxLength:"focusNode"}),postMixInProperties:function(){var a=this.type.toLowerCase();if(this.templateString&&this.templateString.toLowerCase()=="input"||(a=="hidden"||a=="file")&&this.templateString==d.form.TextBox.prototype.templateString)this.templateString=this._singleNodeTemplate;this.inherited(arguments)},_setPlaceHolderAttr:function(a){this._set("placeHolder",
a);if(!this._phspan){this._attachPoints.push("_phspan");this._phspan=e.create("span",{className:"dijitPlaceHolder dijitInputField"},this.textbox,"after")}this._phspan.innerHTML="";this._phspan.appendChild(document.createTextNode(a));this._updatePlaceHolder()},_updatePlaceHolder:function(){if(this._phspan)this._phspan.style.display=this.placeHolder&&!this._focused&&!this.textbox.value?"":"none"},_getValueAttr:function(){return this.parse(this.get("displayedValue"),this.constraints)},_setValueAttr:function(a,
c,f){var g;if(a!==undefined){g=this.filter(a);if(typeof f!="string")f=g!==null&&(typeof g!="number"||!isNaN(g))?this.filter(this.format(g,this.constraints)):""}if(f!=null&&f!=undefined&&(typeof f!="number"||!isNaN(f))&&this.textbox.value!=f){this.textbox.value=f;this._set("displayedValue",this.get("displayedValue"))}this._updatePlaceHolder();this.inherited(arguments,[g,c])},displayedValue:"",getDisplayedValue:function(){e.deprecated(this.declaredClass+"::getDisplayedValue() is deprecated. Use set('displayedValue') instead.",
"","2.0");return this.get("displayedValue")},_getDisplayedValueAttr:function(){return this.filter(this.textbox.value)},setDisplayedValue:function(a){e.deprecated(this.declaredClass+"::setDisplayedValue() is deprecated. Use set('displayedValue', ...) instead.","","2.0");this.set("displayedValue",a)},_setDisplayedValueAttr:function(a){if(a===null||a===undefined)a="";else if(typeof a!="string")a=String(a);this.textbox.value=a;this._setValueAttr(this.get("value"),undefined);this._set("displayedValue",
this.get("displayedValue"))},format:function(a){return a==null||a==undefined?"":a.toString?a.toString():a},parse:function(a){return a},_refreshState:function(){},_onInput:function(a){if(a&&a.type&&/key/i.test(a.type)&&a.keyCode)switch(a.keyCode){case e.keys.SHIFT:case e.keys.ALT:case e.keys.CTRL:case e.keys.TAB:return}if(this.intermediateChanges){var c=this;setTimeout(function(){c._handleOnChange(c.get("value"),false)},0)}this._refreshState();this._set("displayedValue",this.get("displayedValue"))},
postCreate:function(){e.isIE&&setTimeout(e.hitch(this,function(){var a=e.getComputedStyle(this.domNode);if(a)if(a=a.fontFamily){var c=this.domNode.getElementsByTagName("INPUT");if(c)for(var f=0;f<c.length;f++)c[f].style.fontFamily=a}}),0);this.textbox.setAttribute("value",this.textbox.value);this.inherited(arguments);if(e.isMoz||e.isOpera)this.connect(this.textbox,"oninput","_onInput");else{this.connect(this.textbox,"onkeydown","_onInput");this.connect(this.textbox,"onkeyup","_onInput");this.connect(this.textbox,
"onpaste","_onInput");this.connect(this.textbox,"oncut","_onInput")}},_blankValue:"",filter:function(a){if(a===null)return this._blankValue;if(typeof a!="string")return a;if(this.trim)a=e.trim(a);if(this.uppercase)a=a.toUpperCase();if(this.lowercase)a=a.toLowerCase();if(this.propercase)a=a.replace(/[^\s]+/g,function(c){return c.substring(0,1).toUpperCase()+c.substring(1)});return a},_setBlurValue:function(){this._setValueAttr(this.get("value"),true)},_onBlur:function(){if(!this.disabled){this._setBlurValue();
this.inherited(arguments);this._selectOnClickHandle&&this.disconnect(this._selectOnClickHandle);if(this.selectOnClick&&e.isMoz)this.textbox.selectionStart=this.textbox.selectionEnd=undefined;this._updatePlaceHolder()}},_onFocus:function(a){if(!(this.disabled||this.readOnly)){if(this.selectOnClick&&a=="mouse")this._selectOnClickHandle=this.connect(this.domNode,"onmouseup",function(){this.disconnect(this._selectOnClickHandle);var c;if(e.isIE){c=e.doc.selection.createRange();c=c.parentElement()==this.textbox&&
c.text.length==0}else c=this.textbox.selectionStart==this.textbox.selectionEnd;c&&d.selectInputText(this.textbox)});this._updatePlaceHolder();this.inherited(arguments);this._refreshState()}},reset:function(){this.textbox.value="";this.inherited(arguments)}});d.selectInputText=function(a,c,f){var g=e.global,i=e.doc;a=e.byId(a);if(isNaN(c))c=0;if(isNaN(f))f=a.value?a.value.length:0;d.focus(a);if(i.selection&&e.body().createTextRange){if(a.createTextRange){a=a.createTextRange();a.collapse(true);a.moveStart("character",
-99999);a.moveStart("character",c);a.moveEnd("character",f-c);a.select()}}else g.getSelection&&a.setSelectionRange&&a.setSelectionRange(c,f)};return d.form.TextBox});define("text!dijit/templates/Tooltip.html",function(){return'<div class="dijitTooltip dijitTooltipLeft" id="dojoTooltip"\n\t><div class="dijitTooltipContainer dijitTooltipContents" dojoAttachPoint="containerNode" role=\'alert\'></div\n\t><div class="dijitTooltipConnector" dojoAttachPoint="connectorNode"></div\n></div>'});
define("dijit/Tooltip",["dojo","dijit","dijit/_Widget","dijit/_Templated","text!dijit/templates/Tooltip.html"],function(e,d){e.declare("dijit._MasterTooltip",[d._Widget,d._Templated],{duration:d.defaultDuration,templateString:e.cache("dijit","templates/Tooltip.html"),postCreate:function(){e.body().appendChild(this.domNode);this.bgIframe=new d.BackgroundIframe(this.domNode);this.fadeIn=e.fadeIn({node:this.domNode,duration:this.duration,onEnd:e.hitch(this,"_onShow")});this.fadeOut=e.fadeOut({node:this.domNode,
duration:this.duration,onEnd:e.hitch(this,"_onHide")})},show:function(a,c,f,g){if(!(this.aroundNode&&this.aroundNode===c)){this.domNode.width="auto";if(this.fadeOut.status()=="playing")this._onDeck=arguments;else{this.containerNode.innerHTML=a;d.placeOnScreenAroundElement(this.domNode,c,d.getPopupAroundAlignment(f&&f.length?f:d.Tooltip.defaultPosition,!g),e.hitch(this,"orient"));e.style(this.domNode,"opacity",0);this.fadeIn.play();this.isShowingNow=true;this.aroundNode=c}}},orient:function(a,c,f,
g,i){this.connectorNode.style.top="";var j=g.w-this.connectorNode.offsetWidth;a.className="dijitTooltip "+{"BL-TL":"dijitTooltipBelow dijitTooltipABLeft","TL-BL":"dijitTooltipAbove dijitTooltipABLeft","BR-TR":"dijitTooltipBelow dijitTooltipABRight","TR-BR":"dijitTooltipAbove dijitTooltipABRight","BR-BL":"dijitTooltipRight","BL-BR":"dijitTooltipLeft"}[c+"-"+f];this.domNode.style.width="auto";var l=e.contentBox(this.domNode),h=Math.min(Math.max(j,1),l.w),k=h<l.w;this.domNode.style.width=h+"px";if(k){this.containerNode.style.overflow=
"auto";k=this.containerNode.scrollWidth;this.containerNode.style.overflow="visible";if(k>h){k=k+e.style(this.domNode,"paddingLeft")+e.style(this.domNode,"paddingRight");this.domNode.style.width=k+"px"}}if(f.charAt(0)=="B"&&c.charAt(0)=="B"){a=e.marginBox(a);c=this.connectorNode.offsetHeight;if(a.h>g.h){this.connectorNode.style.top=g.h-i.h/2-c/2+"px";this.connectorNode.style.bottom=""}else{this.connectorNode.style.bottom=Math.min(Math.max(i.h/2-c/2,0),a.h-c)+"px";this.connectorNode.style.top=""}}else{this.connectorNode.style.top=
"";this.connectorNode.style.bottom=""}return Math.max(0,l.w-j)},_onShow:function(){if(e.isIE)this.domNode.style.filter=""},hide:function(a){if(this._onDeck&&this._onDeck[1]==a)this._onDeck=null;else if(this.aroundNode===a){this.fadeIn.stop();this.isShowingNow=false;this.aroundNode=null;this.fadeOut.play()}},_onHide:function(){this.domNode.style.cssText="";this.containerNode.innerHTML="";if(this._onDeck){this.show.apply(this,this._onDeck);this._onDeck=null}}});d.showTooltip=function(a,c,f,g){if(!d._masterTT)d._masterTT=
new d._MasterTooltip;return d._masterTT.show(a,c,f,g)};d.hideTooltip=function(a){if(!d._masterTT)d._masterTT=new d._MasterTooltip;return d._masterTT.hide(a)};e.declare("dijit.Tooltip",d._Widget,{label:"",showDelay:400,connectId:[],position:[],_setConnectIdAttr:function(a){e.forEach(this._connections||[],function(f){e.forEach(f,e.hitch(this,"disconnect"))},this);var c=e.isArrayLike(a)?a:a?[a]:[];this._connections=e.map(c,function(f){return(f=e.byId(f))?[this.connect(f,"onmouseenter","_onTargetMouseEnter"),
this.connect(f,"onmouseleave","_onTargetMouseLeave"),this.connect(f,"onfocus","_onTargetFocus"),this.connect(f,"onblur","_onTargetBlur")]:[]},this);this._set("connectId",a);this._connectIds=c},addTarget:function(a){a=a.id||a;e.indexOf(this._connectIds,a)==-1&&this.set("connectId",this._connectIds.concat(a))},removeTarget:function(a){a=e.indexOf(this._connectIds,a.id||a);if(a>=0){this._connectIds.splice(a,1);this.set("connectId",this._connectIds)}},buildRendering:function(){this.inherited(arguments);
e.addClass(this.domNode,"dijitTooltipData")},startup:function(){this.inherited(arguments);var a=this.connectId;e.forEach(e.isArrayLike(a)?a:[a],this.addTarget,this)},_onTargetMouseEnter:function(a){this._onHover(a)},_onTargetMouseLeave:function(a){this._onUnHover(a)},_onTargetFocus:function(a){this._focus=true;this._onHover(a)},_onTargetBlur:function(a){this._focus=false;this._onUnHover(a)},_onHover:function(a){if(!this._showTimer){var c=a.target;this._showTimer=setTimeout(e.hitch(this,function(){this.open(c)}),
this.showDelay)}},_onUnHover:function(){if(!this._focus){if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer}this.close()}},open:function(a){if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer}d.showTooltip(this.label||this.domNode.innerHTML,a,this.position,!this.isLeftToRight());this._connectNode=a;this.onShow(a,this.position)},close:function(){if(this._connectNode){d.hideTooltip(this._connectNode);delete this._connectNode;this.onHide()}if(this._showTimer){clearTimeout(this._showTimer);
delete this._showTimer}},onShow:function(){},onHide:function(){},uninitialize:function(){this.close();this.inherited(arguments)}});d.Tooltip.defaultPosition=["after","before"];return d.Tooltip});
(function(){function e(c,f,g,i,j,l){if(f[c]){g.push(c);if(f[c]===true||f[c]===1)i.push(j+c+"/"+l)}}function d(c,f,g,i,j){f=i+f+"/"+j;require._fileExists(c.nameToUrl(f,null))&&g.push(f)}var a=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",{version:"0.24.0",load:function(c,f,g,i){i=i||{};var j=a.exec(c),l=j[1],h=j[4],k=j[5],q=h.split("-"),u=[],r={},t,v,A="";if(j[5]){l=j[1];c=l+k}else{c=c;k=j[4];h=i.locale||(i.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||
"root").toLowerCase());q=h.split("-")}if(i.isBuild){u.push(c);d(f,"root",u,l,k);for(t=0;v=q[t];t++){A+=(A?"-":"")+v;d(f,A,u,l,k)}f(u);g()}else f([c],function(x){var m=[];e("root",x,m,u,l,k);for(t=0;v=q[t];t++){A+=(A?"-":"")+v;e(A,x,m,u,l,k)}f(u,function(){var o,p;for(o=m.length-1;o>-1&&(v=m[o]);o--){p=x[v];if(p===true||p===1)p=f(l+v+"/"+k);require.mixin(r,p)}g(r)})})}})})();
define("dijit/form/nls/validate",{root:{invalidMessage:"The value entered is not valid.",missingMessage:"This value is required.",rangeMessage:"This value is out of range."},zh:true,"zh-tw":true,tr:true,th:true,sv:true,sl:true,sk:true,ru:true,ro:true,pt:true,"pt-pt":true,pl:true,nl:true,nb:true,ko:true,kk:true,ja:true,it:true,hu:true,he:true,fr:true,fi:true,es:true,el:true,de:true,da:true,cs:true,ca:true,ar:true});
define("dijit/form/ValidationTextBox",["dojo","dijit","text!dijit/form/templates/ValidationTextBox.html","dojo/i18n","dijit/form/TextBox","dijit/Tooltip","i18n!dijit/form/nls/validate"],function(e,d){e.declare("dijit.form.ValidationTextBox",d.form.TextBox,{templateString:e.cache("dijit.form","templates/ValidationTextBox.html"),baseClass:"dijitTextBox dijitValidationTextBox",required:false,promptMessage:"",invalidMessage:"$_unset_$",missingMessage:"$_unset_$",message:"",constraints:{},regExp:".*",
regExpGen:function(){return this.regExp},state:"",tooltipPosition:[],_setValueAttr:function(){this.inherited(arguments);this.validate(this._focused)},validator:function(a,c){return(new RegExp("^(?:"+this.regExpGen(c)+")"+(this.required?"":"?")+"$")).test(a)&&(!this.required||!this._isEmpty(a))&&(this._isEmpty(a)||this.parse(a,c)!==undefined)},_isValidSubset:function(){return this.textbox.value.search(this._partialre)==0},isValid:function(){return this.validator(this.textbox.value,this.constraints)},
_isEmpty:function(a){return(this.trim?/^\s*$/:/^$/).test(a)},getErrorMessage:function(){return this.required&&this._isEmpty(this.textbox.value)?this.missingMessage:this.invalidMessage},getPromptMessage:function(){return this.promptMessage},_maskValidSubsetError:true,validate:function(a){var c="",f=this.disabled||this.isValid(a);if(f)this._maskValidSubsetError=true;var g=this._isEmpty(this.textbox.value),i=!f&&a&&this._isValidSubset();this._set("state",f?"":((!this._hasBeenBlurred||a)&&g||i)&&this._maskValidSubsetError?
"Incomplete":"Error");d.setWaiState(this.focusNode,"invalid",f?"false":"true");if(this.state=="Error"){this._maskValidSubsetError=a&&i;c=this.getErrorMessage(a)}else if(this.state=="Incomplete"){c=this.getPromptMessage(a);this._maskValidSubsetError=!this._hasBeenBlurred||a}else if(g)c=this.getPromptMessage(a);this.set("message",c);return f},displayMessage:function(a){d.hideTooltip(this.domNode);a&&this._focused&&d.showTooltip(a,this.domNode,this.tooltipPosition,!this.isLeftToRight())},_refreshState:function(){this.validate(this._focused);
this.inherited(arguments)},constructor:function(){this.constraints={}},_setConstraintsAttr:function(a){if(!a.locale&&this.lang)a.locale=this.lang;this._set("constraints",a);this._computePartialRE()},_computePartialRE:function(){var a=this.regExpGen(this.constraints);this.regExp=a;var c="";a!=".*"&&this.regExp.replace(/\\.|\[\]|\[.*?[^\\]{1}\]|\{.*?\}|\(\?[=:!]|./g,function(g){switch(g.charAt(0)){case "{":case "+":case "?":case "*":case "^":case "$":case "|":case "(":c+=g;break;case ")":c+="|$)";break;
default:c+="(?:"+g+"|$)";break}});try{"".search(c)}catch(f){c=this.regExp;console.warn("RegExp error in "+this.declaredClass+": "+this.regExp)}this._partialre="^(?:"+c+")$"},postMixInProperties:function(){this.inherited(arguments);this.messages=e.i18n.getLocalization("dijit.form","validate",this.lang);if(this.invalidMessage=="$_unset_$")this.invalidMessage=this.messages.invalidMessage;if(!this.invalidMessage)this.invalidMessage=this.promptMessage;if(this.missingMessage=="$_unset_$")this.missingMessage=
this.messages.missingMessage;if(!this.missingMessage)this.missingMessage=this.invalidMessage;this._setConstraintsAttr(this.constraints)},_setDisabledAttr:function(){this.inherited(arguments);this._refreshState()},_setRequiredAttr:function(a){this._set("required",a);d.setWaiState(this.focusNode,"required",a);this._refreshState()},_setMessageAttr:function(a){this._set("message",a);this.displayMessage(a)},reset:function(){this._maskValidSubsetError=true;this.inherited(arguments)},_onBlur:function(){this.displayMessage("");
this.inherited(arguments)}});e.declare("dijit.form.MappedTextBox",d.form.ValidationTextBox,{postMixInProperties:function(){this.inherited(arguments);this.nameAttrSetting=""},serialize:function(a){return a.toString?a.toString():""},toString:function(){var a=this.filter(this.get("value"));return a!=null?typeof a=="string"?a:this.serialize(a,this.constraints):""},validate:function(){this.valueNode.value=this.toString();return this.inherited(arguments)},buildRendering:function(){this.inherited(arguments);
this.valueNode=e.place("<input type='hidden'"+(this.name?" name='"+this.name.replace(/'/g,"&quot;")+"'":"")+"/>",this.textbox,"after")},reset:function(){this.valueNode.value="";this.inherited(arguments)}});e.declare("dijit.form.RangeBoundTextBox",d.form.MappedTextBox,{rangeMessage:"",rangeCheck:function(a,c){return("min"in c?this.compare(a,c.min)>=0:true)&&("max"in c?this.compare(a,c.max)<=0:true)},isInRange:function(){return this.rangeCheck(this.get("value"),this.constraints)},_isDefinitelyOutOfRange:function(){var a=
this.get("value"),c=false,f=false;if("min"in this.constraints){c=this.constraints.min;c=this.compare(a,typeof c=="number"&&c>=0&&a!=0?0:c);c=typeof c=="number"&&c<0}if("max"in this.constraints){f=this.constraints.max;f=this.compare(a,typeof f!="number"||f>0?f:0);f=typeof f=="number"&&f>0}return c||f},_isValidSubset:function(){return this.inherited(arguments)&&!this._isDefinitelyOutOfRange()},isValid:function(a){return this.inherited(arguments)&&(this._isEmpty(this.textbox.value)&&!this.required||
this.isInRange(a))},getErrorMessage:function(a){var c=this.get("value");if(c!==null&&c!==""&&c!==undefined&&(typeof c!="number"||!isNaN(c))&&!this.isInRange(a))return this.rangeMessage;return this.inherited(arguments)},postMixInProperties:function(){this.inherited(arguments);if(!this.rangeMessage){this.messages=e.i18n.getLocalization("dijit.form","validate",this.lang);this.rangeMessage=this.messages.rangeMessage}},_setConstraintsAttr:function(){this.inherited(arguments);if(this.focusNode){this.constraints.min!==
undefined?d.setWaiState(this.focusNode,"valuemin",this.constraints.min):d.removeWaiState(this.focusNode,"valuemin");this.constraints.max!==undefined?d.setWaiState(this.focusNode,"valuemax",this.constraints.max):d.removeWaiState(this.focusNode,"valuemax")}},_setValueAttr:function(a){d.setWaiState(this.focusNode,"valuenow",a);this.inherited(arguments)}});return d.form.ValidationTextBox});
define("orion/util",["dojo","dijit","dojo/hash","dijit/form/ValidationTextBox"],function(e,d){function a(n){p=n}function c(){return p}function f(n){var s="",y=navigator.platform.indexOf("Mac")!==-1;if(n.mod1)s+=y?"Cmd+":"Ctrl+";if(n.mod2)s+="Shift+";if(n.mod3)s+="Alt+";if(n.alphaKey)return s+n.alphaKey;for(var w in e.keys)if(typeof(e.keys[w]==="number"))if(e.keys[w]===n.keyCode)return s+w;var z;switch(n.keyCode){case 59:z=n.mod2?":":";";break;case 61:z=n.mod2?"+":"=";break;case 188:z=n.mod2?"<":",";
break;case 190:z=n.mod2?">":".";break;case 191:z=n.mod2?"?":"/";break;case 192:z=n.mod2?"~":"`";break;case 219:z=n.mod2?"{":"[";break;case 220:z=n.mod2?"|":"\\";break;case 221:z=n.mod2?"}":"]";break;case 222:z=n.mod2?'"':"'";break}if(z)return s+z;return s+String.fromCharCode(n.keyCode)}function g(n,s){n.startup();if(typeof s==="string"){var y=e.byId(s);if(!y)if(y=d.byId(s))y=y.domNode;s=y?y:null}if(s){s=e.position(s);n._setStyleAttr("left:"+(s.x+16)+"px !important;");n._setStyleAttr("top:"+(s.y+16)+
"px !important;")}n.show()}function i(n,s,y,w,z,B,D,E,F){D=function(L){return function(M){var R=d.byId(n),Q=R.get("value");if(L&&M.keyCode===e.keys.ESCAPE){y&&e.style(s,"display","inline");R.destroyRecursive();B&&B()}else if(!(L&&M.keyCode!==e.keys.ENTER)){if(!R.isValid()||!F&&Q===w)y&&e.style(s,"display","inline");else z(Q);R.destroyRecursive();B&&B()}}};var I=new d.form.ValidationTextBox({id:n,required:true,value:w||""});e.place(I.domNode,s,"after");e.addClass(I.domNode,"userEditBoxPrompt");y&&
e.style(s,"display","none");e.connect(I,"onKeyDown",D(true));e.connect(I,"onBlur",D(false));window.setTimeout(function(){I.focus();if(w){var L=e.byId(n),M=E?w.indexOf(E):-1;M>0?d.selectInputText(L,0,M):L.select()}},0)}function j(n){var s=window.navigator.platform.indexOf("Mac")!==-1;return s&&n.metaKey||!s&&n.ctrlKey}function l(n,s){if(s&&j(s))window.open(n);else window.location=n}function h(n){if(!n)return n;var s=window.location.href.split("#")[0];s=s.substring(0,s.length-window.location.pathname.length);
if(n.indexOf(s)===0)return n.substring(s.length);return n}function k(n){var s,y,w,z,B;n=n.split("#");var D=n[n.length-1].split(/\?(?=(?:line|char))/);n=h(D[0]);if(D.length>1){D=D[1].split(/\&(?=(?:line|char))/);for(var E=0;E<D.length;E++){var F=D[E].split("=");if(F.length>1)switch(F[0]){case "char":F=F[1].split(",");if(w===undefined){s=window.parseInt(F[0]);if(F.length>1)y=window.parseInt(F[1])}else{z=window.parseInt(F[0]);if(F.length>1)B=window.parseInt(F[1])}break;case "line":F=F[1].split(",");
w=window.parseInt(F[0]);break;default:break}}}return{filePath:n,start:s,end:y,line:w,offset:z,length:B}}function q(n,s,y,w,z,B){if(typeof s==="number"){n="#"+n+"?char="+s;if(typeof y==="number")n=n+","+y;else if(typeof B==="number")n=n+","+(s+B);return n}if(typeof w==="number"){n="#"+n+"?line="+w;if(typeof z==="number"){n=n+"&char="+z;if(typeof B==="number")n=n+","+(z+B)}return n}return"#"+n}function u(n){if(!n)return n;var s=window.location.href.split("#")[0];return s.substring(0,s.length-window.location.pathname.length)+
n}function r(n){return this.makeRelative(n).indexOf("/workspace")===0}function t(n,s){n.children=s;for(var y in s)s[y].parent=n;n.children.sort(function(w,z){var B=w.Directory;if(B!==z.Directory)return B?-1:1;w=w.Name&&w.Name.toLowerCase();z=z.Name&&z.Name.toLowerCase();if(w<z)return-1;if(w>z)return 1;return 0})}function v(n){n.children.sort(function(s,y){var w=s.type==="dir";if(w!==(y.type==="dir"))return w?-1:1;s=s.name&&s.name.toLowerCase();y=y.name&&y.name.toLowerCase();if(s<y)return-1;if(s>y)return 1;
return 0})}function A(n,s){n.Parents&&n.Parents.length===0&&s.getService("orion.core.preference").then(function(y){return y.getPreferences("/window/recent")}).then(function(y){var w=y.get("projects");if(typeof w==="string")w=JSON.parse(w);var z=[];if(w&&w.length&&w.length>0)for(var B=0;B<w.length;B++)w[B].location!==n.ChildrenLocation&&w[B].name!==n.Name&&z.push(w[B]);z.push({name:n.Name,location:n.ChildrenLocation});if(z.length>5)z=z.slice(-5,z.length);y.put("projects",z)})}function x(n){return typeof n.textContent!==
"undefined"?n.textContent:n.innerText}function m(n){return x(document.createTextNode(n))}function o(n,s){if(typeof n.textContent!=="undefined")n.textContent=s;else n.innerText=s}var p=null;return{setUserName:a,getUserName:c,getUserKeyString:f,openDialog:g,getUserText:i,openInNewWindow:j,followLink:l,getPositionInfo:k,hashFromPosition:q,makeRelative:h,makeFullPath:u,isAtRoot:r,processNavigatorParent:t,processSearchResultParent:v,rememberSuccessfulTraversal:A,getText:x,safeText:m,setText:o}});
define("text!dijit/templates/Menu.html",function(){return'<table class="dijit dijitMenu dijitMenuPassive dijitReset dijitMenuTable" role="menu" tabIndex="${tabIndex}" dojoAttachEvent="onkeypress:_onKeyPress" cellspacing="0">\n\t<tbody class="dijitReset" dojoAttachPoint="containerNode"></tbody>\n</table>'});
define("dijit/_Container",["dojo","dijit"],function(e,d){e.declare("dijit._Container",null,{isContainer:true,buildRendering:function(){this.inherited(arguments);if(!this.containerNode)this.containerNode=this.domNode},addChild:function(a,c){var f=this.containerNode;if(c&&typeof c=="number"){var g=this.getChildren();if(g&&g.length>=c){f=g[c-1].domNode;c="after"}}e.place(a.domNode,f,c);this._started&&!a._started&&a.startup()},removeChild:function(a){if(typeof a=="number")a=this.getChildren()[a];if(a)(a=
a.domNode)&&a.parentNode&&a.parentNode.removeChild(a)},hasChildren:function(){return this.getChildren().length>0},destroyDescendants:function(a){e.forEach(this.getChildren(),function(c){c.destroyRecursive(a)})},_getSiblingOfChild:function(a,c){a=a.domNode;c=c>0?"nextSibling":"previousSibling";do a=a[c];while(a&&(a.nodeType!=1||!d.byNode(a)));return a&&d.byNode(a)},getIndexOfChild:function(a){return e.indexOf(this.getChildren(),a)},startup:function(){if(!this._started){e.forEach(this.getChildren(),
function(a){a.startup()});this.inherited(arguments)}}});return d._Container});
define("dijit/_KeyNavContainer",["dojo","dijit","dijit/_Container"],function(e,d){e.declare("dijit._KeyNavContainer",d._Container,{tabIndex:"0",_keyNavCodes:{},connectKeyNavHandlers:function(a,c){var f=this._keyNavCodes={},g=e.hitch(this,this.focusPrev),i=e.hitch(this,this.focusNext);e.forEach(a,function(j){f[j]=g});e.forEach(c,function(j){f[j]=i});f[e.keys.HOME]=e.hitch(this,"focusFirstChild");f[e.keys.END]=e.hitch(this,"focusLastChild");this.connect(this.domNode,"onkeypress","_onContainerKeypress");
this.connect(this.domNode,"onfocus","_onContainerFocus")},startupKeyNavChildren:function(){e.forEach(this.getChildren(),e.hitch(this,"_startupChild"))},addChild:function(a){d._KeyNavContainer.superclass.addChild.apply(this,arguments);this._startupChild(a)},focus:function(){this.focusFirstChild()},focusFirstChild:function(){var a=this._getFirstFocusableChild();a&&this.focusChild(a)},focusLastChild:function(){var a=this._getLastFocusableChild();a&&this.focusChild(a)},focusNext:function(){this.focusChild(this._getNextFocusableChild(this.focusedChild,
1))},focusPrev:function(){this.focusChild(this._getNextFocusableChild(this.focusedChild,-1),true)},focusChild:function(a,c){this.focusedChild&&a!==this.focusedChild&&this._onChildBlur(this.focusedChild);a.set("tabIndex",this.tabIndex);a.focus(c?"end":"start");this._set("focusedChild",a)},_startupChild:function(a){a.set("tabIndex","-1");this.connect(a,"_onFocus",function(){a.set("tabIndex",this.tabIndex)});this.connect(a,"_onBlur",function(){a.set("tabIndex","-1")})},_onContainerFocus:function(a){if(a.target===
this.domNode){this.focusFirstChild();e.attr(this.domNode,"tabIndex","-1")}},_onBlur:function(){this.tabIndex&&e.attr(this.domNode,"tabIndex",this.tabIndex);this.inherited(arguments)},_onContainerKeypress:function(a){if(!(a.ctrlKey||a.altKey)){var c=this._keyNavCodes[a.charOrCode];if(c){c();e.stopEvent(a)}}},_onChildBlur:function(){},_getFirstFocusableChild:function(){return this._getNextFocusableChild(null,1)},_getLastFocusableChild:function(){return this._getNextFocusableChild(null,-1)},_getNextFocusableChild:function(a,
c){if(a)a=this._getSiblingOfChild(a,c);for(var f=this.getChildren(),g=0;g<f.length;g++){a||(a=f[c>0?0:f.length-1]);if(a.isFocusable())return a;a=this._getSiblingOfChild(a,c)}return null}});return d._KeyNavContainer});define("text!dijit/templates/MenuItem.html",function(){return'<tr class="dijitReset dijitMenuItem" dojoAttachPoint="focusNode" role="menuitem" tabIndex="-1"\n\t\tdojoAttachEvent="onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick">\n\t<td class="dijitReset dijitMenuItemIconCell" role="presentation">\n\t\t<img src="${_blankGif}" alt="" class="dijitIcon dijitMenuItemIcon" dojoAttachPoint="iconNode"/>\n\t</td>\n\t<td class="dijitReset dijitMenuItemLabel" colspan="2" dojoAttachPoint="containerNode"></td>\n\t<td class="dijitReset dijitMenuItemAccelKey" style="display: none" dojoAttachPoint="accelKeyNode"></td>\n\t<td class="dijitReset dijitMenuArrowCell" role="presentation">\n\t\t<div dojoAttachPoint="arrowWrapper" style="visibility: hidden">\n\t\t\t<img src="${_blankGif}" alt="" class="dijitMenuExpand"/>\n\t\t\t<span class="dijitMenuExpandA11y">+</span>\n\t\t</div>\n\t</td>\n</tr>'});
define("dijit/_Contained",["dojo","dijit"],function(e,d){e.declare("dijit._Contained",null,{getParent:function(){var a=d.getEnclosingWidget(this.domNode.parentNode);return a&&a.isContainer?a:null},_getSibling:function(a){var c=this.domNode;do c=c[a+"Sibling"];while(c&&c.nodeType!=1);return c&&d.byNode(c)},getPreviousSibling:function(){return this._getSibling("previous")},getNextSibling:function(){return this._getSibling("next")},getIndexInParent:function(){var a=this.getParent();if(!a||!a.getIndexOfChild)return-1;
return a.getIndexOfChild(this)}});return d._Contained});
define("dijit/MenuItem",["dojo","dijit","text!dijit/templates/MenuItem.html","dijit/_Widget","dijit/_Templated","dijit/_Contained","dijit/_CssStateMixin"],function(e,d){e.declare("dijit.MenuItem",[d._Widget,d._Templated,d._Contained,d._CssStateMixin],{templateString:e.cache("dijit","templates/MenuItem.html"),attributeMap:e.delegate(d._Widget.prototype.attributeMap,{label:{node:"containerNode",type:"innerHTML"},iconClass:{node:"iconNode",type:"class"}}),baseClass:"dijitMenuItem",label:"",iconClass:"",
accelKey:"",disabled:false,_fillContent:function(a){a&&!("label"in this.params)&&this.set("label",a.innerHTML)},buildRendering:function(){this.inherited(arguments);var a=this.id+"_text";e.attr(this.containerNode,"id",a);if(this.accelKeyNode){e.attr(this.accelKeyNode,"id",this.id+"_accel");a+=" "+this.id+"_accel"}d.setWaiState(this.domNode,"labelledby",a);e.setSelectable(this.domNode,false)},_onHover:function(){this.getParent().onItemHover(this)},_onUnhover:function(){this.getParent().onItemUnhover(this);
this._set("hovering",false)},_onClick:function(a){this.getParent().onItemClick(this,a);e.stopEvent(a)},onClick:function(){},focus:function(){try{e.isIE==8&&this.containerNode.focus();d.focus(this.focusNode)}catch(a){}},_onFocus:function(){this._setSelected(true);this.getParent()._onItemFocus(this);this.inherited(arguments)},_setSelected:function(a){e.toggleClass(this.domNode,"dijitMenuItemSelected",a)},setLabel:function(a){e.deprecated("dijit.MenuItem.setLabel() is deprecated.  Use set('label', ...) instead.",
"","2.0");this.set("label",a)},setDisabled:function(a){e.deprecated("dijit.Menu.setDisabled() is deprecated.  Use set('disabled', bool) instead.","","2.0");this.set("disabled",a)},_setDisabledAttr:function(a){d.setWaiState(this.focusNode,"disabled",a?"true":"false");this._set("disabled",a)},_setAccelKeyAttr:function(a){this.accelKeyNode.style.display=a?"":"none";this.accelKeyNode.innerHTML=a;e.attr(this.containerNode,"colSpan",a?"1":"2");this._set("accelKey",a)}});return d.MenuItem});
define("dijit/PopupMenuItem",["dojo","dijit","dijit/MenuItem"],function(e,d){e.declare("dijit.PopupMenuItem",d.MenuItem,{_fillContent:function(){if(this.srcNodeRef){var a=e.query("*",this.srcNodeRef);d.PopupMenuItem.superclass._fillContent.call(this,a[0]);this.dropDownContainer=this.srcNodeRef}},startup:function(){if(!this._started){this.inherited(arguments);if(!this.popup){var a=e.query("[widgetId]",this.dropDownContainer)[0];this.popup=d.byNode(a)}e.body().appendChild(this.popup.domNode);this.popup.startup();
this.popup.domNode.style.display="none";this.arrowWrapper&&e.style(this.arrowWrapper,"visibility","");d.setWaiState(this.focusNode,"haspopup","true")}},destroyDescendants:function(){if(this.popup){this.popup._destroyed||this.popup.destroyRecursive();delete this.popup}this.inherited(arguments)}});return d.PopupMenuItem});define("text!dijit/templates/CheckedMenuItem.html",function(){return'<tr class="dijitReset dijitMenuItem" dojoAttachPoint="focusNode" role="menuitemcheckbox" tabIndex="-1"\n\t\tdojoAttachEvent="onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick">\n\t<td class="dijitReset dijitMenuItemIconCell" role="presentation">\n\t\t<img src="${_blankGif}" alt="" class="dijitMenuItemIcon dijitCheckedMenuItemIcon" dojoAttachPoint="iconNode"/>\n\t\t<span class="dijitCheckedMenuItemIconChar">&#10003;</span>\n\t</td>\n\t<td class="dijitReset dijitMenuItemLabel" colspan="2" dojoAttachPoint="containerNode,labelNode"></td>\n\t<td class="dijitReset dijitMenuItemAccelKey" style="display: none" dojoAttachPoint="accelKeyNode"></td>\n\t<td class="dijitReset dijitMenuArrowCell" role="presentation">&nbsp;</td>\n</tr>'});
define("dijit/CheckedMenuItem",["dojo","dijit","text!dijit/templates/CheckedMenuItem.html","dijit/MenuItem"],function(e,d){e.declare("dijit.CheckedMenuItem",d.MenuItem,{templateString:e.cache("dijit","templates/CheckedMenuItem.html"),checked:false,_setCheckedAttr:function(a){e.toggleClass(this.domNode,"dijitCheckedMenuItemChecked",a);d.setWaiState(this.domNode,"checked",a);this._set("checked",a)},onChange:function(){},_onClick:function(){if(!this.disabled){this.set("checked",!this.checked);this.onChange(this.checked)}this.inherited(arguments)}});
return d.CheckedMenuItem});define("text!dijit/templates/MenuSeparator.html",function(){return'<tr class="dijitMenuSeparator">\n\t<td class="dijitMenuSeparatorIconCell">\n\t\t<div class="dijitMenuSeparatorTop"></div>\n\t\t<div class="dijitMenuSeparatorBottom"></div>\n\t</td>\n\t<td colspan="3" class="dijitMenuSeparatorLabelCell">\n\t\t<div class="dijitMenuSeparatorTop dijitMenuSeparatorLabel"></div>\n\t\t<div class="dijitMenuSeparatorBottom"></div>\n\t</td>\n</tr>'});
define("dijit/MenuSeparator",["dojo","dijit","text!dijit/templates/MenuSeparator.html","dijit/_Widget","dijit/_Templated","dijit/_Contained"],function(e,d){e.declare("dijit.MenuSeparator",[d._Widget,d._Templated,d._Contained],{templateString:e.cache("dijit","templates/MenuSeparator.html"),buildRendering:function(){this.inherited(arguments);e.setSelectable(this.domNode,false)},isFocusable:function(){return false}});return d.MenuSeparator});
define("dijit/Menu",["dojo","dijit","text!dijit/templates/Menu.html","dojo/window","dijit/_Widget","dijit/_KeyNavContainer","dijit/_Templated","dijit/MenuItem","dijit/PopupMenuItem","dijit/CheckedMenuItem","dijit/MenuSeparator"],function(e,d){e.declare("dijit._MenuBase",[d._Widget,d._Templated,d._KeyNavContainer],{parentMenu:null,popupDelay:500,startup:function(){if(!this._started){e.forEach(this.getChildren(),function(a){a.startup()});this.startupKeyNavChildren();this.inherited(arguments)}},onExecute:function(){},
onCancel:function(){},_moveToPopup:function(a){if(this.focusedChild&&this.focusedChild.popup&&!this.focusedChild.disabled)this.focusedChild._onClick(a);else(a=this._getTopMenu())&&a._isMenuBar&&a.focusNext()},_onPopupHover:function(){if(this.currentPopup&&this.currentPopup._pendingClose_timer){var a=this.currentPopup.parentMenu;a.focusedChild&&a.focusedChild._setSelected(false);a.focusedChild=this.currentPopup.from_item;a.focusedChild._setSelected(true);this._stopPendingCloseTimer(this.currentPopup)}},
onItemHover:function(a){if(this.isActive){this.focusChild(a);if(this.focusedChild.popup&&!this.focusedChild.disabled&&!this.hover_timer)this.hover_timer=setTimeout(e.hitch(this,"_openPopup"),this.popupDelay)}this.focusedChild&&this.focusChild(a);this._hoveredChild=a},_onChildBlur:function(a){this._stopPopupTimer();a._setSelected(false);var c=a.popup;if(c){this._stopPendingCloseTimer(c);c._pendingClose_timer=setTimeout(function(){c._pendingClose_timer=null;if(c.parentMenu)c.parentMenu.currentPopup=
null;d.popup.close(c)},this.popupDelay)}},onItemUnhover:function(a){this.isActive&&this._stopPopupTimer();if(this._hoveredChild==a)this._hoveredChild=null},_stopPopupTimer:function(){if(this.hover_timer){clearTimeout(this.hover_timer);this.hover_timer=null}},_stopPendingCloseTimer:function(a){if(a._pendingClose_timer){clearTimeout(a._pendingClose_timer);a._pendingClose_timer=null}},_stopFocusTimer:function(){if(this._focus_timer){clearTimeout(this._focus_timer);this._focus_timer=null}},_getTopMenu:function(){for(var a=
this;a.parentMenu;a=a.parentMenu);return a},onItemClick:function(a,c){typeof this.isShowingNow=="undefined"&&this._markActive();this.focusChild(a);if(a.disabled)return false;if(a.popup)this._openPopup();else{this.onExecute();a.onClick(c)}},_openPopup:function(){this._stopPopupTimer();var a=this.focusedChild;if(a){var c=a.popup;if(!c.isShowingNow){if(this.currentPopup){this._stopPendingCloseTimer(this.currentPopup);d.popup.close(this.currentPopup)}c.parentMenu=this;c.from_item=a;var f=this;d.popup.open({parent:this,
popup:c,around:a.domNode,orient:this._orient||(this.isLeftToRight()?{TR:"TL",TL:"TR",BR:"BL",BL:"BR"}:{TL:"TR",TR:"TL",BL:"BR",BR:"BL"}),onCancel:function(){f.focusChild(a);f._cleanUp();a._setSelected(true);f.focusedChild=a},onExecute:e.hitch(this,"_cleanUp")});this.currentPopup=c;c.connect(c.domNode,"onmouseenter",e.hitch(f,"_onPopupHover"));if(c.focus)c._focus_timer=setTimeout(e.hitch(c,function(){this._focus_timer=null;this.focus()}),0)}}},_markActive:function(){this.isActive=true;e.replaceClass(this.domNode,
"dijitMenuActive","dijitMenuPassive")},onOpen:function(){this.isShowingNow=true;this._markActive()},_markInactive:function(){this.isActive=false;e.replaceClass(this.domNode,"dijitMenuPassive","dijitMenuActive")},onClose:function(){this._stopFocusTimer();this._markInactive();this.isShowingNow=false;this.parentMenu=null},_closeChild:function(){this._stopPopupTimer();if(this.currentPopup){d._curFocus&&e.isDescendant(d._curFocus,this.currentPopup.domNode)&&this.focusedChild.focusNode.focus();d.popup.close(this.currentPopup);
this.currentPopup=null}if(this.focusedChild){this.focusedChild._setSelected(false);this.focusedChild._onUnhover();this.focusedChild=null}},_onItemFocus:function(a){this._hoveredChild&&this._hoveredChild!=a&&this._hoveredChild._onUnhover()},_onBlur:function(){this._cleanUp();this.inherited(arguments)},_cleanUp:function(){this._closeChild();typeof this.isShowingNow=="undefined"&&this._markInactive()}});e.declare("dijit.Menu",d._MenuBase,{constructor:function(){this._bindings=[]},templateString:e.cache("dijit",
"templates/Menu.html"),baseClass:"dijitMenu",targetNodeIds:[],contextMenuForWindow:false,leftClickToOpen:false,refocus:true,postCreate:function(){this.contextMenuForWindow?this.bindDomNode(e.body()):e.forEach(this.targetNodeIds,this.bindDomNode,this);var a=e.keys,c=this.isLeftToRight();this._openSubMenuKey=c?a.RIGHT_ARROW:a.LEFT_ARROW;this._closeSubMenuKey=c?a.LEFT_ARROW:a.RIGHT_ARROW;this.connectKeyNavHandlers([a.UP_ARROW],[a.DOWN_ARROW])},_onKeyPress:function(a){if(!(a.ctrlKey||a.altKey))switch(a.charOrCode){case this._openSubMenuKey:this._moveToPopup(a);
e.stopEvent(a);break;case this._closeSubMenuKey:if(this.parentMenu)this.parentMenu._isMenuBar?this.parentMenu.focusPrev():this.onCancel(false);else e.stopEvent(a);break}},_iframeContentWindow:function(a){return e.window.get(this._iframeContentDocument(a))||this._iframeContentDocument(a).__parent__||a.name&&e.doc.frames[a.name]||null},_iframeContentDocument:function(a){return a.contentDocument||a.contentWindow&&a.contentWindow.document||a.name&&e.doc.frames[a.name]&&e.doc.frames[a.name].document||
null},bindDomNode:function(a){a=e.byId(a);var c;if(a.tagName.toLowerCase()=="iframe"){var f=a,g=this._iframeContentWindow(f);c=e.withGlobal(g,e.body)}else c=a==e.body()?e.doc.documentElement:a;var i={node:a,iframe:f};e.attr(a,"_dijitMenu"+this.id,this._bindings.push(i));var j=e.hitch(this,function(l){return[e.connect(l,this.leftClickToOpen?"onclick":"oncontextmenu",this,function(h){e.stopEvent(h);this._scheduleOpen(h.target,f,{x:h.pageX,y:h.pageY})}),e.connect(l,"onkeydown",this,function(h){if(h.shiftKey&&
h.keyCode==e.keys.F10){e.stopEvent(h);this._scheduleOpen(h.target,f)}})]});i.connects=c?j(c):[];if(f){i.onloadHandler=e.hitch(this,function(){var l=this._iframeContentWindow(f);c=e.withGlobal(l,e.body);i.connects=j(c)});f.addEventListener?f.addEventListener("load",i.onloadHandler,false):f.attachEvent("onload",i.onloadHandler)}},unBindDomNode:function(a){var c;try{c=e.byId(a)}catch(f){return}a="_dijitMenu"+this.id;if(c&&e.hasAttr(c,a)){var g=e.attr(c,a)-1,i=this._bindings[g];e.forEach(i.connects,e.disconnect);
var j=i.iframe;if(j)j.removeEventListener?j.removeEventListener("load",i.onloadHandler,false):j.detachEvent("onload",i.onloadHandler);e.removeAttr(c,a);delete this._bindings[g]}},_scheduleOpen:function(a,c,f){if(!this._openTimer)this._openTimer=setTimeout(e.hitch(this,function(){delete this._openTimer;this._openMyself({target:a,iframe:c,coords:f})}),1)},_openMyself:function(a){function c(){k.refocus&&d.focus(q);d.popup.close(k)}var f=a.target,g=a.iframe;if(a=a.coords){if(g){f=e.position(g,true);var i=
this._iframeContentWindow(g);i=e.withGlobal(i,"_docScroll",e);var j=e.getComputedStyle(g),l=e._toPixelValue,h=(e.isIE&&e.isQuirks?0:l(g,j.paddingLeft))+(e.isIE&&e.isQuirks?l(g,j.borderLeftWidth):0);g=(e.isIE&&e.isQuirks?0:l(g,j.paddingTop))+(e.isIE&&e.isQuirks?l(g,j.borderTopWidth):0);a.x+=f.x+h-i.x;a.y+=f.y+g-i.y}}else{a=e.position(f,true);a.x+=10;a.y+=10}var k=this,q=d.getFocus(this);d.popup.open({popup:this,x:a.x,y:a.y,onExecute:c,onCancel:c,orient:this.isLeftToRight()?"L":"R"});this.focus();this._onBlur=
function(){this.inherited("_onBlur",arguments);d.popup.close(this)}},uninitialize:function(){e.forEach(this._bindings,function(a){a&&this.unBindDomNode(a.node)},this);this.inherited(arguments)}});return d.Menu});define("text!dijit/form/templates/Button.html",function(){return'<span class="dijit dijitReset dijitInline"\n\t><span class="dijitReset dijitInline dijitButtonNode"\n\t\tdojoAttachEvent="ondijitclick:_onButtonClick"\n\t\t><span class="dijitReset dijitStretch dijitButtonContents"\n\t\t\tdojoAttachPoint="titleNode,focusNode"\n\t\t\trole="button" aria-labelledby="${id}_label"\n\t\t\t><span class="dijitReset dijitInline dijitIcon" dojoAttachPoint="iconNode"></span\n\t\t\t><span class="dijitReset dijitToggleButtonIconChar">&#x25CF;</span\n\t\t\t><span class="dijitReset dijitInline dijitButtonText"\n\t\t\t\tid="${id}_label"\n\t\t\t\tdojoAttachPoint="containerNode"\n\t\t\t></span\n\t\t></span\n\t></span\n\t><input ${!nameAttrSetting} type="${type}" value="${value}" class="dijitOffScreen" tabIndex="-1"\n\t\tdojoAttachPoint="valueNode"\n/></span>'});
define("text!dijit/form/templates/DropDownButton.html",function(){return'<span class="dijit dijitReset dijitInline"\n\t><span class=\'dijitReset dijitInline dijitButtonNode\'\n\t\tdojoAttachEvent="ondijitclick:_onButtonClick" dojoAttachPoint="_buttonNode"\n\t\t><span class="dijitReset dijitStretch dijitButtonContents"\n\t\t\tdojoAttachPoint="focusNode,titleNode,_arrowWrapperNode"\n\t\t\trole="button" aria-haspopup="true" aria-labelledby="${id}_label"\n\t\t\t><span class="dijitReset dijitInline dijitIcon"\n\t\t\t\tdojoAttachPoint="iconNode"\n\t\t\t></span\n\t\t\t><span class="dijitReset dijitInline dijitButtonText"\n\t\t\t\tdojoAttachPoint="containerNode,_popupStateNode"\n\t\t\t\tid="${id}_label"\n\t\t\t></span\n\t\t\t><span class="dijitReset dijitInline dijitArrowButtonInner"></span\n\t\t\t><span class="dijitReset dijitInline dijitArrowButtonChar">&#9660;</span\n\t\t></span\n\t></span\n\t><input ${!nameAttrSetting} type="${type}" value="${value}" class="dijitOffScreen" tabIndex="-1"\n\t\tdojoAttachPoint="valueNode"\n/></span>'});
define("text!dijit/form/templates/ComboButton.html",function(){return'<table class="dijit dijitReset dijitInline dijitLeft"\n\tcellspacing=\'0\' cellpadding=\'0\' role="presentation"\n\t><tbody role="presentation"><tr role="presentation"\n\t\t><td class="dijitReset dijitStretch dijitButtonNode" dojoAttachPoint="buttonNode" dojoAttachEvent="ondijitclick:_onButtonClick,onkeypress:_onButtonKeyPress"\n\t\t><div id="${id}_button" class="dijitReset dijitButtonContents"\n\t\t\tdojoAttachPoint="titleNode"\n\t\t\trole="button" aria-labelledby="${id}_label"\n\t\t\t><div class="dijitReset dijitInline dijitIcon" dojoAttachPoint="iconNode" role="presentation"></div\n\t\t\t><div class="dijitReset dijitInline dijitButtonText" id="${id}_label" dojoAttachPoint="containerNode" role="presentation"></div\n\t\t></div\n\t\t></td\n\t\t><td id="${id}_arrow" class=\'dijitReset dijitRight dijitButtonNode dijitArrowButton\'\n\t\t\tdojoAttachPoint="_popupStateNode,focusNode,_buttonNode"\n\t\t\tdojoAttachEvent="onkeypress:_onArrowKeyPress"\n\t\t\ttitle="${optionsTitle}"\n\t\t\trole="button" aria-haspopup="true"\n\t\t\t><div class="dijitReset dijitArrowButtonInner" role="presentation"></div\n\t\t\t><div class="dijitReset dijitArrowButtonChar" role="presentation">&#9660;</div\n\t\t></td\n\t\t><td style="display:none !important;"\n\t\t\t><input ${!nameAttrSetting} type="${type}" value="${value}" dojoAttachPoint="valueNode"\n\t\t/></td></tr></tbody\n></table>'});
define("dijit/_HasDropDown",["dojo","dijit","dijit/_Widget"],function(e,d){e.declare("dijit._HasDropDown",null,{_buttonNode:null,_arrowWrapperNode:null,_popupStateNode:null,_aroundNode:null,dropDown:null,autoWidth:true,forceWidth:false,maxHeight:0,dropDownPosition:["below","above"],_stopClickEvents:true,_onDropDownMouseDown:function(a){if(!(this.disabled||this.readOnly)){e.stopEvent(a);this._docHandler=this.connect(e.doc,"onmouseup","_onDropDownMouseUp");this.toggleDropDown()}},_onDropDownMouseUp:function(a){a&&
this._docHandler&&this.disconnect(this._docHandler);var c=this.dropDown,f=false;if(a&&this._opened){var g=e.position(this._buttonNode,true);if(!(a.pageX>=g.x&&a.pageX<=g.x+g.w)||!(a.pageY>=g.y&&a.pageY<=g.y+g.h)){for(g=a.target;g&&!f;)if(e.hasClass(g,"dijitPopup"))f=true;else g=g.parentNode;if(f){g=a.target;if(c.onItemClick){for(var i;g&&!(i=d.byNode(g));)g=g.parentNode;i&&i.onClick&&i.getParent&&i.getParent().onItemClick(i,a)}return}}}this._opened&&c.focus&&c.autoFocus!==false&&window.setTimeout(e.hitch(c,
"focus"),1)},_onDropDownClick:function(a){this._stopClickEvents&&e.stopEvent(a)},buildRendering:function(){this.inherited(arguments);this._buttonNode=this._buttonNode||this.focusNode||this.domNode;this._popupStateNode=this._popupStateNode||this.focusNode||this._buttonNode;var a={after:this.isLeftToRight()?"Right":"Left",before:this.isLeftToRight()?"Left":"Right",above:"Up",below:"Down",left:"Left",right:"Right"}[this.dropDownPosition[0]]||this.dropDownPosition[0]||"Down";e.addClass(this._arrowWrapperNode||
this._buttonNode,"dijit"+a+"ArrowButton")},postCreate:function(){this.inherited(arguments);this.connect(this._buttonNode,"onmousedown","_onDropDownMouseDown");this.connect(this._buttonNode,"onclick","_onDropDownClick");this.connect(this.focusNode,"onkeypress","_onKey");this.connect(this.focusNode,"onkeyup","_onKeyUp")},destroy:function(){if(this.dropDown){this.dropDown._destroyed||this.dropDown.destroyRecursive();delete this.dropDown}this.inherited(arguments)},_onKey:function(a){if(!(this.disabled||
this.readOnly)){var c=this.dropDown,f=a.target;if(c&&this._opened&&c.handleKey)if(c.handleKey(a)===false){e.stopEvent(a);return}if(c&&this._opened&&a.charOrCode==e.keys.ESCAPE){this.closeDropDown();e.stopEvent(a)}else if(!this._opened&&(a.charOrCode==e.keys.DOWN_ARROW||(a.charOrCode==e.keys.ENTER||a.charOrCode==" ")&&((f.tagName||"").toLowerCase()!=="input"||f.type&&f.type.toLowerCase()!=="text"))){this._toggleOnKeyUp=true;e.stopEvent(a)}}},_onKeyUp:function(){if(this._toggleOnKeyUp){delete this._toggleOnKeyUp;
this.toggleDropDown();var a=this.dropDown;a&&a.focus&&setTimeout(e.hitch(a,"focus"),1)}},_onBlur:function(){this.closeDropDown(d._curFocus&&this.dropDown&&e.isDescendant(d._curFocus,this.dropDown.domNode));this.inherited(arguments)},isLoaded:function(){return true},loadDropDown:function(a){a()},toggleDropDown:function(){if(!(this.disabled||this.readOnly))if(this._opened)this.closeDropDown();else this.isLoaded()?this.openDropDown():this.loadDropDown(e.hitch(this,"openDropDown"))},openDropDown:function(){var a=
this.dropDown,c=a.domNode,f=this._aroundNode||this.domNode,g=this;if(!this._preparedNode){this._preparedNode=true;if(c.style.width)this._explicitDDWidth=true;if(c.style.height)this._explicitDDHeight=true}if(this.maxHeight||this.forceWidth||this.autoWidth){var i={display:"",visibility:"hidden"};if(!this._explicitDDWidth)i.width="";if(!this._explicitDDHeight)i.height="";e.style(c,i);i=this.maxHeight;if(i==-1){i=e.window.getBox();var j=e.position(f,false);i=Math.floor(Math.max(j.y,i.h-(j.y+j.h)))}a.startup&&
!a._started&&a.startup();d.popup.moveOffScreen(a);j=e._getMarginSize(c);var l=i&&j.h>i;e.style(c,{overflowX:"hidden",overflowY:l?"auto":"hidden"});if(l){j.h=i;if("w"in j)j.w+=16}else delete j.h;if(this.forceWidth)j.w=f.offsetWidth;else if(this.autoWidth)j.w=Math.max(j.w,f.offsetWidth);else delete j.w;e.isFunction(a.resize)?a.resize(j):e.marginBox(c,j)}a=d.popup.open({parent:this,popup:a,around:f,orient:d.getPopupAroundAlignment(this.dropDownPosition&&this.dropDownPosition.length?this.dropDownPosition:
["below"],this.isLeftToRight()),onExecute:function(){g.closeDropDown(true)},onCancel:function(){g.closeDropDown(true)},onClose:function(){e.attr(g._popupStateNode,"popupActive",false);e.removeClass(g._popupStateNode,"dijitHasDropDownOpen");g._opened=false}});e.attr(this._popupStateNode,"popupActive","true");e.addClass(g._popupStateNode,"dijitHasDropDownOpen");this._opened=true;return a},closeDropDown:function(a){if(this._opened){a&&this.focus();d.popup.close(this.dropDown);this._opened=false}}});
return d._HasDropDown});
define("dijit/form/Button",["dojo","dijit","text!dijit/form/templates/Button.html","text!dijit/form/templates/DropDownButton.html","text!dijit/form/templates/ComboButton.html","dijit/form/_FormWidget","dijit/_Container","dijit/_HasDropDown"],function(e,d){e.declare("dijit.form.Button",d.form._FormWidget,{label:"",showLabel:true,iconClass:"",type:"button",baseClass:"dijitButton",templateString:e.cache("dijit.form","templates/Button.html"),attributeMap:e.delegate(d.form._FormWidget.prototype.attributeMap,{value:"valueNode"}),
_onClick:function(a){if(this.disabled)return false;this._clicked();return this.onClick(a)},_onButtonClick:function(a){if(this._onClick(a)===false)a.preventDefault();else if(this.type=="submit"&&!(this.valueNode||this.focusNode).form)for(var c=this.domNode;c.parentNode;c=c.parentNode){var f=d.byNode(c);if(f&&typeof f._onSubmit=="function"){f._onSubmit(a);break}}else if(this.valueNode){this.valueNode.click();a.preventDefault()}},buildRendering:function(){this.inherited(arguments);e.setSelectable(this.focusNode,
false)},_fillContent:function(a){if(a&&(!this.params||!("label"in this.params)))this.set("label",a.innerHTML)},_setShowLabelAttr:function(a){this.containerNode&&e.toggleClass(this.containerNode,"dijitDisplayNone",!a);this._set("showLabel",a)},onClick:function(){return true},_clicked:function(){},setLabel:function(a){e.deprecated("dijit.form.Button.setLabel() is deprecated.  Use set('label', ...) instead.","","2.0");this.set("label",a)},_setLabelAttr:function(a){this._set("label",a);this.containerNode.innerHTML=
a;if(this.showLabel==false&&!this.params.title)this.titleNode.title=e.trim(this.containerNode.innerText||this.containerNode.textContent||"")},_setIconClassAttr:function(a){e.replaceClass(this.iconNode,a||"dijitNoIcon",this.iconClass||"dijitNoIcon");this._set("iconClass",a)}});e.declare("dijit.form.DropDownButton",[d.form.Button,d._Container,d._HasDropDown],{baseClass:"dijitDropDownButton",templateString:e.cache("dijit.form","templates/DropDownButton.html"),_fillContent:function(){if(this.srcNodeRef){var a=
e.query("*",this.srcNodeRef);d.form.DropDownButton.superclass._fillContent.call(this,a[0]);this.dropDownContainer=this.srcNodeRef}},startup:function(){if(!this._started){if(!this.dropDown&&this.dropDownContainer){var a=e.query("[widgetId]",this.dropDownContainer)[0];this.dropDown=d.byNode(a);delete this.dropDownContainer}this.dropDown&&d.popup.hide(this.dropDown);this.inherited(arguments)}},isLoaded:function(){var a=this.dropDown;return!!a&&(!a.href||a.isLoaded)},loadDropDown:function(){var a=this.dropDown;
if(a)if(this.isLoaded())this.openDropDown();else{var c=e.connect(a,"onLoad",this,function(){e.disconnect(c);this.openDropDown()});a.refresh()}},isFocusable:function(){return this.inherited(arguments)&&!this._mouseDown}});e.declare("dijit.form.ComboButton",d.form.DropDownButton,{templateString:e.cache("dijit.form","templates/ComboButton.html"),attributeMap:e.mixin(e.clone(d.form.Button.prototype.attributeMap),{id:"",tabIndex:["focusNode","titleNode"],title:"titleNode"}),optionsTitle:"",baseClass:"dijitComboButton",
cssStateNodes:{buttonNode:"dijitButtonNode",titleNode:"dijitButtonContents",_popupStateNode:"dijitDownArrowButton"},_focusedNode:null,_onButtonKeyPress:function(a){if(a.charOrCode==e.keys[this.isLeftToRight()?"RIGHT_ARROW":"LEFT_ARROW"]){d.focus(this._popupStateNode);e.stopEvent(a)}},_onArrowKeyPress:function(a){if(a.charOrCode==e.keys[this.isLeftToRight()?"LEFT_ARROW":"RIGHT_ARROW"]){d.focus(this.titleNode);e.stopEvent(a)}},focus:function(a){this.disabled||d.focus(a=="start"?this.titleNode:this._popupStateNode)}});
e.declare("dijit.form.ToggleButton",d.form.Button,{baseClass:"dijitToggleButton",checked:false,attributeMap:e.mixin(e.clone(d.form.Button.prototype.attributeMap),{checked:"focusNode"}),_clicked:function(){this.set("checked",!this.checked)},_setCheckedAttr:function(a,c){this._set("checked",a);e.attr(this.focusNode||this.domNode,"checked",a);d.setWaiState(this.focusNode||this.domNode,"pressed",a);this._handleOnChange(a,c)},setChecked:function(a){e.deprecated("setChecked("+a+") is deprecated. Use set('checked',"+
a+") instead.","","2.0");this.set("checked",a)},reset:function(){this._hasBeenBlurred=false;this.set("checked",this.params.checked||false)}});return d.form.Button});define("dijit/form/DropDownButton",["dojo","dijit","dijit/form/Button"],function(e,d){return d.form.DropDownButton});
define("orion/commands",["require","dojo","dijit","orion/util","dijit/Menu","dijit/form/DropDownButton","dijit/MenuItem","dijit/PopupMenuItem","dijit/MenuSeparator","dijit/Tooltip"],function(e,d,a,c){function f(h){this._domScope={};this._objectScope={};this._globalScope={};this._namedGroups={};this._activeBindings={};this._init(h)}function g(h){this._init(h)}function i(h,k,q,u,r){this.keyCode=typeof h==="string"?h.toUpperCase().charCodeAt(0):h;this.mod1=k!==undefined&&k!==null?k:false;this.mod2=q!==
undefined&&q!==null?q:false;this.mod3=u!==undefined&&u!==null?u:false;this.mod4=r!==undefined&&r!==null?r:false}var j=d.declare(a.MenuItem,{_onClick:function(){this.hrefCallback||this.inherited(arguments)}});f.prototype={_init:function(h){this._registry=h.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.page.command",this);this._selection=h.selection;d.connect(window.document,"onkeydown",d.hitch(this,function(k){k=k||window.event;var q=k.target.nodeName.toLowerCase();
if(q==="input")switch(k.target.type.toLowerCase()){case "text":case "password":case "search":case "color":case "date":case "datetime":case "datetime-local":case "email":case "month":case "number":case "range":case "tel":case "time":case "url":case "week":return}else if(q==="textarea")return;this._processKey(k)}))},_processKey:function(h){function k(t){if(window.document.all)t.keyCode=0;else{t.preventDefault();t.stopPropagation()}}for(var q in this._activeBindings)if(this._activeBindings[q]&&this._activeBindings[q].keyBinding&&
this._activeBindings[q].command)if(this._activeBindings[q].keyBinding.match(h)){var u=this._activeBindings[q],r=u.command;if(r.hrefCallback){k(h);h=r.hrefCallback.call(u.handler||window,u.items,q,u.userData);h.then?h.then(function(t){window.open(t)}):window.open(h);return}else if(r.callback){k(h);window.setTimeout(function(){r.callback.call(u.handler||window,u.items,q,null,u.userData)},0);return}}},getSelectionService:function(){return this._selection},showKeyBindings:function(h){for(var k in this._activeBindings)this._activeBindings[k]&&
this._activeBindings[k].keyBinding&&this._activeBindings[k].command&&d.place("<span>"+c.getUserKeyString(this._activeBindings[k].keyBinding)+" = "+this._activeBindings[k].command.name+"<br></span>",h,"last")},addCommand:function(h,k){switch(k){case "dom":this._domScope[h.id]=h;break;case "object":this._objectScope[h.id]=h;break;case "global":this._globalScope[h.id]=h;break;default:throw"unrecognized command scope "+k;}},addCommandGroup:function(h,k,q,u,r){var t=this._namedGroups;if(u)t=this._createEntryForPath(u);
if(t[h]){if(q)t[h].title=q;if(k)t[h].position=k;if(r)t[h].scopeId=r}else{t[h]={title:q,position:k,children:{},scopeId:r};t.sortedCommands=null}},_createEntryForPath:function(h){var k=this._namedGroups;if(h){h=h.split("/");for(var q=0;q<h.length;q++)if(h[q].length>1){k[h[q]]||(k[h[q]]={position:0,children:{}});k=k[h[q]].children}}return k},registerCommandContribution:function(h,k,q,u,r,t){u=this._createEntryForPath(u);u[h]={scopeId:q,position:k};if(r)if(k=this._domScope[h]||this._globalScope[h])this._activeBindings[h]=
{command:k,keyBinding:r,keyOnly:t};u.sortedCommands=null},_isLastChildSeparator:function(h,k){if(k==="image")return h.childNodes.length>0&&d.hasClass(h.childNodes[h.childNodes.length-1],"commandSeparator");if(k==="menu"){h=h.getChildren();return h.length>0&&h[h.length-1]instanceof a.MenuSeparator}return false},renderCommands:function(h,k,q,u,r,t,v,A,x,m){if(typeof h==="string")h=d.byId(h);if(q){var o;if(k==="object")o=this._objectScope;else if(k==="dom")o=this._domScope;else if(k==="global")o=this._globalScope;
else throw"Unrecognized command scope "+k;this._render(this._namedGroups,h,k,q,u,r,t,v,o,A,x,m);if(r==="image")this._isLastChildSeparator(h,r)&&h.removeChild(h.childNodes[h.childNodes.length-1]);else if(r==="menu")if(this._isLastChildSeparator(h,r)){q=h.getChildren()[h.getChildren().length-1];h.removeChild(q);q.destroy()}}else{var p=this;this._selection&&this._selection.getSelections(function(n){p.renderCommands(h,k,n,u,r,t,v,A,x,m)})}},_render:function(h,k,q,u,r,t,v,A,x,m,o,p){var n=h.sortedCommands;
if(!n){n=[];for(var s in h){var y=h[s];if(y&&typeof y.position==="number"){y.id=s;n.push(y)}}n.sort(function(E,F){return E.position-F.position});h.sortedCommands=n}for(h=0;h<n.length;h++){var w;if(n[h].children){s=n[h];if(!(s.scopeId&&k.id!==s.scopeId)){var z;if(t==="image")if(s.title){y=new a.Menu({style:"display: none;"});y.eclipseScopeId=k.eclipseScopeId||k.id;this._render(n[h].children,y,q,u,r,"menu",v,A,x,m,o,p);z=y.getChildren();if(this._isLastChildSeparator(y,"menu")){w=z[z.length-1];y.removeChild(w);
w.destroy();z=y.getChildren()}if(z.length>0){w=z[0].eclipseCommand;if(z.length>1){w=new a.form.DropDownButton({label:s.title,dropDown:y});d.addClass(w.domNode,"commandLink");v&&d.addClass(w.domNode,v);d.place(w.domNode,k,"last")}else{y="image"+w.id+h;s=w._asImage(y,u,r,A,v,m,o,p);d.place(s,k,"last")}}}else{var B;if(k.childNodes.length>0&&!this._isLastChildSeparator(k,t))B=this.generateSeparatorImage(k);this._render(n[h].children,k,q,u,r,t,v,A,x,m,o,p);if(k.childNodes.length>0)if(k.childNodes[k.childNodes.length-
1]!==B)B=this.generateSeparatorImage(k)}else if(s.title){y=new a.Menu;this._render(n[h].children,y,q,u,r,t,v,A,x,m,o,p);y.getChildren().length>0&&k.addChild(new a.PopupMenuItem({label:s.title,popup:y}))}else{var D;if(k.getChildren().length>0&&!this._isLastChildSeparator(k,t)){D=new a.MenuSeparator;k.addChild(D)}this._render(n[h].children,k,q,u,r,t,v,A,x,m,o,p);s=k.getChildren();if(s[s.length-1]!==D){D=new a.MenuSeparator;k.addChild(D)}}}}else{y=(s=x[n[h].id])?true:false;if(s){if(q==="dom")y=t==="image"?
k.id===n[h].scopeId:t==="menu"?k.eclipseScopeId===n[h].scopeId:false;if(this._activeBindings[s.id]&&this._activeBindings[s.id].keyBinding){w=this._activeBindings[s.id];w.items=u;w.userData=A;w.handler=r;if(w.keyOnly)y=false}if(y&&s.visibleWhen)y=s.visibleWhen(u)}if(y)if(s.choiceCallback){y=new a.Menu({style:"display: none;"});if(t==="image"){w=new a.form.DropDownButton({label:s.name,dropDown:y});if(s.image){d.addClass(w.iconNode,"commandImage");v&&d.addClass(w.iconNode,v);w.iconNode.src=s.image}d.place(w.domNode,
k,"last");w.eclipseCommand=s;w.eclipseChoices=y;d.connect(w,"onClick",w,function(){this.eclipseCommand.populateChoicesMenu(this.eclipseChoices,u,r,A)})}else if(t==="menu"){w=new a.PopupMenuItem({label:s.name,popup:y});k.addChild(w);w.eclipseCommand=s;w.eclipseChoices=y;d.connect(k,"_openPopup",w,function(){this.eclipseCommand.populateChoicesMenu(this.eclipseChoices,u,r,A)})}}else if(t==="image"){y="image"+s.id+h;s=s._asImage(y,u,r,A,v,m,o,p);d.place(s,k,"last")}else t==="menu"&&s._addMenuItem(k,u,
r,A,v)}}},generateSeparatorImage:function(h){h=d.create("span",null,h,"last");d.addClass(h,"core-sprite-sep");d.addClass(h,"commandImage");d.addClass(h,"commandSprite");d.addClass(h,"commandSeparator");return h}};f.prototype.constructor=f;g.prototype={_init:function(h){this.id=h.id;this.name=h.name||"Empty Command";this.tooltip=h.tooltip||h.name;this.callback=h.callback;this.hrefCallback=h.hrefCallback;this.choiceCallback=h.choiceCallback;this.image=h.image||e.toUrl("images/none.png");this.imageClass=
h.imageClass;this.spriteClass=h.spriteClass||"commandSprite";this.visibleWhen=h.visibleWhen;this._deviceSupportsHover=false},_asImage:function(h,k,q,u,r,t,v,A){q=q||this;var x=d.create("a");x.id=this.name+"link";var m=null;if(this.tooltip)x.title=this.tooltip;if(t||!this.hasImage()){h=window.document.createTextNode(this.name);d.place(h,x,"last")}else{m=new Image;m.alt=this.name;m.title=this.tooltip||this.name;m.name=h;m.id=h}if(this.hrefCallback){h=this.hrefCallback.call(q,k,this.id,u);if(h.then)h.then(function(o){x.href=
o});else x.href=h}else if(this.callback)m?d.connect(m,"onclick",this,function(){this.callback.call(q,k,this.id,m.id,u)}):d.connect(x,"onclick",this,function(){this.callback.call(q,k,this.id,x.id,u)});if(m){if(this._deviceSupportsHover){m.src=e.toUrl("images/none.png");d.connect(m,"onmouseover",this,function(){m.src=this.image});d.connect(m,"onmouseout",this,function(){m.src=e.toUrl("images/none.png")})}else{m.src=this.image;d.connect(m,"onmouseover",this,function(){v?d.addClass(m,v):d.addClass(m,
"commandOver")});d.connect(m,"onmouseout",this,function(){m.src=this.image;v?d.removeClass(m,v):d.removeClass(m,"commandOver")})}d.addClass(m,"commandImage");r&&d.addClass(m,r);if(this.imageClass){d.addClass(m,this.spriteClass);d.addClass(m,this.imageClass)}d.place(m,x,"last")}A?d.addClass(x,A):d.addClass(x,"commandLink");r&&d.addClass(x,r);return x},_asLink:function(h,k,q){k=k||this;var u=window.document.createElement("a");if(this.tooltip)u.title=this.tooltip;d.place(window.document.createTextNode(this.name),
u,"only");u.href="";u.id=this.id+"link";if(this.callback)d.connect(u,"onclick",this,function(){this.callback.call(k,h,this.id,u.id)});else if(this.hrefCallback){var r=this.hrefCallback.call(k,h,this.id);if(r)if(r.then)r.then(function(t){u.href=t});else u.href=r}d.addClass(u,"commandLink");q&&d.addClass(u,q);return u},_addMenuItem:function(h,k,q,u,r){var t=new j({labelType:this.hrefCallback?"html":"text",label:this.name,iconClass:this.imageClass,hrefCallback:!!this.hrefCallback});this.tooltip&&new a.Tooltip({connectId:[t.domNode],
label:this.tooltip});if(this.hrefCallback){var v=this.hrefCallback.call(q,k,this.id,h.id,u);if(v)v.then?v.then(d.hitch(this,function(A){t.set("label","<a href='"+A+"'>"+this.name+"</a>")})):t.set("label","<a href='"+v+"'>"+this.name+"</a>")}else if(this.callback)t.onClick=d.hitch(this,function(){this.callback.call(q,k,this.id,null,u)});t.eclipseCommand=this;h.addChild(t);if(this.imageClass)d.addClass(t.iconNode,this.spriteClass);else if(this.image){d.addClass(t.iconNode,"commandImage");r&&d.addClass(t.iconNode,
r);t.iconNode.src=this.image}},populateChoicesMenu:function(h,k,q,u){h.focusedChild=null;d.forEach(h.getChildren(),function(v){h.removeChild(v);v.destroy()});q=this.getChoices(k,q,u);for(u=0;u<q.length;u++){var r=q[u],t;if(r.name){t=new a.MenuItem({label:r.name,iconClass:r.imageClass,onClick:this.makeChoiceCallback(r,k)});if(r.imageClass)d.addClass(t.iconNode,r.spriteClass||"commandSprite");else if(r.image){d.addClass(t.iconNode,"commandImage");t.iconNode.src=r.image}}else t=new a.MenuSeparator;h.addChild(t)}},
getChoices:function(h,k,q){if(this.choiceCallback)return this.choiceCallback.call(k,h,q);return null},makeChoiceCallback:function(h,k){return function(q){h.callback&&h.callback.call(h,k,q)}},hasImage:function(){return this.imageClass||this.image!==e.toUrl("images/none.png")}};g.prototype.constructor=g;var l=window.navigator.platform.indexOf("Mac")!==-1;i.prototype={match:function(h){if(this.keyCode===h.keyCode){if(this.mod1!==(l?h.metaKey:h.ctrlKey))return false;if(this.mod2!==h.shiftKey)return false;
if(this.mod3!==h.altKey)return false;if(l&&this.mod4!==h.ctrlKey)return false;return true}return false},equals:function(h){if(!h)return false;if(this.keyCode!==h.keyCode)return false;if(this.mod1!==h.mod1)return false;if(this.mod2!==h.mod2)return false;if(this.mod3!==h.mod3)return false;if(this.mod4!==h.mod4)return false;return true}};i.prototype.constructor=i;return{CommandService:f,CommandKeyBinding:i,Command:g,CommandMenuItem:j}});var orion=orion||{};orion.textview=orion.textview||{};
orion.textview.KeyBinding=function(){function e(a,c,f,g,i){this.keyCode=typeof a==="string"?a.toUpperCase().charCodeAt(0):a;this.mod1=c!==undefined&&c!==null?c:false;this.mod2=f!==undefined&&f!==null?f:false;this.mod3=g!==undefined&&g!==null?g:false;this.mod4=i!==undefined&&i!==null?i:false}var d=window.navigator.platform.indexOf("Mac")!==-1;e.prototype={match:function(a){if(this.keyCode===a.keyCode){if(this.mod1!==(d?a.metaKey:a.ctrlKey))return false;if(this.mod2!==a.shiftKey)return false;if(this.mod3!==
a.altKey)return false;if(d&&this.mod4!==a.ctrlKey)return false;return true}return false},equals:function(a){if(!a)return false;if(this.keyCode!==a.keyCode)return false;if(this.mod1!==a.mod1)return false;if(this.mod2!==a.mod2)return false;if(this.mod3!==a.mod3)return false;if(this.mod4!==a.mod4)return false;return true}};return e}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/textview/keyBinding",[],function(){return orion.textview});
define("text!dijit/templates/Dialog.html",function(){return'<div class="dijitDialog" role="dialog" aria-labelledby="${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="ondijitclick: onCancel" title="${buttonCancel}" role="button" tabIndex="-1">\n\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t</span>\n\t</div>\n\t\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent"></div>\n</div>'});
define("dojo/dnd/common",["dojo"],function(e){e.getObject("dnd",true,e);e.dnd.getCopyKeyState=e.isCopyKey;e.dnd._uniqueId=0;e.dnd.getUniqueId=function(){var d;do d=e._scopeName+"Unique"+ ++e.dnd._uniqueId;while(e.byId(d));return d};e.dnd._empty={};e.dnd.isFormElement=function(d){d=d.target;if(d.nodeType==3)d=d.parentNode;return" button textarea input select option ".indexOf(" "+d.tagName.toLowerCase()+" ")>=0};return e.dnd});
define("dojo/dnd/autoscroll",["dojo","dojo/window"],function(e){e.getObject("dnd",true,e);e.dnd.getViewport=e.window.getBox;e.dnd.V_TRIGGER_AUTOSCROLL=32;e.dnd.H_TRIGGER_AUTOSCROLL=32;e.dnd.V_AUTOSCROLL_VALUE=16;e.dnd.H_AUTOSCROLL_VALUE=16;e.dnd.autoScroll=function(d){var a=e.window.getBox(),c=0,f=0;if(d.clientX<e.dnd.H_TRIGGER_AUTOSCROLL)c=-e.dnd.H_AUTOSCROLL_VALUE;else if(d.clientX>a.w-e.dnd.H_TRIGGER_AUTOSCROLL)c=e.dnd.H_AUTOSCROLL_VALUE;if(d.clientY<e.dnd.V_TRIGGER_AUTOSCROLL)f=-e.dnd.V_AUTOSCROLL_VALUE;
else if(d.clientY>a.h-e.dnd.V_TRIGGER_AUTOSCROLL)f=e.dnd.V_AUTOSCROLL_VALUE;window.scrollBy(c,f)};e.dnd._validNodes={div:1,p:1,td:1};e.dnd._validOverflow={auto:1,scroll:1};e.dnd.autoScrollNodes=function(d){for(var a=d.target;a;){if(a.nodeType==1&&a.tagName.toLowerCase()in e.dnd._validNodes){var c=e.getComputedStyle(a);if(c.overflow.toLowerCase()in e.dnd._validOverflow){var f=e._getContentBox(a,c);c=e.position(a,true);var g=Math.min(e.dnd.H_TRIGGER_AUTOSCROLL,f.w/2),i=Math.min(e.dnd.V_TRIGGER_AUTOSCROLL,
f.h/2),j=d.pageX-c.x,l=d.pageY-c.y,h=c=0;if(e.isWebKit||e.isOpera){j+=e.body().scrollLeft;l+=e.body().scrollTop}if(j>0&&j<f.w)if(j<g)c=-g;else if(j>f.w-g)c=g;if(l>0&&l<f.h)if(l<i)h=-i;else if(l>f.h-i)h=i;f=a.scrollLeft;g=a.scrollTop;a.scrollLeft+=c;a.scrollTop+=h;if(f!=a.scrollLeft||g!=a.scrollTop)return}}try{a=a.parentNode}catch(k){a=null}}e.dnd.autoScroll(d)};return e.dnd});
define("dojo/dnd/Mover",["dojo","dojo/dnd/common","dojo/dnd/autoscroll"],function(e){e.declare("dojo.dnd.Mover",null,{constructor:function(d,a,c){this.node=e.byId(d);var f=a.touches?a.touches[0]:a;this.marginBox={l:f.pageX,t:f.pageY};this.mouseButton=a.button;a=this.host=c;d=d.ownerDocument;this.events=[e.connect(d,"onmousemove",this,"onFirstMove"),e.connect(d,"ontouchmove",this,"onFirstMove"),e.connect(d,"onmousemove",this,"onMouseMove"),e.connect(d,"ontouchmove",this,"onMouseMove"),e.connect(d,
"onmouseup",this,"onMouseUp"),e.connect(d,"ontouchend",this,"onMouseUp"),e.connect(d,"ondragstart",e.stopEvent),e.connect(d.body,"onselectstart",e.stopEvent)];a&&a.onMoveStart&&a.onMoveStart(this)},onMouseMove:function(d){e.dnd.autoScroll(d);var a=this.marginBox,c=d.touches?d.touches[0]:d;this.host.onMove(this,{l:a.l+c.pageX,t:a.t+c.pageY},d);e.stopEvent(d)},onMouseUp:function(d){if(e.isWebKit&&e.isMac&&this.mouseButton==2?d.button==0:this.mouseButton==d.button)this.destroy();e.stopEvent(d)},onFirstMove:function(d){var a=
this.node.style,c,f=this.host;switch(a.position){case "relative":case "absolute":c=Math.round(parseFloat(a.left))||0;a=Math.round(parseFloat(a.top))||0;break;default:a.position="absolute";a=e.marginBox(this.node);c=e.doc.body;var g=e.getComputedStyle(c),i=e._getMarginBox(c,g);g=e._getContentBox(c,g);c=a.l-(g.l-i.l);a=a.t-(g.t-i.t);break}this.marginBox.l=c-this.marginBox.l;this.marginBox.t=a-this.marginBox.t;f&&f.onFirstMove&&f.onFirstMove(this,d);e.disconnect(this.events.shift());e.disconnect(this.events.shift())},
destroy:function(){e.forEach(this.events,e.disconnect);var d=this.host;d&&d.onMoveStop&&d.onMoveStop(this);this.events=this.node=this.host=null}});return e.dnd.Mover});
define("dojo/dnd/Moveable",["dojo","dojo/dnd/Mover"],function(e){e.declare("dojo.dnd.Moveable",null,{handle:"",delay:0,skip:false,constructor:function(d,a){this.node=e.byId(d);a||(a={});this.handle=a.handle?e.byId(a.handle):null;if(!this.handle)this.handle=this.node;this.delay=a.delay>0?a.delay:0;this.skip=a.skip;this.mover=a.mover?a.mover:e.dnd.Mover;this.events=[e.connect(this.handle,"onmousedown",this,"onMouseDown"),e.connect(this.handle,"ontouchstart",this,"onMouseDown"),e.connect(this.handle,
"ondragstart",this,"onSelectStart"),e.connect(this.handle,"onselectstart",this,"onSelectStart")]},markupFactory:function(d,a){return new e.dnd.Moveable(a,d)},destroy:function(){e.forEach(this.events,e.disconnect);this.events=this.node=this.handle=null},onMouseDown:function(d){if(!(this.skip&&e.dnd.isFormElement(d))){if(this.delay){this.events.push(e.connect(this.handle,"onmousemove",this,"onMouseMove"),e.connect(this.handle,"ontouchmove",this,"onMouseMove"),e.connect(this.handle,"onmouseup",this,
"onMouseUp"),e.connect(this.handle,"ontouchend",this,"onMouseUp"));var a=d.touches?d.touches[0]:d;this._lastX=a.pageX;this._lastY=a.pageY}else this.onDragDetected(d);e.stopEvent(d)}},onMouseMove:function(d){var a=d.touches?d.touches[0]:d;if(Math.abs(a.pageX-this._lastX)>this.delay||Math.abs(a.pageY-this._lastY)>this.delay){this.onMouseUp(d);this.onDragDetected(d)}e.stopEvent(d)},onMouseUp:function(d){for(var a=0;a<2;++a)e.disconnect(this.events.pop());e.stopEvent(d)},onSelectStart:function(d){if(!this.skip||
!e.dnd.isFormElement(d))e.stopEvent(d)},onDragDetected:function(d){new this.mover(this.node,d,this)},onMoveStart:function(d){e.publish("/dnd/move/start",[d]);e.addClass(e.body(),"dojoMove");e.addClass(this.node,"dojoMoveItem")},onMoveStop:function(d){e.publish("/dnd/move/stop",[d]);e.removeClass(e.body(),"dojoMove");e.removeClass(this.node,"dojoMoveItem")},onFirstMove:function(){},onMove:function(d,a){this.onMoving(d,a);var c=d.node.style;c.left=a.l+"px";c.top=a.t+"px";this.onMoved(d,a)},onMoving:function(){},
onMoved:function(){}});return e.dnd.Moveable});
define("dojo/dnd/move",["dojo","dojo/dnd/Mover","dojo/dnd/Moveable"],function(e){e.declare("dojo.dnd.move.constrainedMoveable",e.dnd.Moveable,{constraints:function(){},within:false,markupFactory:function(d,a){return new e.dnd.move.constrainedMoveable(a,d)},constructor:function(d,a){a||(a={});this.constraints=a.constraints;this.within=a.within},onFirstMove:function(d){var a=this.constraintBox=this.constraints.call(this,d);a.r=a.l+a.w;a.b=a.t+a.h;if(this.within){d=e._getMarginSize(d.node);a.r-=d.w;
a.b-=d.h}},onMove:function(d,a){var c=this.constraintBox,f=d.node.style;this.onMoving(d,a);a.l=a.l<c.l?c.l:c.r<a.l?c.r:a.l;a.t=a.t<c.t?c.t:c.b<a.t?c.b:a.t;f.left=a.l+"px";f.top=a.t+"px";this.onMoved(d,a)}});e.declare("dojo.dnd.move.boxConstrainedMoveable",e.dnd.move.constrainedMoveable,{box:{},markupFactory:function(d,a){return new e.dnd.move.boxConstrainedMoveable(a,d)},constructor:function(d,a){var c=a&&a.box;this.constraints=function(){return c}}});e.declare("dojo.dnd.move.parentConstrainedMoveable",
e.dnd.move.constrainedMoveable,{area:"content",markupFactory:function(d,a){return new e.dnd.move.parentConstrainedMoveable(a,d)},constructor:function(d,a){var c=a&&a.area;this.constraints=function(){var f=this.node.parentNode,g=e.getComputedStyle(f),i=e._getMarginBox(f,g);if(c=="margin")return i;var j=e._getMarginExtents(f,g);i.l+=j.l;i.t+=j.t;i.w-=j.w;i.h-=j.h;if(c=="border")return i;j=e._getBorderExtents(f,g);i.l+=j.l;i.t+=j.t;i.w-=j.w;i.h-=j.h;if(c=="padding")return i;j=e._getPadExtents(f,g);i.l+=
j.l;i.t+=j.t;i.w-=j.w;i.h-=j.h;return i}}});e.dnd.constrainedMover=e.dnd.move.constrainedMover;e.dnd.boxConstrainedMover=e.dnd.move.boxConstrainedMover;e.dnd.parentConstrainedMover=e.dnd.move.parentConstrainedMover;return e.dnd.move});
define("dojo/dnd/TimedMoveable",["dojo","dojo/dnd/Moveable"],function(e){(function(){var d=e.dnd.Moveable.prototype.onMove;e.declare("dojo.dnd.TimedMoveable",e.dnd.Moveable,{timeout:40,constructor:function(a,c){c||(c={});if(c.timeout&&typeof c.timeout=="number"&&c.timeout>=0)this.timeout=c.timeout},markupFactory:function(a,c){return new e.dnd.TimedMoveable(c,a)},onMoveStop:function(a){if(a._timer){clearTimeout(a._timer);d.call(this,a,a._leftTop)}e.dnd.Moveable.prototype.onMoveStop.apply(this,arguments)},
onMove:function(a,c){a._leftTop=c;if(!a._timer){var f=this;a._timer=setTimeout(function(){a._timer=null;d.call(f,a,a._leftTop)},this.timeout)}}})})();return e.dnd.TimedMoveable});
define("dojo/fx/Toggler",["dojo"],function(e){e.declare("dojo.fx.Toggler",null,{node:null,showFunc:e.fadeIn,hideFunc:e.fadeOut,showDuration:200,hideDuration:200,constructor:function(d){var a=this;e.mixin(a,d);a.node=d.node;a._showArgs=e.mixin({},d);a._showArgs.node=a.node;a._showArgs.duration=a.showDuration;a.showAnim=a.showFunc(a._showArgs);a._hideArgs=e.mixin({},d);a._hideArgs.node=a.node;a._hideArgs.duration=a.hideDuration;a.hideAnim=a.hideFunc(a._hideArgs);e.connect(a.showAnim,"beforeBegin",e.hitch(a.hideAnim,
"stop",true));e.connect(a.hideAnim,"beforeBegin",e.hitch(a.showAnim,"stop",true))},show:function(d){return this.showAnim.play(d||0)},hide:function(d){return this.hideAnim.play(d||0)}});return e.fx.Toggler});
define("dojo/fx",["dojo","dojo/fx/Toggler"],function(e){(function(){var d={_fire:function(f,g){if(this[f])this[f].apply(this,g||[]);return this}},a=function(f){this._index=-1;this._animations=f||[];this._current=this._onAnimateCtx=this._onEndCtx=null;this.duration=0;e.forEach(this._animations,function(g){this.duration+=g.duration;if(g.delay)this.duration+=g.delay},this)};e.extend(a,{_onAnimate:function(){this._fire("onAnimate",arguments)},_onEnd:function(){e.disconnect(this._onAnimateCtx);e.disconnect(this._onEndCtx);
this._onAnimateCtx=this._onEndCtx=null;if(this._index+1==this._animations.length)this._fire("onEnd");else{this._current=this._animations[++this._index];this._onAnimateCtx=e.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx=e.connect(this._current,"onEnd",this,"_onEnd");this._current.play(0,true)}},play:function(f,g){if(!this._current)this._current=this._animations[this._index=0];if(!g&&this._current.status()=="playing")return this;var i=e.connect(this._current,"beforeBegin",this,
function(){this._fire("beforeBegin")}),j=e.connect(this._current,"onBegin",this,function(){this._fire("onBegin",arguments)}),l=e.connect(this._current,"onPlay",this,function(){this._fire("onPlay",arguments);e.disconnect(i);e.disconnect(j);e.disconnect(l)});this._onAnimateCtx&&e.disconnect(this._onAnimateCtx);this._onAnimateCtx=e.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx&&e.disconnect(this._onEndCtx);this._onEndCtx=e.connect(this._current,"onEnd",this,"_onEnd");this._current.play.apply(this._current,
arguments);return this},pause:function(){if(this._current){var f=e.connect(this._current,"onPause",this,function(){this._fire("onPause",arguments);e.disconnect(f)});this._current.pause()}return this},gotoPercent:function(f,g){this.pause();var i=this.duration*f;this._current=null;e.some(this._animations,function(j){if(j.duration<=i){this._current=j;return true}i-=j.duration;return false});this._current&&this._current.gotoPercent(i/this._current.duration,g);return this},stop:function(f){if(this._current){if(f){for(;this._index+
1<this._animations.length;++this._index)this._animations[this._index].stop(true);this._current=this._animations[this._index]}var g=e.connect(this._current,"onStop",this,function(){this._fire("onStop",arguments);e.disconnect(g)});this._current.stop()}return this},status:function(){return this._current?this._current.status():"stopped"},destroy:function(){this._onAnimateCtx&&e.disconnect(this._onAnimateCtx);this._onEndCtx&&e.disconnect(this._onEndCtx)}});e.extend(a,d);e.fx.chain=function(f){return new a(f)};
var c=function(f){this._animations=f||[];this._connects=[];this.duration=this._finished=0;e.forEach(f,function(i){var j=i.duration;if(i.delay)j+=i.delay;if(this.duration<j)this.duration=j;this._connects.push(e.connect(i,"onEnd",this,"_onEnd"))},this);this._pseudoAnimation=new e.Animation({curve:[0,1],duration:this.duration});var g=this;e.forEach(["beforeBegin","onBegin","onPlay","onAnimate","onPause","onStop","onEnd"],function(i){g._connects.push(e.connect(g._pseudoAnimation,i,function(){g._fire(i,
arguments)}))})};e.extend(c,{_doAction:function(f,g){e.forEach(this._animations,function(i){i[f].apply(i,g)});return this},_onEnd:function(){++this._finished>this._animations.length&&this._fire("onEnd")},_call:function(f,g){var i=this._pseudoAnimation;i[f].apply(i,g)},play:function(){this._finished=0;this._doAction("play",arguments);this._call("play",arguments);return this},pause:function(){this._doAction("pause",arguments);this._call("pause",arguments);return this},gotoPercent:function(f,g){var i=
this.duration*f;e.forEach(this._animations,function(j){j.gotoPercent(j.duration<i?1:i/j.duration,g)});this._call("gotoPercent",arguments);return this},stop:function(){this._doAction("stop",arguments);this._call("stop",arguments);return this},status:function(){return this._pseudoAnimation.status()},destroy:function(){e.forEach(this._connects,e.disconnect)}});e.extend(c,d);e.fx.combine=function(f){return new c(f)};e.fx.wipeIn=function(f){var g=f.node=e.byId(f.node),i=g.style,j;f=e.animateProperty(e.mixin({properties:{height:{start:function(){j=
i.overflow;i.overflow="hidden";if(i.visibility=="hidden"||i.display=="none"){i.height="1px";i.display="";i.visibility="";return 1}else{var l=e.style(g,"height");return Math.max(l,1)}},end:function(){return g.scrollHeight}}}},f));e.connect(f,"onEnd",function(){i.height="auto";i.overflow=j});return f};e.fx.wipeOut=function(f){var g=(f.node=e.byId(f.node)).style,i;f=e.animateProperty(e.mixin({properties:{height:{end:1}}},f));e.connect(f,"beforeBegin",function(){i=g.overflow;g.overflow="hidden";g.display=
""});e.connect(f,"onEnd",function(){g.overflow=i;g.height="auto";g.display="none"});return f};e.fx.slideTo=function(f){var g=null,i=null,j=function(l){return function(){var h=e.getComputedStyle(l),k=h.position;g=k=="absolute"?l.offsetTop:parseInt(h.top)||0;i=k=="absolute"?l.offsetLeft:parseInt(h.left)||0;if(k!="absolute"&&k!="relative"){h=e.position(l,true);g=h.y;i=h.x;l.style.position="absolute";l.style.top=g+"px";l.style.left=i+"px"}}}(f.node=e.byId(f.node));j();f=e.animateProperty(e.mixin({properties:{top:f.top||
0,left:f.left||0}},f));e.connect(f,"beforeBegin",f,j);return f}})();return e.fx});
define("dijit/form/_FormMixin",["dojo","dijit","dojo/window"],function(e,d){e.declare("dijit.form._FormMixin",null,{state:"",reset:function(){e.forEach(this.getDescendants(),function(a){a.reset&&a.reset()})},validate:function(){var a=false;return e.every(e.map(this.getDescendants(),function(c){c._hasBeenBlurred=true;var f=c.disabled||!c.validate||c.validate();if(!f&&!a){e.window.scrollIntoView(c.containerNode||c.domNode);c.focus();a=true}return f}),function(c){return c})},setValues:function(a){e.deprecated(this.declaredClass+
"::setValues() is deprecated. Use set('value', val) instead.","","2.0");return this.set("value",a)},_setValueAttr:function(a){var c={};e.forEach(this.getDescendants(),function(j){if(j.name)(c[j.name]||(c[j.name]=[])).push(j)});for(var f in c)if(c.hasOwnProperty(f)){var g=c[f],i=e.getObject(f,false,a);if(i!==undefined){e.isArray(i)||(i=[i]);if(typeof g[0].checked=="boolean")e.forEach(g,function(j){j.set("value",e.indexOf(i,j.value)!=-1)});else g[0].multiple?g[0].set("value",i):e.forEach(g,function(j,
l){j.set("value",i[l])})}}},getValues:function(){e.deprecated(this.declaredClass+"::getValues() is deprecated. Use get('value') instead.","","2.0");return this.get("value")},_getValueAttr:function(){var a={};e.forEach(this.getDescendants(),function(c){var f=c.name;if(!(!f||c.disabled)){var g=c.get("value");if(typeof c.checked=="boolean")if(/Radio/.test(c.declaredClass))if(g!==false)e.setObject(f,g,a);else{g=e.getObject(f,false,a);g===undefined&&e.setObject(f,null,a)}else{c=e.getObject(f,false,a);
if(!c){c=[];e.setObject(f,c,a)}g!==false&&c.push(g)}else{c=e.getObject(f,false,a);if(typeof c!="undefined")e.isArray(c)?c.push(g):e.setObject(f,[c,g],a);else e.setObject(f,g,a)}}});return a},isValid:function(){return this.state==""},onValidStateChange:function(){},_getState:function(){var a=e.map(this._descendants,function(c){return c.get("state")||""});return e.indexOf(a,"Error")>=0?"Error":e.indexOf(a,"Incomplete")>=0?"Incomplete":""},disconnectChildren:function(){e.forEach(this._childConnections||
[],e.hitch(this,"disconnect"));e.forEach(this._childWatches||[],function(a){a.unwatch()})},connectChildren:function(a){var c=this;this.disconnectChildren();this._descendants=this.getDescendants();a=a?function(j,l){c[j]=l}:e.hitch(this,"_set");a("value",this.get("value"));a("state",this._getState());var f=this._childConnections=[],g=this._childWatches=[];e.forEach(e.filter(this._descendants,function(j){return j.validate}),function(j){e.forEach(["state","disabled"],function(l){g.push(j.watch(l,function(){c.set("state",
c._getState())}))})});var i=function(){c._onChangeDelayTimer&&clearTimeout(c._onChangeDelayTimer);c._onChangeDelayTimer=setTimeout(function(){delete c._onChangeDelayTimer;c._set("value",c.get("value"))},10)};e.forEach(e.filter(this._descendants,function(j){return j.onChange}),function(j){f.push(c.connect(j,"onChange",i));g.push(j.watch("disabled",i))})},startup:function(){this.inherited(arguments);this.connectChildren(true);this.watch("state",function(a,c,f){this.onValidStateChange(f=="")})},destroy:function(){this.disconnectChildren();
this.inherited(arguments)}});return d.form._FormMixin});
define("dijit/_DialogMixin",["dojo","dijit","dijit/_Widget"],function(e,d){e.declare("dijit._DialogMixin",null,{attributeMap:d._Widget.prototype.attributeMap,execute:function(){},onCancel:function(){},onExecute:function(){},_onSubmit:function(){this.onExecute();this.execute(this.get("value"))},_getFocusItems:function(){var a=d._getTabNavigable(this.containerNode);this._firstFocusItem=a.lowest||a.first||this.closeButtonNode||this.domNode;this._lastFocusItem=a.last||a.highest||this._firstFocusItem}});
return d._DialogMixin});
define("dijit/DialogUnderlay",["dojo","dijit","dojo/window","dijit/_Widget","dijit/_Templated"],function(e,d){e.declare("dijit.DialogUnderlay",[d._Widget,d._Templated],{templateString:"<div class='dijitDialogUnderlayWrapper'><div class='dijitDialogUnderlay' dojoAttachPoint='node'></div></div>",dialogId:"","class":"",attributeMap:{id:"domNode"},_setDialogIdAttr:function(a){e.attr(this.node,"id",a+"_underlay");this._set("dialogId",a)},_setClassAttr:function(a){this.node.className="dijitDialogUnderlay "+
a;this._set("class",a)},postCreate:function(){e.body().appendChild(this.domNode)},layout:function(){var a=this.node.style,c=this.domNode.style;c.display="none";var f=e.window.getBox();c.top=f.t+"px";c.left=f.l+"px";a.width=f.w+"px";a.height=f.h+"px";c.display="block"},show:function(){this.domNode.style.display="block";this.layout();this.bgIframe=new d.BackgroundIframe(this.domNode)},hide:function(){this.bgIframe.destroy();delete this.bgIframe;this.domNode.style.display="none"}});return d.DialogUnderlay});
define("dijit/layout/_LayoutWidget",["dojo","dijit","dijit/_Widget","dijit/_Container","dijit/_Contained"],function(e,d){e.declare("dijit.layout._LayoutWidget",[d._Widget,d._Container,d._Contained],{baseClass:"dijitLayoutContainer",isLayoutContainer:true,buildRendering:function(){this.inherited(arguments);e.addClass(this.domNode,"dijitContainer")},startup:function(){if(!this._started){this.inherited(arguments);var a=this.getParent&&this.getParent();if(!(a&&a.isLayoutContainer)){this.resize();this.connect(e.isIE?
this.domNode:e.global,"onresize",function(){this.resize()})}}},resize:function(a,c){var f=this.domNode;if(a){e.marginBox(f,a);if(a.t)f.style.top=a.t+"px";if(a.l)f.style.left=a.l+"px"}c=c||{};e.mixin(c,a||{});if(!("h"in c)||!("w"in c))c=e.mixin(e.marginBox(f),c);a=e.getComputedStyle(f);var g=e._getMarginExtents(f,a),i=e._getBorderExtents(f,a);c=this._borderBox={w:c.w-(g.w+i.w),h:c.h-(g.h+i.h)};g=e._getPadExtents(f,a);this._contentBox={l:e._toPixelValue(f,a.paddingLeft),t:e._toPixelValue(f,a.paddingTop),
w:c.w-g.w,h:c.h-g.h};this.layout()},layout:function(){},_setupChild:function(a){e.addClass(a.domNode,this.baseClass+"-child "+(a.baseClass?this.baseClass+"-"+a.baseClass:""))},addChild:function(a){this.inherited(arguments);this._started&&this._setupChild(a)},removeChild:function(a){e.removeClass(a.domNode,this.baseClass+"-child"+(a.baseClass?" "+this.baseClass+"-"+a.baseClass:""));this.inherited(arguments)}});d.layout.marginBox2contentBox=function(a,c){var f=e.getComputedStyle(a),g=e._getMarginExtents(a,
f),i=e._getPadBorderExtents(a,f);return{l:e._toPixelValue(a,f.paddingLeft),t:e._toPixelValue(a,f.paddingTop),w:c.w-(g.w+i.w),h:c.h-(g.h+i.h)}};(function(){var a=function(f){return f.substring(0,1).toUpperCase()+f.substring(1)},c=function(f,g){var i=f.resize?f.resize(g):e.marginBox(f.domNode,g);if(i)e.mixin(f,i);else{e.mixin(f,e.marginBox(f.domNode));e.mixin(f,g)}};d.layout.layoutChildren=function(f,g,i,j,l){g=e.mixin({},g);e.addClass(f,"dijitLayoutContainer");i=e.filter(i,function(h){return h.region!=
"center"&&h.layoutAlign!="client"}).concat(e.filter(i,function(h){return h.region=="center"||h.layoutAlign=="client"}));e.forEach(i,function(h){var k=h.domNode,q=h.region||h.layoutAlign,u=k.style;u.left=g.l+"px";u.top=g.t+"px";u.position="absolute";e.addClass(k,"dijitAlign"+a(q));k={};if(j&&j==h.id)k[h.region=="top"||h.region=="bottom"?"h":"w"]=l;if(q=="top"||q=="bottom"){k.w=g.w;c(h,k);g.h-=h.h;if(q=="top")g.t+=h.h;else u.top=g.t+g.h+"px"}else if(q=="left"||q=="right"){k.h=g.h;c(h,k);g.w-=h.w;if(q==
"left")g.l+=h.w;else u.left=g.l+g.w+"px"}else if(q=="client"||q=="center")c(h,g)})}})();return d.layout._LayoutWidget});
define("dijit/layout/_ContentPaneResizeMixin",["dojo","dijit","dijit/_Contained","dijit/layout/_LayoutWidget"],function(e,d){e.declare("dijit.layout._ContentPaneResizeMixin",null,{doLayout:true,isContainer:true,isLayoutContainer:true,_startChildren:function(){e.forEach(this.getChildren(),function(a){a.startup();a._started=true})},startup:function(){if(!this._started){var a=d._Contained.prototype.getParent.call(this);this._childOfLayoutWidget=a&&a.isLayoutContainer;this._needLayout=!this._childOfLayoutWidget;
this.inherited(arguments);this._startChildren();this._isShown()&&this._onShow();this._childOfLayoutWidget||this.connect(e.isIE?this.domNode:e.global,"onresize",function(){this._needLayout=!this._childOfLayoutWidget;this.resize()})}},_checkIfSingleChild:function(){var a=e.query("> *",this.containerNode).filter(function(g){return g.tagName!=="SCRIPT"}),c=a.filter(function(g){return e.hasAttr(g,"data-dojo-type")||e.hasAttr(g,"dojoType")||e.hasAttr(g,"widgetId")}),f=e.filter(c.map(d.byNode),function(g){return g&&
g.domNode&&g.resize});if(a.length==c.length&&f.length==1)this._singleChild=f[0];else delete this._singleChild;e.toggleClass(this.containerNode,this.baseClass+"SingleChild",!!this._singleChild)},resize:function(a,c){!this._wasShown&&this.open!==false&&this._onShow();this._resizeCalled=true;this._scheduleLayout(a,c)},_scheduleLayout:function(a,c){if(this._isShown())this._layout(a,c);else{this._needLayout=true;this._changeSize=a;this._resultSize=c}},_layout:function(a,c){a&&e.marginBox(this.domNode,
a);var f=this.containerNode;if(f===this.domNode){c=c||{};e.mixin(c,a||{});if(!("h"in c)||!("w"in c))c=e.mixin(e.marginBox(f),c);this._contentBox=d.layout.marginBox2contentBox(f,c)}else this._contentBox=e.contentBox(f);this._layoutChildren();delete this._needLayout},_layoutChildren:function(){this.doLayout&&this._checkIfSingleChild();if(this._singleChild&&this._singleChild.resize){var a=this._contentBox||e.contentBox(this.containerNode);this._singleChild.resize({w:a.w,h:a.h})}else e.forEach(this.getChildren(),
function(c){c.resize&&c.resize()})},_isShown:function(){if(this._childOfLayoutWidget){if(this._resizeCalled&&"open"in this)return this.open;return this._resizeCalled}else if("open"in this)return this.open;else{var a=this.domNode,c=this.domNode.parentNode;return a.style.display!="none"&&a.style.visibility!="hidden"&&!e.hasClass(a,"dijitHidden")&&c&&c.style&&c.style.display!="none"}},_onShow:function(){this._needLayout&&this._layout(this._changeSize,this._resultSize);this.inherited(arguments);this._wasShown=
true}});return d.layout._ContentPaneResizeMixin});
define("dojo/html",["dojo","dojo/parser"],function(e){e.getObject("html",true,e);(function(){var d=0;e.html._secureForInnerHtml=function(a){return a.replace(/(?:\s*<!DOCTYPE\s[^>]+>|<title[^>]*>[\s\S]*?<\/title>)/ig,"")};e.html._emptyNode=e.empty;e.html._setNodeContent=function(a,c){e.empty(a);if(c){if(typeof c=="string")c=e._toDom(c,a.ownerDocument);if(!c.nodeType&&e.isArrayLike(c))for(var f=c.length,g=0;g<c.length;g=f==c.length?g+1:0)e.place(c[g],a,"last");else e.place(c,a,"last")}return a};e.declare("dojo.html._ContentSetter",
null,{node:"",content:"",id:"",cleanContent:false,extractContent:false,parseContent:false,parserScope:e._scopeName,startup:true,constructor:function(a,c){e.mixin(this,a||{});c=this.node=e.byId(this.node||c);if(!this.id)this.id=["Setter",c?c.id||c.tagName:"",d++].join("_")},set:function(a,c){if(undefined!==a)this.content=a;c&&this._mixin(c);this.onBegin();this.setContent();this.onEnd();return this.node},setContent:function(){var a=this.node;if(!a)throw new Error(this.declaredClass+": setContent given no node");
try{a=e.html._setNodeContent(a,this.content)}catch(c){var f=this.onContentError(c);try{a.innerHTML=f}catch(g){console.error("Fatal "+this.declaredClass+".setContent could not change content due to "+g.message,g)}}this.node=a},empty:function(){if(this.parseResults&&this.parseResults.length){e.forEach(this.parseResults,function(a){a.destroy&&a.destroy()});delete this.parseResults}e.html._emptyNode(this.node)},onBegin:function(){var a=this.content;if(e.isString(a)){if(this.cleanContent)a=e.html._secureForInnerHtml(a);
if(this.extractContent){var c=a.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(c)a=c[1]}}this.empty();this.content=a;return this.node},onEnd:function(){this.parseContent&&this._parse();return this.node},tearDown:function(){delete this.parseResults;delete this.node;delete this.content},onContentError:function(a){return"Error occured setting content: "+a},_mixin:function(a){var c={},f;for(f in a)f in c||(this[f]=a[f])},_parse:function(){var a=this.node;try{var c={};e.forEach(["dir","lang","textDir"],
function(g){if(this[g])c[g]=this[g]},this);this.parseResults=e.parser.parse({rootNode:a,noStart:!this.startup,inherited:c,scope:this.parserScope})}catch(f){this._onError("Content",f,"Error parsing in _ContentSetter#"+this.id)}},_onError:function(a,c,f){a=this["on"+a+"Error"].call(this,c);if(f)console.error(f,c);else a&&e.html._setNodeContent(this.node,a,true)}});e.html.set=function(a,c,f){if(undefined==c){console.warn("dojo.html.set: no cont argument provided, using empty string");c=""}return f?(new e.html._ContentSetter(e.mixin(f,
{content:c,node:a}))).set():e.html._setNodeContent(a,c,true)}})();return e.html});define("dijit/nls/loading",{root:{loadingState:"Loading...",errorState:"Sorry, an error occurred"},zh:true,"zh-tw":true,tr:true,th:true,sv:true,sl:true,sk:true,ru:true,ro:true,pt:true,"pt-pt":true,pl:true,nl:true,nb:true,ko:true,kk:true,ja:true,it:true,hu:true,he:true,fr:true,fi:true,es:true,el:true,de:true,da:true,cs:true,ca:true,ar:true});
define("dijit/layout/ContentPane",["dojo","dijit","dijit/_Widget","dijit/layout/_ContentPaneResizeMixin","dojo/string","dojo/html","i18n!dijit/nls/loading"],function(e,d){e.declare("dijit.layout.ContentPane",[d._Widget,d.layout._ContentPaneResizeMixin],{href:"",extractContent:false,parseOnLoad:true,parserScope:e._scopeName,preventCache:false,preload:false,refreshOnShow:false,loadingMessage:"<span class='dijitContentPaneLoading'>${loadingState}</span>",errorMessage:"<span class='dijitContentPaneError'>${errorState}</span>",
isLoaded:false,baseClass:"dijitContentPane",ioArgs:{},onLoadDeferred:null,attributeMap:e.delegate(d._Widget.prototype.attributeMap,{title:[]}),stopParser:true,template:false,create:function(a,c){if((!a||!a.template)&&c&&!("href"in a)&&!("content"in a)){var f=e.doc.createDocumentFragment();for(c=e.byId(c);c.firstChild;)f.appendChild(c.firstChild);a=e.delegate(a,{content:f})}this.inherited(arguments,[a,c])},postMixInProperties:function(){this.inherited(arguments);var a=e.i18n.getLocalization("dijit",
"loading",this.lang);this.loadingMessage=e.string.substitute(this.loadingMessage,a);this.errorMessage=e.string.substitute(this.errorMessage,a)},buildRendering:function(){this.inherited(arguments);if(!this.containerNode)this.containerNode=this.domNode;this.domNode.title="";e.attr(this.domNode,"role")||d.setWaiRole(this.domNode,"group")},_startChildren:function(){this.inherited(arguments);this._contentSetter&&e.forEach(this._contentSetter.parseResults,function(a){if(!a._started&&!a._destroyed&&e.isFunction(a.startup)){a.startup();
a._started=true}},this)},setHref:function(a){e.deprecated("dijit.layout.ContentPane.setHref() is deprecated. Use set('href', ...) instead.","","2.0");return this.set("href",a)},_setHrefAttr:function(a){this.cancel();this.onLoadDeferred=new e.Deferred(e.hitch(this,"cancel"));this.onLoadDeferred.addCallback(e.hitch(this,"onLoad"));this._set("href",a);if(this.preload||this._created&&this._isShown())this._load();else this._hrefChanged=true;return this.onLoadDeferred},setContent:function(a){e.deprecated("dijit.layout.ContentPane.setContent() is deprecated.  Use set('content', ...) instead.",
"","2.0");this.set("content",a)},_setContentAttr:function(a){this._set("href","");this.cancel();this.onLoadDeferred=new e.Deferred(e.hitch(this,"cancel"));this._created&&this.onLoadDeferred.addCallback(e.hitch(this,"onLoad"));this._setContent(a||"");this._isDownloaded=false;return this.onLoadDeferred},_getContentAttr:function(){return this.containerNode.innerHTML},cancel:function(){this._xhrDfd&&this._xhrDfd.fired==-1&&this._xhrDfd.cancel();delete this._xhrDfd;this.onLoadDeferred=null},uninitialize:function(){this._beingDestroyed&&
this.cancel();this.inherited(arguments)},destroyRecursive:function(){this._beingDestroyed||this.inherited(arguments)},_onShow:function(){this.inherited(arguments);if(this.href)if(!this._xhrDfd&&(!this.isLoaded||this._hrefChanged||this.refreshOnShow))return this.refresh()},refresh:function(){this.cancel();this.onLoadDeferred=new e.Deferred(e.hitch(this,"cancel"));this.onLoadDeferred.addCallback(e.hitch(this,"onLoad"));this._load();return this.onLoadDeferred},_load:function(){this._setContent(this.onDownloadStart(),
true);var a=this,c={preventCache:this.preventCache||this.refreshOnShow,url:this.href,handleAs:"text"};e.isObject(this.ioArgs)&&e.mixin(c,this.ioArgs);var f=this._xhrDfd=(this.ioMethod||e.xhrGet)(c);f.addCallback(function(g){try{a._isDownloaded=true;a._setContent(g,false);a.onDownloadEnd()}catch(i){a._onError("Content",i)}delete a._xhrDfd;return g});f.addErrback(function(g){f.canceled||a._onError("Download",g);delete a._xhrDfd;return g});delete this._hrefChanged},_onLoadHandler:function(a){this._set("isLoaded",
true);try{this.onLoadDeferred.callback(a)}catch(c){console.error("Error "+this.widgetId+" running custom onLoad code: "+c.message)}},_onUnloadHandler:function(){this._set("isLoaded",false);try{this.onUnload()}catch(a){console.error("Error "+this.widgetId+" running custom onUnload code: "+a.message)}},destroyDescendants:function(){this.isLoaded&&this._onUnloadHandler();var a=this._contentSetter;e.forEach(this.getChildren(),function(c){c.destroyRecursive&&c.destroyRecursive()});if(a){e.forEach(a.parseResults,
function(c){c.destroyRecursive&&c.domNode&&c.domNode.parentNode==e.body()&&c.destroyRecursive()});delete a.parseResults}e.html._emptyNode(this.containerNode);delete this._singleChild},_setContent:function(a,c){this.destroyDescendants();var f=this._contentSetter;if(!(f&&f instanceof e.html._ContentSetter))f=this._contentSetter=new e.html._ContentSetter({node:this.containerNode,_onError:e.hitch(this,this._onError),onContentError:e.hitch(this,function(i){i=this.onContentError(i);try{this.containerNode.innerHTML=
i}catch(j){console.error("Fatal "+this.id+" could not change content due to "+j.message,j)}})});var g=e.mixin({cleanContent:this.cleanContent,extractContent:this.extractContent,parseContent:this.parseOnLoad,parserScope:this.parserScope,startup:false,dir:this.dir,lang:this.lang},this._contentSetterParams||{});f.set(e.isObject(a)&&a.domNode?a.domNode:a,g);delete this._contentSetterParams;this.doLayout&&this._checkIfSingleChild();if(!c){if(this._started){this._startChildren();this._scheduleLayout()}this._onLoadHandler(a)}},
_onError:function(a,c,f){this.onLoadDeferred.errback(c);a=this["on"+a+"Error"].call(this,c);if(f)console.error(f,c);else a&&this._setContent(a,true)},onLoad:function(){},onUnload:function(){},onDownloadStart:function(){return this.loadingMessage},onContentError:function(){},onDownloadError:function(){return this.errorMessage},onDownloadEnd:function(){}});return d.layout.ContentPane});
define("dijit/nls/common",{root:{buttonOk:"OK",buttonCancel:"Cancel",buttonSave:"Save",itemClose:"Close"},zh:true,"zh-tw":true,tr:true,th:true,sv:true,sl:true,sk:true,ru:true,ro:true,pt:true,"pt-pt":true,pl:true,nl:true,nb:true,ko:true,kk:true,ja:true,it:true,hu:true,he:true,fr:true,fi:true,es:true,el:true,de:true,da:true,cs:true,ca:true,ar:true});define("text!dijit/templates/TooltipDialog.html",function(){return'<div role="presentation" tabIndex="-1">\n\t<div class="dijitTooltipContainer" role="presentation">\n\t\t<div class ="dijitTooltipContents dijitTooltipFocusNode" dojoAttachPoint="containerNode" role="dialog"></div>\n\t</div>\n\t<div class="dijitTooltipConnector" role="presentation"></div>\n</div>'});
define("dijit/TooltipDialog",["dojo","dijit","text!dijit/templates/TooltipDialog.html","dijit/layout/ContentPane","dijit/_Templated","dijit/form/_FormMixin","dijit/_DialogMixin"],function(e,d){e.declare("dijit.TooltipDialog",[d.layout.ContentPane,d._Templated,d.form._FormMixin,d._DialogMixin],{title:"",doLayout:false,autofocus:true,baseClass:"dijitTooltipDialog",_firstFocusItem:null,_lastFocusItem:null,templateString:e.cache("dijit","templates/TooltipDialog.html"),_setTitleAttr:function(a){this.containerNode.title=
a;this._set("title",a)},postCreate:function(){this.inherited(arguments);this.connect(this.containerNode,"onkeypress","_onKey")},orient:function(a,c,f){a="dijitTooltipAB"+(f.charAt(1)=="L"?"Left":"Right")+" dijitTooltip"+(f.charAt(0)=="T"?"Below":"Above");e.replaceClass(this.domNode,a,this._currentOrientClass||"");this._currentOrientClass=a},focus:function(){this._getFocusItems(this.containerNode);d.focus(this._firstFocusItem)},onOpen:function(a){this.orient(this.domNode,a.aroundCorner,a.corner);this._onShow()},
onClose:function(){this.onHide()},_onKey:function(a){var c=a.target,f=e.keys;a.charOrCode===f.TAB&&this._getFocusItems(this.containerNode);var g=this._firstFocusItem==this._lastFocusItem;if(a.charOrCode==f.ESCAPE){setTimeout(e.hitch(this,"onCancel"),0);e.stopEvent(a)}else if(c==this._firstFocusItem&&a.shiftKey&&a.charOrCode===f.TAB){g||d.focus(this._lastFocusItem);e.stopEvent(a)}else if(c==this._lastFocusItem&&a.charOrCode===f.TAB&&!a.shiftKey){g||d.focus(this._firstFocusItem);e.stopEvent(a)}else a.charOrCode===
f.TAB&&a.stopPropagation()}});return d.TooltipDialog});
define("dijit/Dialog",["dojo","dijit","text!dijit/templates/Dialog.html","dojo/dnd/move","dojo/dnd/TimedMoveable","dojo/fx","dojo/window","dijit/_Widget","dijit/_Templated","dijit/_CssStateMixin","dijit/form/_FormMixin","dijit/_DialogMixin","dijit/DialogUnderlay","dijit/layout/ContentPane","i18n!dijit/nls/common","dijit/TooltipDialog"],function(e,d){e.declare("dijit._DialogBase",[d._Templated,d.form._FormMixin,d._DialogMixin,d._CssStateMixin],{templateString:e.cache("dijit","templates/Dialog.html"),
baseClass:"dijitDialog",cssStateNodes:{closeButtonNode:"dijitDialogCloseIcon"},attributeMap:e.delegate(d._Widget.prototype.attributeMap,{title:[{node:"titleNode",type:"innerHTML"},{node:"titleBar",type:"attribute"}],"aria-describedby":""}),open:false,duration:d.defaultDuration,refocus:true,autofocus:true,_firstFocusItem:null,_lastFocusItem:null,doLayout:false,draggable:true,"aria-describedby":"",postMixInProperties:function(){var a=e.i18n.getLocalization("dijit","common");e.mixin(this,a);this.inherited(arguments)},
postCreate:function(){e.style(this.domNode,{display:"none",position:"absolute"});e.body().appendChild(this.domNode);this.inherited(arguments);this.connect(this,"onExecute","hide");this.connect(this,"onCancel","hide");this._modalconnects=[]},onLoad:function(){this._position();if(this.autofocus&&d._DialogLevelManager.isTop(this)){this._getFocusItems(this.domNode);d.focus(this._firstFocusItem)}this.inherited(arguments)},_endDrag:function(a){if(a&&a.node&&a.node===this.domNode)this._relativePosition=
e.position(a.node)},_setup:function(){var a=this.domNode;if(this.titleBar&&this.draggable){this._moveable=e.isIE==6?new e.dnd.TimedMoveable(a,{handle:this.titleBar}):new e.dnd.Moveable(a,{handle:this.titleBar,timeout:0});this._dndListener=e.subscribe("/dnd/move/stop",this,"_endDrag")}else e.addClass(a,"dijitDialogFixed");this.underlayAttrs={dialogId:this.id,"class":e.map(this["class"].split(/\s/),function(c){return c+"_underlay"}).join(" ")}},_size:function(){this._checkIfSingleChild();if(this._singleChild){if(this._singleChildOriginalStyle)this._singleChild.domNode.style.cssText=
this._singleChildOriginalStyle;delete this._singleChildOriginalStyle}else e.style(this.containerNode,{width:"auto",height:"auto"});var a=e._getMarginSize(this.domNode),c=e.window.getBox();if(a.w>=c.w||a.h>=c.h){var f=Math.min(a.w,Math.floor(c.w*0.75));a=Math.min(a.h,Math.floor(c.h*0.75));if(this._singleChild&&this._singleChild.resize){this._singleChildOriginalStyle=this._singleChild.domNode.style.cssText;this._singleChild.resize({w:f,h:a})}else e.style(this.containerNode,{width:f+"px",height:a+"px",
overflow:"auto",position:"relative"})}else this._singleChild&&this._singleChild.resize&&this._singleChild.resize()},_position:function(){if(!e.hasClass(e.body(),"dojoMove")){var a=this.domNode,c=e.window.getBox(),f=this._relativePosition,g=f?null:e._getBorderBox(a),i=Math.floor(c.l+(f?f.x:(c.w-g.w)/2));c=Math.floor(c.t+(f?f.y:(c.h-g.h)/2));e.style(a,{left:i+"px",top:c+"px"})}},_onKey:function(a){if(a.charOrCode){var c=e.keys,f=a.target;a.charOrCode===c.TAB&&this._getFocusItems(this.domNode);var g=
this._firstFocusItem==this._lastFocusItem;if(f==this._firstFocusItem&&a.shiftKey&&a.charOrCode===c.TAB){g||d.focus(this._lastFocusItem);e.stopEvent(a)}else if(f==this._lastFocusItem&&a.charOrCode===c.TAB&&!a.shiftKey){g||d.focus(this._firstFocusItem);e.stopEvent(a)}else{for(;f;){if(f==this.domNode||e.hasClass(f,"dijitPopup"))if(a.charOrCode==c.ESCAPE)this.onCancel();else return;f=f.parentNode}if(a.charOrCode!==c.TAB)e.stopEvent(a);else if(!e.isOpera)try{this._firstFocusItem.focus()}catch(i){}}}},
show:function(){if(!this.open){this._started||this.startup();if(!this._alreadyInitialized){this._setup();this._alreadyInitialized=true}this._fadeOutDeferred&&this._fadeOutDeferred.cancel();this._modalconnects.push(e.connect(window,"onscroll",this,"layout"));this._modalconnects.push(e.connect(window,"onresize",this,function(){var c=e.window.getBox();if(!this._oldViewport||c.h!=this._oldViewport.h||c.w!=this._oldViewport.w){this.layout();this._oldViewport=c}}));this._modalconnects.push(e.connect(this.domNode,
"onkeypress",this,"_onKey"));e.style(this.domNode,{opacity:0,display:""});this._set("open",true);this._onShow();this._size();this._position();var a;this._fadeInDeferred=new e.Deferred(e.hitch(this,function(){a.stop();delete this._fadeInDeferred}));a=e.fadeIn({node:this.domNode,duration:this.duration,beforeBegin:e.hitch(this,function(){d._DialogLevelManager.show(this,this.underlayAttrs)}),onEnd:e.hitch(this,function(){if(this.autofocus&&d._DialogLevelManager.isTop(this)){this._getFocusItems(this.domNode);
d.focus(this._firstFocusItem)}this._fadeInDeferred.callback(true);delete this._fadeInDeferred})}).play();return this._fadeInDeferred}},hide:function(){if(this._alreadyInitialized){this._fadeInDeferred&&this._fadeInDeferred.cancel();var a;this._fadeOutDeferred=new e.Deferred(e.hitch(this,function(){a.stop();delete this._fadeOutDeferred}));a=e.fadeOut({node:this.domNode,duration:this.duration,onEnd:e.hitch(this,function(){this.domNode.style.display="none";d._DialogLevelManager.hide(this);this.onHide();
this._fadeOutDeferred.callback(true);delete this._fadeOutDeferred})}).play();if(this._scrollConnected)this._scrollConnected=false;e.forEach(this._modalconnects,e.disconnect);this._modalconnects=[];this._relativePosition&&delete this._relativePosition;this._set("open",false);return this._fadeOutDeferred}},layout:function(){if(this.domNode.style.display!="none"){d._underlay&&d._underlay.layout();this._position()}},destroy:function(){this._fadeInDeferred&&this._fadeInDeferred.cancel();this._fadeOutDeferred&&
this._fadeOutDeferred.cancel();this._moveable&&this._moveable.destroy();this._dndListener&&e.unsubscribe(this._dndListener);e.forEach(this._modalconnects,e.disconnect);d._DialogLevelManager.hide(this);this.inherited(arguments)}});e.declare("dijit.Dialog",[d.layout.ContentPane,d._DialogBase],{});d._DialogLevelManager={show:function(a,c){var f=d._dialogStack;f[f.length-1].focus=d.getFocus(a);var g=d._underlay;if(!g||g._destroyed)g=d._underlay=new d.DialogUnderlay(c);else g.set(a.underlayAttrs);var i=
f[f.length-1].dialog?f[f.length-1].zIndex+2:950;f.length==1&&g.show();e.style(d._underlay.domNode,"zIndex",i-1);e.style(a.domNode,"zIndex",i);f.push({dialog:a,underlayAttrs:c,zIndex:i})},hide:function(a){var c=d._dialogStack;if(c[c.length-1].dialog==a){c.pop();var f=c[c.length-1];if(c.length==1)d._underlay._destroyed||d._underlay.hide();else{e.style(d._underlay.domNode,"zIndex",f.zIndex-1);d._underlay.set(f.underlayAttrs)}if(a.refocus){c=f.focus;if(!c||f.dialog&&!e.isDescendant(c.node,f.dialog.domNode)){f.dialog._getFocusItems(f.dialog.domNode);
c=f.dialog._firstFocusItem}try{d.focus(c)}catch(g){}}}else{f=e.indexOf(e.map(c,function(i){return i.dialog}),a);f!=-1&&c.splice(f,1)}},isTop:function(a){var c=d._dialogStack;return c[c.length-1].dialog==a}};d._dialogStack=[{dialog:null,focus:null,underlayAttrs:null}];return d.Dialog});
define("orion/widgets/_OrionDialogMixin",["dojo","dijit"],function(e,d){e.declare("orion.widgets._OrionDialogMixin",null,{postMixInProperties:function(){this.inherited(arguments);this.title=this.options.title||"Information Needed";this.buttonCancel="Cancel"},postCreate:function(){this.inherited(arguments);e.connect(this,"onKeyPress",e.hitch(this,function(a){a.keyCode===e.keys.ENTER&&this._onSubmit()}))},onHide:function(){this.inherited(arguments);setTimeout(e.hitch(this,function(){if(e.isDescendant(d._curFocus,
this.domNode))d._curFocus=null;if(e.isDescendant(d._prevFocus,this.domNode))d._prevFocus=null;this.destroyRecursive()}),this.duration)}})});define("text!orion/widgets/templates/OpenResourceDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" title="${title}" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<div style="display:table">\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div style="display:table-cell; padding:5;">\n\t\t\t\t\t<label for="resourceName" style="padding-right:10">${selectFile}</label>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div style="display:table-cell; padding:5;">\n\t\t\t\t\t<input type="text" dojoType="dijit.form.TextBox" dojoAttachPoint="resourceName" \n\t\t\t\t\t\tplaceHolder="${searchPlaceHolder}"\n\t\t\t\t\t\tintermediateChanges="true" style="width:30em;">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div dojoAttachPoint="results" style="max-height:400px; height:auto; overflow-y:auto;"></div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div dojoAttachPoint="statusbar" style="display:table-cell;"></div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/widgets/OpenResourceDialog",["dojo","dijit","dijit/Dialog","dijit/form/TextBox","orion/widgets/_OrionDialogMixin","text!orion/widgets/templates/OpenResourceDialog.html"],function(e,d){return e.declare("orion.widgets.OpenResourceDialog",[d.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:e.cache("orion","widgets/templates/OpenResourceDialog.html"),SEARCH_DELAY:500,timeoutId:null,time:null,options:null,searchLocation:null,searcher:null,constructor:function(){this.inherited(arguments);
this.timeoutId=null;this.time=0;this.searchLocation=(this.options=arguments[0])&&this.options.SearchLocation;this.searcher=this.options&&this.options.searcher;if(!this.searchLocation)throw new Error("Missing required argument: SearchLocation");if(!this.searcher)throw new Error("Missing required argument: searcher");},postMixInProperties:function(){this.options.title=this.options.title||"Find File Named";this.selectFile="Type the name of a file to open (? = any character, * = any string):";this.searchPlaceHolder=
"Search";this.inherited(arguments)},postCreate:function(){this.inherited(arguments);e.connect(this.resourceName,"onChange",this,function(){this.time=+new Date;clearTimeout(this.timeoutId);this.timeoutId=setTimeout(e.hitch(this,this.checkSearch),0)});e.connect(this.resourceName,"onKeyPress",this,function(a){if(a.keyCode===e.keys.ENTER&&this.results){a=e.query("a",this.results);if(a.length>0){window.open(a[0].href);this.hide()}}});e.connect(this,"onMouseUp",function(a){a.target.focus()})},checkSearch:function(){clearTimeout(this.timeoutId);
var a=(new Date).getTime();if(a-this.time>this.SEARCH_DELAY){this.time=a;this.doSearch()}else this.timeoutId=setTimeout(e.hitch(this,"checkSearch"),50)},doSearch:function(){var a=this.resourceName&&this.resourceName.get("value");if(a){e.place("<div>Searching&#x2026;</div>",this.results,"only");var c=this;setTimeout(function(){var f=c.searcher.createSearchQuery(c.searchLocation,null,a);c.searcher.search(c.results,f,false,false,e.hitch(c,c.decorateResult),true,true)},0)}},decorateResult:function(a){var c=
this;e.query("a",a).forEach(function(f){e.connect(f,"onmouseup",function(g){!e.mouseButtons.isMiddle(g)&&!e.isCopyKey(g)&&c.hide()})})},show:function(){this.inherited(arguments);this.resourceName.focus()},onHide:function(){clearTimeout(this.timeoutId);this.inherited(arguments)}})});define("text!orion/widgets/templates/LoginDialog.html",function(){return'\n<div>\n\t<div class="dijitTooltipContainer" role="presentation" style="width: 300px; padding-left: 0; padding-right: 0; padding-top: 0.5em; padding-bottom: 0.45em">\n\t\t<div class="dijitTooltipContents dijitTooltipFocusNode" role="dialog"\n\t\t\tdojoattachpoint="containerNode" style="padding: 0">\n\t\t\t<table dojoAttachPoint="authenticated" style="display: none; width: 100%;">\n\t\t\t <tbody dojoAttachPoint="authenticatedList">\n\t\t\t</tbody>\n\t\t\t</span>\n\t\t\t\n\t\t\t<table dojoAttachPoint="otherUnauthenticated" style="display: none; width: 100%;">\n\t\t\t <tbody dojoAttachPoint="otherUnauthenticatedList">\n\t\t\t</tbody>\n\t\t\t</span>\n\t\t</div>\n\t</div>\n\t<div class="dijitTooltipConnector" role="presentation"></div>\n\n</div>'});
define("orion/widgets/LoginDialog",["require","dojo","dijit","orion/util","dijit/TooltipDialog","text!orion/widgets/templates/LoginDialog.html"],function(e,d,a,c){d.declare("orion.widgets.LoginDialog",[a.TooltipDialog],{widgetsInTemplate:true,templateString:d.cache("orion","widgets/templates/LoginDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{};this.authenticatedServices={};this.unauthenticatedServices={}},setPendingAuthentication:function(f){for(var g in this.unauthenticatedServices)delete this.unauthenticatedServices[g].pending;
for(g in f)if(this.unauthenticatedServices[f[g].SignInKey])this.unauthenticatedServices[f[g].SignInKey].pending=true;else if(this.authenticatedServices[f[g].SignInKey]){this.unauthenticatedServices[f[g].SignInKey]=this.authenticatedServices[f[g].SignInKey];this.unauthenticatedServices[f[g].SignInKey].pending=true;delete this.authenticatedServices[f[g].SignInKey]}else this.unauthenticatedServices[f[g].SignInKey]={label:f[g].SignInKey,SignInLocation:f[g].SignInLocation,pending:true};this.renderUnauthenticatedServices();
this.renderAuthenticatedServices()},addUserItem:function(f,g,i,j){if(j){this.unauthenticatedServices[f]&&delete this.unauthenticatedServices[f];this.authenticatedServices[f]={authService:g,label:i,data:j}}else{this.authenticatedServices[f]&&delete this.authenticatedServices[f];this.unauthenticatedServices[f]=this.unauthenticatedServices[f]?{authService:g,label:i,pending:this.unauthenticatedServices[f].pending}:{authService:g,label:i}}d.hitch(this,this.renderAuthenticatedServices)();d.hitch(this,this.renderUnauthenticatedServices)();
if(a.byId("logins"))if(this.isSingleService()&&j){c.setUserName(j.login);f=j.Name&&j.Name.replace(/^\s+|\s+$/g,"")!==""?j.Name:j.login;if(f.length>40)f=f.substring(0,30)+"...";a.byId("logins").setLabel(f)}else a.byId("logins").setLabel("Security")},renderAuthenticatedServices:function(){d.empty(this.authenticatedList);this.authenticated.style.display=this.isEmpty(this.authenticatedServices)?"none":"";var f=this,g=true;for(var i in this.authenticatedServices){if(!g){var j=d.create("tr",null,this.authenticatedList);
d.create("td",{style:"padding: 0; margin 0;",colspan:2,innerHTML:"<hr style='border-bottom: medium none; border-top: 1px solid #D3D3D3; color: gray; height: 0; margin: 2px;'>"},j)}g=false;j=d.create("tr",{className:"navTableHeading"});var l=d.create("td",{innerHTML:"<h2>"+(this.authenticatedServices[i].label?this.authenticatedServices[i].label:i)+"</h2>"},j,"only");d.addClass(l,"LoginWindowLeft");l=d.create("td",{style:"text-align: right"},j,"last");d.addClass(l,"LoginWindowRight");var h=this.authenticatedServices[i].data,
k=this.authenticatedServices[i].authService;h.Location&&d.create("a",{href:e.toUrl("profile/user-profile.html")+"#"+h.Location,innerHTML:"Profile"},l,"last");d.place(document.createTextNode(" "),l,"last");if(k.logout){var q=d.create("a",{innerHTML:"Sign out"},l,"last");d.connect(q,"onmouseover",q,function(){q.style.cursor="pointer"});d.connect(q,"onmouseout",q,function(){q.style.cursor="default"});d.connect(q,"onclick",d.hitch(f,function(u,r){return function(){u.logout().then(d.hitch(f,function(){this.addUserItem(r,
u,this.authenticatedServices[r].label);this.isSingleService()&&a.popup.close(this);localStorage.removeItem(r)}))}})(k,i))}d.place(j,this.authenticatedList,"last");l="N/A";if(h&&h.lastlogintimestamp)l=d.date.locale.format(new Date(h.lastlogintimestamp),{formatLength:"short"});h=h.Name&&h.Name.replace(/^\s+|\s+$/g,"")!==""?h.Name:h.login;j=d.create("tr");l=h.length>40?d.create("td",{innerHTML:h.substring(0,30)+"... logged in since "+l,colspan:2,title:h+" logged in since "+l},j,"only"):d.create("td",
{innerHTML:h+" logged in since "+l,colspan:2},j,"only");d.addClass(l,"LoginWindowLeft");d.addClass(l,"LoginWindowRight");d.addClass(l,"LoginWindowComment");d.place(j,this.authenticatedList,"last")}},renderUnauthenticatedServices:function(){d.empty(this.otherUnauthenticatedList);var f=this;this.otherUnauthenticated.style.display=this.isEmpty(this.unauthenticatedServices)?"none":"";var g=true;for(var i in this.unauthenticatedServices){if(!g||!this.isEmpty(this.authenticatedServices)){var j=d.create("tr",
null,this.otherUnauthenticatedList);d.create("td",{style:"padding: 0; margin 0;",colspan:2,innerHTML:"<hr style='border-bottom: medium none; border-top: 1px solid #D3D3D3; color: gray; height: 0; margin: 2px;'>"},j)}g=false;j=d.create("tr",{className:"navTableHeading"});var l=d.create("td",null,j,"only");d.addClass(l,"LoginWindowLeft");d.create("h2",{innerHTML:this.unauthenticatedServices[i].label?this.unauthenticatedServices[i].label:i},l,"only");l=d.create("td",{style:"text-align: right"},j,"last");
d.addClass(l,"LoginWindowRight");var h=this.unauthenticatedServices[i].authService;if(h)if(h.getAuthForm)d.hitch(f,function(u,r){h.getAuthForm(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(t){t.indexOf("?")==-1?d.create("a",{target:"_blank",href:t+"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+r,innerHTML:"Sign in"},u,"last"):d.create("a",{target:"_blank",href:t+"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+r,innerHTML:"Sign in"},
u,"last")})})(l,i);else{if(h.login){var k=d.create("a",{innerHTML:"Sign in",style:"cursor: hand;"},l,"last");d.connect(k,"onmouseover",k,function(){k.style.cursor="pointer"});d.connect(k,"onmouseout",k,function(){k.style.cursor="default"});d.connect(k,"onclick",d.hitch(f,function(u){return function(){u.login(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(){f.isSingleService()&&a.popup.close(f)})}})(h))}}else{var q=this.unauthenticatedServices[i].SignInLocation;q.indexOf("?")==
-1?d.create("a",{target:"_blank",href:q+"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+i,innerHTML:"Sign in"},l,"last"):d.create("a",{target:"_blank",href:q+"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+i,innerHTML:"Sign in"},l,"last")}d.place(j,this.otherUnauthenticatedList,"last");if(this.unauthenticatedServices[i].pending){j=d.create("tr");l=d.create("td",{innerHTML:"Authentication required!",style:"padding-left: 10px",colspan:2},j,"only");d.addClass(l,
"LoginWindowLeft");d.addClass(l,"LoginWindowRight");d.create("img",{src:e.toUrl("images/warning.gif"),style:"padding-right: 4px; vertical-align: bottom; padding-bottom: 2px;"},l,"first");d.place(j,this.otherUnauthenticatedList,"last")}}},isSingleService:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)===1},isEmpty:function(f){for(var g in f)if(f.hasOwnProperty(g))return false;return true},length:function(f){var g=0;for(var i in f)f.hasOwnProperty(i)&&
g++;return g},getHostname:function(f){var g=document.createElement("img");g.src=f;f=g.src;g.src=null;return f.match(/^(?:f|ht)tp(?:s)?:\/\/([^\/]+)/im)[1].toString()}})});
define("orion/globalCommands",["require","dojo","dijit","orion/commands","orion/util","orion/textview/keyBinding","dijit/Menu","dijit/MenuItem","dijit/form/DropDownButton","orion/widgets/OpenResourceDialog","orion/widgets/LoginDialog"],function(e,d,a,c,f,g){function i(x){var m=document.createElement("a");m.href=x;return m.href}function j(x,m){if(x.getLabel)return x.getLabel();else{x=new d.Deferred;x.callback(m.properties.name);return x}}function l(x){var m=x.getServiceReferences("orion.core.auth"),
o=d.byId("userInfo");if(o){if(!a.byId("logins")){var p=new a.form.DropDownButton({id:"logins",label:"Security",dropDown:A,title:"Login statuses"});d.addClass(p.domNode,"commandImage");d.place(p.domNode,o,"only")}for(o=0;o<m.length;o++){var n=m[o];x.getService(n).then(function(s){j(s,n).then(function(y){s.getKey().then(function(w){s.getUser().then(function(z){A.addUserItem(w,s,y,z)},function(){A.addUserItem(w,s,y)});window.addEventListener("storage",function(){if(v[w]!==localStorage.getItem(w)){v[w]=
localStorage.getItem(w);s.getUser().then(function(z){A.addUserItem(w,s,y,z)},function(){A.addUserItem(w,s,y)})}},false)})})})}}}function h(x){A.setPendingAuthentication(x);var m;for(m in x)if(x.hasOwnProperty(m)){a.popup.open({popup:A,around:d.byId("logins")});return}a.popup.close(A)}function k(x,m,o,p){var n=d.byId("pageActions");if(o)n=d.byId(o);if(n){d.empty(n);x.renderCommands(n,"dom",m,m,"image",null,null,!p)}}function q(x,m,o,p,n,s,y,w){var z=e.toUrl("filesearch._");z=z.substring(0,z.length-
2)+"?q=";var B;p=d.byId(x);if(!p)throw"could not find banner parent, id was "+x;d.place(u,p,"only");d.place('<div id="keyAssist" class="keyAssistFloat"></div>',document.body,"last");var D=d.byId("primaryNav");if(D)for(var E=m.getServiceReferences("orion.page.link"),F=0;F<E.length;F++)m.getService(E[F]).then(function(){for(var R={},Q=E[F].getPropertyNames(),S=0;S<Q.length;S++)R[Q[S]]=E[F].getProperty(Q[S]);if(R.href&&R.name){Q=d.create("a",{href:R.href},D,"last");d.addClass(Q,"commandLink");B=document.createTextNode(R.name);
d.place(B,Q,"only")}});var I=d.byId("search");if(!I)throw"failed to generate HTML for banner";d.connect(I,"onkeypress",function(R){if(R.charOrCode===d.keys.ENTER)if(z){if(I.value.length>0){R=n.createSearchQuery("../filesearch?q=",I.value);window.location=e.toUrl("search/search.html")+"#"+R}}else window.alert("Can't search: SearchLocation not available")});if(x=d.byId("pageTitle")){B=document.createTextNode(document.title);d.place(B,x,"last")}var L=function(R,Q,S){var aa=new orion.widgets.OpenResourceDialog({SearchLocation:R,
searcher:Q});S&&d.connect(aa,"onHide",function(){S.getTextView().focus()});window.setTimeout(function(){aa.show()},0)};x=new c.Command({name:"Find File Named...",tooltip:"Choose a file by name and open an editor on it",id:"eclipse.openResource",callback:function(){L(z,n,y)}});if(y){y.getTextView().setKeyBinding(new g.KeyBinding("r",true,true,false),"Find File Named...");y.getTextView().setAction("Find File Named...",function(){L(z,n,y);return true})}o.addCommand(x,"global");o.registerCommandContribution("eclipse.openResource",
1,"globalActions",null,new c.CommandKeyBinding("t"),true);var M=d.byId("keyAssist");d.connect(document,"onkeypress",d.hitch(this,function(R){if(R.charOrCode===d.keys.ESCAPE)M.style.display="none"}));w&&w.addHandler({isActive:function(){return M.style.display==="block"},cancel:function(){if(this.isActive()){M.style.display="none";return true}return false}});w=new c.Command({name:"Show Keys",tooltip:"Show a list of all the keybindings on this page",id:"eclipse.keyAssist",callback:function(){d.empty(M);
if(y){d.place("<h2>Editor</h2>",M,"last");for(var R=y.getTextView().getActions(false),Q=0;Q<R.length;Q++)for(var S=R[Q],aa=y.getTextView().getKeyBindings(S),C=0;C<aa.length;C++)d.place("<span>"+f.getUserKeyString(aa[C])+" = "+S+"<br></span>",M,"last")}d.place("<h2>Global</h2>",M,"last");o.showKeyBindings(M);M.style.display="block";return true}});o.addCommand(w,"global");o.registerCommandContribution("eclipse.keyAssist",1,"globalActions",null,new c.CommandKeyBinding(191,false,true),true);if(y){y.getTextView().setKeyBinding(new c.CommandKeyBinding("L",
true,true),"Show Keys");y.getTextView().setAction("Show Keys",w.callback)}if(w=d.byId("globalActions")){d.empty(w);o.renderCommands(w,"global",s||{},s,"image")}l(m);if(r)(m=d.byId("footer"))&&d.place(r,m,"only")}var u='<table style="border: 2px solid white; margin: 0; padding: 0; border-collapse: collapse; width: 100%;"><tr class="topRowBanner" id="bannerRow1"><td rowspan=3 style="padding-top: 12px; padding-bottom: 12px; padding-left: 8px; width: 148px"><a id="home" href="'+e.toUrl("index.html")+
'"><span class="imageSprite core-sprite-orion toolbarLabel" alt="Orion Logo" align="top"></a></td><td class="leftGlobalToolbar" style="padding-top: 16px"><span id="pageTitle" class="pageTitle"></span></td><td class="rightGlobalToolbar" style="padding-top: 16px"><span id="primaryNav" class="globalActions"></span><span id="globalActions" class="globalActions"></span><input type="search" id="search" class="searchbox"><span id="userInfo"></span><span id="help" class="help"><a id="help" href="'+e.toUrl("help/index.jsp")+
'">?</a></span></td></tr><tr class="topRowBanner" id="bannerRow2"><td colspan=2 style="text-wrap: normal"><span id="location" class="currentLocation" style="text-wrap: normal"></span></td></tr><tr class="topRowBanner" id="bannerRow3"><td colspan=2 style="height: 16px; text-align: left"><span id="statusPane" style="color: #5a5a5a;"></span><span id="notifications"></span></td></tr><tr class="pageToolbar"><td colspan=3 style="padding-left: 16px;" id="pageToolbar" class="pageToolbar"><span id="pageActions" class="pageActions"></span><span id="pageActionsRight" class="pageActions"></span></td></tr><tr class="optionalPageToolbar"><td colspan=3 style="border: 1px solid grey;padding-left: 16px;" id="optionalPageToolbar" class="optionalPageToolbar"><div id="optionalPageActions"  class="pageActions"></div></td></tr></table>',
r='<span class="imageSprite core-sprite-warning"></span> This is a Beta build of Orion.  You can use it, play with it and explore the capabilities but BEWARE your data may be lost. &nbsp;| <a href="http://wiki.eclipse.org/Orion/FAQ">FAQ</a> | <a href="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Orion&version=0.3">Report a Bug</a> | <a href="http://www.eclipse.org/legal/privacy.php">Privacy Policy</a> | <a href="http://www.eclipse.org/legal/termsofuse.php">Terms of Use</a> | <a href="http://www.eclipse.org/legal/copyright.php">Copyright Agent</a>',
t=i(e.toUrl("auth/NotifyAuthentication.html")),v={},A=new orion.widgets.LoginDialog;return{generateUserInfo:l,generateDomCommandsInBanner:k,generateBanner:q,notifyAuthenticationSite:t,setPendingAuthentication:h}});
define("dojo/date",["dojo"],function(e){e.getObject("date",true,e);e.date.getDaysInMonth=function(d){var a=d.getMonth();if(a==1&&e.date.isLeapYear(d))return 29;return[31,28,31,30,31,30,31,31,30,31,30,31][a]};e.date.isLeapYear=function(d){d=d.getFullYear();return!(d%400)||!(d%4)&&!!(d%100)};e.date.getTimezoneName=function(d){var a=d.toString(),c="",f=a.indexOf("(");if(f>-1)c=a.substring(++f,a.indexOf(")"));else{f=/([A-Z\/]+) \d{4}$/;if(a=a.match(f))c=a[1];else{a=d.toLocaleString();f=/ ([A-Z\/]+)$/;
if(a=a.match(f))c=a[1]}}return c=="AM"||c=="PM"?"":c};e.date.compare=function(d,a,c){d=new Date(+d);a=new Date(+(a||new Date));if(c=="date"){d.setHours(0,0,0,0);a.setHours(0,0,0,0)}else if(c=="time"){d.setFullYear(0,0,0);a.setFullYear(0,0,0)}if(d>a)return 1;if(d<a)return-1;return 0};e.date.add=function(d,a,c){var f=new Date(+d),g=false,i="Date";switch(a){case "day":break;case "weekday":var j;if(a=c%5){a=a;j=parseInt(c/5)}else{a=c>0?5:-5;j=c>0?(c-5)/5:(c+5)/5}var l=d.getDay(),h=0;if(l==6&&c>0)h=1;
else if(l==0&&c<0)h=-1;l=l+a;if(l==0||l==6)h=c>0?2:-2;c=7*j+a+h;break;case "year":i="FullYear";g=true;break;case "week":c*=7;break;case "quarter":c*=3;case "month":g=true;i="Month";break;default:i="UTC"+a.charAt(0).toUpperCase()+a.substring(1)+"s"}i&&f["set"+i](f["get"+i]()+c);g&&f.getDate()<d.getDate()&&f.setDate(0);return f};e.date.difference=function(d,a,c){a=a||new Date;c=c||"day";var f=a.getFullYear()-d.getFullYear(),g=1;switch(c){case "quarter":d=d.getMonth();a=a.getMonth();d=Math.floor(d/3)+
1;a=Math.floor(a/3)+1;a+=f*4;g=a-d;break;case "weekday":f=Math.round(e.date.difference(d,a,"day"));c=parseInt(e.date.difference(d,a,"week"));g=f%7;if(g==0)f=c*5;else{var i=0,j=d.getDay();a=a.getDay();c=parseInt(f/7);g=f%7;d=new Date(d);d.setDate(d.getDate()+c*7);d=d.getDay();if(f>0)switch(true){case j==6:i=-1;break;case j==0:i=0;break;case a==6:i=-1;break;case a==0:i=-2;break;case d+g>5:i=-2}else if(f<0)switch(true){case j==6:i=0;break;case j==0:i=1;break;case a==6:i=2;break;case a==0:i=1;break;case d+
g<0:i=2}f+=i;f-=c*2}g=f;break;case "year":g=f;break;case "month":g=a.getMonth()-d.getMonth()+f*12;break;case "week":g=parseInt(e.date.difference(d,a,"day")/7);break;case "day":g/=24;case "hour":g/=60;case "minute":g/=60;case "second":g/=1E3;case "millisecond":g*=a.getTime()-d.getTime()}return Math.round(g)};return e.date});
define("dojo/cldr/supplemental",["dojo","dojo/i18n"],function(e){e.getObject("cldr.supplemental",true,e);e.cldr.supplemental.getFirstDayOfWeek=function(d){d={mv:5,ae:6,af:6,bh:6,dj:6,dz:6,eg:6,er:6,et:6,iq:6,ir:6,jo:6,ke:6,kw:6,ly:6,ma:6,om:6,qa:6,sa:6,sd:6,so:6,sy:6,tn:6,ye:6,ar:0,as:0,az:0,bw:0,ca:0,cn:0,fo:0,ge:0,gl:0,gu:0,hk:0,il:0,"in":0,jm:0,jp:0,kg:0,kr:0,la:0,mh:0,mn:0,mo:0,mp:0,mt:0,nz:0,ph:0,pk:0,sg:0,th:0,tt:0,tw:0,um:0,us:0,uz:0,vi:0,zw:0}[e.cldr.supplemental._region(d)];return d===undefined?
1:d};e.cldr.supplemental._region=function(d){d=e.i18n.normalizeLocale(d);d=d.split("-");var a=d[1];if(a){if(a.length==4)a=d[2]}else a={de:"de",en:"us",es:"es",fi:"fi",fr:"fr",he:"il",hu:"hu",it:"it",ja:"jp",ko:"kr",nl:"nl",pt:"br",sv:"se",zh:"cn"}[d[0]];return a};e.cldr.supplemental.getWeekend=function(d){var a=e.cldr.supplemental._region(d);d={"in":0,af:4,dz:4,ir:4,om:4,sa:4,ye:4,ae:5,bh:5,eg:5,il:5,iq:5,jo:5,kw:5,ly:5,ma:5,qa:5,sd:5,sy:5,tn:5}[a];a={af:5,dz:5,ir:5,om:5,sa:5,ye:5,ae:6,bh:5,eg:6,
il:6,iq:6,jo:6,kw:6,ly:6,ma:6,qa:6,sd:6,sy:6,tn:6}[a];if(d===undefined)d=6;if(a===undefined)a=0;return{start:d,end:a}};return e.cldr.supplemental});
define("dojo/regexp",["dojo"],function(e){e.getObject("regexp",true,e);e.regexp.escapeString=function(d,a){return d.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,function(c){if(a&&a.indexOf(c)!=-1)return c;return"\\"+c})};e.regexp.buildGroupRE=function(d,a,c){if(!(d instanceof Array))return a(d);for(var f=[],g=0;g<d.length;g++)f.push(a(d[g]));return e.regexp.group(f.join("|"),c)};e.regexp.group=function(d,a){return"("+(a?"?:":"")+d+")"};return e.regexp});
define("dojo/cldr/nls/gregorian",{root:{"months-format-narrow":["1","2","3","4","5","6","7","8","9","10","11","12"],"quarters-standAlone-narrow":["1","2","3","4"],"field-weekday":"Day of the Week","dateFormatItem-yQQQ":"y QQQ","dateFormatItem-yMEd":"EEE, y-M-d","dateFormatItem-MMMEd":"E MMM d",eraNarrow:["BCE","CE"],"dateTimeFormats-appendItem-Day-Of-Week":"{0} {1}","dateFormat-long":"y MMMM d","months-format-wide":["1","2","3","4","5","6","7","8","9","10","11","12"],"dateTimeFormat-medium":"{1} {0}",
"dateFormatItem-EEEd":"d EEE","dayPeriods-format-wide-pm":"PM","dateFormat-full":"EEEE, y MMMM dd","dateFormatItem-Md":"M-d","dayPeriods-format-abbr-am":"AM","dateTimeFormats-appendItem-Second":"{0} ({2}: {1})","field-era":"Era","dateFormatItem-yM":"y-M","months-standAlone-wide":["1","2","3","4","5","6","7","8","9","10","11","12"],"timeFormat-short":"HH:mm","quarters-format-wide":["Q1","Q2","Q3","Q4"],"timeFormat-long":"HH:mm:ss z","field-year":"Year","dateFormatItem-yMMM":"y MMM","dateFormatItem-yQ":"y Q",
"dateTimeFormats-appendItem-Era":"{0} {1}","field-hour":"Hour","months-format-abbr":["1","2","3","4","5","6","7","8","9","10","11","12"],"timeFormat-full":"HH:mm:ss zzzz","dateTimeFormats-appendItem-Week":"{0} ({2}: {1})","field-day-relative+0":"Today","field-day-relative+1":"Tomorrow","dateFormatItem-H":"HH","months-standAlone-abbr":["1","2","3","4","5","6","7","8","9","10","11","12"],"quarters-format-abbr":["Q1","Q2","Q3","Q4"],"quarters-standAlone-wide":["Q1","Q2","Q3","Q4"],"dateFormatItem-M":"L",
"days-standAlone-wide":["1","2","3","4","5","6","7"],"timeFormat-medium":"HH:mm:ss","dateFormatItem-Hm":"HH:mm","quarters-standAlone-abbr":["Q1","Q2","Q3","Q4"],eraAbbr:["BCE","CE"],"field-minute":"Minute","field-dayperiod":"Dayperiod","days-standAlone-abbr":["1","2","3","4","5","6","7"],"dateFormatItem-d":"d","dateFormatItem-ms":"mm:ss","quarters-format-narrow":["1","2","3","4"],"field-day-relative+-1":"Yesterday","dateFormatItem-h":"h a","dateTimeFormat-long":"{1} {0}","dayPeriods-format-narrow-am":"AM",
"dateFormatItem-MMMd":"MMM d","dateFormatItem-MEd":"E, M-d","dateTimeFormat-full":"{1} {0}","field-day":"Day","days-format-wide":["1","2","3","4","5","6","7"],"field-zone":"Zone","dateTimeFormats-appendItem-Day":"{0} ({2}: {1})","dateFormatItem-y":"y","months-standAlone-narrow":["1","2","3","4","5","6","7","8","9","10","11","12"],"dateFormatItem-hm":"h:mm a","dateTimeFormats-appendItem-Year":"{0} {1}","dateTimeFormats-appendItem-Hour":"{0} ({2}: {1})","dayPeriods-format-abbr-pm":"PM","days-format-abbr":["1",
"2","3","4","5","6","7"],eraNames:["BCE","CE"],"days-format-narrow":["1","2","3","4","5","6","7"],"days-standAlone-narrow":["1","2","3","4","5","6","7"],"dateFormatItem-MMM":"LLL","field-month":"Month","dateTimeFormats-appendItem-Quarter":"{0} ({2}: {1})","dayPeriods-format-wide-am":"AM","dateTimeFormats-appendItem-Month":"{0} ({2}: {1})","dateTimeFormats-appendItem-Minute":"{0} ({2}: {1})","dateFormat-short":"yyyy-MM-dd","field-second":"Second","dateFormatItem-yMMMEd":"EEE, y MMM d","dateTimeFormats-appendItem-Timezone":"{0} {1}",
"field-week":"Week","dateFormat-medium":"y MMM d","dayPeriods-format-narrow-pm":"PM","dateTimeFormat-short":"{1} {0}","dateFormatItem-Hms":"HH:mm:ss","dateFormatItem-hms":"h:mm:ss a"},ar:true,ca:true,cs:true,da:true,de:true,el:true,en:true,"en-au":true,"en-ca":true,"en-gb":true,es:true,fi:true,fr:true,"fr-ch":true,he:true,hu:true,it:true,ja:true,ko:true,nb:true,nl:true,pl:true,pt:true,"pt-pt":true,ro:true,ru:true,sk:true,sl:true,sv:true,th:true,tr:true,zh:true,"zh-hant":true,"zh-hk":true,"zh-tw":true});
define("dojo/cldr/nls/en/gregorian",{"dateFormatItem-yM":"M/y","field-dayperiod":"AM/PM","dateFormatItem-yQ":"Q y","dayPeriods-format-wide-pm":"PM","field-minute":"Minute",eraNames:["Before Christ","Anno Domini"],"dateFormatItem-MMMEd":"E, MMM d","dateTimeFormat-full":"{1} {0}","field-day-relative+-1":"Yesterday","field-weekday":"Day of the Week","dateFormatItem-hms":"h:mm:ss a","dateFormatItem-yQQQ":"QQQ y","days-standAlone-wide":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
"dateFormatItem-MMM":"LLL","months-standAlone-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"dateTimeFormat-short":"{1} {0}","field-era":"Era","field-hour":"Hour","dayPeriods-format-wide-am":"AM","dateTimeFormat-medium":"{1} {0}","dateFormatItem-y":"y","timeFormat-full":"h:mm:ss a zzzz","months-standAlone-abbr":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"dateFormatItem-yMMM":"MMM y","field-day-relative+0":"Today","field-day-relative+1":"Tomorrow","days-standAlone-narrow":["S",
"M","T","W","T","F","S"],eraAbbr:["BC","AD"],"dateFormat-long":"MMMM d, y","timeFormat-medium":"h:mm:ss a","dateFormatItem-EEEd":"d EEE","field-zone":"Zone","dateFormatItem-Hm":"HH:mm","dateFormat-medium":"MMM d, y","dateFormatItem-Hms":"HH:mm:ss","quarters-standAlone-wide":["1st quarter","2nd quarter","3rd quarter","4th quarter"],"dateFormatItem-ms":"mm:ss","field-year":"Year","quarters-standAlone-narrow":["1","2","3","4"],"dateTimeFormat-long":"{1} {0}","field-week":"Week","months-standAlone-wide":["January",
"February","March","April","May","June","July","August","September","October","November","December"],"dateFormatItem-MMMd":"MMM d","timeFormat-long":"h:mm:ss a z","months-format-abbr":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"dayPeriods-format-wide-noon":"noon","timeFormat-short":"h:mm a","field-month":"Month","quarters-format-abbr":["Q1","Q2","Q3","Q4"],"days-format-abbr":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"dateFormatItem-M":"L","days-format-narrow":["S",
"M","T","W","T","F","S"],"field-second":"Second","field-day":"Day","dateFormatItem-MEd":"E, M/d","months-format-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"dateFormatItem-hm":"h:mm a","days-standAlone-abbr":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"dateFormat-short":"M/d/yy","dateFormatItem-yMMMEd":"EEE, MMM d, y","dateFormat-full":"EEEE, MMMM d, y","dateFormatItem-Md":"M/d","dateFormatItem-yMEd":"EEE, M/d/y","months-format-wide":["January","February","March","April","May","June",
"July","August","September","October","November","December"],"dateFormatItem-d":"d","quarters-format-wide":["1st quarter","2nd quarter","3rd quarter","4th quarter"],"days-format-wide":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],eraNarrow:["B","A"]});
define("dojo/date/locale",["dojo","dojo/date","dojo/cldr/supplemental","dojo/regexp","dojo/string","dojo/i18n","i18n!dojo/cldr/nls/gregorian"],function(e){e.getObject("date.locale",true,e);(function(){function d(f,g,i,j){return j.replace(/([a-z])\1*/ig,function(l){var h,k,q=l.charAt(0);l=l.length;var u=["abbr","wide","narrow"];switch(q){case "G":h=g[l<4?"eraAbbr":"eraNames"][f.getFullYear()<0?0:1];break;case "y":h=f.getFullYear();switch(l){case 1:break;case 2:if(!i.fullYear){h=String(h);h=h.substr(h.length-
2);break}default:k=true}break;case "Q":case "q":h=Math.ceil((f.getMonth()+1)/3);k=true;break;case "M":h=f.getMonth();if(l<3){h=h+1;k=true}else{q=["months-format",u[l-3]].join("-");h=g[q][h]}break;case "w":h=e.date.locale._getWeekOfYear(f,0);k=true;break;case "d":h=f.getDate();k=true;break;case "D":h=e.date.locale._getDayOfYear(f);k=true;break;case "E":h=f.getDay();if(l<3){h=h+1;k=true}else{q=["days-format",u[l-3]].join("-");h=g[q][h]}break;case "a":h=f.getHours()<12?"am":"pm";h=i[h]||g["dayPeriods-format-wide-"+
h];break;case "h":case "H":case "K":case "k":k=f.getHours();switch(q){case "h":h=k%12||12;break;case "H":h=k;break;case "K":h=k%12;break;case "k":h=k||24;break}k=true;break;case "m":h=f.getMinutes();k=true;break;case "s":h=f.getSeconds();k=true;break;case "S":h=Math.round(f.getMilliseconds()*Math.pow(10,l-3));k=true;break;case "v":case "z":if(h=e.date.locale._getZone(f,true,i))break;l=4;case "Z":h=e.date.locale._getZone(f,false,i);h=[h<=0?"+":"-",e.string.pad(Math.floor(Math.abs(h)/60),2),e.string.pad(Math.abs(h)%
60,2)];if(l==4){h.splice(0,0,"GMT");h.splice(3,0,":")}h=h.join("");break;default:throw new Error("dojo.date.locale.format: invalid pattern char: "+j);}if(k)h=e.string.pad(h,l);return h})}function a(f,g,i,j){var l=function(q){return q};g=g||l;i=i||l;j=j||l;var h=f.match(/(''|[^'])+/g),k=f.charAt(0)=="'";e.forEach(h,function(q,u){if(q){h[u]=(k?i:g)(q.replace(/''/g,"'"));k=!k}else h[u]=""});return j(h.join(""))}function c(f,g,i,j){j=e.regexp.escapeString(j);i.strict||(j=j.replace(" a"," ?a"));return j.replace(/([a-z])\1*/ig,
function(l){var h;h=l.charAt(0);var k=l.length,q="",u="";if(i.strict){if(k>1)q="0{"+(k-1)+"}";if(k>2)u="0{"+(k-2)+"}"}else{q="0?";u="0{0,2}"}switch(h){case "y":h="\\d{2,4}";break;case "M":h=k>2?"\\S+?":"1[0-2]|"+q+"[1-9]";break;case "D":h="[12][0-9][0-9]|3[0-5][0-9]|36[0-6]|"+u+"[1-9][0-9]|"+q+"[1-9]";break;case "d":h="3[01]|[12]\\d|"+q+"[1-9]";break;case "w":h="[1-4][0-9]|5[0-3]|"+q+"[1-9]";break;case "E":h="\\S+";break;case "h":h="1[0-2]|"+q+"[1-9]";break;case "k":h="1[01]|"+q+"\\d";break;case "H":h=
"1\\d|2[0-3]|"+q+"\\d";break;case "K":h="1\\d|2[0-4]|"+q+"[1-9]";break;case "m":case "s":h="[0-5]\\d";break;case "S":h="\\d{"+k+"}";break;case "a":k=i.am||g["dayPeriods-format-wide-am"];q=i.pm||g["dayPeriods-format-wide-pm"];h=k+"|"+q;if(!i.strict){if(k!=k.toLowerCase())h+="|"+k.toLowerCase();if(q!=q.toLowerCase())h+="|"+q.toLowerCase();if(h.indexOf(".")!=-1)h+="|"+h.replace(/\./g,"")}h=h.replace(/\./g,"\\.");break;default:h=".*"}f&&f.push(l);return"("+h+")"}).replace(/[\xa0 ]/g,"[\\s\\xa0]")}e.date.locale._getZone=
function(f,g){return g?e.date.getTimezoneName(f):f.getTimezoneOffset()};e.date.locale.format=function(f,g){g=g||{};var i=e.i18n.normalizeLocale(g.locale),j=g.formatLength||"short";i=e.date.locale._getGregorianBundle(i);var l=[];f=e.hitch(this,d,f,i,g);if(g.selector=="year")return a(i["dateFormatItem-yyyy"]||"yyyy",f);var h;if(g.selector!="date")(h=g.timePattern||i["timeFormat-"+j])&&l.push(a(h,f));if(g.selector!="time")(h=g.datePattern||i["dateFormat-"+j])&&l.push(a(h,f));return l.length==1?l[0]:
i["dateTimeFormat-"+j].replace(/\{(\d+)\}/g,function(k,q){return l[q]})};e.date.locale.regexp=function(f){return e.date.locale._parseInfo(f).regexp};e.date.locale._parseInfo=function(f){f=f||{};var g=e.i18n.normalizeLocale(f.locale);g=e.date.locale._getGregorianBundle(g);var i=f.formatLength||"short",j=f.datePattern||g["dateFormat-"+i],l=f.timePattern||g["timeFormat-"+i];i=f.selector=="date"?j:f.selector=="time"?l:g["dateTimeFormat-"+i].replace(/\{(\d+)\}/g,function(k,q){return[l,j][q]});var h=[];
return{regexp:a(i,e.hitch(this,c,h,g,f)),tokens:h,bundle:g}};e.date.locale.parse=function(f,g){var i=/[\u200E\u200F\u202A\u202E]/g,j=e.date.locale._parseInfo(g),l=j.tokens,h=j.bundle;f=(new RegExp("^"+j.regexp.replace(i,"")+"$",j.strict?"":"i")).exec(f&&f.replace(i,""));if(!f)return null;var k=["abbr","wide","narrow"],q=[1970,0,1,0,0,0,0],u="";f=e.every(f,function(t,v){if(!v)return true;v=l[v-1];var A=v.length;switch(v.charAt(0)){case "y":if(A!=2&&g.strict)q[0]=t;else if(t<100){t=Number(t);A=""+(new Date).getFullYear();
v=A.substring(0,2)*100;A=Math.min(Number(A.substring(2,4))+20,99);q[0]=t<A?v+t:v-100+t}else{if(g.strict)return false;q[0]=t}break;case "M":if(A>2){v=h["months-format-"+k[A-3]].concat();if(!g.strict){t=t.replace(".","").toLowerCase();v=e.map(v,function(m){return m.replace(".","").toLowerCase()})}t=e.indexOf(v,t);if(t==-1)return false}else t--;q[1]=t;break;case "E":case "e":v=h["days-format-"+k[A-3]].concat();if(!g.strict){t=t.toLowerCase();v=e.map(v,function(m){return m.toLowerCase()})}t=e.indexOf(v,
t);if(t==-1)return false;break;case "D":q[1]=0;case "d":q[2]=t;break;case "a":v=g.am||h["dayPeriods-format-wide-am"];A=g.pm||h["dayPeriods-format-wide-pm"];if(!g.strict){var x=/\./g;t=t.replace(x,"").toLowerCase();v=v.replace(x,"").toLowerCase();A=A.replace(x,"").toLowerCase()}if(g.strict&&t!=v&&t!=A)return false;u=t==A?"p":t==v?"a":"";break;case "K":if(t==24)t=0;case "h":case "H":case "k":if(t>23)return false;q[3]=t;break;case "m":q[4]=t;break;case "s":q[5]=t;break;case "S":q[6]=t}return true});
i=+q[3];if(u==="p"&&i<12)q[3]=i+12;else if(u==="a"&&i==12)q[3]=0;i=new Date(q[0],q[1],q[2],q[3],q[4],q[5],q[6]);g.strict&&i.setFullYear(q[0]);var r=l.join("");j=r.indexOf("d")!=-1;r=r.indexOf("M")!=-1;if(!f||r&&i.getMonth()>q[1]||j&&i.getDate()>q[2])return null;if(r&&i.getMonth()<q[1]||j&&i.getDate()<q[2])i=e.date.add(i,"hour",1);return i}})();(function(){var d=[];e.date.locale.addCustomFormats=function(a,c){d.push({pkg:a,name:c})};e.date.locale._getGregorianBundle=function(a){var c={};e.forEach(d,
function(f){f=e.i18n.getLocalization(f.pkg,f.name,a);c=e.mixin(c,f)},this);return c}})();e.date.locale.addCustomFormats("dojo.cldr","gregorian");e.date.locale.getNames=function(d,a,c,f){var g;f=e.date.locale._getGregorianBundle(f);d=[d,c,a];if(c=="standAlone"){c=d.join("-");g=f[c];if(g[0]==1)g=undefined}d[1]="format";return(g||f[d.join("-")]).concat()};e.date.locale.isWeekend=function(d,a){a=e.cldr.supplemental.getWeekend(a);d=(d||new Date).getDay();if(a.end<a.start){a.end+=7;if(d<a.start)d+=7}return d>=
a.start&&d<=a.end};e.date.locale._getDayOfYear=function(d){return e.date.difference(new Date(d.getFullYear(),0,1,d.getHours()),d)+1};e.date.locale._getWeekOfYear=function(d,a){if(arguments.length==1)a=0;var c=(new Date(d.getFullYear(),0,1)).getDay(),f=(c-a+7)%7;f=Math.floor((e.date.locale._getDayOfYear(d)+f-1)/7);c==a&&f++;return f};return e.date.locale});
define("orion/auth",["dojo","dijit","orion/globalCommands","dojo/date/locale","orion/widgets/LoginDialog"],function(e,d,a){function c(i,j){if(i.status===403){if(typeof f==="undefined")f=new d.Dialog({title:"Forbidden access"});var l=i.message;if(i.responseText)l=JSON.parse(i.responseText).Message||i.message;f.set("content",l);f.show()}if(i.status===401)try{var h=JSON.parse(i.responseText),k=localStorage.getItem(h.SignInKey),q=function(){var r=localStorage.getItem(h.SignInKey);if(k!==r){window.removeEventListener("storage",
q,false);delete g[h.SignInKey];a.setPendingAuthentication(g);j&&j()}};window.addEventListener("storage",q,false);if(h.SignInKey){g[h.SignInKey]=h;a.setPendingAuthentication(g)}}catch(u){}}var f,g={};e.addOnLoad(function(){window.dojo=e;window.eclipse=window.eclipse||{};eclipse.globalCommandUtils=a});return{handleAuthenticationError:c}});
define("dojo/DeferredList",["dojo"],function(e){e.DeferredList=function(d,a,c,f){var g=[];e.Deferred.call(this);var i=this;d.length===0&&!a&&this.resolve([0,[]]);var j=0;e.forEach(d,function(l,h){function k(q,u){g[h]=[q,u];j++;j===d.length&&i.resolve(g)}l.then(function(q){a?i.resolve([h,q]):k(true,q)},function(q){c?i.reject(q):k(false,q);if(f)return null;throw q;})})};e.DeferredList.prototype=new e.Deferred;e.DeferredList.prototype.gatherResults=function(d){d=new e.DeferredList(d,false,true,false);
d.addCallback(function(a){var c=[];e.forEach(a,function(f){c.push(f[1])});return c});return d};return e.DeferredList});
define("orion/preferences",["require","dojo","orion/auth","dojo/DeferredList"],function(e,d,a){function c(h,k){this._name=h;this._providers=k;this._flushPending=false;this._cached=null;this._stores=[];this._dirty=[]}function f(h,k){return{get:function(q,u){if(k===0)return null;q=localStorage.getItem(h+q);if(q===null)return null;q=JSON.parse(q);if(u||k===-1||q._expires&&q._expires>(new Date).getTime()){delete q._expires;return q}return null},set:function(q,u){if(k!==0){if(k!==-1)u._expires=(new Date).getTime()+
1E3*k;if(Object.keys(u).length===0)localStorage.removeItem(h+q);else{var r=JSON.stringify(u);localStorage.setItem(h+q,r);delete u._expires}}},remove:function(q){localStorage.removeItem(h+q)}}}function g(h){this._currentPromises={};this._cache=new f("/orion/preferences/user",0);this._service=null;this.available=function(){var k=this;if(!this._service){var q=h.getServiceReferences("orion.core.preference.provider");q.length>0&&h.getService(q[0],0).then(function(u){k._service=u})}return!!this._service}}
function i(h){this._location=h;this._currentPromise=null;this._cache=new f("/orion/preferences/default",3600)}function j(){this._cache=new f("/orion/preferences/local",-1)}function l(h,k){this._userProvider=new g(h);this._localProvider=new j;k=k||"defaults.pref";if(k.indexOf("://")===-1)k=e.toUrl(k);this._defaultsProvider=new i(k);this._serviceRegistration=h.registerService("orion.core.preference",this)}c.prototype={_flush:function(){for(var h=[],k=0;k<this._stores.length;++k){var q=this._stores[k];
this._dirty.indexOf(q)!==-1&&h.push(this._providers[k].put(this._name,q))}this._dirty=[];return new d.DeferredList(h)},_scheduleFlush:function(h){this._dirty.indexOf(h)===-1&&this._dirty.push(h);if(!this._flushPending){this._flushPending=true;window.setTimeout(d.hitch(this,function(){if(this._flushPending){this._flushPending=false;this._flush()}}),0)}},_getCached:function(){if(!this._cached){this._cached={};for(var h=0;h<this._stores.length;++h){var k=this._stores[h];for(var q in k)if(k.hasOwnProperty(q)&&
typeof this._cached[q]==="undefined")this._cached[q]=k[q]}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(h){return this._getCached()[h]},put:function(h,k){if(this._stores.length!==0){var q=this._stores[0];if(q[h]!==k){q[h]=k;this._cached=null;this._scheduleFlush(q)}}},remove:function(h){for(var k=0;k<this._stores.length;++k){var q=this._stores[k];if(q.hasOwnProperty(h)){delete q[h];this._cached=null;this._scheduleFlush(q);return true}}return false},clear:function(){for(var h=
0;h<this._stores.length;++h){this._stores[h]={};this._scheduleFlush(this._stores[h])}this._cached=null},sync:function(h){if(this._flushPending){this._flushPending=false;return this._flush()}for(var k=this,q=[],u=0;u<this._providers.length;++u)q.push(this._providers[u].get(this._name,h).then(function(r){return function(t){k._stores[r]=t}}(u)));return(new d.DeferredList(q)).then(function(){k._cached=null;k._getCached()})},flush:function(){this._flush()}};g.prototype={get:function(h,k){if(this._currentPromises[h])return this._currentPromises[h];
var q=new d.Deferred,u=null;if(k)this._cache.remove(h);else u=this._cache.get(h);if(u!==null)q.resolve(u);else{this._currentPromises[h]=q;var r=this;this._service.get(h).then(function(t){r._cache.set(h,t);delete r._currentPromises[h];q.resolve(t)},function(t){if(t.status===401){delete r._currentPromises[h];q.resolve({});a.handleAuthenticationError(t,function(){r.get(h)})}else if(t.status===404){t={};r._cache.set(h,t);delete r._currentPromises[h];q.resolve(t)}else{delete r._currentPromises[h];q.resolve(r._cache.get(h,
true)||{})}})}return q},put:function(h,k){var q=new d.Deferred;this._cache.set(h,k);var u=this;this._service.put(h,k).then(function(){q.resolve()},function(r){r.status===401?a.handleAuthenticationError(r,function(){u._service.put(h,k).then(function(){q.resolve()},function(){q.resolve()})}):q.resolve()});return q}};i.prototype={get:function(h,k){if(this._currentPromise)return this._currentPromise;var q=new d.Deferred,u=null;if(k)this._cache.remove(h);else u=this._cache.get(h);if(u!==null)q.resolve(u);
else{this._currentPromise=q;var r=this;d.xhrGet({url:this._location,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(t){r._cache.set(h,t[h]||{});r._currentPromise=null;q.resolve(t[h]||{})},error:function(t,v){if(v.xhr.status===401){r._currentPromise=null;q.resolve({});q=new d.Deferred;r._currentPromise=q;var A=this;a.handleAuthenticationError(v.xhr,function(){d.xhrGet(A)})}else if(v.xhr.status===404){r._cache.set(h,{});r._currentPromise=null;q.resolve({})}else{r._currentPromise=
null;t=r._cache.get(h,true);t!==null?q.resolve(t[h]||{}):q.resolve({})}}})}return q},put:function(){var h=new d.Deferred;h.resolve();return h}};j.prototype={get:function(h){var k=new d.Deferred;h=this._cache.get(h);h!==null?k.resolve(h):k.resolve({});return k},put:function(h,k){var q=new d.Deferred;this._cache.set(h,k);q.resolve();return q}};l.DEFAULT_SCOPE=1;l.LOCAL_SCOPE=2;l.USER_SCOPE=4;l.prototype={getPreferences:function(h,k){if(!k||typeof k!=="number"||k>7||k<1)k=l.DEFAULT_SCOPE|l.LOCAL_SCOPE|
l.USER_SCOPE;var q=[];l.USER_SCOPE&k&&this._userProvider.available()&&q.push(this._userProvider);l.LOCAL_SCOPE&k&&q.push(this._localProvider);l.DEFAULT_SCOPE&k&&q.push(this._defaultsProvider);var u=new c(h,q);return u.sync().then(function(){return u})}};return{PreferencesService:l}});
define("orion/pluginregistry",["dojo","orion/serviceregistry","dojo/DeferredList"],function(e,d){var a=a||{};a.Plugin=function(c,f,g){function i(x,m,o,p){if(!q)throw new Error("plugin not connected");var n=t++;v[String(n)]=p;g.postMessage({id:n,serviceId:x,method:m,params:o},q)}function j(x){var m={};if(x.methods)for(var o=0;o<x.methods.length;o++){var p=x.methods[o];m[p]=function(n){return function(){var s=Array.prototype.slice.call(arguments),y=new e.Deferred;k._load().then(function(){i(x.serviceId,
n,s,y)});return y.promise}}(p)}return m}function l(){var x=f.services;if(x)for(var m=0;m<x.length;m++){var o=x[m],p=j(o);A[o.serviceId]=g.registerService(o.type,p,o.properties)}}function h(x){try{if(x.method)if("plugin"===x.method){if(f){if(JSON.stringify(f)!==JSON.stringify(x.params[0])){for(var m in A)if(A.hasOwnProperty(m)){A[m].unregister();delete A[m]}f=x.params[0];l();g.updatePlugin(k)}}else{f=x.params[0];l()}if(!r){r=true;u.resolve(k)}}else if("dispatchEvent"===x.method){var o=A[x.serviceId];
o.dispatchEvent.apply(o,x.params)}else if("progress"===x.method){var p=v[String(x.requestId)];p.progress.apply(p,x.params)}else throw new Error("Bad response method: "+x.method);else{p=v[String(x.id)];delete v[String(x.id)];x.error?p.reject(x.error):p.resolve(x.result)}}catch(n){console.log(n)}}var k=this,q=null,u=new e.Deferred,r=false,t=0,v={},A={};this.getLocation=function(){return c};this.getData=function(){return f};this.uninstall=function(){for(var x in A)if(A.hasOwnProperty(x)){A[x].unregister();
delete A[x]}if(q){g.disconnect(q);q=null}g.uninstallPlugin(this)};this.getServiceReferences=function(){var x=[],m;for(m in A)A.hasOwnProperty(m)&&x.push(A[m].getServiceReference());return x};this._load=function(x){if(!q){q=g.connect(c,h);window.setTimeout(function(){if(!r){if(!x){f={};g.updatePlugin(k)}u.reject(new Error("Load timeout for plugin: "+c))}},15E3)}return u.promise};if(typeof c!=="string")throw new Error("invalid url:"+c);f&&l()};a.PluginRegistry=function(c,f){function g(t){if(t.indexOf("://")===
-1){var v=document.createElement("a");v.href=t;return v.href}return t}function i(t){delete h["plugin."+t.getLocation()]}function j(t){t=g(t);for(var v=0,A=k.length;v<A;v++){var x=k[v];if(t===x.getLocation())return x}return null}function l(t){h["plugin."+t.getLocation()]=JSON.stringify(t.getData())}var h=f||localStorage||{},k=[],q=[],u=new d.EventTarget;window.addEventListener("message",function(t){for(var v=0,A=t.source;v<q.length;v++)if(A===q[v].target){if(typeof q[v].useStructuredClone==="undefined")q[v].useStructuredClone=
typeof t.data!=="string";q[v].handler(q[v].useStructuredClone?t.data:JSON.parse(t.data));break}},false);var r={registerService:e.hitch(c,c.registerService),connect:function(t,v){var A=document.createElement("iframe");A.id=t;A.name=t;A.style.display="none";A.style.visibility="hidden";A.src=t;document.body.appendChild(A);t={iframe:A,target:A.contentWindow,handler:v,url:t};q.push(t);return t},disconnect:function(t){for(var v=0;v<q.length;v++)if(t===q[v]){q.splice(v,1);try{document.body.removeChild(t.iframe)}catch(A){}break}},
uninstallPlugin:function(t){i(t);for(var v=0;v<k.length;v++)if(t===k[v]){k.splice(v,1);u.dispatchEvent("pluginRemoved",t);break}},updatePlugin:function(t){h["plugin."+t.getLocation()]=JSON.stringify(t.getData());u.dispatchEvent("pluginUpdated",t)},postMessage:function(t,v){v.target.postMessage(v.useStructuredClone?t:JSON.stringify(t),v.url)}};this.startup=function(t){for(var v=[],A=0;A<t.length;++A){var x=t[A];x=g(x);var m="plugin."+x;if(h[m]){if(j(x)===null){m=JSON.parse(h[m]);x=new a.Plugin(x,m,
r);k.push(x)}}else{h[m]="{}";x=new a.Plugin(x,{},r);k.push(x);v.push(x._load(false))}}return new e.DeferredList(v)};this.shutdown=function(){for(var t=0;t<q.length;t++)try{document.body.removeChild(q[t].iframe)}catch(v){}};this.installPlugin=function(t,v){t=g(t);var A=new e.Deferred,x=j(t);if(x)if(x.getData())A.resolve(x);else{var m=function(o){if(o.getLocation()===t){A.resolve(o);u.removeEventListener("pluginAdded",m)}};u.addEventListener("pluginAdded",m)}else{x=new a.Plugin(t,v,r);k.push(x);if(x.getData()){l(x);
u.dispatchEvent("pluginAdded",x);A.resolve(x)}else x._load(true).then(function(){l(x);u.dispatchEvent("pluginAdded",x);A.resolve(x)},function(o){A.reject(o)})}return A.promise};this.getPlugins=function(){for(var t=[],v=0;v<k.length;v++)k[v].getData()&&t.push(k[v]);return t};this.getPlugin=function(t){if((t=j(t))&&t.getData())return t;return null};this.addEventListener=function(t,v){u.addEventListener(t,v)};this.removeEventListener=function(t,v){u.removeEventListener(t,v)}};return a});
define("orion/bootstrap",["require","dojo","orion/serviceregistry","orion/preferences","orion/pluginregistry"],function(e,d,a,c,f){function g(){var i=new a.ServiceRegistry,j=new c.PreferencesService(i),l=new f.PluginRegistry(i);return j.getPreferences("/plugins").then(function(h){h=h.keys();for(var k=0;k<h.length;++k)if(h[k].indexOf("://")===-1)h[k]=e.toUrl(h[k]);return l.startup(h)}).then(function(){if(i.getServiceReferences("orion.core.preference.provider").length>0)return j.getPreferences("/plugins",
j.USER_SCOPE).then(function(h){h=h.keys();for(var k=0;k<h.length;++k)if(h[k].indexOf("://")===-1)h[k]=e.toUrl(h[k]);return l.startup(h)})}).then(function(){d.addOnWindowUnload(function(){l.shutdown()})}).then(function(){return{serviceRegistry:i,preferences:j,pluginRegistry:l}})}return{startup:g}});
define("orion/status",["require","dojo"],function(e,d){function a(c,f,g){this._serviceRegistry=c;this._serviceRegistration=c.registerService("orion.page.message",this);this.domId=f;this.progressDomId=g||f}a.prototype={setMessage:function(c,f){d.place(window.document.createTextNode(c),this.domId,"only");if(typeof f==="number"){var g=this;window.setTimeout(function(){var i=d.byId(g.domId);(typeof i.textContent==="string"?i.textContent:i.innerText)===c&&d.place(window.document.createTextNode(""),g.domId,
"only")},f)}},setErrorMessage:function(c){var f=c.responseText||c.message||c;try{f=JSON.parse(f)}catch(g){}c=f.Message||f;var i="red";if(f.Severity)switch(f.Severity){case "Warning":i="#FFCC00";break;case "Error":i="red";break;case "Info":case "Ok":i="green";break}f=d.create("span",{style:{color:i}});d.place(window.document.createTextNode(c),f);d.place(f,this.domId,"only")},setProgressMessage:function(c){d.place(window.document.createTextNode(c),this.progressDomId,"only")},setProgressResult:function(c){c=
c.responseText||c;try{c=JSON.parse(c)}catch(f){}var g=c.Message||c,i=e.toUrl("images/info.gif"),j="info";if(c.Severity)switch(c.Severity){case "Warning":i=e.toUrl("images/warning.gif");j="warning";break;case "Error":i=e.toUrl("images/error.gif");j="error";break}var l=new Image;l.alt=j;l.title="Press to clear message";l.name=j;l.src=i;d.style(l,"opacity","0.7");d.connect(l,"onmouseover",this,function(){d.style(l,"opacity","1")});d.connect(l,"onmouseout",this,function(){d.style(l,"opacity","0.7")});
d.connect(l,"onclick",this,function(){this.setProgressMessage("")});d.place(l,this.progressDomId,"only");c.HTML?d.place(g,this.progressDomId,"last"):d.place(window.document.createTextNode("   "+g),this.progressDomId,"last")},showWhile:function(c,f){var g=this;g.setProgressMessage(f);return c.then(function(i){if(i&&i.Location&&i.Message&&i.Running)return g._doProgressWhile(i);g.setProgressMessage("");i&&i.Result&&g.setProgressResult(i.Result);return i})},_doProgressWhile:function(c){var f=new d.Deferred;
window.setTimeout(function(){d.xhrGet({url:c.Location,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(g){f.callback(g)}})},2E3);return this.showWhile(f,c.Message)}};a.prototype.constructor=a;return{StatusReportingService:a}});
define("orion/treetable",["dojo"],function(e){function d(a){this._init(a)}d.prototype={_init:function(a){var c=a.parent,f=this;if(typeof c==="string")c=e.byId(c);if(!c)throw"no parent";if(!a.model)throw"no tree model";if(!a.renderer)throw"no renderer";this._parent=c;this._treeModel=a.model;this._renderer=a.renderer;this._showRoot=a.showRoot===undefined?false:a.showRoot;this._indent=a.indent===undefined?16:a.indent;this._labelColumnIndex=a.labelColumnIndex===undefined?0:a.labelColumnIndex;this._id=
a.id===undefined?"treetable":a.id;this._root=this._treeModel.getRoot(function(g){if(this._showRoot){g._depth=0;this._generate([g],0)}else f._treeModel.getChildren(g,function(i){f._generate(i,0)})})},_generate:function(a,c){e.empty(this._parent);var f=document.createElement("table");f.id=this._id;this._renderer.initTable(f,this);var g=document.createElement("tbody");g.id=this._id+"tbody";this._generateChildren(a,c,g,"last");f.appendChild(g);this._parent.appendChild(f);this._rowsChanged()},_generateChildren:function(a,
c,f,g){for(var i in a){var j=document.createElement("tr");j.id=this._treeModel.getId(a[i]);j._depth=c;j._item=a[i];this._renderer.render(a[i],j);e.style(j.childNodes[this._labelColumnIndex],"paddingLeft",this._indent*c+"px");e.place(j,f,g);if(g==="after")f=j}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(a,c,f,g,i,j){var l=this._treeModel.getId(a),h;if(l===this._id){this._removeChildRows(l);
this._generateChildren(c,0,e.byId(l+"tbody"),"last");this._rowsChanged()}else{var k=e.byId(l);if(k){k._item=a;if(k&&(f||k._expanded)){k._expanded=true;this._removeChildRows(l);if(c){this._generateChildren(c,k._depth+1,k,"after");this._rowsChanged();if(g&&i){a=e.byId(g);e.addClass(a,i);j&&e.removeClass(a,j)}}else{h=this;c=this._treeModel.getChildren(k._item,function(q){h._generateChildren(q,k._depth+1,k,"after");h._rowsChanged()})}}}else console.log("could not find table row "+l)}},refreshAndExpand:function(a,
c,f,g,i){this.refresh(a,c,true,f,g,i)},getItem:function(a){if(typeof a==="string"){var c=e.byId(a);if(c)return c._item}if(a._item)return a._item;return a},toggle:function(a,c,f,g){var i=e.byId(a);if(i)if(i._expanded){this.collapse(a);if(c){a=e.byId(c);e.addClass(a,g);e.removeClass(a,f)}}else{this.expand(a);if(c){a=e.byId(c);e.addClass(a,f);e.removeClass(a,g)}}},isExpanded:function(a){if(a=e.byId(a))return a._expanded;return false},expand:function(a,c,f){a=typeof a==="string"?a:this._treeModel.getId(a);
var g=e.byId(a);if(g)if(!g._expanded){g._expanded=true;var i=this;this._treeModel.getChildren(g._item,function(j){i._generateChildren(j,g._depth+1,g,"after");i._rowsChanged();c&&c.apply(this,f)})}},_removeChildRows:function(a){e.byId(this._id);var c=a===this._id,f=false,g=-1,i=[];e.query(".treeTableRow").forEach(function(h){if(!f)if(c)if(h._depth>g)i.push(h);else f=true;else if(h.id===a){c=true;g=h._depth}});for(var j in i){var l=i[j];l.parentNode.removeChild(l)}},collapse:function(a){a=typeof a===
"string"?a:this._treeModel.getId(a);var c=e.byId(a);if(c)if(c._expanded){c._expanded=false;this._removeChildRows(a);this._rowsChanged()}}};d.prototype.constructor=d;return{TableTree:d}});
define("orion/explorer",["require","dojo","orion/treetable"],function(e,d,a){var c={};c.Explorer=function(){function f(g,i,j){this.registry=g;this.renderer=j;this.selection=i;this.myTree=null}f.prototype={changedItem:function(g,i){d.hitch(this.myTree,this.myTree.refreshAndExpand)(g,i)},updateCommands:function(g){this.myTree&&d.hitch(this.myTree._renderer,this.myTree._renderer.updateCommands(g))},makeNewItemPlaceHolder:function(g,i,j){g=this.getRow(g);if(j){g=g.childNodes[j];d.place("<br><span id='"+
i+"placeHolderRow'></span>",g,"last");if(j=d.byId(i+"placeHolderRow"))return{tempNode:j,refNode:j}}if(g){d.place("<tr id='"+i+"placeHolderRow'><td id='"+i+"placeHolderCol'></td>",g,"after");j=d.byId(i+"placeHolderRow");g=d.byId(i+"placeHolderCol");if(j&&g)return{tempNode:j,refNode:g}}return null},getRow:function(g){if(g=this.model.getId(g))return d.byId(g)},createTree:function(g,i){var j=g+"innerTree",l=d.byId(j);l&&d.destroy(l);if(i)i.rootId=j;this.model=i;this.myTree=new a.TableTree({id:j,model:i,
showRoot:false,parent:g,labelColumnIndex:this.checkbox?1:0,renderer:this.renderer});this.renderer._initializeUIState()},getRootPath:function(){if(this.model&&this.model.root)return this.model.root.Location;return null},_lastHash:null,checkbox:this.checkbox||true};return f}();c.ExplorerModel=function(){function f(g,i){this.rootPath=g;this.fetchItems=i}f.prototype={destroy:function(){},getRoot:function(g){this.fetchItems(this.rootPath).then(d.hitch(this,function(i){this.root=i;g(i)}))},getChildren:function(g,
i){if(g.Children)i(g.Children);else g.ChildrenLocation?this.fetchItems(g.ChildrenLocation).then(d.hitch(this,function(j){g.Children=j;i(j)})):i([])},getId:function(g){if(g===this.root)g=this.rootId;else{g=g.Location;g=g.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")}return g}};return f}();c.ExplorerFlatModel=function(){function f(g,i,j){this.rootPath=g;this.fetchItems=i;this.root=j}f.prototype=new c.ExplorerModel;f.prototype.getRoot=function(g){this.root?g(this.root):this.fetchItems(this.rootPath).then(d.hitch(this,
function(i){this.root=i;g(i)}))};f.prototype.getChildren=function(g,i){g===this.root?i(this.root):i([])};return f}();c.ExplorerRenderer=function(){function f(g,i){this.explorer=i;this._init(g);this._expandImageClass="core-sprite-twistie_open";this._collapseImageClass="core-sprite-twistie_closed"}f.prototype={initTable:function(g,i){this.tableTree=i;d.empty(g);d.addClass(g,"treetable");this.renderTableHeader(g)},getActionsColumn:function(g,i){d.connect(i,"onmouseover",i,function(){var h=d.byId(this.id+
"actionswrapper");d.style(h,"visibility","visible")});d.connect(i,"onmouseout",i,function(){var h=d.byId(this.id+"actionswrapper");d.style(h,"visibility","hidden")});var j=document.createElement("td");j.id=i.id+"actions";var l=document.createElement("span");l.id=i.id+"actionswrapper";j.appendChild(l);d.style(l,"visibility","hidden");this.explorer.registry.getService("orion.page.command").then(function(h){h.renderCommands(l,"object",g,this.explorer,"image")});return j},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},
getCheckboxColumn:function(g,i){if(this._useCheckboxSelection){g=document.createElement("td");d.addClass(g,"secondaryColumn");var j=document.createElement("input");d.style(j,"verticalAlign","middle");j.type="checkbox";j.id=i.id+"selectedState";d.addClass(j,"selectionCheckmark");j.itemId=i.id;g.appendChild(j);d.connect(j,"onclick",d.hitch(this,function(l){d.toggleClass(i,"checkedRow",!!l.target.checked);this._storeSelections();this.explorer.selection&&this.explorer.selection.setSelections(this.getSelected())}));
return g}},_storeSelections:function(){var g=this.getSelectedIds(),i=this._getUIStatePreferencePath();if(i&&window.sessionStorage)window.sessionStorage[i+"selection"]=JSON.stringify(g)},_restoreSelections:function(g){g=window.sessionStorage[g+"selection"];if(typeof g==="string")g=g.length>0?JSON.parse(g):null;var i;if(g)for(i=0;i<g.length;i++){var j=d.byId(g[i]);if(j){d.addClass(j,"checkedRow");if(j=d.byId(j.id+"selectedState"))j.checked=true}}g=this.getSelected();this.explorer.selection&&this.explorer.selection.setSelections(g)},
_storeExpansions:function(g){window.sessionStorage[g+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(g){var i=false,j=window.sessionStorage[g+"expanded"];if(typeof j==="string")j=j.length>0?JSON.parse(j):null;var l;if(j)for(l=0;l<j.length;l++)if(d.byId(j[l])){this._expanded.push(j[l]);this.tableTree.expand(j[l],d.hitch(this,function(){this._restoreSelections(g)}));i=true}return!i},_getUIStatePreferencePath:function(){if(this.explorer){var g=this.explorer.getRootPath();if(this._cachePrefix&&
g)return"/"+this._cachePrefix+"/"+g.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")+"/uiState"}return null},expandCollapseImageId:function(g){return g+"__expand"},getExpandImage:function(g,i,j,l){var h=d.create("span",{id:this.expandCollapseImageId(g.id)},i,"last");d.addClass(h,"imageSprite");d.addClass(h,this._collapseImageClass);i=d.create("span",null,i,"last");d.addClass(i,l||"imageSprite");d.addClass(i,j||"core-sprite-folder");h.onclick=d.hitch(this,function(){this.tableTree.toggle(g.id,this.expandCollapseImageId(g.id),
this._expandImageClass,this._collapseImageClass);if(this.tableTree.isExpanded(g.id))this._expanded.push(g.id);else for(var k in this._expanded)if(this._expanded[k]===g.id){this._expanded.splice(k,1);break}(k=this._getUIStatePreferencePath())&&window.sessionStorage&&this._storeExpansions(k)});return h},render:function(g,i){i.cellSpacing="8px";this.renderRow(g,i)},getSelected:function(){var g=[];d.query(".selectionCheckmark").forEach(d.hitch(this,function(i){i.checked&&g.push(this.tableTree.getItem(i.parentNode.parentNode))}));
return g},getSelectedIds:function(){var g=[];d.query(".selectionCheckmark").forEach(d.hitch(this,function(i){i.checked&&g.push(i.parentNode.parentNode.id)}));return g},rowsChanged:function(){d.query(".treeTableRow").forEach(function(g,i){if(i%2){d.addClass(g,"darkTreeTableRow");d.removeClass(g,"lightTreeTableRow")}else{d.addClass(g,"lightTreeTableRow");d.removeClass(g,"darkTreeTableRow")}});this.explorer.selection&&this.explorer.selection.setSelections(this.getSelected())},updateCommands:function(){var g=
this.explorer.registry;d.query(".treeTableRow").forEach(function(i){var j=d.byId(i.id+"actionswrapper");d.empty(j);g.getService("orion.page.command").then(function(l){l.renderCommands(j,"object",i._item,this.explorer,"image")})})},_init:function(g){if(g){this._useCheckboxSelection=g.checkbox===undefined?false:g.checkbox;this._colums=g.colums||[];this._cachePrefix=g.cachePrefix}},_initializeUIState:function(){this._expanded=[];var g=this._getUIStatePreferencePath();g&&window.sessionStorage&&this._restoreExpansions(g)&&
this._restoreSelections(g)}};return f}();c.SelectionRenderer=function(){function f(g,i){this._init(g);this.explorer=i}f.prototype=new c.ExplorerRenderer;f.prototype.renderTableHeader=function(g){var i=document.createElement("thead"),j=document.createElement("tr");d.addClass(i,"navTableHeading");this._useCheckboxSelection&&j.appendChild(this.initCheckboxColumn(g));for(var l=0,h=this.getCellHeaderElement(l);h;){d.addClass(h,"navColumn");j.appendChild(h);h=this.getCellHeaderElement(++l)}i.appendChild(j);
g.appendChild(i)};f.prototype.renderRow=function(g,i){d.style(i,"verticalAlign","baseline");d.addClass(i,"treeTableRow");var j=this.getCheckboxColumn(g,i);j&&i.appendChild(j);j=0;for(var l=this.getCellElement(j,g,i);l;){i.appendChild(l);d.addClass(l,"secondaryColumn");l=this.getCellElement(++j,g,i)}};f.prototype.getCellHeaderElement=function(){};f.prototype.getCellElement=function(){};return f}();return c});
define("orion/fileClient",["dojo","orion/auth","dojo/DeferredList"],function(e,d){function a(g,i,j){var l=new e.Deferred;g[i].apply(g,j).then(function(h){l.callback(h)},function(h){h.status===401?d.handleAuthenticationError(h,function(){g[i].apply(g,j).then(function(k){l.callback(k)},function(k){l.errback(k)})}):l.errback(h)});return l}function c(g,i,j,l){if(!g.readBlob)throw"source file service does not support binary read";if(!j.writeBlob)throw"target file service does not support binary write";
if(i[i.length-1]!=="/")return a(g,"readBlob",[i]).then(function(q){return a(j,"writeBlob",[l,q])});var h=l.substring(0,l.length-1),k=decodeURIComponent(h.substring(h.lastIndexOf("/")+1));h=h.substring(0,h.lastIndexOf("/")+1);return a(j,"createFolder",[h,k]).then(function(){},function(){}).then(function(){if(i.indexOf("/")===0)i+="?depth=1";return a(g,"fetchChildren",[i]).then(function(q){for(var u=[],r=0;r<q.length;++r){var t=q[r].Location,v=t;if(q[r].Directory)v=t.substring(0,t.length-1);v=decodeURIComponent(v.substring(v.lastIndexOf("/")+
1));v=l+encodeURIComponent(v);if(q[r].Directory)v+="/";u[r]=c(g,t,j,v)}return new e.DeferredList(u)})})}function f(g,i){function j(A){var x=new e.Deferred;x.reject("No Matching FileService for location:"+A);return x}var l=g.getServiceReferences("orion.core.file"),h=l;if(i){h=[];for(var k=0;k<l.length;++k)i(l[k])&&h.push(l[k])}for(var q=[],u=[],r=[],t={fetchChildren:function(){var A=new e.Deferred;A.resolve(r);return A},createWorkspace:function(){var A=new e.Deferred;A.reject("no file service");return A},
loadWorkspaces:function(){var A=new e.Deferred;A.reject("no file service");return A},loadWorkspace:function(){var A=new e.Deferred;A.resolve({Directory:true,Length:0,LocalTimeStamp:0,Name:"",Location:"",Children:r});return A},createProject:j,createFolder:j,createFile:j,deleteFile:j,moveFile:j,copyFile:j,read:j,write:j},v=0;v<h.length;++v){r[v]={Directory:true,Length:0,LocalTimeStamp:0,Location:h[v].getProperty("top"),ChildrenLocation:h[v].getProperty("top"),Name:h[v].getProperty("Name")};i=h[v].getProperty("pattern")||
".*";if(i[0]!=="^")i="^"+i;q[v]=new RegExp(i);g.getService(h[v],0).then(function(A){u[v]=A})}if(u.length===1)t=u[0];this._getService=function(A){if(!A)return t;for(var x=0;x<q.length;++x)if(q[x].test(A))return u[x];throw"No Matching FileService for location:"+A;}}f.prototype={fetchChildren:function(g){return a(this._getService(g),"fetchChildren",arguments)},createWorkspace:function(){return a(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return a(this._getService(),"loadWorkspaces",
arguments)},loadWorkspace:function(g){return a(this._getService(g),"loadWorkspace",arguments)},createProject:function(g){return a(this._getService(g),"createProject",arguments)},createFolder:function(g){return a(this._getService(g),"createFolder",arguments)},createFile:function(g){return a(this._getService(g),"createFile",arguments)},deleteFile:function(g){return a(this._getService(g),"deleteFile",arguments)},moveFile:function(g,i,j){var l=this._getService(g),h=this._getService(i);if(l===h)return a(l,
"moveFile",arguments);var k=g[g.length-1]==="/",q=i;if(q[q.length-1]!=="/")q+="/";if(j)q+=encodeURIComponent(j);else{var u=g;if(k)u=u.substring(0,u.length-1);q+=u.substring(u.lastIndexOf("/")+1)}if(k&&q[q.length-1]!=="/")q+="/";return c(l,g,h,q).then(function(){return a(l,"deleteFile",[g])})},copyFile:function(g,i){var j=this._getService(g),l=this._getService(i);if(j===l)return a(j,"copyFile",arguments);var h=g[g.length-1]==="/",k=i;if(k[k.length-1]!=="/")k+="/";var q=g;if(h)q=q.substring(0,q.length-
1);k+=q.substring(q.lastIndexOf("/")+1);if(h&&k[k.length-1]!=="/")k+="/";return c(j,g,l,k)},read:function(g){return a(this._getService(g),"read",arguments)},write:function(g){return a(this._getService(g),"write",arguments)},remoteImport:function(g){return a(this._getService(g),"remoteImport",arguments)},remoteExport:function(g){return a(this._getService(g),"remoteExport",arguments)}};f.prototype.constructor=f;return{FileClient:f}});
define("orion/searchExplorer",["require","dojo","dijit","orion/explorer","orion/util","orion/fileClient","orion/commands"],function(e,d,a,c,f,g,i){function j(k,q,u,r,t){this.registry=k;this.fileClient=q;this._resultLocation=u;this.searchStr=r.toLowerCase();this._treeRoot={isRoot:true,children:[]};this._listRoot={isRoot:true,children:[]};this.indexedFileItems=this.currentDetail=null;this.modelLocHash=[];this._lineDelimiter="\n";this.explorer=t}function l(k,q){this._init(k);this.explorer=q}function h(k,
q,u,r,t){this.parentNode=r;this.registry=k;this._commandService=q;this.fileClient=new g.FileClient(this.registry);this.checkbox=false;this.renderer=new l({checkbox:false},this);this.model=new j(k,this.fileClient,u,t,this)}j.prototype=new c.ExplorerModel;j.prototype.setCurrent=function(k,q){this.currentFileIndex=k;this.currentDetailIndex=q;this.storeStatus()};j.prototype.storeStatus=function(){window.sessionStorage[this.searchStr+"_search_result_useFlatList"]=JSON.stringify(this.useFlatList);window.sessionStorage[this.searchStr+
"_search_result_currentFileIndex"]=JSON.stringify(this.currentFileIndex);window.sessionStorage[this.searchStr+"_search_result_currentDetailIndex"]=JSON.stringify(this.currentDetailIndex)};j.prototype.restoreStatus=function(){this.useFlatList=false;var k=window.sessionStorage[this.searchStr+"_search_result_useFlatList"];if(typeof k==="string")if(k.length>0)this.useFlatList=JSON.parse(k);this.currentFileIndex=0;k=window.sessionStorage[this.searchStr+"_search_result_currentFileIndex"];if(typeof k===
"string")if(k.length>0)this.currentFileIndex=JSON.parse(k);if(this.currentFileIndex<0||this.currentFileIndex>=this.indexedFileItems.length)this.currentFileIndex=0;this.currentDetailIndex=0;k=window.sessionStorage[this.searchStr+"_search_result_currentDetailIndex"];if(typeof k==="string")if(k.length>0)this.currentDetailIndex=JSON.parse(k)};j.prototype.getRealRoot=function(){return this.useFlatList?this._listRoot:this._treeRoot};j.prototype.getRoot=function(k){k(this.getRealRoot())};j.prototype.markUpSharedParent=
function(k,q){if(this.sharedParentHash[k.Location]){var u=this.sharedParentHash[k.Location];if(typeof u==="string")if(u!==q)this.sharedParentHash[k.Location]=2}else this.sharedParentHash[k.Location]=q};j.prototype.preparecompressHash=function(){this.sharedParentHash=[];for(var k=0;k<this._resultLocation.length;k++){var q=this._resultLocation[k].metaData.Parents;if(q.length!==0)for(var u=this._resultLocation[k].location,r=0;r<q.length;r++){var t=q[r];this.markUpSharedParent(t,u);u=t.Location}}};j.prototype.compressParents=
function(k,q,u){if(k.length!==0)if(!(q>k.length-1)){var r=k[q].Name,t=k[q].Location,v=q+1,A=false;if(v<k.length)for(q=q+1;q<k.length;q++){v=q;if(this.sharedParentHash[k[q].Location]===2)break;else{r=k[q].Name+"/"+r;if(q===k.length-1)A=true}}u.push({Location:t,Name:r});A||this.compressParents(k,v,u)}};j.prototype.compressTree=function(){for(var k=0;k<this._resultLocation.length;k++)if(this._resultLocation[k].metaData){var q=this._resultLocation[k].metaData.Parents;if(q.length!==0){this.preparecompressHash();
var u=[];this.compressParents(q,0,u);this._resultLocation[k].metaData.compressedParents=u}}};j.prototype._findExistingParent=function(k,q){var u=this.modelLocHash[k[q].Location];if(u)return{parent:u,index:q};if(q===k.length-1)return null;return this._findExistingParent(k,q+1)};j.prototype.fullPathName=function(k,q){if(k&&k.parent)if(!k.parent.isRoot){q.name=k.parent.name+(q.name===""?"":"/")+q.name;k.parent&&this.fullPathName(k.parent,q)}};j.prototype.buildResultModelTree=function(k,q){q&&this.compressTree();
for(var u=0;u<this._resultLocation.length;u++)if(this._resultLocation[u].metaData){var r;r=q?this._resultLocation[u].metaData.compressedParents:this._resultLocation[u].metaData.Parents;var t=this._findExistingParent(r,0),v;if(t){v=t.parent;t=t.index}else{v=this._treeRoot;t=r.length}if(t>0)for(t=t-1;t>-1;t--){var A={parent:v,children:[],type:"dir",name:r[t].Name,location:r[t].Location};v.children.push(A);f.processSearchResultParent(v);v=this.modelLocHash[r[t].Location]=A}r={name:""};t={parent:v,type:"file",
name:this._resultLocation[u].name,linkLocation:this._resultLocation[u].linkLocation,location:this._resultLocation[u].location};this.fullPathName(t,r);t.fullPathName=r.name;this.modelLocHash[t.location]=t;v.children.push(t);f.processSearchResultParent(v)}this.prepareFileItems();this.restoreStatus();k()};j.prototype.loadOneFileMetaData=function(k,q){var u=this._resultLocation[k];this.fileClient.read(u.location,true).then(d.hitch(this,function(r){u.metaData=r;k===this._resultLocation.length-1?this.buildResultModelTree(q,
true):this.loadOneFileMetaData(k+1,q)}),d.hitch(this,function(r){console.error("Error loading file metadata: "+r.message);k===this._resultLocation.length-1?this.buildResultModelTree(q,true):this.loadOneFileMetaData(k+1,q)}))};j.prototype.prepareFileItems=function(){this.indexedFileItems=[];this.walkTreeNode(this._treeRoot);for(var k=0;k<this.indexedFileItems.length;k++)this._listRoot.children.push(this.indexedFileItems[k])};j.prototype.getFileItemIndex=function(k){for(var q=0;q<this.indexedFileItems.length;q++)if(k===
this.indexedFileItems[q])return q;return-1};j.prototype.getFileDetailItemIndex=function(k,q){if(k<0)return-1;k=this.indexedFileItems[k];if(k.children&&k.children.length>0)for(var u=0;u<k.children.length;u++)if(q===k.children[u])return u;return-1};j.prototype.walkTreeNode=function(k){if(k.children)for(var q=0;q<k.children.length;q++)this.walkTreeNode(k.children[q]);else k.type==="file"&&this.indexedFileItems.push(k)};j.prototype.getId=function(k){if(k===this.getRealRoot())k=this.rootId;else{k=k.location;
k=k.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")}return k};j.prototype.searchOneline=function(k,q){var u;u=0;for(var r=false,t=[];;){u=k.indexOf(q,u);if(u<0)break;else{t.push({startIndex:u});r=true;u=u+q.length}}if(r)return t;return null};j.prototype.searchWithinFile=function(k,q,u){q=q.split(this._lineDelimiter);if(k){k.children=[];for(var r=0;r<q.length;r++){var t=q[r];if(t&&t.length>0)if(this.searchOneline(t.toLowerCase(),u)){var v=r+1;k.children.push({parent:k,type:"detail",name:v+" : "+t,linkLocation:k.linkLocation+
"?line="+v,location:k.location+"-"+v})}}k.name=k.name+" ("+k.children.length+" matches)"}};j.prototype._fileExpanded=function(k,q){k=this.indexedFileItems[k];if(k.children&&k.children.length>0){if(q<0)q=k.children.length-1;else if(q>=k.children.length)q=0;return{childrenNumber:k.children.length,childDiv:d.byId(this.getId(k.children[q]))}}return{childrenNumber:0,childDiv:null}};j.prototype.getChildren=function(k,q){if(k.children)q(k.children);else if(k.type==="detail")q([]);else k.type==="file"&&k.location?
this.fileClient.read(k.location).then(d.hitch(this,function(u){this.searchWithinFile(k,u,this.searchStr);u=this.getId(k);if(d.byId(u))(u=d.byId(u+"NameColumn"))&&d.place(document.createTextNode(k.name),u,"only");q(k.children);if(this.highlightSelectionLater)if(k===this.indexedFileItems[this.currentFileIndex]){if(this.currentDetailIndex<0)this.currentDetailIndex=k.children.length-1;else if(this.currentDetailIndex>=k.children.length)this.currentDetailIndex=0;u=this._fileExpanded(this.currentFileIndex,
this.currentDetailIndex);d.toggleClass(u.childDiv,"currentSearchMatch",true);this.explorer.visible(u.childDiv)||u.childDiv.scrollIntoView(!this.lastNavDirection);this.highlightSelectionLater=false}}),d.hitch(this,function(u){console.error("Error loading file content: "+u.message);q([])})):q([])};j.prototype.constructor=j;l.prototype=new c.SelectionRenderer;l.prototype.getCellHeaderElement=function(k){if(k===0)return d.create("th",{innerHTML:"<h2>Search Results</h2>"});else if(this.explorer.model.useFlatList&&
k===1)return d.create("th",{innerHTML:"<h2>Location</h2>"})};l.prototype.getCellElement=function(k,q,u){switch(k){case 0:var r;if(q.type==="dir"){k=document.createElement("td");r=d.create("span",null,k,"only");this.getExpandImage(u,r);u=d.create("span",{id:u.id+"NameColumn"},r,"last")}else{k=document.createElement("td");var t=q.linkLocation;r=d.create("span",null,k,"only");if(q.type==="file")this.getExpandImage(u,r,"core-sprite-file");else{var v=this;d.connect(u,"onclick",u,function(){var x=v.explorer.model.getFileItemIndex(q.parent);
if(x>-1){var m=v.explorer.model.getFileDetailItemIndex(x,q);if(m>-1)if(!(v.explorer.model.currentFileIndex===x&&v.explorer.model.currentDetailIndex===m)){var o=v.explorer.model._fileExpanded(v.explorer.model.currentFileIndex,v.explorer.model.currentDetailIndex);o.childDiv&&d.toggleClass(o.childDiv,"currentSearchMatch",false);v.explorer.model.setCurrent(x,m);o=v.explorer.model._fileExpanded(v.explorer.model.currentFileIndex,v.explorer.model.currentDetailIndex);d.toggleClass(o.childDiv,"currentSearchMatch",
true)}}});var A=d.create("span",null,r,"last");d.addClass(A,"imageSprite");d.addClass(A,"core-sprite-none");A=d.create("span",null,r,"last");d.addClass(A,"imageSprite");d.addClass(A,"core-sprite-rightarrow")}u=d.create("a",{className:"navlink",id:u.id+"NameColumn",href:t},r,"last")}d.place(document.createTextNode(q.name),u,"only");return k;case 1:if(this.explorer.model.useFlatList&&q.type==="file"){k=document.createElement("td");r=d.create("span",null,k,"only");d.place(document.createTextNode(q.fullPathName),
r,"only");return k}}};l.prototype.constructor=l;h.prototype=new c.Explorer;h.prototype.onchange=function(){};h.prototype.initCommands=function(){var k=this,q=new i.Command({name:"Next result",imageClass:"core-sprite-move_down",id:"orion.search.nextResult",groupId:"orion.searchGroup",callback:function(){k.gotoNext(true,true)}}),u=new i.Command({name:"Previous result",imageClass:"core-sprite-move_up",id:"orion.search.prevResult",groupId:"orion.searchGroup",callback:function(){k.gotoNext(false,true)}}),
r=new i.Command({name:"Expand all results",imageClass:"core-sprite-expandAll",id:"orion.search.expandAll",groupId:"orion.searchGroup",callback:function(){k.expandAll()}}),t=new i.Command({name:"Collapse all results",imageClass:"core-sprite-collapseAll",id:"orion.search.collapseAll",groupId:"orion.searchGroup",callback:function(){k.collapseAll()}});this._commandService.addCommand(q,"dom");this._commandService.addCommand(u,"dom");this._commandService.addCommand(r,"dom");this._commandService.addCommand(t,
"dom");this._commandService.registerCommandContribution("orion.search.nextResult",1,"pageActionsRight");this._commandService.registerCommandContribution("orion.search.prevResult",2,"pageActionsRight");this._commandService.registerCommandContribution("orion.search.expandAll",3,"pageActionsRight");this._commandService.registerCommandContribution("orion.search.collapseAll",4,"pageActionsRight");d.empty("pageActionsRight");this._commandService.renderCommands("pageActionsRight","dom",k,k,"image");(q=a.byId("globalSearchOptMenu"))&&
q.destroy();q=new a.Menu({style:"display: none;",id:"globalSearchOptMenu"});q.addChild(new a.CheckedMenuItem({label:"Show as List",checked:k.model.useFlatList,onChange:function(v){k.switchTo(v)}}));q=new a.form.DropDownButton({label:"Options",dropDown:q});d.addClass(q.domNode,"commandImage");d.place(q.domNode,"pageActionsRight","last")};h.prototype.startUp=function(){var k=this;this.model.loadOneFileMetaData(0,function(){k.initCommands();k.createTree(k.parentNode,k.model);k.gotoCurrent()})};h.prototype.switchTo=
function(k){this.model.useFlatList=k;this.model.storeStatus();this.createTree(this.parentNode,this.model);this.gotoCurrent()};h.prototype.expandAll=function(){var k=this.model.getRealRoot();if(k.isRoot)for(var q=0;q<k.children.length;q++)this.expandRecursively(k.children[q]);else this.expandRecursively(k);this.gotoCurrent()};h.prototype.collapseAll=function(){var k=this.model.getRealRoot();if(k.isRoot)for(var q=0;q<k.children.length;q++)this.myTree.collapse(k.children[q]);else this.myTree.collapse(k)};
h.prototype.expandRecursively=function(k){if(k.type!=="detail"){this.myTree.expand(k);k=k.children;if(!(k===undefined||k===null))for(var q=k.length,u=0;u<q;u++)this.expandRecursively(k[u])}};h.prototype.findUIParentChain=function(k,q){q.push(k);var u=this.model.getId(k);if(d.byId(u))return q;this.findUIParentChain(k.parent,q)};h.prototype._decideNext=function(k,q){if(!q)return{newFileIndex:this.model.currentFileIndex,newDetailIndex:this.model.currentDetailIndex};q=this.model.indexedFileItems[this.model.currentFileIndex];
if(q.children&&q.children.length>0){k=k?this.model.currentDetailIndex+1:this.model.currentDetailIndex-1;if(k<0){q=this.model.currentFileIndex-1;k=-1}else if(k>q.children.length-1){q=this.model.currentFileIndex+1;k=0}else q=this.model.currentFileIndex;if(q<0)q=this.model.indexedFileItems.length-1;else if(q>=this.model.indexedFileItems.length)q=0;return{newFileIndex:q,newDetailIndex:k}}return null};h.prototype.visible=function(k){if(k.offsetWidth===0||k.offsetHeight===0)return false;var q=d.byId("orion.innerSearchResults").getClientRects()[0];
k=k.getClientRects();for(var u=0,r=k.length;u<r;u++){var t=k[u];if(t.top>=q.top&&t.top<=q.bottom&&t.bottom>=q.top&&t.bottom<=q.bottom)return true}return false};h.prototype.gotoCurrent=function(){this.gotoNext(true,false)};h.prototype.gotoNext=function(k,q){var u=this.model._fileExpanded(this.model.currentFileIndex,this.model.currentDetailIndex);u.childDiv&&d.toggleClass(u.childDiv,"currentSearchMatch",false);q=this._decideNext(k,q);this.model.highlightSelectionLater=true;this.model.lastNavDirection=
k;if(q){u=this.model._fileExpanded(q.newFileIndex,q.newDetailIndex);this.model.setCurrent(q.newFileIndex,q.newDetailIndex);if(u.childrenNumber>0){this.model.highlightSelectionLater=false;if(q.newDetailIndex<0)this.model.setCurrent(q.newFileIndex,u.childrenNumber-1);else q.newDetailIndex>=u.childrenNumber&&this.model.setCurrent(q.newFileIndex,0)}if(u.childDiv){d.toggleClass(u.childDiv,"currentSearchMatch",true);this.visible(u.childDiv)||u.childDiv.scrollIntoView(!k);return}}q=[];this.findUIParentChain(this.model.indexedFileItems[this.model.currentFileIndex],
q);for(u=q.length-1;u>-1;u--)this.myTree.expand(q[u]);if(!this.model.highlightSelectionLater){q=this.model._fileExpanded(this.model.currentFileIndex,this.model.currentDetailIndex);d.toggleClass(q.childDiv,"currentSearchMatch",true);this.visible(q.childDiv)||q.childDiv.scrollIntoView(!k)}};h.prototype.constructor=h;return{SearchResultExplorer:h}});
define("dojo/cookie",["dojo","dojo/regexp"],function(e){e.cookie=function(d,a,c){var f=document.cookie;if(arguments.length==1){var g=f.match(new RegExp("(?:^|; )"+e.regexp.escapeString(d)+"=([^;]*)"));return g?decodeURIComponent(g[1]):undefined}else{c=c||{};f=c.expires;if(typeof f=="number"){var i=new Date;i.setTime(i.getTime()+f*24*60*60*1E3);f=c.expires=i}if(f&&f.toUTCString)c.expires=f.toUTCString();a=encodeURIComponent(a);f=d+"="+a;for(g in c){f+="; "+g;i=c[g];if(i!==true)f+="="+i}document.cookie=
f}};e.cookie.isSupported=function(){if(!("cookieEnabled"in navigator)){this("__djCookieTest__","CookiesAllowed");navigator.cookieEnabled=this("__djCookieTest__")=="CookiesAllowed";navigator.cookieEnabled&&this("__djCookieTest__","",{expires:-1})}return navigator.cookieEnabled};return e.cookie});
define("dijit/layout/BorderContainer",["dojo","dijit","dijit/layout/_LayoutWidget","dojo/cookie","dijit/_Templated"],function(e,d){e.declare("dijit.layout.BorderContainer",d.layout._LayoutWidget,{design:"headline",gutters:true,liveSplitters:true,persist:false,baseClass:"dijitBorderContainer",_splitterClass:"dijit.layout._Splitter",postMixInProperties:function(){this.gutters||(this.baseClass+="NoGutter");this.inherited(arguments)},startup:function(){if(!this._started){e.forEach(this.getChildren(),
this._setupChild,this);this.inherited(arguments)}},_setupChild:function(a){var c=a.region;if(c){this.inherited(arguments);e.addClass(a.domNode,this.baseClass+"Pane");var f=this.isLeftToRight();if(c=="leading")c=f?"left":"right";if(c=="trailing")c=f?"right":"left";if(c!="center"&&(a.splitter||this.gutters)&&!a._splitterWidget){var g=e.getObject(a.splitter?this._splitterClass:"dijit.layout._Gutter");f=new g({id:a.id+"_splitter",container:this,child:a,region:c,live:this.liveSplitters});f.isSplitter=
true;a._splitterWidget=f;e.place(f.domNode,a.domNode,"after");f.startup()}a.region=c}},layout:function(){this._layoutChildren()},addChild:function(){this.inherited(arguments);this._started&&this.layout()},removeChild:function(a){var c=a.region,f=a._splitterWidget;if(f){f.destroy();delete a._splitterWidget}this.inherited(arguments);this._started&&this._layoutChildren();e.removeClass(a.domNode,this.baseClass+"Pane");e.style(a.domNode,{top:"auto",bottom:"auto",left:"auto",right:"auto",position:"static"});
e.style(a.domNode,c=="top"||c=="bottom"?"width":"height","auto")},getChildren:function(){return e.filter(this.inherited(arguments),function(a){return!a.isSplitter})},getSplitter:function(a){return e.filter(this.getChildren(),function(c){return c.region==a})[0]._splitterWidget},resize:function(){if(!this.cs||!this.pe){var a=this.domNode;this.cs=e.getComputedStyle(a);this.pe=e._getPadExtents(a,this.cs);this.pe.r=e._toPixelValue(a,this.cs.paddingRight);this.pe.b=e._toPixelValue(a,this.cs.paddingBottom);
e.style(a,"padding","0px")}this.inherited(arguments)},_layoutChildren:function(a,c){if(this._borderBox&&this._borderBox.h){var f=e.map(this.getChildren(),function(i,j){return{pane:i,weight:[i.region=="center"?Infinity:0,i.layoutPriority,(this.design=="sidebar"?1:-1)*(/top|bottom/.test(i.region)?1:-1),j]}},this);f.sort(function(i,j){i=i.weight;j=j.weight;for(var l=0;l<i.length;l++)if(i[l]!=j[l])return i[l]-j[l];return 0});var g=[];e.forEach(f,function(i){i=i.pane;g.push(i);i._splitterWidget&&g.push(i._splitterWidget)});
d.layout.layoutChildren(this.domNode,{l:this.pe.l,t:this.pe.t,w:this._borderBox.w-this.pe.w,h:this._borderBox.h-this.pe.h},g,a,c)}},destroyRecursive:function(){e.forEach(this.getChildren(),function(a){var c=a._splitterWidget;c&&c.destroy();delete a._splitterWidget});this.inherited(arguments)}});e.extend(d._Widget,{region:"",layoutPriority:0,splitter:false,minSize:0,maxSize:Infinity});e.declare("dijit.layout._Splitter",[d._Widget,d._Templated],{live:true,templateString:'<div class="dijitSplitter" dojoAttachEvent="onkeypress:_onKeyPress,onmousedown:_startDrag,onmouseenter:_onMouse,onmouseleave:_onMouse" tabIndex="0" role="separator"><div class="dijitSplitterThumb"></div></div>',
postMixInProperties:function(){this.inherited(arguments);this.horizontal=/top|bottom/.test(this.region);this._factor=/top|left/.test(this.region)?1:-1;this._cookieName=this.container.id+"_"+this.region},buildRendering:function(){this.inherited(arguments);e.addClass(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V"));if(this.container.persist){var a=e.cookie(this._cookieName);if(a)this.child.domNode.style[this.horizontal?"height":"width"]=a}},_computeMaxSize:function(){var a=this.horizontal?"h":
"w",c=e.marginBox(this.child.domNode)[a],f=e.filter(this.container.getChildren(),function(g){return g.region=="center"})[0];a=e.marginBox(f.domNode)[a];return Math.min(this.child.maxSize,c+a)},_startDrag:function(a){if(!this.cover){this.cover=e.doc.createElement("div");e.addClass(this.cover,"dijitSplitterCover");e.place(this.cover,this.child.domNode,"after")}e.addClass(this.cover,"dijitSplitterCoverActive");this.fake&&e.destroy(this.fake);if(!(this._resize=this.live)){(this.fake=this.domNode.cloneNode(true)).removeAttribute("id");
e.addClass(this.domNode,"dijitSplitterShadow");e.place(this.fake,this.domNode,"after")}e.addClass(this.domNode,"dijitSplitterActive dijitSplitter"+(this.horizontal?"H":"V")+"Active");if(this.fake)e.removeClass(this.fake,"dijitSplitterHover dijitSplitter"+(this.horizontal?"H":"V")+"Hover");var c=this._factor,f=this.horizontal,g=f?"pageY":"pageX",i=a[g],j=this.domNode.style;f=f?"h":"w";var l=e.marginBox(this.child.domNode)[f],h=this._computeMaxSize(),k=this.child.minSize||20;f=this.region;var q=f==
"top"||f=="bottom"?"top":"left",u=parseInt(j[q],10),r=this._resize,t=e.hitch(this.container,"_layoutChildren",this.child.id);f=e.doc;this._handlers=(this._handlers||[]).concat([e.connect(f,"onmousemove",this._drag=function(v,A){v=v[g]-i;var x=c*v+l,m=Math.max(Math.min(x,h),k);if(r||A)t(m);j[q]=v+u+c*(m-x)+"px"}),e.connect(f,"ondragstart",e.stopEvent),e.connect(e.body(),"onselectstart",e.stopEvent),e.connect(f,"onmouseup",this,"_stopDrag")]);e.stopEvent(a)},_onMouse:function(a){a=a.type=="mouseover"||
a.type=="mouseenter";e.toggleClass(this.domNode,"dijitSplitterHover",a);e.toggleClass(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V")+"Hover",a)},_stopDrag:function(a){try{this.cover&&e.removeClass(this.cover,"dijitSplitterCoverActive");this.fake&&e.destroy(this.fake);e.removeClass(this.domNode,"dijitSplitterActive dijitSplitter"+(this.horizontal?"H":"V")+"Active dijitSplitterShadow");this._drag(a);this._drag(a,true)}finally{this._cleanupHandlers();delete this._drag}if(this.container.persist)e.cookie(this._cookieName,
this.child.domNode.style[this.horizontal?"height":"width"],{expires:365})},_cleanupHandlers:function(){e.forEach(this._handlers,e.disconnect);delete this._handlers},_onKeyPress:function(a){this._resize=true;var c=this.horizontal,f=1,g=e.keys;switch(a.charOrCode){case c?g.UP_ARROW:g.LEFT_ARROW:f*=-1;case c?g.DOWN_ARROW:g.RIGHT_ARROW:break;default:return}c=e._getMarginSize(this.child.domNode)[c?"h":"w"]+this._factor*f;this.container._layoutChildren(this.child.id,Math.max(Math.min(c,this._computeMaxSize()),
this.child.minSize));e.stopEvent(a)},destroy:function(){this._cleanupHandlers();delete this.child;delete this.container;delete this.cover;delete this.fake;this.inherited(arguments)}});e.declare("dijit.layout._Gutter",[d._Widget,d._Templated],{templateString:'<div class="dijitGutter" role="presentation"></div>',postMixInProperties:function(){this.inherited(arguments);this.horizontal=/top|bottom/.test(this.region)},buildRendering:function(){this.inherited(arguments);e.addClass(this.domNode,"dijitGutter"+
(this.horizontal?"H":"V"))}});return d.layout.BorderContainer});
define("orion/searchClient",["require","dojo","dijit","orion/auth","orion/util","orion/searchExplorer","dijit/form/Button","dijit/layout/BorderContainer","dijit/layout/ContentPane"],function(e,d,a,c,f,g){function i(j){this.registry=j.serviceRegistry;this._commandService=j.commandService}i.prototype={search:function(j,l,h,k,q,u,r){d.xhrGet({url:l,handleAs:"json",headers:{Accept:"application/json","Orion-Version":"1"},sync:false,timeout:15E3,error:function(t,v){var A=this;c.handleAuthenticationError(v.xhr,
function(){d.xhrGet(A)})},load:d.hitch(this,function(t){this.showSearchResult(j,l,h,k,q,u,r,t)})})},handleError:function(j,l){console.error(j);var h=document.createTextNode(j);d.place(h,l,"only");return j},saveSearch:function(j,l){this.registry.getService("orion.core.favorite").then(function(h){h.addFavoriteSearch(j,l)})},createSearchQuery:function(j,l,h){if(h){l=/\*$/.test(h)?"":"*";return j+"Name:"+this._luceneEscape(h,true)+l}return j+this._luceneEscape(l)},_luceneEscape:function(j,l){var h="";
l='+-&|!(){}[]^"~:\\'+(!l?"*?":"");for(var k=0;k<j.length;k++){var q=j.charAt(k);if(l.indexOf(q)>=0)h+="\\";h+=q}return h},formatHighlight:function(j){j=j.split(/(##match|match##)/);for(var l=d.create("div"),h,k=0;k<j.length;k++){var q=j[k];if(q==="##match")h=d.create("b");else if(q==="match##"){d.place(h,l,"last");h=null}else d.place(document.createTextNode(q),h||l,"last")}return l},showSearchResult:function(j,l,h,k,q,u,r,t){r?this.showSearchResultInList(j,l,h,k,q,u,t):this.showSearchResultInTree(j,
l,h,k,q,u,t)},showSearchResultInTree:function(j,l,h,k,q,u,r){window.location.href.split("#");u=false;var t=[];d.empty(j);k=r.responseHeader.params.q;k=k.substring(k.indexOf("}")+1);if(r.response.numFound>0){for(var v=0;v<r.response.docs.length;v++){var A=r.response.docs[v];if(!A.Directory&&A.Location!==h){u||(u=true);var x;x=k&&A.LineNumber?f.hashFromPosition(A.Location,null,null,A.LineNumber,A.Offset,k.length):A.Location;t.push({linkLocation:e.toUrl("edit/edit.html")+"#"+x,location:x,name:A.Name})}}typeof q===
"function"&&q(j)}if(u)(new g.SearchResultExplorer(this.registry,this._commandService,t,j,l.split("q=")[1])).startUp();else{j=d.place("<div>No matches found for </div>",j,"only");j=d.create("b",null,j,"last");d.place(document.createTextNode(k),j,"only")}},showSearchResultInList:function(j,l,h,k,q,u,r){window.location.href.split("#");var t=false;d.empty(j);l=r.responseHeader.params.q;l=l.substring(l.indexOf("}")+1);if(r.response.numFound>0){for(var v=document.createElement("table"),A=0;A<r.response.docs.length;A++){var x=
r.response.docs[A];if(!x.Directory&&x.Location!==h){var m;if(!t){t=true;if(k){m=v.insertRow(0).insertCell(0);m.innerHTML="<h2>Search Results</h2>"}}m=v.insertRow(-1).insertCell(0);m.colspan=2;var o=document.createElement("a");d.place(document.createTextNode(x.Name),o);x.LineNumber&&d.place(document.createTextNode(" (Line "+x.LineNumber+")"),o);var p;p=l&&x.LineNumber?f.hashFromPosition(x.Location,null,null,x.LineNumber,x.Offset,l.length):x.Location;o.setAttribute("href",e.toUrl("edit/edit.html")+
"#"+p);m.appendChild(o);if(!u&&r.highlighting&&r.highlighting[x.Id]&&r.highlighting[x.Id].Text){x=r.highlighting[x.Id].Text[0];m=v.insertRow(-1).insertCell(0);m.colspan=2;d.place(this.formatHighlight(x),m,"only")}}}d.place(v,j,"last");typeof q==="function"&&q(j)}if(!t){j=d.place("<div>No matches found for </div>",j,"only");j=d.create("b",null,j,"last");d.place(document.createTextNode(l),j,"only")}}};i.prototype.constructor=i;return{Searcher:i}});
define("orion/git/gitClient",["require","dojo","orion/auth"],function(e,d,a){var c=c||{};c.GitService=function(){function f(g){if(g){this._serviceRegistry=g;this._serviceRegistration=g.registerService("orion.git.provider",this);var i=this;g.getService("orion.net.ssh").then(function(j){i._sshService=j})}}f.prototype={checkGitService:function(){},cloneGitRepository:function(g,i,j,l,h,k,q,u,r){var t={};if(g)t.Name=g;if(j)t.Path=j;if(i)t.GitUrl=i;t.Location=l;if(h)t.GitSshUsername=h;if(k)t.GitSshPassword=
k;if(q)t.GitSshKnownHost=q;if(u)t.GitSshPrivateKey=u;if(r)t.GitSshPassphrase=r;g=e.toUrl("gitapi/clone/._");g=g.substring(0,g.length-2);return d.xhrPost({url:g,headers:{"Orion-Version":"1"},postData:d.toJson(t),handleAs:"json",timeout:15E3,load:function(v){return v},error:function(v,A){a.handleAuthenticationError(A.xhr,function(){});console.error("HTTP status code: ",A.xhr.status);return v}})},initGitRepository:function(){console.error("Not implemented yet")},removeGitRepository:function(g){return d.xhrDelete({url:g,
headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(i){return i},error:function(i,j){a.handleAuthenticationError(j.xhr,function(){});console.error("HTTP status code: ",j.xhr.status);return i}})},getDiffContent:function(g,i,j){var l=this;d.xhrGet({url:g,headers:{"Orion-Version":"1"},content:{parts:"diff"},handleAs:"text",timeout:15E3,load:function(h,k){if(i)typeof i==="function"?i(h,k):l._serviceRegistration.dispatchEvent(i,h)},error:function(h,k){j&&j(h,k);var q=this;a.handleAuthenticationError(k.xhr,
function(){d.xhrGet(q)});return h}})},getDiffFileURI:function(g,i,j){d.xhrGet({url:g,headers:{"Orion-Version":"1"},content:{parts:"uris"},handleAs:"json",timeout:15E3,load:function(l,h){if(i)typeof i==="function"?i(l,h):service._serviceRegistration.dispatchEvent(i,l)},error:function(l,h){j&&j(l,h);var k=this;a.handleAuthenticationError(h.xhr,function(){d.xhrGet(k)});return l}})},getGitStatus:function(g,i,j){d.xhrGet({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(l,
h){if(i)typeof i==="function"?i(l,h):service._serviceRegistration.dispatchEvent(i,l)},error:function(l,h){j&&j(l,h);var k=this;a.handleAuthenticationError(h.xhr,function(){d.xhrGet(k)});return l}})},stage:function(g,i,j){return d.xhrPut({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(l,h){if(i)typeof i==="function"?i(l,h):service._serviceRegistration.dispatchEvent(i,l)},error:function(l,h){j&&j(l,h);a.handleAuthenticationError(h.xhr,function(){})}})},stageMultipleFiles:function(g,
i,j,l){return d.xhrPut({url:g,headers:{"Orion-Version":"1"},putData:d.toJson({Path:i}),handleAs:"json",timeout:15E3,load:function(h,k){if(j)typeof j==="function"?j(h,k):service._serviceRegistration.dispatchEvent(j,h)},error:function(h,k){l&&l(h,k);a.handleAuthenticationError(k.xhr,function(){});return h}})},unstageAll:function(g,i,j,l){return d.xhrPost({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,postData:d.toJson({Reset:i}),load:function(h,k){if(j)typeof j==="function"?j(h,k):
service._serviceRegistration.dispatchEvent(j,h)},error:function(h,k){l&&l(h,k);a.handleAuthenticationError(k.xhr,function(){});return h}})},unstage:function(g,i,j,l){return d.xhrPost({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,postData:d.toJson({Path:i}),load:function(h,k){if(j)typeof j==="function"?j(h,k):service._serviceRegistration.dispatchEvent(j,h)},error:function(h,k){l&&l(h,k);a.handleAuthenticationError(k.xhr,function(){});return h}})},checkoutPath:function(g,i,j,l){return d.xhrPut({url:g,
headers:{"Orion-Version":"1"},putData:d.toJson({Path:i}),handleAs:"json",timeout:15E3,load:function(h,k){if(j)typeof j==="function"?j(h,k):service._serviceRegistration.dispatchEvent(j,h)},error:function(h,k){l&&l(h,k);a.handleAuthenticationError(k.xhr,function(){});return h}})},commitAll:function(g,i,j,l,h){d.xhrPost({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,postData:j,load:function(k,q){if(l)typeof l==="function"?l(k,q):service._serviceRegistration.dispatchEvent(l,k)},error:function(k,
q){h&&h(k,q);a.handleAuthenticationError(q.xhr,function(){});return k}})},getGitClone:function(g,i){var j=this;return d.xhrGet({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(l,h){if(i)typeof i==="function"?i(l,h):j._serviceRegistration.dispatchEvent(i,l)},error:function(l,h){var k=this;a.handleAuthenticationError(h.xhr,function(){d.xhrGet(k)});console.error("HTTP status code: ",h.xhr.status)}})},getGitCloneConfig:function(g){return d.xhrGet({url:g,headers:{"Orion-Version":"1"},
handleAs:"json",timeout:5E3,load:function(i){return i},error:function(i,j){var l=this;a.handleAuthenticationError(j.xhr,function(){d.xhrGet(l)});console.error("HTTP status code: ",j.xhr.status)}})},getGitBranch:function(g){return d.xhrGet({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(i){return i},error:function(i,j){var l=this;a.handleAuthenticationError(j.xhr,function(){d.xhrGet(l)});console.error("HTTP status code: ",j.xhr.status)}})},getGitRemote:function(g){return d.xhrGet({url:g,
headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(i){return i},error:function(i,j){var l=this;a.handleAuthenticationError(j.xhr,function(){d.xhrGet(l)});console.error("HTTP status code: ",j.xhr.status)}})},checkoutBranch:function(g,i){return d.xhrPut({url:g,headers:{"Orion-Version":"1"},putData:d.toJson({Branch:i}),handleAs:"json",timeout:5E3,load:function(j){return j},error:function(j,l){a.handleAuthenticationError(l.xhr,function(){});console.error("HTTP status code: ",l.xhr.status);
return j}})},resetIndex:function(g,i){return d.xhrPost({url:g,headers:{"Orion-Version":"1"},postData:d.toJson({Commit:i,Reset:"HARD"}),handleAs:"json",timeout:5E3,load:function(j){return j},error:function(j,l){a.handleAuthenticationError(l.xhr,function(){});console.error("HTTP status code: ",l.xhr.status)}})},addBranch:function(g,i,j){var l={};if(i)l.Name=i;if(j)l.Branch=j;return d.xhrPost({url:g,headers:{"Orion-Version":"1"},postData:d.toJson(l),handleAs:"json",timeout:5E3,load:function(h){return h},
error:function(h,k){a.handleAuthenticationError(k.xhr,function(){});console.error("HTTP status code: ",k.xhr.status);return h}})},removeBranch:function(g){return d.xhrDelete({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(i){return i},error:function(i,j){a.handleAuthenticationError(j.xhr,function(){});console.error("HTTP status code: ",j.xhr.status);return i}})},addRemote:function(g,i,j){return d.xhrPost({url:g,headers:{"Orion-Version":"1"},putData:d.toJson({Remote:i,
RemoteURI:j}),handleAs:"json",timeout:5E3,load:function(l){return l},error:function(l,h){a.handleAuthenticationError(h.xhr,function(){});console.error("HTTP status code: ",h.xhr.status);return l}})},removeRemote:function(g){return d.xhrDelete({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(i){return i},error:function(i,j){a.handleAuthenticationError(j.xhr,function(){});console.error("HTTP status code: ",j.xhr.status);return i}})},doGitLog:function(g,i){var j=this;return d.xhrGet({url:g,
headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(l,h){if(i)typeof i==="function"?i(l,h):j._serviceRegistration.dispatchEvent(i,l);return l},error:function(l,h){var k=this;a.handleAuthenticationError(h.xhr,function(){d.xhrGet(k)});console.error("HTTP status code: ",h.xhr.status)}})},getDiff:function(g,i,j){var l=this;d.xhrPost({url:g,headers:{"Orion-Version":"1"},postData:d.toJson({New:i}),handleAs:"json",timeout:5E3,load:function(h,k){if(j)typeof j==="function"?j(h,k,k):l._serviceRegistration.dispatchEvent(j,
h)},error:function(h,k){var q=this;a.handleAuthenticationError(k.xhr,function(){d.xhrGet(q)});console.error("HTTP status code: ",k.xhr.status)}})},doFetch:function(g,i,j,l,h,k,q,u){var r=this;return d.xhrPost({url:g,headers:{"Orion-Version":"1"},postData:d.toJson({Fetch:"true",Force:i,GitSshUsername:l,GitSshPassword:h,GitSshKnownHost:k,GitSshPrivateKey:q,GitSshPassphrase:u}),handleAs:"json",timeout:5E3,load:function(t,v){if(j)typeof j==="function"?j(t,v,v):r._serviceRegistration.dispatchEvent(j,t)},
error:function(t,v){a.handleAuthenticationError(v.xhr,function(){});console.error("HTTP status code: ",v.xhr.status)}})},doMerge:function(g,i){return d.xhrPost({url:g,headers:{"Orion-Version":"1"},postData:d.toJson({Merge:i}),handleAs:"json",timeout:5E3,load:function(j,l){return{jsonData:j,secondArg:l}},error:function(j,l){a.handleAuthenticationError(l.xhr,function(){});console.error("HTTP status code: ",l.xhr.status);return{error:j,ioArgs:l}}})},doCherryPick:function(g,i,j,l){var h=this;return d.xhrPost({url:g,
headers:{"Orion-Version":"1"},postData:d.toJson({"Cherry-Pick":i}),handleAs:"json",timeout:5E3,load:function(k,q){if(j)typeof j==="function"?j(k,q):h._serviceRegistration.dispatchEvent(j,k);return{jsonData:k,secondArg:q}},error:function(k,q){l&&l(k,q);a.handleAuthenticationError(q.xhr,function(){});console.error("HTTP status code: ",q.xhr.status);return{error:k,ioArgs:q}}})},doRebase:function(g,i,j,l,h){var k=this,q={};q.Rebase=i;if(j)q.Operation=j;return d.xhrPost({url:g,headers:{"Orion-Version":"1"},
postData:d.toJson(q),handleAs:"json",timeout:5E3,load:function(u,r){if(l)typeof l==="function"?l(u,r):k._serviceRegistration.dispatchEvent(l,u);return{jsonData:u,secondArg:r}},error:function(u,r){h&&h(u,r);a.handleAuthenticationError(r.xhr,function(){});console.error("HTTP status code: ",r.xhr.status);return{error:u,ioArgs:r}}})},doPush:function(g,i,j,l,h,k,q,u,r,t){var v=this;return d.xhrPost({url:g,headers:{"Orion-Version":"1"},postData:d.toJson({PushSrcRef:i,PushTags:j,Force:l,GitSshUsername:k,
GitSshPassword:q,GitSshKnownHost:u,GitSshPrivateKey:r,GitSshPassphrase:t}),handleAs:"json",timeout:5E3,load:function(A,x){if(h)typeof h==="function"?h(A,x,x):v._serviceRegistration.dispatchEvent(h,A)},error:function(A,x){a.handleAuthenticationError(x.xhr,function(){});console.error("HTTP status code: ",x.xhr.status);return A}})},getLog:function(g,i,j){var l=this;return d.xhrPost({url:g,headers:{"Orion-Version":"1"},postData:d.toJson({New:i}),handleAs:"json",timeout:5E3,load:function(h,k){return k.xhr.getResponseHeader("Location")},
error:function(h,k){a.handleAuthenticationError(k.xhr,function(){});console.error("HTTP status code: ",k.xhr.status)}}).then(function(h){d.xhrGet({url:h,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(k,q){if(j)typeof j==="function"?j(k,q):l._serviceRegistration.dispatchEvent(j,k);return k},error:function(k,q){var u=this;a.handleAuthenticationError(q.xhr,function(){d.xhrGet(u)});console.error("HTTP status code: ",q.xhr.status)}})})},getDefaultRemoteBranch:function(g,i){var j=
this;d.xhrGet({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(l){return l},error:function(l,h){var k=this;a.handleAuthenticationError(h.xhr,function(){d.xhrGet(k)});console.error("HTTP status code: ",h.xhr.status)}}).then(function(l){if(l.Children[0]==null)return null;d.xhrGet({url:l.Children[0].Location,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(h,k){if(i)typeof i==="function"?i(h.Children[0],k):j._serviceRegistration.dispatchEvent(i,h.Children[0]);
return h},error:function(h,k){var q=this;a.handleAuthenticationError(k.xhr,function(){d.xhrGet(q)});console.error("HTTP status code: ",k.xhr.status)}})})},doAddTag:function(g,i,j){var l=this;return d.xhrPut({url:g,headers:{"Orion-Version":"1"},putData:d.toJson({Name:i}),handleAs:"json",timeout:5E3,load:function(h,k){if(j)typeof j==="function"?j(h,k,k):l._serviceRegistration.dispatchEvent(j,h)},error:function(h,k){a.handleAuthenticationError(k.xhr,function(){});console.error("HTTP status code: ",k.xhr.status)}})},
checkoutTag:function(g,i,j,l){var h=this;return d.xhrPut({url:g,headers:{"Orion-Version":"1"},putData:d.toJson({Tag:i,Branch:j}),handleAs:"json",timeout:5E3,load:function(k,q){if(l)typeof l==="function"?l(k,q,q):h._serviceRegistration.dispatchEvent(l,k);return k},error:function(k,q){a.handleAuthenticationError(q.xhr,function(){});console.error("HTTP status code: ",q.xhr.status);return k}})},addCloneConfigurationProperty:function(g,i,j,l,h){return d.xhrPost({url:g,headers:{"Orion-Version":"1"},postData:d.toJson({Key:i,
Value:j}),handleAs:"json",timeout:15E3,load:function(k,q){if(l)typeof l==="function"?l(k,q):service._serviceRegistration.dispatchEvent(l,k)},error:function(k,q){h&&h(k,q);a.handleAuthenticationError(q.xhr,function(){});return k}})},editCloneConfigurationProperty:function(g,i,j,l){return d.xhrPut({url:g,headers:{"Orion-Version":"1"},putData:d.toJson({Value:i}),handleAs:"json",timeout:15E3,load:function(h,k){if(j)typeof j==="function"?j(h,k):service._serviceRegistration.dispatchEvent(j,h)},error:function(h,
k){l&&l(h,k);a.handleAuthenticationError(k.xhr,function(){});return h}})},deleteCloneConfigurationProperty:function(g,i,j){return d.xhrDelete({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(l,h){if(i)typeof i==="function"?i(l,h):service._serviceRegistration.dispatchEvent(i,l)},error:function(l,h){j&&j(l,h);a.handleAuthenticationError(h.xhr,function(){});return l}})}};return f}();return c});
define("orion/compare/diff-provider",["dojo","orion/auth"],function(e,d){function a(g,i,j){var l=new e.Deferred;g[i].apply(g,j).then(function(h){l.callback(h)},function(h){h.status===401||h.status===403?d.handleAuthenticationError(h,function(){g[i].apply(g,j).then(function(k){l.callback(k)},function(k){l.errback(k)})}):l.errback(h)});return l}function c(g){if(g.indexOf("://")===-1){var i=document.createElement("a");i.href=g;return i.href}return g}function f(g,i){var j=g.getServiceReferences("orion.core.diff"),
l=j;if(i){l=[];for(var h=0;h<j.length;++h)i(j[h])&&l.push(j[h])}var k=[],q=[];for(h=0;h<l.length;++h){k[h]=new RegExp(l[h].getProperty("pattern")||".*");g.getService(l[h],0).then(function(u){q[h]=u})}this._getService=function(u){u=c(u);for(var r=0;r<k.length;++r)if(k[r].test(u))return q[r];throw"No Matching DiffService for location:"+u;}}f.prototype={getDiffContent:function(g){return a(this._getService(g),"getDiffContent",arguments)},getDiffFileURI:function(g){return a(this._getService(g),"getDiffFileURI",
arguments)}};return{DiffProvider:f}});
define("orion/compare/diff-parser",[],function(){var e=e||{};e.DiffParser=function(){function d(c){this._lineDelimiter=c?c:a?"\r\n":"\n"}var a=navigator.platform.indexOf("Win")!==-1;d.prototype={_init:function(){this._oFileContents=[];this._diffContents=[];this._oBlocks=[];this._nBlocks=[];this._hunkRanges=[];this._lastToken=" ";this._deltaMap=[];this._nFileContents=[];this._nNewLineAtEnd=this._oNewLineAtEnd=true;this._diffContentIndex=1},setLineDelim:function(c){this._lineDelimiter=c},getDiffArray:function(){return{array:this._diffContents,
index:this._diffContentIndex}},parse:function(c,f,g,i){this._init();if(f==="")return{outPutFile:c,mapper:[]};this._oFileContents=c===""?[]:c.split(this._lineDelimiter);this._diffContents=f.split(this._lineDelimiter);f=this._diffContents.length;this._hunkRanges=[];for(var j=0;j<f;j++){var l=this._parseHunkRange(j);l&&this._hunkRanges.push(l)}if(0===this._hunkRanges.length)return{outPutFile:c,mapper:[]};for(c=0;c<this._hunkRanges.length;c++)this._parsehunkBlock(c);this._buildMap(g);if(i===undefined||
!i)this._buildNewFile();return{outPutFile:this._nFileContents.join(this._lineDelimiter),mapper:this._deltaMap}},_logMap:function(){for(var c=0;c<this._deltaMap.length;c++)console.log(JSON.stringify(this._deltaMap[c]))},_logNewFile:function(){for(var c=0;c<this._nFileContents.length;c++)console.log(this._nFileContents[c])},_createBlock:function(c,f,g,i){if(!(i===g&&c===" ")){g=[g,i-g,"s"];if(c==="-")g[2]="r";else if(c==="+")g[2]="a";else if(c==="c")g[2]="c";f.push(g)}},_createMinusBlock:function(c,
f,g){var i=this._oBlocks.length;if(i===0||c!==this._oBlocks[i-1][0]){this._oBlocks.push([c===0?1:c,g]);this._nBlocks.push([f,0,-2])}else this._oBlocks[i-1][1]+=g},_createPlusBlock:function(c,f,g,i){var j=this._nBlocks.length;if(j===0||f!==this._nBlocks[j-1][0]){this._oBlocks.push([c===0?1:c,0]);this._nBlocks.push([f,g,i])}else{this._nBlocks[j-1][1]+=g;this._nBlocks[j-1][2]=i}},_parsehunkBlock:function(c){for(var f=" ",g=this._hunkRanges[c][0]+1,i=c===this._hunkRanges.length-1?this._diffContents.length:
this._hunkRanges[c+1][0],j=0,l=0,h=this._hunkRanges[c][1],k=this._hunkRanges[c][3],q=g,u=g;u<i;u++)if(0!==this._diffContents[u].length){var r=this._diffContents[u][0];if(r==="\\")if("\\ No newline at end of file"===this._diffContents[u].substring(0,this._diffContents[u].length-1)||"\\ No newline at end of file"===this._diffContents[u]){f==="-"?(this._oNewLineAtEnd=false):(this._nNewLineAtEnd=false);if(u>g&&"\r"===this._diffContents[u-1].substring(this._diffContents[u-1].length-1))this._diffContents[u-
1]=this._diffContents[u-1].substring(0,this._diffContents[u-1].length-1);continue}switch(r){case "-":case "+":case " ":break;default:continue}if(f!==r){if(r==="+")q=u;switch(f){case " ":h=this._hunkRanges[c][1]+j;k=this._hunkRanges[c][3]+l;break;case "-":this._createMinusBlock(h,k,this._hunkRanges[c][1]+j-h);break;case "+":this._createPlusBlock(h,k,this._hunkRanges[c][3]+l-k,q);break;default:}f=r}switch(r){case "-":j++;break;case "+":l++;break;case " ":j++;l++;break}}switch(f){case "-":this._createMinusBlock(h,
k,this._hunkRanges[c][1]+j-h);break;case "+":this._createPlusBlock(h,k,this._hunkRanges[c][3]+l-k,q);break}},_detectConflictes:function(c,f){if(c<0)return false;f=c+f;for(c=c;c<f;c++){var g=this._diffContents[c];if(g.indexOf("<<<<<")>-1||g.indexOf(">>>>>")>-1)return true}return false},_buildMap:function(c){for(var f=this._oBlocks.length,g=this._oFileContents.length,i=0,j=1,l=0;l<f;l++){j=this._oBlocks[l][0]-j;if(j>0){this._deltaMap.push([j,j,0]);i+=j}c&&this._detectConflictes(this._nBlocks[l][2],
this._nBlocks[l][1])?this._deltaMap.push([this._nBlocks[l][1],this._oBlocks[l][1],this._nBlocks[l][2]+1,1]):this._deltaMap.push([this._nBlocks[l][1],this._oBlocks[l][1],this._nBlocks[l][2]+1]);i+=this._oBlocks[l][1];j=this._oBlocks[l][0]+this._oBlocks[l][1]}if(0<g-j){this._deltaMap.push([g-j+1,g-j+1,0]);i+=g-j+1}if(i<g){j=g-i;c=this._deltaMap[this._deltaMap.length-1];if(c[2]===0){c[0]+=j;c[1]+=j}else if(c[2]===-1)this._deltaMap.push([j,j,0]);else c[1]+=j}},_buildNewFile:function(){for(var c=1,f=false,
g=this._deltaMap.length,i=0;i<g;i++){f=false;if(this._deltaMap[i][2]===0){for(var j=0;j<this._deltaMap[i][0];j++)this._nFileContents.push(this._oFileContents[c+j-1]);f=true}else if(this._deltaMap[i][2]>0)for(j=0;j<this._deltaMap[i][0];j++)this._nFileContents.push(this._diffContents[this._deltaMap[i][2]+j-1].substring(1));c+=this._deltaMap[i][1]}if(this._nNewLineAtEnd&&!f){this._nFileContents.push("");this._deltaMap[g-1][0]+=1}},_parseHRangeBody:function(c,f){if(0<c.indexOf(",")){c=c.split(",");f.push(parseInt(c[0]));
f.push(parseInt(c[1]))}else{f.push(parseInt(c));f.push(1)}},_parseHunkRange:function(c){var f=this._diffContents[c];if(!(8>f.length))if("@@"===f.substring(0,2)){f=f.substring(2);var g=f.indexOf("@@");if(!(g<0)){f=f.substring(0,g);g=f.indexOf("-");var i=f.indexOf("+");if(!(g<0||i<0)){c=[c];if(g<i){f=f.substring(g+1).split("+");this._parseHRangeBody(f[0],c);this._parseHRangeBody(f[1],c)}else{f=f.substring(i+1).split("-");this._parseHRangeBody(f[1],c);this._parseHRangeBody(f[0],c)}return c}}}}};return d}();
return e});
define("orion/compare/compareUtils",[],function(){var e=e||{};e.compareUtils=e.compareUtils||{};e.compareUtils.lookUpMapper=function(d,a,c){for(var f=0,g=0;g<d.length;g++){var i=d[g][a];if(i===0)i=1;if(c>=f&&c<f+i)return{mapperIndex:g,startFrom:f};if(g===d.length-1)break;f+=d[g][a]}return{mapperIndex:d.length-1,startFrom:f}};e.compareUtils.lookUpLineIndex=function(d,a,c){if(c===0)return 0;for(var f=0,g=0;g<c;g++)f+=d[g][a];return f};e.compareUtils.updateMapper=function(d,a,c,f,g){if(f!==g)if(f>0||
g>0){var i=e.compareUtils.lookUpMapper(d,a,c);if(!(i.mapperIndex<0)){if(f>0){f=f;var j=c-i.startFrom;for(c=i.mapperIndex;c<d.length;c++){j=d[c][a]-j;if(f<=j){d[c][a]-=f;break}d[c][a]-=j;f-=j;j=0}}if(g>0)d[i.mapperIndex][a]+=g}}};e.compareUtils.overlapMapper=function(d,a,c,f,g){d=c+d[a]-1;if(d<c)d=c;if(g<f)g=f;if(d<f||g<c)return false;return true};e.compareUtils.findFirstDiff=function(d,a,c,f){for(var g=0,i=undefined,j=0;j<d.length;j++){if(g>f)break;if(e.compareUtils.overlapMapper(d[j],a,g,c,f)){i=
{mapperIndex:j,startFrom:g};if(d[j][2]!==0)break}g+=d[j][a]}return i};e.compareUtils.matchMapper=function(d,a,c,f){if(d.length===0)return c;var g=c+Math.round((f-c)/3),i=e.compareUtils.findFirstDiff(d,a,c,f),j=d[i.mapperIndex][a]===0?i.startFrom:i.startFrom+d[i.mapperIndex][a]-1,l=e.compareUtils.lookUpLineIndex(d,1-a,i.mapperIndex),h=i.startFrom-c;if(d[i.mapperIndex][2]===0)return l-h;if(g>=i.startFrom&&g<=j)return l-Math.round((f-c)/3);if(g<i.startFrom)return l-h;return(d[i.mapperIndex][1-a]===0?
l:l+d[i.mapperIndex][1-a]-1)-(j-c)};e.compareUtils.getMapperLineCount=function(d){for(var a=0,c=0;c<d.length;c++)a+=Math.max(d[c][0],d[c][1]);return a};e.compareUtils.findNextDiff=function(d,a){var c=0;if(a>=0&&a<d.length-1)c=a+1;for(var f=c;f<d.length;f++)if(d[f][2]!==0)return f;for(f=0;f<c;f++)if(d[f][2]!==0)return f;return a};e.compareUtils.getAnnotationIndex=function(d,a){for(var c=0;c<d.length;c++)if(d[c][0]===a)return c;return-1};e.compareUtils.getAnnotationMapperIndex=function(d,a){return d[a][1]};
e.compareUtils.getAnnotationIndexByMapper=function(d,a){for(var c=0;c<d.length;c++)if(d[c][1]===a)return{current:c,prev:c-1,next:c+1};return{current:-1,prev:-1,next:-1}};e.compareUtils.isMapperConflict=function(d,a){if(a<0)return false;if(!d[a][3])return false;return d[a][3]===1};return e.compareUtils});
define("orion/compare/rulers",["orion/compare/compareUtils"],function(e){var d=d||{};d.CompareRuler=function(){function a(c,f,g){this._location=c||"left";this._overview=f||"page";this._rulerStyle=g;this._editor=null}a.prototype={setView:function(c){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this,this._onModelChanged);this._editor=c;this._onModelChanged&&this._editor&&this._editor.addEventListener("ModelChanged",this,this._onModelChanged)},getLocation:function(){return this._location},
getOverview:function(){return this._overview},getAnnotationModel:function(){return null},addAnnotationType:function(){},isAnnotationTypeVisible:function(){return false},removeAnnotationType:function(){},setAnnotationModel:function(){},getAnnotations:function(c,f){var g=[];for(c=c;c<f;c++)g[c]={html:this.getHTML(c),style:this.getStyle(c)};return g},getWidestAnnotation:function(){return{html:this.getHTML(-1),style:this.getStyle(-1)}},getRulerStyle:function(){return this.getStyle(undefined)}};return a}();
d.LineNumberCompareRuler=function(){function a(c,f,g,i,j){d.CompareRuler.call(this,f,"page",g);this._oddStyle=i||{style:{backgroundColor:"white"}};this._evenStyle=j||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=c}a.prototype=new d.CompareRuler;a.prototype.getStyle=function(c){return c===undefined?this._rulerStyle:this._evenStyle};a.prototype.getHTML=function(c){var f=this._editor.getModel();if(c===-1)return f.getLineCount();else{if(f.getLineNumber){c=f.getLineNumber(c,
this._mapperColumnIndex);if(c===-1)return"";return c+1}return c+1}};a.prototype._onModelChanged=function(c){c=c.start;var f=this._editor.getModel(),g=f.getLineCount(),i=(g+"").length;if(this._numOfDigits!==i){this._numOfDigits=i;this._editor.redrawLines(f.getLineAtOffset(c),g,this)}};return a}();d.CompareAnnotation=function(){function a(){this._currentAnnotationIndex=0}a.prototype={init:function(c,f){this._mapper=c;this._editor=f;this._currentAnnotationIndex=0},getCurrentAnnotationIndex:function(){return this._currentAnnotationIndex},
getCurrentMapperIndex:function(){var c=this._editor.getModel().getAnnotations();return c.length===0?-1:c[this._currentAnnotationIndex][1]},matchPositionFromAnnotation:function(c){var f=c;if(c===-1)f=0;else{f=this._editor.getModel();f=e.getAnnotationIndex(f.getAnnotations(),c)}this._currentAnnotationIndex=f},gotoDiff:function(c){this._currentAnnotationIndex=c},nextDiff:function(){var c=this._editor.getModel().getAnnotations();if(c.length!==0)if(c.length-1===this._currentAnnotationIndex)this._currentAnnotationIndex=
0;else this._currentAnnotationIndex+=1},prevDiff:function(){var c=this._editor.getModel().getAnnotations();if(c.length!==0)if(0===this._currentAnnotationIndex)this._currentAnnotationIndex=c.length-1;else this._currentAnnotationIndex-=1}};return a}();d.CompareOverviewRuler=function(){function a(c,f){d.CompareRuler.call(this,c,"document",f)}a.prototype=new d.CompareRuler;a.prototype.getStyle=function(c){var f,g;if(c===undefined){f=this._rulerStyle||{};g=f.style||(f.style={});g.lineHeight="1px";g.fontSize=
"1px";g.width="14px"}else{f=c!==-1?{styleClass:"ruler_annotation_breakpoint_overview"}:{};g=f.style||(f.style={});g.cursor="pointer";g.width="8px";g.left="2px";var i=this._editor.getModel();if(c>=0&&i.getAnnotationH){c=i.getAnnotationH(c);i=i.getLineCount();var j=this._editor.getClientArea();c=Math.floor(j.height*c/i);if(c<2)c=2;g.height=c+"px"}else g.height="3px"}return f};a.prototype.getHTML=function(){return"&nbsp;"};a.prototype.onClick=function(c){if(c!==undefined){var f=this._editor.getLineHeight(),
g=this._editor.getClientArea();f=Math.floor(g.height/f/3);this._editor.setTopIndex(c-f>0?c-f:0)}};a.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return a}();d.CompareMergeOverviewRuler=function(){function a(c,f,g,i){this._compareAnnotaion=g;this._onClick=i;d.CompareRuler.call(this,c,"document",f)}a.prototype=new d.CompareRuler;a.prototype.getStyle=function(c){var f,g;if(c===undefined){f=this._rulerStyle||{};g=f.style||(f.style=
{});g.lineHeight="1px";g.fontSize="1px";g.width="14px"}else{f=c!==-1?{styleClass:"ruler_annotation_breakpoint_overview"}:{};g=f.style||(f.style={});g.cursor="pointer";g.width="8px";g.left="2px";var i=this._editor.getModel();if(c>=0&&i.getAnnotationH){c=e.getAnnotationIndex(i.getAnnotations(),c);if(c===-1)return{};var j=e.getAnnotationMapperIndex(i.getAnnotations(),c);if(j=e.isMapperConflict(i.getMapper(),j))g.border="1px #FF0000 solid";if(c===this._compareAnnotaion.getCurrentAnnotationIndex())g.backgroundColor=
j?"red":"blue";c=i.getAnnotationH(c);i=i.getAnnotationLineCount();j=this._editor.getClientArea();i=Math.floor(j.height*c/i);if(i<2)i=2;g.height=i+"px"}else g.height="3px"}return f};a.prototype.getHTML=function(){return"&nbsp;"};a.prototype.onClick=function(c){c!==undefined&&this._onClick(c,this)};a.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return a}();d.CompareMatchRenderer=function(){function a(c){this._canvasDiv=c;this._mapper=
undefined;this._annotation=new d.CompareAnnotation}a.prototype={init:function(c,f,g){this._mapper=c;this._leftEditor=f;this._rightEditor=g;this._annotation.init(c,g);this.render()},getAnnotation:function(){return this._annotation},getCurrentAnnotationIndex:function(){return this._annotation.getCurrentAnnotationIndex()},getCurrentMapperIndex:function(){return this._annotation.getCurrentMapperIndex()},setOverviewRuler:function(c){this._overviewRuler=c},_setEditorPosition:function(c,f){var g=c.getLineHeight(),
i=c.getClientArea();g=Math.floor(i.height/g/3);c.setTopIndex(f-g>0?f-g:0)},_findBaseLine:function(c){var f=c.getLineHeight(),g=c.getClientArea();f=Math.floor(g.height/f/3);return c.getTopIndex()+f},matchPositionFrom:function(c){var f=c?this._leftEditor:this._rightEditor,g=c?this._rightEditor:this._leftEditor,i=f.getTopIndex();f=f.getBottomIndex();c=e.matchMapper(this._mapper,c?0:1,i,f);g.setTopIndex(c)},matchPositionFromAnnotation:function(c){this._annotation.matchPositionFromAnnotation(c);this.positionAnnotation(this._annotation.getCurrentAnnotationIndex())},
positionAnnotation:function(c){var f=this._rightEditor.getModel().getAnnotations();if(f.length!==0){this._setEditorPosition(this._rightEditor,f[c][0]);this._setEditorPosition(this._leftEditor,this._leftEditor.getModel().getLineIndexFromMapper(f[c][1]));this._leftEditor.redrawRange();this._rightEditor.redrawRange();c=this._rightEditor.getTopIndex();this._rightEditor.redrawLines(c,c+1,this._overviewRuler)}},gotoDiff:function(c){this._annotation.gotoDiff(c);c=this._rightEditor.getTopIndex();this._leftEditor.redrawRange();
this._rightEditor.redrawRange();this._rightEditor.redrawLines(c,c+1,this._overviewRuler)},nextDiff:function(){this._annotation.nextDiff();this.positionAnnotation(this._annotation.getCurrentAnnotationIndex());this.render()},prevDiff:function(){this._annotation.prevDiff();this.positionAnnotation(this._annotation.getCurrentAnnotationIndex());this.render()},getMapperTextRange:function(c,f,g){var i=c.getModel().getLineIndexFromMapper(f);f=i+this._mapper[f][g]-1;i=c.getModel().getLineStart(i);c=c.getModel().getLineEnd(f,
true);return{start:i,end:c}},copyToLeft:function(){var c=this.getCurrentMapperIndex(),f=this.getMapperTextRange(this._rightEditor,c,1);c=this.getMapperTextRange(this._leftEditor,c,0);this._leftEditor.setText(this._rightEditor.getText(f.start,f.end),c.start,c.end);this._leftEditor.redrawRange();this._rightEditor.redrawRange()},render:function(){if(this._mapper){var c=this._canvasDiv.getContext("2d");c.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);c.strokeStyle="#AAAAAA";c.lineWidth=1;
c.beginPath();var f=this._leftEditor.getTopIndex(),g=this._leftEditor.getBottomIndex(),i=this._rightEditor.getTopIndex(),j=this._rightEditor.getBottomIndex();this._leftLineH=this._leftEditor.getLineHeight();this._rightLineH=this._rightEditor.getLineHeight();for(var l=0,h=0,k=false,q=0;q<this._mapper.length;q++){if(this._mapper[q][2]!==0)if(e.overlapMapper(this._mapper[q],0,l,f,g)||e.overlapMapper(this._mapper[q],1,h,i,j)){this._renderCurve(q,l,h,this._canvasDiv,c,f,g,i,j);k=true}else if(k)break;l+=
this._mapper[q][0];h+=this._mapper[q][1]}c.stroke()}},_renderCurve:function(c,f,g,i,j){var l=this._mapper[c];f=this._leftEditor.getLinePixel(f+l[0]/2)+l[0]%2*this._leftLineH/3-this._leftEditor.getTopPixel();g=this._rightEditor.getLinePixel(g+l[1]/2)+l[1]%2*this._rightLineH/3-this._rightEditor.getTopPixel();i=i.parentNode.clientWidth;if(c===this.getCurrentMapperIndex()){j.stroke();j.strokeStyle="#000";j.lineWidth=1;j.beginPath();j.moveTo(0,f);j.bezierCurveTo(i/3,f,i*0.666,g,i,g);j.stroke();j.strokeStyle=
"#AAAAAA";j.lineWidth=1;j.beginPath()}else{j.moveTo(0,f);j.bezierCurveTo(i/3,f,i*0.666,g,i,g);j.stroke()}},onChanged:function(c){if(c.removedLineCount!==c.addedLineCount)if(c.removedLineCount>0||c.addedLineCount>0)this.render()}};return a}();return d});
define("orion/compare/compare-model",[],function(){var e=e||{};e.CompareTextModel=function(){function d(a,c,f){this._model=a;this._mapperColumnIndex=c.columnIndex;this._mapper=c.mapper;this._listeners=[];a.addListener(this);this._lineFeeder=f;this.init()}navigator.platform.indexOf("Win");d.prototype={init:function(a,c){if(a)this._mapper=a;a=this._lineFeeder.generateGapBlocks(this._mapper,this._mapperColumnIndex,c);this._dummyLBlock=a.gapBlocks;this._dummyLNumber=a.gapNumber},_getDummyCharCountAt:function(a,
c){if(a.blockNumber<0)return 0;for(var f=0,g=0;g<=a.blockNumber;g++){if(g>=this._dummyLBlock.length)break;for(var i=g===a.blockNumber?a.stopAtDelta:this._dummyLBlock[g][1]-1,j=0;j<=i;j++){var l=c?this._lineFeeder.getLineAt(this._dummyLBlock,g,j,true):this._lineFeeder.getLineAt(this._dummyLBlock,g,j,!(g===a.blockNumber&&j===i));f+=l.length}}return f},lookUpRealIndex:function(a){for(var c=0,f=0,g=0;g<this._dummyLBlock.length;g++){var i=this._dummyLBlock[g][0],j=i+this._dummyLBlock[g][1]-1;if(a<i)break;
if(a>=i&&a<=j)return{lineIndex:-1,gapsBefore:c+a-i,lastGapInfo:{blockNumber:g,stopAtDelta:a-i}};f=this._dummyLBlock[g][1];c+=f}return{lineIndex:a-c,gapsBefore:c,lastGapInfo:{blockNumber:g-1,stopAtDelta:f-1}}},getLineType:function(a){return this._lineFeeder.getLineType(a,this._mapperColumnIndex)},getMapper:function(){return this._mapper},getAnnotations:function(){return this._lineFeeder.getAnnotations()},getAnnotationH:function(a){return this._lineFeeder.getAnnotationH(a)},getAnnotationLineCount:function(){return this.getLineCount()},
getLineNumber:function(a,c){if(this._lineFeeder.getLineNumber)return this._lineFeeder.getLineNumber(a,c);return this.lookUpRealIndex(a).lineIndex},addListener:function(a){this._listeners.push(a)},removeListener:function(a){for(var c=0;c<this._listeners.length;c++)if(this._listeners[c]===a){this._listeners.splice(c,1);return}},getCharCount:function(){var a=this._model.getCharCount();if(this._dummyLBlock.length>0)a+=this._getDummyCharCountAt({blockNumber:this._dummyLBlock.length-1,stopAtDelta:this._dummyLBlock[this._dummyLBlock.length-
1][1]-1},true);return a},getLine:function(a,c){var f=this.getLineCount();if(!(0<=a&&a<f))return null;a=this.lookUpRealIndex(a);return a.lineIndex<0?this._lineFeeder.getLineAt(this._dummyLBlock,a.lastGapInfo.blockNumber,a.lastGapInfo.stopAtDelta,c):this._model.getLine(a.lineIndex,c)},getLineAtOffset:function(a){if(!(0<=a&&a<=this.getCharCount()))return-1;for(var c=this.getLineCount(),f=0,g=0;f<c;){var i=this.lookUpRealIndex(f);if(i.lineIndex<0)g+=this._lineFeeder.getLineAt(this._dummyLBlock,i.lastGapInfo.blockNumber,
i.lastGapInfo.stopAtDelta,true).length;else{i=this._model.getLine(i.lineIndex,true);g+=i?i.length:0}f++;if(g>a)break}if(f>c)return c-1;return f-1},getLineCount:function(){return this._model.getLineCount()+this._dummyLNumber},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(a,c){var f=this.getLineCount();if(!(0<=a&&a<f))return-1;var g=this.lookUpRealIndex(a);f=0;if(g.lineIndex<0){f+=this._getDummyCharCountAt(g.lastGapInfo,c);a=a-g.gapsBefore;if(a>0)f+=this._model.getLineEnd(a-
1,true)}else{f+=this._getDummyCharCountAt(g.lastGapInfo,true);f+=this._model.getLineEnd(g.lineIndex,c)}return f},getLineStart:function(a){if(!(0<=a&&a<this.getLineCount()))return-1;if(a===0)return 0;return this.getLineEnd(a-1,true)},getText:function(a,c){if(a===c)return this._model.getText(a,c);if(a===undefined)a=0;if(c===undefined)c=this.getCharCount();var f=this.getLineAtOffset(a),g=this.getLineAtOffset(c),i=this.getLineStart(f),j=this.getLineEnd(g,true),l=this.getLine(f,true);if(!l)return this._model.getText(a,
c);if(f===g)return l.substring(a-i,l.length-j+c);i=l.substring(a-i);l=this.getLine(g,true);if(!l)return this._model.getText(a,c);a=l.substring(0,l.length-j+c);c="";for(f=f+1;f<g;f++)c+=this.getLine(f,true);return i+c+a},onChanging:function(a){for(var c=0;c<this._listeners.length;c++){var f=this._listeners[c];f&&f.onChanging&&f.onChanging(a)}},onChanged:function(a){for(var c=0;c<this._listeners.length;c++){var f=this._listeners[c];f&&f.onChanged&&f.onChanged(a)}},setLineDelimiter:function(a){this._model.setLineDelimiter(a)},
setText:function(a){this._model.setText(a,0,this._model.getCharCount())}};return d}();e.DiffLineFeeder=function(){function d(a,c){if(a){this._diffLinesArray=a.array;this._diffLinesArrayIndex=a.index}this._lineDelimeter=c;this._annotations=[]}navigator.platform.indexOf("Win");d.prototype={generateGapBlocks:function(a,c,f){var g=[];this._mapper=a;if(f){this._diffLinesArray=f.array;this._diffLinesArrayIndex=f.index}this._annotations=[];f=a=0;for(var i=1-c,j=0,l=0;l<this._mapper.length;l++){j=this._mapper[l][2]===
0?this._mapper[l][c]:this._mapper[l][c]+this._mapper[l][i];if(this._mapper[l][2]>0){var h=this._mapper[l][c];a+=h;g.push([f+this._mapper[l][i],h,this._mapper[l][2]])}this._mapper[l][2]!==0&&this._annotations.push([f,l,j]);f+=j}return{gapBlocks:g,gapNumber:a}},getLineAt:function(a,c,f,g){c=a[c][2];c+=f-1;f=this._diffLinesArray[c];f===undefined&&console.log(a);f=f.substring(this._diffLinesArrayIndex);if(g)return f+this._lineDelimeter;return f},getLineType:function(a,c){for(var f=0,g=1-c,i=0,j=0;j<this._mapper.length;j++){i=
this._mapper[j][2]===0?this._mapper[j][c]:this._mapper[j][c]+this._mapper[j][g];if(a>=f&&a<f+i){if(this._mapper[j][2]===0)return{type:"unchnaged",mapperIndex:j};else if(this._mapper[j][2]<0)return{type:"removed",mapperIndex:j};else if(this._mapper[j][1]===0)return{type:"added",mapperIndex:j};else if(a<this._mapper[j][g]+f)return{type:"removed",mapperIndex:j};return{type:"added",mapperIndex:j}}f+=i}return{type:"unchnaged",mapperIndex:-1}},getLineNumber:function(a,c){if(this._mapper.length===0)return a;
for(var f=0,g=0,i=1-c,j=0,l=0;l<this._mapper.length;l++){j=this._mapper[l][2]===0?this._mapper[l][c]:this._mapper[l][c]+this._mapper[l][i];if(a>=f&&a<f+j){i=a-f;if(this._mapper[l][2]===0)return g+i;else if(this._mapper[l][2]<0)return c===0?-1:g+i;else if(this._mapper[l][1]===0)return c===0?g+i:-1;else if(a<this._mapper[l][1]+f)return c===0?-1:g+i;return c===0?g+i-this._mapper[l][1]:-1}f+=j;g+=this._mapper[l][c]}return a},getAnnotations:function(){return this._annotations},getAnnotationH:function(a){return this._annotations[a][2]}};
return d}();e.GapLineFeeder=function(){function d(a){this._lineDelimeter=a;this._annotations=[]}navigator.platform.indexOf("Win");d.prototype={generateGapBlocks:function(a,c){var f=[];this._mapper=a;this._annotations=[];for(var g=a=0,i=1-c,j=0;j<this._mapper.length;j++){if(this._mapper[j][c]<this._mapper[j][i]){var l=this._mapper[j][i]-this._mapper[j][c];a+=l;f.push([g+this._mapper[j][c],l,1])}l=Math.max(this._mapper[j][i],this._mapper[j][c]);this._mapper[j][2]!==0&&this._annotations.push([g,j,l]);
g+=l}return{gapBlocks:f,gapNumber:a}},getLineAt:function(a,c,f,g){if(g)return this._lineDelimeter;return""},getLineType:function(a,c){for(var f=0,g=1-c,i=0;i<this._mapper.length;i++){var j=Math.max(this._mapper[i][c],this._mapper[i][g]);if(a>=f&&a<f+j){if(this._mapper[i][2]===0)return"unchnaged";else if(this._mapper[i][2]<0)return"removed";else if(this._mapper[i][1]===0)return"added";else if(a<this._mapper[i][c]+f)return"changed";return"changed_gap"}f+=Math.max(this._mapper[i][c],this._mapper[i][g])}return"unchnaged"},
getAnnotations:function(){return this._annotations},getAnnotationH:function(a){return this._annotations[a][2]}};return d}();return e});
define("orion/compare/compare-m-model",["orion/compare/compareUtils"],function(e){var d=d||{};d.CompareMergeModel=function(){function a(c,f){this._model=c;this._mapperColumnIndex=f.columnIndex;this._mapper=f.mapper;this._listeners=[];c.addListener(this);this.init()}navigator.platform.indexOf("Win");a.prototype={init:function(c){this._initing=true;if(c){this._mapper=c;this._annotations=undefined}},getMapper:function(){return this._mapper},getLineType:function(c){var f=e.lookUpMapper(this._mapper,this._mapperColumnIndex,
c);if(f.mapperIndex>-1)if(this._mapper[f.mapperIndex][2]!==0){var g=this._mapper[f.mapperIndex][this._mapperColumnIndex];if(g===0)return{type:"top-only",mapperIndex:f.mapperIndex};if(g===1)return{type:"oneline",mapperIndex:f.mapperIndex};if(c===f.startFrom)return{type:"top",mapperIndex:f.mapperIndex};if(c===f.startFrom+g-1)return{type:"bottom",mapperIndex:f.mapperIndex};return{type:"middle",mapperIndex:f.mapperIndex}}return{type:"unchanged",mapperIndex:f.mapperIndex}},isMapperEmpty:function(){return this._mapper.length===
0},getAnnotations:function(){if(this._annotations===undefined){this._annotations=[];for(var c=0,f=0;f<this._mapper.length;f++){this._mapper[f][2]!==0&&this._annotations.push([c,f]);c+=this._mapper[f][this._mapperColumnIndex]}}return this._annotations},getAnnotationH:function(c){this.getAnnotations();c=this._annotations[c][1];return c===-1?0:this._mapper[c][this._mapperColumnIndex]},getAnnotationLineCount:function(){return this.getLineCount()},getLineNumber:function(c){return c},getLineIndexFromMapper:function(c){return e.lookUpLineIndex(this._mapper,
this._mapperColumnIndex,c)},lookUpMapper:function(c){return e.lookUpMapper(this._mapper,this._mapperColumnIndex,c)},updateMapper:function(c,f,g,i,j){i!==j&&e.updateMapper(this._mapper,this._mapperColumnIndex,this.getLineAtOffset(c),i,j)},addListener:function(c){this._listeners.push(c)},removeListener:function(c){for(var f=0;f<this._listeners.length;f++)if(this._listeners[f]===c){this._listeners.splice(f,1);return}},getCharCount:function(){return this._model.getCharCount()},getLine:function(c,f){return this._model.getLine(c,
f)},getLineAtOffset:function(c){return this._model.getLineAtOffset(c)},getLineCount:function(){return this._model.getLineCount()},getLineDelimiter:function(){return this._model.getLineDelimiter()},setLineDelimiter:function(c){this._model.setLineDelimiter(c)},getLineEnd:function(c,f){return this._model.getLineEnd(c,f)},getLineStart:function(c){return this._model.getLineStart(c)},setText:function(c,f,g){this._model.setText(c,f,g)},getText:function(c,f){return this._model.getText(c,f)},onChanging:function(c){for(var f=
0;f<this._listeners.length;f++){var g=this._listeners[f];g&&g.onChanging&&g.onChanging(c)}},onChanged:function(c){if(this._initing)this._initing=false;else this.updateMapper(c.start,c.removedCharCount,c.addedCharCount,c.removedLineCount,c.addedLineCount);for(var f=0;f<this._listeners.length;f++){var g=this._listeners[f];g&&g.onChanged&&g.onChanged(c)}}};return a}();return d});orion=orion||{};orion.editor=orion.editor||{};
orion.editor.ContentAssist=function(){function e(d,a){this.editor=d;this.textView=d.getTextView();this.contentAssistPanel=document.getElementById(a);this.active=false;this.prefix="";this.providers=[];this.filteredProviders=[];this.listeners={};this.proposals=[];this.contentAssistListener={onModelChanging:function(c){this.ignoreNextChange=this.isIgnorable(c)},onModelChanged:function(c){this.ignoreNextChange?this.cancel():this.showContentAssist(true,c);this.ignoreNextChange=false},onScroll:function(){this.cancel()}};
this.init()}e.prototype={init:function(){this.textView.setKeyBinding(navigator.platform.indexOf("Mac")!==-1?new orion.textview.KeyBinding(" ",false,false,false,true):new orion.textview.KeyBinding(" ",true),"Content Assist");this.textView.setAction("Content Assist",function(){this.showContentAssist(true);return true}.bind(this))},addEventListener:function(d,a){this.listeners[d]||(this.listeners[d]=[]);this.listeners[d].push(a)},removeEventListener:function(d,a){if(d=this.listeners[d]){a=d.indexOf(a);
a!==-1&&d.splice(a,1)}},dispatchEvent:function(d,a){a={type:d,data:a};if(d=this.listeners[d])for(var c=0;c<d.length;c++)d[c](a)},cancel:function(){this.showContentAssist(false)},isActive:function(){return this.active},isIgnorable:function(d){var a=d.removedCharCount>0&&d.addedCharCount===0,c=this.textView;c=d.start+1<=c.getModel().getCharCount()&&/^\s*$/.test(c.getText(d.start,d.start+1));return d.removedLineCount>0||a&&c},lineUp:function(){if(this.contentAssistPanel){var d=this.getSelectedNode();
d===this.contentAssistPanel.firstChild?this.setSelected(this.contentAssistPanel.lastChild):this.setSelected(d.previousSibling);return true}},lineDown:function(){if(this.contentAssistPanel){var d=this.getSelectedNode();d===this.contentAssistPanel.lastChild?this.setSelected(this.contentAssistPanel.firstChild):this.setSelected(d.nextSibling);return true}},enter:function(){return this.contentAssistPanel?this.accept():false},accept:function(){var d=this.getSelectedProposal();if(d===null)return false;this.ignoreNextChange=
true;this.cancel();this.dispatchEvent("accept",{proposal:d,start:this.textView.getCaretOffset()-this.prefix.length,end:this.textView.getCaretOffset()});return true},setSelected:function(d){for(var a=this.contentAssistPanel.childNodes,c=0;c<a.length;c++){var f=a[c];if(f.className==="selected")f.className="";if(f===d){f.className="selected";f.focus();if(f.offsetTop<this.contentAssistPanel.scrollTop)f.scrollIntoView(true);else f.offsetTop+f.offsetHeight>this.contentAssistPanel.scrollTop+this.contentAssistPanel.clientHeight&&
f.scrollIntoView(false)}}},getSelectedNode:function(){var d=this.getSelectedIndex();return d===-1?null:this.contentAssistPanel.childNodes[d]},getSelectedIndex:function(){for(var d=this.contentAssistPanel.childNodes,a=0;a<d.length;a++)if(d[a].className==="selected")return a;return-1},getSelectedProposal:function(){var d=this.getSelectedIndex();return d===-1?null:this.proposals[d]},click:function(d){this.setSelected(d.target);this.accept();this.editor.getTextView().focus()},showContentAssist:function(d,
a){if(this.contentAssistPanel){this.dispatchEvent(d?"show":"hide",null);this.filterProviders(this.editor.getTitle());if(d){var c=a?a.start+a.addedCharCount:this.textView.getCaretOffset();d=c;for(var f;d>0&&(97<=(f=this.textView.getText(d-1,d).charCodeAt(0))&&f<=122||65<=f&&f<=90||f===95||48<=f&&f<=57);)d--;this.prefix=this.textView.getText(d,c);f=this.textView.getText();d=this.textView.getSelection();d.offset=c;this.getKeywords(this.prefix,f,d).then(function(g){this.proposals=[];for(var i=0;i<g.length;i++){var j=
g[i];if(!(j===null||j===undefined))if(this.matchesPrefix(j)||this.matchesPrefix(j.proposal))this.proposals.push(j)}if(this.proposals.length===0)this.cancel();else{g=this.textView.getLocationAtOffset(c);g.y+=this.textView.getLineHeight();this.contentAssistPanel.innerHTML="";for(i=0;i<this.proposals.length;i++)this.createDiv(this.getDisplayString(this.proposals[i]),i===0,this.contentAssistPanel);this.textView.convert(g,"document","page");this.contentAssistPanel.style.position="absolute";this.contentAssistPanel.style.left=
g.x+"px";this.contentAssistPanel.style.top=g.y+"px";this.contentAssistPanel.style.display="block";this.contentAssistPanel.scrollTop=0;i=document.documentElement.clientWidth;if(g.y+this.contentAssistPanel.offsetHeight>document.documentElement.clientHeight)this.contentAssistPanel.style.top=g.y-this.contentAssistPanel.offsetHeight-this.textView.getLineHeight()+"px";if(g.x+this.contentAssistPanel.offsetWidth>i)this.contentAssistPanel.style.left=i-this.contentAssistPanel.offsetWidth+"px";if(!this.listenerAdded){this.textView.addEventListener("ModelChanging",
this,this.contentAssistListener.onModelChanging);this.textView.addEventListener("ModelChanged",this,this.contentAssistListener.onModelChanged);this.textView.addEventListener("Scroll",this,this.contentAssistListener.onScroll)}this.listenerAdded=true;this.contentAssistPanel.onclick=this.click.bind(this);this.active=true}}.bind(this))}else{if(this.listenerAdded){this.textView.removeEventListener("ModelChanging",this,this.contentAssistListener.onModelChanging);this.textView.removeEventListener("ModelChanged",
this,this.contentAssistListener.onModelChanged);this.textView.removeEventListener("Scroll",this,this.contentAssistListener.onScroll);this.listenerAdded=false}this.active=false;this.contentAssistPanel.style.display="none";this.contentAssistPanel.onclick=null}}},createDiv:function(d,a,c){var f=document.createElement("div");if(a)f.className="selected";f.innerHTML=d;c.appendChild(f)},getDisplayString:function(d){return typeof d==="string"?d:d.proposal},matchesPrefix:function(d){return typeof d==="string"&&
d.substr(0,this.prefix.length)===this.prefix},getKeywords:function(d,a,c){function f(u){if(u)i=i.concat(u);++j===h.length&&l.done(i)}function g(){++j===h.length&&l.done(i)}for(var i=[],j=0,l=new this.Promise,h=this.filteredProviders,k=0;k<h.length;k++){var q=h[k].provider.getKeywords(d,a,c);q&&q.then?q.then(f,g):f(q)}return l},Promise:function(){function d(){}d.prototype.then=function(a){this.callback=a;if(this.result){var c=this;setTimeout(function(){c.callback(c.result)},0)}};d.prototype.done=function(a){this.result=
a;this.callback&&this.callback(this.result)};return d}(),addProvider:function(d,a,c){if(!this.providers)this.providers=[];this.providers.push({name:a,pattern:c,provider:d})},filterProviders:function(d){this.filteredProviders=[];for(var a=0;a<this.providers.length;a++){var c=this.providers[a];(new RegExp(c.pattern)).test(d)&&this.filteredProviders.push(c)}}};return e}();
typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/editor/contentAssist",["orion/textview/keyBinding"],function(){return orion.editor});orion=orion||{};orion.textview=orion.textview||{};
orion.textview.UndoStack=function(){function e(c,f){this.view=c;this.size=f!==undefined?f:100;this.reset();f=c.getModel();if(f.getBaseModel)f=f.getBaseModel();this.model=f;var g=this;this._modelListener={onChanging:function(i){g._onModelChanging(i)}};f.addListener(this._modelListener);c.addEventListener("Destroy",this,this._onDestroy)}var d=function(){function c(f,g,i){this.offset=f;this.text=g;this.previousText=i}c.prototype={undo:function(f,g){this._doUndoRedo(this.offset,this.previousText,this.text,
f,g)},redo:function(f,g){this._doUndoRedo(this.offset,this.text,this.previousText,f,g)},_doUndoRedo:function(f,g,i,j,l){var h=j.getModel();if(h.mapOffset&&j.annotationModel){var k=h.mapOffset(f,true);if(k<0)for(var q=j.annotationModel.getAnnotations(f,f+1);q.hasNext();){var u=q.next();if(u.type==="orion.annotation.folding"){u.expand();k=h.mapOffset(f,true);break}}if(k<0)return;f=k}j.setText(g,f,f+i.length);l&&j.setSelection(f,f+g.length)}};return c}(),a=function(){function c(f,g){this.selection=f;
this.caret=g;this.changes=[]}c.prototype={add:function(f){this.changes.push(f)},undo:function(f,g){for(var i=this.changes.length-1;i>=0;i--)this.changes[i].undo(f,false);if(g){g=this.selection.start;i=this.selection.end;f.setSelection(this.caret?g:i,this.caret?i:g)}},redo:function(f,g){for(var i=0;i<this.changes.length;i++)this.changes[i].redo(f,false);if(g){g=this.selection.start;i=this.selection.end;f.setSelection(this.caret?g:i,this.caret?i:g)}}};return c}();e.prototype={add:function(c){if(this.compoundChange)this.compoundChange.add(c);
else{this.stack.splice(this.index,this.stack.length-this.index,c);this.index++;if(this.stack.length>this.size){this.stack.shift();this.index--;this.cleanIndex--}}},markClean:function(){this.endCompoundChange();this._commitUndo();this.cleanIndex=this.index},isClean:function(){return this.cleanIndex===this.getSize().undo},canUndo:function(){return this.getSize().undo>0},canRedo:function(){return this.getSize().redo>0},endCompoundChange:function(){this.compoundChange=undefined},getSize:function(){var c=
this.index,f=this.stack.length;this._undoStart!==undefined&&c++;return{undo:c,redo:f-c}},undo:function(){this._commitUndo();if(this.index<=0)return false;var c=this.stack[--this.index];this._ignoreUndo=true;c.undo(this.view,true);this._ignoreUndo=false;return true},redo:function(){this._commitUndo();if(this.index>=this.stack.length)return false;var c=this.stack[this.index++];this._ignoreUndo=true;c.redo(this.view,true);this._ignoreUndo=false;return true},reset:function(){this.index=this.cleanIndex=
0;this.stack=[];this._undoStart=undefined;this._undoText="";this._ignoreUndo=false;this._compoundChange=undefined},startCompoundChange:function(){this._commitUndo();var c=new a(this.view.getSelection(),this.view.getCaretOffset());this.add(c);this.compoundChange=c},_commitUndo:function(){if(this._undoStart!==undefined){this._undoStart<0?this.add(new d(-this._undoStart,"",this._undoText,"")):this.add(new d(this._undoStart,this._undoText,""));this._undoStart=undefined;this._undoText=""}},_onDestroy:function(){this.model.removeListener(this._modelListener);
this.view.removeEventListener("Destroy",this,this._onDestroy)},_onModelChanging:function(c){var f=c.text,g=c.start,i=c.removedCharCount;c=c.addedCharCount;if(!this._ignoreUndo){if(this._undoStart!==undefined&&!(c===1&&i===0&&g===this._undoStart+this._undoText.length||c===0&&i===1&&(g+1===-this._undoStart||g===-this._undoStart)))this._commitUndo();if(!this.compoundChange)if(c===1&&i===0){if(this._undoStart===undefined)this._undoStart=g;this._undoText+=f;return}else if(c===0&&i===1){f=this._undoText.length>
0&&-this._undoStart===g;this._undoStart=-g;if(f)this._undoText+=this.model.getText(g,g+i);else this._undoText=this.model.getText(g,g+i)+this._undoText;return}this.add(new d(g,f,this.model.getText(g,g+i)))}}};return e}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/textview/undoStack",[],function(){return orion.textview});
define("orion/editorCommands",["dojo","orion/commands","orion/globalCommands","orion/textview/keyBinding","orion/textview/undoStack"],function(e,d,a,c,f){var g={};g.EditorCommandFactory=function(){function i(j,l,h,k,q,u){this.serviceRegistry=j;this.commandService=l;this.fileClient=h;this.inputManager=k;this.toolbarId=q;this.isReadOnly=u}i.prototype={generateEditorCommands:function(j){function l(q){var u=new c.KeyBinding;c.KeyBinding.apply(u,q);return u}if(!this.isReadOnly){j.getTextView().setKeyBinding(new c.KeyBinding("s",
true),"Save");j.getTextView().setAction("Save",e.hitch(this,function(){var q=j.getText(),u={ETag:this.inputManager.getFileMetadata().ETag};this.fileClient.write(this.inputManager.getInput(),q,u).then(e.hitch(this,function(r){this.inputManager.getFileMetadata().ETag=r.ETag;j.onInputChange(this.inputManager.getInput(),null,q,true);this.inputManager.afterSave&&this.inputManager.afterSave()}),e.hitch(this,function(r){if(r.status===412)confirm("Resource is out of sync with the server. Do you want to save it anyway?")&&
this.fileClient.write(this.inputManager.getInput(),q).then(e.hitch(this,function(t){this.inputManager.getFileMetadata().ETag=t.ETag;j.onInputChange(this.inputManager.getInput(),null,q,true);this.inputManager.afterSave&&this.inputManager.afterSave()}));else r.log=true}));return true}));this.commandService.addCommand(new d.Command({name:"Save",tooltip:"Save this file",id:"orion.save",callback:function(q){q.getTextView().invokeAction("Save")}}),"dom");this.commandService.addCommandGroup("orion.editorActions.unlabeled",
200,null,null,this.toolbarId);this.commandService.registerCommandContribution("orion.save",1,this.toolbarId,"orion.editorActions.unlabeled",new d.CommandKeyBinding("s",true));this.commandService.addCommandGroup("orion.editorActions.contributed.noImages",100,"More",null,this.toolbarId);this.commandService.addCommandGroup("orion.editorActions.contributed.images",101,null,null,this.toolbarId);for(var h=this.serviceRegistry.getServiceReferences("orion.edit.command"),k=0;k<h.length;k++)this.serviceRegistry.getService(h[k]).then(e.hitch(this,
function(q){for(var u={},r=h[k].getPropertyNames(),t=0;t<r.length;t++)u[r[t]]=h[k].getProperty(r[t]);r=new d.Command({name:u.name,image:u.img,id:u.name,callback:e.hitch(j,function(v){v=v||this;var A=v.getSelection(),x=v.getModel(),m=x.getText();q.run(x.getText(A.start,A.end),m,A).then(function(o){if(o.text){v.setText(o.text);if(o.selection){v.setSelection(o.selection.start,o.selection.end);v.getTextView().focus()}}else if(typeof o==="string"){v.setText(o,A.start,A.end);v.setSelection(A.start,A.end);
v.getTextView().focus()}});return true})});this.commandService.addCommand(r,"dom");u.img?this.commandService.registerCommandContribution(r.id,k,this.toolbarId,"orion.editorActions.contributed.images"):this.commandService.registerCommandContribution(r.id,k,this.toolbarId,"orion.editorActions.contributed.noImages");a.generateDomCommandsInBanner(this.commandService,j);if(u.key){t=j.getTextView();t.setKeyBinding(l(u.key),r.id);t.setAction(r.id,r.callback)}}))}}};return i}();g.UndoCommandFactory=function(){function i(j,
l,h){this.serviceRegistry=j;this.commandService=l;this.toolbarId=h}i.prototype={createUndoStack:function(j){var l=new f.UndoStack(j.getTextView(),200);j.getTextView().setKeyBinding(new c.KeyBinding("z",true),"Undo");j.getTextView().setAction("Undo",function(){l.undo();return true});this.commandService.addCommand(new d.Command({name:"Undo",id:"orion.undo",callback:function(k){k.getTextView().invokeAction("Undo")}}),"dom");var h=navigator.platform.indexOf("Mac")!==-1?new c.KeyBinding("z",true,true):
new c.KeyBinding("y",true);j.getTextView().setKeyBinding(h,"Redo");j.getTextView().setAction("Redo",function(){l.redo();return true});this.commandService.addCommand(new d.Command({name:"Redo",id:"orion.redo",callback:function(k){k.getTextView().invokeAction("Redo")}}),"dom");this.commandService.registerCommandContribution("orion.undo",400,this.toolbarId,"orion.editorActions.unlabeled",new d.CommandKeyBinding("z",true),true);this.commandService.registerCommandContribution("orion.redo",401,this.toolbarId,
"orion.editorActions.unlabeled",h,true);return l}};return i}();return g});orion=orion||{};orion.editor=orion.editor||{};
orion.editor.Editor=function(){function e(d){this._textViewFactory=d.textViewFactory;this._undoStackFactory=d.undoStackFactory;this._annotationFactory=d.annotationFactory;this._foldingRulerFactory=d.foldingRulerFactory;this._lineNumberRulerFactory=d.lineNumberRulerFactory;this._contentAssistFactory=d.contentAssistFactory;this._keyBindingFactory=d.keyBindingFactory;this._statusReporter=d.statusReporter;this._domNode=d.domNode;this._syntaxHighlightProviders=d.syntaxHighlightProviders;this._foldingRuler=
this._overviewRuler=this._annotationRuler=null;this._dirty=false;this._title=this._contentAssist=null;this._keyModes=[]}e.prototype={errorType:"orion.annotation.error",warningType:"orion.annotation.warning",taskType:"orion.annotation.task",foldingType:"orion.annotation.folding",getTextView:function(){return this._textView},reportStatus:function(d,a,c){this._statusReporter?this._statusReporter(d,a,c):window.alert(a?"ERROR: "+d:d)},getModel:function(){var d=this._textView.getModel();if(d.getBaseModel)d=
d.getBaseModel();return d},mapOffset:function(d,a){var c=this._textView.getModel();if(c.getBaseModel)d=c.mapOffset(d,a);return d},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},getSelection:function(){var d=this._textView,a=d.getSelection();d=d.getModel();if(d.getBaseModel){a.start=d.mapOffset(a.start);a.end=d.mapOffset(a.end)}return a},getText:function(d,a){var c=this._textView.getModel();if(c.getBaseModel)c=c.getBaseModel();return c.getText(d,a)},_expandOffset:function(d){var a=
this._textView.getModel(),c=this._annotationModel;if(c&&a.getBaseModel)for(d=c.getAnnotations(d,d+1);d.hasNext();){a=d.next();if(a.type==="orion.annotation.folding")if(a.expand){a.expand();c.modifyAnnotation(a)}}},setCaretOffset:function(d){var a=this._textView,c=a.getModel();if(c.getBaseModel){this._expandOffset(d);d=c.mapOffset(d,true)}a.setCaretOffset(d)},setText:function(d,a,c){var f=this._textView,g=f.getModel();if(g.getBaseModel){if(a!==undefined){this._expandOffset(a);a=g.mapOffset(a,true)}if(c!==
undefined){this._expandOffset(c);c=g.mapOffset(c,true)}}f.setText(d,a,c)},setFoldingEnabled:function(d){this._foldingEnabled=d;this._updateFoldingRuler()},_updateFoldingRuler:function(){var d=this._textView;if(this._foldingEnabled){if(!this._foldingRuler&&this._foldingRulerFactory&&d.getModel().getBaseModel&&this._foldingEnabled){d.annotationModel=this._annotationModel;this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel);this._foldingRuler.addAnnotationType(this.foldingType);
d.addRuler(this._foldingRuler)}}else if(this._foldingRuler){d.removeRuler(this._foldingRuler);this._foldingRuler=null}},setSelection:function(d,a,c){var f=this._textView,g=f.getModel();if(g.getBaseModel){this._expandOffset(d);this._expandOffset(a);d=g.mapOffset(d,true);a=g.mapOffset(a,true)}f.setSelection(d,a,c)},moveSelection:function(d,a,c){a=a||d;var f=this._textView;this.setSelection(d,a,false);a=f.getTopPixel();var g=f.getBottomPixel();d=this.getModel().getLineAtOffset(d);d=f.getLinePixel(d);
if(d<a||d>g){g=Math.max(0,d-Math.floor((d<a?3:1)*(g-a)/4));(new orion.editor.util.Animation({node:f,duration:300,curve:[a,g],onAnimate:function(i){f.setTopPixel(Math.floor(i))},onEnd:function(){f.showSelection();f.focus();c&&c()}})).play()}else{f.showSelection();f.focus();c&&c()}},isDirty:function(){return this._dirty},checkDirty:function(){var d=!this._undoStack.isClean();this._dirty!==d&&this.onDirtyChange(d)},getAnnotationModel:function(){return this._annotationModel},doFind:function(d,a,c,f){var g=
this.getText();if(c){d=d.toLowerCase();g=g.toLowerCase()}if(f){g=g.split("").reverse().join("");d=d.split("").reverse().join("");a=g.length-a-1;a=g.indexOf(d,a);if(a!==-1)return{index:g.length-d.length-a,length:d.length}}else{a=g.indexOf(d,a);if(a!==-1)return{index:a,length:d.length}}return null},doFindRegExp:function(d,a,c,f){if(!d)return null;a=a||"";a+=(a.indexOf("g")===-1?"g":"")+(a.indexOf("m")===-1?"m":"");d=new RegExp(d,a);a=this.getText();var g=null,i=null;if(f)for(;;)if((g=d.exec(a))&&g.index<=
c)i={index:g.index,length:g[0].length};else return i;else return(g=d.exec(a.substring(c)))&&{index:g.index+c,length:g[0].length}},parseRegExp:function(d){if(d=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(d))return{pattern:d[1],flags:d[2]};return null},highlightAnnotations:function(){if(this._annotationStyler){this._annotationStyler.destroy();this._annotationStyler=null}if(this._annotationFactory)this._annotationStyler=this._annotationFactory.createAnnotationStyler(this.getTextView(),this._annotationModel)},
installTextView:function(){function d(){var g=this.getModel(),i=this.getCaretOffset(),j=g.getLineAtOffset(i);g=g.getLineStart(j);i=i-g;for(g=0;g<this._keyModes.length;g++){var l=this._keyModes[g];if(l.isActive()&&l.isStatusActive&&l.isStatusActive())return}this.reportStatus("Line "+(j+1)+" : Col "+(i+1))}this._textView=this._textViewFactory();if(this._undoStackFactory)this._undoStack=this._undoStackFactory.createUndoStack(this);if(this._contentAssistFactory){this._contentAssist=this._contentAssistFactory(this);
this._keyModes.push(this._contentAssist)}var a=this,c=this._textView;this._keyBindingFactory&&this._keyBindingFactory(this,this._keyModes,this._undoStack,this._contentAssist);c.setKeyBinding(new orion.textview.KeyBinding(27),"Cancel Current Mode");c.setAction("Cancel Current Mode",function(){for(var g=0;g<this._keyModes.length;g++)if(this._keyModes[g].isActive())return this._keyModes[g].cancel();return false}.bind(this));c.setAction("lineUp",function(){for(var g=0;g<this._keyModes.length;g++)if(this._keyModes[g].isActive())return this._keyModes[g].lineUp();
return false}.bind(this));c.setAction("lineDown",function(){for(var g=0;g<this._keyModes.length;g++)if(this._keyModes[g].isActive())return this._keyModes[g].lineDown();return false}.bind(this));c.setAction("enter",function(){for(var g=0;g<this._keyModes.length;g++)if(this._keyModes[g].isActive())return this._keyModes[g].enter();return false}.bind(this));c.addEventListener("ModelChanged",this,this.checkDirty);c.addEventListener("Selection",this,d);if(this._annotationFactory){var f=c.getModel();if(f.getBaseModel)f=
f.getBaseModel();this._annotationModel=this._annotationFactory.createAnnotationModel(f);f=this._annotationFactory.createAnnotationRulers(this._annotationModel);this._annotationRuler=f.annotationRuler;this._annotationRuler.onClick=function(g){if(g!==undefined)if(g!==-1){var i=c.getModel(),j=this.getAnnotationModel(),l=a.mapOffset(i.getLineStart(g));g=a.mapOffset(i.getLineEnd(g));if(j=j.getAnnotations(l,g).next()){g=a.getModel();a.onGotoLine(g.getLineAtOffset(l),j.start-l,j.end-l)}}};this._overviewRuler=
f.overviewRuler;this._overviewRuler.onClick=function(g){if(g!==undefined){g=c.getModel().getLineStart(g);a.moveSelection(a.mapOffset(g))}};this._annotationRuler.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"});this._annotationRuler.addAnnotationType(this.errorType);this._annotationRuler.addAnnotationType(this.warningType);this._annotationRuler.addAnnotationType(this.taskType);this._overviewRuler.addAnnotationType(this.errorType);this._overviewRuler.addAnnotationType(this.warningType);
this._overviewRuler.addAnnotationType(this.taskType);c.addRuler(this._annotationRuler);c.addRuler(this._overviewRuler)}if(this._lineNumberRulerFactory){this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel);c.addRuler(this._lineNumberRuler)}this._updateFoldingRuler()},showProblems:function(d){var a=this._annotationModel;if(a){for(var c=[],f=[],g=a.getTextModel(),i=a.getAnnotations(0,g.getCharCount()),j;i.hasNext();){j=i.next();if(j.type===this.errorType||j.type===
this.warningType)c.push(j)}if(d)for(i=0;i<d.length;i++)if(j=d[i]){var l=j.description.replace(/'/g,"&#39;").replace(/"/g,"&#34;"),h=g.getLineStart(j.line-1),k=j.severity;j={type:this[k+"Type"],start:h+j.start-1,end:h+j.end,title:l,html:"<div class='annotationHTML "+k+"'></div>",style:{styleClass:"annotation "+k},overviewStyle:{styleClass:"annotationOverview "+k},rangeStyle:{styleClass:"annotationRange "+k}};f.push(j)}a.replaceAnnotations(c,f)}},showSelection:function(d,a,c,f,g){if(typeof d==="number"){if(typeof a!==
"number")a=d;this.moveSelection(d,a)}else if(typeof c==="number"){d=this.getModel().getLineStart(c-1);if(typeof f==="number")d+=f;if(typeof g!=="number")g=0;this.moveSelection(d,d+g)}},onInputChange:function(d,a,c,f){this._title=d;if(f&&this._textView){this._undoStack.markClean();this.checkDirty()}else if(this._textView){if(a)this._textView.setText(a);else if(c!==null&&c!==undefined){this._textView.setText(c);this._textView.getModel().setLineDelimiter("auto")}this._undoStack.reset();this.checkDirty();
this._textView.focus()}},onGotoLine:function(d,a,c){if(this._textView){var f=this.getModel(),g=f.getLineStart(d),i=0;if(c===undefined)c=0;if(typeof a==="string"){d=f.getLine(d).indexOf(a);if(d!==-1){i=d;c=i+a.length}}else{i=a;a=f.getLineEnd(d)-g;i=Math.min(i,a);c=Math.min(c,a)}this.moveSelection(g+i,g+c)}},onDirtyChange:function(d){this._dirty=d},getTitle:function(){return this._title}};return e}();
orion.editor.util={connect:function(e,d,a,c){var f=e[d];e[d]=function(){var g=a;if(a===null||typeof a==="undefined")g=e;var i=typeof c==="string"?a[c]:c;typeof f==="function"&&f.apply(e,arguments);i.apply(g,arguments)}},Animation:function(){function e(d){this.options=d}e.prototype.play=function(){function d(){k=k===-1?(new Date).getTime():k;var q=((new Date).getTime()-k)/a;if(q<1){q=c(q);l=i+q*j;f(l)}else{clearInterval(h);g()}}var a=typeof this.options.duration==="number"?this.options.duration:350,
c=this.options.easing||this.defaultEasing,f=this.options.onAnimate||function(){},g=this.options.onEnd||function(){},i=this.options.curve[0],j=this.options.curve[1]-i,l,h,k=-1;h=setInterval(d,typeof this.options.rate==="number"?this.options.rate:20)};e.prototype.defaultEasing=function(d){return Math.sin(d*(Math.PI/2))};return e}(),bind:function(e){var d=this,a=Array.prototype.slice.call(arguments,1);if(a.length)return function(){return arguments.length?d.apply(e,a.concat(Array.prototype.slice.call(arguments))):
d.apply(e,a)};return function(){return arguments.length?d.apply(e,arguments):d.call(e)}}};if(!Function.prototype.bind)Function.prototype.bind=orion.editor.util.bind;typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/editor/editor",["orion/textview/keyBinding"],function(){return orion.editor});orion=orion||{};orion.textview=orion.textview||{};
orion.textview.Tooltip=function(){function e(d){this._view=d;this._create(d._parent.ownerDocument);d.addEventListener("Destroy",this,this.destroy)}e.getTooltip=function(d){if(!d._tooltip)d._tooltip=new e(d);return d._tooltip};e.prototype={_create:function(d){if(!this._domNode){this._document=d;var a=this._domNode=d.createElement("DIV");a.className="viewTooltip";var c=this._viewParent=d.createElement("DIV");a.appendChild(c);c=this._htmlParent=d.createElement("DIV");a.appendChild(c);d.body.appendChild(a);
this.hide()}},destroy:function(){if(this._domNode){if(this._contentsView){this._contentsView.destroy();this._emptyModel=this._contentsView=null}var d=this._domNode.parentNode;d&&d.removeChild(this._domNode);this._domNode=null}},hide:function(){this._contentsView&&this._contentsView.setModel(this._emptyModel);if(this._viewParent){this._viewParent.style.left="-10000px";this._viewParent.style.position="fixed";this._viewParent.style.visibility="hidden"}if(this._htmlParent){this._htmlParent.style.left=
"-10000px";this._htmlParent.style.position="fixed";this._htmlParent.style.visibility="hidden";this._htmlParent.innerHTML=""}if(this._domNode)this._domNode.style.visibility="hidden";if(this._showTimeout){clearTimeout(this._showTimeout);this._showTimeout=null}if(this._hideTimeout){clearTimeout(this._hideTimeout);this._hideTimeout=null}if(this._fadeTimeout){clearInterval(this._fadeTimeout);this._fadeTimeout=null}},isVisible:function(){return this._domNode&&this._domNode.style.visibility==="visible"},
setTarget:function(d){if(this.target!==d){this._target=d;this.hide();if(d){var a=this;a._showTimeout=setTimeout(function(){a.show(true)},1E3)}}},show:function(d){if(this._target){var a=this._target.getTooltipInfo();if(a){var c=this._domNode;c.style.left=c.style.right=c.style.width=c.style.height="auto";var f=a.contents,g;if(f instanceof Array)f=this._getAnnotationContents(f);if(typeof f==="string")(g=this._htmlParent).innerHTML=f;else if(f instanceof Node)(g=this._htmlParent).appendChild(f);else if(f instanceof
orion.textview.ProjectionTextModel){if(!this._contentsView){this._emptyModel=new orion.textview.TextModel("");g=this._contentsView=new orion.textview.TextView({model:this._emptyModel,parent:this._viewParent,tabSize:4,stylesheet:["/orion/textview/tooltip.css","/orion/textview/rulers.css","/examples/textview/textstyler.css","/css/default-theme.css"]});g._clientDiv.contentEditable=false;var i=this._view;g.addEventListener("LineStyle",i,i.onLineStyle)}g=this._contentsView;g.setModel(f);f=g.computeSize();
g=this._viewParent;g.style.width=f.width+20+"px";g.style.height=f.height+"px"}else return;g.style.left="auto";g.style.position="static";g.style.visibility="visible";f=parseInt(this._getNodeStyle(c,"padding-left","0"),10);f+=parseInt(this._getNodeStyle(c,"border-left-width","0"),10);if(a.anchor==="right"){g=parseInt(this._getNodeStyle(c,"padding-right","0"),10);g+=parseInt(this._getNodeStyle(c,"border-right-width","0"),10);c.style.right=c.ownerDocument.body.getBoundingClientRect().right-a.x+f+g+"px"}else c.style.left=
a.x-f+"px";f=parseInt(this._getNodeStyle(c,"padding-top","0"),10);f+=parseInt(this._getNodeStyle(c,"border-top-width","0"),10);c.style.top=a.y-f+"px";c.style.maxWidth=a.maxWidth+"px";c.style.maxHeight=a.maxHeight+"px";c.style.opacity="1";c.style.visibility="visible";if(d){var j=this;j._hideTimeout=setTimeout(function(){var l=parseFloat(j._getNodeStyle(c,"opacity","1"));j._fadeTimeout=setInterval(function(){if(c.style.visibility==="visible"&&l>0){l-=0.1;c.style.opacity=l}else j.hide()},50)},5E3)}}}},
_getAnnotationContents:function(d){function a(l,h){l=f.getLineStart(f.getLineAtOffset(l));h=f.getLineEnd(f.getLineAtOffset(h),true);return f.getText(l,h)}if(d.length===0)return null;var c=this._view.getModel(),f=c.getBaseModel?c.getBaseModel():c,g;if(d.length===1){c=d[0];if(c.title){g=c.title.replace(/</g,"&lt;").replace(/>/g,"&gt;");return c.html+"&nbsp;"+g}else{d=new orion.textview.ProjectionTextModel(f);g=f.getLineStart(f.getLineAtOffset(c.start));d.addProjection({start:c.end,end:d.getCharCount()});
d.addProjection({start:0,end:g});return d}}else{for(var i="<em>Multiple annotations:</em><br>",j=0;j<d.length;j++){c=d[j];(g=c.title)||(g=a(c.start,c.end));g=g.replace(/</g,"&lt;").replace(/>/g,"&gt;");i+=c.html+"&nbsp;"+g+"<br>"}return i}},_getNodeStyle:function(d,a,c){var f;if(d){f=d.style[a];if(!f)if(d.currentStyle){f=0;for(a=a;(f=a.indexOf("-",f))!==-1;)a=a.substring(0,f)+a.substring(f+1,f+2).toUpperCase()+a.substring(f+2);f=d.currentStyle[a]}else f=(d=d.ownerDocument.defaultView.getComputedStyle(d,
null))?d.getPropertyValue(a):null}return f||c}};return e}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/textview/tooltip",[],function(){return orion.textview});orion=orion||{};orion.textview=orion.textview||{};
orion.textview.Ruler=function(){function e(d,a,c,f){this._location=a||"left";this._overview=c||"page";this._rulerStyle=f;this._types=[];this._view=null;var g=this;this._annotationModelListener={onChanged:function(i){g._onAnnotationModelChanged(i)}};this.setAnnotationModel(d)}e.prototype={addAnnotationType:function(d){this._types.push(d)},getAnnotations:function(d,a){var c=this._annotationModel;if(!c)return[];var f=this._view.getModel(),g=f.getLineStart(d),i=f.getLineEnd(a-1),j=f;if(f.getBaseModel){j=
f.getBaseModel();g=f.mapOffset(g);i=f.mapOffset(i)}c=c.getAnnotations(g,i);for(g=[];c.hasNext();){i=c.next();if(this.isAnnotationTypeVisible(i.type))for(var l=j.getLineAtOffset(i.start),h=j.getLineAtOffset(i.end-1),k=l;k<=h;k++){var q=k;if(f!==j){q=j.getLineStart(k);q=f.mapOffset(q,true);if(q===-1)continue;q=f.getLineAtOffset(q)}if(d<=q&&q<a){var u=this._mergeAnnotation(g[q],i,k-l,h-l+1);if(u)g[q]=u}}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var r in g)if(g[r]._multiple)g[r].html+=
this._multiAnnotationOverlay.html;return g},getAnnotationModel:function(){return this._annotationModel},getLocation:function(){return this._location},getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getWidestAnnotation:function(){return null},isAnnotationTypeVisible:function(d){for(var a=0;a<this._types.length;a++)if(this._types[a]===d)return true;return false},removeAnnotationType:function(d){for(var a=0;a<this._types.length;a++)if(this._types[a]===
d){this._types.splice(a,1);break}},setAnnotationModel:function(d){this._annotationModel&&this._annotationModel.removeListener(this._annotationModelListener);(this._annotationModel=d)&&this._annotationModel.addListener(this._annotationModelListener)},setMultiAnnotation:function(d){this._multiAnnotation=d},setMultiAnnotationOverlay:function(d){this._multiAnnotationOverlay=d},setView:function(d){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this,this._onTextModelChanged);
this._view=d;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this,this._onTextModelChanged)},onClick:function(){},onDblClick:function(){},onMouseMove:function(d,a){var c=orion.textview.Tooltip.getTooltip(this._view);if(c)if(!(c.isVisible()&&this._tooltipLineIndex===d)){this._tooltipLineIndex=d;var f=this;c.setTarget({y:a.clientY,getTooltipInfo:function(){return f._getTooltipInfo(f._tooltipLineIndex,this.y)}})}},onMouseOver:this._onMouseMove,onMouseOut:function(){var d=
orion.textview.Tooltip.getTooltip(this._view);d&&d.setTarget(null)},_getTooltipInfo:function(d,a){if(d!==undefined){var c=this._view,f=c.getModel(),g=this._annotationModel,i=[];if(g){var j=f.getLineStart(d),l=f.getLineEnd(d);if(f.getBaseModel){j=f.mapOffset(j);l=f.mapOffset(l)}for(g=g.getAnnotations(j,l);g.hasNext();){j=g.next();this.isAnnotationTypeVisible(j.type)&&i.push(j)}}i=this._getTooltipContents(d,i);if(!i)return null;i={contents:i,anchor:this.getLocation()};g=c.getClientArea();g.y=this.getOverview()===
"document"?c.convert({y:a},"view","document").y:c.getLocationAtOffset(f.getLineStart(d)).y;c.convert(g,"document","page");i.x=g.x;i.y=g.y;if(i.anchor==="right")i.x+=g.width;i.maxWidth=g.width;i.maxHeight=g.height-(g.y-c._parent.getBoundingClientRect().top);return i}},_getTooltipContents:function(d,a){return a},_onAnnotationModelChanged:function(d){function a(j){for(var l=0;l<j.length;l++)if(g.isAnnotationTypeVisible(j[l].type)){var h=j[l].start,k=j[l].end;if(f.getBaseModel){h=f.mapOffset(h,true);
k=f.mapOffset(k,true)}h!==-1&&k!==-1&&c.redrawLines(f.getLineAtOffset(h),f.getLineAtOffset(Math.max(h,k-1))+1,g)}}var c=this._view;if(c){var f=c.getModel(),g=this,i=f.getLineCount();if(d.textModelChangedEvent){d=d.textModelChangedEvent.start;if(f.getBaseModel)d=f.mapOffset(d,true);d=f.getLineAtOffset(d);c.redrawLines(d,i,g)}else{a(d.added);a(d.removed);a(d.changed)}}},_mergeAnnotation:function(d,a,c){d||(d={});if(c===0)if(d.html&&a.html){if(a.html!==d.html)if(!d._multiple&&this._multiAnnotation)d.html=
this._multiAnnotation.html;d._multiple=true}else d.html=a.html;d.style=this._mergeStyle(d.style,a.style);return d},_mergeStyle:function(d,a){if(a){d||(d={});if(d.styleClass&&a.styleClass&&d.styleClass!==a.styleClass)d.styleClass+=" "+a.styleClass;else d.styleClass=a.styleClass;var c;if(a.style){if(!d.style)d.style={};for(c in a.style)d.style[c]||(d.style[c]=a.style[c])}if(a.attributes){if(!d.attributes)d.attributes={};for(c in a.attributes)d.attributes[c]||(d.attributes[c]=a.attributes[c])}}return d}};
return e}();
orion.textview.LineNumberRuler=function(){function e(d,a,c,f,g){orion.textview.Ruler.call(this,d,a,"page",c);this._oddStyle=f||{style:{backgroundColor:"white"}};this._evenStyle=g||{style:{backgroundColor:"white"}};this._numOfDigits=0}e.prototype=new orion.textview.Ruler;e.prototype.getAnnotations=function(d,a){var c=orion.textview.Ruler.prototype.getAnnotations.call(this,d,a),f=this._view.getModel();for(d=d;d<a;d++){var g=d&1?this._oddStyle:this._evenStyle,i=d;if(f.getBaseModel){i=f.getLineStart(i);i=
f.getBaseModel().getLineAtOffset(f.mapOffset(i))}c[d]||(c[d]={});c[d].html=i+1+"";if(!c[d].style)c[d].style=g}return c};e.prototype.getWidestAnnotation=function(){var d=this._view.getModel().getLineCount();return this.getAnnotations(d-1,d)[d-1]};e.prototype._onTextModelChanged=function(d){d=d.start;var a=this._view.getModel(),c=((a.getBaseModel?a.getBaseModel().getLineCount():a.getLineCount())+"").length;if(this._numOfDigits!==c){this._numOfDigits=c;this._view.redrawLines(a.getLineAtOffset(d),a.getLineCount(),
this)}};return e}();orion.textview.AnnotationRuler=function(){function e(d,a,c){orion.textview.Ruler.call(this,d,a,"page",c)}e.prototype=new orion.textview.Ruler;return e}();
orion.textview.OverviewRuler=function(){function e(d,a,c){orion.textview.Ruler.call(this,d,a,"document",c)}e.prototype=new orion.textview.Ruler;e.prototype.getRulerStyle=function(){var d={style:{lineHeight:"1px",fontSize:"1px"}};return d=this._mergeStyle(d,this._rulerStyle)};e.prototype.onClick=function(d){d!==undefined&&this._view.setTopIndex(d)};e.prototype._getTooltipContents=function(d,a){if(a.length===0){a=this._view.getModel();d=d;if(a.getBaseModel){d=a.getLineStart(d);d=a.getBaseModel().getLineAtOffset(a.mapOffset(d))}return"Line: "+
(d+1)}return orion.textview.Ruler.prototype._getTooltipContents.call(this,d,a)};e.prototype._mergeAnnotation=function(d,a,c,f){if(c===0){d=d;if(!d){d={html:"&nbsp;",style:{style:{height:3*f+"px"}}};d.style=this._mergeStyle(d.style,a.overviewStyle)}return d}};return e}();
orion.textview.FoldingRuler=function(){function e(d,a,c){orion.textview.AnnotationRuler.call(this,d,a,c)}e.prototype=new orion.textview.AnnotationRuler;e.prototype.onClick=function(d){if(d!==undefined){var a=this._annotationModel;if(a){var c=this._view.getModel(),f=c.getLineStart(d);d=c.getLineEnd(d,true);if(c.getBaseModel){f=c.mapOffset(f);d=c.mapOffset(d)}var g;for(a=a.getAnnotations(f,d);!g&&a.hasNext();){c=a.next();if(this.isAnnotationTypeVisible(c.type))g=c}if(g){(a=orion.textview.Tooltip.getTooltip(this._view))&&
a.setTarget(null);g.expanded?g.collapse():g.expand();this._annotationModel.modifyAnnotation(g)}}}};e.prototype._getTooltipContents=function(d,a){if(a.length===1)if(a[0].expanded)return null;return orion.textview.AnnotationRuler.prototype._getTooltipContents.call(this,d,a)};e.prototype._onAnnotationModelChanged=function(d){function a(h){for(i=0;i<h.length;i++)if(g.isAnnotationTypeVisible(h[i].type)){var k=h[i].start;if(f.getBaseModel)k=f.mapOffset(k,true);if(k!==-1)l=Math.min(l,f.getLineAtOffset(k))}}
if(d.textModelChangedEvent)orion.textview.AnnotationRuler.prototype._onAnnotationModelChanged.call(this,d);else{var c=this._view;if(c){var f=c.getModel(),g=this,i,j=f.getLineCount(),l=j;a(d.added);a(d.removed);a(d.changed);d=c.getRulers();for(i=0;i<d.length;i++)c.redrawLines(l,j,d[i])}}};return e}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/textview/rulers",["orion/textview/tooltip"],function(){return orion.textview});orion=orion||{};
orion.textview=orion.textview||{};
orion.textview.FoldingAnnotation=function(){function e(d,a,c,f,g,i,j,l){this.type=a;this.start=c;this.end=f;this._projectionModel=d;this._expandedHTML=this.html=g;this._expandedStyle=this.style=i;this._collapsedHTML=j;this._collapsedStyle=l;this.expanded=true}e.prototype={collapse:function(){if(this.expanded){this.expanded=false;this.html=this._collapsedHTML;this.style=this._collapsedStyle;var d=this._projectionModel,a=d.getBaseModel();this._projection={start:a.getLineStart(a.getLineAtOffset(this.start)+1),
end:a.getLineEnd(a.getLineAtOffset(this.end),true)};d.addProjection(this._projection)}},expand:function(){if(!this.expanded){this.expanded=true;this.html=this._expandedHTML;this.style=this._expandedStyle;this._projectionModel.removeProjection(this._projection)}}};return e}();
orion.textview.AnnotationModel=function(){function e(d){this._annotations=[];this._listeners=[];var a=this;this._modelListener={onChanged:function(c){a._onChanged(c)}};this.setTextModel(d)}e.prototype={addListener:function(d){this._listeners.push(d)},removeListener:function(d){for(var a=0;a<this._listeners.length;a++)if(this._listeners[a]===d){this._listeners.splice(a,1);return}},addAnnotation:function(d){if(d){var a=this._annotations,c=this._binarySearch(a,d.start);a.splice(c,0,d);this.onChanged({added:[d],
removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(d,a){var c=this._annotations,f=this._binarySearch(c,d,true);return{next:function(){if(f<c.length){var g=c[f++];if(g.start<a)return g}return null},hasNext:function(){return f<c.length&&c[f].start<a}}},modifyAnnotation:function(d){if(d){for(var a=this._annotations,c=this._binarySearch(a,d.start),f={added:[],removed:[],changed:[]};c<a.length&&a[c].start===d.start;){if(a[c]===d){f.changed.push(d);break}c++}f.changed.length>
0&&this.onChanged(f)}},onChanged:function(d){for(var a=0;a<this._listeners.length;a++){var c=this._listeners[a];c&&c.onChanged&&c.onChanged(d)}},removeAnnotations:function(d){var a=this._annotations,c,f;if(d){c=[];for(f=a.length-1;f>=0;f--){var g=a[f];g.type===d&&a.splice(f,1);c.splice(0,0,g)}}else c=a;this.onChanged({removed:c,added:[],changed:[]})},removeAnnotation:function(d){var a=this._annotations,c=this._binarySearch(a,d.start);if(0<=c&&c<a.length)if(a[c]===d){a.splice(c,1);this.onChanged({removed:[d],
added:[],changed:[]})}},replaceAnnotations:function(d,a){var c=this._annotations,f,g,i;a||(a=[]);d||(d=[]);for(f=0;f<d.length;f++){i=d[f];g=this._binarySearch(c,i.start);0<=g&&g<c.length&&c[g]===i&&c.splice(g,1)}for(f=0;f<a.length;f++){i=a[f];g=this._binarySearch(c,i.start);c.splice(g,0,i)}this.onChanged({removed:d,added:a,changed:[]})},setTextModel:function(d){this._model&&this._model.removeListener(this._modelListener);(this._model=d)&&this._model.addListener(this._modelListener)},_binarySearch:function(d,
a,c){for(var f=d.length,g=-1,i;f-g>1;){i=Math.floor((f+g)/2);if(a<=d[i].start)f=i;else if(c&&a<d[i].end){f=i;break}else g=i}return f},_onChanged:function(d){var a=d.start,c=d.addedCharCount,f=d.removedCharCount,g=this._annotations,i=a+f,j=this._binarySearch(g,a,true);if(0<=j&&j<g.length){d={added:[],changed:[],textModelChangedEvent:d};c=c-f;for(i=f=this._binarySearch(g,i,true);i<g.length;i++){var l=g[i];if(l.start>a)l.start+=c;if(l.end>a)l.end+=c;d.changed.push(l)}d.removed=g.splice(j,f-j);this.onChanged(d)}}};
return e}();
orion.textview.AnnotationStyler=function(){function e(d,a){this._view=d;this._annotationModel=a;d.addEventListener("LineStyle",this,this._onLineStyle);var c=this;this._annotationModelListener={onChanged:function(f){c._onAnnotationModelChanged(f)}};a.addListener(this._annotationModelListener)}e.prototype={destroy:function(){var d=this._view;if(d){d.removeEventListener("Destroy",this,this._onDestroy);d.removeEventListener("LineStyle",this,this._onLineStyle);this.view=null}(d=this._annotationModel)&&d.removeListener(this._annotationModelListener)},
_mergeStyle:function(d,a){if(a){d||(d={});if(d.styleClass&&a.styleClass&&d.styleClass!==a.styleClass)d.styleClass+=" "+a.styleClass;else d.styleClass=a.styleClass;var c;if(a.style){if(!d.style)d.style={};for(c in a.style)d.style[c]||(d.style[c]=a.style[c])}if(a.attributes){if(!d.attributes)d.attributes={};for(c in a.attributes)d.attributes[c]||(d.attributes[c]=a.attributes[c])}}return d},_mergeStyleRanges:function(d,a){for(var c=0;c<d.length;c++){var f=d[c];if(a.end<=f.start)break;if(!(a.start>=f.end)){var g=
this._mergeStyle({},f.style);g=this._mergeStyle(g,a.style);if(a.start<=f.start&&a.end>=f.end)d[c]={start:f.start,end:f.end,style:g};else if(a.start>f.start&&a.end<f.end){d.splice(c,1,{start:f.start,end:a.start,style:f.style},{start:a.start,end:a.end,style:g},{start:a.end,end:f.end,style:f.style});c+=2}else if(a.start>f.start){d.splice(c,1,{start:f.start,end:a.start,style:f.style},{start:a.start,end:f.end,style:g});c+=1}else if(a.end<f.end){d.splice(c,1,{start:f.start,end:a.end,style:g},{start:a.end,
end:f.end,style:f.style});c+=1}}}},_onAnnotationModelChanged:function(d){function a(g){for(var i=0;i<g.length;i++)if(g[i].rangeStyle){var j=g[i].start,l=g[i].end;if(f.getBaseModel){j=f.mapOffset(j,true);l=f.mapOffset(l,true)}j!==-1&&l!==-1&&c.redrawRange(j,l)}}if(!d.textModelChangedEvent){var c=this._view;if(c){var f=c.getModel();a(d.added);a(d.removed);a(d.changed)}}},_onDestroy:function(){this.destroy()},_onLineStyle:function(d){var a=this._annotationModel,c=this._view.getModel(),f=a.getTextModel(),
g=d.lineStart,i=d.lineStart+d.lineText.length;if(f!==c){g=c.mapOffset(g);i=c.mapOffset(i)}for(a=a.getAnnotations(g,i);a.hasNext();){g=a.next();if(g.rangeStyle){i=g.start;var j=g.end;if(f!==c){i=c.mapOffset(i,true);j=c.mapOffset(j,true)}this._mergeStyleRanges(d.ranges,{start:i,end:j,style:g.rangeStyle})}if(g.lineStyle){d.style=this._mergeStyle({},d.style);d.style=this._mergeStyle(d.style,g.lineStyle)}}}};return e}();
typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/textview/annotations",[],function(){return orion.textview});orion=orion||{};orion.editor=orion.editor||{};
orion.editor.UndoFactory=function(){function e(){}e.prototype={createUndoStack:function(d){d=d.getTextView();var a=new orion.textview.UndoStack(d,200);d.setKeyBinding(new orion.textview.KeyBinding("z",true),"Undo");d.setAction("Undo",function(){a.undo();return true});var c=navigator.platform.indexOf("Mac")!==-1;d.setKeyBinding(c?new orion.textview.KeyBinding("z",true,true):new orion.textview.KeyBinding("y",true),"Redo");d.setAction("Redo",function(){a.redo();return true});return a}};return e}();
orion.editor.LineNumberRulerFactory=function(){function e(){}e.prototype={createLineNumberRuler:function(d){return new orion.textview.LineNumberRuler(d,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};return e}();orion.editor.FoldingRulerFactory=function(){function e(){}e.prototype={createFoldingRuler:function(d){return new orion.textview.FoldingRuler(d,"left",{styleClass:"ruler folding"})}};return e}();
orion.editor.AnnotationFactory=function(){function e(){}e.prototype={createAnnotationModel:function(d){return new orion.textview.AnnotationModel(d)},createAnnotationStyler:function(d,a){return new orion.textview.AnnotationStyler(d,a)},createAnnotationRulers:function(d){var a=new orion.textview.AnnotationRuler(d,"left",{styleClass:"ruler annotations"});d=new orion.textview.OverviewRuler(d,"right",{styleClass:"ruler overview"});return{annotationRuler:a,overviewRuler:d}}};return e}();
orion.editor.TextActions=function(){function e(d,a,c){this.editor=d;this.textView=d.getTextView();this.undoStack=a;this._incrementalFindActive=false;this._incrementalFindSuccess=true;this._incrementalFindIgnoreSelection=false;this._incrementalFindPrefix="";(this._searcher=c)&&this._searcher.getAdaptor().setEditor(this.editor);this.init()}e.prototype={init:function(){this._incrementalFindListener={onVerify:function(d){function a(j){return j.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")}var c=this.editor,
f=c.getModel(),g=c.mapOffset(d.start),i=c.mapOffset(d.end);g=f.getText(g,i);f=this._incrementalFindPrefix;if((f=f.match(new RegExp("^"+a(g),"i")))&&f.length>0){f=this._incrementalFindPrefix+=d.text;this.editor.reportStatus("Incremental find: "+f);g=f.toLowerCase()===f;i=c.getSelection().start;if(g=c.doFind(f,i,g)){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;c.moveSelection(g.index,g.index+g.length);this._incrementalFindIgnoreSelection=false}else{c.reportStatus("Incremental find: "+
f+" (not found)",true);this._incrementalFindSuccess=false}d.text=null}}.bind(this),onSelection:function(){this._incrementalFindIgnoreSelection||this.toggleIncrementalFind()}.bind(this)};this.textView.setKeyBinding(new orion.textview.KeyBinding("f",true),"Find...");this.textView.setAction("Find...",function(){if(this._searcher){var d=this.editor,a=d.getSelection(),c="";if(a.end>a.start)c=d.getModel().getText(a.start,a.end);this._searcher.buildToolBar(c);return true}return false}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding("k",
true),"Find Next Occurrence");this.textView.setAction("Find Next Occurrence",function(){if(this._searcher){this._searcher.findNext(true);return true}return false}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding("k",true,true),"Find Previous Occurrence");this.textView.setAction("Find Previous Occurrence",function(){if(this._searcher){this._searcher.findNext(false);return true}return false}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding("j",true),"Incremental Find");
this.textView.setAction("Incremental Find",function(){if(this._searcher&&this._searcher.visible())return true;var d=this.editor;if(this._incrementalFindActive){var a=this._incrementalFindPrefix;if(a.length!==0){var c;if(this._searcher)c=this._searcher.findNext(true,a);else{c=0;if(this._incrementalFindSuccess)c=d.getSelection().start+1;var f=a.toLowerCase()===a;c=d.doFind(a,c,f)}if(c){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;d.moveSelection(c.index,c.index+c.length);this._incrementalFindIgnoreSelection=
false;d.reportStatus("Incremental find: "+a)}else{d.reportStatus("Incremental find: "+a+" (not found)",true);this._incrementalFindSuccess=false}}}else{d.setCaretOffset(d.getCaretOffset());this.toggleIncrementalFind()}return true}.bind(this));this.textView.setAction("deletePrevious",function(){if(this._incrementalFindActive){var d=this.editor,a=this._incrementalFindPrefix;a=this._incrementalFindPrefix=a.substring(0,a.length-1);if(a.length===0){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=
true;d.setCaretOffset(d.getSelection().start);this._incrementalFindIgnoreSelection=false;this.toggleIncrementalFind();return true}d.reportStatus("Incremental find: "+a);var c=d.getCaretOffset();c=d.getModel().getText().lastIndexOf(a,c-a.length-1);if(c!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;d.moveSelection(c,c+a.length);this._incrementalFindIgnoreSelection=false}else d.reportStatus("Incremental find: "+a+" (not found)",true);return true}return false}.bind(this));
this.textView.setAction("tab",function(){var d=this.editor,a=d.getModel(),c=d.getSelection(),f=a.getLineAtOffset(c.start),g=a.getLineAtOffset(c.end>c.start?c.end-1:c.end);if(f!==g){var i=[];i.push("");for(var j=f;j<=g;j++)i.push(a.getLine(j,true));j=a.getLineStart(f);a=a.getLineEnd(g,true);d.setText(i.join("\t"),j,a);d.setSelection(j===c.start?c.start:c.start+1,c.end+(g-f+1));return true}return false}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding(9,false,true),"Unindent Lines");
this.textView.setAction("Unindent Lines",function(){for(var d=this.editor,a=d.getModel(),c=d.getSelection(),f=a.getLineAtOffset(c.start),g=a.getLineAtOffset(c.end>c.start?c.end-1:c.end),i=[],j=0,l=f;l<=g;l++){var h=a.getLine(l,true);if(a.getLineStart(l)!==a.getLineEnd(l)){if(h.indexOf("\t")!==0)return false;h=h.substring(1);j++}i.push(h)}f=a.getLineStart(f);l=a.getLineEnd(g,true);a=a.getLineStart(g);d.setText(i.join(""),f,l);d.setSelection(f===c.start?c.start:c.start-1,c.end-j+(c.end===a+1?1:0));
return true}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding(38,false,false,true),"Move Lines Up");this.textView.setAction("Move Lines Up",function(){var d=this.editor,a=d.getModel(),c=d.getSelection(),f=a.getLineAtOffset(c.start);if(f===0)return true;var g=a.getLineAtOffset(c.end>c.start?c.end-1:c.end),i=a.getLineCount();c=a.getLineStart(f-1);var j=a.getLineStart(f),l=a.getLineEnd(g,true),h=a.getText(j,l),k=0;if(g===i-1){g=a.getLineEnd(f-1);f=a.getLineEnd(f-1,true);h+=a.getText(g,
f);j=g;k=f-g}this.startUndo();d.setText("",j,l);d.setText(h,c,c);d.setSelection(c,c+h.length-k);this.endUndo();return true}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding(40,false,false,true),"Move Lines Down");this.textView.setAction("Move Lines Down",function(){var d=this.editor,a=d.getModel(),c=d.getSelection(),f=a.getLineAtOffset(c.start),g=a.getLineAtOffset(c.end>c.start?c.end-1:c.end),i=a.getLineCount();if(g===i-1)return true;f=a.getLineStart(f);c=a.getLineEnd(g,true);
var j=a.getLineEnd(g+1,true)-(c-f),l=0;if(g!==i-2)a=a.getText(f,c);else{g=a.getLineEnd(g);a=a.getText(g,c)+a.getText(f,g);l+=c-g}this.startUndo();d.setText("",f,c);d.setText(a,j,j);d.setSelection(j+l,j+l+a.length);this.endUndo();return true}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding(38,true,false,true),"Copy Lines Up");this.textView.setAction("Copy Lines Up",function(){var d=this.editor,a=d.getModel(),c=d.getSelection(),f=a.getLineAtOffset(c.start);c=a.getLineAtOffset(c.end>
c.start?c.end-1:c.end);f=a.getLineStart(f);var g=a.getLineEnd(c,true),i=a.getLineCount(),j="";g=a.getText(f,g);if(c===i-1)g+=j=a.getLineDelimiter();d.setText(g,f,f);d.setSelection(f,f+g.length-j.length);return true}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding(40,true,false,true),"Copy Lines Down");this.textView.setAction("Copy Lines Down",function(){var d=this.editor,a=d.getModel(),c=d.getSelection(),f=a.getLineAtOffset(c.start);c=a.getLineAtOffset(c.end>c.start?c.end-1:
c.end);var g=a.getLineStart(f);f=a.getLineEnd(c,true);var i=a.getLineCount(),j="";g=a.getText(g,f);if(c===i-1)g=(j=a.getLineDelimiter())+g;d.setText(g,f,f);d.setSelection(f+j.length,f+g.length);return true}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding("d",true,false,false),"Delete Selected Lines");this.textView.setAction("Delete Selected Lines",function(){var d=this.editor,a=d.getSelection(),c=d.getModel(),f=c.getLineAtOffset(a.start);a=c.getLineAtOffset(a.end>a.start?a.end-
1:a.end);f=c.getLineStart(f);c=c.getLineEnd(a,true);d.setText("",f,c);return true}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding("l",true),"Goto Line...");this.textView.setAction("Goto Line...",function(){var d=this.editor,a=d.getModel().getLineAtOffset(d.getCaretOffset());if(a=prompt("Go to line:",a+1)){a=parseInt(a,10);d.onGotoLine(a-1,0)}return true}.bind(this))},toggleIncrementalFind:function(){if(this._incrementalFindActive=!this._incrementalFindActive){this.editor.reportStatus("Incremental find: "+
this._incrementalFindPrefix);this.textView.addEventListener("Verify",this,this._incrementalFindListener.onVerify);this.textView.addEventListener("Selection",this,this._incrementalFindListener.onSelection)}else{this._incrementalFindPrefix="";this.editor.reportStatus("");this.textView.removeEventListener("Verify",this,this._incrementalFindListener.onVerify);this.textView.removeEventListener("Selection",this,this._incrementalFindListener.onSelection);this.textView.setCaretOffset(this.textView.getCaretOffset())}},
startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},cancel:function(){this.toggleIncrementalFind()},isActive:function(){return this._incrementalFindActive},isStatusActive:function(){return this._incrementalFindActive},lineUp:function(){if(this._incrementalFindActive){var d=this._incrementalFindPrefix;if(d.length===0)return false;var a=this.editor,c=a.getModel(),f;f=this._incrementalFindSuccess?a.getCaretOffset()-
d.length-1:c.getCharCount()-1;c=c.getText().lastIndexOf(d,f);if(c!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;a.moveSelection(c,c+d.length);this._incrementalFindIgnoreSelection=false}else{a.reportStatus("Incremental find: "+d+" (not found)",true);this._incrementalFindSuccess=false}return true}return false},lineDown:function(){if(this._incrementalFindActive){var d=this._incrementalFindPrefix;if(d.length===0)return false;var a=this.editor,c=a.getModel(),f=0;if(this._incrementalFindSuccess)f=
a.getSelection().start+1;c=c.getText().indexOf(d,f);if(c!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;a.moveSelection(c,c+d.length);this._incrementalFindIgnoreSelection=false;this.editor.reportStatus("Incremental find: "+d)}else{a.reportStatus("Incremental find: "+d+" (not found)",true);this._incrementalFindSuccess=false}return true}return false},enter:function(){return false}};return e}();
orion.editor.SourceCodeActions=function(){function e(d,a,c,f){this.editor=d;this.textView=d.getTextView();this.undoStack=a;this.contentAssist=c;this.linkedMode=f;this.contentAssist&&this.contentAssist.addEventListener("accept",this.contentAssistProposalAccepted.bind(this));this.init()}e.prototype={startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},init:function(){function d(a,c,f){var g=a.getLineAtOffset(c),
i=a.getLineAtOffset(f),j,l,h,k,q,u;for(j=g;j>=0;j--){l=a.getLine(j);h=j===g?c-a.getLineStart(g):l.length;k=l.lastIndexOf("/*",h);l=l.lastIndexOf("*/",h);if(l>k)break;else if(k!==-1){q=a.getLineStart(j)+k;break}}for(j=i;j<a.getLineCount();j++){l=a.getLine(j);h=j===i?f-a.getLineStart(i):0;k=l.indexOf("/*",h);l=l.indexOf("*/",h);if(k!==-1&&k<l)break;else if(l!==-1){u=a.getLineStart(j)+l;break}}return{commentStart:q,commentEnd:u}}this.textView.setKeyBinding(new orion.textview.KeyBinding(191,true),"Toggle Line Comment");
this.textView.setAction("Toggle Line Comment",function(){for(var a=this.editor,c=a.getModel(),f=a.getSelection(),g=c.getLineAtOffset(f.start),i=c.getLineAtOffset(f.end>f.start?f.end-1:f.end),j=true,l=[],h,k,q=g;q<=i;q++){h=c.getLine(q,true);l.push(h);if(!j||(k=h.indexOf("//"))===-1)j=false;else if(k!==0){var u;for(u=0;u<k;u++){j=h.charCodeAt(u);if(!(j===32||j===9))break}j=u===k}}q=c.getLineStart(g);u=c.getLineEnd(i,true);if(j){for(j=0;j<l.length;j++){h=l[j];k=h.indexOf("//");l[j]=h.substring(0,k)+
h.substring(k+2)}l=l.join("");h=c.getLineStart(i);c=q===f.start?f.start:f.start-2;f=f.end-2*(i-g+1)+(f.end===h+1?2:0)}else{l.splice(0,0,"");l=l.join("//");c=q===f.start?f.start:f.start+2;f=f.end+2*(i-g+1)}a.setText(l,q,u);a.setSelection(c,f);return true}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding(191,true,true),"Add Block Comment");this.textView.setAction("Add Block Comment",function(){var a=this.editor,c=a.getModel(),f=a.getSelection(),g=new RegExp("/\\*|\\*/","g");c.getLineAtOffset(f.start);
c.getLineAtOffset(f.end);var i=d(c,f.start,f.end);if(i.commentStart!==undefined&&i.commentEnd!==undefined)return true;c=c.getText(f.start,f.end);if(c.length===0)return true;i=c.length;c=c.replace(g,"");g=c.length;a.setText("/*"+c+"*/",f.start,f.end);a.setSelection(f.start+2,f.end+2+(g-i));return true}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding(220,true,true),"Remove Block Comment");this.textView.setAction("Remove Block Comment",function(){var a=this.editor,c=a.getModel(),
f=a.getSelection();c.getLineAtOffset(f.start);c.getLineAtOffset(f.end);var g=c.getText(f.start,f.end),i,j,l;for(l=0;l<g.length;l++)if(g.substring(l,l+2)==="/*"){i=f.start+l;break}for(;l<g.length;l++)if(g.substring(l,l+2)==="*/"){j=f.start+l;break}if(i!==undefined&&j!==undefined){a.setText(c.getText(i+2,j),i,j+2);a.setSelection(i,j)}else{g=d(c,f.start,f.end);if(g.commentStart===undefined||g.commentEnd===undefined)return true;c=c.getText(g.commentStart+2,g.commentEnd);a.setText(c,g.commentStart,g.commentEnd+
2);a.setSelection(f.start-2,f.end-2)}return true}.bind(this))},contentAssistProposalAccepted:function(d){var a=d.data.proposal,c;if(typeof a==="string")c=a;else if(typeof a.proposal==="string")c=a.proposal;this.textView.setText(c,d.data.start,d.data.end);if(a.positions&&this.linkedMode){d=[];for(c=0;c<a.positions.length;++c)d[c]={positions:[{offset:a.positions[c].offset,length:a.positions[c].length}]};this.linkedMode.enterLinkedMode({groups:d,escapePosition:a.escapePosition})}return true},cancel:function(){return false},
isActive:function(){return true},isStatusActive:function(){return false},lineUp:function(){return false},lineDown:function(){return false},enter:function(){var d=this.editor,a=d.getSelection();if(a.start===a.end){var c=d.getModel(),f=c.getLineAtOffset(a.start),g=c.getLine(f,true),i=c.getLineStart(f);f=0;i=a.start-i;for(var j;f<i&&((j=g.charCodeAt(f))===32||j===9);)f++;if(f>0){var l=g.substring(0,f);for(f=i;f<g.length&&((j=g.charCodeAt(f++))===32||j===9);)a.end++;d.setText(c.getLineDelimiter()+l,a.start,
a.end);return true}}return false}};return e}();
orion.editor.LinkedMode=function(){function e(d){this.editor=d;this.textView=d.getTextView();this.linkedModeActive=false;this.linkedModePositions=[];this.linkedModeEscapePosition=this.linkedModeCurrentPositionIndex=0;this.linkedModeListener={onVerify:function(a){for(var c=false,f=0,g=0;g<this.linkedModePositions.length;++g){var i=this.linkedModePositions[g];if(c)i.offset+=f;else if(a.start>=i.offset&&a.end<=i.offset+i.length){c=i.length;i.length=a.start-i.offset+a.text.length+(i.offset+i.length-a.end);
f=i.length-c;c=true}}if(c)this.linkedModeEscapePosition+=f;else this.cancel()}.bind(this)}}e.prototype={enterLinkedMode:function(d){if(!this.linkedModeActive){this.linkedModeActive=true;this.linkedModePositions=[];for(var a=0;a<d.groups.length;++a){var c=d.groups[a];this.linkedModePositions[a]={offset:c.positions[0].offset,length:c.positions[0].length}}this.linkedModeEscapePosition=d.escapePosition;this.linkedModeCurrentPositionIndex=0;this.selectTextForLinkedModePosition(this.linkedModePositions[this.linkedModeCurrentPositionIndex]);
this.textView.addEventListener("Verify",this,this.linkedModeListener.onVerify);this.textView.setKeyBinding(new orion.textview.KeyBinding(9),"nextLinkedModePosition");this.textView.setAction("nextLinkedModePosition",function(){this.linkedModeCurrentPositionIndex=++this.linkedModeCurrentPositionIndex%this.linkedModePositions.length;this.selectTextForLinkedModePosition(this.linkedModePositions[this.linkedModeCurrentPositionIndex]);return true}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding(9,
false,true),"previousLinkedModePosition");this.textView.setAction("previousLinkedModePosition",function(){this.linkedModeCurrentPositionIndex=this.linkedModeCurrentPositionIndex>0?this.linkedModeCurrentPositionIndex-1:this.linkedModePositions.length-1;this.selectTextForLinkedModePosition(this.linkedModePositions[this.linkedModeCurrentPositionIndex]);return true}.bind(this));this.editor.reportStatus("Linked Mode entered")}},isActive:function(){return this.linkedModeActive},isStatusActive:function(){return this.linkedModeActive},
enter:function(){this.cancel();return true},cancel:function(){if(this.linkedModeActive){this.linkedModeActive=false;this.textView.removeEventListener("Verify",this,this.linkedModeListener.onVerify);this.textView.setKeyBinding(new orion.textview.KeyBinding(9),"tab");this.textView.setKeyBinding(new orion.textview.KeyBinding(9,false,true),null);this.textView.setCaretOffset(this.linkedModeEscapePosition,false);this.editor.reportStatus("Linked Mode exited")}},selectTextForLinkedModePosition:function(d){this.textView.setSelection(d.offset,
d.offset+d.length)}};return e}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/editor/editorFeatures",["orion/textview/undoStack","orion/textview/keyBinding","orion/textview/rulers","orion/textview/annotations"],function(){return orion.editor});
define("orion/breadcrumbs",["require","dojo"],function(e,d){function a(c){this._init(c)}a.prototype={_init:function(c){var f=c.container;if(typeof f==="string")f=d.byId(f);if(!f)throw"no parent container";this._container=f;d.removeClass(f,"currentLocation");this._id=c.id||"eclipse.breadcrumbs";this._resource=c.resource||null;this._firstSegmentName=c.firstSegmentName;this._makeHref=c.makeHref;this.path="";this.render()},getNavigatorRootSegment:function(){if(this._firstSegmentName){var c=document.createElement("a");
d.place(document.createTextNode(this._firstSegmentName),c,"only");c.href=e.toUrl("navigate/table.html")+"#";return c}return null},render:function(){var c=this._container,f=d.byId(this._id);if(f)d.empty(f);else{f=document.createElement("span");f.id=this._id;c.appendChild(f)}var g;if(g=this.getNavigatorRootSegment()){d.addClass(g,"breadcrumb");f.appendChild(g);if(this._resource&&this._resource.Parents){g=document.createElement("span");d.place(document.createTextNode(" / "),g,"only");this.path+="/";
d.addClass(g,"breadcrumb");f.appendChild(g)}else{g.href="";d.removeClass(g,"breadcrumb");d.addClass(g,"currentLocation")}}if(this._resource&&this._resource.Parents){c=this._resource.Parents;for(var i=c.length;--i>=0;){g=document.createElement("a");d.addClass(g,"breadcrumb");d.place(document.createTextNode(c[i].Name),g,"only");this.path+=c[i].Name;if(this._makeHref)this._makeHref(g,c[i].ChildrenLocation);else g.href=e.toUrl("navigate/table.html")+"#"+c[i].ChildrenLocation;f.appendChild(g);g=document.createElement("span");
d.place(document.createTextNode(" / "),g,"only");this.path+="/";d.addClass(g,"breadcrumb");f.appendChild(g)}if(this._resource){g=document.createElement("a");d.place(document.createTextNode(this._resource.Name),g,"only");d.addClass(g,"breadcrumb");d.addClass(g,"currentLocation");this.path+=this._resource.Name;f.appendChild(g)}}if(f.childNodes.length===0){g=document.createElement("a");d.place(document.createTextNode(document.title),g,"only");d.addClass(g,"breadcrumb");d.addClass(g,"currentLocation");
f.appendChild(g)}}};a.prototype.constructor=a;return{BreadCrumbs:a}});
define("orion/compare/gap-model",[],function(){var e=e||{};e.GapTextModel=function(){function d(a,c,f){this._model=a;this._myIndex=(this._isOriginal=c===undefined?true:c)?1:0;this._reverseIndex=1-this._myIndex;this._map=f;this._listeners=[];a.addListener(this);this._init()}navigator.platform.indexOf("Win");d.prototype={_init:function(){this._generateGapBlocks()},_generateGapBlocks:function(){this._gapBlocks=[];for(var a=this._gapNumber=0,c=0;c<this._map.length;c++){if(this._map[c][this._myIndex]<
this._map[c][this._reverseIndex]){var f=this._map[c][this._reverseIndex]-this._map[c][this._myIndex];this._gapNumber+=f;this._gapBlocks.push([a+this._map[c][this._myIndex],f])}a+=Math.max(this._map[c][this._reverseIndex],this._map[c][this._myIndex])}},lookUpRealIndex:function(a){for(var c=0,f=0;f<this._gapBlocks.length;f++){var g=this._gapBlocks[f][0],i=this._gapBlocks[f][0]+this._gapBlocks[f][1]-1;if(a<g)break;if(a>=g&&a<=i)return{lineIndex:-1,gapsBefore:c+a-g};c+=this._gapBlocks[f][1]}return{lineIndex:a-
c,gapsBefore:c}},getLineType:function(a){for(var c=0,f=0;f<this._map.length;f++){var g=Math.max(this._map[f][this._reverseIndex],this._map[f][this._myIndex]);if(a>=c&&a<c+g){if(this._map[f][2]===0)return"unchnaged";else if(this._map[f][2]<0)return"removed";else if(this._map[f][1]===0)return"added";else if(a<this._map[f][this._myIndex]+c)return"changed";return"changed_gap"}c+=Math.max(this._map[f][this._reverseIndex],this._map[f][this._myIndex])}return"unchnaged"},addListener:function(a){this._listeners.push(a)},
removeListener:function(a){for(var c=0;c<this._listeners.length;c++)if(this._listeners[c]===a){this._listeners.splice(c,1);return}},getCharCount:function(){var a=this._model.getCharCount();a+=this._gapNumber*this.getLineDelimiter().length;return a},getLine:function(a,c){var f=this.getLineCount();if(!(0<=a&&a<f))return null;a=this.lookUpRealIndex(a);if(a.lineIndex<0){if(c)return this.getLineDelimiter();return""}else return this._model.getLine(a.lineIndex,c)},getLineAtOffset:function(a){if(!(0<=a&&
a<=this.getCharCount()))return-1;for(var c=this.getLineCount(),f=0,g=0;f<c;){var i=this.lookUpRealIndex(f);g+=i.lineIndex<0?this.getLineDelimiter().length:this._model.getLine(i.lineIndex,true).length;f++;if(g>a)break}return f-1},getLineCount:function(){return this._model.getLineCount()+this._gapNumber},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(a,c){var f=this.getLineCount();if(!(0<=a&&a<f))return-1;var g=this.lookUpRealIndex(a);f=g.gapsBefore*this.getLineDelimiter().length;
if(g.lineIndex<0){a=a-g.gapsBefore;if(a>0)f+=this._model.getLineEnd(a-1,true);if(c)f+=this.getLineDelimiter().length}else f+=this._model.getLineEnd(g.lineIndex,c);return f},getLineStart:function(a){if(!(0<=a&&a<this.getLineCount()))return-1;var c=this.lookUpRealIndex(a),f=0,g=-1;if(c.lineIndex<0){f=c.gapsBefore;if(a-f>=0)g=a-f-1}else{f=c.gapsBefore;g=c.lineIndex}a=0;a+=this.getLineDelimiter().length*f;if(g>=0)a+=c.lineIndex<0?this._model.getLineEnd(g,true):this._model.getLineStart(g);return a},getText:function(a,
c){return this._model.getText(a,c)},onChanging:function(a){for(var c=0;c<this._listeners.length;c++){var f=this._listeners[c];f&&f.onChanging&&f.onChanging(a)}},onChanged:function(a){for(var c=0;c<this._listeners.length;c++){var f=this._listeners[c];f&&f.onChanged&&f.onChanged(a)}},setLineDelimiter:function(a){this._model.setLineDelimiter(a)},setText:function(a,c,f){this._model.setText(a,c,f)}};return d}();return e});orion=orion||{};orion.textview=orion.textview||{};
orion.textview.TextModel=function(){function e(a,c){this._listeners=[];this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(a);this.setLineDelimiter(c)}var d=window.navigator.platform.indexOf("Win")!==-1;e.prototype={addListener:function(a){this._listeners.push(a)},removeListener:function(a){for(var c=0;c<this._listeners.length;c++)if(this._listeners[c]===a){this._listeners.splice(c,1);return}},getCharCount:function(){for(var a=0,c=0;c<this._text.length;c++)a+=this._text[c].length;
return a},getLine:function(a,c){var f=this.getLineCount();if(!(0<=a&&a<f))return null;var g=this._lineOffsets[a];if(a+1<f){a=this.getText(g,this._lineOffsets[a+1]);if(c)return a;c=a.length;for(var i;(i=a.charCodeAt(c-1))===10||i===13;)c--;return a.substring(0,c)}else return this.getText(g)},getLineAtOffset:function(a){var c=this.getCharCount();if(!(0<=a&&a<=c))return-1;var f=this.getLineCount();if(a===c)return f-1;var g,i,j=this._lastLineIndex;if(0<=j&&j<f){g=this._lineOffsets[j];i=j+1<f?this._lineOffsets[j+
1]:c;if(g<=a&&a<i)return j}for(var l=f,h=-1;l-h>1;){j=Math.floor((l+h)/2);g=this._lineOffsets[j];i=j+1<f?this._lineOffsets[j+1]:c;if(a<=g)l=j;else if(a<i){l=j;break}else h=j}return this._lastLineIndex=l},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(a,c){var f=this.getLineCount();if(!(0<=a&&a<f))return-1;if(a+1<f){f=this._lineOffsets[a+1];if(c)return f;a=this.getText(Math.max(this._lineOffsets[a],f-2),f);c=a.length;
for(var g;(g=a.charCodeAt(c-1))===10||g===13;)c--;return f-(a.length-c)}else return this.getCharCount()},getLineStart:function(a){if(!(0<=a&&a<this.getLineCount()))return-1;return this._lineOffsets[a]},getText:function(a,c){if(a===undefined)a=0;if(c===undefined)c=this.getCharCount();if(a===c)return"";for(var f=0,g=0,i;g<this._text.length;){i=this._text[g].length;if(a<=f+i)break;f+=i;g++}for(var j=f,l=g;g<this._text.length;){i=this._text[g].length;if(c<=f+i)break;f+=i;g++}f=f;g=g;if(l===g)return this._text[l].substring(a-
j,c-f);a=this._text[l].substring(a-j);c=this._text[g].substring(0,c-f);return a+this._text.slice(l+1,g).join("")+c},onChanging:function(a){for(var c=0;c<this._listeners.length;c++){var f=this._listeners[c];f&&f.onChanging&&f.onChanging(a)}},onChanged:function(a){for(var c=0;c<this._listeners.length;c++){var f=this._listeners[c];f&&f.onChanged&&f.onChanged(a)}},setLineDelimiter:function(a){if(a==="auto"){a=undefined;if(this.getLineCount()>1)a=this.getText(this.getLineEnd(0),this.getLineEnd(0,true))}this._lineDelimiter=
a?a:d?"\r\n":"\n"},setText:function(a,c,f){if(a===undefined)a="";if(c===undefined)c=0;if(f===undefined)f=this.getCharCount();for(var g=this.getLineAtOffset(c),i=this.getLineAtOffset(f),j=c,l=f-c,h=i-g,k=a.length,q=0,u=this.getLineCount(),r=0,t=0,v=0,A=[];;){if(r!==-1&&r<=v)r=a.indexOf("\r",v);if(t!==-1&&t<=v)t=a.indexOf("\n",v);if(t===-1&&r===-1)break;v=r!==-1&&t!==-1?r+1===t?t+1:(r<t?r:t)+1:r!==-1?r+1:t+1;A.push(c+v);q++}this.onChanging({text:a,start:j,removedCharCount:l,addedCharCount:k,removedLineCount:h,
addedLineCount:q});if(A.length===0){r=this.getLineStart(g);i=i+1<u?this.getLineStart(i+1):this.getCharCount();if(c!==r){a=this.getText(r,c)+a;c=r}if(f!==i){a+=this.getText(f,i);f=i}}i=k-l;for(r=g+h+1;r<u;r++)this._lineOffsets[r]+=i;g=[g+1,h].concat(A);Array.prototype.splice.apply(this._lineOffsets,g);for(i=A=0;i<this._text.length;){r=this._text[i].length;if(c<=A+r)break;A+=r;i++}u=A;for(g=i;i<this._text.length;){r=this._text[i].length;if(f<=A+r)break;A+=r;i++}A=A;i=i;r=this._text[i];c=this._text[g].substring(0,
c-u);f=r.substring(f-A);g=[g,i-g+1];c&&g.push(c);a&&g.push(a);f&&g.push(f);Array.prototype.splice.apply(this._text,g);if(this._text.length===0)this._text=[""];this.onChanged({start:j,removedCharCount:l,addedCharCount:k,removedLineCount:h,addedLineCount:q})}};return e}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/textview/textModel",[],function(){return orion.textview});orion=orion||{};orion.textview=orion.textview||{};
orion.textview.TextView=function(){function e(m,o,p,n){typeof m.addEventListener==="function"?m.addEventListener(o,p,n===true):m.attachEvent("on"+o,p)}function d(m,o,p,n){typeof m.removeEventListener==="function"?m.removeEventListener(o,p,n===true):m.detachEvent("on"+o,p)}function a(m){this._init(m)}var c=document.selection&&window.ActiveXObject&&/MSIE/.test(navigator.userAgent)?document.documentMode:undefined,f=parseFloat(navigator.userAgent.split("Firefox/")[1]||navigator.userAgent.split("Minefield/")[1])||
undefined,g=navigator.userAgent.indexOf("Opera")!==-1,i=navigator.userAgent.indexOf("Chrome")!==-1,j=navigator.userAgent.indexOf("Safari")!==-1,l=navigator.userAgent.indexOf("WebKit")!==-1,h=navigator.userAgent.indexOf("iPad")!==-1,k=navigator.platform.indexOf("Mac")!==-1,q=navigator.platform.indexOf("Win")!==-1,u=navigator.platform.indexOf("Linux")!==-1,r=typeof window.document.documentElement.addEventListener==="function",t=(!c||c>=9)&&typeof window.document.createRange().getBoundingClientRect===
"function",v=q?"\r\n":"\n",A=function(){function m(o,p,n){this.start=o;this.end=p;this.caret=n}m.prototype={clone:function(){return new m(this.start,this.end,this.caret)},collapse:function(){if(this.caret)this.end=this.start;else this.start=this.end},extend:function(o){if(this.caret)this.start=o;else this.end=o;if(this.start>this.end){o=this.start;this.start=this.end;this.end=o;this.caret=!this.caret}},setCaret:function(o){this.end=this.start=o;this.caret=false},getCaret:function(){return this.caret?
this.start:this.end},toString:function(){return"start="+this.start+" end="+this.end+(this.caret?" caret is at start":" caret is at end")},isEmpty:function(){return this.start===this.end},equals:function(o){return this.caret===o.caret&&this.start===o.start&&this.end===o.end}};return m}(),x=function(){function m(){this._types={}}m.prototype={addEventListener:function(o,p,n,s){var y=this._types[o];y||(y=this._types[o]={level:0,listeners:[]});y.listeners.push({context:p,func:n,data:s})},sendEvent:function(o,
p){if(o=this._types[o]){var n=o.listeners;try{o.level++;if(n)for(var s=0,y=n.length;s<y;s++){var w=n[s];w&&w.context&&w.func&&w.func.call(w.context,p,w.data)}}finally{o.level--;if(o.compact&&o.level===0){for(p=n.length-1;p>=0;p--)n[p]||n.splice(p,1);o.compact=false}}}},removeEventListener:function(o,p,n,s){if(o=this._types[o])for(var y=o.listeners,w=0,z=y.length;w<z;w++){var B=y[w];if(B&&B.context===p&&B.func===n&&B.data===s){if(o.level!==0){y[w]=null;o.compact=true}else y.splice(w,1);break}}}};return m}();
a.prototype={addEventListener:function(m,o,p,n){this._eventTable.addEventListener(m,o,p,n)},addRuler:function(m){this._rulers.push(m);m.setView(this);this._createRuler(m);this._updatePage()},computeSize:function(){var m=0,o=0,p=this._model,n=this._clientDiv,s=n.style.width;if(l)n.style.width=(524287).toString()+"px";for(var y=p.getLineCount(),w=this._frameDocument,z=0;z<y;z++){var B=this._getLineNode(z),D=null;if(!B||B.lineChanged)B=D=this._createLine(n,null,w,z,p);B=this._getLineBoundingClientRect(B);
m=Math.max(m,B.right-B.left);o+=B.bottom-B.top;D&&n.removeChild(D)}if(l)n.style.width=s;p=this._getViewPadding();m+=p.right-p.left;o+=p.bottom-p.top;return{width:m,height:o}},convert:function(m,o,p){var n=this._getScroll(),s=this._getViewPadding(),y=this._frame.getBoundingClientRect(),w=this._viewDiv.getBoundingClientRect();switch(o){case "document":if(m.x!==undefined)m.x+=-n.x+w.left+s.left;if(m.y!==undefined)m.y+=-n.y+w.top+s.top;break;case "page":if(m.x!==undefined)m.x+=-y.left;if(m.y!==undefined)m.y+=
-y.top;break}switch(p){case "document":if(m.x!==undefined)m.x+=n.x-w.left-s.left;if(m.y!==undefined)m.y+=n.y-w.top-s.top;break;case "page":if(m.x!==undefined)m.x+=y.left;if(m.y!==undefined)m.y+=y.top;break}return m},destroy:function(){for(var m=0;m<this._rulers.length;m++)this._rulers[m].setView(null);this.rulers=null;this._destroyFrame();this.onDestroy({});this._actions=this._keyBindings=this._eventTable=this._doubleClickSelection=this._selection=this._model=this._parentDocument=this._parent=null},
focus:function(){if(this._clientDiv){this._updateDOMSelection();if(h)this._textArea.focus();else{g&&this._clientDiv.blur();this._clientDiv.focus()}this._updateDOMSelection()}},getActions:function(m){for(var o=[],p=this._actions,n=0;n<p.length;n++)!m&&p[n].defaultHandler||o.push(p[n].name);return o},getBottomIndex:function(m){return this._getBottomIndex(m)},getBottomPixel:function(){return this._getScroll().y+this._getClientHeight()},getCaretOffset:function(){return this._getSelection().getCaret()},
getClientArea:function(){var m=this._getScroll();return{x:m.x,y:m.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return this._getScroll().x},getKeyBindings:function(m){for(var o=[],p=this._keyBindings,n=0;n<p.length;n++)p[n].name===m&&o.push(p[n].keyBinding);return o},getLineHeight:function(){return this._getLineHeight()},getLinePixel:function(m){m=Math.min(Math.max(0,m),this._model.getLineCount());return this._getLineHeight()*m},getLocationAtOffset:function(m){var o=
this._model;m=Math.min(Math.max(0,m),o.getCharCount());o=o.getLineAtOffset(m);var p=this._getScroll(),n=this._viewDiv.getBoundingClientRect(),s=this._getViewPadding();m=this._getOffsetToX(m)+p.x-n.left-s.left;o=this.getLinePixel(o);return{x:m,y:o}},getModel:function(){return this._model},getOffsetAtLocation:function(m,o){var p=this._getScroll(),n=this._viewDiv.getBoundingClientRect(),s=this._getViewPadding();o=this._getYToLine(o-p.y);m+=-p.x+n.left+s.left;return this._getXToOffset(o,m)},getRulers:function(){return this._rulers.slice(0)},
getSelection:function(){var m=this._getSelection();return{start:m.start,end:m.end}},getText:function(m,o){return this._model.getText(m,o)},getTopIndex:function(m){return this._getTopIndex(m)},getTopPixel:function(){return this._getScroll().y},invokeAction:function(m,o){for(var p=this._actions,n=0;n<p.length;n++){var s=p[n];if(s.name&&s.name===m){if(!o&&s.userHandler)if(s.userHandler())return;if(s.defaultHandler)return s.defaultHandler();return false}}return false},onContextMenu:function(m){this._eventTable.sendEvent("ContextMenu",
m)},onDestroy:function(m){this._eventTable.sendEvent("Destroy",m)},onLineStyle:function(m){this._eventTable.sendEvent("LineStyle",m)},onModelChanged:function(m){this._eventTable.sendEvent("ModelChanged",m)},onModelChanging:function(m){this._eventTable.sendEvent("ModelChanging",m)},onModify:function(m){this._eventTable.sendEvent("Modify",m)},onSelection:function(m){this._eventTable.sendEvent("Selection",m)},onScroll:function(m){this._eventTable.sendEvent("Scroll",m)},onVerify:function(m){this._eventTable.sendEvent("Verify",
m)},redrawLines:function(m,o,p){if(!(this._redrawCount>0)){if(m===undefined)m=0;if(o===undefined)o=this._model.getLineCount();if(m!==o){var n=this._clientDiv;if(n){if(p)for(var s=(p.getLocation()==="left"?this._leftDiv:this._rightDiv).firstChild.rows[0].cells,y=0;y<s.length;y++)if(s[y].firstChild._ruler===p){n=s[y].firstChild;break}if(p)n.rulerChanged=true;if(!p||p.getOverview()==="page")for(n=n.firstChild;n;){s=n.lineIndex;if(m<=s&&s<o)n.lineChanged=true;n=n.nextSibling}if(!p)if(m<=this._maxLineIndex&&
this._maxLineIndex<o){this._checkMaxLineIndex=this._maxLineIndex;this._maxLineIndex=-1;this._maxLineWidth=0}this._queueUpdatePage()}}}},redrawRange:function(m,o){var p=this._model;if(m===undefined)m=0;if(o===undefined)o=p.getCharCount();if(m!==o){m=p.getLineAtOffset(m);o=p.getLineAtOffset(Math.max(0,o-1))+1;this.redrawLines(m,o)}},removeEventListener:function(m,o,p,n){this._eventTable.removeEventListener(m,o,p,n)},removeRuler:function(m){for(var o=this._rulers,p=0;p<o.length;p++)if(o[p]===m){o.splice(p,
1);m.setView(null);this._destroyRuler(m);this._updatePage();break}},setAction:function(m,o){if(m){for(var p=this._actions,n=0;n<p.length;n++){var s=p[n];if(s.name===m){s.userHandler=o;return}}p.push({name:m,userHandler:o})}},setKeyBinding:function(m,o){for(var p=this._keyBindings,n=0;n<p.length;n++){var s=p[n];if(s.keyBinding.equals(m)){if(o)s.name=o;else if(s.predefined)s.name=null;else{m=s.name;p.splice(n,1);for(n=0;n<p.length&&m!==p[n].name;)n++;if(n===p.length){p=this._actions;for(n=0;n<p.length;n++)if(p[n].name===
m)p[n].defaultHandler||p.splice(n,1)}}return}}o&&p.push({keyBinding:m,name:o})},setCaretOffset:function(m,o){var p=this._model.getCharCount();m=Math.max(0,Math.min(m,p));this._setSelection(new A(m,m,false),o===undefined||o)},setHorizontalPixel:function(m){m=Math.max(0,m);this._scrollView(m-this._getScroll().x,0)},setRedraw:function(m){if(m){if(--this._redrawCount===0){m=this._model.getLineCount();for(var o=this.getRulers(),p=0;p<o.length;p++)this.redrawLines(0,m,o[p]);this.redrawLines(0,m);this._queueUpdatePage()}}else this._redrawCount++},
setModel:function(m){if(m)if(m!==this._model){this._model.removeListener(this._modelListener);var o=this._model.getLineCount(),p=this._model.getCharCount(),n=m.getLineCount(),s=m.getCharCount(),y={text:m.getText(),start:0,removedCharCount:p,addedCharCount:s,removedLineCount:o,addedLineCount:n};this.onModelChanging(y);this._model=m;y={start:0,removedCharCount:p,addedCharCount:s,removedLineCount:o,addedLineCount:n};this.onModelChanged(y);this._model.addListener(this._modelListener);this._reset();this._updatePage()}},
setSelection:function(m,o,p){var n=m>o;if(n){var s=m;m=o;o=s}s=this._model.getCharCount();m=Math.max(0,Math.min(m,s));o=Math.max(0,Math.min(o,s));this._setSelection(new A(m,o,n),p===undefined||p)},setText:function(m,o,p){var n=o===undefined&&p===undefined;if(o===undefined)o=0;if(p===undefined)p=this._model.getCharCount();this._modifyContent({text:m,start:o,end:p,_code:true},!n);if(n){this._columnX=-1;this._setSelection(new A(0,0,false),true);if(f)if(m=this._clientDiv){(o=this._hasFocus)&&m.blur();
m.contentEditable=false;m.contentEditable=true;o&&m.focus()}}},setTopIndex:function(m){var o=this._model;if(o.getCharCount()!==0){o=o.getLineCount();var p=this._getLineHeight(),n=Math.max(1,Math.min(o,Math.floor(this._getClientHeight()/p)));if(m<0)m=0;else if(m>o-n)m=o-n;this._scrollView(0,m*p-this._getScroll().y)}},setTopPixel:function(m){var o=this._getLineHeight(),p=this._getClientHeight(),n=this._model.getLineCount();m=Math.min(Math.max(0,m),o*n-p);this._scrollView(0,m-this._getScroll().y)},showSelection:function(){return this._showCaret(true)},
_handleBodyMouseDown:function(m){if(!m)m=window.event;for(var o=g?this._clientDiv:this._overlayDiv||this._viewDiv,p=m.target?m.target:m.srcElement;p;){if(o===p)return;p=p.parentNode}m.preventDefault&&m.preventDefault();m.stopPropagation&&m.stopPropagation();if(!r){o.setCapture();setTimeout(function(){o.releaseCapture()},0)}},_handleBlur:function(){this._hasFocus=false;if(c<9)if(!this._getSelection().isEmpty()){var m=this._frameDocument,o=m.createElement("DIV");m=m.body;m.appendChild(o);m.removeChild(o)}if(f||
c)if(this._selDiv1){o=c?"transparent":"#AFAFAF";this._selDiv1.style.background=o;this._selDiv2.style.background=o;this._selDiv3.style.background=o}},_handleContextMenu:function(m){if(!m)m=window.event;var o=this._getScroll(),p=this._viewDiv.getBoundingClientRect(),n=this._getViewPadding();this.onContextMenu({x:m.clientX+o.x-p.left-n.left,y:m.clientY+o.y-p.top-n.top,screenX:m.screenX,screenY:m.screenY});m.preventDefault&&m.preventDefault();return false},_handleCopy:function(m){if(!this._ignoreCopy){if(!m)m=
window.event;if(this._doCopy(m)){m.preventDefault&&m.preventDefault();return false}}},_handleCut:function(m){if(!m)m=window.event;if(this._doCut(m)){m.preventDefault&&m.preventDefault();return false}},_handleDOMAttrModified:function(m){if(!m)m=window.event;for(var o=false,p=this._parent;p;){if(p===m.target){o=true;break}p=p.parentNode}if(o){m=this._getVisible();if(m==="visible")this._createView();else m==="hidden"&&this._destroyView()}},_handleDataModified:function(){this._startIME()},_handleDblclick:function(m){if(!m)m=
window.event;this._lastMouseTime=m.timeStamp?m.timeStamp:(new Date).getTime();if(this._clickCount!==2){this._clickCount=2;this._handleMouse(m)}},_handleDragStart:function(m){if(!m)m=window.event;m.preventDefault&&m.preventDefault();return false},_handleDragOver:function(m){if(!m)m=window.event;m.dataTransfer.dropEffect="none";m.preventDefault&&m.preventDefault();return false},_handleDrop:function(m){if(!m)m=window.event;m.preventDefault&&m.preventDefault();return false},_handleDocFocus:function(){this._clientDiv.focus()},
_handleFocus:function(){this._hasFocus=true;c&&this._updateDOMSelection();if(f||c)if(this._selDiv1){var m=this._hightlightRGB;this._selDiv1.style.background=m;this._selDiv2.style.background=m;this._selDiv3.style.background=m}},_handleKeyDown:function(m){if(!m)m=window.event;if(h){if(m.keyCode===8){this._doBackspace({});m.preventDefault()}}else{switch(m.keyCode){case 16:case 17:case 18:case 91:break;default:this._setLinksVisible(false)}if(m.keyCode===229){if(this.readonly){m.preventDefault&&m.preventDefault();
return false}this._startIME()}else this._commitIME();if((k||u)&&f<4||g){this._keyDownEvent=m;return true}if(this._doAction(m)){if(m.preventDefault)m.preventDefault();else{m.cancelBubble=true;m.returnValue=false;m.keyCode=0}return false}}},_handleKeyPress:function(m){if(!m)m=window.event;if(k&&l)if(63232<=m.keyCode&&m.keyCode<=63487||m.keyCode===13||m.keyCode===8){m.preventDefault&&m.preventDefault();return false}if((k||u)&&f<4||g)if(this._doAction(this._keyDownEvent)){m.preventDefault&&m.preventDefault();
return false}var o=k?m.metaKey:m.ctrlKey;if(m.charCode!==undefined)if(o)switch(m.charCode){case 99:case 118:case 120:return true}o=false;if(k){if(m.ctrlKey||m.metaKey)o=true}else if(f){if(m.ctrlKey||m.altKey)o=true}else if(m.ctrlKey^m.altKey)o=true;if(!o){o=g?m.which:m.charCode!==undefined?m.charCode:m.keyCode;if(o>31){this._doContent(String.fromCharCode(o));m.preventDefault&&m.preventDefault();return false}}},_handleKeyUp:function(m){if(!m)m=window.event;(k?m.metaKey:m.ctrlKey)||this._setLinksVisible(false);
m.keyCode===13&&this._commitIME()},_handleLinkClick:function(m){if(!m)m=window.event;if(!(k?m.metaKey:m.ctrlKey)){m.preventDefault&&m.preventDefault();return false}},_handleLoad:function(m){var o=this._getVisible();if(o==="visible"||o==="hidden"&&l)this._createView(!m)},_handleMouse:function(m){var o=this._frameWindow;if(c)o=this._clientDiv;if(this._overlayDiv){var p=this;setTimeout(function(){p.focus()},0)}if(this._clickCount===1){this._setGrab(o);this._setSelectionTo(m.clientX,m.clientY,m.shiftKey)}else{r&&
this._setGrab(o);this._doubleClickSelection=null;this._setSelectionTo(m.clientX,m.clientY,m.shiftKey);this._doubleClickSelection=this._getSelection()}},_handleMouseDown:function(m){if(!m)m=window.event;if(this._linksVisible)if((m.target||m.srcElement).tagName!=="A")this._setLinksVisible(false);else return;var o=m.which?m.button===0:m.button===1;this._commitIME();if(o){this._isMouseDown=true;o=Math.abs(this._lastMouseX-m.clientX);var p=Math.abs(this._lastMouseY-m.clientY),n=m.timeStamp?m.timeStamp:
(new Date).getTime();if(n-this._lastMouseTime<=this._clickTime&&o<=this._clickDist&&p<=this._clickDist)this._clickCount++;else this._clickCount=1;this._lastMouseX=m.clientX;this._lastMouseY=m.clientY;this._lastMouseTime=n;this._handleMouse(m);if(g||i){this._hasFocus||this.focus();m.preventDefault()}}},_handleMouseMove:function(m){if(!m)m=window.event;this._setLinksVisible(!this._isMouseDown&&(k?m.metaKey:m.ctrlKey));if(this._isMouseDown){if(!r){if(m.button===0){this._setGrab(null);return true}if(!this._isMouseDown&&
m.button===1&&(this._clickCount&1)!==0){this._clickCount=2;return this._handleMouse(m,this._clickCount)}}var o=m.clientX,p=m.clientY;if(i)if(m.currentTarget!==this._frameWindow){m=this._frame.getBoundingClientRect();o-=m.left;p-=m.top}var n=this._getViewPadding(),s=this._viewDiv.getBoundingClientRect(),y=this._getClientWidth(),w=this._getClientHeight();m=s.left+n.left;var z=s.top+n.top;y=s.left+n.left+y;n=s.top+n.top+w;s=this._model;w=s.getLineAtOffset(this._getSelection().getCaret());if(p<z&&w!==
0)this._doAutoScroll("up",o,p-z);else if(p>n&&w!==s.getLineCount()-1)this._doAutoScroll("down",o,p-n);else if(o<m)this._doAutoScroll("left",o-m,p);else if(o>y)this._doAutoScroll("right",o-y,p);else{this._endAutoScroll();this._setSelectionTo(o,p,true);c&&this._frameDocument.body.getBoundingClientRect()}}},_handleMouseUp:function(m){if(!m)m=window.event;if(!this._linksVisible)if(m.which?m.button===0:m.button===1){this._isMouseDown=false;this._endAutoScroll();r&&this._setGrab(null)}},_handleMouseWheel:function(m){if(!m)m=
window.event;var o=this._getLineHeight(),p=0,n=0;if(f){o=k?m.detail*3:Math.max(-256,Math.min(256,m.detail))*o;if(m.axis===m.HORIZONTAL_AXIS)p=o;else n=o}else if(k){n=p=40;if(m.wheelDeltaX%120!==0)p=1;if(m.wheelDeltaY%120!==0)n=1;p=-m.wheelDeltaX/p;if(-1<p&&p<0)p=-1;if(0<p&&p<1)p=1;n=-m.wheelDeltaY/n;if(-1<n&&n<0)n=-1;if(0<n&&n<1)n=1}else{p=-m.wheelDeltaX;n=-m.wheelDeltaY/120*8*o}if(j){for(o=m.target;o&&o.lineIndex===undefined;)o=o.parentNode;this._mouseWheelLine=o}o=this._getScroll();this._scrollView(p,
n);p=this._getScroll();if(j)this._mouseWheelLine=null;if(o.x!==p.x||o.y!==p.y){m.preventDefault&&m.preventDefault();return false}},_handlePaste:function(m){if(!this._ignorePaste){if(!m)m=window.event;if(this._doPaste(m)){if(c){var o=this;setTimeout(function(){o._updateDOMSelection()},0)}m.preventDefault&&m.preventDefault();return false}}},_handleResize:function(){var m=this._frameDocument.documentElement,o=m.clientWidth;m=m.clientHeight;if(this._frameWidth!==o||this._frameHeight!==m){this._frameWidth=
o;this._frameHeight=m;this._updatePage()}},_handleRulerEvent:function(m){if(!m)m=window.event;var o=m.target?m.target:m.srcElement,p=o.lineIndex;for(o=o;o&&!o._ruler;){if(p===undefined&&o.lineIndex!==undefined)p=o.lineIndex;o=o.parentNode}o=o?o._ruler:null;if(p===undefined&&o&&o.getOverview()==="document"){p=h?0:17;var n=this._getClientHeight(),s=this._model.getLineCount(),y=this._getViewPadding();p=Math.floor((m.clientY-p)*s/(n+y.top+y.bottom-2*p));0<=p&&p<s||(p=undefined)}if(o)switch(m.type){case "click":o.onClick&&
o.onClick(p,m);break;case "dblclick":o.onDblClick&&o.onDblClick(p,m);break;case "mousemove":o.onMouseMove&&o.onMouseMove(p,m);break;case "mouseover":o.onMouseOver&&o.onMouseOver(p,m);break;case "mouseout":o.onMouseOut&&o.onMouseOut(p,m);break}},_handleScroll:function(){var m=this._getScroll(),o=this._hScroll,p=this._vScroll;if(o!==m.x||p!==m.y){this._hScroll=m.x;this._vScroll=m.y;this._commitIME();this._updatePage();this.onScroll({oldValue:{x:o,y:p},newValue:m})}},_handleSelectStart:function(m){if(!m)m=
window.event;if(this._ignoreSelect){m&&m.preventDefault&&m.preventDefault();return false}},_handleUnload:function(){this._destroyView()},_handleInput:function(m){var o=this._textArea;this._doContent(o.value);o.selectionStart=o.selectionEnd=0;o.value="";m.preventDefault()},_handleTextInput:function(m){this._doContent(m.data);m.preventDefault()},_touchConvert:function(m){var o=this._frame.getBoundingClientRect(),p=this._parentDocument.body;return{left:m.clientX-o.left-p.scrollLeft,top:m.clientY-o.top-
p.scrollTop}},_handleTextAreaClick:function(m){m=this._touchConvert(m);this._clickCount=1;this._ignoreDOMSelection=false;this._setSelectionTo(m.left,m.top,false);this._textArea.focus()},_handleTouchStart:function(m){var o=m.touches,p,n;this._touchMoved=false;this._touchStartScroll=undefined;if(o.length===1){p=o[0];n=p.pageY;this._touchStartX=p.pageX;this._touchStartY=n;this._touchStartTime=m.timeStamp;this._touchStartScroll=this._getScroll();m=this._getSelection();n=this._touchConvert(o[0]);this._touchGesture=
"none";if(!m.isEmpty())if(this._hitOffset(m.end,n.left,n.top))this._touchGesture="extendEnd";else if(this._hitOffset(m.start,n.left,n.top))this._touchGesture="extendStart";if(this._touchGesture==="none"){o=this._textArea;o.value="";o.style.left="-1000px";o.style.top="-1000px";o.style.width="3000px";o.style.height="3000px"}}else if(o.length===2){this._touchGesture="select";if(this._touchTimeout){clearTimeout(this._touchTimeout);this._touchTimeout=null}n=this._touchConvert(o[0]);p=this._getXToOffset(this._getYToLine(n.top),
n.left);n=this._touchConvert(o[1]);o=this._getXToOffset(this._getYToLine(n.top),n.left);m=this._getSelection();m.setCaret(p);m.extend(o);this._setSelection(m,true,true)}},_handleTouchMove:function(m){this._touchMoved=true;var o=m.touches,p;if(o.length===1){o=o[0];var n=o.pageX,s=o.pageY,y=this._touchStartX-n,w=this._touchStartY-s;p=this._touchConvert(o);o=this._getSelection();if(this._touchGesture==="none")this._touchGesture=m.timeStamp-this._touchStartTime<200&&(Math.abs(y)>5||Math.abs(w)>5)?"scroll":
"caret";if(this._touchGesture==="select")this._touchGesture=this._hitOffset(o.end,p.left,p.top)?"extendEnd":this._hitOffset(o.start,p.left,p.top)?"extendStart":"caret";switch(this._touchGesture){case "scroll":this._touchStartX=n;this._touchStartY=s;this._scrollView(y,w);break;case "extendStart":case "extendEnd":this._clickCount=1;p=this._getXToOffset(this._getYToLine(p.top),p.left);o.setCaret(this._touchGesture==="extendStart"?o.end:o.start);o.extend(p);if(p>=o.end&&this._touchGesture==="extendStart")this._touchGesture=
"extendEnd";if(p<=o.start&&this._touchGesture==="extendEnd")this._touchGesture="extendStart";this._setSelection(o,true,true);break;case "caret":this._setSelectionTo(p.left,p.top,false);break}}else if(o.length===2){p=this._touchConvert(o[0]);n=this._getXToOffset(this._getYToLine(p.top),p.left);p=this._touchConvert(o[1]);p=this._getXToOffset(this._getYToLine(p.top),p.left);o=this._getSelection();o.setCaret(n);o.extend(p);this._setSelection(o,true,true)}m.preventDefault()},_handleTouchEnd:function(m){var o=
this;if(!this._touchMoved)if(m.touches.length===0&&m.changedTouches.length===1){var p=this._touchConvert(m.changedTouches[0]),n=this._textArea;n.value="";n.style.left="-1000px";n.style.top="-1000px";n.style.width="3000px";n.style.height="3000px";setTimeout(function(){o._clickCount=1;o._ignoreDOMSelection=false;o._setSelectionTo(p.left,p.top,false)},300)}m.touches.length===0&&setTimeout(function(){var s=o._getSelection(),y=o._model.getText(s.start,s.end),w=o._textArea;w.value=y;w.selectionStart=0;
w.selectionEnd=y.length;if(!s.isEmpty()){y=o._touchDiv.getBoundingClientRect();s=o._getOffsetBounds(s.start);w.style.left=y.width/2+"px";w.style.top=(s.top>40?s.top-30:s.top+30)+"px"}},0)},_doAction:function(m){for(var o=this._keyBindings,p=0;p<o.length;p++){var n=o[p];if(n.keyBinding.match(m)){if(n.name){m=this._actions;for(o=0;o<m.length;o++){p=m[o];if(p.name===n.name){if(p.userHandler){if(!p.userHandler())if(p.defaultHandler)p.defaultHandler();else return false}else p.defaultHandler&&p.defaultHandler();
break}}}return true}}return false},_doBackspace:function(m){var o=this._getSelection();if(o.isEmpty()){var p=this._model,n=o.getCaret(),s=p.getLineAtOffset(n);if(n===p.getLineStart(s))s>0&&o.extend(p.getLineEnd(s-1));else o.extend(this._getOffset(n,m.unit,-1))}this._modifyContent({text:"",start:o.start,end:o.end},true);return true},_doContent:function(m){var o=this._getSelection();this._modifyContent({text:m,start:o.start,end:o.end,_ignoreDOMSelection:true},true)},_doCopy:function(m){var o=this._getSelection();
if(!o.isEmpty())return this._setClipboardText(this._getBaseText(o.start,o.end),m);return true},_doCursorNext:function(m){if(!m.select)if(this._clearSelection("next"))return true;var o=this._model,p=this._getSelection(),n=p.getCaret(),s=o.getLineAtOffset(n);if(n===o.getLineEnd(s))s+1<o.getLineCount()&&p.extend(o.getLineStart(s+1));else p.extend(this._getOffset(n,m.unit,1));m.select||p.collapse();this._setSelection(p,true);return true},_doCursorPrevious:function(m){if(!m.select)if(this._clearSelection("previous"))return true;
var o=this._model,p=this._getSelection(),n=p.getCaret(),s=o.getLineAtOffset(n);if(n===o.getLineStart(s))s>0&&p.extend(o.getLineEnd(s-1));else p.extend(this._getOffset(n,m.unit,-1));m.select||p.collapse();this._setSelection(p,true);return true},_doCut:function(m){var o=this._getSelection();if(!o.isEmpty()){o=this._getBaseText(o.start,o.end);this._doContent("");return this._setClipboardText(o,m)}return true},_doDelete:function(m){var o=this._getSelection();if(o.isEmpty()){var p=this._model,n=o.getCaret(),
s=p.getLineAtOffset(n);if(n===p.getLineEnd(s))s+1<p.getLineCount()&&o.extend(p.getLineStart(s+1));else o.extend(this._getOffset(n,m.unit,1))}this._modifyContent({text:"",start:o.start,end:o.end},true);return true},_doEnd:function(m){var o=this._getSelection(),p=this._model;if(m.ctrl)o.extend(p.getCharCount());else{var n=p.getLineAtOffset(o.getCaret());o.extend(p.getLineEnd(n))}m.select||o.collapse();this._setSelection(o,true);return true},_doEnter:function(m){var o=this._model,p=this._getSelection();
this._doContent(o.getLineDelimiter());if(m&&m.noCursor){p.end=p.start;this._setSelection(p)}return true},_doHome:function(m){var o=this._getSelection(),p=this._model;if(m.ctrl)o.extend(0);else{var n=p.getLineAtOffset(o.getCaret());o.extend(p.getLineStart(n))}m.select||o.collapse();this._setSelection(o,true);return true},_doLineDown:function(m){var o=this._model,p=this._getSelection(),n=p.getCaret(),s=o.getLineAtOffset(n);if(s+1<o.getLineCount()){var y=this._getScroll().x,w=this._columnX;if(w===-1||
m.select)w=this._getOffsetToX(m.wholeLine?o.getLineEnd(s+1):n)+y;p.extend(this._getXToOffset(s+1,w-y));m.select||p.collapse();this._setSelection(p,true,true);this._columnX=w}return true},_doLineUp:function(m){var o=this._model,p=this._getSelection(),n=p.getCaret(),s=o.getLineAtOffset(n);if(s>0){var y=this._getScroll().x,w=this._columnX;if(w===-1||m.select)w=this._getOffsetToX(m.wholeLine?o.getLineStart(s-1):n)+y;p.extend(this._getXToOffset(s-1,w-y));m.select||p.collapse();this._setSelection(p,true,
true);this._columnX=w}return true},_doPageDown:function(m){var o=this._model,p=this._getSelection(),n=p.getCaret(),s=o.getLineAtOffset(n),y=o.getLineCount();if(s<y-1){o=this._getScroll();var w=this._getClientHeight(),z=this._getLineHeight(),B=Math.floor(w/z),D=Math.min(y-s-1,B);D=Math.max(1,D);B=this._columnX;if(B===-1||m.select)B=this._getOffsetToX(n)+o.x;p.extend(this._getXToOffset(s+D,B-o.x));m.select||p.collapse();m=y*z;n=o.y+D*z;if(n+w>m)n=m-w;this._setSelection(p,true,true,n-o.y);this._columnX=
B}return true},_doPageUp:function(m){var o=this._model,p=this._getSelection(),n=p.getCaret(),s=o.getLineAtOffset(n);if(s>0){o=this._getScroll();var y=this._getClientHeight(),w=this._getLineHeight();y=Math.floor(y/w);var z=Math.max(1,Math.min(s,y));y=this._columnX;if(y===-1||m.select)y=this._getOffsetToX(n)+o.x;p.extend(this._getXToOffset(s-z,y-o.x));m.select||p.collapse();m=Math.max(0,o.y-z*w);this._setSelection(p,true,true,m-o.y);this._columnX=y}return true},_doPaste:function(m){(m=this._getClipboardText(m))&&
this._doContent(m);return m!==null},_doScroll:function(m){var o=m.type,p=this._model,n=p.getLineCount();m=this._getClientHeight();var s=this._getLineHeight();n=n*s;var y=this._getScroll().y,w;switch(o){case "textStart":w=0;break;case "textEnd":w=n-m;break;case "pageDown":w=y+m;break;case "pageUp":w=y-m;break;case "centerLine":o=this._getSelection();w=p.getLineAtOffset(o.start);p=(p.getLineAtOffset(o.end)-w+1)*s;w=w*s-m/2+p/2;break}if(w!==undefined){w=Math.min(Math.max(0,w),n-m);this._scrollView(0,
w-y)}},_doSelectAll:function(){var m=this._model,o=this._getSelection();o.setCaret(0);o.extend(m.getCharCount());this._setSelection(o,false);return true},_doTab:function(){this._doContent("\t");return true},_applyStyle:function(m,o){if(m){if(m.styleClass)o.className=m.styleClass;var p=m.style;if(p)for(var n in p)if(p.hasOwnProperty(n))o.style[n]=p[n];if(m=m.attributes)for(var s in m)m.hasOwnProperty(s)&&o.setAttribute(s,m[s])}},_autoScroll:function(){var m=this._getSelection(),o,p=this._autoScrollX;
if(this._autoScrollDir==="up"||this._autoScrollDir==="down"){var n=this._autoScrollY/this._getLineHeight();n=n<0?Math.floor(n):Math.ceil(n);o=this._model.getLineAtOffset(m.getCaret());o=Math.max(0,Math.min(this._model.getLineCount()-1,o+n))}else if(this._autoScrollDir==="left"||this._autoScrollDir==="right"){o=this._getYToLine(this._autoScrollY);p+=this._getOffsetToX(m.getCaret())}m.extend(this._getXToOffset(o,p));this._setSelection(m,true)},_autoScrollTimer:function(){this._autoScroll();var m=this;
this._autoScrollTimerID=setTimeout(function(){m._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeight:function(){var m=this._clientDiv,o=this._frameDocument,p=o.createElement("DIV");p.style.position="fixed";p.style.left="-1000px";var n=o.createElement("SPAN");n.appendChild(o.createTextNode(" "));p.appendChild(n);var s=o.createElement("SPAN");s.style.fontStyle="italic";s.appendChild(o.createTextNode(" "));p.appendChild(s);var y=o.createElement("SPAN");y.style.fontWeight="bold";y.appendChild(o.createTextNode(" "));
p.appendChild(y);var w=o.createElement("SPAN");w.style.fontWeight="bold";w.style.fontStyle="italic";w.appendChild(o.createTextNode(" "));p.appendChild(w);m.appendChild(p);o=n.getBoundingClientRect();s=s.getBoundingClientRect();n=y.getBoundingClientRect();var z=w.getBoundingClientRect();w=o.bottom-o.top;y=s.bottom-s.top;o=n.bottom-n.top;s=z.bottom-z.top;n=0;z=w;if(y>w){z=y;n=1}if(o>y){z=o;n=2}if(s>o){z=s;n=3}this._largestFontStyle=n;m.removeChild(p);return z},_calculatePadding:function(){var m=this._frameDocument,
o=this._clientDiv,p=this._getPadding(this._viewDiv),n=m.createElement("DIV");n.style.position="fixed";n.style.left="-1000px";n.style.paddingLeft=p.left+"px";n.style.paddingTop=p.top+"px";n.style.paddingRight=p.right+"px";n.style.paddingBottom=p.bottom+"px";n.style.width="100px";n.style.height="100px";p=m.createElement("DIV");p.style.width="100%";p.style.height="100%";n.appendChild(p);o.appendChild(n);m=n.getBoundingClientRect();p=p.getBoundingClientRect();o.removeChild(n);return p={left:p.left-m.left,
top:p.top-m.top,right:m.right-p.right,bottom:m.bottom-p.bottom}},_clearSelection:function(m){var o=this._getSelection();if(o.isEmpty())return false;if(m==="next")o.start=o.end;else o.end=o.start;this._setSelection(o,true);return true},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();var m=this._model,o=m.getLineAtOffset(this._imeOffset),p=m.getLineStart(o),n=this._getDOMText(o);m=m.getLine(o);p=this._imeOffset-p;m=p+n.length-m.length;p!==m&&this._doContent(n.substring(p,
m));this._imeOffset=-1}},_convertDelimiter:function(m,o,p){for(var n=0,s=0,y=0,w=m.length;y<w;){if(n!==-1&&n<=y)n=m.indexOf("\r",y);if(s!==-1&&s<=y)s=m.indexOf("\n",y);var z=y,B;if(s===-1&&n===-1){o(m.substring(y));break}if(n!==-1&&s!==-1)if(n+1===s){B=n;y=s+1}else{B=n<s?n:s;y=(n<s?n:s)+1}else if(n!==-1){B=n;y=n+1}else{B=s;y=s+1}o(m.substring(z,B));p()}},_createActions:function(){var m=orion.textview.KeyBinding,o=this._keyBindings=[];o.push({name:"lineUp",keyBinding:new m(38),predefined:true});o.push({name:"lineDown",
keyBinding:new m(40),predefined:true});o.push({name:"charPrevious",keyBinding:new m(37),predefined:true});o.push({name:"charNext",keyBinding:new m(39),predefined:true});if(k){o.push({name:"scrollPageUp",keyBinding:new m(33),predefined:true});o.push({name:"scrollPageDown",keyBinding:new m(34),predefined:true});o.push({name:"pageUp",keyBinding:new m(33,null,null,true),predefined:true});o.push({name:"pageDown",keyBinding:new m(34,null,null,true),predefined:true});o.push({name:"lineStart",keyBinding:new m(37,
true),predefined:true});o.push({name:"lineEnd",keyBinding:new m(39,true),predefined:true});o.push({name:"wordPrevious",keyBinding:new m(37,null,null,true),predefined:true});o.push({name:"wordNext",keyBinding:new m(39,null,null,true),predefined:true});o.push({name:"scrollTextStart",keyBinding:new m(36),predefined:true});o.push({name:"scrollTextEnd",keyBinding:new m(35),predefined:true});o.push({name:"textStart",keyBinding:new m(38,true),predefined:true});o.push({name:"textEnd",keyBinding:new m(40,
true),predefined:true})}else{o.push({name:"pageUp",keyBinding:new m(33),predefined:true});o.push({name:"pageDown",keyBinding:new m(34),predefined:true});o.push({name:"lineStart",keyBinding:new m(36),predefined:true});o.push({name:"lineEnd",keyBinding:new m(35),predefined:true});o.push({name:"wordPrevious",keyBinding:new m(37,true),predefined:true});o.push({name:"wordNext",keyBinding:new m(39,true),predefined:true});o.push({name:"textStart",keyBinding:new m(36,true),predefined:true});o.push({name:"textEnd",
keyBinding:new m(35,true),predefined:true})}o.push({name:"selectLineUp",keyBinding:new m(38,null,true),predefined:true});o.push({name:"selectLineDown",keyBinding:new m(40,null,true),predefined:true});o.push({name:"selectCharPrevious",keyBinding:new m(37,null,true),predefined:true});o.push({name:"selectCharNext",keyBinding:new m(39,null,true),predefined:true});o.push({name:"selectPageUp",keyBinding:new m(33,null,true),predefined:true});o.push({name:"selectPageDown",keyBinding:new m(34,null,true),predefined:true});
if(k){o.push({name:"selectLineStart",keyBinding:new m(37,true,true),predefined:true});o.push({name:"selectLineEnd",keyBinding:new m(39,true,true),predefined:true});o.push({name:"selectWordPrevious",keyBinding:new m(37,null,true,true),predefined:true});o.push({name:"selectWordNext",keyBinding:new m(39,null,true,true),predefined:true});o.push({name:"selectTextStart",keyBinding:new m(36,null,true),predefined:true});o.push({name:"selectTextEnd",keyBinding:new m(35,null,true),predefined:true});o.push({name:"selectTextStart",
keyBinding:new m(38,true,true),predefined:true});o.push({name:"selectTextEnd",keyBinding:new m(40,true,true),predefined:true})}else{if(u){o.push({name:"selectWholeLineUp",keyBinding:new m(38,true,true),predefined:true});o.push({name:"selectWholeLineDown",keyBinding:new m(40,true,true),predefined:true})}o.push({name:"selectLineStart",keyBinding:new m(36,null,true),predefined:true});o.push({name:"selectLineEnd",keyBinding:new m(35,null,true),predefined:true});o.push({name:"selectWordPrevious",keyBinding:new m(37,
true,true),predefined:true});o.push({name:"selectWordNext",keyBinding:new m(39,true,true),predefined:true});o.push({name:"selectTextStart",keyBinding:new m(36,true,true),predefined:true});o.push({name:"selectTextEnd",keyBinding:new m(35,true,true),predefined:true})}o.push({name:"deletePrevious",keyBinding:new m(8),predefined:true});o.push({name:"deletePrevious",keyBinding:new m(8,null,true),predefined:true});o.push({name:"deleteNext",keyBinding:new m(46),predefined:true});o.push({name:"deleteWordPrevious",
keyBinding:new m(8,true),predefined:true});o.push({name:"deleteWordPrevious",keyBinding:new m(8,true,true),predefined:true});o.push({name:"deleteWordNext",keyBinding:new m(46,true),predefined:true});o.push({name:"tab",keyBinding:new m(9),predefined:true});o.push({name:"enter",keyBinding:new m(13),predefined:true});o.push({name:"enter",keyBinding:new m(13,null,true),predefined:true});o.push({name:"selectAll",keyBinding:new m("a",true),predefined:true});if(k){o.push({name:"deleteNext",keyBinding:new m(46,
null,true),predefined:true});o.push({name:"deleteWordPrevious",keyBinding:new m(8,null,null,true),predefined:true});o.push({name:"deleteWordNext",keyBinding:new m(46,null,null,true),predefined:true})}if(!f){var p=k&&i;o.push({name:null,keyBinding:new m("u",!p,false,false,p),predefined:true});o.push({name:null,keyBinding:new m("i",!p,false,false,p),predefined:true});o.push({name:null,keyBinding:new m("b",!p,false,false,p),predefined:true})}if(f){o.push({name:"copy",keyBinding:new m(45,true),predefined:true});
o.push({name:"paste",keyBinding:new m(45,null,true),predefined:true});o.push({name:"cut",keyBinding:new m(46,null,true),predefined:true})}if(k){o.push({name:"lineStart",keyBinding:new m("a",false,false,false,true),predefined:true});o.push({name:"lineEnd",keyBinding:new m("e",false,false,false,true),predefined:true});o.push({name:"lineUp",keyBinding:new m("p",false,false,false,true),predefined:true});o.push({name:"lineDown",keyBinding:new m("n",false,false,false,true),predefined:true});o.push({name:"charPrevious",
keyBinding:new m("b",false,false,false,true),predefined:true});o.push({name:"charNext",keyBinding:new m("f",false,false,false,true),predefined:true});o.push({name:"deletePrevious",keyBinding:new m("h",false,false,false,true),predefined:true});o.push({name:"deleteNext",keyBinding:new m("d",false,false,false,true),predefined:true});o.push({name:"deleteLineEnd",keyBinding:new m("k",false,false,false,true),predefined:true});if(f){o.push({name:"scrollPageDown",keyBinding:new m("v",false,false,false,true),
predefined:true});o.push({name:"deleteLineStart",keyBinding:new m("u",false,false,false,true),predefined:true});o.push({name:"deleteWordPrevious",keyBinding:new m("w",false,false,false,true),predefined:true})}else{o.push({name:"pageDown",keyBinding:new m("v",false,false,false,true),predefined:true});o.push({name:"centerLine",keyBinding:new m("l",false,false,false,true),predefined:true});o.push({name:"enterNoCursor",keyBinding:new m("o",false,false,false,true),predefined:true})}}var n=this;this._actions=
[{name:"lineUp",defaultHandler:function(){return n._doLineUp({select:false})}},{name:"lineDown",defaultHandler:function(){return n._doLineDown({select:false})}},{name:"lineStart",defaultHandler:function(){return n._doHome({select:false,ctrl:false})}},{name:"lineEnd",defaultHandler:function(){return n._doEnd({select:false,ctrl:false})}},{name:"charPrevious",defaultHandler:function(){return n._doCursorPrevious({select:false,unit:"character"})}},{name:"charNext",defaultHandler:function(){return n._doCursorNext({select:false,
unit:"character"})}},{name:"pageUp",defaultHandler:function(){return n._doPageUp({select:false})}},{name:"pageDown",defaultHandler:function(){return n._doPageDown({select:false})}},{name:"scrollPageUp",defaultHandler:function(){return n._doScroll({type:"pageUp"})}},{name:"scrollPageDown",defaultHandler:function(){return n._doScroll({type:"pageDown"})}},{name:"wordPrevious",defaultHandler:function(){return n._doCursorPrevious({select:false,unit:"word"})}},{name:"wordNext",defaultHandler:function(){return n._doCursorNext({select:false,
unit:"word"})}},{name:"textStart",defaultHandler:function(){return n._doHome({select:false,ctrl:true})}},{name:"textEnd",defaultHandler:function(){return n._doEnd({select:false,ctrl:true})}},{name:"scrollTextStart",defaultHandler:function(){return n._doScroll({type:"textStart"})}},{name:"scrollTextEnd",defaultHandler:function(){return n._doScroll({type:"textEnd"})}},{name:"centerLine",defaultHandler:function(){return n._doScroll({type:"centerLine"})}},{name:"selectLineUp",defaultHandler:function(){return n._doLineUp({select:true})}},
{name:"selectLineDown",defaultHandler:function(){return n._doLineDown({select:true})}},{name:"selectWholeLineUp",defaultHandler:function(){return n._doLineUp({select:true,wholeLine:true})}},{name:"selectWholeLineDown",defaultHandler:function(){return n._doLineDown({select:true,wholeLine:true})}},{name:"selectLineStart",defaultHandler:function(){return n._doHome({select:true,ctrl:false})}},{name:"selectLineEnd",defaultHandler:function(){return n._doEnd({select:true,ctrl:false})}},{name:"selectCharPrevious",
defaultHandler:function(){return n._doCursorPrevious({select:true,unit:"character"})}},{name:"selectCharNext",defaultHandler:function(){return n._doCursorNext({select:true,unit:"character"})}},{name:"selectPageUp",defaultHandler:function(){return n._doPageUp({select:true})}},{name:"selectPageDown",defaultHandler:function(){return n._doPageDown({select:true})}},{name:"selectWordPrevious",defaultHandler:function(){return n._doCursorPrevious({select:true,unit:"word"})}},{name:"selectWordNext",defaultHandler:function(){return n._doCursorNext({select:true,
unit:"word"})}},{name:"selectTextStart",defaultHandler:function(){return n._doHome({select:true,ctrl:true})}},{name:"selectTextEnd",defaultHandler:function(){return n._doEnd({select:true,ctrl:true})}},{name:"deletePrevious",defaultHandler:function(){return n._doBackspace({unit:"character"})}},{name:"deleteNext",defaultHandler:function(){return n._doDelete({unit:"character"})}},{name:"deleteWordPrevious",defaultHandler:function(){return n._doBackspace({unit:"word"})}},{name:"deleteWordNext",defaultHandler:function(){return n._doDelete({unit:"word"})}},
{name:"deleteLineStart",defaultHandler:function(){return n._doBackspace({unit:"line"})}},{name:"deleteLineEnd",defaultHandler:function(){return n._doDelete({unit:"line"})}},{name:"tab",defaultHandler:function(){return n._doTab()}},{name:"enter",defaultHandler:function(){return n._doEnter()}},{name:"enterNoCursor",defaultHandler:function(){return n._doEnter({noCursor:true})}},{name:"selectAll",defaultHandler:function(){return n._doSelectAll()}},{name:"copy",defaultHandler:function(){return n._doCopy()}},
{name:"cut",defaultHandler:function(){return n._doCut()}},{name:"paste",defaultHandler:function(){return n._doPaste()}}]},_createLine:function(m,o,p,n,s){var y=s.getLine(n),w=s.getLineStart(n),z={textView:this,lineIndex:n,lineText:y,lineStart:w};this.onLineStyle(z);s=p.createElement("DIV");s.lineIndex=n;this._applyStyle(z.style,s);if(y.length!==0){var B=0;if((n=this._customTabSize)&&n!==8)for(var D=y.indexOf("\t"),E=0;D!==-1;){this._createRanges(s,p,z.ranges,B,D,y,w);var F=n-(D+E)%n,I="\u00a0";for(B=
1;B<F;B++)I+=" ";B=p.createElement("SPAN");B.appendChild(p.createTextNode(I));B.ignoreChars=F-1;E+=B.ignoreChars;if(z.ranges)for(F=0;F<z.ranges.length;F++){I=z.ranges[F];var L=I.start-w,M=I.end-w;if(L>D)break;if(L<=D&&D<M){this._applyStyle(I.style,B);break}}s.appendChild(B);B=D+1;D=y.indexOf("\t",B)}this._createRanges(s,p,z.ranges,B,y.length,y,w)}y=p.createElement("SPAN");y.ignoreChars=1;if((this._largestFontStyle&1)!==0)y.style.fontStyle="italic";if((this._largestFontStyle&2)!==0)y.style.fontWeight=
"bold";w=" ";if(!this._fullSelection&&c<9)w="\ufeff";if(l)w="\u200c";y.appendChild(p.createTextNode(w));s.appendChild(y);m.insertBefore(s,o);return s},_createRanges:function(m,o,p,n,s,y,w){if(!(n>=s)){if(p)for(var z=0;z<p.length;z++){var B=p[z];if(!(B.end<=w+n)){var D=Math.max(w+n,B.start)-w;if(D>=s)break;var E=Math.min(w+s,B.end)-w;if(D<E){D=Math.max(n,D);E=Math.min(s,E);n<D&&m.appendChild(this._createRange(m,o,y.substring(n,D),null));m.appendChild(this._createRange(m,o,y.substring(D,E),B.style));
n=E}}}n<s&&m.appendChild(this._createRange(m,o,y.substring(n,s),null))}},_createRange:function(m,o,p,n){var s=n&&n.tagName==="A";if(s)m.hasLink=true;m=s&&this._linksVisible?"A":"SPAN";s=o.createElement(m);s.appendChild(o.createTextNode(p));this._applyStyle(n,s);if(m==="A"){var y=this;e(s,"click",function(w){return y._handleLinkClick(w)},false)}s.viewStyle=n;return s},_createRuler:function(m){if(this._clientDiv){var o=this._frameDocument,p=o.body,n=m.getLocation(),s=n==="left"?this._leftDiv:this._rightDiv;
if(!s){s=o.createElement("DIV");s.style.overflow="hidden";s.style.MozUserSelect="none";s.style.WebkitUserSelect="none";c&&s.attachEvent("onselectstart",function(){return false});s.style.position="absolute";s.style.top="0px";s.style.cursor="default";p.appendChild(s);if(n==="left"){this._leftDiv=s;s.className="viewLeftRuler"}else{this._rightDiv=s;s.className="viewRightRuler"}p=o.createElement("TABLE");s.appendChild(p);p.cellPadding="0px";p.cellSpacing="0px";p.border="0px";p.insertRow(0);var y=this;
e(s,"click",function(w){y._handleRulerEvent(w)});e(s,"dblclick",function(w){y._handleRulerEvent(w)});e(s,"mousemove",function(w){y._handleRulerEvent(w)});e(s,"mouseover",function(w){y._handleRulerEvent(w)});e(s,"mouseout",function(w){y._handleRulerEvent(w)})}o=o.createElement("DIV");o._ruler=m;o.rulerChanged=true;o.style.position="relative";m=s.firstChild.rows[0];m=m.insertCell(m.cells.length);m.vAlign="top";m.appendChild(o)}},_createFrame:function(){if(!this.frame){for(var m=this._parent;m.hasChildNodes();)m.removeChild(m.lastChild);
var o=m.ownerDocument;this._parentDocument=o;var p=o.createElement("IFRAME");this._frame=p;p.frameBorder="0px";p.style.border="0px";p.style.width="100%";p.style.height="100%";p.scrolling="no";var n=this;e(p,"load",this._loadHandler=function(s){n._handleLoad(s)});if(!l)e(o,"DOMAttrModified",this._attrModifiedHandler=function(s){n._handleDOMAttrModified(s)});m.appendChild(p);this._handleLoad()}},_getFrameHTML:function(m){var o=[];o.push("<!DOCTYPE html>");o.push("<html>");o.push("<head>");c<9&&o.push("<meta http-equiv='X-UA-Compatible' content='IE=EmulateIE7'/>");
o.push("<style>");o.push(".viewContainer {font-family: monospace; font-size: 10pt;}");o.push(".view {padding: 1px 2px;}");o.push(".viewContent {}");o.push("</style>");if(this._stylesheet)for(var p=typeof this._stylesheet==="string"?[this._stylesheet]:this._stylesheet,n=0;n<p.length;n++){if(m)try{var s=new XMLHttpRequest;s.overrideMimeType&&s.overrideMimeType("text/css");s.open("GET",p[n],false);s.send(null);o.push("<style>");o.push(s.responseText);o.push("</style>");continue}catch(y){}o.push("<link rel='stylesheet' type='text/css' href='");
o.push(p[n]);o.push("'></link>")}o.push("</head>");o.push("<body spellcheck='false'></body>");o.push("</html>");return o.join("")},_createView:function(m){if(!this._clientDiv)if(!this._ignoreCreate){this._ignoreCreate=true;var o=this._parent,p=this._parentDocument,n=this._frame.contentWindow;this._frameWindow=n;var s=n.document;this._frameDocument=s;s.open();s.write(this._getFrameHTML(true));s.close();n=s.body;n.className="viewContainer";n.style.margin="0px";n.style.borderWidth="0px";n.style.padding=
"0px";if(h){var y=p.createElement("DIV");this._touchDiv=y;y.style.position="absolute";y.style.border="0px";y.style.padding="0px";y.style.margin="0px";y.style.zIndex="2";y.style.overflow="hidden";y.style.background="transparent";y.style.WebkitUserSelect="none";o.appendChild(y);this._textArea=o=p.createElement("TEXTAREA");o.style.position="absolute";o.style.whiteSpace="pre";o.style.left="-1000px";o.tabIndex=1;o.autocapitalize=false;o.autocorrect=false;o.className="viewContainer";o.style.background=
"transparent";o.style.color="transparent";o.style.border="0px";o.style.padding="0px";o.style.margin="0px";o.style.borderRadius="0px";o.style.WebkitAppearance="none";o.style.WebkitTapHighlightColor="transparent";y.appendChild(o)}if(f){this._clipboardDiv=o=s.createElement("DIV");o.style.position="fixed";o.style.whiteSpace="pre";o.style.left="-1000px";n.appendChild(o)}p=s.createElement("DIV");p.className="view";this._viewDiv=p;p.id="viewDiv";p.tabIndex=-1;p.style.overflow="auto";p.style.position="absolute";
p.style.top="0px";p.style.borderWidth="0px";p.style.margin="0px";p.style.MozOutline="none";p.style.outline="none";n.appendChild(p);this._scrollDiv=o=s.createElement("DIV");o.id="scrollDiv";o.style.margin="0px";o.style.borderWidth="0px";o.style.padding="0px";p.appendChild(o);if(h||this._fullSelection&&!l){this._hightlightRGB="Highlight";this._selDiv1=p=s.createElement("DIV");p.id="selDiv1";p.style.position="fixed";p.style.borderWidth="0px";p.style.margin="0px";p.style.padding="0px";p.style.MozOutline=
"none";p.style.outline="none";p.style.background=this._hightlightRGB;p.style.width="0px";p.style.height="0px";o.appendChild(p);this._selDiv2=y=s.createElement("DIV");y.id="selDiv2";y.style.position="fixed";y.style.borderWidth="0px";y.style.margin="0px";y.style.padding="0px";y.style.MozOutline="none";y.style.outline="none";y.style.background=this._hightlightRGB;y.style.width="0px";y.style.height="0px";o.appendChild(y);var w=s.createElement("DIV");this._selDiv3=w;w.id="selDiv3";w.style.position="fixed";
w.style.borderWidth="0px";w.style.margin="0px";w.style.padding="0px";w.style.MozOutline="none";w.style.outline="none";w.style.background=this._hightlightRGB;w.style.width="0px";w.style.height="0px";o.appendChild(w);if(f&&k){var z=this._frameWindow.getComputedStyle(w,null).getPropertyValue("background-color");switch(z){case "rgb(119, 141, 168)":z="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":z="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":z="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":z=
"rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":z="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":z="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":z="rgb(232, 184, 255)";break;default:z="rgb(180, 213, 255)";break}this._hightlightRGB=z;p.style.background=z;y.style.background=z;w.style.background=z;s.styleSheets[0].insertRule("::-moz-selection {background: "+z+"; }",0)}}p=s.createElement("DIV");p.className="viewContent";this._clientDiv=p;p.id="clientDiv";p.style.whiteSpace="pre";p.style.position=
"fixed";p.style.borderWidth="0px";p.style.margin="0px";p.style.padding="0px";p.style.MozOutline="none";p.style.outline="none";if(h)p.style.WebkitTapHighlightColor="transparent";o.appendChild(p);if(f){this._overlayDiv=s=s.createElement("DIV");s.id="overlayDiv";s.style.position=p.style.position;s.style.borderWidth=p.style.borderWidth;s.style.margin=p.style.margin;s.style.padding=p.style.padding;s.style.cursor="text";s.style.zIndex="1";o.appendChild(s)}if(!h)p.contentEditable="true";this._lineHeight=
this._calculateLineHeight();this._viewPadding=this._calculatePadding();if(c)n.style.lineHeight=this._lineHeight+"px";if(this._tabSize)if(g)p.style.OTabSize=this._tabSize+"";else if(f>=4)p.style.MozTabSize=this._tabSize+"";else if(this._tabSize!==8)this._customTabSize=this._tabSize;this._hookEvents();n=this._rulers;for(s=0;s<n.length;s++)this._createRuler(n[s]);if(m)this._updatePage();else{this._queueUpdatePage();var B=this._hScroll,D=this._vScroll;this._vScroll=this._hScroll=0;if(B>0||D>0){var E=
this;setTimeout(function(){E._scrollView(B,D)},0)}}this._ignoreCreate=false}},_destroyFrame:function(){var m=this._frame;if(m){if(this._loadHandler){d(m,"load",this._loadHandler);this._loadHandler=null}if(this._attrModifiedHandler){d(this._parentDocument,"DOMAttrModified",this._attrModifiedHandler);this._attrModifiedHandler=null}m.parentNode.removeChild(m);this._frameWindow=this._frameDocument=this._frame=null}},_destroyRuler:function(m){var o=m.getLocation()==="left"?this._leftDiv:this._rightDiv;
if(o){o=o.firstChild.rows[0];for(var p=o.cells,n=0;n<p.length;n++)if(p[n].firstChild._ruler===m)break;if(n!==p.length){o.cells[n]._ruler=undefined;o.deleteCell(n)}}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);this._unhookEvents();if(this._autoScrollTimerID){clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=null}if(this._updateTimer){clearTimeout(this._updateTimer);this._updateTimer=null}for(var m=this._frameDocument.body;m.hasChildNodes();)m.removeChild(m.lastChild);
if(this._touchDiv){this._parent.removeChild(this._touchDiv);this._touchDiv=null}this._rightDiv=this._leftDiv=this._overlayDiv=this._clientDiv=this._viewDiv=this._scrollDiv=this._clipboardDiv=this._textArea=this._selDiv3=this._selDiv2=this._selDiv1=null}},_doAutoScroll:function(m,o,p){this._autoScrollDir=m;this._autoScrollX=o;this._autoScrollY=p;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=
this._autoScrollDir=undefined},_getBaseText:function(m,o){var p=this._model;if(p.getBaseModel){m=p.mapOffset(m);o=p.mapOffset(o);p=p.getBaseModel()}return p.getText(m,o)},_getBoundsAtOffset:function(m){var o=this._model,p=this._frameDocument,n=this._clientDiv,s=o.getLineAtOffset(m),y,w=this._getLineNode(s);w||(w=y=this._createLine(n,null,p,s,o));var z=null;if(m<o.getLineEnd(s)){o=o.getLineStart(s);for(s=w.firstChild;s;){var B=s.firstChild,D=B.length;if(s.ignoreChars)D-=s.ignoreChars;if(o+D>m){z=m-
o;if(t){p=p.createRange();p.setStart(B,z);p.setEnd(B,z+1);z=p.getBoundingClientRect()}else if(c){p=p.body.createTextRange();p.moveToElementText(s);p.collapse();p.moveEnd("character",z+1);p.moveStart("character",z);z=p.getBoundingClientRect()}else{m=B.data;s.removeChild(B);s.appendChild(p.createTextNode(m.substring(0,z)));var E=p.createElement("SPAN");E.appendChild(p.createTextNode(m.substring(z,z+1)));s.appendChild(E);s.appendChild(p.createTextNode(m.substring(z+1)));z=E.getBoundingClientRect();s.innerHTML=
"";s.appendChild(B);if(!y){p=this._getSelection();if(o<=p.start&&p.start<o+D||o<=p.end&&p.end<o+D)this._updateDOMSelection()}}if(c){p=window.screen.logicalXDPI;o=window.screen.deviceXDPI;z.left=z.left*p/o;z.right=z.right*p/o}break}o+=D;s=s.nextSibling}}if(!z){w=this._getLineBoundingClientRect(w);z={left:w.right,right:w.right}}y&&n.removeChild(y);return z},_getBottomIndex:function(m){var o=this._bottomChild;if(m&&this._getClientHeight()>this._getLineHeight()){m=o.getBoundingClientRect();var p=this._clientDiv.getBoundingClientRect();
if(m.bottom>p.bottom)o=this._getLinePrevious(o)||o}return o.lineIndex},_getFrameHeight:function(){return this._frameDocument.documentElement.clientHeight},_getFrameWidth:function(){return this._frameDocument.documentElement.clientWidth},_getClientHeight:function(){var m=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-m.top-m.bottom)},_getClientWidth:function(){var m=this._getViewPadding();return Math.max(0,this._viewDiv.clientWidth-m.left-m.right)},_getClipboardText:function(m){var o=
this._model.getLineDelimiter(),p;if(this._frameWindow.clipboardData){p=[];m=this._frameWindow.clipboardData.getData("Text");this._convertDelimiter(m,function(D){p.push(D)},function(){p.push(o)});return p.join("")}if(f){var n=this._frameDocument,s=this._clipboardDiv;s.innerHTML="<pre contenteditable=''></pre>";s.firstChild.focus();var y=this,w=function(){var D=y._getTextFromElement(s);s.innerHTML="";p=[];y._convertDelimiter(D,function(E){p.push(E)},function(){p.push(o)});return p.join("")},z=false;
this._ignorePaste=true;try{z=n.execCommand("paste",false,null)}catch(B){}this._ignorePaste=false;if(!z)if(m){setTimeout(function(){y.focus();var D=w();D&&y._doContent(D)},0);return null}else{this.focus();return""}this.focus();return w()}if(m&&m.clipboardData){p=[];m=m.clipboardData.getData("text/plain");this._convertDelimiter(m,function(D){p.push(D)},function(){p.push(o)});return p.join("")}return""},_getDOMText:function(m){m=this._getLineNode(m).firstChild;for(var o="";m;){for(var p=m.firstChild;p;){if(m.ignoreChars)for(var n=
0;n<p.length;n++){var s=p.data.substring(n,n+1);if(s!==" ")o+=s}else o+=p.data;p=p.nextSibling}m=m.nextSibling}return o},_getTextFromElement:function(m){var o=m.ownerDocument,p=o.defaultView;if(!p.getSelection)return m.innerText||m.textContent;o=o.createRange();o.selectNode(m);m=p.getSelection();p=[];for(var n=0;n<m.rangeCount;n++)p.push(m.getRangeAt(n));this._ignoreSelect=true;m.removeAllRanges();m.addRange(o);o=m.toString();m.removeAllRanges();for(n=0;n<p.length;n++)m.addRange(p[n]);this._ignoreSelect=
false;return o},_getViewPadding:function(){return this._viewPadding},_getLineBoundingClientRect:function(m){var o=m.getBoundingClientRect();for(m=m.lastChild;m&&m.ignoreChars===m.firstChild.length;)m=m.previousSibling;if(!m)return{left:o.left,top:o.top,right:o.left,bottom:o.bottom};m=m.getBoundingClientRect();return{left:o.left,top:o.top,right:m.right,bottom:o.bottom}},_getLineHeight:function(){return this._lineHeight},_getLineNode:function(m){for(var o=this._clientDiv.firstChild;o;){if(m===o.lineIndex)return o;
o=o.nextSibling}},_getLineNext:function(m){for(m=m?m.nextSibling:this._clientDiv.firstChild;m&&m.lineIndex===-1;)m=m.nextSibling;return m},_getLinePrevious:function(m){for(m=m?m.previousSibling:this._clientDiv.lastChild;m&&m.lineIndex===-1;)m=m.previousSibling;return m},_getOffset:function(m,o,p){if(o==="line"){o=this._model;m=o.getLineAtOffset(m);if(p>0)return o.getLineEnd(m);return o.getLineStart(m)}if(o==="wordend")return this._getOffset_W3C(m,o,p);return c?this._getOffset_IE(m,o,p):this._getOffset_W3C(m,
o,p)},_getOffset_W3C:function(m,o,p){function n(F){return 33<=F&&F<=47||58<=F&&F<=64||91<=F&&F<=94||F===96||123<=F&&F<=126}function s(F){return F===32||F===9}if(o==="word"||o==="wordend"){var y=this._model,w=y.getLineAtOffset(m),z=y.getLine(w),B=y.getLineStart(w);w=y.getLineEnd(w);y=z.length;m=m-B;var D,E;if(p>0){if(m===y)return w;D=z.charCodeAt(m);E=n(D);p=!E&&!s(D);for(m++;m<y;){D=z.charCodeAt(m);w=n(D);if(o==="wordend"){if(!w&&E)break}else if(w&&!E)break;D=!w&&!s(D);if(o==="wordend"){if(!D&&p)break}else if(D&&
!p)break;p=D;E=w;m++}}else{if(m===0)return B;m--;D=z.charCodeAt(m);E=n(D);for(p=!E&&!s(D);0<m;){D=z.charCodeAt(m-1);w=n(D);if(o==="wordend"){if(w&&!E)break}else if(!w&&E)break;D=!w&&!s(D);if(o==="wordend"){if(D&&!p)break}else if(!D&&p)break;p=D;E=w;m--}}return B+m}return m+p},_getOffset_IE:function(m,o,p){var n=this._frameDocument,s=this._model,y=s.getLineAtOffset(m),w=this._clientDiv,z,B=this._getLineNode(y);B||(B=z=this._createLine(w,null,n,y,s));var D=0,E;E=s.getLineStart(y);if(m===s.getLineEnd(y)){n=
n.body.createTextRange();n.moveToElementText(B.lastChild);E=n.text.length;n.moveEnd(o,p);D=m+n.text.length-E}else if(m===E&&p<0)D=E;else for(B=B.firstChild;B;){s=B.firstChild.length;if(B.ignoreChars)s-=B.ignoreChars;if(E+s>m){n=n.body.createTextRange();if(m===E&&p<0)n.moveToElementText(B.previousSibling);else{n.moveToElementText(B);n.collapse();n.moveEnd("character",m-E)}E=n.text.length;n.moveEnd(o,p);D=m+n.text.length-E;break}E=s+E;B=B.nextSibling}z&&w.removeChild(z);return D},_getOffsetToX:function(m){return this._getBoundsAtOffset(m).left},
_getPadding:function(m){var o,p,n,s;if(m.currentStyle){o=m.currentStyle.paddingLeft;p=m.currentStyle.paddingTop;n=m.currentStyle.paddingRight;s=m.currentStyle.paddingBottom}else if(this._frameWindow.getComputedStyle){m=this._frameWindow.getComputedStyle(m,null);o=m.getPropertyValue("padding-left");p=m.getPropertyValue("padding-top");n=m.getPropertyValue("padding-right");s=m.getPropertyValue("padding-bottom")}return{left:parseInt(o,10),top:parseInt(p,10),right:parseInt(n,10),bottom:parseInt(s,10)}},
_getScroll:function(){var m=this._viewDiv;return{x:m.scrollLeft,y:m.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(m){var o=this._topChild;if(m&&this._getClientHeight()>this._getLineHeight()){m=o.getBoundingClientRect();var p=this._getViewPadding(),n=this._viewDiv.getBoundingClientRect();if(m.top<n.top+p.top)o=this._getLineNext(o)||o}return o.lineIndex},_getXToOffset:function(m,o){function p(T){var U,Y,ea,ga;if(!T._rectsCache){U=T.getClientRects();Y=[U.length];
for(ea=0;ea<U.length;ea++){ga=U[ea];Y[ea]={left:ga.left-E+L,top:ga.top,right:ga.right-E+L,bottom:ga.bottom}}T._rectsCache=Y}U=T._rectsCache;Y=[U.length];for(ea=0;ea<U.length;ea++){ga=U[ea];Y[ea]={left:ga.left-L,top:ga.top,right:ga.right-L,bottom:ga.bottom}}return Y}var n=this._model,s=n.getLineStart(m),y=n.getLineEnd(m);if(s===y)return s;var w=this._frameDocument,z=this._clientDiv,B,D=this._getLineNode(m);D||(D=B=this._createLine(z,null,w,m,n));m=this._getLineBoundingClientRect(D);if(o<m.left)o=m.left;
if(o>m.right)o=m.right;var E=0,F;if(c<9){F=D.getClientRects();n=F[0].left;for(var I=1;I<F.length;I++)n=Math.min(F[I].left,n);E=n-m.left}var L=this._getScroll().x,M=c?window.screen.logicalXDPI:1,R=c?window.screen.deviceXDPI:1;m=s;n=D.firstChild;a:for(;n;){I=n.firstChild;D=I.length;if(n.ignoreChars)D-=n.ignoreChars;F=p(n);for(var Q=0;Q<F.length;Q++){var S=F[Q];if(S.left<=o&&o<S.right){if(c||t){w=t?w.createRange():w.body.createTextRange();Q=D;for(var aa=-1;Q-aa>1;){var C=Math.floor((Q+aa)/2);F=aa+1;
S=C===D-1&&n.ignoreChars?I.length:C+1;if(t){w.setStart(I,F);w.setEnd(I,S)}else{w.moveToElementText(n);w.move("character",F);w.moveEnd("character",S-F)}F=w.getClientRects();for(var G=false,J=0;J<F.length;J++){S=F[J];var P=S.right*M/R-E;if(S.left*M/R-E<=o&&o<P){G=true;break}}if(G)Q=C;else aa=C}m+=Q;F=Q;S=Q===D-1&&n.ignoreChars?I.length:Q+1;if(t){w.setStart(I,F);w.setEnd(I,S)}else{w.moveToElementText(n);w.move("character",F);w.moveEnd("character",S-F)}S=w.getClientRects()[0];o>S.left*M/R-E+(S.right-
S.left)*M/R/2&&m++}else{F=[];for(M=0;M<D;M++){F.push("<span>");M===D-1?F.push(I.data.substring(M)):F.push(I.data.substring(M,M+1));F.push("</span>")}n.innerHTML=F.join("");for(F=n.firstChild;F;){S=F.getBoundingClientRect();if(S.left<=o&&o<S.right){o>S.left+(S.right-S.left)/2&&m++;break}m++;F=F.nextSibling}if(!B){n.innerHTML="";n.appendChild(I);o=this._getSelection();if(m<=o.start&&o.start<m+D||m<=o.end&&o.end<m+D)this._updateDOMSelection()}}break a}}m+=D;n=n.nextSibling}B&&z.removeChild(B);return Math.min(y,
Math.max(s,m))},_getYToLine:function(m){var o=this._getViewPadding(),p=this._viewDiv.getBoundingClientRect();m-=p.top+o.top;o=this._getLineHeight();m=Math.floor((m+this._getScroll().y)/o);o=this._model.getLineCount();return Math.max(0,Math.min(o-1,m))},_getOffsetBounds:function(m){var o=this._model.getLineAtOffset(m),p=this._getLineHeight(),n=this._getScroll(),s=this._getViewPadding(),y=this._viewDiv.getBoundingClientRect();m=this._getBoundsAtOffset(m);o=o*p-n.y+y.top+s.top;return{left:m.left,top:o,
right:m.right,bottom:o+p}},_getVisible:function(){for(var m=this._parent,o=m.ownerDocument;m!==o;){var p;if(c<9)p=m.currentStyle&&m.currentStyle.display==="none";else p=(p=o.defaultView.getComputedStyle(m,null))&&p.getPropertyValue("display")==="none";if(p)return"hidden";m=m.parentNode;if(!m)return"disconnected"}return"visible"},_hitOffset:function(m,o,p){var n=this._getOffsetBounds(m);m=n.left;var s=n.right,y=n.top;n=n.bottom;m-=20;y-=20;s+=20;n+=20;return m<=o&&o<=s&&y<=p&&p<=n},_hookEvents:function(){var m=
this;this._modelListener={onChanging:function(z){m._onModelChanging(z)},onChanged:function(z){m._onModelChanged(z)}};this._model.addListener(this._modelListener);var o=this._clientDiv,p=this._viewDiv,n=this._frameDocument.body,s=this._handlers=[],y=c<9?this._frame:this._frameWindow,w=h?this._textArea:c||f?this._clientDiv:this._frameWindow;s.push({target:this._frameWindow,type:"unload",handler:function(z){return m._handleUnload(z)}});s.push({target:y,type:"resize",handler:function(z){return m._handleResize(z)}});
s.push({target:w,type:"blur",handler:function(z){return m._handleBlur(z)}});s.push({target:w,type:"focus",handler:function(z){return m._handleFocus(z)}});s.push({target:p,type:"scroll",handler:function(z){return m._handleScroll(z)}});if(h){o=this._touchDiv;n=this._textArea;s.push({target:n,type:"keydown",handler:function(z){return m._handleKeyDown(z)}});s.push({target:n,type:"input",handler:function(z){return m._handleInput(z)}});s.push({target:n,type:"textInput",handler:function(z){return m._handleTextInput(z)}});
s.push({target:n,type:"click",handler:function(z){return m._handleTextAreaClick(z)}});s.push({target:o,type:"touchstart",handler:function(z){return m._handleTouchStart(z)}});s.push({target:o,type:"touchmove",handler:function(z){return m._handleTouchMove(z)}});s.push({target:o,type:"touchend",handler:function(z){return m._handleTouchEnd(z)}})}else{p=this._overlayDiv||this._clientDiv;y=c?o:this._frameWindow;s.push({target:o,type:"keydown",handler:function(z){return m._handleKeyDown(z)}});s.push({target:o,
type:"keypress",handler:function(z){return m._handleKeyPress(z)}});s.push({target:o,type:"keyup",handler:function(z){return m._handleKeyUp(z)}});s.push({target:o,type:"selectstart",handler:function(z){return m._handleSelectStart(z)}});s.push({target:o,type:"contextmenu",handler:function(z){return m._handleContextMenu(z)}});s.push({target:o,type:"copy",handler:function(z){return m._handleCopy(z)}});s.push({target:o,type:"cut",handler:function(z){return m._handleCut(z)}});s.push({target:o,type:"paste",
handler:function(z){return m._handlePaste(z)}});s.push({target:o,type:"mousedown",handler:function(z){return m._handleMouseDown(z)}});s.push({target:y,type:"mouseup",handler:function(z){return m._handleMouseUp(z)}});s.push({target:y,type:"mousemove",handler:function(z){return m._handleMouseMove(z)}});s.push({target:n,type:"mousedown",handler:function(z){return m._handleBodyMouseDown(z)}});s.push({target:p,type:"dragstart",handler:function(z){return m._handleDragStart(z)}});s.push({target:p,type:"dragover",
handler:function(z){return m._handleDragOver(z)}});s.push({target:p,type:"drop",handler:function(z){return m._handleDrop(z)}});if(i){s.push({target:this._parentDocument,type:"mousemove",handler:function(z){return m._handleMouseMove(z)}});s.push({target:this._parentDocument,type:"mouseup",handler:function(z){return m._handleMouseUp(z)}})}c&&s.push({target:this._frameDocument,type:"activate",handler:function(z){return m._handleDocFocus(z)}});f&&s.push({target:this._frameDocument,type:"focus",handler:function(z){return m._handleDocFocus(z)}});
if(!c&&!g)s.push({target:this._viewDiv,type:f?"DOMMouseScroll":"mousewheel",handler:function(z){return m._handleMouseWheel(z)}});f&&!q&&s.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(z){return m._handleDataModified(z)}});if(this._overlayDiv){s.push({target:this._overlayDiv,type:"mousedown",handler:function(z){return m._handleMouseDown(z)}});s.push({target:this._overlayDiv,type:"contextmenu",handler:function(z){return m._handleContextMenu(z)}})}r||s.push({target:this._clientDiv,
type:"dblclick",handler:function(z){return m._handleDblclick(z)}})}for(o=0;o<s.length;o++){n=s[o];e(n.target,n.type,n.handler,n.capture)}},_init:function(m){var o=m.parent;if(typeof o==="string")o=window.document.getElementById(o);if(!o)throw"no parent";this._parent=o;this._model=m.model?m.model:new orion.textview.TextModel;this.readonly=m.readonly===true;this._fullSelection=m.fullSelection===undefined||m.fullSelection;if(c<9)this._fullSelection=false;this._stylesheet=m.stylesheet;this._tabSize=m.tabSize;
this._rulers=[];this._selection=new A(0,0,false);this._linksVisible=false;this._eventTable=new x;this._maxLineWidth=this._redrawCount=0;this._maxLineIndex=-1;this._ignoreSelect=true;this._columnX=-1;this._autoScrollTimerID=this._autoScrollY=this._autoScrollX=null;this._AUTO_SCROLL_RATE=50;this._mouseUpClosure=this._moseMoveClosure=this._grabControl=null;this._clickCount=this._lastMouseTime=this._lastMouseY=this._lastMouseX=0;this._clickTime=250;this._clickDist=5;this._isMouseDown=false;this._doubleClickSelection=
null;this._vScroll=this._hScroll=0;this._imeOffset=-1;this._createActions();this._createFrame()},_modifyContent:function(m,o){if(!(this.readonly&&!m._code)){this.onVerify(m);if(!(m.text===null||m.text===undefined)){var p=this._model;try{if(m._ignoreDOMSelection)this._ignoreDOMSelection=true;p.setText(m.text,m.start,m.end)}finally{if(m._ignoreDOMSelection)this._ignoreDOMSelection=false}if(o){o=this._getSelection();o.setCaret(m.start+m.text.length);this._setSelection(o,true)}this.onModify({})}}},_onModelChanged:function(m){this.onModelChanged(m);
var o=m.start,p=m.addedCharCount,n=m.removedCharCount,s=m.addedLineCount;m=m.removedLineCount;var y=this._getSelection();if(y.end>o){if(y.end>o&&y.start<o+n)y.setCaret(o+p);else{y.start+=p-n;y.end+=p-n}this._setSelection(y,false,false)}o=this._model.getLineAtOffset(o);for(p=this._getLineNext();p;){n=p.lineIndex;if(o<=n&&n<=o+m)p.lineChanged=true;if(n>o+m)p.lineIndex=n+s-m;p=this._getLineNext(p)}if(o<=this._maxLineIndex&&this._maxLineIndex<=o+m){this._checkMaxLineIndex=this._maxLineIndex;this._maxLineIndex=
-1;this._maxLineWidth=0}this._updatePage()},_onModelChanging:function(m){this.onModelChanging(m)},_queueUpdatePage:function(){if(!this._updateTimer){var m=this;this._updateTimer=setTimeout(function(){m._updateTimer=null;m._updatePage()},0)}},_reset:function(){this._maxLineIndex=-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._partialY=0;this._setSelection(new A(0,0,false),false,false);if(this._viewDiv){this._viewDiv.scrollLeft=0;this._viewDiv.scrollTop=0}var m=
this._clientDiv;if(m){for(var o=m.firstChild;o;){o.lineChanged=true;o=o.nextSibling}if(f){(o=this._hasFocus)&&m.blur();m.contentEditable=false;m.contentEditable=true;o&&m.focus()}}},_resizeTouchDiv:function(){for(var m=this._viewDiv.getBoundingClientRect(),o=this._frame.getBoundingClientRect(),p=this._frame;p;){if(p.style&&p.style.top)break;p=p.parentNode}var n=o.top;if(p)n-=p.getBoundingClientRect().top;else n+=this._parentDocument.body.scrollTop;for(p=this._frame;p;){if(p.style&&p.style.left)break;
p=p.parentNode}o=o.left;if(p)o-=p.getBoundingClientRect().left;else o+=this._parentDocument.body.scrollLeft;p=this._touchDiv;p.style.left=o+m.left+"px";p.style.top=n+m.top+"px";p.style.width=m.width+"px";p.style.height=m.height+"px"},_scrollView:function(m,o){this._ensureCaretVisible=false;var p=this._viewDiv;if(m)p.scrollLeft+=m;if(o)p.scrollTop+=o},_setClipboardText:function(m,o){var p;if(this._frameWindow.clipboardData){p=[];this._convertDelimiter(m,function(B){p.push(B)},function(){p.push(v)});
return this._frameWindow.clipboardData.setData("Text",p.join(""))}if(i||f||!o){var n=this._frameWindow,s=this._frameDocument,y=s.createElement("PRE");y.style.position="fixed";y.style.left="-1000px";this._convertDelimiter(m,function(B){y.appendChild(s.createTextNode(B))},function(){y.appendChild(s.createElement("BR"))});y.appendChild(s.createTextNode(" "));this._clientDiv.appendChild(y);m=s.createRange();m.setStart(y.firstChild,0);m.setEndBefore(y.lastChild);n=n.getSelection();n.rangeCount>0&&n.removeAllRanges();
n.addRange(m);var w=this;n=function(){w._clientDiv.removeChild(y);w._updateDOMSelection()};m=false;this._ignoreCopy=true;try{m=s.execCommand("copy",false,null)}catch(z){}this._ignoreCopy=false;if(!m)if(o){setTimeout(n,0);return false}n();return true}if(o&&o.clipboardData){p=[];this._convertDelimiter(m,function(B){p.push(B)},function(){p.push(v)});return o.clipboardData.setData("text/plain",p.join(""))}},_setDOMSelection:function(m,o,p,n){for(var s=this._frameWindow,y=this._frameDocument,w,z,B,D,E=
0,F=m.firstChild,I,L,M=this._model.getLine(m.lineIndex).length;F;){I=F.firstChild;L=I.length;if(F.ignoreChars)L-=F.ignoreChars;if(E+L>o||E+L>=M){w=I;z=o-E;if(F.ignoreChars&&L>0&&z===L)z+=F.ignoreChars;break}E+=L;F=F.nextSibling}E=0;F=p.firstChild;for(var R=this._model.getLine(p.lineIndex).length;F;){I=F.firstChild;L=I.length;if(F.ignoreChars)L-=F.ignoreChars;if(L+E>n||E+L>=R){B=I;D=n-E;if(F.ignoreChars&&L>0&&D===L)D+=F.ignoreChars;break}E+=L;F=F.nextSibling}this._setDOMFullSelection(m,o,M,p,n,R);
if(!h)if(s.getSelection){y=y.createRange();y.setStart(w,z);y.setEnd(B,D);B=s.getSelection();this._ignoreSelect=false;B.rangeCount>0&&B.removeAllRanges();B.addRange(y);this._ignoreSelect=true}else if(y.selection){s=y.body;y=y.createElement("DIV");s.appendChild(y);s.removeChild(y);y=s.createTextRange();y.moveToElementText(w.parentNode);y.moveStart("character",z);w=s.createTextRange();w.moveToElementText(B.parentNode);w.moveStart("character",D);y.setEndPoint("EndToStart",w);this._ignoreSelect=false;
y.select();this._ignoreSelect=true}},_setDOMFullSelection:function(m,o,p,n,s,y){var w=this._model;if(this._selDiv1){var z,B;z=this._getLineBoundingClientRect(m);if(o===0)B=z.left;else if(o>=p)B=z.right;else{this._ignoreDOMSelection=true;B=this._getBoundsAtOffset(w.getLineStart(m.lineIndex)+o).left;this._ignoreDOMSelection=false}if((p=this._textArea)&&h){p.selectionStart=p.selectionEnd=0;var D=this._frame.getBoundingClientRect(),E=this._touchDiv.getBoundingClientRect(),F=this._viewDiv.getBoundingClientRect();
p.style.left=!(F.left<=B&&B<=F.left+F.width&&F.top<=z.top&&z.top<=F.top+F.height)||!(m===n&&o===s)?"-1000px":B-4+D.left-E.left+"px";p.style.top=z.top+D.top-E.top+"px";p.style.width="6px";p.style.height=z.bottom-z.top+"px"}p=this._selDiv1;p.style.width="0px";p.style.height="0px";p=this._selDiv2;p.style.width="0px";p.style.height="0px";p=this._selDiv3;p.style.width="0px";p.style.height="0px";if(!(m===n&&o===s)){D=h?2:0;E=D+"px blue solid";F=this._getViewPadding();var I=this._clientDiv.getBoundingClientRect(),
L=this._viewDiv.getBoundingClientRect();o=L.left+F.left;p=I.right;F=L.top+F.top;I=I.bottom;L=this._getLineBoundingClientRect(n);if(s===0)s=L.left;else if(s>=y)s=L.right;else{this._ignoreDOMSelection=true;s=this._getBoundsAtOffset(w.getLineStart(n.lineIndex)+s).left;this._ignoreDOMSelection=false}y=this._selDiv1;B=Math.min(p,Math.max(o,B));w=Math.min(I,Math.max(F,z.top));var M=p;z=Math.min(I,Math.max(F,z.bottom));y.style.left=B+"px";y.style.top=w+"px";y.style.width=Math.max(0,M-B)+"px";y.style.height=
Math.max(0,z-w)+(h?1:0)+"px";if(h){y.style.borderLeft=E;y.style.borderRight="0px"}if(m===n){M=Math.min(s,p);y.style.width=Math.max(0,M-B-D*2)+"px";if(h)y.style.borderRight=E}else{m=Math.min(I,Math.max(F,L.top));n=Math.min(p,Math.max(o,s));B=Math.min(I,Math.max(F,L.bottom));s=this._selDiv3;s.style.left=o+"px";s.style.top=m+"px";s.style.width=Math.max(0,n-o-D)+"px";s.style.height=Math.max(0,B-m)+"px";if(h)s.style.borderRight=E;if(m-z>0){n=this._selDiv2;n.style.left=o+"px";n.style.top=z+"px";n.style.width=
Math.max(0,p-o)+"px";n.style.height=Math.max(0,m-z)+(h?1:0)+"px"}}}}},_setGrab:function(m){if(m!==this._grabControl)if(m){m.setCapture&&m.setCapture();this._grabControl=m}else{this._grabControl.releaseCapture&&this._grabControl.releaseCapture();this._grabControl=null}},_setLinksVisible:function(m){if(this._linksVisible!==m){this._linksVisible=m;if(c&&m)this._hadFocus=this._hasFocus;var o=this._clientDiv;o.contentEditable=!m;this._hadFocus&&!m&&o.focus();if(this._overlayDiv)this._overlayDiv.style.zIndex=
m?"-1":"1";m=this._frameDocument;for(o=this._getLineNext();o;){if(o.hasLink)for(var p=o.firstChild;p;){var n=p.nextSibling,s=p.viewStyle;s&&s.tagName==="A"&&o.replaceChild(this._createRange(o,m,p.firstChild.data,s),p);p=n}o=this._getLineNext(o)}}},_setSelection:function(m,o,p,n){if(m){this._columnX=-1;if(p===undefined)p=true;var s=this._selection;if(!s.equals(m)){this._selection=m;this.onSelection({oldValue:{start:s.start,end:s.end},newValue:{start:m.start,end:m.end}})}if(o)p=!this._showCaret(false,
n);p&&this._updateDOMSelection()}},_setSelectionTo:function(m,o,p){var n=this._model,s=this._getSelection();o=this._getYToLine(o);if(this._clickCount===1){n=this._getXToOffset(o,m);s.extend(n);p||s.collapse()}else{if((this._clickCount&1)===0){n=this._getXToOffset(o,m);if(this._doubleClickSelection)if(n>=this._doubleClickSelection.start){p=this._doubleClickSelection.start;n=this._getOffset(n,"wordend",+1)}else{p=this._getOffset(n,"word",-1);n=this._doubleClickSelection.end}else{p=this._getOffset(n,
"word",-1);n=this._getOffset(p,"wordend",+1)}}else if(this._doubleClickSelection){m=n.getLineAtOffset(this._doubleClickSelection.start);if(o>=m){p=n.getLineStart(m);n=n.getLineEnd(o)}else{p=n.getLineStart(o);n=n.getLineEnd(m)}}else{p=n.getLineStart(o);n=n.getLineEnd(o)}s.setCaret(p);s.extend(n)}this._setSelection(s,true,true)},_showCaret:function(m,o){if(this._clientDiv){var p=this._model,n=this._getSelection(),s=this._getScroll(),y=n.getCaret(),w=n.start,z=n.end,B=p.getLineAtOffset(w),D=p.getLineAtOffset(z),
E=Math.max(Math.max(w,p.getLineStart(D)),z-1),F=this._getViewPadding(),I=this._getClientWidth(),L=F.left;F=F.left+I;var M=this._getBoundsAtOffset(y===w?w:E),R=M.left,Q=M.right,S=I/4;if(m&&!n.isEmpty()&&B===D){M=this._getBoundsAtOffset(y===z?w:E);if(I-S>(y===w?M.right-R:Q-M.left)){if(R>M.left)R=M.left;if(Q<M.right)Q=M.right}}n=this._viewDiv.getBoundingClientRect();R-=n.left;Q-=n.left;n=0;if(R<L)n=Math.min(R-L,-S);if(Q>F)n=Math.min(this._scrollDiv.scrollWidth-s.x-I,Math.max(Q-F,S));L=0;R=this._getTopIndex(true);
Q=this._getBottomIndex(true);p=p.getLineAtOffset(y);F=this._getClientHeight();if(!(R<=p&&p<=Q)){R=this._getLineHeight();m=m?(D-B)*R:0;L=p*R;L-=s.y;if(L+R>F){L-=F-R;if(y===w&&w!==z)L+=Math.min(F-R,m)}else if(y===z)L-=Math.min(F-R,m);if(o)if(o>0){if(L>0)L=Math.max(L,o)}else if(L<0)L=Math.min(L,o)}if(n!==0||L!==0){this._scrollView(n,L);if(F!==this._getClientHeight()||I!==this._getClientWidth())this._showCaret();else this._ensureCaretVisible=true;return true}return false}},_startIME:function(){if(this._imeOffset===
-1){var m=this._getSelection();m.isEmpty()||this._modifyContent({text:"",start:m.start,end:m.end},true);this._imeOffset=m.start}},_unhookEvents:function(){this._model.removeListener(this._modelListener);this._modelListener=null;for(var m=0;m<this._handlers.length;m++){var o=this._handlers[m];d(o.target,o.type,o.handler)}this._handlers=null},_updateDOMSelection:function(){if(!this._ignoreDOMSelection)if(this._clientDiv){var m=this._getSelection(),o=this._model,p=o.getLineAtOffset(m.start),n=o.getLineAtOffset(m.end),
s=this._getLineNext();if(s){var y=this._getLinePrevious(),w;if(p<s.lineIndex){w=s;p=0}else if(p>y.lineIndex){w=y;p=0}else{w=this._getLineNode(p);p=m.start-o.getLineStart(p)}if(n<s.lineIndex){s=s;m=0}else if(n>y.lineIndex){s=y;m=0}else{s=this._getLineNode(n);m=m.end-o.getLineStart(n)}this._setDOMSelection(w,p,s,m)}}},_updatePage:function(){function m(G){if(G){for(var J=L+w.top+w.bottom,P=G.firstChild.rows[0].cells,T=0;T<P.length;T++){var U=P[T].firstChild,Y=B;if(U._ruler.getOverview()==="page")Y+=
M;U.style.top=-Y+"px";U.style.height=J+Y+"px"}G.style.height=J+"px"}}if(!(this._redrawCount>0)){if(this._updateTimer){clearTimeout(this._updateTimer);this._updateTimer=null}var o=this._frameDocument,p=this._viewDiv,n=this._clientDiv;if(n){var s=this._getFrameWidth(),y=this._getFrameHeight();o.body.style.width=s+"px";o.body.style.height=y+"px";var w=this._getViewPadding();p.style.height=Math.max(0,y-w.top-w.bottom)+"px";var z=this._model,B=this._getLineHeight();y=this._getScroll().y;var D=Math.max(0,
y)/B,E=Math.floor(D),F=Math.max(0,E-1);y=Math.round((D-F)*B);var I=z.getLineCount(),L=this._getClientHeight(),M=Math.round((D-E)*B);D=Math.floor((L+M)/B);D=Math.min(E+D,I-1);var R=Math.min(D+1,I-1);this._partialY=M;for(var Q,S=n.firstChild;S;){Q=S.lineIndex;var aa=S.nextSibling;if(!(F<=Q&&Q<=R)||S.lineChanged||S.lineIndex===-1)if(this._mouseWheelLine===S){S.style.display="none";S.lineIndex=-1}else n.removeChild(S);S=aa}S=this._getLineNext();aa=o.createDocumentFragment();for(Q=F;Q<=R;Q++)if(!S||S.lineIndex>
Q)this._createLine(aa,null,o,Q,z);else{if(aa.firstChild){n.insertBefore(aa,S);aa=o.createDocumentFragment()}S=this._getLineNext(S)}aa.firstChild&&n.insertBefore(aa,S);if(l)n.style.width=(524287).toString()+"px";for(S=this._getLineNext();S;){F=S.lineWidth;if(F===undefined){F=this._getLineBoundingClientRect(S);F=S.lineWidth=F.right-F.left}if(F>=this._maxLineWidth){this._maxLineWidth=F;this._maxLineIndex=S.lineIndex}if(S.lineIndex===E)this._topChild=S;if(S.lineIndex===D)this._bottomChild=S;if(this._checkMaxLineIndex===
S.lineIndex)this._checkMaxLineIndex=-1;S=this._getLineNext(S)}if(this._checkMaxLineIndex!==-1){Q=this._checkMaxLineIndex;this._checkMaxLineIndex=-1;if(0<=Q&&Q<I){o=this._createLine(n,null,o,Q,z);F=this._getLineBoundingClientRect(o);F=F.right-F.left;if(F>=this._maxLineWidth){this._maxLineWidth=F;this._maxLineIndex=Q}n.removeChild(o)}}this._updateRuler(this._leftDiv,E,D);this._updateRuler(this._rightDiv,E,D);o=this._leftDiv?this._leftDiv.scrollWidth:0;z=this._rightDiv?this._rightDiv.scrollWidth:0;p.style.left=
o+"px";p.style.width=Math.max(0,s-o-z-w.left-w.right)+"px";if(this._rightDiv)this._rightDiv.style.left=s-z+"px";z=this._scrollDiv;p=I*B;z.style.height=p+"px";s=this._getClientWidth();I=E=Math.max(this._maxLineWidth,s);if(!c||c>=9)E+=w.right;z.style.width=E+"px";z=this._getScroll();D=E=z.x;Q=y;F=E+s;S=y+L;if(D===0)D-=w.left;if(Q===0)Q-=w.top;if(F===I)F+=w.right;if(z.y+L===p)S+=w.bottom;n.style.clip="rect("+Q+"px,"+F+"px,"+S+"px,"+D+"px)";n.style.left=-E+o+w.left+"px";n.style.top=-y+w.top+"px";n.style.width=
(l?I:s+E)+"px";n.style.height=L+y+"px";if(y=this._overlayDiv){y.style.clip=n.style.clip;y.style.left=n.style.left;y.style.top=n.style.top;y.style.width=n.style.width;y.style.height=n.style.height}m(this._leftDiv);m(this._rightDiv);if(h){var C=this;setTimeout(function(){C._resizeTouchDiv()},0)}this._updateDOMSelection();n=this._ensureCaretVisible;this._ensureCaretVisible=false;if(L!==this._getClientHeight()){this._updatePage();n&&this._showCaret()}}}},_updateRuler:function(m,o,p){if(m){m=m.firstChild.rows[0].cells;
for(var n=this._getLineHeight(),s=this._frameDocument,y=this._getViewPadding(),w=0;w<m.length;w++){var z=m[w].firstChild,B=z._ruler;z.rulerChanged&&this._applyStyle(B.getRulerStyle(),z);var D,E=z.firstChild;if(E){D=E;E=E.nextSibling}else{D=s.createElement("DIV");D.style.visibility="hidden";z.appendChild(D)}var F,I;if(z.rulerChanged)if(D){F=-1;if(I=B.getWidestAnnotation()){this._applyStyle(I.style,D);if(I.html)D.innerHTML=I.html}D.lineIndex=F;D.style.height=n+y.top+"px"}var L,M;if(B.getOverview()===
"page"){for(B=B.getAnnotations(o,p+1);E;){F=E.lineIndex;I=E.nextSibling;if(!(o<=F&&F<=p)||E.lineChanged)z.removeChild(E);E=I}E=z.firstChild.nextSibling;M=s.createDocumentFragment();for(F=o;F<=p;F++)if(!E||E.lineIndex>F){L=s.createElement("DIV");if(I=B[F]){this._applyStyle(I.style,L);if(I.html)L.innerHTML=I.html;L.annotation=I}L.lineIndex=F;L.style.height=n+"px";M.appendChild(L)}else{if(M.firstChild){z.insertBefore(M,E);M=s.createDocumentFragment()}if(E)E=E.nextSibling}M.firstChild&&z.insertBefore(M,
E)}else{E=h?0:17;I=this._getClientHeight();F=this._model.getLineCount();D=I+y.top+y.bottom-2*E;var R;R=n*F<D?n:D/F;if(z.rulerChanged){for(I=z.childNodes.length;I>1;){z.removeChild(z.lastChild);I--}B=B.getAnnotations(0,F);M=s.createDocumentFragment();for(var Q in B){F=Q>>>0;if(!(F<0)){L=s.createElement("DIV");I=B[Q];this._applyStyle(I.style,L);L.style.position="absolute";L.style.top=E+n+Math.floor(F*R)+"px";if(I.html)L.innerHTML=I.html;L.annotation=I;L.lineIndex=F;M.appendChild(L)}}z.appendChild(M)}else if(z._oldTrackHeight!==
D)for(L=z.firstChild?z.firstChild.nextSibling:null;L;){L.style.top=E+n+Math.floor(L.lineIndex*R)+"px";L=L.nextSibling}z._oldTrackHeight=D}z.rulerChanged=false}}}};return a}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/textview/textView",["orion/textview/textModel","orion/textview/keyBinding"],function(){return orion.textview});var examples=examples||{};examples.textview=examples.textview||{};
examples.textview.TextStyler=function(){function e(p,n,s){this.commentStart="/*";this.commentEnd="*/";var y=[];switch(n){case "java":y=a;break;case "js":y=d;break;case "css":y=c;break}this.whitespacesVisible=false;this.detectTasks=this.foldingEnabled=this.highlightCaretLine=this.detectHyperlinks=true;this._scanner=new A(y,this.whitespacesVisible);if(n==="css")this._scanner.isCSS=true;this._firstScanner=new o;this._commentScanner=new m(this.whitespacesVisible);this._whitespaceScanner=new x;this.view=
p;this.annotationModel=s;this._matchingBracket=this._currentBracket=undefined;p.addEventListener("Selection",this,this._onSelection);n=p.getModel();if(n.getBaseModel){var w=this;this._baseModelListener={onChanged:function(z){w._onModelChanged(z)}};n.getBaseModel().addListener(this._baseModelListener)}else p.addEventListener("ModelChanged",this,this._onModelChanged);p.addEventListener("Destroy",this,this._onDestroy);p.addEventListener("LineStyle",this,this._onLineStyle);this._computeComments();this._computeFolding();
p.redrawLines()}var d=["break","case","class","catch","continue","const","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","implements","import","in","instanceof","interface","let","new","null","package","private","protected","public","return","static","super","switch","this","throw","true","try","typeof","undefined","var","void","while","with","yield"],a=["abstract","boolean","break","byte","case","catch","char","class","continue","default",
"do","double","else","extends","false","final","finally","float","for","if","implements","import","instanceof","int","interface","long","native","new","null","package","private","protected","public","return","short","static","super","switch","synchronized","this","throw","throws","transient","true","try","void","volatile","while"],c=["color","text-align","text-indent","text-decoration","font","font-style","font-family","font-weight","font-size","font-variant","line-height","background","background-color",
"background-image","background-position","background-repeat","background-attachment","list-style","list-style-image","list-style-position","list-style-type","outline","outline-color","outline-style","outline-width","border","border-left","border-top","border-bottom","border-right","border-color","border-width","border-style","border-bottom-color","border-bottom-style","border-bottom-width","border-left-color","border-left-style","border-left-width","border-top-color","border-top-style","border-top-width",
"border-right-color","border-right-style","border-right-width","padding","padding-left","padding-top","padding-bottom","padding-right","margin","margin-left","margin-top","margin-bottom","margin-right","width","height","left","top","right","bottom","min-width","max-width","min-height","max-height","display","visibility","clip","cursor","overflow","overflow-x","overflow-y","position","z-index","vertical-align","horizontal-align","float","clear"],f={styleClass:"token_singleline_comment"},g={styleClass:"token_multiline_comment"},
i={styleClass:"token_doc_comment"},j={styleClass:"token_doc_html_markup"},l={styleClass:"token_task_tag"},h={styleClass:"token_doc_tag"},k={styleClass:"token_string"},q={styleClass:"token_keyword"},u={styleClass:"token_space"},r={styleClass:"token_tab"},t={styleClass:(document.selection&&window.ActiveXObject&&/MSIE/.test(navigator.userAgent)?document.documentMode:undefined)<9?"token_bracket":"token_bracket_outline"},v={styleClass:"line_caret"},A=function(){function p(n,s){this.keywords=n;this.whitespacesVisible=
s;this.setText("")}p.prototype={getOffset:function(){return this.offset},getStartOffset:function(){return this.startOffset},getData:function(){return this.text.substring(this.startOffset,this.offset)},getDataLength:function(){return this.offset-this.startOffset},_default:function(n){var s=this.keywords;switch(n){case 32:case 9:if(this.whitespacesVisible)return n===32?9:8;do n=this._read();while(n===32||n===9);this._unread(n);return 7;case 123:case 125:case 40:case 41:case 91:case 93:case 60:case 62:return n;
default:var y=this.isCSS;if(97<=n&&n<=122||65<=n&&n<=90||n===95||48<=n&&n<=57||45===n&&y){var w=this.offset-1;do n=this._read();while(97<=n&&n<=122||65<=n&&n<=90||n===95||48<=n&&n<=57||45===n&&y);this._unread(n);if(s.length>0){n=this.text.substring(w,this.offset);for(y=0;y<s.length;y++)if(this.keywords[y]===n)return 2}}return 1}},_read:function(){if(this.offset<this.text.length)return this.text.charCodeAt(this.offset++);return-1},_unread:function(n){n!==-1&&this.offset--},nextToken:function(){for(this.startOffset=
this.offset;;){var n=this._read();switch(n){case -1:return null;case 47:n=this._read();if(n===47)for(;;){n=this._read();if(n===-1||n===10||n===13){this._unread(n);return 4}}if(n===42){n=this._read();var s=5;if(n===42)s=6;for(;;){for(;n===42;){n=this._read();if(n===47)return s}if(n===-1){this._unread(n);return s}n=this._read()}}this._unread(n);return 1;case 39:for(;;){n=this._read();switch(n){case 39:return 3;case 13:case 10:case -1:this._unread(n);return 3;case 92:this._read();break}}break;case 34:for(;;){n=
this._read();switch(n){case 34:return 3;case 13:case 10:case -1:this._unread(n);return 3;case 92:this._read();break}}break;default:return this._default(n)}}},setText:function(n){this.text=n;this.startOffset=this.offset=0}};return p}(),x=function(){function p(){A.call(this,null,true)}p.prototype=new A(null);p.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var n=this._read();switch(n){case -1:return null;case 32:return 9;case 9:return 8;default:do n=this._read();while(!(n===32||
n===9||n===-1));this._unread(n);return 1}}};return p}(),m=function(){function p(n){A.call(this,null,n)}p.prototype=new A(null);p.prototype.setType=function(n){this._type=n};p.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var n=this._read();switch(n){case -1:return null;case 32:case 9:if(this.whitespacesVisible)return n===32?9:8;do n=this._read();while(n===32||n===9);this._unread(n);return 7;case 60:if(this._type===6){do n=this._read();while(!(n===62||n===-1));if(n===62)return 10}return 1;
case 64:if(this._type===6){do n=this._read();while(97<=n&&n<=122||65<=n&&n<=90||n===95||48<=n&&n<=57);this._unread(n);return 11}return 1;case 84:if((n=this._read())===79)if((n=this._read())===68)if((n=this._read())===79){n=this._read();if(!(97<=n&&n<=122||65<=n&&n<=90||n===95||48<=n&&n<=57)){this._unread(n);return 12}}this._unread(n);default:do n=this._read();while(!(n===32||n===9||n===-1||n===60||n===64||n===84));this._unread(n);return 1}}};return p}(),o=function(){function p(){A.call(this,null,
false)}p.prototype=new A(null);p.prototype._default=function(n){for(;;){n=this._read();switch(n){case 47:case 34:case 39:case -1:this._unread(n);return 1}}};return p}();e.prototype={destroy:function(){var p=this.view;if(p){var n=p.getModel();n.getBaseModel?n.getBaseModel().removeListener(this._baseModelListener):p.removeEventListener("ModelChanged",this,this._onModelChanged);p.removeEventListener("Selection",this,this._onSelection);p.removeEventListener("Destroy",this,this._onDestroy);p.removeEventListener("LineStyle",
this,this._onLineStyle);this.view=null}},setHighlightCaretLine:function(p){this.highlightCaretLine=p},setWhitespacesVisible:function(p){this.whitespacesVisible=p;this._scanner.whitespacesVisible=p;this._commentScanner.whitespacesVisible=p},setDetectHyperlinks:function(p){this.detectHyperlinks=p},setFoldingEnabled:function(p){this.foldingEnabled=p},setDetectTasks:function(p){this.detectTasks=p},_binarySearch:function(p,n,s,y,w){var z;if(y===undefined)y=-1;if(w===undefined)w=p.length;for(;w-y>1;){z=
Math.floor((w+y)/2);if(n<=p[z].start)w=z;else if(s&&n<p[z].end){w=z;break}else y=z}return w},_computeComments:function(){var p=this.view.getModel();if(p.getBaseModel)p=p.getBaseModel();this.comments=this._findComments(p.getText())},_computeFolding:function(){if(this.foldingEnabled){var p=this.view.getModel();if(p.getBaseModel){var n=this.annotationModel;if(n){n.removeAnnotations("orion.annotation.folding");for(var s=[],y=p.getBaseModel(),w=this.comments,z=0;z<w.length;z++){var B=w[z];(B=this._createFoldingAnnotation(p,
y,B.start,B.end))&&s.push(B)}n.replaceAnnotations(null,s)}}}},_createFoldingAnnotation:function(p,n,s,y){var w=n.getLineAtOffset(s);n=n.getLineAtOffset(y);if(w===n)return null;return new orion.textview.FoldingAnnotation(p,"orion.annotation.folding",s,y,"<div class='annotationHTML expanded'></div>",{styleClass:"annotation expanded"},"<div class='annotationHTML collapsed'></div>",{styleClass:"annotation collapsed"})},_computeTasks:function(p,n,s){if(this.detectTasks){var y=this.annotationModel;if(y){var w=
this.view.getModel(),z=w;if(w.getBaseModel)z=w.getBaseModel();var B=y.getAnnotations(n,s);for(w=[];B.hasNext();)w.push(B.next());B=[];var D=this._commentScanner;D.setText(z.getText(n,s));for(var E;E=D.nextToken();){var F=D.getStartOffset()+n;if(E===12){E=z.getLineEnd(z.getLineAtOffset(F));if(p!==4)E=Math.min(E,s-this.commentEnd.length);B.push({start:F,end:E,type:"orion.annotation.task",title:z.getText(F,E),style:{styleClass:"annotation task"},html:"<div class='annotationHTML task'></div>",overviewStyle:{styleClass:"annotationOverview task"}})}}y.replaceAnnotations(w,
B)}}},_getLineStyle:function(p){if(this.highlightCaretLine){var n=this.view,s=n.getModel();n=n.getSelection();if(n.start===n.end&&s.getLineAtOffset(n.start)===p)return v}return null},_getStyles:function(p,n,s){if(p.getBaseModel)s=p.mapOffset(s);for(var y=s+n.length,w=[],z=s,B=this.comments,D=this._binarySearch(B,s,true);D<B.length;D++){if(B[D].start>=y)break;var E=B[D].start,F=B[D].end;z<E&&this._parse(n.substring(z-s,E-s),z,w);var I=B[D].type===6?i:g;if(this.whitespacesVisible||this.detectHyperlinks){z=
Math.max(z,E);E=Math.min(y,F);this._parseComment(n.substring(z-s,E-s),z,w,I,B[D].type)}else w.push({start:E,end:F,style:I});z=F}z<y&&this._parse(n.substring(z-s,y-s),z,w);if(p.getBaseModel)for(n=0;n<w.length;n++){s=w[n].end-w[n].start;w[n].start=p.mapOffset(w[n].start,true);w[n].end=w[n].start+s}return w},_parse:function(p,n,s){var y=this._scanner;for(y.setText(p);p=y.nextToken();){var w=y.getStartOffset()+n,z=null;if(w===this._matchingBracket)z=t;else switch(p){case 2:z=q;break;case 3:if(this.whitespacesVisible){this._parseString(y.getData(),
w,s,k);continue}else z=k;break;case 6:this._parseComment(y.getData(),w,s,i,p);continue;case 4:this._parseComment(y.getData(),w,s,f,p);continue;case 5:this._parseComment(y.getData(),w,s,g,p);continue;case 8:if(this.whitespacesVisible)z=r;break;case 9:if(this.whitespacesVisible)z=u;break}s.push({start:w,end:y.getOffset()+n,style:z})}},_parseComment:function(p,n,s,y,w){var z=this._commentScanner;z.setText(p);for(z.setType(w);p=z.nextToken();){w=z.getStartOffset()+n;var B=y;switch(p){case 8:if(this.whitespacesVisible)B=
r;break;case 9:if(this.whitespacesVisible)B=u;break;case 10:B=j;break;case 11:B=h;break;case 12:B=l;break;default:if(this.detectHyperlinks)B=this._detectHyperlinks(z.getData(),w,s,B)}B&&s.push({start:w,end:z.getOffset()+n,style:B})}},_parseString:function(p,n,s,y){var w=this._whitespaceScanner;for(w.setText(p);p=w.nextToken();){var z=w.getStartOffset()+n,B=y;switch(p){case 8:if(this.whitespacesVisible)B=r;break;case 9:if(this.whitespacesVisible)B=u;break}B&&s.push({start:z,end:w.getOffset()+n,style:B})}},
_detectHyperlinks:function(p,n,s,y){var w=null,z;if((z=p.indexOf("://"))>0){w=p;for(var B=z;B>0;){z=w.charCodeAt(B-1);if(!(97<=z&&z<=122||65<=z&&z<=90||45===z||48<=z&&z<=57))break;B--}if(B>0){z="\"\"''(){}[]<>".indexOf(w.substring(B-1,B));if(z!==-1&&(z&1)===0&&(z=w.lastIndexOf("\"\"''(){}[]<>".substring(z+1,z+2)))!==-1){var D=z;z=this._clone(y);z.tagName="A";z.attributes={href:w.substring(B,D)};s.push({start:n,end:n+B,style:y});s.push({start:n+B,end:n+D,style:z});s.push({start:n+D,end:n+p.length,
style:y});return null}}}else if(p.toLowerCase().indexOf("bug#")===0)w="https://bugs.eclipse.org/bugs/show_bug.cgi?id="+parseInt(p.substring(4),10);if(w){z=this._clone(y);z.tagName="A";z.attributes={href:w};return z}return y},_clone:function(p){if(!p)return p;var n={};for(var s in p)if(p.hasOwnProperty(s))n[s]=p[s];return n},_findComments:function(p,n){n=n||0;var s=this._firstScanner;s.setText(p);for(var y=[];p=s.nextToken();){if(p===5||p===6){var w={start:s.getStartOffset()+n,end:s.getOffset()+n,
type:p};y.push(w);this._computeTasks(p,s.getStartOffset()+n,s.getOffset()+n)}p===4&&this._computeTasks(p,s.getStartOffset()+n,s.getOffset()+n)}return y},_findMatchingBracket:function(p,n){if(p.getBaseModel)p=p.getBaseModel();var s="{}()[]<>",y=p.getText(n,n+1),w=s.indexOf(y,0);if(w===-1)return-1;var z;z=w&1?s.substring(w-1,w):s.substring(w+1,w+2);var B=p.getLineAtOffset(n);s=p.getLine(B);var D=p.getLineStart(B),E=p.getLineEnd(B);s=this._findBrackets(y,z,s,D,D,E);for(E=0;E<s.length;E++){D=s[E]>=0?
1:-1;if(s[E]*D===n){n=1;if(w&1){for(E--;E>=0;E--){D=s[E]>=0?1:-1;n+=D;if(n===0)return s[E]*D}for(B-=1;B>=0;){s=p.getLine(B);D=p.getLineStart(B);E=p.getLineEnd(B);s=this._findBrackets(y,z,s,D,D,E);for(w=s.length-1;w>=0;w--){D=s[w]>=0?1:-1;n+=D;if(n===0)return s[w]*D}B--}}else{for(E++;E<s.length;E++){D=s[E]>=0?1:-1;n+=D;if(n===0)return s[E]*D}B+=1;for(w=p.getLineCount();B<w;){s=p.getLine(B);D=p.getLineStart(B);E=p.getLineEnd(B);s=this._findBrackets(y,z,s,D,D,E);for(E=0;E<s.length;E++){D=s[E]>=0?1:-1;
n+=D;if(n===0)return s[E]*D}B++}}break}}return-1},_findBrackets:function(p,n,s,y,w,z){var B=[];p=p.charCodeAt(0);n=n.charCodeAt(0);for(var D=w,E=this._scanner,F,I=this.comments,L=this._binarySearch(I,w,true);L<I.length;L++){if(I[L].start>=z)break;F=I[L].start;var M=I[L].end;if(D<F)for(E.setText(s.substring(D-w,F-w));F=E.nextToken();)if(F===p)B.push(E.getStartOffset()+D-w+y);else F===n&&B.push(-(E.getStartOffset()+D-w+y));D=M}if(D<z)for(E.setText(s.substring(D-w,z-w));F=E.nextToken();)if(F===p)B.push(E.getStartOffset()+
D-w+y);else F===n&&B.push(-(E.getStartOffset()+D-w+y));return B},_onDestroy:function(){this.destroy()},_onLineStyle:function(p){if(p.textView===this.view)p.style=this._getLineStyle(p.lineIndex);p.ranges=this._getStyles(p.textView.getModel(),p.lineText,p.lineStart)},_onSelection:function(p){var n=p.oldValue,s=p.newValue;p=this.view;var y=p.getModel(),w;w=this._matchingBracket;if(w!==undefined){if(y.getBaseModel)w=y.mapOffset(w,true);w=y.getLineAtOffset(w);p.redrawLines(w,w+1);this._matchingBracket=
this._currentBracket=undefined}if(this.highlightCaretLine){var z=y.getLineAtOffset(n.start);w=y.getLineAtOffset(s.start);var B=s.start===s.end;n=n.start===n.end;if(!(z===w&&n&&B)){n&&p.redrawLines(z,z+1);if((z!==w||!n)&&B)p.redrawLines(w,w+1)}}if(!(s.start!==s.end||s.start===0)){s=p.getCaretOffset()-1;if(!(s<0)){n=s;if(y.getBaseModel)n=y.mapOffset(s);w=this._findMatchingBracket(y,n);if(w!==-1){this._currentBracket=n;this._matchingBracket=w;if(y.getBaseModel)w=y.mapOffset(w,true);w=y.getLineAtOffset(w);
p.redrawLines(w,w+1)}}}},_onModelChanged:function(p){var n=p.start,s=p.removedCharCount,y=p.addedCharCount-s;if(this._matchingBracket&&n<this._matchingBracket)this._matchingBracket+=y;if(this._currentBracket&&n<this._currentBracket)this._currentBracket+=y;var w=this.view;p=w.getModel();var z=p.getBaseModel?p.getBaseModel():p;s=n+s;var B=z.getCharCount(),D=this.comments.length,E=z.getLineStart(z.getLineAtOffset(n)),F=this._binarySearch(this.comments,E,true),I=this._binarySearch(this.comments,s,false,
F-1,D);if(F<D&&this.comments[F].start<=E&&E<this.comments[F].end){E=this.comments[F].start;if(E>n)E+=y}else E=E;var L;if(I<D){L=this.comments[I].end;if(L>n)L+=y;I+=1}else{I=D;L=B}var M;B=this._findComments(z.getText(E,L),E);for(D=F;D<this.comments.length;D++){M=this.comments[D];if(M.start>n)M.start+=y;if(M.start>n)M.end+=y}var R=I-F!==B.length;if(!R)for(D=0;D<B.length;D++){M=this.comments[F+D];var Q=B[D];if(M.start!==Q.start||M.end!==Q.end||M.type!==Q.type){R=true;break}}D=[F,I-F].concat(B);Array.prototype.splice.apply(this.comments,
D);if(R){D=E;M=L;if(p!==z){D=p.mapOffset(D,true);M=p.mapOffset(M,true)}w.redrawRange(D,M)}if(this.foldingEnabled&&z!==p&&this.annotationModel){w=this.annotationModel;F=w.getAnnotations(E,L);E=[];for(L=[];F.hasNext();){M=F.next();if(M.type==="orion.annotation.folding"){L.push(M);for(D=0;D<B.length;D++)if(M.start===B[D].start&&M.end===B[D].end)break;if(D===B.length){E.push(M);M.expand()}else{D=M.start;I=M.end;if(D>n)D-=y;if(I>n)I-=y;if(D<=n&&n<I&&D<=s&&s<I){D=z.getLineAtOffset(M.start);I=z.getLineAtOffset(M.end);
if(D!==I){if(!M.expanded){M.expand();w.modifyAnnotation(M)}}else w.removeAnnotation(M)}}}}n=[];for(D=0;D<B.length;D++){M=B[D];for(y=0;y<L.length;y++)if(L[y].start===M.start&&L[y].end===M.end)break;if(y===L.length)(M=this._createFoldingAnnotation(p,z,M.start,M.end))&&n.push(M)}w.replaceAnnotations(E,n)}}};return e}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("examples/textview/textStyler",[],function(){return examples.textview});
define("orion/compare/compare-container",["require","dojo","orion/compare/diff-parser","orion/compare/rulers","orion/compare/compare-model","orion/compare/compare-m-model","orion/editor/contentAssist","orion/editorCommands","orion/editor/editor","orion/editor/editorFeatures","orion/globalCommands","orion/breadcrumbs","orion/compare/gap-model","orion/commands","orion/textview/textModel","orion/textview/textView","examples/textview/textStyler","orion/compare/compareUtils"],function(e,d,a,c,f,g,i,j,
l,h,k,q,u,r,t,v,A,x){var m={};m.CompareContainer=function(){function o(){this._diffParser=new a.DiffParser;this._input=this._diff=null}o.prototype={_getLineDelim:function(){return"\n"},setDiffProvider:function(p){this._diffProvider=p},getFileDiff:function(p,n,s,y){var w=this;this._diffProvider.getDiffContent(p).then(function(z){w._diff=w._conflict?z.split("diff --git")[1]:z;y?w.setEditor(this._input,w._diff,y):w.getFileURI(p,n,s)},s)},getFileURI:function(p,n,s){var y=this;this._diffProvider.getDiffFileURI(p).then(function(w){y._oldFileURI=
w.Old;y._newFileURI=w.New;y.getFileContent(w.Old,s);n&&n(w.New,w.Old)},s)},getFileContent:function(p,n){var s=this;s._registry.getService("orion.core.file").then(function(y){y.read(p).then(function(w){this._input=w;s.setEditor(w,s._diff)},function(w,z){if(w.status===404){this._input="";s.setEditor("",s._diff)}else n&&n(w,z)})})},parseMapper:function(p,n,s,y){var w=this._getLineDelim(p,n);this._diffParser.setLineDelim(w);p=this._diffParser.parse(p,n,s,y);n=this._diffParser.getDiffArray();return{delim:w,
mapper:p.mapper,output:p.outPutFile,diffArray:n}},resolveDiff:function(p,n,s,y){this._diffURI=p;this.getFileDiff(this._diffURI,n,s,y)},resolveDiffonSave:function(){this.getFileDiff(this._diffURI,null,null,true)},_initDiffPosition:function(p){var n=p.getModel();if(n&&n.getAnnotations){n=n.getAnnotations();if(n.length>0){n=n[0][0];var s=p.getLineHeight(),y=p.getClientArea();s=Math.floor(y.height/s/3);p.setTopIndex(n-s>0?n-s:0)}}}};return o}();m.CompareSyntaxHighlighter=function(){function o(){this.styler=
null}o.prototype={highlight:function(p,n){if(this.styler){this.styler.destroy();this.styler=null}if(p){p=p.split(".");if(p.length>0)switch(p.pop().toLowerCase()){case "js":this.styler=new A.TextStyler(n,"js");break;case "java":this.styler=new A.TextStyler(n,"java");break;case "html":break;case "xml":break;case "css":this.styler=new A.TextStyler(n,"css");break}}}};return o}();m.DiffStyler=function(){function o(p,n){this._compareMatchRenderer=p;this._textView=n}o.prototype={highlight:function(p){this._textView&&
this._textView.removeEventListener("LineStyle",this,this._onLineStyle);if(p)this._textView=p;this._textView&&!this._textView.getModel().isMapperEmpty()&&this._textView.addEventListener("LineStyle",this,this._onLineStyle)},_onLineStyle:function(p){var n=this._textView,s=p.lineIndex,y=n.getModel().getLineType(s);s=y.type;var w=x.getAnnotationIndexByMapper(n.getModel().getAnnotations(),y.mapperIndex).current;n=x.isMapperConflict(n.getModel().getMapper(),y.mapperIndex);w=w===this._compareMatchRenderer.getCurrentAnnotationIndex();
if(s==="top-only"){s=w?"url('"+e.toUrl("images/diff-border-sel.png")+"')":"url('"+e.toUrl("images/diff-border.png")+"')";p.style={style:{backgroundImage:s,backgroundRepeat:"repeat-x"}}}else if(s!=="unchanged")p.style={styleClass:w?n?"diffConflictSelect":"diffNormalSelect":n?"diffConflict":"diffNormal"}}};return o}();m.CompareMergeStyler=function(){function o(p){this._syntaxHighlither=new m.CompareSyntaxHighlighter;this._diffHighlither=new m.DiffStyler(p)}o.prototype={highlight:function(p,n){this._syntaxHighlither.highlight(p,
n);this._diffHighlither.highlight(n)}};return o}();m.CompareMergeContainer=function(){function o(p,n,s,y,w,z,B){this.setDiffProvider(s);this._uiFactory=B;this.readonly=p;this._conflict=n;this._registry=y;this._commandService=w;this._leftEditorDivId=this._uiFactory.getEditorParentDivId(true);this._fileClient=z;this._rightEditorDivId=this._uiFactory.getEditorParentDivId(false);this.initCommands();var D=this;this._inputManager={filePath:"",getInput:function(){return this.filePath},setDirty:function(E){if(E)this._lastTitle&&
this._lastTitle.charAt(0)!=="*"&&this.setTitle("*"+this._lastTitle);else this._lastTitle&&this._lastTitle.charAt(0)==="*"&&this.setTitle(this._lastTitle.substring(1))},getFileMetadata:function(){return this._fileMetadata},setInput:function(E){z.read(E,true).then(d.hitch(this,function(F){this._fileMetadata=F;this.setTitle(F.Location)}),d.hitch(this,function(F){console.error("Error loading file metadata: "+F.message);this.setTitle(E)}));this.lastFilePath=E},setTitle:function(E){var F=E.lastIndexOf("/"),
I=E;if(F!==-1){I="Compare "+I.substring(F+1);if(E.charAt(0)==="*")I="*"+I}this._lastTitle=I;window.document.title=I;if(F=d.byId("location")){d.empty(F);new q.BreadCrumbs({container:"location",resource:this._fileMetadata});if(E.charAt(0)==="*")d.create("b",null,F,"last").innerHTML="*"}},afterSave:function(){D.resolveDiffonSave()}};this._compareMatchRenderer=new c.CompareMatchRenderer(document.getElementById(this._uiFactory.getDiffCanvasDivId()));this._highlighter=[];this._highlighter.push(new m.CompareMergeStyler(this._compareMatchRenderer));
this._highlighter.push(new m.CompareMergeStyler(this._compareMatchRenderer));this.initEditorContainers("\n","fetching...","fetching...",[])}o.prototype=new m.CompareContainer;o.prototype.initEditorContainers=function(p,n,s,y,w,z,B){this._editorLeft=this.createEditorContainer(n,p,y,0,this._leftEditorDivId,this._uiFactory.getStatusDivId(true),this.readonly,w,z);k.generateDomCommandsInBanner(this._commandService,this._editorLeft,"pageActions",true);this._textViewLeft=this._editorLeft.getTextView();this._editorRight=
this.createEditorContainer(s,p,y,1,this._rightEditorDivId,this._uiFactory.getStatusDivId(false),true,w,B);this._textViewRight=this._editorRight.getTextView();var D=this;p=new c.CompareMergeOverviewRuler("right",{styleClass:"ruler_overview"},D._compareMatchRenderer.getAnnotation(),function(F){D._compareMatchRenderer.matchPositionFromAnnotation(F)});this._textViewRight.addRuler(p);this._compareMatchRenderer.setOverviewRuler(p);var E=this;window.onbeforeunload=function(){if(E._editorLeft.isDirty())return"There are unsaved changes."}};
o.prototype.initCommands=function(){var p=this,n=new r.Command({name:"Next Diff",imageClass:"core-sprite-move_down",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",callback:function(){p.nextDiff()}}),s=new r.Command({name:"Previous Diff",imageClass:"core-sprite-move_up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",callback:function(){p.prevDiff()}}),y=new r.Command({name:"Copy Current Change From Right to left",imageClass:"core-sprite-leftarrow",id:"orion.compare.copyToLeft",
groupId:"orion.compareGroup",callback:function(){p.copyToLeft()}});this._commandService.addCommand(s,"dom");this._commandService.addCommand(n,"dom");this._commandService.addCommand(y,"dom");this._commandService.registerCommandContribution("orion.compare.prevDiff",3,"rightContainerCommands");this._commandService.registerCommandContribution("orion.compare.nextDiff",2,"rightContainerCommands");this.readonly||this._commandService.registerCommandContribution("orion.compare.copyToLeft",1,"rightContainerCommands");
this._commandService.renderCommands("rightContainerCommands","dom",p,p,"image")};o.prototype.nextDiff=function(){this._compareMatchRenderer.nextDiff()};o.prototype.prevDiff=function(){this._compareMatchRenderer.prevDiff()};o.prototype.copyToLeft=function(){this._compareMatchRenderer.copyToLeft()};o.prototype.createEditorContainer=function(p,n,s,y,w,z,B,D,E){var F=d.byId(w),I=this;p=new t.TextModel(p,n);var L=new g.CompareMergeModel(p,{mapper:s,columnIndex:y}),M="";s=B?new h.UndoFactory:new j.UndoCommandFactory(I._registry,
I._commandService,"pageActions");s=new l.Editor({textViewFactory:function(){return new v.TextView({parent:F,model:L,readonly:B,stylesheet:e.toUrl("orion/compare/editor.css"),tabSize:4})},undoStackFactory:s,contentAssistFactory:function(Q){return new i.ContentAssist(Q,"contentassist")},keyBindingFactory:function(Q,S,aa,C){if(!B){(new j.EditorCommandFactory(I._registry,I._commandService,I._fileClient,I._inputManager,"pageActions")).generateEditorCommands(Q);var G=new h.TextActions(Q,aa);S.push(G);Q=
new h.SourceCodeActions(Q,aa,C);S.push(Q)}},statusReporter:function(Q,S){if(z){M=S?"ERROR: "+Q:Q;d.byId(z).innerHTML=""+M}},domNode:F});s.installTextView();if(!B){inputManager=this._inputManager;d.connect(s,"onDirtyChange",inputManager,inputManager.setDirty)}var R=s.getTextView();if(D&&E){D=E.split("?")[0];s.onInputChange(D);this._highlighter[y].highlight(D,s)}R.addRuler(new c.LineNumberCompareRuler(0,"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},{styleClass:"ruler_lines_even"}));
R.addEventListener("Selection",this,function(){var Q=R.getModel().getLineAtOffset(R.getCaretOffset());Q=x.lookUpMapper(R.getModel().getMapper(),y,Q).mapperIndex;Q=x.getAnnotationIndexByMapper(R.getModel().getAnnotations(),Q);Q.current!==-1&&I._compareMatchRenderer.gotoDiff(Q.current)});if(y===0){R.getModel().addListener(I._compareMatchRenderer);R.addEventListener("Scroll",window,function(){if(I._compareMatchRenderer){I._compareMatchRenderer.matchPositionFrom(true);I._compareMatchRenderer.render()}})}else R.addEventListener("Scroll",
window,function(){I._compareMatchRenderer&&I._compareMatchRenderer.render()});return s};o.prototype.setEditor=function(p,n,s){n=this.parseMapper(p,n,this._conflict,s);if(this._editorLeft)if(s){this._textViewLeft.getModel().init(n.mapper);this._textViewRight.getModel().init(n.mapper);this._textViewLeft.redrawRange();this._textViewRight.redrawRange()}else{this._inputManager.filePath=this._newFileURI;this._textViewLeft.getModel().init(n.mapper);this._textViewRight.getModel().init(n.mapper);s=this._oldFileURI.split("?")[0];
this._editorRight.onInputChange(s,null,p);this._highlighter[1].highlight(s,this._textViewRight);p=this._newFileURI.split("?")[0];this._editorLeft.onInputChange(p,null,n.output);this._highlighter[0].highlight(p,this._textViewLeft);this.readonly||this._inputManager.setInput(p,this._editorLeft)}else this.initEditorContainers(n.delim,n.output,p,n.mapper,true,this._newFileURI,this._oldFileURI);this._compareMatchRenderer.init(n.mapper,this._textViewLeft,this._textViewRight);this._compareMatchRenderer.matchPositionFromAnnotation(-1)};
return o}();m.InlineCompareContainer=function(){function o(p,n,s){this._annotation=new c.CompareAnnotation;this.setDiffProvider(p);this._registry=n;this._editorDivId=s;this.initEditorContainers("","\n",[],[]);this.hasContent=false}o.prototype=new m.CompareContainer;o.prototype.addRulers=function(){if(this._textView&&!this._hasRuler){this._textView.addRuler(this._rulerOrigin);this._textView.addRuler(this._rulerNew);this._textView.addRuler(this._overview);this._hasRuler=true}};o.prototype.removeRulers=
function(){if(this._textView&&this._hasRuler){this._textView.removeRuler(this._rulerOrigin);this._textView.removeRuler(this._rulerNew);this._textView.removeRuler(this._overview);this._hasRuler=false}};o.prototype.destroyEditor=function(){if(this._textView){this._textView.getModel().init([],[]);this._textView.setText("");this.removeRulers()}this.hasContent=false};o.prototype.createEditorContainer=function(p,n,s,y,w,z){var B=d.byId(this._editorDivId);p=new t.TextModel(p,n);var D=new f.CompareTextModel(p,
{mapper:s,columnIndex:0},new f.DiffLineFeeder(y,n));n=new h.UndoFactory;n=new l.Editor({textViewFactory:function(){return new v.TextView({parent:B,model:D,readonly:true,stylesheet:e.toUrl("orion/compare/editor.css"),tabSize:4})},undoStackFactory:n,keyBindingFactory:function(){},statusReporter:function(){},domNode:B});n.installTextView();w&&z&&n.onInputChange(z.split("?")[0]);var E=n.getTextView();this._rulerOrigin=new c.LineNumberCompareRuler(1,"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},
{styleClass:"ruler_lines_even"});this._rulerNew=new c.LineNumberCompareRuler(0,"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},{styleClass:"ruler_lines_even"});var F=this;this._overview=new c.CompareMergeOverviewRuler("right",{styleClass:"ruler_overview"},F._annotation,function(I){F._annotation.matchPositionFromAnnotation(I);F.positionAnnotation(I)});E.addEventListener("LineStyle",this,this._onLineStyle);E.addEventListener("Selection",this,function(){var I=E.getModel().getLineAtOffset(E.getCaretOffset());
I=E.getModel().getLineType(I).mapperIndex;I=x.getAnnotationIndexByMapper(E.getModel().getAnnotations(),I);if(I.current!==-1){F._annotation.gotoDiff(I.current);I=E.getTopIndex();E.redrawRange();E.redrawLines(I,I+1,F._overview)}});return n};o.prototype.initEditorContainers=function(p,n,s,y,w){this._editor=this.createEditorContainer(n,p,s,y,w);this._textView=this._editor.getTextView()};o.prototype._onLineStyle=function(p){var n=p.lineIndex,s=this._textView.getModel().getLineType(n);n=s.type;s=x.getAnnotationIndexByMapper(this._textView.getModel().getAnnotations(),
s.mapperIndex).current;if(n==="added")p.style=s===this._annotation.getCurrentAnnotationIndex()?{styleClass:"diffInlineAddedSelect"}:{styleClass:"diffInlineAdded"};else if(n==="removed")p.style=s===this._annotation.getCurrentAnnotationIndex()?{styleClass:"diffInlineRemovedSelect"}:{styleClass:"diffInlineRemoved"}};o.prototype.setEditor=function(p,n){this.hasContent=true;n=this.parseMapper(p,n,false,true);if(this._textView){this.addRulers();this._textView.getModel().init([],[]);this._textView.setText("");
this._textView.getModel().init(n.mapper,n.diffArray);this._textView.setText(p);this._annotation.init(n.mapper,this._textView)}else this.initEditorContainers(n.delim,p,n.mapper,n.diffArray,true,this._newFileURI);this._initDiffPosition(this._textView)};o.prototype.nextDiff=function(){this._annotation.nextDiff();this.positionAnnotation(this._textView.getModel().getAnnotations()[this._annotation.getCurrentAnnotationIndex()][0])};o.prototype.setConflicting=function(p){this._conflcit=p};o.prototype.prevDiff=
function(){this._annotation.prevDiff();this.positionAnnotation(this._textView.getModel().getAnnotations()[this._annotation.getCurrentAnnotationIndex()][0])};o.prototype.positionAnnotation=function(p){if(this._textView){var n=this._textView.getLineHeight(),s=this._textView.getClientArea();n=Math.floor(s.height/n/3);this._textView.setTopIndex(p-n>0?p-n:0);this._textView.redrawRange();p=this._textView.getTopIndex();this._textView.redrawLines(p,p+1,this._overview)}};return o}();return m});
define("text!dijit/templates/TreeNode.html",function(){return'<div class="dijitTreeNode" role="presentation"\n\t><div dojoAttachPoint="rowNode" class="dijitTreeRow" role="presentation" dojoAttachEvent="onmouseenter:_onMouseEnter, onmouseleave:_onMouseLeave, onclick:_onClick, ondblclick:_onDblClick"\n\t\t><img src="${_blankGif}" alt="" dojoAttachPoint="expandoNode" class="dijitTreeExpando" role="presentation"\n\t\t/><span dojoAttachPoint="expandoNodeText" class="dijitExpandoText" role="presentation"\n\t\t></span\n\t\t><span dojoAttachPoint="contentNode"\n\t\t\tclass="dijitTreeContent" role="presentation">\n\t\t\t<img src="${_blankGif}" alt="" dojoAttachPoint="iconNode" class="dijitIcon dijitTreeIcon" role="presentation"\n\t\t\t/><span dojoAttachPoint="labelNode" class="dijitTreeLabel" role="treeitem" tabindex="-1" aria-selected="false" dojoAttachEvent="onfocus:_onLabelFocus"></span>\n\t\t</span\n\t></div>\n\t<div dojoAttachPoint="containerNode" class="dijitTreeContainer" role="presentation" style="display: none;"></div>\n</div>'});
define("text!dijit/templates/Tree.html",function(){return'<div class="dijitTree dijitTreeContainer" role="tree"\n\tdojoAttachEvent="onkeypress:_onKeyPress">\n\t<div class="dijitInline dijitTreeIndent" style="position: absolute; top: -9999px" dojoAttachPoint="indentDetector"></div>\n</div>'});
define("dijit/tree/TreeStoreModel",["dojo","dijit"],function(e,d){e.declare("dijit.tree.TreeStoreModel",null,{store:null,childrenAttrs:["children"],newItemIdAttr:"id",labelAttr:"",root:null,query:null,deferItemLoadingUntilExpand:false,constructor:function(a){e.mixin(this,a);this.connects=[];a=this.store;if(!a.getFeatures()["dojo.data.api.Identity"])throw new Error("dijit.Tree: store must support dojo.data.Identity");if(a.getFeatures()["dojo.data.api.Notification"])this.connects=this.connects.concat([e.connect(a,
"onNew",this,"onNewItem"),e.connect(a,"onDelete",this,"onDeleteItem"),e.connect(a,"onSet",this,"onSetItem")])},destroy:function(){e.forEach(this.connects,e.disconnect)},getRoot:function(a,c){this.root?a(this.root):this.store.fetch({query:this.query,onComplete:e.hitch(this,function(f){if(f.length!=1)throw new Error(this.declaredClass+": query "+e.toJson(this.query)+" returned "+f.length+" items, but must return exactly one item");this.root=f[0];a(this.root)}),onError:c})},mayHaveChildren:function(a){return e.some(this.childrenAttrs,
function(c){return this.store.hasAttribute(a,c)},this)},getChildren:function(a,c,f){var g=this.store;if(g.isItemLoaded(a)){for(var i=[],j=0;j<this.childrenAttrs.length;j++){var l=g.getValues(a,this.childrenAttrs[j]);i=i.concat(l)}var h=0;this.deferItemLoadingUntilExpand||e.forEach(i,function(q){g.isItemLoaded(q)||h++});h==0?c(i):e.forEach(i,function(q,u){g.isItemLoaded(q)||g.loadItem({item:q,onItem:function(r){i[u]=r;--h==0&&c(i)},onError:f})})}else{var k=e.hitch(this,arguments.callee);g.loadItem({item:a,
onItem:function(q){k(q,c,f)},onError:f})}},isItem:function(a){return this.store.isItem(a)},fetchItemByIdentity:function(a){this.store.fetchItemByIdentity(a)},getIdentity:function(a){return this.store.getIdentity(a)},getLabel:function(a){return this.labelAttr?this.store.getValue(a,this.labelAttr):this.store.getLabel(a)},newItem:function(a,c,f){var g={parent:c,attribute:this.childrenAttrs[0]},i;if(this.newItemIdAttr&&a[this.newItemIdAttr])this.fetchItemByIdentity({identity:a[this.newItemIdAttr],scope:this,
onItem:function(j){if(j)this.pasteItem(j,null,c,true,f);else(i=this.store.newItem(a,g))&&f!=undefined&&this.pasteItem(i,c,c,false,f)}});else(i=this.store.newItem(a,g))&&f!=undefined&&this.pasteItem(i,c,c,false,f)},pasteItem:function(a,c,f,g,i){var j=this.store,l=this.childrenAttrs[0];c&&e.forEach(this.childrenAttrs,function(k){if(j.containsValue(c,k,a)){if(!g){var q=e.filter(j.getValues(c,k),function(u){return u!=a});j.setValues(c,k,q)}l=k}});if(f)if(typeof i=="number"){var h=j.getValues(f,l).slice();
h.splice(i,0,a);j.setValues(f,l,h)}else j.setValues(f,l,j.getValues(f,l).concat(a))},onChange:function(){},onChildrenChange:function(){},onDelete:function(){},onNewItem:function(a,c){c&&this.getChildren(c.item,e.hitch(this,function(f){this.onChildrenChange(c.item,f)}))},onDeleteItem:function(a){this.onDelete(a)},onSetItem:function(a,c){e.indexOf(this.childrenAttrs,c)!=-1?this.getChildren(a,e.hitch(this,function(f){this.onChildrenChange(a,f)})):this.onChange(a)}});return d.tree.TreeStoreModel});
define("dijit/tree/ForestStoreModel",["dojo","dijit","dijit/tree/TreeStoreModel"],function(e,d){e.declare("dijit.tree.ForestStoreModel",d.tree.TreeStoreModel,{rootId:"$root$",rootLabel:"ROOT",query:null,constructor:function(a){this.root={store:this,root:true,id:a.rootId,label:a.rootLabel,children:a.rootChildren}},mayHaveChildren:function(a){return a===this.root||this.inherited(arguments)},getChildren:function(a,c,f){if(a===this.root)this.root.children?c(this.root.children):this.store.fetch({query:this.query,
onComplete:e.hitch(this,function(g){this.root.children=g;c(g)}),onError:f});else this.inherited(arguments)},isItem:function(a){return a===this.root?true:this.inherited(arguments)},fetchItemByIdentity:function(a){if(a.identity==this.root.id){var c=a.scope?a.scope:e.global;a.onItem&&a.onItem.call(c,this.root)}else this.inherited(arguments)},getIdentity:function(a){return a===this.root?this.root.id:this.inherited(arguments)},getLabel:function(a){return a===this.root?this.root.label:this.inherited(arguments)},
newItem:function(a,c){if(c===this.root){this.onNewRootItem(a);return this.store.newItem(a)}else return this.inherited(arguments)},onNewRootItem:function(){},pasteItem:function(a,c,f,g,i){if(c===this.root)g||this.onLeaveRoot(a);d.tree.TreeStoreModel.prototype.pasteItem.call(this,a,c===this.root?null:c,f===this.root?null:f,g,i);f===this.root&&this.onAddToRoot(a)},onAddToRoot:function(a){console.log(this,": item ",a," added to root")},onLeaveRoot:function(a){console.log(this,": item ",a," removed from root")},
_requeryTop:function(){var a=this.root.children||[];this.store.fetch({query:this.query,onComplete:e.hitch(this,function(c){this.root.children=c;if(a.length!=c.length||e.some(a,function(f,g){return c[g]!=f}))this.onChildrenChange(this.root,c)})})},onNewItem:function(){this._requeryTop();this.inherited(arguments)},onDeleteItem:function(a){e.indexOf(this.root.children,a)!=-1&&this._requeryTop();this.inherited(arguments)},onSetItem:function(){this._requeryTop();this.inherited(arguments)}});return d.tree.ForestStoreModel});
define("dojo/dnd/Container",["dojo","dojo/dnd/common","dojo/parser"],function(e){e.declare("dojo.dnd.Container",null,{skipForm:false,constructor:function(d,a){this.node=e.byId(d);a||(a={});this.creator=a.creator||null;this.skipForm=a.skipForm;this.parent=a.dropParent&&e.byId(a.dropParent);this.map={};this.current=null;this.containerState="";e.addClass(this.node,"dojoDndContainer");a&&a._skipStartup||this.startup();this.events=[e.connect(this.node,"onmouseover",this,"onMouseOver"),e.connect(this.node,
"onmouseout",this,"onMouseOut"),e.connect(this.node,"ondragstart",this,"onSelectStart"),e.connect(this.node,"onselectstart",this,"onSelectStart")]},creator:function(){},getItem:function(d){return this.map[d]},setItem:function(d,a){this.map[d]=a},delItem:function(d){delete this.map[d]},forInItems:function(d,a){a=a||e.global;var c=this.map,f=e.dnd._empty;for(var g in c)g in f||d.call(a,c[g],g,this);return a},clearItems:function(){this.map={}},getAllNodes:function(){return e.query("> .dojoDndItem",this.parent)},
sync:function(){var d={};this.getAllNodes().forEach(function(a){if(a.id){var c=this.getItem(a.id);if(c){d[a.id]=c;return}}else a.id=e.dnd.getUniqueId();c=a.getAttribute("dndType");var f=a.getAttribute("dndData");d[a.id]={data:f||a.innerHTML,type:c?c.split(/\s*,\s*/):["text"]}},this);this.map=d;return this},insertNodes:function(d,a,c){if(this.parent.firstChild)if(a){if(!c)c=this.parent.firstChild}else{if(c)c=c.nextSibling}else c=null;if(c)for(a=0;a<d.length;++a){var f=this._normalizedCreator(d[a]);
this.setItem(f.node.id,{data:f.data,type:f.type});this.parent.insertBefore(f.node,c)}else for(a=0;a<d.length;++a){f=this._normalizedCreator(d[a]);this.setItem(f.node.id,{data:f.data,type:f.type});this.parent.appendChild(f.node)}return this},destroy:function(){e.forEach(this.events,e.disconnect);this.clearItems();this.node=this.parent=this.current=null},markupFactory:function(d,a){d._skipStartup=true;return new e.dnd.Container(a,d)},startup:function(){if(!this.parent){this.parent=this.node;if(this.parent.tagName.toLowerCase()==
"table"){var d=this.parent.getElementsByTagName("tbody");if(d&&d.length)this.parent=d[0]}}this.defaultCreator=e.dnd._defaultCreator(this.parent);this.sync()},onMouseOver:function(d){for(var a=d.relatedTarget;a;){if(a==this.node)break;try{a=a.parentNode}catch(c){a=null}}if(!a){this._changeState("Container","Over");this.onOverEvent()}a=this._getChildByEvent(d);if(this.current!=a){this.current&&this._removeItemClass(this.current,"Over");a&&this._addItemClass(a,"Over");this.current=a}},onMouseOut:function(d){for(d=
d.relatedTarget;d;){if(d==this.node)return;try{d=d.parentNode}catch(a){d=null}}if(this.current){this._removeItemClass(this.current,"Over");this.current=null}this._changeState("Container","");this.onOutEvent()},onSelectStart:function(d){if(!this.skipForm||!e.dnd.isFormElement(d))e.stopEvent(d)},onOverEvent:function(){},onOutEvent:function(){},_changeState:function(d,a){var c="dojoDnd"+d;d=d.toLowerCase()+"State";e.replaceClass(this.node,c+a,c+this[d]);this[d]=a},_addItemClass:function(d,a){e.addClass(d,
"dojoDndItem"+a)},_removeItemClass:function(d,a){e.removeClass(d,"dojoDndItem"+a)},_getChildByEvent:function(d){if(d=d.target)for(var a=d.parentNode;a;d=a,a=d.parentNode)if(a==this.parent&&e.hasClass(d,"dojoDndItem"))return d;return null},_normalizedCreator:function(d,a){d=(this.creator||this.defaultCreator).call(this,d,a);if(!e.isArray(d.type))d.type=["text"];if(!d.node.id)d.node.id=e.dnd.getUniqueId();e.addClass(d.node,"dojoDndItem");return d}});e.dnd._createNode=function(d){if(!d)return e.dnd._createSpan;
return function(a){return e.create(d,{innerHTML:a})}};e.dnd._createTrTd=function(d){var a=e.create("tr");e.create("td",{innerHTML:d},a);return a};e.dnd._createSpan=function(d){return e.create("span",{innerHTML:d})};e.dnd._defaultCreatorNodes={ul:"li",ol:"li",div:"div",p:"div"};e.dnd._defaultCreator=function(d){d=d.tagName.toLowerCase();var a=d=="tbody"||d=="thead"?e.dnd._createTrTd:e.dnd._createNode(e.dnd._defaultCreatorNodes[d]);return function(c,f){var g=c&&e.isObject(c),i;if(g&&c.tagName&&c.nodeType&&
c.getAttribute){i=c.getAttribute("dndData")||c.innerHTML;g=(g=c.getAttribute("dndType"))?g.split(/\s*,\s*/):["text"];c=c}else{i=g&&c.data?c.data:c;g=g&&c.type?c.type:["text"];c=(f=="avatar"?e.dnd._createSpan:a)(String(i))}if(!c.id)c.id=e.dnd.getUniqueId();return{node:c,data:i,type:g}}};return e.dnd.Container});
define("dijit/tree/_dndContainer",["dojo","dijit","dojo/dnd/common","dojo/dnd/Container"],function(e,d){e.getObject("tree",true,e);d.tree._compareNodes=function(a,c){if(a===c)return 0;if("sourceIndex"in document.documentElement)return a.sourceIndex-c.sourceIndex;else if("compareDocumentPosition"in document.documentElement)return a.compareDocumentPosition(c)&2?1:-1;else if(document.createRange){var f=doc.createRange();f.setStartBefore(a);a=doc.createRange();a.setStartBefore(c);return f.compareBoundaryPoints(f.END_TO_END,
a)}else throw Error("dijit.tree._compareNodes don't know how to compare two different nodes in this browser");};e.declare("dijit.tree._dndContainer",null,{constructor:function(a,c){this.tree=a;this.node=a.domNode;e.mixin(this,c);this.map={};this.current=null;this.containerState="";e.addClass(this.node,"dojoDndContainer");this.events=[e.connect(this.node,"onmouseenter",this,"onOverEvent"),e.connect(this.node,"onmouseleave",this,"onOutEvent"),e.connect(this.tree,"_onNodeMouseEnter",this,"onMouseOver"),
e.connect(this.tree,"_onNodeMouseLeave",this,"onMouseOut"),e.connect(this.node,"ondragstart",e,"stopEvent"),e.connect(this.node,"onselectstart",e,"stopEvent")]},getItem:function(a){return{data:this.selection[a],type:["treeNode"]}},destroy:function(){e.forEach(this.events,e.disconnect);this.node=this.parent=null},onMouseOver:function(a){this.current=a},onMouseOut:function(){this.current=null},_changeState:function(a,c){var f="dojoDnd"+a;a=a.toLowerCase()+"State";e.replaceClass(this.node,f+c,f+this[a]);
this[a]=c},_addItemClass:function(a,c){e.addClass(a,"dojoDndItem"+c)},_removeItemClass:function(a,c){e.removeClass(a,"dojoDndItem"+c)},onOverEvent:function(){this._changeState("Container","Over")},onOutEvent:function(){this._changeState("Container","")}});return d.tree._dndContainer});
define("dijit/tree/_dndSelector",["dojo","dijit","dojo/dnd/common","dijit/tree/_dndContainer"],function(e,d){e.declare("dijit.tree._dndSelector",d.tree._dndContainer,{constructor:function(){this.selection={};this.anchor=null;d.setWaiState(this.tree.domNode,"multiselect",!this.singular);this.events.push(e.connect(this.tree.domNode,"onmousedown",this,"onMouseDown"),e.connect(this.tree.domNode,"onmouseup",this,"onMouseUp"),e.connect(this.tree.domNode,"onmousemove",this,"onMouseMove"))},singular:false,
getSelectedTreeNodes:function(){var a=[],c=this.selection;for(var f in c)a.push(c[f]);return a},selectNone:function(){this.setSelection([]);return this},destroy:function(){this.inherited(arguments);this.selection=this.anchor=null},addTreeNode:function(a,c){this.setSelection(this.getSelectedTreeNodes().concat([a]));if(c)this.anchor=a;return a},removeTreeNode:function(a){this.setSelection(this._setDifference(this.getSelectedTreeNodes(),[a]));return a},isTreeNodeSelected:function(a){return a.id&&!!this.selection[a.id]},
setSelection:function(a){var c=this.getSelectedTreeNodes();e.forEach(this._setDifference(c,a),e.hitch(this,function(f){f.setSelected(false);this.anchor==f&&delete this.anchor;delete this.selection[f.id]}));e.forEach(this._setDifference(a,c),e.hitch(this,function(f){f.setSelected(true);this.selection[f.id]=f}));this._updateSelectionProperties()},_setDifference:function(a,c){e.forEach(c,function(f){f.__exclude__=true});a=e.filter(a,function(f){return!f.__exclude__});e.forEach(c,function(f){delete f.__exclude__});
return a},_updateSelectionProperties:function(){var a=this.getSelectedTreeNodes(),c=[],f=[];e.forEach(a,function(g){f.push(g);c.push(g.getTreePath())});a=e.map(f,function(g){return g.item});this.tree._set("paths",c);this.tree._set("path",c[0]||[]);this.tree._set("selectedNodes",f);this.tree._set("selectedNode",f[0]||null);this.tree._set("selectedItems",a);this.tree._set("selectedItem",a[0]||null)},onMouseDown:function(a){if(!(!this.current||this.tree.isExpandoNode(a.target,this.current)))if(a.button!=
e.mouseButtons.RIGHT){e.stopEvent(a);var c=this.current,f=e.isCopyKey(a),g=c.id;if(!this.singular&&!a.shiftKey&&this.selection[g])this._doDeselect=true;else{this._doDeselect=false;this.userSelect(c,f,a.shiftKey)}}},onMouseUp:function(a){if(this._doDeselect){this._doDeselect=false;this.userSelect(this.current,e.isCopyKey(a),a.shiftKey)}},onMouseMove:function(){this._doDeselect=false},userSelect:function(a,c,f){if(this.singular)if(this.anchor==a&&c)this.selectNone();else{this.setSelection([a]);this.anchor=
a}else if(f&&this.anchor){f=this.anchor;if(d.tree._compareNodes(this.anchor.rowNode,a.rowNode)<0){c=f;a=a}else{c=a;a=f}for(nodes=[];c!=a;){nodes.push(c);c=this.tree._getNextNode(c)}nodes.push(a);this.setSelection(nodes)}else if(this.selection[a.id]&&c)this.removeTreeNode(a);else if(c)this.addTreeNode(a,true);else{this.setSelection([a]);this.anchor=a}},forInSelectedItems:function(a,c){c=c||e.global;for(var f in this.selection)a.call(c,this.getItem(f),f,this)}});return d.tree._dndSelector});
define("dijit/Tree",["dojo","dijit","text!dijit/templates/TreeNode.html","text!dijit/templates/Tree.html","dojo/fx","dojo/DeferredList","dijit/_Widget","dijit/_Templated","dijit/_Container","dijit/_Contained","dijit/_CssStateMixin","dojo/cookie","dijit/tree/TreeStoreModel","dijit/tree/ForestStoreModel","dijit/tree/_dndSelector"],function(e,d){e.declare("dijit._TreeNode",[d._Widget,d._Templated,d._Container,d._Contained,d._CssStateMixin],{item:null,isTreeNode:true,label:"",isExpandable:null,isExpanded:false,
state:"UNCHECKED",templateString:e.cache("dijit","templates/TreeNode.html"),baseClass:"dijitTreeNode",cssStateNodes:{rowNode:"dijitTreeRow",labelNode:"dijitTreeLabel"},attributeMap:e.delegate(d._Widget.prototype.attributeMap,{label:{node:"labelNode",type:"innerText"},tooltip:{node:"rowNode",type:"attribute",attribute:"title"}}),buildRendering:function(){this.inherited(arguments);this._setExpando();this._updateItemClasses(this.item);this.isExpandable&&d.setWaiState(this.labelNode,"expanded",this.isExpanded);
this.setSelected(false)},_setIndentAttr:function(a){var c=Math.max(a,0)*this.tree._nodePixelIndent+"px";e.style(this.domNode,"backgroundPosition",c+" 0px");e.style(this.rowNode,this.isLeftToRight()?"paddingLeft":"paddingRight",c);e.forEach(this.getChildren(),function(f){f.set("indent",a+1)});this._set("indent",a)},markProcessing:function(){this.state="LOADING";this._setExpando(true)},unmarkProcessing:function(){this._setExpando(false)},_updateItemClasses:function(a){var c=this.tree,f=c.model;if(c._v10Compat&&
a===f.root)a=null;this._applyClassAndStyle(a,"icon","Icon");this._applyClassAndStyle(a,"label","Label");this._applyClassAndStyle(a,"row","Row")},_applyClassAndStyle:function(a,c,f){var g="_"+c+"Class";c=c+"Node";var i=this[g];this[g]=this.tree["get"+f+"Class"](a,this.isExpanded);e.replaceClass(this[c],this[g]||"",i||"");e.style(this[c],this.tree["get"+f+"Style"](a,this.isExpanded)||{})},_updateLayout:function(){var a=this.getParent();!a||a.rowNode.style.display=="none"?e.addClass(this.domNode,"dijitTreeIsRoot"):
e.toggleClass(this.domNode,"dijitTreeIsLast",!this.getNextSibling())},_setExpando:function(a){var c=["dijitTreeExpandoLoading","dijitTreeExpandoOpened","dijitTreeExpandoClosed","dijitTreeExpandoLeaf"],f=["*","-","+","*"];a=a?0:this.isExpandable?this.isExpanded?1:2:3;e.replaceClass(this.expandoNode,c[a],c);this.expandoNodeText.innerHTML=f[a]},expand:function(){if(this._expandDeferred)return this._expandDeferred;this._wipeOut&&this._wipeOut.stop();this.isExpanded=true;d.setWaiState(this.labelNode,"expanded",
"true");if(this.tree.showRoot||this!==this.tree.rootNode)d.setWaiRole(this.containerNode,"group");e.addClass(this.contentNode,"dijitTreeContentExpanded");this._setExpando();this._updateItemClasses(this.item);this==this.tree.rootNode&&d.setWaiState(this.tree.domNode,"expanded","true");var a,c=e.fx.wipeIn({node:this.containerNode,duration:d.defaultDuration,onEnd:function(){a.callback(true)}});a=this._expandDeferred=new e.Deferred(function(){c.stop()});c.play();return a},collapse:function(){if(this.isExpanded){if(this._expandDeferred){this._expandDeferred.cancel();
delete this._expandDeferred}this.isExpanded=false;d.setWaiState(this.labelNode,"expanded","false");this==this.tree.rootNode&&d.setWaiState(this.tree.domNode,"expanded","false");e.removeClass(this.contentNode,"dijitTreeContentExpanded");this._setExpando();this._updateItemClasses(this.item);if(!this._wipeOut)this._wipeOut=e.fx.wipeOut({node:this.containerNode,duration:d.defaultDuration});this._wipeOut.play()}},indent:0,setChildItems:function(a){var c=this.tree,f=c.model,g=[];e.forEach(this.getChildren(),
function(i){d._Container.prototype.removeChild.call(this,i)},this);this.state="LOADED";if(a&&a.length>0){this.isExpandable=true;e.forEach(a,function(i){var j=f.getIdentity(i),l=c._itemNodesMap[j],h;if(l)for(var k=0;k<l.length;k++)if(l[k]&&!l[k].getParent()){h=l[k];h.set("indent",this.indent+1);break}if(!h){h=this.tree._createTreeNode({item:i,tree:c,isExpandable:f.mayHaveChildren(i),label:c.getLabel(i),tooltip:c.getTooltip(i),dir:c.dir,lang:c.lang,indent:this.indent+1});if(l)l.push(h);else c._itemNodesMap[j]=
[h]}this.addChild(h);if(this.tree.autoExpand||this.tree._state(i))g.push(c._expandNode(h))},this);e.forEach(this.getChildren(),function(i){i._updateLayout()})}else this.isExpandable=false;this._setExpando&&this._setExpando(false);this._updateItemClasses(this.item);if(this==c.rootNode)if(a=this.tree.showRoot?this:this.getChildren()[0]){a.setFocusable(true);c.lastFocused=a}else c.domNode.setAttribute("tabIndex","0");return new e.DeferredList(g)},getTreePath:function(){for(var a=this,c=[];a&&a!==this.tree.rootNode;){c.unshift(a.item);
a=a.getParent()}c.unshift(this.tree.rootNode.item);return c},getIdentity:function(){return this.tree.model.getIdentity(this.item)},removeChild:function(){this.inherited(arguments);var a=this.getChildren();if(a.length==0){this.isExpandable=false;this.collapse()}e.forEach(a,function(c){c._updateLayout()})},makeExpandable:function(){this.isExpandable=true;this._setExpando(false)},_onLabelFocus:function(){this.tree._onNodeFocus(this)},setSelected:function(a){d.setWaiState(this.labelNode,"selected",a);
e.toggleClass(this.rowNode,"dijitTreeRowSelected",a)},setFocusable:function(a){this.labelNode.setAttribute("tabIndex",a?"0":"-1")},_onClick:function(a){this.tree._onClick(this,a)},_onDblClick:function(a){this.tree._onDblClick(this,a)},_onMouseEnter:function(a){this.tree._onNodeMouseEnter(this,a)},_onMouseLeave:function(a){this.tree._onNodeMouseLeave(this,a)}});e.declare("dijit.Tree",[d._Widget,d._Templated],{store:null,model:null,query:null,label:"",showRoot:true,childrenAttr:["children"],paths:[],
path:[],selectedItems:null,selectedItem:null,openOnClick:false,openOnDblClick:false,templateString:e.cache("dijit","templates/Tree.html"),persist:true,autoExpand:false,dndController:"dijit.tree._dndSelector",dndParams:["onDndDrop","itemCreator","onDndCancel","checkAcceptance","checkItemAcceptance","dragThreshold","betweenThreshold"],onDndDrop:null,itemCreator:null,onDndCancel:null,checkAcceptance:null,checkItemAcceptance:null,dragThreshold:5,betweenThreshold:0,_nodePixelIndent:19,_publish:function(a,
c){e.publish(this.id,[e.mixin({tree:this,event:a},c||{})])},postMixInProperties:function(){this.tree=this;if(this.autoExpand)this.persist=false;this._itemNodesMap={};if(!this.cookieName)this.cookieName=this.id+"SaveStateCookie";this._loadDeferred=new e.Deferred;this.inherited(arguments)},postCreate:function(){this._initState();this.model||this._store2model();this.connect(this.model,"onChange","_onItemChange");this.connect(this.model,"onChildrenChange","_onItemChildrenChange");this.connect(this.model,
"onDelete","_onItemDelete");this._load();this.inherited(arguments);if(this.dndController){if(e.isString(this.dndController))this.dndController=e.getObject(this.dndController);for(var a={},c=0;c<this.dndParams.length;c++)if(this[this.dndParams[c]])a[this.dndParams[c]]=this[this.dndParams[c]];this.dndController=new this.dndController(this,a)}},_store2model:function(){this._v10Compat=true;e.deprecated("Tree: from version 2.0, should specify a model object rather than a store/query");var a={id:this.id+
"_ForestStoreModel",store:this.store,query:this.query,childrenAttrs:this.childrenAttr};if(this.params.mayHaveChildren)a.mayHaveChildren=e.hitch(this,"mayHaveChildren");if(this.params.getItemChildren)a.getChildren=e.hitch(this,function(c,f,g){this.getItemChildren(this._v10Compat&&c===this.model.root?null:c,f,g)});this.model=new d.tree.ForestStoreModel(a);this.showRoot=Boolean(this.label)},onLoad:function(){},_load:function(){this.model.getRoot(e.hitch(this,function(a){var c=this.rootNode=this.tree._createTreeNode({item:a,
tree:this,isExpandable:true,label:this.label||this.getLabel(a),indent:this.showRoot?0:-1});if(!this.showRoot){c.rowNode.style.display="none";d.setWaiRole(this.domNode,"presentation");d.setWaiRole(c.labelNode,"presentation");d.setWaiRole(c.containerNode,"tree")}this.domNode.appendChild(c.domNode);a=this.model.getIdentity(a);if(this._itemNodesMap[a])this._itemNodesMap[a].push(c);else this._itemNodesMap[a]=[c];c._updateLayout();this._expandNode(c).addCallback(e.hitch(this,function(){this._loadDeferred.callback(true);
this.onLoad()}))}),function(a){console.error(this,": error loading root: ",a)})},getNodesByItem:function(a){if(!a)return[];return[].concat(this._itemNodesMap[e.isString(a)?a:this.model.getIdentity(a)])},_setSelectedItemAttr:function(a){this.set("selectedItems",[a])},_setSelectedItemsAttr:function(a){var c=this;this._loadDeferred.addCallback(e.hitch(this,function(){var f=e.map(a,function(i){return!i||e.isString(i)?i:c.model.getIdentity(i)}),g=[];e.forEach(f,function(i){g=g.concat(c._itemNodesMap[i]||
[])});this.set("selectedNodes",g)}))},_setPathAttr:function(a){return a.length?this.set("paths",[a]):this.set("paths",[])},_setPathsAttr:function(a){function c(i,j,l){var h=i.shift(),k=e.filter(j,function(q){return q.getIdentity()==h})[0];if(k)i.length?g._expandNode(k).addCallback(function(){c(i,k.getChildren(),l)}):l.callback(k);else l.errback("Could not expand path at "+h)}function f(i){g.set("selectedNodes",e.map(e.filter(i,function(j){return j[0]}),function(j){return j[1]}))}var g=this;return(new e.DeferredList(e.map(a,
function(i){var j=new e.Deferred;i=e.map(i,function(l){return e.isString(l)?l:g.model.getIdentity(l)});i.length?g._loadDeferred.addCallback(function(){c(i,[g.rootNode],j)}):j.errback("Empty path");return j}))).addCallback(f)},_setSelectedNodeAttr:function(a){this.set("selectedNodes",[a])},_setSelectedNodesAttr:function(a){this._loadDeferred.addCallback(e.hitch(this,function(){this.dndController.setSelection(a)}))},mayHaveChildren:function(){},getItemChildren:function(){},getLabel:function(a){return this.model.getLabel(a)},
getIconClass:function(a,c){return!a||this.model.mayHaveChildren(a)?c?"dijitFolderOpened":"dijitFolderClosed":"dijitLeaf"},getLabelClass:function(){},getRowClass:function(){},getIconStyle:function(){},getLabelStyle:function(){},getRowStyle:function(){},getTooltip:function(){return""},_onKeyPress:function(a){if(!a.altKey){var c=e.keys,f=d.getEnclosingWidget(a.target);if(f){var g=a.charOrCode;if(typeof g=="string"&&g!=" "){if(!a.altKey&&!a.ctrlKey&&!a.shiftKey&&!a.metaKey){this._onLetterKeyNav({node:f,
key:g.toLowerCase()});e.stopEvent(a)}}else{if(this._curSearch){clearTimeout(this._curSearch.timer);delete this._curSearch}var i=this._keyHandlerMap;if(!i){i={};i[c.ENTER]="_onEnterKey";i[c.SPACE]=i[" "]="_onEnterKey";i[this.isLeftToRight()?c.LEFT_ARROW:c.RIGHT_ARROW]="_onLeftArrow";i[this.isLeftToRight()?c.RIGHT_ARROW:c.LEFT_ARROW]="_onRightArrow";i[c.UP_ARROW]="_onUpArrow";i[c.DOWN_ARROW]="_onDownArrow";i[c.HOME]="_onHomeKey";i[c.END]="_onEndKey";this._keyHandlerMap=i}if(this._keyHandlerMap[g]){this[this._keyHandlerMap[g]]({node:f,
item:f.item,evt:a});e.stopEvent(a)}}}}},_onEnterKey:function(a){this._publish("execute",{item:a.item,node:a.node});this.dndController.userSelect(a.node,e.isCopyKey(a.evt),a.evt.shiftKey);this.onClick(a.item,a.node,a.evt)},_onDownArrow:function(a){(a=this._getNextNode(a.node))&&a.isTreeNode&&this.focusNode(a)},_onUpArrow:function(a){a=a.node;var c=a.getPreviousSibling();if(c)for(a=c;a.isExpandable&&a.isExpanded&&a.hasChildren();){a=a.getChildren();a=a[a.length-1]}else{c=a.getParent();!this.showRoot&&
c===this.rootNode||(a=c)}a&&a.isTreeNode&&this.focusNode(a)},_onRightArrow:function(a){a=a.node;if(a.isExpandable&&!a.isExpanded)this._expandNode(a);else if(a.hasChildren())(a=a.getChildren()[0])&&a.isTreeNode&&this.focusNode(a)},_onLeftArrow:function(a){a=a.node;if(a.isExpandable&&a.isExpanded)this._collapseNode(a);else(a=a.getParent())&&a.isTreeNode&&!(!this.showRoot&&a===this.rootNode)&&this.focusNode(a)},_onHomeKey:function(){var a=this._getRootOrFirstNode();a&&this.focusNode(a)},_onEndKey:function(){for(var a=
this.rootNode;a.isExpanded;){a=a.getChildren();a=a[a.length-1]}a&&a.isTreeNode&&this.focusNode(a)},multiCharSearchDuration:250,_onLetterKeyNav:function(a){var c=this._curSearch;if(c){c.pattern+=a.key;clearTimeout(c.timer)}else c=this._curSearch={pattern:a.key,startNode:a.node};var f=this;c.timer=setTimeout(function(){delete f._curSearch},this.multiCharSearchDuration);a=c.startNode;do(a=this._getNextNode(a))||(a=this._getRootOrFirstNode());while(a!==c.startNode&&a.label.toLowerCase().substr(0,c.pattern.length)!=
c.pattern);a&&a.isTreeNode&&a!==c.startNode&&this.focusNode(a)},isExpandoNode:function(a,c){return e.isDescendant(a,c.expandoNode)},_onClick:function(a,c){var f=this.isExpandoNode(c.target,a);if(this.openOnClick&&a.isExpandable||f)a.isExpandable&&this._onExpandoClick({node:a});else{this._publish("execute",{item:a.item,node:a,evt:c});this.onClick(a.item,a,c);this.focusNode(a)}e.stopEvent(c)},_onDblClick:function(a,c){var f=c.target;f=f==a.expandoNode||f==a.expandoNodeText;if(this.openOnDblClick&&a.isExpandable||
f)a.isExpandable&&this._onExpandoClick({node:a});else{this._publish("execute",{item:a.item,node:a,evt:c});this.onDblClick(a.item,a,c);this.focusNode(a)}e.stopEvent(c)},_onExpandoClick:function(a){a=a.node;this.focusNode(a);a.isExpanded?this._collapseNode(a):this._expandNode(a)},onClick:function(){},onDblClick:function(){},onOpen:function(){},onClose:function(){},_getNextNode:function(a){if(a.isExpandable&&a.isExpanded&&a.hasChildren())return a.getChildren()[0];else{for(;a&&a.isTreeNode;){var c=a.getNextSibling();
if(c)return c;a=a.getParent()}return null}},_getRootOrFirstNode:function(){return this.showRoot?this.rootNode:this.rootNode.getChildren()[0]},_collapseNode:function(a){a._expandNodeDeferred&&delete a._expandNodeDeferred;if(a.isExpandable)if(a.state!="LOADING"){a.collapse();this.onClose(a.item,a);if(a.item){this._state(a.item,false);this._saveState()}}},_expandNode:function(a,c){if(a._expandNodeDeferred&&!c)return a._expandNodeDeferred;c=this.model;var f=a.item,g=this;switch(a.state){case "UNCHECKED":a.markProcessing();
var i=a._expandNodeDeferred=new e.Deferred;c.getChildren(f,function(j){a.unmarkProcessing();j=a.setChildItems(j);var l=g._expandNode(a,true);j.addCallback(function(){l.addCallback(function(){i.callback()})})},function(j){console.error(g,": error loading root children: ",j)});break;default:i=a._expandNodeDeferred=a.expand();this.onOpen(a.item,a);if(f){this._state(f,true);this._saveState()}}return i},focusNode:function(a){d.focus(a.labelNode)},_onNodeFocus:function(a){if(a&&a!=this.lastFocused){this.lastFocused&&
!this.lastFocused._destroyed&&this.lastFocused.setFocusable(false);a.setFocusable(true);this.lastFocused=a}},_onNodeMouseEnter:function(){},_onNodeMouseLeave:function(){},_onItemChange:function(a){var c=this._itemNodesMap[this.model.getIdentity(a)];if(c){var f=this.getLabel(a),g=this.getTooltip(a);e.forEach(c,function(i){i.set({item:a,label:f,tooltip:g});i._updateItemClasses(a)})}},_onItemChildrenChange:function(a,c){(a=this._itemNodesMap[this.model.getIdentity(a)])&&e.forEach(a,function(f){f.setChildItems(c)})},
_onItemDelete:function(a){a=this.model.getIdentity(a);var c=this._itemNodesMap[a];if(c){e.forEach(c,function(f){this.dndController.removeTreeNode(f);var g=f.getParent();g&&g.removeChild(f);f.destroyRecursive()},this);delete this._itemNodesMap[a]}},_initState:function(){if(this.persist){var a=e.cookie(this.cookieName);this._openedItemIds={};a&&e.forEach(a.split(","),function(c){this._openedItemIds[c]=true},this)}},_state:function(a,c){if(!this.persist)return false;var f=this.model.getIdentity(a);if(arguments.length===
1)return this._openedItemIds[f];if(c)this._openedItemIds[f]=true;else delete this._openedItemIds[f]},_saveState:function(){if(this.persist){var a=[];for(var c in this._openedItemIds)a.push(c);e.cookie(this.cookieName,a.join(","),{expires:365})}},destroy:function(){if(this._curSearch){clearTimeout(this._curSearch.timer);delete this._curSearch}this.rootNode&&this.rootNode.destroyRecursive();this.dndController&&!e.isString(this.dndController)&&this.dndController.destroy();this.rootNode=null;this.inherited(arguments)},
destroyRecursive:function(){this.destroy()},resize:function(a){a&&e.marginBox(this.domNode,a);this._nodePixelIndent=e._getMarginSize(this.tree.indentDetector).w;if(this.tree.rootNode)this.tree.rootNode.set("indent",this.showRoot?0:-1)},_createTreeNode:function(a){return new d._TreeNode(a)}});return d.Tree});define("text!orion/widgets/templates/_ExplorerTreeNode.html",function(){return'<div class="dijitTreeNode" waiRole="presentation">\n\t<div dojoAttachPoint="rowNode" class="dijitTreeRow"\n\t\twaiRole="presentation"\n\t\tdojoAttachEvent="onmouseenter:_onMouseEnter, onmouseleave:_onMouseLeave, onclick:_onClick, ondblclick:_onDblClick">\n\t\t<img src="${_blankGif}" alt="" dojoAttachPoint="expandoNode" class="dijitTreeExpando" waiRole="presentation" />\n\t\t<span dojoAttachPoint="expandoNodeText" class="dijitExpandoText" waiRole="presentation"></span>\n\t\t<span dojoAttachPoint="contentNode" class="dijitTreeContent" waiRole="presentation">\n\t\t\t<img src="${_blankGif}" alt="" dojoAttachPoint="iconNode" class="dijitIcon dijitTreeIcon" waiRole="presentation" />\n\t\t\t<!-- labelNode\'s innerText will be label string --\>\n\t\t\t<span dojoAttachPoint="labelNode" class="dijitTreeLabel" wairole="treeitem" tabindex="-1" waiState="selected-false" dojoAttachEvent="onfocus:_onLabelFocus"></span>\n\t\t\t<a href="" dojoAttachPoint="followLink"><img src="${_blankGif}" alt="" dojoAttachPoint="followNode" class="dijitIcon dijitTreeIcon follow" waiRole="link"></a>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitTreeContainer"\n\t\twaiRole="presentation" style="display: none;">\n\t</div>\n</div>'});
define("orion/widgets/ExplorerTree",["dojo","dijit","dijit/Tree","text!orion/widgets/templates/_ExplorerTreeNode.html"],function(e,d){e.declare("orion.widgets._ExplorerTreeNode",[d._TreeNode],{templateString:e.cache("orion","widgets/templates/_ExplorerTreeNode.html"),_updateItemClasses:function(a){this.inherited(arguments);this._applyClassAndStyle(a,"follow","Follow");typeof this.tree.updateFollowLink==="function"&&this.tree.updateFollowLink(a,this.followLink)}});e.declare("orion.widgets.ExplorerTree",
[d.Tree],{selectedNodes:{},postCreate:function(){e.connect(this,"onMouseDown",this._eatSelectionEvent);e.connect(this.domNode,"onselectstart",this._eatSelectionEvent);this.inherited(arguments)},getFollowClass:function(){},getFollowStyle:function(){},updateFollowLink:function(){},onFollowClick:function(){},getSelectedItems:function(){var a=[];this._forEachSelectedNode(function(c,f){a.push(f.item)});return a},_getSelectedNodes:function(){var a=[];this._forEachSelectedNode(function(c,f){a.push(f)});
return a},_forEachSelectedNode:function(a){var c=this.selectedNodes;for(var f in c)c.hasOwnProperty(f)&&a(f,c[f])},_createTreeNode:function(a){return new orion.widgets._ExplorerTreeNode(a)},_eatSelectionEvent:function(a){if(e.isCopyKey(a)||a.shiftKey)e.stopEvent(a)},_onClick:function(a,c){var f=c.target,g=f===a.expandoNode||f===a.expandoNodeText;f=f===a.followNode;if(e.isCopyKey(c)){this._toggleSelectNode(a);this.focusNode(a)}else if(c.shiftKey){if(this.selectedNode){this._selectRange(this.selectedNode,
a);this.focusNode(a)}}else{if(f)this.onFollowClick(a.item,a,c);else if(this.openOnClick&&a.isExpandable||g)a.isExpandable&&this._onExpandoClick({node:a});else{this._publish("execute",{item:a.item,node:a,evt:c});this.onClick(a.item,a,c);this.focusNode(a)}!g&&!f&&this._selectNode(a)}f||e.stopEvent(c)},_onItemDelete:function(a){var c=this._itemNodesMap[this.model.getIdentity(a)];if(c){var f=this;e.forEach(c,function(g){f._removeFromSelection(g)})}this.inherited(arguments)},_getVisibleAncestor:function(a){if(!a)return null;
for(var c=a.getParent();c&&!(c.isExpandable&&c.isExpanded);){a=c;c=c.getParent()}return a},_toggleSelectNode:function(a){if(this.selectedNodes[a.get("id")]){a.setSelected(false);this._removeFromSelection(a)}else{a.setSelected(true);this._addToSelection(a)}},_addToSelection:function(a){this.selectedNodes[a.get("id")]=a},_removeFromSelection:function(a){delete this.selectedNodes[a.get("id")]},_selectRange:function(a,c){function f(j,l){var h=[];j=j;do{h.push(j);j=g._getNextNode(j)}while(j&&j!==l);if(j===
l){h.push(l);return h}return null}a=this._getVisibleAncestor(a);c=this._getVisibleAncestor(c);if(a&&c)if(a===c)this._selectNode(a);else{var g=this,i=f(a,c);if(i)this._selectNodes(i.reverse(),true);else(i=f(c,a))?this._selectNodes(i,true):console.debug("Warning: couldn't select range from "+a.label+" to "+c.label)}},_selectNode:function(a){this._selectNodes(a?[a]:null)},_selectNodes:function(a){this._forEachSelectedNode(function(g,i){i._destroyed||i.setSelected(false)});this.selectedNodes={};if(a)for(var c=
0;c<a.length;c++){var f=a[c];f.setSelected(true);this._addToSelection(f);this.selectedNode=f}}})});define("text!orion/widgets/templates/DirectoryPrompterDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t\t<div style="display: table">\n\t\t\t\t<div style="display: table-row" dojoAttachPoint="messageCell">\n\t\t\t\t\t<div style="display: table-cell;"><div style="width: 25em; padding-bottom: 5px;">${message}</div></div>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-row"> \n\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t\t<div dojoAttachPoint="treeContainerNode" id="${id}_treeContainerNode" dojoType="dijit.layout.BorderContainer" style="width:25em; height:25em; overflow:auto;" design="sidebar" gutters="true">\n\t\t\t\t\t\t\t<div dojoAttachPoint="treeContentPane" class="dijitDialogPaneContent" id="${id}_treeContentPane dojoType="dijit.layout.ContentPane" region="center" gutters="true">\n\t\t\t\t\t\t\t\t<div dojoAttachPoint="browseDirectoryExplorerTree" class="explorerTreeClass" id="${id}_browseDirectoryExplorerTree" style="margin-top: -3px;"></div> \n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t</div>\n\t\t\t\t</div> \n\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\n\t\t\t\t\t\t<button dojoAttachPoint="directoryBrowserButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">${buttonOk}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div> <!-- end table --\>\n\t</div> <!-- content pane --\>\n</div>'});
define("orion/widgets/DirectoryPrompterDialog",["dojo","dijit","orion/util","dijit/Dialog","dijit/form/Button","orion/widgets/ExplorerTree","orion/widgets/_OrionDialogMixin","text!orion/widgets/templates/DirectoryPrompterDialog.html"],function(e,d,a){e.declare("orion.widgets.DirectoryPrompterDialog",[d.Dialog,orion.widgets._OrionDialogMixin],{treeWidget:null,treeRoot:{},widgetsInTemplate:true,templateString:e.cache("orion","widgets/templates/DirectoryPrompterDialog.html"),constructor:function(){this.inherited(arguments);
this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);this.title=this.options.title||"Choose a Folder";this.buttonOk="OK";this.message=this.options.message||""},postCreate:function(){this.inherited(arguments);this.loadFolderList("");this.message||e.style(this.messageCell,{display:"none"})},loadFolderList:function(c){c=a.makeRelative(c);this.treeRoot.Path=c;this.options.fileClient.loadWorkspace(c).then(e.hitch(this,function(f){for(var g in f)this.treeRoot[g]=f[g];
a.processNavigatorParent(this.treeRoot,f.Children);this.createTree()}))},createTree:function(){var c=new orion.widgets.DirectoryTreeModel(this.options.serviceRegistry,this.treeRoot,this.options.fileClient);this.treeWidget=new orion.widgets.ExplorerTree({id:"treeWidget",style:"width:100%; height:100%",model:c,showRoot:false,persist:true,openOnClick:false,getLabel:function(f){return f.Name},getIconClass:function(){return"folderItem"}});this.treeWidget.startup();e.byId(this.treeContentPane.id).appendChild(this.treeWidget.domNode)},
execute:function(){var c=this.treeWidget.getSelectedItems();this.onHide();this.options.func(c[0])}});orion.widgets.DirectoryTreeModel=function(){function c(f,g,i){this.registry=f;this.root=g;this.fileClient=i}c.prototype={destroy:function(){},getRoot:function(f){f(this.root)},mayHaveChildren:function(){return true},getChildren:function(f,g){if(f.children)g(f.children);else if(f.Directory!==undefined&&f.Directory===false)g([]);else f.Location?this.fileClient.fetchChildren(f.ChildrenLocation).then(e.hitch(this,
function(i){for(var j=[],l=0;l<i.length;l++)i[l].Directory&&j.push(i[l]);a.processNavigatorParent(f,j);g(j)})):g([])},getIdentity:function(f){return f.Name?f.Location:"ROOT"},getLabel:function(f){return f.Name},onChildrenChange:function(){}};return c}()});define("text!orion/git/widgets/templates/CloneGitRepositoryDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t\t\t<span dojoAttachPoint="Basic">\n\t\t\t\t\t<div style="display: block; padding: 5; min-width: 120px; clear: both; float: left;">\n\t\t\t\t\t\t<label dojoAttachPoint="gitUrlLabel" for="${id}_gitUrl" style="padding-right: 10">${gitUrlLabelText}</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: block; padding: 5; width: 40em; text-align: right; float: right">\n\t\t\t\t\t\t<input dojoAttachPoint="gitUrl" id="${id}_gitUrl" style="display: inline-block; width: 100%;" value="">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: block; padding: 5; clear: both; text-align: right;">\n\t\t\t\t\t\t<a dojoAttachPoint="advancedLink" href="javascript:">Choose target location</a>\n\t\t\t\t\t\t<a dojoAttachPoint="advancedLinkHide" href="javascript:" style="display: none">Default target location</a>\n\t\t\t\t\t</div>\n\t\t\t\t</span>\n\t\t\t\t<span dojoAttachPoint="Advanced" style="display: none;">\n\t\t\t\t\t<div style="display: block; padding: 5; min-width: 120px; clear: both; float: left;">\n\t\t\t\t\t\t<input dojoAttachPoint="isNewProject" type="radio" name="${id}_newExisting" checked value="new"/>\n\t\t\t\t\t\t<label dojoAttachPoint="gitNameLabel" for="${id}_gitName" style="padding-right: 10">${gitNameLabelText}</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: block; padding: 5; width: 40em; text-align: right; float: right">\n\t\t\t\t\t\t<input dojoAttachPoint="gitName" id="${id}_gitName" style="display: inline-block; width: 100%;" value="">\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t\t<div style="display: block; padding: 5; min-width: 120px; clear: both; float: left;">\n\t\t\t\t\t\t<input dojoAttachPoint="isExistingProject" type="radio" name="${id}_newExisting" value="existing"/>\n\t\t\t\t\t\t<label dojoAttachPoint="gitPathLabel" for="${id}_gitPath" style="padding-right: 10">${gitPathLabelText}</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: block; padding: 5; width: 40em; text-align: left; float: right;">\n\t\t\t\t\t\t\t<input dojoAttachPoint="gitPath" id="${id}_gitPath" type="hidden" value="">\n\t\t\t\t\t\t\t<div style="width: 30em; float: left" float="left" dojoAttachPoint="shownGitPath"></div>\n\t\t\t\t\t\t\t<div style="width: 10em; float: right; text-align: right"><a dojoAttachPoint="changeGitPath" href="javascript:">Change...</a></div>\n\t\t\t\t\t</div>\n\t\t\t\t</span>\n\t\t\t\t<div style="display: block; padding: 5; clear: both; text-align: right">\n\t\t\t\t\t<button dojoAttachPoint="cloneItemButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0;">OK\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t</div>\n</div>'});
define("orion/git/widgets/CloneGitRepositoryDialog",["require","dojo","dijit","dijit/Dialog","orion/widgets/_OrionDialogMixin","orion/widgets/DirectoryPrompterDialog","text!orion/git/widgets/templates/CloneGitRepositoryDialog.html"],function(e,d,a){d.declare("orion.git.widgets.CloneGitRepositoryDialog",[a.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:d.cache("orion","git/widgets/templates/CloneGitRepositoryDialog.html"),constructor:function(){this.inherited(arguments);
this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);this.title=this.options.title?this.options.title:"Clone Git Repository";this.gitUrlLabelText="Repository URL:";this.gitPathLabelText="Existing directory:";this.gitNameLabelText="New folder:";this.advancedShown=false},postCreate:function(){this.inherited(arguments);if(this.options.advancedOnly){this.Basic.style.display="none";this.Advanced.style.display="";this.gitName.focus()}d.connect(this.changeGitPath,"onclick",
null,d.hitch(this,this.openDirectoryPickerDialog));d.connect(this.isExistingProject,"onchange",null,d.hitch(this,this.showExistingFolder));d.connect(this.gitName,"onfocus",null,d.hitch(this,this.showNewProject));d.connect(this.advancedLink,"onclick",null,d.hitch(this,this.showAdvanced));d.connect(this.advancedLinkHide,"onclick",null,d.hitch(this,this.hideAdvanced))},execute:function(){this.options.func(this.options.advancedOnly?undefined:this.gitUrl.value,this.advancedShown&&this.isNewProject.checked?
undefined:this.gitPath.value,this.advancedShown&&!this.isNewProject.checked?undefined:this.gitName.value)},showAdvanced:function(){this.advancedShown=true;this.Advanced.style.display="";this.advancedLink.style.display="none";this.advancedLinkHide.style.display=""},hideAdvanced:function(){this.advancedShown=false;this.Advanced.style.display="none";this.advancedLink.style.display="";this.advancedLinkHide.style.display="none"},showExistingFolder:function(){this.isExistingProject.checked?this.openDirectoryPickerDialog():
this.gitName.focus()},showNewProject:function(){this.isNewProject.checked=true},openDirectoryPickerDialog:function(){this.isExistingProject.checked=true;var c=new orion.widgets.DirectoryPrompterDialog({title:"Choose a Folder",serviceRegistry:this.options.serviceRegistry,fileClient:this.options.fileClient,func:d.hitch(this,function(f){if(f&&f.Location){this.gitPath.value=f.Location;this.shownGitPath.innerHTML="<a href='"+e.toUrl("navigate/table.html")+"#"+f.ChildrenLocation+"'>"+f.Name+"</a>";for(f=
f;f.parent&&!f.parent.Projects;){this.shownGitPath.innerHTML="<a href='"+e.toUrl("navigate/table.html")+"#"+f.parent.ChildrenLocation+"'>"+f.parent.Name+"</a>/"+this.shownGitPath.innerHTML;f=f.parent}}})});c.startup();c.show()}})});define("text!orion/git/widgets/templates/InitGitRepositoryDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t<div style="display: table">\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="gitTargetLabel" for="${id}_gitTarget" style="padding-right: 10">${gitTargetLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t<input dojoAttachPoint="gitTarget" id="${id}_gitTarget" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t\t<br><i>This is to be replaced with directory picker dialog</i>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<button dojoAttachPoint="cloneItemButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">OK\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/git/widgets/InitGitRepositoryDialog",["dojo","dijit","dijit/Dialog","orion/widgets/_OrionDialogMixin","text!orion/git/widgets/templates/InitGitRepositoryDialog.html"],function(e,d){e.declare("orion.git.widgets.InitGitRepositoryDialog",[d.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:e.cache("orion","git/widgets/templates/InitGitRepositoryDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);
this.title="Init Git Repository";this.gitTargetLabelText="Target:"},execute:function(){this.options.func(this.gitTarget.value)}})});define("text!orion/git/widgets/templates/AddRemoteDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t<div style="display: table">\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="gitRemoteLabel" for="${id}_gitRemote" style="padding-right: 10">${gitRemoteLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t<input dojoAttachPoint="gitRemote" id="${id}_gitRemote" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="gitRemoteURILabel" for="${id}_gitRemoteURI" style="padding-right: 10">${gitRemoteURILabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t<input dojoAttachPoint="gitRemoteURI" id="${id}_gitRemoteURI" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<button dojoAttachPoint="cloneItemButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">OK\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/git/widgets/AddRemoteDialog",["dojo","dijit","dijit/Dialog","orion/widgets/_OrionDialogMixin","text!orion/git/widgets/templates/AddRemoteDialog.html"],function(e,d){e.declare("orion.git.widgets.AddRemoteDialog",[d.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:e.cache("orion","git/widgets/templates/AddRemoteDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);
this.title="Add Remote";this.gitRemoteLabelText="Remote Name:";this.gitRemoteURILabelText="Remote URI:"},execute:function(){this.options.func(this.gitRemote.value,this.gitRemoteURI.value)}})});define("text!orion/git/widgets/templates/GitCredentialsDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t<div style="display: none; padding-top: 10px; padding-bottom: 10px;" dojoAttachPoint="gitCredentialsLabel">Provide credentials for: <b dojoAttachPoint="url"></b></div>\n\t\t<div style="display: table">\n\t\t\t<div style="display: table-row" dojoAttachPoint="gitSshUsernameRow">\n\t\t\t\t<div style="display: table-cell; padding: 5; vertical-align: top;">\n\t\t\t\t\t<label dojoAttachPoint="gitSshUsernameLabel" for="${id}_gitSshUsername" style="padding-right: 10">${gitSshUsernameLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left; vertical-align: top;">\n\t\t\t\t\t<input dojoAttachPoint="gitSshUsername" id="${id}_gitSshUsername" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\t\n\t\t\t<div style="display: table-row" dojoAttachPoint="gitSshPasswordRow">\n\t\t\t\t<div style="display: table-cell; padding: 5; vertical-align: top;">\n\t\t\t\t\t<input dojoAttachPoint="isSshPassword" type="radio" name="${id}_isSshPassword" checked value="password" style="width: 15px;"/>\n\t\t\t\t\t<label dojoAttachPoint="gitSshPasswordLabel" for="${id}_gitSshPassword" style="padding-right: 10">${gitSshPasswordLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left; vertical-align: top;">\n\t\t\t\t\t<input type="password" dojoAttachPoint="gitSshPassword" id="${id}_gitSshPassword" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row" dojoAttachPoint="gitPrivateKeyRow">\n\t\t\t\t<div style="display: table-cell; padding: 5; vertical-align: top;">\n\t\t\t\t\t<input dojoAttachPoint="isPrivateKey" type="radio" name="${id}_isSshPassword" value="privateKey" style="width: 15px;"/>\n\t\t\t\t\t<label dojoAttachPoint="gitPrivateKeyLabel" for="${id}_gitPrivateKey" style="padding-right: 10">${gitPrivateKeyLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left; vertical-align: top;">\n\t\t\t\t\t<textarea dojoAttachPoint="gitPrivateKey" id="${id}_gitPrivateKey" style="display: inline-block; width: 98%;" value=""></textarea>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row" dojoAttachPoint="gitPassphraseRow">\n\t\t\t\t<div style="display: table-cell; padding: 5; vertical-align: top;">\n\t\t\t\t\t&nbsp;\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left; vertical-align: top;">\n\t\t\t\t\t<label dojoAttachPoint="gitPassphraseLabel" for="${id}_gitPassphrase">${gitPassphraseLabelText}</label>\n\t\t\t\t</div>\n\n\t\t\t</div>\n\t\t\t<div style="display: table-row" dojoAttachPoint="gitPassphraseRow_1">\n\t\t\t\t<div style="display: table-cell; padding: 5; vertical-align: top;">\n\t\t\t\t\t&nbsp;\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left; vertical-align: top;">\n\t\t\t\t\t<input type="password" dojoAttachPoint="gitPassphrase" id="${id}_gitPassphrase" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<button dojoAttachPoint="okButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">Ok\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/git/widgets/GitCredentialsDialog",["dojo","dijit","dijit/Dialog","orion/widgets/_OrionDialogMixin","text!orion/git/widgets/templates/GitCredentialsDialog.html"],function(e,d){e.declare("orion.git.widgets.GitCredentialsDialog",[d.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:e.cache("orion","git/widgets/templates/GitCredentialsDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);
this.title=this.options.title||"Git Credentials";this.gitUrlLabelText="Repository URL:";this.gitSshUsernameLabelText="Username:";this.gitSshPasswordLabelText="Ssh password:";this.gitPrivateKeyLabelText="Private key:";this.gitPassphraseLabelText="Passphrase (optional):";if(!this.options.username&&!this.options.password&&!this.options.privatekey&&!this.options.passphrase){this.options.username=true;this.options.password=true;this.options.privatekey=true;this.options.passphrase=true}if(this.options.serviceRegistry){var a=
this;this.options.serviceRegistry.getService("orion.net.ssh").then(function(c){a._sshService=c})}},postCreate:function(){this.inherited(arguments);var a=this;this.options.username||e.style(this.gitSshUsernameRow,"display","none");this.options.password||e.style(this.gitSshPasswordRow,"display","none");this.options.privatekey||e.style(this.gitPrivateKeyRow,"display","none");if(!this.options.passphrase){e.style(this.gitPassphraseRow,"display","none");e.style(this.gitPassphraseRow_1,"display","none")}if(this.options.errordata&&
this.options.errordata.Url){e.style(this.gitCredentialsLabel,"display","block");this.url.innerHTML=this.options.errordata.Url}if(this.options.errordata&&this.options.errordata.User&&this.options.errordata.User!==""){this.gitSshUsername.value=this.options.errordata.User;e.style(this.gitSshUsernameRow,"display","none");setTimeout(function(){a.gitSshPassword.focus()},400)}e.connect(this.gitSshPassword,"onfocus",null,e.hitch(this,function(){this.isSshPassword.checked=true}));e.connect(this.gitPrivateKey,
"onfocus",null,e.hitch(this,function(){this.isPrivateKey.checked=true}));e.connect(this.gitPassphrase,"onfocus",null,e.hitch(this,function(){this.isPrivateKey.checked=true}))},execute:function(){if(this._sshService){var a=this;this._sshService.getKnownHosts().then(function(c){a.options.func({gitSshUsername:a.gitSshUsername.value,gitSshPassword:a.isSshPassword.checked?a.gitSshPassword.value:"",gitPrivateKey:a.isPrivateKey.checked?a.gitPrivateKey.value:"",gitPassphrase:a.isPrivateKey.checked?a.gitPassphrase.value:
"",knownHosts:c})})}else this.options.func({gitSshUsername:this.gitSshUsername.value,gitSshPassword:this.gitSshPassword.value,gitPrivateKey:this.gitPrivateKey.value,gitPassphrase:this.gitPassphrase.value,knownHosts:this.gitSshKnownHosts.value})}})});define("text!dijit/form/templates/CheckBox.html",function(){return'<div class="dijit dijitReset dijitInline" role="presentation"\n\t><input\n\t \t${!nameAttrSetting} type="${type}" ${checkedAttrSetting}\n\t\tclass="dijitReset dijitCheckBoxInput"\n\t\tdojoAttachPoint="focusNode"\n\t \tdojoAttachEvent="onclick:_onClick"\n/></div>'});
define("dijit/form/ToggleButton",["dojo","dijit","dijit/form/Button"],function(e,d){return d.form.ToggleButton});
define("dijit/form/CheckBox",["dojo","dijit","text!dijit/form/templates/CheckBox.html","dijit/form/ToggleButton"],function(e,d){e.declare("dijit.form.CheckBox",d.form.ToggleButton,{templateString:e.cache("dijit.form","templates/CheckBox.html"),baseClass:"dijitCheckBox",type:"checkbox",value:"on",readOnly:false,attributeMap:e.delegate(d.form._FormWidget.prototype.attributeMap,{readOnly:"focusNode"}),_setReadOnlyAttr:function(a){this._set("readOnly",a);e.attr(this.focusNode,"readOnly",a);d.setWaiState(this.focusNode,
"readonly",a)},_setValueAttr:function(a,c){if(typeof a=="string"){this._set("value",a);e.attr(this.focusNode,"value",a);a=true}this._created&&this.set("checked",a,c)},_getValueAttr:function(){return this.checked?this.value:false},_setLabelAttr:undefined,postMixInProperties:function(){if(this.value=="")this.value="on";this.checkedAttrSetting=this.checked?"checked":"";this.inherited(arguments)},_fillContent:function(){},reset:function(){this._hasBeenBlurred=false;this.set("checked",this.params.checked||
false);this._set("value",this.params.value||"on");e.attr(this.focusNode,"value",this.value)},_onFocus:function(){this.id&&e.query("label[for='"+this.id+"']").addClass("dijitFocusedLabel");this.inherited(arguments)},_onBlur:function(){this.id&&e.query("label[for='"+this.id+"']").removeClass("dijitFocusedLabel");this.inherited(arguments)},_onClick:function(a){if(this.readOnly){e.stopEvent(a);return false}return this.inherited(arguments)}});e.declare("dijit.form.RadioButton",d.form.CheckBox,{type:"radio",
baseClass:"dijitRadio",_setCheckedAttr:function(a){this.inherited(arguments);if(this._created)if(a){var c=this;e.query("INPUT[type=radio]",this.focusNode.form||e.doc).forEach(function(f){if(f.name==c.name&&f!=c.focusNode&&f.form==c.focusNode.form)(f=d.getEnclosingWidget(f))&&f.checked&&f.set("checked",false)})}},_clicked:function(){this.checked||this.set("checked",true)}});return d.form.CheckBox});
define("dijit/form/Form",["dojo","dijit","dijit/_Widget","dijit/_Templated","dijit/form/_FormMixin","dijit/layout/_ContentPaneResizeMixin"],function(e,d){e.declare("dijit.form.Form",[d._Widget,d._Templated,d.form._FormMixin,d.layout._ContentPaneResizeMixin],{name:"",action:"",method:"",encType:"","accept-charset":"",accept:"",target:"",templateString:"<form dojoAttachPoint='containerNode' dojoAttachEvent='onreset:_onReset,onsubmit:_onSubmit' ${!nameAttrSetting}></form>",attributeMap:e.delegate(d._Widget.prototype.attributeMap,
{action:"",method:"",encType:"","accept-charset":"",accept:"",target:""}),postMixInProperties:function(){this.nameAttrSetting=this.name?"name='"+this.name+"'":"";this.inherited(arguments)},execute:function(){},onExecute:function(){},_setEncTypeAttr:function(a){this.encType=a;e.attr(this.domNode,"encType",a);if(e.isIE)this.domNode.encoding=a},postCreate:function(){if(e.isIE&&this.srcNodeRef&&this.srcNodeRef.attributes){var a=this.srcNodeRef.attributes.getNamedItem("encType");a&&!a.specified&&typeof a.value==
"string"&&this.set("encType",a.value)}this.inherited(arguments)},reset:function(a){var c={returnValue:true,preventDefault:function(){this.returnValue=false},stopPropagation:function(){},currentTarget:a?a.target:this.domNode,target:a?a.target:this.domNode};this.onReset(c)!==false&&c.returnValue&&this.inherited(arguments,[])},onReset:function(){return true},_onReset:function(a){this.reset(a);e.stopEvent(a);return false},_onSubmit:function(a){var c=d.form.Form.prototype;if(this.execute!=c.execute||this.onExecute!=
c.onExecute){e.deprecated("dijit.form.Form:execute()/onExecute() are deprecated. Use onSubmit() instead.","","2.0");this.onExecute();this.execute(this.getValues())}this.onSubmit(a)===false&&e.stopEvent(a)},onSubmit:function(){return this.isValid()},submit:function(){this.onSubmit()!==false&&this.containerNode.submit()}});return d.form.Form});
define("dojo/data/util/filter",["dojo"],function(e){e.getObject("data.util.filter",true,e);e.data.util.filter.patternToRegExp=function(d,a){for(var c="^",f=null,g=0;g<d.length;g++){f=d.charAt(g);switch(f){case "\\":c+=f;g++;c+=d.charAt(g);break;case "*":c+=".*";break;case "?":c+=".";break;case "$":case "^":case "/":case "+":case ".":case "|":case "(":case ")":case "{":case "}":case "[":case "]":c+="\\";default:c+=f}}c+="$";return a?new RegExp(c,"mi"):new RegExp(c,"m")};return e.data.util.filter});
define("dojo/data/util/sorter",["dojo"],function(e){e.getObject("data.util.sorter",true,e);e.data.util.sorter.basicComparator=function(d,a){var c=-1;if(d===null)d=undefined;if(a===null)a=undefined;if(d==a)c=0;else if(d>a||d==null)c=1;return c};e.data.util.sorter.createSortFunction=function(d,a){function c(q,u,r,t){return function(v,A){v=t.getValue(v,q);A=t.getValue(A,q);return u*r(v,A)}}for(var f=[],g,i=a.comparatorMap,j=e.data.util.sorter.basicComparator,l=0;l<d.length;l++){g=d[l];var h=g.attribute;
if(h){g=g.descending?-1:1;var k=j;if(i){if(typeof h!=="string"&&"toString"in h)h=h.toString();k=i[h]||j}f.push(c(h,g,k,a))}}return function(q,u){for(var r=0;r<f.length;){var t=f[r++](q,u);if(t!==0)return t}return 0}};return e.data.util.sorter});
define("dojo/data/util/simpleFetch",["dojo","dojo/data/util/sorter"],function(e){e.getObject("data.util.simpleFetch",true,e);e.data.util.simpleFetch.fetch=function(d){d=d||{};if(!d.store)d.store=this;var a=this,c=function(g,i){if(i.onError)i.onError.call(i.scope||e.global,g,i)},f=function(g,i){var j=i.abort||null,l=false,h=i.start?i.start:0,k=i.count&&i.count!==Infinity?h+i.count:g.length;i.abort=function(){l=true;j&&j.call(i)};var q=i.scope||e.global;if(!i.store)i.store=a;i.onBegin&&i.onBegin.call(q,
g.length,i);i.sort&&g.sort(e.data.util.sorter.createSortFunction(i.sort,a));if(i.onItem)for(var u=h;u<g.length&&u<k;++u){var r=g[u];l||i.onItem.call(q,r,i)}if(i.onComplete&&!l){u=null;i.onItem||(u=g.slice(h,k));i.onComplete.call(q,u,i)}};this._fetchItems(d,f,c);return d};return e.data.util.simpleFetch});
define("dojo/data/ItemFileReadStore",["dojo","dojo/data/util/filter","dojo/data/util/simpleFetch","dojo/date/stamp"],function(e){e.declare("dojo.data.ItemFileReadStore",null,{constructor:function(d){this._arrayOfAllItems=[];this._arrayOfTopLevelItems=[];this._loadFinished=false;this.url=this._ccUrl=this._jsonFileUrl=d.url;this._jsonData=d.data;this.data=null;this._datatypeMap=d.typeMap||{};this._datatypeMap.Date||(this._datatypeMap.Date={type:Date,deserialize:function(a){return e.date.stamp.fromISOString(a)}});
this._features={"dojo.data.api.Read":true,"dojo.data.api.Identity":true};this._itemsByIdentity=null;this._storeRefPropName="_S";this._itemNumPropName="_0";this._rootItemPropName="_RI";this._reverseRefMap="_RRM";this._loadInProgress=false;this._queuedFetches=[];if(d.urlPreventCache!==undefined)this.urlPreventCache=d.urlPreventCache?true:false;if(d.hierarchical!==undefined)this.hierarchical=d.hierarchical?true:false;if(d.clearOnClose)this.clearOnClose=true;if("failOk"in d)this.failOk=d.failOk?true:
false},url:"",_ccUrl:"",data:null,typeMap:null,clearOnClose:false,urlPreventCache:false,failOk:false,hierarchical:true,_assertIsItem:function(d){if(!this.isItem(d))throw new Error("dojo.data.ItemFileReadStore: Invalid item argument.");},_assertIsAttribute:function(d){if(typeof d!=="string")throw new Error("dojo.data.ItemFileReadStore: Invalid attribute argument.");},getValue:function(d,a,c){d=this.getValues(d,a);return d.length>0?d[0]:c},getValues:function(d,a){this._assertIsItem(d);this._assertIsAttribute(a);
return(d[a]||[]).slice(0)},getAttributes:function(d){this._assertIsItem(d);var a=[];for(var c in d)c!==this._storeRefPropName&&c!==this._itemNumPropName&&c!==this._rootItemPropName&&c!==this._reverseRefMap&&a.push(c);return a},hasAttribute:function(d,a){this._assertIsItem(d);this._assertIsAttribute(a);return a in d},containsValue:function(d,a,c){var f=undefined;if(typeof c==="string")f=e.data.util.filter.patternToRegExp(c,false);return this._containsValue(d,a,c,f)},_containsValue:function(d,a,c,f){return e.some(this.getValues(d,
a),function(g){if(g!==null&&!e.isObject(g)&&f){if(g.toString().match(f))return true}else if(c===g)return true})},isItem:function(d){if(d&&d[this._storeRefPropName]===this)if(this._arrayOfAllItems[d[this._itemNumPropName]]===d)return true;return false},isItemLoaded:function(d){return this.isItem(d)},loadItem:function(d){this._assertIsItem(d.item)},getFeatures:function(){return this._features},getLabel:function(d){if(this._labelAttr&&this.isItem(d))return this.getValue(d,this._labelAttr)},getLabelAttributes:function(){if(this._labelAttr)return[this._labelAttr];
return null},_fetchItems:function(d,a,c){var f=this,g=function(h,k){var q=[],u,r;if(h.query){var t;u=h.queryOptions?h.queryOptions.ignoreCase:false;var v={};for(r in h.query){t=h.query[r];if(typeof t==="string")v[r]=e.data.util.filter.patternToRegExp(t,u);else if(t instanceof RegExp)v[r]=t}for(u=0;u<k.length;++u){var A=true,x=k[u];if(x===null)A=false;else for(r in h.query){t=h.query[r];f._containsValue(x,r,t,v[r])||(A=false)}A&&q.push(x)}}else for(u=0;u<k.length;++u){r=k[u];r!==null&&q.push(r)}a(q,
h)};if(this._loadFinished)g(d,this._getItemsArray(d.queryOptions));else{if(this._jsonFileUrl!==this._ccUrl){e.deprecated("dojo.data.ItemFileReadStore: ","To change the url, set the url property of the store, not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0");this.url=this._ccUrl=this._jsonFileUrl}else if(this.url!==this._ccUrl)this._ccUrl=this._jsonFileUrl=this.url;if(this.data!=null){this._jsonData=this.data;this.data=null}if(this._jsonFileUrl)if(this._loadInProgress)this._queuedFetches.push({args:d,
filter:g});else{this._loadInProgress=true;var i=e.xhrGet({url:f._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk});i.addCallback(function(h){try{f._getItemsFromLoadedData(h);f._loadFinished=true;f._loadInProgress=false;g(d,f._getItemsArray(d.queryOptions));f._handleQueuedFetches()}catch(k){f._loadFinished=true;f._loadInProgress=false;c(k,d)}});i.addErrback(function(h){f._loadInProgress=false;c(h,d)});var j=null;if(d.abort)j=d.abort;d.abort=function(){i&&
i.fired===-1&&i.cancel();j&&j.call(d)}}else if(this._jsonData)try{this._loadFinished=true;this._getItemsFromLoadedData(this._jsonData);this._jsonData=null;g(d,this._getItemsArray(d.queryOptions))}catch(l){c(l,d)}else c(new Error("dojo.data.ItemFileReadStore: No JSON source data was provided as either URL or a nested Javascript object."),d)}},_handleQueuedFetches:function(){if(this._queuedFetches.length>0){for(var d=0;d<this._queuedFetches.length;d++){var a=this._queuedFetches[d],c=a.args;(a=a.filter)?
a(c,this._getItemsArray(c.queryOptions)):this.fetchItemByIdentity(c)}this._queuedFetches=[]}},_getItemsArray:function(d){if(d&&d.deep)return this._arrayOfAllItems;return this._arrayOfTopLevelItems},close:function(){if(this.clearOnClose&&this._loadFinished&&!this._loadInProgress){if((this._jsonFileUrl==""||this._jsonFileUrl==null)&&(this.url==""||this.url==null)&&this.data==null)console.debug("dojo.data.ItemFileReadStore: WARNING!  Data reload  information has not been provided.  Please set 'url' or 'data' to the appropriate value before the next fetch");
this._arrayOfAllItems=[];this._arrayOfTopLevelItems=[];this._loadFinished=false;this._itemsByIdentity=null;this._loadInProgress=false;this._queuedFetches=[]}},_getItemsFromLoadedData:function(d){function a(v){return v!==null&&typeof v==="object"&&(!e.isArray(v)||f)&&!e.isFunction(v)&&(v.constructor==Object||e.isArray(v))&&typeof v._reference==="undefined"&&typeof v._type==="undefined"&&typeof v._value==="undefined"&&g.hierarchical}function c(v){g._arrayOfAllItems.push(v);for(var A in v){var x=v[A];
if(x)if(e.isArray(x))for(var m=0;m<x.length;++m){var o=x[m];a(o)&&c(o)}else a(x)&&c(x)}}var f=false,g=this;this._labelAttr=d.label;var i,j;this._arrayOfAllItems=[];this._arrayOfTopLevelItems=d.items;for(i=0;i<this._arrayOfTopLevelItems.length;++i){j=this._arrayOfTopLevelItems[i];if(e.isArray(j))f=true;c(j);j[this._rootItemPropName]=true}var l={},h;for(i=0;i<this._arrayOfAllItems.length;++i){j=this._arrayOfAllItems[i];for(h in j){if(h!==this._rootItemPropName){var k=j[h];if(k!==null)e.isArray(k)||
(j[h]=[k]);else j[h]=[null]}l[h]=h}}for(;l[this._storeRefPropName];)this._storeRefPropName+="_";for(;l[this._itemNumPropName];)this._itemNumPropName+="_";for(;l[this._reverseRefMap];)this._reverseRefMap+="_";if(l=d.identifier){this._itemsByIdentity={};this._features["dojo.data.api.Identity"]=l;for(i=0;i<this._arrayOfAllItems.length;++i){j=this._arrayOfAllItems[i];d=j[l];d=d[0];if(Object.hasOwnProperty.call(this._itemsByIdentity,d))if(this._jsonFileUrl)throw new Error("dojo.data.ItemFileReadStore:  The json data as specified by: ["+
this._jsonFileUrl+"] is malformed.  Items within the list have identifier: ["+l+"].  Value collided: ["+d+"]");else{if(this._jsonData)throw new Error("dojo.data.ItemFileReadStore:  The json data provided by the creation arguments is malformed.  Items within the list have identifier: ["+l+"].  Value collided: ["+d+"]");}else this._itemsByIdentity[d]=j}}else this._features["dojo.data.api.Identity"]=Number;for(i=0;i<this._arrayOfAllItems.length;++i){j=this._arrayOfAllItems[i];j[this._storeRefPropName]=
this;j[this._itemNumPropName]=i}for(i=0;i<this._arrayOfAllItems.length;++i){j=this._arrayOfAllItems[i];for(h in j){d=j[h];for(l=0;l<d.length;++l){k=d[l];if(k!==null&&typeof k=="object"){if("_type"in k&&"_value"in k){var q=k._type,u=this._datatypeMap[q];if(u)if(e.isFunction(u))d[l]=new u(k._value);else if(e.isFunction(u.deserialize))d[l]=u.deserialize(k._value);else throw new Error("dojo.data.ItemFileReadStore: Value provided in typeMap was neither a constructor, nor a an object with a deserialize function");
else throw new Error("dojo.data.ItemFileReadStore: in the typeMap constructor arg, no object class was specified for the datatype '"+q+"'");}if(k._reference){k=k._reference;if(e.isObject(k))for(q=0;q<this._arrayOfAllItems.length;++q){u=this._arrayOfAllItems[q];var r=true;for(var t in k)if(u[t]!=k[t])r=false;if(r)d[l]=u}else d[l]=this._getItemByIdentity(k);if(this.referenceIntegrity){k=d[l];this.isItem(k)&&this._addReferenceToMap(k,j,h)}}else this.isItem(k)&&this.referenceIntegrity&&this._addReferenceToMap(k,
j,h)}}}}},_addReferenceToMap:function(){},getIdentity:function(d){var a=this._features["dojo.data.api.Identity"];if(a===Number)return d[this._itemNumPropName];else if(d=d[a])return d[0];return null},fetchItemByIdentity:function(d){var a,c;if(this._loadFinished){a=this._getItemByIdentity(d.identity);if(d.onItem){c=d.scope?d.scope:e.global;d.onItem.call(c,a)}}else{var f=this;if(this._jsonFileUrl!==this._ccUrl){e.deprecated("dojo.data.ItemFileReadStore: ","To change the url, set the url property of the store, not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0");
this.url=this._ccUrl=this._jsonFileUrl}else if(this.url!==this._ccUrl)this._ccUrl=this._jsonFileUrl=this.url;if(this.data!=null&&this._jsonData==null){this._jsonData=this.data;this.data=null}if(this._jsonFileUrl)if(this._loadInProgress)this._queuedFetches.push({args:d});else{this._loadInProgress=true;c=e.xhrGet({url:f._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk});c.addCallback(function(g){var i=d.scope?d.scope:e.global;try{f._getItemsFromLoadedData(g);
f._loadFinished=true;f._loadInProgress=false;a=f._getItemByIdentity(d.identity);d.onItem&&d.onItem.call(i,a);f._handleQueuedFetches()}catch(j){f._loadInProgress=false;d.onError&&d.onError.call(i,j)}});c.addErrback(function(g){f._loadInProgress=false;if(d.onError)d.onError.call(d.scope?d.scope:e.global,g)})}else if(this._jsonData){f._getItemsFromLoadedData(f._jsonData);f._jsonData=null;f._loadFinished=true;a=f._getItemByIdentity(d.identity);if(d.onItem){c=d.scope?d.scope:e.global;d.onItem.call(c,a)}}}},
_getItemByIdentity:function(d){var a=null;if(this._itemsByIdentity&&Object.hasOwnProperty.call(this._itemsByIdentity,d))a=this._itemsByIdentity[d];else if(Object.hasOwnProperty.call(this._arrayOfAllItems,d))a=this._arrayOfAllItems[d];if(a===undefined)a=null;return a},getIdentityAttributes:function(){var d=this._features["dojo.data.api.Identity"];return d===Number?null:[d]},_forceLoad:function(){var d=this;if(this._jsonFileUrl!==this._ccUrl){e.deprecated("dojo.data.ItemFileReadStore: ","To change the url, set the url property of the store, not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0");
this.url=this._ccUrl=this._jsonFileUrl}else if(this.url!==this._ccUrl)this._ccUrl=this._jsonFileUrl=this.url;if(this.data!=null){this._jsonData=this.data;this.data=null}if(this._jsonFileUrl){var a=e.xhrGet({url:this._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk,sync:true});a.addCallback(function(c){try{if(d._loadInProgress!==true&&!d._loadFinished){d._getItemsFromLoadedData(c);d._loadFinished=true}else if(d._loadInProgress)throw new Error("dojo.data.ItemFileReadStore:  Unable to perform a synchronous load, an async load is in progress.");
}catch(f){console.log(f);throw f;}});a.addErrback(function(c){throw c;})}else if(this._jsonData){d._getItemsFromLoadedData(d._jsonData);d._jsonData=null;d._loadFinished=true}}});e.extend(e.data.ItemFileReadStore,e.data.util.simpleFetch);return e.data.ItemFileReadStore});define("text!orion/widgets/templates/NewItemDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t<div style="display: table">\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="itemNameLabel" for="${id}_itemName" style="padding-right: 10">${itemNameLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 30em; text-align: left;">\n\t\t\t\t\t<input dojoType="dijit.form.ValidationTextBox" dojoAttachPoint="itemName" id="${id}_itemName" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: none;" dojoAttachPoint="itemAdvancedInfo">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="itemURLLabel" for="itemURL" style="padding-right: 10">Server Path:</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; width: 40em; text-align: left; padding:5;">\n\t\t\t\t\t<input dojoAttachPoint="itemURL" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: none;" dojoAttachPoint="itemAdvancedInfo1">\n\t\t\t\t<div style="display: table-cell;"></div>\n\t\t\t\t<div style="display: table-cell;">\n\t\t\t\t\t<input dojoAttachPoint="createCheckbox" id="${id}_createCheckbox" dojoType="dijit.form.CheckBox" checked="checked" value="on" type="checkbox">\n\t\t\t\t\t<label dojoAttachPoint="createCheckboxLabel" for="${id}_createCheckbox">Create if doesn\'t exist</label>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<button dojoAttachPoint="newItemButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">OK\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/widgets/NewItemDialog",["dojo","dijit","dijit/Dialog","dijit/form/CheckBox","dijit/form/CheckBox","dijit/form/Form","dijit/form/ValidationTextBox","dojo/data/ItemFileReadStore","orion/widgets/_OrionDialogMixin","text!orion/widgets/templates/NewItemDialog.html"],function(e,d){e.declare("orion.widgets.NewItemDialog",[d.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:e.cache("orion","widgets/templates/NewItemDialog.html"),constructor:function(a){this.options=
a||{};this.options.advanced=this.options.advanced||false},postMixInProperties:function(){this.inherited(arguments);this.itemNameLabelText=this.options.label||"Name:"},postCreate:function(){this.inherited(arguments);if(this.options.advanced){this.itemAdvancedInfo.style.display="table-row";this.itemAdvancedInfo1.style.display="table-row";e.connect(this.itemURL,"onkeyup",null,e.hitch(this,this.onURLChange))}else{this.itemAdvancedInfo.style.display="none";this.itemAdvancedInfo1.style.display="none"}},
execute:function(){var a,c;this.newItemButton.focus();if(this.options.advanced){a=this.itemURL.value.replace(/^\s+|\s+$/g,"");c=this.createCheckbox.get("disabled")?false:this.createCheckbox.get("checked")}this.options.func(this.itemName.value,a&&a!==""?a:undefined,c)},onURLChange:function(){var a=this.itemURL.value;if(a.match(/^file:\/\//))this.createCheckbox.set("disabled",false);else a.match(/^[a-zA-Z][a-zA-Z]+:\/\/.+/)?this.createCheckbox.set("disabled",true):this.createCheckbox.set("disabled",
false)}})});
define("orion/git/git-clones-explorer",["require","dojo","orion/explorer","orion/util"],function(e,d,a,c){var f={};f.GitClonesExplorer=function(){function g(i,j,l,h,k,q){this.parentId=h;this.registry=i;this.selection=j;this.toolbarId=k;this.selectionToolsId=q;this.cloneDetails=l;this.checkbox=false;this.renderer=new f.GitClonesRenderer({checkbox:false},this)}g.prototype=new a.Explorer;g.prototype.getGitLocation=function(i){i=c.makeRelative(i);var j=e.toUrl("gitapi/clone._");j=j.substring(0,j.length-
2);return i[0]==="/"?j+i:j+"/"+i};g.prototype.setDefaultPath=function(i){this.defaultPath=i};g.prototype.displayClonesList=function(i){var j=this;i=i||this.defaultPath;i=c.makeRelative(i);if(i!==this._lastHash){this._lastHash=i;d.hash(i,true);var l=this.getGitLocation(i);d.create("div",null,d.byId(this.parentId),"only").innerHTML="Loading <b>"+l+"</b>...";this.registry.getService("orion.git.provider").then(function(h){d.hitch(j,j.createTree(j.parentId,new f.GitClonesModel(h,l,h.getGitClone)))})}};
g.prototype.redisplayClonesList=function(){if(this._lastHash){var i=this,j=this.getGitLocation(this._lastHash);d.create("div",null,d.byId(this.parentId),"only").innerHTML="Loading <b>"+j+"</b>...";this.registry.getService("orion.git.provider").then(function(l){d.hitch(i,i.createTree(i.parentId,new f.GitClonesModel(l,j,l.getGitClone)))})}};g.prototype.loadCloneDetails=function(i){this.cloneDetails.loadCloneDetails(i.ConfigLocation)};return g}();f.GitClonesModel=function(){function g(i,j,l,h){this.gitClient=
i;this.rootPath=j;this.fetchItems=l;this.root=h?h:null}g.prototype=new a.ExplorerModel;g.prototype.getRoot=function(i){this.root?i(this.root):this.fetchItems(this.rootPath).then(d.hitch(this,function(j){this.root=j;i(j)}))};g.prototype.mayHaveChildren=function(i){if(i.children||i.Children)return true;else if(i.BranchLocation&&i.RemoteLocation)return true;else if(i.GroupNode)return true;else if(i.Type==="Remote")return true;return false};g.prototype.getIdentity=function(i){if(i.Location){i=i.Location;
i=i.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")}else i="ROOT";return i};g.prototype.getChildren=function(i,j){i.children=[];if(i.Children){for(var l=0;l<i.Children.length;l++){i.Children[l].parent=i;i.children[l]=i.Children[l]}j(i.Children)}else if(i.BranchLocation&&i.RemoteLocation){i.children=[{GroupNode:"true",Location:i.BranchLocation,Name:"Branches",parent:i},{GroupNode:"true",Location:i.RemoteLocation,BranchLocation:i.BranchLocation,Name:"Remotes",parent:i},{GroupNode:"true",Location:i.TagLocation,
Name:"Tags",parent:i}];j(i.children)}else if(i.GroupNode)this.gitClient.getGitBranch(i.Location).then(d.hitch(this,function(h){i.children=h.Children;for(var k=0;k<h.Children.length;k++)h.Children[k].parent=i;j(h.Children)}));else i.Type==="Remote"&&this.gitClient.getGitBranch(i.Location).then(d.hitch(this,function(h){i.children=h.Children;for(var k=0;k<h.Children.length;k++)h.Children[k].parent=i;j(h.Children)}))};return g}();f.GitClonesRenderer=function(){function g(i,j){this._init(i);this.explorer=
j}g.prototype=new a.SelectionRenderer;g.prototype.getCellHeaderElement=function(i){switch(i){case 0:return d.create("th",{innerHTML:"<h2>Name</h2>"});case 1:return d.create("th",{innerHTML:"<h2>Actions</h2>"})}};g.prototype.getCellElement=function(i,j,l){switch(i){case 0:var h,k;if(j.BranchLocation&&j.RemoteLocation){h=document.createElement("td");i=l.id+"__expand";i=d.create("div",null,h,"only");this.getExpandImage(l,i,"git-sprite-repository","gitImageSprite");k=d.create("a",{className:"navlinkonpage"},
i,"last");d.connect(k,"onclick",k,d.hitch(this,function(){this.explorer.loadCloneDetails(j)}));d.connect(k,"onmouseover",k,function(){k.style.cursor="pointer"});d.connect(k,"onmouseout",k,function(){k.style.cursor="default"});d.place(document.createTextNode(j.Name),k,"only")}else if(j.GroupNode){h=document.createElement("td");i=l.id+"__expand";i=d.create("div",null,h,"only");j.Name==="Branches"&&this.getExpandImage(l,i,"git-sprite-branches","gitImageSprite");j.Name==="Remotes"&&this.getExpandImage(l,
i,"git-sprite-remotes","gitImageSprite");j.Name==="Tags"&&this.getExpandImage(l,i,"git-sprite-tags","gitImageSprite");k=d.create("a",{innerHTML:j.Name,className:"navlinkonpage"},i,"last");d.place(document.createTextNode(j.Name),k,"only")}else if(j.Type==="Branch"){h=document.createElement("td");i=d.create("div",{style:"margin-left: 10px"},h,"only");k=d.create("a",{innerHTML:j.Name,className:"navlinkonpage"},i,"last");if(j.Current)k.style.fontWeight="bold";d.place(document.createTextNode(j.Name),k,
"only");l=d.create("span",null,k,"first");d.addClass(l,"gitImageSprite");d.addClass(l,"git-sprite-branch")}else if(j.Type==="Remote"){h=document.createElement("td");i=l.id+"__expand";i=d.create("div",null,h,"only");this.getExpandImage(l,i,"git-sprite-remote","gitImageSprite");k=d.create("a",{innerHTML:j.Name,className:"navlinkonpage"},i,"last");!j.PushUrl||j.PushUrl===j.GitUrl?d.place(document.createTextNode(j.Name+" ("+j.GitUrl+")"),k,"only"):d.place(document.createTextNode(j.Name+" (See the configuration for fetch/push urls)"),
k,"only")}else if(j.Type==="RemoteTrackingBranch"){h=document.createElement("td");i=d.create("div",{style:"margin-left: 10px"},h,"only");k=d.create("a",{innerHTML:j.Name,className:"navlinkonpage"},i,"last");d.place(document.createTextNode(j.Name),k,"only");l=d.create("span",null,k,"first");d.addClass(l,"gitImageSprite");d.addClass(l,"git-sprite-branch")}else if(j.Type==="Tag"){h=document.createElement("td");i=d.create("div",{style:"margin-left: 10px"},h,"only");k=d.create("a",{innerHTML:j.Name,className:"navlinkonpage"},
i,"last");d.place(document.createTextNode(j.Name),k,"only");l=d.create("span",null,k,"first");d.addClass(l,"gitImageSprite");d.addClass(l,"git-sprite-tag")}return h;case 1:return this.getActionsColumn(j,l)}};return g}();return f});define("text!orion/git/widgets/templates/RemotePrompterDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t\t<div style="display: table">\n\t\t\t\t<div style="display: table-row"> \n\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t\t<div dojoAttachPoint="treeContainerNode" id="${id}_treeContainerNode" dojoType="dijit.layout.BorderContainer" style="width:25em; height:25em; overflow:auto;" design="sidebar" gutters="true">\n\t\t\t\t\t\t\t<div dojoAttachPoint="treeContentPane" class="dijitDialogPaneContent" id="${id}_treeContentPane dojoType="dijit.layout.ContentPane" region="center" gutters="true">\n\t\t\t\t\t\t\t\t<div dojoAttachPoint="browseRemoteExplorerTree" class="explorerTreeClass" id="${id}_browseRemoteExplorerTree" style="margin-top: -3px;"></div> \n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<div style="display: table-row" dojoAttachPoint="newBranchSection">\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t<label for="${id}_newBranch">${newBranchText}</label>\n\t\t\t\t\t<input dojoAttachPoint="newBranch" id="${id}_newBranch" value="" disabled=true/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t \n\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\n\t\t\t\t\t\t<button dojoAttachPoint="RemoteBrowserButton" disabled=true dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">${buttonOk}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div> <!-- end table --\>\n\t</div> <!-- content pane --\>\n</div>'});
define("orion/git/widgets/RemotePrompterDialog",["dojo","dijit","orion/util","orion/git/git-clones-explorer","dijit/Dialog","dijit/form/Button","orion/widgets/ExplorerTree","orion/widgets/_OrionDialogMixin","text!orion/git/widgets/templates/RemotePrompterDialog.html"],function(e,d,a,c){e.declare("orion.git.widgets.RemotePrompterDialog",[d.Dialog,orion.widgets._OrionDialogMixin],{treeWidget:null,treeRoot:{},widgetsInTemplate:true,templateString:e.cache("orion","git/widgets/templates/RemotePrompterDialog.html"),
constructor:function(){this.inherited(arguments);this.options=arguments[0]||{};this.treeRoot=this.options.treeRoot},postMixInProperties:function(){this.inherited(arguments);this.title=this.options.title||"Choose a Folder";this.newBranchText="New Branch:";this.buttonOk="OK"},postCreate:function(){this.inherited(arguments);this.loadRemoteChildren(this.treeRoot);e.connect(this.newBranch,"onchange",e.hitch(this,this.validate));if(this.options.hideNewBranch)this.newBranchSection.style.display="none"},
loadRemoteChildren:function(f){this.treeRoot=f;this.createTree(new c.GitClonesModel(this.gitClient,null,this.gitClient.getGitClone,this.treeRoot))},createTree:function(f){var g=this.treeWidget=new orion.widgets.ExplorerTree({style:"width:100%; height:100%",model:f,region:"center",showRoot:false,persist:true,openOnClick:false,getLabel:function(j){return j.Name},getIconClass:function(j){if(j.BranchLocation&&j.RemoteLocation)return"gitRepoItem";if(j.GroupNode)return j.Name==="Branch"?"gitBranchesItem":
"gitRemotesItem";if(j.Type==="Branch"||j.Type==="RemoteTrackingBranch")return"gitBranchItem";if(j.Type==="Remote")return"gitRemoteItem";return"gitDefaultItem"}}),i=this;this.treeWidget._inheritedSelectNode=this.treeWidget._selectNode;this.treeWidget._selectNode=function(j){g._inheritedSelectNode(j);i.newBranch.disabled=j.item&&j.item.Type==="Remote"?false:true;e.hitch(i,i.validate)()};this.treeWidget.startup();e.byId(this.treeContentPane.id).appendChild(this.treeWidget.domNode)},validate:function(){var f=
this.treeWidget.getSelectedItems();if(f.length==1)if(f[0].Type==="RemoteTrackingBranch"){this.RemoteBrowserButton.disabled=false;return}else if(f[0].Type==="Remote")if(this.newBranch.value!=""){this.RemoteBrowserButton.disabled=false;return}this.RemoteBrowserButton.disabled=true},execute:function(){var f=this.treeWidget.getSelectedItems();this.onHide();f[0].Type==="RemoteTrackingBranch"?this.options.func(f[0],f[0].parent):this.options.func(null,f[0],this.newBranch.value)}})});
define("orion/git/gitCommands",["require","dojo","orion/commands","orion/util","orion/git/widgets/CloneGitRepositoryDialog","orion/git/widgets/InitGitRepositoryDialog","orion/git/widgets/AddRemoteDialog","orion/git/widgets/GitCredentialsDialog","orion/widgets/NewItemDialog","orion/git/widgets/RemotePrompterDialog"],function(e,d,a,c){var f={};(function(){function g(j){serviceRegistry.getService("orion.page.message").then(function(l){if(!(j.status===401||j.status===403)){var h=[];h.Severity="Error";
h.HTML=false;try{var k=JSON.parse(j.responseText);h.Message=k.DetailedMessage?k.DetailedMessage:k.Message}catch(q){h.Message=j.message}l.setProgressResult(h)}})}var i=false;f.updateNavTools=function(j,l,h,k,q){var u=d.byId(h);if(u)d.empty(u);else throw"could not find toolbar "+h;j.getService("orion.page.command").then(d.hitch(l,function(r){r.renderCommands(u,"dom",q,l,"image",null,null,true);if(k){var t=d.create("span",{id:k},u,"last");r.renderCommands(t,"dom",null,l,"image",null,null,true)}}));if(!i){i=
true;j.getService("orion.page.selection").then(function(r){r.addEventListener("selectionChanged",function(t,v){var A=d.byId(k);if(A){d.empty(A);j.getService("orion.page.command").then(function(x){x.renderCommands(A,"dom",v,l,"image",null,null,true)})}})})}};f.getNewItemName=function(j,l,h,k,q,u,r,t){var v;if(h)j=d.byId(k);else if(l=l.makeNewItemPlaceHolder(j,k,r)){j=l.refNode;v=l.tempNode}else j=d.byId(k);if(j)c.getUserText(k+"EditBox",j,false,q,d.hitch(this,function(A){if(A){v&&v.parentNode.removeChild(v);
u(A)}}),undefined,undefined,undefined,t);else(k=window.prompt(q))&&u(k)};f.handleKnownHostsError=function(j,l,h,k){confirm("Would you like to add "+l.KeyType+" key for host "+l.Host+" to continue operation? Key fingerpt is "+l.HostFingerprint+".")&&j.getService("orion.net.ssh").then(function(q){q.addKnownHosts(l.Host+" "+l.KeyType+" "+l.HostKey).then(function(){q.getKnownHosts().then(function(u){h.knownHosts=u;k(h)})})})};f.handleSshAuthenticationError=function(j,l,h,k,q){j=new orion.git.widgets.GitCredentialsDialog({title:q,
serviceRegistry:j,func:k,errordata:h.errordata});j.startup();j.show()};f.getDefaultSshOptions=function(j){var l=new d.Deferred;j.getService("orion.net.ssh").then(function(h){h.getKnownHosts().then(function(k){l.callback({knownHosts:k,gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""})})});return l};f.handleProgressServiceResponse=function(j,l,h,k,q,u){if(j.Running==false){if(j.Result&&j.Result.HttpCode==403){if(j.Result.JsonData&&j.Result.JsonData.HostKey){d.hitch(this,f.handleKnownHostsError)(h,
j.Result.JsonData,l,q);return}}else if(j.Result&&j.Result.HttpCode==401){if(j.Result.JsonData)l.errordata=j.Result.JsonData;d.hitch(this,f.handleSshAuthenticationError)(h,j.Result.JsonData,l,q,u);return}if(j.Result&&j.Result.HttpCode!=200)console.error("error "+j.Result.HttpCode+" while running operation: "+j.Result.DetailedMessage);else k&&k(j)}};f.createFileCommands=function(j,l,h){var k=new a.Command({name:"Link Repository",imageClass:"core-sprite-link",id:"eclipse.linkRepository",callback:function(r){var t=
new orion.widgets.NewItemDialog({title:"Link Repository",label:"Folder name:",func:function(v){j.getService("orion.core.file").then(function(A){A.loadWorkspace("").then(function(x){A.createProject(x.Location,v,r.ContentLocation,false).then(function(m){alert("Repository was linked to "+m.Name);A.read(m.ContentLocation,true).then(function(o){window.location.replace(e.toUrl("navigate/table.html")+"#"+o.ChildrenLocation)})})})})},advanced:false});t.startup();t.show()},visibleWhen:function(r){if(r.ContentLocation)return true;
return false}});l.addCommand(k,"object");k=new a.Command({name:"Checkout",tooltip:"Create a local branch corresponding with the current tag.",imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.checkoutTag",callback:function(r,t,v){function A(){for(var x in r.parent.parent.children)if(r.parent.parent.children[x].Name==="Branches")return r.parent.parent.children[x];return r.parent.parent}f.getNewItemName(r,h,false,v,"tag_"+r.Name,function(x){!x&&x==""||j.getService("orion.git.provider").then(function(m){m.checkoutTag(r.parent.parent.Location,
r.Name,x).then(function(){d.hitch(h,h.changedItem)(A())},g)})},undefined,true)},visibleWhen:function(r){return r.Type==="Tag"}});l.addCommand(k,"object");k=new a.Command({name:"Checkout",tooltip:"Make the branch or corresponding local branch active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first.",imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.checkoutBranch",callback:function(r){j.getService("orion.git.provider").then(function(t){r.Type===
"Branch"?t.checkoutBranch(r.CloneLocation,r.Name).then(function(){d.hitch(h,h.changedItem)(r.parent)},g):t.addBranch(r.parent.parent.BranchLocation,null,r.Name).then(function(v){t.checkoutBranch(v.CloneLocation,v.Name).then(function(){d.hitch(h,h.changedItem)(r.parent.parent.parent)},g)},g)})},visibleWhen:function(r){return r.Type==="Branch"||r.Type==="RemoteTrackingBranch"}});l.addCommand(k,"object");k=new a.Command({name:"New Branch",tooltip:"Add a new local branch to the repository",imageClass:"core-sprite-add",
id:"eclipse.addBranch",callback:function(r,t,v){f.getNewItemName(r,h,false,v,"Branch name",function(A){!A&&A==""||j.getService("orion.git.provider").then(function(x){x.addBranch(r.Location,A).then(function(){d.hitch(h,h.changedItem)(r)},g)})})},visibleWhen:function(r){return r.GroupNode&&r.Name==="Branches"}});l.addCommand(k,"object");k=new a.Command({name:"Delete",tooltip:"Delete the local branch from the repository",imageClass:"core-sprite-delete",id:"eclipse.removeBranch",callback:function(r){confirm("Are you sure you want to delete branch "+
r.Name+"?")&&j.getService("orion.git.provider").then(function(t){t.removeBranch(r.Location).then(function(){d.hitch(h,h.changedItem)(r.parent)},g)})},visibleWhen:function(r){return r.Type==="Branch"&&!r.Current}});l.addCommand(k,"object");k=new a.Command({name:"Delete",tooltip:"Delete the remote tracking branch from the repository",imageClass:"core-sprite-delete",id:"eclipse.removeRemoteBranch",callback:function(r){confirm("You're going to delete remote branch "+r.Name+" and push the change.\n\nAre you sure?")&&
f.getDefaultSshOptions(j).then(function(t){var v=arguments.callee;j.getService("orion.git.provider").then(function(A){j.getService("orion.page.message").then(function(x){var m=A.doPush(r.Location,"",false,false,null,t.gitSshUsername,t.gitSshPassword,t.knownHosts,t.gitPrivateKey,t.gitPassphrase);x.showWhile(m,"Removing remote branch: "+r.Name).then(function(o){f.handleProgressServiceResponse(o,t,j,function(p){p.Result.Severity=="Ok"&&d.hitch(h,h.changedItem)(r.parent)},v,"Delete Remote Branch")})})})})},
visibleWhen:function(r){return r.Type==="RemoteTrackingBranch"}});l.addCommand(k,"object");k=new a.Command({name:"New Remote",tooltip:"Add a new remote to the repository",imageClass:"core-sprite-add",id:"eclipse.addRemote",callback:function(r){var t=new orion.git.widgets.AddRemoteDialog({func:function(v,A){j.getService("orion.git.provider").then(function(x){x.addRemote(r.Location,v,A).then(function(){d.hitch(h,h.changedItem)(r)},g)})}});t.startup();t.show()},visibleWhen:function(r){return r.GroupNode&&
r.Name==="Remotes"}});l.addCommand(k,"object");k=new a.Command({name:"Delete",tooltip:"Delete the remote from the repository",imageClass:"core-sprite-delete",id:"eclipse.removeRemote",callback:function(r){confirm("Are you sure you want to delete remote "+r.Name+"?")&&j.getService("orion.git.provider").then(function(t){t.removeRemote(r.Location).then(function(){d.hitch(h,h.changedItem)(r.parent)},g)})},visibleWhen:function(r){return r.Type==="Remote"}});l.addCommand(k,"object");k=new a.Command({name:"Git Log",
tooltip:"Open the log for the branch",id:"eclipse.openGitLog",hrefCallback:function(r){if(r.Type==="RemoteTrackingBranch")return e.toUrl("git/git-log.html")+"#"+r.Location+"?page=1";return e.toUrl("git/git-log.html")+"#"+r.CommitLocation+"?page=1"},visibleWhen:function(r){return r.Type==="Branch"||r.Type==="RemoteTrackingBranch"}});l.addCommand(k,"object");k=new a.Command({name:"Git Log",tooltip:"Open the log for the repository",id:"eclipse.openGitLogAll",hrefCallback:function(r){return e.toUrl("git/git-log.html")+
"#"+r.CommitLocation+"?page=1"},visibleWhen:function(r){if(!r.CommitLocation||!r.StatusLocation)return false;return true}});l.addCommand(k,"object");k=new a.Command({name:"Git Status",tooltip:"Open the status for the repository",id:"eclipse.openGitStatus",hrefCallback:function(r){return e.toUrl("git/git-status.html")+"#"+r.StatusLocation},visibleWhen:function(r){if(!r.StatusLocation)return false;return true}});l.addCommand(k,"object");k=new a.Command({name:"Show in Navigator",tooltip:"Show the repository folder in the file navigator",
id:"eclipse.openCloneContent",hrefCallback:function(r){return e.toUrl("navigate/table.html")+"#"+r.ContentLocation+"?depth=1"},visibleWhen:function(r){if(!r.ContentLocation)return false;return true}});l.addCommand(k,"object");k=new a.Command({name:"Compare With Each Other",imageClass:"git-sprite-open_compare",spriteClass:"gitCommandSprite",id:"eclipse.compareGitCommits",hrefCallback:function(r){var t=new d.Deferred;j.getService("orion.git.provider").then(function(v){v.getDiff(r[0].DiffLocation,r[1].Name,
function(A,x){t.callback(e.toUrl("compare/compare.html")+"?readonly#"+x.xhr.getResponseHeader("Location"))})});return t},visibleWhen:function(r){if(h.isDirectory)return false;if(d.isArray(r)&&r.length===2&&r[0].Type==="Commit"&&r[1].Type==="Commit")return true;return false}});l.addCommand(k,"dom");k=new a.Command({name:"Compare With Working Tree",imageClass:"git-sprite-open_compare",spriteClass:"gitCommandSprite",id:"eclipse.compareWithWorkingTree",hrefCallback:function(r){return e.toUrl("compare/compare.html")+
"#"+r.DiffLocation},visibleWhen:function(r){return r.Type==="Commit"&&!h.isDirectory}});l.addCommand(k,"object");k=new a.Command({name:"Open",id:"eclipse.openGitCommit",hrefCallback:function(r){return e.toUrl("edit/edit.html")+"#"+r.ContentLocation},visibleWhen:function(r){return r.Type==="Commit"&&r.ContentLocation!=null&&!h.isDirectory}});l.addCommand(k,"object");k=new a.Command({name:"Fetch",tooltip:"Fetch from the remote",imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.fetch",
callback:function(r){var t=r.Location;f.getDefaultSshOptions(j).then(function(v){var A=arguments.callee;j.getService("orion.git.provider").then(function(x){j.getService("orion.page.message").then(function(m){var o=x.doFetch(t,false,null,v.gitSshUsername,v.gitSshPassword,v.knownHosts,v.gitPrivateKey,v.gitPassphrase);m.showWhile(o,"Fetching remote: "+t).then(function(p){f.handleProgressServiceResponse(p,v,j,function(){d.xhrGet({url:t,headers:{"Orion-Version":"1"},postData:d.toJson({GitSshUsername:v.gitSshUsername,
GitSshPassword:v.gitSshPassword,GitSshPrivateKey:v.gitPrivateKey,GitSshPassphrase:v.gitPassphrase,GitSshKnownHost:v.knownHosts}),handleAs:"json",timeout:5E3,load:function(n){return n},error:function(n,s){console.error("HTTP status code: ",s.xhr.status);return n}}).then(function(n){h.parentId==="explorer-tree"&&x.getLog(n.HeadLocation,n.Id,function(s,y){function w(B){h.renderer.setIncomingCommits(B.Children);h.loadCommitsList(n.CommitLocation+"?page=1",n,true)}if(y.xhr.status===200)w(s);else if(y.xhr.status===
202){var z=new d.Deferred;z.callback(s);j.getService("orion.page.message").then(function(B){B.showWhile(z,"Getting git incoming changes").then(function(D){w(D.Result.JsonData)})})}});r.Type==="Remote"&&d.hitch(h,h.changedItem)(r)},g)},A,"Fetch Git Repository")})})})})},visibleWhen:function(r){return r.Type==="RemoteTrackingBranch"||r.Type==="Remote"}});l.addCommand(k,"dom");l.addCommand(k,"object");k=new a.Command({name:"Force Fetch",tooltip:"Fetch from the remote branch into your remote tracking branch overriding its current content",
id:"eclipse.orion.git.fetchForce",callback:function(r){if(confirm("You're going to override content of the remote tracking branch. This can cause the branch to lose commits.\n\nAre you sure?")){var t=r.Location;f.getDefaultSshOptions(j).then(function(v){var A=arguments.callee;j.getService("orion.git.provider").then(function(x){j.getService("orion.page.message").then(function(m){var o=x.doFetch(t,true,null,v.gitSshUsername,v.gitSshPassword,v.knownHosts,v.gitPrivateKey,v.gitPassphrase);m.showWhile(o,
"Fetching remote: "+t).then(function(p){f.handleProgressServiceResponse(p,v,j,function(){d.xhrGet({url:t,headers:{"Orion-Version":"1"},postData:d.toJson({GitSshUsername:v.gitSshUsername,GitSshPassword:v.gitSshPassword,GitSshPrivateKey:v.gitPrivateKey,GitSshPassphrase:v.gitPassphrase,GitSshKnownHost:v.knownHosts}),handleAs:"json",timeout:5E3,load:function(n){return n},error:function(n,s){console.error("HTTP status code: ",s.xhr.status);return n}}).then(function(n){h.parentId==="explorer-tree"&&x.getLog(n.HeadLocation,
n.Id,function(s,y){function w(B){h.renderer.setIncomingCommits(B.Children);h.loadCommitsList(n.CommitLocation+"?page=1",n,true)}if(y.xhr.status===200)w(s);else if(y.xhr.status===202){var z=new d.Deferred;z.callback(s);j.getService("orion.page.message").then(function(B){B.showWhile(z,"Getting git incoming changes").then(function(D){w(D.Result.JsonData)})})}})},g)},A,"Fetch Git Repository")})})})})}},visibleWhen:function(r){return r.Type==="RemoteTrackingBranch"||r.Type==="Remote"}});l.addCommand(k,
"dom");l.addCommand(k,"object");k=new a.Command({name:"Merge",tooltip:"Merge the content from the branch to your active branch",imageClass:"git-sprite-merge",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.merge",callback:function(r){j.getService("orion.git.provider").then(function(t){t.doMerge(r.HeadLocation,r.Name).then(function(v){j.getService("orion.page.message").then(function(A){var x=[];if(v.jsonData&&(v.jsonData.Result=="FAST_FORWARD"||v.jsonData.Result=="ALREADY_UP_TO_DATE")){d.query(".treeTableRow").forEach(function(p){d.toggleClass(p,
"incomingCommitsdRow",false)});x.Severity="Ok";x.HTML=false;x.Message=v.jsonData.Result}else if(v.jsonData){var m=r.HeadLocation.replace("commit/HEAD","status");x.Severity="Warning";x.HTML=true;x.Message="<span>"+v.jsonData.Result+'. Go to <a href="'+e.toUrl("git/git-status.html")+"#"+m+'">Git Status page</a>.<span>'}else if(v.error){x.Severity="Error";if(v.error.responseText&&JSON.parse(v.error.responseText)){var o=JSON.parse(v.error.responseText);x.Message=o.DetailedMessage?o.DetailedMessage:o.Message}else x.Message=
v.error.message;x.HTML=true;x.Message="<span>"+x.Message+' Go to <a href="'+e.toUrl("git/git-status.html")+"#"+m+'">Git Status page</a>.<span>'}A.setProgressResult(x)})},function(v){j.getService("orion.page.message").then(function(A){var x=[],m=r.HeadLocation.replace("commit/HEAD","status");x.Severity="Error";x.HTML=true;x.Message="<span>"+d.fromJson(v.ioArgs.xhr.responseText).DetailedMessage+'. Go to <a href="'+e.toUrl("git/git-status.html")+"#"+m+'">Git Status page</a>.<span>';A.setProgressResult(x)})})})},
visibleWhen:function(r){return r.Type==="RemoteTrackingBranch"||r.Type==="Branch"&&!r.Current}});l.addCommand(k,"dom");l.addCommand(k,"object");k=new a.Command({name:"Rebase",tooltip:"Rewind commits from the active branch and replay them on top of the selected branch",id:"eclipse.orion.git.rebase",callback:function(r){j.getService("orion.git.provider").then(function(t){t.doRebase(r.HeadLocation,r.Name,"BEGIN",function(v){j.getService("orion.page.message").then(function(A){var x=[],m=r.HeadLocation.replace("commit/HEAD",
"status");if(v.Result=="OK"||v.Result=="FAST_FORWARD"||v.Result=="UP_TO_DATE"){x.Severity="Ok";x.HTML=false;x.Message=v.Result}else if(v.Result=="STOPPED"){x.Severity="Warning";x.HTML=true;x.Message="<span>"+v.Result+'. Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing. Go to <a href="'+e.toUrl("git/git-status.html")+"#"+m+'">Git Status page</a>.<span>'}else if(v.Result=="FAILED_WRONG_REPOSITORY_STATE"){x.Severity="Error";x.HTML=true;x.Message="<span>"+v.Result+
'. Repository state is invalid (i.e. already during rebasing). Go to <a href="'+e.toUrl("git/git-status.html")+"#"+m+'">Git Status page</a>.<span>'}else if(v.Result=="FAILED_UNMERGED_PATHS"){x.Severity="Error";x.HTML=true;x.Message="<span>"+v.Result+'. Repository contains unmerged paths. Go to <a href="'+e.toUrl("git/git-status.html")+"#"+m+'">Git Status page</a>.<span>'}else if(v.Result=="FAILED_PENDING_CHANGES"){x.Severity="Error";x.HTML=true;x.Message="<span>"+v.Result+'. Repository contains pending changes. Please commit or stash them. Go to <a href="'+
e.toUrl("git/git-status.html")+"#"+m+'">Git Status page</a>.<span>'}else{x.Severity="Warning";x.HTML=true;x.Message="<span>"+v.Result+'. Go to <a href="'+e.toUrl("git/git-status.html")+"#"+m+'">Git Status page</a>.<span>'}A.setProgressResult(x)})},g)})},visibleWhen:function(r){return r.Type==="RemoteTrackingBranch"||r.Type==="Branch"&&!r.Current}});l.addCommand(k,"dom");l.addCommand(k,"object");k=new a.Command({name:"Push All",tooltip:"Push commits and tags from your local branch into the remote branch",
imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.push",callback:function(r){var t=d.hash();if(r.toRef)r=r.toRef;if(r.RemoteLocation.length==1&&r.RemoteLocation[0].Children.length==1)f.getDefaultSshOptions(j).then(function(A){var x=arguments.callee;j.getService("orion.git.provider").then(function(m){j.getService("orion.page.message").then(function(o){var p=m.doPush(r.RemoteLocation[0].Children[0].Location,"HEAD",true,false,null,A.gitSshUsername,A.gitSshPassword,A.knownHosts,
A.gitPrivateKey,A.gitPassphrase);o.showWhile(p,"Pushing remote: "+t).then(function(n){f.handleProgressServiceResponse(n,A,j,function(s){s.Result.Severity=="Ok"&&d.query(".treeTableRow").forEach(function(y){d.toggleClass(y,"outgoingCommitsdRow",false)})},x,"Push Git Repository")})})})});else{var v=r.RemoteLocation;j.getService("orion.git.provider").then(function(A){A=new orion.git.widgets.RemotePrompterDialog({title:"Choose Branch",serviceRegistry:j,gitClient:A,treeRoot:{Children:v},hideNewBranch:true,
func:d.hitch(this,function(x,m){f.getDefaultSshOptions(j).then(function(o){var p=arguments.callee;j.getService("orion.git.provider").then(function(n){j.getService("orion.page.message").then(function(s){var y=n.doPush(x.Location,"HEAD",true,false,null,o.gitSshUsername,o.gitSshPassword,o.knownHosts,o.gitPrivateKey,o.gitPassphrase);s.showWhile(y,"Pushing remote: "+m.Name).then(function(w){f.handleProgressServiceResponse(w,o,j,function(z){z.Result.Severity=="Ok"&&d.query(".treeTableRow").forEach(function(B){d.toggleClass(B,
"outgoingCommitsdRow",false)})},p,"Push Git Repository")})})})})})});A.startup();A.show()})}},visibleWhen:function(r){return r.toRef?r.RepositoryPath===""&&r.toRef.Type==="Branch"&&r.toRef.Current&&r.toRef.RemoteLocation:r.Type==="Branch"&&r.Current&&r.RemoteLocation}});l.addCommand(k,"dom");l.addCommand(k,"object");k=new a.Command({name:"Force Push All",tooltip:"Push commits and tags from your local branch into the remote branch overriding its current content",imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",
id:"eclipse.orion.git.pushForce",callback:function(r){if(confirm("You're going to override content of the remote branch. This can cause the remote repository to lose commits.\n\nAre you sure?")){var t=d.hash();if(r.toRef)r=r.toRef;if(r.RemoteLocation.length==1&&r.RemoteLocation[0].Children.length==1)f.getDefaultSshOptions(j).then(function(A){var x=arguments.callee;j.getService("orion.git.provider").then(function(m){j.getService("orion.page.message").then(function(o){var p=m.doPush(r.RemoteLocation[0].Children[0].Location,
"HEAD",true,true,null,A.gitSshUsername,A.gitSshPassword,A.knownHosts,A.gitPrivateKey,A.gitPassphrase);o.showWhile(p,"Pushing remote: "+t).then(function(n){f.handleProgressServiceResponse(n,A,j,function(s){s.Result.Severity=="Ok"&&d.query(".treeTableRow").forEach(function(y){d.toggleClass(y,"outgoingCommitsdRow",false)})},x,"Push Git Repository")})})})});else{var v=r.RemoteLocation;j.getService("orion.git.provider").then(function(A){A=new orion.git.widgets.RemotePrompterDialog({title:"Choose Branch",
serviceRegistry:j,gitClient:A,treeRoot:{Children:v},hideNewBranch:true,func:d.hitch(this,function(x,m){f.getDefaultSshOptions(j).then(function(o){var p=arguments.callee;j.getService("orion.git.provider").then(function(n){j.getService("orion.page.message").then(function(s){var y=n.doPush(x.Location,"HEAD",true,true,null,o.gitSshUsername,o.gitSshPassword,o.knownHosts,o.gitPrivateKey,o.gitPassphrase);s.showWhile(y,"Pushing remote: "+m).then(function(w){f.handleProgressServiceResponse(w,o,j,function(z){z.Result.Severity==
"Ok"&&d.query(".treeTableRow").forEach(function(B){d.toggleClass(B,"outgoingCommitsdRow",false)})},p,"Push Git Repository")})})})})})});A.startup();A.show()})}}},visibleWhen:function(r){if(r.toRef)return r.RepositoryPath===""&&r.toRef.Type==="Branch"&&r.toRef.Current&&r.toRef.RemoteLocation}});l.addCommand(k,"dom");l.addCommand(k,"object");k=new a.Command({name:"Switch to Remote",tooltip:"Show the log for the corresponding remote tracking branch",id:"eclipse.orion.git.switchToRemote",hrefCallback:function(r){return e.toUrl("git/git-log.html")+
"#"+r.toRef.RemoteLocation[0].Children[0].Location+"?page=1"},visibleWhen:function(r){return r.toRef!=null&&r.toRef.Type==="Branch"&&r.toRef.Current&&r.toRef.RemoteLocation&&r.toRef.RemoteLocation.length===1&&r.toRef.RemoteLocation[0].Children.length===1}});l.addCommand(k,"dom");var q=function(){var r=/[\?&]page=([^&#]*)/.exec(window.location.href);if(r!=null)try{return parseInt(r[1])}catch(t){console.error(t)}},u=function(r,t){return r.replace(/page=([0-9]*)/,"page="+t)};k=new a.Command({name:"< Previous Page",
tooltip:"Show previous page of git log",id:"eclipse.orion.git.previousLogPage",hrefCallback:function(){return e.toUrl("git/git-log.html")+"#"+u(d.hash(),q(d.hash())-1)},visibleWhen:function(r){if(r.Type==="RemoteTrackingBranch"||r.toRef!=null&&r.toRef.Type==="Branch")return q(d.hash())>1;return false}});l.addCommand(k,"dom");k=new a.Command({name:"Next Page >",tooltip:"Show next page of git log",id:"eclipse.orion.git.nextLogPage",hrefCallback:function(){return e.toUrl("git/git-log.html")+"#"+u(d.hash(),
q(d.hash())+1)},visibleWhen:function(r){if(r.Type==="RemoteTrackingBranch"||r.toRef!=null&&r.toRef.Type==="Branch"){if(r.Children)return r.Children.length>0;return true}return false}});l.addCommand(k,"dom");k=new a.Command({name:"Switch to Active Local",tooltip:"Show the log for the active local branch",id:"eclipse.orion.git.switchToCurrentLocal",hrefCallback:function(r){var t=new d.Deferred,v=r.CloneLocation;if(v==null)v=JSON.parse(r.responseText).JsonData.CloneLocation;d.xhrGet({url:v,headers:{"Orion-Version":"1"},
handleAs:"json",timeout:5E3,load:function(A){d.xhrGet({url:A.Children[0].BranchLocation,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(x){d.forEach(x.Children,function(m){m.Current==true&&t.callback(e.toUrl("git/git-log.html")+"#"+m.CommitLocation+"?page=1")})}})}});return t},visibleWhen:function(r){if(r.Type==="RemoteTrackingBranch")return true;try{if(JSON.parse(r.responseText).JsonData)return true}catch(t){}return false}});l.addCommand(k,"dom");k=new a.Command({name:"Push to...",
tooltip:"Push from your local branch into the selected remote branch",imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushto",callback:function(r){var t={};for(var v in r.parent.parent.children)if(r.parent.parent.children[v].Name==="Remote")t=r.parent.parent.children[v];j.getService("orion.git.provider").then(function(A){A=new orion.git.widgets.RemotePrompterDialog({title:"Choose Branch",serviceRegistry:j,gitClient:A,treeRoot:t,func:d.hitch(this,function(x,m,o){console.info("Branch "+
x+" remote "+m+" new branch "+o)})});A.startup();A.show()})},visibleWhen:function(){return false}});l.addCommand(k,"dom");l.addCommand(k,"object");k=new a.Command({name:"Reset",tooltip:"Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes.",imageClass:"git-sprite-refresh",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.resetIndex",callback:function(r){confirm("The content of your active branch will be replaced with "+r.Name+". All unstaged and staged changes will be discarded and cannot be recovered. Are you sure?")&&
j.getService("orion.git.provider").then(function(t){j.getService("orion.page.message").then(function(v){v.setProgressMessage("Resetting index...");t.resetIndex(r.IndexLocation,r.Name).then(function(){var A={};A.Severity="Info";A.HTML=false;A.Message="Ok";v.setProgressResult(A)},function(A){var x={};x.Severity="Error";x.HTML=false;x.Message=A.message;v.setProgressResult(x)})})})},visibleWhen:function(r){return r.Type==="RemoteTrackingBranch"}});l.addCommand(k,"object");k=new a.Command({name:"Tag",
tooltip:"Create a tag for the commit",imageClass:"git-sprite-tag",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.addTag",callback:function(r,t,v){var A=new d.Deferred;f.getNewItemName(r,h,false,v,"Tag name",function(x){if(!(!x||x==="")){j.getService("orion.git.provider").then(function(m){m.doAddTag(r.Location,x).then(function(o){o=o.Location.replace(/[^\.\:\-\_0-9A-Za-z]/g,"");o=d.byId(o);d.place(document.createTextNode(x),d.create("p",{style:"margin: 5px"},o.children[6],"last"),"only")},function(o){j.getService("orion.page.message").then(function(p){var n=
[];n.Severity="Error";n.HTML=false;var s=JSON.parse(o.responseText);n.Message=s.DetailedMessage?s.DetailedMessage:s.Message;p.setProgressResult(n)})})});return A}},4)},visibleWhen:function(r){return r.Type==="Commit"}});l.addCommand(k,"object");k=new a.Command({name:"Cherry-Pick",tooltip:"Apply the change introduced by the commit to your active branch",id:"eclipse.orion.git.cherryPick",callback:function(r){var t=d.hash();j.getService("orion.git.provider").then(function(v){var A=r.Location.replace(r.Name,
"HEAD");v.doCherryPick(A,r.Name,function(x){j.getService("orion.page.message").then(function(m){var o=[],p=r.Location.replace("commit/"+r.Name,"status");if(x.Result=="OK"){o.Severity="Ok";if(x.HeadUpdated){o.HTML=false;o.Message=x.Result;h.parentId==="explorer-tree"&&d.xhrGet({url:t,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(n){return n},error:function(n,s){console.error("HTTP status code: ",s.xhr.status)}}).then(function(n){n.HeadLocation?v.getLog(n.HeadLocation,n.Id,
function(s,y){function w(B){h.renderer.setIncomingCommits(B.Children);h.loadCommitsList(n.CommitLocation+"?page=1",n,true)}if(y.xhr.status===200)w(s);else if(y.xhr.status===202){var z=new d.Deferred;z.callback(s);j.getService("orion.page.message").then(function(B){B.showWhile(z,"Getting git incoming changes").then(function(D){w(D.Result.JsonData)})})}}):v.getLog(t,"HEAD",function(s,y){function w(B){h.renderer.setOutgoingCommits(B.Children);h.loadCommitsList(t,n,true)}if(y.xhr.status===200)w(s);else if(y.xhr.status===
202){var z=new d.Deferred;z.callback(s);j.getService("orion.page.message").then(function(B){B.showWhile(z,"Getting git outgoing changes").then(function(D){w(D.Result.JsonData)})})}})})}else{o.HTML=true;o.Message="<span>Nothing changed.</span>"}}else if(x.Result=="CONFLICTING"){o.Severity="Warning";o.HTML=true;o.Message="<span>"+x.Result+'. Some conflicts occurred. Go to <a href="'+e.toUrl("git/git-status.html")+"#"+p+'">Git Status page</a>.<span>'}else if(x.Result=="FAILED"){o.Severity="Error";o.HTML=
true;o.Message="<span>"+x.Result+'. Go to <a href="'+e.toUrl("git/git-status.html")+"#"+p+'">Git Status page</a>.<span>'}else{o.Severity="Warning";o.HTML=false;o.Message=x.Result}m.setProgressResult(o)})},g)})},visibleWhen:function(r){return r.Type==="Commit"}});l.addCommand(k,"object")};f.createStatusCommands=function(j,l,h,k,q){var u=new a.Command({name:"Fetch",tooltip:"Fetch from the remote branch into your remote tracking branch",imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.fetch",
callback:function(r){var t=r.Location;f.getDefaultSshOptions(j).then(function(v){var A=arguments.callee;j.getService("orion.git.provider").then(function(x){j.getService("orion.page.message").then(function(m){var o=x.doFetch(t,false,null,v.gitSshUsername,v.gitSshPassword,v.knownHosts,v.gitPrivateKey,v.gitPassphrase);m.showWhile(o,"Fetching remote: "+t).then(function(p){f.handleProgressServiceResponse(p,v,j,function(){d.xhrGet({url:t,headers:{"Orion-Version":"1"},postData:d.toJson({GitSshUsername:v.gitSshUsername,
GitSshPassword:v.gitSshPassword,GitSshPrivateKey:v.gitPrivateKey,GitSshPassphrase:v.gitPassphrase,GitSshKnownHost:v.knownHosts}),handleAs:"json",timeout:5E3,load:function(n){return n},error:function(n,s){console.error("HTTP status code: ",s.xhr.status)}}).then(function(n){x.getLog(n.HeadLocation,n.Id,function(s,y){function w(B){q._gitCommitNavigatorRem.renderer.setIncomingCommits(B.Children);q._gitCommitNavigatorRem.loadCommitsList(n.CommitLocation+"?page=1&pageSize=5",n,true)}if(y.xhr.status===200)w(s);
else if(y.xhr.status===202){var z=new d.Deferred;z.callback(s);j.getService("orion.page.message").then(function(B){B.showWhile(z,"Getting git incoming changes").then(function(D){w(D.Result.JsonData)})})}})})},A,"Fetch Git Repository")})})})})},visibleWhen:function(r){return r.Type==="RemoteTrackingBranch"}});l.addCommand(u,"object");l.registerCommandContribution("eclipse.orion.git.fetch",k+1);u=new a.Command({name:"Merge",tooltip:"Merge the content from the branch to your active branch",imageClass:"git-sprite-merge",
spriteClass:"gitCommandSprite",id:"eclipse.orion.git.merge",callback:function(r){j.getService("orion.git.provider").then(function(t){t.doMerge(r.HeadLocation,r.Name).then(function(v){j.getService("orion.page.message").then(function(A){var x=[];if(v.jsonData&&(v.jsonData.Result=="FAST_FORWARD"||v.jsonData.Result=="ALREADY_UP_TO_DATE")){d.query(".treeTableRow").forEach(function(p){d.toggleClass(p,"incomingCommitsdRow",false)});x.Severity="Ok";x.HTML=false;x.Message=v.jsonData.Result;h();A.setProgressResult(x)}else if(v.jsonData){var m=
r.HeadLocation.replace("commit/HEAD","status");x.Severity="Warning";x.HTML=true;x.Message="<span>"+v.jsonData.Result+'. Go to <a href="'+e.toUrl("git/git-status.html")+"#"+m+'">Git Status page</a>.<span>';A.setProgressResult(x)}else if(v.error){x.Severity="Error";if(v.error.responseText&&JSON.parse(v.error.responseText)){var o=JSON.parse(v.error.responseText);x.Message=o.DetailedMessage?o.DetailedMessage:o.Message}else x.Message=v.error.message;x.HTML=true;x.Message="<span>"+x.Message+' Go to <a href="'+
e.toUrl("git/git-status.html")+"#"+m+'">Git Status page</a>.<span>';A.setProgressResult(x)}})},function(v){j.getService("orion.page.message").then(function(A){var x=[],m=r.HeadLocation.replace("commit/HEAD","status");x.Severity="Error";x.HTML=true;x.Message="<span>"+d.fromJson(v.ioArgs.xhr.responseText).DetailedMessage+'. Go to <a href="'+e.toUrl("git/git-status.html")+"#"+m+'">Git Status page</a>.<span>';A.setProgressResult(x)})})})},visibleWhen:function(r){return r.Type==="RemoteTrackingBranch"||
r.Type==="Branch"&&!r.Current}});l.addCommand(u,"object");l.registerCommandContribution("eclipse.orion.git.merge",k+2);u=new a.Command({name:"Push",tooltip:"Push from your local branch into the remote branch",imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.push",callback:function(r){var t=d.hash();if(r.RemoteLocation.length==1&&r.RemoteLocation[0].Children.length==1)f.getDefaultSshOptions(j).then(function(A){var x=arguments.callee;j.getService("orion.git.provider").then(function(m){j.getService("orion.page.message").then(function(o){var p=
m.doPush(r.RemoteLocation[0].Children[0].Location,"HEAD",true,false,null,A.gitSshUsername,A.gitSshPassword,A.knownHosts,A.gitPrivateKey,A.gitPassphrase);o.showWhile(p,"Pushing remote: "+t).then(function(n){f.handleProgressServiceResponse(n,A,j,function(s){if(s.Result.Severity=="Ok"){d.query(".treeTableRow").forEach(function(y){d.toggleClass(y,"outgoingCommitsdRow",false)});h()}},x,"Push Git Repository")})})})});else{var v=r.RemoteLocation;j.getService("orion.git.provider").then(function(A){A=new orion.git.widgets.RemotePrompterDialog({title:"Choose Branch",
serviceRegistry:j,gitClient:A,treeRoot:{Children:v},hideNewBranch:true,func:d.hitch(this,function(x,m){f.getDefaultSshOptions(j).then(function(o){var p=arguments.callee;j.getService("orion.git.provider").then(function(n){j.getService("orion.page.message").then(function(s){var y=n.doPush(x.Location,"HEAD",true,false,null,o.gitSshUsername,o.gitSshPassword,o.knownHosts,o.gitPrivateKey,o.gitPassphrase);s.showWhile(y,"Pushing remote: "+m).then(function(w){f.handleProgressServiceResponse(w,o,j,function(z){if(z.Result.Severity==
"Ok"){d.query(".treeTableRow").forEach(function(B){d.toggleClass(B,"outgoingCommitsdRow",false)});h()}},p,"Push Git Repository")})})})})})});A.startup();A.show()})}},visibleWhen:function(r){return r.Type==="LocalBranch"}});l.addCommand(u,"object");l.registerCommandContribution("eclipse.orion.git.push",k+3)};f.createGitClonesCommands=function(j,l,h,k,q,u){k=new a.Command({name:"Clone Repository",tooltip:"Clone an existing Git repository to a folder",id:"eclipse.cloneGitRepository",callback:function(){var r=
new orion.git.widgets.CloneGitRepositoryDialog({serviceRegistry:j,fileClient:u,func:function(t,v,A){f.getDefaultSshOptions(j).then(function(x){var m=arguments.callee;j.getService("orion.git.provider").then(function(o){j.getService("orion.page.message").then(function(p){var n=o.cloneGitRepository(A,t,v,h.defaultPath,x.gitSshUsername,x.gitSshPassword,x.knownHosts,x.gitPrivateKey,x.gitPassphrase);p.showWhile(n,"Cloning repository: "+t).then(function(s){f.handleProgressServiceResponse(s,x,j,function(){h.redisplayClonesList&&
d.hitch(h,h.redisplayClonesList)()},m,"Clone Git Repository")})})})})}});r.startup();r.show()},visibleWhen:function(){return true}});l.addCommand(k,"dom");k=new a.Command({name:"Init Repository",tooltip:"Create a new Git repository in a new folder",id:"eclipse.initGitRepository",callback:function(){var r=new orion.git.widgets.CloneGitRepositoryDialog({serviceRegistry:j,title:"Init Git Repository",fileClient:u,advancedOnly:true,func:function(t,v,A){f.getDefaultSshOptions(j).then(function(x){var m=
arguments.callee;j.getService("orion.git.provider").then(function(o){j.getService("orion.page.message").then(function(p){var n=o.cloneGitRepository(A,t,v,h.defaultPath);p.showWhile(n,"Initializing repository: "+A).then(function(s){f.handleProgressServiceResponse(s,x,j,function(){h.redisplayClonesList&&d.hitch(h,h.redisplayClonesList)()},m,"Init Git Repository")})})})})}});r.startup();r.show()},visibleWhen:function(){return true}});l.addCommand(k,"dom");k=new a.Command({name:"Delete",tooltip:"Delete the repository",
imageClass:"core-sprite-delete",id:"eclipse.git.deleteClone",visibleWhen:function(r){r=d.isArray(r)?r:[r];if(r.length===0)return false;for(var t=0;t<r.length;t++)if(!r[t].ContentLocation)return false;return true},callback:function(r){if(d.isArray(r)){if(confirm("Are you sure you want do delete "+r.length+" repositories?"))for(var t=0,v=0;v<r.length;v++)j.getService("orion.git.provider").then(function(A){A.removeGitRepository(r[v].Location).then(function(){t++;t>=r.length&&h.redisplayClonesList&&d.hitch(h,
h.redisplayClonesList)()},g)})}else confirm("Are you sure you want to delete "+r.Name+"?")&&j.getService("orion.git.provider").then(function(A){A.removeGitRepository(r.Location).then(function(){h.redisplayClonesList&&d.hitch(h,h.redisplayClonesList)()},g)})}});l.addCommand(k,"object");l.addCommand(k,"dom")}})();return f});
define("orion/git/git-commit-navigator",["dojo","orion/explorer","orion/util","orion/git/gitCommands"],function(e,d,a,c){var f={};f.GitCommitNavigator=function(){function g(i,j,l,h,k,q,u,r){this.registry=i;this.selection=j;this.checkbox=h!=null?h.checkbox:true;this.minimal=h!=null?h.minimal:false;this.parentId=k;this.pageTitleId=q;this.toolbarId=u;this.selectionToolsId=r;this.isDirectory=true;this.myTree=this.model=null;this.commitDetails=l;this.renderer=new f.GitCommitRenderer({checkbox:this.checkbox,
cachePrefix:"GitCommitsNavigator",minimal:this.minimal},this);this.commitDetails&&this.commitDetails.render(null)}g.prototype=new d.Explorer;g.prototype.loadCommitsList=function(i,j,l){var h=new e.Deferred;i=a.makeRelative(i);if(i===this._lastHash&&!l){h.callback();return h}this._lastHash=i;this._lastTreeRoot=j;var k=e.byId(this.parentId);(l=e.byId(k.id+"progress"))||(l=e.create("div",{id:k.id+"progress"},k,"only"));e.empty(l);if(j.status&&j.status!=200){k=j.message;try{var q=JSON.parse(j.responseText);
if(q.Message)k=q.Message}catch(u){}j.status!=404&&k!==""&&e.create("b",{innerHTML:"Error "+j.status+": "},l,"only");e.place(document.createTextNode(k),l,"last");this.toolbarId&&this.selectionToolsId&&c.updateNavTools(this.registry,this,this.toolbarId,this.selectionToolsId,j);h.callback();return h}b=e.create("b");e.place(document.createTextNode("Loading "),l,"last");e.place(document.createTextNode(i),b,"last");e.place(b,l,"last");e.place(document.createTextNode("..."),l,"last");var r=this;this.toolbarId&&
this.selectionToolsId&&c.updateNavTools(this.registry,this,this.toolbarId,this.selectionToolsId,j);this.registry.getService("orion.git.provider").then(function(t){var v=function(A,x){var m=new e.Deferred;t.doGitLog(A,function(o,p){if(p.xhr.status===200){h.callback();x?x(o.Children):m.callback(o.Children)}if(p.xhr.status===202){var n=new e.Deferred;n.callback(o);r.registry.getService("orion.page.message").then(function(s){s.showWhile(n,"Getting git log").then(function(y){h.callback();x?x(y.Result.JsonData.Children):
m.callback(y.Result.JsonData.Children)})})}});return m};if(j.Children){e.hitch(r,r.createTree(r.parentId,new d.ExplorerFlatModel(i,v,j.Children)));h.callback()}else e.hitch(r,r.createTree(r.parentId,new d.ExplorerFlatModel(i,v)))});return h};g.prototype.loadCommitDetails=function(i){this.commitDetails&&this.commitDetails.loadCommitDetails(i)};return g}();f.GitCommitRenderer=function(){function g(i,j){this._init(i);this.options=i;this.explorer=j}g.prototype=new d.SelectionRenderer;g.prototype.getCellHeaderElement=
function(i){if(!this.options.minimal)switch(i){case 0:return e.create("th",{style:"padding-left: 5px; padding-right: 5px",innerHTML:"<h2>Message</h2>"});case 1:return e.create("th",{style:"padding-left: 5px; padding-right: 5px",innerHTML:"<h2>Author</h2>"});case 2:return e.create("th",{style:"padding-left: 5px; padding-right: 5px",innerHTML:"<h2>Date</h2>"});case 3:return e.create("th",{style:"padding-left: 5px; padding-right: 5px",innerHTML:"<h2>Actions</h2>"});case 4:return e.create("th",{style:"padding-left: 5px; padding-right: 5px",
innerHTML:"<h2>Branches</h2>"});case 5:return e.create("th",{style:"padding-left: 5px; padding-right: 5px",innerHTML:"<h2>Tags</h2>"})}};g.prototype.setIncomingCommits=function(i){this.incomingCommits=i};g.prototype.setOutgoingCommits=function(i){this.outgoingCommits=i};g.prototype.getCellElement=function(i,j,l){var h=false;e.forEach(this.incomingCommits,function(t){if(j.Name===t.Name)h=true});var k=false;e.forEach(this.outgoingCommits,function(t){if(j.Name===t.Name)k=true});switch(i){case 0:var q,
u;i=document.createElement("td");q=e.create("div",{style:"margin-left: 5px; margin-right: 5px; margin-top: 5px; margin-bottom: 5px; padding-left: 20px;"},i,"only");u=e.create("a",{className:"navlinkonpage"},q,"last");if(this.explorer.commitDetails){e.connect(u,"onclick",u,e.hitch(this,function(){this.explorer.loadCommitDetails(j)}));e.connect(u,"onmouseover",u,function(){u.style.cursor="pointer"});e.connect(u,"onmouseout",u,function(){u.style.cursor="default"})}e.place(document.createTextNode(j.Message),
u,"only");if(h)e.toggleClass(l,"incomingCommitsdRow",true);else k&&e.toggleClass(l,"outgoingCommitsdRow",true);return i;case 1:return e.create("td",{style:"padding-left: 5px; padding-right: 5px",innerHTML:j.AuthorName+" ("+j.AuthorEmail+")"});case 2:return e.create("td",{style:"padding-left: 5px; padding-right: 5px",innerHTML:e.date.locale.format(new Date(j.Time),{formatLength:"short"})});case 3:if(this.options.minimal)break;l=this.getActionsColumn(j,l);e.style(l,"padding-left","5px");e.style(l,"padding-right",
"5px");return l;case 4:if(this.options.minimal)break;var r=document.createElement("td",{style:"padding-left: 5px; padding-right: 5px"});e.forEach(j.Branches,function(t){e.place(document.createTextNode(t.FullName),e.create("p",{style:"margin: 5px"},r,"last"),"only")});return r;case 5:if(this.options.minimal)break;r=document.createElement("td",{style:"padding-left: 5px; padding-right: 5px"});e.forEach(j.Tags,function(t){e.place(document.createTextNode(t.Name),e.create("p",{style:"margin: 5px"},r,"last"),
"only")});return r}};return g}();return f});
define("orion/git/git-status-table",["require","dojo","orion/compare/diff-provider","orion/compare/compare-container","orion/commands","orion/git/git-commit-navigator","orion/git/gitCommands","dijit/layout/ContentPane"],function(e,d,a,c,f,g,i){var j=j||{};j.GitStatusModel=function(){function l(){this.selectedItem=this.selectedFileId=undefined;this.interestedUnstagedGroup=["Missing","Modified","Untracked","Conflicting"];this.interestedStagedGroup=["Added","Changed","Removed"];this.conflictPatterns=
[["Both","Modified","Added","Changed","Missing"],["RemoteDelete","Untracked","Removed"],["LocalDelete","Modified","Added","Missing"]];this.conflictType="Conflicting"}l.prototype={destroy:function(){},interestedCategory:function(){},init:function(h){this.items=h},getModelType:function(h,k){return k},_markConflict:function(h){var k=this.getGroupData(h[1]);if(k)for(var q=0;q<k.length;q++)if(!k[q].Conflicting){for(var u=k[q].Location,r=[],t=2;t<h.length;t++){var v=this.getGroupData(h[t]);if(v)(v=this._findSameFile(u,
v))&&r.push(v)}if(r.length===h.length-2){k[q].Conflicting=h[0];for(u=0;u<r.length;u++)r[u].Conflicting="Hide"}}},_findSameFile:function(h,k){for(var q=0;q<k.length;q++)if(!k[q].Conflicting)if(h===k[q].Location)return k[q]},getGroupData:function(h){return this.items[h]},isConflict:function(h){return h===this.conflictType},isStaged:function(h){for(var k=0;k<this.interestedStagedGroup.length;k++)if(h===this.interestedStagedGroup[k])return true;return false}};return l}();j.statusTypeMap={Missing:[e.toUrl("git/images/removal.gif"),
"Unstaged removal",e.toUrl("git/images/stage.gif"),"Stage"],Removed:[e.toUrl("git/images/removal.gif"),"Staged removal",e.toUrl("git/images/unstage.gif"),"Unstage"],Modified:[e.toUrl("git/images/modification.gif"),"Unstaged change",e.toUrl("git/images/stage.gif"),"Stage"],Changed:[e.toUrl("git/images/modification.gif"),"Staged change",e.toUrl("git/images/unstage.gif"),"Unstage"],Untracked:[e.toUrl("git/images/addition.gif"),"Unstaged add",e.toUrl("git/images/stage.gif"),"Stage"],Added:[e.toUrl("git/images/addition.gif"),
"Staged add",e.toUrl("git/images/unstage.gif"),"Unstage"],Conflicting:[e.toUrl("git/images/conflict-file.gif"),"Conflicting",e.toUrl("git/images/stage.gif"),"Resolve Conflict"]};j.GitStatusContentRenderer=function(){function l(h,k,q,u){this._registry=k;this._useCheckboxSelection=h.useCheckBox===undefined?false:h.useCheckBox;this._tableParentDivId=q;this._controller=u}l.prototype={initTable:function(){tableId=this._tableParentDivId+"_table";var h=d.byId(this._tableParentDivId);d.place(document.createTextNode(""),
h,"only");var k=d.create("table",{id:tableId});d.addClass(k,"statusTable");h.appendChild(k);this._table=k},getSelected:function(){var h=[];d.query(".selectionCheckmark"+this._tableParentDivId).forEach(d.hitch(this,function(k){if(k.checked){k=k.parentNode.parentNode;h.push({rowId:k.id,modelItem:k._item})}}));return h},toggleSelectAll:function(h){d.query(".selectionCheckmark"+this._tableParentDivId).forEach(d.hitch(this,function(k){k.checked=h;d.toggleClass(k.parentNode.parentNode,"checkedRow",!!h)}));
return[]},getCheckboxColumn:function(h){if(this._useCheckboxSelection){var k=document.createElement("td");d.addClass(k,"secondaryColumn");var q=d.create("input",{type:"checkbox",id:h.id+"selectedState"});d.addClass(q,"selectionCheckmark"+this._tableParentDivId);d.addClass(q,"statusCheckBoxRow");q.itemId=h.id;k.appendChild(q);d.connect(q,"onclick",d.hitch(this,function(u){d.toggleClass(h,"checkedRow",!!u.target.checked);this._controller._unstagedTableRenderer.renderAction();this._controller._stagedTableRenderer.renderAction();
this._controller._stagedTableRenderer.updateCheckbox();this._controller._unstagedTableRenderer.updateCheckbox()}));return k}return null},renderRow:function(h,k){var q=this,u=document.createElement("tr");u.id=h.name+"_"+h.type+"_row";u._item=h;k%2?d.addClass(u,"darkTreeTableRow"):d.addClass(u,"lightTreeTableRow");this._table.appendChild(u);this._useCheckboxSelection&&u.appendChild(this.getCheckboxColumn(u));k=document.createElement("td");var r=document.createElement("img");r.src=j.statusTypeMap[h.type][0];
d.style(r,"verticalAlign","middle");k.appendChild(r);u.appendChild(k);k=document.createElement("td");k.noWrap=true;u.appendChild(k);var t=document.createElement("span");d.style(t,"verticalAlign","middle");t.id=u.id+"_nameSpan";d.place(document.createTextNode(h.name),t,"only");d.style(t,"color","#0000FF");t.title="Click to compare";k.appendChild(t);if(t.id===q._controller._model.selectedFileId){q._controller._model.selectedItem=h;d.toggleClass(t,"fileNameSelectedRow",true)}d.connect(t,"onmouseover",
t,function(){t.style.cursor=q._controller.loading?"wait":"pointer";d.toggleClass(t,"fileNameCheckedRow",true)});d.connect(t,"onmouseout",t,function(){t.style.cursor=q._controller.loading?"wait":"default";d.toggleClass(t,"fileNameCheckedRow",false)});d.connect(t,"onclick",t,function(){if(h.name!==q._controller._model.selectedFileId){if(q._controller._model.selectedFileId!==undefined){var A=document.getElementById(q._controller._model.selectedFileId);A&&d.toggleClass(A,"fileNameSelectedRow",false)}d.toggleClass(t,
"fileNameSelectedRow",true);q._controller._model.selectedFileId=t.id;q._controller.loadDiffContent(h)}});k=d.create("td",{id:u.id+"actions"},u,"last");d.addClass(k,"statusAction");k.noWrap=true;var v=d.create("span",{id:u.id+"actionsWrapper"},k,"only");d.style(v,"visibility","hidden");this._registry.getService("orion.page.command").then(function(A){A.renderCommands(v,"object",{type:"fileItem",object:h,rowId:u.id},this,"image",null)});d.connect(u,"onmouseover",u,function(){var A=d.byId(this.id+"actionsWrapper");
d.style(A,"visibility","visible")});d.connect(u,"onmouseout",u,function(){var A=d.byId(this.id+"actionsWrapper");d.style(A,"visibility","hidden")});if(this._controller._model.isStaged(h.type))this._controller.hasStaged=true;else this._controller.hasUnstaged=true}};return l}();j.GitStatusTableRenderer=function(){function l(h,k,q,u,r){this._registry=k;this._parentId=q;this._header=u;this._useCheckboxSelection=h.useCheckBox===undefined?false:h.useCheckBox;this._type=r}l.prototype={render:function(h){var k=
d.create("table",{},this._parentId);k=d.create("tr",null,k);this._useCheckboxSelection&&k.appendChild(this.getCheckboxColumn());var q=d.create("td",{},k,"last");d.create("h2",{innerHTML:this._header},q,"last");k=d.create("td",{nowrap:true},k,"last");k=d.create("div",{},k,"last");this._cmdSpan=d.create("span",null,k,"last");this._statusContentId=this._parentId+"_"+this._type;d.create("div",{id:this._statusContentId},this._parentId,"last");h&&d.create("table",{width:"100%",height:"10px"},this._parentId)},
select:function(h){this.checkBox.checked=h},disable:function(h){this.checkBox.disabled=h},updateCheckbox:function(){if(this.contentRenderer.totalRow!==0)this.contentRenderer.totalRow===this.contentRenderer.getSelected().length?this.select(true):this.select(false)},getCheckboxColumn:function(){if(this._useCheckboxSelection){var h=document.createElement("td");d.addClass(h,"secondaryColumn");var k=d.create("input",{type:"checkbox"});d.addClass(k,"statusCheckBoxOverall");this.checkBox=k;h.appendChild(k);
d.connect(k,"onclick",d.hitch(this,function(q){this.contentRenderer.toggleSelectAll(q.target.checked);this.renderAction()}));return h}},getStatusContentId:function(){return this._statusContentId},renderAction:function(){d.place(document.createTextNode(""),this._cmdSpan,"only");var h=this;this._registry.getService("orion.page.command").then(function(k){k.renderCommands(h._cmdSpan,"object",{type:h._type},this,"image",null)})}};return l}();j.GitCommitZoneRenderer=function(){function l(h,k){this._registry=
h;this._parentId=k}l.prototype={render:function(h){this._commitZone=d.create("div",null,this._parentId,"last");var k=d.create("table",{width:"100%"},this._commitZone);k=d.create("tr",null,k);k=d.create("td",{nowrap:true},k,"last");d.create("h2",{innerHTML:"Commit message:"},k,"last");k=d.create("table",null,this._commitZone);k=d.create("tr",null,k);var q=d.create("td",{nowrap:true},k,"last");d.create("textarea",{id:"commitMessage",COLS:40,ROWS:6},q,"last");k=d.create("td",{nowrap:true},k,"last");
k=d.create("div",{style:"float: left;",align:"left"},k,"last");k=d.create("table",null,k);q=d.create("tr",null,k);q=d.create("td",{nowrap:true},q,"last");d.create("button",{id:"commit",innerHTML:"Commit",title:"Record changes in the active branch"},q,"last");d.create("tr",{width:"100%",height:"20px"},k);k=d.create("tr",null,k);k=d.create("td",{nowrap:true},k,"last");d.create("input",{id:"amend",type:"checkbox",value:"Amend",title:"Amend last commit"},k,"last");k.appendChild(document.createTextNode(" Amend"));
h&&d.create("table",{width:"100%",height:"10px"},this._commitZone)},show:function(){this._commitZone.style.display=""},hide:function(){this._commitZone.style.display="none"}};return l}();j.GitRebaseZoneRenderer=function(){function l(h,k){this._registry=h;this._parentId=k}l.prototype={render:function(h){this._rebaseZone=d.create("div",null,this._parentId,"last");var k=d.create("table",{width:"100%"},this._rebaseZone);k=d.create("tr",null,k);k=d.create("td",{nowrap:true},k,"last");d.create("h2",{innerHTML:"Rebase in progress. Choose action:"},
k,"last");k=d.create("table",null,this._rebaseZone);k=d.create("tr",null,k);k=d.create("td",{nowrap:true},k,"last");k=d.create("div",{style:"float: left;",align:"left"},k,"last");this._cmdSpan=d.create("span",{id:"rebaseActions"},k,"last");h&&d.create("table",{width:"100%",height:"10px"},this._rebaseZone)},renderAction:function(){d.place(document.createTextNode(""),this._cmdSpan,"only");var h=this;this._registry.getService("orion.page.command").then(function(k){k.renderCommands(h._cmdSpan,"dom",{type:"rebase"},
this,"image",null,null)})},show:function(){this._rebaseZone.style.display=""},hide:function(){this._rebaseZone.style.display="none"}};return l}();j.GitCommitterAndAuthorZoneRenderer=function(){function l(h,k){this._registry=h;this._parentId=k}l.prototype={render:function(h){this._cmdSpanShow=d.create("span",{id:"personIdentShow"},this._parentId,"last");this._cmdSpanHide=d.create("span",{id:"personIdentHide"},this._parentId,"last");this._personIdentZone=d.create("div",null,this._parentId,"last");var k=
d.create("table",null,this._personIdentZone),q=d.create("tr",null,k),u=d.create("td",{nowrap:true},q,"last");d.create("h2",{innerHTML:"Committer name:"},u,"last");u=d.create("td",{nowrap:true},q,"last");this._committerName=d.create("input",{id:"committerName",type:"text"},u,"last");u=d.create("td",{nowrap:true},q,"last");d.create("h2",{innerHTML:"email:"},u,"last");q=d.create("td",{nowrap:true},q,"last");this._committerEmail=d.create("input",{id:"committerEmail",type:"text"},q,"last");k=d.create("tr",
null,k);u=d.create("td",{nowrap:true},k,"last");d.create("h2",{innerHTML:"Author name:\t"},u,"last");u=d.create("td",{nowrap:true},k,"last");this._authorName=d.create("input",{id:"authorName",type:"text"},u,"last");u=d.create("td",{nowrap:true},k,"last");d.create("h2",{innerHTML:"email:"},u,"last");q=d.create("td",{nowrap:true},k,"last");this._authorEmail=d.create("input",{id:"authorEmail",type:"text"},q,"last");h&&d.create("table",{width:"100%",height:"10px"},this._parentId)},renderAction:function(){d.place(document.createTextNode(""),
this._cmdSpanShow,"only");d.place(document.createTextNode(""),this._cmdSpanHide,"only");var h=this;this._registry.getService("orion.page.command").then(function(k){k.renderCommands(h._cmdSpanShow,"dom",{type:"personIdentShow"},this,"image",null,null);k.renderCommands(h._cmdSpanHide,"dom",{type:"personIdentHide"},this,"image",null,null)})},setDefaultPersonIdent:function(h,k){this._defName=h;this._defEmail=k},show:function(){this._personIdentZone.style.display="";this._cmdSpanHide.style.display="";
this._cmdSpanShow.style.display="none"},hide:function(){this._personIdentZone.style.display="none";this._cmdSpanHide.style.display="none";this._cmdSpanShow.style.display="";this.resetCommitterAndAuthor()},resetCommitterAndAuthor:function(){this._committerName.value=this._defName;this._committerEmail.value=this._defEmail;this._authorName.value=this._defName;this._authorEmail.value=this._defEmail}};return l}();j.GitLogTableRenderer=function(){function l(h,k,q,u,r){this._controller=h;this._registry=
k;this._parentId=q;this._header=u;this._type=r;this._sectionId=this._parentId+"_"+this._type+"_section"}l.prototype={render:function(h){d.create("div",{id:this._sectionId},this._parentId);var k=d.create("table",null,this._sectionId);k=d.create("tr",null,k);var q=d.create("td",null,k,"last");d.create("h2",{id:this._type+"_header",innerHTML:this._header},q,"last");q=d.create("td",null,k,"last");this._cmdSpanAdditional=d.create("span",{},q,"last");d.addClass(this._cmdSpanAdditional,"statusLogCmd");k=
d.create("td",null,k,"last");this._cmdSpan=d.create("span",{},k,"last");d.addClass(this._cmdSpan,"statusLogCmd");this._logContentId=this._parentId+"_"+this._type+"_content";k=d.create("div",{id:this._logContentId},this._sectionId,"last");d.addClass(k,"statusLogContent");h&&d.create("table",{width:"100%",height:"10px"},this._sectionId)},getLogContentId:function(){return this._logContentId},getLogSectionId:function(){return this._sectionId},modifyHeader:function(h){d.place(document.createTextNode("Recent commits on "+
h),this._type+"_header","only")},renderAction:function(){d.place(document.createTextNode(""),this._cmdSpan,"only");var h=this;this._registry.getService("orion.page.command").then(function(k){k.renderCommands(h._cmdSpan,"object",{type:h._type,object:h._controller},this,"image",null,null,true)})},renderAdditionalAction:function(h){d.place(document.createTextNode(""),this._cmdSpanAdditional,"only");var k=this;this._registry.getService("orion.page.command").then(function(q){q.renderCommands(k._cmdSpanAdditional,
"object",h,this,"image",null,null)})}};return l}();j.InlineCompareRenderer=function(){function l(h,k){this._registry=h;this._parentId=k}l.prototype={render:function(h){var k=d.create("table",{width:"100%"}),q=d.create("tr",null,k),u=d.create("td",{nowrap:true},q,"last");d.create("h2",{id:"fileNameInViewer",innerHTML:"Select a file on the left to compare..."},u,"last");u=new dijit.layout.ContentPane({region:"top"});d.addClass(u.domNode,"inlineCompareTitle");u.attr("content",k);var r=new dijit.layout.ContentPane({"class":"mainpane",
id:"inline-compare-viewer",splitter:false,region:"center"});d.addClass(r.domNode,"mainpane");d.addClass(r.domNode,"inlineCompareContent");var t=dijit.byId(this._parentId);t.addChild(u);t.addChild(r);if(h){td=document.createElement("td");td.id="rightContainerCommands";q.appendChild(td);td.noWrap=true;q.align="right";k.align="right"}}};return l}();j.GitStatusController=function(){function l(h,k,q,u){this._registry=k;this._commandService=q;this._statusService=u;this._model=new j.GitStatusModel;this._timerOn=
false;this._renderLog=h.renderLog?true:false;this._generateCommands();this._unstagedTableRenderer=new j.GitStatusTableRenderer({useCheckBox:true},k,"statusZone","Unstaged","unstagedItems");this._unstagedTableRenderer.render(true);this._stagedTableRenderer=new j.GitStatusTableRenderer({useCheckBox:true},k,"statusZone","Staged","stagedItems");this._stagedTableRenderer.render(true);this._commitZoneRenderer=new j.GitCommitZoneRenderer(k,"statusZone");this._commitZoneRenderer.render(true);this._rebaseZoneRenderer=
new j.GitRebaseZoneRenderer(k,"statusZone");this._rebaseZoneRenderer.render(true);this._committerAndAuthorZoneRenderer=new j.GitCommitterAndAuthorZoneRenderer(k,"statusZone");this._committerAndAuthorZoneRenderer.render(true);if(this._renderLog){this._logTableRenderer=new j.GitLogTableRenderer(this,k,"logZone","Recent commits on","gitLog");this._logTableRenderer.render(true);this._remoteTableRenderer=new j.GitLogTableRenderer(this,k,"logZone","Recent commits on","gitRemote");this._remoteTableRenderer.render(true)}(new j.InlineCompareRenderer(k,
"viewerZone")).render(true);this._generateInlineCompareCmds();this._unstagedContentRenderer=new j.GitStatusContentRenderer({useCheckBox:true},k,this._unstagedTableRenderer.getStatusContentId(),this);this._unstagedTableRenderer.contentRenderer=this._unstagedContentRenderer;this._stagedContentRenderer=new j.GitStatusContentRenderer({useCheckBox:true},k,this._stagedTableRenderer.getStatusContentId(),this);this._stagedTableRenderer.contentRenderer=this._stagedContentRenderer;this._inlineCompareContainer=
new c.InlineCompareContainer(new a.DiffProvider(k),k,"inline-compare-viewer");var r=this;r._staging=false;r._stagingConflict=false;this.startTimer();document.getElementById("commit").onclick=function(){r.commit()}}l.prototype={loadStatus:function(h){this._staging=false;this._model.init(h);this._getCloneInfo()},_processStatus:function(){this.initViewer();this._model.selectedFileId=null;this._loadBlock(this._unstagedContentRenderer,this._model.interestedUnstagedGroup);this._loadBlock(this._stagedContentRenderer,
this._model.interestedStagedGroup);this._stagedTableRenderer.disable(!this.hasStaged);this._unstagedTableRenderer.disable(!this.hasUnstaged);if(this._renderLog&&this._initializing){var h=this;this._registry.getService("orion.page.command").then(function(k){i.createStatusCommands(h._registry,k,function(){h.getGitStatus(h._url,true)},9,h)});this._renderLogs(false).then(function(){h._renderLogs(true)})}this._committerAndAuthorZoneRenderer.renderAction();this._unstagedTableRenderer.renderAction();this._stagedTableRenderer.renderAction();
if(this._renderLog){this._logTableRenderer.renderAction();this._remoteTableRenderer.renderAction()}this._renderGlobalActions();if(this._stagingConflict){this._stagingConflict=false;this.hasStaged||this.commit("Resolved deletion conflicts on file "+this._stagingName,false)}this._statusService.setProgressMessage("");if(this._model.items.RepositoryState.indexOf("REBASING")!=-1){this.rebaseState=true;this._rebaseZoneRenderer.renderAction();this._rebaseZoneRenderer.show();this._commitZoneRenderer.hide()}else{this.rebaseState=
false;this._commitZoneRenderer.show();this._rebaseZoneRenderer.hide()}},_commitReady:function(){var h=document.getElementById("amend");return this.hasStaged?true:h.checked?true:false},_prepareStage:function(h,k){this._staging=true;if(k)for(k=0;k<h.length;k++)d.style(h[k].rowId+"_nameSpan","color","#666666");else d.style(h+"_nameSpan","color","#666666")},_renderGlobalActions:function(){var h=d.byId("pageActions");d.place(document.createTextNode(""),h,"only");this._registry.getService("orion.page.command").then(function(k){k.renderCommands(h,
"dom",{type:"global"},this,"image",null,null,true)})},_processCloneInfo:function(){d.byId("logZone").style.display="block";this._curBranch=undefined;for(var h=0;h<this._branchInfo.Children.length;h++)if(this._branchInfo.Children[h].Current)this._curBranch=this._branchInfo.Children[h];this._curRemote=this._remoteInfo&&this._remoteInfo.Children&&this._remoteInfo.Children.length>0?this._remoteInfo.Children[0]:null;this._curClone=this._cloneInfo.Children[0];this._initTitleBar(true);this._committerAndAuthorZoneRenderer.setDefaultPersonIdent(this._userName,
this._userEmail);this._committerAndAuthorZoneRenderer.hide();var k=this,q=new f.Command({name:"Complete log",id:"orion.openGitLog",hrefCallback:function(){return e.toUrl("git/git-log.html")+"#"+(k._curBranch?k._curBranch.CommitLocation:k._model.items.CommitLocation)+"?page=1"},visibleWhen:function(r){return r.type==="gitLog"}}),u=new f.Command({name:"Complete log",id:"orion.openGitRemote",hrefCallback:function(){return e.toUrl("git/git-log.html")+"#"+k._curBranch.RemoteLocation[0].Children[0].Location+
"?page=1"},visibleWhen:function(r){return r.type==="gitRemote"&&k._curBranch&&k._curBranch.RemoteLocation.length===1&&k._curBranch.RemoteLocation[0].Children.length===1}});this._registry.getService("orion.page.command").then(function(r){r.addCommand(q,"object");r.addCommand(u,"object");r.registerCommandContribution("orion.openGitLog",8);r.registerCommandContribution("orion.openGitRemote",9)})},_initTitleBar:function(h){var k="",q=this._curBranch?this._curBranch.Name:"detached";if(h)k=this._curClone.Name+
" on "+q;document.title=k;d.place(document.createTextNode("Git Status"),"pageTitle","only");if(h){this._logTableRenderer.modifyHeader(q);if(this._curBranch&&this._curRemote){q=(this._curBranch.RemoteLocation.length>0?this._curBranch.RemoteLocation[0].Name:"")+"/"+this._curBranch.Name;this._remoteTableRenderer.modifyHeader(q)}d.place(document.createTextNode(this._curClone.Name+" on "+q),"location","only")}},_getCloneInfo:function(){var h=this;if(h._initializing){var k=h._model.items.CloneLocation;
h._registry.getService("orion.git.provider").then(function(q){q.getGitClone(k,function(u){h._cloneInfo=u;if(h._cloneInfo.Children.length===0){h._renderLog=false;h._initTitleBar();h._processStatus()}else h._registry.getService("orion.git.provider").then(function(r){r.getGitBranch(h._cloneInfo.Children[0].BranchLocation).then(function(t){h._branchInfo=t;r.getGitRemote(h._cloneInfo.Children[0].RemoteLocation).then(function(v){h._remoteInfo=v;v=h._cloneInfo.Children[0].ConfigLocation.replace("config",
"config/user.name");var A=function(x){h._userEmail=x;h._processCloneInfo();h._processStatus()};r.getGitCloneConfig(v).then(function(x){h._userName=x.Value;x=h._cloneInfo.Children[0].ConfigLocation.replace("config","config/user.email");r.getGitCloneConfig(x).then(function(m){A(m.Value)},function(){A("")})},function(){h._userName="";var x=h._cloneInfo.Children[0].ConfigLocation.replace("config","config/user.email");r.getGitCloneConfig(x).then(function(m){A(m.Value)},function(){A("")})})})})})})})}else h._processStatus()},
_renderLogs:function(h){var k=this;if(this._renderLog){var q=new d.Deferred;if(h){if(!this._curRemote||!this._curBranch||this._curBranch.RemoteLocation.length!==1||this._curBranch.RemoteLocation[0].Children.length!==1){d.empty(this._remoteTableRenderer.getLogSectionId());q.callback();return}this._gitCommitNavigatorRem=new g.GitCommitNavigator(this._registry,null,null,{checkbox:false,minimal:true},this._remoteTableRenderer.getLogContentId());d.place(document.createTextNode(""),this._remoteTableRenderer.getLogContentId(),
"only");var u=this._curBranch.RemoteLocation[0].Children[0].Location+"?page=1&pageSize=5";d.xhrGet({url:u,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(r){k._registry.getService("orion.git.provider").then(function(t){t.getLog(r.HeadLocation,r.Id,function(v,A){function x(o){k._gitCommitNavigatorRem.renderer.setIncomingCommits(o.Children);k._gitCommitNavigatorRem.loadCommitsList(r.CommitLocation+"?page=1&pageSize=5",r).then(function(){q.callback()});k._remoteTableRenderer.renderAdditionalAction(k._gitCommitNavigatorRem._lastTreeRoot)}
if(A.xhr.status===200)x(v);else if(A.xhr.status===202){var m=new d.Deferred;m.callback(v);k._registry.getService("orion.page.message").then(function(o){o.showWhile(m,"Getting git incoming changes").then(function(p){x(p.Result.JsonData)})})}})})},error:function(r,t){if(t.xhr.status==401||t.xhr.status==403){var v=this;mAuth.handleAuthenticationError(t.xhr,function(){d.xhrGet(v)})}else k._gitCommitNavigatorRem.loadCommitsList(u,r).then(function(){q.callback()});console.error("HTTP status code: ",t.xhr.status)}})}else{this._gitCommitNavigatorLog=
new g.GitCommitNavigator(this._registry,null,null,{checkbox:false,minimal:true},this._logTableRenderer.getLogContentId());d.place(document.createTextNode(""),this._logTableRenderer.getLogContentId(),"only");u=(k._curBranch?k._curBranch.CommitLocation:k._model.items.CommitLocation)+"?page=1&pageSize=5";d.xhrGet({url:u,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(r,t){function v(x){if(x.toRef==null||x.toRef.RemoteLocation.length!==1||x.toRef.RemoteLocation[0].Children.length!==
1||!k._curBranch){k._gitCommitNavigatorLog.loadCommitsList((k._curBranch?k._curBranch.CommitLocation:k._model.items.CommitLocation)+"?page=1&pageSize=5",{Type:"LocalBranch",RemoteLocation:x.toRef.RemoteLocation,Children:x.Children}).then(function(){q.callback()});k._curRemote&&k._curBranch&&k._logTableRenderer.renderAdditionalAction(k._gitCommitNavigatorLog._lastTreeRoot)}else d.xhrGet({url:x.toRef.RemoteLocation[0].Children[0].Location,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(m){k._registry.getService("orion.git.provider").then(function(o){o.getLog(m.CommitLocation,
"HEAD",function(p,n){function s(w){k._gitCommitNavigatorLog.renderer.setOutgoingCommits(w.Children);k._gitCommitNavigatorLog.loadCommitsList(k._curBranch.CommitLocation+"?page=1&pageSize=5",{Type:"LocalBranch",RemoteLocation:x.toRef.RemoteLocation,Children:x.Children}).then(function(){q.callback()});k._curRemote&&k._logTableRenderer.renderAdditionalAction(k._gitCommitNavigatorLog._lastTreeRoot)}if(n.xhr.status===200)s(p);else if(n.xhr.status===202){var y=new d.Deferred;y.callback(p);k._registry.getService("orion.page.message").then(function(w){w.showWhile(y,
"Getting git incoming changes").then(function(z){s(z.Result.JsonData)})})}})})},error:function(m,o){console.error("HTTP status code: ",o.xhr.status);if(o.xhr.status==401||o.xhr.status==403){var p=this;mAuth.handleAuthenticationError(o.xhr,function(){d.xhrGet(p)})}else{k._gitCommitNavigatorLog.loadCommitsList(u,{Type:"LocalBranch",RemoteLocation:x.toRef.RemoteLocation,Children:x.Children}).then(function(){q.callback()});k._curRemote&&k._curBranch&&k._logTableRenderer.renderAdditionalAction(k._gitCommitNavigatorLog._lastTreeRoot)}}})}
if(t.xhr.status===200)v(r);else if(t.xhr.status===202){var A=new d.Deferred;A.callback(r);k._registry.getService("orion.page.message").then(function(x){x.showWhile(A,"Getting git log").then(function(m){v(m.Result.JsonData)})})}},error:function(r,t){console.error("HTTP status code: ",t.xhr.status)}})}return q}},_generateCommands:function(){var h=this,k=new f.Command({name:"Side by Side Compare",tooltip:"Show the side-by-side compare",imageClass:"git-sprite-open_compare",spriteClass:"gitCommandSprite",
id:"orion.sbsCompare",hrefCallback:function(s){return h.openCompareEditor(s.object)},visibleWhen:function(s){return s.type==="fileItem"}}),q=new f.Command({name:"Change Committer or Author",id:"orion.showCommitterAndAuthor",callback:function(){h._committerAndAuthorZoneRenderer.show()},visibleWhen:function(s){return s.type==="personIdentShow"}}),u=new f.Command({name:"Use Default Committer and Author",id:"orion.hideCommitterAndAuthor",callback:function(){h._committerAndAuthorZoneRenderer.hide()},visibleWhen:function(s){return s.type===
"personIdentHide"}}),r=new f.Command({name:"Checkout",tooltip:"Discard the selected unstaged change",imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"orion.gitCheckout",callback:function(s){h._registry.getService("orion.page.dialog").then(function(y){y.confirm("Your changes to the file will be lost. Are you sure you want to checkout?",function(w){if(w){h._statusService.setProgressMessage("Checking out...");h.checkout(s.object)}})})},visibleWhen:function(s){return s.type==="fileItem"&&
!h._model.isStaged(s.object.type)}}),t=new f.Command({name:"Stage",tooltip:"Stage the change",imageClass:"git-sprite-stage",spriteClass:"gitCommandSprite",id:"orion.gitStage",callback:function(s){h._statusService.setProgressMessage("Staging...");h._prepareStage(s.rowId,false);return h.stage(s.object.indexURI,s.object)},visibleWhen:function(s){return s.type==="fileItem"&&!h._model.isStaged(s.object.type)}}),v=new f.Command({name:"Stage Selected",tooltip:"Stage the selected changes",imageClass:"git-sprite-stage_all",
spriteClass:"gitCommandSprite",id:"orion.gitStageAll",callback:function(){h._statusService.setProgressMessage("Staging...");return h.stageSelected()},visibleWhen:function(s){return s.type==="unstagedItems"&&h.hasUnstaged&&h._unstagedContentRenderer.getSelected().length>0}}),A=new f.Command({name:"Unstage",tooltip:"Unstage the change",imageClass:"git-sprite-unstage",spriteClass:"gitCommandSprite",id:"orion.gitUnstage",callback:function(s){h._statusService.setProgressMessage("Unstaging...");return h.unstage(s.object)},
visibleWhen:function(s){return s.type==="fileItem"&&h._model.isStaged(s.object.type)}}),x=new f.Command({name:"Unstage Selected",tooltip:"Unstage the selected changes",imageClass:"git-sprite-unstage_all",spriteClass:"gitCommandSprite",id:"orion.gitUnstageAll",callback:function(){h._statusService.setProgressMessage("Unstaging...");return h.unstageSelected("MIXED")},visibleWhen:function(s){return s.type==="stagedItems"&&h.hasStaged&&h._stagedContentRenderer.getSelected().length>0}}),m=new f.Command({name:"Reset",
tooltip:"Discard all staged and unstaged changes",imageClass:"git-sprite-refresh",spriteClass:"gitCommandSprite",id:"orion.gitResetChanges",callback:function(){h._registry.getService("orion.page.dialog").then(function(s){s.confirm("All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered.\nAre you sure you want to continue?",function(y){if(y){h._statusService.setProgressMessage("Resetting local changes...");return h.unstageAll("HARD")}})})},visibleWhen:function(){return h.hasStaged||
h.hasUnstaged}}),o=new f.Command({name:"Continue",tooltip:"Continue rebase",id:"orion.gitRebaseContinue",callback:function(){h._statusService.setProgressMessage("Continue rebase...");return h.rebase("CONTINUE")},visibleWhen:function(){return h.rebaseState}}),p=new f.Command({name:"Skip Patch",tooltip:"Skip patch",id:"orion.gitRebaseSkip",callback:function(){h._statusService.setProgressMessage("Skipping patch...");return h.rebase("SKIP")},visibleWhen:function(){return h.rebaseState}}),n=new f.Command({name:"Abort",
tooltip:"Abort rebase",id:"orion.gitRebaseAbort",callback:function(){h._statusService.setProgressMessage("Aborting rebase...");return h.rebase("ABORT")},visibleWhen:function(){return h.rebaseState}});this._registry.getService("orion.page.command").then(function(s){s.addCommand(k,"object");s.addCommand(t,"object");s.addCommand(r,"object");s.addCommand(v,"object");s.addCommand(x,"object");s.addCommand(A,"object");s.addCommand(m,"dom");s.addCommand(o,"dom");s.addCommand(p,"dom");s.addCommand(n,"dom");
s.addCommand(m,"dom");s.addCommand(q,"dom");s.addCommand(u,"dom");s.registerCommandContribution("orion.gitStage",1);s.registerCommandContribution("orion.gitCheckout",2);s.registerCommandContribution("orion.gitUnstage",3);s.registerCommandContribution("orion.sbsCompare",4);s.registerCommandContribution("orion.gitStageAll",5);s.registerCommandContribution("orion.gitUnstageAll",6);s.registerCommandContribution("orion.gitResetChanges",7,"pageActions");s.registerCommandContribution("orion.gitRebaseContinue",
8,"rebaseActions");s.registerCommandContribution("orion.gitRebaseSkip",9,"rebaseActions");s.registerCommandContribution("orion.gitRebaseAbort",10,"rebaseActions");s.registerCommandContribution("orion.showCommitterAndAuthor",11,"personIdentShow");s.registerCommandContribution("orion.hideCommitterAndAuthor",12,"personIdentHide")})},_generateInlineCompareCmds:function(){var h=this,k=new f.Command({name:"Next Diff",imageClass:"core-sprite-move_down",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",
callback:function(){h._inlineCompareContainer.nextDiff()}});this._commandService.addCommand(new f.Command({name:"Previous Diff",imageClass:"core-sprite-move_up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",callback:function(){h._inlineCompareContainer.prevDiff()}}),"dom");this._commandService.addCommand(k,"dom");this._commandService.registerCommandContribution("orion.compare.prevDiff",2,"rightContainerCommands");this._commandService.registerCommandContribution("orion.compare.nextDiff",
1,"rightContainerCommands");this._commandService.renderCommands("rightContainerCommands","dom",self,self,"image")},startTimer:function(){if(!this.timerOn){this.timerOn=true;this.doTimer()}},stopTimer:function(){if(this.timerOn&&this._timerId){this.timerOn=false;clearTimeout(this._timerId)}},doTimer:function(){var h=document.getElementById("commitMessage"),k=document.getElementById("commit");if(this._staging){k.disabled=true;h.disabled=false}else{k.disabled=!(this._commitReady()&&h.value!=="");h.disabled=
!this._commitReady()}this._timerId=setTimeout(d.hitch(this,function(){this.doTimer()}),150)},initViewer:function(){this._inlineCompareContainer.destroyEditor();this._model.selectedItem=null;this.hasUnstaged=this.hasStaged=false;d.place(document.createTextNode("Select a file on the left to compare..."),"fileNameInViewer","only");d.style("fileNameInViewer","color","#6d6d6d");d.empty("rightContainerCommands")},_createImgButton:function(h,k,q,u,r){var t=document.createElement("img");t.src=q;k.appendChild(t);
this.modifyImageButton(h,t,u,r)},_modifyImageButton:function(h,k,q,u,r,t){var v=this;if(r===undefined||!r){k.title=q;d.style(k,"opacity","0.4");d.connect(k,"onmouseover",k,function(){var A=false;if(t)A=t();k.style.cursor=v.loading?"wait":A?"default":"pointer";A?d.style(k,"opacity","0.4"):d.style(k,"opacity","1")});d.connect(k,"onmouseout",k,function(){k.style.cursor=v.loading?"wait":"default";d.style(k,"opacity","0.4")});k.onclick=function(A){var x=false;if(t)x=t();if(h&&!x)x||u(A)}}else{k.title=
"";k.style.cursor=v.loading?"wait":"default";d.style(k,"opacity","0.0");d.connect(k,"onmouseover",k,function(){k.style.cursor=v.loading?"wait":"default";d.style(k,"opacity","0")});d.connect(k,"onmouseout",k,function(){k.style.cursor=v.loading?"wait":"default";d.style(k,"opacity","0")});k.onclick=null}},_sortBlock:function(h){for(var k=[],q=0;q<h.length;q++){var u=h[q],r=this._model.getGroupData(u);if(r)for(var t=0;t<r.length;t++){var v=this._model.getModelType(r[t],u);v&&k.push({name:r[t].Name,type:v,
location:r[t].Location,path:r[t].Path,commitURI:r[t].Git.CommitLocation,indexURI:r[t].Git.IndexLocation,diffURI:r[t].Git.DiffLocation,conflicting:this._model.isConflict(v)})}}k.sort(function(A,x){A=A.name&&A.name.toLowerCase();x=x.name&&x.name.toLowerCase();if(A<x)return-1;if(A>x)return 1;return 0});return k},_loadBlock:function(h,k){h.initTable();k=this._sortBlock(k);for(var q=0;q<k.length;q++)h.renderRow(k[q],q);return h.totalRow=k.length},loadDiffContent:function(h){this._statusService.setProgressMessage("Loading diff...");
var k=this,q=this._model.isStaged(h.type)?"index VS HEAD ) ":"local VS index ) ",u="Compare( "+j.statusTypeMap[h.type][1]+" : "+q;this._inlineCompareContainer.setConflicting(this._model.isConflict(h.type));this._inlineCompareContainer.resolveDiff(h.diffURI,function(){d.place(document.createTextNode(u),"fileNameInViewer","only");d.style("fileNameInViewer","color","#6d6d6d");k._statusService.setProgressMessage("");d.empty("rightContainerCommands");k._commandService.renderCommands("rightContainerCommands",
"dom",k,k,"image")},function(r,t){k.handleServerErrors(r,t);d.empty("rightContainerCommands")})},openCompareEditor:function(h){var k="",q=e.toUrl("compare/compare.html")+"#",u=0;if(this._model.isStaged(h.type)){k="readonly";u=1}if(this._model.isConflict(h.type)){if(u===0)k="conflict";else k+="&conflict";u++}if(u>0)q=e.toUrl("compare/compare.html")+"?"+k+"#";return q+h.diffURI},handleServerErrors:function(h,k){var q=[];q.Severity="Error";q.HTML=false;try{var u=JSON.parse(h.responseText);q.Message=
u.DetailedMessage?u.DetailedMessage:u.Message}catch(r){q.Message=typeof h.message==="string"?h.message:k.xhr.statusText}this._statusService.setProgressResult(q)},getGitStatus:function(h,k){this._url=h;if(this._initializing=k?true:false){this._cloneInfo=undefined;this._statusService.setProgressMessage("Loading status...")}var q=this;q._registry.getService("orion.git.provider").then(function(u){u.getGitStatus(h,function(r){q.loadStatus(r)},function(r,t){q.handleServerErrors(r,t)})})},stage:function(h,
k){var q=this;if(k&&k.conflicting){q._stagingConflict=true;q._stagingName=k.name}else q._stagingConflict=false;q._registry.getService("orion.git.provider").then(function(u){u.stage(h,function(){q.getGitStatus(q._url)},function(r,t){q.handleServerErrors(r,t)})})},stageSelected:function(){var h=this._unstagedContentRenderer.getSelected();if(h.length!==0){this._prepareStage(h,true);this._unstagedTableRenderer.select(false);this._stagedTableRenderer.select(false);this.stageMultipleFiles(h)}},stageOneSelection:function(h,
k){var q=this,u=h[k].modelItem;if(u&&u.conflicting){q._stagingConflict=true;q._stagingName=u.name}q._registry.getService("orion.git.provider").then(function(r){r.stage(u.indexURI,function(){k===h.length-1?q.getGitStatus(q._url):q.stageOneSelection(h,k+1)},function(t,v){q.handleServerErrors(t,v)})})},stageMultipleFiles:function(h){for(var k=this,q=[],u=0;u<h.length;u++){var r=h[u].modelItem;if(r&&r.conflicting){k._stagingConflict=true;k._stagingName=r.name}q.push(r.path)}k._registry.getService("orion.git.provider").then(function(t){t.stageMultipleFiles(k._model.items.IndexLocation,
q,function(){k.getGitStatus(k._url)},function(v,A){k.handleServerErrors(v,A)})})},checkout:function(h){var k=this,q=this._model.items.CloneLocation;k._registry.getService("orion.git.provider").then(function(u){u.checkoutPath(q,[h.name],function(){k.getGitStatus(k._url)},function(r,t){k.handleServerErrors(r,t)})})},stageAll:function(){this.stage(this._curClone.IndexLocation)},unstageSelected:function(h){var k=this._stagedContentRenderer.getSelected();this._stagedTableRenderer.select(false);this._unstagedTableRenderer.select(false);
if(k.length!==0)this._stagedContentRenderer.totalRow===k.length?this.unstageAll(h):this.unstageMultipleFiles(k)},unstage:function(h){var k=this;k._registry.getService("orion.git.provider").then(function(q){q.unstage(k._model.items.IndexLocation,[h.name],function(){k.getGitStatus(k._url)},function(u,r){k.handleServerErrors(u,r)})})},unstageAll:function(h){var k=this;k._registry.getService("orion.git.provider").then(function(q){q.unstageAll(k._model.items.IndexLocation,h,function(){k.getGitStatus(k._url)},
function(u,r){k.handleServerErrors(u,r)})})},unstageMultipleFiles:function(h){for(var k=this,q=[],u=0;u<h.length;u++)q.push(h[u].modelItem.path);k._registry.getService("orion.git.provider").then(function(r){r.unstage(k._model.items.IndexLocation,q,function(){k.getGitStatus(k._url)},function(t,v){k.handleServerErrors(t,v)})})},commitAll:function(h,k,q){var u=this;document.getElementById("commitMessage").value="";u._statusService.setProgressMessage("Committing...");u._registry.getService("orion.git.provider").then(function(r){r.commitAll(h,
k,q,function(){u.getGitStatus(u._url,true)},function(t,v){u.handleServerErrors(t,v)})})},commit:function(h,k,q,u,r,t){var v={};if(!h){h=document.getElementById("commitMessage").value;if(h!=="")v.Message=h;else return}if(!k)if(k=document.getElementById("amend").checked)v.Amend="true";if(!q){q=document.getElementById("committerName").value;v.CommitterName=q;if(!q){this.reportWarning("The committer name is required.");this._committerAndAuthorZoneRenderer.show();return}}if(!u){u=document.getElementById("committerEmail").value;
v.CommitterEmail=u;if(!u){this.reportWarning("The committer mail is required.");this._committerAndAuthorZoneRenderer.show();return}}if(!r){r=document.getElementById("authorName").value;v.AuthorName=r;if(!r){this.reportWarning("The author name is required.");this._committerAndAuthorZoneRenderer.show();return}}if(!t){t=document.getElementById("authorEmail").value;v.AuthorEmail=t;if(!t){this.reportWarning("The author mail is required.");this._committerAndAuthorZoneRenderer.show();return}}this.commitAll(this._curClone.HeadLocation,
h,d.toJson(v))},reportWarning:function(h){this._registry.getService("orion.page.message").then(function(k){var q=[];q.Severity="Warning";q.Message=h;k.setProgressResult(q)})},rebase:function(h){var k=this;k._registry.getService("orion.git.provider").then(function(q){q.doRebase(k._curClone.HeadLocation,"",h,function(u){if(u.Result=="OK"||u.Result=="ABORTED"||u.Result=="FAST_FORWARD"||u.Result=="UP_TO_DATE"){var r=[];r.Severity="Ok";r.HTML=false;r.Message=u.Result;k._statusService.setProgressResult(r);
k.getGitStatus(k._url)}if(u.Result=="STOPPED"){r=[];r.Severity="Warning";r.HTML=false;r.Message=u.Result+". Repository still contains conflicts.";k._statusService.setProgressResult(r);k.getGitStatus(k._url)}else if(u.Result=="FAILED_UNMERGED_PATHS"){r=[];r.Severity="Error";r.HTML=false;r.Message=u.Result+". Repository contains unmerged paths. Resolve conflicts first.";k._statusService.setProgressResult(r)}},function(u,r){k.handleServerErrors(u,r)})})}};return l}();return j});
define("orion/dialogs",[],function(){function e(d){this._serviceRegistry=d;this._serviceRegistration=d.registerService("orion.page.dialog",this)}e.prototype={confirm:function(d,a){a(window.confirm(d))},openFiles:function(){}};e.prototype.constructor=e;return{DialogService:e}});
define("orion/ssh/sshTools",[],function(){var e=e||{};e.SshService=function(){function d(a){if(a){this._serviceRegistry=a;this._serviceRegistration=a.registerService("orion.net.ssh",this)}}d.prototype={_KNOWN_HOSTS:"known_hosts",addKnownHosts:function(a,c){c||(c="");var f=localStorage.getItem(c+this._KNOWN_HOSTS);if(f)f.indexOf(a)<0&&localStorage.setItem(c+this._KNOWN_HOSTS,f+"\n"+a);else localStorage.setItem(c+this._KNOWN_HOSTS,a)},clearKnownhosts:function(a){a||(a="");localStorage.removeItem(a+
this._KNOWN_HOSTS)},getKnownHosts:function(a){a||(a="");return localStorage.getItem(a+this._KNOWN_HOSTS)}};return d}();return e});
define("git-status",["dojo","orion/bootstrap","orion/status","orion/commands","orion/searchClient","orion/globalCommands","orion/git/gitClient","orion/git/git-status-table","orion/breadcrumbs","orion/dialogs","orion/ssh/sshTools","dojo/parser","dojo/hash","dijit/layout/BorderContainer","dijit/layout/ContentPane"],function(e,d,a,c,f,g,i,j,l,h,k){e.addOnLoad(function(){d.startup().then(function(q){var u=q.serviceRegistry;q=q.preferences;document.body.style.visibility="visible";e.parser.parse();var r=
new c.CommandService({serviceRegistry:u}),t=new f.Searcher({serviceRegistry:u,commandService:r});new i.GitService(u);new k.SshService(u);new h.DialogService(u);var v=new a.StatusReportingService(u,"statusPane","notifications");g.generateBanner("toolbar",u,r,q,t);var A=new j.GitStatusController({renderLog:true},u,r,v,"unstagedZone","stagedZone");A.getGitStatus(e.hash(),true);e.subscribe("/dojo/hashchange",A,function(){A.getGitStatus(e.hash(),true)})})})});