/*******************************************************************************
 * @license
 * 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
 ******************************************************************************/

/*******************************************************************************
 * @license
 * 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
 *******************************************************************************/

/*******************************************************************************
 * @license
 * 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
 *******************************************************************************/

/*******************************************************************************
 * @license
 * 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
 *******************************************************************************/

/*******************************************************************************
 * @license
 * 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
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012, 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). 
 * 
 ******************************************************************************/

/*******************************************************************************
 * @license
 * 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) 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) 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) 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) 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, 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). 


 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) 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
*/
(function(c,a){typeof define==="function"&&define.amd?define("orion/Deferred",a):typeof exports==="object"?module.exports=a():(c.orion=c.orion||{},c.orion.Deferred=a())})(this,function(){function c(){for(var a;a=b.shift();)a();h=!1}function a(a){b.push(a);h||(h=!0,setTimeout(c,0))}function d(a){return function(){a.apply(void 0,arguments)}}function i(){function c(){for(var e;e=j.shift();){var a=e.deferred,g=l==="fulfilled"?"resolve":"reject";if(typeof e[g]==="function")try{var f=(0,e[g])(n),i=f&&(typeof f===
"object"||typeof f==="function")&&f.then;if(typeof i==="function")if(f===a.promise)a.reject(new TypeError);else{var m=f.cancel;typeof m==="function"?a._protected(b).parentCancel=m.bind(f):delete a._protected(b).parentCancel;i.call(f,d(a.resolve),d(a.reject),d(a.progress))}else a.resolve(f)}catch(h){a.reject(h)}else a[g](n)}}function m(e){delete g.parentCancel;l="rejected";n=e;j.length&&a(c)}function h(e){function p(e){return function(a){b||(b=!0,e(a))}}var b=!1;delete g.parentCancel;try{var d=e&&
(typeof e==="object"||typeof e==="function")&&e.then;if(typeof d==="function")if(e===f)m(new TypeError);else{l="assumed";var q=e&&e.cancel;if(typeof q!=="function"){var t=new i,e=t.promise;try{d(t.resolve,t.reject,t.progress)}catch(u){t.reject(u)}q=e.cancel;d=e.then}n=e;d.call(e,p(h),p(m));g.parentCancel=q.bind(e)}else l="fulfilled",n=e,j.length&&a(c)}catch(o){p(m)(o)}}function q(){var e=g.parentCancel;if(e)delete g.parentCancel,e();else if(!l)e=Error("Cancel"),e.name="Cancel",m(e)}var n,l,j=[],f=
this,g={};Object.defineProperty(this,"_protected",{value:function(e){if(e!==b)throw Error("protected");return g}});this.resolve=function(e){l||h(e);return f};this.reject=function(e){l||m(e);return f};this.progress=function(e){l||j.forEach(function(a){if(a.progress)try{a.progress(e)}catch(g){}});return f.promise};this.cancel=function(){g.parentCancel?setTimeout(q,0):q();return f};this.then=function(e,g,d){e={resolve:e,reject:g,progress:d,deferred:new i};j.push(e);e.deferred._protected(b).parentCancel=
f.promise.cancel.bind(f);(l==="fulfilled"||l==="rejected")&&a(c);return e.deferred.promise};this.promise={then:f.then,cancel:f.cancel}}var b=[],h=!1;i.all=function(a,d){function b(a,e){j||(l[a]=e,--n===0&&f.resolve(l))}function c(a,e){if(!j){if(d)try{b(a,d(e));return}catch(n){e=n}f.reject(e)}}var n=a.length,l=[],j=!1,f=new i;f.then(void 0,function(){j=!0;a.forEach(function(a){a.cancel&&a.cancel()})});n===0?f.resolve(l):a.forEach(function(a,e){a.then(b.bind(void 0,e),c.bind(void 0,e))});return f.promise};
i.when=function(a,d,b,c){var n;if(!(a&&typeof a.then==="function"))n=new i,n.resolve(a),a=n.promise;return a.then(d,b,c)};return i});
define("orion/PageUtil",[],function(){var c=/^http[s]?/i;return{hash:function(){var a=window.location.href.split("#")[1];return a?"#"+a:""},matchResourceParameters:function(a){var a=a||window.location.toString(),d={resource:""},c=a.indexOf("#");if(c!==-1&&(a=a.substring(c+1),a.length!==0)){a=a.split(",");d.resource=decodeURIComponent(a[0]);for(c=1;c<a.length;c++){var b=/([^=]*)(=?)(.*)/.exec(a[c]),h=decodeURIComponent(b[1]||""),b=decodeURIComponent(b[3]||"");h!==""&&h!=="resource"&&(d[h]=b)}}return d},
validateURLScheme:function(a,d){var i=a;if(a.indexOf("://")===-1){var b=document.createElement("a");b.href=a;i=b.href}b=!1;return(b=d?d.some(function(a){return RegExp("^"+a+":","i").test(i)}):c.test(i))?a:(console.log("Illegal URL Scheme: '"+a+"'"),"")}}});
define("orion/URITemplate",[],function(){function c(a){this._text=a}function a(a){return a.replace("%25","%")}function d(d,c){if(c==="U")return encodeURIComponent(d).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if(c==="U+R")return encodeURI(d).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(q,a);if(c==="U+R-,")return encodeURI(d).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+c);}function i(a,c,b){for(var f=
[],g=0;g<a.length;g++)typeof a[g]!=="undefined"&&f.push(d(a[g],c));return f.join(b)}function b(a,c,b,f){for(var g=Object.keys(a),e=[],p=0;p<g.length;p++)typeof a[g[p]]!=="undefined"&&e.push(d(g[p],c)+b+d(a[g[p]],c));return e.join(f)}function h(a){if(a.length===0)throw Error("Invalid Expression: 0 length expression");(this._operator=m[a[0]])?a=a.substring(1):this._operator=m.NUL;for(var c=[],d=a.split(","),b=0;b<d.length;b++){var g=d[b].match(s);if(g===null)throw Error("Bad VarSpec: "+a);c.push({name:g[1],
explode:!!g[2],prefix:g[3]?parseInt(g[3],10):-1})}this._varSpecList=c}function r(a){for(var d=[],b=0,f=a.indexOf("{",b);f!==-1;){d.push(new c(a.substring(b,f)));b=a.indexOf("}",f+1);if(b===-1)throw Error("Invalid template: "+a);d.push(new h(a.substring(f+1,b)));b+=1;f=a.indexOf("{",b)}d.push(new c(a.substring(b)));this._templateComponents=d}var m={NUL:{first:"",sep:",",named:!1,ifemp:"",allow:"U"},"+":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R"},".":{first:".",sep:",",named:!1,ifemp:"",allow:"U"},
"/":{first:"/",sep:"/",named:!1,ifemp:"",allow:"U"},";":{first:";",sep:";",named:!0,ifemp:"",allow:"U"},"?":{first:"?",sep:"&",named:!0,ifemp:"=",allow:"U"},"&":{first:"&",sep:"&",named:!0,ifemp:"=",allow:"U"},"#":{first:"#",sep:",",named:!1,ifemp:"",allow:"U+R"},",":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R-,"}},s=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/,q=/%25[0-9A-F][0-9A-F]/g;c.prototype={expand:function(){return encodeURI(this._text)}};
h.prototype={expand:function(a){for(var c=[],j=0;j<this._varSpecList.length;j++){var f=this._varSpecList[j],g=f.name,e=a[g],p=typeof e;if(p!=="undefined"&&e!==null){var h=c.length===0?this._operator.first:this._operator.sep;if(p==="string")this._operator.named&&(h+=d(g,"U+R"),h+=e.length===0?this._operator.ifemp:"="),f.prefix!==-1&&f.prefix<e.length&&(e=e.substring(0,f.prefix)),h+=d(e,this._operator.allow);else if(Array.isArray(e)){if(e.length===0)continue;f.explode?h+=i(e,this._operator.allow,this._operator.sep):
(f=i(e,this._operator.allow,","),this._operator.named&&(h+=d(g,"U+R"),h+=f.length===0?this._operator.ifemp:"="),h+=f)}else if(p==="object"){if(Object.keys(e).length===0)continue;f.explode?h+=b(e,this._operator.allow,"=",this._operator.sep):(f=b(e,this._operator.allow,",",","),this._operator.named&&(h+=d(g,"U+R"),h+=f.length===0?this._operator.ifemp:"="),h+=f)}else throw Error("bad param type: "+g+" : "+p);c.push(h)}}return c.join("")}};r.prototype={expand:function(a){for(var c=[],b=0;b<this._templateComponents.length;b++)c.push(this._templateComponents[b].expand(a));
return c.join("")}};return r});
define("orion/i18nUtil",["require","orion/Deferred"],function(c,a){function d(a){if(a=localStorage.getItem("orion/messageBundle/"+a))if(a=JSON.parse(a),a._expires&&a._expires>(new Date).getTime())return delete a._expires,a;return null}var i={};return{getMessageBundle:function(b){function h(a){a?c(["i18n!"+b],function(a){if(a){var c=b;a._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+c,JSON.stringify(a));delete a._expires}m.resolve(a)}):r(Error(b))}function r(a){m.reject(a)}
if(i[b])return i[b];var m=new a;i[b]=m;var s=d(b);if(s)return m.resolve(s),m;try{c([b],h,r)}catch(q){c(["orion/i18n!"+b],h,r)}return m},formatMessage:function(a){var c=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,d){return c[(d<<0)+1]})}}});
define("orion/objects",[],function(){function c(a){for(var c=1;c<arguments.length;c++){var i=arguments[c],b;for(b in i)Object.prototype.hasOwnProperty.call(i,b)&&(a[b]=i[b])}return a}return{clone:function(a){if(Array.isArray(a))return Array.prototype.slice.call(a);var d=Object.create(Object.getPrototypeOf(a));c(d,a);return d},mixin:c,toArray:function(a){return Array.isArray(a)?a:[a]}}});
(function(){function c(k){if(typeof k!=="string")throw new TypeError;}function a(k){return k?k.split("&"):[]}function d(k){return k.length===0?"":k.join("&")}function i(k){var a=/([^=]*)(?:=?)(.*)/.exec(k),k=a[1]?decodeURIComponent(a[1]):"",a=a[2]?decodeURIComponent(a[2]):"";return[k,a]}function b(a){var c=encodeURIComponent(a[0]);a[1]&&(c+="="+encodeURIComponent(a[1]));return c}function h(k,c){var e="",d=[],o=0;return{next:function(){if(e!==k.query)e=k.query,d=a(e);if(o<d.length){var b=i(d[o++]);
switch(c){case "keys":return b[0];case "values":return b[1];case "keys+values":return[b[0],b[1]];default:throw new TypeError;}}throw z;}}}function r(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function m(a){return a?/[1-9]\d*$/.exec(a)[0]:""}function s(a){var c=[];a.split("/").forEach(function(a){a===".."?c.pop():a!=="."&&c.push(a)});return c.join("/")}function q(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function n(a,c){if(typeof a!==
"string")throw new TypeError;var a=q(a),d=g.exec(a);if(!d)return null;var b={};b.scheme=d[1]||"";if(b.scheme&&!p.test(b.scheme))return null;var o=d[2];if(o&&(o=e.exec(o),b.userinfo=o[1],b.host=o[2],b.port=o[3],b.port&&!v.test(b.port)))return null;b.path=d[3];b.query=d[4];b.fragment=d[5];if(!b.scheme&&c&&(b.scheme=c.scheme,!b.host&&c.host))b.userinfo=c.userinfo,b.host=c.host,b.port=c.port,b.pathRelative=!0;if(b.pathRelative)if(b.path){if(b.path[0]!=="/")d=/^(.*\/)[^\/]*$/.exec(c.path)[1]||"/",b.path=
d+b.path}else b.path=c.path;if(b.scheme)b.scheme=b.scheme.toLowerCase();if(b.port)b.port=m(b.port);if(b.host&&b.path)b.path=s(b.path);return b}function l(a,b){var c;if(b){b=b.href||b;c=n(b);if(!c||!c.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:c})}c=n(a,c);if(!c)throw new SyntaxError;Object.defineProperty(this,"_input",{value:a,writable:!0});Object.defineProperty(this,"_url",{value:c,writable:!0});var e=new r(this);Object.defineProperty(this,"query",{get:function(){return this._url?
e:null},enumerable:!0})}try{var j;if(typeof window.URL==="function"&&window.URL.length!==0&&(j=new window.URL("http://www.w3.org?q")).protocol==="http:"&&j.query)return}catch(f){}var g=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,e=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,p=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,v=/^\d*$/,w=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,x=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,t=/^([^?#\s]*)$/,u=/^([^\s]*)$/,o=/^\S*$/,y=/([^:]*):?(.*)/,z=typeof StopIteration!==
"undefined"?StopIteration:Error("Stop Iteration"),A={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(r.prototype,{get:{value:function(k){c(k);var b;a(this._url.query).some(function(a){a=i(a);if(a[0]===k)return b=a[1],!0});return b},enumerable:!0},set:{value:function(k,e){c(k);c(e);var o=a(this._url.query);o.some(function(a,c){var d=i(a);if(d[0]===k)return d[1]=e,o[c]=b(d),!0})||o.push(b([k,e]));this._url.query=d(o)},enumerable:!0},has:{value:function(k){c(k);
return a(this._url.query).some(function(a){if(i(a)[0]===k)return!0})},enumerable:!0},"delete":{value:function(k){c(k);var b=a(this._url.query),e=b.filter(function(a){return i(a)[0]!==k});return e.length!==b.length?(this._url.query=d(e),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,b){if(typeof a!=="function")throw new TypeError;var c=h(this._url,"keys+values");try{for(;;){var e=c.next();a.call(b,e[1],e[0],this)}}catch(d){if(d!==z)throw d;
}},enumerable:!0},keys:{value:function(){return h(this._url,"keys")},enumerable:!0},values:{value:function(){return h(this._url,"values")},enumerable:!0},items:{value:function(){return h(this._url,"keys+values")}},size:{get:function(){return a(this._url.query).length},enumerable:!0},getAll:{value:function(k){c(k);var b=[];a(this._url.query).forEach(function(a){a=i(a);a[0]===k&&b.push(a[1])});return b},enumerable:!0},append:{value:function(k,e){c(k);c(e);var o=a(this._url.query);o.push(b([k,e]));this._url.query=
d(o)},enumerable:!0}});Object.defineProperties(l.prototype,{href:{get:function(){var a;if(this._url){a=this._url;var b=a.scheme?a.scheme+":":"";a.host&&(b+="//",a.userinfo&&(b+=a.userinfo+"@"),b+=a.host,a.port&&(b+=":"+a.port));b+=a.path;a.query&&(b+="?"+a.query);a.fragment&&(b+="#"+a.fragment);a=b}else a=this._input;return a},set:function(a){c(a);this._input=a;this._url=n(this._input,this._baseURL)},enumerable:!0},origin:{get:function(){return this._url&&this._url.host?this.protocol+"//"+this.host:
""},enumerable:!0},protocol:{get:function(){return this._url?this._url.scheme+":":":"},set:function(a){c(a);if(this._url&&(a=a.slice(-1)===":"?a.substring(0,a.length-1):a,a===""||p.test(a)))this._url.scheme=a.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(a){c(a);if(this._url)this._url.userinfo=a}},username:{get:function(){if(!this._url)return"";var a=y.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){c(a);if(this._url){var b=
y.exec(this._userinfo),a=[encodeURIComponent(a||"")];b[2]&&a.push(b[2]);this._userinfo=a.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var a=y.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){c(a);if(this._url){var b=[y.exec(this._userinfo)[1]||""];a&&b.push(encodeURIComponent(a));this._userinfo=b.join(":")}},enumerable:!0},host:{get:function(){var a="";this._url&&this._url.host&&(a+=this._url.host,this._url.port&&(a+=":"+this._url.port));return a},
set:function(a){c(a);if(this._url&&(a=x.exec(a)))this._url.host=a[1],this._url.port=m(a[2])},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){c(a);if(this._url&&w.exec(a))this._url.host=a},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===A[this.protocol]&&(a="");return a},set:function(a){c(a);if(this._url&&v.exec(a))this._url.port=m(a)},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(a){c(a);
if(this._url&&t.exec(a))this._url.host&&a&&a[0]!=="/"&&(a="/"+a),this._url.path=a?s(a):""},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){c(a);if(this._url&&(a&&a[0]==="?"&&(a=a.substring(1)),u.exec(a)))this._url.query=a},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(a){c(a);if(this._url&&(a&&a[0]==="#"&&(a=a.substring(1)),o.exec(a)))this._url.fragment=a},enumerable:!0}});
if((j=window.URL||window.webkitURL)&&j.createObjectURL)Object.defineProperty(l,"createObjectURL",{value:j.createObjectURL.bind(j),enumerable:!1}),Object.defineProperty(l,"revokeObjectURL",{value:j.revokeObjectURL.bind(j),enumerable:!1});window.URL=l})();define("orion/URL-shim",function(){});
define("orion/PageLinks","require,orion/Deferred,orion/PageUtil,orion/URITemplate,orion/i18nUtil,orion/objects,orion/URL-shim".split(","),function(c,a,d,i,b,h){function r(){return c.toUrl?(new URL(c.toUrl("orion/../"),window.location.href)).href.slice(0,-1):(new URL("/",window.location.href)).href.slice(0,-1)}function m(a){var b={};a.getPropertyKeys().forEach(function(c){c!=="objectClass"&&c!=="service.names"&&c!=="service.id"&&c!=="__plugin__"&&(b[c]=a.getProperty(c))});return b}function s(a){return b.getMessageBundle(a.nls).then(function(b){a.textContent=
a.nameKey?b[a.nameKey]:a.name;return a},function(){a.textContent=a.nameKey||a.name;return a})}function q(b,c){var f=b.getServiceReferences(c||"orion.page.link"),h=d.matchResourceParameters(window.location.href),j={OrionHome:r(),Location:h.resource},l=[];f.forEach(function(b){b=m(b);if(b.uriTemplate&&(b.nls||b.name)){var c=(new i(b.uriTemplate)).expand(j),c=d.validateURLScheme(c);b.href=c;b.nls?l.push(s(b)):(b.textContent=b.name,l.push((new a).resolve(b)))}});return a.all(l)}function n(a){var b=this.categories=
Object.create(null);a.forEach(function(a){b[a.id]=a})}function l(a){this.allPageLinks=a;this.allPageLinks.sort(j)}function j(a,b){var c=a.textContent&&a.textContent.toLowerCase(),d=b.textContent&&b.textContent.toLowerCase();return c<d?-1:c>d?1:0}var f;h.mixin(n.prototype,{getCategoryIDs:function(){return Object.keys(this.categories)},getCategory:function(a){return this.categories[a]||null}});h.mixin(l.prototype,{createLinkElements:function(){return this.allPageLinks.map(function(a){var b=a.href,a=
a.textContent,c=document.createElement("a");c.href=b;c.target="_self";c.classList.add("targetSelector");c.textContent=a;return c})},getAllLinks:function(){return this.allPageLinks}});return{getCategoriesInfo:function(b){var c;return!f?(c=[],b.getServiceReferences("orion.page.link.category").forEach(function(b){b=m(b);if(b.id&&(b.name||b.nameKey))b.nls?c.push(s(b)):(b.textContent=b.name,c.push((new a).resolve(b)))}),a.all(c).then(function(a){return f=new n(a)})):(new a).resolve(f)},getPageLinksInfo:function(a,
b){return q(a,b).then(function(a){return new l(a)})},getOrionHome:r}});
(function(c,a){typeof define==="function"&&define.amd?define("orion/plugin",["orion/Deferred"],a):typeof exports==="object"?module.exports=a(require("orion/Deferred")):(c.orion=c.orion||{},c.orion.PluginProvider=a(c.orion.Deferred))})(this,function(c){function a(a,c){this.__objectId=a;this.__methods=c}return function(d){function i(a){f&&(typeof ArrayBuffer==="undefined"&&(a=JSON.stringify(a)),f===self?f.postMessage(a):f.postMessage(a,"*"))}function b(){var a=[];Object.keys(t).forEach(function(b){var c=
t[b];a.push({serviceId:b,names:c.names,methods:c.methods,properties:c.properties})});return{headers:l||{},services:a}}function h(a,b){if(b&&b instanceof XMLHttpRequest){var c,d;try{c=b.status,d=b.statusText}catch(e){c=0,d=""}return{status:c||0,statusText:d}}return b}function r(a){var b=a?JSON.parse(JSON.stringify(a,h)):a;if(a instanceof Error)b.__isError=!0,b.message=b.message||a.message,b.name=b.name||a.name;return b}function m(b){if(!f)return(new c).reject(Error("plugin not connected"));b.id=String(g++);
var d=new c;w[b.id]=d;d.then(null,function(a){j&&a instanceof Error&&a.name==="Cancel"&&u({requestId:b.id,method:"cancel",params:a.message?[a.message]:[]})});var h=Object.prototype.toString;b.params.forEach(function(c,f){if(h.call(c)==="[object Object]"&&!(c instanceof a)){var g,i;for(g in c)h.call(c[g])==="[object Function]"&&(i=i||[],i.push(g));if(i){var j=e++;x[j]=c;g=function(){delete x[j]};d.then(g,g);b.params[f]=new a(j,i)}}});u(b);return d.promise}function s(a,b){a||a===0?u({id:a,result:null,
error:b}):console.log(b)}function q(a,b,c,d){d.forEach(function(a,b){if(a&&typeof a.__objectId!=="undefined"){var c={};a.__methods.forEach(function(b){c[b]=function(){return m({objectId:a.__objectId,method:b,params:Array.prototype.slice.call(arguments)})}});d[b]=c}});var e=typeof a===void 0?null:{id:a,result:null,error:null};try{var f=c.apply(b,d);if(e)f&&typeof f.then==="function"?(v[a]=f,f.then(function(b){delete v[a];e.result=b;u(e)},function(b){if(v[a])delete v[a],e.error=r(b),u(e)},function(){u({responseId:a,
method:"progress",params:Array.prototype.slice.call(arguments)})})):(e.result=f,u(e))}catch(g){if(e)e.error=r(g),u(e)}}function n(a){if(a.source===f){a=typeof a.data!=="string"?a.data:JSON.parse(a.data);try{if(a.method){var b=a.method,c=a.params||[];if("serviceId"in a){var d=t[a.serviceId];d||s(a.id,"service not found");d=d.implementation;b in d?q(a.id,d,d[b],c):s(a.id,"method not found")}else if("objectId"in a){var e=x[a.objectId];e||s(a.id,"object not found");!b in e?q(a.id,e,e[b],c):s(a.id,"method not found")}else if("requestId"in
a){var g=v[a.requestId];g&&b==="cancel"&&g.cancel&&g.cancel.apply(g,c)}else if("responseId"in a){var h=w[a.responseId];h&&b==="progress"&&h.progress&&h.progress.apply(h,c)}else throw Error("Bad method: "+a.method);}else{var i=w[String(a.id)];delete w[String(a.id)];a.error?i.reject(a.error):i.resolve(a.result)}}catch(j){console.log("Plugin._messageHandler "+j)}}}var l=d,j=!1,f=null,g=0,e=0,p=0,v={},w={},x={},t={},u=i;this.updateHeaders=function(a){if(j)throw Error("Cannot update headers. Plugin Provider is connected");
l=a};this.registerServiceProvider=this.registerService=function(a,b,c){if(j)throw Error("Cannot register service. Plugin Provider is connected");typeof a==="string"?a=[a]:Array.isArray(a)||(a=[]);var d=null,e=[];for(d in b)typeof b[d]==="function"&&e.push(d);t[p++]={names:a,methods:e,implementation:b,properties:c||{},listeners:{}}};this.connect=function(a,c){if(!j){if(typeof window==="undefined")f=self;else if(window!==window.parent)f=window.parent;else if(window.opener!==null)f=window.opener;else{c&&
c("No valid plugin target");return}addEventListener("message",n,!1);var d={method:"plugin",params:[b()]};i(d);j=!0}a&&a()};this.disconnect=function(){j&&(removeEventListener("message",n),f=null,j=!1)}}});
define('built-pageLinksPlugin.js',["require","orion/PageLinks","orion/plugin","orion/URITemplate"],function(c,a,d,i){var b={},d=new d({name:"Orion Page Links",version:"1.0",description:"This plugin provides the top-level page links for Orion."});d.registerService("orion.page.link.category",null,{id:"edit",nameKey:"Editor",nls:"orion/nls/messages",imageClass:"core-sprite-edit",order:10});d.registerService("orion.page.link.category",null,{id:"search",nameKey:"Search",nls:"orion/nls/messages",imageClass:"core-sprite-search",
order:30});d.registerService("orion.page.link.category",null,{id:"shell",nameKey:"Shell",nls:"orion/nls/messages",imageClass:"core-sprite-shell",order:40});d.registerService("orion.page.link",null,{nameKey:"EditorLinkWorkspace",nls:"orion/nls/messages",tooltip:"Edit code",category:"edit","default":!0,uriTemplate:"{+OrionHome}/edit/edit.html"});d.registerService("orion.page.link",b,{nameKey:"ShellLinkWorkspace",id:"orion.shell",nls:"orion/nls/messages",category:"shell","default":!0,uriTemplate:"{+OrionHome}/shell/shellPage.html"});
d.registerService("orion.page.link",b,{nameKey:"Search",id:"orion.Search",nls:"orion/nls/messages",category:"search","default":!0,order:10,uriTemplate:"{+OrionHome}/search/search.html"});d.registerService("orion.page.link.related",null,{id:"orion.editFromMetadata",nameKey:"EditorRelatedLink",nls:"orion/nls/messages",tooltip:"Open Editor page",category:"edit",order:1,validationProperties:[{source:"ChildrenLocation|ContentLocation",variableName:"EditorLocation",replacements:[{pattern:"\\?depth=1$",
replacement:""}]}],uriTemplate:"{+OrionHome}/edit/edit.html#{,EditorLocation}"});d.registerService("orion.page.link.related",null,{id:"orion.editParent",nameKey:"EditorRelatedLinkParent",nls:"orion/nls/messages",category:"edit",order:3,validationProperties:[{source:"Parents[0]:Location",variableName:"EditorLocation",replacements:[{pattern:"\\?depth=1$",replacement:""}]}],uriTemplate:"{+OrionHome}/edit/edit.html#{,EditorLocation}"});d.registerService("orion.page.link.related",null,{id:"orion.editProjectRoot",
nameKey:"EditorRelatedLinkProj",nls:"orion/nls/messages",category:"edit",order:5,validationProperties:[{source:"Parents[-1]:Location",variableName:"EditorLocation",replacements:[{pattern:"\\?depth=1$",replacement:""}]}],uriTemplate:"{+OrionHome}/edit/edit.html#{,EditorLocation}"});d.registerService("orion.page.link.user",null,{id:"orion.help",nameKey:"Help",nls:"orion/widgets/nls/messages",uriTemplate:c.toUrl("help/index.jsp"),category:"user.0"});d.registerService("orion.page.link.user",null,{id:"orion.report.bug",
nameKey:"Report a Bug",nls:"orion/widgets/nls/messages",uriTemplate:"https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Orion&component=Client&version=5.0",category:"user.0"});d.registerService("orion.page.link.user",null,{id:"orion.settings",nameKey:"Settings",nls:"orion/widgets/nls/messages",uriTemplate:"{+OrionHome}/settings/settings.html",category:"user.1"});c=document.createElement("a");c.href="./contentTemplates/helloWorld.zip";b=document.createElement("a");b.href="./contentTemplates/pluginHelloWorld.zip";
d.registerService("orion.core.content",null,{id:"orion.content.html5",nameKey:"Sample HTML5 Site",nls:"orion/nls/messages",descriptionKey:"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.",contentURITemplate:c.href});d.registerService("orion.core.content",null,{id:"orion.content.plugin",nameKey:"Sample Orion Plugin",nls:"orion/nls/messages",descriptionKey:"Generate a sample plugin for integrating with Orion.",contentURITemplate:b.href});d.registerService("orion.core.setting",
null,{settings:[{pid:"nav.config",nls:"orion/settings/nls/messages",nameKey:"Navigation",category:"general",categoryKey:"General",properties:[{id:"links.newtab",nameKey:"Links",type:"boolean",defaultValue:!1,options:[{value:!0,labelKey:"Open in new tab"},{value:!1,labelKey:"Open in same tab"}]}]}]});d.registerService("orion.core.getplugins",null,{uri:decodeURIComponent((new i("http://orion-plugins.googlecode.com/git/index.html#?target={InstallTarget}&version={Version}&OrionHome={OrionHome}")).expand({Version:"5.0",
InstallTarget:a.getOrionHome()+"/settings/settings.html",OrionHome:a.getOrionHome()}))});d.registerService("orion.page.getstarted",null,{data:[{label:"Add",image:"../images/add.png",secondaryImage:"../images/add-large-dulled.png",alt:"Add Content",media:"../media/Create.gif"},{label:"Modify",image:"../images/modify.png",secondaryImage:"../images/gear-large-dulled.png",alt:"Modify Content",media:"../media/Modify.gif"},{label:"Manage",image:"../images/manage.png",secondaryImage:"../images/hamburger-large-dulled.png",
alt:"Manage Content",media:"../media/Manage.gif"}]});d.connect()});