(()=>{var e={816:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeMirrorEditor=void 0;const r=n(0);class i extends r.Editor{constructor(e){super(),this.cm=e,this.onKeydown=(e,t)=>{const n=this.getCode(t);let r;"UP"===n||"DOWN"===n?r=this.emitMoveEvent(n):"ENTER"===n?r=this.emitEnterEvent():"ESC"===n&&(r=this.emitEscEvent()),r&&r.defaultPrevented&&t.preventDefault()},this.onKeyup=(e,t)=>{const n=this.getCode(t);"DOWN"!==n&&"UP"!==n&&this.emitChangeEvent()},this.startListening()}destroy(){return super.destroy(),this.stopListening(),this}applySearchResult(e){const t=e.getReplacementData(this.getBeforeCursor());t&&(this.cm.replaceRange(t.beforeCursor+t.afterCursor,this.cm.posFromIndex(t.start),this.cm.posFromIndex(t.end)),this.cm.setCursor(this.cm.posFromIndex(t.start+t.beforeCursor.length))),this.cm.focus()}getCursorOffset(){const{left:e,top:t,bottom:n}=this.cm.cursorCoords();return{left:e,top:n,lineHeight:n-t}}getBeforeCursor(){const{line:e,ch:t}=this.cm.getCursor(),n=this.getLines(),r=n.slice(0,e),i=n[e].slice(0,t);return r.concat([i]).join(this.cm.lineSeparator())}getAfterCursor(){const{line:e,ch:t}=this.cm.getCursor(),n=this.getLines(),r=n.slice(e+1);return[n[e].slice(t)].concat(r).join(this.cm.lineSeparator())}getLines(){return this.cm.getValue().split(this.cm.lineSeparator())}startListening(){this.cm.on("keydown",this.onKeydown),this.cm.on("keyup",this.onKeyup)}stopListening(){this.cm.off("keydown",this.onKeydown),this.cm.off("keyup",this.onKeyup)}}t.CodeMirrorEditor=i},811:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeMirrorEditor=void 0;var r=n(816);Object.defineProperty(t,"CodeMirrorEditor",{enumerable:!0,get:function(){return r.CodeMirrorEditor}})},794:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContenteditableEditor=void 0;const r=n(0),i=n(326);class s extends r.Editor{constructor(e){super(),this.el=e,this.onInput=()=>{this.emitChangeEvent()},this.onKeydown=e=>{const t=this.getCode(e);let n;"UP"===t||"DOWN"===t?n=this.emitMoveEvent(t):"ENTER"===t?n=this.emitEnterEvent():"ESC"===t&&(n=this.emitEscEvent()),n&&n.defaultPrevented&&e.preventDefault()},this.startListening=()=>{this.el.addEventListener("input",this.onInput),this.el.addEventListener("keydown",this.onKeydown)},this.stopListening=()=>{this.el.removeEventListener("input",this.onInput),this.el.removeEventListener("keydown",this.onKeydown)},this.startListening()}destroy(){return super.destroy(),this.stopListening(),this}applySearchResult(e){const t=this.getBeforeCursor(),n=this.getAfterCursor();if(null!=t&&null!=n){const r=e.replace(t,n);if(Array.isArray(r)){let e=r[0];(0,i.isSafari)()&&(e=e.replace(t,""));const n=this.getRange();n.selectNode(n.startContainer),this.el.ownerDocument.execCommand("insertText",!1,e+r[1]),n.detach();const s=this.getRange();s.setStart(s.startContainer,e.length),s.collapse(!0)}}}getCursorOffset(){const e=this.getRange(),t=e.getBoundingClientRect(),n=this.el.ownerDocument.body.getBoundingClientRect(),r=e.startContainer,s=r instanceof Text?r.parentElement:r,o=t.left,l=(0,i.getLineHeightPx)(s),a=t.top-n.top+l;return"rtl"!==this.el.dir?{left:o,lineHeight:l,top:a}:{right:document.documentElement.clientWidth-o,lineHeight:l,top:a}}getBeforeCursor(){const e=this.getRange();return e.collapsed&&e.startContainer instanceof Text?e.startContainer.wholeText.substring(0,e.startOffset):null}getAfterCursor(){const e=this.getRange();return e.collapsed&&e.startContainer instanceof Text?e.startContainer.wholeText.substring(e.startOffset):null}getRange(e){var t;const n=null===(t=this.el.ownerDocument.defaultView)||void 0===t?void 0:t.getSelection();if(null==n)throw new Error("The element does not belong to view");for(let e=0,t=n.rangeCount;e<t;e++){const t=n.getRangeAt(e);if(this.el.contains(t.startContainer))return t}if(e)throw new Error("Unexpected");const r=this.el.ownerDocument.activeElement;this.el.focus();const i=this.getRange(!0);if(r){const e=r;e.focus&&e.focus()}return i}}t.ContenteditableEditor=s},786:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(794),t)},615:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Completer=void 0;const r=n(228),i=n(99);class s extends r.EventEmitter{constructor(e){super(),this.handleQueryResult=e=>{this.emit("hit",{searchResults:e})},this.strategies=e.map((e=>new i.Strategy(e)))}destroy(){return this.strategies.forEach((e=>e.destroy())),this}run(e){for(const t of this.strategies)if(t.execute(e,this.handleQueryResult))return;this.handleQueryResult([])}}t.Completer=s},871:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Dropdown=t.DEFAULT_DROPDOWN_ITEM_ACTIVE_CLASS_NAME=t.DEFAULT_DROPDOWN_ITEM_CLASS_NAME=t.DEFAULT_DROPDOWN_CLASS_NAME=t.DEFAULT_DROPDOWN_PLACEMENT=t.DEFAULT_DROPDOWN_MAX_COUNT=void 0;const r=n(228),i=n(665);t.DEFAULT_DROPDOWN_MAX_COUNT=10,t.DEFAULT_DROPDOWN_PLACEMENT="auto",t.DEFAULT_DROPDOWN_CLASS_NAME="dropdown-menu textcomplete-dropdown",t.DEFAULT_DROPDOWN_ITEM_CLASS_NAME="textcomplete-item",t.DEFAULT_DROPDOWN_ITEM_ACTIVE_CLASS_NAME=`${t.DEFAULT_DROPDOWN_ITEM_CLASS_NAME} active`;class s extends r.EventEmitter{static create(e){const n=document.createElement("ul");n.className=e.className||t.DEFAULT_DROPDOWN_CLASS_NAME,Object.assign(n.style,{display:"none",position:"absolute",zIndex:"1000"},e.style);const r=e.parent||document.body;return null==r||r.appendChild(n),new s(n,e)}constructor(e,t){super(),this.el=e,this.option=t,this.shown=!1,this.items=[],this.activeIndex=null}render(e,n){const r=(0,i.createCustomEvent)("render",{cancelable:!0});return this.emit("render",r),r.defaultPrevented?this:(this.clear(),0===e.length?this.hide():(this.items=e.slice(0,this.option.maxCount||t.DEFAULT_DROPDOWN_MAX_COUNT).map(((e,t)=>{var n;return new o(this,t,e,(null===(n=this.option)||void 0===n?void 0:n.item)||{})})),this.setStrategyId(e[0]).renderEdge(e,"header").renderItems().renderEdge(e,"footer").show().setOffset(n).activate(0),this.emit("rendered",(0,i.createCustomEvent)("rendered")),this))}destroy(){var e;return this.clear(),null===(e=this.el.parentNode)||void 0===e||e.removeChild(this.el),this}select(e){const t={searchResult:e.searchResult},n=(0,i.createCustomEvent)("select",{cancelable:!0,detail:t});return this.emit("select",n),n.defaultPrevented||(this.hide(),this.emit("selected",(0,i.createCustomEvent)("selected",{detail:t}))),this}show(){if(!this.shown){const e=(0,i.createCustomEvent)("show",{cancelable:!0});if(this.emit("show",e),e.defaultPrevented)return this;this.el.style.display="block",this.shown=!0,this.emit("shown",(0,i.createCustomEvent)("shown"))}return this}hide(){if(this.shown){const e=(0,i.createCustomEvent)("hide",{cancelable:!0});if(this.emit("hide",e),e.defaultPrevented)return this;this.el.style.display="none",this.shown=!1,this.clear(),this.emit("hidden",(0,i.createCustomEvent)("hidden"))}return this}clear(){return this.items.forEach((e=>e.destroy())),this.items=[],this.el.innerHTML="",this.activeIndex=null,this}up(e){return this.shown?this.moveActiveItem("prev",e):this}down(e){return this.shown?this.moveActiveItem("next",e):this}moveActiveItem(e,t){if(null!=this.activeIndex){const n="next"===e?this.getNextActiveIndex():this.getPrevActiveIndex();null!=n&&(this.activate(n),t.preventDefault())}return this}activate(e){return this.activeIndex!==e&&(null!=this.activeIndex&&this.items[this.activeIndex].deactivate(),this.activeIndex=e,this.items[e].activate()),this}isShown(){return this.shown}getActiveItem(){return null!=this.activeIndex?this.items[this.activeIndex]:null}setOffset(e){const n=document.documentElement;if(n){const r=this.el.offsetWidth;if(e.left){const t=this.option.dynamicWidth?n.scrollWidth:n.clientWidth;e.left+r>t&&(e.left=t-r),this.el.style.left=`${e.left}px`}else e.right&&(e.right-r<0&&(e.right=0),this.el.style.right=`${e.right}px`);let i=!1;const s=this.option.placement||t.DEFAULT_DROPDOWN_PLACEMENT;if("auto"===s){const t=this.items.length*e.lineHeight;i=null!=e.clientTop&&e.clientTop+t>n.clientHeight}"top"===s||i?(this.el.style.bottom=`${n.clientHeight-e.top+e.lineHeight}px`,this.el.style.top="auto"):(this.el.style.top=`${e.top}px`,this.el.style.bottom="auto")}return this}getNextActiveIndex(){if(null==this.activeIndex)throw new Error;return this.activeIndex<this.items.length-1?this.activeIndex+1:this.option.rotate?0:null}getPrevActiveIndex(){if(null==this.activeIndex)throw new Error;return 0!==this.activeIndex?this.activeIndex-1:this.option.rotate?this.items.length-1:null}renderItems(){const e=document.createDocumentFragment();for(const t of this.items)e.appendChild(t.el);return this.el.appendChild(e),this}setStrategyId(e){const t=e.getStrategyId();return t&&(this.el.dataset.strategy=t),this}renderEdge(e,t){const n=this.option[t],r=document.createElement("li");return r.className=`textcomplete-${t}`,r.innerHTML="function"==typeof n?n(e.map((e=>e.data))):n||"",this.el.appendChild(r),this}}t.Dropdown=s;class o{constructor(e,n,r,i){this.dropdown=e,this.index=n,this.searchResult=r,this.props=i,this.active=!1,this.onClick=e=>{e.preventDefault(),this.dropdown.select(this)},this.className=this.props.className||t.DEFAULT_DROPDOWN_ITEM_CLASS_NAME,this.activeClassName=this.props.activeClassName||t.DEFAULT_DROPDOWN_ITEM_ACTIVE_CLASS_NAME;const s=document.createElement("li");s.className=this.active?this.activeClassName:this.className;const o=document.createElement("span");o.tabIndex=-1,o.innerHTML=this.searchResult.render(),s.appendChild(o),s.addEventListener("click",this.onClick),this.el=s}destroy(){var e;const t=this.el;return null===(e=t.parentNode)||void 0===e||e.removeChild(t),t.removeEventListener("click",this.onClick,!1),this}activate(){return this.active||(this.active=!0,this.el.className=this.activeClassName,this.dropdown.el.scrollTop=this.el.offsetTop),this}deactivate(){return this.active&&(this.active=!1,this.el.className=this.className),this}}},271:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Editor=void 0;const r=n(228),i=n(665);class s extends r.EventEmitter{destroy(){return this}applySearchResult(e){throw new Error("Not implemented.")}getCursorOffset(){throw new Error("Not implemented.")}getBeforeCursor(){throw new Error("Not implemented.")}emitMoveEvent(e){const t=(0,i.createCustomEvent)("move",{cancelable:!0,detail:{code:e}});return this.emit("move",t),t}emitEnterEvent(){const e=(0,i.createCustomEvent)("enter",{cancelable:!0});return this.emit("enter",e),e}emitChangeEvent(){const e=(0,i.createCustomEvent)("change",{detail:{beforeCursor:this.getBeforeCursor()}});return this.emit("change",e),e}emitEscEvent(){const e=(0,i.createCustomEvent)("esc",{cancelable:!0});return this.emit("esc",e),e}getCode(e){switch(e.keyCode){case 9:case 13:return"ENTER";case 27:return"ESC";case 38:return"UP";case 40:return"DOWN";case 78:if(e.ctrlKey)return"DOWN";break;case 80:if(e.ctrlKey)return"UP"}return"OTHER"}}t.Editor=s},103:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchResult=void 0;const n=/\$&/g,r=/\$(\d)/g;t.SearchResult=class{constructor(e,t,n){this.data=e,this.term=t,this.strategy=n}getReplacementData(e){let t=this.strategy.replace(this.data);if(null==t)return null;let i="";Array.isArray(t)&&(i=t[1],t=t[0]);const s=this.strategy.match(e);if(null==s||null==s.index)return null;const o=t.replace(n,s[0]).replace(r,((e,t)=>s[parseInt(t)]));return{start:s.index,end:s.index+s[0].length,beforeCursor:o,afterCursor:i}}replace(e,t){const n=this.getReplacementData(e);if(null!==n)return t=n.afterCursor+t,[[e.slice(0,n.start),n.beforeCursor,e.slice(n.end)].join(""),t]}render(){return this.strategy.renderTemplate(this.data,this.term)}getStrategyId(){return this.strategy.getId()}}},99:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Strategy=t.DEFAULT_INDEX=void 0;const r=n(103);t.DEFAULT_INDEX=1,t.Strategy=class{constructor(e){this.props=e,this.cache={}}destroy(){return this.cache={},this}replace(e){return this.props.replace(e)}execute(e,n){var i;const s=this.matchWithContext(e);if(!s)return!1;const o=s[null!==(i=this.props.index)&&void 0!==i?i:t.DEFAULT_INDEX];return this.search(o,(e=>{n(e.map((e=>new r.SearchResult(e,o,this))))}),s),!0}renderTemplate(e,t){if(this.props.template)return this.props.template(e,t);if("string"==typeof e)return e;throw new Error(`Unexpected render data type: ${typeof e}. Please implement template parameter by yourself`)}getId(){return this.props.id||null}match(e){return"function"==typeof this.props.match?this.props.match(e):e.match(this.props.match)}search(e,t,n){this.props.cache?this.searchWithCach(e,t,n):this.props.search(e,t,n)}matchWithContext(e){const t=this.context(e);return!1===t?null:this.match(!0===t?e:t)}context(e){return!this.props.context||this.props.context(e)}searchWithCach(e,t,n){null!=this.cache[e]?t(this.cache[e]):this.props.search(e,(n=>{this.cache[e]=n,t(n)}),n)}}},638:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Textcomplete=void 0;const r=n(228),i=n(871),s=n(615),o=["show","shown","render","rendered","selected","hidden","hide"];class l extends r.EventEmitter{constructor(e,t,n){super(),this.editor=e,this.isQueryInFlight=!1,this.nextPendingQuery=null,this.handleHit=({searchResults:e})=>{e.length?this.dropdown.render(e,this.editor.getCursorOffset()):this.dropdown.hide(),this.isQueryInFlight=!1,null!==this.nextPendingQuery&&this.trigger(this.nextPendingQuery)},this.handleMove=e=>{"UP"===e.detail.code?this.dropdown.up(e):this.dropdown.down(e)},this.handleEnter=e=>{const t=this.dropdown.getActiveItem();t?(this.dropdown.select(t),e.preventDefault()):this.dropdown.hide()},this.handleEsc=e=>{this.dropdown.isShown()&&(this.dropdown.hide(),e.preventDefault())},this.handleChange=e=>{null!=e.detail.beforeCursor?this.trigger(e.detail.beforeCursor):this.dropdown.hide()},this.handleSelect=e=>{this.emit("select",e),e.defaultPrevented||this.editor.applySearchResult(e.detail.searchResult)},this.handleResize=()=>{this.dropdown.isShown()&&this.dropdown.setOffset(this.editor.getCursorOffset())},this.completer=new s.Completer(t),this.dropdown=i.Dropdown.create((null==n?void 0:n.dropdown)||{}),this.startListening()}destroy(e=!0){return this.completer.destroy(),this.dropdown.destroy(),e&&this.editor.destroy(),this.stopListening(),this}isShown(){return this.dropdown.isShown()}hide(){return this.dropdown.hide(),this}trigger(e){return this.isQueryInFlight?this.nextPendingQuery=e:(this.isQueryInFlight=!0,this.nextPendingQuery=null,this.completer.run(e)),this}startListening(){var e;this.editor.on("move",this.handleMove).on("enter",this.handleEnter).on("esc",this.handleEsc).on("change",this.handleChange),this.dropdown.on("select",this.handleSelect);for(const e of o)this.dropdown.on(e,(t=>this.emit(e,t)));this.completer.on("hit",this.handleHit),null===(e=this.dropdown.el.ownerDocument.defaultView)||void 0===e||e.addEventListener("resize",this.handleResize)}stopListening(){var e;null===(e=this.dropdown.el.ownerDocument.defaultView)||void 0===e||e.removeEventListener("resize",this.handleResize),this.completer.removeAllListeners(),this.dropdown.removeAllListeners(),this.editor.removeListener("move",this.handleMove).removeListener("enter",this.handleEnter).removeListener("esc",this.handleEsc).removeListener("change",this.handleChange)}}t.Textcomplete=l},0:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(615),t),i(n(871),t),i(n(271),t),i(n(103),t),i(n(99),t),i(n(638),t),i(n(665),t)},665:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCustomEvent=void 0;const n="undefined"!=typeof window&&!!window.CustomEvent;t.createCustomEvent=(e,t)=>{if(n)return new CustomEvent(e,t);const r=document.createEvent("CustomEvent");return r.initCustomEvent(e,!1,(null==t?void 0:t.cancelable)||!1,(null==t?void 0:t.detail)||void 0),r}},456:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TextareaEditor=void 0;const i=n(531),s=r(n(37)),o=n(0),l=n(326);class a extends o.Editor{constructor(e){super(),this.el=e,this.onInput=()=>{this.emitChangeEvent()},this.onKeydown=e=>{const t=this.getCode(e);let n;"UP"===t||"DOWN"===t?n=this.emitMoveEvent(t):"ENTER"===t?n=this.emitEnterEvent():"ESC"===t&&(n=this.emitEscEvent()),n&&n.defaultPrevented&&e.preventDefault()},this.startListening()}destroy(){return super.destroy(),this.stopListening(),this}applySearchResult(e){const t=this.getBeforeCursor();if(null!=t){const n=e.replace(t,this.getAfterCursor());this.el.focus(),Array.isArray(n)&&((0,i.update)(this.el,n[0],n[1]),this.el&&this.el.dispatchEvent((0,o.createCustomEvent)("input")))}}getCursorOffset(){const e=(0,l.calculateElementOffset)(this.el),t=this.getElScroll(),n=this.getCursorPosition(),r=(0,l.getLineHeightPx)(this.el),i=e.top-t.top+n.top+r,s=e.left-t.left+n.left,o=this.el.getBoundingClientRect().top;return"rtl"!==this.el.dir?{top:i,left:s,lineHeight:r,clientTop:o}:{top:i,right:document.documentElement?document.documentElement.clientWidth-s:0,lineHeight:r,clientTop:o}}getBeforeCursor(){return this.el.selectionStart!==this.el.selectionEnd?null:this.el.value.substring(0,this.el.selectionEnd)}getAfterCursor(){return this.el.value.substring(this.el.selectionEnd)}getElScroll(){return{top:this.el.scrollTop,left:this.el.scrollLeft}}getCursorPosition(){return(0,s.default)(this.el,this.el.selectionEnd)}startListening(){this.el.addEventListener("input",this.onInput),this.el.addEventListener("keydown",this.onKeydown)}stopListening(){this.el.removeEventListener("input",this.onInput),this.el.removeEventListener("keydown",this.onKeydown)}}t.TextareaEditor=a},787:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextareaEditor=void 0;var r=n(456);Object.defineProperty(t,"TextareaEditor",{enumerable:!0,get:function(){return r.TextareaEditor}})},251:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateElementOffset=void 0,t.calculateElementOffset=e=>{const t=e.getBoundingClientRect(),n=e.ownerDocument;if(null==n)throw new Error("Given element does not belong to document");const{defaultView:r,documentElement:i}=n;if(null==r)throw new Error("Given element does not belong to window");const s={top:t.top+r.pageYOffset,left:t.left+r.pageXOffset};return i&&(s.top-=i.clientTop,s.left-=i.clientLeft),s}},675:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLineHeightPx=void 0;const n="0".charCodeAt(0),r="9".charCodeAt(0),i=e=>n<=e&&e<=r;t.getLineHeightPx=e=>{const t=getComputedStyle(e),n=t.lineHeight;if(i(n.charCodeAt(0))){const e=parseFloat(n);return i(n.charCodeAt(n.length-1))?e*parseFloat(t.fontSize):e}return s(e.nodeName,t)};const s=(e,t)=>{const n=document.body;if(!n)return 0;const r=document.createElement(e);r.innerHTML="&nbsp;",Object.assign(r.style,{fontSize:t.fontSize,fontFamily:t.fontFamily,padding:"0"}),n.appendChild(r),r instanceof HTMLTextAreaElement&&(r.rows=1);const i=r.offsetHeight;return n.removeChild(r),i}},326:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(251),t),i(n(675),t),i(n(960),t)},960:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSafari=void 0,t.isSafari=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},228:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,r,s,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var l=new i(r,s||e,o),a=n?n+t:t;return e._events[a]?e._events[a].fn?e._events[a]=[e._events[a],l]:e._events[a].push(l):(e._events[a]=l,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function l(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),l.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},l.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,s=r.length,o=new Array(s);i<s;i++)o[i]=r[i].fn;return o},l.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},l.prototype.emit=function(e,t,r,i,s,o){var l=n?n+e:e;if(!this._events[l])return!1;var a,h,c=this._events[l],d=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),d){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,r),!0;case 4:return c.fn.call(c.context,t,r,i),!0;case 5:return c.fn.call(c.context,t,r,i,s),!0;case 6:return c.fn.call(c.context,t,r,i,s,o),!0}for(h=1,a=new Array(d-1);h<d;h++)a[h-1]=arguments[h];c.fn.apply(c.context,a)}else{var u,p=c.length;for(h=0;h<p;h++)switch(c[h].once&&this.removeListener(e,c[h].fn,void 0,!0),d){case 1:c[h].fn.call(c[h].context);break;case 2:c[h].fn.call(c[h].context,t);break;case 3:c[h].fn.call(c[h].context,t,r);break;case 4:c[h].fn.call(c[h].context,t,r,i);break;default:if(!a)for(u=1,a=new Array(d-1);u<d;u++)a[u-1]=arguments[u];c[h].fn.apply(c[h].context,a)}}return!0},l.prototype.on=function(e,t,n){return s(this,e,t,n,!1)},l.prototype.once=function(e,t,n){return s(this,e,t,n,!0)},l.prototype.removeListener=function(e,t,r,i){var s=n?n+e:e;if(!this._events[s])return this;if(!t)return o(this,s),this;var l=this._events[s];if(l.fn)l.fn!==t||i&&!l.once||r&&l.context!==r||o(this,s);else{for(var a=0,h=[],c=l.length;a<c;a++)(l[a].fn!==t||i&&!l[a].once||r&&l[a].context!==r)&&h.push(l[a]);h.length?this._events[s]=1===h.length?h[0]:h:o(this,s)}return this},l.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&o(this,t)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l},37:e=>{!function(){var t=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],n="undefined"!=typeof window,r=n&&null!=window.mozInnerScreenX;function i(e,i,s){if(!n)throw new Error("textarea-caret-position#getCaretCoordinates should only be called in a browser");var o=s&&s.debug||!1;if(o){var l=document.querySelector("#input-textarea-caret-position-mirror-div");l&&l.parentNode.removeChild(l)}var a=document.createElement("div");a.id="input-textarea-caret-position-mirror-div",document.body.appendChild(a);var h=a.style,c=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,d="INPUT"===e.nodeName;h.whiteSpace="pre-wrap",d||(h.wordWrap="break-word"),h.position="absolute",o||(h.visibility="hidden"),t.forEach((function(e){d&&"lineHeight"===e?h.lineHeight=c.height:h[e]=c[e]})),r?e.scrollHeight>parseInt(c.height)&&(h.overflowY="scroll"):h.overflow="hidden",a.textContent=e.value.substring(0,i),d&&(a.textContent=a.textContent.replace(/\s/g," "));var u=document.createElement("span");u.textContent=e.value.substring(i)||".",a.appendChild(u);var p={top:u.offsetTop+parseInt(c.borderTopWidth),left:u.offsetLeft+parseInt(c.borderLeftWidth),height:parseInt(c.lineHeight)};return o?u.style.backgroundColor="#aaa":document.body.removeChild(a),p}void 0!==e.exports?e.exports=i:n&&(window.getCaretCoordinates=i)}()},44:(e,t,n)=>{const{CodeMirrorEditor:r}=n(811),{ContenteditableEditor:i}=n(786),{TextareaEditor:s}=n(787),{Textcomplete:o}=n(0);e.exports={CodeMirrorEditor:r,ContenteditableEditor:i,TextareaEditor:s,Textcomplete:o}},531:(e,t,n)=>{"use strict";function r(e,t,n){const r=e.value,i=t+(n||""),s=document.activeElement;let o=0,l=0;for(;o<r.length&&o<i.length&&r[o]===i[o];)o++;for(;r.length-l-1>=0&&i.length-l-1>=0&&r[r.length-l-1]===i[i.length-l-1];)l++;o=Math.min(o,Math.min(r.length,i.length)-l),e.setSelectionRange(o,r.length-l);const a=i.substring(o,i.length-l);if(e.focus(),!document.execCommand("insertText",!1,a)){e.value=i;const t=document.createEvent("Event");t.initEvent("input",!0,!0),e.dispatchEvent(t)}return e.setSelectionRange(t.length,t.length),s.focus(),e}function i(e,t,n){const i=e.selectionEnd,s=e.value.substr(0,e.selectionStart)+t,o=e.value.substring(e.selectionStart,i)+(n||"")+e.value.substr(i);return r(e,s,o),e.selectionEnd=i+t.length,e}n.r(t),n.d(t,{update:()=>r,wrapCursor:()=>i})}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r=n(44);self.TextCompleteBundle=r})();