diff --git a/public/cui.js b/public/cui.js index 6775f372..f806d8d3 100644 --- a/public/cui.js +++ b/public/cui.js @@ -36,7 +36,7 @@ ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* module decorator */ module = __webpack_require__.nmd(module); -ace.define("ace/mode/jsdoc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:["comment.doc.tag","comment.doc.text","lparen.doc"],regex:"(@(?:param|member|typedef|property|namespace|var|const|callback))(\\s*)({)",push:[{token:"lparen.doc",regex:"{",push:[{include:"doc-syntax"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"}]},{token:["rparen.doc","text.doc","variable.parameter.doc","lparen.doc","variable.parameter.doc","rparen.doc"],regex:/(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,next:"pop"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"},{include:"doc-syntax"},{defaultToken:"text.doc"}]},{token:["comment.doc.tag","text.doc","lparen.doc"],regex:"(@(?:returns?|yields|type|this|suppress|public|protected|private|package|modifies|implements|external|exception|throws|enum|define|extends))(\\s*)({)",push:[{token:"lparen.doc",regex:"{",push:[{include:"doc-syntax"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"}]},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"},{include:"doc-syntax"},{defaultToken:"text.doc"}]},{token:["comment.doc.tag","text.doc","variable.parameter.doc"],regex:'(@(?:alias|memberof|instance|module|name|lends|namespace|external|this|template|requires|param|implements|function|extends|typedef|mixes|constructor|var|memberof\\!|event|listens|exports|class|constructs|interface|emits|fires|throws|const|callback|borrows|augments))(\\s+)(\\w[\\w#.:/~"\\-]*)?'},{token:["comment.doc.tag","text.doc","variable.parameter.doc"],regex:"(@method)(\\s+)(\\w[\\w.\\(\\)]*)"},{token:"comment.doc.tag",regex:"@access\\s+(?:private|public|protected)"},{token:"comment.doc.tag",regex:"@kind\\s+(?:class|constant|event|external|file|function|member|mixin|module|namespace|typedef)"},{token:"comment.doc.tag",regex:"@\\w+(?=\\s|$)"},s.getTagRule(),{defaultToken:"comment.doc.body",caseInsensitive:!0}],"doc-syntax":[{token:"operator.doc",regex:/[|:]/},{token:"paren.doc",regex:/[\[\]]/}]},this.normalizeRules()};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:/\/\*\*(?!\/)/,next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.JsDocCommentHighlightRules=s}),ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/jsdoc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";function a(){var e=o.replace("\\d","\\d\\-"),t={onMatch:function(e,t,n){var r=e.charAt(1)=="/"?2:1;if(r==1)t!=this.nextState?n.unshift(this.next,this.nextState,0):n.unshift(this.next),n[2]++;else if(r==2&&t==this.nextState){n[1]--;if(!n[1]||n[1]<0)n.shift(),n.shift()}return[{type:"meta.tag.punctuation."+(r==1?"":"end-")+"tag-open.xml",value:e.slice(0,r)},{type:"meta.tag.tag-name.xml",value:e.substr(r)}]},regex:"))",next:"jsxAttributes",nextState:"jsx"};this.$rules.start.unshift(t);var n={regex:"{",token:"paren.quasi.start",push:"start"};this.$rules.jsx=[n,t,{include:"reference"},{defaultToken:"string.xml"}],this.$rules.jsxAttributes=[{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",onMatch:function(e,t,n){return t==n[0]&&n.shift(),e.length==2&&(n[0]==this.nextState&&n[1]--,(!n[1]||n[1]<0)&&n.splice(0,2)),this.next=n[0]||"start",[{type:this.token,value:e}]},nextState:"jsx"},n,f("jsxAttributes"),{token:"entity.other.attribute-name.xml",regex:e},{token:"keyword.operator.attribute-equals.xml",regex:"="},{token:"text.tag-whitespace.xml",regex:"\\s+"},{token:"string.attribute-value.xml",regex:"'",stateName:"jsx_attr_q",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',stateName:"jsx_attr_qq",push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},t],this.$rules.reference=[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}]}function f(e){return[{token:"comment",regex:/\/\*/,next:[i.getTagRule(),{token:"comment",regex:"\\*\\/",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]},{token:"comment",regex:"\\/\\/",next:[i.getTagRule(),{token:"comment",regex:"$|^",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]}]}var r=e("../lib/oop"),i=e("./jsdoc_comment_highlight_rules").JsDocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o="[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*",u=function(e){var t={"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",keyword:"const|yield|import|get|set|async|await|break|case|catch|continue|default|delete|do|else|finally|for|if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},n=this.createKeywordMapper(t,"identifier"),r="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",s="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u{[0-9a-fA-F]{1,6}}|[0-2][0-7]{0,2}|3[0-7][0-7]?|[4-7][0-7]?|.)",u="(function)(\\s*)(\\*?)",l={token:["identifier","text","paren.lparen"],regex:"(\\b(?!"+Object.values(t).join("|")+"\\b)"+o+")(\\s*)(\\()"};this.$rules={no_regex:[i.getStartRule("doc-start"),f("no_regex"),l,{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\s*)(=)(\\s*)"+u+"(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","storage.type","text","text","entity.name.function","text","paren.lparen"],regex:"(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))("+o+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\s*)(:)(\\s*)"+u+"(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)"+u+"(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"from(?=\\s*('|\"))"},{token:"keyword",regex:"(?:"+r+")\\b",next:"start"},{token:"support.constant",regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|debug|time|trace|timeEnd|assert)\b/},{token:n,regex:o},{token:"punctuation.operator",regex:/[.](?![.])/,next:"property"},{token:"storage.type",regex:/=>/,next:"start"},{token:"keyword.operator",regex:/--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],property:[{token:"text",regex:"\\s+"},{token:"keyword.operator",regex:/=/},{token:["storage.type","text","storage.type","text","paren.lparen"],regex:u+"(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","storage.type","text","text","entity.name.function","text","paren.lparen"],regex:"(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:"punctuation.operator",regex:/[.](?![.])/},{token:"support.function",regex:"prototype"},{token:"support.function",regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:"support.function.dom",regex:/(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:"support.constant",regex:/(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:"identifier",regex:o},{regex:"",token:"empty",next:"no_regex"}],start:[i.getStartRule("doc-start"),f("start"),{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],default_parameter:[{token:"string",regex:"'(?=.)",push:[{token:"string",regex:"'|$",next:"pop"},{include:"qstring"}]},{token:"string",regex:'"(?=.)',push:[{token:"string",regex:'"|$',next:"pop"},{include:"qqstring"}]},{token:"constant.language",regex:"null|Infinity|NaN|undefined"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/},{token:"punctuation.operator",regex:",",next:"function_arguments"},{token:"text",regex:"\\s+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],function_arguments:[f("function_arguments"),{token:"variable.parameter",regex:o},{token:"punctuation.operator",regex:","},{token:"text",regex:"\\s+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],qqstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]};if(!e||!e.noES6)this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(e,t,n){this.next=e=="{"?this.nextState:"";if(e=="{"&&n.length)n.unshift("start",t);else if(e=="}"&&n.length){n.shift(),this.next=n.shift();if(this.next.indexOf("string")!=-1||this.next.indexOf("jsx")!=-1)return"paren.quasi.end"}return e=="{"?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:s},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]},{token:["variable.parameter","text"],regex:"("+o+")(\\s*)(?=\\=>)"},{token:"paren.lparen",regex:"(\\()(?=[^\\(]+\\s*=>)",next:"function_arguments"},{token:"variable.language",regex:"(?:(?:(?:Weak)?(?:Set|Map))|Promise)\\b"}),this.$rules.function_arguments.unshift({token:"keyword.operator",regex:"=",next:"default_parameter"},{token:"keyword.operator",regex:"\\.{3}"}),this.$rules.property.unshift({token:"support.function",regex:"(findIndex|repeat|startsWith|endsWith|includes|isSafeInteger|trunc|cbrt|log2|log10|sign|then|catch|finally|resolve|reject|race|any|all|allSettled|keys|entries|isInteger)\\b(?=\\()"},{token:"constant.language",regex:"(?:MAX_SAFE_INTEGER|MIN_SAFE_INTEGER|EPSILON)\\b"}),(!e||e.jsx!=0)&&a.call(this);this.embedRules(i,"doc-",[i.getEndRule("no_regex")]),this.normalizeRules()};r.inherits(u,s),t.JavaScriptHighlightRules=u}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"],function(e,t,n){"use strict";function o(e,t){return e&&e.type.lastIndexOf(t+".xml")>-1}var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,u=function(){this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){var u=i,a=r.doc.getTextRange(n.getSelectionRange());if(a!==""&&a!=="'"&&a!='"'&&n.getWrapBehavioursEnabled())return{text:u+a+u,selection:!1};var f=n.getCursorPosition(),l=r.doc.getLine(f.row),c=l.substring(f.column,f.column+1),h=new s(r,f.row,f.column),p=h.getCurrentToken();if(c==u&&(o(p,"attribute-value")||o(p,"string")))return{text:"",selection:[1,1]};p||(p=h.stepBackward());if(!p)return;while(o(p,"tag-whitespace")||o(p,"whitespace"))p=h.stepBackward();var d=!c||c.match(/\s/);if(o(p,"attribute-equals")&&(d||c==">")||o(p,"decl-attribute-equals")&&(d||c=="?"))return{text:u+u,selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}}),this.add("autoclosing","insertion",function(e,t,n,r,i){if(i==">"){var u=n.getSelectionRange().start,a=new s(r,u.row,u.column),f=a.getCurrentToken()||a.stepBackward();if(!f||!(o(f,"tag-name")||o(f,"tag-whitespace")||o(f,"attribute-name")||o(f,"attribute-equals")||o(f,"attribute-value")))return;if(o(f,"reference.attribute-value"))return;if(o(f,"attribute-value")){var l=a.getCurrentTokenColumn()+f.value.length;if(u.column/.test(r.getLine(u.row).slice(u.column)))return;while(!o(f,"tag-name")){f=a.stepBackward();if(f.value=="<"){f=a.stepForward();break}}var h=a.getCurrentTokenRow(),p=a.getCurrentTokenColumn();if(o(a.stepBackward(),"end-tag-open"))return;var d=f.value;h==u.row&&(d=d.substring(0,u.column-p));if(this.voidElements&&this.voidElements.hasOwnProperty(d.toLowerCase()))return;return{text:">",selection:[1,1]}}}),this.add("autoindent","insertion",function(e,t,n,r,i){if(i=="\n"){var u=n.getCursorPosition(),a=r.getLine(u.row),f=new s(r,u.row,u.column),l=f.getCurrentToken();if(o(l,"")&&l.type.indexOf("tag-close")!==-1){if(l.value=="/>")return;while(l&&l.type.indexOf("tag-name")===-1)l=f.stepBackward();if(!l)return;var c=l.value,h=f.getCurrentTokenRow();l=f.stepBackward();if(!l||l.type.indexOf("end-tag")!==-1)return;if(this.voidElements&&!this.voidElements[c]||!this.voidElements){var p=r.getTokenAt(u.row,u.column+1),a=r.getLine(h),d=this.$getIndent(a),v=d+r.getTabString();return p&&p.value===""){var o=n.getSelectionRange().start,u=new i(r,o.row,o.column),a=u.getCurrentToken()||u.stepBackward();if(!a)return;if(a.value=="<")return{text:">",selection:[1,1]}}})};r.inherits(u,s),t.JavaScriptBehaviour=u}),ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";function a(e,t){return e&&e.type&&e.type.lastIndexOf(t+".xml")>-1}var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e,t){s.call(this),this.voidElements=e||{},this.optionalEndTags=r.mixin({},this.voidElements),t&&r.mixin(this.optionalEndTags,t)};r.inherits(o,s);var u=function(){this.tagName="",this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};(function(){this.getFoldWidget=function(e,t,n){var r=this._getFirstTagInLine(e,n);return r?r.closing||!r.tagName&&r.selfClosing?t==="markbeginend"?"end":"":!r.tagName||r.selfClosing||this.voidElements.hasOwnProperty(r.tagName.toLowerCase())?"":this._findEndTagInLine(e,n,r.tagName,r.end.column)?"":"start":this.getCommentFoldWidget(e,n)},this.getCommentFoldWidget=function(e,t){return/comment/.test(e.getState(t))&&/";break}}return r}if(a(s,"tag-close"))return r.selfClosing=s.value=="/>",r;r.start.column+=s.value.length}return null},this._findEndTagInLine=function(e,t,n,r){var i=e.getTokens(t),s=0;for(var o=0;of)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./xml").FoldMode,s=e("./cstyle").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end))),this.xmlFoldMode=new i};r.inherits(o,s),function(){this.getFoldWidgetRangeBase=this.getFoldWidgetRange,this.getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=this.getFoldWidgetBase(e,t,n);return r?r:this.xmlFoldMode.getFoldWidget(e,t,n)},this.getFoldWidgetRange=function(e,t,n,r){var i=this.getFoldWidgetRangeBase(e,t,n,r);return i?i:this.xmlFoldMode.getFoldWidgetRange(e,t,n)}}.call(o.prototype)}),ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript_highlight_rules").JavaScriptHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../worker/worker_client").WorkerClient,a=e("./behaviour/javascript").JavaScriptBehaviour,f=e("./folding/javascript").FoldMode,l=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new f};r.inherits(l,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.$quotes={'"':'"',"'":"'","`":"`"},this.$pairQuotesAfter={"`":/\w/},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"||e=="no_regex"){var u=t.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);u&&(r+=n)}else if(e=="doc-start")if(o=="start"||o=="no_regex")return"";return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new u(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/javascript",this.snippetFileId="ace/snippets/javascript"}.call(l.prototype),t.Mode=l}),ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=t.supportType="align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index",u=t.supportFunction="rgb|rgba|url|attr|counter|counters",a=t.supportConstant="absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|flex-end|flex-start|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero|zoom",f=t.supportConstantColor="aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen",l=t.supportConstantFonts="arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace",c=t.numRe="\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))",h=t.pseudoElements="(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",p=t.pseudoClasses="(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b",d=function(){var e=this.createKeywordMapper({"support.function":u,"support.constant":a,"support.type":o,"support.constant.color":f,"support.constant.fonts":l},"text",!0);this.$rules={start:[{include:["strings","url","comments"]},{token:"paren.lparen",regex:"\\{",next:"ruleset"},{token:"paren.rparen",regex:"\\}"},{token:"string",regex:"@(?!viewport)",next:"media"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"keyword",regex:"%"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant.numeric",regex:c},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:!0}],media:[{include:["strings","url","comments"]},{token:"paren.lparen",regex:"\\{",next:"start"},{token:"paren.rparen",regex:"\\}",next:"start"},{token:"string",regex:";",next:"start"},{token:"keyword",regex:"(?:media|supports|document|charset|import|namespace|media|supports|document|page|font|keyframes|viewport|counter-style|font-feature-values|swash|ornaments|annotation|stylistic|styleset|character-variant)"}],comments:[{token:"comment",regex:"\\/\\*",push:[{token:"comment",regex:"\\*\\/",next:"pop"},{defaultToken:"comment"}]}],ruleset:[{regex:"-(webkit|ms|moz|o)-",token:"text"},{token:"punctuation.operator",regex:"[:;]"},{token:"paren.rparen",regex:"\\}",next:"start"},{include:["strings","url","comments"]},{token:["constant.numeric","keyword"],regex:"("+c+")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"},{token:"constant.numeric",regex:c},{token:"constant.numeric",regex:"#[a-f0-9]{6}"},{token:"constant.numeric",regex:"#[a-f0-9]{3}"},{token:["punctuation","entity.other.attribute-name.pseudo-element.css"],regex:h},{token:["punctuation","entity.other.attribute-name.pseudo-class.css"],regex:p},{include:"url"},{token:e,regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"},{token:"paren.lparen",regex:"\\{"},{caseInsensitive:!0}],url:[{token:"support.function",regex:"(?:url(:?-prefix)?|domain|regexp)\\(",push:[{token:"support.function",regex:"\\)",next:"pop"},{defaultToken:"string"}]}],strings:[{token:"string.start",regex:"'",push:[{token:"string.end",regex:"'|$",next:"pop"},{include:"escapes"},{token:"constant.language.escape",regex:/\\$/,consumeLineEnd:!0},{defaultToken:"string"}]},{token:"string.start",regex:'"',push:[{token:"string.end",regex:'"|$',next:"pop"},{include:"escapes"},{token:"constant.language.escape",regex:/\\$/,consumeLineEnd:!0},{defaultToken:"string"}]}],escapes:[{token:"constant.language.escape",regex:/\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/}]},this.normalizeRules()};r.inherits(d,s),t.CssHighlightRules=d}),ace.define("ace/mode/css_completions",["require","exports","module"],function(e,t,n){"use strict";var r={background:{"#$0":1},"background-color":{"#$0":1,transparent:1,fixed:1},"background-image":{"url('/$0')":1},"background-repeat":{repeat:1,"repeat-x":1,"repeat-y":1,"no-repeat":1,inherit:1},"background-position":{bottom:2,center:2,left:2,right:2,top:2,inherit:2},"background-attachment":{scroll:1,fixed:1},"background-size":{cover:1,contain:1},"background-clip":{"border-box":1,"padding-box":1,"content-box":1},"background-origin":{"border-box":1,"padding-box":1,"content-box":1},border:{"solid $0":1,"dashed $0":1,"dotted $0":1,"#$0":1},"border-color":{"#$0":1},"border-style":{solid:2,dashed:2,dotted:2,"double":2,groove:2,hidden:2,inherit:2,inset:2,none:2,outset:2,ridged:2},"border-collapse":{collapse:1,separate:1},bottom:{px:1,em:1,"%":1},clear:{left:1,right:1,both:1,none:1},color:{"#$0":1,"rgb(#$00,0,0)":1},cursor:{"default":1,pointer:1,move:1,text:1,wait:1,help:1,progress:1,"n-resize":1,"ne-resize":1,"e-resize":1,"se-resize":1,"s-resize":1,"sw-resize":1,"w-resize":1,"nw-resize":1},display:{none:1,block:1,inline:1,"inline-block":1,"table-cell":1},"empty-cells":{show:1,hide:1},"float":{left:1,right:1,none:1},"font-family":{Arial:2,"Comic Sans MS":2,Consolas:2,"Courier New":2,Courier:2,Georgia:2,Monospace:2,"Sans-Serif":2,"Segoe UI":2,Tahoma:2,"Times New Roman":2,"Trebuchet MS":2,Verdana:1},"font-size":{px:1,em:1,"%":1},"font-weight":{bold:1,normal:1},"font-style":{italic:1,normal:1},"font-variant":{normal:1,"small-caps":1},height:{px:1,em:1,"%":1},left:{px:1,em:1,"%":1},"letter-spacing":{normal:1},"line-height":{normal:1},"list-style-type":{none:1,disc:1,circle:1,square:1,decimal:1,"decimal-leading-zero":1,"lower-roman":1,"upper-roman":1,"lower-greek":1,"lower-latin":1,"upper-latin":1,georgian:1,"lower-alpha":1,"upper-alpha":1},margin:{px:1,em:1,"%":1},"margin-right":{px:1,em:1,"%":1},"margin-left":{px:1,em:1,"%":1},"margin-top":{px:1,em:1,"%":1},"margin-bottom":{px:1,em:1,"%":1},"max-height":{px:1,em:1,"%":1},"max-width":{px:1,em:1,"%":1},"min-height":{px:1,em:1,"%":1},"min-width":{px:1,em:1,"%":1},overflow:{hidden:1,visible:1,auto:1,scroll:1},"overflow-x":{hidden:1,visible:1,auto:1,scroll:1},"overflow-y":{hidden:1,visible:1,auto:1,scroll:1},padding:{px:1,em:1,"%":1},"padding-top":{px:1,em:1,"%":1},"padding-right":{px:1,em:1,"%":1},"padding-bottom":{px:1,em:1,"%":1},"padding-left":{px:1,em:1,"%":1},"page-break-after":{auto:1,always:1,avoid:1,left:1,right:1},"page-break-before":{auto:1,always:1,avoid:1,left:1,right:1},position:{absolute:1,relative:1,fixed:1,"static":1},right:{px:1,em:1,"%":1},"table-layout":{fixed:1,auto:1},"text-decoration":{none:1,underline:1,"line-through":1,blink:1},"text-align":{left:1,right:1,center:1,justify:1},"text-transform":{capitalize:1,uppercase:1,lowercase:1,none:1},top:{px:1,em:1,"%":1},"vertical-align":{top:1,bottom:1},visibility:{hidden:1,visible:1},"white-space":{nowrap:1,normal:1,pre:1,"pre-line":1,"pre-wrap":1},width:{px:1,em:1,"%":1},"word-spacing":{normal:1},filter:{"alpha(opacity=$0100)":1},"text-shadow":{"$02px 2px 2px #777":1},"text-overflow":{"ellipsis-word":1,clip:1,ellipsis:1},"-moz-border-radius":1,"-moz-border-radius-topright":1,"-moz-border-radius-bottomright":1,"-moz-border-radius-topleft":1,"-moz-border-radius-bottomleft":1,"-webkit-border-radius":1,"-webkit-border-top-right-radius":1,"-webkit-border-top-left-radius":1,"-webkit-border-bottom-right-radius":1,"-webkit-border-bottom-left-radius":1,"-moz-box-shadow":1,"-webkit-box-shadow":1,transform:{"rotate($00deg)":1,"skew($00deg)":1},"-moz-transform":{"rotate($00deg)":1,"skew($00deg)":1},"-webkit-transform":{"rotate($00deg)":1,"skew($00deg)":1}},i=function(){};(function(){this.completionsDefined=!1,this.defineCompletions=function(){if(document){var e=document.createElement("c").style;for(var t in e){if(typeof e[t]!="string")continue;var n=t.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()});r.hasOwnProperty(n)||(r[n]=1)}}this.completionsDefined=!0},this.getCompletions=function(e,t,n,r){this.completionsDefined||this.defineCompletions();if(e==="ruleset"||t.$mode.$id=="ace/mode/scss"){var i=t.getLine(n.row).substr(0,n.column),s=/\([^)]*$/.test(i);return s&&(i=i.substr(i.lastIndexOf("(")+1)),/:[^;]+$/.test(i)?(/([\w\-]+):[^:]*$/.test(i),this.getPropertyValueCompletions(e,t,n,r)):this.getPropertyCompletions(e,t,n,r,s)}return[]},this.getPropertyCompletions=function(e,t,n,i,s){s=s||!1;var o=Object.keys(r);return o.map(function(e){return{caption:e,snippet:e+": $0"+(s?"":";"),meta:"property",score:1e6}})},this.getPropertyValueCompletions=function(e,t,n,i){var s=t.getLine(n.row).substr(0,n.column),o=(/([\w\-]+):[^:]*$/.exec(s)||{})[1];if(!o)return[];var u=[];return o in r&&typeof r[o]=="object"&&(u=Object.keys(r[o])),u.map(function(e){return{caption:e,snippet:e,meta:"property value",score:1e6}})}}).call(i.prototype),t.CssCompletions=i}),ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("./cstyle").CstyleBehaviour,o=e("../../token_iterator").TokenIterator,u=function(){this.inherit(s),this.add("colon","insertion",function(e,t,n,r,i){if(i===":"&&n.selection.isEmpty()){var s=n.getCursorPosition(),u=new o(r,s.row,s.column),a=u.getCurrentToken();a&&a.value.match(/\s+/)&&(a=u.stepBackward());if(a&&a.type==="support.type"){var f=r.doc.getLine(s.row),l=f.substring(s.column,s.column+1);if(l===":")return{text:"",selection:[1,1]};if(/^(\s+[^;]|\s*$)/.test(f.substring(s.column)))return{text:":;",selection:[1,1]}}}}),this.add("colon","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s===":"){var u=n.getCursorPosition(),a=new o(r,u.row,u.column),f=a.getCurrentToken();f&&f.value.match(/\s+/)&&(f=a.stepBackward());if(f&&f.type==="support.type"){var l=r.doc.getLine(i.start.row),c=l.substring(i.end.column,i.end.column+1);if(c===";")return i.end.column++,i}}}),this.add("semicolon","insertion",function(e,t,n,r,i){if(i===";"&&n.selection.isEmpty()){var s=n.getCursorPosition(),o=r.doc.getLine(s.row),u=o.substring(s.column,s.column+1);if(u===";")return{text:"",selection:[1,1]}}}),this.add("!important","insertion",function(e,t,n,r,i){if(i==="!"&&n.selection.isEmpty()){var s=n.getCursorPosition(),o=r.doc.getLine(s.row);if(/^\s*(;|}|$)/.test(o.substring(s.column)))return{text:"!important",selection:[10,10]}}})};r.inherits(u,s),t.CssBehaviour=u}),ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./css_highlight_rules").CssHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../worker/worker_client").WorkerClient,a=e("./css_completions").CssCompletions,f=e("./behaviour/css").CssBehaviour,l=e("./folding/cstyle").FoldMode,c=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new f,this.$completer=new a,this.foldingRules=new l};r.inherits(c,i),function(){this.foldingRules="cStyle",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e).tokens;if(i.length&&i[i.length-1].type=="comment")return r;var s=t.match(/^.*\{\s*$/);return s&&(r+=n),r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.getCompletions=function(e,t,n,r){return this.$completer.getCompletions(e,t,n,r)},this.createWorker=function(e){var t=new u(["ace"],"ace/mode/css_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/css",this.snippetFileId="ace/snippets/css"}.call(c.prototype),t.Mode=c}),ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(e){var t="[_:a-zA-Z\u00c0-\uffff][-_:.a-zA-Z0-9\u00c0-\uffff]*";this.$rules={start:[{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:["punctuation.instruction.xml","keyword.instruction.xml"],regex:"(<\\?)("+t+")",next:"processing_instruction"},{token:"comment.start.xml",regex:"<\\!--",next:"comment"},{token:["xml-pe.doctype.xml","xml-pe.doctype.xml"],regex:"(<\\!)(DOCTYPE)(?=[\\s])",next:"doctype",caseInsensitive:!0},{include:"tag"},{token:"text.end-tag-open.xml",regex:"",next:"start"}],doctype:[{include:"whitespace"},{include:"string"},{token:"xml-pe.doctype.xml",regex:">",next:"start"},{token:"xml-pe.xml",regex:"[-_a-zA-Z0-9:]+"},{token:"punctuation.int-subset",regex:"\\[",push:"int_subset"}],int_subset:[{token:"text.xml",regex:"\\s+"},{token:"punctuation.int-subset.xml",regex:"]",next:"pop"},{token:["punctuation.markup-decl.xml","keyword.markup-decl.xml"],regex:"(<\\!)("+t+")",push:[{token:"text",regex:"\\s+"},{token:"punctuation.markup-decl.xml",regex:">",next:"pop"},{include:"string"}]}],cdata:[{token:"string.cdata.xml",regex:"\\]\\]>",next:"start"},{token:"text.xml",regex:"\\s+"},{token:"text.xml",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment.end.xml",regex:"-->",next:"start"},{defaultToken:"comment.xml"}],reference:[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],attr_reference:[{token:"constant.language.escape.reference.attribute-value.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],tag:[{token:["meta.tag.punctuation.tag-open.xml","meta.tag.punctuation.end-tag-open.xml","meta.tag.tag-name.xml"],regex:"(?:(<)|(",next:"start"}]}],tag_whitespace:[{token:"text.tag-whitespace.xml",regex:"\\s+"}],whitespace:[{token:"text.whitespace.xml",regex:"\\s+"}],string:[{token:"string.xml",regex:"'",push:[{token:"string.xml",regex:"'",next:"pop"},{defaultToken:"string.xml"}]},{token:"string.xml",regex:'"',push:[{token:"string.xml",regex:'"',next:"pop"},{defaultToken:"string.xml"}]}],attributes:[{token:"entity.other.attribute-name.xml",regex:t},{token:"keyword.operator.attribute-equals.xml",regex:"="},{include:"tag_whitespace"},{include:"attribute_value"}],attribute_value:[{token:"string.attribute-value.xml",regex:"'",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]}]},this.constructor===s&&this.normalizeRules()};(function(){this.embedTagRules=function(e,t,n){this.$rules.tag.unshift({token:["meta.tag.punctuation.tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(<)("+n+"(?=\\s|>|$))",next:[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:t+"start"}]}),this.$rules[n+"-end"]=[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:"start",onMatch:function(e,t,n){return n.splice(0),this.token}}],this.embedRules(e,t,[{token:["meta.tag.punctuation.end-tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(|$))",next:n+"-end"},{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\["},{token:"string.cdata.xml",regex:"\\]\\]>"}])}}).call(i.prototype),r.inherits(s,i),t.XmlHighlightRules=s}),ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./css_highlight_rules").CssHighlightRules,o=e("./javascript_highlight_rules").JavaScriptHighlightRules,u=e("./xml_highlight_rules").XmlHighlightRules,a=i.createMap({a:"anchor",button:"form",form:"form",img:"image",input:"form",label:"form",option:"form",script:"script",select:"form",textarea:"form",style:"style",table:"table",tbody:"table",td:"table",tfoot:"table",th:"table",tr:"table"}),f=function(){u.call(this),this.addRules({attributes:[{include:"tag_whitespace"},{token:"entity.other.attribute-name.xml",regex:"[-_a-zA-Z0-9:.]+"},{token:"keyword.operator.attribute-equals.xml",regex:"=",push:[{include:"tag_whitespace"},{token:"string.unquoted.attribute-value.html",regex:"[^<>='\"`\\s]+",next:"pop"},{token:"empty",regex:"",next:"pop"}]},{include:"attribute_value"}],tag:[{token:function(e,t){var n=a[t];return["meta.tag.punctuation."+(e=="<"?"":"end-")+"tag-open.xml","meta.tag"+(n?"."+n:"")+".tag-name.xml"]},regex:"(",next:"start"}]}),this.embedTagRules(s,"css-","style"),this.embedTagRules((new o({jsx:!1})).getRules(),"js-","script"),this.constructor===f&&this.normalizeRules()};r.inherits(f,u),t.HtmlHighlightRules=f}),ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=t.FoldMode=function(e,t){this.defaultMode=e,this.subModes=t};r.inherits(s,i),function(){this.$getMode=function(e){typeof e!="string"&&(e=e[0]);for(var t in this.subModes)if(e.indexOf(t)===0)return this.subModes[t];return null},this.$tryMode=function(e,t,n,r){var i=this.$getMode(e);return i?i.getFoldWidget(t,n,r):""},this.getFoldWidget=function(e,t,n){return this.$tryMode(e.getState(n-1),e,t,n)||this.$tryMode(e.getState(n),e,t,n)||this.defaultMode.getFoldWidget(e,t,n)},this.getFoldWidgetRange=function(e,t,n){var r=this.$getMode(e.getState(n-1));if(!r||!r.getFoldWidget(e,t,n))r=this.$getMode(e.getState(n));if(!r||!r.getFoldWidget(e,t,n))r=this.defaultMode;return r.getFoldWidgetRange(e,t,n)}}.call(s.prototype)}),ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./mixed").FoldMode,s=e("./xml").FoldMode,o=e("./cstyle").FoldMode,u=t.FoldMode=function(e,t){i.call(this,new s(e,t),{"js-":new o,"css-":new o})};r.inherits(u,i)}),ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"],function(e,t,n){"use strict";function f(e,t){return e.type.lastIndexOf(t+".xml")>-1}function l(e,t){var n=new r(e,t.row,t.column),i=n.getCurrentToken();while(i&&!f(i,"tag-name"))i=n.stepBackward();if(i)return i.value}function c(e,t){var n=new r(e,t.row,t.column),i=n.getCurrentToken();while(i&&!f(i,"attribute-name"))i=n.stepBackward();if(i)return i.value}var r=e("../token_iterator").TokenIterator,i=["accesskey","class","contenteditable","contextmenu","dir","draggable","dropzone","hidden","id","inert","itemid","itemprop","itemref","itemscope","itemtype","lang","spellcheck","style","tabindex","title","translate"],s=["onabort","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncuechange","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onpause","onplay","onplaying","onprogress","onratechange","onreset","onscroll","onseeked","onseeking","onselect","onshow","onstalled","onsubmit","onsuspend","ontimeupdate","onvolumechange","onwaiting"],o=i.concat(s),u={a:{href:1,target:{_blank:1,top:1},ping:1,rel:{nofollow:1,alternate:1,author:1,bookmark:1,help:1,license:1,next:1,noreferrer:1,prefetch:1,prev:1,search:1,tag:1},media:1,hreflang:1,type:1},abbr:{},address:{},area:{shape:1,coords:1,href:1,hreflang:1,alt:1,target:1,media:1,rel:1,ping:1,type:1},article:{pubdate:1},aside:{},audio:{src:1,autobuffer:1,autoplay:{autoplay:1},loop:{loop:1},controls:{controls:1},muted:{muted:1},preload:{auto:1,metadata:1,none:1}},b:{},base:{href:1,target:1},bdi:{},bdo:{},blockquote:{cite:1},body:{onafterprint:1,onbeforeprint:1,onbeforeunload:1,onhashchange:1,onmessage:1,onoffline:1,onpopstate:1,onredo:1,onresize:1,onstorage:1,onundo:1,onunload:1},br:{},button:{autofocus:1,disabled:{disabled:1},form:1,formaction:1,formenctype:1,formmethod:1,formnovalidate:1,formtarget:1,name:1,value:1,type:{button:1,submit:1}},canvas:{width:1,height:1},caption:{},cite:{},code:{},col:{span:1},colgroup:{span:1},command:{type:1,label:1,icon:1,disabled:1,checked:1,radiogroup:1,command:1},data:{},datalist:{},dd:{},del:{cite:1,datetime:1},details:{open:1},dfn:{},dialog:{open:1},div:{},dl:{},dt:{},em:{},embed:{src:1,height:1,width:1,type:1},fieldset:{disabled:1,form:1,name:1},figcaption:{},figure:{},footer:{},form:{"accept-charset":1,action:1,autocomplete:1,enctype:{"multipart/form-data":1,"application/x-www-form-urlencoded":1},method:{get:1,post:1},name:1,novalidate:1,target:{_blank:1,top:1}},h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},head:{},header:{},hr:{},html:{manifest:1},i:{},iframe:{name:1,src:1,height:1,width:1,sandbox:{"allow-same-origin":1,"allow-top-navigation":1,"allow-forms":1,"allow-scripts":1},seamless:{seamless:1}},img:{alt:1,src:1,height:1,width:1,usemap:1,ismap:1},input:{type:{text:1,password:1,hidden:1,checkbox:1,submit:1,radio:1,file:1,button:1,reset:1,image:31,color:1,date:1,datetime:1,"datetime-local":1,email:1,month:1,number:1,range:1,search:1,tel:1,time:1,url:1,week:1},accept:1,alt:1,autocomplete:{on:1,off:1},autofocus:{autofocus:1},checked:{checked:1},disabled:{disabled:1},form:1,formaction:1,formenctype:{"application/x-www-form-urlencoded":1,"multipart/form-data":1,"text/plain":1},formmethod:{get:1,post:1},formnovalidate:{formnovalidate:1},formtarget:{_blank:1,_self:1,_parent:1,_top:1},height:1,list:1,max:1,maxlength:1,min:1,multiple:{multiple:1},name:1,pattern:1,placeholder:1,readonly:{readonly:1},required:{required:1},size:1,src:1,step:1,width:1,files:1,value:1},ins:{cite:1,datetime:1},kbd:{},keygen:{autofocus:1,challenge:{challenge:1},disabled:{disabled:1},form:1,keytype:{rsa:1,dsa:1,ec:1},name:1},label:{form:1,"for":1},legend:{},li:{value:1},link:{href:1,hreflang:1,rel:{stylesheet:1,icon:1},media:{all:1,screen:1,print:1},type:{"text/css":1,"image/png":1,"image/jpeg":1,"image/gif":1},sizes:1},main:{},map:{name:1},mark:{},math:{},menu:{type:1,label:1},meta:{"http-equiv":{"content-type":1},name:{description:1,keywords:1},content:{"text/html; charset=UTF-8":1},charset:1},meter:{value:1,min:1,max:1,low:1,high:1,optimum:1},nav:{},noscript:{href:1},object:{param:1,data:1,type:1,height:1,width:1,usemap:1,name:1,form:1,classid:1},ol:{start:1,reversed:1},optgroup:{disabled:1,label:1},option:{disabled:1,selected:1,label:1,value:1},output:{"for":1,form:1,name:1},p:{},param:{name:1,value:1},pre:{},progress:{value:1,max:1},q:{cite:1},rp:{},rt:{},ruby:{},s:{},samp:{},script:{charset:1,type:{"text/javascript":1},src:1,defer:1,async:1},select:{autofocus:1,disabled:1,form:1,multiple:{multiple:1},name:1,size:1,readonly:{readonly:1}},small:{},source:{src:1,type:1,media:1},span:{},strong:{},style:{type:1,media:{all:1,screen:1,print:1},scoped:1},sub:{},sup:{},svg:{},table:{summary:1},tbody:{},td:{headers:1,rowspan:1,colspan:1},textarea:{autofocus:{autofocus:1},disabled:{disabled:1},form:1,maxlength:1,name:1,placeholder:1,readonly:{readonly:1},required:{required:1},rows:1,cols:1,wrap:{on:1,off:1,hard:1,soft:1}},tfoot:{},th:{headers:1,rowspan:1,colspan:1,scope:1},thead:{},time:{datetime:1},title:{},tr:{},track:{kind:1,src:1,srclang:1,label:1,"default":1},section:{},summary:{},u:{},ul:{},"var":{},video:{src:1,autobuffer:1,autoplay:{autoplay:1},loop:{loop:1},controls:{controls:1},width:1,height:1,poster:1,muted:{muted:1},preload:{auto:1,metadata:1,none:1}},wbr:{}},a=Object.keys(u),h=function(){};(function(){this.getCompletions=function(e,t,n,r){var i=t.getTokenAt(n.row,n.column);if(!i)return[];if(f(i,"tag-name")||f(i,"tag-open")||f(i,"end-tag-open"))return this.getTagCompletions(e,t,n,r);if(f(i,"tag-whitespace")||f(i,"attribute-name"))return this.getAttributeCompletions(e,t,n,r);if(f(i,"attribute-value"))return this.getAttributeValueCompletions(e,t,n,r);var s=t.getLine(n.row).substr(0,n.column);return/&[a-z]*$/i.test(s)?this.getHTMLEntityCompletions(e,t,n,r):[]},this.getTagCompletions=function(e,t,n,r){return a.map(function(e){return{value:e,meta:"tag",score:1e6}})},this.getAttributeCompletions=function(e,t,n,r){var i=l(t,n);if(!i)return[];var s=o;return i in u&&(s=s.concat(Object.keys(u[i]))),s.map(function(e){return{caption:e,snippet:e+'="$0"',meta:"attribute",score:1e6}})},this.getAttributeValueCompletions=function(e,t,n,r){var i=l(t,n),s=c(t,n);if(!i)return[];var o=[];return i in u&&s in u[i]&&typeof u[i][s]=="object"&&(o=Object.keys(u[i][s])),o.map(function(e){return{caption:e,snippet:e,meta:"attribute value",score:1e6}})},this.getHTMLEntityCompletions=function(e,t,n,r){var i=["Aacute;","aacute;","Acirc;","acirc;","acute;","AElig;","aelig;","Agrave;","agrave;","alefsym;","Alpha;","alpha;","amp;","and;","ang;","Aring;","aring;","asymp;","Atilde;","atilde;","Auml;","auml;","bdquo;","Beta;","beta;","brvbar;","bull;","cap;","Ccedil;","ccedil;","cedil;","cent;","Chi;","chi;","circ;","clubs;","cong;","copy;","crarr;","cup;","curren;","Dagger;","dagger;","dArr;","darr;","deg;","Delta;","delta;","diams;","divide;","Eacute;","eacute;","Ecirc;","ecirc;","Egrave;","egrave;","empty;","emsp;","ensp;","Epsilon;","epsilon;","equiv;","Eta;","eta;","ETH;","eth;","Euml;","euml;","euro;","exist;","fnof;","forall;","frac12;","frac14;","frac34;","frasl;","Gamma;","gamma;","ge;","gt;","hArr;","harr;","hearts;","hellip;","Iacute;","iacute;","Icirc;","icirc;","iexcl;","Igrave;","igrave;","image;","infin;","int;","Iota;","iota;","iquest;","isin;","Iuml;","iuml;","Kappa;","kappa;","Lambda;","lambda;","lang;","laquo;","lArr;","larr;","lceil;","ldquo;","le;","lfloor;","lowast;","loz;","lrm;","lsaquo;","lsquo;","lt;","macr;","mdash;","micro;","middot;","minus;","Mu;","mu;","nabla;","nbsp;","ndash;","ne;","ni;","not;","notin;","nsub;","Ntilde;","ntilde;","Nu;","nu;","Oacute;","oacute;","Ocirc;","ocirc;","OElig;","oelig;","Ograve;","ograve;","oline;","Omega;","omega;","Omicron;","omicron;","oplus;","or;","ordf;","ordm;","Oslash;","oslash;","Otilde;","otilde;","otimes;","Ouml;","ouml;","para;","part;","permil;","perp;","Phi;","phi;","Pi;","pi;","piv;","plusmn;","pound;","Prime;","prime;","prod;","prop;","Psi;","psi;","quot;","radic;","rang;","raquo;","rArr;","rarr;","rceil;","rdquo;","real;","reg;","rfloor;","Rho;","rho;","rlm;","rsaquo;","rsquo;","sbquo;","Scaron;","scaron;","sdot;","sect;","shy;","Sigma;","sigma;","sigmaf;","sim;","spades;","sub;","sube;","sum;","sup;","sup1;","sup2;","sup3;","supe;","szlig;","Tau;","tau;","there4;","Theta;","theta;","thetasym;","thinsp;","THORN;","thorn;","tilde;","times;","trade;","Uacute;","uacute;","uArr;","uarr;","Ucirc;","ucirc;","Ugrave;","ugrave;","uml;","upsih;","Upsilon;","upsilon;","Uuml;","uuml;","weierp;","Xi;","xi;","Yacute;","yacute;","yen;","Yuml;","yuml;","Zeta;","zeta;","zwj;","zwnj;"];return i.map(function(e){return{caption:e,snippet:e,meta:"html entity",score:1e6}})}}).call(h.prototype),t.HtmlCompletions=h}),ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text").Mode,o=e("./javascript").Mode,u=e("./css").Mode,a=e("./html_highlight_rules").HtmlHighlightRules,f=e("./behaviour/xml").XmlBehaviour,l=e("./folding/html").FoldMode,c=e("./html_completions").HtmlCompletions,h=e("../worker/worker_client").WorkerClient,p=["area","base","br","col","embed","hr","img","input","keygen","link","meta","menuitem","param","source","track","wbr"],d=["li","dt","dd","p","rt","rp","optgroup","option","colgroup","td","th"],v=function(e){this.fragmentContext=e&&e.fragmentContext,this.HighlightRules=a,this.$behaviour=new f,this.$completer=new c,this.createModeDelegates({"js-":o,"css-":u}),this.foldingRules=new l(this.voidElements,i.arrayToMap(d))};r.inherits(v,s),function(){this.blockComment={start:""},this.voidElements=i.arrayToMap(p),this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.getCompletions=function(e,t,n,r){return this.$completer.getCompletions(e,t,n,r)},this.createWorker=function(e){if(this.constructor!=v)return;var t=new h(["ace"],"ace/mode/html_worker","Worker");return t.attachToDocument(e.getDocument()),this.fragmentContext&&t.call("setOptions",[{context:this.fragmentContext}]),t.on("error",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/html",this.snippetFileId="ace/snippets/html"}.call(v.prototype),t.Mode=v}); (function() { +ace.define("ace/mode/jsdoc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:["comment.doc.tag","comment.doc.text","lparen.doc"],regex:"(@(?:param|member|typedef|property|namespace|var|const|callback))(\\s*)({)",push:[{token:"lparen.doc",regex:"{",push:[{include:"doc-syntax"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"}]},{token:["rparen.doc","text.doc","variable.parameter.doc","lparen.doc","variable.parameter.doc","rparen.doc"],regex:/(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,next:"pop"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"},{include:"doc-syntax"},{defaultToken:"text.doc"}]},{token:["comment.doc.tag","text.doc","lparen.doc"],regex:"(@(?:returns?|yields|type|this|suppress|public|protected|private|package|modifies|implements|external|exception|throws|enum|define|extends))(\\s*)({)",push:[{token:"lparen.doc",regex:"{",push:[{include:"doc-syntax"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"}]},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"},{include:"doc-syntax"},{defaultToken:"text.doc"}]},{token:["comment.doc.tag","text.doc","variable.parameter.doc"],regex:'(@(?:alias|memberof|instance|module|name|lends|namespace|external|this|template|requires|param|implements|function|extends|typedef|mixes|constructor|var|memberof\\!|event|listens|exports|class|constructs|interface|emits|fires|throws|const|callback|borrows|augments))(\\s+)(\\w[\\w#.:/~"\\-]*)?'},{token:["comment.doc.tag","text.doc","variable.parameter.doc"],regex:"(@method)(\\s+)(\\w[\\w.\\(\\)]*)"},{token:"comment.doc.tag",regex:"@access\\s+(?:private|public|protected)"},{token:"comment.doc.tag",regex:"@kind\\s+(?:class|constant|event|external|file|function|member|mixin|module|namespace|typedef)"},{token:"comment.doc.tag",regex:"@\\w+(?=\\s|$)"},s.getTagRule(),{defaultToken:"comment.doc.body",caseInsensitive:!0}],"doc-syntax":[{token:"operator.doc",regex:/[|:]/},{token:"paren.doc",regex:/[\[\]]/}]},this.normalizeRules()};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:/\/\*\*(?!\/)/,next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.JsDocCommentHighlightRules=s}),ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/jsdoc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";function a(){var e=o.replace("\\d","\\d\\-"),t={onMatch:function(e,t,n){var r=e.charAt(1)=="/"?2:1;if(r==1)t!=this.nextState?n.unshift(this.next,this.nextState,0):n.unshift(this.next),n[2]++;else if(r==2&&t==this.nextState){n[1]--;if(!n[1]||n[1]<0)n.shift(),n.shift()}return[{type:"meta.tag.punctuation."+(r==1?"":"end-")+"tag-open.xml",value:e.slice(0,r)},{type:"meta.tag.tag-name.xml",value:e.substr(r)}]},regex:"))",next:"jsxAttributes",nextState:"jsx"};this.$rules.start.unshift(t);var n={regex:"{",token:"paren.quasi.start",push:"start"};this.$rules.jsx=[n,t,{include:"reference"},{defaultToken:"string.xml"}],this.$rules.jsxAttributes=[{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",onMatch:function(e,t,n){return t==n[0]&&n.shift(),e.length==2&&(n[0]==this.nextState&&n[1]--,(!n[1]||n[1]<0)&&n.splice(0,2)),this.next=n[0]||"start",[{type:this.token,value:e}]},nextState:"jsx"},n,f("jsxAttributes"),{token:"entity.other.attribute-name.xml",regex:e},{token:"keyword.operator.attribute-equals.xml",regex:"="},{token:"text.tag-whitespace.xml",regex:"\\s+"},{token:"string.attribute-value.xml",regex:"'",stateName:"jsx_attr_q",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',stateName:"jsx_attr_qq",push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},t],this.$rules.reference=[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}]}function f(e){return[{token:"comment",regex:/\/\*/,next:[i.getTagRule(),{token:"comment",regex:"\\*\\/",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]},{token:"comment",regex:"\\/\\/",next:[i.getTagRule(),{token:"comment",regex:"$|^",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]}]}var r=e("../lib/oop"),i=e("./jsdoc_comment_highlight_rules").JsDocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o="[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*",u=function(e){var t={"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",keyword:"const|yield|import|get|set|async|await|break|case|catch|continue|default|delete|do|else|finally|for|if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},n=this.createKeywordMapper(t,"identifier"),r="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",s="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u{[0-9a-fA-F]{1,6}}|[0-2][0-7]{0,2}|3[0-7][0-7]?|[4-7][0-7]?|.)",u="(function)(\\s*)(\\*?)",l={token:["identifier","text","paren.lparen"],regex:"(\\b(?!"+Object.values(t).join("|")+"\\b)"+o+")(\\s*)(\\()"};this.$rules={no_regex:[i.getStartRule("doc-start"),f("no_regex"),l,{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\s*)(=)(\\s*)"+u+"(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","storage.type","text","text","entity.name.function","text","paren.lparen"],regex:"(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))("+o+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\s*)(:)(\\s*)"+u+"(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)"+u+"(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"from(?=\\s*('|\"))"},{token:"keyword",regex:"(?:"+r+")\\b",next:"start"},{token:"support.constant",regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|debug|time|trace|timeEnd|assert)\b/},{token:n,regex:o},{token:"punctuation.operator",regex:/[.](?![.])/,next:"property"},{token:"storage.type",regex:/=>/,next:"start"},{token:"keyword.operator",regex:/--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],property:[{token:"text",regex:"\\s+"},{token:"keyword.operator",regex:/=/},{token:["storage.type","text","storage.type","text","paren.lparen"],regex:u+"(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","storage.type","text","text","entity.name.function","text","paren.lparen"],regex:"(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:"punctuation.operator",regex:/[.](?![.])/},{token:"support.function",regex:"prototype"},{token:"support.function",regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:"support.function.dom",regex:/(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:"support.constant",regex:/(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:"identifier",regex:o},{regex:"",token:"empty",next:"no_regex"}],start:[i.getStartRule("doc-start"),f("start"),{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],default_parameter:[{token:"string",regex:"'(?=.)",push:[{token:"string",regex:"'|$",next:"pop"},{include:"qstring"}]},{token:"string",regex:'"(?=.)',push:[{token:"string",regex:'"|$',next:"pop"},{include:"qqstring"}]},{token:"constant.language",regex:"null|Infinity|NaN|undefined"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/},{token:"punctuation.operator",regex:",",next:"function_arguments"},{token:"text",regex:"\\s+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],function_arguments:[f("function_arguments"),{token:"variable.parameter",regex:o},{token:"punctuation.operator",regex:","},{token:"text",regex:"\\s+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],qqstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]};if(!e||!e.noES6)this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(e,t,n){this.next=e=="{"?this.nextState:"";if(e=="{"&&n.length)n.unshift("start",t);else if(e=="}"&&n.length){n.shift(),this.next=n.shift();if(this.next.indexOf("string")!=-1||this.next.indexOf("jsx")!=-1)return"paren.quasi.end"}return e=="{"?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:s},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]},{token:["variable.parameter","text"],regex:"("+o+")(\\s*)(?=\\=>)"},{token:"paren.lparen",regex:"(\\()(?=[^\\(]+\\s*=>)",next:"function_arguments"},{token:"variable.language",regex:"(?:(?:(?:Weak)?(?:Set|Map))|Promise)\\b"}),this.$rules.function_arguments.unshift({token:"keyword.operator",regex:"=",next:"default_parameter"},{token:"keyword.operator",regex:"\\.{3}"}),this.$rules.property.unshift({token:"support.function",regex:"(findIndex|repeat|startsWith|endsWith|includes|isSafeInteger|trunc|cbrt|log2|log10|sign|then|catch|finally|resolve|reject|race|any|all|allSettled|keys|entries|isInteger)\\b(?=\\()"},{token:"constant.language",regex:"(?:MAX_SAFE_INTEGER|MIN_SAFE_INTEGER|EPSILON)\\b"}),(!e||e.jsx!=0)&&a.call(this);this.embedRules(i,"doc-",[i.getEndRule("no_regex")]),this.normalizeRules()};r.inherits(u,s),t.JavaScriptHighlightRules=u}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"],function(e,t,n){"use strict";function o(e,t){return e&&e.type.lastIndexOf(t+".xml")>-1}var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,u=function(){this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){var u=i,a=r.doc.getTextRange(n.getSelectionRange());if(a!==""&&a!=="'"&&a!='"'&&n.getWrapBehavioursEnabled())return{text:u+a+u,selection:!1};var f=n.getCursorPosition(),l=r.doc.getLine(f.row),c=l.substring(f.column,f.column+1),h=new s(r,f.row,f.column),p=h.getCurrentToken();if(c==u&&(o(p,"attribute-value")||o(p,"string")))return{text:"",selection:[1,1]};p||(p=h.stepBackward());if(!p)return;while(o(p,"tag-whitespace")||o(p,"whitespace"))p=h.stepBackward();var d=!c||c.match(/\s/);if(o(p,"attribute-equals")&&(d||c==">")||o(p,"decl-attribute-equals")&&(d||c=="?"))return{text:u+u,selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}}),this.add("autoclosing","insertion",function(e,t,n,r,i){if(i==">"){var u=n.getSelectionRange().start,a=new s(r,u.row,u.column),f=a.getCurrentToken()||a.stepBackward();if(!f||!(o(f,"tag-name")||o(f,"tag-whitespace")||o(f,"attribute-name")||o(f,"attribute-equals")||o(f,"attribute-value")))return;if(o(f,"reference.attribute-value"))return;if(o(f,"attribute-value")){var l=a.getCurrentTokenColumn()+f.value.length;if(u.column/.test(r.getLine(u.row).slice(u.column)))return;while(!o(f,"tag-name")){f=a.stepBackward();if(f.value=="<"){f=a.stepForward();break}}var h=a.getCurrentTokenRow(),p=a.getCurrentTokenColumn();if(o(a.stepBackward(),"end-tag-open"))return;var d=f.value;h==u.row&&(d=d.substring(0,u.column-p));if(this.voidElements&&this.voidElements.hasOwnProperty(d.toLowerCase()))return;return{text:">",selection:[1,1]}}}),this.add("autoindent","insertion",function(e,t,n,r,i){if(i=="\n"){var u=n.getCursorPosition(),a=r.getLine(u.row),f=new s(r,u.row,u.column),l=f.getCurrentToken();if(o(l,"")&&l.type.indexOf("tag-close")!==-1){if(l.value=="/>")return;while(l&&l.type.indexOf("tag-name")===-1)l=f.stepBackward();if(!l)return;var c=l.value,h=f.getCurrentTokenRow();l=f.stepBackward();if(!l||l.type.indexOf("end-tag")!==-1)return;if(this.voidElements&&!this.voidElements[c]||!this.voidElements){var p=r.getTokenAt(u.row,u.column+1),a=r.getLine(h),d=this.$getIndent(a),v=d+r.getTabString();return p&&p.value===""){var o=n.getSelectionRange().start,u=new i(r,o.row,o.column),a=u.getCurrentToken()||u.stepBackward();if(!a)return;if(a.value=="<")return{text:">",selection:[1,1]}}})};r.inherits(u,s),t.JavaScriptBehaviour=u}),ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";function a(e,t){return e.type.lastIndexOf(t+".xml")>-1}var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e,t){s.call(this),this.voidElements=e||{},this.optionalEndTags=r.mixin({},this.voidElements),t&&r.mixin(this.optionalEndTags,t)};r.inherits(o,s);var u=function(){this.tagName="",this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};(function(){this.getFoldWidget=function(e,t,n){var r=this._getFirstTagInLine(e,n);return r?r.closing||!r.tagName&&r.selfClosing?t==="markbeginend"?"end":"":!r.tagName||r.selfClosing||this.voidElements.hasOwnProperty(r.tagName.toLowerCase())?"":this._findEndTagInLine(e,n,r.tagName,r.end.column)?"":"start":this.getCommentFoldWidget(e,n)},this.getCommentFoldWidget=function(e,t){return/comment/.test(e.getState(t))&&/";break}}return r}if(a(s,"tag-close"))return r.selfClosing=s.value=="/>",r;r.start.column+=s.value.length}return null},this._findEndTagInLine=function(e,t,n,r){var i=e.getTokens(t),s=0;for(var o=0;of)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./xml").FoldMode,s=e("./cstyle").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end))),this.xmlFoldMode=new i};r.inherits(o,s),function(){this.getFoldWidgetRangeBase=this.getFoldWidgetRange,this.getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=this.getFoldWidgetBase(e,t,n);return r?r:this.xmlFoldMode.getFoldWidget(e,t,n)},this.getFoldWidgetRange=function(e,t,n,r){var i=this.getFoldWidgetRangeBase(e,t,n,r);return i?i:this.xmlFoldMode.getFoldWidgetRange(e,t,n)}}.call(o.prototype)}),ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript_highlight_rules").JavaScriptHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../worker/worker_client").WorkerClient,a=e("./behaviour/javascript").JavaScriptBehaviour,f=e("./folding/javascript").FoldMode,l=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new f};r.inherits(l,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.$quotes={'"':'"',"'":"'","`":"`"},this.$pairQuotesAfter={"`":/\w/},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"||e=="no_regex"){var u=t.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);u&&(r+=n)}else if(e=="doc-start")if(o=="start"||o=="no_regex")return"";return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new u(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/javascript",this.snippetFileId="ace/snippets/javascript"}.call(l.prototype),t.Mode=l}),ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=t.supportType="align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index",u=t.supportFunction="rgb|rgba|url|attr|counter|counters",a=t.supportConstant="absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|flex-end|flex-start|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero|zoom",f=t.supportConstantColor="aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen",l=t.supportConstantFonts="arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace",c=t.numRe="\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))",h=t.pseudoElements="(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",p=t.pseudoClasses="(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b",d=function(){var e=this.createKeywordMapper({"support.function":u,"support.constant":a,"support.type":o,"support.constant.color":f,"support.constant.fonts":l},"text",!0);this.$rules={start:[{include:["strings","url","comments"]},{token:"paren.lparen",regex:"\\{",next:"ruleset"},{token:"paren.rparen",regex:"\\}"},{token:"string",regex:"@(?!viewport)",next:"media"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"keyword",regex:"%"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant.numeric",regex:c},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:!0}],media:[{include:["strings","url","comments"]},{token:"paren.lparen",regex:"\\{",next:"start"},{token:"paren.rparen",regex:"\\}",next:"start"},{token:"string",regex:";",next:"start"},{token:"keyword",regex:"(?:media|supports|document|charset|import|namespace|media|supports|document|page|font|keyframes|viewport|counter-style|font-feature-values|swash|ornaments|annotation|stylistic|styleset|character-variant)"}],comments:[{token:"comment",regex:"\\/\\*",push:[{token:"comment",regex:"\\*\\/",next:"pop"},{defaultToken:"comment"}]}],ruleset:[{regex:"-(webkit|ms|moz|o)-",token:"text"},{token:"punctuation.operator",regex:"[:;]"},{token:"paren.rparen",regex:"\\}",next:"start"},{include:["strings","url","comments"]},{token:["constant.numeric","keyword"],regex:"("+c+")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"},{token:"constant.numeric",regex:c},{token:"constant.numeric",regex:"#[a-f0-9]{6}"},{token:"constant.numeric",regex:"#[a-f0-9]{3}"},{token:["punctuation","entity.other.attribute-name.pseudo-element.css"],regex:h},{token:["punctuation","entity.other.attribute-name.pseudo-class.css"],regex:p},{include:"url"},{token:e,regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"},{token:"paren.lparen",regex:"\\{"},{caseInsensitive:!0}],url:[{token:"support.function",regex:"(?:url(:?-prefix)?|domain|regexp)\\(",push:[{token:"support.function",regex:"\\)",next:"pop"},{defaultToken:"string"}]}],strings:[{token:"string.start",regex:"'",push:[{token:"string.end",regex:"'|$",next:"pop"},{include:"escapes"},{token:"constant.language.escape",regex:/\\$/,consumeLineEnd:!0},{defaultToken:"string"}]},{token:"string.start",regex:'"',push:[{token:"string.end",regex:'"|$',next:"pop"},{include:"escapes"},{token:"constant.language.escape",regex:/\\$/,consumeLineEnd:!0},{defaultToken:"string"}]}],escapes:[{token:"constant.language.escape",regex:/\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/}]},this.normalizeRules()};r.inherits(d,s),t.CssHighlightRules=d}),ace.define("ace/mode/css_completions",["require","exports","module"],function(e,t,n){"use strict";var r={background:{"#$0":1},"background-color":{"#$0":1,transparent:1,fixed:1},"background-image":{"url('/$0')":1},"background-repeat":{repeat:1,"repeat-x":1,"repeat-y":1,"no-repeat":1,inherit:1},"background-position":{bottom:2,center:2,left:2,right:2,top:2,inherit:2},"background-attachment":{scroll:1,fixed:1},"background-size":{cover:1,contain:1},"background-clip":{"border-box":1,"padding-box":1,"content-box":1},"background-origin":{"border-box":1,"padding-box":1,"content-box":1},border:{"solid $0":1,"dashed $0":1,"dotted $0":1,"#$0":1},"border-color":{"#$0":1},"border-style":{solid:2,dashed:2,dotted:2,"double":2,groove:2,hidden:2,inherit:2,inset:2,none:2,outset:2,ridged:2},"border-collapse":{collapse:1,separate:1},bottom:{px:1,em:1,"%":1},clear:{left:1,right:1,both:1,none:1},color:{"#$0":1,"rgb(#$00,0,0)":1},cursor:{"default":1,pointer:1,move:1,text:1,wait:1,help:1,progress:1,"n-resize":1,"ne-resize":1,"e-resize":1,"se-resize":1,"s-resize":1,"sw-resize":1,"w-resize":1,"nw-resize":1},display:{none:1,block:1,inline:1,"inline-block":1,"table-cell":1},"empty-cells":{show:1,hide:1},"float":{left:1,right:1,none:1},"font-family":{Arial:2,"Comic Sans MS":2,Consolas:2,"Courier New":2,Courier:2,Georgia:2,Monospace:2,"Sans-Serif":2,"Segoe UI":2,Tahoma:2,"Times New Roman":2,"Trebuchet MS":2,Verdana:1},"font-size":{px:1,em:1,"%":1},"font-weight":{bold:1,normal:1},"font-style":{italic:1,normal:1},"font-variant":{normal:1,"small-caps":1},height:{px:1,em:1,"%":1},left:{px:1,em:1,"%":1},"letter-spacing":{normal:1},"line-height":{normal:1},"list-style-type":{none:1,disc:1,circle:1,square:1,decimal:1,"decimal-leading-zero":1,"lower-roman":1,"upper-roman":1,"lower-greek":1,"lower-latin":1,"upper-latin":1,georgian:1,"lower-alpha":1,"upper-alpha":1},margin:{px:1,em:1,"%":1},"margin-right":{px:1,em:1,"%":1},"margin-left":{px:1,em:1,"%":1},"margin-top":{px:1,em:1,"%":1},"margin-bottom":{px:1,em:1,"%":1},"max-height":{px:1,em:1,"%":1},"max-width":{px:1,em:1,"%":1},"min-height":{px:1,em:1,"%":1},"min-width":{px:1,em:1,"%":1},overflow:{hidden:1,visible:1,auto:1,scroll:1},"overflow-x":{hidden:1,visible:1,auto:1,scroll:1},"overflow-y":{hidden:1,visible:1,auto:1,scroll:1},padding:{px:1,em:1,"%":1},"padding-top":{px:1,em:1,"%":1},"padding-right":{px:1,em:1,"%":1},"padding-bottom":{px:1,em:1,"%":1},"padding-left":{px:1,em:1,"%":1},"page-break-after":{auto:1,always:1,avoid:1,left:1,right:1},"page-break-before":{auto:1,always:1,avoid:1,left:1,right:1},position:{absolute:1,relative:1,fixed:1,"static":1},right:{px:1,em:1,"%":1},"table-layout":{fixed:1,auto:1},"text-decoration":{none:1,underline:1,"line-through":1,blink:1},"text-align":{left:1,right:1,center:1,justify:1},"text-transform":{capitalize:1,uppercase:1,lowercase:1,none:1},top:{px:1,em:1,"%":1},"vertical-align":{top:1,bottom:1},visibility:{hidden:1,visible:1},"white-space":{nowrap:1,normal:1,pre:1,"pre-line":1,"pre-wrap":1},width:{px:1,em:1,"%":1},"word-spacing":{normal:1},filter:{"alpha(opacity=$0100)":1},"text-shadow":{"$02px 2px 2px #777":1},"text-overflow":{"ellipsis-word":1,clip:1,ellipsis:1},"-moz-border-radius":1,"-moz-border-radius-topright":1,"-moz-border-radius-bottomright":1,"-moz-border-radius-topleft":1,"-moz-border-radius-bottomleft":1,"-webkit-border-radius":1,"-webkit-border-top-right-radius":1,"-webkit-border-top-left-radius":1,"-webkit-border-bottom-right-radius":1,"-webkit-border-bottom-left-radius":1,"-moz-box-shadow":1,"-webkit-box-shadow":1,transform:{"rotate($00deg)":1,"skew($00deg)":1},"-moz-transform":{"rotate($00deg)":1,"skew($00deg)":1},"-webkit-transform":{"rotate($00deg)":1,"skew($00deg)":1}},i=function(){};(function(){this.completionsDefined=!1,this.defineCompletions=function(){if(document){var e=document.createElement("c").style;for(var t in e){if(typeof e[t]!="string")continue;var n=t.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()});r.hasOwnProperty(n)||(r[n]=1)}}this.completionsDefined=!0},this.getCompletions=function(e,t,n,r){this.completionsDefined||this.defineCompletions();if(e==="ruleset"||t.$mode.$id=="ace/mode/scss"){var i=t.getLine(n.row).substr(0,n.column),s=/\([^)]*$/.test(i);return s&&(i=i.substr(i.lastIndexOf("(")+1)),/:[^;]+$/.test(i)?(/([\w\-]+):[^:]*$/.test(i),this.getPropertyValueCompletions(e,t,n,r)):this.getPropertyCompletions(e,t,n,r,s)}return[]},this.getPropertyCompletions=function(e,t,n,i,s){s=s||!1;var o=Object.keys(r);return o.map(function(e){return{caption:e,snippet:e+": $0"+(s?"":";"),meta:"property",score:1e6}})},this.getPropertyValueCompletions=function(e,t,n,i){var s=t.getLine(n.row).substr(0,n.column),o=(/([\w\-]+):[^:]*$/.exec(s)||{})[1];if(!o)return[];var u=[];return o in r&&typeof r[o]=="object"&&(u=Object.keys(r[o])),u.map(function(e){return{caption:e,snippet:e,meta:"property value",score:1e6}})}}).call(i.prototype),t.CssCompletions=i}),ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("./cstyle").CstyleBehaviour,o=e("../../token_iterator").TokenIterator,u=function(){this.inherit(s),this.add("colon","insertion",function(e,t,n,r,i){if(i===":"&&n.selection.isEmpty()){var s=n.getCursorPosition(),u=new o(r,s.row,s.column),a=u.getCurrentToken();a&&a.value.match(/\s+/)&&(a=u.stepBackward());if(a&&a.type==="support.type"){var f=r.doc.getLine(s.row),l=f.substring(s.column,s.column+1);if(l===":")return{text:"",selection:[1,1]};if(/^(\s+[^;]|\s*$)/.test(f.substring(s.column)))return{text:":;",selection:[1,1]}}}}),this.add("colon","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s===":"){var u=n.getCursorPosition(),a=new o(r,u.row,u.column),f=a.getCurrentToken();f&&f.value.match(/\s+/)&&(f=a.stepBackward());if(f&&f.type==="support.type"){var l=r.doc.getLine(i.start.row),c=l.substring(i.end.column,i.end.column+1);if(c===";")return i.end.column++,i}}}),this.add("semicolon","insertion",function(e,t,n,r,i){if(i===";"&&n.selection.isEmpty()){var s=n.getCursorPosition(),o=r.doc.getLine(s.row),u=o.substring(s.column,s.column+1);if(u===";")return{text:"",selection:[1,1]}}}),this.add("!important","insertion",function(e,t,n,r,i){if(i==="!"&&n.selection.isEmpty()){var s=n.getCursorPosition(),o=r.doc.getLine(s.row);if(/^\s*(;|}|$)/.test(o.substring(s.column)))return{text:"!important",selection:[10,10]}}})};r.inherits(u,s),t.CssBehaviour=u}),ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./css_highlight_rules").CssHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../worker/worker_client").WorkerClient,a=e("./css_completions").CssCompletions,f=e("./behaviour/css").CssBehaviour,l=e("./folding/cstyle").FoldMode,c=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new f,this.$completer=new a,this.foldingRules=new l};r.inherits(c,i),function(){this.foldingRules="cStyle",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e).tokens;if(i.length&&i[i.length-1].type=="comment")return r;var s=t.match(/^.*\{\s*$/);return s&&(r+=n),r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.getCompletions=function(e,t,n,r){return this.$completer.getCompletions(e,t,n,r)},this.createWorker=function(e){var t=new u(["ace"],"ace/mode/css_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/css",this.snippetFileId="ace/snippets/css"}.call(c.prototype),t.Mode=c}),ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(e){var t="[_:a-zA-Z\u00c0-\uffff][-_:.a-zA-Z0-9\u00c0-\uffff]*";this.$rules={start:[{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:["punctuation.instruction.xml","keyword.instruction.xml"],regex:"(<\\?)("+t+")",next:"processing_instruction"},{token:"comment.start.xml",regex:"<\\!--",next:"comment"},{token:["xml-pe.doctype.xml","xml-pe.doctype.xml"],regex:"(<\\!)(DOCTYPE)(?=[\\s])",next:"doctype",caseInsensitive:!0},{include:"tag"},{token:"text.end-tag-open.xml",regex:"",next:"start"}],doctype:[{include:"whitespace"},{include:"string"},{token:"xml-pe.doctype.xml",regex:">",next:"start"},{token:"xml-pe.xml",regex:"[-_a-zA-Z0-9:]+"},{token:"punctuation.int-subset",regex:"\\[",push:"int_subset"}],int_subset:[{token:"text.xml",regex:"\\s+"},{token:"punctuation.int-subset.xml",regex:"]",next:"pop"},{token:["punctuation.markup-decl.xml","keyword.markup-decl.xml"],regex:"(<\\!)("+t+")",push:[{token:"text",regex:"\\s+"},{token:"punctuation.markup-decl.xml",regex:">",next:"pop"},{include:"string"}]}],cdata:[{token:"string.cdata.xml",regex:"\\]\\]>",next:"start"},{token:"text.xml",regex:"\\s+"},{token:"text.xml",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment.end.xml",regex:"-->",next:"start"},{defaultToken:"comment.xml"}],reference:[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],attr_reference:[{token:"constant.language.escape.reference.attribute-value.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],tag:[{token:["meta.tag.punctuation.tag-open.xml","meta.tag.punctuation.end-tag-open.xml","meta.tag.tag-name.xml"],regex:"(?:(<)|(",next:"start"}]}],tag_whitespace:[{token:"text.tag-whitespace.xml",regex:"\\s+"}],whitespace:[{token:"text.whitespace.xml",regex:"\\s+"}],string:[{token:"string.xml",regex:"'",push:[{token:"string.xml",regex:"'",next:"pop"},{defaultToken:"string.xml"}]},{token:"string.xml",regex:'"',push:[{token:"string.xml",regex:'"',next:"pop"},{defaultToken:"string.xml"}]}],attributes:[{token:"entity.other.attribute-name.xml",regex:t},{token:"keyword.operator.attribute-equals.xml",regex:"="},{include:"tag_whitespace"},{include:"attribute_value"}],attribute_value:[{token:"string.attribute-value.xml",regex:"'",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]}]},this.constructor===s&&this.normalizeRules()};(function(){this.embedTagRules=function(e,t,n){this.$rules.tag.unshift({token:["meta.tag.punctuation.tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(<)("+n+"(?=\\s|>|$))",next:[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:t+"start"}]}),this.$rules[n+"-end"]=[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:"start",onMatch:function(e,t,n){return n.splice(0),this.token}}],this.embedRules(e,t,[{token:["meta.tag.punctuation.end-tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(|$))",next:n+"-end"},{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\["},{token:"string.cdata.xml",regex:"\\]\\]>"}])}}).call(i.prototype),r.inherits(s,i),t.XmlHighlightRules=s}),ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./css_highlight_rules").CssHighlightRules,o=e("./javascript_highlight_rules").JavaScriptHighlightRules,u=e("./xml_highlight_rules").XmlHighlightRules,a=i.createMap({a:"anchor",button:"form",form:"form",img:"image",input:"form",label:"form",option:"form",script:"script",select:"form",textarea:"form",style:"style",table:"table",tbody:"table",td:"table",tfoot:"table",th:"table",tr:"table"}),f=function(){u.call(this),this.addRules({attributes:[{include:"tag_whitespace"},{token:"entity.other.attribute-name.xml",regex:"[-_a-zA-Z0-9:.]+"},{token:"keyword.operator.attribute-equals.xml",regex:"=",push:[{include:"tag_whitespace"},{token:"string.unquoted.attribute-value.html",regex:"[^<>='\"`\\s]+",next:"pop"},{token:"empty",regex:"",next:"pop"}]},{include:"attribute_value"}],tag:[{token:function(e,t){var n=a[t];return["meta.tag.punctuation."+(e=="<"?"":"end-")+"tag-open.xml","meta.tag"+(n?"."+n:"")+".tag-name.xml"]},regex:"(",next:"start"}]}),this.embedTagRules(s,"css-","style"),this.embedTagRules((new o({jsx:!1})).getRules(),"js-","script"),this.constructor===f&&this.normalizeRules()};r.inherits(f,u),t.HtmlHighlightRules=f}),ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=t.FoldMode=function(e,t){this.defaultMode=e,this.subModes=t};r.inherits(s,i),function(){this.$getMode=function(e){typeof e!="string"&&(e=e[0]);for(var t in this.subModes)if(e.indexOf(t)===0)return this.subModes[t];return null},this.$tryMode=function(e,t,n,r){var i=this.$getMode(e);return i?i.getFoldWidget(t,n,r):""},this.getFoldWidget=function(e,t,n){return this.$tryMode(e.getState(n-1),e,t,n)||this.$tryMode(e.getState(n),e,t,n)||this.defaultMode.getFoldWidget(e,t,n)},this.getFoldWidgetRange=function(e,t,n){var r=this.$getMode(e.getState(n-1));if(!r||!r.getFoldWidget(e,t,n))r=this.$getMode(e.getState(n));if(!r||!r.getFoldWidget(e,t,n))r=this.defaultMode;return r.getFoldWidgetRange(e,t,n)}}.call(s.prototype)}),ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./mixed").FoldMode,s=e("./xml").FoldMode,o=e("./cstyle").FoldMode,u=t.FoldMode=function(e,t){i.call(this,new s(e,t),{"js-":new o,"css-":new o})};r.inherits(u,i)}),ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"],function(e,t,n){"use strict";function f(e,t){return e.type.lastIndexOf(t+".xml")>-1}function l(e,t){var n=new r(e,t.row,t.column),i=n.getCurrentToken();while(i&&!f(i,"tag-name"))i=n.stepBackward();if(i)return i.value}function c(e,t){var n=new r(e,t.row,t.column),i=n.getCurrentToken();while(i&&!f(i,"attribute-name"))i=n.stepBackward();if(i)return i.value}var r=e("../token_iterator").TokenIterator,i=["accesskey","class","contenteditable","contextmenu","dir","draggable","dropzone","hidden","id","inert","itemid","itemprop","itemref","itemscope","itemtype","lang","spellcheck","style","tabindex","title","translate"],s=["onabort","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncuechange","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onpause","onplay","onplaying","onprogress","onratechange","onreset","onscroll","onseeked","onseeking","onselect","onshow","onstalled","onsubmit","onsuspend","ontimeupdate","onvolumechange","onwaiting"],o=i.concat(s),u={a:{href:1,target:{_blank:1,top:1},ping:1,rel:{nofollow:1,alternate:1,author:1,bookmark:1,help:1,license:1,next:1,noreferrer:1,prefetch:1,prev:1,search:1,tag:1},media:1,hreflang:1,type:1},abbr:{},address:{},area:{shape:1,coords:1,href:1,hreflang:1,alt:1,target:1,media:1,rel:1,ping:1,type:1},article:{pubdate:1},aside:{},audio:{src:1,autobuffer:1,autoplay:{autoplay:1},loop:{loop:1},controls:{controls:1},muted:{muted:1},preload:{auto:1,metadata:1,none:1}},b:{},base:{href:1,target:1},bdi:{},bdo:{},blockquote:{cite:1},body:{onafterprint:1,onbeforeprint:1,onbeforeunload:1,onhashchange:1,onmessage:1,onoffline:1,onpopstate:1,onredo:1,onresize:1,onstorage:1,onundo:1,onunload:1},br:{},button:{autofocus:1,disabled:{disabled:1},form:1,formaction:1,formenctype:1,formmethod:1,formnovalidate:1,formtarget:1,name:1,value:1,type:{button:1,submit:1}},canvas:{width:1,height:1},caption:{},cite:{},code:{},col:{span:1},colgroup:{span:1},command:{type:1,label:1,icon:1,disabled:1,checked:1,radiogroup:1,command:1},data:{},datalist:{},dd:{},del:{cite:1,datetime:1},details:{open:1},dfn:{},dialog:{open:1},div:{},dl:{},dt:{},em:{},embed:{src:1,height:1,width:1,type:1},fieldset:{disabled:1,form:1,name:1},figcaption:{},figure:{},footer:{},form:{"accept-charset":1,action:1,autocomplete:1,enctype:{"multipart/form-data":1,"application/x-www-form-urlencoded":1},method:{get:1,post:1},name:1,novalidate:1,target:{_blank:1,top:1}},h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},head:{},header:{},hr:{},html:{manifest:1},i:{},iframe:{name:1,src:1,height:1,width:1,sandbox:{"allow-same-origin":1,"allow-top-navigation":1,"allow-forms":1,"allow-scripts":1},seamless:{seamless:1}},img:{alt:1,src:1,height:1,width:1,usemap:1,ismap:1},input:{type:{text:1,password:1,hidden:1,checkbox:1,submit:1,radio:1,file:1,button:1,reset:1,image:31,color:1,date:1,datetime:1,"datetime-local":1,email:1,month:1,number:1,range:1,search:1,tel:1,time:1,url:1,week:1},accept:1,alt:1,autocomplete:{on:1,off:1},autofocus:{autofocus:1},checked:{checked:1},disabled:{disabled:1},form:1,formaction:1,formenctype:{"application/x-www-form-urlencoded":1,"multipart/form-data":1,"text/plain":1},formmethod:{get:1,post:1},formnovalidate:{formnovalidate:1},formtarget:{_blank:1,_self:1,_parent:1,_top:1},height:1,list:1,max:1,maxlength:1,min:1,multiple:{multiple:1},name:1,pattern:1,placeholder:1,readonly:{readonly:1},required:{required:1},size:1,src:1,step:1,width:1,files:1,value:1},ins:{cite:1,datetime:1},kbd:{},keygen:{autofocus:1,challenge:{challenge:1},disabled:{disabled:1},form:1,keytype:{rsa:1,dsa:1,ec:1},name:1},label:{form:1,"for":1},legend:{},li:{value:1},link:{href:1,hreflang:1,rel:{stylesheet:1,icon:1},media:{all:1,screen:1,print:1},type:{"text/css":1,"image/png":1,"image/jpeg":1,"image/gif":1},sizes:1},main:{},map:{name:1},mark:{},math:{},menu:{type:1,label:1},meta:{"http-equiv":{"content-type":1},name:{description:1,keywords:1},content:{"text/html; charset=UTF-8":1},charset:1},meter:{value:1,min:1,max:1,low:1,high:1,optimum:1},nav:{},noscript:{href:1},object:{param:1,data:1,type:1,height:1,width:1,usemap:1,name:1,form:1,classid:1},ol:{start:1,reversed:1},optgroup:{disabled:1,label:1},option:{disabled:1,selected:1,label:1,value:1},output:{"for":1,form:1,name:1},p:{},param:{name:1,value:1},pre:{},progress:{value:1,max:1},q:{cite:1},rp:{},rt:{},ruby:{},s:{},samp:{},script:{charset:1,type:{"text/javascript":1},src:1,defer:1,async:1},select:{autofocus:1,disabled:1,form:1,multiple:{multiple:1},name:1,size:1,readonly:{readonly:1}},small:{},source:{src:1,type:1,media:1},span:{},strong:{},style:{type:1,media:{all:1,screen:1,print:1},scoped:1},sub:{},sup:{},svg:{},table:{summary:1},tbody:{},td:{headers:1,rowspan:1,colspan:1},textarea:{autofocus:{autofocus:1},disabled:{disabled:1},form:1,maxlength:1,name:1,placeholder:1,readonly:{readonly:1},required:{required:1},rows:1,cols:1,wrap:{on:1,off:1,hard:1,soft:1}},tfoot:{},th:{headers:1,rowspan:1,colspan:1,scope:1},thead:{},time:{datetime:1},title:{},tr:{},track:{kind:1,src:1,srclang:1,label:1,"default":1},section:{},summary:{},u:{},ul:{},"var":{},video:{src:1,autobuffer:1,autoplay:{autoplay:1},loop:{loop:1},controls:{controls:1},width:1,height:1,poster:1,muted:{muted:1},preload:{auto:1,metadata:1,none:1}},wbr:{}},a=Object.keys(u),h=function(){};(function(){this.getCompletions=function(e,t,n,r){var i=t.getTokenAt(n.row,n.column);if(!i)return[];if(f(i,"tag-name")||f(i,"tag-open")||f(i,"end-tag-open"))return this.getTagCompletions(e,t,n,r);if(f(i,"tag-whitespace")||f(i,"attribute-name"))return this.getAttributeCompletions(e,t,n,r);if(f(i,"attribute-value"))return this.getAttributeValueCompletions(e,t,n,r);var s=t.getLine(n.row).substr(0,n.column);return/&[a-z]*$/i.test(s)?this.getHTMLEntityCompletions(e,t,n,r):[]},this.getTagCompletions=function(e,t,n,r){return a.map(function(e){return{value:e,meta:"tag",score:1e6}})},this.getAttributeCompletions=function(e,t,n,r){var i=l(t,n);if(!i)return[];var s=o;return i in u&&(s=s.concat(Object.keys(u[i]))),s.map(function(e){return{caption:e,snippet:e+'="$0"',meta:"attribute",score:1e6}})},this.getAttributeValueCompletions=function(e,t,n,r){var i=l(t,n),s=c(t,n);if(!i)return[];var o=[];return i in u&&s in u[i]&&typeof u[i][s]=="object"&&(o=Object.keys(u[i][s])),o.map(function(e){return{caption:e,snippet:e,meta:"attribute value",score:1e6}})},this.getHTMLEntityCompletions=function(e,t,n,r){var i=["Aacute;","aacute;","Acirc;","acirc;","acute;","AElig;","aelig;","Agrave;","agrave;","alefsym;","Alpha;","alpha;","amp;","and;","ang;","Aring;","aring;","asymp;","Atilde;","atilde;","Auml;","auml;","bdquo;","Beta;","beta;","brvbar;","bull;","cap;","Ccedil;","ccedil;","cedil;","cent;","Chi;","chi;","circ;","clubs;","cong;","copy;","crarr;","cup;","curren;","Dagger;","dagger;","dArr;","darr;","deg;","Delta;","delta;","diams;","divide;","Eacute;","eacute;","Ecirc;","ecirc;","Egrave;","egrave;","empty;","emsp;","ensp;","Epsilon;","epsilon;","equiv;","Eta;","eta;","ETH;","eth;","Euml;","euml;","euro;","exist;","fnof;","forall;","frac12;","frac14;","frac34;","frasl;","Gamma;","gamma;","ge;","gt;","hArr;","harr;","hearts;","hellip;","Iacute;","iacute;","Icirc;","icirc;","iexcl;","Igrave;","igrave;","image;","infin;","int;","Iota;","iota;","iquest;","isin;","Iuml;","iuml;","Kappa;","kappa;","Lambda;","lambda;","lang;","laquo;","lArr;","larr;","lceil;","ldquo;","le;","lfloor;","lowast;","loz;","lrm;","lsaquo;","lsquo;","lt;","macr;","mdash;","micro;","middot;","minus;","Mu;","mu;","nabla;","nbsp;","ndash;","ne;","ni;","not;","notin;","nsub;","Ntilde;","ntilde;","Nu;","nu;","Oacute;","oacute;","Ocirc;","ocirc;","OElig;","oelig;","Ograve;","ograve;","oline;","Omega;","omega;","Omicron;","omicron;","oplus;","or;","ordf;","ordm;","Oslash;","oslash;","Otilde;","otilde;","otimes;","Ouml;","ouml;","para;","part;","permil;","perp;","Phi;","phi;","Pi;","pi;","piv;","plusmn;","pound;","Prime;","prime;","prod;","prop;","Psi;","psi;","quot;","radic;","rang;","raquo;","rArr;","rarr;","rceil;","rdquo;","real;","reg;","rfloor;","Rho;","rho;","rlm;","rsaquo;","rsquo;","sbquo;","Scaron;","scaron;","sdot;","sect;","shy;","Sigma;","sigma;","sigmaf;","sim;","spades;","sub;","sube;","sum;","sup;","sup1;","sup2;","sup3;","supe;","szlig;","Tau;","tau;","there4;","Theta;","theta;","thetasym;","thinsp;","THORN;","thorn;","tilde;","times;","trade;","Uacute;","uacute;","uArr;","uarr;","Ucirc;","ucirc;","Ugrave;","ugrave;","uml;","upsih;","Upsilon;","upsilon;","Uuml;","uuml;","weierp;","Xi;","xi;","Yacute;","yacute;","yen;","Yuml;","yuml;","Zeta;","zeta;","zwj;","zwnj;"];return i.map(function(e){return{caption:e,snippet:e,meta:"html entity",score:1e6}})}}).call(h.prototype),t.HtmlCompletions=h}),ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text").Mode,o=e("./javascript").Mode,u=e("./css").Mode,a=e("./html_highlight_rules").HtmlHighlightRules,f=e("./behaviour/xml").XmlBehaviour,l=e("./folding/html").FoldMode,c=e("./html_completions").HtmlCompletions,h=e("../worker/worker_client").WorkerClient,p=["area","base","br","col","embed","hr","img","input","keygen","link","meta","menuitem","param","source","track","wbr"],d=["li","dt","dd","p","rt","rp","optgroup","option","colgroup","td","th"],v=function(e){this.fragmentContext=e&&e.fragmentContext,this.HighlightRules=a,this.$behaviour=new f,this.$completer=new c,this.createModeDelegates({"js-":o,"css-":u}),this.foldingRules=new l(this.voidElements,i.arrayToMap(d))};r.inherits(v,s),function(){this.blockComment={start:""},this.voidElements=i.arrayToMap(p),this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.getCompletions=function(e,t,n,r){return this.$completer.getCompletions(e,t,n,r)},this.createWorker=function(e){if(this.constructor!=v)return;var t=new h(["ace"],"ace/mode/html_worker","Worker");return t.attachToDocument(e.getDocument()),this.fragmentContext&&t.call("setOptions",[{context:this.fragmentContext}]),t.on("error",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/html",this.snippetFileId="ace/snippets/html"}.call(v.prototype),t.Mode=v}); (function() { ace.require(["ace/mode/html"], function(m) { if ( true && module) { module.exports = m; @@ -54,7 +54,7 @@ ace.define("ace/mode/jsdoc_comment_highlight_rules",["require","exports","module /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* module decorator */ module = __webpack_require__.nmd(module); -ace.define("ace/mode/jsdoc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:["comment.doc.tag","comment.doc.text","lparen.doc"],regex:"(@(?:param|member|typedef|property|namespace|var|const|callback))(\\s*)({)",push:[{token:"lparen.doc",regex:"{",push:[{include:"doc-syntax"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"}]},{token:["rparen.doc","text.doc","variable.parameter.doc","lparen.doc","variable.parameter.doc","rparen.doc"],regex:/(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,next:"pop"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"},{include:"doc-syntax"},{defaultToken:"text.doc"}]},{token:["comment.doc.tag","text.doc","lparen.doc"],regex:"(@(?:returns?|yields|type|this|suppress|public|protected|private|package|modifies|implements|external|exception|throws|enum|define|extends))(\\s*)({)",push:[{token:"lparen.doc",regex:"{",push:[{include:"doc-syntax"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"}]},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"},{include:"doc-syntax"},{defaultToken:"text.doc"}]},{token:["comment.doc.tag","text.doc","variable.parameter.doc"],regex:'(@(?:alias|memberof|instance|module|name|lends|namespace|external|this|template|requires|param|implements|function|extends|typedef|mixes|constructor|var|memberof\\!|event|listens|exports|class|constructs|interface|emits|fires|throws|const|callback|borrows|augments))(\\s+)(\\w[\\w#.:/~"\\-]*)?'},{token:["comment.doc.tag","text.doc","variable.parameter.doc"],regex:"(@method)(\\s+)(\\w[\\w.\\(\\)]*)"},{token:"comment.doc.tag",regex:"@access\\s+(?:private|public|protected)"},{token:"comment.doc.tag",regex:"@kind\\s+(?:class|constant|event|external|file|function|member|mixin|module|namespace|typedef)"},{token:"comment.doc.tag",regex:"@\\w+(?=\\s|$)"},s.getTagRule(),{defaultToken:"comment.doc.body",caseInsensitive:!0}],"doc-syntax":[{token:"operator.doc",regex:/[|:]/},{token:"paren.doc",regex:/[\[\]]/}]},this.normalizeRules()};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:/\/\*\*(?!\/)/,next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.JsDocCommentHighlightRules=s}),ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/jsdoc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";function a(){var e=o.replace("\\d","\\d\\-"),t={onMatch:function(e,t,n){var r=e.charAt(1)=="/"?2:1;if(r==1)t!=this.nextState?n.unshift(this.next,this.nextState,0):n.unshift(this.next),n[2]++;else if(r==2&&t==this.nextState){n[1]--;if(!n[1]||n[1]<0)n.shift(),n.shift()}return[{type:"meta.tag.punctuation."+(r==1?"":"end-")+"tag-open.xml",value:e.slice(0,r)},{type:"meta.tag.tag-name.xml",value:e.substr(r)}]},regex:"))",next:"jsxAttributes",nextState:"jsx"};this.$rules.start.unshift(t);var n={regex:"{",token:"paren.quasi.start",push:"start"};this.$rules.jsx=[n,t,{include:"reference"},{defaultToken:"string.xml"}],this.$rules.jsxAttributes=[{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",onMatch:function(e,t,n){return t==n[0]&&n.shift(),e.length==2&&(n[0]==this.nextState&&n[1]--,(!n[1]||n[1]<0)&&n.splice(0,2)),this.next=n[0]||"start",[{type:this.token,value:e}]},nextState:"jsx"},n,f("jsxAttributes"),{token:"entity.other.attribute-name.xml",regex:e},{token:"keyword.operator.attribute-equals.xml",regex:"="},{token:"text.tag-whitespace.xml",regex:"\\s+"},{token:"string.attribute-value.xml",regex:"'",stateName:"jsx_attr_q",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',stateName:"jsx_attr_qq",push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},t],this.$rules.reference=[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}]}function f(e){return[{token:"comment",regex:/\/\*/,next:[i.getTagRule(),{token:"comment",regex:"\\*\\/",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]},{token:"comment",regex:"\\/\\/",next:[i.getTagRule(),{token:"comment",regex:"$|^",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]}]}var r=e("../lib/oop"),i=e("./jsdoc_comment_highlight_rules").JsDocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o="[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*",u=function(e){var t={"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",keyword:"const|yield|import|get|set|async|await|break|case|catch|continue|default|delete|do|else|finally|for|if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},n=this.createKeywordMapper(t,"identifier"),r="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",s="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u{[0-9a-fA-F]{1,6}}|[0-2][0-7]{0,2}|3[0-7][0-7]?|[4-7][0-7]?|.)",u="(function)(\\s*)(\\*?)",l={token:["identifier","text","paren.lparen"],regex:"(\\b(?!"+Object.values(t).join("|")+"\\b)"+o+")(\\s*)(\\()"};this.$rules={no_regex:[i.getStartRule("doc-start"),f("no_regex"),l,{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\s*)(=)(\\s*)"+u+"(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","storage.type","text","text","entity.name.function","text","paren.lparen"],regex:"(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))("+o+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\s*)(:)(\\s*)"+u+"(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)"+u+"(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"from(?=\\s*('|\"))"},{token:"keyword",regex:"(?:"+r+")\\b",next:"start"},{token:"support.constant",regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|debug|time|trace|timeEnd|assert)\b/},{token:n,regex:o},{token:"punctuation.operator",regex:/[.](?![.])/,next:"property"},{token:"storage.type",regex:/=>/,next:"start"},{token:"keyword.operator",regex:/--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],property:[{token:"text",regex:"\\s+"},{token:"keyword.operator",regex:/=/},{token:["storage.type","text","storage.type","text","paren.lparen"],regex:u+"(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","storage.type","text","text","entity.name.function","text","paren.lparen"],regex:"(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:"punctuation.operator",regex:/[.](?![.])/},{token:"support.function",regex:"prototype"},{token:"support.function",regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:"support.function.dom",regex:/(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:"support.constant",regex:/(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:"identifier",regex:o},{regex:"",token:"empty",next:"no_regex"}],start:[i.getStartRule("doc-start"),f("start"),{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],default_parameter:[{token:"string",regex:"'(?=.)",push:[{token:"string",regex:"'|$",next:"pop"},{include:"qstring"}]},{token:"string",regex:'"(?=.)',push:[{token:"string",regex:'"|$',next:"pop"},{include:"qqstring"}]},{token:"constant.language",regex:"null|Infinity|NaN|undefined"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/},{token:"punctuation.operator",regex:",",next:"function_arguments"},{token:"text",regex:"\\s+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],function_arguments:[f("function_arguments"),{token:"variable.parameter",regex:o},{token:"punctuation.operator",regex:","},{token:"text",regex:"\\s+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],qqstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]};if(!e||!e.noES6)this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(e,t,n){this.next=e=="{"?this.nextState:"";if(e=="{"&&n.length)n.unshift("start",t);else if(e=="}"&&n.length){n.shift(),this.next=n.shift();if(this.next.indexOf("string")!=-1||this.next.indexOf("jsx")!=-1)return"paren.quasi.end"}return e=="{"?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:s},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]},{token:["variable.parameter","text"],regex:"("+o+")(\\s*)(?=\\=>)"},{token:"paren.lparen",regex:"(\\()(?=[^\\(]+\\s*=>)",next:"function_arguments"},{token:"variable.language",regex:"(?:(?:(?:Weak)?(?:Set|Map))|Promise)\\b"}),this.$rules.function_arguments.unshift({token:"keyword.operator",regex:"=",next:"default_parameter"},{token:"keyword.operator",regex:"\\.{3}"}),this.$rules.property.unshift({token:"support.function",regex:"(findIndex|repeat|startsWith|endsWith|includes|isSafeInteger|trunc|cbrt|log2|log10|sign|then|catch|finally|resolve|reject|race|any|all|allSettled|keys|entries|isInteger)\\b(?=\\()"},{token:"constant.language",regex:"(?:MAX_SAFE_INTEGER|MIN_SAFE_INTEGER|EPSILON)\\b"}),(!e||e.jsx!=0)&&a.call(this);this.embedRules(i,"doc-",[i.getEndRule("no_regex")]),this.normalizeRules()};r.inherits(u,s),t.JavaScriptHighlightRules=u}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"],function(e,t,n){"use strict";function o(e,t){return e&&e.type.lastIndexOf(t+".xml")>-1}var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,u=function(){this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){var u=i,a=r.doc.getTextRange(n.getSelectionRange());if(a!==""&&a!=="'"&&a!='"'&&n.getWrapBehavioursEnabled())return{text:u+a+u,selection:!1};var f=n.getCursorPosition(),l=r.doc.getLine(f.row),c=l.substring(f.column,f.column+1),h=new s(r,f.row,f.column),p=h.getCurrentToken();if(c==u&&(o(p,"attribute-value")||o(p,"string")))return{text:"",selection:[1,1]};p||(p=h.stepBackward());if(!p)return;while(o(p,"tag-whitespace")||o(p,"whitespace"))p=h.stepBackward();var d=!c||c.match(/\s/);if(o(p,"attribute-equals")&&(d||c==">")||o(p,"decl-attribute-equals")&&(d||c=="?"))return{text:u+u,selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}}),this.add("autoclosing","insertion",function(e,t,n,r,i){if(i==">"){var u=n.getSelectionRange().start,a=new s(r,u.row,u.column),f=a.getCurrentToken()||a.stepBackward();if(!f||!(o(f,"tag-name")||o(f,"tag-whitespace")||o(f,"attribute-name")||o(f,"attribute-equals")||o(f,"attribute-value")))return;if(o(f,"reference.attribute-value"))return;if(o(f,"attribute-value")){var l=a.getCurrentTokenColumn()+f.value.length;if(u.column/.test(r.getLine(u.row).slice(u.column)))return;while(!o(f,"tag-name")){f=a.stepBackward();if(f.value=="<"){f=a.stepForward();break}}var h=a.getCurrentTokenRow(),p=a.getCurrentTokenColumn();if(o(a.stepBackward(),"end-tag-open"))return;var d=f.value;h==u.row&&(d=d.substring(0,u.column-p));if(this.voidElements&&this.voidElements.hasOwnProperty(d.toLowerCase()))return;return{text:">",selection:[1,1]}}}),this.add("autoindent","insertion",function(e,t,n,r,i){if(i=="\n"){var u=n.getCursorPosition(),a=r.getLine(u.row),f=new s(r,u.row,u.column),l=f.getCurrentToken();if(o(l,"")&&l.type.indexOf("tag-close")!==-1){if(l.value=="/>")return;while(l&&l.type.indexOf("tag-name")===-1)l=f.stepBackward();if(!l)return;var c=l.value,h=f.getCurrentTokenRow();l=f.stepBackward();if(!l||l.type.indexOf("end-tag")!==-1)return;if(this.voidElements&&!this.voidElements[c]||!this.voidElements){var p=r.getTokenAt(u.row,u.column+1),a=r.getLine(h),d=this.$getIndent(a),v=d+r.getTabString();return p&&p.value===""){var o=n.getSelectionRange().start,u=new i(r,o.row,o.column),a=u.getCurrentToken()||u.stepBackward();if(!a)return;if(a.value=="<")return{text:">",selection:[1,1]}}})};r.inherits(u,s),t.JavaScriptBehaviour=u}),ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";function a(e,t){return e&&e.type&&e.type.lastIndexOf(t+".xml")>-1}var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e,t){s.call(this),this.voidElements=e||{},this.optionalEndTags=r.mixin({},this.voidElements),t&&r.mixin(this.optionalEndTags,t)};r.inherits(o,s);var u=function(){this.tagName="",this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};(function(){this.getFoldWidget=function(e,t,n){var r=this._getFirstTagInLine(e,n);return r?r.closing||!r.tagName&&r.selfClosing?t==="markbeginend"?"end":"":!r.tagName||r.selfClosing||this.voidElements.hasOwnProperty(r.tagName.toLowerCase())?"":this._findEndTagInLine(e,n,r.tagName,r.end.column)?"":"start":this.getCommentFoldWidget(e,n)},this.getCommentFoldWidget=function(e,t){return/comment/.test(e.getState(t))&&/";break}}return r}if(a(s,"tag-close"))return r.selfClosing=s.value=="/>",r;r.start.column+=s.value.length}return null},this._findEndTagInLine=function(e,t,n,r){var i=e.getTokens(t),s=0;for(var o=0;of)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./xml").FoldMode,s=e("./cstyle").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end))),this.xmlFoldMode=new i};r.inherits(o,s),function(){this.getFoldWidgetRangeBase=this.getFoldWidgetRange,this.getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=this.getFoldWidgetBase(e,t,n);return r?r:this.xmlFoldMode.getFoldWidget(e,t,n)},this.getFoldWidgetRange=function(e,t,n,r){var i=this.getFoldWidgetRangeBase(e,t,n,r);return i?i:this.xmlFoldMode.getFoldWidgetRange(e,t,n)}}.call(o.prototype)}),ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript_highlight_rules").JavaScriptHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../worker/worker_client").WorkerClient,a=e("./behaviour/javascript").JavaScriptBehaviour,f=e("./folding/javascript").FoldMode,l=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new f};r.inherits(l,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.$quotes={'"':'"',"'":"'","`":"`"},this.$pairQuotesAfter={"`":/\w/},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"||e=="no_regex"){var u=t.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);u&&(r+=n)}else if(e=="doc-start")if(o=="start"||o=="no_regex")return"";return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new u(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/javascript",this.snippetFileId="ace/snippets/javascript"}.call(l.prototype),t.Mode=l}); (function() { +ace.define("ace/mode/jsdoc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:["comment.doc.tag","comment.doc.text","lparen.doc"],regex:"(@(?:param|member|typedef|property|namespace|var|const|callback))(\\s*)({)",push:[{token:"lparen.doc",regex:"{",push:[{include:"doc-syntax"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"}]},{token:["rparen.doc","text.doc","variable.parameter.doc","lparen.doc","variable.parameter.doc","rparen.doc"],regex:/(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,next:"pop"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"},{include:"doc-syntax"},{defaultToken:"text.doc"}]},{token:["comment.doc.tag","text.doc","lparen.doc"],regex:"(@(?:returns?|yields|type|this|suppress|public|protected|private|package|modifies|implements|external|exception|throws|enum|define|extends))(\\s*)({)",push:[{token:"lparen.doc",regex:"{",push:[{include:"doc-syntax"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"}]},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"},{include:"doc-syntax"},{defaultToken:"text.doc"}]},{token:["comment.doc.tag","text.doc","variable.parameter.doc"],regex:'(@(?:alias|memberof|instance|module|name|lends|namespace|external|this|template|requires|param|implements|function|extends|typedef|mixes|constructor|var|memberof\\!|event|listens|exports|class|constructs|interface|emits|fires|throws|const|callback|borrows|augments))(\\s+)(\\w[\\w#.:/~"\\-]*)?'},{token:["comment.doc.tag","text.doc","variable.parameter.doc"],regex:"(@method)(\\s+)(\\w[\\w.\\(\\)]*)"},{token:"comment.doc.tag",regex:"@access\\s+(?:private|public|protected)"},{token:"comment.doc.tag",regex:"@kind\\s+(?:class|constant|event|external|file|function|member|mixin|module|namespace|typedef)"},{token:"comment.doc.tag",regex:"@\\w+(?=\\s|$)"},s.getTagRule(),{defaultToken:"comment.doc.body",caseInsensitive:!0}],"doc-syntax":[{token:"operator.doc",regex:/[|:]/},{token:"paren.doc",regex:/[\[\]]/}]},this.normalizeRules()};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:/\/\*\*(?!\/)/,next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.JsDocCommentHighlightRules=s}),ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/jsdoc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";function a(){var e=o.replace("\\d","\\d\\-"),t={onMatch:function(e,t,n){var r=e.charAt(1)=="/"?2:1;if(r==1)t!=this.nextState?n.unshift(this.next,this.nextState,0):n.unshift(this.next),n[2]++;else if(r==2&&t==this.nextState){n[1]--;if(!n[1]||n[1]<0)n.shift(),n.shift()}return[{type:"meta.tag.punctuation."+(r==1?"":"end-")+"tag-open.xml",value:e.slice(0,r)},{type:"meta.tag.tag-name.xml",value:e.substr(r)}]},regex:"))",next:"jsxAttributes",nextState:"jsx"};this.$rules.start.unshift(t);var n={regex:"{",token:"paren.quasi.start",push:"start"};this.$rules.jsx=[n,t,{include:"reference"},{defaultToken:"string.xml"}],this.$rules.jsxAttributes=[{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",onMatch:function(e,t,n){return t==n[0]&&n.shift(),e.length==2&&(n[0]==this.nextState&&n[1]--,(!n[1]||n[1]<0)&&n.splice(0,2)),this.next=n[0]||"start",[{type:this.token,value:e}]},nextState:"jsx"},n,f("jsxAttributes"),{token:"entity.other.attribute-name.xml",regex:e},{token:"keyword.operator.attribute-equals.xml",regex:"="},{token:"text.tag-whitespace.xml",regex:"\\s+"},{token:"string.attribute-value.xml",regex:"'",stateName:"jsx_attr_q",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',stateName:"jsx_attr_qq",push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},t],this.$rules.reference=[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}]}function f(e){return[{token:"comment",regex:/\/\*/,next:[i.getTagRule(),{token:"comment",regex:"\\*\\/",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]},{token:"comment",regex:"\\/\\/",next:[i.getTagRule(),{token:"comment",regex:"$|^",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]}]}var r=e("../lib/oop"),i=e("./jsdoc_comment_highlight_rules").JsDocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o="[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*",u=function(e){var t={"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",keyword:"const|yield|import|get|set|async|await|break|case|catch|continue|default|delete|do|else|finally|for|if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},n=this.createKeywordMapper(t,"identifier"),r="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",s="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u{[0-9a-fA-F]{1,6}}|[0-2][0-7]{0,2}|3[0-7][0-7]?|[4-7][0-7]?|.)",u="(function)(\\s*)(\\*?)",l={token:["identifier","text","paren.lparen"],regex:"(\\b(?!"+Object.values(t).join("|")+"\\b)"+o+")(\\s*)(\\()"};this.$rules={no_regex:[i.getStartRule("doc-start"),f("no_regex"),l,{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\s*)(=)(\\s*)"+u+"(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","storage.type","text","text","entity.name.function","text","paren.lparen"],regex:"(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))("+o+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\s*)(:)(\\s*)"+u+"(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)"+u+"(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"from(?=\\s*('|\"))"},{token:"keyword",regex:"(?:"+r+")\\b",next:"start"},{token:"support.constant",regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|debug|time|trace|timeEnd|assert)\b/},{token:n,regex:o},{token:"punctuation.operator",regex:/[.](?![.])/,next:"property"},{token:"storage.type",regex:/=>/,next:"start"},{token:"keyword.operator",regex:/--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],property:[{token:"text",regex:"\\s+"},{token:"keyword.operator",regex:/=/},{token:["storage.type","text","storage.type","text","paren.lparen"],regex:u+"(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","storage.type","text","text","entity.name.function","text","paren.lparen"],regex:"(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:"punctuation.operator",regex:/[.](?![.])/},{token:"support.function",regex:"prototype"},{token:"support.function",regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:"support.function.dom",regex:/(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:"support.constant",regex:/(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:"identifier",regex:o},{regex:"",token:"empty",next:"no_regex"}],start:[i.getStartRule("doc-start"),f("start"),{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],default_parameter:[{token:"string",regex:"'(?=.)",push:[{token:"string",regex:"'|$",next:"pop"},{include:"qstring"}]},{token:"string",regex:'"(?=.)',push:[{token:"string",regex:'"|$',next:"pop"},{include:"qqstring"}]},{token:"constant.language",regex:"null|Infinity|NaN|undefined"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/},{token:"punctuation.operator",regex:",",next:"function_arguments"},{token:"text",regex:"\\s+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],function_arguments:[f("function_arguments"),{token:"variable.parameter",regex:o},{token:"punctuation.operator",regex:","},{token:"text",regex:"\\s+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],qqstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]};if(!e||!e.noES6)this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(e,t,n){this.next=e=="{"?this.nextState:"";if(e=="{"&&n.length)n.unshift("start",t);else if(e=="}"&&n.length){n.shift(),this.next=n.shift();if(this.next.indexOf("string")!=-1||this.next.indexOf("jsx")!=-1)return"paren.quasi.end"}return e=="{"?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:s},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]},{token:["variable.parameter","text"],regex:"("+o+")(\\s*)(?=\\=>)"},{token:"paren.lparen",regex:"(\\()(?=[^\\(]+\\s*=>)",next:"function_arguments"},{token:"variable.language",regex:"(?:(?:(?:Weak)?(?:Set|Map))|Promise)\\b"}),this.$rules.function_arguments.unshift({token:"keyword.operator",regex:"=",next:"default_parameter"},{token:"keyword.operator",regex:"\\.{3}"}),this.$rules.property.unshift({token:"support.function",regex:"(findIndex|repeat|startsWith|endsWith|includes|isSafeInteger|trunc|cbrt|log2|log10|sign|then|catch|finally|resolve|reject|race|any|all|allSettled|keys|entries|isInteger)\\b(?=\\()"},{token:"constant.language",regex:"(?:MAX_SAFE_INTEGER|MIN_SAFE_INTEGER|EPSILON)\\b"}),(!e||e.jsx!=0)&&a.call(this);this.embedRules(i,"doc-",[i.getEndRule("no_regex")]),this.normalizeRules()};r.inherits(u,s),t.JavaScriptHighlightRules=u}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"],function(e,t,n){"use strict";function o(e,t){return e&&e.type.lastIndexOf(t+".xml")>-1}var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,u=function(){this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){var u=i,a=r.doc.getTextRange(n.getSelectionRange());if(a!==""&&a!=="'"&&a!='"'&&n.getWrapBehavioursEnabled())return{text:u+a+u,selection:!1};var f=n.getCursorPosition(),l=r.doc.getLine(f.row),c=l.substring(f.column,f.column+1),h=new s(r,f.row,f.column),p=h.getCurrentToken();if(c==u&&(o(p,"attribute-value")||o(p,"string")))return{text:"",selection:[1,1]};p||(p=h.stepBackward());if(!p)return;while(o(p,"tag-whitespace")||o(p,"whitespace"))p=h.stepBackward();var d=!c||c.match(/\s/);if(o(p,"attribute-equals")&&(d||c==">")||o(p,"decl-attribute-equals")&&(d||c=="?"))return{text:u+u,selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}}),this.add("autoclosing","insertion",function(e,t,n,r,i){if(i==">"){var u=n.getSelectionRange().start,a=new s(r,u.row,u.column),f=a.getCurrentToken()||a.stepBackward();if(!f||!(o(f,"tag-name")||o(f,"tag-whitespace")||o(f,"attribute-name")||o(f,"attribute-equals")||o(f,"attribute-value")))return;if(o(f,"reference.attribute-value"))return;if(o(f,"attribute-value")){var l=a.getCurrentTokenColumn()+f.value.length;if(u.column/.test(r.getLine(u.row).slice(u.column)))return;while(!o(f,"tag-name")){f=a.stepBackward();if(f.value=="<"){f=a.stepForward();break}}var h=a.getCurrentTokenRow(),p=a.getCurrentTokenColumn();if(o(a.stepBackward(),"end-tag-open"))return;var d=f.value;h==u.row&&(d=d.substring(0,u.column-p));if(this.voidElements&&this.voidElements.hasOwnProperty(d.toLowerCase()))return;return{text:">",selection:[1,1]}}}),this.add("autoindent","insertion",function(e,t,n,r,i){if(i=="\n"){var u=n.getCursorPosition(),a=r.getLine(u.row),f=new s(r,u.row,u.column),l=f.getCurrentToken();if(o(l,"")&&l.type.indexOf("tag-close")!==-1){if(l.value=="/>")return;while(l&&l.type.indexOf("tag-name")===-1)l=f.stepBackward();if(!l)return;var c=l.value,h=f.getCurrentTokenRow();l=f.stepBackward();if(!l||l.type.indexOf("end-tag")!==-1)return;if(this.voidElements&&!this.voidElements[c]||!this.voidElements){var p=r.getTokenAt(u.row,u.column+1),a=r.getLine(h),d=this.$getIndent(a),v=d+r.getTabString();return p&&p.value===""){var o=n.getSelectionRange().start,u=new i(r,o.row,o.column),a=u.getCurrentToken()||u.stepBackward();if(!a)return;if(a.value=="<")return{text:">",selection:[1,1]}}})};r.inherits(u,s),t.JavaScriptBehaviour=u}),ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";function a(e,t){return e.type.lastIndexOf(t+".xml")>-1}var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e,t){s.call(this),this.voidElements=e||{},this.optionalEndTags=r.mixin({},this.voidElements),t&&r.mixin(this.optionalEndTags,t)};r.inherits(o,s);var u=function(){this.tagName="",this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};(function(){this.getFoldWidget=function(e,t,n){var r=this._getFirstTagInLine(e,n);return r?r.closing||!r.tagName&&r.selfClosing?t==="markbeginend"?"end":"":!r.tagName||r.selfClosing||this.voidElements.hasOwnProperty(r.tagName.toLowerCase())?"":this._findEndTagInLine(e,n,r.tagName,r.end.column)?"":"start":this.getCommentFoldWidget(e,n)},this.getCommentFoldWidget=function(e,t){return/comment/.test(e.getState(t))&&/";break}}return r}if(a(s,"tag-close"))return r.selfClosing=s.value=="/>",r;r.start.column+=s.value.length}return null},this._findEndTagInLine=function(e,t,n,r){var i=e.getTokens(t),s=0;for(var o=0;of)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./xml").FoldMode,s=e("./cstyle").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end))),this.xmlFoldMode=new i};r.inherits(o,s),function(){this.getFoldWidgetRangeBase=this.getFoldWidgetRange,this.getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=this.getFoldWidgetBase(e,t,n);return r?r:this.xmlFoldMode.getFoldWidget(e,t,n)},this.getFoldWidgetRange=function(e,t,n,r){var i=this.getFoldWidgetRangeBase(e,t,n,r);return i?i:this.xmlFoldMode.getFoldWidgetRange(e,t,n)}}.call(o.prototype)}),ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript_highlight_rules").JavaScriptHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../worker/worker_client").WorkerClient,a=e("./behaviour/javascript").JavaScriptBehaviour,f=e("./folding/javascript").FoldMode,l=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new f};r.inherits(l,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.$quotes={'"':'"',"'":"'","`":"`"},this.$pairQuotesAfter={"`":/\w/},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"||e=="no_regex"){var u=t.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);u&&(r+=n)}else if(e=="doc-start")if(o=="start"||o=="no_regex")return"";return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new u(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/javascript",this.snippetFileId="ace/snippets/javascript"}.call(l.prototype),t.Mode=l}); (function() { ace.require(["ace/mode/javascript"], function(m) { if ( true && module) { module.exports = m; @@ -674,7 +674,9 @@ exports.getDocumentHead = function (doc) { return doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement; }; exports.createElement = function (tag, ns) { - return document.createElementNS ? document.createElementNS(ns || XHTML_NS, tag) : document.createElement(tag); + return document.createElementNS ? + document.createElementNS(ns || XHTML_NS, tag) : + document.createElement(tag); }; exports.removeChildren = function (element) { element.innerHTML = ""; @@ -1062,7 +1064,7 @@ ace.define("ace/lib/default_english_messages",["require","exports","module"], fu "autocomplete.loading": "Loading...", "editor.scroller.aria-roledescription": "editor", "editor.scroller.aria-label": "Editor content, press Enter to start editing, press Escape to exit", - "editor.gutter.aria-roledescription": "editor gutter", + "editor.gutter.aria-roledescription": "editor", "editor.gutter.aria-label": "Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit", "error-marker.good-state": "Looks good!", "prompt.recently-used": "Recently used", @@ -1101,8 +1103,7 @@ ace.define("ace/lib/default_english_messages",["require","exports","module"], fu "gutter-tooltip.aria-label.security.singular": "security finding", "gutter-tooltip.aria-label.security.plural": "security findings", "gutter-tooltip.aria-label.hint.singular": "suggestion", - "gutter-tooltip.aria-label.hint.plural": "suggestions", - "editor.tooltip.disable-editing": "Editing is disabled" + "gutter-tooltip.aria-label.hint.plural": "suggestions" }; exports.defaultEnglishMessages = defaultEnglishMessages; @@ -1128,7 +1129,8 @@ var optionsProvider = { }); } else if (!Array.isArray(optionNames)) { - optionNames = Object.keys(optionNames); + result = optionNames; + optionNames = Object.keys(result); } optionNames.forEach(function (key) { result[key] = this.getOption(key); @@ -1222,7 +1224,7 @@ var AppConfig = /** @class */ (function () { }; AppConfig.prototype.nls = function (key, defaultString, params) { if (!messages[key]) { - warn("No message found for the key '" + key + "' in messages with id " + messages.$id + ", trying to find a translation for the default string '" + defaultString + "'."); + warn("No message found for the key '" + key + "' in the provided messages, trying to find a translation for the default string '" + defaultString + "'."); if (!messages[defaultString]) { warn("No message found for the default string '" + defaultString + "' in the provided messages. Falling back to the default English message."); } @@ -1412,7 +1414,7 @@ var reportErrorIfPathIsNotConfigured = function () { reportErrorIfPathIsNotConfigured = function () { }; } }; -exports.version = "1.43.1"; +exports.version = "1.36.2"; }); @@ -1893,7 +1895,7 @@ EventListener.prototype.destroy = function () { removeListener(this.elem, this.type, this.callback); this.elem = this.type = this.callback = undefined; }; -var addListener = exports.addListener = function (elem, type, callback, destroyer) { +var addListener = exports.addListener = function (elem, type, callback, /**@type{any?}*/ destroyer) { elem.addEventListener(type, callback, getListenerOptions()); if (destroyer) destroyer.$toDestroy.push(new EventListener(elem, type, callback)); @@ -2166,400 +2168,317 @@ var MODS = KEYS.KEY_MODS; var isIOS = useragent.isIOS; var valueResetRegex = isIOS ? /\s/ : /\n/; var isMobile = useragent.isMobile; -var TextInput = /** @class */ (function () { - function TextInput(parentNode, host) { - var _this = this; - this.host = host; - this.text = dom.createElement("textarea"); - this.text.className = "ace_text-input"; - this.text.setAttribute("wrap", "off"); - this.text.setAttribute("autocorrect", "off"); - this.text.setAttribute("autocapitalize", "off"); - this.text.setAttribute("spellcheck", "false"); - this.text.style.opacity = "0"; - parentNode.insertBefore(this.text, parentNode.firstChild); this.copied = false; - this.pasted = false; - this.inComposition = false; - this.sendingText = false; - this.tempStyle = ''; - if (!isMobile) - this.text.style.fontSize = "1px"; - this.commandMode = false; - this.ignoreFocusEvents = false; - this.lastValue = ""; - this.lastSelectionStart = 0; - this.lastSelectionEnd = 0; - this.lastRestoreEnd = 0; - this.rowStart = Number.MAX_SAFE_INTEGER; - this.rowEnd = Number.MIN_SAFE_INTEGER; - this.numberOfExtraLines = 0; - try { - this.$isFocused = document.activeElement === this.text; +var TextInput; +TextInput = function (parentNode, host) { + var text = dom.createElement("textarea"); + text.className = "ace_text-input"; + text.setAttribute("wrap", "off"); + text.setAttribute("autocorrect", "off"); + text.setAttribute("autocapitalize", "off"); + text.setAttribute("spellcheck", "false"); + text.style.opacity = "0"; + parentNode.insertBefore(text, parentNode.firstChild); + var copied = false; + var pasted = false; + var inComposition = false; + var sendingText = false; + var tempStyle = ''; + if (!isMobile) + text.style.fontSize = "1px"; + var commandMode = false; + var ignoreFocusEvents = false; + var lastValue = ""; + var lastSelectionStart = 0; + var lastSelectionEnd = 0; + var lastRestoreEnd = 0; + var rowStart = Number.MAX_SAFE_INTEGER; + var rowEnd = Number.MIN_SAFE_INTEGER; + var numberOfExtraLines = 0; + try { + var isFocused = document.activeElement === text; + } + catch (e) { } + this.setNumberOfExtraLines = function (number) { + rowStart = Number.MAX_SAFE_INTEGER; + rowEnd = Number.MIN_SAFE_INTEGER; + if (number < 0) { + numberOfExtraLines = 0; + return; } - catch (e) { + numberOfExtraLines = number; + }; + this.setAriaOptions = function (options) { + if (options.activeDescendant) { + text.setAttribute("aria-haspopup", "true"); + text.setAttribute("aria-autocomplete", options.inline ? "both" : "list"); + text.setAttribute("aria-activedescendant", options.activeDescendant); } - this.cancelComposition = this.cancelComposition.bind(this); - this.setAriaOptions({ role: "textbox" }); - event.addListener(this.text, "blur", function (e) { - if (_this.ignoreFocusEvents) - return; - host.onBlur(e); - _this.$isFocused = false; - }, host); - event.addListener(this.text, "focus", function (e) { - if (_this.ignoreFocusEvents) - return; - _this.$isFocused = true; - if (useragent.isEdge) { - try { - if (!document.hasFocus()) - return; - } - catch (e) { - } - } - host.onFocus(e); - if (useragent.isEdge) - setTimeout(_this.resetSelection.bind(_this)); - else - _this.resetSelection(); - }, host); this.$focusScroll = false; - host.on("beforeEndOperation", function () { - var curOp = host.curOp; - var commandName = curOp && curOp.command && curOp.command.name; - if (commandName == "insertstring") - return; - var isUserAction = commandName && (curOp.docChanged || curOp.selectionChanged); - if (_this.inComposition && isUserAction) { - _this.lastValue = _this.text.value = ""; - _this.onCompositionEnd(); - } - _this.resetSelection(); - }); - host.on("changeSelection", this.setAriaLabel.bind(this)); - this.resetSelection = isIOS ? this.$resetSelectionIOS : this.$resetSelection; - if (this.$isFocused) - host.onFocus(); - this.inputHandler = null; - this.afterContextMenu = false; - event.addCommandKeyListener(this.text, function (e, hashId, keyCode) { - if (_this.inComposition) - return; - return host.onCommandKey(e, hashId, keyCode); - }, host); - event.addListener(this.text, "select", this.onSelect.bind(this), host); - event.addListener(this.text, "input", this.onInput.bind(this), host); - event.addListener(this.text, "cut", this.onCut.bind(this), host); - event.addListener(this.text, "copy", this.onCopy.bind(this), host); - event.addListener(this.text, "paste", this.onPaste.bind(this), host); - if (!('oncut' in this.text) || !('oncopy' in this.text) || !('onpaste' in this.text)) { - event.addListener(parentNode, "keydown", function (e) { - if ((useragent.isMac && !e.metaKey) || !e.ctrlKey) - return; - switch (e.keyCode) { - case 67: - _this.onCopy(e); - break; - case 86: - _this.onPaste(e); - break; - case 88: - _this.onCut(e); - break; - } - }, host); - } - this.syncComposition = lang.delayedCall(this.onCompositionUpdate.bind(this), 50).schedule.bind(null, null); //TODO: check this - event.addListener(this.text, "compositionstart", this.onCompositionStart.bind(this), host); - event.addListener(this.text, "compositionupdate", this.onCompositionUpdate.bind(this), host); - event.addListener(this.text, "keyup", this.onKeyup.bind(this), host); - event.addListener(this.text, "keydown", this.syncComposition.bind(this), host); - event.addListener(this.text, "compositionend", this.onCompositionEnd.bind(this), host); - this.closeTimeout; - event.addListener(this.text, "mouseup", this.$onContextMenu.bind(this), host); - event.addListener(this.text, "mousedown", function (e) { - e.preventDefault(); - _this.onContextMenuClose(); - }, host); - event.addListener(host.renderer.scroller, "contextmenu", this.$onContextMenu.bind(this), host); - event.addListener(this.text, "contextmenu", this.$onContextMenu.bind(this), host); - if (isIOS) - this.addIosSelectionHandler(parentNode, host, this.text); - } - TextInput.prototype.addIosSelectionHandler = function (parentNode, host, text) { - var _this = this; - var typingResetTimeout = null; - var typing = false; - text.addEventListener("keydown", function (e) { - if (typingResetTimeout) - clearTimeout(typingResetTimeout); - typing = true; - }, true); - text.addEventListener("keyup", function (e) { - typingResetTimeout = setTimeout(function () { - typing = false; - }, 100); - }, true); - var detectArrowKeys = function (e) { - if (document.activeElement !== text) - return; - if (typing || _this.inComposition || host.$mouseHandler.isMousePressed) - return; - if (_this.copied) { - return; - } - var selectionStart = text.selectionStart; - var selectionEnd = text.selectionEnd; - var key = null; - var modifier = 0; - if (selectionStart == 0) { - key = KEYS.up; - } - else if (selectionStart == 1) { - key = KEYS.home; - } - else if (selectionEnd > _this.lastSelectionEnd && _this.lastValue[selectionEnd] == "\n") { - key = KEYS.end; - } - else if (selectionStart < _this.lastSelectionStart && _this.lastValue[selectionStart - 1] == " ") { - key = KEYS.left; - modifier = MODS.option; - } - else if (selectionStart < _this.lastSelectionStart || (selectionStart == _this.lastSelectionStart - && _this.lastSelectionEnd != _this.lastSelectionStart && selectionStart == selectionEnd)) { - key = KEYS.left; - } - else if (selectionEnd > _this.lastSelectionEnd && _this.lastValue.slice(0, selectionEnd).split("\n").length > 2) { - key = KEYS.down; - } - else if (selectionEnd > _this.lastSelectionEnd && _this.lastValue[selectionEnd - 1] == " ") { - key = KEYS.right; - modifier = MODS.option; - } - else if (selectionEnd > _this.lastSelectionEnd || (selectionEnd == _this.lastSelectionEnd - && _this.lastSelectionEnd != _this.lastSelectionStart && selectionStart == selectionEnd)) { - key = KEYS.right; + else { + text.setAttribute("aria-haspopup", "false"); + text.setAttribute("aria-autocomplete", "both"); + text.removeAttribute("aria-activedescendant"); + } + if (options.role) { + text.setAttribute("role", options.role); + } + if (options.setLabel) { + text.setAttribute("aria-roledescription", nls("text-input.aria-roledescription", "editor")); + var arialLabel = ""; + if (host.$textInputAriaLabel) { + arialLabel += "".concat(host.$textInputAriaLabel, ", "); } - if (selectionStart !== selectionEnd) - modifier |= MODS.shift; - if (key) { - var result = host.onCommandKey({}, modifier, key); - if (!result && host.commands) { - key = KEYS.keyCodeToString(key); - var command = host.commands.findKeyCommand(modifier, key); - if (command) - host.execCommand(command); - } - _this.lastSelectionStart = selectionStart; - _this.lastSelectionEnd = selectionEnd; - _this.resetSelection(""); + if (host.session) { + var row = host.session.selection.cursor.row; + arialLabel += nls("text-input.aria-label", "Cursor at row $0", [row + 1]); } - }; - document.addEventListener("selectionchange", detectArrowKeys); - host.on("destroy", function () { - document.removeEventListener("selectionchange", detectArrowKeys); - }); - }; - TextInput.prototype.onContextMenuClose = function () { - var _this = this; - clearTimeout(this.closeTimeout); - this.closeTimeout = setTimeout(function () { - if (_this.tempStyle) { - _this.text.style.cssText = _this.tempStyle; - _this.tempStyle = ''; - } - _this.host.renderer.$isMousePressed = false; - if (_this.host.renderer.$keepTextAreaAtCursor) - _this.host.renderer.$moveTextAreaToCursor(); - }, 0); - }; - TextInput.prototype.$onContextMenu = function (e) { - this.host.textInput.onContextMenu(e); - this.onContextMenuClose(); - }; - TextInput.prototype.onKeyup = function (e) { - if (e.keyCode == 27 && this.text.value.length < this.text.selectionStart) { - if (!this.inComposition) - this.lastValue = this.text.value; - this.lastSelectionStart = this.lastSelectionEnd = -1; - this.resetSelection(); + text.setAttribute("aria-label", arialLabel); } - this.syncComposition(); - }; - TextInput.prototype.cancelComposition = function () { - this.ignoreFocusEvents = true; - this.text.blur(); - this.text.focus(); - this.ignoreFocusEvents = false; }; - TextInput.prototype.onCompositionStart = function (e) { - if (this.inComposition || !this.host.onCompositionStart || this.host.$readOnly) + this.setAriaOptions({ role: "textbox" }); + event.addListener(text, "blur", function (e) { + if (ignoreFocusEvents) return; - this.inComposition = {}; - if (this.commandMode) + host.onBlur(e); + isFocused = false; + }, host); + event.addListener(text, "focus", function (e) { + if (ignoreFocusEvents) return; - if (e.data) - this.inComposition.useTextareaForIME = false; - setTimeout(this.onCompositionUpdate.bind(this), 0); - this.host._signal("compositionStart"); - this.host.on("mousedown", this.cancelComposition); //TODO: - var range = this.host.getSelectionRange(); - range.end.row = range.start.row; - range.end.column = range.start.column; - this.inComposition.markerRange = range; - this.inComposition.selectionStart = this.lastSelectionStart; - this.host.onCompositionStart(this.inComposition); - if (this.inComposition.useTextareaForIME) { - this.lastValue = this.text.value = ""; - this.lastSelectionStart = 0; - this.lastSelectionEnd = 0; + isFocused = true; + if (useragent.isEdge) { + try { + if (!document.hasFocus()) + return; + } + catch (e) { } } - else { - if (this.text.msGetInputContext) - this.inComposition.context = this.text.msGetInputContext(); - if (this.text.getInputContext) - this.inComposition.context = this.text.getInputContext(); + host.onFocus(e); + if (useragent.isEdge) + setTimeout(resetSelection); + else + resetSelection(); + }, host); + this.$focusScroll = false; + this.focus = function () { + this.setAriaOptions({ + setLabel: host.renderer.enableKeyboardAccessibility + }); + if (tempStyle || HAS_FOCUS_ARGS || this.$focusScroll == "browser") + return text.focus({ preventScroll: true }); + var top = text.style.top; + text.style.position = "fixed"; + text.style.top = "0px"; + try { + var isTransformed = text.getBoundingClientRect().top != 0; } - }; - TextInput.prototype.onCompositionUpdate = function () { - if (!this.inComposition || !this.host.onCompositionUpdate || this.host.$readOnly) + catch (e) { return; - if (this.commandMode) - return this.cancelComposition(); - if (this.inComposition.useTextareaForIME) { - this.host.onCompositionUpdate(this.text.value); } - else { - var data = this.text.value; - this.sendText(data); - if (this.inComposition.markerRange) { - if (this.inComposition.context) { - this.inComposition.markerRange.start.column = this.inComposition.selectionStart = this.inComposition.context.compositionStartOffset; - } - this.inComposition.markerRange.end.column = this.inComposition.markerRange.start.column - + this.lastSelectionEnd - this.inComposition.selectionStart + this.lastRestoreEnd; + var ancestors = []; + if (isTransformed) { + var t = text.parentElement; + while (t && t.nodeType == 1) { + ancestors.push(t); + t.setAttribute("ace_nocontext", "true"); + if (!t.parentElement && t.getRootNode) + t = t.getRootNode()["host"]; + else + t = t.parentElement; } } + text.focus({ preventScroll: true }); + if (isTransformed) { + ancestors.forEach(function (p) { + p.removeAttribute("ace_nocontext"); + }); + } + setTimeout(function () { + text.style.position = ""; + if (text.style.top == "0px") + text.style.top = top; + }, 0); }; - TextInput.prototype.onCompositionEnd = function (e) { - if (!this.host.onCompositionEnd || this.host.$readOnly) - return; - this.inComposition = false; - this.host.onCompositionEnd(); - this.host.off("mousedown", this.cancelComposition); - if (e) - this.onInput(); - }; - TextInput.prototype.onCut = function (e) { - this.doCopy(e, true); + this.blur = function () { + text.blur(); }; - TextInput.prototype.onCopy = function (e) { - this.doCopy(e, false); + this.isFocused = function () { + return isFocused; }; - TextInput.prototype.onPaste = function (e) { - var data = this.handleClipboardData(e); - if (clipboard.pasteCancelled()) + host.on("beforeEndOperation", function () { + var curOp = host.curOp; + var commandName = curOp && curOp.command && curOp.command.name; + if (commandName == "insertstring") return; - if (typeof data == "string") { - if (data) - this.host.onPaste(data, e); - if (useragent.isIE) - setTimeout(this.resetSelection); - event.preventDefault(e); + var isUserAction = commandName && (curOp.docChanged || curOp.selectionChanged); + if (inComposition && isUserAction) { + lastValue = text.value = ""; + onCompositionEnd(); } - else { - this.text.value = ""; - this.pasted = true; + resetSelection(); + }); + var positionToSelection = function (row, column) { + var selection = column; + for (var i = 1; i <= row - rowStart && i < 2 * numberOfExtraLines + 1; i++) { + selection += host.session.getLine(row - i).length + 1; } + return selection; }; - TextInput.prototype.doCopy = function (e, isCut) { - var _this = this; - var data = this.host.getCopyText(); - if (!data) - return event.preventDefault(e); - if (this.handleClipboardData(e, data)) { - if (isIOS) { - this.resetSelection(data); - this.copied = data; - setTimeout(function () { - _this.copied = false; - }, 10); + var resetSelection = isIOS + ? function (value) { + if (!isFocused || (copied && !value) || sendingText) + return; + if (!value) + value = ""; + var newValue = "\n ab" + value + "cde fg\n"; + if (newValue != text.value) + text.value = lastValue = newValue; + var selectionStart = 4; + var selectionEnd = 4 + (value.length || (host.selection.isEmpty() ? 0 : 1)); + if (lastSelectionStart != selectionStart || lastSelectionEnd != selectionEnd) { + text.setSelectionRange(selectionStart, selectionEnd); + } + lastSelectionStart = selectionStart; + lastSelectionEnd = selectionEnd; + } + : function () { + if (inComposition || sendingText) + return; + if (!isFocused && !afterContextMenu) + return; + inComposition = true; + var selectionStart = 0; + var selectionEnd = 0; + var line = ""; + if (host.session) { + var selection = host.selection; + var range = selection.getRange(); + var row = selection.cursor.row; + if (row === rowEnd + 1) { + rowStart = rowEnd + 1; + rowEnd = rowStart + 2 * numberOfExtraLines; + } + else if (row === rowStart - 1) { + rowEnd = rowStart - 1; + rowStart = rowEnd - 2 * numberOfExtraLines; + } + else if (row < rowStart - 1 || row > rowEnd + 1) { + rowStart = row > numberOfExtraLines ? row - numberOfExtraLines : 0; + rowEnd = row > numberOfExtraLines ? row + numberOfExtraLines : 2 * numberOfExtraLines; + } + var lines = []; + for (var i = rowStart; i <= rowEnd; i++) { + lines.push(host.session.getLine(i)); + } + line = lines.join('\n'); + selectionStart = positionToSelection(range.start.row, range.start.column); + selectionEnd = positionToSelection(range.end.row, range.end.column); + if (range.start.row < rowStart) { + var prevLine = host.session.getLine(rowStart - 1); + selectionStart = range.start.row < rowStart - 1 ? 0 : selectionStart; + selectionEnd += prevLine.length + 1; + line = prevLine + "\n" + line; + } + else if (range.end.row > rowEnd) { + var nextLine = host.session.getLine(rowEnd + 1); + selectionEnd = range.end.row > rowEnd + 1 ? nextLine.length : range.end.column; + selectionEnd += line.length + 1; + line = line + "\n" + nextLine; + } + else if (isMobile && row > 0) { + line = "\n" + line; + selectionEnd += 1; + selectionStart += 1; + } + if (line.length > MAX_LINE_LENGTH) { + if (selectionStart < MAX_LINE_LENGTH && selectionEnd < MAX_LINE_LENGTH) { + line = line.slice(0, MAX_LINE_LENGTH); + } + else { + line = "\n"; + if (selectionStart == selectionEnd) { + selectionStart = selectionEnd = 0; + } + else { + selectionStart = 0; + selectionEnd = 1; + } + } + } + var newValue = line + "\n\n"; + if (newValue != lastValue) { + text.value = lastValue = newValue; + lastSelectionStart = lastSelectionEnd = newValue.length; + } } - isCut ? this.host.onCut() : this.host.onCopy(); - event.preventDefault(e); - } - else { - this.copied = true; - this.text.value = data; - this.text.select(); - setTimeout(function () { - _this.copied = false; - _this.resetSelection(); - isCut ? _this.host.onCut() : _this.host.onCopy(); - }); - } - }; - TextInput.prototype.handleClipboardData = function (e, data, forceIEMime) { - var clipboardData = e.clipboardData || window["clipboardData"]; - if (!clipboardData || BROKEN_SETDATA) - return; - var mime = USE_IE_MIME_TYPE || forceIEMime ? "Text" : "text/plain"; - try { - if (data) { - return clipboardData.setData(mime, data) !== false; + if (afterContextMenu) { + lastSelectionStart = text.selectionStart; + lastSelectionEnd = text.selectionEnd; } - else { - return clipboardData.getData(mime); + if (lastSelectionEnd != selectionEnd + || lastSelectionStart != selectionStart + || text.selectionEnd != lastSelectionEnd // on ie edge selectionEnd changes silently after the initialization + ) { + try { + text.setSelectionRange(selectionStart, selectionEnd); + lastSelectionStart = selectionStart; + lastSelectionEnd = selectionEnd; + } + catch (e) { } } - } - catch (e) { - if (!forceIEMime) - return this.handleClipboardData(e, data, true); - } - }; - TextInput.prototype.onInput = function (e) { - if (this.inComposition) - return this.onCompositionUpdate(); - if (e && e.inputType) { - if (e.inputType == "historyUndo") - return this.host.execCommand("undo"); - if (e.inputType == "historyRedo") - return this.host.execCommand("redo"); - } - var data = this.text.value; - var inserted = this.sendText(data, true); - if (data.length > MAX_LINE_LENGTH + 100 || valueResetRegex.test(inserted) || isMobile && this.lastSelectionStart - < 1 && this.lastSelectionStart == this.lastSelectionEnd) { - this.resetSelection(); - } - }; - TextInput.prototype.sendText = function (value, fromInput) { - if (this.afterContextMenu) - this.afterContextMenu = false; - if (this.pasted) { - this.resetSelection(); + inComposition = false; + }; + this.resetSelection = resetSelection; + if (isFocused) + host.onFocus(); + var isAllSelected = function (text) { + return text.selectionStart === 0 && text.selectionEnd >= lastValue.length + && text.value === lastValue && lastValue + && text.selectionEnd !== lastSelectionEnd; + }; + var onSelect = function (e) { + if (inComposition) + return; + if (copied) { + copied = false; + } + else if (isAllSelected(text)) { + host.selectAll(); + resetSelection(); + } + else if (isMobile && text.selectionStart != lastSelectionStart) { + resetSelection(); + } + }; + var inputHandler = null; + this.setInputHandler = function (cb) { inputHandler = cb; }; + this.getInputHandler = function () { return inputHandler; }; + var afterContextMenu = false; + var sendText = function (value, fromInput) { + if (afterContextMenu) + afterContextMenu = false; + if (pasted) { + resetSelection(); if (value) - this.host.onPaste(value); - this.pasted = false; + host.onPaste(value); + pasted = false; return ""; } else { - var selectionStart = this.text.selectionStart; - var selectionEnd = this.text.selectionEnd; - var extendLeft = this.lastSelectionStart; - var extendRight = this.lastValue.length - this.lastSelectionEnd; + var selectionStart = text.selectionStart; + var selectionEnd = text.selectionEnd; + var extendLeft = lastSelectionStart; + var extendRight = lastValue.length - lastSelectionEnd; var inserted = value; var restoreStart = value.length - selectionStart; var restoreEnd = value.length - selectionEnd; var i = 0; - while (extendLeft > 0 && this.lastValue[i] == value[i]) { + while (extendLeft > 0 && lastValue[i] == value[i]) { i++; extendLeft--; } inserted = inserted.slice(i); i = 1; - while (extendRight > 0 && this.lastValue.length - i > this.lastSelectionStart - 1 - && this.lastValue[this.lastValue.length - i] == value[value.length - i]) { + while (extendRight > 0 && lastValue.length - i > lastSelectionStart - 1 && lastValue[lastValue.length - i] == value[value.length - i]) { i++; extendRight--; } @@ -2573,307 +2492,371 @@ var TextInput = /** @class */ (function () { inserted = inserted.slice(0, endIndex); if (!fromInput && !inserted && !restoreStart && !extendLeft && !extendRight && !restoreEnd) return ""; - this.sendingText = true; + sendingText = true; var shouldReset = false; if (useragent.isAndroid && inserted == ". ") { inserted = " "; shouldReset = true; } - if (inserted && !extendLeft && !extendRight && !restoreStart && !restoreEnd || this.commandMode) { - this.host.onTextInput(inserted); + if (inserted && !extendLeft && !extendRight && !restoreStart && !restoreEnd || commandMode) { + host.onTextInput(inserted); } else { - this.host.onTextInput(inserted, { + host.onTextInput(inserted, { extendLeft: extendLeft, extendRight: extendRight, restoreStart: restoreStart, restoreEnd: restoreEnd }); } - this.sendingText = false; - this.lastValue = value; - this.lastSelectionStart = selectionStart; - this.lastSelectionEnd = selectionEnd; - this.lastRestoreEnd = restoreEnd; + sendingText = false; + lastValue = value; + lastSelectionStart = selectionStart; + lastSelectionEnd = selectionEnd; + lastRestoreEnd = restoreEnd; return shouldReset ? "\n" : inserted; } }; - TextInput.prototype.onSelect = function (e) { - var _this = this; - if (this.inComposition) - return; - var isAllSelected = function (text) { - return text.selectionStart === 0 && text.selectionEnd >= _this.lastValue.length && text.value - === _this.lastValue && _this.lastValue && text.selectionEnd !== _this.lastSelectionEnd; - }; - if (this.copied) { - this.copied = false; - } - else if (isAllSelected(this.text)) { - this.host.selectAll(); - this.resetSelection(); + var onInput = function (e) { + if (inComposition) + return onCompositionUpdate(); + if (e && e.inputType) { + if (e.inputType == "historyUndo") + return host.execCommand("undo"); + if (e.inputType == "historyRedo") + return host.execCommand("redo"); } - else if (isMobile && this.text.selectionStart != this.lastSelectionStart) { - this.resetSelection(); + var data = text.value; + var inserted = sendText(data, true); + if (data.length > MAX_LINE_LENGTH + 100 + || valueResetRegex.test(inserted) + || isMobile && lastSelectionStart < 1 && lastSelectionStart == lastSelectionEnd) { + resetSelection(); } }; - TextInput.prototype.$resetSelectionIOS = function (value) { - if (!this.$isFocused || (this.copied && !value) || this.sendingText) - return; - if (!value) - value = ""; - var newValue = "\n ab" + value + "cde fg\n"; - if (newValue != this.text.value) - this.text.value = this.lastValue = newValue; - var selectionStart = 4; - var selectionEnd = 4 + (value.length || (this.host.selection.isEmpty() ? 0 : 1)); - if (this.lastSelectionStart != selectionStart || this.lastSelectionEnd != selectionEnd) { - this.text.setSelectionRange(selectionStart, selectionEnd); - } - this.lastSelectionStart = selectionStart; - this.lastSelectionEnd = selectionEnd; - }; - TextInput.prototype.$resetSelection = function () { - var _this = this; - if (this.inComposition || this.sendingText) - return; - if (!this.$isFocused && !this.afterContextMenu) + var handleClipboardData = function (e, data, forceIEMime) { + var clipboardData = e.clipboardData || window["clipboardData"]; + if (!clipboardData || BROKEN_SETDATA) return; - this.inComposition = true; - var selectionStart = 0; - var selectionEnd = 0; - var line = ""; - var positionToSelection = function (row, column) { - var selection = column; - for (var i = 1; i <= row - _this.rowStart && i < 2 * _this.numberOfExtraLines + 1; i++) { - selection += _this.host.session.getLine(row - i).length + 1; - } - return selection; - }; - if (this.host.session) { - var selection = this.host.selection; - var range = selection.getRange(); - var row = selection.cursor.row; - if (row === this.rowEnd + 1) { - this.rowStart = this.rowEnd + 1; - this.rowEnd = this.rowStart + 2 * this.numberOfExtraLines; - } - else if (row === this.rowStart - 1) { - this.rowEnd = this.rowStart - 1; - this.rowStart = this.rowEnd - 2 * this.numberOfExtraLines; - } - else if (row < this.rowStart - 1 || row > this.rowEnd + 1) { - this.rowStart = row > this.numberOfExtraLines ? row - this.numberOfExtraLines : 0; - this.rowEnd = row > this.numberOfExtraLines ? row + this.numberOfExtraLines : 2 - * this.numberOfExtraLines; - } - var lines = []; - for (var i = this.rowStart; i <= this.rowEnd; i++) { - lines.push(this.host.session.getLine(i)); - } - line = lines.join('\n'); - selectionStart = positionToSelection(range.start.row, range.start.column); - selectionEnd = positionToSelection(range.end.row, range.end.column); - if (range.start.row < this.rowStart) { - var prevLine = this.host.session.getLine(this.rowStart - 1); - selectionStart = range.start.row < this.rowStart - 1 ? 0 : selectionStart; - selectionEnd += prevLine.length + 1; - line = prevLine + "\n" + line; - } - else if (range.end.row > this.rowEnd) { - var nextLine = this.host.session.getLine(this.rowEnd + 1); - selectionEnd = range.end.row > this.rowEnd + 1 ? nextLine.length : range.end.column; - selectionEnd += line.length + 1; - line = line + "\n" + nextLine; - } - else if (isMobile && row > 0) { - line = "\n" + line; - selectionEnd += 1; - selectionStart += 1; - } - if (line.length > MAX_LINE_LENGTH) { - if (selectionStart < MAX_LINE_LENGTH && selectionEnd < MAX_LINE_LENGTH) { - line = line.slice(0, MAX_LINE_LENGTH); - } - else { - line = "\n"; - if (selectionStart == selectionEnd) { - selectionStart = selectionEnd = 0; - } - else { - selectionStart = 0; - selectionEnd = 1; - } - } + var mime = USE_IE_MIME_TYPE || forceIEMime ? "Text" : "text/plain"; + try { + if (data) { + return clipboardData.setData(mime, data) !== false; } - var newValue = line + "\n\n"; - if (newValue != this.lastValue) { - this.text.value = this.lastValue = newValue; - this.lastSelectionStart = this.lastSelectionEnd = newValue.length; + else { + return clipboardData.getData(mime); } } - if (this.afterContextMenu) { - this.lastSelectionStart = this.text.selectionStart; - this.lastSelectionEnd = this.text.selectionEnd; + catch (e) { + if (!forceIEMime) + return handleClipboardData(e, data, true); } - if (this.lastSelectionEnd != selectionEnd || this.lastSelectionStart != selectionStart || this.text.selectionEnd - != this.lastSelectionEnd // on ie edge selectionEnd changes silently after the initialization - ) { - try { - this.text.setSelectionRange(selectionStart, selectionEnd); - this.lastSelectionStart = selectionStart; - this.lastSelectionEnd = selectionEnd; - } - catch (e) { + }; + var doCopy = function (e, isCut) { + var data = host.getCopyText(); + if (!data) + return event.preventDefault(e); + if (handleClipboardData(e, data)) { + if (isIOS) { + resetSelection(data); + copied = data; + setTimeout(function () { + copied = false; + }, 10); } + isCut ? host.onCut() : host.onCopy(); + event.preventDefault(e); + } + else { + copied = true; + text.value = data; + text.select(); + setTimeout(function () { + copied = false; + resetSelection(); + isCut ? host.onCut() : host.onCopy(); + }); } - this.inComposition = false; }; - TextInput.prototype.setHost = function (newHost) { - this.host = newHost; + var onCut = function (e) { + doCopy(e, true); }; - TextInput.prototype.setNumberOfExtraLines = function (number) { - this.rowStart = Number.MAX_SAFE_INTEGER; - this.rowEnd = Number.MIN_SAFE_INTEGER; - if (number < 0) { - this.numberOfExtraLines = 0; - return; - } - this.numberOfExtraLines = number; + var onCopy = function (e) { + doCopy(e, false); }; - TextInput.prototype.setAriaLabel = function () { - var ariaLabel = ""; - if (this.host.$textInputAriaLabel) { - ariaLabel += "".concat(this.host.$textInputAriaLabel, ", "); + var onPaste = function (e) { + var data = handleClipboardData(e); + if (clipboard.pasteCancelled()) + return; + if (typeof data == "string") { + if (data) + host.onPaste(data, e); + if (useragent.isIE) + setTimeout(resetSelection); + event.preventDefault(e); } - if (this.host.session) { - var row = this.host.session.selection.cursor.row; - ariaLabel += nls("text-input.aria-label", "Cursor at row $0", [row + 1]); + else { + text.value = ""; + pasted = true; } - this.text.setAttribute("aria-label", ariaLabel); }; - TextInput.prototype.setAriaOptions = function (options) { - if (options.activeDescendant) { - this.text.setAttribute("aria-haspopup", "true"); - this.text.setAttribute("aria-autocomplete", options.inline ? "both" : "list"); - this.text.setAttribute("aria-activedescendant", options.activeDescendant); + event.addCommandKeyListener(text, function (e, hashId, keyCode) { + if (inComposition) + return; + return host.onCommandKey(e, hashId, keyCode); + }, host); + event.addListener(text, "select", onSelect, host); + event.addListener(text, "input", onInput, host); + event.addListener(text, "cut", onCut, host); + event.addListener(text, "copy", onCopy, host); + event.addListener(text, "paste", onPaste, host); + if (!('oncut' in text) || !('oncopy' in text) || !('onpaste' in text)) { + event.addListener(parentNode, "keydown", function (e) { + if ((useragent.isMac && !e.metaKey) || !e.ctrlKey) + return; + switch (e.keyCode) { + case 67: + onCopy(e); + break; + case 86: + onPaste(e); + break; + case 88: + onCut(e); + break; + } + }, host); + } + var onCompositionStart = function (e) { + if (inComposition || !host.onCompositionStart || host.$readOnly) + return; + inComposition = {}; + if (commandMode) + return; + if (e.data) + inComposition.useTextareaForIME = false; + setTimeout(onCompositionUpdate, 0); + host._signal("compositionStart"); + host.on("mousedown", cancelComposition); + var range = host.getSelectionRange(); + range.end.row = range.start.row; + range.end.column = range.start.column; + inComposition.markerRange = range; + inComposition.selectionStart = lastSelectionStart; + host.onCompositionStart(inComposition); + if (inComposition.useTextareaForIME) { + lastValue = text.value = ""; + lastSelectionStart = 0; + lastSelectionEnd = 0; } else { - this.text.setAttribute("aria-haspopup", "false"); - this.text.setAttribute("aria-autocomplete", "both"); - this.text.removeAttribute("aria-activedescendant"); - } - if (options.role) { - this.text.setAttribute("role", options.role); - } - if (options.setLabel) { - this.text.setAttribute("aria-roledescription", nls("text-input.aria-roledescription", "editor")); - this.setAriaLabel(); + if (text.msGetInputContext) + inComposition.context = text.msGetInputContext(); + if (text.getInputContext) + inComposition.context = text.getInputContext(); } }; - TextInput.prototype.focus = function () { - var _this = this; - this.setAriaOptions({ - setLabel: this.host.renderer.enableKeyboardAccessibility - }); - if (this.tempStyle || HAS_FOCUS_ARGS || this.$focusScroll == "browser") - return this.text.focus({ preventScroll: true }); - var top = this.text.style.top; - this.text.style.position = "fixed"; - this.text.style.top = "0px"; - try { - var isTransformed = this.text.getBoundingClientRect().top != 0; - } - catch (e) { + var onCompositionUpdate = function () { + if (!inComposition || !host.onCompositionUpdate || host.$readOnly) return; + if (commandMode) + return cancelComposition(); + if (inComposition.useTextareaForIME) { + host.onCompositionUpdate(text.value); } - var ancestors = []; - if (isTransformed) { - var t = this.text.parentElement; - while (t && t.nodeType == 1) { - ancestors.push(t); - t.setAttribute("ace_nocontext", "true"); - if (!t.parentElement && t.getRootNode) - t = t.getRootNode()["host"]; - else - t = t.parentElement; + else { + var data = text.value; + sendText(data); + if (inComposition.markerRange) { + if (inComposition.context) { + inComposition.markerRange.start.column = inComposition.selectionStart + = inComposition.context.compositionStartOffset; + } + inComposition.markerRange.end.column = inComposition.markerRange.start.column + + lastSelectionEnd - inComposition.selectionStart + lastRestoreEnd; } } - this.text.focus({ preventScroll: true }); - if (isTransformed) { - ancestors.forEach(function (p) { - p.removeAttribute("ace_nocontext"); - }); - } - setTimeout(function () { - _this.text.style.position = ""; - if (_this.text.style.top == "0px") - _this.text.style.top = top; - }, 0); }; - TextInput.prototype.blur = function () { - this.text.blur(); - }; - TextInput.prototype.isFocused = function () { - return this.$isFocused; - }; - TextInput.prototype.setInputHandler = function (cb) { - this.inputHandler = cb; - }; - TextInput.prototype.getInputHandler = function () { - return this.inputHandler; - }; - TextInput.prototype.getElement = function () { - return this.text; + var onCompositionEnd = function (e) { + if (!host.onCompositionEnd || host.$readOnly) + return; + inComposition = false; + host.onCompositionEnd(); + host.off("mousedown", cancelComposition); + if (e) + onInput(); + }; + function cancelComposition() { + ignoreFocusEvents = true; + text.blur(); + text.focus(); + ignoreFocusEvents = false; + } + var syncComposition = lang.delayedCall(onCompositionUpdate, 50).schedule.bind(null, null); + function onKeyup(e) { + if (e.keyCode == 27 && text.value.length < text.selectionStart) { + if (!inComposition) + lastValue = text.value; + lastSelectionStart = lastSelectionEnd = -1; + resetSelection(); + } + syncComposition(); + } + event.addListener(text, "compositionstart", onCompositionStart, host); + event.addListener(text, "compositionupdate", onCompositionUpdate, host); + event.addListener(text, "keyup", onKeyup, host); + event.addListener(text, "keydown", syncComposition, host); + event.addListener(text, "compositionend", onCompositionEnd, host); + this.getElement = function () { + return text; }; - TextInput.prototype.setCommandMode = function (value) { - this.commandMode = value; - this.text.readOnly = false; + this.setCommandMode = function (value) { + commandMode = value; + text.readOnly = false; }; - TextInput.prototype.setReadOnly = function (readOnly) { - if (!this.commandMode) - this.text.readOnly = readOnly; + this.setReadOnly = function (readOnly) { + if (!commandMode) + text.readOnly = readOnly; }; - TextInput.prototype.setCopyWithEmptySelection = function (value) { + this.setCopyWithEmptySelection = function (value) { }; - TextInput.prototype.onContextMenu = function (e) { - this.afterContextMenu = true; - this.resetSelection(); - this.host._emit("nativecontextmenu", { - target: this.host, - domEvent: e - }); + this.onContextMenu = function (e) { + afterContextMenu = true; + resetSelection(); + host._emit("nativecontextmenu", { target: host, domEvent: e }); this.moveToMouse(e, true); }; - TextInput.prototype.moveToMouse = function (e, bringToFront) { - var _this = this; - if (!this.tempStyle) - this.tempStyle = this.text.style.cssText; - this.text.style.cssText = (bringToFront ? "z-index:100000;" : "") + (useragent.isIE ? "opacity:0.1;" : "") - + "text-indent: -" + (this.lastSelectionStart + this.lastSelectionEnd) * this.host.renderer.characterWidth - * 0.5 + "px;"; - var rect = this.host.container.getBoundingClientRect(); - var style = dom.computedStyle(this.host.container); + this.moveToMouse = function (e, bringToFront) { + if (!tempStyle) + tempStyle = text.style.cssText; + text.style.cssText = (bringToFront ? "z-index:100000;" : "") + + (useragent.isIE ? "opacity:0.1;" : "") + + "text-indent: -" + (lastSelectionStart + lastSelectionEnd) * host.renderer.characterWidth * 0.5 + "px;"; + var rect = host.container.getBoundingClientRect(); + var style = dom.computedStyle(host.container); var top = rect.top + (parseInt(style.borderTopWidth) || 0); - var left = rect.left + (parseInt(style.borderLeftWidth) || 0); - var maxTop = rect.bottom - top - this.text.clientHeight - 2; + var left = rect.left + (parseInt(rect.borderLeftWidth) || 0); + var maxTop = rect.bottom - top - text.clientHeight - 2; var move = function (e) { - dom.translate(_this.text, e.clientX - left - 2, Math.min(e.clientY - top - 2, maxTop)); + dom.translate(text, e.clientX - left - 2, Math.min(e.clientY - top - 2, maxTop)); }; move(e); if (e.type != "mousedown") return; - this.host.renderer.$isMousePressed = true; - clearTimeout(this.closeTimeout); + host.renderer.$isMousePressed = true; + clearTimeout(closeTimeout); if (useragent.isWin) - event.capture(this.host.container, move, this.onContextMenuClose.bind(this)); + event.capture(host.container, move, onContextMenuClose); + }; + this.onContextMenuClose = onContextMenuClose; + var closeTimeout; + function onContextMenuClose() { + clearTimeout(closeTimeout); + closeTimeout = setTimeout(function () { + if (tempStyle) { + text.style.cssText = tempStyle; + tempStyle = ''; + } + host.renderer.$isMousePressed = false; + if (host.renderer.$keepTextAreaAtCursor) + host.renderer.$moveTextAreaToCursor(); + }, 0); + } + var onContextMenu = function (e) { + host.textInput.onContextMenu(e); + onContextMenuClose(); }; - TextInput.prototype.destroy = function () { - if (this.text.parentElement) - this.text.parentElement.removeChild(this.text); + event.addListener(text, "mouseup", onContextMenu, host); + event.addListener(text, "mousedown", function (e) { + e.preventDefault(); + onContextMenuClose(); + }, host); + event.addListener(host.renderer.scroller, "contextmenu", onContextMenu, host); + event.addListener(text, "contextmenu", onContextMenu, host); + if (isIOS) + addIosSelectionHandler(parentNode, host, text); + function addIosSelectionHandler(parentNode, host, text) { + var typingResetTimeout = null; + var typing = false; + text.addEventListener("keydown", function (e) { + if (typingResetTimeout) + clearTimeout(typingResetTimeout); + typing = true; + }, true); + text.addEventListener("keyup", function (e) { + typingResetTimeout = setTimeout(function () { + typing = false; + }, 100); + }, true); + var detectArrowKeys = function (e) { + if (document.activeElement !== text) + return; + if (typing || inComposition || host.$mouseHandler.isMousePressed) + return; + if (copied) { + return; + } + var selectionStart = text.selectionStart; + var selectionEnd = text.selectionEnd; + var key = null; + var modifier = 0; + if (selectionStart == 0) { + key = KEYS.up; + } + else if (selectionStart == 1) { + key = KEYS.home; + } + else if (selectionEnd > lastSelectionEnd && lastValue[selectionEnd] == "\n") { + key = KEYS.end; + } + else if (selectionStart < lastSelectionStart && lastValue[selectionStart - 1] == " ") { + key = KEYS.left; + modifier = MODS.option; + } + else if (selectionStart < lastSelectionStart + || (selectionStart == lastSelectionStart + && lastSelectionEnd != lastSelectionStart + && selectionStart == selectionEnd)) { + key = KEYS.left; + } + else if (selectionEnd > lastSelectionEnd && lastValue.slice(0, selectionEnd).split("\n").length > 2) { + key = KEYS.down; + } + else if (selectionEnd > lastSelectionEnd && lastValue[selectionEnd - 1] == " ") { + key = KEYS.right; + modifier = MODS.option; + } + else if (selectionEnd > lastSelectionEnd + || (selectionEnd == lastSelectionEnd + && lastSelectionEnd != lastSelectionStart + && selectionStart == selectionEnd)) { + key = KEYS.right; + } + if (selectionStart !== selectionEnd) + modifier |= MODS.shift; + if (key) { + var result = host.onCommandKey({}, modifier, key); + if (!result && host.commands) { + key = KEYS.keyCodeToString(key); + var command = host.commands.findKeyCommand(modifier, key); + if (command) + host.execCommand(command); + } + lastSelectionStart = selectionStart; + lastSelectionEnd = selectionEnd; + resetSelection(""); + } + }; + document.addEventListener("selectionchange", detectArrowKeys); + host.on("destroy", function () { + document.removeEventListener("selectionchange", detectArrowKeys); + }); + } + this.destroy = function () { + if (text.parentElement) + text.parentElement.removeChild(text); }; - return TextInput; -}()); +}; exports.TextInput = TextInput; exports.$setUserAgentForTests = function (_isMobile, _isIOS) { isMobile = _isMobile; @@ -3471,7 +3454,7 @@ exports.HoverTooltip = HoverTooltip; }); -ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/tooltip","ace/config"], function(require, exports, module){"use strict"; +ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/tooltip","ace/config","ace/lib/lang"], function(require, exports, module){"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || @@ -3502,14 +3485,11 @@ var dom = require("../lib/dom"); var event = require("../lib/event"); var Tooltip = require("../tooltip").Tooltip; var nls = require("../config").nls; -var GUTTER_TOOLTIP_LEFT_OFFSET = 5; -var GUTTER_TOOLTIP_TOP_OFFSET = 3; -exports.GUTTER_TOOLTIP_LEFT_OFFSET = GUTTER_TOOLTIP_LEFT_OFFSET; -exports.GUTTER_TOOLTIP_TOP_OFFSET = GUTTER_TOOLTIP_TOP_OFFSET; +var lang = require("../lib/lang"); function GutterHandler(mouseHandler) { var editor = mouseHandler.editor; var gutter = editor.renderer.$gutterLayer; - var tooltip = new GutterTooltip(editor, true); + var tooltip = new GutterTooltip(editor); mouseHandler.editor.setDefaultHandler("guttermousedown", function (e) { if (!editor.isFocused() || e.getButton() != 0) return; @@ -3545,8 +3525,6 @@ function GutterHandler(mouseHandler) { if (!tooltip.isOpen) return; editor.on("mousewheel", hideTooltip); - editor.on("changeSession", hideTooltip); - window.addEventListener("keydown", hideTooltip, true); if (mouseHandler.$tooltipFollowsMouse) { moveTooltip(mouseEvent); } @@ -3557,26 +3535,20 @@ function GutterHandler(mouseHandler) { var gutterElement = gutterCell.element.querySelector(".ace_gutter_annotation"); var rect = gutterElement.getBoundingClientRect(); var style = tooltip.getElement().style; - style.left = (rect.right - GUTTER_TOOLTIP_LEFT_OFFSET) + "px"; - style.top = (rect.bottom - GUTTER_TOOLTIP_TOP_OFFSET) + "px"; + style.left = rect.right + "px"; + style.top = rect.bottom + "px"; } else { moveTooltip(mouseEvent); } } } - function hideTooltip(e) { - if (e && e.type === "keydown" && (e.ctrlKey || e.metaKey)) - return; - if (e && e.type === "mouseout" && (!e.relatedTarget || tooltip.getElement().contains(e.relatedTarget))) - return; + function hideTooltip() { if (tooltipTimeout) tooltipTimeout = clearTimeout(tooltipTimeout); if (tooltip.isOpen) { tooltip.hideTooltip(); editor.off("mousewheel", hideTooltip); - editor.off("changeSession", hideTooltip); - window.removeEventListener("keydown", hideTooltip, true); } } function moveTooltip(e) { @@ -3584,7 +3556,7 @@ function GutterHandler(mouseHandler) { } mouseHandler.editor.setDefaultHandler("guttermousemove", function (e) { var target = e.domEvent.target || e.domEvent.srcElement; - if (dom.hasCssClass(target, "ace_fold-widget") || dom.hasCssClass(target, "ace_custom-widget")) + if (dom.hasCssClass(target, "ace_fold-widget")) return hideTooltip(); if (tooltip.isOpen && mouseHandler.$tooltipFollowsMouse) moveTooltip(e); @@ -3595,46 +3567,30 @@ function GutterHandler(mouseHandler) { tooltipTimeout = null; if (mouseEvent && !mouseHandler.isMousePressed) showTooltip(); + else + hideTooltip(); }, 50); }); event.addListener(editor.renderer.$gutter, "mouseout", function (e) { mouseEvent = null; - if (!tooltip.isOpen) + if (!tooltip.isOpen || tooltipTimeout) return; tooltipTimeout = setTimeout(function () { tooltipTimeout = null; - hideTooltip(e); + hideTooltip(); }, 50); }, editor); + editor.on("changeSession", hideTooltip); + editor.on("input", hideTooltip); } exports.GutterHandler = GutterHandler; var GutterTooltip = /** @class */ (function (_super) { __extends(GutterTooltip, _super); - function GutterTooltip(editor, isHover) { - if (isHover === void 0) { isHover = false; } + function GutterTooltip(editor) { var _this = _super.call(this, editor.container) || this; - _this.id = "gt" + (++GutterTooltip.$uid); _this.editor = editor; - _this.visibleTooltipRow; - var el = _this.getElement(); - el.setAttribute("role", "tooltip"); - el.setAttribute("id", _this.id); - el.style.pointerEvents = "auto"; - if (isHover) { - _this.onMouseOut = _this.onMouseOut.bind(_this); - el.addEventListener("mouseout", _this.onMouseOut); - } return _this; } - GutterTooltip.prototype.onMouseOut = function (e) { - if (!this.isOpen) - return; - if (!e.relatedTarget || this.getElement().contains(e.relatedTarget)) - return; - if (e && e.currentTarget.contains(e.relatedTarget)) - return; - this.hideTooltip(); - }; GutterTooltip.prototype.setPosition = function (x, y) { var windowWidth = window.innerWidth || document.documentElement.clientWidth; var windowHeight = window.innerHeight || document.documentElement.clientHeight; @@ -3714,7 +3670,7 @@ var GutterTooltip = /** @class */ (function (_super) { } } if (annotation.displayText.length === 0) - return this.hideTooltip(); + return this.hide(); var annotationMessages = { error: [], security: [], warning: [], info: [], hint: [] }; var iconClassName = gutter.$useSvgGutterIcons ? "ace_icon_svg" : "ace_icon"; for (var i = 0; i < annotation.displayText.length; i++) { @@ -3741,39 +3697,12 @@ var GutterTooltip = /** @class */ (function (_super) { this.setTheme(this.editor.renderer.theme); this.setClassName("ace_gutter-tooltip"); } - var annotationNode = this.$findLinkedAnnotationNode(row); - if (annotationNode) { - annotationNode.setAttribute("aria-describedby", this.id); - } this.show(); - this.visibleTooltipRow = row; this.editor._signal("showGutterTooltip", this); }; - GutterTooltip.prototype.$findLinkedAnnotationNode = function (row) { - var cell = this.$findCellByRow(row); - if (cell) { - var element = cell.element; - if (element.childNodes.length > 2) { - return element.childNodes[2]; - } - } - }; - GutterTooltip.prototype.$findCellByRow = function (row) { - return this.editor.renderer.$gutterLayer.$lines.cells.find(function (el) { return el.row === row; }); - }; GutterTooltip.prototype.hideTooltip = function () { - if (!this.isOpen) { - return; - } this.$element.removeAttribute("aria-live"); this.hide(); - if (this.visibleTooltipRow != undefined) { - var annotationNode = this.$findLinkedAnnotationNode(this.visibleTooltipRow); - if (annotationNode) { - annotationNode.removeAttribute("aria-describedby"); - } - } - this.visibleTooltipRow = undefined; this.editor._signal("hideGutterTooltip", this); }; GutterTooltip.annotationsToSummaryString = function (annotations) { @@ -3800,7 +3729,6 @@ var GutterTooltip = /** @class */ (function (_super) { }; return GutterTooltip; }(Tooltip)); -GutterTooltip.$uid = 0; exports.GutterTooltip = GutterTooltip; }); @@ -4614,7 +4542,6 @@ var MouseHandler = /** @class */ (function () { var renderer = this.editor.renderer; renderer.$isMousePressed = true; var self = this; - var continueCapture = true; var onMouseMove = function (e) { if (!e) return; @@ -4628,9 +4555,9 @@ var MouseHandler = /** @class */ (function () { }; var onCaptureEnd = function (e) { editor.off("beforeEndOperation", onOperationEnd); - continueCapture = false; + clearInterval(timerId); if (editor.session) - onCaptureUpdate(); + onCaptureInterval(); self[self.state + "End"] && self[self.state + "End"](e); self.state = ""; self.isMousePressed = renderer.$isMousePressed = false; @@ -4640,16 +4567,10 @@ var MouseHandler = /** @class */ (function () { e && self.onMouseEvent("mouseup", e); editor.endOperation(); }; - var onCaptureUpdate = function () { + var onCaptureInterval = function () { self[self.state] && self[self.state](); self.$mouseMoved = false; }; - var onCaptureInterval = function () { - if (continueCapture) { - onCaptureUpdate(); - event.nextFrame(onCaptureInterval); - } - }; if (useragent.isOldIE && ev.domEvent.type == "dblclick") { return setTimeout(function () { onCaptureEnd(ev); }); } @@ -4666,7 +4587,7 @@ var MouseHandler = /** @class */ (function () { editor.startOperation({ command: { name: "mouse" } }); self.$onCaptureMouseMove = onMouseMove; self.releaseMouse = event.capture(this.editor.container, onMouseMove, onCaptureEnd); - onCaptureInterval(); + var timerId = setInterval(onCaptureInterval, 20); }; MouseHandler.prototype.cancelContextMenu = function () { var stop = function (e) { @@ -7370,345 +7291,6 @@ exports.Mode = Mode; }); -ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"], function(require, exports, module){"use strict"; -var dom = require("./lib/dom"); -var LineWidgets = /** @class */ (function () { - function LineWidgets(session) { - this.session = session; - this.session.widgetManager = this; - this.session.getRowLength = this.getRowLength; - this.session.$getWidgetScreenLength = this.$getWidgetScreenLength; - this.updateOnChange = this.updateOnChange.bind(this); - this.renderWidgets = this.renderWidgets.bind(this); - this.measureWidgets = this.measureWidgets.bind(this); - this.session._changedWidgets = []; - this.$onChangeEditor = this.$onChangeEditor.bind(this); - this.session.on("change", this.updateOnChange); - this.session.on("changeFold", this.updateOnFold); - this.session.on("changeEditor", this.$onChangeEditor); - } - LineWidgets.prototype.getRowLength = function (row) { - var h; - if (this.lineWidgets) - h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0; - else - h = 0; - if (!this["$useWrapMode"] || !this["$wrapData"][row]) { - return 1 + h; - } - else { - return this["$wrapData"][row].length + 1 + h; - } - }; - LineWidgets.prototype.$getWidgetScreenLength = function () { - var screenRows = 0; - this.lineWidgets.forEach(function (w) { - if (w && w.rowCount && !w.hidden) - screenRows += w.rowCount; - }); - return screenRows; - }; - LineWidgets.prototype.$onChangeEditor = function (e) { - this.attach(e.editor); - }; - LineWidgets.prototype.attach = function (editor) { - if (editor && editor.widgetManager && editor.widgetManager != this) - editor.widgetManager.detach(); - if (this.editor == editor) - return; - this.detach(); - this.editor = editor; - if (editor) { - editor.widgetManager = this; - editor.renderer.on("beforeRender", this.measureWidgets); - editor.renderer.on("afterRender", this.renderWidgets); - } - }; - LineWidgets.prototype.detach = function (e) { - var editor = this.editor; - if (!editor) - return; - this.editor = null; - editor.widgetManager = null; - editor.renderer.off("beforeRender", this.measureWidgets); - editor.renderer.off("afterRender", this.renderWidgets); - var lineWidgets = this.session.lineWidgets; - lineWidgets && lineWidgets.forEach(function (w) { - if (w && w.el && w.el.parentNode) { - w._inDocument = false; - w.el.parentNode.removeChild(w.el); - } - }); - }; - LineWidgets.prototype.updateOnFold = function (e, session) { - var lineWidgets = session.lineWidgets; - if (!lineWidgets || !e.action) - return; - var fold = e.data; - var start = fold.start.row; - var end = fold.end.row; - var hide = e.action == "add"; - for (var i = start + 1; i < end; i++) { - if (lineWidgets[i]) - lineWidgets[i].hidden = hide; - } - if (lineWidgets[end]) { - if (hide) { - if (!lineWidgets[start]) - lineWidgets[start] = lineWidgets[end]; - else - lineWidgets[end].hidden = hide; - } - else { - if (lineWidgets[start] == lineWidgets[end]) - lineWidgets[start] = undefined; - lineWidgets[end].hidden = hide; - } - } - }; - LineWidgets.prototype.updateOnChange = function (delta) { - var lineWidgets = this.session.lineWidgets; - if (!lineWidgets) - return; - var startRow = delta.start.row; - var len = delta.end.row - startRow; - if (len === 0) { - } - else if (delta.action == "remove") { - var removed = lineWidgets.splice(startRow + 1, len); - if (!lineWidgets[startRow] && removed[removed.length - 1]) { - lineWidgets[startRow] = removed.pop(); - } - removed.forEach(function (w) { - w && this.removeLineWidget(w); - }, this); - this.$updateRows(); - } - else { - var args = new Array(len); - if (lineWidgets[startRow] && lineWidgets[startRow].column != null) { - if (delta.start.column > lineWidgets[startRow].column) - startRow++; - } - args.unshift(startRow, 0); - lineWidgets.splice.apply(lineWidgets, args); - this.$updateRows(); - } - }; - LineWidgets.prototype.$updateRows = function () { - var lineWidgets = this.session.lineWidgets; - if (!lineWidgets) - return; - var noWidgets = true; - lineWidgets.forEach(function (w, i) { - if (w) { - noWidgets = false; - w.row = i; - while (w.$oldWidget) { - w.$oldWidget.row = i; - w = w.$oldWidget; - } - } - }); - if (noWidgets) - this.session.lineWidgets = null; - }; - LineWidgets.prototype.$registerLineWidget = function (w) { - if (!this.session.lineWidgets) - this.session.lineWidgets = new Array(this.session.getLength()); - var old = this.session.lineWidgets[w.row]; - if (old) { - w.$oldWidget = old; - if (old.el && old.el.parentNode) { - old.el.parentNode.removeChild(old.el); - old._inDocument = false; - } - } - this.session.lineWidgets[w.row] = w; - return w; - }; - LineWidgets.prototype.addLineWidget = function (w) { - this.$registerLineWidget(w); - w.session = this.session; - if (!this.editor) - return w; - var renderer = this.editor.renderer; - if (w.html && !w.el) { - w.el = dom.createElement("div"); - w.el.innerHTML = w.html; - } - if (w.text && !w.el) { - w.el = dom.createElement("div"); - w.el.textContent = w.text; - } - if (w.el) { - dom.addCssClass(w.el, "ace_lineWidgetContainer"); - if (w.className) { - dom.addCssClass(w.el, w.className); - } - w.el.style.position = "absolute"; - w.el.style.zIndex = "5"; - renderer.container.appendChild(w.el); - w._inDocument = true; - if (!w.coverGutter) { - w.el.style.zIndex = "3"; - } - if (w.pixelHeight == null) { - w.pixelHeight = w.el.offsetHeight; - } - } - if (w.rowCount == null) { - w.rowCount = w.pixelHeight / renderer.layerConfig.lineHeight; - } - var fold = this.session.getFoldAt(w.row, 0); - w.$fold = fold; - if (fold) { - var lineWidgets = this.session.lineWidgets; - if (w.row == fold.end.row && !lineWidgets[fold.start.row]) - lineWidgets[fold.start.row] = w; - else - w.hidden = true; - } - this.session._emit("changeFold", { data: { start: { row: w.row } } }); - this.$updateRows(); - this.renderWidgets(null, renderer); - this.onWidgetChanged(w); - return w; - }; - LineWidgets.prototype.removeLineWidget = function (w) { - w._inDocument = false; - w.session = null; - if (w.el && w.el.parentNode) - w.el.parentNode.removeChild(w.el); - if (w.editor && w.editor.destroy) - try { - w.editor.destroy(); - } - catch (e) { } - if (this.session.lineWidgets) { - var w1 = this.session.lineWidgets[w.row]; - if (w1 == w) { - this.session.lineWidgets[w.row] = w.$oldWidget; - if (w.$oldWidget) - this.onWidgetChanged(w.$oldWidget); - } - else { - while (w1) { - if (w1.$oldWidget == w) { - w1.$oldWidget = w.$oldWidget; - break; - } - w1 = w1.$oldWidget; - } - } - } - this.session._emit("changeFold", { data: { start: { row: w.row } } }); - this.$updateRows(); - }; - LineWidgets.prototype.getWidgetsAtRow = function (row) { - var lineWidgets = this.session.lineWidgets; - var w = lineWidgets && lineWidgets[row]; - var list = []; - while (w) { - list.push(w); - w = w.$oldWidget; - } - return list; - }; - LineWidgets.prototype.onWidgetChanged = function (w) { - this.session._changedWidgets.push(w); - this.editor && this.editor.renderer.updateFull(); - }; - LineWidgets.prototype.measureWidgets = function (e, renderer) { - var changedWidgets = this.session._changedWidgets; - var config = renderer.layerConfig; - if (!changedWidgets || !changedWidgets.length) - return; - var min = Infinity; - for (var i = 0; i < changedWidgets.length; i++) { - var w = changedWidgets[i]; - if (!w || !w.el) - continue; - if (w.session != this.session) - continue; - if (!w._inDocument) { - if (this.session.lineWidgets[w.row] != w) - continue; - w._inDocument = true; - renderer.container.appendChild(w.el); - } - w.h = w.el.offsetHeight; - if (!w.fixedWidth) { - w.w = w.el.offsetWidth; - w.screenWidth = Math.ceil(w.w / config.characterWidth); - } - var rowCount = w.h / config.lineHeight; - if (w.coverLine) { - rowCount -= this.session.getRowLineCount(w.row); - if (rowCount < 0) - rowCount = 0; - } - if (w.rowCount != rowCount) { - w.rowCount = rowCount; - if (w.row < min) - min = w.row; - } - } - if (min != Infinity) { - this.session._emit("changeFold", { data: { start: { row: min } } }); - this.session.lineWidgetWidth = null; - } - this.session._changedWidgets = []; - }; - LineWidgets.prototype.renderWidgets = function (e, renderer) { - var config = renderer.layerConfig; - var lineWidgets = this.session.lineWidgets; - if (!lineWidgets) - return; - var first = Math.min(this.firstRow, config.firstRow); - var last = Math.max(this.lastRow, config.lastRow, lineWidgets.length); - while (first > 0 && !lineWidgets[first]) - first--; - this.firstRow = config.firstRow; - this.lastRow = config.lastRow; - renderer.$cursorLayer.config = config; - for (var i = first; i <= last; i++) { - var w = lineWidgets[i]; - if (!w || !w.el) - continue; - if (w.hidden) { - w.el.style.top = -100 - (w.pixelHeight || 0) + "px"; - continue; - } - if (!w._inDocument) { - w._inDocument = true; - renderer.container.appendChild(w.el); - } - var top = renderer.$cursorLayer.getPixelPosition({ row: i, column: 0 }, true).top; - if (!w.coverLine) - top += config.lineHeight * this.session.getRowLineCount(w.row); - w.el.style.top = top - config.offset + "px"; - var left = w.coverGutter ? 0 : renderer.gutterWidth; - if (!w.fixedWidth) - left -= renderer.scrollLeft; - w.el.style.left = left + "px"; - if (w.fullWidth && w.screenWidth) { - w.el.style.minWidth = config.width + 2 * config.padding + "px"; - } - if (w.fixedWidth) { - w.el.style.right = renderer.scrollBar.getWidth() + "px"; - } - else { - w.el.style.right = ""; - } - } - }; - return LineWidgets; -}()); -exports.LineWidgets = LineWidgets; - -}); - ace.define("ace/apply_delta",["require","exports","module"], function(require, exports, module){"use strict"; function throwDeltaError(delta, errorText) { console.log("Invalid Delta:", delta); @@ -8359,7 +7941,6 @@ var SearchHighlight = /** @class */ (function () { this.setRegexp(regExp); this.clazz = clazz; this.type = type; - this.docLen = 0; } SearchHighlight.prototype.setRegexp = function (regExp) { if (this.regExp + "" == regExp + "") @@ -8370,38 +7951,19 @@ var SearchHighlight = /** @class */ (function () { SearchHighlight.prototype.update = function (html, markerLayer, session, config) { if (!this.regExp) return; - var start = config.firstRow; - var end = config.lastRow; + var start = config.firstRow, end = config.lastRow; var renderedMarkerRanges = {}; - var _search = session.$editor && session.$editor.$search; - var mtSearch = _search && _search.$isMultilineSearch(session.$editor.getLastSearchOptions()); for (var i = start; i <= end; i++) { var ranges = this.cache[i]; - if (ranges == null || session.getValue().length != this.docLen) { - if (mtSearch) { - ranges = []; - var match = _search.$multiLineForward(session, this.regExp, i, end); - if (match) { - var end_row = match.endRow <= end ? match.endRow - 1 : end; - if (end_row > i) - i = end_row; - ranges.push(new Range(match.startRow, match.startCol, match.endRow, match.endCol)); - } - if (ranges.length > this.MAX_RANGES) - ranges = ranges.slice(0, this.MAX_RANGES); - } - else { - ranges = lang.getMatchOffsets(session.getLine(i), this.regExp); - if (ranges.length > this.MAX_RANGES) - ranges = ranges.slice(0, this.MAX_RANGES); - ranges = ranges.map(function (match) { - return new Range(i, match.offset, i, match.offset + match.length); - }); - } + if (ranges == null) { + ranges = lang.getMatchOffsets(session.getLine(i), this.regExp); + if (ranges.length > this.MAX_RANGES) + ranges = ranges.slice(0, this.MAX_RANGES); + ranges = ranges.map(function (match) { + return new Range(i, match.offset, i, match.offset + match.length); + }); this.cache[i] = ranges.length ? ranges : ""; } - if (ranges.length === 0) - continue; for (var j = ranges.length; j--;) { var rangeToAddMarkerTo = ranges[j].toScreenRange(session); var rangeAsString = rangeToAddMarkerTo.toString(); @@ -8411,7 +7973,6 @@ var SearchHighlight = /** @class */ (function () { markerLayer.drawSingleLineMarker(html, rangeToAddMarkerTo, this.clazz, config); } } - this.docLen = session.getValue().length; }; return SearchHighlight; }()); @@ -9851,12 +9412,6 @@ function Folding() { this.expandFold(fold); return; } - else if (tryToUnfold) { - var foldLine = this.getFoldLine(cursor.row); - if (foldLine) - this.expandFolds(foldLine.folds); - return; - } else if (bracketPos = this.findMatchingBracket(cursor)) { if (range.comparePoint(bracketPos) == 1) { range.end = bracketPos; @@ -9942,8 +9497,6 @@ function Folding() { token = iterator.getCurrentToken(); range.end.row = iterator.getCurrentTokenRow(); range.end.column = iterator.getCurrentTokenColumn(); - if (range.start.row == range.end.row && range.start.column > range.end.column) - return; return range; } }; @@ -10506,7 +10059,7 @@ exports.BracketMatch = BracketMatch; }); -ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/line_widgets","ace/document","ace/background_tokenizer","ace/search_highlight","ace/undomanager","ace/edit_session/folding","ace/edit_session/bracket_match"], function(require, exports, module){"use strict"; +ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/document","ace/background_tokenizer","ace/search_highlight","ace/undomanager","ace/edit_session/folding","ace/edit_session/bracket_match"], function(require, exports, module){"use strict"; var oop = require("./lib/oop"); var lang = require("./lib/lang"); var BidiHandler = require("./bidihandler").BidiHandler; @@ -10515,7 +10068,6 @@ var EventEmitter = require("./lib/event_emitter").EventEmitter; var Selection = require("./selection").Selection; var TextMode = require("./mode/text").Mode; var Range = require("./range").Range; -var LineWidgets = require("./line_widgets").LineWidgets; var Document = require("./document").Document; var BackgroundTokenizer = require("./background_tokenizer").BackgroundTokenizer; var SearchHighlight = require("./search_highlight").SearchHighlight; @@ -10528,14 +10080,11 @@ var EditSession = /** @class */ (function () { this.$backMarkers = {}; this.$markerId = 1; this.$undoSelect = true; - this.$editor = null; - this.prevOp = {}; this.$foldData = []; this.id = "session" + (++EditSession.$uid); this.$foldData.toString = function () { return this.join("\n"); }; - this.$gutterCustomWidgets = {}; this.bgTokenizer = new BackgroundTokenizer((new TextMode()).getTokenizer(), this); var _self = this; this.bgTokenizer.on("update", function (e) { @@ -10547,73 +10096,12 @@ var EditSession = /** @class */ (function () { text = new Document(/**@type{string}*/ (text)); this.setDocument(text); this.selection = new Selection(this); - this.$onSelectionChange = this.onSelectionChange.bind(this); - this.selection.on("changeSelection", this.$onSelectionChange); - this.selection.on("changeCursor", this.$onSelectionChange); this.$bidiHandler = new BidiHandler(this); config.resetOptions(this); this.setMode(mode); config._signal("session", this); this.destroyed = false; - this.$initOperationListeners(); } - EditSession.prototype.$initOperationListeners = function () { - var _this = this; - this.curOp = null; - this.on("change", function () { - if (!_this.curOp) { - _this.startOperation(); - _this.curOp.selectionBefore = _this.$lastSel; - } - _this.curOp.docChanged = true; - }, true); - this.on("changeSelection", function () { - if (!_this.curOp) { - _this.startOperation(); - _this.curOp.selectionBefore = _this.$lastSel; - } - _this.curOp.selectionChanged = true; - }, true); - this.$operationResetTimer = lang.delayedCall(this.endOperation.bind(this, true)); - }; - EditSession.prototype.startOperation = function (commandEvent) { - if (this.curOp) { - if (!commandEvent || this.curOp.command) { - return; - } - this.prevOp = this.curOp; - } - if (!commandEvent) { - commandEvent = {}; - } - this.$operationResetTimer.schedule(); - this.curOp = { - command: commandEvent.command || {}, - args: commandEvent.args - }; - this.curOp.selectionBefore = this.selection.toJSON(); - this._signal("startOperation", commandEvent); - }; - EditSession.prototype.endOperation = function (e) { - if (this.curOp) { - if (e && e.returnValue === false) { - this.curOp = null; - this._signal("endOperation", e); - return; - } - if (e == true && this.curOp.command && this.curOp.command.name == "mouse") { - return; - } - var currentSelection = this.selection.toJSON(); - this.curOp.selectionAfter = currentSelection; - this.$lastSel = this.selection.toJSON(); - this.getUndoManager().addSelection(currentSelection); - this._signal("beforeEndOperation"); - this.prevOp = this.curOp; - this.curOp = null; - this._signal("endOperation", e); - } - }; EditSession.prototype.setDocument = function (doc) { if (this.doc) this.doc.off("change", this.$onChange); @@ -10625,25 +10113,6 @@ var EditSession = /** @class */ (function () { EditSession.prototype.getDocument = function () { return this.doc; }; - Object.defineProperty(EditSession.prototype, "widgetManager", { - get: function () { - var widgetManager = new LineWidgets(this); - this.widgetManager = widgetManager; - if (this.$editor) - widgetManager.attach(this.$editor); - return widgetManager; - }, - set: function (value) { - Object.defineProperty(this, "widgetManager", { - writable: true, - enumerable: true, - configurable: true, - value: value, - }); - }, - enumerable: false, - configurable: true - }); EditSession.prototype.$resetRowCache = function (docRow) { if (!docRow) { this.$docRowCache = []; @@ -10704,9 +10173,6 @@ var EditSession = /** @class */ (function () { this.bgTokenizer.$updateOnChange(delta); this._signal("change", delta); }; - EditSession.prototype.onSelectionChange = function () { - this._signal("changeSelection"); - }; EditSession.prototype.setValue = function (text) { this.doc.setValue(text); this.selection.moveTo(0, 0); @@ -10851,16 +10317,6 @@ var EditSession = /** @class */ (function () { this.$decorations[row] += " " + className; this._signal("changeBreakpoint", {}); }; - EditSession.prototype.removeGutterCustomWidget = function (row) { - if (this.$editor) { - this.$editor.renderer.$gutterLayer.$removeCustomWidget(row); - } - }; - EditSession.prototype.addGutterCustomWidget = function (row, attributes) { - if (this.$editor) { - this.$editor.renderer.$gutterLayer.$addCustomWidget(row, attributes); - } - }; EditSession.prototype.removeGutterDecoration = function (row, className) { this.$decorations[row] = (this.$decorations[row] || "").replace(" " + className, ""); this._signal("changeBreakpoint", {}); @@ -11042,9 +10498,6 @@ var EditSession = /** @class */ (function () { } this.$modeId = path; config.loadModule(["mode", path], function (m) { - if (this.destroyed) { - return; - } if (this.$modeId !== path) return cb && cb(); if (this.$modes[path] && !options) { @@ -12062,16 +11515,11 @@ var EditSession = /** @class */ (function () { this.bgTokenizer.cleanup(); this.destroyed = true; } - this.endOperation(); this.$stopWorker(); this.removeAllListeners(); if (this.doc) { this.doc.off("change", this.$onChange); } - if (this.selection) { - this.selection.off("changeCursor", this.$onSelectionChange); - this.selection.off("changeSelection", this.$onSelectionChange); - } this.selection.detach(); }; return EditSession; @@ -12321,23 +11769,11 @@ var Search = /** @class */ (function () { } } else { - for (var matches, i = 0; i < lines.length; i++) { - if (this.$isMultilineSearch(options)) { - var lng = lines.length - 1; - matches = this.$multiLineForward(session, re, i, lng); - if (matches) { - var end_row = matches.endRow <= lng ? matches.endRow - 1 : lng; - if (end_row > i) - i = end_row; - ranges.push(new Range(matches.startRow, matches.startCol, matches.endRow, matches.endCol)); - } - } - else { - matches = lang.getMatchOffsets(lines[i], re); - for (var j = 0; j < matches.length; j++) { - var match = matches[j]; - ranges.push(new Range(i, match.offset, i, match.offset + match.length)); - } + for (var i = 0; i < lines.length; i++) { + var matches = lang.getMatchOffsets(lines[i], re); + for (var j = 0; j < matches.length; j++) { + var match = matches[j]; + ranges.push(new Range(i, match.offset, i, match.offset + match.length)); } } } @@ -12358,64 +11794,6 @@ var Search = /** @class */ (function () { } return ranges; }; - Search.prototype.parseReplaceString = function (replaceString) { - var CharCode = { - DollarSign: 36, - Ampersand: 38, - Digit0: 48, - Digit1: 49, - Digit9: 57, - Backslash: 92, - n: 110, - t: 116 - }; - var replacement = ''; - for (var i = 0, len = replaceString.length; i < len; i++) { - var chCode = replaceString.charCodeAt(i); - if (chCode === CharCode.Backslash) { - i++; - if (i >= len) { - replacement += "\\"; - break; - } - var nextChCode = replaceString.charCodeAt(i); - switch (nextChCode) { - case CharCode.Backslash: - replacement += "\\"; - break; - case CharCode.n: - replacement += "\n"; - break; - case CharCode.t: - replacement += "\t"; - break; - } - continue; - } - if (chCode === CharCode.DollarSign) { - i++; - if (i >= len) { - replacement += "$"; - break; - } - var nextChCode_1 = replaceString.charCodeAt(i); - if (nextChCode_1 === CharCode.DollarSign) { - replacement += "$$"; - continue; - } - if (nextChCode_1 === CharCode.Digit0 || nextChCode_1 === CharCode.Ampersand) { - replacement += "$&"; - continue; - } - if (CharCode.Digit1 <= nextChCode_1 && nextChCode_1 <= CharCode.Digit9) { - replacement += "$" + replaceString[i]; - continue; - } - } - replacement += replaceString[i]; - } - return replacement || replaceString; - }; Search.prototype.replace = function (input, replacement) { var options = this.$options; var re = this.$assembleRegExp(options); @@ -12423,15 +11801,12 @@ var Search = /** @class */ (function () { return replacement; if (!re) return; - var mtSearch = this.$isMultilineSearch(options); - if (mtSearch) - input = input.replace(/\r\n|\r|\n/g, "\n"); var match = re.exec(input); - if (!match || (!mtSearch && match[0].length != input.length)) + if (!match || match[0].length != input.length) return null; - replacement = options.regExp - ? this.parseReplaceString(replacement) - : replacement.replace(/\$/g, "$$$$"); + if (!options.regExp) { + replacement = replacement.replace(/\$/g, "$$$$"); + } replacement = input.replace(re, replacement); if (options.preserveCase) { replacement = replacement.split(""); @@ -12488,73 +11863,10 @@ var Search = /** @class */ (function () { } return re; }; - Search.prototype.$isMultilineSearch = function (options) { - return options.re && /\\r\\n|\\r|\\n/.test(options.re.source) && options.regExp && !options.$isMultiLine; - }; - Search.prototype.$multiLineForward = function (session, re, start, last) { - var line, chunk = chunkEnd(session, start); - for (var row = start; row <= last;) { - for (var i = 0; i < chunk; i++) { - if (row > last) - break; - var next = session.getLine(row++); - line = line == null ? next : line + "\n" + next; - } - var match = re.exec(line); - re.lastIndex = 0; - if (match) { - var beforeMatch = line.slice(0, match.index).split("\n"); - var matchedText = match[0].split("\n"); - var startRow = start + beforeMatch.length - 1; - var startCol = beforeMatch[beforeMatch.length - 1].length; - var endRow = startRow + matchedText.length - 1; - var endCol = matchedText.length == 1 - ? startCol + matchedText[0].length - : matchedText[matchedText.length - 1].length; - return { - startRow: startRow, - startCol: startCol, - endRow: endRow, - endCol: endCol - }; - } - } - return null; - }; - Search.prototype.$multiLineBackward = function (session, re, endIndex, start, first) { - var line, chunk = chunkEnd(session, start), endMargin = session.getLine(start).length - endIndex; - for (var row = start; row >= first;) { - for (var i = 0; i < chunk && row >= first; i++) { - var next = session.getLine(row--); - line = line == null ? next : next + "\n" + line; - } - var match = multiLineBackwardMatch(line, re, endMargin); - if (match) { - var beforeMatch = line.slice(0, match.index).split("\n"); - var matchedText = match[0].split("\n"); - var startRow = row + beforeMatch.length; - var startCol = beforeMatch[beforeMatch.length - 1].length; - var endRow = startRow + matchedText.length - 1; - var endCol = matchedText.length == 1 - ? startCol + matchedText[0].length - : matchedText[matchedText.length - 1].length; - return { - startRow: startRow, - startCol: startCol, - endRow: endRow, - endCol: endCol - }; - } - } - return null; - }; Search.prototype.$matchIterator = function (session, options) { var re = this.$assembleRegExp(options); if (!re) return false; - var mtSearch = this.$isMultilineSearch(options); - var mtForward = this.$multiLineForward; - var mtBackward = this.$multiLineBackward; var backwards = options.backwards == true; var skipCurrent = options.skipCurrent != false; var supportsUnicodeFlag = re.unicode; @@ -12620,68 +11932,45 @@ var Search = /** @class */ (function () { } else if (backwards) { var forEachInLine = function (row, endIndex, callback) { - if (mtSearch) { - var pos = mtBackward(session, re, endIndex, row, firstRow); - if (!pos) - return false; - if (callback(pos.startRow, pos.startCol, pos.endRow, pos.endCol)) - return true; - } - else { - var line = session.getLine(row); - var matches = []; - var m, last = 0; - re.lastIndex = 0; - while ((m = re.exec(line))) { - var length = m[0].length; - last = m.index; - if (!length) { - if (last >= line.length) - break; - re.lastIndex = last += lang.skipEmptyMatch(line, last, supportsUnicodeFlag); - } - if (m.index + length > endIndex) + var line = session.getLine(row); + var matches = []; + var m, last = 0; + re.lastIndex = 0; + while ((m = re.exec(line))) { + var length = m[0].length; + last = m.index; + if (!length) { + if (last >= line.length) break; - matches.push(m.index, length); - } - for (var i = matches.length - 1; i >= 0; i -= 2) { - var column = matches[i - 1]; - var length = matches[i]; - if (callback(row, column, row, column + length)) - return true; + re.lastIndex = last += lang.skipEmptyMatch(line, last, supportsUnicodeFlag); } + if (m.index + length > endIndex) + break; + matches.push(m.index, length); + } + for (var i = matches.length - 1; i >= 0; i -= 2) { + var column = matches[i - 1]; + var length = matches[i]; + if (callback(row, column, row, column + length)) + return true; } }; } else { var forEachInLine = function (row, startIndex, callback) { + var line = session.getLine(row); + var last; + var m; re.lastIndex = startIndex; - if (mtSearch) { - var pos = mtForward(session, re, row, lastRow); - if (pos) { - var end_row = pos.endRow <= lastRow ? pos.endRow - 1 : lastRow; - if (end_row > row) - row = end_row; - } - if (!pos) - return false; - if (callback(pos.startRow, pos.startCol, pos.endRow, pos.endCol)) + while ((m = re.exec(line))) { + var length = m[0].length; + last = m.index; + if (callback(row, last, row, last + length)) return true; - } - else { - var line = session.getLine(row); - var last; - var m; - while ((m = re.exec(line))) { - var length = m[0].length; - last = m.index; - if (callback(row, last, row, last + length)) - return true; - if (!length) { - re.lastIndex = last += lang.skipEmptyMatch(line, last, supportsUnicodeFlag); - if (last >= line.length) - return false; - } + if (!length) { + re.lastIndex = last += lang.skipEmptyMatch(line, last, supportsUnicodeFlag); + if (last >= line.length) + return false; } } }; @@ -12710,27 +11999,6 @@ function addWordBoundary(needle, options) { var lastChar = needleArray[needleArray.length - 1]; return wordBoundary(firstChar) + needle + wordBoundary(lastChar, false); } -function multiLineBackwardMatch(line, re, endMargin) { - var match = null; - var from = 0; - while (from <= line.length) { - re.lastIndex = from; - var newMatch = re.exec(line); - if (!newMatch) - break; - var end = newMatch.index + newMatch[0].length; - if (end > line.length - endMargin) - break; - if (!match || end > match.index + match[0].length) - match = newMatch; - from = newMatch.index + 1; - } - return match; -} -function chunkEnd(session, start) { - var base = 5000, startPosition = { row: start, column: 0 }, startIndex = session.doc.positionToIndex(startPosition), targetIndex = startIndex + base, targetPosition = session.doc.indexToPosition(targetIndex), targetLine = targetPosition.row; - return targetLine + 1; -} exports.Search = Search; }); @@ -12997,11 +12265,10 @@ var CommandManager = /** @class */ (function (_super) { } if (typeof command === "string") command = this.commands[command]; - var e = { editor: editor, command: command, args: args }; if (!this.canExecute(command, editor)) { - this._signal("commandUnavailable", e); return false; } + var e = { editor: editor, command: command, args: args }; e.returnValue = this._emit("exec", e); this._signal("afterExec", e); return e.returnValue === false ? false : true; @@ -13936,6 +13203,345 @@ for (var i = 1; i < 9; i++) { }); +ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"], function(require, exports, module){"use strict"; +var dom = require("./lib/dom"); +var LineWidgets = /** @class */ (function () { + function LineWidgets(session) { + this.session = session; + this.session.widgetManager = this; + this.session.getRowLength = this.getRowLength; + this.session.$getWidgetScreenLength = this.$getWidgetScreenLength; + this.updateOnChange = this.updateOnChange.bind(this); + this.renderWidgets = this.renderWidgets.bind(this); + this.measureWidgets = this.measureWidgets.bind(this); + this.session._changedWidgets = []; + this.$onChangeEditor = this.$onChangeEditor.bind(this); + this.session.on("change", this.updateOnChange); + this.session.on("changeFold", this.updateOnFold); + this.session.on("changeEditor", this.$onChangeEditor); + } + LineWidgets.prototype.getRowLength = function (row) { + var h; + if (this.lineWidgets) + h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0; + else + h = 0; + if (!this["$useWrapMode"] || !this["$wrapData"][row]) { + return 1 + h; + } + else { + return this["$wrapData"][row].length + 1 + h; + } + }; + LineWidgets.prototype.$getWidgetScreenLength = function () { + var screenRows = 0; + this.lineWidgets.forEach(function (w) { + if (w && w.rowCount && !w.hidden) + screenRows += w.rowCount; + }); + return screenRows; + }; + LineWidgets.prototype.$onChangeEditor = function (e) { + this.attach(e.editor); + }; + LineWidgets.prototype.attach = function (editor) { + if (editor && editor.widgetManager && editor.widgetManager != this) + editor.widgetManager.detach(); + if (this.editor == editor) + return; + this.detach(); + this.editor = editor; + if (editor) { + editor.widgetManager = this; + editor.renderer.on("beforeRender", this.measureWidgets); + editor.renderer.on("afterRender", this.renderWidgets); + } + }; + LineWidgets.prototype.detach = function (e) { + var editor = this.editor; + if (!editor) + return; + this.editor = null; + editor.widgetManager = null; + editor.renderer.off("beforeRender", this.measureWidgets); + editor.renderer.off("afterRender", this.renderWidgets); + var lineWidgets = this.session.lineWidgets; + lineWidgets && lineWidgets.forEach(function (w) { + if (w && w.el && w.el.parentNode) { + w._inDocument = false; + w.el.parentNode.removeChild(w.el); + } + }); + }; + LineWidgets.prototype.updateOnFold = function (e, session) { + var lineWidgets = session.lineWidgets; + if (!lineWidgets || !e.action) + return; + var fold = e.data; + var start = fold.start.row; + var end = fold.end.row; + var hide = e.action == "add"; + for (var i = start + 1; i < end; i++) { + if (lineWidgets[i]) + lineWidgets[i].hidden = hide; + } + if (lineWidgets[end]) { + if (hide) { + if (!lineWidgets[start]) + lineWidgets[start] = lineWidgets[end]; + else + lineWidgets[end].hidden = hide; + } + else { + if (lineWidgets[start] == lineWidgets[end]) + lineWidgets[start] = undefined; + lineWidgets[end].hidden = hide; + } + } + }; + LineWidgets.prototype.updateOnChange = function (delta) { + var lineWidgets = this.session.lineWidgets; + if (!lineWidgets) + return; + var startRow = delta.start.row; + var len = delta.end.row - startRow; + if (len === 0) { + } + else if (delta.action == "remove") { + var removed = lineWidgets.splice(startRow + 1, len); + if (!lineWidgets[startRow] && removed[removed.length - 1]) { + lineWidgets[startRow] = removed.pop(); + } + removed.forEach(function (w) { + w && this.removeLineWidget(w); + }, this); + this.$updateRows(); + } + else { + var args = new Array(len); + if (lineWidgets[startRow] && lineWidgets[startRow].column != null) { + if (delta.start.column > lineWidgets[startRow].column) + startRow++; + } + args.unshift(startRow, 0); + lineWidgets.splice.apply(lineWidgets, args); + this.$updateRows(); + } + }; + LineWidgets.prototype.$updateRows = function () { + var lineWidgets = this.session.lineWidgets; + if (!lineWidgets) + return; + var noWidgets = true; + lineWidgets.forEach(function (w, i) { + if (w) { + noWidgets = false; + w.row = i; + while (w.$oldWidget) { + w.$oldWidget.row = i; + w = w.$oldWidget; + } + } + }); + if (noWidgets) + this.session.lineWidgets = null; + }; + LineWidgets.prototype.$registerLineWidget = function (w) { + if (!this.session.lineWidgets) + this.session.lineWidgets = new Array(this.session.getLength()); + var old = this.session.lineWidgets[w.row]; + if (old) { + w.$oldWidget = old; + if (old.el && old.el.parentNode) { + old.el.parentNode.removeChild(old.el); + old._inDocument = false; + } + } + this.session.lineWidgets[w.row] = w; + return w; + }; + LineWidgets.prototype.addLineWidget = function (w) { + this.$registerLineWidget(w); + w.session = this.session; + if (!this.editor) + return w; + var renderer = this.editor.renderer; + if (w.html && !w.el) { + w.el = dom.createElement("div"); + w.el.innerHTML = w.html; + } + if (w.text && !w.el) { + w.el = dom.createElement("div"); + w.el.textContent = w.text; + } + if (w.el) { + dom.addCssClass(w.el, "ace_lineWidgetContainer"); + if (w.className) { + dom.addCssClass(w.el, w.className); + } + w.el.style.position = "absolute"; + w.el.style.zIndex = "5"; + renderer.container.appendChild(w.el); + w._inDocument = true; + if (!w.coverGutter) { + w.el.style.zIndex = "3"; + } + if (w.pixelHeight == null) { + w.pixelHeight = w.el.offsetHeight; + } + } + if (w.rowCount == null) { + w.rowCount = w.pixelHeight / renderer.layerConfig.lineHeight; + } + var fold = this.session.getFoldAt(w.row, 0); + w.$fold = fold; + if (fold) { + var lineWidgets = this.session.lineWidgets; + if (w.row == fold.end.row && !lineWidgets[fold.start.row]) + lineWidgets[fold.start.row] = w; + else + w.hidden = true; + } + this.session._emit("changeFold", { data: { start: { row: w.row } } }); + this.$updateRows(); + this.renderWidgets(null, renderer); + this.onWidgetChanged(w); + return w; + }; + LineWidgets.prototype.removeLineWidget = function (w) { + w._inDocument = false; + w.session = null; + if (w.el && w.el.parentNode) + w.el.parentNode.removeChild(w.el); + if (w.editor && w.editor.destroy) + try { + w.editor.destroy(); + } + catch (e) { } + if (this.session.lineWidgets) { + var w1 = this.session.lineWidgets[w.row]; + if (w1 == w) { + this.session.lineWidgets[w.row] = w.$oldWidget; + if (w.$oldWidget) + this.onWidgetChanged(w.$oldWidget); + } + else { + while (w1) { + if (w1.$oldWidget == w) { + w1.$oldWidget = w.$oldWidget; + break; + } + w1 = w1.$oldWidget; + } + } + } + this.session._emit("changeFold", { data: { start: { row: w.row } } }); + this.$updateRows(); + }; + LineWidgets.prototype.getWidgetsAtRow = function (row) { + var lineWidgets = this.session.lineWidgets; + var w = lineWidgets && lineWidgets[row]; + var list = []; + while (w) { + list.push(w); + w = w.$oldWidget; + } + return list; + }; + LineWidgets.prototype.onWidgetChanged = function (w) { + this.session._changedWidgets.push(w); + this.editor && this.editor.renderer.updateFull(); + }; + LineWidgets.prototype.measureWidgets = function (e, renderer) { + var changedWidgets = this.session._changedWidgets; + var config = renderer.layerConfig; + if (!changedWidgets || !changedWidgets.length) + return; + var min = Infinity; + for (var i = 0; i < changedWidgets.length; i++) { + var w = changedWidgets[i]; + if (!w || !w.el) + continue; + if (w.session != this.session) + continue; + if (!w._inDocument) { + if (this.session.lineWidgets[w.row] != w) + continue; + w._inDocument = true; + renderer.container.appendChild(w.el); + } + w.h = w.el.offsetHeight; + if (!w.fixedWidth) { + w.w = w.el.offsetWidth; + w.screenWidth = Math.ceil(w.w / config.characterWidth); + } + var rowCount = w.h / config.lineHeight; + if (w.coverLine) { + rowCount -= this.session.getRowLineCount(w.row); + if (rowCount < 0) + rowCount = 0; + } + if (w.rowCount != rowCount) { + w.rowCount = rowCount; + if (w.row < min) + min = w.row; + } + } + if (min != Infinity) { + this.session._emit("changeFold", { data: { start: { row: min } } }); + this.session.lineWidgetWidth = null; + } + this.session._changedWidgets = []; + }; + LineWidgets.prototype.renderWidgets = function (e, renderer) { + var config = renderer.layerConfig; + var lineWidgets = this.session.lineWidgets; + if (!lineWidgets) + return; + var first = Math.min(this.firstRow, config.firstRow); + var last = Math.max(this.lastRow, config.lastRow, lineWidgets.length); + while (first > 0 && !lineWidgets[first]) + first--; + this.firstRow = config.firstRow; + this.lastRow = config.lastRow; + renderer.$cursorLayer.config = config; + for (var i = first; i <= last; i++) { + var w = lineWidgets[i]; + if (!w || !w.el) + continue; + if (w.hidden) { + w.el.style.top = -100 - (w.pixelHeight || 0) + "px"; + continue; + } + if (!w._inDocument) { + w._inDocument = true; + renderer.container.appendChild(w.el); + } + var top = renderer.$cursorLayer.getPixelPosition({ row: i, column: 0 }, true).top; + if (!w.coverLine) + top += config.lineHeight * this.session.getRowLineCount(w.row); + w.el.style.top = top - config.offset + "px"; + var left = w.coverGutter ? 0 : renderer.gutterWidth; + if (!w.fixedWidth) + left -= renderer.scrollLeft; + w.el.style.left = left + "px"; + if (w.fullWidth && w.screenWidth) { + w.el.style.minWidth = config.width + 2 * config.padding + "px"; + } + if (w.fixedWidth) { + w.el.style.right = renderer.scrollBar.getWidth() + "px"; + } + else { + w.el.style.right = ""; + } + } + }; + return LineWidgets; +}()); +exports.LineWidgets = LineWidgets; + +}); + ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys","ace/mouse/default_gutter_handler"], function(require, exports, module){"use strict"; var keys = require('../lib/keys'); var GutterTooltip = require("../mouse/default_gutter_handler").GutterTooltip; @@ -13977,29 +13583,34 @@ var GutterKeyboardHandler = /** @class */ (function () { setTimeout( function () { var index = this.$rowToRowIndex(this.gutterLayer.$cursorCell.row); - var nearestFoldLaneWidgetIndex = this.$findNearestFoldLaneWidget(index); + var nearestFoldIndex = this.$findNearestFoldWidget(index); var nearestAnnotationIndex = this.$findNearestAnnotation(index); - if (nearestFoldLaneWidgetIndex === null && nearestAnnotationIndex === null) + if (nearestFoldIndex === null && nearestAnnotationIndex === null) return; - var futureActiveRowIndex = this.$findClosestNumber(nearestFoldLaneWidgetIndex, nearestAnnotationIndex, index); - if (futureActiveRowIndex === nearestFoldLaneWidgetIndex) { + if (nearestFoldIndex === null && nearestAnnotationIndex !== null) { + this.activeRowIndex = nearestAnnotationIndex; + this.activeLane = "annotation"; + this.$focusAnnotation(this.activeRowIndex); + return; + } + if (nearestFoldIndex !== null && nearestAnnotationIndex === null) { + this.activeRowIndex = nearestFoldIndex; this.activeLane = "fold"; - this.activeRowIndex = nearestFoldLaneWidgetIndex; - if (this.$isCustomWidgetVisible(nearestFoldLaneWidgetIndex)) { - this.$focusCustomWidget(this.activeRowIndex); - return; - } - else { - this.$focusFoldWidget(this.activeRowIndex); - return; - } + this.$focusFoldWidget(this.activeRowIndex); + return; } - else { + if (Math.abs(nearestAnnotationIndex - index) < Math.abs(nearestFoldIndex - index)) { this.activeRowIndex = nearestAnnotationIndex; this.activeLane = "annotation"; this.$focusAnnotation(this.activeRowIndex); return; } + else { + this.activeRowIndex = nearestFoldIndex; + this.activeLane = "fold"; + this.$focusFoldWidget(this.activeRowIndex); + return; + } }.bind(this), 10); return; } @@ -14058,20 +13669,14 @@ var GutterKeyboardHandler = /** @class */ (function () { e.preventDefault(); switch (this.activeLane) { case "fold": - var row = this.$rowIndexToRow(this.activeRowIndex); - var customWidget = this.editor.session.$gutterCustomWidgets[row]; - if (customWidget) { - if (customWidget.callbacks && customWidget.callbacks.onClick) { - customWidget.callbacks.onClick(e, row); - } - } - else if (this.gutterLayer.session.foldWidgets[row] === 'start') { + if (this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)] === 'start') { + var rowFoldingWidget = this.$rowIndexToRow(this.activeRowIndex); this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex), e); setTimeout( function () { - if (this.$rowIndexToRow(this.activeRowIndex) !== row) { + if (this.$rowIndexToRow(this.activeRowIndex) !== rowFoldingWidget) { this.$blurFoldWidget(this.activeRowIndex); - this.activeRowIndex = this.$rowToRowIndex(row); + this.activeRowIndex = this.$rowToRowIndex(rowFoldingWidget); this.$focusFoldWidget(this.activeRowIndex); } }.bind(this), 10); @@ -14098,7 +13703,6 @@ var GutterKeyboardHandler = /** @class */ (function () { switch (this.activeLane) { case "fold": this.$blurFoldWidget(this.activeRowIndex); - this.$blurCustomWidget(this.activeRowIndex); break; case "annotation": this.$blurAnnotation(this.activeRowIndex); @@ -14114,11 +13718,6 @@ var GutterKeyboardHandler = /** @class */ (function () { var isIconVisible = this.$getFoldWidget(index).style.display !== "none"; return isRowFullyVisible && isIconVisible; }; - GutterKeyboardHandler.prototype.$isCustomWidgetVisible = function (index) { - var isRowFullyVisible = this.editor.isRowFullyVisible(this.$rowIndexToRow(index)); - var isIconVisible = !!this.$getCustomWidget(index); - return isRowFullyVisible && isIconVisible; - }; GutterKeyboardHandler.prototype.$isAnnotationVisible = function (index) { var isRowFullyVisible = this.editor.isRowFullyVisible(this.$rowIndexToRow(index)); var isIconVisible = this.$getAnnotation(index).style.display !== "none"; @@ -14129,28 +13728,17 @@ var GutterKeyboardHandler = /** @class */ (function () { var element = cell.element; return element.childNodes[1]; }; - GutterKeyboardHandler.prototype.$getCustomWidget = function (index) { - var cell = this.lines.get(index); - var element = cell.element; - return element.childNodes[3]; - }; GutterKeyboardHandler.prototype.$getAnnotation = function (index) { var cell = this.lines.get(index); var element = cell.element; return element.childNodes[2]; }; - GutterKeyboardHandler.prototype.$findNearestFoldLaneWidget = function (index) { - if (this.$isCustomWidgetVisible(index)) - return index; + GutterKeyboardHandler.prototype.$findNearestFoldWidget = function (index) { if (this.$isFoldWidgetVisible(index)) return index; var i = 0; while (index - i > 0 || index + i < this.lines.getLength() - 1) { i++; - if (index - i >= 0 && this.$isCustomWidgetVisible(index - i)) - return index - i; - if (index + i <= this.lines.getLength() - 1 && this.$isCustomWidgetVisible(index + i)) - return index + i; if (index - i >= 0 && this.$isFoldWidgetVisible(index - i)) return index - i; if (index + i <= this.lines.getLength() - 1 && this.$isFoldWidgetVisible(index + i)) @@ -14178,15 +13766,6 @@ var GutterKeyboardHandler = /** @class */ (function () { foldWidget.classList.add(this.editor.renderer.keyboardFocusClassName); foldWidget.focus(); }; - GutterKeyboardHandler.prototype.$focusCustomWidget = function (index) { - if (index == null) - return; - var customWidget = this.$getCustomWidget(index); - if (customWidget) { - customWidget.classList.add(this.editor.renderer.keyboardFocusClassName); - customWidget.focus(); - } - }; GutterKeyboardHandler.prototype.$focusAnnotation = function (index) { if (index == null) return; @@ -14199,13 +13778,6 @@ var GutterKeyboardHandler = /** @class */ (function () { foldWidget.classList.remove(this.editor.renderer.keyboardFocusClassName); foldWidget.blur(); }; - GutterKeyboardHandler.prototype.$blurCustomWidget = function (index) { - var customWidget = this.$getCustomWidget(index); - if (customWidget) { - customWidget.classList.remove(this.editor.renderer.keyboardFocusClassName); - customWidget.blur(); - } - }; GutterKeyboardHandler.prototype.$blurAnnotation = function (index) { var annotation = this.$getAnnotation(index); annotation.classList.remove(this.editor.renderer.keyboardFocusClassName); @@ -14215,16 +13787,10 @@ var GutterKeyboardHandler = /** @class */ (function () { var index = this.activeRowIndex; while (index > 0) { index--; - if (this.$isFoldWidgetVisible(index) || this.$isCustomWidgetVisible(index)) { + if (this.$isFoldWidgetVisible(index)) { this.$blurFoldWidget(this.activeRowIndex); - this.$blurCustomWidget(this.activeRowIndex); this.activeRowIndex = index; - if (this.$isFoldWidgetVisible(index)) { - this.$focusFoldWidget(this.activeRowIndex); - } - else { - this.$focusCustomWidget(this.activeRowIndex); - } + this.$focusFoldWidget(this.activeRowIndex); return; } } @@ -14234,16 +13800,10 @@ var GutterKeyboardHandler = /** @class */ (function () { var index = this.activeRowIndex; while (index < this.lines.getLength() - 1) { index++; - if (this.$isFoldWidgetVisible(index) || this.$isCustomWidgetVisible(index)) { + if (this.$isFoldWidgetVisible(index)) { this.$blurFoldWidget(this.activeRowIndex); - this.$blurCustomWidget(this.activeRowIndex); this.activeRowIndex = index; - if (this.$isFoldWidgetVisible(index)) { - this.$focusFoldWidget(this.activeRowIndex); - } - else { - this.$focusCustomWidget(this.activeRowIndex); - } + this.$focusFoldWidget(this.activeRowIndex); return; } } @@ -14275,13 +13835,6 @@ var GutterKeyboardHandler = /** @class */ (function () { } return; }; - GutterKeyboardHandler.prototype.$findClosestNumber = function (num1, num2, target) { - if (num1 === null) - return num2; - if (num2 === null) - return num1; - return (Math.abs(target - num1) <= Math.abs(target - num2)) ? num1 : num2; - }; GutterKeyboardHandler.prototype.$switchLane = function (desinationLane) { switch (desinationLane) { case "annotation": @@ -14294,7 +13847,6 @@ var GutterKeyboardHandler = /** @class */ (function () { } this.activeLane = "annotation"; this.$blurFoldWidget(this.activeRowIndex); - this.$blurCustomWidget(this.activeRowIndex); this.activeRowIndex = annotationIndex; this.$focusAnnotation(this.activeRowIndex); break; @@ -14302,19 +13854,14 @@ var GutterKeyboardHandler = /** @class */ (function () { if (this.activeLane === "fold") { break; } - var foldLaneWidgetIndex = this.$findNearestFoldLaneWidget(this.activeRowIndex); - if (foldLaneWidgetIndex === null) { + var foldWidgetIndex = this.$findNearestFoldWidget(this.activeRowIndex); + if (foldWidgetIndex == null) { break; } this.activeLane = "fold"; this.$blurAnnotation(this.activeRowIndex); - this.activeRowIndex = foldLaneWidgetIndex; - if (this.$isCustomWidgetVisible(foldLaneWidgetIndex)) { - this.$focusCustomWidget(this.activeRowIndex); - } - else { - this.$focusFoldWidget(this.activeRowIndex); - } + this.activeRowIndex = foldWidgetIndex; + this.$focusFoldWidget(this.activeRowIndex); break; } return; @@ -14359,7 +13906,7 @@ exports.GutterKeyboardEvent = GutterKeyboardEvent; }); -ace.define("ace/editor",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/keyboard/gutter_handler","ace/config","ace/clipboard","ace/lib/keys","ace/lib/event","ace/tooltip"], function(require, exports, module){"use strict"; +ace.define("ace/editor",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/line_widgets","ace/keyboard/gutter_handler","ace/config","ace/clipboard","ace/lib/keys"], function(require, exports, module){"use strict"; var __values = (this && this.__values) || function(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); @@ -14387,19 +13934,18 @@ var CommandManager = require("./commands/command_manager").CommandManager; var defaultCommands = require("./commands/default_commands").commands; var config = require("./config"); var TokenIterator = require("./token_iterator").TokenIterator; +var LineWidgets = require("./line_widgets").LineWidgets; var GutterKeyboardHandler = require("./keyboard/gutter_handler").GutterKeyboardHandler; var nls = require("./config").nls; var clipboard = require("./clipboard"); var keys = require('./lib/keys'); -var event = require("./lib/event"); -var HoverTooltip = require("./tooltip").HoverTooltip; var Editor = /** @class */ (function () { - function Editor(renderer, session, options) { - this.id = "editor" + (++Editor.$uid); this.session; + function Editor(renderer, session, options) { this.session; this.$toDestroy = []; var container = renderer.getContainerElement(); this.container = container; this.renderer = renderer; + this.id = "editor" + (++Editor.$uid); this.commands = new CommandManager(useragent.isMac ? "mac" : "win", defaultCommands); if (typeof document == "object") { this.textInput = new TextInput(renderer.getTextAreaContainer(), this); @@ -14431,27 +13977,46 @@ var Editor = /** @class */ (function () { Editor.prototype.$initOperationListeners = function () { this.commands.on("exec", this.startOperation.bind(this), true); this.commands.on("afterExec", this.endOperation.bind(this), true); + this.$opResetTimer = lang.delayedCall(this.endOperation.bind(this, true)); + this.on("change", function () { + if (!this.curOp) { + this.startOperation(); + this.curOp.selectionBefore = this.$lastSel; + } + this.curOp.docChanged = true; + }.bind(this), true); + this.on("changeSelection", function () { + if (!this.curOp) { + this.startOperation(); + this.curOp.selectionBefore = this.$lastSel; + } + this.curOp.selectionChanged = true; + }.bind(this), true); }; Editor.prototype.startOperation = function (commandEvent) { - this.session.startOperation(commandEvent); - }; - Editor.prototype.endOperation = function (e) { - this.session.endOperation(e); - }; - Editor.prototype.onStartOperation = function (commandEvent) { - this.curOp = this.session.curOp; - this.curOp.scrollTop = this.renderer.scrollTop; - this.prevOp = this.session.prevOp; + if (this.curOp) { + if (!commandEvent || this.curOp.command) + return; + this.prevOp = this.curOp; + } if (!commandEvent) { this.previousCommand = null; + commandEvent = {}; } + this.$opResetTimer.schedule(); + this.curOp = this.session.curOp = { + command: commandEvent.command || {}, + args: commandEvent.args, + scrollTop: this.renderer.scrollTop + }; + this.curOp.selectionBefore = this.selection.toJSON(); }; - Editor.prototype.onEndOperation = function (e) { + Editor.prototype.endOperation = function (e) { if (this.curOp && this.session) { - if (e && e.returnValue === false) { - this.curOp = null; + if (e && e.returnValue === false || !this.session) + return (this.curOp = null); + if (e == true && this.curOp.command && this.curOp.command.name == "mouse") return; - } this._signal("beforeEndOperation"); if (!this.curOp) return; @@ -14481,7 +14046,10 @@ var Editor = /** @class */ (function () { if (scrollIntoView == "animate") this.renderer.animateScrolling(this.curOp.scrollTop); } - this.$lastSel = this.session.selection.toJSON(); + var sel = this.selection.toJSON(); + this.curOp.selectionAfter = sel; + this.$lastSel = this.selection.toJSON(); + this.session.getUndoManager().addSelection(sel); this.prevOp = this.curOp; this.curOp = null; } @@ -14555,8 +14123,6 @@ var Editor = /** @class */ (function () { this.session.off("changeOverwrite", this.$onCursorChange); this.session.off("changeScrollTop", this.$onScrollTopChange); this.session.off("changeScrollLeft", this.$onScrollLeftChange); - this.session.off("startOperation", this.$onStartOperation); - this.session.off("endOperation", this.$onEndOperation); var selection = this.session.getSelection(); selection.off("changeCursor", this.$onCursorChange); selection.off("changeSelection", this.$onSelectionChange); @@ -14596,10 +14162,6 @@ var Editor = /** @class */ (function () { this.selection.on("changeCursor", this.$onCursorChange); this.$onSelectionChange = this.onSelectionChange.bind(this); this.selection.on("changeSelection", this.$onSelectionChange); - this.$onStartOperation = this.onStartOperation.bind(this); - this.session.on("startOperation", this.$onStartOperation); - this.$onEndOperation = this.onEndOperation.bind(this); - this.session.on("endOperation", this.$onEndOperation); this.onChangeMode(); this.onCursorChange(); this.onScrollTopChange(); @@ -14622,11 +14184,7 @@ var Editor = /** @class */ (function () { }); this.curOp = null; oldSession && oldSession._signal("changeEditor", { oldEditor: this }); - if (oldSession) - oldSession.$editor = null; session && session._signal("changeEditor", { editor: this }); - if (session) - session.$editor = this; if (session && !session.destroyed) session.bgTokenizer.scheduleStart(); }; @@ -14658,8 +14216,8 @@ var Editor = /** @class */ (function () { Editor.prototype.getTheme = function () { return this.renderer.getTheme(); }; - Editor.prototype.setStyle = function (style, incluude) { - this.renderer.setStyle(style, incluude); + Editor.prototype.setStyle = function (style) { + this.renderer.setStyle(style); }; Editor.prototype.unsetStyle = function (style) { this.renderer.unsetStyle(style); @@ -15252,9 +14810,15 @@ var Editor = /** @class */ (function () { this.moveCursorToPosition(cursor); }; Editor.prototype.setGhostText = function (text, position) { + if (!this.session.widgetManager) { + this.session.widgetManager = new LineWidgets(this.session); + this.session.widgetManager.attach(this); + } this.renderer.setGhostText(text, position); }; Editor.prototype.removeGhostText = function () { + if (!this.session.widgetManager) + return; this.renderer.removeGhostText(); }; Editor.prototype.transposeLetters = function () { @@ -16141,51 +15705,9 @@ config.defineOptions(Editor.prototype, "editor", { initialValue: true }, readOnly: { - set: function (/**@type{boolean}*/ readOnly) { - var _this = this; + set: function (readOnly) { this.textInput.setReadOnly(readOnly); this.$resetCursorStyle(); - if (!this.$readOnlyCallback) { - this.$readOnlyCallback = function (e) { - var shouldShow = false; - if (e && e.type == "keydown") { - shouldShow = e && e.key && e.key.length == 1 && !e.ctrlKey && !e.metaKey; - if (!shouldShow) - return; - } - else if (e && e.type !== "exec") { - shouldShow = true; - } - if (shouldShow) { - if (!_this.hoverTooltip) { - _this.hoverTooltip = new HoverTooltip(); - } - var domNode = dom.createElement("div"); - domNode.textContent = nls("editor.tooltip.disable-editing", "Editing is disabled"); - if (!_this.hoverTooltip.isOpen) { - _this.hoverTooltip.showForRange(_this, _this.getSelectionRange(), domNode); - } - } - else if (_this.hoverTooltip && _this.hoverTooltip.isOpen) { - _this.hoverTooltip.hide(); - } - }; - } - var textArea = this.textInput.getElement(); - if (readOnly) { - event.addListener(textArea, "keydown", this.$readOnlyCallback, this); - this.commands.on("exec", this.$readOnlyCallback); - this.commands.on("commandUnavailable", this.$readOnlyCallback); - } - else { - event.removeListener(textArea, "keydown", this.$readOnlyCallback); - this.commands.off("exec", this.$readOnlyCallback); - this.commands.off("commandUnavailable", this.$readOnlyCallback); - if (this.hoverTooltip) { - this.hoverTooltip.destroy(); - this.hoverTooltip = null; - } - } }, initialValue: false }, @@ -16313,7 +15835,7 @@ config.defineOptions(Editor.prototype, "editor", { this.renderer.$gutter.setAttribute("tabindex", 0); this.renderer.$gutter.setAttribute("aria-hidden", false); this.renderer.$gutter.setAttribute("role", "group"); - this.renderer.$gutter.setAttribute("aria-roledescription", nls("editor.gutter.aria-roledescription", "editor gutter")); + this.renderer.$gutter.setAttribute("aria-roledescription", nls("editor.gutter.aria-roledescription", "editor")); this.renderer.$gutter.setAttribute("aria-label", nls("editor.gutter.aria-label", "Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")); this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName); this.renderer.content.setAttribute("aria-hidden", true); @@ -16771,7 +16293,6 @@ var Gutter = /** @class */ (function () { var textNode = element.childNodes[0]; var foldWidget = element.childNodes[1]; var annotationNode = element.childNodes[2]; - var customWidget = element.childNodes[3]; var annotationIconNode = annotationNode.firstChild; var firstLineNumber = session.$firstLineNumber; var breakpoints = session.$breakpoints; @@ -16873,13 +16394,6 @@ var Gutter = /** @class */ (function () { foldWidget.removeAttribute("aria-label"); } } - var customWidgetAttributes = this.session.$gutterCustomWidgets[row]; - if (customWidgetAttributes) { - this.$addCustomWidget(row, customWidgetAttributes, cell); - } - else if (customWidget) { - this.$removeCustomWidget(row, cell); - } if (annotationInFold && this.$showFoldedAnnotations) { annotationNode.className = "ace_gutter_annotation"; annotationIconNode.className = iconClassName; @@ -16949,7 +16463,7 @@ var Gutter = /** @class */ (function () { dom.setStyle(cell.element.style, "height", this.$lines.computeLineHeight(row, config, session) + "px"); dom.setStyle(cell.element.style, "top", this.$lines.computeLineTop(row, config, session) + "px"); cell.text = rowText; - if (annotationNode.style.display === "none" && foldWidget.style.display === "none" && !customWidgetAttributes) + if (annotationNode.style.display === "none" && foldWidget.style.display === "none") cell.element.setAttribute("aria-hidden", true); else cell.element.setAttribute("aria-hidden", false); @@ -16978,67 +16492,6 @@ var Gutter = /** @class */ (function () { Gutter.prototype.getShowFoldWidgets = function () { return this.$showFoldWidgets; }; - Gutter.prototype.$hideFoldWidget = function (row, cell) { - var rowCell = cell || this.$getGutterCell(row); - if (rowCell && rowCell.element) { - var foldWidget = rowCell.element.childNodes[1]; - if (foldWidget) { - dom.setStyle(foldWidget.style, "display", "none"); - } - } - }; - Gutter.prototype.$showFoldWidget = function (row, cell) { - var rowCell = cell || this.$getGutterCell(row); - if (rowCell && rowCell.element) { - var foldWidget = rowCell.element.childNodes[1]; - if (foldWidget && this.session.foldWidgets && this.session.foldWidgets[rowCell.row]) { - dom.setStyle(foldWidget.style, "display", "inline-block"); - } - } - }; - Gutter.prototype.$getGutterCell = function (row) { - var cells = this.$lines.cells; - var visibileRow = this.session.documentToScreenRow(row, 0); - return cells[row - this.config.firstRowScreen - (row - visibileRow)]; - }; - Gutter.prototype.$addCustomWidget = function (row, _a, cell) { - var className = _a.className, label = _a.label, title = _a.title, callbacks = _a.callbacks; - this.session.$gutterCustomWidgets[row] = { className: className, label: label, title: title, callbacks: callbacks }; - this.$hideFoldWidget(row, cell); - var rowCell = cell || this.$getGutterCell(row); - if (rowCell && rowCell.element) { - var customWidget = rowCell.element.querySelector(".ace_custom-widget"); - if (customWidget) { - customWidget.remove(); - } - customWidget = dom.createElement("span"); - customWidget.className = "ace_custom-widget ".concat(className); - customWidget.setAttribute("tabindex", "-1"); - customWidget.setAttribute("role", 'button'); - customWidget.setAttribute("aria-label", label); - customWidget.setAttribute("title", title); - dom.setStyle(customWidget.style, "display", "inline-block"); - dom.setStyle(customWidget.style, "height", "inherit"); - if (callbacks && callbacks.onClick) { - customWidget.addEventListener("click", function (e) { - callbacks.onClick(e, row); - e.stopPropagation(); - }); - } - rowCell.element.appendChild(customWidget); - } - }; - Gutter.prototype.$removeCustomWidget = function (row, cell) { - delete this.session.$gutterCustomWidgets[row]; - this.$showFoldWidget(row, cell); - var rowCell = cell || this.$getGutterCell(row); - if (rowCell && rowCell.element) { - var customWidget = rowCell.element.querySelector(".ace_custom-widget"); - if (customWidget) { - rowCell.element.removeChild(customWidget); - } - } - }; Gutter.prototype.$computePadding = function () { if (!this.element.firstChild) return { left: 0, right: 0 }; @@ -17517,7 +16970,7 @@ var Text = /** @class */ (function () { }; Text.prototype.$renderToken = function (parent, screenColumn, token, value) { var self = this; - var re = /(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069\u2060\u2061\u2062\u2063\u2064\u206A\u206B\u206B\u206C\u206D\u206E\u206F]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g; + var re = /(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g; var valueFragment = this.dom.createFragment(this.element); var m; var i = 0; @@ -17637,7 +17090,7 @@ var Text = /** @class */ (function () { var ranges = this.session.$bracketHighlight.ranges; for (var i = 0; i < ranges.length; i++) { if (cursor.row !== ranges[i].start.row) { - this.$highlightIndentGuideMarker.end = ranges[i].start.row + 1; + this.$highlightIndentGuideMarker.end = ranges[i].start.row; if (cursor.row > ranges[i].start.row) { this.$highlightIndentGuideMarker.dir = -1; } @@ -17665,24 +17118,24 @@ var Text = /** @class */ (function () { this.$renderHighlightIndentGuide(); }; Text.prototype.$clearActiveIndentGuide = function () { - var activeIndentGuides = this.element.querySelectorAll(".ace_indent-guide-active"); - for (var i = 0; i < activeIndentGuides.length; i++) { - activeIndentGuides[i].classList.remove("ace_indent-guide-active"); + var cells = this.$lines.cells; + for (var i = 0; i < cells.length; i++) { + var cell = cells[i]; + var childNodes = cell.element.childNodes; + if (childNodes.length > 0) { + for (var j = 0; j < childNodes.length; j++) { + if (childNodes[j].classList && childNodes[j].classList.contains("ace_indent-guide-active")) { + childNodes[j].classList.remove("ace_indent-guide-active"); + break; + } + } + } } }; Text.prototype.$setIndentGuideActive = function (cell, indentLevel) { var line = this.session.doc.getLine(cell.row); if (line !== "") { - var element = cell.element; - if (cell.element.classList && cell.element.classList.contains("ace_line_group")) { - if (cell.element.childNodes.length > 0) { - element = cell.element.childNodes[0]; - } - else { - return; - } - } - var childNodes = element.childNodes; + var childNodes = cell.element.childNodes; if (childNodes) { var node = childNodes[indentLevel - 1]; if (node && node.classList && node.classList.contains("ace_indent-guide")) @@ -17712,7 +17165,7 @@ var Text = /** @class */ (function () { for (var i = cells.length - 1; i >= 0; i--) { var cell = cells[i]; if (this.$highlightIndentGuideMarker.end && cell.row < this.$highlightIndentGuideMarker.start) { - if (cell.row < this.$highlightIndentGuideMarker.end) + if (cell.row <= this.$highlightIndentGuideMarker.end) break; this.$setIndentGuideActive(cell, indentLevel); } @@ -18705,7 +18158,7 @@ for (var i = 1; i < 16; i++) { } styles.join("\\n") */ -module.exports = "\n.ace_br1 {border-top-left-radius : 3px;}\n.ace_br2 {border-top-right-radius : 3px;}\n.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}\n.ace_br4 {border-bottom-right-radius: 3px;}\n.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}\n.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}\n.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}\n.ace_br8 {border-bottom-left-radius : 3px;}\n.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}\n.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}\n.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n\n\n.ace_editor {\n position: relative;\n overflow: hidden;\n padding: 0;\n font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Source Code Pro', 'source-code-pro', monospace;\n direction: ltr;\n text-align: left;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n forced-color-adjust: none;\n}\n\n.ace_scroller {\n position: absolute;\n overflow: hidden;\n top: 0;\n bottom: 0;\n background-color: inherit;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n cursor: text;\n}\n\n.ace_content {\n position: absolute;\n box-sizing: border-box;\n min-width: 100%;\n contain: style size layout;\n font-variant-ligatures: no-common-ligatures;\n}\n.ace_invisible {\n font-variant-ligatures: none;\n}\n\n.ace_keyboard-focus:focus {\n box-shadow: inset 0 0 0 2px #5E9ED6;\n outline: none;\n}\n\n.ace_dragging .ace_scroller:before{\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n content: '';\n background: rgba(250, 250, 250, 0.01);\n z-index: 1000;\n}\n.ace_dragging.ace_dark .ace_scroller:before{\n background: rgba(0, 0, 0, 0.01);\n}\n\n.ace_gutter {\n position: absolute;\n overflow : hidden;\n width: auto;\n top: 0;\n bottom: 0;\n left: 0;\n cursor: default;\n z-index: 4;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n contain: style size layout;\n}\n\n.ace_gutter-active-line {\n position: absolute;\n left: 0;\n right: 0;\n}\n\n.ace_scroller.ace_scroll-left:after {\n content: \"\";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;\n pointer-events: none;\n}\n\n.ace_gutter-cell, .ace_gutter-cell_svg-icons {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n padding-left: 19px;\n padding-right: 6px;\n background-repeat: no-repeat;\n}\n\n.ace_gutter-cell_svg-icons .ace_gutter_annotation {\n margin-left: -14px;\n float: left;\n}\n\n.ace_gutter-cell .ace_gutter_annotation {\n margin-left: -19px;\n float: left;\n}\n\n.ace_gutter-cell.ace_error, .ace_icon.ace_error, .ace_icon.ace_error_fold, .ace_gutter-cell.ace_security, .ace_icon.ace_security, .ace_icon.ace_security_fold {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_warning, .ace_icon.ace_warning, .ace_icon.ace_warning_fold {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_info, .ace_icon.ace_info, .ace_gutter-cell.ace_hint, .ace_icon.ace_hint {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_dark .ace_gutter-cell.ace_info, .ace_dark .ace_icon.ace_info, .ace_dark .ace_gutter-cell.ace_hint, .ace_dark .ace_icon.ace_hint {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC\");\n}\n\n.ace_icon_svg.ace_error {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJyZWQiIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIj4KPGNpcmNsZSBmaWxsPSJub25lIiBjeD0iOCIgY3k9IjgiIHI9IjciIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPGxpbmUgeDE9IjExIiB5MT0iNSIgeDI9IjUiIHkyPSIxMSIvPgo8bGluZSB4MT0iMTEiIHkxPSIxMSIgeDI9IjUiIHkyPSI1Ii8+CjwvZz4KPC9zdmc+\");\n background-color: crimson;\n}\n.ace_icon_svg.ace_security {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0iZGFya29yYW5nZSIgZmlsbD0ibm9uZSIgc2hhcGUtcmVuZGVyaW5nPSJnZW9tZXRyaWNQcmVjaXNpb24iPgogICAgICAgIDxwYXRoIGNsYXNzPSJzdHJva2UtbGluZWpvaW4tcm91bmQiIGQ9Ik04IDE0LjgzMDdDOCAxNC44MzA3IDIgMTIuOTA0NyAyIDguMDg5OTJWMy4yNjU0OEM1LjMxIDMuMjY1NDggNy45ODk5OSAxLjM0OTE4IDcuOTg5OTkgMS4zNDkxOEM3Ljk4OTk5IDEuMzQ5MTggMTAuNjkgMy4yNjU0OCAxNCAzLjI2NTQ4VjguMDg5OTJDMTQgMTIuOTA0NyA4IDE0LjgzMDcgOCAxNC44MzA3WiIvPgogICAgICAgIDxwYXRoIGQ9Ik0yIDguMDg5OTJWMy4yNjU0OEM1LjMxIDMuMjY1NDggNy45ODk5OSAxLjM0OTE4IDcuOTg5OTkgMS4zNDkxOCIvPgogICAgICAgIDxwYXRoIGQ9Ik0xMy45OSA4LjA4OTkyVjMuMjY1NDhDMTAuNjggMy4yNjU0OCA4IDEuMzQ5MTggOCAxLjM0OTE4Ii8+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTggNFY5Ii8+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTggMTBWMTIiLz4KICAgIDwvZz4KPC9zdmc+\");\n background-color: crimson;\n}\n.ace_icon_svg.ace_warning {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJkYXJrb3JhbmdlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+Cjxwb2x5Z29uIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGZpbGw9Im5vbmUiIHBvaW50cz0iOCAxIDE1IDE1IDEgMTUgOCAxIi8+CjxyZWN0IHg9IjgiIHk9IjEyIiB3aWR0aD0iMC4wMSIgaGVpZ2h0PSIwLjAxIi8+CjxsaW5lIHgxPSI4IiB5MT0iNiIgeDI9IjgiIHkyPSIxMCIvPgo8L2c+Cjwvc3ZnPg==\");\n background-color: darkorange;\n}\n.ace_icon_svg.ace_info {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJibHVlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CjxjaXJjbGUgZmlsbD0ibm9uZSIgY3g9IjgiIGN5PSI4IiByPSI3IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjxwb2x5bGluZSBwb2ludHM9IjggMTEgOCA4Ii8+Cjxwb2x5bGluZSBwb2ludHM9IjkgOCA2IDgiLz4KPGxpbmUgeDE9IjEwIiB5MT0iMTEiIHgyPSI2IiB5Mj0iMTEiLz4KPHJlY3QgeD0iOCIgeT0iNSIgd2lkdGg9IjAuMDEiIGhlaWdodD0iMC4wMSIvPgo8L2c+Cjwvc3ZnPg==\");\n background-color: royalblue;\n}\n.ace_icon_svg.ace_hint {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0ic2lsdmVyIiBmaWxsPSJub25lIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTYgMTRIMTAiLz4KICAgICAgICA8cGF0aCBkPSJNOCAxMUg5QzkgOS40NzAwMiAxMiA4LjU0MDAyIDEyIDUuNzYwMDJDMTIuMDIgNC40MDAwMiAxMS4zOSAzLjM2MDAyIDEwLjQzIDIuNjcwMDJDOSAxLjY0MDAyIDcuMDAwMDEgMS42NDAwMiA1LjU3MDAxIDIuNjcwMDJDNC42MTAwMSAzLjM2MDAyIDMuOTggNC40MDAwMiA0IDUuNzYwMDJDNCA4LjU0MDAyIDcuMDAwMDEgOS40NzAwMiA3LjAwMDAxIDExSDhaIi8+CiAgICA8L2c+Cjwvc3ZnPg==\");\n background-color: silver;\n}\n\n.ace_icon_svg.ace_error_fold {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSI+CiAgPHBhdGggZD0ibSAxOC45Mjk4NTEsNy44Mjk4MDc2IGMgMC4xNDYzNTMsNi4zMzc0NjA0IC02LjMyMzE0Nyw3Ljc3Nzg0NDQgLTcuNDc3OTEyLDcuNzc3ODQ0NCAtMi4xMDcyNzI2LC0wLjEyODc1IDUuMTE3Njc4LDAuMzU2MjQ5IDUuMDUxNjk4LC03Ljg3MDA2MTggLTAuNjA0NjcyLC04LjAwMzk3MzQ5IC03LjA3NzI3MDYsLTcuNTYzMTE4OSAtNC44NTczLC03LjQzMDM5NTU2IDEuNjA2LC0wLjExNTE0MjI1IDYuODk3NDg1LDEuMjYyNTQ1OTYgNy4yODM1MTQsNy41MjI2MTI5NiB6IiBmaWxsPSJjcmltc29uIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibSA4LjExNDc1NjIsMi4wNTI5ODI4IGMgMy4zNDkxNjk4LDAgNi4wNjQxMzI4LDIuNjc2ODYyNyA2LjA2NDEzMjgsNS45Nzg5NTMgMCwzLjMwMjExMjIgLTIuNzE0OTYzLDUuOTc4OTIwMiAtNi4wNjQxMzI4LDUuOTc4OTIwMiAtMy4zNDkxNDczLDAgLTYuMDY0MTc3MiwtMi42NzY4MDggLTYuMDY0MTc3MiwtNS45Nzg5MjAyIDAuMDA1MzksLTMuMjk5ODg2MSAyLjcxNzI2NTYsLTUuOTczNjQwOCA2LjA2NDE3NzIsLTUuOTc4OTUzIHogbSAwLC0xLjczNTgyNzE5IGMgLTQuMzIxNDgzNiwwIC03LjgyNDc0MDM4LDMuNDU0MDE4NDkgLTcuODI0NzQwMzgsNy43MTQ3ODAxOSAwLDQuMjYwNzI4MiAzLjUwMzI1Njc4LDcuNzE0NzQ1MiA3LjgyNDc0MDM4LDcuNzE0NzQ1MiA0LjMyMTQ0OTgsMCA3LjgyNDY5OTgsLTMuNDU0MDE3IDcuODI0Njk5OCwtNy43MTQ3NDUyIDAsLTIuMDQ2MDkxNCAtMC44MjQzOTIsLTQuMDA4MzY3MiAtMi4yOTE3NTYsLTUuNDU1MTc0NiBDIDEyLjE4MDIyNSwxLjEyOTk2NDggMTAuMTkwMDEzLDAuMzE3MTU1NjEgOC4xMTQ3NTYyLDAuMzE3MTU1NjEgWiBNIDYuOTM3NDU2Myw4LjI0MDU5ODUgNC42NzE4Njg1LDEwLjQ4NTg1MiA2LjAwODY4MTQsMTEuODc2NzI4IDguMzE3MDAzNSw5LjYwMDc5MTEgMTAuNjI1MzM3LDExLjg3NjcyOCAxMS45NjIxMzgsMTAuNDg1ODUyIDkuNjk2NTUwOCw4LjI0MDU5ODUgMTEuOTYyMTM4LDYuMDA2ODA2NiAxMC41NzMyNDYsNC42Mzc0MzM1IDguMzE3MDAzNSw2Ljg3MzQyOTcgNi4wNjA3NjA3LDQuNjM3NDMzNSA0LjY3MTg2ODUsNi4wMDY4MDY2IFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=\");\n background-color: crimson;\n}\n.ace_icon_svg.ace_security_fold {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTcgMTQiIGZpbGw9Im5vbmUiPgogICAgPHBhdGggZD0iTTEwLjAwMDEgMTMuNjk5MkMxMC4wMDAxIDEzLjY5OTIgMTEuOTI0MSAxMy40NzYzIDEzIDEyLjY5OTJDMTQuNDEzOSAxMS42NzgxIDE2IDEwLjUgMTYuMTI1MSA2LjgxMTI2VjIuNTg5ODdDMTYuMTI1MSAyLjU0NzY4IDE2LjEyMjEgMi41MDYxOSAxNi4xMTY0IDIuNDY1NTlWMS43MTQ4NUgxNS4yNDE0TDE1LjIzMDcgMS43MTQ4NEwxNC42MjUxIDEuNjk5MjJWNi44MTEyM0MxNC42MjUxIDguNTEwNjEgMTQuNjI1MSA5LjQ2NDYxIDEyLjc4MjQgMTEuNzIxQzEyLjE1ODYgMTIuNDg0OCAxMC4wMDAxIDEzLjY5OTIgMTAuMDAwMSAxMy42OTkyWiIgZmlsbD0iY3JpbXNvbiIgc3Ryb2tlLXdpZHRoPSIyIi8+CiAgICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcuMzM2MDkgMC4zNjc0NzVDNy4wMzIxNCAwLjE1MjY1MiA2LjYyNTQ4IDAuMTUzNjE0IDYuMzIyNTMgMC4zNjk5OTdMNi4zMDg2OSAwLjM3OTU1NEM2LjI5NTUzIDAuMzg4NTg4IDYuMjczODggMC40MDMyNjYgNi4yNDQxNyAwLjQyMjc4OUM2LjE4NDcxIDAuNDYxODYgNi4wOTMyMSAwLjUyMDE3MSA1Ljk3MzEzIDAuNTkxMzczQzUuNzMyNTEgMC43MzQwNTkgNS4zNzk5IDAuOTI2ODY0IDQuOTQyNzkgMS4xMjAwOUM0LjA2MTQ0IDEuNTA5NyAyLjg3NTQxIDEuODgzNzcgMS41ODk4NCAxLjg4Mzc3SDAuNzE0ODQ0VjIuNzU4NzdWNi45ODAxNUMwLjcxNDg0NCA5LjQ5Mzc0IDIuMjg4NjYgMTEuMTk3MyAzLjcwMjU0IDEyLjIxODVDNC40MTg0NSAxMi43MzU1IDUuMTI4NzQgMTMuMTA1MyA1LjY1NzMzIDEzLjM0NTdDNS45MjI4NCAxMy40NjY0IDYuMTQ1NjYgMTMuNTU1OSA2LjMwNDY1IDEzLjYxNjFDNi4zODQyMyAxMy42NDYyIDYuNDQ4MDUgMTMuNjY5IDYuNDkzNDkgMTMuNjg0OEM2LjUxNjIyIDEzLjY5MjcgNi41MzQzOCAxMy42OTg5IDYuNTQ3NjQgMTMuNzAzM0w2LjU2MzgyIDEzLjcwODdMNi41NjkwOCAxMy43MTA0TDYuNTcwOTkgMTMuNzExTDYuODM5ODQgMTMuNzUzM0w2LjU3MjQyIDEzLjcxMTVDNi43NDYzMyAxMy43NjczIDYuOTMzMzUgMTMuNzY3MyA3LjEwNzI3IDEzLjcxMTVMNy4xMDg3IDEzLjcxMUw3LjExMDYxIDEzLjcxMDRMNy4xMTU4NyAxMy43MDg3TDcuMTMyMDUgMTMuNzAzM0M3LjE0NTMxIDEzLjY5ODkgNy4xNjM0NiAxMy42OTI3IDcuMTg2MTkgMTMuNjg0OEM3LjIzMTY0IDEzLjY2OSA3LjI5NTQ2IDEzLjY0NjIgNy4zNzUwMyAxMy42MTYxQzcuNTM0MDMgMTMuNTU1OSA3Ljc1Njg1IDEzLjQ2NjQgOC4wMjIzNiAxMy4zNDU3QzguNTUwOTUgMTMuMTA1MyA5LjI2MTIzIDEyLjczNTUgOS45NzcxNSAxMi4yMTg1QzExLjM5MSAxMS4xOTczIDEyLjk2NDggOS40OTM3NyAxMi45NjQ4IDYuOTgwMThWMi43NTg4QzEyLjk2NDggMi43MTY2IDEyLjk2MTkgMi42NzUxMSAxMi45NTYxIDIuNjM0NTFWMS44ODM3N0gxMi4wODExQzEyLjA3NzUgMS44ODM3NyAxMi4wNzQgMS44ODM3NyAxMi4wNzA0IDEuODgzNzdDMTAuNzk3OSAxLjg4MDA0IDkuNjE5NjIgMS41MTEwMiA4LjczODk0IDEuMTI0ODZDOC43MzUzNCAxLjEyMzI3IDguNzMxNzQgMS4xMjE2OCA4LjcyODE0IDEuMTIwMDlDOC4yOTEwMyAwLjkyNjg2NCA3LjkzODQyIDAuNzM0MDU5IDcuNjk3NzkgMC41OTEzNzNDNy41Nzc3MiAwLjUyMDE3MSA3LjQ4NjIyIDAuNDYxODYgNy40MjY3NiAwLjQyMjc4OUM3LjM5NzA1IDAuNDAzMjY2IDcuMzc1MzkgMC4zODg1ODggNy4zNjIyNCAwLjM3OTU1NEw3LjM0ODk2IDAuMzcwMzVDNy4zNDg5NiAwLjM3MDM1IDcuMzQ4NDcgMC4zNzAwMiA3LjM0NTYzIDAuMzc0MDU0TDcuMzM3NzkgMC4zNjg2NTlMNy4zMzYwOSAwLjM2NzQ3NVpNOC4wMzQ3MSAyLjcyNjkxQzguODYwNCAzLjA5MDYzIDkuOTYwNjYgMy40NjMwOSAxMS4yMDYxIDMuNTg5MDdWNi45ODAxNUgxMS4yMTQ4QzExLjIxNDggOC42Nzk1MyAxMC4xNjM3IDkuOTI1MDcgOC45NTI1NCAxMC43OTk4QzguMzU1OTUgMTEuMjMwNiA3Ljc1Mzc0IDExLjU0NTQgNy4yOTc5NiAxMS43NTI3QzcuMTE2NzEgMTEuODM1MSA2Ljk2MDYyIDExLjg5OTYgNi44Mzk4NCAxMS45NDY5QzYuNzE5MDYgMTEuODk5NiA2LjU2Mjk3IDExLjgzNTEgNi4zODE3MyAxMS43NTI3QzUuOTI1OTUgMTEuNTQ1NCA1LjMyMzczIDExLjIzMDYgNC43MjcxNSAxMC43OTk4QzMuNTE2MDMgOS45MjUwNyAyLjQ2NDg0IDguNjc5NTUgMi40NjQ4NCA2Ljk4MDE4VjMuNTg5MDlDMy43MTczOCAzLjQ2MjM5IDQuODIzMDggMy4wODYzOSA1LjY1MDMzIDIuNzIwNzFDNi4xNDIyOCAyLjUwMzI0IDYuNTQ0ODUgMi4yODUzNyA2LjgzMjU0IDIuMTE2MjRDNy4xMjE4MSAyLjI4NTM1IDcuNTI3IDIuNTAzNTIgOC4wMjE5NiAyLjcyMTMxQzguMDI2MiAyLjcyMzE3IDguMDMwNDUgMi43MjUwNCA4LjAzNDcxIDIuNzI2OTFaTTUuOTY0ODQgMy40MDE0N1Y3Ljc3NjQ3SDcuNzE0ODRWMy40MDE0N0g1Ljk2NDg0Wk01Ljk2NDg0IDEwLjQwMTVWOC42NTE0N0g3LjcxNDg0VjEwLjQwMTVINS45NjQ4NFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=\");\n background-color: crimson;\n}\n.ace_icon_svg.ace_warning_fold {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNC43NzY5IDE0LjczMzdMOC42NTE5MiAyLjQ4MzY5QzguMzI5NDYgMS44Mzg3NyA3LjQwOTEzIDEuODM4NzcgNy4wODY2NyAyLjQ4MzY5TDAuOTYxNjY5IDE0LjczMzdDMC42NzA3NzUgMTUuMzE1NSAxLjA5MzgzIDE2IDEuNzQ0MjkgMTZIMTMuOTk0M0MxNC42NDQ4IDE2IDE1LjA2NzggMTUuMzE1NSAxNC43NzY5IDE0LjczMzdaTTMuMTYwMDcgMTQuMjVMNy44NjkyOSA0LjgzMTU2TDEyLjU3ODUgMTQuMjVIMy4xNjAwN1pNOC43NDQyOSAxMS42MjVWMTMuMzc1SDYuOTk0MjlWMTEuNjI1SDguNzQ0MjlaTTYuOTk0MjkgMTAuNzVWNy4yNUg4Ljc0NDI5VjEwLjc1SDYuOTk0MjlaIiBmaWxsPSIjRUM3MjExIi8+CjxwYXRoIGQ9Ik0xMS4xOTkxIDIuOTUyMzhDMTAuODgwOSAyLjMxNDY3IDEwLjM1MzcgMS44MDUyNiA5LjcwNTUgMS41MDlMMTEuMDQxIDEuMDY5NzhDMTEuNjg4MyAwLjk0OTgxNCAxMi4zMzcgMS4yNzI2MyAxMi42MzE3IDEuODYxNDFMMTcuNjEzNiAxMS44MTYxQzE4LjM1MjcgMTMuMjkyOSAxNy41OTM4IDE1LjA4MDQgMTYuMDE4IDE1LjU3NDVDMTYuNDA0NCAxNC40NTA3IDE2LjMyMzEgMTMuMjE4OCAxNS43OTI0IDEyLjE1NTVMMTEuMTk5MSAyLjk1MjM4WiIgZmlsbD0iI0VDNzIxMSIvPgo8L3N2Zz4=\");\n background-color: darkorange;\n}\n\n.ace_scrollbar {\n contain: strict;\n position: absolute;\n right: 0;\n bottom: 0;\n z-index: 6;\n}\n\n.ace_scrollbar-inner {\n position: absolute;\n cursor: text;\n left: 0;\n top: 0;\n}\n\n.ace_scrollbar-v{\n overflow-x: hidden;\n overflow-y: scroll;\n top: 0;\n}\n\n.ace_scrollbar-h {\n overflow-x: scroll;\n overflow-y: hidden;\n left: 0;\n}\n\n.ace_print-margin {\n position: absolute;\n height: 100%;\n}\n\n.ace_text-input {\n position: absolute;\n z-index: 0;\n width: 0.5em;\n height: 1em;\n opacity: 0;\n background: transparent;\n -moz-appearance: none;\n appearance: none;\n border: none;\n resize: none;\n outline: none;\n overflow: hidden;\n font: inherit;\n padding: 0 1px;\n margin: 0 -1px;\n contain: strict;\n -ms-user-select: text;\n -moz-user-select: text;\n -webkit-user-select: text;\n user-select: text;\n /*with `pre-line` chrome inserts   instead of space*/\n white-space: pre!important;\n}\n.ace_text-input.ace_composition {\n background: transparent;\n color: inherit;\n z-index: 1000;\n opacity: 1;\n}\n.ace_composition_placeholder { color: transparent }\n.ace_composition_marker { \n border-bottom: 1px solid;\n position: absolute;\n border-radius: 0;\n margin-top: 1px;\n}\n\n[ace_nocontext=true] {\n transform: none!important;\n filter: none!important;\n clip-path: none!important;\n mask : none!important;\n contain: none!important;\n perspective: none!important;\n mix-blend-mode: initial!important;\n z-index: auto;\n}\n\n.ace_layer {\n z-index: 1;\n position: absolute;\n overflow: hidden;\n /* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/\n word-wrap: normal;\n white-space: pre;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n /* setting pointer-events: auto; on node under the mouse, which changes\n during scroll, will break mouse wheel scrolling in Safari */\n pointer-events: none;\n}\n\n.ace_gutter-layer {\n position: relative;\n width: auto;\n text-align: right;\n pointer-events: auto;\n height: 1000000px;\n contain: style size layout;\n}\n\n.ace_text-layer {\n font: inherit !important;\n position: absolute;\n height: 1000000px;\n width: 1000000px;\n contain: style size layout;\n}\n\n.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {\n contain: style size layout;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n}\n\n.ace_hidpi .ace_text-layer,\n.ace_hidpi .ace_gutter-layer,\n.ace_hidpi .ace_content,\n.ace_hidpi .ace_gutter {\n contain: strict;\n}\n.ace_hidpi .ace_text-layer > .ace_line, \n.ace_hidpi .ace_text-layer > .ace_line_group {\n contain: strict;\n}\n\n.ace_cjk {\n display: inline-block;\n text-align: center;\n}\n\n.ace_cursor-layer {\n z-index: 4;\n}\n\n.ace_cursor {\n z-index: 4;\n position: absolute;\n box-sizing: border-box;\n border-left: 2px solid;\n /* workaround for smooth cursor repaintng whole screen in chrome */\n transform: translatez(0);\n}\n\n.ace_multiselect .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_slim-cursors .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_overwrite-cursors .ace_cursor {\n border-left-width: 0;\n border-bottom: 1px solid;\n}\n\n.ace_hidden-cursors .ace_cursor {\n opacity: 0.2;\n}\n\n.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {\n opacity: 0;\n}\n\n.ace_smooth-blinking .ace_cursor {\n transition: opacity 0.18s;\n}\n\n.ace_animate-blinking .ace_cursor {\n animation-duration: 1000ms;\n animation-timing-function: step-end;\n animation-name: blink-ace-animate;\n animation-iteration-count: infinite;\n}\n\n.ace_animate-blinking.ace_smooth-blinking .ace_cursor {\n animation-duration: 1000ms;\n animation-timing-function: ease-in-out;\n animation-name: blink-ace-animate-smooth;\n}\n \n@keyframes blink-ace-animate {\n from, to { opacity: 1; }\n 60% { opacity: 0; }\n}\n\n@keyframes blink-ace-animate-smooth {\n from, to { opacity: 1; }\n 45% { opacity: 1; }\n 60% { opacity: 0; }\n 85% { opacity: 0; }\n}\n\n.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {\n position: absolute;\n z-index: 3;\n}\n\n.ace_marker-layer .ace_selection {\n position: absolute;\n z-index: 5;\n}\n\n.ace_marker-layer .ace_bracket {\n position: absolute;\n z-index: 6;\n}\n\n.ace_marker-layer .ace_error_bracket {\n position: absolute;\n border-bottom: 1px solid #DE5555;\n border-radius: 0;\n}\n\n.ace_marker-layer .ace_active-line {\n position: absolute;\n z-index: 2;\n}\n\n.ace_marker-layer .ace_selected-word {\n position: absolute;\n z-index: 4;\n box-sizing: border-box;\n}\n\n.ace_line .ace_fold {\n box-sizing: border-box;\n\n display: inline-block;\n height: 11px;\n margin-top: -2px;\n vertical-align: middle;\n\n background-image:\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\"),\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=\");\n background-repeat: no-repeat, repeat-x;\n background-position: center center, top left;\n color: transparent;\n\n border: 1px solid black;\n border-radius: 2px;\n\n cursor: pointer;\n pointer-events: auto;\n}\n\n.ace_dark .ace_fold {\n}\n\n.ace_fold:hover{\n background-image:\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\"),\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC\");\n}\n\n.ace_tooltip {\n background-color: #f5f5f5;\n border: 1px solid gray;\n border-radius: 1px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\n color: black;\n padding: 3px 4px;\n position: fixed;\n z-index: 999999;\n box-sizing: border-box;\n cursor: default;\n white-space: pre-wrap;\n word-wrap: break-word;\n line-height: normal;\n font-style: normal;\n font-weight: normal;\n letter-spacing: normal;\n pointer-events: none;\n overflow: auto;\n max-width: min(33em, 66vw);\n overscroll-behavior: contain;\n}\n.ace_tooltip pre {\n white-space: pre-wrap;\n}\n\n.ace_tooltip.ace_dark {\n background-color: #636363;\n color: #fff;\n}\n\n.ace_tooltip:focus {\n outline: 1px solid #5E9ED6;\n}\n\n.ace_icon {\n display: inline-block;\n width: 18px;\n vertical-align: top;\n}\n\n.ace_icon_svg {\n display: inline-block;\n width: 12px;\n vertical-align: top;\n -webkit-mask-repeat: no-repeat;\n -webkit-mask-size: 12px;\n -webkit-mask-position: center;\n}\n\n.ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons {\n padding-right: 13px;\n}\n\n.ace_fold-widget, .ace_custom-widget {\n box-sizing: border-box;\n\n margin: 0 -12px 0 1px;\n display: none;\n width: 11px;\n vertical-align: top;\n\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==\");\n background-repeat: no-repeat;\n background-position: center;\n\n border-radius: 3px;\n \n border: 1px solid transparent;\n cursor: pointer;\n pointer-events: auto;\n}\n\n.ace_custom-widget {\n background: none;\n}\n\n.ace_folding-enabled .ace_fold-widget {\n display: inline-block; \n}\n\n.ace_fold-widget.ace_end {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==\");\n}\n\n.ace_fold-widget.ace_closed {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==\");\n}\n\n.ace_fold-widget:hover {\n border: 1px solid rgba(0, 0, 0, 0.3);\n background-color: rgba(255, 255, 255, 0.2);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n}\n\n.ace_fold-widget:active {\n border: 1px solid rgba(0, 0, 0, 0.4);\n background-color: rgba(0, 0, 0, 0.05);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n}\n/**\n * Dark version for fold widgets\n */\n.ace_dark .ace_fold-widget {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC\");\n}\n.ace_dark .ace_fold-widget.ace_end {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==\");\n}\n.ace_dark .ace_fold-widget.ace_closed {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==\");\n}\n.ace_dark .ace_fold-widget:hover {\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n background-color: rgba(255, 255, 255, 0.1);\n}\n.ace_dark .ace_fold-widget:active {\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n}\n\n.ace_inline_button {\n border: 1px solid lightgray;\n display: inline-block;\n margin: -1px 8px;\n padding: 0 5px;\n pointer-events: auto;\n cursor: pointer;\n}\n.ace_inline_button:hover {\n border-color: gray;\n background: rgba(200,200,200,0.2);\n display: inline-block;\n pointer-events: auto;\n}\n\n.ace_fold-widget.ace_invalid {\n background-color: #FFB4B4;\n border-color: #DE5555;\n}\n\n.ace_fade-fold-widgets .ace_fold-widget {\n transition: opacity 0.4s ease 0.05s;\n opacity: 0;\n}\n\n.ace_fade-fold-widgets:hover .ace_fold-widget {\n transition: opacity 0.05s ease 0.05s;\n opacity:1;\n}\n\n.ace_underline {\n text-decoration: underline;\n}\n\n.ace_bold {\n font-weight: bold;\n}\n\n.ace_nobold .ace_bold {\n font-weight: normal;\n}\n\n.ace_italic {\n font-style: italic;\n}\n\n\n.ace_error-marker {\n background-color: rgba(255, 0, 0,0.2);\n position: absolute;\n z-index: 9;\n}\n\n.ace_highlight-marker {\n background-color: rgba(255, 255, 0,0.2);\n position: absolute;\n z-index: 8;\n}\n\n.ace_mobile-menu {\n position: absolute;\n line-height: 1.5;\n border-radius: 4px;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n background: white;\n box-shadow: 1px 3px 2px grey;\n border: 1px solid #dcdcdc;\n color: black;\n}\n.ace_dark > .ace_mobile-menu {\n background: #333;\n color: #ccc;\n box-shadow: 1px 3px 2px grey;\n border: 1px solid #444;\n\n}\n.ace_mobile-button {\n padding: 2px;\n cursor: pointer;\n overflow: hidden;\n}\n.ace_mobile-button:hover {\n background-color: #eee;\n opacity:1;\n}\n.ace_mobile-button:active {\n background-color: #ddd;\n}\n\n.ace_placeholder {\n position: relative;\n font-family: arial;\n transform: scale(0.9);\n transform-origin: left;\n white-space: pre;\n opacity: 0.7;\n margin: 0 10px;\n z-index: 1;\n}\n\n.ace_ghost_text {\n opacity: 0.5;\n font-style: italic;\n}\n\n.ace_ghost_text_container > div {\n white-space: pre;\n}\n\n.ghost_text_line_wrapped::after {\n content: \"\u21A9\";\n position: absolute;\n}\n\n.ace_lineWidgetContainer.ace_ghost_text {\n margin: 0px 4px\n}\n\n.ace_screenreader-only {\n position:absolute;\n left:-10000px;\n top:auto;\n width:1px;\n height:1px;\n overflow:hidden;\n}\n\n.ace_hidden_token {\n display: none;\n}"; +module.exports = "\n.ace_br1 {border-top-left-radius : 3px;}\n.ace_br2 {border-top-right-radius : 3px;}\n.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}\n.ace_br4 {border-bottom-right-radius: 3px;}\n.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}\n.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}\n.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}\n.ace_br8 {border-bottom-left-radius : 3px;}\n.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}\n.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}\n.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n\n\n.ace_editor {\n position: relative;\n overflow: hidden;\n padding: 0;\n font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Source Code Pro', 'source-code-pro', monospace;\n direction: ltr;\n text-align: left;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n forced-color-adjust: none;\n}\n\n.ace_scroller {\n position: absolute;\n overflow: hidden;\n top: 0;\n bottom: 0;\n background-color: inherit;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n cursor: text;\n}\n\n.ace_content {\n position: absolute;\n box-sizing: border-box;\n min-width: 100%;\n contain: style size layout;\n font-variant-ligatures: no-common-ligatures;\n}\n\n.ace_keyboard-focus:focus {\n box-shadow: inset 0 0 0 2px #5E9ED6;\n outline: none;\n}\n\n.ace_dragging .ace_scroller:before{\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n content: '';\n background: rgba(250, 250, 250, 0.01);\n z-index: 1000;\n}\n.ace_dragging.ace_dark .ace_scroller:before{\n background: rgba(0, 0, 0, 0.01);\n}\n\n.ace_gutter {\n position: absolute;\n overflow : hidden;\n width: auto;\n top: 0;\n bottom: 0;\n left: 0;\n cursor: default;\n z-index: 4;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n contain: style size layout;\n}\n\n.ace_gutter-active-line {\n position: absolute;\n left: 0;\n right: 0;\n}\n\n.ace_scroller.ace_scroll-left:after {\n content: \"\";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;\n pointer-events: none;\n}\n\n.ace_gutter-cell, .ace_gutter-cell_svg-icons {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n padding-left: 19px;\n padding-right: 6px;\n background-repeat: no-repeat;\n}\n\n.ace_gutter-cell_svg-icons .ace_gutter_annotation {\n margin-left: -14px;\n float: left;\n}\n\n.ace_gutter-cell .ace_gutter_annotation {\n margin-left: -19px;\n float: left;\n}\n\n.ace_gutter-cell.ace_error, .ace_icon.ace_error, .ace_icon.ace_error_fold, .ace_gutter-cell.ace_security, .ace_icon.ace_security, .ace_icon.ace_security_fold {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_warning, .ace_icon.ace_warning, .ace_icon.ace_warning_fold {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_info, .ace_icon.ace_info, .ace_gutter-cell.ace_hint, .ace_icon.ace_hint {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_dark .ace_gutter-cell.ace_info, .ace_dark .ace_icon.ace_info, .ace_dark .ace_gutter-cell.ace_hint, .ace_dark .ace_icon.ace_hint {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC\");\n}\n\n.ace_icon_svg.ace_error {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJyZWQiIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIj4KPGNpcmNsZSBmaWxsPSJub25lIiBjeD0iOCIgY3k9IjgiIHI9IjciIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPGxpbmUgeDE9IjExIiB5MT0iNSIgeDI9IjUiIHkyPSIxMSIvPgo8bGluZSB4MT0iMTEiIHkxPSIxMSIgeDI9IjUiIHkyPSI1Ii8+CjwvZz4KPC9zdmc+\");\n background-color: crimson;\n}\n.ace_icon_svg.ace_security {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0iZGFya29yYW5nZSIgZmlsbD0ibm9uZSIgc2hhcGUtcmVuZGVyaW5nPSJnZW9tZXRyaWNQcmVjaXNpb24iPgogICAgICAgIDxwYXRoIGNsYXNzPSJzdHJva2UtbGluZWpvaW4tcm91bmQiIGQ9Ik04IDE0LjgzMDdDOCAxNC44MzA3IDIgMTIuOTA0NyAyIDguMDg5OTJWMy4yNjU0OEM1LjMxIDMuMjY1NDggNy45ODk5OSAxLjM0OTE4IDcuOTg5OTkgMS4zNDkxOEM3Ljk4OTk5IDEuMzQ5MTggMTAuNjkgMy4yNjU0OCAxNCAzLjI2NTQ4VjguMDg5OTJDMTQgMTIuOTA0NyA4IDE0LjgzMDcgOCAxNC44MzA3WiIvPgogICAgICAgIDxwYXRoIGQ9Ik0yIDguMDg5OTJWMy4yNjU0OEM1LjMxIDMuMjY1NDggNy45ODk5OSAxLjM0OTE4IDcuOTg5OTkgMS4zNDkxOCIvPgogICAgICAgIDxwYXRoIGQ9Ik0xMy45OSA4LjA4OTkyVjMuMjY1NDhDMTAuNjggMy4yNjU0OCA4IDEuMzQ5MTggOCAxLjM0OTE4Ii8+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTggNFY5Ii8+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTggMTBWMTIiLz4KICAgIDwvZz4KPC9zdmc+\");\n background-color: crimson;\n}\n.ace_icon_svg.ace_warning {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJkYXJrb3JhbmdlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+Cjxwb2x5Z29uIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGZpbGw9Im5vbmUiIHBvaW50cz0iOCAxIDE1IDE1IDEgMTUgOCAxIi8+CjxyZWN0IHg9IjgiIHk9IjEyIiB3aWR0aD0iMC4wMSIgaGVpZ2h0PSIwLjAxIi8+CjxsaW5lIHgxPSI4IiB5MT0iNiIgeDI9IjgiIHkyPSIxMCIvPgo8L2c+Cjwvc3ZnPg==\");\n background-color: darkorange;\n}\n.ace_icon_svg.ace_info {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJibHVlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CjxjaXJjbGUgZmlsbD0ibm9uZSIgY3g9IjgiIGN5PSI4IiByPSI3IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjxwb2x5bGluZSBwb2ludHM9IjggMTEgOCA4Ii8+Cjxwb2x5bGluZSBwb2ludHM9IjkgOCA2IDgiLz4KPGxpbmUgeDE9IjEwIiB5MT0iMTEiIHgyPSI2IiB5Mj0iMTEiLz4KPHJlY3QgeD0iOCIgeT0iNSIgd2lkdGg9IjAuMDEiIGhlaWdodD0iMC4wMSIvPgo8L2c+Cjwvc3ZnPg==\");\n background-color: royalblue;\n}\n.ace_icon_svg.ace_hint {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0ic2lsdmVyIiBmaWxsPSJub25lIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTYgMTRIMTAiLz4KICAgICAgICA8cGF0aCBkPSJNOCAxMUg5QzkgOS40NzAwMiAxMiA4LjU0MDAyIDEyIDUuNzYwMDJDMTIuMDIgNC40MDAwMiAxMS4zOSAzLjM2MDAyIDEwLjQzIDIuNjcwMDJDOSAxLjY0MDAyIDcuMDAwMDEgMS42NDAwMiA1LjU3MDAxIDIuNjcwMDJDNC42MTAwMSAzLjM2MDAyIDMuOTggNC40MDAwMiA0IDUuNzYwMDJDNCA4LjU0MDAyIDcuMDAwMDEgOS40NzAwMiA3LjAwMDAxIDExSDhaIi8+CiAgICA8L2c+Cjwvc3ZnPg==\");\n background-color: silver;\n}\n\n.ace_icon_svg.ace_error_fold {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSI+CiAgPHBhdGggZD0ibSAxOC45Mjk4NTEsNy44Mjk4MDc2IGMgMC4xNDYzNTMsNi4zMzc0NjA0IC02LjMyMzE0Nyw3Ljc3Nzg0NDQgLTcuNDc3OTEyLDcuNzc3ODQ0NCAtMi4xMDcyNzI2LC0wLjEyODc1IDUuMTE3Njc4LDAuMzU2MjQ5IDUuMDUxNjk4LC03Ljg3MDA2MTggLTAuNjA0NjcyLC04LjAwMzk3MzQ5IC03LjA3NzI3MDYsLTcuNTYzMTE4OSAtNC44NTczLC03LjQzMDM5NTU2IDEuNjA2LC0wLjExNTE0MjI1IDYuODk3NDg1LDEuMjYyNTQ1OTYgNy4yODM1MTQsNy41MjI2MTI5NiB6IiBmaWxsPSJjcmltc29uIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibSA4LjExNDc1NjIsMi4wNTI5ODI4IGMgMy4zNDkxNjk4LDAgNi4wNjQxMzI4LDIuNjc2ODYyNyA2LjA2NDEzMjgsNS45Nzg5NTMgMCwzLjMwMjExMjIgLTIuNzE0OTYzLDUuOTc4OTIwMiAtNi4wNjQxMzI4LDUuOTc4OTIwMiAtMy4zNDkxNDczLDAgLTYuMDY0MTc3MiwtMi42NzY4MDggLTYuMDY0MTc3MiwtNS45Nzg5MjAyIDAuMDA1MzksLTMuMjk5ODg2MSAyLjcxNzI2NTYsLTUuOTczNjQwOCA2LjA2NDE3NzIsLTUuOTc4OTUzIHogbSAwLC0xLjczNTgyNzE5IGMgLTQuMzIxNDgzNiwwIC03LjgyNDc0MDM4LDMuNDU0MDE4NDkgLTcuODI0NzQwMzgsNy43MTQ3ODAxOSAwLDQuMjYwNzI4MiAzLjUwMzI1Njc4LDcuNzE0NzQ1MiA3LjgyNDc0MDM4LDcuNzE0NzQ1MiA0LjMyMTQ0OTgsMCA3LjgyNDY5OTgsLTMuNDU0MDE3IDcuODI0Njk5OCwtNy43MTQ3NDUyIDAsLTIuMDQ2MDkxNCAtMC44MjQzOTIsLTQuMDA4MzY3MiAtMi4yOTE3NTYsLTUuNDU1MTc0NiBDIDEyLjE4MDIyNSwxLjEyOTk2NDggMTAuMTkwMDEzLDAuMzE3MTU1NjEgOC4xMTQ3NTYyLDAuMzE3MTU1NjEgWiBNIDYuOTM3NDU2Myw4LjI0MDU5ODUgNC42NzE4Njg1LDEwLjQ4NTg1MiA2LjAwODY4MTQsMTEuODc2NzI4IDguMzE3MDAzNSw5LjYwMDc5MTEgMTAuNjI1MzM3LDExLjg3NjcyOCAxMS45NjIxMzgsMTAuNDg1ODUyIDkuNjk2NTUwOCw4LjI0MDU5ODUgMTEuOTYyMTM4LDYuMDA2ODA2NiAxMC41NzMyNDYsNC42Mzc0MzM1IDguMzE3MDAzNSw2Ljg3MzQyOTcgNi4wNjA3NjA3LDQuNjM3NDMzNSA0LjY3MTg2ODUsNi4wMDY4MDY2IFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=\");\n background-color: crimson;\n}\n.ace_icon_svg.ace_security_fold {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTcgMTQiIGZpbGw9Im5vbmUiPgogICAgPHBhdGggZD0iTTEwLjAwMDEgMTMuNjk5MkMxMC4wMDAxIDEzLjY5OTIgMTEuOTI0MSAxMy40NzYzIDEzIDEyLjY5OTJDMTQuNDEzOSAxMS42NzgxIDE2IDEwLjUgMTYuMTI1MSA2LjgxMTI2VjIuNTg5ODdDMTYuMTI1MSAyLjU0NzY4IDE2LjEyMjEgMi41MDYxOSAxNi4xMTY0IDIuNDY1NTlWMS43MTQ4NUgxNS4yNDE0TDE1LjIzMDcgMS43MTQ4NEwxNC42MjUxIDEuNjk5MjJWNi44MTEyM0MxNC42MjUxIDguNTEwNjEgMTQuNjI1MSA5LjQ2NDYxIDEyLjc4MjQgMTEuNzIxQzEyLjE1ODYgMTIuNDg0OCAxMC4wMDAxIDEzLjY5OTIgMTAuMDAwMSAxMy42OTkyWiIgZmlsbD0iY3JpbXNvbiIgc3Ryb2tlLXdpZHRoPSIyIi8+CiAgICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcuMzM2MDkgMC4zNjc0NzVDNy4wMzIxNCAwLjE1MjY1MiA2LjYyNTQ4IDAuMTUzNjE0IDYuMzIyNTMgMC4zNjk5OTdMNi4zMDg2OSAwLjM3OTU1NEM2LjI5NTUzIDAuMzg4NTg4IDYuMjczODggMC40MDMyNjYgNi4yNDQxNyAwLjQyMjc4OUM2LjE4NDcxIDAuNDYxODYgNi4wOTMyMSAwLjUyMDE3MSA1Ljk3MzEzIDAuNTkxMzczQzUuNzMyNTEgMC43MzQwNTkgNS4zNzk5IDAuOTI2ODY0IDQuOTQyNzkgMS4xMjAwOUM0LjA2MTQ0IDEuNTA5NyAyLjg3NTQxIDEuODgzNzcgMS41ODk4NCAxLjg4Mzc3SDAuNzE0ODQ0VjIuNzU4NzdWNi45ODAxNUMwLjcxNDg0NCA5LjQ5Mzc0IDIuMjg4NjYgMTEuMTk3MyAzLjcwMjU0IDEyLjIxODVDNC40MTg0NSAxMi43MzU1IDUuMTI4NzQgMTMuMTA1MyA1LjY1NzMzIDEzLjM0NTdDNS45MjI4NCAxMy40NjY0IDYuMTQ1NjYgMTMuNTU1OSA2LjMwNDY1IDEzLjYxNjFDNi4zODQyMyAxMy42NDYyIDYuNDQ4MDUgMTMuNjY5IDYuNDkzNDkgMTMuNjg0OEM2LjUxNjIyIDEzLjY5MjcgNi41MzQzOCAxMy42OTg5IDYuNTQ3NjQgMTMuNzAzM0w2LjU2MzgyIDEzLjcwODdMNi41NjkwOCAxMy43MTA0TDYuNTcwOTkgMTMuNzExTDYuODM5ODQgMTMuNzUzM0w2LjU3MjQyIDEzLjcxMTVDNi43NDYzMyAxMy43NjczIDYuOTMzMzUgMTMuNzY3MyA3LjEwNzI3IDEzLjcxMTVMNy4xMDg3IDEzLjcxMUw3LjExMDYxIDEzLjcxMDRMNy4xMTU4NyAxMy43MDg3TDcuMTMyMDUgMTMuNzAzM0M3LjE0NTMxIDEzLjY5ODkgNy4xNjM0NiAxMy42OTI3IDcuMTg2MTkgMTMuNjg0OEM3LjIzMTY0IDEzLjY2OSA3LjI5NTQ2IDEzLjY0NjIgNy4zNzUwMyAxMy42MTYxQzcuNTM0MDMgMTMuNTU1OSA3Ljc1Njg1IDEzLjQ2NjQgOC4wMjIzNiAxMy4zNDU3QzguNTUwOTUgMTMuMTA1MyA5LjI2MTIzIDEyLjczNTUgOS45NzcxNSAxMi4yMTg1QzExLjM5MSAxMS4xOTczIDEyLjk2NDggOS40OTM3NyAxMi45NjQ4IDYuOTgwMThWMi43NTg4QzEyLjk2NDggMi43MTY2IDEyLjk2MTkgMi42NzUxMSAxMi45NTYxIDIuNjM0NTFWMS44ODM3N0gxMi4wODExQzEyLjA3NzUgMS44ODM3NyAxMi4wNzQgMS44ODM3NyAxMi4wNzA0IDEuODgzNzdDMTAuNzk3OSAxLjg4MDA0IDkuNjE5NjIgMS41MTEwMiA4LjczODk0IDEuMTI0ODZDOC43MzUzNCAxLjEyMzI3IDguNzMxNzQgMS4xMjE2OCA4LjcyODE0IDEuMTIwMDlDOC4yOTEwMyAwLjkyNjg2NCA3LjkzODQyIDAuNzM0MDU5IDcuNjk3NzkgMC41OTEzNzNDNy41Nzc3MiAwLjUyMDE3MSA3LjQ4NjIyIDAuNDYxODYgNy40MjY3NiAwLjQyMjc4OUM3LjM5NzA1IDAuNDAzMjY2IDcuMzc1MzkgMC4zODg1ODggNy4zNjIyNCAwLjM3OTU1NEw3LjM0ODk2IDAuMzcwMzVDNy4zNDg5NiAwLjM3MDM1IDcuMzQ4NDcgMC4zNzAwMiA3LjM0NTYzIDAuMzc0MDU0TDcuMzM3NzkgMC4zNjg2NTlMNy4zMzYwOSAwLjM2NzQ3NVpNOC4wMzQ3MSAyLjcyNjkxQzguODYwNCAzLjA5MDYzIDkuOTYwNjYgMy40NjMwOSAxMS4yMDYxIDMuNTg5MDdWNi45ODAxNUgxMS4yMTQ4QzExLjIxNDggOC42Nzk1MyAxMC4xNjM3IDkuOTI1MDcgOC45NTI1NCAxMC43OTk4QzguMzU1OTUgMTEuMjMwNiA3Ljc1Mzc0IDExLjU0NTQgNy4yOTc5NiAxMS43NTI3QzcuMTE2NzEgMTEuODM1MSA2Ljk2MDYyIDExLjg5OTYgNi44Mzk4NCAxMS45NDY5QzYuNzE5MDYgMTEuODk5NiA2LjU2Mjk3IDExLjgzNTEgNi4zODE3MyAxMS43NTI3QzUuOTI1OTUgMTEuNTQ1NCA1LjMyMzczIDExLjIzMDYgNC43MjcxNSAxMC43OTk4QzMuNTE2MDMgOS45MjUwNyAyLjQ2NDg0IDguNjc5NTUgMi40NjQ4NCA2Ljk4MDE4VjMuNTg5MDlDMy43MTczOCAzLjQ2MjM5IDQuODIzMDggMy4wODYzOSA1LjY1MDMzIDIuNzIwNzFDNi4xNDIyOCAyLjUwMzI0IDYuNTQ0ODUgMi4yODUzNyA2LjgzMjU0IDIuMTE2MjRDNy4xMjE4MSAyLjI4NTM1IDcuNTI3IDIuNTAzNTIgOC4wMjE5NiAyLjcyMTMxQzguMDI2MiAyLjcyMzE3IDguMDMwNDUgMi43MjUwNCA4LjAzNDcxIDIuNzI2OTFaTTUuOTY0ODQgMy40MDE0N1Y3Ljc3NjQ3SDcuNzE0ODRWMy40MDE0N0g1Ljk2NDg0Wk01Ljk2NDg0IDEwLjQwMTVWOC42NTE0N0g3LjcxNDg0VjEwLjQwMTVINS45NjQ4NFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=\");\n background-color: crimson;\n}\n.ace_icon_svg.ace_warning_fold {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNC43NzY5IDE0LjczMzdMOC42NTE5MiAyLjQ4MzY5QzguMzI5NDYgMS44Mzg3NyA3LjQwOTEzIDEuODM4NzcgNy4wODY2NyAyLjQ4MzY5TDAuOTYxNjY5IDE0LjczMzdDMC42NzA3NzUgMTUuMzE1NSAxLjA5MzgzIDE2IDEuNzQ0MjkgMTZIMTMuOTk0M0MxNC42NDQ4IDE2IDE1LjA2NzggMTUuMzE1NSAxNC43NzY5IDE0LjczMzdaTTMuMTYwMDcgMTQuMjVMNy44NjkyOSA0LjgzMTU2TDEyLjU3ODUgMTQuMjVIMy4xNjAwN1pNOC43NDQyOSAxMS42MjVWMTMuMzc1SDYuOTk0MjlWMTEuNjI1SDguNzQ0MjlaTTYuOTk0MjkgMTAuNzVWNy4yNUg4Ljc0NDI5VjEwLjc1SDYuOTk0MjlaIiBmaWxsPSIjRUM3MjExIi8+CjxwYXRoIGQ9Ik0xMS4xOTkxIDIuOTUyMzhDMTAuODgwOSAyLjMxNDY3IDEwLjM1MzcgMS44MDUyNiA5LjcwNTUgMS41MDlMMTEuMDQxIDEuMDY5NzhDMTEuNjg4MyAwLjk0OTgxNCAxMi4zMzcgMS4yNzI2MyAxMi42MzE3IDEuODYxNDFMMTcuNjEzNiAxMS44MTYxQzE4LjM1MjcgMTMuMjkyOSAxNy41OTM4IDE1LjA4MDQgMTYuMDE4IDE1LjU3NDVDMTYuNDA0NCAxNC40NTA3IDE2LjMyMzEgMTMuMjE4OCAxNS43OTI0IDEyLjE1NTVMMTEuMTk5MSAyLjk1MjM4WiIgZmlsbD0iI0VDNzIxMSIvPgo8L3N2Zz4=\");\n background-color: darkorange;\n}\n\n.ace_scrollbar {\n contain: strict;\n position: absolute;\n right: 0;\n bottom: 0;\n z-index: 6;\n}\n\n.ace_scrollbar-inner {\n position: absolute;\n cursor: text;\n left: 0;\n top: 0;\n}\n\n.ace_scrollbar-v{\n overflow-x: hidden;\n overflow-y: scroll;\n top: 0;\n}\n\n.ace_scrollbar-h {\n overflow-x: scroll;\n overflow-y: hidden;\n left: 0;\n}\n\n.ace_print-margin {\n position: absolute;\n height: 100%;\n}\n\n.ace_text-input {\n position: absolute;\n z-index: 0;\n width: 0.5em;\n height: 1em;\n opacity: 0;\n background: transparent;\n -moz-appearance: none;\n appearance: none;\n border: none;\n resize: none;\n outline: none;\n overflow: hidden;\n font: inherit;\n padding: 0 1px;\n margin: 0 -1px;\n contain: strict;\n -ms-user-select: text;\n -moz-user-select: text;\n -webkit-user-select: text;\n user-select: text;\n /*with `pre-line` chrome inserts   instead of space*/\n white-space: pre!important;\n}\n.ace_text-input.ace_composition {\n background: transparent;\n color: inherit;\n z-index: 1000;\n opacity: 1;\n}\n.ace_composition_placeholder { color: transparent }\n.ace_composition_marker { \n border-bottom: 1px solid;\n position: absolute;\n border-radius: 0;\n margin-top: 1px;\n}\n\n[ace_nocontext=true] {\n transform: none!important;\n filter: none!important;\n clip-path: none!important;\n mask : none!important;\n contain: none!important;\n perspective: none!important;\n mix-blend-mode: initial!important;\n z-index: auto;\n}\n\n.ace_layer {\n z-index: 1;\n position: absolute;\n overflow: hidden;\n /* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/\n word-wrap: normal;\n white-space: pre;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n /* setting pointer-events: auto; on node under the mouse, which changes\n during scroll, will break mouse wheel scrolling in Safari */\n pointer-events: none;\n}\n\n.ace_gutter-layer {\n position: relative;\n width: auto;\n text-align: right;\n pointer-events: auto;\n height: 1000000px;\n contain: style size layout;\n}\n\n.ace_text-layer {\n font: inherit !important;\n position: absolute;\n height: 1000000px;\n width: 1000000px;\n contain: style size layout;\n}\n\n.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {\n contain: style size layout;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n}\n\n.ace_hidpi .ace_text-layer,\n.ace_hidpi .ace_gutter-layer,\n.ace_hidpi .ace_content,\n.ace_hidpi .ace_gutter {\n contain: strict;\n}\n.ace_hidpi .ace_text-layer > .ace_line, \n.ace_hidpi .ace_text-layer > .ace_line_group {\n contain: strict;\n}\n\n.ace_cjk {\n display: inline-block;\n text-align: center;\n}\n\n.ace_cursor-layer {\n z-index: 4;\n}\n\n.ace_cursor {\n z-index: 4;\n position: absolute;\n box-sizing: border-box;\n border-left: 2px solid;\n /* workaround for smooth cursor repaintng whole screen in chrome */\n transform: translatez(0);\n}\n\n.ace_multiselect .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_slim-cursors .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_overwrite-cursors .ace_cursor {\n border-left-width: 0;\n border-bottom: 1px solid;\n}\n\n.ace_hidden-cursors .ace_cursor {\n opacity: 0.2;\n}\n\n.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {\n opacity: 0;\n}\n\n.ace_smooth-blinking .ace_cursor {\n transition: opacity 0.18s;\n}\n\n.ace_animate-blinking .ace_cursor {\n animation-duration: 1000ms;\n animation-timing-function: step-end;\n animation-name: blink-ace-animate;\n animation-iteration-count: infinite;\n}\n\n.ace_animate-blinking.ace_smooth-blinking .ace_cursor {\n animation-duration: 1000ms;\n animation-timing-function: ease-in-out;\n animation-name: blink-ace-animate-smooth;\n}\n \n@keyframes blink-ace-animate {\n from, to { opacity: 1; }\n 60% { opacity: 0; }\n}\n\n@keyframes blink-ace-animate-smooth {\n from, to { opacity: 1; }\n 45% { opacity: 1; }\n 60% { opacity: 0; }\n 85% { opacity: 0; }\n}\n\n.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {\n position: absolute;\n z-index: 3;\n}\n\n.ace_marker-layer .ace_selection {\n position: absolute;\n z-index: 5;\n}\n\n.ace_marker-layer .ace_bracket {\n position: absolute;\n z-index: 6;\n}\n\n.ace_marker-layer .ace_error_bracket {\n position: absolute;\n border-bottom: 1px solid #DE5555;\n border-radius: 0;\n}\n\n.ace_marker-layer .ace_active-line {\n position: absolute;\n z-index: 2;\n}\n\n.ace_marker-layer .ace_selected-word {\n position: absolute;\n z-index: 4;\n box-sizing: border-box;\n}\n\n.ace_line .ace_fold {\n box-sizing: border-box;\n\n display: inline-block;\n height: 11px;\n margin-top: -2px;\n vertical-align: middle;\n\n background-image:\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\"),\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=\");\n background-repeat: no-repeat, repeat-x;\n background-position: center center, top left;\n color: transparent;\n\n border: 1px solid black;\n border-radius: 2px;\n\n cursor: pointer;\n pointer-events: auto;\n}\n\n.ace_dark .ace_fold {\n}\n\n.ace_fold:hover{\n background-image:\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\"),\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC\");\n}\n\n.ace_tooltip {\n background-color: #f5f5f5;\n border: 1px solid gray;\n border-radius: 1px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\n color: black;\n max-width: 100%;\n padding: 3px 4px;\n position: fixed;\n z-index: 999999;\n box-sizing: border-box;\n cursor: default;\n white-space: pre-wrap;\n word-wrap: break-word;\n line-height: normal;\n font-style: normal;\n font-weight: normal;\n letter-spacing: normal;\n pointer-events: none;\n overflow: auto;\n max-width: min(60em, 66vw);\n overscroll-behavior: contain;\n}\n.ace_tooltip pre {\n white-space: pre-wrap;\n}\n\n.ace_tooltip.ace_dark {\n background-color: #636363;\n color: #fff;\n}\n\n.ace_tooltip:focus {\n outline: 1px solid #5E9ED6;\n}\n\n.ace_icon {\n display: inline-block;\n width: 18px;\n vertical-align: top;\n}\n\n.ace_icon_svg {\n display: inline-block;\n width: 12px;\n vertical-align: top;\n -webkit-mask-repeat: no-repeat;\n -webkit-mask-size: 12px;\n -webkit-mask-position: center;\n}\n\n.ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons {\n padding-right: 13px;\n}\n\n.ace_fold-widget {\n box-sizing: border-box;\n\n margin: 0 -12px 0 1px;\n display: none;\n width: 11px;\n vertical-align: top;\n\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==\");\n background-repeat: no-repeat;\n background-position: center;\n\n border-radius: 3px;\n \n border: 1px solid transparent;\n cursor: pointer;\n}\n\n.ace_folding-enabled .ace_fold-widget {\n display: inline-block; \n}\n\n.ace_fold-widget.ace_end {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==\");\n}\n\n.ace_fold-widget.ace_closed {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==\");\n}\n\n.ace_fold-widget:hover {\n border: 1px solid rgba(0, 0, 0, 0.3);\n background-color: rgba(255, 255, 255, 0.2);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n}\n\n.ace_fold-widget:active {\n border: 1px solid rgba(0, 0, 0, 0.4);\n background-color: rgba(0, 0, 0, 0.05);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n}\n/**\n * Dark version for fold widgets\n */\n.ace_dark .ace_fold-widget {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC\");\n}\n.ace_dark .ace_fold-widget.ace_end {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==\");\n}\n.ace_dark .ace_fold-widget.ace_closed {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==\");\n}\n.ace_dark .ace_fold-widget:hover {\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n background-color: rgba(255, 255, 255, 0.1);\n}\n.ace_dark .ace_fold-widget:active {\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n}\n\n.ace_inline_button {\n border: 1px solid lightgray;\n display: inline-block;\n margin: -1px 8px;\n padding: 0 5px;\n pointer-events: auto;\n cursor: pointer;\n}\n.ace_inline_button:hover {\n border-color: gray;\n background: rgba(200,200,200,0.2);\n display: inline-block;\n pointer-events: auto;\n}\n\n.ace_fold-widget.ace_invalid {\n background-color: #FFB4B4;\n border-color: #DE5555;\n}\n\n.ace_fade-fold-widgets .ace_fold-widget {\n transition: opacity 0.4s ease 0.05s;\n opacity: 0;\n}\n\n.ace_fade-fold-widgets:hover .ace_fold-widget {\n transition: opacity 0.05s ease 0.05s;\n opacity:1;\n}\n\n.ace_underline {\n text-decoration: underline;\n}\n\n.ace_bold {\n font-weight: bold;\n}\n\n.ace_nobold .ace_bold {\n font-weight: normal;\n}\n\n.ace_italic {\n font-style: italic;\n}\n\n\n.ace_error-marker {\n background-color: rgba(255, 0, 0,0.2);\n position: absolute;\n z-index: 9;\n}\n\n.ace_highlight-marker {\n background-color: rgba(255, 255, 0,0.2);\n position: absolute;\n z-index: 8;\n}\n\n.ace_mobile-menu {\n position: absolute;\n line-height: 1.5;\n border-radius: 4px;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n background: white;\n box-shadow: 1px 3px 2px grey;\n border: 1px solid #dcdcdc;\n color: black;\n}\n.ace_dark > .ace_mobile-menu {\n background: #333;\n color: #ccc;\n box-shadow: 1px 3px 2px grey;\n border: 1px solid #444;\n\n}\n.ace_mobile-button {\n padding: 2px;\n cursor: pointer;\n overflow: hidden;\n}\n.ace_mobile-button:hover {\n background-color: #eee;\n opacity:1;\n}\n.ace_mobile-button:active {\n background-color: #ddd;\n}\n\n.ace_placeholder {\n position: relative;\n font-family: arial;\n transform: scale(0.9);\n transform-origin: left;\n white-space: pre;\n opacity: 0.7;\n margin: 0 10px;\n z-index: 1;\n}\n\n.ace_ghost_text {\n opacity: 0.5;\n font-style: italic;\n}\n\n.ace_ghost_text_container > div {\n white-space: pre;\n}\n\n.ghost_text_line_wrapped::after {\n content: \"\u21A9\";\n position: absolute;\n}\n\n.ace_lineWidgetContainer.ace_ghost_text {\n margin: 0px 4px\n}\n\n.ace_screenreader-only {\n position:absolute;\n left:-10000px;\n top:auto;\n width:1px;\n height:1px;\n overflow:hidden;\n}\n\n.ace_hidden_token {\n display: none;\n}"; }); @@ -18714,45 +18167,50 @@ var dom = require("../lib/dom"); var oop = require("../lib/oop"); var EventEmitter = require("../lib/event_emitter").EventEmitter; var Decorator = /** @class */ (function () { - function Decorator(scrollbarV, renderer) { + function Decorator(parent, renderer) { + this.canvas = dom.createElement("canvas"); this.renderer = renderer; this.pixelRatio = 1; this.maxHeight = renderer.layerConfig.maxHeight; this.lineHeight = renderer.layerConfig.lineHeight; + this.canvasHeight = parent.parent.scrollHeight; + this.heightRatio = this.canvasHeight / this.maxHeight; + this.canvasWidth = parent.width; this.minDecorationHeight = (2 * this.pixelRatio) | 0; this.halfMinDecorationHeight = (this.minDecorationHeight / 2) | 0; + this.canvas.width = this.canvasWidth; + this.canvas.height = this.canvasHeight; + this.canvas.style.top = 0 + "px"; + this.canvas.style.right = 0 + "px"; + this.canvas.style.zIndex = 7 + "px"; + this.canvas.style.position = "absolute"; this.colors = {}; this.colors.dark = { "error": "rgba(255, 18, 18, 1)", "warning": "rgba(18, 136, 18, 1)", - "info": "rgba(18, 18, 136, 1)", + "info": "rgba(18, 18, 136, 1)" }; this.colors.light = { "error": "rgb(255,51,51)", "warning": "rgb(32,133,72)", - "info": "rgb(35,68,138)", + "info": "rgb(35,68,138)" }; - this.setScrollBarV(scrollbarV); + parent.element.appendChild(this.canvas); } - Decorator.prototype.$createCanvas = function () { - this.canvas = dom.createElement("canvas"); - this.canvas.style.top = 0 + "px"; - this.canvas.style.right = 0 + "px"; - this.canvas.style.zIndex = "7"; - this.canvas.style.position = "absolute"; - }; - Decorator.prototype.setScrollBarV = function (scrollbarV) { - this.$createCanvas(); - this.scrollbarV = scrollbarV; - scrollbarV.element.appendChild(this.canvas); - this.setDimensions(); - }; Decorator.prototype.$updateDecorators = function (config) { - if (typeof this.canvas.getContext !== "function") { - return; - } var colors = (this.renderer.theme.isDark === true) ? this.colors.dark : this.colors.light; - this.setDimensions(config); + if (config) { + this.maxHeight = config.maxHeight; + this.lineHeight = config.lineHeight; + this.canvasHeight = config.height; + var allLineHeight = (config.lastRow + 1) * this.lineHeight; + if (allLineHeight < this.canvasHeight) { + this.heightRatio = 1; + } + else { + this.heightRatio = this.canvasHeight / this.maxHeight; + } + } var ctx = this.canvas.getContext("2d"); function compare(a, b) { if (a.priority < b.priority) @@ -18770,66 +18228,53 @@ var Decorator = /** @class */ (function () { "error": 3 }; annotations.forEach(function (item) { - item["priority"] = priorities[item.type] || null; + item.priority = priorities[item.type] || null; }); annotations = annotations.sort(compare); + var foldData = this.renderer.session.$foldData; for (var i = 0; i < annotations.length; i++) { var row = annotations[i].row; - var offset1 = this.getVerticalOffsetForRow(row); - var offset2 = offset1 + this.lineHeight; - var y1 = Math.round(this.heightRatio * offset1); - var y2 = Math.round(this.heightRatio * offset2); - var ycenter = Math.round((y1 + y2) / 2); - var halfHeight = (y2 - ycenter); - if (halfHeight < this.halfMinDecorationHeight) { - halfHeight = this.halfMinDecorationHeight; - } - if (ycenter - halfHeight < 0) { - ycenter = halfHeight; - } - if (ycenter + halfHeight > this.canvasHeight) { - ycenter = this.canvasHeight - halfHeight; + var compensateFold = this.compensateFoldRows(row, foldData); + var currentY = Math.round((row - compensateFold) * this.lineHeight * this.heightRatio); + var y1 = Math.round(((row - compensateFold) * this.lineHeight * this.heightRatio)); + var y2 = Math.round((((row - compensateFold) * this.lineHeight + this.lineHeight) * this.heightRatio)); + var height = y2 - y1; + if (height < this.minDecorationHeight) { + var yCenter = ((y1 + y2) / 2) | 0; + if (yCenter < this.halfMinDecorationHeight) { + yCenter = this.halfMinDecorationHeight; + } + else if (yCenter + this.halfMinDecorationHeight > this.canvasHeight) { + yCenter = this.canvasHeight - this.halfMinDecorationHeight; + } + y1 = Math.round(yCenter - this.halfMinDecorationHeight); + y2 = Math.round(yCenter + this.halfMinDecorationHeight); } - var from = ycenter - halfHeight; - var to = ycenter + halfHeight; - var zoneHeight = to - from; ctx.fillStyle = colors[annotations[i].type] || null; - ctx.fillRect(0, from, Math.round(this.oneZoneWidth - 1), zoneHeight); + ctx.fillRect(0, currentY, this.canvasWidth, y2 - y1); } } var cursor = this.renderer.session.selection.getCursor(); if (cursor) { - var currentY = Math.round(this.getVerticalOffsetForRow(cursor.row) * this.heightRatio); + var compensateFold = this.compensateFoldRows(cursor.row, foldData); + var currentY = Math.round((cursor.row - compensateFold) * this.lineHeight * this.heightRatio); ctx.fillStyle = "rgba(0, 0, 0, 0.5)"; ctx.fillRect(0, currentY, this.canvasWidth, 2); } }; - Decorator.prototype.getVerticalOffsetForRow = function (row) { - row = row | 0; - var offset = this.renderer.session.documentToScreenRow(row, 0) * this.lineHeight; - return offset; - }; - Decorator.prototype.setDimensions = function (config) { - config = config || this.renderer.layerConfig; - this.maxHeight = config.maxHeight; - this.lineHeight = config.lineHeight; - this.canvasHeight = config.height; - this.canvasWidth = this.scrollbarV.width || this.canvasWidth; - this.setZoneWidth(); - this.canvas.width = this.canvasWidth; - this.canvas.height = this.canvasHeight; - if (this.maxHeight < this.canvasHeight) { - this.heightRatio = 1; - } - else { - this.heightRatio = this.canvasHeight / this.maxHeight; + Decorator.prototype.compensateFoldRows = function (row, foldData) { + var compensateFold = 0; + if (foldData && foldData.length > 0) { + for (var j = 0; j < foldData.length; j++) { + if (row > foldData[j].start.row && row < foldData[j].end.row) { + compensateFold += row - foldData[j].start.row; + } + else if (row >= foldData[j].end.row) { + compensateFold += foldData[j].end.row - foldData[j].start.row; + } + } } - }; - Decorator.prototype.setZoneWidth = function () { - this.oneZoneWidth = this.canvasWidth; - }; - Decorator.prototype.destroy = function () { - this.canvas.parentNode.removeChild(this.canvas); + return compensateFold; }; return Decorator; }()); @@ -19519,10 +18964,8 @@ var VirtualRenderer = /** @class */ (function () { this.scrollBarH.setVisible(horizScroll); } var vScrollBefore = this.$vScroll; // autosize can change vscroll value in which case we need to update longestLine - if (this.$maxLines && this.lineHeight > 1) { + if (this.$maxLines && this.lineHeight > 1) this.$autosize(); - hideScrollbars = size.height <= 2 * this.lineHeight; - } var minHeight = size.scrollerHeight + this.lineHeight; var scrollPastEnd = !this.$maxLines && this.$scrollPastEnd ? (size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd @@ -19555,10 +18998,6 @@ var VirtualRenderer = /** @class */ (function () { minHeight = size.scrollerHeight + session.getRowLength(lastRow) * lineHeight + firstRowHeight; offset = this.scrollTop - firstRowScreen * lineHeight; - if (offset < 0 && firstRowScreen > 0) { - firstRowScreen = Math.max(0, firstRowScreen + Math.floor(offset / lineHeight)); - offset = this.scrollTop - firstRowScreen * lineHeight; - } var changes = 0; if (this.layerConfig.width != longestLine || hScrollChanged) changes = this.CHANGE_H_SCROLL; @@ -20119,6 +19558,9 @@ var VirtualRenderer = /** @class */ (function () { this.$horizScroll = this.$vScroll = null; this.scrollBarV.element.remove(); this.scrollBarH.element.remove(); + if (this.$scrollDecorator) { + delete this.$scrollDecorator; + } if (val === true) { this.scrollBarV = new VScrollBarCustom(this.container, this); this.scrollBarH = new HScrollBarCustom(this.container, this); @@ -20132,14 +19574,8 @@ var VirtualRenderer = /** @class */ (function () { if (!_self.$scrollAnimation) _self.session.setScrollLeft(e.data - _self.scrollMargin.left); }); - if (!this.$scrollDecorator) { - this.$scrollDecorator = new Decorator(this.scrollBarV, this); - this.$scrollDecorator.$updateDecorators(); - } - else { - this.$scrollDecorator.setScrollBarV(this.scrollBarV); - this.$scrollDecorator.$updateDecorators(); - } + this.$scrollDecorator = new Decorator(this.scrollBarV, this); + this.$scrollDecorator.$updateDecorators(); } else { this.scrollBarV = new VScrollBar(this.container, this); @@ -21814,16 +21250,8 @@ var FoldMode = exports.FoldMode = function () { }; }); -ace.define("ace/ext/error_marker",["require","exports","module","ace/lib/dom","ace/range","ace/config"], function(require, exports, module){/** - * ## Error Marker extension - * - * Provides inline error display functionality for Ace editor. Creates visual error markers that appear as tooltips - * below editor lines containing annotations (errors, warnings, info). Enables navigation between error locations with - * keyboard shortcuts and displays context-sensitive messages with proper styling based on annotation severity. - * - * @module - */ -"use strict"; +ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range","ace/config"], function(require, exports, module){"use strict"; +var LineWidgets = require("../line_widgets").LineWidgets; var dom = require("../lib/dom"); var Range = require("../range").Range; var nls = require("../config").nls; @@ -21873,6 +21301,10 @@ function findAnnotations(session, row, dir) { } exports.showErrorMarker = function (editor, dir) { var session = editor.session; + if (!session.widgetManager) { + session.widgetManager = new LineWidgets(session); + session.widgetManager.attach(editor); + } var pos = editor.getCursorPosition(); var row = pos.row; var oldWidget = session.widgetManager.getWidgetsAtRow(row).filter(function (w) { @@ -22022,8 +21454,7 @@ exports.Editor = Editor; exports.EditSession = EditSession; exports.UndoManager = UndoManager; exports.VirtualRenderer = Renderer; -var version = exports.config.version; -exports.version = version; +exports.version = exports.config.version; }); (function() { ace.require(["ace/ace"], function(a) { @@ -22051,26834 +21482,23146 @@ exports.version = version; /***/ }), -/***/ "../node_modules/coordinate-parser/coordinate-number.js": -/*!**************************************************************!*\ - !*** ../node_modules/coordinate-parser/coordinate-number.js ***! - \**************************************************************/ -/***/ ((module) => { +/***/ "./base/CSSLoader/CSSLoader.coffee": +/*!*****************************************!*\ + !*** ./base/CSSLoader/CSSLoader.coffee ***! + \*****************************************/ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -// Generated by CoffeeScript 2.5.1 -var CoordinateNumber; +/* provided dependency */ var CUI = __webpack_require__(/*! ./base/CUI.coffee */ "./base/CUI.coffee"); -CoordinateNumber = class CoordinateNumber { - constructor(coordinateNumbers) { - coordinateNumbers = this.normalizeCoordinateNumbers(coordinateNumbers); - this.sign = this.normalizedSignOf(coordinateNumbers[0]); - [this.degrees, this.minutes, this.seconds, this.milliseconds] = coordinateNumbers.map(Math.abs); - } +/* + * coffeescript-ui - Coffeescript User Interface System (CUI) + * Copyright (c) 2013 - 2016 Programmfabrik GmbH + * MIT Licence + * https://github.com/programmfabrik/coffeescript-ui, http://www.coffeescript-ui.org + */ +var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; - normalizeCoordinateNumbers(coordinateNumbers) { - var currentNumber, i, j, len, normalizedNumbers; - normalizedNumbers = [0, 0, 0, 0]; - for (i = j = 0, len = coordinateNumbers.length; j < len; i = ++j) { - currentNumber = coordinateNumbers[i]; - normalizedNumbers[i] = parseFloat(currentNumber); - } - return normalizedNumbers; +CUI.CSSLoader = (function(superClass) { + extend(CSSLoader, superClass); + + function CSSLoader() { + return CSSLoader.__super__.constructor.apply(this, arguments); } - normalizedSignOf(number) { - if (number >= 0) { - return 1; + CSSLoader.prototype.readOpts = function() { + CSSLoader.__super__.readOpts.call(this); + if (this._cssName) { + this.__cssName = this._cssName; } else { - return -1; + this.__cssName = "cui-css-" + this.getUniqueId(); } - } + }; - detectSpecialFormats() { - if (this.degreesCanBeSpecial()) { - if (this.degreesCanBeMilliseconds()) { - return this.degreesAsMilliseconds(); - } else if (this.degreesCanBeDegreesMinutesAndSeconds()) { - return this.degreesAsDegreesMinutesAndSeconds(); - } else if (this.degreesCanBeDegreesAndMinutes()) { - return this.degreesAsDegreesAndMinutes(); + CSSLoader.prototype.initOpts = function() { + CSSLoader.__super__.initOpts.call(this); + return this.addOpts({ + cssName: { + check: String } - } - } + }); + }; - degreesCanBeSpecial() { - var canBe; - canBe = false; - if (!this.minutes && !this.seconds) { - canBe = true; - } - return canBe; - } + CSSLoader.prototype.__getCSSNodes = function() { + return CUI.dom.matchSelector(document.documentElement, "link[name=\"" + this.__cssName + "\"]"); + }; - degreesCanBeMilliseconds() { - var canBe; - if (this.degrees > 909090) { - canBe = true; - } else { - canBe = false; + CSSLoader.prototype.getActiveCSS = function() { + var activeCSS, cssNode, i, len, ref; + ref = this.__getCSSNodes(); + for (i = 0, len = ref.length; i < len; i++) { + cssNode = ref[i]; + if (CUI.dom.getAttribute(cssNode, "data-cui-loading")) { + continue; + } + activeCSS = { + url: CUI.dom.getAttribute(cssNode, "data-cui-url"), + theme: CUI.dom.getAttribute(cssNode, "data-cui-theme") + }; + return activeCSS; } - return canBe; - } - - degreesAsMilliseconds() { - this.milliseconds = this.degrees; - return this.degrees = 0; - } + return null; + }; - degreesCanBeDegreesMinutesAndSeconds() { - var canBe; - if (this.degrees > 9090) { - canBe = true; + CSSLoader.prototype.load = function(_opts) { + var active, addThemeToBody, cssNode, css_href, dfr, i, is_loading, len, oldCssNode, old_css_nodes, opts, ref, url; + if (_opts == null) { + _opts = {}; + } + opts = CUI.Element.readOpts(_opts, "CSSLoader", { + theme: { + check: String, + "default": "" + }, + url: { + mandatory: true, + check: String + } + }); + ref = this.__getCSSNodes(); + for (i = 0, len = ref.length; i < len; i++) { + oldCssNode = ref[i]; + is_loading = CUI.dom.getAttribute(oldCssNode, "data-cui-loading"); + if (is_loading) { + console.warn("CSSLoader.load. CSS already loading.", { + opts: opts + }); + return CUI.rejectedPromise(); + } + } + active = this.getActiveCSS(); + if (active && opts.url === active.url && active.theme === opts.theme) { + return CUI.resolvedPromise(); + } + url = opts.url; + dfr = new CUI.Deferred(); + if (url.startsWith("http://") || url.startsWith("https://") || url.startsWith("file://")) { + css_href = url; + } else if (!url.startsWith("/")) { + css_href = CUI.getPathToScript() + url; } else { - canBe = false; + css_href = document.location.origin + url; } - return canBe; - } - - degreesAsDegreesMinutesAndSeconds() { - var newDegrees; - newDegrees = Math.floor(this.degrees / 10000); - this.minutes = Math.floor((this.degrees - newDegrees * 10000) / 100); - this.seconds = Math.floor(this.degrees - newDegrees * 10000 - this.minutes * 100); - return this.degrees = newDegrees; - } - - degreesCanBeDegreesAndMinutes() { - var canBe; - if (this.degrees > 360) { - canBe = true; + addThemeToBody = function() { + var _class, j, len1, ref1; + if (!opts.theme) { + return; + } + CUI.dom.setAttribute(document.body, "data-cui-theme", opts.theme); + ref1 = document.body.classList; + for (j = 0, len1 = ref1.length; j < len1; j++) { + _class = ref1[j]; + if (!_class.startsWith("cui-theme")) { + continue; + } + CUI.dom.removeClass(document.body, _class); + break; + } + CUI.dom.addClass(document.body, "cui-theme-" + opts.theme); + }; + cssNode = CUI.dom.element("LINK", { + rel: "stylesheet", + charset: "utf-8", + name: this.__cssName, + "data-cui-loading": "1", + "data-cui-theme": opts.theme, + "data-cui-url": opts.url, + href: css_href + }); + old_css_nodes = CUI.dom.matchSelector(document.head, "link[name='" + this.__cssName + "']"); + dfr.always((function(_this) { + return function() { + CUI.dom.removeAttribute(cssNode, "data-cui-loading"); + active = _this.getActiveCSS(); + addThemeToBody(); + }; + })(this)); + dfr.fail((function(_this) { + return function(css_href) { + console.error("CSSLoader: Loading failed, removing node.", css_href); + return CUI.dom.remove(cssNode); + }; + })(this)); + CUI.Events.listen({ + node: cssNode, + type: "load", + call: (function(_this) { + return function(ev, info) { + var css_node, ex, found_stylesheet, j, k, len1, len2, ref1, ref2, styleSheet; + if (dfr.state() !== "pending") { + console.warn("CSSLoader.loadTheme: Caught event load second time, ignoring. IE does that for some reason."); + return; + } + if (CUI.browser.ie) { + found_stylesheet = false; + ref1 = document.styleSheets; + for (j = 0, len1 = ref1.length; j < len1; j++) { + styleSheet = ref1[j]; + if (styleSheet.href === css_href) { + try { + if (!((ref2 = styleSheet.cssRules) != null ? ref2.length : void 0)) { + console.error("CSSLoader: Loaded a stylesheet with no rules: ", css_href, styleSheet); + dfr.reject(css_href); + return; + } + found_stylesheet = true; + } catch (error) { + ex = error; + } + break; + } + } + if (!found_stylesheet) { + console.error("CSSLoader: Stylesheet not correctly loaded: ", css_href); + dfr.reject(css_href); + return; + } + } + for (k = 0, len2 = old_css_nodes.length; k < len2; k++) { + css_node = old_css_nodes[k]; + if (css_node === cssNode) { + continue; + } + CUI.dom.remove(css_node); + } + addThemeToBody(); + CUI.Events.trigger({ + type: "viewport-resize", + info: { + css_load: true + } + }); + dfr.resolve(css_href); + }; + })(this) + }); + CUI.Events.listen({ + node: cssNode, + type: "error", + call: (function(_this) { + return function(ev, info) { + console.error("CSS.load: loading error:", url); + dfr.reject(css_href); + }; + })(this) + }); + if (old_css_nodes.length > 0) { + CUI.dom.insertAfter(old_css_nodes[old_css_nodes.length - 1], cssNode); } else { - canBe = false; + document.head.appendChild(cssNode); } - return canBe; - } - - degreesAsDegreesAndMinutes() { - var newDegrees; - newDegrees = Math.floor(this.degrees / 100); - this.minutes = this.degrees - newDegrees * 100; - return this.degrees = newDegrees; - } - - toDecimal() { - var decimalCoordinate; - decimalCoordinate = this.sign * (this.degrees + this.minutes / 60 + this.seconds / 3600 + this.milliseconds / 3600000); - return decimalCoordinate; - } + return dfr.promise(); + }; -}; + return CSSLoader; -module.exports = CoordinateNumber; +})(CUI.Element); /***/ }), -/***/ "../node_modules/coordinate-parser/coordinates.js": -/*!********************************************************!*\ - !*** ../node_modules/coordinate-parser/coordinates.js ***! - \********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -// Generated by CoffeeScript 2.5.1 -var CoordinateNumber, Coordinates, Validator; +/***/ "./base/CSVData.coffee": +/*!*****************************!*\ + !*** ./base/CSVData.coffee ***! + \*****************************/ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -Validator = __webpack_require__(/*! ./validator */ "../node_modules/coordinate-parser/validator.js"); +/* provided dependency */ var CUI = __webpack_require__(/*! ./base/CUI.coffee */ "./base/CUI.coffee"); +var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty, + indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; -CoordinateNumber = __webpack_require__(/*! ./coordinate-number */ "../node_modules/coordinate-parser/coordinate-number.js"); +CUI.CSVData = (function(superClass) { + extend(CSVData, superClass); -Coordinates = class Coordinates { - constructor(coordinateString) { - this.coordinates = coordinateString; - this.latitudeNumbers = null; - this.longitudeNumbers = null; - this.validate(); - this.parse(); + function CSVData() { + return CSVData.__super__.constructor.apply(this, arguments); } - validate() { - var validator; - validator = new Validator(); - return validator.validate(this.coordinates); - } + CSVData.prototype.initOpts = function() { + CSVData.__super__.initOpts.call(this); + return this.addOpts({ + rows: { + check: function(v) { + return CUI.util.isArray(v) && v.length > 0; + } + } + }); + }; - parse() { - this.groupCoordinateNumbers(); - this.latitude = this.extractLatitude(); - return this.longitude = this.extractLongitude(); - } + CSVData.prototype.readOpts = function() { + CSVData.__super__.readOpts.call(this); + this.__max_column_count = 0; + if (this._rows) { + this.rows = this._rows; + } else { + this.rows = []; + } + this.giveAllRowsSameNumberOfColumns(); + }; - groupCoordinateNumbers() { - var coordinateNumbers, numberCountEachCoordinate; - coordinateNumbers = this.extractCoordinateNumbers(this.coordinates); - numberCountEachCoordinate = coordinateNumbers.length / 2; - this.latitudeNumbers = coordinateNumbers.slice(0, numberCountEachCoordinate); - return this.longitudeNumbers = coordinateNumbers.slice((0 - numberCountEachCoordinate)); - } - - extractCoordinateNumbers(coordinates) { - return coordinates.match(/-?\d+(\.\d+)?/g); - } - - extractLatitude() { - var latitude; - latitude = this.coordinateNumbersToDecimal(this.latitudeNumbers); - if (this.latitudeIsNegative()) { - latitude = latitude * -1; + CSVData.prototype.giveAllRowsSameNumberOfColumns = function() { + var col_count, i, idx, j, k, len1, len2, ref, ref1, ref2, ref3, row; + this.__max_column_count = 0; + ref = this.rows; + for (i = 0, len1 = ref.length; i < len1; i++) { + row = ref[i]; + col_count = row.length; + if (col_count > this.__max_column_count) { + this.__max_column_count = col_count; + } } - return latitude; - } - - extractLongitude() { - var longitude; - longitude = this.coordinateNumbersToDecimal(this.longitudeNumbers); - if (this.longitudeIsNegative()) { - longitude = longitude * -1; + ref1 = this.rows; + for (j = 0, len2 = ref1.length; j < len2; j++) { + row = ref1[j]; + if (row.length < this.__max_column_count) { + for (idx = k = ref2 = row.length, ref3 = this.__max_column_count; ref2 <= ref3 ? k < ref3 : k > ref3; idx = ref2 <= ref3 ? ++k : --k) { + row[idx] = ""; + } + } } - return longitude; - } - - coordinateNumbersToDecimal(coordinateNumbers) { - var coordinate, decimalCoordinate; - coordinate = new CoordinateNumber(coordinateNumbers); - coordinate.detectSpecialFormats(); - decimalCoordinate = coordinate.toDecimal(); - return decimalCoordinate; - } - - latitudeIsNegative() { - var isNegative; - isNegative = this.coordinates.match(/s/i); - return isNegative; - } - - longitudeIsNegative() { - var isNegative; - isNegative = this.coordinates.match(/w/i); - return isNegative; - } - - getLatitude() { - return this.latitude; - } - - getLongitude() { - return this.longitude; - } - -}; + }; -module.exports = Coordinates; + CSVData.prototype.getMaxColumnCount = function() { + return this.__max_column_count; + }; + CSVData.prototype.getRows = function() { + return this.rows; + }; -/***/ }), + CSVData.prototype.getRow = function(row_i) { + return this.rows[row_i]; + }; -/***/ "../node_modules/coordinate-parser/validator.js": -/*!******************************************************!*\ - !*** ../node_modules/coordinate-parser/validator.js ***! - \******************************************************/ -/***/ ((module) => { + CSVData.prototype.getRowsCount = function() { + return this.rows.length; + }; -// Generated by CoffeeScript 2.5.1 -var Validator; + CSVData.prototype.debug = function() { + return console.debug("rows:", this.rows); + }; -Validator = class Validator { - isValid(coordinates) { - var isValid, validationError; - isValid = true; - try { - this.validate(coordinates); - return isValid; - } catch (error) { - validationError = error; - isValid = false; - return isValid; + CSVData.prototype.toText = function(_opts) { + var _row, _rows, col, cr, i, idx, j, len1, len2, nl, opts, quote, ref, row, str; + if (_opts == null) { + _opts = {}; } - } - - validate(coordinates) { - this.checkContainsNoLetters(coordinates); - this.checkValidOrientation(coordinates); - return this.checkNumbers(coordinates); - } - - checkContainsNoLetters(coordinates) { - var containsLetters; - containsLetters = /(?![neswd])[a-z]/i.test(coordinates); - if (containsLetters) { - throw new Error('Coordinate contains invalid alphanumeric characters.'); + opts = CUI.Element.readOpts(_opts, "CSVData.toText", { + delimiter: { + mandatory: true, + "default": ";", + check: (function(_this) { + return function(v) { + return CUI.util.isString(v) && v.length > 0; + }; + })(this) + }, + quotechar: { + mandatory: true, + "default": '"', + check: (function(_this) { + return function(v) { + return CUI.util.isString(v) && v.length > 0; + }; + })(this) + }, + always_quote: { + mandatory: true, + "default": true, + check: Boolean + }, + equal_columns: { + mandatory: true, + "default": true, + check: Boolean + }, + newline: { + mandatory: true, + "default": String.fromCharCode(10), + check: (function(_this) { + return function(v) { + return CUI.util.isString(v) && v.length > 0; + }; + })(this) + } + }); + if (opts.equal_columns) { + this.giveAllRowsSameNumberOfColumns(); } - } - - checkValidOrientation(coordinates) { - var validOrientation; - validOrientation = /^[^nsew]*[ns]?[^nsew]*[ew]?[^nsew]*$/i.test(coordinates); - if (!validOrientation) { - throw new Error('Invalid cardinal direction.'); + nl = String.fromCharCode(10); + cr = String.fromCharCode(13); + _rows = []; + ref = this.rows; + for (i = 0, len1 = ref.length; i < len1; i++) { + row = ref[i]; + _row = []; + for (idx = j = 0, len2 = row.length; j < len2; idx = ++j) { + col = row[idx]; + if (idx > 0) { + _row.push(opts.delimiter); + } + if (CUI.util.isEmpty(col)) { + str = ""; + } else { + str = "" + col; + } + if (opts.always_quote) { + quote = true; + } else if (str.indexOf(opts.delimiter) > -1) { + quote = true; + } else if (str.indexOf(opts.quotechar) > -1) { + quote = true; + } else if (str.indexOf(nl) > -1) { + quote = true; + } else if (str.indexOf(cr) > -1) { + quote = true; + } else { + quote = false; + } + if (quote) { + _row.push(CUI.CSVData.quote(str, opts.quotechar)); + } else { + _row.push(str); + } + } + _rows.push(_row.join("")); } - } - - checkNumbers(coordinates) { - var coordinateNumbers; - coordinateNumbers = coordinates.match(/-?\d+(\.\d+)?/g); - this.checkAnyCoordinateNumbers(coordinateNumbers); - this.checkEvenCoordinateNumbers(coordinateNumbers); - return this.checkMaximumCoordinateNumbers(coordinateNumbers); - } + return _rows.join(opts.newline); + }; - checkAnyCoordinateNumbers(coordinateNumbers) { - if (coordinateNumbers.length === 0) { - throw new Error('Could not find any coordinate number'); + CSVData.prototype.parse = function(_opts) { + var auto_delimiters, auto_quotechars, column_chars, column_idx, columns, delimiter, dfr, do_work, idx, in_quotes, len, lines, opts, quotechar, space_chars, text; + if (_opts == null) { + _opts = {}; } - } - - checkEvenCoordinateNumbers(coordinateNumbers) { - var isUnevenNumbers; - isUnevenNumbers = coordinateNumbers.length % 2; - if (isUnevenNumbers) { - throw new Error('Uneven count of latitude/longitude numbers'); + opts = CUI.Element.readOpts(_opts, "CSVData.parse", { + text: { + mandatory: true, + check: String + }, + delimiter: { + check: String + }, + quotechar: { + check: String + }, + defer: { + mandatory: true, + "default": true, + check: Boolean + } + }); + this.rows = []; + text = opts.text; + columns = []; + column_idx = 0; + column_chars = []; + len = text.length; + idx = 0; + in_quotes = false; + lines = 0; + space_chars = [' ']; + auto_quotechars = ['"', "'"]; + auto_delimiters = [",", ";", "\t"]; + if (opts.delimiter !== void 0) { + delimiter = opts.delimiter; + } else { + delimiter = null; } - } + if (opts.quotechar !== void 0) { + quotechar = opts.quotechar; + } else { + quotechar = null; + } + if (opts.defer) { + dfr = new CUI.Deferred(); + } + do_work = (function(_this) { + return function() { + var char, charCode, end_column, end_row, info, nextCharCode; + end_column = function() { + columns[column_idx] = column_chars.join(""); + column_chars.splice(0); + column_idx = column_idx + 1; + }; + end_row = function() { + if (columns.length > 0) { + lines = lines + 1; + _this.rows.push(columns); + columns = []; + } + column_idx = 0; + }; + while (idx < len) { + char = text.charAt(idx); + if (column_chars.length === 0 && !in_quotes && indexOf.call(space_chars, char) >= 0) { + idx = idx + 1; + continue; + } + if (quotechar === null && indexOf.call(auto_quotechars, char) >= 0) { + quotechar = char; + } + if (delimiter === null && indexOf.call(auto_delimiters, char) >= 0) { + delimiter = char; + } + if (char === quotechar && (column_chars.length === 0 || in_quotes)) { + if (in_quotes) { + if (text[idx + 1] === quotechar) { + column_chars.push(char); + idx = idx + 2; + continue; + } else { + in_quotes = false; + idx = idx + 1; + continue; + } + } else { + in_quotes = true; + idx = idx + 1; + continue; + } + } + if (char === delimiter) { + if (in_quotes) { + column_chars.push(char); + idx = idx + 1; + continue; + } else { + end_column(); + idx = idx + 1; + continue; + } + } + charCode = text.charCodeAt(idx); + nextCharCode = text.charCodeAt(idx + 1); + if (charCode === 13 || charCode === 10) { + if (charCode === 13 && nextCharCode === 10) { + idx = idx + 2; + } else { + idx = idx + 1; + } + if (in_quotes) { + column_chars.push(String.fromCharCode(10)); + } else { + end_column(); + end_row(); + if (lines % 1000 === 0 && opts.defer) { + dfr.notify({ + row_count: lines, + file_read_idx: idx, + file_length: len + }); + CUI.setTimeout({ + ms: 10, + call: do_work + }); + return; + } + } + continue; + } + column_chars.push(char); + idx = idx + 1; + } + if (column_chars.length > 0) { + end_column(); + } + if (columns.length > 0) { + end_row(); + } + _this.giveAllRowsSameNumberOfColumns(); + info = { + row_count: lines, + file_length: len, + rows: _this.rows + }; + if (opts.defer) { + return dfr.resolve(info); + } else { + return info; + } + }; + })(this); + if (opts.defer) { + CUI.setTimeout({ + ms: 0, + call: do_work + }); + dfr.done((function(_this) { + return function() {}; + })(this)); + return dfr.promise(); + } else { + return do_work(); + } + }; - checkMaximumCoordinateNumbers(coordinateNumbers) { - if (coordinateNumbers.length > 6) { - throw new Error('Too many coordinate numbers'); + CSVData.quote = function(str, quotechar) { + if (quotechar == null) { + quotechar = '"'; } - } + return quotechar + str.replace(new RegExp(CUI.util.escapeRegExp(quotechar), "g"), quotechar + quotechar) + quotechar; + }; -}; + return CSVData; -module.exports = Validator; +})(CUI.Element); /***/ }), -/***/ "../node_modules/email-addresses/lib/email-addresses.js": -/*!**************************************************************!*\ - !*** ../node_modules/email-addresses/lib/email-addresses.js ***! - \**************************************************************/ -/***/ (function(module) { +/***/ "./base/CUI.coffee": +/*!*************************!*\ + !*** ./base/CUI.coffee ***! + \*************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -// email-addresses.js - RFC 5322 email address parser -// v 5.0.0 -// -// http://tools.ietf.org/html/rfc5322 -// -// This library does not validate email addresses. -// emailAddresses attempts to parse addresses using the (fairly liberal) -// grammar specified in RFC 5322. -// -// email-addresses returns { -// ast: , -// addresses: [{ -// node: , -// name: , -// address: , -// local: , -// domain: -// }, ...] -// } -// -// emailAddresses.parseOneAddress and emailAddresses.parseAddressList -// work as you might expect. Try it out. -// -// Many thanks to Dominic Sayers and his documentation on the is_email function, -// http://code.google.com/p/isemail/ , which helped greatly in writing this parser. +/* + * coffeescript-ui - Coffeescript User Interface System (CUI) + * Copyright (c) 2013 - 2016 Programmfabrik GmbH + * MIT Licence + * https://github.com/programmfabrik/coffeescript-ui, http://www.coffeescript-ui.org + */ +var CUI, marked; -(function (global) { -"use strict"; +marked = __webpack_require__(/*! marked */ "../node_modules/marked/lib/marked.js"); -function parse5322(opts) { +CUI = (function() { + function CUI() {} - // tokenizing functions + CUI.__readyFuncs = []; - function inStr() { return pos < len; } - function curTok() { return parseString[pos]; } - function getPos() { return pos; } - function setPos(i) { pos = i; } - function nextTok() { pos += 1; } - function initialize() { - pos = 0; - len = parseString.length; - } + CUI.__themes = []; - // parser helper functions + CUI.__ng__ = true; - function o(name, value) { - return { - name: name, - tokens: value || "", - semantic: value || "", - children: [] + CUI.start = function() { + var icons, trigger_viewport_resize; + trigger_viewport_resize = (function(_this) { + return function() { + return CUI.Events.trigger({ + type: "viewport-resize" + }); + }; + })(this); + CUI.Events.listen({ + type: "resize", + node: window, + call: (function(_this) { + return function(ev, info) { + if (!CUI.browser.ie) { + trigger_viewport_resize(); + } else { + CUI.scheduleCallback({ + ms: 500, + call: trigger_viewport_resize + }); + } }; - } - - function wrap(name, ast) { - var n; - if (ast === null) { return null; } - n = o(name); - n.tokens = ast.tokens; - n.semantic = ast.semantic; - n.children.push(ast); - return n; - } - - function add(parent, child) { - if (child !== null) { - parent.tokens += child.tokens; - parent.semantic += child.semantic; + })(this) + }); + CUI.Events.listen({ + type: "drop", + node: document.documentElement, + call: function(ev) { + return ev.preventDefault(); + } + }); + CUI.Events.listen({ + type: "keyup", + node: window, + capture: true, + call: (function(_this) { + return function(ev) { + if (ev.getKeyboard() === "C+U+I") { + CUI.toaster({ + text: "CUI!" + }); + } + if (CUI.defaults.debug) { + if (ev.getKeyboard() === "Alt+Shift+U") { + _this.__toggleUIElements(); + } + if (ev.getKeyboard() === "Control+Shift+U") { + _this.__toggleUIElements(true); + } + } + }; + })(this) + }); + CUI.Events.listen({ + type: "keydown", + node: window, + call: function(ev) { + var j, len1, node, ref, ref1; + if (ev.getKeyboard() === "c+") { + CUI.toaster({ + text: "CUI!" + }); } - parent.children.push(child); - return parent; - } - - function compareToken(fxnCompare) { - var tok; - if (!inStr()) { return null; } - tok = curTok(); - if (fxnCompare(tok)) { - nextTok(); - return o('token', tok); + if (ev.keyCode() === 8) { + ref = CUI.dom.elementsUntil(ev.getTarget(), null, document.documentElement); + for (j = 0, len1 = ref.length; j < len1; j++) { + node = ref[j]; + if ((ref1 = node.tagName) === "INPUT" || ref1 === "TEXTAREA") { + return; + } + if (node.getAttribute("contenteditable") === "true") { + return; + } + } + ev.preventDefault(); } - return null; - } + } + }); + document.body.scrollTop = 0; + icons = (__webpack_require__(/*! ../scss/icons/icons.svg */ "./scss/icons/icons.svg")["default"]); + CUI.Template.loadText(icons); + CUI.Template.load(); + this.chainedCall.apply(this, this.__readyFuncs).always((function(_this) { + return function() { + return _this.__ready = true; + }; + })(this)); + return this; + }; - function noop() { - return null; + CUI.getPathToScript = function() { + var cui_script, m, scripts; + if (!this.__pathToScript) { + scripts = document.getElementsByTagName('script'); + cui_script = scripts[scripts.length - 1]; + if (m = cui_script.src.match("(.*/).*?\.js$")) { + this.__pathToScript = m[1]; + } else { + CUI.util.assert(this.__pathToScript, "CUI", "Could not determine script path."); + } } + return this.__pathToScript; + }; - function literal(lit) { - return function literalFunc() { - return wrap('literal', compareToken(function (tok) { - return tok === lit; - })); - }; + CUI.ready = function(func) { + if (this.__ready) { + return func.call(this); } + return this.__readyFuncs.push(func); + }; - function and() { - var args = arguments; - return function andFunc() { - var i, s, result, start; - start = getPos(); - s = o('and'); - for (i = 0; i < args.length; i += 1) { - result = args[i](); - if (result === null) { - setPos(start); - return null; - } - add(s, result); - } - return s; - }; - } + CUI.defaults = { + FileUpload: { + name: "files[]" + }, + debug: true, + asserts: true, + asserts_alert: 'js', + "class": {} + }; - function or() { - var args = arguments; - return function orFunc() { - var i, result, start; - start = getPos(); - for (i = 0; i < args.length; i += 1) { - result = args[i](); - if (result !== null) { - return result; - } - setPos(start); - } - return null; - }; - } + CUI.resolvedPromise = function() { + var dfr; + dfr = new CUI.Deferred(); + dfr.resolve.apply(dfr, arguments); + return dfr.promise(); + }; - function opt(prod) { - return function optFunc() { - var result, start; - start = getPos(); - result = prod(); - if (result !== null) { - return result; - } - else { - setPos(start); - return o('opt'); - } - }; - } + CUI.rejectedPromise = function() { + var dfr; + dfr = new CUI.Deferred(); + dfr.reject.apply(dfr, arguments); + return dfr.promise(); + }; - function invis(prod) { - return function invisFunc() { - var result = prod(); - if (result !== null) { - result.semantic = ""; - } - return result; - }; - } + CUI.chainedCall = function() { + var __this, args, dfr, get_args, get_return_value, idx, init_next, return_values; + idx = 0; + __this = this; + get_args = function(_arguments) { + var _args, arg, j, len1; + _args = []; + for (j = 0, len1 = _arguments.length; j < len1; j++) { + arg = _arguments[j]; + _args.push(arg); + } + return _args; + }; + get_return_value = function(_arguments) { + var _args; + _args = get_args(_arguments); + if (_args.length === 0) { + return void 0; + } else if (_args.length === 1) { + return _args[0]; + } else { + return _args; + } + }; + args = get_args(arguments); + return_values = []; + init_next = (function(_this) { + return function() { + var ret; + if (idx === args.length) { + dfr.resolve.apply(dfr, return_values); + return; + } + if (CUI.util.isFunction(args[idx])) { + if (__this !== CUI) { + ret = args[idx].call(__this); + } else { + ret = args[idx](); + } + } else { + ret = args[idx]; + } + idx++; + if (CUI.util.isPromise(ret)) { + ret.done(function() { + return_values.push(get_return_value(arguments)); + return init_next(); + }).fail(function() { + return_values.push(get_return_value(arguments)); + return dfr.reject.apply(dfr, return_values); + }); + } else { + return_values.push(ret); + init_next(); + } + }; + })(this); + dfr = new CUI.Deferred(); + init_next(); + return dfr.promise(); + }; - function colwsp(prod) { - return function collapseSemanticWhitespace() { - var result = prod(); - if (result !== null && result.semantic.length > 0) { - result.semantic = " "; - } - return result; - }; + CUI.chunkWork = function(_opts) { + var chunk_size, dfr, idx, len, next_chunk, opts, timeout; + if (_opts == null) { + _opts = {}; } - - function star(prod, minimum) { - return function starFunc() { - var s, result, count, start, min; - start = getPos(); - s = o('star'); - count = 0; - min = minimum === undefined ? 0 : minimum; - while ((result = prod()) !== null) { - count = count + 1; - add(s, result); - } - if (count >= min) { - return s; - } - else { - setPos(start); - return null; + opts = CUI.Element.readOpts(_opts, "CUI.chunkWork", { + items: { + mandatory: true, + check: function(v) { + return CUI.util.isArray(v); + } + }, + chunk_size: { + mandatory: true, + "default": 10, + check: function(v) { + return v >= 1; + } + }, + timeout: { + mandatory: true, + "default": 0, + check: function(v) { + return v >= -1; + } + }, + call: { + mandatory: true, + check: function(v) { + return v instanceof Function; + } + } + }); + chunk_size = opts.chunk_size; + timeout = opts.timeout; + CUI.util.assert(this !== CUI, "CUI.chunkWork", "Cannot call CUI.chunkWork with 'this' not set to the caller."); + idx = 0; + len = opts.items.length; + next_chunk = (function(_this) { + return function() { + var go_on, progress, ret; + progress = (idx + 1) + " - " + Math.min(len, idx + chunk_size) + " / " + len; + dfr.notify({ + progress: progress, + idx: idx, + len: len, + chunk_size: chunk_size + }); + go_on = function() { + if (idx + chunk_size >= len) { + dfr.resolve(); + } else { + idx = idx + chunk_size; + if (timeout === -1) { + next_chunk(); + } else { + CUI.setTimeout({ + ms: timeout, + call: next_chunk + }); } + } }; - } + ret = opts.call.call(_this, opts.items.slice(idx, idx + opts.chunk_size), idx, len); + if (ret === false) { + dfr.reject(); + return; + } + if (CUI.util.isPromise(ret)) { + ret.fail(dfr.reject).done(go_on); + } else { + go_on(); + } + }; + })(this); + dfr = new CUI.Deferred(); + CUI.setTimeout({ + ms: Math.min(0, timeout), + call: (function(_this) { + return function() { + if (len > 0) { + return next_chunk(); + } else { + return dfr.resolve(); + } + }; + })(this) + }); + return dfr.promise(); + }; - // One expects names to get normalized like this: - // " First Last " -> "First Last" - // "First Last" -> "First Last" - // "First Last" -> "First Last" - function collapseWhitespace(s) { - return s.replace(/([ \t]|\r\n)+/g, ' ').replace(/^\s*/, '').replace(/\s*$/, ''); + CUI.chunkWorkOLD = function(objects, chunkSize, timeout) { + var dfr, do_next_chunk, idx; + if (chunkSize == null) { + chunkSize = 10; } - - // UTF-8 pseudo-production (RFC 6532) - // RFC 6532 extends RFC 5322 productions to include UTF-8 - // using the following productions: - // UTF8-non-ascii = UTF8-2 / UTF8-3 / UTF8-4 - // UTF8-2 = - // UTF8-3 = - // UTF8-4 = - // - // For reference, the extended RFC 5322 productions are: - // VCHAR =/ UTF8-non-ascii - // ctext =/ UTF8-non-ascii - // atext =/ UTF8-non-ascii - // qtext =/ UTF8-non-ascii - // dtext =/ UTF8-non-ascii - function isUTF8NonAscii(tok) { - // In JavaScript, we just deal directly with Unicode code points, - // so we aren't checking individual bytes for UTF-8 encoding. - // Just check that the character is non-ascii. - return tok.charCodeAt(0) >= 128; + if (timeout == null) { + timeout = 0; + } + dfr = new CUI.Deferred(); + idx = 0; + do_next_chunk = (function(_this) { + return function() { + var chunk; + chunk = 0; + while (idx < objects.length && (chunk < chunkSize || chunkSize === 0)) { + if (dfr.state() === "rejected") { + return; + } + dfr.notify(objects[idx], idx); + if (idx === objects.length - 1) { + dfr.resolve(); + return; + } + idx++; + chunk++; + } + if (idx < objects.length) { + return CUI.setTimeout(do_next_chunk, timeout); + } + }; + })(this); + if (objects.length === 0) { + CUI.setTimeout((function(_this) { + return function() { + if (dfr.state() === "rejected") { + return; + } + return dfr.resolve(); + }; + })(this)); + } else { + CUI.setTimeout(do_next_chunk); } + return dfr; + }; + CUI.proxyMethods = function(target, source, methods) { + var j, k, len1, results1; + results1 = []; + for (j = 0, len1 = methods.length; j < len1; j++) { + k = methods[j]; + results1.push(target.prototype[k] = source.prototype[k]); + } + return results1; + }; - // common productions (RFC 5234) - // http://tools.ietf.org/html/rfc5234 - // B.1. Core Rules + CUI.__timeouts = []; - // CR = %x0D - // ; carriage return - function cr() { return wrap('cr', literal('\r')()); } + CUI.__timeoutCallbacks = []; - // CRLF = CR LF - // ; Internet standard newline - function crlf() { return wrap('crlf', and(cr, lf)()); } + CUI.__callTimeoutChangeCallbacks = function() { + var cb, j, len1, ref, tracked; + tracked = this.countTimeouts(); + ref = this.__timeoutCallbacks; + for (j = 0, len1 = ref.length; j < len1; j++) { + cb = ref[j]; + cb(tracked); + } + }; - // DQUOTE = %x22 - // ; " (Double Quote) - function dquote() { return wrap('dquote', literal('"')()); } + CUI.__removeTimeout = function(timeout) { + if (CUI.util.removeFromArray(timeout, this.__timeouts)) { + if (timeout.track) { + this.__callTimeoutChangeCallbacks(); + } + } + }; - // HTAB = %x09 - // ; horizontal tab - function htab() { return wrap('htab', literal('\t')()); } + CUI.__getTimeoutById = function(timeoutID, ignoreNotFound) { + var j, len1, ref, timeout; + if (ignoreNotFound == null) { + ignoreNotFound = false; + } + ref = this.__timeouts; + for (j = 0, len1 = ref.length; j < len1; j++) { + timeout = ref[j]; + if (timeout.id === timeoutID) { + return timeout; + } + } + CUI.util.assert(ignoreNotFound, "CUI.__getTimeoutById", "Timeout #" + timeoutID + " not found."); + return null; + }; - // LF = %x0A - // ; linefeed - function lf() { return wrap('lf', literal('\n')()); } + CUI.resetTimeout = function(timeoutID) { + var old_real_id, tid, timeout; + timeout = this.__getTimeoutById(timeoutID); + CUI.util.assert(!timeout.__isRunning, "CUI.resetTimeout", "Timeout " + timeoutID + " cannot be resetted while running.", { + timeout: timeout + }); + if (typeof timeout.onReset === "function") { + timeout.onReset(timeout); + } + window.clearTimeout(timeout.real_id); + old_real_id = timeout.real_id; + tid = this.__startTimeout(timeout); + return tid; + }; - // SP = %x20 - function sp() { return wrap('sp', literal(' ')()); } + CUI.registerTimeoutChangeCallback = function(cb) { + return this.__timeoutCallbacks.push(cb); + }; - // VCHAR = %x21-7E - // ; visible (printing) characters - function vchar() { - return wrap('vchar', compareToken(function vcharFunc(tok) { - var code = tok.charCodeAt(0); - var accept = (0x21 <= code && code <= 0x7E); - if (opts.rfc6532) { - accept = accept || isUTF8NonAscii(tok); - } - return accept; - })); + CUI.setTimeout = function(_func, ms, track) { + var func, onDone, onReset, timeout; + if (ms == null) { + ms = 0; } - - // WSP = SP / HTAB - // ; white space - function wsp() { return wrap('wsp', or(sp, htab)()); } - - - // email productions (RFC 5322) - // http://tools.ietf.org/html/rfc5322 - // 3.2.1. Quoted characters - - // quoted-pair = ("\" (VCHAR / WSP)) / obs-qp - function quotedPair() { - var qp = wrap('quoted-pair', - or( - and(literal('\\'), or(vchar, wsp)), - obsQP - )()); - if (qp === null) { return null; } - // a quoted pair will be two characters, and the "\" character - // should be semantically "invisible" (RFC 5322 3.2.1) - qp.semantic = qp.semantic[1]; - return qp; + if (CUI.util.isPlainObject(_func)) { + ms = _func.ms || 0; + track = _func.track; + func = _func.call; + onDone = _func.onDone; + onReset = _func.onReset; + } else { + func = _func; + } + if (CUI.util.isNull(track)) { + if (ms === 0) { + track = false; + } else { + track = true; + } + } + CUI.util.assert(CUI.util.isFunction(func), "CUI.setTimeout", "Function needs to be a Function (opts.call)", { + parameter: _func + }); + timeout = { + call: (function(_this) { + return function() { + timeout.__isRunning = true; + func(); + _this.__removeTimeout(timeout); + return typeof timeout.onDone === "function" ? timeout.onDone(timeout) : void 0; + }; + })(this), + ms: ms, + func: func, + track: track, + onDone: onDone, + onReset: onReset + }; + this.__timeouts.push(timeout); + if (track && ms > 0) { + this.__callTimeoutChangeCallbacks(); } + return this.__startTimeout(timeout); + }; - // 3.2.2. Folding White Space and Comments + CUI.__scheduledCallbacks = []; - // FWS = ([*WSP CRLF] 1*WSP) / obs-FWS - function fws() { - return wrap('fws', or( - obsFws, - and( - opt(and( - star(wsp), - invis(crlf) - )), - star(wsp, 1) - ) - )()); + CUI.scheduleCallback = function(_opts) { + var cb, dfr, idx, opts, timeoutID; + opts = CUI.Element.readOpts(_opts, "CUI.scheduleCallback", { + call: { + mandatory: true, + check: Function + }, + ms: { + "default": 0, + check: function(v) { + return CUI.util.isInteger(v) && v >= 0; + } + }, + track: { + "default": false, + check: Boolean + } + }); + idx = CUI.util.idxInArray(opts.call, this.__scheduledCallbacks, function(v) { + return v.call === opts.call; + }); + if (idx > -1 && CUI.isTimeoutRunning(this.__scheduledCallbacks[idx].timeoutID)) { + idx = -1; } - - // ctext = %d33-39 / ; Printable US-ASCII - // %d42-91 / ; characters not including - // %d93-126 / ; "(", ")", or "\" - // obs-ctext - function ctext() { - return wrap('ctext', or( - function ctextFunc1() { - return compareToken(function ctextFunc2(tok) { - var code = tok.charCodeAt(0); - var accept = - (33 <= code && code <= 39) || - (42 <= code && code <= 91) || - (93 <= code && code <= 126); - if (opts.rfc6532) { - accept = accept || isUTF8NonAscii(tok); - } - return accept; - }); - }, - obsCtext - )()); + if (idx === -1) { + idx = this.__scheduledCallbacks.length; + } else { + CUI.resetTimeout(this.__scheduledCallbacks[idx].timeoutID); + return this.__scheduledCallbacks[idx].promise; } + dfr = new CUI.Deferred(); + timeoutID = CUI.setTimeout({ + ms: opts.ms, + track: opts.track, + call: (function(_this) { + return function() { + opts.call(); + return dfr.resolve(); + }; + })(this) + }); + cb = this.__scheduledCallbacks[idx] = { + call: opts.call, + timeoutID: timeoutID, + promise: dfr.promise() + }; + dfr.done((function(_this) { + return function() { + return CUI.util.removeFromArray(opts.call, _this.__scheduledCallbacks, function(v) { + return v.call === opts.call; + }); + }; + })(this)); + return cb.promise; + }; - // ccontent = ctext / quoted-pair / comment - function ccontent() { - return wrap('ccontent', or(ctext, quotedPair, comment)()); + CUI.scheduleCallbackCancel = function(_opts) { + var idx, opts; + opts = CUI.Element.readOpts(_opts, "CUI.scheduleCallbackCancel", { + call: { + mandatory: true, + check: Function + } + }); + idx = CUI.util.idxInArray(opts.call, this.__scheduledCallbacks, function(v) { + return v.call === opts.call; + }); + if (idx > -1 && !CUI.isTimeoutRunning(this.__scheduledCallbacks[idx].timeoutID)) { + CUI.clearTimeout(this.__scheduledCallbacks[idx].timeoutID); + this.__scheduledCallbacks.splice(idx, 1); + return true; + } else { + return false; } + }; - // comment = "(" *([FWS] ccontent) [FWS] ")" - function comment() { - return wrap('comment', and( - literal('('), - star(and(opt(fws), ccontent)), - opt(fws), - literal(')') - )()); + CUI.utf8ArrayBufferToString = function(arrayBuffer) { + var array, c, char2, char3, i, len, out; + out = []; + array = new Uint8Array(arrayBuffer); + len = array.length; + i = 0; + while (i < len) { + c = array[i++]; + switch (c >> 4) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + out.push(String.fromCharCode(c)); + break; + case 12: + case 13: + char2 = array[i++]; + out.push(String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F))); + break; + case 14: + char2 = array[i++]; + char3 = array[i++]; + out.push(String.fromCharCode(((c & 0x0F) << 12) | ((char2 & 0x3F) << 6) | ((char3 & 0x3F) << 0))); + } } + return out.join(""); + }; - // CFWS = (1*([FWS] comment) [FWS]) / FWS - function cfws() { - return wrap('cfws', or( - and( - star( - and(opt(fws), comment), - 1 - ), - opt(fws) - ), - fws - )()); + CUI.__startTimeout = function(timeout) { + var real_id; + real_id = window.setTimeout(timeout.call, timeout.ms); + if (!timeout.id) { + timeout.id = real_id; } + timeout.real_id = real_id; + return timeout.id; + }; - // 3.2.3. Atom - - //atext = ALPHA / DIGIT / ; Printable US-ASCII - // "!" / "#" / ; characters not including - // "$" / "%" / ; specials. Used for atoms. - // "&" / "'" / - // "*" / "+" / - // "-" / "/" / - // "=" / "?" / - // "^" / "_" / - // "`" / "{" / - // "|" / "}" / - // "~" - function atext() { - return wrap('atext', compareToken(function atextFunc(tok) { - var accept = - ('a' <= tok && tok <= 'z') || - ('A' <= tok && tok <= 'Z') || - ('0' <= tok && tok <= '9') || - (['!', '#', '$', '%', '&', '\'', '*', '+', '-', '/', - '=', '?', '^', '_', '`', '{', '|', '}', '~'].indexOf(tok) >= 0); - if (opts.rfc6532) { - accept = accept || isUTF8NonAscii(tok); - } - return accept; - })); + CUI.countTimeouts = function() { + var j, len1, ref, timeout, tracked; + tracked = 0; + ref = this.__timeouts; + for (j = 0, len1 = ref.length; j < len1; j++) { + timeout = ref[j]; + if (timeout.track) { + tracked++; + } } + return tracked; + }; - // atom = [CFWS] 1*atext [CFWS] - function atom() { - return wrap('atom', and(colwsp(opt(cfws)), star(atext, 1), colwsp(opt(cfws)))()); + CUI.clearTimeout = function(timeoutID) { + var timeout; + timeout = this.__getTimeoutById(timeoutID, true); + if (!timeout) { + return; } + window.clearTimeout(timeout.real_id); + this.__removeTimeout(timeout); + return timeout.id; + }; - // dot-atom-text = 1*atext *("." 1*atext) - function dotAtomText() { - var s, maybeText; - s = wrap('dot-atom-text', star(atext, 1)()); - if (s === null) { return s; } - maybeText = star(and(literal('.'), star(atext, 1)))(); - if (maybeText !== null) { - add(s, maybeText); - } - return s; + CUI.isTimeoutRunning = function(timeoutID) { + var timeout; + timeout = this.__getTimeoutById(timeoutID, true); + if (!(timeout != null ? timeout.__isRunning : void 0)) { + return false; + } else { + return true; } + }; - // dot-atom = [CFWS] dot-atom-text [CFWS] - function dotAtom() { - return wrap('dot-atom', and(invis(opt(cfws)), dotAtomText, invis(opt(cfws)))()); - } + CUI.setInterval = function(func, ms) { + return window.setInterval(func, ms); + }; - // 3.2.4. Quoted Strings + CUI.clearInterval = function(interval) { + return window.clearInterval(interval); + }; - // qtext = %d33 / ; Printable US-ASCII - // %d35-91 / ; characters not including - // %d93-126 / ; "\" or the quote character - // obs-qtext - function qtext() { - return wrap('qtext', or( - function qtextFunc1() { - return compareToken(function qtextFunc2(tok) { - var code = tok.charCodeAt(0); - var accept = - (33 === code) || - (35 <= code && code <= 91) || - (93 <= code && code <= 126); - if (opts.rfc6532) { - accept = accept || isUTF8NonAscii(tok); - } - return accept; - }); - }, - obsQtext - )()); - } + CUI.startWebdriverTest = function() { + var a; + a = "body"; + return CUI.dom.addClass(a, "cui-webdriver-test"); + }; - // qcontent = qtext / quoted-pair - function qcontent() { - return wrap('qcontent', or(qtext, quotedPair)()); + CUI.getParameterByName = function(name, search) { + var regex, results; + if (search == null) { + search = document.location.search; } - - // quoted-string = [CFWS] - // DQUOTE *([FWS] qcontent) [FWS] DQUOTE - // [CFWS] - function quotedString() { - return wrap('quoted-string', and( - invis(opt(cfws)), - invis(dquote), star(and(opt(colwsp(fws)), qcontent)), opt(invis(fws)), invis(dquote), - invis(opt(cfws)) - )()); + name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); + regex = new RegExp("[\\?&]" + name + "=([^&#]*)"); + results = regex.exec(search); + if (results === null) { + return ""; + } else { + return decodeURIComponent(results[1].replace(/\+/g, " ")); } + }; - // 3.2.5 Miscellaneous Tokens + CUI.setSessionStorage = function(key, value) { + return this.__setStorage("sessionStorage", key, value); + }; - // word = atom / quoted-string - function word() { - return wrap('word', or(atom, quotedString)()); + CUI.getSessionStorage = function(key) { + if (key == null) { + key = null; } + return this.__getStorage("sessionStorage", key); + }; - // phrase = 1*word / obs-phrase - function phrase() { - return wrap('phrase', or(obsPhrase, star(word, 1))()); - } + CUI.clearSessionStorage = function() { + return this.__clearStorage("sessionStorage"); + }; - // 3.4. Address Specification - // address = mailbox / group - function address() { - return wrap('address', or(mailbox, group)()); - } + CUI.setLocalStorage = function(key, value) { + return this.__setStorage("localStorage", key, value); + }; - // mailbox = name-addr / addr-spec - function mailbox() { - return wrap('mailbox', or(nameAddr, addrSpec)()); + CUI.getLocalStorage = function(key) { + if (key == null) { + key = null; } + return this.__getStorage("localStorage", key); + }; - // name-addr = [display-name] angle-addr - function nameAddr() { - return wrap('name-addr', and(opt(displayName), angleAddr)()); - } + CUI.clearLocalStorage = function() { + return this.__clearStorage("localStorage"); + }; - // angle-addr = [CFWS] "<" addr-spec ">" [CFWS] / - // obs-angle-addr - function angleAddr() { - return wrap('angle-addr', or( - and( - invis(opt(cfws)), - literal('<'), - addrSpec, - literal('>'), - invis(opt(cfws)) - ), - obsAngleAddr - )()); - } + CUI.__storage = { + localStorage: null, + sessionStorage: null + }; - // group = display-name ":" [group-list] ";" [CFWS] - function group() { - return wrap('group', and( - displayName, - literal(':'), - opt(groupList), - literal(';'), - invis(opt(cfws)) - )()); + CUI.__setStorage = function(skey, key, value) { + var data, e; + data = this.__getStorage(skey); + if (value === void 0) { + delete data[key]; + } else { + data[key] = value; } - - // display-name = phrase - function displayName() { - return wrap('display-name', function phraseFixedSemantic() { - var result = phrase(); - if (result !== null) { - result.semantic = collapseWhitespace(result.semantic); - } - return result; - }()); + try { + window[skey].setItem("CUI", JSON.stringify(data)); + } catch (error) { + e = error; + console.warn("CUI.__setStorage: Storage not available.", e); + this.__storage[skey] = JSON.stringify(data); } + return data; + }; - // mailbox-list = (mailbox *("," mailbox)) / obs-mbox-list - function mailboxList() { - return wrap('mailbox-list', or( - and( - mailbox, - star(and(literal(','), mailbox)) - ), - obsMboxList - )()); + CUI.__getStorage = function(skey, key) { + var data, data_json, e; + if (key == null) { + key = null; } - - // address-list = (address *("," address)) / obs-addr-list - function addressList() { - return wrap('address-list', or( - and( - address, - star(and(literal(opts.addressListSeparator), address)) - ), - obsAddrList - )()); + try { + data_json = window[skey].getItem("CUI"); + } catch (error) { + e = error; + console.warn("CUI.__getStorage: Storage not available.", e); + data_json = this.__storage[skey]; } - - // group-list = mailbox-list / CFWS / obs-group-list - function groupList() { - return wrap('group-list', or( - mailboxList, - invis(cfws), - obsGroupList - )()); + if (data_json) { + data = JSON.parse(data_json); + } else { + data = {}; + } + if (key !== null) { + return data[key]; + } else { + return data; } + }; - // 3.4.1 Addr-Spec Specification - - // local-part = dot-atom / quoted-string / obs-local-part - function localPart() { - // note: quoted-string, dotAtom are proper subsets of obs-local-part - // so we really just have to look for obsLocalPart, if we don't care about the exact parse tree - return wrap('local-part', or(obsLocalPart, dotAtom, quotedString)()); + CUI.__clearStorage = function(skey) { + var e; + try { + return window[skey].removeItem("CUI"); + } catch (error) { + e = error; + console.warn("CUI.__clearStorage: Storage not available.", e); + return this.__storage[skey] = null; } + }; - // dtext = %d33-90 / ; Printable US-ASCII - // %d94-126 / ; characters not including - // obs-dtext ; "[", "]", or "\" - function dtext() { - return wrap('dtext', or( - function dtextFunc1() { - return compareToken(function dtextFunc2(tok) { - var code = tok.charCodeAt(0); - var accept = - (33 <= code && code <= 90) || - (94 <= code && code <= 126); - if (opts.rfc6532) { - accept = accept || isUTF8NonAscii(tok); - } - return accept; - }); - }, - obsDtext - )() - ); + CUI.encodeUrlData = function(params, replacer, connect, connect_pair) { + var _v, encode_func, j, k, len1, url, v; + if (replacer == null) { + replacer = null; } - - // domain-literal = [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS] - function domainLiteral() { - return wrap('domain-literal', and( - invis(opt(cfws)), - literal('['), - star(and(opt(fws), dtext)), - opt(fws), - literal(']'), - invis(opt(cfws)) - )()); + if (connect == null) { + connect = "&"; } - - // domain = dot-atom / domain-literal / obs-domain - function domain() { - return wrap('domain', function domainCheckTLD() { - var result = or(obsDomain, dotAtom, domainLiteral)(); - if (opts.rejectTLD) { - if (result && result.semantic && result.semantic.indexOf('.') < 0) { - return null; - } - } - // strip all whitespace from domains - if (result) { - result.semantic = result.semantic.replace(/\s+/g, ''); - } - return result; - }()); + if (connect_pair == null) { + connect_pair = "="; } - - // addr-spec = local-part "@" domain - function addrSpec() { - return wrap('addr-spec', and( - localPart, literal('@'), domain - )()); + url = []; + if (replacer) { + if (CUI.util.isFunction(replacer)) { + encode_func = replacer; + } else { + encode_func = function(v) { + return CUI.util.stringMapReplace(v + "", replace_map); + }; + } + } else { + encode_func = function(v) { + return encodeURIComponent(v); + }; } - - // 3.6.2 Originator Fields - // Below we only parse the field body, not the name of the field - // like "From:", "Sender:", or "Reply-To:". Other libraries that - // parse email headers can parse those and defer to these productions - // for the "RFC 5322" part. - - // RFC 6854 2.1. Replacement of RFC 5322, Section 3.6.2. Originator Fields - // from = "From:" (mailbox-list / address-list) CRLF - function fromSpec() { - return wrap('from', or( - mailboxList, - addressList - )()); + for (k in params) { + v = params[k]; + if (CUI.util.isArray(v)) { + for (j = 0, len1 = v.length; j < len1; j++) { + _v = v[j]; + url.push(encode_func(k) + connect_pair + encode_func(_v)); + } + } else if (!CUI.util.isEmpty(v)) { + url.push(encode_func(k) + connect_pair + encode_func(v)); + } else if (v !== void 0) { + url.push(encode_func(k)); + } } + return url.join(connect); + }; - // RFC 6854 2.1. Replacement of RFC 5322, Section 3.6.2. Originator Fields - // sender = "Sender:" (mailbox / address) CRLF - function senderSpec() { - return wrap('sender', or( - mailbox, - address - )()); + CUI.encodeURIComponentNicely = function(str) { + var idx, idx2, j, l, len1, len2, ref, ref1, s, v, v2; + if (str == null) { + str = ""; } - - // RFC 6854 2.1. Replacement of RFC 5322, Section 3.6.2. Originator Fields - // reply-to = "Reply-To:" address-list CRLF - function replyToSpec() { - return wrap('reply-to', addressList()); + s = []; + ref = (str + "").split(","); + for (idx = j = 0, len1 = ref.length; j < len1; idx = ++j) { + v = ref[idx]; + if (idx > 0) { + s.push(","); + } + ref1 = v.split(":"); + for (idx2 = l = 0, len2 = ref1.length; l < len2; idx2 = ++l) { + v2 = ref1[idx2]; + if (idx2 > 0) { + s.push(":"); + } + s.push(encodeURIComponent(v2)); + } } + return s.join(""); + }; - // 4.1. Miscellaneous Obsolete Tokens + CUI.decodeURIComponentNicely = function(v) { + return decodeURIComponent(v); + }; - // obs-NO-WS-CTL = %d1-8 / ; US-ASCII control - // %d11 / ; characters that do not - // %d12 / ; include the carriage - // %d14-31 / ; return, line feed, and - // %d127 ; white space characters - function obsNoWsCtl() { - return opts.strict ? null : wrap('obs-NO-WS-CTL', compareToken(function (tok) { - var code = tok.charCodeAt(0); - return ((1 <= code && code <= 8) || - (11 === code || 12 === code) || - (14 <= code && code <= 31) || - (127 === code)); - })); + CUI.decodeUrlData = function(url, replacer, connect, connect_pair, use_array) { + var decode_func, j, key, len1, pair, params, part, ref, value; + if (replacer == null) { + replacer = null; } - - // obs-ctext = obs-NO-WS-CTL - function obsCtext() { return opts.strict ? null : wrap('obs-ctext', obsNoWsCtl()); } - - // obs-qtext = obs-NO-WS-CTL - function obsQtext() { return opts.strict ? null : wrap('obs-qtext', obsNoWsCtl()); } - - // obs-qp = "\" (%d0 / obs-NO-WS-CTL / LF / CR) - function obsQP() { - return opts.strict ? null : wrap('obs-qp', and( - literal('\\'), - or(literal('\0'), obsNoWsCtl, lf, cr) - )()); + if (connect == null) { + connect = "&"; } - - // obs-phrase = word *(word / "." / CFWS) - function obsPhrase() { - return opts.strict - ? null - : wrap('obs-phrase', and( - word, - star(or( - word, - literal('.'), - opts.atInDisplayName ? literal('@') : noop, - opts.commaInDisplayName ? literal(',') : noop, - colwsp(cfws))) - )()); + if (connect_pair == null) { + connect_pair = "="; } - - // 4.2. Obsolete Folding White Space - - // NOTE: read the errata http://www.rfc-editor.org/errata_search.php?rfc=5322&eid=1908 - // obs-FWS = 1*([CRLF] WSP) - function obsFws() { - return opts.strict ? null : wrap('obs-FWS', star( - and(invis(opt(crlf)), wsp), - 1 - )()); + if (use_array == null) { + use_array = false; } - - // 4.4. Obsolete Addressing - - // obs-angle-addr = [CFWS] "<" obs-route addr-spec ">" [CFWS] - function obsAngleAddr() { - return opts.strict ? null : wrap('obs-angle-addr', and( - invis(opt(cfws)), - literal('<'), - obsRoute, - addrSpec, - literal('>'), - invis(opt(cfws)) - )()); + params = {}; + if (replacer) { + if (CUI.util.isFunction(replacer)) { + decode_func = replacer; + } else { + decode_func = function(v) { + return CUI.util.stringMapReplace(v + "", replacer); + }; + } + } else { + decode_func = function(v) { + return decodeURIComponent(v); + }; } - - // obs-route = obs-domain-list ":" - function obsRoute() { - return opts.strict ? null : wrap('obs-route', and( - obsDomainList, - literal(':') - )()); + ref = url.split(connect); + for (j = 0, len1 = ref.length; j < len1; j++) { + part = ref[j]; + if (part.length === 0) { + continue; + } + if (part.indexOf(connect_pair) > -1) { + pair = part.split(connect_pair); + key = decode_func(pair[0]); + value = decode_func(pair[1]); + } else { + key = decode_func(part); + value = ""; + } + if (use_array) { + if (!params[key]) { + params[key] = []; + } + params[key].push(value); + } else { + params[key] = value; + } } + return params; + }; - // obs-domain-list = *(CFWS / ",") "@" domain - // *("," [CFWS] ["@" domain]) - function obsDomainList() { - return opts.strict ? null : wrap('obs-domain-list', and( - star(or(invis(cfws), literal(','))), - literal('@'), - domain, - star(and( - literal(','), - invis(opt(cfws)), - opt(and(literal('@'), domain)) - )) - )()); + CUI.decodeUrlDataArray = function(url, replace_map, connect, connect_pair) { + if (replace_map == null) { + replace_map = null; } - - // obs-mbox-list = *([CFWS] ",") mailbox *("," [mailbox / CFWS]) - function obsMboxList() { - return opts.strict ? null : wrap('obs-mbox-list', and( - star(and( - invis(opt(cfws)), - literal(',') - )), - mailbox, - star(and( - literal(','), - opt(and( - mailbox, - invis(cfws) - )) - )) - )()); + if (connect == null) { + connect = "&"; } - - // obs-addr-list = *([CFWS] ",") address *("," [address / CFWS]) - function obsAddrList() { - return opts.strict ? null : wrap('obs-addr-list', and( - star(and( - invis(opt(cfws)), - literal(',') - )), - address, - star(and( - literal(','), - opt(and( - address, - invis(cfws) - )) - )) - )()); + if (connect_pair == null) { + connect_pair = "="; } + return this.decodeUrlData(url, replace_map, connect, connect_pair, true); + }; - // obs-group-list = 1*([CFWS] ",") [CFWS] - function obsGroupList() { - return opts.strict ? null : wrap('obs-group-list', and( - star(and( - invis(opt(cfws)), - literal(',') - ), 1), - invis(opt(cfws)) - )()); + CUI.mergeMap = function(targetMap, mergeMap) { + var k, v; + for (k in mergeMap) { + v = mergeMap[k]; + if (!targetMap.hasOwnProperty(k)) { + targetMap[k] = v; + } else if (CUI.util.isPlainObject(targetMap[k]) && CUI.util.isPlainObject(v)) { + CUI.util.mergeMap(targetMap[k], v); + } } + return targetMap; + }; - // obs-local-part = word *("." word) - function obsLocalPart() { - return opts.strict ? null : wrap('obs-local-part', and(word, star(and(literal('.'), word)))()); + CUI.revertMap = function(map) { + var k, map_reverted, v; + map_reverted = {}; + for (k in map) { + v = map[k]; + map_reverted[v] = k; } + return map_reverted; + }; - // obs-domain = atom *("." atom) - function obsDomain() { - return opts.strict ? null : wrap('obs-domain', and(atom, star(and(literal('.'), atom)))()); + CUI.stringMapReplace = function(s, map) { + var key, regex; + regex = []; + for (key in map) { + if (CUI.util.isEmpty(key)) { + continue; + } + regex.push(key.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&")); } - - // obs-dtext = obs-NO-WS-CTL / quoted-pair - function obsDtext() { - return opts.strict ? null : wrap('obs-dtext', or(obsNoWsCtl, quotedPair)()); + if (regex.length > 0) { + return s.replace(new RegExp(regex.join('|'), "g"), function(word) { + return map[word]; + }); + } else { + return s; } + }; - ///////////////////////////////////////////////////// - - // ast analysis + CUI.isFunction = function(v) { + return v && typeof v === "function"; + }; - function findNode(name, root) { - var i, stack, node; - if (root === null || root === undefined) { return null; } - stack = [root]; - while (stack.length > 0) { - node = stack.pop(); - if (node.name === name) { - return node; - } - for (i = node.children.length - 1; i >= 0; i -= 1) { - stack.push(node.children[i]); - } - } - return null; - } + CUI.isPlainObject = function(v) { + var ref; + return v && typeof v === "object" && ((ref = v.constructor) != null ? ref.prototype.hasOwnProperty("isPrototypeOf") : void 0); + }; - function findAllNodes(name, root) { - var i, stack, node, result; - if (root === null || root === undefined) { return null; } - stack = [root]; - result = []; - while (stack.length > 0) { - node = stack.pop(); - if (node.name === name) { - result.push(node); - } - for (i = node.children.length - 1; i >= 0; i -= 1) { - stack.push(node.children[i]); - } - } - return result; + CUI.isEmptyObject = function(v) { + var k; + for (k in v) { + return false; } + return true; + }; - function findAllNodesNoChildren(names, root) { - var i, stack, node, result, namesLookup; - if (root === null || root === undefined) { return null; } - stack = [root]; - result = []; - namesLookup = {}; - for (i = 0; i < names.length; i += 1) { - namesLookup[names[i]] = true; - } + CUI.isMap = function(v) { + return this.isPlainObject(v); + }; - while (stack.length > 0) { - node = stack.pop(); - if (node.name in namesLookup) { - result.push(node); - // don't look at children (hence findAllNodesNoChildren) - } else { - for (i = node.children.length - 1; i >= 0; i -= 1) { - stack.push(node.children[i]); - } - } - } - return result; - } + CUI.isArray = function(v) { + return Array.isArray(v); + }; - function giveResult(ast) { - var addresses, groupsAndMailboxes, i, groupOrMailbox, result; - if (ast === null) { - return null; - } - addresses = []; + CUI.inArray = function(value, array) { + return array.indexOf(value); + }; - // An address is a 'group' (i.e. a list of mailboxes) or a 'mailbox'. - groupsAndMailboxes = findAllNodesNoChildren(['group', 'mailbox'], ast); - for (i = 0; i < groupsAndMailboxes.length; i += 1) { - groupOrMailbox = groupsAndMailboxes[i]; - if (groupOrMailbox.name === 'group') { - addresses.push(giveResultGroup(groupOrMailbox)); - } else if (groupOrMailbox.name === 'mailbox') { - addresses.push(giveResultMailbox(groupOrMailbox)); - } - } + CUI.isString = function(s) { + return typeof s === "string"; + }; - result = { - ast: ast, - addresses: addresses, - }; - if (opts.simple) { - result = simplifyResult(result); - } - if (opts.oneResult) { - return oneResult(result); - } - if (opts.simple) { - return result && result.addresses; - } else { - return result; - } + CUI.downloadData = function(data, fileName) { + var blob, url; + blob = new Blob([data], { + type: "octet/stream" + }); + if (window.navigator.msSaveOrOpenBlob) { + return window.navigator.msSaveOrOpenBlob(blob, fileName); + } else { + url = window.URL.createObjectURL(blob); + this.__downloadDataElement.href = url; + this.__downloadDataElement.download = fileName; + this.__downloadDataElement.click(); + return window.URL.revokeObjectURL(url); } + }; - function giveResultGroup(group) { - var i; - var groupName = findNode('display-name', group); - var groupResultMailboxes = []; - var mailboxes = findAllNodesNoChildren(['mailbox'], group); - for (i = 0; i < mailboxes.length; i += 1) { - groupResultMailboxes.push(giveResultMailbox(mailboxes[i])); - } - return { - node: group, - parts: { - name: groupName, - }, - type: group.name, // 'group' - name: grabSemantic(groupName), - addresses: groupResultMailboxes, - }; - } - - function giveResultMailbox(mailbox) { - var name = findNode('display-name', mailbox); - var aspec = findNode('addr-spec', mailbox); - var cfws = findAllNodes('cfws', mailbox); - var comments = findAllNodesNoChildren(['comment'], mailbox); + CUI.urlRegex = new RegExp("^" + "(?:(?:(sftp|ftp|ftps|https|http))://|)" + "(?:(\\S+?)(?::(\\S*))?@)?" + "((?:(?:" + "(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])" + "(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}" + "(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))" + "|" + "(?:[a-z0-9\\u00a1-\\uffff](?:|[a-z\\u00a1-\\uffff0-9-]*[a-z0-9\\u00a1-\\uffff])\\.)*" + "(?:[a-z\\u00a1-\\uffff]{2,})" + "|" + "(?:[a-z0-9\\u00a1-\\uffff][a-z0-9-\\u00a1-\\uffff]*[a-z0-9\\u00a1-\\uffff])" + "))|)" + "(?::(\\d{2,5}))?" + "(?:([/?#]\\S*))?" + "$", "i"); + CUI.evalCode = function(code) { + var script; + script = document.createElement("script"); + script.text = code; + return document.head.appendChild(script).parentNode.removeChild(script); + }; - var local = findNode('local-part', aspec); - var domain = findNode('domain', aspec); - return { - node: mailbox, - parts: { - name: name, - address: aspec, - local: local, - domain: domain, - comments: cfws - }, - type: mailbox.name, // 'mailbox' - name: grabSemantic(name), - address: grabSemantic(aspec), - local: grabSemantic(local), - domain: grabSemantic(domain), - comments: concatComments(comments), - groupName: grabSemantic(mailbox.groupName), - }; + CUI.appendToUrl = function(url, data) { + var key, value; + for (key in data) { + value = data[key]; + if (value === void 0) { + continue; + } + if (url.match(/\?/)) { + url += "&"; + } else { + url += "?"; + } + url += encodeURIComponent(key) + "=" + encodeURIComponent(value); } + return url; + }; - function grabSemantic(n) { - return n !== null && n !== undefined ? n.semantic : null; + CUI.parseLocation = function(url) { + var _match, match, p, pUrl, ref; + if (!CUI.util.isFunction(url != null ? url.match : void 0) || url.length === 0) { + return null; } - - function simplifyResult(result) { - var i; - if (result && result.addresses) { - for (i = 0; i < result.addresses.length; i += 1) { - delete result.addresses[i].node; - } - } - return result; + try { + pUrl = new URL(url); + p = { + protocol: ((ref = pUrl.protocol) != null ? ref.replaceAll(':', '') : void 0) || "", + user: pUrl.username, + password: pUrl.password, + hostname: pUrl.hostname, + port: pUrl.port, + path: pUrl.pathname, + origin: "", + search: pUrl.search, + hash: pUrl.hash, + href: pUrl.href + }; + } catch (error) { + match = url.match(this.urlRegex); + if (!match) { + return null; + } + p = { + protocol: match[1] || "", + user: match[2] || "", + password: match[3] || "", + hostname: match[4] || "", + port: match[5] || "", + path: match[6] || "", + origin: "" + }; } - - function concatComments(comments) { - var result = ''; - if (comments) { - for (var i = 0; i < comments.length; i += 1) { - result += grabSemantic(comments[i]); - } - } - return result; + if (p.hostname) { + if (!p.protocol) { + p.protocol = "http"; + } + p.origin = p.protocol + "://" + p.hostname; + if (p.port) { + p.origin += ":" + p.port; + } + p.url = p.protocol + "://"; + if (p.user) { + p.url = p.url + p.user + ":" + p.password + "@"; + } + p.url = p.url + p.hostname; + if (p.port) { + p.url = p.url + ":" + p.port; + } + } else { + p.url = ""; } - - function oneResult(result) { - if (!result) { return null; } - if (!opts.partial && result.addresses.length > 1) { return null; } - return result.addresses && result.addresses[0]; + if (p.path.length > 0) { + _match = p.path.match(/(.*?)(|\?.*?)(|\#.*)$/); + p.pathname = _match[1]; + if (!p.search) { + p.search = _match[2]; + } + if (p.search === "?") { + p.search = ""; + } + p.fragment = _match[3]; + } else { + p.search = ""; + p.pathname = ""; + p.fragment = ""; } - - ///////////////////////////////////////////////////// - - var parseString, pos, len, parsed, startProduction; - - opts = handleOpts(opts, {}); - if (opts === null) { return null; } - - parseString = opts.input; - - startProduction = { - 'address': address, - 'address-list': addressList, - 'angle-addr': angleAddr, - 'from': fromSpec, - 'group': group, - 'mailbox': mailbox, - 'mailbox-list': mailboxList, - 'reply-to': replyToSpec, - 'sender': senderSpec, - }[opts.startAt] || addressList; - - if (!opts.strict) { - initialize(); - opts.strict = true; - parsed = startProduction(parseString); - if (opts.partial || !inStr()) { - return giveResult(parsed); - } - opts.strict = false; + if (!p.href) { + p.href = p.origin + p.path; } + if (!p.hash) { + p.hash = p.fragment; + } + if (p.login) { + p.auth = btoa(p.user + ":" + p.password); + } + p.url = p.url + p.path; + return p; + }; - initialize(); - parsed = startProduction(parseString); - if (!opts.partial && inStr()) { return null; } - return giveResult(parsed); -} - -function parseOneAddressSimple(opts) { - return parse5322(handleOpts(opts, { - oneResult: true, - rfc6532: true, - simple: true, - startAt: 'address-list', - })); -} - -function parseAddressListSimple(opts) { - return parse5322(handleOpts(opts, { - rfc6532: true, - simple: true, - startAt: 'address-list', - })); -} - -function parseFromSimple(opts) { - return parse5322(handleOpts(opts, { - rfc6532: true, - simple: true, - startAt: 'from', - })); -} + CUI.escapeAttribute = function(data) { + if (CUI.util.isNull(data) || !CUI.util.isString(data)) { + return ""; + } + data = data.replace(/"/g, """).replace(/\'/g, "'"); + return data; + }; -function parseSenderSimple(opts) { - return parse5322(handleOpts(opts, { - oneResult: true, - rfc6532: true, - simple: true, - startAt: 'sender', - })); -} + CUI.loadScript = function(src) { + var deferred, script; + deferred = new CUI.Deferred; + script = CUI.dom.element("script", { + charset: "utf-8", + src: src + }); + CUI.Events.listen({ + type: "load", + node: script, + instance: script, + call: (function(_this) { + return function(ev) { + deferred.resolve(ev); + }; + })(this) + }); + CUI.Events.listen({ + type: "error", + node: script, + instance: script, + call: (function(_this) { + return function(ev) { + document.head.removeChild(script); + deferred.reject(ev); + }; + })(this) + }); + deferred.always((function(_this) { + return function() { + return CUI.Events.ignore({ + instance: script + }); + }; + })(this)); + document.head.appendChild(script); + return deferred.promise(); + }; -function parseReplyToSimple(opts) { - return parse5322(handleOpts(opts, { - rfc6532: true, - simple: true, - startAt: 'reply-to', - })); -} + CUI.browser = (function() { + var map; + map = { + opera: (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0, + firefox: typeof InstallTrigger !== 'undefined', + safari: Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0, + ie: /*@cc_on!@*/ false || !!document.documentMode, + chrome: !!window.chrome && !!window.chrome.webstore + }; + map.edge = !map.ie && !!window.StyleMedia; + map.blink = (map.chrome || map.opera) && !!window.CSS; + return map; + })(); -function handleOpts(opts, defs) { - function isString(str) { - return Object.prototype.toString.call(str) === '[object String]'; + CUI.__toggleUIElements = function(showAll) { + var div, elementTopContainer, fn, highlightDiv, j, l, len1, len2, len3, n, ref, ref1, ref2, ref3, ref4, topContainer, topElement, uiElement, uiElementRect, uiElements, x, y; + if (showAll == null) { + showAll = false; } - - function isObject(o) { - return o === Object(o); + if (((ref = this.__uiHighlightDivs) != null ? ref.length : void 0) > 0) { + ref1 = this.__uiHighlightDivs; + for (j = 0, len1 = ref1.length; j < len1; j++) { + highlightDiv = ref1[j]; + CUI.dom.remove(highlightDiv); + } + delete this.__uiHighlightDivs; + return; } - - function isNullUndef(o) { - return o === null || o === undefined; + this.__uiHighlightDivs = []; + uiElements = document.querySelectorAll("[ui]"); + fn = (function(_this) { + return function(div, uiElement) { + var borderStyle, divRect, left, span, top, uiElementRect; + divRect = div.getBoundingClientRect(); + uiElementRect = uiElement.getBoundingClientRect(); + div.textContent = uiElement.getAttribute("ui"); + CUI.dom.setStyle(div, { + padding: "4px", + background: "yellow", + position: "absolute", + "white-space": "nowrap", + cursor: "pointer", + border: "solid 1.5px grey" + }); + div.title = "Click to copy!"; + span = CUI.dom.span(); + span.textContent = " [X]"; + CUI.dom.append(div, span); + CUI.dom.append(document.body, div); + borderStyle = CUI.dom.getStyle(uiElement).border; + div.addEventListener('mouseenter', function() { + var len3, n, otherHighlightDiv, ref2; + ref2 = _this.__uiHighlightDivs; + for (n = 0, len3 = ref2.length; n < len3; n++) { + otherHighlightDiv = ref2[n]; + CUI.dom.hideElement(otherHighlightDiv); + } + CUI.dom.showElement(div); + return CUI.dom.setStyle(uiElement, { + border: "2px solid yellow" + }); + }); + div.addEventListener('mouseleave', function() { + var len3, n, otherHighlightDiv, ref2; + ref2 = _this.__uiHighlightDivs; + for (n = 0, len3 = ref2.length; n < len3; n++) { + otherHighlightDiv = ref2[n]; + CUI.dom.showElement(otherHighlightDiv); + } + return CUI.dom.setStyle(uiElement, { + border: borderStyle + }); + }); + div.addEventListener('click', function() { + return navigator.clipboard.writeText(uiElement.getAttribute("ui")); + }); + span.addEventListener('click', function() { + var len3, n, otherHighlightDiv, ref2; + CUI.dom.remove(div); + CUI.util.removeFromArray(div, _this.__uiHighlightDivs); + CUI.dom.setStyle(uiElement, { + border: borderStyle + }); + ref2 = _this.__uiHighlightDivs; + for (n = 0, len3 = ref2.length; n < len3; n++) { + otherHighlightDiv = ref2[n]; + CUI.dom.showElement(otherHighlightDiv); + } + }); + top = uiElementRect.y + uiElementRect.height / 2 - divRect.height / 2; + if (top < 0) { + CUI.dom.remove(div); + return; + } + left = uiElementRect.x - divRect.width; + if (left <= 0) { + if (uiElementRect.width > divRect.width) { + left = uiElementRect.x; + } else { + left = uiElementRect.x + uiElementRect.width; + } + } + CUI.dom.setStyle(div, { + top: top, + left: left + }); + CUI.dom.setStyle(div, { + "zIndex": 5 + }, ""); + return CUI.dom.hideElement(div); + }; + })(this); + for (l = 0, len2 = uiElements.length; l < len2; l++) { + uiElement = uiElements[l]; + if (!showAll) { + uiElementRect = uiElement.getBoundingClientRect(); + x = uiElementRect.left; + y = uiElementRect.top; + topElement = document.elementFromPoint(x, y); + if (topElement) { + elementTopContainer = (ref2 = CUI.dom.parents(uiElement, "body > div")) != null ? ref2[0] : void 0; + topContainer = (ref3 = CUI.dom.parents(topElement, "body > div")) != null ? ref3[0] : void 0; + if (elementTopContainer !== topContainer) { + continue; + } + } + } + div = CUI.dom.div(); + this.__uiHighlightDivs.push(div); + fn(div, uiElement); } - - var defaults, o; - - if (isString(opts)) { - opts = { input: opts }; - } else if (!isObject(opts)) { - return null; + ref4 = this.__uiHighlightDivs; + for (n = 0, len3 = ref4.length; n < len3; n++) { + div = ref4[n]; + CUI.dom.showElement(div); } + }; - if (!isString(opts.input)) { return null; } - if (!defs) { return null; } + return CUI; - defaults = { - oneResult: false, - partial: false, - rejectTLD: false, - rfc6532: false, - simple: false, - startAt: 'address-list', - strict: false, - atInDisplayName: false, - commaInDisplayName: false, - addressListSeparator: ',', - }; +})(); - for (o in defaults) { - if (isNullUndef(opts[o])) { - opts[o] = !isNullUndef(defs[o]) ? defs[o] : defaults[o]; - } +CUI.ready((function(_this) { + return function() { + var k, nodes; + for (k in CUI.browser) { + if (CUI.browser[k]) { + document.body.classList.add("cui-browser-" + k); + } } - return opts; -} - -parse5322.parseOneAddress = parseOneAddressSimple; -parse5322.parseAddressList = parseAddressListSimple; -parse5322.parseFrom = parseFromSimple; -parse5322.parseSender = parseSenderSimple; -parse5322.parseReplyTo = parseReplyToSimple; + CUI.defaults.marked_opts = { + renderer: new marked.Renderer(), + gfm: true, + tables: true, + breaks: false, + pedantic: false, + smartLists: true, + smartypants: false + }; + marked.setOptions(CUI.defaults.marked_opts); + nodes = CUI.dom.htmlToNodes(""); + CUI.__downloadDataElement = nodes[1]; + return CUI.dom.append(document.body, nodes); + }; +})(this)); -if ( true && typeof module.exports !== 'undefined') { - module.exports = parse5322; +if (!window.addEventListener) { + alert("Your browser is not supported. Please update to a current version of Google Chrome, Mozilla Firefox or Internet Explorer."); } else { - global.emailAddresses = parse5322; + window.addEventListener("load", (function(_this) { + return function() { + return CUI.start(); + }; + })(this)); } -}(this)); +module.exports = CUI; /***/ }), -/***/ "../node_modules/formatcoords/index.js": -/*!*********************************************!*\ - !*** ../node_modules/formatcoords/index.js ***! - \*********************************************/ -/***/ ((module) => { +/***/ "./base/DOMElement/DOMElement.coffee": +/*!*******************************************!*\ + !*** ./base/DOMElement/DOMElement.coffee ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -function Coords() {} +/* provided dependency */ var CUI = __webpack_require__(/*! ./base/CUI.coffee */ "./base/CUI.coffee"); +var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; -Coords.prototype.init = function() { - if (!arguments.length) { - throw new Error('no arguments'); - } - else if (arguments[0].lat && arguments[0].lng) { - this.lat = arguments[0].lat; - this.lon = arguments[0].lng; - } - else if (typeof arguments[0] === "string") { - var strarr = arguments[0].split(","); - this.lat = parseFloat(strarr[0].trim()); - this.lon = parseFloat(strarr[1].trim()); - } - else if (Object.prototype.toString.call(arguments[0]) === "[object Array]" ) { - var arr = arguments[0]; - if (arguments[1] === true) { - this.lat = arr[1]; - this.lon = arr[0]; - } else { - this.lat = arr[0]; - this.lon = arr[1]; - } - } - else if (arguments[2] === true) { - this.lat = arguments[1]; - this.lon = arguments[0]; - } - else { - this.lat = arguments[0]; - this.lon = arguments[1]; - } - - this.compute(); -}; - -Coords.prototype.compute = function() { - this.north = this.lat > 0; - this.east = this.lon > 0; - this.latValues = computeFor(this.lat); - this.lonValues = computeFor(this.lon); - - function computeFor(initValue) { - var values = {}; - values.initValue = initValue; - values.degrees = Math.abs(initValue); - values.degreesInt = Math.floor(values.degrees); - values.degreesFrac = values.degrees - values.degreesInt; - values.secondsTotal = 3600 * values.degreesFrac; - values.minutes = values.secondsTotal / 60; - values.minutesInt = Math.floor(values.minutes); - values.seconds = values.secondsTotal - (values.minutesInt * 60); - return values; - } -}; - -var shortFormats = { - 'FFf' : 'DD MM ss X', - 'Ff' : 'DD mm X', - 'f': 'dd X' -}; - -var units = { - degrees: '°', - minutes: '′', - seconds: '″', -}; +CUI.DOMElement = (function(superClass) { + extend(DOMElement, superClass); -Coords.prototype.format = function(format, options) { - if (typeof format === 'object') { - var submittedFormat = format - options = format; - format = 'FFf'; - } - if (typeof format === 'undefined'){ - format = 'FFf'; - } - if (typeof options === 'undefined') { - options = {}; - } - if (typeof options === 'string'){ - var submittedString = options; - options = { - latLonSeparator: submittedString - } - } - if (typeof options.latLonSeparator === 'undefined') { - options.latLonSeparator = ' '; - } - if(typeof options.decimalPlaces === 'undefined') { - options.decimalPlaces = 5; - } - else { - options.decimalPlaces = parseInt(options.decimalPlaces); - } - + function DOMElement() { + return DOMElement.__super__.constructor.apply(this, arguments); + } - if ( Object.keys(shortFormats).indexOf(format) > -1 ) { - format = shortFormats[format]; - } + DOMElement.prototype.initOpts = function() { + DOMElement.__super__.initOpts.call(this); + return this.addOpts({ + "class": { + "default": "", + check: String + }, + id: { + check: String + }, + ui: { + check: String + }, + attr: { + check: "PlainObject" + } + }); + }; - var lat = formatFor(this.latValues, (this.north) ? 'N' : 'S' ); - var lon = formatFor(this.lonValues, (this.east) ? 'E' : 'W' ); + DOMElement.prototype.registerTemplate = function(template, add_default_classes) { + if (add_default_classes == null) { + add_default_classes = true; + } + CUI.util.assert(template instanceof CUI.Template, (CUI.util.getObjectClass(this)) + ".registerDOMElement", "template must be instance of Template but is " + (CUI.util.getObjectClass(template)) + ".", { + template: template + }); + if (this.__template) { + console.warn((CUI.util.getObjectClass(this)) + ".registerDO MElement", "Already called before, destroying existing template", { + template: this.__template + }); + this.__template.destroy(); + } + this.__template = template; + return this.registerDOMElement(this.__template.DOM, add_default_classes); + }; - function formatFor(values, X) { - var formatted = format; - formatted = formatted.replace(/DD/g, values.degreesInt+units.degrees); - formatted = formatted.replace(/dd/g, values.degrees.toFixed(options.decimalPlaces)+units.degrees); - formatted = formatted.replace(/D/g, values.degreesInt); - formatted = formatted.replace(/d/g, values.degrees.toFixed(options.decimalPlaces)); - formatted = formatted.replace(/MM/g, values.minutesInt+units.minutes); - formatted = formatted.replace(/mm/g, values.minutes.toFixed(options.decimalPlaces)+units.minutes); - formatted = formatted.replace(/M/g, values.minutesInt); - formatted = formatted.replace(/m/g, values.minutes.toFixed(options.decimalPlaces)); - formatted = formatted.replace(/ss/g, values.seconds.toFixed(options.decimalPlaces)+units.seconds); - formatted = formatted.replace(/s/g, values.seconds.toFixed(options.decimalPlaces)); - - formatted = formatted.replace(/-/g, (values.initValue<0) ? '-' : ''); - - formatted = formatted.replace(/X/g, X); + DOMElement.prototype.getDOMElementClasses = function() { + return 'cui-' + CUI.util.toDash(this.__cls); + }; - return formatted; - } + DOMElement.prototype.registerDOMElement = function(DOM, add_default_classes) { + this.DOM = DOM; + if (add_default_classes == null) { + add_default_classes = true; + } + if (add_default_classes) { + CUI.dom.addClass(this.DOM, this.getDOMElementClasses()); + } + if (this._attr) { + CUI.dom.setAttributeMap(this.DOM, this._attr); + } + if (this._id) { + CUI.dom.setAttribute(this.DOM, 'id', this._id); + } + if (this._class) { + CUI.dom.addClass(this.DOM, this._class); + } + if (this._ui) { + CUI.dom.setAttribute(this.DOM, 'ui', this._ui); + } + CUI.dom.data(this.DOM, "element", this); + return this; + }; - return lat + options.latLonSeparator + lon; -}; + DOMElement.prototype.getElementForLayer = function() { + return this.DOM; + }; -function formatcoords() { - var c = new Coords(); - c.init.apply(c, arguments); - return c; -} + DOMElement.prototype.unregisterDOMElement = function() { + CUI.dom.removeClass(this.DOM, this.getDOMElementClasses()); + CUI.dom.removeAttribute(this.DOM, "id"); + if (this._class) { + CUI.dom.removeClass(this.DOM, this._class); + } + CUI.dom.removeData(this.DOM, "element"); + delete this.DOM; + return this; + }; -module.exports = formatcoords; + DOMElement.prototype.__assertDOMElement = function(func) { + return CUI.util.assert(this.DOM, this.__cls + "." + func, "registerDOMElement needs to be called before \"" + func + "\" is supported."); + }; -/***/ }), + DOMElement.prototype.__assertTemplateElement = function(func) { + return CUI.util.assert(this.__template, this.__cls + "." + func, "registerTemplateElement needs to be called before \"" + func + "\" is supported."); + }; -/***/ "../node_modules/leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility.js": -/*!***************************************************************************************************!*\ - !*** ../node_modules/leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility.js ***! - \***************************************************************************************************/ -/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + DOMElement.prototype.addClass = function(className, key) { + CUI.util.assert(arguments.length === 1 || arguments.length === 2, "addClass", "Only 'className' and 'key' parameters are allowed."); + if (key) { + this.__assertTemplateElement("addClass"); + return this.__template.addClass.call(this.__template, className, key, this); + } else { + this.__assertDOMElement("addClass"); + return CUI.dom.addClass(this.DOM, className); + } + }; -(function (global, factory) { - true ? factory(__webpack_require__(/*! leaflet */ "../node_modules/leaflet/dist/leaflet-src.js")) : - 0; -}(this, (function (L) { 'use strict'; + DOMElement.prototype.setAria = function(attr, value) { + this.__assertDOMElement("setAria"); + return CUI.dom.setAria(this.DOM, attr, value); + }; - L.Icon.Default.mergeOptions({ - // Erase default options, so that they can be overridden by _initializeOptions if not supplied. - iconUrl: null, - iconRetinaUrl: null, - shadowUrl: null, - iconSize: null, - iconAnchor: null, - popupAnchor: null, - tooltipAnchor: null, - shadowSize: null, + DOMElement.prototype.removeClass = function(className, key) { + CUI.util.assert(arguments.length === 1 || arguments.length === 2, "removeClass", "Only 'className' and 'key' parameters are allowed."); + if (key) { + this.__assertTemplateElement("removeClass"); + return this.__template.removeClass.call(this.__template, className, key, this); + } else { + this.__assertDOMElement("removeClass"); + return CUI.dom.removeClass(this.DOM, className); + } + }; - // @option classNamePrefix: String = 'leaflet-default-icon-' - // Prefix for the classes defined in CSS that contain the Icon options. - // See the leaflet-defaulticon-compatibility.css file as a starter. - // Expected suffixes are "icon", "shadow", "popup" and "tooltip". - classNamePrefix: 'leaflet-default-icon-', - }); + DOMElement.prototype.hide = function(key) { + if (CUI.util.isEmpty(key)) { + this.__assertDOMElement("hide"); + return CUI.dom.hideElement(this.DOM); + } else { + this.__assertTemplateElement("hide"); + return this.__template.hide.call(this.__template, key); + } + }; + DOMElement.prototype.show = function(key) { + if (CUI.util.isEmpty(key)) { + this.__assertDOMElement("show"); + return CUI.dom.showElement(this.DOM); + } else { + this.__assertTemplateElement("show"); + return this.__template.show.call(this.__template, key); + } + }; - L.Icon.Default.include({ + DOMElement.prototype.showWaitBlock = function() { + this.__assertDOMElement("showWaitBlock"); + this.__wb = new CUI.WaitBlock({ + element: this.DOM + }).show(); + return this; + }; - _needsInit: true, + DOMElement.prototype.hideWaitBlock = function() { + this.__wb.destroy(); + delete this.__wb; + return this; + }; - // Override to make sure options are retrieved from CSS. - _getIconUrl: function (name) { - // @option imagePath: String - // `Icon.Default` will try to auto-detect the location of - // the blue icon images. If you are placing these images in a - // non-standard way, set this option to point to the right - // path, before any marker is added to a map. - // Caution: do not use this option with inline base64 image(s). - var imagePath = this.options.imagePath || L.Icon.Default.imagePath || ''; - // Deprecated (IconDefault.imagePath), backwards-compatibility only + DOMElement.prototype.hasClass = function(cls) { + CUI.util.assert(arguments.length === 1, "CUI.dom.hasClass", "Only one parameter allowed."); + this.__assertDOMElement("hasClass"); + return CUI.dom.hasClass(this.DOM, cls); + }; - if (this._needsInit) { - // Modifying imagePath option after _getIconUrl has been called - // once in this instance of IconDefault will no longer have any - // effect. - this._initializeOptions(imagePath); - } + DOMElement.prototype.isDestroyed = function(key) { + var ref; + return (ref = this.__template) != null ? ref.isDestroyed.call(this.__template, key) : void 0; + }; - return imagePath + L.Icon.prototype._getIconUrl.call(this, name); - }, + DOMElement.prototype.empty = function(key) { + this.__assertTemplateElement("empty"); + return this.__template.empty.call(this.__template, key); + }; - // Initialize all necessary options for this instance. - _initializeOptions: function (imagePath) { - this._setOptions('icon', _detectIconOptions, imagePath); - this._setOptions('shadow', _detectIconOptions, imagePath); - this._setOptions('popup', _detectDivOverlayOptions); - this._setOptions('tooltip', _detectDivOverlayOptions); - this._needsInit = false; - }, + DOMElement.prototype.replace = function(value, key) { + this.__assertTemplateElement("replace"); + return this.__template.replace.call(this.__template, value, key, this); + }; - // Retrieve values from CSS and assign to this instance options. - _setOptions: function (name, detectorFn, imagePath) { - var options = this.options, - prefix = options.classNamePrefix, - optionValues = detectorFn(prefix + name, imagePath); + DOMElement.prototype.append = function(value, key) { + this.__assertTemplateElement("append"); + return this.__template.append.call(this.__template, value, key, this); + }; - for (var optionName in optionValues) { - options[name + optionName] = options[name + optionName] || optionValues[optionName]; - } - } + DOMElement.prototype.prepend = function(value, key) { + this.__assertTemplateElement("prepend"); + return this.__template.prepend.call(this.__template, value, key, this); + }; - }); + DOMElement.prototype.text = function(value, key) { + this.__assertTemplateElement("text"); + return this.__template.text.call(this.__template, value, key, this); + }; + DOMElement.prototype.get = function(key) { + this.__assertTemplateElement("get"); + return this.__template.get.call(this.__template, key, this); + }; - // Retrieve icon option values from CSS (icon or shadow). - function _detectIconOptions(className, imagePath) { - var el = L.DomUtil.create('div', className, document.body), - urlsContainer = _getBkgImageOrCursor(el), - urls = _extractUrls(urlsContainer, imagePath), - iconX = _getStyleInt(el, 'width'), - iconY = _getStyleInt(el, 'height'), - anchorNX = _getStyleInt(el, 'margin-left'), - anchorNY = _getStyleInt(el, 'margin-top'); + DOMElement.prototype.getFlexHandle = function(key, do_assert) { + this.__assertTemplateElement("getFlexHandle"); + return this.__template.getFlexHandle.call(this.__template, key, do_assert); + }; - el.parentNode.removeChild(el); + DOMElement.prototype.destroy = function() { + var ref; + DOMElement.__super__.destroy.call(this); + if (this.__template) { + if ((ref = this.__template) != null) { + ref.destroy(); + } + } else if (this.DOM) { + CUI.dom.remove(this.DOM); + } + return this; + }; - return { - Url: urls[0], - RetinaUrl: urls[1], - Size: [iconX, iconY], - Anchor: [-anchorNX, -anchorNY] - }; - } + return DOMElement; - // Retrieve anchor option values from CSS (popup or tooltip). - function _detectDivOverlayOptions(className) { - var el = L.DomUtil.create('div', className, document.body), - anchorX = _getStyleInt(el, 'margin-left'), - anchorY = _getStyleInt(el, 'margin-top'); +})(CUI.Element); - el.parentNode.removeChild(el); - return { - Anchor: [anchorX, anchorY] - }; - } +/***/ }), - // Read the CSS url (could be path or inline base64), may be multiple. - // First: normal icon - // Second: Retina icon - function _extractUrls(urlsContainer, imagePath) { - var re = /url\(['"]?([^"']*?)['"]?\)/gi, // Match anything between url( and ), possibly with single or double quotes. - urls = [], - m = re.exec(urlsContainer); +/***/ "./base/DataField/CheckValueError.coffee": +/*!***********************************************!*\ + !*** ./base/DataField/CheckValueError.coffee ***! + \***********************************************/ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - while (m) { - // Keep the entire URL from CSS rule, so that each image can have its own full URL. - // Except in the case imagePath is provided: remove the path part (i.e. keep only the file name). - urls.push(imagePath ? _stripPath(m[1]) : m[1]); - m = re.exec(urlsContainer); - } +/* provided dependency */ var CUI = __webpack_require__(/*! ./base/CUI.coffee */ "./base/CUI.coffee"); - return urls; - } +/* + * coffeescript-ui - Coffeescript User Interface System (CUI) + * Copyright (c) 2013 - 2016 Programmfabrik GmbH + * MIT Licence + * https://github.com/programmfabrik/coffeescript-ui, http://www.coffeescript-ui.org + */ +var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; - // Remove anything before the last slash (/) occurrence (inclusive). - // Caution: will give unexpected result if url is inline base64 data - // => do not specify imagePath in that case! - function _stripPath(url) { - return url.substr(url.lastIndexOf('/') + 1); - } +CUI.CheckValueError = (function(superClass) { + extend(CheckValueError, superClass); - function _getStyleInt(el, style) { - return parseInt(_getStyle(el, style), 10); - } + function CheckValueError() { + return CheckValueError.__super__.constructor.apply(this, arguments); + } - // Factorize style reading fallback for IE8. - function _getStyle(el, style) { - return L.DomUtil.getStyle(el, style) || L.DomUtil.getStyle(el, _kebabToCamelCase(style)); - } + return CheckValueError; - // When Firefox high contrast (colours override) option is enabled, - // "background-image" is overridden by the browser as "none". - // In that case, fallback to "cursor". But keep "background-image" - // as primary source because IE expects cursor URL as relative to HTML page - // instead of relative to CSS file. - function _getBkgImageOrCursor(el) { - var bkgImage = _getStyle(el, 'background-image'); +})(window.Error); - return bkgImage && bkgImage !== 'none' ? bkgImage : _getStyle(el, 'cursor'); - } - // Convert kebab-case CSS property name to camelCase for IE currentStyle. - function _kebabToCamelCase(prop) { - return prop.replace(/-(\w)/g, function (str, w) { - return w.toUpperCase(); - }); - } +/***/ }), -}))); +/***/ "./base/DataField/DataField.coffee": +/*!*****************************************!*\ + !*** ./base/DataField/DataField.coffee ***! + \*****************************************/ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { +/* provided dependency */ var CUI = __webpack_require__(/*! ./base/CUI.coffee */ "./base/CUI.coffee"); -/***/ }), +/* + * coffeescript-ui - Coffeescript User Interface System (CUI) + * Copyright (c) 2013 - 2016 Programmfabrik GmbH + * MIT Licence + * https://github.com/programmfabrik/coffeescript-ui, http://www.coffeescript-ui.org + */ +var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty, + slice = [].slice; -/***/ "../node_modules/leaflet/dist/leaflet-src.js": -/*!***************************************************!*\ - !*** ../node_modules/leaflet/dist/leaflet-src.js ***! - \***************************************************/ -/***/ (function(__unused_webpack_module, exports) { +CUI.Template.loadTemplateText(__webpack_require__(/*! ./DataField.html */ "./base/DataField/DataField.html")); -/* @preserve - * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com - * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade - */ +CUI.DataField = (function(superClass) { + extend(DataField, superClass); -(function (global, factory) { - true ? factory(exports) : - 0; -})(this, (function (exports) { 'use strict'; + DataField.changed_marker_css_class = "cui-data-field-changed-marker"; - var version = "1.9.4"; + DataField.defaults = { + undo_and_changed_support: false + }; - /* - * @namespace Util - * - * Various utility functions, used by Leaflet internally. - */ - - // @function extend(dest: Object, src?: Object): Object - // Merges the properties of the `src` object (or multiple objects) into `dest` object and returns the latter. Has an `L.extend` shortcut. - function extend(dest) { - var i, j, len, src; - - for (j = 1, len = arguments.length; j < len; j++) { - src = arguments[j]; - for (i in src) { - dest[i] = src[i]; - } - } - return dest; - } - - // @function create(proto: Object, properties?: Object): Object - // Compatibility polyfill for [Object.create](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/create) - var create$2 = Object.create || (function () { - function F() {} - return function (proto) { - F.prototype = proto; - return new F(); - }; - })(); - - // @function bind(fn: Function, …): Function - // Returns a new function bound to the arguments passed, like [Function.prototype.bind](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind). - // Has a `L.bind()` shortcut. - function bind(fn, obj) { - var slice = Array.prototype.slice; - - if (fn.bind) { - return fn.bind.apply(fn, slice.call(arguments, 1)); - } - - var args = slice.call(arguments, 2); - - return function () { - return fn.apply(obj, args.length ? args.concat(slice.call(arguments)) : arguments); - }; - } - - // @property lastId: Number - // Last unique ID used by [`stamp()`](#util-stamp) - var lastId = 0; - - // @function stamp(obj: Object): Number - // Returns the unique ID of an object, assigning it one if it doesn't have it. - function stamp(obj) { - if (!('_leaflet_id' in obj)) { - obj['_leaflet_id'] = ++lastId; - } - return obj._leaflet_id; - } - - // @function throttle(fn: Function, time: Number, context: Object): Function - // Returns a function which executes function `fn` with the given scope `context` - // (so that the `this` keyword refers to `context` inside `fn`'s code). The function - // `fn` will be called no more than one time per given amount of `time`. The arguments - // received by the bound function will be any arguments passed when binding the - // function, followed by any arguments passed when invoking the bound function. - // Has an `L.throttle` shortcut. - function throttle(fn, time, context) { - var lock, args, wrapperFn, later; - - later = function () { - // reset lock and call if queued - lock = false; - if (args) { - wrapperFn.apply(context, args); - args = false; - } - }; - - wrapperFn = function () { - if (lock) { - // called too soon, queue to call later - args = arguments; - - } else { - // call and lock until later - fn.apply(context, arguments); - setTimeout(later, time); - lock = true; - } - }; - - return wrapperFn; - } - - // @function wrapNum(num: Number, range: Number[], includeMax?: Boolean): Number - // Returns the number `num` modulo `range` in such a way so it lies within - // `range[0]` and `range[1]`. The returned value will be always smaller than - // `range[1]` unless `includeMax` is set to `true`. - function wrapNum(x, range, includeMax) { - var max = range[1], - min = range[0], - d = max - min; - return x === max && includeMax ? x : ((x - min) % d + d) % d + min; - } - - // @function falseFn(): Function - // Returns a function which always returns `false`. - function falseFn() { return false; } - - // @function formatNum(num: Number, precision?: Number|false): Number - // Returns the number `num` rounded with specified `precision`. - // The default `precision` value is 6 decimal places. - // `false` can be passed to skip any processing (can be useful to avoid round-off errors). - function formatNum(num, precision) { - if (precision === false) { return num; } - var pow = Math.pow(10, precision === undefined ? 6 : precision); - return Math.round(num * pow) / pow; - } - - // @function trim(str: String): String - // Compatibility polyfill for [String.prototype.trim](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim) - function trim(str) { - return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); - } - - // @function splitWords(str: String): String[] - // Trims and splits the string on whitespace and returns the array of parts. - function splitWords(str) { - return trim(str).split(/\s+/); - } - - // @function setOptions(obj: Object, options: Object): Object - // Merges the given properties to the `options` of the `obj` object, returning the resulting options. See `Class options`. Has an `L.setOptions` shortcut. - function setOptions(obj, options) { - if (!Object.prototype.hasOwnProperty.call(obj, 'options')) { - obj.options = obj.options ? create$2(obj.options) : {}; - } - for (var i in options) { - obj.options[i] = options[i]; - } - return obj.options; - } - - // @function getParamString(obj: Object, existingUrl?: String, uppercase?: Boolean): String - // Converts an object into a parameter URL string, e.g. `{a: "foo", b: "bar"}` - // translates to `'?a=foo&b=bar'`. If `existingUrl` is set, the parameters will - // be appended at the end. If `uppercase` is `true`, the parameter names will - // be uppercased (e.g. `'?A=foo&B=bar'`) - function getParamString(obj, existingUrl, uppercase) { - var params = []; - for (var i in obj) { - params.push(encodeURIComponent(uppercase ? i.toUpperCase() : i) + '=' + encodeURIComponent(obj[i])); - } - return ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&'); - } - - var templateRe = /\{ *([\w_ -]+) *\}/g; - - // @function template(str: String, data: Object): String - // Simple templating facility, accepts a template string of the form `'Hello {a}, {b}'` - // and a data object like `{a: 'foo', b: 'bar'}`, returns evaluated string - // `('Hello foo, bar')`. You can also specify functions instead of strings for - // data values — they will be evaluated passing `data` as an argument. - function template(str, data) { - return str.replace(templateRe, function (str, key) { - var value = data[key]; - - if (value === undefined) { - throw new Error('No value provided for variable ' + str); - - } else if (typeof value === 'function') { - value = value(data); - } - return value; - }); - } - - // @function isArray(obj): Boolean - // Compatibility polyfill for [Array.isArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray) - var isArray = Array.isArray || function (obj) { - return (Object.prototype.toString.call(obj) === '[object Array]'); - }; - - // @function indexOf(array: Array, el: Object): Number - // Compatibility polyfill for [Array.prototype.indexOf](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) - function indexOf(array, el) { - for (var i = 0; i < array.length; i++) { - if (array[i] === el) { return i; } - } - return -1; - } - - // @property emptyImageUrl: String - // Data URI string containing a base64-encoded empty GIF image. - // Used as a hack to free memory from unused images on WebKit-powered - // mobile devices (by setting image `src` to this string). - var emptyImageUrl = 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs='; - - // inspired by https://paulirish.com/2011/requestanimationframe-for-smart-animating/ - - function getPrefixed(name) { - return window['webkit' + name] || window['moz' + name] || window['ms' + name]; - } - - var lastTime = 0; - - // fallback for IE 7-8 - function timeoutDefer(fn) { - var time = +new Date(), - timeToCall = Math.max(0, 16 - (time - lastTime)); - - lastTime = time + timeToCall; - return window.setTimeout(fn, timeToCall); - } - - var requestFn = window.requestAnimationFrame || getPrefixed('RequestAnimationFrame') || timeoutDefer; - var cancelFn = window.cancelAnimationFrame || getPrefixed('CancelAnimationFrame') || - getPrefixed('CancelRequestAnimationFrame') || function (id) { window.clearTimeout(id); }; - - // @function requestAnimFrame(fn: Function, context?: Object, immediate?: Boolean): Number - // Schedules `fn` to be executed when the browser repaints. `fn` is bound to - // `context` if given. When `immediate` is set, `fn` is called immediately if - // the browser doesn't have native support for - // [`window.requestAnimationFrame`](https://developer.mozilla.org/docs/Web/API/window/requestAnimationFrame), - // otherwise it's delayed. Returns a request ID that can be used to cancel the request. - function requestAnimFrame(fn, context, immediate) { - if (immediate && requestFn === timeoutDefer) { - fn.call(context); - } else { - return requestFn.call(window, bind(fn, context)); - } - } - - // @function cancelAnimFrame(id: Number): undefined - // Cancels a previous `requestAnimFrame`. See also [window.cancelAnimationFrame](https://developer.mozilla.org/docs/Web/API/window/cancelAnimationFrame). - function cancelAnimFrame(id) { - if (id) { - cancelFn.call(window, id); - } + function DataField(opts) { + var tt_opts; + DataField.__super__.constructor.call(this, opts); + CUI.util.assertImplements(this, ["render"]); + if (this._name) { + CUI.util.assertImplements(this, ["getDefaultValue"]); + } + this.__checkChangedValue = void 0; + this.initTemplate(); + this.addClass("cui-data-field"); + this.maximizeAddClasses(); + CUI.Events.listen({ + type: "data-changed", + node: this.DOM, + call: (function(_this) { + return function(ev, info) { + _this.onDataChanged(ev, info); + }; + })(this) + }); + if (this.getName()) { + this.DOM.setAttribute("cui-data-field-name", this.getName()); + } + this.init(); + if (this._data && !CUI.util.isFunction(this._data)) { + this.setData(this._data); + } + this.__initDisabled(); + if (this._hidden) { + this.hide(); + } + if (this._tooltip && (this._tooltip.text || this._tooltip.content)) { + tt_opts = CUI.util.copyObject(this._tooltip); + tt_opts.element = this.DOM; + this.__tooltip = new CUI.Tooltip(tt_opts); + } + this.__opacity = 1; + if (typeof this._onInit === "function") { + this._onInit(this); + } } - var Util = { - __proto__: null, - extend: extend, - create: create$2, - bind: bind, - get lastId () { return lastId; }, - stamp: stamp, - throttle: throttle, - wrapNum: wrapNum, - falseFn: falseFn, - formatNum: formatNum, - trim: trim, - splitWords: splitWords, - setOptions: setOptions, - getParamString: getParamString, - template: template, - isArray: isArray, - indexOf: indexOf, - emptyImageUrl: emptyImageUrl, - requestFn: requestFn, - cancelFn: cancelFn, - requestAnimFrame: requestAnimFrame, - cancelAnimFrame: cancelAnimFrame + DataField.prototype.onDataChanged = function(ev, info) { + if (!(info != null ? info.element : void 0)) { + console.warn((CUI.util.getObjectClass(this)) + "[DataField].listen[data-changed]: received event with element not set.", ev, info, this); + return; + } + return typeof this._onDataChanged === "function" ? this._onDataChanged(this.getData(), info.element, ev, info) : void 0; }; - // @class Class - // @aka L.Class - - // @section - // @uninheritable - - // Thanks to John Resig and Dean Edwards for inspiration! - - function Class() {} - - Class.extend = function (props) { - - // @function extend(props: Object): Function - // [Extends the current class](#class-inheritance) given the properties to be included. - // Returns a Javascript function that is a class constructor (to be called with `new`). - var NewClass = function () { - - setOptions(this); - - // call the constructor - if (this.initialize) { - this.initialize.apply(this, arguments); - } - - // call all constructor hooks - this.callInitHooks(); - }; - - var parentProto = NewClass.__super__ = this.prototype; - - var proto = create$2(parentProto); - proto.constructor = NewClass; - - NewClass.prototype = proto; - - // inherit parent's statics - for (var i in this) { - if (Object.prototype.hasOwnProperty.call(this, i) && i !== 'prototype' && i !== '__super__') { - NewClass[i] = this[i]; - } - } - - // mix static properties into the class - if (props.statics) { - extend(NewClass, props.statics); - } - - // mix includes into the prototype - if (props.includes) { - checkDeprecatedMixinEvents(props.includes); - extend.apply(null, [proto].concat(props.includes)); - } - - // mix given properties into the prototype - extend(proto, props); - delete proto.statics; - delete proto.includes; - - // merge options - if (proto.options) { - proto.options = parentProto.options ? create$2(parentProto.options) : {}; - extend(proto.options, props.options); - } - - proto._initHooks = []; - - // add method for calling all hooks - proto.callInitHooks = function () { - - if (this._initHooksCalled) { return; } - - if (parentProto.callInitHooks) { - parentProto.callInitHooks.call(this); - } - - this._initHooksCalled = true; - - for (var i = 0, len = proto._initHooks.length; i < len; i++) { - proto._initHooks[i].call(this); - } - }; - - return NewClass; - }; - - - // @function include(properties: Object): this - // [Includes a mixin](#class-includes) into the current class. - Class.include = function (props) { - var parentOptions = this.prototype.options; - extend(this.prototype, props); - if (props.options) { - this.prototype.options = parentOptions; - this.mergeOptions(props.options); - } - return this; - }; - - // @function mergeOptions(options: Object): this - // [Merges `options`](#class-options) into the defaults of the class. - Class.mergeOptions = function (options) { - extend(this.prototype.options, options); - return this; - }; - - // @function addInitHook(fn: Function): this - // Adds a [constructor hook](#class-constructor-hooks) to the class. - Class.addInitHook = function (fn) { // (Function) || (String, args...) - var args = Array.prototype.slice.call(arguments, 1); - - var init = typeof fn === 'function' ? fn : function () { - this[fn].apply(this, args); - }; - - this.prototype._initHooks = this.prototype._initHooks || []; - this.prototype._initHooks.push(init); - return this; - }; - - function checkDeprecatedMixinEvents(includes) { - /* global L: true */ - if (typeof L === 'undefined' || !L || !L.Mixin) { return; } - - includes = isArray(includes) ? includes : [includes]; - - for (var i = 0; i < includes.length; i++) { - if (includes[i] === L.Mixin.Events) { - console.warn('Deprecated include of L.Mixin.Events: ' + - 'this property will be removed in future releases, ' + - 'please inherit from L.Evented instead.', new Error().stack); - } - } - } + DataField.prototype.initOpts = function() { + DataField.__super__.initOpts.call(this); + return this.addOpts({ + name: this.getNameOpt(), + maximize: { + check: Boolean + }, + maximize_horizontal: { + check: Boolean, + "default": false + }, + maximize_vertical: { + check: Boolean, + "default": false + }, + padded: { + check: Boolean, + "default": false + }, + data: { + check: function(v) { + return CUI.util.isFunction(v != null ? v.hasOwnProperty : void 0) || CUI.util.isFunction(v); + } + }, + data_not_for_others: { + "default": false, + check: Boolean + }, + disabled: { + "default": false, + check: function(v) { + return CUI.util.isBoolean(v) || CUI.util.isFunction(v); + } + }, + disabled_depends_on_data: { + check: Function + }, + tooltip: { + check: "PlainObject" + }, + hidden: { + check: Boolean + }, + form: {}, + undo_and_changed_support: { + check: Boolean + }, + undo_support: { + "default": CUI.DataField.defaults.undo_and_changed_support, + check: Boolean + }, + mark_changed: { + "default": CUI.DataField.defaults.undo_and_changed_support, + check: Boolean + }, + check_changed: { + "default": CUI.DataField.defaults.undo_and_changed_support, + check: Boolean + }, + onDataChanged: { + check: Function + }, + onDataInit: { + check: Function + }, + onInit: { + check: Function + }, + onRender: { + check: Function + }, + render_as_block: { + check: Boolean + } + }); + }; - /* - * @class Evented - * @aka L.Evented - * @inherits Class - * - * A set of methods shared between event-powered classes (like `Map` and `Marker`). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire `'click'` event). - * - * @example - * - * ```js - * map.on('click', function(e) { - * alert(e.latlng); - * } ); - * ``` - * - * Leaflet deals with event listeners by reference, so if you want to add a listener and then remove it, define it as a function: - * - * ```js - * function onClick(e) { ... } - * - * map.on('click', onClick); - * map.off('click', onClick); - * ``` - */ - - var Events = { - /* @method on(type: String, fn: Function, context?: Object): this - * Adds a listener function (`fn`) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. `'click dblclick'`). - * - * @alternative - * @method on(eventMap: Object): this - * Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}` - */ - on: function (types, fn, context) { - - // types can be a map of types/handlers - if (typeof types === 'object') { - for (var type in types) { - // we don't process space-separated events here for performance; - // it's a hot path since Layer uses the on(obj) syntax - this._on(type, types[type], fn); - } - - } else { - // types can be a string of space-separated words - types = splitWords(types); - - for (var i = 0, len = types.length; i < len; i++) { - this._on(types[i], fn, context); - } - } - - return this; - }, - - /* @method off(type: String, fn?: Function, context?: Object): this - * Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to `on`, you must pass the same context to `off` in order to remove the listener. - * - * @alternative - * @method off(eventMap: Object): this - * Removes a set of type/listener pairs. - * - * @alternative - * @method off: this - * Removes all listeners to all events on the object. This includes implicitly attached events. - */ - off: function (types, fn, context) { - - if (!arguments.length) { - // clear all listeners if called without arguments - delete this._events; - - } else if (typeof types === 'object') { - for (var type in types) { - this._off(type, types[type], fn); - } - - } else { - types = splitWords(types); - - var removeAll = arguments.length === 1; - for (var i = 0, len = types.length; i < len; i++) { - if (removeAll) { - this._off(types[i]); - } else { - this._off(types[i], fn, context); - } - } - } - - return this; - }, - - // attach listener (without syntactic sugar now) - _on: function (type, fn, context, _once) { - if (typeof fn !== 'function') { - console.warn('wrong listener type: ' + typeof fn); - return; - } - - // check if fn already there - if (this._listens(type, fn, context) !== false) { - return; - } - - if (context === this) { - // Less memory footprint. - context = undefined; - } - - var newListener = {fn: fn, ctx: context}; - if (_once) { - newListener.once = true; - } - - this._events = this._events || {}; - this._events[type] = this._events[type] || []; - this._events[type].push(newListener); - }, - - _off: function (type, fn, context) { - var listeners, - i, - len; - - if (!this._events) { - return; - } - - listeners = this._events[type]; - if (!listeners) { - return; - } - - if (arguments.length === 1) { // remove all - if (this._firingCount) { - // Set all removed listeners to noop - // so they are not called if remove happens in fire - for (i = 0, len = listeners.length; i < len; i++) { - listeners[i].fn = falseFn; - } - } - // clear all listeners for a type if function isn't specified - delete this._events[type]; - return; - } - - if (typeof fn !== 'function') { - console.warn('wrong listener type: ' + typeof fn); - return; - } - - // find fn and remove it - var index = this._listens(type, fn, context); - if (index !== false) { - var listener = listeners[index]; - if (this._firingCount) { - // set the removed listener to noop so that's not called if remove happens in fire - listener.fn = falseFn; - - /* copy array in case events are being fired */ - this._events[type] = listeners = listeners.slice(); - } - listeners.splice(index, 1); - } - }, - - // @method fire(type: String, data?: Object, propagate?: Boolean): this - // Fires an event of the specified type. You can optionally provide a data - // object — the first argument of the listener function will contain its - // properties. The event can optionally be propagated to event parents. - fire: function (type, data, propagate) { - if (!this.listens(type, propagate)) { return this; } - - var event = extend({}, data, { - type: type, - target: this, - sourceTarget: data && data.sourceTarget || this - }); - - if (this._events) { - var listeners = this._events[type]; - if (listeners) { - this._firingCount = (this._firingCount + 1) || 1; - for (var i = 0, len = listeners.length; i < len; i++) { - var l = listeners[i]; - // off overwrites l.fn, so we need to copy fn to a var - var fn = l.fn; - if (l.once) { - this.off(type, fn, l.ctx); - } - fn.call(l.ctx || this, event); - } - - this._firingCount--; - } - } - - if (propagate) { - // propagate the event to parents (set with addEventParent) - this._propagateEvent(event); - } - - return this; - }, - - // @method listens(type: String, propagate?: Boolean): Boolean - // @method listens(type: String, fn: Function, context?: Object, propagate?: Boolean): Boolean - // Returns `true` if a particular event type has any listeners attached to it. - // The verification can optionally be propagated, it will return `true` if parents have the listener attached to it. - listens: function (type, fn, context, propagate) { - if (typeof type !== 'string') { - console.warn('"string" type argument expected'); - } - - // we don't overwrite the input `fn` value, because we need to use it for propagation - var _fn = fn; - if (typeof fn !== 'function') { - propagate = !!fn; - _fn = undefined; - context = undefined; - } - - var listeners = this._events && this._events[type]; - if (listeners && listeners.length) { - if (this._listens(type, _fn, context) !== false) { - return true; - } - } - - if (propagate) { - // also check parents for listeners if event propagates - for (var id in this._eventParents) { - if (this._eventParents[id].listens(type, fn, context, propagate)) { return true; } - } - } - return false; - }, - - // returns the index (number) or false - _listens: function (type, fn, context) { - if (!this._events) { - return false; - } - - var listeners = this._events[type] || []; - if (!fn) { - return !!listeners.length; - } - - if (context === this) { - // Less memory footprint. - context = undefined; - } - - for (var i = 0, len = listeners.length; i < len; i++) { - if (listeners[i].fn === fn && listeners[i].ctx === context) { - return i; - } - } - return false; - - }, - - // @method once(…): this - // Behaves as [`on(…)`](#evented-on), except the listener will only get fired once and then removed. - once: function (types, fn, context) { - - // types can be a map of types/handlers - if (typeof types === 'object') { - for (var type in types) { - // we don't process space-separated events here for performance; - // it's a hot path since Layer uses the on(obj) syntax - this._on(type, types[type], fn, true); - } - - } else { - // types can be a string of space-separated words - types = splitWords(types); - - for (var i = 0, len = types.length; i < len; i++) { - this._on(types[i], fn, context, true); - } - } - - return this; - }, - - // @method addEventParent(obj: Evented): this - // Adds an event parent - an `Evented` that will receive propagated events - addEventParent: function (obj) { - this._eventParents = this._eventParents || {}; - this._eventParents[stamp(obj)] = obj; - return this; - }, - - // @method removeEventParent(obj: Evented): this - // Removes an event parent, so it will stop receiving propagated events - removeEventParent: function (obj) { - if (this._eventParents) { - delete this._eventParents[stamp(obj)]; - } - return this; - }, - - _propagateEvent: function (e) { - for (var id in this._eventParents) { - this._eventParents[id].fire(e.type, extend({ - layer: e.target, - propagatedFrom: e.target - }, e), true); - } - } - }; - - // aliases; we should ditch those eventually - - // @method addEventListener(…): this - // Alias to [`on(…)`](#evented-on) - Events.addEventListener = Events.on; - - // @method removeEventListener(…): this - // Alias to [`off(…)`](#evented-off) - - // @method clearAllEventListeners(…): this - // Alias to [`off()`](#evented-off) - Events.removeEventListener = Events.clearAllEventListeners = Events.off; - - // @method addOneTimeEventListener(…): this - // Alias to [`once(…)`](#evented-once) - Events.addOneTimeEventListener = Events.once; - - // @method fireEvent(…): this - // Alias to [`fire(…)`](#evented-fire) - Events.fireEvent = Events.fire; - - // @method hasEventListeners(…): Boolean - // Alias to [`listens(…)`](#evented-listens) - Events.hasEventListeners = Events.listens; - - var Evented = Class.extend(Events); + DataField.prototype.readOpts = function() { + var i, k, len, ref; + if (this.opts.hasOwnProperty("undo_and_changed_support")) { + ref = ["undo_support", "check_changed", "mark_changed"]; + for (i = 0, len = ref.length; i < len; i++) { + k = ref[i]; + if (!this.opts.hasOwnProperty(k)) { + this.opts[k] = this.opts.undo_and_changed_support; + } + } + } + DataField.__super__.readOpts.call(this); + return CUI.Layout.prototype.maximizeReadOpts.call(this); + }; - /* - * @class Point - * @aka L.Point - * - * Represents a point with `x` and `y` coordinates in pixels. - * - * @example - * - * ```js - * var point = L.point(200, 300); - * ``` - * - * All Leaflet methods and options that accept `Point` objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent: - * - * ```js - * map.panBy([200, 300]); - * map.panBy(L.point(200, 300)); - * ``` - * - * Note that `Point` does not inherit from Leaflet's `Class` object, - * which means new classes can't inherit from it, and new methods - * can't be added to it with the `include` function. - */ - - function Point(x, y, round) { - // @property x: Number; The `x` coordinate of the point - this.x = (round ? Math.round(x) : x); - // @property y: Number; The `y` coordinate of the point - this.y = (round ? Math.round(y) : y); - } - - var trunc = Math.trunc || function (v) { - return v > 0 ? Math.floor(v) : Math.ceil(v); - }; - - Point.prototype = { - - // @method clone(): Point - // Returns a copy of the current point. - clone: function () { - return new Point(this.x, this.y); - }, - - // @method add(otherPoint: Point): Point - // Returns the result of addition of the current and the given points. - add: function (point) { - // non-destructive, returns a new point - return this.clone()._add(toPoint(point)); - }, - - _add: function (point) { - // destructive, used directly for performance in situations where it's safe to modify existing point - this.x += point.x; - this.y += point.y; - return this; - }, - - // @method subtract(otherPoint: Point): Point - // Returns the result of subtraction of the given point from the current. - subtract: function (point) { - return this.clone()._subtract(toPoint(point)); - }, - - _subtract: function (point) { - this.x -= point.x; - this.y -= point.y; - return this; - }, - - // @method divideBy(num: Number): Point - // Returns the result of division of the current point by the given number. - divideBy: function (num) { - return this.clone()._divideBy(num); - }, - - _divideBy: function (num) { - this.x /= num; - this.y /= num; - return this; - }, - - // @method multiplyBy(num: Number): Point - // Returns the result of multiplication of the current point by the given number. - multiplyBy: function (num) { - return this.clone()._multiplyBy(num); - }, - - _multiplyBy: function (num) { - this.x *= num; - this.y *= num; - return this; - }, - - // @method scaleBy(scale: Point): Point - // Multiply each coordinate of the current point by each coordinate of - // `scale`. In linear algebra terms, multiply the point by the - // [scaling matrix](https://en.wikipedia.org/wiki/Scaling_%28geometry%29#Matrix_representation) - // defined by `scale`. - scaleBy: function (point) { - return new Point(this.x * point.x, this.y * point.y); - }, - - // @method unscaleBy(scale: Point): Point - // Inverse of `scaleBy`. Divide each coordinate of the current point by - // each coordinate of `scale`. - unscaleBy: function (point) { - return new Point(this.x / point.x, this.y / point.y); - }, - - // @method round(): Point - // Returns a copy of the current point with rounded coordinates. - round: function () { - return this.clone()._round(); - }, - - _round: function () { - this.x = Math.round(this.x); - this.y = Math.round(this.y); - return this; - }, - - // @method floor(): Point - // Returns a copy of the current point with floored coordinates (rounded down). - floor: function () { - return this.clone()._floor(); - }, - - _floor: function () { - this.x = Math.floor(this.x); - this.y = Math.floor(this.y); - return this; - }, - - // @method ceil(): Point - // Returns a copy of the current point with ceiled coordinates (rounded up). - ceil: function () { - return this.clone()._ceil(); - }, - - _ceil: function () { - this.x = Math.ceil(this.x); - this.y = Math.ceil(this.y); - return this; - }, - - // @method trunc(): Point - // Returns a copy of the current point with truncated coordinates (rounded towards zero). - trunc: function () { - return this.clone()._trunc(); - }, - - _trunc: function () { - this.x = trunc(this.x); - this.y = trunc(this.y); - return this; - }, - - // @method distanceTo(otherPoint: Point): Number - // Returns the cartesian distance between the current and the given points. - distanceTo: function (point) { - point = toPoint(point); - - var x = point.x - this.x, - y = point.y - this.y; - - return Math.sqrt(x * x + y * y); - }, - - // @method equals(otherPoint: Point): Boolean - // Returns `true` if the given point has the same coordinates. - equals: function (point) { - point = toPoint(point); - - return point.x === this.x && - point.y === this.y; - }, - - // @method contains(otherPoint: Point): Boolean - // Returns `true` if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values). - contains: function (point) { - point = toPoint(point); - - return Math.abs(point.x) <= Math.abs(this.x) && - Math.abs(point.y) <= Math.abs(this.y); - }, - - // @method toString(): String - // Returns a string representation of the point for debugging purposes. - toString: function () { - return 'Point(' + - formatNum(this.x) + ', ' + - formatNum(this.y) + ')'; - } - }; - - // @factory L.point(x: Number, y: Number, round?: Boolean) - // Creates a Point object with the given `x` and `y` coordinates. If optional `round` is set to true, rounds the `x` and `y` values. - - // @alternative - // @factory L.point(coords: Number[]) - // Expects an array of the form `[x, y]` instead. - - // @alternative - // @factory L.point(coords: Object) - // Expects a plain object of the form `{x: Number, y: Number}` instead. - function toPoint(x, y, round) { - if (x instanceof Point) { - return x; - } - if (isArray(x)) { - return new Point(x[0], x[1]); - } - if (x === undefined || x === null) { - return x; - } - if (typeof x === 'object' && 'x' in x && 'y' in x) { - return new Point(x.x, x.y); - } - return new Point(x, y, round); - } + DataField.prototype.maximizeAddClasses = function() { + return CUI.Layout.prototype.maximizeAddClasses.call(this); + }; - /* - * @class Bounds - * @aka L.Bounds - * - * Represents a rectangular area in pixel coordinates. - * - * @example - * - * ```js - * var p1 = L.point(10, 10), - * p2 = L.point(40, 60), - * bounds = L.bounds(p1, p2); - * ``` - * - * All Leaflet methods that accept `Bounds` objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this: - * - * ```js - * otherBounds.intersects([[10, 10], [40, 60]]); - * ``` - * - * Note that `Bounds` does not inherit from Leaflet's `Class` object, - * which means new classes can't inherit from it, and new methods - * can't be added to it with the `include` function. - */ - - function Bounds(a, b) { - if (!a) { return; } - - var points = b ? [a, b] : a; - - for (var i = 0, len = points.length; i < len; i++) { - this.extend(points[i]); - } - } - - Bounds.prototype = { - // @method extend(point: Point): this - // Extends the bounds to contain the given point. - - // @alternative - // @method extend(otherBounds: Bounds): this - // Extend the bounds to contain the given bounds - extend: function (obj) { - var min2, max2; - if (!obj) { return this; } - - if (obj instanceof Point || typeof obj[0] === 'number' || 'x' in obj) { - min2 = max2 = toPoint(obj); - } else { - obj = toBounds(obj); - min2 = obj.min; - max2 = obj.max; - - if (!min2 || !max2) { return this; } - } - - // @property min: Point - // The top left corner of the rectangle. - // @property max: Point - // The bottom right corner of the rectangle. - if (!this.min && !this.max) { - this.min = min2.clone(); - this.max = max2.clone(); - } else { - this.min.x = Math.min(min2.x, this.min.x); - this.max.x = Math.max(max2.x, this.max.x); - this.min.y = Math.min(min2.y, this.min.y); - this.max.y = Math.max(max2.y, this.max.y); - } - return this; - }, - - // @method getCenter(round?: Boolean): Point - // Returns the center point of the bounds. - getCenter: function (round) { - return toPoint( - (this.min.x + this.max.x) / 2, - (this.min.y + this.max.y) / 2, round); - }, - - // @method getBottomLeft(): Point - // Returns the bottom-left point of the bounds. - getBottomLeft: function () { - return toPoint(this.min.x, this.max.y); - }, - - // @method getTopRight(): Point - // Returns the top-right point of the bounds. - getTopRight: function () { // -> Point - return toPoint(this.max.x, this.min.y); - }, - - // @method getTopLeft(): Point - // Returns the top-left point of the bounds (i.e. [`this.min`](#bounds-min)). - getTopLeft: function () { - return this.min; // left, top - }, - - // @method getBottomRight(): Point - // Returns the bottom-right point of the bounds (i.e. [`this.max`](#bounds-max)). - getBottomRight: function () { - return this.max; // right, bottom - }, - - // @method getSize(): Point - // Returns the size of the given bounds - getSize: function () { - return this.max.subtract(this.min); - }, - - // @method contains(otherBounds: Bounds): Boolean - // Returns `true` if the rectangle contains the given one. - // @alternative - // @method contains(point: Point): Boolean - // Returns `true` if the rectangle contains the given point. - contains: function (obj) { - var min, max; - - if (typeof obj[0] === 'number' || obj instanceof Point) { - obj = toPoint(obj); - } else { - obj = toBounds(obj); - } - - if (obj instanceof Bounds) { - min = obj.min; - max = obj.max; - } else { - min = max = obj; - } - - return (min.x >= this.min.x) && - (max.x <= this.max.x) && - (min.y >= this.min.y) && - (max.y <= this.max.y); - }, - - // @method intersects(otherBounds: Bounds): Boolean - // Returns `true` if the rectangle intersects the given bounds. Two bounds - // intersect if they have at least one point in common. - intersects: function (bounds) { // (Bounds) -> Boolean - bounds = toBounds(bounds); - - var min = this.min, - max = this.max, - min2 = bounds.min, - max2 = bounds.max, - xIntersects = (max2.x >= min.x) && (min2.x <= max.x), - yIntersects = (max2.y >= min.y) && (min2.y <= max.y); - - return xIntersects && yIntersects; - }, - - // @method overlaps(otherBounds: Bounds): Boolean - // Returns `true` if the rectangle overlaps the given bounds. Two bounds - // overlap if their intersection is an area. - overlaps: function (bounds) { // (Bounds) -> Boolean - bounds = toBounds(bounds); - - var min = this.min, - max = this.max, - min2 = bounds.min, - max2 = bounds.max, - xOverlaps = (max2.x > min.x) && (min2.x < max.x), - yOverlaps = (max2.y > min.y) && (min2.y < max.y); - - return xOverlaps && yOverlaps; - }, - - // @method isValid(): Boolean - // Returns `true` if the bounds are properly initialized. - isValid: function () { - return !!(this.min && this.max); - }, - - - // @method pad(bufferRatio: Number): Bounds - // Returns bounds created by extending or retracting the current bounds by a given ratio in each direction. - // For example, a ratio of 0.5 extends the bounds by 50% in each direction. - // Negative values will retract the bounds. - pad: function (bufferRatio) { - var min = this.min, - max = this.max, - heightBuffer = Math.abs(min.x - max.x) * bufferRatio, - widthBuffer = Math.abs(min.y - max.y) * bufferRatio; - - - return toBounds( - toPoint(min.x - heightBuffer, min.y - widthBuffer), - toPoint(max.x + heightBuffer, max.y + widthBuffer)); - }, - - - // @method equals(otherBounds: Bounds): Boolean - // Returns `true` if the rectangle is equivalent to the given bounds. - equals: function (bounds) { - if (!bounds) { return false; } - - bounds = toBounds(bounds); - - return this.min.equals(bounds.getTopLeft()) && - this.max.equals(bounds.getBottomRight()); - }, - }; - - - // @factory L.bounds(corner1: Point, corner2: Point) - // Creates a Bounds object from two corners coordinate pairs. - // @alternative - // @factory L.bounds(points: Point[]) - // Creates a Bounds object from the given array of points. - function toBounds(a, b) { - if (!a || a instanceof Bounds) { - return a; - } - return new Bounds(a, b); - } + DataField.prototype.getUniqueIdForLabel = function() { + return null; + }; - /* - * @class LatLngBounds - * @aka L.LatLngBounds - * - * Represents a rectangular geographical area on a map. - * - * @example - * - * ```js - * var corner1 = L.latLng(40.712, -74.227), - * corner2 = L.latLng(40.774, -74.125), - * bounds = L.latLngBounds(corner1, corner2); - * ``` - * - * All Leaflet methods that accept LatLngBounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this: - * - * ```js - * map.fitBounds([ - * [40.712, -74.227], - * [40.774, -74.125] - * ]); - * ``` - * - * Caution: if the area crosses the antimeridian (often confused with the International Date Line), you must specify corners _outside_ the [-180, 180] degrees longitude range. - * - * Note that `LatLngBounds` does not inherit from Leaflet's `Class` object, - * which means new classes can't inherit from it, and new methods - * can't be added to it with the `include` function. - */ - - function LatLngBounds(corner1, corner2) { // (LatLng, LatLng) or (LatLng[]) - if (!corner1) { return; } - - var latlngs = corner2 ? [corner1, corner2] : corner1; - - for (var i = 0, len = latlngs.length; i < len; i++) { - this.extend(latlngs[i]); - } - } - - LatLngBounds.prototype = { - - // @method extend(latlng: LatLng): this - // Extend the bounds to contain the given point - - // @alternative - // @method extend(otherBounds: LatLngBounds): this - // Extend the bounds to contain the given bounds - extend: function (obj) { - var sw = this._southWest, - ne = this._northEast, - sw2, ne2; - - if (obj instanceof LatLng) { - sw2 = obj; - ne2 = obj; - - } else if (obj instanceof LatLngBounds) { - sw2 = obj._southWest; - ne2 = obj._northEast; - - if (!sw2 || !ne2) { return this; } - - } else { - return obj ? this.extend(toLatLng(obj) || toLatLngBounds(obj)) : this; - } - - if (!sw && !ne) { - this._southWest = new LatLng(sw2.lat, sw2.lng); - this._northEast = new LatLng(ne2.lat, ne2.lng); - } else { - sw.lat = Math.min(sw2.lat, sw.lat); - sw.lng = Math.min(sw2.lng, sw.lng); - ne.lat = Math.max(ne2.lat, ne.lat); - ne.lng = Math.max(ne2.lng, ne.lng); - } - - return this; - }, - - // @method pad(bufferRatio: Number): LatLngBounds - // Returns bounds created by extending or retracting the current bounds by a given ratio in each direction. - // For example, a ratio of 0.5 extends the bounds by 50% in each direction. - // Negative values will retract the bounds. - pad: function (bufferRatio) { - var sw = this._southWest, - ne = this._northEast, - heightBuffer = Math.abs(sw.lat - ne.lat) * bufferRatio, - widthBuffer = Math.abs(sw.lng - ne.lng) * bufferRatio; - - return new LatLngBounds( - new LatLng(sw.lat - heightBuffer, sw.lng - widthBuffer), - new LatLng(ne.lat + heightBuffer, ne.lng + widthBuffer)); - }, - - // @method getCenter(): LatLng - // Returns the center point of the bounds. - getCenter: function () { - return new LatLng( - (this._southWest.lat + this._northEast.lat) / 2, - (this._southWest.lng + this._northEast.lng) / 2); - }, - - // @method getSouthWest(): LatLng - // Returns the south-west point of the bounds. - getSouthWest: function () { - return this._southWest; - }, - - // @method getNorthEast(): LatLng - // Returns the north-east point of the bounds. - getNorthEast: function () { - return this._northEast; - }, - - // @method getNorthWest(): LatLng - // Returns the north-west point of the bounds. - getNorthWest: function () { - return new LatLng(this.getNorth(), this.getWest()); - }, - - // @method getSouthEast(): LatLng - // Returns the south-east point of the bounds. - getSouthEast: function () { - return new LatLng(this.getSouth(), this.getEast()); - }, - - // @method getWest(): Number - // Returns the west longitude of the bounds - getWest: function () { - return this._southWest.lng; - }, - - // @method getSouth(): Number - // Returns the south latitude of the bounds - getSouth: function () { - return this._southWest.lat; - }, - - // @method getEast(): Number - // Returns the east longitude of the bounds - getEast: function () { - return this._northEast.lng; - }, - - // @method getNorth(): Number - // Returns the north latitude of the bounds - getNorth: function () { - return this._northEast.lat; - }, - - // @method contains(otherBounds: LatLngBounds): Boolean - // Returns `true` if the rectangle contains the given one. - - // @alternative - // @method contains (latlng: LatLng): Boolean - // Returns `true` if the rectangle contains the given point. - contains: function (obj) { // (LatLngBounds) or (LatLng) -> Boolean - if (typeof obj[0] === 'number' || obj instanceof LatLng || 'lat' in obj) { - obj = toLatLng(obj); - } else { - obj = toLatLngBounds(obj); - } - - var sw = this._southWest, - ne = this._northEast, - sw2, ne2; - - if (obj instanceof LatLngBounds) { - sw2 = obj.getSouthWest(); - ne2 = obj.getNorthEast(); - } else { - sw2 = ne2 = obj; - } - - return (sw2.lat >= sw.lat) && (ne2.lat <= ne.lat) && - (sw2.lng >= sw.lng) && (ne2.lng <= ne.lng); - }, - - // @method intersects(otherBounds: LatLngBounds): Boolean - // Returns `true` if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common. - intersects: function (bounds) { - bounds = toLatLngBounds(bounds); - - var sw = this._southWest, - ne = this._northEast, - sw2 = bounds.getSouthWest(), - ne2 = bounds.getNorthEast(), - - latIntersects = (ne2.lat >= sw.lat) && (sw2.lat <= ne.lat), - lngIntersects = (ne2.lng >= sw.lng) && (sw2.lng <= ne.lng); - - return latIntersects && lngIntersects; - }, - - // @method overlaps(otherBounds: LatLngBounds): Boolean - // Returns `true` if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area. - overlaps: function (bounds) { - bounds = toLatLngBounds(bounds); - - var sw = this._southWest, - ne = this._northEast, - sw2 = bounds.getSouthWest(), - ne2 = bounds.getNorthEast(), - - latOverlaps = (ne2.lat > sw.lat) && (sw2.lat < ne.lat), - lngOverlaps = (ne2.lng > sw.lng) && (sw2.lng < ne.lng); - - return latOverlaps && lngOverlaps; - }, - - // @method toBBoxString(): String - // Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for sending requests to web services that return geo data. - toBBoxString: function () { - return [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(','); - }, - - // @method equals(otherBounds: LatLngBounds, maxMargin?: Number): Boolean - // Returns `true` if the rectangle is equivalent (within a small margin of error) to the given bounds. The margin of error can be overridden by setting `maxMargin` to a small number. - equals: function (bounds, maxMargin) { - if (!bounds) { return false; } - - bounds = toLatLngBounds(bounds); - - return this._southWest.equals(bounds.getSouthWest(), maxMargin) && - this._northEast.equals(bounds.getNorthEast(), maxMargin); - }, - - // @method isValid(): Boolean - // Returns `true` if the bounds are properly initialized. - isValid: function () { - return !!(this._southWest && this._northEast); - } - }; - - // TODO International date line? - - // @factory L.latLngBounds(corner1: LatLng, corner2: LatLng) - // Creates a `LatLngBounds` object by defining two diagonally opposite corners of the rectangle. - - // @alternative - // @factory L.latLngBounds(latlngs: LatLng[]) - // Creates a `LatLngBounds` object defined by the geographical points it contains. Very useful for zooming the map to fit a particular set of locations with [`fitBounds`](#map-fitbounds). - function toLatLngBounds(a, b) { - if (a instanceof LatLngBounds) { - return a; - } - return new LatLngBounds(a, b); - } + DataField.prototype.initTemplate = function() { + return this.registerTemplate(this.getTemplate()); + }; - /* @class LatLng - * @aka L.LatLng - * - * Represents a geographical point with a certain latitude and longitude. - * - * @example - * - * ``` - * var latlng = L.latLng(50.5, 30.5); - * ``` - * - * All Leaflet methods that accept LatLng objects also accept them in a simple Array form and simple object form (unless noted otherwise), so these lines are equivalent: - * - * ``` - * map.panTo([50, 30]); - * map.panTo({lon: 30, lat: 50}); - * map.panTo({lat: 50, lng: 30}); - * map.panTo(L.latLng(50, 30)); - * ``` - * - * Note that `LatLng` does not inherit from Leaflet's `Class` object, - * which means new classes can't inherit from it, and new methods - * can't be added to it with the `include` function. - */ - - function LatLng(lat, lng, alt) { - if (isNaN(lat) || isNaN(lng)) { - throw new Error('Invalid LatLng object: (' + lat + ', ' + lng + ')'); - } - - // @property lat: Number - // Latitude in degrees - this.lat = +lat; - - // @property lng: Number - // Longitude in degrees - this.lng = +lng; - - // @property alt: Number - // Altitude in meters (optional) - if (alt !== undefined) { - this.alt = +alt; - } - } - - LatLng.prototype = { - // @method equals(otherLatLng: LatLng, maxMargin?: Number): Boolean - // Returns `true` if the given `LatLng` point is at the same position (within a small margin of error). The margin of error can be overridden by setting `maxMargin` to a small number. - equals: function (obj, maxMargin) { - if (!obj) { return false; } - - obj = toLatLng(obj); - - var margin = Math.max( - Math.abs(this.lat - obj.lat), - Math.abs(this.lng - obj.lng)); - - return margin <= (maxMargin === undefined ? 1.0E-9 : maxMargin); - }, - - // @method toString(): String - // Returns a string representation of the point (for debugging purposes). - toString: function (precision) { - return 'LatLng(' + - formatNum(this.lat, precision) + ', ' + - formatNum(this.lng, precision) + ')'; - }, - - // @method distanceTo(otherLatLng: LatLng): Number - // Returns the distance (in meters) to the given `LatLng` calculated using the [Spherical Law of Cosines](https://en.wikipedia.org/wiki/Spherical_law_of_cosines). - distanceTo: function (other) { - return Earth.distance(this, toLatLng(other)); - }, - - // @method wrap(): LatLng - // Returns a new `LatLng` object with the longitude wrapped so it's always between -180 and +180 degrees. - wrap: function () { - return Earth.wrapLatLng(this); - }, - - // @method toBounds(sizeInMeters: Number): LatLngBounds - // Returns a new `LatLngBounds` object in which each boundary is `sizeInMeters/2` meters apart from the `LatLng`. - toBounds: function (sizeInMeters) { - var latAccuracy = 180 * sizeInMeters / 40075017, - lngAccuracy = latAccuracy / Math.cos((Math.PI / 180) * this.lat); - - return toLatLngBounds( - [this.lat - latAccuracy, this.lng - lngAccuracy], - [this.lat + latAccuracy, this.lng + lngAccuracy]); - }, - - clone: function () { - return new LatLng(this.lat, this.lng, this.alt); - } - }; - - - - // @factory L.latLng(latitude: Number, longitude: Number, altitude?: Number): LatLng - // Creates an object representing a geographical point with the given latitude and longitude (and optionally altitude). - - // @alternative - // @factory L.latLng(coords: Array): LatLng - // Expects an array of the form `[Number, Number]` or `[Number, Number, Number]` instead. - - // @alternative - // @factory L.latLng(coords: Object): LatLng - // Expects an plain object of the form `{lat: Number, lng: Number}` or `{lat: Number, lng: Number, alt: Number}` instead. - - function toLatLng(a, b, c) { - if (a instanceof LatLng) { - return a; - } - if (isArray(a) && typeof a[0] !== 'object') { - if (a.length === 3) { - return new LatLng(a[0], a[1], a[2]); - } - if (a.length === 2) { - return new LatLng(a[0], a[1]); - } - return null; - } - if (a === undefined || a === null) { - return a; - } - if (typeof a === 'object' && 'lat' in a) { - return new LatLng(a.lat, 'lng' in a ? a.lng : a.lon, a.alt); - } - if (b === undefined) { - return null; - } - return new LatLng(a, b, c); - } + DataField.prototype.getTemplate = function() { + return new CUI.Template({ + name: "data-field" + }); + }; - /* - * @namespace CRS - * @crs L.CRS.Base - * Object that defines coordinate reference systems for projecting - * geographical points into pixel (screen) coordinates and back (and to - * coordinates in other units for [WMS](https://en.wikipedia.org/wiki/Web_Map_Service) services). See - * [spatial reference system](https://en.wikipedia.org/wiki/Spatial_reference_system). - * - * Leaflet defines the most usual CRSs by default. If you want to use a - * CRS not defined by default, take a look at the - * [Proj4Leaflet](https://github.com/kartena/Proj4Leaflet) plugin. - * - * Note that the CRS instances do not inherit from Leaflet's `Class` object, - * and can't be instantiated. Also, new classes can't inherit from them, - * and methods can't be added to them with the `include` function. - */ - - var CRS = { - // @method latLngToPoint(latlng: LatLng, zoom: Number): Point - // Projects geographical coordinates into pixel coordinates for a given zoom. - latLngToPoint: function (latlng, zoom) { - var projectedPoint = this.projection.project(latlng), - scale = this.scale(zoom); - - return this.transformation._transform(projectedPoint, scale); - }, - - // @method pointToLatLng(point: Point, zoom: Number): LatLng - // The inverse of `latLngToPoint`. Projects pixel coordinates on a given - // zoom into geographical coordinates. - pointToLatLng: function (point, zoom) { - var scale = this.scale(zoom), - untransformedPoint = this.transformation.untransform(point, scale); - - return this.projection.unproject(untransformedPoint); - }, - - // @method project(latlng: LatLng): Point - // Projects geographical coordinates into coordinates in units accepted for - // this CRS (e.g. meters for EPSG:3857, for passing it to WMS services). - project: function (latlng) { - return this.projection.project(latlng); - }, - - // @method unproject(point: Point): LatLng - // Given a projected coordinate returns the corresponding LatLng. - // The inverse of `project`. - unproject: function (point) { - return this.projection.unproject(point); - }, - - // @method scale(zoom: Number): Number - // Returns the scale used when transforming projected coordinates into - // pixel coordinates for a particular zoom. For example, it returns - // `256 * 2^zoom` for Mercator-based CRS. - scale: function (zoom) { - return 256 * Math.pow(2, zoom); - }, - - // @method zoom(scale: Number): Number - // Inverse of `scale()`, returns the zoom level corresponding to a scale - // factor of `scale`. - zoom: function (scale) { - return Math.log(scale / 256) / Math.LN2; - }, - - // @method getProjectedBounds(zoom: Number): Bounds - // Returns the projection's bounds scaled and transformed for the provided `zoom`. - getProjectedBounds: function (zoom) { - if (this.infinite) { return null; } - - var b = this.projection.bounds, - s = this.scale(zoom), - min = this.transformation.transform(b.min, s), - max = this.transformation.transform(b.max, s); - - return new Bounds(min, max); - }, - - // @method distance(latlng1: LatLng, latlng2: LatLng): Number - // Returns the distance between two geographical coordinates. - - // @property code: String - // Standard code name of the CRS passed into WMS services (e.g. `'EPSG:3857'`) - // - // @property wrapLng: Number[] - // An array of two numbers defining whether the longitude (horizontal) coordinate - // axis wraps around a given range and how. Defaults to `[-180, 180]` in most - // geographical CRSs. If `undefined`, the longitude axis does not wrap around. - // - // @property wrapLat: Number[] - // Like `wrapLng`, but for the latitude (vertical) axis. - - // wrapLng: [min, max], - // wrapLat: [min, max], - - // @property infinite: Boolean - // If true, the coordinate space will be unbounded (infinite in both axes) - infinite: false, - - // @method wrapLatLng(latlng: LatLng): LatLng - // Returns a `LatLng` where lat and lng has been wrapped according to the - // CRS's `wrapLat` and `wrapLng` properties, if they are outside the CRS's bounds. - wrapLatLng: function (latlng) { - var lng = this.wrapLng ? wrapNum(latlng.lng, this.wrapLng, true) : latlng.lng, - lat = this.wrapLat ? wrapNum(latlng.lat, this.wrapLat, true) : latlng.lat, - alt = latlng.alt; - - return new LatLng(lat, lng, alt); - }, - - // @method wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds - // Returns a `LatLngBounds` with the same size as the given one, ensuring - // that its center is within the CRS's bounds. - // Only accepts actual `L.LatLngBounds` instances, not arrays. - wrapLatLngBounds: function (bounds) { - var center = bounds.getCenter(), - newCenter = this.wrapLatLng(center), - latShift = center.lat - newCenter.lat, - lngShift = center.lng - newCenter.lng; - - if (latShift === 0 && lngShift === 0) { - return bounds; - } - - var sw = bounds.getSouthWest(), - ne = bounds.getNorthEast(), - newSw = new LatLng(sw.lat - latShift, sw.lng - lngShift), - newNe = new LatLng(ne.lat - latShift, ne.lng - lngShift); - - return new LatLngBounds(newSw, newNe); - } + DataField.prototype.isResizable = function() { + return false; }; - /* - * @namespace CRS - * @crs L.CRS.Earth - * - * Serves as the base for CRS that are global such that they cover the earth. - * Can only be used as the base for other CRS and cannot be used directly, - * since it does not have a `code`, `projection` or `transformation`. `distance()` returns - * meters. - */ + DataField.prototype.init = function() {}; - var Earth = extend({}, CRS, { - wrapLng: [-180, 180], + DataField.prototype.debug = function() { + console.debug("----" + this + "----", this); + if (this.__data) { + console.debug("data:", this.getData()); + console.debug("value:", this.getValue()); + console.debug("init-value:", this.getInitValue()); + return console.debug("check-changed-value:", this.getCheckChangedValue()); + } + }; - // Mean Earth Radius, as recommended for use by - // the International Union of Geodesy and Geophysics, - // see https://rosettacode.org/wiki/Haversine_formula - R: 6371000, + DataField.prototype.toString = function() { + return "[" + this.__cls + "[" + this.__uniqueId + ", " + (this._name || '') + "]}"; + }; - // distance between two geographical points using spherical law of cosines approximation - distance: function (latlng1, latlng2) { - var rad = Math.PI / 180, - lat1 = latlng1.lat * rad, - lat2 = latlng2.lat * rad, - sinDLat = Math.sin((latlng2.lat - latlng1.lat) * rad / 2), - sinDLon = Math.sin((latlng2.lng - latlng1.lng) * rad / 2), - a = sinDLat * sinDLat + Math.cos(lat1) * Math.cos(lat2) * sinDLon * sinDLon, - c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); - return this.R * c; - } - }); + DataField.prototype.reload = function() { + this.remove(); + this.render(); + this.displayValue(); + if (typeof this._onRender === "function") { + this._onRender(this); + } + return this; + }; - /* - * @namespace Projection - * @projection L.Projection.SphericalMercator - * - * Spherical Mercator projection — the most common projection for online maps, - * used by almost all free and commercial tile providers. Assumes that Earth is - * a sphere. Used by the `EPSG:3857` CRS. - */ - - var earthRadius = 6378137; - - var SphericalMercator = { - - R: earthRadius, - MAX_LATITUDE: 85.0511287798, - - project: function (latlng) { - var d = Math.PI / 180, - max = this.MAX_LATITUDE, - lat = Math.max(Math.min(max, latlng.lat), -max), - sin = Math.sin(lat * d); - - return new Point( - this.R * latlng.lng * d, - this.R * Math.log((1 + sin) / (1 - sin)) / 2); - }, - - unproject: function (point) { - var d = 180 / Math.PI; - - return new LatLng( - (2 * Math.atan(Math.exp(point.y / this.R)) - (Math.PI / 2)) * d, - point.x * d / this.R); - }, - - bounds: (function () { - var d = earthRadius * Math.PI; - return new Bounds([-d, -d], [d, d]); - })() + DataField.prototype.remove = function() { + this.callOnOthers("remove"); + if (!this.isDestroyed()) { + this.empty(); + } + return this.__isRendered = false; }; - /* - * @class Transformation - * @aka L.Transformation - * - * Represents an affine transformation: a set of coefficients `a`, `b`, `c`, `d` - * for transforming a point of a form `(x, y)` into `(a*x + b, c*y + d)` and doing - * the reverse. Used by Leaflet in its projections code. - * - * @example - * - * ```js - * var transformation = L.transformation(2, 5, -1, 10), - * p = L.point(1, 2), - * p2 = transformation.transform(p), // L.point(7, 8) - * p3 = transformation.untransform(p2); // L.point(1, 2) - * ``` - */ - - - // factory new L.Transformation(a: Number, b: Number, c: Number, d: Number) - // Creates a `Transformation` object with the given coefficients. - function Transformation(a, b, c, d) { - if (isArray(a)) { - // use array properties - this._a = a[0]; - this._b = a[1]; - this._c = a[2]; - this._d = a[3]; - return; - } - this._a = a; - this._b = b; - this._c = c; - this._d = d; - } - - Transformation.prototype = { - // @method transform(point: Point, scale?: Number): Point - // Returns a transformed point, optionally multiplied by the given scale. - // Only accepts actual `L.Point` instances, not arrays. - transform: function (point, scale) { // (Point, Number) -> Point - return this._transform(point.clone(), scale); - }, - - // destructive transform (faster) - _transform: function (point, scale) { - scale = scale || 1; - point.x = scale * (this._a * point.x + this._b); - point.y = scale * (this._c * point.y + this._d); - return point; - }, - - // @method untransform(point: Point, scale?: Number): Point - // Returns the reverse transformation of the given point, optionally divided - // by the given scale. Only accepts actual `L.Point` instances, not arrays. - untransform: function (point, scale) { - scale = scale || 1; - return new Point( - (point.x / scale - this._b) / this._a, - (point.y / scale - this._d) / this._c); - } - }; - - // factory L.transformation(a: Number, b: Number, c: Number, d: Number) - - // @factory L.transformation(a: Number, b: Number, c: Number, d: Number) - // Instantiates a Transformation object with the given coefficients. - - // @alternative - // @factory L.transformation(coefficients: Array): Transformation - // Expects an coefficients array of the form - // `[a: Number, b: Number, c: Number, d: Number]`. - - function toTransformation(a, b, c, d) { - return new Transformation(a, b, c, d); - } + DataField.prototype.getNameOpt = function() { + return { + check: String + }; + }; - /* - * @namespace CRS - * @crs L.CRS.EPSG3857 - * - * The most common CRS for online maps, used by almost all free and commercial - * tile providers. Uses Spherical Mercator projection. Set in by default in - * Map's `crs` option. - */ - - var EPSG3857 = extend({}, Earth, { - code: 'EPSG:3857', - projection: SphericalMercator, - - transformation: (function () { - var scale = 0.5 / (Math.PI * SphericalMercator.R); - return toTransformation(scale, 0.5, -scale, 0.5); - }()) - }); - - var EPSG900913 = extend({}, EPSG3857, { - code: 'EPSG:900913' - }); + DataField.prototype.registerLabel = function(lbl) { + var _for; + _for = this.getUniqueIdForLabel(); + if (_for) { + lbl.setAttribute('for', _for); + } + }; - // @namespace SVG; @section - // There are several static functions which can be called without instantiating L.SVG: + DataField.prototype.getLabel = function() { + return this._label; + }; - // @function create(name: String): SVGElement - // Returns a instance of [SVGElement](https://developer.mozilla.org/docs/Web/API/SVGElement), - // corresponding to the class name passed. For example, using 'line' will return - // an instance of [SVGLineElement](https://developer.mozilla.org/docs/Web/API/SVGLineElement). - function svgCreate(name) { - return document.createElementNS('http://www.w3.org/2000/svg', name); - } + DataField.prototype.getMaximizeHorizontal = function() { + return this.__maximize_horizontal; + }; - // @function pointsToPath(rings: Point[], closed: Boolean): String - // Generates a SVG path string for multiple rings, with each ring turning - // into "M..L..L.." instructions - function pointsToPath(rings, closed) { - var str = '', - i, j, len, len2, points, p; + DataField.prototype.setForm = function(form) { + CUI.util.assertImplements(form, ["getFieldsByName", "getFieldByIdx", "getData", "getFields"]); + this.__form = form; + if (!this.getForm().getFormPath) { + return this; + } + if (this.__form.getMaximizeHorizontal()) { + if (this.getOpt("maximize_horizontal") !== false) { + this.addClass("cui-maximize-horizontal"); + } + } + return this; + }; - for (i = 0, len = rings.length; i < len; i++) { - points = rings[i]; + DataField.prototype.getFormPath = function(include_self, path, call) { + var ref; + if (include_self == null) { + include_self = false; + } + if (path == null) { + path = []; + } + if (call == null) { + call = 0; + } + CUI.util.assert(call < 100, "CUI.DataField.getPath", "Recursion detected."); + if ((ref = this.getForm()) != null ? ref.getFormPath : void 0) { + this.getForm().getFormPath(true, path, call + 1); + } + if (include_self) { + path.push(this); + } + return path; + }; - for (j = 0, len2 = points.length; j < len2; j++) { - p = points[j]; - str += (j ? 'L' : 'M') + p.x + ' ' + p.y; - } + DataField.prototype.getForm = function() { + return this.__form; + }; - // closes the ring for polygons; "x" is VML syntax - str += closed ? (Browser.svg ? 'z' : 'x') : ''; - } + DataField.prototype.getOtherField = function(name) { + var ref, ref1; + return (ref = this.__form) != null ? (ref1 = ref.getFieldsByName(name)) != null ? ref1[0] : void 0 : void 0; + }; - // SVG complains about empty path strings - return str || 'M0 0'; - } + DataField.prototype.getRootForm = function() { + if (this.__form) { + return this.__form.getRootForm(); + } else if (this instanceof CUI.Form) { + return this; + } else { + return null; + } + }; - /* - * @namespace Browser - * @aka L.Browser - * - * A namespace with static properties for browser/feature detection used by Leaflet internally. - * - * @example - * - * ```js - * if (L.Browser.ielt9) { - * alert('Upgrade your browser, dude!'); - * } - * ``` - */ - - var style = document.documentElement.style; - - // @property ie: Boolean; `true` for all Internet Explorer versions (not Edge). - var ie = 'ActiveXObject' in window; - - // @property ielt9: Boolean; `true` for Internet Explorer versions less than 9. - var ielt9 = ie && !document.addEventListener; - - // @property edge: Boolean; `true` for the Edge web browser. - var edge = 'msLaunchUri' in navigator && !('documentMode' in document); - - // @property webkit: Boolean; - // `true` for webkit-based browsers like Chrome and Safari (including mobile versions). - var webkit = userAgentContains('webkit'); - - // @property android: Boolean - // **Deprecated.** `true` for any browser running on an Android platform. - var android = userAgentContains('android'); - - // @property android23: Boolean; **Deprecated.** `true` for browsers running on Android 2 or Android 3. - var android23 = userAgentContains('android 2') || userAgentContains('android 3'); - - /* See https://stackoverflow.com/a/17961266 for details on detecting stock Android */ - var webkitVer = parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1], 10); // also matches AppleWebKit - // @property androidStock: Boolean; **Deprecated.** `true` for the Android stock browser (i.e. not Chrome) - var androidStock = android && userAgentContains('Google') && webkitVer < 537 && !('AudioNode' in window); - - // @property opera: Boolean; `true` for the Opera browser - var opera = !!window.opera; - - // @property chrome: Boolean; `true` for the Chrome browser. - var chrome = !edge && userAgentContains('chrome'); - - // @property gecko: Boolean; `true` for gecko-based browsers like Firefox. - var gecko = userAgentContains('gecko') && !webkit && !opera && !ie; - - // @property safari: Boolean; `true` for the Safari browser. - var safari = !chrome && userAgentContains('safari'); - - var phantom = userAgentContains('phantom'); - - // @property opera12: Boolean - // `true` for the Opera browser supporting CSS transforms (version 12 or later). - var opera12 = 'OTransition' in style; - - // @property win: Boolean; `true` when the browser is running in a Windows platform - var win = navigator.platform.indexOf('Win') === 0; - - // @property ie3d: Boolean; `true` for all Internet Explorer versions supporting CSS transforms. - var ie3d = ie && ('transition' in style); - - // @property webkit3d: Boolean; `true` for webkit-based browsers supporting CSS transforms. - var webkit3d = ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()) && !android23; - - // @property gecko3d: Boolean; `true` for gecko-based browsers supporting CSS transforms. - var gecko3d = 'MozPerspective' in style; - - // @property any3d: Boolean - // `true` for all browsers supporting CSS transforms. - var any3d = !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d) && !opera12 && !phantom; - - // @property mobile: Boolean; `true` for all browsers running in a mobile device. - var mobile = typeof orientation !== 'undefined' || userAgentContains('mobile'); - - // @property mobileWebkit: Boolean; `true` for all webkit-based browsers in a mobile device. - var mobileWebkit = mobile && webkit; - - // @property mobileWebkit3d: Boolean - // `true` for all webkit-based browsers in a mobile device supporting CSS transforms. - var mobileWebkit3d = mobile && webkit3d; - - // @property msPointer: Boolean - // `true` for browsers implementing the Microsoft touch events model (notably IE10). - var msPointer = !window.PointerEvent && window.MSPointerEvent; - - // @property pointer: Boolean - // `true` for all browsers supporting [pointer events](https://msdn.microsoft.com/en-us/library/dn433244%28v=vs.85%29.aspx). - var pointer = !!(window.PointerEvent || msPointer); - - // @property touchNative: Boolean - // `true` for all browsers supporting [touch events](https://developer.mozilla.org/docs/Web/API/Touch_events). - // **This does not necessarily mean** that the browser is running in a computer with - // a touchscreen, it only means that the browser is capable of understanding - // touch events. - var touchNative = 'ontouchstart' in window || !!window.TouchEvent; - - // @property touch: Boolean - // `true` for all browsers supporting either [touch](#browser-touch) or [pointer](#browser-pointer) events. - // Note: pointer events will be preferred (if available), and processed for all `touch*` listeners. - var touch = !window.L_NO_TOUCH && (touchNative || pointer); - - // @property mobileOpera: Boolean; `true` for the Opera browser in a mobile device. - var mobileOpera = mobile && opera; - - // @property mobileGecko: Boolean - // `true` for gecko-based browsers running in a mobile device. - var mobileGecko = mobile && gecko; - - // @property retina: Boolean - // `true` for browsers on a high-resolution "retina" screen or on any screen when browser's display zoom is more than 100%. - var retina = (window.devicePixelRatio || (window.screen.deviceXDPI / window.screen.logicalXDPI)) > 1; - - // @property passiveEvents: Boolean - // `true` for browsers that support passive events. - var passiveEvents = (function () { - var supportsPassiveOption = false; - try { - var opts = Object.defineProperty({}, 'passive', { - get: function () { // eslint-disable-line getter-return - supportsPassiveOption = true; - } - }); - window.addEventListener('testPassiveEventSupport', falseFn, opts); - window.removeEventListener('testPassiveEventSupport', falseFn, opts); - } catch (e) { - // Errors can safely be ignored since this is only a browser support test. - } - return supportsPassiveOption; - }()); - - // @property canvas: Boolean - // `true` when the browser supports [``](https://developer.mozilla.org/docs/Web/API/Canvas_API). - var canvas$1 = (function () { - return !!document.createElement('canvas').getContext; - }()); - - // @property svg: Boolean - // `true` when the browser supports [SVG](https://developer.mozilla.org/docs/Web/SVG). - var svg$1 = !!(document.createElementNS && svgCreate('svg').createSVGRect); - - var inlineSvg = !!svg$1 && (function () { - var div = document.createElement('div'); - div.innerHTML = ''; - return (div.firstChild && div.firstChild.namespaceURI) === 'http://www.w3.org/2000/svg'; - })(); - - // @property vml: Boolean - // `true` if the browser supports [VML](https://en.wikipedia.org/wiki/Vector_Markup_Language). - var vml = !svg$1 && (function () { - try { - var div = document.createElement('div'); - div.innerHTML = ''; - - var shape = div.firstChild; - shape.style.behavior = 'url(#default#VML)'; - - return shape && (typeof shape.adj === 'object'); - - } catch (e) { - return false; - } - }()); - - - // @property mac: Boolean; `true` when the browser is running in a Mac platform - var mac = navigator.platform.indexOf('Mac') === 0; - - // @property mac: Boolean; `true` when the browser is running in a Linux platform - var linux = navigator.platform.indexOf('Linux') === 0; - - function userAgentContains(str) { - return navigator.userAgent.toLowerCase().indexOf(str) >= 0; - } - - - var Browser = { - ie: ie, - ielt9: ielt9, - edge: edge, - webkit: webkit, - android: android, - android23: android23, - androidStock: androidStock, - opera: opera, - chrome: chrome, - gecko: gecko, - safari: safari, - phantom: phantom, - opera12: opera12, - win: win, - ie3d: ie3d, - webkit3d: webkit3d, - gecko3d: gecko3d, - any3d: any3d, - mobile: mobile, - mobileWebkit: mobileWebkit, - mobileWebkit3d: mobileWebkit3d, - msPointer: msPointer, - pointer: pointer, - touch: touch, - touchNative: touchNative, - mobileOpera: mobileOpera, - mobileGecko: mobileGecko, - retina: retina, - passiveEvents: passiveEvents, - canvas: canvas$1, - svg: svg$1, - vml: vml, - inlineSvg: inlineSvg, - mac: mac, - linux: linux + DataField.prototype.__initDisabled = function() { + if (this._disabled && (this._disabled === true || this._disabled.call(this, this))) { + this.disable(); + } }; - /* - * Extends L.DomEvent to provide touch support for Internet Explorer and Windows-based devices. - */ + DataField.prototype.enable = function() { + this.removeClass("cui-data-field-disabled"); + this.callOnOthers("enable"); + return this; + }; - var POINTER_DOWN = Browser.msPointer ? 'MSPointerDown' : 'pointerdown'; - var POINTER_MOVE = Browser.msPointer ? 'MSPointerMove' : 'pointermove'; - var POINTER_UP = Browser.msPointer ? 'MSPointerUp' : 'pointerup'; - var POINTER_CANCEL = Browser.msPointer ? 'MSPointerCancel' : 'pointercancel'; - var pEvent = { - touchstart : POINTER_DOWN, - touchmove : POINTER_MOVE, - touchend : POINTER_UP, - touchcancel : POINTER_CANCEL + DataField.prototype.disable = function() { + this.addClass("cui-data-field-disabled"); + this.callOnOthers("disable"); + return this; }; - var handle = { - touchstart : _onPointerStart, - touchmove : _handlePointer, - touchend : _handlePointer, - touchcancel : _handlePointer + + DataField.prototype.isDisabled = function() { + return this.hasClass("cui-data-field-disabled"); }; - var _pointers = {}; - var _pointerDocListener = false; - // Provides a touch events wrapper for (ms)pointer events. - // ref https://www.w3.org/TR/pointerevents/ https://www.w3.org/Bugs/Public/show_bug.cgi?id=22890 + DataField.prototype.isHidden = function() { + return this.hasClass("cui-data-field-hidden"); + }; - function addPointerListener(obj, type, handler) { - if (type === 'touchstart') { - _addPointerDocListener(); - } - if (!handle[type]) { - console.warn('wrong event specified:', type); - return falseFn; - } - handler = handle[type].bind(this, handler); - obj.addEventListener(pEvent[type], handler, false); - return handler; - } + DataField.prototype.isShown = function() { + return !this.isHidden(); + }; - function removePointerListener(obj, type, handler) { - if (!pEvent[type]) { - console.warn('wrong event specified:', type); - return; - } - obj.removeEventListener(pEvent[type], handler, false); - } + DataField.prototype.updateData = function(data) { + if (CUI.util.isFunction(this._data)) { + this.__data = this._data.call(this, data, this); + } else { + this.__data = data; + } + return this.displayValue(); + }; - function _globalPointerDown(e) { - _pointers[e.pointerId] = e; - } + DataField.prototype.unsetData = function() { + delete this.__data; + if (this.setDataOnOthers()) { + this.callOnOthers("unsetData"); + } + }; - function _globalPointerMove(e) { - if (_pointers[e.pointerId]) { - _pointers[e.pointerId] = e; - } - } + DataField.prototype.setData = function(data, init_data) { + var ref; + if (init_data == null) { + init_data = true; + } + if (this.__data && this._data && !CUI.util.isFunction(this._data)) { + return; + } + CUI.util.assert(!this.__data, this + ".setData", "data is already set.", { + opts: this.opts, + data: this.__data + }); + if (CUI.util.isFunction(this._data)) { + this.__data = this._data.call(this, data, this); + } else { + this.__data = data; + } + CUI.util.assert(CUI.util.isPlainObject(this.__data) || ((ref = this.__data) != null ? typeof ref.hasOwnProperty === "function" ? ref.hasOwnProperty(this.getName()) : void 0 : void 0), this + ".setData", "data needs to be PlainObject or have a property \"" + (this.getName()) + "\".", { + data: data, + opts: this.opts + }); + if (this.setDataOnOthers()) { + this.callOnOthers("setData", this.__data, init_data); + } + if (init_data) { + this.initData(); + } + return this; + }; - function _globalPointerUp(e) { - delete _pointers[e.pointerId]; - } + DataField.prototype.setDataOnOthers = function() { + return !this._data_not_for_others; + }; - function _addPointerDocListener() { - // need to keep track of what pointers and how many are active to provide e.touches emulation - if (!_pointerDocListener) { - // we listen document as any drags that end by moving the touch off the screen get fired there - document.addEventListener(POINTER_DOWN, _globalPointerDown, true); - document.addEventListener(POINTER_MOVE, _globalPointerMove, true); - document.addEventListener(POINTER_UP, _globalPointerUp, true); - document.addEventListener(POINTER_CANCEL, _globalPointerUp, true); + DataField.prototype.hide = function(trigger_event) { + if (trigger_event == null) { + trigger_event = false; + } + this.addClass("cui-data-field-hidden"); + this.callOnOthers("hide"); + if (trigger_event) { + CUI.Events.trigger({ + type: "form-check-row-visibility", + node: this.DOM, + info: { + element: this + } + }); + } + return this; + }; - _pointerDocListener = true; - } - } + DataField.prototype.show = function(trigger_event) { + if (trigger_event == null) { + trigger_event = false; + } + this.removeClass("cui-data-field-hidden"); + this.callOnOthers("show"); + if (trigger_event) { + CUI.Events.trigger({ + type: "form-check-row-visibility", + node: this.DOM, + info: { + element: this + } + }); + } + return this; + }; - function _handlePointer(handler, e) { - if (e.pointerType === (e.MSPOINTER_TYPE_MOUSE || 'mouse')) { return; } + DataField.prototype.isRendered = function() { + return this.__isRendered; + }; - e.touches = []; - for (var i in _pointers) { - e.touches.push(_pointers[i]); - } - e.changedTouches = [e]; + DataField.prototype.render = function(arg) { + var callOnRender, ref; + callOnRender = (ref = (arg != null ? arg : {}).callOnRender) != null ? ref : true; + CUI.util.assert(!this.__isRendered, this.__cls + ".render", "Cannot be called when already rendered.", { + opts: this.opts, + dataField: this + }); + this.__isRendered = true; + this.callOnOthers("render"); + if (this.isDisabled()) { + this.disable(); + } + if (this.isHidden()) { + this.hide(true); + } + if (callOnRender) { + if (typeof this._onRender === "function") { + this._onRender(this); + } + } + return this; + }; - handler(e); - } + DataField.prototype.displayValue = function() { + CUI.util.assert(!this.isDestroyed(), this.__cls + ".displayValue", "DataField already destroyed, cannot display value.", { + data_field: this + }); + CUI.util.assert(this.__isRendered, this.__cls + ".displayValue", "not rendered yet, cannot display.", { + opts: this.opts, + data: this.__data + }); + this.checkChanged(); + return this.callOnOthers("displayValue"); + }; - function _onPointerStart(handler, e) { - // IE10 specific: MsTouch needs preventDefault. See #2000 - if (e.MSPOINTER_TYPE_TOUCH && e.pointerType === e.MSPOINTER_TYPE_TOUCH) { - preventDefault(e); - } - _handlePointer(handler, e); - } + DataField.prototype.start = function() { + CUI.util.assert(!this.__isRendered, this.__cls + ".start", "Cannot be called when already rendered.", { + opts: this.opts, + dataField: this + }); + this.__initDisabled(); + this.render(); + this.displayValue(); + return this; + }; - /* - * Extends the event handling code with double tap support for mobile browsers. - * - * Note: currently most browsers fire native dblclick, with only a few exceptions - * (see https://github.com/Leaflet/Leaflet/issues/7012#issuecomment-595087386) - */ - - function makeDblclick(event) { - // in modern browsers `type` cannot be just overridden: - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only - var newEvent = {}, - prop, i; - for (i in event) { - prop = event[i]; - newEvent[i] = prop && prop.bind ? prop.bind(event) : prop; - } - event = newEvent; - newEvent.type = 'dblclick'; - newEvent.detail = 2; - newEvent.isTrusted = false; - newEvent._simulated = true; // for debug purposes - return newEvent; - } - - var delay = 200; - function addDoubleTapListener(obj, handler) { - // Most browsers handle double tap natively - obj.addEventListener('dblclick', handler); - - // On some platforms the browser doesn't fire native dblclicks for touch events. - // It seems that in all such cases `detail` property of `click` event is always `1`. - // So here we rely on that fact to avoid excessive 'dblclick' simulation when not needed. - var last = 0, - detail; - function simDblclick(e) { - if (e.detail !== 1) { - detail = e.detail; // keep in sync to avoid false dblclick in some cases - return; - } - - if (e.pointerType === 'mouse' || - (e.sourceCapabilities && !e.sourceCapabilities.firesTouchEvents)) { - - return; - } - - // When clicking on an , the browser generates a click on its - //