/*******************************************************************************
 * @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) 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) 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(){var d=this;if(!d.define)d.define=function(h){d.orion=d.orion||{};d.orion.PluginProvider=h();d.eclipse=d.orion;delete d.define}})();
define("orion/plugin",[],function(){return function(d){function h(a){j&&(typeof ArrayBuffer==="undefined"&&(a=JSON.stringify(a)),j===self?j.postMessage(a):j.postMessage(a,"*"))}function e(a,b){if(b&&b instanceof XMLHttpRequest){var g,c;try{g=b.status,c=b.statusText}catch(f){g=0,c=""}return{status:g||0,statusText:c}}return b}function f(a){var b=a?JSON.parse(JSON.stringify(a,e)):a;if(a instanceof Error)b.__isError=!0,b.message=b.message||a.message,b.name=b.name||a.name;return b}function n(a){return function(b){i&&
h({serviceId:a,method:"dispatchEvent",params:[b]})}}function o(a){if(a.source===j){var b=typeof a.data!=="string"?a.data:JSON.parse(a.data);if(typeof b.cancel==="string"){var g=m[b.id];g&&(delete m[b.id],g.cancel&&g.cancel(b.cancel))}else{var a=b.serviceId,c=b.method,d=b.params,e=l[a],i=e.implementation,o=i[c];c==="addEventListener"?(c=d[0],e.listeners[c]=e.listeners[c]||n(a),d=[c,e.listeners[c]]):c==="removeEventListener"&&(c=d[0],d=[c,e.listeners[c]],delete e.listeners[c]);var k={id:b.id,result:null,
error:null};try{(g=o.apply(i,d))&&typeof g.then==="function"?(m[b.id]=g,g.then(function(a){delete m[b.id];k.result=a;h(k)},function(a){if(m[b.id])delete m[b.id],k.error=f(a),h(k)},function(){h({requestId:b.id,method:"progress",params:Array.prototype.slice.call(arguments)})})):(k.result=g,h(k))}catch(p){k.error=f(p),h(k)}}}}var p=d,l=[],i=!1,m={},j=null;this.updateHeaders=function(a){if(i)throw Error("Cannot update headers. Plugin Provider is connected");p=a};this.registerServiceProvider=this.registerService=
function(a,b,d){if(i)throw Error("Cannot register service. Plugin Provider is connected");typeof a==="string"?a=[a]:Array.isArray(a)||(a=[]);var c=null,e=[];for(c in b)typeof b[c]==="function"&&e.push(c);l[l.length]={names:a,methods:e,implementation:b,properties:d||{},listeners:{}}};this.connect=function(a,b){if(!i){if(typeof window==="undefined")j=self;else if(window!==window.parent)j=window.parent;else if(window.opener!==null)j=window.opener;else{b&&b("No valid plugin target");return}addEventListener("message",
o,!1);for(var d=[],c=0;c<l.length;c++)d.push({serviceId:c,names:l[c].names,methods:l[c].methods,properties:l[c].properties});h({method:"plugin",params:[{headers:p||{},services:d}]});i=!0}a&&a()};this.disconnect=function(){i&&(removeEventListener("message",o),j=null,i=!1)}}});
define('built-pageLinksPlugin.js',["require","orion/plugin"],function(d,h){var e={},f=new h({name:"Orion Page Links",version:"1.0",description:"This plugin provides the top-level page links for Orion."});f.registerService("orion.page.link",e,{nameKey:"Navigator",id:"orion.navigator",nls:"orion/nls/messages",uriTemplate:"{OrionHome}/navigate/table.html#"});f.registerService("orion.page.link",e,{nameKey:"Sites",id:"orion.sites",nls:"orion/nls/messages",uriTemplate:"{OrionHome}/sites/sites.html"});f.registerService("orion.page.link",
e,{nameKey:"Shell",id:"orion.shell",nls:"orion/nls/messages",uriTemplate:"{OrionHome}/shell/shellPage.html#projectfor={Location}"});f.registerService("orion.page.link",e,{nameKey:"Search",id:"orion.Search",nls:"orion/nls/messages",uriTemplate:"{OrionHome}/search/search.html"});f.registerService("orion.page.link.related",null,{id:"orion.navigateFromMetadata",nameKey:"Navigator",nls:"orion/nls/messages",tooltip:"Go to the navigator",validationProperties:[{source:"ChildrenLocation|ContentLocation",variableName:"NavigatorLocation",
replacements:[{pattern:"\\?depth=1$",replacement:""}]}],uriTemplate:"{OrionHome}/navigate/table.html#{NavigatorLocation}?depth=1"});f.registerService("orion.page.link.related",null,{id:"orion.editFromMetadata",nameKey:"Editor",nls:"orion/nls/messages",tooltip:"Edit the code",validationProperties:[{source:"ChildrenLocation|ContentLocation",variableName:"NavigatorLocation",replacements:[{pattern:"\\?depth=1$",replacement:""}]}],uriTemplate:"{OrionHome}/edit/edit.html#,navigate={NavigatorLocation}?depth=1"});
f.registerService("orion.page.link.user",null,{id:"orion.help",nameKey:"Help",nls:"orion/widgets/nls/messages",uriTemplate:d.toUrl("help/index.jsp"),category:0});f.registerService("orion.page.link.user",null,{id:"orion.settings",nameKey:"Settings",nls:"orion/widgets/nls/messages",uriTemplate:"{OrionHome}/settings/settings.html",category:1});e=document.createElement("a");e.href="./contentTemplates/helloWorld.zip";var n=document.createElement("a");n.href="./contentTemplates/pluginHelloWorld.zip";f.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:e.href});f.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:n.href});f.registerService("orion.core.setting",null,{settings:[{pid:"nav.config",
name:"Navigation",category:"general",properties:[{id:"links.newtab",name:"Links",type:"boolean",defaultValue:!1,options:[{value:!0,label:"Open in new tab"},{value:!1,label:"Open in same tab"}]}]}]});f.connect()});