From 6a37a823dfd42c26ec9fffd861abc13b80a09a7c Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 31 Oct 2014 14:28:33 +0000 Subject: [PATCH] Update orion to 7.0 release Closes #467 Version: http://download.eclipse.org/orion/drops/R-7.0-201410282256/index.html --- public/orion/built-editor.css | 295 ++++-- public/orion/built-editor.min.js | 1573 +++++++++++++++--------------- 2 files changed, 1021 insertions(+), 847 deletions(-) diff --git a/public/orion/built-editor.css b/public/orion/built-editor.css index 020457868..3d6408964 100644 --- a/public/orion/built-editor.css +++ b/public/orion/built-editor.css @@ -1,12 +1,12 @@ .textview { background-color: white; - font-family: "Consolas", "Monaco", "Vera Mono", "monospace"; - font-size: 10pt; + font-family: "Consolas", "Monaco", "Vera Mono", monospace; + font-size: 12px; min-width: 50px; min-height: 50px; } .textviewScroll { - padding: 1px 2px; + padding: 4px 2px 4px 2px; } .textviewContent { cursor: auto; @@ -17,6 +17,10 @@ .textviewRightRuler { border-left: 1px solid #eaeaea; } +.textviewInnerRightRuler { + border-left: 1px solid #eaeaea; + background-color: white; +} .textviewMarginRuler { border-left: 1px solid #eaeaea; } @@ -38,12 +42,41 @@ .ruler.overview { width: 14px; } +.ruler.zoom { + width: 100px; + height: 100%; +} .rulerLines { color: silver; } .rulerLines.even .rulerLines.odd { } +.rulerZoomWindow { + background-color: rgba(0, 0, 0, 0.1); + margin-left: 1px; + border: 1px solid #eee; + position: absolute; + width: calc(100% - 4px); + border-radius: 5px; + z-index: 100; +} +.textviewZoom { + font-size: 2px !important; + cursor: pointer; +} +.textviewZoom .textviewContent { + cursor: pointer; +} +.textviewZoom .textviewScroll { + padding: 0; +} +.textviewZoom .punctuation.separator.tab { + background-image: none; +} +.textviewZoom .punctuation.separator.space { + background-image: none; +} .tooltipTheme.textview { background-color: InfoBackground !important; color: InfoText !important; @@ -52,8 +85,8 @@ padding: 0px; } .textviewTooltip { - font-family: "Consolas", "Monaco", "Vera Mono", "monospace"; - font-size: 10pt; + font-family: "Consolas", "Monaco", "Vera Mono", monospace; + font-size: 12px; background-color: InfoBackground; color: InfoText; padding: 2px; @@ -79,8 +112,57 @@ .tooltipTheme .annotationLine.currentLine { background-color: transparent !important; } +.textViewFind { + background-color: #ddd; + position: absolute; + top: -50px; + right: -1000px; + border: 1px solid #aaa; + border-top: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; + padding: 2px; + z-index: 100; +} +.textViewFind.show { + top: 0; + right: 40px; + transition: top 0.3s ease-out; + -ms-transition: top 0.3s ease-out; + -moz-transition: top 0.3s ease-out; + -webkit-transition: top 0.3s ease-out; + -o-transition: top 0.3s ease-out; +} +.textViewFindButton { + margin-right: 1px; + margin-left: 0; +} +.textViewFindButton:first-child { + margin-left: 5px; +} +.textViewFindButton:last-child { + margin-right: 5px; +} +.textViewFindButton.checked { + color: blue; + text-decoration: underline; +} +.textViewReplaceInput { +} +.textViewFindInput { +} +.textViewFindCloseButton { + width: 16px; + height: 16px; + border-width: 0; + background-color: transparent; + vertical-align: baseline; + background-position: center; + background-repeat: no-repeat; + background-image: url(data:image/gif;base64,R0lGODlhEAAQAJEAAAAAAP///4CAgP///yH5BAEAAAMALAAAAAAQABAAAAIdnI+py+1vhECSyTluu9px+HkctnSdUh0pxLYuVAAAOw==); +} .contentassist { - font-size:9pt; + font-size:12px; display: none; background-color: white; position: fixed; @@ -89,13 +171,14 @@ z-index:100; cursor: default; min-width: 70px; - max-width: 350px; - max-height: 170px; + width: 350px; + height: 170px; overflow: hidden; white-space: nowrap; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 10px; line-height: 18px; + resize: both; } .contentassist:focus { outline: none; @@ -108,9 +191,9 @@ } .contentassist hr{ border: 0; - height: 0; - border-top: 1px solid rgba(0, 0, 0, 0.1); - border-bottom: 1px solid rgba(255, 255, 255, 0.3); + height: 0; + border-top: 1px solid rgba(0, 0, 0, 0.1); + border-bottom: 1px solid rgba(255, 255, 255, 0.3); } .contentassist .proposal-noemphasis-keyword { background-color: aliceblue; @@ -124,11 +207,11 @@ } .contentassist .proposal-noemphasis-title-keywords { background-color: aliceblue; - color: grey; + color: gray; } .contentassist .proposal-noemphasis-title { background-color: aliceblue; - color: grey; + color: gray; padding-top: 5px; } .contentassist .proposal-noemphasis-title::before { @@ -161,6 +244,7 @@ .contentassist .cloneProposal { box-shadow: rgba(0, 0, 0, 0.9) 2px 2px 8px; position: fixed; + visibility: visible; z-index: 1000; } .contentassist>div { @@ -168,77 +252,43 @@ } .cloneWrapper { display: block; + height: 0; overflow: visible; + visibility: hidden; + width: 0; z-index: 1000; } .contentassist.cloneWrapper:hover { overflow: visible; } -.comment.block.documentation, .comment-block-documentation { - color: #00008F; -} .comment { color: #3C802C; } -.constant.character.entity, .constant-character-entity { - font-style: normal; -} .constant { color: blue; } -.entity.name.function, .entity.name.type, .entity-name-function, .entity-name-type { - font-weight: bold; -} -.entity.name.tag, .entity-name-tag { - color: #CC4C07; -} -.entity.other.attribute.name, .entity-other-attribute-name { - color: #3C802C; -} .entity { color: #3f7f7f; } -.invalid.illegal, .invalid-illegal { - color: white; - background-color: red; -} -.invalid.deprecated, .invalid-deprecated { - text-decoration: line-through; -} .invalid { color: red; font-weight: bold; } -.keyword.other.documentation.markup { - color: #7F7F9F; -} -.keyword.other.documentation { - color: #7F9FBF; -} -.keyword.operator, .keyword-operator { - color: #ddd; -} .keyword { - color: #CC4C07; + color: #9F4177; font-weight: bold; } -.markup.heading, .markup-heading { - font-weight: bold; +.storage { + color: #7F0055; } -.markup.quote, .markup-quote { - font-style: italic; +.string { + color: #446fbd; } -.meta.annotation.currentLine { - background-color: #EAF2FE; +.support { + color: #21439c; } -.meta.tag { - color: #3f7f7f; -} -.punctuation.definition.comment, .punctuation-definition-comment { - color: #3f5fbf; -} -.punctuation.definition.string, .punctuation-definition-string { - color: blue; +.variable { + color: #0000c0; } .punctuation.separator.space { @@ -252,24 +302,51 @@ background-repeat: no-repeat; background-position: left center; } -.storage { - color: #7F0055; +.comment-block-documentation { + color: #00008F; } -.string { - color: #446fbd; +.constant-character-entity { + font-style: normal; } -.support { - color: #21439c; +.entity-name-function, .entity-name-type { + font-weight: bold; + color: #67BBB8; } -.variable.parameter, .variable-parameter { - color: black; +.entity-name-tag { + color: #98937B; } -.variable.language, .variable-language { - color: #7F0055; +.entity-other-attribute-name { + color: #3C802C; +} +.invalid-illegal { + color: white; + background-color: red; +} +.invalid-deprecated { + text-decoration: line-through; +} +.keyword-operator { + color: #CC4C07; font-weight: bold; } -.variable { - color: #0000c0; +.meta.annotation.currentLine { + background-color: #EAF2FE; +} +.meta.tag { + color: #3f7f7f; +} +.punctuation-definition-comment { + color: #3f5fbf; +} +.punctuation-definition-string { + color: blue; +} +.variable-parameter { + color: #D1416F; +} +.variable-language { + color: #7F0055; + font-weight: bold; } .cm-meta { color: #00008F; } .cm-keyword { font-weight: bold; color: #7F0055; } @@ -446,12 +523,12 @@ border: 1px solid #ff3232; } .annotationOverview.currentLine { - background-color: #f8a852; - border: 1px solid #f79327; + background-color: #EAF2FE; + border: 1px solid black; } .annotationOverview.matchingSearch { -background-color: #C3E1FF; -border: 1px solid #afcae5; + background-color: #C3E1FF; + border: 1px solid #afcae5; } .annotationOverview.currentSearch { background-color: #53D1FF; @@ -524,3 +601,71 @@ border: 1px solid #afcae5; .annotationLine.currentLine { background-color: #EAF2FE; } +.comment.block.documentation { + color: #00008F; +} +.constant.character.entity { + font-style: normal; +} +.entity.name.function, .entity.name.type { + font-weight: bold; + color: #67BBB8; +} +.entity.name { + color: #98937B; +} +.entity.other.attribute.name { + color: #3C802C; +} +.meta.documentation.tag { + color: #7F7F9F; +} +.meta.documentation.annotation { + color: #7F9FBF; +} +.markup.bold { + font-weight: bold; +} +.markup.heading, .markup-heading { + color: blue; +} +.markup.italic { + font-style: italic; +} +.markup.list { + color: #CC4C07; +} +.markup.other.separator { + color: #00008F; +} +.markup.other.strikethrough { + text-decoration: line-through; +} +.markup.other.table { + color: #3C802C; +} +.markup.quote, .markup-quote { + color: #446fbd; +} +.markup.raw { + font-family: monospace +} +.markup.underline.link { + text-decoration: underline; +} +.punctuation.definition.comment { + color: #3f5fbf; +} +.punctuation.definition.string { + color: blue; +} +.variable.parameter { + color: #D1416F; +} +.variable.language { + color: #7F0055; + font-weight: bold; +} +.variable.other { + color: #E038AD; +} diff --git a/public/orion/built-editor.min.js b/public/orion/built-editor.min.js index b7d1209b1..8962a0f49 100644 --- a/public/orion/built-editor.min.js +++ b/public/orion/built-editor.min.js @@ -1,5 +1,14 @@ /* + Copyright (c) 2014 IBM Corporation and others. + All rights reserved. This program and the accompanying materials are made + available under the terms of the Eclipse Public License v1.0 + (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution + License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). + + Contributors: + IBM Corporation - initial API and implementation + Copyright (c) 2013 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 @@ -23,8 +32,8 @@ License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). Contributors: - Felipe Heidrich (IBM Corporation) - initial API and implementation - Silenio Quarti (IBM Corporation) - initial API and implementation + Felipe Heidrich (IBM Corporation) - initial API and implementation + Silenio Quarti (IBM Corporation) - initial API and implementation Copyright (c) 2010, 2012 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made @@ -33,8 +42,8 @@ License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). Contributors: - Felipe Heidrich (IBM Corporation) - initial API and implementation - Silenio Quarti (IBM Corporation) - initial API and implementation + Felipe Heidrich (IBM Corporation) - initial API and implementation + Silenio Quarti (IBM Corporation) - initial API and implementation Copyright (c) 2012 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made @@ -51,8 +60,8 @@ License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). Contributors: - Felipe Heidrich (IBM Corporation) - initial API and implementation - Silenio Quarti (IBM Corporation) - initial API and implementation + Felipe Heidrich (IBM Corporation) - initial API and implementation + Silenio Quarti (IBM Corporation) - initial API and implementation Copyright (c) 2010, 2013 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made @@ -61,8 +70,8 @@ License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). Contributors: - Felipe Heidrich (IBM Corporation) - initial API and implementation - Silenio Quarti (IBM Corporation) - initial API and implementation + Felipe Heidrich (IBM Corporation) - initial API and implementation + Silenio Quarti (IBM Corporation) - initial API and implementation Copyright (c) 2013 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made @@ -71,16 +80,16 @@ License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). Contributors: - IBM Corporation - initial API and implementation + IBM Corporation - initial API and implementation - Copyright (c) 2013 IBM Corporation and others. + Copyright (c) 2013,2014 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). Contributors: - IBM Corporation - initial API and implementation + IBM Corporation - initial API and implementation Copyright (c) 2013 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made @@ -97,9 +106,9 @@ License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). Contributors: - Felipe Heidrich (IBM Corporation) - initial API and implementation - Silenio Quarti (IBM Corporation) - initial API and implementation - Mihai Sucan (Mozilla Foundation) - fix for Bug#334583 Bug#348471 Bug#349485 Bug#350595 Bug#360726 Bug#361180 Bug#362835 Bug#362428 Bug#362286 Bug#354270 Bug#361474 Bug#363945 Bug#366312 Bug#370584 + Felipe Heidrich (IBM Corporation) - initial API and implementation + Silenio Quarti (IBM Corporation) - initial API and implementation + Mihai Sucan (Mozilla Foundation) - fix for Bug#334583 Bug#348471 Bug#349485 Bug#350595 Bug#360726 Bug#361180 Bug#362835 Bug#362428 Bug#362286 Bug#354270 Bug#361474 Bug#363945 Bug#366312 Bug#370584 Copyright (c) 2010, 2012 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made @@ -108,8 +117,8 @@ License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). Contributors: - Felipe Heidrich (IBM Corporation) - initial API and implementation - Silenio Quarti (IBM Corporation) - initial API and implementation + Felipe Heidrich (IBM Corporation) - initial API and implementation + Silenio Quarti (IBM Corporation) - initial API and implementation Copyright (c) 2010, 2012 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made @@ -118,10 +127,10 @@ License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). Contributors: - Felipe Heidrich (IBM Corporation) - initial API and implementation - Silenio Quarti (IBM Corporation) - initial API and implementation + Felipe Heidrich (IBM Corporation) - initial API and implementation + Silenio Quarti (IBM Corporation) - initial API and implementation - Copyright (c) 2010, 2012 IBM Corporation and others. + Copyright (c) 2010, 2014 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution @@ -129,32 +138,6 @@ Contributors: IBM Corporation - initial API and implementation - Copyright (c) 2010, 2012 IBM Corporation and others. - All rights reserved. This program and the accompanying materials are made - available under the terms of the Eclipse Public License v1.0 - (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - - Contributors: IBM Corporation - initial API and implementation - - Copyright (c) 2010, 2012 IBM Corporation and others. - All rights reserved. This program and the accompanying materials are made - available under the terms of the Eclipse Public License v1.0 - (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - - Contributors: IBM Corporation - initial API and implementation - - Copyright (c) 2010, 2012 IBM Corporation and others. - All rights reserved. This program and the accompanying materials are made - available under the terms of the Eclipse Public License v1.0 - (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - - Contributors: - Felipe Heidrich (IBM Corporation) - initial API and implementation - Silenio Quarti (IBM Corporation) - initial API and implementation - Copyright (c) 2013 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 @@ -163,6 +146,32 @@ Contributors: IBM Corporation - initial API and implementation + Copyright (c) 2010, 2012 IBM Corporation and others. + All rights reserved. This program and the accompanying materials are made + available under the terms of the Eclipse Public License v1.0 + (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution + License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). + + Contributors: IBM Corporation - initial API and implementation + + Copyright (c) 2010, 2012 IBM Corporation and others. + All rights reserved. This program and the accompanying materials are made + available under the terms of the Eclipse Public License v1.0 + (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution + License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). + + Contributors: IBM Corporation - initial API and implementation + + Copyright (c) 2010, 2012 IBM Corporation and others. + All rights reserved. This program and the accompanying materials are made + available under the terms of the Eclipse Public License v1.0 + (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution + License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). + + Contributors: + Felipe Heidrich (IBM Corporation) - initial API and implementation + Silenio Quarti (IBM Corporation) - initial API and implementation + Copyright (c) 2009, 2014 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 @@ -178,6 +187,15 @@ License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). Contributors: + IBM Corporation - initial API and implementation + + Copyright (c) 2014 IBM Corporation and others. All rights reserved. + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v1.0 + (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution + License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). + + Contributors: IBM Corporation - initial API and implementation Copyright (c) 2013 IBM Corporation and others. @@ -187,7 +205,7 @@ License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). Contributors: - IBM Corporation - initial API and implementation + IBM Corporation - initial API and implementation Copyright (c) 2010, 2014 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made @@ -204,7 +222,7 @@ License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). Contributors: - IBM Corporation - initial API and implementation + IBM Corporation - initial API and implementation Copyright (c) 2013 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made @@ -213,7 +231,7 @@ License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). Contributors: - IBM Corporation - initial API and implementation + IBM Corporation - initial API and implementation Copyright (c) 2011, 2013 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made @@ -222,7 +240,7 @@ License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). Contributors: - IBM Corporation - initial API and implementation + IBM Corporation - initial API and implementation Copyright (c) 2012 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made @@ -247,7 +265,7 @@ License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). Contributors: - IBM Corporation - initial API and implementation + IBM Corporation - initial API and implementation Copyright (c) 2014 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made @@ -265,42 +283,23 @@ Contributors: IBM Corporation - initial API and implementation - Copyright (c) 2011, 2012 IBM Corporation and others. - All rights reserved. This program and the accompanying materials are made - available under the terms of the Eclipse Public License v1.0 - (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - - Contributors: - IBM Corporation - initial API and implementation - - Copyright (c) 2011, 2012 IBM Corporation and others. - All rights reserved. This program and the accompanying materials are made - available under the terms of the Eclipse Public License v1.0 - (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - - Contributors: - IBM Corporation - initial API and implementation - - Copyright (c) 2014 IBM Corporation and others. - All rights reserved. This program and the accompanying materials are made - available under the terms of the Eclipse Public License v1.0 - (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - - Contributors: IBM Corporation - initial API and implementation - Copyright (c) 2011, 2014 IBM Corporation and others. - Copyright (c) 2012 VMware, Inc. - All rights reserved. This program and the accompanying materials are made - available under the terms of the Eclipse Public License v1.0 - (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). + All rights reserved. This program and the accompanying materials are made + available under the terms of the Eclipse Public License v1.0 + (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution + License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). Contributors: - IBM Corporation - initial API and implementation - Andrew Eisenberg - rename to jsTemplateContentAssist.js + IBM Corporation - initial API and implementation + + Copyright (c) 2011, 2014 IBM Corporation and others. + All rights reserved. This program and the accompanying materials are made + available under the terms of the Eclipse Public License v1.0 + (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution + License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). + + Contributors: + IBM Corporation - initial API and implementation Copyright (c) 2011, 2012 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made @@ -317,7 +316,7 @@ License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). Contributors: - IBM Corporation - initial API and implementation + IBM Corporation - initial API and implementation Copyright (c) 2011, 2012 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made @@ -327,7 +326,7 @@ Contributors: IBM Corporation - initial API and implementation - Copyright (c) 2011, 2012 IBM Corporation and others. + Copyright (c) 2011, 2014 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution @@ -342,13 +341,13 @@ License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). Contributors: IBM Corporation - initial API and implementation - Alex Lakatos - fix for bug#369781 + Alex Lakatos - fix for bug#369781 Copyright (c) 2014 IBM Corporation and others. - All rights reserved. This program and the accompanying materials are made - available under the terms of the Eclipse Public License v1.0 - (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). + All rights reserved. This program and the accompanying materials are made + available under the terms of the Eclipse Public License v1.0 + (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution + License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). Contributors: IBM Corporation - initial API and implementation @@ -375,7 +374,7 @@ License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). Contributors: - IBM Corporation - initial API and implementation + IBM Corporation - initial API and implementation RequireJS i18n 2.0.2 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. Available via the MIT or new BSD license. see: http://github.com/requirejs/i18n for details @@ -387,22 +386,22 @@ License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). Contributors: - IBM Corporation - initial API and implementation + IBM Corporation - initial API and implementation */ var requirejs,require,define; -(function(k){function m(a,b){var e,j,w,x,f,l,c,d,o,g=b&&b.split("/"),h=q.map,p=h&&h["*"]||{};if(a&&a.charAt(0)===".")if(b){g=g.slice(0,g.length-1);a=g.concat(a.split("/"));for(d=0;d0&&(a.splice(d-1,2),d-=2);a=a.join("/")}else a.indexOf("./")===0&&(a=a.substring(2));if((g||p)&&h){e=a.split("/");for(d=e.length;d>0;d-=1){j=e.slice(0,d).join("/");if(g)for(o=g.length;o>0;o-=1)if(w=h[g.slice(0, -o).join("/")])if(w=w[j]){x=w;f=d;break}if(x)break;!l&&p&&p[j]&&(l=p[j],c=d)}!x&&l&&(x=l,f=c);x&&(e.splice(0,f,x),a=e.join("/"))}return a}function n(a,e){return function(){return b.apply(k,t.call(arguments,0).concat([a,e]))}}function i(a){return function(b){return m(b,a)}}function c(a){return function(b){l[a]=b}}function d(a){if(p.call(o,a)){var b=o[a];delete o[a];r[a]=!0;h.apply(k,b)}if(!p.call(l,a)&&!p.call(r,a))throw Error("No "+a);return l[a]}function f(a){var b,e=a?a.indexOf("!"):-1;e>-1&&(b= -a.substring(0,e),a=a.substring(e+1,a.length));return[b,a]}function g(a){return function(){return q&&q.config&&q.config[a]||{}}}var h,b,a,e,l={},o={},q={},r={},p=Object.prototype.hasOwnProperty,t=[].slice;a=function(a,b){var e,j=f(a),w=j[0],a=j[1];w&&(w=m(w,b),e=d(w));w?a=e&&e.normalize?e.normalize(a,i(b)):m(a,b):(a=m(a,b),j=f(a),w=j[0],a=j[1],w&&(e=d(w)));return{f:w?w+"!"+a:a,n:a,pr:w,p:e}};e={require:function(a){return n(a)},exports:function(a){var b=l[a];return typeof b!=="undefined"?b:l[a]={}}, -module:function(a){return{id:a,uri:"",exports:l[a],config:g(a)}}};h=function(b,f,g,j){var w,x,D,y,h=[],q,j=j||b;if(typeof g==="function"){f=!f.length&&g.length?["require","exports","module"]:f;for(y=0;y0)return m[c].get();else m[c].set(arguments)});return i};if(!Object.keys)Object.keys=function(k){var m=[],n;for(n in k)k.hasOwnProperty(n)&&m.push(n);return m};if(!Function.prototype.bind)Function.prototype.bind=function(k){var m=this,n=Array.prototype.slice.call(arguments, -1);return n.length?function(){return arguments.length?m.apply(k,n.concat(Array.prototype.slice.call(arguments))):m.apply(k,n)}:function(){return arguments.length?m.apply(k,arguments):m.call(k)}};if(!Array.isArray)Array.isArray=function(k){return Object.prototype.toString.call(k)==="[object Array]"};if(!Array.prototype.indexOf)Array.prototype.indexOf=function(k){for(var m=0;mc;++c)i?n=k(n,this[c],c,this):(n=this[c],i=!0);return n};if(!String.prototype.trim)String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};if(!String.prototype.trimLeft)String.prototype.trimLeft= -function(){return this.replace(/^\s+/g,"")};if(!String.prototype.trimRight)String.prototype.trimRight=function(){return this.replace(/\s+$/g,"")};return{}}); -(function(){function k(c,d,f,g,h,b){d[c]&&(f.push(c),(d[c]===!0||d[c]===1)&&g.push(h+c+"/"+b))}function m(c,d,f,g,h){d=g+d+"/"+h;require._fileExists(c.toUrl(d+".js"))&&f.push(d)}function n(c,d,f){for(var g in d)d.hasOwnProperty(g)&&(!c.hasOwnProperty(g)||f)?c[g]=d[g]:typeof d[g]==="object"&&n(c[g],d[g],f)}var i=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(c){var d=c.config?c.config():{};return{version:"2.0.1+",load:function(f,c,h,b){b=b||{};if(b.locale)d.locale=b.locale; -var a=i.exec(f),e=a[1],l=a[4],o=a[5],q=l.split("-"),r=[],p={},t,v="";if(a[5])e=a[1],f=e+o;else{o=a[4];l=d.locale;if(!l)l=d.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase();q=l.split("-")}if(b.isBuild){r.push(f);m(c,"root",r,e,o);for(t=0;t-1&&b[j];j--){f=b[j];x=a[f];if(x===!0||x===1)x=c(e+f+"/"+o);n(p,x)}h(p)})})}}})})();define("orion/editor/i18n",{load:function(k,m,n){m.specified&&m.specified("orion/bootstrap")?m(["orion/i18n!"+k],function(i){n(i)}):n({})}}); +(function(p){function t(a,b){var c,l,m,w,n,f,d,s,g,h=b&&b.split("/"),u=e.map,q=u&&u["*"]||{};if(a&&"."===a.charAt(0))if(b){h=h.slice(0,h.length-1);a=h.concat(a.split("/"));for(s=0;sg;++g)k?r=p(r,this[g],g,this):(r=this[g],k=!0);return r});String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});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{}}); +(function(){function p(g,h,f,q,d,c){h[g]&&(f.push(g),(!0===h[g]||1===h[g])&&q.push(d+g+"/"+c))}function t(g,h,f,q,d){h=q+h+"/"+d;require._fileExists(g.toUrl(h+".js"))&&f.push(h)}function r(g,h,f){for(var q in h)h.hasOwnProperty(q)&&(!g.hasOwnProperty(q)||f)?g[q]=h[q]:"object"===typeof h[q]&&r(g[q],h[q],f)}var k=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(g){var h=g.config?g.config():{},h=h||{};return{version:"2.0.1+",load:function(f,g,d,c){c=c||{};c.locale&&(h.locale= +c.locale);var a=k.exec(f),b=a[1],l=a[4],n=a[5],e=l.split("-"),s=[],u={},x,v="";a[5]?(b=a[1],f=b+n):(n=a[4],l=h.locale,l||(l=h.locale="undefined"===typeof navigator?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()),e=l.split("-"));if(c.isBuild){s.push(f);t(g,"root",s,b,n);for(x=0;x=0;d--)c[d]||c.splice(d,1);c.length===0&&delete this._eventTypes[k];i.compact=!1}}}},isListening:function(k){return!this._eventTypes?!1:this._eventTypes[k]!==void 0},removeEventListener:function(k, -n,i){if(this._eventTypes){var c=this._eventTypes[k];if(c){for(var d=c.listeners,f=0,g=d.length;f1)this._text=[this._text.join("")];var d=c.string,f=c.regex,g=d,h="",b=c.caseInsensitive;if(g)if(f){if(d=m.parse(g))g=d.pattern,h=d.flags}else g=d.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"),b&&(g=g.replace(/[iI\u0130\u0131]/g, -"[Ii\u0130\u0131]"));var a=null,e;if(g){var d=c.reverse,l=c.wrap,f=c.wholeWord,o=c.start||0,c=c.end,q=c!==null&&c!==void 0;h.indexOf("g")===-1&&(h+="g");h.indexOf("m")===-1&&(h+="m");b&&h.indexOf("i")===-1&&(h+="i");f&&(g="\\b"+g+"\\b");var i=this._text[0],p,t,v=0;q&&(b=o1;)if(b=Math.floor((a+e)/2), -g=this._lineOffsets[b],h=b+11&&(c=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0))));this._lineDelimiter=c?c:n.platformDelimiter;if(d){var f=this.getLineCount();if(f>1){for(var g=Array(f),h=0;h1)return!1; -i=i[0]}return i.type!==this.type?!1:this.keyCode===i.keyCode||this.keyCode===String.fromCharCode(k.isOpera?i.which:i.charCode!==void 0?i.charCode:i.keyCode)?this.mod1!==(k.isMac?i.metaKey:i.ctrlKey)?!1:this.type==="keydown"&&this.mod2!==i.shiftKey?!1:this.mod3!==i.altKey?!1:k.isMac&&this.mod4!==i.ctrlKey?!1:!0:!1},equals:function(i){return!i?!1:this.keyCode!==i.keyCode?!1:this.mod1!==i.mod1?!1:this.mod2!==i.mod2?!1:this.mod3!==i.mod3?!1:this.mod4!==i.mod4?!1:this.type!==i.type?!1:!0}};n.prototype= -{getKeys:function(){return this.keys.slice(0)},match:function(i,c){var d=this.keys;if(c!==void 0)return c>d.length?!1:d[c].match(i)?c===d.length-1?!0:c+1:!1;else{i instanceof Array||(i=[i]);if(i.length>d.length)return!1;var f;for(f=0;f0;)(!f.isIE||f.isIE>=9||f.isIE<9&&b[e].specified)&&a.removeAttribute(b[e].name)}if(j){if(j.styleClass)a.className=j.styleClass;if(b=j.style)for(var c in b)b.hasOwnProperty(c)&&(a.style[c]=b[c]);if(j=j.attributes)for(var l in j)j.hasOwnProperty(l)&& -a.setAttribute(l,j[l])}}function h(j){return j instanceof Array?j.slice(0):j}function b(j,a){if(!j)return a;if(!a)return j;for(var b in a)a.hasOwnProperty(b)&&(j.hasOwnProperty(b)||(j[b]=a[b]));return j}function a(j,w){if(j===w)return!0;if(j&&!w||!j&&w)return!1;if(j&&j.constructor===String||w&&w.constructor===String)return!1;if(j instanceof Array||w instanceof Array){if(!(j instanceof Array&&w instanceof Array))return!1;if(j.length!==w.length)return!1;for(var b=0;bthis.end)j=this.start,this.start=this.end,this.end=j,this.caret=!this.caret},setCaret:function(j){this.end=this.start=j;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(j){return this.caret===j.caret&&this.start===j.start&&this.end===j.end}};r.prototype={toString:function(){return"{l="+this.left+", t="+this.top+", r="+this.right+", b="+this.bottom+"}"}};p.prototype={create:function(j,a){if(!this._lineDiv){var b=this._lineDiv=this._createLine(j,a,this.lineIndex);b._line= -this;return b}},_createLine:function(j,w,b){var e=this.view,c=e._model,l=c.getLine(b),d=c.getLineStart(b),o={type:"LineStyle",textView:e,lineIndex:b,lineText:l,lineStart:d};if(l.length<2E3)e.onLineStyle(o);c=w||f.createElement(j.ownerDocument,"div");if(!w||!a(w.viewStyle,o.style)){g(o.style,c,w);if(w)w._trim=null;c.viewStyle=o.style;c.setAttribute("role","presentation")}c.lineIndex=b;b=[];this._createRanges(o.ranges,l,0,l.length,d,{tabOffset:0,ranges:b});l=" ";!e._fullSelection&&f.isIE<9&&(l="\ufeff"); -o={text:l,style:e._metrics.largestFontStyle,ignoreChars:1};b.length===0||!b[b.length-1].style||b[b.length-1].style.tagName!=="div"?b.push(o):b.splice(b.length-1,0,o);var h,p,i,q,r,l=e=0,s,t;if(w){if(p=w.modelChangedEvent)p.removedLineCount===0&&p.addedLineCount===0?(t=p.start-d,s=p.addedCharCount-p.removedCharCount):t=-1,w.modelChangedEvent=void 0;p=w.firstChild}for(d=0;d=t&&(i-=s);r=(r=p.firstChild.data)?r.length:0;if(l+r>i)break;l+=r}i=p.nextSibling;c.removeChild(p);p=i}h=this._createSpan(c,q,h,o.ignoreChars);p?c.insertBefore(h,p):c.appendChild(h);if(w)w.lineWidth=void 0}if(w)for(j=h?h.nextSibling:null;j;)i=j.nextSibling,w.removeChild(j),j=i;else j.appendChild(c);return c},_createRanges:function(j,w,b,e,c,f){if(!(b>e)){if(j)for(var l=0;le)break;var g=Math.min(c+e,d.end)-c;if(o<=g){o=Math.max(b,o);g=Math.min(e,g);bb)){var f=this.view._customTabSize;if(f&&f!==8)for(var l=j.indexOf("\t",a);l!==-1&&l0){for(var d="\u00a0",o=1;oj){o=j-d;if(g.length===1)o=new r(c.getBoundingClientRect());else if(e._isRangeRects)l=l.createRange(),l.setStart(g,o),l.setEnd(g,o+1),o=new r(l.getBoundingClientRect());else if(f.isIE){if(l=l.body.createTextRange(),l.moveToElementText(c), -l.collapse(),(d=o===0&&f.isIE===8)&&(o=1),l.moveEnd("character",o+1),l.moveStart("character",o),o=new r(l.getBoundingClientRect()),d)o.left=c.getClientRects()[0].left}else{var h=g.data;c.removeChild(g);c.appendChild(l.createTextNode(h.substring(0,o)));var i=f.createElement(l,"span");i.appendChild(l.createTextNode(h.substring(o,o+1)));c.appendChild(i);c.appendChild(l.createTextNode(h.substring(o+1)));o=new r(i.getBoundingClientRect());c.innerHTML="";c.appendChild(g);this._createdDiv||(l=e._getSelection(), -(d<=l.start&&l.startc.right)c.right=o.right;if(o.bottom>c.bottom)c.bottom=o.bottom}}}e=e.nextSibling}return j!==void 0?b[j]:b},_getLineBoundingClientRect:function(j,a){var b=new r(j.getBoundingClientRect()); -if(!this.view._wrapMode){b.right=b.left;for(var e=j.lastChild;e&&e.ignoreChars===e.firstChild.length;)e=e.previousSibling;if(e)e=e.getBoundingClientRect(),b.right=e.right+o(j).right}a&&(e=o(j),b.left+=e.left,b.right-=e.right);return b},getLineCount:function(){return!this.view._wrapMode?1:this.getClientRects().length},getLineIndex:function(j){if(!this.view._wrapMode)return 0;for(var a=this.getClientRects(),j=this.getBoundingClientRect(j),j=j.top+(j.bottom-j.top)/2,b=0;bh.right&&(j=h.right-1)}else j<0&&(j=0),j>g.right-g.left&&(j=g.right-g.left);var q=d.ownerDocument,i=q.defaultView||q.parentWindow,r=f.isIE?i.screen.logicalXDPI/i.screen.deviceXDPI:1,s=f.isIE?i.screen.logicalYDPI/i.screen.deviceYDPI:1,i=l,t=d.firstChild;a:for(;t;){if(!t.ignore){var u=t.firstChild,d=u.length;t.ignoreChars&&(d-=t.ignoreChars);var v,k,n;p=this._getClientRects(t,g);for(var m=0;m1;){var J=Math.floor((z+C)/2);p=C+1;h=J===d-1&&t.ignoreChars?u.length:J+1;A=p===0&&f.isIE===8;b._isRangeRects?(q.setStart(u,p),q.setEnd(u,h)):(A&&(p=1),q.moveToElementText(t),q.move("character",p),q.moveEnd("character",h-p));p=q.getClientRects();for(var N=!1,L=0;L0&&(h=p[0],v=(A?m:h.left)*r-g.left,n=h.right*r-g.left,b=j>v+(n-v)/2);g=i-l;e=e.getLine(c);c=e.charCodeAt(g);55296<=c&&c<=56319&&b?g0&&(c=e.charCodeAt(g-1),55296<=c&&c<=56319&&(i-=1));b&&i++}else{e=[];for(c=0;c"),c===d-1?e.push(u.data.substring(c)):e.push(u.data.substring(c,c+1)),e.push("");t.innerHTML=e.join("");for(e=t.firstChild;e;){h=e.getBoundingClientRect();v=h.left-g.left;n=h.right-g.left;if(v<=j&&jv+(n-v)/2&&i++;break}i++;e=e.nextSibling}if(!this._createdDiv)t.innerHTML="",t.appendChild(u),g=b._getSelection(),(i<=g.start&&g.start0)return a.count--,b.getLineEnd(e);a.count++;return b.getLineStart(e)}return a.unit==="wordend"||a.unit==="wordWS"||a.unit==="wordendWS"?this._getNextOffset_W3C(j,a):f.isIE?this._getNextOffset_IE(j,a):this._getNextOffset_W3C(j,a)},_getNextOffset_W3C:function(j,a){function b(j){return 33<=j&&j<=47||58<=j&&j<=64||91<=j&&j<=94||j===96||123<=j&&j<= -126}function e(j){return j===32||j===9}var c=this.view._model,l=c.getLineAtOffset(j),f=c.getLine(l),o=c.getLineStart(l),c=c.getLineEnd(l),l=f.length,d=j-o,g,h=a.count<0?-1:1;if(a.unit==="word"||a.unit==="wordend"||a.unit==="wordWS"||a.unit==="wordendWS")for(var p,i,q;a.count!==0;){if(a.count>0){if(d===l)return c;g=f.charCodeAt(d);p=b(g);i=!p&&!e(g);for(d++;d0&&(g=f.charCodeAt(d-1),55296<=g&&g<=56319&&(d+=h)),a.count-=h;return o+d},_getNextOffset_IE:function(j,a){var b=this._ensureCreated(),e=this.view._model,c=this.lineIndex,l=0,f;f=e.getLineStart(c);var d=b.ownerDocument,o=a.count<0?-1:1;if(j===e.getLineEnd(c)){for(b=b.lastChild;b&&b.ignoreChars===b.firstChild.length;)b=b.previousSibling;if(!b)return f;l=d.body.createTextRange();l.moveToElementText(b);f=l.text.length;l.moveEnd(a.unit,o);l=j+l.text.length-f}else if(j===f&&a.count<0)l=f;else for(b= -b.firstChild;b;){e=b.firstChild.length;b.ignoreChars&&(e-=b.ignoreChars);if(f+e>j){l=d.body.createTextRange();if(j===f&&a.count<0){for(f=b.previousSibling;f;){if(f.firstChild&&f.firstChild.length)break;f=f.previousSibling}l.moveToElementText(f?f:b.previousSibling)}else l.moveToElementText(b),l.collapse(),l.moveEnd("character",j-f);f=l.text.length;l.moveEnd(a.unit,o);l=j+l.text.length-f;break}f=e+f;b=b.nextSibling}a.count-=o;return l},destroy:function(){var j=this._createdDiv;if(j)j.parentNode.removeChild(j), -this._createdDiv=null}};t.prototype={addKeyMode:function(j,a){var b=this._keyModes;a!==void 0?b.splice(a,0,j):b.push(j);j._modeAdded&&j._modeAdded()},addRuler:function(j,a){j.setView(this);var b=this._rulers;if(a!==void 0){var e,c;for(e=0,c=0;e0)){var j=this._model.getLineCount();this.redrawRulers(0,j);this.redrawLines(0,j)}},redrawRulers:function(j,a){if(!(this._redrawCount>0))for(var b=this.getRulers(),e=0;e0)&&(j===void 0&&(j=0),a===void 0&&(a=this._model.getLineCount()),j!==a)){var e=this._clientDiv;if(e){if(b)for(e=this._getRulerParent(b).firstChild;e;){if(e._ruler=== -b)break;e=e.nextSibling}b?e.rulerChanged=!0:this._lineHeight&&this._resetLineHeight(j,a);if(!b||b.getOverview()==="page")for(e=e.firstChild;e;){var c=e.lineIndex;if(j<=c&&c0)){var b=this._model;j===void 0&&(j=0);a===void 0&&(a=b.getCharCount()); -var e=b.getLineAtOffset(j),b=b.getLineAtOffset(Math.max(j,a-1))+1;this.redrawLines(e,b)}},removeKeyMode:function(j){for(var a=this._keyModes,b=0;ba;if(c)var l=j,j=a,a=l;l=this._model.getCharCount();j= -Math.max(0,Math.min(j,l));a=Math.max(0,Math.min(a,l));this._setSelection(new q(j,a,c),b===void 0||b,!0,e)},setText:function(j,a,b){var e=a===void 0&&b===void 0;a===void 0&&(a=0);b===void 0&&(b=this._model.getCharCount());if(e)this._variableLineHeight=!1;this._modifyContent({text:j,start:a,end:b,_code:!0},!e);if(e)this._columnX=-1,this._setSelection(new q(0,0,!1),!0),f.isFirefox&&this._fixCaret()},setTopIndex:function(j){this._clientDiv&&this._scrollView(0,this._getLinePixel(Math.max(0,j))-this._getScroll().y)}, -setTopPixel:function(j){this._clientDiv&&this._scrollView(0,Math.max(0,j)-this._getScroll().y)},showSelection:function(){return this._showCaret(!0)},update:function(j,a){this._clientDiv&&(j&&this._updateStyle(),a===void 0||a?this._update():this._queueUpdate())},_handleRootMouseDown:function(j){if(!this._ignoreEvent(j)){if(f.isFirefox&&j.which===1)this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0;var a=this._overlayDiv||this._clientDiv;if(f.isIE<9)a= -this._viewDiv;for(var b=j.target?j.target:j.srcElement;b;){if(a===b)return;b=b.parentNode}j.preventDefault&&j.preventDefault();j.stopPropagation&&j.stopPropagation();if(!this._isW3CEvents){var e=this;this._getWindow().setTimeout(function(){e._clientDiv.focus()},0)}}},_handleRootMouseUp:function(j){if(!this._ignoreEvent(j)&&f.isFirefox&&j.which===1)this._clientDiv.contentEditable=!0,(this._overlayDiv||this._clientDiv).draggable=!1,this._fixCaret(),this._ignoreBlur=!1},_handleBlur:function(){if(!this._ignoreBlur){this._hasFocus= -!1;if(f.isIE<9&&!this._getSelection().isEmpty()){var j=this._rootDiv,a=f.createElement(j.ownerDocument,"div");j.appendChild(a);j.removeChild(a)}if(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",j=this._getWindow(),a=this._selDiv1.ownerDocument,j.getSelection){a=j.getSelection();for(j=a.anchorNode;j;){if(j===this._clientDiv){a.rangeCount>0&&a.removeAllRanges(); -break}j=j.parentNode}}else if(a.selection){this._ignoreSelect=!1;for(j=a.selection.createRange().parentElement();j;){if(j===this._clientDiv){a.selection.empty();break}j=j.parentNode}this._ignoreSelect=!0}if(!this._ignoreFocus)this.onBlur({type:"Blur"})}},_handleContextMenu:function(j){if(!this._ignoreEvent(j)){f.isIE&&this._lastMouseButton===3&&this._updateDOMSelection();var a=!1;this.isListening("ContextMenu")?(a=this._createMouseEvent("ContextMenu",j),a.screenX=j.screenX,a.screenY=j.screenY,this.onContextMenu(a), -a=a.defaultPrevented):f.isMac&&f.isFirefox&&j.button===0&&(a=!0);if(a)return j.preventDefault&&j.preventDefault(),!1}},_handleCopy:function(j){if(!this._ignoreEvent(j)&&!this._ignoreCopy&&this._doCopy(j))return j.preventDefault&&j.preventDefault(),!1},_handleCut:function(j){if(!this._ignoreEvent(j)&&this._doCut(j))return j.preventDefault&&j.preventDefault(),!1},_handleDataModified:function(j){this._ignoreEvent(j)||this._startIME()},_handleDblclick:function(j){if(!this._ignoreEvent(j)&&(this._lastMouseTime= -j.timeStamp?j.timeStamp:(new Date).getTime(),this._clickCount!==2))this._clickCount=2,this._handleMouse(j)},_handleDragStart:function(j){if(!this._ignoreEvent(j)){if(f.isFirefox){var a=this;this._getWindow().setTimeout(function(){a._clientDiv.contentEditable=!0;a._clientDiv.draggable=!1;a._ignoreBlur=!1},0)}if(this.isListening("DragStart")&&this._dragOffset!==-1)this._isMouseDown=!1,this.onDragStart(this._createMouseEvent("DragStart",j)),this._dragOffset=-1;else return j.preventDefault&&j.preventDefault(), -!1}},_handleDrag:function(j){if(!this._ignoreEvent(j)&&this.isListening("Drag"))this.onDrag(this._createMouseEvent("Drag",j))},_handleDragEnd:function(j){if(!this._ignoreEvent(j)){this._dropTarget=!1;this._dragOffset=-1;if(this.isListening("DragEnd"))this.onDragEnd(this._createMouseEvent("DragEnd",j));f.isFirefox&&(this._fixCaret(),j.dataTransfer.dropEffect==="none"&&!j.dataTransfer.mozUserCancelled&&this._fixCaret())}},_handleDragEnter:function(j){if(!this._ignoreEvent(j)){var a=!0;this._dropTarget= -!0;this.isListening("DragEnter")&&(a=!1,this.onDragEnter(this._createMouseEvent("DragEnter",j)));if(f.isWebkit||a)return j.preventDefault&&j.preventDefault(),!1}},_handleDragOver:function(j){if(!this._ignoreEvent(j)){var a=!0;this.isListening("DragOver")&&(a=!1,this.onDragOver(this._createMouseEvent("DragOver",j)));if(f.isWebkit||a){if(a)j.dataTransfer.dropEffect="none";j.preventDefault&&j.preventDefault();return!1}}},_handleDragLeave:function(j){if(!this._ignoreEvent(j)&&(this._dropTarget=!1,this.isListening("DragLeave")))this.onDragLeave(this._createMouseEvent("DragLeave", -j))},_handleDrop:function(j){if(!this._ignoreEvent(j)){this._dropTarget=!1;if(this.isListening("Drop"))this.onDrop(this._createMouseEvent("Drop",j));j.preventDefault&&j.preventDefault();return!1}},_handleFocus:function(){this._hasFocus=!0;f.isIOS&&this._lastTouchOffset!==void 0?(this.setCaretOffset(this._lastTouchOffset,!0),this._lastTouchOffset=void 0):this._updateDOMSelection();if(this._cursorDiv)this._cursorDiv.style.display="block";if(this._selDiv1){var j=this._highlightRGB;this._selDiv1.style.background= -j;this._selDiv2.style.background=j;this._selDiv3.style.background=j}if(!this._ignoreFocus)this.onFocus({type:"Focus"})},_handleKeyDown:function(j){if(!this._ignoreEvent(j)){if(this.isListening("KeyDown")){var a=this._createKeyEvent("KeyDown",j);this.onKeyDown(a);if(a.defaultPrevented){if(f.isFirefox)this._keyDownPrevented=!0;j.preventDefault();return}}a=!1;switch(j.keyCode){case 16:case 17:case 18:case 91:a=!0;break;default:this._setLinksVisible(!1)}if(j.keyCode===229){if(this._readonly)return j.preventDefault&& -j.preventDefault(),!1;a=!0;if(f.isSafari&&f.isMac&&j.ctrlKey)a=!1,j.keyCode=129;a&&this._startIME()}else a||this._commitIME();if((f.isMac||f.isLinux)&&f.isFirefox<4||f.isOpera<12.16)return this._keyDownEvent=j,!0;if(this._doAction(j))return j.preventDefault?(j.preventDefault(),j.stopPropagation()):(j.cancelBubble=!0,j.returnValue=!1,j.keyCode=0),!1}},_handleKeyPress:function(j){if(!this._ignoreEvent(j))if(this._keyDownPrevented)j.preventDefault&&(j.preventDefault(),j.stopPropagation()),this._keyDownPrevented= -void 0;else{if(f.isMac&&f.isWebkit&&(63232<=j.keyCode&&j.keyCode<=63487||j.keyCode===13||j.keyCode===8))return j.preventDefault&&j.preventDefault(),!1;if(((f.isMac||f.isLinux)&&f.isFirefox<4||f.isOpera<12.16)&&this._doAction(this._keyDownEvent))return j.preventDefault&&j.preventDefault(),!1;var a=f.isMac?j.metaKey:j.ctrlKey;if(j.charCode!==void 0&&a)switch(j.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")&&(a=this._createKeyEvent("KeyPress",j),this.onKeyPress(a),a.defaultPrevented)){j.preventDefault(); -return}if(this._doAction(j))return j.preventDefault?(j.preventDefault(),j.stopPropagation()):(j.cancelBubble=!0,j.returnValue=!1,j.keyCode=0),!1;a=!1;if(f.isMac){if(j.ctrlKey||j.metaKey)a=!0}else if(f.isFirefox){if(j.ctrlKey||j.altKey)a=!0}else j.ctrlKey^j.altKey&&(a=!0);if(!a&&(a=f.isOpera?j.which:j.charCode!==void 0?j.charCode:j.keyCode,a>31))return this._doContent(String.fromCharCode(a)),j.preventDefault&&j.preventDefault(),!1}},_handleDocKeyUp:function(j){(f.isMac?j.metaKey:j.ctrlKey)||this._setLinksVisible(!1)}, -_handleKeyUp:function(j){if(!this._ignoreEvent(j)){if(this.isListening("KeyUp")){var a=this._createKeyEvent("KeyUp",j);this.onKeyUp(a);if(a.defaultPrevented){j.preventDefault();return}}this._handleDocKeyUp(j);j.keyCode===13&&this._commitIME()}},_handleLinkClick:function(j){if(!(f.isMac?j.metaKey:j.ctrlKey))return j.preventDefault&&j.preventDefault(),!1},_handleMouse:function(j){var a=this._getWindow(),b=!0,e=a;if(f.isIE||f.isFirefox&&!this._overlayDiv)e=this._clientDiv;if(this._overlayDiv){if(this._hasFocus)this._ignoreFocus= -!0;var c=this;a.setTimeout(function(){c.focus();c._ignoreFocus=!1},0)}this._clickCount===1?(b=this._setSelectionTo(j.clientX,j.clientY,j.shiftKey,(!f.isOpera||f.isOpera>=12.16)&&this._hasFocus&&this.isListening("DragStart")))&&this._setGrab(e):(this._isW3CEvents&&this._setGrab(e),this._doubleClickSelection=null,this._setSelectionTo(j.clientX,j.clientY,j.shiftKey),this._doubleClickSelection=this._getSelection());return b},_handleMouseDown:function(j){if(!this._ignoreEvent(j)){if(this._linksVisible)if((j.target|| -j.srcElement).tagName!=="A")this._setLinksVisible(!1);else return;this._commitIME();var a=j.which;a||(j.button===4&&(a=2),j.button===2&&(a=3),j.button===1&&(a=1));var b=a!==2&&j.timeStamp?j.timeStamp:(new Date).getTime(),e=b-this._lastMouseTime,c=Math.abs(this._lastMouseX-j.clientX),l=Math.abs(this._lastMouseY-j.clientY),d=this._lastMouseButton===a;this._lastMouseX=j.clientX;this._lastMouseY=j.clientY;this._lastMouseTime=b;this._lastMouseButton=a;if(a===1)this._isMouseDown=!0,d&&e<=this._clickTime&& -c<=this._clickDist&&l<=this._clickDist?this._clickCount++:this._clickCount=1;if(this.isListening("MouseDown")&&(b=this._createMouseEvent("MouseDown",j),this.onMouseDown(b),b.defaultPrevented)){j.preventDefault();return}if(a===1&&this._handleMouse(j)&&(f.isIE>=9||f.isOpera||f.isChrome||f.isSafari||f.isFirefox&&!this._overlayDiv))this._hasFocus||this.focus(),j.preventDefault();f.isFirefox&&this._lastMouseButton===3&&this._updateDOMSelection()}},_handleMouseOver:function(j){if(!this._ignoreEvent(j)&& -!this._animation&&this.isListening("MouseOver"))this.onMouseOver(this._createMouseEvent("MouseOver",j))},_handleMouseOut:function(j){if(!this._ignoreEvent(j)&&!this._animation&&this.isListening("MouseOut"))this.onMouseOut(this._createMouseEvent("MouseOut",j))},_handleMouseMove:function(j){if(!this._animation){var a=this._isClientDiv(j);if(this.isListening("MouseMove")&&a)this.onMouseMove(this._createMouseEvent("MouseMove",j));if(!this._dropTarget){var b=this._linksVisible||this._lastMouseMoveX!== -j.clientX||this._lastMouseMoveY!==j.clientY;this._lastMouseMoveX=j.clientX;this._lastMouseMoveY=j.clientY;this._setLinksVisible(b&&!this._isMouseDown&&(f.isMac?j.metaKey:j.ctrlKey));if(!this._isW3CEvents){if(j.button===0)return this._setGrab(null),!0;if(!this._isMouseDown&&j.button===1&&(this._clickCount&1)!==0&&a)return this._clickCount=2,this._handleMouse(j,this._clickCount)}if(this._isMouseDown&&this._dragOffset===-1){var a=j.clientX,j=j.clientY,e=this._getViewPadding(),c=this._viewDiv.getBoundingClientRect(), -l=this._getClientWidth(),d=this._getClientHeight(),b=c.left+e.left,o=c.top+e.top,l=c.left+e.left+l,e=c.top+e.top+d;je?this._doAutoScroll("down",a,j-e):al&&!this._wrapMode?this._doAutoScroll("right",a-l,j):(this._endAutoScroll(),this._setSelectionTo(a,j,!0))}}}},_isClientDiv:function(j){for(var a=this._overlayDiv||this._clientDiv,j=j.target?j.target:j.srcElement;j;){if(a===j)return!0;j=j.parentNode}return!1}, -_createKeyEvent:function(j,a){return{type:j,event:a,preventDefault:function(){this.defaultPrevented=!0}}},_createMouseEvent:function(j,a){var b=this.convert({x:a.clientX,y:a.clientY},"page","document");return{type:j,event:a,clickCount:this._clickCount,x:b.x,y:b.y,preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(j){var a=j.which?j.button===0:j.button===1;if(this.isListening("MouseUp")&&(this._isClientDiv(j)||a&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp", -j));if(!this._linksVisible&&a&&this._isMouseDown){if(this._dragOffset!==-1)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);f.isFirefox&&j.preventDefault()}},_handleMouseWheel:function(j){var a=this._getLineHeight(),b=0,e=0;f.isIE||f.isOpera?e=-j.wheelDelta/40*a:f.isFirefox?(a=f.isMac?j.detail*3:Math.max(-256,Math.min(256,j.detail))*a,j.axis===j.HORIZONTAL_AXIS? -b=a:e=a):f.isMac?(e=j.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=j.timeStamp,b=j.wheelDeltaX%120!==0?1:e<40?40/(40-e):40,e=j.wheelDeltaY%120!==0?1:e<40?40/(40-e):40,b=Math.ceil(-j.wheelDeltaX/b),-10)a.getRangeAt(0).deleteContents(),c=b.ownerDocument.createTextNode(j.data),a.getRangeAt(0).insertNode(c),d=this._getDOMText(b,c),f=d.text,d=d.offset,c.parentNode.removeChild(c);b.lineRemoved=!0;for(b=0;l.charCodeAt(b)===f.charCodeAt(b)&&b=d+j.data.length;)a--; -a++;l=f.substring(b,a+c);b+=e;a+=e;this._modifyContent({text:l,start:b,end:a,_ignoreDOMSelection:!0},!0)}}else this._doContent(j.data);j.preventDefault()}},_handleTouchStart:function(j){this._commitIME();var a=this._getWindow();if(this._touchScrollTimer)this._vScrollDiv.style.display="none",this._hScrollDiv.style.display="none",a.clearInterval(this._touchScrollTimer),this._touchScrollTimer=null;var b=j.touches;if(b.length===1){var b=b[0],e=b.clientX,c=b.clientY;this._touchStartX=e;this._touchStartY= -c;if(f.isAndroid&&(c=0;b--)if(a=e[b],typeof a.match==="function"&&(a=a.match(j),a!==void 0))return this.invokeAction(a);return!1},_doMove:function(j,a){var b=this._model,e=a.getCaret(),c=b.getLineAtOffset(e); -if(!j.count)j.count=1;for(;j.count!==0;){var l=b.getLineStart(c);if(j.count<0&&e===l)if(c>0)j.unit==="character"&&j.count++,c--,a.extend(b.getLineEnd(c));else break;else if(j.count>0&&e===b.getLineEnd(c))if(c+10&&(l=Math.min(l+j.count-1,b.getLineCount()-1)),c=b.getLineEnd(l);a.extend(c)}j.select||a.collapse();this._setSelection(a,!0,!0,e);return!0},_doEnter:function(j){var a=this._model,b=this._getSelection();this._doContent(a.getLineDelimiter());if(j&&j.noCursor)b.end=b.start,this._setSelection(b,!0);return!0},_doHome:function(j){var a=this._getSelection(),b=this._model,e;if(j.ctrl)a.extend(0), -e=function(){};else{var c=a.getCaret(),l=b.getLineAtOffset(c);this._wrapMode?(b=this._getLine(l),c=b.getLineIndex(c),c=b.getLineStart(c),b.destroy()):c=b.getLineStart(l);a.extend(c)}j.select||a.collapse();this._setSelection(a,!0,!0,e);return!0},_doLineDown:function(j){var a=this._model,b=this._getSelection(),e=b.getCaret(),c=a.getLineAtOffset(e),l=this._getLine(c),d=this._columnX,o=1,g=!1;if(d===-1||j.wholeLine||j.select&&f.isIE)d=j.wholeLine?a.getLineEnd(c+1):e,d=l.getBoundingClientRect(d).left; -(e=l.getLineIndex(e))0?c=Math.min(c+j.count,e):c++);e=!1;if(g){if(j.select||f.isMac||f.isLinux)b.extend(a.getCharCount()),e=!0}else l.lineIndex!==c&&(l.destroy(),l=this._getLine(c)),b.extend(l.getOffset(d,o)),e=!0;e&&(j.select||b.collapse(),this._setSelection(b,!0,!0));this._columnX=d;l.destroy();return!0},_doLineUp:function(a){var b=this._model,e=this._getSelection(),c=e.getCaret(),l=b.getLineAtOffset(c), -d=this._getLine(l),o=this._columnX,g=!1,h;if(o===-1||a.wholeLine||a.select&&f.isIE)o=a.wholeLine?b.getLineStart(l-1):c,o=d.getBoundingClientRect(o).left;(c=d.getLineIndex(c))>0?h=d.getClientRects(c-1).top+1:(g=l===0,g||(a.count&&a.count>0?l=Math.max(l-a.count,0):l--,h=this._getLineHeight(l)-1));c=!1;if(g){if(a.select||f.isMac||f.isLinux)e.extend(0),c=!0}else d.lineIndex!==l&&(d.destroy(),d=this._getLine(l)),e.extend(d.getOffset(o,h)),c=!0;c&&(a.select||e.collapse(),this._setSelection(e,!0,!0));this._columnX= -o;d.destroy();return!0},_doNoop:function(){return!0},_doPageDown:function(a){var b=this,e=this._model,c=this._getSelection(),l=c.getCaret(),d=e.getLineAtOffset(l),o=e.getLineCount(),g=this._getScroll(),e=this._getClientHeight(),h,p;if(this._lineHeight){h=this._columnX;g=this._getBoundsAtOffset(l);if(h===-1||a.select&&f.isIE)h=g.left;l=this._getLineIndex(g.top+e);p=this._getLine(l);d=this._getLinePixel(l);l=p.getOffset(h,g.top+e-d);e=p.getBoundingClientRect(l);p.destroy();c.extend(l);a.select||c.collapse(); -this._setSelection(c,!0,!0,function(){b._columnX=h},e.top+d-g.top);return!0}if(da&&(l=a-e);this._setSelection(c,!0,!0,function(){b._columnX=h},l-g.y)}return!0},_doPageUp:function(a){var b=this,e=this._model, -c=this._getSelection(),l=c.getCaret(),d=e.getLineAtOffset(l),o=this._getScroll(),g=this._getClientHeight(),h;if(this._lineHeight){h=this._columnX;o=this._getBoundsAtOffset(l);if(h===-1||a.select&&f.isIE)h=o.left;l=this._getLineIndex(o.bottom-g);e=this._getLine(l);d=this._getLinePixel(l);l=e.getOffset(h,o.bottom-g-d);g=e.getBoundingClientRect(l);e.destroy();c.extend(l);a.select||c.collapse();this._setSelection(c,!0,!0,function(){b._columnX=h},g.top+d-o.top);return!0}if(d>0){var p=this._getLineHeight(), -g=Math.max(1,Math.min(d,Math.floor(g/p)));h=this._columnX;if(h===-1||a.select&&f.isIE)e=this._getLine(d),h=e.getBoundingClientRect(l).left,e.destroy();e=this._getLine(d-g);c.extend(e.getOffset(h,this._getLineHeight(d-g)-1));e.destroy();a.select||c.collapse();a=Math.max(0,o.y-g*p);this._setSelection(c,!0,!0,function(){b._columnX=h},a-o.y)}return!0},_doPaste:function(a){var b=this;return this._getClipboardText(a,function(a){a&&(f.isLinux&&b._lastMouseButton===2&&(new Date).getTime()-b._lastMouseTime<= -b._clickTime&&b._setSelectionTo(b._lastMouseX,b._lastMouseY),b._doContent(a))})!==null},_doScroll:function(a){var b=a.type,e=this._model,c=e.getLineCount(),a=this._getClientHeight(),l=this._getLineHeight();c*=l;var f=this._getScroll().y,d;switch(b){case "textStart":d=0;break;case "textEnd":d=c-a;break;case "pageDown":d=f+a;break;case "pageUp":d=f-a;break;case "lineDown":d=f+l;break;case "lineUp":d=f-l;break;case "centerLine":b=this._getSelection(),d=e.getLineAtOffset(b.start),e=(e.getLineAtOffset(b.end)- -d+1)*l,d=d*l-a/2+e/2}d!==void 0&&(d=Math.min(Math.max(0,d),c-a),this._scrollViewAnimated(0,d-f,function(){}));return!0},_doSelectAll:function(){var a=this._model,b=this._getSelection();b.setCaret(0);b.extend(a.getCharCount());this._setSelection(b,!1);return!0},_doTab:function(){if(this._tabMode&&!this._readonly){var a="\t";if(this._expandTab)var b=this._model,a=this._getSelection().getCaret(),e=b.getLineAtOffset(a),b=b.getLineStart(e),a=Array(this._tabSize-(a-b)%this._tabSize+1).join(" ");this._doContent(a); -return!0}},_doShiftTab:function(){return!this._tabMode||this._readonly?void 0:!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,b=this._getSelection(),e=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),c=b.getCaret(), -l=a.getLineCount(),d=a.getLineAtOffset(c),o;if(this._autoScrollDir==="up"||this._autoScrollDir==="down")c=this._autoScrollY/this._getLineHeight(),c=c<0?Math.floor(c):Math.ceil(c),o=Math.max(0,Math.min(l-1,d+c));else if(this._autoScrollDir==="left"||this._autoScrollDir==="right")o=this._getLineIndex(e.y),d=this._getLine(d),e.x+=d.getBoundingClientRect(c,!1).left,d.destroy();o===0&&(f.isMac||f.isLinux)?b.extend(0):o===l-1&&(f.isMac||f.isLinux)?b.extend(a.getCharCount()):(d=this._getLine(o),b.extend(d.getOffset(e.x, -e.y-this._getLinePixel(o))),d.destroy());this._setSelection(b,!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 b=this._model.getLineCount(),e=0;if(a){for(var a=0,c=(new Date).getTime(),l=0;e100)break;this.redrawRulers(0,b);this._queueUpdate()}a=this._getWindow();if(e!==b){var f=this;this._calculateLHTimer=a.setTimeout(function(){f._calculateLHTimer=null;f._calculateLineHeightTimer(!0)},0)}else if(this._calculateLHTimer)a.clearTimeout(this._calculateLHTimer),this._calculateLHTimer=void 0}},_calculateLineHeight:function(a){var a=this._getLine(a),b=a.getBoundingClientRect();a.destroy();return Math.max(1,b.bottom-b.top)},_calculateMetrics:function(){var a=this._clientDiv,b=a.ownerDocument, -e=f.createElement(b,"div");e.style.lineHeight="normal";var c={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(c);g(c.style,e);e.style.position="fixed";e.style.left="-1000px";var d=f.createElement(b,"span");d.appendChild(b.createTextNode(" "));e.appendChild(d);var h=f.createElement(b,"span");h.style.fontStyle="italic";h.appendChild(b.createTextNode(" "));e.appendChild(h);var p=f.createElement(b,"span");p.style.fontWeight="bold";p.appendChild(b.createTextNode(" ")); -e.appendChild(p);c=f.createElement(b,"span");c.style.fontWeight="bold";c.style.fontStyle="italic";c.appendChild(b.createTextNode(" "));e.appendChild(c);a.appendChild(e);var i=e.getBoundingClientRect(),d=d.getBoundingClientRect(),h=h.getBoundingClientRect(),p=p.getBoundingClientRect(),c=c.getBoundingClientRect(),d=d.bottom-d.top,h=h.bottom-h.top,p=p.bottom-p.top,q=c.bottom-c.top,r=0,c=i.bottom-i.top<=0,i=Math.max(1,i.bottom-i.top);h>d&&(r=1);p>h&&(r=2);q>p&&(r=3);var s;if(r!==0){s={style:{}};if((r& -1)!==0)s.style.fontStyle="italic";if((r&2)!==0)s.style.fontWeight="bold"}d=o(e);a.removeChild(e);q=l(this._viewDiv);e=f.createElement(b,"div");e.style.position="fixed";e.style.left="-1000px";e.style.paddingLeft=q.left+"px";e.style.paddingTop=q.top+"px";e.style.paddingRight=q.right+"px";e.style.paddingBottom=q.bottom+"px";e.style.width="100px";e.style.height="100px";q=f.createElement(b,"div");q.style.width="100%";q.style.height="100%";e.appendChild(q);a.appendChild(e);r=e.getBoundingClientRect();h= -q.getBoundingClientRect();p=0;if(!this._singleMode)e.style.overflow="hidden",q.style.height="200px",p=e.clientWidth,e.style.overflow="scroll",p-=e.clientWidth;a.removeChild(e);q={left:h.left-r.left,top:h.top-r.top,right:r.right-h.right,bottom:r.bottom-h.bottom};h=r=0;if(!c&&(this._wrapOffset||this._marginOffset))e=f.createElement(b,"div"),e.style.position="fixed",e.style.left="-1000px",e.innerHTML=Array(this._wrapOffset+1).join(" "),a.appendChild(e),r=e.getBoundingClientRect(),r=Math.ceil(r.right- -r.left),e.innerHTML=Array(this._marginOffset+1).join(" "),h=e.getBoundingClientRect(),h=Math.ceil(h.right-h.left),a.removeChild(e);return{lineHeight:i,largestFontStyle:s,lineTrim:d,viewPadding:q,scrollWidth:p,wrapWidth:r,marginWidth:h,invalid:c}},_cancelAnimation:function(){if(this._animation)this._animation.stop(),this._animation=null},_clearSelection:function(a){var b=this._getSelection();if(b.isEmpty())return!1;a==="next"?b.start=b.end:b.end=b.start;this._setSelection(b,!0);return!0},_commitIME:function(){if(this._imeOffset!== --1){this._scrollDiv.focus();this._clientDiv.focus();var a=this._model,b=a.getLineAtOffset(this._imeOffset),e=a.getLineStart(b),c=this._getDOMText(this._getLineNode(b)).text,a=a.getLine(b),e=this._imeOffset-e,a=e+c.length-a.length;e!==a&&this._doContent(c.substring(e,a));this._imeOffset=-1}},_createActions:function(){this.addKeyMode(new n.DefaultKeyMode(this));var a=this;this._actions={noop:{defaultHandler:function(){return a._doNoop()}},lineUp:{defaultHandler:function(e){return a._doLineUp(b(e,{select:!1}))}, -actionDescription:{name:k.lineUp}},lineDown:{defaultHandler:function(e){return a._doLineDown(b(e,{select:!1}))},actionDescription:{name:k.lineDown}},lineStart:{defaultHandler:function(e){return a._doHome(b(e,{select:!1,ctrl:!1}))},actionDescription:{name:k.lineStart}},lineEnd:{defaultHandler:function(e){return a._doEnd(b(e,{select:!1,ctrl:!1}))},actionDescription:{name:k.lineEnd}},charPrevious:{defaultHandler:function(e){return a._doCursorPrevious(b(e,{select:!1,unit:"character"}))},actionDescription:{name:k.charPrevious}}, -charNext:{defaultHandler:function(e){return a._doCursorNext(b(e,{select:!1,unit:"character"}))},actionDescription:{name:k.charNext}},pageUp:{defaultHandler:function(e){return a._doPageUp(b(e,{select:!1}))},actionDescription:{name:k.pageUp}},pageDown:{defaultHandler:function(e){return a._doPageDown(b(e,{select:!1}))},actionDescription:{name:k.pageDown}},scrollPageUp:{defaultHandler:function(e){return a._doScroll(b(e,{type:"pageUp"}))},actionDescription:{name:k.scrollPageUp}},scrollPageDown:{defaultHandler:function(e){return a._doScroll(b(e, -{type:"pageDown"}))},actionDescription:{name:k.scrollPageDown}},scrollLineUp:{defaultHandler:function(e){return a._doScroll(b(e,{type:"lineUp"}))},actionDescription:{name:k.scrollLineUp}},scrollLineDown:{defaultHandler:function(e){return a._doScroll(b(e,{type:"lineDown"}))},actionDescription:{name:k.scrollLineDown}},wordPrevious:{defaultHandler:function(e){return a._doCursorPrevious(b(e,{select:!1,unit:"word"}))},actionDescription:{name:k.wordPrevious}},wordNext:{defaultHandler:function(e){return a._doCursorNext(b(e, -{select:!1,unit:"word"}))},actionDescription:{name:k.wordNext}},textStart:{defaultHandler:function(e){return a._doHome(b(e,{select:!1,ctrl:!0}))},actionDescription:{name:k.textStart}},textEnd:{defaultHandler:function(e){return a._doEnd(b(e,{select:!1,ctrl:!0}))},actionDescription:{name:k.textEnd}},scrollTextStart:{defaultHandler:function(e){return a._doScroll(b(e,{type:"textStart"}))},actionDescription:{name:k.scrollTextStart}},scrollTextEnd:{defaultHandler:function(e){return a._doScroll(b(e,{type:"textEnd"}))}, -actionDescription:{name:k.scrollTextEnd}},centerLine:{defaultHandler:function(e){return a._doScroll(b(e,{type:"centerLine"}))},actionDescription:{name:k.centerLine}},selectLineUp:{defaultHandler:function(e){return a._doLineUp(b(e,{select:!0}))},actionDescription:{name:k.selectLineUp}},selectLineDown:{defaultHandler:function(e){return a._doLineDown(b(e,{select:!0}))},actionDescription:{name:k.selectLineDown}},selectWholeLineUp:{defaultHandler:function(e){return a._doLineUp(b(e,{select:!0,wholeLine:!0}))}, -actionDescription:{name:k.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(e){return a._doLineDown(b(e,{select:!0,wholeLine:!0}))},actionDescription:{name:k.selectWholeLineDown}},selectLineStart:{defaultHandler:function(e){return a._doHome(b(e,{select:!0,ctrl:!1}))},actionDescription:{name:k.selectLineStart}},selectLineEnd:{defaultHandler:function(e){return a._doEnd(b(e,{select:!0,ctrl:!1}))},actionDescription:{name:k.selectLineEnd}},selectCharPrevious:{defaultHandler:function(e){return a._doCursorPrevious(b(e, -{select:!0,unit:"character"}))},actionDescription:{name:k.selectCharPrevious}},selectCharNext:{defaultHandler:function(e){return a._doCursorNext(b(e,{select:!0,unit:"character"}))},actionDescription:{name:k.selectCharNext}},selectPageUp:{defaultHandler:function(e){return a._doPageUp(b(e,{select:!0}))},actionDescription:{name:k.selectPageUp}},selectPageDown:{defaultHandler:function(e){return a._doPageDown(b(e,{select:!0}))},actionDescription:{name:k.selectPageDown}},selectWordPrevious:{defaultHandler:function(e){return a._doCursorPrevious(b(e, -{select:!0,unit:"word"}))},actionDescription:{name:k.selectWordPrevious}},selectWordNext:{defaultHandler:function(e){return a._doCursorNext(b(e,{select:!0,unit:"word"}))},actionDescription:{name:k.selectWordNext}},selectTextStart:{defaultHandler:function(e){return a._doHome(b(e,{select:!0,ctrl:!0}))},actionDescription:{name:k.selectTextStart}},selectTextEnd:{defaultHandler:function(e){return a._doEnd(b(e,{select:!0,ctrl:!0}))},actionDescription:{name:k.selectTextEnd}},deletePrevious:{defaultHandler:function(e){return a._doBackspace(b(e, -{unit:"character"}))},actionDescription:{name:k.deletePrevious}},deleteNext:{defaultHandler:function(e){return a._doDelete(b(e,{unit:"character"}))},actionDescription:{name:k.deleteNext}},deleteWordPrevious:{defaultHandler:function(e){return a._doBackspace(b(e,{unit:"word"}))},actionDescription:{name:k.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(e){return a._doDelete(b(e,{unit:"word"}))},actionDescription:{name:k.deleteWordNext}},deleteLineStart:{defaultHandler:function(e){return a._doBackspace(b(e, -{unit:"line"}))},actionDescription:{name:k.deleteLineStart}},deleteLineEnd:{defaultHandler:function(e){return a._doDelete(b(e,{unit:"line"}))},actionDescription:{name:k.deleteLineEnd}},tab:{defaultHandler:function(){return a._doTab()},actionDescription:{name:k.tab}},shiftTab:{defaultHandler:function(){return a._doShiftTab()},actionDescription:{name:k.shiftTab}},enter:{defaultHandler:function(){return a._doEnter()},actionDescription:{name:k.enter}},enterNoCursor:{defaultHandler:function(e){return a._doEnter(b(e, -{noCursor:!0}))},actionDescription:{name:k.enterNoCursor}},selectAll:{defaultHandler:function(){return a._doSelectAll()},actionDescription:{name:k.selectAll}},copy:{defaultHandler:function(){return a._doCopy()},actionDescription:{name:k.copy}},cut:{defaultHandler:function(){return a._doCut()},actionDescription:{name:k.cut}},paste:{defaultHandler:function(){return a._doPaste()},actionDescription:{name:k.paste}},uppercase:{defaultHandler:function(e){return a._doCase(b(e,{type:"upper"}))},actionDescription:{name:k.uppercase}}, -lowercase:{defaultHandler:function(e){return a._doCase(b(e,{type:"lower"}))},actionDescription:{name:k.lowercase}},capitalize:{defaultHandler:function(e){return a._doCase(b(e,{unit:"word",type:"capitalize"}))},actionDescription:{name:k.capitalize}},reversecase:{defaultHandler:function(e){return a._doCase(b(e,{type:"reverse"}))},actionDescription:{name:k.reversecase}},toggleOverwriteMode:{defaultHandler:function(){return a._doOverwriteMode()},actionDescription:{name:k.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(){return a._doTabMode()}, -actionDescription:{name:k.toggleTabMode}},toggleWrapMode:{defaultHandler:function(){return a._doWrapMode()},actionDescription:{name:k.toggleWrapMode}}}},_createRulerParent:function(a){var b=f.createElement(document,"div");b.className=a;b.tabIndex=-1;b.style.overflow="hidden";b.style.MozUserSelect="none";b.style.WebkitUserSelect="none";b.style.position="absolute";b.style.top="0px";b.style.bottom="0px";b.style.cursor="default";b.style.display="none";b.setAttribute("aria-hidden","true");this._rootDiv.appendChild(b); -return b},_createRuler:function(a,b){if(this._clientDiv){var e=this._getRulerParent(a);if(e){if(e!==this._marginDiv||this._marginOffset)e.style.display="block";var c=f.createElement(e.ownerDocument,"div");c._ruler=a;c.rulerChanged=!0;c.style.position="relative";c.style.cssFloat="left";c.style.styleFloat="left";c.style.outline="none";if(b===void 0||b<0||b>=e.children.length)e.appendChild(c);else{for(var l=e.firstChild;l&&b-- >0;)l=l.nextSibling;e.insertBefore(c,l)}}}},_createView:function(){if(!this._clientDiv){for(var a= -this._parent;a.hasChildNodes();)a.removeChild(a.lastChild);var b=a.ownerDocument,e=f.createElement(b,"div");this._rootDiv=e;e.tabIndex=-1;e.style.position="relative";e.style.overflow="hidden";e.style.width="100%";e.style.height="100%";e.style.overflow="hidden";e.style.WebkitTextSizeAdjust="100%";e.setAttribute("role","application");a.appendChild(e);this._leftDiv=this._createRulerParent("textviewLeftRuler");a=f.createElement(b,"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";if(f.isMac&&f.isWebkit)a.style.pointerEvents="none",a.style.zIndex="2";e.appendChild(a);var c=this._createRulerParent("textviewRightRuler");this._rightDiv=c;c.style.right="0px";this._scrollDiv=c=f.createElement(b,"div");c.style.margin="0px";c.style.borderWidth="0px";c.style.padding="0px";a.appendChild(c);(this._marginDiv=this._createRulerParent("textviewMarginRuler")).style.zIndex= -"4";if(!f.isIE&&!f.isIOS)this._clipDiv=a=f.createElement(b,"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",e.appendChild(a),this._clipScrollDiv=c=f.createElement(b,"div"),c.style.position="absolute",c.style.height="1px",c.style.top="-1000px",c.style.background="transparent",a.appendChild(c);this._setFullSelection(this._fullSelection,!0);a=f.createElement(b,"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(f.isIOS||f.isAndroid)a.style.WebkitTapHighlightColor="transparent";(this._clipDiv||e).appendChild(a);if(f.isIOS||f.isAndroid)this._vScrollDiv=c=f.createElement(b,"div"),c.style.position="absolute",c.style.borderWidth="1px",c.style.borderColor="white",c.style.borderStyle= -"solid",c.style.borderRadius="4px",c.style.backgroundColor="black",c.style.opacity="0.5",c.style.margin="0px",c.style.padding="0px",c.style.outline="none",c.style.zIndex="3",c.style.width="8px",c.style.display="none",e.appendChild(c),this._hScrollDiv=c=f.createElement(b,"div"),c.style.position="absolute",c.style.borderWidth="1px",c.style.borderColor="white",c.style.borderStyle="solid",c.style.borderRadius="4px",c.style.backgroundColor="black",c.style.opacity="0.5",c.style.margin="0px",c.style.padding= -"0px",c.style.outline="none",c.style.zIndex="3",c.style.height="8px",c.style.display="none",e.appendChild(c);if(f.isFirefox&&!a.setCapture)this._overlayDiv=b=f.createElement(b,"div"),b.style.position=a.style.position,b.style.borderWidth=a.style.borderWidth,b.style.margin=a.style.margin,b.style.padding=a.style.padding,b.style.cursor="text",b.style.zIndex="2",(this._clipDiv||e).appendChild(b);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();e=this._rulers;for(b=0;bthis._getLineHeight()){var a=b.getBoundingClientRect(),e=this._clientDiv.getBoundingClientRect();a.bottom>e.bottom&&(b=this._getLinePrevious(b)||b)}return b.lineIndex},_getBoundsAtOffset:function(a){var b=this._getLine(this._model.getLineAtOffset(a)),a=b.getBoundingClientRect(a),e=this._getLinePixel(b.lineIndex);a.top+=e;a.bottom+=e;b.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,b){var c=this._model.getLineDelimiter(),l,d,o=this._getWindow(),g=o.clipboardData;if(!g&&a)g=a.clipboardData;if(g)return l=[],d=g.getData(f.isIE?"Text":"text/plain"),e(d,function(a){l.push(a)},function(){l.push(c)}),d=l.join(""),b&&b(d),d;if(f.isFirefox){this._ignoreFocus=!0;var h=this._clipboardDiv,g=this._rootDiv.ownerDocument; -if(!h)this._clipboardDiv=h=f.createElement(g,"div"),h.style.position="fixed",h.style.whiteSpace="pre",h.style.left="-1000px",this._rootDiv.appendChild(h);h.innerHTML="
";h.firstChild.focus();var p=this,i=function(){var a=p._getTextFromElement(h);h.innerHTML="";l=[];e(a,function(a){l.push(a)},function(){l.push(c)});return l.join("")},q=!1;this._ignorePaste=!0;if(!f.isLinux||this._lastMouseButton!==2)try{q=g.execCommand("paste",!1,null)}catch(r){q=h.childNodes.length>1||
-h.firstChild&&h.firstChild.childNodes.length>0}this._ignorePaste=!1;if(!q)return a?(o.setTimeout(function(){p.focus();(d=i())&&b&&b(d);p._ignoreFocus=!1},0),null):(this.focus(),this._ignoreFocus=!1,"");this.focus();this._ignoreFocus=!1;(d=i())&&b&&b(d);return d}return""},_getDOMText:function(a,b){for(var e=a.firstChild,c="",l=0;e;){var f;if(!e.ignore)if(e.ignoreChars){f=e.lastChild;for(var d=0,o=[],g=-1;f;){var h=f.data;if(h)for(var p=h.length-1;p>=0;p--){var i=h.substring(p,p+1);db)for(;b=a;b--)e-=this._getLineHeight(b);return e}return this._getLineHeight()*a},_getLineIndex:function(a){var b,e=0,c=this._model.getLineCount();if(this._lineHeight){var e=this._getTopIndex(),l=-this._topIndexY+this._getScroll().y;if(a!==l)if(a0;)a+=this._getLineHeight(--e);else for(b=this._getLineHeight(e);a-b>=l&&ethis._getLineHeight()){var a=b.getBoundingClientRect(),e=this._getViewPadding(),
-c=this._viewDiv.getBoundingClientRect();a.top=15))(c=g.MutationObserver||
-g.MozMutationObserver)?(this._mutationObserver=new c(function(b){a._handleDataModified(b)}),this._mutationObserver.observe(e,{subtree:!0,characterData:!0})):b.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(b){return a._handleDataModified(b?b:g.event)}});this._overlayDiv&&(b.push({target:this._overlayDiv,type:"mousedown",handler:function(b){return a._handleMouseDown(b?b:g.event)}}),b.push({target:this._overlayDiv,type:"mouseover",handler:function(b){return a._handleMouseOver(b?
-b:g.event)}}),b.push({target:this._overlayDiv,type:"mouseout",handler:function(b){return a._handleMouseOut(b?b:g.event)}}),b.push({target:this._overlayDiv,type:"contextmenu",handler:function(b){return a._handleContextMenu(b?b:g.event)}}));this._isW3CEvents||b.push({target:this._clientDiv,type:"dblclick",handler:function(b){return a._handleDblclick(b?b:g.event)}})}this._hookRulerEvents(this._leftDiv,b);this._hookRulerEvents(this._rightDiv,b);this._hookRulerEvents(this._marginDiv,b);for(c=0;c=9)&&typeof b.ownerDocument.createRange().getBoundingClientRect==="function";this._isW3CEvents=b.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,b){if(!this._readonly||a._code)if(a.type="Verify",this.onVerify(a),!(a.text===null||a.text===void 0)){var e=this._model;try{if(a._ignoreDOMSelection)this._ignoreDOMSelection=!0;e.setText(a.text,a.start,a.end)}finally{if(a._ignoreDOMSelection)this._ignoreDOMSelection=!1}b&&(e=this._getSelection(),e.setCaret(a.start+a.text.length),this._setSelection(e,!0));this.onModify({type:"Modify"})}},_onModelChanged:function(a){a.type="ModelChanged";this.onModelChanged(a);
-a.type="Changed";var b=a.start,e=a.addedCharCount,c=a.removedCharCount,l=a.addedLineCount,f=a.removedLineCount,d=this._getSelection();d.end>b&&(d.end>b&&d.startb+f)e.lineIndex=c+l-f,
-e._line.lineIndex=e.lineIndex;e=this._getLineNext(e)}this._lineHeight&&(a=[b,f].concat(Array(l)),Array.prototype.splice.apply(this._lineHeight,a));if(!this._wrapMode&&b<=this._maxLineIndex&&this._maxLineIndex<=b+f)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,b){if(this._wrapMode||this._variableLineHeight){if(a!==void 0&&b!==void 0)for(var e=a;e0&&h.removeAllRanges();h.addRange(d);var p=this,d=function(){g&&g.parentNode===p._clientDiv&&p._clientDiv.removeChild(g);p._updateDOMSelection()},h=!1;this._ignoreCopy=!0;try{h=o.execCommand("copy",!1,null)}catch(i){}this._ignoreCopy=!1;if(!h&&b)return l.setTimeout(d,0),!1;d();return!0},_setDOMSelection:function(a,b,e,c,l){for(var d,o,g,h,p=0,i=a.firstChild,q,r,s=this._model.getLine(a.lineIndex).length;i;){if(!i.ignore){q=
-i.firstChild;r=q.length;i.ignoreChars&&(r-=i.ignoreChars);if(p+r>b||p+r>=s){d=q;o=b-p;i.ignoreChars&&r>0&&o===r&&(o+=i.ignoreChars);break}p+=r}i=i.nextSibling}for(var p=0,i=e.firstChild,t=this._model.getLine(e.lineIndex).length;i;){if(!i.ignore){q=i.firstChild;r=q.length;i.ignoreChars&&(r-=i.ignoreChars);if(r+p>c||p+r>=t){g=q;h=c-p;i.ignoreChars&&r>0&&h===r&&(h+=i.ignoreChars);break}p+=r}i=i.nextSibling}this._setDOMFullSelection(a,b,s,e,c,t);a=this._getWindow();b=this._parent.ownerDocument;if(a.getSelection){e=
-a.getSelection();a=b.createRange();a.setStart(d,o);a.setEnd(g,h);if(this._hasFocus&&(e.anchorNode!==d||e.anchorOffset!==o||e.focusNode!==g||e.focusOffset!==h||e.anchorNode!==g||e.anchorOffset!==h||e.focusNode!==d||e.focusOffset!==o))this._anchorNode=d,this._anchorOffset=o,this._focusNode=g,this._focusOffset=h,this._ignoreSelect=!1,e.rangeCount>0&&e.removeAllRanges(),e.addRange(a),this._ignoreSelect=!0;if(this._cursorDiv&&(a=b.createRange(),l?(a.setStart(d,o),a.setEnd(d,o)):(a.setStart(g,h),a.setEnd(g,
-h)),g=a.getClientRects()[0],h=this._cursorDiv.parentNode,d=h.getBoundingClientRect(),g&&d))this._cursorDiv.style.top=g.top-d.top+h.scrollTop+"px",this._cursorDiv.style.left=g.left-d.left+h.scrollLeft+"px"}else if(b.selection&&this._hasFocus)l=b.body,a=f.createElement(b,"div"),l.appendChild(a),l.removeChild(a),a=l.createTextRange(),a.moveToElementText(d.parentNode),a.moveStart("character",o),d=l.createTextRange(),d.moveToElementText(g.parentNode),d.moveStart("character",h),a.setEndPoint("EndToStart",
-d),this._ignoreSelect=!1,a.select(),this._ignoreSelect=!0},_setDOMFullSelection:function(a,b,e,c,l){if(this._selDiv1&&(e=this._selDiv1,e.style.width="0px",e.style.height="0px",e=this._selDiv2,e.style.width="0px",e.style.height="0px",e=this._selDiv3,e.style.width="0px",e.style.height="0px",!(a===c&&b===l))){var f=this._model,d=this._getViewPadding(),o=this._clientDiv.getBoundingClientRect(),g=this._viewDiv.getBoundingClientRect(),e=g.left+d.left,h=o.right,d=g.top+d.top,i=o.bottom,g=o=0;this._clipDiv?
-(g=this._clipDiv.getBoundingClientRect(),o=g.left-this._clipDiv.scrollLeft):(g=this._rootDiv.getBoundingClientRect(),o=g.left);g=g.top;this._ignoreDOMSelection=!0;var q=(new p(this,a.lineIndex,a)).getBoundingClientRect(f.getLineStart(a.lineIndex)+b,!1),r=q.left,b=(new p(this,c.lineIndex,c)).getBoundingClientRect(f.getLineStart(c.lineIndex)+l,!1),f=b.left;this._ignoreDOMSelection=!1;var s=this._selDiv1,r=Math.min(h,Math.max(e,r)),t=Math.min(i,Math.max(d,q.top)),u=h,l=Math.min(i,Math.max(d,q.bottom));
-s.style.left=r-o+"px";s.style.top=t-g+"px";s.style.width=Math.max(0,u-r)+"px";s.style.height=Math.max(0,l-t)+"px";if(a.lineIndex===c.lineIndex)u=Math.min(f,h),s.style.width=Math.max(0,u-r)+"px";else if(q=Math.min(i,Math.max(d,b.top)),f=Math.min(h,Math.max(e,f)),d=Math.min(i,Math.max(d,b.bottom)),i=this._selDiv3,i.style.left=e-o+"px",i.style.top=q-g+"px",i.style.width=Math.max(0,f-e)+"px",i.style.height=Math.max(0,d-q)+"px",Math.abs(a.lineIndex-c.lineIndex)>1)a=this._selDiv2,a.style.left=e-o+"px",
-a.style.top=l-g+"px",a.style.width=Math.max(0,h-e)+"px",a.style.height=Math.max(0,q-l)+"px"}},_setGrab:function(a){if(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;if(f.isIE&&a)this._hadFocus=this._hasFocus;var b=this._clientDiv;b.contentEditable=!a;this._hadFocus&&!a&&b.focus();if(this._overlayDiv)this._overlayDiv.style.zIndex=
-a?"-1":"1";for(a=this._getLineNext();a;){if(a.hasLink)for(b=a.firstChild;b;)if(b.ignore)b=b.nextSibling;else{var e=b.nextSibling,c=b.viewStyle;c&&c.tagName&&c.tagName.toLowerCase()==="a"&&a.replaceChild(a._line._createSpan(a,b.firstChild.data,c),b);b=e}a=this._getLineNext(a)}this._updateDOMSelection()}},_setSelection:function(a,b,e,c,l){if(a){this._columnX=-1;e===void 0&&(e=!0);var f=this._selection;this._selection=a;b!==!1&&this._showCaret(!1,c,b,l);e&&this._updateDOMSelection();if(!f.equals(a))this.onSelection({type:"Selection",
-oldValue:{start:f.start,end:f.end},newValue:{start:a.start,end:a.end}})}},_setSelectionTo:function(a,b,e,c){var l=this._model,f=this._getSelection(),b=this.convert({x:a,y:b},"page","document"),a=this._getLineIndex(b.y);if(this._clickCount===1){l=this._getLine(a);a=l.getOffset(b.x,b.y-this._getLinePixel(a));l.destroy();if(c&&!e&&f.start<=a&&a=this._doubleClickSelection.start?(e=this._doubleClickSelection.start,c=l.getNextOffset(a,{unit:"wordend",count:1})):(e=l.getNextOffset(a,{unit:"word",count:-1}),c=this._doubleClickSelection.end):(e=l.getNextOffset(a,{unit:"word",count:-1}),c=l.getNextOffset(e,{unit:"wordend",count:1})),l.destroy()):this._doubleClickSelection?(c=l.getLineAtOffset(this._doubleClickSelection.start),a>=c?(e=l.getLineStart(c),c=l.getLineEnd(a)):(e=l.getLineStart(a),c=l.getLineEnd(c))):(e=
-l.getLineStart(a),c=l.getLineEnd(a)),f.setCaret(e),f.extend(c);this._setSelection(f,!0,!0);return!0},_setFullSelection:function(a,b){this._fullSelection=a;if(f.isWebkit)this._fullSelection=!0;var e=this._clipDiv||this._rootDiv;if(e)if(this._fullSelection){if(!this._selDiv1&&this._fullSelection&&!f.isIOS){var c=e.ownerDocument;this._highlightRGB=f.isWebkit?"transparent":"Highlight";var l=f.createElement(c,"div");this._selDiv1=l;l.style.position="absolute";l.style.borderWidth="0px";l.style.margin="0px";
-l.style.padding="0px";l.style.outline="none";l.style.background=this._highlightRGB;l.style.width="0px";l.style.height="0px";l.style.zIndex="0";e.appendChild(l);var d=f.createElement(c,"div");this._selDiv2=d;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";e.appendChild(d);this._selDiv3=c=f.createElement(c,"div");c.style.position="absolute";
-c.style.borderWidth="0px";c.style.margin="0px";c.style.padding="0px";c.style.outline="none";c.style.background=this._highlightRGB;c.style.width="0px";c.style.height="0px";c.style.zIndex="0";e.appendChild(c);if(f.isFirefox&&f.isMac){e=this._getWindow().getComputedStyle(c,null).getPropertyValue("background-color");switch(e){case "rgb(119, 141, 168)":e="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":e="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":e="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":e=
-"rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":e="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":e="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":e="rgb(232, 184, 255)";break;default:e="rgb(180, 213, 255)"}this._highlightRGB=e;l.style.background=e;d.style.background=e;c.style.background=e}b||this._updateDOMSelection()}}else{if(this._selDiv1)e.removeChild(this._selDiv1),this._selDiv1=null;if(this._selDiv2)e.removeChild(this._selDiv2),this._selDiv2=null;if(this._selDiv3)e.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=f.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=" ";this._viewDiv.appendChild(a);this._updateDOMSelection()}}else if(this._cursorDiv)this._cursorDiv.parentNode.removeChild(this._cursorDiv),this._cursorDiv=null},_setMarginOffset:function(a,b){this._marginOffset=a;this._marginDiv.style.display=a?"block":"none";if(!b)this._metrics=this._calculateMetrics(),this._queueUpdate()},_setWrapOffset:function(a,b){this._wrapOffset=a;if(!b)this._metrics=this._calculateMetrics(),this._queueUpdate()},_setReadOnly:function(a){this._readonly=
-a;this._clientDiv.setAttribute("aria-readonly",a?"true":"false")},_setSingleMode:function(a,b){this._singleMode=a;this._updateOverflow();this._updateStyle(b)},_setTabSize:function(a,b){this._tabSize=a;this._customTabSize=void 0;var e=this._clientDiv;if(f.isOpera){if(e)e.style.OTabSize=this._tabSize+""}else if(f.isWebkit>=537.1){if(e)e.style.tabSize=this._tabSize+""}else if(f.isFirefox>=4){if(e)e.style.MozTabSize=this._tabSize+""}else if(this._tabSize!==8)this._customTabSize=this._tabSize;b||(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,b){this._themeClass=a;var e="textview",c=this._theme.getThemeClass();c&&(e+=" "+c);this._themeClass&&c!==this._themeClass&&(e+=" "+this._themeClass);this._rootDiv.className=e;this._updateStyle(b)},_setWrapMode:function(a,
-b){this._wrapMode=a&&this._wrappable;var e=this._clientDiv;this._wrapMode?(e.style.whiteSpace="pre-wrap",e.style.wordWrap="break-word"):(e.style.whiteSpace="pre",e.style.wordWrap="normal");this._updateOverflow();b||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a,b,e,c){if(this._clientDiv){var l=this._model,f=this._getSelection(),d=this._getScroll(),o=f.getCaret(),g=f.start,h=f.end,p=l.getLineAtOffset(h),i=Math.max(Math.max(g,l.getLineStart(p)),h-1),l=this._getClientWidth(),
-p=this._getClientHeight(),q=l/4,r=this._getBoundsAtOffset(o===g?g:i),s=r.left,t=r.right,u=r.top,v=r.bottom;a&&!f.isEmpty()&&(r=this._getBoundsAtOffset(o===h?g:i),r.top===u?o===g?t=s+Math.min(r.right-s,l):s=t-Math.min(t-r.left,l):o===g?v=u+Math.min(r.bottom-u,p):u=v-Math.min(v-r.top,p));a=0;sd.x+l&&(a=Math.max(t-d.x-l,q));f=0;ud.y+p&&(f=v-d.y-p);c&&(c>0?f>0&&(f=Math.max(f,c)):f<0&&(f=Math.min(f,c)));if(a!==0||f!==0)return f!==0&&typeof e==="number"&&(e<
-0&&(e=0),e>1&&(e=1),f+=Math.floor(f>0?e*p:-e*p)),this._scrollViewAnimated(a,f,b),p!==this._getClientHeight()||l!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0;else b&&b();return!1}},_startIME:function(){if(this._imeOffset===-1){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;a0)&&!this._ignoreDOMSelection&&this._clientDiv){var a=this._getSelection(),b=this._model,e=b.getLineAtOffset(a.start),
-c=b.getLineAtOffset(a.end),l=this._getLineNext();if(l){var f=this._getLinePrevious(),d;ef.lineIndex?(d=f,e=0):(d=this._getLineNode(e),e=a.start-b.getLineStart(e));cf.lineIndex?(l=f,b=0):(l=this._getLineNode(c),b=a.end-b.getLineStart(c));this._setDOMSelection(d,e,l,b,a.caret)}}},_update:function(a){if(!(this._redrawCount>0)){if(this._updateTimer)this._getWindow().clearTimeout(this._updateTimer),this._updateTimer=null,a=!1;var b=this._clientDiv,e=this._viewDiv;
-if(b){if(this._metrics.invalid)this._ignoreQueueUpdate=!0,this._updateStyle(),this._ignoreQueueUpdate=!1;var c=this._model,l=this._getScroll(!1),d=this._getViewPadding(),o=c.getLineCount(),g=this._getLineHeight(),h=!1,i=!1,q=!1,r=this._metrics.scrollWidth;if(this._wrapMode)b.style.width=(this._metrics.wrapWidth||this._getClientWidth())+"px";var s,t,u,v,k=0,n=0,m;if(this._lineHeight){for(;nl.y)break;k+=m;n++}s=n;t=Math.max(0,s-1);u=c=l.y-k;s>0&&(c+=this._getLineHeight(s-
-1))}else v=Math.max(0,l.y)/g,s=Math.floor(v),t=Math.max(0,s-1),c=Math.round((v-t)*g),u=Math.round((v-s)*g);this._topIndexY=u;v=this._rootDiv;var I=v.clientWidth,F=v.clientHeight;if(a){g=0;this._leftDiv&&(s=this._leftDiv.getBoundingClientRect(),g=s.right-s.left);s=this._getClientWidth();v=this._getClientHeight();i=s;if(this._wrapMode){if(this._metrics.wrapWidth)i=this._metrics.wrapWidth}else i=Math.max(this._maxLineWidth,i);for(;nA)(new p(this,A)).create(C,null);else{C.firstChild&&(b.insertBefore(C,m),C=z.createDocumentFragment());if(m&&m.lineChanged)m=(new p(this,
-A)).create(C,m),m.lineChanged=!1;m=this._getLineNext(m)}C.firstChild&&b.insertBefore(C,m);if(f.isWebkit&&!this._wrapMode)b.style.width="0x7fffffffpx";m=this._getLineNext();A=v+c;for(C=!1;m;){t=m.lineWidth;if(t===void 0)if(z=m._line.getBoundingClientRect(),t=m.lineWidth=Math.ceil(z.right-z.left),z=z.bottom-z.top,this._lineHeight)this._lineHeight[m.lineIndex]=z;else if(g!==0&&z!==0&&Math.ceil(g)!==Math.ceil(z))this._variableLineHeight=!0,this._lineHeight=[],this._lineHeight[m.lineIndex]=z;if(this._lineHeight&&
-!C&&(A-=this._lineHeight[m.lineIndex],A<0))u=m.lineIndex,C=!0;if(!this._wrapMode){if(t>=this._maxLineWidth)this._maxLineWidth=t,this._maxLineIndex=m.lineIndex;if(this._checkMaxLineIndex===m.lineIndex)this._checkMaxLineIndex=-1}if(m.lineIndex===s)this._topChild=m;if(m.lineIndex===u)this._bottomChild=m;m=this._getLineNext(m)}if(this._checkMaxLineIndex!==-1&&(A=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,0<=A&&A=this._maxLineWidth)this._maxLineWidth=
-t,this._maxLineIndex=A;g.destroy()}for(;nv&&(q=!0,s=m);this._maxLineWidth>s&&(i=!0,v=k,o>v&&(q=!0,s=m));if(n!==i)e.style.overflowX=i?"scroll":"hidden";if(t!==q)e.style.overflowY=q?"scroll":"hidden";h=n!==i||t!==q}q=s;if(this._wrapMode){if(this._metrics.wrapWidth)q=this._metrics.wrapWidth}else q=Math.max(this._maxLineWidth,q);i=q;if((!f.isIE||f.isIE>=9)&&this._maxLineWidth>s)q+=d.right+d.left;l.style.width=q+"px";if(this._clipScrollDiv)this._clipScrollDiv.style.width=
-q+"px";l=this._getScroll(!1)}if(this._vScrollDiv)q=v-8,k=Math.max(15,Math.ceil(Math.min(1,q/(o+d.top+d.bottom))*q)),this._vScrollDiv.style.left=g+s-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,l.y*q/o))+"px",this._vScrollDiv.style.height=k+"px";if(!this._wrapMode&&this._hScrollDiv)q=s-8,k=Math.max(15,Math.ceil(Math.min(1,q/(this._maxLineWidth+d.left+d.right))*q)),this._hScrollDiv.style.left=g+Math.floor(Math.max(0,Math.floor(l.x*q/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=v-
-9+"px",this._hScrollDiv.style.width=k+"px";n=l.x;k=this._clipDiv;q=this._overlayDiv;if(u=this._marginDiv)u.style.left=-n+g+this._metrics.marginWidth+d.left+"px",u.style.bottom=(e.style.overflowX==="scroll"?r:0)+"px";if(k){k.scrollLeft=n;k.scrollTop=0;e=g+d.left;r=d.top;a=s;g=v;n=0;u=-c;if(l.x===0)e-=d.left,a+=d.left,n=d.left;l.x+s===i&&(a+=d.right);l.y===0&&(r-=d.top,g+=d.top,u+=d.top);l.y+v===o&&(g+=d.bottom);k.style.left=e+"px";k.style.top=r+"px";k.style.right=I-a-e+"px";k.style.bottom=F-g-r+"px";
-b.style.left=n+"px";b.style.top=u+"px";b.style.width=i+"px";b.style.height=v+c+"px";if(q)q.style.left=b.style.left,q.style.top=b.style.top,q.style.width=b.style.width,q.style.height=b.style.height}else{e=n;r=c;I=n+s;F=c+v;e===0&&(e-=d.left);r===0&&(r-=d.top);I===i&&(I+=d.right);l.y+v===o&&(F+=d.bottom);b.style.clip="rect("+r+"px,"+I+"px,"+F+"px,"+e+"px)";b.style.left=-n+g+d.left+"px";b.style.width=(this._wrapMode||f.isWebkit?i:s+n)+"px";if(!a)b.style.top=-c+d.top+"px",b.style.height=v+c+"px";if(q&&
-(q.style.clip=b.style.clip,q.style.left=b.style.left,q.style.width=b.style.width,!a))q.style.top=b.style.top,q.style.height=b.style.height}this._updateDOMSelection();if(h)b=this._ensureCaretVisible,this._ensureCaretVisible=!1,b&&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,b,e,c){if(a)for(var l=this._parent.ownerDocument,d=this._getLineHeight(),
-o=this._getViewPadding(),a=a.firstChild;a;){var h=a._ruler,p=d,i=h.getOverview();i==="page"&&(p+=this._topIndexY);a.style.top=-p+"px";a.style.height=c+p+"px";a.rulerChanged&&g(h.getRulerStyle(),a);var q,r=a.firstChild;r?(q=r,r=r.nextSibling):(q=f.createElement(l,"div"),q.style.visibility="hidden",a.appendChild(q));var s;if(a.rulerChanged&&q){p=-1;if(s=h.getWidestAnnotation())if(g(s.style,q),s.html)q.innerHTML=s.html;q.lineIndex=p;q.style.height=d+o.top+"px"}var t;if(i==="page"){for(h=h.getAnnotations(b,
-e+1);r;)p=r.lineIndex,s=r.nextSibling,(!(b<=p&&p<=e)||r.lineChanged)&&a.removeChild(r),r=s;r=a.firstChild.nextSibling;t=l.createDocumentFragment();for(p=b;p<=e;p++)if(!r||r.lineIndex>p){q=f.createElement(l,"div");if(s=h[p]){g(s.style,q);if(s.html)q.innerHTML=s.html;q.annotation=s}q.lineIndex=p;q.style.height=this._getLineHeight(p)+"px";t.appendChild(q)}else if(t.firstChild&&(a.insertBefore(t,r),t=l.createDocumentFragment()),r)r=r.nextSibling;t.firstChild&&a.insertBefore(t,r)}else{s=this._getClientHeight();
-p=this._model.getLineCount();r=s+o.top+o.bottom-2*this._metrics.scrollWidth;i=d*p1;)a.removeChild(a.lastChild),s--;h=h.getAnnotations(0,p);t=l.createDocumentFragment();for(var u in h)if(p=u>>>0,!(p<0)){q=f.createElement(l,"div");s=h[u];g(s.style,q);q.style.position="absolute";q.style.top=this._metrics.scrollWidth+d+Math.floor(p*i)+"px";if(s.html)q.innerHTML=s.html;q.annotation=s;q.lineIndex=p;t.appendChild(q)}a.appendChild(t)}else if(a._oldTrackHeight!==
-r)for(q=a.firstChild?a.firstChild.nextSibling:null;q;)q.style.top=this._metrics.scrollWidth+d+Math.floor(q.lineIndex*i)+"px",q=q.nextSibling;a._oldTrackHeight=r}a.rulerChanged=!1;a=a.nextSibling}},_updateStyleSheet:function(){var a="";f.isWebkit&&this._metrics.scrollWidth>0&&(a+="\n.textview ::-webkit-scrollbar-corner {background: #eeeeee;}");f.isFirefox&&f.isMac&&this._highlightRGB&&this._highlightRGB!=="Highlight"&&(a+="\n.textview ::-moz-selection {background: "+this._highlightRGB+";}");if(a){var b=
-document.getElementById("_textviewStyle");if(b)b.removeChild(b.firstChild),b.appendChild(document.createTextNode(a));else{b=f.createElement(document,"style");b.id="_textviewStyle";var e=document.getElementsByTagName("head")[0]||document.documentElement;b.appendChild(document.createTextNode(a));e.insertBefore(b,e.firstChild)}}},_updateStyle:function(a){if(!a&&f.isIE)this._rootDiv.style.lineHeight="normal";var b=this._metrics=this._calculateMetrics();this._rootDiv.style.lineHeight=f.isIE?b.lineHeight-
-(b.lineTrim.top+b.lineTrim.bottom)+"px":"normal";this._updateStyleSheet();a||(this.redraw(),this._resetLineWidth())}};i.EventTarget.addMixin(t.prototype);return{TextView:t}});
-define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(k,m){function n(i){this._model=i;this._projections=[];var c=this;this._listener={onChanged:function(d){c._onChanged(d)},onChanging:function(d){c._onChanging(d)}};i.addEventListener("postChanged",this._listener.onChanged);i.addEventListener("preChanging",this._listener.onChanging)}n.prototype={destroy:function(){if(this._model)this._model.removeEventListener("postChanged",this._listener.onChanged),
-this._model.removeEventListener("preChanging",this._listener.onChanging),this._model=null},addProjection:function(i){if(i){var c=this._model,d=this._projections;i._lineIndex=c.getLineAtOffset(i.start);i._lineCount=c.getLineAtOffset(i.end)-i._lineIndex;var f=i.text;f||(f="");i._model=typeof f==="string"?new k.TextModel(f,c.getLineDelimiter()):f;var c=this.mapOffset(i.start,!0),f=i.end-i.start,g=i._lineCount,h=i._model.getCharCount(),b=i._model.getLineCount()-1;this.onChanging({type:"Changing",text:i._model.getText(),
-start:c,removedCharCount:f,addedCharCount:h,removedLineCount:g,addedLineCount:b});var a=this._binarySearch(d,i.start);d.splice(a,0,i);this.onChanged({type:"Changed",start:c,removedCharCount:f,addedCharCount:h,removedLineCount:g,addedLineCount:b})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(i,c){var d=this._projections,f=0,g,h;if(c){for(g=0;gi)break;if(h.end>i)return-1;f+=h._model.getCharCount()-
-(h.end-h.start)}return i+f}for(g=0;gi-f)break;var b=h._model.getCharCount();if(h.start+b>i-f)return-1;f+=b-(h.end-h.start)}return i-f},removeProjection:function(i){var c,d=0;for(c=0;c1;)g=Math.floor((d+f)/2),c<=i[g].start?d=g:f=g;return d},getCharCount:function(){for(var i=this._model.getCharCount(),c=this._projections,d=0;d=i-g)break;e=l._model.getLineCount()-1;if(l._lineIndex+e>=i-g)if(b=i-(l._lineIndex+g),bi-g)break;h.push(d.getText(b,l.start));e=l._model.getLineCount()-1;if(l._lineIndex+
-e>i-g)return h.push(l._model.getLine(0,c)),h.join("");h.push(l._model.getText());b=l.end;g+=e-l._lineCount}f=d.getLineEnd(i-g,c);bi-f)break;var a=b._model.getCharCount();if(b.start+a>i-f){d=i-(b.start+f);g+=b._model.getLineAtOffset(d);f+=d;break}g+=b._model.getLineCount()-1-b._lineCount;f+=a-(b.end-b.start)}return c.getLineAtOffset(i-
-f)+g},getLineCount:function(){for(var i=this._projections,c=this._model.getLineCount(),d=0;di-g)break;var e=a._model.getLineCount()-1;if(a._lineIndex+e>i-g)return a._model.getLineEnd(i-(a._lineIndex+g),c)+a.start+h;h+=
-a._model.getCharCount()-(a.end-a.start);g+=e-a._lineCount}return d.getLineEnd(i-g,c)+h},getLineStart:function(i){if(i<0)return-1;for(var c=this._model,d=this._projections,f=0,g=0,h=0;h=i-f)break;var a=b._model.getLineCount()-1;if(b._lineIndex+a>=i-f)return b._model.getLineStart(i-(b._lineIndex+f))+b.start+g;g+=b._model.getCharCount()-(b.end-b.start);f+=a-b._lineCount}return c.getLineStart(i-f)+g},getText:function(i,c){i===void 0&&(i=0);var d=this._model,f=
-this._projections,g=0,h=[],b,a,e;for(b=0;bi-g)break;e=a._model.getCharCount();if(a.start+e>i-g)if(c!==void 0&&a.start+e>c-g)return a._model.getText(i-(a.start+g),c-(a.start+g));else h.push(a._model.getText(i-(a.start+g))),i=a.end+g+e-(a.end-a.start);g+=e-(a.end-a.start)}var l=i-g;if(c!==void 0){for(;bc-g)break;h.push(d.getText(l,a.start));e=a._model.getCharCount();if(a.start+e>c-g)return h.push(a._model.getText(0,c-(a.start+g))),h.join("");
-h.push(a._model.getText());l=a.end;g+=e-(a.end-a.start)}h.push(d.getText(l,c-g))}else{for(;bc)break;var b=f;for(f=0;f=d)break;var a=f,e=this._model,c=i.baseText.length-(d-c);for(f=a;fc)break;if(e.end>c)return-1;b+=e._model.getCharCount()-(e.end-e.start)}return c+b};d.start=i(f);if(d.start===-1)d.text=this._model.getText(e.start,f)+d.text,d.addedLineCount+=this._model.getLineAtOffset(f)-this._model.getLineAtOffset(e.start),d.start=e.start+b;d.end=i(g);if(d.end===-1)d.text+=this._model.getText(g,e.end),d.addedLineCount+=this._model.getLineAtOffset(e.end)-
-this._model.getLineAtOffset(g),d.end=e.start+b}d.addedCharCount=d.text.length;d.removedCharCount=d.end-d.start;d.removedLineCount=this.getLineAtOffset(d.end)-this.getLineAtOffset(d.start);this.onChanging({type:"Changing",text:d.text,start:d.start,removedCharCount:d.removedCharCount,addedCharCount:d.addedCharCount,removedLineCount:d.removedLineCount,addedLineCount:d.addedLineCount})},onChanging:function(i){return this.dispatchEvent(i)},onChanged:function(i){return this.dispatchEvent(i)},setLineDelimiter:function(i){this._model.setLineDelimiter(i)},
-setText:function(i,c,d){function f(e){for(b=0,h=0;be-h)break;var c=a._model.getCharCount();if(a.start+c>e-h)return-1;h+=c-(a.end-a.start)}return e-h}this._change={text:i||"",start:c||0,end:d===void 0?this.getCharCount():d};var g=this._projections,h,b,a,e,l,i=f(this._change.start);if(i===-1)e={projection:a,start:this._change.start-(a.start+h)},i=a.end;c=f(this._change.end);if(c===-1)l={projection:a,end:this._change.end-(a.start+h)},c=a.start;if(e&&l&&e.projection===
-l.projection)a._model.setText(this._change.text,e.start,l.end);else{this._model.setText(this._change.text,i,c);if(e)a=e.projection,a._model.setText("",e.start);if(l)a=l.projection,a._model.setText("",0,l.end),a.start=a.end,a._lineCount=0}this._change=void 0}};m.EventTarget.addMixin(n.prototype);return{ProjectionTextModel:n}});
-define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(k,m){function n(b,a,e){this.start=b;this.end=a;this._projectionModel=e;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function i(){}function c(b,a){var e=b.lastIndexOf("."),e=b.substring(e+1),c={title:k[e],style:{styleClass:"annotation "+e},html:"
",overviewStyle:{styleClass:"annotationOverview "+e}};a?c.lineStyle={styleClass:"annotationLine "+ -e}:c.rangeStyle={styleClass:"annotationRange "+e};i.registerType(b,c)}function d(){}function f(b){this._annotations=[];var a=this;this._listener={onChanged:function(b){a._onChanged(b)}};this.setTextModel(b)}function g(b,a){this._view=b;this._annotationModel=a;var e=this;this._listener={onDestroy:function(a){e._onDestroy(a)},onLineStyle:function(a){e._onLineStyle(a)},onChanged:function(a){e._onAnnotationModelChanged(a)}};b.addEventListener("Destroy",this._listener.onDestroy);b.addEventListener("postLineStyle", -this._listener.onLineStyle);a.addEventListener("Changed",this._listener.onChanged)}n.prototype={_expandedHTML:"
",_expandedStyle:{styleClass:"annotation expanded"},_collapsedHTML:"",_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 b=this._projectionModel,a=b.getBaseModel();this._projection={annotation:this,start:a.getLineStart(a.getLineAtOffset(this.start)+1),end:a.getLineEnd(a.getLineAtOffset(this.end),!0)};b.addProjection(this._projection)}},expand:function(){this._expand()&& -this._projectionModel.removeProjection(this._projection)}};i.ANNOTATION_ERROR="orion.annotation.error";i.ANNOTATION_WARNING="orion.annotation.warning";i.ANNOTATION_TASK="orion.annotation.task";i.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint";i.ANNOTATION_BOOKMARK="orion.annotation.bookmark";i.ANNOTATION_FOLDING="orion.annotation.folding";i.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket";i.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket";i.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine"; -i.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch";i.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch";i.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence";i.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence";i.ANNOTATION_SELECTED_LINKED_GROUP="orion.annotation.selectedLinkedGroup";i.ANNOTATION_CURRENT_LINKED_GROUP="orion.annotation.currentLinkedGroup";i.ANNOTATION_LINKED_GROUP="orion.annotation.linkedGroup";i.ANNOTATION_BLAME="orion.annotation.blame";i.ANNOTATION_CURRENT_BLAME= -"orion.annotation.currentBlame";var h={};i.registerType=function(b,a){var e=a;if(typeof e!=="function")e=function(a,b,e){this.start=a;this.end=b;if(e!==void 0)this.title=e},e.prototype=a;e.prototype.type=b;h[b]=e;return b};i.createAnnotation=function(b,a,e,c){return new (this.getType(b))(a,e,c)};i.getType=function(b){return h[b]};c(i.ANNOTATION_ERROR);c(i.ANNOTATION_WARNING);c(i.ANNOTATION_TASK);c(i.ANNOTATION_BREAKPOINT);c(i.ANNOTATION_BOOKMARK);c(i.ANNOTATION_CURRENT_BRACKET);c(i.ANNOTATION_MATCHING_BRACKET); -c(i.ANNOTATION_CURRENT_SEARCH);c(i.ANNOTATION_MATCHING_SEARCH);c(i.ANNOTATION_READ_OCCURRENCE);c(i.ANNOTATION_WRITE_OCCURRENCE);c(i.ANNOTATION_SELECTED_LINKED_GROUP);c(i.ANNOTATION_CURRENT_LINKED_GROUP);c(i.ANNOTATION_LINKED_GROUP);c(i.ANNOTATION_CURRENT_LINE,!0);c(i.ANNOTATION_BLAME,!0);c(i.ANNOTATION_CURRENT_BLAME,!0);i.registerType(i.ANNOTATION_FOLDING,n);d.addMixin=function(b){var a=d.prototype,e;for(e in a)a.hasOwnProperty(e)&&(b[e]=a[e])};d.prototype={addAnnotationType:function(b){if(!this._annotationTypes)this._annotationTypes= -[];this._annotationTypes.push(b)},getAnnotationTypePriority:function(b){if(this._annotationTypes)for(var a=0;ac.start?b=a)break}return null};c=f();return{next:function(){var a=c;a&&(c=f());return a},hasNext:function(){return c!==null}}},modifyAnnotation:function(b){if(b&&!(this._getAnnotationIndex(b)<0))this.onChanged({type:"Changed",added:[],removed:[],changed:[b]})},onChanged:function(b){return this.dispatchEvent(b)},removeAnnotations:function(b){var a= -this._annotations,e,c;if(b){e=[];for(c=a.length-1;c>=0;c--){var d=a[c];if(d.type===b)a.splice(c,1),e.splice(0,0,d),d._annotationModel=null}}else e=a;this.onChanged({type:"Changed",removed:e,added:[],changed:[]})},removeAnnotation:function(b){if(b){var a=this._getAnnotationIndex(b);if(!(a<0))b._annotationModel=null,this.onChanged({type:"Changed",removed:this._annotations.splice(a,1),added:[],changed:[]})}},replaceAnnotations:function(b,a){var e=this._annotations,c,d,f,g=[];if(b)for(c=b.length-1;c>= -0;c--)if(f=b[c],d=this._getAnnotationIndex(f),!(d<0))f._annotationModel=null,e.splice(d,1),g.splice(0,0,f);a||(a=[]);for(c=0;c1;)d=Math.floor((e+c)/2),a<=b[d].start?e=d:c=d;return e},_getAnnotationIndex:function(b){for(var a=this._annotations,e=this._binarySearch(a,b.start);e=d)g._oldStart=g.start, -g._oldEnd=g.end,g.start+=b,g.end+=b,f.changed.push(g);else if(!(g.end<=a))g.start0||f.removed.length>0||f.changed.length>0)this.onChanged(f)}}};m.EventTarget.addMixin(f.prototype);g.prototype={destroy:function(){var b=this._view;if(b)b.removeEventListener("Destroy",this._listener.onDestroy),b.removeEventListener("LineStyle", -this._listener.onLineStyle),this.view=null;(b=this._annotationModel)&&b.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(b,a){if(a){b||(b={});b.styleClass&&a.styleClass&&b.styleClass!==a.styleClass?b.styleClass+=" "+a.styleClass:b.styleClass=a.styleClass;var e;if(a.tagName&&!b.tagName)b.tagName=a.tagName;if(a.style){if(!b.style)b.style={};for(e in a.style)b.style[e]||(b.style[e]=a.style[e])}if(a.attributes){if(!b.attributes)b.attributes={};for(e in a.attributes)b.attributes[e]|| -(b.attributes[e]=a.attributes[e])}}return b},_mergeStyleRanges:function(b,a){b||(b=[]);var e,c;for(c=0;c=d.end)){e=this._mergeStyle({},d.style);e=this._mergeStyle(e,a.style);var f=[];f.push(c,1);a.startd.start&&f.push({start:d.start,end:a.start,style:d.style});f.push({start:Math.max(d.start,a.start),end:Math.min(d.end,a.end),style:e});a.endd.end?{start:d.end,end:a.end,style:a.style}:null;Array.prototype.splice.apply(b,f)}}a&&(e=this._mergeStyle({},a.style),b.splice(c,0,{start:a.start,end:a.end,style:e}));return b},_onAnnotationModelChanged:function(b){function a(a,b){f.getBaseModel&&(a=f.mapOffset(a,!0),b=f.mapOffset(b,!0));a!==-1&&b!==-1&&c.redrawRange(a,b)}function e(b,e){for(var c=0;c0?(a-=0.1,b.style.opacity=a):r._hide()},r._fadeDelay/10)},r._autoHideDelay)}}}},_getAnnotationContents:function(f){function h(a,b){var e=t.getLineStart(t.getLineAtOffset(a)),c=t.getLineEnd(t.getLineAtOffset(b),!0);return t.getText(e,c)}function b(a){var b=a.title,e=d.createElement(q,"div");e.className= -"tooltipRow";if(a.html)e.innerHTML=a.html,e.lastChild&&c.addEventListener(e.lastChild,"click",function(){var b=a.start,e=a.end;p.getBaseModel&&(b=p.mapOffset(b,!0),e=p.mapOffset(e,!0));r.setSelection(b,e,1/3,function(){o._hide()})},!1),e.appendChild(q.createTextNode("\u00a0"));b||(b=h(a.start,a.end));typeof b==="function"&&(b=a.title());if(typeof b==="string"){var j=d.createElement(q,"span");j.appendChild(q.createTextNode(b));b=j}e.appendChild(b);return e}for(var a,e=[],l=0;l0&&f.addProjection({start:0, -end:e}),f;else{e=d.createElement(q,"div");a=d.createElement(q,"em");a.appendChild(q.createTextNode(k.multipleAnnotations));e.appendChild(a);for(l=0;l=h&&c.groupId!==void 0){e=c;break}if(f&&e&&f.groupId===e.groupId)return}this._currentGroupAnnotation=null;f&&a.removeAnnotations(f.groupType);if(e&&b!==-1){this._currentGroupAnnotation=e;d=a.getAnnotations();for(b=[];d.hasNext();)c=d.next(),delete c.groupAnnotation,c.groupId===e.groupId&&(c=c.createGroupAnnotation(),b.push(c));a.replaceAnnotations(null,b)}}};m.AnnotationTypeList.addMixin(c.prototype); -d.prototype=new c;d.prototype.getAnnotations=function(b,a){for(var e=c.prototype.getAnnotations.call(this,b,a),d=this._view.getModel(),f=b;f=0;c--)i=i.concat(this.changes[c].getUndoChanges());return i},add:function(i){this.changes.push(i)},end:function(i){if(i)this.endSelection=i.getSelection(),this.endCaret=i.getCaretOffset();(i=this.owner)&&i.end&&i.end()},undo:function(i,c){this.changes.length>1&&i&&i.setRedraw(!1);for(var d=this.changes.length-1;d>=0;d--)this.changes[d].undo(i,!1);this.changes.length>1&&i&&i.setRedraw(!0);if(c&&i){var d=this.startSelection.start, -f=this.startSelection.end;i.setSelection(this.startCaret?d:f,this.startCaret?f:d)}(d=this.owner)&&d.undo&&d.undo();return this.changes.length>0},redo:function(i,c){this.changes.length>1&&i&&i.setRedraw(!1);for(var d=0;d0},merge:function(i,c,d,f,g){var h=this.changes.length; -return h>0?this.changes[h-1].merge(i,c,d,f,g):!1},start:function(i){if(i)this.startSelection=i.getSelection(),this.startCaret=i.getCaretOffset();(i=this.owner)&&i.start&&i.start()}};n.prototype={destroy:function(){this._onDestroy()},add:function(i){this.compoundChange?this.compoundChange.add(i):(this.stack.splice(this.index,this.stack.length-this.index,i),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 this.index>0},canRedo:function(){return this.stack.length-this.index>0},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 i=[],c=this.index;c=0;c--)i=i.concat(this.stack[c].getUndoChanges());return i},undo:function(){this._commitUndo();var i;i=!1;this._ignoreUndo=!0;do{if(this.index<=0)break;i=this.stack[--this.index]}while(!(i=i.undo(this.view,!0)));this._ignoreUndo=!1;return i},redo:function(){this._commitUndo();var i;this._ignoreUndo=!0;do{if(this.index>=this.stack.length)break;i=this.stack[this.index++]}while(!i.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(i){if(this.view!==i)this.view&&i.removeEventListener("Destroy",this._listener.onDestroy),(this.view=i)&&i.addEventListener("Destroy",this._listener.onDestroy)},startCompoundChange:function(i){this._commitUndo();i=new m(i);this.add(i);this.compoundChange=i;this.compoundChange.start(this.view);return this.compoundChange},_commitUndo:function(){this.endCompoundChange()}, -_onDestroy:function(i){(!i||!this.shared)&&this.model.removeEventListener("Changing",this._listener.onChanging);if(this.view)this.view.removeEventListener("Destroy",this._listener.onDestroy),this.view=null},_onChanging:function(i){if(!this._ignoreUndo){var c=i.text,d=i.start,f=i.addedCharCount,g=i.removedCharCount,i=d+g,h=0;f===0&&g===1?h=-1:f===1&&g===0&&(h=1);f=this.stack.length;g=this.model.getText(d,i);(!(f>0&&this.index===f)||!this.stack[f-1].merge(d,c,g,h,i))&&this.add(new k(this.model,d,c, -g,h))}}};return{UndoStack:n}}); -define("orion/editor/textDND",["orion/util"],function(k){function m(k,i){this._view=k;this._undoStack=i;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var c=this;this._listener={onDragStart:function(d){c._onDragStart(d)},onDragEnd:function(d){c._onDragEnd(d)},onDragEnter:function(d){c._onDragEnter(d)},onDragOver:function(d){c._onDragOver(d)},onDrop:function(d){c._onDrop(d)},onDestroy:function(d){c._onDestroy(d)}};k.addEventListener("DragStart",this._listener.onDragStart);k.addEventListener("DragEnd", -this._listener.onDragEnd);k.addEventListener("DragEnter",this._listener.onDragEnter);k.addEventListener("DragOver",this._listener.onDragOver);k.addEventListener("Drop",this._listener.onDrop);k.addEventListener("Destroy",this._listener.onDestroy)}m.prototype={destroy:function(){var k=this._view;if(k)k.removeEventListener("DragStart",this._listener.onDragStart),k.removeEventListener("DragEnd",this._listener.onDragEnd),k.removeEventListener("DragEnter",this._listener.onDragEnter),k.removeEventListener("DragOver", -this._listener.onDragOver),k.removeEventListener("Drop",this._listener.onDrop),k.removeEventListener("Destroy",this._listener.onDestroy),this._view=null},_onDestroy:function(){this.destroy()},_onDragStart:function(k){var i=this._view,c=i.getSelection(),i=i.getModel();if(i.getBaseModel)c.start=i.mapOffset(c.start),c.end=i.mapOffset(c.end),i=i.getBaseModel();if(i=i.getText(c.start,c.end))this._dragSelection=c,k.event.dataTransfer.effectAllowed="copyMove",k.event.dataTransfer.setData("Text",i)},_onDragEnd:function(m){if(this._dragSelection){var i= -this._view,c=m.event.dataTransfer.dropEffect;if(!k.isFirefox&&(c!=="none"||this._dropText))c=m.event.dataTransfer.dropEffect=this._dropEffect;this._undoStack&&this._undoStack.startCompoundChange();(m=c==="move")&&i.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var c=this._dropText,d=this._dropOffset;if(m)if(d>=this._dragSelection.end)d-=this._dragSelection.end-this._dragSelection.start;else if(d>=this._dragSelection.start)d=this._dragSelection.start;i.setText(c, -d,d);i.setSelection(d,d+c.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(k){this._onDragOver(k)},_onDragOver:function(m){var i=m.event.dataTransfer.types,c=!this._view.getOptions("readonly");c&&i&&(c=i.contains?i.contains("text/plain")||i.contains("Text"):i.indexOf("text/plain")!==-1||i.indexOf("Text")!==-1);if(c){if(!k.isFirefox)this._dropEffect=m.event.dataTransfer.dropEffect=(k.isMac?m.event.altKey: -m.event.ctrlKey)?"copy":"move"}else m.event.dataTransfer.dropEffect="none"},_onDrop:function(m){var i=this._view,c=m.event.dataTransfer.getData("Text");if(c){if(!k.isFirefox)m.event.dataTransfer.dropEffect=this._dropEffect;m=i.getOffsetAtLocation(m.x,m.y);this._dragSelection?(this._dropOffset=m,this._dropText=c):(i.setText(c,m,m),i.setSelection(m,m+c.length))}}};return{TextDND:m}}); -define("orion/objects",[],function(){function k(k){for(var n=1;n"}),g.addAnnotationType(h.ANNOTATION_ERROR),g.addAnnotationType(h.ANNOTATION_WARNING),g.addAnnotationType(h.ANNOTATION_TASK),g.addAnnotationType(h.ANNOTATION_BOOKMARK);this.setAnnotationRulerVisible(this._annotationRulerVisible||this._annotationRulerVisible=== -void 0,!0);if(g=this._overviewRuler=d.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||this._overviewRulerVisible===void 0,!0)}if(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=c,this.setLineNumberRulerVisible(this._lineNumberRulerVisible|| -this._lineNumberRulerVisible===void 0,!0);if(this._foldingRulerFactory)this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),this._foldingRuler.addAnnotationType(h.ANNOTATION_FOLDING),this.setFoldingRulerVisible(this._foldingRulerVisible||this._foldingRulerVisible===void 0,!0);this.dispatchEvent({type:"TextViewInstalled",textView:a});f.prototype.install.call(this)}},uninstallTextView:function(){this.uninstall()},uninstall:function(){var b=this._textView;if(b)b.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:b}),f.prototype.uninstall.call(this)},_updateCursorStatus:function(){var b= -this.getModel(),a=this.getCaretOffset(),e=b.getLineAtOffset(a),b=b.getLineStart(e);a-=b;for(var b=this.getKeyModes(),c=0;c';e.blame=b;return e})},showSelection:function(b,a,e,c,d){typeof b==="number"?(typeof a!=="number"&&(a=b),this.moveSelection(b,a)):typeof e==="number"&&(b=this.getModel().getLineStart(e-1),typeof c=== -"number"&&(b+=c),typeof d!=="number"&&(d=0),this.moveSelection(b,b+d))},_setModelText:function(b){this._textView&&(this._textView.setText(b),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelection()))},setInput:function(b,a,e,c,d){f.prototype.setInput.call(this,b,a,e,c);this._textView&&!c&&!d&&this._textView.focus()},onGotoLine:function(b,a,e,c){if(this._textView){var d=this.getModel(),b=Math.max(0,Math.min(b,d.getLineCount()-1)),f=d.getLineStart(b), -g=0;e===void 0&&(e=0);typeof a==="string"?(b=d.getLine(b).indexOf(a),b!==-1&&(g=b,e=g+a.length)):(g=a,a=d.getLineEnd(b)-f,g=Math.min(g,a),e=Math.min(e,a));this.moveSelection(f+g,f+e,c)}}});return{BaseEditor:f,Editor:g}}); -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(k,m,n,i,c,d,f){function g(a){var b=a.getTextView();n.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 d=this;this._listener={onVerify:function(a){var b=d.editor,e=b.getModel(),f=b.mapOffset(a.start),b=b.mapOffset(a.end),e=e.getText(f,b);if((e=d._prefix.match(RegExp("^"+c.escape(e),"i")))&&e.length>0)d._prefix+=a.text,d._success=!0,d._status(),d.find(d._forward,!0),a.text=null},onSelection:function(){d._ignoreSelection||d.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 b={};g.prototype=new n.KeyMode;d.mixin(g.prototype,{createKeyBindings:function(){var a=m.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(c.length===0)return!1;var d=this.editor,f=d.getModel(),f=a?this._success?b?this._start:d.getCaretOffset()+ -1:0:this._success?b?this._start:d.getCaretOffset():f.getCharCount()-1;if(c=d.getModel().find({string:c,start:f,reverse:!a,caseInsensitive:c.toLowerCase()===c}).next()){if(!b)this._start=f;this._ignoreSelection=this._success=!0;d.moveSelection(a?c.start:c.end,a?c.end:c.start);this._ignoreSelection=!1}else this._success=!1;this._status();return!0},isActive:function(){return this._active},isStatusActive:function(){return this.isActive()},setActive:function(a){if(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 a.length===0?(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?k.incrementalFindStr:k.incrementalFindStrNotFound:this._success?k.incrementalFindReverseStr:k.incrementalFindReverseStrNotFound;a=f.formatMessage(a,this._prefix);this.editor.reportStatus(a,this._success?"":"error")}else this.editor.reportStatus("")}}); -b.IncrementalFind=g;h.prototype={find:function(a,b,c){this.setOptions({reverse:!a});var d=this.getFindString(),f;if(b)d=b.findString||d,f=b.count;a=this.getOptions();this.setOptions(b);b=c?this._startOffset:this.getStartOffset();if((f=this._doFind(d,b,f))&&!c)this._startOffset=f.start;this.setOptions(a);this._hideAfterFind&&this.hide();return f},getStartOffset:function(){return this._start!==void 0?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=c.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;if(this._savedOptions&&(this.setOptions(this._savedOptions.pop()),this._savedOptions.length===0))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(),f=0;f -0&&(g.endUndo(),c.setRedraw(!0));h>0?b.reportStatus(f.formatMessage(k.replacedMatches,i)):b.reportStatus(k.nothingReplaced,"error");g._replacingAll=!1},100)}},setOptions:function(a){if(a){if((a.showAll===!0||a.showAll===!1)&&this._showAll!==a.showAll)if(this._showAll=a.showAll,this.isVisible())if(this._showAll)this._markAllOccurrences();else{var b=this._editor.getAnnotationModel();b&&b.removeAnnotations(i.AnnotationType.ANNOTATION_MATCHING_SEARCH)}if(a.caseInsensitive===!0||a.caseInsensitive===!1)this._caseInsensitive= -a.caseInsensitive;if(a.wrap===!0||a.wrap===!1)this._wrap=a.wrap;if(a.wholeWord===!0||a.wholeWord===!1)this._wholeWord=a.wholeWord;if(a.incremental===!0||a.incremental===!1)this._incremental=a.incremental;if(a.regex===!0||a.regex===!1)this._regex=a.regex;if(a.findAfterReplace===!0||a.findAfterReplace===!1)this._findAfterReplace=a.findAfterReplace;if(a.hideAfterFind===!0||a.hideAfterFind===!1)this._hideAfterFind=a.hideAfterFind;if(a.reverse===!0||a.reverse===!1)this._reverse=a.reverse;if(a.hasOwnProperty("findCallback"))this._findCallback= -a.findCallback;if(a.hasOwnProperty("start"))this._start=a.start;if(a.hasOwnProperty("end"))this._end=a.end}},show:function(a){this._visible=!0;if(a){if(!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,b,c,d){var c=c||1,f=this._editor;if(!a)return this._removeAllAnnotations(),null;this._lastString=a;var g,h;if(this._regex)try{h=this._find(a,b,d)}catch(t){f.reportStatus(t.message, -"error");return}else h=this._find(a,b,d);for(a=0;a0;)this.undoStack.undo(),--b;return!0}return!1}.bind(this), -{name:k.undo});a.setAction("redo",function(a){if(this.undoStack){var b=1;if(a&&a.count)b=a.count;for(;b>0;)this.undoStack.redo(),--b;return!0}return!1}.bind(this),{name:k.redo});a.setKeyBinding(new m.KeyBinding("f",!0),"find");a.setAction("find",function(){if(this._find){var a=this.editor.getSelection();(a=prompt(k.find,this.editor.getText(a.start,a.end)))&&this._find.find(!0,{findString:a})}}.bind(this),{name:k.find});a.setKeyBinding(new m.KeyBinding("k",!0),"findNext");a.setAction("findNext",function(a){return this._find? -(this._find.find(!0,a),!0):!1}.bind(this),{name:k.findNext});a.setKeyBinding(new m.KeyBinding("k",!0,!0),"findPrevious");a.setAction("findPrevious",function(a){return this._find?(this._find.find(!1,a),!0):!1}.bind(this),{name:k.findPrevious});a.setKeyBinding(new m.KeyBinding("j",!0),"incrementalFind");a.setAction("incrementalFind",function(){this._incrementalFind&&this._incrementalFind.find(!0);return!0}.bind(this),{name:k.incrementalFind});a.setKeyBinding(new m.KeyBinding("j",!0,!0),"incrementalFindReverse"); -a.setAction("incrementalFindReverse",function(){this._incrementalFind&&this._incrementalFind.find(!1);return!0}.bind(this),{name:k.incrementalFindReverse});a.setAction("tab",function(){return this.indentLines()}.bind(this));a.setAction("shiftTab",function(){return this.unindentLines()}.bind(this),{name:k.unindentLines});a.setKeyBinding(new m.KeyBinding(38,!1,!1,!0),"moveLinesUp");a.setAction("moveLinesUp",function(){return this.moveLinesUp()}.bind(this),{name:k.moveLinesUp});a.setKeyBinding(new m.KeyBinding(40, -!1,!1,!0),"moveLinesDown");a.setAction("moveLinesDown",function(){return this.moveLinesDown()}.bind(this),{name:k.moveLinesDown});a.setKeyBinding(new m.KeyBinding(38,!0,!1,!0),"copyLinesUp");a.setAction("copyLinesUp",function(){return this.copyLinesUp()}.bind(this),{name:k.copyLinesUp});a.setKeyBinding(new m.KeyBinding(40,!0,!1,!0),"copyLinesDown");a.setAction("copyLinesDown",function(){return this.copyLinesDown()}.bind(this),{name:k.copyLinesDown});a.setKeyBinding(new m.KeyBinding("d",!0,!1,!1), -"deleteLines");a.setAction("deleteLines",function(a){return this.deleteLines(a)}.bind(this),{name:k.deleteLines});a.setKeyBinding(new m.KeyBinding("l",!d.isMac,!1,!1,d.isMac),"gotoLine");a.setAction("gotoLine",function(){return this.gotoLine()}.bind(this),{name:k.gotoLine});a.setKeyBinding(new m.KeyBinding(190,!0),"nextAnnotation");a.setAction("nextAnnotation",function(){return this.nextAnnotation(!0)}.bind(this),{name:k.nextAnnotation});a.setKeyBinding(new m.KeyBinding(188,!0),"previousAnnotation"); -a.setAction("previousAnnotation",function(){return this.nextAnnotation(!1)}.bind(this),{name:k.prevAnnotation});a.setKeyBinding(new m.KeyBinding("e",!0,!1,!0,!1),"expand");a.setAction("expand",function(){return this.expandAnnotation(!0)}.bind(this),{name:k.expand});a.setKeyBinding(new m.KeyBinding("c",!0,!1,!0,!1),"collapse");a.setAction("collapse",function(){return this.expandAnnotation(!1)}.bind(this),{name:k.collapse});a.setKeyBinding(new m.KeyBinding("e",!0,!0,!0,!1),"expandAll");a.setAction("expandAll", -function(){return this.expandAnnotations(!0)}.bind(this),{name:k.expandAll});a.setKeyBinding(new m.KeyBinding("c",!0,!0,!0,!1),"collapseAll");a.setAction("collapseAll",function(){return this.expandAnnotations(!1)}.bind(this),{name:k.collapseAll});a.setKeyBinding(new m.KeyBinding("q",!d.isMac,!1,!1,d.isMac),"lastEdit");a.setAction("lastEdit",function(){return this.gotoLastEdit()}.bind(this),{name:k.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),f=b.getLineStart(d),d=b.getLineEnd(c,!0),g=b.getLineCount(),h="",f=b.getText(f,d);c===g-1&&(f=(h=b.getLineDelimiter())+f);a.setText(f,d,d);a.setSelection(d+h.length,d+f.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),f=b.getLineEnd(c,!0),g=b.getLineCount(),h="",f=b.getText(d,f);c===g-1&&(f+=h=b.getLineDelimiter());a.setText(f,d,d);a.setSelection(d,d+f.length-h.length);return!0},deleteLines:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var c=1;if(a&&a.count)c=a.count;var d=b.getSelection(),f=b.getModel(),g=f.getLineAtOffset(d.start),a=f.getLineStart(g),c=d.start!==d.end||c===1?f.getLineAtOffset(d.end>d.start?d.end-1:d.end):Math.min(g+c-1,f.getLineCount()- -1),c=f.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(),f=b.getCaretOffset(),g=d.getLineAtOffset(f),f=d.getLineStart(g),g=d.getLineEnd(g,!0);d.getBaseModel&&(f=d.mapOffset(f),g=d.mapOffset(g),d.getBaseModel());for(var h,c=c.getAnnotations(f,g);!h&&c.hasNext();)d=c.next(),d.type===n.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.getModel();d=d.getAnnotations();for(c.setRedraw(!1);d.hasNext();)b=d.next(),b.type===n.AnnotationType.ANNOTATION_FOLDING&&a!==b.expanded&&(a?b.expand():b.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(),f=c.getLineAtOffset(d.start), -g=c.getLineAtOffset(d.end>d.start?d.end-1:d.end);if(f!==g){var h=[];h.push("");for(var i=f;i<=g;i++)h.push(c.getLine(i,!0));i=c.getLineStart(f);c=c.getLineEnd(g,!0);b=b.getOptions("tabSize","expandTab");b=b.expandTab?Array(b.tabSize+1).join(" "):"\t";a.setText(h.join(b),i,c);a.setSelection(i===d.start?d.start:d.start+b.length,d.end+(g-f+1)*b.length);return!0}return!1}},gotoLastEdit:function(){typeof this._lastEditLocation==="number"&&this.editor.showSelection(this._lastEditLocation);return!0},gotoLine:function(){var a= -this.editor,b=a.getModel().getLineAtOffset(a.getCaretOffset());if(b=prompt(k.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),f=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),g=b.getLineCount();if(f===g-1)return!0;var d=b.getLineStart(d),c=b.getLineEnd(f,!0),h=b.getLineEnd(f+1,!0)-(c-d),i=0;f!==g-2?b=b.getText(d,c):(f=b.getLineEnd(f), -b=b.getText(f,c)+b.getText(d,f),i+=c-f);this.startUndo();a.setText("",d,c);a.setText(b,h,h);a.setSelection(h+i,h+i+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(d===0)return!0;var f=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),g=b.getLineCount(),c=b.getLineStart(d-1),h=b.getLineStart(d),i=b.getLineEnd(f,!0),k=b.getText(h,i),s=0;f===g-1&&(f=b.getLineEnd(d- -1),d=b.getLineEnd(d-1,!0),k+=b.getText(f,d),h=f,s=d-f);this.startUndo();a.setText("",h,i);a.setText(k,c,c);a.setSelection(c,c+k.length-s);this.endUndo();return!0},nextAnnotation:function(a){function b(a){return!!a.lineStyle||a.type===h.ANNOTATION_MATCHING_BRACKET||a.type===h.ANNOTATION_CURRENT_BRACKET||!f.isAnnotationTypeVisible(a.type)}var c=this.editor,d=c.getAnnotationModel();if(!d)return!0;var f=c.getOverviewRuler()||c.getAnnotationStyler();if(!f)return!0;for(var g=c.getModel(),p=c.getCaretOffset(), -t=d.getAnnotations(a?p:0,a?g.getCharCount():p),k=null;t.hasNext();){var s=t.next();if(a){if(s.start<=p)continue}else if(s.start>=p)continue;if(!b(s)&&(k=s,a))break}if(k){for(var u=[k],t=d.getAnnotations(k.start,k.start);t.hasNext();)s=t.next(),s!==k&&!b(s)&&u.push(s);var j=c.getTextView(),m=g.getLineAtOffset(k.start),n=i.Tooltip.getTooltip(j);if(!n)return c.moveSelection(k.start),!0;c.moveSelection(k.start,k.start,function(){n.setTarget({getTooltipInfo:function(){var a=j.convert({x:j.getLocationAtOffset(k.start).x, -y:j.getLocationAtOffset(g.getLineStart(m)).y},"document","page");return{contents:u,x:a.x,y:a.y+Math.floor(j.getLineHeight(m)*1.33)}}},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(),f=c.getLineAtOffset(d.start),g=c.getLineAtOffset(d.end>d.start?d.end-1:d.end),h=b.getOptions("tabSize"),i=Array(h+1).join(" "),k=[],s=b=0,u=f;u<=g;u++){var j=c.getLine(u,!0);if(c.getLineStart(u)!== -c.getLineEnd(u))if(j.indexOf("\t")===0)j=j.substring(1),b++;else if(j.indexOf(i)===0)j=j.substring(h),b+=h;else return!0;u===f&&(s=b);k.push(j)}f=c.getLineStart(f);h=c.getLineEnd(g,!0);c=c.getLineStart(g);a.setText(k.join(""),f,h);g=f===d.start?d.start:d.start-s;d=Math.max(g,d.end-b+(d.end===c+1&&d.start!==d.end?1:0));a.setSelection(g,d);return!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};b.TextActions= -f;g.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 m.KeyBinding("t",!0,!1,!0),"trimTrailingWhitespaces");a.setAction("trimTrailingWhitespaces",function(){return this.trimTrailingWhitespaces()}.bind(this),{name:k.trimTrailingWhitespaces});a.setKeyBinding(new m.KeyBinding(191,!0),"toggleLineComment");a.setAction("toggleLineComment", -function(){return this.toggleLineComment()}.bind(this),{name:k.toggleLineComment});a.setKeyBinding(new m.KeyBinding(191,!0,!d.isMac,!1,d.isMac),"addBlockComment");a.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),{name:k.addBlockComment});a.setKeyBinding(new m.KeyBinding(220,!0,!d.isMac,!1,d.isMac),"removeBlockComment");a.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),{name:k.removeBlockComment});a.setKeyBinding(new m.KeyBinding("[", -!1,!1,!1,!1,"keypress"),"autoPairSquareBracket");a.setAction("autoPairSquareBracket",function(){return this.autoPairBrackets("[","]")}.bind(this));a.setKeyBinding(new m.KeyBinding("]",!1,!1,!1,!1,"keypress"),"skipClosingSquareBracket");a.setAction("skipClosingSquareBracket",function(){return this.skipClosingBracket("]")}.bind(this));a.setKeyBinding(new m.KeyBinding("<",!1,!1,!1,!1,"keypress"),"autoPairAngleBracket");a.setAction("autoPairAngleBracket",function(){return this.autoPairBrackets("<",">")}.bind(this)); -a.setKeyBinding(new m.KeyBinding(">",!1,!1,!1,!1,"keypress"),"skipClosingAngleBracket");a.setAction("skipClosingAngleBracket",function(){return this.skipClosingBracket(">")}.bind(this));a.setKeyBinding(new m.KeyBinding("(",!1,!1,!1,!1,"keypress"),"autoPairParentheses");a.setAction("autoPairParentheses",function(){return this.autoPairBrackets("(",")")}.bind(this));a.setKeyBinding(new m.KeyBinding(")",!1,!1,!1,!1,"keypress"),"skipClosingParenthesis");a.setAction("skipClosingParenthesis",function(){return this.skipClosingBracket(")")}.bind(this)); -a.setKeyBinding(new m.KeyBinding("{",!1,!1,!1,!1,"keypress"),"autoPairBraces");a.setAction("autoPairBraces",function(){return this.autoPairBrackets("{","}")}.bind(this));a.setKeyBinding(new m.KeyBinding("}",!1,!1,!1,!1,"keypress"),"skipClosingBrace");a.setAction("skipClosingBrace",function(){return this.skipClosingBracket("}")}.bind(this));a.setKeyBinding(new m.KeyBinding("'",!1,!1,!1,!1,"keypress"),"autoPairSingleQuotation");a.setAction("autoPairSingleQuotation",function(){return this.autoPairQuotations("'")}.bind(this)); -a.setKeyBinding(new m.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(),f=d.getLineAtOffset(c.start),g=d.getLine(f,!1),h=d.getLineStart(f),i=0,k=c.start- -h,s;i=0;f--)if(i=d.getLine(f,!1),j.test(i))return n.test(y)||g.charCodeAt(k)===47?(g=b+h+"*"+y,h=c.start+b.length+h.length+1):(g=b+h+"* "+y,h=c.start+b.length+ -h.length+2),a.setText(g,c.start,c.end+y.length),a.setCaretOffset(h),!0;else if(!m.test(i))break}else if(n.test(D)&&h.charCodeAt(h.length-1)===32)return g=b+h.substring(0,h.length-1),a.setText(g,c.start,c.end),a.setCaretOffset(c.start+g.length),!0;else if(i>0){for(i=k;i]/;if(d.start===d.end&&h.test(g))return c.setText(a+b,d.start,d.start),c.setCaretOffset(d.start+1),!0;else if(d.start!==d.end)return f=f.getText(d.start,d.end),c.setText(a+f+b,d.start,d.end),c.setSelection(d.start+1,d.end+1),!0;return!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(),f=b.getCaretOffset(),g=f===0?"":d.getText(c.start-1,c.start).trim(),h=f===d.getCharCount()?"":d.getText(c.start,c.start+1).trim(),f=/^"$|^'$/,i=/\w/,k=/^$|[)}\]>]/;if(c.start!==c.end){d=d.getText(c.start,c.end);if(f.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)b.setCaretOffset(c.start+1);else if(g===a||f.test(h)||i.test(g)||!k.test(h))return!1; -else 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&&a.positions.length>0&&this.linkedMode){for(var b=[],c=0;c0&&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(),f=d===0?"":c.getText(b.start-1,b.start),c=d===c.getCharCount()?"":c.getText(b.start,b.start+1);(f==="("&&c===")"||f==="["&&c==="]"||f==="{"&&c==="}"||f==="<"&&c===">"||f==='"'&&c==='"'||f==="'"&&c==="'")&&a.setText("",b.start,b.start+ -1);return!1},_findEnclosingComment:function(a,b,c){var d=a.getLineAtOffset(b),f=a.getLineAtOffset(c),g,h,i,k,s,u;for(g=d;g>=0;g--)if(h=a.getLine(g),i=g===d?b-a.getLineStart(d):h.length,k=h.lastIndexOf("/*",i),h=h.lastIndexOf("*/",i),h>k)break;else if(k!==-1){s=a.getLineStart(g)+k;break}for(g=f;gc.start?c.end-1:c.end),g=!0,h=[],i,k,s=d;s<=f;s++)if(i=b.getLine(s,!0),h.push(i),!g||(k=i.indexOf("//"))===-1)g=!1;else if(k!==0){var u;for(u=0;ui)c.start=Math.max(i,c.start-h);if(c.start!==c.end&&c.end>i)c.end=Math.max(i,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}};b.SourceCodeActions=g;if(!String.prototype.trimLeft)String.prototype.trimLeft= -function(){return this.replace(/^\s+/g,"")};if(!String.prototype.trimRight)String.prototype.trimRight=function(){return this.replace(/\s+$/g,"")};return b}); -define("orion/editor/templates",[],function(){function k(k,i,c,d){this.prefix=k;this.description=i;this.template=c;this.name=d;this._parse()}function m(k,i){this._keywords=k||[];this._templates=[];this.addTemplates(i||[])}k.prototype={getProposal:function(k,i,c){var k=i-k.length,i={},d,f=c.delimiter!==void 0?c.delimiter:"\n";c.indentation&&(f+=c.indentation);for(var g=c.tab!==void 0?c.tab:"\t",h=0,b=this.variables,a=this.segments,c=[],e=0;ea.name?1:0}),d.splice(0,0,{proposal:"",description:"Templates",style:"noemphasis_title",unselectable:!0}));return d},removePrefix:function(k,i){if(!(i.overwrite=i.proposal.substring(0,k.length)!==k))i.proposal=i.proposal.substring(k.length)},isValid:function(){return!0}};return{Template:k,TemplateContentAssist:m}}); -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(k,m,n,i,c,d){function f(c,b,a){var e=c.getTextView();n.KeyMode.call(this,e);this.editor=c;this.undoStack=b;this.contentAssist=a;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 a=this.linkedModeModel;this.selectLinkedGroup((a.selectedGroupIndex+1)%a.groups.length);return!0}.bind(this));e.setAction("linkedModePreviousGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup(a.selectedGroupIndex>0?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,e,d;c;)if(e=this._getPositionChanged(c,b,b+a.removedCharCount),d=e.position,d===void 0||d.model!==c)this.exitLinkedMode(!1),c=this.linkedModeModel;else break;if(c){c=0;a=a.addedCharCount-a.removedCharCount;e=e.positions;for(var f,g=0;g=0;m--)j=f[m],j.model===d&&j.group===g.group&&b.setText(a.text,j.oldOffset+ -c,j.oldOffset+k);this.ignoreVerify=!1;a.text=null;this._updateAnnotations(f)}}}.bind(this)}}var g={};f.prototype=new n.KeyMode;d.mixin(f.prototype,{createKeyBindings:function(){var c=m.KeyBinding,b=[];b.push({actionID:"linkedModeEnter",keyBinding:new c(13)});b.push({actionID:"linkedModeCancel",keyBinding:new c(27)});b.push({actionID:"linkedModeNextGroup",keyBinding:new c(9)});b.push({actionID:"linkedModePreviousGroup",keyBinding:new c(9,!1,!0)});return b},enterLinkedMode:function(c){if(!this.linkedModeModel){var b= -this.editor.getTextView();b.addKeyMode(this);b.addEventListener("Verify",this.linkedModeListener.onVerify);b.addEventListener("ModelChanged",this.linkedModeListener.onModelChanged);this.contentAssist.addEventListener("Activating",this.linkedModeListener.onActivating);this.editor.reportStatus(k.linkedModeEntered,null,!0)}this._sortedPositions=null;if(this.linkedModeModel)c.previousModel=this.linkedModeModel,c.parentGroup=this.linkedModeModel.selectedGroupIndex,this.linkedModeModel.nextModel=c;this.linkedModeModel= -c;this.selectLinkedGroup(0)},exitLinkedMode:function(c){if(this.isActive()){if(this._compoundChange)this.endUndo(),this._compoundChange=null;this._sortedPositions=null;var b=this.linkedModeModel;this.linkedModeModel=b.previousModel;b.parentGroup=b.previousModel=void 0;if(this.linkedModeModel)this.linkedModeModel.nextModel=void 0;if(!this.linkedModeModel){var a=this.editor,e=a.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(k.linkedModeExited,null,!0);c&&a.setCaretOffset(b.escapePosition,!1)}this.selectLinkedGroup(0)}},startUndo:function(){if(this.undoStack){var c=this,b=this.linkedModeModel;this._compoundChange=this.undoStack.startCompoundChange({model:b,group:b.selectedGroupIndex,end:function(){c._compoundChange=null}})}},endUndo:function(){this.undoStack&& -this.undoStack.endCompoundChange()},isActive:function(){return!!this.linkedModeModel},isStatusActive:function(){return!!this.linkedModeModel},selectLinkedGroup:function(d){var b=this.linkedModeModel;if(b){b.selectedGroupIndex=d;var d=b.groups[d],a=d.positions[0],e=this.editor;e.setSelection(a.offset,a.offset+a.length);if(b=this.contentAssist)if(b.offset=void 0,d.data&&d.data.type==="link"&&d.data.values)(this._groupContentAssistProvider=new c.TemplateContentAssist(d.data.values)).getPrefix=function(){var b= -e.getSelection();return b.start===b.end&&(b=e.getCaretOffset(),a.offset<=b&&b<=a.offset+a.length)?e.getText(a.offset,b):""},b.offset=a.offset,b.deactivate(),b.activate();else if(this._groupContentAssistProvider)this._groupContentAssistProvider=null,b.deactivate()}this._updateAnnotations()},_getModelPositions:function(c,b,a){for(var e=b.groups,d=0;d=0;d--){var f=c[d].position;if(f.offset<=b&&a<=f.offset+f.length){e=c[d];break}}return{position:e,positions:c}},_updateAnnotations:function(c){var b=this.editor.getAnnotationModel();if(b){var a=[],e=[];b.getTextModel();for(var d=b.getAnnotations(),f;d.hasNext();)switch(f=d.next(),f.type){case i.AnnotationType.ANNOTATION_LINKED_GROUP:case i.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case i.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:a.push(f)}if(d= -this.linkedModeModel)for(var c=c||this._getSortedPositions(d),g=0;g=0)return c;if(c.hasChildNodes())for(var d=0;d=0)return c;if(c.hasChildNodes())for(var d=c.childNodes.length-1;d>=0;d--){var b=i(c.childNodes[d]);if(b)return b}return null}function c(f,h){if(f.nodeType===3){var b=d.exec(f.nodeValue);b&&b.length>1&&h(f, -b)}if(f.hasChildNodes())for(b=0;b0||a.addedLineCount>0);return c},setState:function(c,d){var e;if(c===a)this._filterText="", -e="Activating",this._mode&&this._mode.setActive(!0);else if(c===b)e="Deactivating",this._mode&&this._mode.setActive(!1),this._initialCaretOffset=-1,this._filterText="";e&&this.dispatchEvent({type:e,providerInfoArray:d});this.state=c;this.onStateChange(c)},setMode:function(a){this._mode=a},onStateChange:function(c){if(c===b){if(this.listenerAdded)this._latestModelChangingEvent=null,this.textView.removeEventListener("ModelChanging",this.contentAssistListener.onModelChanging),this.textView.removeEventListener("Scroll", -this.contentAssistListener.onScroll),this.textView.removeEventListener("Selection",this.contentAssistListener.onSelection),this.listenerAdded=!1}else if(c===a){if(!this.listenerAdded)this.textView.addEventListener("ModelChanging",this.contentAssistListener.onModelChanging),this.textView.addEventListener("Scroll",this.contentAssistListener.onScroll),this.textView.addEventListener("Selection",this.contentAssistListener.onSelection),this.listenerAdded=!0;this.computeProposals()}},computeProposals:function(){var a= -this,b=this.textView.getCaretOffset(),c=this.textView.getSelection(),c=Math.min(c.start,c.end);this._initialCaretOffset=Math.min(b,c);this._computeProposals(this._initialCaretOffset).then(function(b){a._computedProposals=b;a.isActive()&&(b=a._flatten(b),a.dispatchEvent({type:"ProposalsComputed",data:{proposals:b},autoApply:!a._autoTriggered}))})},getPrefixStart:function(a,b){for(var c=b;c>0&&/[A-Za-z0-9_]/.test(a.getText(c-1,c));)c--;return c},handleError:function(a){typeof console!=="undefined"&& -(console.log("Error retrieving content assist proposals"),console.log(a&&a.stack))},_computeProposals:function(a){var b=this._providerInfoArray,e=this.textView,f=e.getSelection(),g=e.getModel(),j=a;if(g.getBaseModel)j=g.mapOffset(j),f.start=g.mapOffset(f.start),f.end=g.mapOffset(f.end),g=g.getBaseModel();for(var a=g.getLine(g.getLineAtOffset(j)),h=0;h0&&d.push(a)},this);d=this._removeExtraUnselectableElements(d); -this.dispatchEvent({type:"ProposalsComputed",data:{proposals:this._flatten(d)},autoApply:!1})}},_removeExtraUnselectableElements:function(a){return a.map(function(a){return a.filter(function(b,c){var d=!0;if(r[b.style]===r.hr)0===c||a.length-1===c?d=!1:r.hr===r[a[c-1].style]&&(d=!1);else if(r[b.style]===r.noemphasis_title){var e=a[c+1];e?r[e.style]===r.noemphasis_title&&(d=!1):d=!1}return d})})},setEditorContextProvider:function(a){this.editorContextProvider=a},_generateProviderId:function(){this._uniqueProviderIdCounter? -this._uniqueProviderIdCounter++:this._uniqueProviderIdCounter=0;return"ContentAssistGeneratedID_"+this._uniqueProviderIdCounter},setAutoTriggerEnabled:function(a){this._autoTriggerEnabled=a;this._updateAutoTriggerListenerState()},setProviders:function(a){this.setProviderInfoArray(a.map(function(a){return{provider:a,id:this._generateProviderId()}},this))},setProviderInfoArray:function(a){this.resetProviderInfoArray();this._providerInfoArray=a;this._charTriggersInstalled=a.some(function(a){return a.charTriggers}); -this._updateAutoTriggerListenerState()},resetProviderInfoArray:function(){this._providerInfoArray=[];this._charTriggersInstalled=!1;this._updateAutoTriggerListenerState()},setProgress:function(a){this.progress=a},setStyleAccessor:function(a){this._styleAccessor=a},_flatten:function(a){return a.reduce(function(a,b){var c=a;if(Array.isArray(b)&&b.length>0){var c=b,d=a;b[0].style&&0===r[b[0].style].indexOf(r.noemphasis)&&(c=a,d=b);c.length>0&&c[c.length-1].style&&r.hr!==r[c[c.length-1].style]&&(c=c.concat({proposal:"", -name:"",description:"---------------------------------",style:"hr",unselectable:!0}));c=c.concat(d)}return c},[])},_triggerListener:function(){if(this._styleAccessor){var a=this.textView.getCaretOffset(),b=null,c=[];if(this._charTriggersInstalled){var d=this.textView.getText(a-1,a);this._providerInfoArray.forEach(function(e){var f=e.charTriggers;if(f&&f.test(d)){var f=!1,g=e.excludedStyles;g&&(b||(b=this._styleAccessor.getStyles(a-1)),f=b.some(function(a){return g.test(a.style)}));f||c.push(e)}}, -this);c.length>0&&this.activate(c,!0)}}},_updateAutoTriggerListenerState:function(){if(!this._boundTriggerListener)this._boundTriggerListener=this._triggerListener.bind(this);if(this._triggerListenerInstalled){if(!this._autoTriggerEnabled||!this._charTriggersInstalled)this.textView.removeEventListener("Modify",this._boundTriggerListener),this._triggerListenerInstalled=!1}else if(this._autoTriggerEnabled&&this._charTriggersInstalled)this.textView.addEventListener("Modify",this._boundTriggerListener), -this._triggerListenerInstalled=!0}};i.EventTarget.addMixin(l.prototype);o.prototype=new n.KeyMode;d.mixin(o.prototype,{createKeyBindings:function(){var a=m.KeyBinding,b=[];b.push({actionID:"contentAssistApply",keyBinding:new a(13)});b.push({actionID:"contentAssistCancel",keyBinding:new a(27)});b.push({actionID:"contentAssistNextProposal",keyBinding:new a(40)});b.push({actionID:"contentAssistPreviousProposal",keyBinding:new a(38)});b.push({actionID:"contentAssistNextPage",keyBinding:new a(34)});b.push({actionID:"contentAssistPreviousPage", -keyBinding:new a(33)});b.push({actionID:"contentAssistHome",keyBinding:new a(h.KEY.HOME)});b.push({actionID:"contentAssistEnd",keyBinding:new a(h.KEY.END)});b.push({actionID:"contentAssistTab",keyBinding:new a(9)});return b},cancel:function(){this.getContentAssist().deactivate()},getContentAssist:function(){return this.contentAssist},getProposals:function(){return this.proposals},isActive:function(){return this.getContentAssist().isActive()},setActive:function(a){a?this.contentAssist.textView.addKeyMode(this): -this.contentAssist.textView.removeKeyMode(this)},lineUp:function(a,b){return this.selectNew(a,b,!1)},lineDown:function(a,b){return this.selectNew(a,b,!0)},selectNew:function(a,b,c){if(c){if(void 0===a&&(a=this.selectedIndex+1),a>=this.proposals.length)if(b)return!0;else a=0}else if(void 0===a&&(a=this.selectedIndex-1),0>a)if(b)return!0;else a=this.proposals.length-1;for(var d=a;this.proposals[a]&&this.proposals[a].unselectable;){if(c){if(a++,a>=this.proposals.length)if(b)return!0;else a=0}else if(a--, -0>a)if(b)return!0;else a=this.proposals.length-1;if(a===d){a=-1;break}}this.selectedIndex=a;this.widget&&this.widget.selectNode(a);return!0},pageUp:function(){if(this.widget){var a=this.widget.getTopIndex();a===this.selectedIndex&&(this.widget.scrollIndex(a,!1),a=this.widget.getTopIndex());return 0===a?this.lineDown(a,!0):this.lineUp(a,!0)}else return this.lineUp()},pageDown:function(){if(this.widget){var a=this.widget.getBottomIndex();a===this.selectedIndex&&(this.widget.scrollIndex(a,!0),a=this.widget.getBottomIndex()); -return this.lineDown(a,!0)}else return this.lineDown()},enter:function(){return this.contentAssist.apply(this.proposals[this.selectedIndex]||null)},tab:function(){return this.widget?(this.widget.parentNode.focus(),!0):!1}});q.prototype={onClick:function(a){if(!a)a=window.event;this.contentAssist.apply(this.getProposal(a.target||a.srcElement));this.textView.focus()},onScroll:function(){this.previousCloneNode&&!this.preserveCloneThroughScroll&&(this._removeCloneNode(),this.previousSelectedNode.classList.add(r.selected)); -this.preserveCloneThroughScroll=!1},createDiv:function(a,b,c){var d=b.ownerDocument,e=g.createElement(d,"div");e.id="contentoption"+c;e.setAttribute("role","option");e.className=r[a.style]?r[a.style]:r.dfault;a.style==="hr"?a=g.createElement(d,"hr"):(a=this._createDisplayNode(e,a,c),e.contentAssistProposalIndex=c);e.appendChild(a);b.appendChild(e)},createAccessible:function(){var a=this._contentAssistMode,b=this;this.parentNode.addEventListener("keydown",function(c){if(!c)c=window.event;c.preventDefault&& -c.preventDefault();if(c.keyCode===h.KEY.ESCAPE)return a.cancel();else if(c.keyCode===h.KEY.UP)return a.lineUp();else if(c.keyCode===h.KEY.DOWN)return a.lineDown();else if(c.keyCode===h.KEY.ENTER)return a.enter();else if(c.keyCode===h.KEY.PAGEDOWN)return a.pageDown();else if(c.keyCode===h.KEY.PAGEUP)return a.pageUp();else if(c.keyCode===h.KEY.HOME)return b.scrollIndex(0,!0),a.lineDown(0);else if(c.keyCode===h.KEY.END)return a.lineUp(a.getProposals().length-1);return!1})},_createDisplayNode:function(a, -b,c){var d=null,e=null;if(typeof b==="string")e=b;else if(b.description&&typeof b.description==="string")if(b.name&&typeof b.name==="string"){var f=this._createNameNode(b.name);f.contentAssistProposalIndex=c;d=document.createElement("span");d.appendChild(f);f=document.createTextNode(b.description);d.appendChild(f);a.setAttribute("title",b.name+b.description)}else e=b.description;else e=b.proposal;e&&(d=this._createNameNode(e),a.setAttribute("title",e));d.contentAssistProposalIndex=c;return d},_createNameNode:function(a){var b= -document.createElement("span");b.classList.add("proposal-name");b.appendChild(document.createTextNode(a));return b},getProposal:function(a){var b=null,a=a.contentAssistProposalIndex;void 0!==a&&(b=this._contentAssistMode.getProposals()[a]||null);return b},getTopIndex:function(){for(var a=this.parentNode.childNodes,b=0;b=this.parentNode.scrollTop)return b;return 0},getBottomIndex:function(){for(var a=this.parentNode.childNodes,b=0;bthis.parentNode.scrollTop+this.parentNode.clientHeight)return Math.max(0,b-1)}return a.length-1},scrollIndex:function(a,b){this.parentNode.childNodes[a].scrollIntoView(b);this.preserveCloneThroughScroll=!0},selectNode:function(a){var b=null;if(this.previousSelectedNode)this.previousSelectedNode.classList.remove(r.selected),this.previousSelectedNode=null,this.previousCloneNode&&this._removeCloneNode();if(-1!==a){b=this.parentNode.childNodes[a];b.classList.add(r.selected);this.parentNode.setAttribute("aria-activedescendant", -b.id);b.focus();if(b.offsetTopthis.parentNode.scrollTop+this.parentNode.clientHeight)b.scrollIntoView(!1),this.preserveCloneThroughScroll=!0;var c=h.bounds(b.firstChild||b),d=h.bounds(this.parentNode),a=window.getComputedStyle(this.parentNode),e=window.getComputedStyle(b),e=parseInt(a.paddingLeft)+parseInt(a.paddingRight)+parseInt(e.paddingLeft)+parseInt(e.paddingRight);if(c.width>= -d.width-e){e=parseInt(a.top);d=b.cloneNode(!0);d.classList.add("cloneProposal");d.style.top=e+b.offsetTop-this.parentNode.scrollTop+"px";d.style.left=a.left;d.setAttribute("id",d.id+"_clone");c=c.left+c.width-parseInt(document.documentElement.clientWidth);if(c>0)a=parseInt(a.left)-c,0>a&&(a=0),d.style.left=a+"px";a=document.createElement("div");a.id="clone_contentassist";a.classList.add("contentassist");a.classList.add("cloneWrapper");a.appendChild(d);a.onclick=this.parentNode.onclick;this.parentNode.parentNode.insertBefore(a, -this.parentNode);var f=function(a){a.contentAssistProposalIndex=b.contentAssistProposalIndex;if(a.hasChildNodes())for(var c=0;cb.documentElement.clientHeight)this.parentNode.style.top=a.y-this.parentNode.offsetHeight-this.textView.getLineHeight()+"px";if(a.x+this.parentNode.offsetWidth>c)this.parentNode.style.left=c-this.parentNode.offsetWidth+"px"},_removeCloneNode:function(){this.parentNode.parentNode.contains(this.previousCloneNode)&&this.parentNode.parentNode.removeChild(this.previousCloneNode); -this.previousCloneNode=null}};return{ContentAssist:l,ContentAssistMode:o,ContentAssistWidget:q}}); -define("orion/editor/stylers/lib/syntax",[],function(){return{id:"orion.lib",grammars:[{id:"orion.lib",patterns:[{include:"#brace_open"},{include:"#brace_close"},{include:"#bracket_open"},{include:"#bracket_close"},{include:"#parenthesis_open"},{include:"#parenthesis_close"},{include:"#number_decimal"},{include:"#number_hex"},{include:"#string_doubleQuote"},{include:"#string_singleQuote"}],repository:{brace_open:{match:"{",name:"punctuation.section.block.begin"},brace_close:{match:"}",name:"punctuation.section.block.end"}, -bracket_open:{match:"\\[",name:"punctuation.section.bracket.begin"},bracket_close:{match:"\\]",name:"punctuation.section.bracket.end"},parenthesis_open:{match:"\\(",name:"punctuation.section.parens.begin"},parenthesis_close:{match:"\\)",name:"punctuation.section.parens.end"},doc_block:{begin:"/\\*\\*",end:"\\*/",name:"comment.block.documentation",patterns:[{match:"@(?:(?!\\*/)\\S)*",name:"keyword.other.documentation.tag"},{match:"\\<\\S*\\>",name:"keyword.other.documentation.markup"},{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)", -name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]},number_decimal:{match:"\\b-?(?:\\.\\d+|\\d+\\.?\\d*)(?:[eE][+-]?\\d+)?\\b",name:"constant.numeric.number"},number_hex:{match:"\\b0[xX][0-9A-Fa-f]+\\b",name:"constant.numeric.hex"},string_doubleQuote:{match:'"(?:\\\\.|[^"])*"?',name:"string.quoted.double"},string_singleQuote:{match:"'(?:\\\\.|[^'])*'?",name:"string.quoted.single"},todo_comment_singleLine:{match:"(\\b)(TODO)(\\b)(.*)", -name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.line"}}}}},{id:"orion.c-like",patterns:[{include:"orion.lib"},{include:"#comment_singleLine"},{include:"#comment_block"}],repository:{comment_singleLine:{match:"//.*",name:"comment.line.double-slash",patterns:[{include:"orion.lib#todo_comment_singleLine"}]},comment_block:{begin:"/\\*",end:"\\*/",name:"comment.block",patterns:[{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo", -captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]}}}],keywords:[]}}); -define("orion/editor/stylers/text_css/syntax",["orion/editor/stylers/lib/syntax"],function(k){var m="alignment-adjust,alignment-baseline,animation-delay,animation-direction,animation-duration,animation-iteration-count,animation-name,animation-play-state,animation-timing-function,animation,appearance,azimuth,backface-visibility,background-attachment,background-clip,background-color,background-image,background-origin,background-position,background-repeat,background-size,background,baseline-shift,binding,bleed,bookmark-label,bookmark-level,bookmark-state,bookmark-target,border-bottom-color,border-bottom-left-radius,border-bottom-right-radius,border-bottom-style,border-bottom-width,border-bottom,border-collapse,border-color,border-image-outset,border-image-repeat,border-image-slice,border-image-source,border-image-width,border-image,border-left-color,border-left-style,border-left-width,border-left,border-radius,border-right-color,border-right-style,border-right-width,border-right,border-spacing,border-style,border-top-color,border-top-left-radius,border-top-right-radius,border-top-style,border-top-width,border-top,border-width,border,bottom,box-align,box-decoration-break,box-direction,box-flex-group,box-flex,box-lines,box-ordinal-group,box-orient,box-pack,box-shadow,box-sizing,break-after,break-before,break-inside,caption-side,clear,clip,color-profile,color,column-count,column-fill,column-gap,column-rule-color,column-rule-style,column-rule-width,column-rule,column-span,column-width,columns,content,counter-increment,counter-reset,crop,cue-after,cue-before,cue,cursor,direction,display,dominant-baseline,drop-initial-after-adjust,drop-initial-after-align,drop-initial-before-adjust,drop-initial-before-align,drop-initial-size,drop-initial-value,elevation,empty-cells,fit-position,fit,flex-align,flex-flow,flex-inline-pack,flex-order,flex-pack,float-offset,float,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,font,grid-columns,grid-rows,hanging-punctuation,height,hyphenate-after,hyphenate-before,hyphenate-character,hyphenate-lines,hyphenate-resource,hyphens,icon,image-orientation,image-rendering,image-resolution,inline-box-align,left,letter-spacing,line-height,line-stacking-ruby,line-stacking-shift,line-stacking-strategy,line-stacking,list-style-image,list-style-position,list-style-type,list-style,margin-bottom,margin-left,margin-right,margin-top,margin,mark-after,mark-before,mark,marker-offset,marks,marquee-direction,marquee-loop,marquee-play-count,marquee-speed,marquee-style,max-height,max-width,min-height,min-width,move-to,nav-down,nav-index,nav-left,nav-right,nav-up,opacity,orphans,outline-color,outline-offset,outline-style,outline-width,outline,overflow-style,overflow-x,overflow-y,overflow,padding-bottom,padding-left,padding-right,padding-top,padding,page-break-after,page-break-before,page-break-inside,page-policy,page,pause-after,pause-before,pause,perspective-origin,perspective,phonemes,pitch-range,pitch,play-during,position,presentation-level,punctuation-trim,quotes,rendering-intent,resize,rest-after,rest-before,rest,richness,right,rotation-point,rotation,ruby-align,ruby-overhang,ruby-position,ruby-span,size,speak-header,speak-numeral,speak-punctuation,speak,speech-rate,stress,string-set,table-layout,target-name,target-new,target-position,target,text-align-last,text-align,text-decoration,text-emphasis,text-height,text-indent,text-justify,text-outline,text-shadow,text-transform,text-wrap,top,transform-origin,transform-style,transform,transition-delay,transition-duration,transition-property,transition-timing-function,transition,unicode-bidi,vertical-align,visibility,voice-balance,voice-duration,voice-family,voice-pitch-range,voice-pitch,voice-rate,voice-stress,voice-volume,volume,white-space-collapse,white-space,widows,width,word-break,word-spacing,word-wrap,z-index".split(","),k= -k.grammars;k.push({id:"orion.css",contentTypes:["text/css"],patterns:[{include:"orion.lib"},{include:"orion.c-like#comment_block"},{match:"(?:-webkit-|-moz-|-ms-|\\b)(?:"+m.join("|")+")\\b",name:"keyword.control.css"},{match:"(?i)\\b-?(?:\\.\\d+|\\d+\\.?\\d*)(?:%|em|ex|ch|rem|vw|vh|vmin|vmax|in|cm|mm|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?\\b",name:"constant.numeric.value.css"},{begin:"(['\"])(?:\\\\.|[^\\\\\\1])*\\\\$",end:"^(?:$|(?:\\\\.|[^\\\\\\1])*(\\1|[^\\\\]$))",name:"string.quoted.multiline.css"}], -repository:{number_hex:{match:"#[0-9A-Fa-f]+\\b",name:"constant.numeric.hex.css"}}});return{id:k[k.length-1].id,grammars:k,keywords:m}}); -define("orion/editor/cssContentAssist",["orion/editor/templates","orion/editor/stylers/text_css/syntax"],function(k,m){function n(a){return JSON.stringify(a).replace("}","\\}")}function i(){}for(var c={type:"link",values:"visible,hidden,scroll,auto,no-display,no-content".split(",")},d={type:"link",values:"solid,dashed,dotted,double,groove,ridge,inset,outset".split(",")},f={type:"link",values:[]},g=0;g<10;g++)f.values.push(g.toString());for(var h={type:"link",values:"black,white,red,green,blue,magenta,yellow,cyan,grey,darkred,darkgreen,darkblue,darkmagenta,darkcyan,darkyellow,darkgray,lightgray".split(",")}, -b=[{prefix:"rule",description:"rule - class selector rule",template:".${class} {\n\t${cursor}\n}"},{prefix:"rule",description:"rule - id selector rule",template:"#${id} {\n\t${cursor}\n}"},{prefix:"outline",description:"outline - outline style",template:"outline: ${color:"+n(h)+"} ${style:"+n(d)+"} ${width:"+n(f)+"}px;"},{prefix:"background-image",description:"background-image - image style",template:'background-image: url("${uri}");'},{prefix:"url",description:"url - url image",template:'url("${uri}");'}, -{prefix:"rgb",description:"rgb - rgb color",template:"rgb(${red},${green},${blue});"},{prefix:"@",description:"import - import style sheet",template:'@import "${uri}";'}],a=[{prop:"display",values:{type:"link",values:"none,block,box,flex,inline,inline-block,inline-flex,inline-table,list-item,table,table-caption,table-cell,table-column,table-column-group,table-footer-group,table-header-group,table-row,table-row-group,inherit".split(",")}},{prop:"overflow",values:c},{prop:"overflow-x",values:c},{prop:"overflow-y", -values:c},{prop:"float",values:{type:"link",values:["left","right","none","inherit"]}},{prop:"position",values:{type:"link",values:["absolute","fixed","relative","static","inherit"]}},{prop:"cursor",values:{type:"link",values:"auto,crosshair,default,e-resize,help,move,n-resize,ne-resize,nw-resize,pointer,progress,s-resize,se-resize,sw-resize,text,w-resize,wait,inherit".split(",")}},{prop:"color",values:h},{prop:"border-top-color",values:h},{prop:"border-bottom-color",values:h},{prop:"border-right-color", -values:h},{prop:"border-left-color",values:h},{prop:"background-color",values:h},{prop:"font-style",values:{type:"link",values:["italic","normal","oblique","inherit"]}},{prop:"font-weight",values:{type:"link",values:"bold,normal,bolder,lighter,100,200,300,400,500,600,700,800,900,inherit".split(",")}},{prop:"white-space",values:{type:"link",values:"pre,pre-line,pre-wrap,nowrap,normal,inherit".split(",")}},{prop:"word-wrap",values:{type:"link",values:["normal","break-word"]}},{prop:"visibility",values:{type:"link", -values:["hidden","visible","collapse","inherit"]}}],g=0;g\n\n\t\n\t\t\n\t\t${title}\n\t\n\t\n\t\t

${header}

\n\t\t

\n\t\t\t${cursor}\n\t\t

\n\t\n'),i=[{prefix:"",description:" - HTML image element",template:'${Image}'},{prefix:"",description:" - HTML anchor element", -template:''},{prefix:"",description:" - HTML unordered list",template:"
    \n\t
  • ${cursor}
  • \n
"},{prefix:"",description:" - HTML ordered list",template:"
    \n\t
  1. ${cursor}
  2. \n
"},{prefix:"",description:" - HTML definition list",template:"
\n\t
${cursor}
\n\t
\n
"},{prefix:"",description:" - basic HTML table",template:"\n\t\n\t\t\n\t\n
${cursor}
"}, -{prefix:"<\!--",name:"<\!-- --\>",description:" - HTML comment",template:"<\!-- ${cursor} --\>"}],c,d,f,g,h="abbr,b,button,canvas,cite,command,dd,del,dfn,dt,em,embed,font,h1,h2,h3,h4,h5,h6,i,ins,kbd,label,li,mark,meter,object,option,output,progress,q,rp,rt,samp,small,strong,sub,sup,td,time,title,tt,u,var".split(",");for(g=0;g",d="<"+c+">${cursor}",i.push({prefix:"<"+c,description:f,template:d});h="address,article,aside,audio,bdo,blockquote,body,caption,code,colgroup,datalist,details,div,fieldset,figure,footer,form,head,header,hgroup,iframe,legend,map,menu,nav,noframes,noscript,optgroup,p,pre,ruby,script,section,select,span,style,tbody,textarea,tfoot,th,thead,tr,video".split(","); -for(g=0;g",d="<"+c+">\n\t${cursor}\n",i.push({prefix:"<"+c,description:f,template:d});h="area,base,br,col,hr,input,link,meta,param,keygen,source".split(",");for(g=0;g",i.push({prefix:"<"+c,description:f,template:d});m.prototype=new k.TemplateContentAssist([],i);m.prototype.getPrefix=function(b,a){for(var c="",d=a;d&&/[A-Za-z0-9".indexOf(c)===-1};return{JSTemplateContentAssistProvider:n}}); -define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(k,m){function n(d){return d.getProperty("objectClass").indexOf(c)!==-1&&d.getProperty("type")==="highlighter"}function i(c,d,h){this.initialize(c,d,h);this.lineStyles=[]}var c="orion.edit.highlighter",d=c+" service must be an event emitter";m.AnnotationType.registerType("orion.annotation.highlightError",{title:k.syntaxError,html:"
",rangeStyle:{styleClass:"annotationRange error"}}); -i.prototype={initialize:function(d,g,h){this.textView=d;this.serviceRegistry=g;this.annotationModel=h;this.services=[];var b=this;this.listener={onModelChanging:function(a){b.onModelChanging(a)},onModelChanged:function(a){b.onModelChanged(a)},onDestroy:function(a){b.onDestroy(a)},onLineStyle:function(a){b.onLineStyle(a)},onStyleReady:function(a){b.onStyleReady(a)},onServiceAdded:function(a){b.onServiceAdded(a.serviceReference,b.serviceRegistry.getService(a.serviceReference))},onServiceRemoved:function(a){b.onServiceRemoved(a.serviceReference, -b.serviceRegistry.getService(a.serviceReference))}};d.addEventListener("ModelChanging",this.listener.onModelChanging);d.addEventListener("ModelChanged",this.listener.onModelChanged);d.addEventListener("Destroy",this.listener.onDestroy);d.addEventListener("LineStyle",this.listener.onLineStyle);g.addEventListener("registered",this.listener.onServiceAdded);g.addEventListener("unregistering",this.listener.onServiceRemoved);d=g.getServiceReferences(c);for(h=0;h=this.string.length},sol:function(){return this.pos===0},peek:function(){return this.string[this.pos]},next:function(){return this.string[this.pos++]}, -eat:function(b){var a=this.string[this.pos];return typeof a==="string"&&(a===b||b.test&&b.test(a)||typeof b==="function"&&b(a))?this.string[this.pos++]:void 0},eatWhile:function(b){for(var a=!1;this.eat(b)!==void 0;)a=!0;return a},eatSpace:function(){return this.eatWhile(/\s/)},skipToEnd:function(){this.pos=this.string.length},skipTo:function(b){b=this.string.indexOf(b,this.pos);return b!==-1?(this.pos=b,!0):!1},match:function(b,a,c){a=a===!0||typeof a==="undefined";if(typeof b==="string"){var d= -c?this.string.toLowerCase():this.string,b=c?b.toLowerCase():b,c=d.indexOf(b,this.pos);if(c!==-1&&a)this.pos=c+b.length;return c!==-1}else return(b=this.string.substring(this.pos).match(b))&&a&&typeof b[0]==="string"&&(this.pos+=b.index+b[0].length),b},backUp:function(b){this.pos-=b},column:function(){for(var b=0,a=0;a=c)break;this._expandRange(d,d);for(var f=this._getResumeLineIndex(d),d=f+1,f=(f=f>=0&&this.lines[f].eolState)?this.codeMirror.copyState(this.mode,f):this.mode.startState(),g=0,h=d;h3;if(i||s)break;else if(!k||m)g=0;k=hb&&k){this.highlightLater(h+1);this.onHighlightDone();return}}}this.onHighlightDone()},onHighlightDone:function(){this.startLine!==Number.MAX_VALUE&&this.endLine!==-1&&this.dispatchEvent({type:"Highlight",start:this.startLine,end:this.endLine});this.startLine=Number.MAX_VALUE;this.endLine=-1},_getResumeLineIndex:function(b){for(var a=this.lines,c=b-1;c>=0;c--)if(a[c].eolState||b-c>40)return c;return-1},getState:function(b){var a=this.mode,c=this.lines,d,f;for(d=b-1;d>=0;d--)if(f=c[d], -f.eolState||b-d>40)break;var g=d>=0&&c[d].eolState;if(g){g=this.codeMirror.copyState(a,g);for(d=Math.max(0,d);d",rangeStyle:{styleClass:"annotationRange error"}});h.prototype={init:function(b,a,c){this.textView=b;this.annotationModel=c;this.modeApplier=new g(b.getModel(),a);var d=this;this.listener={onLineStyle:function(a){d.onLineStyle(a)},onDestroy:function(a){d.onDestroy(a)}, -onHighlight:function(a){d.onHighlight(a)}};b.addEventListener("LineStyle",this.listener.onLineStyle);b.addEventListener("Destroy",this.listener.onDestroy);this.modeApplier.addEventListener("Highlight",this.listener.onHighlight)},destroy:function(){this.modeApplier&&(this.modeApplier.removeEventListener("Highlight",this.listener.onHighlight),this.modeApplier.destroy());this.textView&&(this.textView.removeEventListener("LineStyle",this.listener.onLineStyle),this.textView.removeEventListener("Destroy", -this.listener.onDestroy));this.listener=this.modeApplier=this.annotationModel=this.textView=null},setMode:function(b){this.modeApplier.setMode(b)},onLineStyle:function(b){var a=b.lineIndex,c=this.modeApplier,d=c.getLineStyle(a);if(!d||!d.eolState){var f=this.textView.getModel().getLineCount();c.highlight(a,Math.min(a+20,f-1),!0);d=c.getLineStyle(a)}f=this.textView.getModel();if(d){var g=c.toStyleRangesAndErrors(d,a);if(g&&(b.ranges=g[0],b=this.annotationModel)){c=[];d=[];if(g=g[1])for(var h=0;h/,func:function(){return"atomic group"}}],toRegExp:function(c){function d(b,a){throw Error('Unsupported regex feature "'+b+'": "'+a[0]+'" at index: '+a.index+" in "+a.input);}var f="",g,c=i.processGlobalFlag("x",c,function(b){for(var a="",c=!1,d=b.length,f=0;f=0;u--);w=f.charAt(u-1);s=u-1;j=f.substring(u,p+1)}u=a[a.length-1];if(w===")"&&(u.type===2||u.type===4)){k.splice(u.start,0,"(");k.push(j);k.push(")");v={start:u.start,end:k.length-1,type:4,num:u.num}; -for(w=0;w=u.start&&n.end<=s)if(n.start+=1,n.end+=1,n.num+=1,n.type===2)m[n.oldNum]=n.num;a.push(v);i++;break}default:v!=="|"&&n!==2&&n!==4&&b===0&&(h.push(4),a.push({start:p,end:-1,type:4,num:i}),k.push("("),r[i]=null,i++),k.push(v),v==="\\"&&(v=f.charAt(p+1),k.push(v),p+=1)}}for(;h.length;)h.pop(),k.push(")");var f=RegExp(k.join("")),g={},d=d||m,x;for(x in d)d.hasOwnProperty(x)&&(g[x]="\\"+d[x]);f=this.getSubstitutedRegex(f,g,!1);return[f, -m,r]},complexCaptures:function(c){if(!c)return!1;for(var d in c)if(c.hasOwnProperty(d)&&d!=="0")return!0;return!1}};n.prototype={initialize:function(c){this.textView=c;this.textView.stylerOptions=this;var d=this;this._listener={onModelChanged:function(c){d.onModelChanged(c)},onDestroy:function(c){d.onDestroy(c)},onLineStyle:function(c){d.onLineStyle(c)},onStorage:function(c){d.onStorage(c)}};c.addEventListener("ModelChanged",this._listener.onModelChanged);c.addEventListener("Destroy",this._listener.onDestroy); -c.addEventListener("LineStyle",this._listener.onLineStyle);c.redrawLines()},onDestroy:function(){this.destroy()},destroy:function(){if(this.textView)this.textView.removeEventListener("ModelChanged",this._listener.onModelChanged),this.textView.removeEventListener("Destroy",this._listener.onDestroy),this.textView.removeEventListener("LineStyle",this._listener.onLineStyle),this.textView=null;this._listener=this._tree=this._styles=this.grammar=null},preprocess:function(c){for(c=[c];c.length!==0;){var d= -c.pop();if(!d._resolvedRule||!d._typedRule)if(d._resolvedRule=this._resolve(d),d._typedRule=this._createTypedRule(d),this.addStyles(d.name),this.addStyles(d.contentName),this.addStylesForCaptures(d.captures),this.addStylesForCaptures(d.beginCaptures),this.addStylesForCaptures(d.endCaptures),d._resolvedRule!==d&&c.push(d._resolvedRule),d.patterns)for(var f=0;f0;)c.push(d[--f])},exec:function(c,d,f){(d=c.exec(d))&&(d.index+=f);c.lastIndex=0;return d},afterMatch:function(c){return c.index+c[0].length},getEndMatch:function(c,d,f){if(c instanceof this.BeginEndNode){var g=c.rule,c=c.endRegexSubstituted||g.endRegex;return!c?null:this.exec(c,d,f)}return null},initialParse:function(){this.textView.getModel().getCharCount();this._tree=new this.ContainerNode(null,this.grammar._typedRule);this.parse(this._tree, -!1,0)},onModelChanged:function(c){var d=c.addedCharCount,f=c.removedCharCount,c=c.start;if(this._tree){var g=this.textView.getModel(),h=g.getCharCount(),g=g.getLineEnd(g.getLineAtOffset(c)-1),b=this.getFirstDamaged(g,g),g=g===-1?0:g,d=b?this.parse(b,!0,g,c,d,f):h;this.textView.redrawRange(g,d)}else this.initialParse()},getFirstDamaged:function(c,d){if(c<0)return this._tree;for(var f=[this._tree],g=null;f.length;){var h=f.pop();if(!h.parent||this.isDamaged(h,c,d)){h instanceof this.BeginEndNode&&(g= -h);for(var b=0;bd},parse:function(c,d,f,g,h,b){var a=this.textView.getModel(),e=a.getLineStart(a.getLineCount()-1),i=a.getCharCount(),k=this.getInitialExpected(c,f),m=-1;if(d)c.repaired=!0,c.endNeedsUpdate=!0,m=(m=c.children[c.children.length-1])?a.getLineEnd(a.getLineAtOffset(m.end+(h-b))):-1,g=a.getLineEnd(a.getLineAtOffset(g+b)),m=Math.max(m,g);for(var m=m===-1?i:m,g=k,n=c,p=!1, -t=f,v=-1;n&&(!d||t=e?i:a.getLineStart(a.getLineAtOffset(t)+1));var u=s&&s.match,j=s&&s.rule,w=s&&s.isEnd;if(s&&s.isSub){if(t=this.afterMatch(u),j instanceof this.BeginEndRule)p=!0,d&&j===g.rule&&n===g.parent?(n=g,n.setStart(u),n.repaired=!0,n.endNeedsUpdate=!0,g=this.getNextExpected(g,"begin")):(d&&(this.prune(n,g),d=!1),u=new this.BeginEndNode(n,j,u),n.addChild(u),n=u)}else if(w||t===i){if(n instanceof this.BeginEndNode)u?(p=!0,v=Math.max(v,n.end),n.setEnd(u), -t=this.afterMatch(u),d&&n===g&&n.parent===g.parent?(n.repaired=!0,delete n.endNeedsUpdate,g=this.getNextExpected(g,"end")):d&&(this.prune(n,g),d=!1)):(n.setEnd(i),delete n.endNeedsUpdate);n=n.parent}d&&t>=m&&!p&&(this.prune(c,k),d=!1)}this.removeUnrepairedChildren(c,d,f);this.cleanup(d,c,f,m,i,h,b);return d?Math.max(v,t):t},removeUnrepairedChildren:function(c,d,f){if(d){for(var d=c.children,g=-1,h=0;h=d)return g}else if(c instanceof this.BeginEndNode&&c.endMatch){var h=c.endMatch.index;for(f=0;f=d)break;if(g&&g.start",contentName:"entity.name.tag.doctype.html",beginCaptures:{0:{name:"entity.name.tag.doctype.html"}},endCaptures:{0:{name:"entity.name.tag.doctype.html"}}},{begin:"<\!--",end:"--\>",beginCaptures:{0:{name:"punctuation.definition.comment.html"}},endCaptures:{0:{name:"punctuation.definition.comment.html"}}, -patterns:[{match:"--",name:"invalid.illegal.badcomment.html"}],contentName:"comment.block.html"},{match:"<[A-Za-z0-9_\\-:]+(?= ?)",name:"entity.name.tag.html"},{include:"#attrName"},{include:"#qString"},{include:"#qqString"},{include:"#entity"},{match:"",name:"entity.name.tag.html"},{match:">",name:"entity.name.tag.html"}],repository:{attrName:{match:"[A-Za-z\\-:]+(?=\\s*=\\s*['\"])",name:"entity.other.attribute.name.html"},qqString:{match:'(")[^"]+(")',name:"string.quoted.double.html"}, -qString:{match:"(')[^']+(')",name:"string.quoted.single.html"},entity:{match:"&[A-Za-z0-9]+;",name:"constant.character.entity.html"}}}}}}); -define("orion/editor/textStyler",["orion/editor/annotations"],function(k){function m(a,b){this._unnamedCounter=0;this._patterns=[];this._rootId=b;a.forEach(function(a){this._addRepositoryPatterns(a.repository||{},a.id);this._addPatterns(a.patterns||[],a.id)}.bind(this))}function n(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= -{};if(d)this._initPatterns(),this._subBlocks=t(d,d.getText(this.start,this.end),this,this.start)}function i(a){this._styler=a}function c(a,b,c,d){this.highlightCaretLine=this.whitespacesVisible=this.spacesVisible=this.tabsVisible=!1;this.detectTasks=this.foldingEnabled=!0;this.view=a;this.annotationModel=b;this.patternManager=new m(c,d);this._accessor=new i(this);this._bracketAnnotations=void 0;var e=this;this._listener={onChanged:function(a){e._onModelChanged(a)},onDestroy:function(a){e._onDestroy(a)}, -onLineStyle:function(a){e._onLineStyle(a)},onMouseDown:function(a){e._onMouseDown(a)},onSelection:function(a){e._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 n({start:0,contentStart:0,end:d,contentEnd:d},null,this,c);this._computeFolding(this._rootBlock.getBlocks());b&&this.detectTasks&&(d=[],v(this._rootBlock,c,d),b.replaceAnnotations([],d));a.redrawLines()}var d={styleClass:"meta annotation currentLine"},f=/$/,g=/\\(\d)/g,h=/(.*)(?:[\r\n]|$)/g,b={regex:/ /g,style:{styleClass:"punctuation separator space",unmergeable:!0}},a={regex:/\t/g,style:{styleClass:"punctuation separator tab",unmergeable:!0}},e=function(a,b,c,d){var e=c,f=a.lastIndex;h.lastIndex= -c;var c=h.exec(b),g,i;a.lastIndex=0;if(c){for(i=c.index;0<=--i;)if(g=b.charAt(i),g==="\n"||g==="\r")break;g=b.substring(i+1,c.index+c[1].length);a.lastIndex=i=c.index-i-1}for(;c&&c.indexb.result.index?1:a.pattern.pattern.index0;){var k=i[0];i.splice(0,1);if(!(k.result.indexb.start?1:0});for(m=0;mb.result.index?1:a.pattern.pattern.index0;){var k=g[0];g.splice(0,1);if(!(k.result.index1;)if(f= -Math.floor((e+d)/2),b<=a[f].start)e=f;else if(c&&b=f)break;var m=k[l].start,n=k[l].end;i=0?1:-1,f[l]*k-1===c){c=1;if(g){for(l++;l=0?1:-1,c+=k,c===0)return f[l]*k-1;d+=1;for(l=a.getLineCount();d=0?1:-1,c+=k,c===0)return f[g]*k-1;d++}}else{for(l--;l>=0;l--)if(k=f[l]>=0?1:-1,c+=k,c===0)return f[l]*k-1;for(d-=1;d>=0;){k=a.getLine(d);m=a.getLineStart(d);f=a.getLineEnd(d);f=this._findBrackets(h,i,b,k,m,f);for(l=f.length-1;l>=0;l--)if(k=f[l]>=0?1:-1,c+=k,c===0)return f[l]*k-1;d--}}break}return-1},_getAnnotationModel:function(){return this.annotationModel},_getLineStyle:function(a){if(this.highlightCaretLine){var b=this.view,c=b.getModel(),b=b.getSelection();if(b.start===b.end&&c.getLineAtOffset(b.start)=== -a)return d}return null},_getPatternManager:function(){return this.patternManager},_getStyles:function(a,b,c,d){b.getBaseModel&&(d=b.mapOffset(d));for(var f=d+c.length,g=[],h=d,i=a.getBlocks(),k=this._binarySearch(i,d,!0);k=f)break;var l=i[k].start,m=i[k].end;h0)i-=1,a.getBaseModel&&(i=a.mapOffset(i),a=a.getBaseModel()),c=this._findBlock(this._rootBlock,i),a=this._findMatchingBracket(a,c,i),a!==-1&&(h=[k.AnnotationType.createAnnotation(k.AnnotationType.ANNOTATION_MATCHING_BRACKET, -a,a+1),k.AnnotationType.createAnnotation(k.AnnotationType.ANNOTATION_CURRENT_BRACKET,i,i+1)]);this._bracketAnnotations=h;this.annotationModel.replaceAnnotations(b,h)}},_onMouseDown:function(a){if(a.clickCount===2){var b=this.view,c=b.getModel(),d=b.getOffsetAtLocation(a.x,a.y);if(d>0){var e=d-1,f=c;c.getBaseModel&&(e=c.mapOffset(e),f=c.getBaseModel());var g=this._findBlock(this._rootBlock,e),e=this._findMatchingBracket(f,g,e);e!==-1&&(a.preventDefault(),a=e,c.getBaseModel&&(a=c.mapOffset(a,!0)),d> -a&&(d--,a++),b.setSelection(a,d))}}},_onModelChanged:function(a){var b=a.start,c=a.removedCharCount,a=a.addedCharCount-c,d=this.view,e=d.getModel(),f=e.getBaseModel?e.getBaseModel():e,c=b+c,g=f.getCharCount(),i=this._rootBlock.getBlocks(),h=i.length,l=f.getLineStart(f.getLineAtOffset(b)),m=this._binarySearch(i,l,!0),n=this._binarySearch(i,c,!1,m-1,h),o;mb&&(o+=a)):o=m===h&&h>0&&g-a===i[h-1].end?i[h-1].start:l;var p;do nb&&(p+=a),n+=1): -(n=h,p=g),l=f.getText(o,p),l=t(f,l,this._rootBlock,o);while(l.length&&i.length&&nb&&h.adjustStart(a),h.start>b&&h.adjustEnd(a);var q=n-m!==l.length;if(!q)for(g=0;gb&&(g-=a),n>b&&(n-=a),g<=b&&b",captures:{0:{name:"entity.name.tag.doctype.xml"}},patterns:[{include:"#comment"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"}],name:"meta.tag.doctype.xml"},{begin:"",captures:{0:{name:"entity.name.tag.xml"}},name:"meta.tag.xml",patterns:[{include:"#comment"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"}]},{match:"<|>|&",name:"constant.character"}],repository:{comment:{begin:"<\!--",end:"--\>",name:"comment.block.xml",patterns:[{match:"(\\b)(TODO)(\\b)(((?!--\>).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.line"}}}]},xmlDeclaration:{begin:"<\\?xml", -end:"\\?>",captures:{0:{name:"entity.name.tag.declaration.xml"}},patterns:[{include:"#comment"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"}],name:"meta.tag.declaration.xml"}}});return{id:k[k.length-1].id,grammars:k,keywords:[]}}); -define("orion/editor/stylers/text_html/syntax",["orion/editor/stylers/lib/syntax","orion/editor/stylers/application_javascript/syntax","orion/editor/stylers/text_css/syntax","orion/editor/stylers/text_x-php/syntax","orion/editor/stylers/application_xml/syntax"],function(k,m,n,i,c){k=k.grammars.concat(m.grammars).concat(n.grammars).concat(i.grammars).concat(c.grammars);k.push({id:"orion.html",contentTypes:["text/html"],patterns:[{include:"orion.xml"},{begin:"(?i)(]*)(>)",end:"(?i)()", -captures:{1:{name:"entity.name.tag.html"},3:{name:"entity.name.tag.html"}},contentName:"source.css.embedded.html",patterns:[{include:"orion.css"}]},{begin:"(?i)|",end:"(?i)<\/script>",captures:{0:{name:"entity.name.tag.html"}},contentName:"source.js.embedded.html",patterns:[{include:"orion.js"}]},{begin:"(?i)", -end:"(?i)<\/script>",captures:{0:{name:"entity.name.tag.html"}},contentName:"source.php.embedded.html",patterns:[{include:"orion.php"}]},{begin:"(?i)<\\?(?:=|php)?(?:\\s|$)",end:"\\?>",captures:{0:{name:"entity.name.declaration.php"}},contentName:"source.php.embedded.html",patterns:[{include:"orion.php"}]},{begin:"<%=?(?:\\s|$)",end:"%>",captures:{0:{name:"entity.name.declaration.php"}},contentName:"source.php.embedded.html",patterns:[{include:"orion.php"}]}],repository:{xmlDeclaration:{}}});return{id:k[k.length- -1].id,grammars:k,keywords:[]}}); -define("orion/editor/edit","require,orion/editor/shim,orion/editor/textView,orion/editor/textModel,orion/editor/textTheme,orion/editor/projectionTextModel,orion/editor/eventTarget,orion/keyBinding,orion/editor/rulers,orion/editor/annotations,orion/editor/tooltip,orion/editor/undoStack,orion/editor/textDND,orion/editor/editor,orion/editor/editorFeatures,orion/editor/contentAssist,orion/editor/cssContentAssist,orion/editor/htmlContentAssist,orion/editor/jsTemplateContentAssist,orion/editor/AsyncStyler,orion/editor/mirror,orion/editor/textMateStyler,orion/editor/htmlGrammar,orion/editor/textStyler,orion/editor/stylers/application_javascript/syntax,orion/editor/stylers/text_css/syntax,orion/editor/stylers/text_html/syntax".split(","),function(k, -m,n,i,c,d,f,g,h,b,a,e,l,o,q,r,p,t,v,s,u,j,w,x,D,y,K){function O(a){var b=a.firstChild;if(b&&b.tagName==="TEXTAREA")return b.value;var c=a.ownerDocument,d=c.defaultView||c.parentWindow,e;if(!(e=!d.getSelection)){if(!(b=a.childNodes.length===1&&b.nodeType===Node.TEXT_NODE)){for(var f,b=a;b&&b!==c&&f!=="none";)f=d.getComputedStyle?d.getComputedStyle(b,null).getPropertyValue("display"):b.currentStyle.display,b=b.parentNode;b=f==="none"}e=b}if(e)return a.innerText||a.textContent;c=c.createRange();c.selectNode(a); -a=d.getSelection();d=[];for(f=0;f1&&a.noFocus===void 0)a.noFocus=!0;for(var f=[],g=b.length- -1;g>=0;g--)a.parent=b[g],f.push(B(a));return f}if(!e)throw"no parent";a=Q(e,a);if(typeof a.theme==="string"){var b=c.TextTheme.getTheme(a.theme),g=a.theme.lastIndexOf("/"),h=a.theme;g!==-1&&(h=h.substring(g+1));h.substring(h.length-4)===".css"&&(h=h.substring(0,h.length-4));b.setThemeClass(h,{href:a.theme});a.theme=b}var j;a.readonly||(f={createContentAssistMode:function(a){j=new r.ContentAssist(a.getTextView());a=new r.ContentAssistWidget(j);a=new r.ContentAssistMode(j,a);j.setMode(a);return a}}); -var l=new o.Editor({textViewFactory:function(){return new n.TextView({parent:e,model:new d.ProjectionTextModel(a.model?a.model:new i.TextModel("")),tabSize:a.tabSize?a.tabSize:4,readonly:a.readonly,fullSelection:a.fullSelection,tabMode:a.tabMode,expandTab:a.expandTab,singleMode:a.singleMode,themeClass:a.themeClass,theme:a.theme,wrapMode:a.wrapMode,wrappable:a.wrappable})},undoStackFactory:new q.UndoFactory,annotationFactory:new q.AnnotationFactory,lineNumberRulerFactory:new q.LineNumberRulerFactory, -foldingRulerFactory:new q.FoldingRulerFactory,textDNDFactory:new q.TextDNDFactory,contentAssistFactory:f,keyBindingFactory:new q.KeyBindingsFactory,statusReporter:a.statusReporter,domNode:e});l.addEventListener("TextViewInstalled",function(){var b=l.getLineNumberRuler();b&&a.firstLineIndex!==void 0&&b.setFirstLine(a.firstLineIndex);if(b=l.getSourceCodeActions())b.setAutoPairParentheses(a.autoPairParentheses),b.setAutoPairBraces(a.autoPairBraces),b.setAutoPairSquareBrackets(a.autoPairSquareBrackets), -b.setAutoPairAngleBrackets(a.autoPairAngleBrackets),b.setAutoPairQuotations(a.autoPairQuotations),b.setAutoCompleteComments(a.autoCompleteComments),b.setSmartIndentation(a.smartIndentation)});f=a.contents;f===void 0&&(f=O(e));f||(f="");l.installTextView();l.setLineNumberRulerVisible(a.showLinesRuler===void 0||a.showLinesRuler);l.setAnnotationRulerVisible(a.showAnnotationRuler===void 0||a.showFoldingRuler);l.setOverviewRulerVisible(a.showOverviewRuler===void 0||a.showOverviewRuler);l.setFoldingRulerVisible(a.showFoldingRuler=== -void 0||a.showFoldingRuler);l.setInput(a.title,null,f,!1,a.noFocus);({styler:null,highlight:function(b,c){this.styler&&this.styler.destroy&&this.styler.destroy();this.styler=null;b==="js"?b="application/javascript":b==="css"?b="text/css":b==="html"?b="text/html":b==="java"&&(b="text/x-java-source");var d=c.getTextView(),e=c.getAnnotationModel();b&&(b=b.replace(/[*|:/".<>?+]/g,"_"),k(["./stylers/"+b+"/syntax"],function(a){this.styler=new x.TextStyler(d,e,a.grammars,a.id)}));b==="text/css"&&c.setFoldingRulerVisible(a.showFoldingRuler=== -void 0||a.showFoldingRuler)}}).highlight(a.contentType||a.lang,l);if(j){var m=new p.CssContentAssistProvider,s=new t.HTMLContentAssistProvider,u=new v.JSTemplateContentAssistProvider;j.addEventListener("Activating",function(){/css$/.test(a.lang)?j.setProviders([m]):/js$/.test(a.lang)?j.setProviders([u]):/html$/.test(a.lang)&&j.setProviders([s])})}if(e.clientHeight<=50)f=l.getTextView().computeSize().height,e.style.height=f+"px";return l}var E=this.orion?this.orion.editor:void 0;if(E)for(var G=0;G< -arguments.length;G++)M(E,arguments[G]);return B});var orion=this.orion||(this.orion={}),editor=orion.editor||(orion.editor={});editor.edit=require("orion/editor/edit"); \ No newline at end of file +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",next:"Next",previous:"Previous",replace:"Replace",replaceAll:"Replace All",findWith:"Find With",replaceWith:"Replace With",caseInsensitive:"Aa",regex:"/.*/",wholeWord:"\\b",caseInsensitiveTooltip:"Toggle Case Insensitive",regexTooltip:"Toggle Regex",wholeWordTooltip:"Toggle Whole Word",closeTooltip:"Close",replacingAll:"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(p,t){var r={root:t},k;for(k in p)p.hasOwnProperty(k)&&"undefined"===typeof r[k]&&(r[k]=p[k]);return r}); +define("orion/editor/eventTarget",[],function(){function p(){}p.addMixin=function(t){var r=p.prototype,k;for(k in r)r.hasOwnProperty(k)&&(t[k]=r[k])};p.prototype={addEventListener:function(p,r,k){this._eventTypes||(this._eventTypes={});var g=this._eventTypes[p];g||(g=this._eventTypes[p]={level:0,listeners:[]});g.listeners.push({listener:r,useCapture:k})},dispatchEvent:function(p){var r=p.type;this._dispatchEvent("pre"+r,p);this._dispatchEvent(r,p);this._dispatchEvent("post"+r,p)},_dispatchEvent:function(p, +r){var k=this._eventTypes?this._eventTypes[p]:null;if(k){var g=k.listeners;try{if(k.level++,g)for(var h=0,f=g.length;hk.length)q=[q+1,b].concat(k),Array.prototype.splice.apply(this._lineOffsets,q);else{x=q+1;this._lineOffsets.splice(x,b);for(e=0;eh.length?!1:h[g].match(k)?g===h.length-1?!0:g+1:!1;k instanceof Array||(k=[k]);if(k.length>h.length)return!1;var f;for(f=0;fa?(a=r(a),d=g+a*f,k(d)):(k(h),c.stop())},"number"===typeof this.options.rate?this.options.rate:20)};p.prototype.stop=function(){this.options.window.clearInterval(this.interval);(this.options.onEnd||function(){})()};p.prototype.defaultEasing=function(p){return Math.sin(p*(Math.PI/2))};return 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(p,t,r,k,g,h,f){function q(m,w,a){if(a){w.className="";a=w.attributes;for(var b=a.length;0f.isIE&&a[b].specified)&&w.removeAttribute(a[b].name)}if(m){m.styleClass&&(w.className=m.styleClass);if(a=m.style)for(var e in a)a.hasOwnProperty(e)&&(w.style[e]=a[e]);if(m=m.attributes)for(var c in m)m.hasOwnProperty(c)&& +w.setAttribute(c,m[c])}}function d(m){return m instanceof Array?m.slice(0):m}function c(m,a){if(!m)return a;if(!a)return m;for(var b in a)a.hasOwnProperty(b)&&(m.hasOwnProperty(b)||(m[b]=a[b]));return m}function a(m,w){if(m===w)return!0;if(m&&!w||!m&&w||m&&m.constructor===String||w&&w.constructor===String)return!1;if(m instanceof Array||w instanceof Array){if(!(m instanceof Array&&w instanceof Array)||m.length!==w.length)return!1;for(var b=0;bthis.end&&(m=this.start,this.start=this.end,this.end=m,this.caret=!this.caret)}, +setCaret:function(m){this.end=this.start=m;this.caret=!1},getCaret:function(){return this.caret?this.start:this.end},toString:function(){return"start\x3d"+this.start+" end\x3d"+this.end+(this.caret?" caret is at start":" caret is at end")},isEmpty:function(){return this.start===this.end},equals:function(m){return this.caret===m.caret&&this.start===m.start&&this.end===m.end}};u.prototype={toString:function(){return"{l\x3d"+this.left+", t\x3d"+this.top+", r\x3d"+this.right+", b\x3d"+this.bottom+"}"}}; +x.prototype={create:function(m,a){if(!this._lineDiv){var b=this._lineDiv=this._createLine(m,a,this.lineIndex);b._line=this;return b}},_createLine:function(m,w,b){var e=this.view,c=e._model,l=c.getLine(b),n=c.getLineStart(b),d={type:"LineStyle",textView:e,lineIndex:b,lineText:l,lineStart:n};e.onLineStyle(d);var s=m.ownerDocument,c=w||f.createElement(s,"div");if(!w||!a(w.viewStyle,d.style))q(d.style,c,w),w&&(w._trim=null),c.viewStyle=d.style,c.setAttribute("role","presentation");c.lineIndex=b;if(w&& +c.viewLineText===l&&a(d.ranges,c.viewRanges))return c;c.viewRanges=d.ranges;c.viewLineText=l;b=[];this._createRanges(d.ranges,l,0,l.length,n,{tabOffset:0,ranges:b});d=" ";!e._fullSelection&&9>f.isIE&&(d="\ufeff");e={text:d,style:e._metrics.largestFontStyle,ignoreChars:1};0===b.length||!b[b.length-1].style||"div"!==b[b.length-1].style.tagName?b.push(e):b.splice(b.length-1,0,e);var g,h,u,k=d=0;if(f.isFirefox&&2E3=v&&(s-=x);u=(u=h.firstChild.data)?u.length:0;if(k+u>s)break;k+=u}s=h.nextSibling;c.removeChild(h);h=s}g=this._createSpan(c,n,g,e.ignoreChars);h?c.insertBefore(g,h):c.appendChild(g);w&&(w.lineWidth=void 0)}if(w)for(x=g?g.nextSibling:null;x;)s=x.nextSibling,w.removeChild(x),x=s}c.parentNode||m.appendChild(c);return c},_createRanges:function(m,w,b,e,c,l){if(!(b>e)){if(m)for(var n=0;ne)break;var s=Math.min(c+e,f.end)- +c;if(d<=s){d=Math.max(b,d);s=Math.min(e,s);bb)){var l=this.view._customTabSize;if(l&&8!==l)for(var n=m.indexOf("\t",a);-1!==n&&nm){var n=m-s;if(1===w.length)d=new u(a.getBoundingClientRect());else if(e._isRangeRects)c=l.createRange(),c.setStart(w,n),c.setEnd(w,n+1),d=new u(c.getBoundingClientRect());else if(f.isIE)c=l.body.createTextRange(),c.moveToElementText(a),c.collapse(),(w=0===n&&8===f.isIE)&&(n=1),c.moveEnd("character",n+1),c.moveStart("character", +n),d=new u(c.getBoundingClientRect()),w&&(d.left=a.getClientRects()[0].left);else{var g=w.data;a.removeChild(w);a.appendChild(l.createTextNode(g.substring(0,n)));var h=f.createElement(l,"span");h.appendChild(l.createTextNode(g.substring(n,n+1)));a.appendChild(h);a.appendChild(l.createTextNode(g.substring(n+1)));d=new u(h.getBoundingClientRect());a.innerHTML="";a.appendChild(w);this._createdDiv||(a=e._getSelection(),(s<=a.start&&a.startl.right&&(l.right=e.right),e.bottom>l.bottom&&(l.bottom=e.bottom))}}return!0});return void 0!==m?a[m]:a},_getLineBoundingClientRect:function(m,a){var b=new u(m.getBoundingClientRect());if(!this.view._wrapMode){b.right= +b.left;for(var e=m.lastChild;e&&e.ignoreChars===e.firstChild.length;)e=e.previousSibling;e&&(e=e.getBoundingClientRect(),b.right=e.right+n(m).right)}a&&(e=n(m),b.left+=e.left,b.right-=e.right);return b},getLineCount:function(){return!this.view._wrapMode?1:this.getClientRects().length},getLineIndex:function(m){if(!this.view._wrapMode)return 0;var a=this.getClientRects();m=this.getBoundingClientRect(m);m=m.top+(m.bottom-m.top)/2;for(var b=0;bl||a+n>=d)return b=c,e=l-a,m.ignoreChars&&(0y+(z-y)/2);e=s-d;q=n.getLine(l);v=q.charCodeAt(e);55296<=v&& +56319>=v&&k?e=v&&(s+=1)):56320<=v&&(57343>=v&&!k)&&0=v&&(s-=1));k&&s++}else{v=[];for(t=0;ty+(z-y)/2&&s++;break}s++;v=v.nextSibling}u._createdDiv||(e.innerHTML="",e.appendChild(q), +e=c._getSelection(),(s<=e.start&&e.startk.right&&(m=k.right-1)}else 0>m&&(m=0),m>h.right-h.left&&(m=h.right-h.left);var v,p;if(this._lastHitChild&&this._lastHitChild.parentNode){if(v=this._lastHitOffset,p=this._lastHitChild,k=e(p),!k){q=v;for(var x=v+this._nodeLength(p),y=p.previousSibling,r=p.nextSibling;y||r;){if(y){q-=this._nodeLength(y);if(k=e(y)){p=y;v=q;break}y=y.previousSibling}if(r){if(k=e(r)){p=r;v=x;break}x+=this._nodeLength(r);r=r.nextSibling}}}}else v= +d,this.forEach(function(m){p=m;if(k=e(p))return!1;v+=this._nodeLength(p);return!0});p&&k&&(this._lastHitChild=p,this._lastHitOffset=v,v=b(p,v,k));return Math.min(s,Math.max(d,v))},getNextOffset:function(m,a){if("line"===a.unit){var b=this.view._model,e=b.getLineAtOffset(m);if(0=m||58<=m&&64>=m||91<=m&&94>=m||96===m||123<=m&&126>=m}function e(m){return 32===m||9===m}var c=this.view._model,n=c.getLineAtOffset(m),l=c.getLine(n),d=c.getLineStart(n),c=c.getLineEnd(n),n=l.length,f=m-d,s,g=0>a.count?-1:1;if("word"===a.unit||"wordend"===a.unit||"wordWS"===a.unit||"wordendWS"===a.unit)for(var h,u,q;0!==a.count;){if(0=s&&0=s&&(f+=g)),a.count-=g;return d+f},_getNextOffset_IE:function(m,a){var b=this._ensureCreated(),e=this.view._model,c=this.lineIndex,n=0,l;l=e.getLineStart(c);var d=e.getLine(c),f=e.getLineStart(c),s=b.ownerDocument,g=0>a.count?-1:1;if(m===e.getLineEnd(c)){for(b=b.lastChild;b&&b.ignoreChars===b.firstChild.length;)b=b.previousSibling; +if(!b)return l;n=s.body.createTextRange();n.moveToElementText(b);l=n.text.length;n.moveEnd(a.unit,g);n=m+n.text.length-l}else if(m===l&&0>a.count)n=l;else for(b=b.firstChild;b;){e=this._nodeLength(b);if(l+e>m){n=s.body.createTextRange();if(m===l&&0>a.count){for(l=b.previousSibling;l&&(!l.firstChild||!l.firstChild.length);)l=l.previousSibling;n.moveToElementText(l?l:b.previousSibling)}else n.moveToElementText(b),n.collapse(),n.moveEnd("character",m-l);l=n.text.length;n.moveEnd(a.unit,g);n=m+n.text.length- +l;break}l=e+l;b=b.nextSibling}l=n-f;n=d.charCodeAt(l);56320<=n&&57343>=n&&0=n&&(l+=g));a.count-=g;return l+f},updateLinks:function(){var m=this._ensureCreated();if(this.hasLink){var a=this;this.forEach(function(b){var e=b.viewStyle;e&&(e.tagName&&"a"===e.tagName.toLowerCase())&&m.replaceChild(a._createSpan(m,b.firstChild.data,e),b);return!0})}},destroy:function(){var m=this._createdDiv;m&&(m.parentNode.removeChild(m),this._createdDiv=null)}};v.prototype={addKeyMode:function(m, +a){var b=this._keyModes;void 0!==a?b.splice(a,0,m):b.push(m);m._modeAdded&&m._modeAdded()},addRuler:function(m,a){var b=this._rulers;if(void 0!==a){var e,c;for(c=e=0;ea;if(c){var n=m;m=a;a=n}n=this._model.getCharCount();m=Math.max(0,Math.min(m,n));a=Math.max(0,Math.min(a,n));m=new s(m,a,c);this._setSelection(m,void 0===b||b,!0,e)},setText:function(m,a,b){var e=void 0===a&&void 0===b;void 0===a&&(a= +0);void 0===b&&(b=this._model.getCharCount());e&&(this._variableLineHeight=!1);this._modifyContent({text:m,start:a,end:b,_code:!0},!e);e&&(this._columnX=-1,this._setSelection(new s(0,0,!1),!0),13>f.isFirefox&&this._fixCaret())},setTopIndex:function(m,a){this._clientDiv&&this._scrollViewAnimated(0,this._getLinePixel(Math.max(0,m))-this._getScroll().y,a)},setTopPixel:function(m,a){this._clientDiv&&this._scrollViewAnimated(0,Math.max(0,m)-this._getScroll().y,a)},showSelection:function(m,a){return this._showCaret(m? +!1:!0,a,m)},update:function(m,a){this._clientDiv&&((m||this._metrics.invalid)&&this._updateStyle(),void 0===a||a?this._update():this._queueUpdate())},_handleRootMouseDown:function(m){this._cancelCheckSelection();if(!this._ignoreEvent(m)){13>f.isFirefox&&1===m.which&&(this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0);var a=this._overlayDiv||this._clientDiv;9>f.isIE&&(a=this._viewDiv);for(var b=m.target?m.target:m.srcElement;b;){if(a===b||b.className&& +-1!==b.className.indexOf("textViewFind"))return;b=b.parentNode}m.preventDefault&&m.preventDefault();m.stopPropagation&&m.stopPropagation();if(!this._isW3CEvents){var e=this;this._getWindow().setTimeout(function(){e._clientDiv.focus()},0)}}},_handleRootMouseUp:function(m){this._ignoreEvent(m)||(13>f.isFirefox&&1===m.which&&(this._clientDiv.contentEditable=!0,(this._overlayDiv||this._clientDiv).draggable=!1),f.isFirefox&&1===m.which&&(this._fixCaret(),this._ignoreBlur=!1))},_handleBlur:function(){this._cancelCheckSelection(); +if(!this._ignoreBlur){this._commitIME();this._hasFocus=!1;if(9>f.isIE&&!this._getSelection().isEmpty()){var m=this._rootDiv,a=f.createElement(m.ownerDocument,"div");m.appendChild(a);m.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",m=this._getWindow(),a=this._selDiv1.ownerDocument,m.getSelection){a=m.getSelection();for(m=a.anchorNode;m;){if(m=== +this._clientDiv){0f.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",m)),this._dragOffset=-1;else return m.preventDefault&&m.preventDefault(),!1}},_handleDrag:function(m){if(!this._ignoreEvent(m)&& +this.isListening("Drag"))this.onDrag(this._createMouseEvent("Drag",m))},_handleDragEnd:function(m){if(!this._ignoreEvent(m)){this._dropTarget=!1;this._dragOffset=-1;if(this.isListening("DragEnd"))this.onDragEnd(this._createMouseEvent("DragEnd",m));13>f.isFirefox&&(this._fixCaret(),"none"===m.dataTransfer.dropEffect&&!m.dataTransfer.mozUserCancelled&&this._fixCaret())}},_handleDragEnter:function(m){if(!this._ignoreEvent(m)){var a=!0;this._dropTarget=!0;this.isListening("DragEnter")&&(a=!1,this.onDragEnter(this._createMouseEvent("DragEnter", +m)));if(f.isWebkit||a)return m.preventDefault&&m.preventDefault(),!1}},_handleDragOver:function(m){if(!this._ignoreEvent(m)){var a=!0;this.isListening("DragOver")&&(a=!1,this.onDragOver(this._createMouseEvent("DragOver",m)));if(f.isWebkit||a)return a&&(m.dataTransfer.dropEffect="none"),m.preventDefault&&m.preventDefault(),!1}},_handleDragLeave:function(m){if(!this._ignoreEvent(m)&&(this._dropTarget=!1,this.isListening("DragLeave")))this.onDragLeave(this._createMouseEvent("DragLeave",m))},_handleDrop:function(m){if(!this._ignoreEvent(m)){this._dropTarget= +!1;if(this.isListening("Drop"))this.onDrop(this._createMouseEvent("Drop",m));m.preventDefault&&m.preventDefault();return!1}},_handleFocus:function(){this._hasFocus=!0;f.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 m=this._highlightRGB;this._selDiv1.style.background=m;this._selDiv2.style.background=m;this._selDiv3.style.background= +m}if(!this._ignoreFocus)this.onFocus({type:"Focus"})},_handleKeyDown:function(m){this._cancelCheckSelection();if(!this._ignoreEvent(m)){if(this.isListening("KeyDown")){var a=this._createKeyEvent("KeyDown",m);this.onKeyDown(a);if(a.defaultPrevented){f.isFirefox&&(this._keyDownPrevented=!0);m.preventDefault();return}}a=!1;switch(m.keyCode){case 16:case 17:case 18:case 91:a=!0;break;default:this._setLinksVisible(!1)}if(229===m.keyCode){if(this._readonly)return m.preventDefault&&m.preventDefault(),!1; +a=!0;f.isSafari&&f.isMac&&m.ctrlKey&&(a=!1,m.keyCode=129);a&&this._startIME()}else a||this._commitIME();if((f.isMac||f.isLinux)&&4>f.isFirefox||12.16>f.isOpera)return this._keyDownEvent=m,!0;if(this._doAction(m))return m.preventDefault?(m.preventDefault(),m.stopPropagation()):(m.cancelBubble=!0,m.returnValue=!1,m.keyCode=0),!1}},_handleKeyPress:function(m){if(!this._ignoreEvent(m))if(this._keyDownPrevented)m.preventDefault&&(m.preventDefault(),m.stopPropagation()),this._keyDownPrevented=void 0;else{if(f.isMac&& +f.isWebkit&&(63232<=m.keyCode&&63487>=m.keyCode||13===m.keyCode||8===m.keyCode)||((f.isMac||f.isLinux)&&4>f.isFirefox||12.16>f.isOpera)&&this._doAction(this._keyDownEvent))return m.preventDefault&&m.preventDefault(),!1;var a=f.isMac?m.metaKey:m.ctrlKey;if(void 0!==m.charCode&&a)switch(m.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")&&(a=this._createKeyEvent("KeyPress",m),this.onKeyPress(a),a.defaultPrevented)){m.preventDefault();return}if(this._doAction(m))return m.preventDefault? +(m.preventDefault(),m.stopPropagation()):(m.cancelBubble=!0,m.returnValue=!1,m.keyCode=0),!1;a=!1;if(f.isMac){if(m.ctrlKey||m.metaKey)a=!0}else if(f.isFirefox){if(m.ctrlKey||m.altKey)a=!0}else m.ctrlKey^m.altKey&&(a=!0);if(!a&&(a=f.isOpera?m.which:void 0!==m.charCode?m.charCode:m.keyCode,31c?this._doAutoScroll("down",b,a-c):bl&&!this._wrapMode?this._doAutoScroll("right",b-l,a):(this._endAutoScroll(),this._setSelectionTo(b,a,!0))}}}},_isClientDiv:function(a){var b=this._overlayDiv||this._clientDiv;for(a=a.target?a.target:a.srcElement;a;){if(b===a)return!0;a=a.parentNode}return!1}, +_createKeyEvent:function(a,b){return{type:a,event:b,preventDefault:function(){this.defaultPrevented=!0}}},_createMouseEvent:function(a,b){var e=this.convert({x:b.clientX,y:b.clientY},"page","document");return{type:a,event:b,clickCount:this._clickCount,x:e.x,y:e.y,preventDefault:function(){this.defaultPrevented=!0}}},_createTouchEvent:function(a,b){var e=b.touches.length?this.convert({x:b.touches[0].clientX,y:b.touches[0].clientY},"page","document"):{};return{type:a,event:b,touchCount:b.touches.length, +x:e.x,y:e.y,preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(a){var b=a.which?0===a.button:1===a.button;if(this.isListening("MouseUp")&&(this._isClientDiv(a)||b&&this._isMouseDown)){var e=this._createMouseEvent("MouseUp",a);this.onMouseUp(e);if(e.defaultPrevented){a.preventDefault();this._isMouseDown=!1;return}}this._linksVisible||(b&&this._isMouseDown&&(-1!==this._dragOffset&&(e=this._getSelection(),e.extend(this._dragOffset),e.collapse(),this._setSelection(e,!0,!0), +this._dragOffset=-1),this._isMouseDown=!1,this._endAutoScroll(),this._isW3CEvents&&this._setGrab(null)),b&&f.isFirefox&&(this._updateDOMSelection(),a.preventDefault()))},_handleMouseWheel:function(a){if(!this._noScroll){var b=this._getLineHeight(),e=0,c=0;f.isIE||f.isOpera?c=-a.wheelDelta/40*b:f.isFirefox?"wheel"===a.type?a.deltaMode?(e=Math.max(-256,Math.min(256,a.deltaX))*b,c=Math.max(-256,Math.min(256,a.deltaY))*b):(e=a.deltaX,c=a.deltaY):(b=f.isMac?3*a.detail:Math.max(-256,Math.min(256,a.detail))* +b,a.axis===a.HORIZONTAL_AXIS?e=b:c=b):f.isMac?(c=a.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=a.timeStamp,e=0!==a.wheelDeltaX%120?1:40>c?40/(40-c):40,c=0!==a.wheelDeltaY%120?1:40>c?40/(40-c):40,e=Math.ceil(-a.wheelDeltaX/e),-1e&&(e=-1),0e&&(e=1),c=Math.ceil(-a.wheelDeltaY/c),-1c&&(c=-1),0c&&(c=1)):(e=-a.wheelDeltaX,c=8*(-a.wheelDeltaY/120)*b);if(f.isSafari||f.isChrome&&f.isMac){for(b=a.target;b&&void 0===b.lineIndex;)b=b.parentNode;this._mouseWheelLine=b}b=this._getScroll(); +this._scrollView(e,c);e=this._getScroll();if(b.x!==e.x||b.y!==e.y)return a.preventDefault&&a.preventDefault(),!1}},_handlePaste:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)&&!this._ignorePaste&&this._doPaste(a)){if(f.isIE){var b=this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){b._updateDOMSelection();b._ignoreFocus=!1},0)}a.preventDefault&&a.preventDefault();return!1}},_handleResize:function(){var m=this._rootDiv.clientWidth,b=this._rootDiv.clientHeight;if(this._rootWidth!== +m||this._rootHeight!==b)this._rootWidth!==m&&this._wrapMode&&this._resetLineHeight(),this._rootWidth=m,this._rootHeight=b,m=9>f.isIE,b=this._calculateMetrics(),a(b,this._metrics)||(this._variableLineHeight&&(this._variableLineHeight=!1,this._resetLineHeight()),this._metrics=b,m=!0),m?this._queueUpdate():this._update(),this.dispatchEvent({type:"Resize"})},_handleRulerEvent:function(a){for(var b=a.target?a.target:a.srcElement,e=b.lineIndex;b&&!b._ruler;)void 0===e&&void 0!==b.lineIndex&&(e=b.lineIndex), +b=b.parentNode;var c=b?b._ruler:null;if(void 0===e&&c&&"document"===c.getOverview()){var e=this._getClientHeight(),n=this._model.getLineCount(),l=this._getViewPadding(),d=this._viewDiv.getBoundingClientRect(),e=Math.floor((a.clientY-d.top-this._metrics.scrollWidth)*n/(e+l.top+l.bottom-2*this._metrics.scrollWidth));0<=e&&e=s+a.data.length;)b--;b++;l=d.substring(e,b+n);this._ignoreQueueUpdate=f.isSafari;this._modifyContent({text:l, +start:e+c,end:b+c,_ignoreDOMSelection:!0,_ignoreDOMSelection1:f.isChrome},!0);this._ignoreQueueUpdate=!1}}else this._doContent(a.data);a.preventDefault()}},_handleTouchStart:function(a){if(this.isListening("TouchStart")){var b=this._createTouchEvent("TouchStart",a);this.onTouchStart(b);if(b.defaultPrevented){a.preventDefault();return}if(this._noScroll)return}this._commitIME();b=this._getWindow();this._touchScrollTimer&&(this._vScrollDiv.style.display="none",this._hScrollDiv.style.display="none",b.clearInterval(this._touchScrollTimer), +this._touchScrollTimer=null);var e=a.touches;if(1===e.length){var e=e[0],c=e.clientX,n=e.clientY;this._touchStartX=c;this._touchStartY=n;if(f.isAndroid&&(na.timeStamp-this._touchStartTime){this._vScrollDiv.style.display="block";this._wrapMode||(this._hScrollDiv.style.display="block");var e=this,c=this._getWindow();this._touchScrollTimer=c.setInterval(function(){var a=0,b=0;if(e._touching)a=e._touchStartX-e._touchCurrentX,b=e._touchStartY- +e._touchCurrentY,e._touchSpeedX=a/10,e._touchSpeedY=b/10,e._touchStartX=e._touchCurrentX,e._touchStartY=e._touchCurrentY;else{if(0.1>Math.abs(e._touchSpeedX)&&0.1>Math.abs(e._touchSpeedY)){e._vScrollDiv.style.display="none";e._hScrollDiv.style.display="none";c.clearInterval(e._touchScrollTimer);e._touchScrollTimer=null;return}a=10*e._touchSpeedX;b=10*e._touchSpeedY;e._touchSpeedX*=0.95;e._touchSpeedY*=0.95}e._scrollView(a,b)},10)}this._touchScrollTimer&&a.preventDefault()}},_handleTouchEnd:function(a){if(this.isListening("TouchEnd")){var b= +this._createTouchEvent("TouchEnd",a);this.onTouchEnd(b);if(b.defaultPrevented){a.preventDefault();return}if(this._noScroll)return}0===a.touches.length&&(this._touching=!1)},_doAction:function(a){var b,e,c=this._keyModes;for(e=c.length-1;0<=e;e--)if(b=c[e],"function"===typeof b.match&&(b=b.match(a),void 0!==b))return this.invokeAction(b);return!1},_doMove:function(a,b){var e=this._model,c=b.getCaret(),n=e.getLineAtOffset(c);a.count||(a.count=1);for(;0!==a.count;){var l=e.getLineStart(n);if(0>a.count&& +c===l)if(0a.count?1:-1):(l=this._getLine(n),b.extend(l.getNextOffset(c,a)),l.destroy())}c=b.getCaret()}return b},_doBackspace:function(a){var b= +this._getSelection();b.isEmpty()&&(a.count||(a.count=1),a.count*=-1,a.expandTab=this._expandTab,this._doMove(a,b));this._modifyContent({text:"",start:b.start,end:b.end},!0);return!0},_doCase:function(a){var b=this._getSelection();this._doMove(a,b);var e=this.getText(b.start,b.end);this._setSelection(b,!0);switch(a.type){case "lower":e=e.toLowerCase();break;case "capitalize":e=e.replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()});break;case "reverse":a="";for(b=0;ba&&(n=a-e);this._setSelection(c,!0,!0,function(){b._columnX=g},n-s.y)}return!0},_doPageUp:function(a){var b=this,e=this._model,c=this._getSelection(), +n=c.getCaret(),l=e.getLineAtOffset(n),d=this._getScroll(),s=this._getClientHeight(),g;if(this._lineHeight){g=this._columnX;d=this._getBoundsAtOffset(n);if(-1===g||a.select&&f.isIE)g=d.left;n=this._getLineIndex(d.bottom-s);e=this._getLine(n);l=this._getLinePixel(n);n=e.getOffset(g,d.bottom-s-l);s=e.getBoundingClientRect(n);e.destroy();c.extend(n);a.select||c.collapse();this._setSelection(c,!0,!0,function(){b._columnX=g},s.top+l-d.top);return!0}if(0c?Math.floor(c):Math.ceil(c),d=Math.max(0,Math.min(n-1,l+c));else if("left"===this._autoScrollDir||"right"===this._autoScrollDir)d=this._getLineIndex(e.y),l=this._getLine(l),e.x+=l.getBoundingClientRect(c,!1).left,l.destroy();0===d&&(f.isMac||f.isLinux)?b.extend(0):d===n-1&&(f.isMac||f.isLinux)?b.extend(a.getCharCount()):(l=this._getLine(d),b.extend(l.getOffset(e.x, +e.y-this._getLinePixel(d))),l.destroy());this._setSelection(b,!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 b=this._model.getLineCount(),e=0;if(a){a=0;for(var c=(new Date).getTime(),n=0;e=h.bottom-h.top,h=Math.max(1,h.bottom-h.top);s>d&&(k=1);g>s&&(k=2);u>g&&(k=3);var x;0!==k&&(x={style:{}},0!==(k& +1)&&(x.style.fontStyle="italic"),0!==(k&2)&&(x.style.fontWeight="bold"));d=n(e);a.removeChild(e);k=l(this._viewDiv);e=f.createElement(b,"div");e.style.position="fixed";e.style.left="-1000px";e.style.paddingLeft=k.left+"px";e.style.paddingTop=k.top+"px";e.style.paddingRight=k.right+"px";e.style.paddingBottom=k.bottom+"px";e.style.width="100px";e.style.height="100px";k=f.createElement(b,"div");k.style.width="100%";k.style.height="100%";e.appendChild(k);a.appendChild(e);s=e.getBoundingClientRect();g= +k.getBoundingClientRect();u=0;!this._singleMode&&!this._noScroll&&(e.style.overflow="hidden",k.style.height="200px",u=e.clientWidth,e.style.overflow="scroll",u-=e.clientWidth);a.removeChild(e);var k={left:g.left-s.left,top:g.top-s.top,right:s.right-g.right,bottom:s.bottom-g.bottom},v=0,p=g=0;if(!c){e=f.createElement(b,"div");e.style.position="fixed";e.style.left="-1000px";a.appendChild(e);e.innerHTML=Array(2).join("a");s=e.getBoundingClientRect();p=Math.ceil(s.right-s.left);if(this._wrapOffset||this._marginOffset)e.innerHTML= +Array(this._wrapOffset+1+(f.isWebkit?0:1)).join(" "),s=e.getBoundingClientRect(),v=Math.ceil(s.right-s.left),e.innerHTML=Array(this._marginOffset+1).join(" "),g=e.getBoundingClientRect(),g=Math.ceil(g.right-g.left);a.removeChild(e)}return{lineHeight:h,largestFontStyle:x,lineTrim:d,viewPadding:k,scrollWidth:u,wrapWidth:v,marginWidth:g,charWidth:p,invalid:c}},_cancelAnimation:function(){this._animation&&(this._animation.stop(),this._animation=null)},_clearSelection:function(a){var b=this._getSelection(); +if(b.isEmpty())return!1;"next"===a?b.start=b.end:b.end=b.start;this._setSelection(b,!0);return!0},_commitIME:function(a){if(-1!==this._imeOffset){var b=this._model,e=b.getLineAtOffset(this._imeOffset),c=b.getLineStart(e),n=this._getLineNode(e);if(!a){this._scrollDiv.focus();this._clientDiv.focus();var l=this._getDOMText(n).text,b=b.getLine(e),c=this._imeOffset-c,b=c+l.length-b.length;c!==b&&(a=l.substring(c,b))}a&&(!this._doContent(a)&&!f.isWebkit)&&(n.lineRemoved=!0,this._queueUpdate());this._imeOffset= +-1}},_createActions:function(){this.addKeyMode(new r.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:p.lineUp}},lineDown:{defaultHandler:function(b){return a._doLineDown(c(b,{select:!1}))},actionDescription:{name:p.lineDown}},lineStart:{defaultHandler:function(b){return a._doHome(c(b,{select:!1,ctrl:!1}))},actionDescription:{name:p.lineStart}},lineEnd:{defaultHandler:function(b){return a._doEnd(c(b, +{select:!1,ctrl:!1}))},actionDescription:{name:p.lineEnd}},charPrevious:{defaultHandler:function(b){return a._doCursorPrevious(c(b,{select:!1,unit:"character"}))},actionDescription:{name:p.charPrevious}},charNext:{defaultHandler:function(b){return a._doCursorNext(c(b,{select:!1,unit:"character"}))},actionDescription:{name:p.charNext}},pageUp:{defaultHandler:function(b){return a._doPageUp(c(b,{select:!1}))},actionDescription:{name:p.pageUp}},pageDown:{defaultHandler:function(b){return a._doPageDown(c(b, +{select:!1}))},actionDescription:{name:p.pageDown}},scrollPageUp:{defaultHandler:function(b){return a._doScroll(c(b,{type:"pageUp"}))},actionDescription:{name:p.scrollPageUp}},scrollPageDown:{defaultHandler:function(b){return a._doScroll(c(b,{type:"pageDown"}))},actionDescription:{name:p.scrollPageDown}},scrollLineUp:{defaultHandler:function(b){return a._doScroll(c(b,{type:"lineUp"}))},actionDescription:{name:p.scrollLineUp}},scrollLineDown:{defaultHandler:function(b){return a._doScroll(c(b,{type:"lineDown"}))}, +actionDescription:{name:p.scrollLineDown}},wordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(c(b,{select:!1,unit:"word"}))},actionDescription:{name:p.wordPrevious}},wordNext:{defaultHandler:function(b){return a._doCursorNext(c(b,{select:!1,unit:"word"}))},actionDescription:{name:p.wordNext}},textStart:{defaultHandler:function(b){return a._doHome(c(b,{select:!1,ctrl:!0}))},actionDescription:{name:p.textStart}},textEnd:{defaultHandler:function(b){return a._doEnd(c(b,{select:!1,ctrl:!0}))}, +actionDescription:{name:p.textEnd}},scrollTextStart:{defaultHandler:function(b){return a._doScroll(c(b,{type:"textStart"}))},actionDescription:{name:p.scrollTextStart}},scrollTextEnd:{defaultHandler:function(b){return a._doScroll(c(b,{type:"textEnd"}))},actionDescription:{name:p.scrollTextEnd}},centerLine:{defaultHandler:function(b){return a._doScroll(c(b,{type:"centerLine"}))},actionDescription:{name:p.centerLine}},selectLineUp:{defaultHandler:function(b){return a._doLineUp(c(b,{select:!0}))},actionDescription:{name:p.selectLineUp}}, +selectLineDown:{defaultHandler:function(b){return a._doLineDown(c(b,{select:!0}))},actionDescription:{name:p.selectLineDown}},selectWholeLineUp:{defaultHandler:function(b){return a._doLineUp(c(b,{select:!0,wholeLine:!0}))},actionDescription:{name:p.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(b){return a._doLineDown(c(b,{select:!0,wholeLine:!0}))},actionDescription:{name:p.selectWholeLineDown}},selectLineStart:{defaultHandler:function(b){return a._doHome(c(b,{select:!0,ctrl:!1}))}, +actionDescription:{name:p.selectLineStart}},selectLineEnd:{defaultHandler:function(b){return a._doEnd(c(b,{select:!0,ctrl:!1}))},actionDescription:{name:p.selectLineEnd}},selectCharPrevious:{defaultHandler:function(b){return a._doCursorPrevious(c(b,{select:!0,unit:"character"}))},actionDescription:{name:p.selectCharPrevious}},selectCharNext:{defaultHandler:function(b){return a._doCursorNext(c(b,{select:!0,unit:"character"}))},actionDescription:{name:p.selectCharNext}},selectPageUp:{defaultHandler:function(b){return a._doPageUp(c(b, +{select:!0}))},actionDescription:{name:p.selectPageUp}},selectPageDown:{defaultHandler:function(b){return a._doPageDown(c(b,{select:!0}))},actionDescription:{name:p.selectPageDown}},selectWordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(c(b,{select:!0,unit:"word"}))},actionDescription:{name:p.selectWordPrevious}},selectWordNext:{defaultHandler:function(b){return a._doCursorNext(c(b,{select:!0,unit:"word"}))},actionDescription:{name:p.selectWordNext}},selectTextStart:{defaultHandler:function(b){return a._doHome(c(b, +{select:!0,ctrl:!0}))},actionDescription:{name:p.selectTextStart}},selectTextEnd:{defaultHandler:function(b){return a._doEnd(c(b,{select:!0,ctrl:!0}))},actionDescription:{name:p.selectTextEnd}},deletePrevious:{defaultHandler:function(b){return a._doBackspace(c(b,{unit:"character"}))},actionDescription:{name:p.deletePrevious}},deleteNext:{defaultHandler:function(b){return a._doDelete(c(b,{unit:"character"}))},actionDescription:{name:p.deleteNext}},deleteWordPrevious:{defaultHandler:function(b){return a._doBackspace(c(b, +{unit:"word"}))},actionDescription:{name:p.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(b){return a._doDelete(c(b,{unit:"word"}))},actionDescription:{name:p.deleteWordNext}},deleteLineStart:{defaultHandler:function(b){return a._doBackspace(c(b,{unit:"line"}))},actionDescription:{name:p.deleteLineStart}},deleteLineEnd:{defaultHandler:function(b){return a._doDelete(c(b,{unit:"line"}))},actionDescription:{name:p.deleteLineEnd}},tab:{defaultHandler:function(b){return a._doTab(c(b,{}))}, +actionDescription:{name:p.tab}},shiftTab:{defaultHandler:function(b){return a._doShiftTab(c(b,{}))},actionDescription:{name:p.shiftTab}},enter:{defaultHandler:function(b){return a._doEnter(c(b,{}))},actionDescription:{name:p.enter}},enterNoCursor:{defaultHandler:function(b){return a._doEnter(c(b,{noCursor:!0}))},actionDescription:{name:p.enterNoCursor}},selectAll:{defaultHandler:function(b){return a._doSelectAll(c(b,{}))},actionDescription:{name:p.selectAll}},copy:{defaultHandler:function(b){return a._doCopy(c(b, +{}))},actionDescription:{name:p.copy}},cut:{defaultHandler:function(b){return a._doCut(c(b,{}))},actionDescription:{name:p.cut}},paste:{defaultHandler:function(b){return a._doPaste(c(b,{}))},actionDescription:{name:p.paste}},uppercase:{defaultHandler:function(b){return a._doCase(c(b,{type:"upper"}))},actionDescription:{name:p.uppercase}},lowercase:{defaultHandler:function(b){return a._doCase(c(b,{type:"lower"}))},actionDescription:{name:p.lowercase}},capitalize:{defaultHandler:function(b){return a._doCase(c(b, +{unit:"word",type:"capitalize"}))},actionDescription:{name:p.capitalize}},reversecase:{defaultHandler:function(b){return a._doCase(c(b,{type:"reverse"}))},actionDescription:{name:p.reversecase}},toggleOverwriteMode:{defaultHandler:function(b){return a._doOverwriteMode(c(b,{}))},actionDescription:{name:p.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(b){return a._doTabMode(c(b,{}))},actionDescription:{name:p.toggleTabMode}},toggleWrapMode:{defaultHandler:function(b){return a._doWrapMode(c(b, +{}))},actionDescription:{name:p.toggleWrapMode}}}},_createRulerParent:function(a,b){var e=f.createElement(a,"div");e.className=b;e.tabIndex=-1;e.style.overflow="hidden";e.style.MozUserSelect="none";e.style.WebkitUserSelect="none";e.style.position="absolute";e.style.top="0px";e.style.bottom="0px";e.style.cursor="default";e.style.display="none";e.setAttribute("aria-hidden","true");this._rootDiv.appendChild(e);return e},_createRuler:function(a,b){if(this._clientDiv){var e=this._getRulerParent(a);if(e){if(e!== +this._marginDiv||this._marginOffset)e.style.display="block";e.rulerWidth=void 0;var c=f.createElement(e.ownerDocument,"div");c._ruler=a;a.node=c;c.rulerChanged=!0;c.style.position="relative";c.style.cssFloat="left";c.style.styleFloat="left";c.style.outline="none";if(void 0===b||0>b||b>=e.children.length)e.appendChild(c);else{for(var n=e.firstChild;n&&0this._getLineHeight()){a=b.getBoundingClientRect();var e=this._clientDiv.getBoundingClientRect(); +a.bottom>e.bottom&&(b=this._getLinePrevious(b)||b)}return b.lineIndex},_getBoundsAtOffset:function(a){var b=this._getLine(this._model.getLineAtOffset(a));a=b.getBoundingClientRect(a);var e=this._getLinePixel(b.lineIndex);a.top+=e;a.bottom+=e;b.destroy();return a},_getClientHeight:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-a.top-a.bottom)},_getInnerRightWidth:function(){var a=this._innerRightDiv.rulerWidth;void 0===a&&(a=this._innerRightDiv.getBoundingClientRect(), +this._innerRightDiv.rulerWidth=a=a.right-a.left);return a},_getClientWidth:function(){var a=this._getViewPadding(),b=this._getInnerRightWidth();return Math.max(0,this._viewDiv.clientWidth-a.left-a.right-b)},_getClipboardText:function(a,e){var c=this._singleMode?"":this._model.getLineDelimiter(),n,l,d=this._getWindow(),s=d.clipboardData;!s&&a&&(s=a.clipboardData);if(s)return n=[],l=s.getData(f.isIE?"Text":"text/plain"),b(l,function(a){n.push(a)},function(){n.push(c)}),l=n.join(""),e&&e(l),l;if(f.isFirefox){this._ignoreFocus= +!0;var g=this._clipboardDiv,s=this._rootDiv.ownerDocument;g||(this._clipboardDiv=g=f.createElement(s,"div"),g.style.position="fixed",g.style.whiteSpace="pre",g.style.left="-1000px",this._rootDiv.appendChild(g));g.innerHTML="\x3cpre contenteditable\x3d''\x3e\x3c/pre\x3e";g.firstChild.focus();var h=this,u=function(){var a=h._getTextFromElement(g);g.innerHTML="";n=[];b(a,function(a){n.push(a)},function(){n.push(c)});return n.join("")},q=!1;this._ignorePaste=!0;if(!f.isLinux||2!==this._lastMouseButton)try{q= +s.execCommand("paste",!1,null)}catch(k){q=1b)for(;b=a;b--)e-=this._getLineHeight(b);return e}return this._getLineHeight()*a},_getLineIndex:function(a){var b,e=0,c=this._model.getLineCount();if(this._lineHeight){var e=this._getTopIndex(),n=-this._topIndexY+this._getScroll().y; +if(a!==n)if(a=n&&ethis._getLineHeight()){a=b.getBoundingClientRect();var e=this._getViewPadding(),c=this._viewDiv.getBoundingClientRect();a.top(new Date).getTime()-this._lastScrollTime))return{};var a=this._viewDiv.getBoundingClientRect(), +b=this._lastMouseMoveX,e=this._lastMouseMoveY;return{vertical:a.top<=e&&eb&&(d.end>b&&d.startb+l&&(e.lineIndex=c+n-l,e._line.lineIndex=e.lineIndex),e=this._getLineNext(e);this._lineHeight&&(a=[b,l].concat(Array(n)),Array.prototype.splice.apply(this._lineHeight,a));!this._wrapMode&&(b<=this._maxLineIndex&&this._maxLineIndex<= +b+l)&&(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,b){if(this._wrapMode||this._variableLineHeight){if(void 0!==a&&void 0!==b)for(var e=a;e< +b;e++)this._lineHeight[e]=void 0;else e=this._model.getLineCount(),this._lineHeight=Array(e);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 s(0,0,!1),!1,!1);this._viewDiv&& +(this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=0);var a=this._clientDiv;if(a){for(a=a.firstChild;a;)a.lineRemoved=!0,a=a.nextSibling;13>f.isFirefox&&this._fixCaret()}},_scrollViewAnimated:function(a,b,e){var c=this._getWindow();if(e&&this._scrollAnimation){var n=this;this._animation=new C({window:c,duration:this._scrollAnimation,curve:[b,0],onAnimate:function(a){a=b-Math.floor(a);n._scrollView(0,a);b-=a},onEnd:function(){n._animation=null;n._scrollView(a,b);e&&c.setTimeout(e,0)}});this._animation.play()}else this._scrollView(a, +b),e&&c.setTimeout(e,0)},_scrollView:function(a,b){this._ensureCaretVisible=!1;var e=this._viewDiv;a&&(e.scrollLeft+=a);b&&(e.scrollTop+=b)},_setClipboardText:function(a,e){var c,n=this._getWindow(),l=n.clipboardData;!l&&e&&(l=e.clipboardData);if(l&&(c=[],b(a,function(a){c.push(a)},function(){c.push(f.platformDelimiter)}),l.setData(f.isIE?"Text":"text/plain",c.join(""))||21=this._doubleClickSelection.start?(e=this._doubleClickSelection.start,c=n.getNextOffset(a,{unit:"wordend",count:1})):(e=n.getNextOffset(a,{unit:"word",count:-1}),c=this._doubleClickSelection.end):(e=n.getNextOffset(a,{unit:"word",count:-1}),c=n.getNextOffset(e,{unit:"wordend",count:1})),n.destroy()): +this._doubleClickSelection?(c=n.getLineAtOffset(this._doubleClickSelection.start),a>=c?(e=n.getLineStart(c),c=n.getLineEnd(a)):(e=n.getLineStart(a),c=n.getLineEnd(c))):(e=n.getLineStart(a),c=n.getLineEnd(a)),l.setCaret(e),l.extend(c);this._setSelection(l,!0,!0);return!0},_setFullSelection:function(a,b){this._fullSelection=a;f.isWebkit&&(this._fullSelection=!0);var e=this._clipDiv||this._rootDiv;if(e)if(this._fullSelection){if(!this._selDiv1&&this._fullSelection&&!f.isIOS){var c=e.ownerDocument;this._highlightRGB= +f.isWebkit?"transparent":"Highlight";var n=f.createElement(c,"div");this._selDiv1=n;n.style.position="absolute";n.style.borderWidth="0px";n.style.margin="0px";n.style.padding="0px";n.style.outline="none";n.style.background=this._highlightRGB;n.style.width="0px";n.style.height="0px";n.style.zIndex="0";e.appendChild(n);var l=f.createElement(c,"div");this._selDiv2=l;l.style.position="absolute";l.style.borderWidth="0px";l.style.margin="0px";l.style.padding="0px";l.style.outline="none";l.style.background= +this._highlightRGB;l.style.width="0px";l.style.height="0px";l.style.zIndex="0";e.appendChild(l);this._selDiv3=c=f.createElement(c,"div");c.style.position="absolute";c.style.borderWidth="0px";c.style.margin="0px";c.style.padding="0px";c.style.outline="none";c.style.background=this._highlightRGB;c.style.width="0px";c.style.height="0px";c.style.zIndex="0";e.appendChild(c);if(f.isFirefox&&f.isMac){e=this._getWindow().getComputedStyle(c,null).getPropertyValue("background-color");switch(e){case "rgb(119, 141, 168)":e= +"rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":e="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":e="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":e="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":e="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":e="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":e="rgb(232, 184, 255)";break;default:e="rgb(180, 213, 255)"}this._highlightRGB=e;n.style.background=e;l.style.background=e;c.style.background=e}b||this._updateDOMSelection()}}else this._selDiv1&& +(e.removeChild(this._selDiv1),this._selDiv1=null),this._selDiv2&&(e.removeChild(this._selDiv2),this._selDiv2=null),this._selDiv3&&(e.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=this._viewDiv,b=f.createElement(a.ownerDocument, +"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="\x26nbsp;";a.appendChild(b);this._updateDOMSelection()}}else this._cursorDiv&&(this._cursorDiv.parentNode.removeChild(this._cursorDiv),this._cursorDiv=null)},_setMarginOffset:function(a,b){this._marginOffset=a;this._marginDiv.style.display=a?"block":"none";b||(this._metrics=this._calculateMetrics(),this._queueUpdate())}, +_setWrapOffset:function(a,b){this._wrapOffset=a;b||(this._metrics=this._calculateMetrics(),this._queueUpdate())},_setReadOnly:function(a){this._readonly=a;this._clientDiv.setAttribute("aria-readonly",a?"true":"false")},_setSingleMode:function(a,b){this._singleMode=a;this._updateOverflow();this._updateStyle(b)},_setNoScroll:function(a,b){this._noScroll=a;this._updateOverflow();this._updateStyle(b)},_setTabSize:function(a,b){this._tabSize=a;this._customTabSize=void 0;var e=this._clientDiv;f.isOpera? +e&&(e.style.OTabSize=this._tabSize+""):537.1<=f.isWebkit?e&&(e.style.tabSize=this._tabSize+""):4<=f.isFirefox?e&&(e.style.MozTabSize=this._tabSize+""):8!==this._tabSize&&(this._customTabSize=this._tabSize);b||(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, +b){this._themeClass=a;var e="textview",c=this._theme.getThemeClass();c&&(e+=" "+c);this._themeClass&&c!==this._themeClass&&(e+=" "+this._themeClass);this._rootDiv.className=e;this._updateStyle(b)},_setWrapMode:function(a,b){this._wrapMode=a&&this._wrappable;var e=this._clientDiv;this._wrapMode?(e.style.whiteSpace="pre-wrap",e.style.wordWrap="break-word"):(e.style.whiteSpace="pre",e.style.wordWrap="normal");this._updateOverflow();b||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a, +b,e,c){if(this._clientDiv&&!(0z?v.bottom: +z)-(v.topd.x+n&&(a=Math.max(y-d.x-n,x));l=0;rd.y+k&&(l=z-d.y-k);c&&(0l&&(l=Math.min(l,c)));c=C&&"always"===e.scrollPolicy;if(0!==a||0!==l||c)return C?(c=0e&&(e=0),1l.lineIndex?(e=l,d=b.getLineStart(l.lineIndex)):(e=this._getLineNode(e), +d=a.start);cl.lineIndex?(c=l,b=b.getLineStart(l.lineIndex)):(c=this._getLineNode(c),b=a.end);this._setDOMSelection(e,d,c,b,a.caret)}}},_update:function(a){if(!(0n.y)break;r+=t;z++}k=z;v=Math.max(0,k-1);p=c=n.y-r;0E?(new x(this,E)).create(I,null):(I.firstChild&&(b.insertBefore(I,t),I=F.createDocumentFragment()),t&&t.lineChanged&&(t=(new x(this,E)).create(I,t),t.lineChanged=!1),t=this._getLineNext(t));I.firstChild&&b.insertBefore(I,t);f.isWebkit&&!this._wrapMode&&(b.style.width="0x7fffffffpx");t=this._getLineNext(); +E=y+c;for(I=!1;t;)v=t.lineWidth,void 0===v&&(F=t._line.getBoundingClientRect(),v=t.lineWidth=Math.ceil(F.right-F.left),F=F.bottom-F.top,this._lineHeight?this._lineHeight[t.lineIndex]=F:0!==s&&(0!==F&&Math.ceil(s)!==Math.ceil(F))&&(this._variableLineHeight=!0,this._lineHeight=[],this._lineHeight[t.lineIndex]=F)),this._lineHeight&&!I&&(E-=this._lineHeight[t.lineIndex],0>E&&(p=t.lineIndex,I=!0)),this._wrapMode||(v>=this._maxLineWidth&&(this._maxLineWidth=v,this._maxLineIndex=t.lineIndex),this._checkMaxLineIndex=== +t.lineIndex&&(this._checkMaxLineIndex=-1)),t.lineIndex===k&&(this._topChild=t),t.lineIndex===p&&(this._bottomChild=t),t=this._getLineNext(t);-1!==this._checkMaxLineIndex&&(E=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,0<=E&&E=this._maxLineWidth&&(this._maxLineWidth=v,this._maxLineIndex=E),s.destroy()));for(;zy&&(u=!0,k=v),this._maxLineWidth>k&&(h=!0,y=z,d>y&&(u=!0,k=v)),p!==h&&(e.style.overflowX=h?"scroll":"hidden"),E!==u&&(e.style.overflowY=u?"scroll":"hidden"),g=p!==h||E!==u);u=k;this._wrapMode?this._metrics.wrapWidth&&(u=this._metrics.wrapWidth):u=Math.max(this._maxLineWidth+this._getInnerRightWidth(),u);h=u;if((!f.isIE||9<=f.isIE)&&this._maxLineWidth>k)u+=l.right+l.left;n.style.width=u+"px";this._clipScrollDiv&&(this._clipScrollDiv.style.width=u+"px");n=this._getScroll(!1);if(u= +this._innerRightDiv)u.style.right=r+("scroll"===e.style.overflowY?this._metrics.scrollWidth:0)+"px",u.style.bottom=("scroll"===e.style.overflowX?q:0)+"px"}this._scrollHeight=d;this._vScrollDiv&&(u=y-8,r=Math.max(15,Math.ceil(Math.min(1,u/(d+l.top+l.bottom))*u)),this._vScrollDiv.style.left=s+k-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,n.y*u/d))+"px",this._vScrollDiv.style.height=r+"px");!this._wrapMode&&this._hScrollDiv&&(u=k-8,r=Math.max(15,Math.ceil(Math.min(1,u/(this._maxLineWidth+ +l.left+l.right))*u)),this._hScrollDiv.style.left=s+Math.floor(Math.max(0,Math.floor(n.x*u/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=y-9+"px",this._hScrollDiv.style.width=r+"px");z=n.x;r=this._clipDiv;u=this._overlayDiv;if(p=this._marginDiv)p.style.left=-z+s+this._metrics.marginWidth+l.left+"px",p.style.bottom=("scroll"===e.style.overflowX?q:0)+"px";r?(r.scrollLeft=z,r.scrollTop=0,e=s+l.left,q=l.top,a=k,s=y,z=0,p=-c,0===n.x&&(e-=l.left,a+=l.left,z=l.left),n.x+k===h&&(a+=l.right),0===n.y&& +(q-=l.top,s+=l.top,p+=l.top),n.y+y===d&&(s+=l.bottom),r.style.left=e+"px",r.style.top=q+"px",r.style.right=C-a-e+"px",r.style.bottom=J-s-q+"px",b.style.left=z+"px",b.style.top=p+"px",b.style.width=h+"px",b.style.height=y+c+"px",u&&(u.style.left=b.style.left,u.style.top=b.style.top,u.style.width=b.style.width,u.style.height=b.style.height)):(e=z,q=c,C=z+k,J=c+y,0===e&&(e-=l.left),0===q&&(q-=l.top),C===h&&(C+=l.right),n.y+y===d&&(J+=l.bottom),b.style.clip="rect("+q+"px,"+C+"px,"+J+"px,"+e+"px)",b.style.left= +-z+s+l.left+"px",b.style.width=(this._wrapMode||f.isWebkit?h:k+z)+"px",a||(b.style.top=-c+l.top+"px",b.style.height=y+c+"px"),u&&(u.style.clip=b.style.clip,u.style.left=b.style.left,u.style.width=b.style.width,a||(u.style.top=b.style.top,u.style.height=b.style.height)));this._updateDOMSelection();g&&(b=this._ensureCaretVisible,this._ensureCaretVisible=!1,b&&this._showCaret(),this._queueUpdate())}}},_updateOverflow:function(){var a=this._viewDiv;this._noScroll?a.style.overflow="hidden":this._wrapMode? +(a.style.overflowX="hidden",a.style.overflowY="scroll"):a.style.overflow="hidden"},_updateRuler:function(a,b,e,c){if(a)for(var n=this._parent.ownerDocument,l=this._getLineHeight(),d=this._getViewPadding(),s=a.firstChild;s;){var g=s._ruler,h=g.getOverview();s.rulerChanged&&(q(g.getRulerStyle(),s),a.rulerWidth=void 0);if("fixed"!==h){var u=l;"page"===h&&(u+=this._topIndexY);s.style.top=-u+"px";s.style.height=c+u+"px";var k,x=s.firstChild;x?(k=x,x=x.nextSibling):(k=f.createElement(n,"div"),k.style.visibility= +"hidden",s.appendChild(k));var v;if(s.rulerChanged&&k){u=-1;if(v=g.getWidestAnnotation())q(v.style,k),v.html&&(k.innerHTML=v.html);k.lineIndex=u;k.style.height=l+d.top+"px"}var p;if("page"===h){for(g=g.getAnnotations(b,e+1);x;)u=x.lineIndex,v=x.nextSibling,(!(b<=u&&u<=e)||x.lineChanged)&&s.removeChild(x),x=v;x=s.firstChild.nextSibling;p=n.createDocumentFragment();for(u=b;u<=e;u++)if(!x||x.lineIndex>u){k=f.createElement(n,"div");if(v=g[u])q(v.style,k),v.html&&(k.innerHTML=v.html),k.annotation=v;k.lineIndex= +u;k.style.height=this._getLineHeight(u)+"px";p.appendChild(k)}else p.firstChild&&(s.insertBefore(p,x),p=n.createDocumentFragment()),x&&(x=x.nextSibling);p.firstChild&&s.insertBefore(p,x)}else{v=this._getClientHeight();u=this._model.getLineCount();x=v+d.top+d.bottom-2*this._metrics.scrollWidth;h=l*u>>0,0>u||(k=f.createElement(n,"div"),v=g[y], +q(v.style,k),k.style.position="absolute",k.style.top=this._metrics.scrollWidth+l+Math.floor(u*h)+"px",v.html&&(k.innerHTML=v.html),k.annotation=v,k.lineIndex=u,p.appendChild(k));s.appendChild(p)}else if(s._oldTrackHeight!==x)for(k=s.firstChild?s.firstChild.nextSibling:null;k;)k.style.top=this._metrics.scrollWidth+l+Math.floor(k.lineIndex*h)+"px",k=k.nextSibling;s._oldTrackHeight=x}}s.rulerChanged=!1;s=s.nextSibling}},_updateStyleSheet:function(){var a="";f.isWebkit&&0k)break;if(d.end>k)return-1;f+= +d._model.getCharCount()-(d.end-d.start)}return k+f}for(q=0;qk-f)break;var c=d._model.getCharCount();if(d.start+c>k-f)return-1;f+=c-(d.end-d.start)}return k-f},removeProjection:function(k){this._removeProjection(k)},_removeProjection:function(k,g){var h,f=0;for(h=0;hk)return null;var h=this._model,f=this._projections,q=0,d=[],c=0,a,b,l;for(a=0;a=k-q)break;b=l._model.getLineCount()-1;if(l._lineIndex+b>=k-q){c=k-(l._lineIndex+q);if(ck-q)break;d.push(h.getText(c,l.start));b=l._model.getLineCount()-1;if(l._lineIndex+b>k-q)return d.push(l._model.getLine(0,g)),d.join("");d.push(l._model.getText());c=l.end;q+=b-l._lineCount}f=h.getLineEnd(k-q,g);ck-f)break;var a=c._model.getCharCount();if(c.start+a>k-f){h=k-(c.start+f);q+=c._model.getLineAtOffset(h); +f+=h;break}q+=c._model.getLineCount()-1-c._lineCount;f+=a-(c.end-c.start)}return g.getLineAtOffset(k-f)+q},getLineCount:function(){for(var k=this._projections,g=this._model.getLineCount(),h=0;hk)return-1;for(var h=this._model,f=this._projections,q=0,d=0,c=0;ck-q)break;var b=a._model.getLineCount()- +1;if(a._lineIndex+b>k-q)return a._model.getLineEnd(k-(a._lineIndex+q),g)+a.start+d;d+=a._model.getCharCount()-(a.end-a.start);q+=b-a._lineCount}return h.getLineEnd(k-q,g)+d},getLineStart:function(k){if(0>k)return-1;for(var g=this._model,h=this._projections,f=0,q=0,d=0;d=k-f)break;var a=c._model.getLineCount()-1;if(c._lineIndex+a>=k-f)return c._model.getLineStart(k-(c._lineIndex+f))+c.start+q;q+=c._model.getCharCount()-(c.end-c.start);f+=a-c._lineCount}return g.getLineStart(k- +f)+q},getText:function(k,g){void 0===k&&(k=0);var h=this._model,f=this._projections,q=0,d=[],c,a,b;for(c=0;ck-q)break;b=a._model.getCharCount();if(a.start+b>k-q){if(void 0!==g&&a.start+b>g-q)return a._model.getText(k-(a.start+q),g-(a.start+q));d.push(a._model.getText(k-(a.start+q)));k=a.end+q+b-(a.end-a.start)}q+=b-(a.end-a.start)}var l=k-q;if(void 0!==g){for(;cg-q)break;d.push(h.getText(l,a.start));b=a._model.getCharCount();if(a.start+ +b>g-q)return d.push(a._model.getText(0,g-(a.start+q))),d.join("");d.push(a._model.getText());l=a.end;q+=b-(a.end-a.start)}d.push(h.getText(l,g-q))}else{for(;cg);f++);var c=f;for(f=0;f=h);f++);var a=f,b=this._model,g=k.baseText.length- +(h-g);for(f=a;fl)break;if(b.end>l)return-1;c+=b._model.getCharCount()-(b.end-b.start)}return l+c};h.start=k(f);-1===h.start&&(h.text=this._model.getText(b.start,f)+h.text,h.addedLineCount+=this._model.getLineAtOffset(f)-this._model.getLineAtOffset(b.start),h.start=b.start+c);h.end=k(q);-1===h.end&&(h.text+=this._model.getText(q,b.end),h.addedLineCount+= +this._model.getLineAtOffset(b.end)-this._model.getLineAtOffset(q),h.end=b.start+c)}h.addedCharCount=h.text.length;h.removedCharCount=h.end-h.start;h.removedLineCount=this.getLineAtOffset(h.end)-this.getLineAtOffset(h.start);this.onChanging({type:"Changing",text:h.text,start:h.start,removedCharCount:h.removedCharCount,addedCharCount:h.addedCharCount,removedLineCount:h.removedLineCount,addedLineCount:h.addedLineCount})},onChanging:function(k){return this.dispatchEvent(k)},onChanged:function(k){return this.dispatchEvent(k)}, +setLineDelimiter:function(k){this._model.setLineDelimiter(k)},setText:function(k,g,h){function f(b){for(d=c=0;cb-d)break;var e=a._model.getCharCount();if(a.start+e>b-d)return-1;d+=e-(a.end-a.start)}return b-d}this._change={text:k||"",start:g||0,end:void 0===h?this.getCharCount():h};var q=this._projections,d,c,a,b,l;k=f(this._change.start);-1===k&&(b={projection:a,start:this._change.start-(a.start+d)},k=a.end);g=f(this._change.end);-1===g&&(l={projection:a,end:this._change.end- +(a.start+d)},g=a.start);b&&l&&b.projection===l.projection?a._model.setText(this._change.text,b.start,l.end):(this._model.setText(this._change.text,k,g),b&&(a=b.projection,a._model.setText("",b.start)),l&&(a=l.projection,a._model.setText("",0,l.end),a.start=a.end,a._lineCount=0));this._change=void 0}};t.EventTarget.addMixin(r.prototype);return{ProjectionTextModel:r}}); +define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(p,t){function r(){}function k(a,b,c){this.start=a;this.end=b;this._projectionModel=c;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function g(a,b){var c=a.lastIndexOf("."),c=a.substring(c+1),n={title:p[c],style:{styleClass:"annotation "+c},html:"\x3cdiv class\x3d'annotationHTML "+c+"'\x3e\x3c/div\x3e",overviewStyle:{styleClass:"annotationOverview "+c}};b?n.lineStyle= +{styleClass:"annotationLine "+c}:n.rangeStyle={styleClass:"annotationRange "+c};r.registerType(a,n)}function h(){}function f(a,b,c,n,e){var s;void 0===n&&(n=-1);void 0===e&&(e=a.length);for(;1n.start?a=b)break}return null};n=s();return{next:function(){var a=n;a&&(n=s());return a},hasNext:function(){return null!==n}}},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,c,n;if(a){c=[];for(n=b.length-1;0<=n;n--){var e=b[n];e.type===a&&(b.splice(n,1),c.splice(0,0,e),e._annotationModel=null)}}else c=b;this.onChanged({type:"Changed", +removed:c,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 c=this._annotations,n,e,s,d=[];if(a)for(n=a.length-1;0<=n;n--)s=a[n],e=this._getAnnotationIndex(s),0>e||(s._annotationModel=null,c.splice(e,1),d.splice(0,0,s));b||(b=[]);for(n=0;n=s?(d._oldStart=d.start,d._oldEnd=d.end,d.start+=c,d.end+=c,a.changed.push(d)):d.end<=b||(d.start=e.end)){c=this._mergeStyle({},e.style);c=this._mergeStyle(c,b.style);var d=[];d.push(n,1);b.starte.start&&d.push({start:e.start, +end:b.start,style:e.style});d.push({start:Math.max(e.start,b.start),end:Math.min(e.end,b.end),style:c});b.ende.end?{start:e.end,end:b.end,style:b.style}:null;Array.prototype.splice.apply(a,d)}}b&&(c=this._mergeStyle({},b.style),a.splice(n,0,{start:b.start,end:b.end,style:c}));return a},_onAnnotationModelChanged:function(a){function b(a,b){d.getBaseModel&&(a=d.mapOffset(a,!0),b=d.mapOffset(b,!0));-1!==a&&-1!==b&&n.redrawRange(a,b)}function c(a, +n){for(var l=0;l=h&&void 0!==l.groupId){c=l;break}if(f&&c&&f.groupId===c.groupId)return}this._currentGroupAnnotation=null;f&&b.removeAnnotations(f.groupType);if(c&&-1!==a){this._currentGroupAnnotation= +c;d=b.getAnnotations();for(a=[];d.hasNext();)l=d.next(),delete l.groupAnnotation,l.groupId===c.groupId&&(l=l.createGroupAnnotation(),a.push(l));b.replaceAnnotations(null,a)}}});r.AnnotationTypeList.addMixin(d.prototype);c.prototype=new d;c.prototype.getAnnotations=function(a,b){for(var c=d.prototype.getAnnotations.call(this,a,b),l=this._view.getModel(),f=a;fthis.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)break;k=this.stack[--this.index]}while(!(k=k.undo(this.view,!0)));this._ignoreUndo=!1;return k},redo:function(){this._commitUndo();var k;this._ignoreUndo=!0;do{if(this.index>=this.stack.length)break;k=this.stack[this.index++]}while(!k.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(k){this.view!==k&&(this.view&&k.removeEventListener("Destroy",this._listener.onDestroy),(this.view=k)&&k.addEventListener("Destroy",this._listener.onDestroy))},startCompoundChange:function(k){this._commitUndo();k=new t(k);this.add(k);this.compoundChange=k;this.compoundChange.start(this.view);return this.compoundChange},_commitUndo:function(){this.endCompoundChange()}, +_onDestroy:function(k){(!k||!this.shared)&&this.model.removeEventListener("Changing",this._listener.onChanging);this.view&&(this.view.removeEventListener("Destroy",this._listener.onDestroy),this.view=null)},_onChanging:function(k){if(!this._ignoreUndo){var g=k.text,h=k.start,f=k.addedCharCount,q=k.removedCharCount;k=h+q;var d=0;0===f&&1===q?d=-1:1===f&&0===q&&(d=1);f=this.stack.length;q=this.model.getText(h,k);(!(0=this._dragSelection.end?h-=this._dragSelection.end-this._dragSelection.start:h>=this._dragSelection.start&&(h=this._dragSelection.start));k.setText(g,h,h);k.setSelection(h, +h+g.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(p){this._onDragOver(p)},_onDragOver:function(r){var k=r.event.dataTransfer.types,g=!this._view.getOptions("readonly");g&&k&&(g=k.contains?k.contains("text/plain")||k.contains("Text"):-1!==k.indexOf("text/plain")||-1!==k.indexOf("Text"));g?p.isFirefox||(this._dropEffect=r.event.dataTransfer.dropEffect=(p.isMac?r.event.altKey:r.event.ctrlKey)?"copy": +"move"):r.event.dataTransfer.dropEffect="none"},_onDrop:function(r){var k=this._view,g=r.event.dataTransfer.getData("Text");g&&(p.isFirefox||(r.event.dataTransfer.dropEffect=this._dropEffect),r=k.getOffsetAtLocation(r.x,r.y),this._dragSelection?(this._dropOffset=r,this._dropText=g):(k.setText(g,r,r),k.setSelection(r,r+g.length)))}};return{TextDND:t}}); +define("orion/editor/editor","i18n!orion/editor/nls/messages orion/editor/eventTarget orion/editor/tooltip orion/editor/annotations orion/objects orion/util".split(" "),function(p,t,r,k,g,h){function f(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(b){a.onChanged(b)}};this._model&&this._model.addEventListener("Changed",this._listener.onChanged);this.checkDirty()} +function q(c){c=c||{};f.call(this,c);this._textViewFactory=c.textViewFactory;this._undoStackFactory=c.undoStackFactory;this._textDNDFactory=c.textDNDFactory;this._annotationFactory=c.annotationFactory;this._zoomRulerFactory=c.zoomRulerFactory;this._foldingRulerFactory=c.foldingRulerFactory;this._lineNumberRulerFactory=c.lineNumberRulerFactory;this._contentAssistFactory=c.contentAssistFactory;this._keyBindingFactory=c.keyBindingFactory;this._hoverFactory=c.hoverFactory;this._contentAssist=this._foldingRuler= +this._zoomRuler=this._overviewRuler=this._lineNumberRuler=this._annotationRuler=this._annotationModel=this._annotationStyler=null}var d=k.AnnotationType;f.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(c){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,l){this._title=c;l||(a?this.reportStatus(a,"error"):null!==b&&(void 0!==b&&"string"===typeof b)&&this._setModelText(b),this._undoStack&&this._undoStack.reset());this.checkDirty();this.onInputChanged({type:"InputChanged",title:c,message:a,contents:b,contentsSaved:l})},setText:function(c,a,b){this.getModel().setText(c,a,b)},uninstall:function(){this.installed= +!1}};t.EventTarget.addMixin(f.prototype);q.prototype=new f;g.mixin(q.prototype,{destroy:function(){f.prototype.destroy.call(this);this._textViewFactory=this._undoStackFactory=this._textDNDFactory=this._annotationFactory=this._foldingRulerFactory=this._lineNumberRulerFactory=this._contentAssistFactory=this._keyBindingFactory=this._hoverFactory=this._zoomRulerFactory=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},getZoomRuler:function(){return this._zoomRuler},getModel:function(){if(!this._textView)return null;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)}},setZoomRulerVisible:function(c,a){if(this._zoomRulerVisible!==c||a)if(this._zoomRulerVisible=c,this._zoomRuler){var b=this._textView;c?b.addRuler(this._zoomRuler):b.removeRuler(this._zoomRuler)}},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===d.ANNOTATION_FOLDING&&a.expand&&a.expand()},setCaretOffset:function(c,a,b){var l=this._textView,n=l.getModel();n.getBaseModel&&(this._expandOffset(c),c=n.mapOffset(c,!0));l.setCaretOffset(c,a,b)},setText:function(c,a,b){var l=this._textView,n=l.getModel();n.getBaseModel&&(void 0!==a&&(this._expandOffset(a),a=n.mapOffset(a,!0)),void 0!==b&&(this._expandOffset(b),b=n.mapOffset(b,!0)));l.setText(c,a,b)},setSelection:function(c,a,b,l){var n=this._textView, +e=n.getModel();e.getBaseModel&&(this._expandOffset(c),this._expandOffset(a),c=e.mapOffset(c,!0),a=e.mapOffset(a,!0));n.setSelection(c,a,b,l)},moveSelection:function(c,a,b,l){var n=this._textView;this.setSelection(c,a||c,1/3,function(){(void 0===l||l)&&n.focus();b&&b()})},_getTooltipInfo:function(c,a){var b=this._textView,l=this.getAnnotationModel();if(!l)return null;var n=this._annotationStyler;if(!n)return null;var e=b.getOffsetAtLocation(c,a);if(-1===e)return null;for(var e=this.mapOffset(e),d= +n.getAnnotationsByType(l,e,e+1),l=[],n=[],f=0;fd.start?d.end-1:d.end),f=c.getLineStart(e),e=c.getLineEnd(d,!0),g=c.getLineCount(),h="",f=c.getText(f,e);d===g-1&&(f=(h=c.getLineDelimiter())+f);a.setText(f,e,e);a.setSelection(e+h.length,e+f.length);return!0},copyLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=a.getModel(),d=a.getSelection(),e=c.getLineAtOffset(d.start),d=c.getLineAtOffset(d.end>d.start?d.end- +1:d.end),e=c.getLineStart(e),f=c.getLineEnd(d,!0),g=c.getLineCount(),h="",f=c.getText(e,f);d===g-1&&(f+=h=c.getLineDelimiter());a.setText(f,e,e);a.setSelection(e,e+f.length-h.length);return!0},deleteLines:function(a){var c=this.editor;if(c.getTextView().getOptions("readonly"))return!1;var d=1;a&&a.count&&(d=a.count);var e=c.getSelection(),f=c.getModel(),g=f.getLineAtOffset(e.start);a=f.getLineStart(g);d=e.start!==e.end||1===d?f.getLineAtOffset(e.end>e.start?e.end-1:e.end):Math.min(g+d-1,f.getLineCount()- +1);d=f.getLineEnd(d,!0);c.setText("",a,d);return!0},expandAnnotation:function(a){var c=this.editor,d=c.getAnnotationModel();if(!d)return!0;var e=c.getModel(),f=c.getCaretOffset(),g=e.getLineAtOffset(f),f=e.getLineStart(g),g=e.getLineEnd(g,!0);e.getBaseModel&&(f=e.mapOffset(f),g=e.mapOffset(g),e.getBaseModel());for(var h,d=d.getAnnotations(f,g);!h&&d.hasNext();)e=d.next(),e.type===r.AnnotationType.ANNOTATION_FOLDING&&(h=e);h&&a!==h.expanded&&(a?h.expand():(c.setCaretOffset(h.start),h.collapse())); +return!0},expandAnnotations:function(a){var c=this.editor,d=c.getTextView(),c=c.getAnnotationModel();if(!c)return!0;var e=c.getAnnotations();for(d.setRedraw(!1);e.hasNext();)c=e.next(),c.type===r.AnnotationType.ANNOTATION_FOLDING&&a!==c.expanded&&(a?c.expand():c.collapse());d.setRedraw(!0);return!0},indentLines:function(){var a=this.editor,c=a.getTextView();if(c.getOptions("readonly"))return!1;if(c.getOptions("tabMode")){var d=a.getModel(),e=a.getSelection(),f=d.getLineAtOffset(e.start),g=d.getLineAtOffset(e.end> +e.start?e.end-1:e.end);if(f!==g){var h=[];h.push("");for(var k=f;k<=g;k++)h.push(d.getLine(k,!0));k=d.getLineStart(f);d=d.getLineEnd(g,!0);c=c.getOptions("tabSize","expandTab");c=c.expandTab?Array(c.tabSize+1).join(" "):"\t";a.setText(h.join(c),k,d);a.setSelection(k===e.start?e.start:e.start+c.length,e.end+(g-f+1)*c.length);return!0}return!1}},gotoLastEdit:function(){"number"===typeof this._lastEditLocation&&this.editor.showSelection(this._lastEditLocation);return!0},gotoLine:function(){var a=this.editor, +c=a.getModel().getLineAtOffset(a.getCaretOffset());if(c=prompt(p.gotoLinePrompty,c+1))c=parseInt(c,10),a.onGotoLine(c-1,0);return!0},moveLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=a.getModel(),d=a.getSelection(),e=c.getLineAtOffset(d.start),f=c.getLineAtOffset(d.end>d.start?d.end-1:d.end),g=c.getLineCount();if(f===g-1)return!0;var e=c.getLineStart(e),d=c.getLineEnd(f,!0),h=c.getLineEnd(f+1,!0)-(d-e),k=0;f!==g-2?c=c.getText(e,d):(f=c.getLineEnd(f), +c=c.getText(f,d)+c.getText(e,f),k+=d-f);this.startUndo();a.setText("",e,d);a.setText(c,h,h);a.setSelection(h+k,h+k+c.length);this.endUndo();return!0},moveLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=a.getModel(),d=a.getSelection(),e=c.getLineAtOffset(d.start);if(0===e)return!0;var f=c.getLineAtOffset(d.end>d.start?d.end-1:d.end),g=c.getLineCount(),d=c.getLineStart(e-1),h=c.getLineStart(e),k=c.getLineEnd(f,!0),q=c.getText(h,k),p=0;f===g-1&&(f=c.getLineEnd(e- +1),e=c.getLineEnd(e-1,!0),q+=c.getText(f,e),h=f,p=e-f);this.startUndo();a.setText("",h,k);a.setText(q,d,d);a.setSelection(d,d+q.length-p);this.endUndo();return!0},nextAnnotation:function(a){function d(a){return!!a.lineStyle||a.type===c.ANNOTATION_MATCHING_BRACKET||a.type===c.ANNOTATION_CURRENT_BRACKET||!f.isAnnotationTypeVisible(a.type)}var n=this.editor,e=n.getAnnotationModel();if(!e)return!0;var f=n.getOverviewRuler()||n.getAnnotationStyler();if(!f)return!0;for(var g=n.getModel(),h=n.getCaretOffset(), +q=e.getAnnotations(a?h:0,a?g.getCharCount():h),p=null;q.hasNext();){var r=q.next();if(a){if(r.start<=h)continue}else if(r.start>=h)continue;if(!d(r)&&(p=r,a))break}if(p){for(var t=[p],q=e.getAnnotations(p.start,p.start);q.hasNext();)r=q.next(),r!==p&&!d(r)&&t.push(r);var m=n.getTextView(),w=g.getLineAtOffset(p.start),B=k.Tooltip.getTooltip(m);if(!B)return n.moveSelection(p.start),!0;n.moveSelection(p.start,p.start,function(){B.setTarget({getTooltipInfo:function(){var a=m.convert({x:m.getLocationAtOffset(p.start).x, +y:m.getLocationAtOffset(g.getLineStart(w)).y},"document","page");return{contents:t,x:a.x,y:a.y+Math.floor(1.33*m.getLineHeight(w))}}},0)})}return!0},unindentLines:function(){var a=this.editor,c=a.getTextView();if(c.getOptions("readonly"))return!1;if(c.getOptions("tabMode")){for(var d=a.getModel(),e=a.getSelection(),f=d.getLineAtOffset(e.start),g=d.getLineAtOffset(e.end>e.start?e.end-1:e.end),h=c.getOptions("tabSize"),k=Array(h+1).join(" "),q=[],p=c=0,r=f;r<=g;r++){var m=d.getLine(r,!0);if(d.getLineStart(r)!== +d.getLineEnd(r))if(0===m.indexOf("\t"))m=m.substring(1),c++;else if(0===m.indexOf(k))m=m.substring(h),c+=h;else return!0;r===f&&(p=c);q.push(m)}f=d.getLineStart(f);h=d.getLineEnd(g,!0);d=d.getLineStart(g);a.setText(q.join(""),f,h);g=f===e.start?e.start:e.start-p;e=Math.max(g,e.end-c+(e.end===d+1&&e.start!==e.end?1:0));a.setSelection(g,e);return!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};a.TextActions= +q;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 t.KeyBinding("t",!0,!1,!0),"trimTrailingWhitespaces");a.setAction("trimTrailingWhitespaces",function(){return this.trimTrailingWhitespaces()}.bind(this),{name:p.trimTrailingWhitespaces});a.setKeyBinding(new t.KeyBinding(191,!0),"toggleLineComment");a.setAction("toggleLineComment", +function(){return this.toggleLineComment()}.bind(this),{name:p.toggleLineComment});a.setKeyBinding(new t.KeyBinding(191,!0,!f.isMac,!1,f.isMac),"addBlockComment");a.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),{name:p.addBlockComment});a.setKeyBinding(new t.KeyBinding(220,!0,!f.isMac,!1,f.isMac),"removeBlockComment");a.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),{name:p.removeBlockComment});a.setKeyBinding(new t.KeyBinding("[", +!1,!1,!1,!1,"keypress"),"autoPairSquareBracket");a.setAction("autoPairSquareBracket",function(){return this.autoPairBrackets("[","]")}.bind(this));a.setKeyBinding(new t.KeyBinding("]",!1,!1,!1,!1,"keypress"),"skipClosingSquareBracket");a.setAction("skipClosingSquareBracket",function(){return this.skipClosingBracket("]")}.bind(this));a.setKeyBinding(new t.KeyBinding("\x3c",!1,!1,!1,!1,"keypress"),"autoPairAngleBracket");a.setAction("autoPairAngleBracket",function(){return this.autoPairBrackets("\x3c", +"\x3e")}.bind(this));a.setKeyBinding(new t.KeyBinding("\x3e",!1,!1,!1,!1,"keypress"),"skipClosingAngleBracket");a.setAction("skipClosingAngleBracket",function(){return this.skipClosingBracket("\x3e")}.bind(this));a.setKeyBinding(new t.KeyBinding("(",!1,!1,!1,!1,"keypress"),"autoPairParentheses");a.setAction("autoPairParentheses",function(){return this.autoPairBrackets("(",")")}.bind(this));a.setKeyBinding(new t.KeyBinding(")",!1,!1,!1,!1,"keypress"),"skipClosingParenthesis");a.setAction("skipClosingParenthesis", +function(){return this.skipClosingBracket(")")}.bind(this));a.setKeyBinding(new t.KeyBinding("{",!1,!1,!1,!1,"keypress"),"autoPairBraces");a.setAction("autoPairBraces",function(){return this.autoPairBrackets("{","}")}.bind(this));a.setKeyBinding(new t.KeyBinding("}",!1,!1,!1,!1,"keypress"),"skipClosingBrace");a.setAction("skipClosingBrace",function(){return this.skipClosingBracket("}")}.bind(this));a.setKeyBinding(new t.KeyBinding("'",!1,!1,!1,!1,"keypress"),"autoPairSingleQuotation");a.setAction("autoPairSingleQuotation", +function(){return this.autoPairQuotations("'")}.bind(this));a.setKeyBinding(new t.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,c=a.getTextView();if(c.getOptions("readonly")||c.getOptions("singleMode"))return!1;var d=a.getSelection();if(d.start===d.end){for(var e=a.getModel(), +f=e.getLineAtOffset(d.start),g=e.getLine(f,!1),h=e.getLineStart(f),k=0,q=d.start-h,p;k]/;return e.start===e.end&&h.test(g)?(d.setText(a+c,e.start,e.start),d.setCaretOffset(e.start+1),!0):e.start!==e.end?(f=f.getText(e.start,e.end),d.setText(a+f+c,e.start,e.end),d.setSelection(e.start+1,e.end+1),!0):!1},autoPairQuotations:function(a){if(!this.autoPairQuotation)return!1; +var c=this.editor;if(c.getTextView().getOptions("readonly"))return!1;var d=c.getSelection(),e=c.getModel(),f=c.getCaretOffset(),g=0===f?"":e.getText(d.start-1,d.start).trim(),h=f===e.getCharCount()?"":e.getText(d.start,d.start+1).trim(),f=/^"$|^'$/,k=/\w/,q=/^$|[)}\]>]/;if(d.start!==d.end){e=e.getText(d.start,d.end);if(f.test(e))return!1;c.setText(a+e+a,d.start,d.end);c.setSelection(d.start+1,d.end+1)}else{if(h!==a){if(g===a||f.test(h)||k.test(g)||!q.test(h))return!1;c.setText(a+a,d.start,d.start)}c.setCaretOffset(d.start+ +1)}return!0},contentAssistProposalApplied:function(a){function c(){return"number"===typeof d.escapePosition?d.escapePosition:a.data.start+d.proposal.length}var d=a.data.proposal;if(d.positions&&0q);g--)if(-1!==q){p=a.getLineStart(g)+q;break}for(g=f;gf.start?f.end-1:f.end),k=!0,q=[],p,r=g;r<=h;r++){var m=e.getLine(r,!0);p=m.indexOf(d);q.push(p);if(!k||-1===p)k=!1;else if(0!==p){for(k=0;kk&&(d.start=Math.max(k,d.start-h));d.start!==d.end&&d.end>k&&(d.end=Math.max(k,d.end-h))}}a.getUndoStack().endCompoundChange();a.setSelection(d.start,d.end,!1);a.getTextView().setRedraw(!0)},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},skipClosingBracket:function(a){var c=this.editor;if(c.getTextView().getOptions("readonly"))return!1;var d=c.getSelection(),e=c.getModel();return(c.getCaretOffset()===e.getCharCount()?"":e.getText(d.start, +d.start+1))===a?(c.setCaretOffset(d.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}, +setLineComment:function(a){this.lineComment=a},setSmartIndentation:function(a){this.smartIndentation=a}};a.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 a}); +define("orion/editor/templates",[],function(){function p(p,k,g,h){this.prefix=p;this.description=k;this.template=g;this.name=h;this._parse()}function t(p,k){this._keywords=p||[];this._templates=[];this.addTemplates(k||[])}p.prototype={getProposal:function(p,k,g){p=k-p.length;k={};var h,f=void 0!==g.delimiter?g.delimiter:"\n";g.indentation&&(f+=g.indentation);var q=void 0!==g.tab?g.tab:"\t",d=0,c=this.variables,a=this.segments;g=[];for(var b=0;ba.name?1:0}),h.splice(0,0,{proposal:"",description:"Templates",style:"noemphasis_title",unselectable:!0}));return h},removePrefix:function(p,k){if(!(k.overwrite=k.proposal.substring(0,p.length)!==p))k.proposal=k.proposal.substring(p.length)},isValid:function(p,k,g,h){return!0}};return{Template:p,TemplateContentAssist:t}}); +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(p,t,r,k,g,h){function f(d,c,a){var b=d.getTextView();r.KeyMode.call(this,b);this.editor=d;this.undoStack=c;this.contentAssist=a;this.linkedModeModel=null;b.setAction("linkedModeEnter",function(){this.exitLinkedMode(!0);return!0}.bind(this));b.setAction("linkedModeCancel",function(){this.exitLinkedMode(!1); +return!0}.bind(this));b.setAction("linkedModeNextGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup((a.selectedGroupIndex+1)%a.groups.length);return!0}.bind(this));b.setAction("linkedModePreviousGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup(0=this.proposals.length){if(b)return!0; +a=0}}else if(void 0===a&&(a=this.selectedIndex-1),0>a){if(b)return!0;a=this.proposals.length-1}for(var d=a;this.proposals[a]&&this.proposals[a].unselectable;){if(c){if(a++,a>=this.proposals.length){if(b)return!0;a=0}}else if(a--,0>a){if(b)return!0;a=this.proposals.length-1}if(a===d){a=-1;break}}this.selectedIndex=a;this.widget&&this.widget.selectNode(a);return!0},pageUp:function(){if(this.widget){var a=this.widget.getTopIndex();a===this.selectedIndex&&(this.widget.scrollIndex(a,!1),a=this.widget.getTopIndex()); +return 0===a?this.lineDown(a,!0):this.lineUp(a,!0)}return this.lineUp()},pageDown:function(){if(this.widget){var a=this.widget.getBottomIndex();a===this.selectedIndex&&(this.widget.scrollIndex(a,!0),a=this.widget.getBottomIndex());return this.lineDown(a,!0)}return this.lineDown()},enter:function(){return this.contentAssist.apply(this.proposals[this.selectedIndex]||null)},tab:function(){return this.widget?(this.widget.parentNode.focus(),!0):!1}});b.prototype={onClick:function(a){a||(a=window.event); +this.contentAssist.apply(this.getProposal(a.target||a.srcElement));this.textView.focus()},onScroll:function(a){this.previousCloneNode&&!this.preserveCloneThroughScroll&&(this._removeCloneNode(),this.previousSelectedNode.classList.add(n.selected));this.preserveCloneThroughScroll=!1},createDiv:function(a,b,c){var d=b.ownerDocument,f=q.createElement(d,"div");f.id="contentoption"+c;f.setAttribute("role","option");f.className=n[a.style]?n[a.style]:n.dfault;"hr"===a.style?a=q.createElement(d,"hr"):(a=this._createDisplayNode(f, +a,c),f.contentAssistProposalIndex=c);f.appendChild(a);b.appendChild(f)},createAccessible:function(){var a=this._contentAssistMode,b=this;f.addEventListener(this.parentNode,"keydown",function(c){c||(c=window.event);c.preventDefault&&c.preventDefault();return c.keyCode===d.KEY.ESCAPE?a.cancel():c.keyCode===d.KEY.UP?a.lineUp():c.keyCode===d.KEY.DOWN?a.lineDown():c.keyCode===d.KEY.ENTER?a.enter():c.keyCode===d.KEY.PAGEDOWN?a.pageDown():c.keyCode===d.KEY.PAGEUP?a.pageUp():c.keyCode===d.KEY.HOME?(b.scrollIndex(0, +!0),a.lineDown(0)):c.keyCode===d.KEY.END?a.lineUp(a.getProposals().length-1):!1})},_createDisplayNode:function(a,b,c){var d=null,f=null;if("string"===typeof b)f=b;else if(b.description&&"string"===typeof b.description)if(b.name&&"string"===typeof b.name){var g=this._createNameNode(b.name);g.contentAssistProposalIndex=c;d=document.createElement("span");d.appendChild(g);g=document.createTextNode(b.description);d.appendChild(g);a.setAttribute("title",b.name+b.description)}else f=b.description;else f= +b.proposal;f&&(d=this._createNameNode(f),a.setAttribute("title",f));d.contentAssistProposalIndex=c;return d},_createNameNode:function(a){var b=document.createElement("span");b.classList.add("proposal-name");b.appendChild(document.createTextNode(a));return b},getProposal:function(a){var b=null;a=a.contentAssistProposalIndex;void 0!==a&&(b=this._contentAssistMode.getProposals()[a]||null);return b},getTopIndex:function(){for(var a=this.parentNode.childNodes,b=0;b=this.parentNode.scrollTop)return b; +return 0},getBottomIndex:function(){for(var a=this.parentNode.childNodes,b=0;bthis.parentNode.scrollTop+this.parentNode.clientHeight)return Math.max(0,b-1)}return a.length-1},scrollIndex:function(a,b){this.parentNode.childNodes[a].scrollIntoView(b);this.preserveCloneThroughScroll=!0},selectNode:function(a){var b=null;this.previousSelectedNode&&(this.previousSelectedNode.classList.remove(n.selected),this.previousSelectedNode=null,this.previousCloneNode&& +this._removeCloneNode());if(-1!==a){b=this.parentNode.childNodes[a];b.classList.add(n.selected);this.parentNode.setAttribute("aria-activedescendant",b.id);b.focus();b.offsetTopthis.parentNode.scrollTop+this.parentNode.clientHeight&&(b.scrollIntoView(!1),this.preserveCloneThroughScroll=!0);var c=d.bounds(b.firstChild||b),f=d.bounds(this.parentNode);a=window.getComputedStyle(this.parentNode); +var g=window.getComputedStyle(b),g=parseInt(a.paddingLeft)+parseInt(a.paddingRight)+parseInt(g.paddingLeft)+parseInt(g.paddingRight);if(c.width>=f.width-g){g=parseInt(a.top);f=b.cloneNode(!0);f.classList.add("cloneProposal");f.style.top=g+b.offsetTop-this.parentNode.scrollTop+"px";f.style.left=a.left;f.setAttribute("id",f.id+"_clone");c=c.left+c.width-parseInt(document.documentElement.clientWidth);0a&&(a=0),f.style.left=a+"px");a=document.createElement("div");a.id="clone_contentassist"; +a.classList.add("contentassist");a.classList.add("cloneWrapper");a.appendChild(f);a.onclick=this.parentNode.onclick;this.parentNode.parentNode.insertBefore(a,this.parentNode);var l=function(a){a.contentAssistProposalIndex=b.contentAssistProposalIndex;if(a.hasChildNodes())for(var c=0;cc){var d=a.y-this.textView.getLineHeight();this.parentNode.offsetHeight>d?c>d?this.parentNode.style.maxHeight=c+"px":(this.parentNode.style.maxHeight= +d+"px",this.parentNode.style.top="0"):(this.parentNode.style.top=a.y-this.parentNode.offsetHeight-this.textView.getLineHeight()+"px",this.parentNode.style.maxHeight=d+"px")}else this.parentNode.style.maxHeight=c+"px";a.x+this.parentNode.offsetWidth>b?(a=b-this.parentNode.offsetWidth,0>a&&(a=0),this.parentNode.style.left=a+"px",this.parentNode.style.maxWidth=b-a):this.parentNode.style.maxWidth=b+a.x+"px"},_removeCloneNode:function(){this.parentNode.parentNode.contains(this.previousCloneNode)&&this.parentNode.parentNode.removeChild(this.previousCloneNode); +this.previousCloneNode=null}};return{ContentAssist:c,ContentAssistMode:a,ContentAssistWidget:b}}); +define("orion/editor/stylers/lib/syntax",[],function(){return{id:"orion.lib",grammars:[{id:"orion.lib",repository:{brace_open:{match:"{",name:"punctuation.section.block.begin"},brace_close:{match:"}",name:"punctuation.section.block.end"},bracket_open:{match:"\\[",name:"punctuation.section.bracket.begin"},bracket_close:{match:"\\]",name:"punctuation.section.bracket.end"},parenthesis_open:{match:"\\(",name:"punctuation.section.parens.begin"},parenthesis_close:{match:"\\)",name:"punctuation.section.parens.end"}, +doc_block:{begin:{match:"/\\*\\*",literal:"/**"},end:{match:"\\*/",literal:"*/"},name:"comment.block.documentation",patterns:[{match:"@(?:(?!\\*/)\\S)*",name:"meta.documentation.annotation"},{match:"\\\x3c\\S*\\\x3e",name:"meta.documentation.tag"},{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]},number_decimal:{match:"\\b-?(?:\\.\\d+|\\d+\\.?\\d*)(?:[eE][+-]?\\d+)?\\b",name:"constant.numeric.number"}, +number_hex:{match:"\\b0[xX][0-9A-Fa-f]+\\b",name:"constant.numeric.hex"},string_doubleQuote:{match:'"(?:\\\\.|[^"])*"?',name:"string.quoted.double"},string_singleQuote:{match:"'(?:\\\\.|[^'])*'?",name:"string.quoted.single"},todo_comment_singleLine:{match:"(\\b)(TODO)(\\b)(.*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.line"}}}}},{id:"orion.c-like",repository:{comment_singleLine:{match:{match:"//.*",literal:"//"},name:"comment.line.double-slash", +patterns:[{include:"orion.lib#todo_comment_singleLine"}]},comment_block:{begin:{match:"/\\*",literal:"/*"},end:{match:"\\*/",literal:"*/"},name:"comment.block",patterns:[{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]}}}],keywords:[]}}); +define("orion/editor/stylers/text_css/syntax",["orion/editor/stylers/lib/syntax"],function(p){var t="alignment-adjust alignment-baseline animation-delay animation-direction animation-duration animation-iteration-count animation-name animation-play-state animation-timing-function animation appearance azimuth backface-visibility background-attachment background-clip background-color background-image background-origin background-position background-repeat background-size background baseline-shift binding bleed bookmark-label bookmark-level bookmark-state bookmark-target border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-bottom border-collapse border-color border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-image border-left-color border-left-style border-left-width border-left border-radius border-right-color border-right-style border-right-width border-right border-spacing border-style border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-top border-width border bottom box-align box-decoration-break box-direction box-flex-group box-flex box-lines box-ordinal-group box-orient box-pack box-shadow box-sizing break-after break-before break-inside caption-side clear clip color-profile color column-count column-fill column-gap column-rule-color column-rule-style column-rule-width column-rule column-span column-width columns content counter-increment counter-reset crop cue-after cue-before cue cursor direction display dominant-baseline drop-initial-after-adjust drop-initial-after-align drop-initial-before-adjust drop-initial-before-align drop-initial-size drop-initial-value elevation empty-cells fit-position fit flex-align flex-flow flex-inline-pack flex-order flex-pack float-offset float font-family font-size font-size-adjust font-stretch font-style font-variant font-weight font grid-columns grid-rows hanging-punctuation height hyphenate-after hyphenate-before hyphenate-character hyphenate-lines hyphenate-resource hyphens icon image-orientation image-rendering image-resolution inline-box-align left letter-spacing line-height line-stacking-ruby line-stacking-shift line-stacking-strategy line-stacking list-style-image list-style-position list-style-type list-style margin-bottom margin-left margin-right margin-top margin mark-after mark-before mark marker-offset marks marquee-direction marquee-loop marquee-play-count marquee-speed marquee-style max-height max-width min-height min-width move-to nav-down nav-index nav-left nav-right nav-up opacity orphans outline-color outline-offset outline-style outline-width outline overflow-style overflow-x overflow-y overflow padding-bottom padding-left padding-right padding-top padding page-break-after page-break-before page-break-inside page-policy page pause-after pause-before pause perspective-origin perspective phonemes pitch-range pitch play-during position presentation-level punctuation-trim quotes rendering-intent resize rest-after rest-before rest richness right rotation-point rotation ruby-align ruby-overhang ruby-position ruby-span size speak-header speak-numeral speak-punctuation speak speech-rate stress string-set table-layout target-name target-new target-position target text-align-last text-align text-decoration text-emphasis text-height text-indent text-justify text-outline text-shadow text-transform text-wrap top transform-origin transform-style transform transition-delay transition-duration transition-property transition-timing-function transition unicode-bidi vertical-align visibility voice-balance voice-duration voice-family voice-pitch-range voice-pitch voice-rate voice-stress voice-volume volume white-space-collapse white-space widows width word-break word-spacing word-wrap z-index".split(" ");p= +p.grammars;p.push({id:"orion.css",contentTypes:["text/css"],patterns:[{begin:"'(?:\\\\.|[^\\\\'])*\\\\$",end:"^(?:$|(?:\\\\.|[^\\\\'])*('|[^\\\\]$))",name:"string.quoted.single.css"},{begin:'"(?:\\\\.|[^\\\\"])*\\\\$',end:'^(?:$|(?:\\\\.|[^\\\\"])*("|[^\\\\]$))',name:"string.quoted.double.css"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_block"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"}, +{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#number_decimal"},{include:"#number_hex"},{match:"(?i)\\b-?(?:\\.\\d+|\\d+\\.?\\d*)(?:%|em|ex|ch|rem|vw|vh|vmin|vmax|in|cm|mm|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?\\b",name:"constant.numeric.value.css"},{match:"(?:-webkit-|-moz-|-ms-|-o-|\\b)(?:"+t.join("|")+")\\b",name:"support.type.propertyName.css"}],repository:{number_hex:{match:"#[0-9A-Fa-f]+\\b", +name:"constant.numeric.hex.css"}}});return{id:p[p.length-1].id,grammars:p,keywords:t}}); +define("webtools/cssContentAssist",["orion/editor/templates","orion/editor/stylers/text_css/syntax"],function(p,t){function r(a){return JSON.stringify(a).replace("}","\\}")}function k(){}for(var g={type:"link",values:"visible hidden scroll auto no-display no-content".split(" ")},h={type:"link",values:"solid dashed dotted double groove ridge inset outset".split(" ")},f={type:"link",values:[]},q=0;10>q;q++)f.values.push(q.toString());for(var d={type:"link",values:"black white red green blue magenta yellow cyan grey darkred darkgreen darkblue darkmagenta darkcyan darkyellow darkgray lightgray".split(" ")}, +c=[{prefix:"rule",description:"rule - class selector rule",template:".${class} {\n\t${cursor}\n}"},{prefix:"rule",description:"rule - id selector rule",template:"#${id} {\n\t${cursor}\n}"},{prefix:"outline",description:"outline - outline style",template:"outline: ${color:"+r(d)+"} ${style:"+r(h)+"} ${width:"+r(f)+"}px;"},{prefix:"background-image",description:"background-image - image style",template:'background-image: url("${uri}");'},{prefix:"url",description:"url - url image",template:'url("${uri}");'}, +{prefix:"rgb",description:"rgb - rgb color",template:"rgb(${red},${green},${blue});"},{prefix:"@import",description:"import - import style sheet",template:'@import "${uri}";'},{prefix:"csslint",description:"csslint - add embedded rule severity",template:"/*csslint ${:"+r({type:"link",values:"adjoining-classes box-model box-sizing bulletproof-font-face compatible-vendor-prefixes display-property-grouping duplicate-background-images duplicate-properties empty-rules fallback-colors floats font-faces font-sizes gradients ids import important known-properties outline-none overqualified-elements qualified-headings regex-selectors rules-count selector-max-approaching selector-max shorthand star-property-hack text-indent underscore-property-hack unique-headings universal-selector unqualified-attributes vendor-prefix zero-units".split(" ")})+ +"}: ${a:"+r({type:"link",values:["false","true","0","1","2"]})+"} */"}],a=[{prop:"display",values:{type:"link",values:"none block box flex inline inline-block inline-flex inline-table list-item table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group inherit".split(" ")}},{prop:"overflow",values:g},{prop:"overflow-x",values:g},{prop:"overflow-y",values:g},{prop:"float",values:{type:"link",values:["left","right","none","inherit"]}}, +{prop:"position",values:{type:"link",values:["absolute","fixed","relative","static","inherit"]}},{prop:"cursor",values:{type:"link",values:"auto crosshair default e-resize help move n-resize ne-resize nw-resize pointer progress s-resize se-resize sw-resize text w-resize wait inherit".split(" ")}},{prop:"color",values:d},{prop:"border-top-color",values:d},{prop:"border-bottom-color",values:d},{prop:"border-right-color",values:d},{prop:"border-left-color",values:d},{prop:"background-color",values:d}, +{prop:"font-style",values:{type:"link",values:["italic","normal","oblique","inherit"]}},{prop:"font-weight",values:{type:"link",values:"bold normal bolder lighter 100 200 300 400 500 600 700 800 900 inherit".split(" ")}},{prop:"white-space",values:{type:"link",values:"pre pre-line pre-wrap nowrap normal inherit".split(" ")}},{prop:"word-wrap",values:{type:"link",values:["normal","break-word"]}},{prop:"visibility",values:{type:"link",values:["hidden","visible","collapse","inherit"]}}],q=0;q=this.string.length},sol:function(){return 0===this.pos},peek:function(){return this.string[this.pos]},next:function(){return this.string[this.pos++]}, +eat:function(c){var a=this.string[this.pos];return"string"===typeof a&&(a===c||c.test&&c.test(a)||"function"===typeof c&&c(a))?this.string[this.pos++]:void 0},eatWhile:function(c){for(var a=!1;void 0!==this.eat(c);)a=!0;return a},eatSpace:function(){return this.eatWhile(/\s/)},skipToEnd:function(){this.pos=this.string.length},skipTo:function(c){c=this.string.indexOf(c,this.pos);return-1!==c?(this.pos=c,!0):!1},match:function(c,a,b){a=!0===a||"undefined"===typeof a;if("string"===typeof c){var d=b? +this.string.toLowerCase():this.string;c=b?c.toLowerCase():c;b=d.indexOf(c,this.pos);-1!==b&&a&&(this.pos=b+c.length);return-1!==b}if((c=this.string.substring(this.pos).match(c))&&a&&"string"===typeof c[0])this.pos+=c.index+c[0].length;return c},backUp:function(c){this.pos-=c},column:function(){for(var c=0,a=0;a=b)break;this._expandRange(d,d);for(var f=this._getResumeLineIndex(d),d=f+1,f=(f=0<=f&&this.lines[f].eolState)?this.codeMirror.copyState(this.mode,f):this.mode.startState(),e=0,g=d;gc&&k){this.highlightLater(g+1);this.onHighlightDone();return}}}this.onHighlightDone()},onHighlightDone:function(){this.startLine!==Number.MAX_VALUE&&-1!==this.endLine&&this.dispatchEvent({type:"Highlight",start:this.startLine,end:this.endLine});this.startLine=Number.MAX_VALUE;this.endLine=-1},_getResumeLineIndex:function(c){for(var a=this.lines,b=c-1;0<=b;b--)if(a[b].eolState||40/,func:function(g){return"atomic group"}}],toRegExp:function(g){function h(c,a){throw Error('Unsupported regex feature "'+c+'": "'+a[0]+'" at index: '+a.index+" in "+a.input);}var f="",q;g=k.processGlobalFlag("x",g,function(c){for(var a="",b=!1,d=c.length,f=0;f=z.start&&t.end<=y)t.start+=1,t.end+=1,t.num+=1,2===t.type&&(e[t.oldNum]=t.num);a.push(v);l++;break}default:"|"!==v&&(2!==t&&4!==t)&&0===c&&(d.push(4),a.push({start:r,end:-1,type:4,num:l}),n.push("("),p[l]=null,l++),n.push(v),"\\"===v&&(v=f.charAt(r+1),n.push(v),r+=1)}}for(;d.length;)d.pop(),n.push(")");f=RegExp(n.join(""));k={};h=h||e;for(var w in h)h.hasOwnProperty(w)&&(k[w]="\\"+h[w]);f=this.getSubstitutedRegex(f,k,!1);return[f,e,p]},complexCaptures:function(g){if(!g)return!1;for(var h in g)if(g.hasOwnProperty(h)&& +"0"!==h)return!0;return!1}};r.prototype={initialize:function(g){this.textView=g;this.textView.stylerOptions=this;var h=this;this._listener={onModelChanged:function(f){h.onModelChanged(f)},onDestroy:function(f){h.onDestroy(f)},onLineStyle:function(f){h.onLineStyle(f)},onStorage:function(f){h.onStorage(f)}};g.addEventListener("ModelChanged",this._listener.onModelChanged);g.addEventListener("Destroy",this._listener.onDestroy);g.addEventListener("LineStyle",this._listener.onLineStyle);g.redrawLines()}, +onDestroy:function(g){this.destroy()},destroy:function(){this.textView&&(this.textView.removeEventListener("ModelChanged",this._listener.onModelChanged),this.textView.removeEventListener("Destroy",this._listener.onDestroy),this.textView.removeEventListener("LineStyle",this._listener.onLineStyle),this.textView=null);this._listener=this._tree=this._styles=this.grammar=null},preprocess:function(g){for(g=[g];0!==g.length;){var h=g.pop();if(!h._resolvedRule||!h._typedRule)if(h._resolvedRule=this._resolve(h), +h._typedRule=this._createTypedRule(h),this.addStyles(h.name),this.addStyles(h.contentName),this.addStylesForCaptures(h.captures),this.addStylesForCaptures(h.beginCaptures),this.addStylesForCaptures(h.endCaptures),h._resolvedRule!==h&&g.push(h._resolvedRule),h.patterns)for(var f=0;fg)return this._tree;for(var f=[this._tree],k=null;f.length;){var d=f.pop();if(!d.parent||this.isDamaged(d,g,h)){d instanceof this.BeginEndNode&&(k=d);for(var c=0;c +h},parse:function(g,h,f,k,d,c){var a=this.textView.getModel(),b=a.getLineStart(a.getLineCount()-1),l=a.getCharCount(),n=this.getInitialExpected(g,f),e=-1;h&&(g.repaired=!0,g.endNeedsUpdate=!0,e=(e=g.children[g.children.length-1])?a.getLineEnd(a.getLineAtOffset(e.end+(d-c))):-1,k=a.getLineEnd(a.getLineAtOffset(k+c)),e=Math.max(e,k));e=-1===e?l:e;k=n;for(var p=g,r=!1,t=f,v=-1;p&&(!h||t=b?l:a.getLineStart(a.getLineAtOffset(t)+1));var z=y&&y.match,C=y&&y.rule, +m=y&&y.isEnd;if(y&&y.isSub)t=this.afterMatch(z),C instanceof this.BeginEndRule&&(r=!0,h&&C===k.rule&&p===k.parent?(p=k,p.setStart(z),p.repaired=!0,p.endNeedsUpdate=!0,k=this.getNextExpected(k,"begin")):(h&&(this.prune(p,k),h=!1),z=new this.BeginEndNode(p,C,z),p.addChild(z),p=z));else if(m||t===l)p instanceof this.BeginEndNode&&(z?(r=!0,v=Math.max(v,p.end),p.setEnd(z),t=this.afterMatch(z),h&&p===k&&p.parent===k.parent?(p.repaired=!0,delete p.endNeedsUpdate,k=this.getNextExpected(k,"end")):h&&(this.prune(p, +k),h=!1)):(p.setEnd(l),delete p.endNeedsUpdate)),p=p.parent;h&&(t>=e&&!r)&&(this.prune(g,n),h=!1)}this.removeUnrepairedChildren(g,h,f);this.cleanup(h,g,f,e,l,d,c);return h?Math.max(v,t):t},removeUnrepairedChildren:function(g,h,f){if(h){h=g.children;for(var k=-1,d=0;d=h)return k}else if(g instanceof this.BeginEndNode&&g.endMatch){var d=g.endMatch.index;for(f=0;f=h);f++);if(k&&k.startb.result.index?1:a.pattern.pattern.index< +b.pattern.pattern.index?-1:1});for(var p=0;0b.result.index?1:a.pattern.pattern.indexb.start?1:0});for(k=0;k=f);p++){var r=k[p].start,t=k[p].end;h=f);k++){var p=h[k].start,r=h[k].end;ed&&h.end-c<=-d){h=t;continue}z=f.getText(h.start,Math.min(g,h.end+d+1));if(!this._stylerAdapter.verifyBlock(f,z,h,d)){h=t;continue}}r=h.getBlocks();var w=r.length,B=q(r,e,!0),A=q(r,a,!1,B-1,w);k=!1;if(B&&r.length&&r[B-1].end===c){z=f.getText(r[B-1].start,Math.min(g,c+1));var D=this.computeBlocks(f,z,h,r[B-1].start,null,null,null);D.length&&D[0].end!==r[B-1].end&&(B--,k=!0)}Bc&&(m+=d)):B===w&&0c&&(m+=d)):m=Math.max(e,h.contentStart);C=Ac&&(D-=d),k>c&&(k-=d),D<=c&&(cd&&(a--,d++),this._view.setSelection(d, +a))}}},_onSelection:function(d){var c=d.oldValue,a=d.newValue;d=this._view.getModel();var b;if(this._highlightCaretLine){var f=d.getLineAtOffset(c.start);b=d.getLineAtOffset(a.start);var g=a.start===a.end,c=c.start===c.end;f===b&&c&&g||(c&&this._view.redrawLines(f,f+1),(f!==b||!c)&&g&&this._view.redrawLines(b,b+1))}if(this._annotationModel){var c=this._bracketAnnotations,e,h;if(a.start===a.end&&0<(h=this._view.getCaretOffset()))h-=1,d.getBaseModel&&(h=d.mapOffset(h),d=d.getBaseModel()),a=this._findBlock(this._rootBlock, +h),d=this._findMatchingBracket(d,a,h),-1!==d&&(e=[p.AnnotationType.createAnnotation(p.AnnotationType.ANNOTATION_MATCHING_BRACKET,d,d+1),p.AnnotationType.createAnnotation(p.AnnotationType.ANNOTATION_CURRENT_BRACKET,h,h+1)]);this._bracketAnnotations=e;this._annotationModel.replaceAnnotations(c,e)}},_spliceStyles:function(d,c,a,b){for(var f=d.regex,g=f.lastIndex=0,e=f.exec(a);e;){for(e=b+e.index;g?+]/g,"_"),p(["./stylers/"+b+"/syntax"],function(a){a= +new w.createPatternBasedAdapter(a.grammars,a.id);this.styler=new w.TextStyler(d,e,a)},function(a){}));"text/css"===b&&c.setFoldingRulerVisible(void 0===a.showFoldingRuler||a.showFoldingRuler)}}).highlight(a.contentType||a.lang,r);if(q){var t=new x.CssContentAssistProvider,y=new v.HTMLContentAssistProvider;q.addEventListener("Activating",function(){/css$/.test(a.lang)?q.setProviders([t]):/html$/.test(a.lang)&&q.setProviders([y])})}l=b.defaultView||b.parentWindow;!a.noComputeSize&&("none"!==H(l,b,c)&& +50>=c.clientHeight)&&(b=r.getTextView().computeSize().height,c.style.height=b+"px");return r}var L=this.orion?this.orion.editor:void 0;if(L){for(var N=0;N