/*
 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 b(a,c,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"],j=0,h;h=f[j++];)console[h]||function(){var t=h+"";console[t]="log"in console?function(){var r=Array.apply({},arguments);r.unshift(t+":");console.log(r.join(" "))}:function(){};console[t]._fake=true}()}if(typeof a==
"undefined")a={_scopeName:"dojo",_scopePrefix:"",_scopePrefixArgs:"",_scopeSuffix:"",_scopeMap:{},_scopeMapRev:{}};var i=a;if(typeof c=="undefined")c={_scopeName:"dijit"};if(typeof e=="undefined")e={_scopeName:"dojox"};if(!i._scopeArgs)i._scopeArgs=[a,c,e];i.global=this;i.config={isDebug:false,debugAtAllCosts:false};if(f=typeof djConfig!="undefined"?djConfig:typeof dojoConfig!="undefined"?dojoConfig:null)for(var l in f)i.config[l]=f[l];a.locale=i.config.locale;l="$Rev: 24595 $".match(/\d+/);a.version=
{major:1,minor:6,patch:1,flag:"",revision:l?+l[0]:NaN,toString:function(){with(i.version)return major+"."+minor+"."+patch+flag+" ("+revision+")"}};typeof OpenAjax!="undefined"&&OpenAjax.hub.registerLibrary(a._scopeName,"http://dojotoolkit.org",i.version.toString());var o,q,x={};for(j in{toString:1}){o=[];break}a._extraNames=o=o||["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];q=o.length;a._mixin=function(t,r){var s,y,w;for(s in r){y=r[s];
if(!(s in t)||t[s]!==y&&(!(s in x)||x[s]!==y))t[s]=y}if(q&&r)for(w=0;w<q;++w){s=o[w];y=r[s];if(!(s in t)||t[s]!==y&&(!(s in x)||x[s]!==y))t[s]=y}return t};a.mixin=function(t){t||(t={});for(var r=1,s=arguments.length;r<s;r++)i._mixin(t,arguments[r]);return t};a._getProp=function(t,r,s){s=s||i.global;for(var y=0,w;s&&(w=t[y]);y++){if(y==0&&i._scopeMap[w])w=i._scopeMap[w];s=w in s?s[w]:r?(s[w]={}):undefined}return s};a.setObject=function(t,r,s){var y=t.split(".");t=y.pop();return(s=i._getProp(y,true,
s))&&t?(s[t]=r):undefined};a.getObject=function(t,r,s){return i._getProp(t.split("."),r,s)};a.exists=function(t,r){return i.getObject(t,false,r)!==undefined};a.eval=function(t){return i.global.eval?i.global.eval(t):eval(t)};i.deprecated=i.experimental=function(){}})();return{dojo:a,dijit:c,dojox:e}}if(this.define)define("dojo/_base/_loader/bootstrap",[],function(){var a=b();a.dojo._dijit=a.dijit;a.dojo._dojox=a.dojox;return a.dojo});else{var d=b();dojo=d.dojo;dijit=d.dijit;dojox=d.dojox}})();
define("dojo/lib/backCompat",["require","dojo/_base/_loader/bootstrap"],function(b,d){var a=["_moduleHasPrefix","_loadPath","_loadUri","_loadUriAndCheck","loaded","_callLoaded","_getModuleSymbols","_loadModule","require","provide","platformRequire","requireIf","requireAfterIf","registerModulePath"],c,e;for(c=0;c<a.length;){e=a[c++];d[e]=function(t){return function(){console.warn("dojo."+t+" not available when using an AMD loader.")}}(e)}var f=function(t){var r=[],s;for(s=0;s<t.length;)r.push(t[s++]);
return r},j=function(t,r){return r?typeof r=="string"?function(){t[r]()}:function(){r.call(t)}:t};d.ready=d.addOnLoad=function(t,r){b.ready(r?j(t,r):t)};d.addOnLoad(function(){d.postLoad=d.config.afterOnLoad=true});if(a=d.config.addOnLoad)d.addOnLoad[a instanceof Array?"apply":"call"](d,a);var h=d._loaders=[],i=function(){var t=h.slice(0);for(Array.prototype.splice.apply(h,[0,h.length]);t.length;)t.shift().call()};h.unshift=function(){Array.prototype.unshift.apply(h,f(arguments));b.ready(i)};h.splice=
function(){Array.prototype.splice.apply(h,f(arguments));b.ready(i)};var l=d._unloaders=[];d.unloaded=function(){for(;l.length;)l.pop().call()};d._onto=function(t,r,s){t.push(s?j(r,s):r)};d._modulesLoaded=function(){};d.loadInit=function(t){t()};var o=function(t){return t.replace(/\./g,"/")};d.getL10nName=function(t,r,s){s=s?s.toLowerCase():d.locale;t="i18n!"+o(t);return/root/i.test(s)?t+"/nls/"+r:t+"/nls/"+s+"/"+r};d.requireLocalization=function(t,r,s){if(b.vendor!="altoviso.com")s=!s||s.toLowerCase()===
d.locale?"root":s;return b(d.getL10nName(t,r,s))};d.i18n={getLocalization:d.requireLocalization,normalizeLocale:function(t){t=t?t.toLowerCase():d.locale;if(t=="root")t="ROOT";return t}};var q=/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/,x=/^((([^\[:]+):)?([^@]+)@)?(\[([^\]]+)\]|([^\[:]*))(:([0-9]+))?$/;d._Url=function(){for(var t=arguments,r=[t[0]],s=1;s<t.length;s++)if(t[s]){var y=new d._Url(t[s]+"");r=new d._Url(r[0]+"");if(y.path==""&&!y.scheme&&!y.authority&&!y.query){if(y.fragment!=
null)r.fragment=y.fragment;y=r}else if(!y.scheme){y.scheme=r.scheme;if(!y.authority){y.authority=r.authority;if(y.path.charAt(0)!="/"){r=(r.path.substring(0,r.path.lastIndexOf("/")+1)+y.path).split("/");for(var w=0;w<r.length;w++)if(r[w]==".")if(w==r.length-1)r[w]="";else{r.splice(w,1);w--}else if(w>0&&!(w==1&&r[0]=="")&&r[w]==".."&&r[w-1]!="..")if(w==r.length-1){r.splice(w,1);r[w-1]=""}else{r.splice(w-1,2);w-=2}y.path=r.join("/")}}}r=[];y.scheme&&r.push(y.scheme,":");y.authority&&r.push("//",y.authority);
r.push(y.path);y.query&&r.push("?",y.query);y.fragment&&r.push("#",y.fragment)}this.uri=r.join("");s=this.uri.match(q);this.scheme=s[2]||(s[1]?"":null);this.authority=s[4]||(s[3]?"":null);this.path=s[5];this.query=s[7]||(s[6]?"":null);this.fragment=s[9]||(s[8]?"":null);if(this.authority!=null){s=this.authority.match(x);this.user=s[3]||null;this.password=s[4]||null;this.host=s[6]||s[7];this.port=s[9]||null}};d._Url.prototype.toString=function(){return this.uri};d.moduleUrl=function(t,r){if(!t)return null;
t=o(t)+(r?"/"+r:"");r="";var s=t.match(/(.+)(\.[^\/]*)$/);if(s){t=s[1];r=s[2]}return new d._Url(b.nameToUrl(t,r))};return d});
define("dojo/_base/_loader/hostenv_browser",["dojo/lib/backCompat"],function(b){if(typeof window!="undefined"){b.isBrowser=true;b._name="browser";(function(){var a=b;if(document&&document.getElementsByTagName)for(var c=document.getElementsByTagName("script"),e=/dojo(\.xd)?\.js(\W|$)/i,f=0;f<c.length;f++){var j=c[f].getAttribute("src");if(j){var h=j.match(e);if(h){if(!a.config.baseUrl)a.config.baseUrl=j.substring(0,h.index);if(c=c[f].getAttribute("djConfig")||c[f].getAttribute("data-dojo-config")){c=
eval("({ "+c+" })");for(var i in c)b.config[i]=c[i]}break}}}a.baseUrl=a.config.baseUrl;i=navigator;c=i.userAgent;e=i.appVersion;f=parseFloat(e);if(c.indexOf("Opera")>=0)a.isOpera=f;if(c.indexOf("AdobeAIR")>=0)a.isAIR=1;a.isKhtml=e.indexOf("Konqueror")>=0?f:0;a.isWebKit=parseFloat(c.split("WebKit/")[1])||undefined;a.isChrome=parseFloat(c.split("Chrome/")[1])||undefined;a.isMac=e.indexOf("Macintosh")>=0;if((j=Math.max(e.indexOf("WebKit"),e.indexOf("Safari"),0))&&!b.isChrome){a.isSafari=parseFloat(e.split("Version/")[1]);
if(!a.isSafari||parseFloat(e.substr(j+7))<=419.3)a.isSafari=2}if(c.indexOf("Gecko")>=0&&!a.isKhtml&&!a.isWebKit)a.isMozilla=a.isMoz=f;if(a.isMoz)a.isFF=parseFloat(c.split("Firefox/")[1]||c.split("Minefield/")[1])||undefined;if(document.all&&!a.isOpera){a.isIE=parseFloat(e.split("MSIE ")[1])||undefined;if((c=document.documentMode)&&c!=5&&Math.floor(a.isIE)!=c)a.isIE=c}if(b.isIE&&window.location.protocol==="file:")b.config.ieForceActiveXXhr=true;a.isQuirks=document.compatMode=="BackCompat";a.locale=
b.config.locale||(a.isIE?i.userLanguage:i.language).toLowerCase();a._XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];a._xhrObj=function(){var s,y;if(!b.isIE||!b.config.ieForceActiveXXhr)try{s=new XMLHttpRequest}catch(w){}if(!s)for(var g=0;g<3;++g){var k=a._XMLHTTP_PROGIDS[g];try{s=new ActiveXObject(k)}catch(m){y=m}if(s){a._XMLHTTP_PROGIDS=[k];break}}if(!s)throw new Error("XMLHTTP not available: "+y);return s};a._isDocumentOk=function(s){s=s.status||0;var y=location.protocol;
return s>=200&&s<300||s==304||s==1223||!s&&(y=="file:"||y=="chrome:"||y=="chrome-extension:"||y=="app:")};var l=window.location+"";var o=(i=document.getElementsByTagName("base"))&&i.length>0;a._getText=function(s,y){var w=a._xhrObj();if(!o&&b._Url)s=(new b._Url(l,s)).toString();if(a.config.cacheBust){s+="";s+=(s.indexOf("?")==-1?"?":"&")+String(a.config.cacheBust).replace(/\W+/g,"")}w.open("GET",s,false);try{w.send(null);if(!a._isDocumentOk(w)){var g=Error("Unable to load "+s+" status:"+w.status);
g.status=w.status;g.responseText=w.responseText;throw g;}}catch(k){if(y)return null;throw k;}return w.responseText};var q=window,x=function(s,y){var w=q.attachEvent||q.addEventListener;s=q.attachEvent?s:s.substring(2);w(s,function(){y.apply(q,arguments)},false)};a._windowUnloaders=[];a.windowUnloaded=function(){for(var s=a._windowUnloaders;s.length;)s.pop()();a=null};var t=0;a.addOnWindowUnload=function(s,y){a._onto(a._windowUnloaders,s,y);if(!t){t=1;x("onunload",a.windowUnloaded)}};var r=0;a.addOnUnload=
function(s,y){a._onto(a._unloaders,s,y);if(!r){r=1;x("onbeforeunload",b.unloaded)}}})();b._initFired=false;b._loadInit=function(){if(b._scrollIntervalId){clearInterval(b._scrollIntervalId);b._scrollIntervalId=0}if(!b._initFired){b._initFired=true;!b.config.afterOnLoad&&window.detachEvent&&window.detachEvent("onload",b._loadInit);b._inFlightCount==0&&b._modulesLoaded()}};if(!b.config.afterOnLoad)if(document.addEventListener){document.addEventListener("DOMContentLoaded",b._loadInit,false);window.addEventListener("load",
b._loadInit,false)}else if(window.attachEvent){window.attachEvent("onload",b._loadInit);if(!b.config.skipIeDomLoaded&&self===self.top)b._scrollIntervalId=setInterval(function(){try{if(document.body){document.documentElement.doScroll("left");b._loadInit()}}catch(a){}},30)}if(b.isIE)try{(function(){document.namespaces.add("v","urn:schemas-microsoft-com:vml");var a=["*","group","roundrect","oval","shape","rect","imagedata","path","textpath","text"],c=0,e=1,f=document.createStyleSheet();if(b.isIE>=8){c=
1;e=a.length}for(;c<e;++c)f.addRule("v\\:"+a[c],"behavior:url(#default#VML); display:inline-block")})()}catch(d){}}(function(){var a=b.config.modulePaths;if(a)for(var c in a)b.registerModulePath(c,a[c])})();b.config.isDebug&&b.require("dojo._firebug.firebug");if(b.config.debugAtAllCosts){b.require("dojo._base._loader.loader_debug");b.require("dojo.i18n")}return b});define("dojo/lib/kernel",["dojo/_base/_loader/hostenv_browser"],function(b){return dojo=b});
define("dojo/_base/lang",["dojo/lib/kernel"],function(b){(function(){var d=Object.prototype.toString;b.isString=function(i){return typeof i=="string"||i instanceof String};b.isArray=function(i){return i&&(i instanceof Array||typeof i=="array")};b.isFunction=function(i){return d.call(i)==="[object Function]"};b.isObject=function(i){return i!==undefined&&(i===null||typeof i=="object"||b.isArray(i)||b.isFunction(i))};b.isArrayLike=function(i){return i&&i!==undefined&&!b.isString(i)&&!b.isFunction(i)&&
!(i.tagName&&i.tagName.toLowerCase()=="form")&&(b.isArray(i)||isFinite(i.length))};b.isAlien=function(i){return i&&!b.isFunction(i)&&/\{\s*\[native code\]\s*\}/.test(String(i))};b.extend=function(i){for(var l=1,o=arguments.length;l<o;l++)b._mixin(i.prototype,arguments[l]);return i};b._hitchArgs=function(i,l){var o=b._toArray(arguments,2),q=b.isString(l);return function(){var x=b._toArray(arguments),t=q?(i||b.global)[l]:l;return t&&t.apply(i||this,o.concat(x))}};b.hitch=function(i,l){if(arguments.length>
2)return b._hitchArgs.apply(b,arguments);if(!l){l=i;i=null}if(b.isString(l)){i=i||b.global;if(!i[l])throw['dojo.hitch: scope["',l,'"] is null (scope="',i,'")'].join("");return function(){return i[l].apply(i,arguments||[])}}return!i?l:function(){return l.apply(i,arguments||[])}};b.delegate=b._delegate=function(){function i(){}return function(l,o){i.prototype=l;l=new i;i.prototype=null;o&&b._mixin(l,o);return l}}();var a=function(i,l,o){return(o||[]).concat(Array.prototype.slice.call(i,l||0))},c=function(i,
l,o){o=o||[];for(l=l||0;l<i.length;l++)o.push(i[l]);return o};b._toArray=b.isIE?function(i){return(i.item?c:a).apply(this,arguments)}:a;b.partial=function(){return b.hitch.apply(b,[null].concat(b._toArray(arguments)))};var e=b._extraNames,f=e.length,j={};b.clone=function(i){if(!i||typeof i!="object"||b.isFunction(i))return i;if(i.nodeType&&"cloneNode"in i)return i.cloneNode(true);if(i instanceof Date)return new Date(i.getTime());if(i instanceof RegExp)return new RegExp(i);var l,o,q,x;if(b.isArray(i)){l=
[];o=0;for(q=i.length;o<q;++o)o in i&&l.push(b.clone(i[o]))}else l=i.constructor?new i.constructor:{};for(x in i){q=i[x];if(!(x in l)||l[x]!==q&&(!(x in j)||j[x]!==q))l[x]=b.clone(q)}if(f)for(o=0;o<f;++o){x=e[o];q=i[x];if(!(x in l)||l[x]!==q&&(!(x in j)||j[x]!==q))l[x]=q}return l};b.trim=String.prototype.trim?function(i){return i.trim()}:function(i){return i.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};var h=/\{([^\}]+)\}/g;b.replace=function(i,l,o){return i.replace(o||h,b.isFunction(l)?l:function(q,
x){return b.getObject(x,false,l)})}})();return b});
define("dojo/_base/array",["dojo/lib/kernel","dojo/_base/lang"],function(b){(function(){var d=function(c,e,f){return[typeof c=="string"?c.split(""):c,e||b.global,typeof f=="string"?new Function("item","index","array",f):f]},a=function(c,e,f,j){var h=d(e,j,f);e=h[0];f=0;for(j=e.length;f<j;++f){var i=!!h[2].call(h[1],e[f],f,e);if(c^i)return i}return c};b.mixin(b,{indexOf:function(c,e,f,j){var h=1,i=c.length||0,l=0;if(j){l=i-1;h=i=-1}if(f!=undefined)l=f;if(j&&l>i||l<i)for(;l!=i;l+=h)if(c[l]==e)return l;
return-1},lastIndexOf:function(c,e,f){return b.indexOf(c,e,f,true)},forEach:function(c,e,f){if(c&&c.length){var j=d(c,f,e);c=j[0];e=0;for(f=c.length;e<f;++e)j[2].call(j[1],c[e],e,c)}},every:function(c,e,f){return a(true,c,e,f)},some:function(c,e,f){return a(false,c,e,f)},map:function(c,e,f,j){var h=d(c,f,e);c=h[0];e=j?new j:[];f=0;for(j=c.length;f<j;++f)e.push(h[2].call(h[1],c[f],f,c));return e},filter:function(c,e,f){var j=d(c,f,e);c=j[0];e=[];f=0;for(var h=c.length;f<h;++f)j[2].call(j[1],c[f],f,
c)&&e.push(c[f]);return e}})})();return b});
define("dojo/_base/declare",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array"],function(b){(function(){function d(p,u){throw new Error("declare"+(u?" "+u:"")+": "+p);}function a(p,u){for(var v=[],A=[{cls:0,refs:[]}],C={},D=1,E=p.length,F=0,J,M,O,V,Z;F<E;++F){if(J=p[F])g.call(J)!="[object Function]"&&d("mixin #"+F+" is not a callable constructor.",u);else d("mixin #"+F+" is unknown. Did you use dojo.require to pull it in?",u);M=J._meta?J._meta.bases:[J];O=0;for(J=M.length-1;J>=0;--J){V=M[J].prototype;
if(!V.hasOwnProperty("declaredClass"))V.declaredClass="uniqName_"+m++;V=V.declaredClass;if(!C.hasOwnProperty(V)){C[V]={count:0,refs:[],cls:M[J]};++D}V=C[V];if(O&&O!==V){V.refs.push(O);++O.count}O=V}++O.count;A[0].refs.push(O)}for(;A.length;){O=A.pop();v.push(O.cls);for(--D;Z=O.refs,Z.length==1;){O=Z[0];if(!O||--O.count){O=0;break}v.push(O.cls);--D}if(O){F=0;for(E=Z.length;F<E;++F){O=Z[F];--O.count||A.push(O)}}}D&&d("can't build consistent linearization",u);J=p[0];v[0]=J?J._meta&&J===v[v.length-J._meta.bases.length]?
J._meta.bases.length:1:0;return v}function c(p,u,v){var A,C,D,E,F,J,M,O=this._inherited=this._inherited||{};if(typeof p=="string"){A=p;p=u;u=v}v=0;E=p.callee;(A=A||E.nom)||d("can't deduce a name to call inherited()",this.declaredClass);F=this.constructor._meta;D=F.bases;M=O.p;if(A!=n){if(O.c!==E){M=0;J=D[0];F=J._meta;if(F.hidden[A]!==E){(C=F.chains)&&typeof C[A]=="string"&&d("calling chained method with inherited: "+A,this.declaredClass);do{F=J._meta;C=J.prototype;if(F&&(C[A]===E&&C.hasOwnProperty(A)||
F.hidden[A]===E))break}while(J=D[++M]);M=J?M:-1}}if(J=D[++M]){C=J.prototype;if(J._meta&&C.hasOwnProperty(A))v=C[A];else{E=w[A];do{C=J.prototype;if((v=C[A])&&(J._meta?C.hasOwnProperty(A):v!==E))break}while(J=D[++M])}}v=J&&v||w[A]}else{if(O.c!==E){M=0;if((F=D[0]._meta)&&F.ctor!==E){C=F.chains;if(!C||C.constructor!=="manual")d("calling chained constructor with inherited",this.declaredClass);for(;J=D[++M];)if((F=J._meta)&&F.ctor===E)break;M=J?M:-1}}for(;J=D[++M];)if(v=(F=J._meta)?F.ctor:J)break;v=J&&
v}O.c=v;O.p=M;if(v)return u===true?v:v.apply(this,u||p)}function e(p,u){if(typeof p=="string")return this.inherited(p,u,true);return this.inherited(p,true)}function f(p){for(var u=this.constructor._meta.bases,v=0,A=u.length;v<A;++v)if(u[v]===p)return true;return this instanceof p}function j(p,u){var v,A=0,C=s._extraNames.length;for(v in u)if(v!=n&&u.hasOwnProperty(v))p[v]=u[v];for(;A<C;++A){v=s._extraNames[A];if(v!=n&&u.hasOwnProperty(v))p[v]=u[v]}}function h(p,u){var v,A,C=0,D=s._extraNames.length;
for(v in u){A=u[v];if((A!==w[v]||!(v in w))&&v!=n){if(g.call(A)=="[object Function]")A.nom=v;p[v]=A}}for(;C<D;++C){v=s._extraNames[C];A=u[v];if((A!==w[v]||!(v in w))&&v!=n){if(g.call(A)=="[object Function]")A.nom=v;p[v]=A}}return p}function i(p){h(this.prototype,p);return this}function l(p,u){return function(){var v=arguments,A=v,C=v[0],D,E;E=p.length;var F;if(!(this instanceof v.callee))return r(v);if(u&&(C&&C.preamble||this.preamble)){F=new Array(p.length);F[0]=v;for(D=0;;){if(C=v[0])if(C=C.preamble)v=
C.apply(this,v)||v;C=p[D].prototype;if(C=C.hasOwnProperty("preamble")&&C.preamble)v=C.apply(this,v)||v;if(++D==E)break;F[D]=v}}for(D=E-1;D>=0;--D){C=p[D];if(C=(E=C._meta)?E.ctor:C)C.apply(this,F?F[D]:v)}(C=this.postscript)&&C.apply(this,A)}}function o(p,u){return function(){var v=arguments,A=v,C=v[0];if(!(this instanceof v.callee))return r(v);if(u){if(C)if(C=C.preamble)A=C.apply(this,A)||A;(C=this.preamble)&&C.apply(this,A)}p&&p.apply(this,v);(C=this.postscript)&&C.apply(this,v)}}function q(p){return function(){var u=
arguments,v=0,A,C;if(!(this instanceof u.callee))return r(u);for(;A=p[v];++v)if(A=(C=A._meta)?C.ctor:A){A.apply(this,u);break}(A=this.postscript)&&A.apply(this,u)}}function x(p,u,v){return function(){var A,C,D=0,E=1;if(v){D=u.length-1;E=-1}for(;A=u[D];D+=E){C=A._meta;(A=(C?C.hidden:A.prototype)[p])&&A.apply(this,arguments)}}}function t(p){k.prototype=p.prototype;p=new k;k.prototype=null;return p}function r(p){var u=p.callee,v=t(u);u.apply(v,p);return v}var s=b,y=s._mixin,w=Object.prototype,g=w.toString,
k=new Function,m=0,n="constructor";s.declare=function(p,u,v){if(typeof p!="string"){v=u;u=p;p=""}v=v||{};var A,C,D,E,F,J,M,O=1,V=u;if(g.call(u)=="[object Array]"){J=a(u,p);D=J[0];O=J.length-D;u=J[O]}else{J=[0];if(u)if(g.call(u)=="[object Function]"){D=u._meta;J=J.concat(D?D.bases:u)}else d("base class is not a callable constructor.",p);else u!==null&&d("unknown base class. Did you use dojo.require to pull it in?",p)}if(u)for(C=O-1;;--C){A=t(u);if(!C)break;D=J[C];(D._meta?j:y)(A,D.prototype);E=new Function;
E.superclass=u;E.prototype=A;u=A.constructor=E}else A={};h(A,v);D=v.constructor;if(D!==w.constructor){D.nom=n;A.constructor=D}for(C=O-1;C;--C)if((D=J[C]._meta)&&D.chains)M=y(M||{},D.chains);if(A["-chains-"])M=y(M||{},A["-chains-"]);D=!M||!M.hasOwnProperty(n);J[0]=E=M&&M.constructor==="manual"?q(J):J.length==1?o(v.constructor,D):l(J,D);E._meta={bases:J,hidden:v,chains:M,parents:V,ctor:v.constructor};E.superclass=u&&u.prototype;E.extend=i;E.prototype=A;A.constructor=E;A.getInherited=e;A.inherited=c;
A.isInstanceOf=f;if(p){A.declaredClass=p;s.setObject(p,E)}if(M)for(F in M)if(A[F]&&typeof M[F]=="string"&&F!=n){D=A[F]=x(F,J,M[F]==="after");D.nom=F}return E};s.safeMixin=h})();return b.declare});
define("dojo/_base/connect",["dojo/lib/kernel","dojo/_base/lang"],function(b){b._listener={getDispatcher:function(){return function(){var d=Array.prototype,a=arguments.callee,c=a._listeners;a=(a=a.target)&&a.apply(this,arguments);var e;c=[].concat(c);for(e in c)e in d||c[e].apply(this,arguments);return a}},add:function(d,a,c){d=d||b.global;var e=d[a];if(!e||!e._listeners){var f=b._listener.getDispatcher();f.target=e;f._listeners=[];e=d[a]=f}return e._listeners.push(c)},remove:function(d,a,c){(d=(d||
b.global)[a])&&d._listeners&&c--&&delete d._listeners[c]}};b.connect=function(){var d=arguments,a=[],c=0;a.push(b.isString(d[0])?null:d[c++],d[c++]);var e=d[c+1];a.push(b.isString(e)||b.isFunction(e)?d[c++]:null,d[c++]);for(e=d.length;c<e;c++)a.push(d[c]);return b._connect.apply(this,a)};b._connect=function(d,a,c,e){var f=b._listener;c=f.add(d,a,b.hitch(c,e));return[d,a,c,f]};b.disconnect=function(d){if(d&&d[0]!==undefined){b._disconnect.apply(this,d);delete d[0]}};b._disconnect=function(d,a,c,e){e.remove(d,
a,c)};b._topics={};b.subscribe=function(d,a,c){return[d,b._listener.add(b._topics,d,b.hitch(a,c))]};b.unsubscribe=function(d){d&&b._listener.remove(b._topics,d[0],d[1])};b.publish=function(d,a){if(d=b._topics[d])d.apply(this,a||[])};b.connectPublisher=function(d,a,c){var e=function(){b.publish(d,arguments)};return c?b.connect(a,c,e):b.connect(a,e)};return b.connect});
define("dojo/_base/Deferred",["dojo/lib/kernel","dojo/_base/lang"],function(b){(function(){var d=function(){},a=Object.freeze||function(){};b.Deferred=function(c){function e(t){if(h)throw new Error("This deferred has already been resolved");j=t;h=true;f()}function f(){for(var t;!t&&o;){var r=o;o=o.next;if(t=r.progress==d)h=false;var s=i?r.error:r.resolved;if(s)try{var y=s(j);if(y&&typeof y.then==="function")y.then(b.hitch(r.deferred,"resolve"),b.hitch(r.deferred,"reject"));else{s=t&&y===undefined;
if(t&&!s)i=y instanceof Error;r.deferred[s&&i?"reject":"resolve"](s?j:y)}}catch(w){r.deferred.reject(w)}else i?r.deferred.reject(j):r.deferred.resolve(j)}}var j,h,i,l,o,q=this.promise={};this.resolve=this.callback=function(t){this.fired=0;this.results=[t,null];e(t)};this.reject=this.errback=function(t){i=true;this.fired=1;e(t);this.results=[null,t];if(!t||t.log!==false)(b.config.deferredOnError||function(r){console.error(r)})(t)};this.progress=function(t){for(var r=o;r;){var s=r.progress;s&&s(t);
r=r.next}};this.addCallbacks=function(t,r){this.then(t,r,d);return this};this.then=q.then=function(t,r,s){var y=s==d?this:new b.Deferred(q.cancel);t={resolved:t,error:r,progress:s,deferred:y};if(o)l=l.next=t;else o=l=t;h&&f();return y.promise};var x=this;this.cancel=q.cancel=function(){if(!h){var t=c&&c(x);if(!h){t instanceof Error||(t=new Error(t));t.log=false;x.reject(t)}}};a(q)};b.extend(b.Deferred,{addCallback:function(){return this.addCallbacks(b.hitch.apply(b,arguments))},addErrback:function(){return this.addCallbacks(null,
b.hitch.apply(b,arguments))},addBoth:function(){var c=b.hitch.apply(b,arguments);return this.addCallbacks(c,c)},fired:-1})})();b.when=function(d,a,c,e){if(d&&typeof d.then==="function")return d.then(a,c,e);return a(d)};return b.Deferred});
define("dojo/_base/json",["dojo/lib/kernel"],function(b){b.fromJson=function(d){return eval("("+d+")")};b._escapeString=function(d){return('"'+d.replace(/(["\\])/g,"\\$1")+'"').replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")};b.toJsonIndentStr="\t";b.toJson=function(d,a,c){if(d===undefined)return"undefined";var e=typeof d;if(e=="number"||e=="boolean")return d+"";if(d===null)return"null";if(b.isString(d))return b._escapeString(d);var f=
arguments.callee,j;c=c||"";var h=a?c+b.toJsonIndentStr:"";j=d.__json__||d.json;if(b.isFunction(j)){j=j.call(d);if(d!==j)return f(j,a,h)}if(d.nodeType&&d.cloneNode)throw new Error("Can't serialize DOM nodes");j=a?" ":"";var i=a?"\n":"";if(b.isArray(d))return"["+b.map(d,function(x){x=f(x,a,h);if(typeof x!="string")x="undefined";return i+h+x}).join(","+j)+i+c+"]";if(e=="function")return null;e=[];var l;for(l in d){var o,q;if(typeof l=="number")o='"'+l+'"';else if(typeof l=="string")o=b._escapeString(l);
else continue;q=f(d[l],a,h);typeof q=="string"&&e.push(i+h+o+":"+j+q)}return"{"+e.join(","+j)+i+c+"}"};return b});
define("dojo/_base/Color",["dojo/lib/kernel","dojo/_base/array","dojo/_base/lang"],function(b){(function(){b.Color=function(d){d&&this.setColor(d)};b.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:b.config.transparentColor||[255,255,255]};b.extend(b.Color,
{r:255,g:255,b:255,a:1,_set:function(d,a,c,e){this.r=d;this.g=a;this.b=c;this.a=e},setColor:function(d){if(b.isString(d))b.colorFromString(d,this);else if(b.isArray(d))b.colorFromArray(d,this);else{this._set(d.r,d.g,d.b,d.a);d instanceof b.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"#"+b.map(["r","g","b"],function(d){d=this[d].toString(16);return d.length<
2?"0"+d:d},this).join("")},toCss:function(d){var a=this.r+", "+this.g+", "+this.b;return(d?"rgba("+a+", "+this.a:"rgb("+a)+")"},toString:function(){return this.toCss(true)}});b.blendColors=function(d,a,c,e){var f=e||new b.Color;b.forEach(["r","g","b","a"],function(j){f[j]=d[j]+(a[j]-d[j])*c;if(j!="a")f[j]=Math.round(f[j])});return f.sanitize()};b.colorFromRgb=function(d,a){return(d=d.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/))&&b.colorFromArray(d[1].split(/\s*,\s*/),a)};b.colorFromHex=function(d,
a){var c=a||new b.Color,e=d.length==4?4:8,f=(1<<e)-1;d=Number("0x"+d.substr(1));if(isNaN(d))return null;b.forEach(["b","g","r"],function(j){var h=d&f;d>>=e;c[j]=e==4?17*h:h});c.a=1;return c};b.colorFromArray=function(d,a){a=a||new b.Color;a._set(Number(d[0]),Number(d[1]),Number(d[2]),Number(d[3]));if(isNaN(a.a))a.a=1;return a.sanitize()};b.colorFromString=function(d,a){var c=b.Color.named[d];return c&&b.colorFromArray(c,a)||b.colorFromRgb(d,a)||b.colorFromHex(d,a)}})();return b.Color});
define("dojo/_base/window",["dojo/lib/kernel"],function(b){b.doc=window.document||null;b.body=function(){return b.doc.body||b.doc.getElementsByTagName("body")[0]};b.setContext=function(d,a){b.global=d;b.doc=a};b.withGlobal=function(d,a,c,e){var f=b.global;try{b.global=d;return b.withDoc.call(null,d.document,a,c,e)}finally{b.global=f}};b.withDoc=function(d,a,c,e){var f=b.doc,j=b._bodyLtr,h=b.isQuirks;try{b.doc=d;delete b._bodyLtr;b.isQuirks=b.doc.compatMode=="BackCompat";if(c&&typeof a=="string")a=
c[a];return a.apply(c,e||[])}finally{b.doc=f;delete b._bodyLtr;if(j!==undefined)b._bodyLtr=j;b.isQuirks=h}};return b});
define("dojo/_base/event",["dojo/lib/kernel","dojo/_base/connect"],function(b){(function(){var d=b._event_listener={add:function(i,l,o){if(i){l=d._normalizeEventName(l);o=d._fixCallback(l,o);if(!b.isIE&&(l=="mouseenter"||l=="mouseleave")){var q=o;l=l=="mouseenter"?"mouseover":"mouseout";o=function(x){if(!b.isDescendant(x.relatedTarget,i))return q.call(this,x)}}i.addEventListener(l,o,false);return o}},remove:function(i,l,o){if(i){l=d._normalizeEventName(l);if(!b.isIE&&(l=="mouseenter"||l=="mouseleave"))l=
l=="mouseenter"?"mouseover":"mouseout";i.removeEventListener(l,o,false)}},_normalizeEventName:function(i){return i.slice(0,2)=="on"?i.slice(2):i},_fixCallback:function(i,l){return i!="keypress"?l:function(o){return l.call(this,d._fixEvent(o,this))}},_fixEvent:function(i){switch(i.type){case "keypress":d._setKeyChar(i);break}return i},_setKeyChar:function(i){i.keyChar=i.charCode>=32?String.fromCharCode(i.charCode):"";i.charOrCode=i.keyChar||i.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}};b.fixEvent=function(i,l){return d._fixEvent(i,l)};b.stopEvent=function(i){i.preventDefault();i.stopPropagation()};var a=b._listener;b._connect=function(i,l,o,q,x){x=i&&(i.nodeType||i.attachEvent||i.addEventListener)?x?2:1:0;o=[b._listener,d,a][x].add(i,l,b.hitch(o,q));return[i,l,o,x]};b._disconnect=function(i,l,o,q){[b._listener,d,a][q].remove(i,l,o)};b.keys={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,META:b.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:b.isMac&&!b.isAIR?b.isSafari?91:224:17};var c=b.isMac?"metaKey":"ctrlKey";b.isCopyKey=function(i){return i[c]};b.mouseButtons=b.isIE<9||b.isIE&&b.isQuirks?{LEFT:1,MIDDLE:4,RIGHT:2,isButton:function(i,l){return i.button&l},isLeft:function(i){return i.button&1},isMiddle:function(i){return i.button&4},isRight:function(i){return i.button&2}}:{LEFT:0,MIDDLE:1,RIGHT:2,isButton:function(i,l){return i.button==l},isLeft:function(i){return i.button==
0},isMiddle:function(i){return i.button==1},isRight:function(i){return i.button==2}};if(b.isIE){var e=function(i,l){try{return i.keyCode=l}catch(o){return 0}},f=b._listener,j=b._ieListenersName="_"+b._scopeName+"_listeners";if(!b.config._allow_leaks){a=f=b._ie_listener={handlers:[],add:function(i,l,o){i=i||b.global;var q=i[l];if(!q||!q[j]){var x=b._getIeDispatcher();x.target=q&&h.push(q)-1;x[j]=[];q=i[l]=x}return q[j].push(h.push(o)-1)},remove:function(i,l,o){l=(i=(i||b.global)[l])&&i[j];if(i&&l&&
o--){delete h[l[o]];delete l[o]}}};var h=f.handlers}b.mixin(d,{add:function(i,l,o){if(i){l=d._normalizeEventName(l);if(l=="onkeypress"){var q=i.onkeydown;if(!q||!q[j]||!q._stealthKeydownHandle){var x=d.add(i,"onkeydown",d._stealthKeyDown);q=i.onkeydown;q._stealthKeydownHandle=x;q._stealthKeydownRefs=1}else q._stealthKeydownRefs++}return f.add(i,l,d._fixCallback(o))}},remove:function(i,l,o){l=d._normalizeEventName(l);f.remove(i,l,o);if(l=="onkeypress"){l=i.onkeydown;if(--l._stealthKeydownRefs<=0){f.remove(i,
"onkeydown",l._stealthKeydownHandle);delete l._stealthKeydownHandle}}},_normalizeEventName:function(i){return i.slice(0,2)!="on"?"on"+i:i},_nop:function(){},_fixEvent:function(i,l){if(!i)i=(l&&(l.ownerDocument||l.document||l).parentWindow||window).event;if(!i)return i;i.target=i.srcElement;i.currentTarget=l||i.srcElement;i.layerX=i.offsetX;i.layerY=i.offsetY;l=(l=i.srcElement)&&l.ownerDocument||document;l=b.isIE<6||l.compatMode=="BackCompat"?l.body:l.documentElement;var o=b._getIeDocumentElementOffset();
i.pageX=i.clientX+b._fixIeBiDiScrollLeft(l.scrollLeft||0)-o.x;i.pageY=i.clientY+(l.scrollTop||0)-o.y;if(i.type=="mouseover")i.relatedTarget=i.fromElement;if(i.type=="mouseout")i.relatedTarget=i.toElement;if(b.isIE<9||b.isQuirks){i.stopPropagation=d._stopPropagation;i.preventDefault=d._preventDefault}return d._fixKeys(i)},_fixKeys:function(i){switch(i.type){case "keypress":var l="charCode"in i?i.charCode:i.keyCode;if(l==10){l=0;i.keyCode=13}else if(l==13||l==27)l=0;else if(l==3)l=99;i.charCode=l;d._setKeyChar(i);
break}return i},_stealthKeyDown:function(i){var l=i.currentTarget.onkeypress;if(l&&l[j]){var o=i.keyCode,q=(o!=13||b.isIE>=9&&!b.isQuirks)&&o!=32&&o!=27&&(o<48||o>90)&&(o<96||o>111)&&(o<186||o>192)&&(o<219||o>222);if(q||i.ctrlKey){q=q?0:o;if(i.ctrlKey)if(o==3||o==13)return;else if(q>95&&q<106)q-=48;else if(!i.shiftKey&&q>=65&&q<=90)q+=32;else q=d._punctMap[q]||q;o=d._synthesizeEvent(i,{type:"keypress",faux:true,charCode:q});l.call(i.currentTarget,o);if(b.isIE<9||b.isIE&&b.isQuirks)i.cancelBubble=
o.cancelBubble;i.returnValue=o.returnValue;e(i,o.keyCode)}}},_stopPropagation:function(){this.cancelBubble=true},_preventDefault:function(){this.bubbledKeyCode=this.keyCode;this.ctrlKey&&e(this,0);this.returnValue=false}});b.stopEvent=b.isIE<9||b.isQuirks?function(i){i=i||window.event;d._stopPropagation.call(i);d._preventDefault.call(i)}:b.stopEvent}d._synthesizeEvent=function(i,l){l=b.mixin({},i,l);d._setKeyChar(l);l.preventDefault=function(){i.preventDefault()};l.stopPropagation=function(){i.stopPropagation()};
return l};b.isOpera&&b.mixin(d,{_fixEvent:function(i){switch(i.type){case "keypress":var l=i.which;if(l==3)l=99;l=l<41&&!i.shiftKey?0:l;if(i.ctrlKey&&!i.shiftKey&&l>=65&&l<=90)l+=32;return d._synthesizeEvent(i,{charCode:l})}return i}});if(b.isWebKit){d._add=d.add;d._remove=d.remove;b.mixin(d,{add:function(i,l,o){if(i){var q=d._add(i,l,o);if(d._normalizeEventName(l)=="keypress")q._stealthKeyDownHandle=d._add(i,"keydown",function(x){var t=x.keyCode,r=t!=13&&t!=32&&(t<48||t>90)&&(t<96||t>111)&&(t<186||
t>192)&&(t<219||t>222);if(r||x.ctrlKey){r=r?0:t;if(x.ctrlKey)if(t==3||t==13)return;else if(r>95&&r<106)r-=48;else if(!x.shiftKey&&r>=65&&r<=90)r+=32;else r=d._punctMap[r]||r;t=d._synthesizeEvent(x,{type:"keypress",faux:true,charCode:r});o.call(x.currentTarget,t)}});return q}},remove:function(i,l,o){if(i){o._stealthKeyDownHandle&&d._remove(i,"keydown",o._stealthKeyDownHandle);d._remove(i,l,o)}},_fixEvent:function(i){switch(i.type){case "keypress":if(i.faux)return i;var l=i.charCode;l=l>=32?l:0;return d._synthesizeEvent(i,
{charCode:l,faux:true})}return i}})}})();if(b.isIE){b._ieDispatcher=function(d,a){var c=Array.prototype,e=b._ie_listener.handlers,f=d.callee,j=f[b._ieListenersName];f=(f=e[f.target])&&f.apply(a,d);j=[].concat(j);for(var h in j){var i=e[j[h]];!(h in c)&&i&&i.apply(a,d)}return f};b._getIeDispatcher=function(){return new Function(b._scopeName+"._ieDispatcher(arguments, this)")};b._event_listener._fixCallback=function(d){var a=b._event_listener._fixEvent;return function(c){return d.call(this,a(c,this))}}}return b.connect});
define("dojo/_base/html",["dojo/lib/kernel","dojo/_base/lang"],function(b){try{document.execCommand("BackgroundImageCache",false,true)}catch(d){}b.byId=b.isIE?function(a,c){if(typeof a!="string")return a;var e=c||b.doc;if((c=e.getElementById(a))&&(c.attributes.id.value==a||c.id==a))return c;else{var f=e.all[a];if(!f||f.nodeName)f=[f];for(var j=0;c=f[j++];)if(c.attributes&&c.attributes.id&&c.attributes.id.value==a||c.id==a)return c}}:function(a,c){return(typeof a=="string"?(c||b.doc).getElementById(a):
a)||null};(function(){var a=b.byId,c=null,e;b.addOnWindowUnload(function(){c=null});b._destroyElement=b.destroy=function(z){z=a(z);try{var B=z.ownerDocument;if(!c||e!=B){c=B.createElement("div");e=B}c.appendChild(z.parentNode?z.parentNode.removeChild(z):z);c.innerHTML=""}catch(I){}};b.isDescendant=function(z,B){try{z=a(z);for(B=a(B);z;){if(z==B)return true;z=z.parentNode}}catch(I){}return false};b.setSelectable=function(z,B){z=a(z);if(b.isMozilla)z.style.MozUserSelect=B?"":"none";else if(b.isKhtml||
b.isWebKit)z.style.KhtmlUserSelect=B?"auto":"none";else if(b.isIE){B=z.unselectable=B?"":"on";b.query("*",z).forEach("item.unselectable = '"+B+"'")}};var f=function(z,B){var I=B.parentNode;I&&I.insertBefore(z,B)},j=function(z,B){var I=B.parentNode;if(I)I.lastChild==B?I.appendChild(z):I.insertBefore(z,B.nextSibling)};b.place=function(z,B,I){B=a(B);if(typeof z=="string")z=/^\s*</.test(z)?b._toDom(z,B.ownerDocument):a(z);if(typeof I=="number"){var N=B.childNodes;!N.length||N.length<=I?B.appendChild(z):
f(z,N[I<0?0:I])}else switch(I){case "before":f(z,B);break;case "after":j(z,B);break;case "replace":B.parentNode.replaceChild(z,B);break;case "only":b.empty(B);B.appendChild(z);break;case "first":if(B.firstChild){f(z,B.firstChild);break}default:B.appendChild(z)}return z};b.boxModel="content-box";if(b.isIE)b.boxModel=document.compatMode=="BackCompat"?"border-box":"content-box";var h;h=b.isWebKit?function(z){var B;if(z.nodeType==1){var I=z.ownerDocument.defaultView;B=I.getComputedStyle(z,null);if(!B&&
z.style){z.style.display="";B=I.getComputedStyle(z,null)}}return B||{}}:b.isIE?function(z){return z.nodeType==1?z.currentStyle:{}}:function(z){return z.nodeType==1?z.ownerDocument.defaultView.getComputedStyle(z,null):{}};b.getComputedStyle=h;b._toPixelValue=b.isIE?function(z,B){if(!B)return 0;if(B=="medium")return 4;if(B.slice&&B.slice(-2)=="px")return parseFloat(B);with(z){z=style.left;var I=runtimeStyle.left;runtimeStyle.left=currentStyle.left;try{style.left=B;B=style.pixelLeft}catch(N){B=0}style.left=
z;runtimeStyle.left=I}return B}:function(z,B){return parseFloat(B)||0};var i=b._toPixelValue,l=function(z,B){try{return z.filters.item("DXImageTransform.Microsoft.Alpha")}catch(I){return B?{}:null}};b._getOpacity=b.isIE<9?function(z){try{return l(z).Opacity/100}catch(B){return 1}}:function(z){return h(z).opacity};b._setOpacity=b.isIE<9?function(z,B){var I=B*100,N=B==1;z.style.zoom=N?"":1;if(l(z))l(z,1).Opacity=I;else{if(N)return B;z.style.filter+=" progid:DXImageTransform.Microsoft.Alpha(Opacity="+
I+")"}l(z,1).Enabled=!N;z.nodeName.toLowerCase()=="tr"&&b.query("> td",z).forEach(function(U){b._setOpacity(U,B)});return B}:function(z,B){return z.style.opacity=B};var o={left:true,top:true},q=/margin|padding|width|height|max|min|offset/,x=function(z,B,I){B=B.toLowerCase();if(b.isIE){if(I=="auto"){if(B=="height")return z.offsetHeight;if(B=="width")return z.offsetWidth}if(B=="fontweight")switch(I){case 700:return"bold";case 400:default:return"normal"}}B in o||(o[B]=q.test(B));return o[B]?i(z,I):I},
t=b.isIE?"styleFloat":"cssFloat",r={cssFloat:t,styleFloat:t,"float":t};b.style=function(z,B,I){var N=a(z),U=arguments.length,W=B=="opacity";B=r[B]||B;if(U==3)return W?b._setOpacity(N,I):(N.style[B]=I);if(U==2&&W)return b._getOpacity(N);W=h(N);if(U==2&&typeof B!="string"){for(var Y in B)b.style(z,Y,B[Y]);return W}return U==1?W:x(N,B,W[B]||N.style[B])};b._getPadExtents=function(z,B){B=B||h(z);var I=i(z,B.paddingLeft),N=i(z,B.paddingTop);return{l:I,t:N,w:I+i(z,B.paddingRight),h:N+i(z,B.paddingBottom)}};
b._getBorderExtents=function(z,B){B=B||h(z);var I=B.borderLeftStyle!="none"?i(z,B.borderLeftWidth):0,N=B.borderTopStyle!="none"?i(z,B.borderTopWidth):0;return{l:I,t:N,w:I+(B.borderRightStyle!="none"?i(z,B.borderRightWidth):0),h:N+(B.borderBottomStyle!="none"?i(z,B.borderBottomWidth):0)}};b._getPadBorderExtents=function(z,B){var I=B||h(z);B=b._getPadExtents(z,I);z=b._getBorderExtents(z,I);return{l:B.l+z.l,t:B.t+z.t,w:B.w+z.w,h:B.h+z.h}};b._getMarginExtents=function(z,B){B=B||h(z);var I=i(z,B.marginLeft),
N=i(z,B.marginTop),U=i(z,B.marginRight);z=i(z,B.marginBottom);if(b.isWebKit&&B.position!="absolute")U=I;return{l:I,t:N,w:I+U,h:N+z}};b._getMarginBox=function(z,B){var I=B||h(z);B=b._getMarginExtents(z,I);var N=z.offsetLeft-B.l,U=z.offsetTop-B.t,W=z.parentNode;if(b.isMoz){var Y=parseFloat(I.left);I=parseFloat(I.top);if(!isNaN(Y)&&!isNaN(I)){N=Y;U=I}else if(W&&W.style){Y=h(W);if(Y.overflow!="visible"){W=b._getBorderExtents(W,Y);N+=W.l;U+=W.t}}}else if(b.isOpera||b.isIE>7&&!b.isQuirks)if(W){W=b._getBorderExtents(W);
N-=W.l;U-=W.t}return{l:N,t:U,w:z.offsetWidth+B.w,h:z.offsetHeight+B.h}};b._getMarginSize=function(z,B){z=a(z);B=b._getMarginExtents(z,B||h(z));z=z.getBoundingClientRect();return{w:z.right-z.left+B.w,h:z.bottom-z.top+B.h}};b._getContentBox=function(z,B){var I=B||h(z);B=b._getPadExtents(z,I);I=b._getBorderExtents(z,I);var N=z.clientWidth;if(N){z=z.clientHeight;I.w=I.h=0}else{N=z.offsetWidth;z=z.offsetHeight}if(b.isOpera){B.l+=I.l;B.t+=I.t}return{l:B.l,t:B.t,w:N-B.w-I.w,h:z-B.h-I.h}};b._getBorderBox=
function(z,B){var I=B||h(z);B=b._getPadExtents(z,I);z=b._getContentBox(z,I);return{l:z.l-B.l,t:z.t-B.t,w:z.w+B.w,h:z.h+B.h}};b._setBox=function(z,B,I,N,U,W){W=W||"px";z=z.style;if(!isNaN(B))z.left=B+W;if(!isNaN(I))z.top=I+W;if(N>=0)z.width=N+W;if(U>=0)z.height=U+W};b._isButtonTag=function(z){return z.tagName=="BUTTON"||z.tagName=="INPUT"&&(z.getAttribute("type")||"").toUpperCase()=="BUTTON"};b._usesBorderBox=function(z){var B=z.tagName;return b.boxModel=="border-box"||B=="TABLE"||b._isButtonTag(z)};
b._setContentSize=function(z,B,I,N){if(b._usesBorderBox(z)){N=b._getPadBorderExtents(z,N);if(B>=0)B+=N.w;if(I>=0)I+=N.h}b._setBox(z,NaN,NaN,B,I)};b._setMarginBox=function(z,B,I,N,U,W){var Y=W||h(z);W=b._usesBorderBox(z)?s:b._getPadBorderExtents(z,Y);if(b.isWebKit)if(b._isButtonTag(z)){var da=z.style;if(N>=0&&!da.width)da.width="4px";if(U>=0&&!da.height)da.height="4px"}Y=b._getMarginExtents(z,Y);if(N>=0)N=Math.max(N-W.w-Y.w,0);if(U>=0)U=Math.max(U-W.h-Y.h,0);b._setBox(z,B,I,N,U)};var s={l:0,t:0,w:0,
h:0};b.marginBox=function(z,B){z=a(z);var I=h(z);return!B?b._getMarginBox(z,I):b._setMarginBox(z,B.l,B.t,B.w,B.h,I)};b.contentBox=function(z,B){z=a(z);var I=h(z);return!B?b._getContentBox(z,I):b._setContentSize(z,B.w,B.h,I)};b._docScroll=function(){var z=b.global;return"pageXOffset"in z?{x:z.pageXOffset,y:z.pageYOffset}:(z=b.isQuirks?b.doc.body:b.doc.documentElement,{x:b._fixIeBiDiScrollLeft(z.scrollLeft||0),y:z.scrollTop||0})};b._isBodyLtr=function(){return"_bodyLtr"in b?b._bodyLtr:(b._bodyLtr=(b.body().dir||
b.doc.documentElement.dir||"ltr").toLowerCase()=="ltr")};b._getIeDocumentElementOffset=function(){var z=b.doc.documentElement;if(b.isIE<8){var B=z.getBoundingClientRect(),I=B.left;B=B.top;if(b.isIE<7){I+=z.clientLeft;B+=z.clientTop}return{x:I<0?0:I,y:B<0?0:B}}else return{x:0,y:0}};b._fixIeBiDiScrollLeft=function(z){var B=b.isIE;if(B&&!b._isBodyLtr()){var I=b.isQuirks,N=I?b.doc.body:b.doc.documentElement;if(B==6&&!I&&b.global.frameElement&&N.scrollHeight>N.clientHeight)z+=N.clientLeft;return B<8||
I?z+N.clientWidth-N.scrollWidth:-z}return z};b._abs=b.position=function(z,B){z=a(z);var I=b.body(),N=I.parentNode;z=z.getBoundingClientRect();z={x:z.left,y:z.top,w:z.right-z.left,h:z.bottom-z.top};if(b.isIE){N=b._getIeDocumentElementOffset();z.x-=N.x+(b.isQuirks?I.clientLeft+I.offsetLeft:0);z.y-=N.y+(b.isQuirks?I.clientTop+I.offsetTop:0)}else if(b.isFF==3){I=h(N);z.x-=i(N,I.marginLeft)+i(N,I.borderLeftWidth);z.y-=i(N,I.marginTop)+i(N,I.borderTopWidth)}if(B){B=b._docScroll();z.x+=B.x;z.y+=B.y}return z};
b.coords=function(z,B){z=a(z);var I=h(z);I=b._getMarginBox(z,I);B=b.position(z,B);I.x=B.x;I.y=B.y;return I};var y={"class":"className","for":"htmlFor",tabindex:"tabIndex",readonly:"readOnly",colspan:"colSpan",frameborder:"frameBorder",rowspan:"rowSpan",valuetype:"valueType"},w={classname:"class",htmlfor:"for",tabindex:"tabIndex",readonly:"readOnly"},g={innerHTML:1,className:1,htmlFor:b.isIE,value:1},k=function(z){return w[z.toLowerCase()]||z},m=function(z,B){return(z=z.getAttributeNode&&z.getAttributeNode(B))&&
z.specified};b.hasAttr=function(z,B){var I=B.toLowerCase();return g[y[I]||B]||m(a(z),w[I]||B)};var n={},p=0,u=b._scopeName+"attrid",v={col:1,colgroup:1,table:1,tbody:1,tfoot:1,thead:1,tr:1,title:1};b.attr=function(z,B,I){z=a(z);var N=arguments.length;if(N==2&&typeof B!="string"){for(var U in B)b.attr(z,U,B[U]);return z}var W=B.toLowerCase();U=y[W]||B;var Y=g[U];W=w[W]||B;if(N==3){if(U=="style"&&typeof I!="string")b.style(z,I);else if(U=="innerHTML")if(b.isIE&&z.tagName.toLowerCase()in v){b.empty(z);
z.appendChild(b._toDom(I,z.ownerDocument))}else z[U]=I;else if(b.isFunction(I)){N=b.attr(z,u);if(!N){N=p++;b.attr(z,u,N)}n[N]||(n[N]={});if(Y=n[N][U])b.disconnect(Y);else try{delete z[U]}catch(da){}n[N][U]=b.connect(z,U,I)}else if(Y||typeof I=="boolean")z[U]=I;else z.setAttribute(W,I);return z}I=z[U];if(Y&&typeof I!="undefined")return I;if(U!="href"&&(typeof I=="boolean"||b.isFunction(I)))return I;return m(z,W)?z.getAttribute(W):null};b.removeAttr=function(z,B){a(z).removeAttribute(k(B))};b.getNodeProp=
function(z,B){z=a(z);var I=B.toLowerCase(),N=y[I]||B;if(N in z&&N!="href")return z[N];B=w[I]||B;return m(z,B)?z.getAttribute(B):null};b.create=function(z,B,I,N){var U=b.doc;if(I){I=a(I);U=I.ownerDocument}if(typeof z=="string")z=U.createElement(z);B&&b.attr(z,B);I&&b.place(z,I,N);return z};b.empty=b.isIE?function(z){z=a(z);for(var B;B=z.lastChild;)b.destroy(B)}:function(z){a(z).innerHTML=""};var A={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"]},C=/<\s*([\w\:]+)/,D={},E=0,F="__"+b._scopeName+"ToDomId";for(var J in A)if(A.hasOwnProperty(J)){var M=A[J];M.pre=J=="option"?'<select multiple="multiple">':"<"+M.join("><")+">";M.post="</"+M.reverse().join("></")+">"}b._toDom=function(z,B){B=B||b.doc;var I=B[F];if(!I){B[F]=I=++E+"";D[I]=B.createElement("div")}z+="";var N=z.match(C),U=N?N[1].toLowerCase():"";I=D[I];if(N&&A[U]){N=
A[U];I.innerHTML=N.pre+z+N.post;for(z=N.length;z;--z)I=I.firstChild}else I.innerHTML=z;if(I.childNodes.length==1)return I.removeChild(I.firstChild);for(z=B.createDocumentFragment();B=I.firstChild;)z.appendChild(B);return z};var O="className";b.hasClass=function(z,B){return(" "+a(z)[O]+" ").indexOf(" "+B+" ")>=0};var V=/\s+/,Z=[""],Q={},ga=function(z){if(typeof z=="string"||z instanceof String)if(z.indexOf(" ")<0){Z[0]=z;return Z}else return z.split(V);return z||""};b.addClass=function(z,B){z=a(z);
B=ga(B);var I=z[O],N;I=I?" "+I+" ":" ";N=I.length;for(var U=0,W=B.length,Y;U<W;++U)if((Y=B[U])&&I.indexOf(" "+Y+" ")<0)I+=Y+" ";if(N<I.length)z[O]=I.substr(1,I.length-2)};b.removeClass=function(z,B){z=a(z);var I;if(B!==undefined){B=ga(B);I=" "+z[O]+" ";for(var N=0,U=B.length;N<U;++N)I=I.replace(" "+B[N]+" "," ");I=b.trim(I)}else I="";if(z[O]!=I)z[O]=I};b.replaceClass=function(z,B,I){z=a(z);Q.className=z.className;b.removeClass(Q,I);b.addClass(Q,B);if(z.className!==Q.className)z.className=Q.className};
b.toggleClass=function(z,B,I){if(I===undefined)I=!b.hasClass(z,B);b[I?"addClass":"removeClass"](z,B)}})();return b});
define("dojo/_base/NodeList",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array","dojo/_base/connect","dojo/_base/html"],function(b){(function(){var d=Array.prototype,a=d.slice,c=d.concat,e=function(t,r,s){t.sort||(t=a.call(t,0));s=s||this._NodeListCtor||b._NodeListCtor;t.constructor=s;b._mixin(t,s.prototype);t._NodeListCtor=s;return r?t._stash(r):t},f=function(t,r,s){r=[0].concat(a.call(r,0));s=s||b.global;return function(y){r[0]=y;return t.apply(s,r)}},j=function(t,r){return function(){this.forEach(f(t,
arguments,r));return this}},h=function(t,r){return function(){return this.map(f(t,arguments,r))}},i=function(t,r,s){return function(){var y=arguments,w=f(t,y,s);if(r.call(s||b.global,y))return this.map(w);this.forEach(w);return this}},l=function(t){return t.length==1&&typeof t[0]=="string"},o=function(t){var r=t.parentNode;r&&r.removeChild(t)};b.NodeList=function(){return e(Array.apply(null,arguments))};var q=b._NodeListCtor=b.NodeList,x=q.prototype;q._wrap=x._wrap=e;q._adaptAsMap=h;q._adaptAsForEach=
j;q._adaptAsFilter=function(t,r){return function(){return this.filter(f(t,arguments,r))}};q._adaptWithCondition=i;b.forEach(["slice","splice"],function(t){var r=d[t];x[t]=function(){return this._wrap(r.apply(this,arguments),t=="slice"?this:null)}});b.forEach(["indexOf","lastIndexOf","every","some"],function(t){var r=b[t];x[t]=function(){return r.apply(b,[this].concat(a.call(arguments,0)))}});b.forEach(["attr","style"],function(t){x[t]=i(b[t],l)});b.forEach(["connect","addClass","removeClass","replaceClass",
"toggleClass","empty","removeAttr"],function(t){x[t]=j(b[t])});b.extend(b.NodeList,{_normalize:function(t,r){var s=t.parse===true?true:false;if(typeof t.template=="string"){var y=t.templateFunc||b.string&&b.string.substitute;t=y?y(t.template,t):t}y=typeof t;if(y=="string"||y=="number"){t=b._toDom(t,r&&r.ownerDocument);t=t.nodeType==11?b._toArray(t.childNodes):[t]}else if(b.isArrayLike(t))b.isArray(t)||(t=b._toArray(t));else t=[t];if(s)t._runParse=true;return t},_cloneNode:function(t){return t.cloneNode(true)},
_place:function(t,r,s,y){if(!(r.nodeType!=1&&s=="only")){r=r;for(var w,g=t.length,k=g-1;k>=0;k--){var m=y?this._cloneNode(t[k]):t[k];if(t._runParse&&b.parser&&b.parser.parse){w||(w=r.ownerDocument.createElement("div"));w.appendChild(m);b.parser.parse(w);for(m=w.firstChild;w.firstChild;)w.removeChild(w.firstChild)}k==g-1?b.place(m,r,s):r.parentNode.insertBefore(m,r);r=m}}},_stash:function(t){this._parent=t;return this},end:function(){return this._parent?this._parent:new this._NodeListCtor},concat:function(){var t=
b.isArray(this)?this:a.call(this,0),r=b.map(arguments,function(s){return s&&!b.isArray(s)&&(typeof NodeList!="undefined"&&s.constructor===NodeList||s.constructor===this._NodeListCtor)?a.call(s,0):s});return this._wrap(c.apply(t,r),this)},map:function(t,r){return this._wrap(b.map(this,t,r),this)},forEach:function(t,r){b.forEach(this,t,r);return this},coords:h(b.coords),position:h(b.position),place:function(t,r){var s=b.query(t)[0];return this.forEach(function(y){b.place(y,s,r)})},orphan:function(t){return(t?
b._filterQueryResult(this,t):this).forEach(o)},adopt:function(t,r){return b.query(t).place(this[0],r)._stash(this)},query:function(t){if(!t)return this;var r=this.map(function(s){return b.query(t,s).filter(function(y){return y!==undefined})});return this._wrap(c.apply([],r),this)},filter:function(t){var r=arguments,s=this,y=0;if(typeof t=="string"){s=b._filterQueryResult(this,r[0]);if(r.length==1)return s._stash(this);y=1}return this._wrap(b.filter(s,r[y],r[y+1]),this)},addContent:function(t,r){t=
this._normalize(t,this[0]);for(var s=0,y;y=this[s];s++)this._place(t,y,r,s>0);return this},instantiate:function(t,r){var s=b.isFunction(t)?t:b.getObject(t);r=r||{};return this.forEach(function(y){new s(r,y)})},at:function(){var t=new this._NodeListCtor;b.forEach(arguments,function(r){if(r<0)r=this.length+r;this[r]&&t.push(this[r])},this);return t._stash(this)}});q.events=["blur","focus","change","click","error","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mousemove",
"mouseout","mouseover","mouseup","submit"];b.forEach(q.events,function(t){var r="on"+t;x[r]=function(s,y){return this.connect(r,s,y)}})})();return b.NodeList});
(function(){var b=function(a){var c=a.trim,e=a.forEach,f=a._NodeListCtor=a.NodeList,j=function(){return a.doc},h=(a.isWebKit||a.isMozilla)&&j().compatMode=="BackCompat",i=j().firstChild.children?"children":"childNodes",l=false,o=function(){return true},q=function(G){G+=">~+".indexOf(G.slice(-1))>=0?" * ":" ";for(var H=function(oa,pa){return c(G.slice(oa,pa))},K=[],L=-1,R=-1,P=-1,S=-1,T=-1,X=-1,ea=-1,$="",aa="",ha,ba=0,qa=G.length,ca=null,ja=null,ra=function(){if(ea>=0){var oa=ea==ba?null:H(ea,ba);
ca[">~+".indexOf(oa)<0?"tag":"oper"]=oa;ea=-1}},sa=function(){if(X>=0){ca.id=H(X,ba).replace(/\\/g,"");X=-1}},ta=function(){if(T>=0){ca.classes.push(H(T+1,ba).replace(/\\/g,""));T=-1}},ma=function(){sa();ra();ta()},ua=function(){ma();S>=0&&ca.pseudos.push({name:H(S+1,ba)});ca.loops=ca.pseudos.length||ca.attrs.length||ca.classes.length;ca.oquery=ca.query=H(ha,ba);ca.otag=ca.tag=ca.oper?null:ca.tag||"*";if(ca.tag)ca.tag=ca.tag.toUpperCase();if(K.length&&K[K.length-1].oper){ca.infixOper=K.pop();ca.query=
ca.infixOper.query+" "+ca.query}K.push(ca);ca=null};$=aa,aa=G.charAt(ba),ba<qa;ba++)if($!="\\"){if(!ca){ha=ba;ca={query:null,pseudos:[],attrs:[],classes:[],tag:null,oper:null,id:null,getTag:function(){return l?this.otag:this.tag}};ea=ba}if(L>=0)if(aa=="]"){if(ja.attr)ja.matchFor=H(P||L+1,ba);else ja.attr=H(L+1,ba);if(L=ja.matchFor)if(L.charAt(0)=='"'||L.charAt(0)=="'")ja.matchFor=L.slice(1,-1);ca.attrs.push(ja);ja=null;L=P=-1}else{if(aa=="="){P="|~^$*".indexOf($)>=0?$:"";ja.type=P+aa;ja.attr=H(L+
1,ba-P.length);P=ba+1}}else if(R>=0){if(aa==")"){if(S>=0)ja.value=H(R+1,ba);S=R=-1}}else if(aa=="#"){ma();X=ba+1}else if(aa=="."){ma();T=ba}else if(aa==":"){ma();S=ba}else if(aa=="["){ma();L=ba;ja={}}else if(aa=="("){if(S>=0){ja={name:H(S+1,ba),value:null};ca.pseudos.push(ja)}R=ba}else aa==" "&&$!=aa&&ua()}return K},x=function(G,H){if(!G)return H;if(!H)return G;return function(){return G.apply(window,arguments)&&H.apply(window,arguments)}},t=function(G,H){H=H||[];G&&H.push(G);return H},r=function(G){return 1==
G.nodeType},s=function(G,H){if(!G)return"";if(H=="class")return G.className||"";if(H=="for")return G.htmlFor||"";if(H=="style")return G.style.cssText||"";return(l?G.getAttribute(H):G.getAttribute(H,2))||""},y={"*=":function(G,H){return function(K){return s(K,G).indexOf(H)>=0}},"^=":function(G,H){return function(K){return s(K,G).indexOf(H)==0}},"$=":function(G,H){return function(K){K=" "+s(K,G);return K.lastIndexOf(H)==K.length-H.length}},"~=":function(G,H){var K=" "+H+" ";return function(L){return(" "+
s(L,G)+" ").indexOf(K)>=0}},"|=":function(G,H){var K=" "+H+"-";return function(L){L=" "+s(L,G);return L==H||L.indexOf(K)==0}},"=":function(G,H){return function(K){return s(K,G)==H}}},w=typeof j().firstChild.nextElementSibling=="undefined",g=!w?"nextElementSibling":"nextSibling",k=!w?"previousElementSibling":"previousSibling",m=w?r:o,n=function(G){for(;G=G[k];)if(m(G))return false;return true},p=function(G){for(;G=G[g];)if(m(G))return false;return true},u=function(G){var H=G.parentNode,K=0,L=H[i],
R=G._i||-1,P=H._l||-1;if(!L)return-1;L=L.length;if(P==L&&R>=0&&P>=0)return R;H._l=L;R=-1;for(H=H.firstElementChild||H.firstChild;H;H=H[g])if(m(H)){H._i=++K;if(G===H)R=K}return R},v=function(G){return!(u(G)%2)},A=function(G){return u(G)%2},C={checked:function(){return function(G){return!!("checked"in G?G.checked:G.selected)}},"first-child":function(){return n},"last-child":function(){return p},"only-child":function(){return function(G){if(!n(G))return false;if(!p(G))return false;return true}},empty:function(){return function(G){var H=
G.childNodes;for(G=G.childNodes.length-1;G>=0;G--){var K=H[G].nodeType;if(K===1||K==3)return false}return true}},contains:function(G,H){G=H.charAt(0);if(G=='"'||G=="'")H=H.slice(1,-1);return function(K){return K.innerHTML.indexOf(H)>=0}},not:function(G,H){G=q(H)[0];H={el:1};if(G.tag!="*")H.tag=1;if(!G.classes.length)H.classes=1;var K=E(G,H);return function(L){return!K(L)}},"nth-child":function(G,H){G=parseInt;if(H=="odd")return A;else if(H=="even")return v;if(H.indexOf("n")!=-1){H=H.split("n",2);
var K=H[0]?H[0]=="-"?-1:G(H[0]):1,L=H[1]?G(H[1]):0,R=0,P=-1;if(K>0)if(L<0)L=L%K&&K+L%K;else{if(L>0){if(L>=K)R=L-L%K;L%=K}}else if(K<0){K*=-1;if(L>0){P=L;L%=K}}if(K>0)return function(T){T=u(T);return T>=R&&(P<0||T<=P)&&T%K==L};else H=L}var S=G(H);return function(T){return u(T)==S}}},D=a.isIE<9||dojo.isIE&&dojo.isQuirks?function(G){var H=G.toLowerCase();if(H=="class")G="className";return function(K){return l?K.getAttribute(G):K[G]||K[H]}}:function(G){return function(H){return H&&H.getAttribute&&H.hasAttribute(G)}},
E=function(G,H){if(!G)return o;H=H||{};var K=null;"el"in H||(K=x(K,r));if(!("tag"in H))if(G.tag!="*")K=x(K,function(L){return L&&L.tagName==G.getTag()});"classes"in H||e(G.classes,function(L,R){var P=new RegExp("(?:^|\\s)"+L+"(?:\\s|$)");K=x(K,function(S){return P.test(S.className)});K.count=R});"pseudos"in H||e(G.pseudos,function(L){var R=L.name;if(C[R])K=x(K,C[R](R,L.value))});"attrs"in H||e(G.attrs,function(L){var R,P=L.attr;if(L.type&&y[L.type])R=y[L.type](P,L.matchFor);else if(P.length)R=D(P);
if(R)K=x(K,R)});if(!("id"in H))if(G.id)K=x(K,function(L){return!!L&&L.id==G.id});K||"default"in H||(K=o);return K},F=function(G){return function(H,K,L){for(;H=H[g];)if(!(w&&!r(H))){if((!L||ka(H,L))&&G(H))K.push(H);break}return K}},J=function(G){return function(H,K,L){for(H=H[g];H;){if(m(H)){if(L&&!ka(H,L))break;G(H)&&K.push(H)}H=H[g]}return K}},M=function(G){G=G||o;return function(H,K,L){for(var R=0,P=H[i];H=P[R++];)if(m(H)&&(!L||ka(H,L))&&G(H,R))K.push(H);return K}},O=function(G,H){for(G=G.parentNode;G;){if(G==
H)break;G=G.parentNode}return!!G},V={},Z=function(G){var H=V[G.query];if(H)return H;var K=G.infixOper;K=K?K.oper:"";var L=E(G,{el:1}),R="*"==G.tag,P=j().getElementsByClassName;if(K){P={el:1};if(R)P.tag=1;L=E(G,P);if("+"==K)H=F(L);else if("~"==K)H=J(L);else if(">"==K)H=M(L)}else if(G.id){L=!G.loops&&R?o:E(G,{el:1,id:1});H=function(T,X){var ea=a.byId(G.id,T.ownerDocument||T);if(ea&&L(ea))if(9==T.nodeType)return t(ea,X);else if(O(ea,T))return t(ea,X)}}else if(P&&/\{\s*\[native code\]\s*\}/.test(String(P))&&
G.classes.length&&!h){L=E(G,{el:1,classes:1,id:1});var S=G.classes.join(" ");H=function(T,X,ea){X=t(0,X);for(var $,aa=0,ha=T.getElementsByClassName(S);$=ha[aa++];)L($,T)&&ka($,ea)&&X.push($);return X}}else if(!R&&!G.loops)H=function(T,X,ea){X=t(0,X);for(var $=0,aa=T.getElementsByTagName(G.getTag());T=aa[$++];)ka(T,ea)&&X.push(T);return X};else{L=E(G,{el:1,tag:1,id:1});H=function(T,X,ea){X=t(0,X);for(var $,aa=0,ha=T.getElementsByTagName(G.getTag());$=ha[aa++];)L($,T)&&ka($,ea)&&X.push($);return X}}return V[G.query]=
H},Q=function(G,H){G=t(G);for(var K,L,R=H.length,P,S,T=0;T<R;T++){S=[];K=H[T];L=G.length-1;if(L>0){P={};S.nozip=true}L=Z(K);for(var X=0;K=G[X];X++)L(K,S,P);if(!S.length)break;G=S}return S},ga={},z={},B=function(G){var H=q(c(G));if(H.length==1){var K=Z(H[0]);return function(L){if(L=K(L,new f))L.nozip=true;return L}}return function(L){return Q(L,H)}},I=navigator.userAgent;I=a.isWebKit&&I.indexOf("WebKit/")>0&&parseFloat(I.split("WebKit/")[1])>528;var N=a.isIE?"commentStrip":"nozip",U=!!j().querySelectorAll&&
(!a.isSafari||a.isSafari>3.1||I),W=/n\+\d|([^ ])?([>~+])([^ =])?/g,Y=function(G,H,K,L){return K?(H?H+" ":"")+K+(L?" "+L:""):G},da=function(G,H){G=G.replace(W,Y);if(U){var K=z[G];if(K&&!H)return K}if(K=ga[G])return K;K=G.charAt(0);var L=-1==G.indexOf(" ");if(G.indexOf("#")>=0&&L)H=true;if(U&&!H&&">~+".indexOf(K)==-1&&(!a.isIE||G.indexOf(":")==-1)&&!(h&&G.indexOf(".")>=0)&&G.indexOf(":contains")==-1&&G.indexOf(":checked")==-1&&G.indexOf("|=")==-1){var R=">~+".indexOf(G.charAt(G.length-1))>=0?G+" *":
G;return z[G]=function(S){try{if(!(9==S.nodeType||L))throw"";var T=S.querySelectorAll(R);T[N]=true;return T}catch(X){return da(G,true)(S)}}}else{var P=G.split(/\s*,\s*/);return ga[G]=P.length<2?B(G):function(S){for(var T=0,X=[],ea;ea=P[T++];)X=X.concat(B(ea)(S));return X}}},fa=0,na=a.isIE?function(G){return l?G.getAttribute("_uid")||G.setAttribute("_uid",++fa)||fa:G.uniqueID}:function(G){return G._uid||(G._uid=++fa)},ka=function(G,H){if(!H)return 1;G=na(G);if(!H[G])return H[G]=1;return 0},ia="_zipIdx",
la=function(G){if(G&&G.nozip)return f._wrap?f._wrap(G):G;var H=new f;if(!G||!G.length)return H;G[0]&&H.push(G[0]);if(G.length<2)return H;fa++;if(a.isIE&&l){var K=fa+"";G[0].setAttribute(ia,K);for(var L=1,R;R=G[L];L++){G[L].getAttribute(ia)!=K&&H.push(R);R.setAttribute(ia,K)}}else if(a.isIE&&G.commentStrip)try{for(L=1;R=G[L];L++)r(R)&&H.push(R)}catch(P){}else{if(G[0])G[0][ia]=fa;for(L=1;R=G[L];L++){G[L][ia]!=fa&&H.push(R);R[ia]=fa}}return H};a.query=function(G,H){f=a._NodeListCtor;if(!G)return new f;
if(G.constructor==f)return G;if(typeof G!="string")return new f(G);if(typeof H=="string"){H=a.byId(H);if(!H)return new f}H=H||j();var K=H.ownerDocument||H.documentElement;l=H.contentType&&H.contentType=="application/xml"||a.isOpera&&(H.doctype||K.toString()=="[object XMLDocument]")||!!K&&(a.isIE?K.xml:H.xmlVersion||K.xmlVersion);if((G=da(G)(H))&&G.nozip&&!f._wrap)return G;return la(G)};a.query.pseudos=C;a._filterQueryResult=function(G,H,K){var L=new a._NodeListCtor,R=q(H);R=R.length==1&&!/[^\w#\.]/.test(H)?
E(R[0]):function(T){return dojo.query(H,K).indexOf(T)!=-1};for(var P=0,S;S=G[P];P++)R(S)&&L.push(S);return L}},d=function(){acme={trim:function(f){f=f.replace(/^\s+/,"");for(var j=f.length-1;j>=0;j--)if(/\S/.test(f.charAt(j))){f=f.substring(0,j+1);break}return f},forEach:function(f,j,h){if(f&&f.length)for(var i=0,l=f.length;i<l;++i)j.call(h||window,f[i],i,f)},byId:function(f,j){return typeof f=="string"?(j||document).getElementById(f):f},doc:document,NodeList:Array};var a=navigator,c=a.userAgent;
a=a.appVersion;var e=parseFloat(a);acme.isOpera=c.indexOf("Opera")>=0?e:undefined;acme.isKhtml=a.indexOf("Konqueror")>=0?e:undefined;acme.isWebKit=parseFloat(c.split("WebKit/")[1])||undefined;acme.isChrome=parseFloat(c.split("Chrome/")[1])||undefined;if((c=Math.max(a.indexOf("WebKit"),a.indexOf("Safari"),0))&&!acme.isChrome){acme.isSafari=parseFloat(a.split("Version/")[1]);if(!acme.isSafari||parseFloat(a.substr(c+7))<=419.3)acme.isSafari=2}if(document.all&&!acme.isOpera)acme.isIE=parseFloat(a.split("MSIE ")[1])||
undefined;Array._wrap=function(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){b(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");b(this.queryPortability||this.acme||dojo)}else b(this.queryPortability||this.acme||d())})();
define("dojo/_base/xhr",["dojo/lib/kernel","dojo/_base/Deferred","dojo/_base/json","dojo/_base/lang","dojo/_base/query"],function(b){(function(){function d(w,g,k){if(k!==null){var m=w[g];if(typeof m=="string")w[g]=[m,k];else if(a.isArray(m))m.push(k);else w[g]=k}}var a=b,c=a.config;b.fieldToObject=function(w){var g=null;if(w=a.byId(w)){var k=w.name,m=(w.type||"").toLowerCase();if(k&&m&&!w.disabled)if(m=="radio"||m=="checkbox"){if(w.checked)g=w.value}else if(w.multiple){g=[];a.query("option",w).forEach(function(n){n.selected&&
g.push(n.value)})}else g=w.value}return g};b.formToObject=function(w){var g={};a.forEach(b.byId(w).elements,function(k){var m=k.name,n=(k.type||"").toLowerCase();if(m&&n&&"file|submit|image|reset|button|".indexOf(n)==-1&&!k.disabled){d(g,m,a.fieldToObject(k));if(n=="image")g[m+".x"]=g[m+".y"]=g[m].x=g[m].y=0}});return g};b.objectToQuery=function(w){var g=encodeURIComponent,k=[],m={};for(var n in w){var p=w[n];if(p!=m[n]){var u=g(n)+"=";if(a.isArray(p))for(var v=0;v<p.length;v++)k.push(u+g(p[v]));
else k.push(u+g(p))}}return k.join("&")};b.formToQuery=function(w){return a.objectToQuery(a.formToObject(w))};b.formToJson=function(w,g){return a.toJson(a.formToObject(w),g)};b.queryToObject=function(w){var g={};w=w.split("&");var k=decodeURIComponent;a.forEach(w,function(m){if(m.length){var n=m.split("=");m=k(n.shift());n=k(n.join("="));if(typeof g[m]=="string")g[m]=[g[m]];if(a.isArray(g[m]))g[m].push(n);else g[m]=n}});return g};b._blockAsync=false;var e=a._contentHandlers=b.contentHandlers={text:function(w){return w.responseText},
json:function(w){return a.fromJson(w.responseText||null)},"json-comment-filtered":function(w){b.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.");w=w.responseText;var g=w.indexOf("/*"),k=w.lastIndexOf("*/");if(g==-1||k==-1)throw new Error("JSON was not comment filtered");
return a.fromJson(w.substring(g+2,k))},javascript:function(w){return a.eval(w.responseText)},xml:function(w){var g=w.responseXML;if(a.isIE&&(!g||!g.documentElement)){var k=function(m){return"MSXML"+m+".DOMDocument"};k=["Microsoft.XMLDOM",k(6),k(4),k(3),k(2)];a.some(k,function(m){try{var n=new ActiveXObject(m);n.async=false;n.loadXML(w.responseText);g=n}catch(p){return false}return true})}return g},"json-comment-optional":function(w){return w.responseText&&/^[^{\[]*\/\*/.test(w.responseText)?e["json-comment-filtered"](w):
e.json(w)}};b._ioSetArgs=function(w,g,k,m){var n={args:w,url:w.url},p=null;if(w.form){p=a.byId(w.form);var u=p.getAttributeNode("action");n.url=n.url||(u?u.value:null);p=a.formToObject(p)}u=[{}];p&&u.push(p);w.content&&u.push(w.content);w.preventCache&&u.push({"dojo.preventCache":(new Date).valueOf()});n.query=a.objectToQuery(a.mixin.apply(null,u));n.handleAs=w.handleAs||"text";var v=new a.Deferred(g);v.addCallbacks(k,function(E){return m(E,v)});var A=w.load;A&&a.isFunction(A)&&v.addCallback(function(E){return A.call(w,
E,n)});var C=w.error;C&&a.isFunction(C)&&v.addErrback(function(E){return C.call(w,E,n)});var D=w.handle;D&&a.isFunction(D)&&v.addBoth(function(E){return D.call(w,E,n)});if(c.ioPublish&&a.publish&&n.args.ioPublish!==false){v.addCallbacks(function(E){a.publish("/dojo/io/load",[v,E]);return E},function(E){a.publish("/dojo/io/error",[v,E]);return E});v.addBoth(function(E){a.publish("/dojo/io/done",[v,E]);return E})}v.ioArgs=n;return v};var f=function(w){w.canceled=true;var g=w.ioArgs.xhr,k=typeof g.abort;
if(k=="function"||k=="object"||k=="unknown")g.abort();w=w.ioArgs.error;if(!w){w=new Error("xhr cancelled");w.dojoType="cancel"}return w},j=function(w){w=e[w.ioArgs.handleAs](w.ioArgs.xhr);return w===undefined?null:w},h=function(w,g){g.ioArgs.args.failOk||console.error(w);return w},i=null,l=[],o=0,q=function(w){if(o<=0){o=0;if(c.ioPublish&&a.publish&&(!w||w&&w.ioArgs.args.ioPublish!==false))a.publish("/dojo/io/stop")}},x=function(){var w=(new Date).getTime();if(!a._blockAsync)for(var g=0,k;g<l.length&&
(k=l[g]);g++){var m=k.dfd,n=function(){if(!m||m.canceled||!k.validCheck(m)){l.splice(g--,1);o-=1}else if(k.ioCheck(m)){l.splice(g--,1);k.resHandle(m);o-=1}else if(m.startTime)if(m.startTime+(m.ioArgs.args.timeout||0)<w){l.splice(g--,1);var u=new Error("timeout exceeded");u.dojoType="timeout";m.errback(u);m.cancel();o-=1}};if(b.config.debugAtAllCosts)n.call(this);else try{n.call(this)}catch(p){m.errback(p)}}q(m);if(!l.length){clearInterval(i);i=null}};b._ioCancelAll=function(){try{a.forEach(l,function(g){try{g.dfd.cancel()}catch(k){}})}catch(w){}};
a.isIE&&a.addOnWindowUnload(a._ioCancelAll);a._ioNotifyStart=function(w){if(c.ioPublish&&a.publish&&w.ioArgs.args.ioPublish!==false){o||a.publish("/dojo/io/start");o+=1;a.publish("/dojo/io/send",[w])}};a._ioWatch=function(w,g,k,m){var n=w.ioArgs.args;if(n.timeout)w.startTime=(new Date).getTime();l.push({dfd:w,validCheck:g,ioCheck:k,resHandle:m});i||(i=setInterval(x,50));n.sync&&x()};var t="application/x-www-form-urlencoded",r=function(w){return w.ioArgs.xhr.readyState},s=function(w){return 4==w.ioArgs.xhr.readyState},
y=function(w){var g=w.ioArgs.xhr;if(a._isDocumentOk(g))w.callback(w);else{var k=new Error("Unable to load "+w.ioArgs.url+" status:"+g.status);k.status=g.status;k.responseText=g.responseText;w.errback(k)}};b._ioAddQueryToUrl=function(w){if(w.query.length){w.url+=(w.url.indexOf("?")==-1?"?":"&")+w.query;w.query=null}};b.xhr=function(w,g,k){var m=a._ioSetArgs(g,f,j,h),n=m.ioArgs,p=n.xhr=a._xhrObj(n.args);if(!p){m.cancel();return m}if("postData"in g)n.query=g.postData;else if("putData"in g)n.query=g.putData;
else if("rawBody"in g)n.query=g.rawBody;else if(arguments.length>2&&!k||"POST|PUT".indexOf(w.toUpperCase())==-1)a._ioAddQueryToUrl(n);p.open(w,n.url,g.sync!==true,g.user||undefined,g.password||undefined);if(g.headers)for(var u in g.headers)if(u.toLowerCase()==="content-type"&&!g.contentType)g.contentType=g.headers[u];else g.headers[u]&&p.setRequestHeader(u,g.headers[u]);p.setRequestHeader("Content-Type",g.contentType||t);if(!g.headers||!("X-Requested-With"in g.headers))p.setRequestHeader("X-Requested-With",
"XMLHttpRequest");a._ioNotifyStart(m);if(b.config.debugAtAllCosts)p.send(n.query);else try{p.send(n.query)}catch(v){n.error=v;m.cancel()}a._ioWatch(m,r,s,y);return m};b.xhrGet=function(w){return a.xhr("GET",w)};b.rawXhrPost=b.xhrPost=function(w){return a.xhr("POST",w,true)};b.rawXhrPut=b.xhrPut=function(w){return a.xhr("PUT",w,true)};b.xhrDelete=function(w){return a.xhr("DELETE",w)}})();return b.xhr});
define("dojo/_base/fx",["dojo/lib/kernel","dojo/_base/Color","dojo/_base/connect","dojo/_base/lang","dojo/_base/html"],function(b){(function(){var d=b._mixin;b._Line=function(h,i){this.start=h;this.end=i};b._Line.prototype.getValue=function(h){return(this.end-this.start)*h+this.start};b.Animation=function(h){d(this,h);if(b.isArray(this.curve))this.curve=new b._Line(this.curve[0],this.curve[1])};b._Animation=b.Animation;b.extend(b.Animation,{duration:350,repeat:0,rate:20,_percent:0,_startRepeatCount:0,
_getStep:function(){var h=this._percent,i=this.easing;return i?i(h):h},_fire:function(h,i){i=i||[];if(this[h])if(b.config.debugAtAllCosts)this[h].apply(this,i);else try{this[h].apply(this,i)}catch(l){console.error("exception in animation handler for:",h);console.error(l)}return this},play:function(h,i){var l=this;l._delayTimer&&l._clearTimer();if(i){l._stopTimer();l._active=l._paused=false;l._percent=0}else if(l._active&&!l._paused)return l;l._fire("beforeBegin",[l.node]);h=h||l.delay;var o=b.hitch(l,
"_play",i);if(h>0){l._delayTimer=setTimeout(o,h);return l}o();return l},_play:function(){var h=this;h._delayTimer&&h._clearTimer();h._startTime=(new Date).valueOf();if(h._paused)h._startTime-=h.duration*h._percent;h._active=true;h._paused=false;var i=h.curve.getValue(h._getStep());if(!h._percent){if(!h._startRepeatCount)h._startRepeatCount=h.repeat;h._fire("onBegin",[i])}h._fire("onPlay",[i]);h._cycle();return h},pause:function(){var h=this;h._delayTimer&&h._clearTimer();h._stopTimer();if(!h._active)return h;
h._paused=true;h._fire("onPause",[h.curve.getValue(h._getStep())]);return h},gotoPercent:function(h,i){var l=this;l._stopTimer();l._active=l._paused=true;l._percent=h;i&&l.play();return l},stop:function(h){var i=this;i._delayTimer&&i._clearTimer();if(!i._timer)return i;i._stopTimer();if(h)i._percent=1;i._fire("onStop",[i.curve.getValue(i._getStep())]);i._active=i._paused=false;return i},status:function(){if(this._active)return this._paused?"paused":"playing";return"stopped"},_cycle:function(){var h=
this;if(h._active){var i=((new Date).valueOf()-h._startTime)/h.duration;if(i>=1)i=1;h._percent=i;if(h.easing)i=h.easing(i);h._fire("onAnimate",[h.curve.getValue(i)]);if(h._percent<1)h._startTimer();else{h._active=false;if(h.repeat>0){h.repeat--;h.play(null,true)}else if(h.repeat==-1)h.play(null,true);else if(h._startRepeatCount){h.repeat=h._startRepeatCount;h._startRepeatCount=0}h._percent=0;h._fire("onEnd",[h.node]);!h.repeat&&h._stopTimer()}}return h},_clearTimer:function(){clearTimeout(this._delayTimer);
delete this._delayTimer}});var a=0,c=null,e={run:function(){}};b.extend(b.Animation,{_startTimer:function(){if(!this._timer){this._timer=b.connect(e,"run",this,"_cycle");a++}c||(c=setInterval(b.hitch(e,"run"),this.rate))},_stopTimer:function(){if(this._timer){b.disconnect(this._timer);this._timer=null;a--}if(a<=0){clearInterval(c);c=null;a=0}}});var f=b.isIE?function(h){var i=h.style;if(!i.width.length&&b.style(h,"width")=="auto")i.width="auto"}:function(){};b._fade=function(h){h.node=b.byId(h.node);
var i=d({properties:{}},h);h=i.properties.opacity={};h.start=!("start"in i)?function(){return+b.style(i.node,"opacity")||0}:i.start;h.end=i.end;h=b.animateProperty(i);b.connect(h,"beforeBegin",b.partial(f,i.node));return h};b.fadeIn=function(h){return b._fade(d({end:1},h))};b.fadeOut=function(h){return b._fade(d({end:0},h))};b._defaultEasing=function(h){return 0.5+Math.sin((h+1.5)*Math.PI)/2};var j=function(h){this._properties=h;for(var i in h){var l=h[i];if(l.start instanceof b.Color)l.tempColor=
new b.Color}};j.prototype.getValue=function(h){var i={};for(var l in this._properties){var o=this._properties[l],q=o.start;if(q instanceof b.Color)i[l]=b.blendColors(q,o.end,h,o.tempColor).toCss();else b.isArray(q)||(i[l]=(o.end-q)*h+q+(l!="opacity"?o.units||"px":0))}return i};b.animateProperty=function(h){var i=h.node=b.byId(h.node);if(!h.easing)h.easing=b._defaultEasing;h=new b.Animation(h);b.connect(h,"beforeBegin",h,function(){var l={};for(var o in this.properties){if(o=="width"||o=="height")this.node.display=
"block";var q=this.properties[o];if(b.isFunction(q))q=q(i);q=l[o]=d({},b.isObject(q)?q:{end:q});if(b.isFunction(q.start))q.start=q.start(i);if(b.isFunction(q.end))q.end=q.end(i);var x=o.toLowerCase().indexOf("color")>=0,t=function(r,s){var y={height:r.offsetHeight,width:r.offsetWidth}[s];if(y!==undefined)return y;y=b.style(r,s);return s=="opacity"?+y:x?y:parseFloat(y)};if("end"in q){if(!("start"in q))q.start=t(i,o)}else q.end=t(i,o);if(x){q.start=new b.Color(q.start);q.end=new b.Color(q.end)}else q.start=
o=="opacity"?+q.start:parseFloat(q.start)}this.curve=new j(l)});b.connect(h,"onAnimate",b.hitch(b,"style",h.node));return h};b.anim=function(h,i,l,o,q,x){return b.animateProperty({node:h,duration:l||b.Animation.prototype.duration,properties:i,easing:o,onEnd:q}).play(x||0)}})();return b.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(b){return b});
define("orion/serviceregistry",["dojo"],function(b){function d(j,h,i){this.serviceId=j;this.name=h;this.properties=i}function a(j,h,i){this.serviceId=j;this.serviceReference=h;this.internalRegistry=i}function c(j,h,i){this.serviceId=j;this.implementation=h;this.internalRegistry=i;var l;for(l in h)if(typeof h[l]==="function")this[l]=function(o){return function(){if(i.isRegistered(j)){var q=new b.Deferred;try{var x=h[o].apply(h,Array.prototype.slice.call(arguments));b.when(x,b.hitch(q,q.resolve),b.hitch(q,
q.reject))}catch(t){q.reject(t)}return q.promise}throw new Error("Service was unregistered");}}(l)}function e(){this._namedlisteners={}}function f(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new e;var j=this;this.internalRegistry={isRegistered:function(h){return j._entries[h]?true:false},unregisterService:function(h){var i=j._entries[h];if(i){for(var l=i.reference,o=j._namedReferences[l.getName()],q=0;q<o.length;q++)if(o[q]===l){if(o.length===1)delete j._namedReferences[l.getName()];
else o.splice(q,1);break}j._entries[h]=null;j._serviceEventTarget.dispatchEvent("serviceRemoved",l,i.service)}},dispatchEvent:function(h,i){var l=j._entries[h];l&&l.eventTarget.dispatchEvent.apply(l.eventTarget,[i].concat(Array.prototype.slice.call(arguments,2)))},addEventListener:function(h,i,l){(h=j._entries[h])&&h.eventTarget.addEventListener(i,l)},removeEventListener:function(h,i,l){(h=j._entries[h])&&h.eventTarget.removeEventListener(i,l)}}}d.prototype={getServiceId:function(){return this.serviceId},
getName:function(){return this.name},getPropertyNames:function(){var j=[],h;for(h in this.properties)this.properties.hasOwnProperty(h)&&j.push(h);return j},getProperty:function(j){return this.properties[j]}};d.prototype.constructor=d;a.prototype={unregister:function(){this.internalRegistry.unregisterService(this.serviceId)},dispatchEvent:function(j){this.internalRegistry.dispatchEvent.apply(this.internalRegistry,[this.serviceId,j].concat(Array.prototype.slice.call(arguments,1)))},getServiceReference:function(){return this.serviceReference}};
a.prototype.constructor=a;c.prototype={addEventListener:function(j,h){this.internalRegistry.addEventListener(this.serviceId,j,h)},removeEventListener:function(j,h){this.internalRegistry.removeEventListener(this.serviceId,j,h)}};c.prototype.constructor=c;e.prototype={dispatchEvent:function(j){var h=this._namedlisteners[j];if(h)for(var i=0;i<h.length;i++)try{var l=Array.prototype.slice.call(arguments,1);h[i].apply(null,l)}catch(o){console.log(o)}},addEventListener:function(j,h){this._namedlisteners[j]=
this._namedlisteners[j]||[];this._namedlisteners[j].push(h)},removeEventListener:function(j,h){var i=this._namedlisteners[j];if(i)for(var l=0;l<i.length;l++)if(i[l]===h){if(i.length===1)delete this._namedlisteners[j];else i.splice(l,1);break}}};e.prototype.constructor=e;f.prototype={getService:function(j,h){var i,l=new b.Deferred;if(typeof j==="string"){if(this._namedReferences[j])for(var o=0;o<this._namedReferences[j].length;o++)if(i=this._entries[this._namedReferences[j][o].getServiceId()].service)break}else i=
this._entries[j.getServiceId()].service;if(i)l.resolve(i);else if(h===0)l.reject(new Error("timeout: getService"));else{var q=this,x=function(t,r){if(j===t||j===t.getName()){l.resolve(r);q._serviceEventTarget.removeEventListener("serviceAdded",x)}};this._serviceEventTarget.addEventListener("serviceAdded",x)}return l.promise},getServiceReferences:function(j){if(j)return this._namedReferences[j]?this._namedReferences[j]:[];j=[];for(var h=0;h<this._entries.length;h++)this._entries[h]&&j.push(this._entries[h].reference);
return j},registerService:function(j,h,i){var l=this._entries.length;i=new d(l,j,i);h=new c(l,h,this.internalRegistry);this._namedReferences[j]=this._namedReferences[j]||[];this._namedReferences[j].push(i);this._entries.push({reference:i,service:h,eventTarget:new e});this._serviceEventTarget.dispatchEvent("serviceAdded",i,h);return new a(l,i,this.internalRegistry)},addEventListener:function(j,h){this._serviceEventTarget.addEventListener(j,h)},removeEventListener:function(j,h){this._serviceEventTarget.removeEventListener(j,
h)}};f.prototype.constructor=f;return{ServiceReference:d,ServiceRegistration:a,Service:c,EventTarget:e,ServiceRegistry:f}});define("dijit",["dojo"],function(b){return dijit=b._dijit||{}});
define("dojo/hash",["dojo"],function(b){(function(){function d(q,x){x=q.indexOf(x);return x>=0?q.substring(x+1):""}function a(){return d(location.href,"#")}function c(){b.publish("/dojo/hashchange",[a()])}function e(){if(a()!==h){h=a();c()}}function f(q){if(i)if(i.isTransitioning())setTimeout(b.hitch(null,f,q),o);else{var x=i.iframe.location.href,t=x.indexOf("?");i.iframe.location.replace(x.substring(0,t)+"?"+q)}else{location.replace("#"+q);!l&&e()}}function j(){function q(){h=a();r=g?h:d(k.href,
"?");s=false;y=null}var x=document.createElement("iframe"),t=b.config.dojoBlankHtmlUrl||b.moduleUrl("dojo","resources/blank.html");b.config.useXDomain&&!b.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");x.id="dojo-hash-iframe";x.src=t+"?"+a();x.style.display="none";document.body.appendChild(x);this.iframe=b.global["dojo-hash-iframe"];
var r,s,y,w,g,k=this.iframe.location;this.isTransitioning=function(){return s};this.pollLocation=function(){if(!g)try{var m=d(k.href,"?");if(document.title!=w)w=this.iframe.document.title=document.title}catch(n){g=true;console.error("dojo.hash: Error adding history entry. Server unreachable.")}var p=a();if(s&&h===p)if(g||m===y){q();c()}else{setTimeout(b.hitch(this,this.pollLocation),0);return}else if(!(h===p&&(g||r===m)))if(h!==p){h=p;s=true;y=p;x.src=t+"?"+y;g=false;setTimeout(b.hitch(this,this.pollLocation),
0);return}else if(!g){location.href="#"+k.search.substring(1);q();c()}setTimeout(b.hitch(this,this.pollLocation),o)};q();setTimeout(b.hitch(this,this.pollLocation),o)}b.hash=function(q,x){if(!arguments.length)return a();if(q.charAt(0)=="#")q=q.substring(1);if(x)f(q);else location.href="#"+q;return q};var h,i,l,o=b.config.hashPollFrequency||100;b.addOnLoad(function(){if("onhashchange"in b.global&&(!b.isIE||b.isIE>=8&&document.compatMode!="BackCompat"))l=b.connect(b.global,"onhashchange",c);else if(document.addEventListener){h=
a();setInterval(e,o)}else if(document.attachEvent)i=new j})})();return b.hash});
(function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],d=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,a=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,c=[];define("text",["require","exports","module"],function(){var e,f,j;if(typeof window!=="undefined"&&window.navigator&&window.document)f=function(h,i){var l=e.createXhr();l.open("GET",h,true);l.onreadystatechange=function(){l.readyState===4&&i(l.responseText)};l.send(null)};else if(typeof process!=="undefined"&&process.versions&&
process.versions.node){j=require.nodeRequire("fs");f=function(h,i){i(j.readFileSync(h,"utf8"))}}else if(typeof Packages!=="undefined")f=function(h,i){var l=new java.io.File(h);h=java.lang.System.getProperty("line.separator");l=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(l),"utf-8"));var o,q,x="";try{o=new java.lang.StringBuffer;if((q=l.readLine())&&q.length()&&q.charAt(0)===65279)q=q.substring(1);for(o.append(q);(q=l.readLine())!==null;){o.append(h);o.append(q)}x=
String(o.toString())}finally{l.close()}i(x)};return e={version:"0.24.0",strip:function(h){if(h){h=h.replace(d,"");var i=h.match(a);if(i)h=i[1]}else h="";return h},jsEscape:function(h){return h.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 h,i,l;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else for(i=0;i<3;i++){l=b[i];try{h=new ActiveXObject(l)}catch(o){}if(h){b=
[l];break}}if(!h)throw new Error("require.getXhr(): XMLHttpRequest not available");return h},get:f,load:function(h,i,l,o){var q=false,x=h.indexOf("."),t=h.substring(0,x),r=h.substring(x+1,h.length);x=r.indexOf("!");if(x!==-1){q=r.substring(x+1,r.length);q=q==="strip";r=r.substring(0,x)}i=i.nameToUrl(t,"."+r);e.get(i,function(s){s=q?e.strip(s):s;if(o.isBuild&&o.inlineText)c[h]=s;l(s)})},write:function(h,i,l){if(i in c){var o=e.jsEscape(c[i]);l("define('"+h+"!"+i+"', 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(b,d){d.getObject("i18n",true,d);d.i18n.getLocalization=d.i18n.getLocalization||function(a,c,e){e=d.i18n.normalizeLocale(e);var f=e.split("-"),j=[a,"nls",c].join(".");if(typeof d.global.require!=="undefined"){var h=b("i18n!"+[a.replace(/\./g,"/"),"nls",c].join("/"));(d._loadedModules[j]=d._loadedModules[j]||{})[f.join("_")]=h.root||h}if(j=d._loadedModules[j]){var i;for(h=f.length;h>0;h--){var l=f.slice(0,h).join("_");if(j[l]){i=j[l];break}}if(!i)i=j.ROOT;
if(i){a=function(){};a.prototype=i;return new a}}throw new Error("Bundle not found: "+c+" in "+a+" , locale="+e);};d.i18n.normalizeLocale=function(a){a=a?a.toLowerCase():d.locale;if(a=="root")a="ROOT";return a};d.i18n._requireLocalization=function(a,c,e,f){e=d.i18n.normalizeLocale(e);var j=[a,"nls",c].join("."),h="";if(f){for(var i=f.split(","),l=0;l<i.length;l++)if(e.indexOf(i[l])==0)if(i[l].length>h.length)h=i[l];h||(h="ROOT")}i=f?h:e;var o=d._loadedModules[j];l=null;if(o){if(d.config.localizationComplete&&
o._built)return;l=i.replace(/-/g,"_");l=d._loadedModules[j+"."+l]}if(!l){o=d.provide(j);var q=d._getModuleSymbols(a).concat("nls").join("/"),x;d.i18n._searchLocalePath(i,f,function(t){var r=t.replace(/-/g,"_"),s=j+"."+r,y=false;if(d._loadedModules[s])y=true;else{d.provide(s);s=[q];t!="ROOT"&&s.push(t);s.push(c);t=s.join("/")+".js";y=d._loadPath(t,null,function(w){w=w.root||w;var g=function(){};g.prototype=x;o[r]=new g;for(var k in w)o[r][k]=w[k]})}if(y&&o[r])x=o[r];else o[r]=x;if(f)return true})}if(f&&
e!=h)o[e.replace(/-/g,"_")]=o[h.replace(/-/g,"_")]};(function(){var a=d.config.extraLocale;if(a){if(!a instanceof Array)a=[a];var c=d.i18n._requireLocalization;d.i18n._requireLocalization=function(e,f,j,h){c(e,f,j,h);if(!j)for(j=0;j<a.length;j++)c(e,f,a[j],h)}}})();d.i18n._searchLocalePath=function(a,c,e){a=d.i18n.normalizeLocale(a);var f=a.split("-");a=[];for(var j=f.length;j>0;j--)a.push(f.slice(0,j).join("-"));a.push(false);c&&a.reverse();for(c=a.length-1;c>=0;c--)if(e(a[c]||"ROOT"))break};d.i18n._preloadLocalizations=
function(a,c){function e(h){h=d.i18n.normalizeLocale(h);d.i18n._searchLocalePath(h,true,function(i){for(var l=0;l<c.length;l++)if(c[l]==i){d.require(a+"_"+i);return true}return false})}e();for(var f=d.config.extraLocale||[],j=0;j<f.length;j++)e(f[j])};return d.i18n});define("text!dijit/form/templates/TextBox.html",function(){return'<div class="dijit dijitReset dijitInline dijitLeft" id="widget_${id}" role="presentation"\n\t><div class="dijitReset dijitInputField dijitInputContainer"\n\t\t><input class="dijitReset dijitInputInner" dojoAttachPoint=\'textbox,focusNode\' autocomplete="off"\n\t\t\t${!nameAttrSetting} type=\'${type}\'\n\t/></div\n></div>'});
define("dojo/window",["dojo"],function(b){b.getObject("window",true,b);b.window.getBox=function(){var d=b.doc.compatMode=="BackCompat"?b.body():b.doc.documentElement,a=b._docScroll();return{w:d.clientWidth,h:d.clientHeight,l:a.x,t:a.y}};b.window.get=function(d){if(b.isIE&&window!==document.parentWindow){d.parentWindow.execScript("document._parentWindow = window;","Javascript");var a=d._parentWindow;d._parentWindow=null;return a}return d.parentWindow||d.defaultView};b.window.scrollIntoView=function(d,
a){try{d=b.byId(d);var c=d.ownerDocument||b.doc,e=c.body||b.body(),f=c.documentElement||e.parentNode,j=b.isIE,h=b.isWebKit;if((!(b.isMoz||j||h||b.isOpera)||d==e||d==f)&&typeof d.scrollIntoView!="undefined")d.scrollIntoView(false);else{var i=c.compatMode=="BackCompat",l=j>=9&&d.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:i?e:f;c=h?e:l;var o=l.clientWidth,q=l.clientHeight,
x=!b._isBodyLtr(),t=a||b.position(d),r=d.parentNode;a=function(C){return j<=6||j&&i?false:b.style(C,"position").toLowerCase()=="fixed"};if(!a(d))for(;r;){if(r==e)r=c;var s=b.position(r),y=a(r);if(r==c){s.w=o;s.h=q;if(c==f&&j&&x)s.x+=c.offsetWidth-s.w;if(s.x<0||!j)s.x=0;if(s.y<0||!j)s.y=0}else{var w=b._getPadBorderExtents(r);s.w-=w.w;s.h-=w.h;s.x+=w.l;s.y+=w.t;var g=r.clientWidth,k=s.w-g;if(g>0&&k>0){s.w=g;s.x+=x&&(j||r.clientLeft>w.l)?k:0}g=r.clientHeight;k=s.h-g;if(g>0&&k>0)s.h=g}if(y){if(s.y<0){s.h+=
s.y;s.y=0}if(s.x<0){s.w+=s.x;s.x=0}if(s.y+s.h>q)s.h=q-s.y;if(s.x+s.w>o)s.w=o-s.x}var m=t.x-s.x,n=t.y-Math.max(s.y,0),p=m+t.w-s.w,u=n+t.h-s.h;if(p*m>0){var v=Math[m<0?"max":"min"](m,p);if(x&&(j==8&&!i||j>=9))v=-v;t.x+=r.scrollLeft;r.scrollLeft+=v;t.x-=r.scrollLeft}if(u*n>0){t.y+=r.scrollTop;r.scrollTop+=Math[n<0?"max":"min"](n,u);t.y-=r.scrollTop}r=r!=c&&!y&&r.parentNode}}}catch(A){console.error("scrollIntoView: "+A);d.scrollIntoView(false)}};return b.window});
define("dijit/_base/manager",["dojo","dijit"],function(b,d){b.declare("dijit.WidgetSet",null,{constructor:function(){this._hash={};this.length=0},add:function(a){if(this._hash[a.id])throw new Error("Tried to register widget with id=="+a.id+" but that id is already registered");this._hash[a.id]=a;this.length++},remove:function(a){if(this._hash[a]){delete this._hash[a];this.length--}},forEach:function(a,c){c=c||b.global;var e=0,f;for(f in this._hash)a.call(c,this._hash[f],e++,this._hash);return this},
filter:function(a,c){c=c||b.global;var e=new d.WidgetSet,f=0,j;for(j in this._hash){var h=this._hash[j];a.call(c,h,f++,this._hash)&&e.add(h)}return e},byId:function(a){return this._hash[a]},byClass:function(a){var c=new d.WidgetSet,e,f;for(e in this._hash){f=this._hash[e];f.declaredClass==a&&c.add(f)}return c},toArray:function(){var a=[];for(var c in this._hash)a.push(this._hash[c]);return a},map:function(a,c){return b.map(this.toArray(),a,c)},every:function(a,c){c=c||b.global;var e=0,f;for(f in this._hash)if(!a.call(c,
this._hash[f],e++,this._hash))return false;return true},some:function(a,c){c=c||b.global;var e=0,f;for(f in this._hash)if(a.call(c,this._hash[f],e++,this._hash))return true;return false}});(function(){d.registry=new d.WidgetSet;var a=d.registry._hash,c=b.attr,e=b.hasAttr,f=b.style;d.byId=function(l){return typeof l=="string"?a[l]:l};var j={};d.getUniqueId=function(l){var o;do o=l+"_"+(l in j?++j[l]:(j[l]=0));while(a[o]);return d._scopeName=="dijit"?o:d._scopeName+"_"+o};d.findWidgets=function(l){function o(x){for(x=
x.firstChild;x;x=x.nextSibling)if(x.nodeType==1){var t=x.getAttribute("widgetId");if(t)(t=a[t])&&q.push(t);else o(x)}}var q=[];o(l);return q};d._destroyAll=function(){d._curFocus=null;d._prevFocus=null;d._activeStack=[];b.forEach(d.findWidgets(b.body()),function(l){if(!l._destroyed)if(l.destroyRecursive)l.destroyRecursive();else l.destroy&&l.destroy()})};b.isIE&&b.addOnWindowUnload(function(){d._destroyAll()});d.byNode=function(l){return a[l.getAttribute("widgetId")]};d.getEnclosingWidget=function(l){for(;l;){var o=
l.getAttribute&&l.getAttribute("widgetId");if(o)return a[o];l=l.parentNode}return null};var h=d._isElementShown=function(l){var o=f(l);return o.visibility!="hidden"&&o.visibility!="collapsed"&&o.display!="none"&&c(l,"type")!="hidden"};d.hasDefaultTabStop=function(l){switch(l.nodeName.toLowerCase()){case "a":return e(l,"href");case "area":case "button":case "input":case "object":case "select":case "textarea":return true;case "iframe":var o;try{var q=l.contentDocument;if("designMode"in q&&q.designMode==
"on")return true;o=q.body}catch(x){try{o=l.contentWindow.document.body}catch(t){return false}}return o.contentEditable=="true"||o.firstChild&&o.firstChild.contentEditable=="true";default:return l.contentEditable=="true"}};var i=d.isTabNavigable=function(l){return c(l,"disabled")?false:e(l,"tabIndex")?c(l,"tabIndex")>=0:d.hasDefaultTabStop(l)};d._getTabNavigable=function(l){function o(m){return m&&m.tagName.toLowerCase()=="input"&&m.type&&m.type.toLowerCase()=="radio"&&m.name&&m.name.toLowerCase()}
function q(m){return g[o(m)]||m}var x,t,r,s,y,w,g={},k=function(m){b.query("> *",m).forEach(function(n){if(!(b.isIE&&n.scopeName!=="HTML"||!h(n))){if(i(n)){var p=c(n,"tabIndex");if(!e(n,"tabIndex")||p==0){x||(x=n);t=n}else if(p>0){if(!r||p<s){s=p;r=n}if(!y||p>=w){w=p;y=n}}p=o(n);if(b.attr(n,"checked")&&p)g[p]=n}n.nodeName.toUpperCase()!="SELECT"&&k(n)}})};h(l)&&k(l);return{first:q(x),last:q(t),lowest:q(r),highest:q(y)}};d.getFirstInTabbingOrder=function(l){l=d._getTabNavigable(b.byId(l));return l.lowest?
l.lowest:l.first};d.getLastInTabbingOrder=function(l){l=d._getTabNavigable(b.byId(l));return l.last?l.last:l.highest};d.defaultDuration=b.config.defaultDuration||200})();return d});
define("dojo/Stateful",["dojo"],function(b){b.declare("dojo.Stateful",null,{postscript:function(d){d&&b.mixin(this,d)},get:function(d){return this[d]},set:function(d,a){if(typeof d==="object"){for(var c in d)this.set(c,d[c]);return this}c=this[d];this[d]=a;this._watchCallbacks&&this._watchCallbacks(d,c,a);return this},watch:function(d,a){var c=this._watchCallbacks;if(!c){var e=this;c=this._watchCallbacks=function(j,h,i,l){var o=function(q){if(q){q=q.slice();for(var x=0,t=q.length;x<t;x++)try{q[x].call(e,
j,h,i)}catch(r){console.error(r)}}};o(c["_"+j]);l||o(c["*"])}}if(!a&&typeof d==="function"){a=d;d="*"}else d="_"+d;var f=c[d];if(typeof f!=="object")f=c[d]=[];f.push(a);return{unwatch:function(){f.splice(b.indexOf(f,a),1)}}}});return b.Stateful});
define("dijit/_WidgetBase",["dojo","dijit","dijit/_base/manager","dojo/Stateful"],function(b,d){(function(){b.declare("dijit._WidgetBase",b.Stateful,{id:"",lang:"",dir:"","class":"",style:"",title:"",tooltip:"",baseClass:"",srcNodeRef:null,domNode:null,containerNode:null,attributeMap:{id:"",dir:"",lang:"","class":"",style:"",title:""},_blankGif:(b.config.blankGif||b.moduleUrl("dojo","resources/blank.gif")).toString(),postscript:function(a,c){this.create(a,c)},create:function(a,c){this.srcNodeRef=
b.byId(c);this._connects=[];this._subscribes=[];if(this.srcNodeRef&&typeof this.srcNodeRef.id=="string")this.id=this.srcNodeRef.id;if(a){this.params=a;b._mixin(this,a)}this.postMixInProperties();if(!this.id)this.id=d.getUniqueId(this.declaredClass.replace(/\./g,"_"));d.registry.add(this);this.buildRendering();if(this.domNode){this._applyAttributes();(a=this.srcNodeRef)&&a.parentNode&&this.domNode!==a&&a.parentNode.replaceChild(this.domNode,a)}this.domNode&&this.domNode.setAttribute("widgetId",this.id);
this.postCreate();this.srcNodeRef&&!this.srcNodeRef.parentNode&&delete this.srcNodeRef;this._created=true},_applyAttributes:function(){var a=function(e,f){if(f.params&&e in f.params||f[e])f.set(e,f[e])};for(var c in this.attributeMap)a(c,this);b.forEach(this._getSetterAttributes(),function(e){e in this.attributeMap||a(e,this)},this)},_getSetterAttributes:function(){var a=this.constructor;if(!a._setterAttrs){var c=a._setterAttrs=[],e,f=a.prototype;for(var j in f)if(b.isFunction(f[j])&&(e=j.match(/^_set([a-zA-Z]*)Attr$/))&&
e[1])c.push(e[1].charAt(0).toLowerCase()+e[1].substr(1))}return a._setterAttrs},postMixInProperties:function(){},buildRendering:function(){if(!this.domNode)this.domNode=this.srcNodeRef||b.create("div");if(this.baseClass){var a=this.baseClass.split(" ");this.isLeftToRight()||(a=a.concat(b.map(a,function(c){return c+"Rtl"})));b.addClass(this.domNode,a)}},postCreate:function(){},startup:function(){this._started=true},destroyRecursive:function(a){this._beingDestroyed=true;this.destroyDescendants(a);this.destroy(a)},
destroy:function(a){this._beingDestroyed=true;this.uninitialize();var c=b.forEach,e=b.unsubscribe;c(this._connects,function(f){c(f,b.disconnect)});c(this._subscribes,function(f){e(f)});c(this._supportingWidgets||[],function(f){if(f.destroyRecursive)f.destroyRecursive();else f.destroy&&f.destroy()});this.destroyRendering(a);d.registry.remove(this.id);this._destroyed=true},destroyRendering:function(a){if(this.bgIframe){this.bgIframe.destroy(a);delete this.bgIframe}if(this.domNode){a?b.removeAttr(this.domNode,
"widgetId"):b.destroy(this.domNode);delete this.domNode}if(this.srcNodeRef){a||b.destroy(this.srcNodeRef);delete this.srcNodeRef}},destroyDescendants:function(a){b.forEach(this.getChildren(),function(c){c.destroyRecursive&&c.destroyRecursive(a)})},uninitialize:function(){return false},_setClassAttr:function(a){b.replaceClass(this[this.attributeMap["class"]||"domNode"],a,this["class"]);this._set("class",a)},_setStyleAttr:function(a){var c=this[this.attributeMap.style||"domNode"];if(b.isObject(a))b.style(c,
a);else if(c.style.cssText)c.style.cssText+="; "+a;else c.style.cssText=a;this._set("style",a)},_attrToDom:function(a,c){var e=this.attributeMap[a];b.forEach(b.isArray(e)?e:[e],function(f){var j=this[f.node||f||"domNode"];switch(f.type||"attribute"){case "attribute":if(b.isFunction(c))c=b.hitch(this,c);f=f.attribute?f.attribute:/^on[A-Z][a-zA-Z]*$/.test(a)?a.toLowerCase():a;b.attr(j,f,c);break;case "innerText":j.innerHTML="";j.appendChild(b.doc.createTextNode(c));break;case "innerHTML":j.innerHTML=
c;break;case "class":b.replaceClass(j,c,this[a]);break}},this)},get:function(a){var c=this._getAttrNames(a);return this[c.g]?this[c.g]():this[a]},set:function(a,c){if(typeof a==="object"){for(var 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,c);this._set(a,c)}return f||this},_attrPairNames:{},_getAttrNames:function(a){var c=this._attrPairNames;if(c[a])return c[a];
var e=a.charAt(0).toUpperCase()+a.substr(1);return c[a]={n:a+"Node",s:"_set"+e+"Attr",g:"_get"+e+"Attr"}},_set:function(a,c){var e=this[a];this[a]=c;this._watchCallbacks&&this._created&&c!==e&&this._watchCallbacks(a,e,c)},toString:function(){return"[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]"},getDescendants:function(){return this.containerNode?b.query("[widgetId]",this.containerNode).map(d.byNode):[]},getChildren:function(){return this.containerNode?d.findWidgets(this.containerNode):
[]},connect:function(a,c,e){a=[b._connect(a,c,this,e)];this._connects.push(a);return a},disconnect:function(a){for(var c=0;c<this._connects.length;c++)if(this._connects[c]==a){b.forEach(a,b.disconnect);this._connects.splice(c,1);return}},subscribe:function(a,c){a=b.subscribe(a,this,c);this._subscribes.push(a);return a},unsubscribe:function(a){for(var c=0;c<this._subscribes.length;c++)if(this._subscribes[c]==a){b.unsubscribe(a);this._subscribes.splice(c,1);return}},isLeftToRight:function(){return this.dir?
this.dir=="ltr":b._isBodyLtr()},placeAt:function(a,c){a.declaredClass&&a.addChild?a.addChild(this,c):b.place(this.domNode,a,c);return this}})})();return d._WidgetBase});
define("dijit/_base/focus",["dojo","dijit","dojo/window","dijit/_base/manager"],function(b,d){b.mixin(d,{_curFocus:null,_prevFocus:null,isCollapsed:function(){return d.getBookmark().isCollapsed},getBookmark:function(){var a,c,e=b.doc.selection,f=d._curFocus;if(b.global.getSelection){if(e=b.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{c=e.getRangeAt(0);a={isCollapsed:false,mark:c.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{c=e.createRange();return{isCollapsed:c.text&&c.text.length?false:true,mark:{range:c,pRange:true}}}a={};try{c=e.createRange();a.isCollapsed=!(e.type==
"Text"?c.htmlText.length:c.length)}catch(j){a.isCollapsed=true;return a}if(e.type.toUpperCase()=="CONTROL")if(c.length){a.mark=[];e=0;for(f=c.length;e<f;)a.mark.push(c.item(e++))}else{a.isCollapsed=true;a.mark=null}else a.mark=c.getBookmark()}else console.warn("No idea how to store the current selection for this browser!");return a},moveToBookmark:function(a){var c=b.doc;if(a=a.mark)if(b.global.getSelection){var e=b.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(c.selection&&a){var f;if(a.pRange)f=a.range;else if(b.isArray(a)){f=c.body.createControlRange();b.forEach(a,function(j){f.addElement(j)})}else{f=c.body.createTextRange();f.moveToBookmark(a)}f.select()}},getFocus:function(a,c){a=!d._curFocus||a&&b.isDescendant(d._curFocus,a.domNode)?d._prevFocus:d._curFocus;return{node:a,bookmark:a==d._curFocus&&b.withGlobal(c||
b.global,d.getBookmark),openedForWindow:c}},focus:function(a){if(a){var c="node"in a?a.node:a,e=a.bookmark;a=a.openedForWindow;var f=e?e.isCollapsed:false;if(c){var j=c.tagName.toLowerCase()=="iframe"?c.contentWindow:c;if(j&&j.focus)try{j.focus()}catch(h){}d._onFocusNode(c)}if(e&&b.withGlobal(a||b.global,d.isCollapsed)&&!f){a&&a.focus();try{b.withGlobal(a||b.global,d.moveToBookmark,null,[e])}catch(i){}}}},_activeStack:[],registerIframe:function(a){return d.registerWin(a.contentWindow,a)},unregisterIframe:function(a){d.unregisterWin(a)},
registerWin:function(a,c){var e=function(o){d._justMouseDowned=true;setTimeout(function(){d._justMouseDowned=false},0);b.isIE&&o&&o.srcElement&&o.srcElement.parentNode==null||d._onTouchNode(c||o.target||o.srcElement,"mouse")},f=b.isIE?a.document.documentElement:a.document;if(f)if(b.isIE){a.document.body.attachEvent("onmousedown",e);var j=function(o){o.srcElement.tagName.toLowerCase()!="#document"&&d.isTabNavigable(o.srcElement)?d._onFocusNode(c||o.srcElement):d._onTouchNode(c||o.srcElement)};f.attachEvent("onactivate",
j);var h=function(o){d._onBlurNode(c||o.srcElement)};f.attachEvent("ondeactivate",h);return function(){a.document.detachEvent("onmousedown",e);f.detachEvent("onactivate",j);f.detachEvent("ondeactivate",h);f=null}}else{f.body.addEventListener("mousedown",e,true);var i=function(o){d._onFocusNode(c||o.target)};f.addEventListener("focus",i,true);var l=function(o){d._onBlurNode(c||o.target)};f.addEventListener("blur",l,true);return function(){f.body.removeEventListener("mousedown",e,true);f.removeEventListener("focus",
i,true);f.removeEventListener("blur",l,true);f=null}}},unregisterWin:function(a){a&&a()},_onBlurNode:function(){d._prevFocus=d._curFocus;d._curFocus=null;if(!d._justMouseDowned){d._clearActiveWidgetsTimer&&clearTimeout(d._clearActiveWidgetsTimer);d._clearActiveWidgetsTimer=setTimeout(function(){delete d._clearActiveWidgetsTimer;d._setStack([]);d._prevFocus=null},100)}},_onTouchNode:function(a,c){if(d._clearActiveWidgetsTimer){clearTimeout(d._clearActiveWidgetsTimer);delete d._clearActiveWidgetsTimer}var e=
[];try{for(;a;){var f=b.attr(a,"dijitPopupParent");if(f)a=d.byId(f).domNode;else if(a.tagName&&a.tagName.toLowerCase()=="body"){if(a===b.body())break;a=b.window.get(a.ownerDocument).frameElement}else{var j=a.getAttribute&&a.getAttribute("widgetId"),h=j&&d.byId(j);h&&!(c=="mouse"&&h.get("disabled"))&&e.unshift(j);a=a.parentNode}}}catch(i){}d._setStack(e,c)},_onFocusNode:function(a){if(a)if(a.nodeType!=9){d._onTouchNode(a);if(a!=d._curFocus){if(d._curFocus)d._prevFocus=d._curFocus;d._curFocus=a;b.publish("focusNode",
[a])}}},_setStack:function(a,c){var e=d._activeStack;d._activeStack=a;for(var f=0;f<Math.min(e.length,a.length);f++)if(e[f]!=a[f])break;for(var j,h=e.length-1;h>=f;h--)if(j=d.byId(e[h])){j._focused=false;j.set("focused",false);j._hasBeenBlurred=true;j._onBlur&&j._onBlur(c);b.publish("widgetBlur",[j,c])}for(h=f;h<a.length;h++)if(j=d.byId(a[h])){j._focused=true;j.set("focused",true);j._onFocus&&j._onFocus(c);b.publish("widgetFocus",[j,c])}}});b.addOnLoad(function(){var a=d.registerWin(window);b.isIE&&
b.addOnWindowUnload(function(){d.unregisterWin(a);a=null})});return d});
define("dojo/AdapterRegistry",["dojo"],function(b){b.AdapterRegistry=function(d){this.pairs=[];this.returnWrappers=d||false};b.extend(b.AdapterRegistry,{register:function(d,a,c,e,f){this.pairs[f?"unshift":"push"]([d,a,c,e])},match:function(){for(var d=0;d<this.pairs.length;d++){var a=this.pairs[d];if(a[1].apply(this,arguments))return a[3]||this.returnWrappers?a[2]:a[2].apply(this,arguments)}throw new Error("No match found");},unregister:function(d){for(var a=0;a<this.pairs.length;a++)if(this.pairs[a][0]==
d){this.pairs.splice(a,1);return true}return false}});return b.AdapterRegistry});
define("dijit/_base/place",["dojo","dijit","dojo/window","dojo/AdapterRegistry"],function(b,d){d.getViewport=function(){return b.window.getBox()};d.placeOnScreen=function(a,c,e,f){e=b.map(e,function(j){var h={corner:j,pos:{x:c.x,y:c.y}};if(f){h.pos.x+=j.charAt(1)=="L"?f.x:-f.x;h.pos.y+=j.charAt(0)=="T"?f.y:-f.y}return h});return d._place(a,e)};d._place=function(a,c,e,f){var j=b.window.getBox();if(!a.parentNode||String(a.parentNode.tagName).toLowerCase()!="body")b.body().appendChild(a);var h=null;
b.some(c,function(l){var o=l.corner,q=l.pos,x=0,t={w:o.charAt(1)=="L"?j.l+j.w-q.x:q.x-j.l,h:o.charAt(1)=="T"?j.t+j.h-q.y:q.y-j.t};if(e){x=e(a,l.aroundCorner,o,t,f);x=typeof x=="undefined"?0:x}var r=a.style,s=r.display,y=r.visibility;r.visibility="hidden";r.display="";var w=b.marginBox(a);r.display=s;r.visibility=y;r=Math.max(j.l,o.charAt(1)=="L"?q.x:q.x-w.w);s=Math.max(j.t,o.charAt(0)=="T"?q.y:q.y-w.h);y=Math.min(j.l+j.w,o.charAt(1)=="L"?r+w.w:q.x);q=Math.min(j.t+j.h,o.charAt(0)=="T"?s+w.h:q.y);y=
y-r;q=q-s;x+=w.w-y+(w.h-q);if(h==null||x<h.overflow)h={corner:o,aroundCorner:l.aroundCorner,x:r,y:s,w:y,h:q,overflow:x,spaceAvailable:t};return!x});h.overflow&&e&&e(a,h.aroundCorner,h.corner,h.spaceAvailable,f);c=b._isBodyLtr();var i=a.style;i.top=h.y+"px";i[c?"left":"right"]=(c?h.x:j.w-h.x-h.w)+"px";return h};d.placeOnScreenAroundNode=function(a,c,e,f){c=b.byId(c);c=b.position(c,true);return d._placeOnScreenAroundRect(a,c.x,c.y,c.w,c.h,e,f)};d.placeOnScreenAroundRectangle=function(a,c,e,f){return d._placeOnScreenAroundRect(a,
c.x,c.y,c.width,c.height,e,f)};d._placeOnScreenAroundRect=function(a,c,e,f,j,h,i){var l=[];for(var o in h)l.push({aroundCorner:o,corner:h[o],pos:{x:c+(o.charAt(1)=="L"?0:f),y:e+(o.charAt(0)=="T"?0:j)}});return d._place(a,l,i,{w:f,h:j})};d.placementRegistry=new b.AdapterRegistry;d.placementRegistry.register("node",function(a,c){return typeof c=="object"&&typeof c.offsetWidth!="undefined"&&typeof c.offsetHeight!="undefined"},d.placeOnScreenAroundNode);d.placementRegistry.register("rect",function(a,
c){return typeof c=="object"&&"x"in c&&"y"in c&&"width"in c&&"height"in c},d.placeOnScreenAroundRectangle);d.placeOnScreenAroundElement=function(){return d.placementRegistry.match.apply(d.placementRegistry,arguments)};d.getPopupAroundAlignment=function(a,c){var e={};b.forEach(a,function(f){switch(f){case "after":e[c?"BR":"BL"]=c?"BL":"BR";break;case "before":e[c?"BL":"BR"]=c?"BR":"BL";break;case "below-alt":c=!c;case "below":e[c?"BL":"BR"]=c?"TL":"TR";e[c?"BR":"BL"]=c?"TR":"TL";break;case "above-alt":c=
!c;case "above":default:e[c?"TL":"TR"]=c?"BL":"BR";e[c?"TR":"TL"]=c?"BR":"BL";break}});return e};return d});define("dijit/_base/window",["dojo","dijit","dojo/window"],function(b,d){d.getDocumentWindow=function(a){return b.window.get(a)};return d});
define("dijit/_base/popup",["dojo","dijit","dijit/_base/focus","dijit/_base/place","dijit/_base/window"],function(b,d){d.popup={_stack:[],_beginZIndex:1E3,_idGen:1,_createWrapper:function(a){var c=a.declaredClass?a._popupWrapper:a.parentNode&&b.hasClass(a.parentNode,"dijitPopup"),e=a.domNode||a;if(!c){c=b.create("div",{"class":"dijitPopup",style:{display:"none"},role:"presentation"},b.body());c.appendChild(e);e=e.style;e.display="";e.visibility="";e.position="";e.top="0px";if(a.declaredClass){a._popupWrapper=
c;b.connect(a,"destroy",function(){b.destroy(c);delete a._popupWrapper})}}return c},moveOffScreen:function(a){a=this._createWrapper(a);b.style(a,{visibility:"hidden",top:"-9999px",display:""})},hide:function(a){a=this._createWrapper(a);b.style(a,"display","none")},getTopPopup:function(){for(var a=this._stack,c=a.length-1;c>0&&a[c].parent===a[c-1].widget;c--);return a[c]},open:function(a){for(var c=this._stack,e=a.popup,f=a.orient||((a.parent?a.parent.isLeftToRight():b._isBodyLtr())?{BL:"TL",BR:"TR",
TL:"BL",TR:"BR"}:{BR:"TR",BL:"TL",TR:"BR",TL:"BL"}),j=a.around,h=a.around&&a.around.id?a.around.id+"_dropdown":"popup_"+this._idGen++;c.length&&(!a.parent||!b.isDescendant(a.parent.domNode,c[c.length-1].widget.domNode));)d.popup.close(c[c.length-1].widget);var i=this._createWrapper(e);b.attr(i,{id:h,style:{zIndex:this._beginZIndex+c.length},"class":"dijitPopup "+(e.baseClass||e["class"]||"").split(" ")[0]+"Popup",dijitPopupParent:a.parent?a.parent.id:""});if(b.isIE||b.isMoz)if(!e.bgIframe)e.bgIframe=
new d.BackgroundIframe(i);f=j?d.placeOnScreenAroundElement(i,j,f,e.orient?b.hitch(e,"orient"):null):d.placeOnScreen(i,a,f=="R"?["TR","BR","TL","BL"]:["TL","BL","TR","BR"],a.padding);i.style.display="";i.style.visibility="visible";e.domNode.style.visibility="visible";j=[];j.push(b.connect(i,"onkeypress",this,function(l){if(l.charOrCode==b.keys.ESCAPE&&a.onCancel){b.stopEvent(l);a.onCancel()}else if(l.charOrCode===b.keys.TAB){b.stopEvent(l);(l=this.getTopPopup())&&l.onCancel&&l.onCancel()}}));e.onCancel&&
j.push(b.connect(e,"onCancel",a.onCancel));j.push(b.connect(e,e.onExecute?"onExecute":"onChange",this,function(){var l=this.getTopPopup();l&&l.onExecute&&l.onExecute()}));c.push({widget:e,parent:a.parent,onExecute:a.onExecute,onCancel:a.onCancel,onClose:a.onClose,handlers:j});e.onOpen&&e.onOpen(f);return f},close:function(a){for(var c=this._stack;a&&b.some(c,function(h){return h.widget==a})||!a&&c.length;){var e=c.pop(),f=e.widget,j=e.onClose;f.onClose&&f.onClose();b.forEach(e.handlers,b.disconnect);
f&&f.domNode&&this.hide(f);j&&j()}}};d._frames=new (function(){var a=[];this.pop=function(){var c;if(a.length){c=a.pop();c.style.display=""}else{if(b.isIE<9){c="<iframe src='"+(b.config.dojoBlankHtmlUrl||b.moduleUrl("dojo","resources/blank.html")+""||'javascript:""')+"' style='position: absolute; left: 0px; top: 0px;z-index: -1; filter:Alpha(Opacity=\"0\");'>";c=b.doc.createElement(c)}else{c=b.create("iframe");c.src='javascript:""';c.className="dijitBackgroundIframe";b.style(c,"opacity",0.1)}c.tabIndex=
-1;d.setWaiRole(c,"presentation")}return c};this.push=function(c){c.style.display="none";a.push(c)}});d.BackgroundIframe=function(a){if(!a.id)throw new Error("no id");if(b.isIE||b.isMoz){var c=this.iframe=d._frames.pop();a.appendChild(c);if(b.isIE<7||b.isQuirks){this.resize(a);this._conn=b.connect(a,"onresize",this,function(){this.resize(a)})}else b.style(c,{width:"100%",height:"100%"})}};b.extend(d.BackgroundIframe,{resize:function(a){this.iframe&&b.style(this.iframe,{width:a.offsetWidth+"px",height:a.offsetHeight+
"px"})},destroy:function(){if(this._conn){b.disconnect(this._conn);this._conn=null}if(this.iframe){d._frames.push(this.iframe);delete this.iframe}}});return d.popup});define("dijit/_base/scroll",["dojo","dijit","dojo/window"],function(b,d){d.scrollIntoView=function(a,c){b.window.scrollIntoView(a,c)};return d.scrollIntoView});
define("dojo/uacss",["dojo"],function(b){(function(){var d=b.doc.documentElement,a=b.isIE,c=b.isOpera,e=Math.floor,f=b.isFF,j=b.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:b.isQuirks,dj_iequirks:a&&b.isQuirks,dj_opera:c,dj_khtml:b.isKhtml,dj_webkit:b.isWebKit,dj_safari:b.isSafari,dj_chrome:b.isChrome,dj_gecko:b.isMozilla,dj_ff3:e(f)==3};a["dj_"+j]=true;var h="";for(var i in a)if(a[i])h+=i+" ";d.className=b.trim(d.className+" "+h);b._loaders.unshift(function(){if(!b._isBodyLtr()){var l=
"dj_rtl dijitRtl "+h.replace(/ /g,"-rtl ");d.className=b.trim(d.className+" "+l)}})})();return b});define("dijit/_base/sniff",["dojo","dijit","dojo/uacss"],function(b,d){return d});
define("dijit/_base/typematic",["dojo","dijit"],function(b,d){d.typematic={_fireEventAndReload:function(){this._timer=null;this._callback(++this._count,this._node,this._evt);this._currentTimeout=Math.max(this._currentTimeout<0?this._initialDelay:this._subsequentDelay>1?this._subsequentDelay:Math.round(this._currentTimeout*this._subsequentDelay),this._minDelay);this._timer=setTimeout(b.hitch(this,"_fireEventAndReload"),this._currentTimeout)},trigger:function(a,c,e,f,j,h,i,l){if(j!=this._obj){this.stop();
this._initialDelay=i||500;this._subsequentDelay=h||0.9;this._minDelay=l||10;this._obj=j;this._evt=a;this._node=e;this._count=this._currentTimeout=-1;this._callback=b.hitch(c,f);this._fireEventAndReload();this._evt=b.mixin({faux:true},a)}},stop:function(){if(this._timer){clearTimeout(this._timer);this._timer=null}if(this._obj){this._callback(-1,this._node,this._evt);this._obj=null}},addKeyListener:function(a,c,e,f,j,h,i){if(c.keyCode){c.charOrCode=c.keyCode;b.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.",
"","2.0")}else if(c.charCode){c.charOrCode=String.fromCharCode(c.charCode);b.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0")}return[b.connect(a,"onkeypress",this,function(l){if(l.charOrCode==c.charOrCode&&(c.ctrlKey===undefined||c.ctrlKey==l.ctrlKey)&&(c.altKey===undefined||c.altKey==l.altKey)&&(c.metaKey===undefined||c.metaKey==(l.metaKey||false))&&(c.shiftKey===undefined||c.shiftKey==l.shiftKey)){b.stopEvent(l);d.typematic.trigger(l,
e,a,f,c,j,h,i)}else d.typematic._obj==c&&d.typematic.stop()}),b.connect(a,"onkeyup",this,function(){d.typematic._obj==c&&d.typematic.stop()})]},addMouseListener:function(a,c,e,f,j,h){var i=b.connect;return[i(a,"mousedown",this,function(l){b.stopEvent(l);d.typematic.trigger(l,c,a,e,a,f,j,h)}),i(a,"mouseup",this,function(l){b.stopEvent(l);d.typematic.stop()}),i(a,"mouseout",this,function(l){b.stopEvent(l);d.typematic.stop()}),i(a,"mousemove",this,function(l){l.preventDefault()}),i(a,"dblclick",this,
function(l){b.stopEvent(l);if(b.isIE){d.typematic.trigger(l,c,a,e,a,f,j,h);setTimeout(b.hitch(this,d.typematic.stop),50)}})]},addListener:function(a,c,e,f,j,h,i,l){return this.addKeyListener(c,e,f,j,h,i,l).concat(this.addMouseListener(a,f,j,h,i,l))}};return d.typematic});
define("dijit/_base/wai",["dojo","dijit"],function(b,d){d.wai={onload:function(){var a=b.create("div",{id:"a11yTestNode",style:{cssText:'border: 1px solid;border-color:red green;position: absolute;height: 5px;top: -999px;background-image: url("'+(b.config.blankGif||b.moduleUrl("dojo","resources/blank.gif"))+'");'}},b.body()),c=b.getComputedStyle(a);if(c){var e=c.backgroundImage;b[c.borderTopColor==c.borderRightColor||e!=null&&(e=="none"||e=="url(invalid-url:)")?"addClass":"removeClass"](b.body(),
"dijit_a11y");if(b.isIE)a.outerHTML="";else b.body().removeChild(a)}}};if(b.isIE||b.isMoz)b._loaders.unshift(d.wai.onload);b.mixin(d,{hasWaiRole:function(a,c){a=this.getWaiRole(a);return c?a.indexOf(c)>-1:a.length>0},getWaiRole:function(a){return b.trim((b.attr(a,"role")||"").replace("wairole:",""))},setWaiRole:function(a,c){b.attr(a,"role",c)},removeWaiRole:function(a,c){var e=b.attr(a,"role");if(e)if(c){c=b.trim((" "+e+" ").replace(" "+c+" "," "));b.attr(a,"role",c)}else a.removeAttribute("role")},
hasWaiState:function(a,c){return a.hasAttribute?a.hasAttribute("aria-"+c):!!a.getAttribute("aria-"+c)},getWaiState:function(a,c){return a.getAttribute("aria-"+c)||""},setWaiState:function(a,c,e){a.setAttribute("aria-"+c,e)},removeWaiState:function(a,c){a.removeAttribute("aria-"+c)}});return d});
define("dijit/_base",["dojo","dijit","dijit/_base/focus","dijit/_base/manager","dijit/_base/place","dijit/_base/popup","dijit/_base/scroll","dijit/_base/sniff","dijit/_base/typematic","dijit/_base/wai","dijit/_base/window"],function(b,d){return d._base});
define("dijit/_Widget",["dojo","dijit","dijit/_WidgetBase","dijit/_base"],function(b,d){b.connect(b,"_connect",function(a,c){a&&b.isFunction(a._onConnect)&&a._onConnect(c)});d._connectOnUseEventHandler=function(){};d._lastKeyDownNode=null;b.isIE?function(){var a=function(c){d._lastKeyDownNode=c.srcElement};b.doc.attachEvent("onkeydown",a);b.addOnWindowUnload(function(){b.doc.detachEvent("onkeydown",a)})}():b.doc.addEventListener("keydown",function(a){d._lastKeyDownNode=a.target},true);(function(){b.declare("dijit._Widget",
d._WidgetBase,{_deferredConnects:{onClick:"",onDblClick:"",onKeyDown:"",onKeyPress:"",onKeyUp:"",onMouseMove:"",onMouseDown:"",onMouseOut:"",onMouseOver:"",onMouseLeave:"",onMouseEnter:"",onMouseUp:""},onClick:d._connectOnUseEventHandler,onDblClick:d._connectOnUseEventHandler,onKeyDown:d._connectOnUseEventHandler,onKeyPress:d._connectOnUseEventHandler,onKeyUp:d._connectOnUseEventHandler,onMouseDown:d._connectOnUseEventHandler,onMouseMove:d._connectOnUseEventHandler,onMouseOut:d._connectOnUseEventHandler,
onMouseOver:d._connectOnUseEventHandler,onMouseLeave:d._connectOnUseEventHandler,onMouseEnter:d._connectOnUseEventHandler,onMouseUp:d._connectOnUseEventHandler,create:function(){this._deferredConnects=b.clone(this._deferredConnects);for(var a in this.attributeMap)delete this._deferredConnects[a];for(a in this._deferredConnects)this[a]!==d._connectOnUseEventHandler&&delete this._deferredConnects[a];this.inherited(arguments);if(this.domNode)for(a in this.params)this._onConnect(a)},_onConnect:function(a){if(a in
this._deferredConnects){this.connect(this[this._deferredConnects[a]||"domNode"],a.toLowerCase(),a);delete this._deferredConnects[a]}},focused:false,isFocusable:function(){return this.focus&&b.style(this.domNode,"display")!="none"},onFocus:function(){},onBlur:function(){},_onFocus:function(){this.onFocus()},_onBlur:function(){this.onBlur()},setAttribute:function(a,c){b.deprecated(this.declaredClass+"::setAttribute(attr, value) is deprecated. Use set() instead.","","2.0");this.set(a,c)},attr:function(a){if(b.config.isDebug){var c=
arguments.callee._ach||(arguments.callee._ach={}),e=(arguments.callee.caller||"unknown caller").toString();if(!c[e]){b.deprecated(this.declaredClass+"::attr() is deprecated. Use get() or set() instead, called from "+e,"","2.0");c[e]=true}}return arguments.length>=2||typeof a==="object"?this.set.apply(this,arguments):this.get(a)},nodesWithKeyClick:["input","button"],connect:function(a,c,e){var f=b._connect,j=this.inherited(arguments,[a,c=="ondijitclick"?"onclick":c,e]);if(c=="ondijitclick")if(b.indexOf(this.nodesWithKeyClick,
a.nodeName.toLowerCase())==-1){var h=b.hitch(this,e);j.push(f(a,"onkeydown",this,function(i){if((i.keyCode==b.keys.ENTER||i.keyCode==b.keys.SPACE)&&!i.ctrlKey&&!i.shiftKey&&!i.altKey&&!i.metaKey){d._lastKeyDownNode=i.target;"openDropDown"in this&&a==this._buttonNode||i.preventDefault()}}),f(a,"onkeyup",this,function(i){if((i.keyCode==b.keys.ENTER||i.keyCode==b.keys.SPACE)&&i.target==d._lastKeyDownNode&&!i.ctrlKey&&!i.shiftKey&&!i.altKey&&!i.metaKey){d._lastKeyDownNode=null;return h(i)}}))}return j},
_onShow:function(){this.onShow()},onShow:function(){},onHide:function(){},onClose:function(){return true}})})();return d._Widget});
define("dojo/string",["dojo"],function(b){b.getObject("string",true,b);b.string.rep=function(d,a){if(a<=0||!d)return"";for(var c=[];;){a&1&&c.push(d);if(!(a>>=1))break;d+=d}return c.join("")};b.string.pad=function(d,a,c,e){c||(c="0");d=String(d);a=b.string.rep(c,Math.ceil((a-d.length)/c.length));return e?d+a:a+d};b.string.substitute=function(d,a,c,e){e=e||b.global;c=c?b.hitch(e,c):function(f){return f};return d.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,function(f,j,h){f=b.getObject(j,false,
a);if(h)f=b.getObject(h,false,e).call(e,f,j);return c(f,j).toString()})};b.string.trim=String.prototype.trim?b.trim:function(d){d=d.replace(/^\s+/,"");for(var a=d.length-1;a>=0;a--)if(/\S/.test(d.charAt(a))){d=d.substring(0,a+1);break}return d};return b.string});
define("dojo/date/stamp",["dojo"],function(b){b.getObject("date.stamp",true,b);b.date.stamp.fromISOString=function(d,a){if(!b.date.stamp._isoRegExp)b.date.stamp._isoRegExp=/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;var c=b.date.stamp._isoRegExp.exec(d);d=null;if(c){c.shift();c[1]&&c[1]--;if(c[6])c[6]*=1E3;if(a){a=new Date(a);b.forEach(b.map(["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"],function(j){return a["get"+
j]()}),function(j,h){c[h]=c[h]||j})}d=new Date(c[0]||1970,c[1]||0,c[2]||1,c[3]||0,c[4]||0,c[5]||0,c[6]||0);if(c[0]<100)d.setFullYear(c[0]||1970);var e=0,f=c[7]&&c[7].charAt(0);if(f!="Z"){e=(c[8]||0)*60+(Number(c[9])||0);if(f!="-")e*=-1}if(f)e-=d.getTimezoneOffset();e&&d.setTime(d.getTime()+e*6E4)}return d};b.date.stamp.toISOString=function(d,a){var c=function(h){return h<10?"0"+h:h};a=a||{};var e=[],f=a.zulu?"getUTC":"get",j="";if(a.selector!="time"){j=d[f+"FullYear"]();j=["0000".substr((j+"").length)+
j,c(d[f+"Month"]()+1),c(d[f+"Date"]())].join("-")}e.push(j);if(a.selector!="date"){j=[c(d[f+"Hours"]()),c(d[f+"Minutes"]()),c(d[f+"Seconds"]())].join(":");f=d[f+"Milliseconds"]();if(a.milliseconds)j+="."+(f<100?"0":"")+c(f);if(a.zulu)j+="Z";else if(a.selector!="time"){d=d.getTimezoneOffset();a=Math.abs(d);j+=(d>0?"-":"+")+c(Math.floor(a/60))+":"+c(a%60)}e.push(j)}return e.join("T")};return b.date.stamp});
define("dojo/parser",["dojo","dojo/date/stamp"],function(b){b.parser=new (function(){function d(i){if(f.isString(i))return"string";if(typeof i=="number")return"number";if(typeof i=="boolean")return"boolean";if(f.isFunction(i))return"function";if(f.isArray(i))return"array";if(i instanceof Date)return"date";if(i instanceof f._Url)return"url";return"object"}function a(i,l){switch(l){case "string":return i;case "number":return i.length?Number(i):NaN;case "boolean":return typeof i=="boolean"?i:i.toLowerCase()!=
"false";case "function":if(f.isFunction(i)){i=i.toString();i=f.trim(i.substring(i.indexOf("{")+1,i.length-1))}try{return i===""||i.search(/[^\w\.]+/i)!=-1?new Function(i):f.getObject(i,false)||new Function(i)}catch(o){return new Function}case "array":return i?i.split(/\s*,\s*/):[];case "date":switch(i){case "":return new Date("");case "now":return new Date;default:return f.date.stamp.fromISOString(i)}case "url":return f.baseUrl+i;default:return f.fromJson(i)}}function c(i,l){for(var o in i)if(o.charAt(0)!=
"_")o in j||(l[o]=d(i[o]));return l}function e(i,l){var o=h[i];if(o){if(!l&&!o.params)o.params=c(o.cls.prototype,{})}else{i=f.getObject(i);o=null;if(!i)return null;l||(o=c(i.prototype,{}));o={cls:i,params:o}}return o}var f=b,j={},h={};f.connect(f,"extend",function(){h={}});this._functionFromScript=function(i,l){var o="",q="";(l=i.getAttribute(l+"args")||i.getAttribute("args"))&&f.forEach(l.split(/\s*,\s*/),function(x,t){o+="var "+x+" = arguments["+t+"]; "});(l=i.getAttribute("with"))&&l.length&&f.forEach(l.split(/\s*,\s*/),
function(x){o+="with("+x+"){";q+="}"});return new Function(o+i.innerHTML+q)};this.instantiate=function(i,l,o){var q=[];l=l||{};o=o||{};var x=(o.scope||f._scopeName)+"Type",t="data-"+(o.scope||f._scopeName)+"-";f.forEach(i,function(r){if(r){var s,y,w,g,k,m;if(r.node){s=r.node;y=r.type;m=r.fastpath;g=(w=r.clsInfo||y&&e(y,m))&&w.cls;k=r.scripts}else{s=r;k=(g=(w=(y=x in l?l[x]:s.getAttribute(x))&&e(y))&&w.cls)&&(g._noScript||g.prototype._noScript)?[]:f.query("> script[type^='dojo/']",s)}if(!w)throw new Error("Could not load class '"+
y);var n={};o.defaults&&f._mixin(n,o.defaults);r.inherited&&f._mixin(n,r.inherited);if(m){if((w=s.getAttribute(t+"props"))&&w.length)try{w=f.fromJson.call(o.propsThis,"{"+w+"}");f._mixin(n,w)}catch(p){throw new Error(p.toString()+" in data-dojo-props='"+w+"'");}if(w=s.getAttribute(t+"attach-point"))n.dojoAttachPoint=w;if(w=s.getAttribute(t+"attach-event"))n.dojoAttachEvent=w;b.mixin(n,l)}else{r=s.attributes;for(var u in w.params){y=u in l?{value:l[u],specified:true}:r.getNamedItem(u);if(!(!y||!y.specified&&
(!b.isIE||u.toLowerCase()!="value"))){y=y.value;switch(u){case "class":y="className"in l?l.className:s.className;break;case "style":y="style"in l?l.style:s.style&&s.style.cssText}var v=w.params[u];n[u]=typeof y=="string"?a(y,v):y}}}var A=[],C=[];f.forEach(k,function(E){s.removeChild(E);var F=E.getAttribute(t+"event")||E.getAttribute("event"),J=E.getAttribute("type");E=f.parser._functionFromScript(E,t);if(F)if(J=="dojo/connect")A.push({event:F,func:E});else n[F]=E;else C.push(E)});var D=(k=g.markupFactory||
g.prototype&&g.prototype.markupFactory)?k(n,s,g):new g(n,s);q.push(D);(g=s.getAttribute(t+"id")||s.getAttribute("jsId"))&&f.setObject(g,D);f.forEach(A,function(E){f.connect(D,E.event,null,E.func)});f.forEach(C,function(E){E.call(D)})}});l._started||f.forEach(q,function(r){if(!o.noStart&&r&&b.isFunction(r.startup)&&!r._started&&(!r.getParent||!r.getParent()))r.startup()});return q};this.parse=function(i,l){function o(s,y){var w=b.clone(s.inherited);b.forEach(["dir","lang"],function(u){var v=s.node.getAttribute(u);
if(v)w[u]=v});for(var g=s.clsInfo&&!s.clsInfo.cls.prototype._noScript?s.scripts:null,k=!s.clsInfo||!s.clsInfo.cls.prototype.stopParser||l&&l.template,m=s.node.firstChild;m;m=m.nextSibling)if(m.nodeType==1){var n,p=k&&m.getAttribute(x+"type");n=p?p:k&&m.getAttribute(q);p=p==n;if(n){n={type:n,fastpath:p,clsInfo:e(n,p),node:m,scripts:[],inherited:w};y.push(n);o(n,y)}else if(g&&m.nodeName.toLowerCase()=="script")(n=m.getAttribute("type"))&&/^dojo\/\w/i.test(n)&&g.push(m);else k&&o({node:m,inherited:w},
y)}}if(!l&&i&&i.rootNode){l=i;i=l.rootNode}else i=i;i=i?b.byId(i):b.body();l=l||{};var q=(l.scope||f._scopeName)+"Type",x="data-"+(l.scope||f._scopeName)+"-",t={};if(l&&l.inherited)for(var r in l.inherited)if(l.inherited[r])t[r]=l.inherited[r];r=[];o({node:i,inherited:t},r);return this.instantiate(r,l&&l.template?{template:true}:null,l)}});(function(){var d=function(){b.config.parseOnLoad&&b.parser.parse()};b.getObject("dijit.wai.onload")===b._loaders[0]?b._loaders.splice(1,0,d):b._loaders.unshift(d)})();
return b.parser});
define("dojo/cache",["dojo"],function(b){var d={};b.cache=function(a,c,e){if(typeof a=="string")var f=b.moduleUrl(a,c);else{f=a;e=c}f=f.toString();var j=e;if(e!=undefined&&!b.isString(e))j="value"in e?e.value:undefined;e=e&&e.sanitize?true:false;if(typeof j=="string")j=d[f]=e?b.cache._sanitize(j):j;else if(j===null)delete d[f];else{if(!(f in d)){j=undefined;if(b.isFunction(require)&&b.isString(a))try{var h=(a?a.replace(/\./g,"/")+"/":"")+c;j=require("text!"+h)}catch(i){}if(typeof j==="undefined")j=
b._getText(f);d[f]=e?b.cache._sanitize(j):j}j=d[f]}return j};b.cache._sanitize=function(a){if(a){a=a.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,"");var c=a.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(c)a=c[1]}else a="";return a};return b.cache});
define("dijit/_Templated",["dojo","dijit","dijit/_Widget","dojo/string","dojo/parser","dojo/cache"],function(b,d){b.declare("dijit._Templated",null,{templateString:null,templatePath:null,widgetsInTemplate:false,_skipNodeCache:false,_earlyTemplatedStartup:false,constructor:function(){this._attachPoints=[];this._attachEvents=[]},_stringRepl:function(a){var c=this.declaredClass,e=this;return b.string.substitute(a,this,function(f,j){if(j.charAt(0)=="!")f=b.getObject(j.substr(1),false,e);if(typeof f==
"undefined")throw new Error(c+" template:"+j);if(f==null)return"";return j.charAt(0)=="!"?f:f.toString().replace(/"/g,"&quot;")},this)},buildRendering:function(){var a=d._Templated.getCachedTemplate(this.templatePath,this.templateString,this._skipNodeCache),c;if(b.isString(a)){c=b._toDom(this._stringRepl(a));if(c.nodeType!=1)throw new Error("Invalid template: "+a);}else c=a.cloneNode(true);this.domNode=c;this.inherited(arguments);this._attachTemplateNodes(c);if(this.widgetsInTemplate){a=this._startupWidgets=
b.parser.parse(c,{noStart:!this._earlyTemplatedStartup,template:true,inherited:{dir:this.dir,lang:this.lang},propsThis:this,scope:"dojo"});this._supportingWidgets=d.findWidgets(c);this._attachTemplateNodes(a,function(e,f){return e[f]})}this._fillContent(this.srcNodeRef)},_fillContent:function(a){var c=this.containerNode;if(a&&c)for(;a.hasChildNodes();)c.appendChild(a.firstChild)},_attachTemplateNodes:function(a,c){c=c||function(q,x){return q.getAttribute(x)};for(var e=b.isArray(a)?a:a.all||a.getElementsByTagName("*"),
f=b.isArray(a)?0:-1;f<e.length;f++){var j=f==-1?a:e[f];if(!(this.widgetsInTemplate&&(c(j,"dojoType")||c(j,"data-dojo-type")))){var h=c(j,"dojoAttachPoint")||c(j,"data-dojo-attach-point");if(h)for(var i=h.split(/\s*,\s*/);h=i.shift();){if(b.isArray(this[h]))this[h].push(j);else this[h]=j;this._attachPoints.push(h)}if(h=c(j,"dojoAttachEvent")||c(j,"data-dojo-attach-event")){i=h.split(/\s*,\s*/);for(var l=b.trim;h=i.shift();)if(h){var o=null;if(h.indexOf(":")!=-1){o=h.split(":");h=l(o[0]);o=l(o[1])}else h=
l(h);o||(o=h);this._attachEvents.push(this.connect(j,h,o))}}(h=c(j,"waiRole"))&&d.setWaiRole(j,h);(h=c(j,"waiState"))&&b.forEach(h.split(/\s*,\s*/),function(q){if(q.indexOf("-")!=-1){q=q.split("-");d.setWaiState(j,q[0],q[1])}})}}},startup:function(){b.forEach(this._startupWidgets,function(a){a&&!a._started&&a.startup&&a.startup()});this.inherited(arguments)},destroyRendering:function(){b.forEach(this._attachPoints,function(a){delete this[a]},this);this._attachPoints=[];b.forEach(this._attachEvents,
this.disconnect,this);this._attachEvents=[];this.inherited(arguments)}});d._Templated._templateCache={};d._Templated.getCachedTemplate=function(a,c,e){var f=d._Templated._templateCache,j=c||a,h=f[j];if(h){try{if(!h.ownerDocument||h.ownerDocument==b.doc)return h}catch(i){}b.destroy(h)}c||(c=b.cache(a,{sanitize:true}));c=b.string.trim(c);if(e||c.match(/\$\{([^\}]+)\}/g))return f[j]=c;else{a=b._toDom(c);if(a.nodeType!=1)throw new Error("Invalid template: "+c);return f[j]=a}};b.isIE&&b.addOnWindowUnload(function(){var a=
d._Templated._templateCache;for(var c in a){var e=a[c];typeof e=="object"&&b.destroy(e);delete a[c]}});b.extend(d._Widget,{dojoAttachEvent:"",dojoAttachPoint:"",waiRole:"",waiState:""});return d._Templated});
define("dijit/_CssStateMixin",["dojo","dijit"],function(b,d){b.declare("dijit._CssStateMixin",[],{cssStateNodes:{},hovering:false,active:false,_applyAttributes:function(){this.inherited(arguments);b.forEach(["onmouseenter","onmouseleave","onmousedown"],function(c){this.connect(this.domNode,c,"_cssMouseEvent")},this);b.forEach(["disabled","readOnly","checked","selected","focused","state","hovering","active"],function(c){this.watch(c,b.hitch(this,"_setStateClass"))},this);for(var a in this.cssStateNodes)this._trackMouseState(this[a],
this.cssStateNodes[a]);this._setStateClass()},_cssMouseEvent:function(a){if(!this.disabled)switch(a.type){case "mouseenter":case "mouseover":this._set("hovering",true);this._set("active",this._mouseDown);break;case "mouseleave":case "mouseout":this._set("hovering",false);this._set("active",false);break;case "mousedown":this._set("active",true);this._mouseDown=true;var c=this.connect(b.body(),"onmouseup",function(){this._mouseDown=false;this._set("active",false);this.disconnect(c)});break}},_setStateClass:function(){function a(i){c=
c.concat(b.map(c,function(l){return l+i}),"dijit"+i)}var c=this.baseClass.split(" ");this.isLeftToRight()||a("Rtl");this.checked&&a("Checked");this.state&&a(this.state);this.selected&&a("Selected");if(this.disabled)a("Disabled");else if(this.readOnly)a("ReadOnly");else if(this.active)a("Active");else this.hovering&&a("Hover");this._focused&&a("Focused");var e=this.stateNode||this.domNode,f={};b.forEach(e.className.split(" "),function(i){f[i]=true});"_stateClasses"in this&&b.forEach(this._stateClasses,
function(i){delete f[i]});b.forEach(c,function(i){f[i]=true});var j=[];for(var h in f)j.push(h);e.className=j.join(" ");this._stateClasses=c},_trackMouseState:function(a,c){function e(){var o="disabled"in i&&i.disabled||"readonly"in i&&i.readonly;b.toggleClass(a,c+"Hover",f&&!j&&!o);b.toggleClass(a,c+"Active",j&&!o);b.toggleClass(a,c+"Focused",h&&!o)}var f=false,j=false,h=false,i=this,l=b.hitch(this,"connect",a);l("onmouseenter",function(){f=true;e()});l("onmouseleave",function(){j=f=false;e()});
l("onmousedown",function(){j=true;e()});l("onmouseup",function(){j=false;e()});l("onfocus",function(){h=true;e()});l("onblur",function(){h=false;e()});this.watch("disabled",e);this.watch("readOnly",e)}});return d._CssStateMixin});
define("dijit/form/_FormWidget",["dojo","dijit","dojo/window","dijit/_Widget","dijit/_Templated","dijit/_CssStateMixin"],function(b,d){b.declare("dijit.form._FormWidget",[d._Widget,d._Templated,d._CssStateMixin],{name:"",alt:"",value:"",type:"text",tabIndex:"0",disabled:false,intermediateChanges:false,scrollOnFocus:true,attributeMap:b.delegate(d._Widget.prototype.attributeMap,{value:"focusNode",id:"focusNode",tabIndex:"focusNode",alt:"focusNode",title:"focusNode"}),postMixInProperties:function(){this.nameAttrSetting=
this.name?'name="'+this.name.replace(/'/g,"&quot;")+'"':"";this.inherited(arguments)},postCreate:function(){this.inherited(arguments);this.connect(this.domNode,"onmousedown","_onMouseDown")},_setDisabledAttr:function(a){this._set("disabled",a);b.attr(this.focusNode,"disabled",a);this.valueNode&&b.attr(this.valueNode,"disabled",a);d.setWaiState(this.focusNode,"disabled",a);if(a){this._set("hovering",false);this._set("active",false);a="tabIndex"in this.attributeMap?this.attributeMap.tabIndex:"focusNode";
b.forEach(b.isArray(a)?a:[a],function(c){c=this[c];b.isWebKit||d.hasDefaultTabStop(c)?c.setAttribute("tabIndex","-1"):c.removeAttribute("tabIndex")},this)}else this.tabIndex!=""&&this.focusNode.setAttribute("tabIndex",this.tabIndex)},setDisabled:function(a){b.deprecated("setDisabled("+a+") is deprecated. Use set('disabled',"+a+") instead.","","2.0");this.set("disabled",a)},_onFocus:function(){this.scrollOnFocus&&b.window.scrollIntoView(this.domNode);this.inherited(arguments)},isFocusable:function(){return!this.disabled&&
this.focusNode&&b.style(this.domNode,"display")!="none"},focus:function(){this.disabled||d.focus(this.focusNode)},compare:function(a,c){return typeof a=="number"&&typeof c=="number"?isNaN(a)&&isNaN(c)?0:a-c:a>c?1:a<c?-1:0},onChange:function(){},_onChangeActive:false,_handleOnChange:function(a,c){if(this._lastValueReported==undefined&&(c===null||!this._onChangeActive))this._resetValue=this._lastValueReported=a;this._pendingOnChange=this._pendingOnChange||typeof a!=typeof this._lastValueReported||this.compare(a,
this._lastValueReported)!=0;if((this.intermediateChanges||c||c===undefined)&&this._pendingOnChange){this._lastValueReported=a;this._pendingOnChange=false;if(this._onChangeActive){this._onChangeHandle&&clearTimeout(this._onChangeHandle);this._onChangeHandle=setTimeout(b.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){b.deprecated("dijit.form._FormWidget:setValue("+a+") is deprecated.  Use set('value',"+a+") instead.","","2.0");this.set("value",a)},getValue:function(){b.deprecated(this.declaredClass+"::getValue() is deprecated. Use get('value') instead.","","2.0");return this.get("value")},_onMouseDown:function(a){if(!a.ctrlKey&&b.mouseButtons.isLeft(a)&&this.isFocusable())var c=this.connect(b.body(),"onmouseup",function(){this.isFocusable()&&this.focus();this.disconnect(c)})}});b.declare("dijit.form._FormValueWidget",
d.form._FormWidget,{readOnly:false,attributeMap:b.delegate(d.form._FormWidget.prototype.attributeMap,{value:"",readOnly:"focusNode"}),_setReadOnlyAttr:function(a){b.attr(this.focusNode,"readOnly",a);d.setWaiState(this.focusNode,"readonly",a);this._set("readOnly",a)},postCreate:function(){this.inherited(arguments);if(b.isIE<9||b.isIE&&b.isQuirks)this.connect(this.focusNode||this.domNode,"onkeydown",this._onKeyDown);if(this._resetValue===undefined)this._lastValueReported=this._resetValue=this.value},
_setValueAttr:function(a,c){this._handleOnChange(a,c)},_handleOnChange:function(a){this._set("value",a);this.inherited(arguments)},undo:function(){this._setValueAttr(this._lastValueReported,false)},reset:function(){this._hasBeenBlurred=false;this._setValueAttr(this._resetValue,true)},_onKeyDown:function(a){if(a.keyCode==b.keys.ESCAPE&&!(a.ctrlKey||a.altKey||a.metaKey)){var c;if(b.isIE){a.preventDefault();c=document.createEventObject();c.keyCode=b.keys.ESCAPE;c.shiftKey=a.shiftKey;a.srcElement.fireEvent("onkeypress",
c)}}},_layoutHackIE7:function(){if(b.isIE==7)for(var a=this.domNode,c=a.parentNode,e=a.firstChild||a,f=e.style.filter,j=this;c&&c.clientHeight==0;){(function(){var h=j.connect(c,"onscroll",function(){j.disconnect(h);e.style.filter=(new Date).getMilliseconds();setTimeout(function(){e.style.filter=f},0)})})();c=c.parentNode}}});return d.form._FormWidget});
define("dijit/form/TextBox",["dojo","dijit","text!dijit/form/templates/TextBox.html","dijit/form/_FormWidget"],function(b,d){b.declare("dijit.form.TextBox",d.form._FormValueWidget,{trim:false,uppercase:false,lowercase:false,propercase:false,maxLength:"",selectOnClick:false,placeHolder:"",templateString:b.cache("dijit.form","templates/TextBox.html"),_singleNodeTemplate:'<input class="dijit dijitReset dijitLeft dijitInputField" dojoAttachPoint="textbox,focusNode" autocomplete="off" type="${type}" ${!nameAttrSetting} />',
_buttonInputDisabled:b.isIE?"disabled":"",baseClass:"dijitTextBox",attributeMap:b.delegate(d.form._FormValueWidget.prototype.attributeMap,{maxLength:"focusNode"}),postMixInProperties:function(){var a=this.type.toLowerCase();if(this.templateString&&this.templateString.toLowerCase()=="input"||(a=="hidden"||a=="file")&&this.templateString==d.form.TextBox.prototype.templateString)this.templateString=this._singleNodeTemplate;this.inherited(arguments)},_setPlaceHolderAttr:function(a){this._set("placeHolder",
a);if(!this._phspan){this._attachPoints.push("_phspan");this._phspan=b.create("span",{className:"dijitPlaceHolder dijitInputField"},this.textbox,"after")}this._phspan.innerHTML="";this._phspan.appendChild(document.createTextNode(a));this._updatePlaceHolder()},_updatePlaceHolder:function(){if(this._phspan)this._phspan.style.display=this.placeHolder&&!this._focused&&!this.textbox.value?"":"none"},_getValueAttr:function(){return this.parse(this.get("displayedValue"),this.constraints)},_setValueAttr:function(a,
c,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,c])},displayedValue:"",getDisplayedValue:function(){b.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){b.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 b.keys.SHIFT:case b.keys.ALT:case b.keys.CTRL:case b.keys.TAB:return}if(this.intermediateChanges){var c=this;setTimeout(function(){c._handleOnChange(c.get("value"),false)},0)}this._refreshState();this._set("displayedValue",this.get("displayedValue"))},
postCreate:function(){b.isIE&&setTimeout(b.hitch(this,function(){var a=b.getComputedStyle(this.domNode);if(a)if(a=a.fontFamily){var c=this.domNode.getElementsByTagName("INPUT");if(c)for(var e=0;e<c.length;e++)c[e].style.fontFamily=a}}),0);this.textbox.setAttribute("value",this.textbox.value);this.inherited(arguments);if(b.isMoz||b.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=b.trim(a);if(this.uppercase)a=a.toUpperCase();if(this.lowercase)a=a.toLowerCase();if(this.propercase)a=a.replace(/[^\s]+/g,function(c){return c.substring(0,1).toUpperCase()+c.substring(1)});return a},_setBlurValue:function(){this._setValueAttr(this.get("value"),true)},_onBlur:function(){if(!this.disabled){this._setBlurValue();
this.inherited(arguments);this._selectOnClickHandle&&this.disconnect(this._selectOnClickHandle);if(this.selectOnClick&&b.isMoz)this.textbox.selectionStart=this.textbox.selectionEnd=undefined;this._updatePlaceHolder()}},_onFocus:function(a){if(!(this.disabled||this.readOnly)){if(this.selectOnClick&&a=="mouse")this._selectOnClickHandle=this.connect(this.domNode,"onmouseup",function(){this.disconnect(this._selectOnClickHandle);var c;if(b.isIE){c=b.doc.selection.createRange();c=c.parentElement()==this.textbox&&
c.text.length==0}else c=this.textbox.selectionStart==this.textbox.selectionEnd;c&&d.selectInputText(this.textbox)});this._updatePlaceHolder();this.inherited(arguments);this._refreshState()}},reset:function(){this.textbox.value="";this.inherited(arguments)}});d.selectInputText=function(a,c,e){var f=b.global,j=b.doc;a=b.byId(a);if(isNaN(c))c=0;if(isNaN(e))e=a.value?a.value.length:0;d.focus(a);if(j.selection&&b.body().createTextRange){if(a.createTextRange){a=a.createTextRange();a.collapse(true);a.moveStart("character",
-99999);a.moveStart("character",c);a.moveEnd("character",e-c);a.select()}}else f.getSelection&&a.setSelectionRange&&a.setSelectionRange(c,e)};return d.form.TextBox});define("text!dijit/templates/Tooltip.html",function(){return'<div class="dijitTooltip dijitTooltipLeft" id="dojoTooltip"\n\t><div class="dijitTooltipContainer dijitTooltipContents" dojoAttachPoint="containerNode" role=\'alert\'></div\n\t><div class="dijitTooltipConnector" dojoAttachPoint="connectorNode"></div\n></div>'});
define("dijit/Tooltip",["dojo","dijit","dijit/_Widget","dijit/_Templated","text!dijit/templates/Tooltip.html"],function(b,d){b.declare("dijit._MasterTooltip",[d._Widget,d._Templated],{duration:d.defaultDuration,templateString:b.cache("dijit","templates/Tooltip.html"),postCreate:function(){b.body().appendChild(this.domNode);this.bgIframe=new d.BackgroundIframe(this.domNode);this.fadeIn=b.fadeIn({node:this.domNode,duration:this.duration,onEnd:b.hitch(this,"_onShow")});this.fadeOut=b.fadeOut({node:this.domNode,
duration:this.duration,onEnd:b.hitch(this,"_onHide")})},show:function(a,c,e,f){if(!(this.aroundNode&&this.aroundNode===c)){this.domNode.width="auto";if(this.fadeOut.status()=="playing")this._onDeck=arguments;else{this.containerNode.innerHTML=a;d.placeOnScreenAroundElement(this.domNode,c,d.getPopupAroundAlignment(e&&e.length?e:d.Tooltip.defaultPosition,!f),b.hitch(this,"orient"));b.style(this.domNode,"opacity",0);this.fadeIn.play();this.isShowingNow=true;this.aroundNode=c}}},orient:function(a,c,e,
f,j){this.connectorNode.style.top="";var h=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"}[c+"-"+e];this.domNode.style.width="auto";var i=b.contentBox(this.domNode),l=Math.min(Math.max(h,1),i.w),o=l<i.w;this.domNode.style.width=l+"px";if(o){this.containerNode.style.overflow=
"auto";o=this.containerNode.scrollWidth;this.containerNode.style.overflow="visible";if(o>l){o=o+b.style(this.domNode,"paddingLeft")+b.style(this.domNode,"paddingRight");this.domNode.style.width=o+"px"}}if(e.charAt(0)=="B"&&c.charAt(0)=="B"){a=b.marginBox(a);c=this.connectorNode.offsetHeight;if(a.h>f.h){this.connectorNode.style.top=f.h-j.h/2-c/2+"px";this.connectorNode.style.bottom=""}else{this.connectorNode.style.bottom=Math.min(Math.max(j.h/2-c/2,0),a.h-c)+"px";this.connectorNode.style.top=""}}else{this.connectorNode.style.top=
"";this.connectorNode.style.bottom=""}return Math.max(0,i.w-h)},_onShow:function(){if(b.isIE)this.domNode.style.filter=""},hide:function(a){if(this._onDeck&&this._onDeck[1]==a)this._onDeck=null;else if(this.aroundNode===a){this.fadeIn.stop();this.isShowingNow=false;this.aroundNode=null;this.fadeOut.play()}},_onHide:function(){this.domNode.style.cssText="";this.containerNode.innerHTML="";if(this._onDeck){this.show.apply(this,this._onDeck);this._onDeck=null}}});d.showTooltip=function(a,c,e,f){if(!d._masterTT)d._masterTT=
new d._MasterTooltip;return d._masterTT.show(a,c,e,f)};d.hideTooltip=function(a){if(!d._masterTT)d._masterTT=new d._MasterTooltip;return d._masterTT.hide(a)};b.declare("dijit.Tooltip",d._Widget,{label:"",showDelay:400,connectId:[],position:[],_setConnectIdAttr:function(a){b.forEach(this._connections||[],function(e){b.forEach(e,b.hitch(this,"disconnect"))},this);var c=b.isArrayLike(a)?a:a?[a]:[];this._connections=b.map(c,function(e){return(e=b.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=c},addTarget:function(a){a=a.id||a;b.indexOf(this._connectIds,a)==-1&&this.set("connectId",this._connectIds.concat(a))},removeTarget:function(a){a=b.indexOf(this._connectIds,a.id||a);if(a>=0){this._connectIds.splice(a,1);this.set("connectId",this._connectIds)}},buildRendering:function(){this.inherited(arguments);
b.addClass(this.domNode,"dijitTooltipData")},startup:function(){this.inherited(arguments);var a=this.connectId;b.forEach(b.isArrayLike(a)?a:[a],this.addTarget,this)},_onTargetMouseEnter:function(a){this._onHover(a)},_onTargetMouseLeave:function(a){this._onUnHover(a)},_onTargetFocus:function(a){this._focus=true;this._onHover(a)},_onTargetBlur:function(a){this._focus=false;this._onUnHover(a)},_onHover:function(a){if(!this._showTimer){var c=a.target;this._showTimer=setTimeout(b.hitch(this,function(){this.open(c)}),
this.showDelay)}},_onUnHover:function(){if(!this._focus){if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer}this.close()}},open:function(a){if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer}d.showTooltip(this.label||this.domNode.innerHTML,a,this.position,!this.isLeftToRight());this._connectNode=a;this.onShow(a,this.position)},close:function(){if(this._connectNode){d.hideTooltip(this._connectNode);delete this._connectNode;this.onHide()}if(this._showTimer){clearTimeout(this._showTimer);
delete this._showTimer}},onShow:function(){},onHide:function(){},uninitialize:function(){this.close();this.inherited(arguments)}});d.Tooltip.defaultPosition=["after","before"];return d.Tooltip});
(function(){function b(c,e,f,j,h,i){if(e[c]){f.push(c);if(e[c]===true||e[c]===1)j.push(h+c+"/"+i)}}function d(c,e,f,j,h){e=j+e+"/"+h;require._fileExists(c.nameToUrl(e,null))&&f.push(e)}var a=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",{version:"0.24.0",load:function(c,e,f,j){j=j||{};var h=a.exec(c),i=h[1],l=h[4],o=h[5],q=l.split("-"),x=[],t={},r,s,y="";if(h[5]){i=h[1];c=i+o}else{c=c;o=h[4];l=j.locale||(j.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||
"root").toLowerCase());q=l.split("-")}if(j.isBuild){x.push(c);d(e,"root",x,i,o);for(r=0;s=q[r];r++){y+=(y?"-":"")+s;d(e,y,x,i,o)}e(x);f()}else e([c],function(w){var g=[];b("root",w,g,x,i,o);for(r=0;s=q[r];r++){y+=(y?"-":"")+s;b(y,w,g,x,i,o)}e(x,function(){var k,m;for(k=g.length-1;k>-1&&(s=g[k]);k--){m=w[s];if(m===true||m===1)m=e(i+s+"/"+o);require.mixin(t,m)}f(t)})})}})})();
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(b,d){b.declare("dijit.form.ValidationTextBox",d.form.TextBox,{templateString:b.cache("dijit.form","templates/ValidationTextBox.html"),baseClass:"dijitTextBox dijitValidationTextBox",required:false,promptMessage:"",invalidMessage:"$_unset_$",missingMessage:"$_unset_$",message:"",constraints:{},regExp:".*",
regExpGen:function(){return this.regExp},state:"",tooltipPosition:[],_setValueAttr:function(){this.inherited(arguments);this.validate(this._focused)},validator:function(a,c){return(new RegExp("^(?:"+this.regExpGen(c)+")"+(this.required?"":"?")+"$")).test(a)&&(!this.required||!this._isEmpty(a))&&(this._isEmpty(a)||this.parse(a,c)!==undefined)},_isValidSubset:function(){return this.textbox.value.search(this._partialre)==0},isValid:function(){return this.validator(this.textbox.value,this.constraints)},
_isEmpty:function(a){return(this.trim?/^\s*$/:/^$/).test(a)},getErrorMessage:function(){return this.required&&this._isEmpty(this.textbox.value)?this.missingMessage:this.invalidMessage},getPromptMessage:function(){return this.promptMessage},_maskValidSubsetError:true,validate:function(a){var c="",e=this.disabled||this.isValid(a);if(e)this._maskValidSubsetError=true;var f=this._isEmpty(this.textbox.value),j=!e&&a&&this._isValidSubset();this._set("state",e?"":((!this._hasBeenBlurred||a)&&f||j)&&this._maskValidSubsetError?
"Incomplete":"Error");d.setWaiState(this.focusNode,"invalid",e?"false":"true");if(this.state=="Error"){this._maskValidSubsetError=a&&j;c=this.getErrorMessage(a)}else if(this.state=="Incomplete"){c=this.getPromptMessage(a);this._maskValidSubsetError=!this._hasBeenBlurred||a}else if(f)c=this.getPromptMessage(a);this.set("message",c);return e},displayMessage:function(a){d.hideTooltip(this.domNode);a&&this._focused&&d.showTooltip(a,this.domNode,this.tooltipPosition,!this.isLeftToRight())},_refreshState:function(){this.validate(this._focused);
this.inherited(arguments)},constructor:function(){this.constraints={}},_setConstraintsAttr:function(a){if(!a.locale&&this.lang)a.locale=this.lang;this._set("constraints",a);this._computePartialRE()},_computePartialRE:function(){var a=this.regExpGen(this.constraints);this.regExp=a;var c="";a!=".*"&&this.regExp.replace(/\\.|\[\]|\[.*?[^\\]{1}\]|\{.*?\}|\(\?[=:!]|./g,function(f){switch(f.charAt(0)){case "{":case "+":case "?":case "*":case "^":case "$":case "|":case "(":c+=f;break;case ")":c+="|$)";break;
default:c+="(?:"+f+"|$)";break}});try{"".search(c)}catch(e){c=this.regExp;console.warn("RegExp error in "+this.declaredClass+": "+this.regExp)}this._partialre="^(?:"+c+")$"},postMixInProperties:function(){this.inherited(arguments);this.messages=b.i18n.getLocalization("dijit.form","validate",this.lang);if(this.invalidMessage=="$_unset_$")this.invalidMessage=this.messages.invalidMessage;if(!this.invalidMessage)this.invalidMessage=this.promptMessage;if(this.missingMessage=="$_unset_$")this.missingMessage=
this.messages.missingMessage;if(!this.missingMessage)this.missingMessage=this.invalidMessage;this._setConstraintsAttr(this.constraints)},_setDisabledAttr:function(){this.inherited(arguments);this._refreshState()},_setRequiredAttr:function(a){this._set("required",a);d.setWaiState(this.focusNode,"required",a);this._refreshState()},_setMessageAttr:function(a){this._set("message",a);this.displayMessage(a)},reset:function(){this._maskValidSubsetError=true;this.inherited(arguments)},_onBlur:function(){this.displayMessage("");
this.inherited(arguments)}});b.declare("dijit.form.MappedTextBox",d.form.ValidationTextBox,{postMixInProperties:function(){this.inherited(arguments);this.nameAttrSetting=""},serialize:function(a){return a.toString?a.toString():""},toString:function(){var a=this.filter(this.get("value"));return a!=null?typeof a=="string"?a:this.serialize(a,this.constraints):""},validate:function(){this.valueNode.value=this.toString();return this.inherited(arguments)},buildRendering:function(){this.inherited(arguments);
this.valueNode=b.place("<input type='hidden'"+(this.name?" name='"+this.name.replace(/'/g,"&quot;")+"'":"")+"/>",this.textbox,"after")},reset:function(){this.valueNode.value="";this.inherited(arguments)}});b.declare("dijit.form.RangeBoundTextBox",d.form.MappedTextBox,{rangeMessage:"",rangeCheck:function(a,c){return("min"in c?this.compare(a,c.min)>=0:true)&&("max"in c?this.compare(a,c.max)<=0:true)},isInRange:function(){return this.rangeCheck(this.get("value"),this.constraints)},_isDefinitelyOutOfRange:function(){var a=
this.get("value"),c=false,e=false;if("min"in this.constraints){c=this.constraints.min;c=this.compare(a,typeof c=="number"&&c>=0&&a!=0?0:c);c=typeof c=="number"&&c<0}if("max"in this.constraints){e=this.constraints.max;e=this.compare(a,typeof e!="number"||e>0?e:0);e=typeof e=="number"&&e>0}return c||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 c=this.get("value");if(c!==null&&c!==""&&c!==undefined&&(typeof c!="number"||!isNaN(c))&&!this.isInRange(a))return this.rangeMessage;return this.inherited(arguments)},postMixInProperties:function(){this.inherited(arguments);if(!this.rangeMessage){this.messages=b.i18n.getLocalization("dijit.form","validate",this.lang);this.rangeMessage=this.messages.rangeMessage}},_setConstraintsAttr:function(){this.inherited(arguments);if(this.focusNode){this.constraints.min!==
undefined?d.setWaiState(this.focusNode,"valuemin",this.constraints.min):d.removeWaiState(this.focusNode,"valuemin");this.constraints.max!==undefined?d.setWaiState(this.focusNode,"valuemax",this.constraints.max):d.removeWaiState(this.focusNode,"valuemax")}},_setValueAttr:function(a){d.setWaiState(this.focusNode,"valuenow",a);this.inherited(arguments)}});return d.form.ValidationTextBox});
define("orion/util",["dojo","dijit","dojo/hash","dijit/form/ValidationTextBox"],function(b,d){function a(m){k=m}function c(){return k}function e(m){var n="",p=navigator.platform.indexOf("Mac")!==-1;if(m.mod1)n+=p?"Cmd+":"Ctrl+";if(m.mod2)n+="Shift+";if(m.mod3)n+="Alt+";if(m.alphaKey)return n+m.alphaKey;for(var u in b.keys)if(typeof(b.keys[u]==="number"))if(b.keys[u]===m.keyCode)return n+u;var v;switch(m.keyCode){case 59:v=m.mod2?":":";";break;case 61:v=m.mod2?"+":"=";break;case 188:v=m.mod2?"<":",";
break;case 190:v=m.mod2?">":".";break;case 191:v=m.mod2?"?":"/";break;case 192:v=m.mod2?"~":"`";break;case 219:v=m.mod2?"{":"[";break;case 220:v=m.mod2?"|":"\\";break;case 221:v=m.mod2?"}":"]";break;case 222:v=m.mod2?'"':"'";break}if(v)return n+v;return n+String.fromCharCode(m.keyCode)}function f(m,n){m.startup();if(typeof n==="string"){var p=b.byId(n);if(!p)if(p=d.byId(n))p=p.domNode;n=p?p:null}if(n){n=b.position(n);m._setStyleAttr("left:"+(n.x+16)+"px !important;");m._setStyleAttr("top:"+(n.y+16)+
"px !important;")}m.show()}function j(m,n,p,u,v,A,C,D){C=function(F){return function(J){var M=d.byId(m),O=M.get("value");if(F&&J.keyCode===b.keys.ESCAPE){p&&b.style(n,"display","inline");M.destroyRecursive();A&&A()}else if(!(F&&J.keyCode!==b.keys.ENTER)){if(!M.isValid()||O===u)p&&b.style(n,"display","inline");else v(O);M.destroyRecursive();A&&A()}}};var E=new d.form.ValidationTextBox({id:m,required:true,value:u||""});b.place(E.domNode,n,"after");b.addClass(E.domNode,"userEditBoxPrompt");p&&b.style(n,
"display","none");b.connect(E,"onKeyDown",C(true));b.connect(E,"onBlur",C(false));window.setTimeout(function(){E.focus();if(u){var F=b.byId(m),J=D?u.indexOf(D):-1;J>0?d.selectInputText(F,0,J):F.select()}},0)}function h(m){var n=window.navigator.platform.indexOf("Mac")!==-1;return n&&m.metaKey||!n&&m.ctrlKey}function i(m,n){if(n&&h(n))window.open(m);else window.location=m}function l(m){if(!m)return m;var n=window.location.href.split("#")[0];n=n.substring(0,n.length-window.location.pathname.length);
if(m.indexOf(n)===0)return m.substring(n.length);return m}function o(m){var n,p,u,v,A;m=m.split("#");var C=m[m.length-1].split(/\?(?=(?:line|char))/);m=l(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(u===undefined){n=window.parseInt(E[0]);if(E.length>1)p=window.parseInt(E[1])}else{v=E[0];if(E.length>1)A=window.parseInt(E[1]-v)}break;case "line":E=E[1].split(",");u=window.parseInt(E[0]);
break;default:break}}}return{filePath:m,start:n,end:p,line:u,offset:v,length:A}}function q(m,n,p,u,v,A){if(typeof n==="number"){m="#"+m+"?char="+n;if(typeof p==="number")m=m+","+p;else if(typeof A==="number")m=m+","+(n+A);return m}if(typeof u==="number"){m="#"+m+"?line="+u;if(typeof v==="number"){m=m+"&char="+v;if(typeof A==="number")m=m+","+(v+A)}return m}return"#"+m}function x(m){if(!m)return m;var n=window.location.href.split("#")[0];return n.substring(0,n.length-window.location.pathname.length)+
m}function t(m){return this.makeRelative(m).indexOf("/workspace")===0}function r(m,n){m.children=n;for(var p in n)n[p].parent=m;m.children.sort(function(u,v){var A=u.Directory;if(A!==v.Directory)return A?-1:1;u=u.Name&&u.Name.toLowerCase();v=v.Name&&v.Name.toLowerCase();if(u<v)return-1;if(u>v)return 1;return 0})}function s(m,n){m.Parents&&m.Parents.length===0&&n.getService("orion.core.preference").then(function(p){return p.getPreferences("/window/recent")}).then(function(p){var u=p.get("projects");
if(typeof u==="string")u=JSON.parse(u);var v=[];if(u&&u.length&&u.length>0)for(var A=0;A<u.length;A++)u[A].location!==m.ChildrenLocation&&u[A].name!==m.Name&&v.push(u[A]);v.push({name:m.Name,location:m.ChildrenLocation});if(v.length>5)v=v.slice(-5,v.length);p.put("projects",v)})}function y(m){return typeof m.textContent!=="undefined"?m.textContent:m.innerText}function w(m){return y(document.createTextNode(m))}function g(m,n){if(typeof m.textContent!=="undefined")m.textContent=n;else m.innerText=n}
var k=null;return{setUserName:a,getUserName:c,getUserKeyString:e,openDialog:f,getUserText:j,openInNewWindow:h,followLink:i,getPositionInfo:o,hashFromPosition:q,makeRelative:l,makeFullPath:x,isAtRoot:t,processNavigatorParent:r,rememberSuccessfulTraversal:s,getText:y,safeText:w,setText:g}});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(b,d){b.declare("dijit._Container",null,{isContainer:true,buildRendering:function(){this.inherited(arguments);if(!this.containerNode)this.containerNode=this.domNode},addChild:function(a,c){var e=this.containerNode;if(c&&typeof c=="number"){var f=this.getChildren();if(f&&f.length>=c){e=f[c-1].domNode;c="after"}}b.place(a.domNode,e,c);this._started&&!a._started&&a.startup()},removeChild:function(a){if(typeof a=="number")a=this.getChildren()[a];if(a)(a=
a.domNode)&&a.parentNode&&a.parentNode.removeChild(a)},hasChildren:function(){return this.getChildren().length>0},destroyDescendants:function(a){b.forEach(this.getChildren(),function(c){c.destroyRecursive(a)})},_getSiblingOfChild:function(a,c){a=a.domNode;c=c>0?"nextSibling":"previousSibling";do a=a[c];while(a&&(a.nodeType!=1||!d.byNode(a)));return a&&d.byNode(a)},getIndexOfChild:function(a){return b.indexOf(this.getChildren(),a)},startup:function(){if(!this._started){b.forEach(this.getChildren(),
function(a){a.startup()});this.inherited(arguments)}}});return d._Container});
define("dijit/_KeyNavContainer",["dojo","dijit","dijit/_Container"],function(b,d){b.declare("dijit._KeyNavContainer",d._Container,{tabIndex:"0",_keyNavCodes:{},connectKeyNavHandlers:function(a,c){var e=this._keyNavCodes={},f=b.hitch(this,this.focusPrev),j=b.hitch(this,this.focusNext);b.forEach(a,function(h){e[h]=f});b.forEach(c,function(h){e[h]=j});e[b.keys.HOME]=b.hitch(this,"focusFirstChild");e[b.keys.END]=b.hitch(this,"focusLastChild");this.connect(this.domNode,"onkeypress","_onContainerKeypress");
this.connect(this.domNode,"onfocus","_onContainerFocus")},startupKeyNavChildren:function(){b.forEach(this.getChildren(),b.hitch(this,"_startupChild"))},addChild:function(a){d._KeyNavContainer.superclass.addChild.apply(this,arguments);this._startupChild(a)},focus:function(){this.focusFirstChild()},focusFirstChild:function(){var a=this._getFirstFocusableChild();a&&this.focusChild(a)},focusLastChild:function(){var a=this._getLastFocusableChild();a&&this.focusChild(a)},focusNext:function(){this.focusChild(this._getNextFocusableChild(this.focusedChild,
1))},focusPrev:function(){this.focusChild(this._getNextFocusableChild(this.focusedChild,-1),true)},focusChild:function(a,c){this.focusedChild&&a!==this.focusedChild&&this._onChildBlur(this.focusedChild);a.set("tabIndex",this.tabIndex);a.focus(c?"end":"start");this._set("focusedChild",a)},_startupChild:function(a){a.set("tabIndex","-1");this.connect(a,"_onFocus",function(){a.set("tabIndex",this.tabIndex)});this.connect(a,"_onBlur",function(){a.set("tabIndex","-1")})},_onContainerFocus:function(a){if(a.target===
this.domNode){this.focusFirstChild();b.attr(this.domNode,"tabIndex","-1")}},_onBlur:function(){this.tabIndex&&b.attr(this.domNode,"tabIndex",this.tabIndex);this.inherited(arguments)},_onContainerKeypress:function(a){if(!(a.ctrlKey||a.altKey)){var c=this._keyNavCodes[a.charOrCode];if(c){c();b.stopEvent(a)}}},_onChildBlur:function(){},_getFirstFocusableChild:function(){return this._getNextFocusableChild(null,1)},_getLastFocusableChild:function(){return this._getNextFocusableChild(null,-1)},_getNextFocusableChild:function(a,
c){if(a)a=this._getSiblingOfChild(a,c);for(var e=this.getChildren(),f=0;f<e.length;f++){a||(a=e[c>0?0:e.length-1]);if(a.isFocusable())return a;a=this._getSiblingOfChild(a,c)}return null}});return d._KeyNavContainer});define("text!dijit/templates/MenuItem.html",function(){return'<tr class="dijitReset dijitMenuItem" dojoAttachPoint="focusNode" role="menuitem" tabIndex="-1"\n\t\tdojoAttachEvent="onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick">\n\t<td class="dijitReset dijitMenuItemIconCell" role="presentation">\n\t\t<img src="${_blankGif}" alt="" class="dijitIcon dijitMenuItemIcon" dojoAttachPoint="iconNode"/>\n\t</td>\n\t<td class="dijitReset dijitMenuItemLabel" colspan="2" dojoAttachPoint="containerNode"></td>\n\t<td class="dijitReset dijitMenuItemAccelKey" style="display: none" dojoAttachPoint="accelKeyNode"></td>\n\t<td class="dijitReset dijitMenuArrowCell" role="presentation">\n\t\t<div dojoAttachPoint="arrowWrapper" style="visibility: hidden">\n\t\t\t<img src="${_blankGif}" alt="" class="dijitMenuExpand"/>\n\t\t\t<span class="dijitMenuExpandA11y">+</span>\n\t\t</div>\n\t</td>\n</tr>'});
define("dijit/_Contained",["dojo","dijit"],function(b,d){b.declare("dijit._Contained",null,{getParent:function(){var a=d.getEnclosingWidget(this.domNode.parentNode);return a&&a.isContainer?a:null},_getSibling:function(a){var c=this.domNode;do c=c[a+"Sibling"];while(c&&c.nodeType!=1);return c&&d.byNode(c)},getPreviousSibling:function(){return this._getSibling("previous")},getNextSibling:function(){return this._getSibling("next")},getIndexInParent:function(){var a=this.getParent();if(!a||!a.getIndexOfChild)return-1;
return a.getIndexOfChild(this)}});return d._Contained});
define("dijit/MenuItem",["dojo","dijit","text!dijit/templates/MenuItem.html","dijit/_Widget","dijit/_Templated","dijit/_Contained","dijit/_CssStateMixin"],function(b,d){b.declare("dijit.MenuItem",[d._Widget,d._Templated,d._Contained,d._CssStateMixin],{templateString:b.cache("dijit","templates/MenuItem.html"),attributeMap:b.delegate(d._Widget.prototype.attributeMap,{label:{node:"containerNode",type:"innerHTML"},iconClass:{node:"iconNode",type:"class"}}),baseClass:"dijitMenuItem",label:"",iconClass:"",
accelKey:"",disabled:false,_fillContent:function(a){a&&!("label"in this.params)&&this.set("label",a.innerHTML)},buildRendering:function(){this.inherited(arguments);var a=this.id+"_text";b.attr(this.containerNode,"id",a);if(this.accelKeyNode){b.attr(this.accelKeyNode,"id",this.id+"_accel");a+=" "+this.id+"_accel"}d.setWaiState(this.domNode,"labelledby",a);b.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);b.stopEvent(a)},onClick:function(){},focus:function(){try{b.isIE==8&&this.containerNode.focus();d.focus(this.focusNode)}catch(a){}},_onFocus:function(){this._setSelected(true);this.getParent()._onItemFocus(this);this.inherited(arguments)},_setSelected:function(a){b.toggleClass(this.domNode,"dijitMenuItemSelected",a)},setLabel:function(a){b.deprecated("dijit.MenuItem.setLabel() is deprecated.  Use set('label', ...) instead.",
"","2.0");this.set("label",a)},setDisabled:function(a){b.deprecated("dijit.Menu.setDisabled() is deprecated.  Use set('disabled', bool) instead.","","2.0");this.set("disabled",a)},_setDisabledAttr:function(a){d.setWaiState(this.focusNode,"disabled",a?"true":"false");this._set("disabled",a)},_setAccelKeyAttr:function(a){this.accelKeyNode.style.display=a?"":"none";this.accelKeyNode.innerHTML=a;b.attr(this.containerNode,"colSpan",a?"1":"2");this._set("accelKey",a)}});return d.MenuItem});
define("dijit/PopupMenuItem",["dojo","dijit","dijit/MenuItem"],function(b,d){b.declare("dijit.PopupMenuItem",d.MenuItem,{_fillContent:function(){if(this.srcNodeRef){var a=b.query("*",this.srcNodeRef);d.PopupMenuItem.superclass._fillContent.call(this,a[0]);this.dropDownContainer=this.srcNodeRef}},startup:function(){if(!this._started){this.inherited(arguments);if(!this.popup){var a=b.query("[widgetId]",this.dropDownContainer)[0];this.popup=d.byNode(a)}b.body().appendChild(this.popup.domNode);this.popup.startup();
this.popup.domNode.style.display="none";this.arrowWrapper&&b.style(this.arrowWrapper,"visibility","");d.setWaiState(this.focusNode,"haspopup","true")}},destroyDescendants:function(){if(this.popup){this.popup._destroyed||this.popup.destroyRecursive();delete this.popup}this.inherited(arguments)}});return d.PopupMenuItem});define("text!dijit/templates/CheckedMenuItem.html",function(){return'<tr class="dijitReset dijitMenuItem" dojoAttachPoint="focusNode" role="menuitemcheckbox" tabIndex="-1"\n\t\tdojoAttachEvent="onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick">\n\t<td class="dijitReset dijitMenuItemIconCell" role="presentation">\n\t\t<img src="${_blankGif}" alt="" class="dijitMenuItemIcon dijitCheckedMenuItemIcon" dojoAttachPoint="iconNode"/>\n\t\t<span class="dijitCheckedMenuItemIconChar">&#10003;</span>\n\t</td>\n\t<td class="dijitReset dijitMenuItemLabel" colspan="2" dojoAttachPoint="containerNode,labelNode"></td>\n\t<td class="dijitReset dijitMenuItemAccelKey" style="display: none" dojoAttachPoint="accelKeyNode"></td>\n\t<td class="dijitReset dijitMenuArrowCell" role="presentation">&nbsp;</td>\n</tr>'});
define("dijit/CheckedMenuItem",["dojo","dijit","text!dijit/templates/CheckedMenuItem.html","dijit/MenuItem"],function(b,d){b.declare("dijit.CheckedMenuItem",d.MenuItem,{templateString:b.cache("dijit","templates/CheckedMenuItem.html"),checked:false,_setCheckedAttr:function(a){b.toggleClass(this.domNode,"dijitCheckedMenuItemChecked",a);d.setWaiState(this.domNode,"checked",a);this._set("checked",a)},onChange:function(){},_onClick:function(){if(!this.disabled){this.set("checked",!this.checked);this.onChange(this.checked)}this.inherited(arguments)}});
return d.CheckedMenuItem});define("text!dijit/templates/MenuSeparator.html",function(){return'<tr class="dijitMenuSeparator">\n\t<td class="dijitMenuSeparatorIconCell">\n\t\t<div class="dijitMenuSeparatorTop"></div>\n\t\t<div class="dijitMenuSeparatorBottom"></div>\n\t</td>\n\t<td colspan="3" class="dijitMenuSeparatorLabelCell">\n\t\t<div class="dijitMenuSeparatorTop dijitMenuSeparatorLabel"></div>\n\t\t<div class="dijitMenuSeparatorBottom"></div>\n\t</td>\n</tr>'});
define("dijit/MenuSeparator",["dojo","dijit","text!dijit/templates/MenuSeparator.html","dijit/_Widget","dijit/_Templated","dijit/_Contained"],function(b,d){b.declare("dijit.MenuSeparator",[d._Widget,d._Templated,d._Contained],{templateString:b.cache("dijit","templates/MenuSeparator.html"),buildRendering:function(){this.inherited(arguments);b.setSelectable(this.domNode,false)},isFocusable:function(){return false}});return d.MenuSeparator});
define("dijit/Menu",["dojo","dijit","text!dijit/templates/Menu.html","dojo/window","dijit/_Widget","dijit/_KeyNavContainer","dijit/_Templated","dijit/MenuItem","dijit/PopupMenuItem","dijit/CheckedMenuItem","dijit/MenuSeparator"],function(b,d){b.declare("dijit._MenuBase",[d._Widget,d._Templated,d._KeyNavContainer],{parentMenu:null,popupDelay:500,startup:function(){if(!this._started){b.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(b.hitch(this,"_openPopup"),this.popupDelay)}this.focusedChild&&this.focusChild(a);this._hoveredChild=a},_onChildBlur:function(a){this._stopPopupTimer();a._setSelected(false);var c=a.popup;if(c){this._stopPendingCloseTimer(c);c._pendingClose_timer=setTimeout(function(){c._pendingClose_timer=null;if(c.parentMenu)c.parentMenu.currentPopup=
null;d.popup.close(c)},this.popupDelay)}},onItemUnhover:function(a){this.isActive&&this._stopPopupTimer();if(this._hoveredChild==a)this._hoveredChild=null},_stopPopupTimer:function(){if(this.hover_timer){clearTimeout(this.hover_timer);this.hover_timer=null}},_stopPendingCloseTimer:function(a){if(a._pendingClose_timer){clearTimeout(a._pendingClose_timer);a._pendingClose_timer=null}},_stopFocusTimer:function(){if(this._focus_timer){clearTimeout(this._focus_timer);this._focus_timer=null}},_getTopMenu:function(){for(var a=
this;a.parentMenu;a=a.parentMenu);return a},onItemClick:function(a,c){typeof this.isShowingNow=="undefined"&&this._markActive();this.focusChild(a);if(a.disabled)return false;if(a.popup)this._openPopup();else{this.onExecute();a.onClick(c)}},_openPopup:function(){this._stopPopupTimer();var a=this.focusedChild;if(a){var c=a.popup;if(!c.isShowingNow){if(this.currentPopup){this._stopPendingCloseTimer(this.currentPopup);d.popup.close(this.currentPopup)}c.parentMenu=this;c.from_item=a;var e=this;d.popup.open({parent:this,
popup:c,around:a.domNode,orient:this._orient||(this.isLeftToRight()?{TR:"TL",TL:"TR",BR:"BL",BL:"BR"}:{TL:"TR",TR:"TL",BL:"BR",BR:"BL"}),onCancel:function(){e.focusChild(a);e._cleanUp();a._setSelected(true);e.focusedChild=a},onExecute:b.hitch(this,"_cleanUp")});this.currentPopup=c;c.connect(c.domNode,"onmouseenter",b.hitch(e,"_onPopupHover"));if(c.focus)c._focus_timer=setTimeout(b.hitch(c,function(){this._focus_timer=null;this.focus()}),0)}}},_markActive:function(){this.isActive=true;b.replaceClass(this.domNode,
"dijitMenuActive","dijitMenuPassive")},onOpen:function(){this.isShowingNow=true;this._markActive()},_markInactive:function(){this.isActive=false;b.replaceClass(this.domNode,"dijitMenuPassive","dijitMenuActive")},onClose:function(){this._stopFocusTimer();this._markInactive();this.isShowingNow=false;this.parentMenu=null},_closeChild:function(){this._stopPopupTimer();if(this.currentPopup){d._curFocus&&b.isDescendant(d._curFocus,this.currentPopup.domNode)&&this.focusedChild.focusNode.focus();d.popup.close(this.currentPopup);
this.currentPopup=null}if(this.focusedChild){this.focusedChild._setSelected(false);this.focusedChild._onUnhover();this.focusedChild=null}},_onItemFocus:function(a){this._hoveredChild&&this._hoveredChild!=a&&this._hoveredChild._onUnhover()},_onBlur:function(){this._cleanUp();this.inherited(arguments)},_cleanUp:function(){this._closeChild();typeof this.isShowingNow=="undefined"&&this._markInactive()}});b.declare("dijit.Menu",d._MenuBase,{constructor:function(){this._bindings=[]},templateString:b.cache("dijit",
"templates/Menu.html"),baseClass:"dijitMenu",targetNodeIds:[],contextMenuForWindow:false,leftClickToOpen:false,refocus:true,postCreate:function(){this.contextMenuForWindow?this.bindDomNode(b.body()):b.forEach(this.targetNodeIds,this.bindDomNode,this);var a=b.keys,c=this.isLeftToRight();this._openSubMenuKey=c?a.RIGHT_ARROW:a.LEFT_ARROW;this._closeSubMenuKey=c?a.LEFT_ARROW:a.RIGHT_ARROW;this.connectKeyNavHandlers([a.UP_ARROW],[a.DOWN_ARROW])},_onKeyPress:function(a){if(!(a.ctrlKey||a.altKey))switch(a.charOrCode){case this._openSubMenuKey:this._moveToPopup(a);
b.stopEvent(a);break;case this._closeSubMenuKey:if(this.parentMenu)this.parentMenu._isMenuBar?this.parentMenu.focusPrev():this.onCancel(false);else b.stopEvent(a);break}},_iframeContentWindow:function(a){return b.window.get(this._iframeContentDocument(a))||this._iframeContentDocument(a).__parent__||a.name&&b.doc.frames[a.name]||null},_iframeContentDocument:function(a){return a.contentDocument||a.contentWindow&&a.contentWindow.document||a.name&&b.doc.frames[a.name]&&b.doc.frames[a.name].document||
null},bindDomNode:function(a){a=b.byId(a);var c;if(a.tagName.toLowerCase()=="iframe"){var e=a,f=this._iframeContentWindow(e);c=b.withGlobal(f,b.body)}else c=a==b.body()?b.doc.documentElement:a;var j={node:a,iframe:e};b.attr(a,"_dijitMenu"+this.id,this._bindings.push(j));var h=b.hitch(this,function(i){return[b.connect(i,this.leftClickToOpen?"onclick":"oncontextmenu",this,function(l){b.stopEvent(l);this._scheduleOpen(l.target,e,{x:l.pageX,y:l.pageY})}),b.connect(i,"onkeydown",this,function(l){if(l.shiftKey&&
l.keyCode==b.keys.F10){b.stopEvent(l);this._scheduleOpen(l.target,e)}})]});j.connects=c?h(c):[];if(e){j.onloadHandler=b.hitch(this,function(){var i=this._iframeContentWindow(e);c=b.withGlobal(i,b.body);j.connects=h(c)});e.addEventListener?e.addEventListener("load",j.onloadHandler,false):e.attachEvent("onload",j.onloadHandler)}},unBindDomNode:function(a){var c;try{c=b.byId(a)}catch(e){return}a="_dijitMenu"+this.id;if(c&&b.hasAttr(c,a)){var f=b.attr(c,a)-1,j=this._bindings[f];b.forEach(j.connects,b.disconnect);
var h=j.iframe;if(h)h.removeEventListener?h.removeEventListener("load",j.onloadHandler,false):h.detachEvent("onload",j.onloadHandler);b.removeAttr(c,a);delete this._bindings[f]}},_scheduleOpen:function(a,c,e){if(!this._openTimer)this._openTimer=setTimeout(b.hitch(this,function(){delete this._openTimer;this._openMyself({target:a,iframe:c,coords:e})}),1)},_openMyself:function(a){function c(){o.refocus&&d.focus(q);d.popup.close(o)}var e=a.target,f=a.iframe;if(a=a.coords){if(f){e=b.position(f,true);var j=
this._iframeContentWindow(f);j=b.withGlobal(j,"_docScroll",b);var h=b.getComputedStyle(f),i=b._toPixelValue,l=(b.isIE&&b.isQuirks?0:i(f,h.paddingLeft))+(b.isIE&&b.isQuirks?i(f,h.borderLeftWidth):0);f=(b.isIE&&b.isQuirks?0:i(f,h.paddingTop))+(b.isIE&&b.isQuirks?i(f,h.borderTopWidth):0);a.x+=e.x+l-j.x;a.y+=e.y+f-j.y}}else{a=b.position(e,true);a.x+=10;a.y+=10}var o=this,q=d.getFocus(this);d.popup.open({popup:this,x:a.x,y:a.y,onExecute:c,onCancel:c,orient:this.isLeftToRight()?"L":"R"});this.focus();this._onBlur=
function(){this.inherited("_onBlur",arguments);d.popup.close(this)}},uninitialize:function(){b.forEach(this._bindings,function(a){a&&this.unBindDomNode(a.node)},this);this.inherited(arguments)}});return d.Menu});define("text!dijit/form/templates/Button.html",function(){return'<span class="dijit dijitReset dijitInline"\n\t><span class="dijitReset dijitInline dijitButtonNode"\n\t\tdojoAttachEvent="ondijitclick:_onButtonClick"\n\t\t><span class="dijitReset dijitStretch dijitButtonContents"\n\t\t\tdojoAttachPoint="titleNode,focusNode"\n\t\t\trole="button" aria-labelledby="${id}_label"\n\t\t\t><span class="dijitReset dijitInline dijitIcon" dojoAttachPoint="iconNode"></span\n\t\t\t><span class="dijitReset dijitToggleButtonIconChar">&#x25CF;</span\n\t\t\t><span class="dijitReset dijitInline dijitButtonText"\n\t\t\t\tid="${id}_label"\n\t\t\t\tdojoAttachPoint="containerNode"\n\t\t\t></span\n\t\t></span\n\t></span\n\t><input ${!nameAttrSetting} type="${type}" value="${value}" class="dijitOffScreen" tabIndex="-1"\n\t\tdojoAttachPoint="valueNode"\n/></span>'});
define("text!dijit/form/templates/DropDownButton.html",function(){return'<span class="dijit dijitReset dijitInline"\n\t><span class=\'dijitReset dijitInline dijitButtonNode\'\n\t\tdojoAttachEvent="ondijitclick:_onButtonClick" dojoAttachPoint="_buttonNode"\n\t\t><span class="dijitReset dijitStretch dijitButtonContents"\n\t\t\tdojoAttachPoint="focusNode,titleNode,_arrowWrapperNode"\n\t\t\trole="button" aria-haspopup="true" aria-labelledby="${id}_label"\n\t\t\t><span class="dijitReset dijitInline dijitIcon"\n\t\t\t\tdojoAttachPoint="iconNode"\n\t\t\t></span\n\t\t\t><span class="dijitReset dijitInline dijitButtonText"\n\t\t\t\tdojoAttachPoint="containerNode,_popupStateNode"\n\t\t\t\tid="${id}_label"\n\t\t\t></span\n\t\t\t><span class="dijitReset dijitInline dijitArrowButtonInner"></span\n\t\t\t><span class="dijitReset dijitInline dijitArrowButtonChar">&#9660;</span\n\t\t></span\n\t></span\n\t><input ${!nameAttrSetting} type="${type}" value="${value}" class="dijitOffScreen" tabIndex="-1"\n\t\tdojoAttachPoint="valueNode"\n/></span>'});
define("text!dijit/form/templates/ComboButton.html",function(){return'<table class="dijit dijitReset dijitInline dijitLeft"\n\tcellspacing=\'0\' cellpadding=\'0\' role="presentation"\n\t><tbody role="presentation"><tr role="presentation"\n\t\t><td class="dijitReset dijitStretch dijitButtonNode" dojoAttachPoint="buttonNode" dojoAttachEvent="ondijitclick:_onButtonClick,onkeypress:_onButtonKeyPress"\n\t\t><div id="${id}_button" class="dijitReset dijitButtonContents"\n\t\t\tdojoAttachPoint="titleNode"\n\t\t\trole="button" aria-labelledby="${id}_label"\n\t\t\t><div class="dijitReset dijitInline dijitIcon" dojoAttachPoint="iconNode" role="presentation"></div\n\t\t\t><div class="dijitReset dijitInline dijitButtonText" id="${id}_label" dojoAttachPoint="containerNode" role="presentation"></div\n\t\t></div\n\t\t></td\n\t\t><td id="${id}_arrow" class=\'dijitReset dijitRight dijitButtonNode dijitArrowButton\'\n\t\t\tdojoAttachPoint="_popupStateNode,focusNode,_buttonNode"\n\t\t\tdojoAttachEvent="onkeypress:_onArrowKeyPress"\n\t\t\ttitle="${optionsTitle}"\n\t\t\trole="button" aria-haspopup="true"\n\t\t\t><div class="dijitReset dijitArrowButtonInner" role="presentation"></div\n\t\t\t><div class="dijitReset dijitArrowButtonChar" role="presentation">&#9660;</div\n\t\t></td\n\t\t><td style="display:none !important;"\n\t\t\t><input ${!nameAttrSetting} type="${type}" value="${value}" dojoAttachPoint="valueNode"\n\t\t/></td></tr></tbody\n></table>'});
define("dijit/_HasDropDown",["dojo","dijit","dijit/_Widget"],function(b,d){b.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)){b.stopEvent(a);this._docHandler=this.connect(b.doc,"onmouseup","_onDropDownMouseUp");this.toggleDropDown()}},_onDropDownMouseUp:function(a){a&&
this._docHandler&&this.disconnect(this._docHandler);var c=this.dropDown,e=false;if(a&&this._opened){var f=b.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(b.hasClass(f,"dijitPopup"))e=true;else f=f.parentNode;if(e){f=a.target;if(c.onItemClick){for(var j;f&&!(j=d.byNode(f));)f=f.parentNode;j&&j.onClick&&j.getParent&&j.getParent().onItemClick(j,a)}return}}}this._opened&&c.focus&&c.autoFocus!==false&&window.setTimeout(b.hitch(c,
"focus"),1)},_onDropDownClick:function(a){this._stopClickEvents&&b.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";b.addClass(this._arrowWrapperNode||
this._buttonNode,"dijit"+a+"ArrowButton")},postCreate:function(){this.inherited(arguments);this.connect(this._buttonNode,"onmousedown","_onDropDownMouseDown");this.connect(this._buttonNode,"onclick","_onDropDownClick");this.connect(this.focusNode,"onkeypress","_onKey");this.connect(this.focusNode,"onkeyup","_onKeyUp")},destroy:function(){if(this.dropDown){this.dropDown._destroyed||this.dropDown.destroyRecursive();delete this.dropDown}this.inherited(arguments)},_onKey:function(a){if(!(this.disabled||
this.readOnly)){var c=this.dropDown,e=a.target;if(c&&this._opened&&c.handleKey)if(c.handleKey(a)===false){b.stopEvent(a);return}if(c&&this._opened&&a.charOrCode==b.keys.ESCAPE){this.closeDropDown();b.stopEvent(a)}else if(!this._opened&&(a.charOrCode==b.keys.DOWN_ARROW||(a.charOrCode==b.keys.ENTER||a.charOrCode==" ")&&((e.tagName||"").toLowerCase()!=="input"||e.type&&e.type.toLowerCase()!=="text"))){this._toggleOnKeyUp=true;b.stopEvent(a)}}},_onKeyUp:function(){if(this._toggleOnKeyUp){delete this._toggleOnKeyUp;
this.toggleDropDown();var a=this.dropDown;a&&a.focus&&setTimeout(b.hitch(a,"focus"),1)}},_onBlur:function(){this.closeDropDown(d._curFocus&&this.dropDown&&b.isDescendant(d._curFocus,this.dropDown.domNode));this.inherited(arguments)},isLoaded:function(){return true},loadDropDown:function(a){a()},toggleDropDown:function(){if(!(this.disabled||this.readOnly))if(this._opened)this.closeDropDown();else this.isLoaded()?this.openDropDown():this.loadDropDown(b.hitch(this,"openDropDown"))},openDropDown:function(){var a=
this.dropDown,c=a.domNode,e=this._aroundNode||this.domNode,f=this;if(!this._preparedNode){this._preparedNode=true;if(c.style.width)this._explicitDDWidth=true;if(c.style.height)this._explicitDDHeight=true}if(this.maxHeight||this.forceWidth||this.autoWidth){var j={display:"",visibility:"hidden"};if(!this._explicitDDWidth)j.width="";if(!this._explicitDDHeight)j.height="";b.style(c,j);j=this.maxHeight;if(j==-1){j=b.window.getBox();var h=b.position(e,false);j=Math.floor(Math.max(h.y,j.h-(h.y+h.h)))}a.startup&&
!a._started&&a.startup();d.popup.moveOffScreen(a);h=b._getMarginSize(c);var i=j&&h.h>j;b.style(c,{overflowX:"hidden",overflowY:i?"auto":"hidden"});if(i){h.h=j;if("w"in h)h.w+=16}else delete h.h;if(this.forceWidth)h.w=e.offsetWidth;else if(this.autoWidth)h.w=Math.max(h.w,e.offsetWidth);else delete h.w;b.isFunction(a.resize)?a.resize(h):b.marginBox(c,h)}a=d.popup.open({parent:this,popup:a,around:e,orient:d.getPopupAroundAlignment(this.dropDownPosition&&this.dropDownPosition.length?this.dropDownPosition:
["below"],this.isLeftToRight()),onExecute:function(){f.closeDropDown(true)},onCancel:function(){f.closeDropDown(true)},onClose:function(){b.attr(f._popupStateNode,"popupActive",false);b.removeClass(f._popupStateNode,"dijitHasDropDownOpen");f._opened=false}});b.attr(this._popupStateNode,"popupActive","true");b.addClass(f._popupStateNode,"dijitHasDropDownOpen");this._opened=true;return a},closeDropDown:function(a){if(this._opened){a&&this.focus();d.popup.close(this.dropDown);this._opened=false}}});
return d._HasDropDown});
define("dijit/form/Button",["dojo","dijit","text!dijit/form/templates/Button.html","text!dijit/form/templates/DropDownButton.html","text!dijit/form/templates/ComboButton.html","dijit/form/_FormWidget","dijit/_Container","dijit/_HasDropDown"],function(b,d){b.declare("dijit.form.Button",d.form._FormWidget,{label:"",showLabel:true,iconClass:"",type:"button",baseClass:"dijitButton",templateString:b.cache("dijit.form","templates/Button.html"),attributeMap:b.delegate(d.form._FormWidget.prototype.attributeMap,{value:"valueNode"}),
_onClick:function(a){if(this.disabled)return false;this._clicked();return this.onClick(a)},_onButtonClick:function(a){if(this._onClick(a)===false)a.preventDefault();else if(this.type=="submit"&&!(this.valueNode||this.focusNode).form)for(var c=this.domNode;c.parentNode;c=c.parentNode){var e=d.byNode(c);if(e&&typeof e._onSubmit=="function"){e._onSubmit(a);break}}else if(this.valueNode){this.valueNode.click();a.preventDefault()}},buildRendering:function(){this.inherited(arguments);b.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&&b.toggleClass(this.containerNode,"dijitDisplayNone",!a);this._set("showLabel",a)},onClick:function(){return true},_clicked:function(){},setLabel:function(a){b.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=b.trim(this.containerNode.innerText||this.containerNode.textContent||"")},_setIconClassAttr:function(a){b.replaceClass(this.iconNode,a||"dijitNoIcon",this.iconClass||"dijitNoIcon");this._set("iconClass",a)}});b.declare("dijit.form.DropDownButton",[d.form.Button,d._Container,d._HasDropDown],{baseClass:"dijitDropDownButton",templateString:b.cache("dijit.form","templates/DropDownButton.html"),_fillContent:function(){if(this.srcNodeRef){var a=
b.query("*",this.srcNodeRef);d.form.DropDownButton.superclass._fillContent.call(this,a[0]);this.dropDownContainer=this.srcNodeRef}},startup:function(){if(!this._started){if(!this.dropDown&&this.dropDownContainer){var a=b.query("[widgetId]",this.dropDownContainer)[0];this.dropDown=d.byNode(a);delete this.dropDownContainer}this.dropDown&&d.popup.hide(this.dropDown);this.inherited(arguments)}},isLoaded:function(){var a=this.dropDown;return!!a&&(!a.href||a.isLoaded)},loadDropDown:function(){var a=this.dropDown;
if(a)if(this.isLoaded())this.openDropDown();else{var c=b.connect(a,"onLoad",this,function(){b.disconnect(c);this.openDropDown()});a.refresh()}},isFocusable:function(){return this.inherited(arguments)&&!this._mouseDown}});b.declare("dijit.form.ComboButton",d.form.DropDownButton,{templateString:b.cache("dijit.form","templates/ComboButton.html"),attributeMap:b.mixin(b.clone(d.form.Button.prototype.attributeMap),{id:"",tabIndex:["focusNode","titleNode"],title:"titleNode"}),optionsTitle:"",baseClass:"dijitComboButton",
cssStateNodes:{buttonNode:"dijitButtonNode",titleNode:"dijitButtonContents",_popupStateNode:"dijitDownArrowButton"},_focusedNode:null,_onButtonKeyPress:function(a){if(a.charOrCode==b.keys[this.isLeftToRight()?"RIGHT_ARROW":"LEFT_ARROW"]){d.focus(this._popupStateNode);b.stopEvent(a)}},_onArrowKeyPress:function(a){if(a.charOrCode==b.keys[this.isLeftToRight()?"LEFT_ARROW":"RIGHT_ARROW"]){d.focus(this.titleNode);b.stopEvent(a)}},focus:function(a){this.disabled||d.focus(a=="start"?this.titleNode:this._popupStateNode)}});
b.declare("dijit.form.ToggleButton",d.form.Button,{baseClass:"dijitToggleButton",checked:false,attributeMap:b.mixin(b.clone(d.form.Button.prototype.attributeMap),{checked:"focusNode"}),_clicked:function(){this.set("checked",!this.checked)},_setCheckedAttr:function(a,c){this._set("checked",a);b.attr(this.focusNode||this.domNode,"checked",a);d.setWaiState(this.focusNode||this.domNode,"pressed",a);this._handleOnChange(a,c)},setChecked:function(a){b.deprecated("setChecked("+a+") is deprecated. Use set('checked',"+
a+") instead.","","2.0");this.set("checked",a)},reset:function(){this._hasBeenBlurred=false;this.set("checked",this.params.checked||false)}});return d.form.Button});define("dijit/form/DropDownButton",["dojo","dijit","dijit/form/Button"],function(b,d){return d.form.DropDownButton});
define("orion/commands",["dojo","dijit","orion/util","dijit/Menu","dijit/form/DropDownButton","dijit/MenuItem","dijit/PopupMenuItem","dijit/MenuSeparator"],function(b,d,a){function c(h){this._domScope={};this._objectScope={};this._globalScope={};this._namedGroups={};this._activeBindings={};this._init(h)}function e(h){this._init(h)}function f(h,i,l,o,q){this.keyCode=typeof h==="string"?h.toUpperCase().charCodeAt(0):h;this.mod1=i!==undefined&&i!==null?i:false;this.mod2=l!==undefined&&l!==null?l:false;
this.mod3=o!==undefined&&o!==null?o:false;this.mod4=q!==undefined&&q!==null?q:false}c.prototype={_init:function(h){this._registry=h.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.page.command",this);this._selection=h.selection;b.connect(window.document,"onkeydown",b.hitch(this,function(i){i=i||window.event;var l=i.target.nodeName.toLowerCase();if(l==="input")switch(i.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(l===
"textarea")return;this._processKey(i)}))},_processKey:function(h){function i(x){if(window.document.all)x.keyCode=0;else{x.preventDefault();x.stopPropagation()}}for(var l in this._activeBindings)if(this._activeBindings[l]&&this._activeBindings[l].keyBinding&&this._activeBindings[l].command)if(this._activeBindings[l].keyBinding.match(h)){var o=this._activeBindings[l],q=o.command;if(q.hrefCallback){i(h);h=q.hrefCallback.call(o.handler||window,o.items,l,o.userData);h.then?h.then(function(x){window.open(x)}):
window.open(h);return}else if(q.callback){i(h);window.setTimeout(function(){q.callback.call(o.handler||window,o.items,l,null,o.userData)},0);return}}},getSelectionService:function(){return this._selection},showKeyBindings:function(h){for(var i in this._activeBindings)this._activeBindings[i]&&this._activeBindings[i].keyBinding&&this._activeBindings[i].command&&b.place("<span>"+a.getUserKeyString(this._activeBindings[i].keyBinding)+" = "+this._activeBindings[i].command.name+"<br></span>",h,"last")},
addCommand:function(h,i){switch(i){case "dom":this._domScope[h.id]=h;break;case "object":this._objectScope[h.id]=h;break;case "global":this._globalScope[h.id]=h;break;default:throw"unrecognized command scope "+i;}},addCommandGroup:function(h,i,l,o,q){var x=this._namedGroups;if(o)x=this._createEntryForPath(o);if(x[h]){if(l)x[h].title=l;if(i)x[h].position=i;if(q)x[h].scopeId=q}else{x[h]={title:l,position:i,children:{},scopeId:q};x.sortedCommands=null}},_createEntryForPath:function(h){var i=this._namedGroups;
if(h){h=h.split("/");for(var l=0;l<h.length;l++)if(h[l].length>1){i[h[l]]||(i[h[l]]={position:0,children:{}});i=i[h[l]].children}}return i},registerCommandContribution:function(h,i,l,o,q,x){o=this._createEntryForPath(o);o[h]={scopeId:l,position:i};if(q)if(i=this._domScope[h]||this._globalScope[h])this._activeBindings[h]={command:i,keyBinding:q,keyOnly:x};o.sortedCommands=null},_isLastChildSeparator:function(h,i){if(i==="image")return h.childNodes.length>0&&b.hasClass(h.childNodes[h.childNodes.length-
1],"commandSeparator");if(i==="menu"){h=h.getChildren();return h.length>0&&h[h.length-1]instanceof d.MenuSeparator}return false},renderCommands:function(h,i,l,o,q,x,t,r){if(typeof h==="string")h=b.byId(h);if(l){var s;if(i==="object")s=this._objectScope;else if(i==="dom")s=this._domScope;else if(i==="global")s=this._globalScope;else throw"Unrecognized command scope "+i;this._render(this._namedGroups,h,i,l,o,q,x,t,s,r);if(q==="image")this._isLastChildSeparator(h,q)&&h.removeChild(h.childNodes[h.childNodes.length-
1]);else if(q==="menu")if(this._isLastChildSeparator(h,q)){l=h.getChildren()[h.getChildren().length-1];h.removeChild(l);l.destroy()}}else{var y=this;this._selection&&this._selection.getSelections(function(w){y.renderCommands(h,i,w,o,q,x,t,r)})}},_render:function(h,i,l,o,q,x,t,r,s,y){var w=h.sortedCommands;if(!w){w=[];for(var g in h){var k=h[g];if(k&&typeof k.position==="number"){k.id=g;w.push(k)}}w.sort(function(A,C){return A.position-C.position});h.sortedCommands=w}for(h=0;h<w.length;h++){var m;
if(w[h].children){g=w[h];if(!(g.scopeId&&i.id!==g.scopeId)){var n;if(x==="image")if(g.title){k=new d.Menu({style:"display: none;"});k.eclipseScopeId=i.eclipseScopeId||i.id;this._render(w[h].children,k,l,o,q,"menu",t,r,s,y);n=k.getChildren();if(this._isLastChildSeparator(k,"menu")){m=n[n.length-1];k.removeChild(m);m.destroy();n=k.getChildren()}if(n.length>0){var p=true;m=n[0].eclipseCommand;if(n.length===1)p=!(m&&m.hasImage());if(p){m=new d.form.DropDownButton({label:g.title,dropDown:k});b.addClass(m.domNode,
"commandLink");t&&b.addClass(m.domNode,t);b.place(m.domNode,i,"last")}else{k="image"+m.id+h;g=m._asImage(k,o,q,r,y);b.place(g,i,"last")}}}else{var u;if(i.childNodes.length>0&&!this._isLastChildSeparator(i,x)){u=this.generateSeparatorImage();b.place(u,i,"last")}this._render(w[h].children,i,l,o,q,x,t,r,s,y);if(i.childNodes.length>0)if(i.childNodes[i.childNodes.length-1]!==u){u=this.generateSeparatorImage();b.place(u,i,"last")}}else if(g.title){k=new d.Menu;this._render(w[h].children,k,l,o,q,x,t,r,s,
y);k.getChildren().length>0&&i.addChild(new d.PopupMenuItem({label:g.title,popup:k}))}else{var v;if(i.getChildren().length>0&&!this._isLastChildSeparator(i,x)){v=new d.MenuSeparator;i.addChild(v)}this._render(w[h].children,i,l,o,q,x,t,r,s,y);g=i.getChildren();if(g[g.length-1]!==v){v=new d.MenuSeparator;i.addChild(v)}}}}else{k=(g=s[w[h].id])?true:false;if(g){if(l==="dom")k=x==="image"?i.id===w[h].scopeId:x==="menu"?i.eclipseScopeId===w[h].scopeId:false;if(this._activeBindings[g.id]&&this._activeBindings[g.id].keyBinding){m=
this._activeBindings[g.id];m.items=o;m.userData=r;m.handler=q;if(m.keyOnly)k=false}if(k&&g.visibleWhen)k=g.visibleWhen(o)}if(k)if(g.choiceCallback){k=new d.Menu({style:"display: none;"});if(x==="image"){m=new d.form.DropDownButton({label:g.name,dropDown:k});if(g.image){b.addClass(m.iconNode,"commandImage");t&&b.addClass(m.iconNode,t);m.iconNode.src=g.image}b.place(m.domNode,i,"last");m.eclipseCommand=g;m.eclipseChoices=k;b.connect(m,"onClick",m,function(){this.eclipseCommand.populateChoicesMenu(this.eclipseChoices,
o,q,r)})}else if(x==="menu"){m=new d.PopupMenuItem({label:g.name,popup:k});i.addChild(m);m.eclipseCommand=g;m.eclipseChoices=k;b.connect(i,"_openPopup",m,function(){this.eclipseCommand.populateChoicesMenu(this.eclipseChoices,o,q,r)})}}else if(x==="image"){k="image"+g.id+h;g=g._asImage(k,o,q,r,t,y);b.place(g,i,"last")}else x==="menu"&&g._addMenuItem(i,o,q,r,t)}}},generateSeparatorImage:function(){var h=new Image;h.src="/images/sep.gif";b.addClass(h,"commandImage");b.addClass(h,"commandSeparator");
return h}};c.prototype.constructor=c;e.prototype={_init:function(h){this.id=h.id;this.name=h.name||"Empty Command";this.tooltip=h.tooltip||h.name;this.callback=h.callback;this.hrefCallback=h.hrefCallback;this.choiceCallback=h.choiceCallback;this.image=h.image||"/images/none.png";this.visibleWhen=h.visibleWhen;this._deviceSupportsHover=false},_asImage:function(h,i,l,o,q,x){l=l||this;var t=new Image,r=b.create("a");r.id=this.name+"link";t.alt=this.name;t.title=this.name;t.name=h;t.id=h;if(x||!this.hasImage()){h=
window.document.createTextNode(this.name);b.place(h,r,"last")}if(this.hrefCallback){h=this.hrefCallback.call(l,i,this.id,o);if(h.then)h.then(function(s){r.href=s});else r.href=h}else if(this.callback)!x&&this.hasImage()?b.connect(t,"onclick",this,function(){this.callback.call(l,i,this.id,t.id,o)}):b.connect(r,"onclick",this,function(){this.callback.call(l,i,this.id,r.id,o)});if(!x&&this.hasImage()){if(this._deviceSupportsHover){t.src="/images/none.png";b.connect(t,"onmouseover",this,function(){t.src=
this.image});b.connect(t,"onmouseout",this,function(){t.src="/images/none.png"})}else{t.src=this.image;b.connect(t,"onmouseover",this,function(){b.addClass(t,"commandOver")});b.connect(t,"onmouseout",this,function(){t.src=this.image;b.removeClass(t,"commandOver")})}b.addClass(t,"commandImage");q&&b.addClass(t,q);b.place(t,r,"last")}b.addClass(r,"commandLink");q&&b.addClass(r,q);return r},_asLink:function(h,i,l){i=i||this;var o=window.document.createElement("a");b.place(window.document.createTextNode(this.name),
o,"only");o.href="";o.id=this.id+"link";if(this.callback)b.connect(o,"onclick",this,function(){this.callback.call(i,h,this.id,o.id)});else if(this.hrefCallback){var q=this.hrefCallback.call(i,h,this.id);if(q)if(q.then)q.then(function(x){o.href=x});else o.href=q}b.addClass(o,"commandLink");l&&b.addClass(o,l);return o},_addMenuItem:function(h,i,l,o,q){var x=new d.MenuItem({labelType:this.hrefCallback?"html":"text",label:this.name,tooltip:this.tooltip});if(this.hrefCallback){var t=this.hrefCallback.call(l,
i,this.id,h.id,o);if(t)if(t.then)t.then(b.hitch(this,function(r){x.set("label","<a href='"+r+"'>"+this.name+"</a>");x.onClick=function(s){a.followLink(r,s)}}));else{x.set("label","<a href='"+t+"'>"+this.name+"</a>");x.onClick=function(r){a.followLink(t,r)}}}else if(this.callback)x.onClick=b.hitch(this,function(){this.callback.call(l,i,this.id,null,o)});x.eclipseCommand=this;h.addChild(x);if(this.image){b.addClass(x.iconNode,"commandImage");q&&b.addClass(x.iconNode,q);x.iconNode.src=this.image}},populateChoicesMenu:function(h,
i,l,o){h.focusedChild=null;b.forEach(h.getChildren(),function(t){h.removeChild(t);t.destroy()});l=this.getChoices(i,l,o);for(o=0;o<l.length;o++){var q=l[o],x;if(q.name){x=new d.MenuItem({label:q.name,onClick:this.makeChoiceCallback(q,i)});if(q.image){b.addClass(x.iconNode,"commandImage");x.iconNode.src=q.image}}else x=new d.MenuSeparator;h.addChild(x)}},getChoices:function(h,i,l){if(this.choiceCallback)return this.choiceCallback.call(i,h,l);return null},makeChoiceCallback:function(h,i){return function(l){h.callback&&
h.callback.call(h,i,l)}},hasImage:function(){return this.image!=="/images/none.png"}};e.prototype.constructor=e;var j=window.navigator.platform.indexOf("Mac")!==-1;f.prototype={match:function(h){if(this.keyCode===h.keyCode){if(this.mod1!==(j?h.metaKey:h.ctrlKey))return false;if(this.mod2!==h.shiftKey)return false;if(this.mod3!==h.altKey)return false;if(j&&this.mod4!==h.ctrlKey)return false;return true}return false},equals:function(h){if(!h)return false;if(this.keyCode!==h.keyCode)return false;if(this.mod1!==
h.mod1)return false;if(this.mod2!==h.mod2)return false;if(this.mod3!==h.mod3)return false;if(this.mod4!==h.mod4)return false;return true}};f.prototype.constructor=f;return{CommandService:c,CommandKeyBinding:f,Command:e}});var orion=orion||{};orion.textview=orion.textview||{};
orion.textview.KeyBinding=function(){function b(a,c,e,f,j){this.keyCode=typeof a==="string"?a.toUpperCase().charCodeAt(0):a;this.mod1=c!==undefined&&c!==null?c:false;this.mod2=e!==undefined&&e!==null?e:false;this.mod3=f!==undefined&&f!==null?f:false;this.mod4=j!==undefined&&j!==null?j:false}var d=window.navigator.platform.indexOf("Mac")!==-1;b.prototype={match:function(a){if(this.keyCode===a.keyCode){if(this.mod1!==(d?a.metaKey:a.ctrlKey))return false;if(this.mod2!==a.shiftKey)return false;if(this.mod3!==
a.altKey)return false;if(d&&this.mod4!==a.ctrlKey)return false;return true}return false},equals:function(a){if(!a)return false;if(this.keyCode!==a.keyCode)return false;if(this.mod1!==a.mod1)return false;if(this.mod2!==a.mod2)return false;if(this.mod3!==a.mod3)return false;if(this.mod4!==a.mod4)return false;return true}};return b}();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(b){b.getObject("dnd",true,b);b.dnd.getCopyKeyState=b.isCopyKey;b.dnd._uniqueId=0;b.dnd.getUniqueId=function(){var d;do d=b._scopeName+"Unique"+ ++b.dnd._uniqueId;while(b.byId(d));return d};b.dnd._empty={};b.dnd.isFormElement=function(d){d=d.target;if(d.nodeType==3)d=d.parentNode;return" button textarea input select option ".indexOf(" "+d.tagName.toLowerCase()+" ")>=0};return b.dnd});
define("dojo/dnd/autoscroll",["dojo","dojo/window"],function(b){b.getObject("dnd",true,b);b.dnd.getViewport=b.window.getBox;b.dnd.V_TRIGGER_AUTOSCROLL=32;b.dnd.H_TRIGGER_AUTOSCROLL=32;b.dnd.V_AUTOSCROLL_VALUE=16;b.dnd.H_AUTOSCROLL_VALUE=16;b.dnd.autoScroll=function(d){var a=b.window.getBox(),c=0,e=0;if(d.clientX<b.dnd.H_TRIGGER_AUTOSCROLL)c=-b.dnd.H_AUTOSCROLL_VALUE;else if(d.clientX>a.w-b.dnd.H_TRIGGER_AUTOSCROLL)c=b.dnd.H_AUTOSCROLL_VALUE;if(d.clientY<b.dnd.V_TRIGGER_AUTOSCROLL)e=-b.dnd.V_AUTOSCROLL_VALUE;
else if(d.clientY>a.h-b.dnd.V_TRIGGER_AUTOSCROLL)e=b.dnd.V_AUTOSCROLL_VALUE;window.scrollBy(c,e)};b.dnd._validNodes={div:1,p:1,td:1};b.dnd._validOverflow={auto:1,scroll:1};b.dnd.autoScrollNodes=function(d){for(var a=d.target;a;){if(a.nodeType==1&&a.tagName.toLowerCase()in b.dnd._validNodes){var c=b.getComputedStyle(a);if(c.overflow.toLowerCase()in b.dnd._validOverflow){var e=b._getContentBox(a,c);c=b.position(a,true);var f=Math.min(b.dnd.H_TRIGGER_AUTOSCROLL,e.w/2),j=Math.min(b.dnd.V_TRIGGER_AUTOSCROLL,
e.h/2),h=d.pageX-c.x,i=d.pageY-c.y,l=c=0;if(b.isWebKit||b.isOpera){h+=b.body().scrollLeft;i+=b.body().scrollTop}if(h>0&&h<e.w)if(h<f)c=-f;else if(h>e.w-f)c=f;if(i>0&&i<e.h)if(i<j)l=-j;else if(i>e.h-j)l=j;e=a.scrollLeft;f=a.scrollTop;a.scrollLeft+=c;a.scrollTop+=l;if(e!=a.scrollLeft||f!=a.scrollTop)return}}try{a=a.parentNode}catch(o){a=null}}b.dnd.autoScroll(d)};return b.dnd});
define("dojo/dnd/Mover",["dojo","dojo/dnd/common","dojo/dnd/autoscroll"],function(b){b.declare("dojo.dnd.Mover",null,{constructor:function(d,a,c){this.node=b.byId(d);var e=a.touches?a.touches[0]:a;this.marginBox={l:e.pageX,t:e.pageY};this.mouseButton=a.button;a=this.host=c;d=d.ownerDocument;this.events=[b.connect(d,"onmousemove",this,"onFirstMove"),b.connect(d,"ontouchmove",this,"onFirstMove"),b.connect(d,"onmousemove",this,"onMouseMove"),b.connect(d,"ontouchmove",this,"onMouseMove"),b.connect(d,
"onmouseup",this,"onMouseUp"),b.connect(d,"ontouchend",this,"onMouseUp"),b.connect(d,"ondragstart",b.stopEvent),b.connect(d.body,"onselectstart",b.stopEvent)];a&&a.onMoveStart&&a.onMoveStart(this)},onMouseMove:function(d){b.dnd.autoScroll(d);var a=this.marginBox,c=d.touches?d.touches[0]:d;this.host.onMove(this,{l:a.l+c.pageX,t:a.t+c.pageY},d);b.stopEvent(d)},onMouseUp:function(d){if(b.isWebKit&&b.isMac&&this.mouseButton==2?d.button==0:this.mouseButton==d.button)this.destroy();b.stopEvent(d)},onFirstMove:function(d){var a=
this.node.style,c,e=this.host;switch(a.position){case "relative":case "absolute":c=Math.round(parseFloat(a.left))||0;a=Math.round(parseFloat(a.top))||0;break;default:a.position="absolute";a=b.marginBox(this.node);c=b.doc.body;var f=b.getComputedStyle(c),j=b._getMarginBox(c,f);f=b._getContentBox(c,f);c=a.l-(f.l-j.l);a=a.t-(f.t-j.t);break}this.marginBox.l=c-this.marginBox.l;this.marginBox.t=a-this.marginBox.t;e&&e.onFirstMove&&e.onFirstMove(this,d);b.disconnect(this.events.shift());b.disconnect(this.events.shift())},
destroy:function(){b.forEach(this.events,b.disconnect);var d=this.host;d&&d.onMoveStop&&d.onMoveStop(this);this.events=this.node=this.host=null}});return b.dnd.Mover});
define("dojo/dnd/Moveable",["dojo","dojo/dnd/Mover"],function(b){b.declare("dojo.dnd.Moveable",null,{handle:"",delay:0,skip:false,constructor:function(d,a){this.node=b.byId(d);a||(a={});this.handle=a.handle?b.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:b.dnd.Mover;this.events=[b.connect(this.handle,"onmousedown",this,"onMouseDown"),b.connect(this.handle,"ontouchstart",this,"onMouseDown"),b.connect(this.handle,
"ondragstart",this,"onSelectStart"),b.connect(this.handle,"onselectstart",this,"onSelectStart")]},markupFactory:function(d,a){return new b.dnd.Moveable(a,d)},destroy:function(){b.forEach(this.events,b.disconnect);this.events=this.node=this.handle=null},onMouseDown:function(d){if(!(this.skip&&b.dnd.isFormElement(d))){if(this.delay){this.events.push(b.connect(this.handle,"onmousemove",this,"onMouseMove"),b.connect(this.handle,"ontouchmove",this,"onMouseMove"),b.connect(this.handle,"onmouseup",this,
"onMouseUp"),b.connect(this.handle,"ontouchend",this,"onMouseUp"));var a=d.touches?d.touches[0]:d;this._lastX=a.pageX;this._lastY=a.pageY}else this.onDragDetected(d);b.stopEvent(d)}},onMouseMove:function(d){var a=d.touches?d.touches[0]:d;if(Math.abs(a.pageX-this._lastX)>this.delay||Math.abs(a.pageY-this._lastY)>this.delay){this.onMouseUp(d);this.onDragDetected(d)}b.stopEvent(d)},onMouseUp:function(d){for(var a=0;a<2;++a)b.disconnect(this.events.pop());b.stopEvent(d)},onSelectStart:function(d){if(!this.skip||
!b.dnd.isFormElement(d))b.stopEvent(d)},onDragDetected:function(d){new this.mover(this.node,d,this)},onMoveStart:function(d){b.publish("/dnd/move/start",[d]);b.addClass(b.body(),"dojoMove");b.addClass(this.node,"dojoMoveItem")},onMoveStop:function(d){b.publish("/dnd/move/stop",[d]);b.removeClass(b.body(),"dojoMove");b.removeClass(this.node,"dojoMoveItem")},onFirstMove:function(){},onMove:function(d,a){this.onMoving(d,a);var c=d.node.style;c.left=a.l+"px";c.top=a.t+"px";this.onMoved(d,a)},onMoving:function(){},
onMoved:function(){}});return b.dnd.Moveable});
define("dojo/dnd/move",["dojo","dojo/dnd/Mover","dojo/dnd/Moveable"],function(b){b.declare("dojo.dnd.move.constrainedMoveable",b.dnd.Moveable,{constraints:function(){},within:false,markupFactory:function(d,a){return new b.dnd.move.constrainedMoveable(a,d)},constructor:function(d,a){a||(a={});this.constraints=a.constraints;this.within=a.within},onFirstMove:function(d){var a=this.constraintBox=this.constraints.call(this,d);a.r=a.l+a.w;a.b=a.t+a.h;if(this.within){d=b._getMarginSize(d.node);a.r-=d.w;
a.b-=d.h}},onMove:function(d,a){var c=this.constraintBox,e=d.node.style;this.onMoving(d,a);a.l=a.l<c.l?c.l:c.r<a.l?c.r:a.l;a.t=a.t<c.t?c.t:c.b<a.t?c.b:a.t;e.left=a.l+"px";e.top=a.t+"px";this.onMoved(d,a)}});b.declare("dojo.dnd.move.boxConstrainedMoveable",b.dnd.move.constrainedMoveable,{box:{},markupFactory:function(d,a){return new b.dnd.move.boxConstrainedMoveable(a,d)},constructor:function(d,a){var c=a&&a.box;this.constraints=function(){return c}}});b.declare("dojo.dnd.move.parentConstrainedMoveable",
b.dnd.move.constrainedMoveable,{area:"content",markupFactory:function(d,a){return new b.dnd.move.parentConstrainedMoveable(a,d)},constructor:function(d,a){var c=a&&a.area;this.constraints=function(){var e=this.node.parentNode,f=b.getComputedStyle(e),j=b._getMarginBox(e,f);if(c=="margin")return j;var h=b._getMarginExtents(e,f);j.l+=h.l;j.t+=h.t;j.w-=h.w;j.h-=h.h;if(c=="border")return j;h=b._getBorderExtents(e,f);j.l+=h.l;j.t+=h.t;j.w-=h.w;j.h-=h.h;if(c=="padding")return j;h=b._getPadExtents(e,f);j.l+=
h.l;j.t+=h.t;j.w-=h.w;j.h-=h.h;return j}}});b.dnd.constrainedMover=b.dnd.move.constrainedMover;b.dnd.boxConstrainedMover=b.dnd.move.boxConstrainedMover;b.dnd.parentConstrainedMover=b.dnd.move.parentConstrainedMover;return b.dnd.move});
define("dojo/dnd/TimedMoveable",["dojo","dojo/dnd/Moveable"],function(b){(function(){var d=b.dnd.Moveable.prototype.onMove;b.declare("dojo.dnd.TimedMoveable",b.dnd.Moveable,{timeout:40,constructor:function(a,c){c||(c={});if(c.timeout&&typeof c.timeout=="number"&&c.timeout>=0)this.timeout=c.timeout},markupFactory:function(a,c){return new b.dnd.TimedMoveable(c,a)},onMoveStop:function(a){if(a._timer){clearTimeout(a._timer);d.call(this,a,a._leftTop)}b.dnd.Moveable.prototype.onMoveStop.apply(this,arguments)},
onMove:function(a,c){a._leftTop=c;if(!a._timer){var e=this;a._timer=setTimeout(function(){a._timer=null;d.call(e,a,a._leftTop)},this.timeout)}}})})();return b.dnd.TimedMoveable});
define("dojo/fx/Toggler",["dojo"],function(b){b.declare("dojo.fx.Toggler",null,{node:null,showFunc:b.fadeIn,hideFunc:b.fadeOut,showDuration:200,hideDuration:200,constructor:function(d){var a=this;b.mixin(a,d);a.node=d.node;a._showArgs=b.mixin({},d);a._showArgs.node=a.node;a._showArgs.duration=a.showDuration;a.showAnim=a.showFunc(a._showArgs);a._hideArgs=b.mixin({},d);a._hideArgs.node=a.node;a._hideArgs.duration=a.hideDuration;a.hideAnim=a.hideFunc(a._hideArgs);b.connect(a.showAnim,"beforeBegin",b.hitch(a.hideAnim,
"stop",true));b.connect(a.hideAnim,"beforeBegin",b.hitch(a.showAnim,"stop",true))},show:function(d){return this.showAnim.play(d||0)},hide:function(d){return this.hideAnim.play(d||0)}});return b.fx.Toggler});
define("dojo/fx",["dojo","dojo/fx/Toggler"],function(b){(function(){var d={_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;b.forEach(this._animations,function(f){this.duration+=f.duration;if(f.delay)this.duration+=f.delay},this)};b.extend(a,{_onAnimate:function(){this._fire("onAnimate",arguments)},_onEnd:function(){b.disconnect(this._onAnimateCtx);b.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=b.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx=b.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 j=b.connect(this._current,"beforeBegin",this,
function(){this._fire("beforeBegin")}),h=b.connect(this._current,"onBegin",this,function(){this._fire("onBegin",arguments)}),i=b.connect(this._current,"onPlay",this,function(){this._fire("onPlay",arguments);b.disconnect(j);b.disconnect(h);b.disconnect(i)});this._onAnimateCtx&&b.disconnect(this._onAnimateCtx);this._onAnimateCtx=b.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx&&b.disconnect(this._onEndCtx);this._onEndCtx=b.connect(this._current,"onEnd",this,"_onEnd");this._current.play.apply(this._current,
arguments);return this},pause:function(){if(this._current){var e=b.connect(this._current,"onPause",this,function(){this._fire("onPause",arguments);b.disconnect(e)});this._current.pause()}return this},gotoPercent:function(e,f){this.pause();var j=this.duration*e;this._current=null;b.some(this._animations,function(h){if(h.duration<=j){this._current=h;return true}j-=h.duration;return false});this._current&&this._current.gotoPercent(j/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=b.connect(this._current,"onStop",this,function(){this._fire("onStop",arguments);b.disconnect(f)});this._current.stop()}return this},status:function(){return this._current?this._current.status():"stopped"},destroy:function(){this._onAnimateCtx&&b.disconnect(this._onAnimateCtx);this._onEndCtx&&b.disconnect(this._onEndCtx)}});b.extend(a,d);b.fx.chain=function(e){return new a(e)};
var c=function(e){this._animations=e||[];this._connects=[];this.duration=this._finished=0;b.forEach(e,function(j){var h=j.duration;if(j.delay)h+=j.delay;if(this.duration<h)this.duration=h;this._connects.push(b.connect(j,"onEnd",this,"_onEnd"))},this);this._pseudoAnimation=new b.Animation({curve:[0,1],duration:this.duration});var f=this;b.forEach(["beforeBegin","onBegin","onPlay","onAnimate","onPause","onStop","onEnd"],function(j){f._connects.push(b.connect(f._pseudoAnimation,j,function(){f._fire(j,
arguments)}))})};b.extend(c,{_doAction:function(e,f){b.forEach(this._animations,function(j){j[e].apply(j,f)});return this},_onEnd:function(){++this._finished>this._animations.length&&this._fire("onEnd")},_call:function(e,f){var j=this._pseudoAnimation;j[e].apply(j,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 j=
this.duration*e;b.forEach(this._animations,function(h){h.gotoPercent(h.duration<j?1:j/h.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(){b.forEach(this._connects,b.disconnect)}});b.extend(c,d);b.fx.combine=function(e){return new c(e)};b.fx.wipeIn=function(e){var f=e.node=b.byId(e.node),j=f.style,h;e=b.animateProperty(b.mixin({properties:{height:{start:function(){h=
j.overflow;j.overflow="hidden";if(j.visibility=="hidden"||j.display=="none"){j.height="1px";j.display="";j.visibility="";return 1}else{var i=b.style(f,"height");return Math.max(i,1)}},end:function(){return f.scrollHeight}}}},e));b.connect(e,"onEnd",function(){j.height="auto";j.overflow=h});return e};b.fx.wipeOut=function(e){var f=(e.node=b.byId(e.node)).style,j;e=b.animateProperty(b.mixin({properties:{height:{end:1}}},e));b.connect(e,"beforeBegin",function(){j=f.overflow;f.overflow="hidden";f.display=
""});b.connect(e,"onEnd",function(){f.overflow=j;f.height="auto";f.display="none"});return e};b.fx.slideTo=function(e){var f=null,j=null,h=function(i){return function(){var l=b.getComputedStyle(i),o=l.position;f=o=="absolute"?i.offsetTop:parseInt(l.top)||0;j=o=="absolute"?i.offsetLeft:parseInt(l.left)||0;if(o!="absolute"&&o!="relative"){l=b.position(i,true);f=l.y;j=l.x;i.style.position="absolute";i.style.top=f+"px";i.style.left=j+"px"}}}(e.node=b.byId(e.node));h();e=b.animateProperty(b.mixin({properties:{top:e.top||
0,left:e.left||0}},e));b.connect(e,"beforeBegin",e,h);return e}})();return b.fx});
define("dijit/form/_FormMixin",["dojo","dijit","dojo/window"],function(b,d){b.declare("dijit.form._FormMixin",null,{state:"",reset:function(){b.forEach(this.getDescendants(),function(a){a.reset&&a.reset()})},validate:function(){var a=false;return b.every(b.map(this.getDescendants(),function(c){c._hasBeenBlurred=true;var e=c.disabled||!c.validate||c.validate();if(!e&&!a){b.window.scrollIntoView(c.containerNode||c.domNode);c.focus();a=true}return e}),function(c){return c})},setValues:function(a){b.deprecated(this.declaredClass+
"::setValues() is deprecated. Use set('value', val) instead.","","2.0");return this.set("value",a)},_setValueAttr:function(a){var c={};b.forEach(this.getDescendants(),function(h){if(h.name)(c[h.name]||(c[h.name]=[])).push(h)});for(var e in c)if(c.hasOwnProperty(e)){var f=c[e],j=b.getObject(e,false,a);if(j!==undefined){b.isArray(j)||(j=[j]);if(typeof f[0].checked=="boolean")b.forEach(f,function(h){h.set("value",b.indexOf(j,h.value)!=-1)});else f[0].multiple?f[0].set("value",j):b.forEach(f,function(h,
i){h.set("value",j[i])})}}},getValues:function(){b.deprecated(this.declaredClass+"::getValues() is deprecated. Use get('value') instead.","","2.0");return this.get("value")},_getValueAttr:function(){var a={};b.forEach(this.getDescendants(),function(c){var e=c.name;if(!(!e||c.disabled)){var f=c.get("value");if(typeof c.checked=="boolean")if(/Radio/.test(c.declaredClass))if(f!==false)b.setObject(e,f,a);else{f=b.getObject(e,false,a);f===undefined&&b.setObject(e,null,a)}else{c=b.getObject(e,false,a);
if(!c){c=[];b.setObject(e,c,a)}f!==false&&c.push(f)}else{c=b.getObject(e,false,a);if(typeof c!="undefined")b.isArray(c)?c.push(f):b.setObject(e,[c,f],a);else b.setObject(e,f,a)}}});return a},isValid:function(){return this.state==""},onValidStateChange:function(){},_getState:function(){var a=b.map(this._descendants,function(c){return c.get("state")||""});return b.indexOf(a,"Error")>=0?"Error":b.indexOf(a,"Incomplete")>=0?"Incomplete":""},disconnectChildren:function(){b.forEach(this._childConnections||
[],b.hitch(this,"disconnect"));b.forEach(this._childWatches||[],function(a){a.unwatch()})},connectChildren:function(a){var c=this;this.disconnectChildren();this._descendants=this.getDescendants();a=a?function(h,i){c[h]=i}:b.hitch(this,"_set");a("value",this.get("value"));a("state",this._getState());var e=this._childConnections=[],f=this._childWatches=[];b.forEach(b.filter(this._descendants,function(h){return h.validate}),function(h){b.forEach(["state","disabled"],function(i){f.push(h.watch(i,function(){c.set("state",
c._getState())}))})});var j=function(){c._onChangeDelayTimer&&clearTimeout(c._onChangeDelayTimer);c._onChangeDelayTimer=setTimeout(function(){delete c._onChangeDelayTimer;c._set("value",c.get("value"))},10)};b.forEach(b.filter(this._descendants,function(h){return h.onChange}),function(h){e.push(c.connect(h,"onChange",j));f.push(h.watch("disabled",j))})},startup:function(){this.inherited(arguments);this.connectChildren(true);this.watch("state",function(a,c,e){this.onValidStateChange(e=="")})},destroy:function(){this.disconnectChildren();
this.inherited(arguments)}});return d.form._FormMixin});
define("dijit/_DialogMixin",["dojo","dijit","dijit/_Widget"],function(b,d){b.declare("dijit._DialogMixin",null,{attributeMap:d._Widget.prototype.attributeMap,execute:function(){},onCancel:function(){},onExecute:function(){},_onSubmit:function(){this.onExecute();this.execute(this.get("value"))},_getFocusItems:function(){var a=d._getTabNavigable(this.containerNode);this._firstFocusItem=a.lowest||a.first||this.closeButtonNode||this.domNode;this._lastFocusItem=a.last||a.highest||this._firstFocusItem}});
return d._DialogMixin});
define("dijit/DialogUnderlay",["dojo","dijit","dojo/window","dijit/_Widget","dijit/_Templated"],function(b,d){b.declare("dijit.DialogUnderlay",[d._Widget,d._Templated],{templateString:"<div class='dijitDialogUnderlayWrapper'><div class='dijitDialogUnderlay' dojoAttachPoint='node'></div></div>",dialogId:"","class":"",attributeMap:{id:"domNode"},_setDialogIdAttr:function(a){b.attr(this.node,"id",a+"_underlay");this._set("dialogId",a)},_setClassAttr:function(a){this.node.className="dijitDialogUnderlay "+
a;this._set("class",a)},postCreate:function(){b.body().appendChild(this.domNode)},layout:function(){var a=this.node.style,c=this.domNode.style;c.display="none";var e=b.window.getBox();c.top=e.t+"px";c.left=e.l+"px";a.width=e.w+"px";a.height=e.h+"px";c.display="block"},show:function(){this.domNode.style.display="block";this.layout();this.bgIframe=new d.BackgroundIframe(this.domNode)},hide:function(){this.bgIframe.destroy();delete this.bgIframe;this.domNode.style.display="none"}});return d.DialogUnderlay});
define("dijit/layout/_LayoutWidget",["dojo","dijit","dijit/_Widget","dijit/_Container","dijit/_Contained"],function(b,d){b.declare("dijit.layout._LayoutWidget",[d._Widget,d._Container,d._Contained],{baseClass:"dijitLayoutContainer",isLayoutContainer:true,buildRendering:function(){this.inherited(arguments);b.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(b.isIE?
this.domNode:b.global,"onresize",function(){this.resize()})}}},resize:function(a,c){var e=this.domNode;if(a){b.marginBox(e,a);if(a.t)e.style.top=a.t+"px";if(a.l)e.style.left=a.l+"px"}c=c||{};b.mixin(c,a||{});if(!("h"in c)||!("w"in c))c=b.mixin(b.marginBox(e),c);a=b.getComputedStyle(e);var f=b._getMarginExtents(e,a),j=b._getBorderExtents(e,a);c=this._borderBox={w:c.w-(f.w+j.w),h:c.h-(f.h+j.h)};f=b._getPadExtents(e,a);this._contentBox={l:b._toPixelValue(e,a.paddingLeft),t:b._toPixelValue(e,a.paddingTop),
w:c.w-f.w,h:c.h-f.h};this.layout()},layout:function(){},_setupChild:function(a){b.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){b.removeClass(a.domNode,this.baseClass+"-child"+(a.baseClass?" "+this.baseClass+"-"+a.baseClass:""));this.inherited(arguments)}});d.layout.marginBox2contentBox=function(a,c){var e=b.getComputedStyle(a),f=b._getMarginExtents(a,
e),j=b._getPadBorderExtents(a,e);return{l:b._toPixelValue(a,e.paddingLeft),t:b._toPixelValue(a,e.paddingTop),w:c.w-(f.w+j.w),h:c.h-(f.h+j.h)}};(function(){var a=function(e){return e.substring(0,1).toUpperCase()+e.substring(1)},c=function(e,f){var j=e.resize?e.resize(f):b.marginBox(e.domNode,f);if(j)b.mixin(e,j);else{b.mixin(e,b.marginBox(e.domNode));b.mixin(e,f)}};d.layout.layoutChildren=function(e,f,j,h,i){f=b.mixin({},f);b.addClass(e,"dijitLayoutContainer");j=b.filter(j,function(l){return l.region!=
"center"&&l.layoutAlign!="client"}).concat(b.filter(j,function(l){return l.region=="center"||l.layoutAlign=="client"}));b.forEach(j,function(l){var o=l.domNode,q=l.region||l.layoutAlign,x=o.style;x.left=f.l+"px";x.top=f.t+"px";x.position="absolute";b.addClass(o,"dijitAlign"+a(q));o={};if(h&&h==l.id)o[l.region=="top"||l.region=="bottom"?"h":"w"]=i;if(q=="top"||q=="bottom"){o.w=f.w;c(l,o);f.h-=l.h;if(q=="top")f.t+=l.h;else x.top=f.t+f.h+"px"}else if(q=="left"||q=="right"){o.h=f.h;c(l,o);f.w-=l.w;if(q==
"left")f.l+=l.w;else x.left=f.l+f.w+"px"}else if(q=="client"||q=="center")c(l,f)})}})();return d.layout._LayoutWidget});
define("dijit/layout/_ContentPaneResizeMixin",["dojo","dijit","dijit/_Contained","dijit/layout/_LayoutWidget"],function(b,d){b.declare("dijit.layout._ContentPaneResizeMixin",null,{doLayout:true,isContainer:true,isLayoutContainer:true,_startChildren:function(){b.forEach(this.getChildren(),function(a){a.startup();a._started=true})},startup:function(){if(!this._started){var a=d._Contained.prototype.getParent.call(this);this._childOfLayoutWidget=a&&a.isLayoutContainer;this._needLayout=!this._childOfLayoutWidget;
this.inherited(arguments);this._startChildren();this._isShown()&&this._onShow();this._childOfLayoutWidget||this.connect(b.isIE?this.domNode:b.global,"onresize",function(){this._needLayout=!this._childOfLayoutWidget;this.resize()})}},_checkIfSingleChild:function(){var a=b.query("> *",this.containerNode).filter(function(f){return f.tagName!=="SCRIPT"}),c=a.filter(function(f){return b.hasAttr(f,"data-dojo-type")||b.hasAttr(f,"dojoType")||b.hasAttr(f,"widgetId")}),e=b.filter(c.map(d.byNode),function(f){return f&&
f.domNode&&f.resize});if(a.length==c.length&&e.length==1)this._singleChild=e[0];else delete this._singleChild;b.toggleClass(this.containerNode,this.baseClass+"SingleChild",!!this._singleChild)},resize:function(a,c){!this._wasShown&&this.open!==false&&this._onShow();this._resizeCalled=true;this._scheduleLayout(a,c)},_scheduleLayout:function(a,c){if(this._isShown())this._layout(a,c);else{this._needLayout=true;this._changeSize=a;this._resultSize=c}},_layout:function(a,c){a&&b.marginBox(this.domNode,
a);var e=this.containerNode;if(e===this.domNode){c=c||{};b.mixin(c,a||{});if(!("h"in c)||!("w"in c))c=b.mixin(b.marginBox(e),c);this._contentBox=d.layout.marginBox2contentBox(e,c)}else this._contentBox=b.contentBox(e);this._layoutChildren();delete this._needLayout},_layoutChildren:function(){this.doLayout&&this._checkIfSingleChild();if(this._singleChild&&this._singleChild.resize){var a=this._contentBox||b.contentBox(this.containerNode);this._singleChild.resize({w:a.w,h:a.h})}else b.forEach(this.getChildren(),
function(c){c.resize&&c.resize()})},_isShown:function(){if(this._childOfLayoutWidget){if(this._resizeCalled&&"open"in this)return this.open;return this._resizeCalled}else if("open"in this)return this.open;else{var a=this.domNode,c=this.domNode.parentNode;return a.style.display!="none"&&a.style.visibility!="hidden"&&!b.hasClass(a,"dijitHidden")&&c&&c.style&&c.style.display!="none"}},_onShow:function(){this._needLayout&&this._layout(this._changeSize,this._resultSize);this.inherited(arguments);this._wasShown=
true}});return d.layout._ContentPaneResizeMixin});
define("dojo/html",["dojo","dojo/parser"],function(b){b.getObject("html",true,b);(function(){var d=0;b.html._secureForInnerHtml=function(a){return a.replace(/(?:\s*<!DOCTYPE\s[^>]+>|<title[^>]*>[\s\S]*?<\/title>)/ig,"")};b.html._emptyNode=b.empty;b.html._setNodeContent=function(a,c){b.empty(a);if(c){if(typeof c=="string")c=b._toDom(c,a.ownerDocument);if(!c.nodeType&&b.isArrayLike(c))for(var e=c.length,f=0;f<c.length;f=e==c.length?f+1:0)b.place(c[f],a,"last");else b.place(c,a,"last")}return a};b.declare("dojo.html._ContentSetter",
null,{node:"",content:"",id:"",cleanContent:false,extractContent:false,parseContent:false,parserScope:b._scopeName,startup:true,constructor:function(a,c){b.mixin(this,a||{});c=this.node=b.byId(this.node||c);if(!this.id)this.id=["Setter",c?c.id||c.tagName:"",d++].join("_")},set:function(a,c){if(undefined!==a)this.content=a;c&&this._mixin(c);this.onBegin();this.setContent();this.onEnd();return this.node},setContent:function(){var a=this.node;if(!a)throw new Error(this.declaredClass+": setContent given no node");
try{a=b.html._setNodeContent(a,this.content)}catch(c){var e=this.onContentError(c);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){b.forEach(this.parseResults,function(a){a.destroy&&a.destroy()});delete this.parseResults}b.html._emptyNode(this.node)},onBegin:function(){var a=this.content;if(b.isString(a)){if(this.cleanContent)a=b.html._secureForInnerHtml(a);
if(this.extractContent){var c=a.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(c)a=c[1]}}this.empty();this.content=a;return this.node},onEnd:function(){this.parseContent&&this._parse();return this.node},tearDown:function(){delete this.parseResults;delete this.node;delete this.content},onContentError:function(a){return"Error occured setting content: "+a},_mixin:function(a){var c={},e;for(e in a)e in c||(this[e]=a[e])},_parse:function(){var a=this.node;try{var c={};b.forEach(["dir","lang","textDir"],
function(f){if(this[f])c[f]=this[f]},this);this.parseResults=b.parser.parse({rootNode:a,noStart:!this.startup,inherited:c,scope:this.parserScope})}catch(e){this._onError("Content",e,"Error parsing in _ContentSetter#"+this.id)}},_onError:function(a,c,e){a=this["on"+a+"Error"].call(this,c);if(e)console.error(e,c);else a&&b.html._setNodeContent(this.node,a,true)}});b.html.set=function(a,c,e){if(undefined==c){console.warn("dojo.html.set: no cont argument provided, using empty string");c=""}return e?(new b.html._ContentSetter(b.mixin(e,
{content:c,node:a}))).set():b.html._setNodeContent(a,c,true)}})();return b.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(b,d){b.declare("dijit.layout.ContentPane",[d._Widget,d.layout._ContentPaneResizeMixin],{href:"",extractContent:false,parseOnLoad:true,parserScope:b._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:b.delegate(d._Widget.prototype.attributeMap,{title:[]}),stopParser:true,template:false,create:function(a,c){if((!a||!a.template)&&c&&!("href"in a)&&!("content"in a)){var e=b.doc.createDocumentFragment();for(c=b.byId(c);c.firstChild;)e.appendChild(c.firstChild);a=b.delegate(a,{content:e})}this.inherited(arguments,[a,c])},postMixInProperties:function(){this.inherited(arguments);var a=b.i18n.getLocalization("dijit",
"loading",this.lang);this.loadingMessage=b.string.substitute(this.loadingMessage,a);this.errorMessage=b.string.substitute(this.errorMessage,a)},buildRendering:function(){this.inherited(arguments);if(!this.containerNode)this.containerNode=this.domNode;this.domNode.title="";b.attr(this.domNode,"role")||d.setWaiRole(this.domNode,"group")},_startChildren:function(){this.inherited(arguments);this._contentSetter&&b.forEach(this._contentSetter.parseResults,function(a){if(!a._started&&!a._destroyed&&b.isFunction(a.startup)){a.startup();
a._started=true}},this)},setHref:function(a){b.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 b.Deferred(b.hitch(this,"cancel"));this.onLoadDeferred.addCallback(b.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){b.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 b.Deferred(b.hitch(this,"cancel"));this._created&&this.onLoadDeferred.addCallback(b.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 b.Deferred(b.hitch(this,"cancel"));this.onLoadDeferred.addCallback(b.hitch(this,"onLoad"));this._load();return this.onLoadDeferred},_load:function(){this._setContent(this.onDownloadStart(),
true);var a=this,c={preventCache:this.preventCache||this.refreshOnShow,url:this.href,handleAs:"text"};b.isObject(this.ioArgs)&&b.mixin(c,this.ioArgs);var e=this._xhrDfd=(this.ioMethod||b.xhrGet)(c);e.addCallback(function(f){try{a._isDownloaded=true;a._setContent(f,false);a.onDownloadEnd()}catch(j){a._onError("Content",j)}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(c){console.error("Error "+this.widgetId+" running custom onLoad code: "+c.message)}},_onUnloadHandler:function(){this._set("isLoaded",false);try{this.onUnload()}catch(a){console.error("Error "+this.widgetId+" running custom onUnload code: "+a.message)}},destroyDescendants:function(){this.isLoaded&&this._onUnloadHandler();var a=this._contentSetter;b.forEach(this.getChildren(),function(c){c.destroyRecursive&&c.destroyRecursive()});if(a){b.forEach(a.parseResults,
function(c){c.destroyRecursive&&c.domNode&&c.domNode.parentNode==b.body()&&c.destroyRecursive()});delete a.parseResults}b.html._emptyNode(this.containerNode);delete this._singleChild},_setContent:function(a,c){this.destroyDescendants();var e=this._contentSetter;if(!(e&&e instanceof b.html._ContentSetter))e=this._contentSetter=new b.html._ContentSetter({node:this.containerNode,_onError:b.hitch(this,this._onError),onContentError:b.hitch(this,function(j){j=this.onContentError(j);try{this.containerNode.innerHTML=
j}catch(h){console.error("Fatal "+this.id+" could not change content due to "+h.message,h)}})});var f=b.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(b.isObject(a)&&a.domNode?a.domNode:a,f);delete this._contentSetterParams;this.doLayout&&this._checkIfSingleChild();if(!c){if(this._started){this._startChildren();this._scheduleLayout()}this._onLoadHandler(a)}},
_onError:function(a,c,e){this.onLoadDeferred.errback(c);a=this["on"+a+"Error"].call(this,c);if(e)console.error(e,c);else a&&this._setContent(a,true)},onLoad:function(){},onUnload:function(){},onDownloadStart:function(){return this.loadingMessage},onContentError:function(){},onDownloadError:function(){return this.errorMessage},onDownloadEnd:function(){}});return d.layout.ContentPane});
define("dijit/nls/common",{root:{buttonOk:"OK",buttonCancel:"Cancel",buttonSave:"Save",itemClose:"Close"},zh:true,"zh-tw":true,tr:true,th:true,sv:true,sl:true,sk:true,ru:true,ro:true,pt:true,"pt-pt":true,pl:true,nl:true,nb:true,ko:true,kk:true,ja:true,it:true,hu:true,he:true,fr:true,fi:true,es:true,el:true,de:true,da:true,cs:true,ca:true,ar:true});define("text!dijit/templates/TooltipDialog.html",function(){return'<div role="presentation" tabIndex="-1">\n\t<div class="dijitTooltipContainer" role="presentation">\n\t\t<div class ="dijitTooltipContents dijitTooltipFocusNode" dojoAttachPoint="containerNode" role="dialog"></div>\n\t</div>\n\t<div class="dijitTooltipConnector" role="presentation"></div>\n</div>'});
define("dijit/TooltipDialog",["dojo","dijit","text!dijit/templates/TooltipDialog.html","dijit/layout/ContentPane","dijit/_Templated","dijit/form/_FormMixin","dijit/_DialogMixin"],function(b,d){b.declare("dijit.TooltipDialog",[d.layout.ContentPane,d._Templated,d.form._FormMixin,d._DialogMixin],{title:"",doLayout:false,autofocus:true,baseClass:"dijitTooltipDialog",_firstFocusItem:null,_lastFocusItem:null,templateString:b.cache("dijit","templates/TooltipDialog.html"),_setTitleAttr:function(a){this.containerNode.title=
a;this._set("title",a)},postCreate:function(){this.inherited(arguments);this.connect(this.containerNode,"onkeypress","_onKey")},orient:function(a,c,e){a="dijitTooltipAB"+(e.charAt(1)=="L"?"Left":"Right")+" dijitTooltip"+(e.charAt(0)=="T"?"Below":"Above");b.replaceClass(this.domNode,a,this._currentOrientClass||"");this._currentOrientClass=a},focus:function(){this._getFocusItems(this.containerNode);d.focus(this._firstFocusItem)},onOpen:function(a){this.orient(this.domNode,a.aroundCorner,a.corner);this._onShow()},
onClose:function(){this.onHide()},_onKey:function(a){var c=a.target,e=b.keys;a.charOrCode===e.TAB&&this._getFocusItems(this.containerNode);var f=this._firstFocusItem==this._lastFocusItem;if(a.charOrCode==e.ESCAPE){setTimeout(b.hitch(this,"onCancel"),0);b.stopEvent(a)}else if(c==this._firstFocusItem&&a.shiftKey&&a.charOrCode===e.TAB){f||d.focus(this._lastFocusItem);b.stopEvent(a)}else if(c==this._lastFocusItem&&a.charOrCode===e.TAB&&!a.shiftKey){f||d.focus(this._firstFocusItem);b.stopEvent(a)}else a.charOrCode===
e.TAB&&a.stopPropagation()}});return d.TooltipDialog});
define("dijit/Dialog",["dojo","dijit","text!dijit/templates/Dialog.html","dojo/dnd/move","dojo/dnd/TimedMoveable","dojo/fx","dojo/window","dijit/_Widget","dijit/_Templated","dijit/_CssStateMixin","dijit/form/_FormMixin","dijit/_DialogMixin","dijit/DialogUnderlay","dijit/layout/ContentPane","i18n!dijit/nls/common","dijit/TooltipDialog"],function(b,d){b.declare("dijit._DialogBase",[d._Templated,d.form._FormMixin,d._DialogMixin,d._CssStateMixin],{templateString:b.cache("dijit","templates/Dialog.html"),
baseClass:"dijitDialog",cssStateNodes:{closeButtonNode:"dijitDialogCloseIcon"},attributeMap:b.delegate(d._Widget.prototype.attributeMap,{title:[{node:"titleNode",type:"innerHTML"},{node:"titleBar",type:"attribute"}],"aria-describedby":""}),open:false,duration:d.defaultDuration,refocus:true,autofocus:true,_firstFocusItem:null,_lastFocusItem:null,doLayout:false,draggable:true,"aria-describedby":"",postMixInProperties:function(){var a=b.i18n.getLocalization("dijit","common");b.mixin(this,a);this.inherited(arguments)},
postCreate:function(){b.style(this.domNode,{display:"none",position:"absolute"});b.body().appendChild(this.domNode);this.inherited(arguments);this.connect(this,"onExecute","hide");this.connect(this,"onCancel","hide");this._modalconnects=[]},onLoad:function(){this._position();if(this.autofocus&&d._DialogLevelManager.isTop(this)){this._getFocusItems(this.domNode);d.focus(this._firstFocusItem)}this.inherited(arguments)},_endDrag:function(a){if(a&&a.node&&a.node===this.domNode)this._relativePosition=
b.position(a.node)},_setup:function(){var a=this.domNode;if(this.titleBar&&this.draggable){this._moveable=b.isIE==6?new b.dnd.TimedMoveable(a,{handle:this.titleBar}):new b.dnd.Moveable(a,{handle:this.titleBar,timeout:0});this._dndListener=b.subscribe("/dnd/move/stop",this,"_endDrag")}else b.addClass(a,"dijitDialogFixed");this.underlayAttrs={dialogId:this.id,"class":b.map(this["class"].split(/\s/),function(c){return c+"_underlay"}).join(" ")}},_size:function(){this._checkIfSingleChild();if(this._singleChild){if(this._singleChildOriginalStyle)this._singleChild.domNode.style.cssText=
this._singleChildOriginalStyle;delete this._singleChildOriginalStyle}else b.style(this.containerNode,{width:"auto",height:"auto"});var a=b._getMarginSize(this.domNode),c=b.window.getBox();if(a.w>=c.w||a.h>=c.h){var e=Math.min(a.w,Math.floor(c.w*0.75));a=Math.min(a.h,Math.floor(c.h*0.75));if(this._singleChild&&this._singleChild.resize){this._singleChildOriginalStyle=this._singleChild.domNode.style.cssText;this._singleChild.resize({w:e,h:a})}else b.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(!b.hasClass(b.body(),"dojoMove")){var a=this.domNode,c=b.window.getBox(),e=this._relativePosition,f=e?null:b._getBorderBox(a),j=Math.floor(c.l+(e?e.x:(c.w-f.w)/2));c=Math.floor(c.t+(e?e.y:(c.h-f.h)/2));b.style(a,{left:j+"px",top:c+"px"})}},_onKey:function(a){if(a.charOrCode){var c=b.keys,e=a.target;a.charOrCode===c.TAB&&this._getFocusItems(this.domNode);var f=
this._firstFocusItem==this._lastFocusItem;if(e==this._firstFocusItem&&a.shiftKey&&a.charOrCode===c.TAB){f||d.focus(this._lastFocusItem);b.stopEvent(a)}else if(e==this._lastFocusItem&&a.charOrCode===c.TAB&&!a.shiftKey){f||d.focus(this._firstFocusItem);b.stopEvent(a)}else{for(;e;){if(e==this.domNode||b.hasClass(e,"dijitPopup"))if(a.charOrCode==c.ESCAPE)this.onCancel();else return;e=e.parentNode}if(a.charOrCode!==c.TAB)b.stopEvent(a);else if(!b.isOpera)try{this._firstFocusItem.focus()}catch(j){}}}},
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(b.connect(window,"onscroll",this,"layout"));this._modalconnects.push(b.connect(window,"onresize",this,function(){var c=b.window.getBox();if(!this._oldViewport||c.h!=this._oldViewport.h||c.w!=this._oldViewport.w){this.layout();this._oldViewport=c}}));this._modalconnects.push(b.connect(this.domNode,
"onkeypress",this,"_onKey"));b.style(this.domNode,{opacity:0,display:""});this._set("open",true);this._onShow();this._size();this._position();var a;this._fadeInDeferred=new b.Deferred(b.hitch(this,function(){a.stop();delete this._fadeInDeferred}));a=b.fadeIn({node:this.domNode,duration:this.duration,beforeBegin:b.hitch(this,function(){d._DialogLevelManager.show(this,this.underlayAttrs)}),onEnd:b.hitch(this,function(){if(this.autofocus&&d._DialogLevelManager.isTop(this)){this._getFocusItems(this.domNode);
d.focus(this._firstFocusItem)}this._fadeInDeferred.callback(true);delete this._fadeInDeferred})}).play();return this._fadeInDeferred}},hide:function(){if(this._alreadyInitialized){this._fadeInDeferred&&this._fadeInDeferred.cancel();var a;this._fadeOutDeferred=new b.Deferred(b.hitch(this,function(){a.stop();delete this._fadeOutDeferred}));a=b.fadeOut({node:this.domNode,duration:this.duration,onEnd:b.hitch(this,function(){this.domNode.style.display="none";d._DialogLevelManager.hide(this);this.onHide();
this._fadeOutDeferred.callback(true);delete this._fadeOutDeferred})}).play();if(this._scrollConnected)this._scrollConnected=false;b.forEach(this._modalconnects,b.disconnect);this._modalconnects=[];this._relativePosition&&delete this._relativePosition;this._set("open",false);return this._fadeOutDeferred}},layout:function(){if(this.domNode.style.display!="none"){d._underlay&&d._underlay.layout();this._position()}},destroy:function(){this._fadeInDeferred&&this._fadeInDeferred.cancel();this._fadeOutDeferred&&
this._fadeOutDeferred.cancel();this._moveable&&this._moveable.destroy();this._dndListener&&b.unsubscribe(this._dndListener);b.forEach(this._modalconnects,b.disconnect);d._DialogLevelManager.hide(this);this.inherited(arguments)}});b.declare("dijit.Dialog",[d.layout.ContentPane,d._DialogBase],{});d._DialogLevelManager={show:function(a,c){var e=d._dialogStack;e[e.length-1].focus=d.getFocus(a);var f=d._underlay;if(!f||f._destroyed)f=d._underlay=new d.DialogUnderlay(c);else f.set(a.underlayAttrs);var j=
e[e.length-1].dialog?e[e.length-1].zIndex+2:950;e.length==1&&f.show();b.style(d._underlay.domNode,"zIndex",j-1);b.style(a.domNode,"zIndex",j);e.push({dialog:a,underlayAttrs:c,zIndex:j})},hide:function(a){var c=d._dialogStack;if(c[c.length-1].dialog==a){c.pop();var e=c[c.length-1];if(c.length==1)d._underlay._destroyed||d._underlay.hide();else{b.style(d._underlay.domNode,"zIndex",e.zIndex-1);d._underlay.set(e.underlayAttrs)}if(a.refocus){c=e.focus;if(!c||e.dialog&&!b.isDescendant(c.node,e.dialog.domNode)){e.dialog._getFocusItems(e.dialog.domNode);
c=e.dialog._firstFocusItem}try{d.focus(c)}catch(f){}}}else{e=b.indexOf(b.map(c,function(j){return j.dialog}),a);e!=-1&&c.splice(e,1)}},isTop:function(a){var c=d._dialogStack;return c[c.length-1].dialog==a}};d._dialogStack=[{dialog:null,focus:null,underlayAttrs:null}];return d.Dialog});define("text!orion/widgets/templates/OpenResourceDialog.html",function(){return'<div dojoAttachPoint="containerNode">\n\t<div dojoAttachPoint="dialog" dojoType="dijit.Dialog" title="${title}" widgetsInTemplate="true">\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","text!orion/widgets/templates/OpenResourceDialog.html"],function(b,d){return b.declare("orion.widgets.OpenResourceDialog",[d._Widget,d._Templated],{widgetsInTemplate:true,templateString:b.cache("orion","widgets/templates/OpenResourceDialog.html"),SEARCH_DELAY:500,timeoutId:null,time:null,searchLocation:null,searcher:null,constructor:function(){this.inherited(arguments);this.timeoutId=null;this.time=0;this.searchLocation=
arguments[0]&&arguments[0].SearchLocation;this.searcher=arguments[0]&&arguments[0].searcher;if(!this.searchLocation)throw new Error("Missing required argument: SearchLocation");if(!this.searcher)throw new Error("Missing required argument: searcher");},postMixInProperties:function(){this.inherited(arguments);this.title="Open Resource";this.selectFile="Type the name of a file to open (? = any character, * = any string):";this.searchPlaceHolder="Search"},postCreate:function(){this.inherited(arguments);
b.connect(this.resourceName,"onChange",this,function(){this.time=+new Date;clearTimeout(this.timeoutId);this.timeoutId=setTimeout(b.hitch(this,this.checkSearch),0)});b.connect(this.resourceName,"onKeyPress",this,function(a){if(a.keyCode===b.keys.ENTER&&this.results){a=b.query("a",this.results);if(a.length>0){window.open(a[0].href);this.dialog.hide()}}});b.connect(this.dialog,"onMouseUp",function(a){a.target.focus()});b.connect(this.dialog,"onHide",this,function(){this.onHide()});this.dialog.refocus=
false},checkSearch:function(){clearTimeout(this.timeoutId);var a=+new Date;if(a-this.time>this.SEARCH_DELAY){this.time=a;this.doSearch()}else this.timeoutId=setTimeout(b.hitch(this,arguments.callee),50)},doSearch:function(){var a=this.resourceName&&this.resourceName.get("value");if(a){b.place("<div>Searching&#x2026;</div>",this.results,"only");var c=this;setTimeout(function(){var e=a+=/\*$/.test(a)?"":"*";c.searcher.search(c.results,c.searchLocation+"Name:"+e,false,false,b.hitch(c,c.decorateResult),
true)},0)}},decorateResult:function(a){var c=this;b.query("a",a).forEach(function(e){b.connect(e,"onmouseup",function(f){!b.mouseButtons.isMiddle(f)&&!b.isCopyKey(f)&&c.dialog.hide()})})},show:function(){this.dialog.show();this.resourceName.focus()},onHide:function(){clearTimeout(this.timeoutId);setTimeout(b.hitch(this,function(){this.dialog.destroyRecursive();this.destroyRecursive()}),this.dialog.duration)}})});
define("orion/globalCommands",["dojo","dijit","orion/commands","orion/util","orion/textview/keyBinding","dijit/Menu","dijit/MenuItem","dijit/form/DropDownButton","orion/widgets/OpenResourceDialog"],function(b,d,a,c,e){function f(q,x){var t=b.byId("userInfo");if(t){b.addClass(t,"globalActions");var r=d.byId("userMenu");r&&r.destroy();b.empty(t);if(q){c.setUserName(q);r=new d.Menu({style:"display: none;",id:"userMenu"});var s=new d.MenuItem({label:"Profile",onClick:b.hitch(this,function(){window.location=
"/profile/user-profile.html#/users/"+q})});r.addChild(s);s=new d.MenuItem({label:"Sign out",onClick:logout});r.addChild(s);x=new d.form.DropDownButton({label:q,dropDown:r,title:x});b.addClass(x.domNode,"commandImage");b.place(x.domNode,t,"last")}else{x=document.createElement("span");x.appendChild(document.createTextNode("Sign in"));x.onclick=function(){login()};x.id="signOutUser";t.appendChild(x);b.addClass(x,"commandLink")}o=null}else o={userName:q,userStatusText:x}}function j(q,x,t,r){var s=b.byId("pageActions");
if(t)s=b.byId(t);if(s){b.empty(s);q.renderCommands(s,"dom",x,x,"image",null,null,!r)}}function h(q,x,t,r,s,y,w,g){var k;r=b.byId(q);if(!r)throw"could not find banner parent, id was "+q;b.place(i,r,"only");b.place('<div id="keyAssist" class="keyAssistFloat"></div>',document.body,"last");var m=b.byId("primaryNav");if(m)for(var n=x.getServiceReferences("orion.page.link"),p=0;p<n.length;p++)x.getService(n[p]).then(function(){for(var C={},D=n[p].getPropertyNames(),E=0;E<D.length;E++)C[D[E]]=n[p].getProperty(D[E]);
if(C.href&&C.name){D=b.create("a",{href:C.href},m,"last");b.addClass(D,"commandLink");k=document.createTextNode(C.name);b.place(k,D,"only")}});var u=b.byId("search");if(!u)throw"failed to generate HTML for banner";b.connect(u,"onkeypress",function(C){if(C.charOrCode===b.keys.ENTER)if(u.value.length>0)window.location="/search/search.html#"+("/filesearch?q="+u.value)});if(q=b.byId("pageTitle")){k=document.createTextNode(document.title);b.place(k,q,"last")}var v=function(C,D,E){var F=new orion.widgets.OpenResourceDialog({SearchLocation:C,
searcher:D});E&&b.connect(F,"onHide",function(){E.getTextView().focus()});window.setTimeout(function(){F.show()},0)};q=new a.Command({name:"Find File Named...",id:"eclipse.openResource",callback:function(){v("/filesearch?q=",s,w)}});if(w){w.getTextView().setKeyBinding(new e.KeyBinding("r",true,true,false),"Find File Named...");w.getTextView().setAction("Find File Named...",function(){v("/filesearch?q=",s,w);return true})}t.addCommand(q,"global");t.registerCommandContribution("eclipse.openResource",
1,"globalActions",null,new a.CommandKeyBinding("t"),true);var A=b.byId("keyAssist");b.connect(document,"onkeypress",b.hitch(this,function(C){if(C.charOrCode===b.keys.ESCAPE)A.style.display="none"}));g&&g.addHandler({isActive:function(){return A.style.display==="block"},cancel:function(){if(this.isActive()){A.style.display="none";return true}return false}});g=new a.Command({name:"Show Keys",id:"eclipse.keyAssist",callback:function(){b.empty(A);if(w){b.place("<h2>Editor</h2>",A,"last");for(var C=w.getTextView().getActions(false),
D=0;D<C.length;D++)for(var E=C[D],F=w.getTextView().getKeyBindings(E),J=0;J<F.length;J++)b.place("<span>"+c.getUserKeyString(F[J])+" = "+E+"<br></span>",A,"last")}b.place("<h2>Global</h2>",A,"last");t.showKeyBindings(A);A.style.display="block";return true}});t.addCommand(g,"global");t.registerCommandContribution("eclipse.keyAssist",1,"globalActions",null,new a.CommandKeyBinding(191,false,true),true);if(w){w.getTextView().setKeyBinding(new a.CommandKeyBinding("L",true,true),"Show Keys");w.getTextView().setAction("Show Keys",
g.callback)}if(g=b.byId("globalActions")){b.empty(g);t.renderCommands(g,"global",y||{},y,"image")}o&&f(o.userName,o.userStatusText);if(l)(y=b.byId("footer"))&&b.place(l,y,"only")}var i='<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="/index.html"><img class="toolbarLabel" src="/images/orion.gif" 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="/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></td></tr></table>',
l='<img src="http://dev.eclipse.org/small_icons/emblems/emblem-important.png"/> 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=e4&component=Orion&version=0.2">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>',
o=null;return{generateUserInfo:f,generateDomCommandsInBanner:j,generateBanner:h}});
define("dojo/date",["dojo"],function(b){b.getObject("date",true,b);b.date.getDaysInMonth=function(d){var a=d.getMonth();if(a==1&&b.date.isLeapYear(d))return 29;return[31,28,31,30,31,30,31,31,30,31,30,31][a]};b.date.isLeapYear=function(d){d=d.getFullYear();return!(d%400)||!(d%4)&&!!(d%100)};b.date.getTimezoneName=function(d){var a=d.toString(),c="",e=a.indexOf("(");if(e>-1)c=a.substring(++e,a.indexOf(")"));else{e=/([A-Z\/]+) \d{4}$/;if(a=a.match(e))c=a[1];else{a=d.toLocaleString();e=/ ([A-Z\/]+)$/;
if(a=a.match(e))c=a[1]}}return c=="AM"||c=="PM"?"":c};b.date.compare=function(d,a,c){d=new Date(+d);a=new Date(+(a||new Date));if(c=="date"){d.setHours(0,0,0,0);a.setHours(0,0,0,0)}else if(c=="time"){d.setFullYear(0,0,0);a.setFullYear(0,0,0)}if(d>a)return 1;if(d<a)return-1;return 0};b.date.add=function(d,a,c){var e=new Date(+d),f=false,j="Date";switch(a){case "day":break;case "weekday":var h;if(a=c%5){a=a;h=parseInt(c/5)}else{a=c>0?5:-5;h=c>0?(c-5)/5:(c+5)/5}var i=d.getDay(),l=0;if(i==6&&c>0)l=1;
else if(i==0&&c<0)l=-1;i=i+a;if(i==0||i==6)l=c>0?2:-2;c=7*h+a+l;break;case "year":j="FullYear";f=true;break;case "week":c*=7;break;case "quarter":c*=3;case "month":f=true;j="Month";break;default:j="UTC"+a.charAt(0).toUpperCase()+a.substring(1)+"s"}j&&e["set"+j](e["get"+j]()+c);f&&e.getDate()<d.getDate()&&e.setDate(0);return e};b.date.difference=function(d,a,c){a=a||new Date;c=c||"day";var e=a.getFullYear()-d.getFullYear(),f=1;switch(c){case "quarter":d=d.getMonth();a=a.getMonth();d=Math.floor(d/3)+
1;a=Math.floor(a/3)+1;a+=e*4;f=a-d;break;case "weekday":e=Math.round(b.date.difference(d,a,"day"));c=parseInt(b.date.difference(d,a,"week"));f=e%7;if(f==0)e=c*5;else{var j=0,h=d.getDay();a=a.getDay();c=parseInt(e/7);f=e%7;d=new Date(d);d.setDate(d.getDate()+c*7);d=d.getDay();if(e>0)switch(true){case h==6:j=-1;break;case h==0:j=0;break;case a==6:j=-1;break;case a==0:j=-2;break;case d+f>5:j=-2}else if(e<0)switch(true){case h==6:j=0;break;case h==0:j=1;break;case a==6:j=2;break;case a==0:j=1;break;case d+
f<0:j=2}e+=j;e-=c*2}f=e;break;case "year":f=e;break;case "month":f=a.getMonth()-d.getMonth()+e*12;break;case "week":f=parseInt(b.date.difference(d,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()-d.getTime()}return Math.round(f)};return b.date});
define("dojo/cldr/supplemental",["dojo","dojo/i18n"],function(b){b.getObject("cldr.supplemental",true,b);b.cldr.supplemental.getFirstDayOfWeek=function(d){d={mv:5,ae:6,af:6,bh:6,dj:6,dz:6,eg:6,er:6,et:6,iq:6,ir:6,jo:6,ke:6,kw:6,ly:6,ma:6,om:6,qa:6,sa:6,sd:6,so:6,sy:6,tn:6,ye:6,ar:0,as:0,az:0,bw:0,ca:0,cn:0,fo:0,ge:0,gl:0,gu:0,hk:0,il:0,"in":0,jm:0,jp:0,kg:0,kr:0,la:0,mh:0,mn:0,mo:0,mp:0,mt:0,nz:0,ph:0,pk:0,sg:0,th:0,tt:0,tw:0,um:0,us:0,uz:0,vi:0,zw:0}[b.cldr.supplemental._region(d)];return d===undefined?
1:d};b.cldr.supplemental._region=function(d){d=b.i18n.normalizeLocale(d);d=d.split("-");var a=d[1];if(a){if(a.length==4)a=d[2]}else a={de:"de",en:"us",es:"es",fi:"fi",fr:"fr",he:"il",hu:"hu",it:"it",ja:"jp",ko:"kr",nl:"nl",pt:"br",sv:"se",zh:"cn"}[d[0]];return a};b.cldr.supplemental.getWeekend=function(d){var a=b.cldr.supplemental._region(d);d={"in":0,af:4,dz:4,ir:4,om:4,sa:4,ye:4,ae:5,bh:5,eg:5,il:5,iq:5,jo:5,kw:5,ly:5,ma:5,qa:5,sd:5,sy:5,tn:5}[a];a={af:5,dz:5,ir:5,om:5,sa:5,ye:5,ae:6,bh:5,eg:6,
il:6,iq:6,jo:6,kw:6,ly:6,ma:6,qa:6,sd:6,sy:6,tn:6}[a];if(d===undefined)d=6;if(a===undefined)a=0;return{start:d,end:a}};return b.cldr.supplemental});
define("dojo/regexp",["dojo"],function(b){b.getObject("regexp",true,b);b.regexp.escapeString=function(d,a){return d.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,function(c){if(a&&a.indexOf(c)!=-1)return c;return"\\"+c})};b.regexp.buildGroupRE=function(d,a,c){if(!(d instanceof Array))return a(d);for(var e=[],f=0;f<d.length;f++)e.push(a(d[f]));return b.regexp.group(e.join("|"),c)};b.regexp.group=function(d,a){return"("+(a?"?:":"")+d+")"};return b.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(b){b.getObject("date.locale",true,b);(function(){function d(e,f,j,h){return h.replace(/([a-z])\1*/ig,function(i){var l,o,q=i.charAt(0);i=i.length;var x=["abbr","wide","narrow"];switch(q){case "G":l=f[i<4?"eraAbbr":"eraNames"][e.getFullYear()<0?0:1];break;case "y":l=e.getFullYear();switch(i){case 1:break;case 2:if(!j.fullYear){l=String(l);l=l.substr(l.length-
2);break}default:o=true}break;case "Q":case "q":l=Math.ceil((e.getMonth()+1)/3);o=true;break;case "M":l=e.getMonth();if(i<3){l=l+1;o=true}else{q=["months-format",x[i-3]].join("-");l=f[q][l]}break;case "w":l=b.date.locale._getWeekOfYear(e,0);o=true;break;case "d":l=e.getDate();o=true;break;case "D":l=b.date.locale._getDayOfYear(e);o=true;break;case "E":l=e.getDay();if(i<3){l=l+1;o=true}else{q=["days-format",x[i-3]].join("-");l=f[q][l]}break;case "a":l=e.getHours()<12?"am":"pm";l=j[l]||f["dayPeriods-format-wide-"+
l];break;case "h":case "H":case "K":case "k":o=e.getHours();switch(q){case "h":l=o%12||12;break;case "H":l=o;break;case "K":l=o%12;break;case "k":l=o||24;break}o=true;break;case "m":l=e.getMinutes();o=true;break;case "s":l=e.getSeconds();o=true;break;case "S":l=Math.round(e.getMilliseconds()*Math.pow(10,i-3));o=true;break;case "v":case "z":if(l=b.date.locale._getZone(e,true,j))break;i=4;case "Z":l=b.date.locale._getZone(e,false,j);l=[l<=0?"+":"-",b.string.pad(Math.floor(Math.abs(l)/60),2),b.string.pad(Math.abs(l)%
60,2)];if(i==4){l.splice(0,0,"GMT");l.splice(3,0,":")}l=l.join("");break;default:throw new Error("dojo.date.locale.format: invalid pattern char: "+h);}if(o)l=b.string.pad(l,i);return l})}function a(e,f,j,h){var i=function(q){return q};f=f||i;j=j||i;h=h||i;var l=e.match(/(''|[^'])+/g),o=e.charAt(0)=="'";b.forEach(l,function(q,x){if(q){l[x]=(o?j:f)(q.replace(/''/g,"'"));o=!o}else l[x]=""});return h(l.join(""))}function c(e,f,j,h){h=b.regexp.escapeString(h);j.strict||(h=h.replace(" a"," ?a"));return h.replace(/([a-z])\1*/ig,
function(i){var l;l=i.charAt(0);var o=i.length,q="",x="";if(j.strict){if(o>1)q="0{"+(o-1)+"}";if(o>2)x="0{"+(o-2)+"}"}else{q="0?";x="0{0,2}"}switch(l){case "y":l="\\d{2,4}";break;case "M":l=o>2?"\\S+?":"1[0-2]|"+q+"[1-9]";break;case "D":l="[12][0-9][0-9]|3[0-5][0-9]|36[0-6]|"+x+"[1-9][0-9]|"+q+"[1-9]";break;case "d":l="3[01]|[12]\\d|"+q+"[1-9]";break;case "w":l="[1-4][0-9]|5[0-3]|"+q+"[1-9]";break;case "E":l="\\S+";break;case "h":l="1[0-2]|"+q+"[1-9]";break;case "k":l="1[01]|"+q+"\\d";break;case "H":l=
"1\\d|2[0-3]|"+q+"\\d";break;case "K":l="1\\d|2[0-4]|"+q+"[1-9]";break;case "m":case "s":l="[0-5]\\d";break;case "S":l="\\d{"+o+"}";break;case "a":o=j.am||f["dayPeriods-format-wide-am"];q=j.pm||f["dayPeriods-format-wide-pm"];l=o+"|"+q;if(!j.strict){if(o!=o.toLowerCase())l+="|"+o.toLowerCase();if(q!=q.toLowerCase())l+="|"+q.toLowerCase();if(l.indexOf(".")!=-1)l+="|"+l.replace(/\./g,"")}l=l.replace(/\./g,"\\.");break;default:l=".*"}e&&e.push(i);return"("+l+")"}).replace(/[\xa0 ]/g,"[\\s\\xa0]")}b.date.locale._getZone=
function(e,f){return f?b.date.getTimezoneName(e):e.getTimezoneOffset()};b.date.locale.format=function(e,f){f=f||{};var j=b.i18n.normalizeLocale(f.locale),h=f.formatLength||"short";j=b.date.locale._getGregorianBundle(j);var i=[];e=b.hitch(this,d,e,j,f);if(f.selector=="year")return a(j["dateFormatItem-yyyy"]||"yyyy",e);var l;if(f.selector!="date")(l=f.timePattern||j["timeFormat-"+h])&&i.push(a(l,e));if(f.selector!="time")(l=f.datePattern||j["dateFormat-"+h])&&i.push(a(l,e));return i.length==1?i[0]:
j["dateTimeFormat-"+h].replace(/\{(\d+)\}/g,function(o,q){return i[q]})};b.date.locale.regexp=function(e){return b.date.locale._parseInfo(e).regexp};b.date.locale._parseInfo=function(e){e=e||{};var f=b.i18n.normalizeLocale(e.locale);f=b.date.locale._getGregorianBundle(f);var j=e.formatLength||"short",h=e.datePattern||f["dateFormat-"+j],i=e.timePattern||f["timeFormat-"+j];j=e.selector=="date"?h:e.selector=="time"?i:f["dateTimeFormat-"+j].replace(/\{(\d+)\}/g,function(o,q){return[i,h][q]});var l=[];
return{regexp:a(j,b.hitch(this,c,l,f,e)),tokens:l,bundle:f}};b.date.locale.parse=function(e,f){var j=/[\u200E\u200F\u202A\u202E]/g,h=b.date.locale._parseInfo(f),i=h.tokens,l=h.bundle;e=(new RegExp("^"+h.regexp.replace(j,"")+"$",h.strict?"":"i")).exec(e&&e.replace(j,""));if(!e)return null;var o=["abbr","wide","narrow"],q=[1970,0,1,0,0,0,0],x="";e=b.every(e,function(r,s){if(!s)return true;s=i[s-1];var y=s.length;switch(s.charAt(0)){case "y":if(y!=2&&f.strict)q[0]=r;else if(r<100){r=Number(r);y=""+(new Date).getFullYear();
s=y.substring(0,2)*100;y=Math.min(Number(y.substring(2,4))+20,99);q[0]=r<y?s+r:s-100+r}else{if(f.strict)return false;q[0]=r}break;case "M":if(y>2){s=l["months-format-"+o[y-3]].concat();if(!f.strict){r=r.replace(".","").toLowerCase();s=b.map(s,function(g){return g.replace(".","").toLowerCase()})}r=b.indexOf(s,r);if(r==-1)return false}else r--;q[1]=r;break;case "E":case "e":s=l["days-format-"+o[y-3]].concat();if(!f.strict){r=r.toLowerCase();s=b.map(s,function(g){return g.toLowerCase()})}r=b.indexOf(s,
r);if(r==-1)return false;break;case "D":q[1]=0;case "d":q[2]=r;break;case "a":s=f.am||l["dayPeriods-format-wide-am"];y=f.pm||l["dayPeriods-format-wide-pm"];if(!f.strict){var w=/\./g;r=r.replace(w,"").toLowerCase();s=s.replace(w,"").toLowerCase();y=y.replace(w,"").toLowerCase()}if(f.strict&&r!=s&&r!=y)return false;x=r==y?"p":r==s?"a":"";break;case "K":if(r==24)r=0;case "h":case "H":case "k":if(r>23)return false;q[3]=r;break;case "m":q[4]=r;break;case "s":q[5]=r;break;case "S":q[6]=r}return true});
j=+q[3];if(x==="p"&&j<12)q[3]=j+12;else if(x==="a"&&j==12)q[3]=0;j=new Date(q[0],q[1],q[2],q[3],q[4],q[5],q[6]);f.strict&&j.setFullYear(q[0]);var t=i.join("");h=t.indexOf("d")!=-1;t=t.indexOf("M")!=-1;if(!e||t&&j.getMonth()>q[1]||h&&j.getDate()>q[2])return null;if(t&&j.getMonth()<q[1]||h&&j.getDate()<q[2])j=b.date.add(j,"hour",1);return j}})();(function(){var d=[];b.date.locale.addCustomFormats=function(a,c){d.push({pkg:a,name:c})};b.date.locale._getGregorianBundle=function(a){var c={};b.forEach(d,
function(e){e=b.i18n.getLocalization(e.pkg,e.name,a);c=b.mixin(c,e)},this);return c}})();b.date.locale.addCustomFormats("dojo.cldr","gregorian");b.date.locale.getNames=function(d,a,c,e){var f;e=b.date.locale._getGregorianBundle(e);d=[d,c,a];if(c=="standAlone"){c=d.join("-");f=e[c];if(f[0]==1)f=undefined}d[1]="format";return(f||e[d.join("-")]).concat()};b.date.locale.isWeekend=function(d,a){a=b.cldr.supplemental.getWeekend(a);d=(d||new Date).getDay();if(a.end<a.start){a.end+=7;if(d<a.start)d+=7}return d>=
a.start&&d<=a.end};b.date.locale._getDayOfYear=function(d){return b.date.difference(new Date(d.getFullYear(),0,1,d.getHours()),d)+1};b.date.locale._getWeekOfYear=function(d,a){if(arguments.length==1)a=0;var c=(new Date(d.getFullYear(),0,1)).getDay(),e=(c-a+7)%7;e=Math.floor((b.date.locale._getDayOfYear(d)+e-1)/7);c==a&&e++;return e};return b.date.locale});
define("orion/auth",["dojo","orion/globalCommands","dojo/date/locale"],function(b,d){function a(l,o,q,x){j(o.xhr,function(){var t=b.xhrGet(l);q&&t.then(q,x)})}function c(l,o){j(o.xhr,function(){b.xhrPost(l)})}function e(l,o){j(o.xhr,function(){b.xhrDelete(l)})}function f(l,o){j(o.xhr,function(){b.xhrPut(l)})}function j(l,o){if(l.status===403){if(i==null)i=new dijit.Dialog({title:"Forbidden access"});i.set("content",l.message);i.show()}if(l.status===401){var q=b.subscribe("/auth",function(){o();b.unsubscribe(q)});
if(!h){h=true;eval(l.responseText)}}}var h=false,i;b.addOnLoad(function(){window.dojo=b;window.eclipse=window.eclipse||{};eclipse.globalCommandUtils=d;b.xhrGet({url:"/auth2",handleAs:"javascript",headers:{"Orion-Version":"1"}})});return{handleGetAuthenticationError:a,handlePostAuthenticationError:c,handleDeleteAuthenticationError:e,handlePutAuthenticationError:f,handleAuthenticationError:j}});
define("orion/preferences",["dojo","orion/auth"],function(b,d){function a(h,i,l){this._name=h;this._userProvider=i;this._defaultsProvider=l;this._flushPending=false;this._defaults=this._store=null}function c(h){this.location=h;this._currentPromises={}}function e(h){this.location=h;this._currentPromise=null}function f(h,i,l){i=i||"/prefs/user";l=l||"/defaults.pref";this._userProvider=new c(i);this._defaultsProvider=new e(l);this._serviceRegistration=h.registerService("orion.core.preference",this)}
a.prototype={_flush:function(){return this._userProvider.put(this._name,this._store)},_scheduleFlush:function(){if(!this._flushPending){this._flushPending=true;window.setTimeout(b.hitch(this,function(){if(this._flushPending){this._flushPending=false;this._flush()}}),0)}},keys:function(){var h,i=[];for(h in this._store)this._store.hasOwnProperty(h)&&h.charAt(0)!=="/"&&i.push(h);for(h in this._defaults)this._defaults.hasOwnProperty(h)&&!this._store.hasOwnProperty(h)&&h.charAt(0)!=="/"&&i.push(h);return i},
get:function(h){if(h.charAt(0)==="/")throw new Error("Bad character in key name: "+h);return this._store.hasOwnProperty(h)?this._store[h]:this._defaults[h]},put:function(h,i){if(h.charAt(0)==="/")throw new Error("Bad character in key name: "+h);if(this._store[h]!==i){this._store[h]=i;this._scheduleFlush()}},remove:function(h){if(h.charAt(0)==="/")throw new Error("Bad character in key name: "+h);if(this._store[h]){delete this._store[h];this._scheduleFlush();return true}return false},clear:function(){var h;
for(h in this._store)this._store.hasOwnProperty(h)&&h.charAt(0)!=="/"&&delete this._store[h];this._scheduleFlush()},sync:function(){if(this._flushPending){this._flushPending=false;return this._flush()}return this._defaultsProvider.get(this._name).then(b.hitch(this,function(h){this._defaults=h;return this._userProvider.get(this._name).then(b.hitch(this,function(i){this._store=i}))}))},flush:function(){this._flush()}};var j={get:function(h,i){h=localStorage.getItem(h);if(h==null)return null;h=JSON.parse(h);
if(i||h._expires&&h._expires>(new Date).getTime()){delete h._expires;return h}return null},set:function(h,i){i._expires=(new Date).getTime()+36E5;var l=JSON.stringify(i);localStorage.setItem(h,l);delete i._expires}};c.prototype={get:function(h){if(this._currentPromises[h])return this._currentPromises[h];var i=new b.Deferred,l="/orion/preferences/user"+h,o=j.get(l);if(o!==null)i.resolve(o);else{this._currentPromises[h]=i;var q=this;b.xhrGet({url:this.location+h,headers:{"Orion-Version":"1"},handleAs:"json",
timeout:15E3,load:function(x){j.set(l,x);delete q._currentPromises[h];i.resolve(x)},error:function(x,t){x.log=false;if(t.xhr.status===401)d.handleGetAuthenticationError(this,t);else if(t.xhr.status===404){x={};j.set(l,x);delete q._currentPromises[h];i.resolve(x)}else{delete q._currentPromises[h];i.resolve(j.get(l,true)||{})}},failOk:true})}return i},put:function(h,i){var l=new b.Deferred;j.set("/orion/preferences/user"+h,i);b.xhrPut({url:this.location+h,putData:JSON.stringify(i),headers:{"Orion-Version":"1"},
handleAs:"json",contentType:"application/json",timeout:15E3,load:function(){l.resolve()},error:function(o,q){q.xhr.status===401?d.handlePutAuthenticationError(this,q):l.resolve()}});return l}};e.prototype={get:function(h){if(this._currentPromise)return this._currentPromise;var i=new b.Deferred,l=j.get("/orion/preferences/default");if(l!==null)i.resolve(l[h]||{});else{this._currentPromise=i;var o=this;b.xhrGet({url:this.location,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(q){j.set("/orion/preferences/default",
q);o._currentPromise=null;i.resolve(q[h]||{})},error:function(q,x){if(x.xhr.status===401)d.handleGetAuthenticationError(x.xhr,x);else if(x.xhr.status===404){j.set("/orion/preferences/default",{});o._currentPromise=null;i.resolve({})}else{o._currentPromise=null;q=j.get("/orion/preferences/default",true);q!==null?i.resolve(q[h]||{}):i.resolve({})}}})}return i}};f.prototype={getPreferences:function(h){var i=new a(h,this._userProvider,this._defaultsProvider);return i.sync().then(function(){return i})}};
return{Preferences:a,PreferencesService:f}});
define("dojo/DeferredList",["dojo"],function(b){b.DeferredList=function(d,a,c,e){var f=[];b.Deferred.call(this);var j=this;d.length===0&&!a&&this.resolve([0,[]]);var h=0;b.forEach(d,function(i,l){function o(q,x){f[l]=[q,x];h++;h===d.length&&j.resolve(f)}i.then(function(q){a?j.resolve([l,q]):o(true,q)},function(q){c?j.reject(q):o(false,q);if(e)return null;throw q;})})};b.DeferredList.prototype=new b.Deferred;b.DeferredList.prototype.gatherResults=function(d){d=new b.DeferredList(d,false,true,false);
d.addCallback(function(a){var c=[];b.forEach(a,function(e){c.push(e[1])});return c});return d};return b.DeferredList});
define("orion/pluginregistry",["dojo","orion/serviceregistry","dojo/DeferredList"],function(b,d){var a=a||{};a.Plugin=function(c,e,f){function j(w,g,k,m){if(!q)throw new Error("plugin not connected");var n=r++;s[String(n)]=m;f.postMessage({id:n,serviceId:w,method:g,params:k},q)}function h(w){var g={};if(w.methods)for(var k=0;k<w.methods.length;k++){var m=w.methods[k];g[m]=function(n){return function(){var p=Array.prototype.slice.call(arguments),u=new b.Deferred;o._load().then(function(){j(w.serviceId,
n,p,u)});return u.promise}}(m)}return g}function i(){var w=e.services;if(w)for(var g=0;g<w.length;g++){var k=w[g],m=h(k);y[k.serviceId]=f.registerService(k.type,m,k.properties)}}function l(w){try{if(w.method)if("plugin"===w.method){if(e){if(JSON.stringify(e)!=JSON.stringify(w.params[0])){for(var g in y)if(y.hasOwnProperty(g)){y[g].unregister();delete y[g]}e=w.params[0];i();f.updatePlugin(o)}}else{e=w.params[0];i()}if(!t){t=true;x.resolve(o)}}else if("dispatchEvent"===w.method){var k=y[w.serviceId];
k.dispatchEvent.apply(k,w.params)}else throw new Error("Bad response method: "+w.method);else{var m=s[String(w.id)];delete s[String(w.id)];w.error?m.reject(w.error):m.resolve(w.result)}}catch(n){console.log(n)}}var o=this,q=null,x=new b.Deferred,t=false,r=0,s={},y={};this.getLocation=function(){return c};this.getData=function(){return e};this.uninstall=function(){for(var w in y)if(y.hasOwnProperty(w)){y[w].unregister();delete y[w]}if(q){f.disconnect(q);q=null}f.uninstallPlugin(this)};this.getServiceReferences=
function(){var w=[],g;for(g in y)y.hasOwnProperty(g)&&w.push(y[g].getServiceReference());return w};this._load=function(w){if(!q){q=f.connect(c,l);window.setTimeout(function(){if(!t){if(!w){e={};f.updatePlugin(o)}x.reject(new Error("Load timeout for plugin: "+c))}},15E3)}return x.promise};if(typeof c!=="string")throw new Error("invalid url:"+c);e&&i()};a.PluginRegistry=function(c,e){function f(){var g,k,m=[];if((g=o["/orion/preferences/default"]?JSON.parse(o["/orion/preferences/default"]):null)&&g["/plugins"]){s=
g["/plugins"];for(k in s)if(s.hasOwnProperty(k)){k=i(k);g="plugin."+k;if(o[g]){g=JSON.parse(o[g]);g=new a.Plugin(k,g,w);q.push(g)}else m.push(l.installPlugin(k))}}(y=o["/orion/preferences/user/plugins"]?JSON.parse(o["/orion/preferences/user/plugins"]):null)||(y={});for(k in y)if(y.hasOwnProperty(k)&&k!=="_expires"){k=i(k);g="plugin."+k;if(o[g]){g=JSON.parse(o[g]);g=new a.Plugin(k,g,w);q.push(g)}else m.push(l.installPlugin(k))}r=new b.DeferredList(m)}function j(g){var k;o["plugin."+g.getLocation()]=
JSON.stringify(g.getData());for(k in s)if(s.hasOwnProperty(k))if(g.getLocation()===i(k))return;for(k in y)if(y.hasOwnProperty(k))if(g.getLocation()===i(k))return;y[g.getLocation()]=true;o["/orion/preferences/user/plugins"]=JSON.stringify(y)}function h(g){var k;delete o["plugin."+g.getLocation()];for(k in y)if(y.hasOwnProperty(k))if(g.getLocation()===i(k)){delete y[g.getLocation()];o["/orion/preferences/user/plugins"]=JSON.stringify(y);return}}function i(g){if(g.indexOf("://")===-1){var k=document.createElement("a");
k.href=g;return k.href}return g}var l=this,o=e||localStorage||{},q=[],x=[],t=new d.EventTarget,r,s={},y;window.addEventListener("message",function(g){for(var k=0,m=g.source;k<x.length;k++)if(m===x[k].target){x[k].handler(JSON.parse(g.data));break}},false);var w={registerService:b.hitch(c,c.registerService),connect:function(g,k){var m=document.createElement("iframe");m.id=g;m.name=g;m.style.display="none";m.style.visibility="hidden";m.src=g;document.body.appendChild(m);g={iframe:m,target:m.contentWindow,
handler:k,url:g};x.push(g);return g},disconnect:function(g){for(var k=0;k<x.length;k++)if(g===x[k]){x.splice(k,1);try{document.body.removeChild(g.iframe)}catch(m){}break}},uninstallPlugin:function(g){h(g);for(var k=0;k<q.length;k++)if(g===q[k]){q.splice(k,1);t.dispatchEvent("pluginRemoved",g);break}},updatePlugin:function(g){o["plugin."+g.getLocation()]=JSON.stringify(g.getData());t.dispatchEvent("pluginUpdated",g)},postMessage:function(g,k){k.target.postMessage(JSON.stringify(g),k.url)}};this.startup=
function(){return r.promise};this.shutdown=function(){for(var g=0;g<x.length;g++)try{document.body.removeChild(x[g].iframe)}catch(k){}};this.installPlugin=function(g,k){g=i(g);for(var m=new b.Deferred,n,p=0;p<q.length;p++)if(g===q[p].getLocation()){n=q[p];break}if(n)if(n.getData())m.resolve(n);else{var u=function(v){if(v.getLocation()===g){m.resolve(v);t.removeEventListener("pluginAdded",u)}};t.addEventListener("pluginAdded",u)}else{n=new a.Plugin(g,k,w);q.push(n);if(n.getData()){j(n);t.dispatchEvent("pluginAdded",
n);m.resolve(n)}else n._load(!!r).then(function(){j(n);t.dispatchEvent("pluginAdded",n);m.resolve(n)},function(v){m.reject(v)})}return m.promise};this.getPlugins=function(){for(var g=[],k=0;k<q.length;k++)q[k].getData()&&g.push(q[k]);return g};this.getPlugin=function(g){g=i(g);for(var k=0;k<q.length;k++)if(q[k].getData()&&g===q[k].getLocation())return q[k];return null};this.addEventListener=function(g,k){t.addEventListener(g,k)};this.removeEventListener=function(g,k){t.removeEventListener(g,k)};f()};
return a});
define("orion/selection",["dojo"],function(b){function d(a){this._serviceRegistry=a;this._serviceRegistration=a.registerService("orion.page.selection",this);this._selections=[]}d.prototype={getSelection:function(a){a(this._getSingleSelection())},getSelections:function(a){a(this._selections)},_getSingleSelection:function(){if(this._selections&&this._selections.length>0)return this._selections[0];return null},setSelections:function(a){this._selections=b.isArray(a)?a:a?[a]:null;this._serviceRegistration.dispatchEvent("selectionChanged",this._getSingleSelection(),
this._selections)}};d.prototype.constructor=d;return{Selection:d}});
define("orion/status",["dojo"],function(b){function d(a,c,e){this._serviceRegistry=a;this._serviceRegistration=a.registerService("orion.page.message",this);this.domId=c;this.progressDomId=e||c}d.prototype={setMessage:function(a,c){b.place(window.document.createTextNode(a),this.domId,"only");if(typeof c==="number"){var e=this;window.setTimeout(function(){var f=b.byId(e.domId);(typeof f.textContent==="string"?f.textContent:f.innerText)===a&&b.place(window.document.createTextNode(""),e.domId,"only")},
c)}},setErrorMessage:function(a){var c=a.responseText||a;try{c=JSON.parse(c)}catch(e){}a=c.Message||c;var f="red";if(c.Severity)switch(c.Severity){case "Warning":f="#FFCC00";break;case "Error":f="red";break;case "Info":case "Ok":f="green";break}c=b.create("span",{style:{color:f}});b.place(window.document.createTextNode(a),c);b.place(c,this.domId,"only")},setProgressMessage:function(a){b.place(window.document.createTextNode(a),this.progressDomId,"only")},setProgressResult:function(a){a=a.responseText||
a;try{a=JSON.parse(a)}catch(c){}var e=a.Message||a,f="/images/info.gif",j="info";if(a.Severity)switch(a.Severity){case "Warning":f="/images/warning.gif";j="warning";break;case "Error":f="/images/error.gif";j="error";break}var h=new Image;h.alt=j;h.title="Press to clear message";h.name=j;h.src=f;b.style(h,"opacity","0.7");b.connect(h,"onmouseover",this,function(){b.style(h,"opacity","1")});b.connect(h,"onmouseout",this,function(){b.style(h,"opacity","0.7")});b.connect(h,"onclick",this,function(){this.setProgressMessage("")});
b.place(h,this.progressDomId,"only");a.HTML?b.place(e,this.progressDomId,"last"):b.place(window.document.createTextNode("   "+e),this.progressDomId,"last")},showWhile:function(a,c){var e=this;e.setProgressMessage(c);return a.then(function(f){if(f&&f.Location&&f.Message&&f.Running)return e._doProgressWhile(f);e.setProgressMessage("");f&&f.Result&&e.setProgressResult(f.Result);return f})},_doProgressWhile:function(a){var c=new b.Deferred;window.setTimeout(function(){b.xhrGet({url:a.Location,headers:{"Orion-Version":"1"},
handleAs:"json",timeout:15E3,load:function(e){c.callback(e)}})},2E3);return this.showWhile(c,a.Message)}};d.prototype.constructor=d;return{StatusReportingService:d}});define("orion/dialogs",[],function(){function b(d){this._serviceRegistry=d;this._serviceRegistration=d.registerService("orion.page.dialog",this)}b.prototype={confirm:function(d,a){a(window.confirm(d))},openFiles:function(){}};b.prototype.constructor=b;return{DialogService:b}});
define("orion/users",[],function(){function b(d){this._serviceRegistry=d;this._serviceRegistration=d.registerService("IUsers",this);this._user=null}b.prototype={setUser:function(d){this._user=d},getUser:function(d){d(this._user)}};return{UserService:b}});
define("orion/favorites",["dojo","orion/util","orion/commands"],function(b,d,a){function c(f){this._favorites=[];this._searches=[];this._init(f);this._initializeFavorites()}function e(f){var j=f.parent;if(typeof j==="string")j=b.byId(j);if(!j)throw"no parent";if(!f.serviceRegistry)throw"no service registry";this._parent=j;this._registry=f.serviceRegistry;var h=this,i=new a.Command({name:"Add Favorite",tooltip:"Add link as favorite",image:"/images/add.gif",id:"eclipse.addExternalFave",callback:b.hitch(this,
function(x,t,r){this.getUserURL(r)})}),l=new a.Command({name:"Delete",image:"/images/delete.gif",id:"eclipse.deleteFave",visibleWhen:function(x){return x.isFavorite},callback:function(x){window.confirm("Do you want to remove "+x.name+" from favorites?")&&f.serviceRegistry.getService("orion.core.favorite").then(function(t){t.removeFavorite(x.path)})}}),o=new a.Command({name:"Rename",image:"/images/rename.gif",id:"eclipse.renameFave",visibleWhen:function(x){return x.isFavorite},callback:b.hitch(this,
function(x,t,r,s){this.editFavoriteName(x,t,r,s)})}),q=new a.Command({name:"Delete",image:"/images/delete.gif",id:"eclipse.deleteSearch",visibleWhen:function(x){return x.isSearch},callback:function(x){window.confirm("Do you want to remove "+x.name+" from favorites?")&&f.serviceRegistry.getService("orion.core.favorite").then(function(t){t.removeSearch(x.query)})}});this._registry.getService("orion.page.command").then(function(x){x.addCommand(l,"object");x.addCommand(o,"object");x.addCommand(q,"object");
x.addCommand(i,"dom");x.registerCommandContribution("eclipse.renameFave",1);x.registerCommandContribution("eclipse.deleteFave",2);x.registerCommandContribution("eclipse.deleteSearch",1);x.registerCommandContribution("eclipse.addExternalFave",1,"faveCommands")});this._registry.getService("orion.core.favorite").then(function(x){x.getFavorites().then(function(t){h.render(t.navigator,t.search)});x.addEventListener("favoritesChanged",function(t){h.render(t.navigator,t.search)})})}c.prototype={_init:function(f){this._registry=
f.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.favorite",this)},_notifyListeners:function(){this._serviceRegistration.dispatchEvent("favoritesChanged",{navigator:this._favorites,search:this._searches})},makeFavorites:function(f){f=b.isArray(f)?f:[f];for(var j=0;j<f.length;j++){var h=f[j],i=h.ChildrenLocation?h.ChildrenLocation:h.Location;i=d.makeRelative(i);this.addFavorite(h.Name,i,h.Directory)}this._storeFavorites();this._notifyListeners()},addFavoriteUrl:function(f){this.addFavorite(f,
f,false,true)},addFavorite:function(f,j,h,i){this._favorites.push({name:f,path:j,directory:h,isFavorite:true,isExternalResource:i});this._storeFavorites();this._notifyListeners()},removeFavorite:function(f){for(var j in this._favorites)if(this._favorites[j].path===f){this._favorites.splice(j,1);break}this._storeFavorites();this._notifyListeners()},renameFavorite:function(f,j){var h=false;for(var i in this._favorites)if(this._favorites[i].path===f){var l=this._favorites[i];if(l.name!==j){l.name=j;
h=true}}if(h){this._storeFavorites();this._notifyListeners()}},addFavoriteSearch:function(f,j){this._searches.push({name:f,query:j,isSearch:true});this._storeSearches();this._notifyListeners()},removeSearch:function(f){for(var j in this._searches)if(this._searches[j].query===f){this._searches.splice(j,1);break}this._storeSearches();this._notifyListeners()},_initializeFavorites:function(){var f=this;this._registry.getService("orion.core.preference").then(function(j){j.getPreferences("/window/favorites").then(function(h){var i,
l=h.get("navigate");if(typeof l==="string")l=JSON.parse(l);if(l)for(i in l){l[i].isFavorite=true;f._favorites.push(l[i])}h=h.get("search");if(typeof h==="string")h=JSON.parse(h);if(h)for(i in h){h[i].isSearch=true;f._searches.push(h[i])}f._notifyListeners()})})},_storeFavorites:function(){var f=this._favorites;this._registry.getService("orion.core.preference").then(function(j){return j.getPreferences("/window/favorites")}).then(function(j){j.put("navigate",f)})},_storeSearches:function(){var f=this._searches;
this._registry.getService("orion.core.preference").then(function(j){return j.getPreferences("/window/favorites")}).then(function(j){j.put("search",f)})},getFavorites:function(){return{navigator:this._favorites,search:this._searches}}};c.prototype.constructor=c;e.prototype={getUserURL:function(f){var j=this._registry,h=b.byId("spacer");d.getUserText(f+"EditBox",h,true,"",function(i){j.getService("orion.core.favorite").then(function(l){l.addFavoriteUrl(i)})},null,"Type or paste a URL")},editFavoriteName:function(f,
j,h,i){var l=this._registry;j=b.byId("fave"+i);i=b.byId(h).parentNode;b.style(j,"display","none");i=i.childNodes;for(var o=0;o<i.length;o++)b.style(i[o],"display","none");d.getUserText(h+"EditBox",j,true,f.name,function(q){l.getService("orion.core.favorite").then(function(x){x.renameFavorite(f.path,q)})},function(){for(var q=b.byId(h).parentNode.childNodes,x=0;x<q.length;x++)b.style(q[x],"display","inline")})},render:function(f,j){var h=b.create("table",{id:"faveTable"});b.addClass(h,"favoritesTable");
var i=b.create("thead",null,h);i=b.create("tr",null,i);var l=b.create("td",null,i);b.addClass(l,"paneHeadingContainer");b.place("<span class='paneHeading'>Favorites</span>",l,"only");i=b.create("td",null,i);b.style(i,"textAlign","right");b.addClass(i,"paneHeadingContainer");b.place("<span id='faveCommands' class='paneHeadingToolbar'></span>",i,"only");for(var o,q,x,t=b.create("tbody",null,h),r=0;r<f.length;r++){var s=f[r];if(s.isExternalResource)q=s.path;else{q=s.directory?"/navigate/table.html#"+
s.path:"/edit/edit.html#"+s.path;if(q==="#")q=""}var y=s.directory?"navlinkonpage":"navlink",w="fave"+r;i=b.create("tr");i.id="row"+w;o=b.create("td",null,i,"last");b.style(o,"whiteSpace","nowrap");l=b.create("td",{id:i.id+"actions"},i,"last");b.style(l,"whiteSpace","nowrap");b.style(l,"textAlign","right");o=b.create("a",{id:w,href:q,className:y},o,"only");b.place(window.document.createTextNode(s.name),o,"only");x=b.create("span",{id:i.id+"actionsWrapper"},l,"only");b.style(x,"visibility","hidden");
this._registry.getService("orion.page.command").then(function(n){n.renderCommands(x,"object",s,this,"image",null,r)});b.place(i,t,"last");b.connect(i,"onmouseover",i,function(){var n=b.byId(this.id+"actionsWrapper");b.style(n,"visibility","visible")});b.connect(i,"onmouseout",i,function(){var n=b.byId(this.id+"actionsWrapper");b.style(n,"visibility","hidden")})}b.place(h,this._parent,"only");var g=b.byId("faveCommands");this._registry.getService("orion.page.command").then(function(n){n.renderCommands(g,
"dom",this,this,"image")});f=b.create("tr",null,h);f=b.create("td",{colspan:2},f);b.create("span",{id:"spacer"},f);if(j.length>0){i=b.create("thead",null,h);i=b.create("tr",null,i);l=b.create("td",null,i);b.addClass(l,"paneHeadingContainer");b.place("<span class='paneHeading'>Searches</span>",l,"only");i=b.create("td",null,i);b.style(i,"textAlign","right");b.addClass(i,"paneHeadingContainer");t=b.create("tbody",null,h);for(var k=0;k<j.length;k++){var m=j[k];q="/search/search.html#"+m.query;i=b.create("tr");
i.id="searchRow"+k;o=b.create("td",null,i,"last");l=b.create("td",{id:i.id+"actions"},i,"last");b.style(l,"textAlign","right");o=b.create("a",{href:q},o,"only");b.place(window.document.createTextNode(m.name),o,"only");x=b.create("span",{id:i.id+"actionsWrapper"},l,"only");b.style(x,"visibility","hidden");this._registry.getService("orion.page.command").then(function(n){n.renderCommands(x,"object",m,this,"image",null,k)});b.place(i,t,"last");b.connect(i,"onmouseover",i,function(){var n=b.byId(this.id+
"actionsWrapper");b.style(n,"visibility","visible")});b.connect(i,"onmouseout",i,function(){var n=b.byId(this.id+"actionsWrapper");b.style(n,"visibility","hidden")})}}}};e.prototype.constructor=e;return{FavoritesService:c,Favorites:e}});
define("orion/fileClient",["dojo","orion/auth"],function(b,d){function a(c){this.fileService=c}a.prototype={setFileService:function(c){this.fileService=c},fetchChildren:function(){return this._doServiceCall("fetchChildren",arguments)},createWorkspace:function(){return this._doServiceCall("createWorkspace",arguments)},loadWorkspaces:function(){return this._doServiceCall("loadWorkspaces",arguments)},loadWorkspace:function(){return this._doServiceCall("loadWorkspace",arguments)},createProject:function(){return this._doServiceCall("createProject",
arguments)},createFolder:function(){return this._doServiceCall("createFolder",arguments)},createFile:function(){return this._doServiceCall("createFile",arguments)},deleteFile:function(){return this._doServiceCall("deleteFile",arguments)},moveFile:function(){return this._doServiceCall("moveFile",arguments)},copyFile:function(){return this._doServiceCall("copyFile",arguments)},read:function(){return this._doServiceCall("read",arguments)},write:function(){return this._doServiceCall("write",arguments)},
remoteImport:function(){return this._doServiceCall("remoteImport",arguments)},remoteExport:function(){return this._doServiceCall("remoteExport",arguments)},_doServiceCall:function(c,e){var f=new b.Deferred,j=this.fileService;j[c].apply(j,e).then(function(h){f.callback(h)},function(h){h.status===401||h.status===403?d.handleAuthenticationError(h,function(){j[c].apply(j,e).then(function(i){f.callback(i)},function(i){f.errback(i)})}):f.errback(h)});return f}};a.prototype.constructor=a;return{FileClient:a}});
define("dojo/cookie",["dojo","dojo/regexp"],function(b){b.cookie=function(d,a,c){var e=document.cookie;if(arguments.length==1){var f=e.match(new RegExp("(?:^|; )"+b.regexp.escapeString(d)+"=([^;]*)"));return f?decodeURIComponent(f[1]):undefined}else{c=c||{};e=c.expires;if(typeof e=="number"){var j=new Date;j.setTime(j.getTime()+e*24*60*60*1E3);e=c.expires=j}if(e&&e.toUTCString)c.expires=e.toUTCString();a=encodeURIComponent(a);e=d+"="+a;for(f in c){e+="; "+f;j=c[f];if(j!==true)e+="="+j}document.cookie=
e}};b.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 b.cookie});
define("dijit/layout/BorderContainer",["dojo","dijit","dijit/layout/_LayoutWidget","dojo/cookie","dijit/_Templated"],function(b,d){b.declare("dijit.layout.BorderContainer",d.layout._LayoutWidget,{design:"headline",gutters:true,liveSplitters:true,persist:false,baseClass:"dijitBorderContainer",_splitterClass:"dijit.layout._Splitter",postMixInProperties:function(){this.gutters||(this.baseClass+="NoGutter");this.inherited(arguments)},startup:function(){if(!this._started){b.forEach(this.getChildren(),
this._setupChild,this);this.inherited(arguments)}},_setupChild:function(a){var c=a.region;if(c){this.inherited(arguments);b.addClass(a.domNode,this.baseClass+"Pane");var e=this.isLeftToRight();if(c=="leading")c=e?"left":"right";if(c=="trailing")c=e?"right":"left";if(c!="center"&&(a.splitter||this.gutters)&&!a._splitterWidget){var f=b.getObject(a.splitter?this._splitterClass:"dijit.layout._Gutter");e=new f({id:a.id+"_splitter",container:this,child:a,region:c,live:this.liveSplitters});e.isSplitter=
true;a._splitterWidget=e;b.place(e.domNode,a.domNode,"after");e.startup()}a.region=c}},layout:function(){this._layoutChildren()},addChild:function(){this.inherited(arguments);this._started&&this.layout()},removeChild:function(a){var c=a.region,e=a._splitterWidget;if(e){e.destroy();delete a._splitterWidget}this.inherited(arguments);this._started&&this._layoutChildren();b.removeClass(a.domNode,this.baseClass+"Pane");b.style(a.domNode,{top:"auto",bottom:"auto",left:"auto",right:"auto",position:"static"});
b.style(a.domNode,c=="top"||c=="bottom"?"width":"height","auto")},getChildren:function(){return b.filter(this.inherited(arguments),function(a){return!a.isSplitter})},getSplitter:function(a){return b.filter(this.getChildren(),function(c){return c.region==a})[0]._splitterWidget},resize:function(){if(!this.cs||!this.pe){var a=this.domNode;this.cs=b.getComputedStyle(a);this.pe=b._getPadExtents(a,this.cs);this.pe.r=b._toPixelValue(a,this.cs.paddingRight);this.pe.b=b._toPixelValue(a,this.cs.paddingBottom);
b.style(a,"padding","0px")}this.inherited(arguments)},_layoutChildren:function(a,c){if(this._borderBox&&this._borderBox.h){var e=b.map(this.getChildren(),function(j,h){return{pane:j,weight:[j.region=="center"?Infinity:0,j.layoutPriority,(this.design=="sidebar"?1:-1)*(/top|bottom/.test(j.region)?1:-1),h]}},this);e.sort(function(j,h){j=j.weight;h=h.weight;for(var i=0;i<j.length;i++)if(j[i]!=h[i])return j[i]-h[i];return 0});var f=[];b.forEach(e,function(j){j=j.pane;f.push(j);j._splitterWidget&&f.push(j._splitterWidget)});
d.layout.layoutChildren(this.domNode,{l:this.pe.l,t:this.pe.t,w:this._borderBox.w-this.pe.w,h:this._borderBox.h-this.pe.h},f,a,c)}},destroyRecursive:function(){b.forEach(this.getChildren(),function(a){var c=a._splitterWidget;c&&c.destroy();delete a._splitterWidget});this.inherited(arguments)}});b.extend(d._Widget,{region:"",layoutPriority:0,splitter:false,minSize:0,maxSize:Infinity});b.declare("dijit.layout._Splitter",[d._Widget,d._Templated],{live:true,templateString:'<div class="dijitSplitter" dojoAttachEvent="onkeypress:_onKeyPress,onmousedown:_startDrag,onmouseenter:_onMouse,onmouseleave:_onMouse" tabIndex="0" role="separator"><div class="dijitSplitterThumb"></div></div>',
postMixInProperties:function(){this.inherited(arguments);this.horizontal=/top|bottom/.test(this.region);this._factor=/top|left/.test(this.region)?1:-1;this._cookieName=this.container.id+"_"+this.region},buildRendering:function(){this.inherited(arguments);b.addClass(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V"));if(this.container.persist){var a=b.cookie(this._cookieName);if(a)this.child.domNode.style[this.horizontal?"height":"width"]=a}},_computeMaxSize:function(){var a=this.horizontal?"h":
"w",c=b.marginBox(this.child.domNode)[a],e=b.filter(this.container.getChildren(),function(f){return f.region=="center"})[0];a=b.marginBox(e.domNode)[a];return Math.min(this.child.maxSize,c+a)},_startDrag:function(a){if(!this.cover){this.cover=b.doc.createElement("div");b.addClass(this.cover,"dijitSplitterCover");b.place(this.cover,this.child.domNode,"after")}b.addClass(this.cover,"dijitSplitterCoverActive");this.fake&&b.destroy(this.fake);if(!(this._resize=this.live)){(this.fake=this.domNode.cloneNode(true)).removeAttribute("id");
b.addClass(this.domNode,"dijitSplitterShadow");b.place(this.fake,this.domNode,"after")}b.addClass(this.domNode,"dijitSplitterActive dijitSplitter"+(this.horizontal?"H":"V")+"Active");if(this.fake)b.removeClass(this.fake,"dijitSplitterHover dijitSplitter"+(this.horizontal?"H":"V")+"Hover");var c=this._factor,e=this.horizontal,f=e?"pageY":"pageX",j=a[f],h=this.domNode.style;e=e?"h":"w";var i=b.marginBox(this.child.domNode)[e],l=this._computeMaxSize(),o=this.child.minSize||20;e=this.region;var q=e==
"top"||e=="bottom"?"top":"left",x=parseInt(h[q],10),t=this._resize,r=b.hitch(this.container,"_layoutChildren",this.child.id);e=b.doc;this._handlers=(this._handlers||[]).concat([b.connect(e,"onmousemove",this._drag=function(s,y){s=s[f]-j;var w=c*s+i,g=Math.max(Math.min(w,l),o);if(t||y)r(g);h[q]=s+x+c*(g-w)+"px"}),b.connect(e,"ondragstart",b.stopEvent),b.connect(b.body(),"onselectstart",b.stopEvent),b.connect(e,"onmouseup",this,"_stopDrag")]);b.stopEvent(a)},_onMouse:function(a){a=a.type=="mouseover"||
a.type=="mouseenter";b.toggleClass(this.domNode,"dijitSplitterHover",a);b.toggleClass(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V")+"Hover",a)},_stopDrag:function(a){try{this.cover&&b.removeClass(this.cover,"dijitSplitterCoverActive");this.fake&&b.destroy(this.fake);b.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)b.cookie(this._cookieName,
this.child.domNode.style[this.horizontal?"height":"width"],{expires:365})},_cleanupHandlers:function(){b.forEach(this._handlers,b.disconnect);delete this._handlers},_onKeyPress:function(a){this._resize=true;var c=this.horizontal,e=1,f=b.keys;switch(a.charOrCode){case c?f.UP_ARROW:f.LEFT_ARROW:e*=-1;case c?f.DOWN_ARROW:f.RIGHT_ARROW:break;default:return}c=b._getMarginSize(this.child.domNode)[c?"h":"w"]+this._factor*e;this.container._layoutChildren(this.child.id,Math.max(Math.min(c,this._computeMaxSize()),
this.child.minSize));b.stopEvent(a)},destroy:function(){this._cleanupHandlers();delete this.child;delete this.container;delete this.cover;delete this.fake;this.inherited(arguments)}});b.declare("dijit.layout._Gutter",[d._Widget,d._Templated],{templateString:'<div class="dijitGutter" role="presentation"></div>',postMixInProperties:function(){this.inherited(arguments);this.horizontal=/top|bottom/.test(this.region)},buildRendering:function(){this.inherited(arguments);b.addClass(this.domNode,"dijitGutter"+
(this.horizontal?"H":"V"))}});return d.layout.BorderContainer});
define("orion/searchClient",["dojo","dijit","orion/auth","orion/util","dijit/form/Button","dijit/layout/BorderContainer","dijit/layout/ContentPane"],function(b,d,a,c){function e(f){this.registry=f.serviceRegistry}e.prototype={search:function(f,j,h,i,l,o){b.xhrGet({url:j,handleAs:"json",headers:{Accept:"application/json","Orion-Version":"1"},sync:false,timeout:15E3,error:b.hitch(this,function(q,x){this.handleError(q,f);a.handleGetAuthenticationError(this,x,b.hitch(this,this.showSearchResult),b.hitch(this,
function(t){this.handleError(t,f)}));return q}),load:b.hitch(this,function(q){this.showSearchResult(f,j,h,i,l,o,q)})})},handleError:function(f,j){console.error(f);var h=document.createTextNode(f);b.place(h,j,"only");return f},saveSearch:function(f,j){this.registry.getService("orion.core.favorite").then(function(h){h.addFavoriteSearch(f,j)})},formatHighlight:function(f){f=f.split(/(##match|match##)/);for(var j=b.create("div"),h,i=0;i<f.length;i++){var l=f[i];if(l==="##match")h=b.create("b");else if(l===
"match##"){b.place(h,j,"last");h=null}else b.place(document.createTextNode(l),h||j,"last")}return j},showSearchResult:function(f,j,h,i,l,o,q){j=window.location.href.split("#")[0];var x=j.substring(0,j.length-window.location.pathname.length),t=false;b.empty(f);j=q.responseHeader.params.q;j=j.substring(j.indexOf("}")+1);if(q.response.numFound>0){for(var r=document.createElement("table"),s=0;s<q.response.docs.length;s++){var y=q.response.docs[s];if(!y.Directory&&y.Location!==h){var w;if(!t){t=true;if(i){w=
r.insertRow(0).insertCell(0);w.innerHTML="<h2>Search Results</h2>"}}w=r.insertRow(-1).insertCell(0);w.colspan=2;var g=document.createElement("a");b.place(document.createTextNode(y.Name),g);y.LineNumber&&b.place(document.createTextNode(" (Line "+y.LineNumber+")"),g);var k;k=j&&y.LineNumber?x+"/edit/edit.html#"+c.hashFromPosition(y.Location,null,null,y.LineNumber,y.Offset,j.length):x+"/edit/edit.html#"+y.Location;g.setAttribute("href",k);w.appendChild(g);if(!o&&q.highlighting&&q.highlighting[y.Id]&&
q.highlighting[y.Id].Text){y=q.highlighting[y.Id].Text[0];w=r.insertRow(-1).insertCell(0);w.colspan=2;b.place(this.formatHighlight(y),w,"only")}}}b.place(r,f,"last");typeof l==="function"&&l(f)}if(!t){f=b.place("<div>No matches found for </div>",f,"only");f=b.create("b",null,f,"last");b.place(document.createTextNode(j),f,"only")}}};e.prototype.constructor=e;return{Searcher:e}});
define("orion/outliner",["dojo","orion/util"],function(b,d){function a(e){this._init(e)}function c(e){this._serviceRegistry=e;this._serviceRegistration=e.registerService("orion.edit.outline",this)}a.prototype={_init:function(e){var f=e.parent;if(typeof f==="string")f=b.byId(f);if(!f)throw"no parent";if(!e.serviceRegistry)throw"no service registry";this._parent=f;this._selectionService=e.selectionService;var j=this;e.serviceRegistry.getService("orion.edit.outline").then(function(h){h.addEventListener("resourceChanged",
function(i){j.render(i)})})},_createLink:function(e,f,j){var h=b.create("a",null,j,"last");if(this._selectionService)b.style(h,"cursor","pointer");else h.href=f;b.addClass(h,"navlinkonpage");b.place(window.document.createTextNode(e),h);b.create("br",null,j,"last");if(this._selectionService){var i=this._selectionService;b.connect(h,"onclick",h,function(l){d.openInNewWindow(l)?d.followLink(f,l):i.setSelections(f)})}},render:function(e){var f,j,h;if(e.data&&e.title&&e.title.indexOf(".js")===e.title.length-
3){f=b.create("div");var i=e.data.functions;for(var l in i){var o=i[l];j=o.name;if(j[0]==='"')j=o.name=j=j.substring(1,j.length-1);j+="(";if(o.param){h=true;for(var q in o.param){if(h)h=false;else j+=",";j+=o.param[q]}}j+=")";h=window.location.href.split("#")[0];h=h+d.hashFromPosition(e.title,null,null,o.line,null,null,o.name);this._createLink(j,h,f)}b.place(f,this._parent,"only")}else if(e.title.indexOf(".html")===e.title.length-5||e.title.indexOf(".htm")===e.title.length-4){f=b.create("div");for(i=
/id=['"]\S*["']/gi;(j=i.exec(e.contents))!==null;){l=j.index;j=j[0];if(j[0]==="<"){j="&lt;"+j.substring(1)+"&gt;";l+=1}else{l+=4;j=j.substring(4,j.length-1)}q=l+j.length;h=window.location.href.split("#")[0];h=h+d.hashFromPosition(e.title,l,q);this._createLink(j,h,f)}b.place(f,this._parent,"only")}}};a.prototype.constructor=a;c.prototype={_setItems:function(e){this.resource=e;this._serviceRegistration.dispatchEvent("resourceChanged",e)}};c.prototype.constructor=c;return{Outliner:a,OutlineService:c}});
define("orion/problems",[],function(){function b(d){this._serviceRegistry=d;this._serviceRegistration=d.registerService("orion.core.marker",this)}b.prototype={_setProblems:function(d){this.problems=d;this._serviceRegistration.dispatchEvent("problemsChanged",d)}};b.prototype.constructor=b;return{ProblemService:b}});orion=orion||{};orion.editor=orion.editor||{};
orion.editor.ContentAssist=function(){function b(d,a,c){this.editor=d;this.textView=d.getTextView();this.contentAssistPanel=dojo.byId(a);this.active=false;this.prefix="";this.serviceRegistry=c;this.contentAssistProviders=[];this.activeServiceReferences=[];this.activeContentAssistProviders=[];this.contentAssistListener={onVerify:function(){this.showContentAssist(false)},onSelectionChanged:function(){this.showContentAssist(false)}};this.init()}b.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",dojo.hitch(this,function(){this.showContentAssist(true);return true}));dojo.connect(this.editor,"onInputChange",this,this.inputChanged)},inputChanged:function(d){if(this.serviceRegistry){this.activeServiceReferences=[];var a=this.serviceRegistry.getServiceReferences("orion.edit.contentAssist");dojo.forEach(a,dojo.hitch(this,function(e){for(var f=
{},j=e.getPropertyNames(),h=0;h<j.length;h++)f[j[h]]=e.getProperty(j[h]);(new RegExp(f.pattern)).test(d)&&this.activeServiceReferences.push(e)}))}for(a=0;a<this.contentAssistProviders.length;a++){var c=this.contentAssistProviders[a];(new RegExp(c.pattern)).test(d)&&this.activeContentAssistProviders.push(c.provider)}},cancel:function(){this.showContentAssist(false)},isActive:function(){return this.active},lineUp:function(){if(this.contentAssistPanel){for(var d=dojo.query("> div",this.contentAssistPanel),
a=0,c=0;c<d.length;c++)if(d[c].className==="selected"){d[c].className="";a=c;break}if(a>0)d[a-1].className="selected";else d[d.length-1].className="selected";return true}},lineDown:function(){if(this.contentAssistPanel){for(var d=dojo.query("> div",this.contentAssistPanel),a=0,c=0;c<d.length;c++)if(d[c].className==="selected"){d[c].className="";a=c;break}if(a<d.length-1)d[a+1].className="selected";else d[0].className="selected";return true}},enter:function(){if(this.contentAssistPanel){this.textView.setText(dojo.query("> .selected",
this.contentAssistPanel)[0].innerHTML.substring(this.prefix.length),this.textView.getCaretOffset(),this.textView.getCaretOffset());this.showContentAssist(false);return true}},showContentAssist:function(d){function a(j,h,i){var l={innerHTML:j,onclick:function(){alert(j)}};if(h)l.className="selected";dojo.create("div",l,i,this)}if(this.contentAssistPanel)if(d){var c=this.textView.getCaretOffset();d=c;for(var e;d>0&&(97<=(e=this.textView.getText(d-1,d).charCodeAt(0))&&e<=122||65<=e&&e<=90||e===95||48<=
e&&e<=57);)d--;this.prefix=this.textView.getText(d,c);var f=[];e=this.textView.getText();d=this.textView.getSelection();this.getKeywords(this.prefix,e,d).then(dojo.hitch(this,function(j){for(var h=0;h<j.length;h++){var i=j[h];i.substr(0,this.prefix.length)===this.prefix&&f.push(i)}if(f.length!==0){j=this.textView.getLocationAtOffset(c);j.y+=this.textView.getLineHeight();this.contentAssistPanel.innerHTML="";for(h=0;h<f.length;h++)a(f[h],h===0,this.contentAssistPanel);this.textView.convert(j,"document",
"page");this.contentAssistPanel.style.position="absolute";this.contentAssistPanel.style.left=j.x+"px";this.contentAssistPanel.style.top=j.y+"px";this.contentAssistPanel.style.display="block";this.textView.addEventListener("Verify",this,this.contentAssistListener.onVerify);this.textView.addEventListener("Selection",this,this.contentAssistListener.onSelectionChanged);this.active=true}}))}else{this.textView.removeEventListener("Verify",this,this.contentAssistListener.onVerify);this.textView.removeEventListener("Selection",
this,this.contentAssistListener.onSelectionChanged);this.active=false;this.contentAssistPanel.style.display="none"}},getKeywords:function(d,a,c){var e=[];dojo.forEach(this.activeContentAssistProviders,function(l){e=e.concat(l.getKeywords()||[])});var f=new dojo.Deferred;if(this.serviceRegistry)for(var j=dojo.map(this.activeServiceReferences,dojo.hitch(this,function(l){return this.serviceRegistry.getService(l).then(function(o){return o.getKeywords(d,a,c)})})),h=0,i=0;i<j.length;i++)j[i].then(function(l){h++;
e=e.concat(l);h===j.length&&f.resolve(e)},function(l){h=-1;f.reject(l)});else f.resolve(e);return f},addProvider:function(d,a,c){this.contentAssistProviders=this.contentAssistProviders||[];this.contentAssistProviders.push({name:a,pattern:c,provider:d})}};return b}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/editor/contentAssist",["dojo","orion/textview/keyBinding"],function(){return orion.editor});orion=orion||{};orion.textview=orion.textview||{};
orion.textview.UndoStack=function(){function b(c,e){this.view=c;this.size=e!==undefined?e:100;this.reset();c.addEventListener("ModelChanging",this,this._onModelChanging);c.addEventListener("Destroy",this,this._onDestroy)}var d=function(){function c(e,f,j){this.offset=e;this.text=f;this.previousText=j}c.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,j,h,i){h.setText(f,e,e+j.length);i&&h.setSelection(e,e+f.length)}};return c}(),a=function(){function c(e,f){this.selection=e;this.caret=f;this.changes=[]}c.prototype={add:function(e){this.changes.push(e)},undo:function(e,f){for(var j=this.changes.length-1;j>=0;j--)this.changes[j].undo(e,false);if(f){f=this.selection.start;j=this.selection.end;e.setSelection(this.caret?f:j,this.caret?j:f)}},redo:function(e,f){for(var j=0;j<this.changes.length;j++)this.changes[j].redo(e,false);if(f){f=this.selection.start;
j=this.selection.end;e.setSelection(this.caret?f:j,this.caret?j:f)}}};return c}();b.prototype={add:function(c){if(this.compoundChange)this.compoundChange.add(c);else{this.stack.splice(this.index,this.stack.length-this.index,c);this.index++;if(this.stack.length>this.size){this.stack.shift();this.index--;this.cleanIndex--}}},markClean:function(){this.endCompoundChange();this._commitUndo();this.cleanIndex=this.index},isClean:function(){return this.cleanIndex===this.getSize().undo},canUndo:function(){return this.getSize().undo>
0},canRedo:function(){return this.getSize().redo>0},endCompoundChange:function(){this.compoundChange=undefined},getSize:function(){var c=this.index,e=this.stack.length;this._undoStart!==undefined&&c++;return{undo:c,redo:e-c}},undo:function(){this._commitUndo();if(this.index<=0)return false;var c=this.stack[--this.index];this._ignoreUndo=true;c.undo(this.view,true);this._ignoreUndo=false;return true},redo:function(){this._commitUndo();if(this.index>=this.stack.length)return false;var c=this.stack[this.index++];
this._ignoreUndo=true;c.redo(this.view,true);this._ignoreUndo=false;return true},reset:function(){this.index=this.cleanIndex=0;this.stack=[];this._undoStart=undefined;this._undoText="";this._ignoreUndo=false;this._compoundChange=undefined},startCompoundChange:function(){this._commitUndo();var c=new a(this.view.getSelection(),this.view.getCaretOffset());this.add(c);this.compoundChange=c},_commitUndo:function(){if(this._undoStart!==undefined){this._undoStart<0?this.add(new d(-this._undoStart,"",this._undoText,
"")):this.add(new d(this._undoStart,this._undoText,""));this._undoStart=undefined;this._undoText=""}},_onDestroy:function(){this.view.removeEventListener("ModelChanging",this,this._onModelChanging);this.view.removeEventListener("Destroy",this,this._onDestroy)},_onModelChanging:function(c){var e=c.text,f=c.start,j=c.removedCharCount;c=c.addedCharCount;if(!this._ignoreUndo){if(this._undoStart!==undefined&&!(c===1&&j===0&&f===this._undoStart+this._undoText.length||c===0&&j===1&&(f+1===-this._undoStart||
f===-this._undoStart)))this._commitUndo();if(!this.compoundChange)if(c===1&&j===0){if(this._undoStart===undefined)this._undoStart=f;this._undoText+=e;return}else if(c===0&&j===1){e=this._undoText.length>0&&-this._undoStart===f;this._undoStart=-f;if(e)this._undoText+=this.view.getText(f,f+j);else this._undoText=this.view.getText(f,f+j)+this._undoText;return}this.add(new d(f,e,this.view.getText(f,f+j)))}}};return b}();
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(b,d,a,c,e){var f={};f.EditorCommandFactory=function(){function j(h,i,l,o,q,x){this.serviceRegistry=h;this.commandService=i;this.fileClient=l;this.inputManager=o;this.toolbarId=q;this.isReadOnly=x}j.prototype={generateEditorCommands:function(h){function i(q){return c.KeyBinding.apply(this,q)}if(!this.isReadOnly){h.getTextView().setKeyBinding(new c.KeyBinding("s",
true),"Save");h.getTextView().setAction("Save",b.hitch(this,function(){var q=h.getTextView().getText();this.fileClient.write(this.inputManager.getInput(),q).then(b.hitch(this,function(){h.onInputChange(this.inputManager.getInput(),null,q,true);this.inputManager.afterSave&&this.inputManager.afterSave()}));return true}));this.commandService.addCommand(new d.Command({name:"Save",id:"orion.save",callback:function(q){q.getTextView().invokeAction("Save")}}),"dom");this.commandService.addCommandGroup("orion.editorActions.unlabeled",
200,null,null,this.toolbarId);this.commandService.registerCommandContribution("orion.save",1,this.toolbarId,"orion.editorActions.unlabeled",new d.CommandKeyBinding("s",true));this.commandService.addCommandGroup("orion.editorActions.contributed.noImages",100,"More",null,this.toolbarId);this.commandService.addCommandGroup("orion.editorActions.contributed.images",101,null,null,this.toolbarId);for(var l=this.serviceRegistry.getServiceReferences("orion.edit.command"),o=0;o<l.length;o++)this.serviceRegistry.getService(l[o]).then(b.hitch(this,
function(q){for(var x={},t=l[o].getPropertyNames(),r=0;r<t.length;r++)x[t[r]]=l[o].getProperty(t[r]);t=h.getTextView();r=new d.Command({name:x.name,image:x.img,id:x.name,callback:b.hitch(h,function(s){var y=s?s.getTextView():this.getTextView();s=y.getText();var w=y.getSelection();q.run(y.getText(w.start,w.end),s,w).then(function(g){if(g.text){y.setText(g.text);if(g.selection){y.setSelection(g.selection.start,g.selection.end);y.focus()}}else if(typeof g==="string"){y.setText(g,w.start,w.end);y.setSelection(w.start,
w.end);y.focus()}});return true})});this.commandService.addCommand(r,"dom");x.img?this.commandService.registerCommandContribution(r.id,o,this.toolbarId,"orion.editorActions.contributed.images"):this.commandService.registerCommandContribution(r.id,o,this.toolbarId,"orion.editorActions.contributed.noImages");a.generateDomCommandsInBanner(this.commandService,h);if(x.key){i.prototype=c.KeyBinding.prototype;t.setKeyBinding(new i(x.key),r.id);t.setAction(r.id,r.callback)}}))}}};return j}();f.UndoCommandFactory=
function(){function j(h,i,l){this.serviceRegistry=h;this.commandService=i;this.toolbarId=l}j.prototype={createUndoStack:function(h){var i=new e.UndoStack(h.getTextView(),200);h.getTextView().setKeyBinding(new c.KeyBinding("z",true),"Undo");h.getTextView().setAction("Undo",function(){i.undo();return true});this.commandService.addCommand(new d.Command({name:"Undo",id:"orion.undo",callback:function(o){o.getTextView().invokeAction("Undo")}}),"dom");var l=navigator.platform.indexOf("Mac")!==-1?new c.KeyBinding("z",
true,true):new c.KeyBinding("y",true);h.getTextView().setKeyBinding(l,"Redo");h.getTextView().setAction("Redo",function(){i.redo();return true});this.commandService.addCommand(new d.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 d.CommandKeyBinding("z",true),true);this.commandService.registerCommandContribution("orion.redo",401,
this.toolbarId,"orion.editorActions.unlabeled",l,true);return i}};return j}();return f});orion=orion||{};orion.textview=orion.textview||{};
orion.textview.Ruler=function(){function b(d,a,c){this._location=d||"left";this._overview=a||"page";this._rulerStyle=c;this._view=null}b.prototype={setView:function(d){this._onModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this,this._onModelChanged);this._view=d;this._onModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this,this._onModelChanged)},getLocation:function(){return this._location},getOverview:function(){return this._overview}};return b}();
orion.textview.LineNumberRuler=function(){function b(d,a,c,e){orion.textview.Ruler.call(this,d,"page",a);this._oddStyle=c||{style:{backgroundColor:"white"}};this._evenStyle=e||{style:{backgroundColor:"white"}};this._numOfDigits=0}b.prototype=new orion.textview.Ruler;b.prototype.getStyle=function(d){return d===undefined?this._rulerStyle:d&1?this._oddStyle:this._evenStyle};b.prototype.getHTML=function(d){return d===-1?this._view.getModel().getLineCount():d+1};b.prototype._onModelChanged=function(d){d=
d.start;var a=this._view.getModel(),c=a.getLineCount(),e=(c+"").length;if(this._numOfDigits!==e){this._numOfDigits=e;this._view.redrawLines(a.getLineAtOffset(d),c,this)}};return b}();
orion.textview.AnnotationRuler=function(){function b(d,a,c){orion.textview.Ruler.call(this,d,"page",a);this._defaultAnnotation=c;this._annotations=[]}b.prototype=new orion.textview.Ruler;b.prototype.clearAnnotations=function(){this._annotations=[];var d=this._view.getModel().getLineCount();this._view.redrawLines(0,d,this);this._overviewRuler&&this._view.redrawLines(0,d,this._overviewRuler)};b.prototype.getAnnotation=function(d){return this._annotations[d]};b.prototype.getAnnotations=function(){return this._annotations};
b.prototype.getStyle=function(d){switch(d){case undefined:return this._rulerStyle;case -1:return this._defaultAnnotation?this._defaultAnnotation.style:null;default:return this._annotations[d]&&this._annotations[d].style?this._annotations[d].style:null}};b.prototype.getHTML=function(d){return d===-1?this._defaultAnnotation?this._defaultAnnotation.html:"":this._annotations[d]&&this._annotations[d].html?this._annotations[d].html:""};b.prototype.setAnnotation=function(d,a){if(d!==undefined){this._annotations[d]=
a;this._view.redrawLines(d,d+1,this);this._overviewRuler&&this._view.redrawLines(d,d+1,this._overviewRuler)}};b.prototype._onModelChanged=function(d){var a=d.start,c=d.removedLineCount;if(d=d.addedLineCount-c){var e=this._view.getModel();a=e.getLineAtOffset(a);var f=[],j=this._annotations,h=false;for(var i in j){var l=i>>>0;if(a<l&&l<a+c)h=true;else{var o=l;if(l>a){o+=d;h=true}f[o]=j[l]}}this._annotations=f;if(h){c=e.getLineCount();this._view.redrawLines(a,c,this);this._overviewRuler&&this._view.redrawLines(0,
c,this._overviewRuler)}}};return b}();
orion.textview.OverviewRuler=function(){function b(d,a,c){orion.textview.Ruler.call(this,d,"document",a);if(this._annotationRuler=c)c._overviewRuler=this}b.prototype=new orion.textview.Ruler;b.prototype.getAnnotations=function(){var d=this._annotationRuler.getAnnotations(),a=[];for(var c in d){var e=c>>>0;d[e]!==undefined&&a.push(e)}return a};b.prototype.getStyle=function(d){var a;if(d===undefined){d=this._rulerStyle||{};a=d.style||(d.style={});a.lineHeight="1px";a.fontSize="1px";a.width="14px"}else{d=
d!==-1?this._annotationRuler.getAnnotation(d).overviewStyle||{}:{};a=d.style||(d.style={});a.cursor="pointer";a.width="8px";a.height="3px";a.left="2px"}return d};b.prototype.getHTML=function(){return"&nbsp;"};b.prototype.onClick=function(d){d!==undefined&&this._view.setTopIndex(d)};return b}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/textview/rulers",[],function(){return orion.textview});orion=orion||{};orion.editor=orion.editor||{};
orion.editor.UndoFactory=function(){function b(){}b.prototype={createUndoStack:function(d){var a=new orion.textview.UndoStack(d.getTextView(),200);d.getTextView().setKeyBinding(new orion.textview.KeyBinding("z",true),"Undo");d.getTextView().setAction("Undo",function(){a.undo();return true});var c=navigator.platform.indexOf("Mac")!==-1;d.getTextView().setKeyBinding(c?new orion.textview.KeyBinding("z",true,true):new orion.textview.KeyBinding("y",true),"Redo");d.getTextView().setAction("Redo",function(){a.redo();
return true});return a}};return b}();orion.editor.LineNumberRulerFactory=function(){function b(){}b.prototype={createLineNumberRuler:function(){return new orion.textview.LineNumberRuler("left",{style:{backgroundColor:"#ffffff",textAlign:"right",borderLeft:"1px solid #ddd",borderRight:"1px solid #ddd"}},{style:{backgroundColor:"#ffffff"}},{style:{backgroundColor:"#ffffff"}})}};return b}();
orion.editor.AnnotationFactory=function(){function b(d){this.problemImageUrl=d}b.prototype={createAnnotationRulers:function(){var d={style:{backgroundColor:"#ffffff"}};this.annotationRuler=new orion.textview.AnnotationRuler("left",d,{html:"<img src='"+this.problemImageUrl+"'></img>"});this.overviewRuler=new orion.textview.OverviewRuler("right",d,this.annotationRuler);return{annotationRuler:this.annotationRuler,overviewRuler:this.overviewRuler}},showProblems:function(d){var a,c;d=d||[];d.length>0&&
d[d.length-1]===null&&d.pop();var e=this.annotationRuler;if(e){e.clearAnnotations();var f=-1;for(a in d)if(d[a]){c=d[a].reason.replace(/'/g,"&#39;").replace(/"/g,"&#34;");c={line:d[a].line-1,column:d[a].character,html:"<img src='"+this.problemImageUrl+"' title='"+c+"' alt='"+c+"'></img>",overviewStyle:{style:{backgroundColor:"lightcoral",border:"1px solid red"}}};if(f!==d[a].line){e.setAnnotation(d[a].line-1,c);f=d[a].line}}}}};return b}();
orion.editor.TextActions=function(){function b(d,a){this.editor=d;this.textView=d.getTextView();this.undoStack=a;this._incrementalFindActive=false;this._incrementalFindSuccess=true;this._incrementalFindIgnoreSelection=false;this._incrementalFindPrefix="";this.init()}b.prototype={init:function(){this._incrementalFindListener={onVerify:dojo.hitch(this,function(e){var f=this._incrementalFindPrefix,j=this.textView.getText(e.start,e.end);if((f=f.match(new RegExp("^"+dojo.regexp.escapeString(j),"i")))&&
f.length>0){f=this._incrementalFindPrefix+=e.text;this.editor.reportStatus("Incremental find: "+f);j=f.toLowerCase()===f;if(j=this.editor.doFind(f,this.textView.getSelection().start,j)){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;this.editor.moveSelection(this.textView,j.index,j.index+j.length);this._incrementalFindIgnoreSelection=false}else{this.editor.reportStatus("Incremental find: "+f+" (not found)",true);this._incrementalFindSuccess=false}e.text=null}}),onSelection:dojo.hitch(this,
function(){this._incrementalFindIgnoreSelection||this.toggleIncrementalFind()})};var d="",a,c;this.textView.setKeyBinding(new orion.textview.KeyBinding("f",true),"Find...");this.textView.setAction("Find...",dojo.hitch(this,function(){setTimeout(dojo.hitch(this,function(){var e=this.textView.getSelection();d=e.end>e.start?this.textView.getText().substring(e.start,e.end):"";if(d=prompt("Enter search term or /regex/:",d)){e=d.toLowerCase()===d;var f=this.editor.parseRegExp(d);if(f){a=f.pattern;c=f.flags;
c+=e&&c.indexOf("i")===-1?"i":"";e=this.editor.doFindRegExp(a,c,this.textView.getCaretOffset())}else{c=a=null;e=this.editor.doFind(d,this.textView.getCaretOffset(),e)}e?this.editor.moveSelection(this.textView,e.index,e.index+e.length):this.editor.reportStatus("not found",true)}}),0);return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding("k",true),"Find Next Occurrence");this.textView.setAction("Find Next Occurrence",dojo.hitch(this,function(){var e;if(this._incrementalFindActive){var f=
this._incrementalFindPrefix;e=f.toLowerCase()===f;e=this.editor.doFind(f,this.textView.getCaretOffset(),e)}else if(a)e=this.editor.doFindRegExp(a,c,this.textView.getCaretOffset());else{e=this.textView.getSelection();if(e.end>e.start)d=this.textView.getText().substring(e.start,e.end);e=this.editor.doFind(d,this.textView.getCaretOffset(),true)}if(e){this._incrementalFindIgnoreSelection=true;this.editor.moveSelection(this.textView,e.index,e.index+e.length);this._incrementalFindIgnoreSelection=false}else this.editor.reportStatus("not found",
true);return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding("k",true,true),"Find Previous Occurrence");this.textView.setAction("Find Previous Occurrence",dojo.hitch(this,function(){var e=this.textView.getSelection(),f=e.end>e.start?e.end-e.start:0;if(this._incrementalFindActive){var j=this._incrementalFindPrefix;e=j.toLowerCase()===j;f=this.editor.doFind(j,this.textView.getCaretOffset()-f-1,e,true)}else if(a)f=this.editor.doFindRegExp(a,c,this.textView.getCaretOffset()-f-1,true);
else{if(f>0)d=this.textView.getText().substring(e.start,e.end);f=this.editor.doFind(d,this.textView.getCaretOffset()-f-1,true,true)}if(f){this._incrementalFindIgnoreSelection=true;this.editor.moveSelection(this.textView,f.index,f.index+f.length);this._incrementalFindIgnoreSelection=false}else this.editor.reportStatus("not found",true);return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding("j",true),"Incremental Find");this.textView.setAction("Incremental Find",dojo.hitch(this,function(){if(this._incrementalFindActive){var e=
this._incrementalFindPrefix;if(e.length!==0){var f=this.textView.getSelection().start+1;if(this._incrementalFindSuccess===false)f=0;var j=e.toLowerCase()===e;if(f=this.editor.doFind(e,f,j)){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;this.editor.moveSelection(this.textView,f.index,f.index+f.length);this._incrementalFindIgnoreSelection=false;this.editor.reportStatus("Incremental find: "+e)}else{this.editor.reportStatus("Incremental find: "+e+" (not found)",true);this._incrementalFindSuccess=
false}}}else{this.textView.setCaretOffset(this.textView.getCaretOffset());this.toggleIncrementalFind()}return true}));this.textView.setAction("deletePrevious",dojo.hitch(this,function(){if(this._incrementalFindActive){var e=this._incrementalFindPrefix;e=this._incrementalFindPrefix=e.substring(0,e.length-1);if(e.length===0){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;this.textView.setCaretOffset(this.textView.getSelection().start);this._incrementalFindIgnoreSelection=false;
this.toggleIncrementalFind();return true}this.editor.reportStatus("Incremental find: "+e);var f=this.textView.getText().lastIndexOf(e,this.textView.getCaretOffset()-e.length-1);if(f!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;this.editor.moveSelection(this.textView,f,f+e.length);this._incrementalFindIgnoreSelection=false}else this.editor.reportStatus("Incremental find: "+e+" (not found)",true);return true}else return false}));this.textView.setAction("tab",dojo.hitch(this,
function(){var e=this.textView.getSelection(),f=this.textView.getModel(),j=f.getLineAtOffset(e.start),h=f.getLineAtOffset(e.end>e.start?e.end-1:e.end);if(j!==h){var i=[];i.push("");for(var l=j;l<=h;l++)i.push(f.getLine(l,true));this.startUndo();l=f.getLineStart(j);this.textView.setText(i.join("\t"),l,f.getLineEnd(h,true));this.textView.setSelection(l===e.start?e.start:e.start+1,e.end+(h-j+1));this.endUndo();return true}return false}));this.textView.setKeyBinding(new orion.textview.KeyBinding(9,false,
true),"Unindent Lines");this.textView.setAction("Unindent Lines",dojo.hitch(this,function(){for(var e=this.textView.getSelection(),f=this.textView.getModel(),j=f.getLineAtOffset(e.start),h=f.getLineAtOffset(e.end>e.start?e.end-1:e.end),i=[],l=j;l<=h;l++){var o=f.getLine(l,true);if(o.indexOf("\t")!==0)return false;i.push(o.substring(1))}this.startUndo();l=f.getLineStart(j);o=f.getLineStart(h);this.textView.setText(i.join(""),l,f.getLineEnd(h,true));this.textView.setSelection(l===e.start?e.start:e.start-
1,e.end-(h-j+1)+(e.end===o+1?1:0));this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding(38,false,false,true),"Move Lines Up");this.textView.setAction("Move Lines Up",dojo.hitch(this,function(){var e=this.textView.getSelection(),f=this.textView.getModel(),j=f.getLineAtOffset(e.start);if(j===0)return true;this.startUndo();var h=f.getLineAtOffset(e.end>e.start?e.end-1:e.end);e=f.getLineCount()-1===h;var i=f.getLineStart(j);h=e?f.getCharCount():f.getLineStart(h+1);if(e){i=
f.getLineEnd(j-1);var l=f.getLineEnd(j-1,true),o=f.getText(i,l);i=i;f.setText(f.getText(l,h)+o,i,h)}l=f.getText(i,h);f.setText("",i,h);j=f.getLineStart(j-1);f.setText(l,j,j);f=j+l.length-(e?f.getLineDelimiter().length:0);this.textView.setSelection(j,f);this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding(40,false,false,true),"Move Lines Down");this.textView.setAction("Move Lines Down",dojo.hitch(this,function(){var e=this.textView.getSelection(),f=this.textView.getModel(),
j=f.getLineAtOffset(e.start),h=f.getLineAtOffset(e.end>e.start?e.end-1:e.end);if(h===f.getLineCount()-1)return true;this.startUndo();e=h===f.getLineCount()-2;j=f.getLineStart(j);var i=f.getLineStart(h+1);if(e){var l=f.getLineStart(h+1)-f.getLineDelimiter().length,o=f.getLineStart(h+1);o=f.getText(l,o);f.setText(o+f.getText(j,l),j,i)}l=f.getText(j,i);h=(e?f.getCharCount():f.getLineStart(h+2))-(i-j);f.setText("",j,i);f.setText(l,h,h);this.textView.setSelection(h+(e?f.getLineDelimiter().length:0),h+
l.length);this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding(38,true,false,true),"Copy Lines Up");this.textView.setAction("Copy Lines Up",dojo.hitch(this,function(){this.startUndo();var e=this.textView.getSelection(),f=this.textView.getModel(),j=f.getLineDelimiter(),h=f.getLineAtOffset(e.start),i=f.getLineAtOffset(e.end>e.start?e.end-1:e.end);h=f.getLineStart(h);i=(e=f.getLineCount()-1===i)?f.getCharCount():f.getLineStart(i+1);i=f.getText(h,i)+(e?j:"");f.setText(i,
h,h);this.textView.setSelection(h,h+i.length-(e?j.length:0));this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding(40,true,false,true),"Copy Lines Down");this.textView.setAction("Copy Lines Down",dojo.hitch(this,function(){this.startUndo();var e=this.textView.getSelection(),f=this.textView.getModel(),j=f.getLineDelimiter(),h=f.getLineAtOffset(e.start);e=f.getLineAtOffset(e.end>e.start?e.end-1:e.end);var i=f.getLineStart(h);e=(h=f.getLineCount()-1===e)?f.getCharCount():
f.getLineStart(e+1);i=(h?j:"")+f.getText(i,e);f.setText(i,e,e);this.textView.setSelection(e+(h?j.length:0),e+i.length);this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding("d",true,false,false),"Delete Selected Lines");this.textView.setAction("Delete Selected Lines",dojo.hitch(this,function(){this.startUndo();var e=this.textView.getSelection(),f=this.textView.getModel(),j=f.getLineAtOffset(e.start);e=f.getLineAtOffset(e.end>e.start?e.end-1:e.end);j=f.getLineStart(j);
e=f.getLineCount()-1===e?f.getCharCount():f.getLineStart(e+1);f.setText("",j,e);this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding("l",true),"Goto Line...");this.textView.setAction("Goto Line...",dojo.hitch(this,function(){var e=this.textView.getModel().getLineAtOffset(this.textView.getCaretOffset());if(e=prompt("Go to line:",e+1)){e=parseInt(e,10);this.editor.onGotoLine(e-1,0)}return true}))},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},lineUp:function(){var d;if(this._incrementalFindActive){var a=this._incrementalFindPrefix;d=this.textView.getCaretOffset()-a.length-1;if(this._incrementalFindSuccess===false)d=this.textView.getModel().getCharCount()-1;d=this.textView.getText().lastIndexOf(a,
d);if(d!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;this.editor.moveSelection(this.textView,d,d+a.length);this._incrementalFindIgnoreSelection=false}else{this.editor.reportStatus("Incremental find: "+a+" (not found)",true);this._incrementalFindSuccess=false}return true}return false},lineDown:function(){var d;if(this._incrementalFindActive){var a=this._incrementalFindPrefix;if(a.length===0)return;d=this.textView.getSelection().start+1;if(this._incrementalFindSuccess===
false)d=0;d=this.textView.getText().indexOf(a,d);if(d!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;this.editor.moveSelection(this.textView,d,d+a.length);this._incrementalFindIgnoreSelection=false;this.editor.reportStatus("Incremental find: "+a)}else{this.editor.reportStatus("Incremental find: "+a+" (not found)",true);this._incrementalFindSuccess=false}return true}return false},enter:function(){return false}};return b}();
orion.editor.SourceCodeActions=function(){function b(d,a,c){this.editor=d;this.textView=d.getTextView();this.undoStack=a;this.contentAssist=c;this.init()}b.prototype={startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},init:function(){function d(a,c,e){var f=a.getLineAtOffset(c),j=a.getLineAtOffset(e),h,i,l,o,q,x;for(h=f;h>=0;h--){i=a.getLine(h);l=h===f?c-a.getLineStart(f):i.length;o=i.lastIndexOf("/*",l);
i=i.lastIndexOf("*/",l);if(i>o)break;else if(o!==-1){q=a.getLineStart(h)+o;break}}for(h=j;h<a.getLineCount();h++){i=a.getLine(h);l=h===j?e-a.getLineStart(j):0;o=i.indexOf("/*",l);i=i.indexOf("*/",l);if(o!==-1&&o<i)break;else if(i!==-1){x=a.getLineStart(h)+i;break}}return{commentStart:q,commentEnd:x}}this.textView.setKeyBinding(new orion.textview.KeyBinding(191,true),"Toggle Line Comment");this.textView.setAction("Toggle Line Comment",dojo.hitch(this,function(){this.startUndo();for(var a=this.textView.getSelection(),
c=this.textView.getModel(),e=c.getLineAtOffset(a.start),f=c.getLineAtOffset(a.end>a.start?a.end-1:a.end),j=true,h,i=e;i<=f&&j;i++){h=this.textView.getModel().getLine(i);var l=h.indexOf("//");if(l===-1)j=false;else if(l!==0){for(j=0;j<l;j++){var o=h.charCodeAt(j);if(!(o===32||o===9))break}j=j===l}}i=[];l=c.getLineStart(e);if(j){o=c.getLineStart(f);for(j=e;j<=f;j++){var q=c.getLine(j,true),x=h.indexOf("//");i.push(q.substring(0,x)+q.substring(x+2))}this.textView.setText(i.join(""),l,c.getLineEnd(f,
true));this.textView.setSelection(l===a.start?a.start:a.start-2,a.end-2*(f-e+1)+(a.end===o+1?2:0))}else{i.push("");for(j=e;j<=f;j++)i.push(c.getLine(j,true));this.textView.setText(i.join("//"),l,c.getLineEnd(f,true));this.textView.setSelection(l===a.start?a.start:a.start+2,a.end+2*(f-e+1))}this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding(191,true,true),"Add Block Comment");this.textView.setAction("Add Block Comment",dojo.hitch(this,function(){var a=this.textView.getSelection(),
c=this.textView.getModel(),e=new RegExp("/\\*|\\*/","g");c.getLineAtOffset(a.start);c.getLineAtOffset(a.end);var f=d(c,a.start,a.end);if(f.commentStart!==undefined&&f.commentEnd!==undefined)return true;f=c.getText(a.start,a.end);if(f.length===0)return true;var j=f.length;f=f.replace(e,"");e=f.length;this.startUndo();c.setText("/*"+f+"*/",a.start,a.end);this.textView.setSelection(a.start+2,a.end+2+(e-j));this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding(220,true,
true),"Remove Block Comment");this.textView.setAction("Remove Block Comment",dojo.hitch(this,function(){var a=this.textView.getSelection(),c=this.textView.getModel();c.getLineAtOffset(a.start);c.getLineAtOffset(a.end);var e=c.getText(a.start,a.end),f,j,h;for(h=0;h<e.length;h++)if(e.substring(h,h+2)==="/*"){f=a.start+h;break}for(;h<e.length;h++)if(e.substring(h,h+2)==="*/"){j=a.start+h;break}this.startUndo();if(f!==undefined&&j!==undefined){c.setText(c.getText(f+2,j),f,j+2);this.textView.setSelection(f,
j)}else{e=d(c,a.start,a.end);if(e.commentStart===undefined||e.commentEnd===undefined)return true;f=c.getText(e.commentStart+2,e.commentEnd);c.setText(f,e.commentStart,e.commentEnd+2);this.textView.setSelection(a.start-2,a.end-2)}this.endUndo();return true}));this.textView.setAction("enter",dojo.hitch(this,function(){if(this.contentAssist&&this.contentAssist.isActive())return this.contentAssist.enter();var a=this.textView.getSelection();if(a.start===a.end){var c=this.textView.getModel(),e=c.getLineAtOffset(a.start),
f=c.getLine(e),j=c.getLineStart(e);e=0;j=a.start-j;for(var h;e<j&&((h=f.charCodeAt(e))===32||h===9);)e++;if(e>0){var i=f.substring(0,e);for(e=j;e<f.length&&((h=f.charCodeAt(e++))===32||h===9);)a.end++;this.textView.setText(c.getLineDelimiter()+i,a.start,a.end);return true}}return false}))},cancel:function(){return false},isActive:function(){return false},lineUp:function(){return false},lineDown:function(){return false},enter:function(){return false}};return b}();
typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/editor/editorFeatures",["dojo","orion/textview/undoStack","orion/textview/keyBinding","orion/textview/rulers"],function(){return orion.editor});orion=orion||{};orion.editor=orion.editor||{};
orion.editor.Editor=function(){function b(d){this._textViewFactory=d.textViewFactory;this._undoStackFactory=d.undoStackFactory;this._annotationFactory=d.annotationFactory;this._lineNumberRulerFactory=d.lineNumberRulerFactory;this._contentAssistFactory=d.contentAssistFactory;this._keyBindingFactory=d.keyBindingFactory;this._statusReporter=d.statusReporter;this._domNode=d.domNode;this._syntaxHighlightProviders=d.syntaxHighlightProviders;this._overviewRuler=this._annotationsRuler=null;this._dirty=false;
this._contentAssist=null;this._keyModes=[]}b.prototype={getTextView:function(){return this._textView},reportStatus:function(d,a){this._statusReporter?this._statusReporter(d,a):window.alert(a?"ERROR: "+d:d)},moveSelection:function(d,a,c){c=c||a;d.setSelection(a,c,false);c=d.getTopPixel();var e=d.getBottomPixel();a=d.getModel().getLineAtOffset(a);a=d.getLinePixel(a);if(a<c||a>e){e=Math.max(0,a-Math.floor((a<c?3:1)*(e-c)/4));(new dojo.Animation({node:d,duration:300,curve:[c,e],onAnimate:function(f){d.setTopPixel(Math.floor(f))},
onEnd:function(){d.showSelection();d.focus()}})).play()}else{d.showSelection();d.focus()}},getContents:function(){if(this._textView)return this._textView.getText()},isDirty:function(){return this._dirty},checkDirty:function(){var d=!this._undoStack.isClean();this._dirty!==d&&this.onDirtyChange(d)},getAnnotationsRuler:function(){return this._annotationsRuler},doFind:function(d,a,c,e){var f=this._textView.getText();if(c){d=d.toLowerCase();f=f.toLowerCase()}if(e){f=f.split("").reverse().join("");d=d.split("").reverse().join("");
a=f.length-a-1;a=f.indexOf(d,a);if(a!==-1)return{index:f.length-d.length-a,length:d.length}}else{a=f.indexOf(d,a);if(a!==-1)return{index:a,length:d.length}}return null},doFindRegExp:function(d,a,c,e){if(!d)return null;a=a||"";a+=(a.indexOf("g")===-1?"g":"")+(a.indexOf("m")===-1?"m":"");d=new RegExp(d,a);a=this._textView.getText();var f=null,j=null;if(e)for(;;)if((f=d.exec(a))&&f.index<=c)j={index:f.index,length:f[0].length};else return j;else return(f=d.exec(a.substring(c)))&&{index:f.index+c,length:f[0].length}},
parseRegExp:function(d){if(d=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(d))return{pattern:d[1],flags:d[2]};return null},installTextView:function(){function d(){var f=c.getModel(),j=c.getCaretOffset(),h=f.getLineAtOffset(j);f=f.getLineStart(h);j=j-f;for(f=0;f<this._keyModes.length;f++)if(this._keyModes[f].isActive())return;this.reportStatus("Line "+(h+1)+" : Col "+j)}this._textView=this._textViewFactory();if(this._undoStackFactory)this._undoStack=this._undoStackFactory.createUndoStack(this);if(this._contentAssistFactory){this._contentAssist=
this._contentAssistFactory(this);this._keyModes.push(this._contentAssist)}var a=this,c=this._textView;this._keyBindingFactory&&this._keyBindingFactory(this,this._keyModes,this._undoStack,this._contentAssist);c.setKeyBinding(new orion.textview.KeyBinding(27),"Cancel Current Mode");c.setAction("Cancel Current Mode",dojo.hitch(this,function(){for(var f=0;f<this._keyModes.length;f++)if(this._keyModes[f].isActive())return this._keyModes[f].cancel();return false}));c.setAction("lineUp",dojo.hitch(this,
function(){for(var f=0;f<this._keyModes.length;f++)if(this._keyModes[f].isActive())return this._keyModes[f].lineUp();return false}));c.setAction("lineDown",dojo.hitch(this,function(){for(var f=0;f<this._keyModes.length;f++)if(this._keyModes[f].isActive())return this._keyModes[f].lineDown();return false}));c.addEventListener("ModelChanged",this,this.checkDirty);c.addEventListener("Selection",this,d);if(this._annotationFactory){var e=this._annotationFactory.createAnnotationRulers();this._annotationsRuler=
e.annotationRuler;this._annotationsRuler.onClick=function(f){if(f!==undefined)if(f!==-1){f=this.getAnnotation(f);f!==undefined&&a.onGotoLine(f.line,f.column)}};this._overviewRuler=e.overviewRuler;this._overviewRuler.onClick=function(f){f!==undefined&&a.moveSelection(c,c.getModel().getLineStart(f))};c.addRuler(this._annotationsRuler);c.addRuler(this._overviewRuler)}if(this._lineNumberRulerFactory){this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler();c.addRuler(this._lineNumberRuler)}},
showSelection:function(d,a,c,e,f){if(typeof d==="number"){if(typeof a!=="number")a=d;this.moveSelection(this._textView,d,a)}else if(typeof c==="number"){d=this._textView.getModel().getLineStart(c-1);if(typeof e==="number")d+=e;if(typeof f!=="number")f=0;this.moveSelection(this._textView,d,d+f)}},onInputChange:function(d,a,c,e){if(e&&this._textView){this._undoStack.markClean();this.checkDirty()}else if(this._textView){if(a)this._textView.setText(a);else c!==null&&c!==undefined&&this._textView.setText(c);
this._undoStack.reset();this.checkDirty();this._textView.focus()}},onGotoLine:function(d,a,c){if(this._textView){var e=this._textView.getModel().getLineStart(d);if(typeof a==="string"){var f=this._textView.getModel().getLine(d).indexOf(a);if(f!==-1){c=f+a.length;a=f}else a=0}d=Math.min(this._textView.getModel().getLineEnd(d),a);if(c===undefined)c=d;this.moveSelection(this._textView,e+d,e+c)}},onDirtyChange:function(d){this._dirty=d}};return b}();
typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/editor/editor",["dojo","orion/textview/keyBinding"],function(){return orion.editor});
define("orion/syntaxchecker",["dojo"],function(b){var d=d||{};d.SyntaxChecker=function(){function a(c,e){this.registry=c;this.editorContainer=e;b.connect(this.editorContainer,"onInputChange",this,this.checkSyntax)}a.prototype={checkSyntax:function(c,e,f){if(!e){var j;e=this.registry.getServiceReferences("orion.edit.validator");for(var h=0;h<e.length;h++){var i=e[h],l=i.getProperty("pattern");if(l&&(new RegExp(l)).test(c))j=i}if(j){e=b.hitch(this,function(o){this.registry.getService("orion.core.marker").then(function(q){q._setProblems(o.errors)});
this.registry.getService("orion.edit.outline").then(function(q){q._setItems({title:c,contents:f,data:o})})});this.registry.getService(j).then(function(o){return o.checkSyntax(c,f)}).then(e)}else this.registry.getService("orion.edit.outline").then(function(o){o._setItems({title:c,contents:f})})}}};return a}();return d});orion=orion||{};orion.editor=orion.editor||{};
orion.editor.AbstractStyler=function(){function b(){}b.prototype={initialize:function(d){this.textView=d;d.addEventListener("Selection",this,this._onSelection);d.addEventListener("ModelChanged",this,this._onModelChanged);d.addEventListener("Destroy",this,this._onDestroy);d.addEventListener("LineStyle",this,this._onLineStyle);d.redrawLines()},destroy:function(){if(this.textView){this.textView.removeEventListener("Selection",this,this._onSelection);this.textView.removeEventListener("ModelChanged",this,
this._onModelChanged);this.textView.removeEventListener("Destroy",this,this._onDestroy);this.textView.removeEventListener("LineStyle",this,this._onLineStyle);this.textView=null}},_onSelection:function(){},_onModelChanged:function(){},_onDestroy:function(){},_onLineStyle:function(){}};return b}();
orion.editor.AbstractStyler.extend=function(b,d){if(typeof b!=="function")throw new Error("Function expected");b.prototype=new orion.editor.AbstractStyler;b.constructor=b;for(var a in d)if(d.hasOwnProperty(a))b.prototype[a]=d[a]};
orion.editor.RegexUtil={unsupported:[{regex:/\(\?[ims\-]:/,func:function(){return"option on/off for subexp"}},{regex:/\(\?<([=!])/,func:function(b){return b[1]==="="?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(){return"atomic group"}}],toRegExp:function(b){function d(j,h){throw new Error('Unsupported regex feature "'+j+'": "'+h[0]+'" at index: '+h.index+" in "+h.input);}function a(j,h){var i=0,l=j.length,o=-1;for(h=h;h<l&&o===-1;h++)switch(j[h]){case "\\":h+=1;break;case "(":i++;
break;case ")":i--;if(i===0)o=h;break}return o}function c(j){for(var h="",i=false,l=j.length,o=0;o<l;){var q=j[o];if(!i&&q==="#")for(;o<l&&q!=="\r"&&q!=="\n";)q=j[++o];else if(!i&&/\s/.test(q))for(;o<l&&/\s/.test(q);)q=j[++o];else{if(q==="\\"){h+=q;if(!/\s/.test(j[o+1])){h+=j[o+1];o+=1}}else{if(q==="[")i=true;else if(q==="]")i=false;h+=q}o+=1}}return h}var e;for(e=0;e<this.unsupported.length;e++){var f;if(f=this.unsupported[e].regex.exec(b))d(this.unsupported[e].func(f))}if(b.substring(0,4)==="(?x)")b=
c(b.substring(4));else if(b.substring(0,4)==="(?x:"){e=a(b,0);if(e<b.length-1)throw new Error("Only a (?x:) group that encloses the entire regex is supported: "+b);b=c(b.substring(4,e))}return new RegExp(b,"")},hasBackReference:function(b){return/\\\d+/.test(b.source)},getSubstitutedRegex:function(b,d,a){a=typeof a==="undefined"?true:false;b=b.source.split(/(\\\d+)/g);for(var c=[],e=0;e<b.length;e++){var f=b[e],j=/\\(\d+)/.exec(f);if(j){f=d[j[1]]||"";c.push(a?orion.editor.RegexUtil.escapeRegex(f):
f)}else c.push(f)}return new RegExp(c.join(""))},escapeRegex:function(b){return b.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")},groupify:function(b,d){var a=b.source,c=a.length,e=[],f=0,j=[],h=1,i=1,l=[];b={};for(var o={},q=0;q<c;q++){var x=e[e.length-1],t=a[q];switch(t){case "(":if(x===4){e.pop();l.push(")");j[j.length-1].end=q}var r=q+2<c?a[q+1]+""+a[q+2]:null;if(r==="?:"||r==="?="||r==="?!"){var s;if(r==="?:")s=1;else{s=3;f++}e.push(s);j.push({start:q,end:-1,type:s});l.push(t);l.push(r);q+=r.length}else{e.push(2);
j.push({start:q,end:-1,type:2,oldNum:h,num:i});l.push(t);if(f===0)o[i]=null;b[h]=i;h++;i++}break;case ")":x=e.pop();x===3&&f--;j[j.length-1].end=q;l.push(t);break;case "*":case "+":case "?":case "}":var y=t,w=a[q-1];r=q-1;if(t==="}"){for(s=q-1;a[s]!=="{"&&s>=0;s--);w=a[s-1];r=s-1;y=a.substring(s,q+1)}s=j[j.length-1];if(w===")"&&(s.type===2||s.type===4)){l.splice(s.start,0,"(");l.push(y);l.push(")");t={start:s.start,end:l.length-1,type:4,num:s.num};for(w=0;w<j.length;w++){x=j[w];if(x.type===2||x.type===
4)if(x.start>=s.start&&x.end<=r){x.start+=1;x.end+=1;x.num+=1;if(x.type===2)b[x.oldNum]=x.num}}j.push(t);i++;break}default:if(t!=="|"&&x!==2&&x!==4)if(f===0){e.push(4);j.push({start:q,end:-1,type:4,num:i});l.push("(");o[i]=null;i++}l.push(t);if(t==="\\"){l.push(a[q+1]);q+=1}break}}for(;e.length;){e.pop();l.push(")")}a=new RegExp(l.join(""));c={};d=d||b;for(var g in d)if(d.hasOwnProperty(g))c[g]="\\"+d[g];a=this.getSubstitutedRegex(a,c,false);return[a,b,o]},complexCaptures:function(b){if(!b)return false;
for(var d in b)if(b.hasOwnProperty(d))if(d!=="0")return true;return false}};
orion.editor.TextMateStyler=function(){function b(d,a){this.initialize(d);this.grammar=this.copy(a);this._styles={};this._tree=null;this.preprocess()}orion.editor.AbstractStyler.extend(b,{copy:function(d){return JSON.parse(JSON.stringify(d))},preprocess:function(){for(var d=[this.grammar];d.length!==0;){var a=d.pop();if(!(a._resolvedRule&&a._typedRule)){a._resolvedRule=this._resolve(a);a._typedRule=this._createTypedRule(a);this.addStyles(a.name);this.addStyles(a.contentName);this.addStylesForCaptures(a.captures);
this.addStylesForCaptures(a.beginCaptures);this.addStylesForCaptures(a.endCaptures);a._resolvedRule!==a&&d.push(a._resolvedRule);if(a.patterns)for(var c=0;c<a.patterns.length;c++)d.push(a.patterns[c])}}},addStyles:function(d){if(d&&!this._styles[d])this._styles[d]=dojo.map(d.split("."),function(a,c,e){return e.slice(0,c+1).join("-")})},addStylesForCaptures:function(d){for(var a in d)d.hasOwnProperty(a)&&this.addStyles(d[a].name)},ContainerRule:function(){function d(a){this.rule=a;this.subrules=a.patterns}
d.prototype.valueOf=function(){return"aa"};return d}(),BeginEndRule:function(){function d(a){this.rule=a;this.beginRegex=orion.editor.RegexUtil.toRegExp(a.begin);this.endRegex=orion.editor.RegexUtil.toRegExp(a.end);this.subrules=a.patterns||[];this.endRegexHasBackRef=orion.editor.RegexUtil.hasBackReference(this.endRegex);var c=orion.editor.RegexUtil.complexCaptures(a.captures);a=orion.editor.RegexUtil.complexCaptures(a.beginCaptures)||orion.editor.RegexUtil.complexCaptures(a.endCaptures);if(this.isComplex=
c||a){c=orion.editor.RegexUtil.groupify(this.beginRegex);this.beginRegex=c[0];this.beginOld2New=c[1];this.beginConsuming=c[2];c=orion.editor.RegexUtil.groupify(this.endRegex,this.beginOld2New);this.endRegex=c[0];this.endOld2New=c[1];this.endConsuming=c[2]}}d.prototype.valueOf=function(){return this.beginRegex};return d}(),MatchRule:function(){function d(a){this.rule=a;this.matchRegex=orion.editor.RegexUtil.toRegExp(a.match);if(this.isComplex=orion.editor.RegexUtil.complexCaptures(a.captures)){a=orion.editor.RegexUtil.groupify(this.matchRegex);
this.matchRegex=a[0];this.matchOld2New=a[1];this.matchConsuming=a[2]}}d.prototype.valueOf=function(){return this.matchRegex};return d}(),_createTypedRule:function(d){return d.match?new this.MatchRule(d):d.begin?new this.BeginEndRule(d):new this.ContainerRule(d)},_resolve:function(d){var a=d;if(d.include){if(d.begin||d.end||d.match)throw new Error('Unexpected regex pattern in "include" rule '+d.include);d=d.include;if(d.charAt(0)==="#"){a=this.grammar.repository&&this.grammar.repository[d.substring(1)];
if(!a)throw new Error("Couldn't find included rule "+d+" in grammar repository");}else if(d==="$self")a=this.grammar;else if(d==="$base")throw new Error('Include "$base" is not supported');else throw new Error('Include external rule "'+d+'" is not supported');}return a},ContainerNode:function(){function d(a,c){this.parent=a;this.rule=c;this.children=[];this.end=this.start=null}d.prototype.addChild=function(a){this.children.push(a)};d.prototype.valueOf=function(){var a=this.rule;return"ContainerNode { "+
(a.include||"")+" "+(a.name||"")+(a.comment||"")+"}"};return d}(),BeginEndNode:function(){function d(a,c,e){this.parent=a;this.rule=c;this.children=[];this.setStart(e);this.endMatch=this.end=null;this.endRegexSubstituted=c.endRegexHasBackRef?orion.editor.RegexUtil.getSubstitutedRegex(c.endRegex,e):null}d.prototype.addChild=function(a){this.children.push(a)};d.prototype.getIndexInParent=function(){return this.parent?this.parent.children.indexOf(this):-1};d.prototype.setStart=function(a){this.start=
a.index;this.beginMatch=a};d.prototype.setEnd=function(a){if(a&&typeof a==="object"){this.endMatch=a;this.end=a.index+a[0].length}else{this.endMatch=null;this.end=a}};d.prototype.shiftStart=function(a){this.start+=a;this.beginMatch.index+=a};d.prototype.shiftEnd=function(a){this.end+=a;if(this.endMatch)this.endMatch.index+=a};d.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range="+this.start+".."+this.end+"}"};return d}(),push:function(d,a){if(a)for(var c=a.length;c>0;)d.push(a[--c])},
exec:function(d,a,c){if(a=d.exec(a))a.index+=c;d.lastIndex=0;return a},afterMatch:function(d){return d.index+d[0].length},getEndMatch:function(d,a,c){if(d instanceof this.BeginEndNode){var e=d.rule;d=d.endRegexSubstituted||e.endRegex;if(!d)return null;return this.exec(d,a,c)}return null},initialParse:function(){this.textView.getModel().getCharCount();this._tree=new this.ContainerNode(null,this.grammar._typedRule);this.parse(this._tree,false,0)},_onModelChanged:function(d){var a=d.addedCharCount,c=
d.removedCharCount;d=d.start;if(this._tree){var e=this.textView.getModel(),f=e.getCharCount();e=e.getLineEnd(e.getLineAtOffset(d)-1);var j=this.getFirstDamaged(e,e);e=e===-1?0:e;a=j?this.parse(j,true,e,d,a,c):f;this.textView.redrawRange(e,a)}else this.initialParse()},getFirstDamaged:function(d,a){if(d<0)return this._tree;for(var c=[this._tree],e=null;c.length;){var f=c.pop();if(!f.parent||this.isDamaged(f,d,a)){if(f instanceof this.BeginEndNode)e=f;for(var j=0;j<f.children.length;j++)c.push(f.children[j])}}return e||
this._tree},isDamaged:function(d,a,c){return d.start<=c&&d.end>a},parse:function(d,a,c,e,f,j){var h=this.textView.getModel(),i=h.getLineStart(h.getLineCount()-1),l=h.getCharCount(),o=this.getInitialExpected(d,c),q=-1;if(a){d.repaired=true;d.endNeedsUpdate=true;q=d.children[d.children.length-1];var x=f-j;q=q?h.getLineEnd(h.getLineAtOffset(q.end+x)):-1;e=h.getLineEnd(h.getLineAtOffset(e+j));q=Math.max(q,e)}q=q===-1?l:q;e=o;var t=d;x=false;for(var r=c,s=-1;t&&(!a||r<q);){var y=this.getNextMatch(h,t,
r);y||(r=r>=i?l:h.getLineStart(h.getLineAtOffset(r)+1));var w=y&&y.match,g=y&&y.rule,k=y&&y.isEnd;if(y&&y.isSub){r=this.afterMatch(w);if(g instanceof this.BeginEndRule){x=true;if(a&&g===e.rule&&t===e.parent){t=e;t.setStart(w);t.repaired=true;t.endNeedsUpdate=true;t=t;e=this.getNextExpected(e,"begin")}else{if(a){this.prune(t,e);a=false}w=new this.BeginEndNode(t,g,w);t.addChild(w);t=w}}}else if(k||r===l){if(t instanceof this.BeginEndNode)if(w){x=true;s=Math.max(s,t.end);t.setEnd(w);r=this.afterMatch(w);
if(a&&t===e&&t.parent===e.parent){t.repaired=true;delete t.endNeedsUpdate;e=this.getNextExpected(e,"end")}else if(a){this.prune(t,e);a=false}}else{t.setEnd(l);delete t.endNeedsUpdate}t=t.parent}if(a&&r>=q&&!x){this.prune(d,o);a=false}}this.removeUnrepairedChildren(d,a,c);this.cleanup(a,d,c,q,l,f,j);return a?Math.max(s,r):r},removeUnrepairedChildren:function(d,a,c){if(a){a=d.children;for(var e=-1,f=0;f<a.length;f++){var j=a[f];if(!j.repaired&&this.isDamaged(j,c,Number.MAX_VALUE)){e=f;break}}if(e!==
-1)d.children.length=e}},cleanup:function(d,a,c,e,f,j,h){if(d){d=j-h;f=this.getIntersecting(e-d+1,f);a=this.getIntersecting(c,e);for(c=0;c<f.length;c++){e=f[c];if(!e.repaired&&e instanceof this.BeginEndNode){e.shiftEnd(d);e.shiftStart(d)}}for(c=0;c<a.length;c++){e=a[c];e.repaired&&e.endNeedsUpdate&&e.shiftEnd(d);delete e.endNeedsUpdate;delete e.repaired}}else{a=this.getIntersecting(c,e);for(c=0;c<a.length;c++)delete a[c].repaired}},getNextMatch:function(d,a,c,e){var f=d.getLineAtOffset(c);f=d.getLineEnd(f);
var j=d.getText(c,f),h=[],i=[];d=[];f=[];for(this.push(h,a.rule.subrules);h.length;){var l=h.length?h.pop():null;l=l&&l._resolvedRule._typedRule;if(l instanceof this.ContainerRule&&i.indexOf(l)===-1){i.push(l);this.push(h,l.subrules)}else if(!(l&&e&&!l.matchRegex)){var o=l&&this.exec(l.matchRegex||l.beginRegex,j,c);if(o){d.push(o);f.push(l)}}}h=Number.MAX_VALUE;i=-1;for(l=0;l<d.length;l++){o=d[l];if(o.index<h){h=o.index;i=l}}if(!e)if(c=this.getEndMatch(a,j,c)){e=a.rule.applyEndPatternLast;if(i===
-1||c.index<h||!e&&c.index===h)return{isEnd:true,rule:a.rule,match:c}}return i===-1?null:{isSub:true,rule:f[i],match:d[i]}},getInitialExpected:function(d,a){var c,e;if(d===this._tree)for(c=0;c<d.children.length;c++){e=d.children[c];if(e.start>=a)return e}else if(d instanceof this.BeginEndNode)if(d.endMatch){var f=d.endMatch.index;for(c=0;c<d.children.length;c++){e=d.children[c];if(e.start>=a)break}if(e&&e.start<f)return e}return d},getNextExpected:function(d,a){if(a==="begin")return(a=d.children[0])?
a:d;else if(a==="end")if(a=d.parent)return(d=a.children[a.children.indexOf(d)+1])?d:a;return null},prune:function(d,a){if(a.parent===d)d.children.length=a.getIndexInParent();else if(d instanceof this.BeginEndNode){d.endMatch=null;d.end=null}if(d.parent)d.parent.children.length=d.getIndexInParent()+1},_onLineStyle:function(d){function a(h,i){return h.start-i.start}this._tree||this.initialParse();var c=d.lineStart,e=this.textView.getModel(),f=e.getLineEnd(d.lineIndex),j=e.getLineEnd(e.getLineAtOffset(c)-
1);j=this.getFirstDamaged(j,j);c=this.getLineScope(e,j,c,f);d.ranges=this.toStyleRanges(c);d.ranges.sort(a)},getLineScope:function(d,a,c,e){for(var f=c,j=this.getInitialExpected(a,c),h=[],i=[];a&&f<e;){var l=this.getNextMatch(d,a,f);if(!l)break;var o=l&&l.match,q=l&&l.rule,x=l&&l.isSub;l=l&&l.isEnd;o.index!==f&&i.push({start:f,end:o.index,node:a});if(x){f=this.afterMatch(o);if(q instanceof this.BeginEndRule){this.addBeginScope(h,o,q);a=j;j=this.getNextExpected(j,"begin")}else this.addMatchScope(h,
o,q)}else if(l){f=this.afterMatch(o);this.addEndScope(h,o,q);j=this.getNextExpected(j,"end");a=a.parent}}f<e&&i.push({start:f,end:e,node:a});d=this.getInheritedLineScope(i,c,e);return h.concat(d)},getInheritedLineScope:function(d){for(var a=[],c=0;c<d.length;c++)for(var e=d[c],f=e.node;f;){var j=f.rule.rule,h=j.name;if(j=j.contentName||h){this.addScopeRange(a,e.start,e.end,j);break}f=f.parent}return a},addBeginScope:function(d,a,c){var e=c.rule;this.addCapturesScope(d,a,e.beginCaptures||e.captures,
c.isComplex,c.beginOld2New,c.beginConsuming)},addEndScope:function(d,a,c){var e=c.rule;this.addCapturesScope(d,a,e.endCaptures||e.captures,c.isComplex,c.endOld2New,c.endConsuming)},addMatchScope:function(d,a,c){var e=c.rule,f=e.name;(e=e.captures)?this.addCapturesScope(d,a,e,c.isComplex,c.matchOld2New,c.matchConsuming):this.addScope(d,a,f)},addScope:function(d,a,c){c&&d.push({start:a.index,end:this.afterMatch(a),scope:c})},addScopeRange:function(d,a,c,e){e&&d.push({start:a,end:c,scope:e})},addCapturesScope:function(d,
a,c,e,f,j){if(c)if(e){e={1:0};for(var h=0,i=1;a[i]!==undefined;i++){if(j[i]!==undefined)h+=a[i].length;if(a[i+1]!==undefined)e[i+1]=h}j=a.index;for(h=1;c[h];h++){i=c[h].name;var l=f[h],o=j+e[l];typeof a[l]!=="undefined"&&this.addScopeRange(d,o,o+a[l].length,i)}}else this.addScope(d,a,c[0]&&c[0].name)},getIntersecting:function(d,a){for(var c=[],e=this._tree?[this._tree]:[];e.length;){var f=e.pop(),j=false;if(f instanceof this.ContainerNode)j=true;else if(this.isDamaged(f,d,a)){j=true;c.push(f)}if(j){j=
f.children.length;for(var h=0;h<j;h++)e.push(f.children[h])}}return c.reverse()},_onSelection:function(){},_onDestroy:function(){this._tree=this._styles=this.grammar=null},toStyleRanges:function(d){for(var a=[],c=0;c<d.length;c++){var e=d[c],f=this._styles[e.scope];if(!f)throw new Error("styles not found for "+e.scope);f=f.join(" ");a.push({start:e.start,end:e.end,style:{styleClass:f}})}return a}});return b}();
typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/editor/textMateStyler",["dojo"],function(){return orion.editor});
define("orion/breadcrumbs",["dojo"],function(b){function d(a){this._init(a)}d.prototype={_init:function(a){var c=a.container;if(typeof c==="string")c=b.byId(c);if(!c)throw"no parent container";this._container=c;b.removeClass(c,"currentLocation");this._id=a.id||"eclipse.breadcrumbs";this._resource=a.resource||null;this._firstSegmentName=a.firstSegmentName;this._makeHref=a.makeHref;this.path="";this.render()},getNavigatorRootSegment:function(){if(this._firstSegmentName){var a=document.createElement("a");
b.place(document.createTextNode(this._firstSegmentName),a,"only");a.href="/navigate/table.html#";return a}return null},render:function(){var a=this._container,c=b.byId(this._id);if(c)b.empty(c);else{c=document.createElement("span");c.id=this._id;a.appendChild(c)}var e;if(e=this.getNavigatorRootSegment()){b.addClass(e,"breadcrumb");c.appendChild(e);if(this._resource&&this._resource.Parents){e=document.createElement("span");b.place(document.createTextNode(" / "),e,"only");this.path+="/";b.addClass(e,
"breadcrumb");c.appendChild(e)}else{e.href="";b.removeClass(e,"breadcrumb");b.addClass(e,"currentLocation")}}if(this._resource&&this._resource.Parents){a=this._resource.Parents;for(var f=a.length;--f>=0;){e=document.createElement("a");b.addClass(e,"breadcrumb");b.place(document.createTextNode(a[f].Name),e,"only");this.path+=a[f].Name;if(this._makeHref)this._makeHref(e,a[f].ChildrenLocation);else e.href="/navigate/table.html#"+a[f].ChildrenLocation;c.appendChild(e);e=document.createElement("span");
b.place(document.createTextNode(" / "),e,"only");this.path+="/";b.addClass(e,"breadcrumb");c.appendChild(e)}if(this._resource){e=document.createElement("a");b.place(document.createTextNode(this._resource.Name),e,"only");b.addClass(e,"breadcrumb");b.addClass(e,"currentLocation");this.path+=this._resource.Name;c.appendChild(e)}}if(c.childNodes.length===0){e=document.createElement("a");b.place(document.createTextNode(document.title),e,"only");b.addClass(e,"breadcrumb");b.addClass(e,"currentLocation");
c.appendChild(e)}}};d.prototype.constructor=d;return{BreadCrumbs:d}});var examples=examples||{};examples.textview=examples.textview||{};
examples.textview.TextStyler=function(){function b(r,s){this.commentStart="/*";this.commentEnd="*/";var y=[];switch(s){case "java":y=a;break;case "js":y=d;break;case "css":y=c;break}this.whitespacesVisible=false;this.highlightCaretLine=true;this._scanner=new x(y,this.whitespacesVisible);if(s==="css")this._scanner.isCSS=true;this._whitespaceScanner=new t;this.view=r;this.commentOffset=0;this.commentOffsets=[];this._matchingBracket=this._currentBracket=undefined;r.addEventListener("Selection",this,
this._onSelection);r.addEventListener("ModelChanged",this,this._onModelChanged);r.addEventListener("Destroy",this,this._onDestroy);r.addEventListener("LineStyle",this,this._onLineStyle);r.redrawLines()}var d=["break","continue","do","for","new","this","case","default","else","function","in","return","typeof","while","comment","delete","export","if","switch","var","with","abstract","implements","protected","public","interface","static","synchronized","false","throws","final","null","transient","package",
"true","goto","private","catch","enum","throw","class","extends","try","const","finally","debugger","super","undefined"],a=["abstract","boolean","break","byte","case","catch","char","class","continue","default","do","double","else","extends","false","final","finally","float","for","if","implements","import","instanceof","int","interface","long","native","new","null","package","private","protected","public","return","short","static","super","switch","synchronized","this","throw","throws","transient",
"true","try","void","volatile","while"],c=["color","text-align","text-indent","text-decoration","font","font-style","font-family","font-weight","font-size","font-variant","line-height","background","background-color","background-image","background-position","background-repeat","background-attachment","list-style","list-style-image","list-style-position","list-style-type","outline","outline-color","outline-style","outline-width","border","border-left","border-top","border-bottom","border-right","border-color",
"border-width","border-style","border-bottom-color","border-bottom-style","border-bottom-width","border-left-color","border-left-style","border-left-width","border-top-color","border-top-style","border-top-width","border-right-color","border-right-style","border-right-width","padding","padding-left","padding-top","padding-bottom","padding-right","margin","margin-left","margin-top","margin-bottom","margin-right","width","height","left","top","right","bottom","min-width","max-width","min-height","max-height",
"display","visibility","clip","cursor","overflow","overflow-x","overflow-y","position","z-index","vertical-align","horizontal-align","float","clear"],e={styleClass:"token_comment"},f={styleClass:"token_javadoc"},j={styleClass:"token_string"},h={styleClass:"token_keyword"},i={styleClass:"token_space"},l={styleClass:"token_tab"},o={styleClass:(document.selection&&window.ActiveXObject&&/MSIE/.test(navigator.userAgent)?document.documentMode:undefined)<9?"token_bracket":"token_bracket_outline"},q={styleClass:"line_caret"},
x=function(){function r(s,y){this.keywords=s;this.whitespacesVisible=y;this.setText("")}r.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},_read:function(){if(this.offset<this.text.length)return this.text.charCodeAt(this.offset++);return-1},_unread:function(s){s!==-1&&this.offset--},nextToken:function(){for(this.startOffset=
this.offset;;){var s=this._read();switch(s){case -1:return null;case 47:s=this._read();if(s===47)for(;;){s=this._read();if(s===-1||s===10){this._unread(s);return 4}}this._unread(s);return 1;case 39:for(;;){s=this._read();switch(s){case 39:return 3;case -1:this._unread(s);return 3;case 92:this._read();break}}break;case 34:for(;;){s=this._read();switch(s){case 34:return 3;case -1:this._unread(s);return 3;case 92:this._read();break}}break;case 32:case 9:if(this.whitespacesVisible)return s===32?7:6;do s=
this._read();while(s===32||s===9);this._unread(s);return 5;default:var y=this.isCSS;if(97<=s&&s<=122||65<=s&&s<=90||s===95||48<=s&&s<=57||45===s&&y){var w=this.offset-1;do s=this._read();while(97<=s&&s<=122||65<=s&&s<=90||s===95||48<=s&&s<=57||45===s&&y);this._unread(s);s=this.text.substring(w,this.offset);for(y=0;y<this.keywords.length;y++)if(this.keywords[y]===s)return 2}return 1}}},setText:function(s){this.text=s;this.startOffset=this.offset=0}};return r}(),t=function(){function r(){x.call(this,
null,true)}r.prototype=new x(null);r.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var s=this._read();switch(s){case -1:return null;case 32:return 7;case 9:return 6;default:do s=this._read();while(!(s===32||s===9||s===-1));this._unread(s);return 1}}};return r}();b.prototype={destroy:function(){var r=this.view;if(r){r.removeEventListener("Selection",this,this._onSelection);r.removeEventListener("ModelChanged",this,this._onModelChanged);r.removeEventListener("Destroy",this,this._onDestroy);
r.removeEventListener("LineStyle",this,this._onLineStyle);this.view=null}},setHighlightCaretLine:function(r){this.highlightCaretLine=r},setWhitespacesVisible:function(r){this.whitespacesVisible=r;this._scanner.whitespacesVisible=r},_binarySearch:function(r,s,y,w){for(;w-y>2;){var g=w+y>>1>>1<<1;if(r[g+1]>s)w=g;else y=g}return w},_computeComments:function(r){if(!(r<=this.commentOffset)){var s=this.view.getModel(),y=s.getCharCount();s=s.getText(this.commentOffset,r);this.commentOffsets.length>1&&this.commentOffsets[this.commentOffsets.length-
1]===y&&this.commentOffsets.length--;for(var w=0;w<s.length;){var g=(this.commentOffsets.length&1)===0,k=g?this.commentStart:this.commentEnd;w=s.indexOf(k,w);if(w!==-1)this.commentOffsets.push(this.commentOffset+(g?w:w+k.length));else break;w=w+k.length}(this.commentOffsets.length&1)===1&&this.commentOffsets.push(y);this.commentOffset=r}},_getCommentRanges:function(r,s){this._computeComments(s);var y=this.commentOffsets.length;r=this._binarySearch(this.commentOffsets,r,-1,y);if(r>=y)return[];if(this.commentOffsets[r]>
s)return[];y=Math.min(y-2,this._binarySearch(this.commentOffsets,s,r-1,y));if(this.commentOffsets[y]>s)y=Math.max(r,y-2);return this.commentOffsets.slice(r,y+2)},_getLineStyle:function(r){if(this.highlightCaretLine){var s=this.view,y=s.getModel();s=s.getSelection();if(s.start===s.end&&y.getLineAtOffset(s.start)===r)return q}return null},_getStyles:function(r,s){for(var y=s+r.length,w=this.view.getModel(),g=this._getCommentRanges(s,y),k=[],m=s,n=0;n<g.length;n+=2){var p=g[n];m<p&&this._parse(r.substring(m-
s,p-s),m,k);var u=e;if(g[n+1]-p>this.commentStart.length+this.commentEnd.length){var v=p+this.commentStart.length;if(w.getText(v,v+1)==="*")u=f}if(this.whitespacesVisible){m=Math.max(m,p);p=Math.min(y,g[n+1]);this._parseWhitespace(r.substring(m-s,p-s),m,k,u)}else k.push({start:g[n],end:g[n+1],style:u});m=g[n+1]}m<y&&this._parse(r.substring(m-s,y-s),m,k);return k},_parse:function(r,s,y){var w=this._scanner;for(w.setText(r);r=w.nextToken();){var g=w.getStartOffset()+s,k=null;if(g===this._matchingBracket)k=
o;else switch(r){case 2:k=h;break;case 3:if(this.whitespacesVisible){this._parseWhitespace(w.getData(),g,y,j);continue}else k=j;break;case 4:if(this.whitespacesVisible){this._parseWhitespace(w.getData(),g,y,e);continue}else k=e;break;case 6:if(this.whitespacesVisible)k=l;break;case 7:if(this.whitespacesVisible)k=i;break}y.push({start:g,end:w.getOffset()+s,style:k})}},_parseWhitespace:function(r,s,y,w){var g=this._whitespaceScanner;for(g.setText(r);r=g.nextToken();){var k=g.getStartOffset()+s,m=w;
switch(r){case 6:m=l;break;case 7:m=i;break}y.push({start:k,end:g.getOffset()+s,style:m})}},_findBrackets:function(r,s,y,w,g,k){for(var m=[],n=this._getCommentRanges(g,k),p=g,u=this._scanner,v,A=0;A<n.length;A+=2){v=n[A];if(p<v)for(u.setText(y.substring(p-g,v-g));u.nextToken();)if(u.getDataLength()===1){v=u.getData();v===r&&m.push(u.getStartOffset()+p-g+w);v===s&&m.push(-(u.getStartOffset()+p-g+w))}p=n[A+1]}if(p<k)for(u.setText(y.substring(p-g,k-g));u.nextToken();)if(u.getDataLength()===1){v=u.getData();
v===r&&m.push(u.getStartOffset()+p-g+w);v===s&&m.push(-(u.getStartOffset()+p-g+w))}return m},_onDestroy:function(){this.destroy()},_onLineStyle:function(r){r.style=this._getLineStyle(r.lineIndex);r.ranges=this._getStyles(r.lineText,r.lineStart)},_onSelection:function(r){var s=r.oldValue,y=r.newValue;r=this.view;var w=r.getModel(),g;if(this._matchingBracket!==undefined){g=w.getLineAtOffset(this._matchingBracket);r.redrawLines(g,g+1);this._matchingBracket=this._currentBracket=undefined}if(this.highlightCaretLine){var k=
w.getLineAtOffset(s.start);g=w.getLineAtOffset(y.start);var m=y.start===y.end;s=s.start===s.end;if(!(k===g&&s&&m)){s&&r.redrawLines(k,k+1);if((k!==g||!s)&&m)r.redrawLines(g,g+1)}}if(!(y.start!==y.end||y.start===0)){k=r.getCaretOffset();if(k!==0){m="{}()[]<>";s=w.getText(k-1,k);var n=m.indexOf(s,0);if(n!==-1){y=n&1?m.substring(n-1,n):m.substring(n+1,n+2);g=w.getLineAtOffset(k);m=w.getLine(g);var p=w.getLineStart(g),u=w.getLineEnd(g);m=this._findBrackets(s,y,m,p,p,u);for(u=0;u<m.length;u++){p=m[u]>=
0?1:-1;if(m[u]*p===k-1){k=1;this._currentBracket=m[u]*p;if(n&1){for(u--;u>=0;u--){p=m[u]>=0?1:-1;k+=p;if(k===0){this._matchingBracket=m[u]*p;r.redrawLines(g,g+1);return}}for(g-=1;g>=0;){m=w.getLine(g);p=w.getLineStart(g);u=w.getLineEnd(g);m=this._findBrackets(s,y,m,p,p,u);for(n=m.length-1;n>=0;n--){p=m[n]>=0?1:-1;k+=p;if(k===0){this._matchingBracket=m[n]*p;r.redrawLines(g,g+1);return}}g--}}else{for(u++;u<m.length;u++){p=m[u]>=0?1:-1;k+=p;if(k===0){this._matchingBracket=m[u]*p;r.redrawLines(g,g+1);
return}}g+=1;for(n=w.getLineCount();g<n;){m=w.getLine(g);p=w.getLineStart(g);u=w.getLineEnd(g);m=this._findBrackets(s,y,m,p,p,u);for(u=0;u<m.length;u++){p=m[u]>=0?1:-1;k+=p;if(k===0){this._matchingBracket=m[u]*p;r.redrawLines(g,g+1);return}}g++}}break}}}}}},_onModelChanged:function(r){var s=r.start,y=r.removedCharCount;r=r.addedCharCount;if(this._matchingBracket&&s<this._matchingBracket)this._matchingBracket+=r+y;if(this._currentBracket&&s<this._currentBracket)this._currentBracket+=r+y;if(!(s>=this.commentOffset)){var w=
this.view.getModel(),g=this.commentOffsets.length,k=Math.max(this.commentStart.length-1,this.commentEnd.length-1);if(g===0)this.commentOffset=Math.max(0,s-k);else{var m=w.getCharCount(),n=m-r+y,p=this._binarySearch(this.commentOffsets,s,-1,g),u=s+y,v=this._binarySearch(this.commentOffsets,u,p-1,g),A;if(p>0)A=this.commentOffsets[--p];else{A=Math.max(0,Math.min(this.commentOffsets[p],s)-k);--p}var C;g=m;if(v+1<this.commentOffsets.length){C=this.commentOffsets[++v];if(u>C-this.commentEnd.length)if(v+
2<this.commentOffsets.length){v+=2;C=this.commentOffsets[v];g=C+1;if(g>s)g+=r-y}else this.commentOffset=C=Math.min(n,u+k)}else{this.commentOffset=C=Math.min(n,u+k);if(v>0&&v===this.commentOffsets.length)v=this.commentOffsets.length-1}if(A>s)A+=r-y;if(C>s)C+=r-y;this.commentOffsets.length>1&&this.commentOffsets[this.commentOffsets.length-1]===n&&this.commentOffsets.length--;n=0;k=[];w=w.getText(A,C);if(this.commentOffset<C)this.commentOffset=C;for(;n<w.length;){u=(C=(p+1+k.length&1)===0)?this.commentStart:
this.commentEnd;n=w.indexOf(u,n);if(n!==-1)k.push(A+(C?n:n+u.length));else break;n=n+u.length}A=v-p!==k.length;if(!A)for(w=0;w<k.length;w++){n=this.commentOffsets[p+1+w];if(n>s)n+=r-y;if(n!==k[w]){A=true;break}}v=[p+1,v-p].concat(k);Array.prototype.splice.apply(this.commentOffsets,v);for(p=p+1+k.length;p<this.commentOffsets.length;p++)this.commentOffsets[p]+=r-y;(this.commentOffsets.length&1)===1&&this.commentOffsets.push(m);A&&this.view.redrawRange(s+r,g)}}}};return b}();
typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("examples/textview/textStyler",[],function(){return examples.textview});orion=orion||{};orion.textview=orion.textview||{};
orion.textview.TextModel=function(){function b(a,c){this._listeners=[];this._lineDelimiter=c?c:d?"\r\n":"\n";this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(a)}var d=window.navigator.platform.indexOf("Win")!==-1;b.prototype={addListener:function(a){this._listeners.push(a)},removeListener:function(a){for(var c=0;c<this._listeners.length;c++)if(this._listeners[c]===a){this._listeners.splice(c,1);return}},getCharCount:function(){for(var a=0,c=0;c<this._text.length;c++)a+=this._text[c].length;
return a},getLine:function(a,c){var 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(c)return a;c=a.length;for(var j;(j=a.charCodeAt(c-1))===10||j===13;)c--;return a.substring(0,c)}else return this.getText(f)},getLineAtOffset:function(a){if(!(0<=a&&a<=this.getCharCount()))return-1;var c=this.getLineCount(),e=this.getCharCount();if(a===e)return c-1;var f,j,h=this._lastLineIndex;if(0<=h&&h<c){f=this._lineOffsets[h];j=
h+1<c?this._lineOffsets[h+1]:e;if(f<=a&&a<j)return h}for(var i=c,l=-1;i-l>1;){h=Math.floor((i+l)/2);f=this._lineOffsets[h];j=h+1<c?this._lineOffsets[h+1]:e;if(a<=f)i=h;else if(a<j){i=h;break}else l=h}return this._lastLineIndex=i},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(a,c){var e=this.getLineCount();if(!(0<=a&&a<e))return-1;if(a+1<e){e=this._lineOffsets[a+1];if(c)return e;a=this.getText(Math.max(this._lineOffsets[a],
e-2),e);c=a.length;for(var f;(f=a.charCodeAt(c-1))===10||f===13;)c--;return e-(a.length-c)}else return this.getCharCount()},getLineStart:function(a){if(!(0<=a&&a<this.getLineCount()))return-1;return this._lineOffsets[a]},getText:function(a,c){if(a===undefined)a=0;if(c===undefined)c=this.getCharCount();for(var e=0,f=0,j;f<this._text.length;){j=this._text[f].length;if(a<=e+j)break;e+=j;f++}for(var h=e,i=f;f<this._text.length;){j=this._text[f].length;if(c<=e+j)break;e+=j;f++}e=e;f=f;if(i===f)return this._text[i].substring(a-
h,c-e);a=this._text[i].substring(a-h);c=this._text[f].substring(0,c-e);return a+this._text.slice(i+1,f).join("")+c},onChanging:function(a,c,e,f,j,h){for(var i=0;i<this._listeners.length;i++){var l=this._listeners[i];l&&l.onChanging&&l.onChanging(a,c,e,f,j,h)}},onChanged:function(a,c,e,f,j){for(var h=0;h<this._listeners.length;h++){var i=this._listeners[h];i&&i.onChanged&&i.onChanged(a,c,e,f,j)}},setText:function(a,c,e){if(a===undefined)a="";if(c===undefined)c=0;if(e===undefined)e=this.getCharCount();
for(var f=this.getLineAtOffset(c),j=this.getLineAtOffset(e),h=c,i=e-c,l=j-f,o=a.length,q=0,x=this.getLineCount(),t=0,r=0,s=0,y=[];;){if(t!==-1&&t<=s)t=a.indexOf("\r",s);if(r!==-1&&r<=s)r=a.indexOf("\n",s);if(r===-1&&t===-1)break;s=t!==-1&&r!==-1?t+1===r?r+1:(t<r?t:r)+1:t!==-1?t+1:r+1;y.push(c+s);q++}this.onChanging(a,h,i,o,l,q);if(y.length===0){t=this.getLineStart(f);j=j+1<x?this.getLineStart(j+1):this.getCharCount();if(c!==t){a=this.getText(t,c)+a;c=t}if(e!==j){a+=this.getText(e,j);e=j}}j=o-i;for(t=
f+l+1;t<x;t++)this._lineOffsets[t]+=j;f=[f+1,l].concat(y);Array.prototype.splice.apply(this._lineOffsets,f);for(j=y=0;j<this._text.length;){t=this._text[j].length;if(c<=y+t)break;y+=t;j++}x=y;for(f=j;j<this._text.length;){t=this._text[j].length;if(e<=y+t)break;y+=t;j++}y=y;j=j;t=this._text[j];c=this._text[f].substring(0,c-x);e=t.substring(e-y);f=[f,j-f+1];c&&f.push(c);a&&f.push(a);e&&f.push(e);Array.prototype.splice.apply(this._text,f);if(this._text.length===0)this._text=[""];this.onChanged(h,i,o,
l,q)}};return b}();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 b(g,k,m,n){typeof g.addEventListener==="function"?g.addEventListener(k,m,n===true):g.attachEvent("on"+k,m)}function d(g,k,m,n){typeof g.removeEventListener==="function"?g.removeEventListener(k,m,n===true):g.detachEvent("on"+k,m)}function a(g){this._init(g)}var c=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,j=navigator.userAgent.indexOf("Chrome")!==-1,h=navigator.userAgent.indexOf("Safari")!==-1,i=navigator.userAgent.indexOf("WebKit")!==-1,l=navigator.userAgent.indexOf("iPad")!==-1,o=navigator.platform.indexOf("Mac")!==-1,q=navigator.platform.indexOf("Win")!==-1,x=navigator.platform.indexOf("Linux")!==-1,t=typeof window.document.documentElement.addEventListener==="function",r=(!c||c>=9)&&typeof window.document.createRange().getBoundingClientRect===
"function",s=q?"\r\n":"\n",y=function(){function g(k,m,n){this.start=k;this.end=m;this.caret=n}g.prototype={clone:function(){return new g(this.start,this.end,this.caret)},collapse:function(){if(this.caret)this.end=this.start;else this.start=this.end},extend:function(k){if(this.caret)this.start=k;else this.end=k;if(this.start>this.end){k=this.start;this.start=this.end;this.end=k;this.caret=!this.caret}},setCaret:function(k){this.end=this.start=k;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(k){return this.caret===k.caret&&this.start===k.start&&this.end===k.end}};return g}(),w=function(){function g(){this._listeners={}}g.prototype={addEventListener:function(k,m,n,p){this._listeners[k]||(this._listeners[k]=[]);this._listeners[k].push({context:m,func:n,data:p})},sendEvent:function(k,m){if(k=
this._listeners[k])for(var n=0,p=k.length;n<p;n++){var u=k[n];u&&u.context&&u.func&&u.func.call(u.context,m,u.data)}},removeEventListener:function(k,m,n,p){if(k=this._listeners[k])for(var u=0,v=k.length;u<v;u++){var A=k[u];if(A.context===m&&A.func===n&&A.data===p){k.splice(u,1);break}}}};return g}();a.prototype={addEventListener:function(g,k,m,n){this._eventTable.addEventListener(g,k,m,n)},addRuler:function(g){var k=this._frameDocument,m=k.body,n=g.getLocation(),p=n==="left"?this._leftDiv:this._rightDiv;
if(!p){p=k.createElement("DIV");p.style.overflow="hidden";p.style.MozUserSelect="none";p.style.WebkitUserSelect="none";c&&p.attachEvent("onselectstart",function(){return false});p.style.position="absolute";p.style.top="0px";p.style.cursor="default";m.appendChild(p);if(n==="left"){this._leftDiv=p;p.className="viewLeftRuler"}else{this._rightDiv=p;p.className="viewRightRuler"}m=k.createElement("TABLE");p.appendChild(m);m.cellPadding="0px";m.cellSpacing="0px";m.border="0px";m.insertRow(0);var u=this;
b(p,"click",function(v){u._handleRulerEvent(v)});b(p,"dblclick",function(v){u._handleRulerEvent(v)})}k=k.createElement("DIV");k._ruler=g;k.rulerChanged=true;k.style.position="relative";p=p.firstChild.rows[0];p=p.insertCell(p.cells.length);p.vAlign="top";p.appendChild(k);g.setView(this);this._updatePage()},convert:function(g,k,m){var n=this._getScroll(),p=this._getViewPadding(),u=this._frame.getBoundingClientRect(),v=this._viewDiv.getBoundingClientRect();switch(k){case "document":if(g.x!==undefined)g.x+=
-n.x+v.left+p.left;if(g.y!==undefined)g.y+=-n.y+v.top+p.top;break;case "page":if(g.x!==undefined)g.x+=-u.left;if(g.y!==undefined)g.y+=-u.top;break}switch(m){case "document":if(g.x!==undefined)g.x+=n.x-v.left-p.left;if(g.y!==undefined)g.y+=n.y-v.top-p.top;break;case "page":if(g.x!==undefined)g.x+=u.left;if(g.y!==undefined)g.y+=u.top;break}},destroy:function(){this._setGrab(null);this._unhookEvents();var g=function(k){if(k){k=k.firstChild.rows[0].cells;for(var m=0;m<k.length;m++)k[m].firstChild._ruler.setView(null)}};
g(this._leftDiv);g(this._rightDiv);if(this._autoScrollTimerID){clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=null}if(this._updateTimer){clearTimeout(this._updateTimer);this._updateTimer=null}g=this._parent;g.removeChild(this._frame);if(l){g.removeChild(this._touchDiv);this._textArea=this._selDiv3=this._selDiv2=this._selDiv1=this._touchDiv=null}this.onDestroy({});this._actions=this._keyBindings=this._overlayDiv=this._clientDiv=this._viewDiv=this._scrollDiv=this._frameWindow=this._frameDocument=
this._frame=this._eventTable=this._doubleClickSelection=this._selection=this._model=this._parentDocument=this._parent=null},focus:function(){this._updateDOMSelection();if(l)this._textArea.focus();else{f&&this._clientDiv.blur();this._clientDiv.focus()}this._updateDOMSelection()},getActions:function(g){for(var k=[],m=this._actions,n=0;n<m.length;n++)!g&&m[n].defaultHandler||k.push(m[n].name);return k},getBottomIndex:function(g){return this._getBottomIndex(g)},getBottomPixel:function(){return this._getScroll().y+
this._getClientHeight()},getCaretOffset:function(){return this._getSelection().getCaret()},getClientArea:function(){var g=this._getScroll();return{x:g.x,y:g.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return this._getScroll().x},getKeyBindings:function(g){for(var k=[],m=this._keyBindings,n=0;n<m.length;n++)m[n].name===g&&k.push(m[n].keyBinding);return k},getLineHeight:function(){return this._getLineHeight()},getLinePixel:function(g){g=Math.min(Math.max(0,
g),this._model.getLineCount());return this._getLineHeight()*g},getLocationAtOffset:function(g){var k=this._model;g=Math.min(Math.max(0,g),k.getCharCount());k=k.getLineAtOffset(g);var m=this._getScroll(),n=this._viewDiv.getBoundingClientRect(),p=this._getViewPadding();g=this._getOffsetToX(g)+m.x-n.left-p.left;k=this.getLinePixel(k);return{x:g,y:k}},getModel:function(){return this._model},getOffsetAtLocation:function(g,k){var m=this._getScroll(),n=this._viewDiv.getBoundingClientRect(),p=this._getViewPadding();
k=this._getYToLine(k-m.y);g+=-m.x+n.left+p.left;return this._getXToOffset(k,g)},getSelection:function(){var g=this._getSelection();return{start:g.start,end:g.end}},getText:function(g,k){return this._model.getText(g,k)},getTopIndex:function(g){return this._getTopIndex(g)},getTopPixel:function(){return this._getScroll().y},invokeAction:function(g,k){for(var m=this._actions,n=0;n<m.length;n++){var p=m[n];if(p.name&&p.name===g){if(!k&&p.userHandler)if(p.userHandler())return;if(p.defaultHandler)return p.defaultHandler();
return false}}return false},onContextMenu:function(g){this._eventTable.sendEvent("ContextMenu",g)},onDestroy:function(g){this._eventTable.sendEvent("Destroy",g)},onLineStyle:function(g){this._eventTable.sendEvent("LineStyle",g)},onModelChanged:function(g){this._eventTable.sendEvent("ModelChanged",g)},onModelChanging:function(g){this._eventTable.sendEvent("ModelChanging",g)},onModify:function(g){this._eventTable.sendEvent("Modify",g)},onSelection:function(g){this._eventTable.sendEvent("Selection",
g)},onScroll:function(g){this._eventTable.sendEvent("Scroll",g)},onVerify:function(g){this._eventTable.sendEvent("Verify",g)},redrawLines:function(g,k,m){if(g===undefined)g=0;if(k===undefined)k=this._model.getLineCount();if(g!==k){var n=this._clientDiv;if(m)for(var p=(m.getLocation()==="left"?this._leftDiv:this._rightDiv).firstChild.rows[0].cells,u=0;u<p.length;u++)if(p[u].firstChild._ruler===m){n=p[u].firstChild;break}if(m)n.rulerChanged=true;if(!m||m.getOverview()==="page")for(n=n.firstChild;n;){p=
n.lineIndex;if(g<=p&&p<k)n.lineChanged=true;n=n.nextSibling}if(!m)if(g<=this._maxLineIndex&&this._maxLineIndex<k){this._maxLineIndex=-1;this._maxLineWidth=0}this._queueUpdatePage()}},redrawRange:function(g,k){var m=this._model;if(g===undefined)g=0;if(k===undefined)k=m.getCharCount();if(g!==k){g=m.getLineAtOffset(g);k=m.getLineAtOffset(Math.max(0,k-1))+1;this.redrawLines(g,k)}},removeEventListener:function(g,k,m,n){this._eventTable.removeEventListener(g,k,m,n)},removeRuler:function(g){g.setView(null);
for(var k=(g.getLocation()==="left"?this._leftDiv:this._rightDiv).firstChild.rows[0],m=k.cells,n=0;n<m.length;n++)if(m[n].firstChild._ruler===g)break;if(n!==m.length){k.cells[n]._ruler=undefined;k.deleteCell(n);this._updatePage()}},setAction:function(g,k){if(g){for(var m=this._actions,n=0;n<m.length;n++){var p=m[n];if(p.name===g){p.userHandler=k;return}}m.push({name:g,userHandler:k})}},setKeyBinding:function(g,k){for(var m=this._keyBindings,n=0;n<m.length;n++){var p=m[n];if(p.keyBinding.equals(g)){if(k)p.name=
k;else if(p.predefined)p.name=null;else{g=p.name;m.splice(n,1);for(n=0;n<m.length&&g!==m[n].name;)n++;if(n===m.length){m=this._actions;for(n=0;n<m.length;n++)if(m[n].name===g)m[n].defaultHandler||m.splice(n,1)}}return}}k&&m.push({keyBinding:g,name:k})},setCaretOffset:function(g,k){var m=this._model.getCharCount();g=Math.max(0,Math.min(g,m));this._setSelection(new y(g,g,false),k===undefined||k)},setHorizontalPixel:function(g){g=Math.max(0,g);this._scrollView(g-this._getScroll().x,0)},setModel:function(g){if(g){this._model.removeListener(this._modelListener);
var k=this._model.getLineCount(),m=this._model.getCharCount(),n=g.getLineCount(),p=g.getCharCount(),u={text:g.getText(),start:0,removedCharCount:m,addedCharCount:p,removedLineCount:k,addedLineCount:n};this.onModelChanging(u);this.redrawRange();this._model=g;u={start:0,removedCharCount:m,addedCharCount:p,removedLineCount:k,addedLineCount:n};this.onModelChanged(u);this._model.addListener(this._modelListener);this.redrawRange()}},setSelection:function(g,k,m){var n=g>k;if(n){var p=g;g=k;k=p}p=this._model.getCharCount();
g=Math.max(0,Math.min(g,p));k=Math.max(0,Math.min(k,p));this._setSelection(new y(g,k,n),m===undefined||m)},setText:function(g,k,m){var n=k===undefined&&m===undefined;if(k===undefined)k=0;if(m===undefined)m=this._model.getCharCount();this._modifyContent({text:g,start:k,end:m,_code:true},!n);if(n){this._columnX=-1;this._setSelection(new y(0,0,false),true);if(e){g=this._hasFocus;k=this._clientDiv;g&&k.blur();k.contentEditable=false;k.contentEditable=true;g&&k.focus()}}},setTopIndex:function(g){var k=
this._model;if(k.getCharCount()!==0){k=k.getLineCount();var m=this._getLineHeight(),n=Math.max(1,Math.min(k,Math.floor(this._getClientHeight()/m)));if(g<0)g=0;else if(g>k-n)g=k-n;this._scrollView(0,g*m-this._getScroll().y)}},setTopPixel:function(g){var k=this._getLineHeight(),m=this._getClientHeight(),n=this._model.getLineCount();g=Math.min(Math.max(0,g),k*n-m);this._scrollView(0,g-this._getScroll().y)},showSelection:function(){return this._showCaret()},_handleBodyMouseDown:function(g){if(!g)g=window.event;
for(var k=f?this._clientDiv:this._overlayDiv||this._viewDiv,m=g.target?g.target:g.srcElement;m;){if(k===m)return;m=m.parentNode}g.preventDefault&&g.preventDefault();g.stopPropagation&&g.stopPropagation();if(!t){k.setCapture();setTimeout(function(){k.releaseCapture()},0)}},_handleBlur:function(){this._hasFocus=false;if(c<9)if(!this._getSelection().isEmpty()){var g=this._frameDocument,k=g.createElement("DIV");g=g.body;g.appendChild(k);g.removeChild(k)}if(e||c)if(this._selDiv1){k=c?"transparent":"#AFAFAF";
this._selDiv1.style.background=k;this._selDiv2.style.background=k;this._selDiv3.style.background=k}},_handleContextMenu:function(g){if(!g)g=window.event;var k=this._getScroll(),m=this._viewDiv.getBoundingClientRect(),n=this._getViewPadding();this.onContextMenu({x:g.clientX+k.x-m.left-n.left,y:g.clientY+k.y-m.top-n.top,screenX:g.screenX,screenY:g.screenY});g.preventDefault&&g.preventDefault();return false},_handleCopy:function(g){if(!this._ignoreCopy){if(!g)g=window.event;if(this._doCopy(g)){g.preventDefault&&
g.preventDefault();return false}}},_handleCut:function(g){if(!g)g=window.event;if(this._doCut(g)){g.preventDefault&&g.preventDefault();return false}},_handleDataModified:function(){this._startIME()},_handleDblclick:function(g){if(!g)g=window.event;this._lastMouseTime=g.timeStamp?g.timeStamp:(new Date).getTime();if(this._clickCount!==2){this._clickCount=2;this._handleMouse(g)}},_handleDragStart:function(g){if(!g)g=window.event;g.preventDefault&&g.preventDefault();return false},_handleDragOver:function(g){if(!g)g=
window.event;g.dataTransfer.dropEffect="none";g.preventDefault&&g.preventDefault();return false},_handleDrop:function(g){if(!g)g=window.event;g.preventDefault&&g.preventDefault();return false},_handleDocFocus:function(){this._clientDiv.focus()},_handleFocus:function(){this._hasFocus=true;c&&this._updateDOMSelection();if(e||c)if(this._selDiv1){var g=this._hightlightRGB;this._selDiv1.style.background=g;this._selDiv2.style.background=g;this._selDiv3.style.background=g}},_handleKeyDown:function(g){if(!g)g=
window.event;if(l){if(g.keyCode===8){this._doBackspace({});g.preventDefault()}}else{if(g.keyCode===229){if(this.readonly){g.preventDefault&&g.preventDefault();return false}this._startIME()}else this._commitIME();if((o||x)&&e<4||f){this._keyDownEvent=g;return true}if(this._doAction(g)){if(g.preventDefault)g.preventDefault();else{g.cancelBubble=true;g.returnValue=false;g.keyCode=0}return false}}},_handleKeyPress:function(g){if(!g)g=window.event;if(o&&i)if(63232<=g.keyCode&&g.keyCode<=63487||g.keyCode===
13||g.keyCode===8){g.preventDefault&&g.preventDefault();return false}if((o||x)&&e<4||f)if(this._doAction(this._keyDownEvent)){g.preventDefault&&g.preventDefault();return false}var k=o?g.metaKey:g.ctrlKey;if(g.charCode!==undefined)if(k)switch(g.charCode){case 99:case 118:case 120:return true}k=false;if(o){if(g.ctrlKey||g.metaKey)k=true}else if(e){if(g.ctrlKey||g.altKey)k=true}else if(g.ctrlKey^g.altKey)k=true;if(!k){k=f?g.which:g.charCode!==undefined?g.charCode:g.keyCode;if(k>31){this._doContent(String.fromCharCode(k));
g.preventDefault&&g.preventDefault();return false}}},_handleKeyUp:function(g){if(!g)g=window.event;g.keyCode===13&&this._commitIME()},_handleMouse:function(g){var k=this._frameWindow;if(c)k=this._clientDiv;if(this._overlayDiv){var m=this;setTimeout(function(){m.focus()},0)}if(this._clickCount===1){this._setGrab(k);this._setSelectionTo(g.clientX,g.clientY,g.shiftKey)}else{t&&this._setGrab(k);this._doubleClickSelection=null;this._setSelectionTo(g.clientX,g.clientY,g.shiftKey);this._doubleClickSelection=
this._getSelection()}},_handleMouseDown:function(g){if(!g)g=window.event;var k=g.which?g.button===0:g.button===1;this._commitIME();if(k){this._isMouseDown=true;k=Math.abs(this._lastMouseX-g.clientX);var m=Math.abs(this._lastMouseY-g.clientY),n=g.timeStamp?g.timeStamp:(new Date).getTime();if(n-this._lastMouseTime<=this._clickTime&&k<=this._clickDist&&m<=this._clickDist)this._clickCount++;else this._clickCount=1;this._lastMouseX=g.clientX;this._lastMouseY=g.clientY;this._lastMouseTime=n;this._handleMouse(g);
if(f){this._hasFocus||this.focus();g.preventDefault()}}},_handleMouseMove:function(g){if(!g)g=window.event;if(!t){if(g.button===0){this._setGrab(null);return true}if(!this._isMouseDown&&g.button===1&&(this._clickCount&1)!==0){this._clickCount=2;return this._handleMouse(g,this._clickCount)}}var k=g.clientX;g=g.clientY;var m=this._getViewPadding(),n=this._viewDiv.getBoundingClientRect(),p=this._getClientWidth(),u=this._getClientHeight(),v=n.left+m.left,A=n.top+m.top;p=n.left+m.left+p;m=n.top+m.top+
u;n=this._model;u=n.getLineAtOffset(this._getSelection().getCaret());if(g<A&&u!==0)this._doAutoScroll("up",k,g-A);else if(g>m&&u!==n.getLineCount()-1)this._doAutoScroll("down",k,g-m);else if(k<v)this._doAutoScroll("left",k-v,g);else if(k>p)this._doAutoScroll("right",k-p,g);else{this._endAutoScroll();this._setSelectionTo(k,g,true);c&&this._frameDocument.body.getBoundingClientRect()}},_handleMouseUp:function(g){if(!g)g=window.event;this._endAutoScroll();if(g.which?g.button===0:g.button===1){this._isMouseDown=
false;t&&this._setGrab(null)}},_handleMouseWheel:function(g){if(!g)g=window.event;var k=this._getLineHeight(),m=0,n=0;if(e){k=o?g.detail*3:Math.max(-256,Math.min(256,g.detail))*k;if(g.axis===g.HORIZONTAL_AXIS)m=k;else n=k}else if(o){n=m=40;if(j){if(g.wheelDeltaX%120!==0)m=1;if(g.wheelDeltaY%120!==0)n=1}m=-g.wheelDeltaX/m;if(-1<m&&m<0)m=-1;if(0<m&&m<1)m=1;n=-g.wheelDeltaY/n;if(-1<n&&n<0)n=-1;if(0<n&&n<1)n=1}else{m=-g.wheelDeltaX;n=-g.wheelDeltaY/120*8*k}if(h){for(k=g.target;k&&k.lineIndex===undefined;)k=
k.parentNode;this._mouseWheelLine=k}k=this._getScroll();this._scrollView(m,n);m=this._getScroll();if(h)this._mouseWheelLine=null;if(k.x!==m.x||k.y!==m.y){g.preventDefault&&g.preventDefault();return false}},_handlePaste:function(g){if(!this._ignorePaste){if(!g)g=window.event;if(this._doPaste(g)){if(c){var k=this;setTimeout(function(){k._updateDOMSelection()},0)}g.preventDefault&&g.preventDefault();return false}}},_handleResize:function(){var g=this._frameDocument.documentElement,k=g.clientWidth;g=
g.clientHeight;if(this._frameWidth!==k||this._frameHeight!==g){this._frameWidth=k;this._frameHeight=g;this._updatePage()}},_handleRulerEvent:function(g){if(!g)g=window.event;var k=g.target?g.target:g.srcElement,m=k.lineIndex;for(k=k;k&&!k._ruler;){if(m===undefined&&k.lineIndex!==undefined)m=k.lineIndex;k=k.parentNode}k=k?k._ruler:null;if(l&&m===undefined&&k&&k.getOverview()==="document"){var n=this._getClientHeight(),p=this._getLineHeight(),u=this._getViewPadding();n=n+u.top+u.bottom-34;u=this._model.getLineCount()*
p;this.setTopPixel(Math.floor((g.clientY-17-p)*u/n))}if(k)switch(g.type){case "click":k.onClick&&k.onClick(m,g);break;case "dblclick":k.onDblClick&&k.onDblClick(m,g);break}},_handleScroll:function(){this._doScroll(this._getScroll())},_handleSelectStart:function(g){if(!g)g=window.event;if(this._ignoreSelect){g&&g.preventDefault&&g.preventDefault();return false}},_handleInput:function(g){var k=this._textArea;this._doContent(k.value);k.selectionStart=k.selectionEnd=0;k.value="";g.preventDefault()},_handleTextInput:function(g){this._doContent(g.data);
g.preventDefault()},_touchConvert:function(g){var k=this._frame.getBoundingClientRect(),m=this._parentDocument.body;return{left:g.clientX-k.left-m.scrollLeft,top:g.clientY-k.top-m.scrollTop}},_handleTouchStart:function(g){var k=g.touches,m,n;this._touchMoved=false;this._touchStartScroll=undefined;if(k.length===1){m=k[0];var p=m.pageY;this._touchStartX=m.pageX;this._touchStartY=p;this._touchStartTime=g.timeStamp;this._touchStartScroll=this._getScroll();g=this._getSelection();n=this._touchConvert(k[0]);
this._touchGesture="none";if(!g.isEmpty())if(this._hitOffset(g.end,n.left,n.top))this._touchGesture="extendEnd";else if(this._hitOffset(g.start,n.left,n.top))this._touchGesture="extendStart";if(this._touchGesture==="none"){k=this._textArea;k.value="";k.style.left="-1000px";k.style.top="-1000px";k.style.width="3000px";k.style.height="3000px";var u=this;this._touchTimeout=setTimeout(function(){u._touchTimeout=null;u._clickCount=1;u._setSelectionTo(n.left,n.top,false)},200)}}else if(k.length===2){this._touchGesture=
"select";if(this._touchTimeout){clearTimeout(this._touchTimeout);this._touchTimeout=null}n=this._touchConvert(k[0]);m=this._getXToOffset(this._getYToLine(n.top),n.left);n=this._touchConvert(k[1]);k=this._getXToOffset(this._getYToLine(n.top),n.left);g=this._getSelection();g.setCaret(m);g.extend(k);this._setSelection(g,true,true)}},_handleTouchMove:function(g){this._touchMoved=true;var k=g.touches,m;if(k.length===1){k=k[0];var n=k.pageX,p=k.pageY,u=this._touchStartX-n,v=this._touchStartY-p;m=this._touchConvert(k);
k=this._getSelection();if(this._touchTimeout){clearTimeout(this._touchTimeout);this._touchTimeout=null}if(this._touchGesture==="none")this._touchGesture=g.timeStamp-this._touchStartTime<200&&(Math.abs(u)>5||Math.abs(v)>5)?"scroll":"caret";if(this._touchGesture==="select")this._touchGesture=this._hitOffset(k.end,m.left,m.top)?"extendEnd":this._hitOffset(k.start,m.left,m.top)?"extendStart":"caret";switch(this._touchGesture){case "scroll":this._touchStartX=n;this._touchStartY=p;this._scrollView(u,v);
break;case "extendStart":case "extendEnd":this._clickCount=1;m=this._getXToOffset(this._getYToLine(m.top),m.left);k.setCaret(this._touchGesture==="extendStart"?k.end:k.start);k.extend(m);if(m>=k.end&&this._touchGesture==="extendStart")this._touchGesture="extendEnd";if(m<=k.start&&this._touchGesture==="extendEnd")this._touchGesture="extendStart";this._setSelection(k,true,true);break;case "caret":this._setSelectionTo(m.left,m.top,false);break}}else if(k.length===2){m=this._touchConvert(k[0]);n=this._getXToOffset(this._getYToLine(m.top),
m.left);m=this._touchConvert(k[1]);m=this._getXToOffset(this._getYToLine(m.top),m.left);k=this._getSelection();k.setCaret(n);k.extend(m);this._setSelection(k,true,true)}g.preventDefault()},_handleTouchEnd:function(g){if(!this._touchMoved)if(g.touches.length===0&&g.changedTouches.length===1&&this._touchTimeout){clearTimeout(this._touchTimeout);this._touchTimeout=null;var k=g.changedTouches[0];this._clickCount=1;k=this._touchConvert(k);this._setSelectionTo(k.left,k.top,false)}if(g.touches.length===
0){var m=this;setTimeout(function(){var n=m._getSelection(),p=m._model.getText(n.start,n.end),u=m._textArea;u.value=p;u.selectionStart=0;u.selectionEnd=p.length;if(!n.isEmpty()){p=m._touchDiv.getBoundingClientRect();n=m._getOffsetBounds(n.start);u.style.left=p.width/2+"px";u.style.top=(n.top>40?n.top-30:n.top+30)+"px"}},0)}g.preventDefault()},_doAction:function(g){for(var k=this._keyBindings,m=0;m<k.length;m++){var n=k[m];if(n.keyBinding.match(g)){if(n.name){g=this._actions;for(k=0;k<g.length;k++){m=
g[k];if(m.name===n.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(g){var k=this._getSelection();if(k.isEmpty()){var m=this._model,n=k.getCaret(),p=m.getLineAtOffset(n);if(n===m.getLineStart(p))p>0&&k.extend(m.getLineEnd(p-1));else k.extend(this._getOffset(n,g.unit,-1))}this._modifyContent({text:"",start:k.start,end:k.end},true);return true},_doContent:function(g){var k=
this._getSelection();this._modifyContent({text:g,start:k.start,end:k.end,_ignoreDOMSelection:true},true)},_doCopy:function(g){var k=this._getSelection();if(!k.isEmpty())return this._setClipboardText(this._model.getText(k.start,k.end),g);return true},_doCursorNext:function(g){if(!g.select)if(this._clearSelection("next"))return true;var k=this._model,m=this._getSelection(),n=m.getCaret(),p=k.getLineAtOffset(n);if(n===k.getLineEnd(p))p+1<k.getLineCount()&&m.extend(k.getLineStart(p+1));else m.extend(this._getOffset(n,
g.unit,1));g.select||m.collapse();this._setSelection(m,true);return true},_doCursorPrevious:function(g){if(!g.select)if(this._clearSelection("previous"))return true;var k=this._model,m=this._getSelection(),n=m.getCaret(),p=k.getLineAtOffset(n);if(n===k.getLineStart(p))p>0&&m.extend(k.getLineEnd(p-1));else m.extend(this._getOffset(n,g.unit,-1));g.select||m.collapse();this._setSelection(m,true);return true},_doCut:function(g){var k=this._getSelection();if(!k.isEmpty()){k=this._model.getText(k.start,
k.end);this._doContent("");return this._setClipboardText(k,g)}return true},_doDelete:function(g){var k=this._getSelection();if(k.isEmpty()){var m=this._model,n=k.getCaret(),p=m.getLineAtOffset(n);if(n===m.getLineEnd(p))p+1<m.getLineCount()&&k.extend(m.getLineStart(p+1));else k.extend(this._getOffset(n,g.unit,1))}this._modifyContent({text:"",start:k.start,end:k.end},true);return true},_doEnd:function(g){var k=this._getSelection(),m=this._model;if(g.ctrl)k.extend(m.getCharCount());else{var n=m.getLineAtOffset(k.getCaret());
k.extend(m.getLineEnd(n))}g.select||k.collapse();this._setSelection(k,true);return true},_doEnter:function(){this._doContent(this._model.getLineDelimiter());return true},_doHome:function(g){var k=this._getSelection(),m=this._model;if(g.ctrl)k.extend(0);else{var n=m.getLineAtOffset(k.getCaret());k.extend(m.getLineStart(n))}g.select||k.collapse();this._setSelection(k,true);return true},_doLineDown:function(g){var k=this._model,m=this._getSelection(),n=m.getCaret(),p=k.getLineAtOffset(n);if(p+1<k.getLineCount()){k=
this._columnX;if(k===-1||g.select)k=this._getOffsetToX(n);m.extend(this._getXToOffset(p+1,k));g.select||m.collapse();this._setSelection(m,true,true);this._columnX=k}return true},_doLineUp:function(g){var k=this._model,m=this._getSelection(),n=m.getCaret();k=k.getLineAtOffset(n);if(k>0){var p=this._columnX;if(p===-1||g.select)p=this._getOffsetToX(n);m.extend(this._getXToOffset(k-1,p));g.select||m.collapse();this._setSelection(m,true,true);this._columnX=p}return true},_doPageDown:function(g){var k=
this._model,m=this._getSelection(),n=m.getCaret(),p=k.getLineAtOffset(n),u=k.getLineCount();if(p<u-1){k=this._getClientHeight();var v=this._getLineHeight(),A=Math.floor(k/v),C=Math.min(u-p-1,A);C=Math.max(1,C);A=this._columnX;if(A===-1||g.select)A=this._getOffsetToX(n);m.extend(this._getXToOffset(p+C,A));g.select||m.collapse();this._setSelection(m,false,false);g=u*v;m=this._getScroll().y;v=m+C*v;if(v+k>g)v=g-k;v>m?this._scrollView(0,v-m):this._updateDOMSelection();this._columnX=A}return true},_doPageUp:function(g){var k=
this._model,m=this._getSelection(),n=m.getCaret(),p=k.getLineAtOffset(n);if(p>0){var u=this._getClientHeight();k=this._getLineHeight();u=Math.floor(u/k);var v=Math.max(1,Math.min(p,u));u=this._columnX;if(u===-1||g.select)u=this._getOffsetToX(n);m.extend(this._getXToOffset(p-v,u));g.select||m.collapse();this._setSelection(m,false,false);g=this._getScroll().y;m=Math.max(0,g-v*k);m<g?this._scrollView(0,m-g):this._updateDOMSelection();this._columnX=u}return true},_doPaste:function(g){(g=this._getClipboardText(g))&&
this._doContent(g);return g!==null},_doScroll:function(g){var k=this._hScroll,m=this._vScroll;if(k!==g.x||m!==g.y){this._hScroll=g.x;this._vScroll=g.y;this._commitIME();this._updatePage();this.onScroll({oldValue:{x:k,y:m},newValue:g})}},_doSelectAll:function(){var g=this._model,k=this._getSelection();k.setCaret(0);k.extend(g.getCharCount());this._setSelection(k,false);return true},_doTab:function(){this._doContent("\t");return true},_applyStyle:function(g,k){if(g){if(g.styleClass)k.className=g.styleClass;
if(g=g.style)for(var m in g)if(g.hasOwnProperty(m))k.style[m]=g[m]}},_autoScroll:function(){var g=this._getSelection(),k,m=this._autoScrollX;if(this._autoScrollDir==="up"||this._autoScrollDir==="down"){var n=this._autoScrollY/this._getLineHeight();n=n<0?Math.floor(n):Math.ceil(n);k=this._model.getLineAtOffset(g.getCaret());k=Math.max(0,Math.min(this._model.getLineCount()-1,k+n))}else if(this._autoScrollDir==="left"||this._autoScrollDir==="right"){k=this._getYToLine(this._autoScrollY);m+=this._getOffsetToX(g.getCaret())}g.extend(this._getXToOffset(k,
m));this._setSelection(g,true)},_autoScrollTimer:function(){this._autoScroll();var g=this;this._autoScrollTimerID=setTimeout(function(){g._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeight:function(){var g=this._clientDiv,k=this._frameDocument,m=k.createElement("DIV");m.style.position="fixed";m.style.left="-1000px";var n=k.createElement("SPAN");n.appendChild(k.createTextNode(" "));m.appendChild(n);var p=k.createElement("SPAN");p.style.fontStyle="italic";p.appendChild(k.createTextNode(" "));
m.appendChild(p);var u=k.createElement("SPAN");u.style.fontWeight="bold";u.appendChild(k.createTextNode(" "));m.appendChild(u);var v=k.createElement("SPAN");v.style.fontWeight="bold";v.style.fontStyle="italic";v.appendChild(k.createTextNode(" "));m.appendChild(v);g.appendChild(m);k=n.getBoundingClientRect();p=p.getBoundingClientRect();n=u.getBoundingClientRect();var A=v.getBoundingClientRect();v=k.bottom-k.top;u=p.bottom-p.top;k=n.bottom-n.top;p=A.bottom-A.top;n=0;A=v;if(u>v){A=u;n=1}if(k>u){A=k;
n=2}if(p>k){A=p;n=3}this._largestFontStyle=n;g.removeChild(m);return A},_calculatePadding:function(){var g=this._frameDocument,k=this._clientDiv,m=this._getPadding(this._viewDiv),n=g.createElement("DIV");n.style.position="fixed";n.style.left="-1000px";n.style.paddingLeft=m.left+"px";n.style.paddingTop=m.top+"px";n.style.paddingRight=m.right+"px";n.style.paddingBottom=m.bottom+"px";n.style.width="100px";n.style.height="100px";m=g.createElement("DIV");m.style.width="100%";m.style.height="100%";n.appendChild(m);
k.appendChild(n);g=n.getBoundingClientRect();m=m.getBoundingClientRect();k.removeChild(n);return m={left:m.left-g.left,top:m.top-g.top,right:g.right-m.right,bottom:g.bottom-m.bottom}},_clearSelection:function(g){var k=this._getSelection();if(k.isEmpty())return false;if(g==="next")k.start=k.end;else k.end=k.start;this._setSelection(k,true);return true},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();var g=this._model,k=g.getLineAtOffset(this._imeOffset),
m=g.getLineStart(k),n=this._getDOMText(k);g=g.getLine(k);m=this._imeOffset-m;g=m+n.length-g.length;m!==g&&this._doContent(n.substring(m,g));this._imeOffset=-1}},_convertDelimiter:function(g,k,m){for(var n=0,p=0,u=0,v=g.length;u<v;){if(n!==-1&&n<=u)n=g.indexOf("\r",u);if(p!==-1&&p<=u)p=g.indexOf("\n",u);var A=u,C;if(p===-1&&n===-1){k(g.substring(u));break}if(n!==-1&&p!==-1)if(n+1===p){C=n;u=p+1}else{C=n<p?n:p;u=(n<p?n:p)+1}else if(n!==-1){C=n;u=n+1}else{C=p;u=p+1}k(g.substring(A,C));m()}},_createActions:function(){var g=
orion.textview.KeyBinding,k=this._keyBindings=[];k.push({name:"lineUp",keyBinding:new g(38),predefined:true});k.push({name:"lineDown",keyBinding:new g(40),predefined:true});k.push({name:"charPrevious",keyBinding:new g(37),predefined:true});k.push({name:"charNext",keyBinding:new g(39),predefined:true});k.push({name:"pageUp",keyBinding:new g(33),predefined:true});k.push({name:"pageDown",keyBinding:new g(34),predefined:true});if(o){k.push({name:"lineStart",keyBinding:new g(37,true),predefined:true});
k.push({name:"lineEnd",keyBinding:new g(39,true),predefined:true});k.push({name:"wordPrevious",keyBinding:new g(37,null,null,true),predefined:true});k.push({name:"wordNext",keyBinding:new g(39,null,null,true),predefined:true});k.push({name:"textStart",keyBinding:new g(36),predefined:true});k.push({name:"textEnd",keyBinding:new g(35),predefined:true});k.push({name:"textStart",keyBinding:new g(38,true),predefined:true});k.push({name:"textEnd",keyBinding:new g(40,true),predefined:true})}else{k.push({name:"lineStart",
keyBinding:new g(36),predefined:true});k.push({name:"lineEnd",keyBinding:new g(35),predefined:true});k.push({name:"wordPrevious",keyBinding:new g(37,true),predefined:true});k.push({name:"wordNext",keyBinding:new g(39,true),predefined:true});k.push({name:"textStart",keyBinding:new g(36,true),predefined:true});k.push({name:"textEnd",keyBinding:new g(35,true),predefined:true})}k.push({name:"selectLineUp",keyBinding:new g(38,null,true),predefined:true});k.push({name:"selectLineDown",keyBinding:new g(40,
null,true),predefined:true});k.push({name:"selectCharPrevious",keyBinding:new g(37,null,true),predefined:true});k.push({name:"selectCharNext",keyBinding:new g(39,null,true),predefined:true});k.push({name:"selectPageUp",keyBinding:new g(33,null,true),predefined:true});k.push({name:"selectPageDown",keyBinding:new g(34,null,true),predefined:true});if(o){k.push({name:"selectLineStart",keyBinding:new g(37,true,true),predefined:true});k.push({name:"selectLineEnd",keyBinding:new g(39,true,true),predefined:true});
k.push({name:"selectWordPrevious",keyBinding:new g(37,null,true,true),predefined:true});k.push({name:"selectWordNext",keyBinding:new g(39,null,true,true),predefined:true});k.push({name:"selectTextStart",keyBinding:new g(36,null,true),predefined:true});k.push({name:"selectTextEnd",keyBinding:new g(35,null,true),predefined:true});k.push({name:"selectTextStart",keyBinding:new g(38,true,true),predefined:true});k.push({name:"selectTextEnd",keyBinding:new g(40,true,true),predefined:true})}else{k.push({name:"selectLineStart",
keyBinding:new g(36,null,true),predefined:true});k.push({name:"selectLineEnd",keyBinding:new g(35,null,true),predefined:true});k.push({name:"selectWordPrevious",keyBinding:new g(37,true,true),predefined:true});k.push({name:"selectWordNext",keyBinding:new g(39,true,true),predefined:true});k.push({name:"selectTextStart",keyBinding:new g(36,true,true),predefined:true});k.push({name:"selectTextEnd",keyBinding:new g(35,true,true),predefined:true})}k.push({name:"deletePrevious",keyBinding:new g(8),predefined:true});
k.push({name:"deletePrevious",keyBinding:new g(8,null,true),predefined:true});k.push({name:"deleteNext",keyBinding:new g(46),predefined:true});k.push({name:"deleteWordPrevious",keyBinding:new g(8,true),predefined:true});k.push({name:"deleteWordPrevious",keyBinding:new g(8,true,true),predefined:true});k.push({name:"deleteWordNext",keyBinding:new g(46,true),predefined:true});k.push({name:"tab",keyBinding:new g(9),predefined:true});k.push({name:"enter",keyBinding:new g(13),predefined:true});k.push({name:"enter",
keyBinding:new g(13,null,true),predefined:true});k.push({name:"selectAll",keyBinding:new g("a",true),predefined:true});if(o){k.push({name:"deleteNext",keyBinding:new g(46,null,true),predefined:true});k.push({name:"deleteWordPrevious",keyBinding:new g(8,null,null,true),predefined:true});k.push({name:"deleteWordNext",keyBinding:new g(46,null,null,true),predefined:true})}if(!e){var m=o&&j;k.push({name:null,keyBinding:new g("u",!m,false,false,m),predefined:true});k.push({name:null,keyBinding:new g("i",
!m,false,false,m),predefined:true});k.push({name:null,keyBinding:new g("b",!m,false,false,m),predefined:true})}if(e){k.push({name:"copy",keyBinding:new g(45,true),predefined:true});k.push({name:"paste",keyBinding:new g(45,null,true),predefined:true});k.push({name:"cut",keyBinding:new g(46,null,true),predefined:true})}var n=this;this._actions=[{name:"lineUp",defaultHandler:function(){return n._doLineUp({select:false})}},{name:"lineDown",defaultHandler:function(){return n._doLineDown({select:false})}},
{name:"lineStart",defaultHandler:function(){return n._doHome({select:false,ctrl:false})}},{name:"lineEnd",defaultHandler:function(){return n._doEnd({select:false,ctrl:false})}},{name:"charPrevious",defaultHandler:function(){return n._doCursorPrevious({select:false,unit:"character"})}},{name:"charNext",defaultHandler:function(){return n._doCursorNext({select:false,unit:"character"})}},{name:"pageUp",defaultHandler:function(){return n._doPageUp({select:false})}},{name:"pageDown",defaultHandler:function(){return n._doPageDown({select:false})}},
{name:"wordPrevious",defaultHandler:function(){return n._doCursorPrevious({select:false,unit:"word"})}},{name:"wordNext",defaultHandler:function(){return n._doCursorNext({select:false,unit:"word"})}},{name:"textStart",defaultHandler:function(){return n._doHome({select:false,ctrl:true})}},{name:"textEnd",defaultHandler:function(){return n._doEnd({select:false,ctrl:true})}},{name:"selectLineUp",defaultHandler:function(){return n._doLineUp({select:true})}},{name:"selectLineDown",defaultHandler:function(){return n._doLineDown({select:true})}},
{name:"selectLineStart",defaultHandler:function(){return n._doHome({select:true,ctrl:false})}},{name:"selectLineEnd",defaultHandler:function(){return n._doEnd({select:true,ctrl:false})}},{name:"selectCharPrevious",defaultHandler:function(){return n._doCursorPrevious({select:true,unit:"character"})}},{name:"selectCharNext",defaultHandler:function(){return n._doCursorNext({select:true,unit:"character"})}},{name:"selectPageUp",defaultHandler:function(){return n._doPageUp({select:true})}},{name:"selectPageDown",
defaultHandler:function(){return n._doPageDown({select:true})}},{name:"selectWordPrevious",defaultHandler:function(){return n._doCursorPrevious({select:true,unit:"word"})}},{name:"selectWordNext",defaultHandler:function(){return n._doCursorNext({select:true,unit:"word"})}},{name:"selectTextStart",defaultHandler:function(){return n._doHome({select:true,ctrl:true})}},{name:"selectTextEnd",defaultHandler:function(){return n._doEnd({select:true,ctrl:true})}},{name:"deletePrevious",defaultHandler:function(){return n._doBackspace({unit:"character"})}},
{name:"deleteNext",defaultHandler:function(){return n._doDelete({unit:"character"})}},{name:"deleteWordPrevious",defaultHandler:function(){return n._doBackspace({unit:"word"})}},{name:"deleteWordNext",defaultHandler:function(){return n._doDelete({unit:"word"})}},{name:"tab",defaultHandler:function(){return n._doTab()}},{name:"enter",defaultHandler:function(){return n._doEnter()}},{name:"selectAll",defaultHandler:function(){return n._doSelectAll()}},{name:"copy",defaultHandler:function(){return n._doCopy()}},
{name:"cut",defaultHandler:function(){return n._doCut()}},{name:"paste",defaultHandler:function(){return n._doPaste()}}]},_createLine:function(g,k,m,n,p){var u=p.getLine(n),v=p.getLineStart(n),A={lineIndex:n,lineText:u,lineStart:v};this.onLineStyle(A);p=m.createElement("DIV");p.lineIndex=n;this._applyStyle(A.style,p);if(u.length!==0){var C=0;if((n=this._tabSize)&&n!==8)for(var D=u.indexOf("\t"),E=0;D!==-1;){this._createRange(p,m,A.ranges,C,D,u,v);var F=n-(D+E)%n,J="\u00a0";for(C=1;C<F;C++)J+=" ";
C=m.createElement("SPAN");C.appendChild(m.createTextNode(J));C.ignoreChars=F-1;E+=C.ignoreChars;if(A.ranges)for(F=0;F<A.ranges.length;F++){J=A.ranges[F];var M=J.start-v,O=J.end-v;if(M>D)break;if(M<=D&&D<O){this._applyStyle(J.style,C);break}}p.appendChild(C);C=D+1;D=u.indexOf("\t",C)}this._createRange(p,m,A.ranges,C,u.length,u,v)}u=m.createElement("SPAN");u.ignoreChars=1;if((this._largestFontStyle&1)!==0)u.style.fontStyle="italic";if((this._largestFontStyle&2)!==0)u.style.fontWeight="bold";u.appendChild(m.createTextNode(!this._fullSelection&&
(e||f||c>=9)?" ":i||e?"\u200c":"\ufeff"));p.appendChild(u);g.insertBefore(p,k);return p},_createRange:function(g,k,m,n,p,u,v){if(!(n>=p)){var A;if(m)for(var C=0;C<m.length;C++){var D=m[C];if(!(D.end<=v+n)){var E=Math.max(v+n,D.start)-v;if(E>=p)break;var F=Math.min(v+p,D.end)-v;if(E<F){E=Math.max(n,E);F=Math.min(p,F);if(n<E){A=k.createElement("SPAN");A.appendChild(k.createTextNode(u.substring(n,E)));g.appendChild(A)}A=k.createElement("SPAN");A.appendChild(k.createTextNode(u.substring(E,F)));this._applyStyle(D.style,
A);g.appendChild(A);n=F}}}if(n<p){A=k.createElement("SPAN");A.appendChild(k.createTextNode(u.substring(n,p)));g.appendChild(A)}}},_doAutoScroll:function(g,k,m){this._autoScrollDir=g;this._autoScrollX=k;this._autoScrollY=m;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=this._autoScrollDir=undefined},_getBoundsAtOffset:function(g){var k=this._model,m=this._frameDocument,n=this._clientDiv,
p=k.getLineAtOffset(g),u,v=this._getLineNode(p);v||(v=u=this._createLine(n,null,m,p,k));var A=null;if(g<k.getLineEnd(p)){k=k.getLineStart(p);for(p=v.firstChild;p;){var C=p.firstChild,D=C.length;if(p.ignoreChars)D-=p.ignoreChars;if(k+D>g){A=g-k;if(r){m=m.createRange();m.setStart(C,A);m.setEnd(C,A+1);A=m.getBoundingClientRect()}else if(c){m=m.body.createTextRange();m.moveToElementText(p);m.collapse();m.moveEnd("character",A+1);m.moveStart("character",A);A=m.getBoundingClientRect()}else{g=C.data;p.removeChild(C);
p.appendChild(m.createTextNode(g.substring(0,A)));var E=m.createElement("SPAN");E.appendChild(m.createTextNode(g.substring(A,A+1)));p.appendChild(E);p.appendChild(m.createTextNode(g.substring(A+1)));A=E.getBoundingClientRect();p.innerHTML="";p.appendChild(C);if(!u){m=this._getSelection();if(k<=m.start&&m.start<k+D||k<=m.end&&m.end<k+D)this._updateDOMSelection()}}if(c){m=window.screen.logicalXDPI;k=window.screen.deviceXDPI;A.left=A.left*m/k;A.right=A.right*m/k}break}k+=D;p=p.nextSibling}}if(!A){v=
this._getLineBoundingClientRect(v);A={left:v.right,right:v.right}}u&&n.removeChild(u);return A},_getBottomIndex:function(g){var k=this._bottomChild;if(g&&this._getClientHeight()>this._getLineHeight()){g=k.getBoundingClientRect();var m=this._clientDiv.getBoundingClientRect();if(g.bottom>m.bottom)k=this._getLinePrevious(k)||k}return k.lineIndex},_getFrameHeight:function(){return this._frameDocument.documentElement.clientHeight},_getFrameWidth:function(){return this._frameDocument.documentElement.clientWidth},
_getClientHeight:function(){var g=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-g.top-g.bottom)},_getClientWidth:function(){var g=this._getViewPadding();return Math.max(0,this._viewDiv.clientWidth-g.left-g.right)},_getClipboardText:function(g){var k=this._model.getLineDelimiter(),m;if(this._frameWindow.clipboardData){m=[];g=this._frameWindow.clipboardData.getData("Text");this._convertDelimiter(g,function(J){m.push(J)},function(){m.push(k)});return m.join("")}if(e){var n=this._frameWindow,
p=this._frameDocument,u=p.createElement("PRE");u.style.position="fixed";u.style.left="-1000px";u.appendChild(p.createTextNode(" "));this._clientDiv.appendChild(u);var v=p.createRange();v.selectNodeContents(u);var A=n.getSelection();A.rangeCount>0&&A.removeAllRanges();A.addRange(v);var C=this,D=function(){C._updateDOMSelection();C._clientDiv.removeChild(u)},E=function(){var J=null;if(A.anchorNode.nodeType!==u.TEXT_NODE)J=A.anchorNode.childNodes[A.anchorOffset];var M=[],O=function(V){for(V=V.firstChild;V&&
V!==J;){if(V.nodeType===u.TEXT_NODE)M.push(V!==A.anchorNode?V.data:V.data.substring(0,A.anchorOffset));else V.tagName==="BR"?M.push(k):O(V);V=V.nextSibling}};O(u);D();return M.join("")};n=false;this._ignorePaste=true;try{n=p.execCommand("paste",false,null)}catch(F){}this._ignorePaste=false;if(!n)if(g){setTimeout(function(){var J=E();J&&C._doContent(J)},0);return null}else{D();return""}return E()}if(g&&g.clipboardData){m=[];g=g.clipboardData.getData("text/plain");this._convertDelimiter(g,function(J){m.push(J)},
function(){m.push(k)});return m.join("")}return""},_getDOMText:function(g){g=this._getLineNode(g).firstChild;for(var k="";g;){for(var m=g.firstChild;m;){if(g.ignoreChars)for(var n=0;n<m.length;n++){var p=m.data.substring(n,n+1);if(p!==" ")k+=p}else k+=m.data;m=m.nextSibling}g=g.nextSibling}return k},_getViewPadding:function(){return this._viewPadding},_getLineBoundingClientRect:function(g){var k=g.getBoundingClientRect();for(g=g.lastChild;g&&g.ignoreChars===g.firstChild.length;)g=g.previousSibling;
if(!g)return{left:k.left,top:k.top,right:k.left,bottom:k.bottom};g=g.getBoundingClientRect();return{left:k.left,top:k.top,right:g.right,bottom:k.bottom}},_getLineHeight:function(){return this._lineHeight},_getLineNode:function(g){for(var k=this._clientDiv.firstChild;k;){if(g===k.lineIndex)return k;k=k.nextSibling}},_getLineNext:function(g){for(g=g?g.nextSibling:this._clientDiv.firstChild;g&&g.lineIndex===-1;)g=g.nextSibling;return g},_getLinePrevious:function(g){for(g=g?g.previousSibling:this._clientDiv.lastChild;g&&
g.lineIndex===-1;)g=g.previousSibling;return g},_getOffset:function(g,k,m){if(k==="wordend")return this._getOffset_W3C(g,k,m);return c?this._getOffset_IE(g,k,m):this._getOffset_W3C(g,k,m)},_getOffset_W3C:function(g,k,m){function n(F){return 33<=F&&F<=47||58<=F&&F<=64||91<=F&&F<=94||F===96||123<=F&&F<=126}function p(F){return F===32||F===9}if(k==="word"||k==="wordend"){var u=this._model,v=u.getLineAtOffset(g),A=u.getLine(v),C=u.getLineStart(v);v=u.getLineEnd(v);u=A.length;g=g-C;var D,E;if(m>0){if(g===
u)return v;D=A.charCodeAt(g);E=n(D);m=!E&&!p(D);for(g++;g<u;){D=A.charCodeAt(g);v=n(D);if(k==="wordend"){if(!v&&E)break}else if(v&&!E)break;D=!v&&!p(D);if(k==="wordend"){if(!D&&m)break}else if(D&&!m)break;m=D;E=v;g++}}else{if(g===0)return C;g--;D=A.charCodeAt(g);E=n(D);for(m=!E&&!p(D);0<g;){D=A.charCodeAt(g-1);v=n(D);if(k==="wordend"){if(v&&!E)break}else if(!v&&E)break;D=!v&&!p(D);if(k==="wordend"){if(D&&!m)break}else if(!D&&m)break;m=D;E=v;g--}}return C+g}return g+m},_getOffset_IE:function(g,k,m){var n=
this._frameDocument,p=this._model,u=p.getLineAtOffset(g),v=this._clientDiv,A,C=this._getLineNode(u);C||(C=A=this._createLine(v,null,n,u,p));var D=0,E;E=p.getLineStart(u);if(g===p.getLineEnd(u)){n=n.body.createTextRange();n.moveToElementText(C.lastChild);E=n.text.length;n.moveEnd(k,m);D=g+n.text.length-E}else if(g===E&&m<0)D=E;else for(C=C.firstChild;C;){p=C.firstChild.length;if(C.ignoreChars)p-=C.ignoreChars;if(E+p>g){n=n.body.createTextRange();if(g===E&&m<0)n.moveToElementText(C.previousSibling);
else{n.moveToElementText(C);n.collapse();n.moveEnd("character",g-E)}E=n.text.length;n.moveEnd(k,m);D=g+n.text.length-E;break}E=p+E;C=C.nextSibling}A&&v.removeChild(A);return D},_getOffsetToX:function(g){return this._getBoundsAtOffset(g).left},_getPadding:function(g){var k,m,n,p;if(g.currentStyle){k=g.currentStyle.paddingLeft;m=g.currentStyle.paddingTop;n=g.currentStyle.paddingRight;p=g.currentStyle.paddingBottom}else if(this._frameWindow.getComputedStyle){g=this._frameWindow.getComputedStyle(g,null);
k=g.getPropertyValue("padding-left");m=g.getPropertyValue("padding-top");n=g.getPropertyValue("padding-right");p=g.getPropertyValue("padding-bottom")}return{left:parseInt(k,10),top:parseInt(m,10),right:parseInt(n,10),bottom:parseInt(p,10)}},_getScroll:function(){var g=this._viewDiv;return{x:g.scrollLeft,y:g.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(g){var k=this._topChild;if(g&&this._getClientHeight()>this._getLineHeight()){g=k.getBoundingClientRect();
var m=this._getViewPadding(),n=this._viewDiv.getBoundingClientRect();if(g.top<n.top+m.top)k=this._getLineNext(k)||k}return k.lineIndex},_getXToOffset:function(g,k){function m(U){var W,Y,da,fa;if(!U._rectsCache){W=U.getClientRects();Y=[W.length];for(da=0;da<W.length;da++){fa=W[da];Y[da]={left:fa.left-E+M,top:fa.top,right:fa.right-E+M,bottom:fa.bottom}}U._rectsCache=Y}W=U._rectsCache;Y=[W.length];for(da=0;da<W.length;da++){fa=W[da];Y[da]={left:fa.left-M,top:fa.top,right:fa.right-M,bottom:fa.bottom}}return Y}
var n=this._model,p=n.getLineStart(g),u=n.getLineEnd(g);if(p===u)return p;var v=this._frameDocument,A=this._clientDiv,C,D=this._getLineNode(g);D||(D=C=this._createLine(A,null,v,g,n));g=this._getLineBoundingClientRect(D);if(k<g.left)k=g.left;if(k>g.right)k=g.right;var E=0,F;if(c<9){F=D.getClientRects();n=F[0].left;for(var J=1;J<F.length;J++)n=Math.min(F[J].left,n);E=n-g.left}var M=this._getScroll().x,O=c?window.screen.logicalXDPI:1,V=c?window.screen.deviceXDPI:1;g=p;n=D.firstChild;a:for(;n;){J=n.firstChild;
D=J.length;if(n.ignoreChars)D-=n.ignoreChars;F=m(n);for(var Z=0;Z<F.length;Z++){var Q=F[Z];if(Q.left<=k&&k<Q.right){if(c||r){v=r?v.createRange():v.body.createTextRange();Z=D;for(var ga=-1;Z-ga>1;){var z=Math.floor((Z+ga)/2);F=ga+1;Q=z===D-1&&n.ignoreChars?J.length:z+1;if(r){v.setStart(J,F);v.setEnd(J,Q)}else{v.moveToElementText(n);v.move("character",F);v.moveEnd("character",Q-F)}F=v.getClientRects();for(var B=false,I=0;I<F.length;I++){Q=F[I];var N=Q.right*O/V-E;if(Q.left*O/V-E<=k&&k<N){B=true;break}}if(B)Z=
z;else ga=z}g+=Z;F=Z;Q=Z===D-1&&n.ignoreChars?J.length:Z+1;if(r){v.setStart(J,F);v.setEnd(J,Q)}else{v.moveToElementText(n);v.move("character",F);v.moveEnd("character",Q-F)}Q=v.getClientRects()[0];k>Q.left*O/V-E+(Q.right-Q.left)*O/V/2&&g++}else{F=[];for(O=0;O<D;O++){F.push("<span>");O===D-1?F.push(J.data.substring(O)):F.push(J.data.substring(O,O+1));F.push("</span>")}n.innerHTML=F.join("");for(F=n.firstChild;F;){Q=F.getBoundingClientRect();if(Q.left<=k&&k<Q.right){k>Q.left+(Q.right-Q.left)/2&&g++;
break}g++;F=F.nextSibling}if(!C){n.innerHTML="";n.appendChild(J);k=this._getSelection();if(g<=k.start&&k.start<g+D||g<=k.end&&k.end<g+D)this._updateDOMSelection()}}break a}}g+=D;n=n.nextSibling}C&&A.removeChild(C);return Math.min(u,Math.max(p,g))},_getYToLine:function(g){var k=this._getViewPadding(),m=this._viewDiv.getBoundingClientRect();g-=m.top+k.top;k=this._getLineHeight();g=Math.floor((g+this._getScroll().y)/k);k=this._model.getLineCount();return Math.max(0,Math.min(k-1,g))},_getOffsetBounds:function(g){var k=
this._model.getLineAtOffset(g),m=this._getLineHeight(),n=this._getScroll(),p=this._getViewPadding(),u=this._viewDiv.getBoundingClientRect();g=this._getBoundsAtOffset(g);k=k*m-n.y+u.top+p.top;return{left:g.left,top:k,right:g.right,bottom:k+m}},_hitOffset:function(g,k,m){var n=this._getOffsetBounds(g);g=n.left;var p=n.right,u=n.top;n=n.bottom;g-=20;u-=20;p+=20;n+=20;return g<=k&&k<=p&&u<=m&&m<=n},_hookEvents:function(){var g=this;this._modelListener={onChanging:function(v,A,C,D,E,F){g._onModelChanging(v,
A,C,D,E,F)},onChanged:function(v,A,C,D,E){g._onModelChanged(v,A,C,D,E)}};this._model.addListener(this._modelListener);this._mouseMoveClosure=function(v){return g._handleMouseMove(v)};this._mouseUpClosure=function(v){return g._handleMouseUp(v)};var k=this._clientDiv,m=this._viewDiv,n=this._frameDocument.body,p=this._handlers=[],u=l?this._textArea:c||e?this._clientDiv:this._frameWindow;p.push({target:c<9?this._frame:this._frameWindow,type:"resize",handler:function(v){return g._handleResize(v)}});p.push({target:u,
type:"blur",handler:function(v){return g._handleBlur(v)}});p.push({target:u,type:"focus",handler:function(v){return g._handleFocus(v)}});p.push({target:m,type:"scroll",handler:function(v){return g._handleScroll(v)}});if(l){k=this._touchDiv;n=this._textArea;p.push({target:n,type:"keydown",handler:function(v){return g._handleKeyDown(v)}});p.push({target:n,type:"input",handler:function(v){return g._handleInput(v)}});p.push({target:n,type:"textInput",handler:function(v){return g._handleTextInput(v)}});
p.push({target:k,type:"touchstart",handler:function(v){return g._handleTouchStart(v)}});p.push({target:k,type:"touchmove",handler:function(v){return g._handleTouchMove(v)}});p.push({target:k,type:"touchend",handler:function(v){return g._handleTouchEnd(v)}})}else{m=this._overlayDiv||this._clientDiv;p.push({target:k,type:"keydown",handler:function(v){return g._handleKeyDown(v)}});p.push({target:k,type:"keypress",handler:function(v){return g._handleKeyPress(v)}});p.push({target:k,type:"keyup",handler:function(v){return g._handleKeyUp(v)}});
p.push({target:k,type:"selectstart",handler:function(v){return g._handleSelectStart(v)}});p.push({target:k,type:"contextmenu",handler:function(v){return g._handleContextMenu(v)}});p.push({target:k,type:"copy",handler:function(v){return g._handleCopy(v)}});p.push({target:k,type:"cut",handler:function(v){return g._handleCut(v)}});p.push({target:k,type:"paste",handler:function(v){return g._handlePaste(v)}});p.push({target:m,type:"mousedown",handler:function(v){return g._handleMouseDown(v)}});p.push({target:n,
type:"mousedown",handler:function(v){return g._handleBodyMouseDown(v)}});p.push({target:m,type:"dragstart",handler:function(v){return g._handleDragStart(v)}});p.push({target:m,type:"dragover",handler:function(v){return g._handleDragOver(v)}});p.push({target:m,type:"drop",handler:function(v){return g._handleDrop(v)}});c&&p.push({target:this._frameDocument,type:"activate",handler:function(v){return g._handleDocFocus(v)}});e&&p.push({target:this._frameDocument,type:"focus",handler:function(v){return g._handleDocFocus(v)}});
if(!c&&!f)p.push({target:this._viewDiv,type:e?"DOMMouseScroll":"mousewheel",handler:function(v){return g._handleMouseWheel(v)}});e&&!q&&p.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(v){return g._handleDataModified(v)}});this._overlayDiv&&p.push({target:this._overlayDiv,type:"contextmenu",handler:function(v){return g._handleContextMenu(v)}});t||p.push({target:this._clientDiv,type:"dblclick",handler:function(v){return g._handleDblclick(v)}})}for(k=0;k<p.length;k++){n=
p[k];b(n.target,n.type,n.handler,n.capture)}},_init:function(g){var k=g.parent;if(typeof k==="string")k=window.document.getElementById(k);if(!k)throw"no parent";this._parent=k;this._model=g.model?g.model:new orion.textview.TextModel;this.readonly=g.readonly===true;this._selection=new y(0,0,false);this._eventTable=new w;this._maxLineWidth=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;for(this._imeOffset=-1;k.hasChildNodes();)k.removeChild(k.lastChild);var m=k.document||k.ownerDocument;this._parentDocument=m;var n=m.createElement("IFRAME");this._frame=n;n.frameBorder="0px";n.style.width="100%";n.style.height="100%";n.scrolling="no";n.style.border=
"0px";k.appendChild(n);var p=[];p.push("<!DOCTYPE html>");p.push("<html>");p.push("<head>");c<9&&p.push("<meta http-equiv='X-UA-Compatible' content='IE=EmulateIE7'/>");p.push("<style>");p.push(".viewContainer {font-family: monospace; font-size: 10pt;}");p.push(".view {padding: 1px 2px;}");p.push(".viewContent {}");p.push("</style>");if(g.stylesheet)for(var u=typeof g.stylesheet==="string"?[g.stylesheet]:g.stylesheet,v=0;v<u.length;v++)try{var A=new XMLHttpRequest;A.overrideMimeType&&A.overrideMimeType("text/css");
A.open("GET",u[v],false);A.send(null);p.push("<style>");p.push(A.responseText);p.push("</style>")}catch(C){p.push("<link rel='stylesheet' type='text/css' href='");p.push(u[v]);p.push("'></link>")}p.push("</head>");p.push("<body spellcheck='false'></body>");p.push("</html>");this._frameWindow=u=n.contentWindow;this._frameDocument=n=u.document;n.open();n.write(p.join(""));n.close();p=n.body;p.className="viewContainer";p.style.margin="0px";p.style.borderWidth="0px";p.style.padding="0px";if(l){this._touchDiv=
v=m.createElement("DIV");v.style.position="absolute";v.style.border="0px";v.style.padding="0px";v.style.margin="0px";v.style.zIndex="2";v.style.overflow="hidden";v.style.background="transparent";v.style.WebkitUserSelect="none";k.appendChild(v);this._textArea=k=m.createElement("TEXTAREA");k.style.position="absolute";k.style.whiteSpace="pre";k.style.left="-1000px";k.tabIndex=1;k.autocapitalize=false;k.autocorrect=false;k.className="viewContainer";k.style.background="transparent";k.style.color="transparent";
k.style.border="0px";k.style.padding="0px";k.style.margin="0px";k.style.borderRadius="0px";k.style.WebkitAppearance="none";k.style.WebkitTapHighlightColor="transparent";v.appendChild(k)}m=n.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";p.appendChild(m);this._scrollDiv=k=n.createElement("DIV");k.id=
"scrollDiv";k.style.margin="0px";k.style.borderWidth="0px";k.style.padding="0px";m.appendChild(k);this._fullSelection=g.fullSelection===undefined||g.fullSelection;if(c<9)this._fullSelection=false;if(l||this._fullSelection&&!i){this._hightlightRGB="Highlight";this._selDiv1=m=n.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";k.appendChild(m);this._selDiv2=v=n.createElement("DIV");v.id="selDiv2";v.style.position="fixed";v.style.borderWidth="0px";v.style.margin="0px";v.style.padding="0px";v.style.MozOutline="none";v.style.outline="none";v.style.background=this._hightlightRGB;v.style.width="0px";v.style.height="0px";k.appendChild(v);this._selDiv3=A=n.createElement("DIV");A.id="selDiv3";A.style.position="fixed";A.style.borderWidth="0px";A.style.margin="0px";A.style.padding="0px";A.style.MozOutline=
"none";A.style.outline="none";A.style.background=this._hightlightRGB;A.style.width="0px";A.style.height="0px";k.appendChild(A);if(e&&o){u=u.getComputedStyle(A,null).getPropertyValue("background-color");switch(u){case "rgb(119, 141, 168)":u="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":u="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":u="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":u="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":u="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":u=
"rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":u="rgb(232, 184, 255)";break;default:u="rgb(180, 213, 255)";break}this._hightlightRGB=u;m.style.background=u;v.style.background=u;A.style.background=u;n.styleSheets[0].insertRule("::-moz-selection {background: "+u+"; }",0)}}u=n.createElement("DIV");u.className="viewContent";this._clientDiv=u;u.id="clientDiv";u.style.whiteSpace="pre";u.style.position="fixed";u.style.borderWidth="0px";u.style.margin="0px";u.style.padding="0px";u.style.MozOutline="none";
u.style.outline="none";if(l)u.style.WebkitTapHighlightColor="transparent";k.appendChild(u);if(e){this._overlayDiv=n=n.createElement("DIV");n.id="overlayDiv";n.style.position=u.style.position;n.style.borderWidth=u.style.borderWidth;n.style.margin=u.style.margin;n.style.padding=u.style.padding;n.style.cursor="text";n.style.zIndex="1";k.appendChild(n)}if(!l)u.contentEditable="true";this._lineHeight=this._calculateLineHeight();this._viewPadding=this._calculatePadding();if(c)p.style.lineHeight=this._lineHeight+
"px";if(g.tabSize)if(f)u.style.OTabSize=g.tabSize+"";else if(e>=4)u.style.MozTabSize=g.tabSize+"";else if(g.tabSize!==8)this._tabSize=g.tabSize;this._createActions();this._hookEvents();this._updatePage()},_modifyContent:function(g,k){if(!(this.readonly&&!g._code)){this.onVerify(g);if(!(g.text===null||g.text===undefined)){var m=this._model;if(g._ignoreDOMSelection)this._ignoreDOMSelection=true;m.setText(g.text,g.start,g.end);if(g._ignoreDOMSelection)this._ignoreDOMSelection=false;if(k){k=this._getSelection();
k.setCaret(g.start+g.text.length);this._setSelection(k,true)}this.onModify({})}}},_onModelChanged:function(g,k,m,n,p){this.onModelChanged({start:g,removedCharCount:k,addedCharCount:m,removedLineCount:n,addedLineCount:p});var u=this._getSelection();if(u.end>g){if(u.end>g&&u.start<g+k)u.setCaret(g+m);else{u.start+=m-k;u.end+=m-k}this._setSelection(u,false,false)}g=this._model.getLineAtOffset(g);for(k=this._getLineNext();k;){m=k.lineIndex;if(g<=m&&m<=g+n)k.lineChanged=true;if(m>g+n)k.lineIndex=m+p-n;
k=this._getLineNext(k)}if(g<=this._maxLineIndex&&this._maxLineIndex<=g+n){this._maxLineIndex=-1;this._maxLineWidth=0}this._updatePage()},_onModelChanging:function(g,k,m,n,p,u){this.onModelChanging({text:g,start:k,removedCharCount:m,addedCharCount:n,removedLineCount:p,addedLineCount:u})},_queueUpdatePage:function(){if(!this._updateTimer){var g=this;this._updateTimer=setTimeout(function(){g._updateTimer=null;g._updatePage()},0)}},_resizeTouchDiv:function(){for(var g=this._viewDiv.getBoundingClientRect(),
k=this._frame.getBoundingClientRect(),m=this._frame;m;){if(m.style&&m.style.top)break;m=m.parentNode}var n=k.top;if(m)n-=m.getBoundingClientRect().top;else n+=this._parentDocument.body.scrollTop;for(m=this._frame;m;){if(m.style&&m.style.left)break;m=m.parentNode}k=k.left;if(m)k-=m.getBoundingClientRect().left;else k+=this._parentDocument.body.scrollLeft;m=this._touchDiv;m.style.left=k+g.left+"px";m.style.top=n+g.top+"px";m.style.width=g.width+"px";m.style.height=g.height+"px"},_scrollView:function(g,
k){this._ensureCaretVisible=false;var m=this._viewDiv;if(g)m.scrollLeft+=g;if(k)m.scrollTop+=k},_setClipboardText:function(g,k){var m;if(this._frameWindow.clipboardData){m=[];this._convertDelimiter(g,function(C){m.push(C)},function(){m.push(s)});return this._frameWindow.clipboardData.setData("Text",m.join(""))}if(j||e||!k){var n=this._frameWindow,p=this._frameDocument,u=p.createElement("PRE");u.style.position="fixed";u.style.left="-1000px";this._convertDelimiter(g,function(C){u.appendChild(p.createTextNode(C))},
function(){u.appendChild(p.createElement("BR"))});u.appendChild(p.createTextNode(" "));this._clientDiv.appendChild(u);g=p.createRange();g.setStart(u.firstChild,0);g.setEndBefore(u.lastChild);n=n.getSelection();n.rangeCount>0&&n.removeAllRanges();n.addRange(g);var v=this;n=function(){v._clientDiv.removeChild(u);v._updateDOMSelection()};g=false;this._ignoreCopy=true;try{g=p.execCommand("copy",false,null)}catch(A){}this._ignoreCopy=false;if(!g)if(k){setTimeout(n,0);return false}n();return true}if(k&&
k.clipboardData){m=[];this._convertDelimiter(g,function(C){m.push(C)},function(){m.push(s)});return k.clipboardData.setData("text/plain",m.join(""))}},_setDOMSelection:function(g,k,m,n){for(var p=this._frameWindow,u=this._frameDocument,v,A,C,D,E=0,F=g.firstChild,J,M,O=this._model.getLine(g.lineIndex).length;F;){J=F.firstChild;M=J.length;if(F.ignoreChars)M-=F.ignoreChars;if(E+M>k||E+M>=O){v=J;A=k-E;if(F.ignoreChars&&M>0&&A===M)A+=F.ignoreChars;break}E+=M;F=F.nextSibling}E=0;F=m.firstChild;for(var V=
this._model.getLine(m.lineIndex).length;F;){J=F.firstChild;M=J.length;if(F.ignoreChars)M-=F.ignoreChars;if(M+E>n||E+M>=V){C=J;D=n-E;if(F.ignoreChars&&M>0&&D===M)D+=F.ignoreChars;break}E+=M;F=F.nextSibling}this._setDOMFullSelection(g,k,O,m,n,V);if(!l)if(p.getSelection){u=u.createRange();u.setStart(v,A);u.setEnd(C,D);C=p.getSelection();this._ignoreSelect=false;C.rangeCount>0&&C.removeAllRanges();C.addRange(u);this._ignoreSelect=true}else if(u.selection){p=u.body;u=u.createElement("DIV");p.appendChild(u);
p.removeChild(u);u=p.createTextRange();u.moveToElementText(v.parentNode);u.moveStart("character",A);v=p.createTextRange();v.moveToElementText(C.parentNode);v.moveStart("character",D);u.setEndPoint("EndToStart",v);this._ignoreSelect=false;u.select();this._ignoreSelect=true}},_setDOMFullSelection:function(g,k,m,n,p,u){var v=this._model;if(this._selDiv1){var A,C;A=this._getLineBoundingClientRect(g);if(k===0)C=A.left;else if(k>=m)C=A.right;else{this._ignoreDOMSelection=true;C=this._getBoundsAtOffset(v.getLineStart(g.lineIndex)+
k).left;this._ignoreDOMSelection=false}if(m=this._textArea){m.selectionStart=m.selectionEnd=0;var D=this._frame.getBoundingClientRect(),E=this._touchDiv.getBoundingClientRect(),F=this._viewDiv.getBoundingClientRect();m.style.left=!(F.left<=C&&C<=F.left+F.width&&F.top<=A.top&&A.top<=F.top+F.height)||!(g===n&&k===p)?"-1000px":C-4+D.left-E.left+"px";m.style.top=A.top+D.top-E.top+"px";m.style.width="6px";m.style.height=A.bottom-A.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(!(g===n&&k===p)){D=l?2:0;E=D+"px blue solid";F=this._getViewPadding();var J=this._clientDiv.getBoundingClientRect(),M=this._viewDiv.getBoundingClientRect();k=M.left+F.left;m=J.right;F=M.top+F.top;J=J.bottom;M=this._getLineBoundingClientRect(n);if(p===0)p=M.left;else if(p>=u)p=M.right;else{this._ignoreDOMSelection=true;p=this._getBoundsAtOffset(v.getLineStart(n.lineIndex)+p).left;this._ignoreDOMSelection=
false}u=this._selDiv1;C=Math.min(m,Math.max(k,C));v=Math.min(J,Math.max(F,A.top));var O=m;A=Math.min(J,Math.max(F,A.bottom));u.style.left=C+"px";u.style.top=v+"px";u.style.width=Math.max(0,O-C)+"px";u.style.height=Math.max(0,A-v)+(l?1:0)+"px";if(l){u.style.borderLeft=E;u.style.borderRight="0px"}if(g===n){O=Math.min(p,m);u.style.width=Math.max(0,O-C-D*2)+"px";if(l)u.style.borderRight=E}else{g=Math.min(J,Math.max(F,M.top));n=Math.min(m,Math.max(k,p));C=Math.min(J,Math.max(F,M.bottom));p=this._selDiv3;
p.style.left=k+"px";p.style.top=g+"px";p.style.width=Math.max(0,n-k-D)+"px";p.style.height=Math.max(0,C-g)+"px";if(l)p.style.borderRight=E;if(g-A>0){n=this._selDiv2;n.style.left=k+"px";n.style.top=A+"px";n.style.width=Math.max(0,m-k)+"px";n.style.height=Math.max(0,g-A)+(l?1:0)+"px"}}}}},_setGrab:function(g){if(g!==this._grabControl)if(g){b(g,"mousemove",this._mouseMoveClosure);b(g,"mouseup",this._mouseUpClosure);g.setCapture&&g.setCapture();this._grabControl=g}else{d(this._grabControl,"mousemove",
this._mouseMoveClosure);d(this._grabControl,"mouseup",this._mouseUpClosure);this._grabControl.releaseCapture&&this._grabControl.releaseCapture();this._grabControl=null}},_setSelection:function(g,k,m){if(g){this._columnX=-1;if(m===undefined)m=true;var n=this._selection;if(!n.equals(g)){this._selection=g;this.onSelection({oldValue:{start:n.start,end:n.end},newValue:{start:g.start,end:g.end}})}if(k)m=!this._showCaret();m&&this._updateDOMSelection()}},_setSelectionTo:function(g,k,m){var n=this._model,
p=this._getSelection();k=this._getYToLine(k);if(this._clickCount===1){n=this._getXToOffset(k,g);p.extend(n);m||p.collapse()}else{if((this._clickCount&1)===0){n=this._getXToOffset(k,g);if(this._doubleClickSelection)if(n>=this._doubleClickSelection.start){m=this._doubleClickSelection.start;n=this._getOffset(n,"wordend",+1)}else{m=this._getOffset(n,"word",-1);n=this._doubleClickSelection.end}else{m=this._getOffset(n,"word",-1);n=this._getOffset(m,"wordend",+1)}}else if(this._doubleClickSelection){g=
n.getLineAtOffset(this._doubleClickSelection.start);if(k>=g){m=n.getLineStart(g);n=n.getLineEnd(k)}else{m=n.getLineStart(k);n=n.getLineEnd(g)}}else{m=n.getLineStart(k);n=n.getLineEnd(k)}p.setCaret(m);p.extend(n)}this._setSelection(p,true,true)},_showCaret:function(){var g=this._model,k=this._getSelection(),m=this._getScroll(),n=k.getCaret(),p=k.start,u=k.end,v=g.getLineAtOffset(p),A=g.getLineAtOffset(u),C=Math.max(Math.max(p,g.getLineStart(A)),u-1),D=this._getViewPadding(),E=this._getClientWidth(),
F=D.left;D=D.left+E;var J=this._getBoundsAtOffset(n===p?p:C),M=J.left,O=J.right,V=E/4;if(!k.isEmpty()&&v===A){J=this._getBoundsAtOffset(n===u?p:C);if(E-V>(n===p?J.right-M:O-J.left)){if(M>J.left)M=J.left;if(O<J.right)O=J.right}}k=this._viewDiv.getBoundingClientRect();M-=k.left;O-=k.left;k=0;if(M<F)k=Math.min(M-F,-V);if(O>D)k=Math.min(this._scrollDiv.scrollWidth-m.x-E,Math.max(O-D,V));F=0;M=this._getTopIndex(true);O=this._getBottomIndex(true);g=g.getLineAtOffset(n);D=this._getClientHeight();if(!(M<=
g&&g<=O)){M=this._getLineHeight();v=(A-v)*M;F=g*M;F-=m.y;if(F+M>D){F-=D-M;if(n===p&&p!==u)F+=Math.min(D-M,v)}else if(n===u)F-=Math.min(D-M,v)}if(k!==0||F!==0){this._scrollView(k,F);if(D!==this._getClientHeight()||E!==this._getClientWidth())this._showCaret();else this._ensureCaretVisible=true;return true}return false},_startIME:function(){if(this._imeOffset===-1){var g=this._getSelection();g.isEmpty()||this._modifyContent({text:"",start:g.start,end:g.end},true);this._imeOffset=g.start}},_unhookEvents:function(){this._model.removeListener(this._modelListener);
this._mouseUpClosure=this._mouseMoveClosure=this._modelListener=null;for(var g=0;g<this._handlers.length;g++){var k=this._handlers[g];d(k.target,k.type,k.handler)}this._handlers=null},_updateDOMSelection:function(){if(!this._ignoreDOMSelection){var g=this._getSelection(),k=this._model,m=k.getLineAtOffset(g.start),n=k.getLineAtOffset(g.end),p=this._getLineNext();if(p){var u=this._getLinePrevious(),v;if(m<p.lineIndex){v=p;m=0}else if(m>u.lineIndex){v=u;m=0}else{v=this._getLineNode(m);m=g.start-k.getLineStart(m)}if(n<
p.lineIndex){p=p;g=0}else if(n>u.lineIndex){p=u;g=0}else{p=this._getLineNode(n);g=g.end-k.getLineStart(n)}this._setDOMSelection(v,m,p,g)}}},_updatePage:function(){function g(B){if(B){for(var I=M+v.top+v.bottom,N=B.firstChild.rows[0].cells,U=0;U<N.length;U++){var W=N[U].firstChild,Y=C;if(W._ruler.getOverview()==="page")Y+=O;W.style.top=-Y+"px";W.style.height=I+Y+"px"}B.style.height=I+"px"}}if(this._updateTimer){clearTimeout(this._updateTimer);this._updateTimer=null}var k=this._frameDocument,m=this._getFrameWidth(),
n=this._getFrameHeight();k.body.style.width=m+"px";k.body.style.height=n+"px";var p=this._viewDiv,u=this._clientDiv,v=this._getViewPadding();p.style.height=Math.max(0,n-v.top-v.bottom)+"px";var A=this._model,C=this._getLineHeight();n=this._getScroll().y;var D=Math.max(0,n)/C,E=Math.floor(D),F=Math.max(0,E-1);n=Math.round((D-F)*C);var J=A.getLineCount(),M=this._getClientHeight(),O=Math.round((D-E)*C);D=Math.floor((M+O)/C);D=Math.min(E+D,J-1);var V=Math.min(D+1,J-1);this._partialY=O;for(var Z,Q=u.firstChild;Q;){Z=
Q.lineIndex;var ga=Q.nextSibling;if(!(F<=Z&&Z<=V)||Q.lineChanged||Q.lineIndex===-1)if(this._mouseWheelLine===Q){Q.style.display="none";Q.lineIndex=-1}else u.removeChild(Q);Q=ga}Q=this._getLineNext();ga=k.createDocumentFragment();for(Z=F;Z<=V;Z++)if(!Q||Q.lineIndex>Z)this._createLine(ga,null,k,Z,A);else{if(ga.firstChild){u.insertBefore(ga,Q);ga=k.createDocumentFragment()}Q=this._getLineNext(Q)}ga.firstChild&&u.insertBefore(ga,Q);if(i)u.style.width=(524287).toString()+"px";for(Q=this._getLineNext();Q;){k=
Q.lineWidth;if(k===undefined){k=this._getLineBoundingClientRect(Q);k=Q.lineWidth=k.right-k.left}if(k>=this._maxLineWidth){this._maxLineWidth=k;this._maxLineIndex=Q.lineIndex}if(Q.lineIndex===E)this._topChild=Q;if(Q.lineIndex===D)this._bottomChild=Q;Q=this._getLineNext(Q)}this._updateRuler(this._leftDiv,E,D);this._updateRuler(this._rightDiv,E,D);k=this._leftDiv?this._leftDiv.scrollWidth:0;E=this._rightDiv?this._rightDiv.scrollWidth:0;p.style.left=k+"px";p.style.width=Math.max(0,m-k-E-v.left-v.right)+
"px";if(this._rightDiv)this._rightDiv.style.left=m-E+"px";E=this._scrollDiv;m=J*C;E.style.height=m+"px";p=this._getClientWidth();J=A=Math.max(this._maxLineWidth,p);if(!c||c>=9)A+=v.right;E.style.width=A+"px";E=this._getScroll();F=A=E.x;D=n;Q=A+p;V=n+M;if(F===0)F-=v.left;if(D===0)D-=v.top;if(Q===J)Q+=v.right;if(E.y+M===m)V+=v.bottom;u.style.clip="rect("+D+"px,"+Q+"px,"+V+"px,"+F+"px)";u.style.left=-A+k+v.left+"px";u.style.top=-n+v.top+"px";u.style.width=(i?J:p+A)+"px";u.style.height=M+n+"px";if(n=
this._overlayDiv){n.style.clip=u.style.clip;n.style.left=u.style.left;n.style.top=u.style.top;n.style.width=u.style.width;n.style.height=u.style.height}g(this._leftDiv);g(this._rightDiv);if(l){var z=this;setTimeout(function(){z._resizeTouchDiv()},0)}this._updateDOMSelection();u=this._ensureCaretVisible;this._ensureCaretVisible=false;if(M!==this._getClientHeight()){this._updatePage();u&&this._showCaret()}},_updateRuler:function(g,k,m){if(g){g=g.firstChild.rows[0].cells;for(var n=this._getLineHeight(),
p=this._frameDocument,u=this._getViewPadding(),v=0;v<g.length;v++){var A=g[v].firstChild,C=A._ruler;A.rulerChanged&&this._applyStyle(C.getStyle(),A);var D,E=A.firstChild;if(E){D=E;E=E.nextSibling}else{D=p.createElement("DIV");D.style.visibility="hidden";A.appendChild(D)}var F;if(A.rulerChanged)if(D){F=-1;this._applyStyle(C.getStyle(F),D);D.innerHTML=C.getHTML(F);D.lineIndex=F;D.style.height=n+u.top+"px"}var J;if(C.getOverview()==="page"){for(;E;){F=E.lineIndex;D=E.nextSibling;if(!(k<=F&&F<=m)||E.lineChanged)A.removeChild(E);
E=D}E=A.firstChild.nextSibling;J=document.createDocumentFragment();for(F=k;F<=m;F++)if(!E||E.lineIndex>F){D=p.createElement("DIV");this._applyStyle(C.getStyle(F),D);D.innerHTML=C.getHTML(F);D.lineIndex=F;D.style.height=n+"px";J.appendChild(D)}else{if(J.firstChild){A.insertBefore(J,E);J=document.createDocumentFragment()}if(E)E=E.nextSibling}J.firstChild&&A.insertBefore(J,E)}else{E=this._getClientHeight()+u.top+u.bottom-34;F=this._model.getLineCount();var M=E/F;if(A.rulerChanged){for(F=A.childNodes.length;F>
1;){A.removeChild(A.lastChild);F--}var O=C.getAnnotations();J=document.createDocumentFragment();for(var V=0;V<O.length;V++){F=O[V];D=p.createElement("DIV");this._applyStyle(C.getStyle(F),D);D.style.position="absolute";D.style.top=17+n+Math.floor(F*M)+"px";D.innerHTML=C.getHTML(F);D.lineIndex=F;J.appendChild(D)}A.appendChild(J)}else if(A._oldTrackHeight!==E)for(D=A.firstChild?A.firstChild.nextSibling:null;D;){D.style.top=17+n+Math.floor(D.lineIndex*M)+"px";D=D.nextSibling}A._oldTrackHeight=E}A.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});
define("dojox/layout/ToggleSplitter",["dojo","dijit","dijit/layout/BorderContainer"],function(b,d){b.declare("dojox.layout.ToggleSplitter",[d.layout._Splitter],{open:true,closedThreshold:5,openSize:"",_closedSize:"0",templateString:'<div class="dijitSplitter dojoxToggleSplitter" dojoAttachEvent="onkeypress:_onKeyPress,onmousedown:_onMouseDown" tabIndex="0" role="separator"><div dojoAttachPoint="toggleNode" class="dijitSplitterThumb dojoxToggleSplitterIcon"></div></div>',postCreate:function(){this._started=
false;this.inherited(arguments);var a=this.region;b.addClass(this.domNode,"dojoxToggleSplitter"+a.charAt(0).toUpperCase()+a.substring(1));this.connect(this,"onDblClick","_toggleMe")},startup:function(){this.inherited(arguments);var a=this.child.domNode,c=b.style(a,this.horizontal?"height":"width");b.forEach(["toggleSplitterOpen","toggleSplitterClosedThreshold","toggleSplitterOpenSize"],function(e){var f=e.substring(14);f=f.charAt(0).toLowerCase()+f.substring(1);if(e in this.child)this[f]=this.child[e]},
this);if(!this.openSize)this.openSize=this.open?c+"px":"75px";this._openStyleProps=this._getStyleProps(a,true);this._started=true;this.set("open",this.open);return this},_onMouseUp:function(){b.disconnect(this._onMoveHandle);b.disconnect(this._onUpHandle);delete this._onMoveHandle;delete this._onUpHandle;delete this._startPosn},_onPrelimMouseMove:function(a){if(Math.abs((this._startPosn||0)-(this.horizontal?a.clientY:a.clientX))>=3){b.disconnect(this._onMoveHandle);this._startDrag(a)}},_onMouseDown:function(a){if(this.open){if(!this._onUpHandle)this._onUpHandle=
b.connect(b.body(),"onmouseup",this,"_onMouseUp");if(!this._onMoveHandle){this._startPosn=this.horizontal?a.clientY:a.clientX;this._onMoveHandle=b.connect(b.body(),"onmousemove",this,"_onPrelimMouseMove")}}},_handleOnChange:function(){var a=this.child.domNode,c;c=this.horizontal?"height":"width";if(this.open){var e=b.mixin({display:"block",overflow:"auto",visibility:"visible"},this._openStyleProps);e[c]=this._openStyleProps&&this._openStyleProps[c]?this._openStyleProps[c]:this.openSize;b.style(a,
e);this.connect(this.domNode,"onmousedown","_onMouseDown")}else{e=b.getComputedStyle(a);c=this._getStyleProps(a,true,e);e=this._getStyleProps(a,false,e);this._openStyleProps=c;b.style(a,e)}this._setStateClass();this.container._started&&this.container._layoutChildren(this.region)},_getStyleProps:function(a,c,e){e||(e=b.getComputedStyle(a));var f={},j=this.horizontal?"height":"width";f.visibility=c?e.visibility:"hidden";f[j]=c?a.style[j]||e[j]:this._closedSize;var h=["Top","Right","Bottom","Left"];
b.forEach(["padding","margin","border"],function(i){for(var l=0;l<h.length;l++){var o=i+h[l];if(i=="border")i+="Width";if(undefined!==e[o])f[o]=c?e[o]:0}});return f},_setStateClass:function(){if(this.open){b.removeClass(this.domNode,"dojoxToggleSplitterClosed");b.addClass(this.domNode,"dojoxToggleSplitterOpen");b.removeClass(this.toggleNode,"dojoxToggleSplitterIconClosed");b.addClass(this.toggleNode,"dojoxToggleSplitterIconOpen")}else{b.addClass(this.domNode,"dojoxToggleSplitterClosed");b.removeClass(this.domNode,
"dojoxToggleSplitterOpen");b.addClass(this.toggleNode,"dojoxToggleSplitterIconClosed");b.removeClass(this.toggleNode,"dojoxToggleSplitterIconOpen")}},_setOpenAttr:function(a){if(this._started){this.open=a;this._handleOnChange(a,true);this[this.open?"onOpen":"onClose"](this.child)}},onOpen:function(){},onClose:function(){},_toggleMe:function(a){a&&b.stopEvent(a);this.set("open",!this.open)},_onKeyPress:function(){this.inherited(arguments)}});b.extend(d._Widget,{toggleSplitterOpen:true,toggleSplitterClosedThreshold:5,
toggleSplitterOpenSize:""})});
define("orion/widgets/eWebBorderContainer",["dojo","dijit","dijit/layout/BorderContainer","dojox/layout/ToggleSplitter"],function(b,d){b.declare("orion.widgets.eWebBorderContainer",d.layout.BorderContainer,{_splitterClass:"orion.widgets.eWebSplitter",getPreferredLeftPaneWidth:function(){var a=this.getSizeCookie();return a<=0?b.position(this.getRightPane()).w*0.25:a},isLeftPaneOpen:function(){var a=this.getSplitter("left");if(a)return a.open;return false},getLeftPane:function(){if(this._left)return this._left;for(var a=
this.getChildren(),c=0;c<a.length;c++)if(a[c].region&&(a[c].region==="leading"||a[c].region==="left"))return this._left=a[c].domNode},getHidingPane:function(){return this.getLeftPane()},getRightPane:function(){if(this._center)return this._center;for(var a=this.getChildren(),c=0;c<a.length;c++)if(a[c].region&&a[c].region==="center")return this._center=a[c].domNode},getSizeCookie:function(){var a=this.getSplitter("left");if(a)return a.getSizeCookie();return 0},setSizeCookie:function(a){var c=this.getSplitter("left");
if(c)return c.setSizeCookie(a)},toggleLeftPaneState:function(){var a=this.getSplitter("left");a&&a.toggleHidingPaneState()},setToggleCallback:function(a){this.toggleCallback=a},toggle:function(){if(!this._left||!this._center)for(var a=this.getChildren(),c=0;c<a.length;c++)if(a[c].region&&a[c].region==="center")this._center=a[c].domNode;else if(a[c].region&&(a[c].region==="leading"||a[c].region==="left"))this._left=a[c].domNode;var e=this._left,f=this._center,j=b.position(e).w,h=this.isLeftPaneOpen(),
i;i=h?0:this.getPreferredLeftPaneWidth();h||this.toggleLeftPaneState();var l=e.style.overflow,o=f.style.overflow;(new b.Animation({node:e,duration:300,curve:[1,100],onAnimate:b.hitch(this,function(q){e.style.width=j+(i-j)*q/100+"px";e.style.overflow="hidden";f.style.overflow="hidden";this.layout()}),onEnd:b.hitch(this,function(){f.style.overflow=o;e.style.overflow=l;this.toggleCallback&&this.toggleCallback.apply();h?this.toggleLeftPaneState():this.setSizeCookie(null)})})).play()}});b.declare("orion.widgets.eWebSplitter",
dojox.layout.ToggleSplitter,{postCreate:function(){this.inherited(arguments);this.connect(this.toggleNode,"onmousedown","_onThumbMouseDown");this.connect(this.toggleNode,"onmouseover","_onThumbMouseOver");this.connect(this.domNode,"onmouseover","_onMouseOver");this.connect(this.toggleNode,"onmouseout","_onThumbMouseOut");this._openStateCookieName=this.container.id+"_"+this.region+"_open"},startup:function(){this.inherited(arguments);if(this.container.persist){var a=b.cookie(this._openStateCookieName);
if(a==="true")this.container.getHidingPane().style.width=this.getSizeCookie()+"px";else{a==="false"?this.set("open",false):this.set("open",true);this._handleOnChange()}}else{this.set("open",true);this._handleOnChange()}return this},_handleOnChange:function(){var a=this.child.domNode,c;c=this.horizontal?"height":"width";if(this.open){var e=b.mixin({display:"block",overflow:"auto",visibility:"visible"},this._openStyleProps);e[c]=this._openStyleProps&&this._openStyleProps[c]?this._openStyleProps[c]:
this.openSize;b.style(a,e);this.connect(this.domNode,"onmousedown","_onMouseDown")}else{e=b.getComputedStyle(a);c=this._getStyleProps(a,true,e);e=this._getStyleProps(a,false,e);this._openStyleProps=c;b.style(a,e)}this._setStateClass();if(this.container._started){a=0;if(this.open&&this.openSize)a=parseInt(this.openSize.replace("px",""),10);this.container._layoutChildren(this.region,a)}},_removeFocusVisual:function(a){b.stopEvent(a)},_onMouseDown:function(a){this.open?this._startDrag(a):this._removeFocusVisual(a)},
_onMouseOver:function(){this.domNode.style.cursor=this.open?"e-resize":"default"},_onThumbMouseDown:function(a){a.stopPropagation();this._removeFocusVisual(a);this.container.toggle()},_onThumbMouseOver:function(){this.toggleNode.style.backgroundColor="#AAAAAA"},_onThumbMouseOut:function(){this.toggleNode.style.backgroundColor="#DDDDDD"},_toggleMe:function(){},getSizeCookie:function(){if(this.container.persist){var a=b.cookie(this._cookieName);if(a)return parseInt(a.replace("px",""),10)}return 0},
setSizeCookie:function(){if(this.container.persist)b.cookie(this._cookieName,this.child.domNode.style[this.horizontal?"height":"width"],{expires:365})},toggleHidingPaneState:function(){this.set("open",!this.open);this.container.getHidingPane().style.visibility=this.open?"visible":"hidden";if(this.container.persist)b.cookie(this._openStateCookieName,this.open?"true":"false",{expires:365})}});b.declare("orion.widgets.eWebBorderContainerReverse",d.layout.BorderContainer,{_splitterClass:"orion.widgets.eWebSplitter",
getPreferredRightPaneWidth:function(){var a=this.getSizeCookie();return a<=0?b.position(this.getLeftPane()).w*0.25:a},isRightPaneOpen:function(){var a=this.getSplitter("right");if(a)return a.open;return false},getRightPane:function(){if(this._right)return this._right;for(var a=this.getChildren(),c=0;c<a.length;c++)if(a[c].region&&(a[c].region==="trailing"||a[c].region==="right"))return this._right=a[c].domNode},getHidingPane:function(){return this.getRightPane()},getLeftPane:function(){if(this._center)return this._center;
for(var a=this.getChildren(),c=0;c<a.length;c++)if(a[c].region&&a[c].region==="center")return this._center=a[c].domNode},getSizeCookie:function(){var a=this.getSplitter("right");if(a)return a.getSizeCookie();return 0},setSizeCookie:function(a){var c=this.getSplitter("right");if(c)return c.setSizeCookie(a)},toggleRightPaneState:function(){var a=this.getSplitter("right");a&&a.toggleHidingPaneState()},setToggleCallback:function(a){this.toggleCallback=a},toggle:function(){if(!this._right||!this._center)for(var a=
this.getChildren(),c=0;c<a.length;c++)if(a[c].region&&a[c].region==="center")this._center=a[c].domNode;else if(a[c].region&&(a[c].region==="trailing"||a[c].region==="right"))this._right=a[c].domNode;var e=this._right,f=this._center,j=b.position(e).w,h=this.isRightPaneOpen(),i;i=h?0:this.getPreferredRightPaneWidth();h||this.toggleRightPaneState();var l=e.style.overflow,o=f.style.overflow;(new b.Animation({node:e,duration:300,curve:[1,100],onAnimate:b.hitch(this,function(q){e.style.width=j+(i-j)*q/
100+"px";e.style.overflow="hidden";f.style.overflow="hidden";this.layout()}),onEnd:b.hitch(this,function(){f.style.overflow=o;e.style.overflow=l;this.toggleCallback&&this.toggleCallback.apply();h?this.toggleRightPaneState():this.setSizeCookie(null)})})).play()}})});
define("setup",["dojo","orion/serviceregistry","orion/preferences","orion/pluginregistry","orion/selection","orion/status","orion/dialogs","orion/users","orion/commands","orion/util","orion/favorites","orion/fileClient","orion/searchClient","orion/globalCommands","orion/outliner","orion/problems","orion/editor/contentAssist","orion/editorCommands","orion/editor/editorFeatures","orion/editor/editor","orion/syntaxchecker","orion/editor/textMateStyler","orion/breadcrumbs","examples/textview/textStyler",
"orion/textview/textView","orion/textview/keyBinding","dojo/parser","dojo/hash","dijit/layout/BorderContainer","dijit/layout/ContentPane","orion/widgets/eWebBorderContainer"],function(b,d,a,c,e,f,j,h,i,l,o,q,x,t,r,s,y,w,g,k,m,n,p,u,v,A){var C=C||{};C.setUpEditor=function(D){var E=null,F=null,J=window.document,M,O,V,Z;J.body.style.visibility="visible";b.parser.parse();(function(){F=new d.ServiceRegistry;E=new c.PluginRegistry(F);b.addOnWindowUnload(function(){E.shutdown()});M=new e.Selection(F);Z=
new f.StatusReportingService(F,"statusPane","notifications");new j.DialogService(F);new h.UserService(F);O=new a.PreferencesService(F,"/prefs/user");V=new i.CommandService({serviceRegistry:F,selection:M});new s.ProblemService(F);new r.OutlineService(F);new o.FavoritesService({serviceRegistry:F})})();var Q=dijit.byId("orion.innerCoding"),ga=b.byId("outline"),z=b.byId("editor"),B=b.byId("searchFloat");b.byId("leftPane");var I=null;D||(I=function(ia){return new y.ContentAssist(ia,"contentassist",F)});
for(var N=F.getServiceReferences("orion.edit.highlighter"),U={styler:null,highlight:function(ia,la){if(this.styler){this.styler.destroy();this.styler=null}if(ia){ia=ia.split(".");var G=ia.pop().toLowerCase();if(ia.length>0){switch(G){case "js":this.styler=new u.TextStyler(la,"js");break;case "java":this.styler=new u.TextStyler(la,"java");break;case "css":this.styler=new u.TextStyler(la,"css");break}if(!this.styler&&N){var H;b.some(N,function(K){var L=K.getProperty("fileTypes");if(L)for(var R=0;R<
L.length;R++)if(L[R]===G){H=K;return true}});if(H){ia=H.getProperty("type");if(ia==="grammar"){ia=H.getProperty("grammar");this.styler=new n.TextMateStyler(la,ia)}else ia==="parser"&&console.debug("TODO implement support for parser-based syntax highlight provider")}}}}}},W=F.getServiceReferences("orion.core.file"),Y,da=0;da<W.length;da++){for(var fa={},na=W[da].getPropertyNames(),ka=0;ka<na.length;ka++)fa[na[ka]]=W[da].getProperty(na[ka]);if((new RegExp(fa.pattern)).test(b.hash()))Y=W[da]}F.getService(Y).then(function(ia){var la=
new q.FileClient(ia),G=new x.Searcher({serviceRegistry:F}),H={lastFilePath:"",setInput:function(P,S){var T=l.getPositionInfo(P),X=T.filePath;if(X){if(X===this.lastFilePath)S.showSelection(T.start,T.end,T.line,T.offset,T.length);else{S.getTextView()||S.installTextView();var ea=setTimeout(function(){S.onInputChange(X,"Fetching "+X,null)},800);la.read(X).then(b.hitch(this,function($){clearTimeout(ea);var aa,ha=$.indexOf("\n"),ba=$.indexOf("\r");if(ba!==-1&&ha!==-1)aa=ha===ba+1?"\r\n":ba<ha?"\r":"\n";
else if(ha!==-1)aa="\n";else if(ba!==-1)aa="\r";S.getTextView().setModel(new orion.textview.TextModel("",aa));S.onInputChange(X,null,$);U.highlight(X,S.getTextView());S.showSelection(T.start,T.end,T.line,T.offset,T.length)}),b.hitch(this,function($){clearTimeout(ea);S.onInputChange(X,"An error occurred: "+$.message,null);console.error("HTTP status code: ",$.status)}));la.read(X,true).then(b.hitch(this,function($){this._fileMetadata=$;this.setTitle($.Location)}),b.hitch(this,function($){console.error("Error loading file metadata: "+
$.message);this.setTitle(X)}))}this.lastFilePath=X}else S.onInputChange("No File Selected","",null)},getInput:function(){return this.lastFilePath},setTitle:function(P){var S=P.lastIndexOf("/"),T=P;if(S!==-1){T=T.substring(S+1);if(P.charAt(0)==="*")T="*"+T}this._lastTitle=T;window.document.title=T;if(S=b.byId("location")){b.empty(S);T=l.getUserName()||"Navigator Root";new p.BreadCrumbs({container:"location",resource:this._fileMetadata,firstSegmentName:T});if(P.charAt(0)==="*")b.create("b",null,S,"last").innerHTML=
"*"}},getTitle:function(){return this._lastTitle},getFileMetadata:function(){return this._fileMetadata},setDirty:function(P){if(P)this._lastTitle&&this._lastTitle.charAt(0)!=="*"&&this.setTitle("*"+this._lastTitle);else this._lastTitle&&this._lastTitle.charAt(0)==="*"&&this.setTitle(this._lastTitle.substring(1))},hashChanged:function(P){this.shouldGoToURI(P,b.hash())?M.setSelections(b.hash()):b.hash(this.lastFilePath)},shouldGoToURI:function(P,S){if(P.isDirty()){P=l.getPositionInfo(this.lastFilePath).filePath;
S=l.getPositionInfo(S).filePath;if(P!==S)return window.confirm("There are unsaved changes.  Do you still want to navigate away?")}return true}},K={handlers:[],addHandler:function(P){this.handlers.push(P)},cancel:function(){for(var P=false,S=0;S<this.handlers.length;S++)P=this.handlers[S].cancel()||P;return P},isActive:function(){for(var P=0;P<this.handlers.length;P++)if(this.handlers[P].isActive())return true;return false},lineUp:function(){return false},lineDown:function(){return false},enter:function(){return false}},
L=new g.AnnotationFactory("/images/problem.gif"),R=new k.Editor({textViewFactory:function(){return new v.TextView({parent:z,stylesheet:["/orion/textview/textview.css","/orion/textview/rulers.css","/examples/textview/textstyler.css","/css/default-theme.css"],tabSize:4,readonly:D})},undoStackFactory:new w.UndoCommandFactory(F,V,"pageActions"),annotationFactory:L,lineNumberRulerFactory:new g.LineNumberRulerFactory,contentAssistFactory:I,keyBindingFactory:function(P,S,T,X){(new w.EditorCommandFactory(F,
V,la,H,"pageActions",D)).generateEditorCommands(P);var ea=new g.TextActions(P,T);S.push(ea);T=new g.SourceCodeActions(P,T,X);S.push(T);S.push(K);P.getTextView().setKeyBinding(new A.KeyBinding("h",true),"Search Files");P.getTextView().setAction("Search Files",function(){window.setTimeout(function(){var $=P.getTextView(),aa=$.getSelection(),ha="";if(aa.end>aa.start)ha=$.getText().substring(aa.start,aa.end);if(ha.length<=0)ha=prompt("Enter search term:",ha);if(ha){b.connect(J,"onkeypress",b.hitch(this,
function(ba){if(ba.charOrCode===b.keys.ESCAPE)B.style.display="none"}));K.addHandler({isActive:function(){return B.style.display==="block"},cancel:function(){if(this.isActive()){B.style.display="none";return true}return false}});b.place(J.createTextNode("Searching for occurrences of "),B,"last");$=b.create("b",null,B,"last");b.place(J.createTextNode('"'+ha+'"...'),$,"only");B.style.display="block";ha=H.getFileMetadata().SearchLocation+ha;G.search(B,ha,H.getInput())}},0);return true});P.getTextView().setKeyBinding(new A.KeyBinding("o",
true),"Toggle Outliner");P.getTextView().setAction("Toggle Outliner",function(){Q.toggle();return true})},statusReporter:function(P,S){S?Z.setErrorMessage(P):Z.setMessage(P)},domNode:z});F.getService("orion.core.marker").then(function(P){P.addEventListener("problemsChanged",function(S){L.showProblems(S)})});b.connect(R,"onDirtyChange",H,H.setDirty);F.getService("orion.page.selection").then(function(P){P.addEventListener("selectionChanged",function(S){H.shouldGoToURI(R,S)&&H.setInput(S,R)})});b.subscribe("/dojo/hashchange",
H,function(){H.hashChanged(R)});H.setInput(b.hash(),R);t.generateBanner("toolbar",F,V,O,G,R,R,K);t.generateDomCommandsInBanner(V,R);new m.SyntaxChecker(F,R);new r.Outliner({parent:ga,serviceRegistry:F,selectionService:M});window.onbeforeunload=function(){if(R.isDirty())return"There are unsaved changes."};Q.setToggleCallback(function(){R.getTextView().redrawLines()});J.onkeydown=function(P){P=P||window.event;if(P.ctrlKey&&P.keyCode===79){Q.toggle();if(J.all)P.keyCode=0;else{P.preventDefault();P.stopPropagation()}}}})};
return C});define("edit",["dojo","setup"],function(b,d){b.addOnLoad(function(){d.setUpEditor(false)})});