/*

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2014 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
     IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made
 available under the terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2009, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
     IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation
 RequireJS text 2.0.5 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/requirejs/text for details

 Copyright (c) 2012, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010,2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2014 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
     IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: 
  Felipe Heidrich (IBM Corporation) - initial API and implementation
  Silenio Quarti (IBM Corporation) - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
     IBM Corporation - initial API and implementation
 RequireJS i18n 2.0.2 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/requirejs/i18n for details
*/
(function(k,g){"function"===typeof define&&define.amd?define("orion/Deferred",g):"object"===typeof exports?module.exports=g():(k.orion=k.orion||{},k.orion.Deferred=g())})(this,function(){function k(){for(var c;c=h.shift();)c();m=!1}function g(c){h.push(c);m||(m=!0,e())}function d(c){return function(a){c(a)}}function b(){function c(){for(var a;a=h.shift();){var c=a.deferred,l="fulfilled"===n?"resolve":"reject";a=a[l];if("function"===typeof a)try{var b=a(e),f=b&&("object"===typeof b||"function"===typeof b)&&
b.then;if("function"===typeof f)if(b===c.promise)c.reject(new TypeError);else{var m=b.cancel;"function"===typeof m?c._parentCancel=m.bind(b):delete c._parentCancel;f.call(b,d(c.resolve),d(c.reject),d(c.progress))}else c.resolve(b)}catch(g){c.reject(g)}else c[l](e)}}function a(a){delete m._parentCancel;n="rejected";e=a;h.length&&g(c)}function l(f){function d(a){return function(c){(!n||"assumed"===n)&&a(c)}}delete m._parentCancel;try{var k=f&&("object"===typeof f||"function"===typeof f)&&f.then;if("function"===
typeof k)if(f===m)a(new TypeError);else{n="assumed";var s=f&&f.cancel;if("function"!==typeof s){var x=new b;f=x.promise;try{k(x.resolve,x.reject,x.progress)}catch(y){x.reject(y)}s=f.cancel;k=f.then}e=f;k.call(f,d(l),d(a));m._parentCancel=s.bind(f)}else n="fulfilled",e=f,h.length&&g(c)}catch(v){d(a)(v)}}function f(){var c=m._parentCancel;c?(delete m._parentCancel,c()):n||(c=Error("Cancel"),c.name="Cancel",a(c))}var e,n,h=[],m=this;this.resolve=function(a){n||l(a);return m};this.reject=function(c){n||
a(c);return m};this.progress=function(a){n||h.forEach(function(c){if(c.progress)try{c.progress(a)}catch(l){}});return m.promise};this.cancel=function(){m._parentCancel?setTimeout(f,0):f();return m};this.then=function(a,l,f){var e=new b;e._parentCancel=m.promise.cancel;h.push({resolve:a,reject:l,progress:f,deferred:e});("fulfilled"===n||"rejected"===n)&&g(c);return e.promise};this.promise={then:m.then,cancel:m.cancel}}var h=[],m=!1,e=function(){if("undefined"!==typeof process&&"function"===typeof process.nextTick){var c=
process.nextTick;return function(){c(k)}}if("function"===typeof MutationObserver){var a=document.createElement("div");(new MutationObserver(k)).observe(a,{attributes:!0});return function(){a.setAttribute("class","_tick")}}return function(){setTimeout(k,0)}}();b.all=function(c,a){function l(a,c){m||(h[a]=c,0===--e&&d.resolve(h))}function f(c,b){if(!m){if(a)try{l(c,a(b));return}catch(f){b=f}d.reject(b)}}var e=c.length,h=[],m=!1,d=new b;d.then(void 0,function(){m=!0;c.forEach(function(a){a.cancel&&a.cancel()})});
0===e?d.resolve(h):c.forEach(function(a,c){a.then(l.bind(void 0,c),f.bind(void 0,c))});return d.promise};b.when=function(c,a,l,f){var e;c&&"function"===typeof c.then||(e=new b,e.resolve(c),c=e.promise);return c.then(a,l,f)};return b});
(function(k,g){"function"===typeof define&&define.amd?define("orion/plugin",["orion/Deferred"],g):"object"===typeof exports?module.exports=g(require("orion/Deferred")):(k.orion=k.orion||{},k.orion.PluginProvider=g(k.orion.Deferred))})(this,function(k){function g(d,b){this.__objectId=d;this.__methods=b}return function(d){function b(a){p&&("undefined"===typeof ArrayBuffer&&(a=JSON.stringify(a)),p===self?p.postMessage(a):p.postMessage(a,"*"))}function h(){var a=[];Object.keys(y).forEach(function(c){var l=
y[c];a.push({serviceId:c,names:l.names,methods:l.methods,properties:l.properties})});return{headers:q||{},services:a}}function m(a,c){if(c&&c instanceof XMLHttpRequest){var l,b;try{l=c.status,b=c.statusText}catch(f){l=0,b=""}return{status:l||0,statusText:b}}return c}function e(a){var c=a?JSON.parse(JSON.stringify(a,m)):a;a instanceof Error&&(c.__isError=!0,c.message=c.message||a.message,c.name=c.name||a.name);return c}function c(a){if(!p)return(new k).reject(Error("plugin not connected"));a.id=String(r++);
var c=new k;s[a.id]=c;c.then(null,function(c){n&&(c instanceof Error&&"Cancel"===c.name)&&v({requestId:a.id,method:"cancel",params:c.message?[c.message]:[]})});var l=Object.prototype.toString;a.params.forEach(function(b,f){if("[object Object]"===l.call(b)&&!(b instanceof g)){var e,h;for(e in b)"[object Function]"===l.call(b[e])&&(h=h||[],h.push(e));if(h){var n=t++;x[n]=b;e=function(){delete x[n]};c.then(e,e);a.params[f]=new g(n,h)}}});v(a);return c.promise}function a(a,c){a||0===a?v({id:a,result:null,
error:c}):console.log(c)}function l(a,l,b,f){f.forEach(function(a,l){if(a&&"undefined"!==typeof a.__objectId){var b={};a.__methods.forEach(function(l){b[l]=function(){return c({objectId:a.__objectId,method:l,params:Array.prototype.slice.call(arguments)})}});f[l]=b}});var h=void 0===typeof a?null:{id:a,result:null,error:null};try{var n=b.apply(l,f);h&&(n&&"function"===typeof n.then?(u[a]=n,n.then(function(c){delete u[a];h.result=c;v(h)},function(c){u[a]&&(delete u[a],h.error=e(c),v(h))},function(){v({responseId:a,
method:"progress",params:Array.prototype.slice.call(arguments)})})):(h.result=n,v(h)))}catch(q){h&&(h.error=e(q),v(h))}}function f(c){if(!(c.source!==p&&"undefined"!==typeof window)){c="string"!==typeof c.data?c.data:JSON.parse(c.data);try{if(c.method){var b=c.method,f=c.params||[];if("serviceId"in c){var e=y[c.serviceId];e||a(c.id,"service not found");e=e.implementation;b in e?l(c.id,e,e[b],f):a(c.id,"method not found")}else if("objectId"in c){var h=x[c.objectId];h||a(c.id,"object not found");!b in
h?l(c.id,h,h[b],f):a(c.id,"method not found")}else if("requestId"in c){var n=u[c.requestId];n&&("cancel"===b&&n.cancel)&&n.cancel.apply(n,f)}else if("responseId"in c){var q=s[c.responseId];q&&("progress"===b&&q.progress)&&q.progress.apply(q,f)}else throw Error("Bad method: "+c.method);}else{var d=s[String(c.id)];delete s[String(c.id)];c.error?d.reject(c.error):d.resolve(c.result)}}catch(m){console.log("Plugin._messageHandler "+m)}}}var q=d,n=!1,p=null,r=0,t=0,w=0,u={},s={},x={},y={},v=b;this.updateHeaders=
function(a){if(n)throw Error("Cannot update headers. Plugin Provider is connected");q=a};this.registerServiceProvider=this.registerService=function(a,c,l){if(n)throw Error("Cannot register service. Plugin Provider is connected");"string"===typeof a?a=[a]:Array.isArray(a)||(a=[]);var b=null,f=[];for(b in c)"function"===typeof c[b]&&f.push(b);y[w++]={names:a,methods:f,implementation:c,properties:l||{},listeners:{}}};this.connect=function(a,c){if(!n){if("undefined"===typeof window)p=self;else if(window!==
window.parent)p=window.parent;else if(null!==window.opener)p=window.opener;else{c&&c("No valid plugin target");return}addEventListener("message",f,!1);var l={method:"plugin",params:[h()]};b(l);n=!0}a&&a()};this.disconnect=function(){n&&(removeEventListener("message",f),p=null,n=!1)}}});
(function(){function k(b,d,e,c,a,l){d[b]&&(e.push(b),(!0===d[b]||1===d[b])&&c.push(a+b+"/"+l))}function g(b,d,e,c,a){d=c+d+"/"+a;require._fileExists(b.toUrl(d+".js"))&&e.push(d)}function d(b,g,e){for(var c in g)g.hasOwnProperty(c)&&(!b.hasOwnProperty(c)||e)?b[c]=g[c]:"object"===typeof g[c]&&d(b[c],g[c],e)}var b=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(h){var m=h.config?h.config():{},m=m||{};return{version:"2.0.1+",load:function(e,c,a,l){l=l||{};l.locale&&(m.locale=
l.locale);var f=b.exec(e),h=f[1],n=f[4],p=f[5],r=n.split("-"),t=[],w={},u,s="";f[5]?(h=f[1],e=h+p):(p=f[4],n=m.locale,n||(n=m.locale="undefined"===typeof navigator?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()),r=n.split("-"));if(l.isBuild){t.push(e);g(c,"root",t,h,p);for(u=0;u<r.length;u++)l=r[u],s+=(s?"-":"")+l,g(c,s,t,h,p);c(t,function(){a()})}else c([e],function(l){var b=[],f;k("root",l,b,t,h,p);for(u=0;u<r.length;u++)f=r[u],s+=(s?"-":"")+f,k(s,l,b,t,h,p);c(t,function(){var f,
e,n;for(f=b.length-1;-1<f&&b[f];f--){n=b[f];e=l[n];if(!0===e||1===e)e=c(h+n+"/"+p);d(w,e)}a(w)})})}}})})();
define("orion/i18n",[],function(){return{load:function(k,g,d,b){b=b||{};var h=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,m=h.exec(k);if(m){if(!g.defined||g.defined(k))try{d(g(k));return}catch(e){}if(b.isBuild||b.isTest)d({});else if(g.specified&&!g.specified("orion/bootstrap"))d({});else{var c=m[1],a=m[3]?m[2]:"",l=m[3]||m[2];g(["orion/bootstrap"],function(f){f.startup().then(function(f){var e=f.serviceRegistry;f=e.getServiceReferences("orion.i18n.message");if(a)f.some(function(a){return k===a.getProperty("name")?
(e.getService(a).getMessageBundle().then(function(a){d(a)},function(){d({})}),!0):!1})||d({});else{var p={},r;f.forEach(function(f){var e=f.getProperty("name");if((m=h.exec(e))&&c===m[1]&&l===(m[3]||m[2]))if(a=m[3]?m[2]:""){if((f=b.locale||("undefined"!==typeof navigator?navigator.language||navigator.userLanguage:null))&&0===f.toLowerCase().indexOf(a.toLowerCase()))p[a]=!0,(!g.specified||!g.specified(e))&&define(e,["orion/i18n!"+e],function(a){return a})}else r=f});!g.specified||!g.specified(k)?r?
e.getService(r).getMessageBundle().then(function(a){Object.keys(p).forEach(function(c){"undefined"===typeof a[c]&&(a[c]=p[c])});define(k,[],a);d(a)},function(){define(k,[],p);d(p)}):(define(k,[],p),d(p)):d(p)}})})}}else d(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 Editor":"Orion Markdown Editor","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-06-28_22-01-29","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","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,g){var d={root:g};Object.keys(k).forEach(function(b){"undefined"===typeof d[b]&&(d[b]=k[b])});return d});
define("orion/util",[],function(){var k=navigator.userAgent,g=-1!==k.indexOf("MSIE")||-1!==k.indexOf("Trident")?document.documentMode:void 0,d=parseFloat(k.split("Firefox/")[1]||k.split("Minefield/")[1])||void 0,b=-1!==k.indexOf("Opera")?parseFloat(k.split("Version/")[1]):void 0,h=parseFloat(k.split("Chrome/")[1])||void 0,m=-1!==k.indexOf("Safari")&&!h,e=parseFloat(k.split("WebKit/")[1])||void 0,c=-1!==k.indexOf("Android"),a=-1!==k.indexOf("iPad"),k=-1!==k.indexOf("iPhone"),l=a||k,f=-1!==navigator.platform.indexOf("Mac"),
q=-1!==navigator.platform.indexOf("Win"),n=-1!==navigator.platform.indexOf("Linux"),p="undefined"!==typeof document&&"ontouchstart"in document.createElement("input");return{formatMessage:function(a){var c=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,l){return c[(l<<0)+1]})},createElement:function(a,c){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",c):a.createElement(c)},isIE:g,isFirefox:d,isOpera:b,isChrome:h,isSafari:m,isWebkit:e,isAndroid:c,isIPad:a,isIPhone:k,
isIOS:l,isMac:f,isWindows:q,isLinux:n,isTouch:p,platformDelimiter:q?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(k){function g(a,c){c||(c=document);return c.querySelectorAll(a)}function d(a){var c=a.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}[a.nodeName.toLowerCase()]&&!a.attributes.tabIndex&&(c=-1);return c}function b(a){if(0<=d(a))return a;if(a.hasChildNodes())for(var c=0;c<a.childNodes.length;c++){var f=b(a.childNodes[c]);if(f)return f}return null}function h(a){if(0<=
d(a))return a;if(a.hasChildNodes())for(var c=a.childNodes.length-1;0<=c;c--){var b=h(a.childNodes[c]);if(b)return b}return null}function m(a,c){if(3===a.nodeType){var b=e.exec(a.nodeValue);b&&1<b.length&&c(a,b)}if(a.hasChildNodes())for(b=0;b<a.childNodes.length;b++)m(a.childNodes[b],c)}var e=/\$\{([^\}]+)\}/,c=null;return{$:function(a,c){c||(c=document);return c.querySelector(a)},$$:g,$$array:function(a,c){return Array.prototype.slice.call(g(a,c))},node:function(a){var c=a;"string"===typeof a&&(c=
document.getElementById(a));return c},contains:function(a,c){if(!a||!c)return!1;if(a===c)return!0;var b=a.compareDocumentPosition(c);return Boolean(b&16)},bounds:function(a){a=a.getBoundingClientRect();return{left:a.left+document.documentElement.scrollLeft,top:a.top+document.documentElement.scrollTop,width:a.width,height:a.height}},empty:function(a){for(;a.hasChildNodes();)a.removeChild(a.firstChild)},firstTabbable:b,lastTabbable:h,stop:function(a){window.document.all&&(a.keyCode=0);a.preventDefault&&
(a.preventDefault(),a.stopPropagation())},processTextNodes:function(a,c){m(a,function(a,b){a.parentNode.replaceChild(document.createTextNode(c[b[1]]||b[1]),a)})},processDOMNodes:function(a,c){m(a,function(a,b){var e=c[b[1]];if(e){var h=document.createRange(),d=b.index;h.setStart(a,d);h.setEnd(a,d+b[0].length);h.deleteContents();h.insertNode(e)}})},addAutoDismiss:function(a,b){function f(a){c.forEach(function(c){var b=!1,l=c.excludeNodes.some(function(c){return document.body.contains(c)?(b=!0,c.contains(a.target)):
!1});if(b&&!l)try{c.dismiss(a)}catch(f){"undefined"!==typeof console&&console&&console.error(f&&f.message)}});c=c.filter(function(a){return a.excludeNodes.some(function(a){return document.body.contains(a)})})}null===c&&(c=[],document.addEventListener("click",f,!0),k.isIOS&&document.addEventListener("touchend",function(a){function c(){a.target.removeEventListener("click",c)}0===a.touches.length&&a.target.addEventListener("click",c)},!1));c.push({excludeNodes:a,dismiss:b})},setFramesEnabled:function(a){for(var c=
document.getElementsByTagName("iframe"),b=0;b<c.length;b++)c[b].parentNode.style.pointerEvents=a?"":"none"},removeAutoDismiss:function(a){c=c.filter(function(c){return a!==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("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(k,g){function d(b){this._init(b)}d.prototype={_init:function(b){var h=b.parent,d=this,h=g.node(h);if(!h)throw k["no parent"];if(!b.model)throw k["no tree model"];if(!b.renderer)throw k["no renderer"];this._parent=h;this._treeModel=b.model;this._onComplete=b.onComplete;this._renderer=b.renderer;this._showRoot=void 0===b.showRoot?!1:b.showRoot;this._indent=void 0===b.indent?16:b.indent;this._onCollapse=b.onCollapse;
this._labelColumnIndex=void 0===b.labelColumnIndex?0:b.labelColumnIndex;this._id=void 0===b.id?"treetable":b.id;this._tableStyle=b.tableStyle;this._tableElement=b.tableElement||"table";this._tableBodyElement=b.tableBodyElement||"tbody";this._tableRowElement=b.tableRowElement||"tr";this._treeModel.getRoot(function(b){d._root=b;d._showRoot?(b._depth=0,d._generate([b],0)):d._treeModel.getChildren(b,function(c){d.destroyed||d._generate(c,0)})})},destroy:function(){this.destroyed=!0},_generate:function(b,
h){g.empty(this._parent);var d=document.createElement("div");this._renderer.wrapperCallback&&this._renderer.wrapperCallback(d);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===b.length?this._renderer.emptyCallback&&this._renderer.emptyCallback(this._bodyElement):this._generateChildren(b,h);e.appendChild(this._bodyElement);d.appendChild(e);this._parent.appendChild(d);this._rowsChanged();this._onComplete&&this._onComplete(this)},_generateChildren:function(b,h,d){for(var e=0;e<b.length;e++){var c=document.createElement(this._tableRowElement);c.id=this._treeModel.getId(b[e]);c._depth=h;c._item=b[e];this._renderer.render(b[e],c);var a=this._indent*h;c.childNodes[Math.min(c.childNodes.length-
1,this._labelColumnIndex)].style.paddingLeft=a+"px";this._renderer.rowCallback&&this._renderer.rowCallback(c,b[e]);d?(this._bodyElement.insertBefore(c,d.nextSibling),d&&(d=c)):this._bodyElement.appendChild(c)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(b,h,d){var e=this._treeModel.getId(b),c;if(e===this._id)this._removeChildRows(e),this._generateChildren(h,0),this._rowsChanged();else if(e===
this._treeModel.getId(this._root)&&b.removeAll)this._removeAllRows(),this._generateChildren(h,0),this._rowsChanged();else{var a=g.node(e);a?(a._item=b,a&&(d||a._expanded)?(this._removeChildRows(e),h?(a._expanded=!0,this._renderer.updateExpandVisuals(a,!0),this._generateChildren(h,a._depth+1,a),this._rowsChanged()):(c=this,this._renderer.updateExpandVisuals(a,"progress"),h=this._treeModel.getChildren(a._item,function(b){c.destroyed||(c._renderer.updateExpandVisuals(a,!0),a._expanded||(a._expanded=
!0,c._generateChildren(b,a._depth+1,a),c._rowsChanged()))}))):this._renderer.updateExpandVisuals(a,!1)):console.log(k["could not find table row "]+e)}},getItem:function(b){var h=g.node(b);return h&&h._item?h._item:b},toggle:function(b){var h=g.node(b);h&&(h._expanded?this.collapse(b):this.expand(b))},isExpanded:function(b){b="string"===typeof b?b:this._treeModel.getId(b);return(b=g.node(b))?b._expanded:!1},expand:function(b,h,d){b="string"===typeof b?b:this._treeModel.getId(b);var e=g.node(b);if(e){var c=
this;e._expanded?h&&h.apply(c,d):(this._renderer.updateExpandVisuals(e,"progress"),this._treeModel.getChildren(e._item,function(a){c.destroyed||(c._renderer.updateExpandVisuals(e,!0),e._expanded||(e._expanded=!0,c._generateChildren(a,e._depth+1,e),c._rowsChanged()),h&&h.apply(c,d))}))}},_removeChildRows:function(b){for(var h=b===this._id,d=!1,e=-1,c=[],a=g.$$array(".treeTableRow",this._parent),l=0;l<a.length;l++){var f=a[l];if(d)break;h?f._depth>e?c.push(f):d=!0:f.id===b&&(h=!0,e=f._depth)}for(b=
0;b<c.length;b++)h=c[b],h.parentNode.removeChild(h)},_removeAllRows:function(){for(var b=g.$$array(".treeTableRow",this._parent),h=0;h<b.length;h++)b[h].parentNode.removeChild(b[h])},collapse:function(b){b="string"===typeof b?b:this._treeModel.getId(b);var h=g.node(b);if(h){if(!h._expanded)return;h._expanded=!1;this._renderer.updateExpandVisuals(h,!1);this._removeChildRows(b);this._rowsChanged()}this._onCollapse&&this._onCollapse(h._item)},getIndent:function(){return this._indent}};d.prototype.constructor=
d;return{TableTree:d}});
define("orion/treeModelIterator",[],function(){var k={};k.TreeModelIterator=function(){function g(d,b){this.firstLevelChildren=d;this.reset();this._init(b)}g.prototype={_init:function(d){d&&(this.isExpanded=d.isExpanded,this.isExpandable=d.isExpandable,this.forceExpandFunc=d.forceExpandFunc,this.getChildrenFunc=d.getChildrenFunc)},topLevel:function(d){return d.parent?d.parent===this.root:!0},_getChildren:function(d){return"function"===typeof this.getChildrenFunc?this.getChildrenFunc(d):d?d.children:
null},_expanded:function(d){if(!d)return!0;var b=this._getChildren(d),b=b&&0<b.length;this.isExpanded&&b&&(b=this.isExpanded(d));return b},_expandable:function(d){return!d?!0:this.isExpandable?this.isExpandable(d):!1},_diveIn:function(d){return this._expanded(d)?(d=this._getChildren(d),this.setCursor(d[0]),this.cursor()):null},_drillToLast:function(d){return this._expanded(d)?(d=this._getChildren(d),this._drillToLast(d[d.length-1])):d},_forward:function(d){if(!this._cursor)return null;var b=this._diveIn(this._cursor);
if(!b){if(d&&this._expandable(this._cursor)&&this.forceExpandFunc){var h=this;return this.forceExpandFunc(this._cursor,"first",function(b){b&&h.setCursor(b)})}(b=this._findSibling(this._cursor,!0))&&this.setCursor(b)}return b},_backward:function(d){if(!this._cursor)return null;var b=this._findSibling(this._cursor,!1);b&&b!==this._cursor.parent&&(b=this._drillToLast(b));if(d&&b&&this._expandable(b)&&this.forceExpandFunc&&b!==this._cursor.parent){var h=this;return this.forceExpandFunc(b,"last",function(b){b&&
h.setCursor(b)})}b&&this.setCursor(b);return b},_findSibling:function(d,b){for(var h=this.topLevel(d),g=this._getChildren(d.parent),g=h?this.firstLevelChildren:g,e=0;e<g.length;e++)if(g[e]===d)return 0===e&&!b?h?null:d.parent:e===g.length-1&&b?h?null:this._findSibling(d.parent,b):b?g[e+1]:g[e-1];return null},_inParentChain:function(d,b){for(var h=d.parent;h;){if(h===b)return!0;h=h.parent}return!1},_getTopLevelParent:function(d){if(this.topLevel(d))return d;for(d=d.parent;d;){if(this.topLevel(d))return d;
d=d.parent}return null},_onCollapse:function(d){return this._expanded(d.parent)?d:this._onCollapse(d.parent)},_scan:function(d,b,h){this.setCursor(b);var g=[];for(g.push(b);;){if(this.iterate(d))g.push(this.cursor());else break;if(h===this.cursor())return g}return null},setCursor:function(d){this._prevCursor=this._cursor;this._cursor=d},setTree:function(d){this.firstLevelChildren=d;0<this.firstLevelChildren.length&&(this.root=this.firstLevelChildren[0].parent)},scan:function(d,b){var h=this.cursor(),
g=this._scan(!0,d,b);g||(g=this._scan(!1,d,b));this.setCursor(h);return g},iterate:function(d,b){return d?this._forward(b):this._backward(b)},iterateOnTop:function(d,b){var h=this._findSibling(this._getTopLevelParent(this.cursor()),d);h?this.setCursor(h):b&&0<this.firstLevelChildren.length&&this.setCursor(d?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(d){return!this._cursor?null:this._inParentChain(this._cursor,d)?(this.setCursor(d),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 g}();return k});
define("orion/uiUtils",["orion/webui/littlelib"],function(k){function g(b){var h="",d=-1!==navigator.platform.indexOf("Mac");d?(b.mod4&&(h+="\u2303"),b.mod3&&(h+="\u2325"),b.mod2&&(h+="\u21e7"),b.mod1&&(h+="\u2318")):(b.mod1&&(h+="Ctrl+"),b.mod2&&(h+="Shift+"),b.mod3&&(h+="Alt+"));if(b.alphaKey)return h+b.alphaKey;if("keypress"===b.type)return h+b.keyCode;for(var e in k.KEY)if(typeof("number"===k.KEY[e])&&k.KEY[e]===b.keyCode){if(d)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 h+e}var c;switch(b.keyCode){case 59:c=b.mod2?":":";";break;case 61:c=b.mod2?
"+":"\x3d";break;case 188:c=b.mod2?"\x3c":",";break;case 190:c=b.mod2?"\x3e":".";break;case 191:c=b.mod2?"?":"/";break;case 192:c=b.mod2?"~":"`";break;case 219:c=b.mod2?"{":"[";break;case 220:c=b.mod2?"|":"\\";break;case 221:c=b.mod2?"}":"]";break;case 222:c=b.mod2?'"':"'"}return c?h+c:112<=b.keyCode&&123>=b.keyCode?h+"F"+(b.keyCode-111):h+String.fromCharCode(b.keyCode)}function d(b){var h=-1!==window.navigator.platform.indexOf("Mac");return h&&b.metaKey||!h&&b.ctrlKey}return{getUserKeyString:function(b){var h=
"";b=b.getKeys();for(var d=0;d<b.length;d++)0!==d&&(h+=" "),h+=g(b[d]);return h},getUserText:function(b){var h=b.id,d=b.refNode,e=b.hideRefNode,c=b.initialText,a=b.onComplete,l=b.onEditDestroy,f=b.selectTo,g=b.isInitialValid;b=b.insertAsChild;var n=!1,p=function(b){return function(f){if(!n){var p=k.node(h),r=p.value;p&&(b&&f.keyCode===k.KEY.ESCAPE?(e&&(d.style.display="inline"),n=!0,p.parentNode.removeChild(p),l&&l()):b&&f.keyCode!==k.KEY.ENTER||(0===r.length||!g&&r===c?e&&(d.style.display="inline"):
(a(r),e&&d.parentNode&&(d.style.display="inline")),n=!0,p.parentNode&&p.parentNode.removeChild(p),l&&l()))}}},r=document.createElement("input");r.id=h;r.value=c||"";b?d.appendChild(r):d.parentNode.insertBefore(r,d.nextSibling);r.classList.add("userEditBoxPrompt");e&&(d.style.display="none");r.addEventListener("keydown",p(!0),!1);r.addEventListener("blur",p(!1),!1);window.setTimeout(function(){r.focus();if(c){var a=k.node(h),b=f?c.indexOf(f):-1;0<b?a.createTextRange?(a=a.createTextRange(),a.collapse(!0),
a.moveStart("character",0),a.moveEnd("character",b),a.select()):a.setSelectionRange?a.setSelectionRange(0,b):void 0!==a.selectionStart&&(a.selectionStart=0,a.selectionEnd=b):a.select()}},0)},openInNewWindow:d,followLink:function(b,h){h&&d(h)?window.open(b):window.location=b},createButton:function(b,h){var d=document.createElement("button");d.className="orionButton commandButton commandMargins";d.addEventListener("click",function(b){h();k.stop(b)},!1);b&&d.appendChild(document.createTextNode(b));return d},
createDropdownButton:function(b,d,g){},isFormElement:function(b){switch(b.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/explorers/explorerNavHandler",["orion/webui/littlelib","orion/treeModelIterator","orion/uiUtils"],function(k,g,d){var b={},h=-1!==navigator.userAgent.indexOf("iPad"),m=-1!==window.navigator.platform.indexOf("Mac");b.ExplorerNavHandler=function(){function b(c,a,l){this.explorer=c;this.model=this.explorer.model;this._navDict=a;this._listeners=[];this._selections=[];this._currentColumn=0;c=this._getEventListeningDiv();c.tabIndex=0;c.classList.add("selectionModelContainer");var f=this;this._modelIterator=
new g.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:l.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(a){return f.explorer.renderer.isExpandable(a)}:function(a){return f.isExpandable(a)},forceExpandFunc:this.explorer.forceExpandFunc?function(a,c,b){return f.explorer.forceExpandFunc(a,c,b)}:void 0});this._init(l);(!l||!1!==l.setFocus)&&c.focus();l=function(a){if(d.isFormElement(a.target)||f.explorer.preventDefaultFunc&&f.explorer.preventDefaultFunc(a,
f._modelIterator.cursor()))return!0;if(a.keyCode===k.KEY.DOWN)return f.onDownArrow(a);if(a.keyCode===k.KEY.UP)return f.onUpArrow(a);if(a.keyCode===k.KEY.RIGHT)return f.onRightArrow(a);if(a.keyCode===k.KEY.LEFT)return f.onLeftArrow(a);if(a.keyCode===k.KEY.SPACE)return f.onSpace(a);if(a.keyCode===k.KEY.ENTER)return f.onEnter(a)};c.addEventListener("keydown",l,!1);this._listeners.push({type:"keydown",listener:l});l=function(a){if(f.explorer.onFocus)f.explorer.onFocus(!1);else f.toggleCursor(null,!1)};
c.addEventListener("blur",l,!1);this._listeners.push({type:"blur",listener:l});l=function(a){if(f.explorer.onFocus)f.explorer.onFocus(!0);else f.toggleCursor(null,!0)};c.addEventListener("focus",l,!1);this._listeners.push({type:"focus",listener:l});this._parentDiv=c}b.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 m?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,a){var b=this;this.explorer.selection&&this.explorer.selection.getSelections(function(f){b._clearSelection(a);for(var e=0;e<f.length;e++)b._selections.push(f[e]);0<b._selections.length?b.cursorOn(b._selections[0],
!0,!1,c):b.cursorOn(null,!1,!1,c);b._shiftSelectionAnchor&&0<=b._inSelection(b._shiftSelectionAnchor)||(b._shiftSelectionAnchor=null)})},refreshModel:function(c,a,b,f){this._currentColumn=0;this.topIterationNodes=[];this.model=a;this._navDict=c;this.model.getTopIterationNodes?this.topIterationNodes=this.model.getTopIterationNodes():b&&(this.topIterationNodes=b);this._modelIterator.setTree(this.topIterationNodes);!f&&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 a=0;a<this._selections.length;a++)if(c===this.model.getId(this._selections[a]))return a;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,a,b){"readonlySelection"!==this._selectionPolicy&&("cursorOnly"===this._selectionPolicy?a&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(c,!0):this._isRowSelectable(c)&&(!a||"singleSelection"===this._selectionPolicy?(this._clearSelection(!0),
this._checkRow(c,!1),this._selections.push(c),this._lastSelection=c):(a=this._inSelection(c),0<=a?(this._checkRow(c,!0),this._selections.splice(a,1)):(this._checkRow(c,!1),this._selections.push(c),this._lastSelection=c)),b&&(this._shiftSelectionAnchor=this._lastSelection),this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))))},moveColumn:function(c,a){c||(c=this.currentModel());var b=this._getGridChildren(c);if(b&&1<b.length||
0===a&&b){0!==a&&this.toggleCursor(c,!1);var f=this._currentColumn,e=!0,f=f+a;0>f?(this._linearGridMove&&0!==a&&(this._modelIterator.iterate(!1)?c=this.currentModel():e=!1),f=e?b.length-1:this._currentColumn):f>=b.length&&(this._linearGridMove&&0!==a&&(this._modelIterator.iterate(!0)?c=this.currentModel():e=!1),f=e?0:this._currentColumn);this._currentColumn=f;0!==a&&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 a=this._parentDiv,b;c&&c!==a&&"grid"!==(b=c.getAttribute("role"))&&"tree"!==b&&"treegrid"!==b;)c=c.parentNode;return c===a?null:c},toggleCursor:function(c,a){var b=this.getRowDiv(c),f=this.getCurrentGrid(c);f?(b&&(a?b.classList.add("treeIterationCursorRow"):b.classList.remove("treeIterationCursorRow")),f.domNode&&(b=this.getAriaContainerElement(f.domNode),
a?(f.domNode.classList.add("treeIterationCursor"),b&&b.setAttribute("aria-activedescendant",f.domNode.id)):f.domNode.classList.remove("treeIterationCursor"))):b&&(a?b.classList.add("treeIterationCursorRow_Dotted"):b.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(c,a,b,f){var e,d;if(c||a){if(d===this._modelIterator.cursor())return;e=this._modelIterator.cursor();d=c;this._modelIterator.setCursor(d)}else e=this._modelIterator.prevCursor(),
d=this._modelIterator.cursor();if(e!==d||a)if(this.toggleCursor(e,!1),!a||d){this.moveColumn(null,0);this.toggleCursor(d,!0);if((c=this.getRowDiv())&&!f){f=c.parentNode;for(a=document.documentElement;f&&f!==a;){var h=window.getComputedStyle(f,null);if(!h)break;h=h.getPropertyValue("overflow-y");if("auto"===h||"scroll"===h)break;f=f.parentNode}f&&(a=!0,c.offsetTop<=f.scrollTop?(a=!1,void 0===b&&(b=!1)):c.offsetTop+c.offsetHeight>=f.scrollTop+f.clientHeight&&(a=!1,void 0===b&&(b=!0)),a||c.scrollIntoView(!b))}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(e,
d)}},getSelection:function(){return this._selections},getSelectionIds:function(){for(var c=[],a=0;a<this._selections.length;a++)c.push(this.model.getId(this._selections[a]));return c},getRowDiv:function(c){c=c?c:this._modelIterator.cursor();if(!c)return null;c=this.model.getId(c);var a=this._navDict.getValue(c);return a&&a.rowDomNode?a.rowDomNode:k.node(c)},iterate:function(c,a,b,f){var e=null;if(this.topIterationNodes&&0!==this.topIterationNodes.length)if(f){f=this.currentModel();for((e=this._modelIterator.iterate(c,
a))&&this._setCursorOnItem(c,b);e&&e.isNotSelectable;)(e=this._modelIterator.iterate(c,a))&&this._setCursorOnItem(c,b);e||(this.cursorOn(f,!0,!1,!0),this._setCursorOnItem(c,b))}else(e=this._modelIterator.iterate(c,a))&&this._setCursorOnItem(c,b)},_toggleSelectionClass:function(c,a){this._selections.forEach(function(b){(b=this.getRowDiv(b))&&(a?b.classList.add(c):b.classList.remove(c))}.bind(this))},_setCursorOnItem:function(c,a){this.cursorOn(null,!1,c);if(a){var b=this._inSelection(this._modelIterator.prevCursor()),
f=this._inSelection(this._modelIterator.cursor());0<=b&&0<=f?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)}},_checkRow:function(c,a){if(this.explorer.renderer._useCheckboxSelection&&"singleSelection"!==this._selectionPolicy){var b=this.getRowDiv(c);if(b){var f=k.node(this.explorer.renderer.getCheckBoxId(b.id)),e=a?!f.checked:!0;if(e!==f.checked)this.explorer.renderer.onCheck(b,f,e,!0)}}else this._select(c,a)},_select:function(c,a){c||(c=this._modelIterator.cursor());
var b=this.getRowDiv(c);b&&(0>this._inSelection(c)?b.classList.add("checkedRow"):b.classList.remove("checkedRow"))},_onModelGrid:function(c,a){var b=this._getGridChildren(c);if(b)for(var f=0;f<b.length;f++)if(a.target===b[f].domNode)return!0;return!1},onClick:function(c,a){if("readonlySelection"===this._selectionPolicy||this.isDisabled(this.getRowDiv(c)))k.stop(a);else{var b=k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(c)));if(a.target!==b&&!("none"===this.gridClickSelectionPolicy&&
this._onModelGrid(c,a)))if(this.cursorOn(c,!0,!1,!0),h)this.setSelection(c,!0);else if(this._ctrlKeyOn(a))this.setSelection(c,!0,!0);else if(a.shiftKey&&this._shiftSelectionAnchor){if(b=this._modelIterator.scan(this._shiftSelectionAnchor,c)){this._clearSelection(!0);for(var f=0;f<b.length;f++)this.setSelection(b[f],!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 a=this.currentModel(),b=this._getGridChildren(a);return b&&1<b.length?this.isExpandable(a)?this._ctrlKeyOn(c):!0:!1},onLeftArrow:function(c){if(this._shouldMoveColumn(c))return this.moveColumn(null,-1),c.preventDefault(),
!0;var a=this._modelIterator.cursor();if(!a)return!1;if(this.isExpandable(a)&&this.isExpanded(a))return this.explorer.myTree.collapse(a),c.preventDefault(),!0;this._modelIterator.topLevel(a)?this.explorer.scopeUp&&"function"===typeof this.explorer.scopeUp&&this.explorer.scopeUp():(this.cursorOn(a.parent),this.setSelection(a.parent,!1,!0))},onRightArrow:function(c){if(this._shouldMoveColumn(c))return this.moveColumn(null,1),c.preventDefault(),!0;var a=this._modelIterator.cursor();if(!a)return!1;if(this.isExpandable(a)&&
!this.isExpanded(a))return this.explorer.myTree.expand(a),this.explorer.postUserExpand&&this.explorer.postUserExpand(this.model.getId(a)),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 a=this.getCurrentGrid(this._modelIterator.cursor());if(a)if(a.widget)if("function"===typeof a.onClick)a.onClick();else"function"===
typeof a.widget.focus&&a.widget.focus();else{var b=document.createEvent("MouseEvents");b.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(c),!1,!1,!1,0,null);a.domNode.dispatchEvent(b)}else if(a=this._modelIterator.cursor())if(this.explorer.renderer.getRowActionElement&&(b=this.explorer.renderer.getRowActionElement(this.model.getId(a)),b.href&&(this._ctrlKeyOn(c)?window.open(b.href):window.location.href=b.href)),this.explorer.renderer.performRowAction)return this.explorer.renderer.performRowAction(c,
a),c.preventDefault(),!1},setIsNotSelectable:function(c,a){c.isNotSelectable=a},disableItem:function(c){var a=this.getRowDiv(c);this.isExpandable(c)&&this.isExpanded(c)&&(this._modelIterator.collapse(c),this.explorer.myTree.toggle(a.id));a.classList.remove("checkedRow");a.classList.add("disabledNavRow");this.setIsNotSelectable(c,!0)},isDisabled:function(c){return c.classList.contains("disabledNavRow")},enableItem:function(c){var a=this.getRowDiv(c);a&&(a.classList.remove("disabledNavRow"),this.setIsNotSelectable(c,
!1))}};return b}();b.ExplorerNavDict=function(){function b(c){this._dict={};this._model=c}b.prototype={addRow:function(c,a){var b=this._model.getId(c);this._dict[b]={model:c,rowDomNode:a}},getValue:function(c){return this._dict[c]},getGridNavHolder:function(c,a){if(!c)return null;var b=this._model.getId(c);return this._dict[b]?(!this._dict[b].gridChildren&&a&&(this._dict[b].gridChildren=[]),this._dict[b].gridChildren):null},initGridNavHolder:function(c){if(!c)return null;c=this._model.getId(c);this._dict[c]&&
(this._dict[c].gridChildren=null)}};return b}();return b});
define("orion/EventTarget",[],function(){function k(){this._namedListeners={}}k.prototype={dispatchEvent:function(g){if(!g.type)throw Error("unspecified type");var d=this._namedListeners[g.type];d&&d.forEach(function(b){try{"function"===typeof b?b(g):b.handleEvent(g)}catch(d){"undefined"!==typeof console&&console.log(d)}});return!g.defaultPrevented},addEventListener:function(g,d){if("function"===typeof d||d.handleEvent)this._namedListeners[g]=this._namedListeners[g]||[],this._namedListeners[g].push(d)},
removeEventListener:function(g,d){var b=this._namedListeners[g];if(b)for(var h=0;h<b.length;h++)if(b[h]===d){1===b.length?delete this._namedListeners[g]:b.splice(h,1);break}}};k.prototype.constructor=k;k.attach=function(g){var d=new k;g.dispatchEvent=d.dispatchEvent.bind(d);g.addEventListener=d.addEventListener.bind(d);g.removeEventListener=d.removeEventListener.bind(d)};return k});
define("orion/webui/dropdown",["require","orion/webui/littlelib","orion/EventTarget"],function(k,g,d){function b(b){d.attach(this);this._init(b)}function h(b,c){var a=document.createElement(void 0===c?"span":c);a.tabIndex=0;a.className="dropdownMenuItem";a.role="menuitem";var l=document.createElement("span");l.appendChild(document.createTextNode(b));l.classList.add("dropdownCommandName");a.appendChild(l);l=document.createElement("li");l.appendChild(a);return l}function m(){var b=document.createElement("li");
b.classList.add("dropdownSeparator");return b}b.prototype={_init:function(b){this._dropdownNode=g.node(b.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._populate=b.populate;this._selectionClass=b.selectionClass;this._parentDropdown=b.parentDropdown;this._positioningNode=b.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=b.triggerNode?b.triggerNode:g.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";if(!b.skipTriggerEventListeners){var a=this;this._triggerNode.addEventListener("click",function(c){a.toggle(c)&&g.stop(c)},!1);"span"===this._triggerNode.tagName.toLowerCase()&&this._triggerNode.addEventListener("keydown",function(c){if(c.keyCode===g.KEY.ENTER||c.keyCode===g.KEY.SPACE)a.toggle(),g.stop(c)},!1)}this._dropdownNode.addEventListener("keydown",
this._dropdownKeyDown.bind(this),!1)},addTriggerNode:function(b){var c=this;b.addEventListener("click",function(a){c.toggle(a)&&g.stop(a)},!1)},toggle:function(b){return this.isVisible()?this.close():this.open(b)},isVisible:function(){return this._isVisible},open:function(b){var c=!1;this.isVisible()||(this.dispatchEvent({type:"triggered",dropdown:this,event:b}),g.setFramesEnabled(!1),this._populate&&(this.empty(),this._populate(this._dropdownNode)),0<this.getItems().length&&(this._hookedAutoDismiss||
(this._boundAutoDismiss?g.removeAutoDismiss(this._boundAutoDismiss):this._boundAutoDismiss=this._autoDismiss.bind(this),c=g.$$array(".dropdownSubMenu",this._dropdownNode),g.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(b),this._focusDropdownNode(),
c=!0,this._parentDropdown&&this._parentDropdown.submenuOpen(this)));return c},_focusDropdownNode:function(){this._dropdownNode.focus()},_autoDismiss:function(b){if(this.close(!1)&&this._dropdownNode.contains(b.target))for(b=this._parentDropdown;b;)b.close(!1),b=b._parentDropdown},_positionDropdown:function(b){this._dropdownNode.style.left="";this._dropdownNode.style.top="";if(this._positioningNode)this._dropdownNode.style.left=this._positioningNode.offsetLeft+"px";else{b=g.bounds(this._dropdownNode);
var c=g.bounds(document.body);if(b.left+b.width>c.left+c.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-b.width+"px";else{var a=g.bounds(this._boundingNode(this._triggerNode)),l=g.bounds(this._triggerNode);this._dropdownNode.style.left=l.left-a.left-b.width+l.width+"px"}b=b.top+b.height-(c.top+c.height);0<b&&(this._dropdownNode.style.top=Math.floor(this._dropdownNode.style.top-b)+"px")}},_boundingNode:function(b){var c=window.getComputedStyle(b,null);
return null===c||"absolute"===c.getPropertyValue("position")||!b.parentNode||b===document.body?b:this._boundingNode(b.parentNode)},close:function(b){var c=!1;this.isVisible()&&(this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),g.setFramesEnabled(!0),b&&this._triggerNode.focus(),this._isVisible=!1,this._selectedItem&&(this._selectedItem.classList.remove("dropdownMenuItemSelected"),
this._selectedItem=null),c=!0);return c},getItems:function(){var b=[],c=this;g.$$array("li:not(.dropdownSeparator) \x3e .dropdownMenuItem",this._dropdownNode,!0).forEach(function(a){a.parentNode.parentNode===c._dropdownNode&&b.push(a)});b.forEach(function(a){a._hasDropdownMouseover||(a.addEventListener("mouseover",function(b){a.dropdown?a.dropdown.open(b):(c._closeSelectedSubmenu(),g.stop(b));c._selectItem(a)}),a._hasDropdownMouseover=!0)});return b},empty:function(){var b=this;g.$$array("li",this._dropdownNode).forEach(function(c){c.parentNode===
b._dropdownNode&&c.parentNode.removeChild(c)});this._hookedAutoDismiss=!1},_dropdownKeyDown:function(b){if(b.keyCode===g.KEY.UP||b.keyCode===g.KEY.DOWN||b.keyCode===g.KEY.RIGHT||b.keyCode===g.KEY.ENTER||b.keyCode===g.KEY.LEFT){var c=this.getItems();if(c.length&&0<c.length){if(this._selectedItem){var a=c.indexOf(this._selectedItem);0>a&&(a=c.indexOf(this._selectedItem.parentNode));0<=a&&(b.keyCode===g.KEY.UP&&0<a?(a--,this._selectItem(c[a])):b.keyCode===g.KEY.DOWN&&a<c.length-1?(a++,this._selectItem(c[a])):
b.keyCode===g.KEY.ENTER||b.keyCode===g.KEY.RIGHT?this._selectedItem.classList.contains("dropdownTrigger")&&this._selectedItem.dropdown?(this._selectedItem.dropdown.open(),this._selectedItem.dropdown._selectItem()):b.keyCode===g.KEY.ENTER&&this._selectedItem.click():b.keyCode===g.KEY.LEFT&&this._selectedItem.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&(this.close(!0),this._parentDropdown&&this._parentDropdown._dropdownNode.focus()))}else this._selectItem(c[0]);g.stop(b)}}else b.keyCode===
g.KEY.ESCAPE&&(this.close(!0),g.stop(b))},_selectItem:function(b){if(b=b||this.getItems()[0])this._selectedItem&&this._selectedItem.classList.remove("dropdownMenuItemSelected"),this._selectedItem=b,this._selectedItem.classList.add("dropdownMenuItemSelected");document.activeElement!==this._dropdownNode&&this._dropdownNode.focus()},submenuOpen:function(b){b!==this._selectedSubmenu&&(this._closeSelectedSubmenu(),this._selectedSubmenu=b)},_closeSelectedSubmenu:function(){for(var b=this._selectedSubmenu;b;)b.close(),
b=b._selectedSubmenu},destroy:function(){this.empty();this._boundAutoDismiss&&g.removeAutoDismiss(this._boundAutoDismiss)},appendMenuItem:function(b,c){var a=h(b,c);this._dropdownNode.appendChild(a);return a},appendSeparator:function(){var b=m();this._dropdownNode.appendChild(b);return b}};b.prototype.constructor=b;return{Dropdown:b,appendKeyBindingString:function(b,c){var a=document.createElement("span");a.classList.add("dropdownKeyBinding");a.appendChild(document.createTextNode(c));b.appendChild(a)},
createMenuItem:h,createSeparator:m}});
define("text",["module"],function(k){var g,d,b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],h=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,m=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,e="undefined"!==typeof location&&location.href,c=e&&location.protocol&&location.protocol.replace(/\:/,""),a=e&&location.hostname,l=e&&(location.port||void 0),f=[],q=k.config&&k.config()||{};g={version:"2.0.5",strip:function(a){if(a){a=a.replace(h,"");var b=a.match(m);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:q.createXhr||function(){var a,c,f;if("undefined"!==typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!==typeof ActiveXObject)for(c=0;3>c;c+=1){f=b[c];try{a=new ActiveXObject(f)}catch(l){}if(a){b=[f];break}}return a},parseName:function(a){var b,
c,f=!1,l=a.indexOf(".");b=0===a.indexOf("./")||0===a.indexOf("../");-1!==l&&(!b||1<l)?(b=a.substring(0,l),c=a.substring(l+1,a.length)):b=a;a=c||b;l=a.indexOf("!");-1!==l&&(f="strip"===a.substring(l+1),a=a.substring(0,l),c?c=a:b=a);return{moduleName:b,ext:c,strip:f}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,b,c,f){var l,d;l=g.xdRegExp.exec(a);if(!l)return!0;a=l[2];l=l[3];l=l.split(":");d=l[1];l=l[0];return(!a||a===b)&&(!l||l.toLowerCase()===c.toLowerCase())&&(!d&&!l||d===f)},finishLoad:function(a,
b,c,l){c=b?g.strip(c):c;q.isBuild&&(f[a]=c);l(c)},load:function(b,f,d,h){if(h.isBuild&&!h.inlineText)d();else{q.isBuild=h.isBuild;var k=g.parseName(b);h=k.moduleName+(k.ext?"."+k.ext:"");var m=f.toUrl(h),s=q.useXhr||g.useXhr;!e||s(m,c,a,l)?g.get(m,function(a){g.finishLoad(b,k.strip,a,d)},function(a){d.error&&d.error(a)}):f([h],function(a){g.finishLoad(k.moduleName+"."+k.ext,k.strip,a,d)})}},write:function(a,b,c,l){f.hasOwnProperty(b)&&(l=g.jsEscape(f[b]),c.asModule(a+"!"+b,"define(function () { return '"+
l+"';});\n"))},writeFile:function(a,b,c,f,l){b=g.parseName(b);var d=b.ext?"."+b.ext:"",h=b.moduleName+d,e=c.toUrl(b.moduleName+d)+".js";g.load(h,c,function(b){b=function(a){return f(e,a)};b.asModule=function(a,b){return f.asModule(a,e,b)};g.write(a,h,b,l)},l)}};if("node"===q.env||!q.env&&"undefined"!==typeof process&&process.versions&&process.versions.node)d=require.nodeRequire("fs"),g.get=function(a,b){var c=d.readFileSync(a,"utf8");0===c.indexOf("\ufeff")&&(c=c.substring(1));b(c)};else if("xhr"===
q.env||!q.env&&g.createXhr())g.get=function(a,b,c,f){var l=g.createXhr(),d;l.open("GET",a,!0);if(f)for(d in f)f.hasOwnProperty(d)&&l.setRequestHeader(d.toLowerCase(),f[d]);if(q.onXhr)q.onXhr(l,a);l.onreadystatechange=function(f){4===l.readyState&&(f=l.status,399<f&&600>f?(f=Error(a+" HTTP status: "+f),f.xhr=l,c(f)):b(l.responseText))};l.send(null)};else if("rhino"===q.env||!q.env&&"undefined"!==typeof Packages&&"undefined"!==typeof java)g.get=function(a,b){var c,f,l=new java.io.File(a),d=java.lang.System.getProperty("line.separator"),
l=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(l),"utf-8")),h="";try{c=new java.lang.StringBuffer;(f=l.readLine())&&(f.length()&&65279===f.charAt(0))&&(f=f.substring(1));for(null!==f&&c.append(f);null!==(f=l.readLine());)c.append(d),c.append(f);h=String(c.toString())}finally{l.close()}b(h)};return 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,g){function d(b){this._init(b)}d.prototype={_init:function(b){this._node=g.node(b.node);if(!this._node)throw"no dom node for tooltip found";this._position=b.position||["right","above","below","left"];this._text=b.text;this._hideDelay=void 0===b.hideDelay?200:b.hideDelay;this._tailSize=b.tailSize||10;this._trigger=b.trigger||"mouseover";this._afterShowing=b.afterShowing;this._afterHiding=b.afterHiding;var d=this;if("click"===
this._trigger)this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(b){b.target===d._node&&(d.show(),g.stop(b))},!1);else if("mouseover"===this._trigger){this._showDelay=void 0===b.showDelay?500:b.showDelay;b=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(b){g.contains(d._node,b.target)&&(d.show(),g.stop(b))},!1);this._leaveHandler=function(b){g.contains(d._node,b.target)&&d.hide()};for(var k=0;k<b.length;k++)this._node.addEventListener(b[k],
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 b=document.createTextNode(this._text);this._tipTextContent.appendChild(b)}this._tip.appendChild(this._tipInner);
document.body.appendChild(this._tip);var d=this;g.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(b){d._timeout&&(window.clearTimeout(d._timeout),d._timeout=null);d._tip.addEventListener("mouseout",function(b){g.contains(d._tip,b.target)&&(d.hide(),g.stop(b))},
!1)},!1))}return this._tip},_positionTip:function(b,d){this._makeTipNode();"left"===b?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var k=this._node,e;for(e=g.bounds(k);k&&!e.width&&!e.height;k=k.parentNode)e=g.bounds(k);var k=g.bounds(this._tipInner),c;switch(b){case "above":c=e.top-k.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-k.width-
this._tailSize-1;break;default:c=e.top-this._tailSize/2,e=e.left+e.width+this._tailSize+1}var a=g.bounds(document.documentElement);if(c+k.height>a.height)if(d)c=a.height-k.height-1;else return!1;if(e+k.width>a.width)if(d)e=a.width-k.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!==b&&(this._tip.removeChild(this._tail),this._tail=null);this._tail||(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+
b),"above"===b||"left"===b?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner),this._tail.previousPosition=b);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 b=!1,d=0;!b&&d<this._position.length;)b=this._positionTip(this._position[d]),d++;b||this._positionTip(this._position[0],!0);this._tip.classList.add("tooltipShowing");this._afterShowing&&this._afterShowing()},hide:function(b){this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null);if(this._tip&&this._tip.classList.contains("tooltipShowing")){void 0===b&&(b=this._hideDelay);var d=this;this._timeout=window.setTimeout(function(){d._tip.classList.remove("tooltipShowing");
d._tip.removeAttribute("style");d._afterHiding&&d._afterHiding()},b)}},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 b=["mouseout","click"],d=0;d<b.length;d++)this._node.removeEventListener(b[d],
this._leaveHandler,!1)}}};d.prototype.constructor=d;return{Tooltip:d}});
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,g,d,b,h,m,e,c){function a(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 l(b,c){for(var f in c)if(c[f]&&(c[f].keyBinding&&c[f].command)&&c[f].keyBinding.match(b)){var l=c[f],d=l.keyBinding;if((!d.domScope||g.contains(g.node(d.domScope),b.target))&&a(l)){g.stop(b);break}}}function f(){var a={};if(u){var b,c,f;c=Object.keys(s);for(b=0;b<c.length;b++)f=c[b],a[f]=s[f];var l=u();c=Object.keys(l);for(b=0;b<c.length;b++)f=c[b],a[f]=l[f]}else a=
s;return a}function q(a){l(a,f())}function n(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):q(a)}function p(){this._init()}
function r(a,b,c){b.classList.add("commandImage");var f;a.imageClass?a.addImageClassToElement?b.classList.add(a.imageClass):(f=document.createElement("span"),b.appendChild(f),f.classList.add(a.spriteClass),f.classList.add(a.imageClass)):(f=new Image,f.alt=a.name,f.name=c,f.id=c,f.src=a.image,b.appendChild(f));return f}function t(a,b,c,f,l){this.commandRegistry=l;this.handler=a;this.items=b;this.userData=c;this.command=f;f.parameters&&(this.parameters=f.parameters.makeCopy());this.id=f.id}function w(a){this._init(a)}
var u=null,s={};p.prototype={setProxy:function(a){this.proxy=a},setKeyBindings:function(a){this.bindings=a},_init:function(){var a=this;document.addEventListener("keydown",function(b){return n(b,function(b){var c=a.proxy,f=a.bindings;if(f&&c)for(var l=0;l<f.length;l++)f[l].match(b)&&(c.processKey({type:b.type,keyCode:b.keyCode,altKey:b.altKey,ctrlKey:b.ctrlKey,metaKey:b.metaKey,shiftKey:b.shiftKey}),g.stop(b))})})}};window.document.addEventListener("keydown",n,!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.extraClass=a.extraClass;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,f,l){c=this.getChoices(b,c,f);var d=c.some(function(a){return a.checked});c.forEach(function(c){if(c.name){var f=document.createElement("li");a.appendChild(f);var e=document.createElement("span");e.tabIndex=0;e.role="menuitem";e.classList.add("dropdownMenuItem");if(d){var h=document.createElement("span");h.classList.add("check");h.appendChild(document.createTextNode(c.checked?"\u25cf":""));e.appendChild(h)}h=document.createTextNode(c.name);e.appendChild(h);f.appendChild(e);e.choice=c;e.addEventListener("click",
function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,b)},!1);e.addEventListener("keydown",function(a){(a.keyCode===g.KEY.ENTER||a.keyCode===g.KEY.SPACE)&&a.target.choice&&a.target.choice.callback.call(a.target.choice,b)},!1)}else l._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,c,f,l,e,k,n,q,m){a=g.node(a);if(!a)throw"no parent node was specified";var p=document.createRange();p.selectNode(a);p=m?p.createContextualFragment(h):p.createContextualFragment(b);g.processTextNodes(p,{ButtonText:c});a.appendChild(p);a=a.lastChild;
var t;m?(m=a.previousSibling,t=m.lastChild):m=a.previousSibling;l?m.classList.add(l):(m.classList.add("orionButton"),m.classList.add("commandButton"));e&&(k||(m.textContent="",m.setAttribute("aria-label",c)),r({spriteClass:"commandSprite",imageClass:e},m,c),m.classList.add("orionButton"));m.dropdown=new d.Dropdown({dropdown:a,populate:f,selectionClass:n,skipTriggerEventListeners:!!t,positioningNode:q});a.dropdown=m.dropdown;return{menuButton:m,menu:a,dropdown:m.dropdown,dropdownArrow:t}},createCheckedMenuItem:function(a,
b,c,f){a=g.node(a);if(!a)throw"no parent node was specified";var l=document.createRange();l.selectNode(a);l=l.createContextualFragment(e);g.processTextNodes(l,{ItemText:b});a.appendChild(l);a=g.$(".checkedMenuItem",a.lastChild);a.checked=c;a.addEventListener("change",f,!1);return a},createCommandItem:function(a,b,f,l,d,e,h){var g;e=e||!b.name&&b.hasImage();if(b.hrefCallback)g=document.createElement("a"),g.id=l,e&&b.hasImage()?r(b,g,l):(g.className="commandLink",g.appendChild(document.createTextNode(b.name))),
h=b.hrefCallback.call(f.handler,f),h.then?h.then(function(a){g.href=a}):g.href=h?h:"#";else{g=document.createElement("button");g.className="orionButton";b.extraClass&&g.classList.add(b.extraClass);e?b.hasImage()?(r(b,g,l),b.name&&g.setAttribute("aria-label",b.name)):(g.classList.add("commandButton"),g.classList.add("commandMissingImageButton"),g.appendChild(document.createTextNode(b.name))):(g.classList.add("commandButton"),l=document.createTextNode(b.name),g.appendChild(l));var k=h||b.callback;k&&
(b.onClick=k,g.addEventListener("click",function(a){k.call(f.handler,f)},!1))}"ul"===a.nodeName.toLowerCase()?(h=document.createElement("li"),a.appendChild(h),a=h):g.classList.add("commandMargins");a.appendChild(g);b.tooltip&&(g.commandTooltip=new c.Tooltip({node:g,text:b.tooltip,position:["above","below","right","left"]}));d&&(s[b.id]={keyBinding:d,command:b,invocation:f});return g},createCommandMenuItem:function(a,b,f,l,e,h){var k,n,q=a.dropdown;if(b.hrefCallback)n=d.createMenuItem(b.name,"a"),
k=n.firstElementChild,e=b.hrefCallback.call(f.handler,f),e.then?e.then(function(a){k.href=a}):k.href=e?e:"#",k.addEventListener("keydown",function(a){(a.keyCode===g.KEY.ENTER||a.keyCode===g.KEY.SPACE)&&k.click()},!1);else{n=d.createMenuItem(b.name);k=n.firstElementChild;var m=e||b.callback;m&&(b.onClick=m,k.addEventListener("click",function(a){q.close(!0);m.call(f.handler,f)},!1),k.addEventListener("keydown",function(a){if(a.keyCode===g.KEY.ENTER||a.keyCode===g.KEY.SPACE)a.preventDefault(),k.click()},
!1))}b.tooltip&&(k.commandTooltip=new c.Tooltip({node:k,text:b.tooltip,position:["above","below","right","left"]}));h&&d.appendKeyBindingString(k,h);a.appendChild(n);l&&(s[b.id]={keyBinding:l,command:b,invocation:f});return k},executeBinding:a,setKeyBindingProvider:function(a){u=a},localKeyBindings:s,CommandsProxy:p,getKeyBindings:f,processKey:q,NO_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC",
_testMethodProcessKey:l}});
define("orion/explorers/explorer","i18n!orion/nls/messages require orion/webui/littlelib orion/webui/treetable orion/explorers/explorerNavHandler orion/commands".split(" "),function(k,g,d,b,h,m){var e={};e.Explorer=function(){function c(a,b,c,d){this.registry=a;this.renderer=c;this.selection=b;this.commandService=d;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(a,b){this.myTree&&this.myTree.refresh.bind(this.myTree)(a,b,!0)},updateCommands:function(a){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(a)},makeNewItemPlaceholder:function(a,b,c){var d=null;if(a=this.getRow(a)){var d=a.parentNode,e=document.createElement("tr");e.id=b+"placeHolderRow";e.classList.add("navRow");var h=document.createElement("td");h.id=b+"placeHolderCol";h.classList.add("navColumn");e.appendChild(h);
c?d.insertBefore(e,a.nextSibling):d.insertBefore(e,a);h.style.paddingLeft=a.firstChild.style.paddingLeft;d={wrapperNode:e,refNode:h,destroyFunction:function(){try{e&&e.parentNode&&e.parentNode.removeChild(e)}catch(a){}}}}return d},getRow:function(a){if(a=this.model.getId(a))return d.node(a)},collapseAll:function(){for(var a=this._navHandler.getTopLevelNodes(),b=0;b<a.length;b++)this.myTree.collapse(a[b])},expandAll:function(a){if(a)this._expandRecursively(a);else if(this._navHandler){a=this._navHandler.getTopLevelNodes();
for(var b=0;b<a.length;b++)this._expandRecursively(a[b])}},_expandRecursively:function(a){if(this._navHandler&&this._navHandler.isExpandable(a)){var b=this;this.myTree.expand(a,function(){b.model.getChildren(a,function(a){if(!(void 0===a||null===a))for(var c=a.length,d=0;d<c;d++)b._expandRecursively(a[d])})})}},createTree:function(a,c,f){a="string"===typeof a?a:a.id||a;this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var e=a+"innerTree",
g=d.node(e);g&&d.empty(g);c&&(c.rootId=e);this.model=c;this._parentId=a;this._treeOptions=f;if(!f||f&&!f.noSelection)this.selectionPolicy=f?f.selectionPolicy:"",this._navDict=new h.ExplorerNavDict(this.model);this.myTree=new b.TableTree({id:e,model:c,parent:a,onComplete:f?f.onComplete:void 0,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:f?!!f.showRoot:!1,indent:f?f.indent:void 0,onCollapse:f?f.onCollapse:void 0,navHandlerFactory:f?f.navHandlerFactory:void 0,
tableElement:f?f.tableElement:void 0,tableBodyElement:f?f.tableBodyElement:void 0,tableRowElement:f?f.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 a=this.getNavHandler(),b=[];if(a&&this.getNavDict())for(var c=a.getSelection(),d=0;d<c.length;d++){var e=a.getRowDiv(c[d]);e&&e.parentNode&&
(e=this.getNavDict().getValue(this.model.getId(c[d])),e.model&&b.push(e.model))}this.selection.setSelections(b)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:null},initNavHandler:function(){var a=this._treeOptions;if(!a||a&&!a.noSelection){this.getNavHandler()||(this._navHandler=a&&a.navHandlerFactory&&"function"===typeof a.navHandlerFactory.createNavHandler?a.navHandlerFactory.createNavHandler(this,this._navDict,a):new h.ExplorerNavHandler(this,this._navDict,
{getChildrenFunc:a?a.getChildrenFunc:null,setFocus:a&&a.setFocus,selectionPolicy:a?a.selectionPolicy:null}));var b=this;this.model.getRoot(function(c){c instanceof Array?b.getNavHandler().refreshModel(b.getNavDict(),b.model,c):c.children&&c.children instanceof Array&&b.getNavHandler().refreshModel(b.getNavDict(),b.model,c.children);a&&a.setFocus&&b.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return c}();e.createExplorerCommands=function(b,a){function d(b){return"function"===
typeof b.getItemCount&&0<b.getItemCount()?a?a(b):!0:!1}var f=new m.Command({tooltip:k["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return d(a)},callback:function(a){a.items.expandAll()}}),e=new m.Command({tooltip:k["Collapse all"],imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return d(a)},callback:function(a){a.items.collapseAll()}});
b.addCommand(f);b.addCommand(e)};e.ExplorerModel=function(){function b(a,c,f){this.rootPath=a;this.fetchItems=c;this.idPrefix=f||""}b.prototype={destroy:function(){this.destroyed=!0},getRoot:function(a){var b=this;this.fetchItems(this.rootPath).then(function(c){b.root=c;a(c)})},getChildren:function(a,b){a.Children?b(a.Children):a.ChildrenLocation?this.fetchItems(a.ChildrenLocation).then(function(c){a.Children=c;b(c)}):b([])},getId:function(a){if(a.Location===this.root.Location)return this.rootId;
a=a.Location.replace(/[\\\/]/g,"");for(var b=this.idPrefix,c=0;c<a.length;c++)b=a[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?b+a.charCodeAt(c):b+a[c];return b}};return b}();e.ExplorerFlatModel=function(){function b(a,c,f){this.rootPath=a;this.fetchItems=c;this.root=f}b.prototype=new e.ExplorerModel;b.prototype.getRoot=function(a){if(this.root)a(this.root);else{var b=this;this.fetchItems(this.rootPath).then(function(c){b.root=c;a(c)})}};b.prototype.getChildren=function(a,b){a===this.root?b(this.root):b([])};
return b}();e.ExplorerRenderer=function(){function b(a,c){this.explorer=c;this._init(a);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._progressImageClass="core-sprite-progress";this._twistieSpriteClass="modelDecorationSprite"}b.prototype={_init:function(a){a&&(this._useCheckboxSelection=void 0===a.checkbox?!1:a.checkbox,this.selectionPolicy=a.singleSelection?"singleSelection":"",this._cachePrefix=a.cachePrefix,a.getCheckedFunc&&(this.getCheckedFunc=
a.getCheckedFunc),a.onCheckedFunc&&(this.onCheckedFunc=a.onCheckedFunc),this._noRowHighlighting=a.noRowHighlighting,this._highlightSelection=!0,this._treeTableClass=a.treeTableClass||"treetable",!1===a.highlightSelection&&(this._highlightSelection=!1),this.actionScopeId||(this.actionScopeId=a.actionScopeId),this.commandService||(this.commandService=a.commandService))},getLabelColumnIndex:function(){return this.explorer.checkbox?1:0},initTable:function(a,b){this.tableTree=b;this.tableNode=a;d.empty(a);
this._treeTableClass&&a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,b,c,d,e){c=c||"tool";var h=document.createElement("td");h.id=b.id+"actionswrapper";d&&h.classList.add(d);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,h,a,this.explorer,c,null,e&&this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(a,!0):null):window.console.log("Warning, no command service or action scope was specified.  No commands rendered.");
return h},initCheckboxColumn:function(a){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(a,b){if(this._useCheckboxSelection){var c=document.createElement("td"),d=document.createElement("span");d.id=this.getCheckBoxId(b.id);d.classList.add("core-sprite-check");d.classList.add("selectionCheckmarkSprite");d.rowId=b.id;this.getCheckedFunc&&(d.checked=this.getCheckedFunc(a),d.checked?(this._highlightSelection&&b.classList.add("checkedRow"),d.classList.add("core-sprite-check_on")):
(this._highlightSelection&&b.classList.remove("checkedRow"),d.classList.remove("core-sprite-check_on")));c.appendChild(d);var e=this;d.addEventListener("click",function(c){e.onCheck(b,c.target,c.target.checked?!1:!0,!0,!1,a)},!1);return c}},getCheckBoxId:function(a){return a+"selectedState"},onCheck:function(a,b,c,d,e,h){(b.checked=c)?b.classList.add("core-sprite-check_on"):b.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(b.rowId,c,d,h);this.explorer.getNavHandler()&&
e&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(a.id).model,!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var a=this.explorer.getNavHandler().getSelectionIds(),b=this._getUIStatePreferencePath();b&&window.sessionStorage&&(window.sessionStorage[b+"selection"]=JSON.stringify(a))}},_restoreSelections:function(a){var b=this.explorer.getNavDict(),c=this.explorer.getNavHandler();if(c&&(b&&"cursorOnly"!==c.getSelectionPolicy())&&(a=window.sessionStorage[a+
"selection"],"string"===typeof a&&(a=0<a.length?JSON.parse(a):null),a)){for(var e=[],c=0;c<a.length;c++){var h=b.getValue(a[c]);if(h&&(h.rowDomNode&&h.model)&&(e.push(h.model),this._highlightSelection&&h.rowDomNode.classList.add("checkedRow"),h=d.node(this.getCheckBoxId(h.rowDomNode.id))))h.checked=!0,h.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(e),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(a){window.sessionStorage[a+
"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(a){var b=!1,c=window.sessionStorage[a+"expanded"];"string"===typeof c&&(c=0<c.length?JSON.parse(c):null);var e;if(c)for(e=0;e<c.length;e++)if(d.node(c[e])){this._expanded.push(c[e]);var h=this;this.tableTree.expand(c[e],function(){h._restoreSelections(a)});b=!0}return!b},_getUIStatePreferencePath:function(){if(this.explorer){var a=this.explorer.getRootPath();if(this._cachePrefix&&a)return a=a.replace(/[^\.\:\-\_0-9A-Za-z]/g,""),
"/"+this._cachePrefix+"/"+a+"/uiState"}return null},expandCollapseImageId:function(a){return a+"__expand"},updateExpandVisuals:function(a,b){var c=d.node(this.expandCollapseImageId(a.id));c&&(c.classList.remove(this._expandImageClass),c.classList.remove(this._collapseImageClass),c.classList.remove(this._progressImageClass),c.classList.add("progress"===b?this._progressImageClass:b?this._expandImageClass:this._collapseImageClass))},getExpandImage:function(a,b,c,d){var e=document.createElement("span");
e.id=this.expandCollapseImageId(a.id);b.appendChild(e);e.classList.add(this._twistieSpriteClass);e.classList.add(this._collapseImageClass);if(c){var h=document.createElement("span");b.appendChild(h);h.classList.add(d||"imageSprite");h.classList.add(c)}var g=this;e.onclick=function(b){if(!g.explorer.getNavHandler().isDisabled(a)){g.tableTree.toggle(a.id);if(g.tableTree.isExpanded(a.id))g._expanded.push(a.id),g.explorer.postUserExpand&&g.explorer.postUserExpand(a.id);else for(var c in g._expanded)if(g._expanded[c]===
a.id){g._expanded.splice(c,1);break}(b=g._getUIStatePreferencePath())&&window.sessionStorage&&g._storeExpansions(b)}};return e},render:function(a,b){b.classList.add("navRow");this.renderRow(a,b)},rowsChanged:function(){"cursorOnly"!==this.explorer.selectionPolicy&&(this.explorer.refreshSelection(),this.explorer.initNavHandler());this._noRowHighlighting||(d.$(".sectionTreeTable",this.tableNode.parentNode)||d.$(".treetable",this.tableNode.parentNode))&&d.$$array(".treeTableRow",this.tableNode).forEach(function(a,
b){var c=!(b%2)?"lightSectionTreeTableRow":"darkSectionTreeTableRow",d="lightSectionTreeTableRow"===c?"darkSectionTreeTableRow":"lightSectionTreeTableRow";a.classList.add(c);a.classList.remove(d)})},updateCommands:function(){if(this.commandService)for(var a=d.$$array(".treeTableRow"),b=0;b<a.length;b++){var c=a[b],e=d.node(c.id+"actionswrapper");this.commandService.destroy(e);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,e,c._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=
[];var a=this._getUIStatePreferencePath();a&&window.sessionStorage&&this._restoreExpansions(a)&&this._restoreSelections(a)}};return b}();e.SelectionRenderer=function(){function b(a,c){this._init(a);this.explorer=c}b.prototype=new e.ExplorerRenderer;b.prototype.renderTableHeader=function(a){var b=document.createElement("thead"),c=document.createElement("tr");b.classList.add("navTableHeading");this._useCheckboxSelection&&c.appendChild(this.initCheckboxColumn(a));for(var d=0,e=this.getCellHeaderElement(d);e;)0<
e.innerHTML.length&&e.classList.add("navColumn"),c.appendChild(e),e=this.getCellHeaderElement(++d);b.appendChild(c);0<d&&a.appendChild(b)};b.prototype.renderRow=function(a,b){b.verticalAlign="baseline";b.classList.add("treeTableRow");if(void 0===a.selectable||a.selectable){var c=this.explorer.getNavDict();if(c){"cursorOnly"!==this.explorer.selectionPolicy&&b.classList.add("selectableNavRow");c.addRow(a,b);var d=this;b.addEventListener("click",function(b){if(d.explorer.getNavHandler())d.explorer.getNavHandler().onClick(a,
b)},!1)}if(c=this.getCheckboxColumn(a,b))c.classList.add("checkColumn"),b.appendChild(c)}for(var c=0,e=this.getCellElement(c,a,b);e;)b.appendChild(e),0===c?this.getPrimColumnStyle?e.classList.add(this.getPrimColumnStyle(a)):e.classList.add("navColumn"):this.getSecondaryColumnStyle?e.classList.add(this.getSecondaryColumnStyle()):e.classList.add("secondaryColumn"),e=this.getCellElement(++c,a,b)};b.prototype.getCellHeaderElement=function(a){};b.prototype.getCellElement=function(a,b,c){};return b}();
e.SimpleFlatModel=function(){function b(a,c,d){this.items=a;this.getKey=d;this.idPrefix=c;this.root={children:a}}b.prototype=new e.ExplorerModel;b.prototype.getRoot=function(a){a(this.root)};b.prototype.getId=function(a){a=this.getKey(a).replace(/[\\\/]/g,"");for(var b="",c=0;c<a.length;c++)b=a[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?b+a.charCodeAt(c):b+a[c];return this.idPrefix+b};b.prototype.getChildren=function(a,b){a===this.root?b(this.items):b([])};return b}();return e});
define("orion/objects",[],function(){function k(g){for(var d=Object.prototype.hasOwnProperty,b=1,h=arguments.length;b<h;b++){var k=arguments[b],e;for(e in k)d.call(k,e)&&(g[e]=k[e])}return g}return{clone:function(g){if(Array.isArray(g))return Array.prototype.slice.call(g);var d=Object.create(Object.getPrototypeOf(g));k(d,g);return d},mixin:k,toArray:function(g){return Array.isArray(g)?g:[g]}}});
define("edit/content/jsonExplorer",["orion/explorers/explorer","orion/objects","orion/uiUtils","orion/Deferred","orion/webui/littlelib"],function(k,g,d,b,h){function m(a){this._root={key:"json",value:a,id:"json"};this._id="json"}function e(a,b){this._init(a);this.options=a;this.explorer=b}function c(a){this.checkbox=!1;this.parentId=a.parentId;this.update=a.update;var b=this;h.node(this.parentId).addEventListener("click",function(a){var c=a.target;if(c.isKey||c.isValue){a=c;var e=c.id+"EditBox";if(!h.node(e)){for(;a&&
!a._item;)a=a.parentNode;var g=a._item;d.getUserText({id:e,refNode:c,hideRefNode:!0,initialText:c.textContent,onComplete:function(a){if(c.isValue){var d=a;if("null"===a)d=null;else if("true"===a)d=!0;else if("false"===a)d=!1;else if("0"<=a.charAt(0)&&"9">=a.charAt(0))try{d=parseInt(a)}catch(f){}else if('"'===a.charAt(0)||"'"===a.charAt(0))d=a.substring(1,a.length-1);else if("{"===a.charAt(0)||"["===a.charAt(0))try{d=JSON.parse(a)}catch(e){}g.parent.value[g.key]=d;b.update(g)}else g.parent.value[a]||
(g.parent.value[a]=g.value,delete g.parent.value[g.key],b.update({key:a,value:g.value,id:g.parent.id+"-"+a,parent:g.parent}))}})}}})}m.prototype={getRoot:function(a){a(this._root)},getChildren:function(a,b){if(a.children)b(a.children);else{var c=[],d=a.value;if(Array.isArray(d))for(var e=0;e<d.length;e++)c.push({key:String(e),value:d[e],id:a.id+"-"+e,parent:a});else"object"===typeof d&&d&&Object.keys(d).sort().forEach(function(b){c.push({key:b,value:d[b],id:a.id+"-"+b,parent:a})});a.children=c;b(c)}},
getId:function(a){return a.id}};e.prototype=new k.SelectionRenderer;g.mixin(e.prototype,{labelColumnIndex:0,emptyCallback:function(a){var b=this.explorer.emptyMessage;if(b){var c=document.createElement("tr"),d=document.createElement("td");d.colSpan=3;var e=document.createElement("div");e.classList.add("emptyJSON");e.appendChild(document.createTextNode(b));d.appendChild(e);c.appendChild(d);a.appendChild(c)}},getCellElement:function(a,b,c){switch(a){case 0:return a=document.createElement("td"),Array.isArray(b.value)||
"object"===typeof b.value?(a.noWrap=!0,this.getExpandImage(c,a)):(c=document.createElement("scan"),c.classList.add("typeimage"),"number"===typeof b.value?c.classList.add("numbertype"):"boolean"===typeof b.value?c.classList.add("booleantype"):"string"===typeof b.value&&c.classList.add("stringtype"),a.appendChild(c)),c=document.createElement("span"),a.appendChild(c),c.isKey=b.parent&&!Array.isArray(b.parent.value),c.appendChild(document.createTextNode(b.key)),c.classList.add("tablelabel"),a;case 1:a=
document.createElement("td");c=document.createElement("span");var d="";null===b.value?d="null":void 0===b.value?d="undefined":Array.isArray(b.value)||"object"===typeof b.value?Array.isArray(b.value)?d="[]":"object"===typeof b.value&&(d="{}"):d=b.value;c.isValue=!0;c.appendChild(document.createTextNode(d));a.appendChild(c);c.classList.add("tablelabel");return a;case 2:return a=document.createElement("td"),c=document.createElement("span"),d="object",Array.isArray(b.value)?d="array":"number"===typeof b.value?
d="number":"boolean"===typeof b.value?d="boolean":"string"===typeof b.value&&(d="string"),c.appendChild(document.createTextNode(d)),a.appendChild(c),a}}});c.prototype=new k.Explorer;g.mixin(c.prototype,{display:function(a){this.json=a;h.empty(this.parentId);this.renderer=new e({},this);this.createTree(this.parentId,new m(a||{}),{selectionPolicy:"cursorOnly"})},expandItem:function(a){var c=new b;this.showItem(a).then(function(a){this.myTree.isExpanded(a)?c.resolve(a):this.myTree.expand(this.model.getId(a),
function(){c.resolve(a)})}.bind(this),c.reject);return c},reveal:function(a){return this.showItem(a).then(function(a){var b=this.getNavHandler();b&&b.cursorOn(a,!0);return a}.bind(this))},showItem:function(a){var c=new b,d=this.getRow(a);if(d)c.resolve(d._item||a);else if(a.parent)return this.expandItem(a.parent).then(function(c){c=this.getRow(a);return!c?(new b).reject():c._item||a}.bind(this));return c}});return{JSONExplorer:c}});
define("orion/keyBinding",["orion/util"],function(k){function g(b,d,g,e,c,a){this.type=a||"keydown";this.keyCode="string"===typeof b&&"keydown"===this.type?b.toUpperCase().charCodeAt(0):b;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 d(b){this.keys=b}g.prototype={getKeys:function(){return[this]},match:function(b,d){if(void 0!==d){if(0!==d)return!1}else if(b instanceof Array){if(1<b.length)return!1;
b=b[0]}return b.type!==this.type?!1:this.keyCode===b.keyCode||this.keyCode===String.fromCharCode(k.isOpera?b.which:void 0!==b.charCode?b.charCode:b.keyCode)?this.mod1!==(k.isMac?b.metaKey:b.ctrlKey)||"keydown"===this.type&&this.mod2!==b.shiftKey||this.mod3!==b.altKey||k.isMac&&this.mod4!==b.ctrlKey?!1:!0:!1},equals:function(b){return!b||this.keyCode!==b.keyCode||this.mod1!==b.mod1||this.mod2!==b.mod2||this.mod3!==b.mod3||this.mod4!==b.mod4||this.type!==b.type?!1:!0}};d.prototype={getKeys:function(){return this.keys.slice(0)},
match:function(b,d){var g=this.keys;if(void 0!==d)return d>g.length?!1:g[d].match(b)?d===g.length-1?!0:d+1:!1;b instanceof Array||(b=[b]);if(b.length>g.length)return!1;var e;for(e=0;e<b.length;e++)if(!g[e].match(b[e]))return!1;return e===g.length?!0:e},equals:function(b){if(!b.keys||b.keys.length!==this.keys.length)return!1;for(var d=0;d<b.keys.length;d++)if(!b.keys[d].equals(this.keys[d]))return!1;return!0}};return{KeyBinding:g,KeyStroke:g,KeySequence:d}});
define("edit/content/jsonEditorPlugin","orion/plugin edit/content/jsonExplorer orion/Deferred orion/commands orion/keyBinding orion/webui/littlelib".split(" "),function(k,g,d,b,h,m){function e(b,c){return q?(l=b,f=c,q.setText(JSON.stringify(a,null,"\t"))):(new d).reject()}function c(){q&&q.getText().then(function(b){a={};n||(n=new g.JSONExplorer({parentId:document.body,update:e}));try{a=JSON.parse(b)}catch(c){n.emptyMessage="Error parsing JSON text: "+c.message}n.display(a);l&&(f?n.expandItem(l).then(function(){n.reveal(l)}):
n.reveal(l))})}var a,l,f,q,n,p=new b.CommandsProxy;k=new k({name:"Orion JSON Editor Plugin",version:"1.0",description:"This plugin provides editor for JSON files."});k.registerService("orion.edit.editor",{setTextModel:function(a){q=a;c();p.setProxy(q);return new d},onChanged:function(a){c()},registerKeys:function(a){var b=[];a.forEach(function(a){b.push(new h.KeyBinding(a.keyCode,a.mod1,a.mod2,a.mod3,a.mod4))});p.setKeyBindings(b)}},{id:"orion.editor.json",nameKey:"Orion JSON Editor",nls:"orion/nls/messages",
uriTemplate:"../edit/edit.html#{,Location,params*},editor\x3dorion.editor.json"});k.registerService("orion.navigate.openWith",{},{editor:"orion.editor.json",contentType:["application/json"]});k.registerService("orion.edit.command",{run:function(a){a="NewKey";for(var b,c=n.getNavHandler().currentModel()||n.model._root;c;){b=c.value;if(Array.isArray(b))a=b.length+"",b.push("NewValue");else if("object"===typeof b)b[a]="NewValue";else{c=c.parent;continue}e({key:a,value:"NewValue",id:c.id+"-"+a,parent:c});
break}return null}},{name:"Add",contentTypes:["application/json"],editor:"orion.editor.json",key:["a",!0]});k.registerService("orion.edit.command",{run:function(a){if(a=n.getNavHandler().currentModel()){var b=a.parent.value;Array.isArray(b)?b.splice(a.key,1):delete b[a.key];e(a.parent,!0)}return null}},{name:"Delete",contentTypes:["application/json"],editor:"orion.editor.json",key:[46]});k.connect()});
//@ sourceMappingURL=jsonEditorPlugin.js.map