/*
 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 d(a,b,e){(function(){if(typeof this.loadFirebugConsole=="function")this.loadFirebugConsole();else{this.console=this.console||{};for(var f=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","profile","profileEnd","time","timeEnd","trace","warn","log"],g=0,i;i=f[g++];)console[i]||function(){var u=i+"";console[u]="log"in console?function(){var s=Array.apply({},arguments);s.unshift(u+":");console.log(s.join(" "))}:function(){};console[u]._fake=true}()}if(typeof a==
"undefined")a={_scopeName:"dojo",_scopePrefix:"",_scopePrefixArgs:"",_scopeSuffix:"",_scopeMap:{},_scopeMapRev:{}};var k=a;if(typeof b=="undefined")b={_scopeName:"dijit"};if(typeof e=="undefined")e={_scopeName:"dojox"};if(!k._scopeArgs)k._scopeArgs=[a,b,e];k.global=this;k.config={isDebug:false,debugAtAllCosts:false};if(f=typeof djConfig!="undefined"?djConfig:typeof dojoConfig!="undefined"?dojoConfig:null)for(var j in f)k.config[j]=f[j];a.locale=k.config.locale;j="$Rev: 24595 $".match(/\d+/);a.version=
{major:1,minor:6,patch:1,flag:"",revision:j?+j[0]:NaN,toString:function(){with(k.version)return major+"."+minor+"."+patch+flag+" ("+revision+")"}};typeof OpenAjax!="undefined"&&OpenAjax.hub.registerLibrary(a._scopeName,"http://dojotoolkit.org",k.version.toString());var o,q,v={};for(g in{toString:1}){o=[];break}a._extraNames=o=o||["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];q=o.length;a._mixin=function(u,s){var w,z,y;for(w in s){z=s[w];
if(!(w in u)||u[w]!==z&&(!(w in v)||v[w]!==z))u[w]=z}if(q&&s)for(y=0;y<q;++y){w=o[y];z=s[w];if(!(w in u)||u[w]!==z&&(!(w in v)||v[w]!==z))u[w]=z}return u};a.mixin=function(u){u||(u={});for(var s=1,w=arguments.length;s<w;s++)k._mixin(u,arguments[s]);return u};a._getProp=function(u,s,w){w=w||k.global;for(var z=0,y;w&&(y=u[z]);z++){if(z==0&&k._scopeMap[y])y=k._scopeMap[y];w=y in w?w[y]:s?(w[y]={}):undefined}return w};a.setObject=function(u,s,w){var z=u.split(".");u=z.pop();return(w=k._getProp(z,true,
w))&&u?(w[u]=s):undefined};a.getObject=function(u,s,w){return k._getProp(u.split("."),s,w)};a.exists=function(u,s){return k.getObject(u,false,s)!==undefined};a.eval=function(u){return k.global.eval?k.global.eval(u):eval(u)};k.deprecated=k.experimental=function(){}})();return{dojo:a,dijit:b,dojox:e}}if(this.define)define("dojo/_base/_loader/bootstrap",[],function(){var a=d();a.dojo._dijit=a.dijit;a.dojo._dojox=a.dojox;return a.dojo});else{var c=d();dojo=c.dojo;dijit=c.dijit;dojox=c.dojox}})();
define("dojo/lib/backCompat",["require","dojo/_base/_loader/bootstrap"],function(d,c){var a=["_moduleHasPrefix","_loadPath","_loadUri","_loadUriAndCheck","loaded","_callLoaded","_getModuleSymbols","_loadModule","require","provide","platformRequire","requireIf","requireAfterIf","registerModulePath"],b,e;for(b=0;b<a.length;){e=a[b++];c[e]=function(u){return function(){console.warn("dojo."+u+" not available when using an AMD loader.")}}(e)}var f=function(u){var s=[],w;for(w=0;w<u.length;)s.push(u[w++]);
return s},g=function(u,s){return s?typeof s=="string"?function(){u[s]()}:function(){s.call(u)}:u};c.ready=c.addOnLoad=function(u,s){d.ready(s?g(u,s):u)};c.addOnLoad(function(){c.postLoad=c.config.afterOnLoad=true});if(a=c.config.addOnLoad)c.addOnLoad[a instanceof Array?"apply":"call"](c,a);var i=c._loaders=[],k=function(){var u=i.slice(0);for(Array.prototype.splice.apply(i,[0,i.length]);u.length;)u.shift().call()};i.unshift=function(){Array.prototype.unshift.apply(i,f(arguments));d.ready(k)};i.splice=
function(){Array.prototype.splice.apply(i,f(arguments));d.ready(k)};var j=c._unloaders=[];c.unloaded=function(){for(;j.length;)j.pop().call()};c._onto=function(u,s,w){u.push(w?g(s,w):s)};c._modulesLoaded=function(){};c.loadInit=function(u){u()};var o=function(u){return u.replace(/\./g,"/")};c.getL10nName=function(u,s,w){w=w?w.toLowerCase():c.locale;u="i18n!"+o(u);return/root/i.test(w)?u+"/nls/"+s:u+"/nls/"+w+"/"+s};c.requireLocalization=function(u,s,w){if(d.vendor!="altoviso.com")w=!w||w.toLowerCase()===
c.locale?"root":w;return d(c.getL10nName(u,s,w))};c.i18n={getLocalization:c.requireLocalization,normalizeLocale:function(u){u=u?u.toLowerCase():c.locale;if(u=="root")u="ROOT";return u}};var q=/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/,v=/^((([^\[:]+):)?([^@]+)@)?(\[([^\]]+)\]|([^\[:]*))(:([0-9]+))?$/;c._Url=function(){for(var u=arguments,s=[u[0]],w=1;w<u.length;w++)if(u[w]){var z=new c._Url(u[w]+"");s=new c._Url(s[0]+"");if(z.path==""&&!z.scheme&&!z.authority&&!z.query){if(z.fragment!=
null)s.fragment=z.fragment;z=s}else if(!z.scheme){z.scheme=s.scheme;if(!z.authority){z.authority=s.authority;if(z.path.charAt(0)!="/"){s=(s.path.substring(0,s.path.lastIndexOf("/")+1)+z.path).split("/");for(var y=0;y<s.length;y++)if(s[y]==".")if(y==s.length-1)s[y]="";else{s.splice(y,1);y--}else if(y>0&&!(y==1&&s[0]=="")&&s[y]==".."&&s[y-1]!="..")if(y==s.length-1){s.splice(y,1);s[y-1]=""}else{s.splice(y-1,2);y-=2}z.path=s.join("/")}}}s=[];z.scheme&&s.push(z.scheme,":");z.authority&&s.push("//",z.authority);
s.push(z.path);z.query&&s.push("?",z.query);z.fragment&&s.push("#",z.fragment)}this.uri=s.join("");w=this.uri.match(q);this.scheme=w[2]||(w[1]?"":null);this.authority=w[4]||(w[3]?"":null);this.path=w[5];this.query=w[7]||(w[6]?"":null);this.fragment=w[9]||(w[8]?"":null);if(this.authority!=null){w=this.authority.match(v);this.user=w[3]||null;this.password=w[4]||null;this.host=w[6]||w[7];this.port=w[9]||null}};c._Url.prototype.toString=function(){return this.uri};c.moduleUrl=function(u,s){if(!u)return null;
u=o(u)+(s?"/"+s:"");s="";var w=u.match(/(.+)(\.[^\/]*)$/);if(w){u=w[1];s=w[2]}return new c._Url(d.nameToUrl(u,s))};return c});
define("dojo/_base/_loader/hostenv_browser",["dojo/lib/backCompat"],function(d){if(typeof window!="undefined"){d.isBrowser=true;d._name="browser";(function(){var a=d;if(document&&document.getElementsByTagName)for(var b=document.getElementsByTagName("script"),e=/dojo(\.xd)?\.js(\W|$)/i,f=0;f<b.length;f++){var g=b[f].getAttribute("src");if(g){var i=g.match(e);if(i){if(!a.config.baseUrl)a.config.baseUrl=g.substring(0,i.index);if(b=b[f].getAttribute("djConfig")||b[f].getAttribute("data-dojo-config")){b=
eval("({ "+b+" })");for(var k in b)d.config[k]=b[k]}break}}}a.baseUrl=a.config.baseUrl;k=navigator;b=k.userAgent;e=k.appVersion;f=parseFloat(e);if(b.indexOf("Opera")>=0)a.isOpera=f;if(b.indexOf("AdobeAIR")>=0)a.isAIR=1;a.isKhtml=e.indexOf("Konqueror")>=0?f:0;a.isWebKit=parseFloat(b.split("WebKit/")[1])||undefined;a.isChrome=parseFloat(b.split("Chrome/")[1])||undefined;a.isMac=e.indexOf("Macintosh")>=0;if((g=Math.max(e.indexOf("WebKit"),e.indexOf("Safari"),0))&&!d.isChrome){a.isSafari=parseFloat(e.split("Version/")[1]);
if(!a.isSafari||parseFloat(e.substr(g+7))<=419.3)a.isSafari=2}if(b.indexOf("Gecko")>=0&&!a.isKhtml&&!a.isWebKit)a.isMozilla=a.isMoz=f;if(a.isMoz)a.isFF=parseFloat(b.split("Firefox/")[1]||b.split("Minefield/")[1])||undefined;if(document.all&&!a.isOpera){a.isIE=parseFloat(e.split("MSIE ")[1])||undefined;if((b=document.documentMode)&&b!=5&&Math.floor(a.isIE)!=b)a.isIE=b}if(d.isIE&&window.location.protocol==="file:")d.config.ieForceActiveXXhr=true;a.isQuirks=document.compatMode=="BackCompat";a.locale=
d.config.locale||(a.isIE?k.userLanguage:k.language).toLowerCase();a._XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];a._xhrObj=function(){var w,z;if(!d.isIE||!d.config.ieForceActiveXXhr)try{w=new XMLHttpRequest}catch(y){}if(!w)for(var h=0;h<3;++h){var n=a._XMLHTTP_PROGIDS[h];try{w=new ActiveXObject(n)}catch(m){z=m}if(w){a._XMLHTTP_PROGIDS=[n];break}}if(!w)throw new Error("XMLHTTP not available: "+z);return w};a._isDocumentOk=function(w){w=w.status||0;var z=location.protocol;
return w>=200&&w<300||w==304||w==1223||!w&&(z=="file:"||z=="chrome:"||z=="chrome-extension:"||z=="app:")};var j=window.location+"";var o=(k=document.getElementsByTagName("base"))&&k.length>0;a._getText=function(w,z){var y=a._xhrObj();if(!o&&d._Url)w=(new d._Url(j,w)).toString();if(a.config.cacheBust){w+="";w+=(w.indexOf("?")==-1?"?":"&")+String(a.config.cacheBust).replace(/\W+/g,"")}y.open("GET",w,false);try{y.send(null);if(!a._isDocumentOk(y)){var h=Error("Unable to load "+w+" status:"+y.status);
h.status=y.status;h.responseText=y.responseText;throw h;}}catch(n){if(z)return null;throw n;}return y.responseText};var q=window,v=function(w,z){var y=q.attachEvent||q.addEventListener;w=q.attachEvent?w:w.substring(2);y(w,function(){z.apply(q,arguments)},false)};a._windowUnloaders=[];a.windowUnloaded=function(){for(var w=a._windowUnloaders;w.length;)w.pop()();a=null};var u=0;a.addOnWindowUnload=function(w,z){a._onto(a._windowUnloaders,w,z);if(!u){u=1;v("onunload",a.windowUnloaded)}};var s=0;a.addOnUnload=
function(w,z){a._onto(a._unloaders,w,z);if(!s){s=1;v("onbeforeunload",d.unloaded)}}})();d._initFired=false;d._loadInit=function(){if(d._scrollIntervalId){clearInterval(d._scrollIntervalId);d._scrollIntervalId=0}if(!d._initFired){d._initFired=true;!d.config.afterOnLoad&&window.detachEvent&&window.detachEvent("onload",d._loadInit);d._inFlightCount==0&&d._modulesLoaded()}};if(!d.config.afterOnLoad)if(document.addEventListener){document.addEventListener("DOMContentLoaded",d._loadInit,false);window.addEventListener("load",
d._loadInit,false)}else if(window.attachEvent){window.attachEvent("onload",d._loadInit);if(!d.config.skipIeDomLoaded&&self===self.top)d._scrollIntervalId=setInterval(function(){try{if(document.body){document.documentElement.doScroll("left");d._loadInit()}}catch(a){}},30)}if(d.isIE)try{(function(){document.namespaces.add("v","urn:schemas-microsoft-com:vml");var a=["*","group","roundrect","oval","shape","rect","imagedata","path","textpath","text"],b=0,e=1,f=document.createStyleSheet();if(d.isIE>=8){b=
1;e=a.length}for(;b<e;++b)f.addRule("v\\:"+a[b],"behavior:url(#default#VML); display:inline-block")})()}catch(c){}}(function(){var a=d.config.modulePaths;if(a)for(var b in a)d.registerModulePath(b,a[b])})();d.config.isDebug&&d.require("dojo._firebug.firebug");if(d.config.debugAtAllCosts){d.require("dojo._base._loader.loader_debug");d.require("dojo.i18n")}return d});define("dojo/lib/kernel",["dojo/_base/_loader/hostenv_browser"],function(d){return dojo=d});
define("dojo/_base/lang",["dojo/lib/kernel"],function(d){(function(){var c=Object.prototype.toString;d.isString=function(k){return typeof k=="string"||k instanceof String};d.isArray=function(k){return k&&(k instanceof Array||typeof k=="array")};d.isFunction=function(k){return c.call(k)==="[object Function]"};d.isObject=function(k){return k!==undefined&&(k===null||typeof k=="object"||d.isArray(k)||d.isFunction(k))};d.isArrayLike=function(k){return k&&k!==undefined&&!d.isString(k)&&!d.isFunction(k)&&
!(k.tagName&&k.tagName.toLowerCase()=="form")&&(d.isArray(k)||isFinite(k.length))};d.isAlien=function(k){return k&&!d.isFunction(k)&&/\{\s*\[native code\]\s*\}/.test(String(k))};d.extend=function(k){for(var j=1,o=arguments.length;j<o;j++)d._mixin(k.prototype,arguments[j]);return k};d._hitchArgs=function(k,j){var o=d._toArray(arguments,2),q=d.isString(j);return function(){var v=d._toArray(arguments),u=q?(k||d.global)[j]:j;return u&&u.apply(k||this,o.concat(v))}};d.hitch=function(k,j){if(arguments.length>
2)return d._hitchArgs.apply(d,arguments);if(!j){j=k;k=null}if(d.isString(j)){k=k||d.global;if(!k[j])throw['dojo.hitch: scope["',j,'"] is null (scope="',k,'")'].join("");return function(){return k[j].apply(k,arguments||[])}}return!k?j:function(){return j.apply(k,arguments||[])}};d.delegate=d._delegate=function(){function k(){}return function(j,o){k.prototype=j;j=new k;k.prototype=null;o&&d._mixin(j,o);return j}}();var a=function(k,j,o){return(o||[]).concat(Array.prototype.slice.call(k,j||0))},b=function(k,
j,o){o=o||[];for(j=j||0;j<k.length;j++)o.push(k[j]);return o};d._toArray=d.isIE?function(k){return(k.item?b:a).apply(this,arguments)}:a;d.partial=function(){return d.hitch.apply(d,[null].concat(d._toArray(arguments)))};var e=d._extraNames,f=e.length,g={};d.clone=function(k){if(!k||typeof k!="object"||d.isFunction(k))return k;if(k.nodeType&&"cloneNode"in k)return k.cloneNode(true);if(k instanceof Date)return new Date(k.getTime());if(k instanceof RegExp)return new RegExp(k);var j,o,q,v;if(d.isArray(k)){j=
[];o=0;for(q=k.length;o<q;++o)o in k&&j.push(d.clone(k[o]))}else j=k.constructor?new k.constructor:{};for(v in k){q=k[v];if(!(v in j)||j[v]!==q&&(!(v in g)||g[v]!==q))j[v]=d.clone(q)}if(f)for(o=0;o<f;++o){v=e[o];q=k[v];if(!(v in j)||j[v]!==q&&(!(v in g)||g[v]!==q))j[v]=q}return j};d.trim=String.prototype.trim?function(k){return k.trim()}:function(k){return k.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};var i=/\{([^\}]+)\}/g;d.replace=function(k,j,o){return k.replace(o||i,d.isFunction(j)?j:function(q,
v){return d.getObject(v,false,j)})}})();return d});
define("dojo/_base/array",["dojo/lib/kernel","dojo/_base/lang"],function(d){(function(){var c=function(b,e,f){return[typeof b=="string"?b.split(""):b,e||d.global,typeof f=="string"?new Function("item","index","array",f):f]},a=function(b,e,f,g){var i=c(e,g,f);e=i[0];f=0;for(g=e.length;f<g;++f){var k=!!i[2].call(i[1],e[f],f,e);if(b^k)return k}return b};d.mixin(d,{indexOf:function(b,e,f,g){var i=1,k=b.length||0,j=0;if(g){j=k-1;i=k=-1}if(f!=undefined)j=f;if(g&&j>k||j<k)for(;j!=k;j+=i)if(b[j]==e)return j;
return-1},lastIndexOf:function(b,e,f){return d.indexOf(b,e,f,true)},forEach:function(b,e,f){if(b&&b.length){var g=c(b,f,e);b=g[0];e=0;for(f=b.length;e<f;++e)g[2].call(g[1],b[e],e,b)}},every:function(b,e,f){return a(true,b,e,f)},some:function(b,e,f){return a(false,b,e,f)},map:function(b,e,f,g){var i=c(b,f,e);b=i[0];e=g?new g:[];f=0;for(g=b.length;f<g;++f)e.push(i[2].call(i[1],b[f],f,b));return e},filter:function(b,e,f){var g=c(b,f,e);b=g[0];e=[];f=0;for(var i=b.length;f<i;++f)g[2].call(g[1],b[f],f,
b)&&e.push(b[f]);return e}})})();return d});
define("dojo/_base/declare",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array"],function(d){(function(){function c(p,t){throw new Error("declare"+(t?" "+t:"")+": "+p);}function a(p,t){for(var r=[],x=[{cls:0,refs:[]}],B={},C=1,D=p.length,E=0,H,K,L,Q,P;E<D;++E){if(H=p[E])h.call(H)!="[object Function]"&&c("mixin #"+E+" is not a callable constructor.",t);else c("mixin #"+E+" is unknown. Did you use dojo.require to pull it in?",t);K=H._meta?H._meta.bases:[H];L=0;for(H=K.length-1;H>=0;--H){Q=K[H].prototype;
if(!Q.hasOwnProperty("declaredClass"))Q.declaredClass="uniqName_"+m++;Q=Q.declaredClass;if(!B.hasOwnProperty(Q)){B[Q]={count:0,refs:[],cls:K[H]};++C}Q=B[Q];if(L&&L!==Q){Q.refs.push(L);++L.count}L=Q}++L.count;x[0].refs.push(L)}for(;x.length;){L=x.pop();r.push(L.cls);for(--C;P=L.refs,P.length==1;){L=P[0];if(!L||--L.count){L=0;break}r.push(L.cls);--C}if(L){E=0;for(D=P.length;E<D;++E){L=P[E];--L.count||x.push(L)}}}C&&c("can't build consistent linearization",t);H=p[0];r[0]=H?H._meta&&H===r[r.length-H._meta.bases.length]?
H._meta.bases.length:1:0;return r}function b(p,t,r){var x,B,C,D,E,H,K,L=this._inherited=this._inherited||{};if(typeof p=="string"){x=p;p=t;t=r}r=0;D=p.callee;(x=x||D.nom)||c("can't deduce a name to call inherited()",this.declaredClass);E=this.constructor._meta;C=E.bases;K=L.p;if(x!=l){if(L.c!==D){K=0;H=C[0];E=H._meta;if(E.hidden[x]!==D){(B=E.chains)&&typeof B[x]=="string"&&c("calling chained method with inherited: "+x,this.declaredClass);do{E=H._meta;B=H.prototype;if(E&&(B[x]===D&&B.hasOwnProperty(x)||
E.hidden[x]===D))break}while(H=C[++K]);K=H?K:-1}}if(H=C[++K]){B=H.prototype;if(H._meta&&B.hasOwnProperty(x))r=B[x];else{D=y[x];do{B=H.prototype;if((r=B[x])&&(H._meta?B.hasOwnProperty(x):r!==D))break}while(H=C[++K])}}r=H&&r||y[x]}else{if(L.c!==D){K=0;if((E=C[0]._meta)&&E.ctor!==D){B=E.chains;if(!B||B.constructor!=="manual")c("calling chained constructor with inherited",this.declaredClass);for(;H=C[++K];)if((E=H._meta)&&E.ctor===D)break;K=H?K:-1}}for(;H=C[++K];)if(r=(E=H._meta)?E.ctor:H)break;r=H&&
r}L.c=r;L.p=K;if(r)return t===true?r:r.apply(this,t||p)}function e(p,t){if(typeof p=="string")return this.inherited(p,t,true);return this.inherited(p,true)}function f(p){for(var t=this.constructor._meta.bases,r=0,x=t.length;r<x;++r)if(t[r]===p)return true;return this instanceof p}function g(p,t){var r,x=0,B=w._extraNames.length;for(r in t)if(r!=l&&t.hasOwnProperty(r))p[r]=t[r];for(;x<B;++x){r=w._extraNames[x];if(r!=l&&t.hasOwnProperty(r))p[r]=t[r]}}function i(p,t){var r,x,B=0,C=w._extraNames.length;
for(r in t){x=t[r];if((x!==y[r]||!(r in y))&&r!=l){if(h.call(x)=="[object Function]")x.nom=r;p[r]=x}}for(;B<C;++B){r=w._extraNames[B];x=t[r];if((x!==y[r]||!(r in y))&&r!=l){if(h.call(x)=="[object Function]")x.nom=r;p[r]=x}}return p}function k(p){i(this.prototype,p);return this}function j(p,t){return function(){var r=arguments,x=r,B=r[0],C,D;D=p.length;var E;if(!(this instanceof r.callee))return s(r);if(t&&(B&&B.preamble||this.preamble)){E=new Array(p.length);E[0]=r;for(C=0;;){if(B=r[0])if(B=B.preamble)r=
B.apply(this,r)||r;B=p[C].prototype;if(B=B.hasOwnProperty("preamble")&&B.preamble)r=B.apply(this,r)||r;if(++C==D)break;E[C]=r}}for(C=D-1;C>=0;--C){B=p[C];if(B=(D=B._meta)?D.ctor:B)B.apply(this,E?E[C]:r)}(B=this.postscript)&&B.apply(this,x)}}function o(p,t){return function(){var r=arguments,x=r,B=r[0];if(!(this instanceof r.callee))return s(r);if(t){if(B)if(B=B.preamble)x=B.apply(this,x)||x;(B=this.preamble)&&B.apply(this,x)}p&&p.apply(this,r);(B=this.postscript)&&B.apply(this,r)}}function q(p){return function(){var t=
arguments,r=0,x,B;if(!(this instanceof t.callee))return s(t);for(;x=p[r];++r)if(x=(B=x._meta)?B.ctor:x){x.apply(this,t);break}(x=this.postscript)&&x.apply(this,t)}}function v(p,t,r){return function(){var x,B,C=0,D=1;if(r){C=t.length-1;D=-1}for(;x=t[C];C+=D){B=x._meta;(x=(B?B.hidden:x.prototype)[p])&&x.apply(this,arguments)}}}function u(p){n.prototype=p.prototype;p=new n;n.prototype=null;return p}function s(p){var t=p.callee,r=u(t);t.apply(r,p);return r}var w=d,z=w._mixin,y=Object.prototype,h=y.toString,
n=new Function,m=0,l="constructor";w.declare=function(p,t,r){if(typeof p!="string"){r=t;t=p;p=""}r=r||{};var x,B,C,D,E,H,K,L=1,Q=t;if(h.call(t)=="[object Array]"){H=a(t,p);C=H[0];L=H.length-C;t=H[L]}else{H=[0];if(t)if(h.call(t)=="[object Function]"){C=t._meta;H=H.concat(C?C.bases:t)}else c("base class is not a callable constructor.",p);else t!==null&&c("unknown base class. Did you use dojo.require to pull it in?",p)}if(t)for(B=L-1;;--B){x=u(t);if(!B)break;C=H[B];(C._meta?g:z)(x,C.prototype);D=new Function;
D.superclass=t;D.prototype=x;t=x.constructor=D}else x={};i(x,r);C=r.constructor;if(C!==y.constructor){C.nom=l;x.constructor=C}for(B=L-1;B;--B)if((C=H[B]._meta)&&C.chains)K=z(K||{},C.chains);if(x["-chains-"])K=z(K||{},x["-chains-"]);C=!K||!K.hasOwnProperty(l);H[0]=D=K&&K.constructor==="manual"?q(H):H.length==1?o(r.constructor,C):j(H,C);D._meta={bases:H,hidden:r,chains:K,parents:Q,ctor:r.constructor};D.superclass=t&&t.prototype;D.extend=k;D.prototype=x;x.constructor=D;x.getInherited=e;x.inherited=b;
x.isInstanceOf=f;if(p){x.declaredClass=p;w.setObject(p,D)}if(K)for(E in K)if(x[E]&&typeof K[E]=="string"&&E!=l){C=x[E]=v(E,H,K[E]==="after");C.nom=E}return D};w.safeMixin=i})();return d.declare});
define("dojo/_base/connect",["dojo/lib/kernel","dojo/_base/lang"],function(d){d._listener={getDispatcher:function(){return function(){var c=Array.prototype,a=arguments.callee,b=a._listeners;a=(a=a.target)&&a.apply(this,arguments);var e;b=[].concat(b);for(e in b)e in c||b[e].apply(this,arguments);return a}},add:function(c,a,b){c=c||d.global;var e=c[a];if(!e||!e._listeners){var f=d._listener.getDispatcher();f.target=e;f._listeners=[];e=c[a]=f}return e._listeners.push(b)},remove:function(c,a,b){(c=(c||
d.global)[a])&&c._listeners&&b--&&delete c._listeners[b]}};d.connect=function(){var c=arguments,a=[],b=0;a.push(d.isString(c[0])?null:c[b++],c[b++]);var e=c[b+1];a.push(d.isString(e)||d.isFunction(e)?c[b++]:null,c[b++]);for(e=c.length;b<e;b++)a.push(c[b]);return d._connect.apply(this,a)};d._connect=function(c,a,b,e){var f=d._listener;b=f.add(c,a,d.hitch(b,e));return[c,a,b,f]};d.disconnect=function(c){if(c&&c[0]!==undefined){d._disconnect.apply(this,c);delete c[0]}};d._disconnect=function(c,a,b,e){e.remove(c,
a,b)};d._topics={};d.subscribe=function(c,a,b){return[c,d._listener.add(d._topics,c,d.hitch(a,b))]};d.unsubscribe=function(c){c&&d._listener.remove(d._topics,c[0],c[1])};d.publish=function(c,a){if(c=d._topics[c])c.apply(this,a||[])};d.connectPublisher=function(c,a,b){var e=function(){d.publish(c,arguments)};return b?d.connect(a,b,e):d.connect(a,e)};return d.connect});
define("dojo/_base/Deferred",["dojo/lib/kernel","dojo/_base/lang"],function(d){(function(){var c=function(){},a=Object.freeze||function(){};d.Deferred=function(b){function e(u){if(i)throw new Error("This deferred has already been resolved");g=u;i=true;f()}function f(){for(var u;!u&&o;){var s=o;o=o.next;if(u=s.progress==c)i=false;var w=k?s.error:s.resolved;if(w)try{var z=w(g);if(z&&typeof z.then==="function")z.then(d.hitch(s.deferred,"resolve"),d.hitch(s.deferred,"reject"),d.hitch(s.deferred,"progress"));
else{w=u&&z===undefined;if(u&&!w)k=z instanceof Error;s.deferred[w&&k?"reject":"resolve"](w?g:z)}}catch(y){s.deferred.reject(y)}else k?s.deferred.reject(g):s.deferred.resolve(g)}}var g,i,k,j,o,q=this.promise={};this.resolve=this.callback=function(u){this.fired=0;this.results=[u,null];e(u)};this.reject=this.errback=function(u){k=true;this.fired=1;e(u);this.results=[null,u];if(!u||u.log!==false)(d.config.deferredOnError||function(s){console.error(s)})(u)};this.progress=function(u){for(var s=o;s;){var w=
s.progress;w&&w(u);s=s.next}};this.addCallbacks=function(u,s){this.then(u,s,c);return this};this.then=q.then=function(u,s,w){var z=w==c?this:new d.Deferred(q.cancel);u={resolved:u,error:s,progress:w,deferred:z};if(o)j=j.next=u;else o=j=u;i&&f();return z.promise};var v=this;this.cancel=q.cancel=function(){if(!i){var u=b&&b(v);if(!i){u instanceof Error||(u=new Error(u));u.log=false;v.reject(u)}}};a(q)};d.extend(d.Deferred,{addCallback:function(){return this.addCallbacks(d.hitch.apply(d,arguments))},
addErrback:function(){return this.addCallbacks(null,d.hitch.apply(d,arguments))},addBoth:function(){var b=d.hitch.apply(d,arguments);return this.addCallbacks(b,b)},fired:-1})})();d.when=function(c,a,b,e){if(c&&typeof c.then==="function")return c.then(a,b,e);return a(c)};return d.Deferred});
define("dojo/_base/json",["dojo/lib/kernel"],function(d){d.fromJson=function(c){return eval("("+c+")")};d._escapeString=function(c){return('"'+c.replace(/(["\\])/g,"\\$1")+'"').replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")};d.toJsonIndentStr="\t";d.toJson=function(c,a,b){if(c===undefined)return"undefined";var e=typeof c;if(e=="number"||e=="boolean")return c+"";if(c===null)return"null";if(d.isString(c))return d._escapeString(c);var f=
arguments.callee,g;b=b||"";var i=a?b+d.toJsonIndentStr:"";g=c.__json__||c.json;if(d.isFunction(g)){g=g.call(c);if(c!==g)return f(g,a,i)}if(c.nodeType&&c.cloneNode)throw new Error("Can't serialize DOM nodes");g=a?" ":"";var k=a?"\n":"";if(d.isArray(c))return"["+d.map(c,function(v){v=f(v,a,i);if(typeof v!="string")v="undefined";return k+i+v}).join(","+g)+k+b+"]";if(e=="function")return null;e=[];var j;for(j in c){var o,q;if(typeof j=="number")o='"'+j+'"';else if(typeof j=="string")o=d._escapeString(j);
else continue;q=f(c[j],a,i);typeof q=="string"&&e.push(k+i+o+":"+g+q)}return"{"+e.join(","+g)+k+b+"}"};return d});
define("dojo/_base/Color",["dojo/lib/kernel","dojo/_base/array","dojo/_base/lang"],function(d){(function(){d.Color=function(c){c&&this.setColor(c)};d.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:d.config.transparentColor||[255,255,255]};d.extend(d.Color,
{r:255,g:255,b:255,a:1,_set:function(c,a,b,e){this.r=c;this.g=a;this.b=b;this.a=e},setColor:function(c){if(d.isString(c))d.colorFromString(c,this);else if(d.isArray(c))d.colorFromArray(c,this);else{this._set(c.r,c.g,c.b,c.a);c instanceof d.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"#"+d.map(["r","g","b"],function(c){c=this[c].toString(16);return c.length<
2?"0"+c:c},this).join("")},toCss:function(c){var a=this.r+", "+this.g+", "+this.b;return(c?"rgba("+a+", "+this.a:"rgb("+a)+")"},toString:function(){return this.toCss(true)}});d.blendColors=function(c,a,b,e){var f=e||new d.Color;d.forEach(["r","g","b","a"],function(g){f[g]=c[g]+(a[g]-c[g])*b;if(g!="a")f[g]=Math.round(f[g])});return f.sanitize()};d.colorFromRgb=function(c,a){return(c=c.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/))&&d.colorFromArray(c[1].split(/\s*,\s*/),a)};d.colorFromHex=function(c,
a){var b=a||new d.Color,e=c.length==4?4:8,f=(1<<e)-1;c=Number("0x"+c.substr(1));if(isNaN(c))return null;d.forEach(["b","g","r"],function(g){var i=c&f;c>>=e;b[g]=e==4?17*i:i});b.a=1;return b};d.colorFromArray=function(c,a){a=a||new d.Color;a._set(Number(c[0]),Number(c[1]),Number(c[2]),Number(c[3]));if(isNaN(a.a))a.a=1;return a.sanitize()};d.colorFromString=function(c,a){var b=d.Color.named[c];return b&&d.colorFromArray(b,a)||d.colorFromRgb(c,a)||d.colorFromHex(c,a)}})();return d.Color});
define("dojo/_base/window",["dojo/lib/kernel"],function(d){d.doc=window.document||null;d.body=function(){return d.doc.body||d.doc.getElementsByTagName("body")[0]};d.setContext=function(c,a){d.global=c;d.doc=a};d.withGlobal=function(c,a,b,e){var f=d.global;try{d.global=c;return d.withDoc.call(null,c.document,a,b,e)}finally{d.global=f}};d.withDoc=function(c,a,b,e){var f=d.doc,g=d._bodyLtr,i=d.isQuirks;try{d.doc=c;delete d._bodyLtr;d.isQuirks=d.doc.compatMode=="BackCompat";if(b&&typeof a=="string")a=
b[a];return a.apply(b,e||[])}finally{d.doc=f;delete d._bodyLtr;if(g!==undefined)d._bodyLtr=g;d.isQuirks=i}};return d});
define("dojo/_base/event",["dojo/lib/kernel","dojo/_base/connect"],function(d){(function(){var c=d._event_listener={add:function(k,j,o){if(k){j=c._normalizeEventName(j);o=c._fixCallback(j,o);if(!d.isIE&&(j=="mouseenter"||j=="mouseleave")){var q=o;j=j=="mouseenter"?"mouseover":"mouseout";o=function(v){if(!d.isDescendant(v.relatedTarget,k))return q.call(this,v)}}k.addEventListener(j,o,false);return o}},remove:function(k,j,o){if(k){j=c._normalizeEventName(j);if(!d.isIE&&(j=="mouseenter"||j=="mouseleave"))j=
j=="mouseenter"?"mouseover":"mouseout";k.removeEventListener(j,o,false)}},_normalizeEventName:function(k){return k.slice(0,2)=="on"?k.slice(2):k},_fixCallback:function(k,j){return k!="keypress"?j:function(o){return j.call(this,c._fixEvent(o,this))}},_fixEvent:function(k){switch(k.type){case "keypress":c._setKeyChar(k);break}return k},_setKeyChar:function(k){k.keyChar=k.charCode>=32?String.fromCharCode(k.charCode):"";k.charOrCode=k.keyChar||k.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}};d.fixEvent=function(k,j){return c._fixEvent(k,j)};d.stopEvent=function(k){k.preventDefault();k.stopPropagation()};var a=d._listener;d._connect=function(k,j,o,q,v){v=k&&(k.nodeType||k.attachEvent||k.addEventListener)?v?2:1:0;o=[d._listener,c,a][v].add(k,j,d.hitch(o,q));return[k,j,o,v]};d._disconnect=function(k,j,o,q){[d._listener,c,a][q].remove(k,j,o)};d.keys={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,META:d.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:d.isMac&&!d.isAIR?d.isSafari?91:224:17};var b=d.isMac?"metaKey":"ctrlKey";d.isCopyKey=function(k){return k[b]};d.mouseButtons=d.isIE<9||d.isIE&&d.isQuirks?{LEFT:1,MIDDLE:4,RIGHT:2,isButton:function(k,j){return k.button&j},isLeft:function(k){return k.button&1},isMiddle:function(k){return k.button&4},isRight:function(k){return k.button&2}}:{LEFT:0,MIDDLE:1,RIGHT:2,isButton:function(k,j){return k.button==j},isLeft:function(k){return k.button==
0},isMiddle:function(k){return k.button==1},isRight:function(k){return k.button==2}};if(d.isIE){var e=function(k,j){try{return k.keyCode=j}catch(o){return 0}},f=d._listener,g=d._ieListenersName="_"+d._scopeName+"_listeners";if(!d.config._allow_leaks){a=f=d._ie_listener={handlers:[],add:function(k,j,o){k=k||d.global;var q=k[j];if(!q||!q[g]){var v=d._getIeDispatcher();v.target=q&&i.push(q)-1;v[g]=[];q=k[j]=v}return q[g].push(i.push(o)-1)},remove:function(k,j,o){j=(k=(k||d.global)[j])&&k[g];if(k&&j&&
o--){delete i[j[o]];delete j[o]}}};var i=f.handlers}d.mixin(c,{add:function(k,j,o){if(k){j=c._normalizeEventName(j);if(j=="onkeypress"){var q=k.onkeydown;if(!q||!q[g]||!q._stealthKeydownHandle){var v=c.add(k,"onkeydown",c._stealthKeyDown);q=k.onkeydown;q._stealthKeydownHandle=v;q._stealthKeydownRefs=1}else q._stealthKeydownRefs++}return f.add(k,j,c._fixCallback(o))}},remove:function(k,j,o){j=c._normalizeEventName(j);f.remove(k,j,o);if(j=="onkeypress"){j=k.onkeydown;if(--j._stealthKeydownRefs<=0){f.remove(k,
"onkeydown",j._stealthKeydownHandle);delete j._stealthKeydownHandle}}},_normalizeEventName:function(k){return k.slice(0,2)!="on"?"on"+k:k},_nop:function(){},_fixEvent:function(k,j){if(!k)k=(j&&(j.ownerDocument||j.document||j).parentWindow||window).event;if(!k)return k;k.target=k.srcElement;k.currentTarget=j||k.srcElement;k.layerX=k.offsetX;k.layerY=k.offsetY;j=(j=k.srcElement)&&j.ownerDocument||document;j=d.isIE<6||j.compatMode=="BackCompat"?j.body:j.documentElement;var o=d._getIeDocumentElementOffset();
k.pageX=k.clientX+d._fixIeBiDiScrollLeft(j.scrollLeft||0)-o.x;k.pageY=k.clientY+(j.scrollTop||0)-o.y;if(k.type=="mouseover")k.relatedTarget=k.fromElement;if(k.type=="mouseout")k.relatedTarget=k.toElement;if(d.isIE<9||d.isQuirks){k.stopPropagation=c._stopPropagation;k.preventDefault=c._preventDefault}return c._fixKeys(k)},_fixKeys:function(k){switch(k.type){case "keypress":var j="charCode"in k?k.charCode:k.keyCode;if(j==10){j=0;k.keyCode=13}else if(j==13||j==27)j=0;else if(j==3)j=99;k.charCode=j;c._setKeyChar(k);
break}return k},_stealthKeyDown:function(k){var j=k.currentTarget.onkeypress;if(j&&j[g]){var o=k.keyCode,q=(o!=13||d.isIE>=9&&!d.isQuirks)&&o!=32&&o!=27&&(o<48||o>90)&&(o<96||o>111)&&(o<186||o>192)&&(o<219||o>222);if(q||k.ctrlKey){q=q?0:o;if(k.ctrlKey)if(o==3||o==13)return;else if(q>95&&q<106)q-=48;else if(!k.shiftKey&&q>=65&&q<=90)q+=32;else q=c._punctMap[q]||q;o=c._synthesizeEvent(k,{type:"keypress",faux:true,charCode:q});j.call(k.currentTarget,o);if(d.isIE<9||d.isIE&&d.isQuirks)k.cancelBubble=
o.cancelBubble;k.returnValue=o.returnValue;e(k,o.keyCode)}}},_stopPropagation:function(){this.cancelBubble=true},_preventDefault:function(){this.bubbledKeyCode=this.keyCode;this.ctrlKey&&e(this,0);this.returnValue=false}});d.stopEvent=d.isIE<9||d.isQuirks?function(k){k=k||window.event;c._stopPropagation.call(k);c._preventDefault.call(k)}:d.stopEvent}c._synthesizeEvent=function(k,j){j=d.mixin({},k,j);c._setKeyChar(j);j.preventDefault=function(){k.preventDefault()};j.stopPropagation=function(){k.stopPropagation()};
return j};d.isOpera&&d.mixin(c,{_fixEvent:function(k){switch(k.type){case "keypress":var j=k.which;if(j==3)j=99;j=j<41&&!k.shiftKey?0:j;if(k.ctrlKey&&!k.shiftKey&&j>=65&&j<=90)j+=32;return c._synthesizeEvent(k,{charCode:j})}return k}});if(d.isWebKit){c._add=c.add;c._remove=c.remove;d.mixin(c,{add:function(k,j,o){if(k){var q=c._add(k,j,o);if(c._normalizeEventName(j)=="keypress")q._stealthKeyDownHandle=c._add(k,"keydown",function(v){var u=v.keyCode,s=u!=13&&u!=32&&(u<48||u>90)&&(u<96||u>111)&&(u<186||
u>192)&&(u<219||u>222);if(s||v.ctrlKey){s=s?0:u;if(v.ctrlKey)if(u==3||u==13)return;else if(s>95&&s<106)s-=48;else if(!v.shiftKey&&s>=65&&s<=90)s+=32;else s=c._punctMap[s]||s;u=c._synthesizeEvent(v,{type:"keypress",faux:true,charCode:s});o.call(v.currentTarget,u)}});return q}},remove:function(k,j,o){if(k){o._stealthKeyDownHandle&&c._remove(k,"keydown",o._stealthKeyDownHandle);c._remove(k,j,o)}},_fixEvent:function(k){switch(k.type){case "keypress":if(k.faux)return k;var j=k.charCode;j=j>=32?j:0;return c._synthesizeEvent(k,
{charCode:j,faux:true})}return k}})}})();if(d.isIE){d._ieDispatcher=function(c,a){var b=Array.prototype,e=d._ie_listener.handlers,f=c.callee,g=f[d._ieListenersName];f=(f=e[f.target])&&f.apply(a,c);g=[].concat(g);for(var i in g){var k=e[g[i]];!(i in b)&&k&&k.apply(a,c)}return f};d._getIeDispatcher=function(){return new Function(d._scopeName+"._ieDispatcher(arguments, this)")};d._event_listener._fixCallback=function(c){var a=d._event_listener._fixEvent;return function(b){return c.call(this,a(b,this))}}}return d.connect});
define("dojo/_base/html",["dojo/lib/kernel","dojo/_base/lang"],function(d){try{document.execCommand("BackgroundImageCache",false,true)}catch(c){}d.byId=d.isIE?function(a,b){if(typeof a!="string")return a;var e=b||d.doc;if((b=e.getElementById(a))&&(b.attributes.id.value==a||b.id==a))return b;else{var f=e.all[a];if(!f||f.nodeName)f=[f];for(var g=0;b=f[g++];)if(b.attributes&&b.attributes.id&&b.attributes.id.value==a||b.id==a)return b}}:function(a,b){return(typeof a=="string"?(b||d.doc).getElementById(a):
a)||null};(function(){var a=d.byId,b=null,e;d.addOnWindowUnload(function(){b=null});d._destroyElement=d.destroy=function(A){A=a(A);try{var F=A.ownerDocument;if(!b||e!=F){b=F.createElement("div");e=F}b.appendChild(A.parentNode?A.parentNode.removeChild(A):A);b.innerHTML=""}catch(I){}};d.isDescendant=function(A,F){try{A=a(A);for(F=a(F);A;){if(A==F)return true;A=A.parentNode}}catch(I){}return false};d.setSelectable=function(A,F){A=a(A);if(d.isMozilla)A.style.MozUserSelect=F?"":"none";else if(d.isKhtml||
d.isWebKit)A.style.KhtmlUserSelect=F?"auto":"none";else if(d.isIE){F=A.unselectable=F?"":"on";d.query("*",A).forEach("item.unselectable = '"+F+"'")}};var f=function(A,F){var I=F.parentNode;I&&I.insertBefore(A,F)},g=function(A,F){var I=F.parentNode;if(I)I.lastChild==F?I.appendChild(A):I.insertBefore(A,F.nextSibling)};d.place=function(A,F,I){F=a(F);if(typeof A=="string")A=/^\s*</.test(A)?d._toDom(A,F.ownerDocument):a(A);if(typeof I=="number"){var O=F.childNodes;!O.length||O.length<=I?F.appendChild(A):
f(A,O[I<0?0:I])}else switch(I){case "before":f(A,F);break;case "after":g(A,F);break;case "replace":F.parentNode.replaceChild(A,F);break;case "only":d.empty(F);F.appendChild(A);break;case "first":if(F.firstChild){f(A,F.firstChild);break}default:F.appendChild(A)}return A};d.boxModel="content-box";if(d.isIE)d.boxModel=document.compatMode=="BackCompat"?"border-box":"content-box";var i;i=d.isWebKit?function(A){var F;if(A.nodeType==1){var I=A.ownerDocument.defaultView;F=I.getComputedStyle(A,null);if(!F&&
A.style){A.style.display="";F=I.getComputedStyle(A,null)}}return F||{}}:d.isIE?function(A){return A.nodeType==1?A.currentStyle:{}}:function(A){return A.nodeType==1?A.ownerDocument.defaultView.getComputedStyle(A,null):{}};d.getComputedStyle=i;d._toPixelValue=d.isIE?function(A,F){if(!F)return 0;if(F=="medium")return 4;if(F.slice&&F.slice(-2)=="px")return parseFloat(F);with(A){A=style.left;var I=runtimeStyle.left;runtimeStyle.left=currentStyle.left;try{style.left=F;F=style.pixelLeft}catch(O){F=0}style.left=
A;runtimeStyle.left=I}return F}:function(A,F){return parseFloat(F)||0};var k=d._toPixelValue,j=function(A,F){try{return A.filters.item("DXImageTransform.Microsoft.Alpha")}catch(I){return F?{}:null}};d._getOpacity=d.isIE<9?function(A){try{return j(A).Opacity/100}catch(F){return 1}}:function(A){return i(A).opacity};d._setOpacity=d.isIE<9?function(A,F){var I=F*100,O=F==1;A.style.zoom=O?"":1;if(j(A))j(A,1).Opacity=I;else{if(O)return F;A.style.filter+=" progid:DXImageTransform.Microsoft.Alpha(Opacity="+
I+")"}j(A,1).Enabled=!O;A.nodeName.toLowerCase()=="tr"&&d.query("> td",A).forEach(function(S){d._setOpacity(S,F)});return F}:function(A,F){return A.style.opacity=F};var o={left:true,top:true},q=/margin|padding|width|height|max|min|offset/,v=function(A,F,I){F=F.toLowerCase();if(d.isIE){if(I=="auto"){if(F=="height")return A.offsetHeight;if(F=="width")return A.offsetWidth}if(F=="fontweight")switch(I){case 700:return"bold";case 400:default:return"normal"}}F in o||(o[F]=q.test(F));return o[F]?k(A,I):I},
u=d.isIE?"styleFloat":"cssFloat",s={cssFloat:u,styleFloat:u,"float":u};d.style=function(A,F,I){var O=a(A),S=arguments.length,T=F=="opacity";F=s[F]||F;if(S==3)return T?d._setOpacity(O,I):(O.style[F]=I);if(S==2&&T)return d._getOpacity(O);T=i(O);if(S==2&&typeof F!="string"){for(var X in F)d.style(A,X,F[X]);return T}return S==1?T:v(O,F,T[F]||O.style[F])};d._getPadExtents=function(A,F){F=F||i(A);var I=k(A,F.paddingLeft),O=k(A,F.paddingTop);return{l:I,t:O,w:I+k(A,F.paddingRight),h:O+k(A,F.paddingBottom)}};
d._getBorderExtents=function(A,F){F=F||i(A);var I=F.borderLeftStyle!="none"?k(A,F.borderLeftWidth):0,O=F.borderTopStyle!="none"?k(A,F.borderTopWidth):0;return{l:I,t:O,w:I+(F.borderRightStyle!="none"?k(A,F.borderRightWidth):0),h:O+(F.borderBottomStyle!="none"?k(A,F.borderBottomWidth):0)}};d._getPadBorderExtents=function(A,F){var I=F||i(A);F=d._getPadExtents(A,I);A=d._getBorderExtents(A,I);return{l:F.l+A.l,t:F.t+A.t,w:F.w+A.w,h:F.h+A.h}};d._getMarginExtents=function(A,F){F=F||i(A);var I=k(A,F.marginLeft),
O=k(A,F.marginTop),S=k(A,F.marginRight);A=k(A,F.marginBottom);if(d.isWebKit&&F.position!="absolute")S=I;return{l:I,t:O,w:I+S,h:O+A}};d._getMarginBox=function(A,F){var I=F||i(A);F=d._getMarginExtents(A,I);var O=A.offsetLeft-F.l,S=A.offsetTop-F.t,T=A.parentNode;if(d.isMoz){var X=parseFloat(I.left);I=parseFloat(I.top);if(!isNaN(X)&&!isNaN(I)){O=X;S=I}else if(T&&T.style){X=i(T);if(X.overflow!="visible"){T=d._getBorderExtents(T,X);O+=T.l;S+=T.t}}}else if(d.isOpera||d.isIE>7&&!d.isQuirks)if(T){T=d._getBorderExtents(T);
O-=T.l;S-=T.t}return{l:O,t:S,w:A.offsetWidth+F.w,h:A.offsetHeight+F.h}};d._getMarginSize=function(A,F){A=a(A);F=d._getMarginExtents(A,F||i(A));A=A.getBoundingClientRect();return{w:A.right-A.left+F.w,h:A.bottom-A.top+F.h}};d._getContentBox=function(A,F){var I=F||i(A);F=d._getPadExtents(A,I);I=d._getBorderExtents(A,I);var O=A.clientWidth;if(O){A=A.clientHeight;I.w=I.h=0}else{O=A.offsetWidth;A=A.offsetHeight}if(d.isOpera){F.l+=I.l;F.t+=I.t}return{l:F.l,t:F.t,w:O-F.w-I.w,h:A-F.h-I.h}};d._getBorderBox=
function(A,F){var I=F||i(A);F=d._getPadExtents(A,I);A=d._getContentBox(A,I);return{l:A.l-F.l,t:A.t-F.t,w:A.w+F.w,h:A.h+F.h}};d._setBox=function(A,F,I,O,S,T){T=T||"px";A=A.style;if(!isNaN(F))A.left=F+T;if(!isNaN(I))A.top=I+T;if(O>=0)A.width=O+T;if(S>=0)A.height=S+T};d._isButtonTag=function(A){return A.tagName=="BUTTON"||A.tagName=="INPUT"&&(A.getAttribute("type")||"").toUpperCase()=="BUTTON"};d._usesBorderBox=function(A){var F=A.tagName;return d.boxModel=="border-box"||F=="TABLE"||d._isButtonTag(A)};
d._setContentSize=function(A,F,I,O){if(d._usesBorderBox(A)){O=d._getPadBorderExtents(A,O);if(F>=0)F+=O.w;if(I>=0)I+=O.h}d._setBox(A,NaN,NaN,F,I)};d._setMarginBox=function(A,F,I,O,S,T){var X=T||i(A);T=d._usesBorderBox(A)?w:d._getPadBorderExtents(A,X);if(d.isWebKit)if(d._isButtonTag(A)){var da=A.style;if(O>=0&&!da.width)da.width="4px";if(S>=0&&!da.height)da.height="4px"}X=d._getMarginExtents(A,X);if(O>=0)O=Math.max(O-T.w-X.w,0);if(S>=0)S=Math.max(S-T.h-X.h,0);d._setBox(A,F,I,O,S)};var w={l:0,t:0,w:0,
h:0};d.marginBox=function(A,F){A=a(A);var I=i(A);return!F?d._getMarginBox(A,I):d._setMarginBox(A,F.l,F.t,F.w,F.h,I)};d.contentBox=function(A,F){A=a(A);var I=i(A);return!F?d._getContentBox(A,I):d._setContentSize(A,F.w,F.h,I)};d._docScroll=function(){var A=d.global;return"pageXOffset"in A?{x:A.pageXOffset,y:A.pageYOffset}:(A=d.isQuirks?d.doc.body:d.doc.documentElement,{x:d._fixIeBiDiScrollLeft(A.scrollLeft||0),y:A.scrollTop||0})};d._isBodyLtr=function(){return"_bodyLtr"in d?d._bodyLtr:(d._bodyLtr=(d.body().dir||
d.doc.documentElement.dir||"ltr").toLowerCase()=="ltr")};d._getIeDocumentElementOffset=function(){var A=d.doc.documentElement;if(d.isIE<8){var F=A.getBoundingClientRect(),I=F.left;F=F.top;if(d.isIE<7){I+=A.clientLeft;F+=A.clientTop}return{x:I<0?0:I,y:F<0?0:F}}else return{x:0,y:0}};d._fixIeBiDiScrollLeft=function(A){var F=d.isIE;if(F&&!d._isBodyLtr()){var I=d.isQuirks,O=I?d.doc.body:d.doc.documentElement;if(F==6&&!I&&d.global.frameElement&&O.scrollHeight>O.clientHeight)A+=O.clientLeft;return F<8||
I?A+O.clientWidth-O.scrollWidth:-A}return A};d._abs=d.position=function(A,F){A=a(A);var I=d.body(),O=I.parentNode;A=A.getBoundingClientRect();A={x:A.left,y:A.top,w:A.right-A.left,h:A.bottom-A.top};if(d.isIE){O=d._getIeDocumentElementOffset();A.x-=O.x+(d.isQuirks?I.clientLeft+I.offsetLeft:0);A.y-=O.y+(d.isQuirks?I.clientTop+I.offsetTop:0)}else if(d.isFF==3){I=i(O);A.x-=k(O,I.marginLeft)+k(O,I.borderLeftWidth);A.y-=k(O,I.marginTop)+k(O,I.borderTopWidth)}if(F){F=d._docScroll();A.x+=F.x;A.y+=F.y}return A};
d.coords=function(A,F){A=a(A);var I=i(A);I=d._getMarginBox(A,I);F=d.position(A,F);I.x=F.x;I.y=F.y;return I};var z={"class":"className","for":"htmlFor",tabindex:"tabIndex",readonly:"readOnly",colspan:"colSpan",frameborder:"frameBorder",rowspan:"rowSpan",valuetype:"valueType"},y={classname:"class",htmlfor:"for",tabindex:"tabIndex",readonly:"readOnly"},h={innerHTML:1,className:1,htmlFor:d.isIE,value:1},n=function(A){return y[A.toLowerCase()]||A},m=function(A,F){return(A=A.getAttributeNode&&A.getAttributeNode(F))&&
A.specified};d.hasAttr=function(A,F){var I=F.toLowerCase();return h[z[I]||F]||m(a(A),y[I]||F)};var l={},p=0,t=d._scopeName+"attrid",r={col:1,colgroup:1,table:1,tbody:1,tfoot:1,thead:1,tr:1,title:1};d.attr=function(A,F,I){A=a(A);var O=arguments.length;if(O==2&&typeof F!="string"){for(var S in F)d.attr(A,S,F[S]);return A}var T=F.toLowerCase();S=z[T]||F;var X=h[S];T=y[T]||F;if(O==3){if(S=="style"&&typeof I!="string")d.style(A,I);else if(S=="innerHTML")if(d.isIE&&A.tagName.toLowerCase()in r){d.empty(A);
A.appendChild(d._toDom(I,A.ownerDocument))}else A[S]=I;else if(d.isFunction(I)){O=d.attr(A,t);if(!O){O=p++;d.attr(A,t,O)}l[O]||(l[O]={});if(X=l[O][S])d.disconnect(X);else try{delete A[S]}catch(da){}l[O][S]=d.connect(A,S,I)}else if(X||typeof I=="boolean")A[S]=I;else A.setAttribute(T,I);return A}I=A[S];if(X&&typeof I!="undefined")return I;if(S!="href"&&(typeof I=="boolean"||d.isFunction(I)))return I;return m(A,T)?A.getAttribute(T):null};d.removeAttr=function(A,F){a(A).removeAttribute(n(F))};d.getNodeProp=
function(A,F){A=a(A);var I=F.toLowerCase(),O=z[I]||F;if(O in A&&O!="href")return A[O];F=y[I]||F;return m(A,F)?A.getAttribute(F):null};d.create=function(A,F,I,O){var S=d.doc;if(I){I=a(I);S=I.ownerDocument}if(typeof A=="string")A=S.createElement(A);F&&d.attr(A,F);I&&d.place(A,I,O);return A};d.empty=d.isIE?function(A){A=a(A);for(var F;F=A.lastChild;)d.destroy(F)}:function(A){a(A).innerHTML=""};var x={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\:]+)/,C={},D=0,E="__"+d._scopeName+"ToDomId";for(var H in x)if(x.hasOwnProperty(H)){var K=x[H];K.pre=H=="option"?'<select multiple="multiple">':"<"+K.join("><")+">";K.post="</"+K.reverse().join("></")+">"}d._toDom=function(A,F){F=F||d.doc;var I=F[E];if(!I){F[E]=I=++D+"";C[I]=F.createElement("div")}A+="";var O=A.match(B),S=O?O[1].toLowerCase():"";I=C[I];if(O&&x[S]){O=
x[S];I.innerHTML=O.pre+A+O.post;for(A=O.length;A;--A)I=I.firstChild}else I.innerHTML=A;if(I.childNodes.length==1)return I.removeChild(I.firstChild);for(A=F.createDocumentFragment();F=I.firstChild;)A.appendChild(F);return A};var L="className";d.hasClass=function(A,F){return(" "+a(A)[L]+" ").indexOf(" "+F+" ")>=0};var Q=/\s+/,P=[""],R={},$=function(A){if(typeof A=="string"||A instanceof String)if(A.indexOf(" ")<0){P[0]=A;return P}else return A.split(Q);return A||""};d.addClass=function(A,F){A=a(A);
F=$(F);var I=A[L],O;I=I?" "+I+" ":" ";O=I.length;for(var S=0,T=F.length,X;S<T;++S)if((X=F[S])&&I.indexOf(" "+X+" ")<0)I+=X+" ";if(O<I.length)A[L]=I.substr(1,I.length-2)};d.removeClass=function(A,F){A=a(A);var I;if(F!==undefined){F=$(F);I=" "+A[L]+" ";for(var O=0,S=F.length;O<S;++O)I=I.replace(" "+F[O]+" "," ");I=d.trim(I)}else I="";if(A[L]!=I)A[L]=I};d.replaceClass=function(A,F,I){A=a(A);R.className=A.className;d.removeClass(R,I);d.addClass(R,F);if(A.className!==R.className)A.className=R.className};
d.toggleClass=function(A,F,I){if(I===undefined)I=!d.hasClass(A,F);d[I?"addClass":"removeClass"](A,F)}})();return d});
define("dojo/_base/NodeList",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array","dojo/_base/connect","dojo/_base/html"],function(d){(function(){var c=Array.prototype,a=c.slice,b=c.concat,e=function(u,s,w){u.sort||(u=a.call(u,0));w=w||this._NodeListCtor||d._NodeListCtor;u.constructor=w;d._mixin(u,w.prototype);u._NodeListCtor=w;return s?u._stash(s):u},f=function(u,s,w){s=[0].concat(a.call(s,0));w=w||d.global;return function(z){s[0]=z;return u.apply(w,s)}},g=function(u,s){return function(){this.forEach(f(u,
arguments,s));return this}},i=function(u,s){return function(){return this.map(f(u,arguments,s))}},k=function(u,s,w){return function(){var z=arguments,y=f(u,z,w);if(s.call(w||d.global,z))return this.map(y);this.forEach(y);return this}},j=function(u){return u.length==1&&typeof u[0]=="string"},o=function(u){var s=u.parentNode;s&&s.removeChild(u)};d.NodeList=function(){return e(Array.apply(null,arguments))};var q=d._NodeListCtor=d.NodeList,v=q.prototype;q._wrap=v._wrap=e;q._adaptAsMap=i;q._adaptAsForEach=
g;q._adaptAsFilter=function(u,s){return function(){return this.filter(f(u,arguments,s))}};q._adaptWithCondition=k;d.forEach(["slice","splice"],function(u){var s=c[u];v[u]=function(){return this._wrap(s.apply(this,arguments),u=="slice"?this:null)}});d.forEach(["indexOf","lastIndexOf","every","some"],function(u){var s=d[u];v[u]=function(){return s.apply(d,[this].concat(a.call(arguments,0)))}});d.forEach(["attr","style"],function(u){v[u]=k(d[u],j)});d.forEach(["connect","addClass","removeClass","replaceClass",
"toggleClass","empty","removeAttr"],function(u){v[u]=g(d[u])});d.extend(d.NodeList,{_normalize:function(u,s){var w=u.parse===true?true:false;if(typeof u.template=="string"){var z=u.templateFunc||d.string&&d.string.substitute;u=z?z(u.template,u):u}z=typeof u;if(z=="string"||z=="number"){u=d._toDom(u,s&&s.ownerDocument);u=u.nodeType==11?d._toArray(u.childNodes):[u]}else if(d.isArrayLike(u))d.isArray(u)||(u=d._toArray(u));else u=[u];if(w)u._runParse=true;return u},_cloneNode:function(u){return u.cloneNode(true)},
_place:function(u,s,w,z){if(!(s.nodeType!=1&&w=="only")){s=s;for(var y,h=u.length,n=h-1;n>=0;n--){var m=z?this._cloneNode(u[n]):u[n];if(u._runParse&&d.parser&&d.parser.parse){y||(y=s.ownerDocument.createElement("div"));y.appendChild(m);d.parser.parse(y);for(m=y.firstChild;y.firstChild;)y.removeChild(y.firstChild)}n==h-1?d.place(m,s,w):s.parentNode.insertBefore(m,s);s=m}}},_stash:function(u){this._parent=u;return this},end:function(){return this._parent?this._parent:new this._NodeListCtor},concat:function(){var u=
d.isArray(this)?this:a.call(this,0),s=d.map(arguments,function(w){return w&&!d.isArray(w)&&(typeof NodeList!="undefined"&&w.constructor===NodeList||w.constructor===this._NodeListCtor)?a.call(w,0):w});return this._wrap(b.apply(u,s),this)},map:function(u,s){return this._wrap(d.map(this,u,s),this)},forEach:function(u,s){d.forEach(this,u,s);return this},coords:i(d.coords),position:i(d.position),place:function(u,s){var w=d.query(u)[0];return this.forEach(function(z){d.place(z,w,s)})},orphan:function(u){return(u?
d._filterQueryResult(this,u):this).forEach(o)},adopt:function(u,s){return d.query(u).place(this[0],s)._stash(this)},query:function(u){if(!u)return this;var s=this.map(function(w){return d.query(u,w).filter(function(z){return z!==undefined})});return this._wrap(b.apply([],s),this)},filter:function(u){var s=arguments,w=this,z=0;if(typeof u=="string"){w=d._filterQueryResult(this,s[0]);if(s.length==1)return w._stash(this);z=1}return this._wrap(d.filter(w,s[z],s[z+1]),this)},addContent:function(u,s){u=
this._normalize(u,this[0]);for(var w=0,z;z=this[w];w++)this._place(u,z,s,w>0);return this},instantiate:function(u,s){var w=d.isFunction(u)?u:d.getObject(u);s=s||{};return this.forEach(function(z){new w(s,z)})},at:function(){var u=new this._NodeListCtor;d.forEach(arguments,function(s){if(s<0)s=this.length+s;this[s]&&u.push(this[s])},this);return u._stash(this)}});q.events=["blur","focus","change","click","error","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mousemove",
"mouseout","mouseover","mouseup","submit"];d.forEach(q.events,function(u){var s="on"+u;v[s]=function(w,z){return this.connect(s,w,z)}})})();return d.NodeList});
(function(){var d=function(a){var b=a.trim,e=a.forEach,f=a._NodeListCtor=a.NodeList,g=function(){return a.doc},i=(a.isWebKit||a.isMozilla)&&g().compatMode=="BackCompat",k=g().firstChild.children?"children":"childNodes",j=false,o=function(){return true},q=function(G){G+=">~+".indexOf(G.slice(-1))>=0?" * ":" ";for(var J=function(ma,na){return b(G.slice(ma,na))},M=[],N=-1,U=-1,W=-1,Y=-1,V=-1,Z=-1,ca=-1,ga="",ea="",ia,ba=0,oa=G.length,aa=null,ha=null,pa=function(){if(ca>=0){var ma=ca==ba?null:J(ca,ba);
aa[">~+".indexOf(ma)<0?"tag":"oper"]=ma;ca=-1}},qa=function(){if(Z>=0){aa.id=J(Z,ba).replace(/\\/g,"");Z=-1}},ra=function(){if(V>=0){aa.classes.push(J(V+1,ba).replace(/\\/g,""));V=-1}},la=function(){qa();pa();ra()},sa=function(){la();Y>=0&&aa.pseudos.push({name:J(Y+1,ba)});aa.loops=aa.pseudos.length||aa.attrs.length||aa.classes.length;aa.oquery=aa.query=J(ia,ba);aa.otag=aa.tag=aa.oper?null:aa.tag||"*";if(aa.tag)aa.tag=aa.tag.toUpperCase();if(M.length&&M[M.length-1].oper){aa.infixOper=M.pop();aa.query=
aa.infixOper.query+" "+aa.query}M.push(aa);aa=null};ga=ea,ea=G.charAt(ba),ba<oa;ba++)if(ga!="\\"){if(!aa){ia=ba;aa={query:null,pseudos:[],attrs:[],classes:[],tag:null,oper:null,id:null,getTag:function(){return j?this.otag:this.tag}};ca=ba}if(N>=0)if(ea=="]"){if(ha.attr)ha.matchFor=J(W||N+1,ba);else ha.attr=J(N+1,ba);if(N=ha.matchFor)if(N.charAt(0)=='"'||N.charAt(0)=="'")ha.matchFor=N.slice(1,-1);aa.attrs.push(ha);ha=null;N=W=-1}else{if(ea=="="){W="|~^$*".indexOf(ga)>=0?ga:"";ha.type=W+ea;ha.attr=
J(N+1,ba-W.length);W=ba+1}}else if(U>=0){if(ea==")"){if(Y>=0)ha.value=J(U+1,ba);Y=U=-1}}else if(ea=="#"){la();Z=ba+1}else if(ea=="."){la();V=ba}else if(ea==":"){la();Y=ba}else if(ea=="["){la();N=ba;ha={}}else if(ea=="("){if(Y>=0){ha={name:J(Y+1,ba),value:null};aa.pseudos.push(ha)}U=ba}else ea==" "&&ga!=ea&&sa()}return M},v=function(G,J){if(!G)return J;if(!J)return G;return function(){return G.apply(window,arguments)&&J.apply(window,arguments)}},u=function(G,J){J=J||[];G&&J.push(G);return J},s=function(G){return 1==
G.nodeType},w=function(G,J){if(!G)return"";if(J=="class")return G.className||"";if(J=="for")return G.htmlFor||"";if(J=="style")return G.style.cssText||"";return(j?G.getAttribute(J):G.getAttribute(J,2))||""},z={"*=":function(G,J){return function(M){return w(M,G).indexOf(J)>=0}},"^=":function(G,J){return function(M){return w(M,G).indexOf(J)==0}},"$=":function(G,J){return function(M){M=" "+w(M,G);return M.lastIndexOf(J)==M.length-J.length}},"~=":function(G,J){var M=" "+J+" ";return function(N){return(" "+
w(N,G)+" ").indexOf(M)>=0}},"|=":function(G,J){var M=" "+J+"-";return function(N){N=" "+w(N,G);return N==J||N.indexOf(M)==0}},"=":function(G,J){return function(M){return w(M,G)==J}}},y=typeof g().firstChild.nextElementSibling=="undefined",h=!y?"nextElementSibling":"nextSibling",n=!y?"previousElementSibling":"previousSibling",m=y?s:o,l=function(G){for(;G=G[n];)if(m(G))return false;return true},p=function(G){for(;G=G[h];)if(m(G))return false;return true},t=function(G){var J=G.parentNode,M=0,N=J[k],
U=G._i||-1,W=J._l||-1;if(!N)return-1;N=N.length;if(W==N&&U>=0&&W>=0)return U;J._l=N;U=-1;for(J=J.firstElementChild||J.firstChild;J;J=J[h])if(m(J)){J._i=++M;if(G===J)U=M}return U},r=function(G){return!(t(G)%2)},x=function(G){return t(G)%2},B={checked:function(){return function(G){return!!("checked"in G?G.checked:G.selected)}},"first-child":function(){return l},"last-child":function(){return p},"only-child":function(){return function(G){if(!l(G))return false;if(!p(G))return false;return true}},empty:function(){return function(G){var J=
G.childNodes;for(G=G.childNodes.length-1;G>=0;G--){var M=J[G].nodeType;if(M===1||M==3)return false}return true}},contains:function(G,J){G=J.charAt(0);if(G=='"'||G=="'")J=J.slice(1,-1);return function(M){return M.innerHTML.indexOf(J)>=0}},not:function(G,J){G=q(J)[0];J={el:1};if(G.tag!="*")J.tag=1;if(!G.classes.length)J.classes=1;var M=D(G,J);return function(N){return!M(N)}},"nth-child":function(G,J){G=parseInt;if(J=="odd")return x;else if(J=="even")return r;if(J.indexOf("n")!=-1){J=J.split("n",2);
var M=J[0]?J[0]=="-"?-1:G(J[0]):1,N=J[1]?G(J[1]):0,U=0,W=-1;if(M>0)if(N<0)N=N%M&&M+N%M;else{if(N>0){if(N>=M)U=N-N%M;N%=M}}else if(M<0){M*=-1;if(N>0){W=N;N%=M}}if(M>0)return function(V){V=t(V);return V>=U&&(W<0||V<=W)&&V%M==N};else J=N}var Y=G(J);return function(V){return t(V)==Y}}},C=a.isIE<9||dojo.isIE&&dojo.isQuirks?function(G){var J=G.toLowerCase();if(J=="class")G="className";return function(M){return j?M.getAttribute(G):M[G]||M[J]}}:function(G){return function(J){return J&&J.getAttribute&&J.hasAttribute(G)}},
D=function(G,J){if(!G)return o;J=J||{};var M=null;"el"in J||(M=v(M,s));if(!("tag"in J))if(G.tag!="*")M=v(M,function(N){return N&&N.tagName==G.getTag()});"classes"in J||e(G.classes,function(N,U){var W=new RegExp("(?:^|\\s)"+N+"(?:\\s|$)");M=v(M,function(Y){return W.test(Y.className)});M.count=U});"pseudos"in J||e(G.pseudos,function(N){var U=N.name;if(B[U])M=v(M,B[U](U,N.value))});"attrs"in J||e(G.attrs,function(N){var U,W=N.attr;if(N.type&&z[N.type])U=z[N.type](W,N.matchFor);else if(W.length)U=C(W);
if(U)M=v(M,U)});if(!("id"in J))if(G.id)M=v(M,function(N){return!!N&&N.id==G.id});M||"default"in J||(M=o);return M},E=function(G){return function(J,M,N){for(;J=J[h];)if(!(y&&!s(J))){if((!N||ja(J,N))&&G(J))M.push(J);break}return M}},H=function(G){return function(J,M,N){for(J=J[h];J;){if(m(J)){if(N&&!ja(J,N))break;G(J)&&M.push(J)}J=J[h]}return M}},K=function(G){G=G||o;return function(J,M,N){for(var U=0,W=J[k];J=W[U++];)if(m(J)&&(!N||ja(J,N))&&G(J,U))M.push(J);return M}},L=function(G,J){for(G=G.parentNode;G;){if(G==
J)break;G=G.parentNode}return!!G},Q={},P=function(G){var J=Q[G.query];if(J)return J;var M=G.infixOper;M=M?M.oper:"";var N=D(G,{el:1}),U="*"==G.tag,W=g().getElementsByClassName;if(M){W={el:1};if(U)W.tag=1;N=D(G,W);if("+"==M)J=E(N);else if("~"==M)J=H(N);else if(">"==M)J=K(N)}else if(G.id){N=!G.loops&&U?o:D(G,{el:1,id:1});J=function(V,Z){var ca=a.byId(G.id,V.ownerDocument||V);if(ca&&N(ca))if(9==V.nodeType)return u(ca,Z);else if(L(ca,V))return u(ca,Z)}}else if(W&&/\{\s*\[native code\]\s*\}/.test(String(W))&&
G.classes.length&&!i){N=D(G,{el:1,classes:1,id:1});var Y=G.classes.join(" ");J=function(V,Z,ca){Z=u(0,Z);for(var ga,ea=0,ia=V.getElementsByClassName(Y);ga=ia[ea++];)N(ga,V)&&ja(ga,ca)&&Z.push(ga);return Z}}else if(!U&&!G.loops)J=function(V,Z,ca){Z=u(0,Z);for(var ga=0,ea=V.getElementsByTagName(G.getTag());V=ea[ga++];)ja(V,ca)&&Z.push(V);return Z};else{N=D(G,{el:1,tag:1,id:1});J=function(V,Z,ca){Z=u(0,Z);for(var ga,ea=0,ia=V.getElementsByTagName(G.getTag());ga=ia[ea++];)N(ga,V)&&ja(ga,ca)&&Z.push(ga);
return Z}}return Q[G.query]=J},R=function(G,J){G=u(G);for(var M,N,U=J.length,W,Y,V=0;V<U;V++){Y=[];M=J[V];N=G.length-1;if(N>0){W={};Y.nozip=true}N=P(M);for(var Z=0;M=G[Z];Z++)N(M,Y,W);if(!Y.length)break;G=Y}return Y},$={},A={},F=function(G){var J=q(b(G));if(J.length==1){var M=P(J[0]);return function(N){if(N=M(N,new f))N.nozip=true;return N}}return function(N){return R(N,J)}},I=navigator.userAgent;I=a.isWebKit&&I.indexOf("WebKit/")>0&&parseFloat(I.split("WebKit/")[1])>528;var O=a.isIE?"commentStrip":
"nozip",S=!!g().querySelectorAll&&(!a.isSafari||a.isSafari>3.1||I),T=/n\+\d|([^ ])?([>~+])([^ =])?/g,X=function(G,J,M,N){return M?(J?J+" ":"")+M+(N?" "+N:""):G},da=function(G,J){G=G.replace(T,X);if(S){var M=A[G];if(M&&!J)return M}if(M=$[G])return M;M=G.charAt(0);var N=-1==G.indexOf(" ");if(G.indexOf("#")>=0&&N)J=true;if(S&&!J&&">~+".indexOf(M)==-1&&(!a.isIE||G.indexOf(":")==-1)&&!(i&&G.indexOf(".")>=0)&&G.indexOf(":contains")==-1&&G.indexOf(":checked")==-1&&G.indexOf("|=")==-1){var U=">~+".indexOf(G.charAt(G.length-
1))>=0?G+" *":G;return A[G]=function(Y){try{if(!(9==Y.nodeType||N))throw"";var V=Y.querySelectorAll(U);V[O]=true;return V}catch(Z){return da(G,true)(Y)}}}else{var W=G.split(/\s*,\s*/);return $[G]=W.length<2?F(G):function(Y){for(var V=0,Z=[],ca;ca=W[V++];)Z=Z.concat(F(ca)(Y));return Z}}},fa=0,ta=a.isIE?function(G){return j?G.getAttribute("_uid")||G.setAttribute("_uid",++fa)||fa:G.uniqueID}:function(G){return G._uid||(G._uid=++fa)},ja=function(G,J){if(!J)return 1;G=ta(G);if(!J[G])return J[G]=1;return 0},
ka="_zipIdx",ua=function(G){if(G&&G.nozip)return f._wrap?f._wrap(G):G;var J=new f;if(!G||!G.length)return J;G[0]&&J.push(G[0]);if(G.length<2)return J;fa++;if(a.isIE&&j){var M=fa+"";G[0].setAttribute(ka,M);for(var N=1,U;U=G[N];N++){G[N].getAttribute(ka)!=M&&J.push(U);U.setAttribute(ka,M)}}else if(a.isIE&&G.commentStrip)try{for(N=1;U=G[N];N++)s(U)&&J.push(U)}catch(W){}else{if(G[0])G[0][ka]=fa;for(N=1;U=G[N];N++){G[N][ka]!=fa&&J.push(U);U[ka]=fa}}return J};a.query=function(G,J){f=a._NodeListCtor;if(!G)return new f;
if(G.constructor==f)return G;if(typeof G!="string")return new f(G);if(typeof J=="string"){J=a.byId(J);if(!J)return new f}J=J||g();var M=J.ownerDocument||J.documentElement;j=J.contentType&&J.contentType=="application/xml"||a.isOpera&&(J.doctype||M.toString()=="[object XMLDocument]")||!!M&&(a.isIE?M.xml:J.xmlVersion||M.xmlVersion);if((G=da(G)(J))&&G.nozip&&!f._wrap)return G;return ua(G)};a.query.pseudos=B;a._filterQueryResult=function(G,J,M){var N=new a._NodeListCtor,U=q(J);U=U.length==1&&!/[^\w#\.]/.test(J)?
D(U[0]):function(V){return dojo.query(J,M).indexOf(V)!=-1};for(var W=0,Y;Y=G[W];W++)U(Y)&&N.push(Y);return N}},c=function(){acme={trim:function(f){f=f.replace(/^\s+/,"");for(var g=f.length-1;g>=0;g--)if(/\S/.test(f.charAt(g))){f=f.substring(0,g+1);break}return f},forEach:function(f,g,i){if(f&&f.length)for(var k=0,j=f.length;k<j;++k)g.call(i||window,f[k],k,f)},byId:function(f,g){return typeof f=="string"?(g||document).getElementById(f):f},doc:document,NodeList:Array};var a=navigator,b=a.userAgent;
a=a.appVersion;var e=parseFloat(a);acme.isOpera=b.indexOf("Opera")>=0?e:undefined;acme.isKhtml=a.indexOf("Konqueror")>=0?e:undefined;acme.isWebKit=parseFloat(b.split("WebKit/")[1])||undefined;acme.isChrome=parseFloat(b.split("Chrome/")[1])||undefined;if((b=Math.max(a.indexOf("WebKit"),a.indexOf("Safari"),0))&&!acme.isChrome){acme.isSafari=parseFloat(a.split("Version/")[1]);if(!acme.isSafari||parseFloat(a.substr(b+7))<=419.3)acme.isSafari=2}if(document.all&&!acme.isOpera)acme.isIE=parseFloat(a.split("MSIE ")[1])||
undefined;Array._wrap=function(f){return f};return acme};typeof define=="function"&&define("dojo/_base/query",["dojo/lib/kernel","dojo/_base/NodeList","dojo/_base/lang","dojo/_base/window"],function(a){d(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");d(this.queryPortability||this.acme||dojo)}else d(this.queryPortability||this.acme||c())})();
define("dojo/_base/xhr",["dojo/lib/kernel","dojo/_base/Deferred","dojo/_base/json","dojo/_base/lang","dojo/_base/query"],function(d){(function(){function c(y,h,n){if(n!==null){var m=y[h];if(typeof m=="string")y[h]=[m,n];else if(a.isArray(m))m.push(n);else y[h]=n}}var a=d,b=a.config;d.fieldToObject=function(y){var h=null;if(y=a.byId(y)){var n=y.name,m=(y.type||"").toLowerCase();if(n&&m&&!y.disabled)if(m=="radio"||m=="checkbox"){if(y.checked)h=y.value}else if(y.multiple){h=[];a.query("option",y).forEach(function(l){l.selected&&
h.push(l.value)})}else h=y.value}return h};d.formToObject=function(y){var h={};a.forEach(d.byId(y).elements,function(n){var m=n.name,l=(n.type||"").toLowerCase();if(m&&l&&"file|submit|image|reset|button|".indexOf(l)==-1&&!n.disabled){c(h,m,a.fieldToObject(n));if(l=="image")h[m+".x"]=h[m+".y"]=h[m].x=h[m].y=0}});return h};d.objectToQuery=function(y){var h=encodeURIComponent,n=[],m={};for(var l in y){var p=y[l];if(p!=m[l]){var t=h(l)+"=";if(a.isArray(p))for(var r=0;r<p.length;r++)n.push(t+h(p[r]));
else n.push(t+h(p))}}return n.join("&")};d.formToQuery=function(y){return a.objectToQuery(a.formToObject(y))};d.formToJson=function(y,h){return a.toJson(a.formToObject(y),h)};d.queryToObject=function(y){var h={};y=y.split("&");var n=decodeURIComponent;a.forEach(y,function(m){if(m.length){var l=m.split("=");m=n(l.shift());l=n(l.join("="));if(typeof h[m]=="string")h[m]=[h[m]];if(a.isArray(h[m]))h[m].push(l);else h[m]=l}});return h};d._blockAsync=false;var e=a._contentHandlers=d.contentHandlers={text:function(y){return y.responseText},
json:function(y){return a.fromJson(y.responseText||null)},"json-comment-filtered":function(y){d.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.");y=y.responseText;var h=y.indexOf("/*"),n=y.lastIndexOf("*/");if(h==-1||n==-1)throw new Error("JSON was not comment filtered");
return a.fromJson(y.substring(h+2,n))},javascript:function(y){return a.eval(y.responseText)},xml:function(y){var h=y.responseXML;if(a.isIE&&(!h||!h.documentElement)){var n=function(m){return"MSXML"+m+".DOMDocument"};n=["Microsoft.XMLDOM",n(6),n(4),n(3),n(2)];a.some(n,function(m){try{var l=new ActiveXObject(m);l.async=false;l.loadXML(y.responseText);h=l}catch(p){return false}return true})}return h},"json-comment-optional":function(y){return y.responseText&&/^[^{\[]*\/\*/.test(y.responseText)?e["json-comment-filtered"](y):
e.json(y)}};d._ioSetArgs=function(y,h,n,m){var l={args:y,url:y.url},p=null;if(y.form){p=a.byId(y.form);var t=p.getAttributeNode("action");l.url=l.url||(t?t.value:null);p=a.formToObject(p)}t=[{}];p&&t.push(p);y.content&&t.push(y.content);y.preventCache&&t.push({"dojo.preventCache":(new Date).valueOf()});l.query=a.objectToQuery(a.mixin.apply(null,t));l.handleAs=y.handleAs||"text";var r=new a.Deferred(h);r.addCallbacks(n,function(D){return m(D,r)});var x=y.load;x&&a.isFunction(x)&&r.addCallback(function(D){return x.call(y,
D,l)});var B=y.error;B&&a.isFunction(B)&&r.addErrback(function(D){return B.call(y,D,l)});var C=y.handle;C&&a.isFunction(C)&&r.addBoth(function(D){return C.call(y,D,l)});if(b.ioPublish&&a.publish&&l.args.ioPublish!==false){r.addCallbacks(function(D){a.publish("/dojo/io/load",[r,D]);return D},function(D){a.publish("/dojo/io/error",[r,D]);return D});r.addBoth(function(D){a.publish("/dojo/io/done",[r,D]);return D})}r.ioArgs=l;return r};var f=function(y){y.canceled=true;var h=y.ioArgs.xhr,n=typeof h.abort;
if(n=="function"||n=="object"||n=="unknown")h.abort();y=y.ioArgs.error;if(!y){y=new Error("xhr cancelled");y.dojoType="cancel"}return y},g=function(y){y=e[y.ioArgs.handleAs](y.ioArgs.xhr);return y===undefined?null:y},i=function(y,h){h.ioArgs.args.failOk||console.error(y);return y},k=null,j=[],o=0,q=function(y){if(o<=0){o=0;if(b.ioPublish&&a.publish&&(!y||y&&y.ioArgs.args.ioPublish!==false))a.publish("/dojo/io/stop")}},v=function(){var y=(new Date).getTime();if(!a._blockAsync)for(var h=0,n;h<j.length&&
(n=j[h]);h++){var m=n.dfd,l=function(){if(!m||m.canceled||!n.validCheck(m)){j.splice(h--,1);o-=1}else if(n.ioCheck(m)){j.splice(h--,1);n.resHandle(m);o-=1}else if(m.startTime)if(m.startTime+(m.ioArgs.args.timeout||0)<y){j.splice(h--,1);var t=new Error("timeout exceeded");t.dojoType="timeout";m.errback(t);m.cancel();o-=1}};if(d.config.debugAtAllCosts)l.call(this);else try{l.call(this)}catch(p){m.errback(p)}}q(m);if(!j.length){clearInterval(k);k=null}};d._ioCancelAll=function(){try{a.forEach(j,function(h){try{h.dfd.cancel()}catch(n){}})}catch(y){}};
a.isIE&&a.addOnWindowUnload(a._ioCancelAll);a._ioNotifyStart=function(y){if(b.ioPublish&&a.publish&&y.ioArgs.args.ioPublish!==false){o||a.publish("/dojo/io/start");o+=1;a.publish("/dojo/io/send",[y])}};a._ioWatch=function(y,h,n,m){var l=y.ioArgs.args;if(l.timeout)y.startTime=(new Date).getTime();j.push({dfd:y,validCheck:h,ioCheck:n,resHandle:m});k||(k=setInterval(v,50));l.sync&&v()};var u="application/x-www-form-urlencoded",s=function(y){return y.ioArgs.xhr.readyState},w=function(y){return 4==y.ioArgs.xhr.readyState},
z=function(y){var h=y.ioArgs.xhr;if(a._isDocumentOk(h))y.callback(y);else{var n=new Error("Unable to load "+y.ioArgs.url+" status:"+h.status);n.status=h.status;n.responseText=h.responseText;y.errback(n)}};d._ioAddQueryToUrl=function(y){if(y.query.length){y.url+=(y.url.indexOf("?")==-1?"?":"&")+y.query;y.query=null}};d.xhr=function(y,h,n){var m=a._ioSetArgs(h,f,g,i),l=m.ioArgs,p=l.xhr=a._xhrObj(l.args);if(!p){m.cancel();return m}if("postData"in h)l.query=h.postData;else if("putData"in h)l.query=h.putData;
else if("rawBody"in h)l.query=h.rawBody;else if(arguments.length>2&&!n||"POST|PUT".indexOf(y.toUpperCase())==-1)a._ioAddQueryToUrl(l);p.open(y,l.url,h.sync!==true,h.user||undefined,h.password||undefined);if(h.headers)for(var t in h.headers)if(t.toLowerCase()==="content-type"&&!h.contentType)h.contentType=h.headers[t];else h.headers[t]&&p.setRequestHeader(t,h.headers[t]);p.setRequestHeader("Content-Type",h.contentType||u);if(!h.headers||!("X-Requested-With"in h.headers))p.setRequestHeader("X-Requested-With",
"XMLHttpRequest");a._ioNotifyStart(m);if(d.config.debugAtAllCosts)p.send(l.query);else try{p.send(l.query)}catch(r){l.error=r;m.cancel()}a._ioWatch(m,s,w,z);return m};d.xhrGet=function(y){return a.xhr("GET",y)};d.rawXhrPost=d.xhrPost=function(y){return a.xhr("POST",y,true)};d.rawXhrPut=d.xhrPut=function(y){return a.xhr("PUT",y,true)};d.xhrDelete=function(y){return a.xhr("DELETE",y)}})();return d.xhr});
define("dojo/_base/fx",["dojo/lib/kernel","dojo/_base/Color","dojo/_base/connect","dojo/_base/lang","dojo/_base/html"],function(d){(function(){var c=d._mixin;d._Line=function(i,k){this.start=i;this.end=k};d._Line.prototype.getValue=function(i){return(this.end-this.start)*i+this.start};d.Animation=function(i){c(this,i);if(d.isArray(this.curve))this.curve=new d._Line(this.curve[0],this.curve[1])};d._Animation=d.Animation;d.extend(d.Animation,{duration:350,repeat:0,rate:20,_percent:0,_startRepeatCount:0,
_getStep:function(){var i=this._percent,k=this.easing;return k?k(i):i},_fire:function(i,k){k=k||[];if(this[i])if(d.config.debugAtAllCosts)this[i].apply(this,k);else try{this[i].apply(this,k)}catch(j){console.error("exception in animation handler for:",i);console.error(j)}return this},play:function(i,k){var j=this;j._delayTimer&&j._clearTimer();if(k){j._stopTimer();j._active=j._paused=false;j._percent=0}else if(j._active&&!j._paused)return j;j._fire("beforeBegin",[j.node]);i=i||j.delay;var o=d.hitch(j,
"_play",k);if(i>0){j._delayTimer=setTimeout(o,i);return j}o();return j},_play:function(){var i=this;i._delayTimer&&i._clearTimer();i._startTime=(new Date).valueOf();if(i._paused)i._startTime-=i.duration*i._percent;i._active=true;i._paused=false;var k=i.curve.getValue(i._getStep());if(!i._percent){if(!i._startRepeatCount)i._startRepeatCount=i.repeat;i._fire("onBegin",[k])}i._fire("onPlay",[k]);i._cycle();return i},pause:function(){var i=this;i._delayTimer&&i._clearTimer();i._stopTimer();if(!i._active)return i;
i._paused=true;i._fire("onPause",[i.curve.getValue(i._getStep())]);return i},gotoPercent:function(i,k){var j=this;j._stopTimer();j._active=j._paused=true;j._percent=i;k&&j.play();return j},stop:function(i){var k=this;k._delayTimer&&k._clearTimer();if(!k._timer)return k;k._stopTimer();if(i)k._percent=1;k._fire("onStop",[k.curve.getValue(k._getStep())]);k._active=k._paused=false;return k},status:function(){if(this._active)return this._paused?"paused":"playing";return"stopped"},_cycle:function(){var i=
this;if(i._active){var k=((new Date).valueOf()-i._startTime)/i.duration;if(k>=1)k=1;i._percent=k;if(i.easing)k=i.easing(k);i._fire("onAnimate",[i.curve.getValue(k)]);if(i._percent<1)i._startTimer();else{i._active=false;if(i.repeat>0){i.repeat--;i.play(null,true)}else if(i.repeat==-1)i.play(null,true);else if(i._startRepeatCount){i.repeat=i._startRepeatCount;i._startRepeatCount=0}i._percent=0;i._fire("onEnd",[i.node]);!i.repeat&&i._stopTimer()}}return i},_clearTimer:function(){clearTimeout(this._delayTimer);
delete this._delayTimer}});var a=0,b=null,e={run:function(){}};d.extend(d.Animation,{_startTimer:function(){if(!this._timer){this._timer=d.connect(e,"run",this,"_cycle");a++}b||(b=setInterval(d.hitch(e,"run"),this.rate))},_stopTimer:function(){if(this._timer){d.disconnect(this._timer);this._timer=null;a--}if(a<=0){clearInterval(b);b=null;a=0}}});var f=d.isIE?function(i){var k=i.style;if(!k.width.length&&d.style(i,"width")=="auto")k.width="auto"}:function(){};d._fade=function(i){i.node=d.byId(i.node);
var k=c({properties:{}},i);i=k.properties.opacity={};i.start=!("start"in k)?function(){return+d.style(k.node,"opacity")||0}:k.start;i.end=k.end;i=d.animateProperty(k);d.connect(i,"beforeBegin",d.partial(f,k.node));return i};d.fadeIn=function(i){return d._fade(c({end:1},i))};d.fadeOut=function(i){return d._fade(c({end:0},i))};d._defaultEasing=function(i){return 0.5+Math.sin((i+1.5)*Math.PI)/2};var g=function(i){this._properties=i;for(var k in i){var j=i[k];if(j.start instanceof d.Color)j.tempColor=
new d.Color}};g.prototype.getValue=function(i){var k={};for(var j in this._properties){var o=this._properties[j],q=o.start;if(q instanceof d.Color)k[j]=d.blendColors(q,o.end,i,o.tempColor).toCss();else d.isArray(q)||(k[j]=(o.end-q)*i+q+(j!="opacity"?o.units||"px":0))}return k};d.animateProperty=function(i){var k=i.node=d.byId(i.node);if(!i.easing)i.easing=d._defaultEasing;i=new d.Animation(i);d.connect(i,"beforeBegin",i,function(){var j={};for(var o in this.properties){if(o=="width"||o=="height")this.node.display=
"block";var q=this.properties[o];if(d.isFunction(q))q=q(k);q=j[o]=c({},d.isObject(q)?q:{end:q});if(d.isFunction(q.start))q.start=q.start(k);if(d.isFunction(q.end))q.end=q.end(k);var v=o.toLowerCase().indexOf("color")>=0,u=function(s,w){var z={height:s.offsetHeight,width:s.offsetWidth}[w];if(z!==undefined)return z;z=d.style(s,w);return w=="opacity"?+z:v?z:parseFloat(z)};if("end"in q){if(!("start"in q))q.start=u(k,o)}else q.end=u(k,o);if(v){q.start=new d.Color(q.start);q.end=new d.Color(q.end)}else q.start=
o=="opacity"?+q.start:parseFloat(q.start)}this.curve=new g(j)});d.connect(i,"onAnimate",d.hitch(d,"style",i.node));return i};d.anim=function(i,k,j,o,q,v){return d.animateProperty({node:i,duration:j||d.Animation.prototype.duration,properties:k,easing:o,onEnd:q}).play(v||0)}})();return d.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(d){return d});
define("orion/serviceregistry",["dojo"],function(d){function c(g,i,k){this.serviceId=g;this.name=i;this.properties=k}function a(g,i,k){this.serviceId=g;this.serviceReference=i;this.internalRegistry=k}function b(g,i,k){this.serviceId=g;this.implementation=i;this.internalRegistry=k;var j;for(j in i)if(typeof i[j]==="function")this[j]=function(o){return function(){if(k.isRegistered(g)){var q=new d.Deferred;try{var v=i[o].apply(i,Array.prototype.slice.call(arguments));d.when(v,d.hitch(q,q.resolve),d.hitch(q,
q.reject),d.hitch(q,q.progress))}catch(u){q.reject(u)}return q}throw new Error("Service was unregistered");}}(j)}function e(){this._namedlisteners={}}function f(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new e;var g=this;this.internalRegistry={isRegistered:function(i){return g._entries[i]?true:false},unregisterService:function(i){var k=g._entries[i];if(k){for(var j=k.reference,o=g._namedReferences[j.getName()],q=0;q<o.length;q++)if(o[q]===j){if(o.length===1)delete g._namedReferences[j.getName()];
else o.splice(q,1);break}g._entries[i]=null;g._serviceEventTarget.dispatchEvent("serviceRemoved",j,k.service)}},dispatchEvent:function(i,k){var j=g._entries[i];j&&j.eventTarget.dispatchEvent.apply(j.eventTarget,[k].concat(Array.prototype.slice.call(arguments,2)))},addEventListener:function(i,k,j){(i=g._entries[i])&&i.eventTarget.addEventListener(k,j)},removeEventListener:function(i,k,j){(i=g._entries[i])&&i.eventTarget.removeEventListener(k,j)}}}c.prototype={getServiceId:function(){return this.serviceId},
getName:function(){return this.name},getPropertyNames:function(){var g=[],i;for(i in this.properties)this.properties.hasOwnProperty(i)&&g.push(i);return g},getProperty:function(g){return this.properties[g]}};c.prototype.constructor=c;a.prototype={unregister:function(){this.internalRegistry.unregisterService(this.serviceId)},dispatchEvent:function(g){this.internalRegistry.dispatchEvent.apply(this.internalRegistry,[this.serviceId,g].concat(Array.prototype.slice.call(arguments,1)))},getServiceReference:function(){return this.serviceReference}};
a.prototype.constructor=a;b.prototype={addEventListener:function(g,i){this.internalRegistry.addEventListener(this.serviceId,g,i)},removeEventListener:function(g,i){this.internalRegistry.removeEventListener(this.serviceId,g,i)}};b.prototype.constructor=b;e.prototype={dispatchEvent:function(g){var i=this._namedlisteners[g];if(i)for(var k=0;k<i.length;k++)try{var j=Array.prototype.slice.call(arguments,1);i[k].apply(null,j)}catch(o){console.log(o)}},addEventListener:function(g,i){this._namedlisteners[g]=
this._namedlisteners[g]||[];this._namedlisteners[g].push(i)},removeEventListener:function(g,i){var k=this._namedlisteners[g];if(k)for(var j=0;j<k.length;j++)if(k[j]===i){if(k.length===1)delete this._namedlisteners[g];else k.splice(j,1);break}}};e.prototype.constructor=e;f.prototype={getService:function(g,i){var k,j=new d.Deferred;if(typeof g==="string"){if(this._namedReferences[g])for(var o=0;o<this._namedReferences[g].length;o++)if(k=this._entries[this._namedReferences[g][o].getServiceId()].service)break}else k=
this._entries[g.getServiceId()].service;if(k)j.resolve(k);else if(i===0)j.reject(new Error("timeout: getService"));else{var q=this,v=function(u,s){if(g===u||g===u.getName()){j.resolve(s);q._serviceEventTarget.removeEventListener("serviceAdded",v)}};this._serviceEventTarget.addEventListener("serviceAdded",v)}return j.promise},getServiceReferences:function(g){if(g)return this._namedReferences[g]?this._namedReferences[g]:[];g=[];for(var i=0;i<this._entries.length;i++)this._entries[i]&&g.push(this._entries[i].reference);
return g},registerService:function(g,i,k){var j=this._entries.length;k=new c(j,g,k);i=new b(j,i,this.internalRegistry);this._namedReferences[g]=this._namedReferences[g]||[];this._namedReferences[g].push(k);this._entries.push({reference:k,service:i,eventTarget:new e});this._serviceEventTarget.dispatchEvent("serviceAdded",k,i);return new a(j,k,this.internalRegistry)},addEventListener:function(g,i){this._serviceEventTarget.addEventListener(g,i)},removeEventListener:function(g,i){this._serviceEventTarget.removeEventListener(g,
i)}};f.prototype.constructor=f;return{ServiceReference:c,ServiceRegistration:a,Service:b,EventTarget:e,ServiceRegistry:f}});define("dijit",["dojo"],function(d){return dijit=d._dijit||{}});
define("dojo/hash",["dojo"],function(d){(function(){function c(q,v){v=q.indexOf(v);return v>=0?q.substring(v+1):""}function a(){return c(location.href,"#")}function b(){d.publish("/dojo/hashchange",[a()])}function e(){if(a()!==i){i=a();b()}}function f(q){if(k)if(k.isTransitioning())setTimeout(d.hitch(null,f,q),o);else{var v=k.iframe.location.href,u=v.indexOf("?");k.iframe.location.replace(v.substring(0,u)+"?"+q)}else{location.replace("#"+q);!j&&e()}}function g(){function q(){i=a();s=h?i:c(n.href,
"?");w=false;z=null}var v=document.createElement("iframe"),u=d.config.dojoBlankHtmlUrl||d.moduleUrl("dojo","resources/blank.html");d.config.useXDomain&&!d.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");v.id="dojo-hash-iframe";v.src=u+"?"+a();v.style.display="none";document.body.appendChild(v);this.iframe=d.global["dojo-hash-iframe"];
var s,w,z,y,h,n=this.iframe.location;this.isTransitioning=function(){return w};this.pollLocation=function(){if(!h)try{var m=c(n.href,"?");if(document.title!=y)y=this.iframe.document.title=document.title}catch(l){h=true;console.error("dojo.hash: Error adding history entry. Server unreachable.")}var p=a();if(w&&i===p)if(h||m===z){q();b()}else{setTimeout(d.hitch(this,this.pollLocation),0);return}else if(!(i===p&&(h||s===m)))if(i!==p){i=p;w=true;z=p;v.src=u+"?"+z;h=false;setTimeout(d.hitch(this,this.pollLocation),
0);return}else if(!h){location.href="#"+n.search.substring(1);q();b()}setTimeout(d.hitch(this,this.pollLocation),o)};q();setTimeout(d.hitch(this,this.pollLocation),o)}d.hash=function(q,v){if(!arguments.length)return a();if(q.charAt(0)=="#")q=q.substring(1);if(v)f(q);else location.href="#"+q;return q};var i,k,j,o=d.config.hashPollFrequency||100;d.addOnLoad(function(){if("onhashchange"in d.global&&(!d.isIE||d.isIE>=8&&document.compatMode!="BackCompat"))j=d.connect(d.global,"onhashchange",b);else if(document.addEventListener){i=
a();setInterval(e,o)}else if(document.attachEvent)k=new g})})();return d.hash});
(function(){var d=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],c=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,a=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,b=[];define("text",["require","exports","module"],function(){var e,f,g;if(typeof window!=="undefined"&&window.navigator&&window.document)f=function(i,k){var j=e.createXhr();j.open("GET",i,true);j.onreadystatechange=function(){j.readyState===4&&k(j.responseText)};j.send(null)};else if(typeof process!=="undefined"&&process.versions&&
process.versions.node){g=require.nodeRequire("fs");f=function(i,k){k(g.readFileSync(i,"utf8"))}}else if(typeof Packages!=="undefined")f=function(i,k){var j=new java.io.File(i);i=java.lang.System.getProperty("line.separator");j=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(j),"utf-8"));var o,q,v="";try{o=new java.lang.StringBuffer;if((q=j.readLine())&&q.length()&&q.charAt(0)===65279)q=q.substring(1);for(o.append(q);(q=j.readLine())!==null;){o.append(i);o.append(q)}v=
String(o.toString())}finally{j.close()}k(v)};return e={version:"0.24.0",strip:function(i){if(i){i=i.replace(c,"");var k=i.match(a);if(k)i=k[1]}else i="";return i},jsEscape:function(i){return i.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 i,k,j;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else for(k=0;k<3;k++){j=d[k];try{i=new ActiveXObject(j)}catch(o){}if(i){d=
[j];break}}if(!i)throw new Error("require.getXhr(): XMLHttpRequest not available");return i},get:f,load:function(i,k,j,o){var q=false,v=i.indexOf("."),u=i.substring(0,v),s=i.substring(v+1,i.length);v=s.indexOf("!");if(v!==-1){q=s.substring(v+1,s.length);q=q==="strip";s=s.substring(0,v)}k=k.nameToUrl(u,"."+s);e.get(k,function(w){w=q?e.strip(w):w;if(o.isBuild&&o.inlineText)b[i]=w;j(w)})},write:function(i,k,j){if(k in b){var o=e.jsEscape(b[k]);j("define('"+i+"!"+k+"', function () { return '"+o+"';});\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(d,c){c.getObject("i18n",true,c);c.i18n.getLocalization=c.i18n.getLocalization||function(a,b,e){e=c.i18n.normalizeLocale(e);var f=e.split("-"),g=[a,"nls",b].join(".");if(typeof c.global.require!=="undefined"){var i=d("i18n!"+[a.replace(/\./g,"/"),"nls",b].join("/"));(c._loadedModules[g]=c._loadedModules[g]||{})[f.join("_")]=i.root||i}if(g=c._loadedModules[g]){var k;for(i=f.length;i>0;i--){var j=f.slice(0,i).join("_");if(g[j]){k=g[j];break}}if(!k)k=g.ROOT;
if(k){a=function(){};a.prototype=k;return new a}}throw new Error("Bundle not found: "+b+" in "+a+" , locale="+e);};c.i18n.normalizeLocale=function(a){a=a?a.toLowerCase():c.locale;if(a=="root")a="ROOT";return a};c.i18n._requireLocalization=function(a,b,e,f){e=c.i18n.normalizeLocale(e);var g=[a,"nls",b].join("."),i="";if(f){for(var k=f.split(","),j=0;j<k.length;j++)if(e.indexOf(k[j])==0)if(k[j].length>i.length)i=k[j];i||(i="ROOT")}k=f?i:e;var o=c._loadedModules[g];j=null;if(o){if(c.config.localizationComplete&&
o._built)return;j=k.replace(/-/g,"_");j=c._loadedModules[g+"."+j]}if(!j){o=c.provide(g);var q=c._getModuleSymbols(a).concat("nls").join("/"),v;c.i18n._searchLocalePath(k,f,function(u){var s=u.replace(/-/g,"_"),w=g+"."+s,z=false;if(c._loadedModules[w])z=true;else{c.provide(w);w=[q];u!="ROOT"&&w.push(u);w.push(b);u=w.join("/")+".js";z=c._loadPath(u,null,function(y){y=y.root||y;var h=function(){};h.prototype=v;o[s]=new h;for(var n in y)o[s][n]=y[n]})}if(z&&o[s])v=o[s];else o[s]=v;if(f)return true})}if(f&&
e!=i)o[e.replace(/-/g,"_")]=o[i.replace(/-/g,"_")]};(function(){var a=c.config.extraLocale;if(a){if(!a instanceof Array)a=[a];var b=c.i18n._requireLocalization;c.i18n._requireLocalization=function(e,f,g,i){b(e,f,g,i);if(!g)for(g=0;g<a.length;g++)b(e,f,a[g],i)}}})();c.i18n._searchLocalePath=function(a,b,e){a=c.i18n.normalizeLocale(a);var f=a.split("-");a=[];for(var g=f.length;g>0;g--)a.push(f.slice(0,g).join("-"));a.push(false);b&&a.reverse();for(b=a.length-1;b>=0;b--)if(e(a[b]||"ROOT"))break};c.i18n._preloadLocalizations=
function(a,b){function e(i){i=c.i18n.normalizeLocale(i);c.i18n._searchLocalePath(i,true,function(k){for(var j=0;j<b.length;j++)if(b[j]==k){c.require(a+"_"+k);return true}return false})}e();for(var f=c.config.extraLocale||[],g=0;g<f.length;g++)e(f[g])};return c.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(d){d.getObject("window",true,d);d.window.getBox=function(){var c=d.doc.compatMode=="BackCompat"?d.body():d.doc.documentElement,a=d._docScroll();return{w:c.clientWidth,h:c.clientHeight,l:a.x,t:a.y}};d.window.get=function(c){if(d.isIE&&window!==document.parentWindow){c.parentWindow.execScript("document._parentWindow = window;","Javascript");var a=c._parentWindow;c._parentWindow=null;return a}return c.parentWindow||c.defaultView};d.window.scrollIntoView=function(c,
a){try{c=d.byId(c);var b=c.ownerDocument||d.doc,e=b.body||d.body(),f=b.documentElement||e.parentNode,g=d.isIE,i=d.isWebKit;if((!(d.isMoz||g||i||d.isOpera)||c==e||c==f)&&typeof c.scrollIntoView!="undefined")c.scrollIntoView(false);else{var k=b.compatMode=="BackCompat",j=g>=9&&c.ownerDocument.parentWindow.frameElement?f.clientHeight>0&&f.clientWidth>0&&(e.clientHeight==0||e.clientWidth==0||e.clientHeight>f.clientHeight||e.clientWidth>f.clientWidth)?f:e:k?e:f;b=i?e:j;var o=j.clientWidth,q=j.clientHeight,
v=!d._isBodyLtr(),u=a||d.position(c),s=c.parentNode;a=function(B){return g<=6||g&&k?false:d.style(B,"position").toLowerCase()=="fixed"};if(!a(c))for(;s;){if(s==e)s=b;var w=d.position(s),z=a(s);if(s==b){w.w=o;w.h=q;if(b==f&&g&&v)w.x+=b.offsetWidth-w.w;if(w.x<0||!g)w.x=0;if(w.y<0||!g)w.y=0}else{var y=d._getPadBorderExtents(s);w.w-=y.w;w.h-=y.h;w.x+=y.l;w.y+=y.t;var h=s.clientWidth,n=w.w-h;if(h>0&&n>0){w.w=h;w.x+=v&&(g||s.clientLeft>y.l)?n:0}h=s.clientHeight;n=w.h-h;if(h>0&&n>0)w.h=h}if(z){if(w.y<0){w.h+=
w.y;w.y=0}if(w.x<0){w.w+=w.x;w.x=0}if(w.y+w.h>q)w.h=q-w.y;if(w.x+w.w>o)w.w=o-w.x}var m=u.x-w.x,l=u.y-Math.max(w.y,0),p=m+u.w-w.w,t=l+u.h-w.h;if(p*m>0){var r=Math[m<0?"max":"min"](m,p);if(v&&(g==8&&!k||g>=9))r=-r;u.x+=s.scrollLeft;s.scrollLeft+=r;u.x-=s.scrollLeft}if(t*l>0){u.y+=s.scrollTop;s.scrollTop+=Math[l<0?"max":"min"](l,t);u.y-=s.scrollTop}s=s!=b&&!z&&s.parentNode}}}catch(x){console.error("scrollIntoView: "+x);c.scrollIntoView(false)}};return d.window});
define("dijit/_base/manager",["dojo","dijit"],function(d,c){d.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,b){b=b||d.global;var e=0,f;for(f in this._hash)a.call(b,this._hash[f],e++,this._hash);return this},
filter:function(a,b){b=b||d.global;var e=new c.WidgetSet,f=0,g;for(g in this._hash){var i=this._hash[g];a.call(b,i,f++,this._hash)&&e.add(i)}return e},byId:function(a){return this._hash[a]},byClass:function(a){var b=new c.WidgetSet,e,f;for(e in this._hash){f=this._hash[e];f.declaredClass==a&&b.add(f)}return b},toArray:function(){var a=[];for(var b in this._hash)a.push(this._hash[b]);return a},map:function(a,b){return d.map(this.toArray(),a,b)},every:function(a,b){b=b||d.global;var e=0,f;for(f in this._hash)if(!a.call(b,
this._hash[f],e++,this._hash))return false;return true},some:function(a,b){b=b||d.global;var e=0,f;for(f in this._hash)if(a.call(b,this._hash[f],e++,this._hash))return true;return false}});(function(){c.registry=new c.WidgetSet;var a=c.registry._hash,b=d.attr,e=d.hasAttr,f=d.style;c.byId=function(j){return typeof j=="string"?a[j]:j};var g={};c.getUniqueId=function(j){var o;do o=j+"_"+(j in g?++g[j]:(g[j]=0));while(a[o]);return c._scopeName=="dijit"?o:c._scopeName+"_"+o};c.findWidgets=function(j){function o(v){for(v=
v.firstChild;v;v=v.nextSibling)if(v.nodeType==1){var u=v.getAttribute("widgetId");if(u)(u=a[u])&&q.push(u);else o(v)}}var q=[];o(j);return q};c._destroyAll=function(){c._curFocus=null;c._prevFocus=null;c._activeStack=[];d.forEach(c.findWidgets(d.body()),function(j){if(!j._destroyed)if(j.destroyRecursive)j.destroyRecursive();else j.destroy&&j.destroy()})};d.isIE&&d.addOnWindowUnload(function(){c._destroyAll()});c.byNode=function(j){return a[j.getAttribute("widgetId")]};c.getEnclosingWidget=function(j){for(;j;){var o=
j.getAttribute&&j.getAttribute("widgetId");if(o)return a[o];j=j.parentNode}return null};var i=c._isElementShown=function(j){var o=f(j);return o.visibility!="hidden"&&o.visibility!="collapsed"&&o.display!="none"&&b(j,"type")!="hidden"};c.hasDefaultTabStop=function(j){switch(j.nodeName.toLowerCase()){case "a":return e(j,"href");case "area":case "button":case "input":case "object":case "select":case "textarea":return true;case "iframe":var o;try{var q=j.contentDocument;if("designMode"in q&&q.designMode==
"on")return true;o=q.body}catch(v){try{o=j.contentWindow.document.body}catch(u){return false}}return o.contentEditable=="true"||o.firstChild&&o.firstChild.contentEditable=="true";default:return j.contentEditable=="true"}};var k=c.isTabNavigable=function(j){return b(j,"disabled")?false:e(j,"tabIndex")?b(j,"tabIndex")>=0:c.hasDefaultTabStop(j)};c._getTabNavigable=function(j){function o(m){return m&&m.tagName.toLowerCase()=="input"&&m.type&&m.type.toLowerCase()=="radio"&&m.name&&m.name.toLowerCase()}
function q(m){return h[o(m)]||m}var v,u,s,w,z,y,h={},n=function(m){d.query("> *",m).forEach(function(l){if(!(d.isIE&&l.scopeName!=="HTML"||!i(l))){if(k(l)){var p=b(l,"tabIndex");if(!e(l,"tabIndex")||p==0){v||(v=l);u=l}else if(p>0){if(!s||p<w){w=p;s=l}if(!z||p>=y){y=p;z=l}}p=o(l);if(d.attr(l,"checked")&&p)h[p]=l}l.nodeName.toUpperCase()!="SELECT"&&n(l)}})};i(j)&&n(j);return{first:q(v),last:q(u),lowest:q(s),highest:q(z)}};c.getFirstInTabbingOrder=function(j){j=c._getTabNavigable(d.byId(j));return j.lowest?
j.lowest:j.first};c.getLastInTabbingOrder=function(j){j=c._getTabNavigable(d.byId(j));return j.last?j.last:j.highest};c.defaultDuration=d.config.defaultDuration||200})();return c});
define("dojo/Stateful",["dojo"],function(d){d.declare("dojo.Stateful",null,{postscript:function(c){c&&d.mixin(this,c)},get:function(c){return this[c]},set:function(c,a){if(typeof c==="object"){for(var b in c)this.set(b,c[b]);return this}b=this[c];this[c]=a;this._watchCallbacks&&this._watchCallbacks(c,b,a);return this},watch:function(c,a){var b=this._watchCallbacks;if(!b){var e=this;b=this._watchCallbacks=function(g,i,k,j){var o=function(q){if(q){q=q.slice();for(var v=0,u=q.length;v<u;v++)try{q[v].call(e,
g,i,k)}catch(s){console.error(s)}}};o(b["_"+g]);j||o(b["*"])}}if(!a&&typeof c==="function"){a=c;c="*"}else c="_"+c;var f=b[c];if(typeof f!=="object")f=b[c]=[];f.push(a);return{unwatch:function(){f.splice(d.indexOf(f,a),1)}}}});return d.Stateful});
define("dijit/_WidgetBase",["dojo","dijit","dijit/_base/manager","dojo/Stateful"],function(d,c){(function(){d.declare("dijit._WidgetBase",d.Stateful,{id:"",lang:"",dir:"","class":"",style:"",title:"",tooltip:"",baseClass:"",srcNodeRef:null,domNode:null,containerNode:null,attributeMap:{id:"",dir:"",lang:"","class":"",style:"",title:""},_blankGif:(d.config.blankGif||d.moduleUrl("dojo","resources/blank.gif")).toString(),postscript:function(a,b){this.create(a,b)},create:function(a,b){this.srcNodeRef=
d.byId(b);this._connects=[];this._subscribes=[];if(this.srcNodeRef&&typeof this.srcNodeRef.id=="string")this.id=this.srcNodeRef.id;if(a){this.params=a;d._mixin(this,a)}this.postMixInProperties();if(!this.id)this.id=c.getUniqueId(this.declaredClass.replace(/\./g,"_"));c.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(e,f){if(f.params&&e in f.params||f[e])f.set(e,f[e])};for(var b in this.attributeMap)a(b,this);d.forEach(this._getSetterAttributes(),function(e){e in this.attributeMap||a(e,this)},this)},_getSetterAttributes:function(){var a=this.constructor;if(!a._setterAttrs){var b=a._setterAttrs=[],e,f=a.prototype;for(var g in f)if(d.isFunction(f[g])&&(e=g.match(/^_set([a-zA-Z]*)Attr$/))&&
e[1])b.push(e[1].charAt(0).toLowerCase()+e[1].substr(1))}return a._setterAttrs},postMixInProperties:function(){},buildRendering:function(){if(!this.domNode)this.domNode=this.srcNodeRef||d.create("div");if(this.baseClass){var a=this.baseClass.split(" ");this.isLeftToRight()||(a=a.concat(d.map(a,function(b){return b+"Rtl"})));d.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 b=d.forEach,e=d.unsubscribe;b(this._connects,function(f){b(f,d.disconnect)});b(this._subscribes,function(f){e(f)});b(this._supportingWidgets||[],function(f){if(f.destroyRecursive)f.destroyRecursive();else f.destroy&&f.destroy()});this.destroyRendering(a);c.registry.remove(this.id);this._destroyed=true},destroyRendering:function(a){if(this.bgIframe){this.bgIframe.destroy(a);delete this.bgIframe}if(this.domNode){a?d.removeAttr(this.domNode,
"widgetId"):d.destroy(this.domNode);delete this.domNode}if(this.srcNodeRef){a||d.destroy(this.srcNodeRef);delete this.srcNodeRef}},destroyDescendants:function(a){d.forEach(this.getChildren(),function(b){b.destroyRecursive&&b.destroyRecursive(a)})},uninitialize:function(){return false},_setClassAttr:function(a){d.replaceClass(this[this.attributeMap["class"]||"domNode"],a,this["class"]);this._set("class",a)},_setStyleAttr:function(a){var b=this[this.attributeMap.style||"domNode"];if(d.isObject(a))d.style(b,
a);else if(b.style.cssText)b.style.cssText+="; "+a;else b.style.cssText=a;this._set("style",a)},_attrToDom:function(a,b){var e=this.attributeMap[a];d.forEach(d.isArray(e)?e:[e],function(f){var g=this[f.node||f||"domNode"];switch(f.type||"attribute"){case "attribute":if(d.isFunction(b))b=d.hitch(this,b);f=f.attribute?f.attribute:/^on[A-Z][a-zA-Z]*$/.test(a)?a.toLowerCase():a;d.attr(g,f,b);break;case "innerText":g.innerHTML="";g.appendChild(d.doc.createTextNode(b));break;case "innerHTML":g.innerHTML=
b;break;case "class":d.replaceClass(g,b,this[a]);break}},this)},get:function(a){var b=this._getAttrNames(a);return this[b.g]?this[b.g]():this[a]},set:function(a,b){if(typeof a==="object"){for(var e in a)this.set(e,a[e]);return this}e=this._getAttrNames(a);if(this[e.s])var f=this[e.s].apply(this,Array.prototype.slice.call(arguments,1));else{a in this.attributeMap&&this._attrToDom(a,b);this._set(a,b)}return f||this},_attrPairNames:{},_getAttrNames:function(a){var b=this._attrPairNames;if(b[a])return b[a];
var e=a.charAt(0).toUpperCase()+a.substr(1);return b[a]={n:a+"Node",s:"_set"+e+"Attr",g:"_get"+e+"Attr"}},_set:function(a,b){var e=this[a];this[a]=b;this._watchCallbacks&&this._created&&b!==e&&this._watchCallbacks(a,e,b)},toString:function(){return"[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]"},getDescendants:function(){return this.containerNode?d.query("[widgetId]",this.containerNode).map(c.byNode):[]},getChildren:function(){return this.containerNode?c.findWidgets(this.containerNode):
[]},connect:function(a,b,e){a=[d._connect(a,b,this,e)];this._connects.push(a);return a},disconnect:function(a){for(var b=0;b<this._connects.length;b++)if(this._connects[b]==a){d.forEach(a,d.disconnect);this._connects.splice(b,1);return}},subscribe:function(a,b){a=d.subscribe(a,this,b);this._subscribes.push(a);return a},unsubscribe:function(a){for(var b=0;b<this._subscribes.length;b++)if(this._subscribes[b]==a){d.unsubscribe(a);this._subscribes.splice(b,1);return}},isLeftToRight:function(){return this.dir?
this.dir=="ltr":d._isBodyLtr()},placeAt:function(a,b){a.declaredClass&&a.addChild?a.addChild(this,b):d.place(this.domNode,a,b);return this}})})();return c._WidgetBase});
define("dijit/_base/focus",["dojo","dijit","dojo/window","dijit/_base/manager"],function(d,c){d.mixin(c,{_curFocus:null,_prevFocus:null,isCollapsed:function(){return c.getBookmark().isCollapsed},getBookmark:function(){var a,b,e=d.doc.selection,f=c._curFocus;if(d.global.getSelection){if(e=d.global.getSelection())if(e.isCollapsed){if(a=f?f.tagName:""){a=a.toLowerCase();if(a=="textarea"||a=="input"&&(!f.type||f.type.toLowerCase()=="text")){e={start:f.selectionStart,end:f.selectionEnd,node:f,pRange:true};
return{isCollapsed:e.end<=e.start,mark:e}}}a={isCollapsed:true};if(e.rangeCount)a.mark=e.getRangeAt(0).cloneRange()}else{b=e.getRangeAt(0);a={isCollapsed:false,mark:b.cloneRange()}}}else if(e){a=f?f.tagName:"";a=a.toLowerCase();if(f&&a&&(a=="button"||a=="textarea"||a=="input"))if(e.type&&e.type.toLowerCase()=="none")return{isCollapsed:true,mark:null};else{b=e.createRange();return{isCollapsed:b.text&&b.text.length?false:true,mark:{range:b,pRange:true}}}a={};try{b=e.createRange();a.isCollapsed=!(e.type==
"Text"?b.htmlText.length:b.length)}catch(g){a.isCollapsed=true;return a}if(e.type.toUpperCase()=="CONTROL")if(b.length){a.mark=[];e=0;for(f=b.length;e<f;)a.mark.push(b.item(e++))}else{a.isCollapsed=true;a.mark=null}else a.mark=b.getBookmark()}else console.warn("No idea how to store the current selection for this browser!");return a},moveToBookmark:function(a){var b=d.doc;if(a=a.mark)if(d.global.getSelection){var e=d.global.getSelection();if(e&&e.removeAllRanges)if(a.pRange){e=a.node;e.selectionStart=
a.start;e.selectionEnd=a.end}else{e.removeAllRanges();e.addRange(a)}else console.warn("No idea how to restore selection for this browser!")}else if(b.selection&&a){var f;if(a.pRange)f=a.range;else if(d.isArray(a)){f=b.body.createControlRange();d.forEach(a,function(g){f.addElement(g)})}else{f=b.body.createTextRange();f.moveToBookmark(a)}f.select()}},getFocus:function(a,b){a=!c._curFocus||a&&d.isDescendant(c._curFocus,a.domNode)?c._prevFocus:c._curFocus;return{node:a,bookmark:a==c._curFocus&&d.withGlobal(b||
d.global,c.getBookmark),openedForWindow:b}},focus:function(a){if(a){var b="node"in a?a.node:a,e=a.bookmark;a=a.openedForWindow;var f=e?e.isCollapsed:false;if(b){var g=b.tagName.toLowerCase()=="iframe"?b.contentWindow:b;if(g&&g.focus)try{g.focus()}catch(i){}c._onFocusNode(b)}if(e&&d.withGlobal(a||d.global,c.isCollapsed)&&!f){a&&a.focus();try{d.withGlobal(a||d.global,c.moveToBookmark,null,[e])}catch(k){}}}},_activeStack:[],registerIframe:function(a){return c.registerWin(a.contentWindow,a)},unregisterIframe:function(a){c.unregisterWin(a)},
registerWin:function(a,b){var e=function(o){c._justMouseDowned=true;setTimeout(function(){c._justMouseDowned=false},0);d.isIE&&o&&o.srcElement&&o.srcElement.parentNode==null||c._onTouchNode(b||o.target||o.srcElement,"mouse")},f=d.isIE?a.document.documentElement:a.document;if(f)if(d.isIE){a.document.body.attachEvent("onmousedown",e);var g=function(o){o.srcElement.tagName.toLowerCase()!="#document"&&c.isTabNavigable(o.srcElement)?c._onFocusNode(b||o.srcElement):c._onTouchNode(b||o.srcElement)};f.attachEvent("onactivate",
g);var i=function(o){c._onBlurNode(b||o.srcElement)};f.attachEvent("ondeactivate",i);return function(){a.document.detachEvent("onmousedown",e);f.detachEvent("onactivate",g);f.detachEvent("ondeactivate",i);f=null}}else{f.body.addEventListener("mousedown",e,true);var k=function(o){c._onFocusNode(b||o.target)};f.addEventListener("focus",k,true);var j=function(o){c._onBlurNode(b||o.target)};f.addEventListener("blur",j,true);return function(){f.body.removeEventListener("mousedown",e,true);f.removeEventListener("focus",
k,true);f.removeEventListener("blur",j,true);f=null}}},unregisterWin:function(a){a&&a()},_onBlurNode:function(){c._prevFocus=c._curFocus;c._curFocus=null;if(!c._justMouseDowned){c._clearActiveWidgetsTimer&&clearTimeout(c._clearActiveWidgetsTimer);c._clearActiveWidgetsTimer=setTimeout(function(){delete c._clearActiveWidgetsTimer;c._setStack([]);c._prevFocus=null},100)}},_onTouchNode:function(a,b){if(c._clearActiveWidgetsTimer){clearTimeout(c._clearActiveWidgetsTimer);delete c._clearActiveWidgetsTimer}var e=
[];try{for(;a;){var f=d.attr(a,"dijitPopupParent");if(f)a=c.byId(f).domNode;else if(a.tagName&&a.tagName.toLowerCase()=="body"){if(a===d.body())break;a=d.window.get(a.ownerDocument).frameElement}else{var g=a.getAttribute&&a.getAttribute("widgetId"),i=g&&c.byId(g);i&&!(b=="mouse"&&i.get("disabled"))&&e.unshift(g);a=a.parentNode}}}catch(k){}c._setStack(e,b)},_onFocusNode:function(a){if(a)if(a.nodeType!=9){c._onTouchNode(a);if(a!=c._curFocus){if(c._curFocus)c._prevFocus=c._curFocus;c._curFocus=a;d.publish("focusNode",
[a])}}},_setStack:function(a,b){var e=c._activeStack;c._activeStack=a;for(var f=0;f<Math.min(e.length,a.length);f++)if(e[f]!=a[f])break;for(var g,i=e.length-1;i>=f;i--)if(g=c.byId(e[i])){g._focused=false;g.set("focused",false);g._hasBeenBlurred=true;g._onBlur&&g._onBlur(b);d.publish("widgetBlur",[g,b])}for(i=f;i<a.length;i++)if(g=c.byId(a[i])){g._focused=true;g.set("focused",true);g._onFocus&&g._onFocus(b);d.publish("widgetFocus",[g,b])}}});d.addOnLoad(function(){var a=c.registerWin(window);d.isIE&&
d.addOnWindowUnload(function(){c.unregisterWin(a);a=null})});return c});
define("dojo/AdapterRegistry",["dojo"],function(d){d.AdapterRegistry=function(c){this.pairs=[];this.returnWrappers=c||false};d.extend(d.AdapterRegistry,{register:function(c,a,b,e,f){this.pairs[f?"unshift":"push"]([c,a,b,e])},match:function(){for(var c=0;c<this.pairs.length;c++){var a=this.pairs[c];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(c){for(var a=0;a<this.pairs.length;a++)if(this.pairs[a][0]==
c){this.pairs.splice(a,1);return true}return false}});return d.AdapterRegistry});
define("dijit/_base/place",["dojo","dijit","dojo/window","dojo/AdapterRegistry"],function(d,c){c.getViewport=function(){return d.window.getBox()};c.placeOnScreen=function(a,b,e,f){e=d.map(e,function(g){var i={corner:g,pos:{x:b.x,y:b.y}};if(f){i.pos.x+=g.charAt(1)=="L"?f.x:-f.x;i.pos.y+=g.charAt(0)=="T"?f.y:-f.y}return i});return c._place(a,e)};c._place=function(a,b,e,f){var g=d.window.getBox();if(!a.parentNode||String(a.parentNode.tagName).toLowerCase()!="body")d.body().appendChild(a);var i=null;
d.some(b,function(j){var o=j.corner,q=j.pos,v=0,u={w:o.charAt(1)=="L"?g.l+g.w-q.x:q.x-g.l,h:o.charAt(1)=="T"?g.t+g.h-q.y:q.y-g.t};if(e){v=e(a,j.aroundCorner,o,u,f);v=typeof v=="undefined"?0:v}var s=a.style,w=s.display,z=s.visibility;s.visibility="hidden";s.display="";var y=d.marginBox(a);s.display=w;s.visibility=z;s=Math.max(g.l,o.charAt(1)=="L"?q.x:q.x-y.w);w=Math.max(g.t,o.charAt(0)=="T"?q.y:q.y-y.h);z=Math.min(g.l+g.w,o.charAt(1)=="L"?s+y.w:q.x);q=Math.min(g.t+g.h,o.charAt(0)=="T"?w+y.h:q.y);z=
z-s;q=q-w;v+=y.w-z+(y.h-q);if(i==null||v<i.overflow)i={corner:o,aroundCorner:j.aroundCorner,x:s,y:w,w:z,h:q,overflow:v,spaceAvailable:u};return!v});i.overflow&&e&&e(a,i.aroundCorner,i.corner,i.spaceAvailable,f);b=d._isBodyLtr();var k=a.style;k.top=i.y+"px";k[b?"left":"right"]=(b?i.x:g.w-i.x-i.w)+"px";return i};c.placeOnScreenAroundNode=function(a,b,e,f){b=d.byId(b);b=d.position(b,true);return c._placeOnScreenAroundRect(a,b.x,b.y,b.w,b.h,e,f)};c.placeOnScreenAroundRectangle=function(a,b,e,f){return c._placeOnScreenAroundRect(a,
b.x,b.y,b.width,b.height,e,f)};c._placeOnScreenAroundRect=function(a,b,e,f,g,i,k){var j=[];for(var o in i)j.push({aroundCorner:o,corner:i[o],pos:{x:b+(o.charAt(1)=="L"?0:f),y:e+(o.charAt(0)=="T"?0:g)}});return c._place(a,j,k,{w:f,h:g})};c.placementRegistry=new d.AdapterRegistry;c.placementRegistry.register("node",function(a,b){return typeof b=="object"&&typeof b.offsetWidth!="undefined"&&typeof b.offsetHeight!="undefined"},c.placeOnScreenAroundNode);c.placementRegistry.register("rect",function(a,
b){return typeof b=="object"&&"x"in b&&"y"in b&&"width"in b&&"height"in b},c.placeOnScreenAroundRectangle);c.placeOnScreenAroundElement=function(){return c.placementRegistry.match.apply(c.placementRegistry,arguments)};c.getPopupAroundAlignment=function(a,b){var e={};d.forEach(a,function(f){switch(f){case "after":e[b?"BR":"BL"]=b?"BL":"BR";break;case "before":e[b?"BL":"BR"]=b?"BR":"BL";break;case "below-alt":b=!b;case "below":e[b?"BL":"BR"]=b?"TL":"TR";e[b?"BR":"BL"]=b?"TR":"TL";break;case "above-alt":b=
!b;case "above":default:e[b?"TL":"TR"]=b?"BL":"BR";e[b?"TR":"TL"]=b?"BR":"BL";break}});return e};return c});define("dijit/_base/window",["dojo","dijit","dojo/window"],function(d,c){c.getDocumentWindow=function(a){return d.window.get(a)};return c});
define("dijit/_base/popup",["dojo","dijit","dijit/_base/focus","dijit/_base/place","dijit/_base/window"],function(d,c){c.popup={_stack:[],_beginZIndex:1E3,_idGen:1,_createWrapper:function(a){var b=a.declaredClass?a._popupWrapper:a.parentNode&&d.hasClass(a.parentNode,"dijitPopup"),e=a.domNode||a;if(!b){b=d.create("div",{"class":"dijitPopup",style:{display:"none"},role:"presentation"},d.body());b.appendChild(e);e=e.style;e.display="";e.visibility="";e.position="";e.top="0px";if(a.declaredClass){a._popupWrapper=
b;d.connect(a,"destroy",function(){d.destroy(b);delete a._popupWrapper})}}return b},moveOffScreen:function(a){a=this._createWrapper(a);d.style(a,{visibility:"hidden",top:"-9999px",display:""})},hide:function(a){a=this._createWrapper(a);d.style(a,"display","none")},getTopPopup:function(){for(var a=this._stack,b=a.length-1;b>0&&a[b].parent===a[b-1].widget;b--);return a[b]},open:function(a){for(var b=this._stack,e=a.popup,f=a.orient||((a.parent?a.parent.isLeftToRight():d._isBodyLtr())?{BL:"TL",BR:"TR",
TL:"BL",TR:"BR"}:{BR:"TR",BL:"TL",TR:"BR",TL:"BL"}),g=a.around,i=a.around&&a.around.id?a.around.id+"_dropdown":"popup_"+this._idGen++;b.length&&(!a.parent||!d.isDescendant(a.parent.domNode,b[b.length-1].widget.domNode));)c.popup.close(b[b.length-1].widget);var k=this._createWrapper(e);d.attr(k,{id:i,style:{zIndex:this._beginZIndex+b.length},"class":"dijitPopup "+(e.baseClass||e["class"]||"").split(" ")[0]+"Popup",dijitPopupParent:a.parent?a.parent.id:""});if(d.isIE||d.isMoz)if(!e.bgIframe)e.bgIframe=
new c.BackgroundIframe(k);f=g?c.placeOnScreenAroundElement(k,g,f,e.orient?d.hitch(e,"orient"):null):c.placeOnScreen(k,a,f=="R"?["TR","BR","TL","BL"]:["TL","BL","TR","BR"],a.padding);k.style.display="";k.style.visibility="visible";e.domNode.style.visibility="visible";g=[];g.push(d.connect(k,"onkeypress",this,function(j){if(j.charOrCode==d.keys.ESCAPE&&a.onCancel){d.stopEvent(j);a.onCancel()}else if(j.charOrCode===d.keys.TAB){d.stopEvent(j);(j=this.getTopPopup())&&j.onCancel&&j.onCancel()}}));e.onCancel&&
g.push(d.connect(e,"onCancel",a.onCancel));g.push(d.connect(e,e.onExecute?"onExecute":"onChange",this,function(){var j=this.getTopPopup();j&&j.onExecute&&j.onExecute()}));b.push({widget:e,parent:a.parent,onExecute:a.onExecute,onCancel:a.onCancel,onClose:a.onClose,handlers:g});e.onOpen&&e.onOpen(f);return f},close:function(a){for(var b=this._stack;a&&d.some(b,function(i){return i.widget==a})||!a&&b.length;){var e=b.pop(),f=e.widget,g=e.onClose;f.onClose&&f.onClose();d.forEach(e.handlers,d.disconnect);
f&&f.domNode&&this.hide(f);g&&g()}}};c._frames=new (function(){var a=[];this.pop=function(){var b;if(a.length){b=a.pop();b.style.display=""}else{if(d.isIE<9){b="<iframe src='"+(d.config.dojoBlankHtmlUrl||d.moduleUrl("dojo","resources/blank.html")+""||'javascript:""')+"' style='position: absolute; left: 0px; top: 0px;z-index: -1; filter:Alpha(Opacity=\"0\");'>";b=d.doc.createElement(b)}else{b=d.create("iframe");b.src='javascript:""';b.className="dijitBackgroundIframe";d.style(b,"opacity",0.1)}b.tabIndex=
-1;c.setWaiRole(b,"presentation")}return b};this.push=function(b){b.style.display="none";a.push(b)}});c.BackgroundIframe=function(a){if(!a.id)throw new Error("no id");if(d.isIE||d.isMoz){var b=this.iframe=c._frames.pop();a.appendChild(b);if(d.isIE<7||d.isQuirks){this.resize(a);this._conn=d.connect(a,"onresize",this,function(){this.resize(a)})}else d.style(b,{width:"100%",height:"100%"})}};d.extend(c.BackgroundIframe,{resize:function(a){this.iframe&&d.style(this.iframe,{width:a.offsetWidth+"px",height:a.offsetHeight+
"px"})},destroy:function(){if(this._conn){d.disconnect(this._conn);this._conn=null}if(this.iframe){c._frames.push(this.iframe);delete this.iframe}}});return c.popup});define("dijit/_base/scroll",["dojo","dijit","dojo/window"],function(d,c){c.scrollIntoView=function(a,b){d.window.scrollIntoView(a,b)};return c.scrollIntoView});
define("dojo/uacss",["dojo"],function(d){(function(){var c=d.doc.documentElement,a=d.isIE,b=d.isOpera,e=Math.floor,f=d.isFF,g=d.boxModel.replace(/-/,"");a={dj_ie:a,dj_ie6:e(a)==6,dj_ie7:e(a)==7,dj_ie8:e(a)==8,dj_ie9:e(a)==9,dj_quirks:d.isQuirks,dj_iequirks:a&&d.isQuirks,dj_opera:b,dj_khtml:d.isKhtml,dj_webkit:d.isWebKit,dj_safari:d.isSafari,dj_chrome:d.isChrome,dj_gecko:d.isMozilla,dj_ff3:e(f)==3};a["dj_"+g]=true;var i="";for(var k in a)if(a[k])i+=k+" ";c.className=d.trim(c.className+" "+i);d._loaders.unshift(function(){if(!d._isBodyLtr()){var j=
"dj_rtl dijitRtl "+i.replace(/ /g,"-rtl ");c.className=d.trim(c.className+" "+j)}})})();return d});define("dijit/_base/sniff",["dojo","dijit","dojo/uacss"],function(d,c){return c});
define("dijit/_base/typematic",["dojo","dijit"],function(d,c){c.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(d.hitch(this,"_fireEventAndReload"),this._currentTimeout)},trigger:function(a,b,e,f,g,i,k,j){if(g!=this._obj){this.stop();
this._initialDelay=k||500;this._subsequentDelay=i||0.9;this._minDelay=j||10;this._obj=g;this._evt=a;this._node=e;this._count=this._currentTimeout=-1;this._callback=d.hitch(b,f);this._fireEventAndReload();this._evt=d.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,b,e,f,g,i,k){if(b.keyCode){b.charOrCode=b.keyCode;d.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.",
"","2.0")}else if(b.charCode){b.charOrCode=String.fromCharCode(b.charCode);d.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0")}return[d.connect(a,"onkeypress",this,function(j){if(j.charOrCode==b.charOrCode&&(b.ctrlKey===undefined||b.ctrlKey==j.ctrlKey)&&(b.altKey===undefined||b.altKey==j.altKey)&&(b.metaKey===undefined||b.metaKey==(j.metaKey||false))&&(b.shiftKey===undefined||b.shiftKey==j.shiftKey)){d.stopEvent(j);c.typematic.trigger(j,
e,a,f,b,g,i,k)}else c.typematic._obj==b&&c.typematic.stop()}),d.connect(a,"onkeyup",this,function(){c.typematic._obj==b&&c.typematic.stop()})]},addMouseListener:function(a,b,e,f,g,i){var k=d.connect;return[k(a,"mousedown",this,function(j){d.stopEvent(j);c.typematic.trigger(j,b,a,e,a,f,g,i)}),k(a,"mouseup",this,function(j){d.stopEvent(j);c.typematic.stop()}),k(a,"mouseout",this,function(j){d.stopEvent(j);c.typematic.stop()}),k(a,"mousemove",this,function(j){j.preventDefault()}),k(a,"dblclick",this,
function(j){d.stopEvent(j);if(d.isIE){c.typematic.trigger(j,b,a,e,a,f,g,i);setTimeout(d.hitch(this,c.typematic.stop),50)}})]},addListener:function(a,b,e,f,g,i,k,j){return this.addKeyListener(b,e,f,g,i,k,j).concat(this.addMouseListener(a,f,g,i,k,j))}};return c.typematic});
define("dijit/_base/wai",["dojo","dijit"],function(d,c){c.wai={onload:function(){var a=d.create("div",{id:"a11yTestNode",style:{cssText:'border: 1px solid;border-color:red green;position: absolute;height: 5px;top: -999px;background-image: url("'+(d.config.blankGif||d.moduleUrl("dojo","resources/blank.gif"))+'");'}},d.body()),b=d.getComputedStyle(a);if(b){var e=b.backgroundImage;d[b.borderTopColor==b.borderRightColor||e!=null&&(e=="none"||e=="url(invalid-url:)")?"addClass":"removeClass"](d.body(),
"dijit_a11y");if(d.isIE)a.outerHTML="";else d.body().removeChild(a)}}};if(d.isIE||d.isMoz)d._loaders.unshift(c.wai.onload);d.mixin(c,{hasWaiRole:function(a,b){a=this.getWaiRole(a);return b?a.indexOf(b)>-1:a.length>0},getWaiRole:function(a){return d.trim((d.attr(a,"role")||"").replace("wairole:",""))},setWaiRole:function(a,b){d.attr(a,"role",b)},removeWaiRole:function(a,b){var e=d.attr(a,"role");if(e)if(b){b=d.trim((" "+e+" ").replace(" "+b+" "," "));d.attr(a,"role",b)}else a.removeAttribute("role")},
hasWaiState:function(a,b){return a.hasAttribute?a.hasAttribute("aria-"+b):!!a.getAttribute("aria-"+b)},getWaiState:function(a,b){return a.getAttribute("aria-"+b)||""},setWaiState:function(a,b,e){a.setAttribute("aria-"+b,e)},removeWaiState:function(a,b){a.removeAttribute("aria-"+b)}});return c});
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(d,c){return c._base});
define("dijit/_Widget",["dojo","dijit","dijit/_WidgetBase","dijit/_base"],function(d,c){d.connect(d,"_connect",function(a,b){a&&d.isFunction(a._onConnect)&&a._onConnect(b)});c._connectOnUseEventHandler=function(){};c._lastKeyDownNode=null;d.isIE?function(){var a=function(b){c._lastKeyDownNode=b.srcElement};d.doc.attachEvent("onkeydown",a);d.addOnWindowUnload(function(){d.doc.detachEvent("onkeydown",a)})}():d.doc.addEventListener("keydown",function(a){c._lastKeyDownNode=a.target},true);(function(){d.declare("dijit._Widget",
c._WidgetBase,{_deferredConnects:{onClick:"",onDblClick:"",onKeyDown:"",onKeyPress:"",onKeyUp:"",onMouseMove:"",onMouseDown:"",onMouseOut:"",onMouseOver:"",onMouseLeave:"",onMouseEnter:"",onMouseUp:""},onClick:c._connectOnUseEventHandler,onDblClick:c._connectOnUseEventHandler,onKeyDown:c._connectOnUseEventHandler,onKeyPress:c._connectOnUseEventHandler,onKeyUp:c._connectOnUseEventHandler,onMouseDown:c._connectOnUseEventHandler,onMouseMove:c._connectOnUseEventHandler,onMouseOut:c._connectOnUseEventHandler,
onMouseOver:c._connectOnUseEventHandler,onMouseLeave:c._connectOnUseEventHandler,onMouseEnter:c._connectOnUseEventHandler,onMouseUp:c._connectOnUseEventHandler,create:function(){this._deferredConnects=d.clone(this._deferredConnects);for(var a in this.attributeMap)delete this._deferredConnects[a];for(a in this._deferredConnects)this[a]!==c._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&&d.style(this.domNode,"display")!="none"},onFocus:function(){},onBlur:function(){},_onFocus:function(){this.onFocus()},_onBlur:function(){this.onBlur()},setAttribute:function(a,b){d.deprecated(this.declaredClass+"::setAttribute(attr, value) is deprecated. Use set() instead.","","2.0");this.set(a,b)},attr:function(a){if(d.config.isDebug){var b=
arguments.callee._ach||(arguments.callee._ach={}),e=(arguments.callee.caller||"unknown caller").toString();if(!b[e]){d.deprecated(this.declaredClass+"::attr() is deprecated. Use get() or set() instead, called from "+e,"","2.0");b[e]=true}}return arguments.length>=2||typeof a==="object"?this.set.apply(this,arguments):this.get(a)},nodesWithKeyClick:["input","button"],connect:function(a,b,e){var f=d._connect,g=this.inherited(arguments,[a,b=="ondijitclick"?"onclick":b,e]);if(b=="ondijitclick")if(d.indexOf(this.nodesWithKeyClick,
a.nodeName.toLowerCase())==-1){var i=d.hitch(this,e);g.push(f(a,"onkeydown",this,function(k){if((k.keyCode==d.keys.ENTER||k.keyCode==d.keys.SPACE)&&!k.ctrlKey&&!k.shiftKey&&!k.altKey&&!k.metaKey){c._lastKeyDownNode=k.target;"openDropDown"in this&&a==this._buttonNode||k.preventDefault()}}),f(a,"onkeyup",this,function(k){if((k.keyCode==d.keys.ENTER||k.keyCode==d.keys.SPACE)&&k.target==c._lastKeyDownNode&&!k.ctrlKey&&!k.shiftKey&&!k.altKey&&!k.metaKey){c._lastKeyDownNode=null;return i(k)}}))}return g},
_onShow:function(){this.onShow()},onShow:function(){},onHide:function(){},onClose:function(){return true}})})();return c._Widget});
define("dojo/string",["dojo"],function(d){d.getObject("string",true,d);d.string.rep=function(c,a){if(a<=0||!c)return"";for(var b=[];;){a&1&&b.push(c);if(!(a>>=1))break;c+=c}return b.join("")};d.string.pad=function(c,a,b,e){b||(b="0");c=String(c);a=d.string.rep(b,Math.ceil((a-c.length)/b.length));return e?c+a:a+c};d.string.substitute=function(c,a,b,e){e=e||d.global;b=b?d.hitch(e,b):function(f){return f};return c.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,function(f,g,i){f=d.getObject(g,false,
a);if(i)f=d.getObject(i,false,e).call(e,f,g);return b(f,g).toString()})};d.string.trim=String.prototype.trim?d.trim:function(c){c=c.replace(/^\s+/,"");for(var a=c.length-1;a>=0;a--)if(/\S/.test(c.charAt(a))){c=c.substring(0,a+1);break}return c};return d.string});
define("dojo/date/stamp",["dojo"],function(d){d.getObject("date.stamp",true,d);d.date.stamp.fromISOString=function(c,a){if(!d.date.stamp._isoRegExp)d.date.stamp._isoRegExp=/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;var b=d.date.stamp._isoRegExp.exec(c);c=null;if(b){b.shift();b[1]&&b[1]--;if(b[6])b[6]*=1E3;if(a){a=new Date(a);d.forEach(d.map(["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"],function(g){return a["get"+
g]()}),function(g,i){b[i]=b[i]||g})}c=new Date(b[0]||1970,b[1]||0,b[2]||1,b[3]||0,b[4]||0,b[5]||0,b[6]||0);if(b[0]<100)c.setFullYear(b[0]||1970);var e=0,f=b[7]&&b[7].charAt(0);if(f!="Z"){e=(b[8]||0)*60+(Number(b[9])||0);if(f!="-")e*=-1}if(f)e-=c.getTimezoneOffset();e&&c.setTime(c.getTime()+e*6E4)}return c};d.date.stamp.toISOString=function(c,a){var b=function(i){return i<10?"0"+i:i};a=a||{};var e=[],f=a.zulu?"getUTC":"get",g="";if(a.selector!="time"){g=c[f+"FullYear"]();g=["0000".substr((g+"").length)+
g,b(c[f+"Month"]()+1),b(c[f+"Date"]())].join("-")}e.push(g);if(a.selector!="date"){g=[b(c[f+"Hours"]()),b(c[f+"Minutes"]()),b(c[f+"Seconds"]())].join(":");f=c[f+"Milliseconds"]();if(a.milliseconds)g+="."+(f<100?"0":"")+b(f);if(a.zulu)g+="Z";else if(a.selector!="time"){c=c.getTimezoneOffset();a=Math.abs(c);g+=(c>0?"-":"+")+b(Math.floor(a/60))+":"+b(a%60)}e.push(g)}return e.join("T")};return d.date.stamp});
define("dojo/parser",["dojo","dojo/date/stamp"],function(d){d.parser=new (function(){function c(k){if(f.isString(k))return"string";if(typeof k=="number")return"number";if(typeof k=="boolean")return"boolean";if(f.isFunction(k))return"function";if(f.isArray(k))return"array";if(k instanceof Date)return"date";if(k instanceof f._Url)return"url";return"object"}function a(k,j){switch(j){case "string":return k;case "number":return k.length?Number(k):NaN;case "boolean":return typeof k=="boolean"?k:k.toLowerCase()!=
"false";case "function":if(f.isFunction(k)){k=k.toString();k=f.trim(k.substring(k.indexOf("{")+1,k.length-1))}try{return k===""||k.search(/[^\w\.]+/i)!=-1?new Function(k):f.getObject(k,false)||new Function(k)}catch(o){return new Function}case "array":return k?k.split(/\s*,\s*/):[];case "date":switch(k){case "":return new Date("");case "now":return new Date;default:return f.date.stamp.fromISOString(k)}case "url":return f.baseUrl+k;default:return f.fromJson(k)}}function b(k,j){for(var o in k)if(o.charAt(0)!=
"_")o in g||(j[o]=c(k[o]));return j}function e(k,j){var o=i[k];if(o){if(!j&&!o.params)o.params=b(o.cls.prototype,{})}else{k=f.getObject(k);o=null;if(!k)return null;j||(o=b(k.prototype,{}));o={cls:k,params:o}}return o}var f=d,g={},i={};f.connect(f,"extend",function(){i={}});this._functionFromScript=function(k,j){var o="",q="";(j=k.getAttribute(j+"args")||k.getAttribute("args"))&&f.forEach(j.split(/\s*,\s*/),function(v,u){o+="var "+v+" = arguments["+u+"]; "});(j=k.getAttribute("with"))&&j.length&&f.forEach(j.split(/\s*,\s*/),
function(v){o+="with("+v+"){";q+="}"});return new Function(o+k.innerHTML+q)};this.instantiate=function(k,j,o){var q=[];j=j||{};o=o||{};var v=(o.scope||f._scopeName)+"Type",u="data-"+(o.scope||f._scopeName)+"-";f.forEach(k,function(s){if(s){var w,z,y,h,n,m;if(s.node){w=s.node;z=s.type;m=s.fastpath;h=(y=s.clsInfo||z&&e(z,m))&&y.cls;n=s.scripts}else{w=s;n=(h=(y=(z=v in j?j[v]:w.getAttribute(v))&&e(z))&&y.cls)&&(h._noScript||h.prototype._noScript)?[]:f.query("> script[type^='dojo/']",w)}if(!y)throw new Error("Could not load class '"+
z);var l={};o.defaults&&f._mixin(l,o.defaults);s.inherited&&f._mixin(l,s.inherited);if(m){if((y=w.getAttribute(u+"props"))&&y.length)try{y=f.fromJson.call(o.propsThis,"{"+y+"}");f._mixin(l,y)}catch(p){throw new Error(p.toString()+" in data-dojo-props='"+y+"'");}if(y=w.getAttribute(u+"attach-point"))l.dojoAttachPoint=y;if(y=w.getAttribute(u+"attach-event"))l.dojoAttachEvent=y;d.mixin(l,j)}else{s=w.attributes;for(var t in y.params){z=t in j?{value:j[t],specified:true}:s.getNamedItem(t);if(!(!z||!z.specified&&
(!d.isIE||t.toLowerCase()!="value"))){z=z.value;switch(t){case "class":z="className"in j?j.className:w.className;break;case "style":z="style"in j?j.style:w.style&&w.style.cssText}var r=y.params[t];l[t]=typeof z=="string"?a(z,r):z}}}var x=[],B=[];f.forEach(n,function(D){w.removeChild(D);var E=D.getAttribute(u+"event")||D.getAttribute("event"),H=D.getAttribute("type");D=f.parser._functionFromScript(D,u);if(E)if(H=="dojo/connect")x.push({event:E,func:D});else l[E]=D;else B.push(D)});var C=(n=h.markupFactory||
h.prototype&&h.prototype.markupFactory)?n(l,w,h):new h(l,w);q.push(C);(h=w.getAttribute(u+"id")||w.getAttribute("jsId"))&&f.setObject(h,C);f.forEach(x,function(D){f.connect(C,D.event,null,D.func)});f.forEach(B,function(D){D.call(C)})}});j._started||f.forEach(q,function(s){if(!o.noStart&&s&&d.isFunction(s.startup)&&!s._started&&(!s.getParent||!s.getParent()))s.startup()});return q};this.parse=function(k,j){function o(w,z){var y=d.clone(w.inherited);d.forEach(["dir","lang"],function(t){var r=w.node.getAttribute(t);
if(r)y[t]=r});for(var h=w.clsInfo&&!w.clsInfo.cls.prototype._noScript?w.scripts:null,n=!w.clsInfo||!w.clsInfo.cls.prototype.stopParser||j&&j.template,m=w.node.firstChild;m;m=m.nextSibling)if(m.nodeType==1){var l,p=n&&m.getAttribute(v+"type");l=p?p:n&&m.getAttribute(q);p=p==l;if(l){l={type:l,fastpath:p,clsInfo:e(l,p),node:m,scripts:[],inherited:y};z.push(l);o(l,z)}else if(h&&m.nodeName.toLowerCase()=="script")(l=m.getAttribute("type"))&&/^dojo\/\w/i.test(l)&&h.push(m);else n&&o({node:m,inherited:y},
z)}}if(!j&&k&&k.rootNode){j=k;k=j.rootNode}else k=k;k=k?d.byId(k):d.body();j=j||{};var q=(j.scope||f._scopeName)+"Type",v="data-"+(j.scope||f._scopeName)+"-",u={};if(j&&j.inherited)for(var s in j.inherited)if(j.inherited[s])u[s]=j.inherited[s];s=[];o({node:k,inherited:u},s);return this.instantiate(s,j&&j.template?{template:true}:null,j)}});(function(){var c=function(){d.config.parseOnLoad&&d.parser.parse()};d.getObject("dijit.wai.onload")===d._loaders[0]?d._loaders.splice(1,0,c):d._loaders.unshift(c)})();
return d.parser});
define("dojo/cache",["dojo"],function(d){var c={};d.cache=function(a,b,e){if(typeof a=="string")var f=d.moduleUrl(a,b);else{f=a;e=b}f=f.toString();var g=e;if(e!=undefined&&!d.isString(e))g="value"in e?e.value:undefined;e=e&&e.sanitize?true:false;if(typeof g=="string")g=c[f]=e?d.cache._sanitize(g):g;else if(g===null)delete c[f];else{if(!(f in c)){g=undefined;if(d.isFunction(require)&&d.isString(a))try{var i=(a?a.replace(/\./g,"/")+"/":"")+b;g=require("text!"+i)}catch(k){}if(typeof g==="undefined")g=
d._getText(f);c[f]=e?d.cache._sanitize(g):g}g=c[f]}return g};d.cache._sanitize=function(a){if(a){a=a.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,"");var b=a.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(b)a=b[1]}else a="";return a};return d.cache});
define("dijit/_Templated",["dojo","dijit","dijit/_Widget","dojo/string","dojo/parser","dojo/cache"],function(d,c){d.declare("dijit._Templated",null,{templateString:null,templatePath:null,widgetsInTemplate:false,_skipNodeCache:false,_earlyTemplatedStartup:false,constructor:function(){this._attachPoints=[];this._attachEvents=[]},_stringRepl:function(a){var b=this.declaredClass,e=this;return d.string.substitute(a,this,function(f,g){if(g.charAt(0)=="!")f=d.getObject(g.substr(1),false,e);if(typeof f==
"undefined")throw new Error(b+" template:"+g);if(f==null)return"";return g.charAt(0)=="!"?f:f.toString().replace(/"/g,"&quot;")},this)},buildRendering:function(){var a=c._Templated.getCachedTemplate(this.templatePath,this.templateString,this._skipNodeCache),b;if(d.isString(a)){b=d._toDom(this._stringRepl(a));if(b.nodeType!=1)throw new Error("Invalid template: "+a);}else b=a.cloneNode(true);this.domNode=b;this.inherited(arguments);this._attachTemplateNodes(b);if(this.widgetsInTemplate){a=this._startupWidgets=
d.parser.parse(b,{noStart:!this._earlyTemplatedStartup,template:true,inherited:{dir:this.dir,lang:this.lang},propsThis:this,scope:"dojo"});this._supportingWidgets=c.findWidgets(b);this._attachTemplateNodes(a,function(e,f){return e[f]})}this._fillContent(this.srcNodeRef)},_fillContent:function(a){var b=this.containerNode;if(a&&b)for(;a.hasChildNodes();)b.appendChild(a.firstChild)},_attachTemplateNodes:function(a,b){b=b||function(q,v){return q.getAttribute(v)};for(var e=d.isArray(a)?a:a.all||a.getElementsByTagName("*"),
f=d.isArray(a)?0:-1;f<e.length;f++){var g=f==-1?a:e[f];if(!(this.widgetsInTemplate&&(b(g,"dojoType")||b(g,"data-dojo-type")))){var i=b(g,"dojoAttachPoint")||b(g,"data-dojo-attach-point");if(i)for(var k=i.split(/\s*,\s*/);i=k.shift();){if(d.isArray(this[i]))this[i].push(g);else this[i]=g;this._attachPoints.push(i)}if(i=b(g,"dojoAttachEvent")||b(g,"data-dojo-attach-event")){k=i.split(/\s*,\s*/);for(var j=d.trim;i=k.shift();)if(i){var o=null;if(i.indexOf(":")!=-1){o=i.split(":");i=j(o[0]);o=j(o[1])}else i=
j(i);o||(o=i);this._attachEvents.push(this.connect(g,i,o))}}(i=b(g,"waiRole"))&&c.setWaiRole(g,i);(i=b(g,"waiState"))&&d.forEach(i.split(/\s*,\s*/),function(q){if(q.indexOf("-")!=-1){q=q.split("-");c.setWaiState(g,q[0],q[1])}})}}},startup:function(){d.forEach(this._startupWidgets,function(a){a&&!a._started&&a.startup&&a.startup()});this.inherited(arguments)},destroyRendering:function(){d.forEach(this._attachPoints,function(a){delete this[a]},this);this._attachPoints=[];d.forEach(this._attachEvents,
this.disconnect,this);this._attachEvents=[];this.inherited(arguments)}});c._Templated._templateCache={};c._Templated.getCachedTemplate=function(a,b,e){var f=c._Templated._templateCache,g=b||a,i=f[g];if(i){try{if(!i.ownerDocument||i.ownerDocument==d.doc)return i}catch(k){}d.destroy(i)}b||(b=d.cache(a,{sanitize:true}));b=d.string.trim(b);if(e||b.match(/\$\{([^\}]+)\}/g))return f[g]=b;else{a=d._toDom(b);if(a.nodeType!=1)throw new Error("Invalid template: "+b);return f[g]=a}};d.isIE&&d.addOnWindowUnload(function(){var a=
c._Templated._templateCache;for(var b in a){var e=a[b];typeof e=="object"&&d.destroy(e);delete a[b]}});d.extend(c._Widget,{dojoAttachEvent:"",dojoAttachPoint:"",waiRole:"",waiState:""});return c._Templated});
define("dijit/_CssStateMixin",["dojo","dijit"],function(d,c){d.declare("dijit._CssStateMixin",[],{cssStateNodes:{},hovering:false,active:false,_applyAttributes:function(){this.inherited(arguments);d.forEach(["onmouseenter","onmouseleave","onmousedown"],function(b){this.connect(this.domNode,b,"_cssMouseEvent")},this);d.forEach(["disabled","readOnly","checked","selected","focused","state","hovering","active"],function(b){this.watch(b,d.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 b=this.connect(d.body(),"onmouseup",function(){this._mouseDown=false;this._set("active",false);this.disconnect(b)});break}},_setStateClass:function(){function a(k){b=
b.concat(d.map(b,function(j){return j+k}),"dijit"+k)}var b=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 e=this.stateNode||this.domNode,f={};d.forEach(e.className.split(" "),function(k){f[k]=true});"_stateClasses"in this&&d.forEach(this._stateClasses,
function(k){delete f[k]});d.forEach(b,function(k){f[k]=true});var g=[];for(var i in f)g.push(i);e.className=g.join(" ");this._stateClasses=b},_trackMouseState:function(a,b){function e(){var o="disabled"in k&&k.disabled||"readonly"in k&&k.readonly;d.toggleClass(a,b+"Hover",f&&!g&&!o);d.toggleClass(a,b+"Active",g&&!o);d.toggleClass(a,b+"Focused",i&&!o)}var f=false,g=false,i=false,k=this,j=d.hitch(this,"connect",a);j("onmouseenter",function(){f=true;e()});j("onmouseleave",function(){g=f=false;e()});
j("onmousedown",function(){g=true;e()});j("onmouseup",function(){g=false;e()});j("onfocus",function(){i=true;e()});j("onblur",function(){i=false;e()});this.watch("disabled",e);this.watch("readOnly",e)}});return c._CssStateMixin});
define("dijit/form/_FormWidget",["dojo","dijit","dojo/window","dijit/_Widget","dijit/_Templated","dijit/_CssStateMixin"],function(d,c){d.declare("dijit.form._FormWidget",[c._Widget,c._Templated,c._CssStateMixin],{name:"",alt:"",value:"",type:"text",tabIndex:"0",disabled:false,intermediateChanges:false,scrollOnFocus:true,attributeMap:d.delegate(c._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);d.attr(this.focusNode,"disabled",a);this.valueNode&&d.attr(this.valueNode,"disabled",a);c.setWaiState(this.focusNode,"disabled",a);if(a){this._set("hovering",false);this._set("active",false);a="tabIndex"in this.attributeMap?this.attributeMap.tabIndex:"focusNode";
d.forEach(d.isArray(a)?a:[a],function(b){b=this[b];d.isWebKit||c.hasDefaultTabStop(b)?b.setAttribute("tabIndex","-1"):b.removeAttribute("tabIndex")},this)}else this.tabIndex!=""&&this.focusNode.setAttribute("tabIndex",this.tabIndex)},setDisabled:function(a){d.deprecated("setDisabled("+a+") is deprecated. Use set('disabled',"+a+") instead.","","2.0");this.set("disabled",a)},_onFocus:function(){this.scrollOnFocus&&d.window.scrollIntoView(this.domNode);this.inherited(arguments)},isFocusable:function(){return!this.disabled&&
this.focusNode&&d.style(this.domNode,"display")!="none"},focus:function(){this.disabled||c.focus(this.focusNode)},compare:function(a,b){return typeof a=="number"&&typeof b=="number"?isNaN(a)&&isNaN(b)?0:a-b:a>b?1:a<b?-1:0},onChange:function(){},_onChangeActive:false,_handleOnChange:function(a,b){if(this._lastValueReported==undefined&&(b===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||b||b===undefined)&&this._pendingOnChange){this._lastValueReported=a;this._pendingOnChange=false;if(this._onChangeActive){this._onChangeHandle&&clearTimeout(this._onChangeHandle);this._onChangeHandle=setTimeout(d.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){d.deprecated("dijit.form._FormWidget:setValue("+a+") is deprecated.  Use set('value',"+a+") instead.","","2.0");this.set("value",a)},getValue:function(){d.deprecated(this.declaredClass+"::getValue() is deprecated. Use get('value') instead.","","2.0");return this.get("value")},_onMouseDown:function(a){if(!a.ctrlKey&&d.mouseButtons.isLeft(a)&&this.isFocusable())var b=this.connect(d.body(),"onmouseup",function(){this.isFocusable()&&this.focus();this.disconnect(b)})}});d.declare("dijit.form._FormValueWidget",
c.form._FormWidget,{readOnly:false,attributeMap:d.delegate(c.form._FormWidget.prototype.attributeMap,{value:"",readOnly:"focusNode"}),_setReadOnlyAttr:function(a){d.attr(this.focusNode,"readOnly",a);c.setWaiState(this.focusNode,"readonly",a);this._set("readOnly",a)},postCreate:function(){this.inherited(arguments);if(d.isIE<9||d.isIE&&d.isQuirks)this.connect(this.focusNode||this.domNode,"onkeydown",this._onKeyDown);if(this._resetValue===undefined)this._lastValueReported=this._resetValue=this.value},
_setValueAttr:function(a,b){this._handleOnChange(a,b)},_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==d.keys.ESCAPE&&!(a.ctrlKey||a.altKey||a.metaKey)){var b;if(d.isIE){a.preventDefault();b=document.createEventObject();b.keyCode=d.keys.ESCAPE;b.shiftKey=a.shiftKey;a.srcElement.fireEvent("onkeypress",
b)}}},_layoutHackIE7:function(){if(d.isIE==7)for(var a=this.domNode,b=a.parentNode,e=a.firstChild||a,f=e.style.filter,g=this;b&&b.clientHeight==0;){(function(){var i=g.connect(b,"onscroll",function(){g.disconnect(i);e.style.filter=(new Date).getMilliseconds();setTimeout(function(){e.style.filter=f},0)})})();b=b.parentNode}}});return c.form._FormWidget});
define("dijit/form/TextBox",["dojo","dijit","text!dijit/form/templates/TextBox.html","dijit/form/_FormWidget"],function(d,c){d.declare("dijit.form.TextBox",c.form._FormValueWidget,{trim:false,uppercase:false,lowercase:false,propercase:false,maxLength:"",selectOnClick:false,placeHolder:"",templateString:d.cache("dijit.form","templates/TextBox.html"),_singleNodeTemplate:'<input class="dijit dijitReset dijitLeft dijitInputField" dojoAttachPoint="textbox,focusNode" autocomplete="off" type="${type}" ${!nameAttrSetting} />',
_buttonInputDisabled:d.isIE?"disabled":"",baseClass:"dijitTextBox",attributeMap:d.delegate(c.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==c.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=d.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,
b,e){var f;if(a!==undefined){f=this.filter(a);if(typeof e!="string")e=f!==null&&(typeof f!="number"||!isNaN(f))?this.filter(this.format(f,this.constraints)):""}if(e!=null&&e!=undefined&&(typeof e!="number"||!isNaN(e))&&this.textbox.value!=e){this.textbox.value=e;this._set("displayedValue",this.get("displayedValue"))}this._updatePlaceHolder();this.inherited(arguments,[f,b])},displayedValue:"",getDisplayedValue:function(){d.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){d.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 d.keys.SHIFT:case d.keys.ALT:case d.keys.CTRL:case d.keys.TAB:return}if(this.intermediateChanges){var b=this;setTimeout(function(){b._handleOnChange(b.get("value"),false)},0)}this._refreshState();this._set("displayedValue",this.get("displayedValue"))},
postCreate:function(){d.isIE&&setTimeout(d.hitch(this,function(){var a=d.getComputedStyle(this.domNode);if(a)if(a=a.fontFamily){var b=this.domNode.getElementsByTagName("INPUT");if(b)for(var e=0;e<b.length;e++)b[e].style.fontFamily=a}}),0);this.textbox.setAttribute("value",this.textbox.value);this.inherited(arguments);if(d.isMoz||d.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=d.trim(a);if(this.uppercase)a=a.toUpperCase();if(this.lowercase)a=a.toLowerCase();if(this.propercase)a=a.replace(/[^\s]+/g,function(b){return b.substring(0,1).toUpperCase()+b.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&&d.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 b;if(d.isIE){b=d.doc.selection.createRange();b=b.parentElement()==this.textbox&&
b.text.length==0}else b=this.textbox.selectionStart==this.textbox.selectionEnd;b&&c.selectInputText(this.textbox)});this._updatePlaceHolder();this.inherited(arguments);this._refreshState()}},reset:function(){this.textbox.value="";this.inherited(arguments)}});c.selectInputText=function(a,b,e){var f=d.global,g=d.doc;a=d.byId(a);if(isNaN(b))b=0;if(isNaN(e))e=a.value?a.value.length:0;c.focus(a);if(g.selection&&d.body().createTextRange){if(a.createTextRange){a=a.createTextRange();a.collapse(true);a.moveStart("character",
-99999);a.moveStart("character",b);a.moveEnd("character",e-b);a.select()}}else f.getSelection&&a.setSelectionRange&&a.setSelectionRange(b,e)};return c.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(d,c){d.declare("dijit._MasterTooltip",[c._Widget,c._Templated],{duration:c.defaultDuration,templateString:d.cache("dijit","templates/Tooltip.html"),postCreate:function(){d.body().appendChild(this.domNode);this.bgIframe=new c.BackgroundIframe(this.domNode);this.fadeIn=d.fadeIn({node:this.domNode,duration:this.duration,onEnd:d.hitch(this,"_onShow")});this.fadeOut=d.fadeOut({node:this.domNode,
duration:this.duration,onEnd:d.hitch(this,"_onHide")})},show:function(a,b,e,f){if(!(this.aroundNode&&this.aroundNode===b)){this.domNode.width="auto";if(this.fadeOut.status()=="playing")this._onDeck=arguments;else{this.containerNode.innerHTML=a;c.placeOnScreenAroundElement(this.domNode,b,c.getPopupAroundAlignment(e&&e.length?e:c.Tooltip.defaultPosition,!f),d.hitch(this,"orient"));d.style(this.domNode,"opacity",0);this.fadeIn.play();this.isShowingNow=true;this.aroundNode=b}}},orient:function(a,b,e,
f,g){this.connectorNode.style.top="";var i=f.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"}[b+"-"+e];this.domNode.style.width="auto";var k=d.contentBox(this.domNode),j=Math.min(Math.max(i,1),k.w),o=j<k.w;this.domNode.style.width=j+"px";if(o){this.containerNode.style.overflow=
"auto";o=this.containerNode.scrollWidth;this.containerNode.style.overflow="visible";if(o>j){o=o+d.style(this.domNode,"paddingLeft")+d.style(this.domNode,"paddingRight");this.domNode.style.width=o+"px"}}if(e.charAt(0)=="B"&&b.charAt(0)=="B"){a=d.marginBox(a);b=this.connectorNode.offsetHeight;if(a.h>f.h){this.connectorNode.style.top=f.h-g.h/2-b/2+"px";this.connectorNode.style.bottom=""}else{this.connectorNode.style.bottom=Math.min(Math.max(g.h/2-b/2,0),a.h-b)+"px";this.connectorNode.style.top=""}}else{this.connectorNode.style.top=
"";this.connectorNode.style.bottom=""}return Math.max(0,k.w-i)},_onShow:function(){if(d.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}}});c.showTooltip=function(a,b,e,f){if(!c._masterTT)c._masterTT=
new c._MasterTooltip;return c._masterTT.show(a,b,e,f)};c.hideTooltip=function(a){if(!c._masterTT)c._masterTT=new c._MasterTooltip;return c._masterTT.hide(a)};d.declare("dijit.Tooltip",c._Widget,{label:"",showDelay:400,connectId:[],position:[],_setConnectIdAttr:function(a){d.forEach(this._connections||[],function(e){d.forEach(e,d.hitch(this,"disconnect"))},this);var b=d.isArrayLike(a)?a:a?[a]:[];this._connections=d.map(b,function(e){return(e=d.byId(e))?[this.connect(e,"onmouseenter","_onTargetMouseEnter"),
this.connect(e,"onmouseleave","_onTargetMouseLeave"),this.connect(e,"onfocus","_onTargetFocus"),this.connect(e,"onblur","_onTargetBlur")]:[]},this);this._set("connectId",a);this._connectIds=b},addTarget:function(a){a=a.id||a;d.indexOf(this._connectIds,a)==-1&&this.set("connectId",this._connectIds.concat(a))},removeTarget:function(a){a=d.indexOf(this._connectIds,a.id||a);if(a>=0){this._connectIds.splice(a,1);this.set("connectId",this._connectIds)}},buildRendering:function(){this.inherited(arguments);
d.addClass(this.domNode,"dijitTooltipData")},startup:function(){this.inherited(arguments);var a=this.connectId;d.forEach(d.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 b=a.target;this._showTimer=setTimeout(d.hitch(this,function(){this.open(b)}),
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}c.showTooltip(this.label||this.domNode.innerHTML,a,this.position,!this.isLeftToRight());this._connectNode=a;this.onShow(a,this.position)},close:function(){if(this._connectNode){c.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)}});c.Tooltip.defaultPosition=["after","before"];return c.Tooltip});
(function(){function d(b,e,f,g,i,k){if(e[b]){f.push(b);if(e[b]===true||e[b]===1)g.push(i+b+"/"+k)}}function c(b,e,f,g,i){e=g+e+"/"+i;require._fileExists(b.nameToUrl(e,null))&&f.push(e)}var a=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",{version:"0.24.0",load:function(b,e,f,g){g=g||{};var i=a.exec(b),k=i[1],j=i[4],o=i[5],q=j.split("-"),v=[],u={},s,w,z="";if(i[5]){k=i[1];b=k+o}else{b=b;o=i[4];j=g.locale||(g.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||
"root").toLowerCase());q=j.split("-")}if(g.isBuild){v.push(b);c(e,"root",v,k,o);for(s=0;w=q[s];s++){z+=(z?"-":"")+w;c(e,z,v,k,o)}e(v);f()}else e([b],function(y){var h=[];d("root",y,h,v,k,o);for(s=0;w=q[s];s++){z+=(z?"-":"")+w;d(z,y,h,v,k,o)}e(v,function(){var n,m;for(n=h.length-1;n>-1&&(w=h[n]);n--){m=y[w];if(m===true||m===1)m=e(k+w+"/"+o);require.mixin(u,m)}f(u)})})}})})();
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(d,c){d.declare("dijit.form.ValidationTextBox",c.form.TextBox,{templateString:d.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,b){return(new RegExp("^(?:"+this.regExpGen(b)+")"+(this.required?"":"?")+"$")).test(a)&&(!this.required||!this._isEmpty(a))&&(this._isEmpty(a)||this.parse(a,b)!==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 b="",e=this.disabled||this.isValid(a);if(e)this._maskValidSubsetError=true;var f=this._isEmpty(this.textbox.value),g=!e&&a&&this._isValidSubset();this._set("state",e?"":((!this._hasBeenBlurred||a)&&f||g)&&this._maskValidSubsetError?
"Incomplete":"Error");c.setWaiState(this.focusNode,"invalid",e?"false":"true");if(this.state=="Error"){this._maskValidSubsetError=a&&g;b=this.getErrorMessage(a)}else if(this.state=="Incomplete"){b=this.getPromptMessage(a);this._maskValidSubsetError=!this._hasBeenBlurred||a}else if(f)b=this.getPromptMessage(a);this.set("message",b);return e},displayMessage:function(a){c.hideTooltip(this.domNode);a&&this._focused&&c.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 b="";a!=".*"&&this.regExp.replace(/\\.|\[\]|\[.*?[^\\]{1}\]|\{.*?\}|\(\?[=:!]|./g,function(f){switch(f.charAt(0)){case "{":case "+":case "?":case "*":case "^":case "$":case "|":case "(":b+=f;break;case ")":b+="|$)";break;
default:b+="(?:"+f+"|$)";break}});try{"".search(b)}catch(e){b=this.regExp;console.warn("RegExp error in "+this.declaredClass+": "+this.regExp)}this._partialre="^(?:"+b+")$"},postMixInProperties:function(){this.inherited(arguments);this.messages=d.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);c.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)}});d.declare("dijit.form.MappedTextBox",c.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=d.place("<input type='hidden'"+(this.name?" name='"+this.name.replace(/'/g,"&quot;")+"'":"")+"/>",this.textbox,"after")},reset:function(){this.valueNode.value="";this.inherited(arguments)}});d.declare("dijit.form.RangeBoundTextBox",c.form.MappedTextBox,{rangeMessage:"",rangeCheck:function(a,b){return("min"in b?this.compare(a,b.min)>=0:true)&&("max"in b?this.compare(a,b.max)<=0:true)},isInRange:function(){return this.rangeCheck(this.get("value"),this.constraints)},_isDefinitelyOutOfRange:function(){var a=
this.get("value"),b=false,e=false;if("min"in this.constraints){b=this.constraints.min;b=this.compare(a,typeof b=="number"&&b>=0&&a!=0?0:b);b=typeof b=="number"&&b<0}if("max"in this.constraints){e=this.constraints.max;e=this.compare(a,typeof e!="number"||e>0?e:0);e=typeof e=="number"&&e>0}return b||e},_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 b=this.get("value");if(b!==null&&b!==""&&b!==undefined&&(typeof b!="number"||!isNaN(b))&&!this.isInRange(a))return this.rangeMessage;return this.inherited(arguments)},postMixInProperties:function(){this.inherited(arguments);if(!this.rangeMessage){this.messages=d.i18n.getLocalization("dijit.form","validate",this.lang);this.rangeMessage=this.messages.rangeMessage}},_setConstraintsAttr:function(){this.inherited(arguments);if(this.focusNode){this.constraints.min!==
undefined?c.setWaiState(this.focusNode,"valuemin",this.constraints.min):c.removeWaiState(this.focusNode,"valuemin");this.constraints.max!==undefined?c.setWaiState(this.focusNode,"valuemax",this.constraints.max):c.removeWaiState(this.focusNode,"valuemax")}},_setValueAttr:function(a){c.setWaiState(this.focusNode,"valuenow",a);this.inherited(arguments)}});return c.form.ValidationTextBox});
define("orion/util",["dojo","dijit","dojo/hash","dijit/form/ValidationTextBox"],function(d,c){function a(l){m=l}function b(){return m}function e(l){var p="",t=navigator.platform.indexOf("Mac")!==-1;if(l.mod1)p+=t?"Cmd+":"Ctrl+";if(l.mod2)p+="Shift+";if(l.mod3)p+="Alt+";if(l.alphaKey)return p+l.alphaKey;for(var r in d.keys)if(typeof(d.keys[r]==="number"))if(d.keys[r]===l.keyCode)return p+r;var x;switch(l.keyCode){case 59:x=l.mod2?":":";";break;case 61:x=l.mod2?"+":"=";break;case 188:x=l.mod2?"<":",";
break;case 190:x=l.mod2?">":".";break;case 191:x=l.mod2?"?":"/";break;case 192:x=l.mod2?"~":"`";break;case 219:x=l.mod2?"{":"[";break;case 220:x=l.mod2?"|":"\\";break;case 221:x=l.mod2?"}":"]";break;case 222:x=l.mod2?'"':"'";break}if(x)return p+x;return p+String.fromCharCode(l.keyCode)}function f(l,p){l.startup();if(typeof p==="string"){var t=d.byId(p);if(!t)if(t=c.byId(p))t=t.domNode;p=t?t:null}if(p){p=d.position(p);l._setStyleAttr("left:"+(p.x+16)+"px !important;");l._setStyleAttr("top:"+(p.y+16)+
"px !important;")}l.show()}function g(l,p,t,r,x,B,C,D,E){C=function(K){return function(L){var Q=c.byId(l),P=Q.get("value");if(K&&L.keyCode===d.keys.ESCAPE){t&&d.style(p,"display","inline");Q.destroyRecursive();B&&B()}else if(!(K&&L.keyCode!==d.keys.ENTER)){if(!Q.isValid()||!E&&P===r)t&&d.style(p,"display","inline");else x(P);Q.destroyRecursive();B&&B()}}};var H=new c.form.ValidationTextBox({id:l,required:true,value:r||""});d.place(H.domNode,p,"after");d.addClass(H.domNode,"userEditBoxPrompt");t&&
d.style(p,"display","none");d.connect(H,"onKeyDown",C(true));d.connect(H,"onBlur",C(false));window.setTimeout(function(){H.focus();if(r){var K=d.byId(l),L=D?r.indexOf(D):-1;L>0?c.selectInputText(K,0,L):K.select()}},0)}function i(l){var p=window.navigator.platform.indexOf("Mac")!==-1;return p&&l.metaKey||!p&&l.ctrlKey}function k(l,p){if(p&&i(p))window.open(l);else window.location=l}function j(l){if(!l)return l;var p=window.location.href.split("#")[0];p=p.substring(0,p.length-window.location.pathname.length);
if(l.indexOf(p)===0)return l.substring(p.length);return l}function o(l){var p,t,r,x,B;l=l.split("#");var C=l[l.length-1].split(/\?(?=(?:line|char))/);l=j(C[0]);if(C.length>1){C=C[1].split(/\&(?=(?:line|char))/);for(var D=0;D<C.length;D++){var E=C[D].split("=");if(E.length>1)switch(E[0]){case "char":E=E[1].split(",");if(r===undefined){p=window.parseInt(E[0]);if(E.length>1)t=window.parseInt(E[1])}else{x=window.parseInt(E[0]);if(E.length>1)B=window.parseInt(E[1])}break;case "line":E=E[1].split(",");
r=window.parseInt(E[0]);break;default:break}}}return{filePath:l,start:p,end:t,line:r,offset:x,length:B}}function q(l,p,t,r,x,B){if(typeof p==="number"){l="#"+l+"?char="+p;if(typeof t==="number")l=l+","+t;else if(typeof B==="number")l=l+","+(p+B);return l}if(typeof r==="number"){l="#"+l+"?line="+r;if(typeof x==="number"){l=l+"&char="+x;if(typeof B==="number")l=l+","+(x+B)}return l}return"#"+l}function v(l){if(!l)return l;var p=window.location.href.split("#")[0];return p.substring(0,p.length-window.location.pathname.length)+
l}function u(l){return this.makeRelative(l).indexOf("/workspace")===0}function s(l,p){l.children=p;for(var t in p)p[t].parent=l;l.children.sort(function(r,x){var B=r.Directory;if(B!==x.Directory)return B?-1:1;r=r.Name&&r.Name.toLowerCase();x=x.Name&&x.Name.toLowerCase();if(r<x)return-1;if(r>x)return 1;return 0})}function w(l){l.children.sort(function(p,t){var r=p.type==="dir";if(r!==(t.type==="dir"))return r?-1:1;p=p.name&&p.name.toLowerCase();t=t.name&&t.name.toLowerCase();if(p<t)return-1;if(p>t)return 1;
return 0})}function z(l,p){l.Parents&&l.Parents.length===0&&p.getService("orion.core.preference").then(function(t){return t.getPreferences("/window/recent")}).then(function(t){var r=t.get("projects");if(typeof r==="string")r=JSON.parse(r);var x=[];if(r&&r.length&&r.length>0)for(var B=0;B<r.length;B++)r[B].location!==l.ChildrenLocation&&r[B].name!==l.Name&&x.push(r[B]);x.push({name:l.Name,location:l.ChildrenLocation});if(x.length>5)x=x.slice(-5,x.length);t.put("projects",x)})}function y(l){return typeof l.textContent!==
"undefined"?l.textContent:l.innerText}function h(l){return y(document.createTextNode(l))}function n(l,p){if(typeof l.textContent!=="undefined")l.textContent=p;else l.innerText=p}var m=null;return{setUserName:a,getUserName:b,getUserKeyString:e,openDialog:f,getUserText:g,openInNewWindow:i,followLink:k,getPositionInfo:o,hashFromPosition:q,makeRelative:j,makeFullPath:v,isAtRoot:u,processNavigatorParent:s,processSearchResultParent:w,rememberSuccessfulTraversal:z,getText:y,safeText:h,setText:n}});
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(d,c){d.declare("dijit._Container",null,{isContainer:true,buildRendering:function(){this.inherited(arguments);if(!this.containerNode)this.containerNode=this.domNode},addChild:function(a,b){var e=this.containerNode;if(b&&typeof b=="number"){var f=this.getChildren();if(f&&f.length>=b){e=f[b-1].domNode;b="after"}}d.place(a.domNode,e,b);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){d.forEach(this.getChildren(),function(b){b.destroyRecursive(a)})},_getSiblingOfChild:function(a,b){a=a.domNode;b=b>0?"nextSibling":"previousSibling";do a=a[b];while(a&&(a.nodeType!=1||!c.byNode(a)));return a&&c.byNode(a)},getIndexOfChild:function(a){return d.indexOf(this.getChildren(),a)},startup:function(){if(!this._started){d.forEach(this.getChildren(),
function(a){a.startup()});this.inherited(arguments)}}});return c._Container});
define("dijit/_KeyNavContainer",["dojo","dijit","dijit/_Container"],function(d,c){d.declare("dijit._KeyNavContainer",c._Container,{tabIndex:"0",_keyNavCodes:{},connectKeyNavHandlers:function(a,b){var e=this._keyNavCodes={},f=d.hitch(this,this.focusPrev),g=d.hitch(this,this.focusNext);d.forEach(a,function(i){e[i]=f});d.forEach(b,function(i){e[i]=g});e[d.keys.HOME]=d.hitch(this,"focusFirstChild");e[d.keys.END]=d.hitch(this,"focusLastChild");this.connect(this.domNode,"onkeypress","_onContainerKeypress");
this.connect(this.domNode,"onfocus","_onContainerFocus")},startupKeyNavChildren:function(){d.forEach(this.getChildren(),d.hitch(this,"_startupChild"))},addChild:function(a){c._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,b){this.focusedChild&&a!==this.focusedChild&&this._onChildBlur(this.focusedChild);a.set("tabIndex",this.tabIndex);a.focus(b?"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();d.attr(this.domNode,"tabIndex","-1")}},_onBlur:function(){this.tabIndex&&d.attr(this.domNode,"tabIndex",this.tabIndex);this.inherited(arguments)},_onContainerKeypress:function(a){if(!(a.ctrlKey||a.altKey)){var b=this._keyNavCodes[a.charOrCode];if(b){b();d.stopEvent(a)}}},_onChildBlur:function(){},_getFirstFocusableChild:function(){return this._getNextFocusableChild(null,1)},_getLastFocusableChild:function(){return this._getNextFocusableChild(null,-1)},_getNextFocusableChild:function(a,
b){if(a)a=this._getSiblingOfChild(a,b);for(var e=this.getChildren(),f=0;f<e.length;f++){a||(a=e[b>0?0:e.length-1]);if(a.isFocusable())return a;a=this._getSiblingOfChild(a,b)}return null}});return c._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(d,c){d.declare("dijit._Contained",null,{getParent:function(){var a=c.getEnclosingWidget(this.domNode.parentNode);return a&&a.isContainer?a:null},_getSibling:function(a){var b=this.domNode;do b=b[a+"Sibling"];while(b&&b.nodeType!=1);return b&&c.byNode(b)},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 c._Contained});
define("dijit/MenuItem",["dojo","dijit","text!dijit/templates/MenuItem.html","dijit/_Widget","dijit/_Templated","dijit/_Contained","dijit/_CssStateMixin"],function(d,c){d.declare("dijit.MenuItem",[c._Widget,c._Templated,c._Contained,c._CssStateMixin],{templateString:d.cache("dijit","templates/MenuItem.html"),attributeMap:d.delegate(c._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";d.attr(this.containerNode,"id",a);if(this.accelKeyNode){d.attr(this.accelKeyNode,"id",this.id+"_accel");a+=" "+this.id+"_accel"}c.setWaiState(this.domNode,"labelledby",a);d.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);d.stopEvent(a)},onClick:function(){},focus:function(){try{d.isIE==8&&this.containerNode.focus();c.focus(this.focusNode)}catch(a){}},_onFocus:function(){this._setSelected(true);this.getParent()._onItemFocus(this);this.inherited(arguments)},_setSelected:function(a){d.toggleClass(this.domNode,"dijitMenuItemSelected",a)},setLabel:function(a){d.deprecated("dijit.MenuItem.setLabel() is deprecated.  Use set('label', ...) instead.",
"","2.0");this.set("label",a)},setDisabled:function(a){d.deprecated("dijit.Menu.setDisabled() is deprecated.  Use set('disabled', bool) instead.","","2.0");this.set("disabled",a)},_setDisabledAttr:function(a){c.setWaiState(this.focusNode,"disabled",a?"true":"false");this._set("disabled",a)},_setAccelKeyAttr:function(a){this.accelKeyNode.style.display=a?"":"none";this.accelKeyNode.innerHTML=a;d.attr(this.containerNode,"colSpan",a?"1":"2");this._set("accelKey",a)}});return c.MenuItem});
define("dijit/PopupMenuItem",["dojo","dijit","dijit/MenuItem"],function(d,c){d.declare("dijit.PopupMenuItem",c.MenuItem,{_fillContent:function(){if(this.srcNodeRef){var a=d.query("*",this.srcNodeRef);c.PopupMenuItem.superclass._fillContent.call(this,a[0]);this.dropDownContainer=this.srcNodeRef}},startup:function(){if(!this._started){this.inherited(arguments);if(!this.popup){var a=d.query("[widgetId]",this.dropDownContainer)[0];this.popup=c.byNode(a)}d.body().appendChild(this.popup.domNode);this.popup.startup();
this.popup.domNode.style.display="none";this.arrowWrapper&&d.style(this.arrowWrapper,"visibility","");c.setWaiState(this.focusNode,"haspopup","true")}},destroyDescendants:function(){if(this.popup){this.popup._destroyed||this.popup.destroyRecursive();delete this.popup}this.inherited(arguments)}});return c.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(d,c){d.declare("dijit.CheckedMenuItem",c.MenuItem,{templateString:d.cache("dijit","templates/CheckedMenuItem.html"),checked:false,_setCheckedAttr:function(a){d.toggleClass(this.domNode,"dijitCheckedMenuItemChecked",a);c.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 c.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(d,c){d.declare("dijit.MenuSeparator",[c._Widget,c._Templated,c._Contained],{templateString:d.cache("dijit","templates/MenuSeparator.html"),buildRendering:function(){this.inherited(arguments);d.setSelectable(this.domNode,false)},isFocusable:function(){return false}});return c.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(d,c){d.declare("dijit._MenuBase",[c._Widget,c._Templated,c._KeyNavContainer],{parentMenu:null,popupDelay:500,startup:function(){if(!this._started){d.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(d.hitch(this,"_openPopup"),this.popupDelay)}this.focusedChild&&this.focusChild(a);this._hoveredChild=a},_onChildBlur:function(a){this._stopPopupTimer();a._setSelected(false);var b=a.popup;if(b){this._stopPendingCloseTimer(b);b._pendingClose_timer=setTimeout(function(){b._pendingClose_timer=null;if(b.parentMenu)b.parentMenu.currentPopup=
null;c.popup.close(b)},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,b){typeof this.isShowingNow=="undefined"&&this._markActive();this.focusChild(a);if(a.disabled)return false;if(a.popup)this._openPopup();else{this.onExecute();a.onClick(b)}},_openPopup:function(){this._stopPopupTimer();var a=this.focusedChild;if(a){var b=a.popup;if(!b.isShowingNow){if(this.currentPopup){this._stopPendingCloseTimer(this.currentPopup);c.popup.close(this.currentPopup)}b.parentMenu=this;b.from_item=a;var e=this;c.popup.open({parent:this,
popup:b,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(){e.focusChild(a);e._cleanUp();a._setSelected(true);e.focusedChild=a},onExecute:d.hitch(this,"_cleanUp")});this.currentPopup=b;b.connect(b.domNode,"onmouseenter",d.hitch(e,"_onPopupHover"));if(b.focus)b._focus_timer=setTimeout(d.hitch(b,function(){this._focus_timer=null;this.focus()}),0)}}},_markActive:function(){this.isActive=true;d.replaceClass(this.domNode,
"dijitMenuActive","dijitMenuPassive")},onOpen:function(){this.isShowingNow=true;this._markActive()},_markInactive:function(){this.isActive=false;d.replaceClass(this.domNode,"dijitMenuPassive","dijitMenuActive")},onClose:function(){this._stopFocusTimer();this._markInactive();this.isShowingNow=false;this.parentMenu=null},_closeChild:function(){this._stopPopupTimer();if(this.currentPopup){c._curFocus&&d.isDescendant(c._curFocus,this.currentPopup.domNode)&&this.focusedChild.focusNode.focus();c.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()}});d.declare("dijit.Menu",c._MenuBase,{constructor:function(){this._bindings=[]},templateString:d.cache("dijit",
"templates/Menu.html"),baseClass:"dijitMenu",targetNodeIds:[],contextMenuForWindow:false,leftClickToOpen:false,refocus:true,postCreate:function(){this.contextMenuForWindow?this.bindDomNode(d.body()):d.forEach(this.targetNodeIds,this.bindDomNode,this);var a=d.keys,b=this.isLeftToRight();this._openSubMenuKey=b?a.RIGHT_ARROW:a.LEFT_ARROW;this._closeSubMenuKey=b?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);
d.stopEvent(a);break;case this._closeSubMenuKey:if(this.parentMenu)this.parentMenu._isMenuBar?this.parentMenu.focusPrev():this.onCancel(false);else d.stopEvent(a);break}},_iframeContentWindow:function(a){return d.window.get(this._iframeContentDocument(a))||this._iframeContentDocument(a).__parent__||a.name&&d.doc.frames[a.name]||null},_iframeContentDocument:function(a){return a.contentDocument||a.contentWindow&&a.contentWindow.document||a.name&&d.doc.frames[a.name]&&d.doc.frames[a.name].document||
null},bindDomNode:function(a){a=d.byId(a);var b;if(a.tagName.toLowerCase()=="iframe"){var e=a,f=this._iframeContentWindow(e);b=d.withGlobal(f,d.body)}else b=a==d.body()?d.doc.documentElement:a;var g={node:a,iframe:e};d.attr(a,"_dijitMenu"+this.id,this._bindings.push(g));var i=d.hitch(this,function(k){return[d.connect(k,this.leftClickToOpen?"onclick":"oncontextmenu",this,function(j){d.stopEvent(j);this._scheduleOpen(j.target,e,{x:j.pageX,y:j.pageY})}),d.connect(k,"onkeydown",this,function(j){if(j.shiftKey&&
j.keyCode==d.keys.F10){d.stopEvent(j);this._scheduleOpen(j.target,e)}})]});g.connects=b?i(b):[];if(e){g.onloadHandler=d.hitch(this,function(){var k=this._iframeContentWindow(e);b=d.withGlobal(k,d.body);g.connects=i(b)});e.addEventListener?e.addEventListener("load",g.onloadHandler,false):e.attachEvent("onload",g.onloadHandler)}},unBindDomNode:function(a){var b;try{b=d.byId(a)}catch(e){return}a="_dijitMenu"+this.id;if(b&&d.hasAttr(b,a)){var f=d.attr(b,a)-1,g=this._bindings[f];d.forEach(g.connects,d.disconnect);
var i=g.iframe;if(i)i.removeEventListener?i.removeEventListener("load",g.onloadHandler,false):i.detachEvent("onload",g.onloadHandler);d.removeAttr(b,a);delete this._bindings[f]}},_scheduleOpen:function(a,b,e){if(!this._openTimer)this._openTimer=setTimeout(d.hitch(this,function(){delete this._openTimer;this._openMyself({target:a,iframe:b,coords:e})}),1)},_openMyself:function(a){function b(){o.refocus&&c.focus(q);c.popup.close(o)}var e=a.target,f=a.iframe;if(a=a.coords){if(f){e=d.position(f,true);var g=
this._iframeContentWindow(f);g=d.withGlobal(g,"_docScroll",d);var i=d.getComputedStyle(f),k=d._toPixelValue,j=(d.isIE&&d.isQuirks?0:k(f,i.paddingLeft))+(d.isIE&&d.isQuirks?k(f,i.borderLeftWidth):0);f=(d.isIE&&d.isQuirks?0:k(f,i.paddingTop))+(d.isIE&&d.isQuirks?k(f,i.borderTopWidth):0);a.x+=e.x+j-g.x;a.y+=e.y+f-g.y}}else{a=d.position(e,true);a.x+=10;a.y+=10}var o=this,q=c.getFocus(this);c.popup.open({popup:this,x:a.x,y:a.y,onExecute:b,onCancel:b,orient:this.isLeftToRight()?"L":"R"});this.focus();this._onBlur=
function(){this.inherited("_onBlur",arguments);c.popup.close(this)}},uninitialize:function(){d.forEach(this._bindings,function(a){a&&this.unBindDomNode(a.node)},this);this.inherited(arguments)}});return c.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(d,c){d.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)){d.stopEvent(a);this._docHandler=this.connect(d.doc,"onmouseup","_onDropDownMouseUp");this.toggleDropDown()}},_onDropDownMouseUp:function(a){a&&
this._docHandler&&this.disconnect(this._docHandler);var b=this.dropDown,e=false;if(a&&this._opened){var f=d.position(this._buttonNode,true);if(!(a.pageX>=f.x&&a.pageX<=f.x+f.w)||!(a.pageY>=f.y&&a.pageY<=f.y+f.h)){for(f=a.target;f&&!e;)if(d.hasClass(f,"dijitPopup"))e=true;else f=f.parentNode;if(e){f=a.target;if(b.onItemClick){for(var g;f&&!(g=c.byNode(f));)f=f.parentNode;g&&g.onClick&&g.getParent&&g.getParent().onItemClick(g,a)}return}}}this._opened&&b.focus&&b.autoFocus!==false&&window.setTimeout(d.hitch(b,
"focus"),1)},_onDropDownClick:function(a){this._stopClickEvents&&d.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";d.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 b=this.dropDown,e=a.target;if(b&&this._opened&&b.handleKey)if(b.handleKey(a)===false){d.stopEvent(a);return}if(b&&this._opened&&a.charOrCode==d.keys.ESCAPE){this.closeDropDown();d.stopEvent(a)}else if(!this._opened&&(a.charOrCode==d.keys.DOWN_ARROW||(a.charOrCode==d.keys.ENTER||a.charOrCode==" ")&&((e.tagName||"").toLowerCase()!=="input"||e.type&&e.type.toLowerCase()!=="text"))){this._toggleOnKeyUp=true;d.stopEvent(a)}}},_onKeyUp:function(){if(this._toggleOnKeyUp){delete this._toggleOnKeyUp;
this.toggleDropDown();var a=this.dropDown;a&&a.focus&&setTimeout(d.hitch(a,"focus"),1)}},_onBlur:function(){this.closeDropDown(c._curFocus&&this.dropDown&&d.isDescendant(c._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(d.hitch(this,"openDropDown"))},openDropDown:function(){var a=
this.dropDown,b=a.domNode,e=this._aroundNode||this.domNode,f=this;if(!this._preparedNode){this._preparedNode=true;if(b.style.width)this._explicitDDWidth=true;if(b.style.height)this._explicitDDHeight=true}if(this.maxHeight||this.forceWidth||this.autoWidth){var g={display:"",visibility:"hidden"};if(!this._explicitDDWidth)g.width="";if(!this._explicitDDHeight)g.height="";d.style(b,g);g=this.maxHeight;if(g==-1){g=d.window.getBox();var i=d.position(e,false);g=Math.floor(Math.max(i.y,g.h-(i.y+i.h)))}a.startup&&
!a._started&&a.startup();c.popup.moveOffScreen(a);i=d._getMarginSize(b);var k=g&&i.h>g;d.style(b,{overflowX:"hidden",overflowY:k?"auto":"hidden"});if(k){i.h=g;if("w"in i)i.w+=16}else delete i.h;if(this.forceWidth)i.w=e.offsetWidth;else if(this.autoWidth)i.w=Math.max(i.w,e.offsetWidth);else delete i.w;d.isFunction(a.resize)?a.resize(i):d.marginBox(b,i)}a=c.popup.open({parent:this,popup:a,around:e,orient:c.getPopupAroundAlignment(this.dropDownPosition&&this.dropDownPosition.length?this.dropDownPosition:
["below"],this.isLeftToRight()),onExecute:function(){f.closeDropDown(true)},onCancel:function(){f.closeDropDown(true)},onClose:function(){d.attr(f._popupStateNode,"popupActive",false);d.removeClass(f._popupStateNode,"dijitHasDropDownOpen");f._opened=false}});d.attr(this._popupStateNode,"popupActive","true");d.addClass(f._popupStateNode,"dijitHasDropDownOpen");this._opened=true;return a},closeDropDown:function(a){if(this._opened){a&&this.focus();c.popup.close(this.dropDown);this._opened=false}}});
return c._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(d,c){d.declare("dijit.form.Button",c.form._FormWidget,{label:"",showLabel:true,iconClass:"",type:"button",baseClass:"dijitButton",templateString:d.cache("dijit.form","templates/Button.html"),attributeMap:d.delegate(c.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 b=this.domNode;b.parentNode;b=b.parentNode){var e=c.byNode(b);if(e&&typeof e._onSubmit=="function"){e._onSubmit(a);break}}else if(this.valueNode){this.valueNode.click();a.preventDefault()}},buildRendering:function(){this.inherited(arguments);d.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&&d.toggleClass(this.containerNode,"dijitDisplayNone",!a);this._set("showLabel",a)},onClick:function(){return true},_clicked:function(){},setLabel:function(a){d.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=d.trim(this.containerNode.innerText||this.containerNode.textContent||"")},_setIconClassAttr:function(a){d.replaceClass(this.iconNode,a||"dijitNoIcon",this.iconClass||"dijitNoIcon");this._set("iconClass",a)}});d.declare("dijit.form.DropDownButton",[c.form.Button,c._Container,c._HasDropDown],{baseClass:"dijitDropDownButton",templateString:d.cache("dijit.form","templates/DropDownButton.html"),_fillContent:function(){if(this.srcNodeRef){var a=
d.query("*",this.srcNodeRef);c.form.DropDownButton.superclass._fillContent.call(this,a[0]);this.dropDownContainer=this.srcNodeRef}},startup:function(){if(!this._started){if(!this.dropDown&&this.dropDownContainer){var a=d.query("[widgetId]",this.dropDownContainer)[0];this.dropDown=c.byNode(a);delete this.dropDownContainer}this.dropDown&&c.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 b=d.connect(a,"onLoad",this,function(){d.disconnect(b);this.openDropDown()});a.refresh()}},isFocusable:function(){return this.inherited(arguments)&&!this._mouseDown}});d.declare("dijit.form.ComboButton",c.form.DropDownButton,{templateString:d.cache("dijit.form","templates/ComboButton.html"),attributeMap:d.mixin(d.clone(c.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==d.keys[this.isLeftToRight()?"RIGHT_ARROW":"LEFT_ARROW"]){c.focus(this._popupStateNode);d.stopEvent(a)}},_onArrowKeyPress:function(a){if(a.charOrCode==d.keys[this.isLeftToRight()?"LEFT_ARROW":"RIGHT_ARROW"]){c.focus(this.titleNode);d.stopEvent(a)}},focus:function(a){this.disabled||c.focus(a=="start"?this.titleNode:this._popupStateNode)}});
d.declare("dijit.form.ToggleButton",c.form.Button,{baseClass:"dijitToggleButton",checked:false,attributeMap:d.mixin(d.clone(c.form.Button.prototype.attributeMap),{checked:"focusNode"}),_clicked:function(){this.set("checked",!this.checked)},_setCheckedAttr:function(a,b){this._set("checked",a);d.attr(this.focusNode||this.domNode,"checked",a);c.setWaiState(this.focusNode||this.domNode,"pressed",a);this._handleOnChange(a,b)},setChecked:function(a){d.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 c.form.Button});define("dijit/form/DropDownButton",["dojo","dijit","dijit/form/Button"],function(d,c){return c.form.DropDownButton});
define("orion/commands",["require","dojo","dijit","orion/util","dijit/Menu","dijit/form/DropDownButton","dijit/MenuItem","dijit/PopupMenuItem","dijit/MenuSeparator","dijit/Tooltip"],function(d,c,a,b){function e(j){this._domScope={};this._objectScope={};this._globalScope={};this._namedGroups={};this._activeBindings={};this._init(j)}function f(j){this._init(j)}function g(j,o,q,v,u){this.keyCode=typeof j==="string"?j.toUpperCase().charCodeAt(0):j;this.mod1=o!==undefined&&o!==null?o:false;this.mod2=q!==
undefined&&q!==null?q:false;this.mod3=v!==undefined&&v!==null?v:false;this.mod4=u!==undefined&&u!==null?u:false}var i=c.declare(a.MenuItem,{_onClick:function(){this.hrefCallback||this.inherited(arguments)}});e.prototype={_init:function(j){this._registry=j.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.page.command",this);this._selection=j.selection;c.connect(window.document,"onkeydown",c.hitch(this,function(o){o=o||window.event;var q=o.target.nodeName.toLowerCase();
if(q==="input")switch(o.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(o)}))},_processKey:function(j){function o(s){if(window.document.all)s.keyCode=0;else{s.preventDefault();s.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(j)){var v=this._activeBindings[q],u=v.command;if(u.hrefCallback){o(j);j=u.hrefCallback.call(v.handler||window,v.items,q,v.userData);j.then?j.then(function(s){window.open(s)}):window.open(j);return}else if(u.callback){o(j);window.setTimeout(function(){u.callback.call(v.handler||window,v.items,q,null,v.userData)},0);return}}},getSelectionService:function(){return this._selection},showKeyBindings:function(j){for(var o in this._activeBindings)this._activeBindings[o]&&
this._activeBindings[o].keyBinding&&this._activeBindings[o].command&&c.place("<span>"+b.getUserKeyString(this._activeBindings[o].keyBinding)+" = "+this._activeBindings[o].command.name+"<br></span>",j,"last")},addCommand:function(j,o){switch(o){case "dom":this._domScope[j.id]=j;break;case "object":this._objectScope[j.id]=j;break;case "global":this._globalScope[j.id]=j;break;default:throw"unrecognized command scope "+o;}},addCommandGroup:function(j,o,q,v,u){var s=this._namedGroups;if(v)s=this._createEntryForPath(v);
if(s[j]){if(q)s[j].title=q;if(o)s[j].position=o;if(u)s[j].scopeId=u}else{s[j]={title:q,position:o,children:{},scopeId:u};s.sortedCommands=null}},_createEntryForPath:function(j){var o=this._namedGroups;if(j){j=j.split("/");for(var q=0;q<j.length;q++)if(j[q].length>1){o[j[q]]||(o[j[q]]={position:0,children:{}});o=o[j[q]].children}}return o},registerCommandContribution:function(j,o,q,v,u,s){v=this._createEntryForPath(v);v[j]={scopeId:q,position:o};if(u)if(o=this._domScope[j]||this._globalScope[j])this._activeBindings[j]=
{command:o,keyBinding:u,keyOnly:s};v.sortedCommands=null},_isLastChildSeparator:function(j,o){if(o==="image")return j.childNodes.length>0&&c.hasClass(j.childNodes[j.childNodes.length-1],"commandSeparator");if(o==="menu"){j=j.getChildren();return j.length>0&&j[j.length-1]instanceof a.MenuSeparator}return false},renderCommands:function(j,o,q,v,u,s,w,z,y,h){if(typeof j==="string")j=c.byId(j);if(q){var n;if(o==="object")n=this._objectScope;else if(o==="dom")n=this._domScope;else if(o==="global")n=this._globalScope;
else throw"Unrecognized command scope "+o;this._render(this._namedGroups,j,o,q,v,u,s,w,n,z,y,h);if(u==="image")this._isLastChildSeparator(j,u)&&j.removeChild(j.childNodes[j.childNodes.length-1]);else if(u==="menu")if(this._isLastChildSeparator(j,u)){q=j.getChildren()[j.getChildren().length-1];j.removeChild(q);q.destroy()}}else{var m=this;this._selection&&this._selection.getSelections(function(l){m.renderCommands(j,o,l,v,u,s,w,z,y,h)})}},_render:function(j,o,q,v,u,s,w,z,y,h,n,m){var l=j.sortedCommands;
if(!l){l=[];for(var p in j){var t=j[p];if(t&&typeof t.position==="number"){t.id=p;l.push(t)}}l.sort(function(D,E){return D.position-E.position});j.sortedCommands=l}for(j=0;j<l.length;j++){var r;if(l[j].children){p=l[j];if(!(p.scopeId&&o.id!==p.scopeId)){var x;if(s==="image")if(p.title){t=new a.Menu({style:"display: none;"});t.eclipseScopeId=o.eclipseScopeId||o.id;this._render(l[j].children,t,q,v,u,"menu",w,z,y,h,n,m);x=t.getChildren();if(this._isLastChildSeparator(t,"menu")){r=x[x.length-1];t.removeChild(r);
r.destroy();x=t.getChildren()}if(x.length>0){r=x[0].eclipseCommand;if(x.length>1){r=new a.form.DropDownButton({label:p.title,dropDown:t});c.addClass(r.domNode,"commandLink");w&&c.addClass(r.domNode,w);c.place(r.domNode,o,"last")}else{t="image"+r.id+j;p=r._asImage(t,v,u,z,w,h,n,m);c.place(p,o,"last")}}}else{var B;if(o.childNodes.length>0&&!this._isLastChildSeparator(o,s))B=this.generateSeparatorImage(o);this._render(l[j].children,o,q,v,u,s,w,z,y,h,n,m);if(o.childNodes.length>0)if(o.childNodes[o.childNodes.length-
1]!==B)B=this.generateSeparatorImage(o)}else if(p.title){t=new a.Menu;this._render(l[j].children,t,q,v,u,s,w,z,y,h,n,m);t.getChildren().length>0&&o.addChild(new a.PopupMenuItem({label:p.title,popup:t}))}else{var C;if(o.getChildren().length>0&&!this._isLastChildSeparator(o,s)){C=new a.MenuSeparator;o.addChild(C)}this._render(l[j].children,o,q,v,u,s,w,z,y,h,n,m);p=o.getChildren();if(p[p.length-1]!==C){C=new a.MenuSeparator;o.addChild(C)}}}}else{t=(p=y[l[j].id])?true:false;if(p){if(q==="dom")t=s==="image"?
o.id===l[j].scopeId:s==="menu"?o.eclipseScopeId===l[j].scopeId:false;if(this._activeBindings[p.id]&&this._activeBindings[p.id].keyBinding){r=this._activeBindings[p.id];r.items=v;r.userData=z;r.handler=u;if(r.keyOnly)t=false}if(t&&p.visibleWhen)t=p.visibleWhen(v)}if(t)if(p.choiceCallback){t=new a.Menu({style:"display: none;"});if(s==="image"){r=new a.form.DropDownButton({label:p.name,dropDown:t});if(p.image){c.addClass(r.iconNode,"commandImage");w&&c.addClass(r.iconNode,w);r.iconNode.src=p.image}c.place(r.domNode,
o,"last");r.eclipseCommand=p;r.eclipseChoices=t;c.connect(r,"onClick",r,function(){this.eclipseCommand.populateChoicesMenu(this.eclipseChoices,v,u,z)})}else if(s==="menu"){r=new a.PopupMenuItem({label:p.name,popup:t});o.addChild(r);r.eclipseCommand=p;r.eclipseChoices=t;c.connect(o,"_openPopup",r,function(){this.eclipseCommand.populateChoicesMenu(this.eclipseChoices,v,u,z)})}}else if(s==="image"){t="image"+p.id+j;p=p._asImage(t,v,u,z,w,h,n,m);c.place(p,o,"last")}else s==="menu"&&p._addMenuItem(o,v,
u,z,w)}}},generateSeparatorImage:function(j){j=c.create("span",null,j,"last");c.addClass(j,"core-sprite-sep");c.addClass(j,"commandImage");c.addClass(j,"commandSprite");c.addClass(j,"commandSeparator");return j}};e.prototype.constructor=e;f.prototype={_init:function(j){this.id=j.id;this.name=j.name||"Empty Command";this.tooltip=j.tooltip||j.name;this.callback=j.callback;this.hrefCallback=j.hrefCallback;this.choiceCallback=j.choiceCallback;this.image=j.image||d.toUrl("images/none.png");this.imageClass=
j.imageClass;this.spriteClass=j.spriteClass||"commandSprite";this.visibleWhen=j.visibleWhen;this._deviceSupportsHover=false},_asImage:function(j,o,q,v,u,s,w,z){q=q||this;var y=c.create("a");y.id=this.name+"link";var h=null;if(this.tooltip)y.title=this.tooltip;if(s||!this.hasImage()){j=window.document.createTextNode(this.name);c.place(j,y,"last")}else{h=new Image;h.alt=this.name;h.title=this.tooltip||this.name;h.name=j;h.id=j}if(this.hrefCallback){j=this.hrefCallback.call(q,o,this.id,v);if(j.then)j.then(function(n){y.href=
n});else y.href=j}else if(this.callback)h?c.connect(h,"onclick",this,function(){this.callback.call(q,o,this.id,h.id,v)}):c.connect(y,"onclick",this,function(){this.callback.call(q,o,this.id,y.id,v)});if(h){if(this._deviceSupportsHover){h.src=d.toUrl("images/none.png");c.connect(h,"onmouseover",this,function(){h.src=this.image});c.connect(h,"onmouseout",this,function(){h.src=d.toUrl("images/none.png")})}else{h.src=this.image;c.connect(h,"onmouseover",this,function(){w?c.addClass(h,w):c.addClass(h,
"commandOver")});c.connect(h,"onmouseout",this,function(){h.src=this.image;w?c.removeClass(h,w):c.removeClass(h,"commandOver")})}c.addClass(h,"commandImage");u&&c.addClass(h,u);if(this.imageClass){c.addClass(h,this.spriteClass);c.addClass(h,this.imageClass)}c.place(h,y,"last")}z?c.addClass(y,z):c.addClass(y,"commandLink");u&&c.addClass(y,u);return y},_asLink:function(j,o,q){o=o||this;var v=window.document.createElement("a");if(this.tooltip)v.title=this.tooltip;c.place(window.document.createTextNode(this.name),
v,"only");v.href="";v.id=this.id+"link";if(this.callback)c.connect(v,"onclick",this,function(){this.callback.call(o,j,this.id,v.id)});else if(this.hrefCallback){var u=this.hrefCallback.call(o,j,this.id);if(u)if(u.then)u.then(function(s){v.href=s});else v.href=u}c.addClass(v,"commandLink");q&&c.addClass(v,q);return v},_addMenuItem:function(j,o,q,v,u){var s=new i({labelType:this.hrefCallback?"html":"text",label:this.name,iconClass:this.imageClass,hrefCallback:!!this.hrefCallback});this.tooltip&&new a.Tooltip({connectId:[s.domNode],
label:this.tooltip});if(this.hrefCallback){var w=this.hrefCallback.call(q,o,this.id,j.id,v);if(w)w.then?w.then(c.hitch(this,function(z){s.set("label","<a href='"+z+"'>"+this.name+"</a>")})):s.set("label","<a href='"+w+"'>"+this.name+"</a>")}else if(this.callback)s.onClick=c.hitch(this,function(){this.callback.call(q,o,this.id,null,v)});s.eclipseCommand=this;j.addChild(s);if(this.imageClass)c.addClass(s.iconNode,this.spriteClass);else if(this.image){c.addClass(s.iconNode,"commandImage");u&&c.addClass(s.iconNode,
u);s.iconNode.src=this.image}},populateChoicesMenu:function(j,o,q,v){j.focusedChild=null;c.forEach(j.getChildren(),function(w){j.removeChild(w);w.destroy()});q=this.getChoices(o,q,v);for(v=0;v<q.length;v++){var u=q[v],s;if(u.name){s=new a.MenuItem({label:u.name,iconClass:u.imageClass,onClick:this.makeChoiceCallback(u,o)});if(u.imageClass)c.addClass(s.iconNode,u.spriteClass||"commandSprite");else if(u.image){c.addClass(s.iconNode,"commandImage");s.iconNode.src=u.image}}else s=new a.MenuSeparator;j.addChild(s)}},
getChoices:function(j,o,q){if(this.choiceCallback)return this.choiceCallback.call(o,j,q);return null},makeChoiceCallback:function(j,o){return function(q){j.callback&&j.callback.call(j,o,q)}},hasImage:function(){return this.imageClass||this.image!==d.toUrl("images/none.png")}};f.prototype.constructor=f;var k=window.navigator.platform.indexOf("Mac")!==-1;g.prototype={match:function(j){if(this.keyCode===j.keyCode){if(this.mod1!==(k?j.metaKey:j.ctrlKey))return false;if(this.mod2!==j.shiftKey)return false;
if(this.mod3!==j.altKey)return false;if(k&&this.mod4!==j.ctrlKey)return false;return true}return false},equals:function(j){if(!j)return false;if(this.keyCode!==j.keyCode)return false;if(this.mod1!==j.mod1)return false;if(this.mod2!==j.mod2)return false;if(this.mod3!==j.mod3)return false;if(this.mod4!==j.mod4)return false;return true}};g.prototype.constructor=g;return{CommandService:e,CommandKeyBinding:g,Command:f,CommandMenuItem:i}});var orion=orion||{};orion.textview=orion.textview||{};
orion.textview.KeyBinding=function(){function d(a,b,e,f,g){this.keyCode=typeof a==="string"?a.toUpperCase().charCodeAt(0):a;this.mod1=b!==undefined&&b!==null?b:false;this.mod2=e!==undefined&&e!==null?e:false;this.mod3=f!==undefined&&f!==null?f:false;this.mod4=g!==undefined&&g!==null?g:false}var c=window.navigator.platform.indexOf("Mac")!==-1;d.prototype={match:function(a){if(this.keyCode===a.keyCode){if(this.mod1!==(c?a.metaKey:a.ctrlKey))return false;if(this.mod2!==a.shiftKey)return false;if(this.mod3!==
a.altKey)return false;if(c&&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 d}();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(d){d.getObject("dnd",true,d);d.dnd.getCopyKeyState=d.isCopyKey;d.dnd._uniqueId=0;d.dnd.getUniqueId=function(){var c;do c=d._scopeName+"Unique"+ ++d.dnd._uniqueId;while(d.byId(c));return c};d.dnd._empty={};d.dnd.isFormElement=function(c){c=c.target;if(c.nodeType==3)c=c.parentNode;return" button textarea input select option ".indexOf(" "+c.tagName.toLowerCase()+" ")>=0};return d.dnd});
define("dojo/dnd/autoscroll",["dojo","dojo/window"],function(d){d.getObject("dnd",true,d);d.dnd.getViewport=d.window.getBox;d.dnd.V_TRIGGER_AUTOSCROLL=32;d.dnd.H_TRIGGER_AUTOSCROLL=32;d.dnd.V_AUTOSCROLL_VALUE=16;d.dnd.H_AUTOSCROLL_VALUE=16;d.dnd.autoScroll=function(c){var a=d.window.getBox(),b=0,e=0;if(c.clientX<d.dnd.H_TRIGGER_AUTOSCROLL)b=-d.dnd.H_AUTOSCROLL_VALUE;else if(c.clientX>a.w-d.dnd.H_TRIGGER_AUTOSCROLL)b=d.dnd.H_AUTOSCROLL_VALUE;if(c.clientY<d.dnd.V_TRIGGER_AUTOSCROLL)e=-d.dnd.V_AUTOSCROLL_VALUE;
else if(c.clientY>a.h-d.dnd.V_TRIGGER_AUTOSCROLL)e=d.dnd.V_AUTOSCROLL_VALUE;window.scrollBy(b,e)};d.dnd._validNodes={div:1,p:1,td:1};d.dnd._validOverflow={auto:1,scroll:1};d.dnd.autoScrollNodes=function(c){for(var a=c.target;a;){if(a.nodeType==1&&a.tagName.toLowerCase()in d.dnd._validNodes){var b=d.getComputedStyle(a);if(b.overflow.toLowerCase()in d.dnd._validOverflow){var e=d._getContentBox(a,b);b=d.position(a,true);var f=Math.min(d.dnd.H_TRIGGER_AUTOSCROLL,e.w/2),g=Math.min(d.dnd.V_TRIGGER_AUTOSCROLL,
e.h/2),i=c.pageX-b.x,k=c.pageY-b.y,j=b=0;if(d.isWebKit||d.isOpera){i+=d.body().scrollLeft;k+=d.body().scrollTop}if(i>0&&i<e.w)if(i<f)b=-f;else if(i>e.w-f)b=f;if(k>0&&k<e.h)if(k<g)j=-g;else if(k>e.h-g)j=g;e=a.scrollLeft;f=a.scrollTop;a.scrollLeft+=b;a.scrollTop+=j;if(e!=a.scrollLeft||f!=a.scrollTop)return}}try{a=a.parentNode}catch(o){a=null}}d.dnd.autoScroll(c)};return d.dnd});
define("dojo/dnd/Mover",["dojo","dojo/dnd/common","dojo/dnd/autoscroll"],function(d){d.declare("dojo.dnd.Mover",null,{constructor:function(c,a,b){this.node=d.byId(c);var e=a.touches?a.touches[0]:a;this.marginBox={l:e.pageX,t:e.pageY};this.mouseButton=a.button;a=this.host=b;c=c.ownerDocument;this.events=[d.connect(c,"onmousemove",this,"onFirstMove"),d.connect(c,"ontouchmove",this,"onFirstMove"),d.connect(c,"onmousemove",this,"onMouseMove"),d.connect(c,"ontouchmove",this,"onMouseMove"),d.connect(c,
"onmouseup",this,"onMouseUp"),d.connect(c,"ontouchend",this,"onMouseUp"),d.connect(c,"ondragstart",d.stopEvent),d.connect(c.body,"onselectstart",d.stopEvent)];a&&a.onMoveStart&&a.onMoveStart(this)},onMouseMove:function(c){d.dnd.autoScroll(c);var a=this.marginBox,b=c.touches?c.touches[0]:c;this.host.onMove(this,{l:a.l+b.pageX,t:a.t+b.pageY},c);d.stopEvent(c)},onMouseUp:function(c){if(d.isWebKit&&d.isMac&&this.mouseButton==2?c.button==0:this.mouseButton==c.button)this.destroy();d.stopEvent(c)},onFirstMove:function(c){var a=
this.node.style,b,e=this.host;switch(a.position){case "relative":case "absolute":b=Math.round(parseFloat(a.left))||0;a=Math.round(parseFloat(a.top))||0;break;default:a.position="absolute";a=d.marginBox(this.node);b=d.doc.body;var f=d.getComputedStyle(b),g=d._getMarginBox(b,f);f=d._getContentBox(b,f);b=a.l-(f.l-g.l);a=a.t-(f.t-g.t);break}this.marginBox.l=b-this.marginBox.l;this.marginBox.t=a-this.marginBox.t;e&&e.onFirstMove&&e.onFirstMove(this,c);d.disconnect(this.events.shift());d.disconnect(this.events.shift())},
destroy:function(){d.forEach(this.events,d.disconnect);var c=this.host;c&&c.onMoveStop&&c.onMoveStop(this);this.events=this.node=this.host=null}});return d.dnd.Mover});
define("dojo/dnd/Moveable",["dojo","dojo/dnd/Mover"],function(d){d.declare("dojo.dnd.Moveable",null,{handle:"",delay:0,skip:false,constructor:function(c,a){this.node=d.byId(c);a||(a={});this.handle=a.handle?d.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:d.dnd.Mover;this.events=[d.connect(this.handle,"onmousedown",this,"onMouseDown"),d.connect(this.handle,"ontouchstart",this,"onMouseDown"),d.connect(this.handle,
"ondragstart",this,"onSelectStart"),d.connect(this.handle,"onselectstart",this,"onSelectStart")]},markupFactory:function(c,a){return new d.dnd.Moveable(a,c)},destroy:function(){d.forEach(this.events,d.disconnect);this.events=this.node=this.handle=null},onMouseDown:function(c){if(!(this.skip&&d.dnd.isFormElement(c))){if(this.delay){this.events.push(d.connect(this.handle,"onmousemove",this,"onMouseMove"),d.connect(this.handle,"ontouchmove",this,"onMouseMove"),d.connect(this.handle,"onmouseup",this,
"onMouseUp"),d.connect(this.handle,"ontouchend",this,"onMouseUp"));var a=c.touches?c.touches[0]:c;this._lastX=a.pageX;this._lastY=a.pageY}else this.onDragDetected(c);d.stopEvent(c)}},onMouseMove:function(c){var a=c.touches?c.touches[0]:c;if(Math.abs(a.pageX-this._lastX)>this.delay||Math.abs(a.pageY-this._lastY)>this.delay){this.onMouseUp(c);this.onDragDetected(c)}d.stopEvent(c)},onMouseUp:function(c){for(var a=0;a<2;++a)d.disconnect(this.events.pop());d.stopEvent(c)},onSelectStart:function(c){if(!this.skip||
!d.dnd.isFormElement(c))d.stopEvent(c)},onDragDetected:function(c){new this.mover(this.node,c,this)},onMoveStart:function(c){d.publish("/dnd/move/start",[c]);d.addClass(d.body(),"dojoMove");d.addClass(this.node,"dojoMoveItem")},onMoveStop:function(c){d.publish("/dnd/move/stop",[c]);d.removeClass(d.body(),"dojoMove");d.removeClass(this.node,"dojoMoveItem")},onFirstMove:function(){},onMove:function(c,a){this.onMoving(c,a);var b=c.node.style;b.left=a.l+"px";b.top=a.t+"px";this.onMoved(c,a)},onMoving:function(){},
onMoved:function(){}});return d.dnd.Moveable});
define("dojo/dnd/move",["dojo","dojo/dnd/Mover","dojo/dnd/Moveable"],function(d){d.declare("dojo.dnd.move.constrainedMoveable",d.dnd.Moveable,{constraints:function(){},within:false,markupFactory:function(c,a){return new d.dnd.move.constrainedMoveable(a,c)},constructor:function(c,a){a||(a={});this.constraints=a.constraints;this.within=a.within},onFirstMove:function(c){var a=this.constraintBox=this.constraints.call(this,c);a.r=a.l+a.w;a.b=a.t+a.h;if(this.within){c=d._getMarginSize(c.node);a.r-=c.w;
a.b-=c.h}},onMove:function(c,a){var b=this.constraintBox,e=c.node.style;this.onMoving(c,a);a.l=a.l<b.l?b.l:b.r<a.l?b.r:a.l;a.t=a.t<b.t?b.t:b.b<a.t?b.b:a.t;e.left=a.l+"px";e.top=a.t+"px";this.onMoved(c,a)}});d.declare("dojo.dnd.move.boxConstrainedMoveable",d.dnd.move.constrainedMoveable,{box:{},markupFactory:function(c,a){return new d.dnd.move.boxConstrainedMoveable(a,c)},constructor:function(c,a){var b=a&&a.box;this.constraints=function(){return b}}});d.declare("dojo.dnd.move.parentConstrainedMoveable",
d.dnd.move.constrainedMoveable,{area:"content",markupFactory:function(c,a){return new d.dnd.move.parentConstrainedMoveable(a,c)},constructor:function(c,a){var b=a&&a.area;this.constraints=function(){var e=this.node.parentNode,f=d.getComputedStyle(e),g=d._getMarginBox(e,f);if(b=="margin")return g;var i=d._getMarginExtents(e,f);g.l+=i.l;g.t+=i.t;g.w-=i.w;g.h-=i.h;if(b=="border")return g;i=d._getBorderExtents(e,f);g.l+=i.l;g.t+=i.t;g.w-=i.w;g.h-=i.h;if(b=="padding")return g;i=d._getPadExtents(e,f);g.l+=
i.l;g.t+=i.t;g.w-=i.w;g.h-=i.h;return g}}});d.dnd.constrainedMover=d.dnd.move.constrainedMover;d.dnd.boxConstrainedMover=d.dnd.move.boxConstrainedMover;d.dnd.parentConstrainedMover=d.dnd.move.parentConstrainedMover;return d.dnd.move});
define("dojo/dnd/TimedMoveable",["dojo","dojo/dnd/Moveable"],function(d){(function(){var c=d.dnd.Moveable.prototype.onMove;d.declare("dojo.dnd.TimedMoveable",d.dnd.Moveable,{timeout:40,constructor:function(a,b){b||(b={});if(b.timeout&&typeof b.timeout=="number"&&b.timeout>=0)this.timeout=b.timeout},markupFactory:function(a,b){return new d.dnd.TimedMoveable(b,a)},onMoveStop:function(a){if(a._timer){clearTimeout(a._timer);c.call(this,a,a._leftTop)}d.dnd.Moveable.prototype.onMoveStop.apply(this,arguments)},
onMove:function(a,b){a._leftTop=b;if(!a._timer){var e=this;a._timer=setTimeout(function(){a._timer=null;c.call(e,a,a._leftTop)},this.timeout)}}})})();return d.dnd.TimedMoveable});
define("dojo/fx/Toggler",["dojo"],function(d){d.declare("dojo.fx.Toggler",null,{node:null,showFunc:d.fadeIn,hideFunc:d.fadeOut,showDuration:200,hideDuration:200,constructor:function(c){var a=this;d.mixin(a,c);a.node=c.node;a._showArgs=d.mixin({},c);a._showArgs.node=a.node;a._showArgs.duration=a.showDuration;a.showAnim=a.showFunc(a._showArgs);a._hideArgs=d.mixin({},c);a._hideArgs.node=a.node;a._hideArgs.duration=a.hideDuration;a.hideAnim=a.hideFunc(a._hideArgs);d.connect(a.showAnim,"beforeBegin",d.hitch(a.hideAnim,
"stop",true));d.connect(a.hideAnim,"beforeBegin",d.hitch(a.showAnim,"stop",true))},show:function(c){return this.showAnim.play(c||0)},hide:function(c){return this.hideAnim.play(c||0)}});return d.fx.Toggler});
define("dojo/fx",["dojo","dojo/fx/Toggler"],function(d){(function(){var c={_fire:function(e,f){if(this[e])this[e].apply(this,f||[]);return this}},a=function(e){this._index=-1;this._animations=e||[];this._current=this._onAnimateCtx=this._onEndCtx=null;this.duration=0;d.forEach(this._animations,function(f){this.duration+=f.duration;if(f.delay)this.duration+=f.delay},this)};d.extend(a,{_onAnimate:function(){this._fire("onAnimate",arguments)},_onEnd:function(){d.disconnect(this._onAnimateCtx);d.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=d.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");this._current.play(0,true)}},play:function(e,f){if(!this._current)this._current=this._animations[this._index=0];if(!f&&this._current.status()=="playing")return this;var g=d.connect(this._current,"beforeBegin",this,
function(){this._fire("beforeBegin")}),i=d.connect(this._current,"onBegin",this,function(){this._fire("onBegin",arguments)}),k=d.connect(this._current,"onPlay",this,function(){this._fire("onPlay",arguments);d.disconnect(g);d.disconnect(i);d.disconnect(k)});this._onAnimateCtx&&d.disconnect(this._onAnimateCtx);this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx&&d.disconnect(this._onEndCtx);this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");this._current.play.apply(this._current,
arguments);return this},pause:function(){if(this._current){var e=d.connect(this._current,"onPause",this,function(){this._fire("onPause",arguments);d.disconnect(e)});this._current.pause()}return this},gotoPercent:function(e,f){this.pause();var g=this.duration*e;this._current=null;d.some(this._animations,function(i){if(i.duration<=g){this._current=i;return true}g-=i.duration;return false});this._current&&this._current.gotoPercent(g/this._current.duration,f);return this},stop:function(e){if(this._current){if(e){for(;this._index+
1<this._animations.length;++this._index)this._animations[this._index].stop(true);this._current=this._animations[this._index]}var f=d.connect(this._current,"onStop",this,function(){this._fire("onStop",arguments);d.disconnect(f)});this._current.stop()}return this},status:function(){return this._current?this._current.status():"stopped"},destroy:function(){this._onAnimateCtx&&d.disconnect(this._onAnimateCtx);this._onEndCtx&&d.disconnect(this._onEndCtx)}});d.extend(a,c);d.fx.chain=function(e){return new a(e)};
var b=function(e){this._animations=e||[];this._connects=[];this.duration=this._finished=0;d.forEach(e,function(g){var i=g.duration;if(g.delay)i+=g.delay;if(this.duration<i)this.duration=i;this._connects.push(d.connect(g,"onEnd",this,"_onEnd"))},this);this._pseudoAnimation=new d.Animation({curve:[0,1],duration:this.duration});var f=this;d.forEach(["beforeBegin","onBegin","onPlay","onAnimate","onPause","onStop","onEnd"],function(g){f._connects.push(d.connect(f._pseudoAnimation,g,function(){f._fire(g,
arguments)}))})};d.extend(b,{_doAction:function(e,f){d.forEach(this._animations,function(g){g[e].apply(g,f)});return this},_onEnd:function(){++this._finished>this._animations.length&&this._fire("onEnd")},_call:function(e,f){var g=this._pseudoAnimation;g[e].apply(g,f)},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(e,f){var g=
this.duration*e;d.forEach(this._animations,function(i){i.gotoPercent(i.duration<g?1:g/i.duration,f)});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(){d.forEach(this._connects,d.disconnect)}});d.extend(b,c);d.fx.combine=function(e){return new b(e)};d.fx.wipeIn=function(e){var f=e.node=d.byId(e.node),g=f.style,i;e=d.animateProperty(d.mixin({properties:{height:{start:function(){i=
g.overflow;g.overflow="hidden";if(g.visibility=="hidden"||g.display=="none"){g.height="1px";g.display="";g.visibility="";return 1}else{var k=d.style(f,"height");return Math.max(k,1)}},end:function(){return f.scrollHeight}}}},e));d.connect(e,"onEnd",function(){g.height="auto";g.overflow=i});return e};d.fx.wipeOut=function(e){var f=(e.node=d.byId(e.node)).style,g;e=d.animateProperty(d.mixin({properties:{height:{end:1}}},e));d.connect(e,"beforeBegin",function(){g=f.overflow;f.overflow="hidden";f.display=
""});d.connect(e,"onEnd",function(){f.overflow=g;f.height="auto";f.display="none"});return e};d.fx.slideTo=function(e){var f=null,g=null,i=function(k){return function(){var j=d.getComputedStyle(k),o=j.position;f=o=="absolute"?k.offsetTop:parseInt(j.top)||0;g=o=="absolute"?k.offsetLeft:parseInt(j.left)||0;if(o!="absolute"&&o!="relative"){j=d.position(k,true);f=j.y;g=j.x;k.style.position="absolute";k.style.top=f+"px";k.style.left=g+"px"}}}(e.node=d.byId(e.node));i();e=d.animateProperty(d.mixin({properties:{top:e.top||
0,left:e.left||0}},e));d.connect(e,"beforeBegin",e,i);return e}})();return d.fx});
define("dijit/form/_FormMixin",["dojo","dijit","dojo/window"],function(d,c){d.declare("dijit.form._FormMixin",null,{state:"",reset:function(){d.forEach(this.getDescendants(),function(a){a.reset&&a.reset()})},validate:function(){var a=false;return d.every(d.map(this.getDescendants(),function(b){b._hasBeenBlurred=true;var e=b.disabled||!b.validate||b.validate();if(!e&&!a){d.window.scrollIntoView(b.containerNode||b.domNode);b.focus();a=true}return e}),function(b){return b})},setValues:function(a){d.deprecated(this.declaredClass+
"::setValues() is deprecated. Use set('value', val) instead.","","2.0");return this.set("value",a)},_setValueAttr:function(a){var b={};d.forEach(this.getDescendants(),function(i){if(i.name)(b[i.name]||(b[i.name]=[])).push(i)});for(var e in b)if(b.hasOwnProperty(e)){var f=b[e],g=d.getObject(e,false,a);if(g!==undefined){d.isArray(g)||(g=[g]);if(typeof f[0].checked=="boolean")d.forEach(f,function(i){i.set("value",d.indexOf(g,i.value)!=-1)});else f[0].multiple?f[0].set("value",g):d.forEach(f,function(i,
k){i.set("value",g[k])})}}},getValues:function(){d.deprecated(this.declaredClass+"::getValues() is deprecated. Use get('value') instead.","","2.0");return this.get("value")},_getValueAttr:function(){var a={};d.forEach(this.getDescendants(),function(b){var e=b.name;if(!(!e||b.disabled)){var f=b.get("value");if(typeof b.checked=="boolean")if(/Radio/.test(b.declaredClass))if(f!==false)d.setObject(e,f,a);else{f=d.getObject(e,false,a);f===undefined&&d.setObject(e,null,a)}else{b=d.getObject(e,false,a);
if(!b){b=[];d.setObject(e,b,a)}f!==false&&b.push(f)}else{b=d.getObject(e,false,a);if(typeof b!="undefined")d.isArray(b)?b.push(f):d.setObject(e,[b,f],a);else d.setObject(e,f,a)}}});return a},isValid:function(){return this.state==""},onValidStateChange:function(){},_getState:function(){var a=d.map(this._descendants,function(b){return b.get("state")||""});return d.indexOf(a,"Error")>=0?"Error":d.indexOf(a,"Incomplete")>=0?"Incomplete":""},disconnectChildren:function(){d.forEach(this._childConnections||
[],d.hitch(this,"disconnect"));d.forEach(this._childWatches||[],function(a){a.unwatch()})},connectChildren:function(a){var b=this;this.disconnectChildren();this._descendants=this.getDescendants();a=a?function(i,k){b[i]=k}:d.hitch(this,"_set");a("value",this.get("value"));a("state",this._getState());var e=this._childConnections=[],f=this._childWatches=[];d.forEach(d.filter(this._descendants,function(i){return i.validate}),function(i){d.forEach(["state","disabled"],function(k){f.push(i.watch(k,function(){b.set("state",
b._getState())}))})});var g=function(){b._onChangeDelayTimer&&clearTimeout(b._onChangeDelayTimer);b._onChangeDelayTimer=setTimeout(function(){delete b._onChangeDelayTimer;b._set("value",b.get("value"))},10)};d.forEach(d.filter(this._descendants,function(i){return i.onChange}),function(i){e.push(b.connect(i,"onChange",g));f.push(i.watch("disabled",g))})},startup:function(){this.inherited(arguments);this.connectChildren(true);this.watch("state",function(a,b,e){this.onValidStateChange(e=="")})},destroy:function(){this.disconnectChildren();
this.inherited(arguments)}});return c.form._FormMixin});
define("dijit/_DialogMixin",["dojo","dijit","dijit/_Widget"],function(d,c){d.declare("dijit._DialogMixin",null,{attributeMap:c._Widget.prototype.attributeMap,execute:function(){},onCancel:function(){},onExecute:function(){},_onSubmit:function(){this.onExecute();this.execute(this.get("value"))},_getFocusItems:function(){var a=c._getTabNavigable(this.containerNode);this._firstFocusItem=a.lowest||a.first||this.closeButtonNode||this.domNode;this._lastFocusItem=a.last||a.highest||this._firstFocusItem}});
return c._DialogMixin});
define("dijit/DialogUnderlay",["dojo","dijit","dojo/window","dijit/_Widget","dijit/_Templated"],function(d,c){d.declare("dijit.DialogUnderlay",[c._Widget,c._Templated],{templateString:"<div class='dijitDialogUnderlayWrapper'><div class='dijitDialogUnderlay' dojoAttachPoint='node'></div></div>",dialogId:"","class":"",attributeMap:{id:"domNode"},_setDialogIdAttr:function(a){d.attr(this.node,"id",a+"_underlay");this._set("dialogId",a)},_setClassAttr:function(a){this.node.className="dijitDialogUnderlay "+
a;this._set("class",a)},postCreate:function(){d.body().appendChild(this.domNode)},layout:function(){var a=this.node.style,b=this.domNode.style;b.display="none";var e=d.window.getBox();b.top=e.t+"px";b.left=e.l+"px";a.width=e.w+"px";a.height=e.h+"px";b.display="block"},show:function(){this.domNode.style.display="block";this.layout();this.bgIframe=new c.BackgroundIframe(this.domNode)},hide:function(){this.bgIframe.destroy();delete this.bgIframe;this.domNode.style.display="none"}});return c.DialogUnderlay});
define("dijit/layout/_LayoutWidget",["dojo","dijit","dijit/_Widget","dijit/_Container","dijit/_Contained"],function(d,c){d.declare("dijit.layout._LayoutWidget",[c._Widget,c._Container,c._Contained],{baseClass:"dijitLayoutContainer",isLayoutContainer:true,buildRendering:function(){this.inherited(arguments);d.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(d.isIE?
this.domNode:d.global,"onresize",function(){this.resize()})}}},resize:function(a,b){var e=this.domNode;if(a){d.marginBox(e,a);if(a.t)e.style.top=a.t+"px";if(a.l)e.style.left=a.l+"px"}b=b||{};d.mixin(b,a||{});if(!("h"in b)||!("w"in b))b=d.mixin(d.marginBox(e),b);a=d.getComputedStyle(e);var f=d._getMarginExtents(e,a),g=d._getBorderExtents(e,a);b=this._borderBox={w:b.w-(f.w+g.w),h:b.h-(f.h+g.h)};f=d._getPadExtents(e,a);this._contentBox={l:d._toPixelValue(e,a.paddingLeft),t:d._toPixelValue(e,a.paddingTop),
w:b.w-f.w,h:b.h-f.h};this.layout()},layout:function(){},_setupChild:function(a){d.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){d.removeClass(a.domNode,this.baseClass+"-child"+(a.baseClass?" "+this.baseClass+"-"+a.baseClass:""));this.inherited(arguments)}});c.layout.marginBox2contentBox=function(a,b){var e=d.getComputedStyle(a),f=d._getMarginExtents(a,
e),g=d._getPadBorderExtents(a,e);return{l:d._toPixelValue(a,e.paddingLeft),t:d._toPixelValue(a,e.paddingTop),w:b.w-(f.w+g.w),h:b.h-(f.h+g.h)}};(function(){var a=function(e){return e.substring(0,1).toUpperCase()+e.substring(1)},b=function(e,f){var g=e.resize?e.resize(f):d.marginBox(e.domNode,f);if(g)d.mixin(e,g);else{d.mixin(e,d.marginBox(e.domNode));d.mixin(e,f)}};c.layout.layoutChildren=function(e,f,g,i,k){f=d.mixin({},f);d.addClass(e,"dijitLayoutContainer");g=d.filter(g,function(j){return j.region!=
"center"&&j.layoutAlign!="client"}).concat(d.filter(g,function(j){return j.region=="center"||j.layoutAlign=="client"}));d.forEach(g,function(j){var o=j.domNode,q=j.region||j.layoutAlign,v=o.style;v.left=f.l+"px";v.top=f.t+"px";v.position="absolute";d.addClass(o,"dijitAlign"+a(q));o={};if(i&&i==j.id)o[j.region=="top"||j.region=="bottom"?"h":"w"]=k;if(q=="top"||q=="bottom"){o.w=f.w;b(j,o);f.h-=j.h;if(q=="top")f.t+=j.h;else v.top=f.t+f.h+"px"}else if(q=="left"||q=="right"){o.h=f.h;b(j,o);f.w-=j.w;if(q==
"left")f.l+=j.w;else v.left=f.l+f.w+"px"}else if(q=="client"||q=="center")b(j,f)})}})();return c.layout._LayoutWidget});
define("dijit/layout/_ContentPaneResizeMixin",["dojo","dijit","dijit/_Contained","dijit/layout/_LayoutWidget"],function(d,c){d.declare("dijit.layout._ContentPaneResizeMixin",null,{doLayout:true,isContainer:true,isLayoutContainer:true,_startChildren:function(){d.forEach(this.getChildren(),function(a){a.startup();a._started=true})},startup:function(){if(!this._started){var a=c._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(d.isIE?this.domNode:d.global,"onresize",function(){this._needLayout=!this._childOfLayoutWidget;this.resize()})}},_checkIfSingleChild:function(){var a=d.query("> *",this.containerNode).filter(function(f){return f.tagName!=="SCRIPT"}),b=a.filter(function(f){return d.hasAttr(f,"data-dojo-type")||d.hasAttr(f,"dojoType")||d.hasAttr(f,"widgetId")}),e=d.filter(b.map(c.byNode),function(f){return f&&
f.domNode&&f.resize});if(a.length==b.length&&e.length==1)this._singleChild=e[0];else delete this._singleChild;d.toggleClass(this.containerNode,this.baseClass+"SingleChild",!!this._singleChild)},resize:function(a,b){!this._wasShown&&this.open!==false&&this._onShow();this._resizeCalled=true;this._scheduleLayout(a,b)},_scheduleLayout:function(a,b){if(this._isShown())this._layout(a,b);else{this._needLayout=true;this._changeSize=a;this._resultSize=b}},_layout:function(a,b){a&&d.marginBox(this.domNode,
a);var e=this.containerNode;if(e===this.domNode){b=b||{};d.mixin(b,a||{});if(!("h"in b)||!("w"in b))b=d.mixin(d.marginBox(e),b);this._contentBox=c.layout.marginBox2contentBox(e,b)}else this._contentBox=d.contentBox(e);this._layoutChildren();delete this._needLayout},_layoutChildren:function(){this.doLayout&&this._checkIfSingleChild();if(this._singleChild&&this._singleChild.resize){var a=this._contentBox||d.contentBox(this.containerNode);this._singleChild.resize({w:a.w,h:a.h})}else d.forEach(this.getChildren(),
function(b){b.resize&&b.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,b=this.domNode.parentNode;return a.style.display!="none"&&a.style.visibility!="hidden"&&!d.hasClass(a,"dijitHidden")&&b&&b.style&&b.style.display!="none"}},_onShow:function(){this._needLayout&&this._layout(this._changeSize,this._resultSize);this.inherited(arguments);this._wasShown=
true}});return c.layout._ContentPaneResizeMixin});
define("dojo/html",["dojo","dojo/parser"],function(d){d.getObject("html",true,d);(function(){var c=0;d.html._secureForInnerHtml=function(a){return a.replace(/(?:\s*<!DOCTYPE\s[^>]+>|<title[^>]*>[\s\S]*?<\/title>)/ig,"")};d.html._emptyNode=d.empty;d.html._setNodeContent=function(a,b){d.empty(a);if(b){if(typeof b=="string")b=d._toDom(b,a.ownerDocument);if(!b.nodeType&&d.isArrayLike(b))for(var e=b.length,f=0;f<b.length;f=e==b.length?f+1:0)d.place(b[f],a,"last");else d.place(b,a,"last")}return a};d.declare("dojo.html._ContentSetter",
null,{node:"",content:"",id:"",cleanContent:false,extractContent:false,parseContent:false,parserScope:d._scopeName,startup:true,constructor:function(a,b){d.mixin(this,a||{});b=this.node=d.byId(this.node||b);if(!this.id)this.id=["Setter",b?b.id||b.tagName:"",c++].join("_")},set:function(a,b){if(undefined!==a)this.content=a;b&&this._mixin(b);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=d.html._setNodeContent(a,this.content)}catch(b){var e=this.onContentError(b);try{a.innerHTML=e}catch(f){console.error("Fatal "+this.declaredClass+".setContent could not change content due to "+f.message,f)}}this.node=a},empty:function(){if(this.parseResults&&this.parseResults.length){d.forEach(this.parseResults,function(a){a.destroy&&a.destroy()});delete this.parseResults}d.html._emptyNode(this.node)},onBegin:function(){var a=this.content;if(d.isString(a)){if(this.cleanContent)a=d.html._secureForInnerHtml(a);
if(this.extractContent){var b=a.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(b)a=b[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 b={},e;for(e in a)e in b||(this[e]=a[e])},_parse:function(){var a=this.node;try{var b={};d.forEach(["dir","lang","textDir"],
function(f){if(this[f])b[f]=this[f]},this);this.parseResults=d.parser.parse({rootNode:a,noStart:!this.startup,inherited:b,scope:this.parserScope})}catch(e){this._onError("Content",e,"Error parsing in _ContentSetter#"+this.id)}},_onError:function(a,b,e){a=this["on"+a+"Error"].call(this,b);if(e)console.error(e,b);else a&&d.html._setNodeContent(this.node,a,true)}});d.html.set=function(a,b,e){if(undefined==b){console.warn("dojo.html.set: no cont argument provided, using empty string");b=""}return e?(new d.html._ContentSetter(d.mixin(e,
{content:b,node:a}))).set():d.html._setNodeContent(a,b,true)}})();return d.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(d,c){d.declare("dijit.layout.ContentPane",[c._Widget,c.layout._ContentPaneResizeMixin],{href:"",extractContent:false,parseOnLoad:true,parserScope:d._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:d.delegate(c._Widget.prototype.attributeMap,{title:[]}),stopParser:true,template:false,create:function(a,b){if((!a||!a.template)&&b&&!("href"in a)&&!("content"in a)){var e=d.doc.createDocumentFragment();for(b=d.byId(b);b.firstChild;)e.appendChild(b.firstChild);a=d.delegate(a,{content:e})}this.inherited(arguments,[a,b])},postMixInProperties:function(){this.inherited(arguments);var a=d.i18n.getLocalization("dijit",
"loading",this.lang);this.loadingMessage=d.string.substitute(this.loadingMessage,a);this.errorMessage=d.string.substitute(this.errorMessage,a)},buildRendering:function(){this.inherited(arguments);if(!this.containerNode)this.containerNode=this.domNode;this.domNode.title="";d.attr(this.domNode,"role")||c.setWaiRole(this.domNode,"group")},_startChildren:function(){this.inherited(arguments);this._contentSetter&&d.forEach(this._contentSetter.parseResults,function(a){if(!a._started&&!a._destroyed&&d.isFunction(a.startup)){a.startup();
a._started=true}},this)},setHref:function(a){d.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 d.Deferred(d.hitch(this,"cancel"));this.onLoadDeferred.addCallback(d.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){d.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 d.Deferred(d.hitch(this,"cancel"));this._created&&this.onLoadDeferred.addCallback(d.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 d.Deferred(d.hitch(this,"cancel"));this.onLoadDeferred.addCallback(d.hitch(this,"onLoad"));this._load();return this.onLoadDeferred},_load:function(){this._setContent(this.onDownloadStart(),
true);var a=this,b={preventCache:this.preventCache||this.refreshOnShow,url:this.href,handleAs:"text"};d.isObject(this.ioArgs)&&d.mixin(b,this.ioArgs);var e=this._xhrDfd=(this.ioMethod||d.xhrGet)(b);e.addCallback(function(f){try{a._isDownloaded=true;a._setContent(f,false);a.onDownloadEnd()}catch(g){a._onError("Content",g)}delete a._xhrDfd;return f});e.addErrback(function(f){e.canceled||a._onError("Download",f);delete a._xhrDfd;return f});delete this._hrefChanged},_onLoadHandler:function(a){this._set("isLoaded",
true);try{this.onLoadDeferred.callback(a)}catch(b){console.error("Error "+this.widgetId+" running custom onLoad code: "+b.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;d.forEach(this.getChildren(),function(b){b.destroyRecursive&&b.destroyRecursive()});if(a){d.forEach(a.parseResults,
function(b){b.destroyRecursive&&b.domNode&&b.domNode.parentNode==d.body()&&b.destroyRecursive()});delete a.parseResults}d.html._emptyNode(this.containerNode);delete this._singleChild},_setContent:function(a,b){this.destroyDescendants();var e=this._contentSetter;if(!(e&&e instanceof d.html._ContentSetter))e=this._contentSetter=new d.html._ContentSetter({node:this.containerNode,_onError:d.hitch(this,this._onError),onContentError:d.hitch(this,function(g){g=this.onContentError(g);try{this.containerNode.innerHTML=
g}catch(i){console.error("Fatal "+this.id+" could not change content due to "+i.message,i)}})});var f=d.mixin({cleanContent:this.cleanContent,extractContent:this.extractContent,parseContent:this.parseOnLoad,parserScope:this.parserScope,startup:false,dir:this.dir,lang:this.lang},this._contentSetterParams||{});e.set(d.isObject(a)&&a.domNode?a.domNode:a,f);delete this._contentSetterParams;this.doLayout&&this._checkIfSingleChild();if(!b){if(this._started){this._startChildren();this._scheduleLayout()}this._onLoadHandler(a)}},
_onError:function(a,b,e){this.onLoadDeferred.errback(b);a=this["on"+a+"Error"].call(this,b);if(e)console.error(e,b);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 c.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(d,c){d.declare("dijit.TooltipDialog",[c.layout.ContentPane,c._Templated,c.form._FormMixin,c._DialogMixin],{title:"",doLayout:false,autofocus:true,baseClass:"dijitTooltipDialog",_firstFocusItem:null,_lastFocusItem:null,templateString:d.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,b,e){a="dijitTooltipAB"+(e.charAt(1)=="L"?"Left":"Right")+" dijitTooltip"+(e.charAt(0)=="T"?"Below":"Above");d.replaceClass(this.domNode,a,this._currentOrientClass||"");this._currentOrientClass=a},focus:function(){this._getFocusItems(this.containerNode);c.focus(this._firstFocusItem)},onOpen:function(a){this.orient(this.domNode,a.aroundCorner,a.corner);this._onShow()},
onClose:function(){this.onHide()},_onKey:function(a){var b=a.target,e=d.keys;a.charOrCode===e.TAB&&this._getFocusItems(this.containerNode);var f=this._firstFocusItem==this._lastFocusItem;if(a.charOrCode==e.ESCAPE){setTimeout(d.hitch(this,"onCancel"),0);d.stopEvent(a)}else if(b==this._firstFocusItem&&a.shiftKey&&a.charOrCode===e.TAB){f||c.focus(this._lastFocusItem);d.stopEvent(a)}else if(b==this._lastFocusItem&&a.charOrCode===e.TAB&&!a.shiftKey){f||c.focus(this._firstFocusItem);d.stopEvent(a)}else a.charOrCode===
e.TAB&&a.stopPropagation()}});return c.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(d,c){d.declare("dijit._DialogBase",[c._Templated,c.form._FormMixin,c._DialogMixin,c._CssStateMixin],{templateString:d.cache("dijit","templates/Dialog.html"),
baseClass:"dijitDialog",cssStateNodes:{closeButtonNode:"dijitDialogCloseIcon"},attributeMap:d.delegate(c._Widget.prototype.attributeMap,{title:[{node:"titleNode",type:"innerHTML"},{node:"titleBar",type:"attribute"}],"aria-describedby":""}),open:false,duration:c.defaultDuration,refocus:true,autofocus:true,_firstFocusItem:null,_lastFocusItem:null,doLayout:false,draggable:true,"aria-describedby":"",postMixInProperties:function(){var a=d.i18n.getLocalization("dijit","common");d.mixin(this,a);this.inherited(arguments)},
postCreate:function(){d.style(this.domNode,{display:"none",position:"absolute"});d.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&&c._DialogLevelManager.isTop(this)){this._getFocusItems(this.domNode);c.focus(this._firstFocusItem)}this.inherited(arguments)},_endDrag:function(a){if(a&&a.node&&a.node===this.domNode)this._relativePosition=
d.position(a.node)},_setup:function(){var a=this.domNode;if(this.titleBar&&this.draggable){this._moveable=d.isIE==6?new d.dnd.TimedMoveable(a,{handle:this.titleBar}):new d.dnd.Moveable(a,{handle:this.titleBar,timeout:0});this._dndListener=d.subscribe("/dnd/move/stop",this,"_endDrag")}else d.addClass(a,"dijitDialogFixed");this.underlayAttrs={dialogId:this.id,"class":d.map(this["class"].split(/\s/),function(b){return b+"_underlay"}).join(" ")}},_size:function(){this._checkIfSingleChild();if(this._singleChild){if(this._singleChildOriginalStyle)this._singleChild.domNode.style.cssText=
this._singleChildOriginalStyle;delete this._singleChildOriginalStyle}else d.style(this.containerNode,{width:"auto",height:"auto"});var a=d._getMarginSize(this.domNode),b=d.window.getBox();if(a.w>=b.w||a.h>=b.h){var e=Math.min(a.w,Math.floor(b.w*0.75));a=Math.min(a.h,Math.floor(b.h*0.75));if(this._singleChild&&this._singleChild.resize){this._singleChildOriginalStyle=this._singleChild.domNode.style.cssText;this._singleChild.resize({w:e,h:a})}else d.style(this.containerNode,{width:e+"px",height:a+"px",
overflow:"auto",position:"relative"})}else this._singleChild&&this._singleChild.resize&&this._singleChild.resize()},_position:function(){if(!d.hasClass(d.body(),"dojoMove")){var a=this.domNode,b=d.window.getBox(),e=this._relativePosition,f=e?null:d._getBorderBox(a),g=Math.floor(b.l+(e?e.x:(b.w-f.w)/2));b=Math.floor(b.t+(e?e.y:(b.h-f.h)/2));d.style(a,{left:g+"px",top:b+"px"})}},_onKey:function(a){if(a.charOrCode){var b=d.keys,e=a.target;a.charOrCode===b.TAB&&this._getFocusItems(this.domNode);var f=
this._firstFocusItem==this._lastFocusItem;if(e==this._firstFocusItem&&a.shiftKey&&a.charOrCode===b.TAB){f||c.focus(this._lastFocusItem);d.stopEvent(a)}else if(e==this._lastFocusItem&&a.charOrCode===b.TAB&&!a.shiftKey){f||c.focus(this._firstFocusItem);d.stopEvent(a)}else{for(;e;){if(e==this.domNode||d.hasClass(e,"dijitPopup"))if(a.charOrCode==b.ESCAPE)this.onCancel();else return;e=e.parentNode}if(a.charOrCode!==b.TAB)d.stopEvent(a);else if(!d.isOpera)try{this._firstFocusItem.focus()}catch(g){}}}},
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(d.connect(window,"onscroll",this,"layout"));this._modalconnects.push(d.connect(window,"onresize",this,function(){var b=d.window.getBox();if(!this._oldViewport||b.h!=this._oldViewport.h||b.w!=this._oldViewport.w){this.layout();this._oldViewport=b}}));this._modalconnects.push(d.connect(this.domNode,
"onkeypress",this,"_onKey"));d.style(this.domNode,{opacity:0,display:""});this._set("open",true);this._onShow();this._size();this._position();var a;this._fadeInDeferred=new d.Deferred(d.hitch(this,function(){a.stop();delete this._fadeInDeferred}));a=d.fadeIn({node:this.domNode,duration:this.duration,beforeBegin:d.hitch(this,function(){c._DialogLevelManager.show(this,this.underlayAttrs)}),onEnd:d.hitch(this,function(){if(this.autofocus&&c._DialogLevelManager.isTop(this)){this._getFocusItems(this.domNode);
c.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 d.Deferred(d.hitch(this,function(){a.stop();delete this._fadeOutDeferred}));a=d.fadeOut({node:this.domNode,duration:this.duration,onEnd:d.hitch(this,function(){this.domNode.style.display="none";c._DialogLevelManager.hide(this);this.onHide();
this._fadeOutDeferred.callback(true);delete this._fadeOutDeferred})}).play();if(this._scrollConnected)this._scrollConnected=false;d.forEach(this._modalconnects,d.disconnect);this._modalconnects=[];this._relativePosition&&delete this._relativePosition;this._set("open",false);return this._fadeOutDeferred}},layout:function(){if(this.domNode.style.display!="none"){c._underlay&&c._underlay.layout();this._position()}},destroy:function(){this._fadeInDeferred&&this._fadeInDeferred.cancel();this._fadeOutDeferred&&
this._fadeOutDeferred.cancel();this._moveable&&this._moveable.destroy();this._dndListener&&d.unsubscribe(this._dndListener);d.forEach(this._modalconnects,d.disconnect);c._DialogLevelManager.hide(this);this.inherited(arguments)}});d.declare("dijit.Dialog",[c.layout.ContentPane,c._DialogBase],{});c._DialogLevelManager={show:function(a,b){var e=c._dialogStack;e[e.length-1].focus=c.getFocus(a);var f=c._underlay;if(!f||f._destroyed)f=c._underlay=new c.DialogUnderlay(b);else f.set(a.underlayAttrs);var g=
e[e.length-1].dialog?e[e.length-1].zIndex+2:950;e.length==1&&f.show();d.style(c._underlay.domNode,"zIndex",g-1);d.style(a.domNode,"zIndex",g);e.push({dialog:a,underlayAttrs:b,zIndex:g})},hide:function(a){var b=c._dialogStack;if(b[b.length-1].dialog==a){b.pop();var e=b[b.length-1];if(b.length==1)c._underlay._destroyed||c._underlay.hide();else{d.style(c._underlay.domNode,"zIndex",e.zIndex-1);c._underlay.set(e.underlayAttrs)}if(a.refocus){b=e.focus;if(!b||e.dialog&&!d.isDescendant(b.node,e.dialog.domNode)){e.dialog._getFocusItems(e.dialog.domNode);
b=e.dialog._firstFocusItem}try{c.focus(b)}catch(f){}}}else{e=d.indexOf(d.map(b,function(g){return g.dialog}),a);e!=-1&&b.splice(e,1)}},isTop:function(a){var b=c._dialogStack;return b[b.length-1].dialog==a}};c._dialogStack=[{dialog:null,focus:null,underlayAttrs:null}];return c.Dialog});
define("orion/widgets/_OrionDialogMixin",["dojo","dijit"],function(d,c){d.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);d.connect(this,"onKeyPress",d.hitch(this,function(a){a.keyCode===d.keys.ENTER&&this._onSubmit()}))},onHide:function(){this.inherited(arguments);setTimeout(d.hitch(this,function(){if(d.isDescendant(c._curFocus,
this.domNode))c._curFocus=null;if(d.isDescendant(c._prevFocus,this.domNode))c._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(d,c){return d.declare("orion.widgets.OpenResourceDialog",[c.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:d.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);d.connect(this.resourceName,"onChange",this,function(){this.time=+new Date;clearTimeout(this.timeoutId);this.timeoutId=setTimeout(d.hitch(this,this.checkSearch),0)});d.connect(this.resourceName,"onKeyPress",this,function(a){if(a.keyCode===d.keys.ENTER&&this.results){a=d.query("a",this.results);if(a.length>0){window.open(a[0].href);this.hide()}}});d.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(d.hitch(this,"checkSearch"),50)},doSearch:function(){var a=this.resourceName&&this.resourceName.get("value");if(a){d.place("<div>Searching&#x2026;</div>",this.results,"only");var b=this;setTimeout(function(){var e=b.searcher.createSearchQuery(b.searchLocation,null,a);b.searcher.search(b.results,e,false,false,d.hitch(b,b.decorateResult),true,true)},0)}},decorateResult:function(a){var b=
this;d.query("a",a).forEach(function(e){d.connect(e,"onmouseup",function(f){!d.mouseButtons.isMiddle(f)&&!d.isCopyKey(f)&&b.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(d,c,a,b){c.declare("orion.widgets.LoginDialog",[a.TooltipDialog],{widgetsInTemplate:true,templateString:c.cache("orion","widgets/templates/LoginDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{};this.authenticatedServices={};this.unauthenticatedServices={}},setPendingAuthentication:function(e){for(var f in this.unauthenticatedServices)delete this.unauthenticatedServices[f].pending;
for(f in e)if(this.unauthenticatedServices[e[f].SignInKey])this.unauthenticatedServices[e[f].SignInKey].pending=true;else if(this.authenticatedServices[e[f].SignInKey]){this.unauthenticatedServices[e[f].SignInKey]=this.authenticatedServices[e[f].SignInKey];this.unauthenticatedServices[e[f].SignInKey].pending=true;delete this.authenticatedServices[e[f].SignInKey]}else this.unauthenticatedServices[e[f].SignInKey]={label:e[f].SignInKey,SignInLocation:e[f].SignInLocation,pending:true};this.renderUnauthenticatedServices();
this.renderAuthenticatedServices()},addUserItem:function(e,f,g,i){if(i){this.unauthenticatedServices[e]&&delete this.unauthenticatedServices[e];this.authenticatedServices[e]={authService:f,label:g,data:i}}else{this.authenticatedServices[e]&&delete this.authenticatedServices[e];this.unauthenticatedServices[e]=this.unauthenticatedServices[e]?{authService:f,label:g,pending:this.unauthenticatedServices[e].pending}:{authService:f,label:g}}c.hitch(this,this.renderAuthenticatedServices)();c.hitch(this,this.renderUnauthenticatedServices)();
if(a.byId("logins"))if(this.isSingleService()&&i){b.setUserName(i.login);e=i.Name&&i.Name.replace(/^\s+|\s+$/g,"")!==""?i.Name:i.login;if(e.length>40)e=e.substring(0,30)+"...";a.byId("logins").setLabel(e)}else a.byId("logins").setLabel("Security")},renderAuthenticatedServices:function(){c.empty(this.authenticatedList);this.authenticated.style.display=this.isEmpty(this.authenticatedServices)?"none":"";var e=this,f=true;for(var g in this.authenticatedServices){if(!f){var i=c.create("tr",null,this.authenticatedList);
c.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;'>"},i)}f=false;i=c.create("tr",{className:"navTableHeading"});var k=c.create("td",{innerHTML:"<h2>"+(this.authenticatedServices[g].label?this.authenticatedServices[g].label:g)+"</h2>"},i,"only");c.addClass(k,"LoginWindowLeft");k=c.create("td",{style:"text-align: right"},i,"last");c.addClass(k,"LoginWindowRight");var j=this.authenticatedServices[g].data,
o=this.authenticatedServices[g].authService;j.Location&&c.create("a",{href:d.toUrl("profile/user-profile.html")+"#"+j.Location,innerHTML:"Profile"},k,"last");c.place(document.createTextNode(" "),k,"last");if(o.logout){var q=c.create("a",{innerHTML:"Sign out"},k,"last");c.connect(q,"onmouseover",q,function(){q.style.cursor="pointer"});c.connect(q,"onmouseout",q,function(){q.style.cursor="default"});c.connect(q,"onclick",c.hitch(e,function(v,u){return function(){v.logout().then(c.hitch(e,function(){this.addUserItem(u,
v,this.authenticatedServices[u].label);this.isSingleService()&&a.popup.close(this);localStorage.removeItem(u)}))}})(o,g))}c.place(i,this.authenticatedList,"last");k="N/A";if(j&&j.lastlogintimestamp)k=c.date.locale.format(new Date(j.lastlogintimestamp),{formatLength:"short"});j=j.Name&&j.Name.replace(/^\s+|\s+$/g,"")!==""?j.Name:j.login;i=c.create("tr");k=j.length>40?c.create("td",{innerHTML:j.substring(0,30)+"... logged in since "+k,colspan:2,title:j+" logged in since "+k},i,"only"):c.create("td",
{innerHTML:j+" logged in since "+k,colspan:2},i,"only");c.addClass(k,"LoginWindowLeft");c.addClass(k,"LoginWindowRight");c.addClass(k,"LoginWindowComment");c.place(i,this.authenticatedList,"last")}},renderUnauthenticatedServices:function(){c.empty(this.otherUnauthenticatedList);var e=this;this.otherUnauthenticated.style.display=this.isEmpty(this.unauthenticatedServices)?"none":"";var f=true;for(var g in this.unauthenticatedServices){if(!f||!this.isEmpty(this.authenticatedServices)){var i=c.create("tr",
null,this.otherUnauthenticatedList);c.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;'>"},i)}f=false;i=c.create("tr",{className:"navTableHeading"});var k=c.create("td",null,i,"only");c.addClass(k,"LoginWindowLeft");c.create("h2",{innerHTML:this.unauthenticatedServices[g].label?this.unauthenticatedServices[g].label:g},k,"only");k=c.create("td",{style:"text-align: right"},i,"last");
c.addClass(k,"LoginWindowRight");var j=this.unauthenticatedServices[g].authService;if(j)if(j.getAuthForm)c.hitch(e,function(v,u){j.getAuthForm(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(s){s.indexOf("?")==-1?c.create("a",{target:"_blank",href:s+"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+u,innerHTML:"Sign in"},v,"last"):c.create("a",{target:"_blank",href:s+"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+u,innerHTML:"Sign in"},
v,"last")})})(k,g);else{if(j.login){var o=c.create("a",{innerHTML:"Sign in",style:"cursor: hand;"},k,"last");c.connect(o,"onmouseover",o,function(){o.style.cursor="pointer"});c.connect(o,"onmouseout",o,function(){o.style.cursor="default"});c.connect(o,"onclick",c.hitch(e,function(v){return function(){v.login(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(){e.isSingleService()&&a.popup.close(e)})}})(j))}}else{var q=this.unauthenticatedServices[g].SignInLocation;q.indexOf("?")==
-1?c.create("a",{target:"_blank",href:q+"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+g,innerHTML:"Sign in"},k,"last"):c.create("a",{target:"_blank",href:q+"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+g,innerHTML:"Sign in"},k,"last")}c.place(i,this.otherUnauthenticatedList,"last");if(this.unauthenticatedServices[g].pending){i=c.create("tr");k=c.create("td",{innerHTML:"Authentication required!",style:"padding-left: 10px",colspan:2},i,"only");c.addClass(k,
"LoginWindowLeft");c.addClass(k,"LoginWindowRight");c.create("img",{src:d.toUrl("images/warning.gif"),style:"padding-right: 4px; vertical-align: bottom; padding-bottom: 2px;"},k,"first");c.place(i,this.otherUnauthenticatedList,"last")}}},isSingleService:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)===1},isEmpty:function(e){for(var f in e)if(e.hasOwnProperty(f))return false;return true},length:function(e){var f=0;for(var g in e)e.hasOwnProperty(g)&&
f++;return f},getHostname:function(e){var f=document.createElement("img");f.src=e;e=f.src;f.src=null;return e.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(d,c,a,b,e,f){function g(y){var h=document.createElement("a");h.href=y;return h.href}function i(y,h){if(y.getLabel)return y.getLabel();else{y=new c.Deferred;y.callback(h.properties.name);return y}}function k(y){var h=y.getServiceReferences("orion.core.auth"),
n=c.byId("userInfo");if(n){if(!a.byId("logins")){var m=new a.form.DropDownButton({id:"logins",label:"Security",dropDown:z,title:"Login statuses"});c.addClass(m.domNode,"commandImage");c.place(m.domNode,n,"only")}for(n=0;n<h.length;n++){var l=h[n];y.getService(l).then(function(p){i(p,l).then(function(t){p.getKey().then(function(r){p.getUser().then(function(x){z.addUserItem(r,p,t,x)},function(){z.addUserItem(r,p,t)});window.addEventListener("storage",function(){if(w[r]!==localStorage.getItem(r)){w[r]=
localStorage.getItem(r);p.getUser().then(function(x){z.addUserItem(r,p,t,x)},function(){z.addUserItem(r,p,t)})}},false)})})})}}}function j(y){z.setPendingAuthentication(y);var h;for(h in y)if(y.hasOwnProperty(h)){a.popup.open({popup:z,around:c.byId("logins")});return}a.popup.close(z)}function o(y,h,n,m){var l=c.byId("pageActions");if(n)l=c.byId(n);if(l){c.empty(l);y.renderCommands(l,"dom",h,h,"image",null,null,!m)}}function q(y,h,n,m,l,p,t,r){var x=d.toUrl("filesearch._");x=x.substring(0,x.length-
2)+"?q=";var B;m=c.byId(y);if(!m)throw"could not find banner parent, id was "+y;c.place(v,m,"only");c.place('<div id="keyAssist" class="keyAssistFloat"></div>',document.body,"last");var C=c.byId("primaryNav");if(C)for(var D=h.getServiceReferences("orion.page.link"),E=0;E<D.length;E++)h.getService(D[E]).then(function(){for(var Q={},P=D[E].getPropertyNames(),R=0;R<P.length;R++)Q[P[R]]=D[E].getProperty(P[R]);if(Q.href&&Q.name){P=c.create("a",{href:Q.href},C,"last");c.addClass(P,"commandLink");B=document.createTextNode(Q.name);
c.place(B,P,"only")}});var H=c.byId("search");if(!H)throw"failed to generate HTML for banner";c.connect(H,"onkeypress",function(Q){if(Q.charOrCode===c.keys.ENTER)if(x){if(H.value.length>0){Q=l.createSearchQuery("../filesearch?q=",H.value);window.location=d.toUrl("search/search.html")+"#"+Q}}else window.alert("Can't search: SearchLocation not available")});if(y=c.byId("pageTitle")){B=document.createTextNode(document.title);c.place(B,y,"last")}var K=function(Q,P,R){var $=new orion.widgets.OpenResourceDialog({SearchLocation:Q,
searcher:P});R&&c.connect($,"onHide",function(){R.getTextView().focus()});window.setTimeout(function(){$.show()},0)};y=new b.Command({name:"Find File Named...",tooltip:"Choose a file by name and open an editor on it",id:"eclipse.openResource",callback:function(){K(x,l,t)}});if(t){t.getTextView().setKeyBinding(new f.KeyBinding("r",true,true,false),"Find File Named...");t.getTextView().setAction("Find File Named...",function(){K(x,l,t);return true})}n.addCommand(y,"global");n.registerCommandContribution("eclipse.openResource",
1,"globalActions",null,new b.CommandKeyBinding("t"),true);var L=c.byId("keyAssist");c.connect(document,"onkeypress",c.hitch(this,function(Q){if(Q.charOrCode===c.keys.ESCAPE)L.style.display="none"}));r&&r.addHandler({isActive:function(){return L.style.display==="block"},cancel:function(){if(this.isActive()){L.style.display="none";return true}return false}});r=new b.Command({name:"Show Keys",tooltip:"Show a list of all the keybindings on this page",id:"eclipse.keyAssist",callback:function(){c.empty(L);
if(t){c.place("<h2>Editor</h2>",L,"last");for(var Q=t.getTextView().getActions(false),P=0;P<Q.length;P++)for(var R=Q[P],$=t.getTextView().getKeyBindings(R),A=0;A<$.length;A++)c.place("<span>"+e.getUserKeyString($[A])+" = "+R+"<br></span>",L,"last")}c.place("<h2>Global</h2>",L,"last");n.showKeyBindings(L);L.style.display="block";return true}});n.addCommand(r,"global");n.registerCommandContribution("eclipse.keyAssist",1,"globalActions",null,new b.CommandKeyBinding(191,false,true),true);if(t){t.getTextView().setKeyBinding(new b.CommandKeyBinding("L",
true,true),"Show Keys");t.getTextView().setAction("Show Keys",r.callback)}if(r=c.byId("globalActions")){c.empty(r);n.renderCommands(r,"global",p||{},p,"image")}k(h);if(u)(h=c.byId("footer"))&&c.place(u,h,"only")}var v='<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="'+d.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="'+d.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>',
u='<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>',
s=g(d.toUrl("auth/NotifyAuthentication.html")),w={},z=new orion.widgets.LoginDialog;return{generateUserInfo:k,generateDomCommandsInBanner:o,generateBanner:q,notifyAuthenticationSite:s,setPendingAuthentication:j}});
define("dojo/date",["dojo"],function(d){d.getObject("date",true,d);d.date.getDaysInMonth=function(c){var a=c.getMonth();if(a==1&&d.date.isLeapYear(c))return 29;return[31,28,31,30,31,30,31,31,30,31,30,31][a]};d.date.isLeapYear=function(c){c=c.getFullYear();return!(c%400)||!(c%4)&&!!(c%100)};d.date.getTimezoneName=function(c){var a=c.toString(),b="",e=a.indexOf("(");if(e>-1)b=a.substring(++e,a.indexOf(")"));else{e=/([A-Z\/]+) \d{4}$/;if(a=a.match(e))b=a[1];else{a=c.toLocaleString();e=/ ([A-Z\/]+)$/;
if(a=a.match(e))b=a[1]}}return b=="AM"||b=="PM"?"":b};d.date.compare=function(c,a,b){c=new Date(+c);a=new Date(+(a||new Date));if(b=="date"){c.setHours(0,0,0,0);a.setHours(0,0,0,0)}else if(b=="time"){c.setFullYear(0,0,0);a.setFullYear(0,0,0)}if(c>a)return 1;if(c<a)return-1;return 0};d.date.add=function(c,a,b){var e=new Date(+c),f=false,g="Date";switch(a){case "day":break;case "weekday":var i;if(a=b%5){a=a;i=parseInt(b/5)}else{a=b>0?5:-5;i=b>0?(b-5)/5:(b+5)/5}var k=c.getDay(),j=0;if(k==6&&b>0)j=1;
else if(k==0&&b<0)j=-1;k=k+a;if(k==0||k==6)j=b>0?2:-2;b=7*i+a+j;break;case "year":g="FullYear";f=true;break;case "week":b*=7;break;case "quarter":b*=3;case "month":f=true;g="Month";break;default:g="UTC"+a.charAt(0).toUpperCase()+a.substring(1)+"s"}g&&e["set"+g](e["get"+g]()+b);f&&e.getDate()<c.getDate()&&e.setDate(0);return e};d.date.difference=function(c,a,b){a=a||new Date;b=b||"day";var e=a.getFullYear()-c.getFullYear(),f=1;switch(b){case "quarter":c=c.getMonth();a=a.getMonth();c=Math.floor(c/3)+
1;a=Math.floor(a/3)+1;a+=e*4;f=a-c;break;case "weekday":e=Math.round(d.date.difference(c,a,"day"));b=parseInt(d.date.difference(c,a,"week"));f=e%7;if(f==0)e=b*5;else{var g=0,i=c.getDay();a=a.getDay();b=parseInt(e/7);f=e%7;c=new Date(c);c.setDate(c.getDate()+b*7);c=c.getDay();if(e>0)switch(true){case i==6:g=-1;break;case i==0:g=0;break;case a==6:g=-1;break;case a==0:g=-2;break;case c+f>5:g=-2}else if(e<0)switch(true){case i==6:g=0;break;case i==0:g=1;break;case a==6:g=2;break;case a==0:g=1;break;case c+
f<0:g=2}e+=g;e-=b*2}f=e;break;case "year":f=e;break;case "month":f=a.getMonth()-c.getMonth()+e*12;break;case "week":f=parseInt(d.date.difference(c,a,"day")/7);break;case "day":f/=24;case "hour":f/=60;case "minute":f/=60;case "second":f/=1E3;case "millisecond":f*=a.getTime()-c.getTime()}return Math.round(f)};return d.date});
define("dojo/cldr/supplemental",["dojo","dojo/i18n"],function(d){d.getObject("cldr.supplemental",true,d);d.cldr.supplemental.getFirstDayOfWeek=function(c){c={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}[d.cldr.supplemental._region(c)];return c===undefined?
1:c};d.cldr.supplemental._region=function(c){c=d.i18n.normalizeLocale(c);c=c.split("-");var a=c[1];if(a){if(a.length==4)a=c[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"}[c[0]];return a};d.cldr.supplemental.getWeekend=function(c){var a=d.cldr.supplemental._region(c);c={"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(c===undefined)c=6;if(a===undefined)a=0;return{start:c,end:a}};return d.cldr.supplemental});
define("dojo/regexp",["dojo"],function(d){d.getObject("regexp",true,d);d.regexp.escapeString=function(c,a){return c.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,function(b){if(a&&a.indexOf(b)!=-1)return b;return"\\"+b})};d.regexp.buildGroupRE=function(c,a,b){if(!(c instanceof Array))return a(c);for(var e=[],f=0;f<c.length;f++)e.push(a(c[f]));return d.regexp.group(e.join("|"),b)};d.regexp.group=function(c,a){return"("+(a?"?:":"")+c+")"};return d.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(d){d.getObject("date.locale",true,d);(function(){function c(e,f,g,i){return i.replace(/([a-z])\1*/ig,function(k){var j,o,q=k.charAt(0);k=k.length;var v=["abbr","wide","narrow"];switch(q){case "G":j=f[k<4?"eraAbbr":"eraNames"][e.getFullYear()<0?0:1];break;case "y":j=e.getFullYear();switch(k){case 1:break;case 2:if(!g.fullYear){j=String(j);j=j.substr(j.length-
2);break}default:o=true}break;case "Q":case "q":j=Math.ceil((e.getMonth()+1)/3);o=true;break;case "M":j=e.getMonth();if(k<3){j=j+1;o=true}else{q=["months-format",v[k-3]].join("-");j=f[q][j]}break;case "w":j=d.date.locale._getWeekOfYear(e,0);o=true;break;case "d":j=e.getDate();o=true;break;case "D":j=d.date.locale._getDayOfYear(e);o=true;break;case "E":j=e.getDay();if(k<3){j=j+1;o=true}else{q=["days-format",v[k-3]].join("-");j=f[q][j]}break;case "a":j=e.getHours()<12?"am":"pm";j=g[j]||f["dayPeriods-format-wide-"+
j];break;case "h":case "H":case "K":case "k":o=e.getHours();switch(q){case "h":j=o%12||12;break;case "H":j=o;break;case "K":j=o%12;break;case "k":j=o||24;break}o=true;break;case "m":j=e.getMinutes();o=true;break;case "s":j=e.getSeconds();o=true;break;case "S":j=Math.round(e.getMilliseconds()*Math.pow(10,k-3));o=true;break;case "v":case "z":if(j=d.date.locale._getZone(e,true,g))break;k=4;case "Z":j=d.date.locale._getZone(e,false,g);j=[j<=0?"+":"-",d.string.pad(Math.floor(Math.abs(j)/60),2),d.string.pad(Math.abs(j)%
60,2)];if(k==4){j.splice(0,0,"GMT");j.splice(3,0,":")}j=j.join("");break;default:throw new Error("dojo.date.locale.format: invalid pattern char: "+i);}if(o)j=d.string.pad(j,k);return j})}function a(e,f,g,i){var k=function(q){return q};f=f||k;g=g||k;i=i||k;var j=e.match(/(''|[^'])+/g),o=e.charAt(0)=="'";d.forEach(j,function(q,v){if(q){j[v]=(o?g:f)(q.replace(/''/g,"'"));o=!o}else j[v]=""});return i(j.join(""))}function b(e,f,g,i){i=d.regexp.escapeString(i);g.strict||(i=i.replace(" a"," ?a"));return i.replace(/([a-z])\1*/ig,
function(k){var j;j=k.charAt(0);var o=k.length,q="",v="";if(g.strict){if(o>1)q="0{"+(o-1)+"}";if(o>2)v="0{"+(o-2)+"}"}else{q="0?";v="0{0,2}"}switch(j){case "y":j="\\d{2,4}";break;case "M":j=o>2?"\\S+?":"1[0-2]|"+q+"[1-9]";break;case "D":j="[12][0-9][0-9]|3[0-5][0-9]|36[0-6]|"+v+"[1-9][0-9]|"+q+"[1-9]";break;case "d":j="3[01]|[12]\\d|"+q+"[1-9]";break;case "w":j="[1-4][0-9]|5[0-3]|"+q+"[1-9]";break;case "E":j="\\S+";break;case "h":j="1[0-2]|"+q+"[1-9]";break;case "k":j="1[01]|"+q+"\\d";break;case "H":j=
"1\\d|2[0-3]|"+q+"\\d";break;case "K":j="1\\d|2[0-4]|"+q+"[1-9]";break;case "m":case "s":j="[0-5]\\d";break;case "S":j="\\d{"+o+"}";break;case "a":o=g.am||f["dayPeriods-format-wide-am"];q=g.pm||f["dayPeriods-format-wide-pm"];j=o+"|"+q;if(!g.strict){if(o!=o.toLowerCase())j+="|"+o.toLowerCase();if(q!=q.toLowerCase())j+="|"+q.toLowerCase();if(j.indexOf(".")!=-1)j+="|"+j.replace(/\./g,"")}j=j.replace(/\./g,"\\.");break;default:j=".*"}e&&e.push(k);return"("+j+")"}).replace(/[\xa0 ]/g,"[\\s\\xa0]")}d.date.locale._getZone=
function(e,f){return f?d.date.getTimezoneName(e):e.getTimezoneOffset()};d.date.locale.format=function(e,f){f=f||{};var g=d.i18n.normalizeLocale(f.locale),i=f.formatLength||"short";g=d.date.locale._getGregorianBundle(g);var k=[];e=d.hitch(this,c,e,g,f);if(f.selector=="year")return a(g["dateFormatItem-yyyy"]||"yyyy",e);var j;if(f.selector!="date")(j=f.timePattern||g["timeFormat-"+i])&&k.push(a(j,e));if(f.selector!="time")(j=f.datePattern||g["dateFormat-"+i])&&k.push(a(j,e));return k.length==1?k[0]:
g["dateTimeFormat-"+i].replace(/\{(\d+)\}/g,function(o,q){return k[q]})};d.date.locale.regexp=function(e){return d.date.locale._parseInfo(e).regexp};d.date.locale._parseInfo=function(e){e=e||{};var f=d.i18n.normalizeLocale(e.locale);f=d.date.locale._getGregorianBundle(f);var g=e.formatLength||"short",i=e.datePattern||f["dateFormat-"+g],k=e.timePattern||f["timeFormat-"+g];g=e.selector=="date"?i:e.selector=="time"?k:f["dateTimeFormat-"+g].replace(/\{(\d+)\}/g,function(o,q){return[k,i][q]});var j=[];
return{regexp:a(g,d.hitch(this,b,j,f,e)),tokens:j,bundle:f}};d.date.locale.parse=function(e,f){var g=/[\u200E\u200F\u202A\u202E]/g,i=d.date.locale._parseInfo(f),k=i.tokens,j=i.bundle;e=(new RegExp("^"+i.regexp.replace(g,"")+"$",i.strict?"":"i")).exec(e&&e.replace(g,""));if(!e)return null;var o=["abbr","wide","narrow"],q=[1970,0,1,0,0,0,0],v="";e=d.every(e,function(s,w){if(!w)return true;w=k[w-1];var z=w.length;switch(w.charAt(0)){case "y":if(z!=2&&f.strict)q[0]=s;else if(s<100){s=Number(s);z=""+(new Date).getFullYear();
w=z.substring(0,2)*100;z=Math.min(Number(z.substring(2,4))+20,99);q[0]=s<z?w+s:w-100+s}else{if(f.strict)return false;q[0]=s}break;case "M":if(z>2){w=j["months-format-"+o[z-3]].concat();if(!f.strict){s=s.replace(".","").toLowerCase();w=d.map(w,function(h){return h.replace(".","").toLowerCase()})}s=d.indexOf(w,s);if(s==-1)return false}else s--;q[1]=s;break;case "E":case "e":w=j["days-format-"+o[z-3]].concat();if(!f.strict){s=s.toLowerCase();w=d.map(w,function(h){return h.toLowerCase()})}s=d.indexOf(w,
s);if(s==-1)return false;break;case "D":q[1]=0;case "d":q[2]=s;break;case "a":w=f.am||j["dayPeriods-format-wide-am"];z=f.pm||j["dayPeriods-format-wide-pm"];if(!f.strict){var y=/\./g;s=s.replace(y,"").toLowerCase();w=w.replace(y,"").toLowerCase();z=z.replace(y,"").toLowerCase()}if(f.strict&&s!=w&&s!=z)return false;v=s==z?"p":s==w?"a":"";break;case "K":if(s==24)s=0;case "h":case "H":case "k":if(s>23)return false;q[3]=s;break;case "m":q[4]=s;break;case "s":q[5]=s;break;case "S":q[6]=s}return true});
g=+q[3];if(v==="p"&&g<12)q[3]=g+12;else if(v==="a"&&g==12)q[3]=0;g=new Date(q[0],q[1],q[2],q[3],q[4],q[5],q[6]);f.strict&&g.setFullYear(q[0]);var u=k.join("");i=u.indexOf("d")!=-1;u=u.indexOf("M")!=-1;if(!e||u&&g.getMonth()>q[1]||i&&g.getDate()>q[2])return null;if(u&&g.getMonth()<q[1]||i&&g.getDate()<q[2])g=d.date.add(g,"hour",1);return g}})();(function(){var c=[];d.date.locale.addCustomFormats=function(a,b){c.push({pkg:a,name:b})};d.date.locale._getGregorianBundle=function(a){var b={};d.forEach(c,
function(e){e=d.i18n.getLocalization(e.pkg,e.name,a);b=d.mixin(b,e)},this);return b}})();d.date.locale.addCustomFormats("dojo.cldr","gregorian");d.date.locale.getNames=function(c,a,b,e){var f;e=d.date.locale._getGregorianBundle(e);c=[c,b,a];if(b=="standAlone"){b=c.join("-");f=e[b];if(f[0]==1)f=undefined}c[1]="format";return(f||e[c.join("-")]).concat()};d.date.locale.isWeekend=function(c,a){a=d.cldr.supplemental.getWeekend(a);c=(c||new Date).getDay();if(a.end<a.start){a.end+=7;if(c<a.start)c+=7}return c>=
a.start&&c<=a.end};d.date.locale._getDayOfYear=function(c){return d.date.difference(new Date(c.getFullYear(),0,1,c.getHours()),c)+1};d.date.locale._getWeekOfYear=function(c,a){if(arguments.length==1)a=0;var b=(new Date(c.getFullYear(),0,1)).getDay(),e=(b-a+7)%7;e=Math.floor((d.date.locale._getDayOfYear(c)+e-1)/7);b==a&&e++;return e};return d.date.locale});
define("orion/auth",["dojo","dijit","orion/globalCommands","dojo/date/locale","orion/widgets/LoginDialog"],function(d,c,a){function b(g,i){if(g.status===403){if(typeof e==="undefined")e=new c.Dialog({title:"Forbidden access"});var k=g.message;if(g.responseText)k=JSON.parse(g.responseText).Message||g.message;e.set("content",k);e.show()}if(g.status===401)try{var j=JSON.parse(g.responseText),o=localStorage.getItem(j.SignInKey),q=function(){var u=localStorage.getItem(j.SignInKey);if(o!==u){window.removeEventListener("storage",
q,false);delete f[j.SignInKey];a.setPendingAuthentication(f);i&&i()}};window.addEventListener("storage",q,false);if(j.SignInKey){f[j.SignInKey]=j;a.setPendingAuthentication(f)}}catch(v){}}var e,f={};d.addOnLoad(function(){window.dojo=d;window.eclipse=window.eclipse||{};eclipse.globalCommandUtils=a});return{handleAuthenticationError:b}});
define("dojo/DeferredList",["dojo"],function(d){d.DeferredList=function(c,a,b,e){var f=[];d.Deferred.call(this);var g=this;c.length===0&&!a&&this.resolve([0,[]]);var i=0;d.forEach(c,function(k,j){function o(q,v){f[j]=[q,v];i++;i===c.length&&g.resolve(f)}k.then(function(q){a?g.resolve([j,q]):o(true,q)},function(q){b?g.reject(q):o(false,q);if(e)return null;throw q;})})};d.DeferredList.prototype=new d.Deferred;d.DeferredList.prototype.gatherResults=function(c){c=new d.DeferredList(c,false,true,false);
c.addCallback(function(a){var b=[];d.forEach(a,function(e){b.push(e[1])});return b});return c};return d.DeferredList});
define("orion/preferences",["require","dojo","orion/auth","dojo/DeferredList"],function(d,c,a){function b(j,o){this._name=j;this._providers=o;this._flushPending=false;this._cached=null;this._stores=[];this._dirty=[]}function e(j,o){return{get:function(q,v){if(o===0)return null;q=localStorage.getItem(j+q);if(q===null)return null;q=JSON.parse(q);if(v||o===-1||q._expires&&q._expires>(new Date).getTime()){delete q._expires;return q}return null},set:function(q,v){if(o!==0){if(o!==-1)v._expires=(new Date).getTime()+
1E3*o;if(Object.keys(v).length===0)localStorage.removeItem(j+q);else{var u=JSON.stringify(v);localStorage.setItem(j+q,u);delete v._expires}}},remove:function(q){localStorage.removeItem(j+q)}}}function f(j){this._currentPromises={};this._cache=new e("/orion/preferences/user",0);this._service=null;this.available=function(){var o=this;if(!this._service){var q=j.getServiceReferences("orion.core.preference.provider");q.length>0&&j.getService(q[0],0).then(function(v){o._service=v})}return!!this._service}}
function g(j){this._location=j;this._currentPromise=null;this._cache=new e("/orion/preferences/default",3600)}function i(){this._cache=new e("/orion/preferences/local",-1)}function k(j,o){this._userProvider=new f(j);this._localProvider=new i;o=o||"defaults.pref";if(o.indexOf("://")===-1)o=d.toUrl(o);this._defaultsProvider=new g(o);this._serviceRegistration=j.registerService("orion.core.preference",this)}b.prototype={_flush:function(){for(var j=[],o=0;o<this._stores.length;++o){var q=this._stores[o];
this._dirty.indexOf(q)!==-1&&j.push(this._providers[o].put(this._name,q))}this._dirty=[];return new c.DeferredList(j)},_scheduleFlush:function(j){this._dirty.indexOf(j)===-1&&this._dirty.push(j);if(!this._flushPending){this._flushPending=true;window.setTimeout(c.hitch(this,function(){if(this._flushPending){this._flushPending=false;this._flush()}}),0)}},_getCached:function(){if(!this._cached){this._cached={};for(var j=0;j<this._stores.length;++j){var o=this._stores[j];for(var q in o)if(o.hasOwnProperty(q)&&
typeof this._cached[q]==="undefined")this._cached[q]=o[q]}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(j){return this._getCached()[j]},put:function(j,o){if(this._stores.length!==0){var q=this._stores[0];if(q[j]!==o){q[j]=o;this._cached=null;this._scheduleFlush(q)}}},remove:function(j){for(var o=0;o<this._stores.length;++o){var q=this._stores[o];if(q.hasOwnProperty(j)){delete q[j];this._cached=null;this._scheduleFlush(q);return true}}return false},clear:function(){for(var j=
0;j<this._stores.length;++j){this._stores[j]={};this._scheduleFlush(this._stores[j])}this._cached=null},sync:function(j){if(this._flushPending){this._flushPending=false;return this._flush()}for(var o=this,q=[],v=0;v<this._providers.length;++v)q.push(this._providers[v].get(this._name,j).then(function(u){return function(s){o._stores[u]=s}}(v)));return(new c.DeferredList(q)).then(function(){o._cached=null;o._getCached()})},flush:function(){this._flush()}};f.prototype={get:function(j,o){if(this._currentPromises[j])return this._currentPromises[j];
var q=new c.Deferred,v=null;if(o)this._cache.remove(j);else v=this._cache.get(j);if(v!==null)q.resolve(v);else{this._currentPromises[j]=q;var u=this;this._service.get(j).then(function(s){u._cache.set(j,s);delete u._currentPromises[j];q.resolve(s)},function(s){if(s.status===401){delete u._currentPromises[j];q.resolve({});a.handleAuthenticationError(s,function(){u.get(j)})}else if(s.status===404){s={};u._cache.set(j,s);delete u._currentPromises[j];q.resolve(s)}else{delete u._currentPromises[j];q.resolve(u._cache.get(j,
true)||{})}})}return q},put:function(j,o){var q=new c.Deferred;this._cache.set(j,o);var v=this;this._service.put(j,o).then(function(){q.resolve()},function(u){u.status===401?a.handleAuthenticationError(u,function(){v._service.put(j,o).then(function(){q.resolve()},function(){q.resolve()})}):q.resolve()});return q}};g.prototype={get:function(j,o){if(this._currentPromise)return this._currentPromise;var q=new c.Deferred,v=null;if(o)this._cache.remove(j);else v=this._cache.get(j);if(v!==null)q.resolve(v);
else{this._currentPromise=q;var u=this;c.xhrGet({url:this._location,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(s){u._cache.set(j,s[j]||{});u._currentPromise=null;q.resolve(s[j]||{})},error:function(s,w){if(w.xhr.status===401){u._currentPromise=null;q.resolve({});q=new c.Deferred;u._currentPromise=q;var z=this;a.handleAuthenticationError(w.xhr,function(){c.xhrGet(z)})}else if(w.xhr.status===404){u._cache.set(j,{});u._currentPromise=null;q.resolve({})}else{u._currentPromise=
null;s=u._cache.get(j,true);s!==null?q.resolve(s[j]||{}):q.resolve({})}}})}return q},put:function(){var j=new c.Deferred;j.resolve();return j}};i.prototype={get:function(j){var o=new c.Deferred;j=this._cache.get(j);j!==null?o.resolve(j):o.resolve({});return o},put:function(j,o){var q=new c.Deferred;this._cache.set(j,o);q.resolve();return q}};k.DEFAULT_SCOPE=1;k.LOCAL_SCOPE=2;k.USER_SCOPE=4;k.prototype={getPreferences:function(j,o){if(!o||typeof o!=="number"||o>7||o<1)o=k.DEFAULT_SCOPE|k.LOCAL_SCOPE|
k.USER_SCOPE;var q=[];k.USER_SCOPE&o&&this._userProvider.available()&&q.push(this._userProvider);k.LOCAL_SCOPE&o&&q.push(this._localProvider);k.DEFAULT_SCOPE&o&&q.push(this._defaultsProvider);var v=new b(j,q);return v.sync().then(function(){return v})}};return{PreferencesService:k}});
define("orion/pluginregistry",["dojo","orion/serviceregistry","dojo/DeferredList"],function(d,c){var a=a||{};a.Plugin=function(b,e,f){function g(y,h,n,m){if(!q)throw new Error("plugin not connected");var l=s++;w[String(l)]=m;f.postMessage({id:l,serviceId:y,method:h,params:n},q)}function i(y){var h={};if(y.methods)for(var n=0;n<y.methods.length;n++){var m=y.methods[n];h[m]=function(l){return function(){var p=Array.prototype.slice.call(arguments),t=new d.Deferred;o._load().then(function(){g(y.serviceId,
l,p,t)});return t.promise}}(m)}return h}function k(){var y=e.services;if(y)for(var h=0;h<y.length;h++){var n=y[h],m=i(n);z[n.serviceId]=f.registerService(n.type,m,n.properties)}}function j(y){try{if(y.method)if("plugin"===y.method){if(e){if(JSON.stringify(e)!==JSON.stringify(y.params[0])){for(var h in z)if(z.hasOwnProperty(h)){z[h].unregister();delete z[h]}e=y.params[0];k();f.updatePlugin(o)}}else{e=y.params[0];k()}if(!u){u=true;v.resolve(o)}}else if("dispatchEvent"===y.method){var n=z[y.serviceId];
n.dispatchEvent.apply(n,y.params)}else if("progress"===y.method){var m=w[String(y.requestId)];m.progress.apply(m,y.params)}else throw new Error("Bad response method: "+y.method);else{m=w[String(y.id)];delete w[String(y.id)];y.error?m.reject(y.error):m.resolve(y.result)}}catch(l){console.log(l)}}var o=this,q=null,v=new d.Deferred,u=false,s=0,w={},z={};this.getLocation=function(){return b};this.getData=function(){return e};this.uninstall=function(){for(var y in z)if(z.hasOwnProperty(y)){z[y].unregister();
delete z[y]}if(q){f.disconnect(q);q=null}f.uninstallPlugin(this)};this.getServiceReferences=function(){var y=[],h;for(h in z)z.hasOwnProperty(h)&&y.push(z[h].getServiceReference());return y};this._load=function(y){if(!q){q=f.connect(b,j);window.setTimeout(function(){if(!u){if(!y){e={};f.updatePlugin(o)}v.reject(new Error("Load timeout for plugin: "+b))}},15E3)}return v.promise};if(typeof b!=="string")throw new Error("invalid url:"+b);e&&k()};a.PluginRegistry=function(b,e){function f(s){if(s.indexOf("://")===
-1){var w=document.createElement("a");w.href=s;return w.href}return s}function g(s){delete j["plugin."+s.getLocation()]}function i(s){s=f(s);for(var w=0,z=o.length;w<z;w++){var y=o[w];if(s===y.getLocation())return y}return null}function k(s){j["plugin."+s.getLocation()]=JSON.stringify(s.getData())}var j=e||localStorage||{},o=[],q=[],v=new c.EventTarget;window.addEventListener("message",function(s){for(var w=0,z=s.source;w<q.length;w++)if(z===q[w].target){if(typeof q[w].useStructuredClone==="undefined")q[w].useStructuredClone=
typeof s.data!=="string";q[w].handler(q[w].useStructuredClone?s.data:JSON.parse(s.data));break}},false);var u={registerService:d.hitch(b,b.registerService),connect:function(s,w){var z=document.createElement("iframe");z.id=s;z.name=s;z.style.display="none";z.style.visibility="hidden";z.src=s;document.body.appendChild(z);s={iframe:z,target:z.contentWindow,handler:w,url:s};q.push(s);return s},disconnect:function(s){for(var w=0;w<q.length;w++)if(s===q[w]){q.splice(w,1);try{document.body.removeChild(s.iframe)}catch(z){}break}},
uninstallPlugin:function(s){g(s);for(var w=0;w<o.length;w++)if(s===o[w]){o.splice(w,1);v.dispatchEvent("pluginRemoved",s);break}},updatePlugin:function(s){j["plugin."+s.getLocation()]=JSON.stringify(s.getData());v.dispatchEvent("pluginUpdated",s)},postMessage:function(s,w){w.target.postMessage(w.useStructuredClone?s:JSON.stringify(s),w.url)}};this.startup=function(s){for(var w=[],z=0;z<s.length;++z){var y=s[z];y=f(y);var h="plugin."+y;if(j[h]){if(i(y)===null){h=JSON.parse(j[h]);y=new a.Plugin(y,h,
u);o.push(y)}}else{j[h]="{}";y=new a.Plugin(y,{},u);o.push(y);w.push(y._load(false))}}return new d.DeferredList(w)};this.shutdown=function(){for(var s=0;s<q.length;s++)try{document.body.removeChild(q[s].iframe)}catch(w){}};this.installPlugin=function(s,w){s=f(s);var z=new d.Deferred,y=i(s);if(y)if(y.getData())z.resolve(y);else{var h=function(n){if(n.getLocation()===s){z.resolve(n);v.removeEventListener("pluginAdded",h)}};v.addEventListener("pluginAdded",h)}else{y=new a.Plugin(s,w,u);o.push(y);if(y.getData()){k(y);
v.dispatchEvent("pluginAdded",y);z.resolve(y)}else y._load(true).then(function(){k(y);v.dispatchEvent("pluginAdded",y);z.resolve(y)},function(n){z.reject(n)})}return z.promise};this.getPlugins=function(){for(var s=[],w=0;w<o.length;w++)o[w].getData()&&s.push(o[w]);return s};this.getPlugin=function(s){if((s=i(s))&&s.getData())return s;return null};this.addEventListener=function(s,w){v.addEventListener(s,w)};this.removeEventListener=function(s,w){v.removeEventListener(s,w)}};return a});
define("orion/bootstrap",["require","dojo","orion/serviceregistry","orion/preferences","orion/pluginregistry"],function(d,c,a,b,e){function f(){var g=new a.ServiceRegistry,i=new b.PreferencesService(g),k=new e.PluginRegistry(g);return i.getPreferences("/plugins").then(function(j){j=j.keys();for(var o=0;o<j.length;++o)if(j[o].indexOf("://")===-1)j[o]=d.toUrl(j[o]);return k.startup(j)}).then(function(){if(g.getServiceReferences("orion.core.preference.provider").length>0)return i.getPreferences("/plugins",
i.USER_SCOPE).then(function(j){j=j.keys();for(var o=0;o<j.length;++o)if(j[o].indexOf("://")===-1)j[o]=d.toUrl(j[o]);return k.startup(j)})}).then(function(){c.addOnWindowUnload(function(){k.shutdown()})}).then(function(){return{serviceRegistry:g,preferences:i,pluginRegistry:k}})}return{startup:f}});
define("orion/status",["require","dojo"],function(d,c){function a(b,e,f){this._serviceRegistry=b;this._serviceRegistration=b.registerService("orion.page.message",this);this.domId=e;this.progressDomId=f||e}a.prototype={setMessage:function(b,e){c.place(window.document.createTextNode(b),this.domId,"only");if(typeof e==="number"){var f=this;window.setTimeout(function(){var g=c.byId(f.domId);(typeof g.textContent==="string"?g.textContent:g.innerText)===b&&c.place(window.document.createTextNode(""),f.domId,
"only")},e)}},setErrorMessage:function(b){var e=b.responseText||b.message||b;try{e=JSON.parse(e)}catch(f){}b=e.Message||e;var g="red";if(e.Severity)switch(e.Severity){case "Warning":g="#FFCC00";break;case "Error":g="red";break;case "Info":case "Ok":g="green";break}e=c.create("span",{style:{color:g}});c.place(window.document.createTextNode(b),e);c.place(e,this.domId,"only")},setProgressMessage:function(b){c.place(window.document.createTextNode(b),this.progressDomId,"only")},setProgressResult:function(b){b=
b.responseText||b;try{b=JSON.parse(b)}catch(e){}var f=b.Message||b,g=d.toUrl("images/info.gif"),i="info";if(b.Severity)switch(b.Severity){case "Warning":g=d.toUrl("images/warning.gif");i="warning";break;case "Error":g=d.toUrl("images/error.gif");i="error";break}var k=new Image;k.alt=i;k.title="Press to clear message";k.name=i;k.src=g;c.style(k,"opacity","0.7");c.connect(k,"onmouseover",this,function(){c.style(k,"opacity","1")});c.connect(k,"onmouseout",this,function(){c.style(k,"opacity","0.7")});
c.connect(k,"onclick",this,function(){this.setProgressMessage("")});c.place(k,this.progressDomId,"only");b.HTML?c.place(f,this.progressDomId,"last"):c.place(window.document.createTextNode("   "+f),this.progressDomId,"last")},showWhile:function(b,e){var f=this;f.setProgressMessage(e);return b.then(function(g){if(g&&g.Location&&g.Message&&g.Running)return f._doProgressWhile(g);f.setProgressMessage("");g&&g.Result&&f.setProgressResult(g.Result);return g})},_doProgressWhile:function(b){var e=new c.Deferred;
window.setTimeout(function(){c.xhrGet({url:b.Location,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(f){e.callback(f)}})},2E3);return this.showWhile(e,b.Message)}};a.prototype.constructor=a;return{StatusReportingService:a}});
define("orion/fileClient",["dojo","orion/auth","dojo/DeferredList"],function(d,c){function a(f,g,i){var k=new d.Deferred;f[g].apply(f,i).then(function(j){k.callback(j)},function(j){j.status===401?c.handleAuthenticationError(j,function(){f[g].apply(f,i).then(function(o){k.callback(o)},function(o){k.errback(o)})}):k.errback(j)});return k}function b(f,g,i,k){if(!f.readBlob)throw"source file service does not support binary read";if(!i.writeBlob)throw"target file service does not support binary write";
if(g[g.length-1]!=="/")return a(f,"readBlob",[g]).then(function(q){return a(i,"writeBlob",[k,q])});var j=k.substring(0,k.length-1),o=decodeURIComponent(j.substring(j.lastIndexOf("/")+1));j=j.substring(0,j.lastIndexOf("/")+1);return a(i,"createFolder",[j,o]).then(function(){},function(){}).then(function(){if(g.indexOf("/")===0)g+="?depth=1";return a(f,"fetchChildren",[g]).then(function(q){for(var v=[],u=0;u<q.length;++u){var s=q[u].Location,w=s;if(q[u].Directory)w=s.substring(0,s.length-1);w=decodeURIComponent(w.substring(w.lastIndexOf("/")+
1));w=k+encodeURIComponent(w);if(q[u].Directory)w+="/";v[u]=b(f,s,i,w)}return new d.DeferredList(v)})})}function e(f,g){function i(z){var y=new d.Deferred;y.reject("No Matching FileService for location:"+z);return y}var k=f.getServiceReferences("orion.core.file"),j=k;if(g){j=[];for(var o=0;o<k.length;++o)g(k[o])&&j.push(k[o])}for(var q=[],v=[],u=[],s={fetchChildren:function(){var z=new d.Deferred;z.resolve(u);return z},createWorkspace:function(){var z=new d.Deferred;z.reject("no file service");return z},
loadWorkspaces:function(){var z=new d.Deferred;z.reject("no file service");return z},loadWorkspace:function(){var z=new d.Deferred;z.resolve({Directory:true,Length:0,LocalTimeStamp:0,Name:"",Location:"",Children:u});return z},createProject:i,createFolder:i,createFile:i,deleteFile:i,moveFile:i,copyFile:i,read:i,write:i},w=0;w<j.length;++w){u[w]={Directory:true,Length:0,LocalTimeStamp:0,Location:j[w].getProperty("top"),ChildrenLocation:j[w].getProperty("top"),Name:j[w].getProperty("Name")};g=j[w].getProperty("pattern")||
".*";if(g[0]!=="^")g="^"+g;q[w]=new RegExp(g);f.getService(j[w],0).then(function(z){v[w]=z})}if(v.length===1)s=v[0];this._getService=function(z){if(!z)return s;for(var y=0;y<q.length;++y)if(q[y].test(z))return v[y];throw"No Matching FileService for location:"+z;}}e.prototype={fetchChildren:function(f){return a(this._getService(f),"fetchChildren",arguments)},createWorkspace:function(){return a(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return a(this._getService(),"loadWorkspaces",
arguments)},loadWorkspace:function(f){return a(this._getService(f),"loadWorkspace",arguments)},createProject:function(f){return a(this._getService(f),"createProject",arguments)},createFolder:function(f){return a(this._getService(f),"createFolder",arguments)},createFile:function(f){return a(this._getService(f),"createFile",arguments)},deleteFile:function(f){return a(this._getService(f),"deleteFile",arguments)},moveFile:function(f,g,i){var k=this._getService(f),j=this._getService(g);if(k===j)return a(k,
"moveFile",arguments);var o=f[f.length-1]==="/",q=g;if(q[q.length-1]!=="/")q+="/";if(i)q+=encodeURIComponent(i);else{var v=f;if(o)v=v.substring(0,v.length-1);q+=v.substring(v.lastIndexOf("/")+1)}if(o&&q[q.length-1]!=="/")q+="/";return b(k,f,j,q).then(function(){return a(k,"deleteFile",[f])})},copyFile:function(f,g){var i=this._getService(f),k=this._getService(g);if(i===k)return a(i,"copyFile",arguments);var j=f[f.length-1]==="/",o=g;if(o[o.length-1]!=="/")o+="/";var q=f;if(j)q=q.substring(0,q.length-
1);o+=q.substring(q.lastIndexOf("/")+1);if(j&&o[o.length-1]!=="/")o+="/";return b(i,f,k,o)},read:function(f){return a(this._getService(f),"read",arguments)},write:function(f){return a(this._getService(f),"write",arguments)},remoteImport:function(f){return a(this._getService(f),"remoteImport",arguments)},remoteExport:function(f){return a(this._getService(f),"remoteExport",arguments)}};e.prototype.constructor=e;return{FileClient:e}});
define("orion/treetable",["dojo"],function(d){function c(a){this._init(a)}c.prototype={_init:function(a){var b=a.parent,e=this;if(typeof b==="string")b=d.byId(b);if(!b)throw"no parent";if(!a.model)throw"no tree model";if(!a.renderer)throw"no renderer";this._parent=b;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(f){if(this._showRoot){f._depth=0;this._generate([f],0)}else e._treeModel.getChildren(f,function(g){e._generate(g,0)})})},_generate:function(a,b){d.empty(this._parent);var e=document.createElement("table");e.id=this._id;this._renderer.initTable(e,this);var f=document.createElement("tbody");f.id=this._id+"tbody";this._generateChildren(a,b,f,"last");e.appendChild(f);this._parent.appendChild(e);this._rowsChanged()},_generateChildren:function(a,
b,e,f){for(var g in a){var i=document.createElement("tr");i.id=this._treeModel.getId(a[g]);i._depth=b;i._item=a[g];this._renderer.render(a[g],i);d.style(i.childNodes[this._labelColumnIndex],"paddingLeft",this._indent*b+"px");d.place(i,e,f);if(f==="after")e=i}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(a,b,e,f,g,i){var k=this._treeModel.getId(a),j;if(k===this._id){this._removeChildRows(k);
this._generateChildren(b,0,d.byId(k+"tbody"),"last");this._rowsChanged()}else{var o=d.byId(k);if(o){o._item=a;if(o&&(e||o._expanded)){o._expanded=true;this._removeChildRows(k);if(b){this._generateChildren(b,o._depth+1,o,"after");this._rowsChanged();if(f&&g){a=d.byId(f);d.addClass(a,g);i&&d.removeClass(a,i)}}else{j=this;b=this._treeModel.getChildren(o._item,function(q){j._generateChildren(q,o._depth+1,o,"after");j._rowsChanged()})}}}else console.log("could not find table row "+k)}},refreshAndExpand:function(a,
b,e,f,g){this.refresh(a,b,true,e,f,g)},getItem:function(a){if(typeof a==="string"){var b=d.byId(a);if(b)return b._item}if(a._item)return a._item;return a},toggle:function(a,b,e,f){var g=d.byId(a);if(g)if(g._expanded){this.collapse(a);if(b){a=d.byId(b);d.addClass(a,f);d.removeClass(a,e)}}else{this.expand(a);if(b){a=d.byId(b);d.addClass(a,e);d.removeClass(a,f)}}},isExpanded:function(a){if(a=d.byId(a))return a._expanded;return false},expand:function(a,b,e){a=typeof a==="string"?a:this._treeModel.getId(a);
var f=d.byId(a);if(f)if(!f._expanded){f._expanded=true;var g=this;this._treeModel.getChildren(f._item,function(i){g._generateChildren(i,f._depth+1,f,"after");g._rowsChanged();b&&b.apply(this,e)})}},_removeChildRows:function(a){d.byId(this._id);var b=a===this._id,e=false,f=-1,g=[];d.query(".treeTableRow").forEach(function(j){if(!e)if(b)if(j._depth>f)g.push(j);else e=true;else if(j.id===a){b=true;f=j._depth}});for(var i in g){var k=g[i];k.parentNode.removeChild(k)}},collapse:function(a){a=typeof a===
"string"?a:this._treeModel.getId(a);var b=d.byId(a);if(b)if(b._expanded){b._expanded=false;this._removeChildRows(a);this._rowsChanged()}}};c.prototype.constructor=c;return{TableTree:c}});
define("orion/explorer",["require","dojo","orion/treetable"],function(d,c,a){var b={};b.Explorer=function(){function e(f,g,i){this.registry=f;this.renderer=i;this.selection=g;this.myTree=null}e.prototype={changedItem:function(f,g){c.hitch(this.myTree,this.myTree.refreshAndExpand)(f,g)},updateCommands:function(f){this.myTree&&c.hitch(this.myTree._renderer,this.myTree._renderer.updateCommands(f))},makeNewItemPlaceHolder:function(f,g,i){f=this.getRow(f);if(i){f=f.childNodes[i];c.place("<br><span id='"+
g+"placeHolderRow'></span>",f,"last");if(i=c.byId(g+"placeHolderRow"))return{tempNode:i,refNode:i}}if(f){c.place("<tr id='"+g+"placeHolderRow'><td id='"+g+"placeHolderCol'></td>",f,"after");i=c.byId(g+"placeHolderRow");f=c.byId(g+"placeHolderCol");if(i&&f)return{tempNode:i,refNode:f}}return null},getRow:function(f){if(f=this.model.getId(f))return c.byId(f)},createTree:function(f,g){var i=f+"innerTree",k=c.byId(i);k&&c.destroy(k);if(g)g.rootId=i;this.model=g;this.myTree=new a.TableTree({id:i,model:g,
showRoot:false,parent:f,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 e}();b.ExplorerModel=function(){function e(f,g){this.rootPath=f;this.fetchItems=g}e.prototype={destroy:function(){},getRoot:function(f){this.fetchItems(this.rootPath).then(c.hitch(this,function(g){this.root=g;f(g)}))},getChildren:function(f,
g){if(f.Children)g(f.Children);else f.ChildrenLocation?this.fetchItems(f.ChildrenLocation).then(c.hitch(this,function(i){f.Children=i;g(i)})):g([])},getId:function(f){if(f===this.root)f=this.rootId;else{f=f.Location;f=f.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")}return f}};return e}();b.ExplorerFlatModel=function(){function e(f,g,i){this.rootPath=f;this.fetchItems=g;this.root=i}e.prototype=new b.ExplorerModel;e.prototype.getRoot=function(f){this.root?f(this.root):this.fetchItems(this.rootPath).then(c.hitch(this,
function(g){this.root=g;f(g)}))};e.prototype.getChildren=function(f,g){f===this.root?g(this.root):g([])};return e}();b.ExplorerRenderer=function(){function e(f,g){this.explorer=g;this._init(f);this._expandImageClass="core-sprite-twistie_open";this._collapseImageClass="core-sprite-twistie_closed"}e.prototype={initTable:function(f,g){this.tableTree=g;c.empty(f);c.addClass(f,"treetable");this.renderTableHeader(f)},getActionsColumn:function(f,g){c.connect(g,"onmouseover",g,function(){var j=c.byId(this.id+
"actionswrapper");c.style(j,"visibility","visible")});c.connect(g,"onmouseout",g,function(){var j=c.byId(this.id+"actionswrapper");c.style(j,"visibility","hidden")});var i=document.createElement("td");i.id=g.id+"actions";var k=document.createElement("span");k.id=g.id+"actionswrapper";i.appendChild(k);c.style(k,"visibility","hidden");this.explorer.registry.getService("orion.page.command").then(function(j){j.renderCommands(k,"object",f,this.explorer,"image")});return i},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},
getCheckboxColumn:function(f,g){if(this._useCheckboxSelection){f=document.createElement("td");c.addClass(f,"secondaryColumn");var i=document.createElement("input");c.style(i,"verticalAlign","middle");i.type="checkbox";i.id=g.id+"selectedState";c.addClass(i,"selectionCheckmark");i.itemId=g.id;f.appendChild(i);c.connect(i,"onclick",c.hitch(this,function(k){c.toggleClass(g,"checkedRow",!!k.target.checked);this._storeSelections();this.explorer.selection&&this.explorer.selection.setSelections(this.getSelected())}));
return f}},_storeSelections:function(){var f=this.getSelectedIds(),g=this._getUIStatePreferencePath();if(g&&window.sessionStorage)window.sessionStorage[g+"selection"]=JSON.stringify(f)},_restoreSelections:function(f){f=window.sessionStorage[f+"selection"];if(typeof f==="string")f=f.length>0?JSON.parse(f):null;var g;if(f)for(g=0;g<f.length;g++){var i=c.byId(f[g]);if(i){c.addClass(i,"checkedRow");if(i=c.byId(i.id+"selectedState"))i.checked=true}}f=this.getSelected();this.explorer.selection&&this.explorer.selection.setSelections(f)},
_storeExpansions:function(f){window.sessionStorage[f+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(f){var g=false,i=window.sessionStorage[f+"expanded"];if(typeof i==="string")i=i.length>0?JSON.parse(i):null;var k;if(i)for(k=0;k<i.length;k++)if(c.byId(i[k])){this._expanded.push(i[k]);this.tableTree.expand(i[k],c.hitch(this,function(){this._restoreSelections(f)}));g=true}return!g},_getUIStatePreferencePath:function(){if(this.explorer){var f=this.explorer.getRootPath();if(this._cachePrefix&&
f)return"/"+this._cachePrefix+"/"+f.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")+"/uiState"}return null},expandCollapseImageId:function(f){return f+"__expand"},getExpandImage:function(f,g,i,k){var j=c.create("span",{id:this.expandCollapseImageId(f.id)},g,"last");c.addClass(j,"imageSprite");c.addClass(j,this._collapseImageClass);g=c.create("span",null,g,"last");c.addClass(g,k||"imageSprite");c.addClass(g,i||"core-sprite-folder");j.onclick=c.hitch(this,function(){this.tableTree.toggle(f.id,this.expandCollapseImageId(f.id),
this._expandImageClass,this._collapseImageClass);if(this.tableTree.isExpanded(f.id))this._expanded.push(f.id);else for(var o in this._expanded)if(this._expanded[o]===f.id){this._expanded.splice(o,1);break}(o=this._getUIStatePreferencePath())&&window.sessionStorage&&this._storeExpansions(o)});return j},render:function(f,g){g.cellSpacing="8px";this.renderRow(f,g)},getSelected:function(){var f=[];c.query(".selectionCheckmark").forEach(c.hitch(this,function(g){g.checked&&f.push(this.tableTree.getItem(g.parentNode.parentNode))}));
return f},getSelectedIds:function(){var f=[];c.query(".selectionCheckmark").forEach(c.hitch(this,function(g){g.checked&&f.push(g.parentNode.parentNode.id)}));return f},rowsChanged:function(){c.query(".treeTableRow").forEach(function(f,g){if(g%2){c.addClass(f,"darkTreeTableRow");c.removeClass(f,"lightTreeTableRow")}else{c.addClass(f,"lightTreeTableRow");c.removeClass(f,"darkTreeTableRow")}});this.explorer.selection&&this.explorer.selection.setSelections(this.getSelected())},updateCommands:function(){var f=
this.explorer.registry;c.query(".treeTableRow").forEach(function(g){var i=c.byId(g.id+"actionswrapper");c.empty(i);f.getService("orion.page.command").then(function(k){k.renderCommands(i,"object",g._item,this.explorer,"image")})})},_init:function(f){if(f){this._useCheckboxSelection=f.checkbox===undefined?false:f.checkbox;this._colums=f.colums||[];this._cachePrefix=f.cachePrefix}},_initializeUIState:function(){this._expanded=[];var f=this._getUIStatePreferencePath();f&&window.sessionStorage&&this._restoreExpansions(f)&&
this._restoreSelections(f)}};return e}();b.SelectionRenderer=function(){function e(f,g){this._init(f);this.explorer=g}e.prototype=new b.ExplorerRenderer;e.prototype.renderTableHeader=function(f){var g=document.createElement("thead"),i=document.createElement("tr");c.addClass(g,"navTableHeading");this._useCheckboxSelection&&i.appendChild(this.initCheckboxColumn(f));for(var k=0,j=this.getCellHeaderElement(k);j;){c.addClass(j,"navColumn");i.appendChild(j);j=this.getCellHeaderElement(++k)}g.appendChild(i);
f.appendChild(g)};e.prototype.renderRow=function(f,g){c.style(g,"verticalAlign","baseline");c.addClass(g,"treeTableRow");var i=this.getCheckboxColumn(f,g);i&&g.appendChild(i);i=0;for(var k=this.getCellElement(i,f,g);k;){g.appendChild(k);c.addClass(k,"secondaryColumn");k=this.getCellElement(++i,f,g)}};e.prototype.getCellHeaderElement=function(){};e.prototype.getCellElement=function(){};return e}();return b});
define("orion/searchExplorer",["require","dojo","dijit","orion/explorer","orion/util","orion/fileClient","orion/commands"],function(d,c,a,b,e,f,g){function i(o,q,v,u,s){this.registry=o;this.fileClient=q;this._resultLocation=v;this.searchStr=u.toLowerCase();this._treeRoot={isRoot:true,children:[]};this._listRoot={isRoot:true,children:[]};this.indexedFileItems=this.currentDetail=null;this.modelLocHash=[];this._lineDelimiter="\n";this.explorer=s}function k(o,q){this._init(o);this.explorer=q}function j(o,
q,v,u,s){this.parentNode=u;this.registry=o;this._commandService=q;this.fileClient=new f.FileClient(this.registry);this.checkbox=false;this.renderer=new k({checkbox:false},this);this.model=new i(o,this.fileClient,v,s,this)}i.prototype=new b.ExplorerModel;i.prototype.setCurrent=function(o,q){this.currentFileIndex=o;this.currentDetailIndex=q;this.storeStatus()};i.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)};i.prototype.restoreStatus=function(){this.useFlatList=false;var o=window.sessionStorage[this.searchStr+"_search_result_useFlatList"];if(typeof o==="string")if(o.length>0)this.useFlatList=JSON.parse(o);this.currentFileIndex=0;o=window.sessionStorage[this.searchStr+"_search_result_currentFileIndex"];if(typeof o===
"string")if(o.length>0)this.currentFileIndex=JSON.parse(o);if(this.currentFileIndex<0||this.currentFileIndex>=this.indexedFileItems.length)this.currentFileIndex=0;this.currentDetailIndex=0;o=window.sessionStorage[this.searchStr+"_search_result_currentDetailIndex"];if(typeof o==="string")if(o.length>0)this.currentDetailIndex=JSON.parse(o)};i.prototype.getRealRoot=function(){return this.useFlatList?this._listRoot:this._treeRoot};i.prototype.getRoot=function(o){o(this.getRealRoot())};i.prototype.markUpSharedParent=
function(o,q){if(this.sharedParentHash[o.Location]){var v=this.sharedParentHash[o.Location];if(typeof v==="string")if(v!==q)this.sharedParentHash[o.Location]=2}else this.sharedParentHash[o.Location]=q};i.prototype.preparecompressHash=function(){this.sharedParentHash=[];for(var o=0;o<this._resultLocation.length;o++){var q=this._resultLocation[o].metaData.Parents;if(q.length!==0)for(var v=this._resultLocation[o].location,u=0;u<q.length;u++){var s=q[u];this.markUpSharedParent(s,v);v=s.Location}}};i.prototype.compressParents=
function(o,q,v){if(o.length!==0)if(!(q>o.length-1)){var u=o[q].Name,s=o[q].Location,w=q+1,z=false;if(w<o.length)for(q=q+1;q<o.length;q++){w=q;if(this.sharedParentHash[o[q].Location]===2)break;else{u=o[q].Name+"/"+u;if(q===o.length-1)z=true}}v.push({Location:s,Name:u});z||this.compressParents(o,w,v)}};i.prototype.compressTree=function(){for(var o=0;o<this._resultLocation.length;o++)if(this._resultLocation[o].metaData){var q=this._resultLocation[o].metaData.Parents;if(q.length!==0){this.preparecompressHash();
var v=[];this.compressParents(q,0,v);this._resultLocation[o].metaData.compressedParents=v}}};i.prototype._findExistingParent=function(o,q){var v=this.modelLocHash[o[q].Location];if(v)return{parent:v,index:q};if(q===o.length-1)return null;return this._findExistingParent(o,q+1)};i.prototype.fullPathName=function(o,q){if(o&&o.parent)if(!o.parent.isRoot){q.name=o.parent.name+(q.name===""?"":"/")+q.name;o.parent&&this.fullPathName(o.parent,q)}};i.prototype.buildResultModelTree=function(o,q){q&&this.compressTree();
for(var v=0;v<this._resultLocation.length;v++)if(this._resultLocation[v].metaData){var u;u=q?this._resultLocation[v].metaData.compressedParents:this._resultLocation[v].metaData.Parents;var s=this._findExistingParent(u,0),w;if(s){w=s.parent;s=s.index}else{w=this._treeRoot;s=u.length}if(s>0)for(s=s-1;s>-1;s--){var z={parent:w,children:[],type:"dir",name:u[s].Name,location:u[s].Location};w.children.push(z);e.processSearchResultParent(w);w=this.modelLocHash[u[s].Location]=z}u={name:""};s={parent:w,type:"file",
name:this._resultLocation[v].name,linkLocation:this._resultLocation[v].linkLocation,location:this._resultLocation[v].location};this.fullPathName(s,u);s.fullPathName=u.name;this.modelLocHash[s.location]=s;w.children.push(s);e.processSearchResultParent(w)}this.prepareFileItems();this.restoreStatus();o()};i.prototype.loadOneFileMetaData=function(o,q){var v=this._resultLocation[o];this.fileClient.read(v.location,true).then(c.hitch(this,function(u){v.metaData=u;o===this._resultLocation.length-1?this.buildResultModelTree(q,
true):this.loadOneFileMetaData(o+1,q)}),c.hitch(this,function(u){console.error("Error loading file metadata: "+u.message);o===this._resultLocation.length-1?this.buildResultModelTree(q,true):this.loadOneFileMetaData(o+1,q)}))};i.prototype.prepareFileItems=function(){this.indexedFileItems=[];this.walkTreeNode(this._treeRoot);for(var o=0;o<this.indexedFileItems.length;o++)this._listRoot.children.push(this.indexedFileItems[o])};i.prototype.getFileItemIndex=function(o){for(var q=0;q<this.indexedFileItems.length;q++)if(o===
this.indexedFileItems[q])return q;return-1};i.prototype.getFileDetailItemIndex=function(o,q){if(o<0)return-1;o=this.indexedFileItems[o];if(o.children&&o.children.length>0)for(var v=0;v<o.children.length;v++)if(q===o.children[v])return v;return-1};i.prototype.walkTreeNode=function(o){if(o.children)for(var q=0;q<o.children.length;q++)this.walkTreeNode(o.children[q]);else o.type==="file"&&this.indexedFileItems.push(o)};i.prototype.getId=function(o){if(o===this.getRealRoot())o=this.rootId;else{o=o.location;
o=o.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")}return o};i.prototype.searchOneline=function(o,q){var v;v=0;for(var u=false,s=[];;){v=o.indexOf(q,v);if(v<0)break;else{s.push({startIndex:v});u=true;v=v+q.length}}if(u)return s;return null};i.prototype.searchWithinFile=function(o,q,v){q=q.split(this._lineDelimiter);if(o){o.children=[];for(var u=0;u<q.length;u++){var s=q[u];if(s&&s.length>0)if(this.searchOneline(s.toLowerCase(),v)){var w=u+1;o.children.push({parent:o,type:"detail",name:w+" : "+s,linkLocation:o.linkLocation+
"?line="+w,location:o.location+"-"+w})}}o.name=o.name+" ("+o.children.length+" matches)"}};i.prototype._fileExpanded=function(o,q){o=this.indexedFileItems[o];if(o.children&&o.children.length>0){if(q<0)q=o.children.length-1;else if(q>=o.children.length)q=0;return{childrenNumber:o.children.length,childDiv:c.byId(this.getId(o.children[q]))}}return{childrenNumber:0,childDiv:null}};i.prototype.getChildren=function(o,q){if(o.children)q(o.children);else if(o.type==="detail")q([]);else o.type==="file"&&o.location?
this.fileClient.read(o.location).then(c.hitch(this,function(v){this.searchWithinFile(o,v,this.searchStr);v=this.getId(o);if(c.byId(v))(v=c.byId(v+"NameColumn"))&&c.place(document.createTextNode(o.name),v,"only");q(o.children);if(this.highlightSelectionLater)if(o===this.indexedFileItems[this.currentFileIndex]){if(this.currentDetailIndex<0)this.currentDetailIndex=o.children.length-1;else if(this.currentDetailIndex>=o.children.length)this.currentDetailIndex=0;v=this._fileExpanded(this.currentFileIndex,
this.currentDetailIndex);c.toggleClass(v.childDiv,"currentSearchMatch",true);this.explorer.visible(v.childDiv)||v.childDiv.scrollIntoView(!this.lastNavDirection);this.highlightSelectionLater=false}}),c.hitch(this,function(v){console.error("Error loading file content: "+v.message);q([])})):q([])};i.prototype.constructor=i;k.prototype=new b.SelectionRenderer;k.prototype.getCellHeaderElement=function(o){if(o===0)return c.create("th",{innerHTML:"<h2>Search Results</h2>"});else if(this.explorer.model.useFlatList&&
o===1)return c.create("th",{innerHTML:"<h2>Location</h2>"})};k.prototype.getCellElement=function(o,q,v){switch(o){case 0:var u;if(q.type==="dir"){o=document.createElement("td");u=c.create("span",null,o,"only");this.getExpandImage(v,u);v=c.create("span",{id:v.id+"NameColumn"},u,"last")}else{o=document.createElement("td");var s=q.linkLocation;u=c.create("span",null,o,"only");if(q.type==="file")this.getExpandImage(v,u,"core-sprite-file");else{var w=this;c.connect(v,"onclick",v,function(){var y=w.explorer.model.getFileItemIndex(q.parent);
if(y>-1){var h=w.explorer.model.getFileDetailItemIndex(y,q);if(h>-1)if(!(w.explorer.model.currentFileIndex===y&&w.explorer.model.currentDetailIndex===h)){var n=w.explorer.model._fileExpanded(w.explorer.model.currentFileIndex,w.explorer.model.currentDetailIndex);n.childDiv&&c.toggleClass(n.childDiv,"currentSearchMatch",false);w.explorer.model.setCurrent(y,h);n=w.explorer.model._fileExpanded(w.explorer.model.currentFileIndex,w.explorer.model.currentDetailIndex);c.toggleClass(n.childDiv,"currentSearchMatch",
true)}}});var z=c.create("span",null,u,"last");c.addClass(z,"imageSprite");c.addClass(z,"core-sprite-none");z=c.create("span",null,u,"last");c.addClass(z,"imageSprite");c.addClass(z,"core-sprite-rightarrow")}v=c.create("a",{className:"navlink",id:v.id+"NameColumn",href:s},u,"last")}c.place(document.createTextNode(q.name),v,"only");return o;case 1:if(this.explorer.model.useFlatList&&q.type==="file"){o=document.createElement("td");u=c.create("span",null,o,"only");c.place(document.createTextNode(q.fullPathName),
u,"only");return o}}};k.prototype.constructor=k;j.prototype=new b.Explorer;j.prototype.onchange=function(){};j.prototype.initCommands=function(){var o=this,q=new g.Command({name:"Next result",imageClass:"core-sprite-move_down",id:"orion.search.nextResult",groupId:"orion.searchGroup",callback:function(){o.gotoNext(true,true)}}),v=new g.Command({name:"Previous result",imageClass:"core-sprite-move_up",id:"orion.search.prevResult",groupId:"orion.searchGroup",callback:function(){o.gotoNext(false,true)}}),
u=new g.Command({name:"Expand all results",imageClass:"core-sprite-expandAll",id:"orion.search.expandAll",groupId:"orion.searchGroup",callback:function(){o.expandAll()}}),s=new g.Command({name:"Collapse all results",imageClass:"core-sprite-collapseAll",id:"orion.search.collapseAll",groupId:"orion.searchGroup",callback:function(){o.collapseAll()}});this._commandService.addCommand(q,"dom");this._commandService.addCommand(v,"dom");this._commandService.addCommand(u,"dom");this._commandService.addCommand(s,
"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");c.empty("pageActionsRight");this._commandService.renderCommands("pageActionsRight","dom",o,o,"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:o.model.useFlatList,onChange:function(w){o.switchTo(w)}}));q=new a.form.DropDownButton({label:"Options",dropDown:q});c.addClass(q.domNode,"commandImage");c.place(q.domNode,"pageActionsRight","last")};j.prototype.startUp=function(){var o=this;this.model.loadOneFileMetaData(0,function(){o.initCommands();o.createTree(o.parentNode,o.model);o.gotoCurrent()})};j.prototype.switchTo=
function(o){this.model.useFlatList=o;this.model.storeStatus();this.createTree(this.parentNode,this.model);this.gotoCurrent()};j.prototype.expandAll=function(){var o=this.model.getRealRoot();if(o.isRoot)for(var q=0;q<o.children.length;q++)this.expandRecursively(o.children[q]);else this.expandRecursively(o);this.gotoCurrent()};j.prototype.collapseAll=function(){var o=this.model.getRealRoot();if(o.isRoot)for(var q=0;q<o.children.length;q++)this.myTree.collapse(o.children[q]);else this.myTree.collapse(o)};
j.prototype.expandRecursively=function(o){if(o.type!=="detail"){this.myTree.expand(o);o=o.children;if(!(o===undefined||o===null))for(var q=o.length,v=0;v<q;v++)this.expandRecursively(o[v])}};j.prototype.findUIParentChain=function(o,q){q.push(o);var v=this.model.getId(o);if(c.byId(v))return q;this.findUIParentChain(o.parent,q)};j.prototype._decideNext=function(o,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){o=o?this.model.currentDetailIndex+1:this.model.currentDetailIndex-1;if(o<0){q=this.model.currentFileIndex-1;o=-1}else if(o>q.children.length-1){q=this.model.currentFileIndex+1;o=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:o}}return null};j.prototype.visible=function(o){if(o.offsetWidth===0||o.offsetHeight===0)return false;var q=c.byId("orion.innerSearchResults").getClientRects()[0];
o=o.getClientRects();for(var v=0,u=o.length;v<u;v++){var s=o[v];if(s.top>=q.top&&s.top<=q.bottom&&s.bottom>=q.top&&s.bottom<=q.bottom)return true}return false};j.prototype.gotoCurrent=function(){this.gotoNext(true,false)};j.prototype.gotoNext=function(o,q){var v=this.model._fileExpanded(this.model.currentFileIndex,this.model.currentDetailIndex);v.childDiv&&c.toggleClass(v.childDiv,"currentSearchMatch",false);q=this._decideNext(o,q);this.model.highlightSelectionLater=true;this.model.lastNavDirection=
o;if(q){v=this.model._fileExpanded(q.newFileIndex,q.newDetailIndex);this.model.setCurrent(q.newFileIndex,q.newDetailIndex);if(v.childrenNumber>0){this.model.highlightSelectionLater=false;if(q.newDetailIndex<0)this.model.setCurrent(q.newFileIndex,v.childrenNumber-1);else q.newDetailIndex>=v.childrenNumber&&this.model.setCurrent(q.newFileIndex,0)}if(v.childDiv){c.toggleClass(v.childDiv,"currentSearchMatch",true);this.visible(v.childDiv)||v.childDiv.scrollIntoView(!o);return}}q=[];this.findUIParentChain(this.model.indexedFileItems[this.model.currentFileIndex],
q);for(v=q.length-1;v>-1;v--)this.myTree.expand(q[v]);if(!this.model.highlightSelectionLater){q=this.model._fileExpanded(this.model.currentFileIndex,this.model.currentDetailIndex);c.toggleClass(q.childDiv,"currentSearchMatch",true);this.visible(q.childDiv)||q.childDiv.scrollIntoView(!o)}};j.prototype.constructor=j;return{SearchResultExplorer:j}});
define("dojo/cookie",["dojo","dojo/regexp"],function(d){d.cookie=function(c,a,b){var e=document.cookie;if(arguments.length==1){var f=e.match(new RegExp("(?:^|; )"+d.regexp.escapeString(c)+"=([^;]*)"));return f?decodeURIComponent(f[1]):undefined}else{b=b||{};e=b.expires;if(typeof e=="number"){var g=new Date;g.setTime(g.getTime()+e*24*60*60*1E3);e=b.expires=g}if(e&&e.toUTCString)b.expires=e.toUTCString();a=encodeURIComponent(a);e=c+"="+a;for(f in b){e+="; "+f;g=b[f];if(g!==true)e+="="+g}document.cookie=
e}};d.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 d.cookie});
define("dijit/layout/BorderContainer",["dojo","dijit","dijit/layout/_LayoutWidget","dojo/cookie","dijit/_Templated"],function(d,c){d.declare("dijit.layout.BorderContainer",c.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){d.forEach(this.getChildren(),
this._setupChild,this);this.inherited(arguments)}},_setupChild:function(a){var b=a.region;if(b){this.inherited(arguments);d.addClass(a.domNode,this.baseClass+"Pane");var e=this.isLeftToRight();if(b=="leading")b=e?"left":"right";if(b=="trailing")b=e?"right":"left";if(b!="center"&&(a.splitter||this.gutters)&&!a._splitterWidget){var f=d.getObject(a.splitter?this._splitterClass:"dijit.layout._Gutter");e=new f({id:a.id+"_splitter",container:this,child:a,region:b,live:this.liveSplitters});e.isSplitter=
true;a._splitterWidget=e;d.place(e.domNode,a.domNode,"after");e.startup()}a.region=b}},layout:function(){this._layoutChildren()},addChild:function(){this.inherited(arguments);this._started&&this.layout()},removeChild:function(a){var b=a.region,e=a._splitterWidget;if(e){e.destroy();delete a._splitterWidget}this.inherited(arguments);this._started&&this._layoutChildren();d.removeClass(a.domNode,this.baseClass+"Pane");d.style(a.domNode,{top:"auto",bottom:"auto",left:"auto",right:"auto",position:"static"});
d.style(a.domNode,b=="top"||b=="bottom"?"width":"height","auto")},getChildren:function(){return d.filter(this.inherited(arguments),function(a){return!a.isSplitter})},getSplitter:function(a){return d.filter(this.getChildren(),function(b){return b.region==a})[0]._splitterWidget},resize:function(){if(!this.cs||!this.pe){var a=this.domNode;this.cs=d.getComputedStyle(a);this.pe=d._getPadExtents(a,this.cs);this.pe.r=d._toPixelValue(a,this.cs.paddingRight);this.pe.b=d._toPixelValue(a,this.cs.paddingBottom);
d.style(a,"padding","0px")}this.inherited(arguments)},_layoutChildren:function(a,b){if(this._borderBox&&this._borderBox.h){var e=d.map(this.getChildren(),function(g,i){return{pane:g,weight:[g.region=="center"?Infinity:0,g.layoutPriority,(this.design=="sidebar"?1:-1)*(/top|bottom/.test(g.region)?1:-1),i]}},this);e.sort(function(g,i){g=g.weight;i=i.weight;for(var k=0;k<g.length;k++)if(g[k]!=i[k])return g[k]-i[k];return 0});var f=[];d.forEach(e,function(g){g=g.pane;f.push(g);g._splitterWidget&&f.push(g._splitterWidget)});
c.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},f,a,b)}},destroyRecursive:function(){d.forEach(this.getChildren(),function(a){var b=a._splitterWidget;b&&b.destroy();delete a._splitterWidget});this.inherited(arguments)}});d.extend(c._Widget,{region:"",layoutPriority:0,splitter:false,minSize:0,maxSize:Infinity});d.declare("dijit.layout._Splitter",[c._Widget,c._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);d.addClass(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V"));if(this.container.persist){var a=d.cookie(this._cookieName);if(a)this.child.domNode.style[this.horizontal?"height":"width"]=a}},_computeMaxSize:function(){var a=this.horizontal?"h":
"w",b=d.marginBox(this.child.domNode)[a],e=d.filter(this.container.getChildren(),function(f){return f.region=="center"})[0];a=d.marginBox(e.domNode)[a];return Math.min(this.child.maxSize,b+a)},_startDrag:function(a){if(!this.cover){this.cover=d.doc.createElement("div");d.addClass(this.cover,"dijitSplitterCover");d.place(this.cover,this.child.domNode,"after")}d.addClass(this.cover,"dijitSplitterCoverActive");this.fake&&d.destroy(this.fake);if(!(this._resize=this.live)){(this.fake=this.domNode.cloneNode(true)).removeAttribute("id");
d.addClass(this.domNode,"dijitSplitterShadow");d.place(this.fake,this.domNode,"after")}d.addClass(this.domNode,"dijitSplitterActive dijitSplitter"+(this.horizontal?"H":"V")+"Active");if(this.fake)d.removeClass(this.fake,"dijitSplitterHover dijitSplitter"+(this.horizontal?"H":"V")+"Hover");var b=this._factor,e=this.horizontal,f=e?"pageY":"pageX",g=a[f],i=this.domNode.style;e=e?"h":"w";var k=d.marginBox(this.child.domNode)[e],j=this._computeMaxSize(),o=this.child.minSize||20;e=this.region;var q=e==
"top"||e=="bottom"?"top":"left",v=parseInt(i[q],10),u=this._resize,s=d.hitch(this.container,"_layoutChildren",this.child.id);e=d.doc;this._handlers=(this._handlers||[]).concat([d.connect(e,"onmousemove",this._drag=function(w,z){w=w[f]-g;var y=b*w+k,h=Math.max(Math.min(y,j),o);if(u||z)s(h);i[q]=w+v+b*(h-y)+"px"}),d.connect(e,"ondragstart",d.stopEvent),d.connect(d.body(),"onselectstart",d.stopEvent),d.connect(e,"onmouseup",this,"_stopDrag")]);d.stopEvent(a)},_onMouse:function(a){a=a.type=="mouseover"||
a.type=="mouseenter";d.toggleClass(this.domNode,"dijitSplitterHover",a);d.toggleClass(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V")+"Hover",a)},_stopDrag:function(a){try{this.cover&&d.removeClass(this.cover,"dijitSplitterCoverActive");this.fake&&d.destroy(this.fake);d.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)d.cookie(this._cookieName,
this.child.domNode.style[this.horizontal?"height":"width"],{expires:365})},_cleanupHandlers:function(){d.forEach(this._handlers,d.disconnect);delete this._handlers},_onKeyPress:function(a){this._resize=true;var b=this.horizontal,e=1,f=d.keys;switch(a.charOrCode){case b?f.UP_ARROW:f.LEFT_ARROW:e*=-1;case b?f.DOWN_ARROW:f.RIGHT_ARROW:break;default:return}b=d._getMarginSize(this.child.domNode)[b?"h":"w"]+this._factor*e;this.container._layoutChildren(this.child.id,Math.max(Math.min(b,this._computeMaxSize()),
this.child.minSize));d.stopEvent(a)},destroy:function(){this._cleanupHandlers();delete this.child;delete this.container;delete this.cover;delete this.fake;this.inherited(arguments)}});d.declare("dijit.layout._Gutter",[c._Widget,c._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);d.addClass(this.domNode,"dijitGutter"+
(this.horizontal?"H":"V"))}});return c.layout.BorderContainer});
define("orion/searchClient",["require","dojo","dijit","orion/auth","orion/util","orion/searchExplorer","dijit/form/Button","dijit/layout/BorderContainer","dijit/layout/ContentPane"],function(d,c,a,b,e,f){function g(i){this.registry=i.serviceRegistry;this._commandService=i.commandService}g.prototype={search:function(i,k,j,o,q,v,u){c.xhrGet({url:k,handleAs:"json",headers:{Accept:"application/json","Orion-Version":"1"},sync:false,timeout:15E3,error:function(s,w){var z=this;b.handleAuthenticationError(w.xhr,
function(){c.xhrGet(z)})},load:c.hitch(this,function(s){this.showSearchResult(i,k,j,o,q,v,u,s)})})},handleError:function(i,k){console.error(i);var j=document.createTextNode(i);c.place(j,k,"only");return i},saveSearch:function(i,k){this.registry.getService("orion.core.favorite").then(function(j){j.addFavoriteSearch(i,k)})},createSearchQuery:function(i,k,j){if(j){k=/\*$/.test(j)?"":"*";return i+"Name:"+this._luceneEscape(j,true)+k}return i+this._luceneEscape(k)},_luceneEscape:function(i,k){var j="";
k='+-&|!(){}[]^"~:\\'+(!k?"*?":"");for(var o=0;o<i.length;o++){var q=i.charAt(o);if(k.indexOf(q)>=0)j+="\\";j+=q}return j},formatHighlight:function(i){i=i.split(/(##match|match##)/);for(var k=c.create("div"),j,o=0;o<i.length;o++){var q=i[o];if(q==="##match")j=c.create("b");else if(q==="match##"){c.place(j,k,"last");j=null}else c.place(document.createTextNode(q),j||k,"last")}return k},showSearchResult:function(i,k,j,o,q,v,u,s){u?this.showSearchResultInList(i,k,j,o,q,v,s):this.showSearchResultInTree(i,
k,j,o,q,v,s)},showSearchResultInTree:function(i,k,j,o,q,v,u){window.location.href.split("#");v=false;var s=[];c.empty(i);o=u.responseHeader.params.q;o=o.substring(o.indexOf("}")+1);if(u.response.numFound>0){for(var w=0;w<u.response.docs.length;w++){var z=u.response.docs[w];if(!z.Directory&&z.Location!==j){v||(v=true);var y;y=o&&z.LineNumber?e.hashFromPosition(z.Location,null,null,z.LineNumber,z.Offset,o.length):z.Location;s.push({linkLocation:d.toUrl("edit/edit.html")+"#"+y,location:y,name:z.Name})}}typeof q===
"function"&&q(i)}if(v)(new f.SearchResultExplorer(this.registry,this._commandService,s,i,k.split("q=")[1])).startUp();else{i=c.place("<div>No matches found for </div>",i,"only");i=c.create("b",null,i,"last");c.place(document.createTextNode(o),i,"only")}},showSearchResultInList:function(i,k,j,o,q,v,u){window.location.href.split("#");var s=false;c.empty(i);k=u.responseHeader.params.q;k=k.substring(k.indexOf("}")+1);if(u.response.numFound>0){for(var w=document.createElement("table"),z=0;z<u.response.docs.length;z++){var y=
u.response.docs[z];if(!y.Directory&&y.Location!==j){var h;if(!s){s=true;if(o){h=w.insertRow(0).insertCell(0);h.innerHTML="<h2>Search Results</h2>"}}h=w.insertRow(-1).insertCell(0);h.colspan=2;var n=document.createElement("a");c.place(document.createTextNode(y.Name),n);y.LineNumber&&c.place(document.createTextNode(" (Line "+y.LineNumber+")"),n);var m;m=k&&y.LineNumber?e.hashFromPosition(y.Location,null,null,y.LineNumber,y.Offset,k.length):y.Location;n.setAttribute("href",d.toUrl("edit/edit.html")+
"#"+m);h.appendChild(n);if(!v&&u.highlighting&&u.highlighting[y.Id]&&u.highlighting[y.Id].Text){y=u.highlighting[y.Id].Text[0];h=w.insertRow(-1).insertCell(0);h.colspan=2;c.place(this.formatHighlight(y),h,"only")}}}c.place(w,i,"last");typeof q==="function"&&q(i)}if(!s){i=c.place("<div>No matches found for </div>",i,"only");i=c.create("b",null,i,"last");c.place(document.createTextNode(k),i,"only")}}};g.prototype.constructor=g;return{Searcher:g}});
define("orion/compare/compare-features",["dojo","dijit","dijit/layout/ContentPane","dijit/layout/BorderContainer"],function(d,c){var a=a||{};a.CompareMergeUIFactory=function(){function b(e){this._parentDivID=e.parentDivID;this._showTitle=e.showTitle;this._showLineStatus=e.showLineStatus}b.prototype={_createNoWrapTextDiv:function(e,f,g,i){var k=document.createElement("table");k.width="100%";var j=document.createElement("tr");k.appendChild(j);var o=document.createElement("td");o.noWrap=true;if(g)o.align=
g;j.appendChild(o);g=document.createElement("h2");g.id=e;d.place(document.createTextNode(f),g,"only");o.appendChild(g);if(i){o=document.createElement("td");o.id="rightContainerCommands";j.appendChild(o);o.noWrap=true;j.align="right";k.align="right"}return k},_createEditorParentDiv:function(e){e=new c.layout.ContentPane({id:e,region:"center"});d.addClass(e.domNode,"paneScrolled");d.addClass(e.domNode,"compareEditorParent");return e},_createCompareCanvasDiv:function(e){var f=new c.layout.ContentPane({region:"leading",
splitter:false});d.addClass(f.domNode,"canvasContainer");var g=document.createElement("canvas");g.id=e;g.width=46;g.height=3E3;d.toggleClass(g,"compareCanvas",true);f.attr("content",g);f.startup();return f},_appendDomNode:function(e,f){f.placeAt(e)},_createTileDiv:function(e,f){e=this._createNoWrapTextDiv(e,"Compare...",null,f);f=new c.layout.ContentPane({region:"top"});d.addClass(f.domNode,"titleContainer");f.attr("content",e);return f},_createStatusDiv:function(e){e=this._createNoWrapTextDiv(e,
"Line Status","center");var f=new c.layout.ContentPane({region:"bottom"});d.addClass(f.domNode,"statusContainer");f.attr("content",e);return f},_createLeftEditorParentDiv:function(e,f){return this._createEditorParentDiv(e,f)},_createRightEditorParentDiv:function(e,f){var g=new c.layout.BorderContainer({region:"center",gutters:false,design:"headline",liveSplitters:false,persist:false,splitter:false});d.addClass(g.domNode,"borderContainer");this._appendDomNode(g,this._createCompareCanvasDiv(f));this._appendDomNode(g,
this._createEditorParentDiv(e));g.startup();return g},_createLeftBorder:function(){var e=new c.layout.BorderContainer({region:"leading",gutters:false,design:"headline",liveSplitters:true,persist:false,splitter:true});d.addClass(e.domNode,"leftBorder");if(this._showTitle){this._leftTitleDivId=this._parentDivID+"_left_title_id";this._appendDomNode(e,this._createTileDiv(this._leftTitleDivId))}this._leftEditorParentDivId=this._parentDivID+"_left_editor_id";this._appendDomNode(e,this._createLeftEditorParentDiv(this._leftEditorParentDivId));
if(this._showLineStatus){this._leftStatusDivId=this._parentDivID+"_left_status_id";this._appendDomNode(e,this._createStatusDiv(this._leftStatusDivId))}e.startup();return e},_createRightBorder:function(){var e=new c.layout.BorderContainer({region:"center",gutters:false,design:"headline",liveSplitters:false,persist:false,splitter:false});d.addClass(e.domNode,"rightBorder");if(this._showTitle){this._rightTitleDivId=this._parentDivID+"_right_title_id";this._appendDomNode(e,this._createTileDiv(this._rightTitleDivId,
true))}this._rightEditorParentDivId=this._parentDivID+"_right_editor_id";this._diffCanvasDivId=this._parentDivID+"_diff_canvas_id";this._appendDomNode(e,this._createRightEditorParentDiv(this._rightEditorParentDivId,this._diffCanvasDivId));if(this._showLineStatus){this._rightStatusDivId=this._parentDivID+"_right_status_id";this._appendDomNode(e,this._createStatusDiv(this._rightStatusDivId))}e.startup();return e},buildUI:function(){var e=this._createLeftBorder(),f=this._createRightBorder(),g=c.byId(this._parentDivID);
g.addChild(e);g.addChild(f)},getEditorParentDivId:function(e){return e?this._leftEditorParentDivId:this._rightEditorParentDivId},getTitleDivId:function(e){return e?this._leftTitleDivId:this._rightTitleDivId},getStatusDivId:function(e){return e?this._leftStatusDivId:this._rightStatusDivId},getDiffCanvasDivId:function(){return this._diffCanvasDivId}};return b}();return a});
define("orion/compare/diff-provider",["dojo","orion/auth"],function(d,c){function a(f,g,i){var k=new d.Deferred;f[g].apply(f,i).then(function(j){k.callback(j)},function(j){j.status===401||j.status===403?c.handleAuthenticationError(j,function(){f[g].apply(f,i).then(function(o){k.callback(o)},function(o){k.errback(o)})}):k.errback(j)});return k}function b(f){if(f.indexOf("://")===-1){var g=document.createElement("a");g.href=f;return g.href}return f}function e(f,g){var i=f.getServiceReferences("orion.core.diff"),
k=i;if(g){k=[];for(var j=0;j<i.length;++j)g(i[j])&&k.push(i[j])}var o=[],q=[];for(j=0;j<k.length;++j){o[j]=new RegExp(k[j].getProperty("pattern")||".*");f.getService(k[j],0).then(function(v){q[j]=v})}this._getService=function(v){v=b(v);for(var u=0;u<o.length;++u)if(o[u].test(v))return q[u];throw"No Matching DiffService for location:"+v;}}e.prototype={getDiffContent:function(f){return a(this._getService(f),"getDiffContent",arguments)},getDiffFileURI:function(f){return a(this._getService(f),"getDiffFileURI",
arguments)}};return{DiffProvider:e}});
define("orion/compare/diff-parser",[],function(){var d=d||{};d.DiffParser=function(){function c(b){this._lineDelimiter=b?b:a?"\r\n":"\n"}var a=navigator.platform.indexOf("Win")!==-1;c.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(b){this._lineDelimiter=b},getDiffArray:function(){return{array:this._diffContents,
index:this._diffContentIndex}},parse:function(b,e,f,g){this._init();if(e==="")return{outPutFile:b,mapper:[]};this._oFileContents=b===""?[]:b.split(this._lineDelimiter);this._diffContents=e.split(this._lineDelimiter);e=this._diffContents.length;this._hunkRanges=[];for(var i=0;i<e;i++){var k=this._parseHunkRange(i);k&&this._hunkRanges.push(k)}if(0===this._hunkRanges.length)return{outPutFile:b,mapper:[]};for(b=0;b<this._hunkRanges.length;b++)this._parsehunkBlock(b);this._buildMap(f);if(g===undefined||
!g)this._buildNewFile();return{outPutFile:this._nFileContents.join(this._lineDelimiter),mapper:this._deltaMap}},_logMap:function(){for(var b=0;b<this._deltaMap.length;b++)console.log(JSON.stringify(this._deltaMap[b]))},_logNewFile:function(){for(var b=0;b<this._nFileContents.length;b++)console.log(this._nFileContents[b])},_createBlock:function(b,e,f,g){if(!(g===f&&b===" ")){f=[f,g-f,"s"];if(b==="-")f[2]="r";else if(b==="+")f[2]="a";else if(b==="c")f[2]="c";e.push(f)}},_createMinusBlock:function(b,
e,f){var g=this._oBlocks.length;if(g===0||b!==this._oBlocks[g-1][0]){this._oBlocks.push([b===0?1:b,f]);this._nBlocks.push([e,0,-2])}else this._oBlocks[g-1][1]+=f},_createPlusBlock:function(b,e,f,g){var i=this._nBlocks.length;if(i===0||e!==this._nBlocks[i-1][0]){this._oBlocks.push([b===0?1:b,0]);this._nBlocks.push([e,f,g])}else{this._nBlocks[i-1][1]+=f;this._nBlocks[i-1][2]=g}},_parsehunkBlock:function(b){for(var e=" ",f=this._hunkRanges[b][0]+1,g=b===this._hunkRanges.length-1?this._diffContents.length:
this._hunkRanges[b+1][0],i=0,k=0,j=this._hunkRanges[b][1],o=this._hunkRanges[b][3],q=f,v=f;v<g;v++)if(0!==this._diffContents[v].length){var u=this._diffContents[v][0];if(u==="\\")if("\\ No newline at end of file"===this._diffContents[v].substring(0,this._diffContents[v].length-1)||"\\ No newline at end of file"===this._diffContents[v]){e==="-"?(this._oNewLineAtEnd=false):(this._nNewLineAtEnd=false);if(v>f&&"\r"===this._diffContents[v-1].substring(this._diffContents[v-1].length-1))this._diffContents[v-
1]=this._diffContents[v-1].substring(0,this._diffContents[v-1].length-1);continue}switch(u){case "-":case "+":case " ":break;default:continue}if(e!==u){if(u==="+")q=v;switch(e){case " ":j=this._hunkRanges[b][1]+i;o=this._hunkRanges[b][3]+k;break;case "-":this._createMinusBlock(j,o,this._hunkRanges[b][1]+i-j);break;case "+":this._createPlusBlock(j,o,this._hunkRanges[b][3]+k-o,q);break;default:}e=u}switch(u){case "-":i++;break;case "+":k++;break;case " ":i++;k++;break}}switch(e){case "-":this._createMinusBlock(j,
o,this._hunkRanges[b][1]+i-j);break;case "+":this._createPlusBlock(j,o,this._hunkRanges[b][3]+k-o,q);break}},_detectConflictes:function(b,e){if(b<0)return false;e=b+e;for(b=b;b<e;b++){var f=this._diffContents[b];if(f.indexOf("<<<<<")>-1||f.indexOf(">>>>>")>-1)return true}return false},_buildMap:function(b){for(var e=this._oBlocks.length,f=this._oFileContents.length,g=0,i=1,k=0;k<e;k++){i=this._oBlocks[k][0]-i;if(i>0){this._deltaMap.push([i,i,0]);g+=i}b&&this._detectConflictes(this._nBlocks[k][2],
this._nBlocks[k][1])?this._deltaMap.push([this._nBlocks[k][1],this._oBlocks[k][1],this._nBlocks[k][2]+1,1]):this._deltaMap.push([this._nBlocks[k][1],this._oBlocks[k][1],this._nBlocks[k][2]+1]);g+=this._oBlocks[k][1];i=this._oBlocks[k][0]+this._oBlocks[k][1]}if(0<f-i){this._deltaMap.push([f-i+1,f-i+1,0]);g+=f-i+1}if(g<f){i=f-g;b=this._deltaMap[this._deltaMap.length-1];if(b[2]===0){b[0]+=i;b[1]+=i}else if(b[2]===-1)this._deltaMap.push([i,i,0]);else b[1]+=i}},_buildNewFile:function(){for(var b=1,e=false,
f=this._deltaMap.length,g=0;g<f;g++){e=false;if(this._deltaMap[g][2]===0){for(var i=0;i<this._deltaMap[g][0];i++)this._nFileContents.push(this._oFileContents[b+i-1]);e=true}else if(this._deltaMap[g][2]>0)for(i=0;i<this._deltaMap[g][0];i++)this._nFileContents.push(this._diffContents[this._deltaMap[g][2]+i-1].substring(1));b+=this._deltaMap[g][1]}if(this._nNewLineAtEnd&&!e){this._nFileContents.push("");this._deltaMap[f-1][0]+=1}},_parseHRangeBody:function(b,e){if(0<b.indexOf(",")){b=b.split(",");e.push(parseInt(b[0]));
e.push(parseInt(b[1]))}else{e.push(parseInt(b));e.push(1)}},_parseHunkRange:function(b){var e=this._diffContents[b];if(!(8>e.length))if("@@"===e.substring(0,2)){e=e.substring(2);var f=e.indexOf("@@");if(!(f<0)){e=e.substring(0,f);f=e.indexOf("-");var g=e.indexOf("+");if(!(f<0||g<0)){b=[b];if(f<g){e=e.substring(f+1).split("+");this._parseHRangeBody(e[0],b);this._parseHRangeBody(e[1],b)}else{e=e.substring(g+1).split("-");this._parseHRangeBody(e[1],b);this._parseHRangeBody(e[0],b)}return b}}}}};return c}();
return d});
define("orion/compare/compareUtils",[],function(){var d=d||{};d.compareUtils=d.compareUtils||{};d.compareUtils.lookUpMapper=function(c,a,b){for(var e=0,f=0;f<c.length;f++){var g=c[f][a];if(g===0)g=1;if(b>=e&&b<e+g)return{mapperIndex:f,startFrom:e};if(f===c.length-1)break;e+=c[f][a]}return{mapperIndex:c.length-1,startFrom:e}};d.compareUtils.lookUpLineIndex=function(c,a,b){if(b===0)return 0;for(var e=0,f=0;f<b;f++)e+=c[f][a];return e};d.compareUtils.updateMapper=function(c,a,b,e,f){if(e!==f)if(e>0||
f>0){var g=d.compareUtils.lookUpMapper(c,a,b);if(!(g.mapperIndex<0)){if(e>0){e=e;var i=b-g.startFrom;for(b=g.mapperIndex;b<c.length;b++){i=c[b][a]-i;if(e<=i){c[b][a]-=e;break}c[b][a]-=i;e-=i;i=0}}if(f>0)c[g.mapperIndex][a]+=f}}};d.compareUtils.overlapMapper=function(c,a,b,e,f){c=b+c[a]-1;if(c<b)c=b;if(f<e)f=e;if(c<e||f<b)return false;return true};d.compareUtils.findFirstDiff=function(c,a,b,e){for(var f=0,g=undefined,i=0;i<c.length;i++){if(f>e)break;if(d.compareUtils.overlapMapper(c[i],a,f,b,e)){g=
{mapperIndex:i,startFrom:f};if(c[i][2]!==0)break}f+=c[i][a]}return g};d.compareUtils.matchMapper=function(c,a,b,e){if(c.length===0)return b;var f=b+Math.round((e-b)/3),g=d.compareUtils.findFirstDiff(c,a,b,e),i=c[g.mapperIndex][a]===0?g.startFrom:g.startFrom+c[g.mapperIndex][a]-1,k=d.compareUtils.lookUpLineIndex(c,1-a,g.mapperIndex),j=g.startFrom-b;if(c[g.mapperIndex][2]===0)return k-j;if(f>=g.startFrom&&f<=i)return k-Math.round((e-b)/3);if(f<g.startFrom)return k-j;return(c[g.mapperIndex][1-a]===0?
k:k+c[g.mapperIndex][1-a]-1)-(i-b)};d.compareUtils.getMapperLineCount=function(c){for(var a=0,b=0;b<c.length;b++)a+=Math.max(c[b][0],c[b][1]);return a};d.compareUtils.findNextDiff=function(c,a){var b=0;if(a>=0&&a<c.length-1)b=a+1;for(var e=b;e<c.length;e++)if(c[e][2]!==0)return e;for(e=0;e<b;e++)if(c[e][2]!==0)return e;return a};d.compareUtils.getAnnotationIndex=function(c,a){for(var b=0;b<c.length;b++)if(c[b][0]===a)return b;return-1};d.compareUtils.getAnnotationMapperIndex=function(c,a){return c[a][1]};
d.compareUtils.getAnnotationIndexByMapper=function(c,a){for(var b=0;b<c.length;b++)if(c[b][1]===a)return{current:b,prev:b-1,next:b+1};return{current:-1,prev:-1,next:-1}};d.compareUtils.isMapperConflict=function(c,a){if(a<0)return false;if(!c[a][3])return false;return c[a][3]===1};return d.compareUtils});
define("orion/compare/rulers",["orion/compare/compareUtils"],function(d){var c=c||{};c.CompareRuler=function(){function a(b,e,f){this._location=b||"left";this._overview=e||"page";this._rulerStyle=f;this._editor=null}a.prototype={setView:function(b){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this,this._onModelChanged);this._editor=b;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(b,e){var f=[];for(b=b;b<e;b++)f[b]={html:this.getHTML(b),style:this.getStyle(b)};return f},getWidestAnnotation:function(){return{html:this.getHTML(-1),style:this.getStyle(-1)}},getRulerStyle:function(){return this.getStyle(undefined)}};return a}();
c.LineNumberCompareRuler=function(){function a(b,e,f,g,i){c.CompareRuler.call(this,e,"page",f);this._oddStyle=g||{style:{backgroundColor:"white"}};this._evenStyle=i||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=b}a.prototype=new c.CompareRuler;a.prototype.getStyle=function(b){return b===undefined?this._rulerStyle:this._evenStyle};a.prototype.getHTML=function(b){var e=this._editor.getModel();if(b===-1)return e.getLineCount();else{if(e.getLineNumber){b=e.getLineNumber(b,
this._mapperColumnIndex);if(b===-1)return"";return b+1}return b+1}};a.prototype._onModelChanged=function(b){b=b.start;var e=this._editor.getModel(),f=e.getLineCount(),g=(f+"").length;if(this._numOfDigits!==g){this._numOfDigits=g;this._editor.redrawLines(e.getLineAtOffset(b),f,this)}};return a}();c.CompareAnnotation=function(){function a(){this._currentAnnotationIndex=0}a.prototype={init:function(b,e){this._mapper=b;this._editor=e;this._currentAnnotationIndex=0},getCurrentAnnotationIndex:function(){return this._currentAnnotationIndex},
getCurrentMapperIndex:function(){var b=this._editor.getModel().getAnnotations();return b.length===0?-1:b[this._currentAnnotationIndex][1]},matchPositionFromAnnotation:function(b){var e=b;if(b===-1)e=0;else{e=this._editor.getModel();e=d.getAnnotationIndex(e.getAnnotations(),b)}this._currentAnnotationIndex=e},gotoDiff:function(b){this._currentAnnotationIndex=b},nextDiff:function(){var b=this._editor.getModel().getAnnotations();if(b.length!==0)if(b.length-1===this._currentAnnotationIndex)this._currentAnnotationIndex=
0;else this._currentAnnotationIndex+=1},prevDiff:function(){var b=this._editor.getModel().getAnnotations();if(b.length!==0)if(0===this._currentAnnotationIndex)this._currentAnnotationIndex=b.length-1;else this._currentAnnotationIndex-=1}};return a}();c.CompareOverviewRuler=function(){function a(b,e){c.CompareRuler.call(this,b,"document",e)}a.prototype=new c.CompareRuler;a.prototype.getStyle=function(b){var e,f;if(b===undefined){e=this._rulerStyle||{};f=e.style||(e.style={});f.lineHeight="1px";f.fontSize=
"1px";f.width="14px"}else{e=b!==-1?{styleClass:"ruler_annotation_breakpoint_overview"}:{};f=e.style||(e.style={});f.cursor="pointer";f.width="8px";f.left="2px";var g=this._editor.getModel();if(b>=0&&g.getAnnotationH){b=g.getAnnotationH(b);g=g.getLineCount();var i=this._editor.getClientArea();b=Math.floor(i.height*b/g);if(b<2)b=2;f.height=b+"px"}else f.height="3px"}return e};a.prototype.getHTML=function(){return"&nbsp;"};a.prototype.onClick=function(b){if(b!==undefined){var e=this._editor.getLineHeight(),
f=this._editor.getClientArea();e=Math.floor(f.height/e/3);this._editor.setTopIndex(b-e>0?b-e:0)}};a.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return a}();c.CompareMergeOverviewRuler=function(){function a(b,e,f,g){this._compareAnnotaion=f;this._onClick=g;c.CompareRuler.call(this,b,"document",e)}a.prototype=new c.CompareRuler;a.prototype.getStyle=function(b){var e,f;if(b===undefined){e=this._rulerStyle||{};f=e.style||(e.style=
{});f.lineHeight="1px";f.fontSize="1px";f.width="14px"}else{e=b!==-1?{styleClass:"ruler_annotation_breakpoint_overview"}:{};f=e.style||(e.style={});f.cursor="pointer";f.width="8px";f.left="2px";var g=this._editor.getModel();if(b>=0&&g.getAnnotationH){b=d.getAnnotationIndex(g.getAnnotations(),b);if(b===-1)return{};var i=d.getAnnotationMapperIndex(g.getAnnotations(),b);if(i=d.isMapperConflict(g.getMapper(),i))f.border="1px #FF0000 solid";if(b===this._compareAnnotaion.getCurrentAnnotationIndex())f.backgroundColor=
i?"red":"blue";b=g.getAnnotationH(b);g=g.getAnnotationLineCount();i=this._editor.getClientArea();g=Math.floor(i.height*b/g);if(g<2)g=2;f.height=g+"px"}else f.height="3px"}return e};a.prototype.getHTML=function(){return"&nbsp;"};a.prototype.onClick=function(b){b!==undefined&&this._onClick(b,this)};a.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return a}();c.CompareMatchRenderer=function(){function a(b){this._canvasDiv=b;this._mapper=
undefined;this._annotation=new c.CompareAnnotation}a.prototype={init:function(b,e,f){this._mapper=b;this._leftEditor=e;this._rightEditor=f;this._annotation.init(b,f);this.render()},getAnnotation:function(){return this._annotation},getCurrentAnnotationIndex:function(){return this._annotation.getCurrentAnnotationIndex()},getCurrentMapperIndex:function(){return this._annotation.getCurrentMapperIndex()},setOverviewRuler:function(b){this._overviewRuler=b},_setEditorPosition:function(b,e){var f=b.getLineHeight(),
g=b.getClientArea();f=Math.floor(g.height/f/3);b.setTopIndex(e-f>0?e-f:0)},_findBaseLine:function(b){var e=b.getLineHeight(),f=b.getClientArea();e=Math.floor(f.height/e/3);return b.getTopIndex()+e},matchPositionFrom:function(b){var e=b?this._leftEditor:this._rightEditor,f=b?this._rightEditor:this._leftEditor,g=e.getTopIndex();e=e.getBottomIndex();b=d.matchMapper(this._mapper,b?0:1,g,e);f.setTopIndex(b)},matchPositionFromAnnotation:function(b){this._annotation.matchPositionFromAnnotation(b);this.positionAnnotation(this._annotation.getCurrentAnnotationIndex())},
positionAnnotation:function(b){var e=this._rightEditor.getModel().getAnnotations();if(e.length!==0){this._setEditorPosition(this._rightEditor,e[b][0]);this._setEditorPosition(this._leftEditor,this._leftEditor.getModel().getLineIndexFromMapper(e[b][1]));this._leftEditor.redrawRange();this._rightEditor.redrawRange();b=this._rightEditor.getTopIndex();this._rightEditor.redrawLines(b,b+1,this._overviewRuler)}},gotoDiff:function(b){this._annotation.gotoDiff(b);b=this._rightEditor.getTopIndex();this._leftEditor.redrawRange();
this._rightEditor.redrawRange();this._rightEditor.redrawLines(b,b+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(b,e,f){var g=b.getModel().getLineIndexFromMapper(e);e=g+this._mapper[e][f]-1;g=b.getModel().getLineStart(g);b=b.getModel().getLineEnd(e,
true);return{start:g,end:b}},copyToLeft:function(){var b=this.getCurrentMapperIndex(),e=this.getMapperTextRange(this._rightEditor,b,1);b=this.getMapperTextRange(this._leftEditor,b,0);this._leftEditor.setText(this._rightEditor.getText(e.start,e.end),b.start,b.end);this._leftEditor.redrawRange();this._rightEditor.redrawRange()},render:function(){if(this._mapper){var b=this._canvasDiv.getContext("2d");b.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);b.strokeStyle="#AAAAAA";b.lineWidth=1;
b.beginPath();var e=this._leftEditor.getTopIndex(),f=this._leftEditor.getBottomIndex(),g=this._rightEditor.getTopIndex(),i=this._rightEditor.getBottomIndex();this._leftLineH=this._leftEditor.getLineHeight();this._rightLineH=this._rightEditor.getLineHeight();for(var k=0,j=0,o=false,q=0;q<this._mapper.length;q++){if(this._mapper[q][2]!==0)if(d.overlapMapper(this._mapper[q],0,k,e,f)||d.overlapMapper(this._mapper[q],1,j,g,i)){this._renderCurve(q,k,j,this._canvasDiv,b,e,f,g,i);o=true}else if(o)break;k+=
this._mapper[q][0];j+=this._mapper[q][1]}b.stroke()}},_renderCurve:function(b,e,f,g,i){var k=this._mapper[b];e=this._leftEditor.getLinePixel(e+k[0]/2)+k[0]%2*this._leftLineH/3-this._leftEditor.getTopPixel();f=this._rightEditor.getLinePixel(f+k[1]/2)+k[1]%2*this._rightLineH/3-this._rightEditor.getTopPixel();g=g.parentNode.clientWidth;if(b===this.getCurrentMapperIndex()){i.stroke();i.strokeStyle="#000";i.lineWidth=1;i.beginPath();i.moveTo(0,e);i.bezierCurveTo(g/3,e,g*0.666,f,g,f);i.stroke();i.strokeStyle=
"#AAAAAA";i.lineWidth=1;i.beginPath()}else{i.moveTo(0,e);i.bezierCurveTo(g/3,e,g*0.666,f,g,f);i.stroke()}},onChanged:function(b){if(b.removedLineCount!==b.addedLineCount)if(b.removedLineCount>0||b.addedLineCount>0)this.render()}};return a}();return c});
define("orion/compare/compare-model",[],function(){var d=d||{};d.CompareTextModel=function(){function c(a,b,e){this._model=a;this._mapperColumnIndex=b.columnIndex;this._mapper=b.mapper;this._listeners=[];a.addListener(this);this._lineFeeder=e;this.init()}navigator.platform.indexOf("Win");c.prototype={init:function(a,b){if(a)this._mapper=a;a=this._lineFeeder.generateGapBlocks(this._mapper,this._mapperColumnIndex,b);this._dummyLBlock=a.gapBlocks;this._dummyLNumber=a.gapNumber},_getDummyCharCountAt:function(a,
b){if(a.blockNumber<0)return 0;for(var e=0,f=0;f<=a.blockNumber;f++){if(f>=this._dummyLBlock.length)break;for(var g=f===a.blockNumber?a.stopAtDelta:this._dummyLBlock[f][1]-1,i=0;i<=g;i++){var k=b?this._lineFeeder.getLineAt(this._dummyLBlock,f,i,true):this._lineFeeder.getLineAt(this._dummyLBlock,f,i,!(f===a.blockNumber&&i===g));e+=k.length}}return e},lookUpRealIndex:function(a){for(var b=0,e=0,f=0;f<this._dummyLBlock.length;f++){var g=this._dummyLBlock[f][0],i=g+this._dummyLBlock[f][1]-1;if(a<g)break;
if(a>=g&&a<=i)return{lineIndex:-1,gapsBefore:b+a-g,lastGapInfo:{blockNumber:f,stopAtDelta:a-g}};e=this._dummyLBlock[f][1];b+=e}return{lineIndex:a-b,gapsBefore:b,lastGapInfo:{blockNumber:f-1,stopAtDelta:e-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,b){if(this._lineFeeder.getLineNumber)return this._lineFeeder.getLineNumber(a,b);return this.lookUpRealIndex(a).lineIndex},addListener:function(a){this._listeners.push(a)},removeListener:function(a){for(var b=0;b<this._listeners.length;b++)if(this._listeners[b]===a){this._listeners.splice(b,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,b){var e=this.getLineCount();if(!(0<=a&&a<e))return null;a=this.lookUpRealIndex(a);return a.lineIndex<0?this._lineFeeder.getLineAt(this._dummyLBlock,a.lastGapInfo.blockNumber,a.lastGapInfo.stopAtDelta,b):this._model.getLine(a.lineIndex,b)},getLineAtOffset:function(a){if(!(0<=a&&a<=this.getCharCount()))return-1;for(var b=this.getLineCount(),e=0,f=0;e<b;){var g=this.lookUpRealIndex(e);if(g.lineIndex<0)f+=this._lineFeeder.getLineAt(this._dummyLBlock,g.lastGapInfo.blockNumber,
g.lastGapInfo.stopAtDelta,true).length;else{g=this._model.getLine(g.lineIndex,true);f+=g?g.length:0}e++;if(f>a)break}if(e>b)return b-1;return e-1},getLineCount:function(){return this._model.getLineCount()+this._dummyLNumber},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(a,b){var e=this.getLineCount();if(!(0<=a&&a<e))return-1;var f=this.lookUpRealIndex(a);e=0;if(f.lineIndex<0){e+=this._getDummyCharCountAt(f.lastGapInfo,b);a=a-f.gapsBefore;if(a>0)e+=this._model.getLineEnd(a-
1,true)}else{e+=this._getDummyCharCountAt(f.lastGapInfo,true);e+=this._model.getLineEnd(f.lineIndex,b)}return e},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,b){if(a===b)return this._model.getText(a,b);if(a===undefined)a=0;if(b===undefined)b=this.getCharCount();var e=this.getLineAtOffset(a),f=this.getLineAtOffset(b),g=this.getLineStart(e),i=this.getLineEnd(f,true),k=this.getLine(e,true);if(!k)return this._model.getText(a,
b);if(e===f)return k.substring(a-g,k.length-i+b);g=k.substring(a-g);k=this.getLine(f,true);if(!k)return this._model.getText(a,b);a=k.substring(0,k.length-i+b);b="";for(e=e+1;e<f;e++)b+=this.getLine(e,true);return g+b+a},onChanging:function(a){for(var b=0;b<this._listeners.length;b++){var e=this._listeners[b];e&&e.onChanging&&e.onChanging(a)}},onChanged:function(a){for(var b=0;b<this._listeners.length;b++){var e=this._listeners[b];e&&e.onChanged&&e.onChanged(a)}},setLineDelimiter:function(a){this._model.setLineDelimiter(a)},
setText:function(a){this._model.setText(a,0,this._model.getCharCount())}};return c}();d.DiffLineFeeder=function(){function c(a,b){if(a){this._diffLinesArray=a.array;this._diffLinesArrayIndex=a.index}this._lineDelimeter=b;this._annotations=[]}navigator.platform.indexOf("Win");c.prototype={generateGapBlocks:function(a,b,e){var f=[];this._mapper=a;if(e){this._diffLinesArray=e.array;this._diffLinesArrayIndex=e.index}this._annotations=[];e=a=0;for(var g=1-b,i=0,k=0;k<this._mapper.length;k++){i=this._mapper[k][2]===
0?this._mapper[k][b]:this._mapper[k][b]+this._mapper[k][g];if(this._mapper[k][2]>0){var j=this._mapper[k][b];a+=j;f.push([e+this._mapper[k][g],j,this._mapper[k][2]])}this._mapper[k][2]!==0&&this._annotations.push([e,k,i]);e+=i}return{gapBlocks:f,gapNumber:a}},getLineAt:function(a,b,e,f){b=a[b][2];b+=e-1;e=this._diffLinesArray[b];e===undefined&&console.log(a);e=e.substring(this._diffLinesArrayIndex);if(f)return e+this._lineDelimeter;return e},getLineType:function(a,b){for(var e=0,f=1-b,g=0,i=0;i<this._mapper.length;i++){g=
this._mapper[i][2]===0?this._mapper[i][b]:this._mapper[i][b]+this._mapper[i][f];if(a>=e&&a<e+g){if(this._mapper[i][2]===0)return{type:"unchnaged",mapperIndex:i};else if(this._mapper[i][2]<0)return{type:"removed",mapperIndex:i};else if(this._mapper[i][1]===0)return{type:"added",mapperIndex:i};else if(a<this._mapper[i][f]+e)return{type:"removed",mapperIndex:i};return{type:"added",mapperIndex:i}}e+=g}return{type:"unchnaged",mapperIndex:-1}},getLineNumber:function(a,b){if(this._mapper.length===0)return a;
for(var e=0,f=0,g=1-b,i=0,k=0;k<this._mapper.length;k++){i=this._mapper[k][2]===0?this._mapper[k][b]:this._mapper[k][b]+this._mapper[k][g];if(a>=e&&a<e+i){g=a-e;if(this._mapper[k][2]===0)return f+g;else if(this._mapper[k][2]<0)return b===0?-1:f+g;else if(this._mapper[k][1]===0)return b===0?f+g:-1;else if(a<this._mapper[k][1]+e)return b===0?-1:f+g;return b===0?f+g-this._mapper[k][1]:-1}e+=i;f+=this._mapper[k][b]}return a},getAnnotations:function(){return this._annotations},getAnnotationH:function(a){return this._annotations[a][2]}};
return c}();d.GapLineFeeder=function(){function c(a){this._lineDelimeter=a;this._annotations=[]}navigator.platform.indexOf("Win");c.prototype={generateGapBlocks:function(a,b){var e=[];this._mapper=a;this._annotations=[];for(var f=a=0,g=1-b,i=0;i<this._mapper.length;i++){if(this._mapper[i][b]<this._mapper[i][g]){var k=this._mapper[i][g]-this._mapper[i][b];a+=k;e.push([f+this._mapper[i][b],k,1])}k=Math.max(this._mapper[i][g],this._mapper[i][b]);this._mapper[i][2]!==0&&this._annotations.push([f,i,k]);
f+=k}return{gapBlocks:e,gapNumber:a}},getLineAt:function(a,b,e,f){if(f)return this._lineDelimeter;return""},getLineType:function(a,b){for(var e=0,f=1-b,g=0;g<this._mapper.length;g++){var i=Math.max(this._mapper[g][b],this._mapper[g][f]);if(a>=e&&a<e+i){if(this._mapper[g][2]===0)return"unchnaged";else if(this._mapper[g][2]<0)return"removed";else if(this._mapper[g][1]===0)return"added";else if(a<this._mapper[g][b]+e)return"changed";return"changed_gap"}e+=Math.max(this._mapper[g][b],this._mapper[g][f])}return"unchnaged"},
getAnnotations:function(){return this._annotations},getAnnotationH:function(a){return this._annotations[a][2]}};return c}();return d});
define("orion/compare/compare-m-model",["orion/compare/compareUtils"],function(d){var c=c||{};c.CompareMergeModel=function(){function a(b,e){this._model=b;this._mapperColumnIndex=e.columnIndex;this._mapper=e.mapper;this._listeners=[];b.addListener(this);this.init()}navigator.platform.indexOf("Win");a.prototype={init:function(b){this._initing=true;if(b){this._mapper=b;this._annotations=undefined}},getMapper:function(){return this._mapper},getLineType:function(b){var e=d.lookUpMapper(this._mapper,this._mapperColumnIndex,
b);if(e.mapperIndex>-1)if(this._mapper[e.mapperIndex][2]!==0){var f=this._mapper[e.mapperIndex][this._mapperColumnIndex];if(f===0)return{type:"top-only",mapperIndex:e.mapperIndex};if(f===1)return{type:"oneline",mapperIndex:e.mapperIndex};if(b===e.startFrom)return{type:"top",mapperIndex:e.mapperIndex};if(b===e.startFrom+f-1)return{type:"bottom",mapperIndex:e.mapperIndex};return{type:"middle",mapperIndex:e.mapperIndex}}return{type:"unchanged",mapperIndex:e.mapperIndex}},isMapperEmpty:function(){return this._mapper.length===
0},getAnnotations:function(){if(this._annotations===undefined){this._annotations=[];for(var b=0,e=0;e<this._mapper.length;e++){this._mapper[e][2]!==0&&this._annotations.push([b,e]);b+=this._mapper[e][this._mapperColumnIndex]}}return this._annotations},getAnnotationH:function(b){this.getAnnotations();b=this._annotations[b][1];return b===-1?0:this._mapper[b][this._mapperColumnIndex]},getAnnotationLineCount:function(){return this.getLineCount()},getLineNumber:function(b){return b},getLineIndexFromMapper:function(b){return d.lookUpLineIndex(this._mapper,
this._mapperColumnIndex,b)},lookUpMapper:function(b){return d.lookUpMapper(this._mapper,this._mapperColumnIndex,b)},updateMapper:function(b,e,f,g,i){g!==i&&d.updateMapper(this._mapper,this._mapperColumnIndex,this.getLineAtOffset(b),g,i)},addListener:function(b){this._listeners.push(b)},removeListener:function(b){for(var e=0;e<this._listeners.length;e++)if(this._listeners[e]===b){this._listeners.splice(e,1);return}},getCharCount:function(){return this._model.getCharCount()},getLine:function(b,e){return this._model.getLine(b,
e)},getLineAtOffset:function(b){return this._model.getLineAtOffset(b)},getLineCount:function(){return this._model.getLineCount()},getLineDelimiter:function(){return this._model.getLineDelimiter()},setLineDelimiter:function(b){this._model.setLineDelimiter(b)},getLineEnd:function(b,e){return this._model.getLineEnd(b,e)},getLineStart:function(b){return this._model.getLineStart(b)},setText:function(b,e,f){this._model.setText(b,e,f)},getText:function(b,e){return this._model.getText(b,e)},onChanging:function(b){for(var e=
0;e<this._listeners.length;e++){var f=this._listeners[e];f&&f.onChanging&&f.onChanging(b)}},onChanged:function(b){if(this._initing)this._initing=false;else this.updateMapper(b.start,b.removedCharCount,b.addedCharCount,b.removedLineCount,b.addedLineCount);for(var e=0;e<this._listeners.length;e++){var f=this._listeners[e];f&&f.onChanged&&f.onChanged(b)}}};return a}();return c});orion=orion||{};orion.editor=orion.editor||{};
orion.editor.ContentAssist=function(){function d(c,a){this.editor=c;this.textView=c.getTextView();this.contentAssistPanel=document.getElementById(a);this.active=false;this.prefix="";this.providers=[];this.filteredProviders=[];this.listeners={};this.proposals=[];this.contentAssistListener={onModelChanging:function(b){this.ignoreNextChange=this.isIgnorable(b)},onModelChanged:function(b){this.ignoreNextChange?this.cancel():this.showContentAssist(true,b);this.ignoreNextChange=false},onScroll:function(){this.cancel()}};
this.init()}d.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(c,a){this.listeners[c]||(this.listeners[c]=[]);this.listeners[c].push(a)},removeEventListener:function(c,a){if(c=this.listeners[c]){a=c.indexOf(a);
a!==-1&&c.splice(a,1)}},dispatchEvent:function(c,a){a={type:c,data:a};if(c=this.listeners[c])for(var b=0;b<c.length;b++)c[b](a)},cancel:function(){this.showContentAssist(false)},isActive:function(){return this.active},isIgnorable:function(c){var a=c.removedCharCount>0&&c.addedCharCount===0,b=this.textView;b=c.start+1<=b.getModel().getCharCount()&&/^\s*$/.test(b.getText(c.start,c.start+1));return c.removedLineCount>0||a&&b},lineUp:function(){if(this.contentAssistPanel){var c=this.getSelectedNode();
c===this.contentAssistPanel.firstChild?this.setSelected(this.contentAssistPanel.lastChild):this.setSelected(c.previousSibling);return true}},lineDown:function(){if(this.contentAssistPanel){var c=this.getSelectedNode();c===this.contentAssistPanel.lastChild?this.setSelected(this.contentAssistPanel.firstChild):this.setSelected(c.nextSibling);return true}},enter:function(){return this.contentAssistPanel?this.accept():false},accept:function(){var c=this.getSelectedProposal();if(c===null)return false;this.ignoreNextChange=
true;this.cancel();this.dispatchEvent("accept",{proposal:c,start:this.textView.getCaretOffset()-this.prefix.length,end:this.textView.getCaretOffset()});return true},setSelected:function(c){for(var a=this.contentAssistPanel.childNodes,b=0;b<a.length;b++){var e=a[b];if(e.className==="selected")e.className="";if(e===c){e.className="selected";e.focus();if(e.offsetTop<this.contentAssistPanel.scrollTop)e.scrollIntoView(true);else e.offsetTop+e.offsetHeight>this.contentAssistPanel.scrollTop+this.contentAssistPanel.clientHeight&&
e.scrollIntoView(false)}}},getSelectedNode:function(){var c=this.getSelectedIndex();return c===-1?null:this.contentAssistPanel.childNodes[c]},getSelectedIndex:function(){for(var c=this.contentAssistPanel.childNodes,a=0;a<c.length;a++)if(c[a].className==="selected")return a;return-1},getSelectedProposal:function(){var c=this.getSelectedIndex();return c===-1?null:this.proposals[c]},click:function(c){this.setSelected(c.target);this.accept();this.editor.getTextView().focus()},showContentAssist:function(c,
a){if(this.contentAssistPanel){this.dispatchEvent(c?"show":"hide",null);this.filterProviders(this.editor.getTitle());if(c){var b=a?a.start+a.addedCharCount:this.textView.getCaretOffset();c=b;for(var e;c>0&&(97<=(e=this.textView.getText(c-1,c).charCodeAt(0))&&e<=122||65<=e&&e<=90||e===95||48<=e&&e<=57);)c--;this.prefix=this.textView.getText(c,b);e=this.textView.getText();c=this.textView.getSelection();c.offset=b;this.getKeywords(this.prefix,e,c).then(function(f){this.proposals=[];for(var g=0;g<f.length;g++){var i=
f[g];if(!(i===null||i===undefined))if(this.matchesPrefix(i)||this.matchesPrefix(i.proposal))this.proposals.push(i)}if(this.proposals.length===0)this.cancel();else{f=this.textView.getLocationAtOffset(b);f.y+=this.textView.getLineHeight();this.contentAssistPanel.innerHTML="";for(g=0;g<this.proposals.length;g++)this.createDiv(this.getDisplayString(this.proposals[g]),g===0,this.contentAssistPanel);this.textView.convert(f,"document","page");this.contentAssistPanel.style.position="absolute";this.contentAssistPanel.style.left=
f.x+"px";this.contentAssistPanel.style.top=f.y+"px";this.contentAssistPanel.style.display="block";this.contentAssistPanel.scrollTop=0;g=document.documentElement.clientWidth;if(f.y+this.contentAssistPanel.offsetHeight>document.documentElement.clientHeight)this.contentAssistPanel.style.top=f.y-this.contentAssistPanel.offsetHeight-this.textView.getLineHeight()+"px";if(f.x+this.contentAssistPanel.offsetWidth>g)this.contentAssistPanel.style.left=g-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(c,a,b){var e=document.createElement("div");if(a)e.className="selected";e.innerHTML=c;b.appendChild(e)},getDisplayString:function(c){return typeof c==="string"?c:c.proposal},matchesPrefix:function(c){return typeof c==="string"&&
c.substr(0,this.prefix.length)===this.prefix},getKeywords:function(c,a,b){function e(v){if(v)g=g.concat(v);++i===j.length&&k.done(g)}function f(){++i===j.length&&k.done(g)}for(var g=[],i=0,k=new this.Promise,j=this.filteredProviders,o=0;o<j.length;o++){var q=j[o].provider.getKeywords(c,a,b);q&&q.then?q.then(e,f):e(q)}return k},Promise:function(){function c(){}c.prototype.then=function(a){this.callback=a;if(this.result){var b=this;setTimeout(function(){b.callback(b.result)},0)}};c.prototype.done=function(a){this.result=
a;this.callback&&this.callback(this.result)};return c}(),addProvider:function(c,a,b){if(!this.providers)this.providers=[];this.providers.push({name:a,pattern:b,provider:c})},filterProviders:function(c){this.filteredProviders=[];for(var a=0;a<this.providers.length;a++){var b=this.providers[a];(new RegExp(b.pattern)).test(c)&&this.filteredProviders.push(b)}}};return d}();
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 d(b,e){this.view=b;this.size=e!==undefined?e:100;this.reset();e=b.getModel();if(e.getBaseModel)e=e.getBaseModel();this.model=e;var f=this;this._modelListener={onChanging:function(g){f._onModelChanging(g)}};e.addListener(this._modelListener);b.addEventListener("Destroy",this,this._onDestroy)}var c=function(){function b(e,f,g){this.offset=e;this.text=f;this.previousText=g}b.prototype={undo:function(e,f){this._doUndoRedo(this.offset,this.previousText,this.text,
e,f)},redo:function(e,f){this._doUndoRedo(this.offset,this.text,this.previousText,e,f)},_doUndoRedo:function(e,f,g,i,k){var j=i.getModel();if(j.mapOffset&&i.annotationModel){var o=j.mapOffset(e,true);if(o<0)for(var q=i.annotationModel.getAnnotations(e,e+1);q.hasNext();){var v=q.next();if(v.type==="orion.annotation.folding"){v.expand();o=j.mapOffset(e,true);break}}if(o<0)return;e=o}i.setText(f,e,e+g.length);k&&i.setSelection(e,e+f.length)}};return b}(),a=function(){function b(e,f){this.selection=e;
this.caret=f;this.changes=[]}b.prototype={add:function(e){this.changes.push(e)},undo:function(e,f){for(var g=this.changes.length-1;g>=0;g--)this.changes[g].undo(e,false);if(f){f=this.selection.start;g=this.selection.end;e.setSelection(this.caret?f:g,this.caret?g:f)}},redo:function(e,f){for(var g=0;g<this.changes.length;g++)this.changes[g].redo(e,false);if(f){f=this.selection.start;g=this.selection.end;e.setSelection(this.caret?f:g,this.caret?g:f)}}};return b}();d.prototype={add:function(b){if(this.compoundChange)this.compoundChange.add(b);
else{this.stack.splice(this.index,this.stack.length-this.index,b);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 b=
this.index,e=this.stack.length;this._undoStart!==undefined&&b++;return{undo:b,redo:e-b}},undo:function(){this._commitUndo();if(this.index<=0)return false;var b=this.stack[--this.index];this._ignoreUndo=true;b.undo(this.view,true);this._ignoreUndo=false;return true},redo:function(){this._commitUndo();if(this.index>=this.stack.length)return false;var b=this.stack[this.index++];this._ignoreUndo=true;b.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 b=new a(this.view.getSelection(),this.view.getCaretOffset());this.add(b);this.compoundChange=b},_commitUndo:function(){if(this._undoStart!==undefined){this._undoStart<0?this.add(new c(-this._undoStart,"",this._undoText,"")):this.add(new c(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(b){var e=b.text,f=b.start,g=b.removedCharCount;b=b.addedCharCount;if(!this._ignoreUndo){if(this._undoStart!==undefined&&!(b===1&&g===0&&f===this._undoStart+this._undoText.length||b===0&&g===1&&(f+1===-this._undoStart||f===-this._undoStart)))this._commitUndo();if(!this.compoundChange)if(b===1&&g===0){if(this._undoStart===undefined)this._undoStart=f;this._undoText+=e;return}else if(b===0&&g===1){e=this._undoText.length>
0&&-this._undoStart===f;this._undoStart=-f;if(e)this._undoText+=this.model.getText(f,f+g);else this._undoText=this.model.getText(f,f+g)+this._undoText;return}this.add(new c(f,e,this.model.getText(f,f+g)))}}};return d}();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(d,c,a,b,e){var f={};f.EditorCommandFactory=function(){function g(i,k,j,o,q,v){this.serviceRegistry=i;this.commandService=k;this.fileClient=j;this.inputManager=o;this.toolbarId=q;this.isReadOnly=v}g.prototype={generateEditorCommands:function(i){function k(q){var v=new b.KeyBinding;b.KeyBinding.apply(v,q);return v}if(!this.isReadOnly){i.getTextView().setKeyBinding(new b.KeyBinding("s",
true),"Save");i.getTextView().setAction("Save",d.hitch(this,function(){var q=i.getText(),v={ETag:this.inputManager.getFileMetadata().ETag};this.fileClient.write(this.inputManager.getInput(),q,v).then(d.hitch(this,function(u){this.inputManager.getFileMetadata().ETag=u.ETag;i.onInputChange(this.inputManager.getInput(),null,q,true);this.inputManager.afterSave&&this.inputManager.afterSave()}),d.hitch(this,function(u){if(u.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(d.hitch(this,function(s){this.inputManager.getFileMetadata().ETag=s.ETag;i.onInputChange(this.inputManager.getInput(),null,q,true);this.inputManager.afterSave&&this.inputManager.afterSave()}));else u.log=true}));return true}));this.commandService.addCommand(new c.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 c.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 j=this.serviceRegistry.getServiceReferences("orion.edit.command"),o=0;o<j.length;o++)this.serviceRegistry.getService(j[o]).then(d.hitch(this,
function(q){for(var v={},u=j[o].getPropertyNames(),s=0;s<u.length;s++)v[u[s]]=j[o].getProperty(u[s]);u=new c.Command({name:v.name,image:v.img,id:v.name,callback:d.hitch(i,function(w){w=w||this;var z=w.getSelection(),y=w.getModel(),h=y.getText();q.run(y.getText(z.start,z.end),h,z).then(function(n){if(n.text){w.setText(n.text);if(n.selection){w.setSelection(n.selection.start,n.selection.end);w.getTextView().focus()}}else if(typeof n==="string"){w.setText(n,z.start,z.end);w.setSelection(z.start,z.end);
w.getTextView().focus()}});return true})});this.commandService.addCommand(u,"dom");v.img?this.commandService.registerCommandContribution(u.id,o,this.toolbarId,"orion.editorActions.contributed.images"):this.commandService.registerCommandContribution(u.id,o,this.toolbarId,"orion.editorActions.contributed.noImages");a.generateDomCommandsInBanner(this.commandService,i);if(v.key){s=i.getTextView();s.setKeyBinding(k(v.key),u.id);s.setAction(u.id,u.callback)}}))}}};return g}();f.UndoCommandFactory=function(){function g(i,
k,j){this.serviceRegistry=i;this.commandService=k;this.toolbarId=j}g.prototype={createUndoStack:function(i){var k=new e.UndoStack(i.getTextView(),200);i.getTextView().setKeyBinding(new b.KeyBinding("z",true),"Undo");i.getTextView().setAction("Undo",function(){k.undo();return true});this.commandService.addCommand(new c.Command({name:"Undo",id:"orion.undo",callback:function(o){o.getTextView().invokeAction("Undo")}}),"dom");var j=navigator.platform.indexOf("Mac")!==-1?new b.KeyBinding("z",true,true):
new b.KeyBinding("y",true);i.getTextView().setKeyBinding(j,"Redo");i.getTextView().setAction("Redo",function(){k.redo();return true});this.commandService.addCommand(new c.Command({name:"Redo",id:"orion.redo",callback:function(o){o.getTextView().invokeAction("Redo")}}),"dom");this.commandService.registerCommandContribution("orion.undo",400,this.toolbarId,"orion.editorActions.unlabeled",new c.CommandKeyBinding("z",true),true);this.commandService.registerCommandContribution("orion.redo",401,this.toolbarId,
"orion.editorActions.unlabeled",j,true);return k}};return g}();return f});orion=orion||{};orion.editor=orion.editor||{};
orion.editor.Editor=function(){function d(c){this._textViewFactory=c.textViewFactory;this._undoStackFactory=c.undoStackFactory;this._annotationFactory=c.annotationFactory;this._foldingRulerFactory=c.foldingRulerFactory;this._lineNumberRulerFactory=c.lineNumberRulerFactory;this._contentAssistFactory=c.contentAssistFactory;this._keyBindingFactory=c.keyBindingFactory;this._statusReporter=c.statusReporter;this._domNode=c.domNode;this._syntaxHighlightProviders=c.syntaxHighlightProviders;this._foldingRuler=
this._overviewRuler=this._annotationRuler=null;this._dirty=false;this._title=this._contentAssist=null;this._keyModes=[]}d.prototype={errorType:"orion.annotation.error",warningType:"orion.annotation.warning",taskType:"orion.annotation.task",foldingType:"orion.annotation.folding",getTextView:function(){return this._textView},reportStatus:function(c,a,b){this._statusReporter?this._statusReporter(c,a,b):window.alert(a?"ERROR: "+c:c)},getModel:function(){var c=this._textView.getModel();if(c.getBaseModel)c=
c.getBaseModel();return c},mapOffset:function(c,a){var b=this._textView.getModel();if(b.getBaseModel)c=b.mapOffset(c,a);return c},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},getSelection:function(){var c=this._textView,a=c.getSelection();c=c.getModel();if(c.getBaseModel){a.start=c.mapOffset(a.start);a.end=c.mapOffset(a.end)}return a},getText:function(c,a){var b=this._textView.getModel();if(b.getBaseModel)b=b.getBaseModel();return b.getText(c,a)},_expandOffset:function(c){var a=
this._textView.getModel(),b=this._annotationModel;if(b&&a.getBaseModel)for(c=b.getAnnotations(c,c+1);c.hasNext();){a=c.next();if(a.type==="orion.annotation.folding")if(a.expand){a.expand();b.modifyAnnotation(a)}}},setCaretOffset:function(c){var a=this._textView,b=a.getModel();if(b.getBaseModel){this._expandOffset(c);c=b.mapOffset(c,true)}a.setCaretOffset(c)},setText:function(c,a,b){var e=this._textView,f=e.getModel();if(f.getBaseModel){if(a!==undefined){this._expandOffset(a);a=f.mapOffset(a,true)}if(b!==
undefined){this._expandOffset(b);b=f.mapOffset(b,true)}}e.setText(c,a,b)},setFoldingEnabled:function(c){this._foldingEnabled=c;this._updateFoldingRuler()},_updateFoldingRuler:function(){var c=this._textView;if(this._foldingEnabled){if(!this._foldingRuler&&this._foldingRulerFactory&&c.getModel().getBaseModel&&this._foldingEnabled){c.annotationModel=this._annotationModel;this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel);this._foldingRuler.addAnnotationType(this.foldingType);
c.addRuler(this._foldingRuler)}}else if(this._foldingRuler){c.removeRuler(this._foldingRuler);this._foldingRuler=null}},setSelection:function(c,a,b){var e=this._textView,f=e.getModel();if(f.getBaseModel){this._expandOffset(c);this._expandOffset(a);c=f.mapOffset(c,true);a=f.mapOffset(a,true)}e.setSelection(c,a,b)},moveSelection:function(c,a,b){a=a||c;var e=this._textView;this.setSelection(c,a,false);a=e.getTopPixel();var f=e.getBottomPixel();c=this.getModel().getLineAtOffset(c);c=e.getLinePixel(c);
if(c<a||c>f){f=Math.max(0,c-Math.floor((c<a?3:1)*(f-a)/4));(new orion.editor.util.Animation({node:e,duration:300,curve:[a,f],onAnimate:function(g){e.setTopPixel(Math.floor(g))},onEnd:function(){e.showSelection();e.focus();b&&b()}})).play()}else{e.showSelection();e.focus();b&&b()}},isDirty:function(){return this._dirty},checkDirty:function(){var c=!this._undoStack.isClean();this._dirty!==c&&this.onDirtyChange(c)},getAnnotationModel:function(){return this._annotationModel},doFind:function(c,a,b,e){var f=
this.getText();if(b){c=c.toLowerCase();f=f.toLowerCase()}if(e){f=f.split("").reverse().join("");c=c.split("").reverse().join("");a=f.length-a-1;a=f.indexOf(c,a);if(a!==-1)return{index:f.length-c.length-a,length:c.length}}else{a=f.indexOf(c,a);if(a!==-1)return{index:a,length:c.length}}return null},doFindRegExp:function(c,a,b,e){if(!c)return null;a=a||"";a+=(a.indexOf("g")===-1?"g":"")+(a.indexOf("m")===-1?"m":"");c=new RegExp(c,a);a=this.getText();var f=null,g=null;if(e)for(;;)if((f=c.exec(a))&&f.index<=
b)g={index:f.index,length:f[0].length};else return g;else return(f=c.exec(a.substring(b)))&&{index:f.index+b,length:f[0].length}},parseRegExp:function(c){if(c=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(c))return{pattern:c[1],flags:c[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 c(){var f=this.getModel(),g=this.getCaretOffset(),i=f.getLineAtOffset(g);f=f.getLineStart(i);g=g-f;for(f=0;f<this._keyModes.length;f++){var k=this._keyModes[f];if(k.isActive()&&k.isStatusActive&&k.isStatusActive())return}this.reportStatus("Line "+(i+1)+" : Col "+(g+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,b=this._textView;this._keyBindingFactory&&this._keyBindingFactory(this,this._keyModes,this._undoStack,this._contentAssist);b.setKeyBinding(new orion.textview.KeyBinding(27),"Cancel Current Mode");b.setAction("Cancel Current Mode",function(){for(var f=0;f<this._keyModes.length;f++)if(this._keyModes[f].isActive())return this._keyModes[f].cancel();return false}.bind(this));b.setAction("lineUp",function(){for(var f=0;f<this._keyModes.length;f++)if(this._keyModes[f].isActive())return this._keyModes[f].lineUp();
return false}.bind(this));b.setAction("lineDown",function(){for(var f=0;f<this._keyModes.length;f++)if(this._keyModes[f].isActive())return this._keyModes[f].lineDown();return false}.bind(this));b.setAction("enter",function(){for(var f=0;f<this._keyModes.length;f++)if(this._keyModes[f].isActive())return this._keyModes[f].enter();return false}.bind(this));b.addEventListener("ModelChanged",this,this.checkDirty);b.addEventListener("Selection",this,c);if(this._annotationFactory){var e=b.getModel();if(e.getBaseModel)e=
e.getBaseModel();this._annotationModel=this._annotationFactory.createAnnotationModel(e);e=this._annotationFactory.createAnnotationRulers(this._annotationModel);this._annotationRuler=e.annotationRuler;this._annotationRuler.onClick=function(f){if(f!==undefined)if(f!==-1){var g=b.getModel(),i=this.getAnnotationModel(),k=a.mapOffset(g.getLineStart(f));f=a.mapOffset(g.getLineEnd(f));if(i=i.getAnnotations(k,f).next()){f=a.getModel();a.onGotoLine(f.getLineAtOffset(k),i.start-k,i.end-k)}}};this._overviewRuler=
e.overviewRuler;this._overviewRuler.onClick=function(f){if(f!==undefined){f=b.getModel().getLineStart(f);a.moveSelection(a.mapOffset(f))}};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);b.addRuler(this._annotationRuler);b.addRuler(this._overviewRuler)}if(this._lineNumberRulerFactory){this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel);b.addRuler(this._lineNumberRuler)}this._updateFoldingRuler()},showProblems:function(c){var a=this._annotationModel;if(a){for(var b=[],e=[],f=a.getTextModel(),g=a.getAnnotations(0,f.getCharCount()),i;g.hasNext();){i=g.next();if(i.type===this.errorType||i.type===
this.warningType)b.push(i)}if(c)for(g=0;g<c.length;g++)if(i=c[g]){var k=i.description.replace(/'/g,"&#39;").replace(/"/g,"&#34;"),j=f.getLineStart(i.line-1),o=i.severity;i={type:this[o+"Type"],start:j+i.start-1,end:j+i.end,title:k,html:"<div class='annotationHTML "+o+"'></div>",style:{styleClass:"annotation "+o},overviewStyle:{styleClass:"annotationOverview "+o},rangeStyle:{styleClass:"annotationRange "+o}};e.push(i)}a.replaceAnnotations(b,e)}},showSelection:function(c,a,b,e,f){if(typeof c==="number"){if(typeof a!==
"number")a=c;this.moveSelection(c,a)}else if(typeof b==="number"){c=this.getModel().getLineStart(b-1);if(typeof e==="number")c+=e;if(typeof f!=="number")f=0;this.moveSelection(c,c+f)}},onInputChange:function(c,a,b,e){this._title=c;if(e&&this._textView){this._undoStack.markClean();this.checkDirty()}else if(this._textView){if(a)this._textView.setText(a);else if(b!==null&&b!==undefined){this._textView.setText(b);this._textView.getModel().setLineDelimiter("auto")}this._undoStack.reset();this.checkDirty();
this._textView.focus()}},onGotoLine:function(c,a,b){if(this._textView){var e=this.getModel(),f=e.getLineStart(c),g=0;if(b===undefined)b=0;if(typeof a==="string"){c=e.getLine(c).indexOf(a);if(c!==-1){g=c;b=g+a.length}}else{g=a;a=e.getLineEnd(c)-f;g=Math.min(g,a);b=Math.min(b,a)}this.moveSelection(f+g,f+b)}},onDirtyChange:function(c){this._dirty=c},getTitle:function(){return this._title}};return d}();
orion.editor.util={connect:function(d,c,a,b){var e=d[c];d[c]=function(){var f=a;if(a===null||typeof a==="undefined")f=d;var g=typeof b==="string"?a[b]:b;typeof e==="function"&&e.apply(d,arguments);g.apply(f,arguments)}},Animation:function(){function d(c){this.options=c}d.prototype.play=function(){function c(){o=o===-1?(new Date).getTime():o;var q=((new Date).getTime()-o)/a;if(q<1){q=b(q);k=g+q*i;e(k)}else{clearInterval(j);f()}}var a=typeof this.options.duration==="number"?this.options.duration:350,
b=this.options.easing||this.defaultEasing,e=this.options.onAnimate||function(){},f=this.options.onEnd||function(){},g=this.options.curve[0],i=this.options.curve[1]-g,k,j,o=-1;j=setInterval(c,typeof this.options.rate==="number"?this.options.rate:20)};d.prototype.defaultEasing=function(c){return Math.sin(c*(Math.PI/2))};return d}(),bind:function(d){var c=this,a=Array.prototype.slice.call(arguments,1);if(a.length)return function(){return arguments.length?c.apply(d,a.concat(Array.prototype.slice.call(arguments))):
c.apply(d,a)};return function(){return arguments.length?c.apply(d,arguments):c.call(d)}}};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 d(c){this._view=c;this._create(c._parent.ownerDocument);c.addEventListener("Destroy",this,this.destroy)}d.getTooltip=function(c){if(!c._tooltip)c._tooltip=new d(c);return c._tooltip};d.prototype={_create:function(c){if(!this._domNode){this._document=c;var a=this._domNode=c.createElement("DIV");a.className="viewTooltip";var b=this._viewParent=c.createElement("DIV");a.appendChild(b);b=this._htmlParent=c.createElement("DIV");a.appendChild(b);c.body.appendChild(a);
this.hide()}},destroy:function(){if(this._domNode){if(this._contentsView){this._contentsView.destroy();this._emptyModel=this._contentsView=null}var c=this._domNode.parentNode;c&&c.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(c){if(this.target!==c){this._target=c;this.hide();if(c){var a=this;a._showTimeout=setTimeout(function(){a.show(true)},1E3)}}},show:function(c){if(this._target){var a=this._target.getTooltipInfo();if(a){var b=this._domNode;b.style.left=b.style.right=b.style.width=b.style.height="auto";var e=a.contents,f;if(e instanceof Array)e=this._getAnnotationContents(e);if(typeof e==="string")(f=this._htmlParent).innerHTML=e;else if(e instanceof Node)(f=this._htmlParent).appendChild(e);else if(e instanceof
orion.textview.ProjectionTextModel){if(!this._contentsView){this._emptyModel=new orion.textview.TextModel("");f=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"]});f._clientDiv.contentEditable=false;var g=this._view;f.addEventListener("LineStyle",g,g.onLineStyle)}f=this._contentsView;f.setModel(e);e=f.computeSize();
f=this._viewParent;f.style.width=e.width+20+"px";f.style.height=e.height+"px"}else return;f.style.left="auto";f.style.position="static";f.style.visibility="visible";e=parseInt(this._getNodeStyle(b,"padding-left","0"),10);e+=parseInt(this._getNodeStyle(b,"border-left-width","0"),10);if(a.anchor==="right"){f=parseInt(this._getNodeStyle(b,"padding-right","0"),10);f+=parseInt(this._getNodeStyle(b,"border-right-width","0"),10);b.style.right=b.ownerDocument.body.getBoundingClientRect().right-a.x+e+f+"px"}else b.style.left=
a.x-e+"px";e=parseInt(this._getNodeStyle(b,"padding-top","0"),10);e+=parseInt(this._getNodeStyle(b,"border-top-width","0"),10);b.style.top=a.y-e+"px";b.style.maxWidth=a.maxWidth+"px";b.style.maxHeight=a.maxHeight+"px";b.style.opacity="1";b.style.visibility="visible";if(c){var i=this;i._hideTimeout=setTimeout(function(){var k=parseFloat(i._getNodeStyle(b,"opacity","1"));i._fadeTimeout=setInterval(function(){if(b.style.visibility==="visible"&&k>0){k-=0.1;b.style.opacity=k}else i.hide()},50)},5E3)}}}},
_getAnnotationContents:function(c){function a(k,j){k=e.getLineStart(e.getLineAtOffset(k));j=e.getLineEnd(e.getLineAtOffset(j),true);return e.getText(k,j)}if(c.length===0)return null;var b=this._view.getModel(),e=b.getBaseModel?b.getBaseModel():b,f;if(c.length===1){b=c[0];if(b.title){f=b.title.replace(/</g,"&lt;").replace(/>/g,"&gt;");return b.html+"&nbsp;"+f}else{c=new orion.textview.ProjectionTextModel(e);f=e.getLineStart(e.getLineAtOffset(b.start));c.addProjection({start:b.end,end:c.getCharCount()});
c.addProjection({start:0,end:f});return c}}else{for(var g="<em>Multiple annotations:</em><br>",i=0;i<c.length;i++){b=c[i];(f=b.title)||(f=a(b.start,b.end));f=f.replace(/</g,"&lt;").replace(/>/g,"&gt;");g+=b.html+"&nbsp;"+f+"<br>"}return g}},_getNodeStyle:function(c,a,b){var e;if(c){e=c.style[a];if(!e)if(c.currentStyle){e=0;for(a=a;(e=a.indexOf("-",e))!==-1;)a=a.substring(0,e)+a.substring(e+1,e+2).toUpperCase()+a.substring(e+2);e=c.currentStyle[a]}else e=(c=c.ownerDocument.defaultView.getComputedStyle(c,
null))?c.getPropertyValue(a):null}return e||b}};return d}();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 d(c,a,b,e){this._location=a||"left";this._overview=b||"page";this._rulerStyle=e;this._types=[];this._view=null;var f=this;this._annotationModelListener={onChanged:function(g){f._onAnnotationModelChanged(g)}};this.setAnnotationModel(c)}d.prototype={addAnnotationType:function(c){this._types.push(c)},getAnnotations:function(c,a){var b=this._annotationModel;if(!b)return[];var e=this._view.getModel(),f=e.getLineStart(c),g=e.getLineEnd(a-1),i=e;if(e.getBaseModel){i=
e.getBaseModel();f=e.mapOffset(f);g=e.mapOffset(g)}b=b.getAnnotations(f,g);for(f=[];b.hasNext();){g=b.next();if(this.isAnnotationTypeVisible(g.type))for(var k=i.getLineAtOffset(g.start),j=i.getLineAtOffset(g.end-1),o=k;o<=j;o++){var q=o;if(e!==i){q=i.getLineStart(o);q=e.mapOffset(q,true);if(q===-1)continue;q=e.getLineAtOffset(q)}if(c<=q&&q<a){var v=this._mergeAnnotation(f[q],g,o-k,j-k+1);if(v)f[q]=v}}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var u in f)if(f[u]._multiple)f[u].html+=
this._multiAnnotationOverlay.html;return f},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(c){for(var a=0;a<this._types.length;a++)if(this._types[a]===c)return true;return false},removeAnnotationType:function(c){for(var a=0;a<this._types.length;a++)if(this._types[a]===
c){this._types.splice(a,1);break}},setAnnotationModel:function(c){this._annotationModel&&this._annotationModel.removeListener(this._annotationModelListener);(this._annotationModel=c)&&this._annotationModel.addListener(this._annotationModelListener)},setMultiAnnotation:function(c){this._multiAnnotation=c},setMultiAnnotationOverlay:function(c){this._multiAnnotationOverlay=c},setView:function(c){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this,this._onTextModelChanged);
this._view=c;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this,this._onTextModelChanged)},onClick:function(){},onDblClick:function(){},onMouseMove:function(c,a){var b=orion.textview.Tooltip.getTooltip(this._view);if(b)if(!(b.isVisible()&&this._tooltipLineIndex===c)){this._tooltipLineIndex=c;var e=this;b.setTarget({y:a.clientY,getTooltipInfo:function(){return e._getTooltipInfo(e._tooltipLineIndex,this.y)}})}},onMouseOver:this._onMouseMove,onMouseOut:function(){var c=
orion.textview.Tooltip.getTooltip(this._view);c&&c.setTarget(null)},_getTooltipInfo:function(c,a){if(c!==undefined){var b=this._view,e=b.getModel(),f=this._annotationModel,g=[];if(f){var i=e.getLineStart(c),k=e.getLineEnd(c);if(e.getBaseModel){i=e.mapOffset(i);k=e.mapOffset(k)}for(f=f.getAnnotations(i,k);f.hasNext();){i=f.next();this.isAnnotationTypeVisible(i.type)&&g.push(i)}}g=this._getTooltipContents(c,g);if(!g)return null;g={contents:g,anchor:this.getLocation()};f=b.getClientArea();f.y=this.getOverview()===
"document"?b.convert({y:a},"view","document").y:b.getLocationAtOffset(e.getLineStart(c)).y;b.convert(f,"document","page");g.x=f.x;g.y=f.y;if(g.anchor==="right")g.x+=f.width;g.maxWidth=f.width;g.maxHeight=f.height-(f.y-b._parent.getBoundingClientRect().top);return g}},_getTooltipContents:function(c,a){return a},_onAnnotationModelChanged:function(c){function a(i){for(var k=0;k<i.length;k++)if(f.isAnnotationTypeVisible(i[k].type)){var j=i[k].start,o=i[k].end;if(e.getBaseModel){j=e.mapOffset(j,true);
o=e.mapOffset(o,true)}j!==-1&&o!==-1&&b.redrawLines(e.getLineAtOffset(j),e.getLineAtOffset(Math.max(j,o-1))+1,f)}}var b=this._view;if(b){var e=b.getModel(),f=this,g=e.getLineCount();if(c.textModelChangedEvent){c=c.textModelChangedEvent.start;if(e.getBaseModel)c=e.mapOffset(c,true);c=e.getLineAtOffset(c);b.redrawLines(c,g,f)}else{a(c.added);a(c.removed);a(c.changed)}}},_mergeAnnotation:function(c,a,b){c||(c={});if(b===0)if(c.html&&a.html){if(a.html!==c.html)if(!c._multiple&&this._multiAnnotation)c.html=
this._multiAnnotation.html;c._multiple=true}else c.html=a.html;c.style=this._mergeStyle(c.style,a.style);return c},_mergeStyle:function(c,a){if(a){c||(c={});if(c.styleClass&&a.styleClass&&c.styleClass!==a.styleClass)c.styleClass+=" "+a.styleClass;else c.styleClass=a.styleClass;var b;if(a.style){if(!c.style)c.style={};for(b in a.style)c.style[b]||(c.style[b]=a.style[b])}if(a.attributes){if(!c.attributes)c.attributes={};for(b in a.attributes)c.attributes[b]||(c.attributes[b]=a.attributes[b])}}return c}};
return d}();
orion.textview.LineNumberRuler=function(){function d(c,a,b,e,f){orion.textview.Ruler.call(this,c,a,"page",b);this._oddStyle=e||{style:{backgroundColor:"white"}};this._evenStyle=f||{style:{backgroundColor:"white"}};this._numOfDigits=0}d.prototype=new orion.textview.Ruler;d.prototype.getAnnotations=function(c,a){var b=orion.textview.Ruler.prototype.getAnnotations.call(this,c,a),e=this._view.getModel();for(c=c;c<a;c++){var f=c&1?this._oddStyle:this._evenStyle,g=c;if(e.getBaseModel){g=e.getLineStart(g);g=
e.getBaseModel().getLineAtOffset(e.mapOffset(g))}b[c]||(b[c]={});b[c].html=g+1+"";if(!b[c].style)b[c].style=f}return b};d.prototype.getWidestAnnotation=function(){var c=this._view.getModel().getLineCount();return this.getAnnotations(c-1,c)[c-1]};d.prototype._onTextModelChanged=function(c){c=c.start;var a=this._view.getModel(),b=((a.getBaseModel?a.getBaseModel().getLineCount():a.getLineCount())+"").length;if(this._numOfDigits!==b){this._numOfDigits=b;this._view.redrawLines(a.getLineAtOffset(c),a.getLineCount(),
this)}};return d}();orion.textview.AnnotationRuler=function(){function d(c,a,b){orion.textview.Ruler.call(this,c,a,"page",b)}d.prototype=new orion.textview.Ruler;return d}();
orion.textview.OverviewRuler=function(){function d(c,a,b){orion.textview.Ruler.call(this,c,a,"document",b)}d.prototype=new orion.textview.Ruler;d.prototype.getRulerStyle=function(){var c={style:{lineHeight:"1px",fontSize:"1px"}};return c=this._mergeStyle(c,this._rulerStyle)};d.prototype.onClick=function(c){c!==undefined&&this._view.setTopIndex(c)};d.prototype._getTooltipContents=function(c,a){if(a.length===0){a=this._view.getModel();c=c;if(a.getBaseModel){c=a.getLineStart(c);c=a.getBaseModel().getLineAtOffset(a.mapOffset(c))}return"Line: "+
(c+1)}return orion.textview.Ruler.prototype._getTooltipContents.call(this,c,a)};d.prototype._mergeAnnotation=function(c,a,b,e){if(b===0){c=c;if(!c){c={html:"&nbsp;",style:{style:{height:3*e+"px"}}};c.style=this._mergeStyle(c.style,a.overviewStyle)}return c}};return d}();
orion.textview.FoldingRuler=function(){function d(c,a,b){orion.textview.AnnotationRuler.call(this,c,a,b)}d.prototype=new orion.textview.AnnotationRuler;d.prototype.onClick=function(c){if(c!==undefined){var a=this._annotationModel;if(a){var b=this._view.getModel(),e=b.getLineStart(c);c=b.getLineEnd(c,true);if(b.getBaseModel){e=b.mapOffset(e);c=b.mapOffset(c)}var f;for(a=a.getAnnotations(e,c);!f&&a.hasNext();){b=a.next();if(this.isAnnotationTypeVisible(b.type))f=b}if(f){(a=orion.textview.Tooltip.getTooltip(this._view))&&
a.setTarget(null);f.expanded?f.collapse():f.expand();this._annotationModel.modifyAnnotation(f)}}}};d.prototype._getTooltipContents=function(c,a){if(a.length===1)if(a[0].expanded)return null;return orion.textview.AnnotationRuler.prototype._getTooltipContents.call(this,c,a)};d.prototype._onAnnotationModelChanged=function(c){function a(j){for(g=0;g<j.length;g++)if(f.isAnnotationTypeVisible(j[g].type)){var o=j[g].start;if(e.getBaseModel)o=e.mapOffset(o,true);if(o!==-1)k=Math.min(k,e.getLineAtOffset(o))}}
if(c.textModelChangedEvent)orion.textview.AnnotationRuler.prototype._onAnnotationModelChanged.call(this,c);else{var b=this._view;if(b){var e=b.getModel(),f=this,g,i=e.getLineCount(),k=i;a(c.added);a(c.removed);a(c.changed);c=b.getRulers();for(g=0;g<c.length;g++)b.redrawLines(k,i,c[g])}}};return d}();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 d(c,a,b,e,f,g,i,k){this.type=a;this.start=b;this.end=e;this._projectionModel=c;this._expandedHTML=this.html=f;this._expandedStyle=this.style=g;this._collapsedHTML=i;this._collapsedStyle=k;this.expanded=true}d.prototype={collapse:function(){if(this.expanded){this.expanded=false;this.html=this._collapsedHTML;this.style=this._collapsedStyle;var c=this._projectionModel,a=c.getBaseModel();this._projection={start:a.getLineStart(a.getLineAtOffset(this.start)+1),
end:a.getLineEnd(a.getLineAtOffset(this.end),true)};c.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 d}();
orion.textview.AnnotationModel=function(){function d(c){this._annotations=[];this._listeners=[];var a=this;this._modelListener={onChanged:function(b){a._onChanged(b)}};this.setTextModel(c)}d.prototype={addListener:function(c){this._listeners.push(c)},removeListener:function(c){for(var a=0;a<this._listeners.length;a++)if(this._listeners[a]===c){this._listeners.splice(a,1);return}},addAnnotation:function(c){if(c){var a=this._annotations,b=this._binarySearch(a,c.start);a.splice(b,0,c);this.onChanged({added:[c],
removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(c,a){var b=this._annotations,e=this._binarySearch(b,c,true);return{next:function(){if(e<b.length){var f=b[e++];if(f.start<a)return f}return null},hasNext:function(){return e<b.length&&b[e].start<a}}},modifyAnnotation:function(c){if(c){for(var a=this._annotations,b=this._binarySearch(a,c.start),e={added:[],removed:[],changed:[]};b<a.length&&a[b].start===c.start;){if(a[b]===c){e.changed.push(c);break}b++}e.changed.length>
0&&this.onChanged(e)}},onChanged:function(c){for(var a=0;a<this._listeners.length;a++){var b=this._listeners[a];b&&b.onChanged&&b.onChanged(c)}},removeAnnotations:function(c){var a=this._annotations,b,e;if(c){b=[];for(e=a.length-1;e>=0;e--){var f=a[e];f.type===c&&a.splice(e,1);b.splice(0,0,f)}}else b=a;this.onChanged({removed:b,added:[],changed:[]})},removeAnnotation:function(c){var a=this._annotations,b=this._binarySearch(a,c.start);if(0<=b&&b<a.length)if(a[b]===c){a.splice(b,1);this.onChanged({removed:[c],
added:[],changed:[]})}},replaceAnnotations:function(c,a){var b=this._annotations,e,f,g;a||(a=[]);c||(c=[]);for(e=0;e<c.length;e++){g=c[e];f=this._binarySearch(b,g.start);0<=f&&f<b.length&&b[f]===g&&b.splice(f,1)}for(e=0;e<a.length;e++){g=a[e];f=this._binarySearch(b,g.start);b.splice(f,0,g)}this.onChanged({removed:c,added:a,changed:[]})},setTextModel:function(c){this._model&&this._model.removeListener(this._modelListener);(this._model=c)&&this._model.addListener(this._modelListener)},_binarySearch:function(c,
a,b){for(var e=c.length,f=-1,g;e-f>1;){g=Math.floor((e+f)/2);if(a<=c[g].start)e=g;else if(b&&a<c[g].end){e=g;break}else f=g}return e},_onChanged:function(c){var a=c.start,b=c.addedCharCount,e=c.removedCharCount,f=this._annotations,g=a+e,i=this._binarySearch(f,a,true);if(0<=i&&i<f.length){c={added:[],changed:[],textModelChangedEvent:c};b=b-e;for(g=e=this._binarySearch(f,g,true);g<f.length;g++){var k=f[g];if(k.start>a)k.start+=b;if(k.end>a)k.end+=b;c.changed.push(k)}c.removed=f.splice(i,e-i);this.onChanged(c)}}};
return d}();
orion.textview.AnnotationStyler=function(){function d(c,a){this._view=c;this._annotationModel=a;c.addEventListener("LineStyle",this,this._onLineStyle);var b=this;this._annotationModelListener={onChanged:function(e){b._onAnnotationModelChanged(e)}};a.addListener(this._annotationModelListener)}d.prototype={destroy:function(){var c=this._view;if(c){c.removeEventListener("Destroy",this,this._onDestroy);c.removeEventListener("LineStyle",this,this._onLineStyle);this.view=null}(c=this._annotationModel)&&c.removeListener(this._annotationModelListener)},
_mergeStyle:function(c,a){if(a){c||(c={});if(c.styleClass&&a.styleClass&&c.styleClass!==a.styleClass)c.styleClass+=" "+a.styleClass;else c.styleClass=a.styleClass;var b;if(a.style){if(!c.style)c.style={};for(b in a.style)c.style[b]||(c.style[b]=a.style[b])}if(a.attributes){if(!c.attributes)c.attributes={};for(b in a.attributes)c.attributes[b]||(c.attributes[b]=a.attributes[b])}}return c},_mergeStyleRanges:function(c,a){for(var b=0;b<c.length;b++){var e=c[b];if(a.end<=e.start)break;if(!(a.start>=e.end)){var f=
this._mergeStyle({},e.style);f=this._mergeStyle(f,a.style);if(a.start<=e.start&&a.end>=e.end)c[b]={start:e.start,end:e.end,style:f};else if(a.start>e.start&&a.end<e.end){c.splice(b,1,{start:e.start,end:a.start,style:e.style},{start:a.start,end:a.end,style:f},{start:a.end,end:e.end,style:e.style});b+=2}else if(a.start>e.start){c.splice(b,1,{start:e.start,end:a.start,style:e.style},{start:a.start,end:e.end,style:f});b+=1}else if(a.end<e.end){c.splice(b,1,{start:e.start,end:a.end,style:f},{start:a.end,
end:e.end,style:e.style});b+=1}}}},_onAnnotationModelChanged:function(c){function a(f){for(var g=0;g<f.length;g++)if(f[g].rangeStyle){var i=f[g].start,k=f[g].end;if(e.getBaseModel){i=e.mapOffset(i,true);k=e.mapOffset(k,true)}i!==-1&&k!==-1&&b.redrawRange(i,k)}}if(!c.textModelChangedEvent){var b=this._view;if(b){var e=b.getModel();a(c.added);a(c.removed);a(c.changed)}}},_onDestroy:function(){this.destroy()},_onLineStyle:function(c){var a=this._annotationModel,b=this._view.getModel(),e=a.getTextModel(),
f=c.lineStart,g=c.lineStart+c.lineText.length;if(e!==b){f=b.mapOffset(f);g=b.mapOffset(g)}for(a=a.getAnnotations(f,g);a.hasNext();){f=a.next();if(f.rangeStyle){g=f.start;var i=f.end;if(e!==b){g=b.mapOffset(g,true);i=b.mapOffset(i,true)}this._mergeStyleRanges(c.ranges,{start:g,end:i,style:f.rangeStyle})}if(f.lineStyle){c.style=this._mergeStyle({},c.style);c.style=this._mergeStyle(c.style,f.lineStyle)}}}};return d}();
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 d(){}d.prototype={createUndoStack:function(c){c=c.getTextView();var a=new orion.textview.UndoStack(c,200);c.setKeyBinding(new orion.textview.KeyBinding("z",true),"Undo");c.setAction("Undo",function(){a.undo();return true});var b=navigator.platform.indexOf("Mac")!==-1;c.setKeyBinding(b?new orion.textview.KeyBinding("z",true,true):new orion.textview.KeyBinding("y",true),"Redo");c.setAction("Redo",function(){a.redo();return true});return a}};return d}();
orion.editor.LineNumberRulerFactory=function(){function d(){}d.prototype={createLineNumberRuler:function(c){return new orion.textview.LineNumberRuler(c,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};return d}();orion.editor.FoldingRulerFactory=function(){function d(){}d.prototype={createFoldingRuler:function(c){return new orion.textview.FoldingRuler(c,"left",{styleClass:"ruler folding"})}};return d}();
orion.editor.AnnotationFactory=function(){function d(){}d.prototype={createAnnotationModel:function(c){return new orion.textview.AnnotationModel(c)},createAnnotationStyler:function(c,a){return new orion.textview.AnnotationStyler(c,a)},createAnnotationRulers:function(c){var a=new orion.textview.AnnotationRuler(c,"left",{styleClass:"ruler annotations"});c=new orion.textview.OverviewRuler(c,"right",{styleClass:"ruler overview"});return{annotationRuler:a,overviewRuler:c}}};return d}();
orion.editor.TextActions=function(){function d(c,a,b){this.editor=c;this.textView=c.getTextView();this.undoStack=a;this._incrementalFindActive=false;this._incrementalFindSuccess=true;this._incrementalFindIgnoreSelection=false;this._incrementalFindPrefix="";(this._searcher=b)&&this._searcher.getAdaptor().setEditor(this.editor);this.init()}d.prototype={init:function(){this._incrementalFindListener={onVerify:function(c){function a(i){return i.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")}var b=this.editor,
e=b.getModel(),f=b.mapOffset(c.start),g=b.mapOffset(c.end);f=e.getText(f,g);e=this._incrementalFindPrefix;if((e=e.match(new RegExp("^"+a(f),"i")))&&e.length>0){e=this._incrementalFindPrefix+=c.text;this.editor.reportStatus("Incremental find: "+e);f=e.toLowerCase()===e;g=b.getSelection().start;if(f=b.doFind(e,g,f)){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;b.moveSelection(f.index,f.index+f.length);this._incrementalFindIgnoreSelection=false}else{b.reportStatus("Incremental find: "+
e+" (not found)",true);this._incrementalFindSuccess=false}c.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 c=this.editor,a=c.getSelection(),b="";if(a.end>a.start)b=c.getModel().getText(a.start,a.end);this._searcher.buildToolBar(b);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 c=this.editor;if(this._incrementalFindActive){var a=this._incrementalFindPrefix;if(a.length!==0){var b;if(this._searcher)b=this._searcher.findNext(true,a);else{b=0;if(this._incrementalFindSuccess)b=c.getSelection().start+1;var e=a.toLowerCase()===a;b=c.doFind(a,b,e)}if(b){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;c.moveSelection(b.index,b.index+b.length);this._incrementalFindIgnoreSelection=
false;c.reportStatus("Incremental find: "+a)}else{c.reportStatus("Incremental find: "+a+" (not found)",true);this._incrementalFindSuccess=false}}}else{c.setCaretOffset(c.getCaretOffset());this.toggleIncrementalFind()}return true}.bind(this));this.textView.setAction("deletePrevious",function(){if(this._incrementalFindActive){var c=this.editor,a=this._incrementalFindPrefix;a=this._incrementalFindPrefix=a.substring(0,a.length-1);if(a.length===0){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=
true;c.setCaretOffset(c.getSelection().start);this._incrementalFindIgnoreSelection=false;this.toggleIncrementalFind();return true}c.reportStatus("Incremental find: "+a);var b=c.getCaretOffset();b=c.getModel().getText().lastIndexOf(a,b-a.length-1);if(b!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;c.moveSelection(b,b+a.length);this._incrementalFindIgnoreSelection=false}else c.reportStatus("Incremental find: "+a+" (not found)",true);return true}return false}.bind(this));
this.textView.setAction("tab",function(){var c=this.editor,a=c.getModel(),b=c.getSelection(),e=a.getLineAtOffset(b.start),f=a.getLineAtOffset(b.end>b.start?b.end-1:b.end);if(e!==f){var g=[];g.push("");for(var i=e;i<=f;i++)g.push(a.getLine(i,true));i=a.getLineStart(e);a=a.getLineEnd(f,true);c.setText(g.join("\t"),i,a);c.setSelection(i===b.start?b.start:b.start+1,b.end+(f-e+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 c=this.editor,a=c.getModel(),b=c.getSelection(),e=a.getLineAtOffset(b.start),f=a.getLineAtOffset(b.end>b.start?b.end-1:b.end),g=[],i=0,k=e;k<=f;k++){var j=a.getLine(k,true);if(a.getLineStart(k)!==a.getLineEnd(k)){if(j.indexOf("\t")!==0)return false;j=j.substring(1);i++}g.push(j)}e=a.getLineStart(e);k=a.getLineEnd(f,true);a=a.getLineStart(f);c.setText(g.join(""),e,k);c.setSelection(e===b.start?b.start:b.start-1,b.end-i+(b.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 c=this.editor,a=c.getModel(),b=c.getSelection(),e=a.getLineAtOffset(b.start);if(e===0)return true;var f=a.getLineAtOffset(b.end>b.start?b.end-1:b.end),g=a.getLineCount();b=a.getLineStart(e-1);var i=a.getLineStart(e),k=a.getLineEnd(f,true),j=a.getText(i,k),o=0;if(f===g-1){f=a.getLineEnd(e-1);e=a.getLineEnd(e-1,true);j+=a.getText(f,
e);i=f;o=e-f}this.startUndo();c.setText("",i,k);c.setText(j,b,b);c.setSelection(b,b+j.length-o);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 c=this.editor,a=c.getModel(),b=c.getSelection(),e=a.getLineAtOffset(b.start),f=a.getLineAtOffset(b.end>b.start?b.end-1:b.end),g=a.getLineCount();if(f===g-1)return true;e=a.getLineStart(e);b=a.getLineEnd(f,true);
var i=a.getLineEnd(f+1,true)-(b-e),k=0;if(f!==g-2)a=a.getText(e,b);else{f=a.getLineEnd(f);a=a.getText(f,b)+a.getText(e,f);k+=b-f}this.startUndo();c.setText("",e,b);c.setText(a,i,i);c.setSelection(i+k,i+k+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 c=this.editor,a=c.getModel(),b=c.getSelection(),e=a.getLineAtOffset(b.start);b=a.getLineAtOffset(b.end>
b.start?b.end-1:b.end);e=a.getLineStart(e);var f=a.getLineEnd(b,true),g=a.getLineCount(),i="";f=a.getText(e,f);if(b===g-1)f+=i=a.getLineDelimiter();c.setText(f,e,e);c.setSelection(e,e+f.length-i.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 c=this.editor,a=c.getModel(),b=c.getSelection(),e=a.getLineAtOffset(b.start);b=a.getLineAtOffset(b.end>b.start?b.end-1:
b.end);var f=a.getLineStart(e);e=a.getLineEnd(b,true);var g=a.getLineCount(),i="";f=a.getText(f,e);if(b===g-1)f=(i=a.getLineDelimiter())+f;c.setText(f,e,e);c.setSelection(e+i.length,e+f.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 c=this.editor,a=c.getSelection(),b=c.getModel(),e=b.getLineAtOffset(a.start);a=b.getLineAtOffset(a.end>a.start?a.end-
1:a.end);e=b.getLineStart(e);b=b.getLineEnd(a,true);c.setText("",e,b);return true}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding("l",true),"Goto Line...");this.textView.setAction("Goto Line...",function(){var c=this.editor,a=c.getModel().getLineAtOffset(c.getCaretOffset());if(a=prompt("Go to line:",a+1)){a=parseInt(a,10);c.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 c=this._incrementalFindPrefix;if(c.length===0)return false;var a=this.editor,b=a.getModel(),e;e=this._incrementalFindSuccess?a.getCaretOffset()-
c.length-1:b.getCharCount()-1;b=b.getText().lastIndexOf(c,e);if(b!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;a.moveSelection(b,b+c.length);this._incrementalFindIgnoreSelection=false}else{a.reportStatus("Incremental find: "+c+" (not found)",true);this._incrementalFindSuccess=false}return true}return false},lineDown:function(){if(this._incrementalFindActive){var c=this._incrementalFindPrefix;if(c.length===0)return false;var a=this.editor,b=a.getModel(),e=0;if(this._incrementalFindSuccess)e=
a.getSelection().start+1;b=b.getText().indexOf(c,e);if(b!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;a.moveSelection(b,b+c.length);this._incrementalFindIgnoreSelection=false;this.editor.reportStatus("Incremental find: "+c)}else{a.reportStatus("Incremental find: "+c+" (not found)",true);this._incrementalFindSuccess=false}return true}return false},enter:function(){return false}};return d}();
orion.editor.SourceCodeActions=function(){function d(c,a,b,e){this.editor=c;this.textView=c.getTextView();this.undoStack=a;this.contentAssist=b;this.linkedMode=e;this.contentAssist&&this.contentAssist.addEventListener("accept",this.contentAssistProposalAccepted.bind(this));this.init()}d.prototype={startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},init:function(){function c(a,b,e){var f=a.getLineAtOffset(b),
g=a.getLineAtOffset(e),i,k,j,o,q,v;for(i=f;i>=0;i--){k=a.getLine(i);j=i===f?b-a.getLineStart(f):k.length;o=k.lastIndexOf("/*",j);k=k.lastIndexOf("*/",j);if(k>o)break;else if(o!==-1){q=a.getLineStart(i)+o;break}}for(i=g;i<a.getLineCount();i++){k=a.getLine(i);j=i===g?e-a.getLineStart(g):0;o=k.indexOf("/*",j);k=k.indexOf("*/",j);if(o!==-1&&o<k)break;else if(k!==-1){v=a.getLineStart(i)+k;break}}return{commentStart:q,commentEnd:v}}this.textView.setKeyBinding(new orion.textview.KeyBinding(191,true),"Toggle Line Comment");
this.textView.setAction("Toggle Line Comment",function(){for(var a=this.editor,b=a.getModel(),e=a.getSelection(),f=b.getLineAtOffset(e.start),g=b.getLineAtOffset(e.end>e.start?e.end-1:e.end),i=true,k=[],j,o,q=f;q<=g;q++){j=b.getLine(q,true);k.push(j);if(!i||(o=j.indexOf("//"))===-1)i=false;else if(o!==0){var v;for(v=0;v<o;v++){i=j.charCodeAt(v);if(!(i===32||i===9))break}i=v===o}}q=b.getLineStart(f);v=b.getLineEnd(g,true);if(i){for(i=0;i<k.length;i++){j=k[i];o=j.indexOf("//");k[i]=j.substring(0,o)+
j.substring(o+2)}k=k.join("");j=b.getLineStart(g);b=q===e.start?e.start:e.start-2;e=e.end-2*(g-f+1)+(e.end===j+1?2:0)}else{k.splice(0,0,"");k=k.join("//");b=q===e.start?e.start:e.start+2;e=e.end+2*(g-f+1)}a.setText(k,q,v);a.setSelection(b,e);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,b=a.getModel(),e=a.getSelection(),f=new RegExp("/\\*|\\*/","g");b.getLineAtOffset(e.start);
b.getLineAtOffset(e.end);var g=c(b,e.start,e.end);if(g.commentStart!==undefined&&g.commentEnd!==undefined)return true;b=b.getText(e.start,e.end);if(b.length===0)return true;g=b.length;b=b.replace(f,"");f=b.length;a.setText("/*"+b+"*/",e.start,e.end);a.setSelection(e.start+2,e.end+2+(f-g));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,b=a.getModel(),
e=a.getSelection();b.getLineAtOffset(e.start);b.getLineAtOffset(e.end);var f=b.getText(e.start,e.end),g,i,k;for(k=0;k<f.length;k++)if(f.substring(k,k+2)==="/*"){g=e.start+k;break}for(;k<f.length;k++)if(f.substring(k,k+2)==="*/"){i=e.start+k;break}if(g!==undefined&&i!==undefined){a.setText(b.getText(g+2,i),g,i+2);a.setSelection(g,i)}else{f=c(b,e.start,e.end);if(f.commentStart===undefined||f.commentEnd===undefined)return true;b=b.getText(f.commentStart+2,f.commentEnd);a.setText(b,f.commentStart,f.commentEnd+
2);a.setSelection(e.start-2,e.end-2)}return true}.bind(this))},contentAssistProposalAccepted:function(c){var a=c.data.proposal,b;if(typeof a==="string")b=a;else if(typeof a.proposal==="string")b=a.proposal;this.textView.setText(b,c.data.start,c.data.end);if(a.positions&&this.linkedMode){c=[];for(b=0;b<a.positions.length;++b)c[b]={positions:[{offset:a.positions[b].offset,length:a.positions[b].length}]};this.linkedMode.enterLinkedMode({groups:c,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 c=this.editor,a=c.getSelection();if(a.start===a.end){var b=c.getModel(),e=b.getLineAtOffset(a.start),f=b.getLine(e,true),g=b.getLineStart(e);e=0;g=a.start-g;for(var i;e<g&&((i=f.charCodeAt(e))===32||i===9);)e++;if(e>0){var k=f.substring(0,e);for(e=g;e<f.length&&((i=f.charCodeAt(e++))===32||i===9);)a.end++;c.setText(b.getLineDelimiter()+k,a.start,
a.end);return true}}return false}};return d}();
orion.editor.LinkedMode=function(){function d(c){this.editor=c;this.textView=c.getTextView();this.linkedModeActive=false;this.linkedModePositions=[];this.linkedModeEscapePosition=this.linkedModeCurrentPositionIndex=0;this.linkedModeListener={onVerify:function(a){for(var b=false,e=0,f=0;f<this.linkedModePositions.length;++f){var g=this.linkedModePositions[f];if(b)g.offset+=e;else if(a.start>=g.offset&&a.end<=g.offset+g.length){b=g.length;g.length=a.start-g.offset+a.text.length+(g.offset+g.length-a.end);
e=g.length-b;b=true}}if(b)this.linkedModeEscapePosition+=e;else this.cancel()}.bind(this)}}d.prototype={enterLinkedMode:function(c){if(!this.linkedModeActive){this.linkedModeActive=true;this.linkedModePositions=[];for(var a=0;a<c.groups.length;++a){var b=c.groups[a];this.linkedModePositions[a]={offset:b.positions[0].offset,length:b.positions[0].length}}this.linkedModeEscapePosition=c.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(c){this.textView.setSelection(c.offset,
c.offset+c.length)}};return d}();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(d,c){function a(b){this._init(b)}a.prototype={_init:function(b){var e=b.container;if(typeof e==="string")e=c.byId(e);if(!e)throw"no parent container";this._container=e;c.removeClass(e,"currentLocation");this._id=b.id||"eclipse.breadcrumbs";this._resource=b.resource||null;this._firstSegmentName=b.firstSegmentName;this._makeHref=b.makeHref;this.path="";this.render()},getNavigatorRootSegment:function(){if(this._firstSegmentName){var b=document.createElement("a");
c.place(document.createTextNode(this._firstSegmentName),b,"only");b.href=d.toUrl("navigate/table.html")+"#";return b}return null},render:function(){var b=this._container,e=c.byId(this._id);if(e)c.empty(e);else{e=document.createElement("span");e.id=this._id;b.appendChild(e)}var f;if(f=this.getNavigatorRootSegment()){c.addClass(f,"breadcrumb");e.appendChild(f);if(this._resource&&this._resource.Parents){f=document.createElement("span");c.place(document.createTextNode(" / "),f,"only");this.path+="/";
c.addClass(f,"breadcrumb");e.appendChild(f)}else{f.href="";c.removeClass(f,"breadcrumb");c.addClass(f,"currentLocation")}}if(this._resource&&this._resource.Parents){b=this._resource.Parents;for(var g=b.length;--g>=0;){f=document.createElement("a");c.addClass(f,"breadcrumb");c.place(document.createTextNode(b[g].Name),f,"only");this.path+=b[g].Name;if(this._makeHref)this._makeHref(f,b[g].ChildrenLocation);else f.href=d.toUrl("navigate/table.html")+"#"+b[g].ChildrenLocation;e.appendChild(f);f=document.createElement("span");
c.place(document.createTextNode(" / "),f,"only");this.path+="/";c.addClass(f,"breadcrumb");e.appendChild(f)}if(this._resource){f=document.createElement("a");c.place(document.createTextNode(this._resource.Name),f,"only");c.addClass(f,"breadcrumb");c.addClass(f,"currentLocation");this.path+=this._resource.Name;e.appendChild(f)}}if(e.childNodes.length===0){f=document.createElement("a");c.place(document.createTextNode(document.title),f,"only");c.addClass(f,"breadcrumb");c.addClass(f,"currentLocation");
e.appendChild(f)}}};a.prototype.constructor=a;return{BreadCrumbs:a}});
define("orion/compare/gap-model",[],function(){var d=d||{};d.GapTextModel=function(){function c(a,b,e){this._model=a;this._myIndex=(this._isOriginal=b===undefined?true:b)?1:0;this._reverseIndex=1-this._myIndex;this._map=e;this._listeners=[];a.addListener(this);this._init()}navigator.platform.indexOf("Win");c.prototype={_init:function(){this._generateGapBlocks()},_generateGapBlocks:function(){this._gapBlocks=[];for(var a=this._gapNumber=0,b=0;b<this._map.length;b++){if(this._map[b][this._myIndex]<
this._map[b][this._reverseIndex]){var e=this._map[b][this._reverseIndex]-this._map[b][this._myIndex];this._gapNumber+=e;this._gapBlocks.push([a+this._map[b][this._myIndex],e])}a+=Math.max(this._map[b][this._reverseIndex],this._map[b][this._myIndex])}},lookUpRealIndex:function(a){for(var b=0,e=0;e<this._gapBlocks.length;e++){var f=this._gapBlocks[e][0],g=this._gapBlocks[e][0]+this._gapBlocks[e][1]-1;if(a<f)break;if(a>=f&&a<=g)return{lineIndex:-1,gapsBefore:b+a-f};b+=this._gapBlocks[e][1]}return{lineIndex:a-
b,gapsBefore:b}},getLineType:function(a){for(var b=0,e=0;e<this._map.length;e++){var f=Math.max(this._map[e][this._reverseIndex],this._map[e][this._myIndex]);if(a>=b&&a<b+f){if(this._map[e][2]===0)return"unchnaged";else if(this._map[e][2]<0)return"removed";else if(this._map[e][1]===0)return"added";else if(a<this._map[e][this._myIndex]+b)return"changed";return"changed_gap"}b+=Math.max(this._map[e][this._reverseIndex],this._map[e][this._myIndex])}return"unchnaged"},addListener:function(a){this._listeners.push(a)},
removeListener:function(a){for(var b=0;b<this._listeners.length;b++)if(this._listeners[b]===a){this._listeners.splice(b,1);return}},getCharCount:function(){var a=this._model.getCharCount();a+=this._gapNumber*this.getLineDelimiter().length;return a},getLine:function(a,b){var e=this.getLineCount();if(!(0<=a&&a<e))return null;a=this.lookUpRealIndex(a);if(a.lineIndex<0){if(b)return this.getLineDelimiter();return""}else return this._model.getLine(a.lineIndex,b)},getLineAtOffset:function(a){if(!(0<=a&&
a<=this.getCharCount()))return-1;for(var b=this.getLineCount(),e=0,f=0;e<b;){var g=this.lookUpRealIndex(e);f+=g.lineIndex<0?this.getLineDelimiter().length:this._model.getLine(g.lineIndex,true).length;e++;if(f>a)break}return e-1},getLineCount:function(){return this._model.getLineCount()+this._gapNumber},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(a,b){var e=this.getLineCount();if(!(0<=a&&a<e))return-1;var f=this.lookUpRealIndex(a);e=f.gapsBefore*this.getLineDelimiter().length;
if(f.lineIndex<0){a=a-f.gapsBefore;if(a>0)e+=this._model.getLineEnd(a-1,true);if(b)e+=this.getLineDelimiter().length}else e+=this._model.getLineEnd(f.lineIndex,b);return e},getLineStart:function(a){if(!(0<=a&&a<this.getLineCount()))return-1;var b=this.lookUpRealIndex(a),e=0,f=-1;if(b.lineIndex<0){e=b.gapsBefore;if(a-e>=0)f=a-e-1}else{e=b.gapsBefore;f=b.lineIndex}a=0;a+=this.getLineDelimiter().length*e;if(f>=0)a+=b.lineIndex<0?this._model.getLineEnd(f,true):this._model.getLineStart(f);return a},getText:function(a,
b){return this._model.getText(a,b)},onChanging:function(a){for(var b=0;b<this._listeners.length;b++){var e=this._listeners[b];e&&e.onChanging&&e.onChanging(a)}},onChanged:function(a){for(var b=0;b<this._listeners.length;b++){var e=this._listeners[b];e&&e.onChanged&&e.onChanged(a)}},setLineDelimiter:function(a){this._model.setLineDelimiter(a)},setText:function(a,b,e){this._model.setText(a,b,e)}};return c}();return d});orion=orion||{};orion.textview=orion.textview||{};
orion.textview.TextModel=function(){function d(a,b){this._listeners=[];this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(a);this.setLineDelimiter(b)}var c=window.navigator.platform.indexOf("Win")!==-1;d.prototype={addListener:function(a){this._listeners.push(a)},removeListener:function(a){for(var b=0;b<this._listeners.length;b++)if(this._listeners[b]===a){this._listeners.splice(b,1);return}},getCharCount:function(){for(var a=0,b=0;b<this._text.length;b++)a+=this._text[b].length;
return a},getLine:function(a,b){var e=this.getLineCount();if(!(0<=a&&a<e))return null;var f=this._lineOffsets[a];if(a+1<e){a=this.getText(f,this._lineOffsets[a+1]);if(b)return a;b=a.length;for(var g;(g=a.charCodeAt(b-1))===10||g===13;)b--;return a.substring(0,b)}else return this.getText(f)},getLineAtOffset:function(a){var b=this.getCharCount();if(!(0<=a&&a<=b))return-1;var e=this.getLineCount();if(a===b)return e-1;var f,g,i=this._lastLineIndex;if(0<=i&&i<e){f=this._lineOffsets[i];g=i+1<e?this._lineOffsets[i+
1]:b;if(f<=a&&a<g)return i}for(var k=e,j=-1;k-j>1;){i=Math.floor((k+j)/2);f=this._lineOffsets[i];g=i+1<e?this._lineOffsets[i+1]:b;if(a<=f)k=i;else if(a<g){k=i;break}else j=i}return this._lastLineIndex=k},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(a,b){var e=this.getLineCount();if(!(0<=a&&a<e))return-1;if(a+1<e){e=this._lineOffsets[a+1];if(b)return e;a=this.getText(Math.max(this._lineOffsets[a],e-2),e);b=a.length;
for(var f;(f=a.charCodeAt(b-1))===10||f===13;)b--;return e-(a.length-b)}else return this.getCharCount()},getLineStart:function(a){if(!(0<=a&&a<this.getLineCount()))return-1;return this._lineOffsets[a]},getText:function(a,b){if(a===undefined)a=0;if(b===undefined)b=this.getCharCount();if(a===b)return"";for(var e=0,f=0,g;f<this._text.length;){g=this._text[f].length;if(a<=e+g)break;e+=g;f++}for(var i=e,k=f;f<this._text.length;){g=this._text[f].length;if(b<=e+g)break;e+=g;f++}e=e;f=f;if(k===f)return this._text[k].substring(a-
i,b-e);a=this._text[k].substring(a-i);b=this._text[f].substring(0,b-e);return a+this._text.slice(k+1,f).join("")+b},onChanging:function(a){for(var b=0;b<this._listeners.length;b++){var e=this._listeners[b];e&&e.onChanging&&e.onChanging(a)}},onChanged:function(a){for(var b=0;b<this._listeners.length;b++){var e=this._listeners[b];e&&e.onChanged&&e.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:c?"\r\n":"\n"},setText:function(a,b,e){if(a===undefined)a="";if(b===undefined)b=0;if(e===undefined)e=this.getCharCount();for(var f=this.getLineAtOffset(b),g=this.getLineAtOffset(e),i=b,k=e-b,j=g-f,o=a.length,q=0,v=this.getLineCount(),u=0,s=0,w=0,z=[];;){if(u!==-1&&u<=w)u=a.indexOf("\r",w);if(s!==-1&&s<=w)s=a.indexOf("\n",w);if(s===-1&&u===-1)break;w=u!==-1&&s!==-1?u+1===s?s+1:(u<s?u:s)+1:u!==-1?u+1:s+1;z.push(b+w);q++}this.onChanging({text:a,start:i,removedCharCount:k,addedCharCount:o,removedLineCount:j,
addedLineCount:q});if(z.length===0){u=this.getLineStart(f);g=g+1<v?this.getLineStart(g+1):this.getCharCount();if(b!==u){a=this.getText(u,b)+a;b=u}if(e!==g){a+=this.getText(e,g);e=g}}g=o-k;for(u=f+j+1;u<v;u++)this._lineOffsets[u]+=g;f=[f+1,j].concat(z);Array.prototype.splice.apply(this._lineOffsets,f);for(g=z=0;g<this._text.length;){u=this._text[g].length;if(b<=z+u)break;z+=u;g++}v=z;for(f=g;g<this._text.length;){u=this._text[g].length;if(e<=z+u)break;z+=u;g++}z=z;g=g;u=this._text[g];b=this._text[f].substring(0,
b-v);e=u.substring(e-z);f=[f,g-f+1];b&&f.push(b);a&&f.push(a);e&&f.push(e);Array.prototype.splice.apply(this._text,f);if(this._text.length===0)this._text=[""];this.onChanged({start:i,removedCharCount:k,addedCharCount:o,removedLineCount:j,addedLineCount:q})}};return d}();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 d(h,n,m,l){typeof h.addEventListener==="function"?h.addEventListener(n,m,l===true):h.attachEvent("on"+n,m)}function c(h,n,m,l){typeof h.removeEventListener==="function"?h.removeEventListener(n,m,l===true):h.detachEvent("on"+n,m)}function a(h){this._init(h)}var b=document.selection&&window.ActiveXObject&&/MSIE/.test(navigator.userAgent)?document.documentMode:undefined,e=parseFloat(navigator.userAgent.split("Firefox/")[1]||navigator.userAgent.split("Minefield/")[1])||
undefined,f=navigator.userAgent.indexOf("Opera")!==-1,g=navigator.userAgent.indexOf("Chrome")!==-1,i=navigator.userAgent.indexOf("Safari")!==-1,k=navigator.userAgent.indexOf("WebKit")!==-1,j=navigator.userAgent.indexOf("iPad")!==-1,o=navigator.platform.indexOf("Mac")!==-1,q=navigator.platform.indexOf("Win")!==-1,v=navigator.platform.indexOf("Linux")!==-1,u=typeof window.document.documentElement.addEventListener==="function",s=(!b||b>=9)&&typeof window.document.createRange().getBoundingClientRect===
"function",w=q?"\r\n":"\n",z=function(){function h(n,m,l){this.start=n;this.end=m;this.caret=l}h.prototype={clone:function(){return new h(this.start,this.end,this.caret)},collapse:function(){if(this.caret)this.end=this.start;else this.start=this.end},extend:function(n){if(this.caret)this.start=n;else this.end=n;if(this.start>this.end){n=this.start;this.start=this.end;this.end=n;this.caret=!this.caret}},setCaret:function(n){this.end=this.start=n;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(n){return this.caret===n.caret&&this.start===n.start&&this.end===n.end}};return h}(),y=function(){function h(){this._types={}}h.prototype={addEventListener:function(n,m,l,p){var t=this._types[n];t||(t=this._types[n]={level:0,listeners:[]});t.listeners.push({context:m,func:l,data:p})},sendEvent:function(n,
m){if(n=this._types[n]){var l=n.listeners;try{n.level++;if(l)for(var p=0,t=l.length;p<t;p++){var r=l[p];r&&r.context&&r.func&&r.func.call(r.context,m,r.data)}}finally{n.level--;if(n.compact&&n.level===0){for(m=l.length-1;m>=0;m--)l[m]||l.splice(m,1);n.compact=false}}}},removeEventListener:function(n,m,l,p){if(n=this._types[n])for(var t=n.listeners,r=0,x=t.length;r<x;r++){var B=t[r];if(B&&B.context===m&&B.func===l&&B.data===p){if(n.level!==0){t[r]=null;n.compact=true}else t.splice(r,1);break}}}};return h}();
a.prototype={addEventListener:function(h,n,m,l){this._eventTable.addEventListener(h,n,m,l)},addRuler:function(h){this._rulers.push(h);h.setView(this);this._createRuler(h);this._updatePage()},computeSize:function(){var h=0,n=0,m=this._model,l=this._clientDiv,p=l.style.width;if(k)l.style.width=(524287).toString()+"px";for(var t=m.getLineCount(),r=this._frameDocument,x=0;x<t;x++){var B=this._getLineNode(x),C=null;if(!B||B.lineChanged)B=C=this._createLine(l,null,r,x,m);B=this._getLineBoundingClientRect(B);
h=Math.max(h,B.right-B.left);n+=B.bottom-B.top;C&&l.removeChild(C)}if(k)l.style.width=p;m=this._getViewPadding();h+=m.right-m.left;n+=m.bottom-m.top;return{width:h,height:n}},convert:function(h,n,m){var l=this._getScroll(),p=this._getViewPadding(),t=this._frame.getBoundingClientRect(),r=this._viewDiv.getBoundingClientRect();switch(n){case "document":if(h.x!==undefined)h.x+=-l.x+r.left+p.left;if(h.y!==undefined)h.y+=-l.y+r.top+p.top;break;case "page":if(h.x!==undefined)h.x+=-t.left;if(h.y!==undefined)h.y+=
-t.top;break}switch(m){case "document":if(h.x!==undefined)h.x+=l.x-r.left-p.left;if(h.y!==undefined)h.y+=l.y-r.top-p.top;break;case "page":if(h.x!==undefined)h.x+=t.left;if(h.y!==undefined)h.y+=t.top;break}return h},destroy:function(){for(var h=0;h<this._rulers.length;h++)this._rulers[h].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(j)this._textArea.focus();else{f&&this._clientDiv.blur();this._clientDiv.focus()}this._updateDOMSelection()}},getActions:function(h){for(var n=[],m=this._actions,l=0;l<m.length;l++)!h&&m[l].defaultHandler||n.push(m[l].name);return n},getBottomIndex:function(h){return this._getBottomIndex(h)},getBottomPixel:function(){return this._getScroll().y+this._getClientHeight()},getCaretOffset:function(){return this._getSelection().getCaret()},
getClientArea:function(){var h=this._getScroll();return{x:h.x,y:h.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return this._getScroll().x},getKeyBindings:function(h){for(var n=[],m=this._keyBindings,l=0;l<m.length;l++)m[l].name===h&&n.push(m[l].keyBinding);return n},getLineHeight:function(){return this._getLineHeight()},getLinePixel:function(h){h=Math.min(Math.max(0,h),this._model.getLineCount());return this._getLineHeight()*h},getLocationAtOffset:function(h){var n=
this._model;h=Math.min(Math.max(0,h),n.getCharCount());n=n.getLineAtOffset(h);var m=this._getScroll(),l=this._viewDiv.getBoundingClientRect(),p=this._getViewPadding();h=this._getOffsetToX(h)+m.x-l.left-p.left;n=this.getLinePixel(n);return{x:h,y:n}},getModel:function(){return this._model},getOffsetAtLocation:function(h,n){var m=this._getScroll(),l=this._viewDiv.getBoundingClientRect(),p=this._getViewPadding();n=this._getYToLine(n-m.y);h+=-m.x+l.left+p.left;return this._getXToOffset(n,h)},getRulers:function(){return this._rulers.slice(0)},
getSelection:function(){var h=this._getSelection();return{start:h.start,end:h.end}},getText:function(h,n){return this._model.getText(h,n)},getTopIndex:function(h){return this._getTopIndex(h)},getTopPixel:function(){return this._getScroll().y},invokeAction:function(h,n){for(var m=this._actions,l=0;l<m.length;l++){var p=m[l];if(p.name&&p.name===h){if(!n&&p.userHandler)if(p.userHandler())return;if(p.defaultHandler)return p.defaultHandler();return false}}return false},onContextMenu:function(h){this._eventTable.sendEvent("ContextMenu",
h)},onDestroy:function(h){this._eventTable.sendEvent("Destroy",h)},onLineStyle:function(h){this._eventTable.sendEvent("LineStyle",h)},onModelChanged:function(h){this._eventTable.sendEvent("ModelChanged",h)},onModelChanging:function(h){this._eventTable.sendEvent("ModelChanging",h)},onModify:function(h){this._eventTable.sendEvent("Modify",h)},onSelection:function(h){this._eventTable.sendEvent("Selection",h)},onScroll:function(h){this._eventTable.sendEvent("Scroll",h)},onVerify:function(h){this._eventTable.sendEvent("Verify",
h)},redrawLines:function(h,n,m){if(!(this._redrawCount>0)){if(h===undefined)h=0;if(n===undefined)n=this._model.getLineCount();if(h!==n){var l=this._clientDiv;if(l){if(m)for(var p=(m.getLocation()==="left"?this._leftDiv:this._rightDiv).firstChild.rows[0].cells,t=0;t<p.length;t++)if(p[t].firstChild._ruler===m){l=p[t].firstChild;break}if(m)l.rulerChanged=true;if(!m||m.getOverview()==="page")for(l=l.firstChild;l;){p=l.lineIndex;if(h<=p&&p<n)l.lineChanged=true;l=l.nextSibling}if(!m)if(h<=this._maxLineIndex&&
this._maxLineIndex<n){this._checkMaxLineIndex=this._maxLineIndex;this._maxLineIndex=-1;this._maxLineWidth=0}this._queueUpdatePage()}}}},redrawRange:function(h,n){var m=this._model;if(h===undefined)h=0;if(n===undefined)n=m.getCharCount();if(h!==n){h=m.getLineAtOffset(h);n=m.getLineAtOffset(Math.max(0,n-1))+1;this.redrawLines(h,n)}},removeEventListener:function(h,n,m,l){this._eventTable.removeEventListener(h,n,m,l)},removeRuler:function(h){for(var n=this._rulers,m=0;m<n.length;m++)if(n[m]===h){n.splice(m,
1);h.setView(null);this._destroyRuler(h);this._updatePage();break}},setAction:function(h,n){if(h){for(var m=this._actions,l=0;l<m.length;l++){var p=m[l];if(p.name===h){p.userHandler=n;return}}m.push({name:h,userHandler:n})}},setKeyBinding:function(h,n){for(var m=this._keyBindings,l=0;l<m.length;l++){var p=m[l];if(p.keyBinding.equals(h)){if(n)p.name=n;else if(p.predefined)p.name=null;else{h=p.name;m.splice(l,1);for(l=0;l<m.length&&h!==m[l].name;)l++;if(l===m.length){m=this._actions;for(l=0;l<m.length;l++)if(m[l].name===
h)m[l].defaultHandler||m.splice(l,1)}}return}}n&&m.push({keyBinding:h,name:n})},setCaretOffset:function(h,n){var m=this._model.getCharCount();h=Math.max(0,Math.min(h,m));this._setSelection(new z(h,h,false),n===undefined||n)},setHorizontalPixel:function(h){h=Math.max(0,h);this._scrollView(h-this._getScroll().x,0)},setRedraw:function(h){if(h){if(--this._redrawCount===0){h=this._model.getLineCount();for(var n=this.getRulers(),m=0;m<n.length;m++)this.redrawLines(0,h,n[m]);this.redrawLines(0,h);this._queueUpdatePage()}}else this._redrawCount++},
setModel:function(h){if(h)if(h!==this._model){this._model.removeListener(this._modelListener);var n=this._model.getLineCount(),m=this._model.getCharCount(),l=h.getLineCount(),p=h.getCharCount(),t={text:h.getText(),start:0,removedCharCount:m,addedCharCount:p,removedLineCount:n,addedLineCount:l};this.onModelChanging(t);this._model=h;t={start:0,removedCharCount:m,addedCharCount:p,removedLineCount:n,addedLineCount:l};this.onModelChanged(t);this._model.addListener(this._modelListener);this._reset();this._updatePage()}},
setSelection:function(h,n,m){var l=h>n;if(l){var p=h;h=n;n=p}p=this._model.getCharCount();h=Math.max(0,Math.min(h,p));n=Math.max(0,Math.min(n,p));this._setSelection(new z(h,n,l),m===undefined||m)},setText:function(h,n,m){var l=n===undefined&&m===undefined;if(n===undefined)n=0;if(m===undefined)m=this._model.getCharCount();this._modifyContent({text:h,start:n,end:m,_code:true},!l);if(l){this._columnX=-1;this._setSelection(new z(0,0,false),true);if(e)if(h=this._clientDiv){(n=this._hasFocus)&&h.blur();
h.contentEditable=false;h.contentEditable=true;n&&h.focus()}}},setTopIndex:function(h){var n=this._model;if(n.getCharCount()!==0){n=n.getLineCount();var m=this._getLineHeight(),l=Math.max(1,Math.min(n,Math.floor(this._getClientHeight()/m)));if(h<0)h=0;else if(h>n-l)h=n-l;this._scrollView(0,h*m-this._getScroll().y)}},setTopPixel:function(h){var n=this._getLineHeight(),m=this._getClientHeight(),l=this._model.getLineCount();h=Math.min(Math.max(0,h),n*l-m);this._scrollView(0,h-this._getScroll().y)},showSelection:function(){return this._showCaret(true)},
_handleBodyMouseDown:function(h){if(!h)h=window.event;for(var n=f?this._clientDiv:this._overlayDiv||this._viewDiv,m=h.target?h.target:h.srcElement;m;){if(n===m)return;m=m.parentNode}h.preventDefault&&h.preventDefault();h.stopPropagation&&h.stopPropagation();if(!u){n.setCapture();setTimeout(function(){n.releaseCapture()},0)}},_handleBlur:function(){this._hasFocus=false;if(b<9)if(!this._getSelection().isEmpty()){var h=this._frameDocument,n=h.createElement("DIV");h=h.body;h.appendChild(n);h.removeChild(n)}if(e||
b)if(this._selDiv1){n=b?"transparent":"#AFAFAF";this._selDiv1.style.background=n;this._selDiv2.style.background=n;this._selDiv3.style.background=n}},_handleContextMenu:function(h){if(!h)h=window.event;var n=this._getScroll(),m=this._viewDiv.getBoundingClientRect(),l=this._getViewPadding();this.onContextMenu({x:h.clientX+n.x-m.left-l.left,y:h.clientY+n.y-m.top-l.top,screenX:h.screenX,screenY:h.screenY});h.preventDefault&&h.preventDefault();return false},_handleCopy:function(h){if(!this._ignoreCopy){if(!h)h=
window.event;if(this._doCopy(h)){h.preventDefault&&h.preventDefault();return false}}},_handleCut:function(h){if(!h)h=window.event;if(this._doCut(h)){h.preventDefault&&h.preventDefault();return false}},_handleDOMAttrModified:function(h){if(!h)h=window.event;for(var n=false,m=this._parent;m;){if(m===h.target){n=true;break}m=m.parentNode}if(n){h=this._getVisible();if(h==="visible")this._createView();else h==="hidden"&&this._destroyView()}},_handleDataModified:function(){this._startIME()},_handleDblclick:function(h){if(!h)h=
window.event;this._lastMouseTime=h.timeStamp?h.timeStamp:(new Date).getTime();if(this._clickCount!==2){this._clickCount=2;this._handleMouse(h)}},_handleDragStart:function(h){if(!h)h=window.event;h.preventDefault&&h.preventDefault();return false},_handleDragOver:function(h){if(!h)h=window.event;h.dataTransfer.dropEffect="none";h.preventDefault&&h.preventDefault();return false},_handleDrop:function(h){if(!h)h=window.event;h.preventDefault&&h.preventDefault();return false},_handleDocFocus:function(){this._clientDiv.focus()},
_handleFocus:function(){this._hasFocus=true;b&&this._updateDOMSelection();if(e||b)if(this._selDiv1){var h=this._hightlightRGB;this._selDiv1.style.background=h;this._selDiv2.style.background=h;this._selDiv3.style.background=h}},_handleKeyDown:function(h){if(!h)h=window.event;if(j){if(h.keyCode===8){this._doBackspace({});h.preventDefault()}}else{switch(h.keyCode){case 16:case 17:case 18:case 91:break;default:this._setLinksVisible(false)}if(h.keyCode===229){if(this.readonly){h.preventDefault&&h.preventDefault();
return false}this._startIME()}else this._commitIME();if((o||v)&&e<4||f){this._keyDownEvent=h;return true}if(this._doAction(h)){if(h.preventDefault)h.preventDefault();else{h.cancelBubble=true;h.returnValue=false;h.keyCode=0}return false}}},_handleKeyPress:function(h){if(!h)h=window.event;if(o&&k)if(63232<=h.keyCode&&h.keyCode<=63487||h.keyCode===13||h.keyCode===8){h.preventDefault&&h.preventDefault();return false}if((o||v)&&e<4||f)if(this._doAction(this._keyDownEvent)){h.preventDefault&&h.preventDefault();
return false}var n=o?h.metaKey:h.ctrlKey;if(h.charCode!==undefined)if(n)switch(h.charCode){case 99:case 118:case 120:return true}n=false;if(o){if(h.ctrlKey||h.metaKey)n=true}else if(e){if(h.ctrlKey||h.altKey)n=true}else if(h.ctrlKey^h.altKey)n=true;if(!n){n=f?h.which:h.charCode!==undefined?h.charCode:h.keyCode;if(n>31){this._doContent(String.fromCharCode(n));h.preventDefault&&h.preventDefault();return false}}},_handleKeyUp:function(h){if(!h)h=window.event;(o?h.metaKey:h.ctrlKey)||this._setLinksVisible(false);
h.keyCode===13&&this._commitIME()},_handleLinkClick:function(h){if(!h)h=window.event;if(!(o?h.metaKey:h.ctrlKey)){h.preventDefault&&h.preventDefault();return false}},_handleLoad:function(h){var n=this._getVisible();if(n==="visible"||n==="hidden"&&k)this._createView(!h)},_handleMouse:function(h){var n=this._frameWindow;if(b)n=this._clientDiv;if(this._overlayDiv){var m=this;setTimeout(function(){m.focus()},0)}if(this._clickCount===1){this._setGrab(n);this._setSelectionTo(h.clientX,h.clientY,h.shiftKey)}else{u&&
this._setGrab(n);this._doubleClickSelection=null;this._setSelectionTo(h.clientX,h.clientY,h.shiftKey);this._doubleClickSelection=this._getSelection()}},_handleMouseDown:function(h){if(!h)h=window.event;if(this._linksVisible)if((h.target||h.srcElement).tagName!=="A")this._setLinksVisible(false);else return;var n=h.which?h.button===0:h.button===1;this._commitIME();if(n){this._isMouseDown=true;n=Math.abs(this._lastMouseX-h.clientX);var m=Math.abs(this._lastMouseY-h.clientY),l=h.timeStamp?h.timeStamp:
(new Date).getTime();if(l-this._lastMouseTime<=this._clickTime&&n<=this._clickDist&&m<=this._clickDist)this._clickCount++;else this._clickCount=1;this._lastMouseX=h.clientX;this._lastMouseY=h.clientY;this._lastMouseTime=l;this._handleMouse(h);if(f||g){this._hasFocus||this.focus();h.preventDefault()}}},_handleMouseMove:function(h){if(!h)h=window.event;this._setLinksVisible(!this._isMouseDown&&(o?h.metaKey:h.ctrlKey));if(this._isMouseDown){if(!u){if(h.button===0){this._setGrab(null);return true}if(!this._isMouseDown&&
h.button===1&&(this._clickCount&1)!==0){this._clickCount=2;return this._handleMouse(h,this._clickCount)}}var n=h.clientX,m=h.clientY;if(g)if(h.currentTarget!==this._frameWindow){h=this._frame.getBoundingClientRect();n-=h.left;m-=h.top}var l=this._getViewPadding(),p=this._viewDiv.getBoundingClientRect(),t=this._getClientWidth(),r=this._getClientHeight();h=p.left+l.left;var x=p.top+l.top;t=p.left+l.left+t;l=p.top+l.top+r;p=this._model;r=p.getLineAtOffset(this._getSelection().getCaret());if(m<x&&r!==
0)this._doAutoScroll("up",n,m-x);else if(m>l&&r!==p.getLineCount()-1)this._doAutoScroll("down",n,m-l);else if(n<h)this._doAutoScroll("left",n-h,m);else if(n>t)this._doAutoScroll("right",n-t,m);else{this._endAutoScroll();this._setSelectionTo(n,m,true);b&&this._frameDocument.body.getBoundingClientRect()}}},_handleMouseUp:function(h){if(!h)h=window.event;if(!this._linksVisible)if(h.which?h.button===0:h.button===1){this._isMouseDown=false;this._endAutoScroll();u&&this._setGrab(null)}},_handleMouseWheel:function(h){if(!h)h=
window.event;var n=this._getLineHeight(),m=0,l=0;if(e){n=o?h.detail*3:Math.max(-256,Math.min(256,h.detail))*n;if(h.axis===h.HORIZONTAL_AXIS)m=n;else l=n}else if(o){l=m=40;if(h.wheelDeltaX%120!==0)m=1;if(h.wheelDeltaY%120!==0)l=1;m=-h.wheelDeltaX/m;if(-1<m&&m<0)m=-1;if(0<m&&m<1)m=1;l=-h.wheelDeltaY/l;if(-1<l&&l<0)l=-1;if(0<l&&l<1)l=1}else{m=-h.wheelDeltaX;l=-h.wheelDeltaY/120*8*n}if(i){for(n=h.target;n&&n.lineIndex===undefined;)n=n.parentNode;this._mouseWheelLine=n}n=this._getScroll();this._scrollView(m,
l);m=this._getScroll();if(i)this._mouseWheelLine=null;if(n.x!==m.x||n.y!==m.y){h.preventDefault&&h.preventDefault();return false}},_handlePaste:function(h){if(!this._ignorePaste){if(!h)h=window.event;if(this._doPaste(h)){if(b){var n=this;setTimeout(function(){n._updateDOMSelection()},0)}h.preventDefault&&h.preventDefault();return false}}},_handleResize:function(){var h=this._frameDocument.documentElement,n=h.clientWidth;h=h.clientHeight;if(this._frameWidth!==n||this._frameHeight!==h){this._frameWidth=
n;this._frameHeight=h;this._updatePage()}},_handleRulerEvent:function(h){if(!h)h=window.event;var n=h.target?h.target:h.srcElement,m=n.lineIndex;for(n=n;n&&!n._ruler;){if(m===undefined&&n.lineIndex!==undefined)m=n.lineIndex;n=n.parentNode}n=n?n._ruler:null;if(m===undefined&&n&&n.getOverview()==="document"){m=j?0:17;var l=this._getClientHeight(),p=this._model.getLineCount(),t=this._getViewPadding();m=Math.floor((h.clientY-m)*p/(l+t.top+t.bottom-2*m));0<=m&&m<p||(m=undefined)}if(n)switch(h.type){case "click":n.onClick&&
n.onClick(m,h);break;case "dblclick":n.onDblClick&&n.onDblClick(m,h);break;case "mousemove":n.onMouseMove&&n.onMouseMove(m,h);break;case "mouseover":n.onMouseOver&&n.onMouseOver(m,h);break;case "mouseout":n.onMouseOut&&n.onMouseOut(m,h);break}},_handleScroll:function(){var h=this._getScroll(),n=this._hScroll,m=this._vScroll;if(n!==h.x||m!==h.y){this._hScroll=h.x;this._vScroll=h.y;this._commitIME();this._updatePage();this.onScroll({oldValue:{x:n,y:m},newValue:h})}},_handleSelectStart:function(h){if(!h)h=
window.event;if(this._ignoreSelect){h&&h.preventDefault&&h.preventDefault();return false}},_handleUnload:function(){this._destroyView()},_handleInput:function(h){var n=this._textArea;this._doContent(n.value);n.selectionStart=n.selectionEnd=0;n.value="";h.preventDefault()},_handleTextInput:function(h){this._doContent(h.data);h.preventDefault()},_touchConvert:function(h){var n=this._frame.getBoundingClientRect(),m=this._parentDocument.body;return{left:h.clientX-n.left-m.scrollLeft,top:h.clientY-n.top-
m.scrollTop}},_handleTextAreaClick:function(h){h=this._touchConvert(h);this._clickCount=1;this._ignoreDOMSelection=false;this._setSelectionTo(h.left,h.top,false);this._textArea.focus()},_handleTouchStart:function(h){var n=h.touches,m,l;this._touchMoved=false;this._touchStartScroll=undefined;if(n.length===1){m=n[0];l=m.pageY;this._touchStartX=m.pageX;this._touchStartY=l;this._touchStartTime=h.timeStamp;this._touchStartScroll=this._getScroll();h=this._getSelection();l=this._touchConvert(n[0]);this._touchGesture=
"none";if(!h.isEmpty())if(this._hitOffset(h.end,l.left,l.top))this._touchGesture="extendEnd";else if(this._hitOffset(h.start,l.left,l.top))this._touchGesture="extendStart";if(this._touchGesture==="none"){n=this._textArea;n.value="";n.style.left="-1000px";n.style.top="-1000px";n.style.width="3000px";n.style.height="3000px"}}else if(n.length===2){this._touchGesture="select";if(this._touchTimeout){clearTimeout(this._touchTimeout);this._touchTimeout=null}l=this._touchConvert(n[0]);m=this._getXToOffset(this._getYToLine(l.top),
l.left);l=this._touchConvert(n[1]);n=this._getXToOffset(this._getYToLine(l.top),l.left);h=this._getSelection();h.setCaret(m);h.extend(n);this._setSelection(h,true,true)}},_handleTouchMove:function(h){this._touchMoved=true;var n=h.touches,m;if(n.length===1){n=n[0];var l=n.pageX,p=n.pageY,t=this._touchStartX-l,r=this._touchStartY-p;m=this._touchConvert(n);n=this._getSelection();if(this._touchGesture==="none")this._touchGesture=h.timeStamp-this._touchStartTime<200&&(Math.abs(t)>5||Math.abs(r)>5)?"scroll":
"caret";if(this._touchGesture==="select")this._touchGesture=this._hitOffset(n.end,m.left,m.top)?"extendEnd":this._hitOffset(n.start,m.left,m.top)?"extendStart":"caret";switch(this._touchGesture){case "scroll":this._touchStartX=l;this._touchStartY=p;this._scrollView(t,r);break;case "extendStart":case "extendEnd":this._clickCount=1;m=this._getXToOffset(this._getYToLine(m.top),m.left);n.setCaret(this._touchGesture==="extendStart"?n.end:n.start);n.extend(m);if(m>=n.end&&this._touchGesture==="extendStart")this._touchGesture=
"extendEnd";if(m<=n.start&&this._touchGesture==="extendEnd")this._touchGesture="extendStart";this._setSelection(n,true,true);break;case "caret":this._setSelectionTo(m.left,m.top,false);break}}else if(n.length===2){m=this._touchConvert(n[0]);l=this._getXToOffset(this._getYToLine(m.top),m.left);m=this._touchConvert(n[1]);m=this._getXToOffset(this._getYToLine(m.top),m.left);n=this._getSelection();n.setCaret(l);n.extend(m);this._setSelection(n,true,true)}h.preventDefault()},_handleTouchEnd:function(h){var n=
this;if(!this._touchMoved)if(h.touches.length===0&&h.changedTouches.length===1){var m=this._touchConvert(h.changedTouches[0]),l=this._textArea;l.value="";l.style.left="-1000px";l.style.top="-1000px";l.style.width="3000px";l.style.height="3000px";setTimeout(function(){n._clickCount=1;n._ignoreDOMSelection=false;n._setSelectionTo(m.left,m.top,false)},300)}h.touches.length===0&&setTimeout(function(){var p=n._getSelection(),t=n._model.getText(p.start,p.end),r=n._textArea;r.value=t;r.selectionStart=0;
r.selectionEnd=t.length;if(!p.isEmpty()){t=n._touchDiv.getBoundingClientRect();p=n._getOffsetBounds(p.start);r.style.left=t.width/2+"px";r.style.top=(p.top>40?p.top-30:p.top+30)+"px"}},0)},_doAction:function(h){for(var n=this._keyBindings,m=0;m<n.length;m++){var l=n[m];if(l.keyBinding.match(h)){if(l.name){h=this._actions;for(n=0;n<h.length;n++){m=h[n];if(m.name===l.name){if(m.userHandler){if(!m.userHandler())if(m.defaultHandler)m.defaultHandler();else return false}else m.defaultHandler&&m.defaultHandler();
break}}}return true}}return false},_doBackspace:function(h){var n=this._getSelection();if(n.isEmpty()){var m=this._model,l=n.getCaret(),p=m.getLineAtOffset(l);if(l===m.getLineStart(p))p>0&&n.extend(m.getLineEnd(p-1));else n.extend(this._getOffset(l,h.unit,-1))}this._modifyContent({text:"",start:n.start,end:n.end},true);return true},_doContent:function(h){var n=this._getSelection();this._modifyContent({text:h,start:n.start,end:n.end,_ignoreDOMSelection:true},true)},_doCopy:function(h){var n=this._getSelection();
if(!n.isEmpty())return this._setClipboardText(this._getBaseText(n.start,n.end),h);return true},_doCursorNext:function(h){if(!h.select)if(this._clearSelection("next"))return true;var n=this._model,m=this._getSelection(),l=m.getCaret(),p=n.getLineAtOffset(l);if(l===n.getLineEnd(p))p+1<n.getLineCount()&&m.extend(n.getLineStart(p+1));else m.extend(this._getOffset(l,h.unit,1));h.select||m.collapse();this._setSelection(m,true);return true},_doCursorPrevious:function(h){if(!h.select)if(this._clearSelection("previous"))return true;
var n=this._model,m=this._getSelection(),l=m.getCaret(),p=n.getLineAtOffset(l);if(l===n.getLineStart(p))p>0&&m.extend(n.getLineEnd(p-1));else m.extend(this._getOffset(l,h.unit,-1));h.select||m.collapse();this._setSelection(m,true);return true},_doCut:function(h){var n=this._getSelection();if(!n.isEmpty()){n=this._getBaseText(n.start,n.end);this._doContent("");return this._setClipboardText(n,h)}return true},_doDelete:function(h){var n=this._getSelection();if(n.isEmpty()){var m=this._model,l=n.getCaret(),
p=m.getLineAtOffset(l);if(l===m.getLineEnd(p))p+1<m.getLineCount()&&n.extend(m.getLineStart(p+1));else n.extend(this._getOffset(l,h.unit,1))}this._modifyContent({text:"",start:n.start,end:n.end},true);return true},_doEnd:function(h){var n=this._getSelection(),m=this._model;if(h.ctrl)n.extend(m.getCharCount());else{var l=m.getLineAtOffset(n.getCaret());n.extend(m.getLineEnd(l))}h.select||n.collapse();this._setSelection(n,true);return true},_doEnter:function(h){var n=this._model,m=this._getSelection();
this._doContent(n.getLineDelimiter());if(h&&h.noCursor){m.end=m.start;this._setSelection(m)}return true},_doHome:function(h){var n=this._getSelection(),m=this._model;if(h.ctrl)n.extend(0);else{var l=m.getLineAtOffset(n.getCaret());n.extend(m.getLineStart(l))}h.select||n.collapse();this._setSelection(n,true);return true},_doLineDown:function(h){var n=this._model,m=this._getSelection(),l=m.getCaret(),p=n.getLineAtOffset(l);if(p+1<n.getLineCount()){var t=this._getScroll().x,r=this._columnX;if(r===-1||
h.select)r=this._getOffsetToX(h.wholeLine?n.getLineEnd(p+1):l)+t;m.extend(this._getXToOffset(p+1,r-t));h.select||m.collapse();this._setSelection(m,true,true);this._columnX=r}return true},_doLineUp:function(h){var n=this._model,m=this._getSelection(),l=m.getCaret(),p=n.getLineAtOffset(l);if(p>0){var t=this._getScroll().x,r=this._columnX;if(r===-1||h.select)r=this._getOffsetToX(h.wholeLine?n.getLineStart(p-1):l)+t;m.extend(this._getXToOffset(p-1,r-t));h.select||m.collapse();this._setSelection(m,true,
true);this._columnX=r}return true},_doPageDown:function(h){var n=this._model,m=this._getSelection(),l=m.getCaret(),p=n.getLineAtOffset(l),t=n.getLineCount();if(p<t-1){n=this._getScroll();var r=this._getClientHeight(),x=this._getLineHeight(),B=Math.floor(r/x),C=Math.min(t-p-1,B);C=Math.max(1,C);B=this._columnX;if(B===-1||h.select)B=this._getOffsetToX(l)+n.x;m.extend(this._getXToOffset(p+C,B-n.x));h.select||m.collapse();h=t*x;l=n.y+C*x;if(l+r>h)l=h-r;this._setSelection(m,true,true,l-n.y);this._columnX=
B}return true},_doPageUp:function(h){var n=this._model,m=this._getSelection(),l=m.getCaret(),p=n.getLineAtOffset(l);if(p>0){n=this._getScroll();var t=this._getClientHeight(),r=this._getLineHeight();t=Math.floor(t/r);var x=Math.max(1,Math.min(p,t));t=this._columnX;if(t===-1||h.select)t=this._getOffsetToX(l)+n.x;m.extend(this._getXToOffset(p-x,t-n.x));h.select||m.collapse();h=Math.max(0,n.y-x*r);this._setSelection(m,true,true,h-n.y);this._columnX=t}return true},_doPaste:function(h){(h=this._getClipboardText(h))&&
this._doContent(h);return h!==null},_doScroll:function(h){var n=h.type,m=this._model,l=m.getLineCount();h=this._getClientHeight();var p=this._getLineHeight();l=l*p;var t=this._getScroll().y,r;switch(n){case "textStart":r=0;break;case "textEnd":r=l-h;break;case "pageDown":r=t+h;break;case "pageUp":r=t-h;break;case "centerLine":n=this._getSelection();r=m.getLineAtOffset(n.start);m=(m.getLineAtOffset(n.end)-r+1)*p;r=r*p-h/2+m/2;break}if(r!==undefined){r=Math.min(Math.max(0,r),l-h);this._scrollView(0,
r-t)}},_doSelectAll:function(){var h=this._model,n=this._getSelection();n.setCaret(0);n.extend(h.getCharCount());this._setSelection(n,false);return true},_doTab:function(){this._doContent("\t");return true},_applyStyle:function(h,n){if(h){if(h.styleClass)n.className=h.styleClass;var m=h.style;if(m)for(var l in m)if(m.hasOwnProperty(l))n.style[l]=m[l];if(h=h.attributes)for(var p in h)h.hasOwnProperty(p)&&n.setAttribute(p,h[p])}},_autoScroll:function(){var h=this._getSelection(),n,m=this._autoScrollX;
if(this._autoScrollDir==="up"||this._autoScrollDir==="down"){var l=this._autoScrollY/this._getLineHeight();l=l<0?Math.floor(l):Math.ceil(l);n=this._model.getLineAtOffset(h.getCaret());n=Math.max(0,Math.min(this._model.getLineCount()-1,n+l))}else if(this._autoScrollDir==="left"||this._autoScrollDir==="right"){n=this._getYToLine(this._autoScrollY);m+=this._getOffsetToX(h.getCaret())}h.extend(this._getXToOffset(n,m));this._setSelection(h,true)},_autoScrollTimer:function(){this._autoScroll();var h=this;
this._autoScrollTimerID=setTimeout(function(){h._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeight:function(){var h=this._clientDiv,n=this._frameDocument,m=n.createElement("DIV");m.style.position="fixed";m.style.left="-1000px";var l=n.createElement("SPAN");l.appendChild(n.createTextNode(" "));m.appendChild(l);var p=n.createElement("SPAN");p.style.fontStyle="italic";p.appendChild(n.createTextNode(" "));m.appendChild(p);var t=n.createElement("SPAN");t.style.fontWeight="bold";t.appendChild(n.createTextNode(" "));
m.appendChild(t);var r=n.createElement("SPAN");r.style.fontWeight="bold";r.style.fontStyle="italic";r.appendChild(n.createTextNode(" "));m.appendChild(r);h.appendChild(m);n=l.getBoundingClientRect();p=p.getBoundingClientRect();l=t.getBoundingClientRect();var x=r.getBoundingClientRect();r=n.bottom-n.top;t=p.bottom-p.top;n=l.bottom-l.top;p=x.bottom-x.top;l=0;x=r;if(t>r){x=t;l=1}if(n>t){x=n;l=2}if(p>n){x=p;l=3}this._largestFontStyle=l;h.removeChild(m);return x},_calculatePadding:function(){var h=this._frameDocument,
n=this._clientDiv,m=this._getPadding(this._viewDiv),l=h.createElement("DIV");l.style.position="fixed";l.style.left="-1000px";l.style.paddingLeft=m.left+"px";l.style.paddingTop=m.top+"px";l.style.paddingRight=m.right+"px";l.style.paddingBottom=m.bottom+"px";l.style.width="100px";l.style.height="100px";m=h.createElement("DIV");m.style.width="100%";m.style.height="100%";l.appendChild(m);n.appendChild(l);h=l.getBoundingClientRect();m=m.getBoundingClientRect();n.removeChild(l);return m={left:m.left-h.left,
top:m.top-h.top,right:h.right-m.right,bottom:h.bottom-m.bottom}},_clearSelection:function(h){var n=this._getSelection();if(n.isEmpty())return false;if(h==="next")n.start=n.end;else n.end=n.start;this._setSelection(n,true);return true},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();var h=this._model,n=h.getLineAtOffset(this._imeOffset),m=h.getLineStart(n),l=this._getDOMText(n);h=h.getLine(n);m=this._imeOffset-m;h=m+l.length-h.length;m!==h&&this._doContent(l.substring(m,
h));this._imeOffset=-1}},_convertDelimiter:function(h,n,m){for(var l=0,p=0,t=0,r=h.length;t<r;){if(l!==-1&&l<=t)l=h.indexOf("\r",t);if(p!==-1&&p<=t)p=h.indexOf("\n",t);var x=t,B;if(p===-1&&l===-1){n(h.substring(t));break}if(l!==-1&&p!==-1)if(l+1===p){B=l;t=p+1}else{B=l<p?l:p;t=(l<p?l:p)+1}else if(l!==-1){B=l;t=l+1}else{B=p;t=p+1}n(h.substring(x,B));m()}},_createActions:function(){var h=orion.textview.KeyBinding,n=this._keyBindings=[];n.push({name:"lineUp",keyBinding:new h(38),predefined:true});n.push({name:"lineDown",
keyBinding:new h(40),predefined:true});n.push({name:"charPrevious",keyBinding:new h(37),predefined:true});n.push({name:"charNext",keyBinding:new h(39),predefined:true});if(o){n.push({name:"scrollPageUp",keyBinding:new h(33),predefined:true});n.push({name:"scrollPageDown",keyBinding:new h(34),predefined:true});n.push({name:"pageUp",keyBinding:new h(33,null,null,true),predefined:true});n.push({name:"pageDown",keyBinding:new h(34,null,null,true),predefined:true});n.push({name:"lineStart",keyBinding:new h(37,
true),predefined:true});n.push({name:"lineEnd",keyBinding:new h(39,true),predefined:true});n.push({name:"wordPrevious",keyBinding:new h(37,null,null,true),predefined:true});n.push({name:"wordNext",keyBinding:new h(39,null,null,true),predefined:true});n.push({name:"scrollTextStart",keyBinding:new h(36),predefined:true});n.push({name:"scrollTextEnd",keyBinding:new h(35),predefined:true});n.push({name:"textStart",keyBinding:new h(38,true),predefined:true});n.push({name:"textEnd",keyBinding:new h(40,
true),predefined:true})}else{n.push({name:"pageUp",keyBinding:new h(33),predefined:true});n.push({name:"pageDown",keyBinding:new h(34),predefined:true});n.push({name:"lineStart",keyBinding:new h(36),predefined:true});n.push({name:"lineEnd",keyBinding:new h(35),predefined:true});n.push({name:"wordPrevious",keyBinding:new h(37,true),predefined:true});n.push({name:"wordNext",keyBinding:new h(39,true),predefined:true});n.push({name:"textStart",keyBinding:new h(36,true),predefined:true});n.push({name:"textEnd",
keyBinding:new h(35,true),predefined:true})}n.push({name:"selectLineUp",keyBinding:new h(38,null,true),predefined:true});n.push({name:"selectLineDown",keyBinding:new h(40,null,true),predefined:true});n.push({name:"selectCharPrevious",keyBinding:new h(37,null,true),predefined:true});n.push({name:"selectCharNext",keyBinding:new h(39,null,true),predefined:true});n.push({name:"selectPageUp",keyBinding:new h(33,null,true),predefined:true});n.push({name:"selectPageDown",keyBinding:new h(34,null,true),predefined:true});
if(o){n.push({name:"selectLineStart",keyBinding:new h(37,true,true),predefined:true});n.push({name:"selectLineEnd",keyBinding:new h(39,true,true),predefined:true});n.push({name:"selectWordPrevious",keyBinding:new h(37,null,true,true),predefined:true});n.push({name:"selectWordNext",keyBinding:new h(39,null,true,true),predefined:true});n.push({name:"selectTextStart",keyBinding:new h(36,null,true),predefined:true});n.push({name:"selectTextEnd",keyBinding:new h(35,null,true),predefined:true});n.push({name:"selectTextStart",
keyBinding:new h(38,true,true),predefined:true});n.push({name:"selectTextEnd",keyBinding:new h(40,true,true),predefined:true})}else{if(v){n.push({name:"selectWholeLineUp",keyBinding:new h(38,true,true),predefined:true});n.push({name:"selectWholeLineDown",keyBinding:new h(40,true,true),predefined:true})}n.push({name:"selectLineStart",keyBinding:new h(36,null,true),predefined:true});n.push({name:"selectLineEnd",keyBinding:new h(35,null,true),predefined:true});n.push({name:"selectWordPrevious",keyBinding:new h(37,
true,true),predefined:true});n.push({name:"selectWordNext",keyBinding:new h(39,true,true),predefined:true});n.push({name:"selectTextStart",keyBinding:new h(36,true,true),predefined:true});n.push({name:"selectTextEnd",keyBinding:new h(35,true,true),predefined:true})}n.push({name:"deletePrevious",keyBinding:new h(8),predefined:true});n.push({name:"deletePrevious",keyBinding:new h(8,null,true),predefined:true});n.push({name:"deleteNext",keyBinding:new h(46),predefined:true});n.push({name:"deleteWordPrevious",
keyBinding:new h(8,true),predefined:true});n.push({name:"deleteWordPrevious",keyBinding:new h(8,true,true),predefined:true});n.push({name:"deleteWordNext",keyBinding:new h(46,true),predefined:true});n.push({name:"tab",keyBinding:new h(9),predefined:true});n.push({name:"enter",keyBinding:new h(13),predefined:true});n.push({name:"enter",keyBinding:new h(13,null,true),predefined:true});n.push({name:"selectAll",keyBinding:new h("a",true),predefined:true});if(o){n.push({name:"deleteNext",keyBinding:new h(46,
null,true),predefined:true});n.push({name:"deleteWordPrevious",keyBinding:new h(8,null,null,true),predefined:true});n.push({name:"deleteWordNext",keyBinding:new h(46,null,null,true),predefined:true})}if(!e){var m=o&&g;n.push({name:null,keyBinding:new h("u",!m,false,false,m),predefined:true});n.push({name:null,keyBinding:new h("i",!m,false,false,m),predefined:true});n.push({name:null,keyBinding:new h("b",!m,false,false,m),predefined:true})}if(e){n.push({name:"copy",keyBinding:new h(45,true),predefined:true});
n.push({name:"paste",keyBinding:new h(45,null,true),predefined:true});n.push({name:"cut",keyBinding:new h(46,null,true),predefined:true})}if(o){n.push({name:"lineStart",keyBinding:new h("a",false,false,false,true),predefined:true});n.push({name:"lineEnd",keyBinding:new h("e",false,false,false,true),predefined:true});n.push({name:"lineUp",keyBinding:new h("p",false,false,false,true),predefined:true});n.push({name:"lineDown",keyBinding:new h("n",false,false,false,true),predefined:true});n.push({name:"charPrevious",
keyBinding:new h("b",false,false,false,true),predefined:true});n.push({name:"charNext",keyBinding:new h("f",false,false,false,true),predefined:true});n.push({name:"deletePrevious",keyBinding:new h("h",false,false,false,true),predefined:true});n.push({name:"deleteNext",keyBinding:new h("d",false,false,false,true),predefined:true});n.push({name:"deleteLineEnd",keyBinding:new h("k",false,false,false,true),predefined:true});if(e){n.push({name:"scrollPageDown",keyBinding:new h("v",false,false,false,true),
predefined:true});n.push({name:"deleteLineStart",keyBinding:new h("u",false,false,false,true),predefined:true});n.push({name:"deleteWordPrevious",keyBinding:new h("w",false,false,false,true),predefined:true})}else{n.push({name:"pageDown",keyBinding:new h("v",false,false,false,true),predefined:true});n.push({name:"centerLine",keyBinding:new h("l",false,false,false,true),predefined:true});n.push({name:"enterNoCursor",keyBinding:new h("o",false,false,false,true),predefined:true})}}var l=this;this._actions=
[{name:"lineUp",defaultHandler:function(){return l._doLineUp({select:false})}},{name:"lineDown",defaultHandler:function(){return l._doLineDown({select:false})}},{name:"lineStart",defaultHandler:function(){return l._doHome({select:false,ctrl:false})}},{name:"lineEnd",defaultHandler:function(){return l._doEnd({select:false,ctrl:false})}},{name:"charPrevious",defaultHandler:function(){return l._doCursorPrevious({select:false,unit:"character"})}},{name:"charNext",defaultHandler:function(){return l._doCursorNext({select:false,
unit:"character"})}},{name:"pageUp",defaultHandler:function(){return l._doPageUp({select:false})}},{name:"pageDown",defaultHandler:function(){return l._doPageDown({select:false})}},{name:"scrollPageUp",defaultHandler:function(){return l._doScroll({type:"pageUp"})}},{name:"scrollPageDown",defaultHandler:function(){return l._doScroll({type:"pageDown"})}},{name:"wordPrevious",defaultHandler:function(){return l._doCursorPrevious({select:false,unit:"word"})}},{name:"wordNext",defaultHandler:function(){return l._doCursorNext({select:false,
unit:"word"})}},{name:"textStart",defaultHandler:function(){return l._doHome({select:false,ctrl:true})}},{name:"textEnd",defaultHandler:function(){return l._doEnd({select:false,ctrl:true})}},{name:"scrollTextStart",defaultHandler:function(){return l._doScroll({type:"textStart"})}},{name:"scrollTextEnd",defaultHandler:function(){return l._doScroll({type:"textEnd"})}},{name:"centerLine",defaultHandler:function(){return l._doScroll({type:"centerLine"})}},{name:"selectLineUp",defaultHandler:function(){return l._doLineUp({select:true})}},
{name:"selectLineDown",defaultHandler:function(){return l._doLineDown({select:true})}},{name:"selectWholeLineUp",defaultHandler:function(){return l._doLineUp({select:true,wholeLine:true})}},{name:"selectWholeLineDown",defaultHandler:function(){return l._doLineDown({select:true,wholeLine:true})}},{name:"selectLineStart",defaultHandler:function(){return l._doHome({select:true,ctrl:false})}},{name:"selectLineEnd",defaultHandler:function(){return l._doEnd({select:true,ctrl:false})}},{name:"selectCharPrevious",
defaultHandler:function(){return l._doCursorPrevious({select:true,unit:"character"})}},{name:"selectCharNext",defaultHandler:function(){return l._doCursorNext({select:true,unit:"character"})}},{name:"selectPageUp",defaultHandler:function(){return l._doPageUp({select:true})}},{name:"selectPageDown",defaultHandler:function(){return l._doPageDown({select:true})}},{name:"selectWordPrevious",defaultHandler:function(){return l._doCursorPrevious({select:true,unit:"word"})}},{name:"selectWordNext",defaultHandler:function(){return l._doCursorNext({select:true,
unit:"word"})}},{name:"selectTextStart",defaultHandler:function(){return l._doHome({select:true,ctrl:true})}},{name:"selectTextEnd",defaultHandler:function(){return l._doEnd({select:true,ctrl:true})}},{name:"deletePrevious",defaultHandler:function(){return l._doBackspace({unit:"character"})}},{name:"deleteNext",defaultHandler:function(){return l._doDelete({unit:"character"})}},{name:"deleteWordPrevious",defaultHandler:function(){return l._doBackspace({unit:"word"})}},{name:"deleteWordNext",defaultHandler:function(){return l._doDelete({unit:"word"})}},
{name:"deleteLineStart",defaultHandler:function(){return l._doBackspace({unit:"line"})}},{name:"deleteLineEnd",defaultHandler:function(){return l._doDelete({unit:"line"})}},{name:"tab",defaultHandler:function(){return l._doTab()}},{name:"enter",defaultHandler:function(){return l._doEnter()}},{name:"enterNoCursor",defaultHandler:function(){return l._doEnter({noCursor:true})}},{name:"selectAll",defaultHandler:function(){return l._doSelectAll()}},{name:"copy",defaultHandler:function(){return l._doCopy()}},
{name:"cut",defaultHandler:function(){return l._doCut()}},{name:"paste",defaultHandler:function(){return l._doPaste()}}]},_createLine:function(h,n,m,l,p){var t=p.getLine(l),r=p.getLineStart(l),x={textView:this,lineIndex:l,lineText:t,lineStart:r};this.onLineStyle(x);p=m.createElement("DIV");p.lineIndex=l;this._applyStyle(x.style,p);if(t.length!==0){var B=0;if((l=this._customTabSize)&&l!==8)for(var C=t.indexOf("\t"),D=0;C!==-1;){this._createRanges(p,m,x.ranges,B,C,t,r);var E=l-(C+D)%l,H="\u00a0";for(B=
1;B<E;B++)H+=" ";B=m.createElement("SPAN");B.appendChild(m.createTextNode(H));B.ignoreChars=E-1;D+=B.ignoreChars;if(x.ranges)for(E=0;E<x.ranges.length;E++){H=x.ranges[E];var K=H.start-r,L=H.end-r;if(K>C)break;if(K<=C&&C<L){this._applyStyle(H.style,B);break}}p.appendChild(B);B=C+1;C=t.indexOf("\t",B)}this._createRanges(p,m,x.ranges,B,t.length,t,r)}t=m.createElement("SPAN");t.ignoreChars=1;if((this._largestFontStyle&1)!==0)t.style.fontStyle="italic";if((this._largestFontStyle&2)!==0)t.style.fontWeight=
"bold";r=" ";if(!this._fullSelection&&b<9)r="\ufeff";if(k)r="\u200c";t.appendChild(m.createTextNode(r));p.appendChild(t);h.insertBefore(p,n);return p},_createRanges:function(h,n,m,l,p,t,r){if(!(l>=p)){if(m)for(var x=0;x<m.length;x++){var B=m[x];if(!(B.end<=r+l)){var C=Math.max(r+l,B.start)-r;if(C>=p)break;var D=Math.min(r+p,B.end)-r;if(C<D){C=Math.max(l,C);D=Math.min(p,D);l<C&&h.appendChild(this._createRange(h,n,t.substring(l,C),null));h.appendChild(this._createRange(h,n,t.substring(C,D),B.style));
l=D}}}l<p&&h.appendChild(this._createRange(h,n,t.substring(l,p),null))}},_createRange:function(h,n,m,l){var p=l&&l.tagName==="A";if(p)h.hasLink=true;h=p&&this._linksVisible?"A":"SPAN";p=n.createElement(h);p.appendChild(n.createTextNode(m));this._applyStyle(l,p);if(h==="A"){var t=this;d(p,"click",function(r){return t._handleLinkClick(r)},false)}p.viewStyle=l;return p},_createRuler:function(h){if(this._clientDiv){var n=this._frameDocument,m=n.body,l=h.getLocation(),p=l==="left"?this._leftDiv:this._rightDiv;
if(!p){p=n.createElement("DIV");p.style.overflow="hidden";p.style.MozUserSelect="none";p.style.WebkitUserSelect="none";b&&p.attachEvent("onselectstart",function(){return false});p.style.position="absolute";p.style.top="0px";p.style.cursor="default";m.appendChild(p);if(l==="left"){this._leftDiv=p;p.className="viewLeftRuler"}else{this._rightDiv=p;p.className="viewRightRuler"}m=n.createElement("TABLE");p.appendChild(m);m.cellPadding="0px";m.cellSpacing="0px";m.border="0px";m.insertRow(0);var t=this;
d(p,"click",function(r){t._handleRulerEvent(r)});d(p,"dblclick",function(r){t._handleRulerEvent(r)});d(p,"mousemove",function(r){t._handleRulerEvent(r)});d(p,"mouseover",function(r){t._handleRulerEvent(r)});d(p,"mouseout",function(r){t._handleRulerEvent(r)})}n=n.createElement("DIV");n._ruler=h;n.rulerChanged=true;n.style.position="relative";h=p.firstChild.rows[0];h=h.insertCell(h.cells.length);h.vAlign="top";h.appendChild(n)}},_createFrame:function(){if(!this.frame){for(var h=this._parent;h.hasChildNodes();)h.removeChild(h.lastChild);
var n=h.ownerDocument;this._parentDocument=n;var m=n.createElement("IFRAME");this._frame=m;m.frameBorder="0px";m.style.border="0px";m.style.width="100%";m.style.height="100%";m.scrolling="no";var l=this;d(m,"load",this._loadHandler=function(p){l._handleLoad(p)});if(!k)d(n,"DOMAttrModified",this._attrModifiedHandler=function(p){l._handleDOMAttrModified(p)});h.appendChild(m);this._handleLoad()}},_getFrameHTML:function(h){var n=[];n.push("<!DOCTYPE html>");n.push("<html>");n.push("<head>");b<9&&n.push("<meta http-equiv='X-UA-Compatible' content='IE=EmulateIE7'/>");
n.push("<style>");n.push(".viewContainer {font-family: monospace; font-size: 10pt;}");n.push(".view {padding: 1px 2px;}");n.push(".viewContent {}");n.push("</style>");if(this._stylesheet)for(var m=typeof this._stylesheet==="string"?[this._stylesheet]:this._stylesheet,l=0;l<m.length;l++){if(h)try{var p=new XMLHttpRequest;p.overrideMimeType&&p.overrideMimeType("text/css");p.open("GET",m[l],false);p.send(null);n.push("<style>");n.push(p.responseText);n.push("</style>");continue}catch(t){}n.push("<link rel='stylesheet' type='text/css' href='");
n.push(m[l]);n.push("'></link>")}n.push("</head>");n.push("<body spellcheck='false'></body>");n.push("</html>");return n.join("")},_createView:function(h){if(!this._clientDiv)if(!this._ignoreCreate){this._ignoreCreate=true;var n=this._parent,m=this._parentDocument,l=this._frame.contentWindow;this._frameWindow=l;var p=l.document;this._frameDocument=p;p.open();p.write(this._getFrameHTML(true));p.close();l=p.body;l.className="viewContainer";l.style.margin="0px";l.style.borderWidth="0px";l.style.padding=
"0px";if(j){var t=m.createElement("DIV");this._touchDiv=t;t.style.position="absolute";t.style.border="0px";t.style.padding="0px";t.style.margin="0px";t.style.zIndex="2";t.style.overflow="hidden";t.style.background="transparent";t.style.WebkitUserSelect="none";n.appendChild(t);this._textArea=n=m.createElement("TEXTAREA");n.style.position="absolute";n.style.whiteSpace="pre";n.style.left="-1000px";n.tabIndex=1;n.autocapitalize=false;n.autocorrect=false;n.className="viewContainer";n.style.background=
"transparent";n.style.color="transparent";n.style.border="0px";n.style.padding="0px";n.style.margin="0px";n.style.borderRadius="0px";n.style.WebkitAppearance="none";n.style.WebkitTapHighlightColor="transparent";t.appendChild(n)}if(e){this._clipboardDiv=n=p.createElement("DIV");n.style.position="fixed";n.style.whiteSpace="pre";n.style.left="-1000px";l.appendChild(n)}m=p.createElement("DIV");m.className="view";this._viewDiv=m;m.id="viewDiv";m.tabIndex=-1;m.style.overflow="auto";m.style.position="absolute";
m.style.top="0px";m.style.borderWidth="0px";m.style.margin="0px";m.style.MozOutline="none";m.style.outline="none";l.appendChild(m);this._scrollDiv=n=p.createElement("DIV");n.id="scrollDiv";n.style.margin="0px";n.style.borderWidth="0px";n.style.padding="0px";m.appendChild(n);if(j||this._fullSelection&&!k){this._hightlightRGB="Highlight";this._selDiv1=m=p.createElement("DIV");m.id="selDiv1";m.style.position="fixed";m.style.borderWidth="0px";m.style.margin="0px";m.style.padding="0px";m.style.MozOutline=
"none";m.style.outline="none";m.style.background=this._hightlightRGB;m.style.width="0px";m.style.height="0px";n.appendChild(m);this._selDiv2=t=p.createElement("DIV");t.id="selDiv2";t.style.position="fixed";t.style.borderWidth="0px";t.style.margin="0px";t.style.padding="0px";t.style.MozOutline="none";t.style.outline="none";t.style.background=this._hightlightRGB;t.style.width="0px";t.style.height="0px";n.appendChild(t);var r=p.createElement("DIV");this._selDiv3=r;r.id="selDiv3";r.style.position="fixed";
r.style.borderWidth="0px";r.style.margin="0px";r.style.padding="0px";r.style.MozOutline="none";r.style.outline="none";r.style.background=this._hightlightRGB;r.style.width="0px";r.style.height="0px";n.appendChild(r);if(e&&o){var x=this._frameWindow.getComputedStyle(r,null).getPropertyValue("background-color");switch(x){case "rgb(119, 141, 168)":x="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":x="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":x="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":x=
"rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":x="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":x="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":x="rgb(232, 184, 255)";break;default:x="rgb(180, 213, 255)";break}this._hightlightRGB=x;m.style.background=x;t.style.background=x;r.style.background=x;p.styleSheets[0].insertRule("::-moz-selection {background: "+x+"; }",0)}}m=p.createElement("DIV");m.className="viewContent";this._clientDiv=m;m.id="clientDiv";m.style.whiteSpace="pre";m.style.position=
"fixed";m.style.borderWidth="0px";m.style.margin="0px";m.style.padding="0px";m.style.MozOutline="none";m.style.outline="none";if(j)m.style.WebkitTapHighlightColor="transparent";n.appendChild(m);if(e){this._overlayDiv=p=p.createElement("DIV");p.id="overlayDiv";p.style.position=m.style.position;p.style.borderWidth=m.style.borderWidth;p.style.margin=m.style.margin;p.style.padding=m.style.padding;p.style.cursor="text";p.style.zIndex="1";n.appendChild(p)}if(!j)m.contentEditable="true";this._lineHeight=
this._calculateLineHeight();this._viewPadding=this._calculatePadding();if(b)l.style.lineHeight=this._lineHeight+"px";if(this._tabSize)if(f)m.style.OTabSize=this._tabSize+"";else if(e>=4)m.style.MozTabSize=this._tabSize+"";else if(this._tabSize!==8)this._customTabSize=this._tabSize;this._hookEvents();l=this._rulers;for(p=0;p<l.length;p++)this._createRuler(l[p]);if(h)this._updatePage();else{this._queueUpdatePage();var B=this._hScroll,C=this._vScroll;this._vScroll=this._hScroll=0;if(B>0||C>0){var D=
this;setTimeout(function(){D._scrollView(B,C)},0)}}this._ignoreCreate=false}},_destroyFrame:function(){var h=this._frame;if(h){if(this._loadHandler){c(h,"load",this._loadHandler);this._loadHandler=null}if(this._attrModifiedHandler){c(this._parentDocument,"DOMAttrModified",this._attrModifiedHandler);this._attrModifiedHandler=null}h.parentNode.removeChild(h);this._frameWindow=this._frameDocument=this._frame=null}},_destroyRuler:function(h){var n=h.getLocation()==="left"?this._leftDiv:this._rightDiv;
if(n){n=n.firstChild.rows[0];for(var m=n.cells,l=0;l<m.length;l++)if(m[l].firstChild._ruler===h)break;if(l!==m.length){n.cells[l]._ruler=undefined;n.deleteCell(l)}}},_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 h=this._frameDocument.body;h.hasChildNodes();)h.removeChild(h.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(h,n,m){this._autoScrollDir=h;this._autoScrollX=n;this._autoScrollY=m;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=
this._autoScrollDir=undefined},_getBaseText:function(h,n){var m=this._model;if(m.getBaseModel){h=m.mapOffset(h);n=m.mapOffset(n);m=m.getBaseModel()}return m.getText(h,n)},_getBoundsAtOffset:function(h){var n=this._model,m=this._frameDocument,l=this._clientDiv,p=n.getLineAtOffset(h),t,r=this._getLineNode(p);r||(r=t=this._createLine(l,null,m,p,n));var x=null;if(h<n.getLineEnd(p)){n=n.getLineStart(p);for(p=r.firstChild;p;){var B=p.firstChild,C=B.length;if(p.ignoreChars)C-=p.ignoreChars;if(n+C>h){x=h-
n;if(s){m=m.createRange();m.setStart(B,x);m.setEnd(B,x+1);x=m.getBoundingClientRect()}else if(b){m=m.body.createTextRange();m.moveToElementText(p);m.collapse();m.moveEnd("character",x+1);m.moveStart("character",x);x=m.getBoundingClientRect()}else{h=B.data;p.removeChild(B);p.appendChild(m.createTextNode(h.substring(0,x)));var D=m.createElement("SPAN");D.appendChild(m.createTextNode(h.substring(x,x+1)));p.appendChild(D);p.appendChild(m.createTextNode(h.substring(x+1)));x=D.getBoundingClientRect();p.innerHTML=
"";p.appendChild(B);if(!t){m=this._getSelection();if(n<=m.start&&m.start<n+C||n<=m.end&&m.end<n+C)this._updateDOMSelection()}}if(b){m=window.screen.logicalXDPI;n=window.screen.deviceXDPI;x.left=x.left*m/n;x.right=x.right*m/n}break}n+=C;p=p.nextSibling}}if(!x){r=this._getLineBoundingClientRect(r);x={left:r.right,right:r.right}}t&&l.removeChild(t);return x},_getBottomIndex:function(h){var n=this._bottomChild;if(h&&this._getClientHeight()>this._getLineHeight()){h=n.getBoundingClientRect();var m=this._clientDiv.getBoundingClientRect();
if(h.bottom>m.bottom)n=this._getLinePrevious(n)||n}return n.lineIndex},_getFrameHeight:function(){return this._frameDocument.documentElement.clientHeight},_getFrameWidth:function(){return this._frameDocument.documentElement.clientWidth},_getClientHeight:function(){var h=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-h.top-h.bottom)},_getClientWidth:function(){var h=this._getViewPadding();return Math.max(0,this._viewDiv.clientWidth-h.left-h.right)},_getClipboardText:function(h){var n=
this._model.getLineDelimiter(),m;if(this._frameWindow.clipboardData){m=[];h=this._frameWindow.clipboardData.getData("Text");this._convertDelimiter(h,function(C){m.push(C)},function(){m.push(n)});return m.join("")}if(e){var l=this._frameDocument,p=this._clipboardDiv;p.innerHTML="<pre contenteditable=''></pre>";p.firstChild.focus();var t=this,r=function(){var C=t._getTextFromElement(p);p.innerHTML="";m=[];t._convertDelimiter(C,function(D){m.push(D)},function(){m.push(n)});return m.join("")},x=false;
this._ignorePaste=true;try{x=l.execCommand("paste",false,null)}catch(B){}this._ignorePaste=false;if(!x)if(h){setTimeout(function(){t.focus();var C=r();C&&t._doContent(C)},0);return null}else{this.focus();return""}this.focus();return r()}if(h&&h.clipboardData){m=[];h=h.clipboardData.getData("text/plain");this._convertDelimiter(h,function(C){m.push(C)},function(){m.push(n)});return m.join("")}return""},_getDOMText:function(h){h=this._getLineNode(h).firstChild;for(var n="";h;){for(var m=h.firstChild;m;){if(h.ignoreChars)for(var l=
0;l<m.length;l++){var p=m.data.substring(l,l+1);if(p!==" ")n+=p}else n+=m.data;m=m.nextSibling}h=h.nextSibling}return n},_getTextFromElement:function(h){var n=h.ownerDocument,m=n.defaultView;if(!m.getSelection)return h.innerText||h.textContent;n=n.createRange();n.selectNode(h);h=m.getSelection();m=[];for(var l=0;l<h.rangeCount;l++)m.push(h.getRangeAt(l));this._ignoreSelect=true;h.removeAllRanges();h.addRange(n);n=h.toString();h.removeAllRanges();for(l=0;l<m.length;l++)h.addRange(m[l]);this._ignoreSelect=
false;return n},_getViewPadding:function(){return this._viewPadding},_getLineBoundingClientRect:function(h){var n=h.getBoundingClientRect();for(h=h.lastChild;h&&h.ignoreChars===h.firstChild.length;)h=h.previousSibling;if(!h)return{left:n.left,top:n.top,right:n.left,bottom:n.bottom};h=h.getBoundingClientRect();return{left:n.left,top:n.top,right:h.right,bottom:n.bottom}},_getLineHeight:function(){return this._lineHeight},_getLineNode:function(h){for(var n=this._clientDiv.firstChild;n;){if(h===n.lineIndex)return n;
n=n.nextSibling}},_getLineNext:function(h){for(h=h?h.nextSibling:this._clientDiv.firstChild;h&&h.lineIndex===-1;)h=h.nextSibling;return h},_getLinePrevious:function(h){for(h=h?h.previousSibling:this._clientDiv.lastChild;h&&h.lineIndex===-1;)h=h.previousSibling;return h},_getOffset:function(h,n,m){if(n==="line"){n=this._model;h=n.getLineAtOffset(h);if(m>0)return n.getLineEnd(h);return n.getLineStart(h)}if(n==="wordend")return this._getOffset_W3C(h,n,m);return b?this._getOffset_IE(h,n,m):this._getOffset_W3C(h,
n,m)},_getOffset_W3C:function(h,n,m){function l(E){return 33<=E&&E<=47||58<=E&&E<=64||91<=E&&E<=94||E===96||123<=E&&E<=126}function p(E){return E===32||E===9}if(n==="word"||n==="wordend"){var t=this._model,r=t.getLineAtOffset(h),x=t.getLine(r),B=t.getLineStart(r);r=t.getLineEnd(r);t=x.length;h=h-B;var C,D;if(m>0){if(h===t)return r;C=x.charCodeAt(h);D=l(C);m=!D&&!p(C);for(h++;h<t;){C=x.charCodeAt(h);r=l(C);if(n==="wordend"){if(!r&&D)break}else if(r&&!D)break;C=!r&&!p(C);if(n==="wordend"){if(!C&&m)break}else if(C&&
!m)break;m=C;D=r;h++}}else{if(h===0)return B;h--;C=x.charCodeAt(h);D=l(C);for(m=!D&&!p(C);0<h;){C=x.charCodeAt(h-1);r=l(C);if(n==="wordend"){if(r&&!D)break}else if(!r&&D)break;C=!r&&!p(C);if(n==="wordend"){if(C&&!m)break}else if(!C&&m)break;m=C;D=r;h--}}return B+h}return h+m},_getOffset_IE:function(h,n,m){var l=this._frameDocument,p=this._model,t=p.getLineAtOffset(h),r=this._clientDiv,x,B=this._getLineNode(t);B||(B=x=this._createLine(r,null,l,t,p));var C=0,D;D=p.getLineStart(t);if(h===p.getLineEnd(t)){l=
l.body.createTextRange();l.moveToElementText(B.lastChild);D=l.text.length;l.moveEnd(n,m);C=h+l.text.length-D}else if(h===D&&m<0)C=D;else for(B=B.firstChild;B;){p=B.firstChild.length;if(B.ignoreChars)p-=B.ignoreChars;if(D+p>h){l=l.body.createTextRange();if(h===D&&m<0)l.moveToElementText(B.previousSibling);else{l.moveToElementText(B);l.collapse();l.moveEnd("character",h-D)}D=l.text.length;l.moveEnd(n,m);C=h+l.text.length-D;break}D=p+D;B=B.nextSibling}x&&r.removeChild(x);return C},_getOffsetToX:function(h){return this._getBoundsAtOffset(h).left},
_getPadding:function(h){var n,m,l,p;if(h.currentStyle){n=h.currentStyle.paddingLeft;m=h.currentStyle.paddingTop;l=h.currentStyle.paddingRight;p=h.currentStyle.paddingBottom}else if(this._frameWindow.getComputedStyle){h=this._frameWindow.getComputedStyle(h,null);n=h.getPropertyValue("padding-left");m=h.getPropertyValue("padding-top");l=h.getPropertyValue("padding-right");p=h.getPropertyValue("padding-bottom")}return{left:parseInt(n,10),top:parseInt(m,10),right:parseInt(l,10),bottom:parseInt(p,10)}},
_getScroll:function(){var h=this._viewDiv;return{x:h.scrollLeft,y:h.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(h){var n=this._topChild;if(h&&this._getClientHeight()>this._getLineHeight()){h=n.getBoundingClientRect();var m=this._getViewPadding(),l=this._viewDiv.getBoundingClientRect();if(h.top<l.top+m.top)n=this._getLineNext(n)||n}return n.lineIndex},_getXToOffset:function(h,n){function m(S){var T,X,da,fa;if(!S._rectsCache){T=S.getClientRects();X=[T.length];
for(da=0;da<T.length;da++){fa=T[da];X[da]={left:fa.left-D+K,top:fa.top,right:fa.right-D+K,bottom:fa.bottom}}S._rectsCache=X}T=S._rectsCache;X=[T.length];for(da=0;da<T.length;da++){fa=T[da];X[da]={left:fa.left-K,top:fa.top,right:fa.right-K,bottom:fa.bottom}}return X}var l=this._model,p=l.getLineStart(h),t=l.getLineEnd(h);if(p===t)return p;var r=this._frameDocument,x=this._clientDiv,B,C=this._getLineNode(h);C||(C=B=this._createLine(x,null,r,h,l));h=this._getLineBoundingClientRect(C);if(n<h.left)n=h.left;
if(n>h.right)n=h.right;var D=0,E;if(b<9){E=C.getClientRects();l=E[0].left;for(var H=1;H<E.length;H++)l=Math.min(E[H].left,l);D=l-h.left}var K=this._getScroll().x,L=b?window.screen.logicalXDPI:1,Q=b?window.screen.deviceXDPI:1;h=p;l=C.firstChild;a:for(;l;){H=l.firstChild;C=H.length;if(l.ignoreChars)C-=l.ignoreChars;E=m(l);for(var P=0;P<E.length;P++){var R=E[P];if(R.left<=n&&n<R.right){if(b||s){r=s?r.createRange():r.body.createTextRange();P=C;for(var $=-1;P-$>1;){var A=Math.floor((P+$)/2);E=$+1;R=A===
C-1&&l.ignoreChars?H.length:A+1;if(s){r.setStart(H,E);r.setEnd(H,R)}else{r.moveToElementText(l);r.move("character",E);r.moveEnd("character",R-E)}E=r.getClientRects();for(var F=false,I=0;I<E.length;I++){R=E[I];var O=R.right*L/Q-D;if(R.left*L/Q-D<=n&&n<O){F=true;break}}if(F)P=A;else $=A}h+=P;E=P;R=P===C-1&&l.ignoreChars?H.length:P+1;if(s){r.setStart(H,E);r.setEnd(H,R)}else{r.moveToElementText(l);r.move("character",E);r.moveEnd("character",R-E)}R=r.getClientRects()[0];n>R.left*L/Q-D+(R.right-R.left)*
L/Q/2&&h++}else{E=[];for(L=0;L<C;L++){E.push("<span>");L===C-1?E.push(H.data.substring(L)):E.push(H.data.substring(L,L+1));E.push("</span>")}l.innerHTML=E.join("");for(E=l.firstChild;E;){R=E.getBoundingClientRect();if(R.left<=n&&n<R.right){n>R.left+(R.right-R.left)/2&&h++;break}h++;E=E.nextSibling}if(!B){l.innerHTML="";l.appendChild(H);n=this._getSelection();if(h<=n.start&&n.start<h+C||h<=n.end&&n.end<h+C)this._updateDOMSelection()}}break a}}h+=C;l=l.nextSibling}B&&x.removeChild(B);return Math.min(t,
Math.max(p,h))},_getYToLine:function(h){var n=this._getViewPadding(),m=this._viewDiv.getBoundingClientRect();h-=m.top+n.top;n=this._getLineHeight();h=Math.floor((h+this._getScroll().y)/n);n=this._model.getLineCount();return Math.max(0,Math.min(n-1,h))},_getOffsetBounds:function(h){var n=this._model.getLineAtOffset(h),m=this._getLineHeight(),l=this._getScroll(),p=this._getViewPadding(),t=this._viewDiv.getBoundingClientRect();h=this._getBoundsAtOffset(h);n=n*m-l.y+t.top+p.top;return{left:h.left,top:n,
right:h.right,bottom:n+m}},_getVisible:function(){for(var h=this._parent,n=h.ownerDocument;h!==n;){var m;if(b<9)m=h.currentStyle&&h.currentStyle.display==="none";else m=(m=n.defaultView.getComputedStyle(h,null))&&m.getPropertyValue("display")==="none";if(m)return"hidden";h=h.parentNode;if(!h)return"disconnected"}return"visible"},_hitOffset:function(h,n,m){var l=this._getOffsetBounds(h);h=l.left;var p=l.right,t=l.top;l=l.bottom;h-=20;t-=20;p+=20;l+=20;return h<=n&&n<=p&&t<=m&&m<=l},_hookEvents:function(){var h=
this;this._modelListener={onChanging:function(x){h._onModelChanging(x)},onChanged:function(x){h._onModelChanged(x)}};this._model.addListener(this._modelListener);var n=this._clientDiv,m=this._viewDiv,l=this._frameDocument.body,p=this._handlers=[],t=b<9?this._frame:this._frameWindow,r=j?this._textArea:b||e?this._clientDiv:this._frameWindow;p.push({target:this._frameWindow,type:"unload",handler:function(x){return h._handleUnload(x)}});p.push({target:t,type:"resize",handler:function(x){return h._handleResize(x)}});
p.push({target:r,type:"blur",handler:function(x){return h._handleBlur(x)}});p.push({target:r,type:"focus",handler:function(x){return h._handleFocus(x)}});p.push({target:m,type:"scroll",handler:function(x){return h._handleScroll(x)}});if(j){n=this._touchDiv;l=this._textArea;p.push({target:l,type:"keydown",handler:function(x){return h._handleKeyDown(x)}});p.push({target:l,type:"input",handler:function(x){return h._handleInput(x)}});p.push({target:l,type:"textInput",handler:function(x){return h._handleTextInput(x)}});
p.push({target:l,type:"click",handler:function(x){return h._handleTextAreaClick(x)}});p.push({target:n,type:"touchstart",handler:function(x){return h._handleTouchStart(x)}});p.push({target:n,type:"touchmove",handler:function(x){return h._handleTouchMove(x)}});p.push({target:n,type:"touchend",handler:function(x){return h._handleTouchEnd(x)}})}else{m=this._overlayDiv||this._clientDiv;t=b?n:this._frameWindow;p.push({target:n,type:"keydown",handler:function(x){return h._handleKeyDown(x)}});p.push({target:n,
type:"keypress",handler:function(x){return h._handleKeyPress(x)}});p.push({target:n,type:"keyup",handler:function(x){return h._handleKeyUp(x)}});p.push({target:n,type:"selectstart",handler:function(x){return h._handleSelectStart(x)}});p.push({target:n,type:"contextmenu",handler:function(x){return h._handleContextMenu(x)}});p.push({target:n,type:"copy",handler:function(x){return h._handleCopy(x)}});p.push({target:n,type:"cut",handler:function(x){return h._handleCut(x)}});p.push({target:n,type:"paste",
handler:function(x){return h._handlePaste(x)}});p.push({target:n,type:"mousedown",handler:function(x){return h._handleMouseDown(x)}});p.push({target:t,type:"mouseup",handler:function(x){return h._handleMouseUp(x)}});p.push({target:t,type:"mousemove",handler:function(x){return h._handleMouseMove(x)}});p.push({target:l,type:"mousedown",handler:function(x){return h._handleBodyMouseDown(x)}});p.push({target:m,type:"dragstart",handler:function(x){return h._handleDragStart(x)}});p.push({target:m,type:"dragover",
handler:function(x){return h._handleDragOver(x)}});p.push({target:m,type:"drop",handler:function(x){return h._handleDrop(x)}});if(g){p.push({target:this._parentDocument,type:"mousemove",handler:function(x){return h._handleMouseMove(x)}});p.push({target:this._parentDocument,type:"mouseup",handler:function(x){return h._handleMouseUp(x)}})}b&&p.push({target:this._frameDocument,type:"activate",handler:function(x){return h._handleDocFocus(x)}});e&&p.push({target:this._frameDocument,type:"focus",handler:function(x){return h._handleDocFocus(x)}});
if(!b&&!f)p.push({target:this._viewDiv,type:e?"DOMMouseScroll":"mousewheel",handler:function(x){return h._handleMouseWheel(x)}});e&&!q&&p.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(x){return h._handleDataModified(x)}});if(this._overlayDiv){p.push({target:this._overlayDiv,type:"mousedown",handler:function(x){return h._handleMouseDown(x)}});p.push({target:this._overlayDiv,type:"contextmenu",handler:function(x){return h._handleContextMenu(x)}})}u||p.push({target:this._clientDiv,
type:"dblclick",handler:function(x){return h._handleDblclick(x)}})}for(n=0;n<p.length;n++){l=p[n];d(l.target,l.type,l.handler,l.capture)}},_init:function(h){var n=h.parent;if(typeof n==="string")n=window.document.getElementById(n);if(!n)throw"no parent";this._parent=n;this._model=h.model?h.model:new orion.textview.TextModel;this.readonly=h.readonly===true;this._fullSelection=h.fullSelection===undefined||h.fullSelection;if(b<9)this._fullSelection=false;this._stylesheet=h.stylesheet;this._tabSize=h.tabSize;
this._rulers=[];this._selection=new z(0,0,false);this._linksVisible=false;this._eventTable=new y;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(h,n){if(!(this.readonly&&!h._code)){this.onVerify(h);if(!(h.text===null||h.text===undefined)){var m=this._model;try{if(h._ignoreDOMSelection)this._ignoreDOMSelection=true;m.setText(h.text,h.start,h.end)}finally{if(h._ignoreDOMSelection)this._ignoreDOMSelection=false}if(n){n=this._getSelection();n.setCaret(h.start+h.text.length);this._setSelection(n,true)}this.onModify({})}}},_onModelChanged:function(h){this.onModelChanged(h);
var n=h.start,m=h.addedCharCount,l=h.removedCharCount,p=h.addedLineCount;h=h.removedLineCount;var t=this._getSelection();if(t.end>n){if(t.end>n&&t.start<n+l)t.setCaret(n+m);else{t.start+=m-l;t.end+=m-l}this._setSelection(t,false,false)}n=this._model.getLineAtOffset(n);for(m=this._getLineNext();m;){l=m.lineIndex;if(n<=l&&l<=n+h)m.lineChanged=true;if(l>n+h)m.lineIndex=l+p-h;m=this._getLineNext(m)}if(n<=this._maxLineIndex&&this._maxLineIndex<=n+h){this._checkMaxLineIndex=this._maxLineIndex;this._maxLineIndex=
-1;this._maxLineWidth=0}this._updatePage()},_onModelChanging:function(h){this.onModelChanging(h)},_queueUpdatePage:function(){if(!this._updateTimer){var h=this;this._updateTimer=setTimeout(function(){h._updateTimer=null;h._updatePage()},0)}},_reset:function(){this._maxLineIndex=-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._partialY=0;this._setSelection(new z(0,0,false),false,false);if(this._viewDiv){this._viewDiv.scrollLeft=0;this._viewDiv.scrollTop=0}var h=
this._clientDiv;if(h){for(var n=h.firstChild;n;){n.lineChanged=true;n=n.nextSibling}if(e){(n=this._hasFocus)&&h.blur();h.contentEditable=false;h.contentEditable=true;n&&h.focus()}}},_resizeTouchDiv:function(){for(var h=this._viewDiv.getBoundingClientRect(),n=this._frame.getBoundingClientRect(),m=this._frame;m;){if(m.style&&m.style.top)break;m=m.parentNode}var l=n.top;if(m)l-=m.getBoundingClientRect().top;else l+=this._parentDocument.body.scrollTop;for(m=this._frame;m;){if(m.style&&m.style.left)break;
m=m.parentNode}n=n.left;if(m)n-=m.getBoundingClientRect().left;else n+=this._parentDocument.body.scrollLeft;m=this._touchDiv;m.style.left=n+h.left+"px";m.style.top=l+h.top+"px";m.style.width=h.width+"px";m.style.height=h.height+"px"},_scrollView:function(h,n){this._ensureCaretVisible=false;var m=this._viewDiv;if(h)m.scrollLeft+=h;if(n)m.scrollTop+=n},_setClipboardText:function(h,n){var m;if(this._frameWindow.clipboardData){m=[];this._convertDelimiter(h,function(B){m.push(B)},function(){m.push(w)});
return this._frameWindow.clipboardData.setData("Text",m.join(""))}if(g||e||!n){var l=this._frameWindow,p=this._frameDocument,t=p.createElement("PRE");t.style.position="fixed";t.style.left="-1000px";this._convertDelimiter(h,function(B){t.appendChild(p.createTextNode(B))},function(){t.appendChild(p.createElement("BR"))});t.appendChild(p.createTextNode(" "));this._clientDiv.appendChild(t);h=p.createRange();h.setStart(t.firstChild,0);h.setEndBefore(t.lastChild);l=l.getSelection();l.rangeCount>0&&l.removeAllRanges();
l.addRange(h);var r=this;l=function(){r._clientDiv.removeChild(t);r._updateDOMSelection()};h=false;this._ignoreCopy=true;try{h=p.execCommand("copy",false,null)}catch(x){}this._ignoreCopy=false;if(!h)if(n){setTimeout(l,0);return false}l();return true}if(n&&n.clipboardData){m=[];this._convertDelimiter(h,function(B){m.push(B)},function(){m.push(w)});return n.clipboardData.setData("text/plain",m.join(""))}},_setDOMSelection:function(h,n,m,l){for(var p=this._frameWindow,t=this._frameDocument,r,x,B,C,D=
0,E=h.firstChild,H,K,L=this._model.getLine(h.lineIndex).length;E;){H=E.firstChild;K=H.length;if(E.ignoreChars)K-=E.ignoreChars;if(D+K>n||D+K>=L){r=H;x=n-D;if(E.ignoreChars&&K>0&&x===K)x+=E.ignoreChars;break}D+=K;E=E.nextSibling}D=0;E=m.firstChild;for(var Q=this._model.getLine(m.lineIndex).length;E;){H=E.firstChild;K=H.length;if(E.ignoreChars)K-=E.ignoreChars;if(K+D>l||D+K>=Q){B=H;C=l-D;if(E.ignoreChars&&K>0&&C===K)C+=E.ignoreChars;break}D+=K;E=E.nextSibling}this._setDOMFullSelection(h,n,L,m,l,Q);
if(!j)if(p.getSelection){t=t.createRange();t.setStart(r,x);t.setEnd(B,C);B=p.getSelection();this._ignoreSelect=false;B.rangeCount>0&&B.removeAllRanges();B.addRange(t);this._ignoreSelect=true}else if(t.selection){p=t.body;t=t.createElement("DIV");p.appendChild(t);p.removeChild(t);t=p.createTextRange();t.moveToElementText(r.parentNode);t.moveStart("character",x);r=p.createTextRange();r.moveToElementText(B.parentNode);r.moveStart("character",C);t.setEndPoint("EndToStart",r);this._ignoreSelect=false;
t.select();this._ignoreSelect=true}},_setDOMFullSelection:function(h,n,m,l,p,t){var r=this._model;if(this._selDiv1){var x,B;x=this._getLineBoundingClientRect(h);if(n===0)B=x.left;else if(n>=m)B=x.right;else{this._ignoreDOMSelection=true;B=this._getBoundsAtOffset(r.getLineStart(h.lineIndex)+n).left;this._ignoreDOMSelection=false}if((m=this._textArea)&&j){m.selectionStart=m.selectionEnd=0;var C=this._frame.getBoundingClientRect(),D=this._touchDiv.getBoundingClientRect(),E=this._viewDiv.getBoundingClientRect();
m.style.left=!(E.left<=B&&B<=E.left+E.width&&E.top<=x.top&&x.top<=E.top+E.height)||!(h===l&&n===p)?"-1000px":B-4+C.left-D.left+"px";m.style.top=x.top+C.top-D.top+"px";m.style.width="6px";m.style.height=x.bottom-x.top+"px"}m=this._selDiv1;m.style.width="0px";m.style.height="0px";m=this._selDiv2;m.style.width="0px";m.style.height="0px";m=this._selDiv3;m.style.width="0px";m.style.height="0px";if(!(h===l&&n===p)){C=j?2:0;D=C+"px blue solid";E=this._getViewPadding();var H=this._clientDiv.getBoundingClientRect(),
K=this._viewDiv.getBoundingClientRect();n=K.left+E.left;m=H.right;E=K.top+E.top;H=H.bottom;K=this._getLineBoundingClientRect(l);if(p===0)p=K.left;else if(p>=t)p=K.right;else{this._ignoreDOMSelection=true;p=this._getBoundsAtOffset(r.getLineStart(l.lineIndex)+p).left;this._ignoreDOMSelection=false}t=this._selDiv1;B=Math.min(m,Math.max(n,B));r=Math.min(H,Math.max(E,x.top));var L=m;x=Math.min(H,Math.max(E,x.bottom));t.style.left=B+"px";t.style.top=r+"px";t.style.width=Math.max(0,L-B)+"px";t.style.height=
Math.max(0,x-r)+(j?1:0)+"px";if(j){t.style.borderLeft=D;t.style.borderRight="0px"}if(h===l){L=Math.min(p,m);t.style.width=Math.max(0,L-B-C*2)+"px";if(j)t.style.borderRight=D}else{h=Math.min(H,Math.max(E,K.top));l=Math.min(m,Math.max(n,p));B=Math.min(H,Math.max(E,K.bottom));p=this._selDiv3;p.style.left=n+"px";p.style.top=h+"px";p.style.width=Math.max(0,l-n-C)+"px";p.style.height=Math.max(0,B-h)+"px";if(j)p.style.borderRight=D;if(h-x>0){l=this._selDiv2;l.style.left=n+"px";l.style.top=x+"px";l.style.width=
Math.max(0,m-n)+"px";l.style.height=Math.max(0,h-x)+(j?1:0)+"px"}}}}},_setGrab:function(h){if(h!==this._grabControl)if(h){h.setCapture&&h.setCapture();this._grabControl=h}else{this._grabControl.releaseCapture&&this._grabControl.releaseCapture();this._grabControl=null}},_setLinksVisible:function(h){if(this._linksVisible!==h){this._linksVisible=h;if(b&&h)this._hadFocus=this._hasFocus;var n=this._clientDiv;n.contentEditable=!h;this._hadFocus&&!h&&n.focus();if(this._overlayDiv)this._overlayDiv.style.zIndex=
h?"-1":"1";h=this._frameDocument;for(n=this._getLineNext();n;){if(n.hasLink)for(var m=n.firstChild;m;){var l=m.nextSibling,p=m.viewStyle;p&&p.tagName==="A"&&n.replaceChild(this._createRange(n,h,m.firstChild.data,p),m);m=l}n=this._getLineNext(n)}}},_setSelection:function(h,n,m,l){if(h){this._columnX=-1;if(m===undefined)m=true;var p=this._selection;if(!p.equals(h)){this._selection=h;this.onSelection({oldValue:{start:p.start,end:p.end},newValue:{start:h.start,end:h.end}})}if(n)m=!this._showCaret(false,
l);m&&this._updateDOMSelection()}},_setSelectionTo:function(h,n,m){var l=this._model,p=this._getSelection();n=this._getYToLine(n);if(this._clickCount===1){l=this._getXToOffset(n,h);p.extend(l);m||p.collapse()}else{if((this._clickCount&1)===0){l=this._getXToOffset(n,h);if(this._doubleClickSelection)if(l>=this._doubleClickSelection.start){m=this._doubleClickSelection.start;l=this._getOffset(l,"wordend",+1)}else{m=this._getOffset(l,"word",-1);l=this._doubleClickSelection.end}else{m=this._getOffset(l,
"word",-1);l=this._getOffset(m,"wordend",+1)}}else if(this._doubleClickSelection){h=l.getLineAtOffset(this._doubleClickSelection.start);if(n>=h){m=l.getLineStart(h);l=l.getLineEnd(n)}else{m=l.getLineStart(n);l=l.getLineEnd(h)}}else{m=l.getLineStart(n);l=l.getLineEnd(n)}p.setCaret(m);p.extend(l)}this._setSelection(p,true,true)},_showCaret:function(h,n){if(this._clientDiv){var m=this._model,l=this._getSelection(),p=this._getScroll(),t=l.getCaret(),r=l.start,x=l.end,B=m.getLineAtOffset(r),C=m.getLineAtOffset(x),
D=Math.max(Math.max(r,m.getLineStart(C)),x-1),E=this._getViewPadding(),H=this._getClientWidth(),K=E.left;E=E.left+H;var L=this._getBoundsAtOffset(t===r?r:D),Q=L.left,P=L.right,R=H/4;if(h&&!l.isEmpty()&&B===C){L=this._getBoundsAtOffset(t===x?r:D);if(H-R>(t===r?L.right-Q:P-L.left)){if(Q>L.left)Q=L.left;if(P<L.right)P=L.right}}l=this._viewDiv.getBoundingClientRect();Q-=l.left;P-=l.left;l=0;if(Q<K)l=Math.min(Q-K,-R);if(P>E)l=Math.min(this._scrollDiv.scrollWidth-p.x-H,Math.max(P-E,R));K=0;Q=this._getTopIndex(true);
P=this._getBottomIndex(true);m=m.getLineAtOffset(t);E=this._getClientHeight();if(!(Q<=m&&m<=P)){Q=this._getLineHeight();h=h?(C-B)*Q:0;K=m*Q;K-=p.y;if(K+Q>E){K-=E-Q;if(t===r&&r!==x)K+=Math.min(E-Q,h)}else if(t===x)K-=Math.min(E-Q,h);if(n)if(n>0){if(K>0)K=Math.max(K,n)}else if(K<0)K=Math.min(K,n)}if(l!==0||K!==0){this._scrollView(l,K);if(E!==this._getClientHeight()||H!==this._getClientWidth())this._showCaret();else this._ensureCaretVisible=true;return true}return false}},_startIME:function(){if(this._imeOffset===
-1){var h=this._getSelection();h.isEmpty()||this._modifyContent({text:"",start:h.start,end:h.end},true);this._imeOffset=h.start}},_unhookEvents:function(){this._model.removeListener(this._modelListener);this._modelListener=null;for(var h=0;h<this._handlers.length;h++){var n=this._handlers[h];c(n.target,n.type,n.handler)}this._handlers=null},_updateDOMSelection:function(){if(!this._ignoreDOMSelection)if(this._clientDiv){var h=this._getSelection(),n=this._model,m=n.getLineAtOffset(h.start),l=n.getLineAtOffset(h.end),
p=this._getLineNext();if(p){var t=this._getLinePrevious(),r;if(m<p.lineIndex){r=p;m=0}else if(m>t.lineIndex){r=t;m=0}else{r=this._getLineNode(m);m=h.start-n.getLineStart(m)}if(l<p.lineIndex){p=p;h=0}else if(l>t.lineIndex){p=t;h=0}else{p=this._getLineNode(l);h=h.end-n.getLineStart(l)}this._setDOMSelection(r,m,p,h)}}},_updatePage:function(){function h(F){if(F){for(var I=K+r.top+r.bottom,O=F.firstChild.rows[0].cells,S=0;S<O.length;S++){var T=O[S].firstChild,X=B;if(T._ruler.getOverview()==="page")X+=
L;T.style.top=-X+"px";T.style.height=I+X+"px"}F.style.height=I+"px"}}if(!(this._redrawCount>0)){if(this._updateTimer){clearTimeout(this._updateTimer);this._updateTimer=null}var n=this._frameDocument,m=this._viewDiv,l=this._clientDiv;if(l){var p=this._getFrameWidth(),t=this._getFrameHeight();n.body.style.width=p+"px";n.body.style.height=t+"px";var r=this._getViewPadding();m.style.height=Math.max(0,t-r.top-r.bottom)+"px";var x=this._model,B=this._getLineHeight();t=this._getScroll().y;var C=Math.max(0,
t)/B,D=Math.floor(C),E=Math.max(0,D-1);t=Math.round((C-E)*B);var H=x.getLineCount(),K=this._getClientHeight(),L=Math.round((C-D)*B);C=Math.floor((K+L)/B);C=Math.min(D+C,H-1);var Q=Math.min(C+1,H-1);this._partialY=L;for(var P,R=l.firstChild;R;){P=R.lineIndex;var $=R.nextSibling;if(!(E<=P&&P<=Q)||R.lineChanged||R.lineIndex===-1)if(this._mouseWheelLine===R){R.style.display="none";R.lineIndex=-1}else l.removeChild(R);R=$}R=this._getLineNext();$=n.createDocumentFragment();for(P=E;P<=Q;P++)if(!R||R.lineIndex>
P)this._createLine($,null,n,P,x);else{if($.firstChild){l.insertBefore($,R);$=n.createDocumentFragment()}R=this._getLineNext(R)}$.firstChild&&l.insertBefore($,R);if(k)l.style.width=(524287).toString()+"px";for(R=this._getLineNext();R;){E=R.lineWidth;if(E===undefined){E=this._getLineBoundingClientRect(R);E=R.lineWidth=E.right-E.left}if(E>=this._maxLineWidth){this._maxLineWidth=E;this._maxLineIndex=R.lineIndex}if(R.lineIndex===D)this._topChild=R;if(R.lineIndex===C)this._bottomChild=R;if(this._checkMaxLineIndex===
R.lineIndex)this._checkMaxLineIndex=-1;R=this._getLineNext(R)}if(this._checkMaxLineIndex!==-1){P=this._checkMaxLineIndex;this._checkMaxLineIndex=-1;if(0<=P&&P<H){n=this._createLine(l,null,n,P,x);E=this._getLineBoundingClientRect(n);E=E.right-E.left;if(E>=this._maxLineWidth){this._maxLineWidth=E;this._maxLineIndex=P}l.removeChild(n)}}this._updateRuler(this._leftDiv,D,C);this._updateRuler(this._rightDiv,D,C);n=this._leftDiv?this._leftDiv.scrollWidth:0;x=this._rightDiv?this._rightDiv.scrollWidth:0;m.style.left=
n+"px";m.style.width=Math.max(0,p-n-x-r.left-r.right)+"px";if(this._rightDiv)this._rightDiv.style.left=p-x+"px";x=this._scrollDiv;m=H*B;x.style.height=m+"px";p=this._getClientWidth();H=D=Math.max(this._maxLineWidth,p);if(!b||b>=9)D+=r.right;x.style.width=D+"px";x=this._getScroll();C=D=x.x;P=t;E=D+p;R=t+K;if(C===0)C-=r.left;if(P===0)P-=r.top;if(E===H)E+=r.right;if(x.y+K===m)R+=r.bottom;l.style.clip="rect("+P+"px,"+E+"px,"+R+"px,"+C+"px)";l.style.left=-D+n+r.left+"px";l.style.top=-t+r.top+"px";l.style.width=
(k?H:p+D)+"px";l.style.height=K+t+"px";if(t=this._overlayDiv){t.style.clip=l.style.clip;t.style.left=l.style.left;t.style.top=l.style.top;t.style.width=l.style.width;t.style.height=l.style.height}h(this._leftDiv);h(this._rightDiv);if(j){var A=this;setTimeout(function(){A._resizeTouchDiv()},0)}this._updateDOMSelection();l=this._ensureCaretVisible;this._ensureCaretVisible=false;if(K!==this._getClientHeight()){this._updatePage();l&&this._showCaret()}}}},_updateRuler:function(h,n,m){if(h){h=h.firstChild.rows[0].cells;
for(var l=this._getLineHeight(),p=this._frameDocument,t=this._getViewPadding(),r=0;r<h.length;r++){var x=h[r].firstChild,B=x._ruler;x.rulerChanged&&this._applyStyle(B.getRulerStyle(),x);var C,D=x.firstChild;if(D){C=D;D=D.nextSibling}else{C=p.createElement("DIV");C.style.visibility="hidden";x.appendChild(C)}var E,H;if(x.rulerChanged)if(C){E=-1;if(H=B.getWidestAnnotation()){this._applyStyle(H.style,C);if(H.html)C.innerHTML=H.html}C.lineIndex=E;C.style.height=l+t.top+"px"}var K,L;if(B.getOverview()===
"page"){for(B=B.getAnnotations(n,m+1);D;){E=D.lineIndex;H=D.nextSibling;if(!(n<=E&&E<=m)||D.lineChanged)x.removeChild(D);D=H}D=x.firstChild.nextSibling;L=p.createDocumentFragment();for(E=n;E<=m;E++)if(!D||D.lineIndex>E){K=p.createElement("DIV");if(H=B[E]){this._applyStyle(H.style,K);if(H.html)K.innerHTML=H.html;K.annotation=H}K.lineIndex=E;K.style.height=l+"px";L.appendChild(K)}else{if(L.firstChild){x.insertBefore(L,D);L=p.createDocumentFragment()}if(D)D=D.nextSibling}L.firstChild&&x.insertBefore(L,
D)}else{D=j?0:17;H=this._getClientHeight();E=this._model.getLineCount();C=H+t.top+t.bottom-2*D;var Q;Q=l*E<C?l:C/E;if(x.rulerChanged){for(H=x.childNodes.length;H>1;){x.removeChild(x.lastChild);H--}B=B.getAnnotations(0,E);L=p.createDocumentFragment();for(var P in B){E=P>>>0;if(!(E<0)){K=p.createElement("DIV");H=B[P];this._applyStyle(H.style,K);K.style.position="absolute";K.style.top=D+l+Math.floor(E*Q)+"px";if(H.html)K.innerHTML=H.html;K.annotation=H;K.lineIndex=E;L.appendChild(K)}}x.appendChild(L)}else if(x._oldTrackHeight!==
C)for(K=x.firstChild?x.firstChild.nextSibling:null;K;){K.style.top=D+l+Math.floor(K.lineIndex*Q)+"px";K=K.nextSibling}x._oldTrackHeight=C}x.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 d(m,l,p){this.commentStart="/*";this.commentEnd="*/";var t=[];switch(l){case "java":t=a;break;case "js":t=c;break;case "css":t=b;break}this.whitespacesVisible=false;this.detectTasks=this.foldingEnabled=this.highlightCaretLine=this.detectHyperlinks=true;this._scanner=new z(t,this.whitespacesVisible);if(l==="css")this._scanner.isCSS=true;this._firstScanner=new n;this._commentScanner=new h(this.whitespacesVisible);this._whitespaceScanner=new y;this.view=
m;this.annotationModel=p;this._matchingBracket=this._currentBracket=undefined;m.addEventListener("Selection",this,this._onSelection);l=m.getModel();if(l.getBaseModel){var r=this;this._baseModelListener={onChanged:function(x){r._onModelChanged(x)}};l.getBaseModel().addListener(this._baseModelListener)}else m.addEventListener("ModelChanged",this,this._onModelChanged);m.addEventListener("Destroy",this,this._onDestroy);m.addEventListener("LineStyle",this,this._onLineStyle);this._computeComments();this._computeFolding();
m.redrawLines()}var c=["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"],b=["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"],e={styleClass:"token_singleline_comment"},f={styleClass:"token_multiline_comment"},
g={styleClass:"token_doc_comment"},i={styleClass:"token_doc_html_markup"},k={styleClass:"token_task_tag"},j={styleClass:"token_doc_tag"},o={styleClass:"token_string"},q={styleClass:"token_keyword"},v={styleClass:"token_space"},u={styleClass:"token_tab"},s={styleClass:(document.selection&&window.ActiveXObject&&/MSIE/.test(navigator.userAgent)?document.documentMode:undefined)<9?"token_bracket":"token_bracket_outline"},w={styleClass:"line_caret"},z=function(){function m(l,p){this.keywords=l;this.whitespacesVisible=
p;this.setText("")}m.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(l){var p=this.keywords;switch(l){case 32:case 9:if(this.whitespacesVisible)return l===32?9:8;do l=this._read();while(l===32||l===9);this._unread(l);return 7;case 123:case 125:case 40:case 41:case 91:case 93:case 60:case 62:return l;
default:var t=this.isCSS;if(97<=l&&l<=122||65<=l&&l<=90||l===95||48<=l&&l<=57||45===l&&t){var r=this.offset-1;do l=this._read();while(97<=l&&l<=122||65<=l&&l<=90||l===95||48<=l&&l<=57||45===l&&t);this._unread(l);if(p.length>0){l=this.text.substring(r,this.offset);for(t=0;t<p.length;t++)if(this.keywords[t]===l)return 2}}return 1}},_read:function(){if(this.offset<this.text.length)return this.text.charCodeAt(this.offset++);return-1},_unread:function(l){l!==-1&&this.offset--},nextToken:function(){for(this.startOffset=
this.offset;;){var l=this._read();switch(l){case -1:return null;case 47:l=this._read();if(l===47)for(;;){l=this._read();if(l===-1||l===10||l===13){this._unread(l);return 4}}if(l===42){l=this._read();var p=5;if(l===42)p=6;for(;;){for(;l===42;){l=this._read();if(l===47)return p}if(l===-1){this._unread(l);return p}l=this._read()}}this._unread(l);return 1;case 39:for(;;){l=this._read();switch(l){case 39:return 3;case 13:case 10:case -1:this._unread(l);return 3;case 92:this._read();break}}break;case 34:for(;;){l=
this._read();switch(l){case 34:return 3;case 13:case 10:case -1:this._unread(l);return 3;case 92:this._read();break}}break;default:return this._default(l)}}},setText:function(l){this.text=l;this.startOffset=this.offset=0}};return m}(),y=function(){function m(){z.call(this,null,true)}m.prototype=new z(null);m.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var l=this._read();switch(l){case -1:return null;case 32:return 9;case 9:return 8;default:do l=this._read();while(!(l===32||
l===9||l===-1));this._unread(l);return 1}}};return m}(),h=function(){function m(l){z.call(this,null,l)}m.prototype=new z(null);m.prototype.setType=function(l){this._type=l};m.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var l=this._read();switch(l){case -1:return null;case 32:case 9:if(this.whitespacesVisible)return l===32?9:8;do l=this._read();while(l===32||l===9);this._unread(l);return 7;case 60:if(this._type===6){do l=this._read();while(!(l===62||l===-1));if(l===62)return 10}return 1;
case 64:if(this._type===6){do l=this._read();while(97<=l&&l<=122||65<=l&&l<=90||l===95||48<=l&&l<=57);this._unread(l);return 11}return 1;case 84:if((l=this._read())===79)if((l=this._read())===68)if((l=this._read())===79){l=this._read();if(!(97<=l&&l<=122||65<=l&&l<=90||l===95||48<=l&&l<=57)){this._unread(l);return 12}}this._unread(l);default:do l=this._read();while(!(l===32||l===9||l===-1||l===60||l===64||l===84));this._unread(l);return 1}}};return m}(),n=function(){function m(){z.call(this,null,
false)}m.prototype=new z(null);m.prototype._default=function(l){for(;;){l=this._read();switch(l){case 47:case 34:case 39:case -1:this._unread(l);return 1}}};return m}();d.prototype={destroy:function(){var m=this.view;if(m){var l=m.getModel();l.getBaseModel?l.getBaseModel().removeListener(this._baseModelListener):m.removeEventListener("ModelChanged",this,this._onModelChanged);m.removeEventListener("Selection",this,this._onSelection);m.removeEventListener("Destroy",this,this._onDestroy);m.removeEventListener("LineStyle",
this,this._onLineStyle);this.view=null}},setHighlightCaretLine:function(m){this.highlightCaretLine=m},setWhitespacesVisible:function(m){this.whitespacesVisible=m;this._scanner.whitespacesVisible=m;this._commentScanner.whitespacesVisible=m},setDetectHyperlinks:function(m){this.detectHyperlinks=m},setFoldingEnabled:function(m){this.foldingEnabled=m},setDetectTasks:function(m){this.detectTasks=m},_binarySearch:function(m,l,p,t,r){var x;if(t===undefined)t=-1;if(r===undefined)r=m.length;for(;r-t>1;){x=
Math.floor((r+t)/2);if(l<=m[x].start)r=x;else if(p&&l<m[x].end){r=x;break}else t=x}return r},_computeComments:function(){var m=this.view.getModel();if(m.getBaseModel)m=m.getBaseModel();this.comments=this._findComments(m.getText())},_computeFolding:function(){if(this.foldingEnabled){var m=this.view.getModel();if(m.getBaseModel){var l=this.annotationModel;if(l){l.removeAnnotations("orion.annotation.folding");for(var p=[],t=m.getBaseModel(),r=this.comments,x=0;x<r.length;x++){var B=r[x];(B=this._createFoldingAnnotation(m,
t,B.start,B.end))&&p.push(B)}l.replaceAnnotations(null,p)}}}},_createFoldingAnnotation:function(m,l,p,t){var r=l.getLineAtOffset(p);l=l.getLineAtOffset(t);if(r===l)return null;return new orion.textview.FoldingAnnotation(m,"orion.annotation.folding",p,t,"<div class='annotationHTML expanded'></div>",{styleClass:"annotation expanded"},"<div class='annotationHTML collapsed'></div>",{styleClass:"annotation collapsed"})},_computeTasks:function(m,l,p){if(this.detectTasks){var t=this.annotationModel;if(t){var r=
this.view.getModel(),x=r;if(r.getBaseModel)x=r.getBaseModel();var B=t.getAnnotations(l,p);for(r=[];B.hasNext();)r.push(B.next());B=[];var C=this._commentScanner;C.setText(x.getText(l,p));for(var D;D=C.nextToken();){var E=C.getStartOffset()+l;if(D===12){D=x.getLineEnd(x.getLineAtOffset(E));if(m!==4)D=Math.min(D,p-this.commentEnd.length);B.push({start:E,end:D,type:"orion.annotation.task",title:x.getText(E,D),style:{styleClass:"annotation task"},html:"<div class='annotationHTML task'></div>",overviewStyle:{styleClass:"annotationOverview task"}})}}t.replaceAnnotations(r,
B)}}},_getLineStyle:function(m){if(this.highlightCaretLine){var l=this.view,p=l.getModel();l=l.getSelection();if(l.start===l.end&&p.getLineAtOffset(l.start)===m)return w}return null},_getStyles:function(m,l,p){if(m.getBaseModel)p=m.mapOffset(p);for(var t=p+l.length,r=[],x=p,B=this.comments,C=this._binarySearch(B,p,true);C<B.length;C++){if(B[C].start>=t)break;var D=B[C].start,E=B[C].end;x<D&&this._parse(l.substring(x-p,D-p),x,r);var H=B[C].type===6?g:f;if(this.whitespacesVisible||this.detectHyperlinks){x=
Math.max(x,D);D=Math.min(t,E);this._parseComment(l.substring(x-p,D-p),x,r,H,B[C].type)}else r.push({start:D,end:E,style:H});x=E}x<t&&this._parse(l.substring(x-p,t-p),x,r);if(m.getBaseModel)for(l=0;l<r.length;l++){p=r[l].end-r[l].start;r[l].start=m.mapOffset(r[l].start,true);r[l].end=r[l].start+p}return r},_parse:function(m,l,p){var t=this._scanner;for(t.setText(m);m=t.nextToken();){var r=t.getStartOffset()+l,x=null;if(r===this._matchingBracket)x=s;else switch(m){case 2:x=q;break;case 3:if(this.whitespacesVisible){this._parseString(t.getData(),
r,p,o);continue}else x=o;break;case 6:this._parseComment(t.getData(),r,p,g,m);continue;case 4:this._parseComment(t.getData(),r,p,e,m);continue;case 5:this._parseComment(t.getData(),r,p,f,m);continue;case 8:if(this.whitespacesVisible)x=u;break;case 9:if(this.whitespacesVisible)x=v;break}p.push({start:r,end:t.getOffset()+l,style:x})}},_parseComment:function(m,l,p,t,r){var x=this._commentScanner;x.setText(m);for(x.setType(r);m=x.nextToken();){r=x.getStartOffset()+l;var B=t;switch(m){case 8:if(this.whitespacesVisible)B=
u;break;case 9:if(this.whitespacesVisible)B=v;break;case 10:B=i;break;case 11:B=j;break;case 12:B=k;break;default:if(this.detectHyperlinks)B=this._detectHyperlinks(x.getData(),r,p,B)}B&&p.push({start:r,end:x.getOffset()+l,style:B})}},_parseString:function(m,l,p,t){var r=this._whitespaceScanner;for(r.setText(m);m=r.nextToken();){var x=r.getStartOffset()+l,B=t;switch(m){case 8:if(this.whitespacesVisible)B=u;break;case 9:if(this.whitespacesVisible)B=v;break}B&&p.push({start:x,end:r.getOffset()+l,style:B})}},
_detectHyperlinks:function(m,l,p,t){var r=null,x;if((x=m.indexOf("://"))>0){r=m;for(var B=x;B>0;){x=r.charCodeAt(B-1);if(!(97<=x&&x<=122||65<=x&&x<=90||45===x||48<=x&&x<=57))break;B--}if(B>0){x="\"\"''(){}[]<>".indexOf(r.substring(B-1,B));if(x!==-1&&(x&1)===0&&(x=r.lastIndexOf("\"\"''(){}[]<>".substring(x+1,x+2)))!==-1){var C=x;x=this._clone(t);x.tagName="A";x.attributes={href:r.substring(B,C)};p.push({start:l,end:l+B,style:t});p.push({start:l+B,end:l+C,style:x});p.push({start:l+C,end:l+m.length,
style:t});return null}}}else if(m.toLowerCase().indexOf("bug#")===0)r="https://bugs.eclipse.org/bugs/show_bug.cgi?id="+parseInt(m.substring(4),10);if(r){x=this._clone(t);x.tagName="A";x.attributes={href:r};return x}return t},_clone:function(m){if(!m)return m;var l={};for(var p in m)if(m.hasOwnProperty(p))l[p]=m[p];return l},_findComments:function(m,l){l=l||0;var p=this._firstScanner;p.setText(m);for(var t=[];m=p.nextToken();){if(m===5||m===6){var r={start:p.getStartOffset()+l,end:p.getOffset()+l,
type:m};t.push(r);this._computeTasks(m,p.getStartOffset()+l,p.getOffset()+l)}m===4&&this._computeTasks(m,p.getStartOffset()+l,p.getOffset()+l)}return t},_findMatchingBracket:function(m,l){if(m.getBaseModel)m=m.getBaseModel();var p="{}()[]<>",t=m.getText(l,l+1),r=p.indexOf(t,0);if(r===-1)return-1;var x;x=r&1?p.substring(r-1,r):p.substring(r+1,r+2);var B=m.getLineAtOffset(l);p=m.getLine(B);var C=m.getLineStart(B),D=m.getLineEnd(B);p=this._findBrackets(t,x,p,C,C,D);for(D=0;D<p.length;D++){C=p[D]>=0?
1:-1;if(p[D]*C===l){l=1;if(r&1){for(D--;D>=0;D--){C=p[D]>=0?1:-1;l+=C;if(l===0)return p[D]*C}for(B-=1;B>=0;){p=m.getLine(B);C=m.getLineStart(B);D=m.getLineEnd(B);p=this._findBrackets(t,x,p,C,C,D);for(r=p.length-1;r>=0;r--){C=p[r]>=0?1:-1;l+=C;if(l===0)return p[r]*C}B--}}else{for(D++;D<p.length;D++){C=p[D]>=0?1:-1;l+=C;if(l===0)return p[D]*C}B+=1;for(r=m.getLineCount();B<r;){p=m.getLine(B);C=m.getLineStart(B);D=m.getLineEnd(B);p=this._findBrackets(t,x,p,C,C,D);for(D=0;D<p.length;D++){C=p[D]>=0?1:-1;
l+=C;if(l===0)return p[D]*C}B++}}break}}return-1},_findBrackets:function(m,l,p,t,r,x){var B=[];m=m.charCodeAt(0);l=l.charCodeAt(0);for(var C=r,D=this._scanner,E,H=this.comments,K=this._binarySearch(H,r,true);K<H.length;K++){if(H[K].start>=x)break;E=H[K].start;var L=H[K].end;if(C<E)for(D.setText(p.substring(C-r,E-r));E=D.nextToken();)if(E===m)B.push(D.getStartOffset()+C-r+t);else E===l&&B.push(-(D.getStartOffset()+C-r+t));C=L}if(C<x)for(D.setText(p.substring(C-r,x-r));E=D.nextToken();)if(E===m)B.push(D.getStartOffset()+
C-r+t);else E===l&&B.push(-(D.getStartOffset()+C-r+t));return B},_onDestroy:function(){this.destroy()},_onLineStyle:function(m){if(m.textView===this.view)m.style=this._getLineStyle(m.lineIndex);m.ranges=this._getStyles(m.textView.getModel(),m.lineText,m.lineStart)},_onSelection:function(m){var l=m.oldValue,p=m.newValue;m=this.view;var t=m.getModel(),r;r=this._matchingBracket;if(r!==undefined){if(t.getBaseModel)r=t.mapOffset(r,true);r=t.getLineAtOffset(r);m.redrawLines(r,r+1);this._matchingBracket=
this._currentBracket=undefined}if(this.highlightCaretLine){var x=t.getLineAtOffset(l.start);r=t.getLineAtOffset(p.start);var B=p.start===p.end;l=l.start===l.end;if(!(x===r&&l&&B)){l&&m.redrawLines(x,x+1);if((x!==r||!l)&&B)m.redrawLines(r,r+1)}}if(!(p.start!==p.end||p.start===0)){p=m.getCaretOffset()-1;if(!(p<0)){l=p;if(t.getBaseModel)l=t.mapOffset(p);r=this._findMatchingBracket(t,l);if(r!==-1){this._currentBracket=l;this._matchingBracket=r;if(t.getBaseModel)r=t.mapOffset(r,true);r=t.getLineAtOffset(r);
m.redrawLines(r,r+1)}}}},_onModelChanged:function(m){var l=m.start,p=m.removedCharCount,t=m.addedCharCount-p;if(this._matchingBracket&&l<this._matchingBracket)this._matchingBracket+=t;if(this._currentBracket&&l<this._currentBracket)this._currentBracket+=t;var r=this.view;m=r.getModel();var x=m.getBaseModel?m.getBaseModel():m;p=l+p;var B=x.getCharCount(),C=this.comments.length,D=x.getLineStart(x.getLineAtOffset(l)),E=this._binarySearch(this.comments,D,true),H=this._binarySearch(this.comments,p,false,
E-1,C);if(E<C&&this.comments[E].start<=D&&D<this.comments[E].end){D=this.comments[E].start;if(D>l)D+=t}else D=D;var K;if(H<C){K=this.comments[H].end;if(K>l)K+=t;H+=1}else{H=C;K=B}var L;B=this._findComments(x.getText(D,K),D);for(C=E;C<this.comments.length;C++){L=this.comments[C];if(L.start>l)L.start+=t;if(L.start>l)L.end+=t}var Q=H-E!==B.length;if(!Q)for(C=0;C<B.length;C++){L=this.comments[E+C];var P=B[C];if(L.start!==P.start||L.end!==P.end||L.type!==P.type){Q=true;break}}C=[E,H-E].concat(B);Array.prototype.splice.apply(this.comments,
C);if(Q){C=D;L=K;if(m!==x){C=m.mapOffset(C,true);L=m.mapOffset(L,true)}r.redrawRange(C,L)}if(this.foldingEnabled&&x!==m&&this.annotationModel){r=this.annotationModel;E=r.getAnnotations(D,K);D=[];for(K=[];E.hasNext();){L=E.next();if(L.type==="orion.annotation.folding"){K.push(L);for(C=0;C<B.length;C++)if(L.start===B[C].start&&L.end===B[C].end)break;if(C===B.length){D.push(L);L.expand()}else{C=L.start;H=L.end;if(C>l)C-=t;if(H>l)H-=t;if(C<=l&&l<H&&C<=p&&p<H){C=x.getLineAtOffset(L.start);H=x.getLineAtOffset(L.end);
if(C!==H){if(!L.expanded){L.expand();r.modifyAnnotation(L)}}else r.removeAnnotation(L)}}}}l=[];for(C=0;C<B.length;C++){L=B[C];for(t=0;t<K.length;t++)if(K[t].start===L.start&&K[t].end===L.end)break;if(t===K.length)(L=this._createFoldingAnnotation(m,x,L.start,L.end))&&l.push(L)}r.replaceAnnotations(D,l)}}};return d}();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(d,c,a,b,e,f,g,i,
k,j,o,q,v,u,s,w,z,y){var h={};h.CompareContainer=function(){function n(){this._diffParser=new a.DiffParser;this._input=this._diff=null}n.prototype={_getLineDelim:function(){return"\n"},setDiffProvider:function(m){this._diffProvider=m},getFileDiff:function(m,l,p,t){var r=this;this._diffProvider.getDiffContent(m).then(function(x){r._diff=r._conflict?x.split("diff --git")[1]:x;t?r.setEditor(this._input,r._diff,t):r.getFileURI(m,l,p)},p)},getFileURI:function(m,l,p){var t=this;this._diffProvider.getDiffFileURI(m).then(function(r){t._oldFileURI=
r.Old;t._newFileURI=r.New;t.getFileContent(r.Old,p);l&&l(r.New,r.Old)},p)},getFileContent:function(m,l){var p=this;p._registry.getService("orion.core.file").then(function(t){t.read(m).then(function(r){this._input=r;p.setEditor(r,p._diff)},function(r,x){if(r.status===404){this._input="";p.setEditor("",p._diff)}else l&&l(r,x)})})},parseMapper:function(m,l,p,t){var r=this._getLineDelim(m,l);this._diffParser.setLineDelim(r);m=this._diffParser.parse(m,l,p,t);l=this._diffParser.getDiffArray();return{delim:r,
mapper:m.mapper,output:m.outPutFile,diffArray:l}},resolveDiff:function(m,l,p,t){this._diffURI=m;this.getFileDiff(this._diffURI,l,p,t)},resolveDiffonSave:function(){this.getFileDiff(this._diffURI,null,null,true)},_initDiffPosition:function(m){var l=m.getModel();if(l&&l.getAnnotations){l=l.getAnnotations();if(l.length>0){l=l[0][0];var p=m.getLineHeight(),t=m.getClientArea();p=Math.floor(t.height/p/3);m.setTopIndex(l-p>0?l-p:0)}}}};return n}();h.CompareSyntaxHighlighter=function(){function n(){this.styler=
null}n.prototype={highlight:function(m,l){if(this.styler){this.styler.destroy();this.styler=null}if(m){m=m.split(".");if(m.length>0)switch(m.pop().toLowerCase()){case "js":this.styler=new z.TextStyler(l,"js");break;case "java":this.styler=new z.TextStyler(l,"java");break;case "html":break;case "xml":break;case "css":this.styler=new z.TextStyler(l,"css");break}}}};return n}();h.DiffStyler=function(){function n(m,l){this._compareMatchRenderer=m;this._textView=l}n.prototype={highlight:function(m){this._textView&&
this._textView.removeEventListener("LineStyle",this,this._onLineStyle);if(m)this._textView=m;this._textView&&!this._textView.getModel().isMapperEmpty()&&this._textView.addEventListener("LineStyle",this,this._onLineStyle)},_onLineStyle:function(m){var l=this._textView,p=m.lineIndex,t=l.getModel().getLineType(p);p=t.type;var r=y.getAnnotationIndexByMapper(l.getModel().getAnnotations(),t.mapperIndex).current;l=y.isMapperConflict(l.getModel().getMapper(),t.mapperIndex);r=r===this._compareMatchRenderer.getCurrentAnnotationIndex();
if(p==="top-only"){p=r?"url('"+d.toUrl("images/diff-border-sel.png")+"')":"url('"+d.toUrl("images/diff-border.png")+"')";m.style={style:{backgroundImage:p,backgroundRepeat:"repeat-x"}}}else if(p!=="unchanged")m.style={styleClass:r?l?"diffConflictSelect":"diffNormalSelect":l?"diffConflict":"diffNormal"}}};return n}();h.CompareMergeStyler=function(){function n(m){this._syntaxHighlither=new h.CompareSyntaxHighlighter;this._diffHighlither=new h.DiffStyler(m)}n.prototype={highlight:function(m,l){this._syntaxHighlither.highlight(m,
l);this._diffHighlither.highlight(l)}};return n}();h.CompareMergeContainer=function(){function n(m,l,p,t,r,x,B){this.setDiffProvider(p);this._uiFactory=B;this.readonly=m;this._conflict=l;this._registry=t;this._commandService=r;this._leftEditorDivId=this._uiFactory.getEditorParentDivId(true);this._fileClient=x;this._rightEditorDivId=this._uiFactory.getEditorParentDivId(false);this.initCommands();var C=this;this._inputManager={filePath:"",getInput:function(){return this.filePath},setDirty:function(D){if(D)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(D){x.read(D,true).then(c.hitch(this,function(E){this._fileMetadata=E;this.setTitle(E.Location)}),c.hitch(this,function(E){console.error("Error loading file metadata: "+E.message);this.setTitle(D)}));this.lastFilePath=D},setTitle:function(D){var E=D.lastIndexOf("/"),
H=D;if(E!==-1){H="Compare "+H.substring(E+1);if(D.charAt(0)==="*")H="*"+H}this._lastTitle=H;window.document.title=H;if(E=c.byId("location")){c.empty(E);new q.BreadCrumbs({container:"location",resource:this._fileMetadata});if(D.charAt(0)==="*")c.create("b",null,E,"last").innerHTML="*"}},afterSave:function(){C.resolveDiffonSave()}};this._compareMatchRenderer=new b.CompareMatchRenderer(document.getElementById(this._uiFactory.getDiffCanvasDivId()));this._highlighter=[];this._highlighter.push(new h.CompareMergeStyler(this._compareMatchRenderer));
this._highlighter.push(new h.CompareMergeStyler(this._compareMatchRenderer));this.initEditorContainers("\n","fetching...","fetching...",[])}n.prototype=new h.CompareContainer;n.prototype.initEditorContainers=function(m,l,p,t,r,x,B){this._editorLeft=this.createEditorContainer(l,m,t,0,this._leftEditorDivId,this._uiFactory.getStatusDivId(true),this.readonly,r,x);o.generateDomCommandsInBanner(this._commandService,this._editorLeft,"pageActions",true);this._textViewLeft=this._editorLeft.getTextView();this._editorRight=
this.createEditorContainer(p,m,t,1,this._rightEditorDivId,this._uiFactory.getStatusDivId(false),true,r,B);this._textViewRight=this._editorRight.getTextView();var C=this;m=new b.CompareMergeOverviewRuler("right",{styleClass:"ruler_overview"},C._compareMatchRenderer.getAnnotation(),function(E){C._compareMatchRenderer.matchPositionFromAnnotation(E)});this._textViewRight.addRuler(m);this._compareMatchRenderer.setOverviewRuler(m);var D=this;window.onbeforeunload=function(){if(D._editorLeft.isDirty())return"There are unsaved changes."}};
n.prototype.initCommands=function(){var m=this,l=new u.Command({name:"Next Diff",imageClass:"core-sprite-move_down",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",callback:function(){m.nextDiff()}}),p=new u.Command({name:"Previous Diff",imageClass:"core-sprite-move_up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",callback:function(){m.prevDiff()}}),t=new u.Command({name:"Copy Current Change From Right to left",imageClass:"core-sprite-leftarrow",id:"orion.compare.copyToLeft",
groupId:"orion.compareGroup",callback:function(){m.copyToLeft()}});this._commandService.addCommand(p,"dom");this._commandService.addCommand(l,"dom");this._commandService.addCommand(t,"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",m,m,"image")};n.prototype.nextDiff=function(){this._compareMatchRenderer.nextDiff()};n.prototype.prevDiff=function(){this._compareMatchRenderer.prevDiff()};n.prototype.copyToLeft=function(){this._compareMatchRenderer.copyToLeft()};n.prototype.createEditorContainer=function(m,l,p,t,r,x,B,C,D){var E=c.byId(r),H=this;m=new s.TextModel(m,l);var K=new f.CompareMergeModel(m,{mapper:p,columnIndex:t}),L="";p=B?new j.UndoFactory:new i.UndoCommandFactory(H._registry,
H._commandService,"pageActions");p=new k.Editor({textViewFactory:function(){return new w.TextView({parent:E,model:K,readonly:B,stylesheet:d.toUrl("orion/compare/editor.css"),tabSize:4})},undoStackFactory:p,contentAssistFactory:function(P){return new g.ContentAssist(P,"contentassist")},keyBindingFactory:function(P,R,$,A){if(!B){(new i.EditorCommandFactory(H._registry,H._commandService,H._fileClient,H._inputManager,"pageActions")).generateEditorCommands(P);var F=new j.TextActions(P,$);R.push(F);P=new j.SourceCodeActions(P,
$,A);R.push(P)}},statusReporter:function(P,R){if(x){L=R?"ERROR: "+P:P;c.byId(x).innerHTML=""+L}},domNode:E});p.installTextView();if(!B){inputManager=this._inputManager;c.connect(p,"onDirtyChange",inputManager,inputManager.setDirty)}var Q=p.getTextView();if(C&&D){C=D.split("?")[0];p.onInputChange(C);this._highlighter[t].highlight(C,p)}Q.addRuler(new b.LineNumberCompareRuler(0,"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},{styleClass:"ruler_lines_even"}));Q.addEventListener("Selection",
this,function(){var P=Q.getModel().getLineAtOffset(Q.getCaretOffset());P=y.lookUpMapper(Q.getModel().getMapper(),t,P).mapperIndex;P=y.getAnnotationIndexByMapper(Q.getModel().getAnnotations(),P);P.current!==-1&&H._compareMatchRenderer.gotoDiff(P.current)});if(t===0){Q.getModel().addListener(H._compareMatchRenderer);Q.addEventListener("Scroll",window,function(){if(H._compareMatchRenderer){H._compareMatchRenderer.matchPositionFrom(true);H._compareMatchRenderer.render()}})}else Q.addEventListener("Scroll",
window,function(){H._compareMatchRenderer&&H._compareMatchRenderer.render()});return p};n.prototype.setEditor=function(m,l,p){l=this.parseMapper(m,l,this._conflict,p);if(this._editorLeft)if(p){this._textViewLeft.getModel().init(l.mapper);this._textViewRight.getModel().init(l.mapper);this._textViewLeft.redrawRange();this._textViewRight.redrawRange()}else{this._inputManager.filePath=this._newFileURI;this._textViewLeft.getModel().init(l.mapper);this._textViewRight.getModel().init(l.mapper);p=this._oldFileURI.split("?")[0];
this._editorRight.onInputChange(p,null,m);this._highlighter[1].highlight(p,this._textViewRight);m=this._newFileURI.split("?")[0];this._editorLeft.onInputChange(m,null,l.output);this._highlighter[0].highlight(m,this._textViewLeft);this.readonly||this._inputManager.setInput(m,this._editorLeft)}else this.initEditorContainers(l.delim,l.output,m,l.mapper,true,this._newFileURI,this._oldFileURI);this._compareMatchRenderer.init(l.mapper,this._textViewLeft,this._textViewRight);this._compareMatchRenderer.matchPositionFromAnnotation(-1)};
return n}();h.InlineCompareContainer=function(){function n(m,l,p){this._annotation=new b.CompareAnnotation;this.setDiffProvider(m);this._registry=l;this._editorDivId=p;this.initEditorContainers("","\n",[],[]);this.hasContent=false}n.prototype=new h.CompareContainer;n.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}};n.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}};n.prototype.destroyEditor=function(){if(this._textView){this._textView.getModel().init([],[]);this._textView.setText("");this.removeRulers()}this.hasContent=false};n.prototype.createEditorContainer=function(m,l,p,t,r,x){var B=c.byId(this._editorDivId);m=new s.TextModel(m,l);var C=new e.CompareTextModel(m,
{mapper:p,columnIndex:0},new e.DiffLineFeeder(t,l));l=new j.UndoFactory;l=new k.Editor({textViewFactory:function(){return new w.TextView({parent:B,model:C,readonly:true,stylesheet:d.toUrl("orion/compare/editor.css"),tabSize:4})},undoStackFactory:l,keyBindingFactory:function(){},statusReporter:function(){},domNode:B});l.installTextView();r&&x&&l.onInputChange(x.split("?")[0]);var D=l.getTextView();this._rulerOrigin=new b.LineNumberCompareRuler(1,"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},
{styleClass:"ruler_lines_even"});this._rulerNew=new b.LineNumberCompareRuler(0,"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},{styleClass:"ruler_lines_even"});var E=this;this._overview=new b.CompareMergeOverviewRuler("right",{styleClass:"ruler_overview"},E._annotation,function(H){E._annotation.matchPositionFromAnnotation(H);E.positionAnnotation(H)});D.addEventListener("LineStyle",this,this._onLineStyle);D.addEventListener("Selection",this,function(){var H=D.getModel().getLineAtOffset(D.getCaretOffset());
H=D.getModel().getLineType(H).mapperIndex;H=y.getAnnotationIndexByMapper(D.getModel().getAnnotations(),H);if(H.current!==-1){E._annotation.gotoDiff(H.current);H=D.getTopIndex();D.redrawRange();D.redrawLines(H,H+1,E._overview)}});return l};n.prototype.initEditorContainers=function(m,l,p,t,r){this._editor=this.createEditorContainer(l,m,p,t,r);this._textView=this._editor.getTextView()};n.prototype._onLineStyle=function(m){var l=m.lineIndex,p=this._textView.getModel().getLineType(l);l=p.type;p=y.getAnnotationIndexByMapper(this._textView.getModel().getAnnotations(),
p.mapperIndex).current;if(l==="added")m.style=p===this._annotation.getCurrentAnnotationIndex()?{styleClass:"diffInlineAddedSelect"}:{styleClass:"diffInlineAdded"};else if(l==="removed")m.style=p===this._annotation.getCurrentAnnotationIndex()?{styleClass:"diffInlineRemovedSelect"}:{styleClass:"diffInlineRemoved"}};n.prototype.setEditor=function(m,l){this.hasContent=true;l=this.parseMapper(m,l,false,true);if(this._textView){this.addRulers();this._textView.getModel().init([],[]);this._textView.setText("");
this._textView.getModel().init(l.mapper,l.diffArray);this._textView.setText(m);this._annotation.init(l.mapper,this._textView)}else this.initEditorContainers(l.delim,m,l.mapper,l.diffArray,true,this._newFileURI);this._initDiffPosition(this._textView)};n.prototype.nextDiff=function(){this._annotation.nextDiff();this.positionAnnotation(this._textView.getModel().getAnnotations()[this._annotation.getCurrentAnnotationIndex()][0])};n.prototype.setConflicting=function(m){this._conflcit=m};n.prototype.prevDiff=
function(){this._annotation.prevDiff();this.positionAnnotation(this._textView.getModel().getAnnotations()[this._annotation.getCurrentAnnotationIndex()][0])};n.prototype.positionAnnotation=function(m){if(this._textView){var l=this._textView.getLineHeight(),p=this._textView.getClientArea();l=Math.floor(p.height/l/3);this._textView.setTopIndex(m-l>0?m-l:0);this._textView.redrawRange();m=this._textView.getTopIndex();this._textView.redrawLines(m,m+1,this._overview)}};return n}();return h});
define("compare",["dojo","orion/bootstrap","orion/status","orion/commands","orion/fileClient","orion/searchClient","orion/globalCommands","orion/compare/compare-features","orion/compare/diff-provider","orion/compare/compare-container","dojo/parser","dojo/hash","dijit/layout/BorderContainer","dijit/layout/ContentPane"],function(d,c,a,b,e,f,g,i,k,j){d.addOnLoad(function(){function o(){return d.queryToObject(window.location.search.slice(1)).readonly!=null}function q(){return d.queryToObject(window.location.search.slice(1)).conflict!=
null}function v(s,w,z){if(z.getTitleDivId(true)&&z.getTitleDivId(false)){d.place(document.createTextNode(s),z.getTitleDivId(true),"only");d.place(document.createTextNode(w),z.getTitleDivId(false),"only")}}function u(s,w,z){if(z.getTitleDivId(true)&&z.getTitleDivId(false)){s=typeof s.message==="string"?s.message:w.xhr.statusText;d.place(document.createTextNode(s),z.getTitleDivId(true),"only");d.place(document.createTextNode(s),z.getTitleDivId(false),"only");d.style(z.getTitleDivId(true),"color","red");
d.style(z.getTitleDivId(false),"color","red")}}c.startup().then(function(s){var w=s.serviceRegistry;s=s.preferences;document.body.style.visibility="visible";d.parser.parse();var z=new b.CommandService({serviceRegistry:w}),y=new f.Searcher({serviceRegistry:w,commandService:z}),h=new e.FileClient(w),n=new k.DiffProvider(w);g.generateBanner("toolbar",w,z,s,y);var m=new i.CompareMergeUIFactory({parentDivID:"compareContainer",showTitle:true,showLineStatus:true});m.buildUI();var l=o(),p=q();compareMergeContainer=
new j.CompareMergeContainer(l,p,n,w,z,h,m);compareMergeContainer.resolveDiff(d.hash(),function(t,r){v(t,r,m)},function(t,r){u(t,r,m)});d.subscribe("/dojo/hashchange",compareMergeContainer,function(){compareMergeContainer=new j.CompareMergeContainer(l,p,n,w,z,h,m);compareMergeContainer.resolveDiff(d.hash(),function(t,r){v(t,r,m)},function(t,r){u(t,r,m)})})})})});