Bug 426950 - Readonly file widget: When clicking on a *.md file it should be rendered by the markdown viewer instead of the orion text editor. -- widget build
diff --git a/bundles/org.eclipse.orion.client.ui/web/browse/built/built-browser.css b/bundles/org.eclipse.orion.client.ui/web/browse/built/built-browser.css
index 0f39d18..e557ace 100644
--- a/bundles/org.eclipse.orion.client.ui/web/browse/built/built-browser.css
+++ b/bundles/org.eclipse.orion.client.ui/web/browse/built/built-browser.css
@@ -744,7 +744,6 @@
 	line-height: normal;
 	vertical-align:middle;
 	font-family: 'Orion Icon Font';
-	padding-right: 5px;
 	background: none;
 	border: none;
 	margin: 0;
@@ -997,17 +996,31 @@
 	font-weight: bold;

 }

 .contentassist > div:hover {

-	background-color: #fab467;

+	background-color: #fab467; 

+	background: linear-gradient(#fabb76, #e1a25c);

+	border-radius: 3px;

 }

 .contentassist>div.proposal-hr:hover {

-	background-color: white;

+	background-color: white; 

+	background: none;

 }

 .contentassist .selected {

-	 background-color: rgb(48, 135, 179);

-	 color: white;

+	background-color: rgb(48, 135, 179); 

+	background: linear-gradient(rgb(60, 150, 190), rgb(30, 120, 160));

+	border-radius: 3px;

+	color: white;

+}

+.contentassist .cloneProposal {

+	box-shadow: rgba(0, 0, 0, 0.9) 2px 2px 8px;

+	position: fixed;

+	z-index: 1000; 

 }

 .contentassist>div {

-	padding: 1px 3px 0 5px;

+	padding: 1px 3px 1px 5px;

+}

+.cloneWrapper {

+	display: block;

+	z-index: 1000; 

 }

 .comment {
 	color: #3C802C;
@@ -1569,6 +1582,16 @@
 	border-radius: 2px;

 	vertical-align:middle;

 }

+.commandHalfButton_left, .commandHalfButton_left:hover, .commandHalfButton_left:focus {

+    border-top-right-radius:0 !important;

+	border-bottom-right-radius:0 !important;

+	margin-right: 0 !important;

+}

+.commandHalfButton_right, .commandHalfButton_right:hover, .commandHalfButton_right:focus {

+    border-top-left-radius:0 !important;

+	border-bottom-left-radius:0 !important;

+	margin-left: 0 !important;

+}

 .commandButton:hover, .commandButton:focus {

 	background-color: #eee;

 }

@@ -1592,6 +1615,22 @@
 	-ms-user-select: none;

 	user-select: none;

 }

+.commandHalfImage_left, .commandHalfImage_left:hover, .commandHalfImage_left:focus{

+	border-right: 0;

+    border-top-right-radius:0;

+	border-bottom-right-radius:0;

+	padding-right: 0;

+	margin-right: 0;

+}

+.commandHalfImage_right, .commandHalfImage_right:hover, .commandHalfImage_right:focus{

+	border-left: 0;

+    border-top-left-radius:0;

+	border-bottom-left-radius:0;

+	line-height: inherit;

+	padding-left: 0;

+	margin-left 0;

+	vertical-align: top;"

+}

 .commandImage:hover, .commandImage:focus {

 	background-color: #e6e6e6;

 	border: 1px solid #ccc;

@@ -2233,7 +2272,7 @@
 	vertical-align: top;
 	padding-top:1px;
 	font-weight: bold;
-	font-size: 8pt;
+	font-size: 1.05em;
 	color: #444;
 	text-decoration: none;
 	line-height: 10pt;
@@ -2241,7 +2280,6 @@
 }
 a.currentLocation:hover {
 	font-weight: bold;
-	font-size: 8pt;
 	color: #F58B0F;
  	text-decoration: none;
 	border-bottom: 1px dotted;
@@ -2252,6 +2290,12 @@
     text-align:center; 
     vertical-align:middle;
 }
+.breadcrumb {
+	font-size: 1.05em;
+	text-decoration: none;
+	color: #3087B3;
+	padding-top: 2px;
+}
 .browserParentDome {
 	min-height: 215px !important;
 }
diff --git a/bundles/org.eclipse.orion.client.ui/web/browse/built/built-browser.js b/bundles/org.eclipse.orion.client.ui/web/browse/built/built-browser.js
index 8fe9388..e23aa72 100644
--- a/bundles/org.eclipse.orion.client.ui/web/browse/built/built-browser.js
+++ b/bundles/org.eclipse.orion.client.ui/web/browse/built/built-browser.js
@@ -2442,7 +2442,7 @@
         getNavigatorWorkspaceRootSegment: function () {

             if (this._workspaceRootSegmentName) {

                 var seg;

-                if (this._resource && this._resource.Parents) {

+                if (this._resource && this._resource.Parents && !this._resource.skip) {

                     seg = document.createElement('a'); //$NON-NLS-0$

 					var param = this._workspaceRootURL ? this._workspaceRootURL : "";

                     if (this._makeHref) {

@@ -5584,6 +5584,15 @@
 			this._dropdownNode.addEventListener("keydown", this._dropdownKeyDown.bind(this), false); //$NON-NLS-0$

 		},

 		

+		addTriggerNode: function(node){

+			var self = this;

+			node.addEventListener("click", function(event) { //$NON-NLS-0$

+				if (self.toggle(event))  {

+					lib.stop(event);

+				}

+			}, false);			

+		},

+		

 		/**

 		 * Toggle the open/closed state of the dropdown.  Return a boolean that indicates whether action was taken.

 		 */			

@@ -6186,6 +6195,8 @@
 

 define('text!orion/webui/dropdowntriggerbutton.html',[],function () { return '<button class="dropdownTrigger">${ButtonText}<span class="dropdownArrowDown core-sprite-openarrow"></span></button><ul class="dropdownMenu"></ul>';});

 

+define('text!orion/webui/dropdowntriggerbuttonwitharrow.html',[],function () { return '<button>${ButtonText}</button><button class="dropdownTrigger"><span class="dropdownArrowDown core-sprite-openarrow"></span></button><ul class="dropdownMenu"></ul>';});

+

 define('text!orion/webui/submenutriggerbutton.html',[],function () { return '<li class="dropdownSubMenu"><span class="dropdownTrigger dropdownMenuItem" role="menuitem" tabindex="0">${ButtonText}<span class="dropdownArrowRight core-sprite-closedarrow"></span></span><ul class="dropdownMenu"></ul></li>';});

 

 define('text!orion/webui/checkedmenuitem.html',[],function () { return '<li><label class="dropdownMenuItem"><input class="checkedMenuItem" role="menuitem" type="checkbox" />${ItemText}</label></li>';});

@@ -6516,9 +6527,9 @@
 /*jslint sub:true*/

  /*global define document window Image */

  

-define('orion/commands',['require', 'orion/util', 'orion/webui/littlelib', 'orion/webui/dropdown', 'text!orion/webui/dropdowntriggerbutton.html', 'text!orion/webui/submenutriggerbutton.html', 

+define('orion/commands',['require', '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'], 

-	function(require, util, lib, Dropdown, DropdownButtonFragment, SubMenuButtonFragment, CheckedMenuItemFragment, Tooltip) {

+	function(require, util, lib, Dropdown, DropdownButtonFragment, DropdownButtonWithArrowFragment, SubMenuButtonFragment, CheckedMenuItemFragment, Tooltip) {

 	

 		/* a function that can be set for retrieving bindings stored elsewhere, such as a command registry */

 		var getBindings = null;

@@ -6776,24 +6787,38 @@
 		return node;

 	}

 

-	function createDropdownMenu(parent, name, populateFunction, buttonClass, buttonIconClass, showName, selectionClass, positioningNode) {

+	function createDropdownMenu(parent, name, populateFunction, buttonClass, buttonIconClass, showName, selectionClass, positioningNode, displayExtraDropdown) {

 		parent = lib.node(parent);

 		if (!parent) {

 			throw "no parent node was specified"; //$NON-NLS-0$

 		}

 		var range = document.createRange();

 		range.selectNode(parent);

-		var buttonFragment = range.createContextualFragment(DropdownButtonFragment);

+		var buttonFragment = displayExtraDropdown ? range.createContextualFragment(DropdownButtonWithArrowFragment) : range.createContextualFragment(DropdownButtonFragment);

 		// bind name to fragment variable

 		lib.processTextNodes(buttonFragment, {ButtonText: name});

 		parent.appendChild(buttonFragment);

 		var newMenu = parent.lastChild;

-		var menuButton = newMenu.previousSibling;

+		var menuButton;

+		var extraDropdownButton;

+		if(displayExtraDropdown){

+			extraDropdownButton = newMenu.previousSibling;

+			menuButton = extraDropdownButton.previousSibling;

+		} else {

+			menuButton = newMenu.previousSibling;

+		}

 		if (buttonClass) {

 			menuButton.classList.add(buttonClass); //$NON-NLS-0$

+			if(extraDropdownButton) extraDropdownButton.classList.add(buttonClass); //$NON-NLS-0$

 		} else {

 			menuButton.classList.add("orionButton"); //$NON-NLS-0$

 			menuButton.classList.add("commandButton"); //$NON-NLS-0$

+			if(extraDropdownButton) {

+				extraDropdownButton.classList.add("orionButton"); //$NON-NLS-0$

+				extraDropdownButton.classList.add("commandButton"); //$NON-NLS-0$

+				extraDropdownButton.classList.add("commandHalfButton_right"); //$NON-NLS-0$

+				menuButton.classList.add("commandHalfButton_left"); //$NON-NLS-0$

+			}

 		}

 		if (buttonIconClass) {

 			if(!showName) {

@@ -6801,6 +6826,11 @@
 				menuButton.setAttribute("aria-label", name); //$NON-NLS-0$

 			}

 			_addImageToElement({ spriteClass: "commandSprite", imageClass: buttonIconClass }, menuButton, name); //$NON-NLS-0$

+			if(extraDropdownButton) {

+				extraDropdownButton.classList.add("commandImage"); //$NON-NLS-0$

+				extraDropdownButton.classList.add("commandHalfImage_right"); //$NON-NLS-0$

+				menuButton.classList.add("commandHalfImage_left"); //$NON-NLS-0$

+			}

 			menuButton.classList.add("orionButton"); // $NON-NLS-0$

 		}

 		menuButton.dropdown = new Dropdown.Dropdown({

@@ -6810,7 +6840,7 @@
 			positioningNode: positioningNode

 		});

 		newMenu.dropdown = menuButton.dropdown;

-		return {menuButton: menuButton, menu: newMenu, dropdown: menuButton.dropdown};

+		return {menuButton: menuButton, menu: newMenu, dropdown: menuButton.dropdown, extraDropdownButton: extraDropdownButton};

 	}

 	

 	function createCheckedMenuItem(parent, name, checked, onChange) {

@@ -19849,7 +19879,7 @@
 				self._onChanging(e);

 			}

 		};

-		baseModel.addEventListener("preChanged", this._listener.onChanged); //$NON-NLS-0$

+		baseModel.addEventListener("postChanged", this._listener.onChanged); //$NON-NLS-0$

 		baseModel.addEventListener("preChanging", this._listener.onChanging); //$NON-NLS-0$

 	}

 

@@ -21232,7 +21262,8 @@
 		 * @property {Function} next Returns the next annotation in the iterator.

 		 */		

 		/**

-		 * Returns an iterator of annotations for the given range of text.

+		 * Returns an iterator of annotations for the given range of text. If called with no parameters,

+		 * returns all annotations in the model.

 		 *

 		 * @param {Number} start the start offset of the range.

 		 * @param {Number} end the end offset of the range.

@@ -21240,20 +21271,26 @@
 		 */

 		getAnnotations: function(start, end) {

 			var annotations = this._annotations, current;

-			//TODO binary search does not work for range intersection when there are overlaping ranges, need interval search tree for this

-			var i = 0;

-			var skip = function() {

-				while (i < annotations.length) {

-					var a =  annotations[i++];

-					if ((start === a.start) || (start > a.start ? start < a.end : a.start < end)) {

-						return a;

+			var i = 0, skip;

+			if (start === undefined && end === undefined) {

+				skip = function() {

+					return (i < annotations.length) ? annotations[i++] : null;

+				};

+			} else {

+				//TODO binary search does not work for range intersection when there are overlaping ranges, need interval search tree for this

+				skip = function() {

+					while (i < annotations.length) {

+						var a =  annotations[i++];

+						if ((start === a.start) || (start > a.start ? start < a.end : a.start < end)) {

+							return a;

+						}

+						if (a.start >= end) {

+							break;

+						}

 					}

-					if (a.start >= end) {

-						break;

-					}

-				}

-				return null;

-			};

+					return null;

+				};

+			}

 			current = skip();

 			return {

 				next: function() {

@@ -22597,7 +22634,7 @@
 			}

 			var remove = [], add = [];

 			var model = annotationModel.getTextModel();

-			var iter = annotationModel.getAnnotations(0, model.getCharCount()), annotation;

+			var iter = annotationModel.getAnnotations(), annotation;

 			while (iter.hasNext()) {

 				annotation = iter.next();

 				if (types.indexOf(annotation.type) !== -1) {

@@ -23356,8 +23393,12 @@
 		 * @param {String} [tooltip] Tooltip to show on this group. If not provided, and the group uses an <code>imageClass</code>,

 		 * the <code>title</code> will be used as the tooltip.

 		 * @param {String} [selectionClass] CSS class to be appended when the command button is selected. Optional.

+		 * @param {String} or {boolean} [defaultActionId] Id of an action from this group that should be invoked when the group is selected. This will add an

+		 * arrow to the grup that will open the dropdown. Optionally this can be set to <code>true</code> instead of adding a particular action.

+		 * If set to <code>true</code> the group will be renderer as if there was a default action, but instead of invoking the default action it will

+		 * open the dropdown. Optional.

 		 */	

-		addCommandGroup: function(scopeId, groupId, position, title, parentPath, emptyGroupMessage, imageClass, tooltip, selectionClass) {

+		addCommandGroup: function(scopeId, groupId, position, title, parentPath, emptyGroupMessage, imageClass, tooltip, selectionClass, defaultActionId) {

 			if (!this._contributionsByScopeId[scopeId]) {

 				this._contributionsByScopeId[scopeId] = {};

 			}

@@ -23382,6 +23423,13 @@
 				if (selectionClass) {

 					parentTable[groupId].selectionClass = selectionClass;

 				}

+				

+				if(defaultActionId === true){

+					parentTable[groupId].pretendDefaultActionId = true;

+				} else {

+					parentTable[groupId].defaultActionId = defaultActionId;

+				}

+				

 

 				parentTable[groupId].emptyGroupMessage = emptyGroupMessage;

 			} else {

@@ -23392,6 +23440,8 @@
 										imageClass: imageClass,

 										tooltip: tooltip,

 										selectionClass: selectionClass,

+										defaultActionId: defaultActionId === true ? null : defaultActionId,

+										pretendDefaultActionId: defaultActionId === true,

 										children: {}};

 				parentTable.sortedContributions = null;

 			}

@@ -23676,8 +23726,18 @@
 							// If we wait until the end of asynch processing to add the menu button, the layout will have 

 							// to be redone. The down side to always adding the menu button is that we may find out we didn't

 							// need it after all, which could cause layout to change.

-

-							created = self._createDropdownMenu(parent, contribution.title, null /*nested*/, null /*populateFunc*/, contribution.imageClass, contribution.tooltip, contribution.selectionClass);

+							var defaultInvocation;

+							if(contribution.defaultActionId){

+								var defaultChild = self._commandList[contribution.defaultActionId];

+								if(defaultChild && (defaultChild.visibleWhen ? defaultChild.visibleWhen(items) : true)){

+									defaultInvocation = new Commands.CommandInvocation(handler, items, userData, defaultChild, self);

+									defaultInvocation.domParent = parent;

+								} else {

+									contribution.pretendDefaultActionId = true;

+								}

+							}

+						

+							created = self._createDropdownMenu(parent, contribution.title, null /*nested*/, null /*populateFunc*/, contribution.imageClass, contribution.tooltip, contribution.selectionClass, null, defaultInvocation, contribution.pretendDefaultActionId);

 							if(domNodeWrapperList){

 								mNavUtils.generateNavGrid(domNodeWrapperList, created.menuButton);

 							}

@@ -23845,7 +23905,7 @@
 		/*

 		 * private.  Parent must exist in the DOM.

 		 */

-		_createDropdownMenu: function(parent, name, nested, populateFunction, icon, tooltip, selectionClass, positioningNode) {

+		_createDropdownMenu: function(parent, name, nested, populateFunction, icon, tooltip, selectionClass, positioningNode, defaultInvocation, pretendDefaultActionId) {

 			parent = lib.node(parent);

 			// We create dropdowns asynchronously so it's possible that the parent has been removed from the document 

 			// by the time we are called.  If so, don't bother building a submenu for an orphaned menu.

@@ -23878,15 +23938,31 @@
 					tooltip = tooltip || name; // No text and no tooltip => fallback to name

 				}

 				tooltip = icon ? (tooltip || name) : tooltip;

-				var created = Commands.createDropdownMenu(menuParent, name, populateFunction, buttonCss, icon, false, selectionClass, positioningNode);

+				var created = Commands.createDropdownMenu(menuParent, name, populateFunction, buttonCss, icon, false, selectionClass, positioningNode, defaultInvocation || pretendDefaultActionId);

+				if(defaultInvocation){

+					defaultInvocation.domNode = created.menuButton;

+					var self = this;

+					created.menuButton.onclick = function(){

+						self._invoke(defaultInvocation);

+					};

+				} else if(pretendDefaultActionId && created.dropdown){

+					created.dropdown.addTriggerNode(created.menuButton);

+				}

 				menuButton = created.menuButton;

 				newMenu = created.menu;

 				if (tooltip) {

 					menuButton.commandTooltip = new mTooltip.Tooltip({

 						node: menuButton,

-						text: tooltip,

+						text: defaultInvocation && defaultInvocation.command && defaultInvocation.command.name ? tooltip + ": " + defaultInvocation.command.name: tooltip,

 						position: ["above", "below", "right", "left"] //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$

 					});

+					if(created.extraDropdownButton){

+						menuButton.commandTooltip = new mTooltip.Tooltip({

+							node: created.extraDropdownButton,

+							text: tooltip,

+							position: ["above", "below", "right", "left"] //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$

+						});						

+					}

 				}

 			}

 			

@@ -24983,6 +25059,7 @@
 		this.editorView = options.editorView;

 		this._maxEditorLines = options.maxEditorLines;

 		this.imageView = options.imageView;

+		this.isMarkdownView = options.isMarkdownView;

 		this.breadCrumbMaker = options.breadCrumbMaker;

 		this.branchSelector = options.branchSelector;

 		this.clickHandler = options.clickHandler;

@@ -25046,8 +25123,12 @@
 									this.editorView.getParent().style.height = textViewheight + "px"; //$NON-NLS-0$

 								}.bind(this));

 								this.editor = this.editorView.editor;

+							} else if(this.isMarkdownView) {

+								div = document.createElement("div"); //$NON-NLS-0$

+								this.markdownView.displayContents(div, this._metadata);

+								this._foldersSection.setContent(div);

 							} else if(this.imageView) {

-								//this._foldersSection.setContent(this.imageView.image);

+								//Do nothing, updateImage will be called.

 							} else {

 								this.folderNavExplorer = new FolderNavExplorer({

 									parentId: navNode,

@@ -25111,7 +25192,7 @@
 			if(this._metadata.Projects){ //this is a workspace root

 				this.displayWorkspaceView();

 			}

-			if(this.editorView || this.imageView) {

+			if(this.editorView || this.imageView || this.isMarkdownView) {

 				this.displayBrowseView(this._metadata);

 			} else if(this._metadata.Children){

 				this.displayBrowseView(this._metadata);

@@ -25704,7 +25785,7 @@
 				return;

 			}

 			var type = mAnnotations.AnnotationType.ANNOTATION_MATCHING_SEARCH;

-			var iter = annotationModel.getAnnotations(0, annotationModel.getTextModel().getCharCount());

+			var iter = annotationModel.getAnnotations();

 			var remove = [], add;

 			while (iter.hasNext()) {

 				var annotation = iter.next();

@@ -26048,7 +26129,7 @@
 			var annotationModel = editor.getAnnotationModel();

 			if(!annotationModel) { return true; }

 			var model = editor.getModel();

-			var annotation, iter = annotationModel.getAnnotations(0, model.getCharCount());

+			var annotation, iter = annotationModel.getAnnotations();

 			textView.setRedraw(false);

 			while (iter.hasNext()) {

 				annotation = iter.next();

@@ -27948,7 +28029,7 @@
 			

 			if (lineIndex === -1) { return; }

 			this._currentGroupAnnotation = groupAnnotation;

-			annotations = annotationModel.getAnnotations(0, model.getCharCount());

+			annotations = annotationModel.getAnnotations();

 			var add = [];

 			while (annotations.hasNext()) {

 				annotation = annotations.next();

@@ -29025,7 +29106,7 @@
 			if (!annotationModel) { return; }

 			var remove = [], add = [];

 			var textModel = annotationModel.getTextModel();

-			var annotations = annotationModel.getAnnotations(0, textModel.getCharCount()), annotation;

+			var annotations = annotationModel.getAnnotations(), annotation;

 			while (annotations.hasNext()) {

 				annotation = annotations.next();

 				switch (annotation.type) {

@@ -33264,6 +33345,8 @@
 /*global define*/

 

 define("orion/editor/stylers/application_json/syntax", ["orion/editor/stylers/shared/syntax"], function(mShared) { //$NON-NLS-0$

+	var keywords = ["false", "null", "true"]; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$

+

 	var grammars = mShared.grammars;

 	grammars.push({

 		id: "orion.json", //$NON-NLS-0$

@@ -33272,7 +33355,7 @@
 			{

 				include: "orion.patterns" //$NON-NLS-0$

 			}, {

-				match: "\\b(?:true|false|null)\\b", //$NON-NLS-0$

+				match: "\\b(?:" + keywords.join("|") + ")\\b", //$NON-NLS-0$

 				name: "keyword.control.json" //$NON-NLS-0$

 			}, {

 				/* override orion.patterns#comment_singleline */

@@ -33286,7 +33369,7 @@
 	return {

 		id: grammars[grammars.length - 1].id,

 		grammars: grammars,

-		keywords: []

+		keywords: keywords

 	};

 });

 

@@ -34330,7 +34413,7 @@
 				target: this._breadCrumbTarget,

 				breadCrumbContainer: bcContainer,

 				makeBreadcrumbLink: function(segment, folderLocation, folder) {this._makeBreadCrumbLink(segment, folderLocation, folder);}.bind(this),

-				makeBreadcrumFinalLink: true,

+				makeBreadcrumFinalLink: false,

 				fileClient: this._fileClient,

 				maxLength: maxLength

 			});

@@ -34419,7 +34502,9 @@
 					var id = input.editor;

 					if (!id || id === "orion.editor") { //$NON-NLS-0$

 						var cType = this._contentTypeService.getFileContentType(metadata);

-						if(!mNavigatorRenderer.isImage(cType)) {

+						if(cType.id === "text/x-markdown") {

+							browseViewOptons.isMarkdownView = true;

+						} else if(!mNavigatorRenderer.isImage(cType)) {

 							browseViewOptons.editorView = this._editorView;

 						} else {

 							browseViewOptons.imageView = {};

diff --git a/bundles/org.eclipse.orion.client.ui/web/browse/built/built-browser.min.js b/bundles/org.eclipse.orion.client.ui/web/browse/built/built-browser.min.js
index 81cbcf8..f1c7402 100644
--- a/bundles/org.eclipse.orion.client.ui/web/browse/built/built-browser.min.js
+++ b/bundles/org.eclipse.orion.client.ui/web/browse/built/built-browser.min.js
@@ -701,66 +701,66 @@
  Contributors: IBM Corporation - initial API and implementation
 */
 var requirejs,require,define;
-(function(g){function n(a,c){var d,k,q,x,A,m,h,b,e,l=c&&c.split("/"),t=r.map,w=t&&t["*"]||{};if(a&&"."===a.charAt(0))if(c){l=l.slice(0,l.length-1);a=l.concat(a.split("/"));for(b=0;b<a.length;b+=1)if(d=a[b],"."===d)a.splice(b,1),b-=1;else if(".."===d)if(1===b&&(".."===a[2]||".."===a[0]))break;else 0<b&&(a.splice(b-1,2),b-=2);a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((l||w)&&t){d=a.split("/");for(b=d.length;0<b;b-=1){k=d.slice(0,b).join("/");if(l)for(e=l.length;0<e;e-=1)if(q=t[l.slice(0,
-e).join("/")])if(q=q[k]){x=q;A=b;break}if(x)break;!m&&(w&&w[k])&&(m=w[k],h=b)}!x&&m&&(x=m,A=h);x&&(d.splice(0,A,x),a=d.join("/"))}return a}function p(a,c){return function(){return h.apply(g,t.call(arguments,0).concat([a,c]))}}function b(a){return function(c){return n(c,a)}}function l(a){return function(c){k[a]=c}}function f(a){if(v.call(m,a)){var c=m[a];delete m[a];w[a]=!0;d.apply(g,c)}if(!v.call(k,a)&&!v.call(w,a))throw Error("No "+a);return k[a]}function e(a){var c,d=a?a.indexOf("!"):-1;-1<d&&(c=
-a.substring(0,d),a=a.substring(d+1,a.length));return[c,a]}var d,h,c,a,k={},m={},r={},w={},v=Object.prototype.hasOwnProperty,t=[].slice;c=function(a,c){var d,k=e(a),q=k[0],a=k[1];q&&(q=n(q,c),d=f(q));q?a=d&&d.normalize?d.normalize(a,b(c)):n(a,c):(a=n(a,c),k=e(a),q=k[0],a=k[1],q&&(d=f(q)));return{f:q?q+"!"+a:a,n:a,pr:q,p:d}};a={require:function(a){return p(a)},exports:function(a){var c=k[a];return"undefined"!==typeof c?c:k[a]={}},module:function(a){return{id:a,uri:"",exports:k[a],config:function(){return r&&
-r.config&&r.config[a]||{}}}}};d=function(d,r,h,b){var q,x,A,B,C=[],e,b=b||d;if("function"===typeof h){r=!r.length&&h.length?["require","exports","module"]:r;for(B=0;B<r.length;B+=1)if(A=c(r[B],b),x=A.f,"require"===x)C[B]=a.require(d);else if("exports"===x)C[B]=a.exports(d),e=!0;else if("module"===x)q=C[B]=a.module(d);else if(v.call(k,x)||v.call(m,x)||v.call(w,x))C[B]=f(x);else if(A.p)A.p.load(A.n,p(b,!0),l(x),{}),C[B]=k[x];else throw Error(d+" missing "+x);r=h.apply(k[d],C);if(d)if(q&&q.exports!==
-g&&q.exports!==k[d])k[d]=q.exports;else if(r!==g||!e)k[d]=r}else d&&(k[d]=h)};requirejs=require=h=function(k,m,b,e,q){if("string"===typeof k)return a[k]?a[k](m):f(c(k,m).f);k.splice||(r=k,m.splice?(k=m,m=b,b=null):k=g);m=m||function(){};"function"===typeof b&&(b=e,e=q);e?d(g,k,m,b):setTimeout(function(){d(g,k,m,b)},4);return h};h.config=function(a){r=a;return h};define=function(a,c,d){c.splice||(d=c,c=[]);!v.call(k,a)&&!v.call(m,a)&&(m[a]=[a,c,d])};define.amd={jQuery:!0}})();define("almond",function(){});
-define("orion/PageUtil",[],function(){var g=/^http[s]?/i;return{hash:function(){var g=window.location.href.split("#")[1];return g?"#"+g:""},matchResourceParameters:function(g){var g=g||window.location.toString(),p={resource:""},b=g.indexOf("#");if(-1!==b&&(g=g.substring(b+1),0!==g.length)){g=g.split(",");p.resource=decodeURIComponent(g[0]);for(b=1;b<g.length;b++){var l=/([^=]*)(=?)(.*)/.exec(g[b]),f=decodeURIComponent(l[1]||""),l=decodeURIComponent(l[3]||"");""!==f&&"resource"!==f&&(p[f]=l)}}return p},
-validateURLScheme:function(n,p){var b=n;if(-1===n.indexOf("://")){var l=document.createElement("a");l.href=n;b=l.href}l=!1;if(l=p?p.some(function(l){return RegExp("^"+l+":","i").test(b)}):g.test(b))return n;console.log("Illegal URL Scheme: '"+n+"'");return""}}});
-(function(){function g(p,b,l){for(var f in b)b.hasOwnProperty(f)&&(!p.hasOwnProperty(f)||l)?p[f]=b[f]:"object"===typeof b[f]&&g(p[f],b[f],l)}var n=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(p){var b=p.config?p.config():{};return{version:"2.0.1+",load:function(l,f,e,d){d=d||{};d.locale&&(b.locale=d.locale);var h=n.exec(l),c=h[1],a=h[4],k=h[5],m=a.split("-"),r=[],w={},v,t="";h[5]?(c=h[1],l=c+k):(k=h[4],a=b.locale,a||(a=b.locale="undefined"===typeof navigator?"root":
-(navigator.language||navigator.userLanguage||"root").toLowerCase()),m=a.split("-"));if(d.isBuild){r.push(l);d=c+"root/"+k;require._fileExists(f.toUrl(d+".js"))&&r.push(d);for(v=0;v<m.length;v++)d=m[v],t+=(t?"-":"")+d,d=r,h=c+t+"/"+k,require._fileExists(f.toUrl(h+".js"))&&d.push(h);f(r,function(){e()})}else f([l],function(a){var d=[],h;h=c;var b=k;a.root&&(d.push("root"),(!0===a.root||1===a.root)&&r.push(h+"root/"+b));for(v=0;v<m.length;v++){h=m[v];h=t+=(t?"-":"")+h;var b=a,q=r,x=c,A=k;b[h]&&(d.push(h),
-(!0===b[h]||1===b[h])&&q.push(x+h+"/"+A))}f(r,function(){var q,x,A;for(q=d.length-1;-1<q&&d[q];q--){A=d[q];x=a[A];if(!0===x||1===x)x=f(c+A+"/"+k);g(w,x)}e(w)})})}}})})();define("orion/i18n",{load:function(g,n,p){n.specified&&n.specified("orion/bootstrap")?n(["orion/i18n!"+g],function(b){p(b)}):p({})}});
+(function(g){function n(b,c){var d,k,q,w,B,m,h,a,e,l=c&&c.split("/"),t=r.map,x=t&&t["*"]||{};if(b&&"."===b.charAt(0))if(c){l=l.slice(0,l.length-1);b=l.concat(b.split("/"));for(a=0;a<b.length;a+=1)if(d=b[a],"."===d)b.splice(a,1),a-=1;else if(".."===d)if(1===a&&(".."===b[2]||".."===b[0]))break;else 0<a&&(b.splice(a-1,2),a-=2);b=b.join("/")}else 0===b.indexOf("./")&&(b=b.substring(2));if((l||x)&&t){d=b.split("/");for(a=d.length;0<a;a-=1){k=d.slice(0,a).join("/");if(l)for(e=l.length;0<e;e-=1)if(q=t[l.slice(0,
+e).join("/")])if(q=q[k]){w=q;B=a;break}if(w)break;!m&&(x&&x[k])&&(m=x[k],h=a)}!w&&m&&(w=m,B=h);w&&(d.splice(0,B,w),b=d.join("/"))}return b}function p(b,c){return function(){return h.apply(g,t.call(arguments,0).concat([b,c]))}}function a(b){return function(c){return n(c,b)}}function l(b){return function(c){k[b]=c}}function f(b){if(u.call(m,b)){var c=m[b];delete m[b];x[b]=!0;d.apply(g,c)}if(!u.call(k,b)&&!u.call(x,b))throw Error("No "+b);return k[b]}function e(b){var c,d=b?b.indexOf("!"):-1;-1<d&&(c=
+b.substring(0,d),b=b.substring(d+1,b.length));return[c,b]}var d,h,c,b,k={},m={},r={},x={},u=Object.prototype.hasOwnProperty,t=[].slice;c=function(b,c){var d,k=e(b),q=k[0],b=k[1];q&&(q=n(q,c),d=f(q));q?b=d&&d.normalize?d.normalize(b,a(c)):n(b,c):(b=n(b,c),k=e(b),q=k[0],b=k[1],q&&(d=f(q)));return{f:q?q+"!"+b:b,n:b,pr:q,p:d}};b={require:function(b){return p(b)},exports:function(b){var c=k[b];return"undefined"!==typeof c?c:k[b]={}},module:function(b){return{id:b,uri:"",exports:k[b],config:function(){return r&&
+r.config&&r.config[b]||{}}}}};d=function(d,r,h,a){var q,w,B,A,C=[],e,a=a||d;if("function"===typeof h){r=!r.length&&h.length?["require","exports","module"]:r;for(A=0;A<r.length;A+=1)if(B=c(r[A],a),w=B.f,"require"===w)C[A]=b.require(d);else if("exports"===w)C[A]=b.exports(d),e=!0;else if("module"===w)q=C[A]=b.module(d);else if(u.call(k,w)||u.call(m,w)||u.call(x,w))C[A]=f(w);else if(B.p)B.p.load(B.n,p(a,!0),l(w),{}),C[A]=k[w];else throw Error(d+" missing "+w);r=h.apply(k[d],C);if(d)if(q&&q.exports!==
+g&&q.exports!==k[d])k[d]=q.exports;else if(r!==g||!e)k[d]=r}else d&&(k[d]=h)};requirejs=require=h=function(k,m,a,e,q){if("string"===typeof k)return b[k]?b[k](m):f(c(k,m).f);k.splice||(r=k,m.splice?(k=m,m=a,a=null):k=g);m=m||function(){};"function"===typeof a&&(a=e,e=q);e?d(g,k,m,a):setTimeout(function(){d(g,k,m,a)},4);return h};h.config=function(b){r=b;return h};define=function(b,c,d){c.splice||(d=c,c=[]);!u.call(k,b)&&!u.call(m,b)&&(m[b]=[b,c,d])};define.amd={jQuery:!0}})();define("almond",function(){});
+define("orion/PageUtil",[],function(){var g=/^http[s]?/i;return{hash:function(){var g=window.location.href.split("#")[1];return g?"#"+g:""},matchResourceParameters:function(g){var g=g||window.location.toString(),p={resource:""},a=g.indexOf("#");if(-1!==a&&(g=g.substring(a+1),0!==g.length)){g=g.split(",");p.resource=decodeURIComponent(g[0]);for(a=1;a<g.length;a++){var l=/([^=]*)(=?)(.*)/.exec(g[a]),f=decodeURIComponent(l[1]||""),l=decodeURIComponent(l[3]||"");""!==f&&"resource"!==f&&(p[f]=l)}}return p},
+validateURLScheme:function(n,p){var a=n;if(-1===n.indexOf("://")){var l=document.createElement("a");l.href=n;a=l.href}l=!1;if(l=p?p.some(function(l){return RegExp("^"+l+":","i").test(a)}):g.test(a))return n;console.log("Illegal URL Scheme: '"+n+"'");return""}}});
+(function(){function g(p,a,l){for(var f in a)a.hasOwnProperty(f)&&(!p.hasOwnProperty(f)||l)?p[f]=a[f]:"object"===typeof a[f]&&g(p[f],a[f],l)}var n=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(p){var a=p.config?p.config():{};return{version:"2.0.1+",load:function(l,f,e,d){d=d||{};d.locale&&(a.locale=d.locale);var h=n.exec(l),c=h[1],b=h[4],k=h[5],m=b.split("-"),r=[],x={},u,t="";h[5]?(c=h[1],l=c+k):(k=h[4],b=a.locale,b||(b=a.locale="undefined"===typeof navigator?"root":
+(navigator.language||navigator.userLanguage||"root").toLowerCase()),m=b.split("-"));if(d.isBuild){r.push(l);d=c+"root/"+k;require._fileExists(f.toUrl(d+".js"))&&r.push(d);for(u=0;u<m.length;u++)d=m[u],t+=(t?"-":"")+d,d=r,h=c+t+"/"+k,require._fileExists(f.toUrl(h+".js"))&&d.push(h);f(r,function(){e()})}else f([l],function(b){var d=[],h;h=c;var a=k;b.root&&(d.push("root"),(!0===b.root||1===b.root)&&r.push(h+"root/"+a));for(u=0;u<m.length;u++){h=m[u];h=t+=(t?"-":"")+h;var a=b,q=r,w=c,B=k;a[h]&&(d.push(h),
+(!0===a[h]||1===a[h])&&q.push(w+h+"/"+B))}f(r,function(){var q,w,B;for(q=d.length-1;-1<q&&d[q];q--){B=d[q];w=b[B];if(!0===w||1===w)w=f(c+B+"/"+k);g(x,w)}e(x)})})}}})})();define("orion/i18n",{load:function(g,n,p){n.specified&&n.specified("orion/bootstrap")?n(["orion/i18n!"+g],function(a){p(a)}):p({})}});
 define("orion/edit/nls/root/messages",{Editor:"Editor",switchEditor:"Switch Editor",Fetching:"Fetching: ${0}",confirmUnsavedChanges:"There are unsaved changes.  Do you still want to navigate away?",searchFiles:"Search Files",searchTerm:"Enter search term:",unsavedChanges:"There are unsaved changes.",Save:"Save",Saved:"Saved",Blame:"Blame",BlameTooltip:"Show blame annotations",saveOutOfSync:"Resource is out of sync with the server. Do you want to save it anyway?",loadOutOfSync:"Resource is out of sync with the server. Do you want to load it anyway? This will overwrite your local changes.",
 ReadingMetadata:"Reading metadata of ${0}",Reading:"Reading ${0}",readonly:"Read Only.",saveFile:"Save this file",gotoLine:"Go to Line",gotoLineTooltip:"Go to specified line number",gotoLinePrompt:"Go to line:",Undo:"Undo",Redo:"Redo",Find:"Find",noResponse:"No response from server.  Check your internet connection and try again.",savingFile:"Saving file ${0}",running:"Running ${0}","Saving...":"Saving...",View:"View",ViewTooltip:"View",Actions:"Actions",Navigator:"Navigator",FolderNavigator:"Folder Navigator",
 Project:"Project",New:"New",Add:"Add",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding.",LocalEditorSettings:"Local Editor Settings",NoProject:"${0} is not a project. To convert it to a project use ${1}.",NoProjects:"There are no projects in your workspace. Use ${0} to create projects.",disconnected:"(disconnected)",ChooseFS:"Choose Filesystem",ChooseFSTooltip:"Choose the filesystem you want to view.",FSTitle:"${0} (${1})",Deploy:"Deploy",ImportExport:"Import/Export",
-OpenWith:"Open with...",Extensions:"Extensions"});define("orion/edit/nls/messages",["orion/i18n!orion/edit/nls/messages","orion/edit/nls/root/messages"],function(g,n){var p={root:n};Object.keys(g).forEach(function(b){"undefined"===typeof p[b]&&(p[b]=g[b])});return p});
-(function(g,n){"function"===typeof define&&define.amd?define("orion/Deferred",n):"object"===typeof exports?module.exports=n():(g.orion=g.orion||{},g.orion.Deferred=n())})(this,function(){function g(){for(var b;b=l.shift();)b();f=!1}function n(b){l.push(b);f||(f=!0,setTimeout(g,0))}function p(b){return function(){b.apply(void 0,arguments)}}function b(){function e(){for(var c;c=m.shift();){var d=c.deferred,r="fulfilled"===k?"resolve":"reject";if("function"===typeof c[r])try{var h=(0,c[r])(a),b=h&&("object"===
-typeof h||"function"===typeof h)&&h.then;if("function"===typeof b)if(h===d.promise)d.reject(new TypeError);else{var e=h.cancel;"function"===typeof e?d._protected(l).parentCancel=e.bind(h):delete d._protected(l).parentCancel;b.call(h,p(d.resolve),p(d.reject),p(d.progress))}else d.resolve(h)}catch(q){d.reject(q)}else d[r](a)}}function d(c){delete w.parentCancel;k="rejected";a=c;m.length&&n(e)}function h(c){function l(q){return function(a){f||(f=!0,q(a))}}var f=!1;delete w.parentCancel;try{var s=c&&
-("object"===typeof c||"function"===typeof c)&&c.then;if("function"===typeof s)if(c===r)d(new TypeError);else{k="assumed";var u=c&&c.cancel;if("function"!==typeof u){var g=new b,c=g.promise;try{s(g.resolve,g.reject,g.progress)}catch(q){g.reject(q)}u=c.cancel;s=c.then}a=c;s.call(c,l(h),l(d));w.parentCancel=u.bind(c)}else k="fulfilled",a=c,m.length&&n(e)}catch(x){l(d)(x)}}function c(){var a=w.parentCancel;a?(delete w.parentCancel,a()):k||(a=Error("Cancel"),a.name="Cancel",d(a))}var a,k,m=[],r=this,w=
-{};Object.defineProperty(this,"_protected",{value:function(a){if(a!==l)throw Error("protected");return w}});this.resolve=function(a){k||h(a);return r};this.reject=function(a){k||d(a);return r};this.progress=function(a){k||m.forEach(function(c){if(c.progress)try{c.progress(a)}catch(d){}});return r.promise};this.cancel=function(){w.parentCancel?setTimeout(c,0):c();return r};this.then=function(a,c,d){a={resolve:a,reject:c,progress:d,deferred:new b};m.push(a);a.deferred._protected(l).parentCancel=r.promise.cancel.bind(r);
-("fulfilled"===k||"rejected"===k)&&n(e);return a.deferred.promise};this.promise={then:r.then,cancel:r.cancel}}var l=[],f=!1;b.all=function(e,d){function h(c,d){m||(k[c]=d,0===--a&&r.resolve(k))}function c(a,c){if(!m){if(d)try{h(a,d(c));return}catch(k){c=k}r.reject(c)}}var a=e.length,k=[],m=!1,r=new b;r.then(void 0,function(){m=!0;e.forEach(function(a){a.cancel&&a.cancel()})});0===a?r.resolve(k):e.forEach(function(a,d){a.then(h.bind(void 0,d),c.bind(void 0,d))});return r.promise};b.when=function(e,
-d,h,c){var a;e&&"function"===typeof e.then||(a=new b,a.resolve(e),e=a.promise);return e.then(d,h,c)};return b});
-define("orion/i18nUtil",["require","orion/Deferred"],function(g,n){var p={};return{getMessageBundle:function(b){function l(){g(["i18n!"+b],function(d){if(d){var c=b;d._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+c,JSON.stringify(d));delete d._expires}f.resolve(d)})}if(p[b])return p[b];var f=new n;p[b]=f;var e;a:{if(e=localStorage.getItem("orion/messageBundle/"+b))if(e=JSON.parse(e),e._expires&&e._expires>(new Date).getTime()){delete e._expires;break a}e=null}if(e)return f.resolve(e),
-f;try{g([b],l)}catch(d){g(["orion/i18n!"+b],l)}return f},formatMessage:function(b){var l=arguments;return b.replace(/\$\{([^\}]+)\}/g,function(b,e){return l[(e<<0)+1]})}}});
-define("orion/EventTarget",[],function(){function g(){this._namedListeners={}}g.prototype={dispatchEvent:function(g){if(!g.type)throw Error("unspecified type");var p=this._namedListeners[g.type];p&&p.forEach(function(b){try{"function"===typeof b?b(g):b.handleEvent(g)}catch(l){"undefined"!==typeof console&&console.log(l)}});return!g.defaultPrevented},addEventListener:function(g,p){if("function"===typeof p||p.handleEvent)this._namedListeners[g]=this._namedListeners[g]||[],this._namedListeners[g].push(p)},
-removeEventListener:function(g,p){var b=this._namedListeners[g];if(b)for(var l=0;l<b.length;l++)if(b[l]===p){1===b.length?delete this._namedListeners[g]:b.splice(l,1);break}}};g.prototype.constructor=g;g.attach=function(n){var p=new g;n.dispatchEvent=p.dispatchEvent.bind(p);n.addEventListener=p.addEventListener.bind(p);n.removeEventListener=p.removeEventListener.bind(p)};return g});
-define("orion/objects",[],function(){function g(g){for(var p=1;p<arguments.length;p++){var b=arguments[p],l;for(l in b)Object.prototype.hasOwnProperty.call(b,l)&&(g[l]=b[l])}return g}return{clone:function(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var p=Object.create(Object.getPrototypeOf(n));g(p,n);return p},mixin:g,toArray:function(g){return Array.isArray(g)?g:[g]}}});
-define("orion/inputManager","i18n!orion/edit/nls/messages orion/i18nUtil orion/Deferred orion/EventTarget orion/objects orion/PageUtil".split(" "),function(g,n,p,b,l,f){function e(c){this._document=c.document||document;this._timeout=c.timeout;for(var c="keypress keydown keyup mousemove mousedown mousemove".split(" "),a=function(){this._resetTimer()}.bind(this),d=0;d<c.length;d++)this._document.addEventListener(c[d],a,!0);b.attach(this)}function d(c,a){if(c){if(0===a.status)a={Severity:"Error",Message:g.noResponse};
-else{var d=a.responseText;if(d)try{a=JSON.parse(d)}catch(m){a={Severity:"Error",Message:d}}}c.setProgressResult(a)}else window.console.log(a)}function h(c){b.attach(this);this.serviceRegistry=c.serviceRegistry;this.fileClient=c.fileClient;this.progressService=c.progressService;this.contentTypeRegistry=c.contentTypeRegistry;this.selection=c.selection;this._input=this._title="";this.dispatcher=null;this._unsavedChanges=[]}e.prototype={_resetTimer:function(){var c=this._document.defaultView||this._document.parentWindow;
-this._timer&&(c.clearTimeout(this._timer),this._timer=null);-1!==this._timeout&&(this._timer=c.setTimeout(function(){this.onIdle({type:"Idle"});this._timer=null;this._resetTimer()}.bind(this),this._timeout))},onIdle:function(c){return this.dispatchEvent(c)},setTimeout:function(c){this._timeout=c;this._resetTimer()}};l.mixin(h.prototype,{_maybeLoadWorkspace:function(c){var a=this.fileClient;return c===a.fileServiceRootURL(c)?a.loadWorkspace(c).then(function(a){return a.Location}):(new p).resolve(c)},
-_read:function(c){var a=this.fileClient,d=Array.prototype.slice.call(arguments,1);return this._maybeLoadWorkspace(c).then(function(c){return a.read.apply(a,[c].concat(d))})},load:function(){var c=this.getInput();if(c){var a=this.fileClient,k=this._parsedLocation.resource,m=this.progressService,r=function(q,a,c){return!m?q:m.progress(q,n.formatMessage(a,c))},h=this.getEditor();if(this._fileMetadata)!this._saving&&(!this._fileMetadata.Directory&&!this._readonly)&&r(a.read(k,!0),g.ReadingMetadata,c).then(function(q){this._fileMetadata&&
-(this._fileMetadata.Location===q.Location&&this._fileMetadata.ETag!==q.ETag)&&(this._fileMetadata=q,(!h.isDirty()||window.confirm(g.loadOutOfSync))&&r(a.read(k),g.Reading,c).then(function(q){h.setInput(c,null,q);this._unsavedChanges=[]}.bind(this)))}.bind(this));else{var b=k;if(0===b.indexOf("/gitapi/commit/")){var e=b.indexOf("/file"),l=b.indexOf("?",e);-1===l&&(l=b.length);b=b.substring(e,l);this._readonly=!0}var f=window.setTimeout(function(){f=null;this.reportStatus(n.formatMessage(g.Fetching,
-c))}.bind(this),800),u=function(){this.reportStatus("");f&&window.clearTimeout(f)}.bind(this),z=function(q){u();var a=null;this.serviceRegistry&&(a=this.serviceRegistry.getService("orion.page.message"));d(a,q);this._setNoInput()}.bind(this);this._acceptPatch=null;r(this._read(b,!0),g.ReadingMetadata,b).then(function(q){q.Directory?r(a.fetchChildren(q.ChildrenLocation),g.Reading,c).then(function(a){u();q.Children=a;this._setInputContents(this._parsedLocation,c,a,q)}.bind(this),z):this._isText(q)?r(a.read(k,
-!1,!0),g.Reading,c).then(function(a){u();"string"!==typeof a&&(this._acceptPatch=a.acceptPatch,a=a.result);this._setInputContents(this._parsedLocation,c,a,q)}.bind(this),z):r(a._getService(k).readBlob(k),g.Reading,c).then(function(a){u();this._setInputContents(this._parsedLocation,c,a,q)}.bind(this),z)}.bind(this),z)}}},processParameters:function(c){var a=this.getEditor();a&&a.processParameters&&a.processParameters(c)},getEditor:function(){return this.editor},getInput:function(){return this._input},
-getTitle:function(){return this._title},getFileMetadata:function(){return this._fileMetadata},getReadOnly:function(){var c=this._fileMetadata;return this._readonly||!c||c.Attributes&&c.Attributes.ReadOnly},getContentType:function(){return this._contentType},onFocus:function(){this._autoSaveEnabled&&this._errorSaving?this.save():this._autoLoadEnabled&&this.load()},onChanging:function(c){if(this._getSaveDiffsEnabled()){var a=this._unsavedChanges.length,d=c.removedCharCount,m=c.start,r=c.start+d,b=0;
-0===c.addedCharCount?b=-1:0===d&&(b=1);if(0<a&&b===this.previousChangeType){a=this._unsavedChanges[a-1];if(0===d&&m===a.end+a.text.length){a.text+=c.text;return}if(0===c.addedCharCount&&r===a.start){a.start=m;return}}this.previousChangeType=b;this._unsavedChanges.push({start:m,end:r,text:c.text})}},reportStatus:function(c){this.statusReporter?this.statusReporter(c):this.editor&&this.editor.reportStatus(c)},save:function(){function c(a){r===x.getInput()&&(x.getFileMetadata().ETag=a.ETag,k.setInput(r,
-null,b,!0));x.reportStatus("");m&&q&&q.setProgressResult({Message:g.Saved,Severity:"Normal"});x.afterSave&&x.afterSave();x._saving=!1}function a(a){x.reportStatus("");d(q,a);x._saving=!1;x._errorSaving=!0}if(!this._saving){var k=this.getEditor();if(k&&k.isDirty()&&!this.getReadOnly()){var m=this._errorSaving;this._saving=!0;var r=this.getInput();this.reportStatus(g["Saving..."]);this.dispatchEvent({type:"Saving",inputManager:this});k.markClean();var b=k.getText(),h=b;if(this._getSaveDiffsEnabled()&&
-!this._errorSaving){for(var e=this._unsavedChanges,l=0,f=0;f<e.length;f++)l+=e[f].text.length;b.length>l&&(h={diff:e})}this._unsavedChanges=[];this._errorSaving=!1;var e={ETag:this.getFileMetadata().ETag},u=this._parsedLocation.resource,h=this.fileClient.write(u,h,e),z=this.progressService,q=null;this.serviceRegistry&&(q=this.serviceRegistry.getService("orion.page.message"));z&&(h=z.progress(h,n.formatMessage(g.savingFile,r)));var x=this;h.then(c,function(q){412===q.status?window.confirm(g.saveOutOfSync)?
-(q=x.fileClient.write(u,b),z&&(q=z.progress(q,n.formatMessage(g.savingFile,r))),q.then(c,a)):x._saving=!1:a(q)})}}},setAutoLoadEnabled:function(c){this._autoLoadEnabled=c},setAutoSaveTimeout:function(c){this._autoSaveEnabled=-1!==c;this._idle?this._idle.setTimeout(c):(this._idle=new e({document:document,timeout:c}),this._idle.addEventListener("Idle",function(){this._errorSaving||this.save()}.bind(this)))},setContentType:function(c){this._contentType=c},setInput:function(c){if(!this._ignoreInput&&
-(c||(c=f.hash()),"string"===typeof c)){var a=this.getEditor();c&&"#"!==c[0]&&(c="#"+c);var d=f.matchResourceParameters(c),m=this._parsedLocation||{};if(a&&a.isDirty()){var r=this._location;if(m.resource!==d.resource)if(this._autoSaveEnabled)this.save();else if(!window.confirm(g.confirmUnsavedChanges)){window.location.hash=r;return}}a=a&&m.editor!==d.editor;this._location=c;this._parsedLocation=d;this._ignoreInput=!0;this.selection&&this.selection.setSelections(c);this._ignoreInput=!1;(c=d.resource)?
-c===this._input?a?(this.reportStatus(""),this._setInputContents(d,c,null,this._fileMetadata,this._isText(this._fileMetadata))):this.processParameters(d):(this._input=c,this._readonly=!1,this._fileMetadata=null,this.load()):this._setNoInput(!0)}},setTitle:function(c){var a=c.lastIndexOf("/");-1!==a&&(c=c.substring(a+1));this._title=c},setSaveDiffsEnabled:function(c){this._saveDiffsEnabled=c},_getSaveDiffsEnabled:function(){return this._saveDiffsEnabled&&null!==this._acceptPatch&&-1!==this._acceptPatch.indexOf("application/json-patch")},
-_isText:function(c){c=this.contentTypeRegistry.getFileContentType(c);if(!c)return!0;var a=this.contentTypeRegistry.getContentType("text/plain");return this.contentTypeRegistry.isExtensionOf(c,a)},_setNoInput:function(c){c?this.fileClient.loadWorkspace("").then(function(a){this._input=a.ChildrenLocation;this._setInputContents(a.ChildrenLocation,null,a,a)}.bind(this)):(this._input=this._title=this._fileMetadata=null,this.setContentType(null),this.dispatchEvent({type:"InputChanged",input:null}))},_setInputContents:function(c,
-a,d,m,r){var b,h=!1;m?(this._fileMetadata=m,this.setTitle(m.Location||String(m)),this.setContentType(this.contentTypeRegistry.getFileContentType(m)),b=m.Name,h=m.Directory):(this._fileMetadata=null,this.setTitle(a),this.setContentType(this.contentTypeRegistry.getFilenameContentType(this.getTitle())),b=this.getTitle());var e=this.getEditor();this._focusListener&&(e&&(e.getTextView&&e.getTextView())&&e.getTextView().removeEventListener("Focus",this._focusListener),this._focusListener=null);this._changingListener&&
-(e&&(e.getModel&&e.getModel())&&e.getModel().removeEventListener("Changing",this._changingListener),this._changingListener=null);m={type:"InputChanged",input:c,name:b,title:a,contentType:this.getContentType(),metadata:m,location:window.location,contents:d};this.dispatchEvent(m);this.editor=e=m.editor;h||(e&&(e.getTextView&&e.getTextView())&&e.getTextView().addEventListener("Focus",this._focusListener=this.onFocus.bind(this)),e&&(e.getModel&&e.getModel())&&e.getModel().addEventListener("Changing",
-this._changingListener=this.onChanging.bind(this)),r||e.setInput(a,null,d),this._unsavedChanges=[],this.processParameters(c))}});return{InputManager:h}});
-define("orion/util",[],function(){var g=navigator.userAgent,n=-1!==g.indexOf("MSIE")||-1!==g.indexOf("Trident")?document.documentMode:void 0,p=parseFloat(g.split("Firefox/")[1]||g.split("Minefield/")[1])||void 0,b=-1!==g.indexOf("Opera")?parseFloat(g.split("Version/")[1]):void 0,l=parseFloat(g.split("Chrome/")[1])||void 0,f=-1!==g.indexOf("Safari")&&!l,e=parseFloat(g.split("WebKit/")[1])||void 0,d=-1!==g.indexOf("Android"),h=-1!==g.indexOf("iPad"),g=-1!==g.indexOf("iPhone"),c=h||g,a=-1!==navigator.platform.indexOf("Mac"),
-k=-1!==navigator.platform.indexOf("Win"),m=-1!==navigator.platform.indexOf("Linux");return{formatMessage:function(a){var c=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,d){return c[(d<<0)+1]})},createElement:function(a,c){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",c):a.createElement(c)},isIE:n,isFirefox:p,isOpera:b,isChrome:l,isSafari:f,isWebkit:e,isAndroid:d,isIPad:h,isIPhone:g,isIOS:c,isMac:a,isWindows:k,isLinux:m,platformDelimiter:k?"\r\n":"\n"}});
-define("orion/webui/littlelib",["orion/util"],function(g){function n(d,b){b||(b=document);return b.querySelectorAll(d)}function p(d){if(0<=d.tabIndex)return d;if(d.hasChildNodes())for(var b=0;b<d.childNodes.length;b++){var c=p(d.childNodes[b]);if(c)return c}return null}function b(d){if(0<=d.tabIndex)return d;if(d.hasChildNodes())for(var h=d.childNodes.length-1;0<=h;h--){var c=b(d.childNodes[h]);if(c)return c}return null}function l(d,b){if(3===d.nodeType){var c=f.exec(d.nodeValue);c&&1<c.length&&b(d,
-c)}if(d.hasChildNodes())for(c=0;c<d.childNodes.length;c++)l(d.childNodes[c],b)}var f=/\$\{([^\}]+)\}/,e=null;return{$:function(d,b){b||(b=document);return b.querySelector(d)},$$:n,$$array:function(d,b){return Array.prototype.slice.call(n(d,b))},node:function(d){var b=d;"string"===typeof d&&(b=document.getElementById(d));return b},contains:function(d,b){if(!d||!b)return!1;if(d===b)return!0;var c=d.compareDocumentPosition(b);return Boolean(c&16)},bounds:function(d){d=d.getBoundingClientRect();return{left:d.left+
-document.documentElement.scrollLeft,top:d.top+document.documentElement.scrollTop,width:d.width,height:d.height}},empty:function(d){for(;d.hasChildNodes();)d.removeChild(d.firstChild)},firstTabbable:p,lastTabbable:b,stop:function(d){window.document.all&&(d.keyCode=0);d.preventDefault&&(d.preventDefault(),d.stopPropagation())},processTextNodes:function(d,b){l(d,function(c,a){c.parentNode.replaceChild(document.createTextNode(b[a[1]]||a[1]),c)})},processDOMNodes:function(d,b){l(d,function(c,a){var d=
-b[a[1]];if(d){var m=document.createRange(),r=a.index;m.setStart(c,r);m.setEnd(c,r+a[0].length);m.deleteContents();m.insertNode(d)}})},addAutoDismiss:function(d,b){function c(a){e.forEach(function(c){var d=!1,b=c.excludeNodes.some(function(c){return document.body.contains(c)?(d=!0,c.contains(a.target)):!1});if(d&&!b)try{c.dismiss(a)}catch(h){"undefined"!==typeof console&&console&&console.error(h&&h.message)}});e=e.filter(function(a){return a.excludeNodes.some(function(a){return document.body.contains(a)})})}
-null===e&&(e=[],document.addEventListener("click",c,!0),g.isIOS&&document.addEventListener("touchend",function(a){function c(){a.target.removeEventListener("click",c)}0===a.touches.length&&a.target.addEventListener("click",c)},!1));e.push({excludeNodes:d,dismiss:b})},setFramesEnabled:function(d){for(var b=document.getElementsByTagName("iframe"),c=0;c<b.length;c++)b[c].parentNode.style.pointerEvents=d?"":"none"},removeAutoDismiss:function(d){e=e.filter(function(b){return d!==b.dismiss})},KEY:{BKSPC:8,
+OpenWith:"Open with...",Extensions:"Extensions"});define("orion/edit/nls/messages",["orion/i18n!orion/edit/nls/messages","orion/edit/nls/root/messages"],function(g,n){var p={root:n};Object.keys(g).forEach(function(a){"undefined"===typeof p[a]&&(p[a]=g[a])});return p});
+(function(g,n){"function"===typeof define&&define.amd?define("orion/Deferred",n):"object"===typeof exports?module.exports=n():(g.orion=g.orion||{},g.orion.Deferred=n())})(this,function(){function g(){for(var a;a=l.shift();)a();f=!1}function n(a){l.push(a);f||(f=!0,setTimeout(g,0))}function p(a){return function(){a.apply(void 0,arguments)}}function a(){function e(){for(var c;c=m.shift();){var d=c.deferred,r="fulfilled"===k?"resolve":"reject";if("function"===typeof c[r])try{var h=(0,c[r])(b),a=h&&("object"===
+typeof h||"function"===typeof h)&&h.then;if("function"===typeof a)if(h===d.promise)d.reject(new TypeError);else{var e=h.cancel;"function"===typeof e?d._protected(l).parentCancel=e.bind(h):delete d._protected(l).parentCancel;a.call(h,p(d.resolve),p(d.reject),p(d.progress))}else d.resolve(h)}catch(q){d.reject(q)}else d[r](b)}}function d(c){delete x.parentCancel;k="rejected";b=c;m.length&&n(e)}function h(c){function l(q){return function(b){f||(f=!0,q(b))}}var f=!1;delete x.parentCancel;try{var s=c&&
+("object"===typeof c||"function"===typeof c)&&c.then;if("function"===typeof s)if(c===r)d(new TypeError);else{k="assumed";var v=c&&c.cancel;if("function"!==typeof v){var z=new a,c=z.promise;try{s(z.resolve,z.reject,z.progress)}catch(q){z.reject(q)}v=c.cancel;s=c.then}b=c;s.call(c,l(h),l(d));x.parentCancel=v.bind(c)}else k="fulfilled",b=c,m.length&&n(e)}catch(w){l(d)(w)}}function c(){var b=x.parentCancel;b?(delete x.parentCancel,b()):k||(b=Error("Cancel"),b.name="Cancel",d(b))}var b,k,m=[],r=this,x=
+{};Object.defineProperty(this,"_protected",{value:function(b){if(b!==l)throw Error("protected");return x}});this.resolve=function(b){k||h(b);return r};this.reject=function(b){k||d(b);return r};this.progress=function(b){k||m.forEach(function(c){if(c.progress)try{c.progress(b)}catch(d){}});return r.promise};this.cancel=function(){x.parentCancel?setTimeout(c,0):c();return r};this.then=function(b,c,d){b={resolve:b,reject:c,progress:d,deferred:new a};m.push(b);b.deferred._protected(l).parentCancel=r.promise.cancel.bind(r);
+("fulfilled"===k||"rejected"===k)&&n(e);return b.deferred.promise};this.promise={then:r.then,cancel:r.cancel}}var l=[],f=!1;a.all=function(e,d){function h(c,d){m||(k[c]=d,0===--b&&r.resolve(k))}function c(b,c){if(!m){if(d)try{h(b,d(c));return}catch(k){c=k}r.reject(c)}}var b=e.length,k=[],m=!1,r=new a;r.then(void 0,function(){m=!0;e.forEach(function(b){b.cancel&&b.cancel()})});0===b?r.resolve(k):e.forEach(function(b,d){b.then(h.bind(void 0,d),c.bind(void 0,d))});return r.promise};a.when=function(e,
+d,h,c){var b;e&&"function"===typeof e.then||(b=new a,b.resolve(e),e=b.promise);return e.then(d,h,c)};return a});
+define("orion/i18nUtil",["require","orion/Deferred"],function(g,n){var p={};return{getMessageBundle:function(a){function l(){g(["i18n!"+a],function(d){if(d){var c=a;d._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+c,JSON.stringify(d));delete d._expires}f.resolve(d)})}if(p[a])return p[a];var f=new n;p[a]=f;var e;a:{if(e=localStorage.getItem("orion/messageBundle/"+a))if(e=JSON.parse(e),e._expires&&e._expires>(new Date).getTime()){delete e._expires;break a}e=null}if(e)return f.resolve(e),
+f;try{g([a],l)}catch(d){g(["orion/i18n!"+a],l)}return f},formatMessage:function(a){var l=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,e){return l[(e<<0)+1]})}}});
+define("orion/EventTarget",[],function(){function g(){this._namedListeners={}}g.prototype={dispatchEvent:function(g){if(!g.type)throw Error("unspecified type");var p=this._namedListeners[g.type];p&&p.forEach(function(a){try{"function"===typeof a?a(g):a.handleEvent(g)}catch(l){"undefined"!==typeof console&&console.log(l)}});return!g.defaultPrevented},addEventListener:function(g,p){if("function"===typeof p||p.handleEvent)this._namedListeners[g]=this._namedListeners[g]||[],this._namedListeners[g].push(p)},
+removeEventListener:function(g,p){var a=this._namedListeners[g];if(a)for(var l=0;l<a.length;l++)if(a[l]===p){1===a.length?delete this._namedListeners[g]:a.splice(l,1);break}}};g.prototype.constructor=g;g.attach=function(n){var p=new g;n.dispatchEvent=p.dispatchEvent.bind(p);n.addEventListener=p.addEventListener.bind(p);n.removeEventListener=p.removeEventListener.bind(p)};return g});
+define("orion/objects",[],function(){function g(g){for(var p=1;p<arguments.length;p++){var a=arguments[p],l;for(l in a)Object.prototype.hasOwnProperty.call(a,l)&&(g[l]=a[l])}return g}return{clone:function(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var p=Object.create(Object.getPrototypeOf(n));g(p,n);return p},mixin:g,toArray:function(g){return Array.isArray(g)?g:[g]}}});
+define("orion/inputManager","i18n!orion/edit/nls/messages orion/i18nUtil orion/Deferred orion/EventTarget orion/objects orion/PageUtil".split(" "),function(g,n,p,a,l,f){function e(c){this._document=c.document||document;this._timeout=c.timeout;for(var c="keypress keydown keyup mousemove mousedown mousemove".split(" "),b=function(){this._resetTimer()}.bind(this),d=0;d<c.length;d++)this._document.addEventListener(c[d],b,!0);a.attach(this)}function d(c,b){if(c){if(0===b.status)b={Severity:"Error",Message:g.noResponse};
+else{var d=b.responseText;if(d)try{b=JSON.parse(d)}catch(m){b={Severity:"Error",Message:d}}}c.setProgressResult(b)}else window.console.log(b)}function h(c){a.attach(this);this.serviceRegistry=c.serviceRegistry;this.fileClient=c.fileClient;this.progressService=c.progressService;this.contentTypeRegistry=c.contentTypeRegistry;this.selection=c.selection;this._input=this._title="";this.dispatcher=null;this._unsavedChanges=[]}e.prototype={_resetTimer:function(){var c=this._document.defaultView||this._document.parentWindow;
+this._timer&&(c.clearTimeout(this._timer),this._timer=null);-1!==this._timeout&&(this._timer=c.setTimeout(function(){this.onIdle({type:"Idle"});this._timer=null;this._resetTimer()}.bind(this),this._timeout))},onIdle:function(c){return this.dispatchEvent(c)},setTimeout:function(c){this._timeout=c;this._resetTimer()}};l.mixin(h.prototype,{_maybeLoadWorkspace:function(c){var b=this.fileClient;return c===b.fileServiceRootURL(c)?b.loadWorkspace(c).then(function(b){return b.Location}):(new p).resolve(c)},
+_read:function(c){var b=this.fileClient,d=Array.prototype.slice.call(arguments,1);return this._maybeLoadWorkspace(c).then(function(c){return b.read.apply(b,[c].concat(d))})},load:function(){var c=this.getInput();if(c){var b=this.fileClient,k=this._parsedLocation.resource,m=this.progressService,r=function(q,b,c){return!m?q:m.progress(q,n.formatMessage(b,c))},h=this.getEditor();if(this._fileMetadata)!this._saving&&(!this._fileMetadata.Directory&&!this._readonly)&&r(b.read(k,!0),g.ReadingMetadata,c).then(function(q){this._fileMetadata&&
+(this._fileMetadata.Location===q.Location&&this._fileMetadata.ETag!==q.ETag)&&(this._fileMetadata=q,(!h.isDirty()||window.confirm(g.loadOutOfSync))&&r(b.read(k),g.Reading,c).then(function(q){h.setInput(c,null,q);this._unsavedChanges=[]}.bind(this)))}.bind(this));else{var a=k;if(0===a.indexOf("/gitapi/commit/")){var e=a.indexOf("/file"),l=a.indexOf("?",e);-1===l&&(l=a.length);a=a.substring(e,l);this._readonly=!0}var f=window.setTimeout(function(){f=null;this.reportStatus(n.formatMessage(g.Fetching,
+c))}.bind(this),800),v=function(){this.reportStatus("");f&&window.clearTimeout(f)}.bind(this),z=function(q){v();var b=null;this.serviceRegistry&&(b=this.serviceRegistry.getService("orion.page.message"));d(b,q);this._setNoInput()}.bind(this);this._acceptPatch=null;r(this._read(a,!0),g.ReadingMetadata,a).then(function(q){q.Directory?r(b.fetchChildren(q.ChildrenLocation),g.Reading,c).then(function(b){v();q.Children=b;this._setInputContents(this._parsedLocation,c,b,q)}.bind(this),z):this._isText(q)?r(b.read(k,
+!1,!0),g.Reading,c).then(function(b){v();"string"!==typeof b&&(this._acceptPatch=b.acceptPatch,b=b.result);this._setInputContents(this._parsedLocation,c,b,q)}.bind(this),z):r(b._getService(k).readBlob(k),g.Reading,c).then(function(b){v();this._setInputContents(this._parsedLocation,c,b,q)}.bind(this),z)}.bind(this),z)}}},processParameters:function(c){var b=this.getEditor();b&&b.processParameters&&b.processParameters(c)},getEditor:function(){return this.editor},getInput:function(){return this._input},
+getTitle:function(){return this._title},getFileMetadata:function(){return this._fileMetadata},getReadOnly:function(){var c=this._fileMetadata;return this._readonly||!c||c.Attributes&&c.Attributes.ReadOnly},getContentType:function(){return this._contentType},onFocus:function(){this._autoSaveEnabled&&this._errorSaving?this.save():this._autoLoadEnabled&&this.load()},onChanging:function(c){if(this._getSaveDiffsEnabled()){var b=this._unsavedChanges.length,d=c.removedCharCount,m=c.start,r=c.start+d,a=0;
+0===c.addedCharCount?a=-1:0===d&&(a=1);if(0<b&&a===this.previousChangeType){b=this._unsavedChanges[b-1];if(0===d&&m===b.end+b.text.length){b.text+=c.text;return}if(0===c.addedCharCount&&r===b.start){b.start=m;return}}this.previousChangeType=a;this._unsavedChanges.push({start:m,end:r,text:c.text})}},reportStatus:function(c){this.statusReporter?this.statusReporter(c):this.editor&&this.editor.reportStatus(c)},save:function(){function c(b){r===w.getInput()&&(w.getFileMetadata().ETag=b.ETag,k.setInput(r,
+null,a,!0));w.reportStatus("");m&&q&&q.setProgressResult({Message:g.Saved,Severity:"Normal"});w.afterSave&&w.afterSave();w._saving=!1}function b(b){w.reportStatus("");d(q,b);w._saving=!1;w._errorSaving=!0}if(!this._saving){var k=this.getEditor();if(k&&k.isDirty()&&!this.getReadOnly()){var m=this._errorSaving;this._saving=!0;var r=this.getInput();this.reportStatus(g["Saving..."]);this.dispatchEvent({type:"Saving",inputManager:this});k.markClean();var a=k.getText(),h=a;if(this._getSaveDiffsEnabled()&&
+!this._errorSaving){for(var e=this._unsavedChanges,l=0,f=0;f<e.length;f++)l+=e[f].text.length;a.length>l&&(h={diff:e})}this._unsavedChanges=[];this._errorSaving=!1;var e={ETag:this.getFileMetadata().ETag},v=this._parsedLocation.resource,h=this.fileClient.write(v,h,e),z=this.progressService,q=null;this.serviceRegistry&&(q=this.serviceRegistry.getService("orion.page.message"));z&&(h=z.progress(h,n.formatMessage(g.savingFile,r)));var w=this;h.then(c,function(q){412===q.status?window.confirm(g.saveOutOfSync)?
+(q=w.fileClient.write(v,a),z&&(q=z.progress(q,n.formatMessage(g.savingFile,r))),q.then(c,b)):w._saving=!1:b(q)})}}},setAutoLoadEnabled:function(c){this._autoLoadEnabled=c},setAutoSaveTimeout:function(c){this._autoSaveEnabled=-1!==c;this._idle?this._idle.setTimeout(c):(this._idle=new e({document:document,timeout:c}),this._idle.addEventListener("Idle",function(){this._errorSaving||this.save()}.bind(this)))},setContentType:function(c){this._contentType=c},setInput:function(c){if(!this._ignoreInput&&
+(c||(c=f.hash()),"string"===typeof c)){var b=this.getEditor();c&&"#"!==c[0]&&(c="#"+c);var d=f.matchResourceParameters(c),m=this._parsedLocation||{};if(b&&b.isDirty()){var r=this._location;if(m.resource!==d.resource)if(this._autoSaveEnabled)this.save();else if(!window.confirm(g.confirmUnsavedChanges)){window.location.hash=r;return}}b=b&&m.editor!==d.editor;this._location=c;this._parsedLocation=d;this._ignoreInput=!0;this.selection&&this.selection.setSelections(c);this._ignoreInput=!1;(c=d.resource)?
+c===this._input?b?(this.reportStatus(""),this._setInputContents(d,c,null,this._fileMetadata,this._isText(this._fileMetadata))):this.processParameters(d):(this._input=c,this._readonly=!1,this._fileMetadata=null,this.load()):this._setNoInput(!0)}},setTitle:function(c){var b=c.lastIndexOf("/");-1!==b&&(c=c.substring(b+1));this._title=c},setSaveDiffsEnabled:function(c){this._saveDiffsEnabled=c},_getSaveDiffsEnabled:function(){return this._saveDiffsEnabled&&null!==this._acceptPatch&&-1!==this._acceptPatch.indexOf("application/json-patch")},
+_isText:function(c){c=this.contentTypeRegistry.getFileContentType(c);if(!c)return!0;var b=this.contentTypeRegistry.getContentType("text/plain");return this.contentTypeRegistry.isExtensionOf(c,b)},_setNoInput:function(c){c?this.fileClient.loadWorkspace("").then(function(b){this._input=b.ChildrenLocation;this._setInputContents(b.ChildrenLocation,null,b,b)}.bind(this)):(this._input=this._title=this._fileMetadata=null,this.setContentType(null),this.dispatchEvent({type:"InputChanged",input:null}))},_setInputContents:function(c,
+b,d,m,r){var a,h=!1;m?(this._fileMetadata=m,this.setTitle(m.Location||String(m)),this.setContentType(this.contentTypeRegistry.getFileContentType(m)),a=m.Name,h=m.Directory):(this._fileMetadata=null,this.setTitle(b),this.setContentType(this.contentTypeRegistry.getFilenameContentType(this.getTitle())),a=this.getTitle());var e=this.getEditor();this._focusListener&&(e&&(e.getTextView&&e.getTextView())&&e.getTextView().removeEventListener("Focus",this._focusListener),this._focusListener=null);this._changingListener&&
+(e&&(e.getModel&&e.getModel())&&e.getModel().removeEventListener("Changing",this._changingListener),this._changingListener=null);m={type:"InputChanged",input:c,name:a,title:b,contentType:this.getContentType(),metadata:m,location:window.location,contents:d};this.dispatchEvent(m);this.editor=e=m.editor;h||(e&&(e.getTextView&&e.getTextView())&&e.getTextView().addEventListener("Focus",this._focusListener=this.onFocus.bind(this)),e&&(e.getModel&&e.getModel())&&e.getModel().addEventListener("Changing",
+this._changingListener=this.onChanging.bind(this)),r||e.setInput(b,null,d),this._unsavedChanges=[],this.processParameters(c))}});return{InputManager:h}});
+define("orion/util",[],function(){var g=navigator.userAgent,n=-1!==g.indexOf("MSIE")||-1!==g.indexOf("Trident")?document.documentMode:void 0,p=parseFloat(g.split("Firefox/")[1]||g.split("Minefield/")[1])||void 0,a=-1!==g.indexOf("Opera")?parseFloat(g.split("Version/")[1]):void 0,l=parseFloat(g.split("Chrome/")[1])||void 0,f=-1!==g.indexOf("Safari")&&!l,e=parseFloat(g.split("WebKit/")[1])||void 0,d=-1!==g.indexOf("Android"),h=-1!==g.indexOf("iPad"),g=-1!==g.indexOf("iPhone"),c=h||g,b=-1!==navigator.platform.indexOf("Mac"),
+k=-1!==navigator.platform.indexOf("Win"),m=-1!==navigator.platform.indexOf("Linux");return{formatMessage:function(b){var c=arguments;return b.replace(/\$\{([^\}]+)\}/g,function(b,d){return c[(d<<0)+1]})},createElement:function(b,c){return b.createElementNS?b.createElementNS("http://www.w3.org/1999/xhtml",c):b.createElement(c)},isIE:n,isFirefox:p,isOpera:a,isChrome:l,isSafari:f,isWebkit:e,isAndroid:d,isIPad:h,isIPhone:g,isIOS:c,isMac:b,isWindows:k,isLinux:m,platformDelimiter:k?"\r\n":"\n"}});
+define("orion/webui/littlelib",["orion/util"],function(g){function n(d,a){a||(a=document);return a.querySelectorAll(d)}function p(d){if(0<=d.tabIndex)return d;if(d.hasChildNodes())for(var a=0;a<d.childNodes.length;a++){var c=p(d.childNodes[a]);if(c)return c}return null}function a(d){if(0<=d.tabIndex)return d;if(d.hasChildNodes())for(var h=d.childNodes.length-1;0<=h;h--){var c=a(d.childNodes[h]);if(c)return c}return null}function l(d,a){if(3===d.nodeType){var c=f.exec(d.nodeValue);c&&1<c.length&&a(d,
+c)}if(d.hasChildNodes())for(c=0;c<d.childNodes.length;c++)l(d.childNodes[c],a)}var f=/\$\{([^\}]+)\}/,e=null;return{$:function(d,a){a||(a=document);return a.querySelector(d)},$$:n,$$array:function(d,a){return Array.prototype.slice.call(n(d,a))},node:function(d){var a=d;"string"===typeof d&&(a=document.getElementById(d));return a},contains:function(d,a){if(!d||!a)return!1;if(d===a)return!0;var c=d.compareDocumentPosition(a);return Boolean(c&16)},bounds:function(d){d=d.getBoundingClientRect();return{left:d.left+
+document.documentElement.scrollLeft,top:d.top+document.documentElement.scrollTop,width:d.width,height:d.height}},empty:function(d){for(;d.hasChildNodes();)d.removeChild(d.firstChild)},firstTabbable:p,lastTabbable:a,stop:function(d){window.document.all&&(d.keyCode=0);d.preventDefault&&(d.preventDefault(),d.stopPropagation())},processTextNodes:function(d,a){l(d,function(c,b){c.parentNode.replaceChild(document.createTextNode(a[b[1]]||b[1]),c)})},processDOMNodes:function(d,a){l(d,function(c,b){var d=
+a[b[1]];if(d){var m=document.createRange(),r=b.index;m.setStart(c,r);m.setEnd(c,r+b[0].length);m.deleteContents();m.insertNode(d)}})},addAutoDismiss:function(d,a){function c(b){e.forEach(function(c){var d=!1,a=c.excludeNodes.some(function(c){return document.body.contains(c)?(d=!0,c.contains(b.target)):!1});if(d&&!a)try{c.dismiss(b)}catch(h){"undefined"!==typeof console&&console&&console.error(h&&h.message)}});e=e.filter(function(b){return b.excludeNodes.some(function(b){return document.body.contains(b)})})}
+null===e&&(e=[],document.addEventListener("click",c,!0),g.isIOS&&document.addEventListener("touchend",function(b){function c(){b.target.removeEventListener("click",c)}0===b.touches.length&&b.target.addEventListener("click",c)},!1));e.push({excludeNodes:d,dismiss:a})},setFramesEnabled:function(d){for(var a=document.getElementsByTagName("iframe"),c=0;c<a.length;c++)a[c].parentNode.style.pointerEvents=d?"":"none"},removeAutoDismiss:function(d){e=e.filter(function(a){return d!==a.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/breadcrumbs",["require","orion/webui/littlelib"],function(g,n){function p(b){this._init(b)}p.prototype={_init:function(b){var l=n.node(b.container);if(!l)throw"no parent container";this._container=l;l.classList.remove("currentLocation");this._id=b.id||"eclipse.breadcrumbs";this._resource=b.resource||null;this._rootSegmentName=b.rootSegmentName;this._workspaceRootSegmentName=b.workspaceRootSegmentName;this._workspaceRootURL=b.workspaceRootURL;this._makeHref=b.makeHref;this._makeFinalHref=
-b.makeFinalHref;this._maxLength=b.maxLength;this.path="";this.measure();this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var b;if(this._resource&&this._resource.Parents){b=document.createElement("a");var l=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(b,l):b.href=g.toUrl("edit/edit.html")+"#"+l}else b=document.createElement("span");n.empty(b);b.appendChild(document.createTextNode(this._workspaceRootSegmentName));return b}return null},
-MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],buildSegment:function(b){var l=document.createElement("a");l.classList.add("breadcrumb");l.appendChild(document.createTextNode(b));return l},addSegmentHref:function(b,l){this._makeHref?this._makeHref(b,l.Location,l):b.href=g.toUrl("edit/edit.html")+"#"+l.ChildrenLocation},buildSegments:function(b,l){if(this._resource.Parents){var f=this._resource.Parents.slice(0),e,d;f&&(f=f.slice(0),"reverse"===l&&(f=f.reverse().slice(0)),f.forEach(function(h){h.skip||
-(b?(d=b,b=null):d=h.Name,e=this.buildSegment(d),this.path+=h.Name,this.addSegmentHref(e,h),e.include=!1,this.segments.push(e))}.bind(this)))}},addDivider:function(){var b=document.createElement("span");b.appendChild(document.createTextNode(" / "));this.path+="/";b.classList.add("breadcrumbSeparator");this.append(b)},refresh:function(){(this.crumbs=n.node(this._id))?n.empty(this.crumbs):(this.crumbs=document.createElement("span"),this.crumbs.id=this._id,this._container.appendChild(this.crumbs),this.dirty=
-document.createElement("span"),this.dirty.id="dirty",this.dirty.className="modifiedFileMarker",this._container.appendChild(this.dirty));this.crumbs.style.width="auto";this.crumbs.style.visibility="visible";this.crumbs.parentNode.className="currentLocation";this.crumbs.parentNode.style.width="auto"},append:function(b){this.crumbs.appendChild(b)},addTitle:function(b,l){var f=l||document.title;0===this.crumbs.childNodes.length&&(b=document.createElement("span"),b.appendChild(document.createTextNode(f)),
-b.classList.add("breadcrumb"),b.classList.add("currentLocation"),this.append(b))},finalSegment:function(b,l){if(!this._resource.skip){var f;f=l?l:this._resource.Name;this._makeFinalHref?(b=this.buildSegment(f),this.addSegmentHref(b,this._resource)):(b=document.createElement("span"),b.appendChild(document.createTextNode(f)));b.classList.add("currentLocation");this.path+=this._resource.Name;this.append(b)}},firstSegment:function(b){b&&(this.append(b),this._resource&&this._resource.Parents&&!this._resource.skip?
-(b.classList.add("breadcrumb"),this.addDivider()):(this._resource.skip||(b.href=""),b.classList.add("currentLocation")))},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(b){!0===b.include&&(this.append(b),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var b=this.segments.slice(0).reverse();b.forEach(function(b){this.append(b);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?b.include=
-!0:this.INCLUDE_FIRST_SECTION=!1}.bind(this));this.segments=b.reverse()}},measure:function(){var b=this._container;b.style.width="auto";this.MAX_LENGTH=this._maxLength?this._maxLength:b.offsetWidth;this.refresh();this.segments=[];this.crumbs.style.visibility="hidden";var b=this.getNavigatorWorkspaceRootSegment(),l=this._rootSegmentName;l?this.addTitle(b,l):(this.finalSegment(b,l),this._resource&&this._resource.Parents&&(this.buildSegments(l,"reverse"),this.measureSegments(),this.firstSegment(b)),
-this.crumbs.offsetWidth>=this.MAX_LENGTH&&(this.INCLUDE_FIRST_SECTION=!1))},render:function(){this.refresh();var b=this.getNavigatorWorkspaceRootSegment(),l=this._rootSegmentName;l?this.addTitle(b,l):(!0===this.INCLUDE_FIRST_SECTION&&this.firstSegment(b),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(b,l)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};p.prototype.constructor=p;return{BreadCrumbs:p}});
+define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(g,n){function p(a){this._init(a)}p.prototype={_init:function(a){var l=n.node(a.container);if(!l)throw"no parent container";this._container=l;l.classList.remove("currentLocation");this._id=a.id||"eclipse.breadcrumbs";this._resource=a.resource||null;this._rootSegmentName=a.rootSegmentName;this._workspaceRootSegmentName=a.workspaceRootSegmentName;this._workspaceRootURL=a.workspaceRootURL;this._makeHref=a.makeHref;this._makeFinalHref=
+a.makeFinalHref;this._maxLength=a.maxLength;this.path="";this.measure();this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var a;if(this._resource&&this._resource.Parents&&!this._resource.skip){a=document.createElement("a");var l=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(a,l):a.href=g.toUrl("edit/edit.html")+"#"+l}else a=document.createElement("span");n.empty(a);a.appendChild(document.createTextNode(this._workspaceRootSegmentName));
+return a}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],buildSegment:function(a){var l=document.createElement("a");l.classList.add("breadcrumb");l.appendChild(document.createTextNode(a));return l},addSegmentHref:function(a,l){this._makeHref?this._makeHref(a,l.Location,l):a.href=g.toUrl("edit/edit.html")+"#"+l.ChildrenLocation},buildSegments:function(a,l){if(this._resource.Parents){var f=this._resource.Parents.slice(0),e,d;f&&(f=f.slice(0),"reverse"===l&&(f=f.reverse().slice(0)),
+f.forEach(function(h){h.skip||(a?(d=a,a=null):d=h.Name,e=this.buildSegment(d),this.path+=h.Name,this.addSegmentHref(e,h),e.include=!1,this.segments.push(e))}.bind(this)))}},addDivider:function(){var a=document.createElement("span");a.appendChild(document.createTextNode(" / "));this.path+="/";a.classList.add("breadcrumbSeparator");this.append(a)},refresh:function(){(this.crumbs=n.node(this._id))?n.empty(this.crumbs):(this.crumbs=document.createElement("span"),this.crumbs.id=this._id,this._container.appendChild(this.crumbs),
+this.dirty=document.createElement("span"),this.dirty.id="dirty",this.dirty.className="modifiedFileMarker",this._container.appendChild(this.dirty));this.crumbs.style.width="auto";this.crumbs.style.visibility="visible";this.crumbs.parentNode.className="currentLocation";this.crumbs.parentNode.style.width="auto"},append:function(a){this.crumbs.appendChild(a)},addTitle:function(a,l){var f=l||document.title;0===this.crumbs.childNodes.length&&(a=document.createElement("span"),a.appendChild(document.createTextNode(f)),
+a.classList.add("breadcrumb"),a.classList.add("currentLocation"),this.append(a))},finalSegment:function(a,l){if(!this._resource.skip){var f;f=l?l:this._resource.Name;this._makeFinalHref?(a=this.buildSegment(f),this.addSegmentHref(a,this._resource)):(a=document.createElement("span"),a.appendChild(document.createTextNode(f)));a.classList.add("currentLocation");this.path+=this._resource.Name;this.append(a)}},firstSegment:function(a){a&&(this.append(a),this._resource&&this._resource.Parents&&!this._resource.skip?
+(a.classList.add("breadcrumb"),this.addDivider()):(this._resource.skip||(a.href=""),a.classList.add("currentLocation")))},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(a){!0===a.include&&(this.append(a),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var a=this.segments.slice(0).reverse();a.forEach(function(a){this.append(a);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?a.include=
+!0:this.INCLUDE_FIRST_SECTION=!1}.bind(this));this.segments=a.reverse()}},measure:function(){var a=this._container;a.style.width="auto";this.MAX_LENGTH=this._maxLength?this._maxLength:a.offsetWidth;this.refresh();this.segments=[];this.crumbs.style.visibility="hidden";var a=this.getNavigatorWorkspaceRootSegment(),l=this._rootSegmentName;l?this.addTitle(a,l):(this.finalSegment(a,l),this._resource&&this._resource.Parents&&(this.buildSegments(l,"reverse"),this.measureSegments(),this.firstSegment(a)),
+this.crumbs.offsetWidth>=this.MAX_LENGTH&&(this.INCLUDE_FIRST_SECTION=!1))},render:function(){this.refresh();var a=this.getNavigatorWorkspaceRootSegment(),l=this._rootSegmentName;l?this.addTitle(a,l):(!0===this.INCLUDE_FIRST_SECTION&&this.firstSegment(a),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(a,l)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};p.prototype.constructor=p;return{BreadCrumbs:p}});
 define("orion/navigate/nls/root/messages",{"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.":"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.","Toggle Left Pane":"Toggle Left Pane","Open or close the left pane":"Open or close the left pane",Navigator:"Navigator","Strings Xtrnalizr":"Strings Xtrnalizr","Externalize Strings from JavaScript files in this folder":"Externalize Strings from JavaScript files in this folder",
 "Choose a Folder":"Choose a Folder","Copy of ${0}":"Copy of ${0}","Enter a new name for '${0}'":"Enter a new name for '${0}'","Choose folder...":"Choose folder...",Rename:"Rename","Rename the selected files or folders":"Rename the selected files or folders","Compare with each other":"Compare with each other","Compare the selected 2 files with each other":"Compare the selected 2 files with each other","Compare with...":"Compare with...","Compare the selected folder with a specified folder":"Compare the selected folder with a specified folder",
 Delete:"Delete","Unknown item":"Unknown item","Are you sure you want to delete these ${0} items?":"Are you sure you want to delete these ${0} items?","Are you sure you want to delete '${0}'?":"Are you sure you want to delete '${0}'?","Export as zip":"Export as zip","Create a zip file of the folder contents and download it":"Create a zip file of the folder contents and download it","New File":"New File","Create a new file":"Create a new file","Name:":"Name:","New Folder":"New Folder","Folder name:":"Folder name:",
@@ -771,7 +771,7 @@
 "Import local file...":"Import local file...","Copy files and folders from your local file system":"Copy files and folders from your local file system","SFTP from...":"SFTP from...","Copy files and folders from a specified SFTP connection":"Copy files and folders from a specified SFTP connection","Importing from ${0}":"Importing from ${0}","SFTP to...":"SFTP to...","Copy files and folders to a specified SFTP location":"Copy files and folders to a specified SFTP location",Exporting:"Exporting to ${0}",
 "Pasting ${0}":"Pasting ${0}","Copy to":"Copy to","Move to":"Move to","Copying ${0}":"Copying ${0}","Moving ${0}":"Moving ${0}","Renaming ${0}":"Renaming ${0}","Deleting ${0}":"Deleting ${0}","Creating ${0}":"Creating ${0}","Linking to ${0}":"Linking to ${0}","Move files and folders to a new location":"Move files and folders to a new location",Cut:"Cut",Copy:"Copy","Fetching children of ":"Fetching children of ",Paste:"Paste","Cannot paste into the Workspace root":"Cannot paste into the Workspace root",
 "Open With":"Open With","Loading ":"Loading ",New:"New",Actions:"Actions","Orion Content":"Orion Content"," is not supported in this file system":" is not supported in this file system","Create new content":"Create new content","Import from HTTP...":"Import from HTTP...","File URL:":"File URL:","Copy a file from a URL and optionally unzip it":"Copy a file from a URL and optionally unzip it","Unzip *.zip files:":"Unzip *.zip files:","Extracted from:":"Extracted from:","Did not drop ${0}.  Folder drop is not supported in this browser.":"Did not drop ${0}.  Folder drop is not supported in this browser.",
-"You cannot copy files directly into the workspace.  Create a folder first.":"You cannot copy files directly into the workspace.  Create a folder first.","Unzip ${0}?":"Unzip ${0}?",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding."});define("orion/navigate/nls/messages",["orion/i18n!orion/navigate/nls/messages","orion/navigate/nls/root/messages"],function(g,n){var p={root:n};Object.keys(g).forEach(function(b){"undefined"===typeof p[b]&&(p[b]=g[b])});return p});
+"You cannot copy files directly into the workspace.  Create a folder first.":"You cannot copy files directly into the workspace.  Create a folder first.","Unzip ${0}?":"Unzip ${0}?",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding."});define("orion/navigate/nls/messages",["orion/i18n!orion/navigate/nls/messages","orion/navigate/nls/root/messages"],function(g,n){var p={root:n};Object.keys(g).forEach(function(a){"undefined"===typeof p[a]&&(p[a]=g[a])});return p});
 define("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Shell:"Shell","Get Plugins":"Get Plugins",Global:"Global",Editor:"Editor","Filter bindings":"Filter bindings","Orion Editor":"Orion Editor","Orion Image Viewer":"Orion Image Viewer","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.":"@buildLabel@",
@@ -779,207 +779,210 @@
 "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","Saved searches":"Saved searches","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 (* = any string, ? = 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"});
-define("orion/nls/messages",["orion/i18n!orion/nls/messages","orion/nls/root/messages"],function(g,n){var p={root:n};Object.keys(g).forEach(function(b){"undefined"===typeof p[b]&&(p[b]=g[b])});return p});
-(function(){function g(q){if("string"!==typeof q)throw new TypeError;}function n(q){return q?q.split("&"):[]}function p(q){return 0===q.length?"":q.join("&")}function b(q){var a=/([^=]*)(?:=?)(.*)/.exec(q),q=a[1]?decodeURIComponent(a[1]):"",a=a[2]?decodeURIComponent(a[2]):"";return[q,a]}function l(q){var a=encodeURIComponent(q[0]);q[1]&&(a+="="+encodeURIComponent(q[1]));return a}function f(q,a){var x="",c=[],d=0;return{next:function(){x!==q.query&&(x=q.query,c=n(x));if(d<c.length){var k=b(c[d++]);
-switch(a){case "keys":return k[0];case "values":return k[1];case "keys+values":return[k[0],k[1]];default:throw new TypeError;}}throw A;}}}function e(q){Object.defineProperty(this,"_url",{get:function(){return q._url}})}function d(q){return q?/[1-9]\d*$/.exec(q)[0]:""}function h(q){var a=[];q.split("/").forEach(function(q){".."===q?a.pop():"."!==q&&a.push(q)});return a.join("/")}function c(q,a){if("string"!==typeof q)throw new TypeError;var q=q.replace(/\s/g,function(q){return"%"+q.charCodeAt(0).toString(16)}),
-x=r.exec(q);if(!x)return null;var c={};c.scheme=x[1]||"";if(c.scheme&&!v.test(c.scheme))return null;var k=x[2];if(k&&(k=w.exec(k),c.userinfo=k[1],c.host=k[2],c.port=k[3],c.port&&!t.test(c.port)))return null;c.path=x[3];c.query=x[4];c.fragment=x[5];!c.scheme&&a&&(c.scheme=a.scheme,!c.host&&a.host&&(c.userinfo=a.userinfo,c.host=a.host,c.port=a.port,c.pathRelative=!0));c.pathRelative&&(c.path?"/"!==c.path[0]&&(x=/^(.*\/)[^\/]*$/.exec(a.path)[1]||"/",c.path=x+c.path):c.path=a.path);c.scheme&&(c.scheme=
-c.scheme.toLowerCase());c.port&&(c.port=d(c.port));c.host&&c.path&&(c.path=h(c.path));return c}function a(q,a){var x;if(a){a=a.href||a;x=c(a);if(!x||!x.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:x})}x=c(q,x);if(!x)throw new SyntaxError;Object.defineProperty(this,"_input",{value:q,writable:!0});Object.defineProperty(this,"_url",{value:x,writable:!0});var d=new e(this);Object.defineProperty(this,"query",{get:function(){return this._url?d:null},enumerable:!0})}try{var k;
-if("function"===typeof window.URL&&0!==window.URL.length&&"http:"===(k=new window.URL("http://www.w3.org?q")).protocol&&k.query)return}catch(m){}var r=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,w=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,v=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,t=/^\d*$/,y=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,s=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,u=/^([^?#\s]*)$/,z=/^([^\s]*)$/,q=/^\S*$/,x=/([^:]*):?(.*)/,A="undefined"!==typeof StopIteration?StopIteration:
-Error("Stop Iteration"),B={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(e.prototype,{get:{value:function(q){g(q);var a;n(this._url.query).some(function(c){c=b(c);if(c[0]===q)return a=c[1],!0});return a},enumerable:!0},set:{value:function(q,a){g(q);g(a);var c=n(this._url.query);c.some(function(x,d){var k=b(x);if(k[0]===q)return k[1]=a,c[d]=l(k),!0})||c.push(l([q,a]));this._url.query=p(c)},enumerable:!0},has:{value:function(q){g(q);return n(this._url.query).some(function(a){if(b(a)[0]===
-q)return!0})},enumerable:!0},"delete":{value:function(q){g(q);var a=n(this._url.query),c=a.filter(function(a){return b(a)[0]!==q});return c.length!==a.length?(this._url.query=p(c),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(q,a){if("function"!==typeof q)throw new TypeError;var c=f(this._url,"keys+values");try{for(;;){var x=c.next();q.call(a,x[1],x[0],this)}}catch(d){if(d!==A)throw d;}},enumerable:!0},keys:{value:function(){return f(this._url,
-"keys")},enumerable:!0},values:{value:function(){return f(this._url,"values")},enumerable:!0},items:{value:function(){return f(this._url,"keys+values")}},size:{get:function(){return n(this._url.query).length},enumerable:!0},getAll:{value:function(q){g(q);var a=[];n(this._url.query).forEach(function(c){c=b(c);c[0]===q&&a.push(c[1])});return a},enumerable:!0},append:{value:function(q,a){g(q);g(a);var c=n(this._url.query);c.push(l([q,a]));this._url.query=p(c)},enumerable:!0}});Object.defineProperties(a.prototype,
-{href:{get:function(){var q;if(this._url){q=this._url;var a=q.scheme?q.scheme+":":"";q.host&&(a+="//",q.userinfo&&(a+=q.userinfo+"@"),a+=q.host,q.port&&(a+=":"+q.port));a+=q.path;q.query&&(a+="?"+q.query);q.fragment&&(a+="#"+q.fragment);q=a}else q=this._input;return q},set:function(q){g(q);this._input=q;this._url=c(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(q){g(q);if(this._url&&(q=":"===q.slice(-1)?q.substring(0,q.length-1):q,""===q||v.test(q)))this._url.scheme=q.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(q){g(q);this._url&&(this._url.userinfo=q)}},username:{get:function(){if(!this._url)return"";var q=x.exec(this._userinfo);return decodeURIComponent(q[1]||"")},set:function(q){g(q);if(this._url){var a=x.exec(this._userinfo),q=[encodeURIComponent(q||
-"")];a[2]&&q.push(a[2]);this._userinfo=q.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var q=x.exec(this._userinfo);return decodeURIComponent(q[2]||"")},set:function(q){g(q);if(this._url){var a=[x.exec(this._userinfo)[1]||""];q&&a.push(encodeURIComponent(q));this._userinfo=a.join(":")}},enumerable:!0},host:{get:function(){var q="";this._url&&this._url.host&&(q+=this._url.host,this._url.port&&(q+=":"+this._url.port));return q},set:function(q){g(q);if(this._url&&(q=s.exec(q)))this._url.host=
-q[1],this._url.port=d(q[2])},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(q){g(q);this._url&&y.exec(q)&&(this._url.host=q)},enumerable:!0},port:{get:function(){var q=this._url?this._url.port||"":"";q&&q===B[this.protocol]&&(q="");return q},set:function(q){g(q);this._url&&t.exec(q)&&(this._url.port=d(q))},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(q){g(q);this._url&&u.exec(q)&&(this._url.host&&(q&&"/"!==q[0])&&
-(q="/"+q),this._url.path=q?h(q):"")},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(q){g(q);this._url&&(q&&"?"===q[0]&&(q=q.substring(1)),z.exec(q)&&(this._url.query=q))},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(a){g(a);this._url&&(a&&"#"===a[0]&&(a=a.substring(1)),q.exec(a)&&(this._url.fragment=a))},enumerable:!0}});if((k=window.URL||window.webkitURL)&&k.createObjectURL)Object.defineProperty(a,
-"createObjectURL",{value:k.createObjectURL.bind(k),enumerable:!1}),Object.defineProperty(a,"revokeObjectURL",{value:k.revokeObjectURL.bind(k),enumerable:!1});window.URL=a})();define("orion/URL-shim",function(){});
+define("orion/nls/messages",["orion/i18n!orion/nls/messages","orion/nls/root/messages"],function(g,n){var p={root:n};Object.keys(g).forEach(function(a){"undefined"===typeof p[a]&&(p[a]=g[a])});return p});
+(function(){function g(q){if("string"!==typeof q)throw new TypeError;}function n(q){return q?q.split("&"):[]}function p(q){return 0===q.length?"":q.join("&")}function a(q){var b=/([^=]*)(?:=?)(.*)/.exec(q),q=b[1]?decodeURIComponent(b[1]):"",b=b[2]?decodeURIComponent(b[2]):"";return[q,b]}function l(q){var b=encodeURIComponent(q[0]);q[1]&&(b+="="+encodeURIComponent(q[1]));return b}function f(q,b){var c="",w=[],d=0;return{next:function(){c!==q.query&&(c=q.query,w=n(c));if(d<w.length){var k=a(w[d++]);
+switch(b){case "keys":return k[0];case "values":return k[1];case "keys+values":return[k[0],k[1]];default:throw new TypeError;}}throw B;}}}function e(q){Object.defineProperty(this,"_url",{get:function(){return q._url}})}function d(q){return q?/[1-9]\d*$/.exec(q)[0]:""}function h(q){var b=[];q.split("/").forEach(function(q){".."===q?b.pop():"."!==q&&b.push(q)});return b.join("/")}function c(q,b){if("string"!==typeof q)throw new TypeError;var q=q.replace(/\s/g,function(q){return"%"+q.charCodeAt(0).toString(16)}),
+c=r.exec(q);if(!c)return null;var w={};w.scheme=c[1]||"";if(w.scheme&&!u.test(w.scheme))return null;var k=c[2];if(k&&(k=x.exec(k),w.userinfo=k[1],w.host=k[2],w.port=k[3],w.port&&!t.test(w.port)))return null;w.path=c[3];w.query=c[4];w.fragment=c[5];!w.scheme&&b&&(w.scheme=b.scheme,!w.host&&b.host&&(w.userinfo=b.userinfo,w.host=b.host,w.port=b.port,w.pathRelative=!0));w.pathRelative&&(w.path?"/"!==w.path[0]&&(c=/^(.*\/)[^\/]*$/.exec(b.path)[1]||"/",w.path=c+w.path):w.path=b.path);w.scheme&&(w.scheme=
+w.scheme.toLowerCase());w.port&&(w.port=d(w.port));w.host&&w.path&&(w.path=h(w.path));return w}function b(q,b){var w;if(b){b=b.href||b;w=c(b);if(!w||!w.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:w})}w=c(q,w);if(!w)throw new SyntaxError;Object.defineProperty(this,"_input",{value:q,writable:!0});Object.defineProperty(this,"_url",{value:w,writable:!0});var d=new e(this);Object.defineProperty(this,"query",{get:function(){return this._url?d:null},enumerable:!0})}try{var k;
+if("function"===typeof window.URL&&0!==window.URL.length&&"http:"===(k=new window.URL("http://www.w3.org?q")).protocol&&k.query)return}catch(m){}var r=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,x=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,u=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,t=/^\d*$/,y=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,s=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,v=/^([^?#\s]*)$/,z=/^([^\s]*)$/,q=/^\S*$/,w=/([^:]*):?(.*)/,B="undefined"!==typeof StopIteration?StopIteration:
+Error("Stop Iteration"),A={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(e.prototype,{get:{value:function(q){g(q);var b;n(this._url.query).some(function(w){w=a(w);if(w[0]===q)return b=w[1],!0});return b},enumerable:!0},set:{value:function(q,b){g(q);g(b);var w=n(this._url.query);w.some(function(c,d){var k=a(c);if(k[0]===q)return k[1]=b,w[d]=l(k),!0})||w.push(l([q,b]));this._url.query=p(w)},enumerable:!0},has:{value:function(q){g(q);return n(this._url.query).some(function(b){if(a(b)[0]===
+q)return!0})},enumerable:!0},"delete":{value:function(q){g(q);var b=n(this._url.query),w=b.filter(function(b){return a(b)[0]!==q});return w.length!==b.length?(this._url.query=p(w),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(q,b){if("function"!==typeof q)throw new TypeError;var w=f(this._url,"keys+values");try{for(;;){var c=w.next();q.call(b,c[1],c[0],this)}}catch(d){if(d!==B)throw d;}},enumerable:!0},keys:{value:function(){return f(this._url,
+"keys")},enumerable:!0},values:{value:function(){return f(this._url,"values")},enumerable:!0},items:{value:function(){return f(this._url,"keys+values")}},size:{get:function(){return n(this._url.query).length},enumerable:!0},getAll:{value:function(q){g(q);var b=[];n(this._url.query).forEach(function(w){w=a(w);w[0]===q&&b.push(w[1])});return b},enumerable:!0},append:{value:function(q,b){g(q);g(b);var w=n(this._url.query);w.push(l([q,b]));this._url.query=p(w)},enumerable:!0}});Object.defineProperties(b.prototype,
+{href:{get:function(){var q;if(this._url){q=this._url;var b=q.scheme?q.scheme+":":"";q.host&&(b+="//",q.userinfo&&(b+=q.userinfo+"@"),b+=q.host,q.port&&(b+=":"+q.port));b+=q.path;q.query&&(b+="?"+q.query);q.fragment&&(b+="#"+q.fragment);q=b}else q=this._input;return q},set:function(q){g(q);this._input=q;this._url=c(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(q){g(q);if(this._url&&(q=":"===q.slice(-1)?q.substring(0,q.length-1):q,""===q||u.test(q)))this._url.scheme=q.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(q){g(q);this._url&&(this._url.userinfo=q)}},username:{get:function(){if(!this._url)return"";var q=w.exec(this._userinfo);return decodeURIComponent(q[1]||"")},set:function(q){g(q);if(this._url){var b=w.exec(this._userinfo),q=[encodeURIComponent(q||
+"")];b[2]&&q.push(b[2]);this._userinfo=q.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var q=w.exec(this._userinfo);return decodeURIComponent(q[2]||"")},set:function(q){g(q);if(this._url){var b=[w.exec(this._userinfo)[1]||""];q&&b.push(encodeURIComponent(q));this._userinfo=b.join(":")}},enumerable:!0},host:{get:function(){var q="";this._url&&this._url.host&&(q+=this._url.host,this._url.port&&(q+=":"+this._url.port));return q},set:function(q){g(q);if(this._url&&(q=s.exec(q)))this._url.host=
+q[1],this._url.port=d(q[2])},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(q){g(q);this._url&&y.exec(q)&&(this._url.host=q)},enumerable:!0},port:{get:function(){var q=this._url?this._url.port||"":"";q&&q===A[this.protocol]&&(q="");return q},set:function(q){g(q);this._url&&t.exec(q)&&(this._url.port=d(q))},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(q){g(q);this._url&&v.exec(q)&&(this._url.host&&(q&&"/"!==q[0])&&
+(q="/"+q),this._url.path=q?h(q):"")},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(q){g(q);this._url&&(q&&"?"===q[0]&&(q=q.substring(1)),z.exec(q)&&(this._url.query=q))},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(b){g(b);this._url&&(b&&"#"===b[0]&&(b=b.substring(1)),q.exec(b)&&(this._url.fragment=b))},enumerable:!0}});if((k=window.URL||window.webkitURL)&&k.createObjectURL)Object.defineProperty(b,
+"createObjectURL",{value:k.createObjectURL.bind(k),enumerable:!1}),Object.defineProperty(b,"revokeObjectURL",{value:k.revokeObjectURL.bind(k),enumerable:!1});window.URL=b})();define("orion/URL-shim",function(){});
 define("orion/fileUtils",["require","i18n!orion/nls/messages","orion/URL-shim"],function(g){return{makeRelative:function(g){if(!g)return g;var p=window.location.protocol+"//"+window.location.host;return 0===g.indexOf(p)?g.substring(p.length):g},isAtRoot:function(n){if(!n)return!1;if("/workspace"===n)return!0;var p=new URL(g.toUrl("workspace"),window.location.href);return 0===(new URL(n,window.location.href)).href.indexOf(p.href)}}});
-define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(g,n){function p(b){this._init(b)}p.prototype={_init:function(b){var l=b.parent,f=this,l=n.node(l);if(!l)throw g["no parent"];if(!b.model)throw g["no tree model"];if(!b.renderer)throw g["no renderer"];this._parent=l;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._root=this._treeModel.getRoot(function(b){f._showRoot?(b._depth=0,f._generate([b],0)):f._treeModel.getChildren(b,function(d){f.destroyed||f._generate(d,0)})})},destroy:function(){this.destroyed=!0},_generate:function(b,
+define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(g,n){function p(a){this._init(a)}p.prototype={_init:function(a){var l=a.parent,f=this,l=n.node(l);if(!l)throw g["no parent"];if(!a.model)throw g["no tree model"];if(!a.renderer)throw g["no renderer"];this._parent=l;this._treeModel=a.model;this._onComplete=a.onComplete;this._renderer=a.renderer;this._showRoot=void 0===a.showRoot?!1:a.showRoot;this._indent=void 0===a.indent?16:a.indent;this._onCollapse=a.onCollapse;
+this._labelColumnIndex=void 0===a.labelColumnIndex?0:a.labelColumnIndex;this._id=void 0===a.id?"treetable":a.id;this._tableStyle=a.tableStyle;this._tableElement=a.tableElement||"table";this._tableBodyElement=a.tableBodyElement||"tbody";this._tableRowElement=a.tableRowElement||"tr";this._root=this._treeModel.getRoot(function(a){f._showRoot?(a._depth=0,f._generate([a],0)):f._treeModel.getChildren(a,function(d){f.destroyed||f._generate(d,0)})})},destroy:function(){this.destroyed=!0},_generate:function(a,
 l){n.empty(this._parent);var f=document.createElement("div");this._renderer.wrapperCallback&&this._renderer.wrapperCallback(f);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,l);e.appendChild(this._bodyElement);f.appendChild(e);this._parent.appendChild(f);this._rowsChanged();this._onComplete&&this._onComplete(this)},_generateChildren:function(b,l,f){for(var e=0;e<b.length;e++){var d=document.createElement(this._tableRowElement);d.id=this._treeModel.getId(b[e]);d._depth=l;d._item=b[e];this._renderer.render(b[e],d);d.childNodes[this._labelColumnIndex].style.paddingLeft=
-this._indent*l+"px";this._renderer.rowCallback&&this._renderer.rowCallback(d,b[e]);f?(this._bodyElement.insertBefore(d,f.nextSibling),f&&(f=d)):this._bodyElement.appendChild(d)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(b,l,f){var e=this._treeModel.getId(b),d;if(e===this._id)this._removeChildRows(e),this._generateChildren(l,0),this._rowsChanged();else{var h=n.node(e);h?(h._item=b,
+"tbody";0===a.length?this._renderer.emptyCallback&&this._renderer.emptyCallback(this._bodyElement):this._generateChildren(a,l);e.appendChild(this._bodyElement);f.appendChild(e);this._parent.appendChild(f);this._rowsChanged();this._onComplete&&this._onComplete(this)},_generateChildren:function(a,l,f){for(var e=0;e<a.length;e++){var d=document.createElement(this._tableRowElement);d.id=this._treeModel.getId(a[e]);d._depth=l;d._item=a[e];this._renderer.render(a[e],d);d.childNodes[this._labelColumnIndex].style.paddingLeft=
+this._indent*l+"px";this._renderer.rowCallback&&this._renderer.rowCallback(d,a[e]);f?(this._bodyElement.insertBefore(d,f.nextSibling),f&&(f=d)):this._bodyElement.appendChild(d)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(a,l,f){var e=this._treeModel.getId(a),d;if(e===this._id)this._removeChildRows(e),this._generateChildren(l,0),this._rowsChanged();else{var h=n.node(e);h?(h._item=a,
 h&&(f||h._expanded)?(this._removeChildRows(e),l?(h._expanded=!0,this._renderer.updateExpandVisuals(h,!0),this._generateChildren(l,h._depth+1,h),this._rowsChanged()):(d=this,this._renderer.updateExpandVisuals(h,"progress"),l=this._treeModel.getChildren(h._item,function(c){d.destroyed||(d._renderer.updateExpandVisuals(h,!0),h._expanded||(h._expanded=!0,d._generateChildren(c,h._depth+1,h),d._rowsChanged()))}))):this._renderer.updateExpandVisuals(h,!1)):console.log(g["could not find table row "]+e)}},
-getItem:function(b){var l=n.node(b);return l&&l._item?l._item:b},toggle:function(b){var l=n.node(b);l&&(l._expanded?this.collapse(b):this.expand(b))},isExpanded:function(b){b="string"===typeof b?b:this._treeModel.getId(b);return(b=n.node(b))?b._expanded:!1},expand:function(b,l,f){var b="string"===typeof b?b:this._treeModel.getId(b),e=n.node(b);if(e)if(e._expanded)l&&l.apply(d,f);else{var d=this;this._renderer.updateExpandVisuals(e,"progress");this._treeModel.getChildren(e._item,function(b){d.destroyed||
-(d._renderer.updateExpandVisuals(e,!0),e._expanded||(e._expanded=!0,d._generateChildren(b,e._depth+1,e),d._rowsChanged()),l&&l.apply(d,f))})}},_removeChildRows:function(b){for(var l=b===this._id,f=!1,e=-1,d=[],h=n.$$array(".treeTableRow",this._parent),c=0;c<h.length;c++){var a=h[c];if(f)break;l?a._depth>e?d.push(a):f=!0:a.id===b&&(l=!0,e=a._depth)}for(b=0;b<d.length;b++)l=d[b],l.parentNode.removeChild(l)},collapse:function(b){var b="string"===typeof b?b:this._treeModel.getId(b),l=n.node(b);if(l){if(!l._expanded)return;
-l._expanded=!1;this._renderer.updateExpandVisuals(l,!1);this._removeChildRows(b);this._rowsChanged()}this._onCollapse&&this._onCollapse(l._item)},getIndent:function(){return this._indent}};p.prototype.constructor=p;return{TableTree:p}});
-define("orion/treeModelIterator",[],function(){var g={},n=function(g,b){this.firstLevelChildren=g;this.reset();this._init(b)};n.prototype={_init:function(g){g&&(this.isExpanded=g.isExpanded,this.isExpandable=g.isExpandable,this.forceExpandFunc=g.forceExpandFunc,this.getChildrenFunc=g.getChildrenFunc)},topLevel:function(g){return g.parent?g.parent===this.root:!0},_getChildren:function(g){return"function"===typeof this.getChildrenFunc?this.getChildrenFunc(g):g?g.children:null},_expanded:function(g){if(!g)return!0;
-var b=this._getChildren(g),b=b&&0<b.length;this.isExpanded&&b&&(b=this.isExpanded(g));return b},_expandable:function(g){return!g?!0:this.isExpandable?this.isExpandable(g):!1},_diveIn:function(g){return this._expanded(g)?(g=this._getChildren(g),this.setCursor(g[0]),this.cursor()):null},_drillToLast:function(g){return this._expanded(g)?(g=this._getChildren(g),this._drillToLast(g[g.length-1])):g},_forward:function(g){if(!this._cursor)return null;var b=this._diveIn(this._cursor);if(!b){if(g&&this._expandable(this._cursor)&&
-this.forceExpandFunc){var l=this;return this.forceExpandFunc(this._cursor,"first",function(b){b&&l.setCursor(b)})}(b=this._findSibling(this._cursor,!0))&&this.setCursor(b)}return b},_backward:function(g){if(!this._cursor)return null;var b=this._findSibling(this._cursor,!1);b&&b!==this._cursor.parent&&(b=this._drillToLast(b));if(g&&b&&this._expandable(b)&&this.forceExpandFunc&&b!==this._cursor.parent){var l=this;return this.forceExpandFunc(b,"last",function(b){b&&l.setCursor(b)})}b&&this.setCursor(b);
-return b},_findSibling:function(g,b){for(var l=this.topLevel(g),f=this._getChildren(g.parent),f=l?this.firstLevelChildren:f,e=0;e<f.length;e++)if(f[e]===g)return 0===e&&!b?l?null:g.parent:e===f.length-1&&b?l?null:this._findSibling(g.parent,b):b?f[e+1]:f[e-1];return null},_inParentChain:function(g,b){for(var l=g.parent;l;){if(l===b)return!0;l=l.parent}return!1},_getTopLevelParent:function(g){if(this.topLevel(g))return g;for(g=g.parent;g;){if(this.topLevel(g))return g;g=g.parent}return null},_onCollapse:function(g){return this._expanded(g.parent)?
-g:this._onCollapse(g.parent)},_scan:function(g,b,l){this.setCursor(b);var f=[];for(f.push(b);;){if(this.iterate(g))f.push(this.cursor());else break;if(l===this.cursor())return f}return null},setCursor:function(g){this._prevCursor=this._cursor;this._cursor=g},setTree:function(g){this.firstLevelChildren=g;0<this.firstLevelChildren.length&&(this.root=this.firstLevelChildren[0].parent)},scan:function(g,b){var l=this.cursor(),f=this._scan(!0,g,b);f||(f=this._scan(!1,g,b));this.setCursor(l);return f},iterate:function(g,
-b){return g?this._forward(b):this._backward(b)},iterateOnTop:function(g,b){var l=this._findSibling(this._getTopLevelParent(this.cursor()),g);l?this.setCursor(l):b&&0<this.firstLevelChildren.length&&this.setCursor(g?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(g){return!this._cursor?null:this._inParentChain(this._cursor,g)?(this.setCursor(g),this._cursor):null},reset:function(){this.root=this._prevCursor=this._cursor=null;0<this.firstLevelChildren.length&&
+getItem:function(a){var l=n.node(a);return l&&l._item?l._item:a},toggle:function(a){var l=n.node(a);l&&(l._expanded?this.collapse(a):this.expand(a))},isExpanded:function(a){a="string"===typeof a?a:this._treeModel.getId(a);return(a=n.node(a))?a._expanded:!1},expand:function(a,l,f){var a="string"===typeof a?a:this._treeModel.getId(a),e=n.node(a);if(e)if(e._expanded)l&&l.apply(d,f);else{var d=this;this._renderer.updateExpandVisuals(e,"progress");this._treeModel.getChildren(e._item,function(a){d.destroyed||
+(d._renderer.updateExpandVisuals(e,!0),e._expanded||(e._expanded=!0,d._generateChildren(a,e._depth+1,e),d._rowsChanged()),l&&l.apply(d,f))})}},_removeChildRows:function(a){for(var l=a===this._id,f=!1,e=-1,d=[],h=n.$$array(".treeTableRow",this._parent),c=0;c<h.length;c++){var b=h[c];if(f)break;l?b._depth>e?d.push(b):f=!0:b.id===a&&(l=!0,e=b._depth)}for(a=0;a<d.length;a++)l=d[a],l.parentNode.removeChild(l)},collapse:function(a){var a="string"===typeof a?a:this._treeModel.getId(a),l=n.node(a);if(l){if(!l._expanded)return;
+l._expanded=!1;this._renderer.updateExpandVisuals(l,!1);this._removeChildRows(a);this._rowsChanged()}this._onCollapse&&this._onCollapse(l._item)},getIndent:function(){return this._indent}};p.prototype.constructor=p;return{TableTree:p}});
+define("orion/treeModelIterator",[],function(){var g={},n=function(g,a){this.firstLevelChildren=g;this.reset();this._init(a)};n.prototype={_init:function(g){g&&(this.isExpanded=g.isExpanded,this.isExpandable=g.isExpandable,this.forceExpandFunc=g.forceExpandFunc,this.getChildrenFunc=g.getChildrenFunc)},topLevel:function(g){return g.parent?g.parent===this.root:!0},_getChildren:function(g){return"function"===typeof this.getChildrenFunc?this.getChildrenFunc(g):g?g.children:null},_expanded:function(g){if(!g)return!0;
+var a=this._getChildren(g),a=a&&0<a.length;this.isExpanded&&a&&(a=this.isExpanded(g));return a},_expandable:function(g){return!g?!0:this.isExpandable?this.isExpandable(g):!1},_diveIn:function(g){return this._expanded(g)?(g=this._getChildren(g),this.setCursor(g[0]),this.cursor()):null},_drillToLast:function(g){return this._expanded(g)?(g=this._getChildren(g),this._drillToLast(g[g.length-1])):g},_forward:function(g){if(!this._cursor)return null;var a=this._diveIn(this._cursor);if(!a){if(g&&this._expandable(this._cursor)&&
+this.forceExpandFunc){var l=this;return this.forceExpandFunc(this._cursor,"first",function(a){a&&l.setCursor(a)})}(a=this._findSibling(this._cursor,!0))&&this.setCursor(a)}return a},_backward:function(g){if(!this._cursor)return null;var a=this._findSibling(this._cursor,!1);a&&a!==this._cursor.parent&&(a=this._drillToLast(a));if(g&&a&&this._expandable(a)&&this.forceExpandFunc&&a!==this._cursor.parent){var l=this;return this.forceExpandFunc(a,"last",function(a){a&&l.setCursor(a)})}a&&this.setCursor(a);
+return a},_findSibling:function(g,a){for(var l=this.topLevel(g),f=this._getChildren(g.parent),f=l?this.firstLevelChildren:f,e=0;e<f.length;e++)if(f[e]===g)return 0===e&&!a?l?null:g.parent:e===f.length-1&&a?l?null:this._findSibling(g.parent,a):a?f[e+1]:f[e-1];return null},_inParentChain:function(g,a){for(var l=g.parent;l;){if(l===a)return!0;l=l.parent}return!1},_getTopLevelParent:function(g){if(this.topLevel(g))return g;for(g=g.parent;g;){if(this.topLevel(g))return g;g=g.parent}return null},_onCollapse:function(g){return this._expanded(g.parent)?
+g:this._onCollapse(g.parent)},_scan:function(g,a,l){this.setCursor(a);var f=[];for(f.push(a);;){if(this.iterate(g))f.push(this.cursor());else break;if(l===this.cursor())return f}return null},setCursor:function(g){this._prevCursor=this._cursor;this._cursor=g},setTree:function(g){this.firstLevelChildren=g;0<this.firstLevelChildren.length&&(this.root=this.firstLevelChildren[0].parent)},scan:function(g,a){var l=this.cursor(),f=this._scan(!0,g,a);f||(f=this._scan(!1,g,a));this.setCursor(l);return f},iterate:function(g,
+a){return g?this._forward(a):this._backward(a)},iterateOnTop:function(g,a){var l=this._findSibling(this._getTopLevelParent(this.cursor()),g);l?this.setCursor(l):a&&0<this.firstLevelChildren.length&&this.setCursor(g?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(g){return!this._cursor?null:this._inParentChain(this._cursor,g)?(this.setCursor(g),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}};g.TreeModelIterator=n;return g});
-define("orion/uiUtils",["orion/webui/littlelib"],function(g){function n(b){var l="",f=-1!==navigator.platform.indexOf("Mac");b.mod1&&(l=f?l+"Cmd+":l+"Ctrl+");b.mod2&&(l+="Shift+");b.mod3&&(l+="Alt+");b.mod4&&f&&(l+="Ctrl+");if(b.alphaKey)return l+b.alphaKey;if("keypress"===b.type)return l+b.keyCode;for(var e in g.KEY)if(typeof("number"===g.KEY[e])&&g.KEY[e]===b.keyCode)return l+e;var d;switch(b.keyCode){case 59:d=b.mod2?":":";";break;case 61:d=b.mod2?"+":"=";break;case 188:d=b.mod2?"<":",";break;
-case 190:d=b.mod2?">":".";break;case 191:d=b.mod2?"?":"/";break;case 192:d=b.mod2?"~":"`";break;case 219:d=b.mod2?"{":"[";break;case 220:d=b.mod2?"|":"\\";break;case 221:d=b.mod2?"}":"]";break;case 222:d=b.mod2?'"':"'"}return d?l+d:112<=b.keyCode&&123>=b.keyCode?l+"F"+(b.keyCode-111):l+String.fromCharCode(b.keyCode)}function p(b){var l=-1!==window.navigator.platform.indexOf("Mac");return l&&b.metaKey||!l&&b.ctrlKey}return{getUserKeyString:function(b){for(var l="",b=b.getKeys(),f=0;f<b.length;f++)0!==
-f&&(l+=" "),l+=n(b[f]);return l},getUserText:function(b){var l=b.id,f=b.refNode,e=b.hideRefNode,d=b.initialText,h=b.onComplete,c=b.onEditDestroy,a=b.selectTo,k=b.isInitialValid,b=b.insertAsChild,m=!1,r=function(a){return function(b){if(!m){var r=g.node(l),w=r.value;r&&(a&&b.keyCode===g.KEY.ESCAPE?(e&&(f.style.display="inline"),m=!0,r.parentNode.removeChild(r),c&&c()):a&&b.keyCode!==g.KEY.ENTER||(0===w.length||!k&&w===d?e&&(f.style.display="inline"):(h(w),e&&f.parentNode&&(f.style.display="inline")),
-m=!0,r.parentNode&&r.parentNode.removeChild(r),c&&c()))}}},w=document.createElement("input");w.id=l;w.value=d||"";b?f.appendChild(w):f.parentNode.insertBefore(w,f.nextSibling);w.classList.add("userEditBoxPrompt");e&&(f.style.display="none");w.addEventListener("keydown",r(!0),!1);w.addEventListener("blur",r(!1),!1);window.setTimeout(function(){w.focus();if(d){var c=g.node(l),k=a?d.indexOf(a):-1;0<k?c.createTextRange?(c=c.createTextRange(),c.collapse(!0),c.moveStart("character",0),c.moveEnd("character",
-k),c.select()):c.setSelectionRange?c.setSelectionRange(0,k):void 0!==c.selectionStart&&(c.selectionStart=0,c.selectionEnd=k):c.select()}},0)},openInNewWindow:p,followLink:function(b,l){l&&p(l)?window.open(b):window.location=b},createButton:function(b,l){var f=document.createElement("button");f.className="orionButton commandButton commandMargins";f.addEventListener("click",function(b){l();g.stop(b)},!1);b&&f.appendChild(document.createTextNode(b));return f},createDropdownButton:function(){},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(g,n,p){var b={},l=-1!==navigator.userAgent.indexOf("iPad"),f=-1!==window.navigator.platform.indexOf("Mac"),e=function(d,b,c){this.explorer=d;this.model=this.explorer.model;this._navDict=b;this._listeners=[];this._selections=[];this._currentColumn=0;d=this._getEventListeningDiv();d.tabIndex=0;d.classList.add("selectionModelContainer");var a=this;this._modelIterator=new n.TreeModelIterator([],
-{isExpanded:this.isExpanded.bind(this),getChildrenFunc:c.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(c){return a.explorer.renderer.isExpandable(c)}:function(c){return a.isExpandable(c)},forceExpandFunc:this.explorer.forceExpandFunc?function(c,d,b){return a.explorer.forceExpandFunc(c,d,b)}:void 0});this._init(c);(!c||!1!==c.setFocus)&&d.focus();c=function(c){if(p.isFormElement(c.target)||a.explorer.preventDefaultFunc&&a.explorer.preventDefaultFunc(c,a._modelIterator.cursor()))return!0;
-if(c.keyCode===g.KEY.DOWN)return a.onDownArrow(c);if(c.keyCode===g.KEY.UP)return a.onUpArrow(c);if(c.keyCode===g.KEY.RIGHT)return a.onRightArrow(c);if(c.keyCode===g.KEY.LEFT)return a.onLeftArrow(c);if(c.keyCode===g.KEY.SPACE)return a.onSpace(c);if(c.keyCode===g.KEY.ENTER)return a.onEnter(c)};d.addEventListener("keydown",c,!1);this._listeners.push({type:"keydown",listener:c});c=function(){if(a.explorer.onFocus)a.explorer.onFocus(!1);else a.toggleCursor(null,!1)};d.addEventListener("blur",c,!1);this._listeners.push({type:"blur",
-listener:c});c=function(){if(a.explorer.onFocus)a.explorer.onFocus(!0);else a.toggleCursor(null,!0)};d.addEventListener("focus",c,!1);this._listeners.push({type:"focus",listener:c});this._parentDiv=d};e.prototype={destroy:function(){this._parentDiv.classList.remove("selectionModelContainer");this.removeListeners()},_init:function(d){this._linearGridMove=!1;d&&(this._selectionPolicy=d.selectionPolicy,this.gridClickSelectionPolicy=d.gridClickSelectionPolicy||"none",this.preventDefaultFunc=d.preventDefaultFunc,
+define("orion/uiUtils",["orion/webui/littlelib"],function(g){function n(a){var l="",f=-1!==navigator.platform.indexOf("Mac");a.mod1&&(l=f?l+"Cmd+":l+"Ctrl+");a.mod2&&(l+="Shift+");a.mod3&&(l+="Alt+");a.mod4&&f&&(l+="Ctrl+");if(a.alphaKey)return l+a.alphaKey;if("keypress"===a.type)return l+a.keyCode;for(var e in g.KEY)if(typeof("number"===g.KEY[e])&&g.KEY[e]===a.keyCode)return l+e;var d;switch(a.keyCode){case 59:d=a.mod2?":":";";break;case 61:d=a.mod2?"+":"=";break;case 188:d=a.mod2?"<":",";break;
+case 190:d=a.mod2?">":".";break;case 191:d=a.mod2?"?":"/";break;case 192:d=a.mod2?"~":"`";break;case 219:d=a.mod2?"{":"[";break;case 220:d=a.mod2?"|":"\\";break;case 221:d=a.mod2?"}":"]";break;case 222:d=a.mod2?'"':"'"}return d?l+d:112<=a.keyCode&&123>=a.keyCode?l+"F"+(a.keyCode-111):l+String.fromCharCode(a.keyCode)}function p(a){var l=-1!==window.navigator.platform.indexOf("Mac");return l&&a.metaKey||!l&&a.ctrlKey}return{getUserKeyString:function(a){for(var l="",a=a.getKeys(),f=0;f<a.length;f++)0!==
+f&&(l+=" "),l+=n(a[f]);return l},getUserText:function(a){var l=a.id,f=a.refNode,e=a.hideRefNode,d=a.initialText,h=a.onComplete,c=a.onEditDestroy,b=a.selectTo,k=a.isInitialValid,a=a.insertAsChild,m=!1,r=function(b){return function(a){if(!m){var r=g.node(l),x=r.value;r&&(b&&a.keyCode===g.KEY.ESCAPE?(e&&(f.style.display="inline"),m=!0,r.parentNode.removeChild(r),c&&c()):b&&a.keyCode!==g.KEY.ENTER||(0===x.length||!k&&x===d?e&&(f.style.display="inline"):(h(x),e&&f.parentNode&&(f.style.display="inline")),
+m=!0,r.parentNode&&r.parentNode.removeChild(r),c&&c()))}}},x=document.createElement("input");x.id=l;x.value=d||"";a?f.appendChild(x):f.parentNode.insertBefore(x,f.nextSibling);x.classList.add("userEditBoxPrompt");e&&(f.style.display="none");x.addEventListener("keydown",r(!0),!1);x.addEventListener("blur",r(!1),!1);window.setTimeout(function(){x.focus();if(d){var c=g.node(l),k=b?d.indexOf(b):-1;0<k?c.createTextRange?(c=c.createTextRange(),c.collapse(!0),c.moveStart("character",0),c.moveEnd("character",
+k),c.select()):c.setSelectionRange?c.setSelectionRange(0,k):void 0!==c.selectionStart&&(c.selectionStart=0,c.selectionEnd=k):c.select()}},0)},openInNewWindow:p,followLink:function(a,l){l&&p(l)?window.open(a):window.location=a},createButton:function(a,l){var f=document.createElement("button");f.className="orionButton commandButton commandMargins";f.addEventListener("click",function(a){l();g.stop(a)},!1);a&&f.appendChild(document.createTextNode(a));return f},createDropdownButton:function(){},isFormElement:function(a){switch(a.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(g,n,p){var a={},l=-1!==navigator.userAgent.indexOf("iPad"),f=-1!==window.navigator.platform.indexOf("Mac"),e=function(d,a,c){this.explorer=d;this.model=this.explorer.model;this._navDict=a;this._listeners=[];this._selections=[];this._currentColumn=0;d=this._getEventListeningDiv();d.tabIndex=0;d.classList.add("selectionModelContainer");var b=this;this._modelIterator=new n.TreeModelIterator([],
+{isExpanded:this.isExpanded.bind(this),getChildrenFunc:c.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(c){return b.explorer.renderer.isExpandable(c)}:function(c){return b.isExpandable(c)},forceExpandFunc:this.explorer.forceExpandFunc?function(c,d,a){return b.explorer.forceExpandFunc(c,d,a)}:void 0});this._init(c);(!c||!1!==c.setFocus)&&d.focus();c=function(c){if(p.isFormElement(c.target)||b.explorer.preventDefaultFunc&&b.explorer.preventDefaultFunc(c,b._modelIterator.cursor()))return!0;
+if(c.keyCode===g.KEY.DOWN)return b.onDownArrow(c);if(c.keyCode===g.KEY.UP)return b.onUpArrow(c);if(c.keyCode===g.KEY.RIGHT)return b.onRightArrow(c);if(c.keyCode===g.KEY.LEFT)return b.onLeftArrow(c);if(c.keyCode===g.KEY.SPACE)return b.onSpace(c);if(c.keyCode===g.KEY.ENTER)return b.onEnter(c)};d.addEventListener("keydown",c,!1);this._listeners.push({type:"keydown",listener:c});c=function(){if(b.explorer.onFocus)b.explorer.onFocus(!1);else b.toggleCursor(null,!1)};d.addEventListener("blur",c,!1);this._listeners.push({type:"blur",
+listener:c});c=function(){if(b.explorer.onFocus)b.explorer.onFocus(!0);else b.toggleCursor(null,!0)};d.addEventListener("focus",c,!1);this._listeners.push({type:"focus",listener:c});this._parentDiv=d};e.prototype={destroy:function(){this._parentDiv.classList.remove("selectionModelContainer");this.removeListeners()},_init:function(d){this._linearGridMove=!1;d&&(this._selectionPolicy=d.selectionPolicy,this.gridClickSelectionPolicy=d.gridClickSelectionPolicy||"none",this.preventDefaultFunc=d.preventDefaultFunc,
 this.postDefaultFunc=d.postDefaultFunc)},_ctrlKeyOn:function(d){return f?d.metaKey:d.ctrlKey},removeListeners:function(){if(this._listeners)for(var d=0;d<this._listeners.length;d++)this._parentDiv.removeEventListener(this._listeners[d].type,this._listeners[d].listener,!1)},focus:function(){var d=this._getEventListeningDiv();d&&d.focus()},_getEventListeningDiv:function(d){return this.explorer.keyEventListeningDiv&&"function"===typeof this.explorer.keyEventListeningDiv?this.explorer.keyEventListeningDiv(d):
-g.node(this.explorer._parentId)},isExpandable:function(d){return!d?!1:g.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(d)))?!0:!1},isExpanded:function(d){return!d?!1:this.explorer.myTree.isExpanded(this.model.getId(d))},refreshSelection:function(d,b){var c=this;this.explorer.selection&&this.explorer.selection.getSelections(function(a){c._clearSelection(b);for(var k=0;k<a.length;k++)c._selections.push(a[k]);0<c._selections.length?c.cursorOn(c._selections[0],!0,!1,d):c.cursorOn(null,
-!1,!1,d);c._shiftSelectionAnchor&&0<=c._inSelection(c._shiftSelectionAnchor)||(c._shiftSelectionAnchor=null)})},refreshModel:function(d,b,c,a){this._currentColumn=0;this.topIterationNodes=[];this.model=b;this._navDict=d;this.model.getTopIterationNodes?this.topIterationNodes=this.model.getTopIterationNodes():c&&(this.topIterationNodes=c);this._modelIterator.setTree(this.topIterationNodes);!a&&this.explorer.selection&&(this.toggleCursor(this._modelIterator.cursor(),!1),this._modelIterator.reset());
-this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(d){for(var d=this.model.getId(d),b=0;b<this._selections.length;b++)if(d===this.model.getId(this._selections[b]))return b;return-1},_clearSelection:function(d){if(d)for(d=0;d<this._selections.length;d++)this._checkRow(this._selections[d],!0);this._selections=[]},getSelectionPolicy:function(){return this._selectionPolicy},setSelectionPolicy:function(d){this._selectionPolicy!==
-d&&(this._selectionPolicy=d,"cursorOnly"===this._selectionPolicy&&this._clearSelection(!0))},setSelection:function(d,b,c){"cursorOnly"===this._selectionPolicy?b&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(d,!0):this._isRowSelectable(d)&&(!b||"singleSelection"===this._selectionPolicy?(this._clearSelection(!0),this._checkRow(d,!1),this._selections.push(d),this._lastSelection=d):(b=this._inSelection(d),0<=b?(this._checkRow(d,!0),this._selections.splice(b,1)):(this._checkRow(d,!1),this._selections.push(d),
-this._lastSelection=d)),c&&(this._shiftSelectionAnchor=this._lastSelection),this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections)))},moveColumn:function(d,b){d||(d=this.currentModel());var c=this._getGridChildren(d);if(c&&1<c.length||0===b&&c){0!==b&&this.toggleCursor(d,!1);var a=this._currentColumn,k=!0,a=a+b;0>a?(this._linearGridMove&&0!==b&&(this._modelIterator.iterate(!1)?d=this.currentModel():k=!1),a=k?c.length-1:this._currentColumn):
-a>=c.length&&(this._linearGridMove&&0!==b&&(this._modelIterator.iterate(!0)?d=this.currentModel():k=!1),a=k?0:this._currentColumn);this._currentColumn=a;0!==b&&this.toggleCursor(d,!0);return!0}return!1},_getGridChildren:function(d){return this._navDict?this._navDict.getGridNavHolder(d):null},getCurrentGrid:function(d){d||(d=this.currentModel());return(d=this._getGridChildren(d))&&0<d.length?d[this._currentColumn]:null},getAriaContainerElement:function(d){for(var b=this._parentDiv,c;d&&d!==b&&"grid"!==
-(c=d.getAttribute("role"))&&"tree"!==c&&"treegrid"!==c;)d=d.parentNode;return d===b?null:d},toggleCursor:function(d,b){var c=this.getRowDiv(d),a=this.getCurrentGrid(d);a?(c&&(b?c.classList.add("treeIterationCursorRow"):c.classList.remove("treeIterationCursorRow")),a.domNode&&(c=this.getAriaContainerElement(a.domNode),b?(a.domNode.classList.add("treeIterationCursor"),c&&c.setAttribute("aria-activedescendant",a.domNode.id)):a.domNode.classList.remove("treeIterationCursor"))):c&&(b?c.classList.add("treeIterationCursorRow_Dotted"):
-c.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(d,b,c,a){var k,m;if(d||b){if(m===this._modelIterator.cursor())return;k=this._modelIterator.cursor();m=d;this._modelIterator.setCursor(m)}else k=this._modelIterator.prevCursor(),m=this._modelIterator.cursor();if(k!==m||b)if(this.toggleCursor(k,!1),!b||m){this.moveColumn(null,0);this.toggleCursor(m,!0);if((d=this.getRowDiv())&&!a){a=d.parentNode;for(b=document.documentElement;a&&
-a!==b;){var r=window.getComputedStyle(a,null);if(!r)break;r=r.getPropertyValue("overflow-y");if("auto"===r||"scroll"===r)break;a=a.parentNode}b=!0;d.offsetTop<=a.scrollTop?(b=!1,void 0===c&&(c=!1)):d.offsetTop+d.offsetHeight>=a.scrollTop+a.clientHeight&&(b=!1,void 0===c&&(c=!0));b||d.scrollIntoView(!c)}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(k,m)}},getSelection:function(){return this._selections},getSelectionIds:function(){for(var d=[],b=0;b<this._selections.length;b++)d.push(this.model.getId(this._selections[b]));
-return d},getRowDiv:function(d){d=d?d:this._modelIterator.cursor();if(!d)return null;var d=this.model.getId(d),b=this._navDict.getValue(d);return b&&b.rowDomNode?b.rowDomNode:g.node(d)},iterate:function(d,b,c,a){var k=null;if(this.topIterationNodes&&0!==this.topIterationNodes.length)if(a){a=this.currentModel();for((k=this._modelIterator.iterate(d,b))&&this._setCursorOnItem(d,c);k&&k.isNotSelectable;)(k=this._modelIterator.iterate(d,b))&&this._setCursorOnItem(d,c);k||(this.cursorOn(a,!0,!1,!0),this._setCursorOnItem(d,
-c))}else(k=this._modelIterator.iterate(d,b))&&this._setCursorOnItem(d,c)},_setCursorOnItem:function(d,b){this.cursorOn(null,!1,d);if(b){var c=this._inSelection(this._modelIterator.prevCursor()),a=this._inSelection(this._modelIterator.cursor());0<=c&&0<=a?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)}},_checkRow:function(d,b){if(this.explorer.renderer._useCheckboxSelection){var c=this.getRowDiv(d);if(c){var a=g.node(this.explorer.renderer.getCheckBoxId(c.id)),
-k=b?!a.checked:!0;if(k!==a.checked)this.explorer.renderer.onCheck(c,a,k,!0)}}else this._select(d,b)},_select:function(d){d||(d=this._modelIterator.cursor());var b=this.getRowDiv(d);b&&(0>this._inSelection(d)?b.classList.add("checkedRow"):b.classList.remove("checkedRow"))},_onModelGrid:function(d,b){var c=this._getGridChildren(d);if(c)for(var a=0;a<c.length;a++)if(b.target===c[a].domNode)return!0;return!1},onClick:function(d,b){if(this.isDisabled(this.getRowDiv(d)))g.stop(b);else{var c=g.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(d)));
-if(b.target!==c&&!("none"===this.gridClickSelectionPolicy&&this._onModelGrid(d,b)))if(this.cursorOn(d,!0,!1,!0),l)this.setSelection(d,!0);else if(this._ctrlKeyOn(b))this.setSelection(d,!0,!0);else if(b.shiftKey&&this._shiftSelectionAnchor){if(c=this._modelIterator.scan(this._shiftSelectionAnchor,d)){this._clearSelection(!0);for(var a=0;a<c.length;a++)this.setSelection(c[a],!0)}}else this.setSelection(d,!1,!0)}},onCollapse:function(d){this._modelIterator.collapse(d)&&this.cursorOn()},onUpArrow:function(d){this.iterate(!1,
-!1,d.shiftKey,!0);!this._ctrlKeyOn(d)&&!d.shiftKey&&this.setSelection(this.currentModel(),!1,!0);d.preventDefault();return!1},onDownArrow:function(d){this.iterate(!0,!1,d.shiftKey,!0);!this._ctrlKeyOn(d)&&!d.shiftKey&&this.setSelection(this.currentModel(),!1,!0);d.preventDefault();return!1},_shouldMoveColumn:function(d){var b=this.currentModel(),c=this._getGridChildren(b);return c&&1<c.length?this.isExpandable(b)?this._ctrlKeyOn(d):!0:!1},onLeftArrow:function(d){if(this._shouldMoveColumn(d))return this.moveColumn(null,
--1),d.preventDefault(),!0;var b=this._modelIterator.cursor();if(!b)return!1;if(this.isExpandable(b)&&this.isExpanded(b))return this.explorer.myTree.collapse(b),d.preventDefault(),!0;this._modelIterator.topLevel(b)?this.explorer.scopeUp&&"function"===typeof this.explorer.scopeUp&&this.explorer.scopeUp():(this.cursorOn(b.parent),this.setSelection(b.parent,!1,!0))},onRightArrow:function(d){if(this._shouldMoveColumn(d))return this.moveColumn(null,1),d.preventDefault(),!0;var b=this._modelIterator.cursor();
-if(!b)return!1;if(this.isExpandable(b)&&!this.isExpanded(b))return this.explorer.myTree.expand(b),this.explorer.postUserExpand&&this.explorer.postUserExpand(this.model.getId(b)),d.preventDefault(),!1},_isRowSelectable:function(d){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(d):!0},onSpace:function(d){this.setSelection(this.currentModel(),!0,!0);d.preventDefault()},onEnter:function(d){var b=this.getCurrentGrid(this._modelIterator.cursor());if(b)if(b.widget)if("function"===typeof b.onClick)b.onClick();
-else"function"===typeof b.widget.focus&&b.widget.focus();else{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(d),!1,!1,!1,0,null);b.domNode.dispatchEvent(c)}else if(b=this._modelIterator.cursor())if(this.explorer.renderer.getRowActionElement&&(c=this.explorer.renderer.getRowActionElement(this.model.getId(b)),c.href&&(this._ctrlKeyOn(d)?window.open(c.href):window.location.href=c.href)),this.explorer.renderer.performRowAction)return this.explorer.renderer.performRowAction(d,
-b),d.preventDefault(),!1},setIsNotSelectable:function(d,b){d.isNotSelectable=b},disableItem:function(d){var b=this.getRowDiv(d);this.isExpandable(d)&&this.isExpanded(d)&&(this._modelIterator.collapse(d),this.explorer.myTree.toggle(b.id));b.classList.remove("checkedRow");b.classList.add("disabledNavRow");this.setIsNotSelectable(d,!0)},isDisabled:function(d){return d.classList.contains("disabledNavRow")},enableItem:function(d){var b=this.getRowDiv(d);b&&(b.classList.remove("disabledNavRow"),this.setIsNotSelectable(d,
-!1))}};b.ExplorerNavHandler=e;e=function(d){this._dict={};this._model=d};e.prototype={addRow:function(d,b){var c=this._model.getId(d);this._dict[c]={model:d,rowDomNode:b}},getValue:function(d){return this._dict[d]},getGridNavHolder:function(d,b){if(!d)return null;var c=this._model.getId(d);return this._dict[c]?(!this._dict[c].gridChildren&&b&&(this._dict[c].gridChildren=[]),this._dict[c].gridChildren):null},initGridNavHolder:function(d){if(!d)return null;d=this._model.getId(d);this._dict[d]&&(this._dict[d].gridChildren=
-null)}};b.ExplorerNavDict=e;return b});
-define("orion/webui/dropdown",["require","orion/webui/littlelib","orion/EventTarget"],function(g,n,p){function b(b){p.attach(this);this._init(b)}b.prototype={_init:function(b){this._dropdownNode=n.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 f=this._dropdownNode.parentNode;f&&document!==f;){if(f.classList&&
-f.classList.contains("dropdownMenu")){this._parentDropdown=f.dropdown;break}f=f.parentNode}this._triggerNode=b.triggerNode?b.triggerNode:n.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";if(!b.skipTriggerEventListeners){var e=this;this._triggerNode.addEventListener("click",function(d){e.toggle(d)&&n.stop(d)},!1);"span"===this._triggerNode.tagName.toLowerCase()&&this._triggerNode.addEventListener("keydown",function(d){if(d.keyCode===
-n.KEY.ENTER||d.keyCode===n.KEY.SPACE)e.toggle(),n.stop(d)},!1)}this._dropdownNode.addEventListener("keydown",this._dropdownKeyDown.bind(this),!1)},toggle:function(b){return this.isVisible()?this.close():this.open(b)},isVisible:function(){return this._isVisible},open:function(b){var f=!1;if(!this.isVisible()){this.dispatchEvent({type:"triggered",dropdown:this,event:b});n.setFramesEnabled(!1);this._populate&&(this.empty(),this._populate(this._dropdownNode));var e=this.getItems();0<e.length&&(this._hookedAutoDismiss||
-(this._boundAutoDismiss?n.removeAutoDismiss(this._boundAutoDismiss):this._boundAutoDismiss=this._autoDismiss.bind(this),f=n.$$array(".dropdownSubMenu",this._dropdownNode),n.addAutoDismiss([this._triggerNode].concat(f),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),e[0].focus(),
-f=!0,this._parentDropdown&&this._parentDropdown.submenuOpen(this))}return f},_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(){this._dropdownNode.style.left="";this._dropdownNode.style.top="";if(this._positioningNode)this._dropdownNode.style.left=this._positioningNode.offsetLeft+"px";else{var b=n.bounds(this._dropdownNode),f=n.bounds(document.body);if(b.left+b.width>f.left+f.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=
--b.width+"px";else{var e=n.bounds(this._boundingNode(this._triggerNode)),d=n.bounds(this._triggerNode);this._dropdownNode.style.left=d.left-e.left-b.width+d.width+"px"}b=b.top+b.height-(f.top+f.height);0<b&&(this._dropdownNode.style.top=Math.floor(this._dropdownNode.style.top-b)+"px")}},_boundingNode:function(b){var f=window.getComputedStyle(b,null);return null===f||"absolute"===f.getPropertyValue("position")||!b.parentNode||b===document.body?b:this._boundingNode(b.parentNode)},close:function(b){var f=
-!1;this.isVisible()&&(this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),n.setFramesEnabled(!0),b&&this._triggerNode.focus(),this._isVisible=!1,f=!0);return f},getItems:function(){var b=[],f=this;n.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(e){e.parentNode.parentNode===f._dropdownNode&&b.push(e)});b.forEach(function(b){b._hasDropdownMouseover||
-(b.addEventListener("mouseover",function(d){b.dropdown?b.dropdown.open(d):(f._closeSelectedSubmenu(),n.stop(d))}),b._hasDropdownMouseover=!0)});return b},empty:function(){var b=this;n.$$array("li",this._dropdownNode).forEach(function(f){f.parentNode===b._dropdownNode&&f.parentNode.removeChild(f)});this._hookedAutoDismiss=!1},_dropdownKeyDown:function(b){if(b.keyCode===n.KEY.UP||b.keyCode===n.KEY.DOWN||b.keyCode===n.KEY.RIGHT||b.keyCode===n.KEY.ENTER||b.keyCode===n.KEY.LEFT){var f=this.getItems(),
-e=document.activeElement;if(f.length&&0<f.length&&e){var d=f.indexOf(e);0>d&&(d=f.indexOf(e.parentNode));0<=d&&(b.keyCode===n.KEY.UP&&0<d?(d--,f[d].focus()):b.keyCode===n.KEY.DOWN&&d<f.length-1?(d++,f[d].focus()):b.keyCode===n.KEY.ENTER||b.keyCode===n.KEY.RIGHT?e.classList.contains("dropdownTrigger")&&e.dropdown&&e.dropdown.open():b.keyCode===n.KEY.LEFT&&e.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&this.close(!0),n.stop(b))}}else b.keyCode===n.KEY.ESCAPE&&(this.close(!0),n.stop(b))},
-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&&n.removeAutoDismiss(this._boundAutoDismiss)}};b.prototype.constructor=b;return{Dropdown:b}});
-define("text",["module"],function(g){var n,p,b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],l=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,f=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,e="undefined"!==typeof location&&location.href,d=e&&location.protocol&&location.protocol.replace(/\:/,""),h=e&&location.hostname,c=e&&(location.port||void 0),a=[],k=g.config&&g.config()||{};n={version:"2.0.5",strip:function(a){if(a){var a=a.replace(l,""),c=a.match(f);c&&(a=c[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:k.createXhr||function(){var a,c,d;if("undefined"!==typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!==typeof ActiveXObject)for(c=0;3>c;c+=1){d=b[c];try{a=new ActiveXObject(d)}catch(k){}if(a){b=[d];break}}return a},parseName:function(a){var c,
-d,b=!1,k=a.indexOf(".");c=0===a.indexOf("./")||0===a.indexOf("../");-1!==k&&(!c||1<k)?(c=a.substring(0,k),d=a.substring(k+1,a.length)):c=a;a=d||c;k=a.indexOf("!");-1!==k&&(b="strip"===a.substring(k+1),a=a.substring(0,k),d?d=a:c=a);return{moduleName:c,ext:d,strip:b}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,c,d,b){var k,e;k=n.xdRegExp.exec(a);if(!k)return!0;a=k[2];k=k[3];k=k.split(":");e=k[1];k=k[0];return(!a||a===c)&&(!k||k.toLowerCase()===d.toLowerCase())&&(!e&&!k||e===b)},finishLoad:function(c,
-d,b,e){b=d?n.strip(b):b;k.isBuild&&(a[c]=b);e(b)},load:function(a,b,l,f){if(f.isBuild&&!f.inlineText)l();else{k.isBuild=f.isBuild;var t=n.parseName(a),f=t.moduleName+(t.ext?"."+t.ext:""),g=b.toUrl(f),s=k.useXhr||n.useXhr;!e||s(g,d,h,c)?n.get(g,function(c){n.finishLoad(a,t.strip,c,l)},function(a){l.error&&l.error(a)}):b([f],function(a){n.finishLoad(t.moduleName+"."+t.ext,t.strip,a,l)})}},write:function(c,d,b){if(a.hasOwnProperty(d)){var k=n.jsEscape(a[d]);b.asModule(c+"!"+d,"define(function () { return '"+
-k+"';});\n")}},writeFile:function(a,c,d,b,k){var c=n.parseName(c),e=c.ext?"."+c.ext:"",h=c.moduleName+e,l=d.toUrl(c.moduleName+e)+".js";n.load(h,d,function(){var c=function(q){return b(l,q)};c.asModule=function(q,a){return b.asModule(q,l,a)};n.write(a,h,c,k)},k)}};if("node"===k.env||!k.env&&"undefined"!==typeof process&&process.versions&&process.versions.node)p=require.nodeRequire("fs"),n.get=function(a,c){var d=p.readFileSync(a,"utf8");0===d.indexOf("\ufeff")&&(d=d.substring(1));c(d)};else if("xhr"===
-k.env||!k.env&&n.createXhr())n.get=function(a,c,d,b){var e=n.createXhr(),h;e.open("GET",a,!0);if(b)for(h in b)b.hasOwnProperty(h)&&e.setRequestHeader(h.toLowerCase(),b[h]);if(k.onXhr)k.onXhr(e,a);e.onreadystatechange=function(){var b;4===e.readyState&&(b=e.status,399<b&&600>b?(b=Error(a+" HTTP status: "+b),b.xhr=e,d(b)):c(e.responseText))};e.send(null)};else if("rhino"===k.env||!k.env&&"undefined"!==typeof Packages&&"undefined"!==typeof java)n.get=function(a,c){var d,b,k=new java.io.File(a),e=java.lang.System.getProperty("line.separator"),
-k=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(k),"utf-8")),h="";try{d=new java.lang.StringBuffer;(b=k.readLine())&&(b.length()&&65279===b.charAt(0))&&(b=b.substring(1));for(d.append(b);null!==(b=k.readLine());)d.append(e),d.append(b);h=String(d.toString())}finally{k.close()}c(h)};return n});define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'<button class="dropdownTrigger">${ButtonText}<span class="dropdownArrowDown core-sprite-openarrow"></span></button><ul class="dropdownMenu"></ul>'});
-define("text!orion/webui/submenutriggerbutton.html",[],function(){return'<li class="dropdownSubMenu"><span class="dropdownTrigger dropdownMenuItem" role="menuitem" tabindex="0">${ButtonText}<span class="dropdownArrowRight core-sprite-closedarrow"></span></span><ul class="dropdownMenu"></ul></li>'});define("text!orion/webui/checkedmenuitem.html",[],function(){return'<li><label class="dropdownMenuItem"><input class="checkedMenuItem" role="menuitem" type="checkbox" />${ItemText}</label></li>'});
-define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(g,n){function p(b){this._init(b)}p.prototype={_init:function(b){this._node=n.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 l=this;if("click"===
-this._trigger)this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(b){b.target===l._node&&(l.show(),n.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){n.contains(l._node,b.target)&&(l.show(),n.stop(b))},!1);this._leaveHandler=function(b){n.contains(l._node,b.target)&&l.hide()};for(var f=0;f<b.length;f++)this._node.addEventListener(b[f],
-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 l=this;n.addAutoDismiss([this._tip,this._node],function(){l.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(){l._timeout&&(window.clearTimeout(l._timeout),l._timeout=null);l._tip.addEventListener("mouseout",function(b){n.contains(l._tip,b.target)&&(l.hide(),n.stop(b))},
-!1)},!1))}return this._tip},_positionTip:function(b,l){this._makeTipNode();"left"===b?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var f=this._node,e;for(e=n.bounds(f);f&&!e.width&&!e.height;f=f.parentNode)e=n.bounds(f);var f=n.bounds(this._tipInner),d;switch(b){case "above":d=e.top-f.height-this._tailSize-1;e=e.left-this._tailSize;break;case "below":d=e.top+e.height+this._tailSize+1;e=e.left-this._tailSize;break;case "left":d=e.top-this._tailSize/2;e=e.left-f.width-
-this._tailSize-1;break;default:d=e.top-this._tailSize/2,e=e.left+e.width+this._tailSize+1}var h=n.bounds(document.documentElement);if(d+f.height>h.height)if(l)d=h.height-f.height-1;else return!1;if(e+f.width>h.width)if(l)e=h.width-f.width-1;else return!1;if(0>e)if(l)e=4;else return!1;if(0>d)if(l)d=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),"left"===b&&(this._tail.style.left=f.width+"px"),this._tail.previousPosition=b);this._tip.style.top=d+"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,l=0;!b&&l<this._position.length;)b=this._positionTip(this._position[l]),l++;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 l=this;this._timeout=window.setTimeout(function(){l._tip.classList.remove("tooltipShowing");l._tip.removeAttribute("style");l._afterHiding&&l._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"],l=0;l<b.length;l++)this._node.removeEventListener(b[l],this._leaveHandler,!1)}}};p.prototype.constructor=p;return{Tooltip:p}});
-define("orion/commands","require orion/util orion/webui/littlelib orion/webui/dropdown text!orion/webui/dropdowntriggerbutton.html text!orion/webui/submenutriggerbutton.html text!orion/webui/checkedmenuitem.html orion/webui/tooltip".split(" "),function(g,n,p,b,l,f,e,d){function h(a){var c=a.invocation;if(c){var q=a.command;if(q.hrefCallback)return a=q.hrefCallback.call(c.handler||window,c),a.then?a.then(function(q){window.open(q)}):window.open(a),!0;if(c.commandRegistry)return c.commandRegistry._invoke(c),
-!0;if(q.onClick||q.callback)return window.setTimeout(function(){(q.onClick||q.callback).call(c.handler||window,c)},0),!0}return!1}function c(a,c){for(var q in c)if(c[q]&&(c[q].keyBinding&&c[q].command)&&c[q].keyBinding.match(a)){var x=c[q],d=x.keyBinding;if((!d.domScope||p.contains(p.node(d.domScope),a.target))&&h(x)){p.stop(a);break}}}function a(){var a={};if(y){var c,q,x;q=Object.keys(s);for(c=0;c<q.length;c++)x=q[c],a[x]=s[x];var d=y();q=Object.keys(d);for(c=0;c<q.length;c++)x=q[c],a[x]=d[x]}else a=
-s;return a}function k(d){c(d,a())}function m(a,c){a=a||window.event;if(function(q){if(n.isMac){if(q.metaKey&&!q.altKey)return!q.shiftKey&&!q.ctrlKey&&(65===q.keyCode||67===q.keyCode||86===q.keyCode||88===q.keyCode||90===q.keyCode)?!0:!1;if(q.ctrlKey)return!1}else{if(q.ctrlKey&&!q.altKey)return!q.shiftKey&&(65===q.keyCode||67===q.keyCode||86===q.keyCode||88===q.keyCode||90===q.keyCode)?!0:!1;if(q.altKey&&!q.ctrlKey)return!1}if(q["char"])return 0<q["char"].length;if(q.charCode||q.keyCode)switch(q=q.charCode||
-q.keyCode,q){case 8:case 9:case 13:case 46:return!0;default:return 32<=q&&112>q||123<q}return!1}(a)){if("true"===a.target.contentEditable)return;var q=a.target.nodeName.toLowerCase();if("input"===q)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"===q)return}c?c(a):k(a)}function r(){this._init()}
-function w(a,c,q){c.classList.add("commandImage");var d;a.imageClass?a.addImageClassToElement?c.classList.add(a.imageClass):(d=document.createElement("span"),c.appendChild(d),d.classList.add(a.spriteClass),d.classList.add(a.imageClass)):(d=new Image,d.alt=a.name,d.name=q,d.id=q,d.src=a.image,c.appendChild(d));return d}function v(a,c,q,d,b){this.commandRegistry=b;this.handler=a;this.items=c;this.userData=q;this.command=d;d.parameters&&(this.parameters=d.parameters.makeCopy());this.id=d.id}function t(a){this._init(a)}
-var y=null,s={};r.prototype={setProxy:function(a){this.proxy=a},setKeyBindings:function(a){this.bindings=a},_init:function(){var a=this;document.addEventListener("keydown",function(c){return m(c,function(q){var c=a.proxy,d=a.bindings;if(d&&c)for(var b=0;b<d.length;b++)d[b].match(q)&&(c.processKey({type:q.type,keyCode:q.keyCode,altKey:q.altKey,ctrlKey:q.ctrlKey,metaKey:q.metaKey,shiftKey:q.shiftKey}),p.stop(q))})})}};window.document.addEventListener("keydown",m,!1);v.prototype={collectsParameters:function(){return this.commandRegistry&&
-this.commandRegistry.collectsParameters()},makeCopy:function(a){var c=new v(this.handler,this.items,this.userData,this.command,this.commandRegistry);c.domNode=this.domNode;c.domParent=this.domParent;a?c.parameters=a.makeCopy():this.parameters&&(c.parameters=this.parameters.makeCopy());return c}};v.prototype.constructor=v;t.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||g.toUrl&&g.toUrl("images/none.png");this.imageClass=a.imageClass;this.addImageClassToElement=a.addImageClassToElement;this.selectionClass=a.selectionClass;this.spriteClass=a.spriteClass||"commandSprite";this.visibleWhen=a.visibleWhen;this.parameters=a.parameters;this.isEditor=a.isEditor},populateChoicesMenu:function(a,c,q,d,b){this.getChoices(c,q,d).forEach(function(q){if(q.name){var d=document.createElement("li");a.appendChild(d);var x=document.createElement("span");
-x.tabIndex=0;x.role="menuitem";x.classList.add("dropdownMenuItem");var k=document.createTextNode(q.name);x.appendChild(k);d.appendChild(x);x.choice=q;x.addEventListener("click",function(q){q.target.choice&&q.target.choice.callback.call(q.target.choice,c)},!1);x.addEventListener("keydown",function(q){(q.keyCode===p.KEY.ENTER||q.keyCode===p.KEY.SPACE)&&q.target.choice&&q.target.choice.callback.call(q.target.choice,c)},!1)}else b._generateMenuSeparator(a)})},getChoices:function(a,c,q){return this.choiceCallback?
-this.choiceCallback.call(c,a,q):null},makeChoiceCallback:function(a,c){return function(q){a.callback&&a.callback.call(a,c,q)}},hasImage:function(){return this.imageClass||this.image!==g.toUrl("images/none.png")}};t.prototype.constructor=t;return{Command:t,CommandInvocation:v,createDropdownMenu:function(a,c,q,d,k,r,m,e){a=p.node(a);if(!a)throw"no parent node was specified";var h=document.createRange();h.selectNode(a);h=h.createContextualFragment(l);p.processTextNodes(h,{ButtonText:c});a.appendChild(h);
-a=a.lastChild;h=a.previousSibling;d?h.classList.add(d):(h.classList.add("orionButton"),h.classList.add("commandButton"));k&&(r||(h.textContent="",h.setAttribute("aria-label",c)),w({spriteClass:"commandSprite",imageClass:k},h,c),h.classList.add("orionButton"));h.dropdown=new b.Dropdown({dropdown:a,populate:q,selectionClass:m,positioningNode:e});a.dropdown=h.dropdown;return{menuButton:h,menu:a,dropdown:h.dropdown}},createCheckedMenuItem:function(a,c,q,d){a=p.node(a);if(!a)throw"no parent node was specified";
-var b=document.createRange();b.selectNode(a);b=b.createContextualFragment(e);p.processTextNodes(b,{ItemText:c});a.appendChild(b);a=p.$(".checkedMenuItem",a.lastChild);a.checked=q;a.addEventListener("change",d,!1);return a},createCommandItem:function(a,c,q,x,b,k,r){var m,k=k||!c.name&&c.hasImage();if(c.hrefCallback)m=document.createElement("a"),m.id=x,k&&c.hasImage()?w(c,m,x):(m.className="commandLink",m.appendChild(document.createTextNode(c.name))),r=c.hrefCallback.call(q.handler,q),r.then?r.then(function(q){m.href=
-q}):m.href=r?r:"#";else{m=document.createElement("button");m.className="orionButton";k?c.hasImage()?(w(c,m,x),c.name&&m.setAttribute("aria-label",c.name)):(m.classList.add("commandButton"),m.classList.add("commandMissingImageButton"),m.appendChild(document.createTextNode(c.name))):(m.classList.add("commandButton"),x=document.createTextNode(c.name),m.appendChild(x));var e=r||c.callback;e&&(c.onClick=e,m.addEventListener("click",function(){e.call(q.handler,q)},!1))}"ul"===a.nodeName.toLowerCase()?(r=
-document.createElement("li"),a.appendChild(r),a=r):m.classList.add("commandMargins");a.appendChild(m);c.tooltip&&(m.commandTooltip=new d.Tooltip({node:m,text:c.tooltip,position:["above","below","right","left"]}));b&&(s[c.id]={keyBinding:b,command:c,invocation:q});return m},createCommandMenuItem:function(a,c,q,d,b){var k,r=a.dropdown;if(c.hrefCallback)k=document.createElement("a"),k.appendChild(document.createTextNode(c.name)),b=c.hrefCallback.call(q.handler,q),b.then?b.then(function(q){k.href=q}):
-k.href=b?b:"#",k.addEventListener("keydown",function(q){(q.keyCode===p.KEY.ENTER||q.keyCode===p.KEY.SPACE)&&k.click()},!1);else{k=document.createElement("span");k.tabIndex=0;k.appendChild(document.createTextNode(c.name));var m=b||c.callback;m&&(c.onClick=m,k.addEventListener("click",function(){r.close(!0);m.call(q.handler,q)},!1),k.addEventListener("keydown",function(q){if(q.keyCode===p.KEY.ENTER||q.keyCode===p.KEY.SPACE)q.preventDefault(),k.click()},!1))}k.className="dropdownMenuItem";k.role="menuitem";
-b=document.createElement("li");a.appendChild(b);b.appendChild(k);d&&(s[c.id]={keyBinding:d,command:c,invocation:q});return k},executeBinding:h,setKeyBindingProvider:function(a){y=a},localKeyBindings:s,CommandsProxy:r,getKeyBindings:a,processKey:k,_testMethodProcessKey:c}});
-define("orion/explorers/explorer","i18n!orion/nls/messages require orion/webui/littlelib orion/webui/treetable orion/explorers/explorerNavHandler orion/commands".split(" "),function(g,n,p,b,l,f){var n={},e=function(d,b,c,a){this.registry=d;this.renderer=c;this.selection=b;this.commandService=a;this.renderer&&(this.renderer.explorer=this);this.myTree=null};e.prototype={destroy:function(){this._navHandler&&this._navHandler.destroy();this.model&&this.model.destroy();this.myTree&&this.myTree.destroy();
-this.destroyed=!0},changedItem:function(d,b){this.myTree&&this.myTree.refresh.bind(this.myTree)(d,b,!0)},updateCommands:function(d){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(d)},makeNewItemPlaceHolder:function(d,b,c,a){d=this.getRow(d);if(c)return d=d.childNodes[c],d.appendChild(document.createElement("br")),a=document.createElement("span"),a.id=b+"placeHolderRow",d.appendChild(a),{tempNode:a,refNode:a};if(d){var k=document.createElement("tr");k.id=b+"placeHolderRow";
-c=document.createElement("td");c.id=b+"placeHolderCol";k.appendChild(c);a?(d.parentNode.insertBefore(k,d.nextSibling),d=parseInt(d.firstChild.style.paddingLeft),c.style.paddingLeft=this.myTree.getIndent()+d+"px"):d.appendChild(k);a=p.node(b+"placeHolderRow");d=p.node(b+"placeHolderCol");if(a&&d)return{tempNode:a,refNode:d}}return null},getRow:function(d){if(d=this.model.getId(d))return p.node(d)},collapseAll:function(){for(var d=this._navHandler.getTopLevelNodes(),b=0;b<d.length;b++)this.myTree.collapse(d[b])},
-expandAll:function(d){if(d)this._expandRecursively(d);else if(this._navHandler)for(var d=this._navHandler.getTopLevelNodes(),b=0;b<d.length;b++)this._expandRecursively(d[b])},_expandRecursively:function(d){if(this._navHandler&&this._navHandler.isExpandable(d)){var b=this;this.myTree.expand(d,function(){b.model.getChildren(d,function(c){if(!(void 0===c||null===c))for(var a=c.length,d=0;d<a;d++)b._expandRecursively(c[d])})})}},createTree:function(d,e,c){d="string"===typeof d?d:d.id||d;this.selection&&
-this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var a=d+"innerTree",k=p.node(a);k&&p.empty(k);e&&(e.rootId=a);this.model=e;this._parentId=d;this._treeOptions=c;if(!c||c&&!c.noSelection)this.selectionPolicy=c?c.selectionPolicy:"",this._navDict=new l.ExplorerNavDict(this.model);this.myTree=new b.TableTree({id:a,model:e,parent:d,onComplete:c?c.onComplete:void 0,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:c?!!c.showRoot:
-!1,indent:c?c.indent:void 0,onCollapse:c?c.onCollapse:void 0,navHandlerFactory:c?c.navHandlerFactory:void 0,tableElement:c?c.tableElement:void 0,tableBodyElement:c?c.tableBodyElement:void 0,tableRowElement:c?c.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 d=this.getNavHandler(),b=[];
-if(d&&this.getNavDict())for(var c=d.getSelection(),a=0;a<c.length;a++){var k=d.getRowDiv(c[a]);k&&k.parentNode&&(k=this.getNavDict().getValue(this.model.getId(c[a])),k.model&&b.push(k.model))}this.selection.setSelections(b)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:null},initNavHandler:function(){var d=this._treeOptions;if(!d||d&&!d.noSelection){this.getNavHandler()||(this._navHandler=d&&d.navHandlerFactory&&"function"===typeof d.navHandlerFactory.createNavHandler?
-d.navHandlerFactory.createNavHandler(this,this._navDict,d):new l.ExplorerNavHandler(this,this._navDict,{getChildrenFunc:d?d.getChildrenFunc:null,setFocus:d&&d.setFocus,selectionPolicy:d?d.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);d&&d.setFocus&&b.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,
-checkbox:!1};n.Explorer=e;n.createExplorerCommands=function(d,b){function c(a){return"function"===typeof a.getItemCount&&0<a.getItemCount()?b?b(a):!0:!1}var a=new f.Command({tooltip:g["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return c(a)},callback:function(a){a.items.expandAll()}}),k=new f.Command({tooltip:g["Collapse all"],imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",
-visibleWhen:function(a){return c(a)},callback:function(a){a.items.collapseAll()}});d.addCommand(a);d.addCommand(k)};e=function(d,b,c){this.rootPath=d;this.fetchItems=b;this.idPrefix=c||""};e.prototype={destroy:function(){this.destroyed=!0},getRoot:function(d){var b=this;this.fetchItems(this.rootPath).then(function(c){b.root=c;d(c)})},getChildren:function(d,b){d.Children?b(d.Children):d.ChildrenLocation?this.fetchItems(d.ChildrenLocation).then(function(c){d.Children=c;b(c)}):b([])},getId:function(d){if(d.Location===
-this.root.Location)return this.rootId;for(var d=d.Location.replace(/[\\\/]/g,""),b=this.idPrefix,c=0;c<d.length;c++)b=d[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?b+d.charCodeAt(c):b+d[c];return b}};n.ExplorerModel=e;e=function(d,b,c){this.rootPath=d;this.fetchItems=b;this.root=c};e.prototype=new n.ExplorerModel;e.prototype.getRoot=function(d){if(this.root)d(this.root);else{var b=this;this.fetchItems(this.rootPath).then(function(c){b.root=c;d(c)})}};e.prototype.getChildren=function(d,b){d===this.root?b(this.root):
-b([])};n.ExplorerFlatModel=e;e=function(d,b){this.explorer=b;this._init(d);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._progressImageClass="core-sprite-progress";this._twistieSpriteClass="modelDecorationSprite"};e.prototype={_init:function(d){d&&(this._useCheckboxSelection=void 0===d.checkbox?!1:d.checkbox,this.selectionPolicy=d.singleSelection?"singleSelection":"",this._cachePrefix=d.cachePrefix,this.getCheckedFunc=d.getCheckedFunc,this.onCheckedFunc=
-d.onCheckedFunc,this._highlightSelection=!0,this._treeTableClass=d.treeTableClass||"treetable",!1===d.highlightSelection&&(this._highlightSelection=!1),this.actionScopeId||(this.actionScopeId=d.actionScopeId),this.commandService||(this.commandService=d.commandService))},getLabelColumnIndex:function(){return this.explorer.checkbox?1:0},initTable:function(d,b){this.tableTree=b;p.empty(d);this._treeTableClass&&d.classList.add(this._treeTableClass);this.renderTableHeader(d)},getActionsColumn:function(d,
-b,c,a,k){var c=c||"tool",m=document.createElement("td");m.id=b.id+"actionswrapper";a&&m.classList.add(a);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,m,d,this.explorer,c,null,k&&this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(d,!0):null):window.console.log("Warning, no command service or action scope was specified.  No commands rendered.");return m},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},
-getCheckboxColumn:function(d,b){if(this._useCheckboxSelection){var c=document.createElement("td"),a=document.createElement("span");a.id=this.getCheckBoxId(b.id);a.classList.add("core-sprite-check");a.classList.add("selectionCheckmarkSprite");a.rowId=b.id;this.getCheckedFunc&&(a.checked=this.getCheckedFunc(d),a.checked?(this._highlightSelection&&b.classList.add("checkedRow"),a.classList.add("core-sprite-check_on")):(this._highlightSelection&&b.classList.remove("checkedRow"),a.classList.remove("core-sprite-check_on")));
-c.appendChild(a);var k=this;a.addEventListener("click",function(a){k.onCheck(b,a.target,a.target.checked?!1:!0,!0)},!1);return c}},getCheckBoxId:function(d){return d+"selectedState"},onCheck:function(d,b,c,a,k){(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,a);this.explorer.getNavHandler()&&k&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(d.id).model,!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var d=
-this.explorer.getNavHandler().getSelectionIds(),b=this._getUIStatePreferencePath();b&&window.sessionStorage&&(window.sessionStorage[b+"selection"]=JSON.stringify(d))}},_restoreSelections:function(d){var b=this.explorer.getNavDict(),c=this.explorer.getNavHandler();if(c&&(b&&"cursorOnly"!==c.getSelectionPolicy())&&(d=window.sessionStorage[d+"selection"],"string"===typeof d&&(d=0<d.length?JSON.parse(d):null),d)){for(var a=[],c=0;c<d.length;c++){var k=b.getValue(d[c]);if(k&&(k.rowDomNode&&k.model)&&(a.push(k.model),
-this._highlightSelection&&k.rowDomNode.classList.add("checkedRow"),k=p.node(this.getCheckBoxId(k.rowDomNode.id))))k.checked=!0,k.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(a),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(d){window.sessionStorage[d+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(d){var b=!1,c=window.sessionStorage[d+"expanded"];"string"===
-typeof c&&(c=0<c.length?JSON.parse(c):null);var a;if(c)for(a=0;a<c.length;a++)if(p.node(c[a])){this._expanded.push(c[a]);var k=this;this.tableTree.expand(c[a],function(){k._restoreSelections(d)});b=!0}return!b},_getUIStatePreferencePath:function(){if(this.explorer){var d=this.explorer.getRootPath();if(this._cachePrefix&&d)return d=d.replace(/[^\.\:\-\_0-9A-Za-z]/g,""),"/"+this._cachePrefix+"/"+d+"/uiState"}return null},expandCollapseImageId:function(d){return d+"__expand"},updateExpandVisuals:function(d,
-b){var c=p.node(this.expandCollapseImageId(d.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(d,b,c,a){var k=document.createElement("span");k.id=this.expandCollapseImageId(d.id);b.appendChild(k);k.classList.add(this._twistieSpriteClass);k.classList.add(this._collapseImageClass);
-if(c){var m=document.createElement("span");b.appendChild(m);m.classList.add(a||"imageSprite");m.classList.add(c)}var r=this;k.onclick=function(){if(!r.explorer.getNavHandler().isDisabled(d)){r.tableTree.toggle(d.id);if(r.tableTree.isExpanded(d.id))r._expanded.push(d.id),r.explorer.postUserExpand&&r.explorer.postUserExpand(d.id);else for(var a in r._expanded)if(r._expanded[a]===d.id){r._expanded.splice(a,1);break}(a=r._getUIStatePreferencePath())&&window.sessionStorage&&r._storeExpansions(a)}};return k},
-render:function(d,b){b.classList.add("navRow");this.renderRow(d,b)},rowsChanged:function(){"cursorOnly"!==this.explorer.selectionPolicy&&(this.explorer.refreshSelection(),this.explorer.initNavHandler())},updateCommands:function(){if(this.commandService)for(var d=p.$$array(".treeTableRow"),b=0;b<d.length;b++){var c=d[b],a=p.node(c.id+"actionswrapper");this.commandService.destroy(a);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,a,c._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=
-[];var b=this._getUIStatePreferencePath();b&&window.sessionStorage&&this._restoreExpansions(b)&&this._restoreSelections(b)}};n.ExplorerRenderer=e;e=function(b,e){this._init(b);this.explorer=e};e.prototype=new n.ExplorerRenderer;e.prototype.renderTableHeader=function(b){var e=document.createElement("thead"),c=document.createElement("tr");e.classList.add("navTableHeading");this._useCheckboxSelection&&c.appendChild(this.initCheckboxColumn(b));for(var a=0,k=this.getCellHeaderElement(a);k;)0<k.innerHTML.length&&
-k.classList.add("navColumn"),c.appendChild(k),k=this.getCellHeaderElement(++a);e.appendChild(c);0<a&&b.appendChild(e)};e.prototype.renderRow=function(b,e){e.verticalAlign="baseline";e.classList.add("treeTableRow");var c=this.explorer.getNavDict();if(c){c.addRow(b,e);var a=this;e.addEventListener("click",function(c){if(a.explorer.getNavHandler())a.explorer.getNavHandler().onClick(b,c)},!1)}if(c=this.getCheckboxColumn(b,e))c.classList.add("checkColumn"),e.appendChild(c);for(var c=0,k=this.getCellElement(c,
-b,e);k;)e.appendChild(k),0===c?this.getPrimColumnStyle?k.classList.add(this.getPrimColumnStyle(b)):k.classList.add("navColumn"):this.getSecondaryColumnStyle?k.classList.add(this.getSecondaryColumnStyle()):k.classList.add("secondaryColumn"),k=this.getCellElement(++c,b,e)};e.prototype.getCellHeaderElement=function(){};e.prototype.getCellElement=function(){};n.SelectionRenderer=e;e=function(b,e,c){this.items=b;this.getKey=c;this.idPrefix=e;this.root={children:b}};e.prototype=new n.ExplorerModel;e.prototype.getRoot=
-function(b){b(this.root)};e.prototype.getId=function(b){for(var b=this.getKey(b).replace(/[\\\/]/g,""),e="",c=0;c<b.length;c++)e=b[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?e+b.charCodeAt(c):e+b[c];return this.idPrefix+e};e.prototype.getChildren=function(b,e){b===this.root?e(this.items):e([])};n.SimpleFlatModel=e;return n});
-define("orion/explorers/explorer-table","i18n!orion/navigate/nls/messages orion/Deferred orion/webui/littlelib orion/i18nUtil orion/fileUtils orion/explorers/explorer orion/EventTarget orion/objects orion/util".split(" "),function(g,n,p,b,l,f,e,d,h){function c(a,c,b,d,k,m){this.registry=a;this.root=c;this.fileClient=b;this.idPrefix=d||"";this.excludeFiles=!!k;this.excludeFolders=!!m}function a(a){e.attach(this);this.registry=a.serviceRegistry;this.treeRoot=a.treeRoot;this.selection=a.selection;this.fileClient=
-a.fileClient;this.excludeFiles=a.excludeFiles;this.excludeFolders=a.excludeFolders;this.navHandlerFactory=a.navHandlerFactory;this.parentId=a.parentId;this.renderer=a.rendererFactory(this);this.dragAndDrop=a.dragAndDrop;this.setFocus=a.setFocus;this.myTree=this.model=null;this._hookedDrag=this.checkbox=!1;var c=a.modelEventDispatcher?a.modelEventDispatcher:new e;this.modelEventDispatcher=c;var b=this;this._modelListeners={};"copy copyMultiple create delete deleteMultiple import move moveMultiple".split(" ").forEach(function(a){c.addEventListener(a,
-b._modelListeners[a]=b.modelHandler[a].bind(b))});this._clickListener=function(a){if("A"===a.target.tagName){for(a=a.target;a&&!a._item;)a=a.parentNode;if(a&&a._item)b.onLinkClick({type:"linkClick",item:a._item})}};(a=p.node(this.parentId))&&a.addEventListener("click",this._clickListener);var d=this.renderer;this.registry&&this.registry.registerService("orion.cm.managedservice",{updated:function(a){a=a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?"_blank":"_self":"_self";d.setTarget&&d.setTarget(a)}},
-{pid:"nav.config"})}c.prototype=new f.ExplorerModel;d.mixin(c.prototype,{getRoot:function(a){a(this.root)},processParent:function(a,c){if(this.excludeFiles||this.excludeFolders){var b=[],d;for(d in c)if(!(c[d].Directory?this.excludeFolders:this.excludeFiles))b.push(c[d]),c[d].parent=a;c=b}else for(b in c)c[b].parent=a;a.children=c;a.children.sort(function(a,c){var b=a.Directory;if(b!==c.Directory)return b?-1:1;var b=a.Name&&a.Name.toLowerCase(),d=c.Name&&c.Name.toLowerCase();return b<d?-1:b>d?1:0});
-return c},getChildren:function(a,c){var b=this;if(a.children)c(a.children);else if(void 0!==a.Directory&&!1===a.Directory)c([]);else if(a.Location){var d=null;this.registry&&(d=this.registry.getService("orion.page.progress"));(d?d.progress(this.fileClient.fetchChildren(a.ChildrenLocation),g["Fetching children of "]+a.Name):this.fileClient.fetchChildren(a.ChildrenLocation)).then(function(d){b.destroyed||c(b.processParent(a,d))},function(){c([])})}else c([])},hasChildren:function(){var a=!1;this.root.Children&&
-(a=0<this.root.Children.length);return a}});c.prototype.constructor=c;var k,m;a.prototype=Object.create(f.Explorer.prototype);d.mixin(a.prototype,{destroy:function(){var a=this;Object.keys(this._modelListeners).forEach(function(c){a.modelEventDispatcher.removeEventListener(c,a._modelListeners[c])});var c=p.node(this.parentId);c&&c.removeEventListener("click",this._clickListener);f.Explorer.prototype.destroy.call(this)},onLinkClick:function(a){this.dispatchEvent(a)},onModelCreate:function(a){return this.changedItem(a.parent,
-!0)},onModelCopy:function(a){var c=this,b={};(a.items||[a]).forEach(function(a){a=(a=a.parent)||c.treeRoot;b[a.Location]=a});return n.all(Object.keys(b).map(function(a){return c.changedItem(b[a],!0)}))},onModelMove:function(a){var c=this,b={};(a.items||[a]).forEach(function(a){if(c.treeRoot.Location===a.Location){var d=c.treeRoot,a=a.newValue,a=a.ChildrenLocation?a:this.fileClient.read(a.ContentLocation,!0);return n.when(a,function(a){c.dispatchEvent({type:"rootMoved",oldValue:d,newValue:a});c.loadResourceList(a)})}var k=
-a.oldValue.parent,k=k||c.treeRoot;b[k.Location]=k;k=(k=a.parent)||c.treeRoot;b[k.Location]=k;a.oldValue.Directory&&(a.newValue&&c.isExpanded(a.oldValue))&&(b[a.newValue.Location]=a.newValue)});return n.all(Object.keys(b).map(function(a){return c.changedItem(b[a],!0)}))},onModelDelete:function(a){var a=a.items||[a],c=this,b;if(a.some(function(a){return a.oldValue.Location===c.treeRoot.Location?(b=a.parent,!0):!1}))return this.loadResourceList(b);var d={};a.forEach(function(a){a=a.parent;d[a.Location]=
-a});return n.all(Object.keys(d).map(function(a){return c.changedItem(d[a],!0)}))},modelHandler:{copy:function(a){if(!a.count)return this.onModelCopy(a)},copyMultiple:function(a){return this.onModelCopy(a)},create:function(a){return this.onModelCreate(a)},"delete":function(a){if(!a.count)return this.onModelDelete(a)},deleteMultiple:function(a){return this.onModelDelete(a)},"import":function(a){return this.changedItem(a.target,!0)},move:function(a){if(!a.count)return this.onModelMove(a)},moveMultiple:function(a){return this.onModelMove(a)}},
-_makeDropTarget:function(a,c,d){function e(c,q,d,k,m,h){q=q||"";if(c.isFile)l.isAtRoot(d.Location)?k.registry&&k.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:g["You cannot copy files directly into the workspace.  Create a folder first."]}):c.file(function(a){m(d,a,k,a.name.indexOf(".zip")===a.name.length-4&&window.confirm(b.formatMessage(g["Unzip ${0}?"],a.name)))});else if(c.isDirectory){var f=c.createReader(),w=function(a){f.readEntries(function(b){for(var d=
-0;d<b.length;d++)e(b[d],q+c.name+"/",a,k,m,h)})},s=null;k.registry&&(s=k.registry.getService("orion.page.progress"));l.isAtRoot(d.Location)?(s?s.progress(h.createProject(d.ChildrenLocation,c.name),b.formatMessage(g["Creating ${0}"],c.name)):h.createProject(d.ChildrenLocation,c.name)).then(function(a){k.loadResourceList(k.treeRoot.Path,!0);(s?s.progress(h.read(a.ContentLocation,!0),g["Loading "]+a.name):h.read(a.ContentLocation,!0)).then(function(a){w(a)})}):(s?s.progress(h.createFolder(d.Location,
-c.name),b.formatMessage(g["Creating ${0}"],c.name)):h.createFolder(d.Location,c.name)).then(function(q){k.modelEventDispatcher.dispatchEvent({type:"create",parent:a,newValue:q});w(q)})}}if(this.dragAndDrop){var f=this,s=this.dragAndDrop,u=function(a){k=a.target};d&&(this._oldDragStart&&c.removeEventListener("dragstart",this._oldDragStart,!1),this._oldDragStart=u);c.addEventListener("dragstart",u,!1);u=function(){k=null};d&&(this._oldDragEnd&&c.removeEventListener("dragend",this._oldDragEnd,!1),this._oldDragEnd=
-u);c.addEventListener("dragend",u,!1);u=function(a){c.classList.remove("dragOver");a.preventDefault();a.stopPropagation()};d&&(this._oldDragLeave&&c.removeEventListener("dragleave",this._oldDragLeave,!1),this._oldDragLeave=u);c.addEventListener("dragleave",u,!1);u=function(a){if(k)m=a.dataTransfer.dropEffect=(h.isMac?a.altKey:a.ctrlKey)?"copy":"move";else if(!h.isIE&&("all"===a.dataTransfer.effectAllowed||"uninitialized"===a.dataTransfer.effectAllowed||0<=a.dataTransfer.effectAllowed.indexOf("copy")))a.dataTransfer.dropEffect=
-"copy";c.classList.add("dragOver");p.stop(a)};d&&(this._oldDragEnter&&c.removeEventListener("dragenter",this._oldDragEnter,!1),this._oldDragEnter=u);c.addEventListener("dragenter",u,!1);u=function(a){if(k)m=a.dataTransfer.dropEffect=(h.isMac?a.altKey:a.ctrlKey)?"copy":"move";else if(!h.isIE&&("all"===a.dataTransfer.effectAllowed||"uninitialized"===a.dataTransfer.effectAllowed||0<=a.dataTransfer.effectAllowed.indexOf("copy")))a.dataTransfer.dropEffect="copy";p.stop(a)};d&&!this._oldDragOver&&(c.addEventListener("dragover",
-u,!1),this._oldDragOver=u);u=function(d){var q;c.classList.remove("dragOver");if(k){q=f.fileClient;for(var x=k,A;x;){if(x._item){A=x._item;break}x=x.parentNode}if(!A)return;var B=null;f.registry&&(B=f.registry.getService("orion.page.progress"));var h="copy"===m,x=h?q.copyFile:q.moveFile;(B?B.showWhile(x.apply(q,[A.Location,a.Location]),b.formatMessage(g[h?"Copying ${0}":"Moving ${0}"],A.Location)):x.apply(q,[A.Location,a.Location])).then(function(q){f.modelEventDispatcher.dispatchEvent({type:h?"copy":
-"move",oldValue:A,newValue:q,parent:a})},function(a){B?B.setProgressResult(a):window.console.log(a)})}else if(d.dataTransfer.items&&0<d.dataTransfer.items.length)for(q=0;q<d.dataTransfer.items.length;q++)x=null,"function"===typeof d.dataTransfer.items[q].getAsEntry?x=d.dataTransfer.items[q].getAsEntry():"function"===typeof d.dataTransfer.items[q].webkitGetAsEntry&&(x=d.dataTransfer.items[q].webkitGetAsEntry()),x&&e(x,null,a,f,s,f.fileClient);else if(d.dataTransfer.files&&0<d.dataTransfer.files.length)for(q=
-0;q<d.dataTransfer.files.length;q++)x=d.dataTransfer.files[q],!x.length&&(!x.type||""===x.type)?f.registry&&f.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:b.formatMessage(g["Did not drop ${0}.  Folder drop is not supported in this browser."],x.name)}):l.isAtRoot(a.Location)?f.registry&&f.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:g["You cannot copy files directly into the workspace.  Create a folder first."]}):s(a,
-x,f,x.name.indexOf(".zip")===x.name.length-4&&window.confirm(b.formatMessage(g["Unzip ${0}?"],x.name)));p.stop(d)};d&&(this._oldDrop&&c.removeEventListener("drop",this._oldDrop,!1),this._oldDrop=u);c.addEventListener("drop",u,!1)}},createModel:function(){return new c(this.registry,this.treeRoot,this.fileClient,this.parentId,this.excludeFiles,this.excludeFolders)},changedItem:function(a,c){if(this.treeRoot&&this.treeRoot.Location===a.Location)return this.loadResourceList(this.treeRoot,c);var b=this,
-d=new n;a.children=null;this.model.getChildren(a,function(k){b.getNavHandler();b.myTree.refresh.bind(b.myTree)(a,k,c);d.resolve(k)});return d},showItem:function(a,c){var b=new n;if(!a||!this.model||!this.myTree||!this.myTree.showRoot&&a.Location===this.treeRoot.Location)return b.reject();var d=this.getRow(a);if(d)b.resolve(d._item||a);else return a.Parents&&0<a.Parents.length?(a.Parents[0].Parents=a.Parents.slice(1),this.expandItem(a.Parents[0],c).then(function(c){var b=this.getRow(a);return!b?this.changedItem(c,
-!0).then(function(){var c=this.getRow(a);return c?c._item:(new n).reject()}.bind(this)):b._item||a}.bind(this))):void 0===c||c?this.reroot(a):b.reject();return b},expandItem:function(a,c){var b=new n;this.showItem(a,c).then(function(a){this.myTree.isExpanded(a)?b.resolve(a):this.myTree.expand(this.model.getId(a),function(){b.resolve(a)})}.bind(this),b.reject);return b},reveal:function(a,c){return this.showItem(a,c).then(function(a){var c=this.getNavHandler();c&&(c.cursorOn(a,!0),c.setSelection(a));
-return a}.bind(this))},reroot:function(){return(new n).reject()},isExpanded:function(a){a=this.model.getId(a);return this.renderer.tableTree.isExpanded(a)},getNameNode:function(a){if(a=this.model.getId(a))return p.node(a+"NameLink")},scopeUp:function(){},scopeDown:function(){},loadResourceList:function(a,c,b){a&&"object"===typeof a&&(a=a.ChildrenLocation||a.ContentLocation);a=l.makeRelative(a);if(!c&&a===this._lastPath)return(new n).resolve(this.treeRoot);this._lastPath=a;var d=this;return c||a!==
-this.treeRoot.Path?this.load(this.fileClient.loadWorkspace(a),g["Loading "]+a).then(function(){d.treeRoot.Path=a;"function"===typeof b&&b();d.dispatchEvent({type:"rootChanged",root:d.treeRoot});return(new n).resolve(d.treeRoot)},function(a){d.treeRoot.Path=null;d.dispatchEvent({type:"rootChanged",root:d.treeRoot});return(new n).reject(a)}):(new n).resolve(d.treeRoot)},load:function(a,c,b){var d=p.node(this.parentId),k=p.node("progress");k||(k=document.createElement("div"),k.id="progress",p.empty(d),
-d.appendChild(k));p.empty(k);var m=setTimeout(function(){p.empty(k);k.appendChild(document.createTextNode(c))},500),e=this;return n.when(a,function(a){clearTimeout(m);if(!e.destroyed){e.treeRoot={};for(var q in a)e.treeRoot[q]=a[q];e.model=e.createModel();e.dragAndDrop&&(e._hookedDrag?e._makeDropTarget(e.treeRoot,d,!0):(a=(a=d&&("draggable"in d||"ondragstart"in d&&"ondrop"in d))&&!(!window.File||!window.FileList||!window.FileReader),e._hookedDrag=!0,a?e._makeDropTarget(e.treeRoot,d,!0):(e.dragAndDrop=
-null,window.console.log("Local file drag and drop is not supported in this browser."))));var c=new n;e.createTree(e.parentId,e.model,{onComplete:function(a){c.resolve(a)},navHandlerFactory:e.navHandlerFactory,setFocus:"undefined"===typeof e.setFocus?!0:e.setFocus,selectionPolicy:e.renderer.selectionPolicy,onCollapse:function(a){if(e.getNavHandler())e.getNavHandler().onCollapse(a)}});return c.then(function(){if("function"===typeof b)try{b()}catch(a){e.registry&&e.registry.getService("orion.page.message").setErrorMessage(a)}if("function"===
-typeof e.onchange)e.onchange(e.treeRoot);return e.treeRoot})}},function(a){clearTimeout(m);e.registry&&e.registry.getService("orion.page.message").setProgressResult(a);return(new n).reject(a)})},onchange:function(){}});a.prototype.constructor=a;return{FileExplorer:a,FileModel:c}});
-define("orion/explorers/navigationUtils",[],function(){function g(g,b){!n&&g&&(g.push({domNode:b}),b.tabIndex=-1,b.style.outline="none")}var n=-1!==navigator.userAgent.indexOf("iPad");return{addNavGrid:function(p,b,l){p&&(p=p.getGridNavHolder(b,!0))&&g(p,l)},generateNavGrid:g,removeNavGrid:function(g,b){if(g)for(var l=0;l<g.length;l++)if(g[l].domNode===b){g.splice(l,1);break}}}});define("orion/extensionCommands",[],function(){return{getOpenWithCommands:function(){return[]}}});
-define("orion/URITemplate",[],function(){function g(a){this._text=a}function n(a){return a.replace("%25","%")}function p(a,b){if("U"===b)return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if("U+R"===b)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(c,n);if("U+R-,"===b)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+b);}function b(a,c,b){for(var d=
-[],e=0;e<a.length;e++)"undefined"!==typeof a[e]&&d.push(p(a[e],c));return d.join(b)}function l(a,c,b,d){for(var e=Object.keys(a),l=[],h=0;h<e.length;h++)"undefined"!==typeof a[e[h]]&&l.push(p(e[h],c)+b+p(a[e[h]],c));return l.join(d)}function f(a){if(0===a.length)throw Error("Invalid Expression: 0 length expression");(this._operator=d[a[0]])?a=a.substring(1):this._operator=d.NUL;for(var c=[],b=a.split(","),e=0;e<b.length;e++){var l=b[e].match(h);if(null===l)throw Error("Bad VarSpec: "+a);c.push({name:l[1],
-explode:!!l[2],prefix:l[3]?parseInt(l[3],10):-1})}this._varSpecList=c}function e(a){for(var c=[],b=0,d=a.indexOf("{",b);-1!==d;){c.push(new g(a.substring(b,d)));b=a.indexOf("}",d+1);if(-1===b)throw Error("Invalid template: "+a);c.push(new f(a.substring(d+1,b)));b+=1;d=a.indexOf("{",b)}c.push(new g(a.substring(b)));this._templateComponents=c}var d={NUL:{first:"",sep:",",named:!1,ifemp:"",allow:"U"},"+":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R"},".":{first:".",sep:",",named:!1,ifemp:"",allow:"U"},
+g.node(this.explorer._parentId)},isExpandable:function(d){return!d?!1:g.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(d)))?!0:!1},isExpanded:function(d){return!d?!1:this.explorer.myTree.isExpanded(this.model.getId(d))},refreshSelection:function(d,a){var c=this;this.explorer.selection&&this.explorer.selection.getSelections(function(b){c._clearSelection(a);for(var k=0;k<b.length;k++)c._selections.push(b[k]);0<c._selections.length?c.cursorOn(c._selections[0],!0,!1,d):c.cursorOn(null,
+!1,!1,d);c._shiftSelectionAnchor&&0<=c._inSelection(c._shiftSelectionAnchor)||(c._shiftSelectionAnchor=null)})},refreshModel:function(d,a,c,b){this._currentColumn=0;this.topIterationNodes=[];this.model=a;this._navDict=d;this.model.getTopIterationNodes?this.topIterationNodes=this.model.getTopIterationNodes():c&&(this.topIterationNodes=c);this._modelIterator.setTree(this.topIterationNodes);!b&&this.explorer.selection&&(this.toggleCursor(this._modelIterator.cursor(),!1),this._modelIterator.reset());
+this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(d){for(var d=this.model.getId(d),a=0;a<this._selections.length;a++)if(d===this.model.getId(this._selections[a]))return a;return-1},_clearSelection:function(d){if(d)for(d=0;d<this._selections.length;d++)this._checkRow(this._selections[d],!0);this._selections=[]},getSelectionPolicy:function(){return this._selectionPolicy},setSelectionPolicy:function(d){this._selectionPolicy!==
+d&&(this._selectionPolicy=d,"cursorOnly"===this._selectionPolicy&&this._clearSelection(!0))},setSelection:function(d,a,c){"cursorOnly"===this._selectionPolicy?a&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(d,!0):this._isRowSelectable(d)&&(!a||"singleSelection"===this._selectionPolicy?(this._clearSelection(!0),this._checkRow(d,!1),this._selections.push(d),this._lastSelection=d):(a=this._inSelection(d),0<=a?(this._checkRow(d,!0),this._selections.splice(a,1)):(this._checkRow(d,!1),this._selections.push(d),
+this._lastSelection=d)),c&&(this._shiftSelectionAnchor=this._lastSelection),this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections)))},moveColumn:function(d,a){d||(d=this.currentModel());var c=this._getGridChildren(d);if(c&&1<c.length||0===a&&c){0!==a&&this.toggleCursor(d,!1);var b=this._currentColumn,k=!0,b=b+a;0>b?(this._linearGridMove&&0!==a&&(this._modelIterator.iterate(!1)?d=this.currentModel():k=!1),b=k?c.length-1:this._currentColumn):
+b>=c.length&&(this._linearGridMove&&0!==a&&(this._modelIterator.iterate(!0)?d=this.currentModel():k=!1),b=k?0:this._currentColumn);this._currentColumn=b;0!==a&&this.toggleCursor(d,!0);return!0}return!1},_getGridChildren:function(d){return this._navDict?this._navDict.getGridNavHolder(d):null},getCurrentGrid:function(d){d||(d=this.currentModel());return(d=this._getGridChildren(d))&&0<d.length?d[this._currentColumn]:null},getAriaContainerElement:function(d){for(var a=this._parentDiv,c;d&&d!==a&&"grid"!==
+(c=d.getAttribute("role"))&&"tree"!==c&&"treegrid"!==c;)d=d.parentNode;return d===a?null:d},toggleCursor:function(d,a){var c=this.getRowDiv(d),b=this.getCurrentGrid(d);b?(c&&(a?c.classList.add("treeIterationCursorRow"):c.classList.remove("treeIterationCursorRow")),b.domNode&&(c=this.getAriaContainerElement(b.domNode),a?(b.domNode.classList.add("treeIterationCursor"),c&&c.setAttribute("aria-activedescendant",b.domNode.id)):b.domNode.classList.remove("treeIterationCursor"))):c&&(a?c.classList.add("treeIterationCursorRow_Dotted"):
+c.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(d,a,c,b){var k,m;if(d||a){if(m===this._modelIterator.cursor())return;k=this._modelIterator.cursor();m=d;this._modelIterator.setCursor(m)}else k=this._modelIterator.prevCursor(),m=this._modelIterator.cursor();if(k!==m||a)if(this.toggleCursor(k,!1),!a||m){this.moveColumn(null,0);this.toggleCursor(m,!0);if((d=this.getRowDiv())&&!b){b=d.parentNode;for(a=document.documentElement;b&&
+b!==a;){var r=window.getComputedStyle(b,null);if(!r)break;r=r.getPropertyValue("overflow-y");if("auto"===r||"scroll"===r)break;b=b.parentNode}a=!0;d.offsetTop<=b.scrollTop?(a=!1,void 0===c&&(c=!1)):d.offsetTop+d.offsetHeight>=b.scrollTop+b.clientHeight&&(a=!1,void 0===c&&(c=!0));a||d.scrollIntoView(!c)}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(k,m)}},getSelection:function(){return this._selections},getSelectionIds:function(){for(var d=[],a=0;a<this._selections.length;a++)d.push(this.model.getId(this._selections[a]));
+return d},getRowDiv:function(d){d=d?d:this._modelIterator.cursor();if(!d)return null;var d=this.model.getId(d),a=this._navDict.getValue(d);return a&&a.rowDomNode?a.rowDomNode:g.node(d)},iterate:function(d,a,c,b){var k=null;if(this.topIterationNodes&&0!==this.topIterationNodes.length)if(b){b=this.currentModel();for((k=this._modelIterator.iterate(d,a))&&this._setCursorOnItem(d,c);k&&k.isNotSelectable;)(k=this._modelIterator.iterate(d,a))&&this._setCursorOnItem(d,c);k||(this.cursorOn(b,!0,!1,!0),this._setCursorOnItem(d,
+c))}else(k=this._modelIterator.iterate(d,a))&&this._setCursorOnItem(d,c)},_setCursorOnItem:function(d,a){this.cursorOn(null,!1,d);if(a){var c=this._inSelection(this._modelIterator.prevCursor()),b=this._inSelection(this._modelIterator.cursor());0<=c&&0<=b?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)}},_checkRow:function(d,a){if(this.explorer.renderer._useCheckboxSelection){var c=this.getRowDiv(d);if(c){var b=g.node(this.explorer.renderer.getCheckBoxId(c.id)),
+k=a?!b.checked:!0;if(k!==b.checked)this.explorer.renderer.onCheck(c,b,k,!0)}}else this._select(d,a)},_select:function(d){d||(d=this._modelIterator.cursor());var a=this.getRowDiv(d);a&&(0>this._inSelection(d)?a.classList.add("checkedRow"):a.classList.remove("checkedRow"))},_onModelGrid:function(d,a){var c=this._getGridChildren(d);if(c)for(var b=0;b<c.length;b++)if(a.target===c[b].domNode)return!0;return!1},onClick:function(d,a){if(this.isDisabled(this.getRowDiv(d)))g.stop(a);else{var c=g.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(d)));
+if(a.target!==c&&!("none"===this.gridClickSelectionPolicy&&this._onModelGrid(d,a)))if(this.cursorOn(d,!0,!1,!0),l)this.setSelection(d,!0);else if(this._ctrlKeyOn(a))this.setSelection(d,!0,!0);else if(a.shiftKey&&this._shiftSelectionAnchor){if(c=this._modelIterator.scan(this._shiftSelectionAnchor,d)){this._clearSelection(!0);for(var b=0;b<c.length;b++)this.setSelection(c[b],!0)}}else this.setSelection(d,!1,!0)}},onCollapse:function(d){this._modelIterator.collapse(d)&&this.cursorOn()},onUpArrow:function(d){this.iterate(!1,
+!1,d.shiftKey,!0);!this._ctrlKeyOn(d)&&!d.shiftKey&&this.setSelection(this.currentModel(),!1,!0);d.preventDefault();return!1},onDownArrow:function(d){this.iterate(!0,!1,d.shiftKey,!0);!this._ctrlKeyOn(d)&&!d.shiftKey&&this.setSelection(this.currentModel(),!1,!0);d.preventDefault();return!1},_shouldMoveColumn:function(d){var a=this.currentModel(),c=this._getGridChildren(a);return c&&1<c.length?this.isExpandable(a)?this._ctrlKeyOn(d):!0:!1},onLeftArrow:function(d){if(this._shouldMoveColumn(d))return this.moveColumn(null,
+-1),d.preventDefault(),!0;var a=this._modelIterator.cursor();if(!a)return!1;if(this.isExpandable(a)&&this.isExpanded(a))return this.explorer.myTree.collapse(a),d.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(d){if(this._shouldMoveColumn(d))return this.moveColumn(null,1),d.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)),d.preventDefault(),!1},_isRowSelectable:function(d){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(d):!0},onSpace:function(d){this.setSelection(this.currentModel(),!0,!0);d.preventDefault()},onEnter:function(d){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 c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(d),!1,!1,!1,0,null);a.domNode.dispatchEvent(c)}else if(a=this._modelIterator.cursor())if(this.explorer.renderer.getRowActionElement&&(c=this.explorer.renderer.getRowActionElement(this.model.getId(a)),c.href&&(this._ctrlKeyOn(d)?window.open(c.href):window.location.href=c.href)),this.explorer.renderer.performRowAction)return this.explorer.renderer.performRowAction(d,
+a),d.preventDefault(),!1},setIsNotSelectable:function(d,a){d.isNotSelectable=a},disableItem:function(d){var a=this.getRowDiv(d);this.isExpandable(d)&&this.isExpanded(d)&&(this._modelIterator.collapse(d),this.explorer.myTree.toggle(a.id));a.classList.remove("checkedRow");a.classList.add("disabledNavRow");this.setIsNotSelectable(d,!0)},isDisabled:function(d){return d.classList.contains("disabledNavRow")},enableItem:function(d){var a=this.getRowDiv(d);a&&(a.classList.remove("disabledNavRow"),this.setIsNotSelectable(d,
+!1))}};a.ExplorerNavHandler=e;e=function(d){this._dict={};this._model=d};e.prototype={addRow:function(d,a){var c=this._model.getId(d);this._dict[c]={model:d,rowDomNode:a}},getValue:function(d){return this._dict[d]},getGridNavHolder:function(d,a){if(!d)return null;var c=this._model.getId(d);return this._dict[c]?(!this._dict[c].gridChildren&&a&&(this._dict[c].gridChildren=[]),this._dict[c].gridChildren):null},initGridNavHolder:function(d){if(!d)return null;d=this._model.getId(d);this._dict[d]&&(this._dict[d].gridChildren=
+null)}};a.ExplorerNavDict=e;return a});
+define("orion/webui/dropdown",["require","orion/webui/littlelib","orion/EventTarget"],function(g,n,p){function a(a){p.attach(this);this._init(a)}a.prototype={_init:function(a){this._dropdownNode=n.node(a.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._populate=a.populate;this._selectionClass=a.selectionClass;this._parentDropdown=a.parentDropdown;this._positioningNode=a.positioningNode;if(!this._parentDropdown)for(var f=this._dropdownNode.parentNode;f&&document!==f;){if(f.classList&&
+f.classList.contains("dropdownMenu")){this._parentDropdown=f.dropdown;break}f=f.parentNode}this._triggerNode=a.triggerNode?a.triggerNode:n.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";if(!a.skipTriggerEventListeners){var e=this;this._triggerNode.addEventListener("click",function(d){e.toggle(d)&&n.stop(d)},!1);"span"===this._triggerNode.tagName.toLowerCase()&&this._triggerNode.addEventListener("keydown",function(d){if(d.keyCode===
+n.KEY.ENTER||d.keyCode===n.KEY.SPACE)e.toggle(),n.stop(d)},!1)}this._dropdownNode.addEventListener("keydown",this._dropdownKeyDown.bind(this),!1)},addTriggerNode:function(a){var f=this;a.addEventListener("click",function(a){f.toggle(a)&&n.stop(a)},!1)},toggle:function(a){return this.isVisible()?this.close():this.open(a)},isVisible:function(){return this._isVisible},open:function(a){var f=!1;if(!this.isVisible()){this.dispatchEvent({type:"triggered",dropdown:this,event:a});n.setFramesEnabled(!1);this._populate&&
+(this.empty(),this._populate(this._dropdownNode));var e=this.getItems();0<e.length&&(this._hookedAutoDismiss||(this._boundAutoDismiss?n.removeAutoDismiss(this._boundAutoDismiss):this._boundAutoDismiss=this._autoDismiss.bind(this),f=n.$$array(".dropdownSubMenu",this._dropdownNode),n.addAutoDismiss([this._triggerNode].concat(f),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(a),e[0].focus(),f=!0,this._parentDropdown&&this._parentDropdown.submenuOpen(this))}return f},_autoDismiss:function(a){if(this.close(!1)&&this._dropdownNode.contains(a.target))for(a=this._parentDropdown;a;)a.close(!1),a=a._parentDropdown},_positionDropdown:function(){this._dropdownNode.style.left="";this._dropdownNode.style.top="";if(this._positioningNode)this._dropdownNode.style.left=this._positioningNode.offsetLeft+
+"px";else{var a=n.bounds(this._dropdownNode),f=n.bounds(document.body);if(a.left+a.width>f.left+f.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-a.width+"px";else{var e=n.bounds(this._boundingNode(this._triggerNode)),d=n.bounds(this._triggerNode);this._dropdownNode.style.left=d.left-e.left-a.width+d.width+"px"}a=a.top+a.height-(f.top+f.height);0<a&&(this._dropdownNode.style.top=Math.floor(this._dropdownNode.style.top-a)+"px")}},_boundingNode:function(a){var f=
+window.getComputedStyle(a,null);return null===f||"absolute"===f.getPropertyValue("position")||!a.parentNode||a===document.body?a:this._boundingNode(a.parentNode)},close:function(a){var f=!1;this.isVisible()&&(this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),n.setFramesEnabled(!0),a&&this._triggerNode.focus(),this._isVisible=!1,f=!0);return f},getItems:function(){var a=
+[],f=this;n.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(e){e.parentNode.parentNode===f._dropdownNode&&a.push(e)});a.forEach(function(a){a._hasDropdownMouseover||(a.addEventListener("mouseover",function(d){a.dropdown?a.dropdown.open(d):(f._closeSelectedSubmenu(),n.stop(d))}),a._hasDropdownMouseover=!0)});return a},empty:function(){var a=this;n.$$array("li",this._dropdownNode).forEach(function(f){f.parentNode===a._dropdownNode&&f.parentNode.removeChild(f)});
+this._hookedAutoDismiss=!1},_dropdownKeyDown:function(a){if(a.keyCode===n.KEY.UP||a.keyCode===n.KEY.DOWN||a.keyCode===n.KEY.RIGHT||a.keyCode===n.KEY.ENTER||a.keyCode===n.KEY.LEFT){var f=this.getItems(),e=document.activeElement;if(f.length&&0<f.length&&e){var d=f.indexOf(e);0>d&&(d=f.indexOf(e.parentNode));0<=d&&(a.keyCode===n.KEY.UP&&0<d?(d--,f[d].focus()):a.keyCode===n.KEY.DOWN&&d<f.length-1?(d++,f[d].focus()):a.keyCode===n.KEY.ENTER||a.keyCode===n.KEY.RIGHT?e.classList.contains("dropdownTrigger")&&
+e.dropdown&&e.dropdown.open():a.keyCode===n.KEY.LEFT&&e.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&this.close(!0),n.stop(a))}}else a.keyCode===n.KEY.ESCAPE&&(this.close(!0),n.stop(a))},submenuOpen:function(a){a!==this._selectedSubmenu&&(this._closeSelectedSubmenu(),this._selectedSubmenu=a)},_closeSelectedSubmenu:function(){for(var a=this._selectedSubmenu;a;)a.close(),a=a._selectedSubmenu},destroy:function(){this.empty();this._boundAutoDismiss&&n.removeAutoDismiss(this._boundAutoDismiss)}};
+a.prototype.constructor=a;return{Dropdown:a}});
+define("text",["module"],function(g){var n,p,a=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],l=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,f=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,e="undefined"!==typeof location&&location.href,d=e&&location.protocol&&location.protocol.replace(/\:/,""),h=e&&location.hostname,c=e&&(location.port||void 0),b=[],k=g.config&&g.config()||{};n={version:"2.0.5",strip:function(b){if(b){var b=b.replace(l,""),c=b.match(f);c&&(b=c[1])}else b="";return b},
+jsEscape:function(b){return b.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:k.createXhr||function(){var b,c,d;if("undefined"!==typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!==typeof ActiveXObject)for(c=0;3>c;c+=1){d=a[c];try{b=new ActiveXObject(d)}catch(k){}if(b){a=[d];break}}return b},parseName:function(b){var c,
+d,a=!1,k=b.indexOf(".");c=0===b.indexOf("./")||0===b.indexOf("../");-1!==k&&(!c||1<k)?(c=b.substring(0,k),d=b.substring(k+1,b.length)):c=b;b=d||c;k=b.indexOf("!");-1!==k&&(a="strip"===b.substring(k+1),b=b.substring(0,k),d?d=b:c=b);return{moduleName:c,ext:d,strip:a}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(b,c,d,a){var k,e;k=n.xdRegExp.exec(b);if(!k)return!0;b=k[2];k=k[3];k=k.split(":");e=k[1];k=k[0];return(!b||b===c)&&(!k||k.toLowerCase()===d.toLowerCase())&&(!e&&!k||e===a)},finishLoad:function(c,
+d,a,e){a=d?n.strip(a):a;k.isBuild&&(b[c]=a);e(a)},load:function(b,a,l,f){if(f.isBuild&&!f.inlineText)l();else{k.isBuild=f.isBuild;var t=n.parseName(b),f=t.moduleName+(t.ext?"."+t.ext:""),g=a.toUrl(f),s=k.useXhr||n.useXhr;!e||s(g,d,h,c)?n.get(g,function(c){n.finishLoad(b,t.strip,c,l)},function(b){l.error&&l.error(b)}):a([f],function(b){n.finishLoad(t.moduleName+"."+t.ext,t.strip,b,l)})}},write:function(c,d,a){if(b.hasOwnProperty(d)){var k=n.jsEscape(b[d]);a.asModule(c+"!"+d,"define(function () { return '"+
+k+"';});\n")}},writeFile:function(b,c,d,a,k){var c=n.parseName(c),e=c.ext?"."+c.ext:"",h=c.moduleName+e,l=d.toUrl(c.moduleName+e)+".js";n.load(h,d,function(){var c=function(q){return a(l,q)};c.asModule=function(q,b){return a.asModule(q,l,b)};n.write(b,h,c,k)},k)}};if("node"===k.env||!k.env&&"undefined"!==typeof process&&process.versions&&process.versions.node)p=require.nodeRequire("fs"),n.get=function(b,c){var d=p.readFileSync(b,"utf8");0===d.indexOf("\ufeff")&&(d=d.substring(1));c(d)};else if("xhr"===
+k.env||!k.env&&n.createXhr())n.get=function(b,c,d,a){var e=n.createXhr(),h;e.open("GET",b,!0);if(a)for(h in a)a.hasOwnProperty(h)&&e.setRequestHeader(h.toLowerCase(),a[h]);if(k.onXhr)k.onXhr(e,b);e.onreadystatechange=function(){var a;4===e.readyState&&(a=e.status,399<a&&600>a?(a=Error(b+" HTTP status: "+a),a.xhr=e,d(a)):c(e.responseText))};e.send(null)};else if("rhino"===k.env||!k.env&&"undefined"!==typeof Packages&&"undefined"!==typeof java)n.get=function(b,c){var d,a,k=new java.io.File(b),e=java.lang.System.getProperty("line.separator"),
+k=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(k),"utf-8")),h="";try{d=new java.lang.StringBuffer;(a=k.readLine())&&(a.length()&&65279===a.charAt(0))&&(a=a.substring(1));for(d.append(a);null!==(a=k.readLine());)d.append(e),d.append(a);h=String(d.toString())}finally{k.close()}c(h)};return n});define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'<button class="dropdownTrigger">${ButtonText}<span class="dropdownArrowDown core-sprite-openarrow"></span></button><ul class="dropdownMenu"></ul>'});
+define("text!orion/webui/dropdowntriggerbuttonwitharrow.html",[],function(){return'<button>${ButtonText}</button><button class="dropdownTrigger"><span class="dropdownArrowDown core-sprite-openarrow"></span></button><ul class="dropdownMenu"></ul>'});define("text!orion/webui/submenutriggerbutton.html",[],function(){return'<li class="dropdownSubMenu"><span class="dropdownTrigger dropdownMenuItem" role="menuitem" tabindex="0">${ButtonText}<span class="dropdownArrowRight core-sprite-closedarrow"></span></span><ul class="dropdownMenu"></ul></li>'});
+define("text!orion/webui/checkedmenuitem.html",[],function(){return'<li><label class="dropdownMenuItem"><input class="checkedMenuItem" role="menuitem" type="checkbox" />${ItemText}</label></li>'});
+define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(g,n){function p(a){this._init(a)}p.prototype={_init:function(a){this._node=n.node(a.node);if(!this._node)throw"no dom node for tooltip found";this._position=a.position||["right","above","below","left"];this._text=a.text;this._hideDelay=void 0===a.hideDelay?200:a.hideDelay;this._tailSize=a.tailSize||10;this._trigger=a.trigger||"mouseover";this._afterShowing=a.afterShowing;this._afterHiding=a.afterHiding;var l=this;if("click"===
+this._trigger)this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(a){a.target===l._node&&(l.show(),n.stop(a))},!1);else if("mouseover"===this._trigger){this._showDelay=void 0===a.showDelay?500:a.showDelay;a=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(a){n.contains(l._node,a.target)&&(l.show(),n.stop(a))},!1);this._leaveHandler=function(a){n.contains(l._node,a.target)&&l.hide()};for(var f=0;f<a.length;f++)this._node.addEventListener(a[f],
+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 a=document.createTextNode(this._text);this._tipTextContent.appendChild(a)}this._tip.appendChild(this._tipInner);
+document.body.appendChild(this._tip);var l=this;n.addAutoDismiss([this._tip,this._node],function(){l.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(){l._timeout&&(window.clearTimeout(l._timeout),l._timeout=null);l._tip.addEventListener("mouseout",function(a){n.contains(l._tip,a.target)&&(l.hide(),n.stop(a))},
+!1)},!1))}return this._tip},_positionTip:function(a,l){this._makeTipNode();"left"===a?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var f=this._node,e;for(e=n.bounds(f);f&&!e.width&&!e.height;f=f.parentNode)e=n.bounds(f);var f=n.bounds(this._tipInner),d;switch(a){case "above":d=e.top-f.height-this._tailSize-1;e=e.left-this._tailSize;break;case "below":d=e.top+e.height+this._tailSize+1;e=e.left-this._tailSize;break;case "left":d=e.top-this._tailSize/2;e=e.left-f.width-
+this._tailSize-1;break;default:d=e.top-this._tailSize/2,e=e.left+e.width+this._tailSize+1}var h=n.bounds(document.documentElement);if(d+f.height>h.height)if(l)d=h.height-f.height-1;else return!1;if(e+f.width>h.width)if(l)e=h.width-f.width-1;else return!1;if(0>e)if(l)e=4;else return!1;if(0>d)if(l)d=4;else return!1;this._tail&&this._tail.previousPosition!==a&&(this._tip.removeChild(this._tail),this._tail=null);this._tail||(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+
+a),"above"===a||"left"===a?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner),"left"===a&&(this._tail.style.left=f.width+"px"),this._tail.previousPosition=a);this._tip.style.top=d+"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 a=!1,l=0;!a&&l<this._position.length;)a=this._positionTip(this._position[l]),l++;a||this._positionTip(this._position[0],!0);this._tip.classList.add("tooltipShowing");this._afterShowing&&this._afterShowing()},hide:function(a){this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null);if(this._tip&&this._tip.classList.contains("tooltipShowing")){void 0===a&&(a=
+this._hideDelay);var l=this;this._timeout=window.setTimeout(function(){l._tip.classList.remove("tooltipShowing");l._tip.removeAttribute("style");l._afterHiding&&l._afterHiding()},a)}},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 a=["mouseout","click"],l=0;l<a.length;l++)this._node.removeEventListener(a[l],this._leaveHandler,!1)}}};p.prototype.constructor=p;return{Tooltip:p}});
+define("orion/commands","require 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(g,n,p,a,l,f,e,d,h){function c(b){var q=b.invocation;if(q){var c=b.command;if(c.hrefCallback)return b=c.hrefCallback.call(q.handler||window,q),b.then?b.then(function(q){window.open(q)}):window.open(b),
+!0;if(q.commandRegistry)return q.commandRegistry._invoke(q),!0;if(c.onClick||c.callback)return window.setTimeout(function(){(c.onClick||c.callback).call(q.handler||window,q)},0),!0}return!1}function b(b,q){for(var w in q)if(q[w]&&(q[w].keyBinding&&q[w].command)&&q[w].keyBinding.match(b)){var d=q[w],a=d.keyBinding;if((!a.domScope||p.contains(p.node(a.domScope),b.target))&&c(d)){p.stop(b);break}}}function k(){var b={};if(s){var q,c,d;c=Object.keys(v);for(q=0;q<c.length;q++)d=c[q],b[d]=v[d];var a=s();
+c=Object.keys(a);for(q=0;q<c.length;q++)d=c[q],b[d]=a[d]}else b=v;return b}function m(c){b(c,k())}function r(b,q){b=b||window.event;if(function(q){if(n.isMac){if(q.metaKey&&!q.altKey)return!q.shiftKey&&!q.ctrlKey&&(65===q.keyCode||67===q.keyCode||86===q.keyCode||88===q.keyCode||90===q.keyCode)?!0:!1;if(q.ctrlKey)return!1}else{if(q.ctrlKey&&!q.altKey)return!q.shiftKey&&(65===q.keyCode||67===q.keyCode||86===q.keyCode||88===q.keyCode||90===q.keyCode)?!0:!1;if(q.altKey&&!q.ctrlKey)return!1}if(q["char"])return 0<
+q["char"].length;if(q.charCode||q.keyCode)switch(q=q.charCode||q.keyCode,q){case 8:case 9:case 13:case 46:return!0;default:return 32<=q&&112>q||123<q}return!1}(b)){if("true"===b.target.contentEditable)return;var c=b.target.nodeName.toLowerCase();if("input"===c)switch(b.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}q?q(b):m(b)}function x(){this._init()}function u(b,q,c){q.classList.add("commandImage");var d;b.imageClass?b.addImageClassToElement?q.classList.add(b.imageClass):(d=document.createElement("span"),q.appendChild(d),d.classList.add(b.spriteClass),d.classList.add(b.imageClass)):(d=new Image,d.alt=b.name,d.name=c,d.id=c,d.src=b.image,q.appendChild(d));return d}function t(b,q,c,d,a){this.commandRegistry=a;this.handler=b;this.items=q;this.userData=c;this.command=d;d.parameters&&(this.parameters=
+d.parameters.makeCopy());this.id=d.id}function y(b){this._init(b)}var s=null,v={};x.prototype={setProxy:function(b){this.proxy=b},setKeyBindings:function(b){this.bindings=b},_init:function(){var b=this;document.addEventListener("keydown",function(q){return r(q,function(q){var c=b.proxy,d=b.bindings;if(d&&c)for(var a=0;a<d.length;a++)d[a].match(q)&&(c.processKey({type:q.type,keyCode:q.keyCode,altKey:q.altKey,ctrlKey:q.ctrlKey,metaKey:q.metaKey,shiftKey:q.shiftKey}),p.stop(q))})})}};window.document.addEventListener("keydown",
+r,!1);t.prototype={collectsParameters:function(){return this.commandRegistry&&this.commandRegistry.collectsParameters()},makeCopy:function(b){var q=new t(this.handler,this.items,this.userData,this.command,this.commandRegistry);q.domNode=this.domNode;q.domParent=this.domParent;b?q.parameters=b.makeCopy():this.parameters&&(q.parameters=this.parameters.makeCopy());return q}};t.prototype.constructor=t;y.prototype={_init:function(b){this.id=b.id;this.name=b.name;this.tooltip=b.tooltip;this.callback=b.callback;
+this.hrefCallback=b.hrefCallback;this.choiceCallback=b.choiceCallback;this.positioningNode=b.positioningNode;this.image=b.image||g.toUrl&&g.toUrl("images/none.png");this.imageClass=b.imageClass;this.addImageClassToElement=b.addImageClassToElement;this.selectionClass=b.selectionClass;this.spriteClass=b.spriteClass||"commandSprite";this.visibleWhen=b.visibleWhen;this.parameters=b.parameters;this.isEditor=b.isEditor},populateChoicesMenu:function(b,q,c,d,a){this.getChoices(q,c,d).forEach(function(c){if(c.name){var d=
+document.createElement("li");b.appendChild(d);var w=document.createElement("span");w.tabIndex=0;w.role="menuitem";w.classList.add("dropdownMenuItem");var k=document.createTextNode(c.name);w.appendChild(k);d.appendChild(w);w.choice=c;w.addEventListener("click",function(b){b.target.choice&&b.target.choice.callback.call(b.target.choice,q)},!1);w.addEventListener("keydown",function(b){(b.keyCode===p.KEY.ENTER||b.keyCode===p.KEY.SPACE)&&b.target.choice&&b.target.choice.callback.call(b.target.choice,q)},
+!1)}else a._generateMenuSeparator(b)})},getChoices:function(b,q,c){return this.choiceCallback?this.choiceCallback.call(q,b,c):null},makeChoiceCallback:function(b,q){return function(c){b.callback&&b.callback.call(b,q,c)}},hasImage:function(){return this.imageClass||this.image!==g.toUrl("images/none.png")}};y.prototype.constructor=y;return{Command:y,CommandInvocation:t,createDropdownMenu:function(b,q,c,d,k,r,m,e,h){b=p.node(b);if(!b)throw"no parent node was specified";var t=document.createRange();t.selectNode(b);
+t=h?t.createContextualFragment(f):t.createContextualFragment(l);p.processTextNodes(t,{ButtonText:q});b.appendChild(t);var b=b.lastChild,x;h?(x=b.previousSibling,h=x.previousSibling):h=b.previousSibling;d?(h.classList.add(d),x&&x.classList.add(d)):(h.classList.add("orionButton"),h.classList.add("commandButton"),x&&(x.classList.add("orionButton"),x.classList.add("commandButton"),x.classList.add("commandHalfButton_right"),h.classList.add("commandHalfButton_left")));k&&(r||(h.textContent="",h.setAttribute("aria-label",
+q)),u({spriteClass:"commandSprite",imageClass:k},h,q),x&&(x.classList.add("commandImage"),x.classList.add("commandHalfImage_right"),h.classList.add("commandHalfImage_left")),h.classList.add("orionButton"));h.dropdown=new a.Dropdown({dropdown:b,populate:c,selectionClass:m,positioningNode:e});b.dropdown=h.dropdown;return{menuButton:h,menu:b,dropdown:h.dropdown,extraDropdownButton:x}},createCheckedMenuItem:function(b,q,c,a){b=p.node(b);if(!b)throw"no parent node was specified";var k=document.createRange();
+k.selectNode(b);k=k.createContextualFragment(d);p.processTextNodes(k,{ItemText:q});b.appendChild(k);b=p.$(".checkedMenuItem",b.lastChild);b.checked=c;b.addEventListener("change",a,!1);return b},createCommandItem:function(b,q,c,d,a,k,r){var m,k=k||!q.name&&q.hasImage();if(q.hrefCallback)m=document.createElement("a"),m.id=d,k&&q.hasImage()?u(q,m,d):(m.className="commandLink",m.appendChild(document.createTextNode(q.name))),r=q.hrefCallback.call(c.handler,c),r.then?r.then(function(q){m.href=q}):m.href=
+r?r:"#";else{m=document.createElement("button");m.className="orionButton";k?q.hasImage()?(u(q,m,d),q.name&&m.setAttribute("aria-label",q.name)):(m.classList.add("commandButton"),m.classList.add("commandMissingImageButton"),m.appendChild(document.createTextNode(q.name))):(m.classList.add("commandButton"),d=document.createTextNode(q.name),m.appendChild(d));var e=r||q.callback;e&&(q.onClick=e,m.addEventListener("click",function(){e.call(c.handler,c)},!1))}"ul"===b.nodeName.toLowerCase()?(r=document.createElement("li"),
+b.appendChild(r),b=r):m.classList.add("commandMargins");b.appendChild(m);q.tooltip&&(m.commandTooltip=new h.Tooltip({node:m,text:q.tooltip,position:["above","below","right","left"]}));a&&(v[q.id]={keyBinding:a,command:q,invocation:c});return m},createCommandMenuItem:function(b,q,c,d,a){var k,r=b.dropdown;if(q.hrefCallback)k=document.createElement("a"),k.appendChild(document.createTextNode(q.name)),a=q.hrefCallback.call(c.handler,c),a.then?a.then(function(q){k.href=q}):k.href=a?a:"#",k.addEventListener("keydown",
+function(q){(q.keyCode===p.KEY.ENTER||q.keyCode===p.KEY.SPACE)&&k.click()},!1);else{k=document.createElement("span");k.tabIndex=0;k.appendChild(document.createTextNode(q.name));var m=a||q.callback;m&&(q.onClick=m,k.addEventListener("click",function(){r.close(!0);m.call(c.handler,c)},!1),k.addEventListener("keydown",function(q){if(q.keyCode===p.KEY.ENTER||q.keyCode===p.KEY.SPACE)q.preventDefault(),k.click()},!1))}k.className="dropdownMenuItem";k.role="menuitem";a=document.createElement("li");b.appendChild(a);
+a.appendChild(k);d&&(v[q.id]={keyBinding:d,command:q,invocation:c});return k},executeBinding:c,setKeyBindingProvider:function(b){s=b},localKeyBindings:v,CommandsProxy:x,getKeyBindings:k,processKey:m,_testMethodProcessKey:b}});
+define("orion/explorers/explorer","i18n!orion/nls/messages require orion/webui/littlelib orion/webui/treetable orion/explorers/explorerNavHandler orion/commands".split(" "),function(g,n,p,a,l,f){var n={},e=function(d,a,c,b){this.registry=d;this.renderer=c;this.selection=a;this.commandService=b;this.renderer&&(this.renderer.explorer=this);this.myTree=null};e.prototype={destroy:function(){this._navHandler&&this._navHandler.destroy();this.model&&this.model.destroy();this.myTree&&this.myTree.destroy();
+this.destroyed=!0},changedItem:function(d,a){this.myTree&&this.myTree.refresh.bind(this.myTree)(d,a,!0)},updateCommands:function(d){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(d)},makeNewItemPlaceHolder:function(d,a,c,b){d=this.getRow(d);if(c)return d=d.childNodes[c],d.appendChild(document.createElement("br")),b=document.createElement("span"),b.id=a+"placeHolderRow",d.appendChild(b),{tempNode:b,refNode:b};if(d){var k=document.createElement("tr");k.id=a+"placeHolderRow";
+c=document.createElement("td");c.id=a+"placeHolderCol";k.appendChild(c);b?(d.parentNode.insertBefore(k,d.nextSibling),d=parseInt(d.firstChild.style.paddingLeft),c.style.paddingLeft=this.myTree.getIndent()+d+"px"):d.appendChild(k);b=p.node(a+"placeHolderRow");d=p.node(a+"placeHolderCol");if(b&&d)return{tempNode:b,refNode:d}}return null},getRow:function(d){if(d=this.model.getId(d))return p.node(d)},collapseAll:function(){for(var d=this._navHandler.getTopLevelNodes(),a=0;a<d.length;a++)this.myTree.collapse(d[a])},
+expandAll:function(d){if(d)this._expandRecursively(d);else if(this._navHandler)for(var d=this._navHandler.getTopLevelNodes(),a=0;a<d.length;a++)this._expandRecursively(d[a])},_expandRecursively:function(d){if(this._navHandler&&this._navHandler.isExpandable(d)){var a=this;this.myTree.expand(d,function(){a.model.getChildren(d,function(c){if(!(void 0===c||null===c))for(var b=c.length,d=0;d<b;d++)a._expandRecursively(c[d])})})}},createTree:function(d,e,c){d="string"===typeof d?d:d.id||d;this.selection&&
+this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var b=d+"innerTree",k=p.node(b);k&&p.empty(k);e&&(e.rootId=b);this.model=e;this._parentId=d;this._treeOptions=c;if(!c||c&&!c.noSelection)this.selectionPolicy=c?c.selectionPolicy:"",this._navDict=new l.ExplorerNavDict(this.model);this.myTree=new a.TableTree({id:b,model:e,parent:d,onComplete:c?c.onComplete:void 0,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:c?!!c.showRoot:
+!1,indent:c?c.indent:void 0,onCollapse:c?c.onCollapse:void 0,navHandlerFactory:c?c.navHandlerFactory:void 0,tableElement:c?c.tableElement:void 0,tableBodyElement:c?c.tableBodyElement:void 0,tableRowElement:c?c.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 d=this.getNavHandler(),a=[];
+if(d&&this.getNavDict())for(var c=d.getSelection(),b=0;b<c.length;b++){var k=d.getRowDiv(c[b]);k&&k.parentNode&&(k=this.getNavDict().getValue(this.model.getId(c[b])),k.model&&a.push(k.model))}this.selection.setSelections(a)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:null},initNavHandler:function(){var d=this._treeOptions;if(!d||d&&!d.noSelection){this.getNavHandler()||(this._navHandler=d&&d.navHandlerFactory&&"function"===typeof d.navHandlerFactory.createNavHandler?
+d.navHandlerFactory.createNavHandler(this,this._navDict,d):new l.ExplorerNavHandler(this,this._navDict,{getChildrenFunc:d?d.getChildrenFunc:null,setFocus:d&&d.setFocus,selectionPolicy:d?d.selectionPolicy:null}));var a=this;this.model.getRoot(function(c){c instanceof Array?a.getNavHandler().refreshModel(a.getNavDict(),a.model,c):c.children&&c.children instanceof Array&&a.getNavHandler().refreshModel(a.getNavDict(),a.model,c.children);d&&d.setFocus&&a.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,
+checkbox:!1};n.Explorer=e;n.createExplorerCommands=function(d,a){function c(b){return"function"===typeof b.getItemCount&&0<b.getItemCount()?a?a(b):!0:!1}var b=new f.Command({tooltip:g["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(b){return c(b)},callback:function(b){b.items.expandAll()}}),k=new f.Command({tooltip:g["Collapse all"],imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",
+visibleWhen:function(b){return c(b)},callback:function(b){b.items.collapseAll()}});d.addCommand(b);d.addCommand(k)};e=function(d,a,c){this.rootPath=d;this.fetchItems=a;this.idPrefix=c||""};e.prototype={destroy:function(){this.destroyed=!0},getRoot:function(d){var a=this;this.fetchItems(this.rootPath).then(function(c){a.root=c;d(c)})},getChildren:function(d,a){d.Children?a(d.Children):d.ChildrenLocation?this.fetchItems(d.ChildrenLocation).then(function(c){d.Children=c;a(c)}):a([])},getId:function(d){if(d.Location===
+this.root.Location)return this.rootId;for(var d=d.Location.replace(/[\\\/]/g,""),a=this.idPrefix,c=0;c<d.length;c++)a=d[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?a+d.charCodeAt(c):a+d[c];return a}};n.ExplorerModel=e;e=function(d,a,c){this.rootPath=d;this.fetchItems=a;this.root=c};e.prototype=new n.ExplorerModel;e.prototype.getRoot=function(d){if(this.root)d(this.root);else{var a=this;this.fetchItems(this.rootPath).then(function(c){a.root=c;d(c)})}};e.prototype.getChildren=function(d,a){d===this.root?a(this.root):
+a([])};n.ExplorerFlatModel=e;e=function(d,a){this.explorer=a;this._init(d);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._progressImageClass="core-sprite-progress";this._twistieSpriteClass="modelDecorationSprite"};e.prototype={_init:function(d){d&&(this._useCheckboxSelection=void 0===d.checkbox?!1:d.checkbox,this.selectionPolicy=d.singleSelection?"singleSelection":"",this._cachePrefix=d.cachePrefix,this.getCheckedFunc=d.getCheckedFunc,this.onCheckedFunc=
+d.onCheckedFunc,this._highlightSelection=!0,this._treeTableClass=d.treeTableClass||"treetable",!1===d.highlightSelection&&(this._highlightSelection=!1),this.actionScopeId||(this.actionScopeId=d.actionScopeId),this.commandService||(this.commandService=d.commandService))},getLabelColumnIndex:function(){return this.explorer.checkbox?1:0},initTable:function(d,a){this.tableTree=a;p.empty(d);this._treeTableClass&&d.classList.add(this._treeTableClass);this.renderTableHeader(d)},getActionsColumn:function(d,
+a,c,b,k){var c=c||"tool",m=document.createElement("td");m.id=a.id+"actionswrapper";b&&m.classList.add(b);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,m,d,this.explorer,c,null,k&&this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(d,!0):null):window.console.log("Warning, no command service or action scope was specified.  No commands rendered.");return m},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},
+getCheckboxColumn:function(d,a){if(this._useCheckboxSelection){var c=document.createElement("td"),b=document.createElement("span");b.id=this.getCheckBoxId(a.id);b.classList.add("core-sprite-check");b.classList.add("selectionCheckmarkSprite");b.rowId=a.id;this.getCheckedFunc&&(b.checked=this.getCheckedFunc(d),b.checked?(this._highlightSelection&&a.classList.add("checkedRow"),b.classList.add("core-sprite-check_on")):(this._highlightSelection&&a.classList.remove("checkedRow"),b.classList.remove("core-sprite-check_on")));
+c.appendChild(b);var k=this;b.addEventListener("click",function(b){k.onCheck(a,b.target,b.target.checked?!1:!0,!0)},!1);return c}},getCheckBoxId:function(d){return d+"selectedState"},onCheck:function(d,a,c,b,k){(a.checked=c)?a.classList.add("core-sprite-check_on"):a.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(a.rowId,c,b);this.explorer.getNavHandler()&&k&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(d.id).model,!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var d=
+this.explorer.getNavHandler().getSelectionIds(),a=this._getUIStatePreferencePath();a&&window.sessionStorage&&(window.sessionStorage[a+"selection"]=JSON.stringify(d))}},_restoreSelections:function(d){var a=this.explorer.getNavDict(),c=this.explorer.getNavHandler();if(c&&(a&&"cursorOnly"!==c.getSelectionPolicy())&&(d=window.sessionStorage[d+"selection"],"string"===typeof d&&(d=0<d.length?JSON.parse(d):null),d)){for(var b=[],c=0;c<d.length;c++){var k=a.getValue(d[c]);if(k&&(k.rowDomNode&&k.model)&&(b.push(k.model),
+this._highlightSelection&&k.rowDomNode.classList.add("checkedRow"),k=p.node(this.getCheckBoxId(k.rowDomNode.id))))k.checked=!0,k.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(b),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(d){window.sessionStorage[d+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(d){var a=!1,c=window.sessionStorage[d+"expanded"];"string"===
+typeof c&&(c=0<c.length?JSON.parse(c):null);var b;if(c)for(b=0;b<c.length;b++)if(p.node(c[b])){this._expanded.push(c[b]);var k=this;this.tableTree.expand(c[b],function(){k._restoreSelections(d)});a=!0}return!a},_getUIStatePreferencePath:function(){if(this.explorer){var d=this.explorer.getRootPath();if(this._cachePrefix&&d)return d=d.replace(/[^\.\:\-\_0-9A-Za-z]/g,""),"/"+this._cachePrefix+"/"+d+"/uiState"}return null},expandCollapseImageId:function(d){return d+"__expand"},updateExpandVisuals:function(d,
+a){var c=p.node(this.expandCollapseImageId(d.id));c&&(c.classList.remove(this._expandImageClass),c.classList.remove(this._collapseImageClass),c.classList.remove(this._progressImageClass),c.classList.add("progress"===a?this._progressImageClass:a?this._expandImageClass:this._collapseImageClass))},getExpandImage:function(d,a,c,b){var k=document.createElement("span");k.id=this.expandCollapseImageId(d.id);a.appendChild(k);k.classList.add(this._twistieSpriteClass);k.classList.add(this._collapseImageClass);
+if(c){var m=document.createElement("span");a.appendChild(m);m.classList.add(b||"imageSprite");m.classList.add(c)}var r=this;k.onclick=function(){if(!r.explorer.getNavHandler().isDisabled(d)){r.tableTree.toggle(d.id);if(r.tableTree.isExpanded(d.id))r._expanded.push(d.id),r.explorer.postUserExpand&&r.explorer.postUserExpand(d.id);else for(var b in r._expanded)if(r._expanded[b]===d.id){r._expanded.splice(b,1);break}(b=r._getUIStatePreferencePath())&&window.sessionStorage&&r._storeExpansions(b)}};return k},
+render:function(d,a){a.classList.add("navRow");this.renderRow(d,a)},rowsChanged:function(){"cursorOnly"!==this.explorer.selectionPolicy&&(this.explorer.refreshSelection(),this.explorer.initNavHandler())},updateCommands:function(){if(this.commandService)for(var d=p.$$array(".treeTableRow"),a=0;a<d.length;a++){var c=d[a],b=p.node(c.id+"actionswrapper");this.commandService.destroy(b);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,b,c._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=
+[];var a=this._getUIStatePreferencePath();a&&window.sessionStorage&&this._restoreExpansions(a)&&this._restoreSelections(a)}};n.ExplorerRenderer=e;e=function(a,e){this._init(a);this.explorer=e};e.prototype=new n.ExplorerRenderer;e.prototype.renderTableHeader=function(a){var e=document.createElement("thead"),c=document.createElement("tr");e.classList.add("navTableHeading");this._useCheckboxSelection&&c.appendChild(this.initCheckboxColumn(a));for(var b=0,k=this.getCellHeaderElement(b);k;)0<k.innerHTML.length&&
+k.classList.add("navColumn"),c.appendChild(k),k=this.getCellHeaderElement(++b);e.appendChild(c);0<b&&a.appendChild(e)};e.prototype.renderRow=function(a,e){e.verticalAlign="baseline";e.classList.add("treeTableRow");var c=this.explorer.getNavDict();if(c){c.addRow(a,e);var b=this;e.addEventListener("click",function(c){if(b.explorer.getNavHandler())b.explorer.getNavHandler().onClick(a,c)},!1)}if(c=this.getCheckboxColumn(a,e))c.classList.add("checkColumn"),e.appendChild(c);for(var c=0,k=this.getCellElement(c,
+a,e);k;)e.appendChild(k),0===c?this.getPrimColumnStyle?k.classList.add(this.getPrimColumnStyle(a)):k.classList.add("navColumn"):this.getSecondaryColumnStyle?k.classList.add(this.getSecondaryColumnStyle()):k.classList.add("secondaryColumn"),k=this.getCellElement(++c,a,e)};e.prototype.getCellHeaderElement=function(){};e.prototype.getCellElement=function(){};n.SelectionRenderer=e;e=function(a,e,c){this.items=a;this.getKey=c;this.idPrefix=e;this.root={children:a}};e.prototype=new n.ExplorerModel;e.prototype.getRoot=
+function(a){a(this.root)};e.prototype.getId=function(a){for(var a=this.getKey(a).replace(/[\\\/]/g,""),e="",c=0;c<a.length;c++)e=a[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?e+a.charCodeAt(c):e+a[c];return this.idPrefix+e};e.prototype.getChildren=function(a,e){a===this.root?e(this.items):e([])};n.SimpleFlatModel=e;return n});
+define("orion/explorers/explorer-table","i18n!orion/navigate/nls/messages orion/Deferred orion/webui/littlelib orion/i18nUtil orion/fileUtils orion/explorers/explorer orion/EventTarget orion/objects orion/util".split(" "),function(g,n,p,a,l,f,e,d,h){function c(b,c,a,d,k,m){this.registry=b;this.root=c;this.fileClient=a;this.idPrefix=d||"";this.excludeFiles=!!k;this.excludeFolders=!!m}function b(b){e.attach(this);this.registry=b.serviceRegistry;this.treeRoot=b.treeRoot;this.selection=b.selection;this.fileClient=
+b.fileClient;this.excludeFiles=b.excludeFiles;this.excludeFolders=b.excludeFolders;this.navHandlerFactory=b.navHandlerFactory;this.parentId=b.parentId;this.renderer=b.rendererFactory(this);this.dragAndDrop=b.dragAndDrop;this.setFocus=b.setFocus;this.myTree=this.model=null;this._hookedDrag=this.checkbox=!1;var c=b.modelEventDispatcher?b.modelEventDispatcher:new e;this.modelEventDispatcher=c;var a=this;this._modelListeners={};"copy copyMultiple create delete deleteMultiple import move moveMultiple".split(" ").forEach(function(b){c.addEventListener(b,
+a._modelListeners[b]=a.modelHandler[b].bind(a))});this._clickListener=function(b){if("A"===b.target.tagName){for(b=b.target;b&&!b._item;)b=b.parentNode;if(b&&b._item)a.onLinkClick({type:"linkClick",item:b._item})}};(b=p.node(this.parentId))&&b.addEventListener("click",this._clickListener);var d=this.renderer;this.registry&&this.registry.registerService("orion.cm.managedservice",{updated:function(b){b=b&&"undefined"!==b["links.newtab"]?b["links.newtab"]?"_blank":"_self":"_self";d.setTarget&&d.setTarget(b)}},
+{pid:"nav.config"})}c.prototype=new f.ExplorerModel;d.mixin(c.prototype,{getRoot:function(b){b(this.root)},processParent:function(b,c){if(this.excludeFiles||this.excludeFolders){var a=[],d;for(d in c)if(!(c[d].Directory?this.excludeFolders:this.excludeFiles))a.push(c[d]),c[d].parent=b;c=a}else for(a in c)c[a].parent=b;b.children=c;b.children.sort(function(b,c){var a=b.Directory;if(a!==c.Directory)return a?-1:1;var a=b.Name&&b.Name.toLowerCase(),d=c.Name&&c.Name.toLowerCase();return a<d?-1:a>d?1:0});
+return c},getChildren:function(b,c){var a=this;if(b.children)c(b.children);else if(void 0!==b.Directory&&!1===b.Directory)c([]);else if(b.Location){var d=null;this.registry&&(d=this.registry.getService("orion.page.progress"));(d?d.progress(this.fileClient.fetchChildren(b.ChildrenLocation),g["Fetching children of "]+b.Name):this.fileClient.fetchChildren(b.ChildrenLocation)).then(function(d){a.destroyed||c(a.processParent(b,d))},function(){c([])})}else c([])},hasChildren:function(){var b=!1;this.root.Children&&
+(b=0<this.root.Children.length);return b}});c.prototype.constructor=c;var k,m;b.prototype=Object.create(f.Explorer.prototype);d.mixin(b.prototype,{destroy:function(){var b=this;Object.keys(this._modelListeners).forEach(function(c){b.modelEventDispatcher.removeEventListener(c,b._modelListeners[c])});var c=p.node(this.parentId);c&&c.removeEventListener("click",this._clickListener);f.Explorer.prototype.destroy.call(this)},onLinkClick:function(b){this.dispatchEvent(b)},onModelCreate:function(b){return this.changedItem(b.parent,
+!0)},onModelCopy:function(b){var c=this,a={};(b.items||[b]).forEach(function(b){b=(b=b.parent)||c.treeRoot;a[b.Location]=b});return n.all(Object.keys(a).map(function(b){return c.changedItem(a[b],!0)}))},onModelMove:function(b){var c=this,a={};(b.items||[b]).forEach(function(b){if(c.treeRoot.Location===b.Location){var d=c.treeRoot,b=b.newValue,b=b.ChildrenLocation?b:this.fileClient.read(b.ContentLocation,!0);return n.when(b,function(b){c.dispatchEvent({type:"rootMoved",oldValue:d,newValue:b});c.loadResourceList(b)})}var k=
+b.oldValue.parent,k=k||c.treeRoot;a[k.Location]=k;k=(k=b.parent)||c.treeRoot;a[k.Location]=k;b.oldValue.Directory&&(b.newValue&&c.isExpanded(b.oldValue))&&(a[b.newValue.Location]=b.newValue)});return n.all(Object.keys(a).map(function(b){return c.changedItem(a[b],!0)}))},onModelDelete:function(b){var b=b.items||[b],c=this,a;if(b.some(function(b){return b.oldValue.Location===c.treeRoot.Location?(a=b.parent,!0):!1}))return this.loadResourceList(a);var d={};b.forEach(function(b){b=b.parent;d[b.Location]=
+b});return n.all(Object.keys(d).map(function(b){return c.changedItem(d[b],!0)}))},modelHandler:{copy:function(b){if(!b.count)return this.onModelCopy(b)},copyMultiple:function(b){return this.onModelCopy(b)},create:function(b){return this.onModelCreate(b)},"delete":function(b){if(!b.count)return this.onModelDelete(b)},deleteMultiple:function(b){return this.onModelDelete(b)},"import":function(b){return this.changedItem(b.target,!0)},move:function(b){if(!b.count)return this.onModelMove(b)},moveMultiple:function(b){return this.onModelMove(b)}},
+_makeDropTarget:function(b,c,d){function e(c,q,d,k,m,h){q=q||"";if(c.isFile)l.isAtRoot(d.Location)?k.registry&&k.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:g["You cannot copy files directly into the workspace.  Create a folder first."]}):c.file(function(q){m(d,q,k,q.name.indexOf(".zip")===q.name.length-4&&window.confirm(a.formatMessage(g["Unzip ${0}?"],q.name)))});else if(c.isDirectory){var f=c.createReader(),x=function(b){f.readEntries(function(a){for(var d=
+0;d<a.length;d++)e(a[d],q+c.name+"/",b,k,m,h)})},s=null;k.registry&&(s=k.registry.getService("orion.page.progress"));l.isAtRoot(d.Location)?(s?s.progress(h.createProject(d.ChildrenLocation,c.name),a.formatMessage(g["Creating ${0}"],c.name)):h.createProject(d.ChildrenLocation,c.name)).then(function(q){k.loadResourceList(k.treeRoot.Path,!0);(s?s.progress(h.read(q.ContentLocation,!0),g["Loading "]+q.name):h.read(q.ContentLocation,!0)).then(function(q){x(q)})}):(s?s.progress(h.createFolder(d.Location,
+c.name),a.formatMessage(g["Creating ${0}"],c.name)):h.createFolder(d.Location,c.name)).then(function(q){k.modelEventDispatcher.dispatchEvent({type:"create",parent:b,newValue:q});x(q)})}}if(this.dragAndDrop){var f=this,s=this.dragAndDrop,v=function(b){k=b.target};d&&(this._oldDragStart&&c.removeEventListener("dragstart",this._oldDragStart,!1),this._oldDragStart=v);c.addEventListener("dragstart",v,!1);v=function(){k=null};d&&(this._oldDragEnd&&c.removeEventListener("dragend",this._oldDragEnd,!1),this._oldDragEnd=
+v);c.addEventListener("dragend",v,!1);v=function(b){c.classList.remove("dragOver");b.preventDefault();b.stopPropagation()};d&&(this._oldDragLeave&&c.removeEventListener("dragleave",this._oldDragLeave,!1),this._oldDragLeave=v);c.addEventListener("dragleave",v,!1);v=function(b){if(k)m=b.dataTransfer.dropEffect=(h.isMac?b.altKey:b.ctrlKey)?"copy":"move";else if(!h.isIE&&("all"===b.dataTransfer.effectAllowed||"uninitialized"===b.dataTransfer.effectAllowed||0<=b.dataTransfer.effectAllowed.indexOf("copy")))b.dataTransfer.dropEffect=
+"copy";c.classList.add("dragOver");p.stop(b)};d&&(this._oldDragEnter&&c.removeEventListener("dragenter",this._oldDragEnter,!1),this._oldDragEnter=v);c.addEventListener("dragenter",v,!1);v=function(b){if(k)m=b.dataTransfer.dropEffect=(h.isMac?b.altKey:b.ctrlKey)?"copy":"move";else if(!h.isIE&&("all"===b.dataTransfer.effectAllowed||"uninitialized"===b.dataTransfer.effectAllowed||0<=b.dataTransfer.effectAllowed.indexOf("copy")))b.dataTransfer.dropEffect="copy";p.stop(b)};d&&!this._oldDragOver&&(c.addEventListener("dragover",
+v,!1),this._oldDragOver=v);v=function(d){var q;c.classList.remove("dragOver");if(k){q=f.fileClient;for(var w=k,B;w;){if(w._item){B=w._item;break}w=w.parentNode}if(!B)return;var A=null;f.registry&&(A=f.registry.getService("orion.page.progress"));var h="copy"===m,w=h?q.copyFile:q.moveFile;(A?A.showWhile(w.apply(q,[B.Location,b.Location]),a.formatMessage(g[h?"Copying ${0}":"Moving ${0}"],B.Location)):w.apply(q,[B.Location,b.Location])).then(function(q){f.modelEventDispatcher.dispatchEvent({type:h?"copy":
+"move",oldValue:B,newValue:q,parent:b})},function(b){A?A.setProgressResult(b):window.console.log(b)})}else if(d.dataTransfer.items&&0<d.dataTransfer.items.length)for(q=0;q<d.dataTransfer.items.length;q++)w=null,"function"===typeof d.dataTransfer.items[q].getAsEntry?w=d.dataTransfer.items[q].getAsEntry():"function"===typeof d.dataTransfer.items[q].webkitGetAsEntry&&(w=d.dataTransfer.items[q].webkitGetAsEntry()),w&&e(w,null,b,f,s,f.fileClient);else if(d.dataTransfer.files&&0<d.dataTransfer.files.length)for(q=
+0;q<d.dataTransfer.files.length;q++)w=d.dataTransfer.files[q],!w.length&&(!w.type||""===w.type)?f.registry&&f.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:a.formatMessage(g["Did not drop ${0}.  Folder drop is not supported in this browser."],w.name)}):l.isAtRoot(b.Location)?f.registry&&f.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:g["You cannot copy files directly into the workspace.  Create a folder first."]}):s(b,
+w,f,w.name.indexOf(".zip")===w.name.length-4&&window.confirm(a.formatMessage(g["Unzip ${0}?"],w.name)));p.stop(d)};d&&(this._oldDrop&&c.removeEventListener("drop",this._oldDrop,!1),this._oldDrop=v);c.addEventListener("drop",v,!1)}},createModel:function(){return new c(this.registry,this.treeRoot,this.fileClient,this.parentId,this.excludeFiles,this.excludeFolders)},changedItem:function(b,c){if(this.treeRoot&&this.treeRoot.Location===b.Location)return this.loadResourceList(this.treeRoot,c);var a=this,
+d=new n;b.children=null;this.model.getChildren(b,function(k){a.getNavHandler();a.myTree.refresh.bind(a.myTree)(b,k,c);d.resolve(k)});return d},showItem:function(b,c){var a=new n;if(!b||!this.model||!this.myTree||!this.myTree.showRoot&&b.Location===this.treeRoot.Location)return a.reject();var d=this.getRow(b);if(d)a.resolve(d._item||b);else return b.Parents&&0<b.Parents.length?(b.Parents[0].Parents=b.Parents.slice(1),this.expandItem(b.Parents[0],c).then(function(c){var a=this.getRow(b);return!a?this.changedItem(c,
+!0).then(function(){var c=this.getRow(b);return c?c._item:(new n).reject()}.bind(this)):a._item||b}.bind(this))):void 0===c||c?this.reroot(b):a.reject();return a},expandItem:function(b,c){var a=new n;this.showItem(b,c).then(function(b){this.myTree.isExpanded(b)?a.resolve(b):this.myTree.expand(this.model.getId(b),function(){a.resolve(b)})}.bind(this),a.reject);return a},reveal:function(b,c){return this.showItem(b,c).then(function(b){var c=this.getNavHandler();c&&(c.cursorOn(b,!0),c.setSelection(b));
+return b}.bind(this))},reroot:function(){return(new n).reject()},isExpanded:function(b){b=this.model.getId(b);return this.renderer.tableTree.isExpanded(b)},getNameNode:function(b){if(b=this.model.getId(b))return p.node(b+"NameLink")},scopeUp:function(){},scopeDown:function(){},loadResourceList:function(b,c,a){b&&"object"===typeof b&&(b=b.ChildrenLocation||b.ContentLocation);b=l.makeRelative(b);if(!c&&b===this._lastPath)return(new n).resolve(this.treeRoot);this._lastPath=b;var d=this;return c||b!==
+this.treeRoot.Path?this.load(this.fileClient.loadWorkspace(b),g["Loading "]+b).then(function(){d.treeRoot.Path=b;"function"===typeof a&&a();d.dispatchEvent({type:"rootChanged",root:d.treeRoot});return(new n).resolve(d.treeRoot)},function(b){d.treeRoot.Path=null;d.dispatchEvent({type:"rootChanged",root:d.treeRoot});return(new n).reject(b)}):(new n).resolve(d.treeRoot)},load:function(b,c,a){var d=p.node(this.parentId),k=p.node("progress");k||(k=document.createElement("div"),k.id="progress",p.empty(d),
+d.appendChild(k));p.empty(k);var m=setTimeout(function(){p.empty(k);k.appendChild(document.createTextNode(c))},500),e=this;return n.when(b,function(b){clearTimeout(m);if(!e.destroyed){e.treeRoot={};for(var q in b)e.treeRoot[q]=b[q];e.model=e.createModel();e.dragAndDrop&&(e._hookedDrag?e._makeDropTarget(e.treeRoot,d,!0):(b=(b=d&&("draggable"in d||"ondragstart"in d&&"ondrop"in d))&&!(!window.File||!window.FileList||!window.FileReader),e._hookedDrag=!0,b?e._makeDropTarget(e.treeRoot,d,!0):(e.dragAndDrop=
+null,window.console.log("Local file drag and drop is not supported in this browser."))));var c=new n;e.createTree(e.parentId,e.model,{onComplete:function(b){c.resolve(b)},navHandlerFactory:e.navHandlerFactory,setFocus:"undefined"===typeof e.setFocus?!0:e.setFocus,selectionPolicy:e.renderer.selectionPolicy,onCollapse:function(b){if(e.getNavHandler())e.getNavHandler().onCollapse(b)}});return c.then(function(){if("function"===typeof a)try{a()}catch(b){e.registry&&e.registry.getService("orion.page.message").setErrorMessage(b)}if("function"===
+typeof e.onchange)e.onchange(e.treeRoot);return e.treeRoot})}},function(b){clearTimeout(m);e.registry&&e.registry.getService("orion.page.message").setProgressResult(b);return(new n).reject(b)})},onchange:function(){}});b.prototype.constructor=b;return{FileExplorer:b,FileModel:c}});
+define("orion/explorers/navigationUtils",[],function(){function g(g,a){!n&&g&&(g.push({domNode:a}),a.tabIndex=-1,a.style.outline="none")}var n=-1!==navigator.userAgent.indexOf("iPad");return{addNavGrid:function(p,a,l){p&&(p=p.getGridNavHolder(a,!0))&&g(p,l)},generateNavGrid:g,removeNavGrid:function(g,a){if(g)for(var l=0;l<g.length;l++)if(g[l].domNode===a){g.splice(l,1);break}}}});define("orion/extensionCommands",[],function(){return{getOpenWithCommands:function(){return[]}}});
+define("orion/URITemplate",[],function(){function g(b){this._text=b}function n(b){return b.replace("%25","%")}function p(b,a){if("U"===a)return encodeURIComponent(b).replace(/[!'()*]/g,function(b){return"%"+b.charCodeAt(0).toString(16).toUpperCase()});if("U+R"===a)return encodeURI(b).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(c,n);if("U+R-,"===a)return encodeURI(b).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+a);}function a(b,c,a){for(var d=
+[],e=0;e<b.length;e++)"undefined"!==typeof b[e]&&d.push(p(b[e],c));return d.join(a)}function l(b,c,a,d){for(var e=Object.keys(b),l=[],h=0;h<e.length;h++)"undefined"!==typeof b[e[h]]&&l.push(p(e[h],c)+a+p(b[e[h]],c));return l.join(d)}function f(b){if(0===b.length)throw Error("Invalid Expression: 0 length expression");(this._operator=d[b[0]])?b=b.substring(1):this._operator=d.NUL;for(var c=[],a=b.split(","),e=0;e<a.length;e++){var l=a[e].match(h);if(null===l)throw Error("Bad VarSpec: "+b);c.push({name:l[1],
+explode:!!l[2],prefix:l[3]?parseInt(l[3],10):-1})}this._varSpecList=c}function e(b){for(var c=[],a=0,d=b.indexOf("{",a);-1!==d;){c.push(new g(b.substring(a,d)));a=b.indexOf("}",d+1);if(-1===a)throw Error("Invalid template: "+b);c.push(new f(b.substring(d+1,a)));a+=1;d=b.indexOf("{",a)}c.push(new g(b.substring(a)));this._templateComponents=c}var d={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-,"}},h=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/,c=/%25[0-9A-F][0-9A-F]/g;g.prototype={expand:function(){return encodeURI(this._text)}};
-f.prototype={expand:function(a){for(var c=[],d=0;d<this._varSpecList.length;d++){var e=this._varSpecList[d],h=e.name,f=a[h],g=typeof f;if("undefined"!==g&&null!==f){var y=0===c.length?this._operator.first:this._operator.sep,s=y;if("string"===g)this._operator.named&&(s+=p(h,"U+R"),s+=0===f.length?this._operator.ifemp:"="),-1!==e.prefix&&e.prefix<f.length&&(f=f.substring(0,e.prefix)),s+=p(f,this._operator.allow);else if(Array.isArray(f))e.explode?s+=b(f,this._operator.allow,this._operator.sep):(this._operator.named&&
-(s+=p(h,"U+R"),s+=0===f.length?this._operator.ifemp:"="),s+=b(f,this._operator.allow,","));else if("object"===g)e.explode?s+=l(f,this._operator.allow,"=",this._operator.sep):(this._operator.named&&(s+=p(h,"U+R"),s+=0===Object.keys(f).length?this._operator.ifemp:"="),s+=l(f,this._operator.allow,",",","));else throw Error("bad param type: "+h+" : "+g);(s!==y||d<this._varSpecList.length-1)&&c.push(s)}}return c.join("")}};e.prototype={expand:function(a){for(var c=[],b=0;b<this._templateComponents.length;b++)c.push(this._templateComponents[b].expand(a));
+f.prototype={expand:function(b){for(var c=[],d=0;d<this._varSpecList.length;d++){var e=this._varSpecList[d],h=e.name,f=b[h],g=typeof f;if("undefined"!==g&&null!==f){var y=0===c.length?this._operator.first:this._operator.sep,s=y;if("string"===g)this._operator.named&&(s+=p(h,"U+R"),s+=0===f.length?this._operator.ifemp:"="),-1!==e.prefix&&e.prefix<f.length&&(f=f.substring(0,e.prefix)),s+=p(f,this._operator.allow);else if(Array.isArray(f))e.explode?s+=a(f,this._operator.allow,this._operator.sep):(this._operator.named&&
+(s+=p(h,"U+R"),s+=0===f.length?this._operator.ifemp:"="),s+=a(f,this._operator.allow,","));else if("object"===g)e.explode?s+=l(f,this._operator.allow,"=",this._operator.sep):(this._operator.named&&(s+=p(h,"U+R"),s+=0===Object.keys(f).length?this._operator.ifemp:"="),s+=l(f,this._operator.allow,",",","));else throw Error("bad param type: "+h+" : "+g);(s!==y||d<this._varSpecList.length-1)&&c.push(s)}}return c.join("")}};e.prototype={expand:function(b){for(var c=[],a=0;a<this._templateComponents.length;a++)c.push(this._templateComponents[a].expand(b));
 return c.join("")}};return e});
-define("orion/explorers/navigatorRenderer","i18n!orion/navigate/nls/messages orion/Deferred orion/explorers/explorer orion/explorers/navigationUtils orion/extensionCommands orion/objects orion/URITemplate orion/webui/littlelib".split(" "),function(g,n,p,b,l,f,e,d){function h(a){switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":return!0}return!1}function c(a,c,b,d,g,y,s,u,p,q){var c=f.clone(c),x;if(c.Directory)x=document.createElement("a"),
-x.className="navlinkonpage",x.href=!a?k:(new e(a+"#{,resource,params*}")).expand({resource:c.ChildrenLocation}),c.Name&&x.appendChild(document.createTextNode(c.Name));else{g||(g=l.getOpenWithCommands(b));if(!y)for(a=0;a<g.length;a++)"default"===g[a].isEditor&&(y=g[a]);x=document.createElement("a");x.className="navlink targetSelector";s&&"object"===typeof s&&Object.keys(s).forEach(function(a){x[a]=s[a]});var A=null,B=null;if(A=p?p.holderDom:x)B=document.createElement("span"),B.className="core-sprite-file modelDecorationSprite thumbnail",
-A.appendChild(B);c.Name&&x.appendChild(document.createTextNode(c.Name));var C=!1,M=c.Location;u&&"object"===typeof u&&(c.params={},f.mixin(c.params,u));for(a=0;a<g.length;a++)if(u=g[a],u.visibleWhen(c)){M=u.hrefCallback({items:c});C=!0;break}n.when(d.getFileContentType(c),function(a){!C&&(y&&!h(a))&&(M=y.hrefCallback({items:c}));if(A){var b=A,d=B;if(a){var k,e=a.imageClass,m=a.image;e?(k=document.createElement("span"),k.className+=e,k.classList.add("thumbnail")):m&&(k=document.createElement("img"),
-k.src=m,k.classList.add("thumbnail"));k&&b.replaceChild(k,d)}}x.href=M;q&&"function"===typeof q.updateFileNode&&q.updateFileNode(c,x,h(a))})}return x}function a(a,c,b,d){this.explorer=c;this.commandService=b;this.contentTypeService=d;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}var k=new e("#{,resource,params*}");a.prototype=new p.SelectionRenderer;a.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};a.prototype.tableCallback=function(a){a.setAttribute("aria-label",
-g.Navigator);a.setAttribute("role","presentation")};a.prototype.rowCallback=function(a){a.setAttribute("role","treeitem")};a.prototype.emptyCallback=function(a){var c=document.createElement("tr"),b=document.createElement("td");b.colSpan=this.oneColumn?1:3;var k=document.createElement("div");k.classList.add("noFile");k.textContent=g.NoFile;var e=document.createElement("span");e.classList.add("core-sprite-addcontent");e.classList.add("icon-inline");e.classList.add("imageSprite");d.processDOMNodes(k,
-[e]);b.appendChild(k);c.appendChild(b);a.appendChild(c)};a.prototype.getCellHeaderElement=function(a){if(this.oneColumn&&0!==a)return null;switch(a){case 0:case 1:case 2:document.createElement("th").style.height="8px"}};a.prototype.setTarget=function(a){this.target=a};a.prototype.getFolderImage=function(){if(!this.showFolderImage)return null;var a=document.createElement("span");a.className="core-sprite-folder modelDecorationSprite";return a};a.prototype.createFolderNode=function(a){var b;this.showFolderLinks?
-(b=c(this.folderLink||"",a,this.commandService,this.contentTypeService),(a=this.getFolderImage(a))&&b.insertBefore(a,b.firstChild)):(b=document.createElement("span"),b.textContent=a.Name);return b};a.prototype.updateFileNode=function(){};a.prototype.showFolderLinks=!0;a.prototype.getCellElement=function(a,d,k){switch(a){case 0:var a=document.createElement("td"),e=document.createElement("span");e.id=k.id+"MainCol";e.setAttribute("role","presentation");a.appendChild(e);a.setAttribute("role","presentation");
+define("orion/explorers/navigatorRenderer","i18n!orion/navigate/nls/messages orion/Deferred orion/explorers/explorer orion/explorers/navigationUtils orion/extensionCommands orion/objects orion/URITemplate orion/webui/littlelib".split(" "),function(g,n,p,a,l,f,e,d){function h(b){switch(b&&b.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":return!0}return!1}function c(b,c,a,d,g,y,s,v,p,q){var c=f.clone(c),w;if(c.Directory)w=document.createElement("a"),
+w.className="navlinkonpage",w.href=!b?k:(new e(b+"#{,resource,params*}")).expand({resource:c.ChildrenLocation}),c.Name&&w.appendChild(document.createTextNode(c.Name));else{g||(g=l.getOpenWithCommands(a));if(!y)for(b=0;b<g.length;b++)"default"===g[b].isEditor&&(y=g[b]);w=document.createElement("a");w.className="navlink targetSelector";s&&"object"===typeof s&&Object.keys(s).forEach(function(b){w[b]=s[b]});var B=null,A=null;if(B=p?p.holderDom:w)A=document.createElement("span"),A.className="core-sprite-file modelDecorationSprite thumbnail",
+B.appendChild(A);c.Name&&w.appendChild(document.createTextNode(c.Name));var C=!1,M=c.Location;v&&"object"===typeof v&&(c.params={},f.mixin(c.params,v));for(b=0;b<g.length;b++)if(v=g[b],v.visibleWhen(c)){M=v.hrefCallback({items:c});C=!0;break}n.when(d.getFileContentType(c),function(b){!C&&(y&&!h(b))&&(M=y.hrefCallback({items:c}));if(B){var a=B,d=A;if(b){var k,e=b.imageClass,m=b.image;e?(k=document.createElement("span"),k.className+=e,k.classList.add("thumbnail")):m&&(k=document.createElement("img"),
+k.src=m,k.classList.add("thumbnail"));k&&a.replaceChild(k,d)}}w.href=M;q&&"function"===typeof q.updateFileNode&&q.updateFileNode(c,w,h(b))})}return w}function b(b,c,a,d){this.explorer=c;this.commandService=a;this.contentTypeService=d;this.openWithCommands=null;this.actionScopeId=b.actionScopeId;this._init(b);this.target="_self"}var k=new e("#{,resource,params*}");b.prototype=new p.SelectionRenderer;b.prototype.wrapperCallback=function(b){b.setAttribute("role","tree")};b.prototype.tableCallback=function(b){b.setAttribute("aria-label",
+g.Navigator);b.setAttribute("role","presentation")};b.prototype.rowCallback=function(b){b.setAttribute("role","treeitem")};b.prototype.emptyCallback=function(b){var c=document.createElement("tr"),a=document.createElement("td");a.colSpan=this.oneColumn?1:3;var k=document.createElement("div");k.classList.add("noFile");k.textContent=g.NoFile;var e=document.createElement("span");e.classList.add("core-sprite-addcontent");e.classList.add("icon-inline");e.classList.add("imageSprite");d.processDOMNodes(k,
+[e]);a.appendChild(k);c.appendChild(a);b.appendChild(c)};b.prototype.getCellHeaderElement=function(b){if(this.oneColumn&&0!==b)return null;switch(b){case 0:case 1:case 2:document.createElement("th").style.height="8px"}};b.prototype.setTarget=function(b){this.target=b};b.prototype.getFolderImage=function(){if(!this.showFolderImage)return null;var b=document.createElement("span");b.className="core-sprite-folder modelDecorationSprite";return b};b.prototype.createFolderNode=function(b){var a;this.showFolderLinks?
+(a=c(this.folderLink||"",b,this.commandService,this.contentTypeService),(b=this.getFolderImage(b))&&a.insertBefore(b,a.firstChild)):(a=document.createElement("span"),a.textContent=b.Name);return a};b.prototype.updateFileNode=function(){};b.prototype.showFolderLinks=!0;b.prototype.getCellElement=function(b,d,k){switch(b){case 0:var b=document.createElement("td"),e=document.createElement("span");e.id=k.id+"MainCol";e.setAttribute("role","presentation");b.appendChild(e);b.setAttribute("role","presentation");
 e.className="mainNavColumn";var h;if(d.Directory)this.getExpandImage(k,e),h=this.createFolderNode(d),e.appendChild(h),this.explorer._makeDropTarget(d,h),this.explorer._makeDropTarget(d,k);else{if(!this.openWithCommands){this.openWithCommands=l.getOpenWithCommands(this.commandService);for(h=0;h<this.openWithCommands.length;h++)"default"===this.openWithCommands[h].isEditor&&(this.defaultEditor=this.openWithCommands[h])}h=c("",d,this.commandService,this.contentTypeService,this.openWithCommands,this.defaultEditor,
-{target:this.target},null,null,this);e.appendChild(h)}h&&(h.id=k.id+"NameLink",1===h.nodeType&&(b.addNavGrid(this.explorer.getNavDict(),d,h),h.setAttribute("role","link"),h.setAttribute("tabindex","-1")));this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,e,d,this.explorer,"tool",null,!0);return a;case 1:if(this.oneColumn)return null;k=document.createElement("td");d.LocalTimeStamp&&(k.textContent=(new Date(d.LocalTimeStamp)).toLocaleString());return k;case 2:if(this.oneColumn)return null;
-k=document.createElement("td");!d.Directory&&"number"===typeof d.Length&&(d=parseInt(d.Length,10)/1024,k.textContent=Math.ceil(d).toLocaleString()+" KB");k.style.textAlign="right";return k}};a.prototype.constructor=a;return{NavigatorRenderer:a,isImage:h,createLink:c}});
-(function(){function g(a){this.tokens=[];this.tokens.links={};this.options=a||d.defaults;this.rules=h.normal;this.options.gfm&&(this.rules=this.options.tables?h.tables:h.gfm)}function n(a,b){this.options=b||d.defaults;this.links=a;this.rules=c.normal;if(!this.links)throw Error("Tokens array requires a `links` property.");this.options.gfm?this.rules=this.options.breaks?c.breaks:c.gfm:this.options.pedantic&&(this.rules=c.pedantic)}function p(a){this.tokens=[];this.token=null;this.options=a||d.defaults}
-function b(a,c){return a.replace(!c?/&(?!#?\w+;)/g:/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function l(a,c){a=a.source;c=c||"";return function r(b,d){if(!b)return RegExp(a,c);d=d.source||d;d=d.replace(/(^|[^\[])\^/g,"$1");a=a.replace(b,d);return r}}function f(){}function e(a){for(var c=1,b,d;c<arguments.length;c++)for(d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a}function d(a,c,m){if(m||"function"===
-typeof c){m||(m=c,c=null);c&&(c=e({},d.defaults,c));var r=c.highlight,l,h,f=0;try{l=g.lex(a,c)}catch(y){return m(y)}h=l.length;var s=function(a){var q,b;!0!==a&&delete c.highlight;try{q=p.parse(l,c)}catch(d){b=d}c.highlight=r;return b?m(b):m(null,q)};if(!r||3>r.length)return s(!0);if(!h)return s();for(;f<l.length;f++)(function(a){return"code"!==a.type?--h||s():r(a.text,a.lang,function(q,c){if(null==c||c===a.text)return--h||s();a.text=c;a.escaped=!0;--h||s()})})(l[f])}else try{return c&&(c=e({},d.defaults,
-c)),p.parse(g.lex(a,c),c)}catch(u){u.message+="\nPlease report this to https://github.com/chjj/marked.";if((c||d.defaults).silent)return"<p>An error occured:</p><pre>"+b(u.message+"",!0)+"</pre>";throw u;}}var h={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:f,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:f,lheading:/^([^\n]+)\n *(=|-){3,} *\n*/,blockquote:/^( *>[^\n]+(\n[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,
+{target:this.target},null,null,this);e.appendChild(h)}h&&(h.id=k.id+"NameLink",1===h.nodeType&&(a.addNavGrid(this.explorer.getNavDict(),d,h),h.setAttribute("role","link"),h.setAttribute("tabindex","-1")));this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,e,d,this.explorer,"tool",null,!0);return b;case 1:if(this.oneColumn)return null;k=document.createElement("td");d.LocalTimeStamp&&(k.textContent=(new Date(d.LocalTimeStamp)).toLocaleString());return k;case 2:if(this.oneColumn)return null;
+k=document.createElement("td");!d.Directory&&"number"===typeof d.Length&&(d=parseInt(d.Length,10)/1024,k.textContent=Math.ceil(d).toLocaleString()+" KB");k.style.textAlign="right";return k}};b.prototype.constructor=b;return{NavigatorRenderer:b,isImage:h,createLink:c}});
+(function(){function g(b){this.tokens=[];this.tokens.links={};this.options=b||d.defaults;this.rules=h.normal;this.options.gfm&&(this.rules=this.options.tables?h.tables:h.gfm)}function n(b,a){this.options=a||d.defaults;this.links=b;this.rules=c.normal;if(!this.links)throw Error("Tokens array requires a `links` property.");this.options.gfm?this.rules=this.options.breaks?c.breaks:c.gfm:this.options.pedantic&&(this.rules=c.pedantic)}function p(b){this.tokens=[];this.token=null;this.options=b||d.defaults}
+function a(b,c){return b.replace(!c?/&(?!#?\w+;)/g:/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function l(b,c){b=b.source;c=c||"";return function r(a,d){if(!a)return RegExp(b,c);d=d.source||d;d=d.replace(/(^|[^\[])\^/g,"$1");b=b.replace(a,d);return r}}function f(){}function e(b){for(var c=1,a,d;c<arguments.length;c++)for(d in a=arguments[c],a)Object.prototype.hasOwnProperty.call(a,d)&&(b[d]=a[d]);return b}function d(b,c,m){if(m||"function"===
+typeof c){m||(m=c,c=null);c&&(c=e({},d.defaults,c));var l=c.highlight,h,f,t=0;try{h=g.lex(b,c)}catch(y){return m(y)}f=h.length;var s=function(b){var q,a;!0!==b&&delete c.highlight;try{q=p.parse(h,c)}catch(d){a=d}c.highlight=l;return a?m(a):m(null,q)};if(!l||3>l.length)return s(!0);if(!f)return s();for(;t<h.length;t++)(function(b){return"code"!==b.type?--f||s():l(b.text,b.lang,function(q,c){if(null==c||c===b.text)return--f||s();b.text=c;b.escaped=!0;--f||s()})})(h[t])}else try{return c&&(c=e({},d.defaults,
+c)),p.parse(g.lex(b,c),c)}catch(v){v.message+="\nPlease report this to https://github.com/chjj/marked.";if((c||d.defaults).silent)return"<p>An error occured:</p><pre>"+a(v.message+"",!0)+"</pre>";throw v;}}var h={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:f,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:f,lheading:/^([^\n]+)\n *(=|-){3,} *\n*/,blockquote:/^( *>[^\n]+(\n[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,
 def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:f,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/,bullet:/(?:[*+-]|\d+\.)/,item:/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/};h.item=l(h.item,"gm")(/bull/g,h.bullet)();h.list=l(h.list)(/bull/g,h.bullet)("hr",/\n+(?=(?: *[-*_]){3,} *(?:\n+|$))/)();h._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|@)\\b";
 h.html=l(h.html)("comment",/<\!--[\s\S]*?--\>/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,h._tag)();h.paragraph=l(h.paragraph)("hr",h.hr)("heading",h.heading)("lheading",h.lheading)("blockquote",h.blockquote)("tag","<"+h._tag)("def",h.def)();h.normal=e({},h);h.gfm=e({},h.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/});h.gfm.paragraph=l(h.paragraph)("(?!","(?!"+h.gfm.fences.source.replace("\\1","\\2")+"|")();h.tables=
-e({},h.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});g.rules=h;g.lex=function(a,c){return(new g(c)).lex(a)};g.prototype.lex=function(a){a=a.replace(/\r\n|\r/g,"\n").replace(/\t/g,"    ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(a,!0)};g.prototype.token=function(a,c){for(var a=a.replace(/^ +$/gm,""),b,d,e,l,f,g,s;a;){if(e=this.rules.newline.exec(a))a=a.substring(e[0].length),1<
-e[0].length&&this.tokens.push({type:"space"});if(e=this.rules.code.exec(a))a=a.substring(e[0].length),e=e[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:!this.options.pedantic?e.replace(/\n+$/,""):e});else if(e=this.rules.fences.exec(a))a=a.substring(e[0].length),this.tokens.push({type:"code",lang:e[2],text:e[3]});else if(e=this.rules.heading.exec(a))a=a.substring(e[0].length),this.tokens.push({type:"heading",depth:e[1].length,text:e[2]});else if(c&&(e=this.rules.nptable.exec(a))){a=
-a.substring(e[0].length);f={type:"table",header:e[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3].replace(/\n$/,"").split("\n")};for(g=0;g<f.align.length;g++)f.align[g]=/^ *-+: *$/.test(f.align[g])?"right":/^ *:-+: *$/.test(f.align[g])?"center":/^ *:-+ *$/.test(f.align[g])?"left":null;for(g=0;g<f.cells.length;g++)f.cells[g]=f.cells[g].split(/ *\| */);this.tokens.push(f)}else if(e=this.rules.lheading.exec(a))a=a.substring(e[0].length),this.tokens.push({type:"heading",
-depth:"="===e[2]?1:2,text:e[1]});else if(e=this.rules.hr.exec(a))a=a.substring(e[0].length),this.tokens.push({type:"hr"});else if(e=this.rules.blockquote.exec(a))a=a.substring(e[0].length),this.tokens.push({type:"blockquote_start"}),e=e[0].replace(/^ *> ?/gm,""),this.token(e,c),this.tokens.push({type:"blockquote_end"});else if(e=this.rules.list.exec(a)){a=a.substring(e[0].length);l=e[2];this.tokens.push({type:"list_start",ordered:1<l.length});e=e[0].match(this.rules.item);b=!1;s=e.length;for(g=0;g<
-s;g++)f=e[g],d=f.length,f=f.replace(/^ *([*+-]|\d+\.) +/,""),~f.indexOf("\n ")&&(d-=f.length,f=!this.options.pedantic?f.replace(RegExp("^ {1,"+d+"}","gm"),""):f.replace(/^ {1,4}/gm,"")),this.options.smartLists&&g!==s-1&&(d=h.bullet.exec(e[g+1])[0],l!==d&&!(1<l.length&&1<d.length)&&(a=e.slice(g+1).join("\n")+a,g=s-1)),d=b||/\n\n(?!\s*$)/.test(f),g!==s-1&&(b="\n"===f[f.length-1],d||(d=b)),this.tokens.push({type:d?"loose_item_start":"list_item_start"}),this.token(f,!1),this.tokens.push({type:"list_item_end"});
-this.tokens.push({type:"list_end"})}else if(e=this.rules.html.exec(a))a=a.substring(e[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:"pre"===e[1]||"script"===e[1],text:e[0]});else if(c&&(e=this.rules.def.exec(a)))a=a.substring(e[0].length),this.tokens.links[e[1].toLowerCase()]={href:e[2],title:e[3]};else if(c&&(e=this.rules.table.exec(a))){a=a.substring(e[0].length);f={type:"table",header:e[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:e[2].replace(/^ *|\| *$/g,
-"").split(/ *\| */),cells:e[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(g=0;g<f.align.length;g++)f.align[g]=/^ *-+: *$/.test(f.align[g])?"right":/^ *:-+: *$/.test(f.align[g])?"center":/^ *:-+ *$/.test(f.align[g])?"left":null;for(g=0;g<f.cells.length;g++)f.cells[g]=f.cells[g].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(f)}else if(c&&(e=this.rules.paragraph.exec(a)))a=a.substring(e[0].length),this.tokens.push({type:"paragraph",text:"\n"===e[1][e[1].length-1]?e[1].slice(0,-1):
-e[1]});else if(e=this.rules.text.exec(a))a=a.substring(e[0].length),this.tokens.push({type:"text",text:e[0]});else if(a)throw Error("Infinite loop on byte: "+a.charCodeAt(0));}return this.tokens};var c={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:f,tag:/^<\!--[\s\S]*?--\>|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
+e({},h.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});g.rules=h;g.lex=function(b,c){return(new g(c)).lex(b)};g.prototype.lex=function(b){b=b.replace(/\r\n|\r/g,"\n").replace(/\t/g,"    ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(b,!0)};g.prototype.token=function(b,c){for(var b=b.replace(/^ +$/gm,""),a,d,e,l,f,g,s;b;){if(e=this.rules.newline.exec(b))b=b.substring(e[0].length),1<
+e[0].length&&this.tokens.push({type:"space"});if(e=this.rules.code.exec(b))b=b.substring(e[0].length),e=e[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:!this.options.pedantic?e.replace(/\n+$/,""):e});else if(e=this.rules.fences.exec(b))b=b.substring(e[0].length),this.tokens.push({type:"code",lang:e[2],text:e[3]});else if(e=this.rules.heading.exec(b))b=b.substring(e[0].length),this.tokens.push({type:"heading",depth:e[1].length,text:e[2]});else if(c&&(e=this.rules.nptable.exec(b))){b=
+b.substring(e[0].length);f={type:"table",header:e[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3].replace(/\n$/,"").split("\n")};for(g=0;g<f.align.length;g++)f.align[g]=/^ *-+: *$/.test(f.align[g])?"right":/^ *:-+: *$/.test(f.align[g])?"center":/^ *:-+ *$/.test(f.align[g])?"left":null;for(g=0;g<f.cells.length;g++)f.cells[g]=f.cells[g].split(/ *\| */);this.tokens.push(f)}else if(e=this.rules.lheading.exec(b))b=b.substring(e[0].length),this.tokens.push({type:"heading",
+depth:"="===e[2]?1:2,text:e[1]});else if(e=this.rules.hr.exec(b))b=b.substring(e[0].length),this.tokens.push({type:"hr"});else if(e=this.rules.blockquote.exec(b))b=b.substring(e[0].length),this.tokens.push({type:"blockquote_start"}),e=e[0].replace(/^ *> ?/gm,""),this.token(e,c),this.tokens.push({type:"blockquote_end"});else if(e=this.rules.list.exec(b)){b=b.substring(e[0].length);l=e[2];this.tokens.push({type:"list_start",ordered:1<l.length});e=e[0].match(this.rules.item);a=!1;s=e.length;for(g=0;g<
+s;g++)f=e[g],d=f.length,f=f.replace(/^ *([*+-]|\d+\.) +/,""),~f.indexOf("\n ")&&(d-=f.length,f=!this.options.pedantic?f.replace(RegExp("^ {1,"+d+"}","gm"),""):f.replace(/^ {1,4}/gm,"")),this.options.smartLists&&g!==s-1&&(d=h.bullet.exec(e[g+1])[0],l!==d&&!(1<l.length&&1<d.length)&&(b=e.slice(g+1).join("\n")+b,g=s-1)),d=a||/\n\n(?!\s*$)/.test(f),g!==s-1&&(a="\n"===f[f.length-1],d||(d=a)),this.tokens.push({type:d?"loose_item_start":"list_item_start"}),this.token(f,!1),this.tokens.push({type:"list_item_end"});
+this.tokens.push({type:"list_end"})}else if(e=this.rules.html.exec(b))b=b.substring(e[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:"pre"===e[1]||"script"===e[1],text:e[0]});else if(c&&(e=this.rules.def.exec(b)))b=b.substring(e[0].length),this.tokens.links[e[1].toLowerCase()]={href:e[2],title:e[3]};else if(c&&(e=this.rules.table.exec(b))){b=b.substring(e[0].length);f={type:"table",header:e[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:e[2].replace(/^ *|\| *$/g,
+"").split(/ *\| */),cells:e[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(g=0;g<f.align.length;g++)f.align[g]=/^ *-+: *$/.test(f.align[g])?"right":/^ *:-+: *$/.test(f.align[g])?"center":/^ *:-+ *$/.test(f.align[g])?"left":null;for(g=0;g<f.cells.length;g++)f.cells[g]=f.cells[g].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(f)}else if(c&&(e=this.rules.paragraph.exec(b)))b=b.substring(e[0].length),this.tokens.push({type:"paragraph",text:"\n"===e[1][e[1].length-1]?e[1].slice(0,-1):
+e[1]});else if(e=this.rules.text.exec(b))b=b.substring(e[0].length),this.tokens.push({type:"text",text:e[0]});else if(b)throw Error("Infinite loop on byte: "+b.charCodeAt(0));}return this.tokens};var c={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:f,tag:/^<\!--[\s\S]*?--\>|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
 em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/,_inside:/(?:\[[^\]]*\]|[^\]]|\](?=[^\[]*\]))*/,_href:/\s*<?([^\s]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/};c.link=l(c.link)("inside",c._inside)("href",c._href)();c.reflink=l(c.reflink)("inside",c._inside)();c.normal=e({},c);c.pedantic=e({},c.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});
-c.gfm=e({},c.normal,{escape:l(c.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:l(c.text)("]|","~]|")("|","|https?://|")()});c.breaks=e({},c.gfm,{br:l(c.br)("{2,}","*")(),text:l(c.gfm.text)("{2,}","*")()});n.rules=c;n.output=function(a,c,b){return(new n(c,b)).output(a)};n.prototype.output=function(a){for(var c="",d,e;a;)if(e=this.rules.escape.exec(a))a=a.substring(e[0].length),c+=e[1];else if(e=this.rules.autolink.exec(a))a=a.substring(e[0].length),
-"@"===e[2]?(d=":"===e[1][6]?this.mangle(e[1].substring(7)):this.mangle(e[1]),e=this.mangle("mailto:")+d):e=d=b(e[1]),c+='<a href="'+e+'">'+d+"</a>";else if(e=this.rules.url.exec(a))a=a.substring(e[0].length),e=d=b(e[1]),c+='<a href="'+e+'">'+d+"</a>";else if(e=this.rules.tag.exec(a))a=a.substring(e[0].length),c+=this.options.sanitize?b(e[0]):e[0];else if(e=this.rules.link.exec(a))a=a.substring(e[0].length),c+=this.outputLink(e,{href:e[2],title:e[3]});else if((e=this.rules.reflink.exec(a))||(e=this.rules.nolink.exec(a)))a=
-a.substring(e[0].length),d=(e[2]||e[1]).replace(/\s+/g," "),d=this.links[d.toLowerCase()],!d||!d.href?(c+=e[0][0],a=e[0].substring(1)+a):c+=this.outputLink(e,d);else if(e=this.rules.strong.exec(a))a=a.substring(e[0].length),c+="<strong>"+this.output(e[2]||e[1])+"</strong>";else if(e=this.rules.em.exec(a))a=a.substring(e[0].length),c+="<em>"+this.output(e[2]||e[1])+"</em>";else if(e=this.rules.code.exec(a))a=a.substring(e[0].length),c+="<code>"+b(e[2],!0)+"</code>";else if(e=this.rules.br.exec(a))a=
-a.substring(e[0].length),c+="<br>";else if(e=this.rules.del.exec(a))a=a.substring(e[0].length),c+="<del>"+this.output(e[1])+"</del>";else if(e=this.rules.text.exec(a))a=a.substring(e[0].length),c+=b(this.smartypants(e[0]));else if(a)throw Error("Infinite loop on byte: "+a.charCodeAt(0));return c};n.prototype.outputLink=function(a,c){return"!"!==a[0][0]?'<a href="'+b(c.href)+'"'+(c.title?' title="'+b(c.title)+'"':"")+">"+this.output(a[1])+"</a>":'<img src="'+b(c.href)+'" alt="'+b(a[1])+'"'+(c.title?
-' title="'+b(c.title)+'"':"")+">"};n.prototype.smartypants=function(a){return!this.options.smartypants?a:a.replace(/--/g,"\u2014").replace(/'([^']*)'/g,"\u2018$1\u2019").replace(/"([^"]*)"/g,"\u201c$1\u201d").replace(/\.{3}/g,"\u2026")};n.prototype.mangle=function(a){for(var c="",b=a.length,d=0,e;d<b;d++)e=a.charCodeAt(d),0.5<Math.random()&&(e="x"+e.toString(16)),c+="&#"+e+";";return c};p.parse=function(a,c){return(new p(c)).parse(a)};p.prototype.parse=function(a){this.inline=new n(a.links,this.options);
-this.tokens=a.reverse();for(a="";this.next();)a+=this.tok();return a};p.prototype.next=function(){return this.token=this.tokens.pop()};p.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};p.prototype.parseText=function(){for(var a=this.token.text;"text"===this.peek().type;)a+="\n"+this.next().text;return this.inline.output(a)};p.prototype.tok=function(){switch(this.token.type){case "space":return"";case "hr":return"<hr>\n";case "heading":return"<h"+this.token.depth+">"+this.inline.output(this.token.text)+
-"</h"+this.token.depth+">\n";case "code":if(this.options.highlight){var a=this.options.highlight(this.token.text,this.token.lang);null!=a&&a!==this.token.text&&(this.token.escaped=!0,this.token.text=a)}this.token.escaped||(this.token.text=b(this.token.text,!0));return"<pre><code"+(this.token.lang?' class="'+this.options.langPrefix+this.token.lang+'"':"")+">"+this.token.text+"</code></pre>\n";case "table":var c,d,e,l,a="<thead>\n<tr>\n";for(d=0;d<this.token.header.length;d++)c=this.inline.output(this.token.header[d]),
-a+=this.token.align[d]?'<th align="'+this.token.align[d]+'">'+c+"</th>\n":"<th>"+c+"</th>\n";a+="</tr>\n</thead>\n<tbody>\n";for(d=0;d<this.token.cells.length;d++){c=this.token.cells[d];a+="<tr>\n";for(l=0;l<c.length;l++)e=this.inline.output(c[l]),a+=this.token.align[l]?'<td align="'+this.token.align[l]+'">'+e+"</td>\n":"<td>"+e+"</td>\n";a+="</tr>\n"}a+="</tbody>\n";return"<table>\n"+a+"</table>\n";case "blockquote_start":for(a="";"blockquote_end"!==this.next().type;)a+=this.tok();return"<blockquote>\n"+
-a+"</blockquote>\n";case "list_start":d=this.token.ordered?"ol":"ul";for(a="";"list_end"!==this.next().type;)a+=this.tok();return"<"+d+">\n"+a+"</"+d+">\n";case "list_item_start":for(a="";"list_item_end"!==this.next().type;)a+="text"===this.token.type?this.parseText():this.tok();return"<li>"+a+"</li>\n";case "loose_item_start":for(a="";"list_item_end"!==this.next().type;)a+=this.tok();return"<li>"+a+"</li>\n";case "html":return!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):
-this.token.text;case "paragraph":return"<p>"+this.inline.output(this.token.text)+"</p>\n";case "text":return"<p>"+this.parseText()+"</p>\n"}};f.exec=f;d.options=d.setOptions=function(a){e(d.defaults,a);return d};d.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1};d.Parser=p;d.parser=p.parse;d.Lexer=g;d.lexer=g.lex;d.InlineLexer=n;d.inlineLexer=n.output;d.parse=d;"object"===typeof exports?module.exports=d:"function"===
-typeof define&&define.amd?define("marked/marked",[],function(){return d}):this.marked=d}).call(function(){return this||("undefined"!==typeof window?window:global)}());define("orion/editor/i18n",{load:function(g,n,p){n.specified&&n.specified("orion/bootstrap")?n(["orion/i18n!"+g],function(b){p(b)}):p({})}});
+c.gfm=e({},c.normal,{escape:l(c.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:l(c.text)("]|","~]|")("|","|https?://|")()});c.breaks=e({},c.gfm,{br:l(c.br)("{2,}","*")(),text:l(c.gfm.text)("{2,}","*")()});n.rules=c;n.output=function(b,c,a){return(new n(c,a)).output(b)};n.prototype.output=function(b){for(var c="",d,e;b;)if(e=this.rules.escape.exec(b))b=b.substring(e[0].length),c+=e[1];else if(e=this.rules.autolink.exec(b))b=b.substring(e[0].length),
+"@"===e[2]?(d=":"===e[1][6]?this.mangle(e[1].substring(7)):this.mangle(e[1]),e=this.mangle("mailto:")+d):e=d=a(e[1]),c+='<a href="'+e+'">'+d+"</a>";else if(e=this.rules.url.exec(b))b=b.substring(e[0].length),e=d=a(e[1]),c+='<a href="'+e+'">'+d+"</a>";else if(e=this.rules.tag.exec(b))b=b.substring(e[0].length),c+=this.options.sanitize?a(e[0]):e[0];else if(e=this.rules.link.exec(b))b=b.substring(e[0].length),c+=this.outputLink(e,{href:e[2],title:e[3]});else if((e=this.rules.reflink.exec(b))||(e=this.rules.nolink.exec(b)))b=
+b.substring(e[0].length),d=(e[2]||e[1]).replace(/\s+/g," "),d=this.links[d.toLowerCase()],!d||!d.href?(c+=e[0][0],b=e[0].substring(1)+b):c+=this.outputLink(e,d);else if(e=this.rules.strong.exec(b))b=b.substring(e[0].length),c+="<strong>"+this.output(e[2]||e[1])+"</strong>";else if(e=this.rules.em.exec(b))b=b.substring(e[0].length),c+="<em>"+this.output(e[2]||e[1])+"</em>";else if(e=this.rules.code.exec(b))b=b.substring(e[0].length),c+="<code>"+a(e[2],!0)+"</code>";else if(e=this.rules.br.exec(b))b=
+b.substring(e[0].length),c+="<br>";else if(e=this.rules.del.exec(b))b=b.substring(e[0].length),c+="<del>"+this.output(e[1])+"</del>";else if(e=this.rules.text.exec(b))b=b.substring(e[0].length),c+=a(this.smartypants(e[0]));else if(b)throw Error("Infinite loop on byte: "+b.charCodeAt(0));return c};n.prototype.outputLink=function(b,c){return"!"!==b[0][0]?'<a href="'+a(c.href)+'"'+(c.title?' title="'+a(c.title)+'"':"")+">"+this.output(b[1])+"</a>":'<img src="'+a(c.href)+'" alt="'+a(b[1])+'"'+(c.title?
+' title="'+a(c.title)+'"':"")+">"};n.prototype.smartypants=function(b){return!this.options.smartypants?b:b.replace(/--/g,"\u2014").replace(/'([^']*)'/g,"\u2018$1\u2019").replace(/"([^"]*)"/g,"\u201c$1\u201d").replace(/\.{3}/g,"\u2026")};n.prototype.mangle=function(b){for(var c="",a=b.length,d=0,e;d<a;d++)e=b.charCodeAt(d),0.5<Math.random()&&(e="x"+e.toString(16)),c+="&#"+e+";";return c};p.parse=function(b,c){return(new p(c)).parse(b)};p.prototype.parse=function(b){this.inline=new n(b.links,this.options);
+this.tokens=b.reverse();for(b="";this.next();)b+=this.tok();return b};p.prototype.next=function(){return this.token=this.tokens.pop()};p.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};p.prototype.parseText=function(){for(var b=this.token.text;"text"===this.peek().type;)b+="\n"+this.next().text;return this.inline.output(b)};p.prototype.tok=function(){switch(this.token.type){case "space":return"";case "hr":return"<hr>\n";case "heading":return"<h"+this.token.depth+">"+this.inline.output(this.token.text)+
+"</h"+this.token.depth+">\n";case "code":if(this.options.highlight){var b=this.options.highlight(this.token.text,this.token.lang);null!=b&&b!==this.token.text&&(this.token.escaped=!0,this.token.text=b)}this.token.escaped||(this.token.text=a(this.token.text,!0));return"<pre><code"+(this.token.lang?' class="'+this.options.langPrefix+this.token.lang+'"':"")+">"+this.token.text+"</code></pre>\n";case "table":var c,d,e,l,b="<thead>\n<tr>\n";for(d=0;d<this.token.header.length;d++)c=this.inline.output(this.token.header[d]),
+b+=this.token.align[d]?'<th align="'+this.token.align[d]+'">'+c+"</th>\n":"<th>"+c+"</th>\n";b+="</tr>\n</thead>\n<tbody>\n";for(d=0;d<this.token.cells.length;d++){c=this.token.cells[d];b+="<tr>\n";for(l=0;l<c.length;l++)e=this.inline.output(c[l]),b+=this.token.align[l]?'<td align="'+this.token.align[l]+'">'+e+"</td>\n":"<td>"+e+"</td>\n";b+="</tr>\n"}b+="</tbody>\n";return"<table>\n"+b+"</table>\n";case "blockquote_start":for(b="";"blockquote_end"!==this.next().type;)b+=this.tok();return"<blockquote>\n"+
+b+"</blockquote>\n";case "list_start":d=this.token.ordered?"ol":"ul";for(b="";"list_end"!==this.next().type;)b+=this.tok();return"<"+d+">\n"+b+"</"+d+">\n";case "list_item_start":for(b="";"list_item_end"!==this.next().type;)b+="text"===this.token.type?this.parseText():this.tok();return"<li>"+b+"</li>\n";case "loose_item_start":for(b="";"list_item_end"!==this.next().type;)b+=this.tok();return"<li>"+b+"</li>\n";case "html":return!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):
+this.token.text;case "paragraph":return"<p>"+this.inline.output(this.token.text)+"</p>\n";case "text":return"<p>"+this.parseText()+"</p>\n"}};f.exec=f;d.options=d.setOptions=function(b){e(d.defaults,b);return d};d.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1};d.Parser=p;d.parser=p.parse;d.Lexer=g;d.lexer=g.lex;d.InlineLexer=n;d.inlineLexer=n.output;d.parse=d;"object"===typeof exports?module.exports=d:"function"===
+typeof define&&define.amd?define("marked/marked",[],function(){return d}):this.marked=d}).call(function(){return this||("undefined"!==typeof window?window:global)}());define("orion/editor/i18n",{load:function(g,n,p){n.specified&&n.specified("orion/bootstrap")?n(["orion/i18n!"+g],function(a){p(a)}):p({})}});
 define("orion/editor/nls/root/messages",{multipleAnnotations:"Multiple annotations:",line:"Line: ${0}",breakpoint:"Breakpoint",bookmark:"Bookmark",task:"Task",error:"Error",warning:"Warning",matchingSearch:"Matching Search",currentSearch:"Current Search",currentLine:"Current Line",matchingBracket:"Matching Bracket",currentBracket:"Current Bracket",lineUp:"Line Up",lineDown:"Line Down",lineStart:"Line Start",lineEnd:"Line End",charPrevious:"Previous Character",charNext:"Next Character",pageUp:"Page Up",
 pageDown:"Page Down",scrollPageUp:"Scroll Page Up",scrollPageDown:"Scroll Page Down",scrollLineUp:"Scroll Line Up",scrollLineDown:"Scroll Line Down",wordPrevious:"Previous Word",wordNext:"Next Word",textStart:"Document Start",textEnd:"Document End",scrollTextStart:"Scroll Document Start",scrollTextEnd:"Scroll Document End",centerLine:"Center Line",selectLineUp:"Select Line Up",selectLineDown:"Select Line Down",selectWholeLineUp:" Select Whole Line Up",selectWholeLineDown:"Select Whole Line Down",
 selectLineStart:"Select Line Start",selectLineEnd:"Select Line End",selectCharPrevious:"Select Previous Character",selectCharNext:"Select Next Character",selectPageUp:"Select Page Up",selectPageDown:"Select Page Down",selectWordPrevious:"Select Previous Word",selectWordNext:"Select Next Word",selectTextStart:"Select Document Start",selectTextEnd:"Select Document End",deletePrevious:"Delete Previous Character",deleteNext:"Delete Next Character",deleteWordPrevious:"Delete Previous Word",deleteWordNext:"Delete Next Word",
@@ -990,530 +993,531 @@
 viUp:"${0} Up",viDown:"${0} Down",viw:"${0} Next Word",vib:"${0} Beginning of Word",viW:"${0} Next Word (ws stop)",viB:"${0} Beginning of Word (ws stop)",vie:"${0} End of Word",viE:"${0} End of Word (ws stop)",vi$:"${0} End of the line","vi^_":"${0} First non-blank Char Current Line","vi+":"${0} First Char Next Line","vi-":"${0} First Char Previous Line","vi|":"${0} nth Column in Line",viH:"${0} Top of Page",viM:"${0} Middle of Page",viL:"${0} Bottom of Page","vi/":"${0} Search Forward","vi?":"${0} Search Backward",
 vin:"${0} Next Search",viN:"${0} Previous Search",vif:"${0} Search Char Fwd",viF:"${0} Search Char Bckwd",vit:"${0} Search Before Char Fwd",viT:"${0} Search Before Char Bckwd","vi,":"${0} Repeat Reverse Char Search","vi;":"${0} Repeat Char Search",viG:"${0} Go to Line",viycd:"${0} Current Line",via:"Append After Cursor",viA:"Append to End of Line",vii:"Insert Before Cursor",viI:"Insert at Beginning of Line",viO:"Insert Line Above",vio:"Insert Line Below",viR:"Begin Overwriting Text",vis:"Substitute a Character",
 viS:"Substitute Entire Line",viC:"Change Text Until Line End",vip:"Paste After Char or Line",viP:"Paste Before Char or Line",viStar:"Search Word Under Cursor",replaceAll:"Replacing all...",replacedMatches:"Replaced ${0} matches",nothingReplaced:"Nothing replaced",notFound:"Not found"});
-define("orion/editor/nls/messages",["orion/editor/i18n!orion/editor/nls/messages","orion/editor/nls/root/messages"],function(g,n){var p={root:n},b;for(b in g)g.hasOwnProperty(b)&&"undefined"===typeof p[b]&&(p[b]=g[b]);return p});
-define("orion/editor/eventTarget",[],function(){function g(){}g.addMixin=function(n){var p=g.prototype,b;for(b in p)p.hasOwnProperty(b)&&(n[b]=p[b])};g.prototype={addEventListener:function(g,p,b){this._eventTypes||(this._eventTypes={});var l=this._eventTypes[g];l||(l=this._eventTypes[g]={level:0,listeners:[]});l.listeners.push({listener:p,useCapture:b})},dispatchEvent:function(g){var p=g.type;this._dispatchEvent("pre"+p,g);this._dispatchEvent(p,g);this._dispatchEvent("post"+p,g)},_dispatchEvent:function(g,
-p){var b=this._eventTypes?this._eventTypes[g]:null;if(b){var l=b.listeners;try{if(b.level++,l)for(var f=0,e=l.length;f<e;f++)if(l[f]){var d=l[f].listener;"function"===typeof d?d.call(this,p):d.handleEvent&&"function"===typeof d.handleEvent&&d.handleEvent(p)}}finally{if(b.level--,b.compact&&0===b.level){for(f=l.length-1;0<=f;f--)l[f]||l.splice(f,1);0===l.length&&delete this._eventTypes[g];b.compact=!1}}}},isListening:function(g){return!this._eventTypes?!1:void 0!==this._eventTypes[g]},removeEventListener:function(g,
-p,b){if(this._eventTypes){var l=this._eventTypes[g];if(l){for(var f=l.listeners,e=0,d=f.length;e<d;e++){var h=f[e];if(h&&h.listener===p&&h.useCapture===b){0!==l.level?(f[e]=null,l.compact=!0):f.splice(e,1);break}}0===f.length&&delete this._eventTypes[g]}}}};return{EventTarget:g}});define("orion/regex",[],function(){return{escape:function(g){return g.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")},parse:function(g){return(g=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(g))?{pattern:g[1],flags:g[2]}:null}}});
-define("orion/editor/textModel",["orion/editor/eventTarget","orion/regex","orion/util"],function(g,n,p){function b(b,f){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(b);this.setLineDelimiter(f)}b.prototype={destroy:function(){},find:function(b){1<this._text.length&&(this._text=[this._text.join("")]);var f=b.string,e=b.regex,d=f,h="",c=b.caseInsensitive;if(d)if(e){if(f=n.parse(d))d=f.pattern,h=f.flags}else d=f.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"),c&&(d=d.replace(/[iI\u0130\u0131]/g,
-"[Ii\u0130\u0131]"));var a=null,k;if(d){var f=b.reverse,m=b.wrap,e=b.wholeWord,r=b.start||0,b=b.end,g=null!==b&&void 0!==b;-1===h.indexOf("g")&&(h+="g");-1===h.indexOf("m")&&(h+="m");c&&-1===h.indexOf("i")&&(h+="i");e&&(d="\\b"+d+"\\b");var v=this._text[0],t,y,s=0;g&&(c=r<b?r:b,v=v.substring(c,r<b?b:r),s=c);var u=RegExp(d,h);f?k=function(){var a=null;for(u.lastIndex=0;;){y=u.lastIndex;t=u.exec(v);if(y===u.lastIndex)return null;if(t){if(!(t.index+s<r)){if(!m||a)break;r=v.length+s}a={start:t.index+
-s,end:u.lastIndex+s}}else break}a&&(r=a.start);return a}:(g||(u.lastIndex=r),k=function(){for(;;){y=u.lastIndex;t=u.exec(v);if(y===u.lastIndex)break;if(t)return{start:t.index+s,end:u.lastIndex+s};if(!(0!==y&&m))break}return null});a=k()}return{next:function(){var c=a;c&&(a=k());return c},hasNext:function(){return null!==a}}},getCharCount:function(){for(var b=0,f=0;f<this._text.length;f++)b+=this._text[f].length;return b},getLine:function(b,f){var e=this.getLineCount();if(!(0<=b&&b<e))return null;
-var d=this._lineOffsets[b];if(b+1<e){e=this.getText(d,this._lineOffsets[b+1]);if(f)return e;for(var d=e.length,h;10===(h=e.charCodeAt(d-1))||13===h;)d--;return e.substring(0,d)}return this.getText(d)},getLineAtOffset:function(b){var f=this.getCharCount();if(!(0<=b&&b<=f))return-1;var e=this.getLineCount();if(b===f)return e-1;var d,h,c=this._lastLineIndex;if(0<=c&&c<e&&(d=this._lineOffsets[c],h=c+1<e?this._lineOffsets[c+1]:f,d<=b&&b<h))return c;for(var a=e,k=-1;1<a-k;)if(c=Math.floor((a+k)/2),d=this._lineOffsets[c],
-h=c+1<e?this._lineOffsets[c+1]:f,b<=d)a=c;else if(b<h){a=c;break}else k=c;return this._lastLineIndex=a},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(b,f){var e=this.getLineCount();if(!(0<=b&&b<e))return-1;if(b+1<e){e=this._lineOffsets[b+1];if(f)return e;for(var d=this.getText(Math.max(this._lineOffsets[b],e-2),e),h=d.length,c;10===(c=d.charCodeAt(h-1))||13===c;)h--;return e-(d.length-h)}return this.getCharCount()},
-getLineStart:function(b){return!(0<=b&&b<this.getLineCount())?-1:this._lineOffsets[b]},getText:function(b,f){void 0===b&&(b=0);void 0===f&&(f=this.getCharCount());if(b===f)return"";for(var e=0,d=0,h;d<this._text.length;){h=this._text[d].length;if(b<=e+h)break;e+=h;d++}for(var c=e,a=d;d<this._text.length;){h=this._text[d].length;if(f<=e+h)break;e+=h;d++}if(a===d)return this._text[a].substring(b-c,f-e);c=this._text[a].substring(b-c);e=this._text[d].substring(0,f-e);return c+this._text.slice(a+1,d).join("")+
-e},onChanging:function(b){return this.dispatchEvent(b)},onChanged:function(b){return this.dispatchEvent(b)},setLineDelimiter:function(b,f){"auto"===b&&(b=void 0,1<this.getLineCount()&&(b=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0))));this._lineDelimiter=b?b:p.platformDelimiter;if(f){var e=this.getLineCount();if(1<e){for(var d=Array(e),h=0;h<e;h++)d[h]=this.getLine(h);this.setText(d.join(this._lineDelimiter))}}},setText:function(b,f,e){void 0===b&&(b="");void 0===f&&(f=0);void 0===e&&(e=
-this.getCharCount());if(!(f===e&&""===b)){for(var d=this.getLineAtOffset(f),h=this.getLineAtOffset(e),c=f,a=e-f,k=h-d,m=b.length,r=0,g=this.getLineCount(),v=0,t=0,y=0,s=[];;){-1!==v&&v<=y&&(v=b.indexOf("\r",y));-1!==t&&t<=y&&(t=b.indexOf("\n",y));if(-1===t&&-1===v)break;y=-1!==v&&-1!==t?v+1===t?t+1:(v<t?v:t)+1:-1!==v?v+1:t+1;s.push(f+y);r++}this.onChanging({type:"Changing",text:b,start:c,removedCharCount:a,addedCharCount:m,removedLineCount:k,addedLineCount:r});0===s.length&&(y=this.getLineStart(d),
-h=h+1<g?this.getLineStart(h+1):this.getCharCount(),f!==y&&(b=this.getText(y,f)+b,f=y),e!==h&&(b+=this.getText(e,h),e=h));y=m-a;for(h=d+k+1;h<g;h++)this._lineOffsets[h]+=y;if(5E4>s.length)d=[d+1,k].concat(s),Array.prototype.splice.apply(this._lineOffsets,d);else{y=d+1;this._lineOffsets.splice(y,k);for(g=0;g<s.length;g+=5E4)d=[y,0].concat(s.slice(g,Math.min(s.length,g+5E4))),Array.prototype.splice.apply(this._lineOffsets,d),y+=5E4}for(y=g=0;y<this._text.length;){h=this._text[y].length;if(f<=g+h)break;
-g+=h;y++}d=g;for(s=y;y<this._text.length;){h=this._text[y].length;if(e<=g+h)break;g+=h;y++}h=this._text[y];f=this._text[s].substring(0,f-d);e=h.substring(e-g);s=[s,y-s+1];f&&s.push(f);b&&s.push(b);e&&s.push(e);Array.prototype.splice.apply(this._text,s);0===this._text.length&&(this._text=[""]);this.onChanged({type:"Changed",start:c,removedCharCount:a,addedCharCount:m,removedLineCount:k,addedLineCount:r})}}};g.EventTarget.addMixin(b.prototype);return{TextModel:b}});
-define("orion/keyBinding",["orion/util"],function(g){function n(b,l,f,e,d,h){this.type=h||"keydown";this.keyCode="string"===typeof b&&"keydown"===this.type?b.toUpperCase().charCodeAt(0):b;this.mod1=void 0!==l&&null!==l?l:!1;this.mod2=void 0!==f&&null!==f?f:!1;this.mod3=void 0!==e&&null!==e?e:!1;this.mod4=void 0!==d&&null!==d?d:!1}function p(b){this.keys=b}n.prototype={getKeys:function(){return[this]},match:function(b,l){if(void 0!==l){if(0!==l)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(g.isOpera?b.which:void 0!==b.charCode?b.charCode:b.keyCode)?this.mod1!==(g.isMac?b.metaKey:b.ctrlKey)||"keydown"===this.type&&this.mod2!==b.shiftKey||this.mod3!==b.altKey||g.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}};p.prototype={getKeys:function(){return this.keys.slice(0)},
-match:function(b,l){var f=this.keys;if(void 0!==l)return l>f.length?!1:f[l].match(b)?l===f.length-1?!0:l+1:!1;b instanceof Array||(b=[b]);if(b.length>f.length)return!1;var e;for(e=0;e<b.length;e++)if(!f[e].match(b[e]))return!1;return e===f.length?!0:e},equals:function(b){if(!b.keys||b.keys.length!==this.keys.length)return!1;for(var l=0;l<b.keys.length;l++)if(!b.keys[l].equals(this.keys[l]))return!1;return!0}};return{KeyBinding:n,KeyStroke:n,KeySequence:p}});
-define("orion/editor/keyModes",["orion/keyBinding","orion/util"],function(g,n){function p(b){b&&(this._view=b,this._keyBindings=this.createKeyBindings(),this._keyBindingIndex=0)}function b(b){p.call(this,b)}p.prototype={createKeyBindings:function(){return[]},getKeyBindings:function(b){for(var f=[],e=this._keyBindings,d=0;d<e.length;d++)e[d].actionID===b&&f.push(e[d].keyBinding);return f},getView:function(){return this._view},isActive:function(){return-1!==this._view.getKeyModes().indexOf(this)},match:function(b){if("keydown"===
-b.type)switch(b.keyCode){case 16:case 17:case 18:case 91:return}for(var f=this._keyBindingIndex,e=this._matchingKeyBindings||this._keyBindings,d=[],h=0;h<e.length;h++){var c=e[h],a=c.keyBinding.match(b,f);if(!0===a)return this._keyBindingIndex=0,this._matchingKeyBindings=null,c.actionID;"number"===typeof a&&d.push(c)}if(0===d.length)this._keyBindingIndex=0,this._matchingKeyBindings=null;else return this._keyBindingIndex++,this._matchingKeyBindings=d,"noop"},setKeyBinding:function(b,f){for(var e=this._keyBindings,
-d=0;d<e.length;d++){var h=e[d];if(h.keyBinding.equals(b)){f?h.actionID=f:h.predefined?h.actionID="noop":e.splice(d,1);return}}f&&e.push({keyBinding:b,actionID:f})},setView:function(b){this._view=b}};b.prototype=new p;b.prototype.createKeyBindings=function(){var b=g.KeyBinding,f=[];f.push({actionID:"lineUp",keyBinding:new b(38),predefined:!0});f.push({actionID:"lineDown",keyBinding:new b(40),predefined:!0});f.push({actionID:"charPrevious",keyBinding:new b(37),predefined:!0});f.push({actionID:"charNext",
-keyBinding:new b(39),predefined:!0});n.isMac?(f.push({actionID:"scrollPageUp",keyBinding:new b(33),predefined:!0}),f.push({actionID:"scrollPageDown",keyBinding:new b(34),predefined:!0}),f.push({actionID:"pageUp",keyBinding:new b(33,null,null,!0),predefined:!0}),f.push({actionID:"pageDown",keyBinding:new b(34,null,null,!0),predefined:!0}),f.push({actionID:"lineStart",keyBinding:new b(37,!0),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new b(39,!0),predefined:!0}),f.push({actionID:"wordPrevious",
-keyBinding:new b(37,null,null,!0),predefined:!0}),f.push({actionID:"wordNext",keyBinding:new b(39,null,null,!0),predefined:!0}),f.push({actionID:"scrollTextStart",keyBinding:new b(36),predefined:!0}),f.push({actionID:"scrollTextEnd",keyBinding:new b(35),predefined:!0}),f.push({actionID:"textStart",keyBinding:new b(38,!0),predefined:!0}),f.push({actionID:"textEnd",keyBinding:new b(40,!0),predefined:!0}),f.push({actionID:"scrollPageUp",keyBinding:new b(38,null,null,null,!0),predefined:!0}),f.push({actionID:"scrollPageDown",
-keyBinding:new b(40,null,null,null,!0),predefined:!0}),f.push({actionID:"lineStart",keyBinding:new b(37,null,null,null,!0),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new b(39,null,null,null,!0),predefined:!0}),f.push({actionID:"lineStart",keyBinding:new b(38,null,null,!0),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new b(40,null,null,!0),predefined:!0})):(f.push({actionID:"pageUp",keyBinding:new b(33),predefined:!0}),f.push({actionID:"pageDown",keyBinding:new b(34),predefined:!0}),
-f.push({actionID:"lineStart",keyBinding:new b(36),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new b(35),predefined:!0}),f.push({actionID:"wordPrevious",keyBinding:new b(37,!0),predefined:!0}),f.push({actionID:"wordNext",keyBinding:new b(39,!0),predefined:!0}),f.push({actionID:"textStart",keyBinding:new b(36,!0),predefined:!0}),f.push({actionID:"textEnd",keyBinding:new b(35,!0),predefined:!0}));n.isFirefox&&n.isLinux&&(f.push({actionID:"lineUp",keyBinding:new b(38,!0),predefined:!0}),f.push({actionID:"lineDown",
-keyBinding:new b(40,!0),predefined:!0}));n.isWindows&&(f.push({actionID:"scrollLineUp",keyBinding:new b(38,!0),predefined:!0}),f.push({actionID:"scrollLineDown",keyBinding:new b(40,!0),predefined:!0}));f.push({actionID:"selectLineUp",keyBinding:new b(38,null,!0),predefined:!0});f.push({actionID:"selectLineDown",keyBinding:new b(40,null,!0),predefined:!0});f.push({actionID:"selectCharPrevious",keyBinding:new b(37,null,!0),predefined:!0});f.push({actionID:"selectCharNext",keyBinding:new b(39,null,!0),
-predefined:!0});f.push({actionID:"selectPageUp",keyBinding:new b(33,null,!0),predefined:!0});f.push({actionID:"selectPageDown",keyBinding:new b(34,null,!0),predefined:!0});n.isMac?(f.push({actionID:"selectLineStart",keyBinding:new b(37,!0,!0),predefined:!0}),f.push({actionID:"selectLineEnd",keyBinding:new b(39,!0,!0),predefined:!0}),f.push({actionID:"selectWordPrevious",keyBinding:new b(37,null,!0,!0),predefined:!0}),f.push({actionID:"selectWordNext",keyBinding:new b(39,null,!0,!0),predefined:!0}),
-f.push({actionID:"selectTextStart",keyBinding:new b(36,null,!0),predefined:!0}),f.push({actionID:"selectTextEnd",keyBinding:new b(35,null,!0),predefined:!0}),f.push({actionID:"selectTextStart",keyBinding:new b(38,!0,!0),predefined:!0}),f.push({actionID:"selectTextEnd",keyBinding:new b(40,!0,!0),predefined:!0}),f.push({actionID:"selectLineStart",keyBinding:new b(37,null,!0,null,!0),predefined:!0}),f.push({actionID:"selectLineEnd",keyBinding:new b(39,null,!0,null,!0),predefined:!0}),f.push({actionID:"selectLineStart",
-keyBinding:new b(38,null,!0,!0),predefined:!0}),f.push({actionID:"selectLineEnd",keyBinding:new b(40,null,!0,!0),predefined:!0})):(n.isLinux&&(f.push({actionID:"selectWholeLineUp",keyBinding:new b(38,!0,!0),predefined:!0}),f.push({actionID:"selectWholeLineDown",keyBinding:new b(40,!0,!0),predefined:!0})),f.push({actionID:"selectLineStart",keyBinding:new b(36,null,!0),predefined:!0}),f.push({actionID:"selectLineEnd",keyBinding:new b(35,null,!0),predefined:!0}),f.push({actionID:"selectWordPrevious",
-keyBinding:new b(37,!0,!0),predefined:!0}),f.push({actionID:"selectWordNext",keyBinding:new b(39,!0,!0),predefined:!0}),f.push({actionID:"selectTextStart",keyBinding:new b(36,!0,!0),predefined:!0}),f.push({actionID:"selectTextEnd",keyBinding:new b(35,!0,!0),predefined:!0}));f.push({actionID:"undo",keyBinding:new g.KeyBinding("z",!0),predefined:!0});n.isMac?f.push({actionID:"redo",keyBinding:new g.KeyBinding("z",!0,!0),predefined:!0}):f.push({actionID:"redo",keyBinding:new g.KeyBinding("y",!0),predefined:!0});
-f.push({actionID:"deletePrevious",keyBinding:new b(8),predefined:!0});f.push({actionID:"deletePrevious",keyBinding:new b(8,null,!0),predefined:!0});f.push({actionID:"deleteNext",keyBinding:new b(46),predefined:!0});f.push({actionID:"deleteWordPrevious",keyBinding:new b(8,!0),predefined:!0});f.push({actionID:"deleteWordPrevious",keyBinding:new b(8,!0,!0),predefined:!0});f.push({actionID:"deleteWordNext",keyBinding:new b(46,!0),predefined:!0});f.push({actionID:"tab",keyBinding:new b(9),predefined:!0});
-f.push({actionID:"shiftTab",keyBinding:new b(9,null,!0),predefined:!0});f.push({actionID:"enter",keyBinding:new b(13),predefined:!0});f.push({actionID:"enter",keyBinding:new b(13,null,!0),predefined:!0});f.push({actionID:"selectAll",keyBinding:new b("a",!0),predefined:!0});f.push({actionID:"toggleTabMode",keyBinding:new b("m",!0),predefined:!0});n.isMac&&(f.push({actionID:"deleteNext",keyBinding:new b(46,null,!0),predefined:!0}),f.push({actionID:"deleteWordPrevious",keyBinding:new b(8,null,null,!0),
-predefined:!0}),f.push({actionID:"deleteWordNext",keyBinding:new b(46,null,null,!0),predefined:!0}));f.push({actionID:"toggleWrapMode",keyBinding:new g.KeyBinding("w",!0,!1,!0)});f.push({actionID:"toggleOverwriteMode",keyBinding:new g.KeyBinding(45)});if(!n.isFirefox){var e=n.isMac&&n.isChrome;f.push({actionID:"noop",keyBinding:new b("u",!e,!1,!1,e),predefined:!0});f.push({actionID:"noop",keyBinding:new b("i",!e,!1,!1,e),predefined:!0});f.push({actionID:"noop",keyBinding:new b("b",!e,!1,!1,e),predefined:!0})}n.isFirefox&&
-(f.push({actionID:"copy",keyBinding:new b(45,!0),predefined:!0}),f.push({actionID:"paste",keyBinding:new b(45,null,!0),predefined:!0}),f.push({actionID:"cut",keyBinding:new b(46,null,!0),predefined:!0}));n.isMac&&(f.push({actionID:"lineStart",keyBinding:new b("a",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new b("e",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"lineUp",keyBinding:new b("p",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"lineDown",keyBinding:new b("n",!1,!1,
-!1,!0),predefined:!0}),f.push({actionID:"charPrevious",keyBinding:new b("b",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"charNext",keyBinding:new b("f",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"deletePrevious",keyBinding:new b("h",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"deleteNext",keyBinding:new b("d",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"deleteLineEnd",keyBinding:new b("k",!1,!1,!1,!0),predefined:!0}),n.isFirefox?(f.push({actionID:"scrollPageDown",keyBinding:new b("v",!1,
-!1,!1,!0),predefined:!0}),f.push({actionID:"deleteLineStart",keyBinding:new b("u",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"deleteWordPrevious",keyBinding:new b("w",!1,!1,!1,!0),predefined:!0})):(f.push({actionID:"pageDown",keyBinding:new b("v",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"centerLine",keyBinding:new b("l",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"enterNoCursor",keyBinding:new b("o",!1,!1,!1,!0),predefined:!0})));return f};return{KeyMode:p,DefaultKeyMode:b}});
-define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(g,n,p){function b(b){b=b||{};this._document=b.document||document}var l={};b.getTheme=function(f){var f=f||"default",e=l[f];e||(e=l[f]=new b);return e};b.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(b,e){var d=this,h=d._themeClass;d._themeClass=b;this._load(b,e,function(){d.onThemeChanged({type:"ThemeChanged",oldValue:h,newValue:d.getThemeClass()})})},onThemeChanged:function(b){return this.dispatchEvent(b)},
-buildStyleSheet:function(b,e){function d(c,a,d){a&&(h.push("."+b+" ."+c+" {"),h.push("\t"+(d?"background-color":"color")+": "+a+";"),h.push("}"))}var h=[];h.push("");h.push("."+b+" {");e.fontFamily&&h.push("\tfont-family: "+e.fontFamily+";");e.fontSize&&h.push("\tfont-size: "+e.fontSize+";");e.fontSize&&h.push("\tcolor: "+e.text+";");h.push("}");h.push("."+b+".textview {");e.background&&h.push("\tbackground-color: "+e.background+";");h.push("}");d("ruler.annotations",e.annotationRuler,!0);d("ruler.lines",
+define("orion/editor/nls/messages",["orion/editor/i18n!orion/editor/nls/messages","orion/editor/nls/root/messages"],function(g,n){var p={root:n},a;for(a in g)g.hasOwnProperty(a)&&"undefined"===typeof p[a]&&(p[a]=g[a]);return p});
+define("orion/editor/eventTarget",[],function(){function g(){}g.addMixin=function(n){var p=g.prototype,a;for(a in p)p.hasOwnProperty(a)&&(n[a]=p[a])};g.prototype={addEventListener:function(g,p,a){this._eventTypes||(this._eventTypes={});var l=this._eventTypes[g];l||(l=this._eventTypes[g]={level:0,listeners:[]});l.listeners.push({listener:p,useCapture:a})},dispatchEvent:function(g){var p=g.type;this._dispatchEvent("pre"+p,g);this._dispatchEvent(p,g);this._dispatchEvent("post"+p,g)},_dispatchEvent:function(g,
+p){var a=this._eventTypes?this._eventTypes[g]:null;if(a){var l=a.listeners;try{if(a.level++,l)for(var f=0,e=l.length;f<e;f++)if(l[f]){var d=l[f].listener;"function"===typeof d?d.call(this,p):d.handleEvent&&"function"===typeof d.handleEvent&&d.handleEvent(p)}}finally{if(a.level--,a.compact&&0===a.level){for(f=l.length-1;0<=f;f--)l[f]||l.splice(f,1);0===l.length&&delete this._eventTypes[g];a.compact=!1}}}},isListening:function(g){return!this._eventTypes?!1:void 0!==this._eventTypes[g]},removeEventListener:function(g,
+p,a){if(this._eventTypes){var l=this._eventTypes[g];if(l){for(var f=l.listeners,e=0,d=f.length;e<d;e++){var h=f[e];if(h&&h.listener===p&&h.useCapture===a){0!==l.level?(f[e]=null,l.compact=!0):f.splice(e,1);break}}0===f.length&&delete this._eventTypes[g]}}}};return{EventTarget:g}});define("orion/regex",[],function(){return{escape:function(g){return g.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")},parse:function(g){return(g=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(g))?{pattern:g[1],flags:g[2]}:null}}});
+define("orion/editor/textModel",["orion/editor/eventTarget","orion/regex","orion/util"],function(g,n,p){function a(a,f){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(a);this.setLineDelimiter(f)}a.prototype={destroy:function(){},find:function(a){1<this._text.length&&(this._text=[this._text.join("")]);var f=a.string,e=a.regex,d=f,h="",c=a.caseInsensitive;if(d)if(e){if(f=n.parse(d))d=f.pattern,h=f.flags}else d=f.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"),c&&(d=d.replace(/[iI\u0130\u0131]/g,
+"[Ii\u0130\u0131]"));var b=null,k;if(d){var f=a.reverse,m=a.wrap,e=a.wholeWord,r=a.start||0,a=a.end,g=null!==a&&void 0!==a;-1===h.indexOf("g")&&(h+="g");-1===h.indexOf("m")&&(h+="m");c&&-1===h.indexOf("i")&&(h+="i");e&&(d="\\b"+d+"\\b");var u=this._text[0],t,y,s=0;g&&(c=r<a?r:a,u=u.substring(c,r<a?a:r),s=c);var v=RegExp(d,h);f?k=function(){var b=null;for(v.lastIndex=0;;){y=v.lastIndex;t=v.exec(u);if(y===v.lastIndex)return null;if(t){if(!(t.index+s<r)){if(!m||b)break;r=u.length+s}b={start:t.index+
+s,end:v.lastIndex+s}}else break}b&&(r=b.start);return b}:(g||(v.lastIndex=r),k=function(){for(;;){y=v.lastIndex;t=v.exec(u);if(y===v.lastIndex)break;if(t)return{start:t.index+s,end:v.lastIndex+s};if(!(0!==y&&m))break}return null});b=k()}return{next:function(){var c=b;c&&(b=k());return c},hasNext:function(){return null!==b}}},getCharCount:function(){for(var a=0,f=0;f<this._text.length;f++)a+=this._text[f].length;return a},getLine:function(a,f){var e=this.getLineCount();if(!(0<=a&&a<e))return null;
+var d=this._lineOffsets[a];if(a+1<e){e=this.getText(d,this._lineOffsets[a+1]);if(f)return e;for(var d=e.length,h;10===(h=e.charCodeAt(d-1))||13===h;)d--;return e.substring(0,d)}return this.getText(d)},getLineAtOffset:function(a){var f=this.getCharCount();if(!(0<=a&&a<=f))return-1;var e=this.getLineCount();if(a===f)return e-1;var d,h,c=this._lastLineIndex;if(0<=c&&c<e&&(d=this._lineOffsets[c],h=c+1<e?this._lineOffsets[c+1]:f,d<=a&&a<h))return c;for(var b=e,k=-1;1<b-k;)if(c=Math.floor((b+k)/2),d=this._lineOffsets[c],
+h=c+1<e?this._lineOffsets[c+1]:f,a<=d)b=c;else if(a<h){b=c;break}else k=c;return this._lastLineIndex=b},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(a,f){var e=this.getLineCount();if(!(0<=a&&a<e))return-1;if(a+1<e){e=this._lineOffsets[a+1];if(f)return e;for(var d=this.getText(Math.max(this._lineOffsets[a],e-2),e),h=d.length,c;10===(c=d.charCodeAt(h-1))||13===c;)h--;return e-(d.length-h)}return this.getCharCount()},
+getLineStart:function(a){return!(0<=a&&a<this.getLineCount())?-1:this._lineOffsets[a]},getText:function(a,f){void 0===a&&(a=0);void 0===f&&(f=this.getCharCount());if(a===f)return"";for(var e=0,d=0,h;d<this._text.length;){h=this._text[d].length;if(a<=e+h)break;e+=h;d++}for(var c=e,b=d;d<this._text.length;){h=this._text[d].length;if(f<=e+h)break;e+=h;d++}if(b===d)return this._text[b].substring(a-c,f-e);c=this._text[b].substring(a-c);e=this._text[d].substring(0,f-e);return c+this._text.slice(b+1,d).join("")+
+e},onChanging:function(a){return this.dispatchEvent(a)},onChanged:function(a){return this.dispatchEvent(a)},setLineDelimiter:function(a,f){"auto"===a&&(a=void 0,1<this.getLineCount()&&(a=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0))));this._lineDelimiter=a?a:p.platformDelimiter;if(f){var e=this.getLineCount();if(1<e){for(var d=Array(e),h=0;h<e;h++)d[h]=this.getLine(h);this.setText(d.join(this._lineDelimiter))}}},setText:function(a,f,e){void 0===a&&(a="");void 0===f&&(f=0);void 0===e&&(e=
+this.getCharCount());if(!(f===e&&""===a)){for(var d=this.getLineAtOffset(f),h=this.getLineAtOffset(e),c=f,b=e-f,k=h-d,m=a.length,r=0,g=this.getLineCount(),u=0,t=0,y=0,s=[];;){-1!==u&&u<=y&&(u=a.indexOf("\r",y));-1!==t&&t<=y&&(t=a.indexOf("\n",y));if(-1===t&&-1===u)break;y=-1!==u&&-1!==t?u+1===t?t+1:(u<t?u:t)+1:-1!==u?u+1:t+1;s.push(f+y);r++}this.onChanging({type:"Changing",text:a,start:c,removedCharCount:b,addedCharCount:m,removedLineCount:k,addedLineCount:r});0===s.length&&(y=this.getLineStart(d),
+h=h+1<g?this.getLineStart(h+1):this.getCharCount(),f!==y&&(a=this.getText(y,f)+a,f=y),e!==h&&(a+=this.getText(e,h),e=h));y=m-b;for(h=d+k+1;h<g;h++)this._lineOffsets[h]+=y;if(5E4>s.length)d=[d+1,k].concat(s),Array.prototype.splice.apply(this._lineOffsets,d);else{y=d+1;this._lineOffsets.splice(y,k);for(g=0;g<s.length;g+=5E4)d=[y,0].concat(s.slice(g,Math.min(s.length,g+5E4))),Array.prototype.splice.apply(this._lineOffsets,d),y+=5E4}for(y=g=0;y<this._text.length;){h=this._text[y].length;if(f<=g+h)break;
+g+=h;y++}d=g;for(s=y;y<this._text.length;){h=this._text[y].length;if(e<=g+h)break;g+=h;y++}h=this._text[y];f=this._text[s].substring(0,f-d);e=h.substring(e-g);s=[s,y-s+1];f&&s.push(f);a&&s.push(a);e&&s.push(e);Array.prototype.splice.apply(this._text,s);0===this._text.length&&(this._text=[""]);this.onChanged({type:"Changed",start:c,removedCharCount:b,addedCharCount:m,removedLineCount:k,addedLineCount:r})}}};g.EventTarget.addMixin(a.prototype);return{TextModel:a}});
+define("orion/keyBinding",["orion/util"],function(g){function n(a,l,f,e,d,h){this.type=h||"keydown";this.keyCode="string"===typeof a&&"keydown"===this.type?a.toUpperCase().charCodeAt(0):a;this.mod1=void 0!==l&&null!==l?l:!1;this.mod2=void 0!==f&&null!==f?f:!1;this.mod3=void 0!==e&&null!==e?e:!1;this.mod4=void 0!==d&&null!==d?d:!1}function p(a){this.keys=a}n.prototype={getKeys:function(){return[this]},match:function(a,l){if(void 0!==l){if(0!==l)return!1}else if(a instanceof Array){if(1<a.length)return!1;
+a=a[0]}return a.type!==this.type?!1:this.keyCode===a.keyCode||this.keyCode===String.fromCharCode(g.isOpera?a.which:void 0!==a.charCode?a.charCode:a.keyCode)?this.mod1!==(g.isMac?a.metaKey:a.ctrlKey)||"keydown"===this.type&&this.mod2!==a.shiftKey||this.mod3!==a.altKey||g.isMac&&this.mod4!==a.ctrlKey?!1:!0:!1},equals:function(a){return!a||this.keyCode!==a.keyCode||this.mod1!==a.mod1||this.mod2!==a.mod2||this.mod3!==a.mod3||this.mod4!==a.mod4||this.type!==a.type?!1:!0}};p.prototype={getKeys:function(){return this.keys.slice(0)},
+match:function(a,l){var f=this.keys;if(void 0!==l)return l>f.length?!1:f[l].match(a)?l===f.length-1?!0:l+1:!1;a instanceof Array||(a=[a]);if(a.length>f.length)return!1;var e;for(e=0;e<a.length;e++)if(!f[e].match(a[e]))return!1;return e===f.length?!0:e},equals:function(a){if(!a.keys||a.keys.length!==this.keys.length)return!1;for(var l=0;l<a.keys.length;l++)if(!a.keys[l].equals(this.keys[l]))return!1;return!0}};return{KeyBinding:n,KeyStroke:n,KeySequence:p}});
+define("orion/editor/keyModes",["orion/keyBinding","orion/util"],function(g,n){function p(a){a&&(this._view=a,this._keyBindings=this.createKeyBindings(),this._keyBindingIndex=0)}function a(a){p.call(this,a)}p.prototype={createKeyBindings:function(){return[]},getKeyBindings:function(a){for(var f=[],e=this._keyBindings,d=0;d<e.length;d++)e[d].actionID===a&&f.push(e[d].keyBinding);return f},getView:function(){return this._view},isActive:function(){return-1!==this._view.getKeyModes().indexOf(this)},match:function(a){if("keydown"===
+a.type)switch(a.keyCode){case 16:case 17:case 18:case 91:return}for(var f=this._keyBindingIndex,e=this._matchingKeyBindings||this._keyBindings,d=[],h=0;h<e.length;h++){var c=e[h],b=c.keyBinding.match(a,f);if(!0===b)return this._keyBindingIndex=0,this._matchingKeyBindings=null,c.actionID;"number"===typeof b&&d.push(c)}if(0===d.length)this._keyBindingIndex=0,this._matchingKeyBindings=null;else return this._keyBindingIndex++,this._matchingKeyBindings=d,"noop"},setKeyBinding:function(a,f){for(var e=this._keyBindings,
+d=0;d<e.length;d++){var h=e[d];if(h.keyBinding.equals(a)){f?h.actionID=f:h.predefined?h.actionID="noop":e.splice(d,1);return}}f&&e.push({keyBinding:a,actionID:f})},setView:function(a){this._view=a}};a.prototype=new p;a.prototype.createKeyBindings=function(){var a=g.KeyBinding,f=[];f.push({actionID:"lineUp",keyBinding:new a(38),predefined:!0});f.push({actionID:"lineDown",keyBinding:new a(40),predefined:!0});f.push({actionID:"charPrevious",keyBinding:new a(37),predefined:!0});f.push({actionID:"charNext",
+keyBinding:new a(39),predefined:!0});n.isMac?(f.push({actionID:"scrollPageUp",keyBinding:new a(33),predefined:!0}),f.push({actionID:"scrollPageDown",keyBinding:new a(34),predefined:!0}),f.push({actionID:"pageUp",keyBinding:new a(33,null,null,!0),predefined:!0}),f.push({actionID:"pageDown",keyBinding:new a(34,null,null,!0),predefined:!0}),f.push({actionID:"lineStart",keyBinding:new a(37,!0),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new a(39,!0),predefined:!0}),f.push({actionID:"wordPrevious",
+keyBinding:new a(37,null,null,!0),predefined:!0}),f.push({actionID:"wordNext",keyBinding:new a(39,null,null,!0),predefined:!0}),f.push({actionID:"scrollTextStart",keyBinding:new a(36),predefined:!0}),f.push({actionID:"scrollTextEnd",keyBinding:new a(35),predefined:!0}),f.push({actionID:"textStart",keyBinding:new a(38,!0),predefined:!0}),f.push({actionID:"textEnd",keyBinding:new a(40,!0),predefined:!0}),f.push({actionID:"scrollPageUp",keyBinding:new a(38,null,null,null,!0),predefined:!0}),f.push({actionID:"scrollPageDown",
+keyBinding:new a(40,null,null,null,!0),predefined:!0}),f.push({actionID:"lineStart",keyBinding:new a(37,null,null,null,!0),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new a(39,null,null,null,!0),predefined:!0}),f.push({actionID:"lineStart",keyBinding:new a(38,null,null,!0),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new a(40,null,null,!0),predefined:!0})):(f.push({actionID:"pageUp",keyBinding:new a(33),predefined:!0}),f.push({actionID:"pageDown",keyBinding:new a(34),predefined:!0}),
+f.push({actionID:"lineStart",keyBinding:new a(36),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new a(35),predefined:!0}),f.push({actionID:"wordPrevious",keyBinding:new a(37,!0),predefined:!0}),f.push({actionID:"wordNext",keyBinding:new a(39,!0),predefined:!0}),f.push({actionID:"textStart",keyBinding:new a(36,!0),predefined:!0}),f.push({actionID:"textEnd",keyBinding:new a(35,!0),predefined:!0}));n.isFirefox&&n.isLinux&&(f.push({actionID:"lineUp",keyBinding:new a(38,!0),predefined:!0}),f.push({actionID:"lineDown",
+keyBinding:new a(40,!0),predefined:!0}));n.isWindows&&(f.push({actionID:"scrollLineUp",keyBinding:new a(38,!0),predefined:!0}),f.push({actionID:"scrollLineDown",keyBinding:new a(40,!0),predefined:!0}));f.push({actionID:"selectLineUp",keyBinding:new a(38,null,!0),predefined:!0});f.push({actionID:"selectLineDown",keyBinding:new a(40,null,!0),predefined:!0});f.push({actionID:"selectCharPrevious",keyBinding:new a(37,null,!0),predefined:!0});f.push({actionID:"selectCharNext",keyBinding:new a(39,null,!0),
+predefined:!0});f.push({actionID:"selectPageUp",keyBinding:new a(33,null,!0),predefined:!0});f.push({actionID:"selectPageDown",keyBinding:new a(34,null,!0),predefined:!0});n.isMac?(f.push({actionID:"selectLineStart",keyBinding:new a(37,!0,!0),predefined:!0}),f.push({actionID:"selectLineEnd",keyBinding:new a(39,!0,!0),predefined:!0}),f.push({actionID:"selectWordPrevious",keyBinding:new a(37,null,!0,!0),predefined:!0}),f.push({actionID:"selectWordNext",keyBinding:new a(39,null,!0,!0),predefined:!0}),
+f.push({actionID:"selectTextStart",keyBinding:new a(36,null,!0),predefined:!0}),f.push({actionID:"selectTextEnd",keyBinding:new a(35,null,!0),predefined:!0}),f.push({actionID:"selectTextStart",keyBinding:new a(38,!0,!0),predefined:!0}),f.push({actionID:"selectTextEnd",keyBinding:new a(40,!0,!0),predefined:!0}),f.push({actionID:"selectLineStart",keyBinding:new a(37,null,!0,null,!0),predefined:!0}),f.push({actionID:"selectLineEnd",keyBinding:new a(39,null,!0,null,!0),predefined:!0}),f.push({actionID:"selectLineStart",
+keyBinding:new a(38,null,!0,!0),predefined:!0}),f.push({actionID:"selectLineEnd",keyBinding:new a(40,null,!0,!0),predefined:!0})):(n.isLinux&&(f.push({actionID:"selectWholeLineUp",keyBinding:new a(38,!0,!0),predefined:!0}),f.push({actionID:"selectWholeLineDown",keyBinding:new a(40,!0,!0),predefined:!0})),f.push({actionID:"selectLineStart",keyBinding:new a(36,null,!0),predefined:!0}),f.push({actionID:"selectLineEnd",keyBinding:new a(35,null,!0),predefined:!0}),f.push({actionID:"selectWordPrevious",
+keyBinding:new a(37,!0,!0),predefined:!0}),f.push({actionID:"selectWordNext",keyBinding:new a(39,!0,!0),predefined:!0}),f.push({actionID:"selectTextStart",keyBinding:new a(36,!0,!0),predefined:!0}),f.push({actionID:"selectTextEnd",keyBinding:new a(35,!0,!0),predefined:!0}));f.push({actionID:"undo",keyBinding:new g.KeyBinding("z",!0),predefined:!0});n.isMac?f.push({actionID:"redo",keyBinding:new g.KeyBinding("z",!0,!0),predefined:!0}):f.push({actionID:"redo",keyBinding:new g.KeyBinding("y",!0),predefined:!0});
+f.push({actionID:"deletePrevious",keyBinding:new a(8),predefined:!0});f.push({actionID:"deletePrevious",keyBinding:new a(8,null,!0),predefined:!0});f.push({actionID:"deleteNext",keyBinding:new a(46),predefined:!0});f.push({actionID:"deleteWordPrevious",keyBinding:new a(8,!0),predefined:!0});f.push({actionID:"deleteWordPrevious",keyBinding:new a(8,!0,!0),predefined:!0});f.push({actionID:"deleteWordNext",keyBinding:new a(46,!0),predefined:!0});f.push({actionID:"tab",keyBinding:new a(9),predefined:!0});
+f.push({actionID:"shiftTab",keyBinding:new a(9,null,!0),predefined:!0});f.push({actionID:"enter",keyBinding:new a(13),predefined:!0});f.push({actionID:"enter",keyBinding:new a(13,null,!0),predefined:!0});f.push({actionID:"selectAll",keyBinding:new a("a",!0),predefined:!0});f.push({actionID:"toggleTabMode",keyBinding:new a("m",!0),predefined:!0});n.isMac&&(f.push({actionID:"deleteNext",keyBinding:new a(46,null,!0),predefined:!0}),f.push({actionID:"deleteWordPrevious",keyBinding:new a(8,null,null,!0),
+predefined:!0}),f.push({actionID:"deleteWordNext",keyBinding:new a(46,null,null,!0),predefined:!0}));f.push({actionID:"toggleWrapMode",keyBinding:new g.KeyBinding("w",!0,!1,!0)});f.push({actionID:"toggleOverwriteMode",keyBinding:new g.KeyBinding(45)});if(!n.isFirefox){var e=n.isMac&&n.isChrome;f.push({actionID:"noop",keyBinding:new a("u",!e,!1,!1,e),predefined:!0});f.push({actionID:"noop",keyBinding:new a("i",!e,!1,!1,e),predefined:!0});f.push({actionID:"noop",keyBinding:new a("b",!e,!1,!1,e),predefined:!0})}n.isFirefox&&
+(f.push({actionID:"copy",keyBinding:new a(45,!0),predefined:!0}),f.push({actionID:"paste",keyBinding:new a(45,null,!0),predefined:!0}),f.push({actionID:"cut",keyBinding:new a(46,null,!0),predefined:!0}));n.isMac&&(f.push({actionID:"lineStart",keyBinding:new a("a",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new a("e",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"lineUp",keyBinding:new a("p",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"lineDown",keyBinding:new a("n",!1,!1,
+!1,!0),predefined:!0}),f.push({actionID:"charPrevious",keyBinding:new a("b",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"charNext",keyBinding:new a("f",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"deletePrevious",keyBinding:new a("h",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"deleteNext",keyBinding:new a("d",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"deleteLineEnd",keyBinding:new a("k",!1,!1,!1,!0),predefined:!0}),n.isFirefox?(f.push({actionID:"scrollPageDown",keyBinding:new a("v",!1,
+!1,!1,!0),predefined:!0}),f.push({actionID:"deleteLineStart",keyBinding:new a("u",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"deleteWordPrevious",keyBinding:new a("w",!1,!1,!1,!0),predefined:!0})):(f.push({actionID:"pageDown",keyBinding:new a("v",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"centerLine",keyBinding:new a("l",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"enterNoCursor",keyBinding:new a("o",!1,!1,!1,!0),predefined:!0})));return f};return{KeyMode:p,DefaultKeyMode:a}});
+define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(g,n,p){function a(a){a=a||{};this._document=a.document||document}var l={};a.getTheme=function(f){var f=f||"default",e=l[f];e||(e=l[f]=new a);return e};a.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(a,e){var d=this,h=d._themeClass;d._themeClass=a;this._load(a,e,function(){d.onThemeChanged({type:"ThemeChanged",oldValue:h,newValue:d.getThemeClass()})})},onThemeChanged:function(a){return this.dispatchEvent(a)},
+buildStyleSheet:function(a,e){function d(c,b,d){b&&(h.push("."+a+" ."+c+" {"),h.push("\t"+(d?"background-color":"color")+": "+b+";"),h.push("}"))}var h=[];h.push("");h.push("."+a+" {");e.fontFamily&&h.push("\tfont-family: "+e.fontFamily+";");e.fontSize&&h.push("\tfont-size: "+e.fontSize+";");e.fontSize&&h.push("\tcolor: "+e.text+";");h.push("}");h.push("."+a+".textview {");e.background&&h.push("\tbackground-color: "+e.background+";");h.push("}");d("ruler.annotations",e.annotationRuler,!0);d("ruler.lines",
 e.annotationRuler,!0);d("ruler.folding",e.annotationRuler,!0);d("ruler.overview",e.overviewRuler,!0);d("rulerLines",e.lineNumber,!1);d("rulerLines.even",e.lineNumberEven,!1);d("rulerLines.odd",e.lineNumberOdd,!1);d("annotationLine.currentLine",e.currentLine,!0);d("entity-name-tag",e.keyword,!1);d("entity-other-attribute-name",e.attribute,!1);d("string-quoted",e.string,!1);d("line_caret",e.currentLine,!0);d("keyword",e.keyword,!1);d("string",e.string,!1);d("comment",e.comment,!1);d("comment.block.documentation",
-e.comment,!1);d("keyword.other.documentation.markup",e.comment,!1);return h.join("\n")},_createStyle:function(b,e,d,h){var c=this._document,b="orion-theme-"+b,a=c.getElementById(b);if(a){if(h||a.firstChild.data===e)return;a.removeChild(a.firstChild);a.appendChild(c.createTextNode(e))}else h?(a=p.createElement(c,"link"),a.rel="stylesheet",a.type="text/css",a.href=e,a.addEventListener("load",function(){d()})):(a=p.createElement(c,"style"),a.appendChild(c.createTextNode(e))),a.id=b,(c.getElementsByTagName("head")[0]||
-c.documentElement).appendChild(a);h||d()},_load:function(b,e,d){if(b)if("string"===typeof e)this._createStyle(b,e,d);else if(e=e.href,".css"!==e.substring(e.length-4)&&(e+=".css"),/^\//.test(e)||/[a-zA-Z0-9]+:\/\//i.test(e)||!g.toUrl)this._createStyle(b,e,d,!0);else{var h=this;g(["text!"+e],function(c){h._createStyle(b,c,d,!1)})}else d()}};n.EventTarget.addMixin(b.prototype);return{TextTheme:b}});
-define("orion/editor/util",[],function(){return{contains:function(g,n){if(!n)return!1;if(!g.compareDocumentPosition){for(var p=n;p;){if(g===p)return!0;p=p.parentNode}return!1}return g===n||0!==(g.compareDocumentPosition(n)&16)},addEventListener:function(g,n,p,b){"function"===typeof g.addEventListener?g.addEventListener(n,p,!0===b):g.attachEvent("on"+n,p)},removeEventListener:function(g,n,p,b){"function"===typeof g.removeEventListener?g.removeEventListener(n,p,!0===b):g.detachEvent("on"+n,p)}}});
-define("orion/editor/textView","i18n!orion/editor/nls/messages orion/editor/textModel orion/editor/keyModes orion/editor/eventTarget orion/editor/textTheme orion/editor/util orion/util".split(" "),function(g,n,p,b,l,f,e){function d(a,c,b){if(b){c.className="";for(var b=c.attributes,d=b.length;0<d--;)(!e.isIE||9<=e.isIE||9>e.isIE&&b[d].specified)&&c.removeAttribute(b[d].name)}if(a){a.styleClass&&(c.className=a.styleClass);if(b=a.style)for(var k in b)b.hasOwnProperty(k)&&(c.style[k]=b[k]);if(a=a.attributes)for(var m in a)a.hasOwnProperty(m)&&
-c.setAttribute(m,a[m])}}function h(a){return a instanceof Array?a.slice(0):a}function c(a,c){if(!a)return c;if(!c)return a;for(var b in c)c.hasOwnProperty(b)&&(a.hasOwnProperty(b)||(a[b]=c[b]));return a}function a(q,c){if(q===c)return!0;if(q&&!c||!q&&c||q&&q.constructor===String||c&&c.constructor===String)return!1;if(q instanceof Array||c instanceof Array){if(!(q instanceof Array&&c instanceof Array)||q.length!==c.length)return!1;for(var b=0;b<q.length;b++)if(!a(q[b],c[b]))return!1;return!0}if(!(q instanceof
-Object)||!(c instanceof Object))return!1;for(b in q)if(q.hasOwnProperty(b)&&(!c.hasOwnProperty(b)||!a(q[b],c[b])))return!1;for(b in c)if(!q.hasOwnProperty(b))return!1;return!0}function k(a,c,b){for(var d=0,k=0,e=0,m=a.length;e<m;){-1!==d&&d<=e&&(d=a.indexOf("\r",e));-1!==k&&k<=e&&(k=a.indexOf("\n",e));var h=e,f;if(-1===k&&-1===d){c(a.substring(e));break}-1!==d&&-1!==k?d+1===k?(f=d,e=k+1):(f=d<k?d:k,e=(d<k?d:k)+1):-1!==d?(f=d,e=d+1):(f=k,e=k+1);c(a.substring(h,f));b()}}function m(a){var c,b,d,k,e=
-a.ownerDocument.defaultView||a.ownerDocument.parentWindow;e.getComputedStyle?(a=e.getComputedStyle(a,null),c=a.getPropertyValue("padding-left"),b=a.getPropertyValue("padding-top"),d=a.getPropertyValue("padding-right"),k=a.getPropertyValue("padding-bottom")):a.currentStyle&&(c=a.currentStyle.paddingLeft,b=a.currentStyle.paddingTop,d=a.currentStyle.paddingRight,k=a.currentStyle.paddingBottom);return{left:parseInt(c,10)||0,top:parseInt(b,10)||0,right:parseInt(d,10)||0,bottom:parseInt(k,10)||0}}function r(a){var c,
-b,d,k,e=a._trim;if(!e){var e=m(a),h=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;h.getComputedStyle?(k=h.getComputedStyle(a,null),c=k.getPropertyValue("border-left-width"),b=k.getPropertyValue("border-top-width"),d=k.getPropertyValue("border-right-width"),k=k.getPropertyValue("border-bottom-width")):a.currentStyle&&(c=a.currentStyle.borderLeftWidth,b=a.currentStyle.borderTopWidth,d=a.currentStyle.borderRightWidth,k=a.currentStyle.borderBottomWidth);c=parseInt(c,10)||0;b=parseInt(b,10)||
-0;d=parseInt(d,10)||0;k=parseInt(k,10)||0;e.left+=c;e.top+=b;e.right+=d;e.bottom+=k;a._trim=e}return e}function w(a,c,b){this.start=a;this.end=c;this.caret=b}function v(a){this.left=a.left;this.top=a.top;this.right=a.right;this.bottom=a.bottom}function t(a,c,b){this.view=a;this.lineIndex=c;this._lineDiv=b}function y(a){this._init(a||{})}var s=f.addEventListener,u=f.removeEventListener,z=function(a){this.options=a};z.prototype.play=function(){var a="number"===typeof this.options.duration?this.options.duration:
-350,c=this.options.easing||this.defaultEasing,b=this.options.onAnimate||function(){},d=this.options.curve[0],k=this.options.curve[1],e=k-d,m=-1,h,f=this;this.interval=this.options.window.setInterval(function(){m=-1===m?(new Date).getTime():m;var r=((new Date).getTime()-m)/a;1>r?(r=c(r),h=d+r*e,b(h)):(b(k),f.stop())},"number"===typeof this.options.rate?this.options.rate:20)};z.prototype.stop=function(){this.options.window.clearInterval(this.interval);(this.options.onEnd||function(){})()};z.prototype.defaultEasing=
-function(a){return Math.sin(a*(Math.PI/2))};w.prototype={clone:function(){return new w(this.start,this.end,this.caret)},collapse:function(){this.caret?this.end=this.start:this.start=this.end},extend:function(a){this.caret?this.start=a:this.end=a;this.start>this.end&&(a=this.start,this.start=this.end,this.end=a,this.caret=!this.caret)},setCaret:function(a){this.end=this.start=a;this.caret=!1},getCaret:function(){return this.caret?this.start:this.end},toString:function(){return"start="+this.start+" end="+
-this.end+(this.caret?" caret is at start":" caret is at end")},isEmpty:function(){return this.start===this.end},equals:function(a){return this.caret===a.caret&&this.start===a.start&&this.end===a.end}};v.prototype={toString:function(){return"{l="+this.left+", t="+this.top+", r="+this.right+", b="+this.bottom+"}"}};t.prototype={create:function(a,c){if(!this._lineDiv){var b=this._lineDiv=this._createLine(a,c,this.lineIndex);b._line=this;return b}},_createLine:function(q,c,b){var k=this.view,m=k._model,
-h=m.getLine(b),f=m.getLineStart(b),r={type:"LineStyle",textView:k,lineIndex:b,lineText:h,lineStart:f};if(2E3>h.length)k.onLineStyle(r);m=c||e.createElement(q.ownerDocument,"div");if(!c||!a(c.viewStyle,r.style))d(r.style,m,c),c&&(c._trim=null),m.viewStyle=r.style,m.setAttribute("role","presentation");m.lineIndex=b;b=[];this._createRanges(r.ranges,h,0,h.length,f,{tabOffset:0,ranges:b});h=" ";!k._fullSelection&&9>e.isIE&&(h="\ufeff");r={text:h,style:k._metrics.largestFontStyle,ignoreChars:1};0===b.length||
-!b[b.length-1].style||"div"!==b[b.length-1].style.tagName?b.push(r):b.splice(b.length-1,0,r);var g,l,s,t,u,h=k=0,w,v;if(c){if(l=c.modelChangedEvent)0===l.removedLineCount&&0===l.addedLineCount?(v=l.start-f,w=l.addedCharCount-l.removedCharCount):v=-1,c.modelChangedEvent=void 0;l=c.firstChild}for(f=0;f<b.length;f++){r=b[f];t=r.text;k+=t.length;g=r.style;if(l)if(u=l.firstChild.data,s=l.viewStyle,u===t&&a(g,s)){h+=u.length;l._rectsCache=void 0;g=l=l.nextSibling;continue}else for(;l;){if(-1!==v){s=k;s>=
-v&&(s-=w);u=(u=l.firstChild.data)?u.length:0;if(h+u>s)break;h+=u}s=l.nextSibling;m.removeChild(l);l=s}g=this._createSpan(m,t,g,r.ignoreChars);l?m.insertBefore(g,l):m.appendChild(g);c&&(c.lineWidth=void 0)}if(c)for(q=g?g.nextSibling:null;q;)s=q.nextSibling,c.removeChild(q),q=s;else q.appendChild(m);return m},_createRanges:function(q,c,b,d,k,e){if(!(b>d)){if(q)for(var m=0;m<q.length;m++){var h=q[m];if(!(h.end<k+b)){var f=Math.max(k+b,h.start)-k;if(f>d)break;var r=Math.min(k+d,h.end)-k;if(f<=r){f=Math.max(b,
-f);r=Math.min(d,r);b<f&&this._createRange(c,b,f,null,e);if(!h.style||!h.style.unmergeable)for(;m+1<q.length&&q[m+1].start-k===r&&a(h.style,q[m+1].style);)h=q[m+1],r=Math.min(k+d,h.end)-k,m++;this._createRange(c,f,r,h.style,e);b=r}}}b<d&&this._createRange(c,b,d,null,e)}},_createRange:function(a,c,b,d,k){if(!(c>b)){var e=this.view._customTabSize;if(e&&8!==e)for(var m=a.indexOf("\t",c);-1!==m&&m<b;){c<m&&(c={text:a.substring(c,m),style:d},k.ranges.push(c),k.tabOffset+=c.text.length);c=e-k.tabOffset%
-e;if(0<c){for(var h="\u00a0",f=1;f<c;f++)h+=" ";c={text:h,style:d,ignoreChars:c-1};k.ranges.push(c);k.tabOffset+=c.text.length}c=m+1;if(c===b)return;m=a.indexOf("\t",c)}c<=b&&(c={text:a.substring(c,b),style:d},k.ranges.push(c),k.tabOffset+=c.text.length)}},_createSpan:function(a,c,b,k){var m=this.view,h="span";b&&b.tagName&&(h=b.tagName.toLowerCase());var f="a"===h;f&&(a.hasLink=!0);f&&!m._linksVisible&&(h="span");f=a.ownerDocument;a=e.createElement(a.ownerDocument,h);b&&b.html?(a.innerHTML=b.html,
-a.ignore=!0):b&&b.node?(a.appendChild(b.node),a.ignore=!0):a.appendChild(f.createTextNode(b&&b.text?b.text:c));d(b,a);if("a"===h){var r=m._getWindow();s(a,"click",function(a){return m._handleLinkClick(a?a:r.event)},!1)}a.viewStyle=b;k&&(a.ignoreChars=k);return a},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(a,c){var b=this._ensureCreated(),d=this.view;if(void 0===a)return this._getLineBoundingClientRect(b,
-!0);var k=d._model,m=b.ownerDocument,h=this.lineIndex,f=null;if(a<k.getLineEnd(h)){h=k.getLineStart(h);for(k=b.firstChild;k;){if(!k.ignore){var r=k.firstChild,g=r.length;k.ignoreChars&&(g-=k.ignoreChars);if(h+g>a){f=a-h;if(1===r.length)f=new v(k.getBoundingClientRect());else if(d._isRangeRects)m=m.createRange(),m.setStart(r,f),m.setEnd(r,f+1),f=new v(m.getBoundingClientRect());else if(e.isIE)m=m.body.createTextRange(),m.moveToElementText(k),m.collapse(),(h=0===f&&8===e.isIE)&&(f=1),m.moveEnd("character",
-f+1),m.moveStart("character",f),f=new v(m.getBoundingClientRect()),h&&(f.left=k.getClientRects()[0].left);else{var l=r.data;k.removeChild(r);k.appendChild(m.createTextNode(l.substring(0,f)));var s=e.createElement(m,"span");s.appendChild(m.createTextNode(l.substring(f,f+1)));k.appendChild(s);k.appendChild(m.createTextNode(l.substring(f+1)));f=new v(s.getBoundingClientRect());k.innerHTML="";k.appendChild(r);this._createdDiv||(m=d._getSelection(),(h<=m.start&&m.start<h+g||h<=m.end&&m.end<h+g)&&d._updateDOMSelection())}e.isIE&&
-(m=b.ownerDocument.defaultView||b.ownerDocument.parentWindow,b=m.screen.logicalXDPI/m.screen.deviceXDPI,m=m.screen.logicalYDPI/m.screen.deviceYDPI,f.left*=b,f.right*=b,f.top*=m,f.bottom*=m);break}h+=g}k=k.nextSibling}}b=this.getBoundingClientRect();f||(d._wrapMode?(d=this.getClientRects(),f=d[d.length-1],f.left=f.right,f.left+=b.left,f.top+=b.top,f.right+=b.left,f.bottom+=b.top):(f=new v(b),f.left=f.right));if(c||void 0===c)f.left-=b.left,f.top-=b.top,f.right-=b.left,f.bottom-=b.top;return f},_getClientRects:function(a,
-c){var b,d,k,e;if(!a._rectsCache){b=a.getClientRects();d=Array(b.length);for(e=0;e<b.length;e++)k=d[e]=new v(b[e]),k.left-=c.left,k.top-=c.top,k.right-=c.left,k.bottom-=c.top;a._rectsCache=d}b=a._rectsCache;d=[b.length];for(e=0;e<b.length;e++)d[e]=new v(b[e]);return d},getClientRects:function(a){if(!this.view._wrapMode)return[this.getBoundingClientRect()];for(var c=this._ensureCreated(),b=[],d=c.firstChild,k,e=c.getBoundingClientRect();d;){if(!d.ignore)for(var m=this._getClientRects(d,e),c=0;c<m.length;c++){var h=
-m[c],f;if(h.top!==h.bottom){var r=h.top+(h.bottom-h.top)/2;for(f=0;f<b.length&&!(k=b[f],k.top<=r&&r<k.bottom);f++);f===b.length?b.push(h):(h.left<k.left&&(k.left=h.left),h.top<k.top&&(k.top=h.top),h.right>k.right&&(k.right=h.right),h.bottom>k.bottom&&(k.bottom=h.bottom))}}d=d.nextSibling}return void 0!==a?b[a]:b},_getLineBoundingClientRect:function(a,c){var b=new v(a.getBoundingClientRect());if(!this.view._wrapMode){b.right=b.left;for(var d=a.lastChild;d&&d.ignoreChars===d.firstChild.length;)d=d.previousSibling;
-d&&(d=d.getBoundingClientRect(),b.right=d.right+r(a).right)}c&&(d=r(a),b.left+=d.left,b.right-=d.right);return b},getLineCount:function(){return!this.view._wrapMode?1:this.getClientRects().length},getLineIndex:function(a){if(!this.view._wrapMode)return 0;for(var c=this.getClientRects(),a=this.getBoundingClientRect(a),a=a.top+(a.bottom-a.top)/2,b=0;b<c.length;b++)if(c[b].top<=a&&a<c[b].bottom)return b;return c.length-1},getLineStart:function(a){if(!this.view._wrapMode||0===a)return this.view._model.getLineStart(a);
-var c=this.getClientRects();return this.getOffset(c[a].left+1,c[a].top+1)},getOffset:function(a,c){var b=this.view,d=b._model,k=this.lineIndex,m=d.getLineStart(k),h=d.getLineEnd(k);if(m===h)return m;var f=this._ensureCreated(),r=this.getBoundingClientRect(),g,l;if(b._wrapMode){g=this.getClientRects();c<g[0].top&&(c=g[0].top);for(var s=0;s<g.length&&!(l=g[s],l.top<=c&&c<l.bottom);s++);a<l.left&&(a=l.left);a>l.right&&(a=l.right-1)}else 0>a&&(a=0),a>r.right-r.left&&(a=r.right-r.left);var t=f.ownerDocument,
-s=t.defaultView||t.parentWindow,u=e.isIE?s.screen.logicalXDPI/s.screen.deviceXDPI:1,w=e.isIE?s.screen.logicalYDPI/s.screen.deviceYDPI:1,s=m,v=f.firstChild;a:for(;v;){if(!v.ignore){var y=v.firstChild,f=y.length;v.ignoreChars&&(f-=v.ignoreChars);var p,n,z;g=this._getClientRects(v,r);for(var K=0;K<g.length;K++)if(l=g[K],l.left<=a&&a<l.right&&(!b._wrapMode||l.top<=c&&c<l.bottom)){var K=l.left+r.left,G;if(e.isIE||b._isRangeRects){for(var t=b._isRangeRects?t.createRange():t.body.createTextRange(),F=f,L=
--1;1<F-L;){var V=Math.floor((F+L)/2);g=L+1;l=V===f-1&&v.ignoreChars?y.length:V+1;G=0===g&&8===e.isIE;b._isRangeRects?(t.setStart(y,g),t.setEnd(y,l)):(G&&(g=1),t.moveToElementText(v),t.move("character",g),t.moveEnd("character",l-g));g=t.getClientRects();for(var X=!1,W=0;W<g.length;W++)if(l=g[W],p=(G?K:l.left)*u-r.left,z=l.right*u-r.left,n=l.top*w-r.top,l=l.bottom*w-r.top,p<=a&&a<z&&(!b._wrapMode||n<=c&&c<l)){X=!0;break}X?F=V:L=V}s+=F;g=F;l=F===f-1&&v.ignoreChars?y.length:Math.min(F+1,y.length);b._isRangeRects?
-(t.setStart(y,g),t.setEnd(y,l)):(t.moveToElementText(v),t.move("character",g),t.moveEnd("character",l-g));g=t.getClientRects();b=!1;0<g.length&&(l=g[0],p=(G?K:l.left)*u-r.left,z=l.right*u-r.left,b=a>p+(z-p)/2);r=s-m;d=d.getLine(k);k=d.charCodeAt(r);55296<=k&&56319>=k&&b?r<d.length&&(k=d.charCodeAt(r+1),56320<=k&&57343>=k&&(s+=1)):56320<=k&&(57343>=k&&!b)&&0<r&&(k=d.charCodeAt(r-1),55296<=k&&56319>=k&&(s-=1));b&&s++}else{d=[];for(k=0;k<f;k++)d.push("<span>"),k===f-1?d.push(y.data.substring(k)):d.push(y.data.substring(k,
-k+1)),d.push("</span>");v.innerHTML=d.join("");for(d=v.firstChild;d;){l=d.getBoundingClientRect();p=l.left-r.left;z=l.right-r.left;if(p<=a&&a<z){a>p+(z-p)/2&&s++;break}s++;d=d.nextSibling}this._createdDiv||(v.innerHTML="",v.appendChild(y),r=b._getSelection(),(s<=r.start&&r.start<s+f||s<=r.end&&r.end<s+f)&&b._updateDOMSelection())}break a}s+=f}v=v.nextSibling}return Math.min(h,Math.max(m,s))},getNextOffset:function(a,c){if("line"===c.unit){var b=this.view._model,d=b.getLineAtOffset(a);if(0<c.count)return c.count--,
-b.getLineEnd(d);c.count++;return b.getLineStart(d)}return"wordend"===c.unit||"wordWS"===c.unit||"wordendWS"===c.unit?this._getNextOffset_W3C(a,c):e.isIE?this._getNextOffset_IE(a,c):this._getNextOffset_W3C(a,c)},_getNextOffset_W3C:function(a,c){function b(a){return 33<=a&&47>=a||58<=a&&64>=a||91<=a&&94>=a||96===a||123<=a&&126>=a}function d(a){return 32===a||9===a}var k=this.view._model,e=k.getLineAtOffset(a),m=k.getLine(e),h=k.getLineStart(e),k=k.getLineEnd(e),e=m.length,f=a-h,r,g=0>c.count?-1:1;if("word"===
-c.unit||"wordend"===c.unit||"wordWS"===c.unit||"wordendWS"===c.unit)for(var l,s,t;0!==c.count;){if(0<c.count){if(f===e)return k;r=m.charCodeAt(f);l=b(r);s=!l&&!d(r);for(f++;f<e;){r=m.charCodeAt(f);if("wordWS"!==c.unit&&"wordendWS"!==c.unit){t=b(r);if("wordend"===c.unit){if(!t&&l)break}else if(t&&!l)break;r=!t&&!d(r)}else r=!d(r);if("wordend"===c.unit||"wordendWS"===c.unit){if(!r&&s)break}else if(r&&!s)break;s=r;l=t;f++}}else{if(0===f)return h;f--;r=m.charCodeAt(f);l=b(r);for(s=!l&&!d(r);0<f;){r=m.charCodeAt(f-
-1);if("wordWS"!==c.unit&&"wordendWS"!==c.unit){t=b(r);if("wordend"===c.unit){if(t&&!l)break}else if(!t&&l)break;r=!t&&!d(r)}else r=!d(r);if("wordend"===c.unit||"wordendWS"===c.unit){if(r&&!s)break}else if(!r&&s)break;s=r;l=t;f--}}c.count-=g}else for(;0!==c.count&&0<=f+g&&f+g<=e;)f+=g,r=m.charCodeAt(f),56320<=r&&57343>=r&&0<f&&(r=m.charCodeAt(f-1),55296<=r&&56319>=r&&(f+=g)),c.count-=g;return h+f},_getNextOffset_IE:function(a,c){var b=this._ensureCreated(),d=this.view._model,k=this.lineIndex,e=0,m;
-m=d.getLineStart(k);var h=b.ownerDocument,f=0>c.count?-1:1;if(a===d.getLineEnd(k)){for(b=b.lastChild;b&&b.ignoreChars===b.firstChild.length;)b=b.previousSibling;if(!b)return m;e=h.body.createTextRange();e.moveToElementText(b);m=e.text.length;e.moveEnd(c.unit,f);e=a+e.text.length-m}else if(a===m&&0>c.count)e=m;else for(b=b.firstChild;b;){d=b.firstChild.length;b.ignoreChars&&(d-=b.ignoreChars);if(m+d>a){e=h.body.createTextRange();a===m&&0>c.count?e.moveToElementText(b.previousSibling):(e.moveToElementText(b),
-e.collapse(),e.moveEnd("character",a-m));m=e.text.length;e.moveEnd(c.unit,f);e=a+e.text.length-m;break}m=d+m;b=b.nextSibling}c.count-=f;return e},destroy:function(){var a=this._createdDiv;a&&(a.parentNode.removeChild(a),this._createdDiv=null)}};y.prototype={addKeyMode:function(a,c){var b=this._keyModes;void 0!==c?b.splice(c,0,a):b.push(a);a._modeAdded&&a._modeAdded()},addRuler:function(a,c){a.setView(this);var b=this._rulers;if(void 0!==c){var d,k;for(k=d=0;d<b.length&&k<c;d++)a.getLocation()===b[d].getLocation()&&
-k++;b.splice(k,0,a);c=k}else b.push(a);this._createRuler(a,c);this._update()},computeSize:function(){var a=0,c=0,b=this._model,d=this._clientDiv;if(!d)return{width:a,height:c};var k=d.style.width;e.isWebkit&&(d.style.width="0x7fffffffpx");for(var b=b.getLineCount(),m=0;m<b;m++){var h=this._getLine(m),f=h.getBoundingClientRect(),a=Math.max(a,f.right-f.left),c=c+(f.bottom-f.top);h.destroy()}e.isWebkit&&(d.style.width=k);d=this._getViewPadding();a+=d.right+d.left+this._metrics.scrollWidth;c+=d.bottom+
-d.top+this._metrics.scrollWidth;return{width:a,height:c}},convert:function(a,c,b){if(this._clientDiv){var d=this._getScroll(),k=this._getViewPadding(),e=this._viewDiv.getBoundingClientRect();"document"===c&&(void 0!==a.x&&(a.x+=-d.x+e.left+k.left),void 0!==a.y&&(a.y+=-d.y+e.top+k.top));"document"===b&&(void 0!==a.x&&(a.x+=d.x-e.left-k.left),void 0!==a.y&&(a.y+=d.y-e.top-k.top));return a}},destroy:function(){for(var a=0;a<this._rulers.length;a++)this._rulers[a].setView(null);this.rulers=null;this._destroyView();
-this.onDestroy({type:"Destroy"});this._parent=null;this._model&&this._model.destroy&&this._model.destroy();this._actions=this._keyModes=this._doubleClickSelection=this._selection=this._theme=this._model=null},focus:function(){this._clientDiv&&(this._updateDOMSelection(),this._clientDiv.focus(),this._updateDOMSelection())},hasFocus:function(){return this._hasFocus},getActionDescription:function(a){if(a=this._actions[a])return a.actionDescription},getActions:function(a){var c=[],b=this._actions,d;for(d in b)b.hasOwnProperty(d)&&
-(a||!b[d].defaultHandler)&&c.push(d);return c},getBottomIndex:function(a){return!this._clientDiv?0:this._getBottomIndex(a)},getBottomPixel:function(){return!this._clientDiv?0:this._getScroll().y+this._getClientHeight()},getCaretOffset:function(){return this._getSelection().getCaret()},getClientArea:function(){if(!this._clientDiv)return{x:0,y:0,width:0,height:0};var a=this._getScroll();return{x:a.x,y:a.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return!this._clientDiv?
-0:this._getScroll().x},getKeyBindings:function(a){for(var c=[],b=this._keyModes,d=0;d<b.length;d++)c=c.concat(b[d].getKeyBindings(a));return c},getKeyModes:function(){return this._keyModes.slice(0)},getLineHeight:function(a){return!this._clientDiv?0:this._getLineHeight(a)},getLineIndex:function(a){return!this._clientDiv?0:this._getLineIndex(a)},getLinePixel:function(a){return!this._clientDiv?0:this._getLinePixel(a)},getLocationAtOffset:function(a){if(!this._clientDiv)return{x:0,y:0};var c=this._model,
-a=Math.min(Math.max(0,a),c.getCharCount()),c=c.getLineAtOffset(a),b=this._getLine(c),a=b.getBoundingClientRect(a);b.destroy();b=a.left;c=this._getLinePixel(c)+a.top;return{x:b,y:c}},getNextOffset:function(a,c){var b=new w(a,a,!1);this._doMove(c,b);return b.getCaret()},getOptions:function(){var a;if(0===arguments.length)a=this._defaultOptions();else if(1===arguments.length){if(a=arguments[0],"string"===typeof a)return h(this["_"+a])}else{a={};for(var c in arguments)arguments.hasOwnProperty(c)&&(a[arguments[c]]=
-void 0)}for(var b in a)a.hasOwnProperty(b)&&(a[b]=h(this["_"+b]));return a},getModel:function(){return this._model},getOffsetAtLocation:function(a,c){if(!this._clientDiv)return 0;var b=this._getLineIndex(c),d=this._getLine(b),b=d.getOffset(a,c-this._getLinePixel(b));d.destroy();return b},getLineAtOffset:function(a){this.getModel().getLineAtOffset(a)},getLineStart:function(a){this.getModel().getLineStart(a)},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){var a=this._getSelection();
-return{start:a.start,end:a.end}},getText:function(a,c){return this._model.getText(a,c)},getTopIndex:function(a){return!this._clientDiv?0:this._getTopIndex(a)},getTopPixel:function(){return!this._clientDiv?0:this._getScroll().y},invokeAction:function(a,c,b){if(this._clientDiv){if(a=this._actions[a]){if(!c&&a.handler&&a.handler(b))return!0;if(a.defaultHandler)return"boolean"===typeof a.defaultHandler(b)}return!1}},isDestroyed:function(){return!this._clientDiv},onContextMenu:function(a){return this.dispatchEvent(a)},
-onDragStart:function(a){return this.dispatchEvent(a)},onDrag:function(a){return this.dispatchEvent(a)},onDragEnd:function(a){return this.dispatchEvent(a)},onDragEnter:function(a){return this.dispatchEvent(a)},onDragOver:function(a){return this.dispatchEvent(a)},onDragLeave:function(a){return this.dispatchEvent(a)},onDrop:function(a){return this.dispatchEvent(a)},onDestroy:function(a){return this.dispatchEvent(a)},onLineStyle:function(a){return this.dispatchEvent(a)},onKeyDown:function(a){return this.dispatchEvent(a)},
-onKeyPress:function(a){return this.dispatchEvent(a)},onKeyUp:function(a){return this.dispatchEvent(a)},onModelChanged:function(a){return this.dispatchEvent(a)},onModelChanging:function(a){return this.dispatchEvent(a)},onModify:function(a){return this.dispatchEvent(a)},onMouseDown:function(a){return this.dispatchEvent(a)},onMouseUp:function(a){return this.dispatchEvent(a)},onMouseMove:function(a){return this.dispatchEvent(a)},onMouseOver:function(a){return this.dispatchEvent(a)},onMouseOut:function(a){return this.dispatchEvent(a)},
-onSelection:function(a){return this.dispatchEvent(a)},onScroll:function(a){return this.dispatchEvent(a)},onVerify:function(a){return this.dispatchEvent(a)},onFocus:function(a){return this.dispatchEvent(a)},onBlur:function(a){return this.dispatchEvent(a)},redraw:function(){if(!(0<this._redrawCount)){var a=this._model.getLineCount();this.redrawRulers(0,a);this.redrawLines(0,a)}},redrawRulers:function(a,c){if(!(0<this._redrawCount))for(var b=this.getRulers(),d=0;d<b.length;d++)this.redrawLines(a,c,b[d])},
-redrawLines:function(a,c,b){if(!(0<this._redrawCount)&&(void 0===a&&(a=0),void 0===c&&(c=this._model.getLineCount()),a!==c)){var d=this._clientDiv;if(d){if(b)for(d=this._getRulerParent(b).firstChild;d&&d._ruler!==b;)d=d.nextSibling;b?d.rulerChanged=!0:this._lineHeight&&this._resetLineHeight(a,c);if(!b||"page"===b.getOverview())for(d=d.firstChild;d;){var k=d.lineIndex;a<=k&&k<c&&(d.lineChanged=!0);d=d.nextSibling}!b&&(!this._wrapMode&&a<=this._maxLineIndex&&this._maxLineIndex<c)&&(this._checkMaxLineIndex=
-this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0);this._queueUpdate()}}},redrawRange:function(a,c){if(!(0<this._redrawCount)){var b=this._model;void 0===a&&(a=0);void 0===c&&(c=b.getCharCount());var d=b.getLineAtOffset(a),b=b.getLineAtOffset(Math.max(a,c-1))+1;this.redrawLines(d,b)}},removeKeyMode:function(a){for(var c=this._keyModes,b=0;b<c.length;b++)if(c[b]===a){c.splice(b,1);break}a._modeRemoved&&a._modeRemoved()},removeRuler:function(a){for(var c=this._rulers,b=0;b<c.length;b++)if(c[b]===
-a){c.splice(b,1);a.setView(null);this._destroyRuler(a);this._update();break}},resize:function(){this._clientDiv&&this._handleResize(null)},setAction:function(a,c,b){if(a){var d=this._actions,k=d[a];k||(k=d[a]={});k.handler=c;void 0!==b&&(k.actionDescription=b)}},setKeyBinding:function(a,c){this._keyModes[0].setKeyBinding(a,c)},setCaretOffset:function(a,c,b){var d=this._model.getCharCount(),a=Math.max(0,Math.min(a,d)),a=new w(a,a,!1);this._setSelection(a,void 0===c||c,!0,b)},setHorizontalPixel:function(a){this._clientDiv&&
-(a=Math.max(0,a),this._scrollView(a-this._getScroll().x,0))},setRedraw:function(a){a?0===--this._redrawCount&&this.redraw():this._redrawCount++},setModel:function(a){if(a&&a!==this._model){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);var c=this._model.getLineCount(),b=this._model.getCharCount(),d=a.getLineCount(),k=a.getCharCount(),e={type:"ModelChanging",text:a.getText(),start:0,removedCharCount:b,
-addedCharCount:k,removedLineCount:c,addedLineCount:d};this.onModelChanging(e);this._model=a;e={type:"ModelChanged",start:0,removedCharCount:b,addedCharCount:k,removedLineCount:c,addedLineCount:d};this.onModelChanged(e);this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._reset();this._update()}},setOptions:function(c){var b=this._defaultOptions(),d;for(d in c)if(c.hasOwnProperty(d)){var k=c[d];if(!a(this["_"+
-d],k)){var e=b[d]?b[d].update:null;e?e.call(this,k):this["_"+d]=h(k)}}},setSelection:function(a,c,b,d){var k=a>c;if(k)var e=a,a=c,c=e;e=this._model.getCharCount();a=Math.max(0,Math.min(a,e));c=Math.max(0,Math.min(c,e));a=new w(a,c,k);this._setSelection(a,void 0===b||b,!0,d)},setText:function(a,c,b){var d=void 0===c&&void 0===b;void 0===c&&(c=0);void 0===b&&(b=this._model.getCharCount());d&&(this._variableLineHeight=!1);this._modifyContent({text:a,start:c,end:b,_code:!0},!d);d&&(this._columnX=-1,this._setSelection(new w(0,
-0,!1),!0),e.isFirefox&&this._fixCaret())},setTopIndex:function(a){this._clientDiv&&this._scrollView(0,this._getLinePixel(Math.max(0,a))-this._getScroll().y)},setTopPixel:function(a){this._clientDiv&&this._scrollView(0,Math.max(0,a)-this._getScroll().y)},showSelection:function(){return this._showCaret(!0)},update:function(a,c){this._clientDiv&&(a&&this._updateStyle(),void 0===c||c?this._update():this._queueUpdate())},_handleRootMouseDown:function(a){if(!this._ignoreEvent(a)){e.isFirefox&&1===a.which&&
-(this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0);var c=this._overlayDiv||this._clientDiv;9>e.isIE&&(c=this._viewDiv);for(var b=a.target?a.target:a.srcElement;b;){if(c===b)return;b=b.parentNode}a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();if(!this._isW3CEvents){var d=this;this._getWindow().setTimeout(function(){d._clientDiv.focus()},0)}}},_handleRootMouseUp:function(a){!this._ignoreEvent(a)&&(e.isFirefox&&1===a.which)&&
-(this._clientDiv.contentEditable=!0,(this._overlayDiv||this._clientDiv).draggable=!1,this._fixCaret(),this._ignoreBlur=!1)},_handleBlur:function(){if(!this._ignoreBlur){this._hasFocus=!1;if(9>e.isIE&&!this._getSelection().isEmpty()){var a=this._rootDiv,c=e.createElement(a.ownerDocument,"div");a.appendChild(c);a.removeChild(c)}this._cursorDiv&&(this._cursorDiv.style.display="none");if(this._selDiv1)if(this._selDiv1.style.background="lightgray",this._selDiv2.style.background="lightgray",this._selDiv3.style.background=
-"lightgray",a=this._getWindow(),c=this._selDiv1.ownerDocument,a.getSelection){c=a.getSelection();for(a=c.anchorNode;a;){if(a===this._clientDiv){0<c.rangeCount&&c.removeAllRanges();break}a=a.parentNode}}else if(c.selection){this._ignoreSelect=!1;for(a=c.selection.createRange().parentElement();a;){if(a===this._clientDiv){c.selection.empty();break}a=a.parentNode}this._ignoreSelect=!0}if(!this._ignoreFocus)this.onBlur({type:"Blur"})}},_handleContextMenu:function(a){if(!this._ignoreEvent(a)){e.isIE&&3===
-this._lastMouseButton&&this._updateDOMSelection();var c=!1;this.isListening("ContextMenu")?(c=this._createMouseEvent("ContextMenu",a),c.screenX=a.screenX,c.screenY=a.screenY,this.onContextMenu(c),c=c.defaultPrevented):e.isMac&&(e.isFirefox&&0===a.button)&&(c=!0);if(c)return a.preventDefault&&a.preventDefault(),!1}},_handleCopy:function(a){if(!this._ignoreEvent(a)&&!this._ignoreCopy&&this._doCopy(a))return a.preventDefault&&a.preventDefault(),!1},_handleCut:function(a){if(!this._ignoreEvent(a)&&this._doCut(a))return a.preventDefault&&
-a.preventDefault(),!1},_handleDataModified:function(a){this._ignoreEvent(a)||this._startIME()},_handleDblclick:function(a){this._ignoreEvent(a)||(this._lastMouseTime=a.timeStamp?a.timeStamp:(new Date).getTime(),2!==this._clickCount&&(this._clickCount=2,this._handleMouse(a)))},_handleDragStart:function(a){if(!this._ignoreEvent(a)){if(e.isFirefox){var c=this;this._getWindow().setTimeout(function(){c._clientDiv.contentEditable=!0;c._clientDiv.draggable=!1;c._ignoreBlur=!1},0)}if(this.isListening("DragStart")&&
--1!==this._dragOffset)this._isMouseDown=!1,this.onDragStart(this._createMouseEvent("DragStart",a)),this._dragOffset=-1;else return a.preventDefault&&a.preventDefault(),!1}},_handleDrag:function(a){if(!this._ignoreEvent(a)&&this.isListening("Drag"))this.onDrag(this._createMouseEvent("Drag",a))},_handleDragEnd:function(a){if(!this._ignoreEvent(a)){this._dropTarget=!1;this._dragOffset=-1;if(this.isListening("DragEnd"))this.onDragEnd(this._createMouseEvent("DragEnd",a));e.isFirefox&&(this._fixCaret(),
-"none"===a.dataTransfer.dropEffect&&!a.dataTransfer.mozUserCancelled&&this._fixCaret())}},_handleDragEnter:function(a){if(!this._ignoreEvent(a)){var c=!0;this._dropTarget=!0;this.isListening("DragEnter")&&(c=!1,this.onDragEnter(this._createMouseEvent("DragEnter",a)));if(e.isWebkit||c)return a.preventDefault&&a.preventDefault(),!1}},_handleDragOver:function(a){if(!this._ignoreEvent(a)){var c=!0;this.isListening("DragOver")&&(c=!1,this.onDragOver(this._createMouseEvent("DragOver",a)));if(e.isWebkit||
-c)return c&&(a.dataTransfer.dropEffect="none"),a.preventDefault&&a.preventDefault(),!1}},_handleDragLeave:function(a){if(!this._ignoreEvent(a)&&(this._dropTarget=!1,this.isListening("DragLeave")))this.onDragLeave(this._createMouseEvent("DragLeave",a))},_handleDrop:function(a){if(!this._ignoreEvent(a)){this._dropTarget=!1;if(this.isListening("Drop"))this.onDrop(this._createMouseEvent("Drop",a));a.preventDefault&&a.preventDefault();return!1}},_handleFocus:function(){this._hasFocus=!0;e.isIOS&&void 0!==
-this._lastTouchOffset?(this.setCaretOffset(this._lastTouchOffset,!0),this._lastTouchOffset=void 0):this._updateDOMSelection();this._cursorDiv&&(this._cursorDiv.style.display="block");if(this._selDiv1){var a=this._highlightRGB;this._selDiv1.style.background=a;this._selDiv2.style.background=a;this._selDiv3.style.background=a}if(!this._ignoreFocus)this.onFocus({type:"Focus"})},_handleKeyDown:function(a){if(!this._ignoreEvent(a)){if(this.isListening("KeyDown")){var c=this._createKeyEvent("KeyDown",a);
-this.onKeyDown(c);if(c.defaultPrevented){e.isFirefox&&(this._keyDownPrevented=!0);a.preventDefault();return}}c=!1;switch(a.keyCode){case 16:case 17:case 18:case 91:c=!0;break;default:this._setLinksVisible(!1)}if(229===a.keyCode){if(this._readonly)return a.preventDefault&&a.preventDefault(),!1;c=!0;e.isSafari&&e.isMac&&a.ctrlKey&&(c=!1,a.keyCode=129);c&&this._startIME()}else c||this._commitIME();if((e.isMac||e.isLinux)&&4>e.isFirefox||12.16>e.isOpera)return this._keyDownEvent=a,!0;if(this._doAction(a))return a.preventDefault?
-(a.preventDefault(),a.stopPropagation()):(a.cancelBubble=!0,a.returnValue=!1,a.keyCode=0),!1}},_handleKeyPress:function(a){if(!this._ignoreEvent(a))if(this._keyDownPrevented)a.preventDefault&&(a.preventDefault(),a.stopPropagation()),this._keyDownPrevented=void 0;else{if(e.isMac&&e.isWebkit&&(63232<=a.keyCode&&63487>=a.keyCode||13===a.keyCode||8===a.keyCode)||((e.isMac||e.isLinux)&&4>e.isFirefox||12.16>e.isOpera)&&this._doAction(this._keyDownEvent))return a.preventDefault&&a.preventDefault(),!1;var c=
-e.isMac?a.metaKey:a.ctrlKey;if(void 0!==a.charCode&&c)switch(a.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")&&(c=this._createKeyEvent("KeyPress",a),this.onKeyPress(c),c.defaultPrevented)){a.preventDefault();return}if(this._doAction(a))return a.preventDefault?(a.preventDefault(),a.stopPropagation()):(a.cancelBubble=!0,a.returnValue=!1,a.keyCode=0),!1;c=!1;if(e.isMac){if(a.ctrlKey||a.metaKey)c=!0}else if(e.isFirefox){if(a.ctrlKey||a.altKey)c=!0}else a.ctrlKey^a.altKey&&
-(c=!0);if(!c&&(c=e.isOpera?a.which:void 0!==a.charCode?a.charCode:a.keyCode,31<c))return this._doContent(String.fromCharCode(c)),a.preventDefault&&a.preventDefault(),!1}},_handleDocKeyUp:function(a){(e.isMac?a.metaKey:a.ctrlKey)||this._setLinksVisible(!1)},_handleKeyUp:function(a){if(!this._ignoreEvent(a)){if(this.isListening("KeyUp")){var c=this._createKeyEvent("KeyUp",a);this.onKeyUp(c);if(c.defaultPrevented){a.preventDefault();return}}this._handleDocKeyUp(a);13===a.keyCode&&this._commitIME()}},
-_handleLinkClick:function(a){if(!(e.isMac?a.metaKey:a.ctrlKey))return a.preventDefault&&a.preventDefault(),!1},_handleMouse:function(a){var c=this._getWindow(),b=!0,d=c;if(e.isIE||e.isFirefox&&!this._overlayDiv)d=this._clientDiv;if(this._overlayDiv){this._hasFocus&&(this._ignoreFocus=!0);var k=this;c.setTimeout(function(){k.focus();k._ignoreFocus=!1},0)}1===this._clickCount?(b=this._setSelectionTo(a.clientX,a.clientY,a.shiftKey,(!e.isOpera||12.16<=e.isOpera)&&this._hasFocus&&this.isListening("DragStart")))&&
-this._setGrab(d):(this._isW3CEvents&&this._setGrab(d),this._doubleClickSelection=null,this._setSelectionTo(a.clientX,a.clientY,a.shiftKey),this._doubleClickSelection=this._getSelection());return b},_handleMouseDown:function(a){if(!this._ignoreEvent(a)){if(this._linksVisible)if("A"!==(a.target||a.srcElement).tagName)this._setLinksVisible(!1);else return;this._commitIME();var c=a.which;c||(4===a.button&&(c=2),2===a.button&&(c=3),1===a.button&&(c=1));var b=2!==c&&a.timeStamp?a.timeStamp:(new Date).getTime(),
-d=b-this._lastMouseTime,k=Math.abs(this._lastMouseX-a.clientX),m=Math.abs(this._lastMouseY-a.clientY),h=this._lastMouseButton===c;this._lastMouseX=a.clientX;this._lastMouseY=a.clientY;this._lastMouseTime=b;this._lastMouseButton=c;1===c&&(this._isMouseDown=!0,h&&d<=this._clickTime&&k<=this._clickDist&&m<=this._clickDist?this._clickCount++:this._clickCount=1);if(this.isListening("MouseDown")&&(b=this._createMouseEvent("MouseDown",a),this.onMouseDown(b),b.defaultPrevented)){a.preventDefault();return}if(1===
-c&&this._handleMouse(a)&&(9<=e.isIE||e.isOpera||e.isChrome||e.isSafari||e.isFirefox&&!this._overlayDiv))this._hasFocus||this.focus(),a.preventDefault();e.isFirefox&&3===this._lastMouseButton&&this._updateDOMSelection()}},_handleMouseOver:function(a){if(!this._ignoreEvent(a)&&!this._animation&&this.isListening("MouseOver"))this.onMouseOver(this._createMouseEvent("MouseOver",a))},_handleMouseOut:function(a){if(!this._ignoreEvent(a)&&!this._animation&&this.isListening("MouseOut"))this.onMouseOut(this._createMouseEvent("MouseOut",
-a))},_handleMouseMove:function(a){if(!this._animation){var c=this._isClientDiv(a);if(this.isListening("MouseMove")&&c)this.onMouseMove(this._createMouseEvent("MouseMove",a));if(!this._dropTarget){var b=this._linksVisible||this._lastMouseMoveX!==a.clientX||this._lastMouseMoveY!==a.clientY;this._lastMouseMoveX=a.clientX;this._lastMouseMoveY=a.clientY;this._setLinksVisible(b&&!this._isMouseDown&&(e.isMac?a.metaKey:a.ctrlKey));if(!this._isW3CEvents){if(0===a.button)return this._setGrab(null),!0;if(!this._isMouseDown&&
-1===a.button&&0!==(this._clickCount&1)&&c)return this._clickCount=2,this._handleMouse(a,this._clickCount)}if(this._isMouseDown&&-1===this._dragOffset){var c=a.clientX,a=a.clientY,d=this._getViewPadding(),k=this._viewDiv.getBoundingClientRect(),m=this._getClientWidth(),h=this._getClientHeight(),b=k.left+d.left,f=k.top+d.top,m=k.left+d.left+m,d=k.top+d.top+h;a<f?this._doAutoScroll("up",c,a-f):a>d?this._doAutoScroll("down",c,a-d):c<b&&!this._wrapMode?this._doAutoScroll("left",c-b,a):c>m&&!this._wrapMode?
-this._doAutoScroll("right",c-m,a):(this._endAutoScroll(),this._setSelectionTo(c,a,!0))}}}},_isClientDiv:function(a){for(var c=this._overlayDiv||this._clientDiv,a=a.target?a.target:a.srcElement;a;){if(c===a)return!0;a=a.parentNode}return!1},_createKeyEvent:function(a,c){return{type:a,event:c,preventDefault:function(){this.defaultPrevented=!0}}},_createMouseEvent:function(a,c){var b=this.convert({x:c.clientX,y:c.clientY},"page","document");return{type:a,event:c,clickCount:this._clickCount,x:b.x,y:b.y,
-preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(a){var c=a.which?0===a.button:1===a.button;if(this.isListening("MouseUp")&&(this._isClientDiv(a)||c&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp",a));!this._linksVisible&&(c&&this._isMouseDown)&&(-1!==this._dragOffset&&(c=this._getSelection(),c.extend(this._dragOffset),c.collapse(),this._setSelection(c,!0,!0),this._dragOffset=-1),this._isMouseDown=!1,this._endAutoScroll(),this._isW3CEvents&&this._setGrab(null),
-e.isFirefox&&a.preventDefault())},_handleMouseWheel:function(a){var c=this._getLineHeight(),b=0,d=0;e.isIE||e.isOpera?d=-a.wheelDelta/40*c:e.isFirefox?(c=e.isMac?3*a.detail:Math.max(-256,Math.min(256,a.detail))*c,a.axis===a.HORIZONTAL_AXIS?b=c:d=c):e.isMac?(d=a.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=a.timeStamp,b=0!==a.wheelDeltaX%120?1:40>d?40/(40-d):40,d=0!==a.wheelDeltaY%120?1:40>d?40/(40-d):40,b=Math.ceil(-a.wheelDeltaX/b),-1<b&&0>b&&(b=-1),0<b&&1>b&&(b=1),d=Math.ceil(-a.wheelDeltaY/
-d),-1<d&&0>d&&(d=-1),0<d&&1>d&&(d=1)):(b=-a.wheelDeltaX,d=8*(-a.wheelDeltaY/120)*c);if(e.isSafari){for(c=a.target;c&&void 0===c.lineIndex;)c=c.parentNode;this._mouseWheelLine=c}c=this._getScroll();this._scrollView(b,d);b=this._getScroll();if(c.x!==b.x||c.y!==b.y)return a.preventDefault&&a.preventDefault(),!1},_handlePaste:function(a){if(!this._ignoreEvent(a)&&!this._ignorePaste&&this._doPaste(a)){if(e.isIE){var c=this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){c._updateDOMSelection();
-c._ignoreFocus=!1},0)}a.preventDefault&&a.preventDefault();return!1}},_handleResize:function(){var c=this._rootDiv.clientWidth,b=this._rootDiv.clientHeight;if(this._rootWidth!==c||this._rootHeight!==b)this._rootWidth!==c&&this._wrapMode&&this._resetLineHeight(),this._rootWidth=c,this._rootHeight=b,c=9>e.isIE,b=this._calculateMetrics(),a(b,this._metrics)||(this._variableLineHeight&&(this._variableLineHeight=!1,this._resetLineHeight()),this._metrics=b,c=!0),c?this._queueUpdate():this._update()},_handleRulerEvent:function(a){for(var c=
-a.target?a.target:a.srcElement,b=c.lineIndex;c&&!c._ruler;)void 0===b&&void 0!==c.lineIndex&&(b=c.lineIndex),c=c.parentNode;var d=c?c._ruler:null;if(void 0===b&&d&&"document"===d.getOverview()){var b=this._getClientHeight(),k=this._model.getLineCount(),e=this._getViewPadding(),m=this._viewDiv.getBoundingClientRect(),b=Math.floor((a.clientY-m.top-this._metrics.scrollWidth)*k/(b+e.top+e.bottom-2*this._metrics.scrollWidth));0<=b&&b<k||(b=void 0)}if(d)switch(a.type){case "click":if(d.onClick)d.onClick(b,
-a);break;case "dblclick":if(d.onDblClick)d.onDblClick(b,a);break;case "mousemove":if(d.onMouseMove)d.onMouseMove(b,a);break;case "mouseover":if(d.onMouseOver)d.onMouseOver(b,a);break;case "mouseout":if(d.onMouseOut){for(k=a.relatedTarget;k&&k!==this._rootDiv;){if(k===c)return;k=k.parentNode}d.onMouseOut(b,a)}}},_handleScroll:function(){var a=this._getScroll(!1),c=this._hScroll,b=this._vScroll;if(c!==a.x||b!==a.y)this._hScroll=a.x,this._vScroll=a.y,this._commitIME(),this._update(b===a.y),this.onScroll({type:"Scroll",
-oldValue:{x:c,y:b},newValue:a})},_handleSelectStart:function(a){if(this._ignoreSelect)return a&&a.preventDefault&&a.preventDefault(),!1},_getModelOffset:function(a,c){if(a){var b;b="DIV"===a.tagName?a:a.parentNode.parentNode;var d=0,k=b.lineIndex;if("DIV"!==a.tagName)for(b=b.firstChild;b;){var e=b.firstChild;if(e===a){b.ignoreChars&&(d-=b.ignoreChars);d+=c;break}b.ignoreChars&&(d-=b.ignoreChars);d+=e.data.length;b=b.nextSibling}return Math.max(0,d)+this._model.getLineStart(k)}},_updateSelectionFromDOM:function(){var a=
-this._getWindow().getSelection(),c=this._getModelOffset(a.anchorNode,a.anchorOffset),a=this._getModelOffset(a.focusNode,a.focusOffset);void 0===c||void 0===a||this._setSelection(new w(c,a),!1,!1)},_handleSelectionChange:function(){if(-1===this._imeOffset)if(e.isAndroid){var a=this._getWindow();this._selTimer&&a.clearTimeout(this._selTimer);var c=this;this._selTimer=a.setTimeout(function(){c._clientDiv&&(c._selTimer=null,c._updateSelectionFromDOM())},250)}else this._updateSelectionFromDOM()},_handleTextInput:function(a){if(!this._ignoreEvent(a)){this._imeOffset=
--1;var c=this._getWindow().getSelection();if(c.anchorNode!==this._anchorNode||c.focusNode!==this._focusNode||c.anchorOffset!==this._anchorOffset||c.focusOffset!==this._focusOffset){for(var b=c.anchorNode;b&&void 0===b.lineIndex;)b=b.parentNode;if(b){var d=this._model,k=b.lineIndex,e=d.getLine(k),m=e,h=0,d=d.getLineStart(k);0<c.rangeCount&&(c.getRangeAt(0).deleteContents(),k=b.ownerDocument.createTextNode(a.data),c.getRangeAt(0).insertNode(k),h=this._getDOMText(b,k),m=h.text,h=h.offset,k.parentNode.removeChild(k));
-b.lineRemoved=!0;for(b=0;e.charCodeAt(b)===m.charCodeAt(b)&&b<h;)b++;c=e.length-1;for(k=m.length-e.length;e.charCodeAt(c)===m.charCodeAt(c+k)&&c+k>=h+a.data.length;)c--;c++;e=m.substring(b,c+k);this._modifyContent({text:e,start:b+d,end:c+d,_ignoreDOMSelection:!0},!0)}}else this._doContent(a.data);a.preventDefault()}},_handleTouchStart:function(a){this._commitIME();var c=this._getWindow();this._touchScrollTimer&&(this._vScrollDiv.style.display="none",this._hScrollDiv.style.display="none",c.clearInterval(this._touchScrollTimer),
-this._touchScrollTimer=null);var b=a.touches;if(1===b.length){var b=b[0],d=b.clientX,k=b.clientY;this._touchStartX=d;this._touchStartY=k;if(e.isAndroid&&(k<b.pageY-c.pageYOffset||d<b.pageX-c.pageXOffset))d=b.pageX-c.pageXOffset,k=b.pageY-c.pageYOffset;c=this.convert({x:d,y:k},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(c.x,c.y);this._touchStartTime=a.timeStamp;this._touching=!0}},_handleTouchMove:function(a){var c=a.touches;if(1===c.length){c=c[0];this._touchCurrentX=c.clientX;
-this._touchCurrentY=c.clientY;if(!this._touchScrollTimer&&200>a.timeStamp-this._touchStartTime){this._vScrollDiv.style.display="block";this._wrapMode||(this._hScrollDiv.style.display="block");var b=this,d=this._getWindow();this._touchScrollTimer=d.setInterval(function(){var a=0,c=0;if(b._touching)a=b._touchStartX-b._touchCurrentX,c=b._touchStartY-b._touchCurrentY,b._touchSpeedX=a/10,b._touchSpeedY=c/10,b._touchStartX=b._touchCurrentX,b._touchStartY=b._touchCurrentY;else{if(0.1>Math.abs(b._touchSpeedX)&&
-0.1>Math.abs(b._touchSpeedY)){b._vScrollDiv.style.display="none";b._hScrollDiv.style.display="none";d.clearInterval(b._touchScrollTimer);b._touchScrollTimer=null;return}a=10*b._touchSpeedX;c=10*b._touchSpeedY;b._touchSpeedX*=0.95;b._touchSpeedY*=0.95}b._scrollView(a,c)},10)}this._touchScrollTimer&&a.preventDefault()}},_handleTouchEnd:function(a){0===a.touches.length&&(this._touching=!1)},_doAction:function(a){var c,b,d=this._keyModes;for(b=d.length-1;0<=b;b--)if(c=d[b],"function"===typeof c.match&&
-(c=c.match(a),void 0!==c))return this.invokeAction(c);return!1},_doMove:function(a,c){var b=this._model,d=c.getCaret(),k=b.getLineAtOffset(d);a.count||(a.count=1);for(;0!==a.count;){var e=b.getLineStart(k);if(0>a.count&&d===e)if(0<k)"character"===a.unit&&a.count++,k--,c.extend(b.getLineEnd(k));else break;else if(0<a.count&&d===b.getLineEnd(k))if(k+1<b.getLineCount())"character"===a.unit&&a.count--,k++,c.extend(b.getLineStart(k));else break;else{var m=!1;a.expandTab&&("character"===a.unit&&0===(d-
-e)%this._tabSize)&&(e=b.getText(e,d),m=!/[^ ]/.test(e));m?(c.extend(d-this._tabSize),a.count+=0>a.count?1:-1):(e=this._getLine(k),c.extend(e.getNextOffset(d,a)),e.destroy())}d=c.getCaret()}return c},_doBackspace:function(a){var c=this._getSelection();c.isEmpty()&&(a.count||(a.count=1),a.count*=-1,a.expandTab=this._expandTab,this._doMove(a,c));this._modifyContent({text:"",start:c.start,end:c.end},!0);return!0},_doCase:function(a){var c=this._getSelection();this._doMove(a,c);var b=this.getText(c.start,
-c.end);this._setSelection(c,!0);switch(a.type){case "lower":b=b.toLowerCase();break;case "capitalize":b=b.replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()});break;case "reverse":a="";for(c=0;c<b.length;c++)var d=b[c],k=d.toLowerCase(),d=k!==d?k:d.toUpperCase(),a=a+d;b=a;break;default:b=b.toUpperCase()}this._doContent(b);return!0},_doContent:function(a){var c=this._getSelection();if(this._overwriteMode&&c.isEmpty()){var b=this._model,d=b.getLineAtOffset(c.end);c.end<b.getLineEnd(d)&&(b=this._getLine(d),
-c.extend(b.getNextOffset(c.getCaret(),{unit:"character",count:1})),b.destroy())}this._modifyContent({text:a,start:c.start,end:c.end,_ignoreDOMSelection:!0},!0)},_doCopy:function(a){var c=this._getSelection();return!c.isEmpty()?(c=this._getBaseText(c.start,c.end),this._setClipboardText(c,a)):!0},_doCursorNext:function(a){var c=this._getSelection();!c.isEmpty()&&!a.select?c.start=c.end:this._doMove(a,c);a.select||c.collapse();this._setSelection(c,!0);return!0},_doCursorPrevious:function(a){var c=this._getSelection();
-!c.isEmpty()&&!a.select?c.end=c.start:(a.count||(a.count=1),a.count*=-1,this._doMove(a,c));a.select||c.collapse();this._setSelection(c,!0);return!0},_doCut:function(a){var c=this._getSelection();return!c.isEmpty()?(c=this._getBaseText(c.start,c.end),this._doContent(""),this._setClipboardText(c,a)):!0},_doDelete:function(a){var c=this._getSelection();c.isEmpty()&&this._doMove(a,c);this._modifyContent({text:"",start:c.start,end:c.end},!0);return!0},_doEnd:function(a){var c=this._getSelection(),b=this._model,
-d;if(a.ctrl)c.extend(b.getCharCount()),d=function(){};else{var k=c.getCaret(),e=b.getLineAtOffset(k);if(this._wrapMode){var m=this._getLine(e),k=m.getLineIndex(k),k=k===m.getLineCount()-1?b.getLineEnd(e):m.getLineStart(k+1)-1;m.destroy()}else a.count&&0<a.count&&(e=Math.min(e+a.count-1,b.getLineCount()-1)),k=b.getLineEnd(e);c.extend(k)}a.select||c.collapse();this._setSelection(c,!0,!0,d);return!0},_doEnter:function(a){var c=this._model,b=this._getSelection();this._doContent(c.getLineDelimiter());
-a&&a.noCursor&&(b.end=b.start,this._setSelection(b,!0));return!0},_doHome:function(a){var c=this._getSelection(),b=this._model,d;if(a.ctrl)c.extend(0),d=function(){};else{var k=c.getCaret(),e=b.getLineAtOffset(k);this._wrapMode?(b=this._getLine(e),k=b.getLineIndex(k),k=b.getLineStart(k),b.destroy()):k=b.getLineStart(e);c.extend(k)}a.select||c.collapse();this._setSelection(c,!0,!0,d);return!0},_doLineDown:function(a){var c=this._model,b=this._getSelection(),d=b.getCaret(),k=c.getLineAtOffset(d),m=
-this._getLine(k),h=this._columnX,f=1,r=!1;if(-1===h||a.wholeLine||a.select&&e.isIE)h=a.wholeLine?c.getLineEnd(k+1):d,h=m.getBoundingClientRect(h).left;(d=m.getLineIndex(d))<m.getLineCount()-1?f=m.getClientRects(d+1).top+1:(d=c.getLineCount()-1,r=k===d,a.count&&0<a.count?k=Math.min(k+a.count,d):k++);d=!1;if(r){if(a.select||e.isMac||e.isLinux)b.extend(c.getCharCount()),d=!0}else m.lineIndex!==k&&(m.destroy(),m=this._getLine(k)),b.extend(m.getOffset(h,f)),d=!0;d&&(a.select||b.collapse(),this._setSelection(b,
-!0,!0));this._columnX=h;m.destroy();return!0},_doLineUp:function(a){var c=this._model,b=this._getSelection(),d=b.getCaret(),k=c.getLineAtOffset(d),m=this._getLine(k),h=this._columnX,f=!1,r;if(-1===h||a.wholeLine||a.select&&e.isIE)h=a.wholeLine?c.getLineStart(k-1):d,h=m.getBoundingClientRect(h).left;0<(d=m.getLineIndex(d))?r=m.getClientRects(d-1).top+1:(f=0===k,f||(a.count&&0<a.count?k=Math.max(k-a.count,0):k--,r=this._getLineHeight(k)-1));d=!1;if(f){if(a.select||e.isMac||e.isLinux)b.extend(0),d=!0}else m.lineIndex!==
-k&&(m.destroy(),m=this._getLine(k)),b.extend(m.getOffset(h,r)),d=!0;d&&(a.select||b.collapse(),this._setSelection(b,!0,!0));this._columnX=h;m.destroy();return!0},_doNoop:function(){return!0},_doPageDown:function(a){var c=this,b=this._model,d=this._getSelection(),k=d.getCaret(),m=b.getLineAtOffset(k),h=b.getLineCount(),f=this._getScroll(),b=this._getClientHeight(),r,g;if(this._lineHeight){r=this._columnX;f=this._getBoundsAtOffset(k);if(-1===r||a.select&&e.isIE)r=f.left;k=this._getLineIndex(f.top+b);
-g=this._getLine(k);m=this._getLinePixel(k);k=g.getOffset(r,f.top+b-m);b=g.getBoundingClientRect(k);g.destroy();d.extend(k);a.select||d.collapse();this._setSelection(d,!0,!0,function(){c._columnX=r},b.top+m-f.top);return!0}if(m<h-1){var l=this._getLineHeight(),s=Math.min(h-m-1,Math.floor(b/l)),s=Math.max(1,s);r=this._columnX;if(-1===r||a.select&&e.isIE)g=this._getLine(m),r=g.getBoundingClientRect(k).left,g.destroy();g=this._getLine(m+s);d.extend(g.getOffset(r,0));g.destroy();a.select||d.collapse();
-a=h*l;k=f.y+s*l;k+b>a&&(k=a-b);this._setSelection(d,!0,!0,function(){c._columnX=r},k-f.y)}return!0},_doPageUp:function(a){var c=this,b=this._model,d=this._getSelection(),k=d.getCaret(),m=b.getLineAtOffset(k),h=this._getScroll(),f=this._getClientHeight(),r;if(this._lineHeight){r=this._columnX;h=this._getBoundsAtOffset(k);if(-1===r||a.select&&e.isIE)r=h.left;k=this._getLineIndex(h.bottom-f);b=this._getLine(k);m=this._getLinePixel(k);k=b.getOffset(r,h.bottom-f-m);f=b.getBoundingClientRect(k);b.destroy();
-d.extend(k);a.select||d.collapse();this._setSelection(d,!0,!0,function(){c._columnX=r},f.top+m-h.top);return!0}if(0<m){var g=this._getLineHeight(),f=Math.max(1,Math.min(m,Math.floor(f/g)));r=this._columnX;if(-1===r||a.select&&e.isIE)b=this._getLine(m),r=b.getBoundingClientRect(k).left,b.destroy();b=this._getLine(m-f);d.extend(b.getOffset(r,this._getLineHeight(m-f)-1));b.destroy();a.select||d.collapse();a=Math.max(0,h.y-f*g);this._setSelection(d,!0,!0,function(){c._columnX=r},a-h.y)}return!0},_doPaste:function(a){var c=
-this;return null!==this._getClipboardText(a,function(a){a&&(e.isLinux&&2===c._lastMouseButton&&(new Date).getTime()-c._lastMouseTime<=c._clickTime&&c._setSelectionTo(c._lastMouseX,c._lastMouseY),c._doContent(a))})},_doScroll:function(a){var c=a.type,b=this._model,d=b.getLineCount(),a=this._getClientHeight(),k=this._getLineHeight(),d=d*k,e=this._getScroll().y,m;switch(c){case "textStart":m=0;break;case "textEnd":m=d-a;break;case "pageDown":m=e+a;break;case "pageUp":m=e-a;break;case "lineDown":m=e+
-k;break;case "lineUp":m=e-k;break;case "centerLine":c=this._getSelection(),m=b.getLineAtOffset(c.start),b=(b.getLineAtOffset(c.end)-m+1)*k,m=m*k-a/2+b/2}void 0!==m&&(m=Math.min(Math.max(0,m),d-a),this._scrollViewAnimated(0,m-e,function(){}));return!0},_doSelectAll:function(){var a=this._model,c=this._getSelection();c.setCaret(0);c.extend(a.getCharCount());this._setSelection(c,!1);return!0},_doTab:function(){if(this._tabMode&&!this._readonly){var a="\t";if(this._expandTab)var c=this._model,a=this._getSelection().getCaret(),
-b=c.getLineAtOffset(a),c=c.getLineStart(b),a=Array(this._tabSize-(a-c)%this._tabSize+1).join(" ");this._doContent(a);return!0}},_doShiftTab:function(){if(this._tabMode&&!this._readonly)return!0},_doOverwriteMode:function(){if(!this._readonly)return this.setOptions({overwriteMode:!this.getOptions("overwriteMode")}),!0},_doTabMode:function(){this._tabMode=!this._tabMode;return!0},_doWrapMode:function(){this.setOptions({wrapMode:!this.getOptions("wrapMode")});return!0},_autoScroll:function(){var a=this._model,
-c=this._getSelection(),b=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),d=c.getCaret(),k=a.getLineCount(),m=a.getLineAtOffset(d),h;if("up"===this._autoScrollDir||"down"===this._autoScrollDir)d=this._autoScrollY/this._getLineHeight(),d=0>d?Math.floor(d):Math.ceil(d),h=Math.max(0,Math.min(k-1,m+d));else if("left"===this._autoScrollDir||"right"===this._autoScrollDir)h=this._getLineIndex(b.y),m=this._getLine(m),b.x+=m.getBoundingClientRect(d,!1).left,m.destroy();0===h&&(e.isMac||
-e.isLinux)?c.extend(0):h===k-1&&(e.isMac||e.isLinux)?c.extend(a.getCharCount()):(m=this._getLine(h),c.extend(m.getOffset(b.x,b.y-this._getLinePixel(h))),m.destroy());this._setSelection(c,!0)},_autoScrollTimer:function(){this._autoScroll();var a=this;this._autoScrollTimerID=this._getWindow().setTimeout(function(){a._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeightTimer:function(a){if(this._lineHeight&&!this._calculateLHTimer){var c=this._model.getLineCount(),b=0;if(a){for(var a=0,d=
-(new Date).getTime(),k=0;b<c&&!(this._lineHeight[b]||(a++,k||(k=b),this._lineHeight[b]=this._calculateLineHeight(b)),b++,100<(new Date).getTime()-d););this.redrawRulers(0,c);this._queueUpdate()}a=this._getWindow();if(b!==c){var e=this;this._calculateLHTimer=a.setTimeout(function(){e._calculateLHTimer=null;e._calculateLineHeightTimer(!0)},0)}else this._calculateLHTimer&&(a.clearTimeout(this._calculateLHTimer),this._calculateLHTimer=void 0)}},_calculateLineHeight:function(a){var a=this._getLine(a),
-c=a.getBoundingClientRect();a.destroy();return Math.max(1,c.bottom-c.top)},_calculateMetrics:function(){var a=this._clientDiv,c=a.ownerDocument,b=e.createElement(c,"div");b.style.lineHeight="normal";var k={type:"LineStyle",textView:this,"0":0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(k);d(k.style,b);b.style.position="fixed";b.style.left="-1000px";var h=e.createElement(c,"span");h.appendChild(c.createTextNode(" "));b.appendChild(h);var f=e.createElement(c,"span");f.style.fontStyle=
-"italic";f.appendChild(c.createTextNode(" "));b.appendChild(f);var g=e.createElement(c,"span");g.style.fontWeight="bold";g.appendChild(c.createTextNode(" "));b.appendChild(g);k=e.createElement(c,"span");k.style.fontWeight="bold";k.style.fontStyle="italic";k.appendChild(c.createTextNode(" "));b.appendChild(k);a.appendChild(b);var l=b.getBoundingClientRect(),h=h.getBoundingClientRect(),f=f.getBoundingClientRect(),g=g.getBoundingClientRect(),k=k.getBoundingClientRect(),h=h.bottom-h.top,f=f.bottom-f.top,
-g=g.bottom-g.top,s=k.bottom-k.top,t=0,k=0>=l.bottom-l.top,l=Math.max(1,l.bottom-l.top);f>h&&(t=1);g>f&&(t=2);s>g&&(t=3);var u;0!==t&&(u={style:{}},0!==(t&1)&&(u.style.fontStyle="italic"),0!==(t&2)&&(u.style.fontWeight="bold"));h=r(b);a.removeChild(b);s=m(this._viewDiv);b=e.createElement(c,"div");b.style.position="fixed";b.style.left="-1000px";b.style.paddingLeft=s.left+"px";b.style.paddingTop=s.top+"px";b.style.paddingRight=s.right+"px";b.style.paddingBottom=s.bottom+"px";b.style.width="100px";b.style.height=
-"100px";s=e.createElement(c,"div");s.style.width="100%";s.style.height="100%";b.appendChild(s);a.appendChild(b);t=b.getBoundingClientRect();f=s.getBoundingClientRect();g=0;this._singleMode||(b.style.overflow="hidden",s.style.height="200px",g=b.clientWidth,b.style.overflow="scroll",g-=b.clientWidth);a.removeChild(b);s={left:f.left-t.left,top:f.top-t.top,right:t.right-f.right,bottom:t.bottom-f.bottom};f=t=0;if(!k&&(this._wrapOffset||this._marginOffset))b=e.createElement(c,"div"),b.style.position="fixed",
-b.style.left="-1000px",b.innerHTML=Array(this._wrapOffset+1).join(" "),a.appendChild(b),t=b.getBoundingClientRect(),t=Math.ceil(t.right-t.left),b.innerHTML=Array(this._marginOffset+1).join(" "),f=b.getBoundingClientRect(),f=Math.ceil(f.right-f.left),a.removeChild(b);return{lineHeight:l,largestFontStyle:u,lineTrim:h,viewPadding:s,scrollWidth:g,wrapWidth:t,marginWidth:f,invalid:k}},_cancelAnimation:function(){this._animation&&(this._animation.stop(),this._animation=null)},_clearSelection:function(a){var c=
-this._getSelection();if(c.isEmpty())return!1;"next"===a?c.start=c.end:c.end=c.start;this._setSelection(c,!0);return!0},_commitIME:function(){if(-1!==this._imeOffset){this._scrollDiv.focus();this._clientDiv.focus();var a=this._model,c=a.getLineAtOffset(this._imeOffset),b=a.getLineStart(c),d=this._getDOMText(this._getLineNode(c)).text,a=a.getLine(c),b=this._imeOffset-b,a=b+d.length-a.length;b!==a&&(d=d.substring(b,a),this._doContent(d));this._imeOffset=-1}},_createActions:function(){this.addKeyMode(new p.DefaultKeyMode(this));
-var a=this;this._actions={noop:{defaultHandler:function(){return a._doNoop()}},lineUp:{defaultHandler:function(b){return a._doLineUp(c(b,{select:!1}))},actionDescription:{name:g.lineUp}},lineDown:{defaultHandler:function(b){return a._doLineDown(c(b,{select:!1}))},actionDescription:{name:g.lineDown}},lineStart:{defaultHandler:function(b){return a._doHome(c(b,{select:!1,ctrl:!1}))},actionDescription:{name:g.lineStart}},lineEnd:{defaultHandler:function(b){return a._doEnd(c(b,{select:!1,ctrl:!1}))},actionDescription:{name:g.lineEnd}},
-charPrevious:{defaultHandler:function(b){return a._doCursorPrevious(c(b,{select:!1,unit:"character"}))},actionDescription:{name:g.charPrevious}},charNext:{defaultHandler:function(b){return a._doCursorNext(c(b,{select:!1,unit:"character"}))},actionDescription:{name:g.charNext}},pageUp:{defaultHandler:function(b){return a._doPageUp(c(b,{select:!1}))},actionDescription:{name:g.pageUp}},pageDown:{defaultHandler:function(b){return a._doPageDown(c(b,{select:!1}))},actionDescription:{name:g.pageDown}},scrollPageUp:{defaultHandler:function(b){return a._doScroll(c(b,
-{type:"pageUp"}))},actionDescription:{name:g.scrollPageUp}},scrollPageDown:{defaultHandler:function(b){return a._doScroll(c(b,{type:"pageDown"}))},actionDescription:{name:g.scrollPageDown}},scrollLineUp:{defaultHandler:function(b){return a._doScroll(c(b,{type:"lineUp"}))},actionDescription:{name:g.scrollLineUp}},scrollLineDown:{defaultHandler:function(b){return a._doScroll(c(b,{type:"lineDown"}))},actionDescription:{name:g.scrollLineDown}},wordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(c(b,
-{select:!1,unit:"word"}))},actionDescription:{name:g.wordPrevious}},wordNext:{defaultHandler:function(b){return a._doCursorNext(c(b,{select:!1,unit:"word"}))},actionDescription:{name:g.wordNext}},textStart:{defaultHandler:function(b){return a._doHome(c(b,{select:!1,ctrl:!0}))},actionDescription:{name:g.textStart}},textEnd:{defaultHandler:function(b){return a._doEnd(c(b,{select:!1,ctrl:!0}))},actionDescription:{name:g.textEnd}},scrollTextStart:{defaultHandler:function(b){return a._doScroll(c(b,{type:"textStart"}))},
-actionDescription:{name:g.scrollTextStart}},scrollTextEnd:{defaultHandler:function(b){return a._doScroll(c(b,{type:"textEnd"}))},actionDescription:{name:g.scrollTextEnd}},centerLine:{defaultHandler:function(b){return a._doScroll(c(b,{type:"centerLine"}))},actionDescription:{name:g.centerLine}},selectLineUp:{defaultHandler:function(b){return a._doLineUp(c(b,{select:!0}))},actionDescription:{name:g.selectLineUp}},selectLineDown:{defaultHandler:function(b){return a._doLineDown(c(b,{select:!0}))},actionDescription:{name:g.selectLineDown}},
-selectWholeLineUp:{defaultHandler:function(b){return a._doLineUp(c(b,{select:!0,wholeLine:!0}))},actionDescription:{name:g.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(b){return a._doLineDown(c(b,{select:!0,wholeLine:!0}))},actionDescription:{name:g.selectWholeLineDown}},selectLineStart:{defaultHandler:function(b){return a._doHome(c(b,{select:!0,ctrl:!1}))},actionDescription:{name:g.selectLineStart}},selectLineEnd:{defaultHandler:function(b){return a._doEnd(c(b,{select:!0,ctrl:!1}))},
-actionDescription:{name:g.selectLineEnd}},selectCharPrevious:{defaultHandler:function(b){return a._doCursorPrevious(c(b,{select:!0,unit:"character"}))},actionDescription:{name:g.selectCharPrevious}},selectCharNext:{defaultHandler:function(b){return a._doCursorNext(c(b,{select:!0,unit:"character"}))},actionDescription:{name:g.selectCharNext}},selectPageUp:{defaultHandler:function(b){return a._doPageUp(c(b,{select:!0}))},actionDescription:{name:g.selectPageUp}},selectPageDown:{defaultHandler:function(b){return a._doPageDown(c(b,
-{select:!0}))},actionDescription:{name:g.selectPageDown}},selectWordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(c(b,{select:!0,unit:"word"}))},actionDescription:{name:g.selectWordPrevious}},selectWordNext:{defaultHandler:function(b){return a._doCursorNext(c(b,{select:!0,unit:"word"}))},actionDescription:{name:g.selectWordNext}},selectTextStart:{defaultHandler:function(b){return a._doHome(c(b,{select:!0,ctrl:!0}))},actionDescription:{name:g.selectTextStart}},selectTextEnd:{defaultHandler:function(b){return a._doEnd(c(b,
-{select:!0,ctrl:!0}))},actionDescription:{name:g.selectTextEnd}},deletePrevious:{defaultHandler:function(b){return a._doBackspace(c(b,{unit:"character"}))},actionDescription:{name:g.deletePrevious}},deleteNext:{defaultHandler:function(b){return a._doDelete(c(b,{unit:"character"}))},actionDescription:{name:g.deleteNext}},deleteWordPrevious:{defaultHandler:function(b){return a._doBackspace(c(b,{unit:"word"}))},actionDescription:{name:g.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(b){return a._doDelete(c(b,
-{unit:"word"}))},actionDescription:{name:g.deleteWordNext}},deleteLineStart:{defaultHandler:function(b){return a._doBackspace(c(b,{unit:"line"}))},actionDescription:{name:g.deleteLineStart}},deleteLineEnd:{defaultHandler:function(b){return a._doDelete(c(b,{unit:"line"}))},actionDescription:{name:g.deleteLineEnd}},tab:{defaultHandler:function(){return a._doTab()},actionDescription:{name:g.tab}},shiftTab:{defaultHandler:function(){return a._doShiftTab()},actionDescription:{name:g.shiftTab}},enter:{defaultHandler:function(){return a._doEnter()},
-actionDescription:{name:g.enter}},enterNoCursor:{defaultHandler:function(b){return a._doEnter(c(b,{noCursor:!0}))},actionDescription:{name:g.enterNoCursor}},selectAll:{defaultHandler:function(){return a._doSelectAll()},actionDescription:{name:g.selectAll}},copy:{defaultHandler:function(){return a._doCopy()},actionDescription:{name:g.copy}},cut:{defaultHandler:function(){return a._doCut()},actionDescription:{name:g.cut}},paste:{defaultHandler:function(){return a._doPaste()},actionDescription:{name:g.paste}},
-uppercase:{defaultHandler:function(b){return a._doCase(c(b,{type:"upper"}))},actionDescription:{name:g.uppercase}},lowercase:{defaultHandler:function(b){return a._doCase(c(b,{type:"lower"}))},actionDescription:{name:g.lowercase}},capitalize:{defaultHandler:function(b){return a._doCase(c(b,{unit:"word",type:"capitalize"}))},actionDescription:{name:g.capitalize}},reversecase:{defaultHandler:function(b){return a._doCase(c(b,{type:"reverse"}))},actionDescription:{name:g.reversecase}},toggleOverwriteMode:{defaultHandler:function(){return a._doOverwriteMode()},
-actionDescription:{name:g.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(){return a._doTabMode()},actionDescription:{name:g.toggleTabMode}},toggleWrapMode:{defaultHandler:function(){return a._doWrapMode()},actionDescription:{name:g.toggleWrapMode}}}},_createRulerParent:function(a){var c=e.createElement(document,"div");c.className=a;c.tabIndex=-1;c.style.overflow="hidden";c.style.MozUserSelect="none";c.style.WebkitUserSelect="none";c.style.position="absolute";c.style.top="0px";c.style.bottom=
-"0px";c.style.cursor="default";c.style.display="none";c.setAttribute("aria-hidden","true");this._rootDiv.appendChild(c);return c},_createRuler:function(a,c){if(this._clientDiv){var b=this._getRulerParent(a);if(b){if(b!==this._marginDiv||this._marginOffset)b.style.display="block";var d=e.createElement(b.ownerDocument,"div");d._ruler=a;d.rulerChanged=!0;d.style.position="relative";d.style.cssFloat="left";d.style.styleFloat="left";d.style.outline="none";if(void 0===c||0>c||c>=b.children.length)b.appendChild(d);
-else{for(var k=b.firstChild;k&&0<c--;)k=k.nextSibling;b.insertBefore(d,k)}}}},_createView:function(){if(!this._clientDiv){for(var a=this._parent;a.hasChildNodes();)a.removeChild(a.lastChild);var c=a.ownerDocument,b=e.createElement(c,"div");this._rootDiv=b;b.tabIndex=-1;b.style.position="relative";b.style.overflow="hidden";b.style.width="100%";b.style.height="100%";b.style.overflow="hidden";b.style.WebkitTextSizeAdjust="100%";b.setAttribute("role","application");a.appendChild(b);this._leftDiv=this._createRulerParent("textviewLeftRuler");
-a=e.createElement(c,"div");a.className="textviewScroll";this._viewDiv=a;a.tabIndex=-1;a.style.position="absolute";a.style.top="0px";a.style.bottom="0px";a.style.borderWidth="0px";a.style.margin="0px";a.style.outline="none";a.style.background="transparent";e.isMac&&e.isWebkit&&(a.style.pointerEvents="none",a.style.zIndex="2");b.appendChild(a);var d=this._createRulerParent("textviewRightRuler");this._rightDiv=d;d.style.right="0px";this._scrollDiv=d=e.createElement(c,"div");d.style.margin="0px";d.style.borderWidth=
-"0px";d.style.padding="0px";a.appendChild(d);(this._marginDiv=this._createRulerParent("textviewMarginRuler")).style.zIndex="4";!e.isIE&&!e.isIOS&&(this._clipDiv=a=e.createElement(c,"div"),a.style.position="absolute",a.style.overflow="hidden",a.style.margin="0px",a.style.borderWidth="0px",a.style.padding="0px",a.style.background="transparent",b.appendChild(a),this._clipScrollDiv=d=e.createElement(c,"div"),d.style.position="absolute",d.style.height="1px",d.style.top="-1000px",d.style.background="transparent",
-a.appendChild(d));this._setFullSelection(this._fullSelection,!0);a=e.createElement(c,"div");a.className="textviewContent";this._clientDiv=a;a.tabIndex=0;a.style.position="absolute";a.style.borderWidth="0px";a.style.margin="0px";a.style.padding="0px";a.style.outline="none";a.style.zIndex="1";a.style.WebkitUserSelect="text";a.setAttribute("spellcheck","false");if(e.isIOS||e.isAndroid)a.style.WebkitTapHighlightColor="transparent";(this._clipDiv||b).appendChild(a);if(e.isIOS||e.isAndroid)this._vScrollDiv=
-d=e.createElement(c,"div"),d.style.position="absolute",d.style.borderWidth="1px",d.style.borderColor="white",d.style.borderStyle="solid",d.style.borderRadius="4px",d.style.backgroundColor="black",d.style.opacity="0.5",d.style.margin="0px",d.style.padding="0px",d.style.outline="none",d.style.zIndex="3",d.style.width="8px",d.style.display="none",b.appendChild(d),this._hScrollDiv=d=e.createElement(c,"div"),d.style.position="absolute",d.style.borderWidth="1px",d.style.borderColor="white",d.style.borderStyle=
-"solid",d.style.borderRadius="4px",d.style.backgroundColor="black",d.style.opacity="0.5",d.style.margin="0px",d.style.padding="0px",d.style.outline="none",d.style.zIndex="3",d.style.height="8px",d.style.display="none",b.appendChild(d);e.isFirefox&&!a.setCapture&&(this._overlayDiv=c=e.createElement(c,"div"),c.style.position=a.style.position,c.style.borderWidth=a.style.borderWidth,c.style.margin=a.style.margin,c.style.padding=a.style.padding,c.style.cursor="text",c.style.zIndex="2",(this._clipDiv||
-b).appendChild(c));a.contentEditable="true";a.setAttribute("role","textbox");a.setAttribute("aria-multiline","true");this._setWrapMode(this._wrapMode,!0);this._setReadOnly(this._readonly);this._setThemeClass(this._themeClass,!0);this._setTabSize(this._tabSize,!0);this._setMarginOffset(this._marginOffset,!0);this._hookEvents();b=this._rulers;for(c=0;c<b.length;c++)this._createRuler(b[c]);this._update()}},_defaultOptions:function(){return{parent:{value:void 0,update:null},model:{value:void 0,update:this.setModel},
+e.comment,!1);d("keyword.other.documentation.markup",e.comment,!1);return h.join("\n")},_createStyle:function(a,e,d,h){var c=this._document,a="orion-theme-"+a,b=c.getElementById(a);if(b){if(h||b.firstChild.data===e)return;b.removeChild(b.firstChild);b.appendChild(c.createTextNode(e))}else h?(b=p.createElement(c,"link"),b.rel="stylesheet",b.type="text/css",b.href=e,b.addEventListener("load",function(){d()})):(b=p.createElement(c,"style"),b.appendChild(c.createTextNode(e))),b.id=a,(c.getElementsByTagName("head")[0]||
+c.documentElement).appendChild(b);h||d()},_load:function(a,e,d){if(a)if("string"===typeof e)this._createStyle(a,e,d);else if(e=e.href,".css"!==e.substring(e.length-4)&&(e+=".css"),/^\//.test(e)||/[a-zA-Z0-9]+:\/\//i.test(e)||!g.toUrl)this._createStyle(a,e,d,!0);else{var h=this;g(["text!"+e],function(c){h._createStyle(a,c,d,!1)})}else d()}};n.EventTarget.addMixin(a.prototype);return{TextTheme:a}});
+define("orion/editor/util",[],function(){return{contains:function(g,n){if(!n)return!1;if(!g.compareDocumentPosition){for(var p=n;p;){if(g===p)return!0;p=p.parentNode}return!1}return g===n||0!==(g.compareDocumentPosition(n)&16)},addEventListener:function(g,n,p,a){"function"===typeof g.addEventListener?g.addEventListener(n,p,!0===a):g.attachEvent("on"+n,p)},removeEventListener:function(g,n,p,a){"function"===typeof g.removeEventListener?g.removeEventListener(n,p,!0===a):g.detachEvent("on"+n,p)}}});
+define("orion/editor/textView","i18n!orion/editor/nls/messages orion/editor/textModel orion/editor/keyModes orion/editor/eventTarget orion/editor/textTheme orion/editor/util orion/util".split(" "),function(g,n,p,a,l,f,e){function d(b,a,c){if(c){a.className="";for(var c=a.attributes,d=c.length;0<d--;)(!e.isIE||9<=e.isIE||9>e.isIE&&c[d].specified)&&a.removeAttribute(c[d].name)}if(b){b.styleClass&&(a.className=b.styleClass);if(c=b.style)for(var k in c)c.hasOwnProperty(k)&&(a.style[k]=c[k]);if(b=b.attributes)for(var m in b)b.hasOwnProperty(m)&&
+a.setAttribute(m,b[m])}}function h(b){return b instanceof Array?b.slice(0):b}function c(b,a){if(!b)return a;if(!a)return b;for(var c in a)a.hasOwnProperty(c)&&(b.hasOwnProperty(c)||(b[c]=a[c]));return b}function b(q,a){if(q===a)return!0;if(q&&!a||!q&&a||q&&q.constructor===String||a&&a.constructor===String)return!1;if(q instanceof Array||a instanceof Array){if(!(q instanceof Array&&a instanceof Array)||q.length!==a.length)return!1;for(var c=0;c<q.length;c++)if(!b(q[c],a[c]))return!1;return!0}if(!(q instanceof
+Object)||!(a instanceof Object))return!1;for(c in q)if(q.hasOwnProperty(c)&&(!a.hasOwnProperty(c)||!b(q[c],a[c])))return!1;for(c in a)if(!q.hasOwnProperty(c))return!1;return!0}function k(b,a,c){for(var d=0,k=0,e=0,m=b.length;e<m;){-1!==d&&d<=e&&(d=b.indexOf("\r",e));-1!==k&&k<=e&&(k=b.indexOf("\n",e));var h=e,f;if(-1===k&&-1===d){a(b.substring(e));break}-1!==d&&-1!==k?d+1===k?(f=d,e=k+1):(f=d<k?d:k,e=(d<k?d:k)+1):-1!==d?(f=d,e=d+1):(f=k,e=k+1);a(b.substring(h,f));c()}}function m(b){var a,c,d,k,e=
+b.ownerDocument.defaultView||b.ownerDocument.parentWindow;e.getComputedStyle?(b=e.getComputedStyle(b,null),a=b.getPropertyValue("padding-left"),c=b.getPropertyValue("padding-top"),d=b.getPropertyValue("padding-right"),k=b.getPropertyValue("padding-bottom")):b.currentStyle&&(a=b.currentStyle.paddingLeft,c=b.currentStyle.paddingTop,d=b.currentStyle.paddingRight,k=b.currentStyle.paddingBottom);return{left:parseInt(a,10)||0,top:parseInt(c,10)||0,right:parseInt(d,10)||0,bottom:parseInt(k,10)||0}}function r(b){var a,
+c,d,k,e=b._trim;if(!e){var e=m(b),h=b.ownerDocument.defaultView||b.ownerDocument.parentWindow;h.getComputedStyle?(k=h.getComputedStyle(b,null),a=k.getPropertyValue("border-left-width"),c=k.getPropertyValue("border-top-width"),d=k.getPropertyValue("border-right-width"),k=k.getPropertyValue("border-bottom-width")):b.currentStyle&&(a=b.currentStyle.borderLeftWidth,c=b.currentStyle.borderTopWidth,d=b.currentStyle.borderRightWidth,k=b.currentStyle.borderBottomWidth);a=parseInt(a,10)||0;c=parseInt(c,10)||
+0;d=parseInt(d,10)||0;k=parseInt(k,10)||0;e.left+=a;e.top+=c;e.right+=d;e.bottom+=k;b._trim=e}return e}function x(b,a,c){this.start=b;this.end=a;this.caret=c}function u(b){this.left=b.left;this.top=b.top;this.right=b.right;this.bottom=b.bottom}function t(b,a,c){this.view=b;this.lineIndex=a;this._lineDiv=c}function y(b){this._init(b||{})}var s=f.addEventListener,v=f.removeEventListener,z=function(b){this.options=b};z.prototype.play=function(){var b="number"===typeof this.options.duration?this.options.duration:
+350,a=this.options.easing||this.defaultEasing,c=this.options.onAnimate||function(){},d=this.options.curve[0],k=this.options.curve[1],e=k-d,m=-1,h,f=this;this.interval=this.options.window.setInterval(function(){m=-1===m?(new Date).getTime():m;var r=((new Date).getTime()-m)/b;1>r?(r=a(r),h=d+r*e,c(h)):(c(k),f.stop())},"number"===typeof this.options.rate?this.options.rate:20)};z.prototype.stop=function(){this.options.window.clearInterval(this.interval);(this.options.onEnd||function(){})()};z.prototype.defaultEasing=
+function(b){return Math.sin(b*(Math.PI/2))};x.prototype={clone:function(){return new x(this.start,this.end,this.caret)},collapse:function(){this.caret?this.end=this.start:this.start=this.end},extend:function(b){this.caret?this.start=b:this.end=b;this.start>this.end&&(b=this.start,this.start=this.end,this.end=b,this.caret=!this.caret)},setCaret:function(b){this.end=this.start=b;this.caret=!1},getCaret:function(){return this.caret?this.start:this.end},toString:function(){return"start="+this.start+" end="+
+this.end+(this.caret?" caret is at start":" caret is at end")},isEmpty:function(){return this.start===this.end},equals:function(b){return this.caret===b.caret&&this.start===b.start&&this.end===b.end}};u.prototype={toString:function(){return"{l="+this.left+", t="+this.top+", r="+this.right+", b="+this.bottom+"}"}};t.prototype={create:function(b,a){if(!this._lineDiv){var c=this._lineDiv=this._createLine(b,a,this.lineIndex);c._line=this;return c}},_createLine:function(q,a,c){var k=this.view,m=k._model,
+h=m.getLine(c),f=m.getLineStart(c),r={type:"LineStyle",textView:k,lineIndex:c,lineText:h,lineStart:f};if(2E3>h.length)k.onLineStyle(r);m=a||e.createElement(q.ownerDocument,"div");if(!a||!b(a.viewStyle,r.style))d(r.style,m,a),a&&(a._trim=null),m.viewStyle=r.style,m.setAttribute("role","presentation");m.lineIndex=c;c=[];this._createRanges(r.ranges,h,0,h.length,f,{tabOffset:0,ranges:c});h=" ";!k._fullSelection&&9>e.isIE&&(h="\ufeff");r={text:h,style:k._metrics.largestFontStyle,ignoreChars:1};0===c.length||
+!c[c.length-1].style||"div"!==c[c.length-1].style.tagName?c.push(r):c.splice(c.length-1,0,r);var g,l,s,t,v,h=k=0,x,u;if(a){if(l=a.modelChangedEvent)0===l.removedLineCount&&0===l.addedLineCount?(u=l.start-f,x=l.addedCharCount-l.removedCharCount):u=-1,a.modelChangedEvent=void 0;l=a.firstChild}for(f=0;f<c.length;f++){r=c[f];t=r.text;k+=t.length;g=r.style;if(l)if(v=l.firstChild.data,s=l.viewStyle,v===t&&b(g,s)){h+=v.length;l._rectsCache=void 0;g=l=l.nextSibling;continue}else for(;l;){if(-1!==u){s=k;s>=
+u&&(s-=x);v=(v=l.firstChild.data)?v.length:0;if(h+v>s)break;h+=v}s=l.nextSibling;m.removeChild(l);l=s}g=this._createSpan(m,t,g,r.ignoreChars);l?m.insertBefore(g,l):m.appendChild(g);a&&(a.lineWidth=void 0)}if(a)for(q=g?g.nextSibling:null;q;)s=q.nextSibling,a.removeChild(q),q=s;else q.appendChild(m);return m},_createRanges:function(q,a,c,d,k,e){if(!(c>d)){if(q)for(var m=0;m<q.length;m++){var h=q[m];if(!(h.end<k+c)){var f=Math.max(k+c,h.start)-k;if(f>d)break;var r=Math.min(k+d,h.end)-k;if(f<=r){f=Math.max(c,
+f);r=Math.min(d,r);c<f&&this._createRange(a,c,f,null,e);if(!h.style||!h.style.unmergeable)for(;m+1<q.length&&q[m+1].start-k===r&&b(h.style,q[m+1].style);)h=q[m+1],r=Math.min(k+d,h.end)-k,m++;this._createRange(a,f,r,h.style,e);c=r}}}c<d&&this._createRange(a,c,d,null,e)}},_createRange:function(b,a,c,d,k){if(!(a>c)){var e=this.view._customTabSize;if(e&&8!==e)for(var m=b.indexOf("\t",a);-1!==m&&m<c;){a<m&&(a={text:b.substring(a,m),style:d},k.ranges.push(a),k.tabOffset+=a.text.length);a=e-k.tabOffset%
+e;if(0<a){for(var h="\u00a0",f=1;f<a;f++)h+=" ";a={text:h,style:d,ignoreChars:a-1};k.ranges.push(a);k.tabOffset+=a.text.length}a=m+1;if(a===c)return;m=b.indexOf("\t",a)}a<=c&&(a={text:b.substring(a,c),style:d},k.ranges.push(a),k.tabOffset+=a.text.length)}},_createSpan:function(b,a,c,k){var m=this.view,h="span";c&&c.tagName&&(h=c.tagName.toLowerCase());var f="a"===h;f&&(b.hasLink=!0);f&&!m._linksVisible&&(h="span");f=b.ownerDocument;b=e.createElement(b.ownerDocument,h);c&&c.html?(b.innerHTML=c.html,
+b.ignore=!0):c&&c.node?(b.appendChild(c.node),b.ignore=!0):b.appendChild(f.createTextNode(c&&c.text?c.text:a));d(c,b);if("a"===h){var r=m._getWindow();s(b,"click",function(b){return m._handleLinkClick(b?b:r.event)},!1)}b.viewStyle=c;k&&(b.ignoreChars=k);return b},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(b,a){var c=this._ensureCreated(),d=this.view;if(void 0===b)return this._getLineBoundingClientRect(c,
+!0);var k=d._model,m=c.ownerDocument,h=this.lineIndex,f=null;if(b<k.getLineEnd(h)){h=k.getLineStart(h);for(k=c.firstChild;k;){if(!k.ignore){var r=k.firstChild,g=r.length;k.ignoreChars&&(g-=k.ignoreChars);if(h+g>b){f=b-h;if(1===r.length)f=new u(k.getBoundingClientRect());else if(d._isRangeRects)m=m.createRange(),m.setStart(r,f),m.setEnd(r,f+1),f=new u(m.getBoundingClientRect());else if(e.isIE)m=m.body.createTextRange(),m.moveToElementText(k),m.collapse(),(h=0===f&&8===e.isIE)&&(f=1),m.moveEnd("character",
+f+1),m.moveStart("character",f),f=new u(m.getBoundingClientRect()),h&&(f.left=k.getClientRects()[0].left);else{var l=r.data;k.removeChild(r);k.appendChild(m.createTextNode(l.substring(0,f)));var s=e.createElement(m,"span");s.appendChild(m.createTextNode(l.substring(f,f+1)));k.appendChild(s);k.appendChild(m.createTextNode(l.substring(f+1)));f=new u(s.getBoundingClientRect());k.innerHTML="";k.appendChild(r);this._createdDiv||(m=d._getSelection(),(h<=m.start&&m.start<h+g||h<=m.end&&m.end<h+g)&&d._updateDOMSelection())}e.isIE&&
+(m=c.ownerDocument.defaultView||c.ownerDocument.parentWindow,c=m.screen.logicalXDPI/m.screen.deviceXDPI,m=m.screen.logicalYDPI/m.screen.deviceYDPI,f.left*=c,f.right*=c,f.top*=m,f.bottom*=m);break}h+=g}k=k.nextSibling}}c=this.getBoundingClientRect();f||(d._wrapMode?(d=this.getClientRects(),f=d[d.length-1],f.left=f.right,f.left+=c.left,f.top+=c.top,f.right+=c.left,f.bottom+=c.top):(f=new u(c),f.left=f.right));if(a||void 0===a)f.left-=c.left,f.top-=c.top,f.right-=c.left,f.bottom-=c.top;return f},_getClientRects:function(b,
+a){var c,d,k,e;if(!b._rectsCache){c=b.getClientRects();d=Array(c.length);for(e=0;e<c.length;e++)k=d[e]=new u(c[e]),k.left-=a.left,k.top-=a.top,k.right-=a.left,k.bottom-=a.top;b._rectsCache=d}c=b._rectsCache;d=[c.length];for(e=0;e<c.length;e++)d[e]=new u(c[e]);return d},getClientRects:function(b){if(!this.view._wrapMode)return[this.getBoundingClientRect()];for(var a=this._ensureCreated(),c=[],d=a.firstChild,k,e=a.getBoundingClientRect();d;){if(!d.ignore)for(var m=this._getClientRects(d,e),a=0;a<m.length;a++){var h=
+m[a],f;if(h.top!==h.bottom){var r=h.top+(h.bottom-h.top)/2;for(f=0;f<c.length&&!(k=c[f],k.top<=r&&r<k.bottom);f++);f===c.length?c.push(h):(h.left<k.left&&(k.left=h.left),h.top<k.top&&(k.top=h.top),h.right>k.right&&(k.right=h.right),h.bottom>k.bottom&&(k.bottom=h.bottom))}}d=d.nextSibling}return void 0!==b?c[b]:c},_getLineBoundingClientRect:function(b,a){var c=new u(b.getBoundingClientRect());if(!this.view._wrapMode){c.right=c.left;for(var d=b.lastChild;d&&d.ignoreChars===d.firstChild.length;)d=d.previousSibling;
+d&&(d=d.getBoundingClientRect(),c.right=d.right+r(b).right)}a&&(d=r(b),c.left+=d.left,c.right-=d.right);return c},getLineCount:function(){return!this.view._wrapMode?1:this.getClientRects().length},getLineIndex:function(b){if(!this.view._wrapMode)return 0;for(var c=this.getClientRects(),b=this.getBoundingClientRect(b),b=b.top+(b.bottom-b.top)/2,a=0;a<c.length;a++)if(c[a].top<=b&&b<c[a].bottom)return a;return c.length-1},getLineStart:function(b){if(!this.view._wrapMode||0===b)return this.view._model.getLineStart(b);
+var c=this.getClientRects();return this.getOffset(c[b].left+1,c[b].top+1)},getOffset:function(b,c){var a=this.view,d=a._model,k=this.lineIndex,m=d.getLineStart(k),h=d.getLineEnd(k);if(m===h)return m;var f=this._ensureCreated(),r=this.getBoundingClientRect(),g,l;if(a._wrapMode){g=this.getClientRects();c<g[0].top&&(c=g[0].top);for(var s=0;s<g.length&&!(l=g[s],l.top<=c&&c<l.bottom);s++);b<l.left&&(b=l.left);b>l.right&&(b=l.right-1)}else 0>b&&(b=0),b>r.right-r.left&&(b=r.right-r.left);var t=f.ownerDocument,
+s=t.defaultView||t.parentWindow,v=e.isIE?s.screen.logicalXDPI/s.screen.deviceXDPI:1,x=e.isIE?s.screen.logicalYDPI/s.screen.deviceYDPI:1,s=m,u=f.firstChild;a:for(;u;){if(!u.ignore){var y=u.firstChild,f=y.length;u.ignoreChars&&(f-=u.ignoreChars);var p,n,z;g=this._getClientRects(u,r);for(var K=0;K<g.length;K++)if(l=g[K],l.left<=b&&b<l.right&&(!a._wrapMode||l.top<=c&&c<l.bottom)){var K=l.left+r.left,G;if(e.isIE||a._isRangeRects){for(var t=a._isRangeRects?t.createRange():t.body.createTextRange(),F=f,L=
+-1;1<F-L;){var V=Math.floor((F+L)/2);g=L+1;l=V===f-1&&u.ignoreChars?y.length:V+1;G=0===g&&8===e.isIE;a._isRangeRects?(t.setStart(y,g),t.setEnd(y,l)):(G&&(g=1),t.moveToElementText(u),t.move("character",g),t.moveEnd("character",l-g));g=t.getClientRects();for(var X=!1,W=0;W<g.length;W++)if(l=g[W],p=(G?K:l.left)*v-r.left,z=l.right*v-r.left,n=l.top*x-r.top,l=l.bottom*x-r.top,p<=b&&b<z&&(!a._wrapMode||n<=c&&c<l)){X=!0;break}X?F=V:L=V}s+=F;g=F;l=F===f-1&&u.ignoreChars?y.length:Math.min(F+1,y.length);a._isRangeRects?
+(t.setStart(y,g),t.setEnd(y,l)):(t.moveToElementText(u),t.move("character",g),t.moveEnd("character",l-g));g=t.getClientRects();a=!1;0<g.length&&(l=g[0],p=(G?K:l.left)*v-r.left,z=l.right*v-r.left,a=b>p+(z-p)/2);r=s-m;d=d.getLine(k);k=d.charCodeAt(r);55296<=k&&56319>=k&&a?r<d.length&&(k=d.charCodeAt(r+1),56320<=k&&57343>=k&&(s+=1)):56320<=k&&(57343>=k&&!a)&&0<r&&(k=d.charCodeAt(r-1),55296<=k&&56319>=k&&(s-=1));a&&s++}else{d=[];for(k=0;k<f;k++)d.push("<span>"),k===f-1?d.push(y.data.substring(k)):d.push(y.data.substring(k,
+k+1)),d.push("</span>");u.innerHTML=d.join("");for(d=u.firstChild;d;){l=d.getBoundingClientRect();p=l.left-r.left;z=l.right-r.left;if(p<=b&&b<z){b>p+(z-p)/2&&s++;break}s++;d=d.nextSibling}this._createdDiv||(u.innerHTML="",u.appendChild(y),r=a._getSelection(),(s<=r.start&&r.start<s+f||s<=r.end&&r.end<s+f)&&a._updateDOMSelection())}break a}s+=f}u=u.nextSibling}return Math.min(h,Math.max(m,s))},getNextOffset:function(b,a){if("line"===a.unit){var c=this.view._model,d=c.getLineAtOffset(b);if(0<a.count)return a.count--,
+c.getLineEnd(d);a.count++;return c.getLineStart(d)}return"wordend"===a.unit||"wordWS"===a.unit||"wordendWS"===a.unit?this._getNextOffset_W3C(b,a):e.isIE?this._getNextOffset_IE(b,a):this._getNextOffset_W3C(b,a)},_getNextOffset_W3C:function(b,a){function c(b){return 33<=b&&47>=b||58<=b&&64>=b||91<=b&&94>=b||96===b||123<=b&&126>=b}function d(b){return 32===b||9===b}var k=this.view._model,e=k.getLineAtOffset(b),m=k.getLine(e),h=k.getLineStart(e),k=k.getLineEnd(e),e=m.length,f=b-h,r,g=0>a.count?-1:1;if("word"===
+a.unit||"wordend"===a.unit||"wordWS"===a.unit||"wordendWS"===a.unit)for(var l,s,t;0!==a.count;){if(0<a.count){if(f===e)return k;r=m.charCodeAt(f);l=c(r);s=!l&&!d(r);for(f++;f<e;){r=m.charCodeAt(f);if("wordWS"!==a.unit&&"wordendWS"!==a.unit){t=c(r);if("wordend"===a.unit){if(!t&&l)break}else if(t&&!l)break;r=!t&&!d(r)}else r=!d(r);if("wordend"===a.unit||"wordendWS"===a.unit){if(!r&&s)break}else if(r&&!s)break;s=r;l=t;f++}}else{if(0===f)return h;f--;r=m.charCodeAt(f);l=c(r);for(s=!l&&!d(r);0<f;){r=m.charCodeAt(f-
+1);if("wordWS"!==a.unit&&"wordendWS"!==a.unit){t=c(r);if("wordend"===a.unit){if(t&&!l)break}else if(!t&&l)break;r=!t&&!d(r)}else r=!d(r);if("wordend"===a.unit||"wordendWS"===a.unit){if(r&&!s)break}else if(!r&&s)break;s=r;l=t;f--}}a.count-=g}else for(;0!==a.count&&0<=f+g&&f+g<=e;)f+=g,r=m.charCodeAt(f),56320<=r&&57343>=r&&0<f&&(r=m.charCodeAt(f-1),55296<=r&&56319>=r&&(f+=g)),a.count-=g;return h+f},_getNextOffset_IE:function(b,a){var c=this._ensureCreated(),d=this.view._model,k=this.lineIndex,e=0,m;
+m=d.getLineStart(k);var h=c.ownerDocument,f=0>a.count?-1:1;if(b===d.getLineEnd(k)){for(c=c.lastChild;c&&c.ignoreChars===c.firstChild.length;)c=c.previousSibling;if(!c)return m;e=h.body.createTextRange();e.moveToElementText(c);m=e.text.length;e.moveEnd(a.unit,f);e=b+e.text.length-m}else if(b===m&&0>a.count)e=m;else for(c=c.firstChild;c;){d=c.firstChild.length;c.ignoreChars&&(d-=c.ignoreChars);if(m+d>b){e=h.body.createTextRange();b===m&&0>a.count?e.moveToElementText(c.previousSibling):(e.moveToElementText(c),
+e.collapse(),e.moveEnd("character",b-m));m=e.text.length;e.moveEnd(a.unit,f);e=b+e.text.length-m;break}m=d+m;c=c.nextSibling}a.count-=f;return e},destroy:function(){var b=this._createdDiv;b&&(b.parentNode.removeChild(b),this._createdDiv=null)}};y.prototype={addKeyMode:function(b,a){var c=this._keyModes;void 0!==a?c.splice(a,0,b):c.push(b);b._modeAdded&&b._modeAdded()},addRuler:function(b,a){b.setView(this);var c=this._rulers;if(void 0!==a){var d,k;for(k=d=0;d<c.length&&k<a;d++)b.getLocation()===c[d].getLocation()&&
+k++;c.splice(k,0,b);a=k}else c.push(b);this._createRuler(b,a);this._update()},computeSize:function(){var b=0,a=0,c=this._model,d=this._clientDiv;if(!d)return{width:b,height:a};var k=d.style.width;e.isWebkit&&(d.style.width="0x7fffffffpx");for(var c=c.getLineCount(),m=0;m<c;m++){var h=this._getLine(m),f=h.getBoundingClientRect(),b=Math.max(b,f.right-f.left),a=a+(f.bottom-f.top);h.destroy()}e.isWebkit&&(d.style.width=k);d=this._getViewPadding();b+=d.right+d.left+this._metrics.scrollWidth;a+=d.bottom+
+d.top+this._metrics.scrollWidth;return{width:b,height:a}},convert:function(b,a,c){if(this._clientDiv){var d=this._getScroll(),k=this._getViewPadding(),e=this._viewDiv.getBoundingClientRect();"document"===a&&(void 0!==b.x&&(b.x+=-d.x+e.left+k.left),void 0!==b.y&&(b.y+=-d.y+e.top+k.top));"document"===c&&(void 0!==b.x&&(b.x+=d.x-e.left-k.left),void 0!==b.y&&(b.y+=d.y-e.top-k.top));return b}},destroy:function(){for(var b=0;b<this._rulers.length;b++)this._rulers[b].setView(null);this.rulers=null;this._destroyView();
+this.onDestroy({type:"Destroy"});this._parent=null;this._model&&this._model.destroy&&this._model.destroy();this._actions=this._keyModes=this._doubleClickSelection=this._selection=this._theme=this._model=null},focus:function(){this._clientDiv&&(this._updateDOMSelection(),this._clientDiv.focus(),this._updateDOMSelection())},hasFocus:function(){return this._hasFocus},getActionDescription:function(b){if(b=this._actions[b])return b.actionDescription},getActions:function(b){var a=[],c=this._actions,d;for(d in c)c.hasOwnProperty(d)&&
+(b||!c[d].defaultHandler)&&a.push(d);return a},getBottomIndex:function(b){return!this._clientDiv?0:this._getBottomIndex(b)},getBottomPixel:function(){return!this._clientDiv?0:this._getScroll().y+this._getClientHeight()},getCaretOffset:function(){return this._getSelection().getCaret()},getClientArea:function(){if(!this._clientDiv)return{x:0,y:0,width:0,height:0};var b=this._getScroll();return{x:b.x,y:b.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return!this._clientDiv?
+0:this._getScroll().x},getKeyBindings:function(b){for(var a=[],c=this._keyModes,d=0;d<c.length;d++)a=a.concat(c[d].getKeyBindings(b));return a},getKeyModes:function(){return this._keyModes.slice(0)},getLineHeight:function(b){return!this._clientDiv?0:this._getLineHeight(b)},getLineIndex:function(b){return!this._clientDiv?0:this._getLineIndex(b)},getLinePixel:function(b){return!this._clientDiv?0:this._getLinePixel(b)},getLocationAtOffset:function(b){if(!this._clientDiv)return{x:0,y:0};var a=this._model,
+b=Math.min(Math.max(0,b),a.getCharCount()),a=a.getLineAtOffset(b),c=this._getLine(a),b=c.getBoundingClientRect(b);c.destroy();c=b.left;a=this._getLinePixel(a)+b.top;return{x:c,y:a}},getNextOffset:function(b,a){var c=new x(b,b,!1);this._doMove(a,c);return c.getCaret()},getOptions:function(){var b;if(0===arguments.length)b=this._defaultOptions();else if(1===arguments.length){if(b=arguments[0],"string"===typeof b)return h(this["_"+b])}else{b={};for(var a in arguments)arguments.hasOwnProperty(a)&&(b[arguments[a]]=
+void 0)}for(var c in b)b.hasOwnProperty(c)&&(b[c]=h(this["_"+c]));return b},getModel:function(){return this._model},getOffsetAtLocation:function(b,a){if(!this._clientDiv)return 0;var c=this._getLineIndex(a),d=this._getLine(c),c=d.getOffset(b,a-this._getLinePixel(c));d.destroy();return c},getLineAtOffset:function(b){this.getModel().getLineAtOffset(b)},getLineStart:function(b){this.getModel().getLineStart(b)},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){var b=this._getSelection();
+return{start:b.start,end:b.end}},getText:function(b,a){return this._model.getText(b,a)},getTopIndex:function(b){return!this._clientDiv?0:this._getTopIndex(b)},getTopPixel:function(){return!this._clientDiv?0:this._getScroll().y},invokeAction:function(b,a,c){if(this._clientDiv){if(b=this._actions[b]){if(!a&&b.handler&&b.handler(c))return!0;if(b.defaultHandler)return"boolean"===typeof b.defaultHandler(c)}return!1}},isDestroyed:function(){return!this._clientDiv},onContextMenu:function(b){return this.dispatchEvent(b)},
+onDragStart:function(b){return this.dispatchEvent(b)},onDrag:function(b){return this.dispatchEvent(b)},onDragEnd:function(b){return this.dispatchEvent(b)},onDragEnter:function(b){return this.dispatchEvent(b)},onDragOver:function(b){return this.dispatchEvent(b)},onDragLeave:function(b){return this.dispatchEvent(b)},onDrop:function(b){return this.dispatchEvent(b)},onDestroy:function(b){return this.dispatchEvent(b)},onLineStyle:function(b){return this.dispatchEvent(b)},onKeyDown:function(b){return this.dispatchEvent(b)},
+onKeyPress:function(b){return this.dispatchEvent(b)},onKeyUp:function(b){return this.dispatchEvent(b)},onModelChanged:function(b){return this.dispatchEvent(b)},onModelChanging:function(b){return this.dispatchEvent(b)},onModify:function(b){return this.dispatchEvent(b)},onMouseDown:function(b){return this.dispatchEvent(b)},onMouseUp:function(b){return this.dispatchEvent(b)},onMouseMove:function(b){return this.dispatchEvent(b)},onMouseOver:function(b){return this.dispatchEvent(b)},onMouseOut:function(b){return this.dispatchEvent(b)},
+onSelection:function(b){return this.dispatchEvent(b)},onScroll:function(b){return this.dispatchEvent(b)},onVerify:function(b){return this.dispatchEvent(b)},onFocus:function(b){return this.dispatchEvent(b)},onBlur:function(b){return this.dispatchEvent(b)},redraw:function(){if(!(0<this._redrawCount)){var b=this._model.getLineCount();this.redrawRulers(0,b);this.redrawLines(0,b)}},redrawRulers:function(b,a){if(!(0<this._redrawCount))for(var c=this.getRulers(),d=0;d<c.length;d++)this.redrawLines(b,a,c[d])},
+redrawLines:function(b,a,c){if(!(0<this._redrawCount)&&(void 0===b&&(b=0),void 0===a&&(a=this._model.getLineCount()),b!==a)){var d=this._clientDiv;if(d){if(c)for(d=this._getRulerParent(c).firstChild;d&&d._ruler!==c;)d=d.nextSibling;c?d.rulerChanged=!0:this._lineHeight&&this._resetLineHeight(b,a);if(!c||"page"===c.getOverview())for(d=d.firstChild;d;){var k=d.lineIndex;b<=k&&k<a&&(d.lineChanged=!0);d=d.nextSibling}!c&&(!this._wrapMode&&b<=this._maxLineIndex&&this._maxLineIndex<a)&&(this._checkMaxLineIndex=
+this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0);this._queueUpdate()}}},redrawRange:function(b,a){if(!(0<this._redrawCount)){var c=this._model;void 0===b&&(b=0);void 0===a&&(a=c.getCharCount());var d=c.getLineAtOffset(b),c=c.getLineAtOffset(Math.max(b,a-1))+1;this.redrawLines(d,c)}},removeKeyMode:function(b){for(var a=this._keyModes,c=0;c<a.length;c++)if(a[c]===b){a.splice(c,1);break}b._modeRemoved&&b._modeRemoved()},removeRuler:function(b){for(var a=this._rulers,c=0;c<a.length;c++)if(a[c]===
+b){a.splice(c,1);b.setView(null);this._destroyRuler(b);this._update();break}},resize:function(){this._clientDiv&&this._handleResize(null)},setAction:function(b,a,c){if(b){var d=this._actions,k=d[b];k||(k=d[b]={});k.handler=a;void 0!==c&&(k.actionDescription=c)}},setKeyBinding:function(b,a){this._keyModes[0].setKeyBinding(b,a)},setCaretOffset:function(b,a,c){var d=this._model.getCharCount(),b=Math.max(0,Math.min(b,d)),b=new x(b,b,!1);this._setSelection(b,void 0===a||a,!0,c)},setHorizontalPixel:function(b){this._clientDiv&&
+(b=Math.max(0,b),this._scrollView(b-this._getScroll().x,0))},setRedraw:function(b){b?0===--this._redrawCount&&this.redraw():this._redrawCount++},setModel:function(b){if(b&&b!==this._model){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);var a=this._model.getLineCount(),c=this._model.getCharCount(),d=b.getLineCount(),k=b.getCharCount(),e={type:"ModelChanging",text:b.getText(),start:0,removedCharCount:c,
+addedCharCount:k,removedLineCount:a,addedLineCount:d};this.onModelChanging(e);this._model=b;e={type:"ModelChanged",start:0,removedCharCount:c,addedCharCount:k,removedLineCount:a,addedLineCount:d};this.onModelChanged(e);this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._reset();this._update()}},setOptions:function(a){var c=this._defaultOptions(),d;for(d in a)if(a.hasOwnProperty(d)){var k=a[d];if(!b(this["_"+
+d],k)){var e=c[d]?c[d].update:null;e?e.call(this,k):this["_"+d]=h(k)}}},setSelection:function(b,a,c,d){var k=b>a;if(k)var e=b,b=a,a=e;e=this._model.getCharCount();b=Math.max(0,Math.min(b,e));a=Math.max(0,Math.min(a,e));b=new x(b,a,k);this._setSelection(b,void 0===c||c,!0,d)},setText:function(b,a,c){var d=void 0===a&&void 0===c;void 0===a&&(a=0);void 0===c&&(c=this._model.getCharCount());d&&(this._variableLineHeight=!1);this._modifyContent({text:b,start:a,end:c,_code:!0},!d);d&&(this._columnX=-1,this._setSelection(new x(0,
+0,!1),!0),e.isFirefox&&this._fixCaret())},setTopIndex:function(b){this._clientDiv&&this._scrollView(0,this._getLinePixel(Math.max(0,b))-this._getScroll().y)},setTopPixel:function(b){this._clientDiv&&this._scrollView(0,Math.max(0,b)-this._getScroll().y)},showSelection:function(){return this._showCaret(!0)},update:function(b,a){this._clientDiv&&(b&&this._updateStyle(),void 0===a||a?this._update():this._queueUpdate())},_handleRootMouseDown:function(b){if(!this._ignoreEvent(b)){e.isFirefox&&1===b.which&&
+(this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0);var a=this._overlayDiv||this._clientDiv;9>e.isIE&&(a=this._viewDiv);for(var c=b.target?b.target:b.srcElement;c;){if(a===c)return;c=c.parentNode}b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();if(!this._isW3CEvents){var d=this;this._getWindow().setTimeout(function(){d._clientDiv.focus()},0)}}},_handleRootMouseUp:function(b){!this._ignoreEvent(b)&&(e.isFirefox&&1===b.which)&&
+(this._clientDiv.contentEditable=!0,(this._overlayDiv||this._clientDiv).draggable=!1,this._fixCaret(),this._ignoreBlur=!1)},_handleBlur:function(){if(!this._ignoreBlur){this._hasFocus=!1;if(9>e.isIE&&!this._getSelection().isEmpty()){var b=this._rootDiv,a=e.createElement(b.ownerDocument,"div");b.appendChild(a);b.removeChild(a)}this._cursorDiv&&(this._cursorDiv.style.display="none");if(this._selDiv1)if(this._selDiv1.style.background="lightgray",this._selDiv2.style.background="lightgray",this._selDiv3.style.background=
+"lightgray",b=this._getWindow(),a=this._selDiv1.ownerDocument,b.getSelection){a=b.getSelection();for(b=a.anchorNode;b;){if(b===this._clientDiv){0<a.rangeCount&&a.removeAllRanges();break}b=b.parentNode}}else if(a.selection){this._ignoreSelect=!1;for(b=a.selection.createRange().parentElement();b;){if(b===this._clientDiv){a.selection.empty();break}b=b.parentNode}this._ignoreSelect=!0}if(!this._ignoreFocus)this.onBlur({type:"Blur"})}},_handleContextMenu:function(b){if(!this._ignoreEvent(b)){e.isIE&&3===
+this._lastMouseButton&&this._updateDOMSelection();var a=!1;this.isListening("ContextMenu")?(a=this._createMouseEvent("ContextMenu",b),a.screenX=b.screenX,a.screenY=b.screenY,this.onContextMenu(a),a=a.defaultPrevented):e.isMac&&(e.isFirefox&&0===b.button)&&(a=!0);if(a)return b.preventDefault&&b.preventDefault(),!1}},_handleCopy:function(b){if(!this._ignoreEvent(b)&&!this._ignoreCopy&&this._doCopy(b))return b.preventDefault&&b.preventDefault(),!1},_handleCut:function(b){if(!this._ignoreEvent(b)&&this._doCut(b))return b.preventDefault&&
+b.preventDefault(),!1},_handleDataModified:function(b){this._ignoreEvent(b)||this._startIME()},_handleDblclick:function(b){this._ignoreEvent(b)||(this._lastMouseTime=b.timeStamp?b.timeStamp:(new Date).getTime(),2!==this._clickCount&&(this._clickCount=2,this._handleMouse(b)))},_handleDragStart:function(b){if(!this._ignoreEvent(b)){if(e.isFirefox){var a=this;this._getWindow().setTimeout(function(){a._clientDiv.contentEditable=!0;a._clientDiv.draggable=!1;a._ignoreBlur=!1},0)}if(this.isListening("DragStart")&&
+-1!==this._dragOffset)this._isMouseDown=!1,this.onDragStart(this._createMouseEvent("DragStart",b)),this._dragOffset=-1;else return b.preventDefault&&b.preventDefault(),!1}},_handleDrag:function(b){if(!this._ignoreEvent(b)&&this.isListening("Drag"))this.onDrag(this._createMouseEvent("Drag",b))},_handleDragEnd:function(b){if(!this._ignoreEvent(b)){this._dropTarget=!1;this._dragOffset=-1;if(this.isListening("DragEnd"))this.onDragEnd(this._createMouseEvent("DragEnd",b));e.isFirefox&&(this._fixCaret(),
+"none"===b.dataTransfer.dropEffect&&!b.dataTransfer.mozUserCancelled&&this._fixCaret())}},_handleDragEnter:function(b){if(!this._ignoreEvent(b)){var a=!0;this._dropTarget=!0;this.isListening("DragEnter")&&(a=!1,this.onDragEnter(this._createMouseEvent("DragEnter",b)));if(e.isWebkit||a)return b.preventDefault&&b.preventDefault(),!1}},_handleDragOver:function(b){if(!this._ignoreEvent(b)){var a=!0;this.isListening("DragOver")&&(a=!1,this.onDragOver(this._createMouseEvent("DragOver",b)));if(e.isWebkit||
+a)return a&&(b.dataTransfer.dropEffect="none"),b.preventDefault&&b.preventDefault(),!1}},_handleDragLeave:function(b){if(!this._ignoreEvent(b)&&(this._dropTarget=!1,this.isListening("DragLeave")))this.onDragLeave(this._createMouseEvent("DragLeave",b))},_handleDrop:function(b){if(!this._ignoreEvent(b)){this._dropTarget=!1;if(this.isListening("Drop"))this.onDrop(this._createMouseEvent("Drop",b));b.preventDefault&&b.preventDefault();return!1}},_handleFocus:function(){this._hasFocus=!0;e.isIOS&&void 0!==
+this._lastTouchOffset?(this.setCaretOffset(this._lastTouchOffset,!0),this._lastTouchOffset=void 0):this._updateDOMSelection();this._cursorDiv&&(this._cursorDiv.style.display="block");if(this._selDiv1){var b=this._highlightRGB;this._selDiv1.style.background=b;this._selDiv2.style.background=b;this._selDiv3.style.background=b}if(!this._ignoreFocus)this.onFocus({type:"Focus"})},_handleKeyDown:function(b){if(!this._ignoreEvent(b)){if(this.isListening("KeyDown")){var a=this._createKeyEvent("KeyDown",b);
+this.onKeyDown(a);if(a.defaultPrevented){e.isFirefox&&(this._keyDownPrevented=!0);b.preventDefault();return}}a=!1;switch(b.keyCode){case 16:case 17:case 18:case 91:a=!0;break;default:this._setLinksVisible(!1)}if(229===b.keyCode){if(this._readonly)return b.preventDefault&&b.preventDefault(),!1;a=!0;e.isSafari&&e.isMac&&b.ctrlKey&&(a=!1,b.keyCode=129);a&&this._startIME()}else a||this._commitIME();if((e.isMac||e.isLinux)&&4>e.isFirefox||12.16>e.isOpera)return this._keyDownEvent=b,!0;if(this._doAction(b))return b.preventDefault?
+(b.preventDefault(),b.stopPropagation()):(b.cancelBubble=!0,b.returnValue=!1,b.keyCode=0),!1}},_handleKeyPress:function(b){if(!this._ignoreEvent(b))if(this._keyDownPrevented)b.preventDefault&&(b.preventDefault(),b.stopPropagation()),this._keyDownPrevented=void 0;else{if(e.isMac&&e.isWebkit&&(63232<=b.keyCode&&63487>=b.keyCode||13===b.keyCode||8===b.keyCode)||((e.isMac||e.isLinux)&&4>e.isFirefox||12.16>e.isOpera)&&this._doAction(this._keyDownEvent))return b.preventDefault&&b.preventDefault(),!1;var a=
+e.isMac?b.metaKey:b.ctrlKey;if(void 0!==b.charCode&&a)switch(b.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")&&(a=this._createKeyEvent("KeyPress",b),this.onKeyPress(a),a.defaultPrevented)){b.preventDefault();return}if(this._doAction(b))return b.preventDefault?(b.preventDefault(),b.stopPropagation()):(b.cancelBubble=!0,b.returnValue=!1,b.keyCode=0),!1;a=!1;if(e.isMac){if(b.ctrlKey||b.metaKey)a=!0}else if(e.isFirefox){if(b.ctrlKey||b.altKey)a=!0}else b.ctrlKey^b.altKey&&
+(a=!0);if(!a&&(a=e.isOpera?b.which:void 0!==b.charCode?b.charCode:b.keyCode,31<a))return this._doContent(String.fromCharCode(a)),b.preventDefault&&b.preventDefault(),!1}},_handleDocKeyUp:function(b){(e.isMac?b.metaKey:b.ctrlKey)||this._setLinksVisible(!1)},_handleKeyUp:function(b){if(!this._ignoreEvent(b)){if(this.isListening("KeyUp")){var a=this._createKeyEvent("KeyUp",b);this.onKeyUp(a);if(a.defaultPrevented){b.preventDefault();return}}this._handleDocKeyUp(b);13===b.keyCode&&this._commitIME()}},
+_handleLinkClick:function(b){if(!(e.isMac?b.metaKey:b.ctrlKey))return b.preventDefault&&b.preventDefault(),!1},_handleMouse:function(b){var a=this._getWindow(),c=!0,d=a;if(e.isIE||e.isFirefox&&!this._overlayDiv)d=this._clientDiv;if(this._overlayDiv){this._hasFocus&&(this._ignoreFocus=!0);var k=this;a.setTimeout(function(){k.focus();k._ignoreFocus=!1},0)}1===this._clickCount?(c=this._setSelectionTo(b.clientX,b.clientY,b.shiftKey,(!e.isOpera||12.16<=e.isOpera)&&this._hasFocus&&this.isListening("DragStart")))&&
+this._setGrab(d):(this._isW3CEvents&&this._setGrab(d),this._doubleClickSelection=null,this._setSelectionTo(b.clientX,b.clientY,b.shiftKey),this._doubleClickSelection=this._getSelection());return c},_handleMouseDown:function(b){if(!this._ignoreEvent(b)){if(this._linksVisible)if("A"!==(b.target||b.srcElement).tagName)this._setLinksVisible(!1);else return;this._commitIME();var a=b.which;a||(4===b.button&&(a=2),2===b.button&&(a=3),1===b.button&&(a=1));var c=2!==a&&b.timeStamp?b.timeStamp:(new Date).getTime(),
+d=c-this._lastMouseTime,k=Math.abs(this._lastMouseX-b.clientX),m=Math.abs(this._lastMouseY-b.clientY),h=this._lastMouseButton===a;this._lastMouseX=b.clientX;this._lastMouseY=b.clientY;this._lastMouseTime=c;this._lastMouseButton=a;1===a&&(this._isMouseDown=!0,h&&d<=this._clickTime&&k<=this._clickDist&&m<=this._clickDist?this._clickCount++:this._clickCount=1);if(this.isListening("MouseDown")&&(c=this._createMouseEvent("MouseDown",b),this.onMouseDown(c),c.defaultPrevented)){b.preventDefault();return}if(1===
+a&&this._handleMouse(b)&&(9<=e.isIE||e.isOpera||e.isChrome||e.isSafari||e.isFirefox&&!this._overlayDiv))this._hasFocus||this.focus(),b.preventDefault();e.isFirefox&&3===this._lastMouseButton&&this._updateDOMSelection()}},_handleMouseOver:function(b){if(!this._ignoreEvent(b)&&!this._animation&&this.isListening("MouseOver"))this.onMouseOver(this._createMouseEvent("MouseOver",b))},_handleMouseOut:function(b){if(!this._ignoreEvent(b)&&!this._animation&&this.isListening("MouseOut"))this.onMouseOut(this._createMouseEvent("MouseOut",
+b))},_handleMouseMove:function(b){if(!this._animation){var a=this._isClientDiv(b);if(this.isListening("MouseMove")&&a)this.onMouseMove(this._createMouseEvent("MouseMove",b));if(!this._dropTarget){var c=this._linksVisible||this._lastMouseMoveX!==b.clientX||this._lastMouseMoveY!==b.clientY;this._lastMouseMoveX=b.clientX;this._lastMouseMoveY=b.clientY;this._setLinksVisible(c&&!this._isMouseDown&&(e.isMac?b.metaKey:b.ctrlKey));if(!this._isW3CEvents){if(0===b.button)return this._setGrab(null),!0;if(!this._isMouseDown&&
+1===b.button&&0!==(this._clickCount&1)&&a)return this._clickCount=2,this._handleMouse(b,this._clickCount)}if(this._isMouseDown&&-1===this._dragOffset){var a=b.clientX,b=b.clientY,d=this._getViewPadding(),k=this._viewDiv.getBoundingClientRect(),m=this._getClientWidth(),h=this._getClientHeight(),c=k.left+d.left,f=k.top+d.top,m=k.left+d.left+m,d=k.top+d.top+h;b<f?this._doAutoScroll("up",a,b-f):b>d?this._doAutoScroll("down",a,b-d):a<c&&!this._wrapMode?this._doAutoScroll("left",a-c,b):a>m&&!this._wrapMode?
+this._doAutoScroll("right",a-m,b):(this._endAutoScroll(),this._setSelectionTo(a,b,!0))}}}},_isClientDiv:function(b){for(var a=this._overlayDiv||this._clientDiv,b=b.target?b.target:b.srcElement;b;){if(a===b)return!0;b=b.parentNode}return!1},_createKeyEvent:function(b,a){return{type:b,event:a,preventDefault:function(){this.defaultPrevented=!0}}},_createMouseEvent:function(b,a){var c=this.convert({x:a.clientX,y:a.clientY},"page","document");return{type:b,event:a,clickCount:this._clickCount,x:c.x,y:c.y,
+preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(b){var a=b.which?0===b.button:1===b.button;if(this.isListening("MouseUp")&&(this._isClientDiv(b)||a&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp",b));!this._linksVisible&&(a&&this._isMouseDown)&&(-1!==this._dragOffset&&(a=this._getSelection(),a.extend(this._dragOffset),a.collapse(),this._setSelection(a,!0,!0),this._dragOffset=-1),this._isMouseDown=!1,this._endAutoScroll(),this._isW3CEvents&&this._setGrab(null),
+e.isFirefox&&b.preventDefault())},_handleMouseWheel:function(b){var a=this._getLineHeight(),c=0,d=0;e.isIE||e.isOpera?d=-b.wheelDelta/40*a:e.isFirefox?(a=e.isMac?3*b.detail:Math.max(-256,Math.min(256,b.detail))*a,b.axis===b.HORIZONTAL_AXIS?c=a:d=a):e.isMac?(d=b.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=b.timeStamp,c=0!==b.wheelDeltaX%120?1:40>d?40/(40-d):40,d=0!==b.wheelDeltaY%120?1:40>d?40/(40-d):40,c=Math.ceil(-b.wheelDeltaX/c),-1<c&&0>c&&(c=-1),0<c&&1>c&&(c=1),d=Math.ceil(-b.wheelDeltaY/
+d),-1<d&&0>d&&(d=-1),0<d&&1>d&&(d=1)):(c=-b.wheelDeltaX,d=8*(-b.wheelDeltaY/120)*a);if(e.isSafari){for(a=b.target;a&&void 0===a.lineIndex;)a=a.parentNode;this._mouseWheelLine=a}a=this._getScroll();this._scrollView(c,d);c=this._getScroll();if(a.x!==c.x||a.y!==c.y)return b.preventDefault&&b.preventDefault(),!1},_handlePaste:function(b){if(!this._ignoreEvent(b)&&!this._ignorePaste&&this._doPaste(b)){if(e.isIE){var a=this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){a._updateDOMSelection();
+a._ignoreFocus=!1},0)}b.preventDefault&&b.preventDefault();return!1}},_handleResize:function(){var a=this._rootDiv.clientWidth,c=this._rootDiv.clientHeight;if(this._rootWidth!==a||this._rootHeight!==c)this._rootWidth!==a&&this._wrapMode&&this._resetLineHeight(),this._rootWidth=a,this._rootHeight=c,a=9>e.isIE,c=this._calculateMetrics(),b(c,this._metrics)||(this._variableLineHeight&&(this._variableLineHeight=!1,this._resetLineHeight()),this._metrics=c,a=!0),a?this._queueUpdate():this._update()},_handleRulerEvent:function(b){for(var a=
+b.target?b.target:b.srcElement,c=a.lineIndex;a&&!a._ruler;)void 0===c&&void 0!==a.lineIndex&&(c=a.lineIndex),a=a.parentNode;var d=a?a._ruler:null;if(void 0===c&&d&&"document"===d.getOverview()){var c=this._getClientHeight(),k=this._model.getLineCount(),e=this._getViewPadding(),m=this._viewDiv.getBoundingClientRect(),c=Math.floor((b.clientY-m.top-this._metrics.scrollWidth)*k/(c+e.top+e.bottom-2*this._metrics.scrollWidth));0<=c&&c<k||(c=void 0)}if(d)switch(b.type){case "click":if(d.onClick)d.onClick(c,
+b);break;case "dblclick":if(d.onDblClick)d.onDblClick(c,b);break;case "mousemove":if(d.onMouseMove)d.onMouseMove(c,b);break;case "mouseover":if(d.onMouseOver)d.onMouseOver(c,b);break;case "mouseout":if(d.onMouseOut){for(k=b.relatedTarget;k&&k!==this._rootDiv;){if(k===a)return;k=k.parentNode}d.onMouseOut(c,b)}}},_handleScroll:function(){var b=this._getScroll(!1),a=this._hScroll,c=this._vScroll;if(a!==b.x||c!==b.y)this._hScroll=b.x,this._vScroll=b.y,this._commitIME(),this._update(c===b.y),this.onScroll({type:"Scroll",
+oldValue:{x:a,y:c},newValue:b})},_handleSelectStart:function(b){if(this._ignoreSelect)return b&&b.preventDefault&&b.preventDefault(),!1},_getModelOffset:function(b,a){if(b){var c;c="DIV"===b.tagName?b:b.parentNode.parentNode;var d=0,k=c.lineIndex;if("DIV"!==b.tagName)for(c=c.firstChild;c;){var e=c.firstChild;if(e===b){c.ignoreChars&&(d-=c.ignoreChars);d+=a;break}c.ignoreChars&&(d-=c.ignoreChars);d+=e.data.length;c=c.nextSibling}return Math.max(0,d)+this._model.getLineStart(k)}},_updateSelectionFromDOM:function(){var b=
+this._getWindow().getSelection(),a=this._getModelOffset(b.anchorNode,b.anchorOffset),b=this._getModelOffset(b.focusNode,b.focusOffset);void 0===a||void 0===b||this._setSelection(new x(a,b),!1,!1)},_handleSelectionChange:function(){if(-1===this._imeOffset)if(e.isAndroid){var b=this._getWindow();this._selTimer&&b.clearTimeout(this._selTimer);var a=this;this._selTimer=b.setTimeout(function(){a._clientDiv&&(a._selTimer=null,a._updateSelectionFromDOM())},250)}else this._updateSelectionFromDOM()},_handleTextInput:function(b){if(!this._ignoreEvent(b)){this._imeOffset=
+-1;var a=this._getWindow().getSelection();if(a.anchorNode!==this._anchorNode||a.focusNode!==this._focusNode||a.anchorOffset!==this._anchorOffset||a.focusOffset!==this._focusOffset){for(var c=a.anchorNode;c&&void 0===c.lineIndex;)c=c.parentNode;if(c){var d=this._model,k=c.lineIndex,e=d.getLine(k),m=e,h=0,d=d.getLineStart(k);0<a.rangeCount&&(a.getRangeAt(0).deleteContents(),k=c.ownerDocument.createTextNode(b.data),a.getRangeAt(0).insertNode(k),h=this._getDOMText(c,k),m=h.text,h=h.offset,k.parentNode.removeChild(k));
+c.lineRemoved=!0;for(c=0;e.charCodeAt(c)===m.charCodeAt(c)&&c<h;)c++;a=e.length-1;for(k=m.length-e.length;e.charCodeAt(a)===m.charCodeAt(a+k)&&a+k>=h+b.data.length;)a--;a++;e=m.substring(c,a+k);this._modifyContent({text:e,start:c+d,end:a+d,_ignoreDOMSelection:!0},!0)}}else this._doContent(b.data);b.preventDefault()}},_handleTouchStart:function(b){this._commitIME();var a=this._getWindow();this._touchScrollTimer&&(this._vScrollDiv.style.display="none",this._hScrollDiv.style.display="none",a.clearInterval(this._touchScrollTimer),
+this._touchScrollTimer=null);var c=b.touches;if(1===c.length){var c=c[0],d=c.clientX,k=c.clientY;this._touchStartX=d;this._touchStartY=k;if(e.isAndroid&&(k<c.pageY-a.pageYOffset||d<c.pageX-a.pageXOffset))d=c.pageX-a.pageXOffset,k=c.pageY-a.pageYOffset;a=this.convert({x:d,y:k},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(a.x,a.y);this._touchStartTime=b.timeStamp;this._touching=!0}},_handleTouchMove:function(b){var a=b.touches;if(1===a.length){a=a[0];this._touchCurrentX=a.clientX;
+this._touchCurrentY=a.clientY;if(!this._touchScrollTimer&&200>b.timeStamp-this._touchStartTime){this._vScrollDiv.style.display="block";this._wrapMode||(this._hScrollDiv.style.display="block");var c=this,d=this._getWindow();this._touchScrollTimer=d.setInterval(function(){var b=0,a=0;if(c._touching)b=c._touchStartX-c._touchCurrentX,a=c._touchStartY-c._touchCurrentY,c._touchSpeedX=b/10,c._touchSpeedY=a/10,c._touchStartX=c._touchCurrentX,c._touchStartY=c._touchCurrentY;else{if(0.1>Math.abs(c._touchSpeedX)&&
+0.1>Math.abs(c._touchSpeedY)){c._vScrollDiv.style.display="none";c._hScrollDiv.style.display="none";d.clearInterval(c._touchScrollTimer);c._touchScrollTimer=null;return}b=10*c._touchSpeedX;a=10*c._touchSpeedY;c._touchSpeedX*=0.95;c._touchSpeedY*=0.95}c._scrollView(b,a)},10)}this._touchScrollTimer&&b.preventDefault()}},_handleTouchEnd:function(b){0===b.touches.length&&(this._touching=!1)},_doAction:function(b){var a,c,d=this._keyModes;for(c=d.length-1;0<=c;c--)if(a=d[c],"function"===typeof a.match&&
+(a=a.match(b),void 0!==a))return this.invokeAction(a);return!1},_doMove:function(b,a){var c=this._model,d=a.getCaret(),k=c.getLineAtOffset(d);b.count||(b.count=1);for(;0!==b.count;){var e=c.getLineStart(k);if(0>b.count&&d===e)if(0<k)"character"===b.unit&&b.count++,k--,a.extend(c.getLineEnd(k));else break;else if(0<b.count&&d===c.getLineEnd(k))if(k+1<c.getLineCount())"character"===b.unit&&b.count--,k++,a.extend(c.getLineStart(k));else break;else{var m=!1;b.expandTab&&("character"===b.unit&&0===(d-
+e)%this._tabSize)&&(e=c.getText(e,d),m=!/[^ ]/.test(e));m?(a.extend(d-this._tabSize),b.count+=0>b.count?1:-1):(e=this._getLine(k),a.extend(e.getNextOffset(d,b)),e.destroy())}d=a.getCaret()}return a},_doBackspace:function(b){var a=this._getSelection();a.isEmpty()&&(b.count||(b.count=1),b.count*=-1,b.expandTab=this._expandTab,this._doMove(b,a));this._modifyContent({text:"",start:a.start,end:a.end},!0);return!0},_doCase:function(b){var a=this._getSelection();this._doMove(b,a);var c=this.getText(a.start,
+a.end);this._setSelection(a,!0);switch(b.type){case "lower":c=c.toLowerCase();break;case "capitalize":c=c.replace(/(?:^|\s)\S/g,function(b){return b.toUpperCase()});break;case "reverse":b="";for(a=0;a<c.length;a++)var d=c[a],k=d.toLowerCase(),d=k!==d?k:d.toUpperCase(),b=b+d;c=b;break;default:c=c.toUpperCase()}this._doContent(c);return!0},_doContent:function(b){var a=this._getSelection();if(this._overwriteMode&&a.isEmpty()){var c=this._model,d=c.getLineAtOffset(a.end);a.end<c.getLineEnd(d)&&(c=this._getLine(d),
+a.extend(c.getNextOffset(a.getCaret(),{unit:"character",count:1})),c.destroy())}this._modifyContent({text:b,start:a.start,end:a.end,_ignoreDOMSelection:!0},!0)},_doCopy:function(b){var a=this._getSelection();return!a.isEmpty()?(a=this._getBaseText(a.start,a.end),this._setClipboardText(a,b)):!0},_doCursorNext:function(b){var a=this._getSelection();!a.isEmpty()&&!b.select?a.start=a.end:this._doMove(b,a);b.select||a.collapse();this._setSelection(a,!0);return!0},_doCursorPrevious:function(b){var a=this._getSelection();
+!a.isEmpty()&&!b.select?a.end=a.start:(b.count||(b.count=1),b.count*=-1,this._doMove(b,a));b.select||a.collapse();this._setSelection(a,!0);return!0},_doCut:function(b){var a=this._getSelection();return!a.isEmpty()?(a=this._getBaseText(a.start,a.end),this._doContent(""),this._setClipboardText(a,b)):!0},_doDelete:function(b){var a=this._getSelection();a.isEmpty()&&this._doMove(b,a);this._modifyContent({text:"",start:a.start,end:a.end},!0);return!0},_doEnd:function(b){var a=this._getSelection(),c=this._model,
+d;if(b.ctrl)a.extend(c.getCharCount()),d=function(){};else{var k=a.getCaret(),e=c.getLineAtOffset(k);if(this._wrapMode){var m=this._getLine(e),k=m.getLineIndex(k),k=k===m.getLineCount()-1?c.getLineEnd(e):m.getLineStart(k+1)-1;m.destroy()}else b.count&&0<b.count&&(e=Math.min(e+b.count-1,c.getLineCount()-1)),k=c.getLineEnd(e);a.extend(k)}b.select||a.collapse();this._setSelection(a,!0,!0,d);return!0},_doEnter:function(b){var a=this._model,c=this._getSelection();this._doContent(a.getLineDelimiter());
+b&&b.noCursor&&(c.end=c.start,this._setSelection(c,!0));return!0},_doHome:function(b){var a=this._getSelection(),c=this._model,d;if(b.ctrl)a.extend(0),d=function(){};else{var k=a.getCaret(),e=c.getLineAtOffset(k);this._wrapMode?(c=this._getLine(e),k=c.getLineIndex(k),k=c.getLineStart(k),c.destroy()):k=c.getLineStart(e);a.extend(k)}b.select||a.collapse();this._setSelection(a,!0,!0,d);return!0},_doLineDown:function(b){var a=this._model,c=this._getSelection(),d=c.getCaret(),k=a.getLineAtOffset(d),m=
+this._getLine(k),h=this._columnX,f=1,r=!1;if(-1===h||b.wholeLine||b.select&&e.isIE)h=b.wholeLine?a.getLineEnd(k+1):d,h=m.getBoundingClientRect(h).left;(d=m.getLineIndex(d))<m.getLineCount()-1?f=m.getClientRects(d+1).top+1:(d=a.getLineCount()-1,r=k===d,b.count&&0<b.count?k=Math.min(k+b.count,d):k++);d=!1;if(r){if(b.select||e.isMac||e.isLinux)c.extend(a.getCharCount()),d=!0}else m.lineIndex!==k&&(m.destroy(),m=this._getLine(k)),c.extend(m.getOffset(h,f)),d=!0;d&&(b.select||c.collapse(),this._setSelection(c,
+!0,!0));this._columnX=h;m.destroy();return!0},_doLineUp:function(b){var a=this._model,c=this._getSelection(),d=c.getCaret(),k=a.getLineAtOffset(d),m=this._getLine(k),h=this._columnX,f=!1,r;if(-1===h||b.wholeLine||b.select&&e.isIE)h=b.wholeLine?a.getLineStart(k-1):d,h=m.getBoundingClientRect(h).left;0<(d=m.getLineIndex(d))?r=m.getClientRects(d-1).top+1:(f=0===k,f||(b.count&&0<b.count?k=Math.max(k-b.count,0):k--,r=this._getLineHeight(k)-1));d=!1;if(f){if(b.select||e.isMac||e.isLinux)c.extend(0),d=!0}else m.lineIndex!==
+k&&(m.destroy(),m=this._getLine(k)),c.extend(m.getOffset(h,r)),d=!0;d&&(b.select||c.collapse(),this._setSelection(c,!0,!0));this._columnX=h;m.destroy();return!0},_doNoop:function(){return!0},_doPageDown:function(b){var a=this,c=this._model,d=this._getSelection(),k=d.getCaret(),m=c.getLineAtOffset(k),h=c.getLineCount(),f=this._getScroll(),c=this._getClientHeight(),r,g;if(this._lineHeight){r=this._columnX;f=this._getBoundsAtOffset(k);if(-1===r||b.select&&e.isIE)r=f.left;k=this._getLineIndex(f.top+c);
+g=this._getLine(k);m=this._getLinePixel(k);k=g.getOffset(r,f.top+c-m);c=g.getBoundingClientRect(k);g.destroy();d.extend(k);b.select||d.collapse();this._setSelection(d,!0,!0,function(){a._columnX=r},c.top+m-f.top);return!0}if(m<h-1){var l=this._getLineHeight(),s=Math.min(h-m-1,Math.floor(c/l)),s=Math.max(1,s);r=this._columnX;if(-1===r||b.select&&e.isIE)g=this._getLine(m),r=g.getBoundingClientRect(k).left,g.destroy();g=this._getLine(m+s);d.extend(g.getOffset(r,0));g.destroy();b.select||d.collapse();
+b=h*l;k=f.y+s*l;k+c>b&&(k=b-c);this._setSelection(d,!0,!0,function(){a._columnX=r},k-f.y)}return!0},_doPageUp:function(b){var a=this,c=this._model,d=this._getSelection(),k=d.getCaret(),m=c.getLineAtOffset(k),h=this._getScroll(),f=this._getClientHeight(),r;if(this._lineHeight){r=this._columnX;h=this._getBoundsAtOffset(k);if(-1===r||b.select&&e.isIE)r=h.left;k=this._getLineIndex(h.bottom-f);c=this._getLine(k);m=this._getLinePixel(k);k=c.getOffset(r,h.bottom-f-m);f=c.getBoundingClientRect(k);c.destroy();
+d.extend(k);b.select||d.collapse();this._setSelection(d,!0,!0,function(){a._columnX=r},f.top+m-h.top);return!0}if(0<m){var g=this._getLineHeight(),f=Math.max(1,Math.min(m,Math.floor(f/g)));r=this._columnX;if(-1===r||b.select&&e.isIE)c=this._getLine(m),r=c.getBoundingClientRect(k).left,c.destroy();c=this._getLine(m-f);d.extend(c.getOffset(r,this._getLineHeight(m-f)-1));c.destroy();b.select||d.collapse();b=Math.max(0,h.y-f*g);this._setSelection(d,!0,!0,function(){a._columnX=r},b-h.y)}return!0},_doPaste:function(b){var a=
+this;return null!==this._getClipboardText(b,function(b){b&&(e.isLinux&&2===a._lastMouseButton&&(new Date).getTime()-a._lastMouseTime<=a._clickTime&&a._setSelectionTo(a._lastMouseX,a._lastMouseY),a._doContent(b))})},_doScroll:function(b){var a=b.type,c=this._model,d=c.getLineCount(),b=this._getClientHeight(),k=this._getLineHeight(),d=d*k,e=this._getScroll().y,m;switch(a){case "textStart":m=0;break;case "textEnd":m=d-b;break;case "pageDown":m=e+b;break;case "pageUp":m=e-b;break;case "lineDown":m=e+
+k;break;case "lineUp":m=e-k;break;case "centerLine":a=this._getSelection(),m=c.getLineAtOffset(a.start),c=(c.getLineAtOffset(a.end)-m+1)*k,m=m*k-b/2+c/2}void 0!==m&&(m=Math.min(Math.max(0,m),d-b),this._scrollViewAnimated(0,m-e,function(){}));return!0},_doSelectAll:function(){var b=this._model,a=this._getSelection();a.setCaret(0);a.extend(b.getCharCount());this._setSelection(a,!1);return!0},_doTab:function(){if(this._tabMode&&!this._readonly){var b="\t";if(this._expandTab)var a=this._model,b=this._getSelection().getCaret(),
+c=a.getLineAtOffset(b),a=a.getLineStart(c),b=Array(this._tabSize-(b-a)%this._tabSize+1).join(" ");this._doContent(b);return!0}},_doShiftTab:function(){if(this._tabMode&&!this._readonly)return!0},_doOverwriteMode:function(){if(!this._readonly)return this.setOptions({overwriteMode:!this.getOptions("overwriteMode")}),!0},_doTabMode:function(){this._tabMode=!this._tabMode;return!0},_doWrapMode:function(){this.setOptions({wrapMode:!this.getOptions("wrapMode")});return!0},_autoScroll:function(){var b=this._model,
+a=this._getSelection(),c=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),d=a.getCaret(),k=b.getLineCount(),m=b.getLineAtOffset(d),h;if("up"===this._autoScrollDir||"down"===this._autoScrollDir)d=this._autoScrollY/this._getLineHeight(),d=0>d?Math.floor(d):Math.ceil(d),h=Math.max(0,Math.min(k-1,m+d));else if("left"===this._autoScrollDir||"right"===this._autoScrollDir)h=this._getLineIndex(c.y),m=this._getLine(m),c.x+=m.getBoundingClientRect(d,!1).left,m.destroy();0===h&&(e.isMac||
+e.isLinux)?a.extend(0):h===k-1&&(e.isMac||e.isLinux)?a.extend(b.getCharCount()):(m=this._getLine(h),a.extend(m.getOffset(c.x,c.y-this._getLinePixel(h))),m.destroy());this._setSelection(a,!0)},_autoScrollTimer:function(){this._autoScroll();var b=this;this._autoScrollTimerID=this._getWindow().setTimeout(function(){b._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeightTimer:function(b){if(this._lineHeight&&!this._calculateLHTimer){var a=this._model.getLineCount(),c=0;if(b){for(var b=0,d=
+(new Date).getTime(),k=0;c<a&&!(this._lineHeight[c]||(b++,k||(k=c),this._lineHeight[c]=this._calculateLineHeight(c)),c++,100<(new Date).getTime()-d););this.redrawRulers(0,a);this._queueUpdate()}b=this._getWindow();if(c!==a){var e=this;this._calculateLHTimer=b.setTimeout(function(){e._calculateLHTimer=null;e._calculateLineHeightTimer(!0)},0)}else this._calculateLHTimer&&(b.clearTimeout(this._calculateLHTimer),this._calculateLHTimer=void 0)}},_calculateLineHeight:function(b){var b=this._getLine(b),
+a=b.getBoundingClientRect();b.destroy();return Math.max(1,a.bottom-a.top)},_calculateMetrics:function(){var b=this._clientDiv,a=b.ownerDocument,c=e.createElement(a,"div");c.style.lineHeight="normal";var k={type:"LineStyle",textView:this,"0":0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(k);d(k.style,c);c.style.position="fixed";c.style.left="-1000px";var h=e.createElement(a,"span");h.appendChild(a.createTextNode(" "));c.appendChild(h);var f=e.createElement(a,"span");f.style.fontStyle=
+"italic";f.appendChild(a.createTextNode(" "));c.appendChild(f);var g=e.createElement(a,"span");g.style.fontWeight="bold";g.appendChild(a.createTextNode(" "));c.appendChild(g);k=e.createElement(a,"span");k.style.fontWeight="bold";k.style.fontStyle="italic";k.appendChild(a.createTextNode(" "));c.appendChild(k);b.appendChild(c);var l=c.getBoundingClientRect(),h=h.getBoundingClientRect(),f=f.getBoundingClientRect(),g=g.getBoundingClientRect(),k=k.getBoundingClientRect(),h=h.bottom-h.top,f=f.bottom-f.top,
+g=g.bottom-g.top,s=k.bottom-k.top,t=0,k=0>=l.bottom-l.top,l=Math.max(1,l.bottom-l.top);f>h&&(t=1);g>f&&(t=2);s>g&&(t=3);var v;0!==t&&(v={style:{}},0!==(t&1)&&(v.style.fontStyle="italic"),0!==(t&2)&&(v.style.fontWeight="bold"));h=r(c);b.removeChild(c);s=m(this._viewDiv);c=e.createElement(a,"div");c.style.position="fixed";c.style.left="-1000px";c.style.paddingLeft=s.left+"px";c.style.paddingTop=s.top+"px";c.style.paddingRight=s.right+"px";c.style.paddingBottom=s.bottom+"px";c.style.width="100px";c.style.height=
+"100px";s=e.createElement(a,"div");s.style.width="100%";s.style.height="100%";c.appendChild(s);b.appendChild(c);t=c.getBoundingClientRect();f=s.getBoundingClientRect();g=0;this._singleMode||(c.style.overflow="hidden",s.style.height="200px",g=c.clientWidth,c.style.overflow="scroll",g-=c.clientWidth);b.removeChild(c);s={left:f.left-t.left,top:f.top-t.top,right:t.right-f.right,bottom:t.bottom-f.bottom};f=t=0;if(!k&&(this._wrapOffset||this._marginOffset))c=e.createElement(a,"div"),c.style.position="fixed",
+c.style.left="-1000px",c.innerHTML=Array(this._wrapOffset+1).join(" "),b.appendChild(c),t=c.getBoundingClientRect(),t=Math.ceil(t.right-t.left),c.innerHTML=Array(this._marginOffset+1).join(" "),f=c.getBoundingClientRect(),f=Math.ceil(f.right-f.left),b.removeChild(c);return{lineHeight:l,largestFontStyle:v,lineTrim:h,viewPadding:s,scrollWidth:g,wrapWidth:t,marginWidth:f,invalid:k}},_cancelAnimation:function(){this._animation&&(this._animation.stop(),this._animation=null)},_clearSelection:function(b){var a=
+this._getSelection();if(a.isEmpty())return!1;"next"===b?a.start=a.end:a.end=a.start;this._setSelection(a,!0);return!0},_commitIME:function(){if(-1!==this._imeOffset){this._scrollDiv.focus();this._clientDiv.focus();var b=this._model,a=b.getLineAtOffset(this._imeOffset),c=b.getLineStart(a),d=this._getDOMText(this._getLineNode(a)).text,b=b.getLine(a),c=this._imeOffset-c,b=c+d.length-b.length;c!==b&&(d=d.substring(c,b),this._doContent(d));this._imeOffset=-1}},_createActions:function(){this.addKeyMode(new p.DefaultKeyMode(this));
+var b=this;this._actions={noop:{defaultHandler:function(){return b._doNoop()}},lineUp:{defaultHandler:function(a){return b._doLineUp(c(a,{select:!1}))},actionDescription:{name:g.lineUp}},lineDown:{defaultHandler:function(a){return b._doLineDown(c(a,{select:!1}))},actionDescription:{name:g.lineDown}},lineStart:{defaultHandler:function(a){return b._doHome(c(a,{select:!1,ctrl:!1}))},actionDescription:{name:g.lineStart}},lineEnd:{defaultHandler:function(a){return b._doEnd(c(a,{select:!1,ctrl:!1}))},actionDescription:{name:g.lineEnd}},
+charPrevious:{defaultHandler:function(a){return b._doCursorPrevious(c(a,{select:!1,unit:"character"}))},actionDescription:{name:g.charPrevious}},charNext:{defaultHandler:function(a){return b._doCursorNext(c(a,{select:!1,unit:"character"}))},actionDescription:{name:g.charNext}},pageUp:{defaultHandler:function(a){return b._doPageUp(c(a,{select:!1}))},actionDescription:{name:g.pageUp}},pageDown:{defaultHandler:function(a){return b._doPageDown(c(a,{select:!1}))},actionDescription:{name:g.pageDown}},scrollPageUp:{defaultHandler:function(a){return b._doScroll(c(a,
+{type:"pageUp"}))},actionDescription:{name:g.scrollPageUp}},scrollPageDown:{defaultHandler:function(a){return b._doScroll(c(a,{type:"pageDown"}))},actionDescription:{name:g.scrollPageDown}},scrollLineUp:{defaultHandler:function(a){return b._doScroll(c(a,{type:"lineUp"}))},actionDescription:{name:g.scrollLineUp}},scrollLineDown:{defaultHandler:function(a){return b._doScroll(c(a,{type:"lineDown"}))},actionDescription:{name:g.scrollLineDown}},wordPrevious:{defaultHandler:function(a){return b._doCursorPrevious(c(a,
+{select:!1,unit:"word"}))},actionDescription:{name:g.wordPrevious}},wordNext:{defaultHandler:function(a){return b._doCursorNext(c(a,{select:!1,unit:"word"}))},actionDescription:{name:g.wordNext}},textStart:{defaultHandler:function(a){return b._doHome(c(a,{select:!1,ctrl:!0}))},actionDescription:{name:g.textStart}},textEnd:{defaultHandler:function(a){return b._doEnd(c(a,{select:!1,ctrl:!0}))},actionDescription:{name:g.textEnd}},scrollTextStart:{defaultHandler:function(a){return b._doScroll(c(a,{type:"textStart"}))},
+actionDescription:{name:g.scrollTextStart}},scrollTextEnd:{defaultHandler:function(a){return b._doScroll(c(a,{type:"textEnd"}))},actionDescription:{name:g.scrollTextEnd}},centerLine:{defaultHandler:function(a){return b._doScroll(c(a,{type:"centerLine"}))},actionDescription:{name:g.centerLine}},selectLineUp:{defaultHandler:function(a){return b._doLineUp(c(a,{select:!0}))},actionDescription:{name:g.selectLineUp}},selectLineDown:{defaultHandler:function(a){return b._doLineDown(c(a,{select:!0}))},actionDescription:{name:g.selectLineDown}},
+selectWholeLineUp:{defaultHandler:function(a){return b._doLineUp(c(a,{select:!0,wholeLine:!0}))},actionDescription:{name:g.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(a){return b._doLineDown(c(a,{select:!0,wholeLine:!0}))},actionDescription:{name:g.selectWholeLineDown}},selectLineStart:{defaultHandler:function(a){return b._doHome(c(a,{select:!0,ctrl:!1}))},actionDescription:{name:g.selectLineStart}},selectLineEnd:{defaultHandler:function(a){return b._doEnd(c(a,{select:!0,ctrl:!1}))},
+actionDescription:{name:g.selectLineEnd}},selectCharPrevious:{defaultHandler:function(a){return b._doCursorPrevious(c(a,{select:!0,unit:"character"}))},actionDescription:{name:g.selectCharPrevious}},selectCharNext:{defaultHandler:function(a){return b._doCursorNext(c(a,{select:!0,unit:"character"}))},actionDescription:{name:g.selectCharNext}},selectPageUp:{defaultHandler:function(a){return b._doPageUp(c(a,{select:!0}))},actionDescription:{name:g.selectPageUp}},selectPageDown:{defaultHandler:function(a){return b._doPageDown(c(a,
+{select:!0}))},actionDescription:{name:g.selectPageDown}},selectWordPrevious:{defaultHandler:function(a){return b._doCursorPrevious(c(a,{select:!0,unit:"word"}))},actionDescription:{name:g.selectWordPrevious}},selectWordNext:{defaultHandler:function(a){return b._doCursorNext(c(a,{select:!0,unit:"word"}))},actionDescription:{name:g.selectWordNext}},selectTextStart:{defaultHandler:function(a){return b._doHome(c(a,{select:!0,ctrl:!0}))},actionDescription:{name:g.selectTextStart}},selectTextEnd:{defaultHandler:function(a){return b._doEnd(c(a,
+{select:!0,ctrl:!0}))},actionDescription:{name:g.selectTextEnd}},deletePrevious:{defaultHandler:function(a){return b._doBackspace(c(a,{unit:"character"}))},actionDescription:{name:g.deletePrevious}},deleteNext:{defaultHandler:function(a){return b._doDelete(c(a,{unit:"character"}))},actionDescription:{name:g.deleteNext}},deleteWordPrevious:{defaultHandler:function(a){return b._doBackspace(c(a,{unit:"word"}))},actionDescription:{name:g.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(a){return b._doDelete(c(a,
+{unit:"word"}))},actionDescription:{name:g.deleteWordNext}},deleteLineStart:{defaultHandler:function(a){return b._doBackspace(c(a,{unit:"line"}))},actionDescription:{name:g.deleteLineStart}},deleteLineEnd:{defaultHandler:function(a){return b._doDelete(c(a,{unit:"line"}))},actionDescription:{name:g.deleteLineEnd}},tab:{defaultHandler:function(){return b._doTab()},actionDescription:{name:g.tab}},shiftTab:{defaultHandler:function(){return b._doShiftTab()},actionDescription:{name:g.shiftTab}},enter:{defaultHandler:function(){return b._doEnter()},
+actionDescription:{name:g.enter}},enterNoCursor:{defaultHandler:function(a){return b._doEnter(c(a,{noCursor:!0}))},actionDescription:{name:g.enterNoCursor}},selectAll:{defaultHandler:function(){return b._doSelectAll()},actionDescription:{name:g.selectAll}},copy:{defaultHandler:function(){return b._doCopy()},actionDescription:{name:g.copy}},cut:{defaultHandler:function(){return b._doCut()},actionDescription:{name:g.cut}},paste:{defaultHandler:function(){return b._doPaste()},actionDescription:{name:g.paste}},
+uppercase:{defaultHandler:function(a){return b._doCase(c(a,{type:"upper"}))},actionDescription:{name:g.uppercase}},lowercase:{defaultHandler:function(a){return b._doCase(c(a,{type:"lower"}))},actionDescription:{name:g.lowercase}},capitalize:{defaultHandler:function(a){return b._doCase(c(a,{unit:"word",type:"capitalize"}))},actionDescription:{name:g.capitalize}},reversecase:{defaultHandler:function(a){return b._doCase(c(a,{type:"reverse"}))},actionDescription:{name:g.reversecase}},toggleOverwriteMode:{defaultHandler:function(){return b._doOverwriteMode()},
+actionDescription:{name:g.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(){return b._doTabMode()},actionDescription:{name:g.toggleTabMode}},toggleWrapMode:{defaultHandler:function(){return b._doWrapMode()},actionDescription:{name:g.toggleWrapMode}}}},_createRulerParent:function(b){var a=e.createElement(document,"div");a.className=b;a.tabIndex=-1;a.style.overflow="hidden";a.style.MozUserSelect="none";a.style.WebkitUserSelect="none";a.style.position="absolute";a.style.top="0px";a.style.bottom=
+"0px";a.style.cursor="default";a.style.display="none";a.setAttribute("aria-hidden","true");this._rootDiv.appendChild(a);return a},_createRuler:function(b,a){if(this._clientDiv){var c=this._getRulerParent(b);if(c){if(c!==this._marginDiv||this._marginOffset)c.style.display="block";var d=e.createElement(c.ownerDocument,"div");d._ruler=b;d.rulerChanged=!0;d.style.position="relative";d.style.cssFloat="left";d.style.styleFloat="left";d.style.outline="none";if(void 0===a||0>a||a>=c.children.length)c.appendChild(d);
+else{for(var k=c.firstChild;k&&0<a--;)k=k.nextSibling;c.insertBefore(d,k)}}}},_createView:function(){if(!this._clientDiv){for(var b=this._parent;b.hasChildNodes();)b.removeChild(b.lastChild);var a=b.ownerDocument,c=e.createElement(a,"div");this._rootDiv=c;c.tabIndex=-1;c.style.position="relative";c.style.overflow="hidden";c.style.width="100%";c.style.height="100%";c.style.overflow="hidden";c.style.WebkitTextSizeAdjust="100%";c.setAttribute("role","application");b.appendChild(c);this._leftDiv=this._createRulerParent("textviewLeftRuler");
+b=e.createElement(a,"div");b.className="textviewScroll";this._viewDiv=b;b.tabIndex=-1;b.style.position="absolute";b.style.top="0px";b.style.bottom="0px";b.style.borderWidth="0px";b.style.margin="0px";b.style.outline="none";b.style.background="transparent";e.isMac&&e.isWebkit&&(b.style.pointerEvents="none",b.style.zIndex="2");c.appendChild(b);var d=this._createRulerParent("textviewRightRuler");this._rightDiv=d;d.style.right="0px";this._scrollDiv=d=e.createElement(a,"div");d.style.margin="0px";d.style.borderWidth=
+"0px";d.style.padding="0px";b.appendChild(d);(this._marginDiv=this._createRulerParent("textviewMarginRuler")).style.zIndex="4";!e.isIE&&!e.isIOS&&(this._clipDiv=b=e.createElement(a,"div"),b.style.position="absolute",b.style.overflow="hidden",b.style.margin="0px",b.style.borderWidth="0px",b.style.padding="0px",b.style.background="transparent",c.appendChild(b),this._clipScrollDiv=d=e.createElement(a,"div"),d.style.position="absolute",d.style.height="1px",d.style.top="-1000px",d.style.background="transparent",
+b.appendChild(d));this._setFullSelection(this._fullSelection,!0);b=e.createElement(a,"div");b.className="textviewContent";this._clientDiv=b;b.tabIndex=0;b.style.position="absolute";b.style.borderWidth="0px";b.style.margin="0px";b.style.padding="0px";b.style.outline="none";b.style.zIndex="1";b.style.WebkitUserSelect="text";b.setAttribute("spellcheck","false");if(e.isIOS||e.isAndroid)b.style.WebkitTapHighlightColor="transparent";(this._clipDiv||c).appendChild(b);if(e.isIOS||e.isAndroid)this._vScrollDiv=
+d=e.createElement(a,"div"),d.style.position="absolute",d.style.borderWidth="1px",d.style.borderColor="white",d.style.borderStyle="solid",d.style.borderRadius="4px",d.style.backgroundColor="black",d.style.opacity="0.5",d.style.margin="0px",d.style.padding="0px",d.style.outline="none",d.style.zIndex="3",d.style.width="8px",d.style.display="none",c.appendChild(d),this._hScrollDiv=d=e.createElement(a,"div"),d.style.position="absolute",d.style.borderWidth="1px",d.style.borderColor="white",d.style.borderStyle=
+"solid",d.style.borderRadius="4px",d.style.backgroundColor="black",d.style.opacity="0.5",d.style.margin="0px",d.style.padding="0px",d.style.outline="none",d.style.zIndex="3",d.style.height="8px",d.style.display="none",c.appendChild(d);e.isFirefox&&!b.setCapture&&(this._overlayDiv=a=e.createElement(a,"div"),a.style.position=b.style.position,a.style.borderWidth=b.style.borderWidth,a.style.margin=b.style.margin,a.style.padding=b.style.padding,a.style.cursor="text",a.style.zIndex="2",(this._clipDiv||
+c).appendChild(a));b.contentEditable="true";b.setAttribute("role","textbox");b.setAttribute("aria-multiline","true");this._setWrapMode(this._wrapMode,!0);this._setReadOnly(this._readonly);this._setThemeClass(this._themeClass,!0);this._setTabSize(this._tabSize,!0);this._setMarginOffset(this._marginOffset,!0);this._hookEvents();c=this._rulers;for(a=0;a<c.length;a++)this._createRuler(c[a]);this._update()}},_defaultOptions:function(){return{parent:{value:void 0,update:null},model:{value:void 0,update:this.setModel},
 scrollAnimation:{value:0,update:null},readonly:{value:!1,update:this._setReadOnly},fullSelection:{value:!0,update:this._setFullSelection},tabMode:{value:!0,update:null},tabSize:{value:8,update:this._setTabSize},expandTab:{value:!1,update:null},singleMode:{value:!1,update:this._setSingleMode},overwriteMode:{value:!1,update:this._setOverwriteMode},blockCursorVisible:{value:!1,update:this._setBlockCursor},marginOffset:{value:0,update:this._setMarginOffset},wrapOffset:{value:0,update:this._setWrapOffset},
-wrapMode:{value:!1,update:this._setWrapMode},wrappable:{value:!1,update:null},theme:{value:l.TextTheme.getTheme(),update:this._setTheme},themeClass:{value:void 0,update:this._setThemeClass}}},_destroyRuler:function(a){var c=this._getRulerParent(a);if(c)for(var b=c.firstChild;b;){if(b._ruler===a){b._ruler=void 0;c.removeChild(b);if(0===c.children.length&&(c!==this._marginDiv||!this._marginOffset))c.style.display="none";break}b=b.nextSibling}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);
-this._unhookEvents();var a=this._getWindow();this._autoScrollTimerID&&(a.clearTimeout(this._autoScrollTimerID),this._autoScrollTimerID=null);this._updateTimer&&(a.clearTimeout(this._updateTimer),this._updateTimer=null);a=this._rootDiv;a.parentNode.removeChild(a);this._hScrollDiv=this._vScrollDiv=this._cursorDiv=this._marginDiv=this._rightDiv=this._leftDiv=this._overlayDiv=this._clientDiv=this._clipScrollDiv=this._clipDiv=this._viewDiv=this._scrollDiv=this._rootDiv=this._clipboardDiv=this._selDiv3=
-this._selDiv2=this._selDiv1=null}},_doAutoScroll:function(a,c,b){this._autoScrollDir=a;this._autoScrollX=c;this._autoScrollY=b;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&this._getWindow().clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=this._autoScrollDir=void 0},_fixCaret:function(){var a=this._clientDiv;if(a){var c=this._hasFocus;this._ignoreFocus=!0;c&&a.blur();a.contentEditable=!1;a.contentEditable=!0;c&&a.focus();this._ignoreFocus=
-!1}},_getBaseText:function(a,c){var b=this._model;b.getBaseModel&&(a=b.mapOffset(a),c=b.mapOffset(c),b=b.getBaseModel());return b.getText(a,c)},_getBottomIndex:function(a){var c=this._bottomChild;if(a&&this._getClientHeight()>this._getLineHeight()){var a=c.getBoundingClientRect(),b=this._clientDiv.getBoundingClientRect();a.bottom>b.bottom&&(c=this._getLinePrevious(c)||c)}return c.lineIndex},_getBoundsAtOffset:function(a){var c=this._getLine(this._model.getLineAtOffset(a)),a=c.getBoundingClientRect(a),
-b=this._getLinePixel(c.lineIndex);a.top+=b;a.bottom+=b;c.destroy();return a},_getClientHeight:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-a.top-a.bottom)},_getClientWidth:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientWidth-a.left-a.right)},_getClipboardText:function(a,c){var b=this._model.getLineDelimiter(),d,m,h=this._getWindow(),f=h.clipboardData;!f&&a&&(f=a.clipboardData);if(f)return d=[],m=f.getData(e.isIE?"Text":"text/plain"),
-k(m,function(a){d.push(a)},function(){d.push(b)}),m=d.join(""),c&&c(m),m;if(e.isFirefox){this._ignoreFocus=!0;var r=this._clipboardDiv,f=this._rootDiv.ownerDocument;r||(this._clipboardDiv=r=e.createElement(f,"div"),r.style.position="fixed",r.style.whiteSpace="pre",r.style.left="-1000px",this._rootDiv.appendChild(r));r.innerHTML="<pre contenteditable=''></pre>";r.firstChild.focus();var g=this,l=function(){var a=g._getTextFromElement(r);r.innerHTML="";d=[];k(a,function(a){d.push(a)},function(){d.push(b)});
-return d.join("")},s=!1;this._ignorePaste=!0;if(!e.isLinux||2!==this._lastMouseButton)try{s=f.execCommand("paste",!1,null)}catch(t){s=1<r.childNodes.length||r.firstChild&&0<r.firstChild.childNodes.length}this._ignorePaste=!1;if(!s){if(a)return h.setTimeout(function(){g.focus();(m=l())&&c&&c(m);g._ignoreFocus=!1},0),null;this.focus();this._ignoreFocus=!1;return""}this.focus();this._ignoreFocus=!1;(m=l())&&c&&c(m);return m}return""},_getDOMText:function(a,c){for(var b=a.firstChild,d="",k=0;b;){var e;
-if(!b.ignore)if(b.ignoreChars){e=b.lastChild;for(var m=0,h=[],f=-1;e;){var r=e.data;if(r)for(var g=r.length-1;0<=g;g--){var l=r.substring(g,g+1);m<b.ignoreChars&&(" "===l||"\u200b"===l||"\ufeff"===l)?m++:h.push("\u00a0"===l?"\t":l)}c===e&&(f=h.length);e=e.previousSibling}h=h.reverse().join("");-1!==f&&(k=d.length+h.length-f);d+=h}else for(e=b.firstChild;e;)c===e&&(k=d.length),d+=e.data,e=e.nextSibling;b=b.nextSibling}return{text:d,offset:k}},_getTextFromElement:function(a){var c=a.ownerDocument,b=
-c.defaultView;if(!b.getSelection)return a.innerText||a.textContent;c=c.createRange();c.selectNode(a);var a=b.getSelection(),b=[],d;for(d=0;d<a.rangeCount;d++)b.push(a.getRangeAt(d));this._ignoreSelect=!0;a.removeAllRanges();a.addRange(c);c=a.toString();a.removeAllRanges();for(d=0;d<b.length;d++)a.addRange(b[d]);this._ignoreSelect=!1;return c},_getViewPadding:function(){return this._metrics.viewPadding},_getLine:function(a){var c=this._getLineNode(a);return c&&!c.lineChanged&&!c.lineRemoved?c._line:
-new t(this,a)},_getLineHeight:function(a,c){if(void 0!==a&&this._lineHeight){var b=this._lineHeight[a];if(b)return b;if(c||void 0===c)return this._lineHeight[a]=this._calculateLineHeight(a)}return this._metrics.lineHeight},_getLineNode:function(a){for(var c=this._clientDiv.firstChild;c;){if(a===c.lineIndex)return c;c=c.nextSibling}},_getLineNext:function(a){for(a=a?a.nextSibling:this._clientDiv.firstChild;a&&-1===a.lineIndex;)a=a.nextSibling;return a},_getLinePrevious:function(a){for(a=a?a.previousSibling:
-this._clientDiv.lastChild;a&&-1===a.lineIndex;)a=a.previousSibling;return a},_getLinePixel:function(a){a=Math.min(Math.max(0,a),this._model.getLineCount());if(this._lineHeight){var c=this._getTopIndex(),b=-this._topIndexY+this._getScroll().y;if(a>c)for(;c<a;c++)b+=this._getLineHeight(c);else for(c-=1;c>=a;c--)b-=this._getLineHeight(c);return b}return this._getLineHeight()*a},_getLineIndex:function(a){var c,b=0,d=this._model.getLineCount();if(this._lineHeight){var b=this._getTopIndex(),k=-this._topIndexY+
-this._getScroll().y;if(a!==k)if(a<k)for(;a<k&&0<b;)a+=this._getLineHeight(--b);else for(c=this._getLineHeight(b);a-c>=k&&b<d-1;)a-=c,c=this._getLineHeight(++b)}else c=this._getLineHeight(),b=Math.floor(a/c);return Math.max(0,Math.min(d-1,b))},_getRulerParent:function(a){switch(a.getLocation()){case "left":return this._leftDiv;case "right":return this._rightDiv;case "margin":return this._marginDiv}return null},_getScroll:function(a){(void 0===a||a)&&this._cancelAnimation();a=this._viewDiv;return{x:a.scrollLeft,
-y:a.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(a){var c=this._topChild;if(a&&this._getClientHeight()>this._getLineHeight()){var a=c.getBoundingClientRect(),b=this._getViewPadding(),d=this._viewDiv.getBoundingClientRect();a.top<d.top+b.top&&(c=this._getLineNext(c)||c)}return c.lineIndex},_hookEvents:function(){var a=this;this._modelListener={onChanging:function(c){a._onModelChanging(c)},onChanged:function(c){a._onModelChanged(c)}};this._model.addEventListener("preChanging",
-this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._themeListener={onChanged:function(){a._setThemeClass(a._themeClass)}};this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);var c=this._handlers=[],b=this._clientDiv,d=this._viewDiv,k=this._rootDiv,m=this._overlayDiv||b,h=b.ownerDocument,f=this._getWindow(),r=e.isIE?h:f;c.push({target:f,type:"resize",handler:function(c){return a._handleResize(c?c:f.event)}});c.push({target:b,
-type:"blur",handler:function(c){return a._handleBlur(c?c:f.event)}});c.push({target:b,type:"focus",handler:function(c){return a._handleFocus(c?c:f.event)}});c.push({target:d,type:"focus",handler:function(){b.focus()}});c.push({target:d,type:"scroll",handler:function(c){return a._handleScroll(c?c:f.event)}});c.push({target:b,type:"textInput",handler:function(c){return a._handleTextInput(c?c:f.event)}});c.push({target:b,type:"keydown",handler:function(c){return a._handleKeyDown(c?c:f.event)}});c.push({target:b,
-type:"keypress",handler:function(c){return a._handleKeyPress(c?c:f.event)}});c.push({target:b,type:"keyup",handler:function(c){return a._handleKeyUp(c?c:f.event)}});e.isIE&&c.push({target:h,type:"keyup",handler:function(c){return a._handleDocKeyUp(c?c:f.event)}});c.push({target:b,type:"contextmenu",handler:function(c){return a._handleContextMenu(c?c:f.event)}});c.push({target:b,type:"copy",handler:function(c){return a._handleCopy(c?c:f.event)}});c.push({target:b,type:"cut",handler:function(c){return a._handleCut(c?
-c:f.event)}});c.push({target:b,type:"paste",handler:function(c){return a._handlePaste(c?c:f.event)}});if(e.isIOS||e.isAndroid)c.push({target:h,type:"selectionchange",handler:function(c){return a._handleSelectionChange(c?c:f.event)}}),c.push({target:b,type:"touchstart",handler:function(c){return a._handleTouchStart(c?c:f.event)}}),c.push({target:b,type:"touchmove",handler:function(c){return a._handleTouchMove(c?c:f.event)}}),c.push({target:b,type:"touchend",handler:function(c){return a._handleTouchEnd(c?
-c:f.event)}});else{c.push({target:b,type:"selectstart",handler:function(c){return a._handleSelectStart(c?c:f.event)}});c.push({target:b,type:"mousedown",handler:function(c){return a._handleMouseDown(c?c:f.event)}});c.push({target:b,type:"mouseover",handler:function(c){return a._handleMouseOver(c?c:f.event)}});c.push({target:b,type:"mouseout",handler:function(c){return a._handleMouseOut(c?c:f.event)}});c.push({target:r,type:"mouseup",handler:function(c){return a._handleMouseUp(c?c:f.event)}});c.push({target:r,
-type:"mousemove",handler:function(c){return a._handleMouseMove(c?c:f.event)}});c.push({target:k,type:"mousedown",handler:function(c){return a._handleRootMouseDown(c?c:f.event)}});c.push({target:k,type:"mouseup",handler:function(c){return a._handleRootMouseUp(c?c:f.event)}});c.push({target:m,type:"dragstart",handler:function(c){return a._handleDragStart(c?c:f.event)}});c.push({target:m,type:"drag",handler:function(c){return a._handleDrag(c?c:f.event)}});c.push({target:m,type:"dragend",handler:function(c){return a._handleDragEnd(c?
-c:f.event)}});c.push({target:m,type:"dragenter",handler:function(c){return a._handleDragEnter(c?c:f.event)}});c.push({target:m,type:"dragover",handler:function(c){return a._handleDragOver(c?c:f.event)}});c.push({target:m,type:"dragleave",handler:function(c){return a._handleDragLeave(c?c:f.event)}});c.push({target:m,type:"drop",handler:function(c){return a._handleDrop(c?c:f.event)}});c.push({target:this._clientDiv,type:e.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(c){return a._handleMouseWheel(c?
-c:f.event)}});this._clipDiv&&c.push({target:this._clipDiv,type:e.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(c){return a._handleMouseWheel(c?c:f.event)}});if(e.isFirefox&&(!e.isWindows||15<=e.isFirefox))(d=f.MutationObserver||f.MozMutationObserver)?(this._mutationObserver=new d(function(c){a._handleDataModified(c)}),this._mutationObserver.observe(b,{subtree:!0,characterData:!0})):c.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(c){return a._handleDataModified(c?
-c:f.event)}});this._overlayDiv&&(c.push({target:this._overlayDiv,type:"mousedown",handler:function(c){return a._handleMouseDown(c?c:f.event)}}),c.push({target:this._overlayDiv,type:"mouseover",handler:function(c){return a._handleMouseOver(c?c:f.event)}}),c.push({target:this._overlayDiv,type:"mouseout",handler:function(c){return a._handleMouseOut(c?c:f.event)}}),c.push({target:this._overlayDiv,type:"contextmenu",handler:function(c){return a._handleContextMenu(c?c:f.event)}}));this._isW3CEvents||c.push({target:this._clientDiv,
-type:"dblclick",handler:function(c){return a._handleDblclick(c?c:f.event)}})}this._hookRulerEvents(this._leftDiv,c);this._hookRulerEvents(this._rightDiv,c);this._hookRulerEvents(this._marginDiv,c);for(d=0;d<c.length;d++)k=c[d],s(k.target,k.type,k.handler,k.capture)},_hookRulerEvents:function(a,c){if(a){var b=this,d=this._getWindow();e.isIE&&c.push({target:a,type:"selectstart",handler:function(){return!1}});c.push({target:a,type:e.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return b._handleMouseWheel(a?
-a:d.event)}});c.push({target:a,type:"click",handler:function(a){b._handleRulerEvent(a?a:d.event)}});c.push({target:a,type:"dblclick",handler:function(a){b._handleRulerEvent(a?a:d.event)}});c.push({target:a,type:"mousemove",handler:function(a){b._handleRulerEvent(a?a:d.event)}});c.push({target:a,type:"mouseover",handler:function(a){b._handleRulerEvent(a?a:d.event)}});c.push({target:a,type:"mouseout",handler:function(a){b._handleRulerEvent(a?a:d.event)}})}},_getWindow:function(){return this._parent.ownerDocument.defaultView||
-this._parent.ownerDocument.parentWindow},_ignoreEvent:function(a){for(a=a.target;a&&a!==this._clientDiv;){if(a.ignore)return!0;a=a.parentNode}return!1},_init:function(a){var c=a.parent;"string"===typeof c&&(c=(a.document||document).getElementById(c));if(!c)throw"no parent";a.parent=c;a.model=a.model||new n.TextModel;var b=this._defaultOptions(),d;for(d in b)b.hasOwnProperty(d)&&(this["_"+d]=void 0!==a[d]?a[d]:b[d].value);this._keyModes=[];this._rulers=[];this._selection=new w(0,0,!1);this._linksVisible=
-!1;this._maxLineWidth=this._redrawCount=0;this._maxLineIndex=-1;this._ignoreSelect=!0;this._hasFocus=this._ignoreFocus=!1;this._dragOffset=this._columnX=-1;this._isRangeRects=(!e.isIE||9<=e.isIE)&&"function"===typeof c.ownerDocument.createRange().getBoundingClientRect;this._isW3CEvents=c.addEventListener;this._autoScrollTimerID=this._autoScrollY=this._autoScrollX=null;this._AUTO_SCROLL_RATE=50;this._mouseUpClosure=this._moseMoveClosure=this._grabControl=null;this._clickCount=this._lastMouseTime=this._lastMouseY=
-this._lastMouseX=0;this._clickTime=250;this._clickDist=5;this._isMouseDown=!1;this._doubleClickSelection=null;this._vScroll=this._hScroll=0;this._imeOffset=-1;this._createActions();this._createView()},_modifyContent:function(a,c){if(!this._readonly||a._code)if(a.type="Verify",this.onVerify(a),!(null===a.text||void 0===a.text)){var b=this._model;try{a._ignoreDOMSelection&&(this._ignoreDOMSelection=!0),b.setText(a.text,a.start,a.end)}finally{a._ignoreDOMSelection&&(this._ignoreDOMSelection=!1)}c&&(b=
-this._getSelection(),b.setCaret(a.start+a.text.length),this._setSelection(b,!0));this.onModify({type:"Modify"})}},_onModelChanged:function(a){a.type="ModelChanged";this.onModelChanged(a);a.type="Changed";var c=a.start,b=a.addedCharCount,d=a.removedCharCount,k=a.addedLineCount,e=a.removedLineCount,m=this._getSelection();m.end>c&&(m.end>c&&m.start<c+d?m.setCaret(c+b):(m.start+=b-d,m.end+=b-d),this._setSelection(m,!1,!1));c=this._model.getLineAtOffset(c);for(b=this._getLineNext();b;)d=b.lineIndex,c<=
-d&&d<=c+e&&(c===d&&!b.modelChangedEvent&&!b.lineRemoved?(b.modelChangedEvent=a,b.lineChanged=!0):(b.lineRemoved=!0,b.lineChanged=!1,b.modelChangedEvent=null)),d>c+e&&(b.lineIndex=d+k-e,b._line.lineIndex=b.lineIndex),b=this._getLineNext(b);this._lineHeight&&(a=[c,e].concat(Array(k)),Array.prototype.splice.apply(this._lineHeight,a));!this._wrapMode&&(c<=this._maxLineIndex&&this._maxLineIndex<=c+e)&&(this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0);this._update()},
-_onModelChanging:function(a){a.type="ModelChanging";this.onModelChanging(a);a.type="Changing"},_queueUpdate:function(){if(!this._updateTimer&&!this._ignoreQueueUpdate){var a=this;this._updateTimer=this._getWindow().setTimeout(function(){a._updateTimer=null;a._update()},0)}},_resetLineHeight:function(a,c){if(this._wrapMode||this._variableLineHeight){if(void 0!==a&&void 0!==c)for(var b=a;b<c;b++)this._lineHeight[b]=void 0;else this._lineHeight=Array(this._model.getLineCount());this._calculateLineHeightTimer()}else this._lineHeight=
-null},_resetLineWidth:function(){var a=this._clientDiv;if(a)for(a=a.firstChild;a;)a.lineWidth=void 0,a=a.nextSibling},_reset:function(){this._maxLineIndex=-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._topIndexY=0;this._variableLineHeight=!1;this._resetLineHeight();this._setSelection(new w(0,0,!1),!1,!1);this._viewDiv&&(this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=0);var a=this._clientDiv;if(a){for(var c=a.firstChild;c;)c.lineRemoved=!0,c=c.nextSibling;
-e.isFirefox&&(this._ignoreFocus=!1,(c=this._hasFocus)&&a.blur(),a.contentEditable=!1,a.contentEditable=!0,c&&a.focus(),this._ignoreFocus=!1)}},_scrollViewAnimated:function(a,c,b){var d=this._getWindow();if(b&&this._scrollAnimation){var k=this;this._animation=new z({window:d,duration:this._scrollAnimation,curve:[c,0],onAnimate:function(a){a=c-Math.floor(a);k._scrollView(0,a);c-=a},onEnd:function(){k._animation=null;k._scrollView(a,c);b&&d.setTimeout(b,0)}});this._animation.play()}else this._scrollView(a,
-c),b&&d.setTimeout(b,0)},_scrollView:function(a,c){this._ensureCaretVisible=!1;var b=this._viewDiv;a&&(b.scrollLeft+=a);c&&(b.scrollTop+=c)},_setClipboardText:function(a,c){var b,d=this._getWindow(),m=d.clipboardData;!m&&c&&(m=c.clipboardData);if(m&&(b=[],k(a,function(a){b.push(a)},function(){b.push(e.platformDelimiter)}),m.setData(e.isIE?"Text":"text/plain",b.join(""))))return!0;var f=this._parent.ownerDocument,h=e.createElement(f,"pre");h.style.position="fixed";h.style.left="-1000px";k(a,function(a){h.appendChild(f.createTextNode(a))},
-function(){h.appendChild(e.createElement(f,"br"))});h.appendChild(f.createTextNode(" "));this._clientDiv.appendChild(h);m=f.createRange();m.setStart(h.firstChild,0);m.setEndBefore(h.lastChild);var r=d.getSelection();0<r.rangeCount&&r.removeAllRanges();r.addRange(m);var g=this,m=function(){h&&h.parentNode===g._clientDiv&&g._clientDiv.removeChild(h);g._updateDOMSelection()},r=!1;this._ignoreCopy=!0;try{r=f.execCommand("copy",!1,null)}catch(l){}this._ignoreCopy=!1;if(!r&&c)return d.setTimeout(m,0),!1;
-m();return!0},_setDOMSelection:function(a,c,b,d,k){for(var m,f,h,r,g=0,l=a.firstChild,s,t,u=this._model.getLine(a.lineIndex).length;l;){if(!l.ignore){s=l.firstChild;t=s.length;l.ignoreChars&&(t-=l.ignoreChars);if(g+t>c||g+t>=u){m=s;f=c-g;l.ignoreChars&&(0<t&&f===t)&&(f+=l.ignoreChars);break}g+=t}l=l.nextSibling}for(var g=0,l=b.firstChild,v=this._model.getLine(b.lineIndex).length;l;){if(!l.ignore){s=l.firstChild;t=s.length;l.ignoreChars&&(t-=l.ignoreChars);if(t+g>d||g+t>=v){h=s;r=d-g;l.ignoreChars&&
-(0<t&&r===t)&&(r+=l.ignoreChars);break}g+=t}l=l.nextSibling}this._setDOMFullSelection(a,c,u,b,d,v);a=this._getWindow();c=this._parent.ownerDocument;if(a.getSelection){b=a.getSelection();a=c.createRange();a.setStart(m,f);a.setEnd(h,r);if(this._hasFocus&&(b.anchorNode!==m||b.anchorOffset!==f||b.focusNode!==h||b.focusOffset!==r||b.anchorNode!==h||b.anchorOffset!==r||b.focusNode!==m||b.focusOffset!==f))this._anchorNode=m,this._anchorOffset=f,this._focusNode=h,this._focusOffset=r,this._ignoreSelect=!1,
-0<b.rangeCount&&b.removeAllRanges(),b.addRange(a),this._ignoreSelect=!0;this._cursorDiv&&(a=c.createRange(),k?(a.setStart(m,f),a.setEnd(m,f)):(a.setStart(h,r),a.setEnd(h,r)),h=a.getClientRects()[0],r=this._cursorDiv.parentNode,m=r.getBoundingClientRect(),h&&m&&(this._cursorDiv.style.top=h.top-m.top+r.scrollTop+"px",this._cursorDiv.style.left=h.left-m.left+r.scrollLeft+"px"))}else c.selection&&this._hasFocus&&(k=c.body,a=e.createElement(c,"div"),k.appendChild(a),k.removeChild(a),a=k.createTextRange(),
-a.moveToElementText(m.parentNode),a.moveStart("character",f),m=k.createTextRange(),m.moveToElementText(h.parentNode),m.moveStart("character",r),a.setEndPoint("EndToStart",m),this._ignoreSelect=!1,a.select(),this._ignoreSelect=!0)},_setDOMFullSelection:function(a,c,b,d,k){if(this._selDiv1&&(b=this._selDiv1,b.style.width="0px",b.style.height="0px",b=this._selDiv2,b.style.width="0px",b.style.height="0px",b=this._selDiv3,b.style.width="0px",b.style.height="0px",!(a===d&&c===k))){var e=this._model,m=this._getViewPadding(),
-f=this._clientDiv.getBoundingClientRect(),h=this._viewDiv.getBoundingClientRect(),b=h.left+m.left,r=f.right,m=h.top+m.top,g=f.bottom,h=f=0;this._clipDiv?(h=this._clipDiv.getBoundingClientRect(),f=h.left-this._clipDiv.scrollLeft):(h=this._rootDiv.getBoundingClientRect(),f=h.left);h=h.top;this._ignoreDOMSelection=!0;var l=(new t(this,a.lineIndex,a)).getBoundingClientRect(e.getLineStart(a.lineIndex)+c,!1),s=l.left,c=(new t(this,d.lineIndex,d)).getBoundingClientRect(e.getLineStart(d.lineIndex)+k,!1),
-e=c.left;this._ignoreDOMSelection=!1;var u=this._selDiv1,s=Math.min(r,Math.max(b,s)),v=Math.min(g,Math.max(m,l.top)),w=r,k=Math.min(g,Math.max(m,l.bottom));u.style.left=s-f+"px";u.style.top=v-h+"px";u.style.width=Math.max(0,w-s)+"px";u.style.height=Math.max(0,k-v)+"px";a.lineIndex===d.lineIndex?(w=Math.min(e,r),u.style.width=Math.max(0,w-s)+"px"):(l=Math.min(g,Math.max(m,c.top)),e=Math.min(r,Math.max(b,e)),m=Math.min(g,Math.max(m,c.bottom)),g=this._selDiv3,g.style.left=b-f+"px",g.style.top=l-h+"px",
-g.style.width=Math.max(0,e-b)+"px",g.style.height=Math.max(0,m-l)+"px",1<Math.abs(a.lineIndex-d.lineIndex)&&(a=this._selDiv2,a.style.left=b-f+"px",a.style.top=k-h+"px",a.style.width=Math.max(0,r-b)+"px",a.style.height=Math.max(0,l-k)+"px"))}},_setGrab:function(a){a!==this._grabControl&&(a?(a.setCapture&&a.setCapture(),this._grabControl=a):(this._grabControl.releaseCapture&&this._grabControl.releaseCapture(),this._grabControl=null))},_setLinksVisible:function(a){if(this._linksVisible!==a){this._linksVisible=
-a;e.isIE&&a&&(this._hadFocus=this._hasFocus);var c=this._clientDiv;c.contentEditable=!a;this._hadFocus&&!a&&c.focus();this._overlayDiv&&(this._overlayDiv.style.zIndex=a?"-1":"1");for(a=this._getLineNext();a;){if(a.hasLink)for(c=a.firstChild;c;)if(c.ignore)c=c.nextSibling;else{var b=c.nextSibling,d=c.viewStyle;d&&(d.tagName&&"a"===d.tagName.toLowerCase())&&a.replaceChild(a._line._createSpan(a,c.firstChild.data,d),c);c=b}a=this._getLineNext(a)}this._updateDOMSelection()}},_setSelection:function(a,c,
-b,d,k){if(a){this._columnX=-1;void 0===b&&(b=!0);var e=this._selection;this._selection=a;!1!==c&&this._showCaret(!1,d,c,k);b&&this._updateDOMSelection();if(!e.equals(a))this.onSelection({type:"Selection",oldValue:{start:e.start,end:e.end},newValue:{start:a.start,end:a.end}})}},_setSelectionTo:function(a,c,b,d){var k=this._model,e=this._getSelection(),c=this.convert({x:a,y:c},"page","document"),a=this._getLineIndex(c.y);if(1===this._clickCount){k=this._getLine(a);a=k.getOffset(c.x,c.y-this._getLinePixel(a));
-k.destroy();if(d&&!b&&e.start<=a&&a<e.end)return this._dragOffset=a,!1;e.extend(a);b||e.collapse()}else 0===(this._clickCount&1)?(k=this._getLine(a),a=k.getOffset(c.x,c.y-this._getLinePixel(a)),this._doubleClickSelection?a>=this._doubleClickSelection.start?(b=this._doubleClickSelection.start,d=k.getNextOffset(a,{unit:"wordend",count:1})):(b=k.getNextOffset(a,{unit:"word",count:-1}),d=this._doubleClickSelection.end):(b=k.getNextOffset(a,{unit:"word",count:-1}),d=k.getNextOffset(b,{unit:"wordend",count:1})),
-k.destroy()):this._doubleClickSelection?(d=k.getLineAtOffset(this._doubleClickSelection.start),a>=d?(b=k.getLineStart(d),d=k.getLineEnd(a)):(b=k.getLineStart(a),d=k.getLineEnd(d))):(b=k.getLineStart(a),d=k.getLineEnd(a)),e.setCaret(b),e.extend(d);this._setSelection(e,!0,!0);return!0},_setFullSelection:function(a,c){this._fullSelection=a;e.isWebkit&&(this._fullSelection=!0);var b=this._clipDiv||this._rootDiv;if(b)if(this._fullSelection){if(!this._selDiv1&&this._fullSelection&&!e.isIOS){var d=b.ownerDocument;
-this._highlightRGB=e.isWebkit?"transparent":"Highlight";var k=e.createElement(d,"div");this._selDiv1=k;k.style.position="absolute";k.style.borderWidth="0px";k.style.margin="0px";k.style.padding="0px";k.style.outline="none";k.style.background=this._highlightRGB;k.style.width="0px";k.style.height="0px";k.style.zIndex="0";b.appendChild(k);var m=e.createElement(d,"div");this._selDiv2=m;m.style.position="absolute";m.style.borderWidth="0px";m.style.margin="0px";m.style.padding="0px";m.style.outline="none";
-m.style.background=this._highlightRGB;m.style.width="0px";m.style.height="0px";m.style.zIndex="0";b.appendChild(m);this._selDiv3=d=e.createElement(d,"div");d.style.position="absolute";d.style.borderWidth="0px";d.style.margin="0px";d.style.padding="0px";d.style.outline="none";d.style.background=this._highlightRGB;d.style.width="0px";d.style.height="0px";d.style.zIndex="0";b.appendChild(d);if(e.isFirefox&&e.isMac){b=this._getWindow().getComputedStyle(d,null).getPropertyValue("background-color");switch(b){case "rgb(119, 141, 168)":b=
-"rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":b="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":b="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":b="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":b="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":b="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":b="rgb(232, 184, 255)";break;default:b="rgb(180, 213, 255)"}this._highlightRGB=b;k.style.background=b;m.style.background=b;d.style.background=b}c||this._updateDOMSelection()}}else this._selDiv1&&
-(b.removeChild(this._selDiv1),this._selDiv1=null),this._selDiv2&&(b.removeChild(this._selDiv2),this._selDiv2=null),this._selDiv3&&(b.removeChild(this._selDiv3),this._selDiv3=null)},_setBlockCursor:function(a){this._blockCursorVisible=a;this._updateBlockCursorVisible()},_setOverwriteMode:function(a){this._overwriteMode=a;this._updateBlockCursorVisible()},_updateBlockCursorVisible:function(){if(this._blockCursorVisible||this._overwriteMode){if(!this._cursorDiv){var a=e.createElement(document,"div");
-a.className="textviewBlockCursor";this._cursorDiv=a;a.tabIndex=-1;a.style.zIndex="2";a.style.color="transparent";a.style.position="absolute";a.style.pointerEvents="none";a.innerHTML="&nbsp;";this._viewDiv.appendChild(a);this._updateDOMSelection()}}else this._cursorDiv&&(this._cursorDiv.parentNode.removeChild(this._cursorDiv),this._cursorDiv=null)},_setMarginOffset:function(a,c){this._marginOffset=a;this._marginDiv.style.display=a?"block":"none";c||(this._metrics=this._calculateMetrics(),this._queueUpdate())},
-_setWrapOffset:function(a,c){this._wrapOffset=a;c||(this._metrics=this._calculateMetrics(),this._queueUpdate())},_setReadOnly:function(a){this._readonly=a;this._clientDiv.setAttribute("aria-readonly",a?"true":"false")},_setSingleMode:function(a,c){this._singleMode=a;this._updateOverflow();this._updateStyle(c)},_setTabSize:function(a,c){this._tabSize=a;this._customTabSize=void 0;var b=this._clientDiv;e.isOpera?b&&(b.style.OTabSize=this._tabSize+""):537.1<=e.isWebkit?b&&(b.style.tabSize=this._tabSize+
-""):4<=e.isFirefox?b&&(b.style.MozTabSize=this._tabSize+""):8!==this._tabSize&&(this._customTabSize=this._tabSize);c||(this.redrawLines(),this._resetLineWidth())},_setTheme:function(a){this._theme&&this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);(this._theme=a)&&this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);this._setThemeClass(this._themeClass)},_setThemeClass:function(a,c){this._themeClass=a;var b="textview",d=this._theme.getThemeClass();
-d&&(b+=" "+d);this._themeClass&&d!==this._themeClass&&(b+=" "+this._themeClass);this._rootDiv.className=b;this._updateStyle(c)},_setWrapMode:function(a,c){this._wrapMode=a&&this._wrappable;var b=this._clientDiv;this._wrapMode?(b.style.whiteSpace="pre-wrap",b.style.wordWrap="break-word"):(b.style.whiteSpace="pre",b.style.wordWrap="normal");this._updateOverflow();c||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a,c,b,d){if(this._clientDiv){var k=this._model,e=this._getSelection(),
-m=this._getScroll(),f=e.getCaret(),h=e.start,r=e.end,g=k.getLineAtOffset(r),l=Math.max(Math.max(h,k.getLineStart(g)),r-1),k=this._getClientWidth(),g=this._getClientHeight(),s=k/4,t=this._getBoundsAtOffset(f===h?h:l),u=t.left,v=t.right,w=t.top,y=t.bottom;a&&!e.isEmpty()&&(t=this._getBoundsAtOffset(f===r?h:l),t.top===w?f===h?v=u+Math.min(t.right-u,k):u=v-Math.min(v-t.left,k):f===h?y=w+Math.min(t.bottom-w,g):w=y-Math.min(y-t.top,g));a=0;u<m.x&&(a=Math.min(u-m.x,-s));v>m.x+k&&(a=Math.max(v-m.x-k,s));
-e=0;w<m.y?e=w-m.y:y>m.y+g&&(e=y-m.y-g);d&&(0<d?0<e&&(e=Math.max(e,d)):0>e&&(e=Math.min(e,d)));if(0!==a||0!==e)return 0!==e&&"number"===typeof b&&(0>b&&(b=0),1<b&&(b=1),e+=Math.floor(0<e?b*g:-b*g)),this._scrollViewAnimated(a,e,c),g!==this._getClientHeight()||k!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0;c&&c();return!1}},_startIME:function(){if(-1===this._imeOffset){var a=this._getSelection();a.isEmpty()||this._modifyContent({text:"",start:a.start,end:a.end},!0);this._imeOffset=
-a.start}},_unhookEvents:function(){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);this._modelListener=null;for(var a=0;a<this._handlers.length;a++){var c=this._handlers[a];u(c.target,c.type,c.handler)}this._handlers=null;this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null)},_updateDOMSelection:function(){if(!(0<
-this._redrawCount)&&!this._ignoreDOMSelection&&this._clientDiv){var a=this._getSelection(),c=this._model,b=c.getLineAtOffset(a.start),d=c.getLineAtOffset(a.end),k=this._getLineNext();if(k){var e=this._getLinePrevious(),m;b<k.lineIndex?(m=k,b=0):b>e.lineIndex?(m=e,b=0):(m=this._getLineNode(b),b=a.start-c.getLineStart(b));d<k.lineIndex?c=0:d>e.lineIndex?(k=e,c=0):(k=this._getLineNode(d),c=a.end-c.getLineStart(d));this._setDOMSelection(m,b,k,c,a.caret)}}},_update:function(a){if(!(0<this._redrawCount)){this._updateTimer&&
-(this._getWindow().clearTimeout(this._updateTimer),this._updateTimer=null,a=!1);var c=this._clientDiv,b=this._viewDiv;if(c){this._metrics.invalid&&(this._ignoreQueueUpdate=!0,this._updateStyle(),this._ignoreQueueUpdate=!1);var d=this._model,k=this._getScroll(!1),m=this._getViewPadding(),f=d.getLineCount(),h=this._getLineHeight(),r=!1,g=!1,l=!1,s=this._metrics.scrollWidth;this._wrapMode&&(c.style.width=(this._metrics.wrapWidth||this._getClientWidth())+"px");var u,v,w,y,p=0,n=0,z;if(this._lineHeight){for(;n<
-f;){z=this._getLineHeight(n);if(p+z>k.y)break;p+=z;n++}u=n;v=Math.max(0,u-1);w=d=k.y-p;0<u&&(d+=this._getLineHeight(u-1))}else y=Math.max(0,k.y)/h,u=Math.floor(y),v=Math.max(0,u-1),d=Math.round((y-v)*h),w=Math.round((y-u)*h);this._topIndexY=w;y=this._rootDiv;var Q=y.clientWidth,K=y.clientHeight;if(a){h=0;this._leftDiv&&(u=this._leftDiv.getBoundingClientRect(),h=u.right-u.left);u=this._getClientWidth();y=this._getClientHeight();g=u;this._wrapMode?this._metrics.wrapWidth&&(g=this._metrics.wrapWidth):
-g=Math.max(this._maxLineWidth,g);for(;n<f;)z=this._getLineHeight(n,!1),p+=z,n++;f=p}else{y=this._getClientHeight();w=Math.min(u+Math.floor((y+w)/h),f-1);var k=Math.min(w+1,f-1),G;for(z=c.firstChild;z;){G=z.lineIndex;var F=z.nextSibling;if(!(v<=G&&G<=k)||z.lineRemoved||-1===z.lineIndex)this._mouseWheelLine===z?(z.style.display="none",z.lineIndex=-1):c.removeChild(z);z=F}z=this._getLineNext();var F=b.ownerDocument,L=F.createDocumentFragment();for(G=v;G<=k;G++)!z||z.lineIndex>G?(new t(this,G)).create(L,
-null):(L.firstChild&&(c.insertBefore(L,z),L=F.createDocumentFragment()),z&&z.lineChanged&&(z=(new t(this,G)).create(L,z),z.lineChanged=!1),z=this._getLineNext(z));L.firstChild&&c.insertBefore(L,z);e.isWebkit&&!this._wrapMode&&(c.style.width="0x7fffffffpx");z=this._getLineNext();G=y+d;for(L=!1;z;)v=z.lineWidth,void 0===v&&(F=z._line.getBoundingClientRect(),v=z.lineWidth=Math.ceil(F.right-F.left),F=F.bottom-F.top,this._lineHeight?this._lineHeight[z.lineIndex]=F:0!==h&&(0!==F&&Math.ceil(h)!==Math.ceil(F))&&
-(this._variableLineHeight=!0,this._lineHeight=[],this._lineHeight[z.lineIndex]=F)),this._lineHeight&&!L&&(G-=this._lineHeight[z.lineIndex],0>G&&(w=z.lineIndex,L=!0)),this._wrapMode||(v>=this._maxLineWidth&&(this._maxLineWidth=v,this._maxLineIndex=z.lineIndex),this._checkMaxLineIndex===z.lineIndex&&(this._checkMaxLineIndex=-1)),z.lineIndex===u&&(this._topChild=z),z.lineIndex===w&&(this._bottomChild=z),z=this._getLineNext(z);-1!==this._checkMaxLineIndex&&(G=this._checkMaxLineIndex,this._checkMaxLineIndex=
--1,0<=G&&G<f&&(h=new t(this,G),F=h.getBoundingClientRect(),v=F.right-F.left,v>=this._maxLineWidth&&(this._maxLineWidth=v,this._maxLineIndex=G),h.destroy()));for(;n<f;)z=this._getLineHeight(n,n<=w),p+=z,n++;f=p;this._updateRuler(this._leftDiv,u,k,K);this._updateRuler(this._rightDiv,u,k,K);this._updateRuler(this._marginDiv,u,k,K);h=0;this._leftDiv&&(u=this._leftDiv.getBoundingClientRect(),h=u.right-u.left);k=0;this._rightDiv&&(k=this._rightDiv.getBoundingClientRect(),k=k.right-k.left);b.style.left=
-h+"px";b.style.right=k+"px";k=this._scrollDiv;k.style.height=f+"px";u=this._getClientWidth();!this._singleMode&&!this._wrapMode&&(p=r=y,(n="scroll"===b.style.overflowX)?r+=s:p-=s,z=w=u,(v="scroll"===b.style.overflowY)?w+=s:z-=s,y=r,u=w,f>y&&(l=!0,u=z),this._maxLineWidth>u&&(g=!0,y=p,f>y&&(l=!0,u=z)),n!==g&&(b.style.overflowX=g?"scroll":"hidden"),v!==l&&(b.style.overflowY=l?"scroll":"hidden"),r=n!==g||v!==l);l=u;this._wrapMode?this._metrics.wrapWidth&&(l=this._metrics.wrapWidth):l=Math.max(this._maxLineWidth,
-l);g=l;if((!e.isIE||9<=e.isIE)&&this._maxLineWidth>u)l+=m.right+m.left;k.style.width=l+"px";this._clipScrollDiv&&(this._clipScrollDiv.style.width=l+"px");k=this._getScroll(!1)}this._vScrollDiv&&(l=y-8,p=Math.max(15,Math.ceil(Math.min(1,l/(f+m.top+m.bottom))*l)),this._vScrollDiv.style.left=h+u-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,k.y*l/f))+"px",this._vScrollDiv.style.height=p+"px");!this._wrapMode&&this._hScrollDiv&&(l=u-8,p=Math.max(15,Math.ceil(Math.min(1,l/(this._maxLineWidth+
-m.left+m.right))*l)),this._hScrollDiv.style.left=h+Math.floor(Math.max(0,Math.floor(k.x*l/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=y-9+"px",this._hScrollDiv.style.width=p+"px");n=k.x;p=this._clipDiv;l=this._overlayDiv;if(w=this._marginDiv)w.style.left=-n+h+this._metrics.marginWidth+m.left+"px",w.style.bottom=("scroll"===b.style.overflowX?s:0)+"px";p?(p.scrollLeft=n,p.scrollTop=0,b=h+m.left,s=m.top,a=u,h=y,n=0,w=-d,0===k.x&&(b-=m.left,a+=m.left,n=m.left),k.x+u===g&&(a+=m.right),0===k.y&&
-(s-=m.top,h+=m.top,w+=m.top),k.y+y===f&&(h+=m.bottom),p.style.left=b+"px",p.style.top=s+"px",p.style.right=Q-a-b+"px",p.style.bottom=K-h-s+"px",c.style.left=n+"px",c.style.top=w+"px",c.style.width=g+"px",c.style.height=y+d+"px",l&&(l.style.left=c.style.left,l.style.top=c.style.top,l.style.width=c.style.width,l.style.height=c.style.height)):(b=n,s=d,Q=n+u,K=d+y,0===b&&(b-=m.left),0===s&&(s-=m.top),Q===g&&(Q+=m.right),k.y+y===f&&(K+=m.bottom),c.style.clip="rect("+s+"px,"+Q+"px,"+K+"px,"+b+"px)",c.style.left=
--n+h+m.left+"px",c.style.width=(this._wrapMode||e.isWebkit?g:u+n)+"px",a||(c.style.top=-d+m.top+"px",c.style.height=y+d+"px"),l&&(l.style.clip=c.style.clip,l.style.left=c.style.left,l.style.width=c.style.width,a||(l.style.top=c.style.top,l.style.height=c.style.height)));this._updateDOMSelection();r&&(c=this._ensureCaretVisible,this._ensureCaretVisible=!1,c&&this._showCaret(),this._queueUpdate())}}},_updateOverflow:function(){var a=this._viewDiv;this._wrapMode?(a.style.overflowX="hidden",a.style.overflowY=
-"scroll"):a.style.overflow="hidden"},_updateRuler:function(a,c,b,k){if(a)for(var m=this._parent.ownerDocument,f=this._getLineHeight(),h=this._getViewPadding(),a=a.firstChild;a;){var r=a._ruler,g=f,l=r.getOverview();"page"===l&&(g+=this._topIndexY);a.style.top=-g+"px";a.style.height=k+g+"px";a.rulerChanged&&d(r.getRulerStyle(),a);var s,t=a.firstChild;t?(s=t,t=t.nextSibling):(s=e.createElement(m,"div"),s.style.visibility="hidden",a.appendChild(s));var u;if(a.rulerChanged&&s){g=-1;if(u=r.getWidestAnnotation())d(u.style,
-s),u.html&&(s.innerHTML=u.html);s.lineIndex=g;s.style.height=f+h.top+"px"}var v;if("page"===l){for(r=r.getAnnotations(c,b+1);t;)g=t.lineIndex,u=t.nextSibling,(!(c<=g&&g<=b)||t.lineChanged)&&a.removeChild(t),t=u;t=a.firstChild.nextSibling;v=m.createDocumentFragment();for(g=c;g<=b;g++)if(!t||t.lineIndex>g){s=e.createElement(m,"div");if(u=r[g])d(u.style,s),u.html&&(s.innerHTML=u.html),s.annotation=u;s.lineIndex=g;s.style.height=this._getLineHeight(g)+"px";v.appendChild(s)}else v.firstChild&&(a.insertBefore(v,
-t),v=m.createDocumentFragment()),t&&(t=t.nextSibling);v.firstChild&&a.insertBefore(v,t)}else{u=this._getClientHeight();g=this._model.getLineCount();t=u+h.top+h.bottom-2*this._metrics.scrollWidth;l=f*g<t?f:t/g;if(a.rulerChanged){for(u=a.childNodes.length;1<u;)a.removeChild(a.lastChild),u--;r=r.getAnnotations(0,g);v=m.createDocumentFragment();for(var w in r)g=w>>>0,0>g||(s=e.createElement(m,"div"),u=r[w],d(u.style,s),s.style.position="absolute",s.style.top=this._metrics.scrollWidth+f+Math.floor(g*l)+
-"px",u.html&&(s.innerHTML=u.html),s.annotation=u,s.lineIndex=g,v.appendChild(s));a.appendChild(v)}else if(a._oldTrackHeight!==t)for(s=a.firstChild?a.firstChild.nextSibling:null;s;)s.style.top=this._metrics.scrollWidth+f+Math.floor(s.lineIndex*l)+"px",s=s.nextSibling;a._oldTrackHeight=t}a.rulerChanged=!1;a=a.nextSibling}},_updateStyleSheet:function(){var a="";e.isWebkit&&0<this._metrics.scrollWidth&&(a+="\n.textview ::-webkit-scrollbar-corner {background: #eeeeee;}");e.isFirefox&&(e.isMac&&this._highlightRGB&&
-"Highlight"!==this._highlightRGB)&&(a+="\n.textview ::-moz-selection {background: "+this._highlightRGB+";}");if(a){var c=document.getElementById("_textviewStyle");if(c)c.removeChild(c.firstChild),c.appendChild(document.createTextNode(a));else{c=e.createElement(document,"style");c.id="_textviewStyle";var b=document.getElementsByTagName("head")[0]||document.documentElement;c.appendChild(document.createTextNode(a));b.insertBefore(c,b.firstChild)}}},_updateStyle:function(a){!a&&e.isIE&&(this._rootDiv.style.lineHeight=
-"normal");var c=this._metrics=this._calculateMetrics();this._rootDiv.style.lineHeight=e.isIE?c.lineHeight-(c.lineTrim.top+c.lineTrim.bottom)+"px":"normal";this._updateStyleSheet();a||(this.redraw(),this._resetLineWidth())}};b.EventTarget.addMixin(y.prototype);return{TextView:y}});
-define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(g,n){function p(b){this._model=b;this._projections=[];var g=this;this._listener={onChanged:function(b){g._onChanged(b)},onChanging:function(b){g._onChanging(b)}};b.addEventListener("preChanged",this._listener.onChanged);b.addEventListener("preChanging",this._listener.onChanging)}p.prototype={destroy:function(){this._model&&(this._model.removeEventListener("preChanged",this._listener.onChanged),
-this._model.removeEventListener("preChanging",this._listener.onChanging),this._model=null)},addProjection:function(b){if(b){var l=this._model,f=this._projections;b._lineIndex=l.getLineAtOffset(b.start);b._lineCount=l.getLineAtOffset(b.end)-b._lineIndex;var e=b.text;e||(e="");b._model="string"===typeof e?new g.TextModel(e,l.getLineDelimiter()):e;var l=this.mapOffset(b.start,!0),e=b.end-b.start,d=b._lineCount,h=b._model.getCharCount(),c=b._model.getLineCount()-1,a={type:"Changing",text:b._model.getText(),
-start:l,removedCharCount:e,addedCharCount:h,removedLineCount:d,addedLineCount:c};this.onChanging(a);a=this._binarySearch(f,b.start);f.splice(a,0,b);this.onChanged({type:"Changed",start:l,removedCharCount:e,addedCharCount:h,removedLineCount:d,addedLineCount:c})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(b,g){var f=this._projections,e=0,d,h;if(g){for(d=0;d<f.length;d++){h=f[d];if(h.start>b)break;if(h.end>b)return-1;e+=
-h._model.getCharCount()-(h.end-h.start)}return b+e}for(d=0;d<f.length;d++){h=f[d];if(h.start>b-e)break;var c=h._model.getCharCount();if(h.start+c>b-e)return-1;e+=c-(h.end-h.start)}return b-e},removeProjection:function(b){var g,f=0;for(g=0;g<this._projections.length;g++){var e=this._projections[g];if(e===b){b=e;break}f+=e._model.getCharCount()-(e.end-e.start)}if(g<this._projections.length){var e=this._model,f=b.start+f,d=b.end-b.start,h=b._lineCount,c=b._model.getCharCount(),a=b._model.getLineCount()-
-1,b={type:"Changing",text:e.getText(b.start,b.end),start:f,removedCharCount:c,addedCharCount:d,removedLineCount:a,addedLineCount:h};this.onChanging(b);this._projections.splice(g,1);this.onChanged({type:"Changed",start:f,removedCharCount:c,addedCharCount:d,removedLineCount:a,addedLineCount:h})}},_binarySearch:function(b,g){for(var f=b.length,e=-1,d;1<f-e;)d=Math.floor((f+e)/2),g<=b[d].start?f=d:e=d;return f},getCharCount:function(){for(var b=this._model.getCharCount(),g=this._projections,f=0;f<g.length;f++)var e=
-g[f],b=b+(e._model.getCharCount()-(e.end-e.start));return b},getLine:function(b,g){if(0>b)return null;var f=this._model,e=this._projections,d=0,h=[],c=0,a,k,m;for(a=0;a<e.length;a++){m=e[a];if(m._lineIndex>=b-d)break;k=m._model.getLineCount()-1;if(m._lineIndex+k>=b-d){c=b-(m._lineIndex+d);if(c<k)return m._model.getLine(c,g);h.push(m._model.getLine(k))}c=m.end;d+=k-m._lineCount}for(c=Math.max(c,f.getLineStart(b-d));a<e.length;a++){m=e[a];if(m._lineIndex>b-d)break;h.push(f.getText(c,m.start));k=m._model.getLineCount()-
-1;if(m._lineIndex+k>b-d)return h.push(m._model.getLine(0,g)),h.join("");h.push(m._model.getText());c=m.end;d+=k-m._lineCount}e=f.getLineEnd(b-d,g);c<e&&h.push(f.getText(c,e));return h.join("")},getLineAtOffset:function(b){for(var g=this._model,f=this._projections,e=0,d=0,h=0;h<f.length;h++){var c=f[h];if(c.start>b-e)break;var a=c._model.getCharCount();if(c.start+a>b-e){f=b-(c.start+e);d+=c._model.getLineAtOffset(f);e+=f;break}d+=c._model.getLineCount()-1-c._lineCount;e+=a-(c.end-c.start)}return g.getLineAtOffset(b-
-e)+d},getLineCount:function(){for(var b=this._projections,g=this._model.getLineCount(),f=0;f<b.length;f++)var e=b[f],g=g+(e._model.getLineCount()-1-e._lineCount);return g},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(b,g){if(0>b)return-1;for(var f=this._model,e=this._projections,d=0,h=0,c=0;c<e.length;c++){var a=e[c];if(a._lineIndex>b-d)break;var k=a._model.getLineCount()-1;if(a._lineIndex+k>b-d)return a._model.getLineEnd(b-(a._lineIndex+d),g)+a.start+h;h+=
-a._model.getCharCount()-(a.end-a.start);d+=k-a._lineCount}return f.getLineEnd(b-d,g)+h},getLineStart:function(b){if(0>b)return-1;for(var g=this._model,f=this._projections,e=0,d=0,h=0;h<f.length;h++){var c=f[h];if(c._lineIndex>=b-e)break;var a=c._model.getLineCount()-1;if(c._lineIndex+a>=b-e)return c._model.getLineStart(b-(c._lineIndex+e))+c.start+d;d+=c._model.getCharCount()-(c.end-c.start);e+=a-c._lineCount}return g.getLineStart(b-e)+d},getText:function(b,g){void 0===b&&(b=0);var f=this._model,e=
-this._projections,d=0,h=[],c,a,k;for(c=0;c<e.length;c++){a=e[c];if(a.start>b-d)break;k=a._model.getCharCount();if(a.start+k>b-d){if(void 0!==g&&a.start+k>g-d)return a._model.getText(b-(a.start+d),g-(a.start+d));h.push(a._model.getText(b-(a.start+d)));b=a.end+d+k-(a.end-a.start)}d+=k-(a.end-a.start)}var m=b-d;if(void 0!==g){for(;c<e.length;c++){a=e[c];if(a.start>g-d)break;h.push(f.getText(m,a.start));k=a._model.getCharCount();if(a.start+k>g-d)return h.push(a._model.getText(0,g-(a.start+d))),h.join("");
-h.push(a._model.getText());m=a.end;d+=k-(a.end-a.start)}h.push(f.getText(m,g-d))}else{for(;c<e.length;c++)a=e[c],h.push(f.getText(m,a.start)),h.push(a._model.getText()),m=a.end;h.push(f.getText(m))}return h.join("")},_onChanged:function(){var b=this._change,g=b.baseStart,f=b.baseEnd,e,d,h=this._projections;for(e=0;e<h.length&&!(d=h[e],d.end>g);e++);var c=e;for(e=0;e<h.length&&!(d=h[e],d.start>=f);e++);var a=e,k=this._model,g=b.baseText.length-(f-g);for(e=a;e<h.length;e++)d=h[e],d.start+=g,d.end+=
-g,d._lineIndex=k.getLineAtOffset(d.start);d=h.splice(c,a-c);for(e=0;e<d.length;e++)d[e].annotation&&d[e].annotation._expand();this.onChanged({type:"Changed",start:b.start,removedCharCount:b.removedCharCount,addedCharCount:b.addedCharCount,removedLineCount:b.removedLineCount,addedLineCount:b.addedLineCount});this._change=void 0},_onChanging:function(b){var g=!!this._change,f=this._change||{},e=b.start,d=e+b.removedCharCount;f.baseStart=e;f.baseEnd=d;f.baseText=b.text;f.addedLineCount=b.addedLineCount;
-if(!g){this._change=f;f.text=b.text;var h=this._projections,c,a,k,b=function(b){for(c=a=0;a<h.length;a++){k=h[a];if(k.start>b)break;if(k.end>b)return-1;c+=k._model.getCharCount()-(k.end-k.start)}return b+c};f.start=b(e);-1===f.start&&(f.text=this._model.getText(k.start,e)+f.text,f.addedLineCount+=this._model.getLineAtOffset(e)-this._model.getLineAtOffset(k.start),f.start=k.start+c);f.end=b(d);-1===f.end&&(f.text+=this._model.getText(d,k.end),f.addedLineCount+=this._model.getLineAtOffset(k.end)-this._model.getLineAtOffset(d),
-f.end=k.start+c)}f.addedCharCount=f.text.length;f.removedCharCount=f.end-f.start;f.removedLineCount=this.getLineAtOffset(f.end)-this.getLineAtOffset(f.start);this.onChanging({type:"Changing",text:f.text,start:f.start,removedCharCount:f.removedCharCount,addedCharCount:f.addedCharCount,removedLineCount:f.removedLineCount,addedLineCount:f.addedLineCount})},onChanging:function(b){return this.dispatchEvent(b)},onChanged:function(b){return this.dispatchEvent(b)},setLineDelimiter:function(b){this._model.setLineDelimiter(b)},
-setText:function(b,g,f){function e(b){for(h=c=0;c<d.length;c++){a=d[c];if(a.start>b-h)break;var k=a._model.getCharCount();if(a.start+k>b-h)return-1;h+=k-(a.end-a.start)}return b-h}this._change={text:b||"",start:g||0,end:void 0===f?this.getCharCount():f};var d=this._projections,h,c,a,k,m,b=e(this._change.start);-1===b&&(k={projection:a,start:this._change.start-(a.start+h)},b=a.end);g=e(this._change.end);-1===g&&(m={projection:a,end:this._change.end-(a.start+h)},g=a.start);k&&m&&k.projection===m.projection?
-a._model.setText(this._change.text,k.start,m.end):(this._model.setText(this._change.text,b,g),k&&(a=k.projection,a._model.setText("",k.start)),m&&(a=m.projection,a._model.setText("",0,m.end),a.start=a.end,a._lineCount=0));this._change=void 0}};n.EventTarget.addMixin(p.prototype);return{ProjectionTextModel:p}});
-define("orion/editor/tooltip","i18n!orion/editor/nls/messages orion/editor/textView orion/editor/textModel orion/editor/projectionTextModel orion/editor/util orion/util".split(" "),function(g,n,p,b,l,f){function e(b){this._view=b;this._fadeDelay=500;this._hideDelay=200;this._showDelay=500;this._autoHideDelay=5E3;this._create(b.getOptions("parent").ownerDocument)}e.getTooltip=function(b){b._tooltip||(b._tooltip=new e(b));return b._tooltip};e.prototype={_create:function(b){if(!this._tooltipDiv){var e=
-this._tooltipDiv=f.createElement(b,"div");e.tabIndex=0;e.className="textviewTooltip";e.setAttribute("aria-live","assertive");e.setAttribute("aria-atomic","true");var c=this._tooltipContents=f.createElement(b,"div");e.appendChild(c);b.body.appendChild(e);var a=this;l.addEventListener(e,"mouseover",function(){if(a._hideDelay){var c=a._getWindow();a._delayedHideTimeout&&(c.clearTimeout(a._delayedHideTimeout),a._delayedHideTimeout=null);a._hideTimeout&&(c.clearTimeout(a._hideTimeout),a._hideTimeout=null);
-a._nextTarget=null}},!1);l.addEventListener(e,"mouseout",function(c){c=c.relatedTarget||c.toElement;!(c===e||a._hasFocus())&&(!c||!l.contains(e,c))&&a._hide()},!1);l.addEventListener(e,"keydown",function(c){27===c.keyCode&&a._hide()},!1);l.addEventListener(b,"mousedown",this._mouseDownHandler=function(c){a.isVisible()&&(l.contains(e,c.target||c.srcElement)||a._hide())},!0);this._view.addEventListener("Destroy",function(){a.destroy()});this._hide()}},_getWindow:function(){var b=this._tooltipDiv.ownerDocument;
-return b.defaultView||b.parentWindow},destroy:function(){if(this._tooltipDiv){this._hide();var b=this._tooltipDiv.parentNode;b&&b.removeChild(this._tooltipDiv);l.removeEventListener(this._tooltipDiv.ownerDocument,"mousedown",this._mouseDownHandler,!0);this._tooltipDiv=null}},_hasFocus:function(){var b=this._tooltipDiv;return!b?!1:l.contains(b,b.ownerDocument.activeElement)},hide:function(b){void 0===b&&(b=this._hideDelay);var e=this._getWindow();this._delayedHideTimeout&&(e.clearTimeout(this._delayedHideTimeout),
-this._delayedHideTimeout=null);var c=this;b?c._delayedHideTimeout=e.setTimeout(function(){c._delayedHideTimeout=null;c._hide();c.setTarget(c._nextTarget,0)},b):(c._hide(),c.setTarget(c._nextTarget,0))},_hide:function(){var b=this._tooltipDiv;b&&(this._hasFocus()&&this._view.focus(),this._contentsView&&(this._contentsView.destroy(),this._contentsView=null),this._tooltipContents&&(this._tooltipContents.innerHTML=""),b.style.visibility="hidden",b=this._getWindow(),this._showTimeout&&(b.clearTimeout(this._showTimeout),
-this._showTimeout=null),this._delayedHideTimeout&&(b.clearTimeout(this._delayedHideTimeout),this._delayedHideTimeout=null),this._hideTimeout&&(b.clearTimeout(this._hideTimeout),this._hideTimeout=null),this._fadeTimeout&&(b.clearInterval(this._fadeTimeout),this._fadeTimeout=null))},isVisible:function(){return this._tooltipDiv&&"visible"===this._tooltipDiv.style.visibility},setTarget:function(b,e,c){if(this.isVisible())this._hasFocus()||(this._nextTarget=b,this.hide(c));else if(this._target=b){var a=
-this,b=a._getWindow();a._showTimeout&&(b.clearTimeout(a._showTimeout),a._showTimeout=null);0===e?a.show(!0):a._showTimeout=b.setTimeout(function(){a._showTimeout=null;a.show(!0)},e?e:a._showDelay)}},show:function(d){if(this._target){var e=this._target.getTooltipInfo();if(e){var c=this._tooltipDiv,a=this._tooltipContents;c.style.left=c.style.right=c.style.width=c.style.height=a.style.width=a.style.height="auto";var k=e.contents;k instanceof Array&&(k=this._getAnnotationContents(k));if("string"===typeof k)a.innerHTML=
-k;else if(this._isNode(k))a.appendChild(k);else if(k instanceof b.ProjectionTextModel){var m=this._view,f=m.getOptions();f.wrapMode=!1;f.parent=a;var g=f.themeClass;g?((g=g.replace("tooltipTheme",""))&&(g=" "+g),g="tooltipTheme"+g):g="tooltipTheme";f.themeClass=g;f=this._contentsView=new n.TextView(f);f.addEventListener("LineStyle",function(a){m.onLineStyle(a)});f.setModel(k);k=f.computeSize();a.style.width=k.width+"px";a.style.height=k.height+"px";f.resize()}else return;a=c.ownerDocument.documentElement;
-"right"===e.anchor?(k=a.clientWidth-e.x,c.style.right=k+"px"):(k=parseInt(this._getNodeStyle(c,"padding-left","0"),10),k+=parseInt(this._getNodeStyle(c,"border-left-width","0"),10),k=e.x-k,c.style.left=k+"px");c.style.maxWidth=a.clientWidth-k-10+"px";k=parseInt(this._getNodeStyle(c,"padding-top","0"),10);k+=parseInt(this._getNodeStyle(c,"border-top-width","0"),10);k=e.y-k;c.style.top=k+"px";c.style.maxHeight=a.clientHeight-k-10+"px";c.style.opacity="1";c.style.visibility="visible";if(d){var l=this,
-t=this._getWindow();l._hideTimeout=t.setTimeout(function(){l._hideTimeout=null;var a=parseFloat(l._getNodeStyle(c,"opacity","1"));l._fadeTimeout=t.setInterval(function(){"visible"===c.style.visibility&&0<a?(a-=0.1,c.style.opacity=a):l._hide()},l._fadeDelay/10)},l._autoHideDelay)}}}},_getAnnotationContents:function(d){function e(a){var c=a.title,b=f.createElement(r,"div");b.className="tooltipRow";a.html&&(b.innerHTML=a.html,b.lastChild&&l.addEventListener(b.lastChild,"click",function(){var c=a.start,
-b=a.end;v.getBaseModel&&(c=v.mapOffset(c,!0),b=v.mapOffset(b,!0));w.setSelection(c,b,1/3,function(){m._hide()})},!1),b.appendChild(r.createTextNode("\u00a0")));if(!c)var d=a.end,c=t.getLineStart(t.getLineAtOffset(a.start)),d=t.getLineEnd(t.getLineAtOffset(d),!0),c=t.getText(c,d);"function"===typeof c&&(c=a.title());"string"===typeof c&&(d=f.createElement(r,"span"),d.appendChild(r.createTextNode(c)),c=d);b.appendChild(c);return b}for(var c,a=[],k=0;k<d.length;k++)c=d[k],""!==c.title&&!c.groupAnnotation&&
-a.push(c);d=a;if(0===d.length)return null;var m=this,r=this._tooltipDiv.ownerDocument,w=this._view,v=w.getModel(),t=v.getBaseModel?v.getBaseModel():v;if(1===d.length){c=d[0];if(void 0!==c.title)return c=e(c),c.firstChild&&((d=c.firstChild.className)&&(d+=" "),c.firstChild.className=d+"single"),c;d=new b.ProjectionTextModel(t);a=t.getLineStart(t.getLineAtOffset(c.start));k=t.getCharCount();c.end!==k&&d.addProjection({start:c.end,end:k});0<a&&d.addProjection({start:0,end:a});return d}a=f.createElement(r,
-"div");c=f.createElement(r,"em");c.appendChild(r.createTextNode(g.multipleAnnotations));a.appendChild(c);for(k=0;k<d.length;k++)c=d[k],(c=e(c))&&a.appendChild(c);return a},_getNodeStyle:function(b,e,c){var a;if(b&&(a=b.style[e],!a))if(b.currentStyle){for(a=0;-1!==(a=e.indexOf("-",a));)e=e.substring(0,a)+e.substring(a+1,a+2).toUpperCase()+e.substring(a+2);a=b.currentStyle[e]}else a=(b=b.ownerDocument.defaultView.getComputedStyle(b,null))?b.getPropertyValue(e):null;return a||c},_isNode:function(b){return"object"===
-typeof Node?b instanceof Node:b&&"object"===typeof b&&"number"===typeof b.nodeType&&"string"===typeof b.nodeName}};return{Tooltip:e}});
-define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(g,n){function p(c,a,b){this.start=c;this.end=a;this._projectionModel=b;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function b(){}function l(c,a){var d=c.lastIndexOf("."),d=c.substring(d+1),e={title:g[d],style:{styleClass:"annotation "+d},html:"<div class='annotationHTML "+d+"'></div>",overviewStyle:{styleClass:"annotationOverview "+d}};a?e.lineStyle={styleClass:"annotationLine "+
-d}:e.rangeStyle={styleClass:"annotationRange "+d};b.registerType(c,e)}function f(){}function e(c){this._annotations=[];var a=this;this._listener={onChanged:function(c){a._onChanged(c)}};this.setTextModel(c)}function d(c,a){this._view=c;this._annotationModel=a;var b=this;this._listener={onDestroy:function(a){b._onDestroy(a)},onLineStyle:function(a){b._onLineStyle(a)},onChanged:function(a){b._onAnnotationModelChanged(a)}};c.addEventListener("Destroy",this._listener.onDestroy);c.addEventListener("postLineStyle",
-this._listener.onLineStyle);a.addEventListener("Changed",this._listener.onChanged)}p.prototype={_expandedHTML:"<div class='annotationHTML expanded'></div>",_expandedStyle:{styleClass:"annotation expanded"},_collapsedHTML:"<div class='annotationHTML collapsed'></div>",_collapsedStyle:{styleClass:"annotation collapsed"},_collapse:function(){if(!this.expanded)return!1;this.expanded=!1;this.html=this._collapsedHTML;this.style=this._collapsedStyle;this._annotationModel&&this._annotationModel.modifyAnnotation(this);
-return!0},_expand:function(){if(this.expanded)return!1;this.expanded=!0;this.html=this._expandedHTML;this.style=this._expandedStyle;this._annotationModel&&this._annotationModel.modifyAnnotation(this);return!0},collapse:function(){if(this._collapse()){var c=this._projectionModel,a=c.getBaseModel();this._projection={annotation:this,start:a.getLineStart(a.getLineAtOffset(this.start)+1),end:a.getLineEnd(a.getLineAtOffset(this.end),!0)};c.addProjection(this._projection)}},expand:function(){this._expand()&&
-this._projectionModel.removeProjection(this._projection)}};b.ANNOTATION_ERROR="orion.annotation.error";b.ANNOTATION_WARNING="orion.annotation.warning";b.ANNOTATION_TASK="orion.annotation.task";b.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint";b.ANNOTATION_BOOKMARK="orion.annotation.bookmark";b.ANNOTATION_FOLDING="orion.annotation.folding";b.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket";b.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket";b.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine";
-b.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch";b.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch";b.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence";b.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence";b.ANNOTATION_SELECTED_LINKED_GROUP="orion.annotation.selectedLinkedGroup";b.ANNOTATION_CURRENT_LINKED_GROUP="orion.annotation.currentLinkedGroup";b.ANNOTATION_LINKED_GROUP="orion.annotation.linkedGroup";b.ANNOTATION_BLAME="orion.annotation.blame";b.ANNOTATION_CURRENT_BLAME=
-"orion.annotation.currentBlame";var h={};b.registerType=function(c,a){var b=a;"function"!==typeof b&&(b=function(a,c,b){this.start=a;this.end=c;void 0!==b&&(this.title=b)},b.prototype=a);b.prototype.type=c;h[c]=b;return c};b.createAnnotation=function(c,a,b,d){return new (this.getType(c))(a,b,d)};b.getType=function(c){return h[c]};l(b.ANNOTATION_ERROR);l(b.ANNOTATION_WARNING);l(b.ANNOTATION_TASK);l(b.ANNOTATION_BREAKPOINT);l(b.ANNOTATION_BOOKMARK);l(b.ANNOTATION_CURRENT_BRACKET);l(b.ANNOTATION_MATCHING_BRACKET);
-l(b.ANNOTATION_CURRENT_SEARCH);l(b.ANNOTATION_MATCHING_SEARCH);l(b.ANNOTATION_READ_OCCURRENCE);l(b.ANNOTATION_WRITE_OCCURRENCE);l(b.ANNOTATION_SELECTED_LINKED_GROUP);l(b.ANNOTATION_CURRENT_LINKED_GROUP);l(b.ANNOTATION_LINKED_GROUP);l(b.ANNOTATION_CURRENT_LINE,!0);l(b.ANNOTATION_BLAME,!0);l(b.ANNOTATION_CURRENT_BLAME,!0);b.registerType(b.ANNOTATION_FOLDING,p);f.addMixin=function(c){var a=f.prototype,b;for(b in a)a.hasOwnProperty(b)&&(c[b]=a[b])};f.prototype={addAnnotationType:function(c){this._annotationTypes||
-(this._annotationTypes=[]);this._annotationTypes.push(c)},getAnnotationTypePriority:function(c){if(this._annotationTypes)for(var a=0;a<this._annotationTypes.length;a++)if(this._annotationTypes[a]===c)return a+1;return 0},getAnnotationsByType:function(c,a,b){c=c.getAnnotations(a,b);for(b=[];c.hasNext();)a=c.next(),0!==this.getAnnotationTypePriority(a.type)&&b.push(a);var d=this;b.sort(function(a,c){return d.getAnnotationTypePriority(a.type)-d.getAnnotationTypePriority(c.type)});return b},isAnnotationTypeVisible:function(c){return 0!==
-this.getAnnotationTypePriority(c)},removeAnnotationType:function(c){if(this._annotationTypes)for(var a=0;a<this._annotationTypes.length;a++)if(this._annotationTypes[a]===c){this._annotationTypes.splice(a,1);break}}};e.prototype={addAnnotation:function(c){if(c){var a=this._annotations,b=this._binarySearch(a,c.start);a.splice(b,0,c);c._annotationModel=this;this.onChanged({type:"Changed",added:[c],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(c,a){var b=
-this._annotations,d,e=0,f=function(){for(;e<b.length;){var d=b[e++];if(c===d.start||(c>d.start?c<d.end:d.start<a))return d;if(d.start>=a)break}return null};d=f();return{next:function(){var a=d;a&&(d=f());return a},hasNext:function(){return null!==d}}},modifyAnnotation:function(c){if(c&&!(0>this._getAnnotationIndex(c)))this.onChanged({type:"Changed",added:[],removed:[],changed:[c]})},onChanged:function(c){return this.dispatchEvent(c)},removeAnnotations:function(c){var a=this._annotations,b,d;if(c){b=
-[];for(d=a.length-1;0<=d;d--){var e=a[d];e.type===c&&(a.splice(d,1),b.splice(0,0,e),e._annotationModel=null)}}else b=a;this.onChanged({type:"Changed",removed:b,added:[],changed:[]})},removeAnnotation:function(c){if(c){var a=this._getAnnotationIndex(c);0>a||(c._annotationModel=null,c={type:"Changed",removed:this._annotations.splice(a,1),added:[],changed:[]},this.onChanged(c))}},replaceAnnotations:function(c,a){var b=this._annotations,d,e,f,h=[];if(c)for(d=c.length-1;0<=d;d--)f=c[d],e=this._getAnnotationIndex(f),
-0>e||(f._annotationModel=null,b.splice(e,1),h.splice(0,0,f));a||(a=[]);for(d=0;d<a.length;d++)f=a[d],e=this._binarySearch(b,f.start),f._annotationModel=this,b.splice(e,0,f);this.onChanged({type:"Changed",removed:h,added:a,changed:[]})},setTextModel:function(c){this._model&&this._model.removeEventListener("Changed",this._listener.onChanged);(this._model=c)&&this._model.addEventListener("Changed",this._listener.onChanged)},_binarySearch:function(c,a){for(var b=c.length,d=-1,e;1<b-d;)e=Math.floor((b+
-d)/2),a<=c[e].start?b=e:d=e;return b},_getAnnotationIndex:function(c){for(var a=this._annotations,b=this._binarySearch(a,c.start);b<a.length&&a[b].start===c.start;){if(a[b]===c)return b;b++}return-1},_onChanged:function(c){var a=c.start,b=c.addedCharCount,d=c.removedCharCount,e=this._annotations,f=a+d;if(0<e.length){c={type:"Changed",added:[],removed:[],changed:[],textModelChangedEvent:c};b-=d;for(d=0;d<e.length;d++){var h=e[d];h.start>=f?(h._oldStart=h.start,h._oldEnd=h.end,h.start+=b,h.end+=b,c.changed.push(h)):
-h.end<=a||(h.start<a&&f<h.end?(h._oldStart=h.start,h._oldEnd=h.end,h.end+=b,c.changed.push(h)):(e.splice(d,1),c.removed.push(h),h._annotationModel=null,h.expand&&h.expand(),d--))}if(0<c.added.length||0<c.removed.length||0<c.changed.length)this.onChanged(c)}}};n.EventTarget.addMixin(e.prototype);d.prototype={destroy:function(){var c=this._view;c&&(c.removeEventListener("Destroy",this._listener.onDestroy),c.removeEventListener("LineStyle",this._listener.onLineStyle),this.view=null);(c=this._annotationModel)&&
-c.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(c,a){if(a){c||(c={});c.styleClass=c.styleClass&&a.styleClass&&c.styleClass!==a.styleClass?c.styleClass+(" "+a.styleClass):a.styleClass;var b;a.tagName&&!c.tagName&&(c.tagName=a.tagName);if(a.style)for(b in c.style||(c.style={}),a.style)c.style[b]||(c.style[b]=a.style[b]);if(a.attributes)for(b in c.attributes||(c.attributes={}),a.attributes)c.attributes[b]||(c.attributes[b]=a.attributes[b])}return c},_mergeStyleRanges:function(c,
-a){c||(c=[]);var b,d;for(d=0;d<c.length&&a;d++){var e=c[d];if(a.end<=e.start)break;if(!(a.start>=e.end)){b=this._mergeStyle({},e.style);b=this._mergeStyle(b,a.style);var f=[];f.push(d,1);a.start<e.start&&f.push({start:a.start,end:e.start,style:a.style});a.start>e.start&&f.push({start:e.start,end:a.start,style:e.style});f.push({start:Math.max(e.start,a.start),end:Math.min(e.end,a.end),style:b});a.end<e.end&&f.push({start:a.end,end:e.end,style:e.style});a=a.end>e.end?{start:e.end,end:a.end,style:a.style}:
-null;Array.prototype.splice.apply(c,f)}}a&&(b=this._mergeStyle({},a.style),c.splice(d,0,{start:a.start,end:a.end,style:b}));return c},_onAnnotationModelChanged:function(c){function a(a,c){f.getBaseModel&&(a=f.mapOffset(a,!0),c=f.mapOffset(c,!0));-1!==a&&-1!==c&&d.redrawRange(a,c)}function b(c,d){for(var k=0;k<c.length;k++)if(e.isAnnotationTypeVisible(c[k].type)){var m=c[k];a(m.start,m.end);d&&(void 0!==m._oldStart&&m._oldEnd)&&a(m._oldStart,m._oldEnd)}}var d=this._view;if(d){var e=this,f=d.getModel();
-b(c.added);b(c.removed);b(c.changed,!0)}},_onDestroy:function(){this.destroy()},_onLineStyle:function(c){var a=this._annotationModel,b=c.textView.getModel(),d=a.getTextModel(),e=c.lineStart,f=c.lineStart+c.lineText.length;d!==b&&(e=b.mapOffset(e),f=b.mapOffset(f));for(a=a.getAnnotations(e,f);a.hasNext();)if(e=a.next(),this.isAnnotationTypeVisible(e.type)){if(e.rangeStyle){var f=e.start,h=e.end;d!==b&&(f=b.mapOffset(f,!0),h=b.mapOffset(h,!0));c.ranges=this._mergeStyleRanges(c.ranges,{start:f,end:h,
-style:e.rangeStyle})}e.lineStyle&&(c.style=this._mergeStyle({},c.style),c.style=this._mergeStyle(c.style,e.lineStyle))}}};f.addMixin(d.prototype);return{FoldingAnnotation:p,AnnotationType:b,AnnotationTypeList:f,AnnotationModel:e,AnnotationStyler:d}});
-define("orion/editor/editor","i18n!orion/editor/nls/messages orion/editor/eventTarget orion/editor/tooltip orion/editor/annotations orion/objects orion/util".split(" "),function(g,n,p,b,l,f){function e(c){c=c||{};this._domNode=c.domNode;this._model=c.model;this._undoStack=c.undoStack;this._statusReporter=c.statusReporter;this._title=null;var a=this;this._listener={onChanged:function(c){a.onChanged(c)}};this._model&&this._model.addEventListener("Changed",this._listener.onChanged);this.checkDirty()}
-function d(c){c=c||{};e.call(this,c);this._textViewFactory=c.textViewFactory;this._undoStackFactory=c.undoStackFactory;this._textDNDFactory=c.textDNDFactory;this._annotationFactory=c.annotationFactory;this._foldingRulerFactory=c.foldingRulerFactory;this._lineNumberRulerFactory=c.lineNumberRulerFactory;this._contentAssistFactory=c.contentAssistFactory;this._keyBindingFactory=c.keyBindingFactory;this._contentAssist=this._foldingRuler=this._overviewRuler=this._lineNumberRuler=this._annotationRuler=this._annotationModel=
-this._annotationStyler=null}var h=b.AnnotationType;e.prototype={destroy:function(){this.uninstall();this._statusReporter=this._domNode=null;this._model&&this._model.removeEventListener("Changed",this._listener.onChanged)},checkDirty:function(){this.setDirty(this._undoStack&&!this._undoStack.isClean())},focus:function(){},getModel:function(){return this._model},getText:function(c,a){return this.getModel().getText(c,a)},getTitle:function(){return this._title},getUndoStack:function(){return this._undoStack},
-install:function(){this.installed=!0},isDirty:function(){return this._dirty},markClean:function(){this.getUndoStack().markClean();this.setDirty(!1)},onDirtyChanged:function(c){return this.dispatchEvent(c)},onInputChanged:function(c){return this.dispatchEvent(c)},onChanged:function(){this.checkDirty()},reportStatus:function(c,a,b){this._statusReporter&&this._statusReporter(c,a,b)},resize:function(){},setDirty:function(c){this._dirty!==c&&(this._dirty=c,this.onDirtyChanged({type:"DirtyChanged"}))},
-_setModelText:function(c){this._model&&this._model.setText(c)},setInput:function(c,a,b,d){this._title=c;d||(a?this.reportStatus(a,"error"):null!==b&&void 0!==b&&this._setModelText(b),this._undoStack&&this._undoStack.reset());this.checkDirty();this.onInputChanged({type:"InputChanged",title:c,message:a,contents:b,contentsSaved:d})},setText:function(c,a,b){this.getModel().setText(c,a,b)},uninstall:function(){this.installed=!1}};n.EventTarget.addMixin(e.prototype);d.prototype=new e;l.mixin(d.prototype,
+wrapMode:{value:!1,update:this._setWrapMode},wrappable:{value:!1,update:null},theme:{value:l.TextTheme.getTheme(),update:this._setTheme},themeClass:{value:void 0,update:this._setThemeClass}}},_destroyRuler:function(b){var a=this._getRulerParent(b);if(a)for(var c=a.firstChild;c;){if(c._ruler===b){c._ruler=void 0;a.removeChild(c);if(0===a.children.length&&(a!==this._marginDiv||!this._marginOffset))a.style.display="none";break}c=c.nextSibling}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);
+this._unhookEvents();var b=this._getWindow();this._autoScrollTimerID&&(b.clearTimeout(this._autoScrollTimerID),this._autoScrollTimerID=null);this._updateTimer&&(b.clearTimeout(this._updateTimer),this._updateTimer=null);b=this._rootDiv;b.parentNode.removeChild(b);this._hScrollDiv=this._vScrollDiv=this._cursorDiv=this._marginDiv=this._rightDiv=this._leftDiv=this._overlayDiv=this._clientDiv=this._clipScrollDiv=this._clipDiv=this._viewDiv=this._scrollDiv=this._rootDiv=this._clipboardDiv=this._selDiv3=
+this._selDiv2=this._selDiv1=null}},_doAutoScroll:function(b,a,c){this._autoScrollDir=b;this._autoScrollX=a;this._autoScrollY=c;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&this._getWindow().clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=this._autoScrollDir=void 0},_fixCaret:function(){var b=this._clientDiv;if(b){var a=this._hasFocus;this._ignoreFocus=!0;a&&b.blur();b.contentEditable=!1;b.contentEditable=!0;a&&b.focus();this._ignoreFocus=
+!1}},_getBaseText:function(b,a){var c=this._model;c.getBaseModel&&(b=c.mapOffset(b),a=c.mapOffset(a),c=c.getBaseModel());return c.getText(b,a)},_getBottomIndex:function(b){var a=this._bottomChild;if(b&&this._getClientHeight()>this._getLineHeight()){var b=a.getBoundingClientRect(),c=this._clientDiv.getBoundingClientRect();b.bottom>c.bottom&&(a=this._getLinePrevious(a)||a)}return a.lineIndex},_getBoundsAtOffset:function(b){var a=this._getLine(this._model.getLineAtOffset(b)),b=a.getBoundingClientRect(b),
+c=this._getLinePixel(a.lineIndex);b.top+=c;b.bottom+=c;a.destroy();return b},_getClientHeight:function(){var b=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-b.top-b.bottom)},_getClientWidth:function(){var b=this._getViewPadding();return Math.max(0,this._viewDiv.clientWidth-b.left-b.right)},_getClipboardText:function(b,a){var c=this._model.getLineDelimiter(),d,m,h=this._getWindow(),f=h.clipboardData;!f&&b&&(f=b.clipboardData);if(f)return d=[],m=f.getData(e.isIE?"Text":"text/plain"),
+k(m,function(b){d.push(b)},function(){d.push(c)}),m=d.join(""),a&&a(m),m;if(e.isFirefox){this._ignoreFocus=!0;var r=this._clipboardDiv,f=this._rootDiv.ownerDocument;r||(this._clipboardDiv=r=e.createElement(f,"div"),r.style.position="fixed",r.style.whiteSpace="pre",r.style.left="-1000px",this._rootDiv.appendChild(r));r.innerHTML="<pre contenteditable=''></pre>";r.firstChild.focus();var g=this,l=function(){var b=g._getTextFromElement(r);r.innerHTML="";d=[];k(b,function(b){d.push(b)},function(){d.push(c)});
+return d.join("")},s=!1;this._ignorePaste=!0;if(!e.isLinux||2!==this._lastMouseButton)try{s=f.execCommand("paste",!1,null)}catch(t){s=1<r.childNodes.length||r.firstChild&&0<r.firstChild.childNodes.length}this._ignorePaste=!1;if(!s){if(b)return h.setTimeout(function(){g.focus();(m=l())&&a&&a(m);g._ignoreFocus=!1},0),null;this.focus();this._ignoreFocus=!1;return""}this.focus();this._ignoreFocus=!1;(m=l())&&a&&a(m);return m}return""},_getDOMText:function(b,a){for(var c=b.firstChild,d="",k=0;c;){var e;
+if(!c.ignore)if(c.ignoreChars){e=c.lastChild;for(var m=0,h=[],f=-1;e;){var r=e.data;if(r)for(var g=r.length-1;0<=g;g--){var l=r.substring(g,g+1);m<c.ignoreChars&&(" "===l||"\u200b"===l||"\ufeff"===l)?m++:h.push("\u00a0"===l?"\t":l)}a===e&&(f=h.length);e=e.previousSibling}h=h.reverse().join("");-1!==f&&(k=d.length+h.length-f);d+=h}else for(e=c.firstChild;e;)a===e&&(k=d.length),d+=e.data,e=e.nextSibling;c=c.nextSibling}return{text:d,offset:k}},_getTextFromElement:function(b){var a=b.ownerDocument,c=
+a.defaultView;if(!c.getSelection)return b.innerText||b.textContent;a=a.createRange();a.selectNode(b);var b=c.getSelection(),c=[],d;for(d=0;d<b.rangeCount;d++)c.push(b.getRangeAt(d));this._ignoreSelect=!0;b.removeAllRanges();b.addRange(a);a=b.toString();b.removeAllRanges();for(d=0;d<c.length;d++)b.addRange(c[d]);this._ignoreSelect=!1;return a},_getViewPadding:function(){return this._metrics.viewPadding},_getLine:function(b){var a=this._getLineNode(b);return a&&!a.lineChanged&&!a.lineRemoved?a._line:
+new t(this,b)},_getLineHeight:function(b,a){if(void 0!==b&&this._lineHeight){var c=this._lineHeight[b];if(c)return c;if(a||void 0===a)return this._lineHeight[b]=this._calculateLineHeight(b)}return this._metrics.lineHeight},_getLineNode:function(b){for(var a=this._clientDiv.firstChild;a;){if(b===a.lineIndex)return a;a=a.nextSibling}},_getLineNext:function(b){for(b=b?b.nextSibling:this._clientDiv.firstChild;b&&-1===b.lineIndex;)b=b.nextSibling;return b},_getLinePrevious:function(b){for(b=b?b.previousSibling:
+this._clientDiv.lastChild;b&&-1===b.lineIndex;)b=b.previousSibling;return b},_getLinePixel:function(b){b=Math.min(Math.max(0,b),this._model.getLineCount());if(this._lineHeight){var a=this._getTopIndex(),c=-this._topIndexY+this._getScroll().y;if(b>a)for(;a<b;a++)c+=this._getLineHeight(a);else for(a-=1;a>=b;a--)c-=this._getLineHeight(a);return c}return this._getLineHeight()*b},_getLineIndex:function(b){var a,c=0,d=this._model.getLineCount();if(this._lineHeight){var c=this._getTopIndex(),k=-this._topIndexY+
+this._getScroll().y;if(b!==k)if(b<k)for(;b<k&&0<c;)b+=this._getLineHeight(--c);else for(a=this._getLineHeight(c);b-a>=k&&c<d-1;)b-=a,a=this._getLineHeight(++c)}else a=this._getLineHeight(),c=Math.floor(b/a);return Math.max(0,Math.min(d-1,c))},_getRulerParent:function(b){switch(b.getLocation()){case "left":return this._leftDiv;case "right":return this._rightDiv;case "margin":return this._marginDiv}return null},_getScroll:function(b){(void 0===b||b)&&this._cancelAnimation();b=this._viewDiv;return{x:b.scrollLeft,
+y:b.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(b){var a=this._topChild;if(b&&this._getClientHeight()>this._getLineHeight()){var b=a.getBoundingClientRect(),c=this._getViewPadding(),d=this._viewDiv.getBoundingClientRect();b.top<d.top+c.top&&(a=this._getLineNext(a)||a)}return a.lineIndex},_hookEvents:function(){var b=this;this._modelListener={onChanging:function(a){b._onModelChanging(a)},onChanged:function(a){b._onModelChanged(a)}};this._model.addEventListener("preChanging",
+this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._themeListener={onChanged:function(){b._setThemeClass(b._themeClass)}};this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);var a=this._handlers=[],c=this._clientDiv,d=this._viewDiv,k=this._rootDiv,m=this._overlayDiv||c,h=c.ownerDocument,f=this._getWindow(),r=e.isIE?h:f;a.push({target:f,type:"resize",handler:function(a){return b._handleResize(a?a:f.event)}});a.push({target:c,
+type:"blur",handler:function(a){return b._handleBlur(a?a:f.event)}});a.push({target:c,type:"focus",handler:function(a){return b._handleFocus(a?a:f.event)}});a.push({target:d,type:"focus",handler:function(){c.focus()}});a.push({target:d,type:"scroll",handler:function(a){return b._handleScroll(a?a:f.event)}});a.push({target:c,type:"textInput",handler:function(a){return b._handleTextInput(a?a:f.event)}});a.push({target:c,type:"keydown",handler:function(a){return b._handleKeyDown(a?a:f.event)}});a.push({target:c,
+type:"keypress",handler:function(a){return b._handleKeyPress(a?a:f.event)}});a.push({target:c,type:"keyup",handler:function(a){return b._handleKeyUp(a?a:f.event)}});e.isIE&&a.push({target:h,type:"keyup",handler:function(a){return b._handleDocKeyUp(a?a:f.event)}});a.push({target:c,type:"contextmenu",handler:function(a){return b._handleContextMenu(a?a:f.event)}});a.push({target:c,type:"copy",handler:function(a){return b._handleCopy(a?a:f.event)}});a.push({target:c,type:"cut",handler:function(a){return b._handleCut(a?
+a:f.event)}});a.push({target:c,type:"paste",handler:function(a){return b._handlePaste(a?a:f.event)}});if(e.isIOS||e.isAndroid)a.push({target:h,type:"selectionchange",handler:function(a){return b._handleSelectionChange(a?a:f.event)}}),a.push({target:c,type:"touchstart",handler:function(a){return b._handleTouchStart(a?a:f.event)}}),a.push({target:c,type:"touchmove",handler:function(a){return b._handleTouchMove(a?a:f.event)}}),a.push({target:c,type:"touchend",handler:function(a){return b._handleTouchEnd(a?
+a:f.event)}});else{a.push({target:c,type:"selectstart",handler:function(a){return b._handleSelectStart(a?a:f.event)}});a.push({target:c,type:"mousedown",handler:function(a){return b._handleMouseDown(a?a:f.event)}});a.push({target:c,type:"mouseover",handler:function(a){return b._handleMouseOver(a?a:f.event)}});a.push({target:c,type:"mouseout",handler:function(a){return b._handleMouseOut(a?a:f.event)}});a.push({target:r,type:"mouseup",handler:function(a){return b._handleMouseUp(a?a:f.event)}});a.push({target:r,
+type:"mousemove",handler:function(a){return b._handleMouseMove(a?a:f.event)}});a.push({target:k,type:"mousedown",handler:function(a){return b._handleRootMouseDown(a?a:f.event)}});a.push({target:k,type:"mouseup",handler:function(a){return b._handleRootMouseUp(a?a:f.event)}});a.push({target:m,type:"dragstart",handler:function(a){return b._handleDragStart(a?a:f.event)}});a.push({target:m,type:"drag",handler:function(a){return b._handleDrag(a?a:f.event)}});a.push({target:m,type:"dragend",handler:function(a){return b._handleDragEnd(a?
+a:f.event)}});a.push({target:m,type:"dragenter",handler:function(a){return b._handleDragEnter(a?a:f.event)}});a.push({target:m,type:"dragover",handler:function(a){return b._handleDragOver(a?a:f.event)}});a.push({target:m,type:"dragleave",handler:function(a){return b._handleDragLeave(a?a:f.event)}});a.push({target:m,type:"drop",handler:function(a){return b._handleDrop(a?a:f.event)}});a.push({target:this._clientDiv,type:e.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return b._handleMouseWheel(a?
+a:f.event)}});this._clipDiv&&a.push({target:this._clipDiv,type:e.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return b._handleMouseWheel(a?a:f.event)}});if(e.isFirefox&&(!e.isWindows||15<=e.isFirefox))(d=f.MutationObserver||f.MozMutationObserver)?(this._mutationObserver=new d(function(a){b._handleDataModified(a)}),this._mutationObserver.observe(c,{subtree:!0,characterData:!0})):a.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(a){return b._handleDataModified(a?
+a:f.event)}});this._overlayDiv&&(a.push({target:this._overlayDiv,type:"mousedown",handler:function(a){return b._handleMouseDown(a?a:f.event)}}),a.push({target:this._overlayDiv,type:"mouseover",handler:function(a){return b._handleMouseOver(a?a:f.event)}}),a.push({target:this._overlayDiv,type:"mouseout",handler:function(a){return b._handleMouseOut(a?a:f.event)}}),a.push({target:this._overlayDiv,type:"contextmenu",handler:function(a){return b._handleContextMenu(a?a:f.event)}}));this._isW3CEvents||a.push({target:this._clientDiv,
+type:"dblclick",handler:function(a){return b._handleDblclick(a?a:f.event)}})}this._hookRulerEvents(this._leftDiv,a);this._hookRulerEvents(this._rightDiv,a);this._hookRulerEvents(this._marginDiv,a);for(d=0;d<a.length;d++)k=a[d],s(k.target,k.type,k.handler,k.capture)},_hookRulerEvents:function(b,a){if(b){var c=this,d=this._getWindow();e.isIE&&a.push({target:b,type:"selectstart",handler:function(){return!1}});a.push({target:b,type:e.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(b){return c._handleMouseWheel(b?
+b:d.event)}});a.push({target:b,type:"click",handler:function(b){c._handleRulerEvent(b?b:d.event)}});a.push({target:b,type:"dblclick",handler:function(b){c._handleRulerEvent(b?b:d.event)}});a.push({target:b,type:"mousemove",handler:function(b){c._handleRulerEvent(b?b:d.event)}});a.push({target:b,type:"mouseover",handler:function(b){c._handleRulerEvent(b?b:d.event)}});a.push({target:b,type:"mouseout",handler:function(b){c._handleRulerEvent(b?b:d.event)}})}},_getWindow:function(){return this._parent.ownerDocument.defaultView||
+this._parent.ownerDocument.parentWindow},_ignoreEvent:function(b){for(b=b.target;b&&b!==this._clientDiv;){if(b.ignore)return!0;b=b.parentNode}return!1},_init:function(b){var a=b.parent;"string"===typeof a&&(a=(b.document||document).getElementById(a));if(!a)throw"no parent";b.parent=a;b.model=b.model||new n.TextModel;var c=this._defaultOptions(),d;for(d in c)c.hasOwnProperty(d)&&(this["_"+d]=void 0!==b[d]?b[d]:c[d].value);this._keyModes=[];this._rulers=[];this._selection=new x(0,0,!1);this._linksVisible=
+!1;this._maxLineWidth=this._redrawCount=0;this._maxLineIndex=-1;this._ignoreSelect=!0;this._hasFocus=this._ignoreFocus=!1;this._dragOffset=this._columnX=-1;this._isRangeRects=(!e.isIE||9<=e.isIE)&&"function"===typeof a.ownerDocument.createRange().getBoundingClientRect;this._isW3CEvents=a.addEventListener;this._autoScrollTimerID=this._autoScrollY=this._autoScrollX=null;this._AUTO_SCROLL_RATE=50;this._mouseUpClosure=this._moseMoveClosure=this._grabControl=null;this._clickCount=this._lastMouseTime=this._lastMouseY=
+this._lastMouseX=0;this._clickTime=250;this._clickDist=5;this._isMouseDown=!1;this._doubleClickSelection=null;this._vScroll=this._hScroll=0;this._imeOffset=-1;this._createActions();this._createView()},_modifyContent:function(b,a){if(!this._readonly||b._code)if(b.type="Verify",this.onVerify(b),!(null===b.text||void 0===b.text)){var c=this._model;try{b._ignoreDOMSelection&&(this._ignoreDOMSelection=!0),c.setText(b.text,b.start,b.end)}finally{b._ignoreDOMSelection&&(this._ignoreDOMSelection=!1)}a&&(c=
+this._getSelection(),c.setCaret(b.start+b.text.length),this._setSelection(c,!0));this.onModify({type:"Modify"})}},_onModelChanged:function(b){b.type="ModelChanged";this.onModelChanged(b);b.type="Changed";var a=b.start,c=b.addedCharCount,d=b.removedCharCount,k=b.addedLineCount,e=b.removedLineCount,m=this._getSelection();m.end>a&&(m.end>a&&m.start<a+d?m.setCaret(a+c):(m.start+=c-d,m.end+=c-d),this._setSelection(m,!1,!1));a=this._model.getLineAtOffset(a);for(c=this._getLineNext();c;)d=c.lineIndex,a<=
+d&&d<=a+e&&(a===d&&!c.modelChangedEvent&&!c.lineRemoved?(c.modelChangedEvent=b,c.lineChanged=!0):(c.lineRemoved=!0,c.lineChanged=!1,c.modelChangedEvent=null)),d>a+e&&(c.lineIndex=d+k-e,c._line.lineIndex=c.lineIndex),c=this._getLineNext(c);this._lineHeight&&(b=[a,e].concat(Array(k)),Array.prototype.splice.apply(this._lineHeight,b));!this._wrapMode&&(a<=this._maxLineIndex&&this._maxLineIndex<=a+e)&&(this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0);this._update()},
+_onModelChanging:function(b){b.type="ModelChanging";this.onModelChanging(b);b.type="Changing"},_queueUpdate:function(){if(!this._updateTimer&&!this._ignoreQueueUpdate){var b=this;this._updateTimer=this._getWindow().setTimeout(function(){b._updateTimer=null;b._update()},0)}},_resetLineHeight:function(b,a){if(this._wrapMode||this._variableLineHeight){if(void 0!==b&&void 0!==a)for(var c=b;c<a;c++)this._lineHeight[c]=void 0;else this._lineHeight=Array(this._model.getLineCount());this._calculateLineHeightTimer()}else this._lineHeight=
+null},_resetLineWidth:function(){var b=this._clientDiv;if(b)for(b=b.firstChild;b;)b.lineWidth=void 0,b=b.nextSibling},_reset:function(){this._maxLineIndex=-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._topIndexY=0;this._variableLineHeight=!1;this._resetLineHeight();this._setSelection(new x(0,0,!1),!1,!1);this._viewDiv&&(this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=0);var b=this._clientDiv;if(b){for(var a=b.firstChild;a;)a.lineRemoved=!0,a=a.nextSibling;
+e.isFirefox&&(this._ignoreFocus=!1,(a=this._hasFocus)&&b.blur(),b.contentEditable=!1,b.contentEditable=!0,a&&b.focus(),this._ignoreFocus=!1)}},_scrollViewAnimated:function(b,a,c){var d=this._getWindow();if(c&&this._scrollAnimation){var k=this;this._animation=new z({window:d,duration:this._scrollAnimation,curve:[a,0],onAnimate:function(b){b=a-Math.floor(b);k._scrollView(0,b);a-=b},onEnd:function(){k._animation=null;k._scrollView(b,a);c&&d.setTimeout(c,0)}});this._animation.play()}else this._scrollView(b,
+a),c&&d.setTimeout(c,0)},_scrollView:function(b,a){this._ensureCaretVisible=!1;var c=this._viewDiv;b&&(c.scrollLeft+=b);a&&(c.scrollTop+=a)},_setClipboardText:function(b,a){var c,d=this._getWindow(),m=d.clipboardData;!m&&a&&(m=a.clipboardData);if(m&&(c=[],k(b,function(b){c.push(b)},function(){c.push(e.platformDelimiter)}),m.setData(e.isIE?"Text":"text/plain",c.join(""))))return!0;var f=this._parent.ownerDocument,h=e.createElement(f,"pre");h.style.position="fixed";h.style.left="-1000px";k(b,function(b){h.appendChild(f.createTextNode(b))},
+function(){h.appendChild(e.createElement(f,"br"))});h.appendChild(f.createTextNode(" "));this._clientDiv.appendChild(h);m=f.createRange();m.setStart(h.firstChild,0);m.setEndBefore(h.lastChild);var r=d.getSelection();0<r.rangeCount&&r.removeAllRanges();r.addRange(m);var g=this,m=function(){h&&h.parentNode===g._clientDiv&&g._clientDiv.removeChild(h);g._updateDOMSelection()},r=!1;this._ignoreCopy=!0;try{r=f.execCommand("copy",!1,null)}catch(l){}this._ignoreCopy=!1;if(!r&&a)return d.setTimeout(m,0),!1;
+m();return!0},_setDOMSelection:function(b,a,c,d,k){for(var m,f,h,r,g=0,l=b.firstChild,s,t,v=this._model.getLine(b.lineIndex).length;l;){if(!l.ignore){s=l.firstChild;t=s.length;l.ignoreChars&&(t-=l.ignoreChars);if(g+t>a||g+t>=v){m=s;f=a-g;l.ignoreChars&&(0<t&&f===t)&&(f+=l.ignoreChars);break}g+=t}l=l.nextSibling}for(var g=0,l=c.firstChild,x=this._model.getLine(c.lineIndex).length;l;){if(!l.ignore){s=l.firstChild;t=s.length;l.ignoreChars&&(t-=l.ignoreChars);if(t+g>d||g+t>=x){h=s;r=d-g;l.ignoreChars&&
+(0<t&&r===t)&&(r+=l.ignoreChars);break}g+=t}l=l.nextSibling}this._setDOMFullSelection(b,a,v,c,d,x);b=this._getWindow();a=this._parent.ownerDocument;if(b.getSelection){c=b.getSelection();b=a.createRange();b.setStart(m,f);b.setEnd(h,r);if(this._hasFocus&&(c.anchorNode!==m||c.anchorOffset!==f||c.focusNode!==h||c.focusOffset!==r||c.anchorNode!==h||c.anchorOffset!==r||c.focusNode!==m||c.focusOffset!==f))this._anchorNode=m,this._anchorOffset=f,this._focusNode=h,this._focusOffset=r,this._ignoreSelect=!1,
+0<c.rangeCount&&c.removeAllRanges(),c.addRange(b),this._ignoreSelect=!0;this._cursorDiv&&(b=a.createRange(),k?(b.setStart(m,f),b.setEnd(m,f)):(b.setStart(h,r),b.setEnd(h,r)),h=b.getClientRects()[0],r=this._cursorDiv.parentNode,m=r.getBoundingClientRect(),h&&m&&(this._cursorDiv.style.top=h.top-m.top+r.scrollTop+"px",this._cursorDiv.style.left=h.left-m.left+r.scrollLeft+"px"))}else a.selection&&this._hasFocus&&(k=a.body,b=e.createElement(a,"div"),k.appendChild(b),k.removeChild(b),b=k.createTextRange(),
+b.moveToElementText(m.parentNode),b.moveStart("character",f),m=k.createTextRange(),m.moveToElementText(h.parentNode),m.moveStart("character",r),b.setEndPoint("EndToStart",m),this._ignoreSelect=!1,b.select(),this._ignoreSelect=!0)},_setDOMFullSelection:function(b,a,c,d,k){if(this._selDiv1&&(c=this._selDiv1,c.style.width="0px",c.style.height="0px",c=this._selDiv2,c.style.width="0px",c.style.height="0px",c=this._selDiv3,c.style.width="0px",c.style.height="0px",!(b===d&&a===k))){var e=this._model,m=this._getViewPadding(),
+f=this._clientDiv.getBoundingClientRect(),h=this._viewDiv.getBoundingClientRect(),c=h.left+m.left,r=f.right,m=h.top+m.top,g=f.bottom,h=f=0;this._clipDiv?(h=this._clipDiv.getBoundingClientRect(),f=h.left-this._clipDiv.scrollLeft):(h=this._rootDiv.getBoundingClientRect(),f=h.left);h=h.top;this._ignoreDOMSelection=!0;var l=(new t(this,b.lineIndex,b)).getBoundingClientRect(e.getLineStart(b.lineIndex)+a,!1),s=l.left,a=(new t(this,d.lineIndex,d)).getBoundingClientRect(e.getLineStart(d.lineIndex)+k,!1),
+e=a.left;this._ignoreDOMSelection=!1;var v=this._selDiv1,s=Math.min(r,Math.max(c,s)),x=Math.min(g,Math.max(m,l.top)),u=r,k=Math.min(g,Math.max(m,l.bottom));v.style.left=s-f+"px";v.style.top=x-h+"px";v.style.width=Math.max(0,u-s)+"px";v.style.height=Math.max(0,k-x)+"px";b.lineIndex===d.lineIndex?(u=Math.min(e,r),v.style.width=Math.max(0,u-s)+"px"):(l=Math.min(g,Math.max(m,a.top)),e=Math.min(r,Math.max(c,e)),m=Math.min(g,Math.max(m,a.bottom)),g=this._selDiv3,g.style.left=c-f+"px",g.style.top=l-h+"px",
+g.style.width=Math.max(0,e-c)+"px",g.style.height=Math.max(0,m-l)+"px",1<Math.abs(b.lineIndex-d.lineIndex)&&(b=this._selDiv2,b.style.left=c-f+"px",b.style.top=k-h+"px",b.style.width=Math.max(0,r-c)+"px",b.style.height=Math.max(0,l-k)+"px"))}},_setGrab:function(b){b!==this._grabControl&&(b?(b.setCapture&&b.setCapture(),this._grabControl=b):(this._grabControl.releaseCapture&&this._grabControl.releaseCapture(),this._grabControl=null))},_setLinksVisible:function(b){if(this._linksVisible!==b){this._linksVisible=
+b;e.isIE&&b&&(this._hadFocus=this._hasFocus);var a=this._clientDiv;a.contentEditable=!b;this._hadFocus&&!b&&a.focus();this._overlayDiv&&(this._overlayDiv.style.zIndex=b?"-1":"1");for(b=this._getLineNext();b;){if(b.hasLink)for(a=b.firstChild;a;)if(a.ignore)a=a.nextSibling;else{var c=a.nextSibling,d=a.viewStyle;d&&(d.tagName&&"a"===d.tagName.toLowerCase())&&b.replaceChild(b._line._createSpan(b,a.firstChild.data,d),a);a=c}b=this._getLineNext(b)}this._updateDOMSelection()}},_setSelection:function(b,a,
+c,d,k){if(b){this._columnX=-1;void 0===c&&(c=!0);var e=this._selection;this._selection=b;!1!==a&&this._showCaret(!1,d,a,k);c&&this._updateDOMSelection();if(!e.equals(b))this.onSelection({type:"Selection",oldValue:{start:e.start,end:e.end},newValue:{start:b.start,end:b.end}})}},_setSelectionTo:function(b,a,c,d){var k=this._model,e=this._getSelection(),a=this.convert({x:b,y:a},"page","document"),b=this._getLineIndex(a.y);if(1===this._clickCount){k=this._getLine(b);b=k.getOffset(a.x,a.y-this._getLinePixel(b));
+k.destroy();if(d&&!c&&e.start<=b&&b<e.end)return this._dragOffset=b,!1;e.extend(b);c||e.collapse()}else 0===(this._clickCount&1)?(k=this._getLine(b),b=k.getOffset(a.x,a.y-this._getLinePixel(b)),this._doubleClickSelection?b>=this._doubleClickSelection.start?(c=this._doubleClickSelection.start,d=k.getNextOffset(b,{unit:"wordend",count:1})):(c=k.getNextOffset(b,{unit:"word",count:-1}),d=this._doubleClickSelection.end):(c=k.getNextOffset(b,{unit:"word",count:-1}),d=k.getNextOffset(c,{unit:"wordend",count:1})),
+k.destroy()):this._doubleClickSelection?(d=k.getLineAtOffset(this._doubleClickSelection.start),b>=d?(c=k.getLineStart(d),d=k.getLineEnd(b)):(c=k.getLineStart(b),d=k.getLineEnd(d))):(c=k.getLineStart(b),d=k.getLineEnd(b)),e.setCaret(c),e.extend(d);this._setSelection(e,!0,!0);return!0},_setFullSelection:function(b,a){this._fullSelection=b;e.isWebkit&&(this._fullSelection=!0);var c=this._clipDiv||this._rootDiv;if(c)if(this._fullSelection){if(!this._selDiv1&&this._fullSelection&&!e.isIOS){var d=c.ownerDocument;
+this._highlightRGB=e.isWebkit?"transparent":"Highlight";var k=e.createElement(d,"div");this._selDiv1=k;k.style.position="absolute";k.style.borderWidth="0px";k.style.margin="0px";k.style.padding="0px";k.style.outline="none";k.style.background=this._highlightRGB;k.style.width="0px";k.style.height="0px";k.style.zIndex="0";c.appendChild(k);var m=e.createElement(d,"div");this._selDiv2=m;m.style.position="absolute";m.style.borderWidth="0px";m.style.margin="0px";m.style.padding="0px";m.style.outline="none";
+m.style.background=this._highlightRGB;m.style.width="0px";m.style.height="0px";m.style.zIndex="0";c.appendChild(m);this._selDiv3=d=e.createElement(d,"div");d.style.position="absolute";d.style.borderWidth="0px";d.style.margin="0px";d.style.padding="0px";d.style.outline="none";d.style.background=this._highlightRGB;d.style.width="0px";d.style.height="0px";d.style.zIndex="0";c.appendChild(d);if(e.isFirefox&&e.isMac){c=this._getWindow().getComputedStyle(d,null).getPropertyValue("background-color");switch(c){case "rgb(119, 141, 168)":c=
+"rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":c="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":c="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":c="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":c="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":c="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":c="rgb(232, 184, 255)";break;default:c="rgb(180, 213, 255)"}this._highlightRGB=c;k.style.background=c;m.style.background=c;d.style.background=c}a||this._updateDOMSelection()}}else this._selDiv1&&
+(c.removeChild(this._selDiv1),this._selDiv1=null),this._selDiv2&&(c.removeChild(this._selDiv2),this._selDiv2=null),this._selDiv3&&(c.removeChild(this._selDiv3),this._selDiv3=null)},_setBlockCursor:function(b){this._blockCursorVisible=b;this._updateBlockCursorVisible()},_setOverwriteMode:function(b){this._overwriteMode=b;this._updateBlockCursorVisible()},_updateBlockCursorVisible:function(){if(this._blockCursorVisible||this._overwriteMode){if(!this._cursorDiv){var b=e.createElement(document,"div");
+b.className="textviewBlockCursor";this._cursorDiv=b;b.tabIndex=-1;b.style.zIndex="2";b.style.color="transparent";b.style.position="absolute";b.style.pointerEvents="none";b.innerHTML="&nbsp;";this._viewDiv.appendChild(b);this._updateDOMSelection()}}else this._cursorDiv&&(this._cursorDiv.parentNode.removeChild(this._cursorDiv),this._cursorDiv=null)},_setMarginOffset:function(b,a){this._marginOffset=b;this._marginDiv.style.display=b?"block":"none";a||(this._metrics=this._calculateMetrics(),this._queueUpdate())},
+_setWrapOffset:function(b,a){this._wrapOffset=b;a||(this._metrics=this._calculateMetrics(),this._queueUpdate())},_setReadOnly:function(b){this._readonly=b;this._clientDiv.setAttribute("aria-readonly",b?"true":"false")},_setSingleMode:function(b,a){this._singleMode=b;this._updateOverflow();this._updateStyle(a)},_setTabSize:function(b,a){this._tabSize=b;this._customTabSize=void 0;var c=this._clientDiv;e.isOpera?c&&(c.style.OTabSize=this._tabSize+""):537.1<=e.isWebkit?c&&(c.style.tabSize=this._tabSize+
+""):4<=e.isFirefox?c&&(c.style.MozTabSize=this._tabSize+""):8!==this._tabSize&&(this._customTabSize=this._tabSize);a||(this.redrawLines(),this._resetLineWidth())},_setTheme:function(b){this._theme&&this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);(this._theme=b)&&this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);this._setThemeClass(this._themeClass)},_setThemeClass:function(b,a){this._themeClass=b;var c="textview",d=this._theme.getThemeClass();
+d&&(c+=" "+d);this._themeClass&&d!==this._themeClass&&(c+=" "+this._themeClass);this._rootDiv.className=c;this._updateStyle(a)},_setWrapMode:function(b,a){this._wrapMode=b&&this._wrappable;var c=this._clientDiv;this._wrapMode?(c.style.whiteSpace="pre-wrap",c.style.wordWrap="break-word"):(c.style.whiteSpace="pre",c.style.wordWrap="normal");this._updateOverflow();a||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(b,a,c,d){if(this._clientDiv){var k=this._model,e=this._getSelection(),
+m=this._getScroll(),f=e.getCaret(),h=e.start,r=e.end,g=k.getLineAtOffset(r),l=Math.max(Math.max(h,k.getLineStart(g)),r-1),k=this._getClientWidth(),g=this._getClientHeight(),s=k/4,t=this._getBoundsAtOffset(f===h?h:l),v=t.left,x=t.right,u=t.top,y=t.bottom;b&&!e.isEmpty()&&(t=this._getBoundsAtOffset(f===r?h:l),t.top===u?f===h?x=v+Math.min(t.right-v,k):v=x-Math.min(x-t.left,k):f===h?y=u+Math.min(t.bottom-u,g):u=y-Math.min(y-t.top,g));b=0;v<m.x&&(b=Math.min(v-m.x,-s));x>m.x+k&&(b=Math.max(x-m.x-k,s));
+e=0;u<m.y?e=u-m.y:y>m.y+g&&(e=y-m.y-g);d&&(0<d?0<e&&(e=Math.max(e,d)):0>e&&(e=Math.min(e,d)));if(0!==b||0!==e)return 0!==e&&"number"===typeof c&&(0>c&&(c=0),1<c&&(c=1),e+=Math.floor(0<e?c*g:-c*g)),this._scrollViewAnimated(b,e,a),g!==this._getClientHeight()||k!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0;a&&a();return!1}},_startIME:function(){if(-1===this._imeOffset){var b=this._getSelection();b.isEmpty()||this._modifyContent({text:"",start:b.start,end:b.end},!0);this._imeOffset=
+b.start}},_unhookEvents:function(){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);this._modelListener=null;for(var b=0;b<this._handlers.length;b++){var a=this._handlers[b];v(a.target,a.type,a.handler)}this._handlers=null;this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null)},_updateDOMSelection:function(){if(!(0<
+this._redrawCount)&&!this._ignoreDOMSelection&&this._clientDiv){var b=this._getSelection(),a=this._model,c=a.getLineAtOffset(b.start),d=a.getLineAtOffset(b.end),k=this._getLineNext();if(k){var e=this._getLinePrevious(),m;c<k.lineIndex?(m=k,c=0):c>e.lineIndex?(m=e,c=0):(m=this._getLineNode(c),c=b.start-a.getLineStart(c));d<k.lineIndex?a=0:d>e.lineIndex?(k=e,a=0):(k=this._getLineNode(d),a=b.end-a.getLineStart(d));this._setDOMSelection(m,c,k,a,b.caret)}}},_update:function(b){if(!(0<this._redrawCount)){this._updateTimer&&
+(this._getWindow().clearTimeout(this._updateTimer),this._updateTimer=null,b=!1);var a=this._clientDiv,c=this._viewDiv;if(a){this._metrics.invalid&&(this._ignoreQueueUpdate=!0,this._updateStyle(),this._ignoreQueueUpdate=!1);var d=this._model,k=this._getScroll(!1),m=this._getViewPadding(),f=d.getLineCount(),h=this._getLineHeight(),r=!1,g=!1,l=!1,s=this._metrics.scrollWidth;this._wrapMode&&(a.style.width=(this._metrics.wrapWidth||this._getClientWidth())+"px");var v,x,u,y,p=0,n=0,z;if(this._lineHeight){for(;n<
+f;){z=this._getLineHeight(n);if(p+z>k.y)break;p+=z;n++}v=n;x=Math.max(0,v-1);u=d=k.y-p;0<v&&(d+=this._getLineHeight(v-1))}else y=Math.max(0,k.y)/h,v=Math.floor(y),x=Math.max(0,v-1),d=Math.round((y-x)*h),u=Math.round((y-v)*h);this._topIndexY=u;y=this._rootDiv;var Q=y.clientWidth,K=y.clientHeight;if(b){h=0;this._leftDiv&&(v=this._leftDiv.getBoundingClientRect(),h=v.right-v.left);v=this._getClientWidth();y=this._getClientHeight();g=v;this._wrapMode?this._metrics.wrapWidth&&(g=this._metrics.wrapWidth):
+g=Math.max(this._maxLineWidth,g);for(;n<f;)z=this._getLineHeight(n,!1),p+=z,n++;f=p}else{y=this._getClientHeight();u=Math.min(v+Math.floor((y+u)/h),f-1);var k=Math.min(u+1,f-1),G;for(z=a.firstChild;z;){G=z.lineIndex;var F=z.nextSibling;if(!(x<=G&&G<=k)||z.lineRemoved||-1===z.lineIndex)this._mouseWheelLine===z?(z.style.display="none",z.lineIndex=-1):a.removeChild(z);z=F}z=this._getLineNext();var F=c.ownerDocument,L=F.createDocumentFragment();for(G=x;G<=k;G++)!z||z.lineIndex>G?(new t(this,G)).create(L,
+null):(L.firstChild&&(a.insertBefore(L,z),L=F.createDocumentFragment()),z&&z.lineChanged&&(z=(new t(this,G)).create(L,z),z.lineChanged=!1),z=this._getLineNext(z));L.firstChild&&a.insertBefore(L,z);e.isWebkit&&!this._wrapMode&&(a.style.width="0x7fffffffpx");z=this._getLineNext();G=y+d;for(L=!1;z;)x=z.lineWidth,void 0===x&&(F=z._line.getBoundingClientRect(),x=z.lineWidth=Math.ceil(F.right-F.left),F=F.bottom-F.top,this._lineHeight?this._lineHeight[z.lineIndex]=F:0!==h&&(0!==F&&Math.ceil(h)!==Math.ceil(F))&&
+(this._variableLineHeight=!0,this._lineHeight=[],this._lineHeight[z.lineIndex]=F)),this._lineHeight&&!L&&(G-=this._lineHeight[z.lineIndex],0>G&&(u=z.lineIndex,L=!0)),this._wrapMode||(x>=this._maxLineWidth&&(this._maxLineWidth=x,this._maxLineIndex=z.lineIndex),this._checkMaxLineIndex===z.lineIndex&&(this._checkMaxLineIndex=-1)),z.lineIndex===v&&(this._topChild=z),z.lineIndex===u&&(this._bottomChild=z),z=this._getLineNext(z);-1!==this._checkMaxLineIndex&&(G=this._checkMaxLineIndex,this._checkMaxLineIndex=
+-1,0<=G&&G<f&&(h=new t(this,G),F=h.getBoundingClientRect(),x=F.right-F.left,x>=this._maxLineWidth&&(this._maxLineWidth=x,this._maxLineIndex=G),h.destroy()));for(;n<f;)z=this._getLineHeight(n,n<=u),p+=z,n++;f=p;this._updateRuler(this._leftDiv,v,k,K);this._updateRuler(this._rightDiv,v,k,K);this._updateRuler(this._marginDiv,v,k,K);h=0;this._leftDiv&&(v=this._leftDiv.getBoundingClientRect(),h=v.right-v.left);k=0;this._rightDiv&&(k=this._rightDiv.getBoundingClientRect(),k=k.right-k.left);c.style.left=
+h+"px";c.style.right=k+"px";k=this._scrollDiv;k.style.height=f+"px";v=this._getClientWidth();!this._singleMode&&!this._wrapMode&&(p=r=y,(n="scroll"===c.style.overflowX)?r+=s:p-=s,z=u=v,(x="scroll"===c.style.overflowY)?u+=s:z-=s,y=r,v=u,f>y&&(l=!0,v=z),this._maxLineWidth>v&&(g=!0,y=p,f>y&&(l=!0,v=z)),n!==g&&(c.style.overflowX=g?"scroll":"hidden"),x!==l&&(c.style.overflowY=l?"scroll":"hidden"),r=n!==g||x!==l);l=v;this._wrapMode?this._metrics.wrapWidth&&(l=this._metrics.wrapWidth):l=Math.max(this._maxLineWidth,
+l);g=l;if((!e.isIE||9<=e.isIE)&&this._maxLineWidth>v)l+=m.right+m.left;k.style.width=l+"px";this._clipScrollDiv&&(this._clipScrollDiv.style.width=l+"px");k=this._getScroll(!1)}this._vScrollDiv&&(l=y-8,p=Math.max(15,Math.ceil(Math.min(1,l/(f+m.top+m.bottom))*l)),this._vScrollDiv.style.left=h+v-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,k.y*l/f))+"px",this._vScrollDiv.style.height=p+"px");!this._wrapMode&&this._hScrollDiv&&(l=v-8,p=Math.max(15,Math.ceil(Math.min(1,l/(this._maxLineWidth+
+m.left+m.right))*l)),this._hScrollDiv.style.left=h+Math.floor(Math.max(0,Math.floor(k.x*l/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=y-9+"px",this._hScrollDiv.style.width=p+"px");n=k.x;p=this._clipDiv;l=this._overlayDiv;if(u=this._marginDiv)u.style.left=-n+h+this._metrics.marginWidth+m.left+"px",u.style.bottom=("scroll"===c.style.overflowX?s:0)+"px";p?(p.scrollLeft=n,p.scrollTop=0,c=h+m.left,s=m.top,b=v,h=y,n=0,u=-d,0===k.x&&(c-=m.left,b+=m.left,n=m.left),k.x+v===g&&(b+=m.right),0===k.y&&
+(s-=m.top,h+=m.top,u+=m.top),k.y+y===f&&(h+=m.bottom),p.style.left=c+"px",p.style.top=s+"px",p.style.right=Q-b-c+"px",p.style.bottom=K-h-s+"px",a.style.left=n+"px",a.style.top=u+"px",a.style.width=g+"px",a.style.height=y+d+"px",l&&(l.style.left=a.style.left,l.style.top=a.style.top,l.style.width=a.style.width,l.style.height=a.style.height)):(c=n,s=d,Q=n+v,K=d+y,0===c&&(c-=m.left),0===s&&(s-=m.top),Q===g&&(Q+=m.right),k.y+y===f&&(K+=m.bottom),a.style.clip="rect("+s+"px,"+Q+"px,"+K+"px,"+c+"px)",a.style.left=
+-n+h+m.left+"px",a.style.width=(this._wrapMode||e.isWebkit?g:v+n)+"px",b||(a.style.top=-d+m.top+"px",a.style.height=y+d+"px"),l&&(l.style.clip=a.style.clip,l.style.left=a.style.left,l.style.width=a.style.width,b||(l.style.top=a.style.top,l.style.height=a.style.height)));this._updateDOMSelection();r&&(a=this._ensureCaretVisible,this._ensureCaretVisible=!1,a&&this._showCaret(),this._queueUpdate())}}},_updateOverflow:function(){var b=this._viewDiv;this._wrapMode?(b.style.overflowX="hidden",b.style.overflowY=
+"scroll"):b.style.overflow="hidden"},_updateRuler:function(b,a,c,k){if(b)for(var m=this._parent.ownerDocument,f=this._getLineHeight(),h=this._getViewPadding(),b=b.firstChild;b;){var r=b._ruler,g=f,l=r.getOverview();"page"===l&&(g+=this._topIndexY);b.style.top=-g+"px";b.style.height=k+g+"px";b.rulerChanged&&d(r.getRulerStyle(),b);var s,t=b.firstChild;t?(s=t,t=t.nextSibling):(s=e.createElement(m,"div"),s.style.visibility="hidden",b.appendChild(s));var v;if(b.rulerChanged&&s){g=-1;if(v=r.getWidestAnnotation())d(v.style,
+s),v.html&&(s.innerHTML=v.html);s.lineIndex=g;s.style.height=f+h.top+"px"}var x;if("page"===l){for(r=r.getAnnotations(a,c+1);t;)g=t.lineIndex,v=t.nextSibling,(!(a<=g&&g<=c)||t.lineChanged)&&b.removeChild(t),t=v;t=b.firstChild.nextSibling;x=m.createDocumentFragment();for(g=a;g<=c;g++)if(!t||t.lineIndex>g){s=e.createElement(m,"div");if(v=r[g])d(v.style,s),v.html&&(s.innerHTML=v.html),s.annotation=v;s.lineIndex=g;s.style.height=this._getLineHeight(g)+"px";x.appendChild(s)}else x.firstChild&&(b.insertBefore(x,
+t),x=m.createDocumentFragment()),t&&(t=t.nextSibling);x.firstChild&&b.insertBefore(x,t)}else{v=this._getClientHeight();g=this._model.getLineCount();t=v+h.top+h.bottom-2*this._metrics.scrollWidth;l=f*g<t?f:t/g;if(b.rulerChanged){for(v=b.childNodes.length;1<v;)b.removeChild(b.lastChild),v--;r=r.getAnnotations(0,g);x=m.createDocumentFragment();for(var u in r)g=u>>>0,0>g||(s=e.createElement(m,"div"),v=r[u],d(v.style,s),s.style.position="absolute",s.style.top=this._metrics.scrollWidth+f+Math.floor(g*l)+
+"px",v.html&&(s.innerHTML=v.html),s.annotation=v,s.lineIndex=g,x.appendChild(s));b.appendChild(x)}else if(b._oldTrackHeight!==t)for(s=b.firstChild?b.firstChild.nextSibling:null;s;)s.style.top=this._metrics.scrollWidth+f+Math.floor(s.lineIndex*l)+"px",s=s.nextSibling;b._oldTrackHeight=t}b.rulerChanged=!1;b=b.nextSibling}},_updateStyleSheet:function(){var b="";e.isWebkit&&0<this._metrics.scrollWidth&&(b+="\n.textview ::-webkit-scrollbar-corner {background: #eeeeee;}");e.isFirefox&&(e.isMac&&this._highlightRGB&&
+"Highlight"!==this._highlightRGB)&&(b+="\n.textview ::-moz-selection {background: "+this._highlightRGB+";}");if(b){var a=document.getElementById("_textviewStyle");if(a)a.removeChild(a.firstChild),a.appendChild(document.createTextNode(b));else{a=e.createElement(document,"style");a.id="_textviewStyle";var c=document.getElementsByTagName("head")[0]||document.documentElement;a.appendChild(document.createTextNode(b));c.insertBefore(a,c.firstChild)}}},_updateStyle:function(b){!b&&e.isIE&&(this._rootDiv.style.lineHeight=
+"normal");var a=this._metrics=this._calculateMetrics();this._rootDiv.style.lineHeight=e.isIE?a.lineHeight-(a.lineTrim.top+a.lineTrim.bottom)+"px":"normal";this._updateStyleSheet();b||(this.redraw(),this._resetLineWidth())}};a.EventTarget.addMixin(y.prototype);return{TextView:y}});
+define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(g,n){function p(a){this._model=a;this._projections=[];var g=this;this._listener={onChanged:function(a){g._onChanged(a)},onChanging:function(a){g._onChanging(a)}};a.addEventListener("postChanged",this._listener.onChanged);a.addEventListener("preChanging",this._listener.onChanging)}p.prototype={destroy:function(){this._model&&(this._model.removeEventListener("preChanged",this._listener.onChanged),
+this._model.removeEventListener("preChanging",this._listener.onChanging),this._model=null)},addProjection:function(a){if(a){var l=this._model,f=this._projections;a._lineIndex=l.getLineAtOffset(a.start);a._lineCount=l.getLineAtOffset(a.end)-a._lineIndex;var e=a.text;e||(e="");a._model="string"===typeof e?new g.TextModel(e,l.getLineDelimiter()):e;var l=this.mapOffset(a.start,!0),e=a.end-a.start,d=a._lineCount,h=a._model.getCharCount(),c=a._model.getLineCount()-1,b={type:"Changing",text:a._model.getText(),
+start:l,removedCharCount:e,addedCharCount:h,removedLineCount:d,addedLineCount:c};this.onChanging(b);b=this._binarySearch(f,a.start);f.splice(b,0,a);this.onChanged({type:"Changed",start:l,removedCharCount:e,addedCharCount:h,removedLineCount:d,addedLineCount:c})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(a,g){var f=this._projections,e=0,d,h;if(g){for(d=0;d<f.length;d++){h=f[d];if(h.start>a)break;if(h.end>a)return-1;e+=
+h._model.getCharCount()-(h.end-h.start)}return a+e}for(d=0;d<f.length;d++){h=f[d];if(h.start>a-e)break;var c=h._model.getCharCount();if(h.start+c>a-e)return-1;e+=c-(h.end-h.start)}return a-e},removeProjection:function(a){var g,f=0;for(g=0;g<this._projections.length;g++){var e=this._projections[g];if(e===a){a=e;break}f+=e._model.getCharCount()-(e.end-e.start)}if(g<this._projections.length){var e=this._model,f=a.start+f,d=a.end-a.start,h=a._lineCount,c=a._model.getCharCount(),b=a._model.getLineCount()-
+1,a={type:"Changing",text:e.getText(a.start,a.end),start:f,removedCharCount:c,addedCharCount:d,removedLineCount:b,addedLineCount:h};this.onChanging(a);this._projections.splice(g,1);this.onChanged({type:"Changed",start:f,removedCharCount:c,addedCharCount:d,removedLineCount:b,addedLineCount:h})}},_binarySearch:function(a,g){for(var f=a.length,e=-1,d;1<f-e;)d=Math.floor((f+e)/2),g<=a[d].start?f=d:e=d;return f},getCharCount:function(){for(var a=this._model.getCharCount(),g=this._projections,f=0;f<g.length;f++)var e=
+g[f],a=a+(e._model.getCharCount()-(e.end-e.start));return a},getLine:function(a,g){if(0>a)return null;var f=this._model,e=this._projections,d=0,h=[],c=0,b,k,m;for(b=0;b<e.length;b++){m=e[b];if(m._lineIndex>=a-d)break;k=m._model.getLineCount()-1;if(m._lineIndex+k>=a-d){c=a-(m._lineIndex+d);if(c<k)return m._model.getLine(c,g);h.push(m._model.getLine(k))}c=m.end;d+=k-m._lineCount}for(c=Math.max(c,f.getLineStart(a-d));b<e.length;b++){m=e[b];if(m._lineIndex>a-d)break;h.push(f.getText(c,m.start));k=m._model.getLineCount()-
+1;if(m._lineIndex+k>a-d)return h.push(m._model.getLine(0,g)),h.join("");h.push(m._model.getText());c=m.end;d+=k-m._lineCount}e=f.getLineEnd(a-d,g);c<e&&h.push(f.getText(c,e));return h.join("")},getLineAtOffset:function(a){for(var g=this._model,f=this._projections,e=0,d=0,h=0;h<f.length;h++){var c=f[h];if(c.start>a-e)break;var b=c._model.getCharCount();if(c.start+b>a-e){f=a-(c.start+e);d+=c._model.getLineAtOffset(f);e+=f;break}d+=c._model.getLineCount()-1-c._lineCount;e+=b-(c.end-c.start)}return g.getLineAtOffset(a-
+e)+d},getLineCount:function(){for(var a=this._projections,g=this._model.getLineCount(),f=0;f<a.length;f++)var e=a[f],g=g+(e._model.getLineCount()-1-e._lineCount);return g},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(a,g){if(0>a)return-1;for(var f=this._model,e=this._projections,d=0,h=0,c=0;c<e.length;c++){var b=e[c];if(b._lineIndex>a-d)break;var k=b._model.getLineCount()-1;if(b._lineIndex+k>a-d)return b._model.getLineEnd(a-(b._lineIndex+d),g)+b.start+h;h+=
+b._model.getCharCount()-(b.end-b.start);d+=k-b._lineCount}return f.getLineEnd(a-d,g)+h},getLineStart:function(a){if(0>a)return-1;for(var g=this._model,f=this._projections,e=0,d=0,h=0;h<f.length;h++){var c=f[h];if(c._lineIndex>=a-e)break;var b=c._model.getLineCount()-1;if(c._lineIndex+b>=a-e)return c._model.getLineStart(a-(c._lineIndex+e))+c.start+d;d+=c._model.getCharCount()-(c.end-c.start);e+=b-c._lineCount}return g.getLineStart(a-e)+d},getText:function(a,g){void 0===a&&(a=0);var f=this._model,e=
+this._projections,d=0,h=[],c,b,k;for(c=0;c<e.length;c++){b=e[c];if(b.start>a-d)break;k=b._model.getCharCount();if(b.start+k>a-d){if(void 0!==g&&b.start+k>g-d)return b._model.getText(a-(b.start+d),g-(b.start+d));h.push(b._model.getText(a-(b.start+d)));a=b.end+d+k-(b.end-b.start)}d+=k-(b.end-b.start)}var m=a-d;if(void 0!==g){for(;c<e.length;c++){b=e[c];if(b.start>g-d)break;h.push(f.getText(m,b.start));k=b._model.getCharCount();if(b.start+k>g-d)return h.push(b._model.getText(0,g-(b.start+d))),h.join("");
+h.push(b._model.getText());m=b.end;d+=k-(b.end-b.start)}h.push(f.getText(m,g-d))}else{for(;c<e.length;c++)b=e[c],h.push(f.getText(m,b.start)),h.push(b._model.getText()),m=b.end;h.push(f.getText(m))}return h.join("")},_onChanged:function(){var a=this._change,g=a.baseStart,f=a.baseEnd,e,d,h=this._projections;for(e=0;e<h.length&&!(d=h[e],d.end>g);e++);var c=e;for(e=0;e<h.length&&!(d=h[e],d.start>=f);e++);var b=e,k=this._model,g=a.baseText.length-(f-g);for(e=b;e<h.length;e++)d=h[e],d.start+=g,d.end+=
+g,d._lineIndex=k.getLineAtOffset(d.start);d=h.splice(c,b-c);for(e=0;e<d.length;e++)d[e].annotation&&d[e].annotation._expand();this.onChanged({type:"Changed",start:a.start,removedCharCount:a.removedCharCount,addedCharCount:a.addedCharCount,removedLineCount:a.removedLineCount,addedLineCount:a.addedLineCount});this._change=void 0},_onChanging:function(a){var g=!!this._change,f=this._change||{},e=a.start,d=e+a.removedCharCount;f.baseStart=e;f.baseEnd=d;f.baseText=a.text;f.addedLineCount=a.addedLineCount;
+if(!g){this._change=f;f.text=a.text;var h=this._projections,c,b,k,a=function(a){for(c=b=0;b<h.length;b++){k=h[b];if(k.start>a)break;if(k.end>a)return-1;c+=k._model.getCharCount()-(k.end-k.start)}return a+c};f.start=a(e);-1===f.start&&(f.text=this._model.getText(k.start,e)+f.text,f.addedLineCount+=this._model.getLineAtOffset(e)-this._model.getLineAtOffset(k.start),f.start=k.start+c);f.end=a(d);-1===f.end&&(f.text+=this._model.getText(d,k.end),f.addedLineCount+=this._model.getLineAtOffset(k.end)-this._model.getLineAtOffset(d),
+f.end=k.start+c)}f.addedCharCount=f.text.length;f.removedCharCount=f.end-f.start;f.removedLineCount=this.getLineAtOffset(f.end)-this.getLineAtOffset(f.start);this.onChanging({type:"Changing",text:f.text,start:f.start,removedCharCount:f.removedCharCount,addedCharCount:f.addedCharCount,removedLineCount:f.removedLineCount,addedLineCount:f.addedLineCount})},onChanging:function(a){return this.dispatchEvent(a)},onChanged:function(a){return this.dispatchEvent(a)},setLineDelimiter:function(a){this._model.setLineDelimiter(a)},
+setText:function(a,g,f){function e(a){for(h=c=0;c<d.length;c++){b=d[c];if(b.start>a-h)break;var k=b._model.getCharCount();if(b.start+k>a-h)return-1;h+=k-(b.end-b.start)}return a-h}this._change={text:a||"",start:g||0,end:void 0===f?this.getCharCount():f};var d=this._projections,h,c,b,k,m,a=e(this._change.start);-1===a&&(k={projection:b,start:this._change.start-(b.start+h)},a=b.end);g=e(this._change.end);-1===g&&(m={projection:b,end:this._change.end-(b.start+h)},g=b.start);k&&m&&k.projection===m.projection?
+b._model.setText(this._change.text,k.start,m.end):(this._model.setText(this._change.text,a,g),k&&(b=k.projection,b._model.setText("",k.start)),m&&(b=m.projection,b._model.setText("",0,m.end),b.start=b.end,b._lineCount=0));this._change=void 0}};n.EventTarget.addMixin(p.prototype);return{ProjectionTextModel:p}});
+define("orion/editor/tooltip","i18n!orion/editor/nls/messages orion/editor/textView orion/editor/textModel orion/editor/projectionTextModel orion/editor/util orion/util".split(" "),function(g,n,p,a,l,f){function e(a){this._view=a;this._fadeDelay=500;this._hideDelay=200;this._showDelay=500;this._autoHideDelay=5E3;this._create(a.getOptions("parent").ownerDocument)}e.getTooltip=function(a){a._tooltip||(a._tooltip=new e(a));return a._tooltip};e.prototype={_create:function(a){if(!this._tooltipDiv){var e=
+this._tooltipDiv=f.createElement(a,"div");e.tabIndex=0;e.className="textviewTooltip";e.setAttribute("aria-live","assertive");e.setAttribute("aria-atomic","true");var c=this._tooltipContents=f.createElement(a,"div");e.appendChild(c);a.body.appendChild(e);var b=this;l.addEventListener(e,"mouseover",function(){if(b._hideDelay){var a=b._getWindow();b._delayedHideTimeout&&(a.clearTimeout(b._delayedHideTimeout),b._delayedHideTimeout=null);b._hideTimeout&&(a.clearTimeout(b._hideTimeout),b._hideTimeout=null);
+b._nextTarget=null}},!1);l.addEventListener(e,"mouseout",function(a){a=a.relatedTarget||a.toElement;!(a===e||b._hasFocus())&&(!a||!l.contains(e,a))&&b._hide()},!1);l.addEventListener(e,"keydown",function(a){27===a.keyCode&&b._hide()},!1);l.addEventListener(a,"mousedown",this._mouseDownHandler=function(a){b.isVisible()&&(l.contains(e,a.target||a.srcElement)||b._hide())},!0);this._view.addEventListener("Destroy",function(){b.destroy()});this._hide()}},_getWindow:function(){var a=this._tooltipDiv.ownerDocument;
+return a.defaultView||a.parentWindow},destroy:function(){if(this._tooltipDiv){this._hide();var a=this._tooltipDiv.parentNode;a&&a.removeChild(this._tooltipDiv);l.removeEventListener(this._tooltipDiv.ownerDocument,"mousedown",this._mouseDownHandler,!0);this._tooltipDiv=null}},_hasFocus:function(){var a=this._tooltipDiv;return!a?!1:l.contains(a,a.ownerDocument.activeElement)},hide:function(a){void 0===a&&(a=this._hideDelay);var e=this._getWindow();this._delayedHideTimeout&&(e.clearTimeout(this._delayedHideTimeout),
+this._delayedHideTimeout=null);var c=this;a?c._delayedHideTimeout=e.setTimeout(function(){c._delayedHideTimeout=null;c._hide();c.setTarget(c._nextTarget,0)},a):(c._hide(),c.setTarget(c._nextTarget,0))},_hide:function(){var a=this._tooltipDiv;a&&(this._hasFocus()&&this._view.focus(),this._contentsView&&(this._contentsView.destroy(),this._contentsView=null),this._tooltipContents&&(this._tooltipContents.innerHTML=""),a.style.visibility="hidden",a=this._getWindow(),this._showTimeout&&(a.clearTimeout(this._showTimeout),
+this._showTimeout=null),this._delayedHideTimeout&&(a.clearTimeout(this._delayedHideTimeout),this._delayedHideTimeout=null),this._hideTimeout&&(a.clearTimeout(this._hideTimeout),this._hideTimeout=null),this._fadeTimeout&&(a.clearInterval(this._fadeTimeout),this._fadeTimeout=null))},isVisible:function(){return this._tooltipDiv&&"visible"===this._tooltipDiv.style.visibility},setTarget:function(a,e,c){if(this.isVisible())this._hasFocus()||(this._nextTarget=a,this.hide(c));else if(this._target=a){var b=
+this,a=b._getWindow();b._showTimeout&&(a.clearTimeout(b._showTimeout),b._showTimeout=null);0===e?b.show(!0):b._showTimeout=a.setTimeout(function(){b._showTimeout=null;b.show(!0)},e?e:b._showDelay)}},show:function(d){if(this._target){var e=this._target.getTooltipInfo();if(e){var c=this._tooltipDiv,b=this._tooltipContents;c.style.left=c.style.right=c.style.width=c.style.height=b.style.width=b.style.height="auto";var k=e.contents;k instanceof Array&&(k=this._getAnnotationContents(k));if("string"===typeof k)b.innerHTML=
+k;else if(this._isNode(k))b.appendChild(k);else if(k instanceof a.ProjectionTextModel){var m=this._view,f=m.getOptions();f.wrapMode=!1;f.parent=b;var g=f.themeClass;g?((g=g.replace("tooltipTheme",""))&&(g=" "+g),g="tooltipTheme"+g):g="tooltipTheme";f.themeClass=g;f=this._contentsView=new n.TextView(f);f.addEventListener("LineStyle",function(b){m.onLineStyle(b)});f.setModel(k);k=f.computeSize();b.style.width=k.width+"px";b.style.height=k.height+"px";f.resize()}else return;b=c.ownerDocument.documentElement;
+"right"===e.anchor?(k=b.clientWidth-e.x,c.style.right=k+"px"):(k=parseInt(this._getNodeStyle(c,"padding-left","0"),10),k+=parseInt(this._getNodeStyle(c,"border-left-width","0"),10),k=e.x-k,c.style.left=k+"px");c.style.maxWidth=b.clientWidth-k-10+"px";k=parseInt(this._getNodeStyle(c,"padding-top","0"),10);k+=parseInt(this._getNodeStyle(c,"border-top-width","0"),10);k=e.y-k;c.style.top=k+"px";c.style.maxHeight=b.clientHeight-k-10+"px";c.style.opacity="1";c.style.visibility="visible";if(d){var l=this,
+t=this._getWindow();l._hideTimeout=t.setTimeout(function(){l._hideTimeout=null;var b=parseFloat(l._getNodeStyle(c,"opacity","1"));l._fadeTimeout=t.setInterval(function(){"visible"===c.style.visibility&&0<b?(b-=0.1,c.style.opacity=b):l._hide()},l._fadeDelay/10)},l._autoHideDelay)}}}},_getAnnotationContents:function(d){function e(b){var a=b.title,c=f.createElement(r,"div");c.className="tooltipRow";b.html&&(c.innerHTML=b.html,c.lastChild&&l.addEventListener(c.lastChild,"click",function(){var a=b.start,
+c=b.end;u.getBaseModel&&(a=u.mapOffset(a,!0),c=u.mapOffset(c,!0));x.setSelection(a,c,1/3,function(){m._hide()})},!1),c.appendChild(r.createTextNode("\u00a0")));if(!a)var d=b.end,a=t.getLineStart(t.getLineAtOffset(b.start)),d=t.getLineEnd(t.getLineAtOffset(d),!0),a=t.getText(a,d);"function"===typeof a&&(a=b.title());"string"===typeof a&&(d=f.createElement(r,"span"),d.appendChild(r.createTextNode(a)),a=d);c.appendChild(a);return c}for(var c,b=[],k=0;k<d.length;k++)c=d[k],""!==c.title&&!c.groupAnnotation&&
+b.push(c);d=b;if(0===d.length)return null;var m=this,r=this._tooltipDiv.ownerDocument,x=this._view,u=x.getModel(),t=u.getBaseModel?u.getBaseModel():u;if(1===d.length){c=d[0];if(void 0!==c.title)return c=e(c),c.firstChild&&((d=c.firstChild.className)&&(d+=" "),c.firstChild.className=d+"single"),c;d=new a.ProjectionTextModel(t);b=t.getLineStart(t.getLineAtOffset(c.start));k=t.getCharCount();c.end!==k&&d.addProjection({start:c.end,end:k});0<b&&d.addProjection({start:0,end:b});return d}b=f.createElement(r,
+"div");c=f.createElement(r,"em");c.appendChild(r.createTextNode(g.multipleAnnotations));b.appendChild(c);for(k=0;k<d.length;k++)c=d[k],(c=e(c))&&b.appendChild(c);return b},_getNodeStyle:function(a,e,c){var b;if(a&&(b=a.style[e],!b))if(a.currentStyle){for(b=0;-1!==(b=e.indexOf("-",b));)e=e.substring(0,b)+e.substring(b+1,b+2).toUpperCase()+e.substring(b+2);b=a.currentStyle[e]}else b=(a=a.ownerDocument.defaultView.getComputedStyle(a,null))?a.getPropertyValue(e):null;return b||c},_isNode:function(a){return"object"===
+typeof Node?a instanceof Node:a&&"object"===typeof a&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName}};return{Tooltip:e}});
+define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(g,n){function p(a,b,d){this.start=a;this.end=b;this._projectionModel=d;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function a(){}function l(c,b){var d=c.lastIndexOf("."),d=c.substring(d+1),e={title:g[d],style:{styleClass:"annotation "+d},html:"<div class='annotationHTML "+d+"'></div>",overviewStyle:{styleClass:"annotationOverview "+d}};b?e.lineStyle={styleClass:"annotationLine "+
+d}:e.rangeStyle={styleClass:"annotationRange "+d};a.registerType(c,e)}function f(){}function e(a){this._annotations=[];var b=this;this._listener={onChanged:function(a){b._onChanged(a)}};this.setTextModel(a)}function d(a,b){this._view=a;this._annotationModel=b;var d=this;this._listener={onDestroy:function(b){d._onDestroy(b)},onLineStyle:function(b){d._onLineStyle(b)},onChanged:function(b){d._onAnnotationModelChanged(b)}};a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("postLineStyle",
+this._listener.onLineStyle);b.addEventListener("Changed",this._listener.onChanged)}p.prototype={_expandedHTML:"<div class='annotationHTML expanded'></div>",_expandedStyle:{styleClass:"annotation expanded"},_collapsedHTML:"<div class='annotationHTML collapsed'></div>",_collapsedStyle:{styleClass:"annotation collapsed"},_collapse:function(){if(!this.expanded)return!1;this.expanded=!1;this.html=this._collapsedHTML;this.style=this._collapsedStyle;this._annotationModel&&this._annotationModel.modifyAnnotation(this);
+return!0},_expand:function(){if(this.expanded)return!1;this.expanded=!0;this.html=this._expandedHTML;this.style=this._expandedStyle;this._annotationModel&&this._annotationModel.modifyAnnotation(this);return!0},collapse:function(){if(this._collapse()){var a=this._projectionModel,b=a.getBaseModel();this._projection={annotation:this,start:b.getLineStart(b.getLineAtOffset(this.start)+1),end:b.getLineEnd(b.getLineAtOffset(this.end),!0)};a.addProjection(this._projection)}},expand:function(){this._expand()&&
+this._projectionModel.removeProjection(this._projection)}};a.ANNOTATION_ERROR="orion.annotation.error";a.ANNOTATION_WARNING="orion.annotation.warning";a.ANNOTATION_TASK="orion.annotation.task";a.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint";a.ANNOTATION_BOOKMARK="orion.annotation.bookmark";a.ANNOTATION_FOLDING="orion.annotation.folding";a.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket";a.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket";a.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine";
+a.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch";a.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch";a.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence";a.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence";a.ANNOTATION_SELECTED_LINKED_GROUP="orion.annotation.selectedLinkedGroup";a.ANNOTATION_CURRENT_LINKED_GROUP="orion.annotation.currentLinkedGroup";a.ANNOTATION_LINKED_GROUP="orion.annotation.linkedGroup";a.ANNOTATION_BLAME="orion.annotation.blame";a.ANNOTATION_CURRENT_BLAME=
+"orion.annotation.currentBlame";var h={};a.registerType=function(a,b){var d=b;"function"!==typeof d&&(d=function(b,a,c){this.start=b;this.end=a;void 0!==c&&(this.title=c)},d.prototype=b);d.prototype.type=a;h[a]=d;return a};a.createAnnotation=function(a,b,d,e){return new (this.getType(a))(b,d,e)};a.getType=function(a){return h[a]};l(a.ANNOTATION_ERROR);l(a.ANNOTATION_WARNING);l(a.ANNOTATION_TASK);l(a.ANNOTATION_BREAKPOINT);l(a.ANNOTATION_BOOKMARK);l(a.ANNOTATION_CURRENT_BRACKET);l(a.ANNOTATION_MATCHING_BRACKET);
+l(a.ANNOTATION_CURRENT_SEARCH);l(a.ANNOTATION_MATCHING_SEARCH);l(a.ANNOTATION_READ_OCCURRENCE);l(a.ANNOTATION_WRITE_OCCURRENCE);l(a.ANNOTATION_SELECTED_LINKED_GROUP);l(a.ANNOTATION_CURRENT_LINKED_GROUP);l(a.ANNOTATION_LINKED_GROUP);l(a.ANNOTATION_CURRENT_LINE,!0);l(a.ANNOTATION_BLAME,!0);l(a.ANNOTATION_CURRENT_BLAME,!0);a.registerType(a.ANNOTATION_FOLDING,p);f.addMixin=function(a){var b=f.prototype,d;for(d in b)b.hasOwnProperty(d)&&(a[d]=b[d])};f.prototype={addAnnotationType:function(a){this._annotationTypes||
+(this._annotationTypes=[]);this._annotationTypes.push(a)},getAnnotationTypePriority:function(a){if(this._annotationTypes)for(var b=0;b<this._annotationTypes.length;b++)if(this._annotationTypes[b]===a)return b+1;return 0},getAnnotationsByType:function(a,b,d){a=a.getAnnotations(b,d);for(d=[];a.hasNext();)b=a.next(),0!==this.getAnnotationTypePriority(b.type)&&d.push(b);var e=this;d.sort(function(b,a){return e.getAnnotationTypePriority(b.type)-e.getAnnotationTypePriority(a.type)});return d},isAnnotationTypeVisible:function(a){return 0!==
+this.getAnnotationTypePriority(a)},removeAnnotationType:function(a){if(this._annotationTypes)for(var b=0;b<this._annotationTypes.length;b++)if(this._annotationTypes[b]===a){this._annotationTypes.splice(b,1);break}}};e.prototype={addAnnotation:function(a){if(a){var b=this._annotations,d=this._binarySearch(b,a.start);b.splice(d,0,a);a._annotationModel=this;this.onChanged({type:"Changed",added:[a],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(a,b){var d=
+this._annotations,e,f=0,h;h=void 0===a&&void 0===b?function(){return f<d.length?d[f++]:null}:function(){for(;f<d.length;){var e=d[f++];if(a===e.start||(a>e.start?a<e.end:e.start<b))return e;if(e.start>=b)break}return null};e=h();return{next:function(){var b=e;b&&(e=h());return b},hasNext:function(){return null!==e}}},modifyAnnotation:function(a){if(a&&!(0>this._getAnnotationIndex(a)))this.onChanged({type:"Changed",added:[],removed:[],changed:[a]})},onChanged:function(a){return this.dispatchEvent(a)},
+removeAnnotations:function(a){var b=this._annotations,d,e;if(a){d=[];for(e=b.length-1;0<=e;e--){var f=b[e];f.type===a&&(b.splice(e,1),d.splice(0,0,f),f._annotationModel=null)}}else d=b;this.onChanged({type:"Changed",removed:d,added:[],changed:[]})},removeAnnotation:function(a){if(a){var b=this._getAnnotationIndex(a);0>b||(a._annotationModel=null,a={type:"Changed",removed:this._annotations.splice(b,1),added:[],changed:[]},this.onChanged(a))}},replaceAnnotations:function(a,b){var d=this._annotations,
+e,f,h,g=[];if(a)for(e=a.length-1;0<=e;e--)h=a[e],f=this._getAnnotationIndex(h),0>f||(h._annotationModel=null,d.splice(f,1),g.splice(0,0,h));b||(b=[]);for(e=0;e<b.length;e++)h=b[e],f=this._binarySearch(d,h.start),h._annotationModel=this,d.splice(f,0,h);this.onChanged({type:"Changed",removed:g,added:b,changed:[]})},setTextModel:function(a){this._model&&this._model.removeEventListener("Changed",this._listener.onChanged);(this._model=a)&&this._model.addEventListener("Changed",this._listener.onChanged)},
+_binarySearch:function(a,b){for(var d=a.length,e=-1,f;1<d-e;)f=Math.floor((d+e)/2),b<=a[f].start?d=f:e=f;return d},_getAnnotationIndex:function(a){for(var b=this._annotations,d=this._binarySearch(b,a.start);d<b.length&&b[d].start===a.start;){if(b[d]===a)return d;d++}return-1},_onChanged:function(a){var b=a.start,d=a.addedCharCount,e=a.removedCharCount,f=this._annotations,h=b+e;if(0<f.length){a={type:"Changed",added:[],removed:[],changed:[],textModelChangedEvent:a};d-=e;for(e=0;e<f.length;e++){var g=
+f[e];g.start>=h?(g._oldStart=g.start,g._oldEnd=g.end,g.start+=d,g.end+=d,a.changed.push(g)):g.end<=b||(g.start<b&&h<g.end?(g._oldStart=g.start,g._oldEnd=g.end,g.end+=d,a.changed.push(g)):(f.splice(e,1),a.removed.push(g),g._annotationModel=null,g.expand&&g.expand(),e--))}if(0<a.added.length||0<a.removed.length||0<a.changed.length)this.onChanged(a)}}};n.EventTarget.addMixin(e.prototype);d.prototype={destroy:function(){var a=this._view;a&&(a.removeEventListener("Destroy",this._listener.onDestroy),a.removeEventListener("LineStyle",
+this._listener.onLineStyle),this.view=null);(a=this._annotationModel)&&a.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(a,b){if(b){a||(a={});a.styleClass=a.styleClass&&b.styleClass&&a.styleClass!==b.styleClass?a.styleClass+(" "+b.styleClass):b.styleClass;var d;b.tagName&&!a.tagName&&(a.tagName=b.tagName);if(b.style)for(d in a.style||(a.style={}),b.style)a.style[d]||(a.style[d]=b.style[d]);if(b.attributes)for(d in a.attributes||(a.attributes={}),b.attributes)a.attributes[d]||
+(a.attributes[d]=b.attributes[d])}return a},_mergeStyleRanges:function(a,b){a||(a=[]);var d,e;for(e=0;e<a.length&&b;e++){var f=a[e];if(b.end<=f.start)break;if(!(b.start>=f.end)){d=this._mergeStyle({},f.style);d=this._mergeStyle(d,b.style);var h=[];h.push(e,1);b.start<f.start&&h.push({start:b.start,end:f.start,style:b.style});b.start>f.start&&h.push({start:f.start,end:b.start,style:f.style});h.push({start:Math.max(f.start,b.start),end:Math.min(f.end,b.end),style:d});b.end<f.end&&h.push({start:b.end,
+end:f.end,style:f.style});b=b.end>f.end?{start:f.end,end:b.end,style:b.style}:null;Array.prototype.splice.apply(a,h)}}b&&(d=this._mergeStyle({},b.style),a.splice(e,0,{start:b.start,end:b.end,style:d}));return a},_onAnnotationModelChanged:function(a){function b(b,a){h.getBaseModel&&(b=h.mapOffset(b,!0),a=h.mapOffset(a,!0));-1!==b&&-1!==a&&e.redrawRange(b,a)}function d(a,c){for(var k=0;k<a.length;k++)if(f.isAnnotationTypeVisible(a[k].type)){var e=a[k];b(e.start,e.end);c&&(void 0!==e._oldStart&&e._oldEnd)&&
+b(e._oldStart,e._oldEnd)}}var e=this._view;if(e){var f=this,h=e.getModel();d(a.added);d(a.removed);d(a.changed,!0)}},_onDestroy:function(){this.destroy()},_onLineStyle:function(a){var b=this._annotationModel,d=a.textView.getModel(),e=b.getTextModel(),f=a.lineStart,h=a.lineStart+a.lineText.length;e!==d&&(f=d.mapOffset(f),h=d.mapOffset(h));for(b=b.getAnnotations(f,h);b.hasNext();)if(f=b.next(),this.isAnnotationTypeVisible(f.type)){if(f.rangeStyle){var h=f.start,g=f.end;e!==d&&(h=d.mapOffset(h,!0),g=
+d.mapOffset(g,!0));a.ranges=this._mergeStyleRanges(a.ranges,{start:h,end:g,style:f.rangeStyle})}f.lineStyle&&(a.style=this._mergeStyle({},a.style),a.style=this._mergeStyle(a.style,f.lineStyle))}}};f.addMixin(d.prototype);return{FoldingAnnotation:p,AnnotationType:a,AnnotationTypeList:f,AnnotationModel:e,AnnotationStyler:d}});
+define("orion/editor/editor","i18n!orion/editor/nls/messages orion/editor/eventTarget orion/editor/tooltip orion/editor/annotations orion/objects orion/util".split(" "),function(g,n,p,a,l,f){function e(a){a=a||{};this._domNode=a.domNode;this._model=a.model;this._undoStack=a.undoStack;this._statusReporter=a.statusReporter;this._title=null;var b=this;this._listener={onChanged:function(a){b.onChanged(a)}};this._model&&this._model.addEventListener("Changed",this._listener.onChanged);this.checkDirty()}
+function d(a){a=a||{};e.call(this,a);this._textViewFactory=a.textViewFactory;this._undoStackFactory=a.undoStackFactory;this._textDNDFactory=a.textDNDFactory;this._annotationFactory=a.annotationFactory;this._foldingRulerFactory=a.foldingRulerFactory;this._lineNumberRulerFactory=a.lineNumberRulerFactory;this._contentAssistFactory=a.contentAssistFactory;this._keyBindingFactory=a.keyBindingFactory;this._contentAssist=this._foldingRuler=this._overviewRuler=this._lineNumberRuler=this._annotationRuler=this._annotationModel=
+this._annotationStyler=null}var h=a.AnnotationType;e.prototype={destroy:function(){this.uninstall();this._statusReporter=this._domNode=null;this._model&&this._model.removeEventListener("Changed",this._listener.onChanged)},checkDirty:function(){this.setDirty(this._undoStack&&!this._undoStack.isClean())},focus:function(){},getModel:function(){return this._model},getText:function(a,b){return this.getModel().getText(a,b)},getTitle:function(){return this._title},getUndoStack:function(){return this._undoStack},
+install:function(){this.installed=!0},isDirty:function(){return this._dirty},markClean:function(){this.getUndoStack().markClean();this.setDirty(!1)},onDirtyChanged:function(a){return this.dispatchEvent(a)},onInputChanged:function(a){return this.dispatchEvent(a)},onChanged:function(){this.checkDirty()},reportStatus:function(a,b,d){this._statusReporter&&this._statusReporter(a,b,d)},resize:function(){},setDirty:function(a){this._dirty!==a&&(this._dirty=a,this.onDirtyChanged({type:"DirtyChanged"}))},
+_setModelText:function(a){this._model&&this._model.setText(a)},setInput:function(a,b,d,e){this._title=a;e||(b?this.reportStatus(b,"error"):null!==d&&void 0!==d&&this._setModelText(d),this._undoStack&&this._undoStack.reset());this.checkDirty();this.onInputChanged({type:"InputChanged",title:a,message:b,contents:d,contentsSaved:e})},setText:function(a,b,d){this.getModel().setText(a,b,d)},uninstall:function(){this.installed=!1}};n.EventTarget.addMixin(e.prototype);d.prototype=new e;l.mixin(d.prototype,
 {destroy:function(){e.prototype.destroy.call(this);this._textViewFactory=this._undoStackFactory=this._textDNDFactory=this._annotationFactory=this._foldingRulerFactory=this._lineNumberRulerFactory=this._contentAssistFactory=this._keyBindingFactory=null},getAnnotationModel:function(){return this._annotationModel},getAnnotationRuler:function(){return this._annotationRuler},getAnnotationStyler:function(){return this._annotationStyler},getContentAssist:function(){return this._contentAssist},getFoldingRuler:function(){return this._foldingRuler},
-getLineNumberRuler:function(){return this._lineNumberRuler},getModel:function(){var c=this._textView.getModel();c.getBaseModel&&(c=c.getBaseModel());return c},getOverviewRuler:function(){return this._overviewRuler},getTextView:function(){return this._textView},getKeyModes:function(){return this._textView.getKeyModes()},getSourceCodeActions:function(){return this._sourceCodeActions},getLinkedMode:function(){return this._linkedMode},getTextActions:function(){return this._textActions},focus:function(){this._textView&&
-this._textView.focus()},resize:function(){this._textView&&this._textView.resize()},setAnnotationRulerVisible:function(c,a){if(this._annotationRulerVisible!==c||a)if(this._annotationRulerVisible=c,this._annotationRuler){var b=this._textView;c?b.addRuler(this._annotationRuler,0):b.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(c,a){if(this._foldingRulerVisible!==c||a)if(this._foldingRulerVisible=c,this._foldingRuler){var b=this._textView;b.getModel().getBaseModel&&(c?b.addRuler(this._foldingRuler):
-b.removeRuler(this._foldingRuler))}},setLineNumberRulerVisible:function(c,a){if(this._lineNumberRulerVisible!==c||a)if(this._lineNumberRulerVisible=c,this._lineNumberRuler){var b=this._textView;c?b.addRuler(this._lineNumberRuler,!this._annotationRulerVisible?0:1):b.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(c,a){if(this._overviewRulerVisible!==c||a)if(this._overviewRulerVisible=c,this._overviewRuler){var b=this._textView;c?b.addRuler(this._overviewRuler):b.removeRuler(this._overviewRuler)}},
-mapOffset:function(c,a){var b=this._textView.getModel();b.getBaseModel&&(c=b.mapOffset(c,a));return c},getLineAtOffset:function(c){return this.getModel().getLineAtOffset(this.mapOffset(c))},getLineStart:function(c){return this.getModel().getLineStart(c)},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},getSelection:function(){var c=this._textView,a=c.getSelection(),c=c.getModel();c.getBaseModel&&(a.start=c.mapOffset(a.start),a.end=c.mapOffset(a.end));return a},_expandOffset:function(c){var a=
-this._textView.getModel(),b=this._annotationModel;if(b&&a.getBaseModel)for(c=b.getAnnotations(c,c+1);c.hasNext();)a=c.next(),a.type===h.ANNOTATION_FOLDING&&a.expand&&a.expand()},setCaretOffset:function(c,a,b){var d=this._textView,e=d.getModel();e.getBaseModel&&(this._expandOffset(c),c=e.mapOffset(c,!0));d.setCaretOffset(c,a,b)},setText:function(c,a,b){var d=this._textView,e=d.getModel();e.getBaseModel&&(void 0!==a&&(this._expandOffset(a),a=e.mapOffset(a,!0)),void 0!==b&&(this._expandOffset(b),b=e.mapOffset(b,
-!0)));d.setText(c,a,b)},setSelection:function(c,a,b,d){var e=this._textView,f=e.getModel();f.getBaseModel&&(this._expandOffset(c),this._expandOffset(a),c=f.mapOffset(c,!0),a=f.mapOffset(a,!0));e.setSelection(c,a,b,d)},moveSelection:function(c,a,b,d){var e=this._textView;this.setSelection(c,a||c,1/3,function(){(void 0===d||d)&&e.focus();b&&b()})},_getTooltipInfo:function(c,a){var b=this._textView,d=this.getAnnotationModel();if(!d)return null;var e=this._annotationStyler;if(!e)return null;var f=b.getOffsetAtLocation(c,
-a);if(-1===f)return null;f=this.mapOffset(f);e=e.getAnnotationsByType(d,f,f+1);d=[];for(f=0;f<e.length;f++)e[f].rangeStyle&&d.push(e[f]);if(0===d.length)return null;b=b.convert({x:c,y:a},"document","page");return{contents:d,anchor:"left",x:b.x+10,y:b.y+20}},_highlightCurrentLine:function(c,a){var b=this._annotationModel;if(b){var d=this._textView;if(!d.getOptions("singleMode")){var e=d.getModel(),f=a?e.getLineAtOffset(a.start):-1,g=e.getLineAtOffset(c.start),d=c.start===c.end,l=!a||a.start===a.end,
-y=e.getLineStart(g),s=e.getLineEnd(g);e.getBaseModel&&(y=e.mapOffset(y),s=e.mapOffset(s));e=this._currentLineAnnotation;if(!(f===g&&l&&d&&e&&e.start===y&&e.end===s)){var f=e?[e]:null,u;d&&(e=h.createAnnotation(h.ANNOTATION_CURRENT_LINE,y,s),u=[e]);this._currentLineAnnotation=e;b.replaceAnnotations(f,u)}}}},installTextView:function(){this.install()},install:function(){if(!this._textView){this._textView=this._textViewFactory();this._undoStackFactory&&(this._undoStack=this._undoStackFactory.createUndoStack(this),
-this.checkDirty());this._textDNDFactory&&(this._textDND=this._textDNDFactory.createTextDND(this,this._undoStack));this._contentAssistFactory&&(this._contentAssist=this._contentAssistFactory.createContentAssistMode(this).getContentAssist());var c=this,a=this._textView,b=this;this._listener={onModelChanged:function(){b.checkDirty()},onMouseOver:function(a){b._listener.onMouseMove(a)},onMouseMove:function(c){var d=p.Tooltip.getTooltip(a);d&&!(b._listener.lastMouseX===c.event.clientX&&b._listener.lastMouseY===
-c.event.clientY)&&(b._listener.lastMouseX=c.event.clientX,b._listener.lastMouseY=c.event.clientY,d.setTarget({x:c.x,y:c.y,getTooltipInfo:function(){return b._getTooltipInfo(this.x,this.y)}}))},onMouseOut:function(c){var d=p.Tooltip.getTooltip(a);d&&!(b._listener.lastMouseX===c.event.clientX&&b._listener.lastMouseY===c.event.clientY)&&(b._listener.lastMouseX=c.event.clientX,b._listener.lastMouseY=c.event.clientY,d.setTarget(null))},onScroll:function(){var c=p.Tooltip.getTooltip(a);c&&c.setTarget(null,
-0,0)},onSelection:function(a){b._updateCursorStatus();b._highlightCurrentLine(a.newValue,a.oldValue)}};a.addEventListener("ModelChanged",this._listener.onModelChanged);a.addEventListener("Selection",this._listener.onSelection);a.addEventListener("MouseOver",this._listener.onMouseOver);a.addEventListener("MouseOut",this._listener.onMouseOut);a.addEventListener("MouseMove",this._listener.onMouseMove);a.addEventListener("Scroll",this._listener.onScroll);if(this._keyBindingFactory){var d;if(d="function"===
-typeof this._keyBindingFactory?this._keyBindingFactory(this,this.getKeyModes(),this._undoStack,this._contentAssist):this._keyBindingFactory.createKeyBindings(c,this._undoStack,this._contentAssist))this._textActions=d.textActions,this._linkedMode=d.linkedMode,this._sourceCodeActions=d.sourceCodeActions}d=function(a){if(void 0!==a&&-1!==a){for(var b=this.getView().getModel(),d=this.getAnnotationModel(),k=c.mapOffset(b.getLineStart(a)),a=c.mapOffset(b.getLineEnd(a)),b=d.getAnnotations(k,a),e=null;b.hasNext();){var f=
-b.next();if(f.type===h.ANNOTATION_BOOKMARK){e=f;break}}e?d.removeAnnotation(e):(e=h.createAnnotation(h.ANNOTATION_BOOKMARK,k,a),e.title=void 0,d.addAnnotation(e))}};if(this._annotationFactory){var f=a.getModel();f.getBaseModel&&(f=f.getBaseModel());if(this._annotationModel=this._annotationFactory.createAnnotationModel(f))if(f=this._annotationStyler=this._annotationFactory.createAnnotationStyler(a,this._annotationModel))f.addAnnotationType(h.ANNOTATION_CURRENT_SEARCH),f.addAnnotationType(h.ANNOTATION_MATCHING_SEARCH),
-f.addAnnotationType(h.ANNOTATION_ERROR),f.addAnnotationType(h.ANNOTATION_WARNING),f.addAnnotationType(h.ANNOTATION_MATCHING_BRACKET),f.addAnnotationType(h.ANNOTATION_CURRENT_BRACKET),f.addAnnotationType(h.ANNOTATION_CURRENT_LINE),f.addAnnotationType(h.ANNOTATION_READ_OCCURRENCE),f.addAnnotationType(h.ANNOTATION_WRITE_OCCURRENCE),f.addAnnotationType(h.ANNOTATION_SELECTED_LINKED_GROUP),f.addAnnotationType(h.ANNOTATION_CURRENT_LINKED_GROUP),f.addAnnotationType(h.ANNOTATION_LINKED_GROUP),f.addAnnotationType("orion.annotation.highlightError");
-var f=this._annotationFactory.createAnnotationRulers(this._annotationModel),g=this._annotationRuler=f.annotationRuler;g&&(g.onDblClick=d,g.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"}),g.addAnnotationType(h.ANNOTATION_ERROR),g.addAnnotationType(h.ANNOTATION_WARNING),g.addAnnotationType(h.ANNOTATION_TASK),g.addAnnotationType(h.ANNOTATION_BOOKMARK));this.setAnnotationRulerVisible(this._annotationRulerVisible||void 0===this._annotationRulerVisible,!0);if(g=this._overviewRuler=
-f.overviewRuler)g.addAnnotationType(h.ANNOTATION_CURRENT_SEARCH),g.addAnnotationType(h.ANNOTATION_MATCHING_SEARCH),g.addAnnotationType(h.ANNOTATION_READ_OCCURRENCE),g.addAnnotationType(h.ANNOTATION_WRITE_OCCURRENCE),g.addAnnotationType(h.ANNOTATION_CURRENT_BLAME),g.addAnnotationType(h.ANNOTATION_ERROR),g.addAnnotationType(h.ANNOTATION_WARNING),g.addAnnotationType(h.ANNOTATION_TASK),g.addAnnotationType(h.ANNOTATION_BOOKMARK),g.addAnnotationType(h.ANNOTATION_MATCHING_BRACKET),g.addAnnotationType(h.ANNOTATION_CURRENT_BRACKET),
-g.addAnnotationType(h.ANNOTATION_CURRENT_LINE);this.setOverviewRulerVisible(this._overviewRulerVisible||void 0===this._overviewRulerVisible,!0)}this._lineNumberRulerFactory&&(this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel),this._lineNumberRuler.addAnnotationType(h.ANNOTATION_CURRENT_BLAME),this._lineNumberRuler.addAnnotationType(h.ANNOTATION_BLAME),this._lineNumberRuler.onDblClick=d,this.setLineNumberRulerVisible(this._lineNumberRulerVisible||void 0===
-this._lineNumberRulerVisible,!0));this._foldingRulerFactory&&(this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),this._foldingRuler.addAnnotationType(h.ANNOTATION_FOLDING),this.setFoldingRulerVisible(this._foldingRulerVisible||void 0===this._foldingRulerVisible,!0));this.dispatchEvent({type:"TextViewInstalled",textView:a});e.prototype.install.call(this)}},uninstallTextView:function(){this.uninstall()},uninstall:function(){var c=this._textView;c&&(c.destroy(),this._textView=
-this._undoStack=this._textDND=this._contentAssist=this._listener=this._annotationModel=this._annotationStyler=this._annotationRuler=this._overviewRuler=this._lineNumberRuler=this._foldingRuler=this._currentLineAnnotation=this._title=null,this._dirty=!1,this._foldingRulerVisible=this._overviewRulerVisible=this._lineNumberRulerVisible=this._annotationRulerVisible=void 0,this.dispatchEvent({type:"TextViewUninstalled",textView:c}),e.prototype.uninstall.call(this))},_updateCursorStatus:function(){for(var c=
-this.getModel(),a=this.getCaretOffset(),b=c.getLineAtOffset(a),c=c.getLineStart(b),a=a-c,c=this.getKeyModes(),d=0;d<c.length;d++){var e=c[d];if(e.isActive()&&e.isStatusActive&&e.isStatusActive())return}this.reportStatus(f.formatMessage(g.lineColumn,b+1,a+1))},showAnnotations:function(c,a,b,d){var e=this._annotationModel;if(e){for(var f=[],g=[],l=e.getTextModel(),y=e.getAnnotations(0,l.getCharCount()),s;y.hasNext();)s=y.next(),-1!==a.indexOf(s.type)&&s.creatorID===this&&f.push(s);if(c)for(a=0;a<c.length;a++)if(s=
-c[a]){if(b)s=b(s);else{var u;"number"===typeof s.line?(u=l.getLineStart(s.line-1),y=u+s.start-1,u=u+s.end-1):(y=s.start,u=s.end);var p=d(s);if(!p)continue;s=h.createAnnotation(p,y,u,s.description)}s.creatorID=this;g.push(s)}e.replaceAnnotations(f,g)}},showProblems:function(c){this.showAnnotations(c,[h.ANNOTATION_ERROR,h.ANNOTATION_WARNING,h.ANNOTATION_TASK],null,function(a){switch(a.severity){case "error":return h.ANNOTATION_ERROR;case "warning":return h.ANNOTATION_WARNING;case "task":return h.ANNOTATION_TASK}return null})},
-showOccurrences:function(c){this.showAnnotations(c,[h.ANNOTATION_READ_OCCURRENCE,h.ANNOTATION_WRITE_OCCURRENCE],null,function(a){return a.readAccess?h.ANNOTATION_READ_OCCURRENCE:h.ANNOTATION_WRITE_OCCURRENCE})},showBlame:function(c){var a=this._blameRGB,d=this.getTextView().getOptions("parent").ownerDocument;if(!a){var e=f.createElement(d,"div");e.className="annotation blame";d.body.appendChild(e);var r=(d.defaultView||d.parentWindow).getComputedStyle(e).getPropertyValue("background-color");e.parentNode.removeChild(e);
-var e=r.indexOf("("),p=r.indexOf(")"),r=r.substring(e+1,p);this._blameRGB=a=r.split(",").slice(0,3)}var n=function(){var a=b.AnnotationType.createAnnotation(this.groupType,this.start,this.end,this.title);a.style=l.mixin({},a.style);a.style.style=l.mixin({},a.style.style);a.style.style.backgroundColor="";this.groupAnnotation=a;a.blame=this.blame;a.html=this.html;a.creatorID=this.creatorID;return a},t=function(){var a=f.createElement(d,"div");a.className="tooltipTitle";var c=this.blame.Message.indexOf("\n");
--1===c&&(c=this.blame.Message.length);var b=f.createElement(d,"a");b.href=this.blame.CommitLink;b.appendChild(d.createTextNode(this.blame.Message.substring(0,c)));a.appendChild(b);a.appendChild(f.createElement(d,"br"));a.appendChild(d.createTextNode(f.formatMessage(g.committerOnTime,this.blame.AuthorName,this.blame.Time)));return a},y=this.getModel();this.showAnnotations(c,[h.ANNOTATION_BLAME,h.ANNOTATION_CURRENT_BLAME],function(c){var d=y.getLineStart(c.Start-1),e=y.getLineEnd(c.End-1,!0),d=b.AnnotationType.createAnnotation(h.ANNOTATION_BLAME,
-d,e,t),e=a.slice(0);e.push(c.Shade);d.style=l.mixin({},d.style);d.style.style=l.mixin({},d.style.style);d.style.style.backgroundColor="rgba("+e.join()+")";d.groupId=c.Name;d.groupType=h.ANNOTATION_CURRENT_BLAME;d.createGroupAnnotation=n;d.html='<img class="annotationHTML blame" src="'+c.AuthorImage+'"/>';d.blame=c;return d})},showSelection:function(c,a,b,d,e){"number"===typeof c?("number"!==typeof a&&(a=c),this.moveSelection(c,a)):"number"===typeof b&&(c=this.getModel().getLineStart(b-1),"number"===
-typeof d&&(c+=d),"number"!==typeof e&&(e=0),this.moveSelection(c,c+e))},_setModelText:function(c){this._textView&&(this._textView.setText(c),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelection()))},setInput:function(c,a,b,d,f){e.prototype.setInput.call(this,c,a,b,d);this._textView&&(!d&&!f)&&this._textView.focus()},onGotoLine:function(c,a,b,d){if(this._textView){var e=this.getModel(),c=Math.max(0,Math.min(c,e.getLineCount()-1)),f=e.getLineStart(c),
-h=0;void 0===b&&(b=0);"string"===typeof a?(c=e.getLine(c).indexOf(a),-1!==c&&(h=c,b=h+a.length)):(h=a,a=e.getLineEnd(c)-f,h=Math.min(h,a),b=Math.min(b,a));this.moveSelection(f+h,f+b,d)}}});return{BaseEditor:e,Editor:d}});
-define("orion/selection",["orion/EventTarget","orion/Deferred"],function(g){function n(p,b){b||(b="orion.page.selection");this._serviceRegistry=p;g.attach(this);this._serviceRegistration=p.registerService(b,this);this._selections=null}n.prototype={getSelection:function(g){var b=this._getSingleSelection();"function"===typeof g&&g(b);return b},getSelections:function(g){var b=Array.isArray(this._selections)?this._selections.slice():[];"function"===typeof g&&g(b);return b},_getSingleSelection:function(){return this._selections&&
-0<this._selections.length?this._selections[0]:null},setSelections:function(g){var b=this._selections;this._selections=Array.isArray(g)?0<g.length?g.slice():null:g?[g]:null;b!==this._selections&&this.dispatchEvent({type:"selectionChanged",selection:this._getSingleSelection(),selections:this._selections})}};n.prototype.constructor=n;return{Selection:n}});
-define("orion/commandRegistry","require orion/commands orion/explorers/navigationUtils orion/PageUtil orion/uiUtils orion/webui/littlelib orion/webui/dropdown orion/webui/tooltip text!orion/webui/checkedmenuitem.html text!orion/webui/dropdowntriggerbutton.html text!orion/webui/submenutriggerbutton.html".split(" "),function(g,n,p,b,l,f,e,d,h,c,a){function k(a){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(a);this._parameterCollector=
-null}function m(a,b){this.token=a;this.parameterName=b}function r(a,b,c){this.event=a;this.handler=b;this.capture=c||!1}function w(a,b,c,d,e,k){this.name=a;this.type=b;this.label=c;this.value=d;this.lines=e||1;this.eventListeners=Array.isArray(k)?k:k?[k]:[]}function v(a,b,c){this._storeParameters(a);this._hasOptionalParameters=b&&b.hasOptionalParameters;this._options=b;this.optionsRequested=!1;this.getParameters=c;this.clientCollect=b&&b.clientCollect}k.prototype={_init:function(a){this._selectionService=
-a.selection;var b=this;n.setKeyBindingProvider(function(){return b._activeBindings})},processURL:function(a){for(var b in this._urlBindings)if(this._urlBindings[b]&&this._urlBindings[b].urlBinding&&this._urlBindings[b].command){var c=this._urlBindings[b].urlBinding.match(a);if(c){var d=this._urlBindings[b],e=d.command,k=d.invocation;if(k&&k.parameters&&e.callback){k.parameters.setValue(c.parameterName,c.parameterValue);var f=this;window.setTimeout(function(){f._invoke(k)},0);break}}}},findCommand:function(a){return this._commandList[a]},
-runCommand:function(a,b,c,d){b?(a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(b):1)&&a.callback&&this._invoke(new n.CommandInvocation(c,b,null,a,this),d):(b=this._urlBindings[a])&&b.command&&b.command.callback&&this._invoke(b.invocation,d)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(a){this._parameterCollector=a},openParameterCollector:function(a,b,c){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(a,
-b,c))},confirm:function(a,b,c,d,e,k){var f=!1;if(this._parameterCollector&&!e){var m=this;this._parameterCollector.close();if(this._parameterCollector.open(a,function(a,e){var k=document.createElement("span");k.classList.add("parameterPrompt");k.textContent=b;a.appendChild(k);k=document.createElement("button");k.addEventListener("click",function(){f=!0;m._parameterCollector.close()},!1);e.appendChild(k);k.appendChild(document.createTextNode(c));k.className="dismissButton";var h=document.createElement("button");
-h.addEventListener("click",function(){f=!1;m._parameterCollector.close()},!1);e.appendChild(h);h.appendChild(document.createTextNode(d));h.className="dismissButton";return k},function(){k(f)}))return}f=window.confirm(b);k(f)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(a,b){return this._collectAndInvoke(a.makeCopy(b),!1)},_collectAndInvoke:function(a,b){if(a)if(this._parameterCollector&&
-a.parameters&&a.parameters.hasParameters()&&(b||a.parameters.shouldCollectParameters())){var c=!1;a.parameters.updateParameters(a);if(a.parameters.shouldCollectParameters()&&(c=this._parameterCollector.collectParameters(a),!c)){var e=new d.Tooltip({node:a.domNode,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]}),c=e.contentContainer();c.classList.add("parameterPopup");var k=window.document.activeElement,f=this._parameterCollector.getFillFunction(a,
-function(){k&&k.focus();e.destroy()})(c);e.show();window.setTimeout(function(){f.focus();f.select()},0);c=!0}c||a.command.callback.call(a.handler||window,a)}else a.command.callback.call(a.handler||window,a);else window.console.log("Client attempted to invoke command without an available (rendered) command invocation")},collectParameters:function(a){this._collectAndInvoke(a,!0)},showKeyBindings:function(a){function b(a){return function(){n.executeBinding(a)}}var c={},d,e,k=[],f;for(f in this._activeBindings)(e=
-this._activeBindings[f])&&(e.keyBinding&&e.command&&(e.command.name||e.command.tooltip))&&k.push(e);k.sort(function(a,b){return(a.command.name||a.command.tooltip).localeCompare(b.command.name||b.command.tooltip)});for(f=0;f<k.length;f++)e=k[f],e.keyBinding.scopeName?(c[e.keyBinding.scopeName]||(c[e.keyBinding.scopeName]=[]),c[e.keyBinding.scopeName].push(e)):(d=l.getUserKeyString(e.keyBinding),a.createItem(d,e.command.name||e.command.tooltip,b(e)));for(var m in c)c[m].length&&0<c[m].length&&(a.createHeader(m),
-c[m].forEach(function(c){d=l.getUserKeyString(c.keyBinding);a.createItem(d,c.command.name||c.command.tooltip,b(c))}))},addCommand:function(a){this._commandList[a.id]=a;var b=this._pendingBindings[a.id];if(b){var c=this;b.forEach(function(b){c._addBinding(a,b.type,b.binding,b.bindingOnly)});delete this._pendingBindings[a.id]}},addCommandGroup:function(a,b,c,d,e,k,f,m,h){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];e&&(a=this._createEntryForPath(a,
-e));a[b]?(d&&(a[b].title=d),c&&(a[b].position=c),f&&(a[b].imageClass=f),m&&(a[b].tooltip=m),h&&(a[b].selectionClass=h),a[b].emptyGroupMessage=k):(a[b]={title:d,position:c,emptyGroupMessage:k,imageClass:f,tooltip:m,selectionClass:h,children:{}},a.sortedContributions=null)},_createEntryForPath:function(a,b){b&&b.split("/").forEach(function(b){1<b.length&&(a[b]||(a[b]={position:0,children:{}},a.sortedContributions=null),a=a[b].children)});return a},registerSelectionService:function(a,b){this._contributionsByScopeId[a]||
-(this._contributionsByScopeId[a]={});this._contributionsByScopeId[a].localSelectionService=b},registerCommandContribution:function(a,b,c,d,e,k,f){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];d&&(a=this._createEntryForPath(a,d));a[b]={position:c};k&&((c=this._commandList[b])?this._addBinding(c,"key",k,e):this._addPendingBinding(b,"key",k,e));f&&((c=this._commandList[b])?this._addBinding(c,"url",f,e):this._addPendingBinding(b,"url",f,e));a.sortedContributions=
-null},unregisterCommandContribution:function(a,b,c){if(this._contributionsByScopeId[a]){delete this._commandList[b];delete this._activeBindings[b];delete this._urlBindings[b];delete this._pendingBindings[b];var d=this._contributionsByScopeId[a];c&&c.split("/").forEach(function(a){1<a.length&&d[a]&&(d=d[a].children)});delete d[b];d.sortedContributions=null}},_addBinding:function(a,b,c,d){if(!a.id)throw Error("No command id: "+a);"key"===b?this._activeBindings[a.id]={command:a,keyBinding:c,bindingOnly:d}:
-"url"===b&&(this._urlBindings[a.id]={command:a,urlBinding:c,bindingOnly:d})},_addPendingBinding:function(a,b,c,d){this._pendingBindings[a]=this._pendingBindings[a]||[];this._pendingBindings[a].push({type:b,binding:c,bindingOnly:d})},_checkForTrailingSeparator:function(a,b,c){var d;if("tool"===b||"button"===b)if((d=0<a.childNodes.length?a.childNodes[a.childNodes.length-1]:null)&&d.classList.contains("commandSeparator"))return c?(a.removeChild(d),!1):!0;if("menu"===b&&(a=f.$$array("li > *",a),0<a.length&&
-a[a.length-1].classList.contains("dropdownSeparator")))if(d=a[a.length-1],c)d.parentNode.parentNode.removeChild(d.parentNode);else return!0;return!1},renderCommands:function(a,b,c,d,e,k,m){if("string"!==typeof a)throw"a scope id for rendering must be specified";b=f.node(b);if(!b)throw"no parent";var h=this._contributionsByScopeId[a];if(!c&&h){var c=h.localSelectionService||this._selectionService,g=this;c&&c.getSelections(function(c){g.renderCommands(a,b,c,d,e,k)})}else h&&(this._render(this._contributionsByScopeId[a],
-b,c,d,e||"button",k,m),this._checkForTrailingSeparator(b,e,!0))},destroy:function(a){a=f.node(a);if(!a)throw"no parent";for(;a.hasChildNodes();){var b=a.firstChild;b.commandTooltip&&b.commandTooltip.destroy();b.emptyGroupTooltip&&b.emptyGroupTooltip.destroy();this.destroy(b);a.removeChild(b)}},_render:function(a,b,c,e,k,f,m){var h=a.sortedContributions;if(!h){var h=[],g=!1,r;for(r in a)if(Object.prototype.hasOwnProperty.call(a,r)){var l=a[r];l&&"number"===typeof l.position&&(l.id=r,h.push(l),g=!0)}g&&
-(h.sort(function(a,b){return a.position-b.position}),a.sortedContributions=h)}var v=0,w=this;h.forEach(function(a){var h,g;a.imageClass||(a.imageClass=null);if(a.children&&0<Object.getOwnPropertyNames(a.children).length){h=a.children;var r;if("tool"===k||"button"===k)if(a.title)r=w._createDropdownMenu(b,a.title,null,null,a.imageClass,a.tooltip,a.selectionClass),m&&p.generateNavGrid(m,r.menuButton),r&&window.setTimeout(function(){w._render(a.children,r.menu,c,e,"menu",f,m);w._checkForTrailingSeparator(r.menu,
-"menu",!0);0===r.menu.childNodes.length?a.emptyGroupMessage?r.menuButton.emptyGroupTooltip||(r.menuButton.emptyGroupTooltip=new d.Tooltip({node:r.menuButton,text:a.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})):(m&&p.removeNavGrid(m,r.menuButton),r.menu.parentNode&&r.menu.parentNode.removeChild(r.menu),r.destroyButton&&r.destroyButton.parentNode&&r.destroyButton.parentNode.removeChild(r.destroyButton)):r.menuButton.style.visibility="visible"},0);else{var l;0<b.childNodes.length&&
-!w._checkForTrailingSeparator(b,k)&&(l=w.generateSeparatorImage(b));w._render(h,b,c,e,k,f,m);0<b.childNodes.length&&b.childNodes[b.childNodes.length-1]!==l&&(l=w.generateSeparatorImage(b))}else if(a.title){if(l=w._createDropdownMenu(b,a.title,!0,null,null,a.imageClass))w._render(h,l.menu,c,e,"menu",f,m),0===l.menu.childNodes.length&&l.destroyButton&&b.removeChild(l.destroyButton)}else 0<b.childNodes.length&&w._generateMenuSeparator(b),w._render(h,b,c,e,k,f,m),w._generateMenuSeparator(b)}else{var t=
-w._commandList[a.id];h=t?!0:!1;var B=null,B=null;t&&(g=new n.CommandInvocation(e,c,f,t,w),g.domParent=b,l=h&&(t.visibleWhen?t.visibleWhen(c):!0),w._activeBindings[t.id]&&w._activeBindings[t.id].keyBinding&&(B=w._activeBindings[t.id],B.invocation=l?g:null,B.bindingOnly&&(h=!1)),w._urlBindings[t.id]&&w._urlBindings[t.id].urlBinding&&(B=w._urlBindings[t.id],B.invocation=l?g:null,B.bindingOnly&&(h=!1)),h=h&&l);h&&(t.choiceCallback?("tool"===k||"button"===k?(h=b,l=!1,"ul"===b.nodeName.toLowerCase()&&(h=
-document.createElement("li"),b.appendChild(h))):(h=b,l=!0),w._createDropdownMenu(h,t.name,l,function(a){t.populateChoicesMenu(a,c,e,f,w)}.bind(t),t.imageClass,t.tooltip||t.title,t.selectionClass,t.positioningNode)):(g.handler=g.handler||this,g.domParent=b,l=function(){w._invoke(g)},"menu"===k?h=n.createCommandMenuItem(b,t,g,null,l):(h=k+t.id+v,h=n.createCommandItem(b,t,g,h,null,"tool"===k,l)),p.generateNavGrid(m,h),g.domNode=h,v++))}})},_createDropdownMenu:function(b,c,k,m,h,g,r,l){b=f.node(b);if(!b||
-!f.contains(document.body,b))return null;var p,w=b;k?(g=document.createRange(),g.selectNode(b),g=g.createContextualFragment(a),f.processTextNodes(g,{ButtonText:c}),b.appendChild(g),p=b.lastChild,h=p.lastChild,c=h.previousSibling,c.dropdown=new e.Dropdown({dropdown:h,populate:m,parentDropdown:b.dropdown}),h.dropdown=c.dropdown):("ul"===b.nodeName.toLowerCase()&&(w=document.createElement("li"),b.appendChild(w),p=w),b=null,h&&(b="dropdownButtonWithIcon",g=g||c),g=h?g||c:g,m=n.createDropdownMenu(w,c,
-m,b,h,!1,r,l),c=m.menuButton,h=m.menu,g&&(c.commandTooltip=new d.Tooltip({node:c,text:g,position:["above","below","right","left"]})));return{menuButton:c,menu:h,dropdown:c.dropdown,destroyButton:p}},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,"menu")){var b=document.createElement("li");b.classList.add("dropdownSeparator");var c=document.createElement("span");c.classList.add("dropdownSeparator");b.appendChild(c);a.appendChild(b)}},generateSeparatorImage:function(a){var b;
-b="ul"===a.nodeName.toLowerCase()?document.createElement("li"):document.createElement("span");a.appendChild(b);b.classList.add("core-sprite-sep");b.classList.add("imageSprite");b.classList.add("commandSeparator");return b}};k.prototype.constructor=k;m.prototype={match:function(a){a=b.matchResourceParameters(a);return"undefined"!==typeof a[this.token]?(this.parameterValue=a[this.token],this):null}};m.prototype.constructor=m;r.prototype.constructor=r;w.prototype={optionsRequested:function(){return this.optionsRequested}};
-w.prototype.constructor=w;v.prototype={_storeParameters:function(a){this.parameterTable=null;if(a){var b=this.parameterTable={};a.forEach(function(a){b[a.name]=a})}},updateParameters:function(a){"function"===typeof this.getParameters&&this._storeParameters(this.getParameters(a))},hasParameters:function(){return null!==this.parameterTable},shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(a){return this.parameterTable[a]},valueFor:function(a){return(a=
-this.parameterTable[a])?a.value:null},setValue:function(a,b){var c=this.parameterTable[a];c&&(c.value=b)},forEach:function(a){for(var b in this.parameterTable)this.parameterTable[b].type&&this.parameterTable[b].name&&a(this.parameterTable[b])},makeCopy:function(){var a=[];this.forEach(function(b){b=new w(b.name,b.type,b.label,b.value,b.lines,b.eventListeners);a.push(b)});var b=new v(a,this._options,this.getParameters);b.clientCollect=this.clientCollect;return b},hasOptionalParameters:function(){return this._hasOptionalParameters}};
-v.prototype.constructor=v;return{CommandRegistry:k,URLBinding:m,ParametersDescription:v,CommandParameter:w,CommandEventListener:r}});define("text!orion/banner/slideout.html",[],function(){return'<div id="slideContainer" class="slideParameters slideContainer">\r\n\t<span id="pageCommandParameters" class="layoutLeft parameters"></span>\r\n\t<span id="pageCommandDismiss" class="layoutRight parametersDismiss"></span>\r\n</div>'});
-define("orion/commonHTMLFragments",["require","orion/webui/littlelib","text!orion/banner/slideout.html"],function(g,n,p){return{slideoutHTMLFragment:function(b){var g=document.createElement("div");g.innerHTML=p;var f=n.$("#slideContainer",g);f.id=b+f.id;f=n.$("#pageCommandParameters",g);f.id=b+f.id;f=n.$("#pageCommandDismiss",g);f.id=b+f.id;return g.innerHTML}}});
-define("orion/section","orion/webui/littlelib orion/selection orion/commandRegistry orion/commonHTMLFragments orion/objects orion/selection".split(" "),function(g,n,p,b,l,f){function e(d,c){var a=this;this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite";if(!c.id)throw Error("Missing required argument: id");this.id=c.id;if(!c.title)throw Error("Missing required argument: title");var e=c.useAuxStyle?["sectionWrapper",
+getLineNumberRuler:function(){return this._lineNumberRuler},getModel:function(){var a=this._textView.getModel();a.getBaseModel&&(a=a.getBaseModel());return a},getOverviewRuler:function(){return this._overviewRuler},getTextView:function(){return this._textView},getKeyModes:function(){return this._textView.getKeyModes()},getSourceCodeActions:function(){return this._sourceCodeActions},getLinkedMode:function(){return this._linkedMode},getTextActions:function(){return this._textActions},focus:function(){this._textView&&
+this._textView.focus()},resize:function(){this._textView&&this._textView.resize()},setAnnotationRulerVisible:function(a,b){if(this._annotationRulerVisible!==a||b)if(this._annotationRulerVisible=a,this._annotationRuler){var d=this._textView;a?d.addRuler(this._annotationRuler,0):d.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(a,b){if(this._foldingRulerVisible!==a||b)if(this._foldingRulerVisible=a,this._foldingRuler){var d=this._textView;d.getModel().getBaseModel&&(a?d.addRuler(this._foldingRuler):
+d.removeRuler(this._foldingRuler))}},setLineNumberRulerVisible:function(a,b){if(this._lineNumberRulerVisible!==a||b)if(this._lineNumberRulerVisible=a,this._lineNumberRuler){var d=this._textView;a?d.addRuler(this._lineNumberRuler,!this._annotationRulerVisible?0:1):d.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(a,b){if(this._overviewRulerVisible!==a||b)if(this._overviewRulerVisible=a,this._overviewRuler){var d=this._textView;a?d.addRuler(this._overviewRuler):d.removeRuler(this._overviewRuler)}},
+mapOffset:function(a,b){var d=this._textView.getModel();d.getBaseModel&&(a=d.mapOffset(a,b));return a},getLineAtOffset:function(a){return this.getModel().getLineAtOffset(this.mapOffset(a))},getLineStart:function(a){return this.getModel().getLineStart(a)},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},getSelection:function(){var a=this._textView,b=a.getSelection(),a=a.getModel();a.getBaseModel&&(b.start=a.mapOffset(b.start),b.end=a.mapOffset(b.end));return b},_expandOffset:function(a){var b=
+this._textView.getModel(),d=this._annotationModel;if(d&&b.getBaseModel)for(a=d.getAnnotations(a,a+1);a.hasNext();)b=a.next(),b.type===h.ANNOTATION_FOLDING&&b.expand&&b.expand()},setCaretOffset:function(a,b,d){var e=this._textView,f=e.getModel();f.getBaseModel&&(this._expandOffset(a),a=f.mapOffset(a,!0));e.setCaretOffset(a,b,d)},setText:function(a,b,d){var e=this._textView,f=e.getModel();f.getBaseModel&&(void 0!==b&&(this._expandOffset(b),b=f.mapOffset(b,!0)),void 0!==d&&(this._expandOffset(d),d=f.mapOffset(d,
+!0)));e.setText(a,b,d)},setSelection:function(a,b,d,e){var f=this._textView,h=f.getModel();h.getBaseModel&&(this._expandOffset(a),this._expandOffset(b),a=h.mapOffset(a,!0),b=h.mapOffset(b,!0));f.setSelection(a,b,d,e)},moveSelection:function(a,b,d,e){var f=this._textView;this.setSelection(a,b||a,1/3,function(){(void 0===e||e)&&f.focus();d&&d()})},_getTooltipInfo:function(a,b){var d=this._textView,e=this.getAnnotationModel();if(!e)return null;var f=this._annotationStyler;if(!f)return null;var h=d.getOffsetAtLocation(a,
+b);if(-1===h)return null;h=this.mapOffset(h);f=f.getAnnotationsByType(e,h,h+1);e=[];for(h=0;h<f.length;h++)f[h].rangeStyle&&e.push(f[h]);if(0===e.length)return null;d=d.convert({x:a,y:b},"document","page");return{contents:e,anchor:"left",x:d.x+10,y:d.y+20}},_highlightCurrentLine:function(a,b){var d=this._annotationModel;if(d){var e=this._textView;if(!e.getOptions("singleMode")){var f=e.getModel(),g=b?f.getLineAtOffset(b.start):-1,l=f.getLineAtOffset(a.start),e=a.start===a.end,t=!b||b.start===b.end,
+y=f.getLineStart(l),s=f.getLineEnd(l);f.getBaseModel&&(y=f.mapOffset(y),s=f.mapOffset(s));f=this._currentLineAnnotation;if(!(g===l&&t&&e&&f&&f.start===y&&f.end===s)){var g=f?[f]:null,v;e&&(f=h.createAnnotation(h.ANNOTATION_CURRENT_LINE,y,s),v=[f]);this._currentLineAnnotation=f;d.replaceAnnotations(g,v)}}}},installTextView:function(){this.install()},install:function(){if(!this._textView){this._textView=this._textViewFactory();this._undoStackFactory&&(this._undoStack=this._undoStackFactory.createUndoStack(this),
+this.checkDirty());this._textDNDFactory&&(this._textDND=this._textDNDFactory.createTextDND(this,this._undoStack));this._contentAssistFactory&&(this._contentAssist=this._contentAssistFactory.createContentAssistMode(this).getContentAssist());var a=this,b=this._textView,d=this;this._listener={onModelChanged:function(){d.checkDirty()},onMouseOver:function(b){d._listener.onMouseMove(b)},onMouseMove:function(a){var c=p.Tooltip.getTooltip(b);c&&!(d._listener.lastMouseX===a.event.clientX&&d._listener.lastMouseY===
+a.event.clientY)&&(d._listener.lastMouseX=a.event.clientX,d._listener.lastMouseY=a.event.clientY,c.setTarget({x:a.x,y:a.y,getTooltipInfo:function(){return d._getTooltipInfo(this.x,this.y)}}))},onMouseOut:function(a){var c=p.Tooltip.getTooltip(b);c&&!(d._listener.lastMouseX===a.event.clientX&&d._listener.lastMouseY===a.event.clientY)&&(d._listener.lastMouseX=a.event.clientX,d._listener.lastMouseY=a.event.clientY,c.setTarget(null))},onScroll:function(){var a=p.Tooltip.getTooltip(b);a&&a.setTarget(null,
+0,0)},onSelection:function(b){d._updateCursorStatus();d._highlightCurrentLine(b.newValue,b.oldValue)}};b.addEventListener("ModelChanged",this._listener.onModelChanged);b.addEventListener("Selection",this._listener.onSelection);b.addEventListener("MouseOver",this._listener.onMouseOver);b.addEventListener("MouseOut",this._listener.onMouseOut);b.addEventListener("MouseMove",this._listener.onMouseMove);b.addEventListener("Scroll",this._listener.onScroll);if(this._keyBindingFactory){var f;if(f="function"===
+typeof this._keyBindingFactory?this._keyBindingFactory(this,this.getKeyModes(),this._undoStack,this._contentAssist):this._keyBindingFactory.createKeyBindings(a,this._undoStack,this._contentAssist))this._textActions=f.textActions,this._linkedMode=f.linkedMode,this._sourceCodeActions=f.sourceCodeActions}f=function(b){if(void 0!==b&&-1!==b){for(var d=this.getView().getModel(),k=this.getAnnotationModel(),e=a.mapOffset(d.getLineStart(b)),b=a.mapOffset(d.getLineEnd(b)),d=k.getAnnotations(e,b),f=null;d.hasNext();){var m=
+d.next();if(m.type===h.ANNOTATION_BOOKMARK){f=m;break}}f?k.removeAnnotation(f):(f=h.createAnnotation(h.ANNOTATION_BOOKMARK,e,b),f.title=void 0,k.addAnnotation(f))}};if(this._annotationFactory){var g=b.getModel();g.getBaseModel&&(g=g.getBaseModel());if(this._annotationModel=this._annotationFactory.createAnnotationModel(g))if(g=this._annotationStyler=this._annotationFactory.createAnnotationStyler(b,this._annotationModel))g.addAnnotationType(h.ANNOTATION_CURRENT_SEARCH),g.addAnnotationType(h.ANNOTATION_MATCHING_SEARCH),
+g.addAnnotationType(h.ANNOTATION_ERROR),g.addAnnotationType(h.ANNOTATION_WARNING),g.addAnnotationType(h.ANNOTATION_MATCHING_BRACKET),g.addAnnotationType(h.ANNOTATION_CURRENT_BRACKET),g.addAnnotationType(h.ANNOTATION_CURRENT_LINE),g.addAnnotationType(h.ANNOTATION_READ_OCCURRENCE),g.addAnnotationType(h.ANNOTATION_WRITE_OCCURRENCE),g.addAnnotationType(h.ANNOTATION_SELECTED_LINKED_GROUP),g.addAnnotationType(h.ANNOTATION_CURRENT_LINKED_GROUP),g.addAnnotationType(h.ANNOTATION_LINKED_GROUP),g.addAnnotationType("orion.annotation.highlightError");
+var g=this._annotationFactory.createAnnotationRulers(this._annotationModel),l=this._annotationRuler=g.annotationRuler;l&&(l.onDblClick=f,l.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"}),l.addAnnotationType(h.ANNOTATION_ERROR),l.addAnnotationType(h.ANNOTATION_WARNING),l.addAnnotationType(h.ANNOTATION_TASK),l.addAnnotationType(h.ANNOTATION_BOOKMARK));this.setAnnotationRulerVisible(this._annotationRulerVisible||void 0===this._annotationRulerVisible,!0);if(l=this._overviewRuler=
+g.overviewRuler)l.addAnnotationType(h.ANNOTATION_CURRENT_SEARCH),l.addAnnotationType(h.ANNOTATION_MATCHING_SEARCH),l.addAnnotationType(h.ANNOTATION_READ_OCCURRENCE),l.addAnnotationType(h.ANNOTATION_WRITE_OCCURRENCE),l.addAnnotationType(h.ANNOTATION_CURRENT_BLAME),l.addAnnotationType(h.ANNOTATION_ERROR),l.addAnnotationType(h.ANNOTATION_WARNING),l.addAnnotationType(h.ANNOTATION_TASK),l.addAnnotationType(h.ANNOTATION_BOOKMARK),l.addAnnotationType(h.ANNOTATION_MATCHING_BRACKET),l.addAnnotationType(h.ANNOTATION_CURRENT_BRACKET),
+l.addAnnotationType(h.ANNOTATION_CURRENT_LINE);this.setOverviewRulerVisible(this._overviewRulerVisible||void 0===this._overviewRulerVisible,!0)}this._lineNumberRulerFactory&&(this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel),this._lineNumberRuler.addAnnotationType(h.ANNOTATION_CURRENT_BLAME),this._lineNumberRuler.addAnnotationType(h.ANNOTATION_BLAME),this._lineNumberRuler.onDblClick=f,this.setLineNumberRulerVisible(this._lineNumberRulerVisible||void 0===
+this._lineNumberRulerVisible,!0));this._foldingRulerFactory&&(this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),this._foldingRuler.addAnnotationType(h.ANNOTATION_FOLDING),this.setFoldingRulerVisible(this._foldingRulerVisible||void 0===this._foldingRulerVisible,!0));this.dispatchEvent({type:"TextViewInstalled",textView:b});e.prototype.install.call(this)}},uninstallTextView:function(){this.uninstall()},uninstall:function(){var a=this._textView;a&&(a.destroy(),this._textView=
+this._undoStack=this._textDND=this._contentAssist=this._listener=this._annotationModel=this._annotationStyler=this._annotationRuler=this._overviewRuler=this._lineNumberRuler=this._foldingRuler=this._currentLineAnnotation=this._title=null,this._dirty=!1,this._foldingRulerVisible=this._overviewRulerVisible=this._lineNumberRulerVisible=this._annotationRulerVisible=void 0,this.dispatchEvent({type:"TextViewUninstalled",textView:a}),e.prototype.uninstall.call(this))},_updateCursorStatus:function(){for(var a=
+this.getModel(),b=this.getCaretOffset(),d=a.getLineAtOffset(b),a=a.getLineStart(d),b=b-a,a=this.getKeyModes(),e=0;e<a.length;e++){var h=a[e];if(h.isActive()&&h.isStatusActive&&h.isStatusActive())return}this.reportStatus(f.formatMessage(g.lineColumn,d+1,b+1))},showAnnotations:function(a,b,d,e){var f=this._annotationModel;if(f){for(var g=[],l=[],t=f.getTextModel(),y=f.getAnnotations(),s;y.hasNext();)s=y.next(),-1!==b.indexOf(s.type)&&s.creatorID===this&&g.push(s);if(a)for(b=0;b<a.length;b++)if(s=a[b]){if(d)s=
+d(s);else{var v;"number"===typeof s.line?(v=t.getLineStart(s.line-1),y=v+s.start-1,v=v+s.end-1):(y=s.start,v=s.end);var p=e(s);if(!p)continue;s=h.createAnnotation(p,y,v,s.description)}s.creatorID=this;l.push(s)}f.replaceAnnotations(g,l)}},showProblems:function(a){this.showAnnotations(a,[h.ANNOTATION_ERROR,h.ANNOTATION_WARNING,h.ANNOTATION_TASK],null,function(b){switch(b.severity){case "error":return h.ANNOTATION_ERROR;case "warning":return h.ANNOTATION_WARNING;case "task":return h.ANNOTATION_TASK}return null})},
+showOccurrences:function(a){this.showAnnotations(a,[h.ANNOTATION_READ_OCCURRENCE,h.ANNOTATION_WRITE_OCCURRENCE],null,function(b){return b.readAccess?h.ANNOTATION_READ_OCCURRENCE:h.ANNOTATION_WRITE_OCCURRENCE})},showBlame:function(c){var b=this._blameRGB,d=this.getTextView().getOptions("parent").ownerDocument;if(!b){var e=f.createElement(d,"div");e.className="annotation blame";d.body.appendChild(e);var r=(d.defaultView||d.parentWindow).getComputedStyle(e).getPropertyValue("background-color");e.parentNode.removeChild(e);
+var e=r.indexOf("("),p=r.indexOf(")"),r=r.substring(e+1,p);this._blameRGB=b=r.split(",").slice(0,3)}var n=function(){var b=a.AnnotationType.createAnnotation(this.groupType,this.start,this.end,this.title);b.style=l.mixin({},b.style);b.style.style=l.mixin({},b.style.style);b.style.style.backgroundColor="";this.groupAnnotation=b;b.blame=this.blame;b.html=this.html;b.creatorID=this.creatorID;return b},t=function(){var b=f.createElement(d,"div");b.className="tooltipTitle";var a=this.blame.Message.indexOf("\n");
+-1===a&&(a=this.blame.Message.length);var c=f.createElement(d,"a");c.href=this.blame.CommitLink;c.appendChild(d.createTextNode(this.blame.Message.substring(0,a)));b.appendChild(c);b.appendChild(f.createElement(d,"br"));b.appendChild(d.createTextNode(f.formatMessage(g.committerOnTime,this.blame.AuthorName,this.blame.Time)));return b},y=this.getModel();this.showAnnotations(c,[h.ANNOTATION_BLAME,h.ANNOTATION_CURRENT_BLAME],function(c){var d=y.getLineStart(c.Start-1),e=y.getLineEnd(c.End-1,!0),d=a.AnnotationType.createAnnotation(h.ANNOTATION_BLAME,
+d,e,t),e=b.slice(0);e.push(c.Shade);d.style=l.mixin({},d.style);d.style.style=l.mixin({},d.style.style);d.style.style.backgroundColor="rgba("+e.join()+")";d.groupId=c.Name;d.groupType=h.ANNOTATION_CURRENT_BLAME;d.createGroupAnnotation=n;d.html='<img class="annotationHTML blame" src="'+c.AuthorImage+'"/>';d.blame=c;return d})},showSelection:function(a,b,d,e,f){"number"===typeof a?("number"!==typeof b&&(b=a),this.moveSelection(a,b)):"number"===typeof d&&(a=this.getModel().getLineStart(d-1),"number"===
+typeof e&&(a+=e),"number"!==typeof f&&(f=0),this.moveSelection(a,a+f))},_setModelText:function(a){this._textView&&(this._textView.setText(a),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelection()))},setInput:function(a,b,d,f,h){e.prototype.setInput.call(this,a,b,d,f);this._textView&&(!f&&!h)&&this._textView.focus()},onGotoLine:function(a,b,d,e){if(this._textView){var f=this.getModel(),a=Math.max(0,Math.min(a,f.getLineCount()-1)),h=f.getLineStart(a),
+g=0;void 0===d&&(d=0);"string"===typeof b?(a=f.getLine(a).indexOf(b),-1!==a&&(g=a,d=g+b.length)):(g=b,b=f.getLineEnd(a)-h,g=Math.min(g,b),d=Math.min(d,b));this.moveSelection(h+g,h+d,e)}}});return{BaseEditor:e,Editor:d}});
+define("orion/selection",["orion/EventTarget","orion/Deferred"],function(g){function n(p,a){a||(a="orion.page.selection");this._serviceRegistry=p;g.attach(this);this._serviceRegistration=p.registerService(a,this);this._selections=null}n.prototype={getSelection:function(g){var a=this._getSingleSelection();"function"===typeof g&&g(a);return a},getSelections:function(g){var a=Array.isArray(this._selections)?this._selections.slice():[];"function"===typeof g&&g(a);return a},_getSingleSelection:function(){return this._selections&&
+0<this._selections.length?this._selections[0]:null},setSelections:function(g){var a=this._selections;this._selections=Array.isArray(g)?0<g.length?g.slice():null:g?[g]:null;a!==this._selections&&this.dispatchEvent({type:"selectionChanged",selection:this._getSingleSelection(),selections:this._selections})}};n.prototype.constructor=n;return{Selection:n}});
+define("orion/commandRegistry","require orion/commands orion/explorers/navigationUtils orion/PageUtil orion/uiUtils orion/webui/littlelib orion/webui/dropdown orion/webui/tooltip text!orion/webui/checkedmenuitem.html text!orion/webui/dropdowntriggerbutton.html text!orion/webui/submenutriggerbutton.html".split(" "),function(g,n,p,a,l,f,e,d,h,c,b){function k(b){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(b);this._parameterCollector=
+null}function m(b,a){this.token=b;this.parameterName=a}function r(b,a,c){this.event=b;this.handler=a;this.capture=c||!1}function x(b,a,c,d,e,k){this.name=b;this.type=a;this.label=c;this.value=d;this.lines=e||1;this.eventListeners=Array.isArray(k)?k:k?[k]:[]}function u(b,a,c){this._storeParameters(b);this._hasOptionalParameters=a&&a.hasOptionalParameters;this._options=a;this.optionsRequested=!1;this.getParameters=c;this.clientCollect=a&&a.clientCollect}k.prototype={_init:function(b){this._selectionService=
+b.selection;var a=this;n.setKeyBindingProvider(function(){return a._activeBindings})},processURL:function(b){for(var a in this._urlBindings)if(this._urlBindings[a]&&this._urlBindings[a].urlBinding&&this._urlBindings[a].command){var c=this._urlBindings[a].urlBinding.match(b);if(c){var d=this._urlBindings[a],e=d.command,k=d.invocation;if(k&&k.parameters&&e.callback){k.parameters.setValue(c.parameterName,c.parameterValue);var f=this;window.setTimeout(function(){f._invoke(k)},0);break}}}},findCommand:function(b){return this._commandList[b]},
+runCommand:function(b,a,c,d){a?(b=this._commandList[b])&&(b.visibleWhen?b.visibleWhen(a):1)&&b.callback&&this._invoke(new n.CommandInvocation(c,a,null,b,this),d):(a=this._urlBindings[b])&&a.command&&a.command.callback&&this._invoke(a.invocation,d)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(b){this._parameterCollector=b},openParameterCollector:function(b,a,c){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(b,
+a,c))},confirm:function(b,a,c,d,e,k){var f=!1;if(this._parameterCollector&&!e){var m=this;this._parameterCollector.close();if(this._parameterCollector.open(b,function(b,e){var k=document.createElement("span");k.classList.add("parameterPrompt");k.textContent=a;b.appendChild(k);k=document.createElement("button");k.addEventListener("click",function(){f=!0;m._parameterCollector.close()},!1);e.appendChild(k);k.appendChild(document.createTextNode(c));k.className="dismissButton";var h=document.createElement("button");
+h.addEventListener("click",function(){f=!1;m._parameterCollector.close()},!1);e.appendChild(h);h.appendChild(document.createTextNode(d));h.className="dismissButton";return k},function(){k(f)}))return}f=window.confirm(a);k(f)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(b,a){return this._collectAndInvoke(b.makeCopy(a),!1)},_collectAndInvoke:function(b,a){if(b)if(this._parameterCollector&&
+b.parameters&&b.parameters.hasParameters()&&(a||b.parameters.shouldCollectParameters())){var c=!1;b.parameters.updateParameters(b);if(b.parameters.shouldCollectParameters()&&(c=this._parameterCollector.collectParameters(b),!c)){var e=new d.Tooltip({node:b.domNode,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]}),c=e.contentContainer();c.classList.add("parameterPopup");var k=window.document.activeElement,f=this._parameterCollector.getFillFunction(b,
+function(){k&&k.focus();e.destroy()})(c);e.show();window.setTimeout(function(){f.focus();f.select()},0);c=!0}c||b.command.callback.call(b.handler||window,b)}else b.command.callback.call(b.handler||window,b);else window.console.log("Client attempted to invoke command without an available (rendered) command invocation")},collectParameters:function(b){this._collectAndInvoke(b,!0)},showKeyBindings:function(b){function a(b){return function(){n.executeBinding(b)}}var c={},d,e,k=[],f;for(f in this._activeBindings)(e=
+this._activeBindings[f])&&(e.keyBinding&&e.command&&(e.command.name||e.command.tooltip))&&k.push(e);k.sort(function(b,a){return(b.command.name||b.command.tooltip).localeCompare(a.command.name||a.command.tooltip)});for(f=0;f<k.length;f++)e=k[f],e.keyBinding.scopeName?(c[e.keyBinding.scopeName]||(c[e.keyBinding.scopeName]=[]),c[e.keyBinding.scopeName].push(e)):(d=l.getUserKeyString(e.keyBinding),b.createItem(d,e.command.name||e.command.tooltip,a(e)));for(var m in c)c[m].length&&0<c[m].length&&(b.createHeader(m),
+c[m].forEach(function(c){d=l.getUserKeyString(c.keyBinding);b.createItem(d,c.command.name||c.command.tooltip,a(c))}))},addCommand:function(b){this._commandList[b.id]=b;var a=this._pendingBindings[b.id];if(a){var c=this;a.forEach(function(a){c._addBinding(b,a.type,a.binding,a.bindingOnly)});delete this._pendingBindings[b.id]}},addCommandGroup:function(b,a,c,d,e,k,f,m,h,g){this._contributionsByScopeId[b]||(this._contributionsByScopeId[b]={});b=this._contributionsByScopeId[b];e&&(b=this._createEntryForPath(b,
+e));b[a]?(d&&(b[a].title=d),c&&(b[a].position=c),f&&(b[a].imageClass=f),m&&(b[a].tooltip=m),h&&(b[a].selectionClass=h),!0===g?b[a].pretendDefaultActionId=!0:b[a].defaultActionId=g,b[a].emptyGroupMessage=k):(b[a]={title:d,position:c,emptyGroupMessage:k,imageClass:f,tooltip:m,selectionClass:h,defaultActionId:!0===g?null:g,pretendDefaultActionId:!0===g,children:{}},b.sortedContributions=null)},_createEntryForPath:function(b,a){a&&a.split("/").forEach(function(a){1<a.length&&(b[a]||(b[a]={position:0,
+children:{}},b.sortedContributions=null),b=b[a].children)});return b},registerSelectionService:function(b,a){this._contributionsByScopeId[b]||(this._contributionsByScopeId[b]={});this._contributionsByScopeId[b].localSelectionService=a},registerCommandContribution:function(b,a,c,d,e,k,f){this._contributionsByScopeId[b]||(this._contributionsByScopeId[b]={});b=this._contributionsByScopeId[b];d&&(b=this._createEntryForPath(b,d));b[a]={position:c};k&&((c=this._commandList[a])?this._addBinding(c,"key",
+k,e):this._addPendingBinding(a,"key",k,e));f&&((c=this._commandList[a])?this._addBinding(c,"url",f,e):this._addPendingBinding(a,"url",f,e));b.sortedContributions=null},unregisterCommandContribution:function(b,a,c){if(this._contributionsByScopeId[b]){delete this._commandList[a];delete this._activeBindings[a];delete this._urlBindings[a];delete this._pendingBindings[a];var d=this._contributionsByScopeId[b];c&&c.split("/").forEach(function(b){1<b.length&&d[b]&&(d=d[b].children)});delete d[a];d.sortedContributions=
+null}},_addBinding:function(b,a,c,d){if(!b.id)throw Error("No command id: "+b);"key"===a?this._activeBindings[b.id]={command:b,keyBinding:c,bindingOnly:d}:"url"===a&&(this._urlBindings[b.id]={command:b,urlBinding:c,bindingOnly:d})},_addPendingBinding:function(b,a,c,d){this._pendingBindings[b]=this._pendingBindings[b]||[];this._pendingBindings[b].push({type:a,binding:c,bindingOnly:d})},_checkForTrailingSeparator:function(b,a,c){var d;if("tool"===a||"button"===a)if((d=0<b.childNodes.length?b.childNodes[b.childNodes.length-
+1]:null)&&d.classList.contains("commandSeparator"))return c?(b.removeChild(d),!1):!0;if("menu"===a&&(b=f.$$array("li > *",b),0<b.length&&b[b.length-1].classList.contains("dropdownSeparator")))if(d=b[b.length-1],c)d.parentNode.parentNode.removeChild(d.parentNode);else return!0;return!1},renderCommands:function(b,a,c,d,e,k,m){if("string"!==typeof b)throw"a scope id for rendering must be specified";a=f.node(a);if(!a)throw"no parent";var h=this._contributionsByScopeId[b];if(!c&&h){var c=h.localSelectionService||
+this._selectionService,g=this;c&&c.getSelections(function(c){g.renderCommands(b,a,c,d,e,k)})}else h&&(this._render(this._contributionsByScopeId[b],a,c,d,e||"button",k,m),this._checkForTrailingSeparator(a,e,!0))},destroy:function(b){b=f.node(b);if(!b)throw"no parent";for(;b.hasChildNodes();){var a=b.firstChild;a.commandTooltip&&a.commandTooltip.destroy();a.emptyGroupTooltip&&a.emptyGroupTooltip.destroy();this.destroy(a);b.removeChild(a)}},_render:function(b,a,c,e,k,f,m){var h=b.sortedContributions;
+if(!h){var h=[],g=!1,l;for(l in b)if(Object.prototype.hasOwnProperty.call(b,l)){var r=b[l];r&&"number"===typeof r.position&&(r.id=l,h.push(r),g=!0)}g&&(h.sort(function(b,a){return b.position-a.position}),b.sortedContributions=h)}var x=0,u=this;h.forEach(function(b){var h,g;b.imageClass||(b.imageClass=null);if(b.children&&0<Object.getOwnPropertyNames(b.children).length){h=b.children;var l;if("tool"===k||"button"===k)if(b.title){var r;b.defaultActionId&&((h=u._commandList[b.defaultActionId])&&(h.visibleWhen?
+h.visibleWhen(c):1)?(r=new n.CommandInvocation(e,c,f,h,u),r.domParent=a):b.pretendDefaultActionId=!0);l=u._createDropdownMenu(a,b.title,null,null,b.imageClass,b.tooltip,b.selectionClass,null,r,b.pretendDefaultActionId);m&&p.generateNavGrid(m,l.menuButton);l&&window.setTimeout(function(){u._render(b.children,l.menu,c,e,"menu",f,m);u._checkForTrailingSeparator(l.menu,"menu",!0);0===l.menu.childNodes.length?b.emptyGroupMessage?l.menuButton.emptyGroupTooltip||(l.menuButton.emptyGroupTooltip=new d.Tooltip({node:l.menuButton,
+text:b.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})):(m&&p.removeNavGrid(m,l.menuButton),l.menu.parentNode&&l.menu.parentNode.removeChild(l.menu),l.destroyButton&&l.destroyButton.parentNode&&l.destroyButton.parentNode.removeChild(l.destroyButton)):l.menuButton.style.visibility="visible"},0)}else{var t;0<a.childNodes.length&&!u._checkForTrailingSeparator(a,k)&&(t=u.generateSeparatorImage(a));u._render(h,a,c,e,k,f,m);0<a.childNodes.length&&a.childNodes[a.childNodes.length-
+1]!==t&&(t=u.generateSeparatorImage(a))}else if(b.title){if(r=u._createDropdownMenu(a,b.title,!0,null,null,b.imageClass))u._render(h,r.menu,c,e,"menu",f,m),0===r.menu.childNodes.length&&r.destroyButton&&a.removeChild(r.destroyButton)}else 0<a.childNodes.length&&u._generateMenuSeparator(a),u._render(h,a,c,e,k,f,m),u._generateMenuSeparator(a)}else{var A=u._commandList[b.id];h=A?!0:!1;t=t=null;A&&(g=new n.CommandInvocation(e,c,f,A,u),g.domParent=a,r=h&&(A.visibleWhen?A.visibleWhen(c):!0),u._activeBindings[A.id]&&
+u._activeBindings[A.id].keyBinding&&(t=u._activeBindings[A.id],t.invocation=r?g:null,t.bindingOnly&&(h=!1)),u._urlBindings[A.id]&&u._urlBindings[A.id].urlBinding&&(t=u._urlBindings[A.id],t.invocation=r?g:null,t.bindingOnly&&(h=!1)),h=h&&r);h&&(A.choiceCallback?("tool"===k||"button"===k?(h=a,r=!1,"ul"===a.nodeName.toLowerCase()&&(h=document.createElement("li"),a.appendChild(h))):(h=a,r=!0),u._createDropdownMenu(h,A.name,r,function(b){A.populateChoicesMenu(b,c,e,f,u)}.bind(A),A.imageClass,A.tooltip||
+A.title,A.selectionClass,A.positioningNode)):(g.handler=g.handler||this,g.domParent=a,r=function(){u._invoke(g)},"menu"===k?h=n.createCommandMenuItem(a,A,g,null,r):(h=k+A.id+x,h=n.createCommandItem(a,A,g,h,null,"tool"===k,r)),p.generateNavGrid(m,h),g.domNode=h,x++))}})},_createDropdownMenu:function(a,c,k,h,m,g,l,r,p,u){a=f.node(a);if(!a||!f.contains(document.body,a))return null;var x,E=a;if(k)g=document.createRange(),g.selectNode(a),g=g.createContextualFragment(b),f.processTextNodes(g,{ButtonText:c}),
+a.appendChild(g),x=a.lastChild,u=x.lastChild,c=u.previousSibling,c.dropdown=new e.Dropdown({dropdown:u,populate:h,parentDropdown:a.dropdown}),u.dropdown=c.dropdown;else{"ul"===a.nodeName.toLowerCase()&&(E=document.createElement("li"),a.appendChild(E),x=E);a=null;m&&(a="dropdownButtonWithIcon",g=g||c);g=m?g||c:g;h=n.createDropdownMenu(E,c,h,a,m,!1,l,r,p||u);if(p){p.domNode=h.menuButton;var N=this;h.menuButton.onclick=function(){N._invoke(p)}}else u&&h.dropdown&&h.dropdown.addTriggerNode(h.menuButton);
+c=h.menuButton;u=h.menu;g&&(c.commandTooltip=new d.Tooltip({node:c,text:p&&p.command&&p.command.name?g+": "+p.command.name:g,position:["above","below","right","left"]}),h.extraDropdownButton&&(c.commandTooltip=new d.Tooltip({node:h.extraDropdownButton,text:g,position:["above","below","right","left"]})))}return{menuButton:c,menu:u,dropdown:c.dropdown,destroyButton:x}},_generateMenuSeparator:function(b){if(!this._checkForTrailingSeparator(b,"menu")){var a=document.createElement("li");a.classList.add("dropdownSeparator");
+var c=document.createElement("span");c.classList.add("dropdownSeparator");a.appendChild(c);b.appendChild(a)}},generateSeparatorImage:function(b){var a;a="ul"===b.nodeName.toLowerCase()?document.createElement("li"):document.createElement("span");b.appendChild(a);a.classList.add("core-sprite-sep");a.classList.add("imageSprite");a.classList.add("commandSeparator");return a}};k.prototype.constructor=k;m.prototype={match:function(b){b=a.matchResourceParameters(b);return"undefined"!==typeof b[this.token]?
+(this.parameterValue=b[this.token],this):null}};m.prototype.constructor=m;r.prototype.constructor=r;x.prototype={optionsRequested:function(){return this.optionsRequested}};x.prototype.constructor=x;u.prototype={_storeParameters:function(b){this.parameterTable=null;if(b){var a=this.parameterTable={};b.forEach(function(b){a[b.name]=b})}},updateParameters:function(b){"function"===typeof this.getParameters&&this._storeParameters(this.getParameters(b))},hasParameters:function(){return null!==this.parameterTable},
+shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(b){return this.parameterTable[b]},valueFor:function(b){return(b=this.parameterTable[b])?b.value:null},setValue:function(b,a){var c=this.parameterTable[b];c&&(c.value=a)},forEach:function(b){for(var a in this.parameterTable)this.parameterTable[a].type&&this.parameterTable[a].name&&b(this.parameterTable[a])},makeCopy:function(){var b=[];this.forEach(function(a){a=new x(a.name,a.type,a.label,a.value,
+a.lines,a.eventListeners);b.push(a)});var a=new u(b,this._options,this.getParameters);a.clientCollect=this.clientCollect;return a},hasOptionalParameters:function(){return this._hasOptionalParameters}};u.prototype.constructor=u;return{CommandRegistry:k,URLBinding:m,ParametersDescription:u,CommandParameter:x,CommandEventListener:r}});define("text!orion/banner/slideout.html",[],function(){return'<div id="slideContainer" class="slideParameters slideContainer">\r\n\t<span id="pageCommandParameters" class="layoutLeft parameters"></span>\r\n\t<span id="pageCommandDismiss" class="layoutRight parametersDismiss"></span>\r\n</div>'});
+define("orion/commonHTMLFragments",["require","orion/webui/littlelib","text!orion/banner/slideout.html"],function(g,n,p){return{slideoutHTMLFragment:function(a){var g=document.createElement("div");g.innerHTML=p;var f=n.$("#slideContainer",g);f.id=a+f.id;f=n.$("#pageCommandParameters",g);f.id=a+f.id;f=n.$("#pageCommandDismiss",g);f.id=a+f.id;return g.innerHTML}}});
+define("orion/section","orion/webui/littlelib orion/selection orion/commandRegistry orion/commonHTMLFragments orion/objects orion/selection".split(" "),function(g,n,p,a,l,f){function e(d,c){var b=this;this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite";if(!c.id)throw Error("Missing required argument: id");this.id=c.id;if(!c.title)throw Error("Missing required argument: title");var e=c.useAuxStyle?["sectionWrapper",
 "sectionWrapperAux","toolComposite"]:["sectionWrapper","toolComposite"];this.domNode=document.createElement("div");d.appendChild(this.domNode);for(var f=0;f<e.length;f++)this.domNode.classList.add(e[f]);this.domNode.id=c.id;c.canHide&&(this.twistie=document.createElement("span"),this.twistie.classList.add("modelDecorationSprite"),this.twistie.classList.add("layoutLeft"),this.twistie.classList.add("sectionTitleTwistie"),this.domNode.style.cursor="pointer",this.domNode.appendChild(this.twistie),this.domNode.tabIndex=
-0,this.domNode.addEventListener("click",function(b){(b.target===a.titleNode||b.target===a.twistie)&&a._changeExpandedState()},!1),this.domNode.addEventListener("keydown",function(b){b.keyCode===g.KEY.ENTER&&(b.target===a.domNode||b.target===a.titleNode||b.target===a.twistie)&&a._changeExpandedState()},!1));if(c.iconClass){var r=document.createElement("span");r.classList.add("sectionIcon");this.domNode.appendChild(r);e=Array.isArray(c.iconClass)?c.iconClass:[c.iconClass];e.forEach(function(a){r.classList.add(a)})}c.headerClass&&
-(e=Array.isArray(c.headerClass)?c.headerClass:[c.headerClass],e.forEach(function(a){this.domNode.classList.add(a)}.bind(this)));this.titleNode=document.createElement("div");this.titleNode.id=c.id+"Title";this.titleNode.classList.add("sectionAnchor");this.titleNode.classList.add("sectionTitle");this.titleNode.classList.add("layoutLeft");this.domNode.appendChild(this.titleNode);this.titleNode.textContent=c.title;"function"===typeof c.getItemCount&&(e=document.createElement("div"),e.classList.add("layoutLeft"),
+0,this.domNode.addEventListener("click",function(a){(a.target===b.titleNode||a.target===b.twistie)&&b._changeExpandedState()},!1),this.domNode.addEventListener("keydown",function(a){a.keyCode===g.KEY.ENTER&&(a.target===b.domNode||a.target===b.titleNode||a.target===b.twistie)&&b._changeExpandedState()},!1));if(c.iconClass){var l=document.createElement("span");l.classList.add("sectionIcon");this.domNode.appendChild(l);e=Array.isArray(c.iconClass)?c.iconClass:[c.iconClass];e.forEach(function(b){l.classList.add(b)})}c.headerClass&&
+(e=Array.isArray(c.headerClass)?c.headerClass:[c.headerClass],e.forEach(function(b){this.domNode.classList.add(b)}.bind(this)));this.titleNode=document.createElement("div");this.titleNode.id=c.id+"Title";this.titleNode.classList.add("sectionAnchor");this.titleNode.classList.add("sectionTitle");this.titleNode.classList.add("layoutLeft");this.domNode.appendChild(this.titleNode);this.titleNode.textContent=c.title;"function"===typeof c.getItemCount&&(e=document.createElement("div"),e.classList.add("layoutLeft"),
 e.classList.add("sectionItemCount"),this.domNode.appendChild(e),e.textContent=c.getItemCount(this));this._progressNode=document.createElement("div");this._progressNode.id=c.id+"Progress";this._progressNode.classList.add("sectionProgress");this._progressNode.classList.add("sectionTitle");this._progressNode.classList.add("layoutLeft");this._progressNode.style.visibility="hidden";this._progressNode.textContent="...";this.domNode.appendChild(this._progressNode);e=document.createElement("div");e.id=c.id+
 "FilterSearchBox";this.domNode.appendChild(e);this._toolActionsNode=document.createElement("div");this._toolActionsNode.id=c.id+"ToolActionsArea";this._toolActionsNode.classList.add("layoutRight");this._toolActionsNode.classList.add("sectionActions");this.domNode.appendChild(this._toolActionsNode);this.actionsNode=document.createElement("div");this.actionsNode.id=c.id+"ActionArea";this.actionsNode.classList.add("layoutRight");this.actionsNode.classList.add("sectionActions");this.domNode.appendChild(this.actionsNode);
-this.selectionNode=document.createElement("div");this.selectionNode.id=c.id+"SelectionArea";this.selectionNode.classList.add("layoutRight");this.selectionNode.classList.add("sectionActions");this.domNode.appendChild(this.selectionNode);c.slideout&&(e=b.slideoutHTMLFragment(c.id),f=document.createRange(),f.selectNode(this.domNode),e=f.createContextualFragment(e),this.domNode.appendChild(e));this._contentParent=document.createElement("div");this._contentParent.id=this.id+"Content";this._contentParent.role=
-"region";this._contentParent.classList.add("sectionTable");this._contentParent.setAttribute("aria-labelledby",this.titleNode.id);d.appendChild(this._contentParent);c.content&&this.setContent(c.content);this.hidden=c.hidden;"function"===typeof c.onExpandCollapse&&(this._onExpandCollapse=c.onExpandCollapse);this._preferenceService=c.preferenceService;this._contentParent.style.display="none";this.domNode.classList.add("sectionWrapperClosed");if(this._preferenceService){var l=this;this._preferenceService.getPreferences("/window/views").then(function(a){a=
-a.get(l.id);void 0!==a&&(l.hidden=!a);l.hidden||(l._contentParent.style.display="block",l.domNode.classList.remove("sectionWrapperClosed"));l._updateExpandedState(!l.hidden,!1)})}else this.hidden||(this._contentParent.style.display="block",this.domNode.classList.remove("sectionWrapperClosed")),this._updateExpandedState(!this.hidden,!1);this._commandService=c.commandService;this._lastMonitor=0;this._loading={}}function d(b){this._section=b;this._id=++b._lastMonitor}e.prototype={setTitle:function(b){this.titleNode.textContent=
-b},getHeaderElement:function(){return this.domNode},getTitleElement:function(){return this.titleNode},setContent:function(b){"string"===typeof b?this._contentParent.innerHTML=b:(this._contentParent.innerHTML="",this._contentParent.appendChild(b))},getContentElement:function(){return this._contentParent},embedExplorer:function(b,c,a){this._contentParent.innerHTML="";b.parent||(b.parent=c);this._contentParent.appendChild(b.parent);b.section=this;l.mixin(b,{createActionSections:function(){this.actionsSections&&
-this.actionsSections.forEach(function(a){if(!g.node(a)){var b=document.createElement("ul");b.id=a;b.classList.add("commandList");b.classList.add("layoutRight");this.section.actionsNode.appendChild(b)}}.bind(this))},getCommandsVisible:function(){return"hidden"!==this.section.actionsNode.style.visibility},setCommandsVisible:function(a){this.section.actionsNode.style.visibility=a?"":"hidden";var b=a?null:"cursorOnly";this.renderer.selectionPolicy=b;var c=this.getNavHandler();c&&c.setSelectionPolicy(b);
-a?this.updateCommands():this.actionsSections&&this.actionsSections.forEach(function(a){g.node(a)&&this.commandRegistry.destroy(a)}.bind(this))},destroy:function(){Object.getPrototypeOf(this).destroy.call(this);var a=this;this.actionsSections&&(this.actionsSections.forEach(function(b){delete a[b]}),delete this.actionsSections)},updateCommands:function(a){this.section.actionsNode&&this.getCommandsVisible()&&(this.createActionSections(),Object.getPrototypeOf(this).updateCommands.call(this,a))},loaded:function(){var b=
-this;!this.selection&&!a&&(this.serviceRegistry||this.registry?(this.selection=new f.Selection(this.serviceRegistry||this.registry,this.parent.id+"Selection"),this.selection.addEventListener("selectionChanged",function(a){b.updateCommands(a.selections)})):window.console.error("Could not create a Selection for the explorer because of lack of serviceRegistry"));var c=this.registerCommands();!c||!c.then?b.updateCommands():c.then(function(){b.updateCommands()})}});b.renderer&&(b.renderer.section=this,
-l.mixin(b.renderer,{getCellHeaderElement:function(a){(a=Object.getPrototypeOf(this).getCellHeaderElement.call(this,a))&&this.section.setTitle(a.innerHTML);return null}}))},createProgressMonitor:function(){return new d(this)},_setMonitorMessage:function(b,c){this._progressNode.style.visibility="visible";this._loading[b]=c;var a="",d;for(d in this._loading)""!==a&&(a+="\n"),a+=this._loading[d];this._progressNode.title=a},_monitorDone:function(b){delete this._loading[b];var b="",c;for(c in this._loading)""!==
-b&&(b+="\n"),b+=this._loading[c];this._progressNode.title=b;""===b&&(this._progressNode.style.visibility="hidden")},_changeExpandedState:function(){this.hidden?(this._contentParent.style.display="block",this.domNode.classList.remove("sectionWrapperClosed"),this.hidden=!1):(this._contentParent.style.display="none",this.domNode.classList.add("sectionWrapperClosed"),this.hidden=!0);this._updateExpandedState(!this.hidden,!0)},_updateExpandedState:function(b,c){var a=this.twistie,d=this.id;a&&(a.classList.add(b?
-this._expandImageClass:this._collapseImageClass),a.classList.remove(b?this._collapseImageClass:this._expandImageClass));this._preferenceService&&c&&this._preferenceService.getPreferences("/window/views").then(function(a){a.put(d,b)});this._onExpandCollapse&&this._onExpandCollapse(b,this)}};e.prototype.constructor=e;d.prototype={begin:function(b){this.status=b;this._section._setMonitorMessage(this.id,b)},worked:function(b){this.status=b;this._section._setMonitorMessage(this.id,b)},done:function(b){this.status=
-b;this._section._monitorDone(this.id)}};d.prototype.constructor=d;return{Section:e}});
-define("orion/markdownView","marked/marked orion/editor/editor orion/objects orion/webui/littlelib orion/URITemplate orion/PageUtil orion/section orion/URL-shim".split(" "),function(g,n,p,b,l,f,e){function d(a){var b=g.InlineLexer.prototype.outputLink,c=f.matchResourceParameters().resource,d=new URL(c,window.location.href),e=g.InlineLexer.prototype,m=-1===c.indexOf(":");e.outputLink=function(a,c){if(-1===c.href.indexOf(":"))try{var e;"filesystem:"===d.protocol?e={href:"filesystem:"+(new URL(c.href,
-d.pathname)).href}:(e=new URL(c.href,d),m&&(e.protocol="",e.host=""));c.href="!"!==a[0][0]?k.expand({resource:e.href}):e.href}catch(f){console.log(f)}return b.call(this,a,c)};a=g(a,{sanitize:!0});g.InlineLexer.prototype.outputLink=b;return a}function h(a){this.fileClient=a.fileClient;this.progress=a.progress;this.canHide=a.canHide;this._node=null}function c(a){this.id="orion.markdownViewer";m.apply(this,arguments)}function a(a){this._parent=a.parent;this.serviceRegistry=a.serviceRegistry;this.contentTypeRegistry=
-a.contentTypeRegistry;this.commandRegistry=a.commandRegistry;this.progress=a.progressService;this.model=a.model;this.undoStack=a.undoStack}var k=new l("#{,resource,params*}");h.prototype={display:function(a,b){a.classList.add("orionMarkdown");a.innerHTML=d(b)},displayContents:function(a,c){var d=c.Location||c;b.empty(a);var e=document.createElement("div");(this.progress?this.progress.progress(this.fileClient.read(d),"Reading file "+(c.Name||d)):this.fileClient.read(d)).then(function(a){this.display.bind(this)(e,
-a)}.bind(this));a.appendChild(e)},displayInFrame:function(a,b,c){a=new e.Section(a,{id:"markdownSection",title:b.Name||"readme",headerClass:c,canHide:this.canHide});this.displayContents.call(this,a.getContentElement(),b)}};var m=n.BaseEditor;c.prototype=Object.create(m.prototype);p.mixin(c.prototype,{install:function(){var a=this._rootDiv=document.createElement("div");a.style.width="100%";a.style.height="100%";var c=this._contentDiv=document.createElement("div");c.classList.add("orionMarkdown");a.appendChild(c);
-b.node(this._domNode).appendChild(a);this._contentDiv.innerHTML=d(this.getModel().getText());m.prototype.install.call(this)},setInput:function(a,b,c,e){m.prototype.setInput.call(this,a,b,c,e);!b&&!e&&(this._contentDiv.innerHTML=d(c))},uninstall:function(){b.empty(this._domNode);m.prototype.uninstall.call(this)}});a.prototype={create:function(){this.editor=new c({domNode:this._parent,model:this.model,undoStack:this.undoStack});this.editor.install()},destroy:function(){this.editor&&this.editor.destroy();
-this.editor=null}};return{MarkdownEditorView:a,MarkdownView:h}});
-define("orion/widgets/browse/browseView","i18n!orion/edit/nls/messages orion/explorers/explorer-table orion/explorers/navigatorRenderer orion/markdownView orion/PageUtil orion/URITemplate orion/webui/littlelib orion/objects orion/Deferred orion/section".split(" "),function(g,n,p,b,l,f,e,d,h,c){function a(){w.apply(this,arguments)}function k(b){b.setFocus=!1;b.cachePrefix=null;b.rendererFactory=function(c){return new a({checkbox:!1,cachePrefix:"FolderNavigator"},c,b.commandRegistry,b.contentTypeRegistry)};
-r.apply(this,arguments);this.commandsId=".folderNav";this.fileClient=b.fileClient;this.commandRegistry=b.commandRegistry;this.contentTypeRegistry=b.contentTypeRegistry;this.readonly=b.readonly;this.breadCrumbMaker=b.breadCrumbMaker;this.clickHandler=b.clickHandler;this.treeRoot={};this.parent=e.node(b.parentId);this.toolbarId=this.parent.id+"Tool";this.newActionsScope=this.parent.id+"NewScope";this.selectionActionsScope=this.parent.id+"SelectionScope";this.actionsSections=[this.newActionsScope,this.selectionActionsScope]}
-function m(a){this._parent=a.parent;this._metadata=a.metadata;this.fileClient=a.fileService;this.progress=a.progressService;this.commandRegistry=a.commandRegistry;this.contentTypeRegistry=a.contentTypeRegistry;this.preferences=a.preferences;this.readonly="undefined"===typeof a.readonly?!1:a.readonly;this.showFolderNav=!0;this.readmeHeaderClass=a.readmeHeaderClass;this.editorView=a.editorView;this._maxEditorLines=a.maxEditorLines;this.imageView=a.imageView;this.breadCrumbMaker=a.breadCrumbMaker;this.branchSelector=
-a.branchSelector;this.clickHandler=a.clickHandler;this._init()}var r=n.FileExplorer,w=p.NavigatorRenderer,v=new f("#{,resource,params*}");a.prototype=Object.create(w.prototype);d.mixin(a.prototype,{showFolderImage:!0,createFolderNode:function(a){var b=p.NavigatorRenderer.prototype.createFolderNode.call(this,a);this.showFolderLinks&&"A"===b.tagName&&(b.href=v.expand({resource:a.Location}));b.classList.add("folderNavFolder");b.classList.add("navlink");b.classList.add("targetSelector");b.classList.remove("navlinkonpage");
-this.explorer.readonly&&this.explorer.clickHandler&&(b.href="javascript:void(0)",b.addEventListener("click",function(){this.explorer.clickHandler(a.Location)}.bind(this),!1));return b},updateFileNode:function(a,b,c){p.NavigatorRenderer.prototype.updateFileNode.call(this,a,b,c);this.explorer.readonly&&"A"===b.tagName&&(this.explorer.clickHandler?(b.href="javascript:void(0)",b.addEventListener("click",function(){this.explorer.clickHandler(a.Location)}.bind(this),!1)):b.href=v.expand({resource:a.Location}))},
-getCellHeaderElement:function(a){if(this.explorer.breadCrumbMaker)return null;if(0===a){a=document.createElement("th");a.colSpan=1;var b=this.explorer.treeRoot;a.appendChild(document.createTextNode(b.Parents?b.Name:this.explorer.fileClient.fileServiceName(b.Location)));return a}return null},emptyCallback:function(a){this.explorer.readonly||p.NavigatorRenderer.prototype.emptyCallback.call(this,a)},getExpandImage:function(){return null}});k.prototype=Object.create(r.prototype);d.mixin(k.prototype,{loadRoot:function(a){a?
-this.load(a,"Loading "+a.Name).then(this.loaded.bind(this)):this.loadResourceList(l.matchResourceParameters().resource+"?depth=1",!1).then(this.loaded.bind(this))},registerCommands:function(){return(new h).resolve()},updateCommands:function(){}});m.prototype={_init:function(){this.markdownView=new b.MarkdownView({fileClient:this.fileClient,canHide:!this.readonly,progress:this.progress})},_isCommandsVisible:function(){return!this.readonly},displayWorkspaceView:function(){this._node||(this._node=document.createElement("div"),
-this._node.classList.add("browse_inner_container"));this._parent.appendChild(this._node)},displayBrowseView:function(a){var a=a.Children,b;if(a)for(var d=0;d<a.length;d++){var f=a[d];!f.Directory&&(f.Name&&"readme.md"===f.Name.toLowerCase())&&(b=f)}var m;this._node||(this._node=document.createElement("div"),this._node.classList.add("browse_inner_container"));this._parent.appendChild(this._node);(function(a){a.forEach(function(a){if("folderNav"===a){if(this.showFolderNav){a=document.createElement("div");
-a.id="folderNavNode";this._foldersSection=new c.Section(this._node,{id:"folderNavSection",title:"Files",canHide:!this.readonly});if(this.editorView){this._foldersSection.setContent(this.editorView.getParent());this.editorView.getParent().style.height="30px";this.editorView.create();var d=this.editorView.editor.getTextView();d.getModel().addEventListener("Changed",this._editorViewModelChangedListener=function(){var a=d.getModel().getLineCount();this._maxEditorLines&&(0<this._maxEditorLines&&a>this._maxEditorLines)&&
-(a=this._maxEditorLines);a=d.getLineHeight()*a+20;this.editorView.getParent().style.height=a+"px"}.bind(this));this.editor=this.editorView.editor}else this.imageView||(this.folderNavExplorer=new k({parentId:a,readonly:this.readonly,breadCrumbMaker:this.breadCrumbMaker,clickHandler:this.clickHandler,fileClient:this.fileClient,commandRegistry:this.commandRegistry,contentTypeRegistry:this.contentTypeRegistry}),this._foldersSection.embedExplorer(this.folderNavExplorer,null,!0),this.folderNavExplorer.setCommandsVisible(this._isCommandsVisible()),
-this.folderNavExplorer.loadRoot(this._metadata));if(this.breadCrumbMaker&&(a=this._foldersSection.getTitleElement())){e.empty(a);var f=document.createElement("div");f.classList.add("breadCrumbContainer");var h=document.createElement("div");this.branchSelector&&a.appendChild(this.branchSelector.node);f.appendChild(h);a.appendChild(f);this.breadCrumbMaker(h,this._foldersSection.getHeaderElement().offsetWidth-150-50);this.branchSelector&&this.branchSelector.refresh()}}}else"readme"===a&&b&&(m=document.createElement("div"),
-this.markdownView.displayInFrame(m,b,this.readmeHeaderClass),this._node.appendChild(m))}.bind(this))}).apply(this,[["folderNav","readme"]])},updateImage:function(a){var b=document.createElement("table");b.classList.add("imageViewTable");var c=document.createElement("tr"),d=document.createElement("td"),e=document.createElement("div");e.appendChild(a);d.appendChild(e);c.appendChild(d);b.appendChild(c);this._foldersSection.setContent(b)},create:function(){this._metadata.Projects&&this.displayWorkspaceView();
-this.editorView||this.imageView?this.displayBrowseView(this._metadata):this._metadata.Children?this.displayBrowseView(this._metadata):this._metadata.ChildrenLocation&&this.progress.progress(this.fileClient.fetchChildren(this._metadata.ChildrenLocation),"Fetching children of "+this._metadata.Name).then(function(a){this._metadata.Children=a;this.displayBrowseView(this._metadata)}.bind(this))},destroy:function(){this.editorView&&(this.editorView.editor.getTextView().getModel().removeEventListener("Changed",
-this._editorViewModelChangedListener),this.editorView.destroy(),this.editor=null);this.folderNavExplorer&&this.folderNavExplorer.destroy();this.folderNavExplorer=null;this._node&&this._node.parentNode&&this._node.parentNode.removeChild(this._node);this._node=null}};return{BrowseView:m}});
-define("orion/editor/find","i18n!orion/editor/nls/messages orion/keyBinding orion/editor/keyModes orion/editor/annotations orion/regex orion/objects orion/util".split(" "),function(g,n,p,b,l,f,e){function d(a){var b=a.getTextView();p.KeyMode.call(this,b);this.editor=a;this._active=!1;this._success=!0;this._ignoreSelection=!1;this._prefix="";b.setAction("incrementalFindCancel",function(){this.setActive(!1);return!0}.bind(this));b.setAction("incrementalFindBackspace",function(){return this._backspace()}.bind(this));
-var c=this;this._listener={onVerify:function(a){var b=c.editor,d=b.getModel(),e=b.mapOffset(a.start),b=b.mapOffset(a.end),d=d.getText(e,b);if((d=c._prefix.match(RegExp("^"+l.escape(d),"i")))&&0<d.length)c._prefix+=a.text,c._success=!0,c._status(),c.find(c._forward,!0),a.text=null},onSelection:function(){c._ignoreSelection||c.setActive(!1)}}}function h(a,b,c){if(a){this._editor=a;this._undoStack=b;this._showAll=!0;this._visible=!1;this._wrap=this._caseInsensitive=!0;this._wholeWord=!1;this._incremental=
-!0;this._regex=!1;this._findAfterReplace=!0;this._reverse=this._hideAfterFind=!1;this._timer=this._end=this._start=void 0;this._lastString="";var d=this;this._listeners={onEditorFocus:function(a){d._removeCurrentAnnotation(a)}};this.setOptions(c)}}var c={};d.prototype=new p.KeyMode;f.mixin(d.prototype,{createKeyBindings:function(){var a=n.KeyBinding,b=[];b.push({actionID:"incrementalFindBackspace",keyBinding:new a(8)});b.push({actionID:"incrementalFindCancel",keyBinding:new a(13)});b.push({actionID:"incrementalFindCancel",
-keyBinding:new a(27)});b.push({actionID:"incrementalFindReverse",keyBinding:new a(38)});b.push({actionID:"incrementalFind",keyBinding:new a(40)});b.push({actionID:"incrementalFindReverse",keyBinding:new a("k",!0,!0)});b.push({actionID:"incrementalFind",keyBinding:new a("k",!0)});return b},find:function(a,b){this._forward=a;if(!this.isActive())return this.setActive(!0),!1;var c=this._prefix;if(0===c.length)return!1;var d=this.editor,e=d.getModel(),e=a?this._success?b?this._start:d.getCaretOffset()+
-1:0:this._success?b?this._start:d.getCaretOffset():e.getCharCount()-1;(c=d.getModel().find({string:c,start:e,reverse:!a,caseInsensitive:c.toLowerCase()===c}).next())?(b||(this._start=e),this._ignoreSelection=this._success=!0,d.moveSelection(a?c.start:c.end,a?c.end:c.start),this._ignoreSelection=!1):this._success=!1;this._status();return!0},isActive:function(){return this._active},isStatusActive:function(){return this.isActive()},setActive:function(a){this._active!==a&&(this._active=a,this._prefix=
-"",this._success=!0,a=this.editor.getTextView(),this._start=this.editor.getCaretOffset(),this.editor.setCaretOffset(this._start),this._active?(a.addEventListener("Verify",this._listener.onVerify),a.addEventListener("Selection",this._listener.onSelection),a.addKeyMode(this)):(a.removeEventListener("Verify",this._listener.onVerify),a.removeEventListener("Selection",this._listener.onSelection),a.removeKeyMode(this)),this._status())},_backspace:function(){var a=this._prefix,a=this._prefix=a.substring(0,
-a.length-1);return 0===a.length?(this._ignoreSelection=this._success=!0,this.editor.setCaretOffset(this.editor.getSelection().start),this._ignoreSelection=!1,this._status(),!0):this.find(this._forward,!0)},_status:function(){if(this.isActive()){var a;a=this._forward?this._success?g.incrementalFindStr:g.incrementalFindStrNotFound:this._success?g.incrementalFindReverseStr:g.incrementalFindReverseStrNotFound;a=e.formatMessage(a,this._prefix);this.editor.reportStatus(a,this._success?"":"error")}else this.editor.reportStatus("")}});
-c.IncrementalFind=d;h.prototype={find:function(a,b,c){this.setOptions({reverse:!a});var d=this.getFindString(),e;b&&(d=b.findString||d,e=b.count);a=this.getOptions();this.setOptions(b);b=c?this._startOffset:this.getStartOffset();if((e=this._doFind(d,b,e))&&!c)this._startOffset=e.start;this.setOptions(a);this._hideAfterFind&&this.hide();return e},getStartOffset:function(){return void 0!==this._start?this._start:this._reverse?this._editor.getSelection().start-1:this._editor.getCaretOffset()},getFindString:function(){var a=
-this._editor.getSelection(),a=this._editor.getText(a.start,a.end);this._regex&&(a=l.escape(a));return a||this._lastString},getOptions:function(){return{showAll:this._showAll,caseInsensitive:this._caseInsensitive,wrap:this._wrap,wholeWord:this._wholeWord,incremental:this._incremental,regex:this._regex,findAfterReplace:this._findAfterReplace,hideAfterFind:this._hideAfterFind,reverse:this._reverse,findCallback:this._findCallback,start:this._start,end:this._end}},getReplaceString:function(){return""},
-hide:function(){this._visible=!1;this._savedOptions&&(this.setOptions(this._savedOptions.pop()),0===this._savedOptions.length&&(this._savedOptions=null));this._removeAllAnnotations();var a=this._editor.getTextView();a&&(a.removeEventListener("Focus",this._listeners.onEditorFocus),a.focus())},_processReplaceString:function(a){var b=a;if(this._regex){for(var b="",c=!1,d=this._editor.getModel().getLineDelimiter(),e=0;e<a.length;e++){var f=a.substring(e,e+1);if(c){switch(f){case "R":b+=d;break;case "r":b+=
-"\r";break;case "n":b+="\n";break;case "t":b+="\t";break;case "\\":b+="\\";break;default:b+="\\"+f}c=!1}else"\\"===f?c=!0:b+=f}c&&(b+="\\")}return b},isVisible:function(){return this._visible},replace:function(){var a=this.getFindString();if(a){var b=this._editor,c=this._processReplaceString(this.getReplaceString()),d=b.getSelection().start;if(b=b.getModel().find({string:a,start:d,reverse:!1,wrap:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}).next())this.startUndo(),
-this._doReplace(b.start,b.end,a,c),this.endUndo()}this._findAfterReplace&&a&&this._doFind(a,this.getStartOffset())},replaceAll:function(){var a=this.getFindString();if(a){this._replacingAll=!0;var b=this._editor,c=b.getTextView();b.reportStatus(g.replaceAll);var d=this._processReplaceString(this.getReplaceString()),f=this;window.setTimeout(function(){for(var h=0,l=0;;){var p=f._doFind(a,h,null,!0);if(!p)break;l++;1===l&&(c.setRedraw(!1),f.startUndo());f._doReplace(p.start,p.end,a,d);h=f.getStartOffset()}0<
-l&&(f.endUndo(),c.setRedraw(!0));0<h?b.reportStatus(e.formatMessage(g.replacedMatches,l)):b.reportStatus(g.nothingReplaced,"error");f._replacingAll=!1},100)}},setOptions:function(a){if(a){if((!0===a.showAll||!1===a.showAll)&&this._showAll!==a.showAll)if(this._showAll=a.showAll,this.isVisible())if(this._showAll)this._markAllOccurrences();else{var c=this._editor.getAnnotationModel();c&&c.removeAnnotations(b.AnnotationType.ANNOTATION_MATCHING_SEARCH)}if(!0===a.caseInsensitive||!1===a.caseInsensitive)this._caseInsensitive=
-a.caseInsensitive;if(!0===a.wrap||!1===a.wrap)this._wrap=a.wrap;if(!0===a.wholeWord||!1===a.wholeWord)this._wholeWord=a.wholeWord;if(!0===a.incremental||!1===a.incremental)this._incremental=a.incremental;if(!0===a.regex||!1===a.regex)this._regex=a.regex;if(!0===a.findAfterReplace||!1===a.findAfterReplace)this._findAfterReplace=a.findAfterReplace;if(!0===a.hideAfterFind||!1===a.hideAfterFind)this._hideAfterFind=a.hideAfterFind;if(!0===a.reverse||!1===a.reverse)this._reverse=a.reverse;a.hasOwnProperty("findCallback")&&
-(this._findCallback=a.findCallback);a.hasOwnProperty("start")&&(this._start=a.start);a.hasOwnProperty("end")&&(this._end=a.end)}},show:function(a){this._visible=!0;a&&(this._savedOptions||(this._savedOptions=[]),this._savedOptions.push(this.getOptions()),this.setOptions(a));this._startOffset=this._editor.getSelection().start;this._editor.getTextView().addEventListener("Focus",this._listeners.onEditorFocus);var b=this;window.setTimeout(function(){b._incremental&&b.find(!0,null,!0)},0)},startUndo:function(){this._undoStack&&
-this._undoStack.startCompoundChange()},endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},_find:function(a,b,c){return this._editor.getModel().find({string:a,start:b,end:this._end,reverse:this._reverse,wrap:c?!1:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive})},_doFind:function(a,c,d,e){var d=d||1,f=this._editor;if(!a)return this._removeAllAnnotations(),null;this._lastString=a;var h,l;if(this._regex)try{l=this._find(a,c,e)}catch(p){f.reportStatus(p.message,
-"error");return}else l=this._find(a,c,e);for(a=0;a<d&&l.hasNext();a++)h=l.next();if(!this._replacingAll){h?this._editor.reportStatus(""):this._editor.reportStatus(g.notFound,"error");if(this.isVisible()){d=b.AnnotationType.ANNOTATION_CURRENT_SEARCH;if(l=f.getAnnotationModel())l.removeAnnotations(d),h&&l.addAnnotation(b.AnnotationType.createAnnotation(d,h.start,h.end));if(this._showAll){this._timer&&window.clearTimeout(this._timer);var s=this;this._timer=window.setTimeout(function(){s._markAllOccurrences();
-s._timer=null},500)}}this._findCallback?this._findCallback(h):h&&f.moveSelection(h.start,h.end,null,!1)}return h},_doReplace:function(a,b,c,d){var e=this._editor;if(this._regex&&(d=e.getText(a,b).replace(RegExp(c,this._caseInsensitive?"i":""),d),!d))return;e.setText(d,a,b);e.setSelection(a,a+d.length,!0)},_markAllOccurrences:function(){var a=this._editor.getAnnotationModel();if(a){for(var c=b.AnnotationType.ANNOTATION_MATCHING_SEARCH,d=a.getAnnotations(0,a.getTextModel().getCharCount()),e=[],f;d.hasNext();){var h=
-d.next();h.type===c&&e.push(h)}if(this.isVisible()){d=this.getFindString();d=this._editor.getModel().find({string:d,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive});for(f=[];d.hasNext();)h=d.next(),f.push(b.AnnotationType.createAnnotation(c,h.start,h.end))}a.replaceAnnotations(e,f)}},_removeAllAnnotations:function(){var a=this._editor.getAnnotationModel();a&&(a.removeAnnotations(b.AnnotationType.ANNOTATION_CURRENT_SEARCH),a.removeAnnotations(b.AnnotationType.ANNOTATION_MATCHING_SEARCH))},
-_removeCurrentAnnotation:function(){var a=this._editor.getAnnotationModel();a&&a.removeAnnotations(b.AnnotationType.ANNOTATION_CURRENT_SEARCH)}};c.Find=h;return c});
-define("orion/editor/actions","i18n!orion/editor/nls/messages orion/keyBinding orion/editor/annotations orion/editor/tooltip orion/editor/find orion/util".split(" "),function(g,n,p,b,l,f){function e(a,b,c){this.editor=a;this.undoStack=b;this._incrementalFind=new l.IncrementalFind(a);this._find=c?c:new l.Find(a,b);this._lastEditLocation=null;this.init()}function d(a,b,c,d){this.editor=a;this.undoStack=b;this.contentAssist=c;this.linkedMode=d;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",
-this.contentAssistProposalApplied.bind(this));this.init()}var h=p.AnnotationType,c={};e.prototype={init:function(){var a=this.editor.getTextView();this._lastEditListener={onModelChanged:function(a){this.editor.isDirty()&&(this._lastEditLocation=a.start+a.addedCharCount)}.bind(this)};a.addEventListener("ModelChanged",this._lastEditListener.onModelChanged);a.setAction("undo",function(a){if(this.undoStack){var b=1;a&&a.count&&(b=a.count);for(;0<b;)this.undoStack.undo(),--b;return!0}return!1}.bind(this),
-{name:g.undo});a.setAction("redo",function(a){if(this.undoStack){var b=1;a&&a.count&&(b=a.count);for(;0<b;)this.undoStack.redo(),--b;return!0}return!1}.bind(this),{name:g.redo});a.setKeyBinding(new n.KeyBinding("f",!0),"find");a.setAction("find",function(){if(this._find){var a=this.editor.getSelection();(a=prompt(g.find,this.editor.getText(a.start,a.end)))&&this._find.find(!0,{findString:a})}}.bind(this),{name:g.find});a.setKeyBinding(new n.KeyBinding("k",!0),"findNext");a.setAction("findNext",function(a){return this._find?
-(this._find.find(!0,a),!0):!1}.bind(this),{name:g.findNext});a.setKeyBinding(new n.KeyBinding("k",!0,!0),"findPrevious");a.setAction("findPrevious",function(a){return this._find?(this._find.find(!1,a),!0):!1}.bind(this),{name:g.findPrevious});a.setKeyBinding(new n.KeyBinding("j",!0),"incrementalFind");a.setAction("incrementalFind",function(){this._incrementalFind&&this._incrementalFind.find(!0);return!0}.bind(this),{name:g.incrementalFind});a.setKeyBinding(new n.KeyBinding("j",!0,!0),"incrementalFindReverse");
-a.setAction("incrementalFindReverse",function(){this._incrementalFind&&this._incrementalFind.find(!1);return!0}.bind(this),{name:g.incrementalFindReverse});a.setAction("tab",function(){return this.indentLines()}.bind(this));a.setAction("shiftTab",function(){return this.unindentLines()}.bind(this),{name:g.unindentLines});a.setKeyBinding(new n.KeyBinding(38,!1,!1,!0),"moveLinesUp");a.setAction("moveLinesUp",function(){return this.moveLinesUp()}.bind(this),{name:g.moveLinesUp});a.setKeyBinding(new n.KeyBinding(40,
-!1,!1,!0),"moveLinesDown");a.setAction("moveLinesDown",function(){return this.moveLinesDown()}.bind(this),{name:g.moveLinesDown});a.setKeyBinding(new n.KeyBinding(38,!0,!1,!0),"copyLinesUp");a.setAction("copyLinesUp",function(){return this.copyLinesUp()}.bind(this),{name:g.copyLinesUp});a.setKeyBinding(new n.KeyBinding(40,!0,!1,!0),"copyLinesDown");a.setAction("copyLinesDown",function(){return this.copyLinesDown()}.bind(this),{name:g.copyLinesDown});a.setKeyBinding(new n.KeyBinding("d",!0,!1,!1),
-"deleteLines");a.setAction("deleteLines",function(a){return this.deleteLines(a)}.bind(this),{name:g.deleteLines});a.setKeyBinding(new n.KeyBinding("l",!f.isMac,!1,!1,f.isMac),"gotoLine");a.setAction("gotoLine",function(){return this.gotoLine()}.bind(this),{name:g.gotoLine});a.setKeyBinding(new n.KeyBinding(190,!0),"nextAnnotation");a.setAction("nextAnnotation",function(){return this.nextAnnotation(!0)}.bind(this),{name:g.nextAnnotation});a.setKeyBinding(new n.KeyBinding(188,!0),"previousAnnotation");
-a.setAction("previousAnnotation",function(){return this.nextAnnotation(!1)}.bind(this),{name:g.prevAnnotation});a.setKeyBinding(new n.KeyBinding("e",!0,!1,!0,!1),"expand");a.setAction("expand",function(){return this.expandAnnotation(!0)}.bind(this),{name:g.expand});a.setKeyBinding(new n.KeyBinding("c",!0,!1,!0,!1),"collapse");a.setAction("collapse",function(){return this.expandAnnotation(!1)}.bind(this),{name:g.collapse});a.setKeyBinding(new n.KeyBinding("e",!0,!0,!0,!1),"expandAll");a.setAction("expandAll",
-function(){return this.expandAnnotations(!0)}.bind(this),{name:g.expandAll});a.setKeyBinding(new n.KeyBinding("c",!0,!0,!0,!1),"collapseAll");a.setAction("collapseAll",function(){return this.expandAnnotations(!1)}.bind(this),{name:g.collapseAll});a.setKeyBinding(new n.KeyBinding("q",!f.isMac,!1,!1,f.isMac),"lastEdit");a.setAction("lastEdit",function(){return this.gotoLastEdit()}.bind(this),{name:g.lastEdit})},copyLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;
-var b=a.getModel(),c=a.getSelection(),d=b.getLineAtOffset(c.start),c=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),e=b.getLineStart(d),d=b.getLineEnd(c,!0),f=b.getLineCount(),h="",e=b.getText(e,d);c===f-1&&(e=(h=b.getLineDelimiter())+e);a.setText(e,d,d);a.setSelection(d+h.length,d+e.length);return!0},copyLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),d=b.getLineAtOffset(c.start),c=b.getLineAtOffset(c.end>c.start?c.end-
-1:c.end),d=b.getLineStart(d),e=b.getLineEnd(c,!0),f=b.getLineCount(),h="",e=b.getText(d,e);c===f-1&&(e+=h=b.getLineDelimiter());a.setText(e,d,d);a.setSelection(d,d+e.length-h.length);return!0},deleteLines:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var c=1;a&&a.count&&(c=a.count);var d=b.getSelection(),e=b.getModel(),f=e.getLineAtOffset(d.start),a=e.getLineStart(f),c=d.start!==d.end||1===c?e.getLineAtOffset(d.end>d.start?d.end-1:d.end):Math.min(f+c-1,e.getLineCount()-
-1),c=e.getLineEnd(c,!0);b.setText("",a,c);return!0},expandAnnotation:function(a){var b=this.editor,c=b.getAnnotationModel();if(!c)return!0;var d=b.getModel(),e=b.getCaretOffset(),f=d.getLineAtOffset(e),e=d.getLineStart(f),f=d.getLineEnd(f,!0);d.getBaseModel&&(e=d.mapOffset(e),f=d.mapOffset(f),d.getBaseModel());for(var h,c=c.getAnnotations(e,f);!h&&c.hasNext();)d=c.next(),d.type===p.AnnotationType.ANNOTATION_FOLDING&&(h=d);h&&a!==h.expanded&&(a?h.expand():(b.setCaretOffset(h.start),h.collapse()));
-return!0},expandAnnotations:function(a){var b=this.editor,c=b.getTextView(),d=b.getAnnotationModel();if(!d)return!0;b=b.getModel();b=d.getAnnotations(0,b.getCharCount());for(c.setRedraw(!1);b.hasNext();)d=b.next(),d.type===p.AnnotationType.ANNOTATION_FOLDING&&a!==d.expanded&&(a?d.expand():d.collapse());c.setRedraw(!0);return!0},indentLines:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){var c=a.getModel(),d=a.getSelection(),e=c.getLineAtOffset(d.start),
-f=c.getLineAtOffset(d.end>d.start?d.end-1:d.end);if(e!==f){var h=[];h.push("");for(var g=e;g<=f;g++)h.push(c.getLine(g,!0));g=c.getLineStart(e);c=c.getLineEnd(f,!0);b=b.getOptions("tabSize","expandTab");b=b.expandTab?Array(b.tabSize+1).join(" "):"\t";a.setText(h.join(b),g,c);a.setSelection(g===d.start?d.start:d.start+b.length,d.end+(f-e+1)*b.length);return!0}return!1}},gotoLastEdit:function(){"number"===typeof this._lastEditLocation&&this.editor.showSelection(this._lastEditLocation);return!0},gotoLine:function(){var a=
-this.editor,b=a.getModel().getLineAtOffset(a.getCaretOffset());if(b=prompt(g.gotoLinePrompty,b+1))b=parseInt(b,10),a.onGotoLine(b-1,0);return!0},moveLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),d=b.getLineAtOffset(c.start),e=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),f=b.getLineCount();if(e===f-1)return!0;var d=b.getLineStart(d),c=b.getLineEnd(e,!0),h=b.getLineEnd(e+1,!0)-(c-d),g=0;e!==f-2?b=b.getText(d,c):(e=b.getLineEnd(e),
-b=b.getText(e,c)+b.getText(d,e),g+=c-e);this.startUndo();a.setText("",d,c);a.setText(b,h,h);a.setSelection(h+g,h+g+b.length);this.endUndo();return!0},moveLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),d=b.getLineAtOffset(c.start);if(0===d)return!0;var e=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),f=b.getLineCount(),c=b.getLineStart(d-1),h=b.getLineStart(d),g=b.getLineEnd(e,!0),l=b.getText(h,g),u=0;e===f-1&&(e=b.getLineEnd(d-
-1),d=b.getLineEnd(d-1,!0),l+=b.getText(e,d),h=e,u=d-e);this.startUndo();a.setText("",h,g);a.setText(l,c,c);a.setSelection(c,c+l.length-u);this.endUndo();return!0},nextAnnotation:function(a){function c(a){return!!a.lineStyle||a.type===h.ANNOTATION_MATCHING_BRACKET||a.type===h.ANNOTATION_CURRENT_BRACKET||!f.isAnnotationTypeVisible(a.type)}var d=this.editor,e=d.getAnnotationModel();if(!e)return!0;var f=d.getOverviewRuler()||d.getAnnotationStyler();if(!f)return!0;for(var g=d.getModel(),l=d.getCaretOffset(),
-p=e.getAnnotations(a?l:0,a?g.getCharCount():l),s=null;p.hasNext();){var u=p.next();if(a){if(u.start<=l)continue}else if(u.start>=l)continue;if(!c(u)&&(s=u,a))break}if(s){for(var n=[s],p=e.getAnnotations(s.start,s.start);p.hasNext();)u=p.next(),u!==s&&!c(u)&&n.push(u);var q=d.getTextView(),x=g.getLineAtOffset(s.start),A=b.Tooltip.getTooltip(q);if(!A)return d.moveSelection(s.start),!0;d.moveSelection(s.start,s.start,function(){A.setTarget({getTooltipInfo:function(){var a=q.convert({x:q.getLocationAtOffset(s.start).x,
-y:q.getLocationAtOffset(g.getLineStart(x)).y},"document","page");return{contents:n,x:a.x,y:a.y+Math.floor(1.33*q.getLineHeight(x))}}},0)})}return!0},unindentLines:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){for(var c=a.getModel(),d=a.getSelection(),e=c.getLineAtOffset(d.start),f=c.getLineAtOffset(d.end>d.start?d.end-1:d.end),h=b.getOptions("tabSize"),g=Array(h+1).join(" "),l=[],p=b=0,n=e;n<=f;n++){var q=c.getLine(n,!0);if(c.getLineStart(n)!==
-c.getLineEnd(n))if(0===q.indexOf("\t"))q=q.substring(1),b++;else if(0===q.indexOf(g))q=q.substring(h),b+=h;else return!0;n===e&&(p=b);l.push(q)}e=c.getLineStart(e);h=c.getLineEnd(f,!0);c=c.getLineStart(f);a.setText(l.join(""),e,h);f=e===d.start?d.start:d.start-p;d=Math.max(f,d.end-b+(d.end===c+1&&d.start!==d.end?1:0));a.setSelection(f,d);return!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};c.TextActions=
-e;d.prototype={init:function(){var a=this.editor.getTextView();a.setAction("lineStart",function(){return this.lineStart()}.bind(this));a.setAction("enter",function(){return this.autoIndent()}.bind(this));a.setKeyBinding(new n.KeyBinding("t",!0,!1,!0),"trimTrailingWhitespaces");a.setAction("trimTrailingWhitespaces",function(){return this.trimTrailingWhitespaces()}.bind(this),{name:g.trimTrailingWhitespaces});a.setKeyBinding(new n.KeyBinding(191,!0),"toggleLineComment");a.setAction("toggleLineComment",
-function(){return this.toggleLineComment()}.bind(this),{name:g.toggleLineComment});a.setKeyBinding(new n.KeyBinding(191,!0,!f.isMac,!1,f.isMac),"addBlockComment");a.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),{name:g.addBlockComment});a.setKeyBinding(new n.KeyBinding(220,!0,!f.isMac,!1,f.isMac),"removeBlockComment");a.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),{name:g.removeBlockComment});a.setKeyBinding(new n.KeyBinding("[",
-!1,!1,!1,!1,"keypress"),"autoPairSquareBracket");a.setAction("autoPairSquareBracket",function(){return this.autoPairBrackets("[","]")}.bind(this));a.setKeyBinding(new n.KeyBinding("]",!1,!1,!1,!1,"keypress"),"skipClosingSquareBracket");a.setAction("skipClosingSquareBracket",function(){return this.skipClosingBracket("]")}.bind(this));a.setKeyBinding(new n.KeyBinding("<",!1,!1,!1,!1,"keypress"),"autoPairAngleBracket");a.setAction("autoPairAngleBracket",function(){return this.autoPairBrackets("<",">")}.bind(this));
-a.setKeyBinding(new n.KeyBinding(">",!1,!1,!1,!1,"keypress"),"skipClosingAngleBracket");a.setAction("skipClosingAngleBracket",function(){return this.skipClosingBracket(">")}.bind(this));a.setKeyBinding(new n.KeyBinding("(",!1,!1,!1,!1,"keypress"),"autoPairParentheses");a.setAction("autoPairParentheses",function(){return this.autoPairBrackets("(",")")}.bind(this));a.setKeyBinding(new n.KeyBinding(")",!1,!1,!1,!1,"keypress"),"skipClosingParenthesis");a.setAction("skipClosingParenthesis",function(){return this.skipClosingBracket(")")}.bind(this));
-a.setKeyBinding(new n.KeyBinding("{",!1,!1,!1,!1,"keypress"),"autoPairBraces");a.setAction("autoPairBraces",function(){return this.autoPairBrackets("{","}")}.bind(this));a.setKeyBinding(new n.KeyBinding("}",!1,!1,!1,!1,"keypress"),"skipClosingBrace");a.setAction("skipClosingBrace",function(){return this.skipClosingBracket("}")}.bind(this));a.setKeyBinding(new n.KeyBinding("'",!1,!1,!1,!1,"keypress"),"autoPairSingleQuotation");a.setAction("autoPairSingleQuotation",function(){return this.autoPairQuotations("'")}.bind(this));
-a.setKeyBinding(new n.KeyBinding('"',!1,!1,!1,!1,"keypress"),"autoPairDblQuotation");a.setAction("autoPairDblQuotation",function(){return this.autoPairQuotations('"')}.bind(this));a.setAction("deletePrevious",function(){return this.deletePrevious()}.bind(this))},autoIndent:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;var c=a.getSelection();if(c.start===c.end){for(var d=a.getModel(),e=d.getLineAtOffset(c.start),f=d.getLine(e,!1),h=d.getLineStart(e),g=0,l=c.start-
-h,p;g<l&&(32===(p=f.charCodeAt(g))||9===p);)g++;var h=f.substring(0,g),b=b.getOptions("tabSize","expandTab"),n=b.expandTab?Array(b.tabSize+1).join(" "):"\t",b=d.getLineDelimiter(),q=/^[\s]*\/\*[\*]*[\s]*$/,x=/^[\s]*\*/,A=/\*\/[\s]*$/,B=f.substring(0,l),C=f.substring(l),M;if(this.smartIndentation&&123===f.charCodeAt(M=B.trimRight().length-1))return d=l-M-1,C=C.length-C.trimLeft().length,f=125===f.charCodeAt(l+C)?b+h+n+b+h:b+h+n,a.setText(f,c.start-d,c.end+C),a.setCaretOffset(c.start+b.length+h.length+
-n.length-d),!0;if(this.autoCompleteComments&&!A.test(B)&&(q.test(B)||x.test(B))){if(g=q.exec(B)){f=b+h+" * ";f=A.test(C)?f+C.substring(0,C.length-2).trim():f+C.trim();if(d.getLineCount()===e+1||!x.test(d.getLine(e+1)))f+=b+h+" */";a.setText(f,c.start,c.end+C.length);a.setCaretOffset(c.start+b.length+h.length+3);return!0}if(g=x.exec(B))for(e-=1;0<=e;e--){g=d.getLine(e,!1);if(q.test(g))return A.test(C)||47===f.charCodeAt(l)?(f=b+h+"*"+C,h=c.start+b.length+h.length+1):(f=b+h+"* "+C,h=c.start+b.length+
-h.length+2),a.setText(f,c.start,c.end+C.length),a.setCaretOffset(h),!0;if(!x.test(g))break}}else{if(A.test(B)&&32===h.charCodeAt(h.length-1))return f=b+h.substring(0,h.length-1),a.setText(f,c.start,c.end),a.setCaretOffset(c.start+f.length),!0;if(0<g){for(g=l;g<f.length&&(32===(p=f.charCodeAt(g++))||9===p);)c.end++;a.setText(d.getLineDelimiter()+h,c.start,c.end);return!0}}}return!1},addBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=
-a.getSelection(),d=this._findEnclosingComment(b,c.start,c.end);if(void 0!==d.commentStart&&void 0!==d.commentEnd)return!0;b=b.getText(c.start,c.end);if(0===b.length)return!0;var d=b.length,b=b.replace(/\/\*|\*\//g,""),e=b.length;a.setText("/*"+b+"*/",c.start,c.end);a.setSelection(c.start+2,c.end+2+(e-d));return!0},autoPairBrackets:function(a,b){if("["===a&&!this.autoPairSquareBrackets||"{"===a&&!this.autoPairBraces||"("===a&&!this.autoPairParentheses||"<"===a&&!this.autoPairAngleBrackets)return!1;
-var c=this.editor;if(c.getTextView().getOptions("readonly"))return!1;var d=c.getSelection(),e=c.getModel(),f=c.getCaretOffset()===e.getCharCount()?"":e.getText(d.start,d.start+1).trim(),h=/^$|[)}\]>]/;return d.start===d.end&&h.test(f)?(c.setText(a+b,d.start,d.start),c.setCaretOffset(d.start+1),!0):d.start!==d.end?(e=e.getText(d.start,d.end),c.setText(a+e+b,d.start,d.end),c.setSelection(d.start+1,d.end+1),!0):!1},autoPairQuotations:function(a){if(!this.autoPairQuotation)return!1;var b=this.editor;
-if(b.getTextView().getOptions("readonly"))return!1;var c=b.getSelection(),d=b.getModel(),e=b.getCaretOffset(),f=0===e?"":d.getText(c.start-1,c.start).trim(),h=e===d.getCharCount()?"":d.getText(c.start,c.start+1).trim(),e=/^"$|^'$/,g=/\w/,l=/^$|[)}\]>]/;if(c.start!==c.end){d=d.getText(c.start,c.end);if(e.test(d))return!1;b.setText(a+d+a,c.start,c.end);b.setSelection(c.start+1,c.end+1)}else{if(h!==a){if(f===a||e.test(h)||g.test(f)||!l.test(h))return!1;b.setText(a+a,c.start,c.start)}b.setCaretOffset(c.start+
-1)}return!0},contentAssistProposalApplied:function(a){a=a.data.proposal;if(a.positions&&0<a.positions.length&&this.linkedMode){for(var b=[],c=0;c<a.positions.length;++c)b[c]={positions:[{offset:a.positions[c].offset,length:a.positions[c].length}]};this.linkedMode.enterLinkedMode({groups:b,escapePosition:a.escapePosition})}else a.groups&&0<a.groups.length&&this.linkedMode?this.linkedMode.enterLinkedMode({groups:a.groups,escapePosition:a.escapePosition}):a.escapePosition&&this.editor.getTextView().setCaretOffset(a.escapePosition);
-return!0},deletePrevious:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getSelection();if(b.start!==b.end)return!1;var c=a.getModel(),d=a.getCaretOffset(),e=0===d?"":c.getText(b.start-1,b.start),c=d===c.getCharCount()?"":c.getText(b.start,b.start+1);("("===e&&")"===c||"["===e&&"]"===c||"{"===e&&"}"===c||"<"===e&&">"===c||'"'===e&&'"'===c||"'"===e&&"'"===c)&&a.setText("",b.start,b.start+1);return!1},_findEnclosingComment:function(a,b,c){var d=a.getLineAtOffset(b),
-e=a.getLineAtOffset(c),f,h,g,l,p,n;for(f=d;0<=f&&!(h=a.getLine(f),g=f===d?b-a.getLineStart(d):h.length,l=h.lastIndexOf("/*",g),h=h.lastIndexOf("*/",g),h>l);f--)if(-1!==l){p=a.getLineStart(f)+l;break}for(f=e;f<a.getLineCount()&&!(h=a.getLine(f),g=f===e?c-a.getLineStart(e):0,l=h.indexOf("/*",g),h=h.indexOf("*/",g),-1!==l&&l<h);f++)if(-1!==h){n=a.getLineStart(f)+h;break}return{commentStart:p,commentEnd:n}},lineStart:function(){for(var a=this.editor,b=a.getModel(),c=a.getCaretOffset(),d=b.getLineAtOffset(c),
-e=b.getLineStart(d),b=b.getLine(d),d=0;d<b.length;d++){var f=b.charCodeAt(d);if(!(32===f||9===f))break}d+=e;return c!==d?(a.setSelection(d,d),!0):!1},removeBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),d=b.getText(c.start,c.end),e,f,h;for(h=0;h<d.length;h++)if("/*"===d.substring(h,h+2)){e=c.start+h;break}for(;h<d.length;h++)if("*/"===d.substring(h,h+2)){f=c.start+h;break}if(void 0!==e&&void 0!==f)a.setText(b.getText(e+
-2,f),e,f+2),a.setSelection(e,f);else{d=this._findEnclosingComment(b,c.start,c.end);if(void 0===d.commentStart||void 0===d.commentEnd)return!0;b=b.getText(d.commentStart+2,d.commentEnd);a.setText(b,d.commentStart,d.commentEnd+2);a.setSelection(c.start-2,c.end-2)}return!0},toggleLineComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;for(var b=a.getModel(),c=a.getSelection(),d=b.getLineAtOffset(c.start),e=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),f=!0,h=[],g,
-l,p=d;p<=e;p++)if(g=b.getLine(p,!0),h.push(g),!f||-1===(l=g.indexOf("//")))f=!1;else if(0!==l){var n;for(n=0;n<l&&!(f=g.charCodeAt(n),!(32===f||9===f));n++);f=n===l}p=b.getLineStart(d);n=b.getLineEnd(e,!0);if(f){for(f=0;f<h.length;f++)g=h[f],l=g.indexOf("//"),h[f]=g.substring(0,l)+g.substring(l+2);h=h.join("");g=b.getLineStart(e);b=p===c.start?c.start:c.start-2;c=c.end-2*(e-d+1)+(c.end===g+1?2:0)}else h.splice(0,0,""),h=h.join("//"),b=p===c.start?c.start:c.start+2,c=c.end+2*(e-d+1);a.setText(h,p,
-n);a.setSelection(b,c);return!0},trimTrailingWhitespaces:function(){var a=this.editor,b=a.getModel(),c=a.getSelection();a.getTextView().setRedraw(!1);a.getUndoStack().startCompoundChange();for(var d=/(\s+$)/,e=b.getLineCount(),f=0;f<e;f++){var h=b.getLine(f),g=d.exec(h);if(g){var l=b.getLineStart(f),h=g[0].length,g=l+g.index;b.setText("",g,g+h);c.start>g&&(c.start=Math.max(g,c.start-h));c.start!==c.end&&c.end>g&&(c.end=Math.max(g,c.end-h))}}a.getUndoStack().endCompoundChange();a.getTextView().setRedraw(!0);
-a.setSelection(c.start,c.end,!1)},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},skipClosingBracket:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var c=b.getSelection(),d=b.getModel();return(b.getCaretOffset()===d.getCharCount()?"":d.getText(c.start,c.start+1))===a?(b.setCaretOffset(c.start+1),!0):!1},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},setAutoPairParentheses:function(a){this.autoPairParentheses=a},setAutoPairBraces:function(a){this.autoPairBraces=
-a},setAutoPairSquareBrackets:function(a){this.autoPairSquareBrackets=a},setAutoPairAngleBrackets:function(a){this.autoPairAngleBrackets=a},setAutoPairQuotations:function(a){this.autoPairQuotation=a},setAutoCompleteComments:function(a){this.autoCompleteComments=a},setSmartIndentation:function(a){this.smartIndentation=a}};c.SourceCodeActions=d;String.prototype.trimLeft||(String.prototype.trimLeft=function(){return this.replace(/^\s+/g,"")});String.prototype.trimRight||(String.prototype.trimRight=function(){return this.replace(/\s+$/g,
+this.selectionNode=document.createElement("div");this.selectionNode.id=c.id+"SelectionArea";this.selectionNode.classList.add("layoutRight");this.selectionNode.classList.add("sectionActions");this.domNode.appendChild(this.selectionNode);c.slideout&&(e=a.slideoutHTMLFragment(c.id),f=document.createRange(),f.selectNode(this.domNode),e=f.createContextualFragment(e),this.domNode.appendChild(e));this._contentParent=document.createElement("div");this._contentParent.id=this.id+"Content";this._contentParent.role=
+"region";this._contentParent.classList.add("sectionTable");this._contentParent.setAttribute("aria-labelledby",this.titleNode.id);d.appendChild(this._contentParent);c.content&&this.setContent(c.content);this.hidden=c.hidden;"function"===typeof c.onExpandCollapse&&(this._onExpandCollapse=c.onExpandCollapse);this._preferenceService=c.preferenceService;this._contentParent.style.display="none";this.domNode.classList.add("sectionWrapperClosed");if(this._preferenceService){var p=this;this._preferenceService.getPreferences("/window/views").then(function(b){b=
+b.get(p.id);void 0!==b&&(p.hidden=!b);p.hidden||(p._contentParent.style.display="block",p.domNode.classList.remove("sectionWrapperClosed"));p._updateExpandedState(!p.hidden,!1)})}else this.hidden||(this._contentParent.style.display="block",this.domNode.classList.remove("sectionWrapperClosed")),this._updateExpandedState(!this.hidden,!1);this._commandService=c.commandService;this._lastMonitor=0;this._loading={}}function d(a){this._section=a;this._id=++a._lastMonitor}e.prototype={setTitle:function(a){this.titleNode.textContent=
+a},getHeaderElement:function(){return this.domNode},getTitleElement:function(){return this.titleNode},setContent:function(a){"string"===typeof a?this._contentParent.innerHTML=a:(this._contentParent.innerHTML="",this._contentParent.appendChild(a))},getContentElement:function(){return this._contentParent},embedExplorer:function(a,c,b){this._contentParent.innerHTML="";a.parent||(a.parent=c);this._contentParent.appendChild(a.parent);a.section=this;l.mixin(a,{createActionSections:function(){this.actionsSections&&
+this.actionsSections.forEach(function(b){if(!g.node(b)){var a=document.createElement("ul");a.id=b;a.classList.add("commandList");a.classList.add("layoutRight");this.section.actionsNode.appendChild(a)}}.bind(this))},getCommandsVisible:function(){return"hidden"!==this.section.actionsNode.style.visibility},setCommandsVisible:function(b){this.section.actionsNode.style.visibility=b?"":"hidden";var a=b?null:"cursorOnly";this.renderer.selectionPolicy=a;var c=this.getNavHandler();c&&c.setSelectionPolicy(a);
+b?this.updateCommands():this.actionsSections&&this.actionsSections.forEach(function(b){g.node(b)&&this.commandRegistry.destroy(b)}.bind(this))},destroy:function(){Object.getPrototypeOf(this).destroy.call(this);var b=this;this.actionsSections&&(this.actionsSections.forEach(function(a){delete b[a]}),delete this.actionsSections)},updateCommands:function(b){this.section.actionsNode&&this.getCommandsVisible()&&(this.createActionSections(),Object.getPrototypeOf(this).updateCommands.call(this,b))},loaded:function(){var a=
+this;!this.selection&&!b&&(this.serviceRegistry||this.registry?(this.selection=new f.Selection(this.serviceRegistry||this.registry,this.parent.id+"Selection"),this.selection.addEventListener("selectionChanged",function(b){a.updateCommands(b.selections)})):window.console.error("Could not create a Selection for the explorer because of lack of serviceRegistry"));var c=this.registerCommands();!c||!c.then?a.updateCommands():c.then(function(){a.updateCommands()})}});a.renderer&&(a.renderer.section=this,
+l.mixin(a.renderer,{getCellHeaderElement:function(b){(b=Object.getPrototypeOf(this).getCellHeaderElement.call(this,b))&&this.section.setTitle(b.innerHTML);return null}}))},createProgressMonitor:function(){return new d(this)},_setMonitorMessage:function(a,c){this._progressNode.style.visibility="visible";this._loading[a]=c;var b="",d;for(d in this._loading)""!==b&&(b+="\n"),b+=this._loading[d];this._progressNode.title=b},_monitorDone:function(a){delete this._loading[a];var a="",c;for(c in this._loading)""!==
+a&&(a+="\n"),a+=this._loading[c];this._progressNode.title=a;""===a&&(this._progressNode.style.visibility="hidden")},_changeExpandedState:function(){this.hidden?(this._contentParent.style.display="block",this.domNode.classList.remove("sectionWrapperClosed"),this.hidden=!1):(this._contentParent.style.display="none",this.domNode.classList.add("sectionWrapperClosed"),this.hidden=!0);this._updateExpandedState(!this.hidden,!0)},_updateExpandedState:function(a,c){var b=this.twistie,d=this.id;b&&(b.classList.add(a?
+this._expandImageClass:this._collapseImageClass),b.classList.remove(a?this._collapseImageClass:this._expandImageClass));this._preferenceService&&c&&this._preferenceService.getPreferences("/window/views").then(function(b){b.put(d,a)});this._onExpandCollapse&&this._onExpandCollapse(a,this)}};e.prototype.constructor=e;d.prototype={begin:function(a){this.status=a;this._section._setMonitorMessage(this.id,a)},worked:function(a){this.status=a;this._section._setMonitorMessage(this.id,a)},done:function(a){this.status=
+a;this._section._monitorDone(this.id)}};d.prototype.constructor=d;return{Section:e}});
+define("orion/markdownView","marked/marked orion/editor/editor orion/objects orion/webui/littlelib orion/URITemplate orion/PageUtil orion/section orion/URL-shim".split(" "),function(g,n,p,a,l,f,e){function d(b){var a=g.InlineLexer.prototype.outputLink,c=f.matchResourceParameters().resource,d=new URL(c,window.location.href),e=g.InlineLexer.prototype,m=-1===c.indexOf(":");e.outputLink=function(b,c){if(-1===c.href.indexOf(":"))try{var e;"filesystem:"===d.protocol?e={href:"filesystem:"+(new URL(c.href,
+d.pathname)).href}:(e=new URL(c.href,d),m&&(e.protocol="",e.host=""));c.href="!"!==b[0][0]?k.expand({resource:e.href}):e.href}catch(f){console.log(f)}return a.call(this,b,c)};b=g(b,{sanitize:!0});g.InlineLexer.prototype.outputLink=a;return b}function h(b){this.fileClient=b.fileClient;this.progress=b.progress;this.canHide=b.canHide;this._node=null}function c(b){this.id="orion.markdownViewer";m.apply(this,arguments)}function b(b){this._parent=b.parent;this.serviceRegistry=b.serviceRegistry;this.contentTypeRegistry=
+b.contentTypeRegistry;this.commandRegistry=b.commandRegistry;this.progress=b.progressService;this.model=b.model;this.undoStack=b.undoStack}var k=new l("#{,resource,params*}");h.prototype={display:function(b,a){b.classList.add("orionMarkdown");b.innerHTML=d(a)},displayContents:function(b,c){var d=c.Location||c;a.empty(b);var e=document.createElement("div");(this.progress?this.progress.progress(this.fileClient.read(d),"Reading file "+(c.Name||d)):this.fileClient.read(d)).then(function(b){this.display.bind(this)(e,
+b)}.bind(this));b.appendChild(e)},displayInFrame:function(b,a,c){b=new e.Section(b,{id:"markdownSection",title:a.Name||"readme",headerClass:c,canHide:this.canHide});this.displayContents.call(this,b.getContentElement(),a)}};var m=n.BaseEditor;c.prototype=Object.create(m.prototype);p.mixin(c.prototype,{install:function(){var b=this._rootDiv=document.createElement("div");b.style.width="100%";b.style.height="100%";var c=this._contentDiv=document.createElement("div");c.classList.add("orionMarkdown");b.appendChild(c);
+a.node(this._domNode).appendChild(b);this._contentDiv.innerHTML=d(this.getModel().getText());m.prototype.install.call(this)},setInput:function(b,a,c,e){m.prototype.setInput.call(this,b,a,c,e);!a&&!e&&(this._contentDiv.innerHTML=d(c))},uninstall:function(){a.empty(this._domNode);m.prototype.uninstall.call(this)}});b.prototype={create:function(){this.editor=new c({domNode:this._parent,model:this.model,undoStack:this.undoStack});this.editor.install()},destroy:function(){this.editor&&this.editor.destroy();
+this.editor=null}};return{MarkdownEditorView:b,MarkdownView:h}});
+define("orion/widgets/browse/browseView","i18n!orion/edit/nls/messages orion/explorers/explorer-table orion/explorers/navigatorRenderer orion/markdownView orion/PageUtil orion/URITemplate orion/webui/littlelib orion/objects orion/Deferred orion/section".split(" "),function(g,n,p,a,l,f,e,d,h,c){function b(){x.apply(this,arguments)}function k(a){a.setFocus=!1;a.cachePrefix=null;a.rendererFactory=function(c){return new b({checkbox:!1,cachePrefix:"FolderNavigator"},c,a.commandRegistry,a.contentTypeRegistry)};
+r.apply(this,arguments);this.commandsId=".folderNav";this.fileClient=a.fileClient;this.commandRegistry=a.commandRegistry;this.contentTypeRegistry=a.contentTypeRegistry;this.readonly=a.readonly;this.breadCrumbMaker=a.breadCrumbMaker;this.clickHandler=a.clickHandler;this.treeRoot={};this.parent=e.node(a.parentId);this.toolbarId=this.parent.id+"Tool";this.newActionsScope=this.parent.id+"NewScope";this.selectionActionsScope=this.parent.id+"SelectionScope";this.actionsSections=[this.newActionsScope,this.selectionActionsScope]}
+function m(b){this._parent=b.parent;this._metadata=b.metadata;this.fileClient=b.fileService;this.progress=b.progressService;this.commandRegistry=b.commandRegistry;this.contentTypeRegistry=b.contentTypeRegistry;this.preferences=b.preferences;this.readonly="undefined"===typeof b.readonly?!1:b.readonly;this.showFolderNav=!0;this.readmeHeaderClass=b.readmeHeaderClass;this.editorView=b.editorView;this._maxEditorLines=b.maxEditorLines;this.imageView=b.imageView;this.isMarkdownView=b.isMarkdownView;this.breadCrumbMaker=
+b.breadCrumbMaker;this.branchSelector=b.branchSelector;this.clickHandler=b.clickHandler;this._init()}var r=n.FileExplorer,x=p.NavigatorRenderer,u=new f("#{,resource,params*}");b.prototype=Object.create(x.prototype);d.mixin(b.prototype,{showFolderImage:!0,createFolderNode:function(b){var a=p.NavigatorRenderer.prototype.createFolderNode.call(this,b);this.showFolderLinks&&"A"===a.tagName&&(a.href=u.expand({resource:b.Location}));a.classList.add("folderNavFolder");a.classList.add("navlink");a.classList.add("targetSelector");
+a.classList.remove("navlinkonpage");this.explorer.readonly&&this.explorer.clickHandler&&(a.href="javascript:void(0)",a.addEventListener("click",function(){this.explorer.clickHandler(b.Location)}.bind(this),!1));return a},updateFileNode:function(b,a,c){p.NavigatorRenderer.prototype.updateFileNode.call(this,b,a,c);this.explorer.readonly&&"A"===a.tagName&&(this.explorer.clickHandler?(a.href="javascript:void(0)",a.addEventListener("click",function(){this.explorer.clickHandler(b.Location)}.bind(this),
+!1)):a.href=u.expand({resource:b.Location}))},getCellHeaderElement:function(b){if(this.explorer.breadCrumbMaker)return null;if(0===b){b=document.createElement("th");b.colSpan=1;var a=this.explorer.treeRoot;b.appendChild(document.createTextNode(a.Parents?a.Name:this.explorer.fileClient.fileServiceName(a.Location)));return b}return null},emptyCallback:function(b){this.explorer.readonly||p.NavigatorRenderer.prototype.emptyCallback.call(this,b)},getExpandImage:function(){return null}});k.prototype=Object.create(r.prototype);
+d.mixin(k.prototype,{loadRoot:function(b){b?this.load(b,"Loading "+b.Name).then(this.loaded.bind(this)):this.loadResourceList(l.matchResourceParameters().resource+"?depth=1",!1).then(this.loaded.bind(this))},registerCommands:function(){return(new h).resolve()},updateCommands:function(){}});m.prototype={_init:function(){this.markdownView=new a.MarkdownView({fileClient:this.fileClient,canHide:!this.readonly,progress:this.progress})},_isCommandsVisible:function(){return!this.readonly},displayWorkspaceView:function(){this._node||
+(this._node=document.createElement("div"),this._node.classList.add("browse_inner_container"));this._parent.appendChild(this._node)},displayBrowseView:function(b){var b=b.Children,a;if(b)for(var d=0;d<b.length;d++){var f=b[d];!f.Directory&&(f.Name&&"readme.md"===f.Name.toLowerCase())&&(a=f)}var m;this._node||(this._node=document.createElement("div"),this._node.classList.add("browse_inner_container"));this._parent.appendChild(this._node);(function(b){b.forEach(function(b){if("folderNav"===b){if(this.showFolderNav){b=
+document.createElement("div");b.id="folderNavNode";this._foldersSection=new c.Section(this._node,{id:"folderNavSection",title:"Files",canHide:!this.readonly});if(this.editorView){this._foldersSection.setContent(this.editorView.getParent());this.editorView.getParent().style.height="30px";this.editorView.create();var d=this.editorView.editor.getTextView();d.getModel().addEventListener("Changed",this._editorViewModelChangedListener=function(){var b=d.getModel().getLineCount();this._maxEditorLines&&(0<
+this._maxEditorLines&&b>this._maxEditorLines)&&(b=this._maxEditorLines);b=d.getLineHeight()*b+20;this.editorView.getParent().style.height=b+"px"}.bind(this));this.editor=this.editorView.editor}else this.isMarkdownView?(m=document.createElement("div"),this.markdownView.displayContents(m,this._metadata),this._foldersSection.setContent(m)):this.imageView||(this.folderNavExplorer=new k({parentId:b,readonly:this.readonly,breadCrumbMaker:this.breadCrumbMaker,clickHandler:this.clickHandler,fileClient:this.fileClient,
+commandRegistry:this.commandRegistry,contentTypeRegistry:this.contentTypeRegistry}),this._foldersSection.embedExplorer(this.folderNavExplorer,null,!0),this.folderNavExplorer.setCommandsVisible(this._isCommandsVisible()),this.folderNavExplorer.loadRoot(this._metadata));if(this.breadCrumbMaker&&(b=this._foldersSection.getTitleElement())){e.empty(b);var f=document.createElement("div");f.classList.add("breadCrumbContainer");var h=document.createElement("div");this.branchSelector&&b.appendChild(this.branchSelector.node);
+f.appendChild(h);b.appendChild(f);this.breadCrumbMaker(h,this._foldersSection.getHeaderElement().offsetWidth-150-50);this.branchSelector&&this.branchSelector.refresh()}}}else"readme"===b&&a&&(m=document.createElement("div"),this.markdownView.displayInFrame(m,a,this.readmeHeaderClass),this._node.appendChild(m))}.bind(this))}).apply(this,[["folderNav","readme"]])},updateImage:function(b){var a=document.createElement("table");a.classList.add("imageViewTable");var c=document.createElement("tr"),d=document.createElement("td"),
+e=document.createElement("div");e.appendChild(b);d.appendChild(e);c.appendChild(d);a.appendChild(c);this._foldersSection.setContent(a)},create:function(){this._metadata.Projects&&this.displayWorkspaceView();this.editorView||this.imageView||this.isMarkdownView?this.displayBrowseView(this._metadata):this._metadata.Children?this.displayBrowseView(this._metadata):this._metadata.ChildrenLocation&&this.progress.progress(this.fileClient.fetchChildren(this._metadata.ChildrenLocation),"Fetching children of "+
+this._metadata.Name).then(function(b){this._metadata.Children=b;this.displayBrowseView(this._metadata)}.bind(this))},destroy:function(){this.editorView&&(this.editorView.editor.getTextView().getModel().removeEventListener("Changed",this._editorViewModelChangedListener),this.editorView.destroy(),this.editor=null);this.folderNavExplorer&&this.folderNavExplorer.destroy();this.folderNavExplorer=null;this._node&&this._node.parentNode&&this._node.parentNode.removeChild(this._node);this._node=null}};return{BrowseView:m}});
+define("orion/editor/find","i18n!orion/editor/nls/messages orion/keyBinding orion/editor/keyModes orion/editor/annotations orion/regex orion/objects orion/util".split(" "),function(g,n,p,a,l,f,e){function d(b){var a=b.getTextView();p.KeyMode.call(this,a);this.editor=b;this._active=!1;this._success=!0;this._ignoreSelection=!1;this._prefix="";a.setAction("incrementalFindCancel",function(){this.setActive(!1);return!0}.bind(this));a.setAction("incrementalFindBackspace",function(){return this._backspace()}.bind(this));
+var c=this;this._listener={onVerify:function(b){var a=c.editor,d=a.getModel(),e=a.mapOffset(b.start),a=a.mapOffset(b.end),d=d.getText(e,a);if((d=c._prefix.match(RegExp("^"+l.escape(d),"i")))&&0<d.length)c._prefix+=b.text,c._success=!0,c._status(),c.find(c._forward,!0),b.text=null},onSelection:function(){c._ignoreSelection||c.setActive(!1)}}}function h(b,a,c){if(b){this._editor=b;this._undoStack=a;this._showAll=!0;this._visible=!1;this._wrap=this._caseInsensitive=!0;this._wholeWord=!1;this._incremental=
+!0;this._regex=!1;this._findAfterReplace=!0;this._reverse=this._hideAfterFind=!1;this._timer=this._end=this._start=void 0;this._lastString="";var d=this;this._listeners={onEditorFocus:function(b){d._removeCurrentAnnotation(b)}};this.setOptions(c)}}var c={};d.prototype=new p.KeyMode;f.mixin(d.prototype,{createKeyBindings:function(){var b=n.KeyBinding,a=[];a.push({actionID:"incrementalFindBackspace",keyBinding:new b(8)});a.push({actionID:"incrementalFindCancel",keyBinding:new b(13)});a.push({actionID:"incrementalFindCancel",
+keyBinding:new b(27)});a.push({actionID:"incrementalFindReverse",keyBinding:new b(38)});a.push({actionID:"incrementalFind",keyBinding:new b(40)});a.push({actionID:"incrementalFindReverse",keyBinding:new b("k",!0,!0)});a.push({actionID:"incrementalFind",keyBinding:new b("k",!0)});return a},find:function(b,a){this._forward=b;if(!this.isActive())return this.setActive(!0),!1;var c=this._prefix;if(0===c.length)return!1;var d=this.editor,e=d.getModel(),e=b?this._success?a?this._start:d.getCaretOffset()+
+1:0:this._success?a?this._start:d.getCaretOffset():e.getCharCount()-1;(c=d.getModel().find({string:c,start:e,reverse:!b,caseInsensitive:c.toLowerCase()===c}).next())?(a||(this._start=e),this._ignoreSelection=this._success=!0,d.moveSelection(b?c.start:c.end,b?c.end:c.start),this._ignoreSelection=!1):this._success=!1;this._status();return!0},isActive:function(){return this._active},isStatusActive:function(){return this.isActive()},setActive:function(b){this._active!==b&&(this._active=b,this._prefix=
+"",this._success=!0,b=this.editor.getTextView(),this._start=this.editor.getCaretOffset(),this.editor.setCaretOffset(this._start),this._active?(b.addEventListener("Verify",this._listener.onVerify),b.addEventListener("Selection",this._listener.onSelection),b.addKeyMode(this)):(b.removeEventListener("Verify",this._listener.onVerify),b.removeEventListener("Selection",this._listener.onSelection),b.removeKeyMode(this)),this._status())},_backspace:function(){var b=this._prefix,b=this._prefix=b.substring(0,
+b.length-1);return 0===b.length?(this._ignoreSelection=this._success=!0,this.editor.setCaretOffset(this.editor.getSelection().start),this._ignoreSelection=!1,this._status(),!0):this.find(this._forward,!0)},_status:function(){if(this.isActive()){var b;b=this._forward?this._success?g.incrementalFindStr:g.incrementalFindStrNotFound:this._success?g.incrementalFindReverseStr:g.incrementalFindReverseStrNotFound;b=e.formatMessage(b,this._prefix);this.editor.reportStatus(b,this._success?"":"error")}else this.editor.reportStatus("")}});
+c.IncrementalFind=d;h.prototype={find:function(b,a,c){this.setOptions({reverse:!b});var d=this.getFindString(),e;a&&(d=a.findString||d,e=a.count);b=this.getOptions();this.setOptions(a);a=c?this._startOffset:this.getStartOffset();if((e=this._doFind(d,a,e))&&!c)this._startOffset=e.start;this.setOptions(b);this._hideAfterFind&&this.hide();return e},getStartOffset:function(){return void 0!==this._start?this._start:this._reverse?this._editor.getSelection().start-1:this._editor.getCaretOffset()},getFindString:function(){var b=
+this._editor.getSelection(),b=this._editor.getText(b.start,b.end);this._regex&&(b=l.escape(b));return b||this._lastString},getOptions:function(){return{showAll:this._showAll,caseInsensitive:this._caseInsensitive,wrap:this._wrap,wholeWord:this._wholeWord,incremental:this._incremental,regex:this._regex,findAfterReplace:this._findAfterReplace,hideAfterFind:this._hideAfterFind,reverse:this._reverse,findCallback:this._findCallback,start:this._start,end:this._end}},getReplaceString:function(){return""},
+hide:function(){this._visible=!1;this._savedOptions&&(this.setOptions(this._savedOptions.pop()),0===this._savedOptions.length&&(this._savedOptions=null));this._removeAllAnnotations();var b=this._editor.getTextView();b&&(b.removeEventListener("Focus",this._listeners.onEditorFocus),b.focus())},_processReplaceString:function(b){var a=b;if(this._regex){for(var a="",c=!1,d=this._editor.getModel().getLineDelimiter(),e=0;e<b.length;e++){var f=b.substring(e,e+1);if(c){switch(f){case "R":a+=d;break;case "r":a+=
+"\r";break;case "n":a+="\n";break;case "t":a+="\t";break;case "\\":a+="\\";break;default:a+="\\"+f}c=!1}else"\\"===f?c=!0:a+=f}c&&(a+="\\")}return a},isVisible:function(){return this._visible},replace:function(){var b=this.getFindString();if(b){var a=this._editor,c=this._processReplaceString(this.getReplaceString()),d=a.getSelection().start;if(a=a.getModel().find({string:b,start:d,reverse:!1,wrap:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}).next())this.startUndo(),
+this._doReplace(a.start,a.end,b,c),this.endUndo()}this._findAfterReplace&&b&&this._doFind(b,this.getStartOffset())},replaceAll:function(){var b=this.getFindString();if(b){this._replacingAll=!0;var a=this._editor,c=a.getTextView();a.reportStatus(g.replaceAll);var d=this._processReplaceString(this.getReplaceString()),f=this;window.setTimeout(function(){for(var h=0,l=0;;){var p=f._doFind(b,h,null,!0);if(!p)break;l++;1===l&&(c.setRedraw(!1),f.startUndo());f._doReplace(p.start,p.end,b,d);h=f.getStartOffset()}0<
+l&&(f.endUndo(),c.setRedraw(!0));0<h?a.reportStatus(e.formatMessage(g.replacedMatches,l)):a.reportStatus(g.nothingReplaced,"error");f._replacingAll=!1},100)}},setOptions:function(b){if(b){if((!0===b.showAll||!1===b.showAll)&&this._showAll!==b.showAll)if(this._showAll=b.showAll,this.isVisible())if(this._showAll)this._markAllOccurrences();else{var c=this._editor.getAnnotationModel();c&&c.removeAnnotations(a.AnnotationType.ANNOTATION_MATCHING_SEARCH)}if(!0===b.caseInsensitive||!1===b.caseInsensitive)this._caseInsensitive=
+b.caseInsensitive;if(!0===b.wrap||!1===b.wrap)this._wrap=b.wrap;if(!0===b.wholeWord||!1===b.wholeWord)this._wholeWord=b.wholeWord;if(!0===b.incremental||!1===b.incremental)this._incremental=b.incremental;if(!0===b.regex||!1===b.regex)this._regex=b.regex;if(!0===b.findAfterReplace||!1===b.findAfterReplace)this._findAfterReplace=b.findAfterReplace;if(!0===b.hideAfterFind||!1===b.hideAfterFind)this._hideAfterFind=b.hideAfterFind;if(!0===b.reverse||!1===b.reverse)this._reverse=b.reverse;b.hasOwnProperty("findCallback")&&
+(this._findCallback=b.findCallback);b.hasOwnProperty("start")&&(this._start=b.start);b.hasOwnProperty("end")&&(this._end=b.end)}},show:function(b){this._visible=!0;b&&(this._savedOptions||(this._savedOptions=[]),this._savedOptions.push(this.getOptions()),this.setOptions(b));this._startOffset=this._editor.getSelection().start;this._editor.getTextView().addEventListener("Focus",this._listeners.onEditorFocus);var a=this;window.setTimeout(function(){a._incremental&&a.find(!0,null,!0)},0)},startUndo:function(){this._undoStack&&
+this._undoStack.startCompoundChange()},endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},_find:function(b,a,c){return this._editor.getModel().find({string:b,start:a,end:this._end,reverse:this._reverse,wrap:c?!1:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive})},_doFind:function(b,c,d,e){var d=d||1,f=this._editor;if(!b)return this._removeAllAnnotations(),null;this._lastString=b;var h,l;if(this._regex)try{l=this._find(b,c,e)}catch(p){f.reportStatus(p.message,
+"error");return}else l=this._find(b,c,e);for(b=0;b<d&&l.hasNext();b++)h=l.next();if(!this._replacingAll){h?this._editor.reportStatus(""):this._editor.reportStatus(g.notFound,"error");if(this.isVisible()){d=a.AnnotationType.ANNOTATION_CURRENT_SEARCH;if(l=f.getAnnotationModel())l.removeAnnotations(d),h&&l.addAnnotation(a.AnnotationType.createAnnotation(d,h.start,h.end));if(this._showAll){this._timer&&window.clearTimeout(this._timer);var s=this;this._timer=window.setTimeout(function(){s._markAllOccurrences();
+s._timer=null},500)}}this._findCallback?this._findCallback(h):h&&f.moveSelection(h.start,h.end,null,!1)}return h},_doReplace:function(b,a,c,d){var e=this._editor;if(this._regex&&(d=e.getText(b,a).replace(RegExp(c,this._caseInsensitive?"i":""),d),!d))return;e.setText(d,b,a);e.setSelection(b,b+d.length,!0)},_markAllOccurrences:function(){var b=this._editor.getAnnotationModel();if(b){for(var c=a.AnnotationType.ANNOTATION_MATCHING_SEARCH,d=b.getAnnotations(),e=[],f;d.hasNext();){var h=d.next();h.type===
+c&&e.push(h)}if(this.isVisible()){d=this.getFindString();d=this._editor.getModel().find({string:d,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive});for(f=[];d.hasNext();)h=d.next(),f.push(a.AnnotationType.createAnnotation(c,h.start,h.end))}b.replaceAnnotations(e,f)}},_removeAllAnnotations:function(){var b=this._editor.getAnnotationModel();b&&(b.removeAnnotations(a.AnnotationType.ANNOTATION_CURRENT_SEARCH),b.removeAnnotations(a.AnnotationType.ANNOTATION_MATCHING_SEARCH))},
+_removeCurrentAnnotation:function(){var b=this._editor.getAnnotationModel();b&&b.removeAnnotations(a.AnnotationType.ANNOTATION_CURRENT_SEARCH)}};c.Find=h;return c});
+define("orion/editor/actions","i18n!orion/editor/nls/messages orion/keyBinding orion/editor/annotations orion/editor/tooltip orion/editor/find orion/util".split(" "),function(g,n,p,a,l,f){function e(b,a,c){this.editor=b;this.undoStack=a;this._incrementalFind=new l.IncrementalFind(b);this._find=c?c:new l.Find(b,a);this._lastEditLocation=null;this.init()}function d(b,a,c,d){this.editor=b;this.undoStack=a;this.contentAssist=c;this.linkedMode=d;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",
+this.contentAssistProposalApplied.bind(this));this.init()}var h=p.AnnotationType,c={};e.prototype={init:function(){var b=this.editor.getTextView();this._lastEditListener={onModelChanged:function(b){this.editor.isDirty()&&(this._lastEditLocation=b.start+b.addedCharCount)}.bind(this)};b.addEventListener("ModelChanged",this._lastEditListener.onModelChanged);b.setAction("undo",function(b){if(this.undoStack){var a=1;b&&b.count&&(a=b.count);for(;0<a;)this.undoStack.undo(),--a;return!0}return!1}.bind(this),
+{name:g.undo});b.setAction("redo",function(b){if(this.undoStack){var a=1;b&&b.count&&(a=b.count);for(;0<a;)this.undoStack.redo(),--a;return!0}return!1}.bind(this),{name:g.redo});b.setKeyBinding(new n.KeyBinding("f",!0),"find");b.setAction("find",function(){if(this._find){var b=this.editor.getSelection();(b=prompt(g.find,this.editor.getText(b.start,b.end)))&&this._find.find(!0,{findString:b})}}.bind(this),{name:g.find});b.setKeyBinding(new n.KeyBinding("k",!0),"findNext");b.setAction("findNext",function(b){return this._find?
+(this._find.find(!0,b),!0):!1}.bind(this),{name:g.findNext});b.setKeyBinding(new n.KeyBinding("k",!0,!0),"findPrevious");b.setAction("findPrevious",function(b){return this._find?(this._find.find(!1,b),!0):!1}.bind(this),{name:g.findPrevious});b.setKeyBinding(new n.KeyBinding("j",!0),"incrementalFind");b.setAction("incrementalFind",function(){this._incrementalFind&&this._incrementalFind.find(!0);return!0}.bind(this),{name:g.incrementalFind});b.setKeyBinding(new n.KeyBinding("j",!0,!0),"incrementalFindReverse");
+b.setAction("incrementalFindReverse",function(){this._incrementalFind&&this._incrementalFind.find(!1);return!0}.bind(this),{name:g.incrementalFindReverse});b.setAction("tab",function(){return this.indentLines()}.bind(this));b.setAction("shiftTab",function(){return this.unindentLines()}.bind(this),{name:g.unindentLines});b.setKeyBinding(new n.KeyBinding(38,!1,!1,!0),"moveLinesUp");b.setAction("moveLinesUp",function(){return this.moveLinesUp()}.bind(this),{name:g.moveLinesUp});b.setKeyBinding(new n.KeyBinding(40,
+!1,!1,!0),"moveLinesDown");b.setAction("moveLinesDown",function(){return this.moveLinesDown()}.bind(this),{name:g.moveLinesDown});b.setKeyBinding(new n.KeyBinding(38,!0,!1,!0),"copyLinesUp");b.setAction("copyLinesUp",function(){return this.copyLinesUp()}.bind(this),{name:g.copyLinesUp});b.setKeyBinding(new n.KeyBinding(40,!0,!1,!0),"copyLinesDown");b.setAction("copyLinesDown",function(){return this.copyLinesDown()}.bind(this),{name:g.copyLinesDown});b.setKeyBinding(new n.KeyBinding("d",!0,!1,!1),
+"deleteLines");b.setAction("deleteLines",function(b){return this.deleteLines(b)}.bind(this),{name:g.deleteLines});b.setKeyBinding(new n.KeyBinding("l",!f.isMac,!1,!1,f.isMac),"gotoLine");b.setAction("gotoLine",function(){return this.gotoLine()}.bind(this),{name:g.gotoLine});b.setKeyBinding(new n.KeyBinding(190,!0),"nextAnnotation");b.setAction("nextAnnotation",function(){return this.nextAnnotation(!0)}.bind(this),{name:g.nextAnnotation});b.setKeyBinding(new n.KeyBinding(188,!0),"previousAnnotation");
+b.setAction("previousAnnotation",function(){return this.nextAnnotation(!1)}.bind(this),{name:g.prevAnnotation});b.setKeyBinding(new n.KeyBinding("e",!0,!1,!0,!1),"expand");b.setAction("expand",function(){return this.expandAnnotation(!0)}.bind(this),{name:g.expand});b.setKeyBinding(new n.KeyBinding("c",!0,!1,!0,!1),"collapse");b.setAction("collapse",function(){return this.expandAnnotation(!1)}.bind(this),{name:g.collapse});b.setKeyBinding(new n.KeyBinding("e",!0,!0,!0,!1),"expandAll");b.setAction("expandAll",
+function(){return this.expandAnnotations(!0)}.bind(this),{name:g.expandAll});b.setKeyBinding(new n.KeyBinding("c",!0,!0,!0,!1),"collapseAll");b.setAction("collapseAll",function(){return this.expandAnnotations(!1)}.bind(this),{name:g.collapseAll});b.setKeyBinding(new n.KeyBinding("q",!f.isMac,!1,!1,f.isMac),"lastEdit");b.setAction("lastEdit",function(){return this.gotoLastEdit()}.bind(this),{name:g.lastEdit})},copyLinesDown:function(){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;
+var a=b.getModel(),c=b.getSelection(),d=a.getLineAtOffset(c.start),c=a.getLineAtOffset(c.end>c.start?c.end-1:c.end),e=a.getLineStart(d),d=a.getLineEnd(c,!0),f=a.getLineCount(),h="",e=a.getText(e,d);c===f-1&&(e=(h=a.getLineDelimiter())+e);b.setText(e,d,d);b.setSelection(d+h.length,d+e.length);return!0},copyLinesUp:function(){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var a=b.getModel(),c=b.getSelection(),d=a.getLineAtOffset(c.start),c=a.getLineAtOffset(c.end>c.start?c.end-
+1:c.end),d=a.getLineStart(d),e=a.getLineEnd(c,!0),f=a.getLineCount(),h="",e=a.getText(d,e);c===f-1&&(e+=h=a.getLineDelimiter());b.setText(e,d,d);b.setSelection(d,d+e.length-h.length);return!0},deleteLines:function(b){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=1;b&&b.count&&(c=b.count);var d=a.getSelection(),e=a.getModel(),f=e.getLineAtOffset(d.start),b=e.getLineStart(f),c=d.start!==d.end||1===c?e.getLineAtOffset(d.end>d.start?d.end-1:d.end):Math.min(f+c-1,e.getLineCount()-
+1),c=e.getLineEnd(c,!0);a.setText("",b,c);return!0},expandAnnotation:function(b){var a=this.editor,c=a.getAnnotationModel();if(!c)return!0;var d=a.getModel(),e=a.getCaretOffset(),f=d.getLineAtOffset(e),e=d.getLineStart(f),f=d.getLineEnd(f,!0);d.getBaseModel&&(e=d.mapOffset(e),f=d.mapOffset(f),d.getBaseModel());for(var h,c=c.getAnnotations(e,f);!h&&c.hasNext();)d=c.next(),d.type===p.AnnotationType.ANNOTATION_FOLDING&&(h=d);h&&b!==h.expanded&&(b?h.expand():(a.setCaretOffset(h.start),h.collapse()));
+return!0},expandAnnotations:function(b){var a=this.editor,c=a.getTextView(),d=a.getAnnotationModel();if(!d)return!0;a.getModel();d=d.getAnnotations();for(c.setRedraw(!1);d.hasNext();)a=d.next(),a.type===p.AnnotationType.ANNOTATION_FOLDING&&b!==a.expanded&&(b?a.expand():a.collapse());c.setRedraw(!0);return!0},indentLines:function(){var b=this.editor,a=b.getTextView();if(a.getOptions("readonly"))return!1;if(a.getOptions("tabMode")){var c=b.getModel(),d=b.getSelection(),e=c.getLineAtOffset(d.start),
+f=c.getLineAtOffset(d.end>d.start?d.end-1:d.end);if(e!==f){var h=[];h.push("");for(var g=e;g<=f;g++)h.push(c.getLine(g,!0));g=c.getLineStart(e);c=c.getLineEnd(f,!0);a=a.getOptions("tabSize","expandTab");a=a.expandTab?Array(a.tabSize+1).join(" "):"\t";b.setText(h.join(a),g,c);b.setSelection(g===d.start?d.start:d.start+a.length,d.end+(f-e+1)*a.length);return!0}return!1}},gotoLastEdit:function(){"number"===typeof this._lastEditLocation&&this.editor.showSelection(this._lastEditLocation);return!0},gotoLine:function(){var b=
+this.editor,a=b.getModel().getLineAtOffset(b.getCaretOffset());if(a=prompt(g.gotoLinePrompty,a+1))a=parseInt(a,10),b.onGotoLine(a-1,0);return!0},moveLinesDown:function(){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var a=b.getModel(),c=b.getSelection(),d=a.getLineAtOffset(c.start),e=a.getLineAtOffset(c.end>c.start?c.end-1:c.end),f=a.getLineCount();if(e===f-1)return!0;var d=a.getLineStart(d),c=a.getLineEnd(e,!0),h=a.getLineEnd(e+1,!0)-(c-d),g=0;e!==f-2?a=a.getText(d,c):(e=a.getLineEnd(e),
+a=a.getText(e,c)+a.getText(d,e),g+=c-e);this.startUndo();b.setText("",d,c);b.setText(a,h,h);b.setSelection(h+g,h+g+a.length);this.endUndo();return!0},moveLinesUp:function(){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var a=b.getModel(),c=b.getSelection(),d=a.getLineAtOffset(c.start);if(0===d)return!0;var e=a.getLineAtOffset(c.end>c.start?c.end-1:c.end),f=a.getLineCount(),c=a.getLineStart(d-1),h=a.getLineStart(d),g=a.getLineEnd(e,!0),l=a.getText(h,g),v=0;e===f-1&&(e=a.getLineEnd(d-
+1),d=a.getLineEnd(d-1,!0),l+=a.getText(e,d),h=e,v=d-e);this.startUndo();b.setText("",h,g);b.setText(l,c,c);b.setSelection(c,c+l.length-v);this.endUndo();return!0},nextAnnotation:function(b){function c(b){return!!b.lineStyle||b.type===h.ANNOTATION_MATCHING_BRACKET||b.type===h.ANNOTATION_CURRENT_BRACKET||!f.isAnnotationTypeVisible(b.type)}var d=this.editor,e=d.getAnnotationModel();if(!e)return!0;var f=d.getOverviewRuler()||d.getAnnotationStyler();if(!f)return!0;for(var g=d.getModel(),l=d.getCaretOffset(),
+p=e.getAnnotations(b?l:0,b?g.getCharCount():l),s=null;p.hasNext();){var v=p.next();if(b){if(v.start<=l)continue}else if(v.start>=l)continue;if(!c(v)&&(s=v,b))break}if(s){for(var n=[s],p=e.getAnnotations(s.start,s.start);p.hasNext();)v=p.next(),v!==s&&!c(v)&&n.push(v);var q=d.getTextView(),w=g.getLineAtOffset(s.start),B=a.Tooltip.getTooltip(q);if(!B)return d.moveSelection(s.start),!0;d.moveSelection(s.start,s.start,function(){B.setTarget({getTooltipInfo:function(){var b=q.convert({x:q.getLocationAtOffset(s.start).x,
+y:q.getLocationAtOffset(g.getLineStart(w)).y},"document","page");return{contents:n,x:b.x,y:b.y+Math.floor(1.33*q.getLineHeight(w))}}},0)})}return!0},unindentLines:function(){var b=this.editor,a=b.getTextView();if(a.getOptions("readonly"))return!1;if(a.getOptions("tabMode")){for(var c=b.getModel(),d=b.getSelection(),e=c.getLineAtOffset(d.start),f=c.getLineAtOffset(d.end>d.start?d.end-1:d.end),h=a.getOptions("tabSize"),g=Array(h+1).join(" "),l=[],p=a=0,n=e;n<=f;n++){var q=c.getLine(n,!0);if(c.getLineStart(n)!==
+c.getLineEnd(n))if(0===q.indexOf("\t"))q=q.substring(1),a++;else if(0===q.indexOf(g))q=q.substring(h),a+=h;else return!0;n===e&&(p=a);l.push(q)}e=c.getLineStart(e);h=c.getLineEnd(f,!0);c=c.getLineStart(f);b.setText(l.join(""),e,h);f=e===d.start?d.start:d.start-p;d=Math.max(f,d.end-a+(d.end===c+1&&d.start!==d.end?1:0));b.setSelection(f,d);return!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};c.TextActions=
+e;d.prototype={init:function(){var b=this.editor.getTextView();b.setAction("lineStart",function(){return this.lineStart()}.bind(this));b.setAction("enter",function(){return this.autoIndent()}.bind(this));b.setKeyBinding(new n.KeyBinding("t",!0,!1,!0),"trimTrailingWhitespaces");b.setAction("trimTrailingWhitespaces",function(){return this.trimTrailingWhitespaces()}.bind(this),{name:g.trimTrailingWhitespaces});b.setKeyBinding(new n.KeyBinding(191,!0),"toggleLineComment");b.setAction("toggleLineComment",
+function(){return this.toggleLineComment()}.bind(this),{name:g.toggleLineComment});b.setKeyBinding(new n.KeyBinding(191,!0,!f.isMac,!1,f.isMac),"addBlockComment");b.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),{name:g.addBlockComment});b.setKeyBinding(new n.KeyBinding(220,!0,!f.isMac,!1,f.isMac),"removeBlockComment");b.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),{name:g.removeBlockComment});b.setKeyBinding(new n.KeyBinding("[",
+!1,!1,!1,!1,"keypress"),"autoPairSquareBracket");b.setAction("autoPairSquareBracket",function(){return this.autoPairBrackets("[","]")}.bind(this));b.setKeyBinding(new n.KeyBinding("]",!1,!1,!1,!1,"keypress"),"skipClosingSquareBracket");b.setAction("skipClosingSquareBracket",function(){return this.skipClosingBracket("]")}.bind(this));b.setKeyBinding(new n.KeyBinding("<",!1,!1,!1,!1,"keypress"),"autoPairAngleBracket");b.setAction("autoPairAngleBracket",function(){return this.autoPairBrackets("<",">")}.bind(this));
+b.setKeyBinding(new n.KeyBinding(">",!1,!1,!1,!1,"keypress"),"skipClosingAngleBracket");b.setAction("skipClosingAngleBracket",function(){return this.skipClosingBracket(">")}.bind(this));b.setKeyBinding(new n.KeyBinding("(",!1,!1,!1,!1,"keypress"),"autoPairParentheses");b.setAction("autoPairParentheses",function(){return this.autoPairBrackets("(",")")}.bind(this));b.setKeyBinding(new n.KeyBinding(")",!1,!1,!1,!1,"keypress"),"skipClosingParenthesis");b.setAction("skipClosingParenthesis",function(){return this.skipClosingBracket(")")}.bind(this));
+b.setKeyBinding(new n.KeyBinding("{",!1,!1,!1,!1,"keypress"),"autoPairBraces");b.setAction("autoPairBraces",function(){return this.autoPairBrackets("{","}")}.bind(this));b.setKeyBinding(new n.KeyBinding("}",!1,!1,!1,!1,"keypress"),"skipClosingBrace");b.setAction("skipClosingBrace",function(){return this.skipClosingBracket("}")}.bind(this));b.setKeyBinding(new n.KeyBinding("'",!1,!1,!1,!1,"keypress"),"autoPairSingleQuotation");b.setAction("autoPairSingleQuotation",function(){return this.autoPairQuotations("'")}.bind(this));
+b.setKeyBinding(new n.KeyBinding('"',!1,!1,!1,!1,"keypress"),"autoPairDblQuotation");b.setAction("autoPairDblQuotation",function(){return this.autoPairQuotations('"')}.bind(this));b.setAction("deletePrevious",function(){return this.deletePrevious()}.bind(this))},autoIndent:function(){var b=this.editor,a=b.getTextView();if(a.getOptions("readonly"))return!1;var c=b.getSelection();if(c.start===c.end){for(var d=b.getModel(),e=d.getLineAtOffset(c.start),f=d.getLine(e,!1),h=d.getLineStart(e),g=0,l=c.start-
+h,p;g<l&&(32===(p=f.charCodeAt(g))||9===p);)g++;var h=f.substring(0,g),a=a.getOptions("tabSize","expandTab"),n=a.expandTab?Array(a.tabSize+1).join(" "):"\t",a=d.getLineDelimiter(),q=/^[\s]*\/\*[\*]*[\s]*$/,w=/^[\s]*\*/,B=/\*\/[\s]*$/,A=f.substring(0,l),C=f.substring(l),M;if(this.smartIndentation&&123===f.charCodeAt(M=A.trimRight().length-1))return d=l-M-1,C=C.length-C.trimLeft().length,f=125===f.charCodeAt(l+C)?a+h+n+a+h:a+h+n,b.setText(f,c.start-d,c.end+C),b.setCaretOffset(c.start+a.length+h.length+
+n.length-d),!0;if(this.autoCompleteComments&&!B.test(A)&&(q.test(A)||w.test(A))){if(g=q.exec(A)){f=a+h+" * ";f=B.test(C)?f+C.substring(0,C.length-2).trim():f+C.trim();if(d.getLineCount()===e+1||!w.test(d.getLine(e+1)))f+=a+h+" */";b.setText(f,c.start,c.end+C.length);b.setCaretOffset(c.start+a.length+h.length+3);return!0}if(g=w.exec(A))for(e-=1;0<=e;e--){g=d.getLine(e,!1);if(q.test(g))return B.test(C)||47===f.charCodeAt(l)?(f=a+h+"*"+C,h=c.start+a.length+h.length+1):(f=a+h+"* "+C,h=c.start+a.length+
+h.length+2),b.setText(f,c.start,c.end+C.length),b.setCaretOffset(h),!0;if(!w.test(g))break}}else{if(B.test(A)&&32===h.charCodeAt(h.length-1))return f=a+h.substring(0,h.length-1),b.setText(f,c.start,c.end),b.setCaretOffset(c.start+f.length),!0;if(0<g){for(g=l;g<f.length&&(32===(p=f.charCodeAt(g++))||9===p);)c.end++;b.setText(d.getLineDelimiter()+h,c.start,c.end);return!0}}}return!1},addBlockComment:function(){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var a=b.getModel(),c=
+b.getSelection(),d=this._findEnclosingComment(a,c.start,c.end);if(void 0!==d.commentStart&&void 0!==d.commentEnd)return!0;a=a.getText(c.start,c.end);if(0===a.length)return!0;var d=a.length,a=a.replace(/\/\*|\*\//g,""),e=a.length;b.setText("/*"+a+"*/",c.start,c.end);b.setSelection(c.start+2,c.end+2+(e-d));return!0},autoPairBrackets:function(b,a){if("["===b&&!this.autoPairSquareBrackets||"{"===b&&!this.autoPairBraces||"("===b&&!this.autoPairParentheses||"<"===b&&!this.autoPairAngleBrackets)return!1;
+var c=this.editor;if(c.getTextView().getOptions("readonly"))return!1;var d=c.getSelection(),e=c.getModel(),f=c.getCaretOffset()===e.getCharCount()?"":e.getText(d.start,d.start+1).trim(),h=/^$|[)}\]>]/;return d.start===d.end&&h.test(f)?(c.setText(b+a,d.start,d.start),c.setCaretOffset(d.start+1),!0):d.start!==d.end?(e=e.getText(d.start,d.end),c.setText(b+e+a,d.start,d.end),c.setSelection(d.start+1,d.end+1),!0):!1},autoPairQuotations:function(b){if(!this.autoPairQuotation)return!1;var a=this.editor;
+if(a.getTextView().getOptions("readonly"))return!1;var c=a.getSelection(),d=a.getModel(),e=a.getCaretOffset(),f=0===e?"":d.getText(c.start-1,c.start).trim(),h=e===d.getCharCount()?"":d.getText(c.start,c.start+1).trim(),e=/^"$|^'$/,g=/\w/,l=/^$|[)}\]>]/;if(c.start!==c.end){d=d.getText(c.start,c.end);if(e.test(d))return!1;a.setText(b+d+b,c.start,c.end);a.setSelection(c.start+1,c.end+1)}else{if(h!==b){if(f===b||e.test(h)||g.test(f)||!l.test(h))return!1;a.setText(b+b,c.start,c.start)}a.setCaretOffset(c.start+
+1)}return!0},contentAssistProposalApplied:function(b){b=b.data.proposal;if(b.positions&&0<b.positions.length&&this.linkedMode){for(var a=[],c=0;c<b.positions.length;++c)a[c]={positions:[{offset:b.positions[c].offset,length:b.positions[c].length}]};this.linkedMode.enterLinkedMode({groups:a,escapePosition:b.escapePosition})}else b.groups&&0<b.groups.length&&this.linkedMode?this.linkedMode.enterLinkedMode({groups:b.groups,escapePosition:b.escapePosition}):b.escapePosition&&this.editor.getTextView().setCaretOffset(b.escapePosition);
+return!0},deletePrevious:function(){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var a=b.getSelection();if(a.start!==a.end)return!1;var c=b.getModel(),d=b.getCaretOffset(),e=0===d?"":c.getText(a.start-1,a.start),c=d===c.getCharCount()?"":c.getText(a.start,a.start+1);("("===e&&")"===c||"["===e&&"]"===c||"{"===e&&"}"===c||"<"===e&&">"===c||'"'===e&&'"'===c||"'"===e&&"'"===c)&&b.setText("",a.start,a.start+1);return!1},_findEnclosingComment:function(b,a,c){var d=b.getLineAtOffset(a),
+e=b.getLineAtOffset(c),f,h,g,l,p,n;for(f=d;0<=f&&!(h=b.getLine(f),g=f===d?a-b.getLineStart(d):h.length,l=h.lastIndexOf("/*",g),h=h.lastIndexOf("*/",g),h>l);f--)if(-1!==l){p=b.getLineStart(f)+l;break}for(f=e;f<b.getLineCount()&&!(h=b.getLine(f),g=f===e?c-b.getLineStart(e):0,l=h.indexOf("/*",g),h=h.indexOf("*/",g),-1!==l&&l<h);f++)if(-1!==h){n=b.getLineStart(f)+h;break}return{commentStart:p,commentEnd:n}},lineStart:function(){for(var b=this.editor,a=b.getModel(),c=b.getCaretOffset(),d=a.getLineAtOffset(c),
+e=a.getLineStart(d),a=a.getLine(d),d=0;d<a.length;d++){var f=a.charCodeAt(d);if(!(32===f||9===f))break}d+=e;return c!==d?(b.setSelection(d,d),!0):!1},removeBlockComment:function(){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var a=b.getModel(),c=b.getSelection(),d=a.getText(c.start,c.end),e,f,h;for(h=0;h<d.length;h++)if("/*"===d.substring(h,h+2)){e=c.start+h;break}for(;h<d.length;h++)if("*/"===d.substring(h,h+2)){f=c.start+h;break}if(void 0!==e&&void 0!==f)b.setText(a.getText(e+
+2,f),e,f+2),b.setSelection(e,f);else{d=this._findEnclosingComment(a,c.start,c.end);if(void 0===d.commentStart||void 0===d.commentEnd)return!0;a=a.getText(d.commentStart+2,d.commentEnd);b.setText(a,d.commentStart,d.commentEnd+2);b.setSelection(c.start-2,c.end-2)}return!0},toggleLineComment:function(){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;for(var a=b.getModel(),c=b.getSelection(),d=a.getLineAtOffset(c.start),e=a.getLineAtOffset(c.end>c.start?c.end-1:c.end),f=!0,h=[],g,
+l,p=d;p<=e;p++)if(g=a.getLine(p,!0),h.push(g),!f||-1===(l=g.indexOf("//")))f=!1;else if(0!==l){var n;for(n=0;n<l&&!(f=g.charCodeAt(n),!(32===f||9===f));n++);f=n===l}p=a.getLineStart(d);n=a.getLineEnd(e,!0);if(f){for(f=0;f<h.length;f++)g=h[f],l=g.indexOf("//"),h[f]=g.substring(0,l)+g.substring(l+2);h=h.join("");g=a.getLineStart(e);a=p===c.start?c.start:c.start-2;c=c.end-2*(e-d+1)+(c.end===g+1?2:0)}else h.splice(0,0,""),h=h.join("//"),a=p===c.start?c.start:c.start+2,c=c.end+2*(e-d+1);b.setText(h,p,
+n);b.setSelection(a,c);return!0},trimTrailingWhitespaces:function(){var b=this.editor,a=b.getModel(),c=b.getSelection();b.getTextView().setRedraw(!1);b.getUndoStack().startCompoundChange();for(var d=/(\s+$)/,e=a.getLineCount(),f=0;f<e;f++){var h=a.getLine(f),g=d.exec(h);if(g){var l=a.getLineStart(f),h=g[0].length,g=l+g.index;a.setText("",g,g+h);c.start>g&&(c.start=Math.max(g,c.start-h));c.start!==c.end&&c.end>g&&(c.end=Math.max(g,c.end-h))}}b.getUndoStack().endCompoundChange();b.getTextView().setRedraw(!0);
+b.setSelection(c.start,c.end,!1)},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},skipClosingBracket:function(b){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=a.getSelection(),d=a.getModel();return(a.getCaretOffset()===d.getCharCount()?"":d.getText(c.start,c.start+1))===b?(a.setCaretOffset(c.start+1),!0):!1},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},setAutoPairParentheses:function(b){this.autoPairParentheses=b},setAutoPairBraces:function(b){this.autoPairBraces=
+b},setAutoPairSquareBrackets:function(b){this.autoPairSquareBrackets=b},setAutoPairAngleBrackets:function(b){this.autoPairAngleBrackets=b},setAutoPairQuotations:function(b){this.autoPairQuotation=b},setAutoCompleteComments:function(b){this.autoCompleteComments=b},setSmartIndentation:function(b){this.smartIndentation=b}};c.SourceCodeActions=d;String.prototype.trimLeft||(String.prototype.trimLeft=function(){return this.replace(/^\s+/g,"")});String.prototype.trimRight||(String.prototype.trimRight=function(){return this.replace(/\s+$/g,
 "")});return c});
-define("orion/editor/undoStack",[],function(){function g(b,g,f,e,d){this.model=b;this.offset=g;this.text=f;this.previousText=e;this.type=d}function n(b){this.owner=b;this.changes=[]}function p(b,g){this.size=void 0!==g?g:100;this.reset();var f=this;this._listener={onChanging:function(b){f._onChanging(b)},onDestroy:function(b){f._onDestroy(b)}};if(b.getModel){var e=b.getModel();e.getBaseModel&&(e=e.getBaseModel());this.model=e;this.setView(b)}else this.shared=!0,this.model=b;this.model.addEventListener("Changing",this._listener.onChanging)}
-g.prototype={getRedoChanges:function(){return[{start:this.offset,end:this.offset+this.previousText.length,text:this.text}]},getUndoChanges:function(){return[{start:this.offset,end:this.offset+this.text.length,text:this.previousText}]},undo:function(b,g){this._doUndoRedo(this.offset,this.previousText,this.text,b,g);return!0},redo:function(b,g){this._doUndoRedo(this.offset,this.text,this.previousText,b,g);return!0},merge:function(b,g,f,e,d){if(e===this.type){if(1===e&&b===this.offset+this.text.length)return this.text+=
-g,!0;if(-1===e&&d===this.offset)return this.offset=b,this.previousText=f+this.previousText,!0;if(-1===e&&b===this.offset)return this.previousText+=f,!0}return!1},_doUndoRedo:function(b,g,f,e,d){this.model.setText(g,b,b+f.length);d&&e&&(f=e.getModel(),f!==this.model&&(b=f.mapOffset(b,!0)),e.setSelection(b,b+g.length))}};n.prototype={getRedoChanges:function(){for(var b=[],g=0;g<this.changes.length;g++)b=b.concat(this.changes[g].getRedoChanges());return b},getUndoChanges:function(){for(var b=[],g=this.changes.length-
-1;0<=g;g--)b=b.concat(this.changes[g].getUndoChanges());return b},add:function(b){this.changes.push(b)},end:function(b){b&&(this.endSelection=b.getSelection(),this.endCaret=b.getCaretOffset());(b=this.owner)&&b.end&&b.end()},undo:function(b,g){1<this.changes.length&&b&&b.setRedraw(!1);for(var f=this.changes.length-1;0<=f;f--)this.changes[f].undo(b,!1);1<this.changes.length&&b&&b.setRedraw(!0);if(g&&b){var f=this.startSelection.start,e=this.startSelection.end;b.setSelection(this.startCaret?f:e,this.startCaret?
-e:f)}(f=this.owner)&&f.undo&&f.undo();return 0<this.changes.length},redo:function(b,g){1<this.changes.length&&b&&b.setRedraw(!1);for(var f=0;f<this.changes.length;f++)this.changes[f].redo(b,!1);(1<this.changes.length,b)&&b.setRedraw(!0);if(g&&b){var f=this.endSelection.start,e=this.endSelection.end;b.setSelection(this.endCaret?f:e,this.endCaret?e:f)}(f=this.owner)&&f.redo&&f.redo();return 0<this.changes.length},merge:function(b,g,f,e,d){var h=this.changes.length;return 0<h?this.changes[h-1].merge(b,
-g,f,e,d):!1},start:function(b){b&&(this.startSelection=b.getSelection(),this.startCaret=b.getCaretOffset());(b=this.owner)&&b.start&&b.start()}};p.prototype={destroy:function(){this._onDestroy()},add:function(b){this.compoundChange?this.compoundChange.add(b):(this.stack.splice(this.index,this.stack.length-this.index,b),this.index++,this.stack.length>this.size&&(this.stack.shift(),this.index--))},markClean:function(){this._commitUndo();if(this.cleanChange=this.stack[this.index-1])this.cleanChange.type=
-2},isClean:function(){return this.cleanChange===this.stack[this.index-1]},canUndo:function(){return 0<this.index},canRedo:function(){return 0<this.stack.length-this.index},endCompoundChange:function(){this.compoundChange&&this.compoundChange.end(this.view);this.compoundChange=void 0},getSize:function(){return{undo:this.index,redo:this.stack.length-this.index}},getRedoChanges:function(){this._commitUndo();for(var b=[],g=this.index;g<this.stack.length;g++)b=b.concat(this.stack[g].getRedoChanges());
-return b},getUndoChanges:function(){this._commitUndo();for(var b=[],g=this.index;0<=g;g--)b=b.concat(this.stack[g].getUndoChanges());return b},undo:function(){this._commitUndo();var b;b=!1;this._ignoreUndo=!0;do{if(0>=this.index)break;b=this.stack[--this.index]}while(!(b=b.undo(this.view,!0)));this._ignoreUndo=!1;return b},redo:function(){this._commitUndo();var b;this._ignoreUndo=!0;do{if(this.index>=this.stack.length)break;b=this.stack[this.index++]}while(!b.redo(this.view,!0));this._ignoreUndo=
-!1;return!0},reset:function(){this.index=0;this.cleanChange=void 0;this.stack=[];this._ignoreUndo=!1;this._compoundChange=void 0},setView:function(b){this.view!==b&&(this.view&&b.removeEventListener("Destroy",this._listener.onDestroy),(this.view=b)&&b.addEventListener("Destroy",this._listener.onDestroy))},startCompoundChange:function(b){this._commitUndo();b=new n(b);this.add(b);this.compoundChange=b;this.compoundChange.start(this.view);return this.compoundChange},_commitUndo:function(){this.endCompoundChange()},
-_onDestroy:function(b){(!b||!this.shared)&&this.model.removeEventListener("Changing",this._listener.onChanging);this.view&&(this.view.removeEventListener("Destroy",this._listener.onDestroy),this.view=null)},_onChanging:function(b){if(!this._ignoreUndo){var l=b.text,f=b.start,e=b.addedCharCount,d=b.removedCharCount,b=f+d,h=0;0===e&&1===d?h=-1:1===e&&0===d&&(h=1);e=this.stack.length;d=this.model.getText(f,b);(!(0<e&&this.index===e)||!this.stack[e-1].merge(f,l,d,h,b))&&this.add(new g(this.model,f,l,
+define("orion/editor/undoStack",[],function(){function g(a,g,f,e,d){this.model=a;this.offset=g;this.text=f;this.previousText=e;this.type=d}function n(a){this.owner=a;this.changes=[]}function p(a,g){this.size=void 0!==g?g:100;this.reset();var f=this;this._listener={onChanging:function(a){f._onChanging(a)},onDestroy:function(a){f._onDestroy(a)}};if(a.getModel){var e=a.getModel();e.getBaseModel&&(e=e.getBaseModel());this.model=e;this.setView(a)}else this.shared=!0,this.model=a;this.model.addEventListener("Changing",this._listener.onChanging)}
+g.prototype={getRedoChanges:function(){return[{start:this.offset,end:this.offset+this.previousText.length,text:this.text}]},getUndoChanges:function(){return[{start:this.offset,end:this.offset+this.text.length,text:this.previousText}]},undo:function(a,g){this._doUndoRedo(this.offset,this.previousText,this.text,a,g);return!0},redo:function(a,g){this._doUndoRedo(this.offset,this.text,this.previousText,a,g);return!0},merge:function(a,g,f,e,d){if(e===this.type){if(1===e&&a===this.offset+this.text.length)return this.text+=
+g,!0;if(-1===e&&d===this.offset)return this.offset=a,this.previousText=f+this.previousText,!0;if(-1===e&&a===this.offset)return this.previousText+=f,!0}return!1},_doUndoRedo:function(a,g,f,e,d){this.model.setText(g,a,a+f.length);d&&e&&(f=e.getModel(),f!==this.model&&(a=f.mapOffset(a,!0)),e.setSelection(a,a+g.length))}};n.prototype={getRedoChanges:function(){for(var a=[],g=0;g<this.changes.length;g++)a=a.concat(this.changes[g].getRedoChanges());return a},getUndoChanges:function(){for(var a=[],g=this.changes.length-
+1;0<=g;g--)a=a.concat(this.changes[g].getUndoChanges());return a},add:function(a){this.changes.push(a)},end:function(a){a&&(this.endSelection=a.getSelection(),this.endCaret=a.getCaretOffset());(a=this.owner)&&a.end&&a.end()},undo:function(a,g){1<this.changes.length&&a&&a.setRedraw(!1);for(var f=this.changes.length-1;0<=f;f--)this.changes[f].undo(a,!1);1<this.changes.length&&a&&a.setRedraw(!0);if(g&&a){var f=this.startSelection.start,e=this.startSelection.end;a.setSelection(this.startCaret?f:e,this.startCaret?
+e:f)}(f=this.owner)&&f.undo&&f.undo();return 0<this.changes.length},redo:function(a,g){1<this.changes.length&&a&&a.setRedraw(!1);for(var f=0;f<this.changes.length;f++)this.changes[f].redo(a,!1);(1<this.changes.length,a)&&a.setRedraw(!0);if(g&&a){var f=this.endSelection.start,e=this.endSelection.end;a.setSelection(this.endCaret?f:e,this.endCaret?e:f)}(f=this.owner)&&f.redo&&f.redo();return 0<this.changes.length},merge:function(a,g,f,e,d){var h=this.changes.length;return 0<h?this.changes[h-1].merge(a,
+g,f,e,d):!1},start:function(a){a&&(this.startSelection=a.getSelection(),this.startCaret=a.getCaretOffset());(a=this.owner)&&a.start&&a.start()}};p.prototype={destroy:function(){this._onDestroy()},add:function(a){this.compoundChange?this.compoundChange.add(a):(this.stack.splice(this.index,this.stack.length-this.index,a),this.index++,this.stack.length>this.size&&(this.stack.shift(),this.index--))},markClean:function(){this._commitUndo();if(this.cleanChange=this.stack[this.index-1])this.cleanChange.type=
+2},isClean:function(){return this.cleanChange===this.stack[this.index-1]},canUndo:function(){return 0<this.index},canRedo:function(){return 0<this.stack.length-this.index},endCompoundChange:function(){this.compoundChange&&this.compoundChange.end(this.view);this.compoundChange=void 0},getSize:function(){return{undo:this.index,redo:this.stack.length-this.index}},getRedoChanges:function(){this._commitUndo();for(var a=[],g=this.index;g<this.stack.length;g++)a=a.concat(this.stack[g].getRedoChanges());
+return a},getUndoChanges:function(){this._commitUndo();for(var a=[],g=this.index;0<=g;g--)a=a.concat(this.stack[g].getUndoChanges());return a},undo:function(){this._commitUndo();var a;a=!1;this._ignoreUndo=!0;do{if(0>=this.index)break;a=this.stack[--this.index]}while(!(a=a.undo(this.view,!0)));this._ignoreUndo=!1;return a},redo:function(){this._commitUndo();var a;this._ignoreUndo=!0;do{if(this.index>=this.stack.length)break;a=this.stack[this.index++]}while(!a.redo(this.view,!0));this._ignoreUndo=
+!1;return!0},reset:function(){this.index=0;this.cleanChange=void 0;this.stack=[];this._ignoreUndo=!1;this._compoundChange=void 0},setView:function(a){this.view!==a&&(this.view&&a.removeEventListener("Destroy",this._listener.onDestroy),(this.view=a)&&a.addEventListener("Destroy",this._listener.onDestroy))},startCompoundChange:function(a){this._commitUndo();a=new n(a);this.add(a);this.compoundChange=a;this.compoundChange.start(this.view);return this.compoundChange},_commitUndo:function(){this.endCompoundChange()},
+_onDestroy:function(a){(!a||!this.shared)&&this.model.removeEventListener("Changing",this._listener.onChanging);this.view&&(this.view.removeEventListener("Destroy",this._listener.onDestroy),this.view=null)},_onChanging:function(a){if(!this._ignoreUndo){var l=a.text,f=a.start,e=a.addedCharCount,d=a.removedCharCount,a=f+d,h=0;0===e&&1===d?h=-1:1===e&&0===d&&(h=1);e=this.stack.length;d=this.model.getText(f,a);(!(0<e&&this.index===e)||!this.stack[e-1].merge(f,l,d,h,a))&&this.add(new g(this.model,f,l,
 d,h))}}};return{UndoStack:p}});
-define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/util"],function(g,n,p,b){function l(b,a,d,e){this._location=a||"left";this._overview=d||"page";this._rulerStyle=e;this._view=null;var f=this;this._listener={onTextModelChanged:function(a){f._onTextModelChanged(a)},onAnnotationModelChanged:function(a){f._onAnnotationModelChanged(a)}};this.setAnnotationModel(b)}function f(b,a,d,e,f){l.call(this,b,a,"page",d);this._oddStyle=e||{style:{backgroundColor:"white"}};
-this._evenStyle=f||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._firstLine=1}function e(b,a,d){l.call(this,b,a,"page",d)}function d(b,a,d){l.call(this,b,a,"document",d)}function h(b,a,d){e.call(this,b,a,d)}l.prototype={getAnnotations:function(b,a){var d=this._annotationModel;if(!d)return[];var e=this._view.getModel(),f=e.getLineStart(b),h=e.getLineEnd(a-1),g=e;e.getBaseModel&&(g=e.getBaseModel(),f=e.mapOffset(f),h=e.mapOffset(h));for(var l=[],d=this.getAnnotationsByType(d,f,h),f=0;f<
-d.length;f++)for(var h=d[f],p=g.getLineAtOffset(h.start),s=g.getLineAtOffset(Math.max(h.start,h.end-1)),u=p;u<=s;u++){var n=u;if(e!==g){n=g.getLineStart(u);n=e.mapOffset(n,!0);if(-1===n)continue;n=e.getLineAtOffset(n)}if(b<=n&&n<a){var q=this._mergeAnnotation(l[n],h,u-p,s-p+1);q&&(l[n]=q)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var x in l)l[x]._multiple&&(l[x].html+=this._multiAnnotationOverlay.html);return l},getAnnotationModel:function(){return this._annotationModel},getLocation:function(){return this._location},
-getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getView:function(){return this._view},getWidestAnnotation:function(){return null},setAnnotationModel:function(b){this._annotationModel&&this._annotationModel.removEventListener("Changed",this._listener.onAnnotationModelChanged);(this._annotationModel=b)&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(b){this._multiAnnotation=b},setMultiAnnotationOverlay:function(b){this._multiAnnotationOverlay=
-b},setView:function(b){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged);this._view=b;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)},onClick:function(b){if(void 0!==b){var a=this._view,d=a.getModel(),e=d,f=d.getLineStart(b),h=f,g=f,l=this._annotationModel;if(l){a=a.getSelection();g=d.getLineEnd(b,!0);f<=a.start&&a.start<g&&(f=a.start);d.getBaseModel&&(f=d.mapOffset(f),
-g=d.mapOffset(g),e=d.getBaseModel());for(var n,g=l.getAnnotations(f,g),l=null;!n&&g.hasNext();)a=g.next(),this.isAnnotationTypeVisible(a.type)&&(l=a,a.start<=f||(n=a));l&&void 0!==l.groupId&&(this._currentClickGroup=this._currentClickGroup===l.groupId?null:l.groupId,this._setCurrentGroup(b));n&&e.getLineAtOffset(n.start)===e.getLineAtOffset(f)?(f=n.start,g=n.end):g=f=h;d.getBaseModel&&(f=d.mapOffset(f,!0),g=d.mapOffset(g,!0))}(b=p.Tooltip.getTooltip(this._view))&&b.setTarget(null);this._view.setSelection(g,
-f,1/3,function(){})}},onDblClick:function(){},onMouseMove:function(b,a){var d=p.Tooltip.getTooltip(this._view);if(d&&!(d.isVisible()&&this._tooltipLineIndex===b)){this._tooltipLineIndex=b;var e=this;d.setTarget({y:a.clientY,getTooltipInfo:function(){return e._getTooltipInfo(e._tooltipLineIndex,this.y)}})}},onMouseOver:function(b,a){this.onMouseMove(b,a);this._currentClickGroup||this._setCurrentGroup(b)},onMouseOut:function(){this._currentClickGroup||this._setCurrentGroup(-1);var b=p.Tooltip.getTooltip(this._view);
-b&&b.setTarget(null)},_getTooltipInfo:function(b,a){if(void 0!==b){var d=this._view,e=d.getModel(),f=this._annotationModel,h=[];if(f){var h=e.getLineStart(b),g=e.getLineEnd(b);e.getBaseModel&&(h=e.mapOffset(h),g=e.mapOffset(g));h=this.getAnnotationsByType(f,h,g)}f=this._getTooltipContents(b,h);if(!f)return null;f={contents:f,anchor:this.getLocation()};h=d.getClientArea();h.y="document"===this.getOverview()?d.convert({y:a},"view","document").y:d.getLocationAtOffset(e.getLineStart(b)).y;d.convert(h,
-"document","page");f.x=h.x;f.y=h.y;"right"===f.anchor&&(f.x+=h.width);return f}},_getTooltipContents:function(b,a){return a},_onAnnotationModelChanged:function(b){function a(a){for(var b=0;b<a.length;b++)if(f.isAnnotationTypeVisible(a[b].type)){var c=a[b].start,h=a[b].end;e.getBaseModel&&(c=e.mapOffset(c,!0),h=e.mapOffset(h,!0));-1!==c&&-1!==h&&d.redrawLines(e.getLineAtOffset(c),e.getLineAtOffset(Math.max(c,h-1))+1,f)}}var d=this._view;if(d){var e=d.getModel(),f=this,h=e.getLineCount();b.textModelChangedEvent?
-(b=b.textModelChangedEvent.start,e.getBaseModel&&(b=e.mapOffset(b,!0)),b=e.getLineAtOffset(b),d.redrawLines(b,h,f)):(a(b.added),a(b.removed),a(b.changed))}},_mergeAnnotation:function(b,a,d){b||(b={});0===d&&(b.html&&a.html?(a.html!==b.html&&(!b._multiple&&this._multiAnnotation)&&(b.html=this._multiAnnotation.html),b._multiple=!0):b.html=a.html);b.style=this._mergeStyle(b.style,a.style);return b},_mergeStyle:function(b,a){if(a){b||(b={});b.styleClass=b.styleClass&&a.styleClass&&b.styleClass!==a.styleClass?
-b.styleClass+(" "+a.styleClass):a.styleClass;var d;if(a.style)for(d in b.style||(b.style={}),a.style)void 0===b.style[d]&&(b.style[d]=a.style[d]);if(a.attributes)for(d in b.attributes||(b.attributes={}),a.attributes)void 0===b.attributes[d]&&(b.attributes[d]=a.attributes[d])}return b},_setCurrentGroup:function(b){var a=this._annotationModel,d=null,e=a.getTextModel(),f,h,g=this._currentGroupAnnotation;if(-1!==b){var l=e.getLineStart(b),p=e.getLineEnd(b);e.getBaseModel&&(l=e.mapOffset(l),p=e.mapOffset(p));
-for(h=a.getAnnotations(l,p);h.hasNext();)if(f=h.next(),this.isAnnotationTypeVisible(f.type)&&f.start<=l&&f.end>=p&&void 0!==f.groupId){d=f;break}if(g&&d&&g.groupId===d.groupId)return}this._currentGroupAnnotation=null;g&&a.removeAnnotations(g.groupType);if(d&&-1!==b){this._currentGroupAnnotation=d;h=a.getAnnotations(0,e.getCharCount());for(b=[];h.hasNext();)f=h.next(),delete f.groupAnnotation,f.groupId===d.groupId&&(f=f.createGroupAnnotation(),b.push(f));a.replaceAnnotations(null,b)}}};n.AnnotationTypeList.addMixin(l.prototype);
-f.prototype=new l;f.prototype.getAnnotations=function(b,a){for(var d=l.prototype.getAnnotations.call(this,b,a),e=this._view.getModel(),f=b;f<a;f++){var h=f&1?this._oddStyle:this._evenStyle,g=f;e.getBaseModel&&(g=e.getLineStart(g),g=e.getBaseModel().getLineAtOffset(e.mapOffset(g)));d[f]||(d[f]={});d[f].html=this._firstLine+g+"";d[f].style||(d[f].style=h)}return d};f.prototype.getWidestAnnotation=function(){var b=this._view.getModel().getLineCount();return this.getAnnotations(b-1,b)[b-1]};f.prototype.setFirstLine=
-function(b){this._firstLine=void 0!==b?b:1};f.prototype._onTextModelChanged=function(b){var a=b.start,b=this._view.getModel(),d=b.getBaseModel?b.getBaseModel().getLineCount():b.getLineCount(),d=(this._firstLine+d-1+"").length;this._numOfDigits!==d&&(this._numOfDigits=d,a=b.getLineAtOffset(a),this._view.redrawLines(a,b.getLineCount(),this))};e.prototype=new l;d.prototype=new l;d.prototype.getRulerStyle=function(){var b={style:{lineHeight:"1px",fontSize:"1px"}};return b=this._mergeStyle(b,this._rulerStyle)};
-d.prototype._getTooltipContents=function(c,a){if(0===a.length){var d=this._view.getModel(),e=c;d.getBaseModel&&(e=d.getLineStart(e),e=d.getBaseModel().getLineAtOffset(d.mapOffset(e)));return b.formatMessage(g.line,e+1)}return l.prototype._getTooltipContents.call(this,c,a)};d.prototype._mergeAnnotation=function(b,a,d,e){if(0===d)return b||(b={html:"&nbsp;",style:{style:{height:3*e+"px"}}},b.style=this._mergeStyle(b.style,a.overviewStyle)),b};h.prototype=new e;h.prototype.onClick=function(b){if(void 0!==
-b){var a=this._annotationModel;if(a){var d=this._view.getModel(),e=d.getLineStart(b),b=d.getLineEnd(b,!0);d.getBaseModel&&(e=d.mapOffset(e),b=d.mapOffset(b),d=d.getBaseModel());for(var f,a=a.getAnnotations(e,b);!f&&a.hasNext();)b=a.next(),this.isAnnotationTypeVisible(b.type)&&(f=b);f&&d.getLineAtOffset(f.start)===d.getLineAtOffset(e)&&((d=p.Tooltip.getTooltip(this._view))&&d.setTarget(null),f.expanded?f.collapse():f.expand())}}};h.prototype._getTooltipContents=function(b,a){return 1===a.length&&a[0].expanded?
-null:e.prototype._getTooltipContents.call(this,b,a)};h.prototype._onAnnotationModelChanged=function(b){function a(a){for(g=0;g<a.length;g++)if(h.isAnnotationTypeVisible(a[g].type)){var b=a[g].start;f.getBaseModel&&(b=f.mapOffset(b,!0));-1!==b&&(p=Math.min(p,f.getLineAtOffset(b)))}}if(b.textModelChangedEvent)e.prototype._onAnnotationModelChanged.call(this,b);else{var d=this._view;if(d){var f=d.getModel(),h=this,g,l=f.getLineCount(),p=l;a(b.added);a(b.removed);a(b.changed);b=d.getRulers();for(g=0;g<
-b.length;g++)d.redrawLines(p,l,b[g])}}};return{Ruler:l,AnnotationRuler:e,LineNumberRuler:f,OverviewRuler:d,FoldingRuler:h}});
-define("orion/editor/textDND",["orion/util"],function(g){function n(g,b){this._view=g;this._undoStack=b;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var l=this;this._listener={onDragStart:function(b){l._onDragStart(b)},onDragEnd:function(b){l._onDragEnd(b)},onDragEnter:function(b){l._onDragEnter(b)},onDragOver:function(b){l._onDragOver(b)},onDrop:function(b){l._onDrop(b)},onDestroy:function(b){l._onDestroy(b)}};g.addEventListener("DragStart",this._listener.onDragStart);g.addEventListener("DragEnd",
+define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/util"],function(g,n,p,a){function l(a,b,d,e){this._location=b||"left";this._overview=d||"page";this._rulerStyle=e;this._view=null;var f=this;this._listener={onTextModelChanged:function(b){f._onTextModelChanged(b)},onAnnotationModelChanged:function(b){f._onAnnotationModelChanged(b)}};this.setAnnotationModel(a)}function f(a,b,d,e,f){l.call(this,a,b,"page",d);this._oddStyle=e||{style:{backgroundColor:"white"}};
+this._evenStyle=f||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._firstLine=1}function e(a,b,d){l.call(this,a,b,"page",d)}function d(a,b,d){l.call(this,a,b,"document",d)}function h(a,b,d){e.call(this,a,b,d)}l.prototype={getAnnotations:function(a,b){var d=this._annotationModel;if(!d)return[];var e=this._view.getModel(),f=e.getLineStart(a),h=e.getLineEnd(b-1),g=e;e.getBaseModel&&(g=e.getBaseModel(),f=e.mapOffset(f),h=e.mapOffset(h));for(var l=[],d=this.getAnnotationsByType(d,f,h),f=0;f<
+d.length;f++)for(var h=d[f],p=g.getLineAtOffset(h.start),s=g.getLineAtOffset(Math.max(h.start,h.end-1)),v=p;v<=s;v++){var n=v;if(e!==g){n=g.getLineStart(v);n=e.mapOffset(n,!0);if(-1===n)continue;n=e.getLineAtOffset(n)}if(a<=n&&n<b){var q=this._mergeAnnotation(l[n],h,v-p,s-p+1);q&&(l[n]=q)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var w in l)l[w]._multiple&&(l[w].html+=this._multiAnnotationOverlay.html);return l},getAnnotationModel:function(){return this._annotationModel},getLocation:function(){return this._location},
+getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getView:function(){return this._view},getWidestAnnotation:function(){return null},setAnnotationModel:function(a){this._annotationModel&&this._annotationModel.removEventListener("Changed",this._listener.onAnnotationModelChanged);(this._annotationModel=a)&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(a){this._multiAnnotation=a},setMultiAnnotationOverlay:function(a){this._multiAnnotationOverlay=
+a},setView:function(a){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged);this._view=a;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)},onClick:function(a){if(void 0!==a){var b=this._view,d=b.getModel(),e=d,f=d.getLineStart(a),h=f,g=f,l=this._annotationModel;if(l){b=b.getSelection();g=d.getLineEnd(a,!0);f<=b.start&&b.start<g&&(f=b.start);d.getBaseModel&&(f=d.mapOffset(f),
+g=d.mapOffset(g),e=d.getBaseModel());for(var n,g=l.getAnnotations(f,g),l=null;!n&&g.hasNext();)b=g.next(),this.isAnnotationTypeVisible(b.type)&&(l=b,b.start<=f||(n=b));l&&void 0!==l.groupId&&(this._currentClickGroup=this._currentClickGroup===l.groupId?null:l.groupId,this._setCurrentGroup(a));n&&e.getLineAtOffset(n.start)===e.getLineAtOffset(f)?(f=n.start,g=n.end):g=f=h;d.getBaseModel&&(f=d.mapOffset(f,!0),g=d.mapOffset(g,!0))}(a=p.Tooltip.getTooltip(this._view))&&a.setTarget(null);this._view.setSelection(g,
+f,1/3,function(){})}},onDblClick:function(){},onMouseMove:function(a,b){var d=p.Tooltip.getTooltip(this._view);if(d&&!(d.isVisible()&&this._tooltipLineIndex===a)){this._tooltipLineIndex=a;var e=this;d.setTarget({y:b.clientY,getTooltipInfo:function(){return e._getTooltipInfo(e._tooltipLineIndex,this.y)}})}},onMouseOver:function(a,b){this.onMouseMove(a,b);this._currentClickGroup||this._setCurrentGroup(a)},onMouseOut:function(){this._currentClickGroup||this._setCurrentGroup(-1);var a=p.Tooltip.getTooltip(this._view);
+a&&a.setTarget(null)},_getTooltipInfo:function(a,b){if(void 0!==a){var d=this._view,e=d.getModel(),f=this._annotationModel,h=[];if(f){var h=e.getLineStart(a),g=e.getLineEnd(a);e.getBaseModel&&(h=e.mapOffset(h),g=e.mapOffset(g));h=this.getAnnotationsByType(f,h,g)}f=this._getTooltipContents(a,h);if(!f)return null;f={contents:f,anchor:this.getLocation()};h=d.getClientArea();h.y="document"===this.getOverview()?d.convert({y:b},"view","document").y:d.getLocationAtOffset(e.getLineStart(a)).y;d.convert(h,
+"document","page");f.x=h.x;f.y=h.y;"right"===f.anchor&&(f.x+=h.width);return f}},_getTooltipContents:function(a,b){return b},_onAnnotationModelChanged:function(a){function b(b){for(var a=0;a<b.length;a++)if(f.isAnnotationTypeVisible(b[a].type)){var c=b[a].start,h=b[a].end;e.getBaseModel&&(c=e.mapOffset(c,!0),h=e.mapOffset(h,!0));-1!==c&&-1!==h&&d.redrawLines(e.getLineAtOffset(c),e.getLineAtOffset(Math.max(c,h-1))+1,f)}}var d=this._view;if(d){var e=d.getModel(),f=this,h=e.getLineCount();a.textModelChangedEvent?
+(a=a.textModelChangedEvent.start,e.getBaseModel&&(a=e.mapOffset(a,!0)),a=e.getLineAtOffset(a),d.redrawLines(a,h,f)):(b(a.added),b(a.removed),b(a.changed))}},_mergeAnnotation:function(a,b,d){a||(a={});0===d&&(a.html&&b.html?(b.html!==a.html&&(!a._multiple&&this._multiAnnotation)&&(a.html=this._multiAnnotation.html),a._multiple=!0):a.html=b.html);a.style=this._mergeStyle(a.style,b.style);return a},_mergeStyle:function(a,b){if(b){a||(a={});a.styleClass=a.styleClass&&b.styleClass&&a.styleClass!==b.styleClass?
+a.styleClass+(" "+b.styleClass):b.styleClass;var d;if(b.style)for(d in a.style||(a.style={}),b.style)void 0===a.style[d]&&(a.style[d]=b.style[d]);if(b.attributes)for(d in a.attributes||(a.attributes={}),b.attributes)void 0===a.attributes[d]&&(a.attributes[d]=b.attributes[d])}return a},_setCurrentGroup:function(a){var b=this._annotationModel,d=null,e=b.getTextModel(),f,h=this._currentGroupAnnotation;if(-1!==a){var g=e.getLineStart(a),l=e.getLineEnd(a);e.getBaseModel&&(g=e.mapOffset(g),l=e.mapOffset(l));
+for(f=b.getAnnotations(g,l);f.hasNext();)if(e=f.next(),this.isAnnotationTypeVisible(e.type)&&e.start<=g&&e.end>=l&&void 0!==e.groupId){d=e;break}if(h&&d&&h.groupId===d.groupId)return}this._currentGroupAnnotation=null;h&&b.removeAnnotations(h.groupType);if(d&&-1!==a){this._currentGroupAnnotation=d;f=b.getAnnotations();for(a=[];f.hasNext();)e=f.next(),delete e.groupAnnotation,e.groupId===d.groupId&&(e=e.createGroupAnnotation(),a.push(e));b.replaceAnnotations(null,a)}}};n.AnnotationTypeList.addMixin(l.prototype);
+f.prototype=new l;f.prototype.getAnnotations=function(a,b){for(var d=l.prototype.getAnnotations.call(this,a,b),e=this._view.getModel(),f=a;f<b;f++){var h=f&1?this._oddStyle:this._evenStyle,g=f;e.getBaseModel&&(g=e.getLineStart(g),g=e.getBaseModel().getLineAtOffset(e.mapOffset(g)));d[f]||(d[f]={});d[f].html=this._firstLine+g+"";d[f].style||(d[f].style=h)}return d};f.prototype.getWidestAnnotation=function(){var a=this._view.getModel().getLineCount();return this.getAnnotations(a-1,a)[a-1]};f.prototype.setFirstLine=
+function(a){this._firstLine=void 0!==a?a:1};f.prototype._onTextModelChanged=function(a){var b=a.start,a=this._view.getModel(),d=a.getBaseModel?a.getBaseModel().getLineCount():a.getLineCount(),d=(this._firstLine+d-1+"").length;this._numOfDigits!==d&&(this._numOfDigits=d,b=a.getLineAtOffset(b),this._view.redrawLines(b,a.getLineCount(),this))};e.prototype=new l;d.prototype=new l;d.prototype.getRulerStyle=function(){var a={style:{lineHeight:"1px",fontSize:"1px"}};return a=this._mergeStyle(a,this._rulerStyle)};
+d.prototype._getTooltipContents=function(c,b){if(0===b.length){var d=this._view.getModel(),e=c;d.getBaseModel&&(e=d.getLineStart(e),e=d.getBaseModel().getLineAtOffset(d.mapOffset(e)));return a.formatMessage(g.line,e+1)}return l.prototype._getTooltipContents.call(this,c,b)};d.prototype._mergeAnnotation=function(a,b,d,e){if(0===d)return a||(a={html:"&nbsp;",style:{style:{height:3*e+"px"}}},a.style=this._mergeStyle(a.style,b.overviewStyle)),a};h.prototype=new e;h.prototype.onClick=function(a){if(void 0!==
+a){var b=this._annotationModel;if(b){var d=this._view.getModel(),e=d.getLineStart(a),a=d.getLineEnd(a,!0);d.getBaseModel&&(e=d.mapOffset(e),a=d.mapOffset(a),d=d.getBaseModel());for(var f,b=b.getAnnotations(e,a);!f&&b.hasNext();)a=b.next(),this.isAnnotationTypeVisible(a.type)&&(f=a);f&&d.getLineAtOffset(f.start)===d.getLineAtOffset(e)&&((d=p.Tooltip.getTooltip(this._view))&&d.setTarget(null),f.expanded?f.collapse():f.expand())}}};h.prototype._getTooltipContents=function(a,b){return 1===b.length&&b[0].expanded?
+null:e.prototype._getTooltipContents.call(this,a,b)};h.prototype._onAnnotationModelChanged=function(a){function b(b){for(g=0;g<b.length;g++)if(h.isAnnotationTypeVisible(b[g].type)){var a=b[g].start;f.getBaseModel&&(a=f.mapOffset(a,!0));-1!==a&&(p=Math.min(p,f.getLineAtOffset(a)))}}if(a.textModelChangedEvent)e.prototype._onAnnotationModelChanged.call(this,a);else{var d=this._view;if(d){var f=d.getModel(),h=this,g,l=f.getLineCount(),p=l;b(a.added);b(a.removed);b(a.changed);a=d.getRulers();for(g=0;g<
+a.length;g++)d.redrawLines(p,l,a[g])}}};return{Ruler:l,AnnotationRuler:e,LineNumberRuler:f,OverviewRuler:d,FoldingRuler:h}});
+define("orion/editor/textDND",["orion/util"],function(g){function n(g,a){this._view=g;this._undoStack=a;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var l=this;this._listener={onDragStart:function(a){l._onDragStart(a)},onDragEnd:function(a){l._onDragEnd(a)},onDragEnter:function(a){l._onDragEnter(a)},onDragOver:function(a){l._onDragOver(a)},onDrop:function(a){l._onDrop(a)},onDestroy:function(a){l._onDestroy(a)}};g.addEventListener("DragStart",this._listener.onDragStart);g.addEventListener("DragEnd",
 this._listener.onDragEnd);g.addEventListener("DragEnter",this._listener.onDragEnter);g.addEventListener("DragOver",this._listener.onDragOver);g.addEventListener("Drop",this._listener.onDrop);g.addEventListener("Destroy",this._listener.onDestroy)}n.prototype={destroy:function(){var g=this._view;g&&(g.removeEventListener("DragStart",this._listener.onDragStart),g.removeEventListener("DragEnd",this._listener.onDragEnd),g.removeEventListener("DragEnter",this._listener.onDragEnter),g.removeEventListener("DragOver",
-this._listener.onDragOver),g.removeEventListener("Drop",this._listener.onDrop),g.removeEventListener("Destroy",this._listener.onDestroy),this._view=null)},_onDestroy:function(){this.destroy()},_onDragStart:function(g){var b=this._view,l=b.getSelection(),b=b.getModel();b.getBaseModel&&(l.start=b.mapOffset(l.start),l.end=b.mapOffset(l.end),b=b.getBaseModel());if(b=b.getText(l.start,l.end))this._dragSelection=l,g.event.dataTransfer.effectAllowed="copyMove",g.event.dataTransfer.setData("Text",b)},_onDragEnd:function(p){if(this._dragSelection){var b=
-this._view,l=p.event.dataTransfer.dropEffect;if(!g.isFirefox&&("none"!==l||this._dropText))l=p.event.dataTransfer.dropEffect=this._dropEffect;this._undoStack&&this._undoStack.startCompoundChange();(p="move"===l)&&b.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var l=this._dropText,f=this._dropOffset;p&&(f>=this._dragSelection.end?f-=this._dragSelection.end-this._dragSelection.start:f>=this._dragSelection.start&&(f=this._dragSelection.start));b.setText(l,f,f);b.setSelection(f,
-f+l.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(g){this._onDragOver(g)},_onDragOver:function(p){var b=p.event.dataTransfer.types,l=!this._view.getOptions("readonly");l&&b&&(l=b.contains?b.contains("text/plain")||b.contains("Text"):-1!==b.indexOf("text/plain")||-1!==b.indexOf("Text"));l?g.isFirefox||(this._dropEffect=p.event.dataTransfer.dropEffect=(g.isMac?p.event.altKey:p.event.ctrlKey)?"copy":
-"move"):p.event.dataTransfer.dropEffect="none"},_onDrop:function(p){var b=this._view,l=p.event.dataTransfer.getData("Text");l&&(g.isFirefox||(p.event.dataTransfer.dropEffect=this._dropEffect),p=b.getOffsetAtLocation(p.x,p.y),this._dragSelection?(this._dropOffset=p,this._dropText=l):(b.setText(l,p,p),b.setSelection(p,p+l.length)))}};return{TextDND:n}});
-define("orion/editor/templates",[],function(){function g(g,b,l,f){this.prefix=g;this.description=b;this.template=l;this.name=f;this._parse()}function n(g,b){this._keywords=g||[];this._templates=[];this.addTemplates(b||[])}g.prototype={getProposal:function(g,b,l){var g=b-g.length,b={},f,e=void 0!==l.delimiter?l.delimiter:"\n";l.indentation&&(e+=l.indentation);for(var d=void 0!==l.tab?l.tab:"\t",h=0,c=this.variables,a=this.segments,l=[],k=0;k<a.length;k++){var m=a[k],r=c[m];if(void 0!==r)switch(m){case "${tab}":m=
-d;break;case "${delimiter}":m=e;break;case "${cursor}":m="";f=h;break;default:var n=b[m];n||(n=b[m]={data:r.data,positions:[]});m=r.substitution;n.data&&n.data.values&&(m=n.data.values[0]);n.positions.push({offset:g+h,length:m.length})}l.push(m);h+=m.length}var e=[],v;for(v in b)b.hasOwnProperty(v)&&e.push(b[v]);l=l.join("");void 0===f&&(f=l.length);return{proposal:l,name:this.name,description:this.description,groups:e,escapePosition:g+f,style:"noemphasis"}},match:function(g){return 0===this.prefix.indexOf(g)},
-_parse:function(){var g=this.template,b=[],l={},f,e=0,g=g.replace(/\n/g,"${delimiter}"),g=g.replace(/\t/g,"${tab}");g.replace(/\$\{((?:[^\\}]+|\\.))*\}/g,function(d,h,c){var a=d.substring(2,d.length-1),h=d,k=a,m=null,r=k.indexOf(":");-1!==r&&(k=k.substring(0,r),h="${"+k+"}",m=JSON.parse(a.substring(r+1).replace("\\}","}").trim()));(a=l[h])||(a=l[h]={});a.substitution=k;m&&(a.data=m);(f=g.substring(e,c))&&b.push(f);b.push(h);e=c+d.length;return k});(f=g.substring(e,g.length))&&b.push(f);this.segments=
-b;this.variables=l}};n.prototype={addTemplates:function(n){for(var b=this.getTemplates(),l=0;l<n.length;l++)b.push(new g(n[l].prefix,n[l].description,n[l].template,n[l].name))},computeProposals:function(g,b,l){var f=this.getPrefix(g,b,l),e=[];this.isValid(f,g,b,l)&&(e=e.concat(this.getTemplateProposals(f,b,l)),e=e.concat(this.getKeywordProposals(f)));return e},getKeywords:function(){return this._keywords},getKeywordProposals:function(g){var b=[],l=this.getKeywords();if(l){for(var f=0;f<l.length;f++)0===
-l[f].indexOf(g)&&b.push({proposal:l[f].substring(g.length),description:l[f],style:"noemphasis_keyword"});0<b.length&&b.splice(0,0,{proposal:"",description:"Keywords",style:"noemphasis_title_keywords",unselectable:!0})}return b},getPrefix:function(g,b,l){return l.prefix},getTemplates:function(){return this._templates},getTemplateProposals:function(g,b,l){for(var f=[],e=this.getTemplates(),d=0;d<e.length;d++){var h=e[d];h.match(g)&&(h=h.getProposal(g,b,l),this.removePrefix(g,h),f.push(h))}0<f.length&&
-f.splice(0,0,{proposal:"",description:"Templates",style:"noemphasis_title",unselectable:!0});return f},removePrefix:function(g,b){if(!(b.overwrite=b.proposal.substring(0,g.length)!==g))b.proposal=b.proposal.substring(g.length)},isValid:function(){return!0}};return{Template:g,TemplateContentAssist:n}});
-define("orion/editor/linkedMode","i18n!orion/editor/nls/messages orion/keyBinding orion/editor/keyModes orion/editor/annotations orion/editor/templates orion/objects orion/util".split(" "),function(g,n,p,b,l,f){function e(b,c,a){var d=b.getTextView();p.KeyMode.call(this,d);this.editor=b;this.undoStack=c;this.contentAssist=a;this.linkedModeModel=null;d.setAction("linkedModeEnter",function(){this.exitLinkedMode(!0);return!0}.bind(this));d.setAction("linkedModeCancel",function(){this.exitLinkedMode(!1);
-return!0}.bind(this));d.setAction("linkedModeNextGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup((a.selectedGroupIndex+1)%a.groups.length);return!0}.bind(this));d.setAction("linkedModePreviousGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup(0<a.selectedGroupIndex?a.selectedGroupIndex-1:a.groups.length-1);return!0}.bind(this));this.linkedModeListener={onActivating:function(){this._groupContentAssistProvider&&(this.contentAssist.setProviders([this._groupContentAssistProvider]),
-this.contentAssist.setProgress(null))}.bind(this),onModelChanged:function(a){if(!this.ignoreVerify){for(var b=this.editor.mapOffset(a.start),c=this.linkedModeModel,d,e;c;)if(d=this._getPositionChanged(c,b,b+a.removedCharCount),e=d.position,void 0===e||e.model!==c)this.exitLinkedMode(!1),c=this.linkedModeModel;else break;if(c){c=0;a=a.addedCharCount-a.removedCharCount;d=d.positions;for(var f,h=0;h<d.length;++h){f=d[h];e=f.position;var g=e.offset<=b&&b<=e.offset+e.length;g&&!f.ansestor?(e.offset+=c,
-e.length+=a,c+=a):(e.offset+=c,f.ansestor&&g&&(e.length+=a));f.escape&&(f.model.escapePosition=e.offset)}this._updateAnnotations(d)}}}.bind(this),onVerify:function(a){if(!this.ignoreVerify){for(var b=this.editor,c=b.mapOffset(a.start),d=this.editor.mapOffset(a.end),e=this.linkedModeModel,f,h;e;)if(f=this._getPositionChanged(e,c,d),h=f.position,void 0===h||h.model!==e)this.exitLinkedMode(!1),e=this.linkedModeModel;else break;if(e){var g=this._compoundChange;g?g.owner.model===e&&g.owner.group===h.group||
-(this.endUndo(),this.startUndo()):this.startUndo();e.selectedGroupIndex=h.group;var g=0,k=a.text.length-(d-c);f=f.positions;for(var l,c=c-h.position.offset,n=d-h.position.offset,p=0;p<f.length;++p)l=f[p],d=l.position,l.oldOffset=d.offset,l.model===e&&l.group===h.group?(d.offset+=g,d.length+=k,g+=k):(d.offset+=g,l.ansestor&&(d.length+=h.count*k)),l.escape&&(l.model.escapePosition=d.offset);this.ignoreVerify=!0;for(p=f.length-1;0<=p;p--)l=f[p],l.model===e&&l.group===h.group&&b.setText(a.text,l.oldOffset+
-c,l.oldOffset+n);this.ignoreVerify=!1;a.text=null;this._updateAnnotations(f)}}}.bind(this)}}var d={};e.prototype=new p.KeyMode;f.mixin(e.prototype,{createKeyBindings:function(){var b=n.KeyBinding,c=[];c.push({actionID:"linkedModeEnter",keyBinding:new b(13)});c.push({actionID:"linkedModeCancel",keyBinding:new b(27)});c.push({actionID:"linkedModeNextGroup",keyBinding:new b(9)});c.push({actionID:"linkedModePreviousGroup",keyBinding:new b(9,!1,!0)});return c},enterLinkedMode:function(b){if(!this.linkedModeModel){var c=
-this.editor.getTextView();c.addKeyMode(this);c.addEventListener("Verify",this.linkedModeListener.onVerify);c.addEventListener("ModelChanged",this.linkedModeListener.onModelChanged);this.contentAssist.addEventListener("Activating",this.linkedModeListener.onActivating);this.editor.reportStatus(g.linkedModeEntered,null,!0)}this._sortedPositions=null;this.linkedModeModel&&(b.previousModel=this.linkedModeModel,b.parentGroup=this.linkedModeModel.selectedGroupIndex,this.linkedModeModel.nextModel=b);this.linkedModeModel=
-b;this.selectLinkedGroup(0)},exitLinkedMode:function(b){if(this.isActive()){this._compoundChange&&(this.endUndo(),this._compoundChange=null);this._sortedPositions=null;var c=this.linkedModeModel;this.linkedModeModel=c.previousModel;c.parentGroup=c.previousModel=void 0;this.linkedModeModel&&(this.linkedModeModel.nextModel=void 0);if(!this.linkedModeModel){var a=this.editor,d=a.getTextView();d.removeKeyMode(this);d.removeEventListener("Verify",this.linkedModeListener.onVerify);d.removeEventListener("ModelChanged",
-this.linkedModeListener.onModelChanged);d=this.contentAssist;d.removeEventListener("Activating",this.linkedModeListener.onActivating);d.offset=void 0;this.editor.reportStatus(g.linkedModeExited,null,!0);b&&a.setCaretOffset(c.escapePosition,!1)}this.selectLinkedGroup(0)}},startUndo:function(){if(this.undoStack){var b=this,c=this.linkedModeModel;this._compoundChange=this.undoStack.startCompoundChange({model:c,group:c.selectedGroupIndex,end:function(){b._compoundChange=null}})}},endUndo:function(){this.undoStack&&
-this.undoStack.endCompoundChange()},isActive:function(){return!!this.linkedModeModel},isStatusActive:function(){return!!this.linkedModeModel},selectLinkedGroup:function(b){var c=this.linkedModeModel;if(c){c.selectedGroupIndex=b;var b=c.groups[b],a=b.positions[0],d=this.editor;d.setSelection(a.offset,a.offset+a.length);if(c=this.contentAssist)c.offset=void 0,b.data&&"link"===b.data.type&&b.data.values?((this._groupContentAssistProvider=new l.TemplateContentAssist(b.data.values)).getPrefix=function(){var b=
-d.getSelection();return b.start===b.end&&(b=d.getCaretOffset(),a.offset<=b&&b<=a.offset+a.length)?d.getText(a.offset,b):""},c.offset=a.offset,c.deactivate(),c.activate()):this._groupContentAssistProvider&&(this._groupContentAssistProvider=null,c.deactivate())}this._updateAnnotations()},_getModelPositions:function(b,c,a){for(var d=c.groups,e=0;e<d.length;e++)for(var f=d[e].positions,g=0;g<f.length;g++){var l=f[g];a&&(l={offset:l.offset+a,length:l.length});l={index:g,group:e,count:f.length,model:c,
-position:l};b.push(l);c.nextModel&&c.nextModel.parentGroup===e&&(l.ansestor=!0,this._getModelPositions(b,c.nextModel,(a||0)+f[g].offset-f[0].offset))}},_getSortedPositions:function(b){var c=this._sortedPositions;if(!c){for(c=[];b.previousModel;)b=b.previousModel;for(this._getModelPositions(c,b);b;)void 0!==b.escapePosition&&c.push({escape:!0,model:b,position:{offset:b.escapePosition,length:0}}),b=b.nextModel;c.sort(function(a,b){return a.position.offset-b.position.offset});this._sortedPositions=c}return c},
-_getPositionChanged:function(b,c,a){for(var d,b=this._getSortedPositions(b),e=b.length-1;0<=e;e--){var f=b[e].position;if(f.offset<=c&&a<=f.offset+f.length){d=b[e];break}}return{position:d,positions:b}},_updateAnnotations:function(d){var c=this.editor.getAnnotationModel();if(c){for(var a=[],e=[],f=c.getTextModel(),f=c.getAnnotations(0,f.getCharCount()),g;f.hasNext();)switch(g=f.next(),g.type){case b.AnnotationType.ANNOTATION_LINKED_GROUP:case b.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case b.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:a.push(g)}if(f=
-this.linkedModeModel)for(var d=d||this._getSortedPositions(f),l=0;l<d.length;l++)if(g=d[l],g.model===f){var n=b.AnnotationType.ANNOTATION_LINKED_GROUP;g.group===f.selectedGroupIndex&&(n=0===g.index?b.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:b.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP);g=g.position;g=b.AnnotationType.createAnnotation(n,g.offset,g.offset+g.length,"");e.push(g)}c.replaceAnnotations(a,e)}}});d.LinkedMode=e;return d});
-define("orion/editor/factories","orion/editor/actions orion/editor/undoStack orion/editor/rulers orion/editor/annotations orion/editor/textDND orion/editor/linkedMode".split(" "),function(g,n,p,b,l,f){function e(){}function d(){}function h(){}function c(){}function a(){}function k(){}var m={};e.prototype={createKeyBindings:function(a,b,c,d){var d=new g.TextActions(a,b,d),e=new f.LinkedMode(a,b,c),a=new g.SourceCodeActions(a,b,c,e);return{textActions:d,linkedMode:e,sourceCodeActions:a}}};m.KeyBindingsFactory=
-e;d.prototype={createUndoStack:function(a){a=a.getTextView();return new n.UndoStack(a,200)}};m.UndoFactory=d;h.prototype={createLineNumberRuler:function(a){return new p.LineNumberRuler(a,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};m.LineNumberRulerFactory=h;c.prototype={createFoldingRuler:function(a){return new p.FoldingRuler(a,"left",{styleClass:"ruler folding"})}};m.FoldingRulerFactory=c;a.prototype={createAnnotationModel:function(a){return new b.AnnotationModel(a)},
-createAnnotationStyler:function(a,c){return new b.AnnotationStyler(a,c)},createAnnotationRulers:function(a){var b=new p.AnnotationRuler(a,"left",{styleClass:"ruler annotations"}),a=new p.OverviewRuler(a,"right",{styleClass:"ruler overview"});return{annotationRuler:b,overviewRuler:a}}};m.AnnotationFactory=a;k.prototype={createTextDND:function(a,b){return new l.TextDND(a.getTextView(),b)}};m.TextDNDFactory=k;return m});
-define("orion/editor/editorFeatures",["orion/editor/factories","orion/editor/actions","orion/editor/linkedMode","orion/objects"],function(g,n,p,b){return b.mixin({},g,n,p)});
-define("orion/editorPreferences",[],function(){function g(b,g){this._preferences=b;if(this._callback=g)var f=b.listenForChangedSettings(n,function(b){b.key===f&&g()}.bind(this))}var n="/editor/settings",p={autoSave:!1,autoSaveVisible:!0,autoSaveLocalVisible:!0,autoSaveTimeout:1E3,autoSaveTimeoutVisible:!0,themeVisible:!0,themeLocalVisible:!0,fontSizeVisible:!0,fontSizeLocalVisible:!0,autoLoad:!0,autoLoadVisible:!0,saveDiffs:!0,saveDiffsVisible:!0,showBlame:!1,showBlameVisible:!0,contentAssistAutoTrigger:!0,
+this._listener.onDragOver),g.removeEventListener("Drop",this._listener.onDrop),g.removeEventListener("Destroy",this._listener.onDestroy),this._view=null)},_onDestroy:function(){this.destroy()},_onDragStart:function(g){var a=this._view,l=a.getSelection(),a=a.getModel();a.getBaseModel&&(l.start=a.mapOffset(l.start),l.end=a.mapOffset(l.end),a=a.getBaseModel());if(a=a.getText(l.start,l.end))this._dragSelection=l,g.event.dataTransfer.effectAllowed="copyMove",g.event.dataTransfer.setData("Text",a)},_onDragEnd:function(p){if(this._dragSelection){var a=
+this._view,l=p.event.dataTransfer.dropEffect;if(!g.isFirefox&&("none"!==l||this._dropText))l=p.event.dataTransfer.dropEffect=this._dropEffect;this._undoStack&&this._undoStack.startCompoundChange();(p="move"===l)&&a.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var l=this._dropText,f=this._dropOffset;p&&(f>=this._dragSelection.end?f-=this._dragSelection.end-this._dragSelection.start:f>=this._dragSelection.start&&(f=this._dragSelection.start));a.setText(l,f,f);a.setSelection(f,
+f+l.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(g){this._onDragOver(g)},_onDragOver:function(p){var a=p.event.dataTransfer.types,l=!this._view.getOptions("readonly");l&&a&&(l=a.contains?a.contains("text/plain")||a.contains("Text"):-1!==a.indexOf("text/plain")||-1!==a.indexOf("Text"));l?g.isFirefox||(this._dropEffect=p.event.dataTransfer.dropEffect=(g.isMac?p.event.altKey:p.event.ctrlKey)?"copy":
+"move"):p.event.dataTransfer.dropEffect="none"},_onDrop:function(p){var a=this._view,l=p.event.dataTransfer.getData("Text");l&&(g.isFirefox||(p.event.dataTransfer.dropEffect=this._dropEffect),p=a.getOffsetAtLocation(p.x,p.y),this._dragSelection?(this._dropOffset=p,this._dropText=l):(a.setText(l,p,p),a.setSelection(p,p+l.length)))}};return{TextDND:n}});
+define("orion/editor/templates",[],function(){function g(g,a,l,f){this.prefix=g;this.description=a;this.template=l;this.name=f;this._parse()}function n(g,a){this._keywords=g||[];this._templates=[];this.addTemplates(a||[])}g.prototype={getProposal:function(g,a,l){var g=a-g.length,a={},f,e=void 0!==l.delimiter?l.delimiter:"\n";l.indentation&&(e+=l.indentation);for(var d=void 0!==l.tab?l.tab:"\t",h=0,c=this.variables,b=this.segments,l=[],k=0;k<b.length;k++){var m=b[k],r=c[m];if(void 0!==r)switch(m){case "${tab}":m=
+d;break;case "${delimiter}":m=e;break;case "${cursor}":m="";f=h;break;default:var n=a[m];n||(n=a[m]={data:r.data,positions:[]});m=r.substitution;n.data&&n.data.values&&(m=n.data.values[0]);n.positions.push({offset:g+h,length:m.length})}l.push(m);h+=m.length}var e=[],u;for(u in a)a.hasOwnProperty(u)&&e.push(a[u]);l=l.join("");void 0===f&&(f=l.length);return{proposal:l,name:this.name,description:this.description,groups:e,escapePosition:g+f,style:"noemphasis"}},match:function(g){return 0===this.prefix.indexOf(g)},
+_parse:function(){var g=this.template,a=[],l={},f,e=0,g=g.replace(/\n/g,"${delimiter}"),g=g.replace(/\t/g,"${tab}");g.replace(/\$\{((?:[^\\}]+|\\.))*\}/g,function(d,h,c){var b=d.substring(2,d.length-1),h=d,k=b,m=null,r=k.indexOf(":");-1!==r&&(k=k.substring(0,r),h="${"+k+"}",m=JSON.parse(b.substring(r+1).replace("\\}","}").trim()));(b=l[h])||(b=l[h]={});b.substitution=k;m&&(b.data=m);(f=g.substring(e,c))&&a.push(f);a.push(h);e=c+d.length;return k});(f=g.substring(e,g.length))&&a.push(f);this.segments=
+a;this.variables=l}};n.prototype={addTemplates:function(n){for(var a=this.getTemplates(),l=0;l<n.length;l++)a.push(new g(n[l].prefix,n[l].description,n[l].template,n[l].name))},computeProposals:function(g,a,l){var f=this.getPrefix(g,a,l),e=[];this.isValid(f,g,a,l)&&(e=e.concat(this.getTemplateProposals(f,a,l)),e=e.concat(this.getKeywordProposals(f)));return e},getKeywords:function(){return this._keywords},getKeywordProposals:function(g){var a=[],l=this.getKeywords();if(l){for(var f=0;f<l.length;f++)0===
+l[f].indexOf(g)&&a.push({proposal:l[f].substring(g.length),description:l[f],style:"noemphasis_keyword"});0<a.length&&a.splice(0,0,{proposal:"",description:"Keywords",style:"noemphasis_title_keywords",unselectable:!0})}return a},getPrefix:function(g,a,l){return l.prefix},getTemplates:function(){return this._templates},getTemplateProposals:function(g,a,l){for(var f=[],e=this.getTemplates(),d=0;d<e.length;d++){var h=e[d];h.match(g)&&(h=h.getProposal(g,a,l),this.removePrefix(g,h),f.push(h))}0<f.length&&
+f.splice(0,0,{proposal:"",description:"Templates",style:"noemphasis_title",unselectable:!0});return f},removePrefix:function(g,a){if(!(a.overwrite=a.proposal.substring(0,g.length)!==g))a.proposal=a.proposal.substring(g.length)},isValid:function(){return!0}};return{Template:g,TemplateContentAssist:n}});
+define("orion/editor/linkedMode","i18n!orion/editor/nls/messages orion/keyBinding orion/editor/keyModes orion/editor/annotations orion/editor/templates orion/objects orion/util".split(" "),function(g,n,p,a,l,f){function e(a,d,b){var e=a.getTextView();p.KeyMode.call(this,e);this.editor=a;this.undoStack=d;this.contentAssist=b;this.linkedModeModel=null;e.setAction("linkedModeEnter",function(){this.exitLinkedMode(!0);return!0}.bind(this));e.setAction("linkedModeCancel",function(){this.exitLinkedMode(!1);
+return!0}.bind(this));e.setAction("linkedModeNextGroup",function(){var b=this.linkedModeModel;this.selectLinkedGroup((b.selectedGroupIndex+1)%b.groups.length);return!0}.bind(this));e.setAction("linkedModePreviousGroup",function(){var b=this.linkedModeModel;this.selectLinkedGroup(0<b.selectedGroupIndex?b.selectedGroupIndex-1:b.groups.length-1);return!0}.bind(this));this.linkedModeListener={onActivating:function(){this._groupContentAssistProvider&&(this.contentAssist.setProviders([this._groupContentAssistProvider]),
+this.contentAssist.setProgress(null))}.bind(this),onModelChanged:function(b){if(!this.ignoreVerify){for(var a=this.editor.mapOffset(b.start),d=this.linkedModeModel,c,e;d;)if(c=this._getPositionChanged(d,a,a+b.removedCharCount),e=c.position,void 0===e||e.model!==d)this.exitLinkedMode(!1),d=this.linkedModeModel;else break;if(d){d=0;b=b.addedCharCount-b.removedCharCount;c=c.positions;for(var f,g=0;g<c.length;++g){f=c[g];e=f.position;var h=e.offset<=a&&a<=e.offset+e.length;h&&!f.ansestor?(e.offset+=d,
+e.length+=b,d+=b):(e.offset+=d,f.ansestor&&h&&(e.length+=b));f.escape&&(f.model.escapePosition=e.offset)}this._updateAnnotations(c)}}}.bind(this),onVerify:function(b){if(!this.ignoreVerify){for(var a=this.editor,d=a.mapOffset(b.start),c=this.editor.mapOffset(b.end),e=this.linkedModeModel,f,g;e;)if(f=this._getPositionChanged(e,d,c),g=f.position,void 0===g||g.model!==e)this.exitLinkedMode(!1),e=this.linkedModeModel;else break;if(e){var h=this._compoundChange;h?h.owner.model===e&&h.owner.group===g.group||
+(this.endUndo(),this.startUndo()):this.startUndo();e.selectedGroupIndex=g.group;var h=0,k=b.text.length-(c-d);f=f.positions;for(var l,d=d-g.position.offset,n=c-g.position.offset,p=0;p<f.length;++p)l=f[p],c=l.position,l.oldOffset=c.offset,l.model===e&&l.group===g.group?(c.offset+=h,c.length+=k,h+=k):(c.offset+=h,l.ansestor&&(c.length+=g.count*k)),l.escape&&(l.model.escapePosition=c.offset);this.ignoreVerify=!0;for(p=f.length-1;0<=p;p--)l=f[p],l.model===e&&l.group===g.group&&a.setText(b.text,l.oldOffset+
+d,l.oldOffset+n);this.ignoreVerify=!1;b.text=null;this._updateAnnotations(f)}}}.bind(this)}}var d={};e.prototype=new p.KeyMode;f.mixin(e.prototype,{createKeyBindings:function(){var a=n.KeyBinding,d=[];d.push({actionID:"linkedModeEnter",keyBinding:new a(13)});d.push({actionID:"linkedModeCancel",keyBinding:new a(27)});d.push({actionID:"linkedModeNextGroup",keyBinding:new a(9)});d.push({actionID:"linkedModePreviousGroup",keyBinding:new a(9,!1,!0)});return d},enterLinkedMode:function(a){if(!this.linkedModeModel){var d=
+this.editor.getTextView();d.addKeyMode(this);d.addEventListener("Verify",this.linkedModeListener.onVerify);d.addEventListener("ModelChanged",this.linkedModeListener.onModelChanged);this.contentAssist.addEventListener("Activating",this.linkedModeListener.onActivating);this.editor.reportStatus(g.linkedModeEntered,null,!0)}this._sortedPositions=null;this.linkedModeModel&&(a.previousModel=this.linkedModeModel,a.parentGroup=this.linkedModeModel.selectedGroupIndex,this.linkedModeModel.nextModel=a);this.linkedModeModel=
+a;this.selectLinkedGroup(0)},exitLinkedMode:function(a){if(this.isActive()){this._compoundChange&&(this.endUndo(),this._compoundChange=null);this._sortedPositions=null;var d=this.linkedModeModel;this.linkedModeModel=d.previousModel;d.parentGroup=d.previousModel=void 0;this.linkedModeModel&&(this.linkedModeModel.nextModel=void 0);if(!this.linkedModeModel){var b=this.editor,e=b.getTextView();e.removeKeyMode(this);e.removeEventListener("Verify",this.linkedModeListener.onVerify);e.removeEventListener("ModelChanged",
+this.linkedModeListener.onModelChanged);e=this.contentAssist;e.removeEventListener("Activating",this.linkedModeListener.onActivating);e.offset=void 0;this.editor.reportStatus(g.linkedModeExited,null,!0);a&&b.setCaretOffset(d.escapePosition,!1)}this.selectLinkedGroup(0)}},startUndo:function(){if(this.undoStack){var a=this,d=this.linkedModeModel;this._compoundChange=this.undoStack.startCompoundChange({model:d,group:d.selectedGroupIndex,end:function(){a._compoundChange=null}})}},endUndo:function(){this.undoStack&&
+this.undoStack.endCompoundChange()},isActive:function(){return!!this.linkedModeModel},isStatusActive:function(){return!!this.linkedModeModel},selectLinkedGroup:function(a){var d=this.linkedModeModel;if(d){d.selectedGroupIndex=a;var a=d.groups[a],b=a.positions[0],e=this.editor;e.setSelection(b.offset,b.offset+b.length);if(d=this.contentAssist)d.offset=void 0,a.data&&"link"===a.data.type&&a.data.values?((this._groupContentAssistProvider=new l.TemplateContentAssist(a.data.values)).getPrefix=function(){var a=
+e.getSelection();return a.start===a.end&&(a=e.getCaretOffset(),b.offset<=a&&a<=b.offset+b.length)?e.getText(b.offset,a):""},d.offset=b.offset,d.deactivate(),d.activate()):this._groupContentAssistProvider&&(this._groupContentAssistProvider=null,d.deactivate())}this._updateAnnotations()},_getModelPositions:function(a,d,b){for(var e=d.groups,f=0;f<e.length;f++)for(var g=e[f].positions,l=0;l<g.length;l++){var n=g[l];b&&(n={offset:n.offset+b,length:n.length});n={index:l,group:f,count:g.length,model:d,
+position:n};a.push(n);d.nextModel&&d.nextModel.parentGroup===f&&(n.ansestor=!0,this._getModelPositions(a,d.nextModel,(b||0)+g[l].offset-g[0].offset))}},_getSortedPositions:function(a){var d=this._sortedPositions;if(!d){for(d=[];a.previousModel;)a=a.previousModel;for(this._getModelPositions(d,a);a;)void 0!==a.escapePosition&&d.push({escape:!0,model:a,position:{offset:a.escapePosition,length:0}}),a=a.nextModel;d.sort(function(b,a){return b.position.offset-a.position.offset});this._sortedPositions=d}return d},
+_getPositionChanged:function(a,d,b){for(var e,a=this._getSortedPositions(a),f=a.length-1;0<=f;f--){var g=a[f].position;if(g.offset<=d&&b<=g.offset+g.length){e=a[f];break}}return{position:e,positions:a}},_updateAnnotations:function(d){var c=this.editor.getAnnotationModel();if(c){var b=[],e=[];c.getTextModel();for(var f=c.getAnnotations(),g;f.hasNext();)switch(g=f.next(),g.type){case a.AnnotationType.ANNOTATION_LINKED_GROUP:case a.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case a.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:b.push(g)}if(f=
+this.linkedModeModel)for(var d=d||this._getSortedPositions(f),l=0;l<d.length;l++)if(g=d[l],g.model===f){var n=a.AnnotationType.ANNOTATION_LINKED_GROUP;g.group===f.selectedGroupIndex&&(n=0===g.index?a.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:a.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP);g=g.position;g=a.AnnotationType.createAnnotation(n,g.offset,g.offset+g.length,"");e.push(g)}c.replaceAnnotations(b,e)}}});d.LinkedMode=e;return d});
+define("orion/editor/factories","orion/editor/actions orion/editor/undoStack orion/editor/rulers orion/editor/annotations orion/editor/textDND orion/editor/linkedMode".split(" "),function(g,n,p,a,l,f){function e(){}function d(){}function h(){}function c(){}function b(){}function k(){}var m={};e.prototype={createKeyBindings:function(b,a,d,c){var c=new g.TextActions(b,a,c),e=new f.LinkedMode(b,a,d),b=new g.SourceCodeActions(b,a,d,e);return{textActions:c,linkedMode:e,sourceCodeActions:b}}};m.KeyBindingsFactory=
+e;d.prototype={createUndoStack:function(b){b=b.getTextView();return new n.UndoStack(b,200)}};m.UndoFactory=d;h.prototype={createLineNumberRuler:function(b){return new p.LineNumberRuler(b,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};m.LineNumberRulerFactory=h;c.prototype={createFoldingRuler:function(b){return new p.FoldingRuler(b,"left",{styleClass:"ruler folding"})}};m.FoldingRulerFactory=c;b.prototype={createAnnotationModel:function(b){return new a.AnnotationModel(b)},
+createAnnotationStyler:function(b,d){return new a.AnnotationStyler(b,d)},createAnnotationRulers:function(b){var a=new p.AnnotationRuler(b,"left",{styleClass:"ruler annotations"}),b=new p.OverviewRuler(b,"right",{styleClass:"ruler overview"});return{annotationRuler:a,overviewRuler:b}}};m.AnnotationFactory=b;k.prototype={createTextDND:function(b,a){return new l.TextDND(b.getTextView(),a)}};m.TextDNDFactory=k;return m});
+define("orion/editor/editorFeatures",["orion/editor/factories","orion/editor/actions","orion/editor/linkedMode","orion/objects"],function(g,n,p,a){return a.mixin({},g,n,p)});
+define("orion/editorPreferences",[],function(){function g(a,g){this._preferences=a;if(this._callback=g)var f=a.listenForChangedSettings(n,function(a){a.key===f&&g()}.bind(this))}var n="/editor/settings",p={autoSave:!1,autoSaveVisible:!0,autoSaveLocalVisible:!0,autoSaveTimeout:1E3,autoSaveTimeoutVisible:!0,themeVisible:!0,themeLocalVisible:!0,fontSizeVisible:!0,fontSizeLocalVisible:!0,autoLoad:!0,autoLoadVisible:!0,saveDiffs:!0,saveDiffsVisible:!0,showBlame:!1,showBlameVisible:!0,contentAssistAutoTrigger:!0,
 contentAssistAutoTriggerVisible:!0,showOccurrences:!1,showOccurrencesVisible:!0,autoPairParentheses:!0,autoPairParenthesesVisible:!0,autoPairBraces:!0,autoPairBracesVisible:!0,autoPairSquareBrackets:!0,autoPairSquareBracketsVisible:!0,autoPairAngleBrackets:!1,autoPairAngleBracketsVisible:!0,autoPairQuotations:!0,autoPairQuotationsVisible:!0,autoCompleteComments:!0,autoCompleteCommentsVisible:!0,smartIndentation:!0,smartIndentationVisible:!0,trimTrailingWhiteSpace:!1,trimTrailingWhiteSpaceVisible:!0,
 tabSize:4,tabSizeVisible:!0,expandTab:!1,expandTabVisible:!0,scrollAnimation:!0,scrollAnimationVisible:!0,scrollAnimationTimeout:300,scrollAnimationTimeoutVisible:!0,annotationRuler:!0,annotationRulerVisible:!0,lineNumberRuler:!0,lineNumberRulerVisible:!0,foldingRuler:!0,foldingRulerVisible:!0,overviewRuler:!0,overviewRulerVisible:!0,showTabs:!1,showTabsVisible:!0,showSpaces:!1,showSpacesVisible:!0,wordWrap:!1,wordWrapVisible:!0,showMargin:!1,showMarginVisible:!0,marginOffset:80,marginOffsetVisible:!0,
-keyBindings:"Default",keyBindingsVisible:!0,keyBindingsLocalVisible:!0};g.prototype={_initialize:function(b){var b=b.get("editorSettings")||{},g;for(g in p)b.hasOwnProperty(g)||(b[g]=p[g]);return b},getPrefs:function(b){this._preferences.getPreferences(n).then(function(g){g=this._initialize(g);"string"===typeof g&&(g=JSON.parse(g));b(g)}.bind(this))},setPrefs:function(b,g){this._preferences.getPreferences(n).then(function(f){f.put("editorSettings",b);b=this._initialize(f);g&&g(b);this._callback&&
-this._callback(b)}.bind(this))}};return{EditorPreferences:g}});
-define("orion/widgets/themes/ThemePreferences",[],function(){function g(g,p){this._preferences=g;this._themeData=p;var b=p.getThemeStorageInfo(),l=g.listenForChangedSettings(b.storage,2,function(b){b.key===l&&this.apply()}.bind(this))}g.prototype={_initialize:function(g,p,b){var l=b.get(g.styleset);l||(l=p.getStyles(),b.put(g.styleset,JSON.stringify(l)));(p=b.get("selected"))&&(p=JSON.parse(p));if(!p||void 0===p[g.selectedKey])p=p||{},p[g.selectedKey]=g.defaultTheme,b.put("selected",JSON.stringify(p))},
-apply:function(){this.setTheme()},getTheme:function(g){var p=this._themeData,b=p.getThemeStorageInfo();this._preferences.getPreferences(b.storage,2).then(function(l){this._initialize(b,p,l);var f=JSON.parse(l.get("selected")),l=JSON.parse(l.get(b.styleset)),e;if(l)for(var d=0;d<l.length;d++)if(l[d].name===f[b.selectedKey]){e=l[d];break}g({style:e,styles:l})}.bind(this))},setTheme:function(g,p){var b=this._themeData,l=b.getThemeStorageInfo();this._preferences.getPreferences(l.storage,2).then(function(f){this._initialize(l,
-b,f);var e=JSON.parse(f.get("selected"));g||(g=e[l.selectedKey]);e[l.selectedKey]=g;f.put("selected",JSON.stringify(e));p?f.put(l.styleset,JSON.stringify(p)):p=JSON.parse(f.get(l.styleset));for(f=0;f<p.length;f++)if(p[f].name===e[l.selectedKey]){b.processSettings(p[f]);break}}.bind(this))},setFontSize:function(g){var p=this._themeData,b=p.getThemeStorageInfo();this._preferences.getPreferences(b.storage,2).then(function(l){this._initialize(b,p,l);var f=JSON.parse(l.get("selected")),e=JSON.parse(l.get(b.styleset)),
-d;if(e)for(var h=0;h<e.length;h++)e[h].fontSize=g,e[h].name===f[b.selectedKey]&&(d=e[h]);l.put(b.styleset,JSON.stringify(e));p.processSettings(d)}.bind(this))}};return{ThemePreferences:g}});
+keyBindings:"Default",keyBindingsVisible:!0,keyBindingsLocalVisible:!0};g.prototype={_initialize:function(a){var a=a.get("editorSettings")||{},g;for(g in p)a.hasOwnProperty(g)||(a[g]=p[g]);return a},getPrefs:function(a){this._preferences.getPreferences(n).then(function(g){g=this._initialize(g);"string"===typeof g&&(g=JSON.parse(g));a(g)}.bind(this))},setPrefs:function(a,g){this._preferences.getPreferences(n).then(function(f){f.put("editorSettings",a);a=this._initialize(f);g&&g(a);this._callback&&
+this._callback(a)}.bind(this))}};return{EditorPreferences:g}});
+define("orion/widgets/themes/ThemePreferences",[],function(){function g(g,p){this._preferences=g;this._themeData=p;var a=p.getThemeStorageInfo(),l=g.listenForChangedSettings(a.storage,2,function(a){a.key===l&&this.apply()}.bind(this))}g.prototype={_initialize:function(g,p,a){var l=a.get(g.styleset);l||(l=p.getStyles(),a.put(g.styleset,JSON.stringify(l)));(p=a.get("selected"))&&(p=JSON.parse(p));if(!p||void 0===p[g.selectedKey])p=p||{},p[g.selectedKey]=g.defaultTheme,a.put("selected",JSON.stringify(p))},
+apply:function(){this.setTheme()},getTheme:function(g){var p=this._themeData,a=p.getThemeStorageInfo();this._preferences.getPreferences(a.storage,2).then(function(l){this._initialize(a,p,l);var f=JSON.parse(l.get("selected")),l=JSON.parse(l.get(a.styleset)),e;if(l)for(var d=0;d<l.length;d++)if(l[d].name===f[a.selectedKey]){e=l[d];break}g({style:e,styles:l})}.bind(this))},setTheme:function(g,p){var a=this._themeData,l=a.getThemeStorageInfo();this._preferences.getPreferences(l.storage,2).then(function(f){this._initialize(l,
+a,f);var e=JSON.parse(f.get("selected"));g||(g=e[l.selectedKey]);e[l.selectedKey]=g;f.put("selected",JSON.stringify(e));p?f.put(l.styleset,JSON.stringify(p)):p=JSON.parse(f.get(l.styleset));for(f=0;f<p.length;f++)if(p[f].name===e[l.selectedKey]){a.processSettings(p[f]);break}}.bind(this))},setFontSize:function(g){var p=this._themeData,a=p.getThemeStorageInfo();this._preferences.getPreferences(a.storage,2).then(function(l){this._initialize(a,p,l);var f=JSON.parse(l.get("selected")),e=JSON.parse(l.get(a.styleset)),
+d;if(e)for(var h=0;h<e.length;h++)e[h].fontSize=g,e[h].name===f[a.selectedKey]&&(d=e[h]);l.put(a.styleset,JSON.stringify(e));p.processSettings(d)}.bind(this))}};return{ThemePreferences:g}});
 define("orion/settings/nls/root/messages",{"Plugin Description":"Plugin Description",Create:"Create","Loading...":"Loading...","Label:":"Label:",Title:"Title",Plugins:"Plugins","User Profile":"User Profile","Git Settings":"Git Settings",General:"General",Navigation:"Navigation",Links:"Links","Open in same tab":"Open in same tab","Open in new tab":"Open in new tab",Font:"Font",Family:"Family","Sans Serif":"Sans Serif",Serif:"Serif",Size:"Size","8pt":"8pt","9pt":"9pt","10pt":"10pt","12pt":"12pt",Color:"Color",
 Background:"Background",Strings:"Strings","String Types":"String Types",blue:"blue",Weight:"Weight",Normal:"Normal",Bold:"Bold",Comments:"Comments","Comment Types":"Comment Types",green:"green",Keywords:"Keywords","Keyword Types":"Keyword Types",darkred:"darkred",Categories:"Categories",Username:"Username","Full Name":"Full Name","Email Address":"Email Address","Email Confirmed":"Email Confirmed",Account:"Account","Current Password":"Current Password","New Password":"New Password","Verify Password":"Verify Password",
 Password:"Password",OpenId:"OpenId",AOL:"AOL",Yahoo:"Yahoo",Google:"Google",Unlink:"Unlink",Link:"Link",Unlinked:"Unlinked",Linked:"Linked","Linked Accounts":"Linked Accounts","Git Email Address":"Git Email Address","Git Username":"Git Username","Git Credentials Storage":"Git Credentials Storage",Update:"Update","Update Profile Settings":"Update Profile Settings","Update Git User Settings":"Update Git User Settings","Update Git Credentials":"Update Git Credentials","User profile data successfully updated.":"User profile data successfully updated.",
@@ -1527,89 +1531,89 @@
 autoPairQuotations:'Autopair "Strings"',autoCompleteComments:"Autocomplete /** Block Comments */",smartIndentation:"Smart Indentation",sourceControl:"Source Control",showBlame:"Show Blame",languageTools:"Language Tools",showOccurrences:"Show Occurrences",contentAssistAutoTrigger:"Show Content Assist automatically","Editor preferences updated":"Editor preferences updated","Editor defaults restored":"Editor defaults restored",Theme:"Theme","Font Size":"Font Size","New Theme Name:":"New Theme Name:",
 "Font Size:":"Font Size:","UI Theme":"UI Theme","Navigation Bar":"Navigation Bar","Navigation Text":"Navigation Text","Search Box":"Search Box","Tool Panel":"Tool Panel","Selection Bar":"Selection Bar",Location:"Location",Content:"Content","Main Panel":"Main Panel",Button:"Button","Button Text":"Button Text","Section Text":"Section Text","Side Panel":"Side Panel","Line Color":"Line Color","Line Numbers":"Line Numbers",Foreground:"Foreground","Current Line":"Current Line","HTML Attribute":"HTML Attribute",
 "Overview Ruler":"Overview Ruler","HTML Tag":"HTML Tag","Annotation Ruler":"Annotation Ruler","Show Guide":"Show Guide","Check Guide":"Check Guide",Cancel:"Cancel","Revert Theme":"Revert Theme","Update Theme":"Update Theme","Theme:":"Theme:",clickDiagram:"Click diagram to style.",clickUpdate:"Click Update button to save preview.","CSS Class Name":"CSS Class Name","CSS Attribute":"CSS Attribute","CSS Value":"CSS Value","CSS Text":"CSS Text","COLOR:":"Color:","NEW COLOR:":"New Color:",Ok:"Ok","OR HEX:":"Or Hex: "});
-define("orion/settings/nls/messages",["orion/i18n!orion/settings/nls/messages","orion/settings/nls/root/messages"],function(g,n){var p={root:n};Object.keys(g).forEach(function(b){"undefined"===typeof p[b]&&(p[b]=g[b])});return p});
-define("orion/widgets/themes/editor/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme"],function(g,n){function p(){}function b(){this.styles=[];var b=new p;b.name="Eclipse";b.annotationRuler="white";b.background="white";b.comment="green";b.keyword="#7f0055";b.text="darkSlateGray";b.string="blue";b.overviewRuler="white";b.lineNumberOdd="#444";b.lineNumberEven="#444";b.lineNumber="#444";b.currentLine="#EAF2FE";b.tag="darkorange";b.attribute="cadetBlue";b.fontFamily=f;b.fontSize=
-e;this.styles.push(b);b=new p;b.name="Prospecto";b.annotationRuler="white";b.background="white";b.comment="#3C802C";b.keyword="#CC4C07";b.text="#333";b.string="#446FBD";b.overviewRuler="white";b.lineNumberOdd="silver";b.lineNumberEven="silver";b.lineNumber="silver";b.currentLine="#EAF2FE";b.tag="#CC4C07";b.attribute="cadetBlue";b.fontFamily=f;b.fontSize=e;this.styles.push(b);b=new p;b.name="Blue";b.annotationRuler="lavender";b.background="aliceBlue";b.comment="indigo";b.keyword="cornFlowerBlue";b.text=
-"navy";b.string="cornFlowerBlue";b.overviewRuler="lavender";b.lineNumberOdd="darkSlateGray";b.lineNumberEven="darkSlateGray";b.lineNumber="darkSlateGray";b.currentLine="white";b.tag="cornFlowerBlue";b.attribute="cadetBlue";b.fontFamily=f;b.fontSize=e;this.styles.push(b);b=new p;b.name="Ambience";b.annotationRuler="#3D3D3D";b.background="#202020";b.comment="mediumslateblue";b.keyword="cornFlowerBlue";b.text="darkseagreen";b.string="lightcoral";b.overviewRuler="white";b.lineNumberOdd="black";b.lineNumberEven=
-"black";b.lineNumber="black";b.currentLine="lightcyan";b.tag="cornFlowerBlue";b.attribute="cadetBlue";b.fontFamily=f;b.fontSize=e;this.styles.push(b);b=new p;b.name="Tierra";b.annotationRuler="moccasin";b.background="lemonchiffon";b.comment="darkseagreen";b.keyword="darkred";b.text="#555555";b.string="orangered";b.overviewRuler="moccasin";b.lineNumberOdd="chocolate";b.lineNumberEven="chocolate";b.lineNumber="chocolate";b.currentLine="#baa289";b.tag="darkred";b.attribute="cadetBlue";b.fontFamily=f;
-b.fontSize=e;this.styles.push(b);b=new p;b.name="Nimbus";b.annotationRuler="#444";b.background="dimgray";b.comment="darkseagreen";b.keyword="darkorange";b.text="white";b.string="cornflowerblue";b.overviewRuler="#444";b.lineNumberOdd="#aaa";b.lineNumberEven="#aaa";b.lineNumber="#aaa";b.currentLine="#aabfbb";b.tag="darkorange";b.attribute="cadetBlue";b.fontFamily=f;b.fontSize=e;this.styles.push(b);b=new p;b.name="Adelante";b.annotationRuler="#E2D2B2";b.background="#F1E7C8";b.comment="#5D774E";b.keyword=
-"#AF473B";b.text="dimgray";b.string="#DE5D3B";b.overviewRuler="#E2D2B2";b.lineNumberOdd="#AF473B";b.lineNumberEven="#AF473B";b.lineNumber="#AF473B";b.currentLine="#9e937b";b.tag="#AF473B";b.attribute="cadetBlue";b.fontFamily=f;b.fontSize=e;this.styles.push(b);b=new p;b.name="Raspberry Pi";b.annotationRuler="seashell";b.background="seashell";b.comment="#66B32F";b.keyword="#E73E36";b.text="dimgray";b.string="darkorange";b.overviewRuler="seashell";b.lineNumberOdd="#E73E36";b.lineNumberEven="#E73E36";
-b.lineNumber="#E73E36";b.currentLine="#F5B1AE";b.tag="#E73E36";b.attribute="cadetBlue";b.fontFamily=f;b.fontSize=e;this.styles.push(b)}function l(){return this.styles}var f='"Consolas", "Monaco", "Vera Mono", "monospace"',e="10pt";b.prototype.styles=[];b.prototype.getStyles=l;b.prototype.fontSettable=!0;b.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"editorstyles",defaultTheme:"Prospecto",selectedKey:"editorSelected"}};b.prototype.parseToXML=function(b){try{var e=null;
-if(window.DOMParser){var e=(new DOMParser).parseFromString(b,"text/xml"),c=e.getElementsByTagName("parsererror");return!c||!c.length||!c[0].childNodes.length?e:null}e=new ActiveXObject("Microsoft.XMLDOM");e.async=!1;e.loadXML(b);return e}catch(a){}};b.prototype.selectFontSize=function(b){console.log("fontsize: "+b)};b.prototype.importTheme=function(b){console.log("import theme");console.log(b);var e=b.parameters.valueFor("name"),e=this.parseToXML(e),c=new p;c.name=e.getElementsByTagName("colorTheme")[0].attributes[1].value;
+define("orion/settings/nls/messages",["orion/i18n!orion/settings/nls/messages","orion/settings/nls/root/messages"],function(g,n){var p={root:n};Object.keys(g).forEach(function(a){"undefined"===typeof p[a]&&(p[a]=g[a])});return p});
+define("orion/widgets/themes/editor/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme"],function(g,n){function p(){}function a(){this.styles=[];var a=new p;a.name="Eclipse";a.annotationRuler="white";a.background="white";a.comment="green";a.keyword="#7f0055";a.text="darkSlateGray";a.string="blue";a.overviewRuler="white";a.lineNumberOdd="#444";a.lineNumberEven="#444";a.lineNumber="#444";a.currentLine="#EAF2FE";a.tag="darkorange";a.attribute="cadetBlue";a.fontFamily=f;a.fontSize=
+e;this.styles.push(a);a=new p;a.name="Prospecto";a.annotationRuler="white";a.background="white";a.comment="#3C802C";a.keyword="#CC4C07";a.text="#333";a.string="#446FBD";a.overviewRuler="white";a.lineNumberOdd="silver";a.lineNumberEven="silver";a.lineNumber="silver";a.currentLine="#EAF2FE";a.tag="#CC4C07";a.attribute="cadetBlue";a.fontFamily=f;a.fontSize=e;this.styles.push(a);a=new p;a.name="Blue";a.annotationRuler="lavender";a.background="aliceBlue";a.comment="indigo";a.keyword="cornFlowerBlue";a.text=
+"navy";a.string="cornFlowerBlue";a.overviewRuler="lavender";a.lineNumberOdd="darkSlateGray";a.lineNumberEven="darkSlateGray";a.lineNumber="darkSlateGray";a.currentLine="white";a.tag="cornFlowerBlue";a.attribute="cadetBlue";a.fontFamily=f;a.fontSize=e;this.styles.push(a);a=new p;a.name="Ambience";a.annotationRuler="#3D3D3D";a.background="#202020";a.comment="mediumslateblue";a.keyword="cornFlowerBlue";a.text="darkseagreen";a.string="lightcoral";a.overviewRuler="white";a.lineNumberOdd="black";a.lineNumberEven=
+"black";a.lineNumber="black";a.currentLine="lightcyan";a.tag="cornFlowerBlue";a.attribute="cadetBlue";a.fontFamily=f;a.fontSize=e;this.styles.push(a);a=new p;a.name="Tierra";a.annotationRuler="moccasin";a.background="lemonchiffon";a.comment="darkseagreen";a.keyword="darkred";a.text="#555555";a.string="orangered";a.overviewRuler="moccasin";a.lineNumberOdd="chocolate";a.lineNumberEven="chocolate";a.lineNumber="chocolate";a.currentLine="#baa289";a.tag="darkred";a.attribute="cadetBlue";a.fontFamily=f;
+a.fontSize=e;this.styles.push(a);a=new p;a.name="Nimbus";a.annotationRuler="#444";a.background="dimgray";a.comment="darkseagreen";a.keyword="darkorange";a.text="white";a.string="cornflowerblue";a.overviewRuler="#444";a.lineNumberOdd="#aaa";a.lineNumberEven="#aaa";a.lineNumber="#aaa";a.currentLine="#aabfbb";a.tag="darkorange";a.attribute="cadetBlue";a.fontFamily=f;a.fontSize=e;this.styles.push(a);a=new p;a.name="Adelante";a.annotationRuler="#E2D2B2";a.background="#F1E7C8";a.comment="#5D774E";a.keyword=
+"#AF473B";a.text="dimgray";a.string="#DE5D3B";a.overviewRuler="#E2D2B2";a.lineNumberOdd="#AF473B";a.lineNumberEven="#AF473B";a.lineNumber="#AF473B";a.currentLine="#9e937b";a.tag="#AF473B";a.attribute="cadetBlue";a.fontFamily=f;a.fontSize=e;this.styles.push(a);a=new p;a.name="Raspberry Pi";a.annotationRuler="seashell";a.background="seashell";a.comment="#66B32F";a.keyword="#E73E36";a.text="dimgray";a.string="darkorange";a.overviewRuler="seashell";a.lineNumberOdd="#E73E36";a.lineNumberEven="#E73E36";
+a.lineNumber="#E73E36";a.currentLine="#F5B1AE";a.tag="#E73E36";a.attribute="cadetBlue";a.fontFamily=f;a.fontSize=e;this.styles.push(a)}function l(){return this.styles}var f='"Consolas", "Monaco", "Vera Mono", "monospace"',e="10pt";a.prototype.styles=[];a.prototype.getStyles=l;a.prototype.fontSettable=!0;a.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"editorstyles",defaultTheme:"Prospecto",selectedKey:"editorSelected"}};a.prototype.parseToXML=function(a){try{var e=null;
+if(window.DOMParser){var e=(new DOMParser).parseFromString(a,"text/xml"),c=e.getElementsByTagName("parsererror");return!c||!c.length||!c[0].childNodes.length?e:null}e=new ActiveXObject("Microsoft.XMLDOM");e.async=!1;e.loadXML(a);return e}catch(b){}};a.prototype.selectFontSize=function(a){console.log("fontsize: "+a)};a.prototype.importTheme=function(a){console.log("import theme");console.log(a);var e=a.parameters.valueFor("name"),e=this.parseToXML(e),c=new p;c.name=e.getElementsByTagName("colorTheme")[0].attributes[1].value;
 c.annotationRuler=e.getElementsByTagName("background")[0].attributes[0].value;c.background=e.getElementsByTagName("background")[0].attributes[0].value;c.comment=e.getElementsByTagName("singleLineComment")[0].attributes[0].value;c.keyword=e.getElementsByTagName("keyword")[0].attributes[0].value;c.text=e.getElementsByTagName("foreground")[0].attributes[0].value;c.string=e.getElementsByTagName("string")[0].attributes[0].value;c.overviewRuler=e.getElementsByTagName("background")[0].attributes[0].value;
-c.lineNumberOdd=e.getElementsByTagName("lineNumber")[0].attributes[0].value;c.lineNumberEven=e.getElementsByTagName("lineNumber")[0].attributes[0].value;c.lineNumber=e.getElementsByTagName("lineNumber")[0].attributes[0].value;c.currentLine=e.getElementsByTagName("selectionBackground")[0].attributes[0].value;b.items.addTheme(c)};b.prototype.processSettings=function(b){var e=n.TextTheme.getTheme();e.setThemeClass("editorTheme",e.buildStyleSheet("editorTheme",b))};b.prototype.getViewData=function(){var b=
-{top:10,left:10,width:400,height:350},e=b.left,c=b.top;b.shapes=[{type:"TEXT",name:g["Line Numbers"],label:"1",x:e+20,y:c+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"},{type:"RECTANGLE",name:g.Background,x:e+46,y:c,width:290,height:b.height,family:"background",fill:"white"},{type:"TEXT",name:g.Strings,label:"'text/javascript'",x:e+134,y:c+20,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:"=",x:e+124,y:c+20,fill:"darkSlateGray",family:"text",
-font:"9pt sans-serif"},{type:"RECTANGLE",name:g["Current Line"],x:e+46,y:c+87,width:290,height:18,family:"currentLine",fill:"#eaf2fd"},{type:"TEXT",name:g["HTML Attribute"],label:"type",x:e+98,y:c+20,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"RECTANGLE",name:g["Overview Ruler"],x:e+336,y:c,width:14,height:b.height,family:"overviewRuler",fill:"white"},{type:"TEXT",name:g.Comments,label:"/* comment */",x:e+75,y:c+40,fill:"darkSeaGreen",family:"comment",font:"9pt sans-serif"},{type:"TEXT",
+c.lineNumberOdd=e.getElementsByTagName("lineNumber")[0].attributes[0].value;c.lineNumberEven=e.getElementsByTagName("lineNumber")[0].attributes[0].value;c.lineNumber=e.getElementsByTagName("lineNumber")[0].attributes[0].value;c.currentLine=e.getElementsByTagName("selectionBackground")[0].attributes[0].value;a.items.addTheme(c)};a.prototype.processSettings=function(a){var e=n.TextTheme.getTheme();e.setThemeClass("editorTheme",e.buildStyleSheet("editorTheme",a))};a.prototype.getViewData=function(){var a=
+{top:10,left:10,width:400,height:350},e=a.left,c=a.top;a.shapes=[{type:"TEXT",name:g["Line Numbers"],label:"1",x:e+20,y:c+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"},{type:"RECTANGLE",name:g.Background,x:e+46,y:c,width:290,height:a.height,family:"background",fill:"white"},{type:"TEXT",name:g.Strings,label:"'text/javascript'",x:e+134,y:c+20,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:"=",x:e+124,y:c+20,fill:"darkSlateGray",family:"text",
+font:"9pt sans-serif"},{type:"RECTANGLE",name:g["Current Line"],x:e+46,y:c+87,width:290,height:18,family:"currentLine",fill:"#eaf2fd"},{type:"TEXT",name:g["HTML Attribute"],label:"type",x:e+98,y:c+20,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"RECTANGLE",name:g["Overview Ruler"],x:e+336,y:c,width:14,height:a.height,family:"overviewRuler",fill:"white"},{type:"TEXT",name:g.Comments,label:"/* comment */",x:e+75,y:c+40,fill:"darkSeaGreen",family:"comment",font:"9pt sans-serif"},{type:"TEXT",
 name:g["HTML Tag"],label:"<script",x:e+55,y:c+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g["HTML Tag"],label:">",x:e+213,y:c+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g.Strings,label:"'Result'",x:e+164,y:c+80,fill:"cornflowerBlue",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:"multiply(a,b){",x:e+120,y:c+60,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g.Keywords,label:"function",
 x:e+75,y:c+60,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g.Keywords,label:"var",x:e+95,y:c+80,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:"output = ",x:e+115,y:c+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:";",x:e+205,y:c+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g.Keywords,label:"var",x:e+95,y:c+100,fill:"darkorange",family:"keyword",
 font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:"result = a*b;",x:e+115,y:c+100,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g.Keywords,label:"return",x:e+95,y:c+120,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:"output + result;",x:e+135,y:c+120,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:"}",x:e+75,y:c+140,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},
 {type:"TEXT",name:g["HTML Tag"],label:"<\/script>",x:e+55,y:c+160,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g["HTML Tag"],label:"<style",x:e+55,y:c+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g["HTML Attribute"],label:"type",x:e+95,y:c+200,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:"=",x:e+121,y:c+200,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g.Strings,
 label:"'text/css'",x:e+131,y:c+200,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:g["HTML Tag"],label:">",x:e+180,y:c+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g["CSS Class Name"],label:".some-class",x:e+75,y:c+220,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g["CSS Class Name"],label:"{",x:e+145,y:c+220,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g["CSS Attribute"],label:"color:",
 x:e+95,y:c+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g["CSS Value"],label:"#123456",x:e+130,y:c+240,fill:"darkSlateGray",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:g["CSS Text"],label:";",x:e+180,y:c+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g["CSS Class Name"],label:"}",x:e+75,y:c+260,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g["HTML Tag"],label:"</style>",x:e+55,y:c+280,fill:"darkorange",
-family:"keyword",font:"9pt sans-serif"},{type:"RECTANGLE",name:g["Annotation Ruler"],x:e,y:c,width:46,height:b.height,family:"annotationRuler",fill:"white"}];for(var a=0;16>a;a++)b.shapes.push({type:"TEXT",name:g["Line Numbers"],label:a+1,x:e+20,y:c+20*a+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"});return b};return{ThemeData:b,getStyles:l}});
-define("orion/widgets/browse/readonlyEditorView","orion/editor/editor orion/editor/textView orion/editor/textModel orion/editor/projectionTextModel orion/editor/editorFeatures orion/editorPreferences orion/widgets/themes/ThemePreferences orion/widgets/themes/editor/ThemeData orion/objects".split(" "),function(g,n,p,b,l,f,e,d,h){function c(a){this._parent=a.parent;this.renderToolbars=a.renderToolbars;this.inputManager=a.inputManager;this.preferences=a.preferences;this.statusReporter=a.statusReporter;
-this.model=a.model;this.syntaxHighlighter=a.syntaxHighlighter;this.readonly=!0;this.settings={};this._init()}c.prototype={getParent:function(){return this._parent},updateViewOptions:function(a){var b=0;a.showMargin&&(b=a.marginOffset,"number"!==typeof b&&(b=a.marginOffset=parseInt(b,10)));var c=0;a.wordWrap&&(c=b);return{readonly:this.readonly||this.inputManager.getReadOnly(),tabSize:a.tabSize||4,expandTab:a.expandTab,wrapMode:a.wordWrap,wrapOffset:c,marginOffset:b,scrollAnimation:a.scrollAnimation?
-a.scrollAnimationTimeout:0}},updateSettings:function(a){this.settings=a;var b=this.editor,c=this.inputManager;c.setAutoLoadEnabled(a.autoLoad);c.setAutoSaveTimeout(a.autoSave?a.autoSaveTimeout:-1);c.setSaveDiffsEnabled(a.saveDiffs);this.updateStyler(a);var d=b.getTextView();d&&d.setOptions(this.updateViewOptions(a));b.setAnnotationRulerVisible(a.annotationRuler);b.setLineNumberRulerVisible(a.lineNumberRuler);b.setFoldingRulerVisible(a.foldingRuler);b.setOverviewRulerVisible(a.overviewRuler);this.renderToolbars&&
-this.renderToolbars(c.getFileMetadata())},updateStyler:function(a){var b=this.syntaxHighlighter.getStyler();b&&(b.setTabsVisible&&b.setTabsVisible(a.showTabs),b.setSpacesVisible&&b.setSpacesVisible(a.showSpaces))},_init:function(){var a=null;this.preferences&&(a=this.editorPreferences=new f.EditorPreferences(this.preferences,function(b){b?this.updateSettings(b):a.getPrefs(this.updateSettings.bind(this))}.bind(this)));var c=null;this.preferences&&(c=new e.ThemePreferences(this.preferences,new d.ThemeData),
-c.apply());var m=this._parent,c=this.inputManager,r=function(){var a=this.updateViewOptions(this.settings);h.mixin(a,{parent:m,model:new b.ProjectionTextModel(this.model||new p.TextModel)});return new n.TextView(a)}.bind(this),w=this.editor=new g.Editor({textViewFactory:r,annotationFactory:new l.AnnotationFactory,foldingRulerFactory:new l.FoldingRulerFactory,lineNumberRulerFactory:new l.LineNumberRulerFactory,statusReporter:this.statusReporter,domNode:m});w.id="orion.editor";c.addEventListener("InputChanged",
-function(a){var b=w.getTextView();b&&(b.setOptions(this.updateViewOptions(this.settings)),this.syntaxHighlighter.setup(a.contentType,w.getTextView(),w.getAnnotationModel(),a.title,!0).then(function(){this.updateStyler(this.settings)}.bind(this)))}.bind(this));this.editorPreferences?this.editorPreferences.getPrefs(this.updateSettings.bind(this)):w.setAnnotationRulerVisible(!1)},create:function(){this.editor.install()},destroy:function(){this.editor.uninstall()},getStyleAccessor:function(){this.syntaxHighlighter.getStyler().getStyleAccessor()}};
+family:"keyword",font:"9pt sans-serif"},{type:"RECTANGLE",name:g["Annotation Ruler"],x:e,y:c,width:46,height:a.height,family:"annotationRuler",fill:"white"}];for(var b=0;16>b;b++)a.shapes.push({type:"TEXT",name:g["Line Numbers"],label:b+1,x:e+20,y:c+20*b+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"});return a};return{ThemeData:a,getStyles:l}});
+define("orion/widgets/browse/readonlyEditorView","orion/editor/editor orion/editor/textView orion/editor/textModel orion/editor/projectionTextModel orion/editor/editorFeatures orion/editorPreferences orion/widgets/themes/ThemePreferences orion/widgets/themes/editor/ThemeData orion/objects".split(" "),function(g,n,p,a,l,f,e,d,h){function c(a){this._parent=a.parent;this.renderToolbars=a.renderToolbars;this.inputManager=a.inputManager;this.preferences=a.preferences;this.statusReporter=a.statusReporter;
+this.model=a.model;this.syntaxHighlighter=a.syntaxHighlighter;this.readonly=!0;this.settings={};this._init()}c.prototype={getParent:function(){return this._parent},updateViewOptions:function(a){var c=0;a.showMargin&&(c=a.marginOffset,"number"!==typeof c&&(c=a.marginOffset=parseInt(c,10)));var d=0;a.wordWrap&&(d=c);return{readonly:this.readonly||this.inputManager.getReadOnly(),tabSize:a.tabSize||4,expandTab:a.expandTab,wrapMode:a.wordWrap,wrapOffset:d,marginOffset:c,scrollAnimation:a.scrollAnimation?
+a.scrollAnimationTimeout:0}},updateSettings:function(a){this.settings=a;var c=this.editor,d=this.inputManager;d.setAutoLoadEnabled(a.autoLoad);d.setAutoSaveTimeout(a.autoSave?a.autoSaveTimeout:-1);d.setSaveDiffsEnabled(a.saveDiffs);this.updateStyler(a);var e=c.getTextView();e&&e.setOptions(this.updateViewOptions(a));c.setAnnotationRulerVisible(a.annotationRuler);c.setLineNumberRulerVisible(a.lineNumberRuler);c.setFoldingRulerVisible(a.foldingRuler);c.setOverviewRulerVisible(a.overviewRuler);this.renderToolbars&&
+this.renderToolbars(d.getFileMetadata())},updateStyler:function(a){var c=this.syntaxHighlighter.getStyler();c&&(c.setTabsVisible&&c.setTabsVisible(a.showTabs),c.setSpacesVisible&&c.setSpacesVisible(a.showSpaces))},_init:function(){var b=null;this.preferences&&(b=this.editorPreferences=new f.EditorPreferences(this.preferences,function(a){a?this.updateSettings(a):b.getPrefs(this.updateSettings.bind(this))}.bind(this)));var c=null;this.preferences&&(c=new e.ThemePreferences(this.preferences,new d.ThemeData),
+c.apply());var m=this._parent,c=this.inputManager,r=function(){var b=this.updateViewOptions(this.settings);h.mixin(b,{parent:m,model:new a.ProjectionTextModel(this.model||new p.TextModel)});return new n.TextView(b)}.bind(this),x=this.editor=new g.Editor({textViewFactory:r,annotationFactory:new l.AnnotationFactory,foldingRulerFactory:new l.FoldingRulerFactory,lineNumberRulerFactory:new l.LineNumberRulerFactory,statusReporter:this.statusReporter,domNode:m});x.id="orion.editor";c.addEventListener("InputChanged",
+function(a){var b=x.getTextView();b&&(b.setOptions(this.updateViewOptions(this.settings)),this.syntaxHighlighter.setup(a.contentType,x.getTextView(),x.getAnnotationModel(),a.title,!0).then(function(){this.updateStyler(this.settings)}.bind(this)))}.bind(this));this.editorPreferences?this.editorPreferences.getPrefs(this.updateSettings.bind(this)):x.setAnnotationRulerVisible(!1)},create:function(){this.editor.install()},destroy:function(){this.editor.uninstall()},getStyleAccessor:function(){this.syntaxHighlighter.getStyler().getStyleAccessor()}};
 return{ReadonlyEditorView:c}});
-define("orion/widgets/browse/branchSelector",["orion/objects","orion/webui/littlelib","orion/commands","orion/URITemplate","orion/URL-shim"],function(g,n,p,b){function l(b){this.commandRegistry=b.commandRegistry;this.branchChangeListener=b.branchChangeListener;this.branchChangeDispatcher=b.branchChangeDispatcher;this.fileClient=b.fileClient;this.branches=b.branches;this.fileBrowser=b.fileBrowser;this.activeBranchName=b.activeBranchName;this.node=b.node;this.listener=function(b){this.refresh(b.root)}.bind(this);
-this.branchChangeListener&&this.branchChangeListener.addEventListener("branchChanged",this.listener);this.render()}var f=new b("#{,resource,params*}");g.mixin(l.prototype,{destroy:function(){this.branchChangeListener&&this.branchChangeListener.removeEventListener("branchChanged",this.listener);this.commandRegistry.destroy(this.node);n.empty(this.node);this.branchChangeListener=this.branchChangeDispatcher=this.listener=this.node=null},registerCommands:function(){if(!this.commandsRegistered){this.commandsRegistered=
-!0;var b=this.commandRegistry,d=new p.Command({imageClass:"core-sprite-openarrow",id:"orion.browse.switchbr",visibleWhen:function(){return!0},choiceCallback:this._switchBrMenuCallback.bind(this),positioningNode:this.node});b.addCommand(d);b.registerCommandContribution("orion.browse","orion.browse.switchbr",1)}},_switchBrMenuCallback:function(){var b=this;return this.branches.map(function(d){return{name:d.Name,callback:b.setActiveBranch.bind(b,d.Name,d.Location)}})},render:function(){this.brName=document.createElement("div");
-this.brName.classList.add("browserBranchName");this.brName.classList.add("layoutLeft");this.menu=document.createElement("ul");this.menu.classList.add("BranchSelector");this.menu.classList.add("commandList");this.menu.classList.add("layoutRight");this.menu.classList.add("pageActions");this.node.appendChild(this.brName);this.node.appendChild(this.menu);this.registerCommands();this.brName.addEventListener("click",this._openMenu.bind(this))},_openMenu:function(){var b=n.$(".dropdownTrigger",this.menu);
-if(b){var d=document.createEvent("MouseEvents");d.initEvent("click",!0,!0);b.dispatchEvent(d)}},_branchLabel:function(){var b=document.createDocumentFragment();b.textContent=this.activeBranchName;return b},refresh:function(b){n.empty(this.brName);this.brName.appendChild(this._branchLabel(b));this.commandRegistry.destroy(this.menu);this.commandRegistry.renderCommands("orion.browse",this.menu,{},"menu")},setActiveBranch:function(b,d){this.activeBranchName=b;window.location=f.expand({resource:d});this.branchChangeDispatcher&&
+define("orion/widgets/browse/branchSelector",["orion/objects","orion/webui/littlelib","orion/commands","orion/URITemplate","orion/URL-shim"],function(g,n,p,a){function l(a){this.commandRegistry=a.commandRegistry;this.branchChangeListener=a.branchChangeListener;this.branchChangeDispatcher=a.branchChangeDispatcher;this.fileClient=a.fileClient;this.branches=a.branches;this.fileBrowser=a.fileBrowser;this.activeBranchName=a.activeBranchName;this.node=a.node;this.listener=function(a){this.refresh(a.root)}.bind(this);
+this.branchChangeListener&&this.branchChangeListener.addEventListener("branchChanged",this.listener);this.render()}var f=new a("#{,resource,params*}");g.mixin(l.prototype,{destroy:function(){this.branchChangeListener&&this.branchChangeListener.removeEventListener("branchChanged",this.listener);this.commandRegistry.destroy(this.node);n.empty(this.node);this.branchChangeListener=this.branchChangeDispatcher=this.listener=this.node=null},registerCommands:function(){if(!this.commandsRegistered){this.commandsRegistered=
+!0;var a=this.commandRegistry,d=new p.Command({imageClass:"core-sprite-openarrow",id:"orion.browse.switchbr",visibleWhen:function(){return!0},choiceCallback:this._switchBrMenuCallback.bind(this),positioningNode:this.node});a.addCommand(d);a.registerCommandContribution("orion.browse","orion.browse.switchbr",1)}},_switchBrMenuCallback:function(){var a=this;return this.branches.map(function(d){return{name:d.Name,callback:a.setActiveBranch.bind(a,d.Name,d.Location)}})},render:function(){this.brName=document.createElement("div");
+this.brName.classList.add("browserBranchName");this.brName.classList.add("layoutLeft");this.menu=document.createElement("ul");this.menu.classList.add("BranchSelector");this.menu.classList.add("commandList");this.menu.classList.add("layoutRight");this.menu.classList.add("pageActions");this.node.appendChild(this.brName);this.node.appendChild(this.menu);this.registerCommands();this.brName.addEventListener("click",this._openMenu.bind(this))},_openMenu:function(){var a=n.$(".dropdownTrigger",this.menu);
+if(a){var d=document.createEvent("MouseEvents");d.initEvent("click",!0,!0);a.dispatchEvent(d)}},_branchLabel:function(){var a=document.createDocumentFragment();a.textContent=this.activeBranchName;return a},refresh:function(a){n.empty(this.brName);this.brName.appendChild(this._branchLabel(a));this.commandRegistry.destroy(this.menu);this.commandRegistry.renderCommands("orion.browse",this.menu,{},"menu")},setActiveBranch:function(a,d){this.activeBranchName=a;window.location=f.expand({resource:d});this.branchChangeDispatcher&&
 this.branchChangeDispatcher.dispatchEvent({type:"branchChanged",newInput:d})}});return{BranchSelector:l}});
-define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(g,n,p){function b(b,d,f){if(!b[d])throw d+g[" is not supported in this file system"];return b[d].apply(b,f)}function l(e,d,f,c){if(!e.readBlob)throw g["source file service does not support binary read"];if(!f.writeBlob)throw g["target file service does not support binary write"];if("/"!==d[d.length-1])return b(e,"readBlob",[d]).then(function(a){return b(f,"writeBlob",[c,a])});var a=c.substring(0,
-c.length-1),k=decodeURIComponent(a.substring(a.lastIndexOf("/")+1)),a=a.substring(0,a.lastIndexOf("/")+1);return b(f,"createFolder",[a,k]).then(function(){},function(){}).then(function(){return b(e,"fetchChildren",[d]).then(function(a){for(var b=[],d=0;d<a.length;++d){var g=a[d].Location,k=g;a[d].Directory&&(k=g.substring(0,g.length-1));k=decodeURIComponent(k.substring(k.lastIndexOf("/")+1));k=c+encodeURIComponent(k);a[d].Directory&&(k+="/");b[d]=l(e,g,f,k)}return n.all(b)})})}function f(b,d){function f(a){var b=
-new n;b.reject(g["No Matching FileService for location:"]+a);return b}var c=b.getServiceReferences("orion.core.file"),a=c;if(d)for(var a=[],k=0;k<c.length;++k)d(c[k])&&a.push(c[k]);for(var l=[],r=[],w=[],v=[],t={fetchChildren:function(){var a=new n;a.resolve(v);return a},createWorkspace:function(){var a=new n;a.reject(g["no file service"]);return a},loadWorkspaces:function(){var a=new n;a.reject(g["no file service"]);return a},loadWorkspace:function(){var a=new n;window.setTimeout(function(){a.resolve({Directory:!0,
-Length:0,LocalTimeStamp:0,Name:g["File Servers"],Location:"/",Children:v,ChildrenLocation:"/"})},100);return a},search:f,createProject:f,createFolder:f,createFile:f,deleteFile:f,moveFile:f,copyFile:f,read:f,write:f},c=0;c<a.length;++c)v[c]={Directory:!0,Length:0,LocalTimeStamp:0,Location:a[c].getProperty("top"),ChildrenLocation:a[c].getProperty("top"),Name:a[c].getProperty("Name")},k=a[c].getProperty("pattern")||a[c].getProperty("top").replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"^"!==k[0]&&(k=
-"^"+k),l[c]=RegExp(k),r[c]=b.getService(a[c]),w[c]=a[c].getProperty("Name"),a[c].getProperty("NameKey")&&a[c].getProperty("nls")&&p.getMessageBundle(a[c].getProperty("nls")).then(function(b,c){v[b].Name=c[a[b].getProperty("NameKey")];w[b]=c[a[b].getProperty("NameKey")]}.bind(this,c));this._getServiceIndex=function(a){if("/"===a)return-1;if(!a||a.length&&0===a.length)return r[0]?0:-1;for(var b=0;b<l.length;++b)if(l[b].test(a))return b;throw g["No Matching FileService for location:"]+a;};this._getService=
-function(a){a=this._getServiceIndex(a);return-1===a?t:r[a]};this._getServiceName=function(a){a=this._getServiceIndex(a);return-1===a?t.Name:w[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return-1===a?t.Location:v[a].Location}}f.prototype={getService:function(b){return this._getService(b)},fileServiceName:function(b){return this._getServiceName(b)},fileServiceRootURL:function(b){return this._getServiceRootURL(b)},fetchChildren:function(e){return b(this._getService(e),"fetchChildren",
-arguments)},createWorkspace:function(e){return b(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return b(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(e){return b(this._getService(e),"loadWorkspace",arguments)},createProject:function(e,d,f,c){return b(this._getService(e),"createProject",arguments)},createFolder:function(e,d){return b(this._getService(e),"createFolder",arguments)},createFile:function(e,d){return b(this._getService(e),"createFile",
-arguments)},deleteFile:function(e){return b(this._getService(e),"deleteFile",arguments)},moveFile:function(e,d,f){var c=this._getService(e),a=this._getService(d);if(c===a)return b(c,"moveFile",arguments);var g="/"===e[e.length-1],m=d;"/"!==m[m.length-1]&&(m+="/");if(f)m+=encodeURIComponent(f);else{var n=e;g&&(n=n.substring(0,n.length-1));m+=n.substring(n.lastIndexOf("/")+1)}g&&"/"!==m[m.length-1]&&(m+="/");return l(c,e,a,m).then(function(){return b(c,"deleteFile",[e])})},copyFile:function(e,d,f){var c=
-this._getService(e),a=this._getService(d);if(c===a)return b(c,"copyFile",arguments);var g="/"===e[e.length-1],m=d;"/"!==m[m.length-1]&&(m+="/");if(f)m+=encodeURIComponent(f);else{var n=e;g&&(n=n.substring(0,n.length-1));m+=n.substring(n.lastIndexOf("/")+1)}g&&"/"!==m[m.length-1]&&(m+="/");return l(c,e,a,m)},read:function(e,d){return b(this._getService(e),"read",arguments)},readBlob:function(e){return b(this._getService(e),"readBlob",arguments)},write:function(e,d,f){return b(this._getService(e),"write",
-arguments)},remoteImport:function(e,d){return b(this._getService(e),"remoteImport",arguments)},remoteExport:function(e,d){return b(this._getService(e),"remoteExport",arguments)},search:function(e){return b(this._getService(e.resource),"search",arguments)}};f.prototype.constructor=f;return{FileClient:f}});
-define("orion/contentTypes",[],function(){function g(b,c){if("string"!==typeof b)return null;for(var a=b&&b.split(".").pop(),d=null,e=0;e<c.length;e++){var f=c[e],g;a:{g=d;var l=f,n=a,p=0<=l.filename.indexOf(b),s;s=n.toLowerCase();s=-1!==l.extension.indexOf(s);if(p||s){if(!(s=!g))p&&(n=n.toLowerCase(),p=-1!==g.extension.indexOf(n)),s=p;if(s){g=l;break a}}}g===f&&(d=f)}return d}function n(b){return null===b||"undefined"===typeof b?[]:Array.isArray(b)?b:[b]}function p(b){return{id:b.id,name:b.name,
-image:b.image,imageClass:b.imageClass,"extends":b["extends"],extension:n(b.extension).map(function(b){return String.prototype.toLowerCase.call(b)}),filename:n(b.filename)}}function b(b){var c=Object.create(null);b.map(p).forEach(function(a){Object.prototype.hasOwnProperty.call(c,a.id)||(c[a.id]=a)});return c}function l(g){if(g&&g.registerService){this.serviceRegistry=g;for(var c=g.getServiceReferences(e).concat(g.getServiceReferences(d)),a=[],k=0;k<c.length;k++)for(var l=n(c[k].getProperty("contentTypes")),
-p=0;p<l.length;p++)a.push(l[p]);this.map=b(a);g.registerService(f,this)}else if(Array.isArray(g))this.serviceRegistry=null,this.map=b(g);else throw Error("Invalid parameter");}var f="orion.core.contentTypeRegistry",e="orion.core.contenttype",d="orion.file.contenttype";l.prototype={getContentTypes:function(){var b=this.getContentTypesMap(),c=[],a;for(a in b)Object.prototype.hasOwnProperty.call(b,a)&&c.push(b[a]);return c},getContentTypesMap:function(){return this.map},getFileContentType:function(b){return g(b.Name,
-this.getContentTypes())},getFilenameContentType:function(b){return g(b,this.getContentTypes())},getContentType:function(b){return this.map[b]||null},isExtensionOf:function(b,c){b="string"===typeof b?this.getContentType(b):b;c="string"===typeof c?this.getContentType(c):c;if(!b||!c)return!1;if(b.id===c.id)return!0;for(var a=b,d={};a&&(a=this.getContentType(a["extends"]));){if(a.id===c.id)return!0;if(d[a.id])throw Error("Cycle: "+a.id);d[a.id]=!0}return!1},isSomeExtensionOf:function(b,c){for(var a=0;a<
-c.length;a++)if(this.isExtensionOf(b,c[a]))return!0;return!1}};return{ContentTypeRegistry:l,getFilenameContentType:g}});
+define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(g,n,p){function a(a,d,f){if(!a[d])throw d+g[" is not supported in this file system"];return a[d].apply(a,f)}function l(e,d,f,c){if(!e.readBlob)throw g["source file service does not support binary read"];if(!f.writeBlob)throw g["target file service does not support binary write"];if("/"!==d[d.length-1])return a(e,"readBlob",[d]).then(function(b){return a(f,"writeBlob",[c,b])});var b=c.substring(0,
+c.length-1),k=decodeURIComponent(b.substring(b.lastIndexOf("/")+1)),b=b.substring(0,b.lastIndexOf("/")+1);return a(f,"createFolder",[b,k]).then(function(){},function(){}).then(function(){return a(e,"fetchChildren",[d]).then(function(a){for(var b=[],d=0;d<a.length;++d){var g=a[d].Location,k=g;a[d].Directory&&(k=g.substring(0,g.length-1));k=decodeURIComponent(k.substring(k.lastIndexOf("/")+1));k=c+encodeURIComponent(k);a[d].Directory&&(k+="/");b[d]=l(e,g,f,k)}return n.all(b)})})}function f(a,d){function f(a){var b=
+new n;b.reject(g["No Matching FileService for location:"]+a);return b}var c=a.getServiceReferences("orion.core.file"),b=c;if(d)for(var b=[],k=0;k<c.length;++k)d(c[k])&&b.push(c[k]);for(var l=[],r=[],x=[],u=[],t={fetchChildren:function(){var a=new n;a.resolve(u);return a},createWorkspace:function(){var a=new n;a.reject(g["no file service"]);return a},loadWorkspaces:function(){var a=new n;a.reject(g["no file service"]);return a},loadWorkspace:function(){var a=new n;window.setTimeout(function(){a.resolve({Directory:!0,
+Length:0,LocalTimeStamp:0,Name:g["File Servers"],Location:"/",Children:u,ChildrenLocation:"/"})},100);return a},search:f,createProject:f,createFolder:f,createFile:f,deleteFile:f,moveFile:f,copyFile:f,read:f,write:f},c=0;c<b.length;++c)u[c]={Directory:!0,Length:0,LocalTimeStamp:0,Location:b[c].getProperty("top"),ChildrenLocation:b[c].getProperty("top"),Name:b[c].getProperty("Name")},k=b[c].getProperty("pattern")||b[c].getProperty("top").replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"^"!==k[0]&&(k=
+"^"+k),l[c]=RegExp(k),r[c]=a.getService(b[c]),x[c]=b[c].getProperty("Name"),b[c].getProperty("NameKey")&&b[c].getProperty("nls")&&p.getMessageBundle(b[c].getProperty("nls")).then(function(a,c){u[a].Name=c[b[a].getProperty("NameKey")];x[a]=c[b[a].getProperty("NameKey")]}.bind(this,c));this._getServiceIndex=function(a){if("/"===a)return-1;if(!a||a.length&&0===a.length)return r[0]?0:-1;for(var b=0;b<l.length;++b)if(l[b].test(a))return b;throw g["No Matching FileService for location:"]+a;};this._getService=
+function(a){a=this._getServiceIndex(a);return-1===a?t:r[a]};this._getServiceName=function(a){a=this._getServiceIndex(a);return-1===a?t.Name:x[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return-1===a?t.Location:u[a].Location}}f.prototype={getService:function(a){return this._getService(a)},fileServiceName:function(a){return this._getServiceName(a)},fileServiceRootURL:function(a){return this._getServiceRootURL(a)},fetchChildren:function(e){return a(this._getService(e),"fetchChildren",
+arguments)},createWorkspace:function(e){return a(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return a(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(e){return a(this._getService(e),"loadWorkspace",arguments)},createProject:function(e,d,f,c){return a(this._getService(e),"createProject",arguments)},createFolder:function(e,d){return a(this._getService(e),"createFolder",arguments)},createFile:function(e,d){return a(this._getService(e),"createFile",
+arguments)},deleteFile:function(e){return a(this._getService(e),"deleteFile",arguments)},moveFile:function(e,d,f){var c=this._getService(e),b=this._getService(d);if(c===b)return a(c,"moveFile",arguments);var g="/"===e[e.length-1],m=d;"/"!==m[m.length-1]&&(m+="/");if(f)m+=encodeURIComponent(f);else{var n=e;g&&(n=n.substring(0,n.length-1));m+=n.substring(n.lastIndexOf("/")+1)}g&&"/"!==m[m.length-1]&&(m+="/");return l(c,e,b,m).then(function(){return a(c,"deleteFile",[e])})},copyFile:function(e,d,f){var c=
+this._getService(e),b=this._getService(d);if(c===b)return a(c,"copyFile",arguments);var g="/"===e[e.length-1],m=d;"/"!==m[m.length-1]&&(m+="/");if(f)m+=encodeURIComponent(f);else{var n=e;g&&(n=n.substring(0,n.length-1));m+=n.substring(n.lastIndexOf("/")+1)}g&&"/"!==m[m.length-1]&&(m+="/");return l(c,e,b,m)},read:function(e,d){return a(this._getService(e),"read",arguments)},readBlob:function(e){return a(this._getService(e),"readBlob",arguments)},write:function(e,d,f){return a(this._getService(e),"write",
+arguments)},remoteImport:function(e,d){return a(this._getService(e),"remoteImport",arguments)},remoteExport:function(e,d){return a(this._getService(e),"remoteExport",arguments)},search:function(e){return a(this._getService(e.resource),"search",arguments)}};f.prototype.constructor=f;return{FileClient:f}});
+define("orion/contentTypes",[],function(){function g(a,c){if("string"!==typeof a)return null;for(var b=a&&a.split(".").pop(),d=null,e=0;e<c.length;e++){var f=c[e],g;a:{g=d;var l=f,n=b,p=0<=l.filename.indexOf(a),s;s=n.toLowerCase();s=-1!==l.extension.indexOf(s);if(p||s){if(!(s=!g))p&&(n=n.toLowerCase(),p=-1!==g.extension.indexOf(n)),s=p;if(s){g=l;break a}}}g===f&&(d=f)}return d}function n(a){return null===a||"undefined"===typeof a?[]:Array.isArray(a)?a:[a]}function p(a){return{id:a.id,name:a.name,
+image:a.image,imageClass:a.imageClass,"extends":a["extends"],extension:n(a.extension).map(function(a){return String.prototype.toLowerCase.call(a)}),filename:n(a.filename)}}function a(a){var c=Object.create(null);a.map(p).forEach(function(a){Object.prototype.hasOwnProperty.call(c,a.id)||(c[a.id]=a)});return c}function l(g){if(g&&g.registerService){this.serviceRegistry=g;for(var c=g.getServiceReferences(e).concat(g.getServiceReferences(d)),b=[],k=0;k<c.length;k++)for(var l=n(c[k].getProperty("contentTypes")),
+p=0;p<l.length;p++)b.push(l[p]);this.map=a(b);g.registerService(f,this)}else if(Array.isArray(g))this.serviceRegistry=null,this.map=a(g);else throw Error("Invalid parameter");}var f="orion.core.contentTypeRegistry",e="orion.core.contenttype",d="orion.file.contenttype";l.prototype={getContentTypes:function(){var a=this.getContentTypesMap(),c=[],b;for(b in a)Object.prototype.hasOwnProperty.call(a,b)&&c.push(a[b]);return c},getContentTypesMap:function(){return this.map},getFileContentType:function(a){return g(a.Name,
+this.getContentTypes())},getFilenameContentType:function(a){return g(a,this.getContentTypes())},getContentType:function(a){return this.map[a]||null},isExtensionOf:function(a,c){a="string"===typeof a?this.getContentType(a):a;c="string"===typeof c?this.getContentType(c):c;if(!a||!c)return!1;if(a.id===c.id)return!0;for(var b=a,d={};b&&(b=this.getContentType(b["extends"]));){if(b.id===c.id)return!0;if(d[b.id])throw Error("Cycle: "+b.id);d[b.id]=!0}return!1},isSomeExtensionOf:function(a,c){for(var b=0;b<
+c.length;b++)if(this.isExtensionOf(a,c[b]))return!0;return!1}};return{ContentTypeRegistry:l,getFilenameContentType:g}});
 define("orion/editor/textStyler",["orion/editor/annotations"],function(g){function n(a,b){this._unnamedCounter=0;this._patterns=[];this._rootId=b;a.forEach(function(a){a.patterns&&this._addPatterns(a.patterns,a.id)}.bind(this))}function p(a,b,c,d,e){this.start=a.start;this.end=a.end;this.contentStart=a.contentStart;this.contentEnd=a.contentEnd;this.pattern=b;this._styler=c;this._parent=e;this._linePatterns=[];this._blockPatterns=[];this._enclosurePatterns={};d&&(this._initPatterns(),this._subBlocks=
-y(d,d.getText(this.start,this.end),this,this.start))}function b(a){this._styler=a}function l(a,c,d,e){this.whitespacesVisible=this.spacesVisible=this.tabsVisible=!1;this.detectHyperlinks=!0;this.highlightCaretLine=!1;this.detectTasks=this.foldingEnabled=!0;this.view=a;this.annotationModel=c;this.patternManager=new n(d,e);this._accessor=new b(this);this._bracketAnnotations=void 0;var f=this;this._listener={onChanged:function(a){f._onModelChanged(a)},onDestroy:function(a){f._onDestroy(a)},onLineStyle:function(a){f._onLineStyle(a)},
-onMouseDown:function(a){f._onMouseDown(a)},onSelection:function(a){f._onSelection(a)}};c=a.getModel();c.getBaseModel&&(c=c.getBaseModel());c.addEventListener("Changed",this._listener.onChanged);a.addEventListener("MouseDown",this._listener.onMouseDown);a.addEventListener("Selection",this._listener.onSelection);a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("LineStyle",this._listener.onLineStyle);d=c.getCharCount();this._rootBlock=new p({start:0,contentStart:0,end:d,contentEnd:d},
-null,this,c);this._computeFolding(this._rootBlock.getBlocks());a.redrawLines()}var f={styleClass:"line_caret"},e=/$/,d=/\\(\d)/g,h=/(.*)(?:[\r\n]|$)/g,c={regex:/ /g,style:{styleClass:"punctuation separator space",unmergeable:!0}},a={regex:/\t/g,style:{styleClass:"punctuation separator tab",unmergeable:!0}},k=function(a,b,c,d){var e=c,f=a.lastIndex;h.lastIndex=c;var c=h.exec(b),g,k;a.lastIndex=0;if(c){k=c.index;for(g=b.charAt(k);0<=k&&"\n"!==g&&"\r"!==g;)k--,g=b.charAt(k);g=b.substring(k+1,c.index+
+y(d,d.getText(this.start,this.end),this,this.start))}function a(a){this._styler=a}function l(b,c,d,e){this.whitespacesVisible=this.spacesVisible=this.tabsVisible=!1;this.detectHyperlinks=!0;this.highlightCaretLine=!1;this.detectTasks=this.foldingEnabled=!0;this.view=b;this.annotationModel=c;this.patternManager=new n(d,e);this._accessor=new a(this);this._bracketAnnotations=void 0;var f=this;this._listener={onChanged:function(a){f._onModelChanged(a)},onDestroy:function(a){f._onDestroy(a)},onLineStyle:function(a){f._onLineStyle(a)},
+onMouseDown:function(a){f._onMouseDown(a)},onSelection:function(a){f._onSelection(a)}};c=b.getModel();c.getBaseModel&&(c=c.getBaseModel());c.addEventListener("Changed",this._listener.onChanged);b.addEventListener("MouseDown",this._listener.onMouseDown);b.addEventListener("Selection",this._listener.onSelection);b.addEventListener("Destroy",this._listener.onDestroy);b.addEventListener("LineStyle",this._listener.onLineStyle);d=c.getCharCount();this._rootBlock=new p({start:0,contentStart:0,end:d,contentEnd:d},
+null,this,c);this._computeFolding(this._rootBlock.getBlocks());b.redrawLines()}var f={styleClass:"line_caret"},e=/$/,d=/\\(\d)/g,h=/(.*)(?:[\r\n]|$)/g,c={regex:/ /g,style:{styleClass:"punctuation separator space",unmergeable:!0}},b={regex:/\t/g,style:{styleClass:"punctuation separator tab",unmergeable:!0}},k=function(a,b,c,d){var e=c,f=a.lastIndex;h.lastIndex=c;var c=h.exec(b),g,k;a.lastIndex=0;if(c){k=c.index;for(g=b.charAt(k);0<=k&&"\n"!==g&&"\r"!==g;)k--,g=b.charAt(k);g=b.substring(k+1,c.index+
 c[1].length);a.lastIndex=k=c.index-k-1}for(;c&&c.index<b.length;){var l;if(d){var m=a.lastIndex;a.test(g)&&(a.lastIndex=m,l=a.exec(g))}else l=a.exec(g);if(l)return l.index+=e,l.index-=k,a.lastIndex=f,l;k=0;e+=c[0].length;if(c=h.exec(b))g=c[1],a.lastIndex=0}a.lastIndex=f;return null},m=function(a,b,c,d){if(b=k(a.pattern.regex?a.pattern.regex:a.pattern.regexBegin,b,d,!0)){a.result=b;for(d=0;d<c.length;d++)if(b.index<c[d].result.index||b.index===c[d].result.index&&a.pattern.pattern.index<c[d].pattern.pattern.index){c.splice(d,
-0,a);return}c.push(a)}},r=function(a,b,c,d){for(var e=0,f=1;f<a.length;f++)if(a[f]){var g=b[f];if(g){var h=c+e;d.push({start:h,end:h+a[f].length,style:g.name})}e+=a[f].length}},w=function(a,b,c){var d=a.start;b.forEach(function(b){d<=b.start&&c.push({start:d,end:b.start,style:a.style});c.push(b);d=b.end});d<a.end&&c.push({start:d,end:a.end,style:a.style})},v=function(a,b,c,d,f){if(c=c.getLinePatterns()){var g=[];c.forEach(function(b){var c=b.regex||b.regexBegin;c.oldLastIndex=c.lastIndex;c.lastIndex=
+0,a);return}c.push(a)}},r=function(a,b,c,d){for(var e=0,f=1;f<a.length;f++)if(a[f]){var g=b[f];if(g){var h=c+e;d.push({start:h,end:h+a[f].length,style:g.name})}e+=a[f].length}},x=function(a,b,c){var d=a.start;b.forEach(function(b){d<=b.start&&c.push({start:d,end:b.start,style:a.style});c.push(b);d=b.end});d<a.end&&c.push({start:d,end:a.end,style:a.style})},u=function(a,b,c,d,f){if(c=c.getLinePatterns()){var g=[];c.forEach(function(b){var c=b.regex||b.regexBegin;c.oldLastIndex=c.lastIndex;c.lastIndex=
 0;(c=c.exec(a))&&g.push({result:c,pattern:b})});g.sort(function(a,b){return a.result.index<b.result.index?-1:a.result.index>b.result.index?1:a.pattern.pattern.index<b.pattern.pattern.index?-1:1});for(var h=0;0<g.length;){var k=g[0];g.splice(0,1);if(!(k.result.index<h)){var l=k.result.index,n,p=[];if(k.pattern.regex){h=k.result;n=l+h[0].length;n={start:b+l,end:b+n,style:k.pattern.pattern.name,isWhitespace:k.pattern.isWhitespace};if(!f){k.pattern.pattern.captures&&r(h,k.pattern.pattern.captures,b+l,
-p);p.sort(function(a,b){return a.start<b.start?-1:a.start>b.start?1:0});for(l=0;l<p.length-1;l++)if(p[l+1].start<p[l].end){var t={start:p[l+1].end,end:p[l].end,style:p[l].style};p[l].end=p[l+1].start;p.splice(l+2,0,t)}}w(n,p,d)}else k.pattern.regexEnd.lastIndex=k.result.index+k.result[0].length,h=k.pattern.regexEnd.exec(a),h||(e.lastIndex=0,h=e.exec(a)),n=h.index+h[0].length,d.push({start:b+l,end:b+n,style:k.pattern.pattern.name,isWhitespace:k.pattern.isWhitespace});h=h.index+h[0].length}m(k,a,g,
-h)}c.forEach(function(a){a=a.regex||a.regexBegin;a.lastIndex=a.oldLastIndex})}},t=function(a,b,c,d){if(b.detectTasks()){var e=b.getAnnotationModel();if(e){var f=g.AnnotationType.ANNOTATION_TASK,h=[],k=[];d.forEach(function(a){for(var b=e.getAnnotations(a.start,a.end);b.hasNext();){var d=b.next();d.type===f&&k.push(d)}if(a.getLinePatterns().length&&a.pattern.pattern.name&&0===a.pattern.pattern.name.indexOf("comment")){b=[];v(c.getText(a.contentStart,a.end),a.contentStart,a,b,!0);for(a=0;a<b.length;a++)"meta.annotation.task.todo"===
+p);p.sort(function(a,b){return a.start<b.start?-1:a.start>b.start?1:0});for(l=0;l<p.length-1;l++)if(p[l+1].start<p[l].end){var t={start:p[l+1].end,end:p[l].end,style:p[l].style};p[l].end=p[l+1].start;p.splice(l+2,0,t)}}x(n,p,d)}else k.pattern.regexEnd.lastIndex=k.result.index+k.result[0].length,h=k.pattern.regexEnd.exec(a),h||(e.lastIndex=0,h=e.exec(a)),n=h.index+h[0].length,d.push({start:b+l,end:b+n,style:k.pattern.pattern.name,isWhitespace:k.pattern.isWhitespace});h=h.index+h[0].length}m(k,a,g,
+h)}c.forEach(function(a){a=a.regex||a.regexBegin;a.lastIndex=a.oldLastIndex})}},t=function(a,b,c,d){if(b.detectTasks()){var e=b.getAnnotationModel();if(e){var f=g.AnnotationType.ANNOTATION_TASK,h=[],k=[];d.forEach(function(a){for(var b=e.getAnnotations(a.start,a.end);b.hasNext();){var d=b.next();d.type===f&&k.push(d)}if(a.getLinePatterns().length&&a.pattern.pattern.name&&0===a.pattern.pattern.name.indexOf("comment")){b=[];u(c.getText(a.contentStart,a.end),a.contentStart,a,b,!0);for(a=0;a<b.length;a++)"meta.annotation.task.todo"===
 b[a].style&&h.push(g.AnnotationType.createAnnotation(f,b[a].start,b[a].end,c.getText(b[a].start,b[a].end)))}}.bind(this));e.replaceAnnotations(k,h)}}},y=function(a,b,c,f){var g=[];c.getBlockPatterns().forEach(function(a){var c=k(a.regexBegin,b,0);c&&g.push({result:c,pattern:a})}.bind(this));g.sort(function(a,b){return a.result.index<b.result.index?-1:a.result.index>b.result.index?1:a.pattern.pattern.index<b.pattern.pattern.index?-1:1});if(!g.length)return g;for(var h=0,l=[];0<g.length;){var n=g[0];
-g.splice(0,1);if(!(n.result.index<h)){var r=a.getLineAtOffset(f+n.result.index),w=a.getLine(r),y=[];v(w,a.getLineStart(r),c,y);r=f+n.result.index;for(w=0;w<y.length;w++)if(y[w].start===r){var h=n.result.index+n.result[0].length,I=null,H=n.pattern.regexEnd,J=H.toString();d.lastIndex=0;if(d.test(J)){d.lastIndex=0;for(var D=d.exec(J);D;)J=J.replace(D[0],n.result[D[1]]||""),D=d.exec(J);H=RegExp(J.substring(1,J.length-2),"g")}for(D=h;!I;){D=k(H,b,D);D||(e.lastIndex=0,D=e.exec(b));var J=[],O=new p({start:r,
-end:f+D.index+D[0].length,contentStart:f+h,contentEnd:f+D.index},n.pattern,c.getStyler(),a,c);v(b.substring(h,D.index+D[0].length),h,O,J);if(!J.length||J[J.length-1].end<=D.index)I=O;D=D.index+D[0].length}l.push(I);h=I.end-f;break}w===y.length&&(h=n.result.index+1)}m(n,b,g,h)}t(f,c,a,l);return l};n.prototype={getPatterns:function(a){var b=[0],c={},d=RegExp((a?"string"===typeof a?a:a.qualifiedId:this._rootId)+"#[^#]+$"),e=[];this._patterns.forEach(function(a){d.test(a.qualifiedId)&&(a.include?e.push(a):
+g.splice(0,1);if(!(n.result.index<h)){var r=a.getLineAtOffset(f+n.result.index),x=a.getLine(r),y=[];u(x,a.getLineStart(r),c,y);r=f+n.result.index;for(x=0;x<y.length;x++)if(y[x].start===r){var h=n.result.index+n.result[0].length,I=null,H=n.pattern.regexEnd,J=H.toString();d.lastIndex=0;if(d.test(J)){d.lastIndex=0;for(var D=d.exec(J);D;)J=J.replace(D[0],n.result[D[1]]||""),D=d.exec(J);H=RegExp(J.substring(1,J.length-2),"g")}for(D=h;!I;){D=k(H,b,D);D||(e.lastIndex=0,D=e.exec(b));var J=[],O=new p({start:r,
+end:f+D.index+D[0].length,contentStart:f+h,contentEnd:f+D.index},n.pattern,c.getSty