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

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

/*******************************************************************************
 * @license
 * Copyright (c) 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) 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) 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) 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) 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
*/
(function(a,c){typeof define==="function"&&define.amd?define("orion/Deferred",c):typeof exports==="object"?module.exports=c():(a.orion=a.orion||{},a.orion.Deferred=c())})(this,function(){function a(){for(var f;f=m.shift();)f();r=!1}function c(f){m.push(f);r||(r=!0,setTimeout(a,0))}function i(f){return function(){f.apply(void 0,arguments)}}function n(){function f(){for(var b;b=d.shift();){var a=b.deferred,e=g==="fulfilled"?"resolve":"reject";if(typeof b[e]==="function")try{var f=(0,b[e])(j),c=f&&(typeof f===
"object"||typeof f==="function")&&f.then;if(typeof c==="function")if(f===a.promise)a.reject(new TypeError);else{var k=f.cancel;typeof k==="function"?a._protected(m).parentCancel=k.bind(f):delete a._protected(m).parentCancel;c.call(f,i(a.resolve),i(a.reject),i(a.progress))}else a.resolve(f)}catch(n){a.reject(n)}else a[e](j)}}function a(b){delete k.parentCancel;g="rejected";j=b;d.length&&c(f)}function q(b){function s(h){return function(b){i||(i=!0,h(b))}}var i=!1;delete k.parentCancel;try{var l=b&&
(typeof b==="object"||typeof b==="function")&&b.then;if(typeof l==="function")if(b===e)a(new TypeError);else{g="assumed";var m=b&&b.cancel;if(typeof m!=="function"){var o=new n,b=o.promise;try{l(o.resolve,o.reject,o.progress)}catch(p){o.reject(p)}m=b.cancel;l=b.then}j=b;l.call(b,s(q),s(a));k.parentCancel=m.bind(b)}else g="fulfilled",j=b,d.length&&c(f)}catch(h){s(a)(h)}}function l(){var b=k.parentCancel;if(b)delete k.parentCancel,b();else if(!g)b=Error("Cancel"),b.name="Cancel",a(b)}var j,g,d=[],e=
this,k={};Object.defineProperty(this,"_protected",{value:function(b){if(b!==m)throw Error("protected");return k}});this.resolve=function(b){g||q(b);return e};this.reject=function(b){g||a(b);return e};this.progress=function(b){g||d.forEach(function(a){if(a.progress)try{a.progress(b)}catch(f){}});return e.promise};this.cancel=function(){k.parentCancel?setTimeout(l,0):l();return e};this.then=function(b,a,k){b={resolve:b,reject:a,progress:k,deferred:new n};d.push(b);b.deferred._protected(m).parentCancel=
e.promise.cancel.bind(e);(g==="fulfilled"||g==="rejected")&&c(f);return b.deferred.promise};this.promise={then:e.then,cancel:e.cancel}}var m=[],r=!1;n.all=function(a,c){function i(a,b){d||(g[a]=b,--j===0&&e.resolve(g))}function l(a,b){if(!d){if(c)try{i(a,c(b));return}catch(f){b=f}e.reject(b)}}var j=a.length,g=[],d=!1,e=new n;e.then(void 0,function(){d=!0;a.forEach(function(a){a.cancel&&a.cancel()})});j===0?e.resolve(g):a.forEach(function(a,b){a.then(i.bind(void 0,b),l.bind(void 0,b))});return e.promise};
n.when=function(a,c,i,l){var j;if(!(a&&typeof a.then==="function"))j=new n,j.resolve(a),a=j.promise;return a.then(c,i,l)};return n});
(function(a,c){typeof define==="function"&&define.amd?define("orion/plugin",["orion/Deferred"],c):typeof exports==="object"?module.exports=c(require("orion/Deferred")):(a.orion=a.orion||{},a.orion.PluginProvider=c(a.orion.Deferred))})(this,function(a){function c(a,c){this.__objectId=a;this.__methods=c}return function(i){function n(h){e&&(typeof ArrayBuffer==="undefined"&&(h=JSON.stringify(h)),e===self?e.postMessage(h):e.postMessage(h,"*"))}function m(){var h=[];Object.keys(o).forEach(function(a){var b=
o[a];h.push({serviceId:a,names:b.names,methods:b.methods,properties:b.properties})});return{headers:g||{},services:h}}function r(h,a){if(a&&a instanceof XMLHttpRequest){var b,c;try{b=a.status,c=a.statusText}catch(e){b=0,c=""}return{status:b||0,statusText:c}}return a}function f(h){var a=h?JSON.parse(JSON.stringify(h,r)):h;if(h instanceof Error)a.__isError=!0,a.message=a.message||h.message,a.name=a.name||h.name;return a}function w(h){if(!e)return(new a).reject(Error("plugin not connected"));h.id=String(k++);
var f=new a;u[h.id]=f;f.then(null,function(a){d&&a instanceof Error&&a.name==="Cancel"&&p({requestId:h.id,method:"cancel",params:a.message?[a.message]:[]})});var i=Object.prototype.toString;h.params.forEach(function(a,e){if(i.call(a)==="[object Object]"&&!(a instanceof c)){var d,g;for(d in a)i.call(a[d])==="[object Function]"&&(g=g||[],g.push(d));if(g){var j=b++;v[j]=a;d=function(){delete v[j]};f.then(d,d);h.params[e]=new c(j,g)}}});p(h);return f.promise}function q(a,b){a||a===0?p({id:a,result:null,
error:b}):console.log(b)}function l(a,b,c,e){e.forEach(function(a,b){if(a&&typeof a.__objectId!=="undefined"){var h={};a.__methods.forEach(function(b){h[b]=function(){return w({objectId:a.__objectId,method:b,params:Array.prototype.slice.call(arguments)})}});e[b]=h}});var d=typeof a===void 0?null:{id:a,result:null,error:null};try{var g=c.apply(b,e);if(d)g&&typeof g.then==="function"?(t[a]=g,g.then(function(b){delete t[a];d.result=b;p(d)},function(b){if(t[a])delete t[a],d.error=f(b),p(d)},function(){p({responseId:a,
method:"progress",params:Array.prototype.slice.call(arguments)})})):(d.result=g,p(d))}catch(i){if(d)d.error=f(i),p(d)}}function j(a){if(a.source===e){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=o[a.serviceId];d||q(a.id,"service not found");d=d.implementation;b in d?l(a.id,d,d[b],c):q(a.id,"method not found")}else if("objectId"in a){var f=v[a.objectId];f||q(a.id,"object not found");!b in f?l(a.id,f,f[b],c):q(a.id,"method not found")}else if("requestId"in
a){var g=t[a.requestId];g&&b==="cancel"&&g.cancel&&g.cancel.apply(g,c)}else if("responseId"in a){var i=u[a.responseId];i&&b==="progress"&&i.progress&&i.progress.apply(i,c)}else throw Error("Bad method: "+a.method);}else{var j=u[String(a.id)];delete u[String(a.id)];a.error?j.reject(a.error):j.resolve(a.result)}}catch(k){console.log("Plugin._messageHandler "+k)}}}var g=i,d=!1,e=null,k=0,b=0,s=0,t={},u={},v={},o={},p=n;this.updateHeaders=function(a){if(d)throw Error("Cannot update headers. Plugin Provider is connected");
g=a};this.registerServiceProvider=this.registerService=function(a,b,c){if(d)throw Error("Cannot register service. Plugin Provider is connected");typeof a==="string"?a=[a]:Array.isArray(a)||(a=[]);var e=null,f=[];for(e in b)typeof b[e]==="function"&&f.push(e);o[s++]={names:a,methods:f,implementation:b,properties:c||{},listeners:{}}};this.connect=function(a,b){if(!d){if(typeof window==="undefined")e=self;else if(window!==window.parent)e=window.parent;else if(window.opener!==null)e=window.opener;else{b&&
b("No valid plugin target");return}addEventListener("message",j,!1);var c={method:"plugin",params:[m()]};n(c);d=!0}a&&a()};this.disconnect=function(){d&&(removeEventListener("message",j),e=null,d=!1)}}});
define("orion/editor/stylers/lib/syntax",[],function(){return{id:"orion.lib",grammars:[{id:"orion.lib",patterns:[{include:"#brace_open"},{include:"#brace_close"},{include:"#bracket_open"},{include:"#bracket_close"},{include:"#parenthesis_open"},{include:"#parenthesis_close"},{include:"#number_decimal"},{include:"#number_hex"},{include:"#string_doubleQuote"},{include:"#string_singleQuote"}],repository:{brace_open:{match:"{",name:"punctuation.section.block.begin"},brace_close:{match:"}",name:"punctuation.section.block.end"},
bracket_open:{match:"\\[",name:"punctuation.section.bracket.begin"},bracket_close:{match:"\\]",name:"punctuation.section.bracket.end"},parenthesis_open:{match:"\\(",name:"punctuation.section.parens.begin"},parenthesis_close:{match:"\\)",name:"punctuation.section.parens.end"},doc_block:{begin:"/\\*\\*",end:"\\*/",name:"comment.block.documentation",patterns:[{match:"@(?:(?!\\*/)\\S)*",name:"keyword.other.documentation.tag"},{match:"\\<\\S*\\>",name:"keyword.other.documentation.markup"},{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",
name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]},number_decimal:{match:"\\b-?(?:\\.\\d+|\\d+\\.?\\d*)(?:[eE][+-]?\\d+)?\\b",name:"constant.numeric.number"},number_hex:{match:"\\b0[xX][0-9A-Fa-f]+\\b",name:"constant.numeric.hex"},string_doubleQuote:{match:'"(?:\\\\.|[^"])*"?',name:"string.quoted.double"},string_singleQuote:{match:"'(?:\\\\.|[^'])*'?",name:"string.quoted.single"},todo_comment_singleLine:{match:"(\\b)(TODO)(\\b)(.*)",
name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.line"}}}}},{id:"orion.c-like",patterns:[{include:"orion.lib"},{include:"#comment_singleLine"},{include:"#comment_block"}],repository:{comment_singleLine:{match:"//.*",name:"comment.line.double-slash",patterns:[{include:"orion.lib#todo_comment_singleLine"}]},comment_block:{begin:"/\\*",end:"\\*/",name:"comment.block",patterns:[{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",
captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]}}}],keywords:[]}});
define("orion/editor/stylers/text_x-php/syntax",["orion/editor/stylers/lib/syntax"],function(a){var c="abstract,and,array,as,break,callable,case,catch,class,clone,const,continue,declare,default,die,do,echo,else,elseif,empty,enddeclare,endfor,endforeach,endif,endswitch,endwhile,eval,exit,extends,false,FALSE,final,finally,for,foreach,function,global,goto,if,implements,include,include_once,insteadof,interface,instanceof,isset,list,namespace,new,null,NULL,or,parent,print,private,protected,public,require,require_once,return,self,static,switch,throw,trait,try,true,TRUE,unset,use,var,while,xor,yield,__halt_compiler,__CLASS__,__DIR__,__FILE__,__FUNCTION__,__LINE__,__METHOD__,__NAMESPACE__,__TRAIT__".split(","),a=
a.grammars;a.push({id:"orion.php",contentTypes:["text/x-php"],patterns:[{include:"orion.lib#doc_block"},{include:"orion.c-like"},{match:"(?i)<\\?(?:=|php)?(?:\\s|$)",name:"entity.name.declaration.php"},{match:"<%=?(?:\\s|$)",name:"entity.name.declaration.php"},{match:"#.*",name:"comment.line.number-sign.php",patterns:[{include:"orion.lib#todo_comment_singleLine"}]},{begin:"<<<(\\w+)$",end:"^\\1;$",name:"string.unquoted.heredoc.php"},{begin:"<<<'(\\w+)'$",end:"^\\1;$",name:"string.unquoted.heredoc.nowdoc.php"},
{match:"\\b0[bB][01]+\\b",name:"constant.numeric.binary.php"},{match:"\\b(?:"+c.join("|")+")\\b",name:"keyword.control.php"}]});return{id:"orion.php",grammars:a,keywords:c}});
define('built-phpPlugin.js',["orion/plugin","orion/editor/stylers/text_x-php/syntax"],function(a,c){var i=new a({name:"Orion PHP Tool Support",version:"1.0",description:"This plugin provides PHP tools support for Orion."});i.registerServiceProvider("orion.core.contenttype",{},{contentTypes:[{id:"text/x-php","extends":"text/plain",name:"PHP",extension:"php,php3,php4,php5,phpt,phtml,aw,ctp".split(",")}]});i.registerServiceProvider("orion.edit.highlighter",{},c.grammars[c.grammars.length-
1]);i.connect()});