import{g as Q}from"./index-d7fba904.js";function q(B,K){for(var f=0;fC[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,` `+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=` `: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=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.column1?(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;l2&&(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(` .ace_snippet-marker { -moz-box-sizing: border-box; box-sizing: border-box; background: rgba(194, 193, 208, 0.09); border: 1px dotted rgba(211, 208, 235, 0.62); position: absolute; }`,"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<=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(` .ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line { background-color: #CAD6FA; z-index: 1; } .ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line { background-color: #3a674e; } .ace_editor.ace_autocomplete .ace_line-hover { border: 1px solid #abbffe; margin-top: -1px; background: rgba(233,233,253,0.4); position: absolute; z-index: 2; } .ace_dark.ace_editor.ace_autocomplete .ace_line-hover { border: 1px solid rgba(109, 150, 13, 0.8); background: rgba(58, 103, 78, 0.62); } .ace_completion-meta { opacity: 0.5; margin-left: 0.9em; } .ace_completion-message { color: blue; } .ace_editor.ace_autocomplete .ace_completion-highlight{ color: #2d69c7; } .ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{ color: #93ca12; } .ace_editor.ace_autocomplete { width: 300px; z-index: 200000; border: 1px lightgray solid; position: fixed; box-shadow: 2px 3px 5px rgba(0,0,0,.2); line-height: 1.4; background: #fefefe; color: #111; } .ace_dark.ace_editor.ace_autocomplete { border: 1px #484747 solid; box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51); line-height: 1.4; background: #25282c; color: #c1c1c1; } .ace_autocomplete .ace_text-layer { width: calc(100% - 8px); } .ace_autocomplete .ace_line { display: flex; align-items: center; } .ace_autocomplete .ace_line > * { min-width: 0; flex: 0 0 auto; } .ace_autocomplete .ace_line .ace_ { flex: 0 1 auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .ace_autocomplete .ace_completion-spacer { flex: 1; } `,"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;_=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.columnthis.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=0&&(v<0||y0&&(a===-1&&(s+=10),s+=h,l=l|1<=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=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",S.escapeHTML(e.caption),"","
",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=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(` .ace_icon_svg.ace_arrow, .ace_icon_svg.ace_arrow_rotated { -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTUuODM3MDEgMTVMNC41ODc1MSAxMy43MTU1TDEwLjE0NjggOEw0LjU4NzUxIDIuMjg0NDZMNS44MzcwMSAxTDEyLjY0NjUgOEw1LjgzNzAxIDE1WiIgZmlsbD0iYmxhY2siLz48L3N2Zz4="); } .ace_icon_svg.ace_arrow_rotated { transform: rotate(180deg); } div.`.concat(N,`.completion_position { padding: 0; } `),"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};