(function(){function k(){for(var d=navigator.userAgent,f={browser:!1,version:!1},e=[{name:"Chrome/Chromium",regExp:/(?:chrome|crios|chromium)\/(\d+)/i,minVersion:24},{name:"Firefox",regExp:/firefox\/(\d+)/i,minVersion:17},{name:"Microsoft Internet Explorer",regExp:/msie\s(\d+)/i,minVersion:10},{name:"Microsoft Internet Explorer",regExp:/Trident\/(\d+)/i,minVersion:6},{name:"Safari",regExp:/version\/(\d+).*?safari/i,minVersion:6}],c=0;c<e.length;c++){var b=e[c],m=d.match(b.regExp);if(m){f.browser=
!0;f.version=m[1]>=b.minVersion;f.name=b.name;break}}return f}function l(){try{return"localStorage"in window&&null!==window.localStorage}catch(d){return!1}}function h(d){alert(d);throw Error("unsupported browser");}var f=k();if(f.browser)f.version||h("Sorry, your browser version is not supported.\n\nTo use Orion, please upgrade to the latest version of "+f.name+".\n");else if(l()&&!localStorage.skipBrowserCheck)if(confirm("Sorry, your browser is not supported. The latest version of Chrome, Firefox or Safari web browser is recommended.\nContinue anyway?"))localStorage.skipBrowserCheck=
1;else throw"unsupported browser";else l()||h("Sorry, your browser is not supported.\n\nTo use Orion, the latest version of the Chrome, Firefox, or Safari web browser is recommended.\n");return{isSupportedBrowser:k,supportsLocalStorage:l,throwBrowserAlert:h}})();define("orion/browserCompatibility",function(){});
(function(k,l){"function"===typeof define&&define.amd?define("orion/Deferred",l):"object"===typeof exports?module.exports=l():(k.orion=k.orion||{},k.orion.Deferred=l())})(this,function(){function k(){for(var c;c=d.shift();)c();g=!1}function l(c){d.push(c);g||(g=!0,e())}function h(c){return function(b){c(b)}}function f(){function c(){for(var a;a=g.shift();){var b=a.deferred,c="fulfilled"===q?"resolve":"reject";a=a[c];if("function"===typeof a)try{var e=a(d),m=e&&("object"===typeof e||"function"===typeof e)&&
e.then;if("function"===typeof m)if(e===b.promise)b.reject(new TypeError);else{var f=e.cancel;"function"===typeof f?b._parentCancel=f.bind(e):delete b._parentCancel;m.call(e,h(b.resolve),h(b.reject),h(b.progress))}else b.resolve(e)}catch(s){b.reject(s)}else b[c](d)}}function b(a){delete s._parentCancel;q="rejected";d=a;g.length&&l(c)}function e(a){function h(a){return function(b){(!q||"assumed"===q)&&a(b)}}delete s._parentCancel;try{var v=a&&("object"===typeof a||"function"===typeof a)&&a.then;if("function"===
typeof v)if(a===s)b(new TypeError);else{q="assumed";var k=a&&a.cancel;if("function"!==typeof k){var z=new f;a=z.promise;try{v(z.resolve,z.reject,z.progress)}catch(x){z.reject(x)}k=a.cancel;v=a.then}d=a;v.call(a,h(e),h(b));s._parentCancel=k.bind(a)}else q="fulfilled",d=a,g.length&&l(c)}catch(A){h(b)(A)}}function a(){var a=s._parentCancel;a?(delete s._parentCancel,a()):q||(a=Error("Cancel"),a.name="Cancel",b(a))}var d,q,g=[],s=this;this.resolve=function(a){q||e(a);return s};this.reject=function(a){q||
b(a);return s};this.progress=function(a){q||g.forEach(function(b){if(b.progress)try{b.progress(a)}catch(c){}});return s.promise};this.cancel=function(){s._parentCancel?setTimeout(a,0):a();return s};this.then=function(a,b,e){var d=new f;d._parentCancel=s.promise.cancel;g.push({resolve:a,reject:b,progress:e,deferred:d});("fulfilled"===q||"rejected"===q)&&l(c);return d.promise};this.promise={then:s.then,cancel:s.cancel}}var d=[],g=!1,e=function(){if("undefined"!==typeof process&&"function"===typeof process.nextTick){var c=
process.nextTick;return function(){c(k)}}if("function"===typeof MutationObserver){var b=document.createElement("div");(new MutationObserver(k)).observe(b,{attributes:!0});return function(){b.setAttribute("class","_tick")}}return function(){setTimeout(k,0)}}();f.all=function(c,b){function e(a,b){g||(q[a]=b,0===--d&&s.resolve(q))}function a(a,c){if(!g){if(b)try{e(a,b(c));return}catch(d){c=d}s.reject(c)}}var d=c.length,q=[],g=!1,s=new f;s.then(void 0,function(){g=!0;c.forEach(function(a){a.cancel&&a.cancel()})});
0===d?s.resolve(q):c.forEach(function(b,c){b.then(e.bind(void 0,c),a.bind(void 0,c))});return s.promise};f.when=function(c,b,e,a){var d;c&&"function"===typeof c.then||(d=new f,d.resolve(c),c=d.promise);return c.then(b,e,a)};return f});
define("orion/EventTarget",[],function(){function k(){this._namedListeners={}}k.prototype={dispatchEvent:function(k){if(!k.type)throw Error("unspecified type");var h=this._namedListeners[k.type];h&&h.forEach(function(f){try{"function"===typeof f?f(k):f.handleEvent(k)}catch(d){"undefined"!==typeof console&&console.log(d)}});return!k.defaultPrevented},addEventListener:function(k,h){if("function"===typeof h||h.handleEvent)this._namedListeners[k]=this._namedListeners[k]||[],this._namedListeners[k].push(h)},
removeEventListener:function(k,h){var f=this._namedListeners[k];if(f)for(var d=0;d<f.length;d++)if(f[d]===h){1===f.length?delete this._namedListeners[k]:f.splice(d,1);break}}};k.prototype.constructor=k;k.attach=function(l){var h=new k;l.dispatchEvent=h.dispatchEvent.bind(h);l.addEventListener=h.addEventListener.bind(h);l.removeEventListener=h.removeEventListener.bind(h)};return k});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(k,l){function h(c,b,e){this._properties=e||{};this._properties["service.id"]=c;this._properties.objectClass=b;this._properties["service.names"]=b}function f(c,b,e){this._serviceId=c;this._serviceReference=b;this._internalRegistry=e}function d(c,b){function e(a){return function(){var e;try{if(!b())throw Error("Service was unregistered");var d=c[a].apply(c,Array.prototype.slice.call(arguments));if(d&&"function"===typeof d.then)return d;
e=new k;e.resolve(d)}catch(m){e=new k,e.reject(m)}return e.promise}}for(var a in c)"function"===typeof c[a]&&(this[a]=e(a))}function g(c,b){this.type=c;this.serviceReference=b}function e(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new l;var c=this;this._internalRegistry={isRegistered:function(b){return c._entries[b]?!0:!1},unregisterService:function(b){var e=c._entries[b];if(!e)throw Error("Service has already been unregistered: "+b);var a=e.reference;c._serviceEventTarget.dispatchEvent(new g("unregistering",
a));c._entries[b]=null;a.getProperty("objectClass").forEach(function(b){for(var e=c._namedReferences[b],d=0;d<e.length;d++)if(e[d]===a){1===e.length?delete c._namedReferences[b]:e.splice(d,1);break}})},modifyService:function(b){var e=c._entries[b];if(!e)throw Error("Service not found while trying to send modified event: "+b);c._serviceEventTarget.dispatchEvent(new g("modified",e.reference))}}}h.prototype={getPropertyKeys:function(){var c=[],b;for(b in this._properties)this._properties.hasOwnProperty(b)&&
c.push(b);return c},getProperty:function(c){return this._properties[c]}};h.prototype.constructor=h;f.prototype={unregister:function(){this._internalRegistry.unregisterService(this._serviceId)},getReference:function(){if(!this._internalRegistry.isRegistered(this._serviceId))throw Error("Service has already been unregistered: "+this._serviceId);return this._serviceReference},setProperties:function(c){var b=this._serviceReference._properties;this._serviceReference._properties=c||{};c["service.id"]=this._serviceId;
c.objectClass=b.objectClass;c["service.names"]=b["service.names"];this._internalRegistry.modifyService(this._serviceId)}};f.prototype.constructor=f;e.prototype={getService:function(c){var b;if("string"===typeof c)(c=this._namedReferences[c])&&c.some(function(c){b=this._entries[c.getProperty("service.id")].service;return!!b},this);else if(c=this._entries[c.getProperty("service.id")])b=c.service;return b||null},getServiceReferences:function(c){if(c)return this._namedReferences[c]?this._namedReferences[c]:
[];var b=[];this._entries.forEach(function(c){c&&b.push(c.reference)});return b},registerService:function(c,b,e){if("undefined"===typeof b||null===b)throw Error("invalid service");"string"===typeof c?c=[c]:Array.isArray(c)||(c=[]);var a=this._entries.length,n=new h(a,c,e),q=this._namedReferences;c.forEach(function(a){q[a]=q[a]||[];q[a].push(n)});c=new d(b,this._internalRegistry.isRegistered.bind(null,a));this._entries.push({reference:n,service:c});c=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new g("registered",
n));return new f(a,n,c)},addEventListener:function(c,b){this._serviceEventTarget.addEventListener(c,b)},removeEventListener:function(c,b){this._serviceEventTarget.removeEventListener(c,b)}};e.prototype.constructor=e;return{ServiceRegistry:e}});
define("orion/xhr",["orion/Deferred"],function(k){function l(h,f,d,g){var e="undefined"!==typeof d.response?d.response:d.responseText,c;try{c=d.status}catch(b){c=0}h={args:f,response:e,responseText:"string"===typeof e?e:null,status:c,url:h,xhr:d};"undefined"!==typeof g&&(h.error=g);return h}return function(h,f,d){d=d||{};var g=3<arguments.length&&arguments[3]?arguments[3]:new XMLHttpRequest,e=new k,c=d.headers||{},b=d.log||!1,m;"undefined"===typeof c["X-Requested-With"]&&(c["X-Requested-With"]="XMLHttpRequest");
if("undefined"!==typeof d.data&&("POST"===h||"PUT"===h))m=d.data;var a=!1,n=!1;e.promise.then(void 0,function(b){a=!0;!n&&b instanceof Error&&"Cancel"===b.name&&g.abort()});g.onabort=function(){n=!0;if(!a){var b=Error("Cancel");b.name="Cancel";e.reject(b)}};g.onload=function(){var a=l(f,d,g);200<=g.status&&400>g.status?e.resolve(a):(e.reject(a),b&&"undefined"!==typeof console&&console.log(Error(g.statusText)))};g.onerror=function(){var a=l(f,d,g);e.reject(a);b&&"undefined"!==typeof console&&console.log(Error(g.statusText))};
g.onprogress=function(a){a.xhr=g;e.progress(a)};try{g.open(h,f,!0);"string"===typeof d.responseType&&(g.responseType=d.responseType);if("number"===typeof d.timeout)if("number"===typeof g.timeout)g.timeout=d.timeout,g.addEventListener("timeout",function(a){e.reject(l(f,d,g,"Timeout exceeded"))});else{var q=setTimeout(function(){e.reject(l(f,d,g,"Timeout exceeded"))},d.timeout);e.promise.then(clearTimeout.bind(null,q),clearTimeout.bind(null,q))}Object.keys(c).forEach(function(a){g.setRequestHeader(a,
c[a])});g.send(m||null)}catch(r){e.reject(l(f,d,g,r))}return e.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(k,l,h){function f(b,a){this._name=b;this._providers=a;this._flushPending=!1;this._cached=null;this._stores=[];this._pendingDeletes=[];this._dirty=[]}function d(b,a){return{get:function(c,e){if(0===a)return null;var d=localStorage.getItem(b+c);if(null===d)return null;d=JSON.parse(d);return e||-1===a||d._expires&&d._expires>(new Date).getTime()?(delete d._expires,d):null},set:function(c,e){if(0!==a)if(-1!==a&&(e._expires=(new Date).getTime()+
1E3*a),0===Object.keys(e).length)localStorage.removeItem(b+c);else{var d=JSON.stringify(e);localStorage.setItem(b+c,d);delete e._expires}},remove:function(a){localStorage.removeItem(b+a)}}}function g(b){this._currentPromises={};this._cache=new d("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var a=b.getServiceReferences("orion.core.preference.provider");0<a.length&&(this._service=b.getService(a[0]))}return!!this._service}}function e(b){this._location=
b;this._currentPromise=null;this._cache=new d("/orion/preferences/default",3600)}function c(){this._cache=new d("/orion/preferences/local",-1)}function b(b,a){this._userProvider=new g(b);this._localProvider=new c;a=a||"defaults.pref";-1===a.indexOf("://")&&(a=k.toUrl(a));this._defaultsProvider=new e(a);this._serviceRegistration=b.registerService("orion.core.preference",this)}f.prototype={_flush:function(){for(var b=[],a=0;a<this._stores.length;++a){var c=this._stores[a];-1!==this._dirty.indexOf(c)&&
b.push(this._providers[a].put(this._name,c));if(this._pendingDeletes[a]&&0<this._pendingDeletes[a].length){for(c=0;c<this._pendingDeletes[a].length;c++)b.push(this._providers[a].remove(this._name,this._pendingDeletes[a][c]));delete this._pendingDeletes[a]}}this._dirty=[];return l.all(b)},_scheduleFlush:function(b){b&&-1===this._dirty.indexOf(b)&&this._dirty.push(b);this._flushPending||(this._flushPending=!0,window.setTimeout(function(){this._flushPending&&(this._flushPending=!1,this._flush())}.bind(this),
0))},_getCached:function(){if(!this._cached){this._cached={};for(var b=0;b<this._stores.length;++b){var a=this._stores[b],c;for(c in a)a.hasOwnProperty(c)&&"undefined"===typeof this._cached[c]&&(this._cached[c]=a[c])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(b){return this._getCached()[b]},put:function(b,a){if(0!==this._stores.length){var c=this._stores[0];c[b]!==a&&(c[b]=a,this._cached=null,this._scheduleFlush(c))}},remove:function(b){for(var a=0;a<
this._stores.length;++a){var c=this._stores[a];if(c.hasOwnProperty(b))return delete c[b],this._pendingDeletes[a]||(this._pendingDeletes[a]=[]),this._pendingDeletes[a].push(b),this._cached=null,this._scheduleFlush(),!0}return!1},clear:function(){for(var b=0;b<this._stores.length;++b)this._stores[b]={},this._scheduleFlush(this._stores[b]);this._cached=null},sync:function(b){if(this._flushPending)return this._flushPending=!1,this._flush();for(var a=this,c=[],e=0;e<this._providers.length;++e)c.push(this._providers[e].get(this._name,
b).then(function(b){return function(c){a._stores[b]=c}}(e)));return l.all(c).then(function(){a._cached=null;a._getCached()})},flush:function(){this._flush()}};g.prototype={get:function(b,a){if(this._currentPromises[b])return this._currentPromises[b];var c=new l,e=null;a?this._cache.remove(b):e=this._cache.get(b);if(null!==e)c.resolve(e);else{this._currentPromises[b]=c;var d=this;this._service.get(b).then(function(a){d._cache.set(b,a);delete d._currentPromises[b];c.resolve(a)},function(a){404===a.status?
(a={},d._cache.set(b,a),delete d._currentPromises[b],c.resolve(a)):(delete d._currentPromises[b],c.resolve(d._cache.get(b,!0)||{}))})}return c},put:function(b,a){this._cache.set(b,a);return this._service.put(b,a)},remove:function(b,a){var c=this._cache.get(b);delete c[a];this._cache.set(b,c);return this._service.remove(b,a)}};e.prototype={get:function(b,a){if(this._currentPromise)return this._currentPromise;var c=new l,e=null;a?this._cache.remove(b):e=this._cache.get(b);if(null!==e)c.resolve(e);else{this._currentPromise=
c;var d=this;h("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(a){a=JSON.parse(a.response);d._cache.set(b,a[b]||{});d._currentPromise=null;c.resolve(a[b]||{})},function(a){401===a.xhr.status||404===a.xhr.status?(d._cache.set(b,{}),d._currentPromise=null,c.resolve({})):(d._currentPromise=null,a=d._cache.get(b,!0),null!==a?c.resolve(a[b]||{}):c.resolve({}))})}return c},put:function(b,a){var c=new l;c.resolve();return c},remove:function(b,a){var c=this._cache.get(b);
delete c[a];this.put(b,c)}};c.prototype={get:function(b){var a=new l;b=this._cache.get(b);null!==b?a.resolve(b):a.resolve({});return a},put:function(b,a){var c=new l;this._cache.set(b,a);c.resolve();return c},remove:function(b,a){var c=this._cache.get(b);delete c[a];this.put(b,c)}};b.DEFAULT_SCOPE=1;b.LOCAL_SCOPE=2;b.USER_SCOPE=4;b.prototype={listenForChangedSettings:function(c,a,e){if(!a||"number"!==typeof a||7<a||1>a)e=a,a=b.DEFAULT_SCOPE|b.LOCAL_SCOPE|b.USER_SCOPE;window.addEventListener("storage",
e,!1);return 0!==(b.USER_SCOPE&a)?"/orion/preferences/user"+c:0!==(b.LOCAL_SCOPE&a)?"/orion/preferences/local"+c:"/orion/preferences/default"+c},getPreferences:function(c,a){if(!a||"number"!==typeof a||7<a||1>a)a=b.DEFAULT_SCOPE|b.LOCAL_SCOPE|b.USER_SCOPE;var e=[];b.USER_SCOPE&a&&this._userProvider.available()&&e.push(this._userProvider);b.LOCAL_SCOPE&a&&e.push(this._localProvider);b.DEFAULT_SCOPE&a&&e.push(this._defaultsProvider);var d=new f(c,e);return d.sync().then(function(){return d})},getSetting:function(b,
a,c){for(var e,d=0;d<b.length;d++)if(b[d].label===a)for(var f=0;f<b[d].data.length;f++)if(b[d].data[f].label===c){e=b[d].data[f].value;break}return e}};return{PreferencesService:b}});
(function(){function k(a){if("string"!==typeof a)throw new TypeError;}function l(a){return a?a.split("\x26"):[]}function h(a){return 0===a.length?"":a.join("\x26")}function f(a){var p=/([^=]*)(?:=?)(.*)/.exec(a);a=p[1]?decodeURIComponent(p[1]):"";p=p[2]?decodeURIComponent(p[2]):"";return[a,p]}function d(a){var p=encodeURIComponent(a[0]);a[1]&&(p+="\x3d"+encodeURIComponent(a[1]));return p}function g(a,p){var b="",c=[],e=0;return{next:function(){b!==a.query&&(b=a.query,c=l(b));if(e<c.length){var d=
f(c[e++]);switch(p){case "keys":return d[0];case "values":return d[1];case "keys+values":return[d[0],d[1]];default:throw new TypeError;}}throw y;}}}function e(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function c(a){return a?/[1-9]\d*$/.exec(a)[0]:""}function b(a){var p=[];a.split("/").forEach(function(a){".."===a?p.pop():"."!==a&&p.push(a)});return p.join("/")}function m(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function a(a,p){if("string"!==
typeof a)throw new TypeError;a=m(a);var e=s.exec(a);if(!e)return null;var d={};d.scheme=e[1]||"";if(d.scheme&&!w.test(d.scheme))return null;var y=e[2];if(y&&(y=t.exec(y),d.userinfo=y[1],d.host=y[2],d.port=y[3],d.port&&!v.test(d.port)))return null;d.path=e[3];d.query=e[4];d.fragment=e[5];!d.scheme&&p&&(d.scheme=p.scheme,!d.host&&p.host&&(d.userinfo=p.userinfo,d.host=p.host,d.port=p.port,d.pathRelative=!0));d.pathRelative&&(d.path?"/"!==d.path[0]&&(e=/^(.*\/)[^\/]*$/.exec(p.path)[1]||"/",d.path=e+d.path):
d.path=p.path);d.scheme&&(d.scheme=d.scheme.toLowerCase());d.port&&(d.port=c(d.port));d.host&&d.path&&(d.path=b(d.path));return d}function n(p,b){var c;if(b){b=b.href||b;c=a(b);if(!c||!c.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:c})}c=a(p,c);if(!c)throw new SyntaxError;Object.defineProperty(this,"_input",{value:p,writable:!0});Object.defineProperty(this,"_url",{value:c,writable:!0});var d=new e(this);Object.defineProperty(this,"query",{get:function(){return this._url?
d:null},enumerable:!0})}try{var q;if("function"===typeof window.URL&&0!==window.URL.length&&"http:"===(q=new window.URL("http://www.w3.org?q")).protocol&&q.query)return}catch(r){}var s=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,t=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,w=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,v=/^\d*$/,u=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,z=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,x=/^([^?#\s]*)$/,A=/^([^\s]*)$/,p=/^\S*$/,B=/([^:]*):?(.*)/,y="undefined"!==
typeof StopIteration?StopIteration:Error("Stop Iteration"),C={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(e.prototype,{get:{value:function(a){k(a);var p;l(this._url.query).some(function(b){b=f(b);if(b[0]===a)return p=b[1],!0});return p},enumerable:!0},set:{value:function(a,p){k(a);k(p);var b=l(this._url.query);b.some(function(c,e){var y=f(c);if(y[0]===a)return y[1]=p,b[e]=d(y),!0})||b.push(d([a,p]));this._url.query=h(b)},enumerable:!0},has:{value:function(a){k(a);
return l(this._url.query).some(function(p){if(f(p)[0]===a)return!0})},enumerable:!0},"delete":{value:function(a){k(a);var p=l(this._url.query),b=p.filter(function(p){return f(p)[0]!==a});return b.length!==p.length?(this._url.query=h(b),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,p){if("function"!==typeof a)throw new TypeError;var b=g(this._url,"keys+values");try{for(;;){var c=b.next();a.call(p,c[1],c[0],this)}}catch(e){if(e!==y)throw e;
}},enumerable:!0},keys:{value:function(){return g(this._url,"keys")},enumerable:!0},values:{value:function(){return g(this._url,"values")},enumerable:!0},items:{value:function(){return g(this._url,"keys+values")}},size:{get:function(){return l(this._url.query).length},enumerable:!0},getAll:{value:function(a){k(a);var p=[];l(this._url.query).forEach(function(b){b=f(b);b[0]===a&&p.push(b[1])});return p},enumerable:!0},append:{value:function(a,p){k(a);k(p);var b=l(this._url.query);b.push(d([a,p]));this._url.query=
h(b)},enumerable:!0}});Object.defineProperties(n.prototype,{href:{get:function(){var a;if(this._url){a=this._url;var p=a.scheme?a.scheme+":":"";a.host&&(p+="//",a.userinfo&&(p+=a.userinfo+"@"),p+=a.host,a.port&&(p+=":"+a.port));p+=a.path;a.query&&(p+="?"+a.query);a.fragment&&(p+="#"+a.fragment);a=p}else a=this._input;return a},set:function(p){k(p);this._input=p;this._url=a(this._input,this._baseURL)},enumerable:!0},origin:{get:function(){return this._url&&this._url.host?this.protocol+"//"+this.host:
""},enumerable:!0},protocol:{get:function(){return this._url?this._url.scheme+":":":"},set:function(a){k(a);if(this._url&&(a=":"===a.slice(-1)?a.substring(0,a.length-1):a,""===a||w.test(a)))this._url.scheme=a.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(a){k(a);this._url&&(this._url.userinfo=a)}},username:{get:function(){if(!this._url)return"";var a=B.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){k(a);if(this._url){var p=
B.exec(this._userinfo);a=[encodeURIComponent(a||"")];p[2]&&a.push(p[2]);this._userinfo=a.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var a=B.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){k(a);if(this._url){var p=[B.exec(this._userinfo)[1]||""];a&&p.push(encodeURIComponent(a));this._userinfo=p.join(":")}},enumerable:!0},host:{get:function(){var a="";this._url&&this._url.host&&(a+=this._url.host,this._url.port&&(a+=":"+this._url.port));return a},
set:function(a){k(a);if(this._url&&(a=z.exec(a)))this._url.host=a[1],this._url.port=c(a[2])},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){k(a);this._url&&u.exec(a)&&(this._url.host=a)},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===C[this.protocol]&&(a="");return a},set:function(a){k(a);this._url&&v.exec(a)&&(this._url.port=c(a))},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(a){k(a);
this._url&&x.exec(a)&&(this._url.host&&a&&"/"!==a[0]&&(a="/"+a),this._url.path=a?b(a):"")},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){k(a);this._url&&(a&&"?"===a[0]&&(a=a.substring(1)),A.exec(a)&&(this._url.query=a))},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(a){k(a);this._url&&(a&&"#"===a[0]&&(a=a.substring(1)),p.exec(a)&&(this._url.fragment=a))},enumerable:!0}});
if((q=window.URL||window.webkitURL)&&q.createObjectURL)Object.defineProperty(n,"createObjectURL",{value:q.createObjectURL.bind(q),enumerable:!1}),Object.defineProperty(n,"revokeObjectURL",{value:q.revokeObjectURL.bind(q),enumerable:!1});window.URL=n})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(k,l,h){function f(a,b){var c=Object.keys(a),e=Object.keys(b);if(c.length!==e.length)return!1;c.sort();e.sort();for(var d=0,n=c.length;d<n;d++){var m=c[d];if(m!==e[d])return!1;var f=a[m],m=b[m];if(f!==m&&JSON.stringify(f)!==JSON.stringify(m))return!1}return!0}function d(a){if(-1===a.indexOf("://"))try{return(new URL(a,location.href)).href}catch(b){}return a}function g(a){var b=null,c={key:function(c){return(b=
b||Object.keys(a))[c]},getItem:function(b){return a[b]},setItem:function(c,e){a[c]=e;b=null},removeItem:function(c){delete a[c];b=null},clear:function(){(b=b||Object.keys(a)).forEach(function(b){delete a[b]}.bind(this));b=null}};Object.defineProperty(c,"length",{get:function(){return(b=b||Object.keys(a)).length}});return c}function e(a,b){if(b&&b instanceof XMLHttpRequest){var c,e;try{c=b.status,e=b.statusText}catch(d){c=0,e=""}return{status:c||0,statusText:e}}return b}function c(a){var b=a?JSON.parse(JSON.stringify(a,
e)):a;a instanceof Error&&(b.__isError=!0,b.message=b.message||a.message,b.name=b.name||a.name);return b}function b(a,b){this.type=a;this.plugin=b}function m(a,b){this.__objectId=a;this.__methods=b}function a(a,e,d){function n(a){N&&d.postMessage(a,N)}function g(a){if(!N)return(new k).reject(Error("plugin not connected"));a.id=String(T++);var p=new k;X[a.id]=p;p.then(null,function(p){"active"===D&&p instanceof Error&&"Cancel"===p.name&&n({requestId:a.id,method:"cancel",params:p.message?[p.message]:
[]})});var b=Object.prototype.toString;a.params.forEach(function(c,e){if("[object Object]"===b.call(c)&&!(c instanceof m)){var d,y;for(d in c)"[object Function]"===b.call(c[d])&&(y=y||[],y.push(d));if(y){var B=V++;S[B]=c;d=function(){delete S[B]};p.then(d,d);a.params[e]=new m(B,y)}}});d.postMessage(a,N);return p.promise}function h(a,p){a||0===a?n({id:a,result:null,error:p}):console.log(p)}function u(a,p,b,e){e.forEach(function(a,p){if(a&&"undefined"!==typeof a.__objectId){var b={};a.__methods.forEach(function(p){b[p]=
function(){return g({objectId:a.__objectId,method:p,params:Array.prototype.slice.call(arguments)})}});e[p]=b}});var d=void 0===typeof a?null:{id:a,result:null,error:null};try{var y=b.apply(p,e);d&&(y&&"function"===typeof y.then?(W[a]=y,y.then(function(p){delete W[a];d.result=p;n(d)},function(p){W[a]&&(delete W[a],d.error=c(p),n(d))},function(){n({responseId:a,method:"progress",params:Array.prototype.slice.call(arguments)})})):(d.result=y,n(d)))}catch(B){d&&(d.error=c(B),n(d))}}function z(a){try{if(a.method){var p=
a.method,b=a.params||[];if("serviceId"in a){var c=$[a.serviceId];c||h(a.id,"service not found");p in c?u(a.id,c,c[p],b):h(a.id,"method not found")}else if("objectId"in a){var e=S[a.objectId];e||h(a.id,"object not found");p in e?u(a.id,e,e[p],b):h(a.id,"method not found")}else if("requestId"in a){var B=W[a.requestId];B&&"cancel"===p&&B.cancel&&B.cancel.apply(B,b)}else if("responseId"in a){var n=X[a.responseId];n&&"progress"===p&&n.progress&&n.progress.apply(n,b)}else if("plugin"===a.method){var m=
a.params[0];O({headers:m.headers,services:m.services}).then(function(){M&&M.resolve(y)})}else if("timeout"===a.method)M&&M.reject(a.error);else throw Error("Bad method: "+a.method);}else{var q=X[String(a.id)];delete X[String(a.id)];if(a.error){var f=d.handleServiceError(y,a.error);q.reject(f)}else q.resolve(a.result)}}catch(g){console.log("Plugin._messageHandler "+g)}}function x(a){var p={};if(a.methods&&(a.methods.forEach(function(b){p[b]=function(){var p={serviceId:a.serviceId,method:b,params:Array.prototype.slice.call(arguments)};
return"active"===D?g(p):y.start({"transient":!0}).then(function(){return g(p)})}}),p.addEventListener&&p.removeEventListener)){var b=new l,c=V++;S[c]={handleEvent:b.dispatchEvent.bind(b)};var e=new m(c,["handleEvent"]),d=p.addEventListener;p.addEventListener=function(a,p){b._namedListeners[a]||d(a,e);b.addEventListener(a,p)};var B=p.removeEventListener;p.removeEventListener=function(a,p){b.removeEventListener(a,p);b._namedListeners[a]||B(a,e)}}return p}function A(p){var b=JSON.parse(JSON.stringify(p.properties));
b.__plugin__=a;p=p.names||p.type||[];Array.isArray(p)||(p=[p]);b.objectClass=p;return b}function p(a){var p=x(a),b=A(a),b=d.registerService(a.names||a.type,p,b);G[a.serviceId]={registration:b,proxy:p}}function B(){d.persist(a,{created:C,headers:K,services:Q,autostart:E,lastModified:L})}var y=this;e=e||{};var C=e.created||(new Date).getTime(),K=e.headers||{},Q=e.services||[],E=e.autostart,L=e.lastModified||0,D="installed",F,M,N,P,G={},T=0,V=0,W={},X={},S={},$={},O;this._persist=B;this._resolve=function(){D=
"resolved";d.dispatchEvent(new b("resolved",y))};this._getAutostart=function(){return E};this._getCreated=function(){return C};this.getLocation=function(){return a};this.getHeaders=function(){return JSON.parse(JSON.stringify(K))};this.getName=function(){var a=this.getHeaders();return a?a.name||"":null};this.getVersion=function(){var a=this.getHeaders();return a?a.version||"0.0.0":null};this.getLastModified=function(){return L};this.getServiceReferences=function(){var a=[];Object.keys(G).forEach(function(p){a.push(G[p].registration.getReference())});
return a};this.setParent=function(a){return P!==a?(P=a,y.stop({"transient":!0}).then(function(){if("started"===E)return y.start({"transient":!0});if("lazy"===E)return y.start({lazy:!0,"transient":!0})})):(new k).resolve()};this.getState=function(){return D};this.start=function(c){if("uninstalled"===D)return(new k).reject(Error("Plugin is uninstalled"));if(F)return F.promise.then(this.start.bind(this,c));if("active"===D)return(new k).resolve();if(!c||!c.transient){var e=c&&c.lazy?"lazy":"started";
e!==E&&(E=e,B())}e=d.getState();if("starting"!==e&&"active"!==e)return c.transient?(new k).reject(Error("start transient error")):(new k).resolve();if("installed"===D)try{this._resolve()}catch(n){return(new k).reject(n)}"resolved"===D&&Q.forEach(function(a){p(a)});if(c&&c.lazy)return"starting"!==D&&(D="starting",d.dispatchEvent(new b("lazy activation",y))),(new k).resolve();var m=new k;F=m;D="starting";d.dispatchEvent(new b("starting",y));M=new k;N=d.connect(a,z,P);M.then(function(){M=null;D="active";
d.dispatchEvent(new b("started",y));F=null;m.resolve()},function(){M=null;D="stopping";d.dispatchEvent(new b("stopping",y));Object.keys(G).forEach(function(a){G[a].registration.unregister();delete G[a]});d.disconnect(N);N=null;D="resolved";F=null;d.dispatchEvent(new b("stopped",y));m.reject(Error("plugin activation error"))});return m.promise};this.stop=function(a){if("uninstalled"===D)return(new k).reject(Error("Plugin is uninstalled"));if(F)return F.promise.then(this.stop.bind(this,a));if((!a||
!a.transient)&&"stopped"!==E)E="stopped",B();if("active"!==D&&"starting"!==D)return(new k).resolve();F=a=new k;D="stopping";d.dispatchEvent(new b("stopping",y));Object.keys(G).forEach(function(a){G[a].registration.unregister();delete G[a]});N&&(d.disconnect(N),N=null);D="resolved";F=null;d.dispatchEvent(new b("stopped",y));a.resolve();return a.promise};O=function(c){if("uninstalled"===D)return(new k).reject(Error("Plugin is uninstalled"));if(!c)return 0===L&&(L=(new Date).getTime(),B()),d.loadManifest(a).then(O);
var e=K,n=Q,m=E;K=c.headers||{};Q=c.services||{};E=c.autostart||E;c.lastModified?L=c.lastModified:(L=(new Date).getTime(),B());if(f(K,e)&&f(Q,n)&&E===m)return(new k).resolve();if("active"===D||"starting"===D){var g=[];Object.keys(Q).forEach(function(a){var b=Q[a];g.push(a);var c=G[a];if(c){if(f(b.methods,Object.keys(c.proxy))){a=A(b);var e=c.registration.getReference(),d={};e.getPropertyKeys().forEach(function(a){d[a]=e.getProperty(a)});f(a,d)||c.registration.setProperties(a);return}c.registration.unregister();
delete G[a]}p(b)});Object.keys(G).forEach(function(a){-1===g.indexOf(a)&&(G[a].registration.unregister(),delete G[a])})}"active"===D&&(d.disconnect(N),M=new k,N=d.connect(a,z,P),M.then(function(){M=null},function(){M=null;D="stopping";d.dispatchEvent(new b("stopping"),y);Object.keys(G).forEach(function(a){G[a].registration.unregister();delete G[a]});d.disconnect(N);N=null;D="resolved";d.dispatchEvent(new b("stopped",y))}));return(new k).resolve()};this.update=function(a){return O(a).then(function(){d.dispatchEvent(new b("updated",
y))})};this.uninstall=function(){if("uninstalled"===D)return(new k).reject(Error("Plugin is uninstalled"));if("active"===D||"starting"===D||"stopping"===D)return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));d.removePlugin(this);D="uninstalled";d.dispatchEvent(new b("uninstalled",y));return(new k).resolve()}}var n=/^http[s]?/i;return{Plugin:a,PluginRegistry:function(c,e){function m(a){var p=a.source;z.some(function(b){if(p===b.target){try{var c;if("undefined"===typeof b.useStructuredClone){var e=
"string"!==typeof a.data;c=e?a.data:JSON.parse(a.data);b.useStructuredClone=e}else c=b.useStructuredClone?a.data:JSON.parse(a.data);b.handler(c)}catch(d){}return!0}})}e=e||{};var f=e.storage||localStorage;f.getItem||(f=g(f));var h="installed",v,u=[],z=[],x=new l,A={},p={registerService:c.registerService.bind(c),connect:function(a,p,b,c){function e(a){a=Error(a);a.name="timeout";p({method:"timeout",error:a})}var d={handler:p,url:a},n=setTimeout(e.bind(null,"Load timeout for: "+a),c||15E3),m=document.createElement("iframe");
m.name=a+"_"+(new Date).getTime();m.src=a;m.onload=function(){clearTimeout(n);n=setTimeout(e.bind(null,"Plugin handshake timeout for: "+a),5E3)};m.sandbox="allow-scripts allow-same-origin";m.style.width=m.style.height="100%";m.frameBorder=0;(b||v).appendChild(m);d.target=m.contentWindow;d.close=function(){clearTimeout(n);if(m){var a=m.parentNode;a&&a.removeChild(m);m=null}};z.push(d);return d},disconnect:function(a){for(var p=0;p<z.length;p++)if(a===z[p]){z.splice(p,1);try{a.close()}catch(b){}break}},
removePlugin:function(a){for(var p=0;p<u.length;p++)if(a===u[p]){u.splice(p,1);break}f.removeItem("plugin."+a.getLocation())},persist:function(a,p){f.setItem("plugin."+a,JSON.stringify(p))},postMessage:function(a,p){p.target.postMessage(p.useStructuredClone?a:JSON.stringify(a),p.url)},dispatchEvent:function(a){try{x.dispatchEvent(a)}catch(p){console&&console.log("PluginRegistry.dispatchEvent "+p)}},loadManifest:function(a){var b=new k,c=p.connect(a,function(a){c&&a.method&&("manifest"===a.method||
"plugin"===a.method?(a=a.params[0],p.disconnect(c),c=null,b.resolve(a)):"timeout"===a.method&&(p.disconnect(c),c=null,b.reject(a.error)))});return b.promise},getState:function(){return h},handleServiceError:function(a,p){if(p&&401===p.status){var b=a.getHeaders(),c=a.getName()||a.getLocation(),e=document.createElement("span");e.appendChild(document.createTextNode("Authentication required for: "+c+"."));b.login&&(e.appendChild(document.createTextNode(" ")),c=document.createElement("a"),c.target="_blank",
c.textContent="Login",c.href=b.login,n.test(c.href)?(e.appendChild(c),e.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+b.login));return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(e)}}if(p.__isError){var d=p;p=Error(d.message);Object.keys(d).forEach(function(a){p[a]=d[a]});delete p.__isError}return p}};this.getLocation=function(){return"System"};this.getHeaders=function(){return{}};this.getName=function(){return"System"};
this.getVersion=function(){return"0.0.0"};this.getLastModified=function(){return 0};this.getState=p.getState;this.init=function(){if(!("starting"===h||"active"===h||"stopping"===h)){addEventListener("message",m,!1);for(var b=[],c=0,n=f.length;c<n;c++)b.push(f.key(c));b.forEach(function(b){if(0===b.indexOf("plugin.")){var c=b.substring(7);b=JSON.parse(f.getItem(b));b.created&&u.push(new a(c,b,p))}});u.sort(function(a,p){return a._getCreated()<p._getCreated()?-1:1});e.parent?v=e.parent:(v=document.createElement("div"),
e.visible||(v.style.display="none",v.style.visibility="hidden"),document.body.appendChild(v));e.plugins&&Object.keys(e.plugins).forEach(function(b){b=d(b);if(!this.getPlugin(b)){var c=e.plugins[b];"object"!==typeof c&&(c={});c.autostart=c.autostart||e.defaultAutostart||"lazy";u.push(new a(b,c,p))}}.bind(this));h="starting"}};this.start=function(){"starting"!==h&&this.init();if("starting"!==h)return(new k).reject("Cannot start framework. Framework is already "+h+".");var a=[],p=(new Date).getTime();
u.forEach(function(b){var c=b._getAutostart();0===b.getLastModified()?a.push(b.update().then(function(){if("started"===c)return b.start({"transient":!0});if("lazy"===c)return b.start({lazy:!0,"transient":!0});b._resolve()})):"started"===c?a.push(b.start({"transient":!0})):"lazy"===c?(a.push(b.start({lazy:!0,"transient":!0})),p>b.getLastModified()+864E5&&b.update()):b._resolve()});return k.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){h="active"})};this.stop=function(){if("starting"!==
h&&"active"!==h)return(new k).reject("Cannot stop registry. Registry is already "+h+".");h="stopping";var a=[];u.forEach(function(p){a.push(p.stop({"transient":!0}))});return k.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){if(!e.parent){var a=v.parentNode;a&&a.removeChild(v)}v=null;removeEventListener("message",m);h="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new k).reject("Cannot uninstall registry")};
this.installPlugin=function(c,e){c=d(c);var n=this.getPlugin(c);if(n)return(new k).resolve(n);if(A[c])return A[c];if(e)return n=new a(c,e,p),u.push(n),n._persist(),p.dispatchEvent(new b("installed",n)),(new k).resolve(n);var m=p.loadManifest(c).then(function(e){n=new a(c,e,p);u.push(n);n._persist();delete A[c];p.dispatchEvent(new b("installed",n));return n},function(a){delete A[c];throw a;});return A[c]=m};this.getPlugins=function(){return u.slice()};this.getPlugin=function(a){var p=null;a=d(a);u.some(function(b){if(a===
b.getLocation())return p=b,!0});return p};this.addEventListener=x.addEventListener.bind(x);this.removeEventListener=x.removeEventListener.bind(x);this.resolvePlugins=function(){var a=!0;u.forEach(function(p){a=a&&p._resolve()});return a}}}});
define("orion/serviceTracker",[],function(){function k(f,d){function g(a){var e=a.getProperty("service.id"),d=this.addingService(a);d&&(c[e]=a,b[e]=d)}function e(a){var e=a.getProperty("service.id"),d=b[e];delete c[e];delete b[e];this.removedService(a,d)}this.serviceRegistry=f;var c={},b={},m=l,a,n;this.close=function(){if(m!==h)throw"Already closed";m=l;f.removeEventListener("registered",a);f.removeEventListener("unregistering",n);n=a=null;var b=this;this.getServiceReferences().forEach(function(a){e.call(b,
a)});if("function"===typeof this.onClose)this.onClose()};this.getServiceReferences=function(){var a=Object.keys(c);return!a.length?null:a.map(function(a){return c[a]})};this.open=function(){if(m!==l)throw"Already open";m=h;var b=this;a=function(a){if(-1!==a.serviceReference.getProperty("objectClass").indexOf(d)&&(g.call(b,a.serviceReference),"function"===typeof b.onServiceAdded))return b.onServiceAdded(a.serviceReference,b.serviceRegistry.getService(a.serviceReference))};n=function(a){-1!==a.serviceReference.getProperty("objectClass").indexOf(d)&&
e.call(b,a.serviceReference)};f.addEventListener("registered",a);f.addEventListener("unregistering",n);f.getServiceReferences(d).forEach(function(a){g.call(b,a);if("function"===typeof b.onServiceAdded)return b.onServiceAdded(a,f.getService(a))});if("function"===typeof this.onOpen)this.onOpen()}}var l=0,h=1;k.prototype={addingService:function(f){return this.serviceRegistry.getService(f)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(f,d){}};return k});
define("orion/objects",[],function(){function k(k){for(var h=1;h<arguments.length;h++){var f=arguments[h],d;for(d in f)Object.prototype.hasOwnProperty.call(f,d)&&(k[d]=f[d])}return k}return{clone:function(l){if(Array.isArray(l))return Array.prototype.slice.call(l);var h=Object.create(Object.getPrototypeOf(l));k(h,l);return h},mixin:k,toArray:function(k){return Array.isArray(k)?k:[k]}}});
define("orion/config",["orion/Deferred","orion/serviceTracker","orion/objects"],function(k,l,h){var f,d,g,e,c,b="pid";f=function(a,c,e){function d(a,b,e){b.forEach(function(d,m){try{var p=a[m].getProperty("__plugin__"),B=p&&c.getPlugin(p);(!p||B&&"active"===B.getState())&&b[m].updated(e)}catch(y){"undefined"!==typeof console&&console.log(y)}})}l.call(this,a,"orion.cm.managedservice");var m={},f={},g=function(c){var d=[];c.plugin.getServiceReferences().forEach(function(c){if(-1!==c.getProperty("objectClass").indexOf("orion.cm.managedservice")){var n=
c.getProperty(b);c=a.getService(c);n&&c&&(n=(n=e._find(n))&&n.getProperties(),d.push(c.updated(n)))}});return k.all(d)};this.addingService=function(c){var e=c.getProperty(b),d=a.getService(c);if(!e||!d)return null;m[e]||(m[e]=[]);f[e]||(f[e]=[]);m[e].push(c);f[e].push(d);return d};this.onServiceAdded=function(a,c){var n=a.getProperty(b),n=e._find(n);d([a],[c],n&&n.getProperties())};this.onOpen=function(){c.addEventListener("started",g)};this.onClose=function(){c.removeEventListener("started",g)};
this.notifyUpdated=function(a){var b=a.getPid();d(m[b]||[],f[b]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();d(m[a]||[],f[a]||[],null)};this.removedService=function(a,c){var e=a.getProperty(b),d=m[e],n=f[e];1<d.length?d.splice(d.indexOf(a),1):delete m[e];1<n.length?n.splice(n.indexOf(c),1):delete f[e]}};d=function(){function a(a,b,c){this.store=new g(this,c);this.configAdmin=new e(this,this.store);this.tracker=new f(a,b,this.store)}a.prototype={getConfigurationAdmin:function(){var a=
this;return this.configAdmin._init().then(function(b){a.tracker.open();return b})},notifyDeleted:function(a){this.tracker.notifyDeleted(a)},notifyUpdated:function(a){this.tracker.notifyUpdated(a)}};return a}();e=function(){function a(a,b){this.factory=a;this.store=b}a.prototype={_init:function(){var a=this;return this.store._init().then(function(){return a})},getConfiguration:function(a){return this.store.get(a)},listConfigurations:function(){return this.store.list()}};return a}();var m="/cm/configurations";
g=function(){function a(a,e){this.factory=a;this.prefsService=e;this.configs=Object.create(null);this.pref=null;var d=this;this.initPromise=this.prefsService.getPreferences(m).then(function(a){d.pref=a;a.keys().forEach(function(e){if(!d.configs[e]){var n=a.get(e);"object"===typeof n&&null!==n&&0<Object.keys(n).length&&(n[b]=e,d.configs[e]=new c(d.factory,d,n))}})})}a.prototype={_init:function(){return this.initPromise},_find:function(a){return this.configs[a]||null},get:function(a){var b=this._find(a);
b||(b=new c(this.factory,this,a),this.configs[a]=b);return b},list:function(){var a=this,b=[];this.pref.keys().forEach(function(c){(c=a._find(c))&&null!==c.getProperties()&&b.push(c)});return b},remove:function(a){this.pref.remove(a);delete this.configs[a]},save:function(a,b){this.pref.put(a,b.getProperties(!0)||{})}};return a}();c=function(){function a(a,c){c=h.clone(c);delete c[b];a.properties=c}function c(e,d,n){this.factory=e;this.store=d;if(null!==n&&"object"===typeof n)this.pid=n[b],a(this,
n);else if("string"===typeof n)this.pid=n,this.properties=null;else throw Error("Invalid pid/properties "+n);}c.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(a){this._checkRemoved();var c=null;this.properties&&(c=h.clone(this.properties),a||(c[b]=this.pid));return c},remove:function(){this._checkRemoved();this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=
!0},update:function(b){this._checkRemoved();a(this,b);this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return c}();return{ConfigurationAdminFactory:d}});
define("orion/bootstrap","require orion/Deferred orion/serviceregistry orion/preferences orion/pluginregistry orion/config".split(" "),function(k,l,h,f,d,g){var e;return{startup:function(){if(e)return e;e=new l;var c=new h.ServiceRegistry,b=new f.PreferencesService(c);return b.getPreferences("/plugins").then(function(m){var a={plugins:{}};m.keys().forEach(function(b){var c=k.toUrl(b);a.plugins[c]=m[b]});var n=new d.PluginRegistry(c,a);return n.start().then(function(){if(0<c.getServiceReferences("orion.core.preference.provider").length)return b.getPreferences("/plugins",
b.USER_SCOPE).then(function(a){var b=[];a.keys().forEach(function(a){a=k.toUrl(a);n.getPlugin(a)||b.push(n.installPlugin(a,{autostart:"lazy"}).then(function(a){return a.update().then(function(){return a.start({lazy:!0})})}))});return l.all(b,function(a){console.log(a)})})}).then(function(){return(new g.ConfigurationAdminFactory(c,n,b)).getConfigurationAdmin().then(c.registerService.bind(c,"orion.cm.configadmin"))}).then(function(){var a=c.getService("orion.core.auth");if(a){var b=a.getUser().then(function(b){if(b)localStorage.setItem("lastLogin",
(new Date).getTime());else return a.getAuthForm(window.location.href).then(function(a){setTimeout(function(){window.location=a},0)})}),e=localStorage.getItem("lastLogin");if(!e||e<(new Date).getTime()-9E5)return b}}).then(function(){var a={serviceRegistry:c,preferences:b,pluginRegistry:n};e.resolve(a);return a})})}}});
(function(){function k(d,f,e,c,b,m){f[d]&&(e.push(d),(!0===f[d]||1===f[d])&&c.push(b+d+"/"+m))}function l(d,f,e,c,b){f=c+f+"/"+b;require._fileExists(d.toUrl(f+".js"))&&e.push(f)}function h(d,f,e){for(var c in f)f.hasOwnProperty(c)&&(!d.hasOwnProperty(c)||e)?d[c]=f[c]:"object"===typeof f[c]&&h(d[c],f[c],e)}var f=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(d){var g=d.config?d.config():{},g=g||{};return{version:"2.0.1+",load:function(e,c,b,d){d=d||{};d.locale&&(g.locale=
d.locale);var a=f.exec(e),n=a[1],q=a[4],r=a[5],s=q.split("-"),t=[],w={},v,u="";a[5]?(n=a[1],e=n+r):(r=a[4],q=g.locale,q||(q=g.locale="undefined"===typeof navigator?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()),s=q.split("-"));if(d.isBuild){t.push(e);l(c,"root",t,n,r);for(v=0;v<s.length;v++)d=s[v],u+=(u?"-":"")+d,l(c,u,t,n,r);c(t,function(){b()})}else c([e],function(a){var e=[],d;k("root",a,e,t,n,r);for(v=0;v<s.length;v++)d=s[v],u+=(u?"-":"")+d,k(u,a,e,t,n,r);c(t,function(){var p,
d,y;for(p=e.length-1;-1<p&&e[p];p--){y=e[p];d=a[y];if(!0===d||1===d)d=c(n+y+"/"+r);h(w,d)}b(w)})})}}})})();
define("orion/i18n",[],function(){return{load:function(k,l,h,f){f=f||{};var d=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,g=d.exec(k);if(g){if(!l.defined||l.defined(k))try{h(l(k));return}catch(e){}if(f.isBuild||f.isTest)h({});else if(l.specified&&!l.specified("orion/bootstrap"))h({});else{var c=g[1],b=g[3]?g[2]:"",m=g[3]||g[2];l(["orion/bootstrap"],function(a){a.startup().then(function(a){var e=a.serviceRegistry;a=e.getServiceReferences("orion.i18n.message");if(b)a.some(function(a){return k===a.getProperty("name")?
(e.getService(a).getMessageBundle().then(function(a){h(a)},function(){h({})}),!0):!1})||h({});else{var r={},s;a.forEach(function(a){var e=a.getProperty("name");if((g=d.exec(e))&&c===g[1]&&m===(g[3]||g[2]))if(b=g[3]?g[2]:""){if((a=f.locale||("undefined"!==typeof navigator?navigator.language||navigator.userLanguage:null))&&0===a.toLowerCase().indexOf(b.toLowerCase()))r[b]=!0,(!l.specified||!l.specified(e))&&define(e,["orion/i18n!"+e],function(a){return a})}else s=a});!l.specified||!l.specified(k)?s?
e.getService(s).getMessageBundle().then(function(a){Object.keys(r).forEach(function(b){"undefined"===typeof a[b]&&(a[b]=r[b])});define(k,[],a);h(a)},function(){define(k,[],r);h(r)}):(define(k,[],r),h(r)):h(r)}})})}}else h(null)}}});
define("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Shell:"Shell",ShellLinkWorkspace:"Workspace Shell","Get Plugins":"Get Plugins",Global:"Global",Editor:"Editor",EditorRelatedLink:"Show Current Folder",EditorRelatedLinkParent:"Show Enclosing Folder",EditorLinkWorkspace:"Show Workspace",EditorRelatedLinkProj:"Show Project","Filter bindings":"Filter bindings","Orion Editor":"Orion Editor","Orion Image Viewer":"Orion Image Viewer","Orion Markdown Viewer":"Orion Markdown Viewer","Orion JSON Editor":"Orion JSON Editor",
"View on Site":"View on Site","View this file or folder on a web site hosted by Orion":"View this file or folder on a web site hosted by Orion.","Show a list of all the keybindings on this page":"Show a list of all the keybindings on this page","Show Keys":"Show Keys","Hide or show the page banner and footer":"Hide or show the page banner and footer","Toggle banner and footer":"Toggle banner and footer","Choose a file by name and open an editor on it":"Choose a file by name and open an editor on it",
"Find File Named...":"Find File Named...","System Configuration Details":"System Configuration Details","System Config Tooltip":"Go to the System Configuration Details page","Background Operations":"Background Operations","Background Operations Tooltip":"Go to the Background Operations page","Operation status is unknown":"Operation status is unknown","Unknown item":"Unknown item","Can't search: no search service is available":"Can't search: no search service is available","could not find banner parent, id was ":"could not find banner parent, id was ",
Related:"Related",Options:"Options",FAQ:"FAQ","Report a Bug":"Bugs","Privacy Policy":"Privacy","Terms of Use":"Terms","Copyright Agent":"Copyright","Orion Logo":"Orion Logo","Orion is in Beta. Please try it out but BEWARE your data may be lost.":"2014-04-02_22-01-33","LOG: ":"LOG: ",View:"View","no parent":"no parent","no tree model":"no tree model","no renderer":"no renderer","could not find table row ":"could not find table row ","Resource is out of sync with the server. Do you want to save it anyway?":"Resource is out of sync with the server. Do you want to save it anyway?",
Operations:"Operations","Operations running":"Operations running","Some operations finished with warning":"Some operations finished with warning","Some operations finished with error":"Some operations finished with error","no service registry":"no service registry",Tasks:"Tasks",Close:"Close","Expand all":"Expand all","Collapse all":"Collapse all",Search:"Search","Advanced search":"Advanced search",Submit:"Submit",More:"More","Saved searches":"Saved searches","Recent searches":"Recent searches","Regular expression":"Regular expression",
"Search options":"Search options","Global search":"Global search","Orion Home":"Orion Home","Close notification":"Close notification","Operations - Press spacebar to show current operations":"Operations - Press spacebar to show current operations","Type a keyword or wild card to search in root":"Type a keyword or wild card to search in root","Toggle side panel":"Toggle side panel","Open or close the side panel":"Open or close the side panel",Projects:"Projects","Toggle Sidebar":"Toggle Sidebar","Sample HTML5 Site":"Sample HTML5 Site",
"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.":"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.","Sample Orion Plugin":"Sample Orion Plugin","Generate a sample plugin for integrating with Orion.":"Generate a sample plugin for integrating with Orion.",Browser:"Web Browser",OutlineProgress:"Getting outline for ${0} from ${1}",UnknownError:"An unknown error occurred.",UnknownWarning:"An unknown warning occurred.",Filter:"Filter (* \x3d any string, ? \x3d any character)",
"To view the browser's context menu, trigger the context menu again.":"To view the browser's context menu, trigger the context menu again.",Edit:"Edit",CentralNavTooltip:"Toggle Navigation Menu"});define("orion/nls/messages",["orion/i18n!orion/nls/messages","orion/nls/root/messages"],function(k,l){var h={root:l};Object.keys(k).forEach(function(f){"undefined"===typeof h[f]&&(h[f]=k[f])});return h});
define("orion/util",[],function(){var k=navigator.userAgent,l=-1!==k.indexOf("MSIE")||-1!==k.indexOf("Trident")?document.documentMode:void 0,h=parseFloat(k.split("Firefox/")[1]||k.split("Minefield/")[1])||void 0,f=-1!==k.indexOf("Opera")?parseFloat(k.split("Version/")[1]):void 0,d=parseFloat(k.split("Chrome/")[1])||void 0,g=-1!==k.indexOf("Safari")&&!d,e=parseFloat(k.split("WebKit/")[1])||void 0,c=-1!==k.indexOf("Android"),b=-1!==k.indexOf("iPad"),k=-1!==k.indexOf("iPhone"),m=b||k,a=-1!==navigator.platform.indexOf("Mac"),
n=-1!==navigator.platform.indexOf("Win"),q=-1!==navigator.platform.indexOf("Linux"),r="ontouchstart"in document.createElement("input");return{formatMessage:function(a){var b=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,c){return b[(c<<0)+1]})},createElement:function(a,b){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",b):a.createElement(b)},isIE:l,isFirefox:h,isOpera:f,isChrome:d,isSafari:g,isWebkit:e,isAndroid:c,isIPad:b,isIPhone:k,isIOS:m,isMac:a,isWindows:n,
isLinux:q,isTouch:r,platformDelimiter:n?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(k){function l(b,c){c||(c=document);return c.querySelectorAll(b)}function h(b){var c=b.tabIndex;0===c&&k.isIE&&!{a:!0,body:!0,button:!0,frame:!0,iframe:!0,img:!0,input:!0,isindex:!0,object:!0,select:!0,textarea:!0}[b.nodeName.toLowerCase()]&&!b.attributes.tabIndex&&(c=-1);return c}function f(b){if(0<=h(b))return b;if(b.hasChildNodes())for(var c=0;c<b.childNodes.length;c++){var a=f(b.childNodes[c]);if(a)return a}return null}function d(b){if(0<=
h(b))return b;if(b.hasChildNodes())for(var c=b.childNodes.length-1;0<=c;c--){var a=d(b.childNodes[c]);if(a)return a}return null}function g(b,c){if(3===b.nodeType){var a=e.exec(b.nodeValue);a&&1<a.length&&c(b,a)}if(b.hasChildNodes())for(a=0;a<b.childNodes.length;a++)g(b.childNodes[a],c)}var e=/\$\{([^\}]+)\}/,c=null;return{$:function(b,c){c||(c=document);return c.querySelector(b)},$$:l,$$array:function(b,c){return Array.prototype.slice.call(l(b,c))},node:function(b){var c=b;"string"===typeof b&&(c=
document.getElementById(b));return c},contains:function(b,c){if(!b||!c)return!1;if(b===c)return!0;var a=b.compareDocumentPosition(c);return Boolean(a&16)},bounds:function(b){b=b.getBoundingClientRect();return{left:b.left+document.documentElement.scrollLeft,top:b.top+document.documentElement.scrollTop,width:b.width,height:b.height}},empty:function(b){for(;b.hasChildNodes();)b.removeChild(b.firstChild)},firstTabbable:f,lastTabbable:d,stop:function(b){window.document.all&&(b.keyCode=0);b.preventDefault&&
(b.preventDefault(),b.stopPropagation())},processTextNodes:function(b,c){g(b,function(a,b){a.parentNode.replaceChild(document.createTextNode(c[b[1]]||b[1]),a)})},processDOMNodes:function(b,c){g(b,function(a,b){var e=c[b[1]];if(e){var d=document.createRange(),f=b.index;d.setStart(a,f);d.setEnd(a,f+b[0].length);d.deleteContents();d.insertNode(e)}})},addAutoDismiss:function(b,e){function a(a){c.forEach(function(b){var c=!1,e=b.excludeNodes.some(function(b){return document.body.contains(b)?(c=!0,b.contains(a.target)):
!1});if(c&&!e)try{b.dismiss(a)}catch(d){"undefined"!==typeof console&&console&&console.error(d&&d.message)}});c=c.filter(function(a){return a.excludeNodes.some(function(a){return document.body.contains(a)})})}null===c&&(c=[],document.addEventListener("click",a,!0),k.isIOS&&document.addEventListener("touchend",function(a){function b(){a.target.removeEventListener("click",b)}0===a.touches.length&&a.target.addEventListener("click",b)},!1));c.push({excludeNodes:b,dismiss:e})},setFramesEnabled:function(b){for(var c=
document.getElementsByTagName("iframe"),a=0;a<c.length;a++)c[a].parentNode.style.pointerEvents=b?"":"none"},removeAutoDismiss:function(b){c=c.filter(function(c){return b!==c.dismiss})},KEY:{BKSPC:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46}}});
define("text",["module"],function(k){var l,h,f=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],d=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,g=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,e="undefined"!==typeof location&&location.href,c=e&&location.protocol&&location.protocol.replace(/\:/,""),b=e&&location.hostname,m=e&&(location.port||void 0),a=[],n=k.config&&k.config()||{};l={version:"2.0.5",strip:function(a){if(a){a=a.replace(d,"");var b=a.match(g);b&&(a=b[1])}else a="";return a},
jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:n.createXhr||function(){var a,b,c;if("undefined"!==typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!==typeof ActiveXObject)for(b=0;3>b;b+=1){c=f[b];try{a=new ActiveXObject(c)}catch(e){}if(a){f=[c];break}}return a},parseName:function(a){var b,
c,e=!1,d=a.indexOf(".");b=0===a.indexOf("./")||0===a.indexOf("../");-1!==d&&(!b||1<d)?(b=a.substring(0,d),c=a.substring(d+1,a.length)):b=a;a=c||b;d=a.indexOf("!");-1!==d&&(e="strip"===a.substring(d+1),a=a.substring(0,d),c?c=a:b=a);return{moduleName:b,ext:c,strip:e}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,b,c,e){var d,n;d=l.xdRegExp.exec(a);if(!d)return!0;a=d[2];d=d[3];d=d.split(":");n=d[1];d=d[0];return(!a||a===b)&&(!d||d.toLowerCase()===c.toLowerCase())&&(!n&&!d||n===e)},finishLoad:function(b,
c,e,d){e=c?l.strip(e):e;n.isBuild&&(a[b]=e);d(e)},load:function(a,d,f,g){if(g.isBuild&&!g.inlineText)f();else{n.isBuild=g.isBuild;var h=l.parseName(a);g=h.moduleName+(h.ext?"."+h.ext:"");var k=d.toUrl(g),u=n.useXhr||l.useXhr;!e||u(k,c,b,m)?l.get(k,function(b){l.finishLoad(a,h.strip,b,f)},function(a){f.error&&f.error(a)}):d([g],function(a){l.finishLoad(h.moduleName+"."+h.ext,h.strip,a,f)})}},write:function(b,c,e,d){a.hasOwnProperty(c)&&(d=l.jsEscape(a[c]),e.asModule(b+"!"+c,"define(function () { return '"+
d+"';});\n"))},writeFile:function(a,b,c,e,d){b=l.parseName(b);var n=b.ext?"."+b.ext:"",m=b.moduleName+n,f=c.toUrl(b.moduleName+n)+".js";l.load(m,c,function(b){b=function(a){return e(f,a)};b.asModule=function(a,p){return e.asModule(a,f,p)};l.write(a,m,b,d)},d)}};if("node"===n.env||!n.env&&"undefined"!==typeof process&&process.versions&&process.versions.node)h=require.nodeRequire("fs"),l.get=function(a,b){var c=h.readFileSync(a,"utf8");0===c.indexOf("\ufeff")&&(c=c.substring(1));b(c)};else if("xhr"===
n.env||!n.env&&l.createXhr())l.get=function(a,b,c,e){var d=l.createXhr(),m;d.open("GET",a,!0);if(e)for(m in e)e.hasOwnProperty(m)&&d.setRequestHeader(m.toLowerCase(),e[m]);if(n.onXhr)n.onXhr(d,a);d.onreadystatechange=function(e){4===d.readyState&&(e=d.status,399<e&&600>e?(e=Error(a+" HTTP status: "+e),e.xhr=d,c(e)):b(d.responseText))};d.send(null)};else if("rhino"===n.env||!n.env&&"undefined"!==typeof Packages&&"undefined"!==typeof java)l.get=function(a,b){var c,e,d=new java.io.File(a),n=java.lang.System.getProperty("line.separator"),
d=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(d),"utf-8")),m="";try{c=new java.lang.StringBuffer;(e=d.readLine())&&e.length()&&65279===e.charAt(0)&&(e=e.substring(1));for(null!==e&&c.append(e);null!==(e=d.readLine());)c.append(n),c.append(e);m=String(c.toString())}finally{d.close()}b(m)};return l});define("text!orion/banner/slideout.html",[],function(){return'\x3cdiv id\x3d"slideContainer" class\x3d"slideParameters slideContainer"\x3e\n\t\x3cspan id\x3d"pageCommandParameters" class\x3d"layoutLeft parameters"\x3e\x3c/span\x3e\n\t\x3cspan id\x3d"pageCommandDismiss" class\x3d"layoutRight parametersDismiss"\x3e\x3c/span\x3e\n\x3c/div\x3e'});
define("orion/commonHTMLFragments",["require","orion/webui/littlelib","text!orion/banner/slideout.html"],function(k,l,h){return{slideoutHTMLFragment:function(f){var d=document.createElement("div");d.innerHTML=h;var g=l.$("#slideContainer",d);g.id=f+g.id;g=l.$("#pageCommandParameters",d);g.id=f+g.id;g=l.$("#pageCommandDismiss",d);g.id=f+g.id;return d.innerHTML}}});
define("orion/keyBinding",["orion/util"],function(k){function l(f,d,g,e,c,b){this.type=b||"keydown";this.keyCode="string"===typeof f&&"keydown"===this.type?f.toUpperCase().charCodeAt(0):f;this.mod1=void 0!==d&&null!==d?d:!1;this.mod2=void 0!==g&&null!==g?g:!1;this.mod3=void 0!==e&&null!==e?e:!1;this.mod4=void 0!==c&&null!==c?c:!1}function h(f){this.keys=f}l.prototype={getKeys:function(){return[this]},match:function(f,d){if(void 0!==d){if(0!==d)return!1}else if(f instanceof Array){if(1<f.length)return!1;
f=f[0]}return f.type!==this.type?!1:this.keyCode===f.keyCode||this.keyCode===String.fromCharCode(k.isOpera?f.which:void 0!==f.charCode?f.charCode:f.keyCode)?this.mod1!==(k.isMac?f.metaKey:f.ctrlKey)||"keydown"===this.type&&this.mod2!==f.shiftKey||this.mod3!==f.altKey||k.isMac&&this.mod4!==f.ctrlKey?!1:!0:!1},equals:function(f){return!f||this.keyCode!==f.keyCode||this.mod1!==f.mod1||this.mod2!==f.mod2||this.mod3!==f.mod3||this.mod4!==f.mod4||this.type!==f.type?!1:!0}};h.prototype={getKeys:function(){return this.keys.slice(0)},
match:function(f,d){var g=this.keys;if(void 0!==d)return d>g.length?!1:g[d].match(f)?d===g.length-1?!0:d+1:!1;f instanceof Array||(f=[f]);if(f.length>g.length)return!1;var e;for(e=0;e<f.length;e++)if(!g[e].match(f[e]))return!1;return e===g.length?!0:e},equals:function(f){if(!f.keys||f.keys.length!==this.keys.length)return!1;for(var d=0;d<f.keys.length;d++)if(!f.keys[d].equals(this.keys[d]))return!1;return!0}};return{KeyBinding:l,KeyStroke:l,KeySequence:h}});
define("orion/webui/dropdown",["require","orion/webui/littlelib","orion/EventTarget"],function(k,l,h){function f(e){h.attach(this);this._init(e)}function d(e,c){var b=document.createElement(void 0===c?"span":c);b.tabIndex=0;b.className="dropdownMenuItem";b.role="menuitem";var d=document.createElement("span");d.appendChild(document.createTextNode(e));d.classList.add("dropdownCommandName");b.appendChild(d);d=document.createElement("li");d.appendChild(b);return d}function g(){var e=document.createElement("li");
e.classList.add("dropdownSeparator");return e}f.prototype={_init:function(e){this._dropdownNode=l.node(e.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._populate=e.populate;this._selectionClass=e.selectionClass;this._parentDropdown=e.parentDropdown;this._positioningNode=e.positioningNode;if(!this._parentDropdown)for(var c=this._dropdownNode.parentNode;c&&document!==c;){if(c.classList&&c.classList.contains("dropdownMenu")){this._parentDropdown=c.dropdown;break}c=c.parentNode}this._dropdownNode.tabIndex=
0;this._triggerNode=e.triggerNode?e.triggerNode:l.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";if(!e.skipTriggerEventListeners){var b=this;this._triggerNode.addEventListener("click",function(c){b.toggle(c)&&l.stop(c)},!1);"span"===this._triggerNode.tagName.toLowerCase()&&this._triggerNode.addEventListener("keydown",function(c){if(c.keyCode===l.KEY.ENTER||c.keyCode===l.KEY.SPACE)b.toggle(),l.stop(c)},!1)}this._dropdownNode.addEventListener("keydown",
this._dropdownKeyDown.bind(this),!1)},addTriggerNode:function(e){var c=this;e.addEventListener("click",function(b){c.toggle(b)&&l.stop(b)},!1)},toggle:function(e){return this.isVisible()?this.close():this.open(e)},isVisible:function(){return this._isVisible},open:function(e){var c=!1;this.isVisible()||(this.dispatchEvent({type:"triggered",dropdown:this,event:e}),l.setFramesEnabled(!1),this._populate&&(this.empty(),this._populate(this._dropdownNode)),0<this.getItems().length&&(this._hookedAutoDismiss||
(this._boundAutoDismiss?l.removeAutoDismiss(this._boundAutoDismiss):this._boundAutoDismiss=this._autoDismiss.bind(this),c=l.$$array(".dropdownSubMenu",this._dropdownNode),l.addAutoDismiss([this._triggerNode].concat(c),this._boundAutoDismiss),this._hookedAutoDismiss=!0),this._triggerNode.classList.add("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.add(this._selectionClass),this._dropdownNode.classList.add("dropdownMenuOpen"),this._isVisible=!0,this._positionDropdown(e),this._dropdownNode.focus(),
c=!0,this._parentDropdown&&this._parentDropdown.submenuOpen(this)));return c},_autoDismiss:function(e){if(this.close(!1)&&this._dropdownNode.contains(e.target))for(e=this._parentDropdown;e;)e.close(!1),e=e._parentDropdown},_positionDropdown:function(e){this._dropdownNode.style.left="";this._dropdownNode.style.top="";if(this._positioningNode)this._dropdownNode.style.left=this._positioningNode.offsetLeft+"px";else{e=l.bounds(this._dropdownNode);var c=l.bounds(document.body);if(e.left+e.width>c.left+
c.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-e.width+"px";else{var b=l.bounds(this._boundingNode(this._triggerNode)),d=l.bounds(this._triggerNode);this._dropdownNode.style.left=d.left-b.left-e.width+d.width+"px"}e=e.top+e.height-(c.top+c.height);0<e&&(this._dropdownNode.style.top=Math.floor(this._dropdownNode.style.top-e)+"px")}},_boundingNode:function(e){var c=window.getComputedStyle(e,null);return null===c||"absolute"===c.getPropertyValue("position")||
!e.parentNode||e===document.body?e:this._boundingNode(e.parentNode)},close:function(e){var c=!1;this.isVisible()&&(this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),l.setFramesEnabled(!0),e&&this._triggerNode.focus(),this._isVisible=!1,this._selectedItem&&(this._selectedItem.classList.remove("dropdownMenuItemSelected"),this._selectedItem=null),c=!0);return c},
getItems:function(){var e=[],c=this;l.$$array("li:not(.dropdownSeparator) \x3e .dropdownMenuItem",this._dropdownNode,!0).forEach(function(b){b.parentNode.parentNode===c._dropdownNode&&e.push(b)});e.forEach(function(b){b._hasDropdownMouseover||(b.addEventListener("mouseover",function(e){b.dropdown?b.dropdown.open(e):(c._closeSelectedSubmenu(),l.stop(e));c._selectItem(b)}),b._hasDropdownMouseover=!0)});return e},empty:function(){var e=this;l.$$array("li",this._dropdownNode).forEach(function(c){c.parentNode===
e._dropdownNode&&c.parentNode.removeChild(c)});this._hookedAutoDismiss=!1},_dropdownKeyDown:function(e){if(e.keyCode===l.KEY.UP||e.keyCode===l.KEY.DOWN||e.keyCode===l.KEY.RIGHT||e.keyCode===l.KEY.ENTER||e.keyCode===l.KEY.LEFT){var c=this.getItems();if(c.length&&0<c.length){if(this._selectedItem){var b=c.indexOf(this._selectedItem);0>b&&(b=c.indexOf(this._selectedItem.parentNode));0<=b&&(e.keyCode===l.KEY.UP&&0<b?(b--,this._selectItem(c[b])):e.keyCode===l.KEY.DOWN&&b<c.length-1?(b++,this._selectItem(c[b])):
e.keyCode===l.KEY.ENTER||e.keyCode===l.KEY.RIGHT?this._selectedItem.classList.contains("dropdownTrigger")&&this._selectedItem.dropdown?(this._selectedItem.dropdown.open(),this._selectedItem.dropdown._selectItem()):e.keyCode===l.KEY.ENTER&&this._selectedItem.click():e.keyCode===l.KEY.LEFT&&this._selectedItem.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&(this.close(!0),this._parentDropdown&&this._parentDropdown._dropdownNode.focus()))}else this._selectItem(c[0]);l.stop(e)}}else e.keyCode===
l.KEY.ESCAPE&&(this.close(!0),l.stop(e))},_selectItem:function(e){if(e=e||this.getItems()[0])this._selectedItem&&this._selectedItem.classList.remove("dropdownMenuItemSelected"),this._selectedItem=e,this._selectedItem.classList.add("dropdownMenuItemSelected");document.activeElement!==this._dropdownNode&&this._dropdownNode.focus()},submenuOpen:function(e){e!==this._selectedSubmenu&&(this._closeSelectedSubmenu(),this._selectedSubmenu=e)},_closeSelectedSubmenu:function(){for(var e=this._selectedSubmenu;e;)e.close(),
e=e._selectedSubmenu},destroy:function(){this.empty();this._boundAutoDismiss&&l.removeAutoDismiss(this._boundAutoDismiss)},appendMenuItem:function(e,c){var b=d(e,c);this._dropdownNode.appendChild(b);return b},appendSeparator:function(){var e=g();this._dropdownNode.appendChild(e);return e}};f.prototype.constructor=f;return{Dropdown:f,appendKeyBindingString:function(e,c){var b=document.createElement("span");b.classList.add("dropdownKeyBinding");b.appendChild(document.createTextNode(c));e.appendChild(b)},
createMenuItem:d,createSeparator:g}});define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'\x3cbutton class\x3d"dropdownTrigger"\x3e${ButtonText}\x3c!--span class\x3d"dropdownArrowDown core-sprite-openarrow"\x3e\x3c/span--\x3e\x3c/button\x3e\x3cul class\x3d"dropdownMenu"\x3e\x3c/ul\x3e'});define("text!orion/webui/dropdowntriggerbuttonwitharrow.html",[],function(){return'\x3cbutton class\x3d"dropdownTrigger dropdownDefaultButton"\x3e${ButtonText}\x3cspan class\x3d"dropdownArrowDown core-sprite-openarrow"\x3e\x3c/span\x3e\x3c/button\x3e\x3cul class\x3d"dropdownMenu"\x3e\x3c/ul\x3e'});
define("text!orion/webui/submenutriggerbutton.html",[],function(){return'\x3cli class\x3d"dropdownSubMenu"\x3e\x3cspan class\x3d"dropdownTrigger dropdownMenuItem" role\x3d"menuitem" tabindex\x3d"0"\x3e\x3cspan class\x3d"dropdownCommandName"\x3e${ButtonText}\x3c/span\x3e\x3cspan class\x3d"dropdownArrowRight core-sprite-closedarrow"\x3e\x3c/span\x3e\x3c/span\x3e\x3cul class\x3d"dropdownMenu"\x3e\x3c/ul\x3e\x3c/li\x3e'});define("text!orion/webui/checkedmenuitem.html",[],function(){return'\x3cli\x3e\x3clabel class\x3d"dropdownMenuItem"\x3e\x3cinput class\x3d"checkedMenuItem" role\x3d"menuitem" type\x3d"checkbox" /\x3e${ItemText}\x3c/label\x3e\x3c/li\x3e'});
define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(k,l){function h(f){this._init(f)}h.prototype={_init:function(f){this._node=l.node(f.node);if(!this._node)throw"no dom node for tooltip found";this._position=f.position||["right","above","below","left"];this._text=f.text;this._hideDelay=void 0===f.hideDelay?200:f.hideDelay;this._tailSize=f.tailSize||10;this._trigger=f.trigger||"mouseover";this._afterShowing=f.afterShowing;this._afterHiding=f.afterHiding;var d=this;if("click"===
this._trigger)this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(e){e.target===d._node&&(d.show(),l.stop(e))},!1);else if("mouseover"===this._trigger){this._showDelay=void 0===f.showDelay?500:f.showDelay;f=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(e){l.contains(d._node,e.target)&&(d.show(),l.stop(e))},!1);this._leaveHandler=function(e){l.contains(d._node,e.target)&&d.hide()};for(var g=0;g<f.length;g++)this._node.addEventListener(f[g],
this._leaveHandler,!1)}},_makeTipNode:function(){if(!this._tip){this._tip=document.createElement("span");this._tip.classList.add("tooltipContainer");this._tipInner=document.createElement("div");this._tipInner.classList.add("tooltip");if(this._text){this._tipTextContent=document.createElement("div");this._tipTextContent.classList.add("textContent");this._tipInner.appendChild(this._tipTextContent);var f=document.createTextNode(this._text);this._tipTextContent.appendChild(f)}this._tip.appendChild(this._tipInner);
document.body.appendChild(this._tip);var d=this;l.addAutoDismiss([this._tip,this._node],function(){d.hide()});"mouseover"===this._trigger&&(this._tipInner.role="tooltip",this._tipInner.id="tooltip"+(new Date).getTime().toString(),this._node.setAttribute("aria-describedby",this._tipInner.id),this._tip.addEventListener("mouseover",function(f){d._timeout&&(window.clearTimeout(d._timeout),d._timeout=null);d._tip.addEventListener("mouseout",function(e){l.contains(d._tip,e.target)&&(d.hide(),l.stop(e))},
!1)},!1))}return this._tip},_positionTip:function(f,d){this._makeTipNode();"left"===f?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var g=this._node,e;for(e=l.bounds(g);g&&!e.width&&!e.height;g=g.parentNode)e=l.bounds(g);var g=l.bounds(this._tipInner),c;switch(f){case "above":c=e.top-g.height-this._tailSize-1;e=e.left-this._tailSize;break;case "below":c=e.top+e.height+this._tailSize+1;e=e.left-this._tailSize;break;case "left":c=e.top-this._tailSize/2;e=e.left-g.width-
this._tailSize-1;break;default:c=e.top-this._tailSize/2,e=e.left+e.width+this._tailSize+1}var b=l.bounds(document.documentElement);if(c+g.height>b.height)if(d)c=b.height-g.height-1;else return!1;if(e+g.width>b.width)if(d)e=b.width-g.width-1;else return!1;if(0>e)if(d)e=4;else return!1;if(0>c)if(d)c=4;else return!1;this._tail&&this._tail.previousPosition!==f&&(this._tip.removeChild(this._tail),this._tail=null);this._tail||(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+
f),"above"===f||"left"===f?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner),"left"===f&&(this._tail.style.left=g.width+"px"),this._tail.previousPosition=f);this._tip.style.top=c+"px";this._tip.style.left=e+"px";return!0},contentContainer:function(){this._makeTipNode();return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing"))this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null),this._showDelay?this._timeout=
window.setTimeout(this._showImmediately.bind(this),this._showDelay):this._showImmediately()},_showImmediately:function(){for(var f=!1,d=0;!f&&d<this._position.length;)f=this._positionTip(this._position[d]),d++;f||this._positionTip(this._position[0],!0);this._tip.classList.add("tooltipShowing");this._afterShowing&&this._afterShowing()},hide:function(f){this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null);if(this._tip&&this._tip.classList.contains("tooltipShowing")){void 0===f&&(f=
this._hideDelay);var d=this;this._timeout=window.setTimeout(function(){d._tip.classList.remove("tooltipShowing");d._tip.removeAttribute("style");d._afterHiding&&d._afterHiding()},f)}},destroy:function(){this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null);this._tip&&(document.body.removeChild(this._tip),this._tail=this._tipTextContent=this._tipInner=this._tip=null);if(this._node){this._node.removeEventListener("click",this._clickHandler,!1);this._node.removeEventListener("mouseover",
this._mouseoverHandler,!1);for(var f=["mouseout","click"],d=0;d<f.length;d++)this._node.removeEventListener(f[d],this._leaveHandler,!1)}}};h.prototype.constructor=h;return{Tooltip:h}});
define("orion/commands","orion/util orion/webui/littlelib orion/webui/dropdown text!orion/webui/dropdowntriggerbutton.html text!orion/webui/dropdowntriggerbuttonwitharrow.html text!orion/webui/submenutriggerbutton.html text!orion/webui/checkedmenuitem.html orion/webui/tooltip".split(" "),function(k,l,h,f,d,g,e,c){function b(a){var b=a.invocation;if(b){var c=a.command;if(c.hrefCallback)return a=c.hrefCallback.call(b.handler||window,b),a.then?a.then(function(a){window.open(a)}):window.open(a),!0;if(b.commandRegistry)return b.commandRegistry._invoke(b),
!0;if(c.onClick||c.callback)return window.setTimeout(function(){(c.onClick||c.callback).call(b.handler||window,b)},0),!0}return!1}function m(a,c){for(var e in c)if(c[e]&&c[e].keyBinding&&c[e].command&&c[e].keyBinding.match(a)){var p=c[e],d=p.keyBinding;if((!d.domScope||l.contains(l.node(d.domScope),a.target))&&b(p)){l.stop(a);break}}}function a(){var a={};if(v){var b,c,p;c=Object.keys(u);for(b=0;b<c.length;b++)p=c[b],a[p]=u[p];var e=v();c=Object.keys(e);for(b=0;b<c.length;b++)p=c[b],a[p]=e[p]}else a=
u;return a}function n(b){m(b,a())}function q(a,b){a=a||window.event;if(function(a){if(k.isMac){if(a.metaKey&&!a.altKey)return!a.shiftKey&&!a.ctrlKey&&(65===a.keyCode||67===a.keyCode||86===a.keyCode||88===a.keyCode||90===a.keyCode)?!0:!1;if(a.ctrlKey)return!1}else{if(a.ctrlKey&&!a.altKey)return!a.shiftKey&&(65===a.keyCode||67===a.keyCode||86===a.keyCode||88===a.keyCode||90===a.keyCode)?!0:!1;if(a.altKey&&!a.ctrlKey)return!1}if(a["char"])return 0<a["char"].length;if(a.charCode||a.keyCode)switch(a=a.charCode||
a.keyCode,a){case 8:case 9:case 13:case 46:return!0;default:return 32<=a&&112>a||123<a}return!1}(a)){if("true"===a.target.contentEditable)return;var c=a.target.nodeName.toLowerCase();if("input"===c)switch(a.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("textarea"===c)return}b?b(a):n(a)}function r(){this._init()}
function s(a,b,c){b.classList.add("commandImage");var p;a.imageClass?a.addImageClassToElement?b.classList.add(a.imageClass):(p=document.createElement("span"),b.appendChild(p),p.classList.add(a.spriteClass),p.classList.add(a.imageClass)):(p=new Image,p.alt=a.name,p.name=c,p.id=c,p.src=a.image,b.appendChild(p));return p}function t(a,b,c,p,e){this.commandRegistry=e;this.handler=a;this.items=b;this.userData=c;this.command=p;p.parameters&&(this.parameters=p.parameters.makeCopy());this.id=p.id}function w(a){this._init(a)}
var v=null,u={};r.prototype={setProxy:function(a){this.proxy=a},setKeyBindings:function(a){this.bindings=a},_init:function(){var a=this;document.addEventListener("keydown",function(b){return q(b,function(b){var p=a.proxy,c=a.bindings;if(c&&p)for(var e=0;e<c.length;e++)c[e].match(b)&&(p.processKey({type:b.type,keyCode:b.keyCode,altKey:b.altKey,ctrlKey:b.ctrlKey,metaKey:b.metaKey,shiftKey:b.shiftKey}),l.stop(b))})})}};window.document.addEventListener("keydown",q,!1);t.prototype={collectsParameters:function(){return this.commandRegistry&&
this.commandRegistry.collectsParameters()},makeCopy:function(a){var b=new t(this.handler,this.items,this.userData,this.command,this.commandRegistry);b.domNode=this.domNode;b.domParent=this.domParent;a?b.parameters=a.makeCopy():this.parameters&&(b.parameters=this.parameters.makeCopy());return b}};t.prototype.constructor=t;w.prototype={_init:function(a){this.id=a.id;this.name=a.name;this.tooltip=a.tooltip;this.callback=a.callback;this.hrefCallback=a.hrefCallback;this.choiceCallback=a.choiceCallback;
this.positioningNode=a.positioningNode;this.image=a.image||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC";this.imageClass=a.imageClass;this.addImageClassToElement=a.addImageClassToElement;this.selectionClass=a.selectionClass;this.spriteClass=a.spriteClass||"commandSprite";this.visibleWhen=a.visibleWhen;this.parameters=a.parameters;this.isEditor=a.isEditor},populateChoicesMenu:function(a,b,c,p,
e){c=this.getChoices(b,c,p);var d=c.some(function(a){return a.checked});c.forEach(function(p){if(p.name){var c=document.createElement("li");a.appendChild(c);var n=document.createElement("span");n.tabIndex=0;n.role="menuitem";n.classList.add("dropdownMenuItem");if(d){var m=document.createElement("span");m.classList.add("check");m.appendChild(document.createTextNode(p.checked?"\u25cf":""));n.appendChild(m)}m=document.createTextNode(p.name);n.appendChild(m);c.appendChild(n);n.choice=p;n.addEventListener("click",
function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,b)},!1);n.addEventListener("keydown",function(a){(a.keyCode===l.KEY.ENTER||a.keyCode===l.KEY.SPACE)&&a.target.choice&&a.target.choice.callback.call(a.target.choice,b)},!1)}else e._generateMenuSeparator(a)})},getChoices:function(a,b,c){return this.choiceCallback?this.choiceCallback.call(b,a,c):null},makeChoiceCallback:function(a,b){return function(c){a.callback&&a.callback.call(a,b,c)}},hasImage:function(){return this.imageClass||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC"!==this.image}};w.prototype.constructor=w;return{Command:w,CommandInvocation:t,createDropdownMenu:function(a,b,c,p,e,y,n,m,q){a=l.node(a);if(!a)throw"no parent node was specified";var g=document.createRange();g.selectNode(a);g=q?g.createContextualFragment(d):g.createContextualFragment(f);l.processTextNodes(g,{ButtonText:b});a.appendChild(g);a=a.lastChild;
var r;q?(q=a.previousSibling,r=q.lastChild):q=a.previousSibling;p?q.classList.add(p):(q.classList.add("orionButton"),q.classList.add("commandButton"));e&&(y||(q.textContent="",q.setAttribute("aria-label",b)),s({spriteClass:"commandSprite",imageClass:e},q,b),q.classList.add("orionButton"));q.dropdown=new h.Dropdown({dropdown:a,populate:c,selectionClass:n,skipTriggerEventListeners:!!r,positioningNode:m});a.dropdown=q.dropdown;return{menuButton:q,menu:a,dropdown:q.dropdown,dropdownArrow:r}},createCheckedMenuItem:function(a,
b,c,p){a=l.node(a);if(!a)throw"no parent node was specified";var d=document.createRange();d.selectNode(a);d=d.createContextualFragment(e);l.processTextNodes(d,{ItemText:b});a.appendChild(d);a=l.$(".checkedMenuItem",a.lastChild);a.checked=c;a.addEventListener("change",p,!1);return a},createCommandItem:function(a,b,e,p,d,y,n){var m;y=y||!b.name&&b.hasImage();if(b.hrefCallback)m=document.createElement("a"),m.id=p,y&&b.hasImage()?s(b,m,p):(m.className="commandLink",m.appendChild(document.createTextNode(b.name))),
n=b.hrefCallback.call(e.handler,e),n.then?n.then(function(a){m.href=a}):m.href=n?n:"#";else{m=document.createElement("button");m.className="orionButton";y?b.hasImage()?(s(b,m,p),b.name&&m.setAttribute("aria-label",b.name)):(m.classList.add("commandButton"),m.classList.add("commandMissingImageButton"),m.appendChild(document.createTextNode(b.name))):(m.classList.add("commandButton"),p=document.createTextNode(b.name),m.appendChild(p));var f=n||b.callback;f&&(b.onClick=f,m.addEventListener("click",function(a){f.call(e.handler,
e)},!1))}"ul"===a.nodeName.toLowerCase()?(n=document.createElement("li"),a.appendChild(n),a=n):m.classList.add("commandMargins");a.appendChild(m);b.tooltip&&(m.commandTooltip=new c.Tooltip({node:m,text:b.tooltip,position:["above","below","right","left"]}));d&&(u[b.id]={keyBinding:d,command:b,invocation:e});return m},createCommandMenuItem:function(a,b,e,p,d,y){var n,m,f=a.dropdown;if(b.hrefCallback)m=h.createMenuItem(b.name,"a"),n=m.firstElementChild,d=b.hrefCallback.call(e.handler,e),d.then?d.then(function(a){n.href=
a}):n.href=d?d:"#",n.addEventListener("keydown",function(a){(a.keyCode===l.KEY.ENTER||a.keyCode===l.KEY.SPACE)&&n.click()},!1);else{m=h.createMenuItem(b.name);n=m.firstElementChild;var q=d||b.callback;q&&(b.onClick=q,n.addEventListener("click",function(a){f.close(!0);q.call(e.handler,e)},!1),n.addEventListener("keydown",function(a){if(a.keyCode===l.KEY.ENTER||a.keyCode===l.KEY.SPACE)a.preventDefault(),n.click()},!1))}b.tooltip&&(n.commandTooltip=new c.Tooltip({node:n,text:b.tooltip,position:["above",
"below","right","left"]}));y&&h.appendKeyBindingString(n,y);a.appendChild(m);p&&(u[b.id]={keyBinding:p,command:b,invocation:e});return n},executeBinding:b,setKeyBindingProvider:function(a){v=a},localKeyBindings:u,CommandsProxy:r,getKeyBindings:a,processKey:n,NO_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC",_testMethodProcessKey:m}});
define("orion/explorers/navigationUtils",[],function(){function k(h,f,d,g){!l&&h&&(h.push({domNode:f}),f.tabIndex=-1,f.style.outline="none")}var l=-1!==navigator.userAgent.indexOf("iPad");return{addNavGrid:function(h,f,d){h&&(h=h.getGridNavHolder(f,!0))&&k(h,d)},generateNavGrid:k,removeNavGrid:function(h,f){if(h)for(var d=0;d<h.length;d++)if(h[d].domNode===f){h.splice(d,1);break}}}});
define("orion/PageUtil",[],function(){var k=/^http[s]?/i;return{hash:function(){var k=window.location.href.split("#")[1];return k?"#"+k:""},matchResourceParameters:function(k){k=k||window.location.toString();var h={resource:""},f=k.indexOf("#");if(-1!==f&&(k=k.substring(f+1),0!==k.length)){k=k.split(",");h.resource=decodeURIComponent(k[0]);for(f=1;f<k.length;f++){var d=/([^=]*)(=?)(.*)/.exec(k[f]),g=decodeURIComponent(d[1]||""),d=decodeURIComponent(d[3]||"");""!==g&&"resource"!==g&&(h[g]=d)}}return h},
validateURLScheme:function(l,h){var f=l;if(-1===l.indexOf("://")){var d=document.createElement("a");d.href=l;f=d.href}d=!1;if(d=h?h.some(function(d){return RegExp("^"+d+":","i").test(f)}):k.test(f))return l;console.log("Illegal URL Scheme: '"+l+"'");return""}}});
define("orion/uiUtils",["orion/webui/littlelib"],function(k){function l(f){var d="",g=-1!==navigator.platform.indexOf("Mac");g?(f.mod4&&(d+="\u2303"),f.mod3&&(d+="\u2325"),f.mod2&&(d+="\u21e7"),f.mod1&&(d+="\u2318")):(f.mod1&&(d+="Ctrl+"),f.mod2&&(d+="Shift+"),f.mod3&&(d+="Alt+"));if(f.alphaKey)return d+f.alphaKey;if("keypress"===f.type)return d+f.keyCode;for(var e in k.KEY)if(typeof("number"===k.KEY[e])&&k.KEY[e]===f.keyCode){if(g)switch(k.KEY[e]){case k.KEY.BKSPC:e="\u232b";break;case k.KEY.TAB:e=
"\u21e5";break;case k.KEY.ENTER:e="\u23ce";break;case k.KEY.ESCAPE:e="\u238b";break;case k.KEY.SPACE:e="\u2423";break;case k.KEY.PAGEUP:e="\u21de";break;case k.KEY.PAGEDOWN:e="\u21df";break;case k.KEY.END:e="\u21f2";break;case k.KEY.HOME:e="\u21f1";break;case k.KEY.DEL:e="\u2326"}switch(k.KEY[e]){case k.KEY.DOWN:e="\u2193";break;case k.KEY.UP:e="\u2191";break;case k.KEY.RIGHT:e="\u2192";break;case k.KEY.LEFT:e="\u2190"}return d+e}var c;switch(f.keyCode){case 59:c=f.mod2?":":";";break;case 61:c=f.mod2?
"+":"\x3d";break;case 188:c=f.mod2?"\x3c":",";break;case 190:c=f.mod2?"\x3e":".";break;case 191:c=f.mod2?"?":"/";break;case 192:c=f.mod2?"~":"`";break;case 219:c=f.mod2?"{":"[";break;case 220:c=f.mod2?"|":"\\";break;case 221:c=f.mod2?"}":"]";break;case 222:c=f.mod2?'"':"'"}return c?d+c:112<=f.keyCode&&123>=f.keyCode?d+"F"+(f.keyCode-111):d+String.fromCharCode(f.keyCode)}function h(f){var d=-1!==window.navigator.platform.indexOf("Mac");return d&&f.metaKey||!d&&f.ctrlKey}return{getUserKeyString:function(f){var d=
"";f=f.getKeys();for(var g=0;g<f.length;g++)0!==g&&(d+=" "),d+=l(f[g]);return d},getUserText:function(f){var d=f.id,g=f.refNode,e=f.hideRefNode,c=f.initialText,b=f.onComplete,m=f.onEditDestroy,a=f.selectTo,n=f.isInitialValid;f=f.insertAsChild;var q=!1,r=function(a){return function(f){if(!q){var r=k.node(d),h=r.value;r&&(a&&f.keyCode===k.KEY.ESCAPE?(e&&(g.style.display="inline"),q=!0,r.parentNode.removeChild(r),m&&m()):a&&f.keyCode!==k.KEY.ENTER||(0===h.length||!n&&h===c?e&&(g.style.display="inline"):
(b(h),e&&g.parentNode&&(g.style.display="inline")),q=!0,r.parentNode&&r.parentNode.removeChild(r),m&&m()))}}},h=document.createElement("input");h.id=d;h.value=c||"";f?g.appendChild(h):g.parentNode.insertBefore(h,g.nextSibling);h.classList.add("userEditBoxPrompt");e&&(g.style.display="none");h.addEventListener("keydown",r(!0),!1);h.addEventListener("blur",r(!1),!1);window.setTimeout(function(){h.focus();if(c){var b=k.node(d),e=a?c.indexOf(a):-1;0<e?b.createTextRange?(b=b.createTextRange(),b.collapse(!0),
b.moveStart("character",0),b.moveEnd("character",e),b.select()):b.setSelectionRange?b.setSelectionRange(0,e):void 0!==b.selectionStart&&(b.selectionStart=0,b.selectionEnd=e):b.select()}},0)},openInNewWindow:h,followLink:function(f,d){d&&h(d)?window.open(f):window.location=f},createButton:function(f,d){var g=document.createElement("button");g.className="orionButton commandButton commandMargins";g.addEventListener("click",function(e){d();k.stop(e)},!1);f&&g.appendChild(document.createTextNode(f));return g},
createDropdownButton:function(f,d,g){},isFormElement:function(f){switch(f.tagName.toLowerCase()){case "button":case "fieldset":case "form":case "input":case "keygen":case "label":case "legend":case "meter":case "optgroup":case "output":case "progress":case "select":case "textarea":return!0}return!1}}});
define("orion/commandRegistry","orion/commands orion/explorers/navigationUtils orion/PageUtil orion/uiUtils orion/webui/littlelib orion/webui/dropdown orion/webui/tooltip text!orion/webui/checkedmenuitem.html text!orion/webui/dropdowntriggerbutton.html text!orion/webui/submenutriggerbutton.html".split(" "),function(k,l,h,f,d,g,e,c,b,m){function a(a){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(a);this._parameterCollector=
null}function n(a,b){this.token=a;this.parameterName=b}function q(a,b,c){this.event=a;this.handler=b;this.capture=c||!1}function r(a,b,c,e,d,n){this.name=a;this.type=b;this.label=c;this.value=e;this.lines=d||1;this.eventListeners=Array.isArray(n)?n:n?[n]:[]}function s(a,b,c){this._storeParameters(a);this._hasOptionalParameters=b&&b.hasOptionalParameters;this._options=b;this.optionsRequested=!1;this.getParameters=c;this.clientCollect=b&&b.clientCollect}a.prototype={_init:function(a){this._selectionService=
a.selection;var b=this;k.setKeyBindingProvider(function(){return b._activeBindings})},processURL:function(a){for(var b in this._urlBindings)if(this._urlBindings[b]&&this._urlBindings[b].urlBinding&&this._urlBindings[b].command){var c=this._urlBindings[b].urlBinding.match(a);if(c){var e=this._urlBindings[b],d=e.command,n=e.invocation;if(n&&n.parameters&&d.callback){n.parameters.setValue(c.parameterName,c.parameterValue);var m=this;window.setTimeout(function(){m._invoke(n)},0);break}}}},findCommand:function(a){return this._commandList[a]},
runCommand:function(a,b,c,e){b?(a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(b):1)&&a.callback&&this._invoke(new k.CommandInvocation(c,b,null,a,this),e):(b=this._urlBindings[a])&&b.command&&b.command.callback&&this._invoke(b.invocation,e)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(a){this._parameterCollector=a},openParameterCollector:function(a,b,c){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(a,
b,c))},confirm:function(a,b,c,e,d,n){var m=!1;if(this._parameterCollector&&!d){var p=this;this._parameterCollector.close();if(this._parameterCollector.open(a,function(a,d){var n=document.createElement("span");n.classList.add("parameterPrompt");n.textContent=b;a.appendChild(n);n=document.createElement("button");n.addEventListener("click",function(a){m=!0;p._parameterCollector.close()},!1);d.appendChild(n);n.appendChild(document.createTextNode(c));n.className="dismissButton";var f=document.createElement("button");
f.addEventListener("click",function(a){m=!1;p._parameterCollector.close()},!1);d.appendChild(f);f.appendChild(document.createTextNode(e));f.className="dismissButton";return n},function(){n(m)}))return}m=window.confirm(b);n(m)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(a,b){return this._collectAndInvoke(a.makeCopy(b),!1)},_collectAndInvoke:function(a,b){if(a)if(this._parameterCollector&&
a.parameters&&a.parameters.hasParameters()&&(b||a.parameters.shouldCollectParameters())){var c=!1;a.parameters.updateParameters(a);if(a.parameters.shouldCollectParameters()&&(c=this._parameterCollector.collectParameters(a),!c)){var d=new e.Tooltip({node:a.domNode,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]}),c=d.contentContainer();c.classList.add("parameterPopup");var n=window.document.activeElement,m=this._parameterCollector.getFillFunction(a,
function(){n&&n.focus();d.destroy()})(c);d.show();window.setTimeout(function(){m.focus();m.select()},0);c=!0}c||a.command.callback.call(a.handler||window,a)}else a.command.callback.call(a.handler||window,a);else window.console.log("Client attempted to invoke command without an available (rendered) command invocation")},collectParameters:function(a){this._collectAndInvoke(a,!0)},showKeyBindings:function(a){function b(a){return function(){k.executeBinding(a)}}var c={},e,d,n=[],m;for(m in this._activeBindings)(d=
this._activeBindings[m])&&d.keyBinding&&d.command&&(d.command.name||d.command.tooltip)&&n.push(d);n.sort(function(a,b){return(a.command.name||a.command.tooltip).localeCompare(b.command.name||b.command.tooltip)});for(m=0;m<n.length;m++)d=n[m],d.keyBinding.scopeName?(c[d.keyBinding.scopeName]||(c[d.keyBinding.scopeName]=[]),c[d.keyBinding.scopeName].push(d)):(e=f.getUserKeyString(d.keyBinding),a.createItem(e,d.command.name||d.command.tooltip,b(d)));for(var p in c)c[p].length&&0<c[p].length&&(a.createHeader(p),
c[p].forEach(function(p){e=f.getUserKeyString(p.keyBinding);a.createItem(e,p.command.name||p.command.tooltip,b(p))}))},addCommand:function(a){this._commandList[a.id]=a;var b=this._pendingBindings[a.id];if(b){var c=this;b.forEach(function(b){c._addBinding(a,b.type,b.binding,b.bindingOnly)});delete this._pendingBindings[a.id]}},addCommandGroup:function(a,b,c,e,d,n,m,p,B,y){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];d&&(a=this._createEntryForPath(a,
d));a[b]?(e&&(a[b].title=e),c&&(a[b].position=c),m&&(a[b].imageClass=m),p&&(a[b].tooltip=p),B&&(a[b].selectionClass=B),!0===y?a[b].pretendDefaultActionId=!0:a[b].defaultActionId=y,a[b].emptyGroupMessage=n):(a[b]={title:e,position:c,emptyGroupMessage:n,imageClass:m,tooltip:p,selectionClass:B,defaultActionId:!0===y?null:y,pretendDefaultActionId:!0===y,children:{}},a.sortedContributions=null)},_createEntryForPath:function(a,b){b&&b.split("/").forEach(function(b){1<b.length&&(a[b]||(a[b]={position:0,
children:{}},a.sortedContributions=null),a=a[b].children)});return a},registerSelectionService:function(a,b){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});this._contributionsByScopeId[a].localSelectionService=b},registerCommandContribution:function(a,b,c,e,d,n,m){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];e&&(a=this._createEntryForPath(a,e));a[b]={position:c};n&&((c=this._commandList[b])?this._addBinding(c,"key",
n,d):this._addPendingBinding(b,"key",n,d));m&&((c=this._commandList[b])?this._addBinding(c,"url",m,d):this._addPendingBinding(b,"url",m,d));a.sortedContributions=null},unregisterCommandContribution:function(a,b,c){if(this._contributionsByScopeId[a]){delete this._commandList[b];delete this._activeBindings[b];delete this._urlBindings[b];delete this._pendingBindings[b];var e=this._contributionsByScopeId[a];c&&c.split("/").forEach(function(a){1<a.length&&e[a]&&(e=e[a].children)});delete e[b];e.sortedContributions=
null}},_addBinding:function(a,b,c,e){if(!a.id)throw Error("No command id: "+a);"key"===b?this._activeBindings[a.id]={command:a,keyBinding:c,bindingOnly:e}:"url"===b&&(this._urlBindings[a.id]={command:a,urlBinding:c,bindingOnly:e})},_addPendingBinding:function(a,b,c,e){this._pendingBindings[a]=this._pendingBindings[a]||[];this._pendingBindings[a].push({type:b,binding:c,bindingOnly:e})},_checkForTrailingSeparator:function(a,b,c){var e;if("tool"===b||"button"===b)if((e=0<a.childNodes.length?a.childNodes[a.childNodes.length-
1]:null)&&e.classList.contains("commandSeparator"))return c?(a.removeChild(e),!1):!0;if("menu"===b&&(a=d.$$array("li \x3e *",a),0<a.length&&a[a.length-1].classList.contains("dropdownSeparator")))if(e=a[a.length-1],c)e.parentNode.parentNode.removeChild(e.parentNode);else return!0;return!1},renderCommands:function(a,b,c,e,n,m,f){if("string"!==typeof a)throw"a scope id for rendering must be specified";b=d.node(b);if(!b)throw"no parent";var p=this._contributionsByScopeId[a];if(!c&&p){c=p.localSelectionService||
this._selectionService;var B=this;c&&c.getSelections(function(c){B.renderCommands(a,b,c,e,n,m)})}else p&&(this._render(p,b,c,e,n||"button",m,f),this._checkForTrailingSeparator(b,n,!0))},destroy:function(a){a=d.node(a);if(!a)throw"no parent";for(;a.hasChildNodes();){var b=a.firstChild;b.commandTooltip&&b.commandTooltip.destroy();b.emptyGroupTooltip&&b.emptyGroupTooltip.destroy();this.destroy(b);a.removeChild(b)}},_render:function(a,b,c,d,n,m,q){var p=a.sortedContributions;if(!p){var p=[],B=!1,y;for(y in a)if(Object.prototype.hasOwnProperty.call(a,
y)){var g=a[y];g&&"number"===typeof g.position&&(g.id=y,p.push(g),B=!0)}B&&(p.sort(function(a,b){return a.position-b.position}),a.sortedContributions=p)}var r=0,h=this;p.forEach(function(a){var p;a.imageClass||(a.imageClass=null);if(a.children&&0<Object.getOwnPropertyNames(a.children).length){var y=a.children;if("tool"===n||"button"===n)if(a.title){var B;a.defaultActionId&&((y=h._commandList[a.defaultActionId])&&(y.visibleWhen?y.visibleWhen(c):1)?(B=new k.CommandInvocation(d,c,m,y,h),B.domParent=
b):a.pretendDefaultActionId=!0);y=h._createDropdownMenu(b,a.title,null,null,a.imageClass,a.tooltip,a.selectionClass,null,B,a.pretendDefaultActionId);q&&l.generateNavGrid(q,y.menuButton);y&&(h._render(a.children,y.menu,c,d,"menu",m,q),h._checkForTrailingSeparator(y.menu,"menu",!0),0===y.menu.childNodes.length?a.emptyGroupMessage?y.menuButton.emptyGroupTooltip||(y.menuButton.emptyGroupTooltip=new e.Tooltip({node:y.menuButton,text:a.emptyGroupMessage,trigger:"click",position:["below","right","above",
"left"]})):(q&&l.removeNavGrid(q,y.menuButton),a=function(a){a&&a.parentNode&&a.parentNode.removeChild(a)},a(y.menu),a(y.menuButton),a(y.destroyButton)):y.menuButton.style.visibility="visible")}else{var g;0<b.childNodes.length&&!h._checkForTrailingSeparator(b,n)&&(g=h.generateSeparatorImage(b));h._render(y,b,c,d,n,m,q);0<b.childNodes.length&&b.childNodes[b.childNodes.length-1]!==g&&(g=h.generateSeparatorImage(b))}else if(a.title){if(a=h._createDropdownMenu(b,a.title,!0,null,null,a.imageClass))h._render(y,
a.menu,c,d,"menu",m,q),h._checkForTrailingSeparator(a.menu,"menu",!0),0===a.menu.childNodes.length&&a.destroyButton&&b.removeChild(a.destroyButton)}else 0<b.childNodes.length&&h._generateMenuSeparator(b),h._render(y,b,c,d,n,m,q),h._generateMenuSeparator(b)}else{var C=h._commandList[a.id],y=C?!0:!1;B=a=null;if(C){p=new k.CommandInvocation(d,c,m,C,h);p.domParent=b;g=!1;try{g=y&&(C.visibleWhen?C.visibleWhen(c):!0)}catch(s){throw console.log(s),s;}h._activeBindings[C.id]&&h._activeBindings[C.id].keyBinding&&
(a=h._activeBindings[C.id],a.invocation=g?p:null,a.bindingOnly&&(y=!1));h._urlBindings[C.id]&&h._urlBindings[C.id].urlBinding&&(B=h._urlBindings[C.id],B.invocation=g?p:null,B.bindingOnly&&(y=!1));y=y&&g}y&&(C.choiceCallback?("tool"===n||"button"===n?(a=b,y=!1,"ul"===b.nodeName.toLowerCase()&&(a=document.createElement("li"),b.appendChild(a))):(a=b,y=!0),h._createDropdownMenu(a,C.name,y,function(a){C.populateChoicesMenu(a,c,d,m,h)}.bind(C),C.imageClass,C.tooltip||C.title,C.selectionClass,C.positioningNode)):
(p.handler=p.handler||this,p.domParent=b,y=function(a){h._invoke(p)},"menu"===n?(B=null,a&&a.keyBinding&&(B=f.getUserKeyString(a.keyBinding)),a=k.createCommandMenuItem(b,C,p,null,y,B)):(a=n+C.id+r,a=k.createCommandItem(b,C,p,a,null,"tool"===n,y)),l.generateNavGrid(q,a),p.domNode=a,r++))}})},_createDropdownMenu:function(a,b,c,n,f,q,r,p,B,y){a=d.node(a);if(!a||!d.contains(document.body,a))return null;var C,h,s=a;if(c)q=document.createRange(),q.selectNode(a),q=q.createContextualFragment(m),d.processTextNodes(q,
{ButtonText:b}),a.appendChild(q),h=a.lastChild,f=h.lastChild,b=f.previousSibling,b.dropdown=new g.Dropdown({dropdown:f,populate:n,parentDropdown:a.dropdown}),f.dropdown=b.dropdown;else{"ul"===a.nodeName.toLowerCase()&&(s=document.createElement("li"),a.appendChild(s),h=s);a=null;f&&(a="dropdownButtonWithIcon",q=q||b);q=f?q||b:q;var E=k.createDropdownMenu(s,b,n,a,f,!1,r,p,B||y);C=E.dropdownArrow;b=E.menuButton;if(C){B&&(B.domNode=E.menuButton);var l=this;b.onclick=function(a){var b=d.bounds(C);a.clientX>=
b.left&&E.dropdown?E.dropdown.toggle(a):l._invoke(B)};E.dropdown&&(b.onkeydown=function(a){d.KEY.DOWN===a.keyCode&&(E.dropdown.toggle(a),d.stop(a))})}f=E.menu;var D;(n=B&&B.command&&(B.command.tooltip||B.command.name))?D=B.command.tooltip||B.command.name:n&&(D=q);D&&(b.commandTooltip=new e.Tooltip({node:b,text:D,position:["above","below","right","left"]}))}return{menuButton:b,menu:f,dropdown:b.dropdown,destroyButton:h,dropdownArrow:C}},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,
"menu")){var b=document.createElement("li");b.classList.add("dropdownSeparator");var c=document.createElement("span");c.classList.add("dropdownSeparator");b.appendChild(c);a.appendChild(b)}},generateSeparatorImage:function(a){var b;b="ul"===a.nodeName.toLowerCase()?document.createElement("li"):document.createElement("span");a.appendChild(b);b.classList.add("core-sprite-sep");b.classList.add("imageSprite");b.classList.add("commandSeparator");return b}};a.prototype.constructor=a;n.prototype={match:function(a){a=
h.matchResourceParameters(a);return"undefined"!==typeof a[this.token]?(this.parameterValue=a[this.token],this):null}};n.prototype.constructor=n;q.prototype.constructor=q;r.prototype={optionsRequested:function(){return this.optionsRequested}};r.prototype.constructor=r;s.prototype={_storeParameters:function(a){this.parameterTable=null;if(a){var b=this.parameterTable={};a.forEach(function(a){b[a.name]=a})}},updateParameters:function(a){"function"===typeof this.getParameters&&this._storeParameters(this.getParameters(a))},
hasParameters:function(){return null!==this.parameterTable},shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(a){return this.parameterTable[a]},valueFor:function(a){return(a=this.parameterTable[a])?a.value:null},setValue:function(a,b){var c=this.parameterTable[a];c&&(c.value=b)},forEach:function(a){for(var b in this.parameterTable)this.parameterTable[b].type&&this.parameterTable[b].name&&a(this.parameterTable[b])},makeCopy:function(){var a=
[];this.forEach(function(b){b=new r(b.name,b.type,b.label,b.value,b.lines,b.eventListeners);a.push(b)});var b=new s(a,this._options,this.getParameters);b.clientCollect=this.clientCollect;return b},hasOptionalParameters:function(){return this._hasOptionalParameters}};s.prototype.constructor=s;return{CommandRegistry:a,URLBinding:n,ParametersDescription:s,CommandParameter:r,CommandEventListener:q}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(k,l,h){function f(d,f){this._activeContainer=null;this._getElementsFunction=d;this._toolbarLayoutFunction=f}f.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&h.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&h.empty(this._activeElements.dismissArea);
this._activeElements.commandNode&&this._activeElements.commandNode.classList.remove("activeCommand");this._toolbarLayoutFunction(this._activeElements);if(this._activeElements.onClose)this._activeElements.onClose();this._oldFocusNode&&(this._oldFocusNode.focus(),this._oldFocusNode=null)}this._activeElements=null},open:function(d,f,e){"string"===typeof d&&(d=h.node(d));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===d)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(d))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=e;var c=f(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!c)return!1;this._activeElements.focusNode=c;d=h.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(0===d.length){f=this._activeElements.dismissArea||
this._activeElements.parameterArea;d=document.createElement("button");d.id="closebox";d.className="imageSprite core-sprite-close dismissButton";d.title=k.Close;f.appendChild(d);var b=this;d.addEventListener("click",function(c){b.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);c&&(this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){c.focus();c.select&&c.select()},0));this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(d,f){h.$$array("input",f).forEach(function(e){"checkbox"===e.type?d.parameters.setValue(e.parameterName,e.checked):"button"!==e.type&&d.parameters.setValue(e.parameterName,e.value.trim())});h.$$array("textArea",f).forEach(function(e){d.parameters.setValue(e.parameterName,e.value.trim())});d.command.callback&&d.command.callback.call(d.handler,d)},collectParameters:function(d){return d.parameters?
(d.domNode&&d.domNode.classList.add("commandMarker"),this.open(d.domNode||d.domParent,this.getFillFunction(d))):!1},getFillFunction:function(d,f){var e=this;return function(c,b){var m=null,a=function(){f&&f();e.close()},n=function(b){b.keyCode===h.KEY.ENTER&&e._collectAndCall(d,c);if(b.keyCode===h.KEY.ESCAPE||b.keyCode===h.KEY.ENTER)a(),h.stop(b)};d.parameters.forEach(function(b){var e=null;b.label&&(e=document.createElement("label"),e.classList.add("parameterInput"),e.setAttribute("for",b.name+"parameterCollector"),
e.textContent=b.label,c.appendChild(e));var f=b.name+"parameterCollector",q,e=e||c;"text"===b.type&&"number"===typeof b.lines&&1<b.lines?(q=document.createElement("textarea"),q.rows=b.lines,q.type="textarea",q.id=f,e.appendChild(q),n=function(b){b.keyCode===h.KEY.ESCAPE&&(a(),h.stop(b))}):"boolean"===b.type?(q=document.createElement("input"),q.type="checkbox",q.id=f,e.appendChild(q),b.value&&(q.checked=!0)):(q=document.createElement("input"),q.type=b.type,q.id=f,e.appendChild(q),b.value&&(q.value=
b.value));q.classList.add("parameterInput");q.setAttribute("speech","speech");q.setAttribute("x-webkit-speech","x-webkit-speech");q.parameterName=b.name;m||(m=q);0<b.eventListeners.length&&b.eventListeners.forEach(function(a){q.addEventListener(a.event,function(b){return a.handler(b,d)},a.capture)});q.addEventListener("keydown",n,!1)});var q=b;q||(q=document.createElement("span"),q.classList.add("layoutRight"),q.classList.add("parametersDismiss"),c.appendChild(q));var r=function(a,b){var c=document.createElement("button");
b.appendChild(c);a&&c.appendChild(document.createTextNode(a));c.classList.add("dismissButton");return c};d.parameters.hasOptionalParameters()&&(d.parameters.optionsRequested=!1,r(k.More,q).addEventListener("click",function(){d.parameters.optionsRequested=!0;e._collectAndCall(d,c);a()},!1));r(k.Submit,q).addEventListener("click",function(){e._collectAndCall(d,c);a()},!1);q=r(null,q);q.id="closebox";q.classList.add("imageSprite");q.classList.add("core-sprite-close");q.title=k.Close;q.addEventListener("click",
function(b){a()},!1);return m}}};f.prototype.constructor=f;return{CommandParameterCollector:f}});define("orion/regex",[],function(){return{escape:function(k){return k.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$\x26")},parse:function(k){return(k=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(k))?{pattern:k[1],flags:k[2]}:null}}});
define("orion/contentTypes",[],function(){function k(b,a){if("string"!==typeof b)return null;for(var c=b&&b.split(".").pop(),e=null,d=0;d<a.length;d++){var f=a[d],g;g=e;var h=f,k=c,l=0<=h.filename.indexOf(b),z;z=k.toLowerCase();z=-1!==h.extension.indexOf(z);if(l||z){if(!(z=!g))l&&(k=k.toLowerCase(),l=-1!==g.extension.indexOf(k)),z=l;z&&(g=h)}g===f&&(e=f)}return e}function l(b){return null===b||"undefined"===typeof b?[]:Array.isArray(b)?b:[b]}function h(b){return l(b).map(function(a){return String.prototype.toLowerCase.call(a)})}
function f(b){return{id:b.id,name:b.name,image:b.image,imageClass:b.imageClass,"extends":b["extends"],extension:h(b.extension),filename:l(b.filename)}}function d(b){var a=Object.create(null);b.map(f).forEach(function(b){Object.prototype.hasOwnProperty.call(a,b.id)||(a[b.id]=b)});return a}function g(m){if(m&&m.registerService){this.serviceRegistry=m;for(var a=m.getServiceReferences(c).concat(m.getServiceReferences(b)),n=[],f=0;f<a.length;f++)for(var g=l(a[f].getProperty("contentTypes")),h=0;h<g.length;h++)n.push(g[h]);
this.map=d(n);m.registerService(e,this)}else if(Array.isArray(m))this.serviceRegistry=null,this.map=d(m);else throw Error("Invalid parameter");}var e="orion.core.contentTypeRegistry",c="orion.core.contenttype",b="orion.file.contenttype";g.prototype={getContentTypes:function(){var b=this.getContentTypesMap(),a=[],c;for(c in b)Object.prototype.hasOwnProperty.call(b,c)&&a.push(b[c]);return a},getContentTypesMap:function(){return this.map},getFileContentType:function(b){return k(b.Name,this.getContentTypes())},
getFilenameContentType:function(b){return k(b,this.getContentTypes())},getContentType:function(b){return this.map[b]||null},isExtensionOf:function(b,a){b="string"===typeof b?this.getContentType(b):b;a="string"===typeof a?this.getContentType(a):a;if(!b||!a)return!1;if(b.id===a.id)return!0;for(var c=b,e={};c&&(c=this.getContentType(c["extends"]));){if(c.id===a.id)return!0;if(e[c.id])throw Error("Cycle: "+c.id);e[c.id]=!0}return!1},isSomeExtensionOf:function(b,a){for(var c=0;c<a.length;c++)if(this.isExtensionOf(b,
a[c]))return!0;return!1}};return{ContentTypeRegistry:g,getFilenameContentType:k}});
define("orion/URITemplate",[],function(){function k(a){this._text=a}function l(a){return a.replace("%25","%")}function h(a,b){if("U"===b)return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if("U+R"===b)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(m,l);if("U+R-,"===b)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+b);}function f(a,b,c){for(var e=
[],d=0;d<a.length;d++)"undefined"!==typeof a[d]&&e.push(h(a[d],b));return e.join(c)}function d(a,b,c,e){for(var d=Object.keys(a),m=[],f=0;f<d.length;f++)"undefined"!==typeof a[d[f]]&&m.push(h(d[f],b)+c+h(a[d[f]],b));return m.join(e)}function g(a){if(0===a.length)throw Error("Invalid Expression: 0 length expression");(this._operator=c[a[0]])?a=a.substring(1):this._operator=c.NUL;for(var e=[],d=a.split(","),m=0;m<d.length;m++){var f=d[m].match(b);if(null===f)throw Error("Bad VarSpec: "+a);e.push({name:f[1],
explode:!!f[2],prefix:f[3]?parseInt(f[3],10):-1})}this._varSpecList=e}function e(a){for(var b=[],c=0,e=a.indexOf("{",c);-1!==e;){b.push(new k(a.substring(c,e)));c=a.indexOf("}",e+1);if(-1===c)throw Error("Invalid template: "+a);b.push(new g(a.substring(e+1,c)));c+=1;e=a.indexOf("{",c)}b.push(new k(a.substring(c)));this._templateComponents=b}var c={NUL:{first:"",sep:",",named:!1,ifemp:"",allow:"U"},"+":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R"},".":{first:".",sep:",",named:!1,ifemp:"",allow:"U"},
"/":{first:"/",sep:"/",named:!1,ifemp:"",allow:"U"},";":{first:";",sep:";",named:!0,ifemp:"",allow:"U"},"?":{first:"?",sep:"\x26",named:!0,ifemp:"\x3d",allow:"U"},"\x26":{first:"\x26",sep:"\x26",named:!0,ifemp:"\x3d",allow:"U"},"#":{first:"#",sep:",",named:!1,ifemp:"",allow:"U+R"},",":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R-,"}},b=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/,m=/%25[0-9A-F][0-9A-F]/g;k.prototype={expand:function(a){return encodeURI(this._text)}};
g.prototype={expand:function(a){for(var b=[],c=0;c<this._varSpecList.length;c++){var e=this._varSpecList[c],m=e.name,g=a[m],k=typeof g;if("undefined"!==k&&null!==g){var l=0===b.length?this._operator.first:this._operator.sep;if("string"===k)this._operator.named&&(l+=h(m,"U+R"),l+=0===g.length?this._operator.ifemp:"\x3d"),-1!==e.prefix&&e.prefix<g.length&&(g=g.substring(0,e.prefix)),l+=h(g,this._operator.allow);else if(Array.isArray(g)){if(0===g.length)continue;e.explode?l+=f(g,this._operator.allow,
this._operator.sep):(e=f(g,this._operator.allow,","),this._operator.named&&(l+=h(m,"U+R"),l+=0===e.length?this._operator.ifemp:"\x3d"),l+=e)}else if("object"===k){if(0===Object.keys(g).length)continue;e.explode?l+=d(g,this._operator.allow,"\x3d",this._operator.sep):(e=d(g,this._operator.allow,",",","),this._operator.named&&(l+=h(m,"U+R"),l+=0===e.length?this._operator.ifemp:"\x3d"),l+=e)}else throw Error("bad param type: "+m+" : "+k);b.push(l)}}return b.join("")}};e.prototype={expand:function(a){for(var b=
[],c=0;c<this._templateComponents.length;c++)b.push(this._templateComponents[c].expand(a));return b.join("")}};return e});
define("orion/i18nUtil",["require","orion/Deferred"],function(k,l){function h(d){if(d=localStorage.getItem("orion/messageBundle/"+d))if(d=JSON.parse(d),d._expires&&d._expires>(new Date).getTime())return delete d._expires,d;return null}var f={};return{getMessageBundle:function(d){function g(a){a?k(["i18n!"+d],function(a){if(a){var b=d;a._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+b,JSON.stringify(a));delete a._expires}c.resolve(a)}):e(Error(d))}function e(a){c.reject(a)}
if(f[d])return f[d];var c=new l;f[d]=c;var b=h(d);if(b)return c.resolve(b),c;try{k([d],g,e)}catch(m){k(["orion/i18n!"+d],g,e)}return c},formatMessage:function(d){var f=arguments;return d.replace(/\$\{([^\}]+)\}/g,function(e,c){return f[(c<<0)+1]})}}});
define("orion/PageLinks","require orion/Deferred orion/PageUtil orion/URITemplate orion/i18nUtil orion/objects orion/URL-shim".split(" "),function(k,l,h,f,d,g,e){function c(){return k.toUrl?(new URL(k.toUrl("orion/../"),window.location.href)).href.slice(0,-1):(new URL("/",window.location.href)).href.slice(0,-1)}function b(a){var b={};a.getPropertyKeys().forEach(function(c){"objectClass"!==c&&"service.names"!==c&&"service.id"!==c&&"__plugin__"!==c&&(b[c]=a.getProperty(c))});return b}function m(a){return d.getMessageBundle(a.nls).then(function(b){a.textContent=
a.nameKey?b[a.nameKey]:a.name;return a},function(b){a.textContent=a.nameKey||a.name;return a})}function a(a,e){var d=a.getServiceReferences(e||"orion.page.link"),n=h.matchResourceParameters(window.location.href),q={OrionHome:c(),Location:n.resource},g=[];d.forEach(function(a){a=b(a);if(a.uriTemplate&&(a.nls||a.name)){var c=(new f(a.uriTemplate)).expand(q),c=h.validateURLScheme(c);a.href=c;a.nls?g.push(m(a)):(a.textContent=a.name,g.push((new l).resolve(a)))}});return l.all(g)}function n(a){var b=this.categories=
Object.create(null);a.forEach(function(a){b[a.id]=a})}function q(a){this.allPageLinks=a;this.allPageLinks.sort(r)}function r(a,b){var c=a.textContent&&a.textContent.toLowerCase(),e=b.textContent&&b.textContent.toLowerCase();return c<e?-1:c>e?1:0}var s;g.mixin(n.prototype,{getCategoryIDs:function(){return Object.keys(this.categories)},getCategory:function(a){return this.categories[a]||null}});g.mixin(q.prototype,{createLinkElements:function(){return this.allPageLinks.map(function(a){var b=a.href;a=
a.textContent;var c=document.createElement("a");c.href=b;c.target="_self";c.classList.add("targetSelector");c.textContent=a;return c})},getAllLinks:function(){return this.allPageLinks}});return{getCategoriesInfo:function(a){var c;return!s?(c=[],a.getServiceReferences("orion.page.link.category").forEach(function(a){a=b(a);if(a.id&&(a.name||a.nameKey))a.nls?c.push(m(a)):(a.textContent=a.name,c.push((new l).resolve(a)))}),l.all(c).then(function(a){return s=new n(a)})):(new l).resolve(s)},getPageLinksInfo:function(b,
c){return a(b,c).then(function(a){return new q(a)})},getOrionHome:c}});
define("orion/edit/nls/root/messages",{Editor:"Editor",switchEditor:"Switch Editor",Fetching:"Fetching: ${0}",confirmUnsavedChanges:"There are unsaved changes.  Do you still want to navigate away?",searchFiles:"Search Files...",searchTerm:"Enter search term:",unsavedChanges:"There are unsaved changes.",unsavedAutoSaveChanges:"Please stay on the page until Auto Save is complete.",Save:"Save",Saved:"Saved",Blame:"Blame",BlameTooltip:"Show blame annotations",saveOutOfSync:"Resource is out of sync with the server. Do you want to save it anyway?",
loadOutOfSync:"Resource is out of sync with the server. Do you want to load it anyway? This will overwrite your local changes.",ReadingMetadata:"Reading metadata of ${0}",ReadingMetadataError:"Can not get metadata of ${0}",Reading:"Reading ${0}",readonly:"Read Only.",saveFile:"Save this file",gotoLine:"Go to Line...",gotoLineTooltip:"Go to specified line number",gotoLinePrompt:"Go to line:",Undo:"Undo",Redo:"Redo",Find:"Find...",noResponse:"No response from server.  Check your internet connection and try again.",
savingFile:"Saving file ${0}",running:"Running ${0}","Saving...":"Saving...",View:"View",SidePanel:"Side Panel",SidePanelTooltip:"Choose what to show in the side panel.",Actions:"Actions",Navigator:"Navigator",FolderNavigator:"Folder Navigator",Project:"Project",New:"New",File:"File",Edit:"Edit",Tools:"Tools",Add:"Add",noActions:"There are no actions for the current selection.",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding.",LocalEditorSettings:"Local Editor Settings",
NoProject:"${0} is not a project. To convert it to a project use ${1}.",NoProjects:"There are no projects in your workspace. Use the ${0} menu to create projects.",disconnected:"(disconnected)",ChooseFS:"Choose Filesystem",ChooseFSTooltip:"Choose the filesystem you want to view.",FSTitle:"${0} (${1})",Deploy:"Deploy","Deploy As":"Deploy As",Import:"Import",Export:"Export",OpenWith:"Open With",OpenRelated:"Open Related",Dependency:"Dependency",UnnamedCommand:"Unnamed"});
define("orion/edit/nls/messages",["orion/i18n!orion/edit/nls/messages","orion/edit/nls/root/messages"],function(k,l){var h={root:l};Object.keys(k).forEach(function(f){"undefined"===typeof h[f]&&(h[f]=k[f])});return h});
define("orion/extensionCommands","require orion/Deferred orion/commands orion/regex orion/contentTypes orion/URITemplate orion/i18nUtil orion/URL-shim orion/PageLinks i18n!orion/edit/nls/messages".split(" "),function(k,l,h,f,d,g,e,c,b,m){function a(a){var b={};a.getPropertyKeys().forEach(function(c){b[c]=a.getProperty(c)});return b}var n={},q=b.getOrionHome();n._cloneItemWithoutChildren=function w(a){if(null===a||"object"!==typeof a)return a;var b=a.constructor(),c;for(c in a)"children"!==c&&"Children"!==
c&&(b[c]=w(a[c]));return b};n._getOpenWithNavCommandExtensions=function(a,b){function c(a,b){for(var p=a.getServiceReferences("orion.navigate.openWith"),e=[],d=[],n=0;n<p.length;n++){var m=p[n];if(m.getProperty("editor")===b.id){var B=m.getProperty("contentType");B instanceof Array?e=e.concat(B):e.push(B||"*/*");m=m.getProperty("excludedContentTypes");m instanceof Array?d=d.concat(m):null!==m&&"undefined"!==typeof m&&d.push(m)}}0===e.length&&(e=null);0===d.length&&(d=null);return{contentTypes:e,excludedContentTypes:d}}
for(var e=function(){for(var b=a.getServiceReferences("orion.edit.editor"),c=[],p=0;p<b.length;p++){var e=b[p],d=e.getProperty("id");c.push({id:d,"default":e.getProperty("default")||!1,name:e.getProperty("name"),nameKey:e.getProperty("nameKey"),nls:e.getProperty("nls"),uriTemplate:e.getProperty("orionTemplate")||e.getProperty("uriTemplate"),validationProperties:e.getProperty("validationProperties")||[]})}return c}(),d=[],n=0;n<e.length;n++){var p=e[n],m=c(a,p);d.push({properties:{name:p.name||p.id,
nameKey:p.nameKey,id:"eclipse.openWithCommand."+p.id,contentType:m.contentTypes,excludedContentTypes:m.excludedContentTypes,uriTemplate:p.uriTemplate,nls:p.nls,forceSingleItem:!0,isEditor:p["default"]?"default":"editor",validationProperties:p.validationProperties},service:{}})}return d};n._makeValidator=function(a,b,c,e){function n(a,b,c,p,e){var d=!1,m;if("!"===b.charAt(0))return"undefined"===typeof a[b.substring(1)];if("undefined"!==typeof a[b]){if("undefined"===typeof c)m=a[b],d=!0;else if("string"===
typeof c){if(!typeof("string"===a[b]))return!1;if(p.variableName){if(c=RegExp(c).exec(a[b]))d=c[0],m="before"===p.variableMatchPosition?a[b].substring(0,c.index):"after"===p.variableMatchPosition?a[b].substring(c.index+d.length):"only"===p.variableMatchPosition?d:a[b],d=!0}else return RegExp(c).test(a[b])}else a[b]===c&&(m=a[b],d=!0);b=p.variableName;p=p.replacements;if(d&&b&&(e[b]=m,e.itemCached=a,p)){if("string"!==typeof m)return window.console.log("Cannot replace "+b+", value is not a string: "+
m),d;for(a=0;a<p.length;a++){m=!1;if(p[a].pattern){c=p[a].pattern;var f=p[a].replacement||"";e[b]=e[b].replace(RegExp(c),f).replace(RegExp(c),f)}else m=!0;m&&window.console.log("Invalid replacements specified in validation property.  "+p[a])}}return d}return!1}function m(a,b,c,p){var e=c.match,d,f;if(0<=(d=b.indexOf("["))){if(0>(f=b.indexOf("]")))return!1;var g=b.substring(0,d),q;if(!(q=a[g])||!Array.isArray(q))return!1;d=b.substring(d+1,f);d=parseInt(d,10);if(isNaN(d))return!1;0>d&&(d+=q.length);
b=b.substring(f+1);b=g+":"+String(d)+b}return 0<=b.indexOf("|")?(d=b.substring(0,b.indexOf("|")),b=b.substring(b.indexOf("|")+1),m(a,d,c,p)?!0:m(a,b,c,p)):0<=b.indexOf(":")?(d=b.substring(0,b.indexOf(":")),b=b.substring(b.indexOf(":")+1),a[d]?m(a[d],b,c,p):!1):n(a,b,e,c,p)}function p(b,c,p){if(p.info.validationProperties)for(var e=0;e<p.info.validationProperties.length;e++){var n=p.info.validationProperties[e];if("undefined"!==typeof n.source){if(!m(b,n.source,n,p))return!1}else return window.console.log("Invalid validationProperties in "+
a.id+".  No source property specified."),!1}var e=!0,f=c?d.getFilenameContentType(b.Name,c):null,f=f||{id:"application/octet-stream"};p.info.excludedContentTypes&&c&&(e=p.info.excludedContentTypes.every(function(a){a=a.replace(/([*?])/g,".$1");return-1!==f.id.search(a)?!1:!0}));e&&p.info.contentType&&c&&(e=p.info.contentType.some(function(a){a=a.replace(/([*?])/g,".$1");return-1!==f.id.search(a)?!0:!1}));return e}return{info:a,validationFunction:function(a){"function"===typeof e&&(a=e.call(this,a));
if(a){if(Array.isArray(a)){if((this.info.forceSingleItem||this.info.uriTemplate)&&1!==a.length||1>a.length)return!1}else a=[a];for(var b=0;b<a.length;b++)if(!p(a[b],c,this))return!1;return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var b={},c;for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);if(this.info.validationProperties)for(c=0;c<this.info.validationProperties.length;c++){var p=this.info.validationProperties[c];
p.source&&p.variableName&&(this.itemCached===a&&this[p.variableName]||m(a,p.source,p,this),a[p.variableName]?window.console.log("Variable name "+p.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):b[p.variableName]=this[p.variableName])}b.OrionHome=q;return(new g(this.info.uriTemplate)).expand(b)}return null}}};var r=m.UnnamedCommand;n._createCommandOptions=function(a,b,c,d,m,f){function p(p,e){var y=n._makeValidator(a,c,d,f);p.visibleWhen=
y.validationFunction.bind(y);if(m)if(y.generatesURI.bind(y)())p.hrefCallback=function(a){a=Array.isArray(a.items)?a.items[0]:a.items;return y.getURI.bind(y)(a)};else{var B=a;p.callback=function(a){var e;if(B.forceSingleItem)a=Array.isArray(a.items)?a.items[0]:a.items,e=n._cloneItemWithoutChildren(a);else if(Array.isArray(a.items)){e=[];for(var d=0;d<a.items.length;d++)e.push(n._cloneItemWithoutChildren(a.items[d]))}else e=n._cloneItemWithoutChildren(a.items);if(c)var y=c.getService("orion.page.progress");
b.run?y?y.progress(b.run(e),"Running command: "+p.name):b.run(e):c&&(y?y.progress(c.getService(b).run(e),"Running command: "+p.name):c.getService(b).run(e))}}e.resolve(p)}var B=new l;if(a.nls){var y=function(b){var c;b?(c=a.tooltipKey&&b[a.tooltipKey],b=a.nameKey&&b[a.nameKey]||a.name||r,c=c||a.tooltip||""):(b=a.name||a.nameKey||r,c=a.tooltip||a.tooltipKey||"");p({name:b,image:a.image,id:a.id||a.name,tooltip:c,isEditor:a.isEditor,showGlobally:a.showGlobally},B)};e.getMessageBundle(a.nls).then(y,y.bind(this,
null))}else p({name:a.name,image:a.image,id:a.id||a.name,tooltip:a.tooltip,isEditor:a.isEditor,showGlobally:a.showGlobally},B);return B};n.getOpenWithCommand=function(a,b,c){var e;a=c||n.getOpenWithCommands(a);for(c=0;c<a.length;c++)if(a[c].visibleWhen(b)){var d="default"===a[c].isEditor;if(!e||d)if(e=a[c],d)break}return e};n.getOpenWithCommands=function(a){var b=[],c;for(c in a._commandList){var e=a._commandList[c];e.isEditor&&b.push(e)}return b};var s;n.createAndPlaceFileCommandsExtension=function(a,
b,c,e,d,f){return n.createFileCommands(a,null,f?"all":void 0,!!f,b).then(function(a){d&&0<a.length&&(b.addCommandGroup(c,"eclipse.openWith",1E3,m.OpenWith,d,null,null,null,"dropdownSelection"),b.addCommandGroup(c,"eclipse.fileCommandExtensions",1E3,m.OpenRelated,d));a.forEach(function(a){var p=null;d&&(p=a.isEditor?d+"/eclipse.openWith":d+"/eclipse.fileCommandExtensions");b.registerCommandContribution(c,a.id,e,p)});return{}})};n.createFileCommands=function(a,b,c,e,d){c=void 0===c?"global":c;e=void 0===
e?!0:e;var m=[];n._cachedFileCommands||n._createCachedFileCommands(a);("all"===c||"global"===c)&&n._cachedFileCommands.forEach(function(a){var b=a.properties;("all"===c||b.forceSingleItem&&b.showGlobally)&&m.push(a)});return l.when(function(){var c=a.getService("orion.core.contentTypeRegistry")||b;return s||l.when(c.getContentTypes(),function(a){return s=a})}(),function(){e&&(n._cachedOpenWithExtensions||(n._cachedOpenWithExtensions=n._getOpenWithNavCommandExtensions(a,s)),m=m.concat(n._cachedOpenWithExtensions),
d._addedOpenWithCommands=e);var b=m.map(function(b){var c=b.properties;b=b.service;var p=d.findCommand(c.id||c.name);return p?(new l).resolve(p):n._createCommandOptions(c,b,a,s,!0).then(function(a){a=new h.Command(a);d.addCommand(a);return a})});return l.all(b,function(a){return{_error:a}}).then(function(a){return a})})};n._createCachedFileCommands=function(b){var c=b.getServiceReferences("orion.navigate.command");n._cachedFileCommands=[];for(var e=0;e<c.length;e++)if("orion.navigateFromMetadata"!==
c[e].getProperty("id")){var d=b.getService(c[e]),m=a(c[e]);n._cachedFileCommands.push({properties:m,service:d})}};n.getFileCommandIds=function(){var a=[];if(n._cachedFileCommands)n._cachedFileCommands.length&&(a=n._cachedFileCommands.map(function(a){return a.properties.id}));else throw"extensionCommandUtils._cachedFileCommands is not initialized";return a};n.createOpenWithCommands=function(a,b,c){return c&&c._addedOpenWithCommands?(new l).resolve(n.getOpenWithCommands(c)):n.createFileCommands(a,b,
"none",!0,c)};return n});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(k,l){function h(f){this._init(f)}h.prototype={_init:function(f){var d=l.node(f.container);if(!d)throw"no parent container";this._container=d;d.classList.remove("currentLocation");this._id=f.id||"eclipse.breadcrumbs";this._resource=f.resource||null;this._rootSegmentName=f.rootSegmentName;this._workspaceRootSegmentName=f.workspaceRootSegmentName;this._workspaceRootURL=f.workspaceRootURL;this._makeHref=f.makeHref;this._makeFinalHref=
f.makeFinalHref;this._maxLength=f.maxLength;this.path="";this.measure();this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var f;if(this._resource&&this._resource.Parents&&!this._resource.skip){f=document.createElement("a");var d=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(f,d):f.href=k.toUrl("edit/edit.html")+"#"+d}else f=document.createElement("span");l.empty(f);f.appendChild(document.createTextNode(this._workspaceRootSegmentName));
return f}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],buildSegment:function(f){var d=document.createElement("a");d.classList.add("breadcrumb");d.appendChild(document.createTextNode(f));return d},addSegmentHref:function(f,d){this._makeHref?this._makeHref(f,d.Location,d):f.href=k.toUrl("edit/edit.html")+"#"+d.ChildrenLocation},buildSegments:function(f,d){if(this._resource.Parents){var g=this._resource.Parents.slice(0),e,c;g&&(g=g.slice(0),"reverse"===d&&(g=g.reverse().slice(0)),
g.forEach(function(b){b.skip||(f?(c=f,f=null):c=b.Name,e=this.buildSegment(c),this.path+=b.Name,this.addSegmentHref(e,b),e.include=!1,this.segments.push(e))}.bind(this)))}},addDivider:function(){var f=document.createElement("span");f.appendChild(document.createTextNode(" / "));this.path+="/";f.classList.add("breadcrumbSeparator");this.append(f)},refresh:function(){(this.crumbs=l.node(this._id))?l.empty(this.crumbs):(this.crumbs=document.createElement("span"),this.crumbs.id=this._id,this._container.appendChild(this.crumbs),
this.dirty=document.createElement("span"),this.dirty.id="dirty",this.dirty.className="modifiedFileMarker",this._container.appendChild(this.dirty));this.crumbs.style.width="auto";this.crumbs.style.visibility="visible";this.crumbs.parentNode.className="currentLocation";this.crumbs.parentNode.style.width="auto"},append:function(f){this.crumbs.appendChild(f)},addTitle:function(f,d){var g=d||document.title;0===this.crumbs.childNodes.length&&(f=document.createElement("span"),f.appendChild(document.createTextNode(g)),
f.classList.add("breadcrumb"),f.classList.add("currentLocation"),this.append(f))},finalSegment:function(f,d){if(!this._resource.skip){var g;g=d?d:this._resource.Name;this._makeFinalHref?(f=this.buildSegment(g),this.addSegmentHref(f,this._resource)):(f=document.createElement("span"),f.appendChild(document.createTextNode(g)));f.classList.add("currentLocation");this.path+=this._resource.Name;this.append(f)}},firstSegment:function(f){f&&(this.append(f),this._resource&&this._resource.Parents&&!this._resource.skip?
(f.classList.add("breadcrumb"),this.addDivider()):(this._resource.skip||(f.href=""),f.classList.add("currentLocation")))},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(f){!0===f.include&&(this.append(f),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var f=this.segments.slice(0).reverse();f.forEach(function(d){this.append(d);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?d.include=
!0:this.INCLUDE_FIRST_SECTION=!1}.bind(this));this.segments=f.reverse()}},measure:function(){var f=this._container;f.style.width="auto";this.MAX_LENGTH=this._maxLength?this._maxLength:f.offsetWidth;this.refresh();this.segments=[];this.crumbs.style.visibility="hidden";var f=this.getNavigatorWorkspaceRootSegment(),d=this._rootSegmentName;d?this.addTitle(f,d):(this.finalSegment(f,d),this._resource&&this._resource.Parents&&(this.buildSegments(d,"reverse"),this.measureSegments(),this.firstSegment(f)),
this.crumbs.offsetWidth>=this.MAX_LENGTH&&(this.INCLUDE_FIRST_SECTION=!1))},render:function(){this.refresh();var f=this.getNavigatorWorkspaceRootSegment(),d=this._rootSegmentName;d?this.addTitle(f,d):(!0===this.INCLUDE_FIRST_SECTION&&this.firstSegment(f),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(f,d)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};h.prototype.constructor=h;return{BreadCrumbs:h}});
define("orion/webui/splitter",["require","orion/EventTarget","orion/webui/littlelib"],function(k,l,h){function f(d){l.attach(this);this._init(d)}f.prototype={_init:function(d){this._tracking=null;this._animationDelay=501;this._closeReversely=d.closeReversely;this.$node=h.node(d.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=h.node(d.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=h.node(d.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";
this._vertical=d.vertical;this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");d.toggle&&(this._thumb=document.createElement("div"),this.$node.appendChild(this._thumb),this._thumb.classList.add("splitThumb"),this._thumb.classList.add(this._vertical?"splitVerticalThumbLayout":"splitThumbLayout"));this._closeByDefault="closed"===this.$node.getAttribute("data-initial-state");"undefined"!==typeof d.closeByDefault&&(this._closeByDefault=d.closeByDefault);this._initializeFromStoredSettings();
this._closed?(this._closed=!1,this._thumbDown(!0,!0)):this._adjustToSplitPosition();this.$node.style.visibility="visible";this.$mainNode.style.display="block";this.$sideNode.style.display="block";this.$node.addEventListener("mousedown",this._mouseDown.bind(this),!1);window.addEventListener("mouseup",this._mouseUp.bind(this),!1);window.addEventListener("resize",this._resize.bind(this),!1)},isClosed:function(){return this._closed},toggleSidePanel:function(){this._thumbDown()},openSidePanel:function(){this._closed||
this._thumbDown()},addResizeListener:function(d){this.addEventListener("resize",function(f){d(f.node)})},_initializeFromStoredSettings:function(){var d=localStorage.getItem(this._prefix+"/toggleState");this._closed="string"===typeof d?"closed"===d:this._closeByDefault;var d=h.bounds(this.$node.parentNode),f=h.bounds(this.$node),e;this._vertical?(e=localStorage.getItem(this._prefix+"/yPosition"))?(this._splitTop=parseInt(e,10),this._splitTop>d.top+d.height-f.height&&(this._splitTop=d.top+d.height/
2)):this._closeByDefault&&(this._initialSplit=this._getSplitPosition(),this._splitTop=0):(e=localStorage.getItem(this._prefix+"/xPosition"))?(this._splitLeft=parseInt(e,10),this._splitLeft>d.left+d.width-f.width&&(this._splitLeft=d.left+d.width/2)):this._closeByDefault&&(this._initialSplit=this._getSplitPosition(),this._splitLeft=0)},_getSplitPosition:function(){var d=h.bounds(this.$node),f=h.bounds(this.$node.parentNode);return this.vertical?d.top-f.top:d.left-f.left},_adjustToSplitPosition:function(d){var f=
h.bounds(this.$node),e=h.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=f.height;if(d||!this._splitTop)this._splitTop=f.top,localStorage.setItem(this._prefix+"/yPosition",this._splitTop);d=this._splitTop;"relative"===this.$node.parentNode.style.position&&(d=this._splitTop-e.top);this.$sideNode.style.height=d+"px";this.$sideNode.style.display="block";this.$node.style.top=d+"px"}else{this._splitWidth=f.width;if(d||!this._splitLeft)this._splitLeft=f.left,localStorage.setItem(this._prefix+
"/xPosition",this._splitLeft);d=this._splitLeft;"relative"===this.$node.parentNode.style.position&&(d=this._splitLeft-e.left);this.$sideNode.style.width=d+"px";this.$sideNode.style.display="block";this.$node.style.left=d+"px"}this._resize()},_resize:function(d,f,e){d=d||0;var c=h.bounds(this.$node.parentNode),b=h.bounds(this.$node);this._vertical?(void 0===e&&(e=b.top-c.top),e+=b.height,this.$mainNode.style.top=e+"px"):(void 0===f&&(f=b.left-c.left),f+=b.width,this.$mainNode.style.left=f+"px");var m=
this;window.setTimeout(function(){m._notifyResizeListeners(m.$mainNode);m._notifyResizeListeners(m.$sideNode)},d)},_notifyResizeListeners:function(d){this.dispatchEvent({type:"resize",node:d})},_notifyToggleListeners:function(){this.dispatchEvent({type:"toggle",closed:this._closed})},_thumbDown:function(d,f){d||this._addAnimation();var e=this._splitTop,c=this._splitLeft;if(this._closed)this._closed=!1,!this._splitLeft&&!this._splitTop&&"number"===typeof this._initialSplit&&(e=c=this._initialSplit);
else if(this._closed=!0,this._closeReversely){var b=h.bounds(this.$node.parentNode),m=h.bounds(this.$node);this._vertical?e=b.height-m.height:c=b.width-m.width}else e=c=0;this._vertical?(this.$sideNode.style.height=e+"px",this.$node.style.top=e+"px"):(this.$sideNode.style.width=c+"px",this.$node.style.left=c+"px");this._resize(this._animationDelay,c,e);d||this._removeAnimation();f||localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null);var a=this;window.setTimeout(function(){a._notifyToggleListeners()},
this._animationDelay)},_removeAnimation:function(){var d=this;window.setTimeout(function(){d.$sideNode.classList.remove(d._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");d.$mainNode.classList.remove(d._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");d.$node.classList.remove(d._vertical?"splitVerticalLayoutAnimation":"splitLayoutAnimation")},this._animationDelay)},_addAnimation:function(){this.$sideNode.classList.add(this._vertical?"sidePanelVerticalLayoutAnimation":
"sidePanelLayoutAnimation");this.$mainNode.classList.add(this._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");this.$node.classList.add(this._vertical?"splitVerticalLayoutAnimation":"splitLayoutAnimation")},_mouseDown:function(d){if(d.target===this._thumb)return h.stop(d),this._thumbDown();this._tracking||(this.$node.classList.add("splitTracking"),this.$mainNode.classList.add("panelTracking"),this.$sideNode.classList.add("panelTracking"),this._tracking=this._mouseMove.bind(this),
window.addEventListener("mousemove",this._tracking),h.setFramesEnabled(!1),h.stop(d))},_mouseMove:function(d){if(this._tracking){var f=h.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=d.clientY;this._splitTop<f.top+5?this._splitTop=f.top+5:this._splitTop>f.top+f.height-5&&(this._splitTop=f.top+f.height-5);var e=this._splitTop,e=this._splitTop-f.top;this.$node.style.top=e+"px"}else this._splitLeft=d.clientX,this._splitLeft<f.left+5?this._splitLeft=f.left+5:this._splitLeft>f.left+f.width-
5&&(this._splitLeft=f.left+f.width-5),e=this._splitLeft-2*f.left,this.$node.style.left=e+"px";this._adjustToSplitPosition(!0);h.stop(d)}},_mouseUp:function(d){this._tracking&&(h.setFramesEnabled(!0),window.removeEventListener("mousemove",this._tracking),this._tracking=null,this.$node.classList.remove("splitTracking"),this.$mainNode.classList.remove("panelTracking"),this.$sideNode.classList.remove("panelTracking"),h.stop(d))}};f.prototype.constructor=f;return{Splitter:f}});
define("orion/keyAssist",["i18n!orion/nls/messages","orion/webui/littlelib","orion/util"],function(k,l,h){function f(d){this.commandRegistry=d.commandRegistry;this.create();this._filterString="";this._providers=[]}f.prototype={addProvider:function(d){this._providers.push(d)},create:function(){var d=this._keyAssistDiv=document.createElement("div");d.id="keyAssist";d.style.display="none";d.classList.add("keyAssistFloat");d.setAttribute("role","menu");var f=this._keyAssistInput=document.createElement("input");
f.classList.add("keyAssistInput");f.type="text";f.placeholder=k["Filter bindings"];d.appendChild(f);var e=this._keyAssistContents=document.createElement("div");e.classList.add("keyAssistContents");if(h.isIOS||h.isAndroid)e.style.overflowY="auto";d.appendChild(e);var c=this._keyAssistTable=document.createElement("table");c.tabIndex=0;c.classList.add("keyAssistList");e.appendChild(c);document.body.appendChild(d);f.addEventListener("keydown",function(b){this._keyDown(b)}.bind(this));c.addEventListener("keydown",
function(b){this._keyDown(b)}.bind(this));f.addEventListener("input",function(b){this.filterChanged()}.bind(this));e.addEventListener(h.isFirefox?"DOMMouseScroll":"mousewheel",function(b){this._scrollWheel(b)}.bind(this));document.addEventListener("keydown",function(b){b.keyCode===l.KEY.ESCAPE&&this.hide()}.bind(this));l.addAutoDismiss([d],function(){this.hide()}.bind(this))},createContents:function(){l.empty(this._keyAssistTable);this._selectedIndex=-1;this._selectedRow=null;for(var d=this._idCount=
this._keyAssistContents.scrollTop=0;d<this._providers.length;d++)this._providers[d].showKeyBindings(this);this.createHeader(k.Global);this.commandRegistry.showKeyBindings(this)},createItem:function(d,f,e){if(this._filterString){var c=this._filterString.toLowerCase(),b;c!==this._filterString?(c=this._filterString,b=function(a){return a}):b=function(a){return a.toLowerCase()};if(-1===b(f).indexOf(c)&&-1===b(d).indexOf(c)&&-1===b(this._lastHeader).indexOf(c))return}var m=this._keyAssistTable.insertRow(-1);
m.id="keyAssist-keyBinding-"+this._idCount++;m.setAttribute("role","menuitem");m._execute=e;m.classList.add("keyAssistItem");m.addEventListener("click",function(a){this._selectedRow=m;this.execute();a.preventDefault()}.bind(this));e=m.insertCell(-1);e.classList.add("keyAssistName");e.appendChild(document.createTextNode(f));e=m.insertCell(-1);e.classList.add("keyAssistAccel");e.appendChild(document.createTextNode(d))},createHeader:function(d){this._lastHeader=d;var f=this._keyAssistTable.insertRow(-1);
f.classList.add("keyAssistSection");var f=f.insertCell(-1),e=document.createElement("h2");e.appendChild(document.createTextNode(d));f.appendChild(e)},execute:function(){window.setTimeout(function(){this.hide();var d=this._selectedRow;this._selectedRow=null;d&&d._execute&&d._execute()}.bind(this),0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var d=this._keyAssistInput.value;this._filterString!==d&&(this._filterString=
d,this.createContents())}.bind(this),100)},hide:function(){if(this.isVisible()){var d=document.activeElement,f=this._keyAssistDiv,d=f===d||0!==(f.compareDocumentPosition(d)&16);f.style.display="none";d&&1!==document.compareDocumentPosition(this._previousActiveElement)&&this._previousActiveElement.focus();this._previousActiveElement=null}},isVisible:function(){return"block"===this._keyAssistDiv.style.display},removeProvider:function(d){d=this._providers.indexOf(d);-1!==d&&this._providers.splice(d,
1)},select:function(d){var f=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(0===f.length)this._selectedIndex=-1;else{var e=this._selectedIndex,e=(e+(d?1:-1))%f.length;0>e&&(e=f.length-1);-1!==this._selectedIndex&&(d=f[this._selectedIndex],d.classList.remove("selected"),this._selectedRow=null);this._selectedIndex=e;if(-1!==this._selectedIndex){this._selectedRow=d=f[this._selectedIndex];d.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",d.id);this._keyAssistTable.focus();
var f=d.getBoundingClientRect(),c=this._keyAssistContents,b=c.getBoundingClientRect();d.offsetTop<c.scrollTop?0===e?c.scrollTop=0:d.scrollIntoView(!0):f.bottom>b.bottom&&d.scrollIntoView(!1)}}},show:function(){this.isVisible()||(this._previousActiveElement=document.activeElement,this.createContents(),this._keyAssistContents.style.height=Math.floor(0.75*this._keyAssistDiv.parentNode.clientHeight)+"px",this._keyAssistDiv.style.display="block",this._keyAssistInput.value=this._filterString,this._keyAssistInput.focus(),
this._keyAssistInput.select())},_keyDown:function(d){if(40===d.keyCode)this.select(!0);else if(38===d.keyCode)this.select(!1);else if(13===d.keyCode)this.execute();else return;d.preventDefault()},_scrollWheel:function(d){var f=0,f=h.isIE||h.isOpera?-d.wheelDelta:h.isFirefox?40*d.detail:-d.wheelDeltaY,e=this._keyAssistContents,c=e.scrollTop;e.scrollTop+=f;if(c!==e.scrollTop)return d.preventDefault&&d.preventDefault(),!1}};return{KeyAssistPanel:f}});
define("orion/widgets/themes/ThemePreferences",[],function(){function k(k,h){this._preferences=k;this._themeData=h;var f=h.getThemeStorageInfo();this._themeVersion=f.version;var d=k.listenForChangedSettings(f.storage,2,function(f){f.key===d&&this.apply()}.bind(this))}k.prototype={_initialize:function(k,h,f){var d,g;void 0===this._themeVersion||f.get("version")===this._themeVersion?(d=f.get(k.styleset),(g=f.get("selected"))&&(g=JSON.parse(g))):g=d=null;d||(d=h.getStyles(),f.put(k.styleset,JSON.stringify(d)));
if(!g||void 0===g[k.selectedKey])g=g||{},g[k.selectedKey]=k.defaultTheme,f.put("selected",JSON.stringify(g));f.put("version",this._themeVersion)},apply:function(){this.setTheme()},getTheme:function(k){var h=this._themeData,f=h.getThemeStorageInfo();this._preferences.getPreferences(f.storage,2).then(function(d){this._initialize(f,h,d);var g=JSON.parse(d.get("selected"));d=JSON.parse(d.get(f.styleset));var e;if(d)for(var c=0;c<d.length;c++)if(d[c].name===g[f.selectedKey]){e=d[c];break}k({style:e,styles:d})}.bind(this))},
setTheme:function(k,h){var f=this._themeData,d=f.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(g){this._initialize(d,f,g);var e=JSON.parse(g.get("selected"));k||(k=e[d.selectedKey]);e[d.selectedKey]=k;g.put("selected",JSON.stringify(e));h?g.put(d.styleset,JSON.stringify(h)):h=JSON.parse(g.get(d.styleset));for(var c=0;c<h.length;c++)if(h[c].name===e[d.selectedKey]){f.processSettings(h[c]);break}g.put("version",this._themeVersion)}.bind(this))},setFontSize:function(k){var h=
this._themeData,f=h.getThemeStorageInfo();this._preferences.getPreferences(f.storage,2).then(function(d){this._initialize(f,h,d);var g=JSON.parse(d.get("selected")),e=JSON.parse(d.get(f.styleset)),c;if(e)for(var b=0;b<e.length;b++)e[b].fontSize=k,e[b].name===g[f.selectedKey]&&(c=e[b]);d.put(f.styleset,JSON.stringify(e));h.processSettings(c)}.bind(this))}};return{ThemePreferences:k}});
define("orion/settings/nls/root/messages",{"Plugin Description":"Plugin Description",Create:"Create","Loading...":"Loading...","Label:":"Label:",Title:"Title",Plugins:"Plugins","User Profile":"User Profile",Git:"Git","Git Settings":"Git Settings",General:"General",Navigation:"Navigation",Links:"Links","Open in same tab":"Open in same tab","Open in new tab":"Open in new tab",Font:"Font",Family:"Family","Sans Serif":"Sans Serif",Serif:"Serif",Size:"Size","8pt":"8pt","9pt":"9pt","10pt":"10pt","12pt":"12pt",
Color:"Color",Background:"Background",Strings:"Strings","String Types":"String Types",blue:"blue",Weight:"Weight",Normal:"Normal",Bold:"Bold",Comments:"Comments","Comment Types":"Comment Types",green:"green",Keywords:"Keywords","Keyword Types":"Keyword Types",darkred:"darkred",Categories:"Categories",Username:"Username","Full Name":"Full Name","Email Address":"Email Address","Email Confirmed":"Email Confirmed",Account:"Account","Current Password":"Current Password","New Password":"New Password","Verify Password":"Verify Password",
Password:"Password",OpenId:"OpenId",AOL:"AOL",Yahoo:"Yahoo",Google:"Google",Unlink:"Unlink",Link:"Link",Unlinked:"Unlinked",Linked:"Linked","Linked Accounts":"Linked Accounts","Git Email Address":"Git Email Address","Git Username":"Git Username","Git Credentials Storage":"Git Credentials Storage",Update:"Update","Update Profile Settings":"Update Profile Settings","Update Git User Settings":"Update Git User Settings","Update Git Credentials":"Update Git Credentials","User profile data successfully updated.":"User profile data successfully updated.",
"Git user data successfully updated.":"Git user data successfully updated.","Git Credentials successfully updated.":"Git Credentials successfully updated.","Edit Plugin JavaScript":"Edit Plugin JavaScript","Install Plugin":"Install Plugin","Plugin Name:":"Plugin Name:","Author Name:":"Author Name:","Licence:":"Licence:","Description:":"Description:","A plugin for Eclipse Orion":"A plugin for Eclipse Orion","Plugin Link":"Plugin Link",Install:"Install","Install a plugin by specifying its URL":"Install a plugin by specifying its URL",
"Plugin URL:":"Plugin URL:",Disable:"Disable",DisableTooltip:"Disable the plugin",Enable:"Enable",EnableTooltip:"Enable the plugin","Reload all":"Reload all","Reload all installed plugins":"Reload all installed plugins","Create a new Orion Plugin":"Create a new Orion Plugin","Find More Orion Plugins":"Find More Orion Plugins","Get Plugins":"Get Plugins",Reload:"Reload","Reload the plugin":"Reload the plugin",Delete:"Delete","Delete this plugin from the configuration":"Delete this plugin from the configuration",
"Type a plugin url here ...":"Type a plugin url here ...","Installed ":"Installed ","Installing ":"Installing ","Already installed":"Already installed"," plugin":" plugin","Reloaded ":"Reloaded ","Uninstalled ":"Uninstalled ","Are you sure you want to uninstall '":"Are you sure you want to uninstall '",Services:"Services",Value:"Value","JavaScript Object":"JavaScript Object","click here, then check javascript console to drill down":"click here, then check javascript console to drill down",Item:"Item",
"Git Config":"Git Config","Clear Git Credentials":"Clear Git Credentials","Enable Storage":"Enable Storage","Please be aware that your credentials will be stored persistently in the browser.":"Please be aware that your credentials will be stored persistently in the browser.","Do you wish to enable the Key Storage?":"Do you wish to enable the Key Storage?",general:"General",validation:"Validation","Deleted git credentials for ${0}":"Deleted git credentials for ${0}",Editor:"Editor",editorSettings:"Settings",
EditorThemes:"Themes",Import:"Import","Import a theme":"Import a theme",Export:"Export","Export a theme":"Export a theme","Theme name:":"Theme name:",yourTheme:"yourTheme",fileManagement:"File Management",typing:"Typing",autoSave:"Auto Save",autoSaveTimeout:"Save interval (ms)",autoLoad:"Auto Load",saveDiffs:"Save file as diffs",trimTrailingWhiteSpace:"Trim Trailing Whitespace on Save",Restore:"Restore Defaults",Default:"Default",keys:"Keys",tabs:"Tabs",tabSize:"Tab Size",expandTab:"Insert spaces for tabs",
smoothScrolling:"Smooth Scrolling",scrollAnimation:"Scrolling Animation",scrollAnimationTimeout:"Scrolling Duration (ms)",keyBindings:"Key Bindings",rulers:"Rulers",annotationRuler:"Show Annotation Ruler",lineNumberRuler:"Show Line Number Ruler",foldingRuler:"Show Folding Ruler",overviewRuler:"Show Overview Ruler",whitespaces:"White Spaces",wrapping:"Wrapping",wordWrap:"Word Wrap",showMargin:"Show Margin",marginOffset:"Margin Column",showTabs:"Show Tabs",showSpaces:"Show Spaces",autoSaveTimeoutInvalid:"Invalid save interval.",
scrollAnimationTimeoutInvalid:"Invalid scrolling duration.",tabSizeInvalid:"Invalid tab size.",localSettingsTooltip:"Toggle whether this setting is shown in the local editor settings drop down.",editorSettingsInfo:"Use the ${0} and ${1} to toggle whether a given setting is shown in the local editor settings drop down ${2}.",autoPairParentheses:"Autopair (Parentheses)",autoPairBraces:"Autopair {Braces}",autoPairSquareBrackets:"Autopair [Square] Brackets",autoPairAngleBrackets:"Autopair \x3cAngle\x3e Brackets",
autoPairQuotations:'Autopair "Strings"',autoCompleteComments:"Autocomplete /** Block Comments */",smartIndentation:"Smart Indentation",sourceControl:"Source Control",showBlame:"Show Blame",languageTools:"Language Tools",showOccurrences:"Show Occurrences",contentAssistAutoTrigger:"Show Content Assist automatically","Editor preferences updated":"Editor preferences updated","Editor defaults restored":"Editor defaults restored",Theme:"Theme","Font Size":"Font Size","New Theme Name:":"New Theme Name:",
"Font Size:":"Font Size:","UI Theme":"UI Theme","Navigation Bar":"Navigation Bar","Navigation Text":"Navigation Text","Search Box":"Search Box","Tool Panel":"Tool Panel","Selection Bar":"Selection Bar",Location:"Location",Content:"Content","Main Panel":"Main Panel",Button:"Button","Button Text":"Button Text","Section Text":"Section Text","Side Panel":"Side Panel","Line Color":"Line Color","Line Numbers":"Line Numbers",Foreground:"Foreground","Current Line":"Current Line","HTML Attribute":"HTML Attribute",
"Overview Ruler":"Overview Ruler","HTML Tag":"HTML Tag","Annotation Ruler":"Annotation Ruler","Show Guide":"Show Guide","Check Guide":"Check Guide",Cancel:"Cancel","Revert Theme":"Revert Theme","Update Theme":"Update Theme","Theme:":"Theme:",clickDiagram:"Click diagram to style.",clickUpdate:"Click Update button to save preview.","CSS Class Name":"CSS Class Name","CSS Attribute":"CSS Attribute","CSS Value":"CSS Value","CSS Text":"CSS Text","COLOR:":"Color:","NEW COLOR:":"New Color:",Ok:"Ok","OR HEX:":"Or Hex: "});
define("orion/settings/nls/messages",["orion/i18n!orion/settings/nls/messages","orion/settings/nls/root/messages"],function(k,l){var h={root:l};Object.keys(k).forEach(function(f){"undefined"===typeof h[f]&&(h[f]=k[f])});return h});
define("orion/editor/eventTarget",[],function(){function k(){}k.addMixin=function(l){var h=k.prototype,f;for(f in h)h.hasOwnProperty(f)&&(l[f]=h[f])};k.prototype={addEventListener:function(k,h,f){this._eventTypes||(this._eventTypes={});var d=this._eventTypes[k];d||(d=this._eventTypes[k]={level:0,listeners:[]});d.listeners.push({listener:h,useCapture:f})},dispatchEvent:function(k){var h=k.type;this._dispatchEvent("pre"+h,k);this._dispatchEvent(h,k);this._dispatchEvent("post"+h,k)},_dispatchEvent:function(k,
h){var f=this._eventTypes?this._eventTypes[k]:null;if(f){var d=f.listeners;try{if(f.level++,d)for(var g=0,e=d.length;g<e;g++)if(d[g]){var c=d[g].listener;"function"===typeof c?c.call(this,h):c.handleEvent&&"function"===typeof c.handleEvent&&c.handleEvent(h)}}finally{if(f.level--,f.compact&&0===f.level){for(g=d.length-1;0<=g;g--)d[g]||d.splice(g,1);0===d.length&&delete this._eventTypes[k];f.compact=!1}}}},isListening:function(k){return!this._eventTypes?!1:void 0!==this._eventTypes[k]},removeEventListener:function(k,
h,f){if(this._eventTypes){var d=this._eventTypes[k];if(d){for(var g=d.listeners,e=0,c=g.length;e<c;e++){var b=g[e];if(b&&b.listener===h&&b.useCapture===f){0!==d.level?(g[e]=null,d.compact=!0):g.splice(e,1);break}}0===g.length&&delete this._eventTypes[k]}}}};return{EventTarget:k}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(k,l,h){function f(d){d=d||{};this._document=d.document||document}var d={};f.getTheme=function(g){g=g||"default";var e=d[g];e||(e=d[g]=new f);return e};f.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(d,e){var c=this,b=c._themeClass;c._themeClass=d;this._load(d,e,function(){c.onThemeChanged({type:"ThemeChanged",oldValue:b,newValue:c.getThemeClass()})})},onThemeChanged:function(d){return this.dispatchEvent(d)},
buildStyleSheet:function(d,e){function c(c,a,e){a&&(b.push("."+d+" ."+c+" {"),b.push("\t"+(e?"background-color":"color")+": "+a+";"),b.push("}"))}var b=[];b.push("");b.push("."+d+" {");e.fontFamily&&b.push("\tfont-family: "+e.fontFamily+";");e.fontSize&&b.push("\tfont-size: "+e.fontSize+";");e.fontSize&&b.push("\tcolor: "+e.text+";");b.push("}");b.push("."+d+".textview {");e.background&&b.push("\tbackground-color: "+e.background+";");b.push("}");c("ruler.annotations",e.annotationRuler,!0);c("ruler.lines",
e.annotationRuler,!0);c("ruler.folding",e.annotationRuler,!0);c("ruler.overview",e.overviewRuler,!0);c("rulerLines",e.lineNumber,!1);c("rulerLines.even",e.lineNumberEven,!1);c("rulerLines.odd",e.lineNumberOdd,!1);c("annotationLine.currentLine",e.currentLine,!0);c("entity-name-tag",e.keyword,!1);c("entity-other-attribute-name",e.attribute,!1);c("string-quoted",e.string,!1);c("meta.annotation.currentLine",e.currentLine,!0);c("keyword",e.keyword,!1);c("string",e.string,!1);c("comment",e.comment,!1);
c("comment.block.documentation",e.comment,!1);c("keyword.other.documentation.markup",e.comment,!1);return b.join("\n")},_createStyle:function(d,e,c,b){var m=this._document;d="orion-theme-"+d;var a=m.getElementById(d);if(a){if(b||a.firstChild.data===e)return;a.removeChild(a.firstChild);a.appendChild(m.createTextNode(e))}else b?(a=h.createElement(m,"link"),a.rel="stylesheet",a.type="text/css",a.href=e,a.addEventListener("load",function(){c()})):(a=h.createElement(m,"style"),a.appendChild(m.createTextNode(e))),
a.id=d,(m.getElementsByTagName("head")[0]||m.documentElement).appendChild(a);b||c()},_load:function(d,e,c){if(d)if("string"===typeof e)this._createStyle(d,e,c);else if(e=e.href,".css"!==e.substring(e.length-4)&&(e+=".css"),/^\//.test(e)||/[a-zA-Z0-9]+:\/\//i.test(e)||!k.toUrl)this._createStyle(d,e,c,!0);else{var b=this;k(["text!"+e],function(e){b._createStyle(d,e,c,!1)})}else c()}};l.EventTarget.addMixin(f.prototype);return{TextTheme:f}});
define("orion/widgets/themes/ThemeClass",[],function(){function k(k){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=k;this.classString="."+k+"{ "}k.prototype.className=null;k.prototype.classString=void 0;k.prototype.style=void 0;k.prototype.closeString=" }\n";k.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:k}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(k){function l(){}l.prototype.navbar="white";l.prototype.button="#777777";l.prototype.location="#EFEFEF";l.prototype.selection="#cedce7";l.prototype.sidepanel="#F7F7F7";l.prototype.mainpanel="white";l.prototype.navtext="#bfbfbf";l.prototype.content="#3087B3";l.prototype.search="#444";l.prototype.toolpanel="white";l.prototype.writeNavigationStyle=function(){var h="",f=[],d=new k.ThemeClass("orionPage");
d.style.backgroundColor="#fdfdfd";d.style.width="100%";d.style.height="100%";f.push(d);d=new k.ThemeClass("topRowBanner");d.style.margin="0";d.style.border="0";d.style.backgroundColor=this.navbar;d.style.height="16px";d.style.padding="10px";d.style.paddingLeft="6px";d.style.paddingRight="2px";d.style.borderBottom="none";d.style.boxShadow="0 2px 2px 0 rgba(0, 0, 0, 0.1),0 1px 0 0 rgba(0, 0, 0, 0.1)";d.style.zIndex="100";f.push(d);d=new k.ThemeClass("a");d.style.textDecoration="none";d.style.color=
this.content;f.push(d);d=new k.ThemeClass("navlink");d.style.display="inline-block";d.style.padding="2px";d.style.color=this.content;d.style.verticalAlign="bottom";f.push(d);d=new k.ThemeClass("primaryNav");d.style.color=this.navtext;d.style.fontSize="8pt";d.style.fontWeight="normal";d.style.paddingTop="0";d.style.verticalAlign="baseline";f.push(d);d=new k.ThemeClass("primaryNav a");d.style.fontSize="8pt";d.style.color=this.navtext;d.style.marginRight="6px";d.style.marginLeft="6px";d.style.verticalAlign=
"baseline";d.style.textDecoration="none";f.push(d);d=new k.ThemeClass("primaryNav a:hover");d.style.color="#bfbfbf";d.style.cursor="hand";d.style.color="white";d.style.fontWeight="normal";f.push(d);for(var g in f)h+=f[g].toString();return h};l.prototype.writeLocationStyle=function(){var h="",f=[],d=new k.ThemeClass("titleArea");d.style.margin="0";d.style.paddingTop="5px";d.style.border="0";d.style.background=this.location;d.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+
this.location+"), color-stop(100%,"+this.location+"))";d.style.borderBottom="1px solid "+this.location;d.style.minHeight="20px";f.push(d);d=new k.ThemeClass("breadcrumb");d.style.fontSize="8pt";d.style.textDecoration="none";d.style.color="#f1f1f2;";d.style.paddingTop="2px";f.push(d);d=new k.ThemeClass("a.breadcrumb:hover");d.style.textDecoration="none";d.style.borderBottom="1px dotted";d.style.color="#F58B0F";d.style.cursor="pointer";f.push(d);d=new k.ThemeClass("breadcrumbSeparator");d.style.fontSize=
"8pt";d.style.textDecoration="none";d.style.color=this.separator;d.style.fontWeight="bold";f.push(d);d=new k.ThemeClass("currentLocation");d.style.fontWeight="bold";d.style.fontSize="8pt";d.style.color=this.breadcrumb;d.style.textDecoration="none";d.style.textWrap="normal";d.style.lineHeight="10pt";f.push(d);d=new k.ThemeClass("a.currentLocation:hover");d.style.fontWeight="bold";d.style.fontSize="10pt";d.style.color="#666666";d.style.textDecoration="none";d.style.borderBottom="0";f.push(d);d=new k.ThemeClass("navlinkonpage");
d.style.color=this.content;d.style.verticalAlign="middle";f.push(d);this.bannerProgress&&(d=new k.ThemeClass("topRowBanner .progressPane_running"),d.style.borderColor=this.bannerProgress,f.push(d));for(var g in f)h+=f[g].toString();return h};l.prototype.writeButtonStyle=function(){var h="",f=[],d=new k.ThemeClass("commandButton");d.style.color="#666";d.style.border="1px solid #dedede";d.style.backgroundColor="#ddd";d.style.textAlign="center";d.style.verticalAlign="middle";d.style.cursor="pointer";
d.style.display="inline-block";d.style.padding="4px 6px";d.style.borderRadius="3px";d.style.lineHeight="12px";d.style.fontSize="9pt";d.style.userSelect="none";f.push(d);d=new k.ThemeClass("commandButton:over");d.style.backgroundColor="#e6e6e6";d.style.border="1px solid #808080";f.push(d);d=new k.ThemeClass("commandMenu");d.style.color="#222";d.style.display="inline-block";d.style.verticalAlign="baseline";d.style.margin="0";d.style.fontSize="8pt";d.style.fontWeight="normal";d.style.border="1px solid #dedede";
d.style.backgroundColor="#efefef";d.style.cursor="pointer";d.style.borderRadius="1px";f.push(d);d=new k.ThemeClass("commandMenuItem");d.style.border="0";d.style.padding="0";d.style.margin="0";f.push(d);for(var g in f)h+=f[g].toString();return h};l.prototype.writeMainStyle=function(){var h="",f=[],d=new k.ThemeClass("searchbox");d.style.backgroundImage="url(../images/core_sprites.png)";d.style.backgroundRepeat="no-repeat";d.style.backgroundPosition="4px -297px";d.style.width="12px";d.style.height=
"12px";d.style.backgroundColor=this.search;d.style.border="1px solid "+this.search;d.style.fontSize="11px";d.style.width="15em";d.style.height="16px";d.style.borderRadius="10px";d.style.color="#999";d.style.padding="0";d.style.paddingLeft="20px";d.style.marginLeft="5px";d.style.marginTop="6px !important";d.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";f.push(d);d=new k.ThemeClass("searchbox:focus");d.style.color="white";d.style.outline=
"none";f.push(d);d=new k.ThemeClass("checkedRow");d.style.cssText="background-color:"+this.selection+" !important;";f.push(d);d=new k.ThemeClass("navbar-item-selected");d.style.background=this.selection;d.style.color=this.content;f.push(d);d=new k.ThemeClass("auxpane");d.style.border="0";d.style.background=this.sidepanel;f.push(d);d=new k.ThemeClass("mainpane");d.style.background=this.mainpanel;d.style.border=0;f.push(d);d=new k.ThemeClass("mainToolbar");d.style.background=this.toolpanel;f.push(d);
for(var g in f)h+=f[g].toString();return h};l.prototype.render=function(h){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};l.prototype.getSheet=function(h){h.navbar.value?(this.navbar=h.navbar.value,this.button=h.button.value,this.location=h.location.value,this.selection=h.selection.value,this.sidepanel=h.sidepanel.value,this.mainpanel=h.mainpanel.value,this.navtext=h.navtext.value,this.search=
h.search.value,this.content=h.content.value,this.toolpanel=h.toolpanel.value,this.bannerProgress=h.bannerProgress.value):(this.navbar=h.navbar,this.button=h.button,this.location=h.location,this.selection=h.selection,this.sidepanel=h.sidepanel,this.mainpanel=h.mainpanel,this.navtext=h.navtext,this.search=h.search,this.content=h.content,this.toolpanel=h.toolpanel,this.bannerProgress=h.bannerProgress);return this.writeNavigationStyle()+this.writeLocationStyle()+this.writeMainStyle()+this.writeButtonStyle()};
return{ThemeSheetWriter:l}});
define("orion/widgets/themes/container/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme","orion/widgets/themes/container/ThemeSheetWriter"],function(k,l,h){function f(){}function d(){this.styles=[];var e=new f;e.name="Orion";e.navbar="white";e.button="#EFEFEF";e.location="#efefef";e.selection="FEC";e.sidepanel="#FBFBFB";e.mainpanel="white";e.toolpanel="white";e.navtext="#bfbfbf";e.content="#3087B3";e.search="#444";e.breadcrumb="#3087B3";e.separator="#333";e.bannerProgress="whitesmoke";
this.styles.push(e);e=new f;e.name="Orion2014";e.navbar="white";e.button="#EFEFEF";e.location="#EFEFEF";e.selection="FEC";e.sidepanel="#EEEEEE";e.mainpanel="#EEEEEE";e.toolpanel="#EEEEEE";e.navtext="#BFBFBF";e.content="#333333";e.search="#444444";e.breadcrumb="#333333";e.separator="#333333";e.bannerProgress="orange";this.styles.push(e);e=new f;e.name="Green Zone";e.navbar="seagreen";e.button="lavender";e.location="darkseagreen";e.selection="moccasin";e.sidepanel="aliceblue";e.mainpanel="white";e.toolpanel=
"white";e.navtext="#FBFBFB";e.content="darkgreen";e.search="darkgreen";e.breadcrumb="#3087B3";e.separator="seagreen";e.bannerProgress="#F2F2F2";this.styles.push(e);e=new f;e.name="Pretty In Pink";e.navbar="plum";e.button="lavender";e.location="pink";e.selection="lavender";e.sidepanel="seashell";e.mainpanel="white";e.toolpanel="white";e.navtext="#FBFBFB";e.content="mediumorchid";e.search="violet";e.breadcrumb="#3087B3";e.separator="plum";e.bannerProgress="#F2F2F2";this.styles.push(e);e=new f;e.name=
"Blue Monday";e.navbar="cornflowerblue";e.button="lavender";e.location="skyblue";e.selection="lavender";e.sidepanel="aliceblue";e.mainpanel="white";e.toolpanel="white";e.navtext="#FBFBFB";e.content="royalblue";e.search="royalblue";e.breadcrumb="#3087B3";e.separator="cornflowerblue";e.bannerProgress="#F2F2F2";this.styles.push(e);e=new f;e.name="Vanilla Skies";e.navbar="sandybrown";e.button="lemmonchiffon";e.location="cornsilk";e.selection="lemonchiffon";e.sidepanel="white";e.mainpanel="white";e.toolpanel=
"white";e.navtext="lemonchiffon";e.content="chocolate";e.search="moccasin";e.breadcrumb="#3087B3";e.separator="sandybrown";e.bannerProgress="#F2F2F2";this.styles.push(e);e=new f;e.name="Beetlejuice";e.navbar="indigo";e.button="slateblue";e.location="darkslateblue";e.selection="silver";e.sidepanel="lavender";e.mainpanel="white";e.toolpanel="white";e.navtext="#FBFBFB";e.content="mediumslateblue";e.search="#444";e.breadcrumb="#3087B3";e.separator="indigo";e.bannerProgress="#F2F2F2";this.styles.push(e);
e=new f;e.name="Red";e.navbar="#CD2127";e.button="#777777";e.location="#D85F56";e.selection="lightcoral";e.sidepanel="#EFDAB2";e.mainpanel="#FDFADD";e.toolpanel="#FDFADD";e.navtext="#FBFBFB";e.content="darkred";e.search="#D85F56";e.breadcrumb="darkred";e.separator="#CD2127";e.bannerProgress="#F2F2F2";this.styles.push(e)}function g(){return this.styles}f.prototype.name="Orion";f.prototype.navbar="#404648";f.prototype.button="#EFEFEF";f.prototype.location="#333";f.prototype.breadcrumb="#3087B3";f.prototype.separator=
"#333";f.prototype.selection="FEC";f.prototype.sidepanel="#FBFBFB";f.prototype.mainpanel="white";f.prototype.toolpanel="white";f.prototype.navtext="#bfbfbf";f.prototype.content="#3087B3";f.prototype.search="#444";f.prototype.bannerProgress="white";d.prototype.styles=[];d.prototype.getStyles=g;d.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion2014",selectedKey:"selected",version:"5.0"}};d.prototype.getViewData=function(){var e={top:10,left:10,
width:350,height:350};e.shapes=[{type:"RECTANGLE",name:k["Navigation Bar"],x:10,y:10,width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:k["Navigation Text"],label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:k["Search Box"],x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:k["Tool Panel"],x:150,y:71,width:209,height:30,family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",
name:k["Selection Bar"],x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},{type:"RECTANGLE",name:k.Location,x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:k["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:k.Content,label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"TEXT",name:k.Content,label:"/",x:78,y:60,family:"content",
fill:"#3087B3",font:"8pt sans-serif",order:9},{type:"TEXT",name:k.Content,label:"Location",x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:k["Main Panel"],x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:k.Button,x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:k["Button Text"],label:"Button",x:158,y:90,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"TRIANGLE",
name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:k["Section Text"],label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:k["Line Color"],x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:k["Line Color"],x1:150,y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:k["Line Color"],
x1:20,y1:100,x2:140,y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:k["Side Panel"],x:10,y:71,width:140,height:289,family:"sidepanel",fill:"#FBFBFB",order:12},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:k["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},
{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"}];for(var c=0;3>c;c++)e.shapes.push({type:"TEXT",name:k.Content,label:"org.eclipse.orion.content",x:170,y:127+20*c,fill:"#3087B3",family:"content"});for(c=0;3>c;c++)e.shapes.push({type:"TEXT",name:k.Content,label:"Item",x:25,y:115+20*c,fill:"#3087B3",family:"content"});for(c=0;3>c;c++)e.shapes.push({type:"TRIANGLE",
name:"twisty",x1:160,y1:121+20*c,x2:165,y2:124+20*c,x3:160,y3:127+20*c,family:"navbar",fill:"#333"});e.shapes.push({type:"IMAGE",name:"logo",x:15,y:18,source:"../../images/orion-transparent.png",family:"logo"});return e};d.prototype.processSettings=function(e){var c=new h.ThemeSheetWriter;(new l.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",c.getSheet(e))};return{ThemeData:d,getStyles:g}});
define("orion/widgets/nls/root/messages",{"no input":"no input","no output":"no output","Choose a Folder":"Choose a Folder",OK:"OK",Profile:"Profile","Sign out":"Sign out","N/A":"N/A","logged in since ":"logged in since ","Sign in":"Sign in","Authentication required!":"Authentication required!","Name:":"Name:","Plug-ins":"Plug-ins"," \x3cNo available services or timed out, check URL and try reloading\x3e":" \x3cNo available services or timed out, check URL and try reloading\x3e",Properties:"Properties",
" (Service Id: ":" (Service Id: ",Services:"Services","SFTP Transfer":"SFTP Transfer","Remote host:":"Remote host:","Port:":"SFTP Port:","Remote path:":"Remote path:","User name:":"User name:","Password:":"Password:","Start Transfer":"Start Transfer","Location:":"Location:","orion.sftpConnections":"orion.sftpConnections","Drag a file here":"Drag a file here","unzip zips":"Unzip *.zip files","or if you prefer":"(or upload a file using the buttons below)",Upload:"Upload","Browse...":"Browse...","Import a file or zip":"Import a file or zip",
"Missing required argument: searchRenderer":"Missing required argument: searchRenderer","Missing required argument: favService":"Missing required argument: favService","Find File Named":"Find File Named","Type the name of a file to open (? \x3d any character, * \x3d any string):":"Type the name of a file to open (? \x3d any character, * \x3d any string):",Search:"Search","FileName FolderName":"FileName FolderName(Optional)","Searching...":"Searching...","Searching for occurrences of":'Searching for occurrences of: "${0}"',
name:"name","orion.widgets.UserMenu":"orion.widgets.UserMenu",test:"test","Sign Out":"Sign Out","Sign Out ":"Sign Out ","\x3c/a\x3e":"\x3c/a\x3e","\x3e":"\x3e","Sign In To ":"Sign In To ","Sign In":"Sign In",Help:"Help","Report a Bug":"Report a Bug","Keyboard Shortcuts":"Keyboard Shortcuts",Settings:"Settings","View profile of ":"View profile of ",Profiles:"Profiles","Information Needed":"Information Needed",Cancel:"Cancel","If the same file exists in both the source and destination:":"If the same file exists in both the source and destination:",
"Cancel the transfer":"Cancel the transfer","Always overwrite destination":"Always overwrite destination","Overwrite if source is newer":"Overwrite if source is newer",New:"New","Building file skeleton...":"Building file skeleton...",Add:"Add","Upload...":"Upload...","For a list of available commands type '${0}'.":"For a list of available commands type '${0}'.","Main Pages":"Main Pages","Related Links":"Related Links"});
define("orion/widgets/nls/messages",["orion/i18n!orion/widgets/nls/messages","orion/widgets/nls/root/messages"],function(k,l){var h={root:l};Object.keys(k).forEach(function(f){"undefined"===typeof h[f]&&(h[f]=k[f])});return h});
define("orion/widgets/userAssistance/UATaskPanel",["orion/webui/littlelib"],function(k){function l(h,f,d){this.elements=d;this.taskPanel=document.createElement("div");this.taskPanel.className="UAContainer";this.taskPanel.innerHTML='\x3cheader class\x3d"UAHeader"\x3eDevelop software from within the cloud\x3c/header\x3e';this.elementNode=document.createElement("div");this.switchesContainer=document.createElement("div");this.switches=document.createElement("span");this.radioButtons=[];this.elementNode.className=
"UAContainer-body";this.taskPanel.appendChild(this.elementNode);this.switchesContainer.className="UAContainer-switch-body";this.switches.className="UAContainer-switches";this.switchesContainer.innerHTML="";this.switchesContainer.appendChild(this.switches);this.taskPanel.appendChild(this.switchesContainer);!0===f?(this.container=document.createElement("div"),this.container.className="UAModal",this.container.appendChild(this.taskPanel),this.backdrop=document.createElement("div"),this.backdrop.className=
"UAModalBackground",document.body.appendChild(this.backdrop),document.body.appendChild(this.container),k.addAutoDismiss([this.container],this.destroy.bind(this))):h.appendChild(this.taskPanel);this.chosenSwitch=this.createSwitch(null,!0);this.chosenSwitch.firstChild.className="chosenCircle";this.initialize();this.elements.forEach(this.createSwitch.bind(this))}l.prototype.elementNode=null;l.prototype.switchesContainer=null;l.prototype.switches=null;l.prototype.radioButtons=null;l.prototype.chosenSwitch=
null;l.prototype.addElement=function(h){var f=document.createElement("span");f.className="UAContainer-icon";f.innerHTML='\x3cspan class\x3d"workingSpan"\x3e\x3cimg src\x3d"'+h.image+'" id\x3d"'+h.label+'ImageNode" alt\x3d"'+h.alt+'" height\x3d"64" width\x3d"64"\x3e\x3c/span\x3e\x3cspan class\x3d"UAIcon-label"\x3e\x3cspan class\x3d"UALabel" id\x3d"'+h.label+'LabelNode" \x3e'+h.label+"\x3c/span\x3e\x3c/span\x3e";f.onmouseover=function(){document.getElementById(h.label+"ImageNode").src=h.secondaryImage;
document.getElementById(h.label+"LabelNode").className="UALabel-live";f.className="UAContainer-icon-live"};f.onmouseout=function(){document.getElementById(h.label+"ImageNode").src=h.image;document.getElementById(h.label+"LabelNode").className="UALabel";f.className="UAContainer-icon"};var d=this;f.onclick=function(){d.showMedia(h)};this.elementNode.appendChild(f)};l.prototype.clearElements=function(){this.elementNode.innerHTML=""};l.prototype.showMedia=function(h){this.clearElements();this.addElement(h);
var f=document.createElement("span");f.className="UAContainer-media";f.innerHTML='\x3cdiv\x3e\x3c/div\x3e\x3cdiv\x3e\x3c/div\x3e\x3cspan class\x3d"mediaSpan"\x3e\x3cimg src\x3d"'+h.media+'" alt\x3d"'+h.alt+'" height\x3d"300" width\x3d"400"\x3e\x3c/span\x3e';this.elementNode.appendChild(f);setTimeout(function(){f.style.opacity=1},100);h=document.getElementById(h.label+"switch");this.chosenSwitch.firstChild.className="circle";this.chosenSwitch=h.parentNode;h.className="chosenCircle"};l.prototype.createSwitch=
function(h){var f;f=h?h.label+"switch":"indexSwitch";var d=document.createElement("span");d.className="workingSpan";d.innerHTML='\x3cdiv class\x3d"circle" id \x3d"'+f+'"\x3e\x3c/div\x3e';var g=this;d.onclick=h?function(){g.showMedia(h)}:function(){g.initialize();g.chosenSwitch.firstChild.className="circle";g.chosenSwitch=d;g.chosenSwitch.firstChild.className="chosenCircle"};this.switches.appendChild(d);return this.radioButtons[this.radioButtons.length]=d};l.prototype.initialize=function(){this.clearElements();
this.elements.forEach(this.addElement.bind(this))};l.prototype.destroy=function(){document.body.removeChild(this.backdrop);document.body.removeChild(this.container)};return l});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(k,l,h,f){function d(){}var g=null;d.prototype={DISABLED:"disabled",CONTAINERTEMPLATE:'\x3cdiv class\x3d"dialog" role\x3d"dialog"\x3e\x3cdiv class\x3d"dialogTitle"\x3e\x3cspan id\x3d"title" class\x3d"dialogTitleText layoutLeft"\x3e\x3c/span\x3e\x3cbutton aria-label\x3d"Close" class\x3d"dismissButton layoutRight core-sprite-close imageSprite" id\x3d"closeDialog"\x3e\x3c/button\x3e\x3c/div\x3e\x3cdiv id\x3d"dialogContent" class\x3d"dialogContent layoutBlock"\x3e\x3c/div\x3e\x3cdiv id\x3d"buttons" class\x3d"dialogButtons"\x3e\x3c/div\x3e\x3c/div\x3e',_initialize:function(){var e=
document.body;this.$frameParent=e;this.$$modalExclusions=this.$$modalExclusions||[];var c=document.createRange();c.selectNode(e);c=c.createContextualFragment(this.CONTAINERTEMPLATE);e.appendChild(c);this.$frame=e.lastChild;this.title&&h.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=h.$("#closeDialog",this.$frame);var b=this;this.$close.addEventListener("click",function(c){b.hide()},!1);this.$parent=h.$(".dialogContent",this.$frame);c=document.createRange();c.selectNode(this.$parent);
e=c.createContextualFragment(this.TEMPLATE);this.messages&&h.processTextNodes(e,this.messages);this.$parent.appendChild(e);this.$buttonContainer=h.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(c){c.keyCode===h.KEY.ESCAPE?b.hide():c.keyCode===h.KEY.ENTER&&"function"===typeof b._defaultCallback&&b._defaultCallback()},!1);this._bindElements(this.$parent);"function"===typeof this._bindToDom&&this._bindToDom(this.$parent);this.modal&&this._makeModal()},
_makeButtons:function(){if(this.$buttonContainer&&Array.isArray(this.buttons)){var e=this;this.buttons.forEach(function(c){var b=f.createButton(c.text,c.callback);c.id&&(b.id=c.id,e["$"+b.id]=b);c.isDefault&&(e._defaultCallback=c.callback,e._defaultButton=b);e.$buttonContainer.appendChild(b)})}},_makeModal:function(e){var c=this;this.$frame.addEventListener("blur",function(a){c.$lastFocusedElement=a.target},!0);this._modalListener=function(a){var b=!h.contains(c.$frame,a.target);if(b)for(var e=0;e<
c.$$modalExclusions.length;e++)if(h.contains(c.$$modalExclusions[e],a.target)){b=!1;break}b&&(window.setTimeout(function(){(c.$lastFocusedElement||c.$parent).focus()},0),h.stop(a))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);e=this.$frameParent.childNodes;var b=!1;this._addedBackdrop=[];for(var d=0;d<e.length;d++){for(var a=0;a<this.$$modalExclusions.length;a++)if(h.contains(this.$$modalExclusions[a],e[d])){b=
!0;break}!b&&e[d]!==c.$frame&&e[d].classList&&!e[d].classList.contains("tooltipContainer")&&(a=e[d],a.classList.contains("modalBackdrop")||(a.classList.add("modalBackdrop"),this._addedBackdrop.push(a)))}(e=h.lastTabbable(this.$buttonContainer)||h.lastTabbable(this.$parent))&&e.addEventListener("keydown",function(a){if(a.keyCode===h.KEY.TAB){var b=c._getFirstFocusField();b&&b!==a.target&&b.focus();h.stop(a)}},!1)},_addChildDialog:function(e){this.$$modalExclusions.push(e.$frame||e.$parent)},_inModalExclusion:function(e){return this.$$modalExclusions.some(function(c){return e.$frame===
c||e.$parent===c})},_bindElements:function(e){for(var c=0;c<e.childNodes.length;c++){var b=e.childNodes[c];b.id&&(this["$"+b.id]=b);this._bindElements(b)}},hide:function(e){!e&&g===this&&(g=null);"function"===typeof this._beforeHiding&&this._beforeHiding();this._modalListener&&(this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0));this.$frame.classList.remove("dialogShowing");h.setFramesEnabled(!0);"function"===
typeof this._afterHiding&&this._afterHiding();var c=this;this.keepAlive||window.setTimeout(function(){c.destroy()},0)},show:function(e){if(this.modal)if(g){if(!g._inModalExclusion(this)){this.hide(!0);return}}else g=this;"function"===typeof this._beforeShowing&&this._beforeShowing();h.setFramesEnabled(!1);var c=h.bounds(this.$frame),b=h.bounds(document.documentElement),d;e?(d=h.bounds(e),e=d.top+d.height+4,d=d.left+4,e+c.height>b.height&&(e=Math.max(0,b.height-c.height-4)),d+c.width>b.width&&(d=Math.max(0,
b.width-c.width-4))):(d=Math.max(0,(b.width-c.width)/2),e=Math.max(0,(b.height-c.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=e+"px";this.$frame.style.left=d+"px";this.$frame.classList.add("dialogShowing");"function"===typeof this._afterShowing&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return h.firstTabbable(this.$parent)||this._defaultButton||h.firstTabbable(this.$buttonContainer)||this.$close},
destroy:function(){this.$frame&&(g===this&&(g=null),h.setFramesEnabled(!0),this._addedBackdrop&&0<this._addedBackdrop.length&&this._addedBackdrop.forEach(function(e){e.classList.remove("modalBackdrop")}),this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0),this.$frameParent.removeChild(this.$frame),this.$parent=this.$frame=void 0)}};d.prototype.constructor=d;return{Dialog:d}});
define("orion/widgets/UserMenu","i18n!orion/widgets/nls/messages require orion/webui/littlelib orion/PageLinks orion/widgets/userAssistance/UATaskPanel orion/webui/dialog orion/webui/dropdown".split(" "),function(k,l,h,f,d,g,e){function c(b){this._displaySignOut=!0;this._init(b)}c.prototype={_init:function(b){this._dropdownNode=h.node(b.dropdownNode);if(!this._dropdownNode)throw"no dom node for dropdown found";this._dropdown=b.dropdown;this._serviceRegistry=b.serviceRegistry;this.authenticatedServices=
{};this.unauthenticatedServices={};this._noSeparator=b.noSeparator;this._dropDownItemClass=b.dropDownItemClass;this._keyAssistClass=b.keyAssistClass;void 0!==b.signOut&&(this._displaySignOut=b.signOut)},isSingleService:function(){return 1===this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)},hasServices:function(){return 0<this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)},length:function(b){var c=0,a;for(a in b)b.hasOwnProperty(a)&&c++;
return c},_makeMenuItem:function(b,c){var a=e.createMenuItem(b).firstElementChild;"string"===typeof this._dropDownItemClass&&""!==this._dropDownItemClass&&a.classList.add(this._dropDownItemClass);a.addEventListener("click",c,!1);a.addEventListener("keydown",function(a){(a.keyCode===h.KEY.ENTER||a.keyCode===h.KEY.SPACE)&&c()},!1);return a},_renderAuthenticatedService:function(b,c){var a=this,e=this.authenticatedServices[b].authService;if(e&&e.logout&&this._displaySignOut){var d=this._makeMenuItem(k["Sign Out"],
function(){e.logout().then(function(){a.addUserItem(b,e,a.authenticatedServices[b].label);localStorage.removeItem(b);localStorage.removeItem("lastLogin");for(var c=localStorage.length-1;0<=c;c--){var d=localStorage.key(c);d&&0===d.indexOf("/orion/preferences/user")&&localStorage.removeItem(d)}e.getAuthForm(window.location.href).then(function(a){window.location=a})})});this._dropdownNode.appendChild(d.parentNode)}},renderServices:function(){function b(b){a[b]||(a[b]=c.createDocumentFragment());return a[b]}
var c=document,a=[],d=this._serviceRegistry;f.getPageLinksInfo(d,"orion.page.link.user").then(function(f){this._dropdown?this._dropdown.empty():this._dropdownNode&&h.empty(this._dropdownNode);f.getAllLinks().forEach(function(a){var e,d;if(a.category&&(d=/user\.(\d+)/.exec(a.category)))e=parseInt(d[1],10);if("number"!==typeof e||isNaN(e))e=1;e=b(e);d=c.createElement("li");var n=c.createElement("a");n.role="menuitem";"string"===typeof this._dropDownItemClass?""!==this._dropDownItemClass&&n.classList.add(this._dropDownItemClass):
n.classList.add("dropdownMenuItem");n.href=a.href;n.textContent=a.textContent;d.appendChild(n);e.appendChild(d);n.addEventListener("keydown",function(a){(a.keyCode===h.KEY.ENTER||a.keyCode===h.KEY.SPACE)&&n.click()},!1)}.bind(this));this.keyAssistFunction&&(f=this._makeMenuItem(k["Keyboard Shortcuts"],this.keyAssistFunction),"string"===typeof this._keyAssistClass?""!==this._keyAssistClass&&f.classList.add(this._keyAssistClass):f.classList.add("key-assist-menuitem"),f=f.parentNode,b(0).appendChild(f));
if(f=d.getServiceReferences("orion.page.getstarted")[0])f=f.getProperty("data"),f=this._makeMenuItem("Getting Started",this.getStartedDialog.bind(this,f)).parentNode,b(0).appendChild(f);var g=this;a.sort(function(a,b){return a-b}).forEach(function(b,c){if(c<a.length-1&&!this._noSeparator){var d=e.createSeparator();b.appendChild(d)}g._dropdownNode.appendChild(b)}.bind(this));if(this.isSingleService())for(var s in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(s)&&this._renderAuthenticatedService(s,
0)}.bind(this))},getStartedDialog:function(b){new d(null,!0,b)},setKeyAssist:function(b){this.keyAssistFunction=b;this.renderServices()},addUserItem:function(b,c,a,e){e?(this.unauthenticatedServices[b]&&delete this.unauthenticatedServices[b],this.authenticatedServices[b]={authService:c,label:a,data:e}):(this.authenticatedServices[b]&&delete this.authenticatedServices[b],this.unauthenticatedServices[b]=this.unauthenticatedServices[b]?{authService:c,label:a,pending:this.unauthenticatedServices[b].pending}:
{authService:c,label:a});this.renderServices()}};c.prototype.constructor=c;return{UserMenu:c}});
define("orion/crawler/nls/root/messages",{"Searching file:":"Searching file:","is not supported in this file system":"is not supported in this file system","${0} files found out of ${1}":"${0} files found out of ${1}","The search term on this location will not use indexed files.":"The search term on this location will not use indexed files.","It will take longer time. Do you want to proceed?":"It will take longer time. Do you want to proceed?","Search cancelled by user":"Search cancelled by user",
Cancel:"Cancel"});define("orion/crawler/nls/messages",["orion/i18n!orion/crawler/nls/messages","orion/crawler/nls/root/messages"],function(k,l){var h={root:l};Object.keys(k).forEach(function(f){"undefined"===typeof h[f]&&(h[f]=k[f])});return h});
define("orion/searchUtils","i18n!orion/nls/messages require orion/regex orion/commandRegistry orion/PageUtil orion/URITemplate".split(" "),function(k,l,h,f,d,g){function e(b,c,a){var e="";a&&(e="^");if(e=h.parse("/"+e+b.searchStr+"/"))a=e.pattern,e=e.flags,-1===e.indexOf("i")&&!c.caseSensitive&&(e+="i"),b.regExp={pattern:a,flags:e},b.wildCard=!0}var c={ALL_FILE_TYPE:"*.*",doSearch:function(b,e,a,d){if(b){var f=!0;"*"===a&&(a="");""===a&&(f=d&&d.type!==c.ALL_FILE_TYPE);f&&(""!==a&&c.addRecentSearch(e,
a,d?d.regEx:!1),b=b.createSearchParams(a,!1,!1,d),b=c.generateSearchHref(b),window.location=b)}else window.alert(k["Can't search: no search service is available"])},generateSearchHelper:function(b,d){var a=b.keyword,n=a,f={};b.fileType&&b.fileType!==c.ALL_FILE_TYPE&&""===a&&(n="*."+b.fileType);if(b.regEx)f.searchStr=a,e(f,b,d);else{var g=-1<a.indexOf("*"),h=-1<a.indexOf("?");g&&(a=a.split("*").join(".*"));h&&(a=a.split("?").join("."));!g&&!h&&!b.nameSearch?(f.searchStr=b.caseSensitive?a.split("\\").join(""):
a.split("\\").join("").toLowerCase(),f.wildCard=!1):(f.searchStr=b.caseSensitive?a:a.toLowerCase(),e(f,b,d),f.wildCard=!0)}f.searchStrLength=f.searchStr.length;return{params:b,inFileQuery:f,displayedSearchTerm:n}},convertSearchParams:function(b){void 0!==b.rows&&(b.rows=parseInt(b.rows,10));void 0!==b.start&&(b.start=parseInt(b.start,10));"string"===typeof b.regEx&&(b.regEx="true"===b.regEx.toLowerCase());"string"===typeof b.caseSensitive&&(b.caseSensitive="true"===b.caseSensitive.toLowerCase());
"string"===typeof b.nameSearch&&(b.nameSearch="true"===b.nameSearch.toLowerCase())},copySearchParams:function(b,c){var a={},e;for(e in b)if(void 0!==b[e]&&null!==b[e]&&(c||"replace"!==e))a[e]=b[e];return a},generateSearchHref:function(b){var e=l.toUrl("search/search.html");b=c.copySearchParams(b,!0);var a=b.resource;b.resource=void 0;return"undefined"!==typeof b.keyword?(new g(e+"#{,resource,params*}")).expand({resource:a,params:b}):(new g(e+"#{,resource}")).expand({resource:a})},generateFindURLBinding:function(b,
c,a,e,d){b={find:c.searchStr,regEx:c.wildCard?!0:void 0,caseSensitive:b.caseSensitive?!0:void 0,replaceWith:"string"===typeof e?e:void 0,atLine:"number"===typeof a?a:void 0};return d?b:","+(new g("{,params*}")).expand({params:b})},convertFindURLBinding:function(b){"string"===typeof b.regEx&&(b.regEx="true"===b.regEx.toLowerCase());"string"===typeof b.caseSensitive&&(b.caseSensitive="true"===b.caseSensitive.toLowerCase());"string"===typeof b.atLine&&(b.atLine=parseInt(b.atLine,10))},replaceRegEx:function(b,
c,a){return b.replace(RegExp(c.pattern,c.flags),a)},replaceStringLiteral:function(b,e,a){e=h.parse("/"+e+"/gim");return c.replaceRegEx(b,e,a)},searchOnelineLiteral:function(b,c,a){var e;e=0;for(var d=!1,f=[];!(e=c.indexOf(b.searchStr,e),0>e);){f.push({startIndex:e,length:b.searchStrLength});d=!0;if(a)break;e+=b.searchStrLength}return d?f:null},findRegExp:function(b,c,a,e){if(!c)return null;a=a||"";a+=(-1===a.indexOf("g")?"g":"")+(-1===a.indexOf("m")?"m":"");var d=null;return(d=RegExp(c,a).exec(b.substring(e)))&&
{startIndex:d.index+e,length:d[0].length}},searchOnelineRegEx:function(b,e,a){for(var d=0,f=!1,g=[];;)if(d=c.findRegExp(e,b.regExp.pattern,b.regExp.flags,d)){g.push(d);f=!0;if(a)break;d=d.startIndex+d.length}else break;return f?g:null},generateNewContents:function(b,e,a,d,f,g){if(d&&e){b||(a.contents=[]);for(var h=0;h<e.length;h++){for(var k=e[h],l=!1,v=!1,u=[],z,x=0,A=0;A<d.children.length;A++)if(d.children[A].lineNumber-1===h){x=A;for(l=0;l<d.children[A].matches.length;l++)!1!==d.children[A+l].checked&&
u.push(l);v=0<u.length;z=d.children[A].matches;l=!0;break}if(l){if(v){u=c.replaceCheckedMatches(k,f,z,u,g);k=u.replacedStr;for(l=0;l<d.children[x].matches.length;l++)d.children[x+l].newMatches=u.newMatches}else for(l=0;l<d.children[x].matches.length;l++)d.children[x+l].newMatches=d.children[x+l].matches;b?a.contents[h]=k:a.contents.push(k)}else b||a.contents.push(k)}}},generateMatchContext:function(b,c,a){var e=[],d=2*b+1,f;c.length<=d?(f=0,b=c.length-1):(f=a-b,0>f?(f=0,b=f+d-1):(b=a+b,b>c.length-
1&&(b=c.length-1,f=b-d+1)));for(d=f;d<=b;d++)e.push({context:c[d],current:d===a});return e},splitFile:function(b){for(var c=0,a=0,e=0,d=0,f=[];;){-1!==c&&c<=e&&(c=b.indexOf("\r",e));-1!==a&&a<=e&&(a=b.indexOf("\n",e));if(-1===a&&-1===c){f.push(b.substring(d));break}var g=1;-1!==c&&-1!==a?c+1===a?(g=2,e=a+1):e=(c<a?c:a)+1:e=-1!==c?c+1:a+1;f.push(b.substring(d,e-g));d=e}return f},searchWithinFile:function(b,e,a,d,f,g){a=c.splitFile(a);f&&(e.contents=a);if(e){e.children=[];for(var h=d=0;h<a.length;h++){var k=
a[h];if(k&&0<k.length){var l=g?k:k.toLowerCase();if(l=b.wildCard?c.searchOnelineRegEx(b,l):c.searchOnelineLiteral(b,l)){var v,u=h+1;if(f)for(var z=0;z<l.length;z++)v=z+1,v={parent:e,checked:e.checked,type:"detail",matches:l,lineNumber:u,matchNumber:v,name:k,location:e.location+"-"+u+"-"+v},e.children.push(v);else v={parent:e,context:c.generateMatchContext(2,a,h),checked:e.checked,type:"detail",matches:l,lineNumber:u,name:k,location:e.location+"-"+u},e.children.push(v);d+=l.length}}}e.totalMatches=
d}},replaceCheckedMatches:function(b,c,a,e,d){for(var f=0,g="",h=[],k=0;k<a.length;k++){f!==a[k].startIndex&&(g+=b.substring(f,a[k].startIndex));a[k].length&&(d=a[k].length);for(var f=!1,l=0;l<e.length;l++)if(e[l]===k){f=!0;break}f?(h.push({startIndex:g.length,length:c.length}),g+=c):(h.push({startIndex:g.length,length:d}),g+=b.substring(a[k].startIndex,a[k].startIndex+d));f=a[k].startIndex+d}f<b.length&&(g+=b.substring(f));return{replacedStr:g,newMatches:h}},fullPathNameByMeta:function(b){var c=
b.length,a="";if(0<c)for(c-=1;-1<c;c--)a=a+(""===a?"":"/")+b[c].Name;return a},path2FolderName:function(b,c,a){return b.substring(0,b.length-c.length-(a?0:1))},_storeRecentSearch:function(b,c,a,e){b.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){b.put("recentSearch",c);a&&window.setTimeout(function(){a.dispatchEvent({type:"inputDataListChanged",deleting:e})}.bind(this),20)})},addRecentSearch:function(b,e,a){"string"===typeof e&&e&&b.getService("orion.core.preference").getPreferences("/window/favorites").then(function(d){var f;
d=d.get("recentSearch");"string"===typeof d&&(d=JSON.parse(d));if(d){for(f in d)if(d[f].name===e)return;20<=d.length&&d.splice(19,d.length-20+1)}else d=[];d.splice(0,0,{name:e,regEx:a});c._storeRecentSearch(b,d)})},removeRecentSearch:function(b,e,a){"string"===typeof e&&e&&b.getService("orion.core.preference").getPreferences("/window/favorites").then(function(d){var f;d=d.get("recentSearch");"string"===typeof d&&(d=JSON.parse(d));if(d)for(f in d)if(d[f].name===e){d.splice(f,1);c._storeRecentSearch(b,
d,a,!0);break}})},getSearches:function(b,c,a){b.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){b=b.get(c);"string"===typeof b&&(b=JSON.parse(b));b&&a&&a(b)})},getMixedSearches:function(b,e,a,d){b.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){var f=b.get("recentSearch");"string"===typeof f&&(f=JSON.parse(f));e&&(b=b.get("search"),"string"===typeof b&&(b=JSON.parse(b)),b&&b.forEach(function(b){if(a){var e=c.parseQueryStr(b.query);
f.some(function(a){return e.searchStrTitle===a.name})||f.push({name:e.searchStrTitle,label:b.name})}else f.push({name:null,label:b.name,value:b.query})}));f&&d&&d(f)})},getOpenSearchPref:function(b,c){b.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(a){a=a.get("nav.config");c(a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?!0:!1:!1)})},setOpenSearchPref:function(b,c){b.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("openSearchPref",
{openInNewTab:c})})}};return c});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages require orion/i18nUtil orion/searchUtils orion/contentTypes orion/Deferred".split(" "),function(k,l,h,f,d,g){function e(c,b,e,a){this.registry=c;this.fileClient=b;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=a&&a.searchOnName;this._buildSkeletonOnly=a&&a.buildSkeletonOnly;this._fetchChildrenCallBack=a&&a.fetchChildrenCallBack;this._searchParams=e;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:f.generateSearchHelper(e);this._location=a&&a.location;this._childrenLocation=a&&a.childrenLocation?a.childrenLocation:this._location;this._reportOnCancel=a&&a.reportOnCancel;this._cancelled=!1;this._statusService=this.registry.getService("orion.page.message");this._progressService=this.registry.getService("orion.page.progress");this._statusService&&this._statusService.setCancelFunction(function(){this._cancelFileContentsSearch()}.bind(this))}e.prototype.search=function(c){var b=
this.registry.getService("orion.core.contentTypeRegistry");this._onSearchComplete=c;this._cancelled=!1;this._deferredArray=[];b.getContentTypes().then(function(b){this.contentTypesCache=b;var a=this;this._visitRecursively(this._childrenLocation).then(function(){(!a._cancelled||a._reportOnCancel)&&a._reportResult();a._cancelled&&a._HandleStatus({name:"Cancel"})}.bind(a),function(b){a._reportResult();a._HandleStatus(b)}.bind(a))}.bind(this))};e.prototype.searchName=function(c,b){c&&(this._searchParams=
c,this.searchHelper=f.generateSearchHelper(c,!0));b&&(this.onSearchNameComplete=b);var e=[];this._cancelled=!1;this._deferredArray=[];this._sort(this.fileSkeleton);if(0<this.fileSkeleton.length){for(var a=0;a<this.fileSkeleton.length;a++){var d=this.fileSkeleton[a].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?f.searchOnelineRegEx(this.searchHelper.inFileQuery,d,!0):f.searchOnelineLiteral(this.searchHelper.inFileQuery,d,!0))if(e.push(this.fileSkeleton[a]),e.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:e.length,
docs:e}})}else this.onSearchNameComplete({response:{numFound:0,docs:[]}})};e.prototype.buildSkeleton=function(c,b){this._buildingSkeleton=!0;var e=this.registry.getService("orion.core.contentTypeRegistry");this._cancelled=!1;this._deferredArray=[];var a=this;c();e.getContentTypes().then(function(c){a.contentTypesCache=c;a._visitRecursively(a._childrenLocation).then(function(){a._buildingSkeleton=!1;b();a.searchHelper&&!a._buildSkeletonOnly&&a.searchName()})})};e.prototype._sort=function(c){c.sort(function(b,
c){var a,e;if("Path asc"===this._searchParams.sort){a=b.Location&&b.Location.toLowerCase();a=f.path2FolderName(a,b.Name&&b.Name.toLowerCase(),!0);e=c.Location&&c.Location.toLowerCase();e=f.path2FolderName(e,c.Name&&c.Name.toLowerCase(),!0);if(a<e)return-1;if(a>e)return 1}return this._sortOnNameSingle(b,c)}.bind(this))};e.prototype._HandleStatus=function(c){this._statusService&&"Cancel"===c.name&&(console.log("Crawling search cancelled. Deferred array length : "+this._deferredArray.length),this._statusService.setProgressResult({Message:k["Search cancelled by user"],
Severity:"Warning"}))};e.prototype._reportResult=function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}})};e.prototype._sortOnNameSingle=function(c,b){var e=c.Name&&c.Name.toLowerCase(),a=b.Name&&b.Name.toLowerCase();return e<a?-1:e>a?1:0};e.prototype._onFileType=function(c){return this.searchHelper.params.fileType?this.searchHelper.params.fileType===f.ALL_FILE_TYPE?!0:0<=c.extension.indexOf(this.searchHelper.params.fileType):
!0};e.prototype._visitRecursively=function(c){var b=[],e=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(c);return(e._progressService?this._progressService.progress(e.fileClient.fetchChildren(c),"Crawling search for children of "+c):e.fileClient.fetchChildren(c)).then(function(a){for(var c=0;c<a.length;c++)if(void 0!==a[c].Directory&&!1===a[c].Directory)if(e._searchOnName)b.push(e._buildSingleSkeleton(a[c]));else if(e._buildSkeletonOnly)b.push(e._buildSingleSkeleton(a[c]));else{if(!e._cancelled){var f=
d.getFilenameContentType(a[c].Name,e.contentTypesCache);if(f&&("text/plain"===f["extends"]||"text/plain"===f.id)&&e._onFileType(f))f=e._sniffSearch(a[c]),b.push(f),e._deferredArray.push(f)}}else if(a[c].Location)if(e._cancelled)break;else f=e._visitRecursively(a[c].ChildrenLocation),b.push(f),e._deferredArray.push(f);return g.all(b)})};e.prototype._hitOnceWithinFile=function(c){c=this._searchParams.caseSensitive?c:c.toLowerCase();return this.searchHelper.inFileQuery.wildCard?f.searchOnelineRegEx(this.searchHelper.inFileQuery,
c,!0):f.searchOnelineLiteral(this.searchHelper.inFileQuery,c,!0)};e.prototype._reportSingleHit=function(c){this._cancelled||(c.LastModified=c.LocalTimeStamp,this.fileLocations.push(c),this._hitCounter++,this._sort(this.fileLocations),this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}},!0))};e.prototype._cancelFileContentsSearch=function(){(this._cancelled=!0)&&this._deferredArray.forEach(function(c){c.cancel()})};e.prototype._sniffSearch=function(c){this._totalCounter++;
var b=this;if(!this._cancelled)if(""===this.searchHelper.params.keyword)this._reportSingleHit(c),this._statusService&&this._statusService.setProgressResult({Message:h.formatMessage(k["${0} files found out of ${1}"],this._hitCounter,this._totalCounter)});else return(b._progressService?b._progressService.progress(b.fileClient.read(c.Location),"Reading file "+c.Location):b.fileClient.read(c.Location)).then(function(e){b._hitOnceWithinFile(e)&&b._reportSingleHit(c);b._statusService&&b._statusService.setProgressResult({Message:h.formatMessage(k["${0} files found out of ${1}"],
b._hitCounter,b._totalCounter)},k.Cancel)},function(b){b&&b.message&&"cancel"!==b.message.toLowerCase()&&console.error("Error loading file content: "+b.message)})};e.prototype._buildSingleSkeleton=function(c){this._totalCounter++;this.fileSkeleton.push(c);this.searchHelper&&!this._buildSkeletonOnly&&0===this._totalCounter%100&&this.searchName();c=new g;c.resolve(this._totalCounter);return c};e.prototype.constructor=e;return{SearchCrawler:e}});
define("orion/webui/dialogs/OpenResourceDialog","i18n!orion/widgets/nls/messages orion/crawler/searchCrawler orion/contentTypes require orion/webui/littlelib orion/util orion/webui/dialog".split(" "),function(k,l,h,f,d,g,e){function c(b){this._init(b)}c.prototype=new e.Dialog;c.prototype.TEMPLATE='\x3cdiv role\x3d"search"\x3e\x3cdiv\x3e\x3clabel id\x3d"fileNameMessage" for\x3d"fileName"\x3e${Type the name of a file to open (? \x3d any character, * \x3d any string):}\x3c/label\x3e\x3c/div\x3e\x3cdiv\x3e\x3cinput id\x3d"fileName" type\x3d"text" class\x3d"setting-control" style\x3d"width:90%;"/\x3e\x3c/div\x3e\x3cdiv id\x3d"progress" style\x3d"padding: 2px 0 0; width: 100%;"\x3e\x3cimg src\x3d"'+
f.toUrl("../../../images/progress_running.gif")+'" class\x3d"progressPane_running_dialog" id\x3d"crawlingProgress"\x3e\x3c/img\x3e\x3c/div\x3e\x3cdiv id\x3d"results" style\x3d"max-height:250px; height:auto; overflow-y:auto;" aria-live\x3d"off"\x3e\x3c/div\x3e\x3cdiv id\x3d"statusbar"\x3e\x3c/div\x3e\x3c/div\x3e';c.prototype._init=function(b){this.title=b.title||k["Find File Named"];this.modal=!0;this.messages=k;this._searcher=b.searcher;this._progress=b.progress;this._onHide=b.onHide;this._contentTypeService=
new h.ContentTypeRegistry(this._searcher.registry);if(!this._searcher)throw Error("Missing required argument: searcher");this._searchDelay=b.searchDelay||500;this._time=0;this._searcher.setCrawler(null);this._forceUseCrawler=!1;this._initialText=b.initialText;this._message=b.message;this._nameSearch=!0;void 0!==b.nameSearch&&(this._nameSearch=b.nameSearch);this._searchOnRoot=!0;this._fileService=this._searcher.getFileService();if(!this._fileService)throw Error(k["Missing required argument: fileService"]);
this._searchRenderer=b.searchRenderer;if(!this._searchRenderer||"function"!==typeof this._searchRenderer.makeRenderFunction)throw Error(k["Missing required argument: searchRenderer"]);this._initialize()};c.prototype._bindToDom=function(b){var c=this;c.$crawlingProgress.style.display="none";this._nameSearch?this.$fileName.setAttribute("placeholder",k["FileName FolderName"]):this.$fileName.setAttribute("placeholder",k.Search);this.$fileName.addEventListener("input",function(a){c._time=+new Date;c._timeoutId&&
clearTimeout(c._timeoutId);c._timeoutId=setTimeout(c.checkSearch.bind(c),0)},!1);this.$fileName.addEventListener("keydown",function(a){if(a.keyCode===d.KEY.ENTER){var b=d.$("a",c.$results);b&&(d.stop(a),(g.isMac?a.metaKey:a.ctrlKey)?window.open(b.href):(window.location.href=b.href,c.hide()))}},!1);b.addEventListener("keydown",function(a){var b,e,f;if(a.keyCode===d.KEY.DOWN||a.keyCode===d.KEY.UP)b=d.$$array("a",c.$results),e=document.activeElement,f=b.indexOf(e),a.keyCode===d.KEY.DOWN?0<=f?(e.classList.remove("treeIterationCursor"),
b=f<b.length-1?b[f+1]:b[0],b.focus(),b.classList.add("treeIterationCursor")):0<b.length&&(b=b[0],b.focus(),b.classList.add("treeIterationCursor")):0<=f?(e.classList.remove("treeIterationCursor"),e=c.$fileName,b=0<f?b[f-1]:e,b.focus(),0<f&&b.classList.add("treeIterationCursor")):0<b.length&&(b[b.length-1].focus(),b[b.length-1].classList.add("treeIterationCursor")),d.stop(a)});b.addEventListener("mouseup",function(a){a.target.focus()},!1);setTimeout(function(){if(c._forceUseCrawler||!c._fileService.getService(c._searcher.getSearchLocation()).search){var a=
c._searchOnRoot?c._searcher.getSearchRootLocation():c._searcher.getChildrenLocation(),a=new l.SearchCrawler(c._searcher.registry,c._fileService,"",{searchOnName:!0,location:a});c._searcher.setCrawler(a);a.buildSkeleton(function(){c.$crawlingProgress.style.display="inline";c.$progress.appendChild(document.createTextNode(k["Building file skeleton..."]))},function(){c.$crawlingProgress.style.display="none";c.$progress.removeChild(c.$progress.lastChild)})}},0);this._message&&(this.$fileNameMessage.removeChild(this.$fileNameMessage.firstChild),
this.$fileNameMessage.appendChild(document.createTextNode(this._message)));this._initialText&&(this.$fileName.value=this._initialText,this.doSearch())};c.prototype.checkSearch=function(){clearTimeout(this._timeoutId);var b=(new Date).getTime();b-this._time>this._searchDelay?(this._time=b,this.doSearch()):this._timeoutId=setTimeout(this.checkSearch.bind(this),50)};c.prototype._detectFolderKeyword=function(b){var c,a=b,e=null;if(this._nameSearch&&(c=/(\S+)\s*(.*)/,(b=c.exec(b))&&3===b.length))b[1]&&
(a=b[1]),b[2]&&(e=b[2]);return{keyword:a,folderKeyword:e}};c.prototype.doSearch=function(){var b=this.$fileName.value;if(b){var c=this._detectFolderKeyword(b),a=this._searcher.createSearchParams(c.keyword,this._nameSearch,this._searchOnRoot),e=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));this.currentSearch=e;var f=document.createElement("div");f.appendChild(document.createTextNode(this._nameSearch?k["Searching..."]:g.formatMessage(k["Searching for occurrences of"],
b)));d.empty(this.$results);this.$results.appendChild(f);this._searcher.search(a,c.folderKeyword,function(){e===this.currentSearch&&e.apply(null,arguments)}.bind(this))}};c.prototype.decorateResult=function(b){function c(b){0===b.button&&!b.ctrlKey&&!b.metaKey&&a.hide()}var a=this;b=d.$$array("a",b);for(var e=0;e<b.length;e++)b[e].addEventListener("click",c,!1)};c.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};c.prototype._afterHiding=function(){this._onHide&&this._onHide()};c.prototype.constructor=
c;return{OpenResourceDialog:c}});define("text!orion/banner/banner.html",[],function(){return'\x3cheader id\x3d"banner" role\x3d"banner"\x3e\n\t\x3c!-- Requires some js code to bind the home link, link to progress image, and binding NLS variables  --\x3e\n\n\t\x3cdiv id\x3d"staticBanner" class\x3d"layoutBlock topRowBanner"\x3e \x3c!-- primaryNav --\x3e\n\t\t\x3cdiv id\x3d"centralNavigationArea" style\x3d"position:absolute;left:0;top:0;width:39px;height:36px; z-index:1;border-right:1px solid #ddd;"\x3e\x3c/div\x3e\n\n\t\t\x3c!-- Static "Home" link. TODO delete this --\x3e\n\t\t\x3ca id\x3d"home" class\x3d"layoutLeft "\x3e\x3c/a\x3e\n\n\t\t\x3c!-- Left banner component: hamburger --\x3e\n\t\t\x3cnav id\x3d"primaryNav" class\x3d"bannerLeftArea" style\x3d"z-index:2;" role\x3d"navigation"\x3e\n\t\t\t\t\x3cbutton class\x3d"centralNavigation commandSprite core-sprite-hamburger" type\x3d"button"id\x3d"centralNavigation"\x3e\x3c/button\x3e\n\t\t\x3c/nav\x3e\n\n\t\t\x3c!-- Middle banner component: Breadcrumb bar --\x3e\n\t\t\x3cdiv class\x3d"clear navigationBreadcrumb bannerMiddleArea" \x3e\n\t\t\t\x3cdiv id\x3d"location" class\x3d"currentLocation"\x3e\x3c/div\x3e\n\t\t\x3c/div\x3e\n\n\t\t\x3c!-- Right banner component: user identity --\x3e\n\t\t\x3cdiv class\x3d"bannerRightArea" style\x3d"z-index:2;"\x3e\n\t\t\t\x3c!-- Global commands support. --\x3e\n\t\t\t\x3cdiv id\x3d"globalActions" class\x3d"spacingLeft layoutLeft"\x3e\x3c/div\x3e\n\n\t\t\t\x3c!-- Search. TODO delete this --\x3e\n\t\t\t\x3cinput type\x3d"text" id\x3d"search" autocomplete\x3d"off" class\x3d"layoutLeft spacingLeft searchbox" role\x3d"search" style\x3d"display:none;"\x3e\n\t\t\t\x3cdiv id\x3d"searchOptions" class\x3d"layoutLeft" style\x3d"padding-top:1px;display:none;"\x3e\x3c/div\x3e\n\n\t\t\t\x3c!-- User identity menu and Progress --\x3e\n\t\t\t\x3cdiv id\x3d"userMenu" class\x3d"spacingRight layoutRight" style\x3d"color:#ccc;line-height:16px;"\x3e\n\t\t\t\t\x3cdiv id\x3d"progressPane" class\x3d"progressWatch" tabindex\x3d"0" role\x3d"progressbar"\x3e\n\t\t\t\t\t\x3cdiv id\x3d"watchButton" class\x3d"watchButton"\x3e\x3c/div\x3e\n\t\t\t\t\t\x3cdiv id\x3d"watchBody" class\x3d"watchBody"\x3e\n\t\t\t\t\t\t\x3cspan class\x3d"hand longMinute"\x3e\n\t\t\t\t\t\t\t\x3cspan class\x3d"darkSide"\x3e\x3c/span\x3e\n\t\t\t\t\t\t\x3c/span\x3e\n\t\t\t\t\t\t\x3cspan class\x3d"hand longHour"\x3e\n\t\t\t\t\t\t\t\x3cspan class\x3d"darkSide"\x3e\x3c/span\x3e\n\t\t\t\t\t\t\x3c/span\x3e\n\t\t\t\t\t\x3c/div\x3e\n\t\t\t\t\x3c/div\x3e\n\t\t\t\t\n\t\t\t\t\x3cdiv style\x3d"position: absolute;right: 0px;top:0;width: 39px;height:36px; z-index:-50;border-left: 1px solid #ddd;"\x3e\x3c/div\x3e\n\t\t\t\t\x3cspan id\x3d"userTrigger" tabindex\x3d"0" role\x3d"button" class\x3d"dropdownTrigger" style\x3d"z-index:2;"\x3e\n\t\t\t\t\x3c/span\x3e\n\t\t\t\t\x3cul id\x3d"userDropdown" class\x3d"dropdownMenu" role\x3d"menu"\x3e\x3c/ul\x3e\n\t\t\t\x3c/div\x3e\n\t\t\x3c/div\x3e\n\t\x3c/div\x3e\n\n\t\x3c!-- IDE notification messages go in here --\x3e\n\t\x3cdiv id\x3d"notificationArea" class\x3d"notificationHide"\x3e\n\t\t\x3cdiv class\x3d"layoutLeft" id\x3d"notifications" aria-live\x3d"assertive" aria-atomic\x3d"true"\x3e\x3c/div\x3e\n\t\t\x3cdiv class\x3d"layoutRight"\x3e\x3cbutton aria-label\x3d"Close" class\x3d"dismissButton layoutRight core-sprite-close imageSprite" type\x3d"button" id\x3d"closeNotifications"\x3e\x3c/span\x3e\x3c/div\x3e\n\t\x3c/div\x3e\n\x3c/header\x3e'});
define("text!orion/banner/footer.html",[],function(){return'\x3c!--\n\x3cfooter id\x3d"footerContent" class\x3d"layoutBlock footerLayout" role\x3d"contentinfo"\x3e\n\t\x3cdiv class\x3d"logoFooter commandSprite core-sprite-orion-logo"\x3e\x3c/div\x3e\n\t\x3cdiv class\x3d"footerBlock"\x3e${Orion is in Beta. Please try it out but BEWARE your data may be lost.}\x3c/div\x3e\n\t\x3cdiv class\x3d"footerRightBlock"\x3e\n\t\t\x3cul\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"https://bugs.eclipse.org/bugs/enter_bug.cgi?product\x3dOrion\x26version\x3d5.0" target\x3d"_blank"\x3e${Report a Bug}\x3c/a\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"http://www.eclipse.org/legal/privacy.php" target\x3d"_blank"\x3e${Privacy Policy}\x3c/a\x3e\x3c/li\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"http://www.eclipse.org/legal/termsofuse.php" target\x3d"_blank"\x3e${Terms of Use}\x3c/a\x3e\x3c/li\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"http://www.eclipse.org/legal/copyright.php" target\x3d"_blank"\x3e${Copyright Agent}\x3c/a\x3e\x3c/li\x3e\n\t\t\x3c/ul\x3e\n\t\x3c/div\x3e\n\x3c/footer\x3e\n--\x3e'});
define("text!orion/banner/toolbar.html",[],function(){return'\x3cul class\x3d"layoutLeft commandList pageActions" id\x3d"pageActions"\x3e\x3c/ul\x3e\n\x3cul class\x3d"layoutLeft commandList pageActions" id\x3d"selectionTools"\x3e\x3c/ul\x3e\n\x3cul class\x3d"layoutLeft commandList pageActions" id\x3d"navActions"\x3e\x3c/ul\x3e\n\x3cdiv class\x3d"layoutLeft" style\x3d"padding-left:7px;padding-right:7px;margin-top:2px;" id\x3d"filterBox" style\x3d"visibility: hidden;"\x3e\x3c/div\x3e\n\x3cul class\x3d"layoutRight commandList pageActions" id\x3d"settingsActions"\x3e\x3c/ul\x3e\n\x3cdiv class\x3d"layoutRight status" id\x3d"statusPane" role\x3d"status" aria-live\x3d"off"\x3e\x3c/div\x3e\n\x3cul class\x3d"layoutRight commandList pageActions" id\x3d"pageNavigationActions"\x3e\x3c/ul\x3e'});
define("orion/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(k,l){function h(f,d,g){if(f=l.node(f))this._parent=f;else throw Error("Parent node of dropdown menu not found");this.options=g=g||{};this.navDropDownId=this._parent.id+"_navdropdown";this.selectionClass=g.selectionClass;f=document.createElement("div");f.classList.add("dropdownMenu");f.classList.add("dropdownMenuOpen");f.id=this.navDropDownId;f.style.display="none";this._parent.appendChild(f);this._dropdownMenu=
f;if(d=l.node(d))this._triggerNode=d;else throw"Trigger node of dropdown menu not found";"hidden"===this._triggerNode.style.visibility&&(this._triggerNode.style.visibility="visible");g.noClick||(this._triggerNode.onclick=this.click.bind(this));this._dropdownMenu.addEventListener("keydown",function(e){e.keyCode===l.KEY.ESCAPE&&this.clearPanel()}.bind(this))}k.mixin(h.prototype,{click:function(){"none"===this._dropdownMenu.style.display?this.updateContent(this.getContentNode(),function(){l.setFramesEnabled(!1);
this._dropdownMenu.style.display="";this._positionDropdown();this.selectionClass&&this._triggerNode.classList.add(this.selectionClass);this.handle=l.addAutoDismiss([this._triggerNode,this._dropdownMenu],this.clearPanel.bind(this));if(this.options.onShow)this.options.onShow()}.bind(this)):this.clearPanel()},clearPanel:function(){if(this.isVisible()&&(this._dropdownMenu.style.display="none",l.setFramesEnabled(!0),this.selectionClass&&this._triggerNode.classList.remove(this.selectionClass),this.options.onHide))this.options.onHide()},
addContent:function(f){this._dropdownMenu.innerHTML=f},getContentNode:function(){return this._dropdownMenu},updateContent:function(f,d){d()},_positionDropdown:function(){this._dropdownMenu.style.right="";var f=l.bounds(this._dropdownMenu),d=l.bounds(document.body);f.left+f.width>d.left+d.width&&(f=l.bounds(this._boundingNode(this._triggerNode)),d=l.bounds(this._triggerNode),this._dropdownMenu.style.right=f.width-(d.left-f.left+d.width)+"px")},_boundingNode:function(f){var d=window.getComputedStyle(f,
null);return null===d||"absolute"===d.getPropertyValue("position")||!f.parentNode||f===document.body?f:this._boundingNode(f.parentNode)},isDestroyed:function(){return!this._dropdownMenu.parentNode},isVisible:function(){return"none"!==this._dropdownMenu.style.display&&!this.isDestroyed()},focus:function(){this._dropdownMenu.focus()},destroy:function(){this._parent&&(l.setFramesEnabled(!0),l.empty(this._parent),this._parent=this.select=null)}});return h});define("orion/customGlobalCommands",[],function(){return{}});
define("orion/navigate/nls/root/messages",{"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.":"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.","Toggle Left Pane":"Toggle Left Pane","Open or close the left pane":"Open or close the left pane",Navigator:"Navigator","Strings Xtrnalizr":"Strings Xtrnalizr","Externalize Strings from JavaScript files in this folder":"Externalize strings from JavaScript files in this folder.",
"Choose a Folder":"Choose a Folder","Copy of ${0}":"Copy of ${0}","Enter a new name for '${0}'":"Enter a new name for '${0}'","Choose folder...":"Choose folder...",Rename:"Rename","Rename the selected files or folders":"Rename the selected files or folders","Compare with each other":"Compare with each other","Compare the selected 2 files with each other":"Compare the selected 2 files with each other","Compare with...":"Compare with...","Compare the selected folder with a specified folder":"Compare the selected folder with a specified folder",
Delete:"Delete","Unknown item":"Unknown item","Are you sure you want to delete these ${0} items?":"Are you sure you want to delete these ${0} items?","Are you sure you want to delete '${0}'?":"Are you sure you want to delete '${0}'?","Export as zip":"Zip","Create a zip file of the folder contents and download it":"Create a zip file of the folder contents and download it","New File":"File","Create a new file":"Create a new file","Name:":"Name:","New Folder":"Folder","Folder name:":"Folder name:","Create a new folder":"Create a new folder",
"Creating folder":"Creating folder",Folder:"Folder","Create an empty folder":"Create an empty folder","Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.":"Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.","Sample HTML5 Site":"Sample HTML5 Site","Generate a sample":"Generate a sample",'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.':'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.',
"Creating a folder for ${0}":"Creating a folder for ${0}","SFTP Import":"SFTP Import","Import content from SFTP":"Import content from SFTP","Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.":"Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.","Imported Content":"Imported Content","Upload a Zip":"Upload a Zip","Upload content from a local zip file":"Upload content from a local zip file",
"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.":"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.","Uploaded Content":"Uploaded Content","Creating an upload folder for ":"Creating an upload folder for ","Clone Git Repository":"Clone Git Repository","Clone a git repository":"Clone a git repository","Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.":"Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.",
"Link to Server":"Link to Server","Link to existing content on the server":"Link to existing content on the server","Create a folder that links to an existing folder on the server.":"Create a folder that links to an existing folder on the server.","Server path:":"Server path:","The name and server location were not specified.":"The name and server location were not specified.","Go Up":"Go Up","Move up to the parent folder":"Move up to the parent folder","Go Into":"Go Into","Move into the selected folder":"Move into the selected folder",
"Import local file...":"File System","Copy files and folders from your local file system":"Copy files and folders from your local file system","SFTP from...":"SFTP","Copy files and folders from a specified SFTP connection":"Copy files and folders from a specified SFTP connection","Importing from ${0}":"Importing from ${0}","SFTP to...":"SFTP","Copy files and folders to a specified SFTP location":"Copy files and folders to a specified SFTP location",Exporting:"Exporting to ${0}","Pasting ${0}":"Pasting ${0}",
"Copy to":"Copy to","Move to":"Move to","Copying ${0}":"Copying ${0}","Moving ${0}":"Moving ${0}","Renaming ${0}":"Renaming ${0}","Deleting ${0}":"Deleting ${0}","Creating ${0}":"Creating ${0}","Linking to ${0}":"Linking to ${0}","Move files and folders to a new location":"Move files and folders to a new location",Cut:"Cut",Copy:"Copy","Fetching children of ":"Fetching children of ",Paste:"Paste","Cannot paste into the Workspace root":"Cannot paste into the Workspace root","Open With":"Open With",
"Loading ":"Loading ",New:"New",File:"File",Actions:"Actions","Orion Content":"Orion Content"," is not supported in this file system":" is not supported in this file system","Create new content":"Create new content","Import from HTTP...":"HTTP","File URL:":"File URL:","Copy a file from a URL and optionally unzip it":"Copy a file from a URL and optionally unzip it","Unzip *.zip files:":"Unzip *.zip files:","Extracted from:":"Extracted from:","Did not drop ${0}.  Folder drop is not supported in this browser.":"Did not drop ${0}.  Folder drop is not supported in this browser.",
"You cannot copy files directly into the workspace.  Create a folder first.":"You cannot copy files directly into the workspace.  Create a folder first.","Unzip ${0}?":"Unzip ${0}?",NoFile:"Use the ${0} menu to create new files and folders. Click a file to start coding."});define("orion/navigate/nls/messages",["orion/i18n!orion/navigate/nls/messages","orion/navigate/nls/root/messages"],function(k,l){var h={root:l};Object.keys(k).forEach(function(f){"undefined"===typeof h[f]&&(h[f]=k[f])});return h});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(k,l,h){function f(e,c,b){if(!e[c])throw c+k[" is not supported in this file system"];return e[c].apply(e,b)}function d(e,c,b,m){if(!e.readBlob)throw k["source file service does not support binary read"];if(!b.writeBlob)throw k["target file service does not support binary write"];if("/"!==c[c.length-1])return f(e,"readBlob",[c]).then(function(a){return f(b,"writeBlob",[m,a])});var a=m.substring(0,
m.length-1),n=decodeURIComponent(a.substring(a.lastIndexOf("/")+1)),a=a.substring(0,a.lastIndexOf("/")+1);return f(b,"createFolder",[a,n]).then(function(){},function(){}).then(function(){return f(e,"fetchChildren",[c]).then(function(a){for(var c=[],f=0;f<a.length;++f){var n=a[f].Location,g=n;a[f].Directory&&(g=n.substring(0,n.length-1));g=decodeURIComponent(g.substring(g.lastIndexOf("/")+1));g=m+encodeURIComponent(g);a[f].Directory&&(g+="/");c[f]=d(e,n,b,g)}return l.all(c)})})}function g(e,c){function b(a){var b=
new l;b.reject(k["No Matching FileService for location:"]+a);return b}var d=e.getServiceReferences("orion.core.file"),a=d;if(c)for(var a=[],f=0;f<d.length;++f)c(d[f])&&a.push(d[f]);for(var g=[],r=[],s=[],t=[],w={fetchChildren:function(){var a=new l;a.resolve(t);return a},createWorkspace:function(){var a=new l;a.reject(k["no file service"]);return a},loadWorkspaces:function(){var a=new l;a.reject(k["no file service"]);return a},loadWorkspace:function(a){var b=new l;window.setTimeout(function(){b.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:k["File Servers"],Location:"/",Children:t,ChildrenLocation:"/"})},100);return b},search:b,createProject:b,createFolder:b,createFile:b,deleteFile:b,moveFile:b,copyFile:b,read:b,write:b},d=0;d<a.length;++d)t[d]={Directory:!0,Length:0,LocalTimeStamp:0,Location:a[d].getProperty("top"),ChildrenLocation:a[d].getProperty("top"),Name:a[d].getProperty("Name")},f=a[d].getProperty("pattern")||a[d].getProperty("top").replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"^"!==f[0]&&(f=
"^"+f),g[d]=RegExp(f),r[d]=e.getService(a[d]),s[d]=a[d].getProperty("Name"),a[d].getProperty("NameKey")&&a[d].getProperty("nls")&&h.getMessageBundle(a[d].getProperty("nls")).then(function(b,c){t[b].Name=c[a[b].getProperty("NameKey")];s[b]=c[a[b].getProperty("NameKey")]}.bind(this,d));this._getServiceIndex=function(a){if("/"===a)return-1;if(!a||a.length&&0===a.length)return r[0]?0:-1;for(var b=0;b<g.length;++b)if(g[b].test(a))return b;throw k["No Matching FileService for location:"]+a;};this._getService=
function(a){a=this._getServiceIndex(a);return-1===a?w:r[a]};this._getServiceName=function(a){a=this._getServiceIndex(a);return-1===a?w.Name:s[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return-1===a?w.Location:t[a].Location}}g.prototype={getService:function(e){return this._getService(e)},fileServiceName:function(e){return this._getServiceName(e)},fileServiceRootURL:function(e){return this._getServiceRootURL(e)},fetchChildren:function(e){return f(this._getService(e),"fetchChildren",
arguments)},createWorkspace:function(e){return f(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return f(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(e){return f(this._getService(e),"loadWorkspace",arguments)},createProject:function(e,c,b,d){return f(this._getService(e),"createProject",arguments)},createFolder:function(e,c){return f(this._getService(e),"createFolder",arguments)},createFile:function(e,c){return f(this._getService(e),"createFile",
arguments)},deleteFile:function(e){return f(this._getService(e),"deleteFile",arguments)},moveFile:function(e,c,b){var m=this._getService(e),a=this._getService(c);if(m===a)return f(m,"moveFile",arguments);var n="/"===e[e.length-1],g=c;"/"!==g[g.length-1]&&(g+="/");if(b)g+=encodeURIComponent(b);else{var h=e;n&&(h=h.substring(0,h.length-1));g+=h.substring(h.lastIndexOf("/")+1)}n&&"/"!==g[g.length-1]&&(g+="/");return d(m,e,a,g).then(function(){return f(m,"deleteFile",[e])})},copyFile:function(e,c,b){var m=
this._getService(e),a=this._getService(c);if(m===a)return f(m,"copyFile",arguments);var n="/"===e[e.length-1],g=c;"/"!==g[g.length-1]&&(g+="/");if(b)g+=encodeURIComponent(b);else{var h=e;n&&(h=h.substring(0,h.length-1));g+=h.substring(h.lastIndexOf("/")+1)}n&&"/"!==g[g.length-1]&&(g+="/");return d(m,e,a,g)},read:function(e,c){return f(this._getService(e),"read",arguments)},readBlob:function(e){return f(this._getService(e),"readBlob",arguments)},write:function(e,c,b){return f(this._getService(e),"write",
arguments)},remoteImport:function(e,c){return f(this._getService(e),"remoteImport",arguments)},remoteExport:function(e,c){return f(this._getService(e),"remoteExport",arguments)},search:function(e){return f(this._getService(e.resource),"search",arguments)}};g.prototype.constructor=g;return{FileClient:g}});
define("orion/webui/SideMenu","orion/commands orion/objects orion/webui/littlelib orion/PageLinks orion/PageUtil orion/URITemplate orion/URL-shim orion/util".split(" "),function(k,l,h,f,d,g,e,c){function b(a,b){this.parentNode=h.node(a);this.contentNode=h.node(b);if(!this.parentNode)throw Error("Missing parentNode");this.menuitems=Object.create(null);this.categories=this.links=null;this.anchor=document.createElement("ul");this.anchor.classList.add("sideMenuList");this.parentNode.appendChild(this.anchor);
this.anchor.addEventListener("click",this._handleEvent.bind(this));this.anchor.addEventListener("touchstart",this._handleEvent.bind(this));this.anchor.addEventListener("focus",this._handleEvent.bind(this),!0);h.addAutoDismiss([this.anchor],this._expandMenu.bind(this,null))}function m(a){return!a.isRelatedLink}function a(a,b){var c=a.order,e=b.order;return c<e?-1:e<c?1:0}function n(a,b){var c=a.source.order,e=b.source.order,c="number"===typeof c?c:100,e="number"===typeof e?e:100;return c===e?a.textContent.localeCompare(b.textContent):
c<e?-1:1}var q=c.isTouch;l.mixin(b.prototype,{LOCAL_STORAGE_NAME:"sideMenuNavigation",OPEN_STATE:"open",CLOSED_STATE:"closed",DEFAULT_STATE:"open",SIDE_MENU_OPEN_WIDTH:"40px",TRANSITION_DURATION_MS:301,addMenuItem:function(a,b,c){var e=this.anchor;a=this.createListItem(a,b);c&&a.classList.add("sideMenuItemActive");e.appendChild(a);this.menuitems[b]=a},setSideMenu:function(){var a=this.getDisplayState(),b=this.parentNode;b&&(a===this.CLOSED_STATE&&(this.setPageContentLeft("0"),this._timeout&&(window.clearTimeout(this._timeout),
this._timeout=null),this._timeout=window.setTimeout(function(){b.style.display="none"},this.TRANSITION_DURATION_MS),b.classList.add("animating")),a===this.OPEN_STATE&&(this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null),b.classList.remove("animating"),b.style.display="block",b.style.width=this.SIDE_MENU_OPEN_WIDTH,this.setPageContentLeft(this.SIDE_MENU_OPEN_WIDTH)))},setPageContentLeft:function(a){var b=this.contentNode;b&&(b.style.left=a)},toggleSideMenu:function(){var a=this.getDisplayState(),
b=this.contentNode;b&&b.classList.add("content-fixedHeight-animation");a=a===this.OPEN_STATE?this.CLOSED_STATE:this.OPEN_STATE;a===this.DEFAULT_STATE?localStorage.removeItem(this.LOCAL_STORAGE_NAME):localStorage.setItem(this.LOCAL_STORAGE_NAME,a);this.setSideMenu()},clearMenuItems:function(){this.menuitems=[];h.empty(this.anchor)},getMenuItems:function(){var a=this.menuitems;return Object.keys(a).map(function(b){return a[b]})},getMenuItem:function(a){return this.menuitems[a]},getDisplayState:function(){var a=
localStorage.getItem(this.LOCAL_STORAGE_NAME);a||(a=this.DEFAULT_STATE);return a},createListItem:function(a,b){var c=document.createElement("li");c.className=a;c.classList.add("sideMenuItem");c.categoryId=b;return c},setCategories:function(a){this.categories=a;this.links=Object.create(null)},setPageLinks:function(a){this.pageLinks=a;var b=this,c=a.createLinkElements();a.getAllLinks().forEach(function(a,e){var d=c[e];d.source=a;b._getLinksBin(a.category).push(d)});this._renderLinks()},setRelatedLinks:function(a,
b){this.relatedLinks=a;var c=this;Object.keys(this.links).forEach(function(a){var b=c._getLinksBin(a);c.links[a]=b.filter(m)});var e=document.createDocumentFragment();a.forEach(function(a){var b=a.relatedLink,d=c._getLinksBin(b.category);a=k.createCommandMenuItem(e,a.command,a.invocation);a.classList.remove("dropdownMenuItem");a.isRelatedLink=!0;a.source=b;d.push(a)});this._renderLinks(b)},_getLinksBin:function(a){if(a){var b=this.links;b[a]=b[a]||[];return b[a]}return[]},_sort:function(){var a=this.links;
Object.keys(a).forEach(function(b){a[b].sort(n)})},_renderCategories:function(){var b=this.categories,c=this,e=new URL(window.location.href),n=d.matchResourceParameters();n.OrionHome=f.getOrionHome();var m=!1;this.clearMenuItems();b.getCategoryIDs().map(function(a){return b.getCategory(a)}).sort(a).forEach(function(a){var b=c._getLinksBin(a.id);b.length&&(m?c.addMenuItem(a.imageClass,a.id,!1):(b=b.some(function(a){if(!a.source.uriTemplate)return!1;a=new g(a.source.uriTemplate);a=new URL(a.expand(n),
window.location);return a.protocol===e.protocol&&a.host===e.host&&a.hostname===e.hostname&&a.port===e.port&&a.pathname===e.pathname&&a.search===e.search?m=!0:!1}),c.addMenuItem(a.imageClass,a.id,b)))})},_renderLinks:function(a){a=a||[];this._sort();this._renderCategories();var b=this,c=window.location.href;Object.keys(this.menuitems).forEach(function(e){var d=b.getMenuItem(e);if(d){for(var f=b._getLinksBin(e).slice(),f=f.filter(function(b){var e=b.source;return 0<=a.indexOf(e.id)||!e.default&&!e.force&&
b.href===c?!1:!0}),f=f.filter(function(a){a=a.source;return!(1<f.length&&a.default&&!a.force)}),n=f.length-1;0<n;n--)f[n].href===f[n-1].href&&f.splice(n,1);if(f.length){d.appendChild(b._createCategoryElement(e,d,f[0]));var m=document.createElement("ul");m.className="sideMenuSubMenu";f.forEach(function(a){var b=document.createElement("li");b.className="sideMenuSubMenuItem";var c=document.createElement("a");c.href=a;c.className="sideMenuSubMenuItemLink";var e=document.createElement("span");e.innerHTML=
a.innerHTML;e.className="sideMenuSubMenuItemSpan";c.appendChild(e);b.appendChild(c);m.appendChild(b)});d.appendChild(m)}}})},_createCategoryElement:function(a,b,c){a=this.categories.getCategory(a);var e;q?(e=document.createElement("button"),e.type="button"):(e=document.createElement("a"),e.href=c.href);e.className+=a.imageClass;e.classList.add("submenu-trigger");e.tabIndex="0";b.classList.remove(a.imageClass);return e},_handleEvent:function(a){var b=a.target;a="focus"===a.type;if("A"!==b.tagName||
a)b.classList.contains("submenu-trigger")&&(q||a)&&this._expandMenu(h.$(".sideMenuSubMenu",b.parentNode))},_expandMenu:function(a){this.getMenuItems().forEach(function(b){b=h.$(".sideMenuSubMenu",b);a!==b&&b.classList.remove("expanded")});a&&a.classList.toggle("expanded")}});return b});
define("orion/globalCommands","i18n!orion/nls/messages require orion/commonHTMLFragments orion/keyBinding orion/EventTarget orion/commandRegistry orion/commands orion/parameterCollectors orion/extensionCommands orion/uiUtils orion/keyBinding orion/breadcrumbs orion/webui/littlelib orion/webui/splitter orion/webui/dropdown orion/webui/tooltip orion/contentTypes orion/URITemplate orion/keyAssist orion/PageUtil orion/widgets/themes/ThemePreferences orion/widgets/themes/container/ThemeData orion/Deferred orion/widgets/UserMenu orion/PageLinks orion/webui/dialogs/OpenResourceDialog text!orion/banner/banner.html text!orion/banner/footer.html text!orion/banner/toolbar.html orion/widgets/input/DropDownMenu orion/util orion/customGlobalCommands orion/fileClient orion/webui/SideMenu orion/objects".split(" "),function(k,
l,h,f,d,g,e,c,b,m,a,n,q,r,s,t,w,v,u,z,x,A,p,B,y,C,K,Q,E,L,D,F,M,N,P){function G(a,b){if(a.getLabel)return a.getLabel();var c=new p;c.resolve(b.properties.name);return c}function T(a){q.node("progressPane").setAttribute("aria-label",k["Operations - Press spacebar to show current operations"]);(a=a.getService("orion.page.progress"))&&a.init.bind(a)("progressPane")}function V(a,b){var c=a.getServiceReferences("orion.core.auth");ba=[];var e=U.createMenuGenerator.apply(this,arguments);if(e)for(var d=0;d<
c.length;d++){var p=c[d],f=a.getService(p);G(f,p).then(function(a){f.getKey().then(function(b){ba.push(b);f.getUser().then(function(c){e.addUserItem(b,f,a,c)},function(c,d){e.addUserItem(b,f,a,d)});window.addEventListener("storage",function(c){I[b]!==localStorage.getItem(b)&&(I[b]=localStorage.getItem(b),f.getUser().then(function(c){e.addUserItem(b,f,a,c)},function(c){e.addUserItem(b,f,a)}))},!1)})})}}function W(a){return a}function X(a,c,d,f,y){function B(){if(C)return C;var b=a.getService("orion.core.contentTypeRegistry");
b||(b=new w.ContentTypeRegistry(a),b=a.getService("orion.core.contentTypeRegistry"));return b.getContentTypes().then(function(a){return C=a})}function n(a){for(var b={},c=a.getPropertyKeys(),e,d=0;d<c.length;d++)e=c[d],b[e]=a.getProperty(e);return b}function m(a,b){var c=null;a.some(function(a){return b===a.getProperty("id")?!!(c=a):!1});return c}function g(a){var b=a.command;return!b.visibleWhen||b.visibleWhen(c)?(a.invocation=new e.CommandInvocation(c,c,null,b,f),(new p).resolve(a)):"function"===
typeof y?(K||(K=y()),p.when(K,function(d){if(d&&c===ca&&(!b.visibleWhen||b.visibleWhen(d)))return a.invocation=new e.CommandInvocation(d,d,null,b,f),a})):(new p).resolve()}function q(a,b,c){return c?(new p).resolve({relatedLink:a,command:c}):b.then(function(b){return{relatedLink:a,command:new e.Command(b)}})}var h=arguments,C,K,k=a&&a.getServiceReferences("orion.page.link.related");if(k&&0!==k.length){var r=this;p.when(B(),function(){if(U.beforeGenerateRelatedLinks.apply(r,h)){var c=a.getServiceReferences("orion.navigate.command"),
e=[];k.forEach(function(d){var p=n(d);if(p.id){var y;if((p.nls&&p.nameKey||p.name)&&p.uriTemplate)y=b._createCommandOptions(p,d,a,C,!0),e.push(q(p,y,null));else if(y=m(c,p.id)){var B=n(y);d={};P.mixin(d,B,p);(p=f.findCommand(p.id))?e.push(q(d,null,p)):(y=b._createCommandOptions(B,y,a,C,!0),e.push(q(d,y,null)))}}});p.all(e,W).then(function(a){a.sort(function(a,b){return a.command.name.localeCompare(b.command.name)});return p.all(a.map(g),W).then(function(b){var c=[];b=b.filter(function(b,e){if(b)return!0;
c.push(a[e]);return!1});U.addRelatedLinkCommands.call(r,f,b,c,d);U.afterGenerateRelatedLinks.apply(r,h)})})}})}}function S(a){var b=q.node("globalActions");b&&(a.destroy(b),a.renderCommands(b.id,b,{},{},"tool"))}function $(a){var b=window.getComputedStyle(a,null);return null===b||"absolute"===b.getPropertyValue("position")||!a.parentNode||a===document.body?a:$(a.parentNode)}function O(a){var b={},c=null;"string"===typeof a&&(a=q.node(a));a||(a=q.node("pageActions"));for(var e=a;e&&e.classList;){if(e.classList.contains("toolComposite")){c=
e;break}e=e.parentNode}a.classList.contains("commandMarker")&&(b.commandNode=a);c&&(b.slideContainer=q.$(".slideParameters",c),b.parameterArea=q.$(".parameters",c),b.dismissArea=q.$(".parametersDismiss",c),b.notifications=q.$("#notificationArea",c),c.parentNode&&(b.toolbarTarget=q.$(".toolbarTarget",c.parentNode),b.toolbarTarget&&(a=q.bounds(b.toolbarTarget),e=q.bounds($(b.toolbarTarget.parentNode)),b.toolbarTargetY=a.top-e.top,b.toolbar=c)));return b}function H(a){if(a=a.slideContainer)if(a.style.left=
"",a.style.top="",a.classList.contains("slideContainerActive")){var b=q.bounds(a),c=q.bounds(a.parentNode);a.style.left=(c.width-b.width)/2+"px";a.style.top="0"}}g=function(a){var b=document.createElement("a");b.href=a;return b.href}(l.toUrl("auth/NotifyAuthentication.html"));var I={},J=null,U={createMenuGenerator:F.createMenuGenerator||function(a,b){if(q.node("userMenu")){var c=q.node("userDropdown"),e=new s.Dropdown({dropdown:c}),c=new B.UserMenu({dropdownNode:c,dropdown:e,serviceRegistry:a}),e=
q.node("userTrigger");new t.Tooltip({node:e,text:k.Options,position:["below","left"]});e=document.getElementById("userTrigger");e.className+=" imageSprite core-sprite-silhouette";c.setKeyAssist(b);return c}},beforeGenerateRelatedLinks:F.beforeGenerateRelatedLinks||function(a,b,c,e,d){return!0},addRelatedLinkCommands:F.addRelatedLinkCommands||function(a,b,c,e){this.sideMenu&&this.sideMenu.setRelatedLinks(b,e)},afterGenerateRelatedLinks:F.afterGenerateRelatedLinks||function(a,b,c,e,d){},afterSetPageTarget:F.afterSetPageTarget||
function(a){},generateNavigationMenu:F.generateNavigationMenu||function(a,b,c,e,d,p,f){if(a=q.node("sideMenu"))b=q.node("centralNavigation"),new t.Tooltip({node:b,text:k.CentralNavTooltip,position:["right"]}),J=this.sideMenu=new N(a,q.node("pageContent")),b.addEventListener("click",J.toggleSideMenu.bind(J)),(a=q.node("sideMenuToggle"))&&a.addEventListener("click",J.toggleSideMenu.bind(J))},afterGenerateNavigationMenu:F.afterGenerateNavigationMenu||function(a,b,c,e,d,p,f){},afterGenerateBanner:F.afterGenerateBanner||
function(a,b,c,e,d,p,f){}},ba=[],ca,aa=[],R,Z=null,Y=null,da=new d;return{generateBanner:function(a,b,d,B,n,m,g,s){function L(a){a.registerService("orion.cm.managedservice",{updated:function(a){a=a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?"_blank":"_self":"_self";for(var b=q.$$array(".targetSelector"),c=0;c<b.length;c++)b[c].target=a}},{pid:"nav.config"})}(new x.ThemePreferences(B,new A.ThemeData)).apply();var t=q.node(a);if(!t)throw k["could not find banner parent, id was "]+a;var F=document.createRange();
F.selectNode(t);F=F.createContextualFragment(K);q.processTextNodes(F,k);t.firstChild?t.insertBefore(F,t.firstChild):t.appendChild(F);t=q.node("home");t.href=l.toUrl("edit/edit.html");t.setAttribute("aria-label",k["Orion Home"]);q.node("progressPane").src=e.NO_IMAGE;if(t=q.node("pageToolbar"))t.classList.add("toolbarLayout"),t.innerHTML=E+h.slideoutHTMLFragment("mainToolbar");(t=q.node("closeNotifications"))&&t.setAttribute("aria-label",k["Close notification"]);if(17>=D.isFirefox&&(t=q.node("staticBanner")))t.style.width=
"100%",t.style.MozBoxSizing="border-box";if(t=q.node("footer"))t.innerHTML=Q,q.processTextNodes(t,k);d.setParameterCollector(new c.CommandParameterCollector(O,H));document.addEventListener("keydown",function(a){a.keyCode===q.KEY.ESCAPE&&(a=b.getService("orion.page.message"))&&a.setProgressMessage("")},!1);U.generateNavigationMenu.apply(this,arguments);U.afterGenerateNavigationMenu.apply(this,arguments);t=y.getCategoriesInfo(b);F=y.getPageLinksInfo(b,"orion.page.link");p.all([t,F]).then(function(a){if(J){var b=
a[1];J.setCategories(a[0]);J.setPageLinks(b);J.setSideMenu()}});if(t=q.$(".split")){var F=q.$(".sidePanelLayout"),w=q.$(".mainPanelLayout");F&&w&&(Z={side:F,main:w},Z.splitter=new r.Splitter({node:t,sidePanel:F,mainPanel:w,toggle:!0,closeByDefault:s}),t=new e.Command({name:k["Toggle side panel"],tooltip:k["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){Z.splitter.toggleSidePanel()}}),d.addCommand(t),d.registerCommandContribution("pageActions","orion.toggleSidePane",1,
null,!0,new f.KeyBinding("l",D.isMac?!1:!0,!0,!1,D.isMac?!0:!1)))}var v=!1,z=function(a,b){if(!v){var c=b.getService("orion.page.progress"),e=new C.OpenResourceDialog({searcher:a,progress:c,searchRenderer:a.defaultRenderer,onHide:function(){v=!1}});window.setTimeout(function(){v=!0;e.show()},0)}},t=new e.Command({name:k["Find File Named..."],tooltip:k["Choose a file by name and open an editor on it"],id:"orion.openResource",callback:function(a){z(n,b)}});d.addCommand(t);d.registerCommandContribution("globalActions",
"orion.openResource",100,null,!0,new f.KeyBinding("f",!0,!0));t=new e.Command({name:k["Toggle banner and footer"],tooltip:k["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:function(){var a=q.node("banner"),b=q.node("footer"),c=q.node("sideMenu"),e=q.$(".content-fixedHeight"),d="hidden"===a.style.visibility;d?(a.style.visibility="visible",b.style.visibility="visible",e.classList.remove("content-fixedHeight-maximized"),c&&c.classList.remove("sideMenu-maximized")):(a.style.visibility=
"hidden",b.style.visibility="hidden",e.classList.add("content-fixedHeight-maximized"),c&&c.classList.add("sideMenu-maximized"));da.dispatchEvent({type:"toggleTrim",maximized:!d});return!0}});d.addCommand(t);d.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new f.KeyBinding("m",!0,!0));t=new e.Command({name:k["System Configuration Details"],tooltip:k["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return l.toUrl("help/about.html")}});d.addCommand(t);
d.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new f.KeyBinding(112,!0,!0));t=new e.Command({name:k["Background Operations"],tooltip:k["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return l.toUrl("operations/list.html")}});d.addCommand(t);d.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new f.KeyBinding("o",!0,!0));Y=new u.KeyAssistPanel({commandRegistry:d});t=new e.Command({name:k["Show Keys"],
tooltip:k["Show a list of all the keybindings on this page"],id:"orion.keyAssist",callback:function(){Y.isVisible()?Y.hide():Y.show();return!0}});d.addCommand(t);d.registerCommandContribution("globalActions","orion.keyAssist",100,null,!0,new f.KeyBinding(191,!1,!0));S(d);V(b,t.callback);T(b);window.addEventListener("hashchange",function(){d.processURL(window.location.href)},!1);window.setTimeout(function(){L(b)},0);U.afterGenerateBanner.apply(this,arguments)},getToolbarElements:O,getMainSplitter:function(){return Z},
getKeyAssist:function(){return Y},getGlobalEventTarget:function(){return da},layoutToolbarElements:H,setPageTarget:function(a){var b,c,e=a.breadcrumbRootName,d=a.serviceRegistry;a.target?(a.searchService&&a.searchService.setLocationByMetaData(a.target),a.fileService&&!a.breadcrumbTarget&&!a.staticBreadcrumb&&(c=(e?e+" ":"")+a.fileService.fileServiceName(a.target.Location),e=null),b=a.name||a.target.Name,ca=a.target,X.call(this,d,a.target,aa,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||
(e=e||a.task||a.name),b=a.name,X.call(this,d,{NoTarget:""},aa,a.commandService,a.makeAlternate));(R=a.title)||(R=b?b+" - "+a.task:a.task);window.document.title=R;U.afterSetPageTarget.apply(this,arguments);if(b=a.breadCrumbContainer?q.node(a.breadCrumbContainer):q.node("location"))if(q.empty(b),a.staticBreadcrumb)new n.BreadCrumbs({container:b,rootSegmentName:e});else{var p=d&&new M.FileClient(d),d=a.breadcrumbTarget||a.target,p=p&&d&&d.Location?p.fileServiceRootURL(d.Location):null;new n.BreadCrumbs({container:b,
resource:d,rootSegmentName:e,workspaceRootSegmentName:c,workspaceRootURL:p,makeFinalHref:a.makeBreadcrumFinalLink,makeHref:a.makeBreadcrumbLink})}},setDirtyIndicator:function(a){R&&("*"===R.charAt(0)&&!a&&(R=R.substring(1)),a&&"*"!==R.charAt(0)&&(R="*"+R),window.document.title=R);var b=q.node("dirty");b&&(b.textContent=a?"*":"")},setPageCommandExclusions:function(a){aa=a},notifyAuthenticationSite:g}});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(k){return{detectValidURL:function(l){for(var h=/\[([^\]]*)\]\(([^\)]+)\)/g,f=h.exec(l),d=[],g=0;f;){if(3===f.length&&0<f[2].length){var e=new URL(f[2]);":"!==e.protocol&&k.validateURLScheme(e.href)&&(f.index>g&&d.push({segmentStr:l.substring(g,f.index)}),d.push({segmentStr:0<f[1].length?f[1]:f[2],urlStr:f[2]}),g=f.index+f[0].length)}f=h.exec(l)}if(0===g)return null;g<l.length-1&&d.push({segmentStr:l.substring(g)});return d},processURLSegments:function(k,
h){h.forEach(function(f){if(f.urlStr){var d=document.createElement("a");d.href=f.urlStr;d.appendChild(document.createTextNode(f.segmentStr))}else d=document.createElement("span"),d.textContent=f.segmentStr;k.appendChild(d)})}}});
define("orion/status",["i18n!orion/nls/messages","orion/webui/littlelib","orion/globalCommands","orion/urlUtils"],function(k,l,h,f){function d(e,c,b,d,a){this._serviceRegistry=e;this._serviceRegistration=e.registerService("orion.page.message",this);this._operationsClient=c;this.notificationContainerDomId=a;this.domId=b;this.progressDomId=d||b;this._hookedClose=!1;this._timer=null;this._clickToDisMiss=!0;this._cancelMsg=null}var g;d.prototype={_init:function(){var e=l.node("closeNotifications");if(e&&
!this._hookedClose){e.style.cursor="pointer";this._hookedClose=!0;var c=l.node(this.notificationContainerDomId);l.addAutoDismiss([c],function(){this._clickToDisMiss&&this.close()}.bind(this));e.addEventListener("click",function(){this.close()}.bind(this));c.addEventListener("click",function(b){b&&b.target&&"a"===b.target.nodeName.toLowerCase()&&(b=l.$$("a",c))&&b.length&&1===b.length&&this.close()}.bind(this))}},close:function(){window.clearTimeout(this._timer);var e=l.node("closeNotifications");
this._cancelMsg&&this._cancelFunc&&e?(e.innerHTML="",e.classList.remove("cancelButton"),e.classList.add("dismissButton"),e.classList.add("core-sprite-close"),e.classList.add("imageSprite"),this._cancelFunc(),this._cancelMsg=null):this.setProgressMessage("")},_getNotifierElements:function(){this._notifierElements||(this._notifierElements=h.getToolbarElements(this.notificationContainerDomId));return this._notifierElements},setMessage:function(e,c,b){this._init();this.currentMessage=e;var d=l.node(this.domId);
if("boolean"===typeof b){var a=d.getAttribute("aria-live");d.setAttribute("aria-live",b?"polite":"off");window.setTimeout(function(){e===this.currentMessage&&(l.empty(d),d.appendChild(document.createTextNode(e)),window.setTimeout(function(){d.setAttribute("aria-live",a)},100))}.bind(this),100)}else l.empty(d),d.appendChild(document.createTextNode(e));"number"===typeof c&&window.setTimeout(function(){e===this.currentMessage&&(l.empty(d),d.appendChild(document.createTextNode("")))}.bind(this),c)},setErrorMessage:function(e){this._clickToDisMiss=
!0;this.currentMessage=e;this._init();var c=e.responseText||e.message||e;if("string"===typeof c)try{c=JSON.parse(c)}catch(b){}e=c.Message||c;var d="red";if(c.Severity)switch(c.Severity){case "Warning":d="#FFCC00";break;case "Error":d="red";break;case "Info":case "Ok":d="green"}c=document.createElement("span");c.style.color=d;c.appendChild(document.createTextNode(e));e=l.node(this.domId);l.empty(e);e.appendChild(c)},setProgressMessage:function(e){this._clickToDisMiss=!1;this._init();this.currentMessage=
e;var c=document.createElement("span");c.classList.add("progressIcon");var b=l.node(this.progressDomId);l.empty(b);b.appendChild(c);b.appendChild(document.createTextNode(e));c=l.node(this.notificationContainerDomId);c.classList.remove("notificationHide");if(e&&0<e.length)c.classList.add("progressNormal"),c.classList.add("notificationShow");else{if(this._progressMonitors&&0<this._progressMonitors.length)return this._renderOngoingMonitors();c.classList.remove("notificationShow");c.classList.add("notificationHide")}},
setCancelFunction:function(e){this._cancelFunc=e},setProgressResult:function(e,c){this._clickToDisMiss=!1;this._cancelMsg=c;this.currentMessage=e;var b=e.responseText||e;if("string"===typeof b)try{b=JSON.parse(b)}catch(d){}this._init();var a=b.Message||b.toString(),n=k.UnknownError,g="core-sprite-information",h="progressNormal",s=document.createElement("span");s.classList.add("imageSprite");s.classList.add("progressIcon");var t=[];if(b.Severity)switch(b.Severity){case "Warning":n=k.UnknownWarning;
g="core-sprite-warning";h="progressWarning";t.push("progressInfo");t.push("progressError");t.push("progressNormal");this._clickToDisMiss=!0;break;case "Error":g="core-sprite-error";h="progressError";t.push("progressWarning");t.push("progressInfo");t.push("progressNormal");this._clickToDisMiss=!0;break;default:h="progressNormal",t.push("progressWarning"),t.push("progressError"),t.push("progressNormal")}t.push("notificationHide");s.classList.add(g);var w=l.node(this.progressDomId),g=l.node(this.notificationContainerDomId);
l.empty(w);w.appendChild(s);a===Object.prototype.toString()&&(a=n);b.HTML?(b=document.createElement("span"),b.innerHTML=a,w.appendChild(b)):((n=f.detectValidURL(a))?(a=document.createDocumentFragment(),f.processURLSegments(a,n),Array.prototype.forEach.call(l.$$("a",a),function(a){a.target="_blank"})):("Warning"!==b.Severity&&"Error"!==b.Severity&&!c&&(this._timer&&window.clearTimeout(this._timer),this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),5E3)),
a=document.createTextNode(a)),w.appendChild(a));if(h&&this.progressDomId!==this.domId){g.classList.add(h);for(h=0;h<t.length;h++)g.classList.remove(t[h])}g.classList.add("notificationShow");if(t=l.node("closeNotifications"))this._cancelMsg?(t.classList.add("cancelButton"),t.classList.remove("dismissButton"),t.classList.remove("core-sprite-close"),t.classList.remove("imageSprite"),t.innerHTML=this._cancelMsg):(t.innerHTML="",t.classList.remove("cancelButton"),t.classList.add("dismissButton"),t.classList.add("core-sprite-close"),
t.classList.add("imageSprite"))},showWhile:function(e,c){var b=this;if(c){b.setProgressMessage(c);var d=function(){c===b.currentMessage&&b.setProgressMessage("")};e.then(d,d)}return e},_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(e,c){return new g(this,++this._lastProgressId,e,c)},_renderOngoingMonitors:function(){if(0<this._progressMonitors.length){var e="",c=!0,b;for(b in this._progressMonitors)this._progressMonitors[b].status&&(c||(e+=", "),e+=this._progressMonitors[b].status,
c=!1);this.setProgressMessage(e)}else this.setProgressMessage("")},_beginProgressMonitor:function(e){this._progressMonitors[e.progressId]=e;this._progressMonitors.length++;this._renderOngoingMonitors()},_workedProgressMonitor:function(e){this._progressMonitors[e.progressId]=e;this._renderOngoingMonitors()},_doneProgressMonitor:function(e){delete this._progressMonitors[e.progressId];this._progressMonitors.length--;e.status?this.setProgressResult(e.status):this._renderOngoingMonitors()}};d.prototype.constructor=
d;g=function(e,c,b,d){this.statusService=e;this.progressId=c;if(b){this.deferred=b;this.begin(d);var a=this;b.then(function(b,c){a.done.bind(a)()},function(b,c){a.done.bind(a)()})}};g.prototype.begin=function(e){this.status=e;this.statusService._beginProgressMonitor(this)};g.prototype.done=function(e){this.status=e;this.statusService._doneProgressMonitor(this)};g.prototype.worked=function(e){this.status=e;this.statusService._workedProgressMonitor(this)};g.prototype.constructor=g;return{StatusReportingService:d,
ProgressMonitor:g}});
define("orion/operations/nls/root/messages",{More:"More","No Matching OperationService for location:":"No Matching OperationService for location:","No operations services registered.":"No operations services registered.","could not find toolbar ":"could not find toolbar ","Remove Completed":"Remove Completed","Remove all completed operations":"Remove all completed operations",Remove:"Remove","Remove operations from the operations list.":"Remove operations from the operations list.",Cancel:"Cancel",
"Cancel operations from the operations list.":"Cancel operations from the operations list.","Operation resulted in a warning.":"Operation resulted in a warning.","Operation resulted in an error.":"Operation resulted in an error.","Operation is running.":"Operation is running.","Operation is canceled.":"Operation is canceled.","Operation failed.":"Operation failed.",Name:"Name",Actions:"Actions",Status:"Status",Scheduled:"Scheduled"});
define("orion/operations/nls/messages",["orion/i18n!orion/operations/nls/messages","orion/operations/nls/root/messages"],function(k,l){var h={root:l};Object.keys(k).forEach(function(f){"undefined"===typeof h[f]&&(h[f]=k[f])});return h});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(k,l,h,f){function d(){}d.prototype={_initialize:function(d,e,c,b,m){this._tooltip=new f.Tooltip({node:d,hideDelay:m||0,afterShowing:this._afterShowingFunction(e).bind(this),afterHiding:c,trigger:b?b:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";d=document.createRange();d.selectNode(this.$parent);d=d.createContextualFragment(this.TEMPLATE);
this.messages&&h.processTextNodes(d,k);this.$parent.appendChild(d);var a=this._tooltip;this.$parent.addEventListener("keydown",function(b){b.keyCode===h.KEY.ESCAPE&&a.hide()},!1);this._bindElements(this.$parent);"function"===typeof this._bindToDom&&this._bindToDom(this.$parent)},_bindElements:function(d){for(var e=0;e<d.childNodes.length;e++){var c=d.childNodes[e];c.id&&(this["$"+c.id]=c);this._bindElements(c)}},_afterShowingFunction:function(d){return function(){d&&d.bind(this)();if(!this.customFocus){var e=
h.firstTabbable(this.$parent);e&&e.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};d.prototype.constructor=d;return{PopupDialog:d}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(k,l,h,f){var d={};(function(){var g=!1;d.updateNavTools=function(e,c,b,d,a,f){var q=h.node(d);if(q)c.destroy(q);else throw k["could not find toolbar "]+d;c.renderCommands(d,q,f,b,"button");if(a&&(d=h.node(a)))c.destroy(d),c.renderCommands(a,d,null,b,"button");g||(g=!0,e.getService("orion.page.selection").addEventListener("selectionChanged",function(e){var d=h.node(a);
d&&(c.destroy(d),c.renderCommands(a,d,e.selections,b,"button"))}))};d.createOperationsCommands=function(e,c,b){function d(a){return!a.operation||!a.operation.type?!1:"loadstart"===a.operation.type||"progress"===a.operation.type}var a=new f.Command({name:k["Remove Completed"],tooltip:k["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(a){b.removeCompletedOperations().then(function(a){c.loadOperations.bind(c)()})},visibleWhen:function(a){return!0}});e.addCommand(a);
a=new f.Command({name:k.Remove,tooltip:k["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(a){a=Array.isArray(a.items)?a.items:[a.items];for(var e=0;e<a.length;e++){var d=a[e];b.removeOperation.bind(b)(d.Location).then(function(){c.loadOperations.bind(c)()},function(){c.loadOperations.bind(c)()})}},visibleWhen:function(a){if(!Array.isArray(a)||0===a.length)return!d(a);for(var b in a)if(d(a[b]))return!1;return!0}});e.addCommand(a);
a=new f.Command({name:k.Cancel,tooltip:k["Cancel operations from the operations list."],imageClass:"core-sprite-stop",id:"eclipse.cancelOperation",callback:function(a){a=Array.isArray(a.items)?a.items:[a.items];for(var b=0;b<a.length;b++){var c=a[b];c.deferred&&c.deferred.cancel()}},visibleWhen:function(a){if(!Array.isArray(a)||0===a.length)return d(a)&&(a.operation&&a.operation.cancelable?!0:!1);for(var b in a)if(!d(a[b])||!a[b].operation||!a[b].operation.cancelable)return!1;return!0}});e.addCommand(a)}})();
return d});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(k,l,h,f,d){function g(e){this._options=e}g.prototype=new f.PopupDialog;g.prototype.TEMPLATE='\x3ctable style\x3d"width: 360px;"\x3e\x3ctr\x3e\x3ctd\x3e\x3ch2\x3eRecent operations\x3c/h2\x3e\x3c/td\x3e\x3ctd style\x3d"text-align: right;"\x3e\x3ca id\x3d"allOperationsLink" class\x3d"navlinkonpage"\x3eAll Operations\x3c/a\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3cdiv id\x3d"operationsExist"\x3e\x3cdiv style\x3d"padding-left: 7px" id\x3d"myOperationsListEmpty"\x3eNo operations running on this page.\x3c/div\x3e\x3ctable id\x3d"myOperationsList" style\x3d"display: none;"\x3e\x3c/table\x3e\x3c/div\x3e\x3cdiv style\x3d"padding-left: 7px" id\x3d"operationsDontExist"\x3eNo operations running.\x3c/div\x3e';g.prototype._init=
function(e){this._myOperations=[];this._operationsDeferreds=[];this._commandService=e.commandRegistry;d.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(e.triggerNode)};g.prototype._bindToDom=function(e){this.$allOperationsLink.href=l.toUrl("operations/list.html");this._setOperationsVisibility()};g.prototype.setOperations=function(e,c){this._myOperations||this._init(this._options);
this._myOperations=[];this._operationsDeferreds=[];if(e)for(var b in e)this._myOperations.push(e[b]),this._operationsDeferreds.push(c[b]);this._renderOperations()};g.prototype.parseProgressResult=function(e){if(!e)return{};e=e.responseText||e;try{e=JSON.parse(e)}catch(c){}var b={Message:e.Message||e,Severity:e.Severity};e.DetailedMessage&&e.DetailedMessage!==b.Message&&(b.DetailedMessage=e.DetailedMessage);return b};g.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,
this._myOperations,this._operationsDeferreds)};g.prototype._renderOperationsTable=function(e,c,b){h.empty(e);for(var d=0;d<c.length;d++){var a=c[d],f=document.createElement("tr"),g=document.createElement("td");g.style.paddingLeft="5px";g.style.paddingRight="5px";g.textContent=a.Name;f.appendChild(g);var r=document.createElement("div");g.appendChild(r);g=document.createElement("span");g.style.paddingRight="5px";g.classList.add("imageSprite");switch(a.type){case "Warning":g.classList.add("core-sprite-warning");
g.setAttribute("aria-label",k["Operation resulted in a warning."]);break;case "error":g.classList.add("core-sprite-error");g.setAttribute("aria-label",k["Operation resulted in an error."]);break;case "loadstart":case "progress":g.classList.add("core-sprite-start");g.setAttribute("aria-label",k["Operation is running."]);break;case "abort":g.classList.add("core-sprite-stop");g.setAttribute("aria-label",k["Operation is canceled."]);break;case "load":case "loadend":g.classList.add("core-sprite-ok"),g.setAttribute("aria-label",
"Operation ok.")}r.appendChild(g);g=document.createElement("span");g.classList.add("operationStatus");g.textContent=a.Name;r.appendChild(g);if(a.error){var s=a.error.Message||a.error;a.error.DetailedMessage&&""!==a.error.DetailedMessage&&(s+=": "+a.error.DetailedMessage);g.textContent=s;g.classList.remove("operationStatus");g.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",r,{operation:a,deferred:b[d]},this,"tool");e.appendChild(f)}this._setOperationsVisibility()};
g.prototype._setOperationsVisibility=function(){this.$myOperationsList.style.display=0<this._myOperations.length?"":"none";this.$myOperationsListEmpty.style.display=0<this._myOperations.length?"none":"";this.$operationsDontExist.style.display=0<this._myOperations.length?"none":"";this.$operationsExist.style.display=0<this._myOperations.length?"":"none"};g.prototype.constructor=g;return{OperationsDialog:g}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(k,l,h,f,d){function g(c,b){if(!this._progressPane){this._progressPane=f.node(c);this._operationsDialog=new d.OperationsDialog({triggerNode:this._progressPane,commandRegistry:b});var e=this;this._progressPane.addEventListener("keydown",function(a){(" "===a.charOrCode||a.keyCode===f.KEY.ENTER)&&e._operationsDialog.show()});this._progressPane.addEventListener("click",
function(a){e._operationsDialog.show()});this._operationsDialog.setOperations(null,null)}}function e(c,b,e,a){this._serviceRegistry=c;this._serviceRegistration=c.registerService("orion.page.progress",this);this._commandRegistry=e;this._operationsClient=b;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=a}g.prototype={_switchIconTo:function(c){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);
this._lastIconClass=c;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(c,b){var e={},a;for(a in c)c[a].progressMonitor||(e[a]=c[a]);if(this._isEmpty(e))this._switchIconTo("progressPane_empty"),this._progressPane.title=k.Operations,this._progressPane.alt=k.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var d="";for(a in e){var f=e[a];if(f.type&&("loadstart"===f.type||"progress"===f.type)){d=
"running";break}}""===d&&null!=this._lastOperation&&this._lastOperation.type&&"error"===this._lastOperation.type&&"error"==d;switch(d){case "running":this._progressPane.title=k["Operations running"];this._progressPane.alt=k["Operations running"];this._progressPane.setAttribute("aria-valuetext",k["Operations running"]);this._switchIconTo("running");break;case "warning":this._progressPane.title=k["Some operations finished with warning"];this._progressPane.alt=k["Some operations finished with warning"];
this._progressPane.setAttribute("aria-valuetext",k["Some operations finished with warning"]);this._switchIconTo("warning");break;case "error":this._progressPane.title=k["Some operations finished with error"];this._progressPane.alt=k["Some operations finished with error"];this._progressPane.setAttribute("aria-valuetext",k["Some operations finished with error"]);this._switchIconTo("error");break;default:this._progressPane.title=k.Operations,this._progressPane.alt=k.Operations,this._progressPane.hasAttribute("aria-valuetext")&&
this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_empty")}}this._operationsDialog.setOperations(e,b)},_isEmpty:function(c){for(var b in c)return!1;return!0}};g.prototype.constructor=g;e.prototype={init:function(c){this._progressMonitorClass||(this._progressMonitorTool=new g(c,this._commandRegistry))},progress:function(c,b,e){var a=this,d=this._operationsIndex++;!e&&this._progressMonitorClass&&(e=new this._progressMonitorClass,e.begin(b));c.then(function(f){a._operations[d]&&
(f=a._operations[d],b&&(f.Name=b),a._lastOperation=f,f.type="loadend",e&&(f.progressMonitor=e),a.writeOperation.bind(a)(d,f,c),f.Location||a._removeOperationFromTheList.bind(a)(d))},function(f){if(a._operations[d]){var g=a._operations[d];b&&(g.Name=b);e&&(g.progressMonitor=e);a._lastOperation=g;g.type=f.canceled?"abort":"error";g.error=f;a.writeOperation.bind(a)(d,g,c);g.Location||a._removeOperationFromTheList.bind(a)(d)}},function(f){b&&(f.Name=b);e&&(f.progressMonitor=e);a.writeOperation.bind(a)(d,
f,c)});return c},removeOperation:function(c){for(var b in this._operations)if(this._operations[b].Location&&this._operations[b].Location===c){this._removeOperationFromTheList(b);break}this._operationsClient.removeOperation.bind(this._operationsClient)(c)},_removeOperationFromTheList:function(c){var b=this._operations[c].progressMonitor;delete this._operations[c];delete this._operationDeferrds[c];b?b.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},
removeCompletedOperations:function(){for(var c in this._operations){var b=this._operations[c];b.type&&"loadstart"!==b.type&&"progress"!==b.type&&((b=this._operations[c].progressMonitor)&&b.done(),delete this._operations[c],delete this._operationDeferrds[c])}this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},setProgressResult:function(c){this._serviceRegistry.getService("orion.page.message").setProgressResult(c)},showWhile:function(c,b,e){b&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(b);
var a=this;c.then(function(b){a._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(b){e?a._serviceRegistry.getService("orion.page.message").setProgressMessage(""):a.setProgressResult.bind(a)(b);return b});return this.progress(c,b)},writeOperation:function(c,b,e){this._operations[c]=b;this._operationDeferrds[c]=e;b.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(a){a.put(b.Location,{Name:b.Name,expires:b.expires})});
b.progressMonitor?b.progressMonitor.progress(b.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};e.prototype.constructor=e;return{ProgressService:e}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(k,l){function h(e,c,b){return e[c].apply(e,b)}function f(e){this._location=e}function d(){var e=new l;e.reject(k["No Matching OperationService for location:"]+this._location);return e}function g(e){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=e.getService("orion.core.preference");for(var c=e.getServiceReferences("orion.core.operation"),
b=0;b<c.length;b++){var d=e.getService(c[b]);this._services[b]=d;d=c[b].getProperty("pattern")||".*";"^"!==d[0]&&(d="^"+d);this._patterns[b]=RegExp(d)}this._getService=function(a){if(!a)return this._services[0];for(var b=0;b<this._patterns.length;++b)if(this._patterns[b].test(a))return this._services[b];this._operations.remove(a);return new f(a)}}f.prototype={getOperation:d,getOperations:d,removeCompletedOperations:d,removeOperation:d,cancelOperation:d};f.prototype.constructor=f;g.prototype={getOperations:function(){var e=
new l;if(this._operations)return e.resolve(this._operations),e;var c=this;this._preferenceService.getPreferences("/operations").then(function(b){c._operations=b;e.resolve(c._operations)});return e},getOperation:function(e){return h(this._getService(e),"getOperation",arguments)},removeCompletedOperations:function(){for(var e=[],c=this,b=0;b<this._services.length;b++){var d=this._patterns[b],a=new l;e[b]=a.promise;h(this._services[b],"removeCompletedOperations").then(function(a){return function(b){Array.isArray(b)&&
c.getOperations.bind(c)().then(function(c){for(var e=c.keys(),f=0;f<e.length;f++){var g=e[f];d.test(g)&&0>b.indexOf(g)&&c.remove(g)}a.resolve()})}}(a),function(a){return function(b){a.reject(b)}}(a))}return l.all(e)},removeOperation:function(e){var c=this;return h(this._getService(e),"removeOperation",arguments).then(function(b){c.getOperations.bind(c)().then(function(b){b.remove(e)})},function(b){return b},function(b){return b})}};g.prototype.constructor=g;return{OperationsClient:g}});
define("orion/search/nls/root/messages",{"Find:":"Find:","Find With":"Find With","ReplaceWith:":"ReplaceWith:","Replace With":"Replace With","Show all":"Show all","Wrap search":"Wrap search","Incremental search":"Incremental search","Whole Word":"Whole Word","Regular expression":"Regular expression","Find after replace":"Find after replace",Options:"Options","Find next match":"Find next match","Find previous match":"Find previous match",Next:"Next",Previous:"Previous",Replace:"Replace","Replace All":"Replace All",
"Search ${0}":"Search ${0}","Type a keyword or wild card to search in ":"Type a keyword or wild card to search in ","Search failed.":"Search failed.","No matches found for ${0}":"No matches found for ${0}","Searching...":"Searching...","Resource has been changed by others.":"Resource has been changed by others.","Failed to write file.":"Failed to write file.",Results:"Results","Files ${0} of ${1} matching ${2}":"Files ${0} of ${1} matching ${2}","Replace ${0} with ${1} for files ${2} of ${3}":"Replace ${0} with ${1} for files ${2} of ${3}",
Location:"Location","Click to compare":"Click to compare",'Search again in this folder with "${0}"':'Search again in this folder with "${0}"',"Files replaced":"Files replaced",Status:"Status","${0} out of ${1}  matches replaced.":"${0} out of ${1}  matches replaced.","Replace all matches with...":"Replace all matches with...","Apply Changes":"Apply Changes","Replace all selected matches":"Replace all selected matches","Hide Compare":"Hide Compare","Hide compare view of changes":"Hide compare view of changes",
"Show Compare":"Show Compare","Show compare view of changes":"Show compare view of changes","Show All":"Show All","Show all the results in one page":"Show all the results in one page","\x3c Previous Page":"\x3c Previous Page","Show previous page of search result":"Show previous page of search result","Next Page \x3e":"Next Page \x3e","Show next page of search result":"Show next page of search result","Next result":"Next result","Previous result":"Previous result","Expand all results":"Expand all results",
"Collapse all results":"Collapse all results","Writing files...":"Writing files...","Preparing preview...":"Preparing preview...","Replaced File (${0})":"Replaced File (${0})","Original File (${0})":"Original File (${0})","Sort by Name":"Sort by Name","Compare changes":"Compare changes","Search Results":"Search Results","Replace All Matches":"Replace All Matches","No matches":"No matches",Rename:"Rename","My Saved Searches":"My Saved Searches","Save frequently used searches by choosing ${0} shown above.":"Save frequently used searches by choosing ${0} shown above.",
"Save frequently used searches by clicking on the ${0} button above.":"Save frequently used searches by clicking on the ${0} button above.","Files that contain:":"Files that contain:",Search:"Search","All types":"All types","File type":"File type","All ${0} files":"All ${0} files","${0} is already saved":"${0} is already saved","Type a search term":"Type a search term","Type a replace term":"Type a replace term","Case sensitive":"Case sensitive","Sort by":"Sort by","File name":"File name","Path name":"Path name",
Save:"Save","Type a name for the search":"Type a name for the search","Save the current search":"Save the current search","Type filter text":"Type filter text","Scope Search":"Scope Search","Open in Search page for this directory":"Open the Search page for this folder.","${0}. Try your search again.":"${0}. Try your search again.","Click or use delete key to delete the search term":"Click or use delete key to delete the search term","${0} matches":"${0} matches","Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.":"Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.",
"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.":"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.",root:"root",Scope:"Scope"});
define("orion/search/nls/messages",["orion/i18n!orion/search/nls/messages","orion/search/nls/root/messages"],function(k,l){var h={root:l};Object.keys(k).forEach(function(f){"undefined"===typeof h[f]&&(h[f]=k[f])});return h});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(k,l){function h(f){this._init(f)}h.prototype={_init:function(f){var d=f.parent,g=this,d=l.node(d);if(!d)throw k["no parent"];if(!f.model)throw k["no tree model"];if(!f.renderer)throw k["no renderer"];this._parent=d;this._treeModel=f.model;this._onComplete=f.onComplete;this._renderer=f.renderer;this._showRoot=void 0===f.showRoot?!1:f.showRoot;this._indent=void 0===f.indent?16:f.indent;this._onCollapse=f.onCollapse;
this._labelColumnIndex=void 0===f.labelColumnIndex?0:f.labelColumnIndex;this._id=void 0===f.id?"treetable":f.id;this._tableStyle=f.tableStyle;this._tableElement=f.tableElement||"table";this._tableBodyElement=f.tableBodyElement||"tbody";this._tableRowElement=f.tableRowElement||"tr";this._root=this._treeModel.getRoot(function(e){g._showRoot?(e._depth=0,g._generate([e],0)):g._treeModel.getChildren(e,function(c){g.destroyed||g._generate(c,0)})})},destroy:function(){this.destroyed=!0},_generate:function(f,
d){l.empty(this._parent);var g=document.createElement("div");this._renderer.wrapperCallback&&this._renderer.wrapperCallback(g);var e=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(e);e.id=this._id;this._tableStyle&&e.classList.add(this._tableStyle);this._renderer.initTable(e,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+
"tbody";0===f.length?this._renderer.emptyCallback&&this._renderer.emptyCallback(this._bodyElement):this._generateChildren(f,d);e.appendChild(this._bodyElement);g.appendChild(e);this._parent.appendChild(g);this._rowsChanged();this._onComplete&&this._onComplete(this)},_generateChildren:function(f,d,g){for(var e=0;e<f.length;e++){var c=document.createElement(this._tableRowElement);c.id=this._treeModel.getId(f[e]);c._depth=d;c._item=f[e];this._renderer.render(f[e],c);c.childNodes[this._labelColumnIndex].style.paddingLeft=
this._indent*d+"px";this._renderer.rowCallback&&this._renderer.rowCallback(c,f[e]);g?(this._bodyElement.insertBefore(c,g.nextSibling),g&&(g=c)):this._bodyElement.appendChild(c)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(f,d,g){var e=this._treeModel.getId(f),c;if(e===this._id)this._removeChildRows(e),this._generateChildren(d,0),this._rowsChanged();else{var b=l.node(e);b?(b._item=f,
b&&(g||b._expanded)?(this._removeChildRows(e),d?(b._expanded=!0,this._renderer.updateExpandVisuals(b,!0),this._generateChildren(d,b._depth+1,b),this._rowsChanged()):(c=this,this._renderer.updateExpandVisuals(b,"progress"),d=this._treeModel.getChildren(b._item,function(e){c.destroyed||(c._renderer.updateExpandVisuals(b,!0),b._expanded||(b._expanded=!0,c._generateChildren(e,b._depth+1,b),c._rowsChanged()))}))):this._renderer.updateExpandVisuals(b,!1)):console.log(k["could not find table row "]+e)}},
getItem:function(f){var d=l.node(f);return d&&d._item?d._item:f},toggle:function(f){var d=l.node(f);d&&(d._expanded?this.collapse(f):this.expand(f))},isExpanded:function(f){f="string"===typeof f?f:this._treeModel.getId(f);return(f=l.node(f))?f._expanded:!1},expand:function(f,d,g){f="string"===typeof f?f:this._treeModel.getId(f);var e=l.node(f);if(e){var c=this;e._expanded?d&&d.apply(c,g):(this._renderer.updateExpandVisuals(e,"progress"),this._treeModel.getChildren(e._item,function(b){c.destroyed||
(c._renderer.updateExpandVisuals(e,!0),e._expanded||(e._expanded=!0,c._generateChildren(b,e._depth+1,e),c._rowsChanged()),d&&d.apply(c,g))}))}},_removeChildRows:function(f){for(var d=f===this._id,g=!1,e=-1,c=[],b=l.$$array(".treeTableRow",this._parent),m=0;m<b.length;m++){var a=b[m];if(g)break;d?a._depth>e?c.push(a):g=!0:a.id===f&&(d=!0,e=a._depth)}for(f=0;f<c.length;f++)d=c[f],d.parentNode.removeChild(d)},collapse:function(f){f="string"===typeof f?f:this._treeModel.getId(f);var d=l.node(f);if(d){if(!d._expanded)return;
d._expanded=!1;this._renderer.updateExpandVisuals(d,!1);this._removeChildRows(f);this._rowsChanged()}this._onCollapse&&this._onCollapse(d._item)},getIndent:function(){return this._indent}};h.prototype.constructor=h;return{TableTree:h}});
define("orion/treeModelIterator",[],function(){var k={};k.TreeModelIterator=function(){function k(h,f){this.firstLevelChildren=h;this.reset();this._init(f)}k.prototype={_init:function(h){h&&(this.isExpanded=h.isExpanded,this.isExpandable=h.isExpandable,this.forceExpandFunc=h.forceExpandFunc,this.getChildrenFunc=h.getChildrenFunc)},topLevel:function(h){return h.parent?h.parent===this.root:!0},_getChildren:function(h){return"function"===typeof this.getChildrenFunc?this.getChildrenFunc(h):h?h.children:
null},_expanded:function(h){if(!h)return!0;var f=this._getChildren(h),f=f&&0<f.length;this.isExpanded&&f&&(f=this.isExpanded(h));return f},_expandable:function(h){return!h?!0:this.isExpandable?this.isExpandable(h):!1},_diveIn:function(h){return this._expanded(h)?(h=this._getChildren(h),this.setCursor(h[0]),this.cursor()):null},_drillToLast:function(h){return this._expanded(h)?(h=this._getChildren(h),this._drillToLast(h[h.length-1])):h},_forward:function(h){if(!this._cursor)return null;var f=this._diveIn(this._cursor);
if(!f){if(h&&this._expandable(this._cursor)&&this.forceExpandFunc){var d=this;return this.forceExpandFunc(this._cursor,"first",function(f){f&&d.setCursor(f)})}(f=this._findSibling(this._cursor,!0))&&this.setCursor(f)}return f},_backward:function(h){if(!this._cursor)return null;var f=this._findSibling(this._cursor,!1);f&&f!==this._cursor.parent&&(f=this._drillToLast(f));if(h&&f&&this._expandable(f)&&this.forceExpandFunc&&f!==this._cursor.parent){var d=this;return this.forceExpandFunc(f,"last",function(f){f&&
d.setCursor(f)})}f&&this.setCursor(f);return f},_findSibling:function(h,f){for(var d=this.topLevel(h),g=this._getChildren(h.parent),g=d?this.firstLevelChildren:g,e=0;e<g.length;e++)if(g[e]===h)return 0===e&&!f?d?null:h.parent:e===g.length-1&&f?d?null:this._findSibling(h.parent,f):f?g[e+1]:g[e-1];return null},_inParentChain:function(h,f){for(var d=h.parent;d;){if(d===f)return!0;d=d.parent}return!1},_getTopLevelParent:function(h){if(this.topLevel(h))return h;for(h=h.parent;h;){if(this.topLevel(h))return h;
h=h.parent}return null},_onCollapse:function(h){return this._expanded(h.parent)?h:this._onCollapse(h.parent)},_scan:function(h,f,d){this.setCursor(f);var g=[];for(g.push(f);;){if(this.iterate(h))g.push(this.cursor());else break;if(d===this.cursor())return g}return null},setCursor:function(h){this._prevCursor=this._cursor;this._cursor=h},setTree:function(h){this.firstLevelChildren=h;0<this.firstLevelChildren.length&&(this.root=this.firstLevelChildren[0].parent)},scan:function(h,f){var d=this.cursor(),
g=this._scan(!0,h,f);g||(g=this._scan(!1,h,f));this.setCursor(d);return g},iterate:function(h,f){return h?this._forward(f):this._backward(f)},iterateOnTop:function(h,f){var d=this._findSibling(this._getTopLevelParent(this.cursor()),h);d?this.setCursor(d):f&&0<this.firstLevelChildren.length&&this.setCursor(h?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(h){return!this._cursor?null:this._inParentChain(this._cursor,h)?(this.setCursor(h),this._cursor):
null},reset:function(){this.root=this._prevCursor=this._cursor=null;0<this.firstLevelChildren.length&&(this._cursor=this.firstLevelChildren[0],this.root=this.firstLevelChildren[0].parent)},cursorMoved:function(){return this._cursor!==this._prevCursor},cursor:function(){return this._cursor},prevCursor:function(){return this._prevCursor}};return k}();return k});
define("orion/explorers/explorerNavHandler",["orion/webui/littlelib","orion/treeModelIterator","orion/uiUtils"],function(k,l,h){var f={},d=-1!==navigator.userAgent.indexOf("iPad"),g=-1!==window.navigator.platform.indexOf("Mac");f.ExplorerNavHandler=function(){function e(c,b,e){this.explorer=c;this.model=this.explorer.model;this._navDict=b;this._listeners=[];this._selections=[];this._currentColumn=0;c=this._getEventListeningDiv();c.tabIndex=0;c.classList.add("selectionModelContainer");var a=this;this._modelIterator=
new l.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:e.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(b){return a.explorer.renderer.isExpandable(b)}:function(b){return a.isExpandable(b)},forceExpandFunc:this.explorer.forceExpandFunc?function(b,c,e){return a.explorer.forceExpandFunc(b,c,e)}:void 0});this._init(e);(!e||!1!==e.setFocus)&&c.focus();e=function(b){if(h.isFormElement(b.target)||a.explorer.preventDefaultFunc&&a.explorer.preventDefaultFunc(b,
a._modelIterator.cursor()))return!0;if(b.keyCode===k.KEY.DOWN)return a.onDownArrow(b);if(b.keyCode===k.KEY.UP)return a.onUpArrow(b);if(b.keyCode===k.KEY.RIGHT)return a.onRightArrow(b);if(b.keyCode===k.KEY.LEFT)return a.onLeftArrow(b);if(b.keyCode===k.KEY.SPACE)return a.onSpace(b);if(b.keyCode===k.KEY.ENTER)return a.onEnter(b)};c.addEventListener("keydown",e,!1);this._listeners.push({type:"keydown",listener:e});e=function(b){if(a.explorer.onFocus)a.explorer.onFocus(!1);else a.toggleCursor(null,!1)};
c.addEventListener("blur",e,!1);this._listeners.push({type:"blur",listener:e});e=function(b){if(a.explorer.onFocus)a.explorer.onFocus(!0);else a.toggleCursor(null,!0)};c.addEventListener("focus",e,!1);this._listeners.push({type:"focus",listener:e});this._parentDiv=c}e.prototype={destroy:function(){this._parentDiv.classList.remove("selectionModelContainer");this.removeListeners()},_init:function(c){this._linearGridMove=!1;c&&(this._selectionPolicy=c.selectionPolicy,this.gridClickSelectionPolicy=c.gridClickSelectionPolicy||
"none",this.preventDefaultFunc=c.preventDefaultFunc,this.postDefaultFunc=c.postDefaultFunc)},_ctrlKeyOn:function(c){return g?c.metaKey:c.ctrlKey},removeListeners:function(){if(this._listeners)for(var c=0;c<this._listeners.length;c++)this._parentDiv.removeEventListener(this._listeners[c].type,this._listeners[c].listener,!1)},focus:function(){var c=this._getEventListeningDiv();c&&c.focus()},_getEventListeningDiv:function(c){return this.explorer.keyEventListeningDiv&&"function"===typeof this.explorer.keyEventListeningDiv?
this.explorer.keyEventListeningDiv(c):k.node(this.explorer._parentId)},isExpandable:function(c){return!c?!1:k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(c)))?!0:!1},isExpanded:function(c){return!c?!1:this.explorer.myTree.isExpanded(this.model.getId(c))},refreshSelection:function(c,b){var e=this;this.explorer.selection&&this.explorer.selection.getSelections(function(a){e._clearSelection(b);for(var d=0;d<a.length;d++)e._selections.push(a[d]);0<e._selections.length?e.cursorOn(e._selections[0],
!0,!1,c):e.cursorOn(null,!1,!1,c);e._shiftSelectionAnchor&&0<=e._inSelection(e._shiftSelectionAnchor)||(e._shiftSelectionAnchor=null)})},refreshModel:function(c,b,e,a){this._currentColumn=0;this.topIterationNodes=[];this.model=b;this._navDict=c;this.model.getTopIterationNodes?this.topIterationNodes=this.model.getTopIterationNodes():e&&(this.topIterationNodes=e);this._modelIterator.setTree(this.topIterationNodes);!a&&this.explorer.selection&&(this.toggleCursor(this._modelIterator.cursor(),!1),this._modelIterator.reset());
this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(c){c=this.model.getId(c);for(var b=0;b<this._selections.length;b++)if(c===this.model.getId(this._selections[b]))return b;return-1},_clearSelection:function(c){if(c)for(c=0;c<this._selections.length;c++)this._checkRow(this._selections[c],!0);this._selections=[]},getSelectionPolicy:function(){return this._selectionPolicy},setSelectionPolicy:function(c){this._selectionPolicy!==
c&&(("readonlySelection"===this._selectionPolicy||"readonlySelection"===c)&&this._toggleSelectionClass("disabledRow","readonlySelection"===c),this._selectionPolicy=c,"cursorOnly"===this._selectionPolicy&&this._clearSelection(!0))},setSelection:function(c,b,e){"readonlySelection"!==this._selectionPolicy&&("cursorOnly"===this._selectionPolicy?b&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(c,!0):this._isRowSelectable(c)&&(!b||"singleSelection"===this._selectionPolicy?(this._clearSelection(!0),
this._checkRow(c,!1),this._selections.push(c),this._lastSelection=c):(b=this._inSelection(c),0<=b?(this._checkRow(c,!0),this._selections.splice(b,1)):(this._checkRow(c,!1),this._selections.push(c),this._lastSelection=c)),e&&(this._shiftSelectionAnchor=this._lastSelection),this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))))},moveColumn:function(c,b){c||(c=this.currentModel());var e=this._getGridChildren(c);if(e&&1<e.length||
0===b&&e){0!==b&&this.toggleCursor(c,!1);var a=this._currentColumn,d=!0,a=a+b;0>a?(this._linearGridMove&&0!==b&&(this._modelIterator.iterate(!1)?c=this.currentModel():d=!1),a=d?e.length-1:this._currentColumn):a>=e.length&&(this._linearGridMove&&0!==b&&(this._modelIterator.iterate(!0)?c=this.currentModel():d=!1),a=d?0:this._currentColumn);this._currentColumn=a;0!==b&&this.toggleCursor(c,!0);return!0}return!1},_getGridChildren:function(c){return this._navDict?this._navDict.getGridNavHolder(c):null},
getCurrentGrid:function(c){c||(c=this.currentModel());return(c=this._getGridChildren(c))&&0<c.length?c[this._currentColumn]:null},getAriaContainerElement:function(c){for(var b=this._parentDiv,e;c&&c!==b&&"grid"!==(e=c.getAttribute("role"))&&"tree"!==e&&"treegrid"!==e;)c=c.parentNode;return c===b?null:c},toggleCursor:function(c,b){var e=this.getRowDiv(c),a=this.getCurrentGrid(c);a?(e&&(b?e.classList.add("treeIterationCursorRow"):e.classList.remove("treeIterationCursorRow")),a.domNode&&(e=this.getAriaContainerElement(a.domNode),
b?(a.domNode.classList.add("treeIterationCursor"),e&&e.setAttribute("aria-activedescendant",a.domNode.id)):a.domNode.classList.remove("treeIterationCursor"))):e&&(b?e.classList.add("treeIterationCursorRow_Dotted"):e.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(c,b,e,a){var d,f;if(c||b){if(f===this._modelIterator.cursor())return;d=this._modelIterator.cursor();f=c;this._modelIterator.setCursor(f)}else d=this._modelIterator.prevCursor(),
f=this._modelIterator.cursor();if(d!==f||b)if(this.toggleCursor(d,!1),!b||f){this.moveColumn(null,0);this.toggleCursor(f,!0);if((c=this.getRowDiv())&&!a){a=c.parentNode;for(b=document.documentElement;a&&a!==b;){var g=window.getComputedStyle(a,null);if(!g)break;g=g.getPropertyValue("overflow-y");if("auto"===g||"scroll"===g)break;a=a.parentNode}a&&(b=!0,c.offsetTop<=a.scrollTop?(b=!1,void 0===e&&(e=!1)):c.offsetTop+c.offsetHeight>=a.scrollTop+a.clientHeight&&(b=!1,void 0===e&&(e=!0)),b||c.scrollIntoView(!e))}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(d,
f)}},getSelection:function(){return this._selections},getSelectionIds:function(){for(var c=[],b=0;b<this._selections.length;b++)c.push(this.model.getId(this._selections[b]));return c},getRowDiv:function(c){c=c?c:this._modelIterator.cursor();if(!c)return null;c=this.model.getId(c);var b=this._navDict.getValue(c);return b&&b.rowDomNode?b.rowDomNode:k.node(c)},iterate:function(c,b,e,a){var d=null;if(this.topIterationNodes&&0!==this.topIterationNodes.length)if(a){a=this.currentModel();for((d=this._modelIterator.iterate(c,
b))&&this._setCursorOnItem(c,e);d&&d.isNotSelectable;)(d=this._modelIterator.iterate(c,b))&&this._setCursorOnItem(c,e);d||(this.cursorOn(a,!0,!1,!0),this._setCursorOnItem(c,e))}else this._modelIterator.iterate(c,b)&&this._setCursorOnItem(c,e)},_toggleSelectionClass:function(c,b){this._selections.forEach(function(e){(e=this.getRowDiv(e))&&(b?e.classList.add(c):e.classList.remove(c))}.bind(this))},_setCursorOnItem:function(c,b){this.cursorOn(null,!1,c);if(b){var e=this._inSelection(this._modelIterator.prevCursor()),
a=this._inSelection(this._modelIterator.cursor());0<=e&&0<=a?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)}},_checkRow:function(c,b){if(this.explorer.renderer._useCheckboxSelection&&"singleSelection"!==this._selectionPolicy){var e=this.getRowDiv(c);if(e){var a=k.node(this.explorer.renderer.getCheckBoxId(e.id)),d=b?!a.checked:!0;if(d!==a.checked)this.explorer.renderer.onCheck(e,a,d,!0)}}else this._select(c,b)},_select:function(c,b){c||(c=this._modelIterator.cursor());
var e=this.getRowDiv(c);e&&(0>this._inSelection(c)?e.classList.add("checkedRow"):e.classList.remove("checkedRow"))},_onModelGrid:function(c,b){var e=this._getGridChildren(c);if(e)for(var a=0;a<e.length;a++)if(b.target===e[a].domNode)return!0;return!1},onClick:function(c,b){if("readonlySelection"===this._selectionPolicy||this.isDisabled(this.getRowDiv(c)))k.stop(b);else{var e=k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(c)));if(b.target!==e&&!("none"===this.gridClickSelectionPolicy&&
this._onModelGrid(c,b)))if(this.cursorOn(c,!0,!1,!0),d)this.setSelection(c,!0);else if(this._ctrlKeyOn(b))this.setSelection(c,!0,!0);else if(b.shiftKey&&this._shiftSelectionAnchor){if(e=this._modelIterator.scan(this._shiftSelectionAnchor,c)){this._clearSelection(!0);for(var a=0;a<e.length;a++)this.setSelection(e[a],!0)}}else this.setSelection(c,!1,!0)}},onCollapse:function(c){this._modelIterator.collapse(c)&&this.cursorOn()},onUpArrow:function(c){this.iterate(!1,!1,c.shiftKey,!0);!this._ctrlKeyOn(c)&&
!c.shiftKey&&this.setSelection(this.currentModel(),!1,!0);c.preventDefault();return!1},onDownArrow:function(c){this.iterate(!0,!1,c.shiftKey,!0);!this._ctrlKeyOn(c)&&!c.shiftKey&&this.setSelection(this.currentModel(),!1,!0);c.preventDefault();return!1},_shouldMoveColumn:function(c){var b=this.currentModel(),e=this._getGridChildren(b);return e&&1<e.length?this.isExpandable(b)?this._ctrlKeyOn(c):!0:!1},onLeftArrow:function(c){if(this._shouldMoveColumn(c))return this.moveColumn(null,-1),c.preventDefault(),
!0;var b=this._modelIterator.cursor();if(!b)return!1;if(this.isExpandable(b)&&this.isExpanded(b))return this.explorer.myTree.collapse(b),c.preventDefault(),!0;this._modelIterator.topLevel(b)?this.explorer.scopeUp&&"function"===typeof this.explorer.scopeUp&&this.explorer.scopeUp():(this.cursorOn(b.parent),this.setSelection(b.parent,!1,!0))},onRightArrow:function(c){if(this._shouldMoveColumn(c))return this.moveColumn(null,1),c.preventDefault(),!0;var b=this._modelIterator.cursor();if(!b)return!1;if(this.isExpandable(b)&&
!this.isExpanded(b))return this.explorer.myTree.expand(b),this.explorer.postUserExpand&&this.explorer.postUserExpand(this.model.getId(b)),c.preventDefault(),!1},_isRowSelectable:function(c){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(c):!0},onSpace:function(c){this.setSelection(this.currentModel(),!0,!0);c.preventDefault()},onEnter:function(c){var b=this.getCurrentGrid(this._modelIterator.cursor());if(b)if(b.widget)if("function"===typeof b.onClick)b.onClick();else"function"===
typeof b.widget.focus&&b.widget.focus();else{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(c),!1,!1,!1,0,null);b.domNode.dispatchEvent(e)}else if(b=this._modelIterator.cursor())if(this.explorer.renderer.getRowActionElement&&(e=this.explorer.renderer.getRowActionElement(this.model.getId(b)),e.href&&(this._ctrlKeyOn(c)?window.open(e.href):window.location.href=e.href)),this.explorer.renderer.performRowAction)return this.explorer.renderer.performRowAction(c,
b),c.preventDefault(),!1},setIsNotSelectable:function(c,b){c.isNotSelectable=b},disableItem:function(c){var b=this.getRowDiv(c);this.isExpandable(c)&&this.isExpanded(c)&&(this._modelIterator.collapse(c),this.explorer.myTree.toggle(b.id));b.classList.remove("checkedRow");b.classList.add("disabledNavRow");this.setIsNotSelectable(c,!0)},isDisabled:function(c){return c.classList.contains("disabledNavRow")},enableItem:function(c){var b=this.getRowDiv(c);b&&(b.classList.remove("disabledNavRow"),this.setIsNotSelectable(c,
!1))}};return e}();f.ExplorerNavDict=function(){function e(c){this._dict={};this._model=c}e.prototype={addRow:function(c,b){var e=this._model.getId(c);this._dict[e]={model:c,rowDomNode:b}},getValue:function(c){return this._dict[c]},getGridNavHolder:function(c,b){if(!c)return null;var e=this._model.getId(c);return this._dict[e]?(!this._dict[e].gridChildren&&b&&(this._dict[e].gridChildren=[]),this._dict[e].gridChildren):null},initGridNavHolder:function(c){if(!c)return null;c=this._model.getId(c);this._dict[c]&&
(this._dict[c].gridChildren=null)}};return e}();return f});
define("orion/explorers/explorer","i18n!orion/nls/messages require orion/webui/littlelib orion/webui/treetable orion/explorers/explorerNavHandler orion/commands".split(" "),function(k,l,h,f,d,g){var e={};e.Explorer=function(){function c(b,c,a,e){this.registry=b;this.renderer=a;this.selection=c;this.commandService=e;this.renderer&&(this.renderer.explorer=this);this.myTree=null}c.prototype={destroy:function(){this._navHandler&&this._navHandler.destroy();this.model&&this.model.destroy();this.myTree&&
this.myTree.destroy();this.destroyed=!0},changedItem:function(b,c){this.myTree&&this.myTree.refresh.bind(this.myTree)(b,c,!0)},updateCommands:function(b){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(b)},makeNewItemPlaceHolder:function(b,c,a,e){b=this.getRow(b);if(a)return b=b.childNodes[a],b.appendChild(document.createElement("br")),e=document.createElement("span"),e.id=c+"placeHolderRow",b.appendChild(e),{tempNode:e,refNode:e};if(b){var d=document.createElement("tr");
d.id=c+"placeHolderRow";a=document.createElement("td");a.id=c+"placeHolderCol";d.appendChild(a);e?(b.parentNode.insertBefore(d,b.nextSibling),b=parseInt(b.firstChild.style.paddingLeft),a.style.paddingLeft=this.myTree.getIndent()+b+"px"):b.appendChild(d);e=h.node(c+"placeHolderRow");b=h.node(c+"placeHolderCol");if(e&&b)return{tempNode:e,refNode:b}}return null},getRow:function(b){if(b=this.model.getId(b))return h.node(b)},collapseAll:function(){for(var b=this._navHandler.getTopLevelNodes(),c=0;c<b.length;c++)this.myTree.collapse(b[c])},
expandAll:function(b){if(b)this._expandRecursively(b);else if(this._navHandler){b=this._navHandler.getTopLevelNodes();for(var c=0;c<b.length;c++)this._expandRecursively(b[c])}},_expandRecursively:function(b){if(this._navHandler&&this._navHandler.isExpandable(b)){var c=this;this.myTree.expand(b,function(){c.model.getChildren(b,function(a){if(!(void 0===a||null===a))for(var b=a.length,e=0;e<b;e++)c._expandRecursively(a[e])})})}},createTree:function(b,c,a){b="string"===typeof b?b:b.id||b;this.selection&&
this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var e=b+"innerTree",g=h.node(e);g&&h.empty(g);c&&(c.rootId=e);this.model=c;this._parentId=b;this._treeOptions=a;if(!a||a&&!a.noSelection)this.selectionPolicy=a?a.selectionPolicy:"",this._navDict=new d.ExplorerNavDict(this.model);this.myTree=new f.TableTree({id:e,model:c,parent:b,onComplete:a?a.onComplete:void 0,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:a?!!a.showRoot:
!1,indent:a?a.indent:void 0,onCollapse:a?a.onCollapse:void 0,navHandlerFactory:a?a.navHandlerFactory:void 0,tableElement:a?a.tableElement:void 0,tableBodyElement:a?a.tableBodyElement:void 0,tableRowElement:a?a.tableRowElement:void 0});this.renderer._initializeUIState();"cursorOnly"===this.selectionPolicy&&this.initNavHandler()},getNavHandler:function(){return this._navHandler},getNavDict:function(){return this._navDict},refreshSelection:function(){if(this.selection){var b=this.getNavHandler(),c=[];
if(b&&this.getNavDict())for(var a=b.getSelection(),e=0;e<a.length;e++){var d=b.getRowDiv(a[e]);d&&d.parentNode&&(d=this.getNavDict().getValue(this.model.getId(a[e])),d.model&&c.push(d.model))}this.selection.setSelections(c)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:null},initNavHandler:function(){var b=this._treeOptions;if(!b||b&&!b.noSelection){this.getNavHandler()||(this._navHandler=b&&b.navHandlerFactory&&"function"===typeof b.navHandlerFactory.createNavHandler?
b.navHandlerFactory.createNavHandler(this,this._navDict,b):new d.ExplorerNavHandler(this,this._navDict,{getChildrenFunc:b?b.getChildrenFunc:null,setFocus:b&&b.setFocus,selectionPolicy:b?b.selectionPolicy:null}));var c=this;this.model.getRoot(function(a){a instanceof Array?c.getNavHandler().refreshModel(c.getNavDict(),c.model,a):a.children&&a.children instanceof Array&&c.getNavHandler().refreshModel(c.getNavDict(),c.model,a.children);b&&b.setFocus&&c.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,
checkbox:!1};return c}();e.createExplorerCommands=function(c,b){function e(a){return"function"===typeof a.getItemCount&&0<a.getItemCount()?b?b(a):!0:!1}var a=new g.Command({tooltip:k["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return e(a)},callback:function(a){a.items.expandAll()}}),d=new g.Command({tooltip:k["Collapse all"],imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",
visibleWhen:function(a){return e(a)},callback:function(a){a.items.collapseAll()}});c.addCommand(a);c.addCommand(d)};e.ExplorerModel=function(){function c(b,c,a){this.rootPath=b;this.fetchItems=c;this.idPrefix=a||""}c.prototype={destroy:function(){this.destroyed=!0},getRoot:function(b){var c=this;this.fetchItems(this.rootPath).then(function(a){c.root=a;b(a)})},getChildren:function(b,c){b.Children?c(b.Children):b.ChildrenLocation?this.fetchItems(b.ChildrenLocation).then(function(a){b.Children=a;c(a)}):
c([])},getId:function(b){if(b.Location===this.root.Location)return this.rootId;b=b.Location.replace(/[\\\/]/g,"");for(var c=this.idPrefix,a=0;a<b.length;a++)c=b[a].match(/[^\.\:\-\_0-9A-Za-z]/g)?c+b.charCodeAt(a):c+b[a];return c}};return c}();e.ExplorerFlatModel=function(){function c(b,c,a){this.rootPath=b;this.fetchItems=c;this.root=a}c.prototype=new e.ExplorerModel;c.prototype.getRoot=function(b){if(this.root)b(this.root);else{var c=this;this.fetchItems(this.rootPath).then(function(a){c.root=a;
b(a)})}};c.prototype.getChildren=function(b,c){b===this.root?c(this.root):c([])};return c}();e.ExplorerRenderer=function(){function c(b,c){this.explorer=c;this._init(b);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._progressImageClass="core-sprite-progress";this._twistieSpriteClass="modelDecorationSprite"}c.prototype={_init:function(b){b&&(this._useCheckboxSelection=void 0===b.checkbox?!1:b.checkbox,this.selectionPolicy=b.singleSelection?"singleSelection":
"",this._cachePrefix=b.cachePrefix,this.getCheckedFunc=b.getCheckedFunc,this.onCheckedFunc=b.onCheckedFunc,this._highlightSelection=!0,this._treeTableClass=b.treeTableClass||"treetable",!1===b.highlightSelection&&(this._highlightSelection=!1),this.actionScopeId||(this.actionScopeId=b.actionScopeId),this.commandService||(this.commandService=b.commandService))},getLabelColumnIndex:function(){return this.explorer.checkbox?1:0},initTable:function(b,c){this.tableTree=c;this.tableNode=b;h.empty(b);this._treeTableClass&&
b.classList.add(this._treeTableClass);this.renderTableHeader(b)},getActionsColumn:function(b,c,a,e,d){a=a||"tool";var f=document.createElement("td");f.id=c.id+"actionswrapper";e&&f.classList.add(e);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,f,b,this.explorer,a,null,d&&this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(b,!0):null):window.console.log("Warning, no command service or action scope was specified.  No commands rendered.");
return f},initCheckboxColumn:function(b){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(b,c){if(this._useCheckboxSelection){var a=document.createElement("td"),e=document.createElement("span");e.id=this.getCheckBoxId(c.id);e.classList.add("core-sprite-check");e.classList.add("selectionCheckmarkSprite");e.rowId=c.id;this.getCheckedFunc&&(e.checked=this.getCheckedFunc(b),e.checked?(this._highlightSelection&&c.classList.add("checkedRow"),e.classList.add("core-sprite-check_on")):
(this._highlightSelection&&c.classList.remove("checkedRow"),e.classList.remove("core-sprite-check_on")));a.appendChild(e);var d=this;e.addEventListener("click",function(a){d.onCheck(c,a.target,a.target.checked?!1:!0,!0)},!1);return a}},getCheckBoxId:function(b){return b+"selectedState"},onCheck:function(b,c,a,e,d){(c.checked=a)?c.classList.add("core-sprite-check_on"):c.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(c.rowId,a,e);this.explorer.getNavHandler()&&d&&
this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(b.id).model,!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var b=this.explorer.getNavHandler().getSelectionIds(),c=this._getUIStatePreferencePath();c&&window.sessionStorage&&(window.sessionStorage[c+"selection"]=JSON.stringify(b))}},_restoreSelections:function(b){var c=this.explorer.getNavDict(),a=this.explorer.getNavHandler();if(a&&c&&"cursorOnly"!==a.getSelectionPolicy()&&(b=window.sessionStorage[b+
"selection"],"string"===typeof b&&(b=0<b.length?JSON.parse(b):null),b)){for(var e=[],a=0;a<b.length;a++){var d=c.getValue(b[a]);if(d&&d.rowDomNode&&d.model&&(e.push(d.model),this._highlightSelection&&d.rowDomNode.classList.add("checkedRow"),d=h.node(this.getCheckBoxId(d.rowDomNode.id))))d.checked=!0,d.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(e),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(b){window.sessionStorage[b+
"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(b){var c=!1,a=window.sessionStorage[b+"expanded"];"string"===typeof a&&(a=0<a.length?JSON.parse(a):null);var e;if(a)for(e=0;e<a.length;e++)if(h.node(a[e])){this._expanded.push(a[e]);var d=this;this.tableTree.expand(a[e],function(){d._restoreSelections(b)});c=!0}return!c},_getUIStatePreferencePath:function(){if(this.explorer){var b=this.explorer.getRootPath();if(this._cachePrefix&&b)return b=b.replace(/[^\.\:\-\_0-9A-Za-z]/g,""),
"/"+this._cachePrefix+"/"+b+"/uiState"}return null},expandCollapseImageId:function(b){return b+"__expand"},updateExpandVisuals:function(b,c){var a=h.node(this.expandCollapseImageId(b.id));a&&(a.classList.remove(this._expandImageClass),a.classList.remove(this._collapseImageClass),a.classList.remove(this._progressImageClass),a.classList.add("progress"===c?this._progressImageClass:c?this._expandImageClass:this._collapseImageClass))},getExpandImage:function(b,c,a,e){var d=document.createElement("span");
d.id=this.expandCollapseImageId(b.id);c.appendChild(d);d.classList.add(this._twistieSpriteClass);d.classList.add(this._collapseImageClass);if(a){var f=document.createElement("span");c.appendChild(f);f.classList.add(e||"imageSprite");f.classList.add(a)}var g=this;d.onclick=function(a){if(!g.explorer.getNavHandler().isDisabled(b)){g.tableTree.toggle(b.id);if(g.tableTree.isExpanded(b.id))g._expanded.push(b.id),g.explorer.postUserExpand&&g.explorer.postUserExpand(b.id);else for(var c in g._expanded)if(g._expanded[c]===
b.id){g._expanded.splice(c,1);break}(a=g._getUIStatePreferencePath())&&window.sessionStorage&&g._storeExpansions(a)}};return d},render:function(b,c){c.classList.add("navRow");this.renderRow(b,c)},rowsChanged:function(){"cursorOnly"!==this.explorer.selectionPolicy&&(this.explorer.refreshSelection(),this.explorer.initNavHandler());(h.$(".sectionTreeTable",this.tableNode.parentNode)||h.$(".treetable",this.tableNode.parentNode))&&h.$$array(".treeTableRow",this.tableNode).forEach(function(b,c){var a=!(c%
2)?"darkSectionTreeTableRow":"lightSectionTreeTableRow",e="darkSectionTreeTableRow"===a?"lightSectionTreeTableRow":"darkSectionTreeTableRow";b.classList.add(a);b.classList.remove(e)})},updateCommands:function(){if(this.commandService)for(var b=h.$$array(".treeTableRow"),c=0;c<b.length;c++){var a=b[c],e=h.node(a.id+"actionswrapper");this.commandService.destroy(e);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,e,a._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=
[];var b=this._getUIStatePreferencePath();b&&window.sessionStorage&&this._restoreExpansions(b)&&this._restoreSelections(b)}};return c}();e.SelectionRenderer=function(){function c(b,c){this._init(b);this.explorer=c}c.prototype=new e.ExplorerRenderer;c.prototype.renderTableHeader=function(b){var c=document.createElement("thead"),a=document.createElement("tr");c.classList.add("navTableHeading");this._useCheckboxSelection&&a.appendChild(this.initCheckboxColumn(b));for(var e=0,d=this.getCellHeaderElement(e);d;)0<
d.innerHTML.length&&d.classList.add("navColumn"),a.appendChild(d),d=this.getCellHeaderElement(++e);c.appendChild(a);0<e&&b.appendChild(c)};c.prototype.renderRow=function(b,c){c.verticalAlign="baseline";c.classList.add("treeTableRow");"cursorOnly"!==this.explorer.selectionPolicy&&c.classList.add("selectableNavRow");var a=this.explorer.getNavDict();if(a){a.addRow(b,c);var e=this;c.addEventListener("click",function(a){if(e.explorer.getNavHandler())e.explorer.getNavHandler().onClick(b,a)},!1)}if(a=this.getCheckboxColumn(b,
c))a.classList.add("checkColumn"),c.appendChild(a);for(var a=0,d=this.getCellElement(a,b,c);d;)c.appendChild(d),0===a?this.getPrimColumnStyle?d.classList.add(this.getPrimColumnStyle(b)):d.classList.add("navColumn"):this.getSecondaryColumnStyle?d.classList.add(this.getSecondaryColumnStyle()):d.classList.add("secondaryColumn"),d=this.getCellElement(++a,b,c)};c.prototype.getCellHeaderElement=function(b){};c.prototype.getCellElement=function(b,c,a){};return c}();e.SimpleFlatModel=function(){function c(b,
c,a){this.items=b;this.getKey=a;this.idPrefix=c;this.root={children:b}}c.prototype=new e.ExplorerModel;c.prototype.getRoot=function(b){b(this.root)};c.prototype.getId=function(b){b=this.getKey(b).replace(/[\\\/]/g,"");for(var c="",a=0;a<b.length;a++)c=b[a].match(/[^\.\:\-\_0-9A-Za-z]/g)?c+b.charCodeAt(a):c+b[a];return this.idPrefix+c};c.prototype.getChildren=function(b,c){b===this.root?c(this.items):c([])};return c}();return e});
define("orion/explorers/navigatorRenderer","i18n!orion/navigate/nls/messages orion/Deferred orion/explorers/explorer orion/explorers/navigationUtils orion/extensionCommands orion/objects orion/URITemplate orion/webui/littlelib".split(" "),function(k,l,h,f,d,g,e,c){function b(a){switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":return!0}return!1}function m(a,c,f,m,h,k,z,x,A){c=g.clone(c);var p;if(c.Directory)p=document.createElement("a"),
p.className="navlinkonpage",p.href=!a?n:(new e(a+"#{,resource,params*}")).expand({resource:c.ChildrenLocation}),c.Name&&p.appendChild(document.createTextNode(c.Name));else{h||(h=d.getOpenWithCommands(f));p=document.createElement("a");p.className="navlink targetSelector";k&&"object"===typeof k&&Object.keys(k).forEach(function(a){p[a]=k[a]});var B=null,y=null;if(B=x?x.holderDom:p)y=document.createElement("span"),y.className="core-sprite-file modelDecorationSprite thumbnail",B.appendChild(y);c.Name&&
p.appendChild(document.createTextNode(c.Name));var C=c.Location;z&&"object"===typeof z&&(c.params={},g.mixin(c.params,z));(a=d.getOpenWithCommand(f,c,h))&&(C=a.hrefCallback({items:c}));l.when(m.getFileContentType(c),function(a){if(B){var e=B,d=y;if(a){var f,g=a.imageClass,n=a.image;g?(f=document.createElement("span"),f.className+=g,f.classList.add("thumbnail")):n&&(f=document.createElement("img"),f.src=n,f.classList.add("thumbnail"));f&&e.replaceChild(f,d)}}p.href=C;A&&"function"===typeof A.updateFileNode&&
A.updateFileNode(c,p,b(a))})}p.addEventListener("click",function(){q=c}.bind(this),!1);return p}function a(a,b,c,e){this.explorer=b;this.commandService=c;this.contentTypeService=e;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}var n=new e("#{,resource,params*}"),q;a.prototype=new h.SelectionRenderer;a.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};a.prototype.tableCallback=function(a){a.setAttribute("aria-label",k.Navigator);a.setAttribute("role",
"presentation")};a.prototype.rowCallback=function(a,b){a.setAttribute("role","treeitem")};a.prototype.emptyCallback=function(a){var b=document.createElement("tr"),e=document.createElement("td");e.colSpan=this.oneColumn?1:3;var d=document.createElement("div");d.classList.add("noFile");d.textContent=k.NoFile;var f=document.createElement("span");f.appendChild(document.createTextNode(k.File));c.processDOMNodes(d,[f]);e.appendChild(d);b.appendChild(e);a.appendChild(b)};a.prototype.getCellHeaderElement=
function(a){if(this.oneColumn&&0!==a)return null;switch(a){case 0:case 1:case 2:document.createElement("th").style.height="8px"}};a.prototype.setTarget=function(a){this.target=a};a.prototype.getFolderImage=function(a){if(!this.showFolderImage)return null;a=document.createElement("span");a.className="core-sprite-folder modelDecorationSprite";return a};a.prototype.createFolderNode=function(a){var b;this.showFolderLinks?(b=m(this.folderLink||"",a,this.commandService,this.contentTypeService),(a=this.getFolderImage(a))&&
b.insertBefore(a,b.firstChild)):(b=document.createElement("span"),b.textContent=a.Name);return b};a.prototype.updateFileNode=function(a,b,c){};a.prototype.showFolderLinks=!0;a.prototype.getCellElement=function(a,b,c){switch(a){case 0:a=document.createElement("td");var e=document.createElement("span");e.id=c.id+"MainCol";e.setAttribute("role","presentation");a.appendChild(e);a.setAttribute("role","presentation");e.className="mainNavColumn";var g;b.Directory?(this.getExpandImage(c,e),g=this.createFolderNode(b),
e.appendChild(g),this.explorer._makeDropTarget(b,g),this.explorer._makeDropTarget(b,c)):(this.openWithCommands||(this.openWithCommands=d.getOpenWithCommands(this.commandService)),g=m("",b,this.commandService,this.contentTypeService,this.openWithCommands,{target:this.target},null,null,this),e.appendChild(g));g&&(g.id=c.id+"NameLink",1===g.nodeType&&(f.addNavGrid(this.explorer.getNavDict(),b,g),g.setAttribute("role","link"),g.setAttribute("tabindex","-1")));this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,
e,b,this.explorer,"tool",null,!0);return a;case 1:if(this.oneColumn)return null;c=document.createElement("td");b.LocalTimeStamp&&(c.textContent=(new Date(b.LocalTimeStamp)).toLocaleString());return c;case 2:if(this.oneColumn)return null;c=document.createElement("td");!b.Directory&&"number"===typeof b.Length&&(b=parseInt(b.Length,10)/1024,c.textContent=Math.ceil(b).toLocaleString()+" KB");c.style.textAlign="right";return c}};a.prototype.constructor=a;return{NavigatorRenderer:a,isImage:b,getClickedItem:function(){return q},
createLink:m}});
define("orion/searchClient","i18n!orion/search/nls/messages require orion/webui/littlelib orion/i18nUtil orion/searchUtils orion/crawler/searchCrawler orion/explorers/navigatorRenderer orion/extensionCommands orion/Deferred".split(" "),function(k,l,h,f,d,g,e,c,b){function m(a,b){this.serviceRegistry=a;this.commandRegistry=b;this.openWithCommands=null}function a(a){this.registry=a.serviceRegistry;this._commandService=a.commandService;this._fileService=a.fileService;this.defaultRenderer=new m(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}m.prototype.makeRenderFunction=function(a,g,m,s,t){var w=this.serviceRegistry,v=this.commandRegistry;this.openWithCommands=this.openWithCommands||c.createOpenWithCommands(w,a,v);var u=this;return function(c,x,w,p){b.when(u.openWithCommands,function(b){if(w)h.empty(g),b=document.createElement("div"),b.appendChild(document.createTextNode(k["Search failed."])),g.appendChild(b),"function"===typeof s&&s(g);else{var y=
function(){function a(b,c){var e=c.folderName?c.folderName:c.path,d=document.createElement("span");d.id=e.replace(/[^a-zA-Z0-9_\.:\-]/g,"");d.appendChild(document.createTextNode(" - "+e+" "));b.appendChild(d)}var b={};return function(c,e){var d=e.name;if(b.hasOwnProperty(d)){a(c,e);var p=b[d];"function"===typeof p&&(b[d]=null,p())}else b[d]=function(){a(c,e)}}}(),C=!1;h.empty(g);if(c&&0<c.length){var K=document.createElement("table");K.setAttribute("role","presentation");for(var Q=0;Q<c.length;Q++){var E=
c[Q],L;C||(C=!0,m&&(L=K.insertRow(0).insertCell(0),L.textContent=m));L=K.insertRow(-1).insertCell(0);L.colspan=2;t&&t(L);var u={Name:E.name,Directory:E.directory,Location:E.path||E.location},F=null;"number"===typeof E.LineNumber&&(F={},F.line=E.LineNumber);if(p&&p.keyword&&!p.nameSearch){var M=d.generateSearchHelper(p),F=F||{};F.find=M.inFileQuery.searchStr;F.regEx=M.inFileQuery.wildCard?!0:void 0}u=e.createLink(l.toUrl("edit/edit.html"),u,v,a,b,{"aria-describedby":(E.folderName?E.folderName:E.path).replace(/[^a-zA-Z0-9_\.:\-]/g,
""),style:{verticalAlign:"middle"}},F);E.LineNumber&&u.appendChild(document.createTextNode(" (Line "+E.LineNumber+")"));L.appendChild(u);y(L,E)}g.appendChild(K);"function"===typeof s&&s(g)}!C&&x&&(b=f.formatMessage(k["No matches found for ${0}"],x),h.empty(g),g.appendChild(document.createTextNode(b)),"function"===typeof s&&s(g))}})}};a.prototype={search:function(a,b,c){var e=function(a){for(var c=[],e=0;e<a.response.docs.length;e++){var f=a.response.docs[e],g=f.Location,n=d.path2FolderName(f.Path?
f.Path:f.Location,f.Name),p=n?n:g;(b?0<=p.indexOf(b):1)&&c.push({name:f.Name,path:g,folderName:n,directory:f.Directory,lineNumber:f.LineNumber})}return c};if(this._crawler&&a.nameSearch)this._crawler.searchName(a,function(b){c(e(b),a.keyword,null,a)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(a),"Searching "+a.keyword).then(function(b){var d=a.keyword,d=d.substring(d.indexOf("}")+1),d=d.substring(d.indexOf(":")+1);c(e(b),d,null,a)},function(a){c(null,
null,a,null)})}catch(f){"string"===typeof f&&-1<f.indexOf("search")&&this._crawler?this._crawler.searchName(a,function(b){c(e(b),null,null,a)}):"string"===typeof f&&-1<f.indexOf("search")&&!a.nameSearch?(new g.SearchCrawler(this.registry,this._fileService,a,{childrenLocation:this.getChildrenLocation()})).search(function(b){c(e(b),null,null,a)}):this.registry.getService("orion.page.message").setErrorMessage(f)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=
a},handleError:function(a,b){console.error(a);h.empty(b);b.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,b){var c="",e=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);b&&a&&a.Parents&&0<a.Parents.length?e="last"===b.index?a.Parents[a.Parents.length-1]:a.Parents[0]:a&&a.Directory&&a.Location&&a.Parents&&(e=a);e?(this.setLocationbyURL(e.Location),c=e.Name,this._childrenLocation=e.ChildrenLocation):a&&(this.setLocationbyURL(this._searchRootLocation),
c=this._fileService.fileServiceName(a.Location),this._childrenLocation=a.ChildrenLocation);e=h.node("search");c||(c="");if(e&&e.placeholder){e.value="";var d=f.formatMessage(k["Search ${0}"],c);e.placeholder=30<d.length?d.substring(0,27)+"...":f.formatMessage(k["Search ${0}"],c)}e&&e.title&&(e.title=k["Type a keyword or wild card to search in "]+c)},setLocationbyURL:function(a){this._searchLocation=a},setRootLocationbyURL:function(a){this._searchRootLocation=a},setChildrenLocationbyURL:function(a){this._childrenLocation=
a},getSearchLocation:function(){return this._searchLocation?this._searchLocation:this._fileService.fileServiceRootURL()},getSearchRootLocation:function(){return this._searchRootLocation?this._searchRootLocation:this._fileService.fileServiceRootURL()},getChildrenLocation:function(){return this._childrenLocation?this._childrenLocation:this._fileService.fileServiceRootURL()},createSearchParams:function(a,b,c,e){c=c?this.getSearchRootLocation():this.getSearchLocation();return b?{resource:c,sort:"NameLower asc",
rows:100,start:0,nameSearch:!0,keyword:a}:{resource:c,sort:e&&e.sort?e.sort:"Path asc",rows:e&&e.rows?e.rows:40,start:0,caseSensitive:e?e.caseSensitive:void 0,regEx:e?e.regEx:void 0,fileType:e?e.fileType:void 0,keyword:a,replace:e?e.replace:void 0}}};a.prototype.constructor=a;return{Searcher:a}});
define("orion/compare/nls/root/messages",{"Copy current change from right to left":"Copy current change from right to left","Copy current change from left to right":"Copy current change from left to right","Switch to unified diff":"Switch to unified diff",Unified:"Unified","Switch to side by side diff":"Switch to side by side diff","Side by side":"Side by side","Generate link of the current diff":"Generate link of the current diff","Generate Link":"Generate Link","Next diff block":"Next diff block",
"Previous diff block":"Previous diff block","Next diff change":"Next diff change","Previous diff change":"Previous diff change","Copy the link URL:":"Copy the link URL:",Compare:"Compare","Open the compare page":"Open the compare page","fetching...":"fetching...","There are unsaved changes.":"There are unsaved changes.","ERROR: ":"ERROR: ","Compare...":"Compare...","files changed":" files changed",Location:"Location",Options:"Options","Sort by folders":"Sort by folders","Line 0 : Col 0":"Line 0 : Col 0",
"No Matching DiffService for location:":"No Matching DiffService for location:","${0} files compared. The two folders are identical.":"${0} files compared. The two folders are identical."});define("orion/compare/nls/messages",["orion/i18n!orion/compare/nls/messages","orion/compare/nls/root/messages"],function(k,l){var h={root:l};Object.keys(k).forEach(function(f){"undefined"===typeof h[f]&&(h[f]=k[f])});return h});
define("orion/compare/compareCommands",["i18n!orion/compare/nls/messages","orion/commands","orion/keyBinding","orion/webui/littlelib"],function(k,l,h,f){var d={};d.CompareCommandFactory=function(){function d(e){this.setOptions(e,!0)}d.prototype={setOptions:function(e,c){c&&(this.options={});this.options||(this.options={});e&&Object.keys(e).forEach(function(b){this.options[b]=e[b]}.bind(this))},getOptions:function(){return this.options},initCommands:function(e){var c=this.options.commandSpanId,b=this.options.commandService;
if(b&&c){var d=new l.Command({name:k["Copy current change from right to left"],tooltip:k["Copy current change from right to left"],imageClass:"core-sprite-leftarrow",id:"orion.compare.copyToLeft",groupId:"orion.compareGroup",visibleWhen:function(a){return"twoWay"===e.type&&!e.getImageMode()&&e.options.newFile&&!e.options.newFile.readonly}.bind(this),callback:function(a){a.items.copyToLeft()}}),a=new l.Command({name:k["Copy current change from left to right"],tooltip:k["Copy current change from left to right"],
imageClass:"core-sprite-rightarrow",id:"orion.compare.copyToRight",groupId:"orion.compareGroup",visibleWhen:function(a){return"twoWay"===e.type&&!e.getImageMode()&&e.options.oldFile&&!e.options.oldFile.readonly}.bind(this),callback:function(a){a.items.copyToRight()}}),f=new l.Command({tooltip:k["Switch to unified diff"],name:k.Unified,id:"orion.compare.toggle2Inline",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.toggler&&"twoWay"===a.options.toggler.getWidget().type},callback:function(a){a.items.options.toggler.toggle()}}),
g=new l.Command({tooltip:k["Switch to side by side diff"],name:k["Side by side"],id:"orion.compare.toggle2TwoWay",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.toggler&&"inline"===a.options.toggler.getWidget().type},callback:function(a){a.items.options.toggler.toggle()}}),r=new l.Command({name:k["Next diff block"],tooltip:k["Next diff block"],imageClass:"core-sprite-move-down",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",visibleWhen:function(a){return!e.getImageMode()},
callback:function(a){a.items.nextDiff()}}),s=new l.Command({name:k["Previous diff block"],tooltip:k["Previous diff block"],imageClass:"core-sprite-move-up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",visibleWhen:function(a){return!e.getImageMode()},callback:function(a){a.items.prevDiff()}}),t=new l.Command({name:k["Next diff change"],tooltip:k["Next diff change"],imageClass:"core-sprite-move-down",id:"orion.compare.nextChange",groupId:"orion.compareGroup",visibleWhen:function(a){return!e.getImageMode()},
callback:function(a){a.items.nextChange()}}),w=new l.Command({name:k["Previous diff change"],tooltip:k["Previous diff change"],imageClass:"core-sprite-move-up",id:"orion.compare.prevChange",groupId:"orion.compareGroup",visibleWhen:function(a){return!e.getImageMode()},callback:function(a){a.items.prevChange(a)}});b.addCommand(d);b.addCommand(a);b.addCommand(g);b.addCommand(f);b.addCommand(r);b.addCommand(s);b.addCommand(t);b.addCommand(w);b.registerCommandContribution(c,"orion.compare.toggle2Inline",
108);b.registerCommandContribution(c,"orion.compare.toggle2TwoWay",109);b.registerCommandContribution(c,"orion.compare.copyToLeft",110,null,!1,new h.KeyBinding(37,!0,!1,!0));b.registerCommandContribution(c,"orion.compare.copyToRight",111,null,!1,new h.KeyBinding(39,!0,!1,!0));b.registerCommandContribution(c,"orion.compare.nextDiff",112,null,!1,new h.KeyBinding(40,!0));b.registerCommandContribution(c,"orion.compare.prevDiff",113,null,!1,new h.KeyBinding(38,!0));e.options.wordLevelNav?(b.registerCommandContribution(c,
"orion.compare.nextChange",114,null,!1,new h.KeyBinding(40,!0,!0)),b.registerCommandContribution(c,"orion.compare.prevChange",115,null,!1,new h.KeyBinding(38,!0,!0))):(b.registerCommandContribution(c,"orion.compare.nextChange",114,null,!0,new h.KeyBinding(40,!0,!0)),b.registerCommandContribution(c,"orion.compare.prevChange",115,null,!0,new h.KeyBinding(38,!0,!0)))}},renderCommands:function(e){var c=this.options.commandSpanId,b=this.options.commandService;b&&c&&(f.empty(f.node(c)),this.options.gridRenderer&&
this.options.gridRenderer.navGridHolder?(this.options.gridRenderer.navGridHolder.splice(0,this.options.gridRenderer.navGridHolder.length),this.options.gridRenderer.additionalCmdRender?this.options.gridRenderer.before?(this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder),b.renderCommands(c,c,e,e,"tool",null,this.options.gridRenderer.navGridHolder)):(b.renderCommands(c,c,e,e,"tool",null,this.options.gridRenderer.navGridHolder),this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder)):
b.renderCommands(c,c,e,e,"tool",null,this.options.gridRenderer.navGridHolder)):b.renderCommands(c,c,e,e,"tool",null))}};return d}();return d});
define("orion/compare/compareUtils",["orion/URITemplate"],function(k){var l=l||{};l.compareUtils=l.compareUtils||{};l.compareUtils.lookUpMapper=function(h,f,d){for(var g=0,e=0;e<h.length;e++){var c=h[e][f];0===c&&(c=1);if(d>=g&&d<g+c)return{mapperIndex:e,startFrom:g};if(e===h.length-1)break;g+=h[e][f]}return{mapperIndex:h.length-1,startFrom:g}};l.compareUtils.lookUpLineIndex=function(h,f,d){if(0===d)return 0;for(var g=0,e=0;e<d;e++)g+=h[e][f];return g};l.compareUtils.updateMapper=function(h,f,d,g,
e){if(g!==e&&(0<g||0<e)){var c=l.compareUtils.lookUpMapper(h,f,d);if(!(0>c.mapperIndex)){if(0<g){var b=d-c.startFrom;for(d=c.mapperIndex;d<h.length;d++){b=h[d][f]-b;if(g<=b){h[d][f]-=g;break}h[d][f]-=b;g-=b;b=0}}0<e&&(h[c.mapperIndex][f]+=e)}}};l.compareUtils.overlapMapper=function(h,f,d,g,e){h=d+h[f]-1;h<d&&(h=d);e<g&&(e=g);return h<g||e<d?!1:!0};l.compareUtils.findFirstDiff=function(h,f,d,g){for(var e=0,c=null,b=0;b<h.length&&!(e>g)&&(!l.compareUtils.overlapMapper(h[b],f,e,d,g)||!(c={mapperIndex:b,
startFrom:e},0!==h[b][2]));b++)e+=h[b][f];return c};l.compareUtils.matchMapper=function(h,f,d,g){if(0===h.length)return d;var e=d+Math.round((g-d)/3),c=l.compareUtils.findFirstDiff(h,f,d,g),b=0===h[c.mapperIndex][f]?c.startFrom:c.startFrom+h[c.mapperIndex][f]-1,m=l.compareUtils.lookUpLineIndex(h,1-f,c.mapperIndex),a=c.startFrom-d;return 0===h[c.mapperIndex][2]?m-a:e>=c.startFrom&&e<=b?m-Math.round((g-d)/3):e<c.startFrom?m-a:(0===h[c.mapperIndex][1-f]?m:m+h[c.mapperIndex][1-f]-1)-(b-d)};l.compareUtils.getMapperLineCount=
function(h){for(var f=0,d=0;d<h.length;d++)f+=Math.max(h[d][0],h[d][1]);return f};l.compareUtils.getAnnotationIndex=function(h,f){for(var d=0;d<h.length;d++)if(h[d][0]===f)return d;return-1};l.compareUtils.getAnnotationMapperIndex=function(h,f){return h[f][1]};l.compareUtils.getAnnotationIndexByMapper=function(h,f){for(var d=0;d<h.length;d++)if(h[d][1]===f)return{current:d,prev:d-1,next:d+1};return{current:-1,prev:-1,next:-1}};l.compareUtils.isMapperConflict=function(h,f){return 0>f||!h[f][3]?!1:
1===h[f][3]};l.compareUtils.mergeDiffBlocks=function(h,f,d,g,e,c){for(var b=0;b<f.length;b++){var m=f[b][0],a=d[f[b][1]];if(0<a[0]){for(var n="",q=0;q<a[0];q++)n=n+g[a[2]-1+q].substring(e)+c;a=h.getLineCount();m>=a&&(m=h.getLineEnd(a-1),q=h.getLineEnd(a-1,!0),m===q?(h.setText(c,m,m),m=a):m=a-1);m=h.getLineStart(m);h.setText(n,m,m)}}};l.compareUtils.generateCompareHref=function(h,f){var d=require.toUrl("compare/compare.html");f.conflict||(f.conflict=void 0);f.readonly||(f.readonly=void 0);return(new k(d+
"#{,resource,params*}")).expand({resource:h,params:f})};l.compareUtils.generateCompareTreeHref=function(h,f){var d=require.toUrl("compare-tree/compare-tree.html");return(new k(d+"#{,resource,params*}")).expand({resource:h,params:f})};return l.compareUtils});
define("orion/compare/diffProvider",["i18n!orion/compare/nls/messages","orion/Deferred"],function(k,l){function h(d,f,e){var c=new l;d[f].apply(d,e).then(function(b){c.resolve(b)},function(b){c.reject(b)});return c}function f(d,f){var e=d.getServiceReferences("orion.core.diff"),c,b=e;if(f){b=[];for(c=0;c<e.length;++c)f(e[c])&&b.push(e[c])}var m=[],a=[];for(c=0;c<b.length;++c)m[c]=RegExp(b[c].getProperty("pattern")||".*"),a[c]=d.getService(b[c]);this._getService=function(b){if(-1===b.indexOf("://")){var c=
document.createElement("a");c.href=b;b=c.href}for(c=0;c<m.length;++c)if(m[c].test(b))return a[c];throw k["No Matching DiffService for location:"]+b;}}f.prototype={getDiffContent:function(d){return h(this._getService(d),"getDiffContent",arguments)},getDiffFileURI:function(d){return h(this._getService(d),"getDiffFileURI",arguments)}};return{DiffProvider:f}});
define("orion/compare/diffParser",[],function(){var k=k||{};k.DiffParser=function(){function k(f,d){this._lineDelimiter=f?f:h?"\r\n":"\n";this._diffLineDelimiter=d?d:this._lineDelimiter;this._DEBUG=!1}var h=-1!==window.navigator.platform.indexOf("Win");k.prototype={_init:function(){this._oFileContents=[];this._diffContents=[];this._oBlocks=[];this._nBlocks=[];this._hunkRanges=[];this._lastToken=" ";this._deltaMap=[];this._nFileContents=[];this._nNewLineAtEnd=this._oNewLineAtEnd=!0;this._diffContentIndex=
1},setLineDelim:function(f){this._diffLineDelimiter=this._lineDelimiter=f},getDiffArray:function(){return{array:this._diffContents,index:this._diffContentIndex}},parse:function(f,d,g,e){this._init();if(""===d)return{outPutFile:f,mapper:[]};this._oFileContents=""===f?[]:f.split(this._lineDelimiter);this._diffContents=d.split(this._diffLineDelimiter);d=this._diffContents.length;this._hunkRanges=[];for(var c=0;c<d;c++){var b=this._parseHunkRange(c);b&&this._hunkRanges.push(b)}if(0===this._hunkRanges.length)return{outPutFile:f,
mapper:[]};this._DEBUG&&(console.log("***Diff contents: \n"),this._diffContents.forEach(function(b){console.log(b)}),console.log("***Hunk ranges: \n"),console.log(JSON.stringify(this._hunkRanges)));for(f=0;f<this._hunkRanges.length;f++)this._parseHunkBlock(f);this._DEBUG&&(console.log("***Original Hunk range blocks: \n"),console.log(JSON.stringify(this._oBlocks)),console.log("***New Hunk range blocks: \n"),console.log(JSON.stringify(this._nBlocks)));this._buildMap(g);this._DEBUG&&(console.log("***New Line at end of file(original): \n"),
console.log(JSON.stringify(this._oNewLineAtEnd)),console.log("***New Line at end of file(new): \n"),console.log(JSON.stringify(this._nNewLineAtEnd)),console.log("***Mapper: \n"),this._logMap(),console.log("***Total line number in original file: "+this._oFileContents.length));e||this._buildNewFile();return{outPutFile:this._nFileContents.join(this._diffLineDelimiter),mapper:this._deltaMap}},_logMap:function(){for(var f=0;f<this._deltaMap.length;f++)if(console.log(JSON.stringify(this._deltaMap[f])),
0<this._deltaMap[f][2]){console.log("    **Diff content on change/add: \n");for(var d=0;d<this._deltaMap[f][0];d++)console.log("    "+this._diffContents[this._deltaMap[f][2]+d-1])}},_logNewFile:function(){for(var f=0;f<this._nFileContents.length;f++)console.log(this._nFileContents[f])},_createBlock:function(f,d,g,e){e===g&&" "===f||(g=[g,e-g,"s"],"-"===f?g[2]="r":"+"===f?g[2]="a":"c"===f&&(g[2]="c"),d.push(g))},_createMinusBlock:function(f,d,g){var e=this._oBlocks.length;0===e||f!==this._oBlocks[e-
1][0]?(this._oBlocks.push([0===f?1:f,g]),this._nBlocks.push([d,0,-2])):this._oBlocks[e-1][1]+=g},_createPlusBlock:function(f,d,g,e){var c=this._nBlocks.length;0===c||d!==this._nBlocks[c-1][0]?(this._oBlocks.push([0===f?1:f,0]),this._nBlocks.push([d,g,e])):(this._nBlocks[c-1][1]+=g,this._nBlocks[c-1][2]=e)},_parseHunkBlock:function(f){for(var d=" ",g=this._hunkRanges[f][0]+1,e=f===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[f+1][0],c=0,b=0,m=this._hunkRanges[f][1],a=this._hunkRanges[f][3],
n=g,h=g;h<e;h++)if(0!==this._diffContents[h].length){var k=this._diffContents[h][0];if("\\"===k&&("\\ No newline at end of file"===this._diffContents[h].substring(0,this._diffContents[h].length-1)||"\\ No newline at end of file"===this._diffContents[h]))"-"===d?this._oNewLineAtEnd=!1:" "===d?this._oNewLineAtEnd=this._nNewLineAtEnd=!1:this._nNewLineAtEnd=!1,h>g&&"\r"===this._diffContents[h-1][this._diffContents[h-1].length-1]&&(this._diffContents[h-1]=this._diffContents[h-1].substring(0,this._diffContents[h-
1].length-1));else{switch(k){case "-":case "+":case " ":break;default:continue}if(d!==k){"+"===k&&(n=h);switch(d){case " ":m=this._hunkRanges[f][1]+c;a=this._hunkRanges[f][3]+b;break;case "-":this._createMinusBlock(m,a,this._hunkRanges[f][1]+c-m);break;case "+":this._createPlusBlock(m,a,this._hunkRanges[f][3]+b-a,n)}d=k}switch(k){case "-":c++;break;case "+":b++;break;case " ":c++,b++}}}switch(d){case "-":this._createMinusBlock(m,a,this._hunkRanges[f][1]+c-m);break;case "+":this._createPlusBlock(m,
a,this._hunkRanges[f][3]+b-a,n)}},_detectConflictes:function(f,d){if(0>f)return!1;for(var g=f+d,e=f;e<g;e++){var c=this._diffContents[e];if(-1<c.indexOf("\x3c\x3c\x3c\x3c\x3c")||-1<c.indexOf("\x3e\x3e\x3e\x3e\x3e"))return!0}return!1},_buildMap:function(f){var d=this._oBlocks.length,g=this._oFileContents.length,e=0,c;c=1;for(var b=0;b<d;b++)c=this._oBlocks[b][0]-c,0<c&&(this._deltaMap.push([c,c,0]),e+=c),f&&this._detectConflictes(this._nBlocks[b][2],this._nBlocks[b][1])?this._deltaMap.push([this._nBlocks[b][1],
this._oBlocks[b][1],this._nBlocks[b][2]+1,1]):this._deltaMap.push([this._nBlocks[b][1],this._oBlocks[b][1],this._nBlocks[b][2]+1]),e+=this._oBlocks[b][1],c=this._oBlocks[b][0]+this._oBlocks[b][1];0<g-c&&(this._deltaMap.push([g-c+1,g-c+1,0]),e+=g-c+1);e<g&&(c=g-e,f=this._deltaMap[this._deltaMap.length-1],0===f[2]?(f[0]+=c,f[1]+=c):-1===f[2]?this._deltaMap.push([c,c,0]):this._nNewLineAtEnd===this._oNewLineAtEnd?this._deltaMap.push([c,c,0]):(this._nNewLineAtEnd&&(f[0]+=c),this._oNewLineAtEnd&&(f[1]+=
c)))},_buildNewFile:function(){var f=1,d=!1,g=this._deltaMap.length,e,c;for(e=0;e<g;e++){d=!1;if(0===this._deltaMap[e][2]){for(c=0;c<this._deltaMap[e][0];c++)this._nFileContents.push(this._oFileContents[f+c-1]);d=!0}else if(0<this._deltaMap[e][2])for(c=0;c<this._deltaMap[e][0];c++)this._nFileContents.push(this._diffContents[this._deltaMap[e][2]+c-1].substring(1));f+=this._deltaMap[e][1]}this._nNewLineAtEnd&&!d&&this._nFileContents.push("")},_converHRangeBody:function(f,d){if(f){var g=parseInt(f,10);
d.push(0<=g?g:1)}else d.push(1)},_parseHunkRange:function(f){var d=this._diffContents[f],g=/^@@\s*\+([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*-([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*@@+/,e=/^@@\s*-([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*\+([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*@@+/.exec(d),c=null;if(e&&5===e.length)c=[f],this._converHRangeBody(e[1],c),this._converHRangeBody(e[2],c),this._converHRangeBody(e[3],c),this._converHRangeBody(e[4],c);else if((e=g.exec(d))&&5===e.length)c=[f],this._converHRangeBody(e[3],c),this._converHRangeBody(e[4],
c),this._converHRangeBody(e[1],c),this._converHRangeBody(e[2],c);return c}};return k}();return k});
define("orion/compare/compareRulers",["orion/compare/compareUtils"],function(k){var l=l||{};l.CompareRuler=function(){function h(f,d,g){this._location=f||"left";this._overview=d||"page";this._rulerStyle=g;this._editor=null;var e=this;this._listener={onModelChanged:function(c){e._onModelChanged(c)}}}h.prototype={setView:function(f){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this._listener.onModelChanged);this._editor=f;this._onModelChanged&&this._editor&&this._editor.addEventListener("ModelChanged",
this._listener.onModelChanged)},getLocation:function(){return this._location},getOverview:function(f){return this._overview},getAnnotationModel:function(){return null},addAnnotationType:function(f){},isAnnotationTypeVisible:function(f){return!1},removeAnnotationType:function(f){},setAnnotationModel:function(f){},getAnnotations:function(f,d){for(var g=[],e=f;e<d;e++){var c=this.getStyle(e);c&&(g[e]={html:this.getHTML(e),style:c})}return g},getWidestAnnotation:function(){return{html:this.getHTML(-1),
style:this.getStyle(-1)}},getRulerStyle:function(){return this.getStyle(void 0)}};return h}();l.LineNumberCompareRuler=function(){function h(f,d,g,e,c,b){l.CompareRuler.call(this,g,"page",e);this._diffNavigator=f;this._oddStyle=c||{style:{backgroundColor:"white"}};this._evenStyle=b||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=d}h.prototype=new l.CompareRuler;h.prototype.getStyle=function(f){return void 0===f?this._rulerStyle:this._evenStyle};h.prototype.getHTML=function(f){var d=
this._editor.getModel(),g=this._diffNavigator.getFeeder(0===this._mapperColumnIndex);return!g?"":-1===f?d.getLineCount():g.getLineNumber?(f=g.getLineNumber(f),-1===f?"":f+1):f+1};h.prototype._onModelChanged=function(f){var d=f.start,g=this._editor.getModel();f=g.getLineCount();var e=(f+"").length;this._numOfDigits!==e&&(this._numOfDigits=e,d=g.getLineAtOffset(d),this._editor.redrawLines(d,f,this))};return h}();l.CompareOverviewRuler=function(){function h(f,d,g,e){this._diffNavigator=g;this._onClick=
e;l.CompareRuler.call(this,f,"document",d)}h.prototype=new l.CompareRuler;h.prototype.getStyle=function(f){var d,g;if(void 0===f)d=this._rulerStyle||{},g=d.style||(d.style={}),g.lineHeight="1px",g.fontSize="1px",g.width="14px";else if(d=-1!==f?{styleClass:"annotationOverview breakpoint"}:{},g=d.style||(d.style={}),g.cursor="pointer",g.width="8px",g.left="2px",0<=f){var e;if(this._diffNavigator&&this._diffNavigator.getFeeder())e=this._diffNavigator.getFeeder().getDiffBlocks();else return null;f=k.getAnnotationIndex(e,
f);if(-1===f)return null;e=k.getAnnotationMapperIndex(e,f);var c;c=this._diffNavigator.getMapper();if(e=k.isMapperConflict(c,e))g.border="1px #FF0000 solid";f===this._diffNavigator.getCurrentBlockIndex()&&(g.backgroundColor=e?"red":"blue");f=this._diffNavigator.getFeeder().getDiffBlockH(f);e=this._diffNavigator.getFeeder().getOverviewLineCount();if(0>f)return null;c=this._editor.getClientArea();f=Math.floor(c.height*f/e);2>f&&(f=2);g.height=f+"px"}else return null;return d};h.prototype.setDiffNavigator=
function(f){this._diffNavigator=f};h.prototype.getHTML=function(f){return"\x26nbsp;"};h.prototype.onClick=function(f,d){void 0!==f&&this._onClick(f,this)};h.prototype._onModelChanged=function(f){0<this._editor.getModel().getLineCount()&&this._editor.redrawLines(0,1,this)};return h}();l.CompareCurveRuler=function(){function h(f){this._canvasDiv=f;this._mapper=void 0}h.prototype={init:function(f,d,g,e){this._rightIniting=this._rightIniting=this._leftIniting=!0;this._mapper=f;this._leftEditor=d;this._rightEditor=
g;this._leftTextView=d.getTextView();this._rightTextView=g.getTextView();this._diffNavigator=e;this.render()},matchPositionFrom:function(f){var d=f?this._leftTextView:this._rightTextView,g=f?this._rightTextView:this._leftTextView,e=d.getTopIndex(),d=d.getBottomIndex();f=k.matchMapper(this._mapper,f?0:1,e,d);g.setTopIndex(f)},copyTo:function(f){if(this._diffNavigator.iterator){var d=this._diffNavigator.iterator.cursor();if(d&&("word"===d.type?!d.copied&&!d.parent.copied:!d.copied)){var g=f?this._rightTextView.getText(d.oldA.start,
d.oldA.end):this._leftTextView.getText(d.newA.start,d.newA.end),e=f?d.newA:d.oldA;(f?this._leftTextView:this._rightTextView).setText(g,e.start,e.end);d.copied=!0}}},render:function(){if(this._mapper){var f=this._canvasDiv.getContext("2d");f.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);f.strokeStyle="#AAAAAA";f.lineWidth=1;f.beginPath();var d=this._leftTextView.getTopIndex(),g=this._leftTextView.getBottomIndex(),e=this._rightTextView.getTopIndex(),c=this._rightTextView.getBottomIndex();
this._leftLineH=this._leftTextView.getLineHeight();this._rightLineH=this._rightTextView.getLineHeight();for(var b=0,m=0,a=!1,n=0;n<this._mapper.length;n++){if(0!==this._mapper[n][2])if(k.overlapMapper(this._mapper[n],0,b,d,g)||k.overlapMapper(this._mapper[n],1,m,e,c))this._renderCurve(n,b,m,this._canvasDiv,f,d,g,e,c),a=!0;else if(a)break;b+=this._mapper[n][0];m+=this._mapper[n][1]}f.stroke()}},_renderCurve:function(f,d,g,e,c,b,m,a,n){b=this._mapper[f];d=this._leftTextView.getLinePixel(d+b[0]/2)+b[0]%
2*this._leftLineH/3-this._leftTextView.getTopPixel();g=this._rightTextView.getLinePixel(g+b[1]/2)+b[1]%2*this._rightLineH/3-this._rightTextView.getTopPixel();e=e.parentNode.clientWidth;f===this._diffNavigator.getCurrentMapperIndex()?(c.stroke(),c.strokeStyle="#000",c.lineWidth=1,c.beginPath(),c.moveTo(0,d),c.bezierCurveTo(e/3,d,0.666*e,g,e,g),c.stroke(),c.strokeStyle="#AAAAAA",c.lineWidth=1,c.beginPath()):(c.moveTo(0,d),c.bezierCurveTo(e/3,d,0.666*e,g,e,g),c.stroke())},onChanged:function(f,d){var g=
d?this._rightIniting:this._leftIniting;if(f.removedLineCount!==f.addedLineCount){var e=d?this._rightTextView:this._leftTextView;g||k.updateMapper(this._mapper,d?1:0,e.getModel().getLineAtOffset(f.start),f.removedLineCount,f.addedLineCount);(0<f.removedLineCount||0<f.addedLineCount)&&this.render()}d?this._rightIniting=!1:this._leftIniting=!1;return g}};return h}();return l});
define("orion/editor/i18n",{load:function(k,l,h,f){l.specified&&l.specified("orion/bootstrap")?l(["orion/i18n!"+k],function(d){h(d)}):h({})}});
define("orion/editor/nls/root/messages",{multipleAnnotations:"Multiple annotations:",line:"Line: ${0}",breakpoint:"Breakpoint",bookmark:"Bookmark",task:"Task",error:"Error",warning:"Warning",matchingSearch:"Matching Search",currentSearch:"Current Search",currentLine:"Current Line",matchingBracket:"Matching Bracket",currentBracket:"Current Bracket",lineUp:"Line Up",lineDown:"Line Down",lineStart:"Line Start",lineEnd:"Line End",charPrevious:"Previous Character",charNext:"Next Character",pageUp:"Page Up",
pageDown:"Page Down",scrollPageUp:"Scroll Page Up",scrollPageDown:"Scroll Page Down",scrollLineUp:"Scroll Line Up",scrollLineDown:"Scroll Line Down",wordPrevious:"Previous Word",wordNext:"Next Word",textStart:"Document Start",textEnd:"Document End",scrollTextStart:"Scroll Document Start",scrollTextEnd:"Scroll Document End",centerLine:"Center Line",selectLineUp:"Select Line Up",selectLineDown:"Select Line Down",selectWholeLineUp:" Select Whole Line Up",selectWholeLineDown:"Select Whole Line Down",
selectLineStart:"Select Line Start",selectLineEnd:"Select Line End",selectCharPrevious:"Select Previous Character",selectCharNext:"Select Next Character",selectPageUp:"Select Page Up",selectPageDown:"Select Page Down",selectWordPrevious:"Select Previous Word",selectWordNext:"Select Next Word",selectTextStart:"Select Document Start",selectTextEnd:"Select Document End",deletePrevious:"Delete Previous Character",deleteNext:"Delete Next Character",deleteWordPrevious:"Delete Previous Word",deleteWordNext:"Delete Next Word",
deleteLineStart:"Delete Line Start",deleteLineEnd:"Delete Line End",tab:"Insert Tab",enter:"Insert Line Delimiter",enterNoCursor:"Insert Line Delimiter",selectAll:"Select All",copy:"Copy",cut:"Cut",paste:"Paste",uppercase:"To Upper Case",lowercase:"To Lower Case",capitalize:"Capitalize",reversecase:"Reverse Case",toggleWrapMode:"Toggle Wrap Mode",toggleTabMode:"Toggle Tab Mode",toggleOverwriteMode:"Toggle Overwrite Mode",committerOnTime:"${0} on ${1}",emacs:"Emacs",exchangeMarkPoint:"Exchange Mark and Point",
setMarkCommand:"Set Mark",clearMark:"Clear Mark",digitArgument:"Digit Argument ${0}",negativeArgument:"Negative Argument",Comment:"Comment","Flat outline":"Flat outline",incrementalFindStr:"Incremental find: ${0}",incrementalFindStrNotFound:"Incremental find: ${0} (not found)",incrementalFindReverseStr:"Reverse Incremental find: ${0}",incrementalFindReverseStrNotFound:"Reverse Incremental find: ${0} (not found)",find:"Find...",undo:"Undo",redo:"Redo",cancelMode:"Cancel Current Mode",findNext:"Find Next Occurrence",
findPrevious:"Find Previous Occurrence",incrementalFind:"Incremental Find",incrementalFindReverse:"Incremental Find Reverse",indentLines:"Indent Lines",unindentLines:"Unindent Lines",moveLinesUp:"Move Lines Up",moveLinesDown:"Move Lines Down",copyLinesUp:"Copy Lines Up",copyLinesDown:"Copy Lines Down",deleteLines:"Delete Lines",gotoLine:"Goto Line...",gotoLinePrompty:"Goto Line:",nextAnnotation:"Next Annotation",prevAnnotation:"Previous Annotation",expand:"Expand",collapse:"Collapse",expandAll:"Expand All",
collapseAll:"Collapse All",lastEdit:"Last Edit Location",trimTrailingWhitespaces:"Trim Trailing Whitespaces",toggleLineComment:"Toggle Line Comment",addBlockComment:"Add Block Comment",removeBlockComment:"Remove Block Comment",linkedModeEntered:"Linked Mode entered",linkedModeExited:"Linked Mode exited",syntaxError:"Syntax Error",contentAssist:"Content Assist",lineColumn:"Line ${0} : Col ${1}",vi:"vi",vimove:"(Move)",viyank:"(Yank)",videlete:"(Delete)",vichange:"(Change)",viLeft:"${0} Left",viRight:"${0} Right",
viUp:"${0} Up",viDown:"${0} Down",viw:"${0} Next Word",vib:"${0} Beginning of Word",viW:"${0} Next Word (ws stop)",viB:"${0} Beginning of Word (ws stop)",vie:"${0} End of Word",viE:"${0} End of Word (ws stop)",vi$:"${0} End of the line","vi^_":"${0} First non-blank Char Current Line","vi+":"${0} First Char Next Line","vi-":"${0} First Char Previous Line","vi|":"${0} nth Column in Line",viH:"${0} Top of Page",viM:"${0} Middle of Page",viL:"${0} Bottom of Page","vi/":"${0} Search Forward","vi?":"${0} Search Backward",
vin:"${0} Next Search",viN:"${0} Previous Search",vif:"${0} Search Char Fwd",viF:"${0} Search Char Bckwd",vit:"${0} Search Before Char Fwd",viT:"${0} Search Before Char Bckwd","vi,":"${0} Repeat Reverse Char Search","vi;":"${0} Repeat Char Search",viG:"${0} Go to Line",viycd:"${0} Current Line",via:"Append After Cursor",viA:"Append to End of Line",vii:"Insert Before Cursor",viI:"Insert at Beginning of Line",viO:"Insert Line Above",vio:"Insert Line Below",viR:"Begin Overwriting Text",vis:"Substitute a Character",
viS:"Substitute Entire Line",viC:"Change Text Until Line End",vip:"Paste After Char or Line",viP:"Paste Before Char or Line",viStar:"Search Word Under Cursor",replaceAll:"Replacing all...",replacedMatches:"Replaced ${0} matches",nothingReplaced:"Nothing replaced",notFound:"Not found"});
define("orion/editor/nls/messages",["orion/editor/i18n!orion/editor/nls/messages","orion/editor/nls/root/messages"],function(k,l){var h={root:l},f;for(f in k)k.hasOwnProperty(f)&&"undefined"===typeof h[f]&&(h[f]=k[f]);return h});
define("orion/editor/textModel",["orion/editor/eventTarget","orion/regex","orion/util"],function(k,l,h){function f(d,f){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(d);this.setLineDelimiter(f)}f.prototype={destroy:function(){},find:function(d){1<this._text.length&&(this._text=[this._text.join("")]);var f=d.string,e=d.regex,c=f,b="",m=d.caseInsensitive;if(c)if(e){if(f=l.parse(c))c=f.pattern,b=f.flags}else c=f.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$\x26"),m&&(c=c.replace(/[iI\u0130\u0131]/g,
"[Ii\u0130\u0131]"));var a=null,n;if(c){var f=d.reverse,h=d.wrap,e=d.wholeWord,k=d.start||0;d=d.end;var s=null!==d&&void 0!==d;-1===b.indexOf("g")&&(b+="g");-1===b.indexOf("m")&&(b+="m");m&&-1===b.indexOf("i")&&(b+="i");e&&(c="\\b"+c+"\\b");var t=this._text[0],w,v,u=0;s&&(m=k<d?k:d,t=t.substring(m,k<d?d:k),u=m);var z=RegExp(c,b);f?n=function(){var a=null;for(z.lastIndex=0;;){v=z.lastIndex;w=z.exec(t);if(v===z.lastIndex)return null;if(w){if(!(w.index+u<k)){if(!h||a)break;k=t.length+u}a={start:w.index+
u,end:z.lastIndex+u}}else break}a&&(k=a.start);return a}:(s||(z.lastIndex=k),n=function(){for(;;){v=z.lastIndex;w=z.exec(t);if(v===z.lastIndex)break;if(w)return{start:w.index+u,end:z.lastIndex+u};if(!(0!==v&&h))break}return null});a=n()}return{next:function(){var b=a;b&&(a=n());return b},hasNext:function(){return null!==a}}},getCharCount:function(){for(var d=0,f=0;f<this._text.length;f++)d+=this._text[f].length;return d},getLine:function(d,f){var e=this.getLineCount();if(!(0<=d&&d<e))return null;
var c=this._lineOffsets[d];if(d+1<e){e=this.getText(c,this._lineOffsets[d+1]);if(f)return e;for(var c=e.length,b;10===(b=e.charCodeAt(c-1))||13===b;)c--;return e.substring(0,c)}return this.getText(c)},getLineAtOffset:function(d){var f=this.getCharCount();if(!(0<=d&&d<=f))return-1;var e=this.getLineCount();if(d===f)return e-1;var c,b,m=this._lastLineIndex;if(0<=m&&m<e&&(c=this._lineOffsets[m],b=m+1<e?this._lineOffsets[m+1]:f,c<=d&&d<b))return m;for(var a=e,n=-1;1<a-n;)if(m=Math.floor((a+n)/2),c=this._lineOffsets[m],
b=m+1<e?this._lineOffsets[m+1]:f,d<=c)a=m;else if(d<b){a=m;break}else n=m;return this._lastLineIndex=a},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(d,f){var e=this.getLineCount();if(!(0<=d&&d<e))return-1;if(d+1<e){e=this._lineOffsets[d+1];if(f)return e;for(var c=this.getText(Math.max(this._lineOffsets[d],e-2),e),b=c.length,m;10===(m=c.charCodeAt(b-1))||13===m;)b--;return e-(c.length-b)}return this.getCharCount()},
getLineStart:function(d){return!(0<=d&&d<this.getLineCount())?-1:this._lineOffsets[d]},getText:function(d,f){void 0===d&&(d=0);void 0===f&&(f=this.getCharCount());if(d===f)return"";for(var e=0,c=0,b;c<this._text.length;){b=this._text[c].length;if(d<=e+b)break;e+=b;c++}for(var m=e,a=c;c<this._text.length;){b=this._text[c].length;if(f<=e+b)break;e+=b;c++}if(a===c)return this._text[a].substring(d-m,f-e);m=this._text[a].substring(d-m);e=this._text[c].substring(0,f-e);return m+this._text.slice(a+1,c).join("")+
e},onChanging:function(d){return this.dispatchEvent(d)},onChanged:function(d){return this.dispatchEvent(d)},setLineDelimiter:function(d,f){"auto"===d&&(d=void 0,1<this.getLineCount()&&(d=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0))));this._lineDelimiter=d?d:h.platformDelimiter;if(f){var e=this.getLineCount();if(1<e){for(var c=Array(e),b=0;b<e;b++)c[b]=this.getLine(b);this.setText(c.join(this._lineDelimiter))}}},setText:function(d,f,e){void 0===d&&(d="");void 0===f&&(f=0);void 0===e&&(e=
this.getCharCount());if(!(f===e&&""===d)){for(var c=this.getLineAtOffset(f),b=this.getLineAtOffset(e),m=f,a=e-f,n=b-c,h=d.length,k=0,l=this.getLineCount(),t=0,w=0,v=0,u=[];;){-1!==t&&t<=v&&(t=d.indexOf("\r",v));-1!==w&&w<=v&&(w=d.indexOf("\n",v));if(-1===w&&-1===t)break;v=-1!==t&&-1!==w?t+1===w?w+1:(t<w?t:w)+1:-1!==t?t+1:w+1;u.push(f+v);k++}this.onChanging({type:"Changing",text:d,start:m,removedCharCount:a,addedCharCount:h,removedLineCount:n,addedLineCount:k});0===u.length&&(v=this.getLineStart(c),
b=b+1<l?this.getLineStart(b+1):this.getCharCount(),f!==v&&(d=this.getText(v,f)+d,f=v),e!==b&&(d+=this.getText(e,b),e=b));v=h-a;for(b=c+n+1;b<l;b++)this._lineOffsets[b]+=v;if(5E4>u.length)c=[c+1,n].concat(u),Array.prototype.splice.apply(this._lineOffsets,c);else{v=c+1;this._lineOffsets.splice(v,n);for(l=0;l<u.length;l+=5E4)c=[v,0].concat(u.slice(l,Math.min(u.length,l+5E4))),Array.prototype.splice.apply(this._lineOffsets,c),v+=5E4}for(v=l=0;v<this._text.length;){b=this._text[v].length;if(f<=l+b)break;
l+=b;v++}c=l;for(u=v;v<this._text.length;){b=this._text[v].length;if(e<=l+b)break;l+=b;v++}b=this._text[v];f=this._text[u].substring(0,f-c);e=b.substring(e-l);u=[u,v-u+1];f&&u.push(f);d&&u.push(d);e&&u.push(e);Array.prototype.splice.apply(this._text,u);0===this._text.length&&(this._text=[""]);this.onChanged({type:"Changed",start:m,removedCharCount:a,addedCharCount:h,removedLineCount:n,addedLineCount:k})}}};k.EventTarget.addMixin(f.prototype);return{TextModel:f}});
define("orion/editor/keyModes",["orion/keyBinding","orion/util"],function(k,l){function h(d){d&&(this._view=d,this._keyBindings=this.createKeyBindings(),this._keyBindingIndex=0)}function f(d){h.call(this,d)}h.prototype={createKeyBindings:function(){return[]},getKeyBindings:function(d){for(var f=[],e=this._keyBindings,c=0;c<e.length;c++)e[c].actionID===d&&f.push(e[c].keyBinding);return f},getView:function(){return this._view},isActive:function(){return-1!==this._view.getKeyModes().indexOf(this)},match:function(d){if("keydown"===
d.type)switch(d.keyCode){case 16:case 17:case 18:case 91:return}for(var f=this._keyBindingIndex,e=this._matchingKeyBindings||this._keyBindings,c=[],b=0;b<e.length;b++){var m=e[b],a=m.keyBinding.match(d,f);if(!0===a)return this._keyBindingIndex=0,this._matchingKeyBindings=null,m.actionID;"number"===typeof a&&c.push(m)}if(0===c.length)this._keyBindingIndex=0,this._matchingKeyBindings=null;else return this._keyBindingIndex++,this._matchingKeyBindings=c,"noop"},setKeyBinding:function(d,f){for(var e=this._keyBindings,
c=0;c<e.length;c++){var b=e[c];if(b.keyBinding.equals(d)){f?b.actionID=f:b.predefined?b.actionID="noop":e.splice(c,1);return}}f&&e.push({keyBinding:d,actionID:f})},setView:function(d){this._view=d}};f.prototype=new h;f.prototype.createKeyBindings=function(){var d=k.KeyBinding,f=[];f.push({actionID:"lineUp",keyBinding:new d(38),predefined:!0});f.push({actionID:"lineDown",keyBinding:new d(40),predefined:!0});f.push({actionID:"charPrevious",keyBinding:new d(37),predefined:!0});f.push({actionID:"charNext",
keyBinding:new d(39),predefined:!0});l.isMac?(f.push({actionID:"scrollPageUp",keyBinding:new d(33),predefined:!0}),f.push({actionID:"scrollPageDown",keyBinding:new d(34),predefined:!0}),f.push({actionID:"pageUp",keyBinding:new d(33,null,null,!0),predefined:!0}),f.push({actionID:"pageDown",keyBinding:new d(34,null,null,!0),predefined:!0}),f.push({actionID:"lineStart",keyBinding:new d(37,!0),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new d(39,!0),predefined:!0}),f.push({actionID:"wordPrevious",
keyBinding:new d(37,null,null,!0),predefined:!0}),f.push({actionID:"wordNext",keyBinding:new d(39,null,null,!0),predefined:!0}),f.push({actionID:"scrollTextStart",keyBinding:new d(36),predefined:!0}),f.push({actionID:"scrollTextEnd",keyBinding:new d(35),predefined:!0}),f.push({actionID:"textStart",keyBinding:new d(38,!0),predefined:!0}),f.push({actionID:"textEnd",keyBinding:new d(40,!0),predefined:!0}),f.push({actionID:"scrollPageUp",keyBinding:new d(38,null,null,null,!0),predefined:!0}),f.push({actionID:"scrollPageDown",
keyBinding:new d(40,null,null,null,!0),predefined:!0}),f.push({actionID:"lineStart",keyBinding:new d(37,null,null,null,!0),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new d(39,null,null,null,!0),predefined:!0}),f.push({actionID:"lineStart",keyBinding:new d(38,null,null,!0),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new d(40,null,null,!0),predefined:!0})):(f.push({actionID:"pageUp",keyBinding:new d(33),predefined:!0}),f.push({actionID:"pageDown",keyBinding:new d(34),predefined:!0}),
f.push({actionID:"lineStart",keyBinding:new d(36),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new d(35),predefined:!0}),f.push({actionID:"wordPrevious",keyBinding:new d(37,!0),predefined:!0}),f.push({actionID:"wordNext",keyBinding:new d(39,!0),predefined:!0}),f.push({actionID:"textStart",keyBinding:new d(36,!0),predefined:!0}),f.push({actionID:"textEnd",keyBinding:new d(35,!0),predefined:!0}));l.isFirefox&&l.isLinux&&(f.push({actionID:"lineUp",keyBinding:new d(38,!0),predefined:!0}),f.push({actionID:"lineDown",
keyBinding:new d(40,!0),predefined:!0}));l.isWindows&&(f.push({actionID:"scrollLineUp",keyBinding:new d(38,!0),predefined:!0}),f.push({actionID:"scrollLineDown",keyBinding:new d(40,!0),predefined:!0}));f.push({actionID:"selectLineUp",keyBinding:new d(38,null,!0),predefined:!0});f.push({actionID:"selectLineDown",keyBinding:new d(40,null,!0),predefined:!0});f.push({actionID:"selectCharPrevious",keyBinding:new d(37,null,!0),predefined:!0});f.push({actionID:"selectCharNext",keyBinding:new d(39,null,!0),
predefined:!0});f.push({actionID:"selectPageUp",keyBinding:new d(33,null,!0),predefined:!0});f.push({actionID:"selectPageDown",keyBinding:new d(34,null,!0),predefined:!0});l.isMac?(f.push({actionID:"selectLineStart",keyBinding:new d(37,!0,!0),predefined:!0}),f.push({actionID:"selectLineEnd",keyBinding:new d(39,!0,!0),predefined:!0}),f.push({actionID:"selectWordPrevious",keyBinding:new d(37,null,!0,!0),predefined:!0}),f.push({actionID:"selectWordNext",keyBinding:new d(39,null,!0,!0),predefined:!0}),
f.push({actionID:"selectTextStart",keyBinding:new d(36,null,!0),predefined:!0}),f.push({actionID:"selectTextEnd",keyBinding:new d(35,null,!0),predefined:!0}),f.push({actionID:"selectTextStart",keyBinding:new d(38,!0,!0),predefined:!0}),f.push({actionID:"selectTextEnd",keyBinding:new d(40,!0,!0),predefined:!0}),f.push({actionID:"selectLineStart",keyBinding:new d(37,null,!0,null,!0),predefined:!0}),f.push({actionID:"selectLineEnd",keyBinding:new d(39,null,!0,null,!0),predefined:!0}),f.push({actionID:"selectLineStart",
keyBinding:new d(38,null,!0,!0),predefined:!0}),f.push({actionID:"selectLineEnd",keyBinding:new d(40,null,!0,!0),predefined:!0})):(l.isLinux&&(f.push({actionID:"selectWholeLineUp",keyBinding:new d(38,!0,!0),predefined:!0}),f.push({actionID:"selectWholeLineDown",keyBinding:new d(40,!0,!0),predefined:!0})),f.push({actionID:"selectLineStart",keyBinding:new d(36,null,!0),predefined:!0}),f.push({actionID:"selectLineEnd",keyBinding:new d(35,null,!0),predefined:!0}),f.push({actionID:"selectWordPrevious",
keyBinding:new d(37,!0,!0),predefined:!0}),f.push({actionID:"selectWordNext",keyBinding:new d(39,!0,!0),predefined:!0}),f.push({actionID:"selectTextStart",keyBinding:new d(36,!0,!0),predefined:!0}),f.push({actionID:"selectTextEnd",keyBinding:new d(35,!0,!0),predefined:!0}));f.push({actionID:"undo",keyBinding:new k.KeyBinding("z",!0),predefined:!0});l.isMac?f.push({actionID:"redo",keyBinding:new k.KeyBinding("z",!0,!0),predefined:!0}):f.push({actionID:"redo",keyBinding:new k.KeyBinding("y",!0),predefined:!0});
f.push({actionID:"deletePrevious",keyBinding:new d(8),predefined:!0});f.push({actionID:"deletePrevious",keyBinding:new d(8,null,!0),predefined:!0});f.push({actionID:"deleteNext",keyBinding:new d(46),predefined:!0});f.push({actionID:"deleteWordPrevious",keyBinding:new d(8,!0),predefined:!0});f.push({actionID:"deleteWordPrevious",keyBinding:new d(8,!0,!0),predefined:!0});f.push({actionID:"deleteWordNext",keyBinding:new d(46,!0),predefined:!0});f.push({actionID:"tab",keyBinding:new d(9),predefined:!0});
f.push({actionID:"shiftTab",keyBinding:new d(9,null,!0),predefined:!0});f.push({actionID:"enter",keyBinding:new d(13),predefined:!0});f.push({actionID:"enter",keyBinding:new d(13,null,!0),predefined:!0});f.push({actionID:"selectAll",keyBinding:new d("a",!0),predefined:!0});f.push({actionID:"toggleTabMode",keyBinding:new d("m",!0),predefined:!0});l.isMac&&(f.push({actionID:"deleteNext",keyBinding:new d(46,null,!0),predefined:!0}),f.push({actionID:"deleteWordPrevious",keyBinding:new d(8,null,null,!0),
predefined:!0}),f.push({actionID:"deleteWordNext",keyBinding:new d(46,null,null,!0),predefined:!0}));f.push({actionID:"toggleWrapMode",keyBinding:new k.KeyBinding("w",!0,!1,!0)});f.push({actionID:"toggleOverwriteMode",keyBinding:new k.KeyBinding(45)});if(!l.isFirefox){var e=l.isMac&&l.isChrome;f.push({actionID:"noop",keyBinding:new d("u",!e,!1,!1,e),predefined:!0});f.push({actionID:"noop",keyBinding:new d("i",!e,!1,!1,e),predefined:!0});f.push({actionID:"noop",keyBinding:new d("b",!e,!1,!1,e),predefined:!0})}l.isFirefox&&
(f.push({actionID:"copy",keyBinding:new d(45,!0),predefined:!0}),f.push({actionID:"paste",keyBinding:new d(45,null,!0),predefined:!0}),f.push({actionID:"cut",keyBinding:new d(46,null,!0),predefined:!0}));l.isMac&&(f.push({actionID:"lineStart",keyBinding:new d("a",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new d("e",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"lineUp",keyBinding:new d("p",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"lineDown",keyBinding:new d("n",!1,!1,
!1,!0),predefined:!0}),f.push({actionID:"charPrevious",keyBinding:new d("b",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"charNext",keyBinding:new d("f",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"deletePrevious",keyBinding:new d("h",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"deleteNext",keyBinding:new d("d",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"deleteLineEnd",keyBinding:new d("k",!1,!1,!1,!0),predefined:!0}),l.isFirefox?(f.push({actionID:"scrollPageDown",keyBinding:new d("v",!1,
!1,!1,!0),predefined:!0}),f.push({actionID:"deleteLineStart",keyBinding:new d("u",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"deleteWordPrevious",keyBinding:new d("w",!1,!1,!1,!0),predefined:!0})):(f.push({actionID:"pageDown",keyBinding:new d("v",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"centerLine",keyBinding:new d("l",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"enterNoCursor",keyBinding:new d("o",!1,!1,!1,!0),predefined:!0})));return f};return{KeyMode:h,DefaultKeyMode:f}});
define("orion/editor/util",[],function(){return{contains:function(k,l){if(!l)return!1;if(!k.compareDocumentPosition){for(var h=l;h;){if(k===h)return!0;h=h.parentNode}return!1}return k===l||0!==(k.compareDocumentPosition(l)&16)},addEventListener:function(k,l,h,f){"function"===typeof k.addEventListener?k.addEventListener(l,h,!0===f):k.attachEvent("on"+l,h)},removeEventListener:function(k,l,h,f){"function"===typeof k.removeEventListener?k.removeEventListener(l,h,!0===f):k.detachEvent("on"+l,h)}}});
define("orion/editor/textView","i18n!orion/editor/nls/messages orion/editor/textModel orion/editor/keyModes orion/editor/eventTarget orion/editor/textTheme orion/editor/util orion/util".split(" "),function(k,l,h,f,d,g,e){function c(a,b,c){if(c){b.className="";c=b.attributes;for(var d=c.length;0<d--;)(!e.isIE||9<=e.isIE||9>e.isIE&&c[d].specified)&&b.removeAttribute(c[d].name)}if(a){a.styleClass&&(b.className=a.styleClass);if(c=a.style)for(var f in c)c.hasOwnProperty(f)&&(b.style[f]=c[f]);if(a=a.attributes)for(var n in a)a.hasOwnProperty(n)&&
b.setAttribute(n,a[n])}}function b(a){return a instanceof Array?a.slice(0):a}function m(a,b){if(!a)return b;if(!b)return a;for(var c in b)b.hasOwnProperty(c)&&(a.hasOwnProperty(c)||(a[c]=b[c]));return a}function a(b,c){if(b===c)return!0;if(b&&!c||!b&&c||b&&b.constructor===String||c&&c.constructor===String)return!1;if(b instanceof Array||c instanceof Array){if(!(b instanceof Array&&c instanceof Array)||b.length!==c.length)return!1;for(var e=0;e<b.length;e++)if(!a(b[e],c[e]))return!1;return!0}if(!(b instanceof
Object)||!(c instanceof Object))return!1;for(e in b)if(b.hasOwnProperty(e)&&(!c.hasOwnProperty(e)||!a(b[e],c[e])))return!1;for(e in c)if(!b.hasOwnProperty(e))return!1;return!0}function n(a,b,c){for(var e=0,d=0,f=0,n=a.length;f<n;){-1!==e&&e<=f&&(e=a.indexOf("\r",f));-1!==d&&d<=f&&(d=a.indexOf("\n",f));var g=f,m;if(-1===d&&-1===e){b(a.substring(f));break}-1!==e&&-1!==d?e+1===d?(m=e,f=d+1):(m=e<d?e:d,f=(e<d?e:d)+1):-1!==e?(m=e,f=e+1):(m=d,f=d+1);b(a.substring(g,m));c()}}function q(a){var b,c,e,d,f=
a.ownerDocument.defaultView||a.ownerDocument.parentWindow;f.getComputedStyle?(a=f.getComputedStyle(a,null),b=a.getPropertyValue("padding-left"),c=a.getPropertyValue("padding-top"),e=a.getPropertyValue("padding-right"),d=a.getPropertyValue("padding-bottom")):a.currentStyle&&(b=a.currentStyle.paddingLeft,c=a.currentStyle.paddingTop,e=a.currentStyle.paddingRight,d=a.currentStyle.paddingBottom);return{left:parseInt(b,10)||0,top:parseInt(c,10)||0,right:parseInt(e,10)||0,bottom:parseInt(d,10)||0}}function r(a){var b,
c,e,d,f=a._trim;if(!f){var f=q(a),n=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;n.getComputedStyle?(d=n.getComputedStyle(a,null),b=d.getPropertyValue("border-left-width"),c=d.getPropertyValue("border-top-width"),e=d.getPropertyValue("border-right-width"),d=d.getPropertyValue("border-bottom-width")):a.currentStyle&&(b=a.currentStyle.borderLeftWidth,c=a.currentStyle.borderTopWidth,e=a.currentStyle.borderRightWidth,d=a.currentStyle.borderBottomWidth);b=parseInt(b,10)||0;c=parseInt(c,10)||
0;e=parseInt(e,10)||0;d=parseInt(d,10)||0;f.left+=b;f.top+=c;f.right+=e;f.bottom+=d;a._trim=f}return f}function s(a,b,c,e){function d(b){if(b.animationName===n){var c=b.target;"function"===typeof c.__DOMReady&&(a.defaultView||a.parentWindow).setTimeout(function(){c.__DOMReady()},0)}}function f(a,b){for(var c=["","-webkit-","-moz-","-ms-","-o-"],e="",d="body ."+a+" {\n",p=0;p<c.length;p++)e+="@"+c[p]+"keyframes "+b+" {\nfrom { opacity: 0.99; }\nto { opacity: 1; }\n}\n",d+=c[p]+"animation-duration: 0.001s;\n"+
c[p]+"animation-name: "+b+";\n";return e+(d+"}")}c="_"+c+"DOMReady";b.className=b.className?b.className+" "+c:c;b.__DOMReady=e;e=c+"Style";if(!a.getElementById(e)){var n=c+"Animation";a.addEventListener("animationstart",d,!1);a.addEventListener("MSAnimationStart",d,!1);a.addEventListener("webkitAnimationStart",d,!1);b=a.createElement("style");b.id=e;e=a.getElementsByTagName("head")[0]||a.documentElement;b.appendChild(a.createTextNode(f(c,n)));e.insertBefore(b,e.firstChild)}}function t(a,b,c){this.start=
a;this.end=b;this.caret=c}function w(a){this.left=a.left;this.top=a.top;this.right=a.right;this.bottom=a.bottom}function v(a,b,c){this.view=a;this.lineIndex=b;this._lineDiv=c}function u(a){this._init(a||{})}var z=g.addEventListener,x=g.removeEventListener,A=function(){function a(b){this.options=b}a.prototype.play=function(){var a="number"===typeof this.options.duration?this.options.duration:350,b=this.options.easing||this.defaultEasing,c=this.options.onAnimate||function(){},e=this.options.curve[0],
d=this.options.curve[1],p=d-e,f=-1,n,g=this;this.interval=this.options.window.setInterval(function(){f=-1===f?(new Date).getTime():f;var m=((new Date).getTime()-f)/a;1>m?(m=b(m),n=e+m*p,c(n)):(c(d),g.stop())},"number"===typeof this.options.rate?this.options.rate:20)};a.prototype.stop=function(){this.options.window.clearInterval(this.interval);(this.options.onEnd||function(){})()};a.prototype.defaultEasing=function(a){return Math.sin(a*(Math.PI/2))};return a}();t.prototype={clone:function(){return new t(this.start,
this.end,this.caret)},collapse:function(){this.caret?this.end=this.start:this.start=this.end},extend:function(a){this.caret?this.start=a:this.end=a;this.start>this.end&&(a=this.start,this.start=this.end,this.end=a,this.caret=!this.caret)},setCaret:function(a){this.end=this.start=a;this.caret=!1},getCaret:function(){return this.caret?this.start:this.end},toString:function(){return"start\x3d"+this.start+" end\x3d"+this.end+(this.caret?" caret is at start":" caret is at end")},isEmpty:function(){return this.start===
this.end},equals:function(a){return this.caret===a.caret&&this.start===a.start&&this.end===a.end}};w.prototype={toString:function(){return"{l\x3d"+this.left+", t\x3d"+this.top+", r\x3d"+this.right+", b\x3d"+this.bottom+"}"}};v.prototype={create:function(a,b){if(!this._lineDiv){var c=this._lineDiv=this._createLine(a,b,this.lineIndex);c._line=this;return c}},_createLine:function(b,d,f){var n=this.view,g=n._model,m=g.getLine(f),h=g.getLineStart(f),q={type:"LineStyle",textView:n,lineIndex:f,lineText:m,
lineStart:h};n.onLineStyle(q);var k=b.ownerDocument,g=d||e.createElement(k,"div");if(!d||!a(d.viewStyle,q.style))c(q.style,g,d),d&&(d._trim=null),g.viewStyle=q.style,g.setAttribute("role","presentation");g.lineIndex=f;if(d&&g.viewLineText===m&&a(q.ranges,g.viewRanges))return g;g.viewRanges=q.ranges;g.viewLineText=m;f=[];this._createRanges(q.ranges,m,0,m.length,h,{tabOffset:0,ranges:f});q=" ";!n._fullSelection&&9>e.isIE&&(q="\ufeff");n={text:q,style:n._metrics.largestFontStyle,ignoreChars:1};0===f.length||
!f[f.length-1].style||"div"!==f[f.length-1].style.tagName?f.push(n):f.splice(f.length-1,0,n);var r,l,s,t=q=0;if(e.isFirefox&&2E3<m.length){d&&(g.innerHTML="",d.lineWidth=void 0);d=k.createDocumentFragment();for(m=0;m<f.length;m++)n=f[m],h=n.text,r=n.style,r=this._createSpan(g,h,r,n.ignoreChars),d.appendChild(r);g.appendChild(d)}else{var x,w;if(d){if(l=d.modelChangedEvent)0===l.removedLineCount&&0===l.addedLineCount?(w=l.start-h,x=l.addedCharCount-l.removedCharCount):w=-1,d.modelChangedEvent=void 0;
l=d.firstChild}for(m=0;m<f.length;m++){n=f[m];h=n.text;q+=h.length;r=n.style;if(l)if(s=l.firstChild.data,k=l.viewStyle,s===h&&a(r,k)){t+=s.length;l._rectsCache=void 0;r=l=l.nextSibling;continue}else for(;l;){if(-1!==w){k=q;k>=w&&(k-=x);s=(s=l.firstChild.data)?s.length:0;if(t+s>k)break;t+=s}k=l.nextSibling;g.removeChild(l);l=k}r=this._createSpan(g,h,r,n.ignoreChars);l?g.insertBefore(r,l):g.appendChild(r);d&&(d.lineWidth=void 0)}if(d)for(x=r?r.nextSibling:null;x;)k=x.nextSibling,d.removeChild(x),x=
k}g.parentNode||b.appendChild(g);return g},_createRanges:function(b,c,e,d,f,n){if(!(e>d)){if(b)for(var g=0;g<b.length;g++){var m=b[g];if(!(m.end<f+e)){var h=Math.max(f+e,m.start)-f;if(h>d)break;var q=Math.min(f+d,m.end)-f;if(h<=q){h=Math.max(e,h);q=Math.min(d,q);e<h&&this._createRange(c,e,h,null,n);if(!m.style||!m.style.unmergeable)for(;g+1<b.length&&b[g+1].start-f===q&&a(m.style,b[g+1].style);)m=b[g+1],q=Math.min(f+d,m.end)-f,g++;this._createRange(c,h,q,m.style,n);e=q}}}e<d&&this._createRange(c,
e,d,null,n)}},_createRange:function(a,b,c,e,d){if(!(b>c)){var f=this.view._customTabSize;if(f&&8!==f)for(var n=a.indexOf("\t",b);-1!==n&&n<c;){b<n&&(b={text:a.substring(b,n),style:e},d.ranges.push(b),d.tabOffset+=b.text.length);b=f-d.tabOffset%f;if(0<b){for(var g="\u00a0",m=1;m<b;m++)g+=" ";b={text:g,style:e,ignoreChars:b-1};d.ranges.push(b);d.tabOffset+=b.text.length}b=n+1;if(b===c)return;n=a.indexOf("\t",b)}b<=c&&(b={text:a.substring(b,c),style:e},d.ranges.push(b),d.tabOffset+=b.text.length)}},
_createSpan:function(a,b,d,f){var n=this.view,g="span";d&&d.tagName&&(g=d.tagName.toLowerCase());var m="a"===g;m&&(this.hasLink=!0);m&&!n._linksVisible&&(g="span");m=a.ownerDocument;a=e.createElement(a.ownerDocument,g);a.appendChild(m.createTextNode(d&&d.text?d.text:b));d&&d.html?(a.innerHTML=d.html,a.ignore=!0):d&&d.node&&(a.appendChild(d.node),a.ignore=!0);c(d,a);if("a"===g){var h=n._getWindow();z(a,"click",function(a){return n._handleLinkClick(a?a:h.event)},!1)}a.viewStyle=d;f&&(a.ignoreChars=
f);return a},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(a,b){var c=this._ensureCreated(),d=this.view;if(void 0===a)return this._getLineBoundingClientRect(c,!0);var f=d._model,n=c.ownerDocument,g=this.lineIndex,m=null;if(a<f.getLineEnd(g)){var h=f.getLineStart(g);this.forEach(function(b){var f=b.firstChild,B=this._nodeLength(b);if(h+B>a){var g=a-h;if(1===f.length)m=new w(b.getBoundingClientRect());
else if(d._isRangeRects)B=n.createRange(),B.setStart(f,g),B.setEnd(f,g+1),m=new w(B.getBoundingClientRect());else if(e.isIE)B=n.body.createTextRange(),B.moveToElementText(b),B.collapse(),(f=0===g&&8===e.isIE)&&(g=1),B.moveEnd("character",g+1),B.moveStart("character",g),m=new w(B.getBoundingClientRect()),f&&(m.left=b.getClientRects()[0].left);else{var q=f.data;b.removeChild(f);b.appendChild(n.createTextNode(q.substring(0,g)));var k=e.createElement(n,"span");k.appendChild(n.createTextNode(q.substring(g,
g+1)));b.appendChild(k);b.appendChild(n.createTextNode(q.substring(g+1)));m=new w(k.getBoundingClientRect());b.innerHTML="";b.appendChild(f);this._createdDiv||(b=d._getSelection(),(h<=b.start&&b.start<h+B||h<=b.end&&b.end<h+B)&&d._updateDOMSelection())}e.isIE&&(g=c.ownerDocument.defaultView||c.ownerDocument.parentWindow,b=g.screen.logicalXDPI/g.screen.deviceXDPI,g=g.screen.logicalYDPI/g.screen.deviceYDPI,m.left*=b,m.right*=b,m.top*=g,m.bottom*=g);return!1}h+=B;return!0})}f=this.getBoundingClientRect();
m||(d._wrapMode?(g=this.getClientRects(),m=g[g.length-1],m.left=m.right,m.left+=f.left,m.top+=f.top,m.right+=f.left,m.bottom+=f.top):(m=new w(f),m.left=m.right));if(b||void 0===b)m.left-=f.left,m.top-=f.top,m.right-=f.left,m.bottom-=f.top;return m},forEach:function(a){for(var b=this._ensureCreated().firstChild;b;){var c=b.nextSibling;if(!b.ignore&&!a.call(this,b))break;b=c}},_getClientRects:function(a,b){var c,e,d,f;if(!a._rectsCache){c=a.getClientRects();e=Array(c.length);for(f=0;f<c.length;f++)d=
e[f]=new w(c[f]),d.left-=b.left,d.top-=b.top,d.right-=b.left,d.bottom-=b.top;a._rectsCache=e}c=a._rectsCache;e=[c.length];for(f=0;f<c.length;f++)e[f]=new w(c[f]);return e},getClientRects:function(a){if(!this.view._wrapMode)return[this.getBoundingClientRect()];var b=[],c=this._ensureCreated().getBoundingClientRect();this.forEach(function(a){a=this._getClientRects(a,c);for(var e=0;e<a.length;e++){var d=a[e],p,f;if(d.top!==d.bottom){var n=d.top+(d.bottom-d.top)/2;for(p=0;p<b.length&&!(f=b[p],f.top<=
n&&n<f.bottom);p++);p===b.length?b.push(d):(d.left<f.left&&(f.left=d.left),d.top<f.top&&(f.top=d.top),d.right>f.right&&(f.right=d.right),d.bottom>f.bottom&&(f.bottom=d.bottom))}}return!0});return void 0!==a?b[a]:b},_getLineBoundingClientRect:function(a,b){var c=new w(a.getBoundingClientRect());if(!this.view._wrapMode){c.right=c.left;for(var e=a.lastChild;e&&e.ignoreChars===e.firstChild.length;)e=e.previousSibling;e&&(e=e.getBoundingClientRect(),c.right=e.right+r(a).right)}b&&(e=r(a),c.left+=e.left,
c.right-=e.right);return c},getLineCount:function(){return!this.view._wrapMode?1:this.getClientRects().length},getLineIndex:function(a){if(!this.view._wrapMode)return 0;var b=this.getClientRects();a=this.getBoundingClientRect(a);a=a.top+(a.bottom-a.top)/2;for(var c=0;c<b.length;c++)if(b[c].top<=a&&a<b[c].bottom)return c;return b.length-1},getLineStart:function(a){if(!this.view._wrapMode||0===a)return this.view._model.getLineStart(this.lineIndex);var b=this.getClientRects();return this.getOffset(b[a].left+
1,b[a].top+1)},_nodeLength:function(a){if(!a||a.ignore)return 0;var b=a.firstChild.length;a.ignoreChars&&(b-=a.ignoreChars);return b},getModelOffset:function(a,b){if(!a)return 0;var c=0;this.forEach(function(e){var d=e.firstChild;if(d===a)return e.ignoreChars&&(c-=e.ignoreChars),c+=b,!1;e.ignoreChars&&(c-=e.ignoreChars);c+=d.data.length;return!0});return Math.max(0,c)+this.view._model.getLineStart(this.lineIndex)},getNodeOffset:function(a){var b=0,c,e,d=this.view._model,f=d.getLineStart(this.lineIndex),
n=a-f,g=d.getLineEnd(this.lineIndex)-f;this.forEach(function(a){var d=a.firstChild,p=this._nodeLength(a);if(p+b>n||b+p>=g)return c=d,e=n-b,a.ignoreChars&&0<p&&e===p&&(e+=a.ignoreChars),!1;b+=p;return!0});return{node:c,offset:e}},getText:function(a){var b="",c=0;this.forEach(function(e){var d;if(e.ignoreChars){d=e.lastChild;for(var f=0,n=[],g=-1;d;){var m=d.data;if(m)for(var h=m.length-1;0<=h;h--){var q=m.substring(h,h+1);f<e.ignoreChars&&(" "===q||"\ufeff"===q)?f++:n.push("\u00a0"===q?"\t":q)}a===
d&&(g=n.length);d=d.previousSibling}n=n.reverse().join("");-1!==g&&(c=b.length+n.length-g);b+=n}else for(d=e.firstChild;d;)a===d&&(c=b.length),b+=d.data,d=d.nextSibling;return!0});return{text:b,offset:c}},getOffset:function(a,b){function c(d,y,h){var C=d.firstChild,l=r._nodeLength(d),s=q.ownerDocument,t=s.defaultView||s.parentWindow,x=e.isIE?t.screen.logicalXDPI/t.screen.deviceXDPI:1,w=e.isIE?t.screen.logicalYDPI/t.screen.deviceYDPI:1,u,v,A,t=h.left+k.left,z,D;if(e.isIE||f._isRangeRects){for(var s=
f._isRangeRects?s.createRange():s.body.createTextRange(),P=l,G=-1;1<P-G;){var T=Math.floor((P+G)/2);h=G+1;u=T===l-1&&d.ignoreChars?C.length:T+1;z=0===h&&8===e.isIE;f._isRangeRects?(s.setStart(C,h),s.setEnd(C,u)):(z&&(h=1),s.moveToElementText(d),s.move("character",h),s.moveEnd("character",u-h));D=s.getClientRects();for(var S=!1,V=0;V<D.length;V++)if(h=D[V],u=(z?t:h.left)*x-k.left,A=h.right*x-k.left,v=h.top*w-k.top,h=h.bottom*w-k.top,u<=a&&a<A&&(!f._wrapMode||v<=b&&b<h)){S=!0;break}S?P=T:G=T}y+=P;h=
P;u=P===l-1&&d.ignoreChars?C.length:Math.min(P+1,C.length);f._isRangeRects?(s.setStart(C,h),s.setEnd(C,u)):(s.moveToElementText(d),s.move("character",h),s.moveEnd("character",u-h));D=s.getClientRects();l=!1;0<D.length&&(h=D[0],u=(z?t:h.left)*x-k.left,A=h.right*x-k.left,l=a>u+(A-u)/2);d=y-m;C=n.getLine(g);x=C.charCodeAt(d);55296<=x&&56319>=x&&l?d<C.length&&(x=C.charCodeAt(d+1),56320<=x&&57343>=x&&(y+=1)):56320<=x&&57343>=x&&!l&&0<d&&(x=C.charCodeAt(d-1),55296<=x&&56319>=x&&(y-=1));l&&y++}else{x=[];
for(z=0;z<l;z++)x.push("\x3cspan\x3e"),z===l-1?x.push(C.data.substring(z)):x.push(C.data.substring(z,z+1)),x.push("\x3c/span\x3e");d.innerHTML=x.join("");for(x=d.firstChild;x;){h=x.getBoundingClientRect();u=h.left-k.left;A=h.right-k.left;if(u<=a&&a<A){a>u+(A-u)/2&&y++;break}y++;x=x.nextSibling}r._createdDiv||(d.innerHTML="",d.appendChild(C),d=f._getSelection(),(y<=d.start&&d.start<y+l||y<=d.end&&d.end<y+l)&&f._updateDOMSelection())}return y}function d(c){if(c.ignore)return null;c=r._getClientRects(c,
k);for(var e=0;e<c.length;e++){var y=c[e];if(y.left<=a&&a<y.right&&(!f._wrapMode||y.top<=b&&b<y.bottom))return y}return null}var f=this.view,n=f._model,g=this.lineIndex,m=n.getLineStart(g),h=n.getLineEnd(g);if(m===h)return m;var q=this._ensureCreated(),k=this.getBoundingClientRect(),r=this,l,s;if(f._wrapMode){l=this.getClientRects();b<l[0].top&&(b=l[0].top);for(var t=0;t<l.length&&!(s=l[t],s.top<=b&&b<s.bottom);t++);a<s.left&&(a=s.left);a>s.right&&(a=s.right-1)}else 0>a&&(a=0),a>k.right-k.left&&(a=
k.right-k.left);var x,w;if(this._lastHitChild&&this._lastHitChild.parentNode){if(x=this._lastHitOffset,w=this._lastHitChild,s=d(w),!s){l=x;for(var t=x+this._nodeLength(w),u=w.previousSibling,v=w.nextSibling;u||v;){if(u){l-=this._nodeLength(u);if(s=d(u)){w=u;x=l;break}u=u.previousSibling}if(v){if(s=d(v)){w=v;x=t;break}t+=this._nodeLength(v);v=v.nextSibling}}}}else x=m,this.forEach(function(a){w=a;if(s=d(w))return!1;x+=this._nodeLength(w);return!0});w&&s&&(this._lastHitChild=w,this._lastHitOffset=x,
x=c(w,x,s));return Math.min(h,Math.max(m,x))},getNextOffset:function(a,b){if("line"===b.unit){var c=this.view._model,d=c.getLineAtOffset(a);if(0<b.count)return b.count--,c.getLineEnd(d);b.count++;return c.getLineStart(d)}return"wordend"===b.unit||"wordWS"===b.unit||"wordendWS"===b.unit?this._getNextOffset_W3C(a,b):e.isIE?this._getNextOffset_IE(a,b):this._getNextOffset_W3C(a,b)},_getNextOffset_W3C:function(a,b){function c(a){return 33<=a&&47>=a||58<=a&&64>=a||91<=a&&94>=a||96===a||123<=a&&126>=a}function e(a){return 32===
a||9===a}var d=this.view._model,f=d.getLineAtOffset(a),n=d.getLine(f),g=d.getLineStart(f),d=d.getLineEnd(f),f=n.length,m=a-g,h,q=0>b.count?-1:1;if("word"===b.unit||"wordend"===b.unit||"wordWS"===b.unit||"wordendWS"===b.unit)for(var k,r,l;0!==b.count;){if(0<b.count){if(m===f)return d;h=n.charCodeAt(m);k=c(h);r=!k&&!e(h);for(m++;m<f;){h=n.charCodeAt(m);if("wordWS"!==b.unit&&"wordendWS"!==b.unit){l=c(h);if("wordend"===b.unit){if(!l&&k)break}else if(l&&!k)break;h=!l&&!e(h)}else h=!e(h);if("wordend"===
b.unit||"wordendWS"===b.unit){if(!h&&r)break}else if(h&&!r)break;r=h;k=l;m++}}else{if(0===m)return g;m--;h=n.charCodeAt(m);k=c(h);for(r=!k&&!e(h);0<m;){h=n.charCodeAt(m-1);if("wordWS"!==b.unit&&"wordendWS"!==b.unit){l=c(h);if("wordend"===b.unit){if(l&&!k)break}else if(!l&&k)break;h=!l&&!e(h)}else h=!e(h);if("wordend"===b.unit||"wordendWS"===b.unit){if(h&&!r)break}else if(!h&&r)break;r=h;k=l;m--}}b.count-=q}else for(;0!==b.count&&0<=m+q&&m+q<=f;)m+=q,h=n.charCodeAt(m),56320<=h&&57343>=h&&0<m&&(h=n.charCodeAt(m-
1),55296<=h&&56319>=h&&(m+=q)),b.count-=q;return g+m},_getNextOffset_IE:function(a,b){var c=this._ensureCreated(),e=this.view._model,d=this.lineIndex,f=0,n;n=e.getLineStart(d);var g=c.ownerDocument,m=0>b.count?-1:1;if(a===e.getLineEnd(d)){for(c=c.lastChild;c&&c.ignoreChars===c.firstChild.length;)c=c.previousSibling;if(!c)return n;f=g.body.createTextRange();f.moveToElementText(c);n=f.text.length;f.moveEnd(b.unit,m);f=a+f.text.length-n}else if(a===n&&0>b.count)f=n;else for(c=c.firstChild;c;){e=this._nodeLength(c);
if(n+e>a){f=g.body.createTextRange();if(a===n&&0>b.count){for(n=c.previousSibling;n&&(!n.firstChild||!n.firstChild.length);)n=n.previousSibling;f.moveToElementText(n?n:c.previousSibling)}else f.moveToElementText(c),f.collapse(),f.moveEnd("character",a-n);n=f.text.length;f.moveEnd(b.unit,m);f=a+f.text.length-n;break}n=e+n;c=c.nextSibling}b.count-=m;return f},updateLinks:function(){var a=this._ensureCreated();if(this.hasLink){var b=this;this.forEach(function(c){var e=c.viewStyle;e&&e.tagName&&"a"===
e.tagName.toLowerCase()&&a.replaceChild(b._createSpan(a,c.firstChild.data,e),c);return!0})}},destroy:function(){var a=this._createdDiv;a&&(a.parentNode.removeChild(a),this._createdDiv=null)}};u.prototype={addKeyMode:function(a,b){var c=this._keyModes;void 0!==b?c.splice(b,0,a):c.push(a);a._modeAdded&&a._modeAdded()},addRuler:function(a,b){a.setView(this);var c=this._rulers;if(void 0!==b){var e,d;for(d=e=0;e<c.length&&d<b;e++)a.getLocation()===c[e].getLocation()&&d++;c.splice(d,0,a);b=d}else c.push(a);
this._createRuler(a,b);this._update()},computeSize:function(){var a=0,b=0,c=this._model,d=this._clientDiv;if(!d)return{width:a,height:b};var f=d.style.width;e.isWebkit&&(d.style.width="0x7fffffffpx");for(var c=c.getLineCount(),n=0;n<c;n++){var g=this._getLine(n),m=g.getBoundingClientRect(),a=Math.max(a,m.right-m.left),b=b+(m.bottom-m.top);g.destroy()}e.isWebkit&&(d.style.width=f);d=this._getViewPadding();a+=d.right+d.left+this._metrics.scrollWidth;b+=d.bottom+d.top+this._metrics.scrollWidth;return{width:a,
height:b}},convert:function(a,b,c){if(this._clientDiv){var e=this._getScroll(),d=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect();"document"===b&&(void 0!==a.x&&(a.x+=-e.x+f.left+d.left),void 0!==a.y&&(a.y+=-e.y+f.top+d.top));"document"===c&&(void 0!==a.x&&(a.x+=e.x-f.left-d.left),void 0!==a.y&&(a.y+=e.y-f.top-d.top));return a}},destroy:function(){for(var a=0;a<this._rulers.length;a++)this._rulers[a].setView(null);this.rulers=null;this._destroyView();this.onDestroy({type:"Destroy"});
this._parent=null;this._model&&this._model.destroy&&this._model.destroy();this._actions=this._keyModes=this._doubleClickSelection=this._selection=this._theme=this._model=null},focus:function(){this._clientDiv&&(this._updateDOMSelection(),this._clientDiv.focus(),this._updateDOMSelection())},hasFocus:function(){return this._hasFocus},getActionDescription:function(a){if(a=this._actions[a])return a.actionDescription},getActions:function(a){var b=[],c=this._actions,e;for(e in c)c.hasOwnProperty(e)&&(a||
!c[e].defaultHandler)&&b.push(e);return b},getBottomIndex:function(a){return!this._clientDiv?0:this._getBottomIndex(a)},getBottomPixel:function(){return!this._clientDiv?0:this._getScroll().y+this._getClientHeight()},getCaretOffset:function(){return this._getSelection().getCaret()},getClientArea:function(){if(!this._clientDiv)return{x:0,y:0,width:0,height:0};var a=this._getScroll();return{x:a.x,y:a.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return!this._clientDiv?
0:this._getScroll().x},getKeyBindings:function(a){for(var b=[],c=this._keyModes,e=0;e<c.length;e++)b=b.concat(c[e].getKeyBindings(a));return b},getKeyModes:function(){return this._keyModes.slice(0)},getLineHeight:function(a){return!this._clientDiv?0:this._getLineHeight(a)},getLineIndex:function(a){return!this._clientDiv?0:this._getLineIndex(a)},getLinePixel:function(a){return!this._clientDiv?0:this._getLinePixel(a)},getLocationAtOffset:function(a){if(!this._clientDiv)return{x:0,y:0};var b=this._model;
a=Math.min(Math.max(0,a),b.getCharCount());var b=b.getLineAtOffset(a),c=this._getLine(b);a=c.getBoundingClientRect(a);c.destroy();c=a.left;b=this._getLinePixel(b)+a.top;return{x:c,y:b}},getNextOffset:function(a,b){var c=new t(a,a,!1);this._doMove(b,c);return c.getCaret()},getOptions:function(){var a;if(0===arguments.length)a=this._defaultOptions();else if(1===arguments.length){if(a=arguments[0],"string"===typeof a)return b(this["_"+a])}else{a={};for(var c in arguments)arguments.hasOwnProperty(c)&&
(a[arguments[c]]=void 0)}for(var e in a)a.hasOwnProperty(e)&&(a[e]=b(this["_"+e]));return a},getModel:function(){return this._model},getOffsetAtLocation:function(a,b){if(!this._clientDiv)return 0;var c=this._getLineIndex(b),e=this._getLine(c),c=e.getOffset(a,b-this._getLinePixel(c));e.destroy();return c},getLineAtOffset:function(a){this.getModel().getLineAtOffset(a)},getLineStart:function(a){this.getModel().getLineStart(a)},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){var a=
this._getSelection();return{start:a.start,end:a.end}},getText:function(a,b){return this._model.getText(a,b)},getTopIndex:function(a){return!this._clientDiv?0:this._getTopIndex(a)},getTopPixel:function(){return!this._clientDiv?0:this._getScroll().y},invokeAction:function(a,b,c){if(this._clientDiv){if(a=this._actions[a]){if(!b&&a.handler&&a.handler(c))return!0;if(a.defaultHandler)return"boolean"===typeof a.defaultHandler(c)}return!1}},isDestroyed:function(){return!this._clientDiv},onContextMenu:function(a){return this.dispatchEvent(a)},
onDragStart:function(a){return this.dispatchEvent(a)},onDrag:function(a){return this.dispatchEvent(a)},onDragEnd:function(a){return this.dispatchEvent(a)},onDragEnter:function(a){return this.dispatchEvent(a)},onDragOver:function(a){return this.dispatchEvent(a)},onDragLeave:function(a){return this.dispatchEvent(a)},onDrop:function(a){return this.dispatchEvent(a)},onDestroy:function(a){return this.dispatchEvent(a)},onLineStyle:function(a){return this.dispatchEvent(a)},onKeyDown:function(a){return this.dispatchEvent(a)},
onKeyPress:function(a){return this.dispatchEvent(a)},onKeyUp:function(a){return this.dispatchEvent(a)},onModelChanged:function(a){return this.dispatchEvent(a)},onModelChanging:function(a){return this.dispatchEvent(a)},onModify:function(a){return this.dispatchEvent(a)},onMouseDown:function(a){return this.dispatchEvent(a)},onMouseUp:function(a){return this.dispatchEvent(a)},onMouseMove:function(a){return this.dispatchEvent(a)},onMouseOver:function(a){return this.dispatchEvent(a)},onMouseOut:function(a){return this.dispatchEvent(a)},
onSelection:function(a){return this.dispatchEvent(a)},onScroll:function(a){return this.dispatchEvent(a)},onVerify:function(a){return this.dispatchEvent(a)},onFocus:function(a){return this.dispatchEvent(a)},onBlur:function(a){return this.dispatchEvent(a)},redraw:function(){if(!(0<this._redrawCount)){var a=this._model.getLineCount();this.redrawRulers(0,a);this.redrawLines(0,a)}},redrawRulers:function(a,b){if(!(0<this._redrawCount))for(var c=this.getRulers(),e=0;e<c.length;e++)this.redrawLines(a,b,c[e])},
redrawLines:function(a,b,c){if(!(0<this._redrawCount)&&(void 0===a&&(a=0),void 0===b&&(b=this._model.getLineCount()),a!==b)){var e=this._clientDiv;if(e){if(c)for(e=this._getRulerParent(c).firstChild;e&&e._ruler!==c;)e=e.nextSibling;c?e.rulerChanged=!0:this._lineHeight&&this._resetLineHeight(a,b);if(!c||"page"===c.getOverview())for(e=e.firstChild;e;){var d=e.lineIndex;a<=d&&d<b&&(e.lineChanged=!0);e=e.nextSibling}!c&&!this._wrapMode&&a<=this._maxLineIndex&&this._maxLineIndex<b&&(this._checkMaxLineIndex=
this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0);this._queueUpdate()}}},redrawRange:function(a,b){if(!(0<this._redrawCount)){var c=this._model;void 0===a&&(a=0);void 0===b&&(b=c.getCharCount());var e=c.getLineAtOffset(a),c=c.getLineAtOffset(Math.max(a,b-1))+1;this.redrawLines(e,c)}},removeKeyMode:function(a){for(var b=this._keyModes,c=0;c<b.length;c++)if(b[c]===a){b.splice(c,1);break}a._modeRemoved&&a._modeRemoved()},removeRuler:function(a){for(var b=this._rulers,c=0;c<b.length;c++)if(b[c]===
a){b.splice(c,1);a.setView(null);this._destroyRuler(a);this._update();break}},resize:function(){this._clientDiv&&this._handleResize(null)},setAction:function(a,b,c){if(a){var e=this._actions,d=e[a];d||(d=e[a]={});d.handler=b;void 0!==c&&(d.actionDescription=c)}},setKeyBinding:function(a,b){this._keyModes[0].setKeyBinding(a,b)},setCaretOffset:function(a,b,c){var e=this._model.getCharCount();a=Math.max(0,Math.min(a,e));a=new t(a,a,!1);this._setSelection(a,void 0===b||b,!0,c)},setHorizontalPixel:function(a){this._clientDiv&&
(a=Math.max(0,a),this._scrollView(a-this._getScroll().x,0))},setRedraw:function(a){a?0===--this._redrawCount&&this.redraw():this._redrawCount++},setModel:function(a){if(a&&a!==this._model){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);var b=this._model.getLineCount(),c=this._model.getCharCount(),e=a.getLineCount(),d=a.getCharCount(),f={type:"ModelChanging",text:a.getText(),start:0,removedCharCount:c,
addedCharCount:d,removedLineCount:b,addedLineCount:e};this.onModelChanging(f);this._model=a;f={type:"ModelChanged",start:0,removedCharCount:c,addedCharCount:d,removedLineCount:b,addedLineCount:e};this.onModelChanged(f);this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._reset();this._update()}},setOptions:function(c){var e=this._defaultOptions(),d;for(d in c)if(c.hasOwnProperty(d)){var f=c[d];if(!a(this["_"+
d],f)){var n=e[d]?e[d].update:null;n?n.call(this,f):this["_"+d]=b(f)}}},setSelection:function(a,b,c,e){var d=a>b;if(d){var f=a;a=b;b=f}f=this._model.getCharCount();a=Math.max(0,Math.min(a,f));b=Math.max(0,Math.min(b,f));a=new t(a,b,d);this._setSelection(a,void 0===c||c,!0,e)},setText:function(a,b,c){var d=void 0===b&&void 0===c;void 0===b&&(b=0);void 0===c&&(c=this._model.getCharCount());d&&(this._variableLineHeight=!1);this._modifyContent({text:a,start:b,end:c,_code:!0},!d);d&&(this._columnX=-1,
this._setSelection(new t(0,0,!1),!0),13>e.isFirefox&&this._fixCaret())},setTopIndex:function(a){this._clientDiv&&this._scrollView(0,this._getLinePixel(Math.max(0,a))-this._getScroll().y)},setTopPixel:function(a){this._clientDiv&&this._scrollView(0,Math.max(0,a)-this._getScroll().y)},showSelection:function(){return this._showCaret(!0)},update:function(a,b){this._clientDiv&&((a||this._metrics.invalid)&&this._updateStyle(),void 0===b||b?this._update():this._queueUpdate())},_handleRootMouseDown:function(a){this._cancelCheckSelection();
if(!this._ignoreEvent(a)){13>e.isFirefox&&1===a.which&&(this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0);var b=this._overlayDiv||this._clientDiv;9>e.isIE&&(b=this._viewDiv);for(var c=a.target?a.target:a.srcElement;c;){if(b===c)return;c=c.parentNode}a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();if(!this._isW3CEvents){var d=this;this._getWindow().setTimeout(function(){d._clientDiv.focus()},0)}}},_handleRootMouseUp:function(a){!this._ignoreEvent(a)&&
13>e.isFirefox&&1===a.which&&(this._clientDiv.contentEditable=!0,(this._overlayDiv||this._clientDiv).draggable=!1,this._fixCaret(),this._ignoreBlur=!1)},_handleBlur:function(a){this._cancelCheckSelection();if(!this._ignoreBlur){this._hasFocus=!1;if(9>e.isIE&&!this._getSelection().isEmpty()){a=this._rootDiv;var b=e.createElement(a.ownerDocument,"div");a.appendChild(b);a.removeChild(b)}this._cursorDiv&&(this._cursorDiv.style.display="none");if(this._selDiv1)if(this._selDiv1.style.background="lightgray",
this._selDiv2.style.background="lightgray",this._selDiv3.style.background="lightgray",a=this._getWindow(),b=this._selDiv1.ownerDocument,a.getSelection){b=a.getSelection();for(a=b.anchorNode;a;){if(a===this._clientDiv){0<b.rangeCount&&b.removeAllRanges();break}a=a.parentNode}}else if(b.selection){this._ignoreSelect=!1;for(a=b.selection.createRange().parentElement();a;){if(a===this._clientDiv){b.selection.empty();break}a=a.parentNode}this._ignoreSelect=!0}if(!this._ignoreFocus)this.onBlur({type:"Blur"})}},
_handleContextMenu:function(a){if(!this._ignoreEvent(a)){e.isIE&&3===this._lastMouseButton&&this._updateDOMSelection();var b=!1;this.isListening("ContextMenu")?(b=this._createMouseEvent("ContextMenu",a),b.screenX=a.screenX,b.screenY=a.screenY,this.onContextMenu(b),b=b.defaultPrevented):e.isMac&&e.isFirefox&&0===a.button&&(b=!0);if(b)return a.preventDefault&&a.preventDefault(),!1;this._contextMenuOpen=!0;e.isFirefox&&(this._checkSelectionChange=!0,this._pollSelectionChange(!0))}},_handleCopy:function(a){this._cancelCheckSelection();
if(!this._ignoreEvent(a)&&!this._ignoreCopy&&this._doCopy(a))return a.preventDefault&&a.preventDefault(),!1},_handleCut:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)&&this._doCut(a))return a.preventDefault&&a.preventDefault(),!1},_handleDataModified:function(a){this._ignoreEvent(a)||this._startIME()},_handleDblclick:function(a){this._ignoreEvent(a)||(this._lastMouseTime=a.timeStamp?a.timeStamp:(new Date).getTime(),2!==this._clickCount&&(this._clickCount=2,this._handleMouse(a)))},
_handleDragStart:function(a){if(!this._ignoreEvent(a)){if(13>e.isFirefox){var b=this;this._getWindow().setTimeout(function(){b._clientDiv.contentEditable=!0;b._clientDiv.draggable=!1;b._ignoreBlur=!1},0)}if(this.isListening("DragStart")&&-1!==this._dragOffset)this._isMouseDown=!1,this.onDragStart(this._createMouseEvent("DragStart",a)),this._dragOffset=-1;else return a.preventDefault&&a.preventDefault(),!1}},_handleDrag:function(a){if(!this._ignoreEvent(a)&&this.isListening("Drag"))this.onDrag(this._createMouseEvent("Drag",
a))},_handleDragEnd:function(a){if(!this._ignoreEvent(a)){this._dropTarget=!1;this._dragOffset=-1;if(this.isListening("DragEnd"))this.onDragEnd(this._createMouseEvent("DragEnd",a));13>e.isFirefox&&(this._fixCaret(),"none"===a.dataTransfer.dropEffect&&!a.dataTransfer.mozUserCancelled&&this._fixCaret())}},_handleDragEnter:function(a){if(!this._ignoreEvent(a)){var b=!0;this._dropTarget=!0;this.isListening("DragEnter")&&(b=!1,this.onDragEnter(this._createMouseEvent("DragEnter",a)));if(e.isWebkit||b)return a.preventDefault&&
a.preventDefault(),!1}},_handleDragOver:function(a){if(!this._ignoreEvent(a)){var b=!0;this.isListening("DragOver")&&(b=!1,this.onDragOver(this._createMouseEvent("DragOver",a)));if(e.isWebkit||b)return b&&(a.dataTransfer.dropEffect="none"),a.preventDefault&&a.preventDefault(),!1}},_handleDragLeave:function(a){if(!this._ignoreEvent(a)&&(this._dropTarget=!1,this.isListening("DragLeave")))this.onDragLeave(this._createMouseEvent("DragLeave",a))},_handleDrop:function(a){if(!this._ignoreEvent(a)){this._dropTarget=
!1;if(this.isListening("Drop"))this.onDrop(this._createMouseEvent("Drop",a));a.preventDefault&&a.preventDefault();return!1}},_handleFocus:function(a){this._hasFocus=!0;e.isIOS&&void 0!==this._lastTouchOffset?(this.setCaretOffset(this._lastTouchOffset,!0),this._lastTouchOffset=void 0):this._updateDOMSelection();this._cursorDiv&&(this._cursorDiv.style.display="block");this._selDiv1&&(a=this._highlightRGB,this._selDiv1.style.background=a,this._selDiv2.style.background=a,this._selDiv3.style.background=
a);if(!this._ignoreFocus)this.onFocus({type:"Focus"})},_handleKeyDown:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)){if(this.isListening("KeyDown")){var b=this._createKeyEvent("KeyDown",a);this.onKeyDown(b);if(b.defaultPrevented){e.isFirefox&&(this._keyDownPrevented=!0);a.preventDefault();return}}b=!1;switch(a.keyCode){case 16:case 17:case 18:case 91:b=!0;break;default:this._setLinksVisible(!1)}if(229===a.keyCode){if(this._readonly)return a.preventDefault&&a.preventDefault(),!1;
b=!0;e.isSafari&&e.isMac&&a.ctrlKey&&(b=!1,a.keyCode=129);b&&this._startIME()}else b||this._commitIME();if((e.isMac||e.isLinux)&&4>e.isFirefox||12.16>e.isOpera)return this._keyDownEvent=a,!0;if(this._doAction(a))return a.preventDefault?(a.preventDefault(),a.stopPropagation()):(a.cancelBubble=!0,a.returnValue=!1,a.keyCode=0),!1}},_handleKeyPress:function(a){if(!this._ignoreEvent(a))if(this._keyDownPrevented)a.preventDefault&&(a.preventDefault(),a.stopPropagation()),this._keyDownPrevented=void 0;else{if(e.isMac&&
e.isWebkit&&(63232<=a.keyCode&&63487>=a.keyCode||13===a.keyCode||8===a.keyCode)||((e.isMac||e.isLinux)&&4>e.isFirefox||12.16>e.isOpera)&&this._doAction(this._keyDownEvent))return a.preventDefault&&a.preventDefault(),!1;var b=e.isMac?a.metaKey:a.ctrlKey;if(void 0!==a.charCode&&b)switch(a.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")&&(b=this._createKeyEvent("KeyPress",a),this.onKeyPress(b),b.defaultPrevented))a.preventDefault();else{if(this._doAction(a))return a.preventDefault?
(a.preventDefault(),a.stopPropagation()):(a.cancelBubble=!0,a.returnValue=!1,a.keyCode=0),!1;b=!1;if(e.isMac){if(a.ctrlKey||a.metaKey)b=!0}else if(e.isFirefox){if(a.ctrlKey||a.altKey)b=!0}else a.ctrlKey^a.altKey&&(b=!0);if(!b&&(b=e.isOpera?a.which:void 0!==a.charCode?a.charCode:a.keyCode,31<b))return this._doContent(String.fromCharCode(b)),a.preventDefault&&a.preventDefault(),!1}}},_handleDocKeyUp:function(a){(e.isMac?a.metaKey:a.ctrlKey)||this._setLinksVisible(!1)},_handleKeyUp:function(a){if(!this._ignoreEvent(a)){if(this.isListening("KeyUp")){var b=
this._createKeyEvent("KeyUp",a);this.onKeyUp(b);if(b.defaultPrevented){a.preventDefault();return}}this._handleDocKeyUp(a);13===a.keyCode&&this._commitIME()}},_handleLinkClick:function(a){if(!(e.isMac?a.metaKey:a.ctrlKey))return a.preventDefault&&a.preventDefault(),!1},_handleMouse:function(a){var b=this._getWindow(),c=!0,d=b;if(e.isIE||e.isFirefox&&!this._overlayDiv)d=this._clientDiv;if(this._overlayDiv){this._hasFocus&&(this._ignoreFocus=!0);var f=this;b.setTimeout(function(){f.focus();f._ignoreFocus=
!1},0)}1===this._clickCount?(c=this._setSelectionTo(a.clientX,a.clientY,a.shiftKey,(!e.isOpera||12.16<=e.isOpera)&&this._hasFocus&&this.isListening("DragStart")))&&this._setGrab(d):(this._isW3CEvents&&this._setGrab(d),this._doubleClickSelection=null,this._setSelectionTo(a.clientX,a.clientY,a.shiftKey),this._doubleClickSelection=this._getSelection());return c},_handleMouseDown:function(a){if(!this._ignoreEvent(a)){if(this._linksVisible)if("A"!==(a.target||a.srcElement).tagName)this._setLinksVisible(!1);
else return;this._commitIME();var b=a.which;b||(4===a.button&&(b=2),2===a.button&&(b=3),1===a.button&&(b=1));var c=2!==b&&a.timeStamp?a.timeStamp:(new Date).getTime(),d=c-this._lastMouseTime,f=Math.abs(this._lastMouseX-a.clientX),n=Math.abs(this._lastMouseY-a.clientY),g=this._lastMouseButton===b;this._lastMouseX=a.clientX;this._lastMouseY=a.clientY;this._lastMouseTime=c;this._lastMouseButton=b;1===b&&(this._isMouseDown=!0,g&&d<=this._clickTime&&f<=this._clickDist&&n<=this._clickDist?this._clickCount++:
this._clickCount=1);if(this.isListening("MouseDown")&&(c=this._createMouseEvent("MouseDown",a),this.onMouseDown(c),c.defaultPrevented))a.preventDefault();else{if(1===b&&this._handleMouse(a)&&(9<=e.isIE||e.isOpera||e.isChrome||e.isSafari||e.isFirefox&&!this._overlayDiv))this._hasFocus||this.focus(),a.preventDefault();e.isFirefox&&3===this._lastMouseButton&&this._updateDOMSelection()}}},_handleMouseOver:function(a){if(!this._ignoreEvent(a)&&!this._animation&&this.isListening("MouseOver"))this.onMouseOver(this._createMouseEvent("MouseOver",
a))},_handleMouseOut:function(a){if(!this._ignoreEvent(a)&&!this._animation&&this.isListening("MouseOut"))this.onMouseOut(this._createMouseEvent("MouseOut",a))},_handleMouseMove:function(a){if(!this._animation){var b=this._isClientDiv(a);if(this.isListening("MouseMove")&&b)this.onMouseMove(this._createMouseEvent("MouseMove",a));if(!this._dropTarget){var c=this._linksVisible||this._lastMouseMoveX!==a.clientX||this._lastMouseMoveY!==a.clientY;this._lastMouseMoveX=a.clientX;this._lastMouseMoveY=a.clientY;
this._setLinksVisible(c&&!this._isMouseDown&&(e.isMac?a.metaKey:a.ctrlKey));if(!this._isW3CEvents){if(0===a.button)return this._setGrab(null),!0;if(!this._isMouseDown&&1===a.button&&0!==(this._clickCount&1)&&b)return this._clickCount=2,this._handleMouse(a,this._clickCount)}if(this._isMouseDown&&-1===this._dragOffset){b=a.clientX;a=a.clientY;var d=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect(),n=this._getClientWidth(),g=this._getClientHeight(),c=f.left+d.left,m=f.top+d.top,n=f.left+
d.left+n,d=f.top+d.top+g;a<m?this._doAutoScroll("up",b,a-m):a>d?this._doAutoScroll("down",b,a-d):b<c&&!this._wrapMode?this._doAutoScroll("left",b-c,a):b>n&&!this._wrapMode?this._doAutoScroll("right",b-n,a):(this._endAutoScroll(),this._setSelectionTo(b,a,!0))}}}},_isClientDiv:function(a){var b=this._overlayDiv||this._clientDiv;for(a=a.target?a.target:a.srcElement;a;){if(b===a)return!0;a=a.parentNode}return!1},_createKeyEvent:function(a,b){return{type:a,event:b,preventDefault:function(){this.defaultPrevented=
!0}}},_createMouseEvent:function(a,b){var c=this.convert({x:b.clientX,y:b.clientY},"page","document");return{type:a,event:b,clickCount:this._clickCount,x:c.x,y:c.y,preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(a){var b=a.which?0===a.button:1===a.button;if(this.isListening("MouseUp")&&(this._isClientDiv(a)||b&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp",a));if(!this._linksVisible){if(b&&this._isMouseDown){if(-1!==this._dragOffset){var c=this._getSelection();
c.extend(this._dragOffset);c.collapse();this._setSelection(c,!0,!0);this._dragOffset=-1}this._isMouseDown=!1;this._endAutoScroll();this._isW3CEvents&&this._setGrab(null)}b&&e.isFirefox&&(this._updateDOMSelection(),a.preventDefault())}},_handleMouseWheel:function(a){var b=this._getLineHeight(),c=0,d=0;e.isIE||e.isOpera?d=-a.wheelDelta/40*b:e.isFirefox?"wheel"===a.type?a.deltaMode?(c=Math.max(-256,Math.min(256,a.deltaX))*b,d=Math.max(-256,Math.min(256,a.deltaY))*b):(c=a.deltaX,d=a.deltaY):(b=e.isMac?
3*a.detail:Math.max(-256,Math.min(256,a.detail))*b,a.axis===a.HORIZONTAL_AXIS?c=b:d=b):e.isMac?(d=a.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=a.timeStamp,c=0!==a.wheelDeltaX%120?1:40>d?40/(40-d):40,d=0!==a.wheelDeltaY%120?1:40>d?40/(40-d):40,c=Math.ceil(-a.wheelDeltaX/c),-1<c&&0>c&&(c=-1),0<c&&1>c&&(c=1),d=Math.ceil(-a.wheelDeltaY/d),-1<d&&0>d&&(d=-1),0<d&&1>d&&(d=1)):(c=-a.wheelDeltaX,d=8*(-a.wheelDeltaY/120)*b);if(e.isSafari||e.isChrome&&e.isMac){for(b=a.target;b&&void 0===b.lineIndex;)b=
b.parentNode;this._mouseWheelLine=b}b=this._getScroll();this._scrollView(c,d);c=this._getScroll();if(b.x!==c.x||b.y!==c.y)return a.preventDefault&&a.preventDefault(),!1},_handlePaste:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)&&!this._ignorePaste&&this._doPaste(a)){if(e.isIE){var b=this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){b._updateDOMSelection();b._ignoreFocus=!1},0)}a.preventDefault&&a.preventDefault();return!1}},_handleResize:function(b){b=this._rootDiv.clientWidth;
var c=this._rootDiv.clientHeight;if(this._rootWidth!==b||this._rootHeight!==c)this._rootWidth!==b&&this._wrapMode&&this._resetLineHeight(),this._rootWidth=b,this._rootHeight=c,b=9>e.isIE,c=this._calculateMetrics(),a(c,this._metrics)||(this._variableLineHeight&&(this._variableLineHeight=!1,this._resetLineHeight()),this._metrics=c,b=!0),b?this._queueUpdate():this._update()},_handleRulerEvent:function(a){for(var b=a.target?a.target:a.srcElement,c=b.lineIndex;b&&!b._ruler;)void 0===c&&void 0!==b.lineIndex&&
(c=b.lineIndex),b=b.parentNode;var e=b?b._ruler:null;if(void 0===c&&e&&"document"===e.getOverview()){var c=this._getClientHeight(),d=this._model.getLineCount(),f=this._getViewPadding(),n=this._viewDiv.getBoundingClientRect(),c=Math.floor((a.clientY-n.top-this._metrics.scrollWidth)*d/(c+f.top+f.bottom-2*this._metrics.scrollWidth));0<=c&&c<d||(c=void 0)}if(e)switch(a.type){case "click":if(e.onClick)e.onClick(c,a);break;case "dblclick":if(e.onDblClick)e.onDblClick(c,a);break;case "mousemove":if(e.onMouseMove)e.onMouseMove(c,
a);break;case "mouseover":if(e.onMouseOver)e.onMouseOver(c,a);break;case "mouseout":if(e.onMouseOut){for(d=a.relatedTarget;d&&d!==this._rootDiv;){if(d===b)return;d=d.parentNode}e.onMouseOut(c,a)}}},_handleScroll:function(){var a=this._getScroll(!1),b=this._hScroll,c=this._vScroll;if(b!==a.x||c!==a.y)this._hScroll=a.x,this._vScroll=a.y,this._commitIME(),this._update(c===a.y),this.onScroll({type:"Scroll",oldValue:{x:b,y:c},newValue:a})},_handleSelectStart:function(a){var b=this._contextMenuOpen;this._contextMenuOpen=
!1;if(b)this._checkSelectionChange=!0;else if(this._ignoreSelect)return a&&a.preventDefault&&a.preventDefault(),!1},_getModelOffset:function(a,b){if(a){var c;c="DIV"===a.tagName?a:a.parentNode.parentNode;return!c._line?0:c._line.getModelOffset(a,b)}},_updateSelectionFromDOM:function(){if(!e.isOS&&!e.isAndroid&&!this._checkSelectionChange)return!1;var a=this._getWindow().getSelection(),b=this._getModelOffset(a.anchorNode,a.anchorOffset),c=this._getModelOffset(a.focusNode,a.focusOffset),d=this._getSelection();
if(void 0===b||void 0===c||d.start===b&&d.end===c)return!1;if(this._checkSelectionChange){var d=this._getLineNext(),f=this._getLinePrevious();if(a.anchorNode===d.firstChild.firstChild&&0===a.anchorOffset&&a.focusNode===f.firstChild.firstChild&&0===a.focusOffset)return!1;if(a.anchorNode===d.firstChild.firstChild&&0===a.anchorOffset&&a.focusNode===f.lastChild.firstChild||a.anchorNode===this._clientDiv&&a.focusNode===this._clientDiv)b=0,c=this.getModel().getCharCount()}this._setSelection(new t(b,c),
!1,!1);this._checkSelectionChange=!1;return!0},_cancelCheckSelection:function(){this._checkSelectionChange&&(this._checkSelectionChange=!1,this._cancelPollSelectionChange())},_cancelPollSelectionChange:function(){this._selPollTimer&&(this._getWindow().clearTimeout(this._selPollTimer),this._selPollTimer=null)},_pollSelectionChange:function(a){var b=this,c=this._getWindow();this._cancelPollSelectionChange();this._selPollTimer=c.setTimeout(function(){b._selPollTimer=null;b._clientDiv&&!b._updateSelectionFromDOM()&&
a&&b._pollSelectionChange(a)},100)},_handleSelectionChange:function(a){-1===this._imeOffset&&(e.isAndroid?this._pollSelectionChange():this._updateSelectionFromDOM())},_handleTextInput:function(a){if(!this._ignoreEvent(a)){this._imeOffset=-1;var b=this._getWindow().getSelection();if(b.anchorNode!==this._anchorNode||b.focusNode!==this._focusNode||b.anchorOffset!==this._anchorOffset||b.focusOffset!==this._focusOffset){for(var c=b.anchorNode;c&&void 0===c.lineIndex;)c=c.parentNode;if(c){var e=this._model,
d=c.lineIndex,f=e.getLine(d),n=f,g=0,e=e.getLineStart(d);0<b.rangeCount&&(b.getRangeAt(0).deleteContents(),d=c.ownerDocument.createTextNode(a.data),b.getRangeAt(0).insertNode(d),g=this._getDOMText(c,d),n=g.text,g=g.offset,d.parentNode.removeChild(d));c.lineRemoved=!0;for(c=0;f.charCodeAt(c)===n.charCodeAt(c)&&c<g;)c++;b=f.length-1;for(d=n.length-f.length;f.charCodeAt(b)===n.charCodeAt(b+d)&&b+d>=g+a.data.length;)b--;b++;f=n.substring(c,b+d);this._modifyContent({text:f,start:c+e,end:b+e,_ignoreDOMSelection:!0},
!0)}}else this._doContent(a.data);a.preventDefault()}},_handleTouchStart:function(a){this._commitIME();var b=this._getWindow();this._touchScrollTimer&&(this._vScrollDiv.style.display="none",this._hScrollDiv.style.display="none",b.clearInterval(this._touchScrollTimer),this._touchScrollTimer=null);var c=a.touches;if(1===c.length){var c=c[0],d=c.clientX,f=c.clientY;this._touchStartX=d;this._touchStartY=f;if(e.isAndroid&&(f<c.pageY-b.pageYOffset||d<c.pageX-b.pageXOffset))d=c.pageX-b.pageXOffset,f=c.pageY-
b.pageYOffset;b=this.convert({x:d,y:f},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(b.x,b.y);this._touchStartTime=a.timeStamp;this._touching=!0}},_handleTouchMove:function(a){var b=a.touches;if(1===b.length){b=b[0];this._touchCurrentX=b.clientX;this._touchCurrentY=b.clientY;if(!this._touchScrollTimer&&200>a.timeStamp-this._touchStartTime){this._vScrollDiv.style.display="block";this._wrapMode||(this._hScrollDiv.style.display="block");var c=this,e=this._getWindow();this._touchScrollTimer=
e.setInterval(function(){var a=0,b=0;if(c._touching)a=c._touchStartX-c._touchCurrentX,b=c._touchStartY-c._touchCurrentY,c._touchSpeedX=a/10,c._touchSpeedY=b/10,c._touchStartX=c._touchCurrentX,c._touchStartY=c._touchCurrentY;else{if(0.1>Math.abs(c._touchSpeedX)&&0.1>Math.abs(c._touchSpeedY)){c._vScrollDiv.style.display="none";c._hScrollDiv.style.display="none";e.clearInterval(c._touchScrollTimer);c._touchScrollTimer=null;return}a=10*c._touchSpeedX;b=10*c._touchSpeedY;c._touchSpeedX*=0.95;c._touchSpeedY*=
0.95}c._scrollView(a,b)},10)}this._touchScrollTimer&&a.preventDefault()}},_handleTouchEnd:function(a){0===a.touches.length&&(this._touching=!1)},_doAction:function(a){var b,c,e=this._keyModes;for(c=e.length-1;0<=c;c--)if(b=e[c],"function"===typeof b.match&&(b=b.match(a),void 0!==b))return this.invokeAction(b);return!1},_doMove:function(a,b){var c=this._model,e=b.getCaret(),d=c.getLineAtOffset(e);for(a.count||(a.count=1);0!==a.count;){var f=c.getLineStart(d);if(0>a.count&&e===f)if(0<d)"character"===
a.unit&&a.count++,d--,b.extend(c.getLineEnd(d));else break;else if(0<a.count&&e===c.getLineEnd(d))if(d+1<c.getLineCount())"character"===a.unit&&a.count--,d++,b.extend(c.getLineStart(d));else break;else{var n=!1;a.expandTab&&"character"===a.unit&&0===(e-f)%this._tabSize&&(f=c.getText(f,e),n=!/[^ ]/.test(f));n?(b.extend(e-this._tabSize),a.count+=0>a.count?1:-1):(f=this._getLine(d),b.extend(f.getNextOffset(e,a)),f.destroy())}e=b.getCaret()}return b},_doBackspace:function(a){var b=this._getSelection();
b.isEmpty()&&(a.count||(a.count=1),a.count*=-1,a.expandTab=this._expandTab,this._doMove(a,b));this._modifyContent({text:"",start:b.start,end:b.end},!0);return!0},_doCase:function(a){var b=this._getSelection();this._doMove(a,b);var c=this.getText(b.start,b.end);this._setSelection(b,!0);switch(a.type){case "lower":c=c.toLowerCase();break;case "capitalize":c=c.replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()});break;case "reverse":a="";for(b=0;b<c.length;b++){var e=c[b],d=e.toLowerCase(),e=d!==
e?d:e.toUpperCase();a+=e}c=a;break;default:c=c.toUpperCase()}this._doContent(c);return!0},_doContent:function(a){var b=this._getSelection();if(this._overwriteMode&&b.isEmpty()){var c=this._model,e=c.getLineAtOffset(b.end);b.end<c.getLineEnd(e)&&(c=this._getLine(e),b.extend(c.getNextOffset(b.getCaret(),{unit:"character",count:1})),c.destroy())}this._modifyContent({text:a,start:b.start,end:b.end,_ignoreDOMSelection:!0},!0)},_doCopy:function(a){var b=this._getSelection();return!b.isEmpty()?(b=this._getBaseText(b.start,
b.end),this._setClipboardText(b,a)):!0},_doCursorNext:function(a){var b=this._getSelection();!b.isEmpty()&&!a.select?b.start=b.end:this._doMove(a,b);a.select||b.collapse();this._setSelection(b,!0);return!0},_doCursorPrevious:function(a){var b=this._getSelection();!b.isEmpty()&&!a.select?b.end=b.start:(a.count||(a.count=1),a.count*=-1,this._doMove(a,b));a.select||b.collapse();this._setSelection(b,!0);return!0},_doCut:function(a){var b=this._getSelection();return!b.isEmpty()?(b=this._getBaseText(b.start,
b.end),this._doContent(""),this._setClipboardText(b,a)):!0},_doDelete:function(a){var b=this._getSelection();b.isEmpty()&&this._doMove(a,b);this._modifyContent({text:"",start:b.start,end:b.end},!0);return!0},_doEnd:function(a){var b=this._getSelection(),c=this._model,e;if(a.ctrl)b.extend(c.getCharCount()),e=function(){};else{var d=b.getCaret(),f=c.getLineAtOffset(d);if(this._wrapMode){var n=this._getLine(f),d=n.getLineIndex(d),d=d===n.getLineCount()-1?c.getLineEnd(f):n.getLineStart(d+1)-1;n.destroy()}else a.count&&
0<a.count&&(f=Math.min(f+a.count-1,c.getLineCount()-1)),d=c.getLineEnd(f);b.extend(d)}a.select||b.collapse();this._setSelection(b,!0,!0,e);return!0},_doEnter:function(a){var b=this._model,c=this._getSelection();this._doContent(b.getLineDelimiter());a&&a.noCursor&&(c.end=c.start,this._setSelection(c,!0));return!0},_doHome:function(a){var b=this._getSelection(),c=this._model,e;if(a.ctrl)b.extend(0),e=function(){};else{var d=b.getCaret(),f=c.getLineAtOffset(d);this._wrapMode?(c=this._getLine(f),d=c.getLineIndex(d),
d=c.getLineStart(d),c.destroy()):d=c.getLineStart(f);b.extend(d)}a.select||b.collapse();this._setSelection(b,!0,!0,e);return!0},_doLineDown:function(a){var b=this._model,c=this._getSelection(),d=c.getCaret(),f=b.getLineAtOffset(d),n=this._getLine(f),g=this._columnX,m=1,h=!1;if(-1===g||a.wholeLine||a.select&&e.isIE)g=a.wholeLine?b.getLineEnd(f+1):d,g=n.getBoundingClientRect(g).left;(d=n.getLineIndex(d))<n.getLineCount()-1?m=n.getClientRects(d+1).top+1:(d=b.getLineCount()-1,h=f===d,a.count&&0<a.count?
f=Math.min(f+a.count,d):f++);d=!1;if(h){if(a.select||e.isMac||e.isLinux)c.extend(b.getCharCount()),d=!0}else n.lineIndex!==f&&(n.destroy(),n=this._getLine(f)),c.extend(n.getOffset(g,m)),d=!0;d&&(a.select||c.collapse(),this._setSelection(c,!0,!0));this._columnX=g;n.destroy();return!0},_doLineUp:function(a){var b=this._model,c=this._getSelection(),d=c.getCaret(),f=b.getLineAtOffset(d),n=this._getLine(f),g=this._columnX,m=!1,h;if(-1===g||a.wholeLine||a.select&&e.isIE)g=a.wholeLine?b.getLineStart(f-1):
d,g=n.getBoundingClientRect(g).left;0<(d=n.getLineIndex(d))?h=n.getClientRects(d-1).top+1:(m=0===f,m||(a.count&&0<a.count?f=Math.max(f-a.count,0):f--,h=this._getLineHeight(f)-1));d=!1;if(m){if(a.select||e.isMac||e.isLinux)c.extend(0),d=!0}else n.lineIndex!==f&&(n.destroy(),n=this._getLine(f)),c.extend(n.getOffset(g,h)),d=!0;d&&(a.select||c.collapse(),this._setSelection(c,!0,!0));this._columnX=g;n.destroy();return!0},_doNoop:function(){return!0},_doPageDown:function(a){var b=this,c=this._model,d=this._getSelection(),
f=d.getCaret(),n=c.getLineAtOffset(f),g=c.getLineCount(),m=this._getScroll(),c=this._getClientHeight(),h,q;if(this._lineHeight){h=this._columnX;m=this._getBoundsAtOffset(f);if(-1===h||a.select&&e.isIE)h=m.left;f=this._getLineIndex(m.top+c);q=this._getLine(f);n=this._getLinePixel(f);f=q.getOffset(h,m.top+c-n);c=q.getBoundingClientRect(f);q.destroy();d.extend(f);a.select||d.collapse();this._setSelection(d,!0,!0,function(){b._columnX=h},c.top+n-m.top);return!0}if(n<g-1){var k=this._getLineHeight(),r=
Math.min(g-n-1,Math.floor(c/k)),r=Math.max(1,r);h=this._columnX;if(-1===h||a.select&&e.isIE)q=this._getLine(n),h=q.getBoundingClientRect(f).left,q.destroy();q=this._getLine(n+r);d.extend(q.getOffset(h,0));q.destroy();a.select||d.collapse();a=g*k;f=m.y+r*k;f+c>a&&(f=a-c);this._setSelection(d,!0,!0,function(){b._columnX=h},f-m.y)}return!0},_doPageUp:function(a){var b=this,c=this._model,d=this._getSelection(),f=d.getCaret(),n=c.getLineAtOffset(f),g=this._getScroll(),m=this._getClientHeight(),h;if(this._lineHeight){h=
this._columnX;g=this._getBoundsAtOffset(f);if(-1===h||a.select&&e.isIE)h=g.left;f=this._getLineIndex(g.bottom-m);c=this._getLine(f);n=this._getLinePixel(f);f=c.getOffset(h,g.bottom-m-n);m=c.getBoundingClientRect(f);c.destroy();d.extend(f);a.select||d.collapse();this._setSelection(d,!0,!0,function(){b._columnX=h},m.top+n-g.top);return!0}if(0<n){var q=this._getLineHeight(),m=Math.max(1,Math.min(n,Math.floor(m/q)));h=this._columnX;if(-1===h||a.select&&e.isIE)c=this._getLine(n),h=c.getBoundingClientRect(f).left,
c.destroy();c=this._getLine(n-m);d.extend(c.getOffset(h,this._getLineHeight(n-m)-1));c.destroy();a.select||d.collapse();a=Math.max(0,g.y-m*q);this._setSelection(d,!0,!0,function(){b._columnX=h},a-g.y)}return!0},_doPaste:function(a){var b=this;return null!==this._getClipboardText(a,function(a){a&&(e.isLinux&&2===b._lastMouseButton&&(new Date).getTime()-b._lastMouseTime<=b._clickTime&&b._setSelectionTo(b._lastMouseX,b._lastMouseY),b._doContent(a))})},_doScroll:function(a){var b=a.type,c=this._model,
e=c.getLineCount();a=this._getClientHeight();var d=this._getLineHeight(),e=e*d,f=this._getScroll().y,n;switch(b){case "textStart":n=0;break;case "textEnd":n=e-a;break;case "pageDown":n=f+a;break;case "pageUp":n=f-a;break;case "lineDown":n=f+d;break;case "lineUp":n=f-d;break;case "centerLine":b=this._getSelection(),n=c.getLineAtOffset(b.start),c=(c.getLineAtOffset(b.end)-n+1)*d,n=n*d-a/2+c/2}void 0!==n&&(n=Math.min(Math.max(0,n),e-a),this._scrollViewAnimated(0,n-f,function(){}));return!0},_doSelectAll:function(a){a=
this._model;var b=this._getSelection();b.setCaret(0);b.extend(a.getCharCount());this._setSelection(b,!1);return!0},_doTab:function(a){if(this._tabMode&&!this._readonly){a="\t";if(this._expandTab){var b=this._model;a=this._getSelection().getCaret();var c=b.getLineAtOffset(a),b=b.getLineStart(c);a=Array(this._tabSize-(a-b)%this._tabSize+1).join(" ")}this._doContent(a);return!0}},_doShiftTab:function(a){if(this._tabMode&&!this._readonly)return!0},_doOverwriteMode:function(a){if(!this._readonly)return this.setOptions({overwriteMode:!this.getOptions("overwriteMode")}),
!0},_doTabMode:function(a){this._tabMode=!this._tabMode;return!0},_doWrapMode:function(a){this.setOptions({wrapMode:!this.getOptions("wrapMode")});return!0},_autoScroll:function(){var a=this._model,b=this._getSelection(),c=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),d=b.getCaret(),f=a.getLineCount(),n=a.getLineAtOffset(d),g;if("up"===this._autoScrollDir||"down"===this._autoScrollDir)d=this._autoScrollY/this._getLineHeight(),d=0>d?Math.floor(d):Math.ceil(d),g=Math.max(0,
Math.min(f-1,n+d));else if("left"===this._autoScrollDir||"right"===this._autoScrollDir)g=this._getLineIndex(c.y),n=this._getLine(n),c.x+=n.getBoundingClientRect(d,!1).left,n.destroy();0===g&&(e.isMac||e.isLinux)?b.extend(0):g===f-1&&(e.isMac||e.isLinux)?b.extend(a.getCharCount()):(n=this._getLine(g),b.extend(n.getOffset(c.x,c.y-this._getLinePixel(g))),n.destroy());this._setSelection(b,!0)},_autoScrollTimer:function(){this._autoScroll();var a=this;this._autoScrollTimerID=this._getWindow().setTimeout(function(){a._autoScrollTimer()},
this._AUTO_SCROLL_RATE)},_calculateLineHeightTimer:function(a){if(this._lineHeight&&!this._calculateLHTimer){var b=this._model.getLineCount(),c=0;if(a){a=0;for(var e=(new Date).getTime(),d=0;c<b&&!(this._lineHeight[c]||(a++,d||(d=c),this._lineHeight[c]=this._calculateLineHeight(c)),c++,100<(new Date).getTime()-e););this.redrawRulers(0,b);this._queueUpdate()}a=this._getWindow();if(c!==b){var f=this;this._calculateLHTimer=a.setTimeout(function(){f._calculateLHTimer=null;f._calculateLineHeightTimer(!0)},
0)}else this._calculateLHTimer&&(a.clearTimeout(this._calculateLHTimer),this._calculateLHTimer=void 0)}},_calculateLineHeight:function(a){a=this._getLine(a);var b=a.getBoundingClientRect();a.destroy();return Math.max(1,b.bottom-b.top)},_calculateMetrics:function(){var a=this._clientDiv,b=a.ownerDocument,d=e.createElement(b,"div");d.style.lineHeight="normal";var f={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(f);c(f.style,d);d.style.position="fixed";
d.style.left="-1000px";var n=e.createElement(b,"span");n.appendChild(b.createTextNode(" "));d.appendChild(n);var g=e.createElement(b,"span");g.style.fontStyle="italic";g.appendChild(b.createTextNode(" "));d.appendChild(g);var m=e.createElement(b,"span");m.style.fontWeight="bold";m.appendChild(b.createTextNode(" "));d.appendChild(m);f=e.createElement(b,"span");f.style.fontWeight="bold";f.style.fontStyle="italic";f.appendChild(b.createTextNode(" "));d.appendChild(f);a.appendChild(d);var h=d.getBoundingClientRect(),
n=n.getBoundingClientRect(),g=g.getBoundingClientRect(),m=m.getBoundingClientRect(),f=f.getBoundingClientRect(),n=n.bottom-n.top,g=g.bottom-g.top,m=m.bottom-m.top,k=f.bottom-f.top,l=0,f=0>=h.bottom-h.top,h=Math.max(1,h.bottom-h.top);g>n&&(l=1);m>g&&(l=2);k>m&&(l=3);var s;0!==l&&(s={style:{}},0!==(l&1)&&(s.style.fontStyle="italic"),0!==(l&2)&&(s.style.fontWeight="bold"));n=r(d);a.removeChild(d);k=q(this._viewDiv);d=e.createElement(b,"div");d.style.position="fixed";d.style.left="-1000px";d.style.paddingLeft=
k.left+"px";d.style.paddingTop=k.top+"px";d.style.paddingRight=k.right+"px";d.style.paddingBottom=k.bottom+"px";d.style.width="100px";d.style.height="100px";k=e.createElement(b,"div");k.style.width="100%";k.style.height="100%";d.appendChild(k);a.appendChild(d);l=d.getBoundingClientRect();g=k.getBoundingClientRect();m=0;this._singleMode||(d.style.overflow="hidden",k.style.height="200px",m=d.clientWidth,d.style.overflow="scroll",m-=d.clientWidth);a.removeChild(d);k={left:g.left-l.left,top:g.top-l.top,
right:l.right-g.right,bottom:l.bottom-g.bottom};g=l=0;if(!f&&(this._wrapOffset||this._marginOffset))d=e.createElement(b,"div"),d.style.position="fixed",d.style.left="-1000px",d.innerHTML=Array(this._wrapOffset+1+(e.isWebkit?0:1)).join(" "),a.appendChild(d),l=d.getBoundingClientRect(),l=Math.ceil(l.right-l.left),d.innerHTML=Array(this._marginOffset+1).join(" "),g=d.getBoundingClientRect(),g=Math.ceil(g.right-g.left),a.removeChild(d);return{lineHeight:h,largestFontStyle:s,lineTrim:n,viewPadding:k,scrollWidth:m,
wrapWidth:l,marginWidth:g,invalid:f}},_cancelAnimation:function(){this._animation&&(this._animation.stop(),this._animation=null)},_clearSelection:function(a){var b=this._getSelection();if(b.isEmpty())return!1;"next"===a?b.start=b.end:b.end=b.start;this._setSelection(b,!0);return!0},_commitIME:function(){if(-1!==this._imeOffset){this._scrollDiv.focus();this._clientDiv.focus();var a=this._model,b=a.getLineAtOffset(this._imeOffset),c=a.getLineStart(b),d=this._getDOMText(this._getLineNode(b)).text,a=
a.getLine(b),c=this._imeOffset-c,a=c+d.length-a.length;c!==a&&(d=d.substring(c,a),this._doContent(d));this._imeOffset=-1}},_createActions:function(){this.addKeyMode(new h.DefaultKeyMode(this));var a=this;this._actions={noop:{defaultHandler:function(){return a._doNoop()}},lineUp:{defaultHandler:function(b){return a._doLineUp(m(b,{select:!1}))},actionDescription:{name:k.lineUp}},lineDown:{defaultHandler:function(b){return a._doLineDown(m(b,{select:!1}))},actionDescription:{name:k.lineDown}},lineStart:{defaultHandler:function(b){return a._doHome(m(b,
{select:!1,ctrl:!1}))},actionDescription:{name:k.lineStart}},lineEnd:{defaultHandler:function(b){return a._doEnd(m(b,{select:!1,ctrl:!1}))},actionDescription:{name:k.lineEnd}},charPrevious:{defaultHandler:function(b){return a._doCursorPrevious(m(b,{select:!1,unit:"character"}))},actionDescription:{name:k.charPrevious}},charNext:{defaultHandler:function(b){return a._doCursorNext(m(b,{select:!1,unit:"character"}))},actionDescription:{name:k.charNext}},pageUp:{defaultHandler:function(b){return a._doPageUp(m(b,
{select:!1}))},actionDescription:{name:k.pageUp}},pageDown:{defaultHandler:function(b){return a._doPageDown(m(b,{select:!1}))},actionDescription:{name:k.pageDown}},scrollPageUp:{defaultHandler:function(b){return a._doScroll(m(b,{type:"pageUp"}))},actionDescription:{name:k.scrollPageUp}},scrollPageDown:{defaultHandler:function(b){return a._doScroll(m(b,{type:"pageDown"}))},actionDescription:{name:k.scrollPageDown}},scrollLineUp:{defaultHandler:function(b){return a._doScroll(m(b,{type:"lineUp"}))},
actionDescription:{name:k.scrollLineUp}},scrollLineDown:{defaultHandler:function(b){return a._doScroll(m(b,{type:"lineDown"}))},actionDescription:{name:k.scrollLineDown}},wordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(m(b,{select:!1,unit:"word"}))},actionDescription:{name:k.wordPrevious}},wordNext:{defaultHandler:function(b){return a._doCursorNext(m(b,{select:!1,unit:"word"}))},actionDescription:{name:k.wordNext}},textStart:{defaultHandler:function(b){return a._doHome(m(b,{select:!1,
ctrl:!0}))},actionDescription:{name:k.textStart}},textEnd:{defaultHandler:function(b){return a._doEnd(m(b,{select:!1,ctrl:!0}))},actionDescription:{name:k.textEnd}},scrollTextStart:{defaultHandler:function(b){return a._doScroll(m(b,{type:"textStart"}))},actionDescription:{name:k.scrollTextStart}},scrollTextEnd:{defaultHandler:function(b){return a._doScroll(m(b,{type:"textEnd"}))},actionDescription:{name:k.scrollTextEnd}},centerLine:{defaultHandler:function(b){return a._doScroll(m(b,{type:"centerLine"}))},
actionDescription:{name:k.centerLine}},selectLineUp:{defaultHandler:function(b){return a._doLineUp(m(b,{select:!0}))},actionDescription:{name:k.selectLineUp}},selectLineDown:{defaultHandler:function(b){return a._doLineDown(m(b,{select:!0}))},actionDescription:{name:k.selectLineDown}},selectWholeLineUp:{defaultHandler:function(b){return a._doLineUp(m(b,{select:!0,wholeLine:!0}))},actionDescription:{name:k.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(b){return a._doLineDown(m(b,
{select:!0,wholeLine:!0}))},actionDescription:{name:k.selectWholeLineDown}},selectLineStart:{defaultHandler:function(b){return a._doHome(m(b,{select:!0,ctrl:!1}))},actionDescription:{name:k.selectLineStart}},selectLineEnd:{defaultHandler:function(b){return a._doEnd(m(b,{select:!0,ctrl:!1}))},actionDescription:{name:k.selectLineEnd}},selectCharPrevious:{defaultHandler:function(b){return a._doCursorPrevious(m(b,{select:!0,unit:"character"}))},actionDescription:{name:k.selectCharPrevious}},selectCharNext:{defaultHandler:function(b){return a._doCursorNext(m(b,
{select:!0,unit:"character"}))},actionDescription:{name:k.selectCharNext}},selectPageUp:{defaultHandler:function(b){return a._doPageUp(m(b,{select:!0}))},actionDescription:{name:k.selectPageUp}},selectPageDown:{defaultHandler:function(b){return a._doPageDown(m(b,{select:!0}))},actionDescription:{name:k.selectPageDown}},selectWordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(m(b,{select:!0,unit:"word"}))},actionDescription:{name:k.selectWordPrevious}},selectWordNext:{defaultHandler:function(b){return a._doCursorNext(m(b,
{select:!0,unit:"word"}))},actionDescription:{name:k.selectWordNext}},selectTextStart:{defaultHandler:function(b){return a._doHome(m(b,{select:!0,ctrl:!0}))},actionDescription:{name:k.selectTextStart}},selectTextEnd:{defaultHandler:function(b){return a._doEnd(m(b,{select:!0,ctrl:!0}))},actionDescription:{name:k.selectTextEnd}},deletePrevious:{defaultHandler:function(b){return a._doBackspace(m(b,{unit:"character"}))},actionDescription:{name:k.deletePrevious}},deleteNext:{defaultHandler:function(b){return a._doDelete(m(b,
{unit:"character"}))},actionDescription:{name:k.deleteNext}},deleteWordPrevious:{defaultHandler:function(b){return a._doBackspace(m(b,{unit:"word"}))},actionDescription:{name:k.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(b){return a._doDelete(m(b,{unit:"word"}))},actionDescription:{name:k.deleteWordNext}},deleteLineStart:{defaultHandler:function(b){return a._doBackspace(m(b,{unit:"line"}))},actionDescription:{name:k.deleteLineStart}},deleteLineEnd:{defaultHandler:function(b){return a._doDelete(m(b,
{unit:"line"}))},actionDescription:{name:k.deleteLineEnd}},tab:{defaultHandler:function(b){return a._doTab()},actionDescription:{name:k.tab}},shiftTab:{defaultHandler:function(b){return a._doShiftTab()},actionDescription:{name:k.shiftTab}},enter:{defaultHandler:function(b){return a._doEnter()},actionDescription:{name:k.enter}},enterNoCursor:{defaultHandler:function(b){return a._doEnter(m(b,{noCursor:!0}))},actionDescription:{name:k.enterNoCursor}},selectAll:{defaultHandler:function(b){return a._doSelectAll()},
actionDescription:{name:k.selectAll}},copy:{defaultHandler:function(b){return a._doCopy()},actionDescription:{name:k.copy}},cut:{defaultHandler:function(b){return a._doCut()},actionDescription:{name:k.cut}},paste:{defaultHandler:function(b){return a._doPaste()},actionDescription:{name:k.paste}},uppercase:{defaultHandler:function(b){return a._doCase(m(b,{type:"upper"}))},actionDescription:{name:k.uppercase}},lowercase:{defaultHandler:function(b){return a._doCase(m(b,{type:"lower"}))},actionDescription:{name:k.lowercase}},
capitalize:{defaultHandler:function(b){return a._doCase(m(b,{unit:"word",type:"capitalize"}))},actionDescription:{name:k.capitalize}},reversecase:{defaultHandler:function(b){return a._doCase(m(b,{type:"reverse"}))},actionDescription:{name:k.reversecase}},toggleOverwriteMode:{defaultHandler:function(b){return a._doOverwriteMode()},actionDescription:{name:k.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(b){return a._doTabMode()},actionDescription:{name:k.toggleTabMode}},toggleWrapMode:{defaultHandler:function(b){return a._doWrapMode()},
actionDescription:{name:k.toggleWrapMode}}}},_createRulerParent:function(a,b){var c=e.createElement(a,"div");c.className=b;c.tabIndex=-1;c.style.overflow="hidden";c.style.MozUserSelect="none";c.style.WebkitUserSelect="none";c.style.position="absolute";c.style.top="0px";c.style.bottom="0px";c.style.cursor="default";c.style.display="none";c.setAttribute("aria-hidden","true");this._rootDiv.appendChild(c);return c},_createRuler:function(a,b){if(this._clientDiv){var c=this._getRulerParent(a);if(c){if(c!==
this._marginDiv||this._marginOffset)c.style.display="block";var d=e.createElement(c.ownerDocument,"div");d._ruler=a;d.rulerChanged=!0;d.style.position="relative";d.style.cssFloat="left";d.style.styleFloat="left";d.style.outline="none";if(void 0===b||0>b||b>=c.children.length)c.appendChild(d);else{for(var f=c.firstChild;f&&0<b--;)f=f.nextSibling;c.insertBefore(d,f)}}}},_createView:function(){function a(){n._rootDiv&&(n.update(!0),n._metrics.invalid&&n._getWindow().setTimeout(function(){a()},100))}
if(!this._clientDiv){for(var b=this._parent;b.hasChildNodes();)b.removeChild(b.lastChild);var c=b.ownerDocument,d=e.createElement(c,"div");this._rootDiv=d;d.tabIndex=-1;d.style.position="relative";d.style.overflow="hidden";d.style.width="100%";d.style.height="100%";d.style.overflow="hidden";d.style.WebkitTextSizeAdjust="100%";d.setAttribute("role","application");b.appendChild(d);this._leftDiv=this._createRulerParent(c,"textviewLeftRuler");b=e.createElement(c,"div");b.className="textviewScroll";this._viewDiv=
b;b.tabIndex=-1;b.style.position="absolute";b.style.top="0px";b.style.bottom="0px";b.style.borderWidth="0px";b.style.margin="0px";b.style.outline="none";b.style.background="transparent";e.isMac&&e.isWebkit&&(b.style.pointerEvents="none",b.style.zIndex="2");d.appendChild(b);var f=this._createRulerParent(c,"textviewRightRuler");this._rightDiv=f;f.style.right="0px";this._scrollDiv=f=e.createElement(c,"div");f.style.margin="0px";f.style.borderWidth="0px";f.style.padding="0px";b.appendChild(f);(this._marginDiv=
this._createRulerParent(c,"textviewMarginRuler")).style.zIndex="4";!e.isIE&&!e.isIOS&&(this._clipDiv=b=e.createElement(c,"div"),b.style.position="absolute",b.style.overflow="hidden",b.style.margin="0px",b.style.borderWidth="0px",b.style.padding="0px",b.style.background="transparent",d.appendChild(b),this._clipScrollDiv=f=e.createElement(c,"div"),f.style.position="absolute",f.style.height="1px",f.style.top="-1000px",f.style.background="transparent",b.appendChild(f));this._setFullSelection(this._fullSelection,
!0);b=e.createElement(c,"div");b.className="textviewContent";this._clientDiv=b;b.tabIndex=0;b.style.position="absolute";b.style.borderWidth="0px";b.style.margin="0px";b.style.padding="0px";b.style.outline="none";b.style.zIndex="1";b.style.WebkitUserSelect="text";b.setAttribute("spellcheck","false");if(e.isIOS||e.isAndroid)b.style.WebkitTapHighlightColor="transparent";(this._clipDiv||d).appendChild(b);if(e.isIOS||e.isAndroid)this._vScrollDiv=f=e.createElement(c,"div"),f.style.position="absolute",f.style.borderWidth=
"1px",f.style.borderColor="white",f.style.borderStyle="solid",f.style.borderRadius="4px",f.style.backgroundColor="black",f.style.opacity="0.5",f.style.margin="0px",f.style.padding="0px",f.style.outline="none",f.style.zIndex="3",f.style.width="8px",f.style.display="none",d.appendChild(f),this._hScrollDiv=f=e.createElement(c,"div"),f.style.position="absolute",f.style.borderWidth="1px",f.style.borderColor="white",f.style.borderStyle="solid",f.style.borderRadius="4px",f.style.backgroundColor="black",
f.style.opacity="0.5",f.style.margin="0px",f.style.padding="0px",f.style.outline="none",f.style.zIndex="3",f.style.height="8px",f.style.display="none",d.appendChild(f);e.isFirefox&&!b.setCapture&&(this._overlayDiv=f=e.createElement(c,"div"),f.style.position=b.style.position,f.style.borderWidth=b.style.borderWidth,f.style.margin=b.style.margin,f.style.padding=b.style.padding,f.style.cursor="text",f.style.zIndex="2",(this._clipDiv||d).appendChild(f));b.contentEditable="true";b.setAttribute("role","textbox");
b.setAttribute("aria-multiline","true");this._setWrapMode(this._wrapMode,!0);this._setReadOnly(this._readonly);this._setThemeClass(this._themeClass,!0);this._setTabSize(this._tabSize,!0);this._setMarginOffset(this._marginOffset,!0);this._hookEvents();b=this._rulers;for(f=0;f<b.length;f++)this._createRuler(b[f]);this._update();var n=this;s(c,d,"textview",a)}},_defaultOptions:function(){return{parent:{value:void 0,update:null},model:{value:void 0,update:this.setModel},scrollAnimation:{value:0,update:null},
readonly:{value:!1,update:this._setReadOnly},fullSelection:{value:!0,update:this._setFullSelection},tabMode:{value:!0,update:null},tabSize:{value:8,update:this._setTabSize},expandTab:{value:!1,update:null},singleMode:{value:!1,update:this._setSingleMode},overwriteMode:{value:!1,update:this._setOverwriteMode},blockCursorVisible:{value:!1,update:this._setBlockCursor},marginOffset:{value:0,update:this._setMarginOffset},wrapOffset:{value:0,update:this._setWrapOffset},wrapMode:{value:!1,update:this._setWrapMode},
wrappable:{value:!1,update:null},theme:{value:d.TextTheme.getTheme(),update:this._setTheme},themeClass:{value:void 0,update:this._setThemeClass}}},_destroyRuler:function(a){var b=this._getRulerParent(a);if(b)for(var c=b.firstChild;c;){if(c._ruler===a){c._ruler=void 0;b.removeChild(c);if(0===b.children.length&&(b!==this._marginDiv||!this._marginOffset))b.style.display="none";break}c=c.nextSibling}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);this._unhookEvents();var a=this._getWindow();
this._autoScrollTimerID&&(a.clearTimeout(this._autoScrollTimerID),this._autoScrollTimerID=null);this._updateTimer&&(a.clearTimeout(this._updateTimer),this._updateTimer=null);a=this._rootDiv;a.parentNode.removeChild(a);this._hScrollDiv=this._vScrollDiv=this._cursorDiv=this._marginDiv=this._rightDiv=this._leftDiv=this._overlayDiv=this._clientDiv=this._clipScrollDiv=this._clipDiv=this._viewDiv=this._scrollDiv=this._rootDiv=this._clipboardDiv=this._selDiv3=this._selDiv2=this._selDiv1=null}},_doAutoScroll:function(a,
b,c){this._autoScrollDir=a;this._autoScrollX=b;this._autoScrollY=c;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&this._getWindow().clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=this._autoScrollDir=void 0},_fixCaret:function(){var a=this._clientDiv;if(a){var b=this._hasFocus;this._ignoreFocus=!0;b&&a.blur();a.contentEditable=!1;a.contentEditable=!0;b&&a.focus();this._ignoreFocus=!1}},_getBaseText:function(a,b){var c=this._model;
c.getBaseModel&&(a=c.mapOffset(a),b=c.mapOffset(b),c=c.getBaseModel());return c.getText(a,b)},_getBottomIndex:function(a){var b=this._bottomChild;if(a&&this._getClientHeight()>this._getLineHeight()){a=b.getBoundingClientRect();var c=this._clientDiv.getBoundingClientRect();a.bottom>c.bottom&&(b=this._getLinePrevious(b)||b)}return b.lineIndex},_getBoundsAtOffset:function(a){var b=this._getLine(this._model.getLineAtOffset(a));a=b.getBoundingClientRect(a);var c=this._getLinePixel(b.lineIndex);a.top+=
c;a.bottom+=c;b.destroy();return a},_getClientHeight:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-a.top-a.bottom)},_getClientWidth:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientWidth-a.left-a.right)},_getClipboardText:function(a,b){var c=this._model.getLineDelimiter(),d,f,g=this._getWindow(),m=g.clipboardData;!m&&a&&(m=a.clipboardData);if(m)return d=[],f=m.getData(e.isIE?"Text":"text/plain"),n(f,function(a){d.push(a)},function(){d.push(c)}),
f=d.join(""),b&&b(f),f;if(e.isFirefox){this._ignoreFocus=!0;var h=this._clipboardDiv,m=this._rootDiv.ownerDocument;h||(this._clipboardDiv=h=e.createElement(m,"div"),h.style.position="fixed",h.style.whiteSpace="pre",h.style.left="-1000px",this._rootDiv.appendChild(h));h.innerHTML="\x3cpre contenteditable\x3d''\x3e\x3c/pre\x3e";h.firstChild.focus();var q=this,k=function(){var a=q._getTextFromElement(h);h.innerHTML="";d=[];n(a,function(a){d.push(a)},function(){d.push(c)});return d.join("")},r=!1;this._ignorePaste=
!0;if(!e.isLinux||2!==this._lastMouseButton)try{r=m.execCommand("paste",!1,null)}catch(l){r=1<h.childNodes.length||h.firstChild&&0<h.firstChild.childNodes.length}this._ignorePaste=!1;if(!r){if(a)return g.setTimeout(function(){q.focus();(f=k())&&b&&b(f);q._ignoreFocus=!1},0),null;this.focus();this._ignoreFocus=!1;return""}this.focus();this._ignoreFocus=!1;(f=k())&&b&&b(f);return f}return""},_getDOMText:function(a,b){return a._line.getText(b)},_getTextFromElement:function(a){var b=a.ownerDocument,c=
b.defaultView;if(!c.getSelection)return a.innerText||a.textContent;b=b.createRange();b.selectNode(a);a=c.getSelection();var c=[],d;for(d=0;d<a.rangeCount;d++)c.push(a.getRangeAt(d));this._ignoreSelect=!0;a.removeAllRanges();a.addRange(b);b=a.toString();a.removeAllRanges();for(d=0;d<c.length;d++)a.addRange(c[d]);this._ignoreSelect=!1;return b},_getViewPadding:function(){return this._metrics.viewPadding},_getLine:function(a){var b=this._getLineNode(a);return b&&!b.lineChanged&&!b.lineRemoved?b._line:
new v(this,a)},_getLineHeight:function(a,b){if(void 0!==a&&this._lineHeight){var c=this._lineHeight[a];if(c)return c;if(b||void 0===b)return this._lineHeight[a]=this._calculateLineHeight(a)}return this._metrics.lineHeight},_getLineNode:function(a){for(var b=this._clientDiv.firstChild;b;){if(a===b.lineIndex)return b;b=b.nextSibling}},_getLineNext:function(a){for(a=a?a.nextSibling:this._clientDiv.firstChild;a&&-1===a.lineIndex;)a=a.nextSibling;return a},_getLinePrevious:function(a){for(a=a?a.previousSibling:
this._clientDiv.lastChild;a&&-1===a.lineIndex;)a=a.previousSibling;return a},_getLinePixel:function(a){a=Math.min(Math.max(0,a),this._model.getLineCount());if(this._lineHeight){var b=this._getTopIndex(),c=-this._topIndexY+this._getScroll().y;if(a>b)for(;b<a;b++)c+=this._getLineHeight(b);else for(b-=1;b>=a;b--)c-=this._getLineHeight(b);return c}return this._getLineHeight()*a},_getLineIndex:function(a){var b,c=0,d=this._model.getLineCount();if(this._lineHeight){var c=this._getTopIndex(),e=-this._topIndexY+
this._getScroll().y;if(a!==e)if(a<e)for(;a<e&&0<c;)a+=this._getLineHeight(--c);else for(b=this._getLineHeight(c);a-b>=e&&c<d-1;)a-=b,b=this._getLineHeight(++c)}else b=this._getLineHeight(),c=Math.floor(a/b);return Math.max(0,Math.min(d-1,c))},_getRulerParent:function(a){switch(a.getLocation()){case "left":return this._leftDiv;case "right":return this._rightDiv;case "margin":return this._marginDiv}return null},_getScroll:function(a){(void 0===a||a)&&this._cancelAnimation();a=this._viewDiv;return{x:a.scrollLeft,
y:a.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(a){var b=this._topChild;if(a&&this._getClientHeight()>this._getLineHeight()){a=b.getBoundingClientRect();var c=this._getViewPadding(),d=this._viewDiv.getBoundingClientRect();a.top<d.top+c.top&&(b=this._getLineNext(b)||b)}return b.lineIndex},_hookEvents:function(){var a=this;this._modelListener={onChanging:function(b){a._onModelChanging(b)},onChanged:function(b){a._onModelChanged(b)}};this._model.addEventListener("preChanging",
this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._themeListener={onChanged:function(b){a._setThemeClass(a._themeClass)}};this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);var b=this._handlers=[],c=this._clientDiv,d=this._viewDiv,f=this._rootDiv,n=this._overlayDiv||c,g=c.ownerDocument,m=this._getWindow(),h=e.isIE?g:m;b.push({target:m,type:"resize",handler:function(b){return a._handleResize(b?b:m.event)}});b.push({target:c,
type:"blur",handler:function(b){return a._handleBlur(b?b:m.event)}});b.push({target:c,type:"focus",handler:function(b){return a._handleFocus(b?b:m.event)}});b.push({target:d,type:"focus",handler:function(a){c.focus()}});b.push({target:d,type:"scroll",handler:function(b){return a._handleScroll(b?b:m.event)}});b.push({target:c,type:"textInput",handler:function(b){return a._handleTextInput(b?b:m.event)}});b.push({target:c,type:"keydown",handler:function(b){return a._handleKeyDown(b?b:m.event)}});b.push({target:c,
type:"keypress",handler:function(b){return a._handleKeyPress(b?b:m.event)}});b.push({target:c,type:"keyup",handler:function(b){return a._handleKeyUp(b?b:m.event)}});e.isIE&&b.push({target:g,type:"keyup",handler:function(b){return a._handleDocKeyUp(b?b:m.event)}});b.push({target:c,type:"contextmenu",handler:function(b){return a._handleContextMenu(b?b:m.event)}});b.push({target:c,type:"copy",handler:function(b){return a._handleCopy(b?b:m.event)}});b.push({target:c,type:"cut",handler:function(b){return a._handleCut(b?
b:m.event)}});b.push({target:c,type:"paste",handler:function(b){return a._handlePaste(b?b:m.event)}});b.push({target:g,type:"selectionchange",handler:function(b){return a._handleSelectionChange(b?b:m.event)}});if(e.isIOS||e.isAndroid)b.push({target:c,type:"touchstart",handler:function(b){return a._handleTouchStart(b?b:m.event)}}),b.push({target:c,type:"touchmove",handler:function(b){return a._handleTouchMove(b?b:m.event)}}),b.push({target:c,type:"touchend",handler:function(b){return a._handleTouchEnd(b?
b:m.event)}});else{b.push({target:c,type:"selectstart",handler:function(b){return a._handleSelectStart(b?b:m.event)}});b.push({target:c,type:"mousedown",handler:function(b){return a._handleMouseDown(b?b:m.event)}});b.push({target:c,type:"mouseover",handler:function(b){return a._handleMouseOver(b?b:m.event)}});b.push({target:c,type:"mouseout",handler:function(b){return a._handleMouseOut(b?b:m.event)}});b.push({target:h,type:"mouseup",handler:function(b){return a._handleMouseUp(b?b:m.event)}});b.push({target:h,
type:"mousemove",handler:function(b){return a._handleMouseMove(b?b:m.event)}});b.push({target:f,type:"mousedown",handler:function(b){return a._handleRootMouseDown(b?b:m.event)}});b.push({target:f,type:"mouseup",handler:function(b){return a._handleRootMouseUp(b?b:m.event)}});b.push({target:n,type:"dragstart",handler:function(b){return a._handleDragStart(b?b:m.event)}});b.push({target:n,type:"drag",handler:function(b){return a._handleDrag(b?b:m.event)}});b.push({target:n,type:"dragend",handler:function(b){return a._handleDragEnd(b?
b:m.event)}});b.push({target:n,type:"dragenter",handler:function(b){return a._handleDragEnter(b?b:m.event)}});b.push({target:n,type:"dragover",handler:function(b){return a._handleDragOver(b?b:m.event)}});b.push({target:n,type:"dragleave",handler:function(b){return a._handleDragLeave(b?b:m.event)}});b.push({target:n,type:"drop",handler:function(b){return a._handleDrop(b?b:m.event)}});b.push({target:this._clientDiv,type:26<e.isFirefox?"wheel":e.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(b){return a._handleMouseWheel(b?
b:m.event)}});this._clipDiv&&b.push({target:this._clipDiv,type:26<e.isFirefox?"wheel":e.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(b){return a._handleMouseWheel(b?b:m.event)}});if(e.isFirefox&&(!e.isWindows||15<=e.isFirefox))(d=m.MutationObserver||m.MozMutationObserver)?(this._mutationObserver=new d(function(b){a._handleDataModified(b)}),this._mutationObserver.observe(c,{subtree:!0,characterData:!0})):b.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(b){return a._handleDataModified(b?
b:m.event)}});this._overlayDiv&&(b.push({target:this._overlayDiv,type:"mousedown",handler:function(b){return a._handleMouseDown(b?b:m.event)}}),b.push({target:this._overlayDiv,type:"mouseover",handler:function(b){return a._handleMouseOver(b?b:m.event)}}),b.push({target:this._overlayDiv,type:"mouseout",handler:function(b){return a._handleMouseOut(b?b:m.event)}}),b.push({target:this._overlayDiv,type:"contextmenu",handler:function(b){return a._handleContextMenu(b?b:m.event)}}));this._isW3CEvents||b.push({target:this._clientDiv,
type:"dblclick",handler:function(b){return a._handleDblclick(b?b:m.event)}})}this._hookRulerEvents(this._leftDiv,b);this._hookRulerEvents(this._rightDiv,b);this._hookRulerEvents(this._marginDiv,b);for(d=0;d<b.length;d++)f=b[d],z(f.target,f.type,f.handler,f.capture)},_hookRulerEvents:function(a,b){if(a){var c=this,d=this._getWindow();e.isIE&&b.push({target:a,type:"selectstart",handler:function(){return!1}});b.push({target:a,type:26<e.isFirefox?"wheel":e.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return c._handleMouseWheel(a?
a:d.event)}});b.push({target:a,type:"click",handler:function(a){c._handleRulerEvent(a?a:d.event)}});b.push({target:a,type:"dblclick",handler:function(a){c._handleRulerEvent(a?a:d.event)}});b.push({target:a,type:"mousemove",handler:function(a){c._handleRulerEvent(a?a:d.event)}});b.push({target:a,type:"mouseover",handler:function(a){c._handleRulerEvent(a?a:d.event)}});b.push({target:a,type:"mouseout",handler:function(a){c._handleRulerEvent(a?a:d.event)}})}},_getWindow:function(){return this._parent.ownerDocument.defaultView||
this._parent.ownerDocument.parentWindow},_ignoreEvent:function(a){for(a=a.target;a&&a!==this._clientDiv;){if(a.ignore)return!0;a=a.parentNode}return!1},_init:function(a){var b=a.parent;"string"===typeof b&&(b=(a.document||document).getElementById(b));if(!b)throw"no parent";a.parent=b;a.model=a.model||new l.TextModel;var c=this._defaultOptions(),d;for(d in c)c.hasOwnProperty(d)&&(this["_"+d]=void 0!==a[d]?a[d]:c[d].value);this._keyModes=[];this._rulers=[];this._selection=new t(0,0,!1);this._linksVisible=
!1;this._maxLineWidth=this._redrawCount=0;this._maxLineIndex=-1;this._ignoreSelect=!0;this._hasFocus=this._ignoreFocus=!1;this._dragOffset=this._columnX=-1;this._isRangeRects=(!e.isIE||9<=e.isIE)&&"function"===typeof b.ownerDocument.createRange().getBoundingClientRect;this._isW3CEvents=b.addEventListener;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=!1;this._doubleClickSelection=null;this._vScroll=this._hScroll=0;this._imeOffset=-1;this._createActions();this._createView()},_modifyContent:function(a,b){if(!this._readonly||a._code)if(a.type="Verify",this.onVerify(a),!(null===a.text||void 0===a.text)){var c=this._model;try{a._ignoreDOMSelection&&(this._ignoreDOMSelection=!0),c.setText(a.text,a.start,a.end)}finally{a._ignoreDOMSelection&&(this._ignoreDOMSelection=!1)}b&&(c=
this._getSelection(),c.setCaret(a.start+a.text.length),this._setSelection(c,!0));this.onModify({type:"Modify"})}},_onModelChanged:function(a){a.type="ModelChanged";this.onModelChanged(a);a.type="Changed";var b=a.start,c=a.addedCharCount,d=a.removedCharCount,e=a.addedLineCount,f=a.removedLineCount,n=this._getSelection();n.end>b&&(n.end>b&&n.start<b+d?n.setCaret(b+c):(n.start+=c-d,n.end+=c-d),this._setSelection(n,!1,!1));b=this._model.getLineAtOffset(b);for(c=this._getLineNext();c;)d=c.lineIndex,b<=
d&&d<=b+f&&(b===d&&!c.modelChangedEvent&&!c.lineRemoved?(c.modelChangedEvent=a,c.lineChanged=!0):(c.lineRemoved=!0,c.lineChanged=!1,c.modelChangedEvent=null)),d>b+f&&(c.lineIndex=d+e-f,c._line.lineIndex=c.lineIndex),c=this._getLineNext(c);this._lineHeight&&(a=[b,f].concat(Array(e)),Array.prototype.splice.apply(this._lineHeight,a));!this._wrapMode&&b<=this._maxLineIndex&&this._maxLineIndex<=b+f&&(this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0);this._update()},
_onModelChanging:function(a){a.type="ModelChanging";this.onModelChanging(a);a.type="Changing"},_queueUpdate:function(){if(!this._updateTimer&&!this._ignoreQueueUpdate){var a=this;this._updateTimer=this._getWindow().setTimeout(function(){a._updateTimer=null;a._update()},0)}},_resetLineHeight:function(a,b){if(this._wrapMode||this._variableLineHeight){if(void 0!==a&&void 0!==b)for(var c=a;c<b;c++)this._lineHeight[c]=void 0;else this._lineHeight=Array(this._model.getLineCount());this._calculateLineHeightTimer()}else this._lineHeight=
null},_resetLineWidth:function(){var a=this._clientDiv;if(a)for(a=a.firstChild;a;)a.lineWidth=void 0,a=a.nextSibling},_reset:function(){this._maxLineIndex=-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._topIndexY=0;this._variableLineHeight=!1;this._resetLineHeight();this._setSelection(new t(0,0,!1),!1,!1);this._viewDiv&&(this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=0);var a=this._clientDiv;if(a){for(a=a.firstChild;a;)a.lineRemoved=!0,a=a.nextSibling;13>e.isFirefox&&
this._fixCaret()}},_scrollViewAnimated:function(a,b,c){var d=this._getWindow();if(c&&this._scrollAnimation){var e=this;this._animation=new A({window:d,duration:this._scrollAnimation,curve:[b,0],onAnimate:function(a){a=b-Math.floor(a);e._scrollView(0,a);b-=a},onEnd:function(){e._animation=null;e._scrollView(a,b);c&&d.setTimeout(c,0)}});this._animation.play()}else this._scrollView(a,b),c&&d.setTimeout(c,0)},_scrollView:function(a,b){this._ensureCaretVisible=!1;var c=this._viewDiv;a&&(c.scrollLeft+=
a);b&&(c.scrollTop+=b)},_setClipboardText:function(a,b){var c,d=this._getWindow(),f=d.clipboardData;!f&&b&&(f=b.clipboardData);if(f&&(c=[],n(a,function(a){c.push(a)},function(){c.push(e.platformDelimiter)}),f.setData(e.isIE?"Text":"text/plain",c.join(""))))return!0;var g=this._parent.ownerDocument,m=e.createElement(g,"pre");m.style.position="fixed";m.style.left="-1000px";n(a,function(a){m.appendChild(g.createTextNode(a))},function(){m.appendChild(e.createElement(g,"br"))});m.appendChild(g.createTextNode(" "));
this._clientDiv.appendChild(m);f=g.createRange();f.setStart(m.firstChild,0);f.setEndBefore(m.lastChild);var h=d.getSelection();0<h.rangeCount&&h.removeAllRanges();h.addRange(f);var q=this,f=function(){m&&m.parentNode===q._clientDiv&&q._clientDiv.removeChild(m);q._updateDOMSelection()},h=!1;this._ignoreCopy=!0;try{h=g.execCommand("copy",!1,null)}catch(k){}this._ignoreCopy=!1;if(!h&&b)return d.setTimeout(f,0),!1;f();return!0},_setDOMSelection:function(a,b,c,d,f){this._setDOMFullSelection(a,b,c,d);a=
a._line.getNodeOffset(b);c=c._line.getNodeOffset(d);d=this._getWindow();b=this._parent.ownerDocument;if(d.getSelection){var n=d.getSelection();d=b.createRange();d.setStart(a.node,a.offset);d.setEnd(c.node,c.offset);if(this._hasFocus&&(n.anchorNode!==a.node||n.anchorOffset!==a.offset||n.focusNode!==c.node||n.focusOffset!==c.offset||n.anchorNode!==c.node||n.anchorOffset!==c.offset||n.focusNode!==a.node||n.focusOffset!==a.offset))this._anchorNode=a.node,this._anchorOffset=a.offset,this._focusNode=c.node,
this._focusOffset=c.offset,this._ignoreSelect=!1,0<n.rangeCount&&n.removeAllRanges(),n.addRange(d),this._ignoreSelect=!0;this._cursorDiv&&(d=b.createRange(),f?(d.setStart(a.node,a.offset),d.setEnd(a.node,a.offset)):(d.setStart(c.node,c.offset),d.setEnd(c.node,c.offset)),f=d.getClientRects()[0],a=this._cursorDiv.parentNode,c=a.getBoundingClientRect(),f&&c&&(this._cursorDiv.style.top=f.top-c.top+a.scrollTop+"px",this._cursorDiv.style.left=f.left-c.left+a.scrollLeft+"px"))}else b.selection&&this._hasFocus&&
(f=b.body,d=e.createElement(b,"div"),f.appendChild(d),f.removeChild(d),d=f.createTextRange(),d.moveToElementText(a.node.parentNode),d.moveStart("character",a.offset),f=f.createTextRange(),f.moveToElementText(c.node.parentNode),f.moveStart("character",c.offset),d.setEndPoint("EndToStart",f),this._ignoreSelect=!1,d.select(),this._ignoreSelect=!0)},_setDOMFullSelection:function(a,b,c,d){if(this._selDiv1){var e=this._selDiv1;e.style.width="0px";e.style.height="0px";e=this._selDiv2;e.style.width="0px";
e.style.height="0px";e=this._selDiv3;e.style.width="0px";e.style.height="0px";if(!(a===c&&b===d)){var f=this._getViewPadding(),n=this._clientDiv.getBoundingClientRect(),g=this._viewDiv.getBoundingClientRect(),e=g.left+f.left,m=n.right,f=g.top+f.top,h=n.bottom,g=n=0;this._clipDiv?(g=this._clipDiv.getBoundingClientRect(),n=g.left-this._clipDiv.scrollLeft):(g=this._rootDiv.getBoundingClientRect(),n=g.left);g=g.top;this._ignoreDOMSelection=!0;var q=(new v(this,a.lineIndex,a)).getBoundingClientRect(b,
!1),k=q.left;b=(new v(this,c.lineIndex,c)).getBoundingClientRect(d,!1);var r=b.left;this._ignoreDOMSelection=!1;var l=this._selDiv1,k=Math.min(m,Math.max(e,k)),s=Math.min(h,Math.max(f,q.top)),x=m;d=Math.min(h,Math.max(f,q.bottom));l.style.left=k-n+"px";l.style.top=s-g+"px";l.style.width=Math.max(0,x-k)+"px";l.style.height=Math.max(0,d-s)+"px";a.lineIndex===c.lineIndex?(x=Math.min(r,m),l.style.width=Math.max(0,x-k)+"px"):(q=Math.min(h,Math.max(f,b.top)),r=Math.min(m,Math.max(e,r)),f=Math.min(h,Math.max(f,
b.bottom)),h=this._selDiv3,h.style.left=e-n+"px",h.style.top=q-g+"px",h.style.width=Math.max(0,r-e)+"px",h.style.height=Math.max(0,f-q)+"px",1<Math.abs(a.lineIndex-c.lineIndex)&&(a=this._selDiv2,a.style.left=e-n+"px",a.style.top=d-g+"px",a.style.width=Math.max(0,m-e)+"px",a.style.height=Math.max(0,q-d)+"px"))}}},_setGrab:function(a){a!==this._grabControl&&(a?(a.setCapture&&a.setCapture(),this._grabControl=a):(this._grabControl.releaseCapture&&this._grabControl.releaseCapture(),this._grabControl=null))},
_setLinksVisible:function(a){if(this._linksVisible!==a){this._linksVisible=a;e.isIE&&a&&(this._hadFocus=this._hasFocus);var b=this._clientDiv;b.contentEditable=!a;this._hadFocus&&!a&&b.focus();this._overlayDiv&&(this._overlayDiv.style.zIndex=a?"-1":"1");for(a=this._getLineNext();a;)a._line.updateLinks(),a=this._getLineNext(a);this._updateDOMSelection()}},_setSelection:function(a,b,c,d,e){if(a){this._columnX=-1;void 0===c&&(c=!0);var f=this._selection;this._selection=a;!1!==b&&this._showCaret(!1,d,
b,e);c&&this._updateDOMSelection();if(!f.equals(a))this.onSelection({type:"Selection",oldValue:{start:f.start,end:f.end},newValue:{start:a.start,end:a.end}})}},_setSelectionTo:function(a,b,c,d){var e=this._model,f=this._getSelection();b=this.convert({x:a,y:b},"page","document");a=this._getLineIndex(b.y);if(1===this._clickCount){e=this._getLine(a);a=e.getOffset(b.x,b.y-this._getLinePixel(a));e.destroy();if(d&&!c&&f.start<=a&&a<f.end)return this._dragOffset=a,!1;f.extend(a);c||f.collapse()}else 0===
(this._clickCount&1)?(e=this._getLine(a),a=e.getOffset(b.x,b.y-this._getLinePixel(a)),this._doubleClickSelection?a>=this._doubleClickSelection.start?(c=this._doubleClickSelection.start,d=e.getNextOffset(a,{unit:"wordend",count:1})):(c=e.getNextOffset(a,{unit:"word",count:-1}),d=this._doubleClickSelection.end):(c=e.getNextOffset(a,{unit:"word",count:-1}),d=e.getNextOffset(c,{unit:"wordend",count:1})),e.destroy()):this._doubleClickSelection?(d=e.getLineAtOffset(this._doubleClickSelection.start),a>=
d?(c=e.getLineStart(d),d=e.getLineEnd(a)):(c=e.getLineStart(a),d=e.getLineEnd(d))):(c=e.getLineStart(a),d=e.getLineEnd(a)),f.setCaret(c),f.extend(d);this._setSelection(f,!0,!0);return!0},_setFullSelection:function(a,b){this._fullSelection=a;e.isWebkit&&(this._fullSelection=!0);var c=this._clipDiv||this._rootDiv;if(c)if(this._fullSelection){if(!this._selDiv1&&this._fullSelection&&!e.isIOS){var d=c.ownerDocument;this._highlightRGB=e.isWebkit?"transparent":"Highlight";var f=e.createElement(d,"div");
this._selDiv1=f;f.style.position="absolute";f.style.borderWidth="0px";f.style.margin="0px";f.style.padding="0px";f.style.outline="none";f.style.background=this._highlightRGB;f.style.width="0px";f.style.height="0px";f.style.zIndex="0";c.appendChild(f);var n=e.createElement(d,"div");this._selDiv2=n;n.style.position="absolute";n.style.borderWidth="0px";n.style.margin="0px";n.style.padding="0px";n.style.outline="none";n.style.background=this._highlightRGB;n.style.width="0px";n.style.height="0px";n.style.zIndex=
"0";c.appendChild(n);this._selDiv3=d=e.createElement(d,"div");d.style.position="absolute";d.style.borderWidth="0px";d.style.margin="0px";d.style.padding="0px";d.style.outline="none";d.style.background=this._highlightRGB;d.style.width="0px";d.style.height="0px";d.style.zIndex="0";c.appendChild(d);if(e.isFirefox&&e.isMac){c=this._getWindow().getComputedStyle(d,null).getPropertyValue("background-color");switch(c){case "rgb(119, 141, 168)":c="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":c="rgb(198, 198, 198)";
break;case "rgb(255, 193, 31)":c="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":c="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":c="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":c="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":c="rgb(232, 184, 255)";break;default:c="rgb(180, 213, 255)"}this._highlightRGB=c;f.style.background=c;n.style.background=c;d.style.background=c}b||this._updateDOMSelection()}}else this._selDiv1&&(c.removeChild(this._selDiv1),this._selDiv1=null),this._selDiv2&&
(c.removeChild(this._selDiv2),this._selDiv2=null),this._selDiv3&&(c.removeChild(this._selDiv3),this._selDiv3=null)},_setBlockCursor:function(a){this._blockCursorVisible=a;this._updateBlockCursorVisible()},_setOverwriteMode:function(a){this._overwriteMode=a;this._updateBlockCursorVisible()},_updateBlockCursorVisible:function(){if(this._blockCursorVisible||this._overwriteMode){if(!this._cursorDiv){var a=this._viewDiv,b=e.createElement(a.ownerDocument,"div");b.className="textviewBlockCursor";this._cursorDiv=
b;b.tabIndex=-1;b.style.zIndex="2";b.style.color="transparent";b.style.position="absolute";b.style.pointerEvents="none";b.innerHTML="\x26nbsp;";a.appendChild(b);this._updateDOMSelection()}}else this._cursorDiv&&(this._cursorDiv.parentNode.removeChild(this._cursorDiv),this._cursorDiv=null)},_setMarginOffset:function(a,b){this._marginOffset=a;this._marginDiv.style.display=a?"block":"none";b||(this._metrics=this._calculateMetrics(),this._queueUpdate())},_setWrapOffset:function(a,b){this._wrapOffset=
a;b||(this._metrics=this._calculateMetrics(),this._queueUpdate())},_setReadOnly:function(a){this._readonly=a;this._clientDiv.setAttribute("aria-readonly",a?"true":"false")},_setSingleMode:function(a,b){this._singleMode=a;this._updateOverflow();this._updateStyle(b)},_setTabSize:function(a,b){this._tabSize=a;this._customTabSize=void 0;var c=this._clientDiv;e.isOpera?c&&(c.style.OTabSize=this._tabSize+""):537.1<=e.isWebkit?c&&(c.style.tabSize=this._tabSize+""):4<=e.isFirefox?c&&(c.style.MozTabSize=this._tabSize+
""):8!==this._tabSize&&(this._customTabSize=this._tabSize);b||(this.redrawLines(),this._resetLineWidth())},_setTheme:function(a){this._theme&&this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);(this._theme=a)&&this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);this._setThemeClass(this._themeClass)},_setThemeClass:function(a,b){this._themeClass=a;var c="textview",d=this._theme.getThemeClass();d&&(c+=" "+d);this._themeClass&&d!==this._themeClass&&(c+=
" "+this._themeClass);this._rootDiv.className=c;this._updateStyle(b)},_setWrapMode:function(a,b){this._wrapMode=a&&this._wrappable;var c=this._clientDiv;this._wrapMode?(c.style.whiteSpace="pre-wrap",c.style.wordWrap="break-word"):(c.style.whiteSpace="pre",c.style.wordWrap="normal");this._updateOverflow();b||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a,b,c,d){if(this._clientDiv){var e=this._model,f=this._getSelection(),n=this._getScroll(),g=f.getCaret(),m=f.start,
h=f.end,q=e.getLineAtOffset(m),k=e.getLineAtOffset(h),r=Math.max(Math.max(m,e.getLineStart(k)),h-1),e=this._getClientWidth(),l=this._getClientHeight(),s=e/4,x=this._getBoundsAtOffset(g===m?m:r),t=x.left,w=x.right,u=x.top,v=x.bottom,A=0,z="object"===typeof c;if((a||z)&&!f.isEmpty())x=this._getBoundsAtOffset(g===h?m:r),A=(x.bottom>v?x.bottom:v)-(x.top<u?x.top:u),a&&(x.top===u?g===m?w=t+Math.min(x.right-t,e):t=w-Math.min(w-x.left,e):g===m?v=u+Math.min(x.bottom-u,l):u=v-Math.min(v-x.top,l));a=0;t<n.x&&
(a=Math.min(t-n.x,-s));w>n.x+e&&(a=Math.max(w-n.x-e,s));f=0;u<n.y?f=u-n.y:v>n.y+l&&(f=v-n.y-l);d&&(0<d?0<f&&(f=Math.max(f,d)):0>f&&(f=Math.min(f,d)));d=z&&"always"===c.scrollPolicy;if(0!==a||0!==f||d)return z?(d=0<f,0===f&&(f=u-n.y),n=c.viewAnchor||"caret",u=c.selectionAnchor||"caret",c=Math.min(Math.max(0,c.viewAnchorOffset||0)),f="top"===n?f+Math.floor(d?(1-c)*l:-c*l):"bottom"===n?f+Math.floor(d?c*l:-(1-c)*l):"center"===n?f+Math.floor(d?l/2+c*l:l/2-(1-c)*l):f+Math.floor(d?c*l:-c*l),q!==k&&("top"===
u&&g!==m?f+=Math.floor(-A):"bottom"===u&&g!==h?f+=Math.floor(A):"center"===u&&(f+=Math.floor(A/2)))):0!==f&&"number"===typeof c&&(0>c&&(c=0),1<c&&(c=1),f+=Math.floor(0<f?c*l:-c*l)),this._scrollViewAnimated(a,f,b),l!==this._getClientHeight()||e!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0;b&&b();return!1}},_startIME:function(){if(-1===this._imeOffset){var a=this._getSelection();a.isEmpty()||this._modifyContent({text:"",start:a.start,end:a.end},!0);this._imeOffset=a.start}},
_unhookEvents:function(){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);this._modelListener=null;for(var a=0;a<this._handlers.length;a++){var b=this._handlers[a];x(b.target,b.type,b.handler)}this._handlers=null;this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null)},_updateDOMSelection:function(){if(!(0<
this._redrawCount)&&!this._ignoreDOMSelection&&this._clientDiv){var a=this._getSelection(),b=this._model,c=b.getLineAtOffset(a.start),d=b.getLineAtOffset(a.end),e=this._getLineNext();if(e){var f=this._getLinePrevious(),n;c<e.lineIndex?(c=e,n=b.getLineStart(e.lineIndex)):c>f.lineIndex?(c=f,n=b.getLineStart(f.lineIndex)):(c=this._getLineNode(c),n=a.start);d<e.lineIndex?(d=e,b=b.getLineStart(e.lineIndex)):d>f.lineIndex?(d=f,b=b.getLineStart(f.lineIndex)):(d=this._getLineNode(d),b=a.end);this._setDOMSelection(c,
n,d,b,a.caret)}}},_update:function(a){if(!(0<this._redrawCount)){this._updateTimer&&(this._getWindow().clearTimeout(this._updateTimer),this._updateTimer=null,a=!1);var b=this._clientDiv,c=this._viewDiv;if(b){this._metrics.invalid&&(this._ignoreQueueUpdate=!0,this._updateStyle(),this._ignoreQueueUpdate=!1);var d=this._model,f=this._getScroll(!1),n=this._getViewPadding(),g=d.getLineCount(),m=this._getLineHeight(),h=!1,q=!1,k=!1,r=this._metrics.scrollWidth;this._wrapMode&&(b.style.width=(this._metrics.wrapWidth||
this._getClientWidth())+"px");var l,s,x,t,w=0,u=0,A;if(this._lineHeight){for(;u<g;){A=this._getLineHeight(u);if(w+A>f.y)break;w+=A;u++}l=u;s=Math.max(0,l-1);x=d=f.y-w;0<l&&(d+=this._getLineHeight(l-1))}else t=Math.max(0,f.y)/m,l=Math.floor(t),s=Math.max(0,l-1),d=Math.round((t-s)*m),x=Math.round((t-l)*m);this._topIndexY=x;t=this._rootDiv;var z=t.clientWidth,O=t.clientHeight;if(a){m=0;this._leftDiv&&(l=this._leftDiv.getBoundingClientRect(),m=l.right-l.left);l=this._getClientWidth();t=this._getClientHeight();
q=l;for(this._wrapMode?this._metrics.wrapWidth&&(q=this._metrics.wrapWidth):q=Math.max(this._maxLineWidth,q);u<g;)A=this._getLineHeight(u,!1),w+=A,u++;g=w}else{t=this._getClientHeight();x=Math.min(l+Math.floor((t+x)/m),g-1);var f=Math.min(x+1,g-1),H;for(A=b.firstChild;A;){H=A.lineIndex;var I=A.nextSibling;if(!(s<=H&&H<=f)||A.lineRemoved||-1===A.lineIndex)this._mouseWheelLine===A?(A.style.display="none",A.lineIndex=-1):b.removeChild(A);A=I}A=this._getLineNext();var I=c.ownerDocument,J=I.createDocumentFragment();
for(H=s;H<=f;H++)!A||A.lineIndex>H?(new v(this,H)).create(J,null):(J.firstChild&&(b.insertBefore(J,A),J=I.createDocumentFragment()),A&&A.lineChanged&&(A=(new v(this,H)).create(J,A),A.lineChanged=!1),A=this._getLineNext(A));J.firstChild&&b.insertBefore(J,A);e.isWebkit&&!this._wrapMode&&(b.style.width="0x7fffffffpx");A=this._getLineNext();H=t+d;for(J=!1;A;)s=A.lineWidth,void 0===s&&(I=A._line.getBoundingClientRect(),s=A.lineWidth=Math.ceil(I.right-I.left),I=I.bottom-I.top,this._lineHeight?this._lineHeight[A.lineIndex]=
I:0!==m&&0!==I&&Math.ceil(m)!==Math.ceil(I)&&(this._variableLineHeight=!0,this._lineHeight=[],this._lineHeight[A.lineIndex]=I)),this._lineHeight&&!J&&(H-=this._lineHeight[A.lineIndex],0>H&&(x=A.lineIndex,J=!0)),this._wrapMode||(s>=this._maxLineWidth&&(this._maxLineWidth=s,this._maxLineIndex=A.lineIndex),this._checkMaxLineIndex===A.lineIndex&&(this._checkMaxLineIndex=-1)),A.lineIndex===l&&(this._topChild=A),A.lineIndex===x&&(this._bottomChild=A),A=this._getLineNext(A);for(-1!==this._checkMaxLineIndex&&
(H=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,0<=H&&H<g&&(m=new v(this,H),I=m.getBoundingClientRect(),s=I.right-I.left,s>=this._maxLineWidth&&(this._maxLineWidth=s,this._maxLineIndex=H),m.destroy()));u<g;)A=this._getLineHeight(u,u<=x),w+=A,u++;g=w;this._updateRuler(this._leftDiv,l,f,O);this._updateRuler(this._rightDiv,l,f,O);this._updateRuler(this._marginDiv,l,f,O);m=0;this._leftDiv&&(l=this._leftDiv.getBoundingClientRect(),m=l.right-l.left);f=0;this._rightDiv&&(f=this._rightDiv.getBoundingClientRect(),
f=f.right-f.left);c.style.left=m+"px";c.style.right=f+"px";f=this._scrollDiv;f.style.height=g+"px";l=this._getClientWidth();!this._singleMode&&!this._wrapMode&&(w=h=t,(u="scroll"===c.style.overflowX)?h+=r:w-=r,A=x=l,(s="scroll"===c.style.overflowY)?x+=r:A-=r,t=h,l=x,g>t&&(k=!0,l=A),this._maxLineWidth>l&&(q=!0,t=w,g>t&&(k=!0,l=A)),u!==q&&(c.style.overflowX=q?"scroll":"hidden"),s!==k&&(c.style.overflowY=k?"scroll":"hidden"),h=u!==q||s!==k);k=l;this._wrapMode?this._metrics.wrapWidth&&(k=this._metrics.wrapWidth):
k=Math.max(this._maxLineWidth,k);q=k;if((!e.isIE||9<=e.isIE)&&this._maxLineWidth>l)k+=n.right+n.left;f.style.width=k+"px";this._clipScrollDiv&&(this._clipScrollDiv.style.width=k+"px");f=this._getScroll(!1)}this._vScrollDiv&&(k=t-8,w=Math.max(15,Math.ceil(Math.min(1,k/(g+n.top+n.bottom))*k)),this._vScrollDiv.style.left=m+l-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,f.y*k/g))+"px",this._vScrollDiv.style.height=w+"px");!this._wrapMode&&this._hScrollDiv&&(k=l-8,w=Math.max(15,Math.ceil(Math.min(1,
k/(this._maxLineWidth+n.left+n.right))*k)),this._hScrollDiv.style.left=m+Math.floor(Math.max(0,Math.floor(f.x*k/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=t-9+"px",this._hScrollDiv.style.width=w+"px");u=f.x;w=this._clipDiv;k=this._overlayDiv;if(x=this._marginDiv)x.style.left=-u+m+this._metrics.marginWidth+n.left+"px",x.style.bottom=("scroll"===c.style.overflowX?r:0)+"px";w?(w.scrollLeft=u,w.scrollTop=0,c=m+n.left,r=n.top,a=l,m=t,u=0,x=-d,0===f.x&&(c-=n.left,a+=n.left,u=n.left),f.x+l===
q&&(a+=n.right),0===f.y&&(r-=n.top,m+=n.top,x+=n.top),f.y+t===g&&(m+=n.bottom),w.style.left=c+"px",w.style.top=r+"px",w.style.right=z-a-c+"px",w.style.bottom=O-m-r+"px",b.style.left=u+"px",b.style.top=x+"px",b.style.width=q+"px",b.style.height=t+d+"px",k&&(k.style.left=b.style.left,k.style.top=b.style.top,k.style.width=b.style.width,k.style.height=b.style.height)):(c=u,r=d,z=u+l,O=d+t,0===c&&(c-=n.left),0===r&&(r-=n.top),z===q&&(z+=n.right),f.y+t===g&&(O+=n.bottom),b.style.clip="rect("+r+"px,"+z+
"px,"+O+"px,"+c+"px)",b.style.left=-u+m+n.left+"px",b.style.width=(this._wrapMode||e.isWebkit?q:l+u)+"px",a||(b.style.top=-d+n.top+"px",b.style.height=t+d+"px"),k&&(k.style.clip=b.style.clip,k.style.left=b.style.left,k.style.width=b.style.width,a||(k.style.top=b.style.top,k.style.height=b.style.height)));this._updateDOMSelection();h&&(b=this._ensureCaretVisible,this._ensureCaretVisible=!1,b&&this._showCaret(),this._queueUpdate())}}},_updateOverflow:function(){var a=this._viewDiv;this._wrapMode?(a.style.overflowX=
"hidden",a.style.overflowY="scroll"):a.style.overflow="hidden"},_updateRuler:function(a,b,d,f){if(a){var n=this._parent.ownerDocument,g=this._getLineHeight(),m=this._getViewPadding();for(a=a.firstChild;a;){var h=a._ruler,q=g,k=h.getOverview();"page"===k&&(q+=this._topIndexY);a.style.top=-q+"px";a.style.height=f+q+"px";a.rulerChanged&&c(h.getRulerStyle(),a);var r,l=a.firstChild;l?(r=l,l=l.nextSibling):(r=e.createElement(n,"div"),r.style.visibility="hidden",a.appendChild(r));var s;if(a.rulerChanged&&
r){q=-1;if(s=h.getWidestAnnotation())c(s.style,r),s.html&&(r.innerHTML=s.html);r.lineIndex=q;r.style.height=g+m.top+"px"}var x;if("page"===k){for(h=h.getAnnotations(b,d+1);l;)q=l.lineIndex,s=l.nextSibling,(!(b<=q&&q<=d)||l.lineChanged)&&a.removeChild(l),l=s;l=a.firstChild.nextSibling;x=n.createDocumentFragment();for(q=b;q<=d;q++)if(!l||l.lineIndex>q){r=e.createElement(n,"div");if(s=h[q])c(s.style,r),s.html&&(r.innerHTML=s.html),r.annotation=s;r.lineIndex=q;r.style.height=this._getLineHeight(q)+"px";
x.appendChild(r)}else x.firstChild&&(a.insertBefore(x,l),x=n.createDocumentFragment()),l&&(l=l.nextSibling);x.firstChild&&a.insertBefore(x,l)}else{s=this._getClientHeight();q=this._model.getLineCount();l=s+m.top+m.bottom-2*this._metrics.scrollWidth;k=g*q<l?g:l/q;if(a.rulerChanged){for(s=a.childNodes.length;1<s;)a.removeChild(a.lastChild),s--;h=h.getAnnotations(0,q);x=n.createDocumentFragment();for(var t in h)q=t>>>0,0>q||(r=e.createElement(n,"div"),s=h[t],c(s.style,r),r.style.position="absolute",
r.style.top=this._metrics.scrollWidth+g+Math.floor(q*k)+"px",s.html&&(r.innerHTML=s.html),r.annotation=s,r.lineIndex=q,x.appendChild(r));a.appendChild(x)}else if(a._oldTrackHeight!==l)for(r=a.firstChild?a.firstChild.nextSibling:null;r;)r.style.top=this._metrics.scrollWidth+g+Math.floor(r.lineIndex*k)+"px",r=r.nextSibling;a._oldTrackHeight=l}a.rulerChanged=!1;a=a.nextSibling}}},_updateStyleSheet:function(){var a="";e.isWebkit&&0<this._metrics.scrollWidth&&(a+="\n.textview ::-webkit-scrollbar-corner {background: #eeeeee;}");
e.isFirefox&&e.isMac&&this._highlightRGB&&"Highlight"!==this._highlightRGB&&(a+="\n.textview ::-moz-selection {background: "+this._highlightRGB+";}");if(a){var b=this._clientDiv.ownerDocument,c=b.getElementById("_textviewStyle");if(c)c.removeChild(c.firstChild),c.appendChild(b.createTextNode(a));else{c=e.createElement(b,"style");c.id="_textviewStyle";var d=b.getElementsByTagName("head")[0]||b.documentElement;c.appendChild(b.createTextNode(a));d.insertBefore(c,d.firstChild)}}},_updateStyle:function(a){!a&&
e.isIE&&(this._rootDiv.style.lineHeight="normal");var b=this._metrics=this._calculateMetrics();this._variableLineHeight&&(this._variableLineHeight=!1,this._resetLineHeight());this._rootDiv.style.lineHeight=e.isIE?b.lineHeight-(b.lineTrim.top+b.lineTrim.bottom)+"px":"normal";this._updateStyleSheet();a||(this.redraw(),this._resetLineWidth())}};f.EventTarget.addMixin(u.prototype);return{TextView:u}});
define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(k,l){function h(f){this._model=f;this._projections=[];var d=this;this._listener={onChanged:function(f){d._onChanged(f)},onChanging:function(f){d._onChanging(f)}};f.addEventListener("postChanged",this._listener.onChanged);f.addEventListener("preChanging",this._listener.onChanging)}h.prototype={destroy:function(){this._model&&(this._model.removeEventListener("postChanged",this._listener.onChanged),
this._model.removeEventListener("preChanging",this._listener.onChanging),this._model=null)},addProjection:function(f){if(f){var d=this._model,g=this._projections;f._lineIndex=d.getLineAtOffset(f.start);f._lineCount=d.getLineAtOffset(f.end)-f._lineIndex;var e=f.text;e||(e="");f._model="string"===typeof e?new k.TextModel(e,d.getLineDelimiter()):e;var d=this.mapOffset(f.start,!0),e=f.end-f.start,c=f._lineCount,b=f._model.getCharCount(),m=f._model.getLineCount()-1,a={type:"Changing",text:f._model.getText(),
start:d,removedCharCount:e,addedCharCount:b,removedLineCount:c,addedLineCount:m};this.onChanging(a);a=this._binarySearch(g,f.start);g.splice(a,0,f);this.onChanged({type:"Changed",start:d,removedCharCount:e,addedCharCount:b,removedLineCount:c,addedLineCount:m})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(f,d){var g=this._projections,e=0,c,b;if(d){for(c=0;c<g.length;c++){b=g[c];if(b.start>f)break;if(b.end>f)return-1;e+=
b._model.getCharCount()-(b.end-b.start)}return f+e}for(c=0;c<g.length;c++){b=g[c];if(b.start>f-e)break;var m=b._model.getCharCount();if(b.start+m>f-e)return-1;e+=m-(b.end-b.start)}return f-e},removeProjection:function(f){var d,g=0;for(d=0;d<this._projections.length;d++){var e=this._projections[d];if(e===f){f=e;break}g+=e._model.getCharCount()-(e.end-e.start)}if(d<this._projections.length){var e=this._model,g=f.start+g,c=f.end-f.start,b=f._lineCount,m=f._model.getCharCount(),a=f._model.getLineCount()-
1;f={type:"Changing",text:e.getText(f.start,f.end),start:g,removedCharCount:m,addedCharCount:c,removedLineCount:a,addedLineCount:b};this.onChanging(f);this._projections.splice(d,1);this.onChanged({type:"Changed",start:g,removedCharCount:m,addedCharCount:c,removedLineCount:a,addedLineCount:b})}},_binarySearch:function(f,d){for(var g=f.length,e=-1,c;1<g-e;)c=Math.floor((g+e)/2),d<=f[c].start?g=c:e=c;return g},getCharCount:function(){for(var f=this._model.getCharCount(),d=this._projections,g=0;g<d.length;g++)var e=
d[g],f=f+(e._model.getCharCount()-(e.end-e.start));return f},getLine:function(f,d){if(0>f)return null;var g=this._model,e=this._projections,c=0,b=[],m=0,a,n,h;for(a=0;a<e.length;a++){h=e[a];if(h._lineIndex>=f-c)break;n=h._model.getLineCount()-1;if(h._lineIndex+n>=f-c){m=f-(h._lineIndex+c);if(m<n)return h._model.getLine(m,d);b.push(h._model.getLine(n))}m=h.end;c+=n-h._lineCount}for(m=Math.max(m,g.getLineStart(f-c));a<e.length;a++){h=e[a];if(h._lineIndex>f-c)break;b.push(g.getText(m,h.start));n=h._model.getLineCount()-
1;if(h._lineIndex+n>f-c)return b.push(h._model.getLine(0,d)),b.join("");b.push(h._model.getText());m=h.end;c+=n-h._lineCount}e=g.getLineEnd(f-c,d);m<e&&b.push(g.getText(m,e));return b.join("")},getLineAtOffset:function(f){for(var d=this._model,g=this._projections,e=0,c=0,b=0;b<g.length;b++){var m=g[b];if(m.start>f-e)break;var a=m._model.getCharCount();if(m.start+a>f-e){g=f-(m.start+e);c+=m._model.getLineAtOffset(g);e+=g;break}c+=m._model.getLineCount()-1-m._lineCount;e+=a-(m.end-m.start)}return d.getLineAtOffset(f-
e)+c},getLineCount:function(){for(var f=this._projections,d=this._model.getLineCount(),g=0;g<f.length;g++)var e=f[g],d=d+(e._model.getLineCount()-1-e._lineCount);return d},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(f,d){if(0>f)return-1;for(var g=this._model,e=this._projections,c=0,b=0,m=0;m<e.length;m++){var a=e[m];if(a._lineIndex>f-c)break;var n=a._model.getLineCount()-1;if(a._lineIndex+n>f-c)return a._model.getLineEnd(f-(a._lineIndex+c),d)+a.start+b;b+=
a._model.getCharCount()-(a.end-a.start);c+=n-a._lineCount}return g.getLineEnd(f-c,d)+b},getLineStart:function(f){if(0>f)return-1;for(var d=this._model,g=this._projections,e=0,c=0,b=0;b<g.length;b++){var m=g[b];if(m._lineIndex>=f-e)break;var a=m._model.getLineCount()-1;if(m._lineIndex+a>=f-e)return m._model.getLineStart(f-(m._lineIndex+e))+m.start+c;c+=m._model.getCharCount()-(m.end-m.start);e+=a-m._lineCount}return d.getLineStart(f-e)+c},getText:function(f,d){void 0===f&&(f=0);var g=this._model,e=
this._projections,c=0,b=[],m,a,n;for(m=0;m<e.length;m++){a=e[m];if(a.start>f-c)break;n=a._model.getCharCount();if(a.start+n>f-c){if(void 0!==d&&a.start+n>d-c)return a._model.getText(f-(a.start+c),d-(a.start+c));b.push(a._model.getText(f-(a.start+c)));f=a.end+c+n-(a.end-a.start)}c+=n-(a.end-a.start)}var h=f-c;if(void 0!==d){for(;m<e.length;m++){a=e[m];if(a.start>d-c)break;b.push(g.getText(h,a.start));n=a._model.getCharCount();if(a.start+n>d-c)return b.push(a._model.getText(0,d-(a.start+c))),b.join("");
b.push(a._model.getText());h=a.end;c+=n-(a.end-a.start)}b.push(g.getText(h,d-c))}else{for(;m<e.length;m++)a=e[m],b.push(g.getText(h,a.start)),b.push(a._model.getText()),h=a.end;b.push(g.getText(h))}return b.join("")},_onChanged:function(f){f=this._change;var d=f.baseStart,g=f.baseEnd,e,c,b=this._projections;for(e=0;e<b.length&&!(c=b[e],c.end>d);e++);var m=e;for(e=0;e<b.length&&!(c=b[e],c.start>=g);e++);var a=e,n=this._model,d=f.baseText.length-(g-d);for(e=a;e<b.length;e++)c=b[e],c.start+=d,c.end+=
d,c._lineIndex=n.getLineAtOffset(c.start);c=b.splice(m,a-m);for(e=0;e<c.length;e++)c[e].annotation&&c[e].annotation._expand();this.onChanged({type:"Changed",start:f.start,removedCharCount:f.removedCharCount,addedCharCount:f.addedCharCount,removedLineCount:f.removedLineCount,addedLineCount:f.addedLineCount});this._change=void 0},_onChanging:function(f){var d=!!this._change,g=this._change||{},e=f.start,c=e+f.removedCharCount;g.baseStart=e;g.baseEnd=c;g.baseText=f.text;g.addedLineCount=f.addedLineCount;
if(!d){this._change=g;g.text=f.text;var b=this._projections,m,a,n;f=function(c){for(m=a=0;a<b.length;a++){n=b[a];if(n.start>c)break;if(n.end>c)return-1;m+=n._model.getCharCount()-(n.end-n.start)}return c+m};g.start=f(e);-1===g.start&&(g.text=this._model.getText(n.start,e)+g.text,g.addedLineCount+=this._model.getLineAtOffset(e)-this._model.getLineAtOffset(n.start),g.start=n.start+m);g.end=f(c);-1===g.end&&(g.text+=this._model.getText(c,n.end),g.addedLineCount+=this._model.getLineAtOffset(n.end)-this._model.getLineAtOffset(c),
g.end=n.start+m)}g.addedCharCount=g.text.length;g.removedCharCount=g.end-g.start;g.removedLineCount=this.getLineAtOffset(g.end)-this.getLineAtOffset(g.start);this.onChanging({type:"Changing",text:g.text,start:g.start,removedCharCount:g.removedCharCount,addedCharCount:g.addedCharCount,removedLineCount:g.removedLineCount,addedLineCount:g.addedLineCount})},onChanging:function(f){return this.dispatchEvent(f)},onChanged:function(f){return this.dispatchEvent(f)},setLineDelimiter:function(f){this._model.setLineDelimiter(f)},
setText:function(f,d,g){function e(d){for(b=m=0;m<c.length;m++){a=c[m];if(a.start>d-b)break;var e=a._model.getCharCount();if(a.start+e>d-b)return-1;b+=e-(a.end-a.start)}return d-b}this._change={text:f||"",start:d||0,end:void 0===g?this.getCharCount():g};var c=this._projections,b,m,a,n,h;f=e(this._change.start);-1===f&&(n={projection:a,start:this._change.start-(a.start+b)},f=a.end);d=e(this._change.end);-1===d&&(h={projection:a,end:this._change.end-(a.start+b)},d=a.start);n&&h&&n.projection===h.projection?
a._model.setText(this._change.text,n.start,h.end):(this._model.setText(this._change.text,f,d),n&&(a=n.projection,a._model.setText("",n.start)),h&&(a=h.projection,a._model.setText("",0,h.end),a.start=a.end,a._lineCount=0));this._change=void 0}};l.EventTarget.addMixin(h.prototype);return{ProjectionTextModel:h}});
define("orion/editor/tooltip","i18n!orion/editor/nls/messages orion/editor/textView orion/editor/textModel orion/editor/projectionTextModel orion/editor/util orion/util".split(" "),function(k,l,h,f,d,g){function e(c){this._view=c;this._fadeDelay=500;this._hideDelay=200;this._showDelay=500;this._autoHideDelay=5E3;this._create(c.getOptions("parent").ownerDocument)}e.getTooltip=function(c){c._tooltip||(c._tooltip=new e(c));return c._tooltip};e.prototype={_create:function(c){if(!this._tooltipDiv){var b=
this._tooltipDiv=g.createElement(c,"div");b.tabIndex=0;b.className="textviewTooltip";b.setAttribute("aria-live","assertive");b.setAttribute("aria-atomic","true");var e=this._tooltipContents=g.createElement(c,"div");b.appendChild(e);c.body.appendChild(b);var a=this;d.addEventListener(b,"mouseover",function(b){a._hideDelay&&(b=a._getWindow(),a._delayedHideTimeout&&(b.clearTimeout(a._delayedHideTimeout),a._delayedHideTimeout=null),a._hideTimeout&&(b.clearTimeout(a._hideTimeout),a._hideTimeout=null),
a._nextTarget=null)},!1);d.addEventListener(b,"mouseout",function(c){c=c.relatedTarget||c.toElement;!(c===b||a._hasFocus())&&(!c||!d.contains(b,c))&&a._hide()},!1);d.addEventListener(b,"keydown",function(b){27===b.keyCode&&a._hide()},!1);d.addEventListener(c,"mousedown",this._mouseDownHandler=function(c){a.isVisible()&&(d.contains(b,c.target||c.srcElement)||a._hide())},!0);this._view.addEventListener("Destroy",function(){a.destroy()});this._hide()}},_getWindow:function(){var c=this._tooltipDiv.ownerDocument;
return c.defaultView||c.parentWindow},destroy:function(){if(this._tooltipDiv){this._hide();var c=this._tooltipDiv.parentNode;c&&c.removeChild(this._tooltipDiv);d.removeEventListener(this._tooltipDiv.ownerDocument,"mousedown",this._mouseDownHandler,!0);this._tooltipDiv=null}},_hasFocus:function(){var c=this._tooltipDiv;return!c?!1:d.contains(c,c.ownerDocument.activeElement)},hide:function(c){void 0===c&&(c=this._hideDelay);var b=this._getWindow();this._delayedHideTimeout&&(b.clearTimeout(this._delayedHideTimeout),
this._delayedHideTimeout=null);var d=this;c?d._delayedHideTimeout=b.setTimeout(function(){d._delayedHideTimeout=null;d._hide();d.setTarget(d._nextTarget,0)},c):(d._hide(),d.setTarget(d._nextTarget,0))},_hide:function(){var c=this._tooltipDiv;c&&(this._hasFocus()&&this._view.focus(),this._contentsView&&(this._contentsView.destroy(),this._contentsView=null),this._tooltipContents&&(this._tooltipContents.innerHTML=""),c.style.visibility="hidden",c=this._getWindow(),this._showTimeout&&(c.clearTimeout(this._showTimeout),
this._showTimeout=null),this._delayedHideTimeout&&(c.clearTimeout(this._delayedHideTimeout),this._delayedHideTimeout=null),this._hideTimeout&&(c.clearTimeout(this._hideTimeout),this._hideTimeout=null),this._fadeTimeout&&(c.clearInterval(this._fadeTimeout),this._fadeTimeout=null))},isVisible:function(){return this._tooltipDiv&&"visible"===this._tooltipDiv.style.visibility},setTarget:function(c,b,d){if(this.isVisible())this._hasFocus()||(this._nextTarget=c,this.hide(d));else if(this._target=c){var a=
this;c=a._getWindow();a._showTimeout&&(c.clearTimeout(a._showTimeout),a._showTimeout=null);0===b?a.show(!0):a._showTimeout=c.setTimeout(function(){a._showTimeout=null;a.show(!0)},b?b:a._showDelay)}},show:function(c){if(this._target){var b=this._target.getTooltipInfo();if(b){var d=this._tooltipDiv,a=this._tooltipContents;d.style.left=d.style.right=d.style.width=d.style.height=a.style.width=a.style.height="auto";var e=b.contents;e instanceof Array&&(e=this._getAnnotationContents(e));if("string"===typeof e)a.innerHTML=
e;else if(this._isNode(e))a.appendChild(e);else if(e instanceof f.ProjectionTextModel){var g=this._view,h=g.getOptions();h.wrapMode=!1;h.parent=a;var k=h.themeClass;k?((k=k.replace("tooltipTheme",""))&&(k=" "+k),k="tooltipTheme"+k):k="tooltipTheme";h.themeClass=k;h=this._contentsView=new l.TextView(h);h.addEventListener("LineStyle",function(a){g.onLineStyle(a)});h.setModel(e);e=h.computeSize();a.style.width=e.width+"px";a.style.height=e.height+"px";h.resize()}else return;a=d.ownerDocument.documentElement;
"right"===b.anchor?(e=a.clientWidth-b.x,d.style.right=e+"px"):(e=parseInt(this._getNodeStyle(d,"padding-left","0"),10),e+=parseInt(this._getNodeStyle(d,"border-left-width","0"),10),e=b.x-e,d.style.left=e+"px");d.style.maxWidth=a.clientWidth-e-10+"px";e=parseInt(this._getNodeStyle(d,"padding-top","0"),10);e+=parseInt(this._getNodeStyle(d,"border-top-width","0"),10);e=b.y-e;d.style.top=e+"px";d.style.maxHeight=a.clientHeight-e-10+"px";d.style.opacity="1";d.style.visibility="visible";if(c){var t=this,
w=this._getWindow();t._hideTimeout=w.setTimeout(function(){t._hideTimeout=null;var a=parseFloat(t._getNodeStyle(d,"opacity","1"));t._fadeTimeout=w.setInterval(function(){"visible"===d.style.visibility&&0<a?(a-=0.1,d.style.opacity=a):t._hide()},t._fadeDelay/10)},t._autoHideDelay)}}}},_getAnnotationContents:function(c){function b(a,b){var c=v.getLineStart(v.getLineAtOffset(a)),d=v.getLineEnd(v.getLineAtOffset(b),!0);return v.getText(c,d)}function e(a){var c=a.title,f=g.createElement(l,"div");f.className=
"tooltipRow";a.html&&(f.innerHTML=a.html,f.lastChild&&d.addEventListener(f.lastChild,"click",function(b){b=a.start;var c=a.end;w.getBaseModel&&(b=w.mapOffset(b,!0),c=w.mapOffset(c,!0));t.setSelection(b,c,1/3,function(){r._hide()})},!1),f.appendChild(l.createTextNode("\u00a0")));c||(c=b(a.start,a.end));"function"===typeof c&&(c=a.title());if("string"===typeof c){var n=g.createElement(l,"span");n.appendChild(l.createTextNode(c));c=n}f.appendChild(c);return f}for(var a,n=[],h=0;h<c.length;h++)a=c[h],
""!==a.title&&!a.groupAnnotation&&n.push(a);c=n;if(0===c.length)return null;var r=this,l=this._tooltipDiv.ownerDocument,t=this._view,w=t.getModel(),v=w.getBaseModel?w.getBaseModel():w;if(1===c.length){a=c[0];if(void 0!==a.title)return a=e(a),a.firstChild&&((c=a.firstChild.className)&&(c+=" "),a.firstChild.className=c+"single"),a;c=new f.ProjectionTextModel(v);n=v.getLineStart(v.getLineAtOffset(a.start));h=v.getCharCount();a.end!==h&&c.addProjection({start:a.end,end:h});0<n&&c.addProjection({start:0,
end:n});return c}n=g.createElement(l,"div");a=g.createElement(l,"em");a.appendChild(l.createTextNode(k.multipleAnnotations));n.appendChild(a);for(h=0;h<c.length;h++)a=c[h],(a=e(a))&&n.appendChild(a);return n},_getNodeStyle:function(c,b,d){var a;if(c&&(a=c.style[b],!a))if(c.currentStyle){for(a=0;-1!==(a=b.indexOf("-",a));)b=b.substring(0,a)+b.substring(a+1,a+2).toUpperCase()+b.substring(a+2);a=c.currentStyle[b]}else a=(c=c.ownerDocument.defaultView.getComputedStyle(c,null))?c.getPropertyValue(b):null;
return a||d},_isNode:function(c){return"object"===typeof Node?c instanceof Node:c&&"object"===typeof c&&"number"===typeof c.nodeType&&"string"===typeof c.nodeName}};return{Tooltip:e}});
define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(k,l){function h(){}function f(a,b,c){this.start=a;this.end=b;this._projectionModel=c;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function d(a,b){var c=a.lastIndexOf("."),c=a.substring(c+1),d={title:k[c],style:{styleClass:"annotation "+c},html:"\x3cdiv class\x3d'annotationHTML "+c+"'\x3e\x3c/div\x3e",overviewStyle:{styleClass:"annotationOverview "+c}};b?d.lineStyle=
{styleClass:"annotationLine "+c}:d.rangeStyle={styleClass:"annotationRange "+c};h.registerType(a,d)}function g(){}function e(a,b){for(var c=a.length,d=-1,e;1<c-d;)e=Math.floor((c+d)/2),b<=a[e].start?c=e:d=e;return c}function c(a){this._annotations=[];var b=this;this._listener={onChanged:function(a){b._onChanged(a)}};this.setTextModel(a)}function b(a,b){this._view=a;this._annotationModel=b;var c=this;this._listener={onDestroy:function(a){c._onDestroy(a)},onLineStyle:function(a){c._onLineStyle(a)},
onChanged:function(a){c._onAnnotationModelChanged(a)}};a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("postLineStyle",this._listener.onLineStyle);b.addEventListener("Changed",this._listener.onChanged)}f.prototype={_expandedHTML:"\x3cdiv class\x3d'annotationHTML expanded'\x3e\x3c/div\x3e",_expandedStyle:{styleClass:"annotation expanded"},_collapsedHTML:"\x3cdiv class\x3d'annotationHTML collapsed'\x3e\x3c/div\x3e",_collapsedStyle:{styleClass:"annotation collapsed"},_collapse:function(){if(!this.expanded)return!1;
this.expanded=!1;this.html=this._collapsedHTML;this.style=this._collapsedStyle;this._annotationModel&&this._annotationModel.modifyAnnotation(this);return!0},_expand:function(){if(this.expanded)return!1;this.expanded=!0;this.html=this._expandedHTML;this.style=this._expandedStyle;this._annotationModel&&this._annotationModel.modifyAnnotation(this);return!0},_collapseImpl:function(a){if(this._collapse()){a&&this._forEachOverlaping(function(a){a.expanded||(a._expandImpl(!1),a._recollapse=!0)});a=this._projectionModel;
var b=a.getBaseModel();this._projection={annotation:this,start:b.getLineStart(b.getLineAtOffset(this.start)+1),end:b.getLineEnd(b.getLineAtOffset(this.end),!0)};a.addProjection(this._projection)}},_expandImpl:function(a){this._expand()&&(this._projectionModel.removeProjection(this._projection),a&&this._forEachOverlaping(function(a){a._recollapse&&(a._collapseImpl(!1),a._recollapse=!1)}))},_forEachOverlaping:function(a){if(this._annotationModel)for(var b=this._annotationModel.getAnnotations(this.start,
this.end);b.hasNext();){var c=b.next();c!==this&&c.type===h.ANNOTATION_FOLDING&&a.call(this,c)}},collapse:function(){this._recollapse=!1;this._collapseImpl(!0)},expand:function(){this._recollapse=!1;this._expandImpl(!0)}};h.ANNOTATION_ERROR="orion.annotation.error";h.ANNOTATION_WARNING="orion.annotation.warning";h.ANNOTATION_TASK="orion.annotation.task";h.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint";h.ANNOTATION_BOOKMARK="orion.annotation.bookmark";h.ANNOTATION_FOLDING="orion.annotation.folding";
h.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket";h.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket";h.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine";h.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch";h.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch";h.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence";h.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence";h.ANNOTATION_SELECTED_LINKED_GROUP="orion.annotation.selectedLinkedGroup";
h.ANNOTATION_CURRENT_LINKED_GROUP="orion.annotation.currentLinkedGroup";h.ANNOTATION_LINKED_GROUP="orion.annotation.linkedGroup";h.ANNOTATION_BLAME="orion.annotation.blame";h.ANNOTATION_CURRENT_BLAME="orion.annotation.currentBlame";var m={};h.registerType=function(a,b){var c=b;"function"!==typeof c&&(c=function(a,b,c){this.start=a;this.end=b;void 0!==c&&(this.title=c)},c.prototype=b);c.prototype.type=a;m[a]=c;return a};h.createAnnotation=function(a,b,c,d){return new (this.getType(a))(b,c,d)};h.getType=
function(a){return m[a]};d(h.ANNOTATION_ERROR);d(h.ANNOTATION_WARNING);d(h.ANNOTATION_TASK);d(h.ANNOTATION_BREAKPOINT);d(h.ANNOTATION_BOOKMARK);d(h.ANNOTATION_CURRENT_BRACKET);d(h.ANNOTATION_MATCHING_BRACKET);d(h.ANNOTATION_CURRENT_SEARCH);d(h.ANNOTATION_MATCHING_SEARCH);d(h.ANNOTATION_READ_OCCURRENCE);d(h.ANNOTATION_WRITE_OCCURRENCE);d(h.ANNOTATION_SELECTED_LINKED_GROUP);d(h.ANNOTATION_CURRENT_LINKED_GROUP);d(h.ANNOTATION_LINKED_GROUP);d(h.ANNOTATION_CURRENT_LINE,!0);d(h.ANNOTATION_BLAME,!0);d(h.ANNOTATION_CURRENT_BLAME,
!0);h.registerType(h.ANNOTATION_FOLDING,f);g.addMixin=function(a){var b=g.prototype,c;for(c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};g.prototype={addAnnotationType:function(a,b){this._annotationTypes||(this._annotationTypes=[]);var c=b-1;void 0==b||!(0<=c&&c<this._annotationTypes.length)?this._annotationTypes.push(a):this._annotationTypes.splice(c,0,a)},getAnnotationTypePriority:function(a){if(this._annotationTypes)for(var b=0;b<this._annotationTypes.length;b++)if(this._annotationTypes[b]===a)return b+
1;return 0},getAnnotationsByType:function(a,b,c){a=a.getAnnotations(b,c);for(c=[];a.hasNext();)b=a.next(),0!==this.getAnnotationTypePriority(b.type)&&c.push(b);var d=this;c.sort(function(a,b){return d.getAnnotationTypePriority(a.type)-d.getAnnotationTypePriority(b.type)});return c},isAnnotationTypeVisible:function(a){return 0!==this.getAnnotationTypePriority(a)},removeAnnotationType:function(a){if(this._annotationTypes)for(var b=0;b<this._annotationTypes.length;b++)if(this._annotationTypes[b]===a){this._annotationTypes.splice(b,
1);break}}};c.prototype={addAnnotation:function(a){if(a){var b=this._annotations,c=e(b,a.start);b.splice(c,0,a);a._annotationModel=this;this.onChanged({type:"Changed",added:[a],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(a,b){var c=this._annotations,d,e=0,f;f=void 0===a&&void 0===b?function(){return e<c.length?c[e++]:null}:function(){for(;e<c.length;){var d=c[e++];if(a===d.start||(a>d.start?a<d.end:d.start<b))return d;if(d.start>=b)break}return null};
d=f();return{next:function(){var a=d;a&&(d=f());return a},hasNext:function(){return null!==d}}},modifyAnnotation:function(a){if(a&&!(0>this._getAnnotationIndex(a)))this.onChanged({type:"Changed",added:[],removed:[],changed:[a]})},onChanged:function(a){return this.dispatchEvent(a)},removeAnnotations:function(a){var b=this._annotations,c,d;if(a){c=[];for(d=b.length-1;0<=d;d--){var e=b[d];e.type===a&&(b.splice(d,1),c.splice(0,0,e),e._annotationModel=null)}}else c=b;this.onChanged({type:"Changed",removed:c,
added:[],changed:[]})},removeAnnotation:function(a){if(a){var b=this._getAnnotationIndex(a);0>b||(a._annotationModel=null,a={type:"Changed",removed:this._annotations.splice(b,1),added:[],changed:[]},this.onChanged(a))}},replaceAnnotations:function(a,b){var c=this._annotations,d,f,g,m=[];if(a)for(d=a.length-1;0<=d;d--)g=a[d],f=this._getAnnotationIndex(g),0>f||(g._annotationModel=null,c.splice(f,1),m.splice(0,0,g));b||(b=[]);for(d=0;d<b.length;d++)g=b[d],f=e(c,g.start),g._annotationModel=this,c.splice(f,
0,g);this.onChanged({type:"Changed",removed:m,added:b,changed:[]})},setTextModel:function(a){this._model&&this._model.removeEventListener("Changed",this._listener.onChanged);(this._model=a)&&this._model.addEventListener("Changed",this._listener.onChanged)},_getAnnotationIndex:function(a){for(var b=this._annotations,c=e(b,a.start);c<b.length&&b[c].start===a.start;){if(b[c]===a)return c;c++}return-1},_onChanged:function(a){var b=a.start,c=a.addedCharCount,d=a.removedCharCount,e=this._annotations,f=
b+d;if(0<e.length){a={type:"Changed",added:[],removed:[],changed:[],textModelChangedEvent:a};c-=d;for(d=0;d<e.length;d++){var g=e[d];g.start>=f?(g._oldStart=g.start,g._oldEnd=g.end,g.start+=c,g.end+=c,a.changed.push(g)):g.end<=b||(g.start<b&&f<g.end?(g._oldStart=g.start,g._oldEnd=g.end,g.end+=c,a.changed.push(g)):(e.splice(d,1),a.removed.push(g),g._annotationModel=null,g.expand&&g.expand(),d--))}if(0<a.added.length||0<a.removed.length||0<a.changed.length)this.onChanged(a)}}};l.EventTarget.addMixin(c.prototype);
b.prototype={destroy:function(){var a=this._view;a&&(a.removeEventListener("Destroy",this._listener.onDestroy),a.removeEventListener("LineStyle",this._listener.onLineStyle),this.view=null);(a=this._annotationModel)&&a.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(a,b){if(b){a||(a={});a.styleClass=a.styleClass&&b.styleClass&&a.styleClass!==b.styleClass?a.styleClass+(" "+b.styleClass):b.styleClass;var c;b.tagName&&!a.tagName&&(a.tagName=b.tagName);if(b.style)for(c in a.style||
(a.style={}),b.style)a.style[c]||(a.style[c]=b.style[c]);if(b.attributes)for(c in a.attributes||(a.attributes={}),b.attributes)a.attributes[c]||(a.attributes[c]=b.attributes[c])}return a},_mergeStyleRanges:function(a,b){a||(a=[]);for(var c,d=e(a,b.start);d<a.length&&b;d++){var f=a[d];if(b.end<=f.start)break;if(!(b.start>=f.end)){c=this._mergeStyle({},f.style);c=this._mergeStyle(c,b.style);var g=[];g.push(d,1);b.start<f.start&&g.push({start:b.start,end:f.start,style:b.style});b.start>f.start&&g.push({start:f.start,
end:b.start,style:f.style});g.push({start:Math.max(f.start,b.start),end:Math.min(f.end,b.end),style:c});b.end<f.end&&g.push({start:b.end,end:f.end,style:f.style});b=b.end>f.end?{start:f.end,end:b.end,style:b.style}:null;Array.prototype.splice.apply(a,g)}}b&&(c=this._mergeStyle({},b.style),a.splice(d,0,{start:b.start,end:b.end,style:c}));return a},_onAnnotationModelChanged:function(a){function b(a,c){f.getBaseModel&&(a=f.mapOffset(a,!0),c=f.mapOffset(c,!0));-1!==a&&-1!==c&&d.redrawRange(a,c)}function c(a,
d){for(var f=0;f<a.length;f++)if(e.isAnnotationTypeVisible(a[f].type)){var g=a[f];b(g.start,g.end);d&&void 0!==g._oldStart&&g._oldEnd&&b(g._oldStart,g._oldEnd)}}var d=this._view;if(d){var e=this,f=d.getModel();c(a.added);c(a.removed);c(a.changed,!0)}},_onDestroy:function(a){this.destroy()},_onLineStyle:function(a){var b=this._annotationModel,c=a.textView.getModel(),d=b.getTextModel(),e=a.lineStart,f=a.lineStart+a.lineText.length;d!==c&&(e=c.mapOffset(e),f=c.mapOffset(f));for(b=b.getAnnotations(e,
f);b.hasNext();)if(e=b.next(),this.isAnnotationTypeVisible(e.type)){if(e.rangeStyle){var f=e.start,g=e.end;d!==c&&(f=c.mapOffset(f,!0),g=c.mapOffset(g,!0));a.ranges=this._mergeStyleRanges(a.ranges,{start:f,end:g,style:e.rangeStyle})}e.lineStyle&&(a.style=this._mergeStyle({},a.style),a.style=this._mergeStyle(a.style,e.lineStyle))}}};g.addMixin(b.prototype);return{FoldingAnnotation:f,AnnotationType:h,AnnotationTypeList:g,AnnotationModel:c,AnnotationStyler:b}});
define("orion/editor/editor","i18n!orion/editor/nls/messages orion/editor/eventTarget orion/editor/tooltip orion/editor/annotations orion/objects orion/util".split(" "),function(k,l,h,f,d,g){function e(b){b=b||{};this._domNode=b.domNode;this._model=b.model;this._undoStack=b.undoStack;this._statusReporter=b.statusReporter;this._title=null;var a=this;this._listener={onChanged:function(b){a.onChanged(b)}};this._model&&this._model.addEventListener("Changed",this._listener.onChanged);this.checkDirty()}
function c(b){b=b||{};e.call(this,b);this._textViewFactory=b.textViewFactory;this._undoStackFactory=b.undoStackFactory;this._textDNDFactory=b.textDNDFactory;this._annotationFactory=b.annotationFactory;this._foldingRulerFactory=b.foldingRulerFactory;this._lineNumberRulerFactory=b.lineNumberRulerFactory;this._contentAssistFactory=b.contentAssistFactory;this._keyBindingFactory=b.keyBindingFactory;this._contentAssist=this._foldingRuler=this._overviewRuler=this._lineNumberRuler=this._annotationRuler=this._annotationModel=
this._annotationStyler=null}var b=f.AnnotationType;e.prototype={destroy:function(){this.uninstall();this._statusReporter=this._domNode=null;this._model&&this._model.removeEventListener("Changed",this._listener.onChanged)},checkDirty:function(){this.setDirty(this._undoStack&&!this._undoStack.isClean())},focus:function(){},getModel:function(){return this._model},getText:function(b,a){return this.getModel().getText(b,a)},getTitle:function(){return this._title},getUndoStack:function(){return this._undoStack},
install:function(){this.installed=!0},isDirty:function(){return this._dirty},markClean:function(){this.getUndoStack().markClean();this.setDirty(!1)},onDirtyChanged:function(b){return this.dispatchEvent(b)},onInputChanged:function(b){return this.dispatchEvent(b)},onChanged:function(b){this.checkDirty()},reportStatus:function(b,a,c){this._statusReporter&&this._statusReporter(b,a,c)},resize:function(){},setDirty:function(b){this._dirty!==b&&(this._dirty=b,this.onDirtyChanged({type:"DirtyChanged"}))},
_setModelText:function(b){this._model&&this._model.setText(b)},setInput:function(b,a,c,d){this._title=b;d||(a?this.reportStatus(a,"error"):null!==c&&void 0!==c&&"string"===typeof c&&this._setModelText(c),this._undoStack&&this._undoStack.reset());this.checkDirty();this.onInputChanged({type:"InputChanged",title:b,message:a,contents:c,contentsSaved:d})},setText:function(b,a,c){this.getModel().setText(b,a,c)},uninstall:function(){this.installed=!1}};l.EventTarget.addMixin(e.prototype);c.prototype=new e;
d.mixin(c.prototype,{destroy:function(){e.prototype.destroy.call(this);this._textViewFactory=this._undoStackFactory=this._textDNDFactory=this._annotationFactory=this._foldingRulerFactory=this._lineNumberRulerFactory=this._contentAssistFactory=this._keyBindingFactory=null},getAnnotationModel:function(){return this._annotationModel},getAnnotationRuler:function(){return this._annotationRuler},getAnnotationStyler:function(){return this._annotationStyler},getContentAssist:function(){return this._contentAssist},
getFoldingRuler:function(){return this._foldingRuler},getLineNumberRuler:function(){return this._lineNumberRuler},getModel:function(){if(!this._textView)return null;var b=this._textView.getModel();b.getBaseModel&&(b=b.getBaseModel());return b},getOverviewRuler:function(){return this._overviewRuler},getTextView:function(){return this._textView},getKeyModes:function(){return this._textView.getKeyModes()},getSourceCodeActions:function(){return this._sourceCodeActions},getLinkedMode:function(){return this._linkedMode},
getTextActions:function(){return this._textActions},focus:function(){this._textView&&this._textView.focus()},resize:function(){this._textView&&this._textView.resize()},setAnnotationRulerVisible:function(b,a){if(this._annotationRulerVisible!==b||a)if(this._annotationRulerVisible=b,this._annotationRuler){var c=this._textView;b?c.addRuler(this._annotationRuler,0):c.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(b,a){if(this._foldingRulerVisible!==b||a)if(this._foldingRulerVisible=
b,this._foldingRuler){var c=this._textView;c.getModel().getBaseModel&&(b?c.addRuler(this._foldingRuler):c.removeRuler(this._foldingRuler))}},setLineNumberRulerVisible:function(b,a){if(this._lineNumberRulerVisible!==b||a)if(this._lineNumberRulerVisible=b,this._lineNumberRuler){var c=this._textView;b?c.addRuler(this._lineNumberRuler,!this._annotationRulerVisible?0:1):c.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(b,a){if(this._overviewRulerVisible!==b||a)if(this._overviewRulerVisible=
b,this._overviewRuler){var c=this._textView;b?c.addRuler(this._overviewRuler):c.removeRuler(this._overviewRuler)}},mapOffset:function(b,a){var c=this._textView.getModel();c.getBaseModel&&(b=c.mapOffset(b,a));return b},getLineAtOffset:function(b){return this.getModel().getLineAtOffset(this.mapOffset(b))},getLineStart:function(b){return this.getModel().getLineStart(b)},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},getSelection:function(){var b=this._textView,a=b.getSelection(),
b=b.getModel();b.getBaseModel&&(a.start=b.mapOffset(a.start),a.end=b.mapOffset(a.end));return a},_expandOffset:function(c){var a=this._textView.getModel(),d=this._annotationModel;if(d&&a.getBaseModel)for(c=d.getAnnotations(c,c+1);c.hasNext();)a=c.next(),a.type===b.ANNOTATION_FOLDING&&a.expand&&a.expand()},setCaretOffset:function(b,a,c){var d=this._textView,e=d.getModel();e.getBaseModel&&(this._expandOffset(b),b=e.mapOffset(b,!0));d.setCaretOffset(b,a,c)},setText:function(b,a,c){var d=this._textView,
e=d.getModel();e.getBaseModel&&(void 0!==a&&(this._expandOffset(a),a=e.mapOffset(a,!0)),void 0!==c&&(this._expandOffset(c),c=e.mapOffset(c,!0)));d.setText(b,a,c)},setSelection:function(b,a,c,d){var e=this._textView,f=e.getModel();f.getBaseModel&&(this._expandOffset(b),this._expandOffset(a),b=f.mapOffset(b,!0),a=f.mapOffset(a,!0));e.setSelection(b,a,c,d)},moveSelection:function(b,a,c,d){var e=this._textView;this.setSelection(b,a||b,1/3,function(){(void 0===d||d)&&e.focus();c&&c()})},_getTooltipInfo:function(b,
a){var c=this._textView,d=this.getAnnotationModel();if(!d)return null;var e=this._annotationStyler;if(!e)return null;var f=c.getOffsetAtLocation(b,a);if(-1===f)return null;f=this.mapOffset(f);e=e.getAnnotationsByType(d,f,f+1);d=[];for(f=0;f<e.length;f++)e[f].rangeStyle&&d.push(e[f]);if(0===d.length)return null;c=c.convert({x:b,y:a},"document","page");return{contents:d,anchor:"left",x:c.x+10,y:c.y+20}},_highlightCurrentLine:function(c,a){var d=this._annotationModel;if(d){var e=this._textView;if(!e.getOptions("singleMode")){var f=
e.getModel(),g=a?f.getLineAtOffset(a.start):-1,h=f.getLineAtOffset(c.start),e=c.start===c.end,k=!a||a.start===a.end,l=f.getLineStart(h),u=f.getLineEnd(h);f.getBaseModel&&(l=f.mapOffset(l),u=f.mapOffset(u));f=this._currentLineAnnotation;if(!(g===h&&k&&e&&f&&f.start===l&&f.end===u)){var g=f?[f]:null,z;e&&(f=b.createAnnotation(b.ANNOTATION_CURRENT_LINE,l,u),z=[f]);this._currentLineAnnotation=f;d.replaceAnnotations(g,z)}}}},installTextView:function(){this.install()},install:function(){if(!this._textView){this._textView=
this._textViewFactory();this._undoStackFactory&&(this._undoStack=this._undoStackFactory.createUndoStack(this),this.checkDirty());this._textDNDFactory&&(this._textDND=this._textDNDFactory.createTextDND(this,this._undoStack));this._contentAssistFactory&&(this._contentAssist=this._contentAssistFactory.createContentAssistMode(this).getContentAssist());var c=this,a=this._textView,d=this;this._listener={onModelChanged:function(a){d.checkDirty()},onMouseOver:function(a){d._listener.onMouseMove(a)},onMouseMove:function(b){var c=
h.Tooltip.getTooltip(a);c&&!(d._listener.lastMouseX===b.event.clientX&&d._listener.lastMouseY===b.event.clientY)&&(d._listener.lastMouseX=b.event.clientX,d._listener.lastMouseY=b.event.clientY,c.setTarget({x:b.x,y:b.y,getTooltipInfo:function(){return d._getTooltipInfo(this.x,this.y)}}))},onMouseOut:function(b){var c=h.Tooltip.getTooltip(a);c&&!(d._listener.lastMouseX===b.event.clientX&&d._listener.lastMouseY===b.event.clientY)&&(d._listener.lastMouseX=b.event.clientX,d._listener.lastMouseY=b.event.clientY,
c.setTarget(null))},onScroll:function(b){(b=h.Tooltip.getTooltip(a))&&b.setTarget(null,0,0)},onSelection:function(a){d._updateCursorStatus();d._highlightCurrentLine(a.newValue,a.oldValue)}};a.addEventListener("ModelChanged",this._listener.onModelChanged);a.addEventListener("Selection",this._listener.onSelection);a.addEventListener("MouseOver",this._listener.onMouseOver);a.addEventListener("MouseOut",this._listener.onMouseOut);a.addEventListener("MouseMove",this._listener.onMouseMove);a.addEventListener("Scroll",
this._listener.onScroll);if(this._keyBindingFactory){var f;if(f="function"===typeof this._keyBindingFactory?this._keyBindingFactory(this,this.getKeyModes(),this._undoStack,this._contentAssist):this._keyBindingFactory.createKeyBindings(c,this._undoStack,this._contentAssist))this._textActions=f.textActions,this._linkedMode=f.linkedMode,this._sourceCodeActions=f.sourceCodeActions}f=function(a,d){if(void 0!==a&&-1!==a){for(var e=this.getView().getModel(),f=this.getAnnotationModel(),g=c.mapOffset(e.getLineStart(a)),
e=c.mapOffset(e.getLineEnd(a)),n=f.getAnnotations(g,e),h=null;n.hasNext();){var k=n.next();if(k.type===b.ANNOTATION_BOOKMARK){h=k;break}}h?f.removeAnnotation(h):(h=b.createAnnotation(b.ANNOTATION_BOOKMARK,g,e),h.title=void 0,f.addAnnotation(h))}};if(this._annotationFactory){var g=a.getModel();g.getBaseModel&&(g=g.getBaseModel());if(this._annotationModel=this._annotationFactory.createAnnotationModel(g))if(g=this._annotationStyler=this._annotationFactory.createAnnotationStyler(a,this._annotationModel))g.addAnnotationType(b.ANNOTATION_CURRENT_SEARCH),
g.addAnnotationType(b.ANNOTATION_MATCHING_SEARCH),g.addAnnotationType(b.ANNOTATION_ERROR),g.addAnnotationType(b.ANNOTATION_WARNING),g.addAnnotationType(b.ANNOTATION_MATCHING_BRACKET),g.addAnnotationType(b.ANNOTATION_CURRENT_BRACKET),g.addAnnotationType(b.ANNOTATION_CURRENT_LINE),g.addAnnotationType(b.ANNOTATION_READ_OCCURRENCE),g.addAnnotationType(b.ANNOTATION_WRITE_OCCURRENCE),g.addAnnotationType(b.ANNOTATION_SELECTED_LINKED_GROUP),g.addAnnotationType(b.ANNOTATION_CURRENT_LINKED_GROUP),g.addAnnotationType(b.ANNOTATION_LINKED_GROUP),
g.addAnnotationType("orion.annotation.highlightError");var g=this._annotationFactory.createAnnotationRulers(this._annotationModel),k=this._annotationRuler=g.annotationRuler;k&&(k.onDblClick=f,k.setMultiAnnotationOverlay({html:"\x3cdiv class\x3d'annotationHTML overlay'\x3e\x3c/div\x3e"}),k.addAnnotationType(b.ANNOTATION_ERROR),k.addAnnotationType(b.ANNOTATION_WARNING),k.addAnnotationType(b.ANNOTATION_TASK),k.addAnnotationType(b.ANNOTATION_BOOKMARK));this.setAnnotationRulerVisible(this._annotationRulerVisible||
void 0===this._annotationRulerVisible,!0);if(k=this._overviewRuler=g.overviewRuler)k.addAnnotationType(b.ANNOTATION_CURRENT_SEARCH),k.addAnnotationType(b.ANNOTATION_MATCHING_SEARCH),k.addAnnotationType(b.ANNOTATION_READ_OCCURRENCE),k.addAnnotationType(b.ANNOTATION_WRITE_OCCURRENCE),k.addAnnotationType(b.ANNOTATION_CURRENT_BLAME),k.addAnnotationType(b.ANNOTATION_ERROR),k.addAnnotationType(b.ANNOTATION_WARNING),k.addAnnotationType(b.ANNOTATION_TASK),k.addAnnotationType(b.ANNOTATION_BOOKMARK),k.addAnnotationType(b.ANNOTATION_MATCHING_BRACKET),
k.addAnnotationType(b.ANNOTATION_CURRENT_BRACKET),k.addAnnotationType(b.ANNOTATION_CURRENT_LINE);this.setOverviewRulerVisible(this._overviewRulerVisible||void 0===this._overviewRulerVisible,!0)}this._lineNumberRulerFactory&&(this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel),this._lineNumberRuler.addAnnotationType(b.ANNOTATION_CURRENT_BLAME),this._lineNumberRuler.addAnnotationType(b.ANNOTATION_BLAME),this._lineNumberRuler.onDblClick=f,this.setLineNumberRulerVisible(this._lineNumberRulerVisible||
void 0===this._lineNumberRulerVisible,!0));this._foldingRulerFactory&&(this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),this._foldingRuler.addAnnotationType(b.ANNOTATION_FOLDING),this.setFoldingRulerVisible(this._foldingRulerVisible||void 0===this._foldingRulerVisible,!0));this.dispatchEvent({type:"TextViewInstalled",textView:a});e.prototype.install.call(this)}},uninstallTextView:function(){this.uninstall()},uninstall:function(){var b=this._textView;b&&(b.destroy(),
this._textView=this._undoStack=this._textDND=this._contentAssist=this._listener=this._annotationModel=this._annotationStyler=this._annotationRuler=this._overviewRuler=this._lineNumberRuler=this._foldingRuler=this._currentLineAnnotation=this._title=null,this._dirty=!1,this._foldingRulerVisible=this._overviewRulerVisible=this._lineNumberRulerVisible=this._annotationRulerVisible=void 0,this.dispatchEvent({type:"TextViewUninstalled",textView:b}),e.prototype.uninstall.call(this))},_updateCursorStatus:function(){for(var b=
this.getModel(),a=this.getCaretOffset(),c=b.getLineAtOffset(a),b=b.getLineStart(c),a=a-b,b=this.getKeyModes(),d=0;d<b.length;d++){var e=b[d];if(e.isActive()&&e.isStatusActive&&e.isStatusActive())return}this.reportStatus(g.formatMessage(k.lineColumn,c+1,a+1))},showAnnotations:function(c,a,d,e){var f=this._annotationModel;if(f){for(var g=[],h=[],k=f.getTextModel(),l=f.getAnnotations(),u;l.hasNext();)u=l.next(),-1!==a.indexOf(u.type)&&u.creatorID===this&&g.push(u);if(c)for(a=0;a<c.length;a++)if(u=c[a]){if(d)u=
d(u);else{var z;"number"===typeof u.line?(z=k.getLineStart(u.line-1),l=z+u.start-1,z=z+u.end-1):(l=u.start,z=u.end);var x=e(u);if(!x)continue;u=b.createAnnotation(x,l,z,u.description)}u.creatorID=this;h.push(u)}f.replaceAnnotations(g,h)}},showProblems:function(c){this.showAnnotations(c,[b.ANNOTATION_ERROR,b.ANNOTATION_WARNING,b.ANNOTATION_TASK],null,function(a){switch(a.severity){case "error":return b.ANNOTATION_ERROR;case "warning":return b.ANNOTATION_WARNING;case "task":return b.ANNOTATION_TASK}return null})},
showOccurrences:function(c){this.showAnnotations(c,[b.ANNOTATION_READ_OCCURRENCE,b.ANNOTATION_WRITE_OCCURRENCE],null,function(a){return a.readAccess?b.ANNOTATION_READ_OCCURRENCE:b.ANNOTATION_WRITE_OCCURRENCE})},showBlame:function(c){var a=this._blameRGB,e=this.getTextView().getOptions("parent").ownerDocument;if(!a){var h=g.createElement(e,"div");h.className="annotation blame";e.body.appendChild(h);var l=(e.defaultView||e.parentWindow).getComputedStyle(h).getPropertyValue("background-color");h.parentNode.removeChild(h);
var h=l.indexOf("("),s=l.indexOf(")"),l=l.substring(h+1,s);this._blameRGB=a=l.split(",").slice(0,3)}var t=function(){var a=f.AnnotationType.createAnnotation(this.groupType,this.start,this.end,this.title);a.style=d.mixin({},a.style);a.style.style=d.mixin({},a.style.style);a.style.style.backgroundColor="";this.groupAnnotation=a;a.blame=this.blame;a.html=this.html;a.creatorID=this.creatorID;return a},w=function(){var a=g.createElement(e,"div");a.className="tooltipTitle";var b=this.blame.Message.indexOf("\n");
-1===b&&(b=this.blame.Message.length);var c=g.createElement(e,"a");c.href=this.blame.CommitLink;c.appendChild(e.createTextNode(this.blame.Message.substring(0,b)));a.appendChild(c);a.appendChild(g.createElement(e,"br"));a.appendChild(e.createTextNode(g.formatMessage(k.committerOnTime,this.blame.AuthorName,this.blame.Time)));return a},v=this.getModel();this.showAnnotations(c,[b.ANNOTATION_BLAME,b.ANNOTATION_CURRENT_BLAME],function(c){var e=v.getLineStart(c.Start-1),g=v.getLineEnd(c.End-1,!0),e=f.AnnotationType.createAnnotation(b.ANNOTATION_BLAME,
e,g,w),g=a.slice(0);g.push(c.Shade);e.style=d.mixin({},e.style);e.style.style=d.mixin({},e.style.style);e.style.style.backgroundColor="rgba("+g.join()+")";e.groupId=c.Name;e.groupType=b.ANNOTATION_CURRENT_BLAME;e.createGroupAnnotation=t;e.html='\x3cimg class\x3d"annotationHTML blame" src\x3d"'+c.AuthorImage+'"/\x3e';e.blame=c;return e})},showSelection:function(b,a,c,d,e){"number"===typeof b?("number"!==typeof a&&(a=b),this.moveSelection(b,a)):"number"===typeof c&&(b=this.getModel().getLineStart(c-
1),"number"===typeof d&&(b+=d),"number"!==typeof e&&(e=0),this.moveSelection(b,b+e))},_setModelText:function(b){this._textView&&(this._textView.setText(b),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelection()))},setInput:function(b,a,c,d,f){e.prototype.setInput.call(this,b,a,c,d);this._textView&&!d&&!f&&this._textView.focus()},onGotoLine:function(b,a,c,d){if(this._textView){var e=this.getModel();b=Math.max(0,Math.min(b,e.getLineCount()-1));var f=
e.getLineStart(b),g=0;void 0===c&&(c=0);"string"===typeof a?(b=e.getLine(b).indexOf(a),-1!==b&&(g=b,c=g+a.length)):(g=a,a=e.getLineEnd(b)-f,g=Math.min(g,a),c=Math.min(c,a));this.moveSelection(f+g,f+c,d)}}});return{BaseEditor:e,Editor:c}});
define("orion/editor/find","i18n!orion/editor/nls/messages orion/keyBinding orion/editor/keyModes orion/editor/annotations orion/regex orion/objects orion/util".split(" "),function(k,l,h,f,d,g,e){function c(a){var b=a.getTextView();h.KeyMode.call(this,b);this.editor=a;this._active=!1;this._success=!0;this._ignoreSelection=!1;this._prefix="";b.setAction("incrementalFindCancel",function(){this.setActive(!1);return!0}.bind(this));b.setAction("incrementalFindBackspace",function(){return this._backspace()}.bind(this));
var c=this;this._listener={onVerify:function(a){var b=c.editor,e=b.getModel(),f=b.mapOffset(a.start),b=b.mapOffset(a.end),e=e.getText(f,b);if((e=c._prefix.match(RegExp("^"+d.escape(e),"i")))&&0<e.length)c._prefix+=a.text,c._success=!0,c._status(),c.find(c._forward,!0),a.text=null},onSelection:function(){c._ignoreSelection||c.setActive(!1)}}}function b(a,b,c){if(a){this._editor=a;this._undoStack=b;this._showAll=!0;this._visible=!1;this._wrap=this._caseInsensitive=!0;this._wholeWord=!1;this._incremental=
!0;this._regex=!1;this._findAfterReplace=!0;this._reverse=this._hideAfterFind=!1;this._timer=this._end=this._start=void 0;this._lastString="";var d=this;this._listeners={onEditorFocus:function(a){d._removeCurrentAnnotation(a)}};this.setOptions(c)}}var m={};c.prototype=new h.KeyMode;g.mixin(c.prototype,{createKeyBindings:function(){var a=l.KeyBinding,b=[];b.push({actionID:"incrementalFindBackspace",keyBinding:new a(8)});b.push({actionID:"incrementalFindCancel",keyBinding:new a(13)});b.push({actionID:"incrementalFindCancel",
keyBinding:new a(27)});b.push({actionID:"incrementalFindReverse",keyBinding:new a(38)});b.push({actionID:"incrementalFind",keyBinding:new a(40)});b.push({actionID:"incrementalFindReverse",keyBinding:new a("k",!0,!0)});b.push({actionID:"incrementalFind",keyBinding:new a("k",!0)});return b},find:function(a,b){this._forward=a;if(!this.isActive())return this.setActive(!0),!1;var c=this._prefix;if(0===c.length)return!1;var d=this.editor,e=d.getModel(),e=a?this._success?b?this._start:d.getCaretOffset()+
1:0:this._success?b?this._start:d.getCaretOffset():e.getCharCount()-1;(c=d.getModel().find({string:c,start:e,reverse:!a,caseInsensitive:c.toLowerCase()===c}).next())?(b||(this._start=e),this._ignoreSelection=this._success=!0,d.moveSelection(a?c.start:c.end,a?c.end:c.start),this._ignoreSelection=!1):this._success=!1;this._status();return!0},isActive:function(){return this._active},isStatusActive:function(){return this.isActive()},setActive:function(a){this._active!==a&&(this._active=a,this._prefix=
"",this._success=!0,a=this.editor.getTextView(),this._start=this.editor.getCaretOffset(),this.editor.setCaretOffset(this._start),this._active?(a.addEventListener("Verify",this._listener.onVerify),a.addEventListener("Selection",this._listener.onSelection),a.addKeyMode(this)):(a.removeEventListener("Verify",this._listener.onVerify),a.removeEventListener("Selection",this._listener.onSelection),a.removeKeyMode(this)),this._status())},_backspace:function(){var a=this._prefix,a=this._prefix=a.substring(0,
a.length-1);return 0===a.length?(this._ignoreSelection=this._success=!0,this.editor.setCaretOffset(this.editor.getSelection().start),this._ignoreSelection=!1,this._status(),!0):this.find(this._forward,!0)},_status:function(){if(this.isActive()){var a;a=this._forward?this._success?k.incrementalFindStr:k.incrementalFindStrNotFound:this._success?k.incrementalFindReverseStr:k.incrementalFindReverseStrNotFound;a=e.formatMessage(a,this._prefix);this.editor.reportStatus(a,this._success?"":"error")}else this.editor.reportStatus("")}});
m.IncrementalFind=c;b.prototype={find:function(a,b,c){this.setOptions({reverse:!a});var d=this.getFindString(),e;b&&(d=b.findString||d,e=b.count);a=this.getOptions();this.setOptions(b);b=c?this._startOffset:this.getStartOffset();if((e=this._doFind(d,b,e))&&!c)this._startOffset=e.start;this.setOptions(a);this._hideAfterFind&&this.hide();return e},getStartOffset:function(){return void 0!==this._start?this._start:this._reverse?this._editor.getSelection().start-1:this._editor.getCaretOffset()},getFindString:function(){var a=
this._editor.getSelection(),a=this._editor.getText(a.start,a.end);this._regex&&(a=d.escape(a));return a||this._lastString},getOptions:function(){return{showAll:this._showAll,caseInsensitive:this._caseInsensitive,wrap:this._wrap,wholeWord:this._wholeWord,incremental:this._incremental,regex:this._regex,findAfterReplace:this._findAfterReplace,hideAfterFind:this._hideAfterFind,reverse:this._reverse,findCallback:this._findCallback,start:this._start,end:this._end}},getReplaceString:function(){return""},
hide:function(){this._visible=!1;this._savedOptions&&(this.setOptions(this._savedOptions.pop()),0===this._savedOptions.length&&(this._savedOptions=null));this._removeAllAnnotations();var a=this._editor.getTextView();a&&(a.removeEventListener("Focus",this._listeners.onEditorFocus),a.focus())},_processReplaceString:function(a){var b=a;if(this._regex){for(var b="",c=!1,d=this._editor.getModel().getLineDelimiter(),e=0;e<a.length;e++){var f=a.substring(e,e+1);if(c){switch(f){case "R":b+=d;break;case "r":b+=
"\r";break;case "n":b+="\n";break;case "t":b+="\t";break;case "\\":b+="\\";break;default:b+="\\"+f}c=!1}else"\\"===f?c=!0:b+=f}c&&(b+="\\")}return b},isVisible:function(){return this._visible},replace:function(){var a=this.getFindString();if(a){var b=this._editor,c=this._processReplaceString(this.getReplaceString()),d=b.getSelection().start;if(b=b.getModel().find({string:a,start:d,reverse:!1,wrap:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}).next())this.startUndo(),
this._doReplace(b.start,b.end,a,c),this.endUndo()}this._findAfterReplace&&a&&this._doFind(a,this.getStartOffset())},replaceAll:function(){var a=this.getFindString();if(a){this._replacingAll=!0;var b=this._editor,c=b.getTextView();b.reportStatus(k.replaceAll);var d=this._processReplaceString(this.getReplaceString()),f=this;window.setTimeout(function(){for(var g=0,h=0;;){var m=f._doFind(a,g,null,!0);if(!m)break;h++;1===h&&(c.setRedraw(!1),f.startUndo());f._doReplace(m.start,m.end,a,d);g=f.getStartOffset()}0<
h&&(f.endUndo(),c.setRedraw(!0));0<g?b.reportStatus(e.formatMessage(k.replacedMatches,h)):b.reportStatus(k.nothingReplaced,"error");f._replacingAll=!1},100)}},setOptions:function(a){if(a){if((!0===a.showAll||!1===a.showAll)&&this._showAll!==a.showAll)if(this._showAll=a.showAll,this.isVisible())if(this._showAll)this._markAllOccurrences();else{var b=this._editor.getAnnotationModel();b&&b.removeAnnotations(f.AnnotationType.ANNOTATION_MATCHING_SEARCH)}if(!0===a.caseInsensitive||!1===a.caseInsensitive)this._caseInsensitive=
a.caseInsensitive;if(!0===a.wrap||!1===a.wrap)this._wrap=a.wrap;if(!0===a.wholeWord||!1===a.wholeWord)this._wholeWord=a.wholeWord;if(!0===a.incremental||!1===a.incremental)this._incremental=a.incremental;if(!0===a.regex||!1===a.regex)this._regex=a.regex;if(!0===a.findAfterReplace||!1===a.findAfterReplace)this._findAfterReplace=a.findAfterReplace;if(!0===a.hideAfterFind||!1===a.hideAfterFind)this._hideAfterFind=a.hideAfterFind;if(!0===a.reverse||!1===a.reverse)this._reverse=a.reverse;a.hasOwnProperty("findCallback")&&
(this._findCallback=a.findCallback);a.hasOwnProperty("start")&&(this._start=a.start);a.hasOwnProperty("end")&&(this._end=a.end)}},show:function(a){this._visible=!0;a&&(this._savedOptions||(this._savedOptions=[]),this._savedOptions.push(this.getOptions()),this.setOptions(a));this._startOffset=this._editor.getSelection().start;this._editor.getTextView().addEventListener("Focus",this._listeners.onEditorFocus);var b=this;window.setTimeout(function(){b._incremental&&b.find(!0,null,!0)},0)},startUndo:function(){this._undoStack&&
this._undoStack.startCompoundChange()},endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},_find:function(a,b,c){return this._editor.getModel().find({string:a,start:b,end:this._end,reverse:this._reverse,wrap:c?!1:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive})},_doFind:function(a,b,c,d){c=c||1;var e=this._editor;if(!a)return this._removeAllAnnotations(),null;this._lastString=a;var g,h;if(this._regex)try{h=this._find(a,b,d)}catch(m){e.reportStatus(m.message,
"error");return}else h=this._find(a,b,d);for(a=0;a<c&&h.hasNext();a++)g=h.next();if(!this._replacingAll){g?this._editor.reportStatus(""):this._editor.reportStatus(k.notFound,"error");if(this.isVisible()){c=f.AnnotationType.ANNOTATION_CURRENT_SEARCH;if(h=e.getAnnotationModel())h.removeAnnotations(c),g&&h.addAnnotation(f.AnnotationType.createAnnotation(c,g.start,g.end));if(this._showAll){this._timer&&window.clearTimeout(this._timer);var l=this;this._timer=window.setTimeout(function(){l._markAllOccurrences();
l._timer=null},500)}}this._findCallback?this._findCallback(g):g&&e.moveSelection(g.start,g.end,null,!1)}return g},_doReplace:function(a,b,c,d){var e=this._editor;if(!this._regex||!(d=e.getText(a,b).replace(RegExp(c,this._caseInsensitive?"i":""),d),!d))e.setText(d,a,b),e.setSelection(a,a+d.length,!0)},_markAllOccurrences:function(){var a=this._editor.getAnnotationModel();if(a){for(var b=f.AnnotationType.ANNOTATION_MATCHING_SEARCH,c=a.getAnnotations(),d=[],e;c.hasNext();){var g=c.next();g.type===b&&
d.push(g)}if(this.isVisible()){c=this.getFindString();c=this._editor.getModel().find({string:c,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive});for(e=[];c.hasNext();)g=c.next(),e.push(f.AnnotationType.createAnnotation(b,g.start,g.end))}a.replaceAnnotations(d,e)}},_removeAllAnnotations:function(){var a=this._editor.getAnnotationModel();a&&(a.removeAnnotations(f.AnnotationType.ANNOTATION_CURRENT_SEARCH),a.removeAnnotations(f.AnnotationType.ANNOTATION_MATCHING_SEARCH))},
_removeCurrentAnnotation:function(a){(a=this._editor.getAnnotationModel())&&a.removeAnnotations(f.AnnotationType.ANNOTATION_CURRENT_SEARCH)}};m.Find=b;return m});
define("orion/editor/actions","i18n!orion/editor/nls/messages orion/keyBinding orion/editor/annotations orion/editor/tooltip orion/editor/find orion/util".split(" "),function(k,l,h,f,d,g){function e(a,b,c){this.editor=a;this.undoStack=b;this._incrementalFind=new d.IncrementalFind(a);this._find=c?c:new d.Find(a,b);this._lastEditLocation=null;this.init()}function c(a,b,c,d){this.editor=a;this.undoStack=b;this.contentAssist=c;this.linkedMode=d;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",
this.contentAssistProposalApplied.bind(this));this.init()}var b=h.AnnotationType,m={};e.prototype={init:function(){var a=this.editor.getTextView();this._lastEditListener={onModelChanged:function(a){this.editor.isDirty()&&(this._lastEditLocation=a.start+a.addedCharCount)}.bind(this)};a.addEventListener("ModelChanged",this._lastEditListener.onModelChanged);a.setAction("undo",function(a){if(this.undoStack){var b=1;for(a&&a.count&&(b=a.count);0<b;)this.undoStack.undo(),--b;return!0}return!1}.bind(this),
{name:k.undo});a.setAction("redo",function(a){if(this.undoStack){var b=1;for(a&&a.count&&(b=a.count);0<b;)this.undoStack.redo(),--b;return!0}return!1}.bind(this),{name:k.redo});a.setKeyBinding(new l.KeyBinding("f",!0),"find");a.setAction("find",function(){if(this._find){var a=this.editor.getSelection();(a=prompt(k.find,this.editor.getText(a.start,a.end)))&&this._find.find(!0,{findString:a})}}.bind(this),{name:k.find});a.setKeyBinding(new l.KeyBinding("k",!0),"findNext");a.setAction("findNext",function(a){return this._find?
(this._find.find(!0,a),!0):!1}.bind(this),{name:k.findNext});a.setKeyBinding(new l.KeyBinding("k",!0,!0),"findPrevious");a.setAction("findPrevious",function(a){return this._find?(this._find.find(!1,a),!0):!1}.bind(this),{name:k.findPrevious});a.setKeyBinding(new l.KeyBinding("j",!0),"incrementalFind");a.setAction("incrementalFind",function(){this._incrementalFind&&this._incrementalFind.find(!0);return!0}.bind(this),{name:k.incrementalFind});a.setKeyBinding(new l.KeyBinding("j",!0,!0),"incrementalFindReverse");
a.setAction("incrementalFindReverse",function(){this._incrementalFind&&this._incrementalFind.find(!1);return!0}.bind(this),{name:k.incrementalFindReverse});a.setAction("tab",function(){return this.indentLines()}.bind(this));a.setAction("shiftTab",function(){return this.unindentLines()}.bind(this),{name:k.unindentLines});a.setKeyBinding(new l.KeyBinding(38,!1,!1,!0),"moveLinesUp");a.setAction("moveLinesUp",function(){return this.moveLinesUp()}.bind(this),{name:k.moveLinesUp});a.setKeyBinding(new l.KeyBinding(40,
!1,!1,!0),"moveLinesDown");a.setAction("moveLinesDown",function(){return this.moveLinesDown()}.bind(this),{name:k.moveLinesDown});a.setKeyBinding(new l.KeyBinding(38,!0,!1,!0),"copyLinesUp");a.setAction("copyLinesUp",function(){return this.copyLinesUp()}.bind(this),{name:k.copyLinesUp});a.setKeyBinding(new l.KeyBinding(40,!0,!1,!0),"copyLinesDown");a.setAction("copyLinesDown",function(){return this.copyLinesDown()}.bind(this),{name:k.copyLinesDown});a.setKeyBinding(new l.KeyBinding("d",!0,!1,!1),
"deleteLines");a.setAction("deleteLines",function(a){return this.deleteLines(a)}.bind(this),{name:k.deleteLines});a.setKeyBinding(new l.KeyBinding("l",!g.isMac,!1,!1,g.isMac),"gotoLine");a.setAction("gotoLine",function(){return this.gotoLine()}.bind(this),{name:k.gotoLine});a.setKeyBinding(new l.KeyBinding(190,!0),"nextAnnotation");a.setAction("nextAnnotation",function(){return this.nextAnnotation(!0)}.bind(this),{name:k.nextAnnotation});a.setKeyBinding(new l.KeyBinding(188,!0),"previousAnnotation");
a.setAction("previousAnnotation",function(){return this.nextAnnotation(!1)}.bind(this),{name:k.prevAnnotation});a.setKeyBinding(new l.KeyBinding("e",!0,!1,!0,!1),"expand");a.setAction("expand",function(){return this.expandAnnotation(!0)}.bind(this),{name:k.expand});a.setKeyBinding(new l.KeyBinding("c",!0,!1,!0,!1),"collapse");a.setAction("collapse",function(){return this.expandAnnotation(!1)}.bind(this),{name:k.collapse});a.setKeyBinding(new l.KeyBinding("e",!0,!0,!0,!1),"expandAll");a.setAction("expandAll",
function(){return this.expandAnnotations(!0)}.bind(this),{name:k.expandAll});a.setKeyBinding(new l.KeyBinding("c",!0,!0,!0,!1),"collapseAll");a.setAction("collapseAll",function(){return this.expandAnnotations(!1)}.bind(this),{name:k.collapseAll});a.setKeyBinding(new l.KeyBinding("q",!g.isMac,!1,!1,g.isMac),"lastEdit");a.setAction("lastEdit",function(){return this.gotoLastEdit()}.bind(this),{name:k.lastEdit})},copyLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;
var b=a.getModel(),c=a.getSelection(),d=b.getLineAtOffset(c.start),c=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),e=b.getLineStart(d),d=b.getLineEnd(c,!0),f=b.getLineCount(),g="",e=b.getText(e,d);c===f-1&&(e=(g=b.getLineDelimiter())+e);a.setText(e,d,d);a.setSelection(d+g.length,d+e.length);return!0},copyLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),d=b.getLineAtOffset(c.start),c=b.getLineAtOffset(c.end>c.start?c.end-
1:c.end),d=b.getLineStart(d),e=b.getLineEnd(c,!0),f=b.getLineCount(),g="",e=b.getText(d,e);c===f-1&&(e+=g=b.getLineDelimiter());a.setText(e,d,d);a.setSelection(d,d+e.length-g.length);return!0},deleteLines:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var c=1;a&&a.count&&(c=a.count);var d=b.getSelection(),e=b.getModel(),f=e.getLineAtOffset(d.start);a=e.getLineStart(f);c=d.start!==d.end||1===c?e.getLineAtOffset(d.end>d.start?d.end-1:d.end):Math.min(f+c-1,e.getLineCount()-
1);c=e.getLineEnd(c,!0);b.setText("",a,c);return!0},expandAnnotation:function(a){var b=this.editor,c=b.getAnnotationModel();if(!c)return!0;var d=b.getModel(),e=b.getCaretOffset(),f=d.getLineAtOffset(e),e=d.getLineStart(f),f=d.getLineEnd(f,!0);d.getBaseModel&&(e=d.mapOffset(e),f=d.mapOffset(f),d.getBaseModel());for(var g,c=c.getAnnotations(e,f);!g&&c.hasNext();)d=c.next(),d.type===h.AnnotationType.ANNOTATION_FOLDING&&(g=d);g&&a!==g.expanded&&(a?g.expand():(b.setCaretOffset(g.start),g.collapse()));
return!0},expandAnnotations:function(a){var b=this.editor,c=b.getTextView(),b=b.getAnnotationModel();if(!b)return!0;var d=b.getAnnotations();for(c.setRedraw(!1);d.hasNext();)b=d.next(),b.type===h.AnnotationType.ANNOTATION_FOLDING&&a!==b.expanded&&(a?b.expand():b.collapse());c.setRedraw(!0);return!0},indentLines:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){var c=a.getModel(),d=a.getSelection(),e=c.getLineAtOffset(d.start),f=c.getLineAtOffset(d.end>
d.start?d.end-1:d.end);if(e!==f){var g=[];g.push("");for(var h=e;h<=f;h++)g.push(c.getLine(h,!0));h=c.getLineStart(e);c=c.getLineEnd(f,!0);b=b.getOptions("tabSize","expandTab");b=b.expandTab?Array(b.tabSize+1).join(" "):"\t";a.setText(g.join(b),h,c);a.setSelection(h===d.start?d.start:d.start+b.length,d.end+(f-e+1)*b.length);return!0}return!1}},gotoLastEdit:function(){"number"===typeof this._lastEditLocation&&this.editor.showSelection(this._lastEditLocation);return!0},gotoLine:function(){var a=this.editor,
b=a.getModel().getLineAtOffset(a.getCaretOffset());if(b=prompt(k.gotoLinePrompty,b+1))b=parseInt(b,10),a.onGotoLine(b-1,0);return!0},moveLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),d=b.getLineAtOffset(c.start),e=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),f=b.getLineCount();if(e===f-1)return!0;var d=b.getLineStart(d),c=b.getLineEnd(e,!0),g=b.getLineEnd(e+1,!0)-(c-d),h=0;e!==f-2?b=b.getText(d,c):(e=b.getLineEnd(e),
b=b.getText(e,c)+b.getText(d,e),h+=c-e);this.startUndo();a.setText("",d,c);a.setText(b,g,g);a.setSelection(g+h,g+h+b.length);this.endUndo();return!0},moveLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),d=b.getLineAtOffset(c.start);if(0===d)return!0;var e=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),f=b.getLineCount(),c=b.getLineStart(d-1),g=b.getLineStart(d),h=b.getLineEnd(e,!0),m=b.getText(g,h),k=0;e===f-1&&(e=b.getLineEnd(d-
1),d=b.getLineEnd(d-1,!0),m+=b.getText(e,d),g=e,k=d-e);this.startUndo();a.setText("",g,h);a.setText(m,c,c);a.setSelection(c,c+m.length-k);this.endUndo();return!0},nextAnnotation:function(a){function c(a){return!!a.lineStyle||a.type===b.ANNOTATION_MATCHING_BRACKET||a.type===b.ANNOTATION_CURRENT_BRACKET||!g.isAnnotationTypeVisible(a.type)}var d=this.editor,e=d.getAnnotationModel();if(!e)return!0;var g=d.getOverviewRuler()||d.getAnnotationStyler();if(!g)return!0;for(var h=d.getModel(),m=d.getCaretOffset(),
k=e.getAnnotations(a?m:0,a?h.getCharCount():m),l=null;k.hasNext();){var z=k.next();if(a){if(z.start<=m)continue}else if(z.start>=m)continue;if(!c(z)&&(l=z,a))break}if(l){for(var x=[l],k=e.getAnnotations(l.start,l.start);k.hasNext();)z=k.next(),z!==l&&!c(z)&&x.push(z);var A=d.getTextView(),p=h.getLineAtOffset(l.start),B=f.Tooltip.getTooltip(A);if(!B)return d.moveSelection(l.start),!0;d.moveSelection(l.start,l.start,function(){B.setTarget({getTooltipInfo:function(){var a=A.convert({x:A.getLocationAtOffset(l.start).x,
y:A.getLocationAtOffset(h.getLineStart(p)).y},"document","page");return{contents:x,x:a.x,y:a.y+Math.floor(1.33*A.getLineHeight(p))}}},0)})}return!0},unindentLines:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){for(var c=a.getModel(),d=a.getSelection(),e=c.getLineAtOffset(d.start),f=c.getLineAtOffset(d.end>d.start?d.end-1:d.end),g=b.getOptions("tabSize"),h=Array(g+1).join(" "),m=[],k=b=0,l=e;l<=f;l++){var A=c.getLine(l,!0);if(c.getLineStart(l)!==
c.getLineEnd(l))if(0===A.indexOf("\t"))A=A.substring(1),b++;else if(0===A.indexOf(h))A=A.substring(g),b+=g;else return!0;l===e&&(k=b);m.push(A)}e=c.getLineStart(e);g=c.getLineEnd(f,!0);c=c.getLineStart(f);a.setText(m.join(""),e,g);f=e===d.start?d.start:d.start-k;d=Math.max(f,d.end-b+(d.end===c+1&&d.start!==d.end?1:0));a.setSelection(f,d);return!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};m.TextActions=
e;c.prototype={init:function(){var a=this.editor.getTextView();a.setAction("lineStart",function(){return this.lineStart()}.bind(this));a.setAction("enter",function(){return this.autoIndent()}.bind(this));a.setKeyBinding(new l.KeyBinding("t",!0,!1,!0),"trimTrailingWhitespaces");a.setAction("trimTrailingWhitespaces",function(){return this.trimTrailingWhitespaces()}.bind(this),{name:k.trimTrailingWhitespaces});a.setKeyBinding(new l.KeyBinding(191,!0),"toggleLineComment");a.setAction("toggleLineComment",
function(){return this.toggleLineComment()}.bind(this),{name:k.toggleLineComment});a.setKeyBinding(new l.KeyBinding(191,!0,!g.isMac,!1,g.isMac),"addBlockComment");a.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),{name:k.addBlockComment});a.setKeyBinding(new l.KeyBinding(220,!0,!g.isMac,!1,g.isMac),"removeBlockComment");a.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),{name:k.removeBlockComment});a.setKeyBinding(new l.KeyBinding("[",
!1,!1,!1,!1,"keypress"),"autoPairSquareBracket");a.setAction("autoPairSquareBracket",function(){return this.autoPairBrackets("[","]")}.bind(this));a.setKeyBinding(new l.KeyBinding("]",!1,!1,!1,!1,"keypress"),"skipClosingSquareBracket");a.setAction("skipClosingSquareBracket",function(){return this.skipClosingBracket("]")}.bind(this));a.setKeyBinding(new l.KeyBinding("\x3c",!1,!1,!1,!1,"keypress"),"autoPairAngleBracket");a.setAction("autoPairAngleBracket",function(){return this.autoPairBrackets("\x3c",
"\x3e")}.bind(this));a.setKeyBinding(new l.KeyBinding("\x3e",!1,!1,!1,!1,"keypress"),"skipClosingAngleBracket");a.setAction("skipClosingAngleBracket",function(){return this.skipClosingBracket("\x3e")}.bind(this));a.setKeyBinding(new l.KeyBinding("(",!1,!1,!1,!1,"keypress"),"autoPairParentheses");a.setAction("autoPairParentheses",function(){return this.autoPairBrackets("(",")")}.bind(this));a.setKeyBinding(new l.KeyBinding(")",!1,!1,!1,!1,"keypress"),"skipClosingParenthesis");a.setAction("skipClosingParenthesis",
function(){return this.skipClosingBracket(")")}.bind(this));a.setKeyBinding(new l.KeyBinding("{",!1,!1,!1,!1,"keypress"),"autoPairBraces");a.setAction("autoPairBraces",function(){return this.autoPairBrackets("{","}")}.bind(this));a.setKeyBinding(new l.KeyBinding("}",!1,!1,!1,!1,"keypress"),"skipClosingBrace");a.setAction("skipClosingBrace",function(){return this.skipClosingBracket("}")}.bind(this));a.setKeyBinding(new l.KeyBinding("'",!1,!1,!1,!1,"keypress"),"autoPairSingleQuotation");a.setAction("autoPairSingleQuotation",
function(){return this.autoPairQuotations("'")}.bind(this));a.setKeyBinding(new l.KeyBinding('"',!1,!1,!1,!1,"keypress"),"autoPairDblQuotation");a.setAction("autoPairDblQuotation",function(){return this.autoPairQuotations('"')}.bind(this));a.setAction("deletePrevious",function(){return this.deletePrevious()}.bind(this))},autoIndent:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;var c=a.getSelection();if(c.start===c.end){for(var d=a.getModel(),e=d.getLineAtOffset(c.start),
f=d.getLine(e,!1),g=d.getLineStart(e),h=0,m=c.start-g,k;h<m&&(32===(k=f.charCodeAt(h))||9===k);)h++;var g=f.substring(0,h),b=b.getOptions("tabSize","expandTab"),l=b.expandTab?Array(b.tabSize+1).join(" "):"\t",b=d.getLineDelimiter(),A=/^[\s]*\/\*[\*]*[\s]*$/,p=/^[\s]*\*/,B=/\*\/[\s]*$/,y=f.substring(0,m),C=f.substring(m),K;if(this.smartIndentation&&123===f.charCodeAt(K=y.trimRight().length-1))return d=m-K-1,C=C.length-C.trimLeft().length,f=125===f.charCodeAt(m+C)?b+g+l+b+g:b+g+l,a.setText(f,c.start-
d,c.end+C),a.setCaretOffset(c.start+b.length+g.length+l.length-d),!0;if(this.autoCompleteComments&&!B.test(y)&&(A.test(y)||p.test(y))){if(A.exec(y)){f=b+g+" * ";f=B.test(C)?f+C.substring(0,C.length-2).trim():f+C.trim();if(d.getLineCount()===e+1||!p.test(d.getLine(e+1)))f+=b+g+" */";a.setText(f,c.start,c.end+C.length);a.setCaretOffset(c.start+b.length+g.length+3);return!0}if(p.exec(y))for(e-=1;0<=e;e--){h=d.getLine(e,!1);if(A.test(h))return B.test(C)||47===f.charCodeAt(m)?(f=b+g+"*"+C,g=c.start+b.length+
g.length+1):(f=b+g+"* "+C,g=c.start+b.length+g.length+2),a.setText(f,c.start,c.end+C.length),a.setCaretOffset(g),!0;if(!p.test(h))break}}else{if(B.test(y)&&32===g.charCodeAt(g.length-1))return f=b+g.substring(0,g.length-1),a.setText(f,c.start,c.end),a.setCaretOffset(c.start+f.length),!0;if(0<h){for(h=m;h<f.length&&(32===(k=f.charCodeAt(h++))||9===k);)c.end++;a.setText(d.getLineDelimiter()+g,c.start,c.end);return!0}}}return!1},addBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;
var b=a.getModel(),c=a.getSelection(),d=this._findEnclosingComment(b,c.start,c.end);if(void 0!==d.commentStart&&void 0!==d.commentEnd)return!0;b=b.getText(c.start,c.end);if(0===b.length)return!0;var d=b.length,b=b.replace(/\/\*|\*\//g,""),e=b.length;a.setText("/*"+b+"*/",c.start,c.end);a.setSelection(c.start+2,c.end+2+(e-d));return!0},autoPairBrackets:function(a,b){if("["===a&&!this.autoPairSquareBrackets||"{"===a&&!this.autoPairBraces||"("===a&&!this.autoPairParentheses||"\x3c"===a&&!this.autoPairAngleBrackets)return!1;
var c=this.editor;if(c.getTextView().getOptions("readonly"))return!1;var d=c.getSelection(),e=c.getModel(),f=c.getCaretOffset()===e.getCharCount()?"":e.getText(d.start,d.start+1).trim(),g=/^$|[)}\]>]/;return d.start===d.end&&g.test(f)?(c.setText(a+b,d.start,d.start),c.setCaretOffset(d.start+1),!0):d.start!==d.end?(e=e.getText(d.start,d.end),c.setText(a+e+b,d.start,d.end),c.setSelection(d.start+1,d.end+1),!0):!1},autoPairQuotations:function(a){if(!this.autoPairQuotation)return!1;var b=this.editor;
if(b.getTextView().getOptions("readonly"))return!1;var c=b.getSelection(),d=b.getModel(),e=b.getCaretOffset(),f=0===e?"":d.getText(c.start-1,c.start).trim(),g=e===d.getCharCount()?"":d.getText(c.start,c.start+1).trim(),e=/^"$|^'$/,h=/\w/,m=/^$|[)}\]>]/;if(c.start!==c.end){d=d.getText(c.start,c.end);if(e.test(d))return!1;b.setText(a+d+a,c.start,c.end);b.setSelection(c.start+1,c.end+1)}else{if(g!==a){if(f===a||e.test(g)||h.test(f)||!m.test(g))return!1;b.setText(a+a,c.start,c.start)}b.setCaretOffset(c.start+
1)}return!0},contentAssistProposalApplied:function(a){a=a.data.proposal;if(a.positions&&0<a.positions.length&&this.linkedMode){for(var b=[],c=0;c<a.positions.length;++c)b[c]={positions:[{offset:a.positions[c].offset,length:a.positions[c].length}]};this.linkedMode.enterLinkedMode({groups:b,escapePosition:a.escapePosition})}else a.groups&&0<a.groups.length&&this.linkedMode?this.linkedMode.enterLinkedMode({groups:a.groups,escapePosition:a.escapePosition}):a.escapePosition&&this.editor.getTextView().setCaretOffset(a.escapePosition);
return!0},deletePrevious:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getSelection();if(b.start!==b.end)return!1;var c=a.getModel(),d=a.getCaretOffset(),e=0===d?"":c.getText(b.start-1,b.start),c=d===c.getCharCount()?"":c.getText(b.start,b.start+1);("("===e&&")"===c||"["===e&&"]"===c||"{"===e&&"}"===c||"\x3c"===e&&"\x3e"===c||'"'===e&&'"'===c||"'"===e&&"'"===c)&&a.setText("",b.start,b.start+1);return!1},_findEnclosingComment:function(a,b,c){var d=a.getLineAtOffset(b),
e=a.getLineAtOffset(c),f,g,h,m,k,l;for(f=d;0<=f&&!(g=a.getLine(f),h=f===d?b-a.getLineStart(d):g.length,m=g.lastIndexOf("/*",h),g=g.lastIndexOf("*/",h),g>m);f--)if(-1!==m){k=a.getLineStart(f)+m;break}for(f=e;f<a.getLineCount()&&!(g=a.getLine(f),h=f===e?c-a.getLineStart(e):0,m=g.indexOf("/*",h),g=g.indexOf("*/",h),-1!==m&&m<g);f++)if(-1!==g){l=a.getLineStart(f)+g;break}return{commentStart:k,commentEnd:l}},lineStart:function(){for(var a=this.editor,b=a.getModel(),c=a.getCaretOffset(),d=b.getLineAtOffset(c),
e=b.getLineStart(d),b=b.getLine(d),d=0;d<b.length;d++){var f=b.charCodeAt(d);if(!(32===f||9===f))break}d+=e;return c!==d?(a.setSelection(d,d),!0):!1},removeBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),d=b.getText(c.start,c.end),e,f,g;for(g=0;g<d.length;g++)if("/*"===d.substring(g,g+2)){e=c.start+g;break}for(;g<d.length;g++)if("*/"===d.substring(g,g+2)){f=c.start+g;break}if(void 0!==e&&void 0!==f)a.setText(b.getText(e+
2,f),e,f+2),a.setSelection(e,f);else{d=this._findEnclosingComment(b,c.start,c.end);if(void 0===d.commentStart||void 0===d.commentEnd)return!0;b=b.getText(d.commentStart+2,d.commentEnd);a.setText(b,d.commentStart,d.commentEnd+2);a.setSelection(c.start-2,c.end-2)}return!0},toggleLineComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;for(var b=this.lineComment||"//",c=a.getModel(),d=a.getSelection(),e=c.getLineAtOffset(d.start),f=c.getLineAtOffset(d.end>d.start?d.end-
1:d.end),g=!0,h=[],m,k,l=e;l<=f;l++)if(m=c.getLine(l,!0),h.push(m),!g||-1===(k=m.indexOf(b)))g=!1;else if(0!==k){var A;for(A=0;A<k;A++){var p=m.charCodeAt(A);if(!(32===p||9===p))break}g=A===k}p=b.length;l=c.getLineStart(e);A=c.getLineEnd(f,!0);if(g){for(g=0;g<h.length;g++)m=h[g],k=m.indexOf(b),h[g]=m.substring(0,k)+m.substring(k+p);b=h.join("");h=c.getLineStart(f);c=l===d.start?d.start:d.start-p;d=d.end-p*(f-e+1)+(d.end===h+1?p:0)}else h.splice(0,0,""),b=h.join(b),c=l===d.start?d.start:d.start+p,
d=d.end+p*(f-e+1);a.setText(b,l,A);a.setSelection(c,d);return!0},trimTrailingWhitespaces:function(){var a=this.editor,b=a.getModel(),c=a.getSelection();a.getTextView().setRedraw(!1);a.getUndoStack().startCompoundChange();for(var d=/(\s+$)/,e=b.getLineCount(),f=0;f<e;f++){var g=b.getLine(f),h=d.exec(g);if(h){var m=b.getLineStart(f),g=h[0].length,h=m+h.index;b.setText("",h,h+g);c.start>h&&(c.start=Math.max(h,c.start-g));c.start!==c.end&&c.end>h&&(c.end=Math.max(h,c.end-g))}}a.getUndoStack().endCompoundChange();
a.getTextView().setRedraw(!0);a.setSelection(c.start,c.end,!1)},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},skipClosingBracket:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var c=b.getSelection(),d=b.getModel();return(b.getCaretOffset()===d.getCharCount()?"":d.getText(c.start,c.start+1))===a?(b.setCaretOffset(c.start+1),!0):!1},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},setAutoPairParentheses:function(a){this.autoPairParentheses=
a},setAutoPairBraces:function(a){this.autoPairBraces=a},setAutoPairSquareBrackets:function(a){this.autoPairSquareBrackets=a},setAutoPairAngleBrackets:function(a){this.autoPairAngleBrackets=a},setAutoPairQuotations:function(a){this.autoPairQuotation=a},setAutoCompleteComments:function(a){this.autoCompleteComments=a},setLineComment:function(a){this.lineComment=a},setSmartIndentation:function(a){this.smartIndentation=a}};m.SourceCodeActions=c;String.prototype.trimLeft||(String.prototype.trimLeft=function(){return this.replace(/^\s+/g,
"")});String.prototype.trimRight||(String.prototype.trimRight=function(){return this.replace(/\s+$/g,"")});return m});
define("orion/editor/undoStack",[],function(){function k(f,d,g,e,c){this.model=f;this.offset=d;this.text=g;this.previousText=e;this.type=c}function l(f){this.owner=f;this.changes=[]}function h(f,d){this.size=void 0!==d?d:100;this.reset();var g=this;this._listener={onChanging:function(c){g._onChanging(c)},onDestroy:function(c){g._onDestroy(c)}};if(f.getModel){var e=f.getModel();e.getBaseModel&&(e=e.getBaseModel());this.model=e;this.setView(f)}else this.shared=!0,this.model=f;this.model.addEventListener("Changing",
this._listener.onChanging)}k.prototype={getRedoChanges:function(){return[{start:this.offset,end:this.offset+this.previousText.length,text:this.text}]},getUndoChanges:function(){return[{start:this.offset,end:this.offset+this.text.length,text:this.previousText}]},undo:function(f,d){this._doUndoRedo(this.offset,this.previousText,this.text,f,d);return!0},redo:function(f,d){this._doUndoRedo(this.offset,this.text,this.previousText,f,d);return!0},merge:function(f,d,g,e,c){if(e===this.type){if(1===e&&f===
this.offset+this.text.length)return this.text+=d,!0;if(-1===e&&c===this.offset)return this.offset=f,this.previousText=g+this.previousText,!0;if(-1===e&&f===this.offset)return this.previousText+=g,!0}return!1},_doUndoRedo:function(f,d,g,e,c){this.model.setText(d,f,f+g.length);c&&e&&(g=e.getModel(),g!==this.model&&(f=g.mapOffset(f,!0)),e.setSelection(f,f+d.length))}};l.prototype={getRedoChanges:function(){for(var f=[],d=0;d<this.changes.length;d++)f=f.concat(this.changes[d].getRedoChanges());return f},
getUndoChanges:function(){for(var f=[],d=this.changes.length-1;0<=d;d--)f=f.concat(this.changes[d].getUndoChanges());return f},add:function(f){this.changes.push(f)},end:function(f){f&&(this.endSelection=f.getSelection(),this.endCaret=f.getCaretOffset());(f=this.owner)&&f.end&&f.end()},undo:function(f,d){1<this.changes.length&&f&&f.setRedraw(!1);for(var g=this.changes.length-1;0<=g;g--)this.changes[g].undo(f,!1);1<this.changes.length&&f&&f.setRedraw(!0);if(d&&f){var g=this.startSelection.start,e=this.startSelection.end;
f.setSelection(this.startCaret?g:e,this.startCaret?e:g)}(g=this.owner)&&g.undo&&g.undo();return 0<this.changes.length},redo:function(f,d){1<this.changes.length&&f&&f.setRedraw(!1);for(var g=0;g<this.changes.length;g++)this.changes[g].redo(f,!1);(1<this.changes.length,f)&&f.setRedraw(!0);if(d&&f){var g=this.endSelection.start,e=this.endSelection.end;f.setSelection(this.endCaret?g:e,this.endCaret?e:g)}(g=this.owner)&&g.redo&&g.redo();return 0<this.changes.length},merge:function(f,d,g,e,c){var b=this.changes.length;
return 0<b?this.changes[b-1].merge(f,d,g,e,c):!1},start:function(f){f&&(this.startSelection=f.getSelection(),this.startCaret=f.getCaretOffset());(f=this.owner)&&f.start&&f.start()}};h.prototype={destroy:function(){this._onDestroy()},add:function(f){this.compoundChange?this.compoundChange.add(f):(this.stack.splice(this.index,this.stack.length-this.index,f),this.index++,this.stack.length>this.size&&(this.stack.shift(),this.index--))},markClean:function(){this._commitUndo();if(this.cleanChange=this.stack[this.index-
1])this.cleanChange.type=2},isClean:function(){return this.cleanChange===this.stack[this.index-1]},canUndo:function(){return 0<this.index},canRedo:function(){return 0<this.stack.length-this.index},endCompoundChange:function(){this.compoundChange&&this.compoundChange.end(this.view);this.compoundChange=void 0},getSize:function(){return{undo:this.index,redo:this.stack.length-this.index}},getRedoChanges:function(){this._commitUndo();for(var f=[],d=this.index;d<this.stack.length;d++)f=f.concat(this.stack[d].getRedoChanges());
return f},getUndoChanges:function(){this._commitUndo();for(var f=[],d=this.index;0<=d;d--)f=f.concat(this.stack[d].getUndoChanges());return f},undo:function(){this._commitUndo();var f;f=!1;this._ignoreUndo=!0;do{if(0>=this.index)break;f=this.stack[--this.index]}while(!(f=f.undo(this.view,!0)));this._ignoreUndo=!1;return f},redo:function(){this._commitUndo();var f;this._ignoreUndo=!0;do{if(this.index>=this.stack.length)break;f=this.stack[this.index++]}while(!f.redo(this.view,!0));this._ignoreUndo=
!1;return!0},reset:function(){this.index=0;this.cleanChange=void 0;this.stack=[];this._ignoreUndo=!1;this._compoundChange=void 0},setView:function(f){this.view!==f&&(this.view&&f.removeEventListener("Destroy",this._listener.onDestroy),(this.view=f)&&f.addEventListener("Destroy",this._listener.onDestroy))},startCompoundChange:function(f){this._commitUndo();f=new l(f);this.add(f);this.compoundChange=f;this.compoundChange.start(this.view);return this.compoundChange},_commitUndo:function(){this.endCompoundChange()},
_onDestroy:function(f){(!f||!this.shared)&&this.model.removeEventListener("Changing",this._listener.onChanging);this.view&&(this.view.removeEventListener("Destroy",this._listener.onDestroy),this.view=null)},_onChanging:function(f){if(!this._ignoreUndo){var d=f.text,g=f.start,e=f.addedCharCount,c=f.removedCharCount;f=g+c;var b=0;0===e&&1===c?b=-1:1===e&&0===c&&(b=1);e=this.stack.length;c=this.model.getText(g,f);(!(0<e&&this.index===e)||!this.stack[e-1].merge(g,d,c,b,f))&&this.add(new k(this.model,
g,d,c,b))}}};return{UndoStack:h}});
define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/util"],function(k,l,h,f){function d(b,a,c,d){this._location=a||"left";this._overview=c||"page";this._rulerStyle=d;this._view=null;var e=this;this._listener={onTextModelChanged:function(a){e._onTextModelChanged(a)},onAnnotationModelChanged:function(a){e._onAnnotationModelChanged(a)}};this.setAnnotationModel(b)}function g(b,a,c,e,f){d.call(this,b,a,"page",c);this._oddStyle=e||{style:{backgroundColor:"white"}};
this._evenStyle=f||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._firstLine=1}function e(b,a,c){d.call(this,b,a,"page",c)}function c(b,a,c){d.call(this,b,a,"document",c)}function b(b,a,c){e.call(this,b,a,c)}d.prototype={getAnnotations:function(b,a){var c=this._annotationModel;if(!c)return[];var d=this._view.getModel(),e=d.getLineStart(b),f=d.getLineEnd(a-1),g=d;d.getBaseModel&&(g=d.getBaseModel(),e=d.mapOffset(e),f=d.mapOffset(f));for(var h=[],c=this.getAnnotationsByType(c,e,f),e=0;e<
c.length;e++)for(var f=c[e],k=g.getLineAtOffset(f.start),l=g.getLineAtOffset(Math.max(f.start,f.end-1)),z=k;z<=l;z++){var x=z;if(d!==g){x=g.getLineStart(z);x=d.mapOffset(x,!0);if(-1===x)continue;x=d.getLineAtOffset(x)}if(b<=x&&x<a){var A=this._mergeAnnotation(h[x],f,z-k,l-k+1);A&&(h[x]=A)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var p in h)h[p]._multiple&&(h[p].html+=this._multiAnnotationOverlay.html);return h},getAnnotationModel:function(){return this._annotationModel},getLocation:function(){return this._location},
getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getView:function(){return this._view},getWidestAnnotation:function(){return null},setAnnotationModel:function(b){this._annotationModel&&this._annotationModel.removEventListener("Changed",this._listener.onAnnotationModelChanged);(this._annotationModel=b)&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(b){this._multiAnnotation=b},setMultiAnnotationOverlay:function(b){this._multiAnnotationOverlay=
b},setView:function(b){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged);this._view=b;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)},onClick:function(b,a){if(void 0!==b){var c=this._view,d=c.getModel(),e=d,f=d.getLineStart(b),g=f,k=f,l=this._annotationModel;if(l){c=c.getSelection();k=d.getLineEnd(b,!0);f<=c.start&&c.start<k&&(f=c.start);d.getBaseModel&&(f=d.mapOffset(f),
k=d.mapOffset(k),e=d.getBaseModel());for(var u,k=l.getAnnotations(f,k),l=null;!u&&k.hasNext();)c=k.next(),this.isAnnotationTypeVisible(c.type)&&(l=c,c.start<=f||(u=c));l&&void 0!==l.groupId&&(this._currentClickGroup=this._currentClickGroup===l.groupId?null:l.groupId,this._setCurrentGroup(b));u&&e.getLineAtOffset(u.start)===e.getLineAtOffset(f)?(f=u.start,k=u.end):k=f=g;d.getBaseModel&&(f=d.mapOffset(f,!0),k=d.mapOffset(k,!0))}(d=h.Tooltip.getTooltip(this._view))&&d.setTarget(null);this._view.setSelection(k,
f,1/3,function(){})}},onDblClick:function(b,a){},onMouseMove:function(b,a){var c=h.Tooltip.getTooltip(this._view);if(c&&!(c.isVisible()&&this._tooltipLineIndex===b)){this._tooltipLineIndex=b;var d=this;c.setTarget({y:a.clientY,getTooltipInfo:function(){return d._getTooltipInfo(d._tooltipLineIndex,this.y)}})}},onMouseOver:function(b,a){this.onMouseMove(b,a);this._currentClickGroup||this._setCurrentGroup(b)},onMouseOut:function(b,a){this._currentClickGroup||this._setCurrentGroup(-1);var c=h.Tooltip.getTooltip(this._view);
c&&c.setTarget(null)},_getTooltipInfo:function(b,a){if(void 0!==b){var c=this._view,d=c.getModel(),e=this._annotationModel,f=[];if(e){var f=d.getLineStart(b),g=d.getLineEnd(b);d.getBaseModel&&(f=d.mapOffset(f),g=d.mapOffset(g));f=this.getAnnotationsByType(e,f,g)}e=this._getTooltipContents(b,f);if(!e)return null;e={contents:e,anchor:this.getLocation()};f=c.getClientArea();"document"===this.getOverview()?f.y=c.convert({y:a},"view","document").y:f.y=c.getLocationAtOffset(d.getLineStart(b)).y;c.convert(f,
"document","page");e.x=f.x;e.y=f.y;"right"===e.anchor&&(e.x+=f.width);return e}},_getTooltipContents:function(b,a){return a},_onAnnotationModelChanged:function(b){function a(a){for(var b=0;b<a.length;b++)if(e.isAnnotationTypeVisible(a[b].type)){var f=a[b].start,g=a[b].end;d.getBaseModel&&(f=d.mapOffset(f,!0),g=d.mapOffset(g,!0));-1!==f&&-1!==g&&c.redrawLines(d.getLineAtOffset(f),d.getLineAtOffset(Math.max(f,g-1))+1,e)}}var c=this._view;if(c){var d=c.getModel(),e=this,f=d.getLineCount();b.textModelChangedEvent?
(b=b.textModelChangedEvent.start,d.getBaseModel&&(b=d.mapOffset(b,!0)),b=d.getLineAtOffset(b),c.redrawLines(b,f,e)):(a(b.added),a(b.removed),a(b.changed))}},_mergeAnnotation:function(b,a,c,d){b||(b={});0===c&&(b.html&&a.html?(a.html!==b.html&&!b._multiple&&this._multiAnnotation&&(b.html=this._multiAnnotation.html),b._multiple=!0):b.html=a.html);b.style=this._mergeStyle(b.style,a.style);return b},_mergeStyle:function(b,a){if(a){b||(b={});b.styleClass=b.styleClass&&a.styleClass&&b.styleClass!==a.styleClass?
b.styleClass+(" "+a.styleClass):a.styleClass;var c;if(a.style)for(c in b.style||(b.style={}),a.style)void 0===b.style[c]&&(b.style[c]=a.style[c]);if(a.attributes)for(c in b.attributes||(b.attributes={}),a.attributes)void 0===b.attributes[c]&&(b.attributes[c]=a.attributes[c])}return b},_setCurrentGroup:function(b){var a=this._annotationModel,c=null,d=a.getTextModel(),e,f=this._currentGroupAnnotation;if(-1!==b){var g=d.getLineStart(b),h=d.getLineEnd(b);d.getBaseModel&&(g=d.mapOffset(g),h=d.mapOffset(h));
for(e=a.getAnnotations(g,h);e.hasNext();)if(d=e.next(),this.isAnnotationTypeVisible(d.type)&&d.start<=g&&d.end>=h&&void 0!==d.groupId){c=d;break}if(f&&c&&f.groupId===c.groupId)return}this._currentGroupAnnotation=null;f&&a.removeAnnotations(f.groupType);if(c&&-1!==b){this._currentGroupAnnotation=c;e=a.getAnnotations();for(b=[];e.hasNext();)d=e.next(),delete d.groupAnnotation,d.groupId===c.groupId&&(d=d.createGroupAnnotation(),b.push(d));a.replaceAnnotations(null,b)}}};l.AnnotationTypeList.addMixin(d.prototype);
g.prototype=new d;g.prototype.getAnnotations=function(b,a){for(var c=d.prototype.getAnnotations.call(this,b,a),e=this._view.getModel(),f=b;f<a;f++){var g=f&1?this._oddStyle:this._evenStyle,h=f;e.getBaseModel&&(h=e.getLineStart(h),h=e.getBaseModel().getLineAtOffset(e.mapOffset(h)));c[f]||(c[f]={});c[f].html=this._firstLine+h+"";c[f].style||(c[f].style=g)}return c};g.prototype.getWidestAnnotation=function(){var b=this._view.getModel().getLineCount();return this.getAnnotations(b-1,b)[b-1]};g.prototype.setFirstLine=
function(b){this._firstLine=void 0!==b?b:1};g.prototype._onTextModelChanged=function(b){var a=b.start;b=this._view.getModel();var c=b.getBaseModel?b.getBaseModel().getLineCount():b.getLineCount(),c=(this._firstLine+c-1+"").length;this._numOfDigits!==c&&(this._numOfDigits=c,a=b.getLineAtOffset(a),this._view.redrawLines(a,b.getLineCount(),this))};e.prototype=new d;c.prototype=new d;c.prototype.getRulerStyle=function(){return this._mergeStyle({style:{lineHeight:"1px",fontSize:"1px"}},this._rulerStyle)};
c.prototype._getTooltipContents=function(b,a){if(0===a.length){var c=this._view.getModel(),e=b;c.getBaseModel&&(e=c.getLineStart(e),e=c.getBaseModel().getLineAtOffset(c.mapOffset(e)));return f.formatMessage(k.line,e+1)}return d.prototype._getTooltipContents.call(this,b,a)};c.prototype._mergeAnnotation=function(b,a,c,d){if(0===c)return b||(b={html:"\x26nbsp;",style:{style:{height:3*d+"px"}}},b.style=this._mergeStyle(b.style,a.overviewStyle)),b};b.prototype=new e;b.prototype.onClick=function(b,a){if(void 0!==
b){var c=this._annotationModel;if(c){var d=this._view.getModel(),e=d.getLineStart(b),f=d.getLineEnd(b,!0);d.getBaseModel&&(e=d.mapOffset(e),f=d.mapOffset(f),d=d.getBaseModel());for(var g,c=c.getAnnotations(e,f);!g&&c.hasNext();)f=c.next(),this.isAnnotationTypeVisible(f.type)&&d.getLineAtOffset(f.start)===d.getLineAtOffset(e)&&(g=f);g&&((d=h.Tooltip.getTooltip(this._view))&&d.setTarget(null),g.expanded?g.collapse():g.expand())}}};b.prototype._getTooltipContents=function(b,a){if(0<a.length){var c=this._view.getModel(),
d=c.getLineStart(b);c.getBaseModel&&(d=c.mapOffset(d),c=c.getBaseModel());for(var d=c.getLineAtOffset(d),f=0;f<a.length;f++){var g=a[f];if(this.isAnnotationTypeVisible(g.type)&&c.getLineAtOffset(g.start)===d){if(a[f].expanded)break;return e.prototype._getTooltipContents.call(this,b,[g])}}}return null};b.prototype._onAnnotationModelChanged=function(b){function a(a){for(g=0;g<a.length;g++)if(f.isAnnotationTypeVisible(a[g].type)){var b=a[g].start;d.getBaseModel&&(b=d.mapOffset(b,!0));-1!==b&&(k=Math.min(k,
d.getLineAtOffset(b)))}}if(b.textModelChangedEvent)e.prototype._onAnnotationModelChanged.call(this,b);else{var c=this._view;if(c){var d=c.getModel(),f=this,g,h=d.getLineCount(),k=h;a(b.added);a(b.removed);a(b.changed);b=c.getRulers();for(g=0;g<b.length;g++)c.redrawLines(k,h,b[g])}}};return{Ruler:d,AnnotationRuler:e,LineNumberRuler:g,OverviewRuler:c,FoldingRuler:b}});
define("orion/editor/textDND",["orion/util"],function(k){function l(h,f){this._view=h;this._undoStack=f;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var d=this;this._listener={onDragStart:function(f){d._onDragStart(f)},onDragEnd:function(f){d._onDragEnd(f)},onDragEnter:function(f){d._onDragEnter(f)},onDragOver:function(f){d._onDragOver(f)},onDrop:function(f){d._onDrop(f)},onDestroy:function(f){d._onDestroy(f)}};h.addEventListener("DragStart",this._listener.onDragStart);h.addEventListener("DragEnd",
this._listener.onDragEnd);h.addEventListener("DragEnter",this._listener.onDragEnter);h.addEventListener("DragOver",this._listener.onDragOver);h.addEventListener("Drop",this._listener.onDrop);h.addEventListener("Destroy",this._listener.onDestroy)}l.prototype={destroy:function(){var h=this._view;h&&(h.removeEventListener("DragStart",this._listener.onDragStart),h.removeEventListener("DragEnd",this._listener.onDragEnd),h.removeEventListener("DragEnter",this._listener.onDragEnter),h.removeEventListener("DragOver",
this._listener.onDragOver),h.removeEventListener("Drop",this._listener.onDrop),h.removeEventListener("Destroy",this._listener.onDestroy),this._view=null)},_onDestroy:function(h){this.destroy()},_onDragStart:function(h){var f=this._view,d=f.getSelection(),f=f.getModel();f.getBaseModel&&(d.start=f.mapOffset(d.start),d.end=f.mapOffset(d.end),f=f.getBaseModel());if(f=f.getText(d.start,d.end))this._dragSelection=d,h.event.dataTransfer.effectAllowed="copyMove",h.event.dataTransfer.setData("Text",f)},_onDragEnd:function(h){if(this._dragSelection){var f=
this._view,d=h.event.dataTransfer.dropEffect;if(!k.isFirefox&&("none"!==d||this._dropText))d=h.event.dataTransfer.dropEffect=this._dropEffect;this._undoStack&&this._undoStack.startCompoundChange();(h="move"===d)&&f.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var d=this._dropText,g=this._dropOffset;h&&(g>=this._dragSelection.end?g-=this._dragSelection.end-this._dragSelection.start:g>=this._dragSelection.start&&(g=this._dragSelection.start));f.setText(d,g,g);f.setSelection(g,
g+d.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(h){this._onDragOver(h)},_onDragOver:function(h){var f=h.event.dataTransfer.types,d=!this._view.getOptions("readonly");d&&f&&(d=f.contains?f.contains("text/plain")||f.contains("Text"):-1!==f.indexOf("text/plain")||-1!==f.indexOf("Text"));d?k.isFirefox||(this._dropEffect=h.event.dataTransfer.dropEffect=(k.isMac?h.event.altKey:h.event.ctrlKey)?"copy":
"move"):h.event.dataTransfer.dropEffect="none"},_onDrop:function(h){var f=this._view,d=h.event.dataTransfer.getData("Text");d&&(k.isFirefox||(h.event.dataTransfer.dropEffect=this._dropEffect),h=f.getOffsetAtLocation(h.x,h.y),this._dragSelection?(this._dropOffset=h,this._dropText=d):(f.setText(d,h,h),f.setSelection(h,h+d.length)))}};return{TextDND:l}});
define("orion/editor/templates",[],function(){function k(h,f,d,g){this.prefix=h;this.description=f;this.template=d;this.name=g;this._parse()}function l(h,f){this._keywords=h||[];this._templates=[];this.addTemplates(f||[])}k.prototype={getProposal:function(h,f,d){h=f-h.length;f={};var g,e=void 0!==d.delimiter?d.delimiter:"\n";d.indentation&&(e+=d.indentation);var c=void 0!==d.tab?d.tab:"\t",b=0,m=this.variables,a=this.segments;d=[];for(var k=0;k<a.length;k++){var l=a[k],r=m[l];if(void 0!==r)switch(l){case "${tab}":l=
c;break;case "${delimiter}":l=e;break;case "${cursor}":l="";g=b;break;default:var s=f[l];s||(s=f[l]={data:r.data,positions:[]});l=r.substitution;s.data&&s.data.values&&(l=s.data.values[0]);s.positions.push({offset:h+b,length:l.length})}d.push(l);b+=l.length}var e=[],t;for(t in f)f.hasOwnProperty(t)&&e.push(f[t]);d=d.join("");void 0===g&&(g=d.length);return{proposal:d,name:this.name,description:this.description,groups:e,escapePosition:h+g,style:"noemphasis"}},match:function(h){return 0===this.prefix.indexOf(h)},
_parse:function(){var h=this.template,f=[],d={},g,e=0,h=h.replace(/\n/g,"${delimiter}"),h=h.replace(/\t/g,"${tab}");h.replace(/\$\{((?:[^\\}]+|\\.))*\}/g,function(c,b,m){var a=c.substring(2,c.length-1);b=c;var k=a,l=null,r=k.indexOf(":");-1!==r&&(k=k.substring(0,r),b="${"+k+"}",l=JSON.parse(a.substring(r+1).replace("\\}","}").trim()));(a=d[b])||(a=d[b]={});a.substitution=k;l&&(a.data=l);(g=h.substring(e,m))&&f.push(g);f.push(b);e=m+c.length;return k});(g=h.substring(e,h.length))&&f.push(g);this.segments=
f;this.variables=d}};l.prototype={addTemplates:function(h){for(var f=this.getTemplates(),d=0;d<h.length;d++)f.push(new k(h[d].prefix,h[d].description,h[d].template,h[d].name))},computeProposals:function(h,f,d){var g=this.getPrefix(h,f,d),e=[];this.isValid(g,h,f,d)&&(e=e.concat(this.getTemplateProposals(g,f,d)),e=e.concat(this.getKeywordProposals(g)));return e},getKeywords:function(){return this._keywords},getKeywordProposals:function(h){var f=[],d=this.getKeywords();if(d){for(var g=0;g<d.length;g++)0===
d[g].indexOf(h)&&f.push({proposal:d[g].substring(h.length),description:d[g],style:"noemphasis_keyword"});0<f.length&&f.splice(0,0,{proposal:"",description:"Keywords",style:"noemphasis_title_keywords",unselectable:!0})}return f},getPrefix:function(h,f,d){return d.prefix},getTemplates:function(){return this._templates},getTemplateProposals:function(h,f,d){for(var g=[],e=this.getTemplates(),c=0;c<e.length;c++){var b=e[c];b.match(h)&&(b=b.getProposal(h,f,d),this.removePrefix(h,b),g.push(b))}0<g.length&&
(g.sort(function(b,a){return b.name<a.name?-1:b.name>a.name?1:0}),g.splice(0,0,{proposal:"",description:"Templates",style:"noemphasis_title",unselectable:!0}));return g},removePrefix:function(h,f){if(!(f.overwrite=f.proposal.substring(0,h.length)!==h))f.proposal=f.proposal.substring(h.length)},isValid:function(h,f,d,g){return!0}};return{Template:k,TemplateContentAssist:l}});
define("orion/editor/linkedMode","i18n!orion/editor/nls/messages orion/keyBinding orion/editor/keyModes orion/editor/annotations orion/editor/templates orion/objects orion/util".split(" "),function(k,l,h,f,d,g){function e(b,c,a){var d=b.getTextView();h.KeyMode.call(this,d);this.editor=b;this.undoStack=c;this.contentAssist=a;this.linkedModeModel=null;d.setAction("linkedModeEnter",function(){this.exitLinkedMode(!0);return!0}.bind(this));d.setAction("linkedModeCancel",function(){this.exitLinkedMode(!1);
return!0}.bind(this));d.setAction("linkedModeNextGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup((a.selectedGroupIndex+1)%a.groups.length);return!0}.bind(this));d.setAction("linkedModePreviousGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup(0<a.selectedGroupIndex?a.selectedGroupIndex-1:a.groups.length-1);return!0}.bind(this));this.linkedModeListener={onActivating:function(a){this._groupContentAssistProvider&&(this.contentAssist.setProviders([this._groupContentAssistProvider]),
this.contentAssist.setProgress(null))}.bind(this),onModelChanged:function(a){if(!this.ignoreVerify){for(var b=this.editor.mapOffset(a.start),c=this.linkedModeModel,d,e;c;)if(d=this._getPositionChanged(c,b,b+a.removedCharCount),e=d.position,void 0===e||e.model!==c)this.exitLinkedMode(!1),c=this.linkedModeModel;else break;if(c){c=0;a=a.addedCharCount-a.removedCharCount;d=d.positions;for(var f,g=0;g<d.length;++g){f=d[g];e=f.position;var h=e.offset<=b&&b<=e.offset+e.length;h&&!f.ansestor?(e.offset+=c,
e.length+=a,c+=a):(e.offset+=c,f.ansestor&&h&&(e.length+=a));f.escape&&(f.model.escapePosition=e.offset)}this._updateAnnotations(d)}}}.bind(this),onVerify:function(a){if(!this.ignoreVerify){for(var b=this.editor,c=b.mapOffset(a.start),d=this.editor.mapOffset(a.end),e=this.linkedModeModel,f,g;e;)if(f=this._getPositionChanged(e,c,d),g=f.position,void 0===g||g.model!==e)this.exitLinkedMode(!1),e=this.linkedModeModel;else break;if(e){var h=this._compoundChange;h?h.owner.model===e&&h.owner.group===g.group||
(this.endUndo(),this.startUndo()):this.startUndo();e.selectedGroupIndex=g.group;var h=0,m=a.text.length-(d-c);f=f.positions;for(var k,c=c-g.position.offset,n=d-g.position.offset,l=0;l<f.length;++l)k=f[l],d=k.position,k.oldOffset=d.offset,k.model===e&&k.group===g.group?(d.offset+=h,d.length+=m,h+=m):(d.offset+=h,k.ansestor&&(d.length+=g.count*m)),k.escape&&(k.model.escapePosition=d.offset);this.ignoreVerify=!0;for(l=f.length-1;0<=l;l--)k=f[l],k.model===e&&k.group===g.group&&b.setText(a.text,k.oldOffset+
c,k.oldOffset+n);this.ignoreVerify=!1;a.text=null;this._updateAnnotations(f)}}}.bind(this)}}var c={};e.prototype=new h.KeyMode;g.mixin(e.prototype,{createKeyBindings:function(){var b=l.KeyBinding,c=[];c.push({actionID:"linkedModeEnter",keyBinding:new b(13)});c.push({actionID:"linkedModeCancel",keyBinding:new b(27)});c.push({actionID:"linkedModeNextGroup",keyBinding:new b(9)});c.push({actionID:"linkedModePreviousGroup",keyBinding:new b(9,!1,!0)});return c},enterLinkedMode:function(b){if(!this.linkedModeModel){var c=
this.editor.getTextView();c.addKeyMode(this);c.addEventListener("Verify",this.linkedModeListener.onVerify);c.addEventListener("ModelChanged",this.linkedModeListener.onModelChanged);this.contentAssist.addEventListener("Activating",this.linkedModeListener.onActivating);this.editor.reportStatus(k.linkedModeEntered,null,!0)}this._sortedPositions=null;this.linkedModeModel&&(b.previousModel=this.linkedModeModel,b.parentGroup=this.linkedModeModel.selectedGroupIndex,this.linkedModeModel.nextModel=b);this.linkedModeModel=
b;this.selectLinkedGroup(0)},exitLinkedMode:function(b){if(this.isActive()){this._compoundChange&&(this.endUndo(),this._compoundChange=null);this._sortedPositions=null;var c=this.linkedModeModel;this.linkedModeModel=c.previousModel;c.parentGroup=c.previousModel=void 0;this.linkedModeModel&&(this.linkedModeModel.nextModel=void 0);if(!this.linkedModeModel){var a=this.editor,d=a.getTextView();d.removeKeyMode(this);d.removeEventListener("Verify",this.linkedModeListener.onVerify);d.removeEventListener("ModelChanged",
this.linkedModeListener.onModelChanged);d=this.contentAssist;d.removeEventListener("Activating",this.linkedModeListener.onActivating);d.offset=void 0;this.editor.reportStatus(k.linkedModeExited,null,!0);b&&a.setCaretOffset(c.escapePosition,!1)}this.selectLinkedGroup(0)}},startUndo:function(){if(this.undoStack){var b=this,c=this.linkedModeModel;this._compoundChange=this.undoStack.startCompoundChange({model:c,group:c.selectedGroupIndex,end:function(){b._compoundChange=null}})}},endUndo:function(){this.undoStack&&
this.undoStack.endCompoundChange()},isActive:function(){return!!this.linkedModeModel},isStatusActive:function(){return!!this.linkedModeModel},selectLinkedGroup:function(b){var c=this.linkedModeModel;if(c){c.selectedGroupIndex=b;b=c.groups[b];var a=b.positions[0],e=this.editor;e.setSelection(a.offset,a.offset+a.length);if(c=this.contentAssist)c.offset=void 0,b.data&&"link"===b.data.type&&b.data.values?((this._groupContentAssistProvider=new d.TemplateContentAssist(b.data.values)).getPrefix=function(){var b=
e.getSelection();return b.start===b.end&&(b=e.getCaretOffset(),a.offset<=b&&b<=a.offset+a.length)?e.getText(a.offset,b):""},c.offset=a.offset,c.deactivate(),c.activate()):this._groupContentAssistProvider&&(this._groupContentAssistProvider=null,c.deactivate())}this._updateAnnotations()},_getModelPositions:function(b,c,a){for(var d=c.groups,e=0;e<d.length;e++)for(var f=d[e].positions,g=0;g<f.length;g++){var h=f[g];a&&(h={offset:h.offset+a,length:h.length});h={index:g,group:e,count:f.length,model:c,
position:h};b.push(h);c.nextModel&&c.nextModel.parentGroup===e&&(h.ansestor=!0,this._getModelPositions(b,c.nextModel,(a||0)+f[g].offset-f[0].offset))}},_getSortedPositions:function(b){var c=this._sortedPositions;if(!c){for(c=[];b.previousModel;)b=b.previousModel;for(this._getModelPositions(c,b);b;)void 0!==b.escapePosition&&c.push({escape:!0,model:b,position:{offset:b.escapePosition,length:0}}),b=b.nextModel;c.sort(function(a,b){return a.position.offset-b.position.offset});this._sortedPositions=c}return c},
_getPositionChanged:function(b,c,a){var d;b=this._getSortedPositions(b);for(var e=b.length-1;0<=e;e--){var f=b[e].position;if(f.offset<=c&&a<=f.offset+f.length){d=b[e];break}}return{position:d,positions:b}},_updateAnnotations:function(b){var c=this.editor.getAnnotationModel();if(c){var a=[],d=[];c.getTextModel();for(var e=c.getAnnotations(),g;e.hasNext();)switch(g=e.next(),g.type){case f.AnnotationType.ANNOTATION_LINKED_GROUP:case f.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case f.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:a.push(g)}if(e=
this.linkedModeModel){b=b||this._getSortedPositions(e);for(var h=0;h<b.length;h++)if(g=b[h],g.model===e){var k=f.AnnotationType.ANNOTATION_LINKED_GROUP;g.group===e.selectedGroupIndex&&(k=0===g.index?f.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:f.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP);g=g.position;g=f.AnnotationType.createAnnotation(k,g.offset,g.offset+g.length,"");d.push(g)}}c.replaceAnnotations(a,d)}}});c.LinkedMode=e;return c});
define("orion/editor/factories","orion/editor/actions orion/editor/undoStack orion/editor/rulers orion/editor/annotations orion/editor/textDND orion/editor/linkedMode".split(" "),function(k,l,h,f,d,g){function e(){}function c(){}function b(){}function m(){}function a(){}function n(){}var q={};e.prototype={createKeyBindings:function(a,b,c,d){d=new k.TextActions(a,b,d);var e=new g.LinkedMode(a,b,c);a=new k.SourceCodeActions(a,b,c,e);return{textActions:d,linkedMode:e,sourceCodeActions:a}}};q.KeyBindingsFactory=
e;c.prototype={createUndoStack:function(a){a=a.getTextView();return new l.UndoStack(a,200)}};q.UndoFactory=c;b.prototype={createLineNumberRuler:function(a){return new h.LineNumberRuler(a,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};q.LineNumberRulerFactory=b;m.prototype={createFoldingRuler:function(a){return new h.FoldingRuler(a,"left",{styleClass:"ruler folding"})}};q.FoldingRulerFactory=m;a.prototype={createAnnotationModel:function(a){return new f.AnnotationModel(a)},
createAnnotationStyler:function(a,b){return new f.AnnotationStyler(a,b)},createAnnotationRulers:function(a){var b=new h.AnnotationRuler(a,"left",{styleClass:"ruler annotations"});a=new h.OverviewRuler(a,"right",{styleClass:"ruler overview"});return{annotationRuler:b,overviewRuler:a}}};q.AnnotationFactory=a;n.prototype={createTextDND:function(a,b){return new d.TextDND(a.getTextView(),b)}};q.TextDNDFactory=n;return q});
define("orion/editor/editorFeatures",["orion/editor/factories","orion/editor/actions","orion/editor/linkedMode","orion/objects"],function(k,l,h,f){return f.mixin({},k,l,h)});define("text!orion/compare/sideBySideTemplate.html",[],function(){return'\x3cdiv id\x3d"topWidget_id" style\x3d"height:100%;width:100%;position:relative"\x3e\n\t\x3cdiv class\x3d"leftPanelLayout "\x3e\n\t\t\x3cdiv class\x3d"titleActionContainer"\x3e\n\t\t\t\x3cdiv class\x3d"compareActionContainer" id\x3d"left_action_id"\x3e\x3c/div\x3e\n\t\t\t\x3cdiv class\x3d"titleContainer" id\x3d"left_title_id"\x3e\x3c/div\x3e\n\t\t\x3c/div\x3e\n\t\t\x3cdiv class\x3d"compareEditorParent" id\x3d"left_editor_id"\x3e\x3c/div\x3e\n\t\t\x3cdiv class\x3d"statusContainer" id\x3d"left_status_id"\x3e\x3c/div\x3e\n\t\x3c/div\x3e\n\t\x3cdiv class\x3d"split compareSplitLayout"\x3e\x3c/div\x3e\n\t\x3cdiv class\x3d"rightPanelLayout"\x3e\n\t\t\x3cdiv class\x3d"titleActionContainer"\x3e\n\t\t\t\x3cdiv class\x3d"compareActionContainer" id\x3d"right_action_id"\x3e\x3c/div\x3e\n\t\t\t\x3cdiv class\x3d"titleContainer" id\x3d"right_title_id"\x3e\x3c/div\x3e\n\t\t\x3c/div\x3e\n\t\t\x3cdiv class\x3d"compareEditorParent"  id\x3d"right_editor_wrapper_id"\x3e\n\t\t\t\x3cdiv class\x3d"canvasContainer"\x3e\n\t\t\t\t\x3ccanvas id\x3d"diff_canvas_id" class\x3d"compareCanvas" width\x3d"46" height\x3d"3000"\x3e\x3c/canvas\x3e\n\t\t\t\x3c/div\x3e\n\t\t\t\x3cdiv class\x3d"compareEditorParentWithCanvas" id\x3d"right_editor_id"\x3e\x3c/div\x3e\n\t\t\x3c/div\x3e\n\t\t\x3cdiv class\x3d"statusContainer" id\x3d"right_status_id"\x3e\x3c/div\x3e\n\t\x3c/div\x3e\n\x3c/div\x3e'});
define("orion/compare/compareUIFactory",["orion/webui/littlelib","orion/webui/splitter","text!orion/compare/sideBySideTemplate.html"],function(k,l,h){var f=f||{};f.TwoWayCompareUIFactory=function(){function d(d){this._parentDivID=d.parentDivID;this._commandSpanId=d.commandSpanId;this._showTitle=d.showTitle;this._leftTitle=d.leftTitle;this._rightTitle=d.rightTitle;this._showLineStatus=d.showLineStatus}d.prototype={_init:function(){var d=this._parentDivID+"_";this._topWidgetDiv=k.node("topWidget_id");
this._topWidgetDiv.id=d+"topWidget_id";this._leftEditorParentDiv=k.node("left_editor_id");this._leftEditorParentDiv.id=d+"left_editor_id";this._rightEditorParentDiv=k.node("right_editor_id");this._rightEditorParentDiv.id=d+"right_editor_id";this._rightEditorWrapperDiv=k.node("right_editor_wrapper_id");this._rightEditorWrapperDiv.id=d+"right_editor_wrapper_id";this._leftActionDiv=k.node("left_action_id");this._leftActionDiv.id=d+"left_action_id";this._rightActionDiv=k.node("right_action_id");this._rightActionDiv.id=
d+"right_action_id";this._leftTitleDiv=k.node("left_title_id");this._leftTitleDiv.id=d+"left_title_id";this._rightTitleDiv=k.node("right_title_id");this._rightTitleDiv.id=d+"right_title_id";this._leftStatusDiv=k.node("left_status_id");this._leftStatusDiv.id=d+"left_status_id";this._rightStatusDiv=k.node("right_status_id");this._rightStatusDiv.id=d+"right_status_id";this._diffCanvasDiv=k.node("diff_canvas_id");this._diffCanvasDiv.id=d+"diff_canvas_id";this._splitterId=d+"orion_splitter";this._showTitle||
this.disableTitle();this._showLineStatus||this.disableLineStatus()},_createSplitter:function(){var d=k.$(".split",this._topWidgetDiv);d.id=this._splitterId;var e=k.$(".leftPanelLayout",this._topWidgetDiv),c=k.$(".rightPanelLayout",this._topWidgetDiv);d&&e&&c&&(this._splitter=new l.Splitter({node:d,sidePanel:e,mainPanel:c}))},buildUI:function(){k.node(this._parentDivID).innerHTML=h;this._init();this._createSplitter()},destroy:function(){},getSplitter:function(){return this._splitter},isLeftPane:function(d){return k.$(".leftPanelLayout",
this._topWidgetDiv)===d},getEditorParentDiv:function(d){return d?this._leftEditorParentDiv:this._rightEditorParentDiv},getTitleDiv:function(d){return d?this._leftTitleDiv:this._rightTitleDiv},getActionDivId:function(d){return d?this._leftActionDiv.id:this._rightActionDiv.id},getStatusDiv:function(d){return d?this._leftStatusDiv:this._rightStatusDiv},getCommandSpanId:function(){return this._commandSpanId},getDiffCanvasDiv:function(){return this._diffCanvasDiv},disableTitle:function(){this._leftEditorParentDiv.style.top=
"0px";this._rightEditorWrapperDiv.style.top="0px";this._leftTitleDiv.style.height="0px";this._rightTitleDiv.style.height="0px"},disableLineStatus:function(){this._leftEditorParentDiv.style.marginBottom="0px";this._rightEditorWrapperDiv.style.marginBottom="0px";this._leftStatusDiv.style.height="0px";this._rightStatusDiv.style.height="0px"}};return d}();return f});
var JsDiff=function(){function k(c){for(var b=[],d=0;d<c.length;d++)c[d]&&b.push(c[d]);return b}function l(c){c=c.replace(/&/g,"\x26amp;");c=c.replace(/</g,"\x26lt;");c=c.replace(/>/g,"\x26gt;");return c.replace(/"/g,"\x26quot;")}var h=function(c){this.ignoreWhitespace=c};h.prototype={diff:function(c,b){if(b==c)return[{value:b}];if(!b)return[{value:c,removed:!0}];if(!c)return[{value:b,added:!0}];b=this.tokenize(b);c=this.tokenize(c);var d=b.length,a=c.length,e=d+a,f=[{newPos:-1,components:[]}],g=
this.extractCommon(f[0],b,c,0);if(f[0].newPos+1>=d&&g+1>=a)return f[0].components;for(var h=1;h<=e;h++)for(var k=-1*h;k<=h;k+=2){var l;l=f[k-1];var v=f[k+1],g=(v?v.newPos:0)-k;l&&(f[k-1]=void 0);var u=l&&l.newPos+1<d,z=v&&0<=g&&g<a;if(!u&&!z)f[k]=void 0;else{!u||z&&l.newPos<v.newPos?(l={newPos:v.newPos,components:v.components.slice(0)},this.pushComponent(l.components,c[g],void 0,!0)):(l={newPos:l.newPos,components:l.components.slice(0)},l.newPos++,this.pushComponent(l.components,b[l.newPos],!0,void 0));
g=this.extractCommon(l,b,c,k);if(l.newPos+1>=d&&g+1>=a)return l.components;f[k]=l}}},pushComponent:function(c,b,d,a){var e=c[c.length-1];e&&e.added===d&&e.removed===a?c[c.length-1]={value:this.join(e.value,b),added:d,removed:a}:c.push({value:b,added:d,removed:a})},extractCommon:function(c,b,d,a){var e=b.length,f=d.length,g=c.newPos;for(a=g-a;g+1<e&&a+1<f&&this.equals(b[g+1],d[a+1]);)g++,a++,this.pushComponent(c.components,b[g],void 0,void 0);c.newPos=g;return a},equals:function(c,b){var d=/\S/;return this.ignoreWhitespace&&
!d.test(c)&&!d.test(b)?!0:c==b},join:function(c,b){return c+b},tokenize:function(c){return c}};var f=new h,d=new h(!1);d.tokenize=function(c){return k(c.split(/(\s+|\b)/))};var g=new h(!0);g.tokenize=function(c){return k(c.split(/([{}:;,]|\s+)/))};var e=new h;e.tokenize=function(c){return c.split(/^/m)};return{diffChars:function(c,b){return f.diff(c,b)},diffWords:function(c,b){return d.diff(c,b)},diffLines:function(c,b){return e.diff(c,b)},diffCss:function(c,b){return g.diff(c,b)},createPatch:function(c,
b,d,a,f){var g=[];g.push("Index: "+c);g.push("\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d");g.push("--- "+c+"\t"+a);g.push("+++ "+c+"\t"+f);c=e.diff(b,d);c.push({value:"",lines:[]});d=b=0;a=[];for(var h=f=1,k=0;k<c.length;k++){var l=c[k],w=l.lines||l.value.replace(/\n$/,"").split("\n");
l.lines=w;if(l.added||l.removed){if(!b){var v=c[k-1];b=f;d=h;v&&(a.push.apply(a,v.lines.slice(-4).map(function(a){return" "+a})),b-=4,d-=4)}a.push.apply(a,w.map(function(a){return(l.added?"+":"-")+a}));l.added?h+=w.length:f+=w.length}else b&&(8>=w.length&&k<c.length-1?a.push.apply(a,w.map(function(a){return" "+a})):(v=Math.min(w.length,4),g.push("@@ -"+b+","+(f-b+v)+" +"+d+","+(h-d+v)+" @@"),g.push.apply(g,a),g.push.apply(g,w.slice(0,v).map(function(a){return" "+a})),d=b=0,a=[])),f+=w.length,h+=w.length}1<
c.length&&!/\n$/.test(c[c.length-2].value)&&g.push("\\ No newline at end of file\n");return g.join("\n")},convertChangesToXML:function(c){for(var b=[],d=0;d<c.length;d++){var a=c[d];a.added?b.push("\x3cins\x3e"):a.removed&&b.push("\x3cdel\x3e");b.push(l(a.value));a.added?b.push("\x3c/ins\x3e"):a.removed&&b.push("\x3c/del\x3e")}return b.join("")}}}();"undefined"!==typeof module&&(module.exports=JsDiff);"function"===typeof define&&define.amd&&define("jsdiff/diff",[],function(){return JsDiff});
define("orion/compare/jsdiffAdapter",["jsdiff/diff"],function(k){var l=l||{};l.JSDiffAdapter=function(){function h(){}h.prototype={_specialLine:function(f,d,g){return d.value===f&&g!==f},adapt:function(f,d,g){g||(g="\n");var e=f.split(g),c=d.split(g),b=""===e[e.length-1],c=""===c[c.length-1],h=k.diffLines(f,d);f=[];d=[];for(var a=0,n=0,l=-1,r=0,s=!0,t=g,w=0;w<h.length;w++){var v=h[w],u=v.lines||v.value.split(g),z=u.length,x=0;1<u.length&&""===u[u.length-1]&&z--;1<z&&!s&&""===u[0]&&(z--,x++);v.lines=
u;if(!v.added&&!v.removed){if(!this._specialLine(g,v,t)){if(a||n)f.push([a,n,l]),n=a=0,l=-1,r+=n;f.push([z,z,0]);r+=z}}else if(v.added){-1===l&&(l=d.length+1);a+=z;for(s=x;s<z+x;s++)d.push(v.lines[s])}else n+=z;s=!1;1<u.length&&""===u[u.length-1]&&(s=!0);t=v.value?v.value[v.value.length-1]:g}if(a||n)f.push([a,n,l]),r+=n;r<e.length&&1<e.length&&(g=f[f.length-1],0===g[2]?(g[0]+=1,g[1]+=1):-1===g[2]?f.push([1,1,0]):b===c?f.push([1,1,0]):(c&&(g[0]+=1),b&&(g[1]+=1)));return{mapper:f,changContents:{array:d,
index:0}}},adaptCharDiff:function(f,d,g){f=g?k.diffWords(f,d):k.diffChars(f,d);d=[];for(var e=g=0,c=0,b=0,h=0;h<f.length;h++){var a=f[h];if(!a.added&&!a.removed){if(0<c||0<b)d.push([e,e+c,g,g+b]),e+=c,g+=b,b=c=0;e+=a.value.length;g+=a.value.length}else a.added?c+=a.value.length:b+=a.value.length}(0<c||0<b)&&d.push([e,e+c,g,g+b]);return d}};return h}();return l});
define("orion/compare/diffTreeNavigator",["orion/treeModelIterator","orion/compare/compareUtils","orion/editor/annotations","orion/compare/jsdiffAdapter"],function(k,l,h,f){var d={},g,e,c,b,m,a,n,q,r,s,t,w,v,u,z,x;d.DiffTreeNavigator=function(){function d(a,b,c,e,f,g){this._root={type:"root",children:[]};this._initialized=!1;this.initAll(a,b,c,e,f,g)}g="orion.annotation.diff.addedBlock";e="orion.annotation.diff.currentAddedBlock";c="orion.annotation.diff.deletedBlock";b="orion.annotation.diff.currentDeletedBlock";
m="orion.annotation.diff.blockTop";a="orion.annotation.diff.currentBlockTop";n="orion.annotation.diff.blockConflict";q="orion.annotation.diff.currentBlockConflict";r="orion.annotation.diff.addedWord";s="orion.annotation.diff.currentAddedWord";t="orion.annotation.diff.deletedWord";w="orion.annotation.diff.currentDeletedWord";v="orion.annotation.diff.emptyDeletedWordLeft";u="orion.annotation.diff.emptyDeletedWordRight";z="orion.annotation.diff.emptyAddedWordLeft";x="orion.annotation.diff.emptyAddedWordRight";
h.AnnotationType.registerType(g,{title:"",html:"",lineStyle:{styleClass:"annotationLine addedBlockDiff"}});h.AnnotationType.registerType(e,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentAddedBlockDiff"}});h.AnnotationType.registerType(c,{title:"",html:"",lineStyle:{styleClass:"annotationLine deletedBlockDiff"}});h.AnnotationType.registerType(b,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentDeletedBlockDiff"}});h.AnnotationType.registerType(m,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffTopOnly"}});
h.AnnotationType.registerType(a,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffTopOnly"}});h.AnnotationType.registerType(n,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffConflict"}});h.AnnotationType.registerType(q,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffConflict"}});h.AnnotationType.registerType(r,{title:"word added",html:"",rangeStyle:{styleClass:"annotationRange addedWordDiff"}});h.AnnotationType.registerType(s,{title:"",
html:"",rangeStyle:{styleClass:"annotationRange currentAddedWordDiff"}});h.AnnotationType.registerType(t,{title:"word deleted",html:"",rangeStyle:{styleClass:"annotationRange deletedWordDiff"}});h.AnnotationType.registerType(w,{title:"",html:"",rangeStyle:{styleClass:"annotationRange currentDeletedWordDiff"}});h.AnnotationType.registerType(v,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffLeft"}});h.AnnotationType.registerType(u,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffRight"}});
h.AnnotationType.registerType(z,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffLeft"}});h.AnnotationType.registerType(x,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffRight"}});d.prototype={initAll:function(a,b,c,d,e,f,g){this._charOrWordDiff=a?a:"word";b&&(this._initialized=!0);this.editorWrapper=[{editor:b,diffFeeder:d},{editor:c,diffFeeder:e}];this._curveRuler=g;(this._overviewRuler=f)&&this._overviewRuler.setDiffNavigator(this)},initMapper:function(a){if(a)for(var b=
0;b<this.editorWrapper.length;b++)this.editorWrapper[b].diffFeeder.init(this.editorWrapper[b].editor.getTextView().getModel(),a)},destroy:function(){this.initAll(this._charOrWordDiff)},renderAnnotations:function(){var a;for(a=0;a<this.editorWrapper.length;a++){this.editorWrapper[a].annoTypes=[];this.editorWrapper[a].diffFeeder.getBlockAnnoTypes(this.editorWrapper[a].annoTypes);this.editorWrapper[a].diffFeeder.getWordAnnoTypes(this.editorWrapper[a].annoTypes);for(var b=0;b<this.editorWrapper[a].annoTypes.length;b++)this.editorWrapper[a].annoTypes[b].current&&
this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[b].current),this.editorWrapper[a].annoTypes[b].normal&&this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[b].normal)}this._root.children=[];b=this.editorWrapper[0].diffFeeder.getDiffBlocks();if(!b||0===b.length)this.replaceAllAnnotations(!0,0,"block",!1,[]),this.replaceAllAnnotations(!0,1,"block",!1,[]),this.replaceAllAnnotations(!0,0,"word",!1,[]),
this.replaceAllAnnotations(!0,1,"word",!1,[]),this.replaceAllAnnotations(!0,0,"block",!0,[]),this.replaceAllAnnotations(!0,1,"block",!0,[]),this.replaceAllAnnotations(!0,0,"word",!0,[]),this.replaceAllAnnotations(!0,1,"word",!0,[]);else{var c=new f.JSDiffAdapter;for(a=0;a<b.length;a++){var d=this.generatePairBlockAnnotations(this._root,a);this._root.children.push(d);var e=this.generatePairWordAnnotations(d,a,c);e&&(d.children=e)}this.replaceAllAnnotations(!1,0,"block",!0);this.replaceAllAnnotations(!1,
1,"block",!0);this.replaceAllAnnotations(!1,0,"word",!0);this.replaceAllAnnotations(!1,1,"word",!0);this.iterator=new k.TreeModelIterator(this._root.children)}},replaceAllAnnotations:function(a,b,c,d,e){if(this.editorWrapper[b].annoTypes)for(var f=0;f<this.editorWrapper[b].annoTypes.length;f++)this.editorWrapper[b].annoTypes[f].type===c&&this.replaceDiffAnnotations(this.editorWrapper[b].editor,e?e:this.editorWrapper[b].annoTypes[f].list,d?this.editorWrapper[b].annoTypes[f].normal:this.editorWrapper[b].annoTypes[f].current,
a)},getMapper:function(){return this.editorWrapper[0].diffFeeder.getMapper()},getFeeder:function(a){return a?this.editorWrapper[1].diffFeeder:this.editorWrapper[0].diffFeeder},iterateOnBlock:function(a,b){this.iterator&&(this.iterator.iterateOnTop(a,b),this.updateCurrentAnnotation(!0))},iterateOnChange:function(a){if(!this.iterator)return null;var b=this.iterator.iterate(a);if(b){var c=this.iterator.cursor();"block"===c.type&&c.children&&0<c.children.length&&this.iterator.iterate(a);this.updateCurrentAnnotation(!0)}return b},
gotoBlock:function(a,b){if(this.iterator){if(0>a||a>=this._root.children.length||0===this._root.children.length)a=0;void 0!==b&&0<=b&&this._root.children[a].children&&b<this._root.children[a].children.length?this.iterator.setCursor(this._root.children[a].children[b]):this.iterator.setCursor(this._root.children[a]);this.updateCurrentAnnotation(!1);this._positionDiffBlock()}},_hitDiffAnnotation:function(a,b,c){if(c===this.editorWrapper[a].editor.getTextView()){for(var d=0;d<this._root.children.length;d++){c=
this._root.children[d];var e=0===a?c.oldA:c.newA;if(b>=e.start&&b<=e.end){d=c;if(c.children&&0<c.children.length)for(e=0;e<c.children.length;e++){var f=c.children[e],g=0===a?f.oldA:f.newA;if(b>=g.start&&b<=g.end){d=f;break}}return d}}return null}},gotoChange:function(a,b){for(var c=0;c<this.editorWrapper.length;c++){var d=this._hitDiffAnnotation(c,a,b);if(d)return this.iterator.setCursor(d),this.updateCurrentAnnotation(!1,b),!0}return!1},getCurrentBlockIndex:function(){if(!this.iterator)return-1;
var a=this.iterator.cursor();return!a?-1:"block"===a.type?a.index:a.parent.index},getCurrentPosition:function(){if(!this.iterator)return{};var a=this.iterator.cursor();return"block"===a.type?{block:a.index+1}:{block:a.parent.index+1,change:a.index+1}},getCurrentMapperIndex:function(){var a=this.getCurrentBlockIndex();0>a&&(a=0);var b=this.getFeeder().getDiffBlocks();if(!b||0===b.length)return-1;a>b.length-1&&(a=0);return b[a][1]},replaceDiffAnnotations:function(a,b,c,d){if(b&&c&&(a=a.getAnnotationModel())){for(var e=
a.getAnnotations(),f=[];d&&e.hasNext();){var g=e.next();g.type===c&&f.push(g)}a.replaceAnnotations(f,b)}},updateCurrentAnnotation:function(a,b){this.replaceAllAnnotations(!0,0,"block",!1,[]);this.replaceAllAnnotations(!0,1,"block",!1,[]);this.replaceAllAnnotations(!0,0,"word",!1,[]);this.replaceAllAnnotations(!0,1,"word",!1,[]);if(this.iterator){var c=this.iterator.cursor();if(c){var d,e,f={start:c.oldA.start,end:c.oldA.end},g={start:c.newA.start,end:c.newA.end};"word"===c.type?(d=this.editorWrapper[0].diffFeeder.getCurrentWordAnnoType(f,
this.editorWrapper[0].editor.getTextView().getModel()),e=this.editorWrapper[1].diffFeeder.getCurrentWordAnnoType(g,this.editorWrapper[1].editor.getTextView().getModel())):(d=this.editorWrapper[0].diffFeeder.getCurrentBlockAnnoType(c.index),e=this.editorWrapper[1].diffFeeder.getCurrentBlockAnnoType(c.index));d&&this.replaceDiffAnnotations(this.editorWrapper[0].editor,[new (h.AnnotationType.getType(d.current))(f.start,f.end)],d,!0);e&&this.replaceDiffAnnotations(this.editorWrapper[1].editor,[new (h.AnnotationType.getType(e.current))(g.start,
g.end)],e,!0);a?(this.autoSelecting=!0,this.editorWrapper[0].editor.setSelection(c.oldA.start,c.oldA.end,!0),this.editorWrapper[1].editor.setSelection(c.newA.start,c.newA.end,!0),this.autoSelecting=!1):b&&(this.autoSelecting=!0,b!==this.editorWrapper[0].editor.getTextView()&&this.editorWrapper[0].editor.setSelection(c.oldA.start,c.oldA.end,!0),b!==this.editorWrapper[1].editor.getTextView()&&this.editorWrapper[1].editor.setSelection(c.newA.start,c.newA.end,!0),this.autoSelecting=!1)}}},generatePairBlockAnnotations:function(a,
b){var c=this.generateBlockDiffAnnotations(0,b),d=this.generateBlockDiffAnnotations(1,b);return{parent:a,index:b,type:"block",oldA:c,newA:d}},generatePairWordAnnotations:function(a,b,c){var d=this.editorWrapper[0].diffFeeder.getTextOnBlock(b),e=this.editorWrapper[1].diffFeeder.getTextOnBlock(b),f=0,g=0;if(d&&e&&d.text&&e.text&&5E3>=d.text.length&&5E3>=e.text.length)b=c.adaptCharDiff(d.text,e.text,"word"===this._charOrWordDiff),g=e.start,f=d.start;else return null;c=[];d=[];this.generateWordDiffAnnotations(0,
c,f,b,2,3);this.generateWordDiffAnnotations(1,d,g,b,0,1);b=[];for(f=0;f<c.length;f++)b.push({parent:a,index:f,type:"word",oldA:c[f],newA:d[f]});return b},getAnnoModelList:function(a,b,c){for(var d=0;d<this.editorWrapper[a].annoTypes.length;d++)if(this.editorWrapper[a].annoTypes[d].type===b&&this.editorWrapper[a].annoTypes[d].normal===c)return this.editorWrapper[a].annoTypes[d].list;return null},generateBlockDiffAnnotations:function(a,b){var c=this.editorWrapper[a].diffFeeder.getCurrentBlockAnnoType(b),
d=this.getAnnoModelList(a,"block",c.normal),e=this.editorWrapper[a].diffFeeder.getCharRange(b),c=h.AnnotationType.createAnnotation(c.normal,e.start,e.end);d&&d.push(c);return c},generateWordDiffAnnotations:function(a,b,c,d,e,f){if(d){var g=this.editorWrapper[a].diffFeeder.getCurrentWordAnnoType({start:-1,end:-1});a=this.getAnnoModelList(a,"word",g.normal);for(var k=0;k<d.length;k++){var m=h.AnnotationType.createAnnotation(g.normal,d[k][e]+c,d[k][f]+c);a.push(m);b.push(m)}}},_updateOverviewRuler:function(){if(this._overviewRuler){var a=
this.editorWrapper[0].editor.getTextView().getTopIndex();this.editorWrapper[0].editor.getTextView().redrawLines(a,a+1,this._overviewRuler)}},_updateCurveRuler:function(){this._curveRuler&&this._curveRuler.render()},_setTextViewPosition:function(a,b){var c=a.getLineHeight(),d=a.getClientArea(),c=Math.floor(d.height/c/3);a.setTopIndex(0<b-c?b-c:0)},_positionDiffBlock:function(){var a=this.getCurrentBlockIndex();0>a&&(a=0);var b=this.getFeeder().getDiffBlocks();0!==b.length&&(this._setTextViewPosition(this.editorWrapper[0].editor.getTextView(),
b[a][0]),this.editorWrapper[0].editor!==this.editorWrapper[1].editor&&(a=l.lookUpLineIndex(this.getMapper(),0,b[a][1]),this._setTextViewPosition(this.editorWrapper[1].editor.getTextView(),a)),this._updateOverviewRuler(),this._updateCurveRuler())},matchPositionFromOverview:function(a){this._initialized&&(a=0>a?0:l.getAnnotationIndex(this.getFeeder().getDiffBlocks(),a),this.gotoBlock(a))},gotoDiff:function(a,b){this.gotoChange(a,b)&&(this._updateOverviewRuler(),this._updateCurveRuler())},nextDiff:function(){this.iterateOnBlock(!0,
!0);this._positionDiffBlock()},prevDiff:function(){this.iterateOnBlock(!1,!0);this._positionDiffBlock()},nextChange:function(){var a=this.iterateOnChange(!0);this._positionDiffBlock();return a},prevChange:function(){this.iterateOnChange(!1);this._positionDiffBlock()}};return d}();d.DiffBlockFeeder=function(){function a(){}a.prototype={_isAddedSide:function(){return 0===this._mapperColumnIndex},getWordAnnoTypes:function(a){this._isAddedSide()?a.push({type:"word",current:s,normal:r,list:[]}):a.push({type:"word",
current:w,normal:t,list:[]});a.push({type:"word",current:v});a.push({type:"word",current:u});a.push({type:"word",current:z});a.push({type:"word",current:x})},getCurrentWordAnnoType:function(a,b){return a.start===a.end&&b?this._isAddedSide()?{current:this._repositionEmptyWord(a,b),normal:r}:{current:this._repositionEmptyWord(a,b),normal:t}:this._isAddedSide()?{current:s,normal:r}:{current:w,normal:t}},_repositionEmptyWord:function(a,b){var c=b.getLineAtOffset(a.start),d=b.getLineStart(c),e=b.getLineEnd(c);
if(d!==e){if(a.start===e)return a.start--,this._isAddedSide()?x:u;a.end++}else if(0<c&&(c--,d=b.getLineStart(c),e=b.getLineEnd(c),d!==e))return a.start=e-1,a.end=e,this._isAddedSide()?x:u;return this._isAddedSide()?z:v},getMapper:function(){return this._mapper},getDiffBlocks:function(){return this._diffBlocks},getDiffBlockH:function(a){if(!this._diffBlocks||0===this._diffBlocks.length)return-1;a=this._diffBlocks[a][1];return-1===a?0:this._mapper[a][this._mapperColumnIndex]},getOverviewLineCount:function(){return this._textModel.getLineCount()},
getLineNumber:function(a){return a},getCharRange:function(a){if(!this._diffBlocks||0===this._diffBlocks.length)return null;var b=this._diffBlocks[a][0],c=b+this._mapper[this._diffBlocks[a][1]][this._mapperColumnIndex]-1;a=this._textModel.getLineStart(b);if(c<b)return{start:a,end:a};b=this._textModel.getLineEnd(c,!0);return{start:a,end:b}},getTextOnBlock:function(a){if(!this._diffBlocks||0===this._diffBlocks.length)return null;a=this.getCharRange(a);return{start:a.start,text:this._textModel.getText(a.start,
a.end)}},isMapperEmpty:function(){return 0===this._mapper.length}};return a}();d.TwoWayDiffBlockFeeder=function(){function f(a,b,c,d){this._mapperColumnIndex=c;this._reverseAnnotation=d;this.init(a,b)}f.prototype=new d.DiffBlockFeeder;f.prototype._isAddedSide=function(){return this._reverseAnnotation?0!==this._mapperColumnIndex:0===this._mapperColumnIndex};f.prototype.init=function(a,b){this._textModel=a;this._diffBlocks=void 0;if(b){this._mapper=b;this._diffBlocks=[];for(var c=0,d=0;d<this._mapper.length;d++)0!==
this._mapper[d][2]&&this._diffBlocks.push([c,d]),c+=this._mapper[d][this._mapperColumnIndex]}};f.prototype.getBlockAnnoTypes=function(d){this._isAddedSide()?d.push({type:"block",normal:g,current:e,list:[]}):d.push({type:"block",normal:c,current:b,list:[]});d.push({type:"block",normal:m,current:a,list:[]});d.push({type:"block",normal:n,current:q,list:[]})};f.prototype.getCurrentBlockAnnoType=function(d){if(!this._diffBlocks||0===this._diffBlocks.length||this._diffBlocks.length<=d)return null;d=this._diffBlocks[d][1];
return 0===this._mapper[d][this._mapperColumnIndex]?{normal:m,current:a}:l.isMapperConflict(this.getMapper(),d)?{normal:n,current:q}:this._isAddedSide()?{type:"block",normal:g,current:e,list:[]}:{type:"block",normal:c,current:b,list:[]}};return f}();d.inlineDiffBlockFeeder=function(){function a(b,c){this._mapperColumnIndex=c;this.init(b)}a.prototype=new d.DiffBlockFeeder;a.prototype.setModel=function(a){this._textModel=a};a.prototype.init=function(a){this._diffBlocks=void 0;if(a){this._mapper=a;this._diffBlocks=
[];this._gapBlocks=[];for(var b=a=0,c=0;c<this._mapper.length;c++){if(0!==this._mapper[c][2]){if(this._isAddedSide()){var d=a+this._mapper[c][1];this._diffBlocks.push([d,c]);this._gapBlocks.push([d,d+this._mapper[c][0],b])}else this._diffBlocks.push([a,c]),this._gapBlocks.push([a,a+this._mapper[c][1],b]);a+=this._mapper[c][0]+this._mapper[c][1]}else this._gapBlocks.push([a,a+this._mapper[c][this._mapperColumnIndex],b]),a+=this._mapper[c][this._mapperColumnIndex];b+=this._mapper[c][this._mapperColumnIndex]}}};
a.prototype.getBlockAnnoTypes=function(a){this._isAddedSide()?a.push({type:"block",normal:g,current:e,list:[]}):a.push({type:"block",normal:c,current:b,list:[]});a.push({type:"block",normal:n,current:q,list:[]})};a.prototype.getCurrentBlockAnnoType=function(a){if(!this._diffBlocks||0===this._diffBlocks.length)return null;a=this._diffBlocks[a][1];return 0===this._mapper[a][this._mapperColumnIndex]?{current:s,normal:r}:l.isMapperConflict(this.getMapper(),a)?{normal:n,current:q}:this._isAddedSide()?
{type:"block",normal:g,current:e,list:[]}:{type:"block",normal:c,current:b,list:[]}};a.prototype.getDiffBlockH=function(a){if(!this._diffBlocks||0===this._diffBlocks.length)return-1;a=this._diffBlocks[a][1];return this._mapper[a][0]+this._mapper[a][1]};a.prototype.getLineNumber=function(a){for(var b=0;b<this._gapBlocks.length;b++)if(this._gapBlocks[b][0]!==this._gapBlocks[b][1]&&a>=this._gapBlocks[b][0]&&a<this._gapBlocks[b][1])return a-this._gapBlocks[b][0]+this._gapBlocks[b][2];return-1};return a}();
return d});
define("orion/compare/compareView","i18n!orion/compare/nls/messages orion/Deferred orion/webui/littlelib orion/compare/diffParser orion/compare/compareRulers orion/editor/editor orion/editor/editorFeatures orion/keyBinding orion/editor/textView orion/compare/compareUIFactory orion/compare/compareUtils orion/compare/jsdiffAdapter orion/compare/diffTreeNavigator".split(" "),function(k,l,h,f,d,g,e,c,b,m,a,n,q,r,s,t){var w={};w.CompareView=function(){function a(){this._diffParser=new f.DiffParser}a.prototype=
{_clearOptions:function(){this.options={};this.options.blockNumber=1;this.options.changeNumber=0},_getLineDelim:function(a,b){return"\n"},_generateMapper:function(a,b,c,d,e){var f=this._getLineDelim(a,c);this._diffParser.setLineDelim(f);if(this.options.mapper&&this.options.toggler)return{delim:f,mapper:this.options.mapper,output:this.options.newFile.Content,diffArray:this.options.diffArray};if("string"===typeof b&&"string"===typeof a)return a=(new n.JSDiffAdapter).adapt(a,b,f),this.options.toggler&&
(this.options.mapper=a.mapper,this.options.newFile.Content=b,this.options.diffArray=a.changContents),{delim:f,mapper:a.mapper,output:b,diffArray:a.changContents};b=this._diffParser.parse(a,c,d,e);a=this._diffParser.getDiffArray();this.options.toggler&&(this.options.mapper=b.mapper,this.options.newFile.Content=b.outPutFile,this.options.diffArray=a);return{delim:f,mapper:b.mapper,output:b.outPutFile,diffArray:a}},_loadImageFile:function(a,b,c){var d=document.createElement("img");d.src=a;var e=new l;
d.onload=function(){b.appendChild(d);if(c){var a=document.createElement("hr");b.appendChild(a)}e.resolve(d.height)};d.onerror=function(){e.resolve(0)};return e},_initSyntaxHighlighter:function(a){this._syntaxHighlighters=null;if(this.options.highlighters&&0<this.options.highlighters.length&&!(1>a.length||2<a.length))this._syntaxHighlighters=[{highlighter:this.options.highlighters[0],target:a[0]}],2===a.length&&2===this.options.highlighters.length&&this._syntaxHighlighters.push({highlighter:this.options.highlighters[1],
target:a[1]})},_highlightSyntax:function(){if(this._syntaxHighlighters){var a=[];this._syntaxHighlighters.forEach(function(b){a.push(b.highlighter.highlight(b.target.fileName,b.target.contentType,b.target.editor))}.bind(this));l.all(a,function(a){return{_error:a}}).then(function(a){this._diffNavigator.renderAnnotations();this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1)}.bind(this))}else window.setTimeout(function(){this._diffNavigator.renderAnnotations();this._diffNavigator.gotoBlock(this.options.blockNumber-
1,this.options.changeNumber-1)}.bind(this),50)},setOptions:function(a,b){b&&this._clearOptions();this.options||(this.options={});a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this));if(a.newFileOnRight){var c=this.options.newFile;this.options.newFile=this.options.oldFile;this.options.oldFile=c}},getOptions:function(){return this.options},getCurrentDiffPos:function(){return this._diffNavigator.getCurrentPosition()},initDiffNav:function(){this._diffNavigator.gotoBlock(0,0)},nextDiff:function(){this._diffNavigator.nextDiff()},
prevDiff:function(){this._diffNavigator.prevDiff()},nextChange:function(){return this._diffNavigator.nextChange()},prevChange:function(){this._diffNavigator.prevChange()},getWidget:function(){return this},startup:function(){this.initEditors();this.refresh(!0)},initEditors:function(a){},initImageMode:function(){}};return a}();w.TwoWayCompareView=function(){function a(b){this.setOptions(b,!0);this._diffNavigator=new q.DiffTreeNavigator("word");this.type="twoWay";(this._uiFactory=this.options.uiFactory)||
(this._uiFactory=new m.TwoWayCompareUIFactory({parentDivID:this.options.parentDivId,showTitle:this.options.showTitle?this.options.showTitle:!1,showLineStatus:this.options.showLineStatus?this.options.showLineStatus:!1}),this._uiFactory.buildUI());this._viewLoadedCounter=0;this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._curveRuler=new d.CompareCurveRuler(this._uiFactory.getDiffCanvasDiv())}a.prototype=new w.CompareView;a.prototype.initEditors=function(a){this._editors=
[];this._editors.push(this._createEditor(a,this._uiFactory.getEditorParentDiv(!1),this._uiFactory.getStatusDiv(!1),this.options.oldFile));this._editors.push(this._createEditor(a,this._uiFactory.getEditorParentDiv(!0),this._uiFactory.getStatusDiv(!0),this.options.newFile,!0));this._overviewRuler=new d.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a,b){this._diffNavigator.matchPositionFromOverview(a)}.bind(this));window.onbeforeunload=function(){if(this._editors&&this._editors.some(function(a){return a.isDirty()}))return k["There are unsaved changes."]}.bind(this)};
a.prototype.initImageMode=function(){this._editors&&(this._editors.forEach(function(a){a.destroy()}),this._editors=null);this._uiFactory.getEditorParentDiv(!0).classList.add("compareEditorParentImageMode");this._uiFactory.getEditorParentDiv().classList.add("compareEditorParentImageMode");this._uiFactory.disableTitle();this._uiFactory.disableLineStatus();this._imageMode=!0};a.prototype.getImageMode=function(){return this._imageMode};a.prototype.getEditors=function(){return this._editors};a.prototype.gotoDiff=
function(a,b,c){c=c?this._editors[1].getTextView():this._editors[0].getTextView();a=c.getModel().getLineStart(a)+b;this._diffNavigator.gotoDiff(a,c)};a.prototype.copyToLeft=function(){this._curveRuler.copyTo(!0)};a.prototype.copyToRight=function(){this._curveRuler.copyTo(!1)};a.prototype.resizeEditors=function(){this._editors.forEach(function(a){a.getTextView().resize()})};a.prototype.getSplitter=function(){return this._uiFactory.getSplitter()};a.prototype._createEditor=function(a,c,d,f,h){var m=
"undefined"===typeof f.readonly?!0:f.readonly,n=function(){var a=new b.TextView({parent:c,readonly:m,tabSize:4});this._viewLoadedCounter++;2===this._viewLoadedCounter&&this._diffNavigator.matchPositionFromOverview(-1);if(this.onLoad)this.onLoad();var d=this.getSplitter();d&&d.addResizeListener(function(b){b&&(this._uiFactory.isLeftPane(b)?h:!h)&&a.resize()}.bind(this));return a}.bind(this),l=f.keyBindingFactory;l||(l=new e.KeyBindingsFactory);var q=null;if(d)var r="",q=function(a,b){d&&(r=b?k["ERROR: "]+
a:a,d.textContent=""+r)};n=new g.Editor({textViewFactory:n,undoStackFactory:new e.UndoFactory,annotationFactory:new e.AnnotationFactory,keyBindingFactory:l,statusReporter:q,domNode:c});n.installTextView();n.setInput(null,null,f.Content?f.Content:a);n.setOverviewRulerVisible(!1);var E=n.getTextView();E.addEventListener("Selection",function(a){!(a.newValue&&a.newValue.start!==a.newValue.end)&&!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder&&(a=E.getCaretOffset(),
this._diffNavigator.gotoDiff(a,E))}.bind(this));E.getModel().addEventListener("Changed",function(a){this._curveRuler.onChanged(a,!h)||(this.options.mapper=null)}.bind(this));h?E.addEventListener("Scroll",function(a){this._curveRuler&&(this._curveRuler.matchPositionFrom(!0),this._curveRuler.render());if(this.onScroll)this.onScroll()}.bind(this)):E.addEventListener("Scroll",function(a){this._curveRuler&&this._curveRuler.render()}.bind(this));return n};a.prototype.destroy=function(){this._editors&&(this._diffNavigator.destroy(),
this._editors.forEach(function(a){a.destroy()}),this._uiFactory.destroy())};a.prototype.addRulers=function(){if(this._editors&&!this._hasRuler){var a=new d.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"}),b=new d.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._editors[1].getTextView().addRuler(a);this._editors[0].getTextView().addRuler(b);
this._editors[0].getTextView().addRuler(this._overviewRuler);this._hasRuler=!0}};a.prototype.refresh=function(a){if(this._imageMode){this.options.commandProvider&&this.options.commandProvider.renderCommands(this);var b=this;return this._loadImageFile(this.options.newFile.URL,this._uiFactory.getEditorParentDiv(!0)).then(function(a){return b._loadImageFile(b.options.oldFile.URL,b._uiFactory.getEditorParentDiv()).then(function(b){return(new l).resolve(a>b?a:b)})})}var c=this.options.oldFile.Content,
d=this.options.newFile.Content,e=this.options.diffContent;"string"===typeof d?e=this._generateMapper(c,d,e,this.options.hasConflicts):(e=this._generateMapper(c,d,e,this.options.hasConflicts),d=e.output);var f=new q.TwoWayDiffBlockFeeder(this._editors[0].getTextView().getModel(),e.mapper,1,this.options.newFileOnRight),g=new q.TwoWayDiffBlockFeeder(this._editors[1].getTextView().getModel(),e.mapper,0,this.options.newFileOnRight);this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editors[0],
this._editors[1],f,g,this._overviewRuler,this._curveRuler);this._curveRuler.init(e.mapper,this._editors[1],this._editors[0],this._diffNavigator);a&&(this._editors[1].setInput(this.options.newFile.Name,null,d),this._editors[0].setInput(this.options.oldFile.Name,null,c));this._initSyntaxHighlighter([{fileName:this.options.newFile.Name,contentType:this.options.newFile.Type,editor:this._editors[1]},{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,editor:this._editors[0]}]);this._highlightSyntax();
this.options.commandProvider&&this.options.commandProvider.renderCommands(this);this.addRulers();2===this._viewLoadedCounter&&this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1);this.refreshTitle(0);this.refreshTitle(1);a=this._editors[1].getTextView().getModel().getLineCount()*this._editors[1].getTextView().getLineHeight()+5;c=this._editors[0].getTextView().getModel().getLineCount()*this._editors[0].getTextView().getLineHeight()+5;return a>c?a:c};a.prototype.refreshTitle=
function(a,b){if(1===a){var c=this._uiFactory.getTitleDiv(!0);c&&(h.empty(c),c.appendChild(document.createTextNode(b||this._editors[a].isDirty()?this.options.newFile.Name+"*":this.options.newFile.Name)))}else if(c=this._uiFactory.getTitleDiv(!1))h.empty(c),c.appendChild(document.createTextNode(b||this._editors[a].isDirty()?this.options.oldFile.Name+"*":this.options.oldFile.Name))};return a}();w.InlineCompareView=function(){function c(a){this.setOptions(a,!0);this._diffNavigator=new q.DiffTreeNavigator("word");
this.type="inline";this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._editorDiv=this.options.parentDivId}c.prototype=new w.CompareView;c.prototype.addRulers=function(){this._textView&&!this._hasRuler&&(this._textView.addRuler(this._rulerOrigin),this._textView.addRuler(this._rulerNew),this._textView.addRuler(this._overviewRuler),this._hasRuler=!0)};c.prototype.removeRulers=function(){this._textView&&this._hasRuler&&(this._textView.removeRuler(this._rulerOrigin),this._textView.removeRuler(this._rulerNew),
this._textView.removeRuler(this._overviewRuler),this._hasRuler=!1)};c.prototype.destroyEditor=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.setText(""),this.removeRulers())};c.prototype.destroy=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.destroy())};c.prototype.initEditors=function(a){var c=h.node(this._editorDiv),f=function(){return new b.TextView({parent:c,readonly:!0,tabSize:4})}.bind(this);this._editor=new g.Editor({textViewFactory:f,undoStackFactory:new e.UndoFactory,
annotationFactory:new e.AnnotationFactory,domNode:c});this._editor.installTextView();this._editor.setInput(null,null,a);this._editor.setOverviewRulerVisible(!1);this._editor.setAnnotationRulerVisible(!1);this._textView=this._editor.getTextView();this._rulerOrigin=new d.LineNumberCompareRuler(this._diffNavigator,1,"left",{styleClass:"ruler lines inlineRulerLeft"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._rulerNew=new d.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},
{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._overviewRuler=new d.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a,b){this._diffNavigator.matchPositionFromOverview(a)}.bind(this));this._textView.addEventListener("Selection",function(a){!(a.newValue&&a.newValue.start!==a.newValue.end)&&!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder&&(a=this._textView.getCaretOffset(),this._diffNavigator.gotoDiff(a,this._textView))}.bind(this))};
c.prototype.initImageMode=function(){this._editor&&(this._editor.destroy(),this._editor=null);h.node(this._editorDiv).classList.add("compareEditorParentImageMode");this._imageMode=!0};c.prototype.getImageMode=function(){return this._imageMode};c.prototype._initDiffPosition=function(a){var b=a.getModel();if(b&&b.getAnnotations&&(b=b.getAnnotations(),0<b.length)){var b=b[0][0],c=a.getLineHeight(),d=a.getClientArea(),c=Math.floor(d.height/c/3);a.setTopIndex(0<b-c?b-c:0)}};c.prototype.refresh=function(){if(this._imageMode){this.options.commandProvider&&
this.options.commandProvider.renderCommands(this);var b=this;return this._loadImageFile(this.options.newFile.URL,h.node(this._editorDiv),!0).then(function(a){return b._loadImageFile(b.options.oldFile.URL,h.node(b._editorDiv)).then(function(b){return(new l).resolve(a+b+20)})})}var c=this.options.oldFile.Content,d=this.options.newFile.Content,e=this._generateMapper(c,d,this.options.diffContent,this.options.hasConflicts,!this.options.toggler);"string"!==typeof d&&(d=e.output);this._textView.getModel().setText(c);
c=new q.inlineDiffBlockFeeder(e.mapper,1);d=new q.inlineDiffBlockFeeder(e.mapper,0);a.mergeDiffBlocks(this._textView.getModel(),d.getDiffBlocks(),e.mapper,e.diffArray.array,e.diffArray.index,this._diffParser._lineDelimiter);c.setModel(this._textView.getModel());d.setModel(this._textView.getModel());this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editor,this._editor,c,d,this._overviewRuler);this._initSyntaxHighlighter([{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,
editor:this._editor}]);this._highlightSyntax();this.options.commandProvider&&this.options.commandProvider.renderCommands(this);this.addRulers();e=this._textView.getTopIndex();this._textView.redrawLines(e,e+1,this._overviewRuler);this._textView.redrawLines(e,e+1,this._rulerOrigin);this._textView.redrawLines(e,e+1,this._rulerNew);this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1);return this._textView.getLineHeight()*this._textView.getModel().getLineCount()+5};c.prototype.setConflicting=
function(a){this._conflcit=a};return c}();w.toggleableCompareView=function(){function a(b,c){c&&(c.toggler=this);this._widget="inline"===b?new w.InlineCompareView(c):new w.TwoWayCompareView(c)}a.prototype={startup:function(){this._widget.startup()},initImageMode:function(){this._imageMode=!0;this._widget.initImageMode()},toggle:function(){var a=this._widget.options;if(!this._imageMode){var b=this._widget.getCurrentDiffPos();a.blockNumber=b.block;a.changeNumber=b.change}this._widget.destroy();h.empty(h.node(a.parentDivId));
this._widget="inline"===this._widget.type?new w.TwoWayCompareView(a):new w.InlineCompareView(a);this._imageMode?this._widget.initImageMode():this._widget.initEditors();this._widget.refresh(!0)},getWidget:function(){return this._widget}};return a}();return w});
define("orion/editor/stylers/lib/syntax",[],function(){return{id:"orion.lib",grammars:[{id:"orion.lib",repository:{brace_open:{match:"{",name:"punctuation.section.block.begin"},brace_close:{match:"}",name:"punctuation.section.block.end"},bracket_open:{match:"\\[",name:"punctuation.section.bracket.begin"},bracket_close:{match:"\\]",name:"punctuation.section.bracket.end"},parenthesis_open:{match:"\\(",name:"punctuation.section.parens.begin"},parenthesis_close:{match:"\\)",name:"punctuation.section.parens.end"},
doc_block:{begin:{match:"/\\*\\*",literal:"/**"},end:{match:"\\*/",literal:"*/"},name:"comment.block.documentation",patterns:[{match:"@(?:(?!\\*/)\\S)*",name:"keyword.other.documentation.tag"},{match:"\\\x3c\\S*\\\x3e",name:"keyword.other.documentation.markup"},{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]},number_decimal:{match:"\\b-?(?:\\.\\d+|\\d+\\.?\\d*)(?:[eE][+-]?\\d+)?\\b",name:"constant.numeric.number"},
number_hex:{match:"\\b0[xX][0-9A-Fa-f]+\\b",name:"constant.numeric.hex"},string_doubleQuote:{match:'"(?:\\\\.|[^"])*"?',name:"string.quoted.double"},string_singleQuote:{match:"'(?:\\\\.|[^'])*'?",name:"string.quoted.single"},todo_comment_singleLine:{match:"(\\b)(TODO)(\\b)(.*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.line"}}}}},{id:"orion.c-like",repository:{comment_singleLine:{match:{match:"//.*",literal:"//"},name:"comment.line.double-slash",
patterns:[{include:"orion.lib#todo_comment_singleLine"}]},comment_block:{begin:{match:"/\\*",literal:"/*"},end:{match:"\\*/",literal:"*/"},name:"comment.block",patterns:[{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]}}}],keywords:[]}});
define("orion/editor/stylers/application_javascript/syntax",["orion/editor/stylers/lib/syntax"],function(k){var l="break case class catch continue const debugger default delete do else enum export extends false finally for function if implements import in instanceof interface let new null package private protected public return static super switch this throw true try typeof undefined var void while with yield".split(" ");k=k.grammars;k.push({id:"orion.js",contentTypes:["application/javascript"],patterns:[{begin:"'(?:\\\\.|[^\\\\'])*\\\\$",
end:"^(?:$|(?:\\\\.|[^\\\\'])*('|[^\\\\]$))",name:"string.quoted.single.js"},{begin:'"(?:\\\\.|[^\\\\"])*\\\\$',end:'^(?:$|(?:\\\\.|[^\\\\"])*("|[^\\\\]$))',name:"string.quoted.double.js"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_singleLine"},{match:"/(?![\\s\\*])(?:\\\\.|[^/])+/(?:[gim]{0,3})",name:"string.regexp.js"},{include:"orion.lib#doc_block"},{include:"orion.c-like#comment_block"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},
{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{match:"\\b(?:"+l.join("|")+")\\b",name:"keyword.control.js"}]});return{id:k[k.length-1].id,grammars:k,keywords:l}});
define("orion/editor/stylers/text_x-java-source/syntax",["orion/editor/stylers/lib/syntax"],function(k){var l="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".split(" ");k=k.grammars;k.push({id:"orion.java",contentTypes:["text/x-java-source"],
patterns:[{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_singleLine"},{include:"orion.lib#doc_block"},{include:"orion.c-like#comment_block"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{match:"\\b(?:"+
l.join("|")+")\\b",name:"keyword.control.java"}],repository:{string_singleQuote:{}}});return{id:k[k.length-1].id,grammars:k,keywords:l}});
define("orion/editor/stylers/text_css/syntax",["orion/editor/stylers/lib/syntax"],function(k){var l="alignment-adjust alignment-baseline animation-delay animation-direction animation-duration animation-iteration-count animation-name animation-play-state animation-timing-function animation appearance azimuth backface-visibility background-attachment background-clip background-color background-image background-origin background-position background-repeat background-size background baseline-shift binding bleed bookmark-label bookmark-level bookmark-state bookmark-target border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-bottom border-collapse border-color border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-image border-left-color border-left-style border-left-width border-left border-radius border-right-color border-right-style border-right-width border-right border-spacing border-style border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-top border-width border bottom box-align box-decoration-break box-direction box-flex-group box-flex box-lines box-ordinal-group box-orient box-pack box-shadow box-sizing break-after break-before break-inside caption-side clear clip color-profile color column-count column-fill column-gap column-rule-color column-rule-style column-rule-width column-rule column-span column-width columns content counter-increment counter-reset crop cue-after cue-before cue cursor direction display dominant-baseline drop-initial-after-adjust drop-initial-after-align drop-initial-before-adjust drop-initial-before-align drop-initial-size drop-initial-value elevation empty-cells fit-position fit flex-align flex-flow flex-inline-pack flex-order flex-pack float-offset float font-family font-size font-size-adjust font-stretch font-style font-variant font-weight font grid-columns grid-rows hanging-punctuation height hyphenate-after hyphenate-before hyphenate-character hyphenate-lines hyphenate-resource hyphens icon image-orientation image-rendering image-resolution inline-box-align left letter-spacing line-height line-stacking-ruby line-stacking-shift line-stacking-strategy line-stacking list-style-image list-style-position list-style-type list-style margin-bottom margin-left margin-right margin-top margin mark-after mark-before mark marker-offset marks marquee-direction marquee-loop marquee-play-count marquee-speed marquee-style max-height max-width min-height min-width move-to nav-down nav-index nav-left nav-right nav-up opacity orphans outline-color outline-offset outline-style outline-width outline overflow-style overflow-x overflow-y overflow padding-bottom padding-left padding-right padding-top padding page-break-after page-break-before page-break-inside page-policy page pause-after pause-before pause perspective-origin perspective phonemes pitch-range pitch play-during position presentation-level punctuation-trim quotes rendering-intent resize rest-after rest-before rest richness right rotation-point rotation ruby-align ruby-overhang ruby-position ruby-span size speak-header speak-numeral speak-punctuation speak speech-rate stress string-set table-layout target-name target-new target-position target text-align-last text-align text-decoration text-emphasis text-height text-indent text-justify text-outline text-shadow text-transform text-wrap top transform-origin transform-style transform transition-delay transition-duration transition-property transition-timing-function transition unicode-bidi vertical-align visibility voice-balance voice-duration voice-family voice-pitch-range voice-pitch voice-rate voice-stress voice-volume volume white-space-collapse white-space widows width word-break word-spacing word-wrap z-index".split(" ");k=
k.grammars;k.push({id:"orion.css",contentTypes:["text/css"],patterns:[{begin:"'(?:\\\\.|[^\\\\'])*\\\\$",end:"^(?:$|(?:\\\\.|[^\\\\'])*('|[^\\\\]$))",name:"string.quoted.single.css"},{begin:'"(?:\\\\.|[^\\\\"])*\\\\$',end:'^(?:$|(?:\\\\.|[^\\\\"])*("|[^\\\\]$))',name:"string.quoted.double.css"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_block"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},
{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#number_decimal"},{include:"#number_hex"},{match:"(?i)\\b-?(?:\\.\\d+|\\d+\\.?\\d*)(?:%|em|ex|ch|rem|vw|vh|vmin|vmax|in|cm|mm|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?\\b",name:"constant.numeric.value.css"},{match:"(?:-webkit-|-moz-|-ms-|\\b)(?:"+l.join("|")+")\\b",name:"keyword.control.css"}],repository:{number_hex:{match:"#[0-9A-Fa-f]+\\b",name:"constant.numeric.hex.css"}}});
return{id:k[k.length-1].id,grammars:k,keywords:l}});
define("examples/editor/textStyler",["orion/editor/annotations","orion/editor/stylers/application_javascript/syntax","orion/editor/stylers/text_x-java-source/syntax","orion/editor/stylers/text_css/syntax"],function(k,l,h,f){function d(a,b){this.keywords=a;this.whitespacesVisible=b;this.setText("")}function g(){d.call(this,null,!0)}function e(a){d.call(this,null,a)}function c(){d.call(this,null,!1)}function b(b,f,h){this.commentStart="/*";this.commentEnd="*/";var k=[];switch(f){case "java":k=a;break;
case "js":k=m;break;case "css":k=n}this.whitespacesVisible=this.spacesVisible=this.tabsVisible=!1;this.detectHyperlinks=!0;this.highlightCaretLine=!1;this.detectTasks=this.foldingEnabled=!0;this._scanner=new d(k,this.whitespacesVisible);this._firstScanner=new c;this._commentScanner=new e(this.whitespacesVisible);this._whitespaceScanner=new g;"css"===f&&(this._scanner.isCSS=!0,this._firstScanner.isCSS=!0);this.view=b;this.annotationModel=h;this._bracketAnnotations=void 0;var l=this;this._listener=
{onChanged:function(a){l._onModelChanged(a)},onDestroy:function(a){l._onDestroy(a)},onLineStyle:function(a){l._onLineStyle(a)},onMouseDown:function(a){l._onMouseDown(a)},onSelection:function(a){l._onSelection(a)}};f=b.getModel();f.getBaseModel&&(f=f.getBaseModel());f.addEventListener("Changed",this._listener.onChanged);b.addEventListener("MouseDown",this._listener.onMouseDown);b.addEventListener("Selection",this._listener.onSelection);b.addEventListener("Destroy",this._listener.onDestroy);b.addEventListener("LineStyle",
this._listener.onLineStyle);this._computeComments();this._computeFolding();b.redrawLines()}var m=l.keywords,a=h.keywords,n=f.keywords,q={styleClass:"comment"},r={styleClass:"comment"},s={styleClass:"comment block documentation"},t={styleClass:"keyword other documentation markup"},w={styleClass:"keyword other documentation task"},v={styleClass:"keyword other documentation tag"},u={styleClass:"string"},z={styleClass:"constant numeric"},x={styleClass:"keyword"},A={styleClass:"punctuation separator space",
unmergeable:!0},p={styleClass:"punctuation separator tab",unmergeable:!0},B={styleClass:"meta annotation currentLine"};d.prototype={getOffset:function(){return this.offset},getStartOffset:function(){return this.startOffset},getData:function(){return this.text.substring(this.startOffset,this.offset)},getDataLength:function(){return this.offset-this.startOffset},_default:function(a){switch(a){case 32:case 9:if(this.whitespacesVisible)return 32===a?11:10;do a=this._read();while(32===a||9===a);this._unread(a);
return 9;case 123:case 125:case 40:case 41:case 91:case 93:case 60:case 62:return a;default:var b=this.isCSS,c=this.offset-1;if(!b&&48<=a&&57>=a){var d=b=!1,e=!1,f=a;do if(a=this._read(),46===a&&!b)b=!0;else if(101===a&&!d)b=d=!0,a=this._read(),45!==a&&this._unread(a);else if(120===a&&48===f&&2===this.offset-c)b=d=e=!0;else if(!(48<=a&&57>=a||e&&(65<=a&&70>=a||97<=a&&102>=a)))break;while(1);this._unread(a);return 3}if(97<=a&&122>=a||65<=a&&90>=a||95===a||45===a&&b){do a=this._read();while(97<=a&&
122>=a||65<=a&&90>=a||95===a||48<=a&&57>=a||45===a&&b);this._unread(a);a=this.keywords;if(0<a.length){c=this.text.substring(c,this.offset);for(b=0;b<a.length;b++)if(this.keywords[b]===c)return 2}}return 1}},_read:function(){return this.offset<this.text.length?this.text.charCodeAt(this.offset++):-1},_unread:function(a){-1!==a&&this.offset--},nextToken:function(){for(this.startOffset=this.offset;;){var a=this._read(),b;switch(a){case -1:return null;case 47:a=this._read();if(!this.isCSS&&47===a)for(;;)if(a=
this._read(),-1===a||10===a||13===a)return this._unread(a),6;if(42===a){a=this._read();b=7;for(42===a&&(b=8);;){for(;42===a;)if(a=this._read(),47===a)return b;if(-1===a)return this._unread(a),b;a=this._read()}}this._unread(a);return 1;case 39:for(b=4;;)switch(a=this._read(),a){case 39:return b;case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),10!==a&&this._unread(a)}}break;case 34:for(b=4;;)switch(a=this._read(),a){case 34:return b;
case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),10!==a&&this._unread(a)}}break;default:return this._default(a)}}},setText:function(a){this.text=a;this.startOffset=this.offset=0}};g.prototype=new d(null);g.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var a=this._read();switch(a){case -1:return null;case 32:return 11;case 9:return 10;default:do a=this._read();while(!(32===a||9===a||-1===a));this._unread(a);
return 1}}};e.prototype=new d(null);e.prototype.setType=function(a){this._type=a};e.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var a=this._read();switch(a){case -1:return null;case 32:case 9:if(this.whitespacesVisible)return 32===a?11:10;do a=this._read();while(32===a||9===a);this._unread(a);return 9;case 60:if(8===this._type){do a=this._read();while(!(62===a||-1===a));if(62===a)return 12}return 1;case 64:if(8===this._type){do a=this._read();while(97<=a&&122>=a||65<=a&&90>=
a||95===a||48<=a&&57>=a);this._unread(a);return 13}return 1;case 84:if(79===(a=this._read()))if(68===(a=this._read()))if(79===(a=this._read()))if(a=this._read(),!(97<=a&&122>=a||65<=a&&90>=a||95===a||48<=a&&57>=a))return this._unread(a),14;this._unread(a);default:do a=this._read();while(!(32===a||9===a||-1===a||60===a||64===a||84===a));this._unread(a);return 1}}};c.prototype=new d(null);c.prototype._default=function(a){for(;;)switch(a=this._read(),a){case 47:case 34:case 39:case -1:return this._unread(a),
1}};b.prototype={destroy:function(){var a=this.view;if(a){var b=a.getModel();b.getBaseModel&&(b=b.getBaseModel());b.removeEventListener("Changed",this._listener.onChanged);a.removeEventListener("MouseDown",this._listener.onMouseDown);a.removeEventListener("Selection",this._listener.onSelection);a.removeEventListener("Destroy",this._listener.onDestroy);a.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}},setHighlightCaretLine:function(a){this.highlightCaretLine=a},setWhitespacesVisible:function(a,
b){this.whitespacesVisible!==a&&(this.whitespacesVisible=a,this._scanner.whitespacesVisible=a,this._commentScanner.whitespacesVisible=a,b&&this.view.redraw())},setTabsVisible:function(a){this.tabsVisible!==a&&(this.tabsVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw())},setSpacesVisible:function(a){this.spacesVisible!==a&&(this.spacesVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw())},setDetectHyperlinks:function(a){this.detectHyperlinks=
a},setFoldingEnabled:function(a){this.foldingEnabled=a},setDetectTasks:function(a){this.detectTasks=a},_binarySearch:function(a,b,c,d,e){var f;void 0===d&&(d=-1);for(void 0===e&&(e=a.length);1<e-d;)if(f=Math.floor((e+d)/2),b<=a[f].start)e=f;else if(c&&b<a[f].end){e=f;break}else d=f;return e},_computeComments:function(){var a=this.view.getModel();a.getBaseModel&&(a=a.getBaseModel());this.comments=this._findComments(a.getText())},_computeFolding:function(){if(this.foldingEnabled){var a=this.view.getModel();
if(a.getBaseModel){var b=this.annotationModel;if(b){b.removeAnnotations(k.AnnotationType.ANNOTATION_FOLDING);for(var c=[],d=a.getBaseModel(),e=this.comments,f=0;f<e.length;f++){var g=e[f];(g=this._createFoldingAnnotation(a,d,g.start,g.end))&&c.push(g)}b.replaceAnnotations(null,c)}}}},_createFoldingAnnotation:function(a,b,c,d){var e=b.getLineAtOffset(c);b=b.getLineAtOffset(d);return e===b?null:new (k.AnnotationType.getType(k.AnnotationType.ANNOTATION_FOLDING))(c,d,a)},_computeTasks:function(a,b,c){if(this.detectTasks){var d=
this.annotationModel;if(d){var e=this.view.getModel(),f=e;e.getBaseModel&&(f=e.getBaseModel());for(var g=d.getAnnotations(b,c),e=[],h=k.AnnotationType.ANNOTATION_TASK;g.hasNext();){var m=g.next();m.type===h&&e.push(m)}g=[];m=this._commentScanner;m.setText(f.getText(b,c));for(var l;l=m.nextToken();){var n=m.getStartOffset()+b;14===l&&(l=f.getLineEnd(f.getLineAtOffset(n)),6!==a&&(l=Math.min(l,c-this.commentEnd.length)),g.push(k.AnnotationType.createAnnotation(h,n,l,f.getText(n,l))))}d.replaceAnnotations(e,
g)}}},_getLineStyle:function(a){if(this.highlightCaretLine){var b=this.view,c=b.getModel(),b=b.getSelection();if(b.start===b.end&&c.getLineAtOffset(b.start)===a)return B}return null},_getStyles:function(a,b,c){a.getBaseModel&&(c=a.mapOffset(c));for(var d=c+b.length,e=[],f=c,g=this.comments,h=this._binarySearch(g,c,!0);h<g.length&&!(g[h].start>=d);h++){var k=g[h].start,m=g[h].end;f<k&&this._parse(b.substring(f-c,k-c),f,e);var l=g[h].type,n;switch(l){case 8:n=s;break;case 7:n=r;break;case 5:n=u}f=Math.max(f,
k);k=Math.min(d,m);(8===l||7===l)&&(this.whitespacesVisible||this.detectHyperlinks)?this._parseComment(b.substring(f-c,k-c),f,e,n,l):5===l&&this.whitespacesVisible?this._parseString(b.substring(f-c,k-c),f,e,u):e.push({start:f,end:k,style:n});f=m}f<d&&this._parse(b.substring(f-c,d-c),f,e);if(a.getBaseModel)for(b=0;b<e.length;b++)c=e[b].end-e[b].start,e[b].start=a.mapOffset(e[b].start,!0),e[b].end=e[b].start+c;return e},_parse:function(a,b,c){var d=this._scanner;for(d.setText(a);a=d.nextToken();){var e=
d.getStartOffset()+b,f=null;switch(a){case 2:f=x;break;case 3:f=z;break;case 5:case 4:if(this.whitespacesVisible){this._parseString(d.getData(),e,c,u);continue}else f=u;break;case 8:this._parseComment(d.getData(),e,c,s,a);continue;case 6:this._parseComment(d.getData(),e,c,q,a);continue;case 7:this._parseComment(d.getData(),e,c,r,a);continue;case 10:this.whitespacesVisible&&this.tabsVisible&&(f=p);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(f=A)}c.push({start:e,end:d.getOffset()+b,
style:f})}},_parseComment:function(a,b,c,d,e){var f=this._commentScanner;f.setText(a);for(f.setType(e);a=f.nextToken();){e=f.getStartOffset()+b;var g=d;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&(g=p);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(g=A);break;case 12:g=t;break;case 13:g=v;break;case 14:g=w;break;default:this.detectHyperlinks&&(g=this._detectHyperlinks(f.getData(),e,c,g))}g&&c.push({start:e,end:f.getOffset()+b,style:g})}},_parseString:function(a,b,c,d){var e=
this._whitespaceScanner;for(e.setText(a);a=e.nextToken();){var f=e.getStartOffset()+b,g=d;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&(g=p);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(g=A)}g&&c.push({start:f,end:e.getOffset()+b,style:g})}},_detectHyperlinks:function(a,b,c,d){var e=null,f;if(0<(f=a.indexOf("://"))){for(var e=a,g=f;0<g;){f=e.charCodeAt(g-1);if(!(97<=f&&122>=f||65<=f&&90>=f||45===f||48<=f&&57>=f))break;g--}if(0<g&&(f="\"\"''(){}[]\x3c\x3e".indexOf(e.substring(g-
1,g)),-1!==f&&0===(f&1)&&-1!==(f=e.lastIndexOf("\"\"''(){}[]\x3c\x3e".substring(f+1,f+2))))){var h=f;f=this._clone(d);f.tagName="a";f.attributes={href:e.substring(g,h)};c.push({start:b,end:b+g,style:d});c.push({start:b+g,end:b+h,style:f});c.push({start:b+h,end:b+a.length,style:d});return null}}else 0===a.toLowerCase().indexOf("bug#")&&(e="https://bugs.eclipse.org/bugs/show_bug.cgi?id\x3d"+parseInt(a.substring(4),10));return e?(f=this._clone(d),f.tagName="a",f.attributes={href:e},f):d},_clone:function(a){if(!a)return a;
var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b},_findComments:function(a,b){b=b||0;var c=this._firstScanner,d;c.setText(a);for(var e=[];d=c.nextToken();)(7===d||8===d||5===d)&&e.push({start:c.getStartOffset()+b,end:c.getOffset()+b,type:d}),(6===d||7===d||8===d)&&this._computeTasks(d,c.getStartOffset()+b,c.getOffset()+b);return e},_findMatchingBracket:function(a,b){var c="{}()[]\x3c\x3e",d=a.getText(b,b+1),e=c.indexOf(d,0);if(-1===e)return-1;var f;f=e&1?c.substring(e-1,e):c.substring(e+
1,e+2);for(var g=a.getLineAtOffset(b),c=a.getLine(g),h=a.getLineStart(g),k=a.getLineEnd(g),c=this._findBrackets(d,f,c,h,h,k),k=0;k<c.length;k++)if(h=0<=c[k]?1:-1,c[k]*h-1===b){var m=1;if(e&1){for(k--;0<=k;k--)if(h=0<=c[k]?1:-1,m+=h,0===m)return c[k]*h-1;for(g-=1;0<=g;){c=a.getLine(g);h=a.getLineStart(g);k=a.getLineEnd(g);c=this._findBrackets(d,f,c,h,h,k);for(e=c.length-1;0<=e;e--)if(h=0<=c[e]?1:-1,m+=h,0===m)return c[e]*h-1;g--}}else{for(k++;k<c.length;k++)if(h=0<=c[k]?1:-1,m+=h,0===m)return c[k]*
h-1;g+=1;for(e=a.getLineCount();g<e;){c=a.getLine(g);h=a.getLineStart(g);k=a.getLineEnd(g);c=this._findBrackets(d,f,c,h,h,k);for(k=0;k<c.length;k++)if(h=0<=c[k]?1:-1,m+=h,0===m)return c[k]*h-1;g++}}break}return-1},_findBrackets:function(a,b,c,d,e,f){var g=[];a=a.charCodeAt(0);b=b.charCodeAt(0);for(var h=e,k=this._scanner,m,l=this.comments,n=this._binarySearch(l,e,!0);n<l.length&&!(l[n].start>=f);n++){m=l[n].start;var p=l[n].end;if(h<m)for(k.setText(c.substring(h-e,m-e));m=k.nextToken();)m===a?g.push(k.getStartOffset()+
h-e+d+1):m===b&&g.push(-(k.getStartOffset()+h-e+d+1));h=p}if(h<f)for(k.setText(c.substring(h-e,f-e));m=k.nextToken();)m===a?g.push(k.getStartOffset()+h-e+d+1):m===b&&g.push(-(k.getStartOffset()+h-e+d+1));return g},_onDestroy:function(a){this.destroy()},_onLineStyle:function(a){a.textView===this.view&&(a.style=this._getLineStyle(a.lineIndex));a.ranges=this._getStyles(a.textView.getModel(),a.lineText,a.lineStart)},_onSelection:function(a){var b=a.oldValue,c=a.newValue,d=this.view;a=d.getModel();var e;
if(this.highlightCaretLine){var f=a.getLineAtOffset(b.start);e=a.getLineAtOffset(c.start);var g=c.start===c.end,b=b.start===b.end;f===e&&b&&g||(b&&d.redrawLines(f,f+1),(f!==e||!b)&&g&&d.redrawLines(e,e+1))}if(this.annotationModel){var b=this._bracketAnnotations,h,m;if(c.start===c.end&&0<(m=d.getCaretOffset()))m-=1,a.getBaseModel&&(m=a.mapOffset(m),a=a.getBaseModel()),a=this._findMatchingBracket(a,m),-1!==a&&(h=[k.AnnotationType.createAnnotation(k.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),
k.AnnotationType.createAnnotation(k.AnnotationType.ANNOTATION_CURRENT_BRACKET,m,m+1)]);this._bracketAnnotations=h;this.annotationModel.replaceAnnotations(b,h)}},_onMouseDown:function(a){if(2===a.clickCount){var b=this.view,c=b.getModel(),d=b.getOffsetAtLocation(a.x,a.y);if(0<d){var e=d-1,f=c;c.getBaseModel&&(e=c.mapOffset(e),f=c.getBaseModel());e=this._findMatchingBracket(f,e);-1!==e&&(a.preventDefault(),a=e,c.getBaseModel&&(a=c.mapOffset(a,!0)),d>a&&(d--,a++),b.setSelection(a,d))}}},_onModelChanged:function(a){var b=
a.start,c=a.removedCharCount,d=a.addedCharCount-c,e=this.view;a=e.getModel();var f=a.getBaseModel?a.getBaseModel():a,c=b+c,g=f.getCharCount(),h=this.comments.length,m=f.getLineStart(f.getLineAtOffset(b)),l=this._binarySearch(this.comments,m,!0),n=this._binarySearch(this.comments,c,!1,l-1,h);l<h&&this.comments[l].start<=m&&m<this.comments[l].end?(m=this.comments[l].start,m>b&&(m+=d)):m=l===h&&0<h&&g-d===this.comments[h-1].end?this.comments[h-1].start:m;var p;n<h?(p=this.comments[n].end,p>b&&(p+=d),
n+=1):(n=h,p=g);for(var g=f.getText(m,p),q,g=this._findComments(g,m),h=l;h<this.comments.length;h++)q=this.comments[h],q.start>b&&(q.start+=d),q.start>b&&(q.end+=d);var x=n-l!==g.length;if(!x)for(h=0;h<g.length;h++){q=this.comments[l+h];var B=g[h];if(q.start!==B.start||q.end!==B.end||q.type!==B.type){x=!0;break}}h=[l,n-l].concat(g);Array.prototype.splice.apply(this.comments,h);x&&(h=m,q=p,a!==f&&(h=a.mapOffset(h,!0),q=a.mapOffset(q,!0)),e.redrawRange(h,q));if(this.foldingEnabled&&f!==a&&this.annotationModel){e=
this.annotationModel;l=e.getAnnotations(m,p);m=[];for(p=[];l.hasNext();)if(q=l.next(),q.type===k.AnnotationType.ANNOTATION_FOLDING){p.push(q);for(h=0;h<g.length&&!(q.start===g[h].start&&q.end===g[h].end);h++);h===g.length?(m.push(q),q.expand()):(h=q.start,n=q.end,h>b&&(h-=d),n>b&&(n-=d),h<=b&&b<n&&h<=c&&c<n&&(h=f.getLineAtOffset(q.start),n=f.getLineAtOffset(q.end),h!==n?q.expanded||q.expand():e.removeAnnotation(q)))}b=[];for(h=0;h<g.length;h++){q=g[h];for(d=0;d<p.length&&!(p[d].start===q.start&&p[d].end===
q.end);d++);d===p.length&&(q=this._createFoldingAnnotation(a,f,q.start,q.end))&&b.push(q)}e.replaceAnnotations(m,b)}}};return{TextStyler:b}});
define("orion/editor/textStyler",["orion/editor/annotations"],function(k){function l(a,b){this._unnamedCounter=0;this._patterns=[];this._rootId=b;a.forEach(function(a){this._addRepositoryPatterns(a.repository||{},a.id);this._addPatterns(a.patterns||[],a.id)}.bind(this))}function h(a,b,c,d,e){this.start=a.start;this.end=a.end;this.contentStart=a.contentStart;this.contentEnd=a.contentEnd;this.pattern=b;this._styler=c;this._parent=e;this._linePatterns=[];this._blockPatterns=[];this._enclosurePatterns=
{};d&&(this._initPatterns(),this._subBlocks=u(d,d.getText(this.start,this.end),this,this.start))}function f(a){this._styler=a}function d(a,b,c,d){this.highlightCaretLine=this.whitespacesVisible=this.spacesVisible=this.tabsVisible=!1;this.detectTasks=this.foldingEnabled=!0;this.view=a;this.annotationModel=b;this.patternManager=new l(c,d);this._accessor=new f(this);this._bracketAnnotations=void 0;var e=this;this._listener={onChanged:function(a){e._onModelChanged(a)},onDestroy:function(a){e._onDestroy(a)},
onLineStyle:function(a){e._onLineStyle(a)},onMouseDown:function(a){e._onMouseDown(a)},onSelection:function(a){e._onSelection(a)}};c=a.getModel();c.getBaseModel&&(c=c.getBaseModel());c.addEventListener("Changed",this._listener.onChanged);a.addEventListener("MouseDown",this._listener.onMouseDown);a.addEventListener("Selection",this._listener.onSelection);a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("LineStyle",this._listener.onLineStyle);d=c.getCharCount();this._rootBlock=
new h({start:0,contentStart:0,end:d,contentEnd:d},null,this,c);this._computeFolding(this._rootBlock.getBlocks());b&&this.detectTasks&&(d=[],z(this._rootBlock,c,d),b.replaceAnnotations([],d));a.redrawLines()}var g={styleClass:"meta annotation currentLine"},e=/$/,c=/\\(\d)/g,b=/^\(\?i\)\s*/,m=/(.*)(?:[\r\n]|$)/g,a={regex:/[ ]/g,style:{styleClass:"punctuation separator space",unmergeable:!0}},n={regex:/\t/g,style:{styleClass:"punctuation separator tab",unmergeable:!0}},q=function(a,b,c,d){var e=c,f=
a.lastIndex;m.lastIndex=c;c=m.exec(b);var g,h;a.lastIndex=0;if(c){for(h=c.index;0<=--h&&!(g=b.charAt(h),"\n"===g||"\r"===g););g=b.substring(h+1,c.index+c[1].length);a.lastIndex=h=c.index-h-1}for(;c&&c.index<b.length;){var k;if(d){var l=a.lastIndex;a.test(g)&&(a.lastIndex=l,k=a.exec(g))}else k=a.exec(g);if(k)return k.index+=e,k.index-=h,a.lastIndex=f,k;h=0;e+=c[0].length;if(c=m.exec(b))g=c[1],a.lastIndex=0}a.lastIndex=f;return null},r=function(a,b){var d=a.toString();c.lastIndex=0;if(!c.test(d))return a;
c.lastIndex=0;for(var e=c.exec(d);e;)d=d.replace(e[0],b[e[1]]||""),c.lastIndex=0,e=c.exec(d);return RegExp(d.substring(1,d.length-1-1),"g")},s=function(a,b,c,d){if(b=q(a.pattern.regex?a.pattern.regex:a.pattern.regexBegin,b,d,!0)){a.result=b;for(d=0;d<c.length;d++)if(b.index<c[d].result.index||b.index===c[d].result.index&&a.pattern.pattern.index<c[d].pattern.pattern.index){c.splice(d,0,a);return}c.push(a)}},t=function(a,b,c,d){if(b[0])d.push({start:c,end:c+a[0].length,style:b[0].name});else for(var e=
0,f=1;f<a.length;f++)if(a[f]){var g=b[f];if(g){var h=c+e;d.push({start:h,end:h+a[f].length,style:g.name})}e+=a[f].length}},w=function(a,b,c){var d=a.start;b.forEach(function(b){d<=b.start&&c.push({start:d,end:b.start,style:a.style});c.push(b);d=b.end});d<a.end&&c.push({start:d,end:a.end,style:a.style})},v=function(a,b,c,d,f){if(a&&(c=c.getLinePatterns())){var g=[];c.forEach(function(b){var c=b.regex||b.regexBegin;c.oldLastIndex=c.lastIndex;(c=q(c,a,0))&&g.push({result:c,pattern:b})});g.sort(function(a,
b){return a.result.index<b.result.index?-1:a.result.index>b.result.index?1:a.pattern.pattern.index<b.pattern.pattern.index?-1:1});for(var h=0;0<g.length;){var k=g[0];g.splice(0,1);if(!(k.result.index<h)){var m=k.result.index,l,n=[];if(k.pattern.regex){h=k.result;l=m+h[0].length;l={start:b+m,end:b+l,style:k.pattern.pattern.name};if(!f){k.pattern.pattern.captures&&t(h,k.pattern.pattern.captures,b+m,n);n.sort(function(a,b){return a.start<b.start?-1:a.start>b.start?1:0});for(m=0;m<n.length-1;m++)if(n[m+
1].start<n[m].end){var z={start:n[m+1].end,end:n[m].end,style:n[m].style};n[m].end=n[m+1].start;n.splice(m+2,0,z)}}w(l,n,d)}else h=k.pattern.regexEnd,h=r(h,k.result),(h=q(h,a,k.result.index+k.result[0].length))||(e.lastIndex=0,h=e.exec(a)),l=h.index+h[0].length,d.push({start:b+m,end:b+l,style:k.pattern.pattern.name});h=h.index+h[0].length}s(k,a,g,h)}c.forEach(function(a){a=a.regex||a.regexBegin;a.lastIndex=a.oldLastIndex})}},u=function(a,b,c,d){if(!b)return[];var f=[],g=[];c.getBlockPatterns().forEach(function(a){var c=
q(a.regexBegin||a.regex,b,0);c&&g.push({result:c,pattern:a})}.bind(this));if(!g.length)return f;g.sort(function(a,b){return a.result.index<b.result.index?-1:a.result.index>b.result.index?1:a.pattern.pattern.index<b.pattern.pattern.index?-1:1});for(var k=0;0<g.length;){var m=g[0];g.splice(0,1);if(!(m.result.index<k)){var k=d+m.result.index,n=m.result.index,l=null,t=m.pattern.regexEnd;if(t){var n=n+m.result[0].length,z=m.pattern,u=r(t,m.result);u!==t&&(z={pattern:z.pattern,regexBegin:z.regexBegin,regexEnd:u},
t=u);for(u=n;!l;){(u=q(t,b,u))||(e.lastIndex=0,u=e.exec(b));var v=new h({start:k,end:d+u.index+u[0].length,contentStart:d+n,contentEnd:d+u.index},z,c.getStyler(),a,c),w=v.getBlocks();if(!w.length||w[w.length-1].end<=u.index+d)l=v;u=u.index+u[0].length}}else l=new h({start:k,end:k+m.result[0].length,contentStart:k,contentEnd:k+m.result[0].length},m.pattern,c.getStyler(),a,c);f.push(l);k=l.end-d}s(m,b,g,k)}return f},z=function(a,b,c){if(a.getAnnotationModel()){var d=k.AnnotationType.ANNOTATION_TASK;
if(a.getLinePatterns().length&&a.pattern&&a.pattern.pattern.name&&0===a.pattern.pattern.name.indexOf("comment")){var e=[];v(b.getText(a.contentStart,a.end),a.contentStart,a,e,!0);for(var f=0;f<e.length;f++)"meta.annotation.task.todo"===e[f].style&&c.push(k.AnnotationType.createAnnotation(d,e[f].start,e[f].end,b.getText(e[f].start,e[f].end)))}a.getBlocks().forEach(function(a){z(a,b,c)}.bind(this))}};l.prototype={getPatterns:function(a){a?(a="string"===typeof a?a:a.qualifiedId,a+="#"):a=this._rootId+
"#"+this._NO_ID;var b=[0],c={},d=RegExp("^"+a+"[^#]+$");this._patterns.forEach(function(a){d.test(a.qualifiedId)&&(a.include?this._processInclude(a,b,c):(a.index=b[0]++,c[a.id]=a))}.bind(this));var e=[];Object.keys(c).forEach(function(a){e.push(c[a])});return e},_addPatterns:function(a,b){a.forEach(function(a){this._addPattern(a,this._NO_ID+this._unnamedCounter++,b)}.bind(this))},_addRepositoryPatterns:function(a,b){Object.keys(a).forEach(function(c){this._addPattern(a[c],c,b)}.bind(this))},_addPattern:function(a,
b,c){a.parentId=c;a.id=b;a.qualifiedId=a.parentId+"#"+a.id;this._patterns.push(a);a.patterns&&!a.include&&this._addPatterns(a.patterns,a.qualifiedId)},_processInclude:function(a,b,c){var d,e=a.include.indexOf("#");d=0===e?RegExp("^"+a.qualifiedId.substring(0,a.qualifiedId.indexOf("#"))+a.include+"$"):-1===e?RegExp("^"+a.include+"#"+this._NO_ID+"[^#]+$"):RegExp("^"+a.include+"$");this._patterns.forEach(function(a){d.test(a.qualifiedId)&&(a.include?this._processInclude(a,b,c):c[a.id]||(a.index=b[0]++,
c[a.id]=a))}.bind(this))},_NO_ID:"NoID"};h.prototype={adjustEnd:function(a){this.end+=a;this.contentEnd+=a;this._subBlocks.forEach(function(b){b.adjustEnd(a)})},adjustStart:function(a){this.start+=a;this.contentStart+=a;this._subBlocks.forEach(function(b){b.adjustStart(a)})},computeStyle:function(a,b){if(!this.pattern||!(this.start<=b&&b<this.end))return null;var c={start:this.start,end:this.end,style:this.pattern.pattern.name};if(this.contentStart<=b&&b<this.contentEnd)return this.pattern.pattern.contentName?
{start:this.contentStart,end:this.contentEnd,style:this.pattern.pattern.contentName}:c;var d,e,f,g;if(b<this.contentStart){e=this.pattern.pattern.beginCaptures||this.pattern.pattern.captures;if(!e)return c;d=this.pattern.regexBegin;f=a.getText(this.start,this.contentStart);g=this.start}else{e=this.pattern.pattern.endCaptures||this.pattern.pattern.captures;if(!e)return c;d=this.pattern.regexEnd;f=a.getText(this.contentEnd,this.end);g=this.contentEnd}d.lastIndex=0;if(f=d.exec(f)){d=[];t(f,e,g,d);for(e=
0;e<d.length;e++)if(d[e].start<=b&&b<d[e].end)return d[e]}return c},getAnnotationModel:function(){return this._styler._getAnnotationModel()},getBlockPatterns:function(){return this._blockPatterns},getBlocks:function(){return this._subBlocks},getEnclosurePatterns:function(){return this._enclosurePatterns},getLinePatterns:function(){return this._linePatterns},getParent:function(){return this._parent},getPatternManager:function(){return this._styler._getPatternManager()},getPatterns:function(){return this.getLinePatterns()},
getStyler:function(){return this._styler},isRenderingWhitespace:function(){return this._styler._isRenderingWhitespace()},_initPatterns:function(){if(this.pattern&&this.pattern.pattern._linePatterns)this._linePatterns=this.pattern.pattern._linePatterns,this._blockPatterns=this.pattern.pattern._blockPatterns,this._enclosurePatterns=this.pattern.pattern._enclosurePatterns;else{var a=function(a){a="string"===typeof a?a:a.match;var c=b.exec(a),d="g";c&&(a=a.substring(c[0].length),d+="i");return RegExp(a,
d)},c=-1,d=0;this.getPatternManager().getPatterns(this.pattern?this.pattern.pattern:null).forEach(function(b){var e;if(b.match&&!b.begin&&!b.end){if(e={regex:a(b.match),pattern:b},this._linePatterns.push(e),b.name&&0===b.name.indexOf("punctuation.section")&&(-1!==b.name.indexOf(".begin")||-1!==b.name.indexOf(".end")))this._enclosurePatterns[b.name]=e}else!b.match&&b.begin&&b.end&&(c=d,e={regexBegin:a(b.begin),regexEnd:a(b.end),pattern:b},this._linePatterns.push(e));d++}.bind(this));this._blockPatterns=
this._linePatterns.slice(0,c+1);this.pattern&&(this.pattern.pattern._enclosurePatterns=this._enclosurePatterns,this.pattern.pattern._linePatterns=this._linePatterns,this.pattern.pattern._blockPatterns=this._blockPatterns)}}};f.prototype={getPatterns:function(a){return this._styler.getPatterns(a)},getStyles:function(a){return this._styler.getStyles(a)}};d.prototype={destroy:function(){var a=this.view;if(a){var b=a.getModel();b.getBaseModel&&(b=b.getBaseModel());b.removeEventListener("Changed",this._listener.onChanged);
a.removeEventListener("MouseDown",this._listener.onMouseDown);a.removeEventListener("Selection",this._listener.onSelection);a.removeEventListener("Destroy",this._listener.onDestroy);a.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}},getPatterns:function(a){return this._findBlock(this._rootBlock,a).getPatterns()},getStyleAccessor:function(){return this._accessor},getStyles:function(a){var b=[],c=this.view.getModel();c.getBaseModel&&(c=c.getBaseModel());var d=this._findBlock(this._rootBlock,
a),e=c.getLineAtOffset(a),f=c.getLine(e),g=[];v(f,c.getLineStart(e),d,g);for(e=0;e<g.length&&!(a<g[e].start);e++)if(g[e].start<=a&&a<g[e].end){b.push(g[e]);break}for(;d;)(g=d.computeStyle(c,a))&&b.splice(0,0,g),d=d.getParent();return b},setHighlightCaretLine:function(a){this.highlightCaretLine=a},setWhitespacesVisible:function(a,b){this.whitespacesVisible!==a&&(this.whitespacesVisible=a,b&&this.view.redraw())},setTabsVisible:function(a){this.tabsVisible!==a&&(this.tabsVisible=a,this.setWhitespacesVisible(this.tabsVisible||
this.spacesVisible,!1),this.view.redraw())},setSpacesVisible:function(a){this.spacesVisible!==a&&(this.spacesVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw())},setDetectHyperlinks:function(a){},setFoldingEnabled:function(a){this.foldingEnabled=a},setDetectTasks:function(a){this.detectTasks=a},_binarySearch:function(a,b,c,d,e){var f;void 0===d&&(d=-1);for(void 0===e&&(e=a.length);1<e-d;)if(f=Math.floor((e+d)/2),b<=a[f].start)e=f;else if(c&&b<a[f].end){e=
f;break}else d=f;return e},_computeFolding:function(a){if(this.foldingEnabled){var b=this.view.getModel();if(b.getBaseModel){var c=this.annotationModel;if(c){c.removeAnnotations(k.AnnotationType.ANNOTATION_FOLDING);for(var d=[],e=b.getBaseModel(),f=0;f<a.length;f++){var g=a[f];(g=this._createFoldingAnnotation(b,e,g.start,g.end))&&d.push(g)}c.replaceAnnotations(null,d)}}}},_createFoldingAnnotation:function(a,b,c,d){var e=b.getLineAtOffset(c);b=b.getLineAtOffset(d);return e===b?null:new (k.AnnotationType.getType(k.AnnotationType.ANNOTATION_FOLDING))(c,
d,a)},_findBlock:function(a,b){var c=a.getBlocks();if(!c.length)return a;var d=this._binarySearch(c,b,!0);return d<c.length&&c[d].start<=b&&b<c[d].end?this._findBlock(c[d],b):a},_findBrackets:function(a,b,c,d,e,f){for(var g=[],h=[],k=e,m=c.getBlocks(),l=this._binarySearch(m,e,!0);l<m.length&&!(m[l].start>=f);l++){var n=m[l].start,q=m[l].end;k<n&&(v(d.substring(k-e,n-e),k,c,h),h.forEach(function(c){0===c.style.indexOf(a.pattern.name)?g.push(c.start+1):0===c.style.indexOf(b.pattern.name)&&g.push(-(c.start+
1))}),h=[]);k=q}k<f&&(v(d.substring(k-e,f-e),k,c,h),h.forEach(function(c){0===c.style.indexOf(a.pattern.name)?g.push(c.start+1):0===c.style.indexOf(b.pattern.name)&&g.push(-(c.start+1))}));return g},_findMatchingBracket:function(a,b,c){for(var d=a.getLineAtOffset(c),e=a.getLineEnd(d),f=a.getText(c,e),g,h=b.getEnclosurePatterns(),k=Object.keys(h),m=0;m<k.length;m++){var l=h[k[m]],n=q(l.regex,f,0);if(n&&0===n.index){g=l;break}}if(!g)return-1;f=!1;-1!==g.pattern.name.indexOf(".begin")?(f=!0,m=g.pattern.name.replace(".begin",
".end")):m=g.pattern.name.replace(".end",".begin");h=h[m];if(!h)return-1;k=a.getLine(d);l=a.getLineStart(d);e=this._findBrackets(g,h,b,k,l,e);for(m=0;m<e.length;m++)if(k=0<=e[m]?1:-1,e[m]*k-1===c){c=1;if(f){for(m++;m<e.length;m++)if(k=0<=e[m]?1:-1,c+=k,0===c)return e[m]*k-1;d+=1;for(m=a.getLineCount();d<m;){k=a.getLine(d);l=a.getLineStart(d);e=a.getLineEnd(d);e=this._findBrackets(g,h,b,k,l,e);for(f=0;f<e.length;f++)if(k=0<=e[f]?1:-1,c+=k,0===c)return e[f]*k-1;d++}}else{for(m--;0<=m;m--)if(k=0<=e[m]?
1:-1,c+=k,0===c)return e[m]*k-1;for(d-=1;0<=d;){k=a.getLine(d);l=a.getLineStart(d);e=a.getLineEnd(d);e=this._findBrackets(g,h,b,k,l,e);for(m=e.length-1;0<=m;m--)if(k=0<=e[m]?1:-1,c+=k,0===c)return e[m]*k-1;d--}}break}return-1},_getAnnotationModel:function(){return this.annotationModel},_getLineStyle:function(a){if(this.highlightCaretLine){var b=this.view,c=b.getModel(),b=b.getSelection();if(b.start===b.end&&c.getLineAtOffset(b.start)===a)return g}return null},_getPatternManager:function(){return this.patternManager},
_getStyles:function(a,b,c,d){b.getBaseModel&&(d=b.mapOffset(d));for(var e=d+c.length,f=[],g=d,h=a.getBlocks(),k=this._binarySearch(h,d,!0);k<h.length&&!(h[k].start>=e);k++){var m=h[k].start,l=h[k].end;g<m&&v(c.substring(g-d,m-d),g,a,f);var n=Math.max(g,m);if(n===m&&h[k].pattern.regexBegin){var r=q(h[k].pattern.regexBegin,c.substring(n-d),0);if(r){var s=h[k].pattern.pattern.beginCaptures||h[k].pattern.pattern.captures;s?t(r,s,n,f):f.push({start:n,end:n+r[0].length,style:h[k].pattern.pattern.name});
n+=r[0].length}}var m=Math.min(e,l),u=[];if(m===l&&h[k].pattern.regexEnd&&(g=c.substring(m-g-(h[k].end-h[k].contentEnd)),r=q(h[k].pattern.regexEnd,g,0)))(s=h[k].pattern.pattern.endCaptures||h[k].pattern.pattern.captures)?t(r,s,m-r[0].length,u):h[k].pattern.pattern.name&&u.push({start:m-r[0].length,end:m,style:h[k].pattern.pattern.name}),m-=r[0].length;var g=this._getStyles(h[k],b,c.substring(n-d,m-d),n),z=h[k].pattern.pattern.contentName||h[k].pattern.pattern.name;if(z){var w=n;g.forEach(function(a){a.start-
w&&f.push({start:w,end:a.start,style:z});f.push(a);w=a.end});m-w&&f.push({start:w,end:m,style:z})}else f=f.concat(g);f=f.concat(u);g=l}g<e&&v(c.substring(g-d,e-d),g,a,f);if(b.getBaseModel)for(a=0;a<f.length;a++)c=f[a].end-f[a].start,f[a].start=b.mapOffset(f[a].start,!0),f[a].end=f[a].start+c;return f},_isRenderingWhitespace:function(){return this.whitespacesVisible&&(this.tabsVisible||this.spacesVisible)},_onDestroy:function(a){this.destroy()},_onLineStyle:function(b){b.textView===this.view&&(b.style=
this._getLineStyle(b.lineIndex));b.ranges=this._getStyles(this._rootBlock,b.textView.getModel(),b.lineText,b.lineStart);b.ranges.forEach(function(a){a.style&&(a.style={styleClass:a.style.replace(/\./g," ")})});this._isRenderingWhitespace()&&(this.spacesVisible&&this._spliceStyles(a,b.ranges,b.lineText,b.lineStart),this.tabsVisible&&this._spliceStyles(n,b.ranges,b.lineText,b.lineStart))},_onSelection:function(a){var b=a.oldValue,c=a.newValue,d=this.view;a=d.getModel();var e;if(this.highlightCaretLine){var f=
a.getLineAtOffset(b.start);e=a.getLineAtOffset(c.start);var g=c.start===c.end,b=b.start===b.end;f===e&&b&&g||(b&&d.redrawLines(f,f+1),(f!==e||!b)&&g&&d.redrawLines(e,e+1))}if(this.annotationModel){var b=this._bracketAnnotations,h,m;if(c.start===c.end&&0<(m=d.getCaretOffset()))m-=1,a.getBaseModel&&(m=a.mapOffset(m),a=a.getBaseModel()),c=this._findBlock(this._rootBlock,m),a=this._findMatchingBracket(a,c,m),-1!==a&&(h=[k.AnnotationType.createAnnotation(k.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,
a+1),k.AnnotationType.createAnnotation(k.AnnotationType.ANNOTATION_CURRENT_BRACKET,m,m+1)]);this._bracketAnnotations=h;this.annotationModel.replaceAnnotations(b,h)}},_onMouseDown:function(a){if(2===a.clickCount){var b=this.view,c=b.getModel(),d=b.getOffsetAtLocation(a.x,a.y);if(0<d){var e=d-1,f=c;c.getBaseModel&&(e=c.mapOffset(e),f=c.getBaseModel());var g=this._findBlock(this._rootBlock,e),e=this._findMatchingBracket(f,g,e);-1!==e&&(a.preventDefault(),a=e,c.getBaseModel&&(a=c.mapOffset(a,!0)),d>a&&
(d--,a++),b.setSelection(a,d))}}},_onModelChanged:function(a){var b=a.start,c=a.removedCharCount;a=a.addedCharCount-c;var d=this.view,e=d.getModel(),f=e.getBaseModel?e.getBaseModel():e,c=b+c,g=f.getCharCount(),h=this._rootBlock.getBlocks(),m=h.length,l=f.getLineStart(f.getLineAtOffset(b)),n=this._binarySearch(h,l,!0),q=this._binarySearch(h,c,!1,n-1,m),r;n<m&&h[n].start<=l&&l<h[n].end?(r=h[n].start,r>b&&(r+=a)):r=n===m&&0<m&&g-a===h[m-1].end?h[m-1].start:l;var s;do q<m?(s=h[q].end,s>b&&(s+=a),q+=1):
(q=m,s=g),l=f.getText(r,s),l=u(f,l,this._rootBlock,r);while(l.length&&h.length&&q<m&&l[l.length-1].pattern.pattern.id!==h[q-1].pattern.pattern.id);for(g=n;g<h.length;g++)m=h[g],m.start>b&&m.adjustStart(a),m.start>b&&m.adjustEnd(a);var t=q-n!==l.length;if(!t)for(g=0;g<l.length;g++){var m=h[n+g],v=l[g];if(m.start!==v.start||m.end!==v.end||m.type!==v.type){t=!0;break}}g=[n,q-n].concat(l);Array.prototype.splice.apply(h,g);t&&(g=r,m=s,e!==f&&(g=e.mapOffset(g,!0),m=e.mapOffset(m,!0)),d.redrawRange(g,m));
if(this.annotationModel){d=[];h=[];n=[];r=this.annotationModel.getAnnotations(r,s);for(s=this.foldingEnabled&&f!==e;r.hasNext();)if(m=r.next(),s&&m.type===k.AnnotationType.ANNOTATION_FOLDING){n.push(m);for(g=0;g<l.length&&!(m.start===l[g].start&&m.end===l[g].end);g++);g===l.length?(d.push(m),m.expand()):(g=m.start,q=m.end,g>b&&(g-=a),q>b&&(q-=a),g<=b&&b<q&&g<=c&&c<q&&(g=f.getLineAtOffset(m.start),q=f.getLineAtOffset(m.end),g!==q?m.expanded||m.expand():this.annotationModel.removeAnnotation(m)));for(g=
0;g<l.length;g++){m=l[g];for(q=0;q<n.length&&!(n[q].start===m.start&&n[q].end===m.end);q++);q===n.length&&(m=this._createFoldingAnnotation(e,f,m.start,m.end))&&h.push(m)}}else m.type===k.AnnotationType.ANNOTATION_TASK&&d.push(m);if(this.detectTasks)for(g=0;g<l.length;g++)z(l[g],f,h);this.annotationModel.replaceAnnotations(d,h)}},_spliceStyles:function(a,b,c,d){for(var e=a.regex,f=e.lastIndex=0,g=e.exec(c);g;){for(g=d+g.index;f<b.length&&!(g<b[f].end);)f++;var h={start:g,end:g+1,style:a.style};if(f<
b.length&&b[f].start<=g){var k={start:g+1,end:b[f].end,style:b[f].style};b[f].end=g;b.splice(f+1,0,k);b.splice(f+1,0,h);f+=2}else b.splice(f,0,h),f++;g=e.exec(c)}}};return{TextStyler:d}});
define("orion/editor/textMateStyler",["orion/regex"],function(k){function l(d){var f;if(d instanceof Array){f=Array(d.length);for(var e=0;e<d.length;e++)f[e]=l(d[e])}else for(e in f={},d)if(Object.prototype.hasOwnProperty.call(d,e)){var c=d[e];f[e]="object"===typeof c&&null!==c?l(c):c}return f}function h(d,f,e){this.initialize(d);this.grammar=l(f);this.externalGrammars=e?l(e):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar)}var f={unsupported:[{regex:/\(\?[ims\-]:/,
func:function(d){return"option on/off for subexp"}},{regex:/\(\?<([=!])/,func:function(d){return"\x3d"===d[1]?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(d){return"atomic group"}}],toRegExp:function(d){function g(b,a){throw Error('Unsupported regex feature "'+b+'": "'+a[0]+'" at index: '+a.index+" in "+a.input);}var e="",c;d=f.processGlobalFlag("x",d,function(b){for(var a="",c=!1,d=b.length,e=0;e<d;){var f=b.charAt(e);if(!c&&"#"===f)for(;e<d&&"\r"!==f&&"\n"!==f;)f=b.charAt(++e);
else if(!c&&/\s/.test(f))for(;e<d&&/\s/.test(f);)f=b.charAt(++e);else"\\"===f?(a+=f,/\s/.test(b.charAt(e+1))||(a+=b.charAt(e+1),e+=1)):("["===f?c=!0:"]"===f&&(c=!1),a+=f),e+=1}return a});d=f.processGlobalFlag("i",d,function(b){e+="i";return b});for(c=0;c<this.unsupported.length;c++){var b;(b=this.unsupported[c].regex.exec(d))&&g(this.unsupported[c].func(b),b)}return RegExp(d,e)},processGlobalFlag:function(d,f,e){var c="(?"+d+")";d="(?"+d+":";if(f.substring(0,c.length)===c)return e(f.substring(c.length));
if(f.substring(0,d.length)===d){for(var c=0,b=f.length,h=-1,a=0;a<b&&-1===h;a++)switch(f.charAt(a)){case "\\":a++;break;case "(":c++;break;case ")":c--,0===c&&(h=a)}c=h;if(c<f.length-1)throw Error("Only a "+d+") group that encloses the entire regex is supported in: "+f);return e(f.substring(d.length,c))}return f},hasBackReference:function(d){return/\\\d+/.test(d.source)},getSubstitutedRegex:function(d,f,e){e="undefined"===typeof e?!0:!1;d=d.source.split(/(\\\d+)/g);for(var c=[],b=0;b<d.length;b++){var h=
d[b],a=/\\(\d+)/.exec(h);a?(h=f[a[1]]||"",c.push(e?k.escape(h):h)):c.push(h)}return RegExp(c.join(""))},groupify:function(d,f){for(var e=d.source,c=e.length,b=[],h=0,a=[],k=1,l=1,r=[],s={},t={},w=0;w<c;w++){var v=b[b.length-1],u=e.charAt(w);switch(u){case "(":4===v&&(b.pop(),r.push(")"),a[a.length-1].end=w);var z=w+2<c?e.charAt(w+1)+""+e.charAt(w+2):null;if("?:"===z||"?\x3d"===z||"?!"===z){var x;"?:"===z?x=1:(x=3,h++);b.push(x);a.push({start:w,end:-1,type:x});r.push(u);r.push(z);w+=z.length}else b.push(2),
a.push({start:w,end:-1,type:2,oldNum:k,num:l}),r.push(u),0===h&&(t[l]=null),s[k]=l,k++,l++;break;case ")":v=b.pop();3===v&&h--;a[a.length-1].end=w;r.push(u);break;case "*":case "+":case "?":case "}":var A=u,p=e.charAt(w-1),z=w-1;if("}"===u){for(x=w-1;"{"!==e.charAt(x)&&0<=x;x--);p=e.charAt(x-1);z=x-1;A=e.substring(x,w+1)}x=a[a.length-1];if(")"===p&&(2===x.type||4===x.type)){r.splice(x.start,0,"(");r.push(A);r.push(")");u={start:x.start,end:r.length-1,type:4,num:x.num};for(p=0;p<a.length;p++)if(v=
a[p],(2===v.type||4===v.type)&&v.start>=x.start&&v.end<=z)v.start+=1,v.end+=1,v.num+=1,2===v.type&&(s[v.oldNum]=v.num);a.push(u);l++;break}default:"|"!==u&&2!==v&&4!==v&&0===h&&(b.push(4),a.push({start:w,end:-1,type:4,num:l}),r.push("("),t[l]=null,l++),r.push(u),"\\"===u&&(u=e.charAt(w+1),r.push(u),w+=1)}}for(;b.length;)b.pop(),r.push(")");e=RegExp(r.join(""));c={};f=f||s;for(var B in f)f.hasOwnProperty(B)&&(c[B]="\\"+f[B]);e=this.getSubstitutedRegex(e,c,!1);return[e,s,t]},complexCaptures:function(d){if(!d)return!1;
for(var f in d)if(d.hasOwnProperty(f)&&"0"!==f)return!0;return!1}};h.prototype={initialize:function(d){this.textView=d;this.textView.stylerOptions=this;var f=this;this._listener={onModelChanged:function(d){f.onModelChanged(d)},onDestroy:function(d){f.onDestroy(d)},onLineStyle:function(d){f.onLineStyle(d)},onStorage:function(d){f.onStorage(d)}};d.addEventListener("ModelChanged",this._listener.onModelChanged);d.addEventListener("Destroy",this._listener.onDestroy);d.addEventListener("LineStyle",this._listener.onLineStyle);
d.redrawLines()},onDestroy:function(d){this.destroy()},destroy:function(){this.textView&&(this.textView.removeEventListener("ModelChanged",this._listener.onModelChanged),this.textView.removeEventListener("Destroy",this._listener.onDestroy),this.textView.removeEventListener("LineStyle",this._listener.onLineStyle),this.textView=null);this._listener=this._tree=this._styles=this.grammar=null},preprocess:function(d){for(d=[d];0!==d.length;){var f=d.pop();if(!f._resolvedRule||!f._typedRule)if(f._resolvedRule=
this._resolve(f),f._typedRule=this._createTypedRule(f),this.addStyles(f.name),this.addStyles(f.contentName),this.addStylesForCaptures(f.captures),this.addStylesForCaptures(f.beginCaptures),this.addStylesForCaptures(f.endCaptures),f._resolvedRule!==f&&d.push(f._resolvedRule),f.patterns)for(var e=0;e<f.patterns.length;e++)d.push(f.patterns[e])}},addStyles:function(d){if(d&&!this._styles[d]){this._styles[d]=[];for(var f=d.split("."),e=0;e<f.length;e++)this._styles[d].push(f.slice(0,e+1).join("-"))}},
addStylesForCaptures:function(d){for(var f in d)d.hasOwnProperty(f)&&this.addStyles(d[f].name)},ContainerRule:function(){function d(d){this.rule=d;this.subrules=d.patterns}d.prototype.valueOf=function(){return"aa"};return d}(),BeginEndRule:function(){function d(d){this.rule=d;this.beginRegex=f.toRegExp(d.begin);this.endRegex=f.toRegExp(d.end);this.subrules=d.patterns||[];this.endRegexHasBackRef=f.hasBackReference(this.endRegex);var e=f.complexCaptures(d.captures);d=f.complexCaptures(d.beginCaptures)||
f.complexCaptures(d.endCaptures);if(this.isComplex=e||d)e=f.groupify(this.beginRegex),this.beginRegex=e[0],this.beginOld2New=e[1],this.beginConsuming=e[2],e=f.groupify(this.endRegex,this.beginOld2New),this.endRegex=e[0],this.endOld2New=e[1],this.endConsuming=e[2]}d.prototype.valueOf=function(){return this.beginRegex};return d}(),MatchRule:function(){function d(d){this.rule=d;this.matchRegex=f.toRegExp(d.match);if(this.isComplex=f.complexCaptures(d.captures))d=f.groupify(this.matchRegex),this.matchRegex=
d[0],this.matchOld2New=d[1],this.matchConsuming=d[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 f=d;if(d.include){if(d.begin||d.end||d.match)throw Error('Unexpected regex pattern in "include" rule '+d.include);d=d.include;if("#"===d.charAt(0)){if(f=this.grammar.repository&&this.grammar.repository[d.substring(1)],!f)throw Error("Couldn't find included rule "+
d+" in grammar repository");}else if("$self"===d)f=this.grammar;else{if("$base"===d)throw Error('Include "$base" is not supported');f=this._allGrammars[d];if(!f)for(var e=0;e<this.externalGrammars.length;e++){var c=this.externalGrammars[e];if(c.scopeName===d){this.preprocess(c);f=this._allGrammars[d]=c;break}}}}return f},ContainerNode:function(){function d(d,e){this.parent=d;this.rule=e;this.children=[];this.end=this.start=null}d.prototype.addChild=function(d){this.children.push(d)};d.prototype.valueOf=
function(){var d=this.rule;return"ContainerNode { "+(d.include||"")+" "+(d.name||"")+(d.comment||"")+"}"};return d}(),BeginEndNode:function(){function d(d,e,c){this.parent=d;this.rule=e;this.children=[];this.setStart(c);this.endMatch=this.end=null;this.endRegexSubstituted=e.endRegexHasBackRef?f.getSubstitutedRegex(e.endRegex,c):null}d.prototype.addChild=function(d){this.children.push(d)};d.prototype.getIndexInParent=function(d){return this.parent?this.parent.children.indexOf(this):-1};d.prototype.setStart=
function(d){this.start=d.index;this.beginMatch=d};d.prototype.setEnd=function(d){d&&"object"===typeof d?(this.endMatch=d,this.end=d.index+d[0].length):(this.endMatch=null,this.end=d)};d.prototype.shiftStart=function(d){this.start+=d;this.beginMatch.index+=d};d.prototype.shiftEnd=function(d){this.end+=d;this.endMatch&&(this.endMatch.index+=d)};d.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range\x3d"+this.start+".."+this.end+"}"};return d}(),push:function(d,f){if(f)for(var e=f.length;0<
e;)d.push(f[--e])},exec:function(d,f,e){if(f=d.exec(f))f.index+=e;d.lastIndex=0;return f},afterMatch:function(d){return d.index+d[0].length},getEndMatch:function(d,f,e){if(d instanceof this.BeginEndNode){var c=d.rule;d=d.endRegexSubstituted||c.endRegex;return!d?null:this.exec(d,f,e)}return null},initialParse:function(){this.textView.getModel().getCharCount();this._tree=new this.ContainerNode(null,this.grammar._typedRule);this.parse(this._tree,!1,0)},onModelChanged:function(d){var f=d.addedCharCount,
e=d.removedCharCount;d=d.start;if(this._tree){var c=this.textView.getModel(),b=c.getCharCount(),c=c.getLineEnd(c.getLineAtOffset(d)-1),h=this.getFirstDamaged(c,c),c=-1===c?0:c,f=h?this.parse(h,!0,c,d,f,e):b;this.textView.redrawRange(c,f)}else this.initialParse()},getFirstDamaged:function(d,f){if(0>d)return this._tree;for(var e=[this._tree],c=null;e.length;){var b=e.pop();if(!b.parent||this.isDamaged(b,d,f)){b instanceof this.BeginEndNode&&(c=b);for(var h=0;h<b.children.length;h++)e.push(b.children[h])}}return c||
this._tree},isDamaged:function(d,f,e){return d.start<=e&&d.end>f},parse:function(d,f,e,c,b,h){var a=this.textView.getModel(),k=a.getLineStart(a.getLineCount()-1),l=a.getCharCount(),r=this.getInitialExpected(d,e),s=-1;f&&(d.repaired=!0,d.endNeedsUpdate=!0,s=(s=d.children[d.children.length-1])?a.getLineEnd(a.getLineAtOffset(s.end+(b-h))):-1,c=a.getLineEnd(a.getLineAtOffset(c+h)),s=Math.max(s,c));s=-1===s?l:s;c=r;for(var t=d,w=!1,v=e,u=-1;t&&(!f||v<s);){var z=this.getNextMatch(a,t,v);z||(v=v>=k?l:a.getLineStart(a.getLineAtOffset(v)+
1));var x=z&&z.match,A=z&&z.rule,p=z&&z.isEnd;if(z&&z.isSub)v=this.afterMatch(x),A instanceof this.BeginEndRule&&(w=!0,f&&A===c.rule&&t===c.parent?(t=c,t.setStart(x),t.repaired=!0,t.endNeedsUpdate=!0,c=this.getNextExpected(c,"begin")):(f&&(this.prune(t,c),f=!1),x=new this.BeginEndNode(t,A,x),t.addChild(x),t=x));else if(p||v===l)t instanceof this.BeginEndNode&&(x?(w=!0,u=Math.max(u,t.end),t.setEnd(x),v=this.afterMatch(x),f&&t===c&&t.parent===c.parent?(t.repaired=!0,delete t.endNeedsUpdate,c=this.getNextExpected(c,
"end")):f&&(this.prune(t,c),f=!1)):(t.setEnd(l),delete t.endNeedsUpdate)),t=t.parent;f&&v>=s&&!w&&(this.prune(d,r),f=!1)}this.removeUnrepairedChildren(d,f,e);this.cleanup(f,d,e,s,l,b,h);return f?Math.max(u,v):v},removeUnrepairedChildren:function(d,f,e){if(f){f=d.children;for(var c=-1,b=0;b<f.length;b++){var h=f[b];if(!h.repaired&&this.isDamaged(h,e,Number.MAX_VALUE)){c=b;break}}-1!==c&&(d.children.length=c)}},cleanup:function(d,f,e,c,b,h,a){if(d){d=h-a;b=this.getIntersecting(c-d+1,b);f=this.getIntersecting(e,
c);for(e=0;e<b.length;e++)c=b[e],!c.repaired&&c instanceof this.BeginEndNode&&(c.shiftEnd(d),c.shiftStart(d));for(e=0;e<f.length;e++)c=f[e],c.repaired&&c.endNeedsUpdate&&c.shiftEnd(d),delete c.endNeedsUpdate,delete c.repaired}else{f=this.getIntersecting(e,c);for(e=0;e<f.length;e++)delete f[e].repaired}},getNextMatch:function(d,f,e,c){var b=d.getLineAtOffset(e),b=d.getLineEnd(b),h=d.getText(e,b),a=[],k=[];d=[];b=[];for(this.push(a,f.rule.subrules);a.length;){var l=a.length?a.pop():null,l=l&&l._resolvedRule._typedRule;
if(l instanceof this.ContainerRule&&-1===k.indexOf(l))k.push(l),this.push(a,l.subrules);else if(!l||!c||l.matchRegex){var r=l&&this.exec(l.matchRegex||l.beginRegex,h,e);r&&(d.push(r),b.push(l))}}a=Number.MAX_VALUE;k=-1;for(l=0;l<d.length;l++)r=d[l],r.index<a&&(a=r.index,k=l);if(!c&&(e=this.getEndMatch(f,h,e)))if(c=f.rule.applyEndPatternLast,-1===k||e.index<a||!c&&e.index===a)return{isEnd:!0,rule:f.rule,match:e};return-1===k?null:{isSub:!0,rule:b[k],match:d[k]}},getInitialExpected:function(d,f){var e,
c;if(d===this._tree)for(e=0;e<d.children.length;e++){if(c=d.children[e],c.start>=f)return c}else if(d instanceof this.BeginEndNode&&d.endMatch){var b=d.endMatch.index;for(e=0;e<d.children.length&&!(c=d.children[e],c.start>=f);e++);if(c&&c.start<b)return c}return d},getNextExpected:function(d,f){if("begin"===f){var e=d.children[0];return e?e:d}if("end"===f&&(e=d.parent)){var c=e.children[e.children.indexOf(d)+1];return c?c:e}return null},prune:function(d,f){f.parent===d?d.children.length=f.getIndexInParent():
d instanceof this.BeginEndNode&&(d.endMatch=null,d.end=null);d.parent&&(d.parent.children.length=d.getIndexInParent()+1)},onLineStyle:function(d){this._tree||this.initialParse();var f=d.lineStart,e=this.textView.getModel(),c=e.getLineEnd(d.lineIndex),b=e.getLineEnd(e.getLineAtOffset(f)-1),b=this.getFirstDamaged(b,b),f=this.getLineScope(e,b,f,c);d.ranges=this.toStyleRanges(f);d.ranges.sort(function(b,a){return b.start-a.start})},getLineScope:function(d,f,e,c){for(var b=e,h=this.getInitialExpected(f,
e),a=[],k=[];f&&b<c;){var l=this.getNextMatch(d,f,b);if(!l)break;var r=l&&l.match,s=l&&l.rule,t=l&&l.isSub,l=l&&l.isEnd;r.index!==b&&k.push({start:b,end:r.index,node:f});t?(b=this.afterMatch(r),s instanceof this.BeginEndRule?(this.addBeginScope(a,r,s),f=h,h=this.getNextExpected(h,"begin")):this.addMatchScope(a,r,s)):l&&(b=this.afterMatch(r),this.addEndScope(a,r,s),h=this.getNextExpected(h,"end"),f=f.parent)}b<c&&k.push({start:b,end:c,node:f});d=this.getInheritedLineScope(k,e,c);return a.concat(d)},
getInheritedLineScope:function(d,f,e){f=[];for(e=0;e<d.length;e++)for(var c=d[e],b=c.node;b;){var h=b.rule.rule,a=h.name;if(h=h.contentName||a){this.addScopeRange(f,c.start,c.end,h);break}b=b.parent}return f},addBeginScope:function(d,f,e){var c=e.rule;this.addCapturesScope(d,f,c.beginCaptures||c.captures,e.isComplex,e.beginOld2New,e.beginConsuming)},addEndScope:function(d,f,e){var c=e.rule;this.addCapturesScope(d,f,c.endCaptures||c.captures,e.isComplex,e.endOld2New,e.endConsuming)},addMatchScope:function(d,
f,e){var c=e.rule,b=c.name;(c=c.captures)?this.addCapturesScope(d,f,c,e.isComplex,e.matchOld2New,e.matchConsuming):this.addScope(d,f,b)},addScope:function(d,f,e){e&&d.push({start:f.index,end:this.afterMatch(f),scope:e})},addScopeRange:function(d,f,e,c){c&&d.push({start:f,end:e,scope:c})},addCapturesScope:function(d,f,e,c,b,h){if(e)if(c){c={1:0};for(var a=0,k=1;void 0!==f[k];k++)void 0!==h[k]&&(a+=f[k].length),void 0!==f[k+1]&&(c[k+1]=a);h=f.index;for(a=1;e[a];a++){var k=e[a].name,l=b[a],r=h+c[l];
"undefined"!==typeof f[l]&&this.addScopeRange(d,r,r+f[l].length,k)}}else this.addScope(d,f,e[0]&&e[0].name)},getIntersecting:function(d,f){for(var e=[],c=this._tree?[this._tree]:[];c.length;){var b=c.pop(),h=!1;b instanceof this.ContainerNode?h=!0:this.isDamaged(b,d,f)&&(h=!0,e.push(b));if(h)for(var h=b.children.length,a=0;a<h;a++)c.push(b.children[a])}return e.reverse()},toStyleRanges:function(d){for(var f=[],e=0;e<d.length;e++){var c=d[e],b=this._styles[c.scope];if(!b)throw Error("styles not found for "+
c.scope);b=b.join(" ");f.push({start:c.start,end:c.end,style:{styleClass:b}})}return f}};return{RegexUtil:f,TextMateStyler:h}});
define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(k,l){function h(e){return-1!==e.getProperty("objectClass").indexOf(d)&&"highlighter"===e.getProperty("type")}function f(d,c,b){this.initialize(d,c,b);this.lineStyles=[]}var d="orion.edit.highlighter",g=d+" service must be an event emitter";l.AnnotationType.registerType("orion.annotation.highlightError",{title:k.syntaxError,html:"\x3cdiv class\x3d'annotationHTML error'\x3e\x3c/div\x3e",rangeStyle:{styleClass:"annotationRange error"}});
f.prototype={initialize:function(e,c,b){this.textView=e;this.serviceRegistry=c;this.annotationModel=b;this.services=[];var f=this;this.listener={onModelChanging:function(a){f.onModelChanging(a)},onModelChanged:function(a){f.onModelChanged(a)},onDestroy:function(a){f.onDestroy(a)},onLineStyle:function(a){f.onLineStyle(a)},onStyleReady:function(a){f.onStyleReady(a)},onServiceAdded:function(a){f.onServiceAdded(a.serviceReference,f.serviceRegistry.getService(a.serviceReference))},onServiceRemoved:function(a){f.onServiceRemoved(a.serviceReference,
f.serviceRegistry.getService(a.serviceReference))}};e.addEventListener("ModelChanging",this.listener.onModelChanging);e.addEventListener("ModelChanged",this.listener.onModelChanged);e.addEventListener("Destroy",this.listener.onDestroy);e.addEventListener("LineStyle",this.listener.onLineStyle);c.addEventListener("registered",this.listener.onServiceAdded);c.addEventListener("unregistering",this.listener.onServiceRemoved);e=c.getServiceReferences(d);for(b=0;b<e.length;b++){var a=e[b];h(a)&&this.addServiceListener(c.getService(a))}},
onDestroy:function(d){this.destroy()},destroy:function(){this.textView&&(this.textView.removeEventListener("ModelChanging",this.listener.onModelChanging),this.textView.removeEventListener("ModelChanged",this.listener.onModelChanged),this.textView.removeEventListener("Destroy",this.listener.onDestroy),this.textView.removeEventListener("LineStyle",this.listener.onLineStyle),this.textView=null);if(this.services){for(var d=0;d<this.services.length;d++)this.removeServiceListener(this.services[d]);this.services=
null}this.serviceRegistry&&(this.serviceRegistry.removeEventListener("registered",this.listener.onServiceAdded),this.serviceRegistry.removeEventListener("unregistering",this.listener.onServiceRemoved),this.serviceRegistry=null);this.lineStyles=this.listener=null},onModelChanging:function(d){this.startLine=this.textView.getModel().getLineAtOffset(d.start)},onModelChanged:function(d){var c=this.startLine;(d.addedLineCount||d.removedLineCount)&&Array.prototype.splice.apply(this.lineStyles,[c,d.removedLineCount].concat(this._getEmptyStyle(d.addedLineCount)))},
onStyleReady:function(d){var c=d.lineStyles||d.style;d=Number.MAX_VALUE;var b=-1,f=this.textView.getModel(),a;for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(this.lineStyles[a]=c[a],d=Math.min(d,a),b=Math.max(b,a));d=Math.max(d,0);b=Math.min(b,f.getLineCount());if(c=this.annotationModel){for(var g=c.getAnnotations(f.getLineStart(d),f.getLineEnd(b)),h=[];g.hasNext();){var k=g.next();"orion.annotation.highlightError"===k.type&&h.push(k)}g=[];for(k=d;k<=b;k++){a=k;var s=this.lineStyles[a],s=s&&
s.errors;a=f.getLineStart(a);if(s)for(var t=0;t<s.length;t++){var w=s[t];g.push(l.AnnotationType.createAnnotation("orion.annotation.highlightError",w.start+a,w.end+a))}}c.replaceAnnotations(h,g)}this.textView.redrawLines(d,b+1)},onLineStyle:function(d){var c=this.lineStyles[d.lineIndex];if(c)if(c.ranges){for(var c=c.ranges,b=d.lineStart,f=c.length,a=[],g=0;g<f;g++){var h=c[g];a.push({start:h.start+b,end:h.end+b,style:h.style})}d.ranges=a}else c.style&&(d.style=c.style)},_getEmptyStyle:function(d){for(var c=
[],b=0;b<d;b++)c.push(null);return c},setContentType:function(d){this.contentType=d;if(this.services)for(d=0;d<this.services.length;d++){var c=this.services[d];if(c.setContentType){var b=this.serviceRegistry.getService("orion.page.progress");b?b.progress(c.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):c.setContentType(this.contentType)}}},onServiceAdded:function(d,c){h(d)&&this.addServiceListener(c)},onServiceRemoved:function(d,
c){-1!==this.services.indexOf(c)&&this.removeServiceListener(c)},addServiceListener:function(d){if("function"===typeof d.addEventListener){if(d.addEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),this.services.push(d),d.setContentType&&this.contentType){var c=this.serviceRegistry.getService("orion.page.progress");c?c.progress(d.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):d.setContentType(this.contentType)}}else"undefined"!==
typeof console&&console.log(Error(g))},removeServiceListener:function(d){"function"===typeof d.removeEventListener?(d.removeEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),d=this.services.indexOf(d),-1!==d&&this.services.splice(d,1)):"undefined"!==typeof console&&console.log(Error(g))}};return f});
define("orion/highlight",["examples/editor/textStyler","orion/editor/textStyler","orion/editor/textMateStyler","orion/editor/AsyncStyler","orion/Deferred"],function(k,l,h,f,d){function g(b,e,a,g,q,r,s){function t(b,c){var f=b.getProperty("contentType")||b.getProperty("contentTypes"),g=b.getProperty("fileTypes");return f?d.when(e.isSomeExtensionOf(a,f)).then(function(a){return a?b:null}):c&&g&&-1!==g.indexOf(c)?(f=new d,f.resolve(b),f):null}function w(a){var b=null;switch(a&&a.id){case "application/javascript":case "application/json":b=
new k.TextStyler(g,"js",q);break;case "text/x-java-source":b=new k.TextStyler(g,"java",q);break;case "text/css":b=new k.TextStyler(g,"css",q)}return b}if(!c){var v=w(a);if(v)return r=new d,r.resolve(v),r}c&&!this.orionGrammars&&(this.orionGrammars={});v=r&&r.split(".").pop().toLowerCase();r=b.getServiceReferences("orion.edit.highlighter");for(var u=[],z=[],x=0;x<r.length;x++){var A=r[x],p=A.getProperty("type");"grammar"===p||!c&&"undefined"===typeof p?u.push(A.getProperty("grammar")):"highlighter"!==
p&&(p=A.getProperty("id"))&&!this.orionGrammars[p]&&(this.orionGrammars[p]={id:p,contentTypes:A.getProperty("contentTypes"),patterns:A.getProperty("patterns"),repository:A.getProperty("repository")});(A=t(A,v))&&z.push(A)}return d.all(z,function(a){return{_error:a}}).then(function(d){for(var e,k=d.length-1;0<=k;k--){var m=d[k];if(m&&!m._error&&(s||"highlighter"!==m.getProperty("type"))){e=m;break}}var p;if(e)if(d=e.getProperty("type"),"highlighter"===d)p=new f(g,b,q),p.setContentType(a);else if("grammar"===
d||!c&&"undefined"===typeof d)e=e.getProperty("grammar"),p=new h.TextMateStyler(g,e,u);else if(c){p=[];for(var r in this.orionGrammars)p.push(this.orionGrammars[r]);p=new l.TextStyler(g,q,p,e.getProperty("id"))}return p})}function e(b,c){this.serviceRegistry=b;this.contentTypeService=c;this.styler=null}var c=1;e.prototype={setup:function(b,c,a,d,e){e="undefined"===typeof e?!0:e;this.styler&&(this.styler.destroy&&this.styler.destroy(),this.styler=null);var f=this;return g(this.serviceRegistry,this.contentTypeService?
this.contentTypeService:this.serviceRegistry.getService("orion.core.contentTypeRegistry"),b,c,a,d,e).then(function(a){return f.styler=a})},getStyler:function(){return this.styler}};return{createStyler:g,SyntaxHighlighter:e}});
define("orion/inputCompletion/inputCompletion",["orion/EventTarget"],function(k){function l(h,f,d){k.attach(this);this._binderFunc=f;this.setInputField(h);(h=d?d.group:null)||(h=this._inputField&&this._inputField.id?this._inputField.id:"default__input__group");this._completionIdPrefix=h+"__completion__";this._proposeFromStart=d?d.proposeFromStart:!1;this._extendedProvider=d?d.extendedProvider:null;this._serviceRegistry=d?d.serviceRegistry:null;this._onDelete=d?d.onDelete:null;this._deleteToolTips=
d?d.deleteToolTips:"";this._proposalIndex=-1;this._dismissed=!0;this._mouseDown=!1;this._dataList=[];this._initUI();this._listeners=[];d=function(d){this._binderFunc&&this._binderFunc(function(e){this._bind(e);d.deleting&&(this._proposeOn(this._inputField.value),this._selectProposal(this._proposalIndex,!0))}.bind(this))}.bind(this);this.addEventListener("inputDataListChanged",d);this._listeners.push({evtTarget:this,type:"inputDataListChanged",handler:d});d=function(d){this._mouseDown=!0}.bind(this);
this._completionUIContainer.addEventListener("mousedown",d);this._listeners.push({evtTarget:this._completionUIContainer,type:"mousedown",handler:d});d=function(d){this._mouseDown=!1}.bind(this);this._completionUIContainer.addEventListener("mouseup",d);this._listeners.push({evtTarget:this._completionUIContainer,type:"mouseup",handler:d})}l.prototype._removeListeners=function(h){h&&h.forEach(function(f){f.evtTarget.removeEventListener(f.type,f.handler,!1)})};l.prototype.destroy=function(){this._removeListeners(this._inputFieldListeners);
this._removeListeners(this.listeners)};l.prototype.hasValueOf=function(h){return this._dataList.some(function(f){return f.value===h})};l.prototype.setInputField=function(h){this._inputField&&this._inputFieldListeners&&this._removeListeners(this._inputFieldListeners);this._inputFieldListeners=[];this._inputField=h;"string"===typeof this._inputField&&(this._inputField=document.getElementById(this._inputField));h=function(f){this._mouseDown?window.setTimeout(function(){this._inputField.focus()}.bind(this),
200):this._dismiss()}.bind(this);this._inputField.addEventListener("blur",h);this._inputFieldListeners.push({evtTarget:this._inputField,type:"blur",handler:h});h=function(f){this.onKeyDown(f)}.bind(this);this._inputField.addEventListener("keydown",h);this._inputFieldListeners.push({evtTarget:this._inputField,type:"keydown",handler:h});h=function(f){this._proposeOn(this._inputField.value)}.bind(this);this._inputField.addEventListener("input",h);this._inputFieldListeners.push({evtTarget:this._inputField,
type:"input",handler:h});h=function(f){this._dismissed&&this._binderFunc&&(this._dismissing?this._dismissing=!1:this._binderFunc&&this._binderFunc(function(d){this._bind(d)}.bind(this)))}.bind(this);this._inputField.addEventListener("focus",h);this._inputFieldListeners.push({evtTarget:this._inputField,type:"focus",handler:h})};l.prototype.onKeyDown=function(h){if(this._dismissed)return!0;var f=h.charCode||h.keyCode;if(13===f){if(this._proposalList&&0<this._proposalList.length&&0<=this._proposalIndex&&
this._proposalIndex<this._proposalList.length)return h.preventDefault(),this._dismiss(this._proposalList[this._proposalIndex].item.value,h.ctrlKey),h.stopPropagation(),!1}else{if((40===f||38===f)&&this._proposalList&&0<this._proposalList.length)return h.preventDefault(),this._walk(40===f),h.stopPropagation(),!1;if(27===f)return h.preventDefault(),this._dismiss(),!1;if(46===f&&-1<this._proposalIndex&&this._onDelete)return h.preventDefault(),this._onDelete(this._proposalList[this._proposalIndex].item.value,
this),this._resetIndexAfterDeletion(),h.stopPropagation(),!1}return!0};l.prototype._resetIndexAfterDeletion=function(){1>=this._proposalList.length?this._proposalIndex=-1:this._proposalIndex===this._proposalList.length-1&&(this._proposalIndex=this._proposalList.length-2)};l.prototype._bind=function(h){this._dataList=h};l.prototype._getUIContainerID=function(){return this._completionIdPrefix+"UIContainer"};l.prototype._getUIProposalListId=function(){return this._completionIdPrefix+"UIProposalList"};
l.prototype._initUI=function(){(this._completionUIContainer=document.getElementById(this._getUIContainerID()))||(this._completionUIContainer=document.createElement("div"),this._completionUIContainer.id=this._getUIContainerID(),this._completionUIContainer.style.display="none",this._completionUIContainer.className="inputCompletionContainer",this._completionUIContainer.setAttribute("role","list"),this._completionUIContainer.setAttribute("aria-atomic","true"),this._completionUIContainer.setAttribute("aria-live",
"assertive"),document.body.appendChild(this._completionUIContainer));this._completionUIContainer.textContent="";(this._completionUL=document.getElementById(this._getUIProposalListId()))||(this._completionUL=document.createElement("ul"),this._completionUL.id=this._getUIProposalListId(),this._completionUL.className="inputCompletionUL");this._completionUL.textContent="";this._completionUIContainer.appendChild(this._completionUL)};l.prototype._createProposalLink=function(h,f,d,g){var e=document.createElement("a");
e.href=require.toUrl(f);e.appendChild(this._createBoldText(h,d,g));return e};l.prototype._createBoldText=function(h,f,d,g){if(0>f)return document.createTextNode(h);g=g?g:document.createElement("span");var e;0!==f&&(e=document.createTextNode(h.substring(0,f)),g.appendChild(e));var c=document.createElement("b");g.appendChild(c);e=document.createTextNode(h.substring(f,f+d));c.appendChild(e);f+d<h.length&&(e=document.createTextNode(h.substring(f+d)),g.appendChild(e));return g};l.prototype._proposeOnCategory=
function(h,f){if(0!==f.length){var d;if(h){d=document.createElement("li");d.className="inputCompletionLICategory";var g=document.createTextNode(h);d.appendChild(g);this._completionUL.appendChild(d)}f.forEach(function(e){d=document.createElement("li");d.onmouseover=function(a){this._selectProposal(a.currentTarget)}.bind(this);d.onclick=function(a){this._dismiss(a.currentTarget.completionItem.value)}.bind(this);d.className="inputCompletionLINormal";d.completionItem=e.item;var c;if("string"===typeof e.item.value){var b=
document.createElement("table");b.style.width="100%";b.style.tableLayout="fixed";b.style.borderSpacing="0";var f=document.createElement("tr");f.style.width=this._inputField.offsetWidth+"px";b.appendChild(f);var a=document.createElement("td");a.classList.add("inputCompletionLILeftTD");var g=this._createBoldText(e.item.value,e.boldIndex,e.boldLength);a.appendChild(g);a.style.overflow="hidden";f.appendChild(a);this._onDelete&&(c=document.createElement("button"),c.classList.add("inputCompletionDismissButton"),
c.classList.add("layoutRight"),c.classList.add("core-sprite-close"),c.classList.add("imageSprite"),c.style.display="none",c.style.margin="0 0 0",c.title=this._deleteToolTips,c.onclick=function(a){a.stopPropagation();this._onDelete(e.item.value,this);this._resetIndexAfterDeletion()}.bind(this),a=document.createElement("td"),a.classList.add("inputCompletionLIRightTD"),a.appendChild(c),f.appendChild(a));d.appendChild(b)}else e.item.value.name&&"link"===e.item.value.type&&d.appendChild(this._createProposalLink(e.item.value.name,
e.item.value.value,e.boldIndex,e.boldLength));this._completionUL.appendChild(d);this._proposalList.push({item:e.item,domNode:d,deleteBtn:c})}.bind(this))}};l.prototype._domNode2Index=function(h){if(this._proposalList)for(var f=0;f<this._proposalList.length;f++)if(this._proposalList[f].domNode===h)return f;return-1};l.prototype._highlight=function(h,f){var d=h,g,e=!1;isNaN(d)||(e=!0,this._proposalList&&0<=h&&h<this._proposalList.length?(d=this._proposalList[h].domNode,g=this._proposalList[h].deleteBtn):
d=null);d&&(d.className=f?"inputCompletionLISelected":"inputCompletionLINormal",g&&(g.style.display=f?"":"none"),f&&e&&(d.offsetTop<this._completionUIContainer.scrollTop?d.scrollIntoView(!0):d.offsetTop+d.offsetHeight>this._completionUIContainer.scrollTop+this._completionUIContainer.clientHeight&&d.scrollIntoView(!1)))};l.prototype._selectProposal=function(h,f){var d=h;isNaN(d)&&(d=this._domNode2Index(h));if(d!==this._proposalIndex||f)this._highlight(this._proposalIndex,!1),this._proposalIndex=d,
this._highlight(this._proposalIndex,!0)};l.prototype._dismiss=function(h,f){this._mouseDown||(this._dismissed=!0,this._proposalList=null,this._proposalIndex=-1,"string"===typeof h?(this._inputField.value=h,this._dismissing=!0,this._inputField.focus()):h&&h.name&&"link"===h.type&&(f?window.open(h.value):window.location.href=h.value),window.setTimeout(function(){this._completionUIContainer.style.display="none"}.bind(this),200))};l.prototype._show=function(){if(this._proposalList&&0<this._proposalList.length){for(var h=
0,f=0,d=this._inputField;d;)h+=d.offsetLeft,f+=d.offsetTop,d=d.offsetParent;this._completionUIContainer.style.display="block";this._completionUIContainer.style.top=f+this._inputField.offsetHeight+2+"px";this._completionUIContainer.style.left=h+"px";this._completionUIContainer.style.width=this._inputField.offsetWidth+"px";this._dismissed=this._mouseDown=!1}else this._dismissed=!0,this._proposalList=null,this._proposalIndex=-1,this._completionUIContainer.style.display="none"};l.prototype._walk=function(h){h=
this._proposalIndex+(h?1:-1);-1>h?h=this._proposalList.length-1:h>=this._proposalList.length&&(h=-1);this._selectProposal(h)};l.prototype._proposeOnList=function(h,f,d){var g="",e=[],c=f?f.length:0;h.forEach(function(b){if("category"===b.type)this._proposeOnCategory(g,e),g=b.label,e=[];else{var h=!0,a=-1;if(f&&d){var k;"string"===typeof b.value?k=b.value.toLowerCase():b.value.name&&(k=b.value.name.toLowerCase());a=k.indexOf(f);0>a?h=!1:this._proposeFromStart&&(h=0===a)}h&&e.push({item:b,boldIndex:a,
boldLength:c})}}.bind(this));this._proposeOnCategory(g,e)};l.prototype._proposeOn=function(h){this._completionUL.textContent="";var f=h?h.toLowerCase():null;this._proposalList=[];this._proposeOnList(this._dataList,f,!0);this._extendedProvider&&f?this._extendedProvider(h,function(d){d&&d.forEach(function(d){this._proposeOnList(d.proposals,d.filterForMe?f:h,d.filterForMe)}.bind(this));this._show()}.bind(this),[]):this._show()};l.prototype.constructor=l;return{InputCompletion:l}});
define("orion/searchAndReplace/textSearcher","i18n!orion/search/nls/messages orion/editor/find orion/commands orion/objects orion/searchUtils orion/inputCompletion/inputCompletion orion/webui/littlelib".split(" "),function(k,l,h,f,d,g,e){function c(b,c,a,d,e){l.Find.call(this,b,d,e);this._serviceRegistry=c;this._commandService=a}c.prototype=new l.Find;f.mixin(c.prototype,{getFindString:function(){var b=document.getElementById("localSearchFindWith");return!b?l.Find.prototype.getFindString.call(this):
b.value},getReplaceString:function(){var b=document.getElementById("localSearchReplaceWith");return!b?l.Find.prototype.getReplaceString(this):b.value},hide:function(){var b=this.isVisible();l.Find.prototype.hide.call(this);b&&this._commandService.closeParameterCollector()},show:function(b){l.Find.prototype.show.call(this,b);var c=b.findString;this._addRecentfind(c);b=b.replaceString;var a=document.getElementById("localSearchFindWith");a||(this._createActionTable(),a=document.getElementById("localSearchFindWith"));
c&&(a.value=c);b&&(document.getElementById("localSearchReplaceWith").value=b);window.setTimeout(function(){a.select();a.focus()},10)},_showReplaceInfo:function(){this._regex?(this._replaceInfo.src="data:image/gif;base64,R0lGODlhBwAIAMQAAMzX6cbT5kh4qFiIuKC40FCIuGSXwmWZw2SaxGacxmadxmWcxbPM4GigyJW92JzC26DI0P///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABIALAAAAAAHAAgAAAUmoEQUQkFI0PBEz5A2yII0w9AwkUPbRpTsjUNEQUsFIgCXiGSShAAAOw\x3d\x3d",this._replaceInfo.title=k["Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e."]):
(this._replaceInfo.src="data:image/gif;base64,R0lGODlhBwAIAEAAACH5BAEAABIALAAAAAAHAAgAhwAAAAAAMwAAZgAAmQAAzAAA/wArAAArMwArZgArmQArzAAr/wBVAABVMwBVZgBVmQBVzABV/wCAAACAMwCAZgCAmQCAzACA/wCqAACqMwCqZgCqmQCqzACq/wDVAADVMwDVZgDVmQDVzADV/wD/AAD/MwD/ZgD/mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMrADMrMzMrZjMrmTMrzDMr/zNVADNVMzNVZjNVmTNVzDNV/zOAADOAMzOAZjOAmTOAzDOA/zOqADOqMzOqZjOqmTOqzDOq/zPVADPVMzPVZjPVmTPVzDPV/zP/ADP/MzP/ZjP/mTP/zDP//2YAAGYAM2YAZmYAmWYAzGYA/2YrAGYrM2YrZmYrmWYrzGYr/2ZVAGZVM2ZVZmZVmWZVzGZV/2aAAGaAM2aAZmaAmWaAzGaA/2aqAGaqM2aqZmaqmWaqzGaq/2bVAGbVM2bVZmbVmWbVzGbV/2b/AGb/M2b/Zmb/mWb/zGb//5kAAJkAM5kAZpkAmZkAzJkA/5krAJkrM5krZpkrmZkrzJkr/5lVAJlVM5lVZplVmZlVzJlV/5mAAJmAM5mAZpmAmZmAzJmA/5mqAJmqM5mqZpmqmZmqzJmq/5nVAJnVM5nVZpnVmZnVzJnV/5n/AJn/M5n/Zpn/mZn/zJn//8wAAMwAM8wAZswAmcwAzMwA/8wrAMwrM8wrZswrmcwrzMwr/8xVAMxVM8xVZsxVmcxVzMxV/8yAAMyAM8yAZsyAmcyAzMyA/8yqAMyqM8yqZsyqmcyqzMyq/8zVAMzVM8zVZszVmczVzMzV/8z/AMz/M8z/Zsz/mcz/zMz///8AAP8AM/8AZv8Amf8AzP8A//8rAP8rM/8rZv8rmf8rzP8r//9VAP9VM/9VZv9Vmf9VzP9V//+AAP+AM/+AZv+Amf+AzP+A//+qAP+qM/+qZv+qmf+qzP+q///VAP/VM//VZv/Vmf/VzP/V////AP//M///Zv//mf//zP///wAAAAAAAAAAAAAAAAgsAPcpQzMJjbJ9xNAQQ6hwUqaHDws+3PeQoMN9DiUuzFRQ2ZiDyyYdHFhwYUAAOw\x3d\x3d",
this._replaceInfo.title=k["Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e."]);this._replaceInfo.style.display=""},_createActionTable:function(){var b=this;this._commandService.openParameterCollector("pageNavigationActions",function(c){var a=document.createElement("input");a.type="text";a.name=k["Find:"];a.className="parameterInput";a.id="localSearchFindWith";
a.placeholder=k["Find With"];a.oninput=function(a){return b._handleInput(a)};a.onkeydown=function(a){return b._handleKeyDown(a)};c.appendChild(a);b._initCompletion(a);b._createButton(k.Next,c,function(){b._addRecentfind(b.getFindString());b.find(!0)});b._createButton(k.Previous,c,function(){b._addRecentfind(b.getFindString());b.find(!1)});var d=b._editor.getTextView().getOptions("readonly");if(!d){var e=document.createElement("input");e.type="text";e.name=k["ReplaceWith:"];e.className="parameterInput";
e.id="localSearchReplaceWith";e.placeholder=k["Replace With"];e.onkeydown=function(a){return b._handleKeyDown(a)};c.appendChild(e);b._replaceInfo=b._createInfoImage(null,c,null);b._showReplaceInfo();b._createButton(k.Replace,c,function(){b.replace()});b._createButton(k["Replace All"],c,function(){b.replaceAll()})}e=document.createElement("div");c.appendChild(e);e.classList.add("findOptionsDiv");var f=h.createDropdownMenu(e,k.Options,null,"dismissButton",null,!0);f.menuButton.classList.add("parameterInlineButton");
h.createCheckedMenuItem(f.menu,k["Show all"],b._showAll,function(a){b.setOptions({showAll:a.target.checked});f.dropdown.close(!0)});h.createCheckedMenuItem(f.menu,k["Case sensitive"],!b._caseInsensitive,function(a){b.setOptions({caseInsensitive:!a.target.checked});f.dropdown.close(!0);b.find(!0)});h.createCheckedMenuItem(f.menu,k["Wrap search"],b._wrap,function(a){b.setOptions({wrap:a.target.checked});f.dropdown.close(!0)});h.createCheckedMenuItem(f.menu,k["Incremental search"],b._incremental,function(a){b.setOptions({incremental:a.target.checked});
f.dropdown.close(!0)});h.createCheckedMenuItem(f.menu,k["Whole Word"],b._wholeWord,function(a){b.setOptions({wholeWord:a.target.checked});f.dropdown.close(!0);b.find(!0)});b._regExBox=h.createCheckedMenuItem(f.menu,k["Regular expression"],b._regex,function(a){b.setOptions({regex:a.target.checked});f.dropdown.close(!0);b.find(!0);b._showReplaceInfo()});d||h.createCheckedMenuItem(f.menu,k["Find after replace"],b._findAfterReplace,function(a){b.setOptions({findAfterReplace:a.target.checked});f.dropdown.close(!0)});
return a},function(){b.hide()})},_storeRecentFind:function(b,c,a){this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(d){d.put("recentFind",b);c&&window.setTimeout(function(){c.dispatchEvent({type:"inputDataListChanged",deleting:a})}.bind(this),20)})},_addRecentfind:function(b){"string"===typeof b&&b&&(!this._completion||!this._completion.hasValueOf(b))&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){var a;
c=c.get("recentFind");"string"===typeof c&&(c=JSON.parse(c));if(c){for(a in c)if(c[a].name===b)return;30<=c.length&&c.splice(29,c.length-30+1)}else c=[];c.splice(0,0,{name:b});this._storeRecentFind(c,this._completion)}.bind(this))},_removeRecentSearch:function(b,c){"string"===typeof b&&b&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){var d;a=a.get("recentFind");"string"===typeof a&&(a=JSON.parse(a));if(a)for(d in a)if(a[d].name===b){a.splice(d,
1);this._storeRecentFind(a,c,!0);break}}.bind(this))},_initCompletion:function(b){if(this._completion)this._completion.setInputField(b);else{var c=function(a){this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){b=b.get("recentFind");"string"===typeof b&&(b=JSON.parse(b));if(b){var c=[];b.forEach(function(a){c.push({type:"proposal",label:a.name,value:a.name})});a(c)}})}.bind(this);this._completion=new g.InputCompletion(b,c,{serviceRegistry:this._serviceRegistry,
group:"localSearch",onDelete:function(a,b){this._removeRecentSearch(a,b)}.bind(this),deleteToolTips:k["Click or use delete key to delete the search term"]})}},_createButton:function(b,c,a){var d=document.createElement("button");d.addEventListener("click",a.bind(this),!1);var f=this;d.addEventListener("keydown",function(a){a.keyCode===e.KEY.ESCAPE&&f.hide()});d.appendChild(document.createTextNode(b));d.className="dismissButton parameterInlineButton";c.appendChild(d)},_createInfoImage:function(b,c,
a){b=document.createElement("img");b.classList.add("replaceInfo");b.addEventListener("click",function(a){this._regExBox.checked=!this._regex;this.setOptions({regex:!this._regex});this.find(!0);this._showReplaceInfo()}.bind(this));c.appendChild(b);return b},_handleInput:function(b){this._incremental&&this.find(!0,null,!0);return!0},_handleKeyDown:function(b){var c=(this.isMac?b.metaKey:b.ctrlKey)&&!b.altKey&&!b.shiftKey;return c&&70===b.keyCode?(b.stopPropagation&&b.stopPropagation(),b.cancelBubble=
!0,!1):(this.isMac?b.metaKey:b.ctrlKey)&&!b.altKey&&75===b.keyCode||13===b.keyCode?(b.stopPropagation&&b.stopPropagation(),b.cancelBubble=!0,this._addRecentfind(this.getFindString()),13===b.keyCode?this.find(this._reverse?b.shiftKey:!b.shiftKey):this.find(!b.shiftKey),!1):c&&82===b.keyCode?(b.stopPropagation&&b.stopPropagation(),b.cancelBubble=!0,this.replace(),!1):27===b.keyCode?(this.hide(),!1):!0}});return{TextSearcher:c}});
define("orion/edit/editorContext",[],function(){return{getEditorContext:function(k){var l=Object.create(null);k.getServiceReferences("orion.edit.context").forEach(function(h){var f=k.getService(h);Object.keys(f).forEach(function(d){"function"===typeof f[d]&&(l[d]=f[d].bind(f))})});return l},getOptions:function(k){var l=Object.create(null);k.getServiceReferences("orion.edit.context").forEach(function(h){h.getPropertyKeys().forEach(function(f){"service.id"!==f&&"service.names"!==f&&"objectClass"!==
f&&(l[f]=h.getProperty(f))})});return l}}});
define("orion/blamer",["orion/extensionCommands","orion/PageLinks","orion/URITemplate","orion/edit/editorContext"],function(k,l,h,f){function d(d,e){for(var c=e.getFileMetadata(),b=d.getServiceReferences("orion.edit.blamer"),f=0;f<b.length;f++){var a=b[f],h={};h.validationProperties=a.getProperty("validationProperties");h.forceSingleItem=!0;h=k._makeValidator(h,d);if(h.validationFunction.bind(h)(c))return d.getService(a)}return null}return{isVisible:function(f,e){return!!d(f,e)&&!!f.getService("orion.core.blame")},
getBlame:function(g,e){var c=d(g,e);if(c){var b=function(a){for(var b=l.getOrionHome(),c=0;c<a.length;c++){var d=a[c],e=new h(d.CommitLink),f={};f.OrionHome=b;d.CommitLink=e.expand(f)}g.getService("orion.core.blame")._setAnnotations(a)};if(c.computeBlame){var k={metadata:e.getFileMetadata()};c.computeBlame(f.getEditorContext(g),k).then(b)}else c.doBlame(e.getInput()).then(b)}}}});
define("orion/editorCommands","i18n!orion/edit/nls/messages orion/i18nUtil orion/webui/littlelib orion/webui/dialogs/OpenResourceDialog orion/widgets/input/DropDownMenu orion/Deferred orion/URITemplate orion/commands orion/keyBinding orion/commandRegistry orion/extensionCommands orion/contentTypes orion/searchUtils orion/PageUtil orion/PageLinks orion/editor/annotations orion/blamer orion/regex orion/util orion/edit/editorContext".split(" "),function(k,l,h,f,d,g,e,c,b,m,a,n,q,r,s,t,w,v,u,z){function x(a){var b=
new e(a.uriTemplate),c=a.params||{};c.OrionHome=c.OrionHome||s.getOrionHome();var b=b.expand(c),d=document.createElement("div"),f=document.createElement("iframe");f.id=a.id;f.name=a.id;f.type="text/html";f.sandbox="allow-scripts allow-same-origin";f.frameborder=void 0!==a.border?a.border:1;f.src=b;f.className="delegatedUI";a.width&&(d.style.width=a.width,f.style.width=a.width);a.height&&(d.style.height=a.height,f.style.height=a.height);f.style.visibility="hidden";null!==a.parent&&(a.parent||window.document.body).appendChild(d);
d.appendChild(f);f.style.left=a.left||(window.innerWidth-parseInt(f.clientWidth,10))/2+"px";f.style.top=a.top||(window.innerHeight-parseInt(f.clientHeight,10))/2+"px";f.style.visibility="";window.addEventListener("message",function D(b){if(b.source===f.contentWindow&&"string"===typeof b.data&&(b=JSON.parse(b.data),"orion.page.delegatedUI"===b.pageService&&b.source===a.id)){if(b.cancelled)a.cancelled&&a.cancelled();else if(b.result)a.done&&a.done(b.result);else if(b.Status||b.status)a.status&&a.status(b.Status||
b.status);window.removeEventListener("message",D,!1);d.parentNode&&d.parentNode.removeChild(d)}},!1);return d}function A(a){this.serviceRegistry=a.serviceRegistry;this.commandService=a.commandRegistry;this.fileClient=a.fileClient;this.inputManager=a.inputManager;this.toolbarId=a.toolbarId;this.saveToolbarId=a.saveToolbarId;this.editToolbarId=a.editToolbarId;this.pageNavId=a.navToolbarId;this.isReadOnly=a.readonly;this._localSearcher=a.textSearcher;this._searcher=a.searcher;this.editorSettings=a.editorSettings;
this.localSettings=a.localSettings}var p={},B=null;p.createDelegatedUI=x;A.prototype={generateSimpleEditorCommands:function(a,b){this.isReadOnly||(this._generateUndoStackCommands(a),this._generateSaveCommand(a,b));this._generateSearchFilesCommand(a);this._generateGotoLineCommnand(a);this._generateFindCommnand(a)},generateEditorCommands:function(a){this.generateBaseEditorCommands(a);this.generateExtraEditorCommands(a)},generateBaseEditorCommands:function(a){this.isReadOnly||(this._generateUndoStackCommands(a),
this._generateSaveCommand(a),this._generateEditCommands(a))},generateExtraEditorCommands:function(a){this._generateSettingsCommand(a);this._generateSearchFilesCommand(a);this._generateGotoLineCommnand(a);this._generateFindCommnand(a);this._generateBlame(a)},_generateSettingsCommand:function(a){var e=this,f=new c.Command({imageClass:"core-sprite-wrench",tooltip:k.LocalEditorSettings,id:"orion.edit.settings",visibleWhen:function(){return a.installed},callback:function(b){var c=f.settingsDropDown;if(!c||
c.isDestroyed())c=f.settingsDropDown=new d(b.domNode.parentNode,b.domNode,{noClick:!0,selectionClass:"dropdownSelection",onShow:function(){c.focus()},onHide:function(){a.focus()}}),c.updateContent=e.localSettings.show.bind(e.localSettings),b=c.getContentNode(),b.tabIndex=b.style.marginTop=0;c.click()}});this.commandService.addCommand(f);this.commandService.registerCommandContribution("settingsActions","orion.edit.settings",1,null,!1,new b.KeyBinding("s",!0,!0))},_generateUndoStackCommands:function(a){var d=
new c.Command({name:k.Undo,id:"orion.undo",visibleWhen:function(){return a.installed},callback:function(b){a.getUndoStack().undo()}});this.commandService.addCommand(d);this.commandService.registerCommandContribution(this.editToolbarId||this.toolbarId,"orion.undo",400,this.editToolbarId?"orion.menuBarEditGroup/orion.undoGroup":null,!this.editToolbarId,new b.KeyBinding("z",!0));d=new c.Command({name:k.Redo,id:"orion.redo",visibleWhen:function(){return a.installed},callback:function(b){a.getUndoStack().redo()}});
this.commandService.addCommand(d);this.commandService.registerCommandContribution(this.editToolbarId||this.toolbarId,"orion.redo",401,this.editToolbarId?"orion.menuBarEditGroup/orion.undoGroup":null,!this.editToolbarId,u.isMac?new b.KeyBinding("z",!0,!0):new b.KeyBinding("y",!0))},_generateSearchFilesCommand:function(a){var d=this;if(d._searcher){var e=!1,g=new c.Command({name:k.searchFiles,tooltip:k.searchFiles,id:"orion.searchFiles",visibleWhen:function(){return a.installed},callback:function(b){if(!e){b=
a.getSelection();b=a.getText(b.start,b.end);var c=d.serviceRegistry.getService("orion.page.progress"),g=new f.OpenResourceDialog({searcher:d._searcher,progress:c,searchRenderer:d._searcher.defaultRenderer,nameSearch:!1,title:k.searchFiles,message:k.searchTerm,initialText:b,onHide:function(){e=!1;a.focus()}});window.setTimeout(function(){e=!0;g.show(h.node(d.toolbarId))},0)}}});this.commandService.addCommand(g);this.commandService.registerCommandContribution(this.editToolbarId||this.pageNavId,"orion.searchFiles",
1,this.editToolbarId?"orion.menuBarEditGroup/orion.findGroup":null,!this.editToolbarId,new b.KeyBinding("h",!0))}},_generateSaveCommand:function(a,d){var e=this,f=d?d:"orion.save",g=new c.Command({name:k.Save,tooltip:k.saveFile,id:f,visibleWhen:function(){return!a.installed||e.inputManager.getReadOnly()?!1:!0},callback:function(a){e.inputManager.save();return!0}});this.commandService.addCommand(g);this.commandService.registerCommandContribution(this.saveToolbarId||this.toolbarId,f,1,this.saveToolbarId?
"orion.menuBarFileGroup/orion.saveGroup":null,!1,new b.KeyBinding("s",!0));a.getTextView&&a.getTextView()&&(a.getTextView().setKeyBinding(new b.KeyBinding("s",!0),"save"),a.getTextView().setAction("save",g.callback,g))},_generateGotoLineCommnand:function(a){var d=this,e=new m.ParametersDescription([new m.CommandParameter("line","number","Line:")],{hasOptionalParameters:!1},function(){var b=a.getModel().getLineAtOffset(a.getCaretOffset())+1;return[new m.CommandParameter("line","number","Line:",b.toString())]}),
e=new c.Command({name:k.gotoLine,tooltip:k.gotoLineTooltip,id:"orion.gotoLine",visibleWhen:function(){return a.installed},parameters:e,callback:function(b){var c=a.getModel();b.parameters&&b.parameters.valueFor("line")?b=b.parameters.valueFor("line"):(b=c.getLineAtOffset(a.getCaretOffset()),(b=prompt(k.gotoLinePrompt,b+1))&&(b=parseInt(b,10)));if(b)a.onGotoLine(b-1,0)}});this.commandService.addCommand(e);this.commandService.registerCommandContribution(this.editToolbarId||this.pageNavId,"orion.gotoLine",
3,this.editToolbarId?"orion.menuBarEditGroup/orion.findGroup":null,!this.editToolbarId,new b.KeyBinding("l",!u.isMac,!1,!1,u.isMac),new m.URLBinding("gotoLine","line"));a.getTextView&&a.getTextView()&&a.getTextView().setAction("gotoLine",function(b){if(b)return a.onGotoLine(b.line-1,0,void 0,b.callback),!0;d.commandService.runCommand("orion.gotoLine");return!0},e)},_generateFindCommnand:function(a){var d=this,e=new m.ParametersDescription([new m.CommandParameter("find","text","Find:")],{clientCollect:!0},
function(){var b=a.getSelection(),c="";b.end>b.start&&(c=a.getModel().getText(b.start,b.end),d._localSearcher&&d._localSearcher.getOptions().regex&&(c=v.escape(c)));return[new m.CommandParameter("find","text","Find:",c)]}),e=new c.Command({name:k.Find,tooltip:k.Find,id:"orion.editor.find",visibleWhen:function(){return a.installed},parameters:e,callback:function(b){if(d._localSearcher){var c="",e=null,f=a.getSelection();f.end>f.start&&b.parameters.valueFor("useEditorSelection")?(c=a.getModel().getText(f.start,
f.end),d._localSearcher.getOptions().regex&&(c=v.escape(c))):b.parameters&&b.parameters.valueFor("find")&&(c=b.parameters.valueFor("find"),e=r.matchResourceParameters(),q.convertFindURLBinding(e));e?(d._localSearcher.setOptions({regex:e.regEx,caseInsensitive:!e.caseSensitive}),b={},e.atLine&&(b.start=a.getModel().getLineStart(e.atLine-1)),d._localSearcher.show({findString:c,replaceString:e.replaceWith}),d._localSearcher.find(!0,b)):d._localSearcher.show({findString:c});return!0}return!1}});this.commandService.addCommand(e);
this.commandService.registerCommandContribution(this.editToolbarId||this.pageNavId,"orion.editor.find",0,this.editToolbarId?"orion.menuBarEditGroup/orion.findGroup":null,!this.editToolbarId,new b.KeyBinding("f",!0),new m.URLBinding("find","find"));a.getTextView&&a.getTextView()&&a.getTextView().setAction("find",function(a){if(a)return d._localSearcher.show(a),!0;d.commandService.runCommand("orion.editor.find",null,null,new m.ParametersDescription([new m.CommandParameter("useEditorSelection","text",
"","true")],{clientCollect:!0}));return!0},e)},_generateBlame:function(a){var d=this,e=new c.Command({name:k.Blame,tooltip:k.BlameTooltip,id:"orion.edit.blame",parameters:new m.ParametersDescription([new m.CommandParameter("blame","boolean")],{clientCollect:!0}),visibleWhen:function(){return!a.installed?!1:w.isVisible(d.serviceRegistry,d.inputManager)},callback:function(b){for(var c=!1,e=a.getAnnotationModel().getAnnotations();e.hasNext();)if(e.next().type===t.AnnotationType.ANNOTATION_BLAME){c=!0;
break}c=!c;b.parameters&&b.parameters.valueFor("blame")&&(c="true"===b.parameters.valueFor("blame"));c?w.getBlame(d.serviceRegistry,d.inputManager):a.showBlame([])}});this.commandService.addCommand(e);this.commandService.registerCommandContribution(this.toolbarId,"orion.edit.blame",1,"orion.menuBarToolsGroup",!1,new b.KeyBinding("b",!0,!0),new m.URLBinding("blame","blame"))},_generateEditCommands:function(d){function e(a){if(!a)return null;var c=new b.KeyBinding;b.KeyBinding.apply(c,a);return c}function f(a,
b){!b&&a&&"undefined"!==typeof a.HTML&&delete a.HTML;var c=m.serviceRegistry.getService("orion.page.message");c?c.setProgressResult(a):window.console.log(a)}var m=this,p=this.toolbarId,q=this.serviceRegistry,r=q.getServiceReferences("orion.edit.command"),s=this.inputManager,u=q.getService("orion.page.progress"),t=function(a,b,e){var g=e.visibleWhen;e.visibleWhen=function(a){return!d.installed||m.inputManager.getReadOnly()?!1:!g||g(a)};e.callback=function(c){d=this;var e=d.getSelection?d.getSelection():
{start:0,end:0};c=d.getModel();var g=function(a){"object"===typeof a&&a?(a.text&&d.setText(a.text),a.selection&&(d.setSelection&&d.setSelection(a.selection.start,a.selection.end,!0),d.focus())):"string"===typeof a&&(d.setText(a,e.start,e.end,!0),d.setSelection&&d.setSelection(e.start,e.start+a.length),d.focus())},h;b.execute?(c={contentType:s.getContentType(),input:s.getInput()},h=z.getEditorContext(q),h.openDelegatedUI=x,h.setStatus=f,c=b.execute(h,c),h=null):(c=b.run(c.getText(e.start,e.end),c.getText(),
e,s.getInput()),h=function(b){if(b&&b.uriTemplate){var c={};c.uriTemplate=b.uriTemplate;c.params=s.getFileMetadata();c.id=a.id;c.width=b.width;c.height=b.height;c.done=g;c.status=f;x(c)}else b&&(b.Status||b.status)?f(b.Status||b.status):g(b)});u.showWhile(c,l.formatMessage(k.running,a.name)).then(h);return!0};e.callback=e.callback.bind(d);return new c.Command(e)};g.when(function(a){if(B)return B;var b=a.getService("orion.core.contentTypeRegistry");b||(b=new n.ContentTypeRegistry(a),b=a.getService("orion.core.contentTypeRegistry"));
return b.getContentTypes().then(function(a){return B=a})}(this.serviceRegistry),function(){var b=[],c=100;r.forEach(function(f){var g=f.getProperty("editor");if(!g||!(d.id&&g!==d.id)){for(var h=m.serviceRegistry.getService(f),k={},g=f.getPropertyKeys(),l=0;l<g.length;l++)k[g[l]]=f.getProperty(g[l]);k.forceSingleItem=!0;f=a._createCommandOptions(k,f,m.serviceRegistry,B,!1,function(a){return s.getFileMetadata()});b.push(f);f.then(function(a){a=t(k,h,a);m.commandService.addCommand(a);m.commandService.registerCommandContribution(m.toolbarId,
a.id,c,"orion.menuBarToolsGroup",!1,e(k.key))});c++}});g.all(b,function(a){return{_error:a}}).then(function(a){if(a=s.getFileMetadata()){var b=h.node(p);b&&(m.commandService.destroy(b),m.commandService.renderCommands(b.id,b,a,d,"button"));if(b=h.node("pageNavigationActions"))m.commandService.destroy(b),m.commandService.renderCommands(b.id,b,d,d,"button")}})})}};p.EditorCommandFactory=A;return p});
define("orion/inputManager","i18n!orion/edit/nls/messages orion/explorers/navigatorRenderer orion/i18nUtil orion/Deferred orion/EventTarget orion/objects orion/PageUtil".split(" "),function(k,l,h,f,d,g,e){function c(a){this._document=a.document||document;this._timeout=a.timeout;a="keypress keydown keyup mousemove mousedown mousemove".split(" ");for(var b=function(a){this._resetTimer()}.bind(this),c=0;c<a.length;c++)this._document.addEventListener(a[c],b,!0);d.attach(this)}function b(a,b){if(a){if(!b.Severity){var c=
b,d={Severity:"Error",Message:k.noResponse};if(0!==c.status)if(c.responseText){c=c.responseText;try{var e=JSON.parse(c);d.Severity=e.Severity||d.Severity;d.Message=e.Message||d.Message}catch(f){d.Message=c}}else try{d.Message=JSON.stringify(c)}catch(g){}b=d}a.setProgressResult(b)}else window.console.log(b)}function m(a){d.attach(this);this.serviceRegistry=a.serviceRegistry;this.statusService=a.statusService;this.fileClient=a.fileClient;this.progressService=a.progressService;this.contentTypeRegistry=
a.contentTypeRegistry;this.selection=a.selection;this._input=this._title="";this.dispatcher=null;this._unsavedChanges=[]}c.prototype={_resetTimer:function(){var a=this._document.defaultView||this._document.parentWindow;this._timer&&(a.clearTimeout(this._timer),this._timer=null);-1!==this._timeout&&(this._timer=a.setTimeout(function(){this.onIdle({type:"Idle"});this._timer=null;this._resetTimer()}.bind(this),this._timeout))},onIdle:function(a){return this.dispatchEvent(a)},setTimeout:function(a){this._timeout=
a;this._resetTimer()}};g.mixin(m.prototype,{_maybeLoadWorkspace:function(a){var b=this.fileClient;return a===b.fileServiceRootURL(a)?b.loadWorkspace(a).then(function(a){return a.Location}):(new f).resolve(a)},_read:function(a){var b=this.cachedMetadata||l.getClickedItem();if(b&&b.Location===a&&b.Parents&&b.Attributes&&b.ETag)return(new f).resolve(b);var c=this.fileClient,d=Array.prototype.slice.call(arguments,1);return this._maybeLoadWorkspace(a).then(function(a){return c.read.apply(c,[a].concat(d))})},
load:function(){var a=this.getInput();if(a){var c=this.fileClient,d=this._parsedLocation.resource,e=this.progressService,g=function(a,b,c){return!e?a:e.progress(a,h.formatMessage(b,c))},m=this.getEditor();if(this._fileMetadata)!this._saving&&!this._fileMetadata.Directory&&!this._readonly&&g(c.read(d,!0),k.ReadingMetadata,a).then(function(b){this._fileMetadata&&this._fileMetadata.Location===b.Location&&this._fileMetadata.ETag!==b.ETag&&(this._fileMetadata=b,(!m.isDirty()||window.confirm(k.loadOutOfSync))&&
g(c.read(d),k.Reading,a).then(function(b){m.setInput(a,null,b);this._unsavedChanges=[]}.bind(this)))}.bind(this));else{var l=d;if(0===l.indexOf("/gitapi/commit/")){var v=l.indexOf("/file"),u=l.indexOf("?",v);-1===u&&(u=l.length);l=l.substring(v,u);this._readonly=!0}var z=window.setTimeout(function(){z=null;this.reportStatus(h.formatMessage(k.Fetching,a))}.bind(this),800),x=function(){this.reportStatus("");z&&window.clearTimeout(z)}.bind(this),A=function(a){x();var c=null;this.serviceRegistry?c=this.serviceRegistry.getService("orion.page.message"):
this.statusService&&(c=this.statusService);b(c,a);this._setNoInput()}.bind(this);this._acceptPatch=null;g(this._read(l,!0),k.ReadingMetadata,l).then(function(b){b?b.Directory?f.when(b.Children||g(c.fetchChildren(b.ChildrenLocation),k.Reading,a),function(c){x();b.Children=c;this._setInputContents(this._parsedLocation,a,c,b)}.bind(this),A):this._isText(b)?g(c.read(d,!1,!0),k.Reading,a).then(function(c){x();"string"!==typeof c&&(this._acceptPatch=c.acceptPatch,c=c.result);this._setInputContents(this._parsedLocation,
a,c,b)}.bind(this),A):g(c._getService(d).readBlob(d),k.Reading,a).then(function(c){x();this._setInputContents(this._parsedLocation,a,c,b)}.bind(this),A):A({responseText:h.formatMessage(k.ReadingMetadataError,l)})}.bind(this),A)}}},processParameters:function(a){var b=this.getEditor();b&&b.processParameters&&b.processParameters(a)},getAutoLoadEnabled:function(){return this._autoLoadEnabled},getAutoSaveEnabled:function(){return this._autoSaveEnabled},getEditor:function(){return this.editor},getInput:function(){return this._input},
getTitle:function(){return this._title},getFileMetadata:function(){return this._fileMetadata},getReadOnly:function(){var a=this._fileMetadata;return this._readonly||!a||a.Attributes&&a.Attributes.ReadOnly},getContentType:function(){return this._contentType},onFocus:function(a){this._autoSaveEnabled&&this._errorSaving?this.save():this._autoLoadEnabled&&this.load()},onChanging:function(a){if(this._getSaveDiffsEnabled()){var b=this._unsavedChanges.length,c=a.removedCharCount,d=a.start,e=a.start+c,f=
0;0===a.addedCharCount?f=-1:0===c&&(f=1);if(0<b&&f===this.previousChangeType){b=this._unsavedChanges[b-1];if(0===c&&d===b.end+b.text.length){b.text+=a.text;return}if(0===a.addedCharCount&&e===b.start){b.start=d;return}}this.previousChangeType=f;this._unsavedChanges.push({start:d,end:e,text:a.text})}},reportStatus:function(a){this.statusReporter?this.statusReporter(a):this.editor&&this.editor.reportStatus(a)},save:function(){function a(a){f===B.getInput()&&(B.getFileMetadata().ETag=a.ETag,d.setInput(f,
null,g,!0));B.reportStatus("");e&&p&&p.setProgressResult({Message:k.Saved,Severity:"Normal"});B.afterSave&&B.afterSave();B._saving=!1}function c(a){B.reportStatus("");b(p,a);B._saving=!1;B._errorSaving=!0}if(!this._saving){var d=this.getEditor();if(d&&d.isDirty()&&!this.getReadOnly()){var e=this._errorSaving;this._saving=!0;var f=this.getInput();this.reportStatus(k["Saving..."]);this.dispatchEvent({type:"Saving",inputManager:this});d.markClean();var g=d.getText(),m=g;if(this._getSaveDiffsEnabled()&&
!this._errorSaving){for(var l=this._unsavedChanges,u=0,z=0;z<l.length;z++)u+=l[z].text.length;g.length>u&&(m={diff:l})}this._unsavedChanges=[];this._errorSaving=!1;var l={ETag:this.getFileMetadata().ETag},x=this._parsedLocation.resource,m=this.fileClient.write(x,m,l),A=this.progressService,p=null;this.serviceRegistry&&(p=this.serviceRegistry.getService("orion.page.message"));A&&(m=A.progress(m,h.formatMessage(k.savingFile,f)));var B=this;m.then(a,function(b){412===b.status?window.confirm(k.saveOutOfSync)?
(b=B.fileClient.write(x,g),A&&(b=A.progress(b,h.formatMessage(k.savingFile,f))),b.then(a,c)):B._saving=!1:c(b)})}}},setAutoLoadEnabled:function(a){this._autoLoadEnabled=a},setAutoSaveTimeout:function(a){this._autoSaveEnabled=-1!==a;this._idle?this._idle.setTimeout(a):(this._idle=new c({document:document,timeout:a}),this._idle.addEventListener("Idle",function(){this._errorSaving||this.save()}.bind(this)))},setContentType:function(a){this._contentType=a},setInput:function(a){if(!this._ignoreInput&&
(a||(a=e.hash()),"string"===typeof a)){var b=this.getEditor();a&&"#"!==a[0]&&(a="#"+a);var c=e.matchResourceParameters(a),d=this._parsedLocation||{};if(b&&b.isDirty()){var f=this._location;if(d.resource!==c.resource)if(this._autoSaveEnabled)this.save();else if(!window.confirm(k.confirmUnsavedChanges)){window.location.hash=f;return}}b=b&&d.editor!==c.editor;this._location=a;this._parsedLocation=c;this._ignoreInput=!0;this.selection&&this.selection.setSelections(a);this._ignoreInput=!1;(a=c.resource)?
a===this._input?b?(this.reportStatus(""),this._setInputContents(c,a,null,this._fileMetadata,this._isText(this._fileMetadata))):this.processParameters(c):(this._input=a,this._readonly=!1,this._fileMetadata=null,this.load()):this._setNoInput(!0)}},setTitle:function(a){var b=a.lastIndexOf("/");-1!==b&&(a=a.substring(b+1));this._title=a},setSaveDiffsEnabled:function(a){this._saveDiffsEnabled=a},_getSaveDiffsEnabled:function(){return this._saveDiffsEnabled&&null!==this._acceptPatch&&-1!==this._acceptPatch.indexOf("application/json-patch")},
_isText:function(a){a=this.contentTypeRegistry.getFileContentType(a);if(!a)return!0;var b=this.contentTypeRegistry.getContentType("text/plain");return this.contentTypeRegistry.isExtensionOf(a,b)},_setNoInput:function(a){a?this.fileClient.loadWorkspace("").then(function(a){this._input=a.ChildrenLocation;this._setInputContents(a.ChildrenLocation,null,a,a)}.bind(this)):(this._input=this._title=this._fileMetadata=null,this.setContentType(null),this.dispatchEvent({type:"InputChanged",input:null}))},_setInputContents:function(a,
b,c,d,e){var f,g=!1;d?(this._fileMetadata=d,this.setTitle(d.Location||String(d)),this.setContentType(this.contentTypeRegistry.getFileContentType(d)),f=d.Name,g=d.Directory):(this._fileMetadata=null,this.setTitle(b),this.setContentType(this.contentTypeRegistry.getFilenameContentType(this.getTitle())),f=this.getTitle());var h=this.getEditor();this._focusListener&&(h&&h.getTextView&&h.getTextView()&&h.getTextView().removeEventListener("Focus",this._focusListener),this._focusListener=null);this._changingListener&&
(h&&h.getModel&&h.getModel()&&h.getModel().removeEventListener("Changing",this._changingListener),this._changingListener=null);d={type:"InputChanged",input:a,name:f,title:b,contentType:this.getContentType(),metadata:d,location:window.location,contents:c};this.dispatchEvent(d);this.editor=h=d.editor;g||(h&&h.getModel&&h.getModel()&&h.getModel().addEventListener("Changing",this._changingListener=this.onChanging.bind(this)),e||h.setInput(b,null,c),h&&h.getTextView&&h.getTextView()&&h.getTextView().addEventListener("Focus",
this._focusListener=this.onFocus.bind(this)),this._unsavedChanges=[],this.processParameters(a))}});return{handleError:b,InputManager:m}});
define("orion/compare/resourceComparer","i18n!orion/compare/nls/messages require orion/Deferred orion/webui/littlelib orion/compare/compareUtils orion/compare/diffProvider orion/compare/compareView orion/highlight orion/fileClient orion/globalCommands orion/commands orion/keyBinding orion/searchAndReplace/textSearcher orion/editorCommands orion/objects orion/inputManager orion/editor/editorFeatures orion/URL-shim".split(" "),function(k,l,h,f,d,g,e,c,b,m,a,n,q,r,s,t,w){function v(a){this._syntaxHighlither=
new c.SyntaxHighlighter(a)}l={};l.DefaultDiffProvider=function(){function a(b){this.serviceRegistry=b;this._diffProvider=new g.DiffProvider(b)}a.prototype={_resolveTwoFiles:function(a,b){var c=this;return h.all([c._getContentType(a),c._getContentType(b)],function(a){return{_error:a}}).then(function(d){if(Array.isArray(d)&&2===d.length&&d[0]&&d[1]){var e=d[0];d=d[1];return(new h).resolve({oldFile:{URL:a,Name:c._resolveFileName(a),Type:e},newFile:{URL:b,Name:c._resolveFileName(b),Type:d},diffContent:c._diffContent})}e=
a?c._resolveFileName(a):"";d=b?c._resolveFileName(b):"";return(new h).resolve({oldFile:{URL:a,Name:e,Type:null},newFile:{URL:b,Name:d,Type:null},diffContent:c._diffContent})})},_resolveFileName:function(a){return a.split("?")[0]},_getContentType:function(a){a=this._resolveFileName(a);return this.serviceRegistry.getService("orion.core.contentTypeRegistry").getFilenameContentType(a)},_resolveComplexFileURL:function(a){var b=this;return this._diffProvider.getDiffFileURI(a).then(function(a,c){return b._resolveTwoFiles(a.Old,
a.New)},function(){})},resolveDiff:function(a,b,c){this._hasConflicts=c;if(b)return this._resolveTwoFiles(b,a);if(this._diffProvider){var d=this;return d._diffProvider.getDiffContent(a).then(function(b,c){d._diffContent=d._hasConflicts?b.split("diff --git")[1]:b;return d._resolveComplexFileURL(a)},function(){})}console.log("A diff provider is needed for compound diff URL")}};return a}();v.prototype={highlight:function(a,b,c){return this._syntaxHighlither.setup(b,c.getTextView(),null,a,!1)}};l.ResourceComparer=
function(){function c(a,d,f,g){this._registry=a;this._commandService=d;this._fileClient=new b.FileClient(a);this._fileClient=new b.FileClient(a);this._searchService=this._registry.getService("orion.core.search");this._progress=this._registry.getService("orion.page.progress");this.setOptions(f,!0);this._compareView=f.toggleable?new e.toggleableCompareView("inline"===f.type?"inline":"twoWay",g):"inline"===f.type?new e.inlineCompareView(g):new e.TwoWayCompareView(g);this._compareView.getWidget().setOptions({extCmdHolder:this});
g.highlighters||this._compareView.getWidget().setOptions({highlighters:[new v(a),new v(a)]});g.oldFile||this._compareView.getWidget().setOptions({oldFile:{readonly:this._checkReadonly(f.readonlyRight)}});g.newFile||this._compareView.getWidget().setOptions({newFile:{readonly:this._checkReadonly(f.readonly,!0)}});this.initExtCmds();this._initInputManagers();this._compareView.getWidget().initEditors(k["fetching..."]);this._inputManagers.forEach(function(a){if(a.manager){var b=this._compareView.getWidget().getEditors()[a.manager._editorIndex];
b.addEventListener("DirtyChanged",function(c){a.manager.setDirty(b.isDirty())})}}.bind(this))}c.prototype={_clearOptions:function(){this.options={}},_checkReadonly:function(a,b){return b?"undefined"===typeof a?!1:a:"undefined"===typeof a?!0:a},_getFileOptions:function(a){return 1===a?this._compareView.getWidget().options.newFile:this._compareView.getWidget().options.oldFile},_createInputManager:function(){return new t.InputManager({serviceRegistry:this._registry,fileClient:this._fileClient,progressService:this._progress})},
_initInputManagers:function(){this._inputManagers=[{},{}];!this.options.toggleable&&this._compareView.getWidget()._uiFactory&&"twoWay"===this._compareView.getWidget().type&&(this._checkReadonly(this.options.readonlyRight)||(this._inputManagers[0].manager=this._createInputManager(),this._initInputManager(this._inputManagers[0].manager,0,this._compareView.getWidget()._uiFactory.getActionDivId())),this._checkReadonly(this.options.readonly,!0)||(this._inputManagers[1].manager=this._createInputManager(),
this._initInputManager(this._inputManagers[1].manager,1,this._compareView.getWidget()._uiFactory.getActionDivId(!0))));var a=this;this._inputManagers.forEach(function(b){b.manager&&(this._getFileOptions(b.manager._editorIndex).keyBindingFactory=function(c,d,e,f){d=new q.TextSearcher(c,a._registry,a._commandService,e);e=(new w.KeyBindingsFactory).createKeyBindings(c,e,f,d);(new r.EditorCommandFactory({serviceRegistry:a._registry,commandRegistry:a._commandService,fileClient:a._fileClient,inputManager:b.manager,
toolbarId:b.manager._actionBarId,readonly:!1,navToolbarId:"pageNavigationActions",textSearcher:d})).generateSimpleEditorCommands(c,1===b.manager._editorIndex?"orion.compare.save.left":"orion.compare.save.right");return e})}.bind(this))},_initInputManager:function(a,b,c){var d=this;s.mixin(a,{filePath:"",_editorIndex:b,_actionBarId:c,getInput:function(){return this.filePath},setDirty:function(a){var b=d._compareView.getWidget().getEditors(),c=a;b&&2===b.length&&(c=b[0].isDirty()||b[1].isDirty());m.setDirtyIndicator(c);
d._compareView.getWidget().refreshTitle&&d._compareView.getWidget().refreshTitle(this._editorIndex,a)},getFileMetadata:function(){return this._fileMetadata},getEditor:function(){return d._compareView.getWidget().getEditors()[this._editorIndex]},setInput:function(a,b){this._parsedLocation={resource:a};d._progress.progress(d._fileClient.read(a,!0),"Getting file metadata "+a).then(function(a){this._fileMetadata=a;var b=f.node(this._actionBarId);if(b){d._commandService.destroy(b);var c=this._editorIndex;
d._commandService.renderCommands(b.id,b,d._compareView.getWidget().getEditors()[c],d._compareView.getWidget().getEditors()[c],"button")}a&&this.setTitle(a.Location,a)}.bind(this),function(b){console.error("Error loading file metadata: "+b.message);this.setTitle(a)}.bind(this));this.lastFilePath=a},setTitle:function(a,b){"*"===a.charAt(0)?m.setDirtyIndicator(!0):m.setDirtyIndicator(!1)},afterSave:function(){var a=d._compareView.getWidget().getEditors()[this._editorIndex].getTextView().getText();d._getFileOptions(this._editorIndex).Content=
a;d._compareView.getWidget().refresh()}})},setOptions:function(a,b){b&&this._clearOptions();this.options||(this.options={});a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this))},generateLink:function(a){a=a.getCurrentDiffPos();a=d.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:this.options.readonly,readonlyRight:this.options.readonlyRight,conflict:this.options.hasConflicts,block:a.block?a.block:1,change:a.change?a.change:0});a=(new URL(a,window.location.href)).href;
prompt(k["Copy the link URL:"],a)},openComparePage:function(a){a=a.getCurrentDiffPos();return d.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:!this.options.editableInComparePage,conflict:this.options.hasConflicts,block:a.block?a.block:1,change:a.change?a.change:0})},initExtCmds:function(){var b=this._compareView.getWidget().options.commandProvider;if(b&&b.getOptions().commandSpanId){var b=b.getOptions().commandSpanId,c=new a.Command({tooltip:k["Generate link of the current diff"],
name:k["Generate Link"],id:"orion.compare.generateLink",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.extCmdHolder.options.resource&&a.options.extCmdHolder.options.generateLink},callback:function(a){a.items.options.extCmdHolder.generateLink(a.items)}}),d=new a.Command({tooltip:k["Open the compare page"],name:k.Compare,id:"orion.compare.openComparePage",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.extCmdHolder.options.resource&&!a.options.extCmdHolder.options.generateLink},
hrefCallback:function(a){return a.items.options.extCmdHolder.openComparePage(a.items)}});this._commandService.addCommand(c);this._commandService.addCommand(d);this._commandService.registerCommandContribution(b,"orion.compare.openComparePage",98);this._commandService.registerCommandContribution(b,"orion.compare.generateLink",99,null,!1,new n.KeyBinding("l",!0,!0))}},_getFilesContents:function(a){var b=[];a.forEach(function(a){b.push(this._loadSingleFile(a))}.bind(this));return h.all(b,function(a){return{_error:a}})},
_isImage:function(a){switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":return!0}return!1},_loadSingleFile:function(a){return this._registry.getService("orion.page.progress").progress(this._fileClient.read(a.URL),"Getting contents of "+a.URL).then(function(b){a.Content=b;return a}.bind(this),function(b,c){404===b.status&&(a.Content="");return a}.bind(this))},start:function(){if(this.options.resource){if(this.options.diffProvider){var a=
this;return a.options.diffProvider.resolveDiff(a.options.resource,a.options.compareTo,a.options.hasConflicts).then(function(b){a._compareView.getWidget().setOptions(b);b=a._isImage(b.newFile.Type);var c=a._compareView.getWidget().options;if(a._checkReadonly(a.options.readonlyRight)||b)c.oldFile.readonly=!0;if(a._checkReadonly(a.options.readonly,!0)||b)c.newFile.readonly=!0;return b?(a._compareView.initImageMode(),a._compareView.getWidget().refresh().then(function(a){return(new h).resolve(a+5)})):
a._getFilesContents(c.diffContent?[c.oldFile]:[c.oldFile,c.newFile]).then(function(){var b=a._compareView.getWidget().refresh(!0);this._inputManagers.forEach(function(b){if(b.manager){var c=a._getFileOptions(b.manager._editorIndex),d=a._compareView.getWidget().getEditors()[b.manager._editorIndex];b.manager.filePath=c.URL;b.manager.setInput(c.URL,d)}});return(new h).resolve(b)}.bind(a))})}console.log("A diff provider is needed for Complex diff URL")}}};return c}();return l});
define("orion/widgets/themes/editor/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme"],function(k,l){function h(){}function f(){this.styles=[];var c=new h;c.name="Eclipse";c.annotationRuler="white";c.background="white";c.comment="green";c.keyword="#7f0055";c.text="darkSlateGray";c.string="blue";c.overviewRuler="white";c.lineNumberOdd="#444";c.lineNumberEven="#444";c.lineNumber="#444";c.currentLine="#EAF2FE";c.tag="darkorange";c.attribute="cadetBlue";c.fontFamily=g;c.fontSize=
e;this.styles.push(c);c=new h;c.name="Prospecto";c.annotationRuler="white";c.background="white";c.comment="#3C802C";c.keyword="#CC4C07";c.text="#333";c.string="#446FBD";c.overviewRuler="white";c.lineNumberOdd="silver";c.lineNumberEven="silver";c.lineNumber="silver";c.currentLine="#EAF2FE";c.tag="#CC4C07";c.attribute="cadetBlue";c.fontFamily=g;c.fontSize=e;this.styles.push(c);c=new h;c.name="Blue";c.annotationRuler="lavender";c.background="aliceBlue";c.comment="indigo";c.keyword="cornFlowerBlue";c.text=
"navy";c.string="cornFlowerBlue";c.overviewRuler="lavender";c.lineNumberOdd="darkSlateGray";c.lineNumberEven="darkSlateGray";c.lineNumber="darkSlateGray";c.currentLine="white";c.tag="cornFlowerBlue";c.attribute="cadetBlue";c.fontFamily=g;c.fontSize=e;this.styles.push(c);c=new h;c.name="Ambience";c.annotationRuler="#3D3D3D";c.background="#202020";c.comment="mediumslateblue";c.keyword="cornFlowerBlue";c.text="darkseagreen";c.string="lightcoral";c.overviewRuler="white";c.lineNumberOdd="black";c.lineNumberEven=
"black";c.lineNumber="black";c.currentLine="lightcyan";c.tag="cornFlowerBlue";c.attribute="cadetBlue";c.fontFamily=g;c.fontSize=e;this.styles.push(c);c=new h;c.name="Tierra";c.annotationRuler="moccasin";c.background="lemonchiffon";c.comment="darkseagreen";c.keyword="darkred";c.text="#555555";c.string="orangered";c.overviewRuler="moccasin";c.lineNumberOdd="chocolate";c.lineNumberEven="chocolate";c.lineNumber="chocolate";c.currentLine="#baa289";c.tag="darkred";c.attribute="cadetBlue";c.fontFamily=g;
c.fontSize=e;this.styles.push(c);c=new h;c.name="Nimbus";c.annotationRuler="#444";c.background="dimgray";c.comment="darkseagreen";c.keyword="darkorange";c.text="white";c.string="cornflowerblue";c.overviewRuler="#444";c.lineNumberOdd="#aaa";c.lineNumberEven="#aaa";c.lineNumber="#aaa";c.currentLine="#aabfbb";c.tag="darkorange";c.attribute="cadetBlue";c.fontFamily=g;c.fontSize=e;this.styles.push(c);c=new h;c.name="Adelante";c.annotationRuler="#E2D2B2";c.background="#F1E7C8";c.comment="#5D774E";c.keyword=
"#AF473B";c.text="dimgray";c.string="#DE5D3B";c.overviewRuler="#E2D2B2";c.lineNumberOdd="#AF473B";c.lineNumberEven="#AF473B";c.lineNumber="#AF473B";c.currentLine="#9e937b";c.tag="#AF473B";c.attribute="cadetBlue";c.fontFamily=g;c.fontSize=e;this.styles.push(c);c=new h;c.name="Raspberry Pi";c.annotationRuler="seashell";c.background="seashell";c.comment="#66B32F";c.keyword="#E73E36";c.text="dimgray";c.string="darkorange";c.overviewRuler="seashell";c.lineNumberOdd="#E73E36";c.lineNumberEven="#E73E36";
c.lineNumber="#E73E36";c.currentLine="#F5B1AE";c.tag="#E73E36";c.attribute="cadetBlue";c.fontFamily=g;c.fontSize=e;this.styles.push(c)}function d(){return this.styles}var g='"Consolas", "Monaco", "Vera Mono", "monospace"',e="10pt";f.prototype.styles=[];f.prototype.getStyles=d;f.prototype.fontSettable=!0;f.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"editorstyles",defaultTheme:"Prospecto",selectedKey:"editorSelected",version:"5.0"}};f.prototype.parseToXML=function(c){try{var b=
null;if(window.DOMParser){var b=(new DOMParser).parseFromString(c,"text/xml"),d=b.getElementsByTagName("parsererror");return!d||!d.length||!d[0].childNodes.length?b:null}b=new ActiveXObject("Microsoft.XMLDOM");b.async=!1;b.loadXML(c);return b}catch(a){}};f.prototype.selectFontSize=function(c){console.log("fontsize: "+c)};f.prototype.importTheme=function(c){console.log("import theme");console.log(c);var b=c.parameters.valueFor("name"),b=this.parseToXML(b),d=new h;d.name=b.getElementsByTagName("colorTheme")[0].attributes[1].value;
d.annotationRuler=b.getElementsByTagName("background")[0].attributes[0].value;d.background=b.getElementsByTagName("background")[0].attributes[0].value;d.comment=b.getElementsByTagName("singleLineComment")[0].attributes[0].value;d.keyword=b.getElementsByTagName("keyword")[0].attributes[0].value;d.text=b.getElementsByTagName("foreground")[0].attributes[0].value;d.string=b.getElementsByTagName("string")[0].attributes[0].value;d.overviewRuler=b.getElementsByTagName("background")[0].attributes[0].value;
d.lineNumberOdd=b.getElementsByTagName("lineNumber")[0].attributes[0].value;d.lineNumberEven=b.getElementsByTagName("lineNumber")[0].attributes[0].value;d.lineNumber=b.getElementsByTagName("lineNumber")[0].attributes[0].value;d.currentLine=b.getElementsByTagName("selectionBackground")[0].attributes[0].value;c.items.addTheme(d)};f.prototype.processSettings=function(c,b){var d=l.TextTheme.getTheme();d.setThemeClass("editorTheme",d.buildStyleSheet("editorTheme",c))};f.prototype.getViewData=function(){var c=
{top:10,left:10,width:400,height:350},b=c.left,d=c.top;c.shapes=[{type:"TEXT",name:k["Line Numbers"],label:"1",x:b+20,y:d+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"},{type:"RECTANGLE",name:k.Background,x:b+46,y:d,width:290,height:c.height,family:"background",fill:"white"},{type:"TEXT",name:k.Strings,label:"'text/javascript'",x:b+134,y:d+20,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:k.Foreground,label:"\x3d",x:b+124,y:d+20,fill:"darkSlateGray",
family:"text",font:"9pt sans-serif"},{type:"RECTANGLE",name:k["Current Line"],x:b+46,y:d+87,width:290,height:18,family:"currentLine",fill:"#eaf2fd"},{type:"TEXT",name:k["HTML Attribute"],label:"type",x:b+98,y:d+20,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"RECTANGLE",name:k["Overview Ruler"],x:b+336,y:d,width:14,height:c.height,family:"overviewRuler",fill:"white"},{type:"TEXT",name:k.Comments,label:"/* comment */",x:b+75,y:d+40,fill:"darkSeaGreen",family:"comment",font:"9pt sans-serif"},
{type:"TEXT",name:k["HTML Tag"],label:"\x3cscript",x:b+55,y:d+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:k["HTML Tag"],label:"\x3e",x:b+213,y:d+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:k.Strings,label:"'Result'",x:b+164,y:d+80,fill:"cornflowerBlue",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:k.Foreground,label:"multiply(a,b){",x:b+120,y:d+60,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",
name:k.Keywords,label:"function",x:b+75,y:d+60,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:k.Keywords,label:"var",x:b+95,y:d+80,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:k.Foreground,label:"output \x3d ",x:b+115,y:d+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:k.Foreground,label:";",x:b+205,y:d+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:k.Keywords,label:"var",x:b+
95,y:d+100,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:k.Foreground,label:"result \x3d a*b;",x:b+115,y:d+100,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:k.Keywords,label:"return",x:b+95,y:d+120,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:k.Foreground,label:"output + result;",x:b+135,y:d+120,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:k.Foreground,label:"}",x:b+75,y:d+140,
fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:k["HTML Tag"],label:"\x3c/script\x3e",x:b+55,y:d+160,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:k["HTML Tag"],label:"\x3cstyle",x:b+55,y:d+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:k["HTML Attribute"],label:"type",x:b+95,y:d+200,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"TEXT",name:k.Foreground,label:"\x3d",x:b+121,y:d+200,fill:"darkSlateGray",
family:"text",font:"9pt sans-serif"},{type:"TEXT",name:k.Strings,label:"'text/css'",x:b+131,y:d+200,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:k["HTML Tag"],label:"\x3e",x:b+180,y:d+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:k["CSS Class Name"],label:".some-class",x:b+75,y:d+220,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:k["CSS Class Name"],label:"{",x:b+145,y:d+220,fill:"darkSlateGray",family:"text",
font:"9pt sans-serif"},{type:"TEXT",name:k["CSS Attribute"],label:"color:",x:b+95,y:d+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:k["CSS Value"],label:"#123456",x:b+130,y:d+240,fill:"darkSlateGray",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:k["CSS Text"],label:";",x:b+180,y:d+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:k["CSS Class Name"],label:"}",x:b+75,y:d+260,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},
{type:"TEXT",name:k["HTML Tag"],label:"\x3c/style\x3e",x:b+55,y:d+280,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"RECTANGLE",name:k["Annotation Ruler"],x:b,y:d,width:46,height:c.height,family:"annotationRuler",fill:"white"}];for(var a=0;16>a;a++)c.shapes.push({type:"TEXT",name:k["Line Numbers"],label:a+1,x:b+20,y:d+20*a+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"});return c};return{ThemeData:f,getStyles:d}});
define("built-compare.js","orion/browserCompatibility orion/bootstrap orion/status orion/progress orion/operationsClient orion/commandRegistry orion/fileClient orion/searchClient orion/globalCommands orion/compare/compareCommands orion/compare/resourceComparer orion/widgets/themes/ThemePreferences orion/widgets/themes/editor/ThemeData orion/compare/compareUtils orion/contentTypes orion/PageUtil i18n!orion/compare/nls/messages".split(" "),function(k,l,h,f,d,g,e,c,b,m,a,n,q,r,s,t,w){l.startup().then(function(k){var l=
k.serviceRegistry;k=k.preferences;var r=new g.CommandRegistry({}),x=new e.FileClient(l);new s.ContentTypeRegistry(l);var x=new c.Searcher({serviceRegistry:l,commandService:r,fileService:x}),A=new d.OperationsClient(l);new h.StatusReportingService(l,A,"statusPane","notifications","notificationArea");new f.ProgressService(l,A,r);(new n.ThemePreferences(k,new q.ThemeData)).apply();b.generateBanner("orion-compare",l,r,k,x);b.setPageTarget({task:w.Compare,serviceRegistry:l,commandService:r});var p=new a.DefaultDiffProvider(l),
B=new m.CompareCommandFactory({commandService:r,commandSpanId:"pageNavigationActions"}),y=function(){var b=t.matchResourceParameters();(new a.ResourceComparer(l,r,{readonly:"true"===b.readonly,readonlyRight:"undefined"===typeof b.readonlyRight||"true"===b.readonlyRight,generateLink:!0,hasConflicts:"true"===b.conflict,diffProvider:p,resource:b.resource,compareTo:b.compareTo},{parentDivId:"compareContainer",commandProvider:B,showTitle:!0,showLineStatus:!0,blockNumber:"undefined"===typeof b.block?1:
b.block,changeNumber:"undefined"===typeof b.change?0:b.change})).start()};y();window.addEventListener("hashchange",function(){y()},!1)})});
//@ sourceMappingURL=built-compare.js.map