ext-inline_autocomplete-2d9076b2.js 67 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. import{g as Q}from"./index-91b358e1.js";function q(B,K){for(var f=0;f<K.length;f++){const C=K[f];if(typeof C!="string"&&!Array.isArray(C)){for(const H in C)if(H!=="default"&&!(H in B)){const A=Object.getOwnPropertyDescriptor(C,H);A&&Object.defineProperty(B,H,A.get?A:{enumerable:!0,get:()=>C[H]})}}}return Object.freeze(Object.defineProperty(B,Symbol.toStringTag,{value:"Module"}))}var G={exports:{}};(function(B,K){ace.define("ace/snippets",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/editor"],function(f,C,H){var A=f("./lib/dom"),$=f("./lib/oop"),M=f("./lib/event_emitter").EventEmitter,S=f("./lib/lang"),b=f("./range").Range,T=f("./range_list").RangeList,_=f("./keyboard/hash_handler").HashHandler,L=f("./tokenizer").Tokenizer,O=f("./clipboard"),N={CURRENT_WORD:function(o){return o.session.getTextRange(o.session.getWordRange())},SELECTION:function(o,t,e){var n=o.session.getTextRange();return e?n.replace(/\n\r?([ \t]*\S)/g,`
  2. `+e+"$1"):n},CURRENT_LINE:function(o){return o.session.getLine(o.getCursorPosition().row)},PREV_LINE:function(o){return o.session.getLine(o.getCursorPosition().row-1)},LINE_INDEX:function(o){return o.getCursorPosition().row},LINE_NUMBER:function(o){return o.getCursorPosition().row+1},SOFT_TABS:function(o){return o.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(o){return o.session.getTabSize()},CLIPBOARD:function(o){return O.getText&&O.getText()},FILENAME:function(o){return/[^/\\]*$/.exec(this.FILEPATH(o))[0]},FILENAME_BASE:function(o){return/[^/\\]*$/.exec(this.FILEPATH(o))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(o){return this.FILEPATH(o).replace(/[^/\\]*$/,"")},FILEPATH:function(o){return"/not implemented.txt"},WORKSPACE_NAME:function(){return"Unknown"},FULLNAME:function(){return"Unknown"},BLOCK_COMMENT_START:function(o){var t=o.session.$mode||{};return t.blockComment&&t.blockComment.start||""},BLOCK_COMMENT_END:function(o){var t=o.session.$mode||{};return t.blockComment&&t.blockComment.end||""},LINE_COMMENT:function(o){var t=o.session.$mode||{};return t.lineCommentStart||""},CURRENT_YEAR:x.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:x.bind(null,{year:"2-digit"}),CURRENT_MONTH:x.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:x.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:x.bind(null,{month:"short"}),CURRENT_DATE:x.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:x.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:x.bind(null,{weekday:"short"}),CURRENT_HOUR:x.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:x.bind(null,{minute:"2-digit"}),CURRENT_SECOND:x.bind(null,{second:"2-digit"})};N.SELECTED_TEXT=N.SELECTION;function x(o){var t=new Date().toLocaleString("en-us",o);return t.length==1?"0"+t:t}var E=function(){function o(){this.snippetMap={},this.snippetNameMap={},this.variables=N}return o.prototype.getTokenizer=function(){return o.$tokenizer||this.createTokenizer()},o.prototype.createTokenizer=function(){function t(i){return i=i.substr(1),/^\d+$/.test(i)?[{tabstopId:parseInt(i,10)}]:[{text:i}]}function e(i){return"(?:[^\\\\"+i+"]|\\\\.)"}var n={regex:"/("+e("/")+"+)/",onMatch:function(i,a,l){var s=l[0];return s.fmtString=!0,s.guard=i.slice(1,-1),s.flag="",""},next:"formatString"};return o.$tokenizer=new L({start:[{regex:/\\./,onMatch:function(i,a,l){var s=i[1];return(s=="}"&&l.length||"`$\\".indexOf(s)!=-1)&&(i=s),[i]}},{regex:/}/,onMatch:function(i,a,l){return[l.length?l.shift():i]}},{regex:/\$(?:\d+|\w+)/,onMatch:t},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(i,a,l){var s=t(i.substr(1));return l.unshift(s[0]),s},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+e("\\|")+"*\\|",onMatch:function(i,a,l){var s=i.slice(1,-1).replace(/\\[,|\\]|,/g,function(d){return d.length==2?d[1]:"\0"}).split("\0").map(function(d){return{value:d}});return l[0].choices=s,[s[0]]},next:"start"},n,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(i,a,l){return l.length&&l[0].expectElse?(l[0].expectElse=!1,l[0].ifEnd={elseEnd:l[0]},[l[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(i,a,l){var s=i[1];return s=="}"&&l.length||"`$\\".indexOf(s)!=-1?i=s:s=="n"?i=`
  3. `:s=="t"?i=" ":"ulULE".indexOf(s)!=-1&&(i={changeCase:s,local:s>"a"}),[i]}},{regex:"/\\w*}",onMatch:function(i,a,l){var s=l.shift();return s&&(s.flag=i.slice(1,-1)),this.next=s&&s.tabstopId?"start":"",[s||i]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(i,a,l){return[{text:i.slice(1)}]}},{regex:/\${\w+/,onMatch:function(i,a,l){var s={text:i.slice(2)};return l.unshift(s),[s]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(i,a,l){var s=l.shift();return this.next=s&&s.tabstopId?"start":"",[s||i]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(i,a,l){var s=l[0];return s.formatFunction=i.slice(2,-1),[l.shift()]},next:"formatString"},n,{regex:/:[\?\-+]?/,onMatch:function(i,a,l){i[1]=="+"&&(l[0].ifEnd=l[0]),i[1]=="?"&&(l[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]}),o.$tokenizer},o.prototype.tokenizeTmSnippet=function(t,e){return this.getTokenizer().getLineTokens(t,e).tokens.map(function(n){return n.value||n})},o.prototype.getVariableValue=function(t,e,n){if(/^\d+$/.test(e))return(this.variables.__||{})[e]||"";if(/^[A-Z]\d+$/.test(e))return(this.variables[e[0]+"__"]||{})[e.substr(1)]||"";if(e=e.replace(/^TM_/,""),!this.variables.hasOwnProperty(e))return"";var i=this.variables[e];return typeof i=="function"&&(i=this.variables[e](t,e,n)),i??""},o.prototype.tmStrFormat=function(t,e,n){if(!e.fmt)return t;var i=e.flag||"",a=e.guard;a=new RegExp(a,i.replace(/[^gim]/g,""));var l=typeof e.fmt=="string"?this.tokenizeTmSnippet(e.fmt,"formatString"):e.fmt,s=this,d=t.replace(a,function(){var h=s.variables.__;s.variables.__=[].slice.call(arguments);for(var g=s.resolveVariables(l,n),m="E",y=0;y<g.length;y++){var v=g[y];if(typeof v=="object")if(g[y]="",v.changeCase&&v.local){var w=g[y+1];w&&typeof w=="string"&&(v.changeCase=="u"?g[y]=w[0].toUpperCase():g[y]=w[0].toLowerCase(),g[y+1]=w.substr(1))}else v.changeCase&&(m=v.changeCase);else m=="U"?g[y]=v.toUpperCase():m=="L"&&(g[y]=v.toLowerCase())}return s.variables.__=h,g.join("")});return d},o.prototype.tmFormatFunction=function(t,e,n){return e.formatFunction=="upcase"?t.toUpperCase():e.formatFunction=="downcase"?t.toLowerCase():t},o.prototype.resolveVariables=function(t,e){for(var n=[],i="",a=!0,l=0;l<t.length;l++){var s=t[l];if(typeof s=="string"){n.push(s),s==`
  4. `?(a=!0,i=""):a&&(i=/^\t*/.exec(s)[0],a=/\S/.test(s));continue}if(s){if(a=!1,s.fmtString){var d=t.indexOf(s,l+1);d==-1&&(d=t.length),s.fmt=t.slice(l+1,d),l=d}if(s.text){var h=this.getVariableValue(e,s.text,i)+"";s.fmtString&&(h=this.tmStrFormat(h,s,e)),s.formatFunction&&(h=this.tmFormatFunction(h,s,e)),h&&!s.ifEnd?(n.push(h),g(s)):!h&&s.ifEnd&&g(s.ifEnd)}else s.elseEnd?g(s.elseEnd):(s.tabstopId!=null||s.changeCase!=null)&&n.push(s)}}function g(m){var y=t.indexOf(m,l+1);y!=-1&&(l=y)}return n},o.prototype.getDisplayTextForSnippet=function(t,e){var n=k.call(this,t,e);return n.text},o.prototype.insertSnippetForSelection=function(t,e,n){n===void 0&&(n={});var i=k.call(this,t,e,n),a=t.getSelectionRange();n.range&&n.range.compareRange(a)===0&&(a=n.range);var l=t.session.replace(a,i.text),s=new r(t),d=t.inVirtualSelectionMode&&t.selection.index;s.addTabstops(i.tabstops,a.start,l,d)},o.prototype.insertSnippet=function(t,e,n){n===void 0&&(n={});var i=this;if(n.range&&!(n.range instanceof b)&&(n.range=b.fromPoints(n.range.start,n.range.end)),t.inVirtualSelectionMode)return i.insertSnippetForSelection(t,e,n);t.forEachSelection(function(){i.insertSnippetForSelection(t,e,n)},null,{keepOrder:!0}),t.tabstopManager&&t.tabstopManager.tabNext()},o.prototype.$getScope=function(t){var e=t.session.$mode.$id||"";if(e=e.split("/").pop(),e==="html"||e==="php"){e==="php"&&!t.session.$mode.inlinePhp&&(e="html");var n=t.getCursorPosition(),i=t.session.getState(n.row);typeof i=="object"&&(i=i[0]),i.substring&&(i.substring(0,3)=="js-"?e="javascript":i.substring(0,4)=="css-"?e="css":i.substring(0,4)=="php-"&&(e="php"))}return e},o.prototype.getActiveScopes=function(t){var e=this.$getScope(t),n=[e],i=this.snippetMap;return i[e]&&i[e].includeScopes&&n.push.apply(n,i[e].includeScopes),n.push("_"),n},o.prototype.expandWithTab=function(t,e){var n=this,i=t.forEachSelection(function(){return n.expandSnippetForSelection(t,e)},null,{keepOrder:!0});return i&&t.tabstopManager&&t.tabstopManager.tabNext(),i},o.prototype.expandSnippetForSelection=function(t,e){var n=t.getCursorPosition(),i=t.session.getLine(n.row),a=i.substring(0,n.column),l=i.substr(n.column),s=this.snippetMap,d;return this.getActiveScopes(t).some(function(h){var g=s[h];return g&&(d=this.findMatchingSnippet(g,a,l)),!!d},this),d?(e&&e.dryRun||(t.session.doc.removeInLine(n.row,n.column-d.replaceBefore.length,n.column+d.replaceAfter.length),this.variables.M__=d.matchBefore,this.variables.T__=d.matchAfter,this.insertSnippetForSelection(t,d.content),this.variables.M__=this.variables.T__=null),!0):!1},o.prototype.findMatchingSnippet=function(t,e,n){for(var i=t.length;i--;){var a=t[i];if(!(a.startRe&&!a.startRe.test(e))&&!(a.endRe&&!a.endRe.test(n))&&!(!a.startRe&&!a.endRe))return a.matchBefore=a.startRe?a.startRe.exec(e):[""],a.matchAfter=a.endRe?a.endRe.exec(n):[""],a.replaceBefore=a.triggerRe?a.triggerRe.exec(e)[0]:"",a.replaceAfter=a.endTriggerRe?a.endTriggerRe.exec(n)[0]:"",a}},o.prototype.register=function(t,e){var n=this.snippetMap,i=this.snippetNameMap,a=this;t||(t=[]);function l(h){return h&&!/^\^?\(.*\)\$?$|^\\b$/.test(h)&&(h="(?:"+h+")"),h||""}function s(h,g,m){return h=l(h),g=l(g),m?(h=g+h,h&&h[h.length-1]!="$"&&(h=h+"$")):(h=h+g,h&&h[0]!="^"&&(h="^"+h)),new RegExp(h)}function d(h){h.scope||(h.scope=e||"_"),e=h.scope,n[e]||(n[e]=[],i[e]={});var g=i[e];if(h.name){var m=g[h.name];m&&a.unregister(m),g[h.name]=h}n[e].push(h),h.prefix&&(h.tabTrigger=h.prefix),!h.content&&h.body&&(h.content=Array.isArray(h.body)?h.body.join(`
  5. `):h.body),h.tabTrigger&&!h.trigger&&(!h.guard&&/^\w/.test(h.tabTrigger)&&(h.guard="\\b"),h.trigger=S.escapeRegExp(h.tabTrigger)),!(!h.trigger&&!h.guard&&!h.endTrigger&&!h.endGuard)&&(h.startRe=s(h.trigger,h.guard,!0),h.triggerRe=new RegExp(h.trigger),h.endRe=s(h.endTrigger,h.endGuard,!0),h.endTriggerRe=new RegExp(h.endTrigger))}Array.isArray(t)?t.forEach(d):Object.keys(t).forEach(function(h){d(t[h])}),this._signal("registerSnippets",{scope:e})},o.prototype.unregister=function(t,e){var n=this.snippetMap,i=this.snippetNameMap;function a(l){var s=i[l.scope||e];if(s&&s[l.name]){delete s[l.name];var d=n[l.scope||e],h=d&&d.indexOf(l);h>=0&&d.splice(h,1)}}t.content?a(t):Array.isArray(t)&&t.forEach(a)},o.prototype.parseSnippetFile=function(t){t=t.replace(/\r/g,"");for(var e=[],n={},i=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm,a;a=i.exec(t);){if(a[1])try{n=JSON.parse(a[1]),e.push(n)}catch{}if(a[4])n.content=a[4].replace(/^\t/gm,""),e.push(n),n={};else{var l=a[2],s=a[3];if(l=="regex"){var d=/\/((?:[^\/\\]|\\.)*)|$/g;n.guard=d.exec(s)[1],n.trigger=d.exec(s)[1],n.endTrigger=d.exec(s)[1],n.endGuard=d.exec(s)[1]}else l=="snippet"?(n.tabTrigger=s.match(/^\S*/)[0],n.name||(n.name=s)):l&&(n[l]=s)}}return e},o.prototype.getSnippetByName=function(t,e){var n=this.snippetNameMap,i;return this.getActiveScopes(e).some(function(a){var l=n[a];return l&&(i=l[t]),!!i},this),i},o}();$.implement(E.prototype,M);var k=function(o,t,e){e===void 0&&(e={});var n=o.getCursorPosition(),i=o.session.getLine(n.row),a=o.session.getTabString(),l=i.match(/^\s*/)[0];n.column<l.length&&(l=l.slice(0,n.column)),t=t.replace(/\r/g,"");var s=this.tokenizeTmSnippet(t);s=this.resolveVariables(s,o),s=s.map(function(R){return R==`
  6. `&&!e.excludeExtraIndent?R+l:typeof R=="string"?R.replace(/\t/g,a):R});var d=[];s.forEach(function(R,F){if(typeof R=="object"){var U=R.tabstopId,P=d[U];if(P||(P=d[U]=[],P.index=U,P.value="",P.parents={}),P.indexOf(R)===-1){R.choices&&!P.choices&&(P.choices=R.choices),P.push(R);var W=s.indexOf(R,F+1);if(W!==-1){var j=s.slice(F+1,W),X=j.some(function(J){return typeof J=="object"});X&&!P.value?P.value=j:j.length&&(!P.value||typeof P.value!="string")&&(P.value=j.join(""))}}}}),d.forEach(function(R){R.length=0});var h={};function g(R){for(var F=[],U=0;U<R.length;U++){var P=R[U];if(typeof P=="object"){if(h[P.tabstopId])continue;var W=R.lastIndexOf(P,U-1);P=F[W]||{tabstopId:P.tabstopId}}F[U]=P}return F}for(var m=0;m<s.length;m++){var y=s[m];if(typeof y=="object"){var v=y.tabstopId,w=d[v],D=s.indexOf(y,m+1);if(h[v]){h[v]===y&&(delete h[v],Object.keys(h).forEach(function(R){w.parents[R]=!0}));continue}h[v]=y;var I=w.value;typeof I!="string"?I=g(I):y.fmt&&(I=this.tmStrFormat(I,y,o)),s.splice.apply(s,[m+1,Math.max(0,D-m)].concat(I,y)),w.indexOf(y)===-1&&w.push(y)}}var z=0,V=0,Z="";return s.forEach(function(R){if(typeof R=="string"){var F=R.split(`
  7. `);F.length>1?(V=F[F.length-1].length,z+=F.length-1):V+=R.length,Z+=R}else R&&(R.start?R.end={row:z,column:V}:R.start={row:z,column:V})}),{text:Z,tabstops:d,tokens:s}},r=function(){function o(t){if(this.index=0,this.ranges=[],this.tabstops=[],t.tabstopManager)return t.tabstopManager;t.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=S.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(t)}return o.prototype.attach=function(t){this.$openTabstops=null,this.selectedTabstop=null,this.editor=t,this.session=t.session,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},o.prototype.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges.length=0,this.tabstops.length=0,this.selectedTabstop=null,this.editor.off("change",this.$onChange),this.editor.off("changeSelection",this.$onChangeSelection),this.editor.off("changeSession",this.$onChangeSession),this.editor.commands.off("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.session=null,this.editor=null},o.prototype.onChange=function(t){for(var e=t.action[0]=="r",n=this.selectedTabstop||{},i=n.parents||{},a=this.tabstops.slice(),l=0;l<a.length;l++){var s=a[l],d=s==n||i[s.index];if(s.rangeList.$bias=d?0:1,t.action=="remove"&&s!==n){var h=s.parents&&s.parents[n.index],g=s.rangeList.pointIndex(t.start,h);g=g<0?-g-1:g+1;var m=s.rangeList.pointIndex(t.end,h);m=m<0?-m-1:m-1;for(var y=s.rangeList.ranges.slice(g,m),v=0;v<y.length;v++)this.removeRange(y[v])}s.rangeList.$onChange(t)}var w=this.session;!this.$inChange&&e&&w.getLength()==1&&!w.getValue()&&this.detach()},o.prototype.updateLinkedFields=function(){var t=this.selectedTabstop;if(!(!t||!t.hasLinkedRanges||!t.firstNonLinked)){this.$inChange=!0;for(var e=this.session,n=e.getTextRange(t.firstNonLinked),i=0;i<t.length;i++){var a=t[i];if(a.linked){var l=a.original,s=C.snippetManager.tmStrFormat(n,l,this.editor);e.replace(a,s)}}this.$inChange=!1}},o.prototype.onAfterExec=function(t){t.command&&!t.command.readOnly&&this.updateLinkedFields()},o.prototype.onChangeSelection=function(){if(this.editor){for(var t=this.editor.selection.lead,e=this.editor.selection.anchor,n=this.editor.selection.isEmpty(),i=0;i<this.ranges.length;i++)if(!this.ranges[i].linked){var a=this.ranges[i].contains(t.row,t.column),l=n||this.ranges[i].contains(e.row,e.column);if(a&&l)return}this.detach()}},o.prototype.onChangeSession=function(){this.detach()},o.prototype.tabNext=function(t){var e=this.tabstops.length,n=this.index+(t||1);n=Math.min(Math.max(n,1),e),n==e&&(n=0),this.selectTabstop(n),n===0&&this.detach()},o.prototype.selectTabstop=function(t){this.$openTabstops=null;var e=this.tabstops[this.index];if(e&&this.addTabstopMarkers(e),this.index=t,e=this.tabstops[this.index],!(!e||!e.length)){this.selectedTabstop=e;var n=e.firstNonLinked||e;if(e.choices&&(n.cursor=n.start),this.editor.inVirtualSelectionMode)this.editor.selection.fromOrientedRange(n);else{var i=this.editor.multiSelect;i.toSingleRange(n);for(var a=0;a<e.length;a++)e.hasLinkedRanges&&e[a].linked||i.addRange(e[a].clone(),!0)}this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler),this.selectedTabstop&&this.selectedTabstop.choices&&this.editor.execCommand("startAutocomplete",{matches:this.selectedTabstop.choices})}},o.prototype.addTabstops=function(t,e,n){var i=this.useLink||!this.editor.getOption("enableMultiselect");if(this.$openTabstops||(this.$openTabstops=[]),!t[0]){var a=b.fromPoints(n,n);u(a.start,e),u(a.end,e),t[0]=[a],t[0].index=0}var l=this.index,s=[l+1,0],d=this.ranges;t.forEach(function(h,g){for(var m=this.$openTabstops[g]||h,y=0;y<h.length;y++){var v=h[y],w=b.fromPoints(v.start,v.end||v.start);c(w.start,e),c(w.end,e),w.original=v,w.tabstop=m,d.push(w),m!=h?m.unshift(w):m[y]=w,v.fmtString||m.firstNonLinked&&i?(w.linked=!0,m.hasLinkedRanges=!0):m.firstNonLinked||(m.firstNonLinked=w)}m.firstNonLinked||(m.hasLinkedRanges=!1),m===h&&(s.push(m),this.$openTabstops[g]=m),this.addTabstopMarkers(m),m.rangeList=m.rangeList||new T,m.rangeList.$bias=0,m.rangeList.addList(m)},this),s.length>2&&(this.tabstops.length&&s.push(s.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,s))},o.prototype.addTabstopMarkers=function(t){var e=this.session;t.forEach(function(n){n.markerId||(n.markerId=e.addMarker(n,"ace_snippet-marker","text"))})},o.prototype.removeTabstopMarkers=function(t){var e=this.session;t.forEach(function(n){e.removeMarker(n.markerId),n.markerId=null})},o.prototype.removeRange=function(t){var e=t.tabstop.indexOf(t);e!=-1&&t.tabstop.splice(e,1),e=this.ranges.indexOf(t),e!=-1&&this.ranges.splice(e,1),e=t.tabstop.rangeList.ranges.indexOf(t),e!=-1&&t.tabstop.splice(e,1),this.session.removeMarker(t.markerId),t.tabstop.length||(e=this.tabstops.indexOf(t.tabstop),e!=-1&&this.tabstops.splice(e,1),this.tabstops.length||this.detach())},o}();r.prototype.keyboardHandler=new _,r.prototype.keyboardHandler.bindKeys({Tab:function(o){C.snippetManager&&C.snippetManager.expandWithTab(o)||(o.tabstopManager.tabNext(1),o.renderer.scrollCursorIntoView())},"Shift-Tab":function(o){o.tabstopManager.tabNext(-1),o.renderer.scrollCursorIntoView()},Esc:function(o){o.tabstopManager.detach()}});var c=function(o,t){o.row==0&&(o.column+=t.column),o.row+=t.row},u=function(o,t){o.row==t.row&&(o.column-=t.column),o.row-=t.row};A.importCssString(`
  8. .ace_snippet-marker {
  9. -moz-box-sizing: border-box;
  10. box-sizing: border-box;
  11. background: rgba(194, 193, 208, 0.09);
  12. border: 1px dotted rgba(211, 208, 235, 0.62);
  13. position: absolute;
  14. }`,"snippets.css",!1),C.snippetManager=new E;var p=f("./editor").Editor;(function(){this.insertSnippet=function(o,t){return C.snippetManager.insertSnippet(this,o,t)},this.expandSnippet=function(o){return C.snippetManager.expandWithTab(this,o)}}).call(p.prototype)}),ace.define("ace/autocomplete/inline",["require","exports","module","ace/snippets"],function(f,C,H){var A=f("../snippets").snippetManager,$=function(){function M(){this.editor=null}return M.prototype.show=function(S,b,T){if(T=T||"",S&&this.editor&&this.editor!==S&&(this.hide(),this.editor=null),!S||!b)return!1;var _=b.snippet?A.getDisplayTextForSnippet(S,b.snippet):b.value;return!_||!_.startsWith(T)?!1:(this.editor=S,_=_.slice(T.length),_===""?S.removeGhostText():S.setGhostText(_),!0)},M.prototype.isOpen=function(){return this.editor?!!this.editor.renderer.$ghostText:!1},M.prototype.hide=function(){return this.editor?(this.editor.removeGhostText(),!0):!1},M.prototype.destroy=function(){this.hide(),this.editor=null},M}();C.AceInline=$}),ace.define("ace/autocomplete/popup",["require","exports","module","ace/virtual_renderer","ace/editor","ace/range","ace/lib/event","ace/lib/lang","ace/lib/dom","ace/config"],function(f,C,H){var A=f("../virtual_renderer").VirtualRenderer,$=f("../editor").Editor,M=f("../range").Range,S=f("../lib/event"),b=f("../lib/lang"),T=f("../lib/dom"),_=f("../config").nls,L=function(x){return"suggest-aria-id:".concat(x)},O=function(x){var E=new A(x);E.$maxLines=4;var k=new $(E);return k.setHighlightActiveLine(!1),k.setShowPrintMargin(!1),k.renderer.setShowGutter(!1),k.renderer.setHighlightGutterLine(!1),k.$mouseHandler.$focusTimeout=0,k.$highlightTagPending=!0,k},N=function(){function x(E){var k=T.createElement("div"),r=new O(k);E&&E.appendChild(k),k.style.display="none",r.renderer.content.style.cursor="default",r.renderer.setStyle("ace_autocomplete"),r.renderer.container.setAttribute("role","listbox"),r.renderer.container.setAttribute("aria-label",_("Autocomplete suggestions")),r.setOption("displayIndentGuides",!1),r.setOption("dragDelay",150);var c=function(){};r.focus=c,r.$isFocused=!0,r.renderer.$cursorLayer.restartTimer=c,r.renderer.$cursorLayer.element.style.opacity=0,r.renderer.$maxLines=8,r.renderer.$keepTextAreaAtCursor=!1,r.setHighlightActiveLine(!1),r.session.highlight(""),r.session.$searchHighlight.clazz="ace_highlight-marker",r.on("mousedown",function(i){var a=i.getDocumentPosition();r.selection.moveToPosition(a),o.start.row=o.end.row=a.row,i.stop()});var u,p=new M(-1,0,-1,1/0),o=new M(-1,0,-1,1/0);o.id=r.session.addMarker(o,"ace_active-line","fullLine"),r.setSelectOnHover=function(i){i?p.id&&(r.session.removeMarker(p.id),p.id=null):p.id=r.session.addMarker(p,"ace_line-hover","fullLine")},r.setSelectOnHover(!1),r.on("mousemove",function(i){if(!u){u=i;return}if(!(u.x==i.x&&u.y==i.y)){u=i,u.scrollTop=r.renderer.scrollTop;var a=u.getDocumentPosition().row;p.start.row!=a&&(p.id||r.setRow(a),e(a))}}),r.renderer.on("beforeRender",function(){if(u&&p.start.row!=-1){u.$pos=null;var i=u.getDocumentPosition().row;p.id||r.setRow(i),e(i,!0)}}),r.renderer.on("afterRender",function(){var i=r.getRow(),a=r.renderer.$textLayer,l=a.element.childNodes[i-a.config.firstRow],s=document.activeElement;if(l!==a.selectedNode&&a.selectedNode&&(T.removeCssClass(a.selectedNode,"ace_selected"),s.removeAttribute("aria-activedescendant"),a.selectedNode.removeAttribute("id")),a.selectedNode=l,l){T.addCssClass(l,"ace_selected");var d=L(i);l.id=d,r.renderer.container.setAttribute("aria-activedescendant",d),s.setAttribute("aria-activedescendant",d),l.setAttribute("role","option"),l.setAttribute("aria-label",r.getData(i).value),l.setAttribute("aria-setsize",r.data.length),l.setAttribute("aria-posinset",i),l.setAttribute("aria-describedby","doc-tooltip")}});var t=function(){e(-1)},e=function(i,a){i!==p.start.row&&(p.start.row=p.end.row=i,a||r.session._emit("changeBackMarker"),r._emit("changeHoverMarker"))};r.getHoveredRow=function(){return p.start.row},S.addListener(r.container,"mouseout",t),r.on("hide",t),r.on("changeSelection",t),r.session.doc.getLength=function(){return r.data.length},r.session.doc.getLine=function(i){var a=r.data[i];return typeof a=="string"?a:a&&a.value||""};var n=r.session.bgTokenizer;return n.$tokenizeRow=function(i){var a=r.data[i],l=[];if(!a)return l;typeof a=="string"&&(a={value:a});var s=a.caption||a.value||a.name;function d(I,z){I&&l.push({type:(a.className||"")+(z||""),value:I})}for(var h=s.toLowerCase(),g=(r.filterText||"").toLowerCase(),m=0,y=0,v=0;v<=g.length;v++)if(v!=y&&(a.matchMask&1<<v||v==g.length)){var w=g.slice(y,v);y=v;var D=h.indexOf(w,m);if(D==-1)continue;d(s.slice(m,D),""),m=D+w.length,d(s.slice(D,m),"completion-highlight")}return d(s.slice(m,s.length),""),l.push({type:"completion-spacer",value:" "}),a.meta&&l.push({type:"completion-meta",value:a.meta}),a.message&&l.push({type:"completion-message",value:a.message}),l},n.$updateOnChange=c,n.start=c,r.session.$computeWidth=function(){return this.screenWidth=0},r.isOpen=!1,r.isTopdown=!1,r.autoSelect=!0,r.filterText="",r.data=[],r.setData=function(i,a){r.filterText=a||"",r.setValue(b.stringRepeat(`
  15. `,i.length),-1),r.data=i||[],r.setRow(0)},r.getData=function(i){return r.data[i]},r.getRow=function(){return o.start.row},r.setRow=function(i){i=Math.max(this.autoSelect?0:-1,Math.min(this.data.length-1,i)),o.start.row!=i&&(r.selection.clearSelection(),o.start.row=o.end.row=i||0,r.session._emit("changeBackMarker"),r.moveCursorTo(i||0,0),r.isOpen&&r._signal("select"))},r.on("changeSelection",function(){r.isOpen&&r.setRow(r.selection.lead.row),r.renderer.scrollCursorIntoView()}),r.hide=function(){this.container.style.display="none",r.anchorPos=null,r.anchor=null,r.isOpen&&(r.isOpen=!1,this._signal("hide"))},r.tryShow=function(i,a,l,s){if(!s&&r.isOpen&&r.anchorPos&&r.anchor&&r.anchorPos.top===i.top&&r.anchorPos.left===i.left&&r.anchor===l)return!0;var d=this.container,h=window.innerHeight,g=window.innerWidth,m=this.renderer,y=m.$maxLines*a*1.4,v={top:0,bottom:0,left:0},w=h-i.top-3*this.$borderSize-a,D=i.top-3*this.$borderSize;l||(D<=w||w>=y?l="bottom":l="top"),l==="top"?(v.bottom=i.top-this.$borderSize,v.top=v.bottom-y):l==="bottom"&&(v.top=i.top+a+this.$borderSize,v.bottom=v.top+y);var I=v.top>=0&&v.bottom<=h;if(!s&&!I)return!1;I?m.$maxPixelHeight=null:l==="top"?m.$maxPixelHeight=D:m.$maxPixelHeight=w,l==="top"?(d.style.top="",d.style.bottom=h-v.bottom+"px",r.isTopdown=!1):(d.style.top=v.top+"px",d.style.bottom="",r.isTopdown=!0),d.style.display="";var z=i.left;return z+d.offsetWidth>g&&(z=g-d.offsetWidth),d.style.left=z+"px",d.style.right="",r.isOpen||(r.isOpen=!0,this._signal("show"),u=null),r.anchorPos=i,r.anchor=l,!0},r.show=function(i,a,l){this.tryShow(i,a,l?"bottom":void 0,!0)},r.goTo=function(i){var a=this.getRow(),l=this.session.getLength()-1;switch(i){case"up":a=a<=0?l:a-1;break;case"down":a=a>=l?-1:a+1;break;case"start":a=0;break;case"end":a=l;break}this.setRow(a)},r.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},r.$imageSize=0,r.$borderSize=1,r}return x}();T.importCssString(`
  16. .ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {
  17. background-color: #CAD6FA;
  18. z-index: 1;
  19. }
  20. .ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {
  21. background-color: #3a674e;
  22. }
  23. .ace_editor.ace_autocomplete .ace_line-hover {
  24. border: 1px solid #abbffe;
  25. margin-top: -1px;
  26. background: rgba(233,233,253,0.4);
  27. position: absolute;
  28. z-index: 2;
  29. }
  30. .ace_dark.ace_editor.ace_autocomplete .ace_line-hover {
  31. border: 1px solid rgba(109, 150, 13, 0.8);
  32. background: rgba(58, 103, 78, 0.62);
  33. }
  34. .ace_completion-meta {
  35. opacity: 0.5;
  36. margin-left: 0.9em;
  37. }
  38. .ace_completion-message {
  39. color: blue;
  40. }
  41. .ace_editor.ace_autocomplete .ace_completion-highlight{
  42. color: #2d69c7;
  43. }
  44. .ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{
  45. color: #93ca12;
  46. }
  47. .ace_editor.ace_autocomplete {
  48. width: 300px;
  49. z-index: 200000;
  50. border: 1px lightgray solid;
  51. position: fixed;
  52. box-shadow: 2px 3px 5px rgba(0,0,0,.2);
  53. line-height: 1.4;
  54. background: #fefefe;
  55. color: #111;
  56. }
  57. .ace_dark.ace_editor.ace_autocomplete {
  58. border: 1px #484747 solid;
  59. box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);
  60. line-height: 1.4;
  61. background: #25282c;
  62. color: #c1c1c1;
  63. }
  64. .ace_autocomplete .ace_text-layer {
  65. width: calc(100% - 8px);
  66. }
  67. .ace_autocomplete .ace_line {
  68. display: flex;
  69. align-items: center;
  70. }
  71. .ace_autocomplete .ace_line > * {
  72. min-width: 0;
  73. flex: 0 0 auto;
  74. }
  75. .ace_autocomplete .ace_line .ace_ {
  76. flex: 0 1 auto;
  77. overflow: hidden;
  78. white-space: nowrap;
  79. text-overflow: ellipsis;
  80. }
  81. .ace_autocomplete .ace_completion-spacer {
  82. flex: 1;
  83. }
  84. `,"autocompletion.css",!1),C.AcePopup=N,C.$singleLineEditor=O,C.getAriaId=L}),ace.define("ace/autocomplete/util",["require","exports","module"],function(f,C,H){C.parForEach=function($,M,S){var b=0,T=$.length;T===0&&S();for(var _=0;_<T;_++)M($[_],function(L,O){b++,b===T&&S(L,O)})};var A=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;C.retrievePrecedingIdentifier=function($,M,S){S=S||A;for(var b=[],T=M-1;T>=0&&S.test($[T]);T--)b.push($[T]);return b.reverse().join("")},C.retrieveFollowingIdentifier=function($,M,S){S=S||A;for(var b=[],T=M;T<$.length&&S.test($[T]);T++)b.push($[T]);return b},C.getCompletionPrefix=function($){var M=$.getCursorPosition(),S=$.session.getLine(M.row),b;return $.completers.forEach(function(T){T.identifierRegexps&&T.identifierRegexps.forEach(function(_){!b&&_&&(b=this.retrievePrecedingIdentifier(S,M.column,_))}.bind(this))}.bind(this)),b||this.retrievePrecedingIdentifier(S,M.column)},C.triggerAutocomplete=function($){var M=$.getCursorPosition(),S=$.session.getLine(M.row),b=M.column===0?0:M.column-1,T=S[b];return $.completers.some(function(_){if(_.triggerCharacters&&Array.isArray(_.triggerCharacters))return _.triggerCharacters.includes(T)})}}),ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/inline","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config"],function(f,C,H){var A=f("./keyboard/hash_handler").HashHandler,$=f("./autocomplete/popup").AcePopup,M=f("./autocomplete/inline").AceInline,S=f("./autocomplete/popup").getAriaId,b=f("./autocomplete/util"),T=f("./lib/lang"),_=f("./lib/dom"),L=f("./snippets").snippetManager,O=f("./config"),N=function(r,c){c.completer&&c.completer.destroy()},x=function(){function r(){this.autoInsert=!1,this.autoSelect=!0,this.autoShown=!1,this.exactMatch=!1,this.inlineEnabled=!1,this.keyboardHandler=new A,this.keyboardHandler.bindKeys(this.commands),this.parentNode=null,this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.onLayoutChange=this.onLayoutChange.bind(this),this.changeTimer=T.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=T.delayedCall(this.updateDocTooltip.bind(this),50)}return r.prototype.$init=function(){return this.popup=new $(this.parentNode||document.body||document.documentElement),this.popup.on("click",function(c){this.insertMatch(),c.stop()}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on("show",this.$onPopupChange.bind(this)),this.popup.on("hide",this.$onHidePopup.bind(this)),this.popup.on("select",this.$onPopupChange.bind(this)),this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null)),this.popup},r.prototype.$initInline=function(){if(!(!this.inlineEnabled||this.inlineRenderer))return this.inlineRenderer=new M,this.inlineRenderer},r.prototype.getPopup=function(){return this.popup||this.$init()},r.prototype.$onHidePopup=function(){this.inlineRenderer&&this.inlineRenderer.hide(),this.hideDocTooltip()},r.prototype.$onPopupChange=function(c){if(this.inlineRenderer&&this.inlineEnabled){var u=c?null:this.popup.getData(this.popup.getRow()),p=b.getCompletionPrefix(this.editor);this.inlineRenderer.show(this.editor,u,p)||this.inlineRenderer.hide(),this.$updatePopupPosition()}this.tooltipTimer.call(null,null)},r.prototype.observeLayoutChanges=function(){if(!(this.$elements||!this.editor)){window.addEventListener("resize",this.onLayoutChange,{passive:!0}),window.addEventListener("wheel",this.mousewheelListener);for(var c=this.editor.container.parentNode,u=[];c;)u.push(c),c.addEventListener("scroll",this.onLayoutChange,{passive:!0}),c=c.parentNode;this.$elements=u}},r.prototype.unObserveLayoutChanges=function(){var c=this;window.removeEventListener("resize",this.onLayoutChange,{passive:!0}),window.removeEventListener("wheel",this.mousewheelListener),this.$elements&&this.$elements.forEach(function(u){u.removeEventListener("scroll",c.onLayoutChange,{passive:!0})}),this.$elements=null},r.prototype.onLayoutChange=function(){if(!this.popup.isOpen)return this.unObserveLayoutChanges();this.$updatePopupPosition(),this.updateDocTooltip()},r.prototype.$updatePopupPosition=function(){var c=this.editor,u=c.renderer,p=u.layerConfig.lineHeight,o=u.$cursorLayer.getPixelPosition(this.base,!0);o.left-=this.popup.getTextLeftOffset();var t=c.container.getBoundingClientRect();o.top+=t.top-u.layerConfig.offset,o.left+=t.left-c.renderer.scrollLeft,o.left+=u.gutterWidth;var e={top:o.top,left:o.left};u.$ghostText&&u.$ghostTextWidget&&this.base.row===u.$ghostText.position.row&&(e.top+=u.$ghostTextWidget.el.offsetHeight),!this.popup.tryShow(e,p,"bottom")&&(this.popup.tryShow(o,p,"top")||this.popup.show(o,p))},r.prototype.openPopup=function(c,u,p){this.popup||this.$init(),this.inlineEnabled&&!this.inlineRenderer&&this.$initInline(),this.popup.autoSelect=this.autoSelect,this.popup.setData(this.completions.filtered,this.completions.filterText),this.editor.textInput.setAriaOptions&&this.editor.textInput.setAriaOptions({activeDescendant:S(this.popup.getRow()),inline:this.inlineEnabled}),c.keyBinding.addKeyboardHandler(this.keyboardHandler),this.popup.setRow(this.autoSelect?0:-1),p?p&&!u&&this.detach():(this.popup.setTheme(c.getTheme()),this.popup.setFontSize(c.getFontSize()),this.$updatePopupPosition(),this.tooltipNode&&this.updateDocTooltip()),this.changeTimer.cancel(),this.observeLayoutChanges()},r.prototype.detach=function(){this.editor&&(this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener),this.editor.off("mousedown",this.mousedownListener),this.editor.off("mousewheel",this.mousewheelListener)),this.changeTimer.cancel(),this.hideDocTooltip(),this.completionProvider&&this.completionProvider.detach(),this.popup&&this.popup.isOpen&&this.popup.hide(),this.base&&this.base.detach(),this.activated=!1,this.completionProvider=this.completions=this.base=null,this.unObserveLayoutChanges()},r.prototype.changeListener=function(c){var u=this.editor.selection.lead;(u.row!=this.base.row||u.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach()},r.prototype.blurListener=function(c){var u=document.activeElement,p=this.editor.textInput.getElement(),o=c.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(c.relatedTarget),t=this.popup&&this.popup.container;u!=p&&u.parentNode!=t&&!o&&u!=this.tooltipNode&&c.relatedTarget!=p&&this.detach()},r.prototype.mousedownListener=function(c){this.detach()},r.prototype.mousewheelListener=function(c){this.detach()},r.prototype.goTo=function(c){this.popup.goTo(c)},r.prototype.insertMatch=function(c,u){if(c||(c=this.popup.getData(this.popup.getRow())),!c)return!1;if(c.value==="")return this.detach();var p=this.completions,o=this.getCompletionProvider().insertMatch(this.editor,c,p.filterText,u);return this.completions==p&&this.detach(),o},r.prototype.showPopup=function(c,u){this.editor&&this.detach(),this.activated=!0,this.editor=c,c.completer!=this&&(c.completer&&c.completer.detach(),c.completer=this),c.on("changeSelection",this.changeListener),c.on("blur",this.blurListener),c.on("mousedown",this.mousedownListener),c.on("mousewheel",this.mousewheelListener),this.updateCompletions(!1,u)},r.prototype.getCompletionProvider=function(){return this.completionProvider||(this.completionProvider=new E),this.completionProvider},r.prototype.gatherCompletions=function(c,u){return this.getCompletionProvider().gatherCompletions(c,u)},r.prototype.updateCompletions=function(c,u){if(c&&this.base&&this.completions){var o=this.editor.getCursorPosition(),t=this.editor.session.getTextRange({start:this.base,end:o});if(t==this.completions.filterText)return;if(this.completions.setFilter(t),!this.completions.filtered.length)return this.detach();if(this.completions.filtered.length==1&&this.completions.filtered[0].value==t&&!this.completions.filtered[0].snippet)return this.detach();this.openPopup(this.editor,t,c);return}if(u&&u.matches){var o=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(o.row,o.column),this.base.$insertRight=!0,this.completions=new k(u.matches),this.openPopup(this.editor,"",c)}var p=this.editor.getSession(),o=this.editor.getCursorPosition(),t=b.getCompletionPrefix(this.editor);this.base=p.doc.createAnchor(o.row,o.column-t.length),this.base.$insertRight=!0;var e={exactMatch:this.exactMatch};this.getCompletionProvider().provideCompletions(this.editor,e,function(n,i,a){var l=i.filtered,s=b.getCompletionPrefix(this.editor);if(a){if(!l.length){var d=!this.autoShown&&this.emptyMessage;if(typeof d=="function"&&(d=this.emptyMessage(s)),d){var h=[{caption:this.emptyMessage(s),value:""}];this.completions=new k(h),this.openPopup(this.editor,s,c);return}return this.detach()}if(l.length==1&&l[0].value==s&&!l[0].snippet)return this.detach();if(this.autoInsert&&!this.autoShown&&l.length==1)return this.insertMatch(l[0])}this.completions=i,this.openPopup(this.editor,s,c)}.bind(this))},r.prototype.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},r.prototype.updateDocTooltip=function(){var c=this.popup,u=c.data,p=u&&(u[c.getHoveredRow()]||u[c.getRow()]),o=null;if(!p||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();for(var t=this.editor.completers.length,e=0;e<t;e++){var n=this.editor.completers[e];if(n.getDocTooltip&&p.completerId===n.id){o=n.getDocTooltip(p);break}}if(!o&&typeof p!="string"&&(o=p),typeof o=="string"&&(o={docText:o}),!o||!(o.docHTML||o.docText))return this.hideDocTooltip();this.showDocTooltip(o)},r.prototype.showDocTooltip=function(c){this.tooltipNode||(this.tooltipNode=_.createElement("div"),this.tooltipNode.style.margin=0,this.tooltipNode.style.pointerEvents="auto",this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this),this.tooltipNode.id="doc-tooltip",this.tooltipNode.setAttribute("role","tooltip"));var u=this.editor.renderer.theme;this.tooltipNode.className="ace_tooltip ace_doc-tooltip "+(u.isDark?"ace_dark ":"")+(u.cssClass||"");var p=this.tooltipNode;c.docHTML?p.innerHTML=c.docHTML:c.docText&&(p.textContent=c.docText),p.parentNode||this.popup.container.appendChild(this.tooltipNode);var o=this.popup,t=o.container.getBoundingClientRect();p.style.top=o.container.style.top,p.style.bottom=o.container.style.bottom,p.style.display="block",window.innerWidth-t.right<320?t.left<320?o.isTopdown?(p.style.top=t.bottom+"px",p.style.left=t.left+"px",p.style.right="",p.style.bottom=""):(p.style.top=o.container.offsetTop-p.offsetHeight+"px",p.style.left=t.left+"px",p.style.right="",p.style.bottom=""):(p.style.right=window.innerWidth-t.left+"px",p.style.left=""):(p.style.left=t.right+1+"px",p.style.right="")},r.prototype.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),!!this.tooltipNode){var c=this.tooltipNode;!this.editor.isFocused()&&document.activeElement==c&&this.editor.focus(),this.tooltipNode=null,c.parentNode&&c.parentNode.removeChild(c)}},r.prototype.onTooltipClick=function(c){for(var u=c.target;u&&u!=this.tooltipNode;){if(u.nodeName=="A"&&u.href){u.rel="noreferrer",u.target="_blank";break}u=u.parentNode}},r.prototype.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var c=this.popup.container;c&&c.parentNode&&c.parentNode.removeChild(c)}this.editor&&this.editor.completer==this&&(this.editor.off("destroy",N),this.editor.completer=null),this.inlineRenderer=this.popup=this.editor=null},r}();x.prototype.commands={Up:function(r){r.completer.goTo("up")},Down:function(r){r.completer.goTo("down")},"Ctrl-Up|Ctrl-Home":function(r){r.completer.goTo("start")},"Ctrl-Down|Ctrl-End":function(r){r.completer.goTo("end")},Esc:function(r){r.completer.detach()},Return:function(r){return r.completer.insertMatch()},"Shift-Return":function(r){r.completer.insertMatch(null,{deleteSuffix:!0})},Tab:function(r){var c=r.completer.insertMatch();if(!c&&!r.tabstopManager)r.completer.goTo("down");else return c},PageUp:function(r){r.completer.popup.gotoPageUp()},PageDown:function(r){r.completer.popup.gotoPageDown()}},x.for=function(r){return r.completer instanceof x||(r.completer&&(r.completer.destroy(),r.completer=null),O.get("sharedPopups")?(x.$sharedInstance||(x.$sharedInstance=new x),r.completer=x.$sharedInstance):(r.completer=new x,r.once("destroy",N))),r.completer},x.startCommand={name:"startAutocomplete",exec:function(r,c){var u=x.for(r);u.autoInsert=!1,u.autoSelect=!0,u.autoShown=!1,u.showPopup(r,c),u.cancelContextMenu()},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var E=function(){function r(){this.active=!0}return r.prototype.insertByIndex=function(c,u,p){return!this.completions||!this.completions.filtered?!1:this.insertMatch(c,this.completions.filtered[u],p)},r.prototype.insertMatch=function(c,u,p){if(!u)return!1;if(c.startOperation({command:{name:"insertMatch"}}),u.completer&&u.completer.insertMatch)u.completer.insertMatch(c,u);else{if(!this.completions)return!1;if(this.completions.filterText){var o;c.selection.getAllRanges?o=c.selection.getAllRanges():o=[c.getSelectionRange()];for(var t=0,e;e=o[t];t++)e.start.column-=this.completions.filterText.length,c.session.remove(e)}u.snippet?L.insertSnippet(c,u.snippet,{range:u.range}):this.$insertString(c,u),u.command&&u.command==="startAutocomplete"&&c.execCommand(u.command)}return c.endOperation(),!0},r.prototype.$insertString=function(c,u){var p=u.value||u;if(u.range){if(c.inVirtualSelectionMode)return c.session.replace(u.range,p);c.forEachSelection(function(){var o=c.getSelectionRange();u.range.compareRange(o)===0?c.session.replace(u.range,p):c.insert(p)},null,{keepOrder:!0})}else c.execCommand("insertstring",p)},r.prototype.gatherCompletions=function(c,u){var p=c.getSession(),o=c.getCursorPosition(),t=b.getCompletionPrefix(c),e=[];this.completers=c.completers;var n=c.completers.length;return c.completers.forEach(function(i,a){i.getCompletions(c,p,o,t,function(l,s){!l&&s&&(e=e.concat(s)),u(null,{prefix:b.getCompletionPrefix(c),matches:e,finished:--n===0})})}),!0},r.prototype.provideCompletions=function(c,u,p){var o=function(i){var a=i.prefix,l=i.matches;this.completions=new k(l),u.exactMatch&&(this.completions.exactMatch=!0),u.ignoreCaption&&(this.completions.ignoreCaption=!0),this.completions.setFilter(a),(i.finished||this.completions.filtered.length)&&p(null,this.completions,i.finished)}.bind(this),t=!0,e=null;if(this.gatherCompletions(c,function(i,a){if(this.active){i&&(p(i,[],!0),this.detach());var l=a.prefix;if(l.indexOf(a.prefix)===0){if(t){e=a;return}o(a)}}}.bind(this)),t=!1,e){var n=e;e=null,o(n)}},r.prototype.detach=function(){this.active=!1,this.completers&&this.completers.forEach(function(c){typeof c.cancel=="function"&&c.cancel()})},r}(),k=function(){function r(c,u){this.all=c,this.filtered=c,this.filterText=u||"",this.exactMatch=!1,this.ignoreCaption=!1}return r.prototype.setFilter=function(c){if(c.length>this.filterText&&c.lastIndexOf(this.filterText,0)===0)var u=this.filtered;else var u=this.all;this.filterText=c,u=this.filterCompletions(u,this.filterText),u=u.sort(function(o,t){return t.exactMatch-o.exactMatch||t.$score-o.$score||(o.caption||o.value).localeCompare(t.caption||t.value)});var p=null;u=u.filter(function(o){var t=o.snippet||o.caption||o.value;return t===p?!1:(p=t,!0)}),this.filtered=u},r.prototype.filterCompletions=function(c,u){var p=[],o=u.toUpperCase(),t=u.toLowerCase();e:for(var e=0,n;n=c[e];e++){var i=!this.ignoreCaption&&n.caption||n.value||n.snippet;if(i){var a=-1,l=0,s=0,d,h;if(this.exactMatch){if(u!==i.substr(0,u.length))continue e}else{var g=i.toLowerCase().indexOf(t);if(g>-1)s=g;else for(var m=0;m<u.length;m++){var y=i.indexOf(t[m],a+1),v=i.indexOf(o[m],a+1);if(d=y>=0&&(v<0||y<v)?y:v,d<0)continue e;h=d-a-1,h>0&&(a===-1&&(s+=10),s+=h,l=l|1<<m),a=d}}n.matchMask=l,n.exactMatch=s?0:1,n.$score=(n.score||0)-s,p.push(n)}}return p},r}();C.Autocomplete=x,C.CompletionProvider=E,C.FilteredList=k}),ace.define("ace/ext/command_bar",["require","exports","module","ace/tooltip","ace/lib/event_emitter","ace/lib/lang","ace/lib/dom","ace/lib/oop","ace/lib/useragent"],function(f,C,H){var A=this&&this.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},$=f("../tooltip").Tooltip,M=f("../lib/event_emitter").EventEmitter,S=f("../lib/lang"),b=f("../lib/dom"),T=f("../lib/oop"),_=f("../lib/useragent"),L="command_bar_tooltip_button",O="command_bar_button_value",N="command_bar_button_caption",x="command_bar_keybinding",E="command_bar_tooltip",k="MoreOptionsButton",r=100,c=4,u=function(t,e){return e.row>t.row||e.row===t.row&&e.column>t.column?t:e},p={Ctrl:{mac:"^"},Option:{mac:"⌥"},Command:{mac:"⌘"},Cmd:{mac:"⌘"},Shift:"⇧",Left:"←",Right:"→",Up:"↑",Down:"↓"},o=function(){function t(e,n){var i,a;n=n||{},this.parentNode=e,this.tooltip=new $(this.parentNode),this.moreOptions=new $(this.parentNode),this.maxElementsOnTooltip=n.maxElementsOnTooltip||c,this.$alwaysShow=n.alwaysShow||!1,this.eventListeners={},this.elements={},this.commands={},this.tooltipEl=b.buildDom(["div",{class:E}],this.tooltip.getElement()),this.moreOptionsEl=b.buildDom(["div",{class:E+" tooltip_more_options"}],this.moreOptions.getElement()),this.$showTooltipTimer=S.delayedCall(this.$showTooltip.bind(this),n.showDelay||r),this.$hideTooltipTimer=S.delayedCall(this.$hideTooltip.bind(this),n.hideDelay||r),this.$tooltipEnter=this.$tooltipEnter.bind(this),this.$onMouseMove=this.$onMouseMove.bind(this),this.$onChangeScroll=this.$onChangeScroll.bind(this),this.$onEditorChangeSession=this.$onEditorChangeSession.bind(this),this.$scheduleTooltipForHide=this.$scheduleTooltipForHide.bind(this),this.$preventMouseEvent=this.$preventMouseEvent.bind(this);try{for(var l=A(["mousedown","mouseup","click"]),s=l.next();!s.done;s=l.next()){var d=s.value;this.tooltip.getElement().addEventListener(d,this.$preventMouseEvent),this.moreOptions.getElement().addEventListener(d,this.$preventMouseEvent)}}catch(h){i={error:h}}finally{try{s&&!s.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}}return t.prototype.registerCommand=function(e,n){var i=Object.keys(this.commands).length<this.maxElementsOnTooltip;!i&&!this.elements[k]&&this.$createCommand(k,{name:"···",exec:function(){this.$shouldHideMoreOptions=!1,this.$setMoreOptionsVisibility(!this.isMoreOptionsShown())}.bind(this),type:"checkbox",getValue:function(){return this.isMoreOptionsShown()}.bind(this),enabled:!0},!0),this.$createCommand(e,n,i),this.isShown()&&this.updatePosition()},t.prototype.isShown=function(){return!!this.tooltip&&this.tooltip.isOpen},t.prototype.isMoreOptionsShown=function(){return!!this.moreOptions&&this.moreOptions.isOpen},t.prototype.getAlwaysShow=function(){return this.$alwaysShow},t.prototype.setAlwaysShow=function(e){this.$alwaysShow=e,this.$updateOnHoverHandlers(!this.$alwaysShow),this._signal("alwaysShow",this.$alwaysShow)},t.prototype.attach=function(e){!e||this.isShown()&&this.editor===e||(this.detach(),this.editor=e,this.editor.on("changeSession",this.$onEditorChangeSession),this.editor.session&&(this.editor.session.on("changeScrollLeft",this.$onChangeScroll),this.editor.session.on("changeScrollTop",this.$onChangeScroll)),this.getAlwaysShow()?this.$showTooltip():this.$updateOnHoverHandlers(!0))},t.prototype.updatePosition=function(){if(this.editor){var e=this.editor.renderer,n;if(this.editor.selection.getAllRanges?n=this.editor.selection.getAllRanges():n=[this.editor.getSelectionRange()],!!n.length){for(var i=u(n[0].start,n[0].end),a=0,l;l=n[a];a++)i=u(i,u(l.start,l.end));var s=e.$cursorLayer.getPixelPosition(i,!0),d=this.tooltip.getElement(),h=window.innerWidth,g=window.innerHeight,m=this.editor.container.getBoundingClientRect();s.top+=m.top-e.layerConfig.offset,s.left+=m.left+e.gutterWidth-e.scrollLeft;var y=s.top>=m.top&&s.top<=m.bottom&&s.left>=m.left+e.gutterWidth&&s.left<=m.right;if(!y&&this.isShown()){this.$hideTooltip();return}else if(y&&!this.isShown()&&this.getAlwaysShow()){this.$showTooltip();return}var v=s.top-d.offsetHeight,w=Math.min(h-d.offsetWidth,s.left),D=v>=0&&v+d.offsetHeight<=g&&w>=0&&w+d.offsetWidth<=h;if(!D){this.$hideTooltip();return}if(this.tooltip.setPosition(w,v),this.isMoreOptionsShown()){v=v+d.offsetHeight,w=this.elements[k].getBoundingClientRect().left;var I=this.moreOptions.getElement(),g=window.innerHeight;v+I.offsetHeight>g&&(v-=d.offsetHeight+I.offsetHeight),w+I.offsetWidth>h&&(w=h-I.offsetWidth),this.moreOptions.setPosition(w,v)}}}},t.prototype.update=function(){Object.keys(this.elements).forEach(this.$updateElement.bind(this))},t.prototype.detach=function(){this.tooltip.hide(),this.moreOptions.hide(),this.$updateOnHoverHandlers(!1),this.editor&&(this.editor.off("changeSession",this.$onEditorChangeSession),this.editor.session&&(this.editor.session.off("changeScrollLeft",this.$onChangeScroll),this.editor.session.off("changeScrollTop",this.$onChangeScroll))),this.$mouseInTooltip=!1,this.editor=null},t.prototype.destroy=function(){this.tooltip&&this.moreOptions&&(this.detach(),this.tooltip.destroy(),this.moreOptions.destroy()),this.eventListeners={},this.commands={},this.elements={},this.tooltip=this.moreOptions=this.parentNode=null},t.prototype.$createCommand=function(e,n,i){var a=i?this.tooltipEl:this.moreOptionsEl,l=[],s=n.bindKey;s&&(typeof s=="object"&&(s=_.isMac?s.mac:s.win),s=s.split("|")[0],l=s.split("-"),l=l.map(function(g){if(p[g]){if(typeof p[g]=="string")return p[g];if(_.isMac&&p[g].mac)return p[g].mac}return g}));var d;i&&n.iconCssClass?d=["div",{class:["ace_icon_svg",n.iconCssClass].join(" "),"aria-label":n.name+" ("+n.bindKey+")"}]:(d=[["div",{class:O}],["div",{class:N},n.name]],l.length&&d.push(["div",{class:x},l.map(function(g){return["div",g]})])),b.buildDom(["div",{class:[L,n.cssClass||""].join(" "),ref:e},d],a,this.elements),this.commands[e]=n;var h=function(g){this.editor&&this.editor.focus(),this.$shouldHideMoreOptions=this.isMoreOptionsShown(),!this.elements[e].disabled&&n.exec&&n.exec(this.editor),this.$shouldHideMoreOptions&&this.$setMoreOptionsVisibility(!1),this.update(),g.preventDefault()}.bind(this);this.eventListeners[e]=h,this.elements[e].addEventListener("click",h.bind(this)),this.$updateElement(e)},t.prototype.$setMoreOptionsVisibility=function(e){e?(this.moreOptions.setTheme(this.editor.renderer.theme),this.moreOptions.setClassName(E+"_wrapper"),this.moreOptions.show(),this.update(),this.updatePosition()):this.moreOptions.hide()},t.prototype.$onEditorChangeSession=function(e){e.oldSession&&(e.oldSession.off("changeScrollTop",this.$onChangeScroll),e.oldSession.off("changeScrollLeft",this.$onChangeScroll)),this.detach()},t.prototype.$onChangeScroll=function(){this.editor.renderer&&(this.isShown()||this.getAlwaysShow())&&this.editor.renderer.once("afterRender",this.updatePosition.bind(this))},t.prototype.$onMouseMove=function(e){if(!this.$mouseInTooltip){var n=this.editor.getCursorPosition(),i=this.editor.renderer.textToScreenCoordinates(n.row,n.column),a=this.editor.renderer.lineHeight,l=e.clientY>=i.pageY&&e.clientY<i.pageY+a;l?(!this.isShown()&&!this.$showTooltipTimer.isPending()&&this.$showTooltipTimer.delay(),this.$hideTooltipTimer.isPending()&&this.$hideTooltipTimer.cancel()):(this.isShown()&&!this.$hideTooltipTimer.isPending()&&this.$hideTooltipTimer.delay(),this.$showTooltipTimer.isPending()&&this.$showTooltipTimer.cancel())}},t.prototype.$preventMouseEvent=function(e){this.editor&&this.editor.focus(),e.preventDefault()},t.prototype.$scheduleTooltipForHide=function(){this.$mouseInTooltip=!1,this.$showTooltipTimer.cancel(),this.$hideTooltipTimer.delay()},t.prototype.$tooltipEnter=function(){this.$mouseInTooltip=!0,this.$showTooltipTimer.isPending()&&this.$showTooltipTimer.cancel(),this.$hideTooltipTimer.isPending()&&this.$hideTooltipTimer.cancel()},t.prototype.$updateOnHoverHandlers=function(e){var n=this.tooltip.getElement(),i=this.moreOptions.getElement();e?(this.editor&&(this.editor.on("mousemove",this.$onMouseMove),this.editor.renderer.getMouseEventTarget().addEventListener("mouseout",this.$scheduleTooltipForHide,!0)),n.addEventListener("mouseenter",this.$tooltipEnter),n.addEventListener("mouseleave",this.$scheduleTooltipForHide),i.addEventListener("mouseenter",this.$tooltipEnter),i.addEventListener("mouseleave",this.$scheduleTooltipForHide)):(this.editor&&(this.editor.off("mousemove",this.$onMouseMove),this.editor.renderer.getMouseEventTarget().removeEventListener("mouseout",this.$scheduleTooltipForHide,!0)),n.removeEventListener("mouseenter",this.$tooltipEnter),n.removeEventListener("mouseleave",this.$scheduleTooltipForHide),i.removeEventListener("mouseenter",this.$tooltipEnter),i.removeEventListener("mouseleave",this.$scheduleTooltipForHide))},t.prototype.$showTooltip=function(){this.isShown()||(this.tooltip.setTheme(this.editor.renderer.theme),this.tooltip.setClassName(E+"_wrapper"),this.tooltip.show(),this.update(),this.updatePosition(),this._signal("show"))},t.prototype.$hideTooltip=function(){this.$mouseInTooltip=!1,this.isShown()&&(this.moreOptions.hide(),this.tooltip.hide(),this._signal("hide"))},t.prototype.$updateElement=function(e){var n=this.commands[e];if(n){var i=this.elements[e],a=n.enabled;if(typeof a=="function"&&(a=a(this.editor)),typeof n.getValue=="function"){var l=n.getValue(this.editor);if(n.type==="text")i.textContent=l;else if(n.type==="checkbox"){var s=l?b.addCssClass:b.removeCssClass,d=i.parentElement===this.tooltipEl;i.ariaChecked=l,d?s(i,"ace_selected"):(i=i.querySelector("."+O),s(i,"ace_checkmark"))}}a&&i.disabled?(b.removeCssClass(i,"ace_disabled"),i.ariaDisabled=i.disabled=!1,i.removeAttribute("disabled")):!a&&!i.disabled&&(b.addCssClass(i,"ace_disabled"),i.ariaDisabled=i.disabled=!0,i.setAttribute("disabled",""))}},t}();T.implement(o.prototype,M),b.importCssString(`
  85. .ace_tooltip.`.concat(E,`_wrapper {
  86. padding: 0;
  87. }
  88. .ace_tooltip .`).concat(E,` {
  89. padding: 1px 5px;
  90. display: flex;
  91. pointer-events: auto;
  92. }
  93. .ace_tooltip .`).concat(E,`.tooltip_more_options {
  94. padding: 1px;
  95. flex-direction: column;
  96. }
  97. div.`).concat(L,` {
  98. display: inline-flex;
  99. cursor: pointer;
  100. margin: 1px;
  101. border-radius: 2px;
  102. padding: 2px 5px;
  103. align-items: center;
  104. }
  105. div.`).concat(L,`.ace_selected,
  106. div.`).concat(L,`:hover:not(.ace_disabled) {
  107. background-color: rgba(0, 0, 0, 0.1);
  108. }
  109. div.`).concat(L,`.ace_disabled {
  110. color: #777;
  111. pointer-events: none;
  112. }
  113. div.`).concat(L,` .ace_icon_svg {
  114. height: 12px;
  115. background-color: #000;
  116. }
  117. div.`).concat(L,`.ace_disabled .ace_icon_svg {
  118. background-color: #777;
  119. }
  120. .`).concat(E,".tooltip_more_options .").concat(L,` {
  121. display: flex;
  122. }
  123. .`).concat(E,".").concat(O,` {
  124. display: none;
  125. }
  126. .`).concat(E,".tooltip_more_options .").concat(O,` {
  127. display: inline-block;
  128. width: 12px;
  129. }
  130. .`).concat(N,` {
  131. display: inline-block;
  132. }
  133. .`).concat(x,` {
  134. margin: 0 2px;
  135. display: inline-block;
  136. font-size: 8px;
  137. }
  138. .`).concat(E,".tooltip_more_options .").concat(x,` {
  139. margin-left: auto;
  140. }
  141. .`).concat(x,` div {
  142. display: inline-block;
  143. min-width: 8px;
  144. padding: 2px;
  145. margin: 0 1px;
  146. border-radius: 2px;
  147. background-color: #ccc;
  148. text-align: center;
  149. }
  150. .ace_dark.ace_tooltip .`).concat(E,` {
  151. background-color: #373737;
  152. color: #eee;
  153. }
  154. .ace_dark div.`).concat(L,`.ace_disabled {
  155. color: #979797;
  156. }
  157. .ace_dark div.`).concat(L,`.ace_selected,
  158. .ace_dark div.`).concat(L,`:hover:not(.ace_disabled) {
  159. background-color: rgba(255, 255, 255, 0.1);
  160. }
  161. .ace_dark div.`).concat(L,` .ace_icon_svg {
  162. background-color: #eee;
  163. }
  164. .ace_dark div.`).concat(L,`.ace_disabled .ace_icon_svg {
  165. background-color: #979797;
  166. }
  167. .ace_dark .`).concat(L,`.ace_disabled {
  168. color: #979797;
  169. }
  170. .ace_dark .`).concat(x,` div {
  171. background-color: #575757;
  172. }
  173. .ace_checkmark::before {
  174. content: '✓';
  175. }
  176. `),"commandbar.css",!1),C.CommandBarTooltip=o,C.TOOLTIP_CLASS_NAME=E,C.BUTTON_CLASS_NAME=L}),ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],function(f,C,H){var A=f("../range").Range,$=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;function M(b,T){var _=b.getTextRange(A.fromPoints({row:0,column:0},T));return _.split($).length-1}function S(b,T){var _=M(b,T),L=b.getValue().split($),O=Object.create(null),N=L[_];return L.forEach(function(x,E){if(!(!x||x===N)){var k=Math.abs(_-E),r=L.length-k;O[x]?O[x]=Math.max(r,O[x]):O[x]=r}}),O}C.getCompletions=function(b,T,_,L,O){var N=S(T,_),x=Object.keys(N);O(null,x.map(function(E){return{caption:E,value:E,score:N[E],meta:"local"}}))}}),ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"],function(f,C,H){var A=f("../snippets").snippetManager,$=f("../autocomplete").Autocomplete,M=f("../config"),S=f("../lib/lang"),b=f("../autocomplete/util"),T=f("../autocomplete/text_completer"),_={getCompletions:function(e,n,i,a,l){if(n.$mode.completer)return n.$mode.completer.getCompletions(e,n,i,a,l);var s=e.session.getState(i.row),d=n.$mode.getCompletions(s,n,i,a);d=d.map(function(h){return h.completerId=_.id,h}),l(null,d)},id:"keywordCompleter"},L=function(e){var n={};return e.replace(/\${(\d+)(:(.*?))?}/g,function(i,a,l,s){return n[a]=s||""}).replace(/\$(\d+?)/g,function(i,a){return n[a]})},O={getCompletions:function(e,n,i,a,l){var s=[],d=n.getTokenAt(i.row,i.column);d&&d.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?s.push("html-tag"):s=A.getActiveScopes(e);var h=A.snippetMap,g=[];s.forEach(function(m){for(var y=h[m]||[],v=y.length;v--;){var w=y[v],D=w.name||w.tabTrigger;D&&g.push({caption:D,snippet:w.content,meta:w.tabTrigger&&!w.name?w.tabTrigger+"⇥ ":"snippet",completerId:O.id})}},this),l(null,g)},getDocTooltip:function(e){e.snippet&&!e.docHTML&&(e.docHTML=["<b>",S.escapeHTML(e.caption),"</b>","<hr></hr>",S.escapeHTML(L(e.snippet))].join(""))},id:"snippetCompleter"},N=[O,T,_];C.setCompleters=function(e){N.length=0,e&&N.push.apply(N,e)},C.addCompleter=function(e){N.push(e)},C.textCompleter=T,C.keyWordCompleter=_,C.snippetCompleter=O;var x={name:"expandSnippet",exec:function(e){return A.expandWithTab(e)},bindKey:"Tab"},E=function(e,n){k(n.session.$mode)},k=function(e){typeof e=="string"&&(e=M.$modes[e]),e&&(A.files||(A.files={}),r(e.$id,e.snippetFileId),e.modes&&e.modes.forEach(k))},r=function(e,n){!n||!e||A.files[e]||(A.files[e]={},M.loadModule(n,function(i){i&&(A.files[e]=i,!i.snippets&&i.snippetText&&(i.snippets=A.parseSnippetFile(i.snippetText)),A.register(i.snippets||[],i.scope),i.includeScopes&&(A.snippetMap[i.scope].includeScopes=i.includeScopes,i.includeScopes.forEach(function(a){k("ace/mode/"+a)})))}))},c=function(e){var n=e.editor,i=n.completer&&n.completer.activated;if(e.command.name==="backspace")i&&!b.getCompletionPrefix(n)&&n.completer.detach();else if(e.command.name==="insertstring"&&!i){u=e;var a=e.editor.$liveAutocompletionDelay;a?p.delay(a):o(e)}},u,p=S.delayedCall(function(){o(u)},0),o=function(e){var n=e.editor,i=b.getCompletionPrefix(n),a=b.triggerAutocomplete(n);if((i||a)&&i.length>=n.$liveAutocompletionThreshold){var l=$.for(n);l.autoShown=!0,l.showPopup(n)}},t=f("../editor").Editor;f("../config").defineOptions(t.prototype,"editor",{enableBasicAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:N),this.commands.addCommand($.startCommand)):this.commands.removeCommand($.startCommand)},value:!1},enableLiveAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:N),this.commands.on("afterExec",c)):this.commands.off("afterExec",c)},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function(e){e?(this.commands.addCommand(x),this.on("changeMode",E),E(null,this)):(this.commands.removeCommand(x),this.off("changeMode",E))},value:!1}})}),ace.define("ace/ext/inline_autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/inline","ace/autocomplete","ace/autocomplete","ace/editor","ace/autocomplete/util","ace/lib/dom","ace/lib/lang","ace/ext/command_bar","ace/ext/command_bar","ace/ext/language_tools","ace/ext/language_tools","ace/ext/language_tools","ace/config"],function(f,C,H){var A=f("../keyboard/hash_handler").HashHandler,$=f("../autocomplete/inline").AceInline,M=f("../autocomplete").FilteredList,S=f("../autocomplete").CompletionProvider,b=f("../editor").Editor,T=f("../autocomplete/util"),_=f("../lib/dom"),L=f("../lib/lang"),O=f("./command_bar").CommandBarTooltip,N=f("./command_bar").BUTTON_CLASS_NAME,x=f("./language_tools").snippetCompleter,E=f("./language_tools").textCompleter,k=f("./language_tools").keyWordCompleter,r=function(p,o){o.completer&&o.completer.destroy()},c=function(){function p(o){this.editor=o,this.keyboardHandler=new A(this.commands),this.$index=-1,this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.changeTimer=L.delayedCall(function(){this.updateCompletions()}.bind(this))}return p.prototype.getInlineRenderer=function(){return this.inlineRenderer||(this.inlineRenderer=new $),this.inlineRenderer},p.prototype.getInlineTooltip=function(){return this.inlineTooltip||(this.inlineTooltip=p.createInlineTooltip(document.body||document.documentElement)),this.inlineTooltip},p.prototype.show=function(o){this.activated=!0,this.editor.completer!==this&&(this.editor.completer&&this.editor.completer.detach(),this.editor.completer=this),this.editor.on("changeSelection",this.changeListener),this.editor.on("blur",this.blurListener),this.updateCompletions(o)},p.prototype.$open=function(){this.editor.textInput.setAriaOptions&&this.editor.textInput.setAriaOptions({}),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler),this.getInlineTooltip().attach(this.editor),this.$index===-1?this.setIndex(0):this.$showCompletion(),this.changeTimer.cancel()},p.prototype.insertMatch=function(){var o=this.getCompletionProvider().insertByIndex(this.editor,this.$index);return this.detach(),o},p.prototype.changeListener=function(o){var t=this.editor.selection.lead;(t.row!=this.base.row||t.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach()},p.prototype.blurListener=function(o){this.detach()},p.prototype.goTo=function(o){if(!(!this.completions||!this.completions.filtered)){var t=this.completions.filtered.length;switch(o.toLowerCase()){case"prev":this.setIndex((this.$index-1+t)%t);break;case"next":this.setIndex((this.$index+1+t)%t);break;case"first":this.setIndex(0);break;case"last":this.setIndex(this.completions.filtered.length-1);break}}},p.prototype.getLength=function(){return!this.completions||!this.completions.filtered?0:this.completions.filtered.length},p.prototype.getData=function(o){return o==null||o===null?this.completions.filtered[this.$index]:this.completions.filtered[o]},p.prototype.getIndex=function(){return this.$index},p.prototype.isOpen=function(){return this.$index>=0},p.prototype.setIndex=function(o){if(!(!this.completions||!this.completions.filtered)){var t=Math.max(-1,Math.min(this.completions.filtered.length-1,o));t!==this.$index&&(this.$index=t,this.$showCompletion())}},p.prototype.getCompletionProvider=function(){return this.completionProvider||(this.completionProvider=new S),this.completionProvider},p.prototype.$showCompletion=function(){this.getInlineRenderer().show(this.editor,this.completions.filtered[this.$index],this.completions.filterText)||this.getInlineRenderer().hide(),this.inlineTooltip&&this.inlineTooltip.isShown()&&this.inlineTooltip.update()},p.prototype.$updatePrefix=function(){var o=this.editor.getCursorPosition(),t=this.editor.session.getTextRange({start:this.base,end:o});return this.completions.setFilter(t),this.completions.filtered.length?this.completions.filtered.length==1&&this.completions.filtered[0].value==t&&!this.completions.filtered[0].snippet?this.detach():(this.$open(this.editor,t),t):this.detach()},p.prototype.updateCompletions=function(i){var n="";if(i&&i.matches){var e=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(e.row,e.column),this.base.$insertRight=!0,this.completions=new M(i.matches),this.$open(this.editor,"")}this.base&&this.completions&&(n=this.$updatePrefix());var t=this.editor.getSession(),e=this.editor.getCursorPosition(),n=T.getCompletionPrefix(this.editor);this.base=t.doc.createAnchor(e.row,e.column-n.length),this.base.$insertRight=!0;var i={exactMatch:!0,ignoreCaption:!0};this.getCompletionProvider().provideCompletions(this.editor,i,function(a,l,s){var d=l.filtered,h=T.getCompletionPrefix(this.editor);if(s){if(!d.length)return this.detach();if(d.length==1&&d[0].value==h&&!d[0].snippet)return this.detach()}this.completions=l,this.$open(this.editor,h)}.bind(this))},p.prototype.detach=function(){this.editor&&(this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener)),this.changeTimer.cancel(),this.inlineTooltip&&this.inlineTooltip.detach(),this.setIndex(-1),this.completionProvider&&this.completionProvider.detach(),this.inlineRenderer&&this.inlineRenderer.isOpen()&&this.inlineRenderer.hide(),this.base&&this.base.detach(),this.activated=!1,this.completionProvider=this.completions=this.base=null},p.prototype.destroy=function(){this.detach(),this.inlineRenderer&&this.inlineRenderer.destroy(),this.inlineTooltip&&this.inlineTooltip.destroy(),this.editor&&this.editor.completer==this&&(this.editor.off("destroy",r),this.editor.completer=null),this.inlineTooltip=this.editor=this.inlineRenderer=null},p}();c.prototype.commands={Previous:{bindKey:"Alt-[",name:"Previous",exec:function(p){p.completer.goTo("prev")}},Next:{bindKey:"Alt-]",name:"Next",exec:function(p){p.completer.goTo("next")}},Accept:{bindKey:{win:"Tab|Ctrl-Right",mac:"Tab|Cmd-Right"},name:"Accept",exec:function(p){return p.completer.insertMatch()}},Close:{bindKey:"Esc",name:"Close",exec:function(p){p.completer.detach()}}},c.for=function(p){return p.completer instanceof c||(p.completer&&(p.completer.destroy(),p.completer=null),p.completer=new c(p),p.once("destroy",r)),p.completer},c.startCommand={name:"startInlineAutocomplete",exec:function(p,o){var t=c.for(p);t.show(o)},bindKey:{win:"Alt-C",mac:"Option-C"}};var u=[x,E,k];f("../config").defineOptions(b.prototype,"editor",{enableInlineAutocompletion:{set:function(p){p?(this.completers||(this.completers=Array.isArray(p)?p:u),this.commands.addCommand(c.startCommand)):this.commands.removeCommand(c.startCommand)},value:!1}}),c.createInlineTooltip=function(p){var o=new O(p);return o.registerCommand("Previous",Object.assign({},c.prototype.commands.Previous,{enabled:!0,type:"button",iconCssClass:"ace_arrow_rotated"})),o.registerCommand("Position",{enabled:!1,getValue:function(t){return t?[t.completer.getIndex()+1,t.completer.getLength()].join("/"):""},type:"text",cssClass:"completion_position"}),o.registerCommand("Next",Object.assign({},c.prototype.commands.Next,{enabled:!0,type:"button",iconCssClass:"ace_arrow"})),o.registerCommand("Accept",Object.assign({},c.prototype.commands.Accept,{enabled:function(t){return!!t&&t.completer.getIndex()>=0},type:"button"})),o.registerCommand("ShowTooltip",{name:"Always Show Tooltip",exec:function(){o.setAlwaysShow(!o.getAlwaysShow())},enabled:!0,getValue:function(){return o.getAlwaysShow()},type:"checkbox"}),o},_.importCssString(`
  177. .ace_icon_svg.ace_arrow,
  178. .ace_icon_svg.ace_arrow_rotated {
  179. -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTUuODM3MDEgMTVMNC41ODc1MSAxMy43MTU1TDEwLjE0NjggOEw0LjU4NzUxIDIuMjg0NDZMNS44MzcwMSAxTDEyLjY0NjUgOEw1LjgzNzAxIDE1WiIgZmlsbD0iYmxhY2siLz48L3N2Zz4=");
  180. }
  181. .ace_icon_svg.ace_arrow_rotated {
  182. transform: rotate(180deg);
  183. }
  184. div.`.concat(N,`.completion_position {
  185. padding: 0;
  186. }
  187. `),"inlineautocomplete.css",!1),C.InlineAutocomplete=c}),function(){ace.require(["ace/ext/inline_autocomplete"],function(f){B&&(B.exports=f)})}()})(G);var Y=G.exports;const ee=Q(Y),ie=q({__proto__:null,default:ee},[Y]);export{ie as e};
  188. //# sourceMappingURL=ext-inline_autocomplete-2d9076b2.js.map