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

/******************************************************************************* 
 * @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) 2011, 2012 IBM Corporation and others.
 * Copyright (c) 2012 VMware, Inc.
 * 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
 *     Andrew Eisenberg - rename to jsTemplateContentAssist.js
 *******************************************************************************/

/*******************************************************************************
 * @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) 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, 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) 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) 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) 2011, 2012 IBM Corporation and others.
 Copyright (c) 2012 VMware, Inc.
 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
 Andrew Eisenberg - rename to jsTemplateContentAssist.js

 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(e,j){typeof define==="function"&&define.amd?define("orion/Deferred",j):typeof exports==="object"?module.exports=j():(e.orion=e.orion||{},e.orion.Deferred=j())})(this,function(){function e(){for(var b;b=a.shift();)b();c=!1}function j(b){a.push(b);c||(c=!0,setTimeout(e,0))}function b(a){return function(){a.apply(void 0,arguments)}}function d(){function k(){for(var d;d=e.shift();){var f=d.deferred,k=l==="fulfilled"?"resolve":"reject";if(typeof d[k]==="function")try{var c=(0,d[k])(h),g=c&&(typeof c===
"object"||typeof c==="function")&&c.then;if(typeof g==="function")if(c===f.promise)f.reject(new TypeError);else{var i=c.cancel;typeof i==="function"?f._protected(a).parentCancel=i.bind(c):delete f._protected(a).parentCancel;g.call(c,b(f.resolve),b(f.reject),b(f.progress))}else f.resolve(c)}catch(j){f.reject(j)}else f[k](h)}}function f(a){delete n.parentCancel;l="rejected";h=a;e.length&&j(k)}function g(a){function b(a){return function(v){c||(c=!0,a(v))}}var c=!1;delete n.parentCancel;try{var o=a&&
(typeof a==="object"||typeof a==="function")&&a.then;if(typeof o==="function")if(a===i)f(new TypeError);else{l="assumed";var r=a&&a.cancel;if(typeof r!=="function"){var p=new d,a=p.promise;try{o(p.resolve,p.reject,p.progress)}catch(q){p.reject(q)}r=a.cancel;o=a.then}h=a;o.call(a,b(g),b(f));n.parentCancel=r.bind(a)}else l="fulfilled",h=a,e.length&&j(k)}catch(v){b(f)(v)}}function c(){var a=n.parentCancel;if(a)delete n.parentCancel,a();else if(!l)a=Error("Cancel"),a.name="Cancel",f(a)}var h,l,e=[],i=
this,n={};Object.defineProperty(this,"_protected",{value:function(b){if(b!==a)throw Error("protected");return n}});this.resolve=function(a){l||g(a);return i};this.reject=function(a){l||f(a);return i};this.progress=function(a){l||e.forEach(function(b){if(b.progress)try{b.progress(a)}catch(f){}});return i.promise};this.cancel=function(){n.parentCancel?setTimeout(c,0):c();return i};this.then=function(b,f,c){b={resolve:b,reject:f,progress:c,deferred:new d};e.push(b);b.deferred._protected(a).parentCancel=
i.promise.cancel.bind(i);(l==="fulfilled"||l==="rejected")&&j(k);return b.deferred.promise};this.promise={then:i.then,cancel:i.cancel}}var a=[],c=!1;d.all=function(a,b){function c(a,b){m||(l[a]=b,--h===0&&i.resolve(l))}function e(a,d){if(!m){if(b)try{c(a,b(d));return}catch(k){d=k}i.reject(d)}}var h=a.length,l=[],m=!1,i=new d;i.then(void 0,function(){m=!0;a.forEach(function(a){a.cancel&&a.cancel()})});h===0?i.resolve(l):a.forEach(function(a,b){a.then(c.bind(void 0,b),e.bind(void 0,b))});return i.promise};
d.when=function(a,b,c,e){var h;if(!(a&&typeof a.then==="function"))h=new d,h.resolve(a),a=h.promise;return a.then(b,c,e)};return d});
(function(e,j){typeof define==="function"&&define.amd?define("orion/plugin",["orion/Deferred"],j):typeof exports==="object"?module.exports=j(require("orion/Deferred")):(e.orion=e.orion||{},e.orion.PluginProvider=j(e.orion.Deferred))})(this,function(e){function j(b,d){this.__objectId=b;this.__methods=d}return function(b){function d(a){i&&(typeof ArrayBuffer==="undefined"&&(a=JSON.stringify(a)),i===self?i.postMessage(a):i.postMessage(a,"*"))}function a(){var a=[];Object.keys(p).forEach(function(b){var d=
p[b];a.push({serviceId:b,names:d.names,methods:d.methods,properties:d.properties})});return{headers:l||{},services:a}}function c(a,b){if(b&&b instanceof XMLHttpRequest){var d,c;try{d=b.status,c=b.statusText}catch(f){d=0,c=""}return{status:d||0,statusText:c}}return b}function k(a){var b=a?JSON.parse(JSON.stringify(a,c)):a;if(a instanceof Error)b.__isError=!0,b.message=b.message||a.message,b.name=b.name||a.name;return b}function f(a){if(!i)return(new e).reject(Error("plugin not connected"));a.id=String(n++);
var b=new e;u[a.id]=b;b.then(null,function(b){m&&b instanceof Error&&b.name==="Cancel"&&q({requestId:a.id,method:"cancel",params:b.message?[b.message]:[]})});var d=Object.prototype.toString;a.params.forEach(function(c,f){if(d.call(c)==="[object Object]"&&!(c instanceof j)){var k,e;for(k in c)d.call(c[k])==="[object Function]"&&(e=e||[],e.push(k));if(e){var g=s++;r[g]=c;k=function(){delete r[g]};b.then(k,k);a.params[f]=new j(g,e)}}});q(a);return b.promise}function g(a,b){a||a===0?q({id:a,result:null,
error:b}):console.log(b)}function o(a,b,d,c){c.forEach(function(a,b){if(a&&typeof a.__objectId!=="undefined"){var d={};a.__methods.forEach(function(b){d[b]=function(){return f({objectId:a.__objectId,method:b,params:Array.prototype.slice.call(arguments)})}});c[b]=d}});var e=typeof a===void 0?null:{id:a,result:null,error:null};try{var g=d.apply(b,c);if(e)g&&typeof g.then==="function"?(t[a]=g,g.then(function(b){delete t[a];e.result=b;q(e)},function(b){if(t[a])delete t[a],e.error=k(b),q(e)},function(){q({responseId:a,
method:"progress",params:Array.prototype.slice.call(arguments)})})):(e.result=g,q(e))}catch(l){if(e)e.error=k(l),q(e)}}function h(a){if(a.source===i){a=typeof a.data!=="string"?a.data:JSON.parse(a.data);try{if(a.method){var b=a.method,d=a.params||[];if("serviceId"in a){var c=p[a.serviceId];c||g(a.id,"service not found");c=c.implementation;b in c?o(a.id,c,c[b],d):g(a.id,"method not found")}else if("objectId"in a){var f=r[a.objectId];f||g(a.id,"object not found");!b in f?o(a.id,f,f[b],d):g(a.id,"method not found")}else if("requestId"in
a){var e=t[a.requestId];e&&b==="cancel"&&e.cancel&&e.cancel.apply(e,d)}else if("responseId"in a){var k=u[a.responseId];k&&b==="progress"&&k.progress&&k.progress.apply(k,d)}else throw Error("Bad method: "+a.method);}else{var l=u[String(a.id)];delete u[String(a.id)];a.error?l.reject(a.error):l.resolve(a.result)}}catch(h){console.log("Plugin._messageHandler "+h)}}}var l=b,m=!1,i=null,n=0,s=0,w=0,t={},u={},r={},p={},q=d;this.updateHeaders=function(a){if(m)throw Error("Cannot update headers. Plugin Provider is connected");
l=a};this.registerServiceProvider=this.registerService=function(a,b,d){if(m)throw Error("Cannot register service. Plugin Provider is connected");typeof a==="string"?a=[a]:Array.isArray(a)||(a=[]);var c=null,f=[];for(c in b)typeof b[c]==="function"&&f.push(c);p[w++]={names:a,methods:f,implementation:b,properties:d||{},listeners:{}}};this.connect=function(b,c){if(!m){if(typeof window==="undefined")i=self;else if(window!==window.parent)i=window.parent;else if(window.opener!==null)i=window.opener;else{c&&
c("No valid plugin target");return}addEventListener("message",h,!1);var f={method:"plugin",params:[a()]};d(f);m=!0}b&&b()};this.disconnect=function(){m&&(removeEventListener("message",h),i=null,m=!1)}}});
define("orion/editor/templates",[],function(){function e(b,d,a){this.prefix=b;this.description=d;this.template=a;this._parse()}function j(b,d){this._keywords=b||[];this._templates=[];this.addTemplates(d||[])}e.prototype={getProposal:function(b,d,a){var b=d-b.length,d={},c,e=a.delimiter!==void 0?a.delimiter:"\n";a.indentation&&(e+=a.indentation);for(var f=a.tab!==void 0?a.tab:"\t",g=0,j=this.variables,h=this.segments,a=[],l=0;l<h.length;l++){var m=h[l],i=j[m];if(i!==void 0)switch(m){case "${tab}":m=
f;break;case "${delimiter}":m=e;break;case "${cursor}":m="";c=g;break;default:var n=d[m];n||(n=d[m]={data:i.data,positions:[]});m=i.substitution;n.data&&n.data.values&&(m=n.data.values[0]);n.positions.push({offset:b+g,length:m.length})}a.push(m);g+=m.length}var e=[],s;for(s in d)d.hasOwnProperty(s)&&e.push(d[s]);a=a.join("");if(c===void 0)c=a.length;return{proposal:a,description:this.description,groups:e,escapePosition:b+c}},match:function(b){return this.prefix.indexOf(b)===0},_parse:function(){var b=
this.template,d=[],a={},c,e=0,b=b.replace(/\n/g,"${delimiter}"),b=b.replace(/\t/g,"${tab}");b.replace(/\$\{((?:[^\\}]+|\\.))*\}/g,function(f,g,j){var h=f.substring(2,f.length-1),g=f,l=h,m=null,i=l.indexOf(":");i!==-1&&(l=l.substring(0,i),g="${"+l+"}",m=JSON.parse(h.substring(i+1).replace("\\}","}").trim()));(h=a[g])||(h=a[g]={});h.substitution=l;if(m)h.data=m;(c=b.substring(e,j))&&d.push(c);d.push(g);e=j+f.length;return l});(c=b.substring(e,b.length))&&d.push(c);this.segments=d;this.variables=a}};
j.prototype={addTemplates:function(b){for(var d=this.getTemplates(),a=0;a<b.length;a++)d.push(new e(b[a].prefix,b[a].description,b[a].template))},computeProposals:function(b,d,a){var c=this.getPrefix(b,d,a),e=[];if(!this.isValid(c,b,d,a))return e;e=e.concat(this.getTemplateProposals(c,d,a));return e=e.concat(this.getKeywordProposals(c))},getKeywords:function(){return this._keywords},getKeywordProposals:function(b){var d=[],a=this.getKeywords();if(a)for(var c=0;c<a.length;c++)a[c].indexOf(b)===0&&
d.push({proposal:a[c].substring(b.length),description:a[c]});return d},getPrefix:function(b,d,a){return a.prefix},getTemplates:function(){return this._templates},getTemplateProposals:function(b,d,a){for(var c=[],e=this.getTemplates(),f=0;f<e.length;f++){var g=e[f];g.match(b)&&(g=g.getProposal(b,d,a),this.removePrefix(b,g),c.push(g))}return c},removePrefix:function(b,d){if(!(d.overwrite=d.proposal.substring(0,b.length)!==b))d.proposal=d.proposal.substring(b.length)},isValid:function(){return!0}};return{Template:e,
TemplateContentAssist:j}});
define("orion/editor/keywords",[],function(){return{JSKeywords:"break,case,class,catch,continue,const,debugger,default,delete,do,else,enum,export,extends,false,finally,for,function,if,implements,import,in,instanceof,interface,let,new,null,package,private,protected,public,return,static,super,switch,this,throw,true,try,typeof,undefined,var,void,while,with,yield".split(","),CSSKeywords:"alignment-adjust,alignment-baseline,animation,animation-delay,animation-direction,animation-duration,animation-iteration-count,animation-name,animation-play-state,animation-timing-function,appearance,azimuth,backface-visibility,background,background-attachment,background-clip,background-color,background-image,background-origin,background-position,background-repeat,background-size,baseline-shift,binding,bleed,bookmark-label,bookmark-level,bookmark-state,bookmark-target,border,border-bottom,border-bottom-color,border-bottom-left-radius,border-bottom-right-radius,border-bottom-style,border-bottom-width,border-collapse,border-color,border-image,border-image-outset,border-image-repeat,border-image-slice,border-image-source,border-image-width,border-left,border-left-color,border-left-style,border-left-width,border-radius,border-right,border-right-color,border-right-style,border-right-width,border-spacing,border-style,border-top,border-top-color,border-top-left-radius,border-top-right-radius,border-top-style,border-top-width,border-width,bottom,box-align,box-decoration-break,box-direction,box-flex,box-flex-group,box-lines,box-ordinal-group,box-orient,box-pack,box-shadow,box-sizing,break-after,break-before,break-inside,caption-side,clear,clip,color,color-profile,column-count,column-fill,column-gap,column-rule,column-rule-color,column-rule-style,column-rule-width,column-span,column-width,columns,content,counter-increment,counter-reset,crop,cue,cue-after,cue-before,cursor,direction,display,dominant-baseline,drop-initial-after-adjust,drop-initial-after-align,drop-initial-before-adjust,drop-initial-before-align,drop-initial-size,drop-initial-value,elevation,empty-cells,fit,fit-position,flex-align,flex-flow,flex-inline-pack,flex-order,flex-pack,float,float-offset,font,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,grid-columns,grid-rows,hanging-punctuation,height,hyphenate-after,hyphenate-before,hyphenate-character,hyphenate-lines,hyphenate-resource,hyphens,icon,image-orientation,image-rendering,image-resolution,inline-box-align,left,letter-spacing,line-height,line-stacking,line-stacking-ruby,line-stacking-shift,line-stacking-strategy,list-style,list-style-image,list-style-position,list-style-type,margin,margin-bottom,margin-left,margin-right,margin-top,mark,mark-after,mark-before,marker-offset,marks,marquee-direction,marquee-loop,marquee-play-count,marquee-speed,marquee-style,max-height,max-width,min-height,min-width,move-to,nav-down,nav-index,nav-left,nav-right,nav-up,opacity,orphans,outline,outline-color,outline-offset,outline-style,outline-width,overflow,overflow-style,overflow-x,overflow-y,padding,padding-bottom,padding-left,padding-right,padding-top,page,page-break-after,page-break-before,page-break-inside,page-policy,pause,pause-after,pause-before,perspective,perspective-origin,phonemes,pitch,pitch-range,play-during,position,presentation-level,punctuation-trim,quotes,rendering-intent,resize,rest,rest-after,rest-before,richness,right,rotation,rotation-point,ruby-align,ruby-overhang,ruby-position,ruby-span,size,speak,speak-header,speak-numeral,speak-punctuation,speech-rate,stress,string-set,table-layout,target,target-name,target-new,target-position,text-align,text-align-last,text-decoration,text-emphasis,text-height,text-indent,text-justify,text-outline,text-shadow,text-transform,text-wrap,top,transform,transform-origin,transform-style,transition,transition-delay,transition-duration,transition-property,transition-timing-function,unicode-bidi,vertical-align,visibility,voice-balance,voice-duration,voice-family,voice-pitch,voice-pitch-range,voice-rate,voice-stress,voice-volume,volume,white-space,white-space-collapse,widows,width,word-break,word-spacing,word-wrap,z-index".split(","),JAVAKeywords:"abstract,boolean,break,byte,case,catch,char,class,continue,default,do,double,else,extends,false,final,finally,float,for,if,implements,import,instanceof,int,interface,long,native,new,null,package,private,protected,public,return,short,static,super,switch,synchronized,this,throw,throws,transient,true,try,void,volatile,while".split(",")}});
define("orion/editor/cssContentAssist",["orion/editor/templates","orion/editor/keywords"],function(e,j){function b(a){return JSON.stringify(a).replace("}","\\}")}function d(){}for(var a={type:"link",values:"visible,hidden,scroll,auto,no-display,no-content".split(",")},c={type:"link",values:"solid,dashed,dotted,double,groove,ridge,inset,outset".split(",")},k={type:"link",values:[]},f=0;f<10;f++)k.values.push(f.toString());for(var g={type:"link",values:"black,white,red,green,blue,magenta,yellow,cyan,grey,darkred,darkgreen,darkblue,darkmagenta,darkcyan,darkyellow,darkgray,lightgray".split(",")},
o=[{prefix:"rule",description:"rule - class selector rule",template:".${class} {\n\t${cursor}\n}"},{prefix:"rule",description:"rule - id selector rule",template:"#${id} {\n\t${cursor}\n}"},{prefix:"outline",description:"outline - outline style",template:"outline: ${color:"+b(g)+"} ${style:"+b(c)+"} ${width:"+b(k)+"}px;"},{prefix:"background-image",description:"background-image - image style",template:'background-image: url("${uri}");'},{prefix:"url",description:"url - url image",template:'url("${uri}");'},
{prefix:"rgb",description:"rgb - rgb color",template:"rgb(${red},${green},${blue});"},{prefix:"@",description:"import - import style sheet",template:'@import "${uri}";'}],h=[{prop:"display",values:{type:"link",values:"none,block,box,flex,inline,inline-block,inline-flex,inline-table,list-item,table,table-caption,table-cell,table-column,table-column-group,table-footer-group,table-header-group,table-row,table-row-group,inherit".split(",")}},{prop:"overflow",values:a},{prop:"overflow-x",values:a},{prop:"overflow-y",
values:a},{prop:"float",values:{type:"link",values:["left","right","none","inherit"]}},{prop:"position",values:{type:"link",values:["absolute","fixed","relative","static","inherit"]}},{prop:"cursor",values:{type:"link",values:"auto,crosshair,default,e-resize,help,move,n-resize,ne-resize,nw-resize,pointer,progress,s-resize,se-resize,sw-resize,text,w-resize,wait,inherit".split(",")}},{prop:"color",values:g},{prop:"border-top-color",values:g},{prop:"border-bottom-color",values:g},{prop:"border-right-color",
values:g},{prop:"border-left-color",values:g},{prop:"background-color",values:g},{prop:"font-style",values:{type:"link",values:["italic","normal","oblique","inherit"]}},{prop:"font-weight",values:{type:"link",values:"bold,normal,bolder,lighter,100,200,300,400,500,600,700,800,900,inherit".split(",")}},{prop:"white-space",values:{type:"link",values:"pre,pre-line,pre-wrap,nowrap,normal,inherit".split(",")}},{prop:"word-wrap",values:{type:"link",values:["normal","break-word"]}},{prop:"visibility",values:{type:"link",
values:["hidden","visible","collapse","inherit"]}}],f=0;f<h.length;f++)a=h[f],o.push({prefix:a.prop,description:a.prop+" - "+a.prop+" style",template:a.prop+": ${value:"+b(a.values)+"};"});h="width,height,top,bottom,left,right,min-width,min-height,max-width,max-height,margin,padding,padding-left,padding-right,padding-top,padding-bottom,margin-left,margin-top,margin-bottom,margin-right".split(",");for(f=0;f<h.length;f++)a=h[f],o.push({prefix:a,description:a+" - "+a+" pixel style",template:a+": ${value}px;"});
h=["padding","margin"];for(f=0;f<h.length;f++)a=h[f],o.push({prefix:a,description:a+" - "+a+" top right bottom left style",template:a+": ${top}px ${left}px ${bottom}px ${right}px;"}),o.push({prefix:a,description:a+" - "+a+" top right,left bottom style",template:a+": ${top}px ${right_left}px ${bottom}px;"}),o.push({prefix:a,description:a+" - "+a+" top,bottom right,left style",template:a+": ${top_bottom}px ${right_left}px"});h=["border","border-top","border-bottom","border-left","border-right"];for(f=
0;f<h.length;f++)a=h[f],o.push({prefix:a,description:a+" - "+a+" style",template:a+": ${width:"+b(k)+"}px ${style:"+b(c)+"} ${color:"+b(g)+"};"});d.prototype=new e.TemplateContentAssist(j.CSSKeywords,o);d.prototype.getPrefix=function(a,b){for(var c=b;c&&/[A-Za-z\-\@]/.test(a.charAt(c-1));)c--;return c?a.substring(c,b):""};return{CssContentAssistProvider:d}});
define("orion/editor/htmlContentAssist",["orion/editor/templates"],function(e){function j(){}var b=new e.Template("","Simple HTML document",'<!DOCTYPE html>\n<html lang="en">\n\t<head>\n\t\t<meta charset=utf-8>\n\t\t<title>${title}</title>\n\t</head>\n\t<body>\n\t\t<h1>${header}</h1>\n\t\t<p>\n\t\t\t${cursor}\n\t\t</p>\n\t</body>\n</html>'),d=[{prefix:"<img",description:"<img> - HTML image element",template:'<img src="${cursor}" alt="${Image}"/>'},{prefix:"<a",description:"<a> - HTML anchor element",
template:'<a href="${cursor}"></a>'},{prefix:"<ul",description:"<ul> - HTML unordered list",template:"<ul>\n\t<li>${cursor}</li>\n</ul>"},{prefix:"<ol",description:"<ol> - HTML ordered list",template:"<ol>\n\t<li>${cursor}</li>\n</ol>"},{prefix:"<dl",description:"<dl> - HTML definition list",template:"<dl>\n\t<dt>${cursor}</dt>\n\t<dd></dd>\n</dl>"},{prefix:"<table",description:"<table> - basic HTML table",template:"<table>\n\t<tr>\n\t\t<td>${cursor}</td>\n\t</tr>\n</table>"}],a,c,k,f,g="abbr,b,button,canvas,cite,command,dd,del,dfn,dt,em,embed,font,h1,h2,h3,h4,h5,h6,i,ins,kbd,label,li,mark,meter,object,option,output,progress,q,rp,rt,samp,small,strong,sub,sup,td,time,title,tt,u,var".split(",");
for(f=0;f<g.length;f++)a=g[f],k="<"+a+"></"+a+">",c="<"+a+">${cursor}</"+a+">",d.push({prefix:"<"+a,description:k,template:c});g="address,article,aside,audio,bdo,blockquote,body,caption,code,colgroup,datalist,details,div,fieldset,figure,footer,form,head,header,hgroup,iframe,legend,map,menu,nav,noframes,noscript,optgroup,p,pre,ruby,script,section,select,span,style,tbody,textarea,tfoot,th,thead,tr,video".split(",");for(f=0;f<g.length;f++)a=g[f],k="<"+a+"></"+a+">",c="<"+a+">\n\t${cursor}\n</"+a+">",
d.push({prefix:"<"+a,description:k,template:c});g="area,base,br,col,hr,input,link,meta,param,keygen,source".split(",");for(f=0;f<g.length;f++)a=g[f],c=k="<"+a+"/>",d.push({prefix:"<"+a,description:k,template:c});j.prototype=new e.TemplateContentAssist([],d);j.prototype.getPrefix=function(a,b){for(var c=b;c&&/[A-Za-z0-9<]/.test(a.charAt(c-1));)if(c--,a.charAt(c)==="<")break;return c?a.substring(c,b):""};j.prototype.computeProposals=function(a,c,d){return a.length===0?[b.getProposal("",c,d)]:e.TemplateContentAssist.prototype.computeProposals.call(this,
a,c,d)};return{HTMLContentAssistProvider:j}});
define("orion/editor/htmlGrammar",[],function(){return{HtmlGrammar:function(){return{scopeName:"source.html",uuid:"3B5C76FB-EBB5-D930-F40C-047D082CE99B",patterns:[{begin:"<!(doctype|DOCTYPE)",end:">",contentName:"entity.name.tag.doctype.html",beginCaptures:{0:{name:"entity.name.tag.doctype.html"}},endCaptures:{0:{name:"entity.name.tag.doctype.html"}}},{begin:"<\!--",end:"--\>",beginCaptures:{0:{name:"punctuation.definition.comment.html"}},endCaptures:{0:{name:"punctuation.definition.comment.html"}},patterns:[{match:"--",
name:"invalid.illegal.badcomment.html"}],contentName:"comment.block.html"},{match:"<[A-Za-z0-9_\\-:]+(?= ?)",name:"entity.name.tag.html"},{include:"#attrName"},{include:"#qString"},{include:"#qqString"},{include:"#entity"},{match:"</[A-Za-z0-9_\\-:]+>",name:"entity.name.tag.html"},{match:">",name:"entity.name.tag.html"}],repository:{attrName:{match:"[A-Za-z\\-:]+(?=\\s*=\\s*['\"])",name:"entity.other.attribute.name.html"},qqString:{match:'(")[^"]+(")',name:"string.quoted.double.html"},qString:{match:"(')[^']+(')",
name:"string.quoted.single.html"},entity:{match:"&[A-Za-z0-9]+;",name:"constant.character.entity.html"}}}}}});
define("orion/editor/jsTemplateContentAssist",["orion/editor/templates","orion/editor/keywords"],function(e,j){function b(){}var d=[{prefix:"if",description:"if - if statement",template:"if (${condition}) {\n\t${cursor}\n}"},{prefix:"if",description:"if - if else statement",template:"if (${condition}) {\n\t${cursor}\n} else {\n\t\n}"},{prefix:"for",description:"for - iterate over array",template:"for (var ${i}=0; ${i}<${array}.length; ${i}++) {\n\t${cursor}\n}"},{prefix:"for",description:"for - iterate over array with local var",
template:"for (var ${i}=0; ${i}<${array}.length; ${i}++) {\n\tvar ${value} = ${array}[${i}];\n\t${cursor}\n}"},{prefix:"for",description:"for..in - iterate over properties of an object",template:"for (var ${property} in ${object}) {\n\tif (${object}.hasOwnProperty(${property})) {\n\t\t${cursor}\n\t}\n}"},{prefix:"while",description:"while - while loop with condition",template:"while (${condition}) {\n\t${cursor}\n}"},{prefix:"do",description:"do - do while loop with condition",template:"do {\n\t${cursor}\n} while (${condition});"},
{prefix:"switch",description:"switch - switch case statement",template:"switch (${expression}) {\n\tcase ${value1}:\n\t\t${cursor}\n\t\tbreak;\n\tdefault:\n}"},{prefix:"case",description:"case - case statement",template:"case ${value}:\n\t${cursor}\n\tbreak;"},{prefix:"try",description:"try - try..catch statement",template:"try {\n\t${cursor}\n} catch (${err}) {\n}"},{prefix:"try",description:"try - try..catch statement with finally block",template:"try {\n\t${cursor}\n} catch (${err}) {\n} finally {\n}"},
{prefix:"var",description:"var - variable declaration",template:"var ${name};"},{prefix:"var",description:"var - variable declaration with value",template:"var ${name} = ${value};"},{prefix:"let",description:"let - local scope variable declaration",template:"let ${name};"},{prefix:"let",description:"let - local scope variable declaration with value",template:"let ${name} = ${value};"},{prefix:"return",description:"return - return result",template:"return ${result};"},{prefix:"typeof",description:"typeof - typeof statement",
template:'typeof ${object} === "${type:'+JSON.stringify({type:"link",values:"undefined,object,boolean,number,string,function,xml".split(",")}).replace("}","\\}")+'}"'},{prefix:"instanceof",description:"instanceof - instanceof statement",template:"${object} instanceof ${type}"},{prefix:"with",description:"with - with statement",template:"with (${object}) {\n\t${cursor}\n}"},{prefix:"function",description:"function - function declaration",template:"function ${name} (${parameter}) {\n\t${cursor}\n}"},
{prefix:"nls",description:"string - non NLS",template:"${cursor} //$NON-NLS-${0}$"},{prefix:"log",description:"log - console log",template:"console.log(${object});"}];b.prototype=new e.TemplateContentAssist(j.JSKeywords,d);b.prototype.isValid=function(a,b,d){a=d-a.length-1;for(d="";a>=0;)if(d=b[a],d==="\n"||d==="\r")break;else if(/\s/.test(d))a--;else break;b=d;return!b||":!@#$^&*.?<>".indexOf(b)===-1};return{JSTemplateContentAssistProvider:b}});
define('built-webEditingPlugin.js',"orion/plugin,orion/editor/cssContentAssist,orion/editor/htmlContentAssist,orion/editor/htmlGrammar,orion/editor/jsTemplateContentAssist,orion/editor/keywords,orion/editor/templates".split(","),function(e,j,b,d,a){e=new e({name:"Orion Web Editing Plugin",version:"1.0",description:"This plugin provides editor link support for the navigator and provides default editing capabilities for HTML, JavaScript, and CSS."});e.registerService("orion.core.contenttype",{},{contentTypes:[{id:"text/plain",
name:"Text",extension:["txt"],image:"../images/file.png"},{id:"text/html","extends":"text/plain",name:"HTML",extension:["html","htm"],image:"../images/html.png"},{id:"text/css","extends":"text/plain",name:"CSS",extension:["css"],image:"../images/css.png"},{id:"application/javascript","extends":"text/plain",name:"JavaScript",extension:["js"],image:"../images/javascript.png"},{id:"application/json","extends":"text/plain",name:"JSON",extension:["json"],image:"../images/file.png"},{id:"application/xml",
"extends":"text/plain",name:"XML",extension:["xml"],image:"../images/xmlfile.png"},{id:"text/x-java-source","extends":"text/plain",name:"Java",extension:["java"]},{id:"text/x-markdown","extends":"text/plain",name:"Markdown",extension:["md"]},{id:"text/x-yaml","extends":"text/plain",name:"YAML",extension:["yaml","yml"]},{id:"text/conf","extends":"text/plain",name:"Conf",extension:["conf"]},{id:"text/sh","extends":"text/plain",name:"sh",extension:["sh"]},{id:"image/gif",name:"GIF",extension:["gif"],
image:"../images/wtp/image.gif"},{id:"image/jpeg",name:"JPG",extension:["jpg","jpeg","jpe"],image:"../images/wtp/image.gif"},{id:"image/ico",name:"ICO",extension:["ico"],image:"../images/wtp/image.gif"},{id:"image/png",name:"PNG",extension:["png"],image:"../images/wtp/image.gif"},{id:"image/tiff",name:"TIFF",extension:["tif","tiff"],image:"../images/wtp/image.gif"},{id:"image/svg",name:"SVG",extension:["svg"],image:"../images/wtp/image.gif"}]});e.registerService("orion.navigate.command",{},{id:"orion.view.raw",
nameKey:"Raw",nls:"orion/nls/messages",tooltipKey:"Open the raw file or folder in the browser",uriTemplate:"{+Location}",forceSingleItem:!0,validationProperties:[{source:"!Projects"}]});e.registerService("orion.edit.editor",{},{id:"orion.editor",nameKey:"Orion Editor",nls:"orion/nls/messages",uriTemplate:"../edit/edit.html#{,Location,params*}",orionTemplate:"../edit/edit.html#{,Location,params*}"});e.registerService("orion.navigate.openWith",{},{editor:"orion.editor",contentType:"text/plain,text/html,text/css,application/javascript,application/json,application/xml,text/x-java-source".split(",")});
e.registerService("orion.navigate.openWith.default",{},{editor:"orion.editor"});e.registerService("orion.edit.contentassist",new j.CssContentAssistProvider,{name:"CSS content assist",contentType:["text/css"]});e.registerService("orion.edit.contentassist",new a.JSTemplateContentAssistProvider,{name:"JavaScript content assist",contentType:["application/javascript"]});e.registerService("orion.edit.contentassist",new b.HTMLContentAssistProvider,{name:"HTML content assist",contentType:["text/html"]});
e.registerService("orion.edit.highlighter",{},{type:"grammar",contentType:["text/html"],grammar:new d.HtmlGrammar});e.connect()});