|
|
import"./helpers-CjmtV6uB.js";import"./common-CalHcBJp.js";import{j as Fu}from"./index-C8mAaM2V.js";import{Q as Eu,t as Ol,H as Wu,d as Nl,c as Iu,o as Pl,f as Bu,al as Hu,i as zu,v as Ru,E as dl,am as Ku,b as _u,an as pl,h as vl}from"./index-bVOhw2NF.js";import{c as Uu,i as Gu,d as qu,g as Xu}from"./vue-repl-jaFwbjhK.js";function uf(){const We=(H,z)=>{z.addEventListener("message",H)},Ie=(H,z,V)=>{V.postMessage({type:H,data:z})};function y(H){var B;const z=document.getElementById(H.id);if(!z)return;const V=(B=z.querySelector(".iframe-container iframe"))==null?void 0:B.contentWindow;if(!V){Eu(y.bind(null,H));return}const{click:re,dblclick:I,mouseenter:D,mouseleave:_,change:T}=Fu();We(C=>{const{type:M,data:W}=C.data;if(M==="inited")Ol(()=>H.props.datasets,Z=>{Z&&Ie("update",Wu(Z),V)},{immediate:!0,deep:!0}),H.isRemote&&H.config&&Ie("config",JSON.parse(H.config),V);else if(M==="hookEmitEvent"){const{eventType:Z,value:O}=W;Z==="click"?re(H.props.datasets,O,H):Z==="dblclick"?I(H.props.datasets,O,H):Z==="mouseenter"?D(H.props.datasets,O,H):Z==="mouseleave"?_(H.props.datasets,O,H):Z==="change"&&T(H.props.datasets,O,H)}},V)}return{init:y}}var Ml={exports:{}};(function(We,Ie){(function(y,H){We.exports=H()})(Uu,function(){var y=navigator.userAgent,H=navigator.platform,z=/gecko\/\d/i.test(y),V=/MSIE \d/.test(y),re=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(y),I=/Edge\/(\d+)/.exec(y),D=V||re||I,_=D&&(V?document.documentMode||6:+(I||re)[1]),T=!I&&/WebKit\//.test(y),B=T&&/Qt\/\d+\.\d+/.test(y),C=!I&&/Chrome\/(\d+)/.exec(y),M=C&&+C[1],W=/Opera\//.test(y),Z=/Apple Computer/.test(navigator.vendor),O=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(y),S=/PhantomJS/.test(y),v=Z&&(/Mobile\/\w+/.test(y)||navigator.maxTouchPoints>2),g=/Android/.test(y),u=v||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(y),p=v||/Mac/.test(H),m=/\bCrOS\b/.test(y),w=/win/i.test(H),d=W&&y.match(/Version\/(\d*\.\d*)/);d&&(d=Number(d[1])),d&&d>=15&&(W=!1,T=!0);var L=p&&(B||W&&(d==null||d<12.11)),F=z||D&&_>=9;function N(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var U=function(e,t){var n=e.className,r=N(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function A(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function G(e,t){return A(e).appendChild(t)}function c(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function Q(e,t,n,r){var i=c(e,t,n,r);return i.setAttribute("role","presentation"),i}var j;document.createRange?j=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:j=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function ne(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function fe(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch{n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function ce(e,t){var n=e.className;N(t).test(n)||(e.className+=(n?" ":"")+t)}function we(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!N(n[r]).test(t)&&(t+=" "+n[r]);return t}var Be=function(e){e.select()};v?Be=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:D&&(Be=function(e){try{e.select()}catch{}});function Me(e){return e.display.wrapper.ownerDocument}function Ge(e){return Ee(e.display.wrapper)}function Ee(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function me(e){return Me(e).defaultView}function ge(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function xe(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function Le(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(``,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),a=o.indexOf("\r");a!=-1?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},sr=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},zn=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Et=null;function yi(e){if(Et!=null)return Et;var t=G(e,c("span","x")),n=t.getBoundingClientRect(),r=j(t,0,1).getBoundingClientRect();return Et=Math.abs(n.left-r.left)>1}var Fr={},Wt={};function It(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Fr[e]=t}function xr(e,t){Wt[e]=t}function Er(e){if(typeof e=="string"&&Wt.hasOwnProperty(e))e=Wt[e];else if(e&&typeof e.name=="string"&&Wt.hasOwnProperty(e.name)){var t=Wt[e.name];typeof t=="string"&&(t={name:t}),e=X(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Er("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Er("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Wr(e,t){t=Er(t);var n=Fr[t.name];if(!n)return Wr(e,"text/plain");var r=n(e,t);if(ur.hasOwnProperty(t.name)){var i=ur[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var ur={};function Ir(e,t){var n=ur.hasOwnProperty(e)?ur[e]:ur[e]={};xe(t,n)}function _t(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function ln(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Br(e,t,n){return e.startState?e.startState(t,n):!0}var _e=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};_e.prototype.eol=function(){return this.pos>=this.string.length},_e.prototype.sol=function(){return this.pos==this.lineStart},_e.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},_e.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},_e.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},_e.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},_e.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},_e.prototype.skipToEnd=function(){this.pos=this.string.length},_e.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},_e.prototype.backUp=function(e){this.pos-=e},_e.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Le(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Le(this.string,this.lineStart,this.tabSize):0)},_e.prototype.indentation=function(){return Le(this.string,null,this.tabSize)-(this.lineStart?Le(this.string,this.lineStart,this.tabSize):0)},_e.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(a){return n?a.toLowerCase():a},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var o=this.string.slice(this.pos).match(e);return o&&o.index>0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},_e.prototype.current=function(){return this.string.slice(this.start,this.pos)},_e.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},_e.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},_e.pr
`?(J=b.appendChild(c("span",E[0]=="\r"?"␍":"","cm-invalidchar")),J.setAttribute("cm-text",E[0]),e.col+=1):(J=e.cm.options.specialCharPlaceholder(E[0]),J.setAttribute("cm-text",E[0]),D&&_<9?b.appendChild(c("span",[J])):b.appendChild(J),e.col+=1);e.map.push(e.pos,e.pos+1,J),e.pos++}}if(e.trailingSpace=l.charCodeAt(t.length-1)==32,n||r||i||f||o||a){var le=n||"";r&&(le+=r),i&&(le+=i);var oe=c("span",[b],le,o);if(a)for(var se in a)a.hasOwnProperty(se)&&se!="style"&&se!="class"&&oe.setAttribute(se,a[se]);return e.content.appendChild(oe)}e.content.appendChild(b)}}function $l(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);o==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(o=" "),r+=o,n=o==" "}return r}function es(e,t){return function(n,r,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var f=n.pos,b=f+r.length;;){for(var k=void 0,E=0;E<t.length&&(k=t[E],!(k.to>f&&k.from<=f));E++);if(k.to>=b)return e(n,r,i,o,a,l,s);e(n,r.slice(0,k.to-f),i,o,null,l,s),o=null,r=r.slice(k.to-f),f=k.to}}}function Fo(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function ts(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var a=1;a<n.length;a+=2)t.addToken(t,i.slice(o,o=n[a]),Mo(n[a+1],t.cm.options));return}for(var l=i.length,s=0,f=1,b="",k,E,P=0,q,J,ee,ie,le;;){if(P==s){q=J=ee=E="",le=null,ie=null,P=1/0;for(var oe=[],se=void 0,ve=0;ve<r.length;++ve){var de=r[ve],ke=de.marker;if(ke.type=="bookmark"&&de.from==s&&ke.widgetNode)oe.push(ke);else if(de.from<=s&&(de.to==null||de.to>s||ke.collapsed&&de.to==s&&de.from==s)){if(de.to!=null&&de.to!=s&&P>de.to&&(P=de.to,J=""),ke.className&&(q+=" "+ke.className),ke.css&&(E=(E?E+";":"")+ke.css),ke.startStyle&&de.from==s&&(ee+=" "+ke.startStyle),ke.endStyle&&de.to==P&&(se||(se=[])).push(ke.endStyle,de.to),ke.title&&((le||(le={})).title=ke.title),ke.attributes)for(var Fe in ke.attributes)(le||(le={}))[Fe]=ke.attributes[Fe];ke.collapsed&&(!ie||wi(ie.marker,ke)<0)&&(ie=de)}else de.from>s&&P>de.from&&(P=de.from)}if(se)for(var tt=0;tt<se.length;tt+=2)se[tt+1]==P&&(J+=" "+se[tt]);if(!ie||ie.from==s)for(var ze=0;ze<oe.length;++ze)Fo(t,0,oe[ze]);if(ie&&(ie.from||0)==s){if(Fo(t,(ie.to==null?l+1:ie.to)-s,ie.marker,ie.from==null),ie.to==null)return;ie.to==s&&(ie=!1)}}if(s>=l)break;for(var Ct=Math.min(l,P);;){if(b){var bt=s+b.length;if(!ie){var Ye=bt>Ct?b.slice(0,Ct-s):b;t.addToken(t,Ye,k?k+q:q,ee,s+Ye.length==P?J:"",E,le)}if(bt>=Ct){b=b.slice(Ct-s),s=Ct;break}s=bt,ee=""}b=i.slice(o,o=n[f++]),k=Mo(n[f++],t.cm.options)}}}function Eo(e,t,n){this.line=t,this.rest=Xl(t),this.size=this.rest?h(Ce(this.rest))-n+1:1,this.node=this.text=null,this.hidden=fr(e,t)}function Xn(e,t,n){for(var r=[],i,o=t;o<n;o=i){var a=new Eo(e.doc,ue(e.doc,o),o);i=o+a.size,r.push(a)}return r}var Rr=null;function rs(e){Rr?Rr.ops.push(e):e.ownsGroup=Rr={ops:[e],delayedCallbacks:[]}}function ns(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function is(e,t){var n=e.ownsGroup;if(n)try{ns(n)}finally{Rr=null,t(n)}}var cn=null;function Ve(e,t){var n=Zt(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;Rr?i=Rr.delayedCallbacks:cn?i=cn:(i=cn=[],setTimeout(os,0));for(var o=function(l){i.push(function(){return n[l].apply(null,r)})},a=0;a<n.length;++a)o(a)}}function os(){var e=cn;cn=null;for(var t=0;t<e.length;++t)e[t]()}function Wo(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];o=="text"?ls(e,t):o=="gutter"?Bo(e,t,n,r):o=="class"?Ti(e,t):o=="widget"&&ss(e,t,r)}t.changes=null}function hn(e){return e.node==e.text&&(e.node=c("div",null,null,"position: relative"),e.text.parentNode&&
top: `+se+"px; width: "+(ve??s-oe)+`px; height: `+(de-se)+"px"))}function k(oe,se,ve){var de=ue(i,oe),ke=de.text.length,Fe,tt;function ze(Ye,xt){return Zn(e,K(oe,Ye),"div",de,xt)}function Ct(Ye,xt,ot){var Qe=Vo(e,de,null,Ye),Ze=xt=="ltr"==(ot=="after")?"left":"right",Ue=ot=="after"?Qe.begin:Qe.end-(/\s/.test(de.text.charAt(Qe.end-1))?2:1);return ze(Ue,Ze)[Ze]}var bt=Se(de,i.direction);return ir(bt,se||0,ve??ke,function(Ye,xt,ot,Qe){var Ze=ot=="ltr",Ue=ze(Ye,Ze?"left":"right"),kt=ze(xt-1,Ze?"right":"left"),rn=se==null&&Ye==0,yr=ve==null&&xt==ke,ft=Qe==0,Xt=!bt||Qe==bt.length-1;if(kt.top-Ue.top<=3){var rt=(f?rn:yr)&&ft,fo=(f?yr:rn)&&Xt,rr=rt?l:(Ze?Ue:kt).left,Nr=fo?s:(Ze?kt:Ue).right;b(rr,Ue.top,Nr-rr,Ue.bottom)}else{var Pr,ht,nn,co;Ze?(Pr=f&&rn&&ft?l:Ue.left,ht=f?s:Ct(Ye,ot,"before"),nn=f?l:Ct(xt,ot,"after"),co=f&&yr&&Xt?s:kt.right):(Pr=f?Ct(Ye,ot,"before"):l,ht=!f&&rn&&ft?s:Ue.right,nn=!f&&yr&&Xt?l:kt.left,co=f?Ct(xt,ot,"after"):s),b(Pr,Ue.top,ht-Pr,Ue.bottom),Ue.bottom<kt.top&&b(l,Ue.bottom,null,kt.top),b(nn,kt.top,co-nn,kt.bottom)}(!Fe||Jn(Ue,Fe)<0)&&(Fe=Ue),Jn(kt,Fe)<0&&(Fe=kt),(!tt||Jn(Ue,tt)<0)&&(tt=Ue),Jn(kt,tt)<0&&(tt=kt)}),{start:Fe,end:tt}}var E=t.from(),P=t.to();if(E.line==P.line)k(E.line,E.ch,P.ch);else{var q=ue(i,E.line),J=ue(i,P.line),ee=Bt(q)==Bt(J),ie=k(E.line,E.ch,ee?q.text.length+1:null).end,le=k(P.line,ee?0:null,P.ch).start;ee&&(ie.top<le.top-2?(b(ie.right,ie.top,null,ie.bottom),b(l,le.top,le.left,le.bottom)):b(ie.right,ie.top,le.left-ie.right,ie.bottom)),ie.bottom<le.top&&b(l,ie.bottom,null,le.top)}n.appendChild(o)}function Hi(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Gr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function ra(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Ri(e))}function zi(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Gr(e))},100)}function Ri(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Re(e,"focus",e,t),e.state.focused=!0,ce(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),T&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Hi(e))}function Gr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Re(e,"blur",e,t),e.state.focused=!1,U(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Vn(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,a=0;a<t.view.length;a++){var l=t.view[a],s=e.options.lineWrapping,f=void 0,b=0;if(!l.hidden){if(i+=l.line.height,D&&_<8){var k=l.node.offsetTop+l.node.offsetHeight;f=k-n,n=k}else{var E=l.node.getBoundingClientRect();f=E.bottom-E.top,!s&&l.text.firstChild&&(b=l.text.firstChild.getBoundingClientRect().right-E.left-1)}var P=l.line.height-f;if((P>.005||P<-.005)&&(i<r&&(o-=P),At(l.line,f),na(l.line),l.rest))for(var q=0;q<l.rest.length;q++)na(l.rest[q]);if(b>e.display.sizerWidth){var J=Math.ceil(b/Ur(e.display));J>e.display.maxLineLength&&(e.display.maxLineLength=J,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function na(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function $n(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-jn(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,o=x(t,r),a=x(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;l<o?(o=l,a=x(t,Vt(ue(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=x(t,Vt(ue(t,s))-e.wrapper.clientHeight),a=s)}retur
top: `+(t.top-n.viewOffset-jn(e.display))+`px; height: `+(t.bottom-t.top+Gt(e)+n.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(i),e.display.lineSpace.removeChild(a)}}}function ws(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?K(t.line,t.ch+1,"before"):t,t=t.ch?K(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,l=Ht(e,t),s=!n||n==t?l:Ht(e,n);i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-r,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+r};var f=Ki(e,i),b=e.doc.scrollTop,k=e.doc.scrollLeft;if(f.scrollTop!=null&&(mn(e,f.scrollTop),Math.abs(e.doc.scrollTop-b)>1&&(a=!0)),f.scrollLeft!=null&&(Lr(e,f.scrollLeft),Math.abs(e.doc.scrollLeft-k)>1&&(a=!0)),!a)break}return i}function Ss(e,t){var n=Ki(e,t);n.scrollTop!=null&&mn(e,n.scrollTop),n.scrollLeft!=null&&Lr(e,n.scrollLeft)}function Ki(e,t){var n=e.display,r=_r(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=Oi(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Ai(n),s=t.top<r,f=t.bottom>l-r;if(t.top<i)a.scrollTop=s?0:t.top;else if(t.bottom>i+o){var b=Math.min(t.top,(f?l:t.bottom)-o);b!=i&&(a.scrollTop=b)}var k=e.options.fixedGutter?0:n.gutters.offsetWidth,E=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-k,P=kr(e)-n.gutters.offsetWidth,q=t.right-t.left>P;return q&&(t.right=t.left+P),t.left<10?a.scrollLeft=0:t.left<E?a.scrollLeft=Math.max(0,t.left+k-(q?0:10)):t.right>P+E-3&&(a.scrollLeft=t.right+(q?0:10)-P),a}function _i(e,t){t!=null&&(ei(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function qr(e){ei(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function gn(e,t,n){(t!=null||n!=null)&&ei(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Cs(e,t){ei(e),e.curOp.scrollToPos=t}function ei(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Qo(e,t.from),r=Qo(e,t.to);ia(e,n,r,t.margin)}}function ia(e,t,n,r){var i=Ki(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});gn(e,i.scrollLeft,i.scrollTop)}function mn(e,t){Math.abs(e.doc.scrollTop-t)<2||(z||Gi(e,{top:t}),oa(e,t,!0),z&&Gi(e),xn(e,100))}function oa(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Lr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,fa(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function yn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Ai(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Gt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Tr=function(e,t,n){this.cm=n;var r=this.vert=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=c("div",[c("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),pe(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),pe(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,D&&_<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Tr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.h
`},setDirection:et(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&Rs(this.cm))})}),yt.prototype.eachLine=yt.prototype.iter;var Ka=0;function $s(e){var t=this;if(_a(t),!(Ke(t,e)||$t(t.display,e))){st(e),D&&(Ka=+new Date);var n=Sr(t,e,!0),r=e.dataTransfer.files;if(!(!n||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,l=function(){++a==i&&$e(t,function(){n=ye(t.doc,n);var P={from:n,to:n,text:t.doc.splitLines(o.filter(function(q){return q!=null}).join(t.doc.lineSeparator())),origin:"paste"};Zr(t.doc,P),Ta(t.doc,dr(ye(t.doc,n),ye(t.doc,pr(P))))})()},s=function(P,q){if(t.options.allowDropFileTypes&&he(t.options.allowDropFileTypes,P.type)==-1){l();return}var J=new FileReader;J.onerror=function(){return l()},J.onload=function(){var ee=J.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(ee)){l();return}o[q]=ee,l()},J.readAsText(P)},f=0;f<r.length;f++)s(r[f],f);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var b=e.dataTransfer.getData("Text");if(b){var k;if(t.state.draggingText&&!t.state.draggingText.copy&&(k=t.listSelections()),ai(t.doc,dr(n,n)),k)for(var E=0;E<k.length;++E)Qr(t.doc,"",k[E].anchor,k[E].head,"drag");t.replaceSelection(b,"around","paste"),t.display.input.focus()}}catch{}}}}function eu(e,t){if(D&&(!e.state.draggingText||+new Date-Ka<100)){ar(t);return}if(!(Ke(e,t)||$t(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!Z)){var n=c("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",W&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),W&&n.parentNode.removeChild(n)}}function tu(e,t){var n=Sr(e,t);if(n){var r=document.createDocumentFragment();Bi(e,n,r),e.display.dragCursor||(e.display.dragCursor=c("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),G(e.display.dragCursor,r)}}function _a(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ua(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var o=0;o<n.length;o++)e(n[o])})}}var Ga=!1;function ru(){Ga||(nu(),Ga=!0)}function nu(){var e;pe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ua(iu)},100))}),pe(window,"blur",function(){return Ua(Gr)})}function iu(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var mr={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Nn=0;Nn<10;Nn++)mr[Nn+48]=mr[Nn+96]=String(Nn);for(var ui=65;ui<=90;ui++)mr[ui]=String.fromCharCode(ui);for(var Pn=1;Pn<=12;Pn++)mr[Pn+111]=mr[Pn+63235]="F"+Pn;var tr={};tr.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},tr.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z"`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ya(e,t){var n=ue(e.doc,t),r=Bt(n);return r!=n&&(t=h(r)),ro(!0,e,r,t,1)}function su(e,t){var n=ue(e.doc,t),r=ql(n);return r!=n&&(t=h(r)),ro(!0,e,n,t,-1)}function Za(e,t){var n=Ya(e,t.line),r=ue(e.doc,n.line),i=Se(r,e.doc.direction);if(!i||i[0].level==0){var o=Math.max(n.ch,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return K(n.line,a?0:o,n.sticky)}return n}function ci(e,t,n){if(typeof t=="string"&&(t=Mn[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Mt}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function uu(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Vr(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Vr(t,e.options.extraKeys,n,e)||Vr(t,e.options.keyMap,n,e)}var fu=new be;function Dn(e,t,n,r){var i=e.state.keySeq;if(i){if(qa(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:fu.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),Qa(e,i+" "+t,n,r))return!0}return Qa(e,t,n,r)}function Qa(e,t,n,r){var i=uu(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&Ve(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(st(n),Hi(e)),!!i}function Ja(e,t){var n=ja(t,!0);return n?t.shiftKey&&!e.state.keySeq?Dn(e,"Shift-"+n,t,function(r){return ci(e,r,!0)})||Dn(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return ci(e,r)}):Dn(e,n,t,function(r){return ci(e,r)}):!1}function cu(e,t,n){return Dn(e,"'"+n+"'",t,function(r){return ci(e,r,!0)})}var no=null;function Va(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=fe(Ge(t)),!Ke(t,e))){D&&_<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=Ja(t,e);W&&(no=r?n:null,!r&&n==88&&!zn&&(p?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),z&&!p&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&hu(t)}}function hu(e){var t=e.display.lineDiv;ce(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(U(t,"CodeMirror-crosshair"),lt(document,"keyup",n),lt(document,"mouseover",n))}pe(document,"keyup",n),pe(document,"mouseover",n)}function $a(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ke(this,e)}function el(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!($t(t.display,e)||Ke(t,e)||e.ctrlKey&&!e.altKey||p&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(W&&n==no){no=null,st(e);return}if(!(W&&(!e.which||e.which<10)&&Ja(t,e))){var i=String.fromCharCode(r??n);i!="\b"&&(cu(t,e,i)||t.display.input.onKeyPress(e))}}}var du=400,io=function(e,t,n){this.time=e,this.pos=t,this.button=n};io.prototype.compare=function(e,t,n){return this.time+du>e&&ae(t,this.pos)==0&&n==this.button};var Fn,En;function pu(e,t){var n=+new Date;return En&&En.compare(n,e,t)?(Fn=En=null,"triple"):Fn&&Fn.compare(n,e,t)?(En=new io(n,e,t),Fn=null,"double"):(Fn=new io(n,e,t),En=null,"single")}function tl(e){var t=this,n=t.display;if(!(Ke(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,$t(n,e)){T||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!oo(t,e)){var r=Sr(t,e),i=Ft(e),o=r?pu(r,i):"single";me(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&vu(t,i,r,o,e))&&(i==1?r?mu(t,r,o,e):on(e)==n.scroller&&st(e):i==2?(r&&oi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(F?t.display.input.onContextMenu(e):zi(t)))}}}function vu(e,t,n,r,i){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,Dn(e,Xa(o,i),i,function(a){if(typeof a=="string"&&(a=Mn[a]),!a)return!1;var l=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),l=a(e,n)!=Mt}finally{e.state.suppressEdits=!1}return l})}function gu(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==
`)==t){if(r.ranges.length%Rt.text.length==0){f=[];for(var b=0;b<Rt.text.length;b++)f.push(o.splitLines(Rt.text[b]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(f=De(s,function(ie){return[ie]}));for(var k=e.curOp.updateInput,E=r.ranges.length-1;E>=0;E--){var P=r.ranges[E],q=P.from(),J=P.to();P.empty()&&(n&&n>0?q=K(q.line,q.ch-n):e.state.overwrite&&!l?J=K(J.line,Math.min(ue(o,J.line).text.length,J.ch+Ce(s).length)):l&&Rt&&Rt.lineWise&&Rt.text.join(``)==s.join(``)&&(q=J=K(q.line,0)));var ee={from:q,to:J,text:f?f[E%f.length]:s,origin:i||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};Zr(e.doc,ee),Ve(e,"inputRead",e,ee)}t&&!l&&sl(e,t),qr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=k),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ll(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&St(t,function(){return lo(t,n,0,null,"paste")}),!0}function sl(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=Wn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(ue(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Wn(e,i.head.line,"smart"));a&&Ve(e,"electricInput",e,i.head.line)}}}function ul(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:K(i,0),head:K(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function so(e,t,n,r){e.setAttribute("autocorrect",n?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function fl(){var e=c("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=c("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return T?e.style.width="1000px":e.setAttribute("wrap","off"),v&&(e.style.border="1px solid black"),t}function Tu(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){me(this).focus(),this.display.input.focus()},setOption:function(r,i){var o=this.options,a=o[r];o[r]==i&&r!="mode"||(o[r]=i,t.hasOwnProperty(r)&&$e(this,t[r])(this,i,a),Re(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](fi(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,o=0;o<i.length;++o)if(i[o]==r||i[o].name==r)return i.splice(o,1),!0},addOverlay:ct(function(r,i){var o=r.token?r:e.getMode(this.options,r);if(o.startState)throw new Error("Overlays may not be stateful.");R(this.state.overlays,{mode:o,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(a){return a.priority}),this.state.modeGen++,mt(this)}),removeOverlay:ct(function(r){for(var i=this.state.overlays,o=0;o<i.length;++o){var a=i[o].modeSpec;if(a==r||typeof r=="string"&&a.name==r){i.splice(o,1),this.state.modeGen++,mt(this);return}}}),indentLine:ct(function(r,i,o){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),Y(this.doc,r)&&Wn(this,r,i,o)}),indentSelection:ct(function(r){for(var i=this.doc.sel.ranges,o=-1,a=0;a<i.length;a++){var l=i[a];if(l.empty())l.head.line>o&&(Wn(this,l.head.line,r,!0),o=l.head.line,a==this.doc.sel.primIndex&&qr(this));else{var s=l.from(),f=l.to(),b=Math.max(o,s.line);o=Math.min(this.lastLine(),f.line-(f.ch?0:1))+1;for(var k=b;k<o;++k)Wn(this,k,r);var E=this.doc.sel.ranges;s.ch==0&&i.length==E.length&&E[a].from().ch>0&&$i(this.doc,a,new Ne(s,E[a].to()),dt)}}}),getTokenAt:function(r,i){return xo(this,r,i)},getLineTokens:function(r,i){return xo(this,K(r),i,!0)},getTokenTypeAt:function(r){r=ye(this.doc,r);var i=mo(this,ue(this.doc,r.line)),o=0,a=(i.length-1)/2,l=r.ch,s;if(l==0)s=i[2];else for(;;){var f=o+a>>1;if((f?i[f*2-1]:0)>=l)a=f;else if(i[f*2+1]<l)o=f+1;else{s=i[f*2+2];break}}var b=s?s.indexOf("overlay "):-1;return b<0?s:b==0?null:s.slice(0,b-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var o=[];if(!n.hasOwnProperty(i))return o;var a=n[i],l=this.getModeAt(r);if(typeof l[i]=="string")a[l[i]]&&o.pu
`,ee=jt(J,P)?"w":E&&J==``?"n":!E||/\s/.test(J)?null:"p";if(E&&!q&&!ee&&(ee="s"),k&&k!=ee){n<0&&(n=1,b(),t.sticky="after");break}if(ee&&(k=ee),n>0&&!b(!q))break}var ie=li(e,t,o,a,!0);return Oe(o,ie)&&(ie.hitSide=!0),ie}function cl(e,t,n,r){var i=e.doc,o=t.left,a;if(r=="page"){var l=Math.min(e.display.wrapper.clientHeight,me(e).innerHeight||i(e).documentElement.clientHeight),s=Math.max(l-.5*_r(e.display),3);a=(n>0?t.bottom:t.top)+n*s}else r=="line"&&(a=n>0?t.bottom+3:t.top-3);for(var f;f=Di(e,o,a),!!f.outside;){if(n<0?a<=0:a>=i.height){f.hitSide=!0;break}a+=n*5}return f}var Pe=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new be,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Pe.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,so(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function o(l){for(var s=l.target;s;s=s.parentNode){if(s==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}pe(i,"paste",function(l){!o(l)||Ke(r,l)||ll(l,r)||_<=11&&setTimeout($e(r,function(){return t.updateFromDOM()}),20)}),pe(i,"compositionstart",function(l){t.composing={data:l.data,done:!1}}),pe(i,"compositionupdate",function(l){t.composing||(t.composing={data:l.data,done:!1})}),pe(i,"compositionend",function(l){t.composing&&(l.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),pe(i,"touchstart",function(){return n.forceCompositionEnd()}),pe(i,"input",function(){t.composing||t.readFromDOMSoon()});function a(l){if(!(!o(l)||Ke(r,l))){if(r.somethingSelected())di({lineWise:!1,text:r.getSelections()}),l.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=ul(r);di({lineWise:!0,text:s.text}),l.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,dt),r.replaceSelection("",null,"cut")})}else return;if(l.clipboardData){l.clipboardData.clearData();var f=Rt.text.join(``);if(l.clipboardData.setData("Text",f),l.clipboardData.getData("Text")==f){l.preventDefault();return}}var b=fl(),k=b.firstChild;so(k),r.display.lineSpace.insertBefore(b,r.display.lineSpace.firstChild),k.value=Rt.text.join(``);var E=fe(Ee(i));Be(k),setTimeout(function(){r.display.lineSpace.removeChild(b),E.focus(),E==i&&n.showPrimarySelection()},50)}}pe(i,"copy",a),pe(i,"cut",a)},Pe.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Pe.prototype.prepareSelection=function(){var e=ta(this.cm,!1);return e.focus=fe(Ee(this.div))==this.div,e},Pe.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Pe.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Pe.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var o=pi(t,e.anchorNode,e.anchorOffset),a=pi(t,e.focusNode,e.focusOffset);if(!(o&&!o.bad&&a&&!a.bad&&ae(Hr(o,a),r)==0&&ae(gt(o,a),i)==0)){var l=t.display.view,s=r.line>=t.display.viewFrom&&hl(t,r)||{node:l[0].measure.map[2],offset:0},f=i.line<t.display.viewTo&&hl(t,i);if(!f){var b=l[l.length-1].measure,k=b.maps?b.maps[b.maps.length-1]:b.map;f={node:k[k.length-1],offset:k[k.length-2]-k[k.length-3]}}if(!s||!f){e.removeAllRanges();return}var E=e.rangeCount&&e.getRangeAt(0),P;try{P=j(s.node,s.offset,f.offset,f.node)}catch{}P&&(!z&&t.state.focused?(e.collapse(s.node,s.offset),P.collapsed||(e.removeAllRanges(),e.addRange(P))):(e.removeAllRanges(),e.addRange(P)),E&&e.anchorNode==null?e.addRange(E):z&&this.startGracePeriod()),this.rememberSelection()}},Pe.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Pe.prototype.showMultipleSelections=function(e){G(this.cm.display.cursorDiv,e.cursors),G(this.cm.display.selectionDiv,e.selection)},Pe.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Pe.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return ne(this.div,t)},Pe.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||fe(Ee(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Pe.prototype.blur=function(){this.div.blur()},Pe.prototype.getField=function(){return this.div},Pe.prototype.supportsTouch=function(){return!0},Pe.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):St(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function n(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,n))}this.polling.set(this.cm.options.pollInterval,n)},Pe.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Pe.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(g&&C&&this.cm.display.gutterSpecs.length&&Au(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=pi(t,e.anchorNode,e.anchorOffset),r=pi(t,e.focusNode,e.focusOffset);n&&r&&St(t,function(){ut(t.doc,dr(n,r),dt),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},Pe.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=K(r.line-1,ue(e.doc,r.line-1).length)),i.ch==ue(e.doc,i.li
`),Be(i))}else return;a.type=="cut"&&(r.state.cutIncoming=+new Date)}}pe(i,"cut",o),pe(i,"copy",o),pe(e.scroller,"paste",function(a){if(!($t(e,a)||Ke(r,a))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var l=new Event("paste");l.clipboardData=a.clipboardData,i.dispatchEvent(l)}}),pe(e.lineSpace,"selectstart",function(a){$t(e,a)||st(a)}),pe(i,"compositionstart",function(){var a=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:a,range:r.markText(a,r.getCursor("to"),{className:"CodeMirror-composing"})}}),pe(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},qe.prototype.createField=function(e){this.wrapper=fl(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;so(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},qe.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},qe.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=ta(e);if(e.options.moveInputWithCursor){var i=Ht(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},qe.prototype.showSelection=function(e){var t=this.cm,n=t.display;G(n.cursorDiv,e.cursors),G(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},qe.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&Be(this.textarea),D&&_>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",D&&_>=9&&(this.hasSelection=null));this.resetting=!1}},qe.prototype.getField=function(){return this.textarea},qe.prototype.supportsTouch=function(){return!1},qe.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!u||fe(Ee(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},qe.prototype.blur=function(){this.textarea.blur()},qe.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},qe.prototype.receivedFocus=function(){this.slowPoll()},qe.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},qe.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},qe.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||sr(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(D&&_>=9&&this.hasSelection===i||p&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(o==8203&&!r&&(r=""),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var a=0,l=Math.min(r.length,i.length);a<l&&r.charCodeAt(a)==i.charCodeAt(a);)++a;return St(t,function(){lo(t,i.slice(a),r.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(``)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},qe.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},qe.prototype.onKeyPress=function(){D&&_>=9&&(this.hasSelection=null),this.fastPoll()},qe.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Sr(n,e),a=r.scroller.scrollTop;if(!o||W)return;var l=n.options.resetSelectionOnContextMenu;l&&n.doc.sel.contains(o)==-1&&$e(n,ut)(n.doc,dr(o),dt);var s=i.style.cssText,f=t.wrapper.style.cssText,b=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-b.top-5)+"px; left: "+(e.clientX-b.left-5)+`px; z-index: 1000; background: `+(D?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var k;T&&(k=i.ownerDocument.defaultView.scrollY),r.input.focus(),T&&i.ownerDocument.defaultView.scrollTo(null,k),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=P,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function E(){if(i.selectionStart!=null){var J=n.somethingSelected(),ee=""+(J?i.value:"");i.value="⇚",i.value=ee,t.prevInput=J?"":"",i.selectionStart=1,i.selectionEnd=ee.length,r.selForContextMenu=n.doc.sel}}function P(){if(t.contextMenuPending==P&&(t.contextMenuPending=!1,t.wrapper.style.cssText=f,i.style.cssText=s,D&&_<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=a),i.selectionStart!=null)){(!D||D&&_<9)&&E();var J=0,ee=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput==""?$e(n,Ma)(n):J++<10?r.detectingSelectAll=setTimeout(ee,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(ee,200)}}if(D&&_>=9&&E(),F){ar(e);var q=function(){lt(window,"mouseup",q),setTimeout(P,20)};pe(window,"mouseup",q)}else setTimeout(P,50)},qe.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},qe.prototype.setUneditable=function(){},qe.prototype.needsContentAttribute=!1;function Pu(e,t){if(t=t?xe(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=fe(Ee(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=l.getValue()}var i;if(e.form&&(pe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch{}}t.finishInit=function(s){s.save=r,s.getTextArea=function(){return e},s.toTextArea=function(){s.toTextArea=isNaN,r(),e.parentNode.removeChild(s.getWrapperElement()),e.style.display="",e.form&&(lt(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var l=He(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return l}function Mu(e){e.off=lt,e.on=pe,e.wheelEventPixels=Hs,e.Doc=yt,e.splitLines=Pt,e.countColumn=Le,e.findColumn=Xe,e.isWordChar=at,e.Pass=Mt,e.signal=Re,e.Line=zr,e.changeEnd=pr,e.scrollbarModel=la,e.Pos=K,e.cmpPos=ae,e.modes=Fr,e.mimeModes=Wt,e.resolveMode=Er,e.getMode=Wr,e.modeExtensions=ur,e.extendMode=Ir,e.copyState=_t,e.startState=Br,e.innerMode=ln,e.commands=Mn,e.keyMap=tr,e.keyName=ja,e.isModifierKey=qa,e.lookupKey=Vr,e.normalizeKeyMap=au,e.StringStream=_e,e.SharedTextMarker=On,e.TextMarker=gr,e.LineWidget=An,e.e_preventDefault=st,e.e_stopPropagation=Mr,e.e_stop=ar,e.addClass=ce,e.contains=ne,e.rmClass=U,e.keyNames=mr}wu(He),Tu(He);var Du="iter insert remove copy getEditor constructor".split(" ");for(var vi in yt.prototype)yt.prototype.hasOwnProperty(vi)&&he(Du,vi)<0&&(He.prototype[vi]=function(e){return function(){return e.apply(this.doc,arguments)}}(yt.prototype[vi]));return Dt(yt),He.inputStyles={textarea:qe,contenteditable:Pe},He.defineMode=function(e){!He.defaults.mode&&e!="null"&&(He.defaults.mode=e),It.apply(this,arguments)},He.defineMIME=xr,He.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),He.defineMIME("text/plain","null"),He.defineExtension=function(e,t){He.prototype[e]=t},He.defineDocExtension=function(e,t){yt.prototype[e]=t},He.fromTextArea=Pu,Mu(He),He.version="5.65.18",He})})(Ml);var nt=Ml.exports;const ju=Xu(nt);var Yu={exports:{}};(function(We,Ie){(function(y){y(nt)})(function(y){y.defineMode("javascript",function(H,z){var V=H.indentUnit,re=z.statementIndent,I=z.jsonld,D=z.json||I,_=z.trackScope!==!1,T=z.typescript,B=z.wordCharacters||/[\w$\xa1-\uffff]/,C=function(){function h(Je){return{type:Je,style:"keyword"}}var x=h("keyword a"),Y=h("keyword b"),$=h("keyword c"),K=h("keyword d"),ae=h("operator"),Oe={type:"atom",style:"atom"};return{if:h("if"),while:x,
`;S.replaceSelection(w+w,null),C(S,-1),u=S.listSelections();for(var d=0;d<u.length;d++){var L=u[d].head.line;S.indentLine(L,null,!0),S.indentLine(L+1,null,!0)}})}function C(S,v){for(var g=[],u=S.listSelections(),p=0,m=0;m<u.length;m++){var w=u[m];w.head==S.getCursor()&&(p=m);var d=w.head.ch||v>0?{line:w.head.line,ch:w.head.ch+v}:{line:w.head.line-1};g.push({anchor:d,head:d})}S.setSelections(g,p)}function M(S){var v=y.cmpPos(S.anchor,S.head)>0;return{anchor:new z(S.anchor.line,S.anchor.ch+(v?-1:1)),head:new z(S.head.line,S.head.ch+(v?1:-1))}}function W(S,v){var g=_(S);if(!g||S.getOption("disableInput"))return y.Pass;var u=V(g,"pairs"),p=u.indexOf(v);if(p==-1)return y.Pass;for(var m=V(g,"closeBefore"),w=V(g,"triples"),d=u.charAt(p+1)==v,L=S.listSelections(),F=p%2==0,N,U=0;U<L.length;U++){var A=L[U],G=A.head,c,Q=S.getRange(G,z(G.line,G.ch+1));if(F&&!A.empty())c="surround";else if((d||!F)&&Q==v)d&&O(S,G)?c="both":w.indexOf(v)>=0&&S.getRange(G,z(G.line,G.ch+3))==v+v+v?c="skipThree":c="skip";else if(d&&G.ch>1&&w.indexOf(v)>=0&&S.getRange(z(G.line,G.ch-2),G)==v+v){if(G.ch>2&&/\bstring/.test(S.getTokenTypeAt(z(G.line,G.ch-2))))return y.Pass;c="addFour"}else if(d){var j=G.ch==0?" ":S.getRange(z(G.line,G.ch-1),G);if(!y.isWordChar(Q)&&j!=v&&!y.isWordChar(j))c="both";else return y.Pass}else if(F&&(Q.length===0||/\s/.test(Q)||m.indexOf(Q)>-1))c="both";else return y.Pass;if(!N)N=c;else if(N!=c)return y.Pass}var ne=p%2?u.charAt(p-1):v,fe=p%2?v:u.charAt(p+1);S.operation(function(){if(N=="skip")C(S,1);else if(N=="skipThree")C(S,3);else if(N=="surround"){for(var ce=S.getSelections(),we=0;we<ce.length;we++)ce[we]=ne+ce[we]+fe;S.replaceSelections(ce,"around"),ce=S.listSelections().slice();for(var we=0;we<ce.length;we++)ce[we]=M(ce[we]);S.setSelections(ce)}else N=="both"?(S.replaceSelection(ne+fe,null),S.triggerElectric(ne+fe),C(S,-1)):N=="addFour"&&(S.replaceSelection(ne+ne+ne+ne,"before"),C(S,1))})}function Z(S,v){var g=S.getRange(z(v.line,v.ch-1),z(v.line,v.ch+1));return g.length==2?g:null}function O(S,v){var g=S.getTokenAt(z(v.line,v.ch+1));return/\bstring/.test(g.type)&&g.start==v.ch&&(v.ch==0||!/\bstring/.test(S.getTokenTypeAt(v)))}})})();var xl={exports:{}},kl;function Ju(){return kl||(kl=1,function(We,Ie){(function(y){y(nt)})(function(y){var H=y.Pos;function z(v,g){return v.line-g.line||v.ch-g.ch}var V="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",re=V+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",I=new RegExp("<(/?)(["+V+"]["+re+"]*)","g");function D(v,g,u,p){this.line=g,this.ch=u,this.cm=v,this.text=v.getLine(g),this.min=p?Math.max(p.from,v.firstLine()):v.firstLine(),this.max=p?Math.min(p.to-1,v.lastLine()):v.lastLine()}function _(v,g){var u=v.cm.getTokenTypeAt(H(v.line,g));return u&&/\btag\b/.test(u)}function T(v){if(!(v.line>=v.max))return v.ch=0,v.text=v.cm.getLine(++v.line),!0}function B(v){if(!(v.line<=v.min))return v.text=v.cm.getLine(--v.line),v.ch=v.text.length,!0}function C(v){for(;;){var g=v.text.indexOf(">",v.ch);if(g==-1){if(T(v))continue;return}if(!_(v,g+1)){v.ch=g+1;continue}var u=v.text.lastIndexOf("/",g),p=u>-1&&!/\S/.test(v.text.slice(u+1,g));return v.ch=g+1,p?"selfClose":"regular"}}function M(v){for(;;){var g=v.ch?v.text.lastIndexOf("<",v.ch-1):-1;if(g==-1){if(B(v))continue;return}if(!_(v,g+1)){v.ch=g;continue}I.lastIndex=g,v.ch=g;var u=I.exec(v.text);if(u&&u.index==g)return u}}function W(v){for(;;){I.lastIndex=v.ch;var g=I.exec(v.text);if(!g){if(T(v))continue;return}if(!_(v,g.index+1)){v.ch=g.index+1;continue}return v.ch=g.index+g[0].length,g}}function Z(v){for(;;){var g=v.ch?v.text.lastIndexOf(">",v.ch-1):-1;if(g==-1){if(B(v))continue;return}if(!_(v,g+1)){v.ch=g;continue}var u=v.text.lastIndexOf("/",g),p=u>-1&&!/\S/.test(v.text.slice(u+1,g));return v.ch=g+1,p?"selfClose":"regular"}}function O(v,g){for(var u=[];;){var p=W(v),m,w=v.line,d=v.ch-(p?p[0].length:0);if(!p||!(m=C(v)))return;if(m!="selfClose")if(p[1]){for(var L=u.length-1;L>=0;--L)if(u[L]==p[2]){u.length=L;break}if(L<0&&(!g||g
`:"")+"</"+u+">",newPos:F?y.Pos(Z.line+1,0):y.Pos(Z.line,Z.ch+1)}}for(var N=typeof M=="object"&&M.dontIndentOnAutoClose,W=B.length-1;W>=0;W--){var U=C[W];T.replaceRange(U.text,B[W].head,B[W].anchor,"+insert");var A=T.listSelections().slice(0);A[W]={head:U.newPos,anchor:U.newPos},T.setSelections(A),!N&&U.indent&&(T.indentLine(U.newPos.line,null,!0),T.indentLine(U.newPos.line+1,null,!0))}}function re(T,B){for(var C=T.listSelections(),M=[],W=B?"/":"</",Z=T.getOption("autoCloseTags"),O=typeof Z=="object"&&Z.dontIndentOnSlash,S=0;S<C.length;S++){if(!C[S].empty())return y.Pass;var v=C[S].head,g=T.getTokenAt(v),u=y.innerMode(T.getMode(),g.state),p=u.state;if(B&&(g.type=="string"||g.string.charAt(0)!="<"||g.start!=v.ch-1))return y.Pass;var m,w=u.mode.name!="xml"&&T.getMode().name=="htmlmixed";if(w&&u.mode.name=="javascript")m=W+"script";else if(w&&u.mode.name=="css")m=W+"style";else{var d=u.mode.xmlCurrentContext&&u.mode.xmlCurrentContext(p),L=d.length?d[d.length-1]:"";if(!d||d.length&&_(T,d,L,v))return y.Pass;m=W+L}T.getLine(v.line).charAt(g.end)!=">"&&(m+=">"),M[S]=m}if(T.replaceSelections(M),C=T.listSelections(),!O)for(var S=0;S<C.length;S++)(S==C.length-1||C[S].head.line<C[S+1].head.line)&&T.indentLine(C[S].head.line)}function I(T){return T.getOption("disableInput")?y.Pass:re(T,!0)}y.commands.closeTag=function(T){return re(T)};function D(T,B){if(T.indexOf)return T.indexOf(B);for(var C=0,M=T.length;C<M;++C)if(T[C]==B)return C;return-1}function _(T,B,C,M,W){if(!y.scanForClosingTag)return!1;var Z=Math.min(T.lastLine()+1,M.line+500),O=y.scanForClosingTag(T,M,null,Z);if(!O||O.tag!=C)return!1;for(var S=W?1:0,v=B.length-1;v>=0&&B[v]==C;v--)++S;M=O.to;for(var v=1;v<S;v++){var g=y.scanForClosingTag(T,M,null,Z);if(!g||g.tag!=C)return!1;M=g.to}return!0}})})();(function(We,Ie){(function(y){y(nt)})(function(y){var H={},z=/[^\s\u00a0]/,V=y.Pos,re=y.cmpPos;function I(T){var B=T.search(z);return B==-1?0:B}y.commands.toggleComment=function(T){T.toggleComment()},y.defineExtension("toggleComment",function(T){T||(T=H);for(var B=this,C=1/0,M=this.listSelections(),W=null,Z=M.length-1;Z>=0;Z--){var O=M[Z].from(),S=M[Z].to();O.line>=C||(S.line>=C&&(S=V(C,0)),C=O.line,W==null?B.uncomment(O,S,T)?W="un":(B.lineComment(O,S,T),W="line"):W=="un"?B.uncomment(O,S,T):B.lineComment(O,S,T))}});function D(T,B,C){return/\bstring\b/.test(T.getTokenTypeAt(V(B.line,0)))&&!/^[\'\"\`]/.test(C)}function _(T,B){var C=T.getMode();return C.useInnerComments===!1||!C.innerMode?C:T.getModeAt(B)}y.defineExtension("lineComment",function(T,B,C){C||(C=H);var M=this,W=_(M,T),Z=M.getLine(T.line);if(!(Z==null||D(M,T,Z))){var O=C.lineComment||W.lineComment;if(!O){(C.blockCommentStart||W.blockCommentStart)&&(C.fullLines=!0,M.blockComment(T,B,C));return}var S=Math.min(B.ch!=0||B.line==T.line?B.line+1:B.line,M.lastLine()+1),v=C.padding==null?" ":C.padding,g=C.commentBlankLines||T.line==B.line;M.operation(function(){if(C.indent){for(var u=null,p=T.line;p<S;++p){var m=M.getLine(p),w=m.search(z)===-1?m:m.slice(0,I(m));(u==null||u.length>w.length)&&(u=w)}for(var p=T.line;p<S;++p){var m=M.getLine(p),d=u.length;!g&&!z.test(m)||(m.slice(0,d)!=u&&(d=I(m)),M.replaceRange(u+O+v,V(p,0),V(p,d)))}}else for(var p=T.line;p<S;++p)(g||z.test(M.getLine(p)))&&M.replaceRange(O+v,V(p,0))})}}),y.defineExtension("blockComment",function(T,B,C){C||(C=H);var M=this,W=_(M,T),Z=C.blockCommentStart||W.blockCommentStart,O=C.blockCommentEnd||W.blockCommentEnd;if(!Z||!O){(C.lineComment||W.lineComment)&&C.fullLines!=!1&&M.lineComment(T,B,C);return}if(!/\bcomment\b/.test(M.getTokenTypeAt(V(T.line,0)))){var S=Math.min(B.line,M.lastLine());S!=T.line&&B.ch==0&&z.test(M.getLine(S))&&--S;var v=C.padding==null?" ":C.padding;T.line>S||M.operation(function(){if(C.fullLines!=!1){var g=z.test(M.getLine(S));M.replaceRange(v+O,V(S)),M.replaceRange(Z+v,V(T.line,0));var u=C.blockCommentLead||W.blockCommentLead;if(u!=null)for(var p=T.line+1;p<=S;++p)(p!=S||g)&&M.replaceRange(u+v,V(p,0))}else{var m=re(M.getCursor("to"),B)==0,w=!M.somethingSelected();M.replaceRange(O,B),m&&M.setSelection(w?B:M.getCursor("from"),B),M.replaceRange(Z,T
`).indexOf(L)>-1)return!1;var j=N.lastIndexOf(d,T.ch),ne=j==-1?-1:N.slice(0,T.ch).indexOf(L,j+d.length);if(j!=-1&&ne!=-1&&ne+L.length!=T.ch)return!1;ne=A.indexOf(L,B.ch);var fe=A.slice(B.ch).lastIndexOf(d,ne-B.ch);return j=ne==-1||fe==-1?-1:B.ch+fe,ne!=-1&&j!=-1&&j!=B.ch?!1:(M.operation(function(){M.replaceRange("",V(Z,G-(g&&A.slice(G-g.length,G)==g?g.length:0)),V(Z,G+L.length));var ce=U+d.length;if(g&&N.slice(ce,ce+g.length)==g&&(ce+=g.length),M.replaceRange("",V(O,U),V(O,ce)),F)for(var we=O+1;we<=Z;++we){var Be=M.getLine(we),Me=Be.indexOf(F);if(!(Me==-1||z.test(Be.slice(0,Me)))){var Ge=Me+F.length;g&&Be.slice(Ge,Ge+g.length)==g&&(Ge+=g.length),M.replaceRange("",V(we,Me),V(we,Ge))}}}),!0)})})})();var Vu={exports:{}};(function(We,Ie){(function(y){y(nt)})(function(y){function H(I,D,_,T){if(_&&_.call){var B=_;_=null}else var B=re(I,_,"rangeFinder");typeof D=="number"&&(D=y.Pos(D,0));var C=re(I,_,"minFoldSize");function M(S){var v=B(I,D);if(!v||v.to.line-v.from.line<C)return null;if(T==="fold")return v;for(var g=I.findMarksAt(v.from),u=0;u<g.length;++u)if(g[u].__isFold){if(!S)return null;v.cleared=!0,g[u].clear()}return v}var W=M(!0);if(re(I,_,"scanUp"))for(;!W&&D.line>I.firstLine();)D=y.Pos(D.line-1,0),W=M(!1);if(!(!W||W.cleared||T==="unfold")){var Z=z(I,_,W);y.on(Z,"mousedown",function(S){O.clear(),y.e_preventDefault(S)});var O=I.markText(W.from,W.to,{replacedWith:Z,clearOnEnter:re(I,_,"clearOnEnter"),__isFold:!0});O.on("clear",function(S,v){y.signal(I,"unfold",I,S,v)}),y.signal(I,"fold",I,W.from,W.to)}}function z(I,D,_){var T=re(I,D,"widget");if(typeof T=="function"&&(T=T(_.from,_.to)),typeof T=="string"){var B=document.createTextNode(T);T=document.createElement("span"),T.appendChild(B),T.className="CodeMirror-foldmarker"}else T&&(T=T.cloneNode(!0));return T}y.newFoldFunction=function(I,D){return function(_,T){H(_,T,{rangeFinder:I,widget:D})}},y.defineExtension("foldCode",function(I,D,_){H(this,I,D,_)}),y.defineExtension("isFolded",function(I){for(var D=this.findMarksAt(I),_=0;_<D.length;++_)if(D[_].__isFold)return!0}),y.commands.toggleFold=function(I){I.foldCode(I.getCursor())},y.commands.fold=function(I){I.foldCode(I.getCursor(),null,"fold")},y.commands.unfold=function(I){I.foldCode(I.getCursor(),{scanUp:!1},"unfold")},y.commands.foldAll=function(I){I.operation(function(){for(var D=I.firstLine(),_=I.lastLine();D<=_;D++)I.foldCode(y.Pos(D,0),{scanUp:!1},"fold")})},y.commands.unfoldAll=function(I){I.operation(function(){for(var D=I.firstLine(),_=I.lastLine();D<=_;D++)I.foldCode(y.Pos(D,0),{scanUp:!1},"unfold")})},y.registerHelper("fold","combine",function(){var I=Array.prototype.slice.call(arguments,0);return function(D,_){for(var T=0;T<I.length;++T){var B=I[T](D,_);if(B)return B}}}),y.registerHelper("fold","auto",function(I,D){for(var _=I.getHelpers(D,"fold"),T=0;T<_.length;T++){var B=_[T](I,D);if(B)return B}});var V={rangeFinder:y.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};y.defineOption("foldOptions",null);function re(I,D,_){if(D&&D[_]!==void 0)return D[_];var T=I.options.foldOptions;return T&&T[_]!==void 0?T[_]:V[_]}y.defineExtension("foldOption",function(I,D){return re(this,I,D)})})})();var $u=Vu.exports;(function(We,Ie){(function(y){y(nt,$u)})(function(y){y.defineOption("foldGutter",!1,function(O,S,v){v&&v!=y.Init&&(O.clearGutter(O.state.foldGutter.options.gutter),O.state.foldGutter=null,O.off("gutterClick",B),O.off("changes",M),O.off("viewportChange",W),O.off("fold",Z),O.off("unfold",Z),O.off("swapDoc",M),O.off("optionChange",C)),S&&(O.state.foldGutter=new z(V(S)),T(O),O.on("gutterClick",B),O.on("changes",M),O.on("viewportChange",W),O.on("fold",Z),O.on("unfold",Z),O.on("swapDoc",M),O.on("optionChange",C))});var H=y.Pos;function z(O){this.options=O,this.from=this.to=0}function V(O){return O===!0&&(O={}),O.gutter==null&&(O.gutter="CodeMirror-foldgutter"),O.indicatorOpen==null&&(O.indicatorOpen="CodeMirror-foldgutter-open"),O.indicatorFolded==null&&(O.indicatorFolded="CodeMirror-foldgutter-folded"),O}function re(O,S){for(var v=O.findMarks(H(S,0),H(S+1,0)),g=0;g<v.length;++g)if(v[g].__isFold){var
`+F}m=m*2,g.lastIndex=u.ch;var N=g.exec(p);if(N){var U=p.slice(0,N.index).split(``),A=N[0].split(``),G=u.line+U.length-1,c=U[U.length-1].length;return{from:H(G,c),to:H(G+A.length-1,A.length==1?c+A[0].length:A[A.length-1].length),match:N}}}}function _(v,g,u){for(var p,m=0;m<=v.length;){g.lastIndex=m;var w=g.exec(v);if(!w)break;var d=w.index+w[0].length;if(d>v.length-u)break;(!p||d>p.index+p[0].length)&&(p=w),m=w.index+1}return p}function T(v,g,u){g=V(g,"g");for(var p=u.line,m=u.ch,w=v.firstLine();p>=w;p--,m=-1){var d=v.getLine(p),L=_(d,g,m<0?0:d.length-m);if(L)return{from:H(p,L.index),to:H(p,L.index+L[0].length),match:L}}}function B(v,g,u){if(!re(g))return T(v,g,u);g=V(g,"gm");for(var p,m=1,w=v.getLine(u.line).length-u.ch,d=u.line,L=v.firstLine();d>=L;){for(var F=0;F<m&&d>=L;F++){var N=v.getLine(d--);p=p==null?N:N+``+p}m*=2;var U=_(p,g,w);if(U){var A=p.slice(0,U.index).split(``),G=U[0].split(``),c=d+A.length,Q=A[A.length-1].length;return{from:H(c,Q),to:H(c+G.length-1,G.length==1?Q+G[0].length:G[G.length-1].length),match:U}}}}var C,M;String.prototype.normalize?(C=function(v){return v.normalize("NFD").toLowerCase()},M=function(v){return v.normalize("NFD")}):(C=function(v){return v.toLowerCase()},M=function(v){return v});function W(v,g,u,p){if(v.length==g.length)return u;for(var m=0,w=u+Math.max(0,v.length-g.length);;){if(m==w)return m;var d=m+w>>1,L=p(v.slice(0,d)).length;if(L==u)return d;L>u?w=d:m=d+1}}function Z(v,g,u,p){if(!g.length)return null;var m=p?C:M,w=m(g).split(/\r|\n\r?/);e:for(var d=u.line,L=u.ch,F=v.lastLine()+1-w.length;d<=F;d++,L=0){var N=v.getLine(d).slice(L),U=m(N);if(w.length==1){var A=U.indexOf(w[0]);if(A==-1)continue e;var u=W(N,U,A,m)+L;return{from:H(d,W(N,U,A,m)+L),to:H(d,W(N,U,A+w[0].length,m)+L)}}else{var G=U.length-w[0].length;if(U.slice(G)!=w[0])continue e;for(var c=1;c<w.length-1;c++)if(m(v.getLine(d+c))!=w[c])continue e;var Q=v.getLine(d+w.length-1),j=m(Q),ne=w[w.length-1];if(j.slice(0,ne.length)!=ne)continue e;return{from:H(d,W(N,U,G,m)+L),to:H(d+w.length-1,W(Q,j,ne.length,m))}}}}function O(v,g,u,p){if(!g.length)return null;var m=p?C:M,w=m(g).split(/\r|\n\r?/);e:for(var d=u.line,L=u.ch,F=v.firstLine()-1+w.length;d>=F;d--,L=-1){var N=v.getLine(d);L>-1&&(N=N.slice(0,L));var U=m(N);if(w.length==1){var A=U.lastIndexOf(w[0]);if(A==-1)continue e;return{from:H(d,W(N,U,A,m)),to:H(d,W(N,U,A+w[0].length,m))}}else{var G=w[w.length-1];if(U.slice(0,G.length)!=G)continue e;for(var c=1,u=d-w.length+1;c<w.length-1;c++)if(m(v.getLine(u+c))!=w[c])continue e;var Q=v.getLine(d+1-w.length),j=m(Q);if(j.slice(j.length-w[0].length)!=w[0])continue e;return{from:H(d+1-w.length,W(Q,j,Q.length-w[0].length,m)),to:H(d,W(N,U,G.length,m))}}}}function S(v,g,u,p){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=v,u=u?v.clipPos(u):H(0,0),this.pos={from:u,to:u};var m;typeof p=="object"?m=p.caseFold:(m=p,p=null),typeof g=="string"?(m==null&&(m=!1),this.matches=function(w,d){return(w?O:Z)(v,g,d,m)}):(g=V(g,"gm"),!p||p.multiline!==!1?this.matches=function(w,d){return(w?B:D)(v,g,d)}:this.matches=function(w,d){return(w?T:I)(v,g,d)})}S.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(v){var g=this.doc.clipPos(v?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(g=H(g.line,g.ch),v?(g.ch--,g.ch<0&&(g.line--,g.ch=(this.doc.getLine(g.line)||"").length)):(g.ch++,g.ch>(this.doc.getLine(g.line)||"").length&&(g.ch=0,g.line++)),y.cmpPos(g,this.doc.clipPos(g))!=0))return this.atOccurrence=!1;var u=this.matches(v,g);if(this.afterEmptyMatch=u&&y.cmpPos(u.from,u.to)==0,u)return this.pos=u,this.atOccurrence=!0,this.pos.match||!0;var p=H(v?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:p,to:p},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(v,g){if(this.atOccurrence){var u=y.splitLines(v);this.doc.replaceRange(u,this.pos.from,this.pos.to,g),this.pos.to=H(this.pos.from.line+u.length-1,u[u.length-1].length+(u.length==1?this.pos.from.ch:0))}}},y.defineExtension("getSearchCursor",function(v,g,u){return new S(this.doc,v,g,u)}),y.defineDocExtension("getSearchCursor",function(v,g,u){return new S(this,v,g,u)}),y.defineExtension("selectMatches",function(v,g){for(var u=[],p=this.getSearchCursor(v,this.getCursor("from"),g);p.findNext()&&!(y.cmpPos(p.to(),this.getCursor("to"))>0);)u.push({anchor:p.from(),head:p.to()});u.length&&this.setSelections(u,0)})})}()),wl.exports}var Cl={exports:{}},Ll;function Fl(){return Ll||(Ll=1,function(We,Ie){(function(y){y(nt)})(function(y){function H(V,re,I){var D=V.getWrapperElement(),_;return _=D.appendChild(document.createElement("div")),I?_.className="CodeMirror-dialog CodeMirror-dialog-bottom":_.className="CodeMirror-dialog CodeMirror-dialog-top",typeof re=="string"?_.innerHTML=re:_.appendChild(re),y.addClass(D,"dialog-opened"),_}function z(V,re){V.state.currentNotificationClose&&V.state.currentNotif
`:F=="r"?"\r":F=="t"?" ":F=="\\"?"\\":L})}function C(d){var L=d.match(/^\/(.*)\/([a-z]*)$/);if(L)try{d=new RegExp(L[1],L[2].indexOf("i")==-1?"":"i")}catch{}else d=B(d);return(typeof d=="string"?d=="":d.test(""))&&(d=/x^/),d}function M(d,L,F){L.queryText=F,L.query=C(F),d.removeOverlay(L.overlay,re(L.query)),L.overlay=H(L.query,re(L.query)),d.addOverlay(L.overlay),d.showMatchesOnScrollbar&&(L.annotate&&(L.annotate.clear(),L.annotate=null),L.annotate=d.showMatchesOnScrollbar(L.query,re(L.query)))}function W(d,L,F,N){var U=V(d);if(U.query)return Z(d,L);var A=d.getSelection()||U.lastQuery;if(A instanceof RegExp&&A.source=="x^"&&(A=null),F&&d.openDialog){var G=null,c=function(Q,j){y.e_stop(j),Q&&(Q!=U.queryText&&(M(d,U,Q),U.posFrom=U.posTo=d.getCursor()),G&&(G.style.opacity=1),Z(d,j.shiftKey,function(ne,fe){var ce;fe.line<3&&document.querySelector&&(ce=d.display.wrapper.querySelector(".CodeMirror-dialog"))&&ce.getBoundingClientRect().bottom-4>d.cursorCoords(fe,"window").top&&((G=ce).style.opacity=.4)}))};D(d,v(d),A,c,function(Q,j){var ne=y.keyName(Q),fe=d.getOption("extraKeys"),ce=fe&&fe[ne]||y.keyMap[d.getOption("keyMap")][ne];ce=="findNext"||ce=="findPrev"||ce=="findPersistentNext"||ce=="findPersistentPrev"?(y.e_stop(Q),M(d,V(d),j),d.execCommand(ce)):(ce=="find"||ce=="findPersistent")&&(y.e_stop(Q),c(j,Q))}),N&&A&&(M(d,U,A),Z(d,L))}else _(d,v(d),"Search for:",A,function(Q){Q&&!U.query&&d.operation(function(){M(d,U,Q),U.posFrom=U.posTo=d.getCursor(),Z(d,L)})})}function Z(d,L,F){d.operation(function(){var N=V(d),U=I(d,N.query,L?N.posFrom:N.posTo);!U.find(L)&&(U=I(d,N.query,L?y.Pos(d.lastLine()):y.Pos(d.firstLine(),0)),!U.find(L))||(d.setSelection(U.from(),U.to()),d.scrollIntoView({from:U.from(),to:U.to()},20),N.posFrom=U.from(),N.posTo=U.to(),F&&F(U.from(),U.to()))})}function O(d){d.operation(function(){var L=V(d);L.lastQuery=L.query,L.query&&(L.query=L.queryText=null,d.removeOverlay(L.overlay),L.annotate&&(L.annotate.clear(),L.annotate=null))})}function S(d,L){var F=d?document.createElement(d):document.createDocumentFragment();for(var N in L)F[N]=L[N];for(var U=2;U<arguments.length;U++){var A=arguments[U];F.appendChild(typeof A=="string"?document.createTextNode(A):A)}return F}function v(d){var L=S("label",{className:"CodeMirror-search-label"},d.phrase("Search:"),S("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field",id:"CodeMirror-search-field"}));return L.setAttribute("for","CodeMirror-search-field"),S("",null,L," ",S("span",{style:"color: #666",className:"CodeMirror-search-hint"},d.phrase("(Use /re/ syntax for regexp search)")))}function g(d){return S("",null," ",S("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"})," ",S("span",{style:"color: #666",className:"CodeMirror-search-hint"},d.phrase("(Use /re/ syntax for regexp search)")))}function u(d){return S("",null,S("span",{className:"CodeMirror-search-label"},d.phrase("With:"))," ",S("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"}))}function p(d){return S("",null,S("span",{className:"CodeMirror-search-label"},d.phrase("Replace?"))," ",S("button",{},d.phrase("Yes"))," ",S("button",{},d.phrase("No"))," ",S("button",{},d.phrase("All"))," ",S("button",{},d.phrase("Stop")))}function m(d,L,F){d.operation(function(){for(var N=I(d,L);N.findNext();)if(typeof L!="string"){var U=d.getRange(N.from(),N.to()).match(L);N.replace(F.replace(/\$(\d)/g,function(A,G){return U[G]}))}else N.replace(F)})}function w(d,L){if(!d.getOption("readOnly")){var F=d.getSelection()||V(d).lastQuery,N=L?d.phrase("Replace all:"):d.phrase("Replace:"),U=S("",null,S("span",{className:"CodeMirror-search-label"},N),g(d));_(d,U,N,F,function(A){A&&(A=C(A),_(d,u(d),d.phrase("Replace with:"),"",function(G){if(G=B(G),L)m(d,A,G);else{O(d);var c=I(d,A,d.getCursor("from")),Q=function(){var ne=c.from(),fe;!(fe=c.findNext())&&(c=I(d,A),!(fe=c.findNext())||ne&&c.from().line==ne.line&&c.from().ch==ne.ch)||(d.setSelection(c.from(),c.to()),d.scrollIntoView({from:c.from(),to:c.to()}),T(d,p(d),d.phrase("Replace?"),[function(){j(fe)},Q,function(){m(d
`,N,null,"+insertLine"),u.indentLine(N.line,null,!0),w.push({head:N,anchor:N}),d=F.line+1}}u.setSelections(w)}),u.execCommand("indentAuto")}H.insertLineAfter=function(u){return I(u,!1)},H.insertLineBefore=function(u){return I(u,!0)};function D(u,p){for(var m=p.ch,w=m,d=u.getLine(p.line);m&&y.isWordChar(d.charAt(m-1));)--m;for(;w<d.length&&y.isWordChar(d.charAt(w));)++w;return{from:z(p.line,m),to:z(p.line,w),word:d.slice(m,w)}}H.selectNextOccurrence=function(u){var p=u.getCursor("from"),m=u.getCursor("to"),w=u.state.sublimeFindFullWord==u.doc.sel;if(y.cmpPos(p,m)==0){var d=D(u,p);if(!d.word)return;u.setSelection(d.from,d.to),w=!0}else{var L=u.getRange(p,m),F=w?new RegExp("\\b"+L+"\\b"):L,N=u.getSearchCursor(F,m),U=N.findNext();if(U||(N=u.getSearchCursor(F,z(u.firstLine(),0)),U=N.findNext()),!U||T(u.listSelections(),N.from(),N.to()))return;u.addSelection(N.from(),N.to())}w&&(u.state.sublimeFindFullWord=u.doc.sel)},H.skipAndSelectNextOccurrence=function(u){var p=u.getCursor("anchor"),m=u.getCursor("head");H.selectNextOccurrence(u),y.cmpPos(p,m)!=0&&u.doc.setSelections(u.doc.listSelections().filter(function(w){return w.anchor!=p||w.head!=m}))};function _(u,p){for(var m=u.listSelections(),w=[],d=0;d<m.length;d++){var L=m[d],F=u.findPosV(L.anchor,p,"line",L.anchor.goalColumn),N=u.findPosV(L.head,p,"line",L.head.goalColumn);F.goalColumn=L.anchor.goalColumn!=null?L.anchor.goalColumn:u.cursorCoords(L.anchor,"div").left,N.goalColumn=L.head.goalColumn!=null?L.head.goalColumn:u.cursorCoords(L.head,"div").left;var U={anchor:F,head:N};w.push(L),w.push(U)}u.setSelections(w)}H.addCursorToPrevLine=function(u){_(u,-1)},H.addCursorToNextLine=function(u){_(u,1)};function T(u,p,m){for(var w=0;w<u.length;w++)if(y.cmpPos(u[w].from(),p)==0&&y.cmpPos(u[w].to(),m)==0)return!0;return!1}var B="(){}[]";function C(u){for(var p=u.listSelections(),m=[],w=0;w<p.length;w++){var d=p[w],L=d.head,F=u.scanForBracket(L,-1);if(!F)return!1;for(;;){var N=u.scanForBracket(L,1);if(!N)return!1;if(N.ch==B.charAt(B.indexOf(F.ch)+1)){var U=z(F.pos.line,F.pos.ch+1);if(y.cmpPos(U,d.from())==0&&y.cmpPos(N.pos,d.to())==0){if(F=u.scanForBracket(F.pos,-1),!F)return!1}else{m.push({anchor:U,head:N.pos});break}}L=z(N.pos.line,N.pos.ch+1)}}return u.setSelections(m),!0}H.selectScope=function(u){C(u)||u.execCommand("selectAll")},H.selectBetweenBrackets=function(u){if(!C(u))return y.Pass};function M(u){return u?/\bpunctuation\b/.test(u)?u:void 0:null}H.goToBracket=function(u){u.extendSelectionsBy(function(p){var m=u.scanForBracket(p.head,1,M(u.getTokenTypeAt(p.head)));if(m&&y.cmpPos(m.pos,p.head)!=0)return m.pos;var w=u.scanForBracket(p.head,-1,M(u.getTokenTypeAt(z(p.head.line,p.head.ch+1))));return w&&z(w.pos.line,w.pos.ch+1)||p.head})},H.swapLineUp=function(u){if(u.isReadOnly())return y.Pass;for(var p=u.listSelections(),m=[],w=u.firstLine()-1,d=[],L=0;L<p.length;L++){var F=p[L],N=F.from().line-1,U=F.to().line;d.push({anchor:z(F.anchor.line-1,F.anchor.ch),head:z(F.head.line-1,F.head.ch)}),F.to().ch==0&&!F.empty()&&--U,N>w?m.push(N,U):m.length&&(m[m.length-1]=U),w=U}u.operation(function(){for(var A=0;A<m.length;A+=2){var G=m[A],c=m[A+1],Q=u.getLine(G);u.replaceRange("",z(G,0),z(G+1,0),"+swapLine"),c>u.lastLine()?u.replaceRange(``+Q,z(u.lastLine()),null,"+swapLine"):u.replaceRange(Q+``,z(c,0),null,"+swapLine")}u.setSelections(d),u.scrollIntoView()})},H.swapLineDown=function(u){if(u.isReadOnly())return y.Pass;for(var p=u.listSelections(),m=[],w=u.lastLine()+1,d=p.length-1;d>=0;d--){var L=p[d],F=L.to().line+1,N=L.from().line;L.to().ch==0&&!L.empty()&&F--,F<w?m.push(F,N):m.length&&(m[m.length-1]=N),w=N}u.operation(function(){for(var U=m.length-2;U>=0;U-=2){var A=m[U],G=m[U+1],c=u.getLine(A);A==u.lastLine()?u.replaceRange("",z(A-1),z(A),"+swapLine"):u.replaceRange("",z(A,0),z(A+1,0),"+swapLine"),u.replaceRange(c+``,z(G,0),null,"+swapLine")}u.scrollIntoView()})},H.toggleCommentIndented=function(u){u.toggleComment({indent:!0})},H.joinLines=function(u){for(var p=u.listSelections(),m=[],w=0;w<p.length;w++){for(var d=p[w],L=d.from(),F=L.line,N=d.to().line;w<p.length-1&&p[w+1].from().line==N;)N=p[++w].to().line;m.push({start:F,end:N,anchor:!d.empty()&&L})}u.operation(function(){for(var U=0,A=[],G=0;G<m.length;G++){for(var c=m[G],Q=c.anchor&&z(c.anchor.line-U,c.anchor.ch),j,ne=c.start;ne<=c.end;ne++){var fe=ne-U;ne==c.end&&(j=z(fe,u.getLine(fe).length+1)),fe<u.lastLine()&&(u.replaceRange(" ",z(fe),z(fe+1,/^\s*/.exec(u.getLine(fe+1))[0].length)),++U)}A.push({anchor:Q||j,head:j})}u.setSelections(A,0)})},H.duplicateLine=function(u){u.operation(function(){for(var p=u.listSelections().length,m=0;m<p;m++){var w=u.listSelections()[m];w.empty()?u.replaceRange(u.getLine(w.head.line)+``,z(w.head.line,0)):u.replaceRange(u.getRange(w.from(),w.to()),w.from())}u.scrollIntoView()})};function W(u,p,m){if(u.isReadOnly())return y.Pass;for(var w=u.listSelections(),d=[],L,F=0;F<w.length;F++){var N=w[F];if(!N.empty()){for(var U=N.from().line,A=N.to().line;F<w.length-1&&w[F+1].from().line==A;)A=w[++F].to().line;w[F].to().ch||A--,d.push(U,A)}}d.length?L=!0:d.push(u.firstLine(),u.lastLine()),u.operation(function(){for(var G=[],c=0;c<d.length;c+=2){var Q=d[c],j=d[c+1],ne=z(Q,0),fe=z(j),ce=u.getRange(ne,fe,!1);p?ce.sort(function(we,Be){return we<Be?-m:we==Be?0:m}):ce.sort(function(we,Be){var Me=we.toUpperCase(),Ge=Be.toUpperCase();return Me!=Ge&&(we=Me,Be=Ge),we<Be?-m:we==Be?0:m}),u.replaceRange(ce,ne,fe),L&&G.push({anchor:ne,head:z(j+1,0)})}L&&u.setSelections(G,0)})}H.sortLines=function(u){W(u,!0,1)},H.reverseSortLines=function(u){W(u,!0,-1)},H.sortLinesInsensitive=function(u){W(u,!1,1)},H.reverseSortLinesInsensitive=function(u){W(u,!1,-1)},H.nextBookmark=function(u){var p=u.state.sublimeBookmarks;if(p)for(;p.length;){var m=p.shift(),w=m.find();if(w)return p.push(m),u.setSelection(w.from,w.to)}},H.prevBookmark=function(u){var p=u.state.sublimeBookmarks;if(p)for(;p.length;){p.unshift(p.pop());var m=p[p.length-1].find();if(!m)p.pop();else return u.setSelection(m.from,m.to)}},H.toggleBookmark=function(u){for(var p=u.listSelections(),m=u.state.sublimeBookmarks||(u.state.sublimeBookmarks=[]),w=0;w<p.length;w++){for(var d=p[w].from(),L=p[w].to(),F=p[w].empty()?u.findMarksAt(d):u.findMarks(d,L),N=0;N<F.length;N++)if(F[N].sublimeBookmark){F[N].clear();for(var U=0;U<m.length;U++)m[U]==F[N]&&m.splice(U--,1);break}N==F.length&&m.push(u.markText(d,L,{sublimeBookmark:!0,clearWhenEmpty:!1}))}},H.clearBookmarks=function(u){var p=u.state.sublimeBookmarks;if(p)for(var m=0;m<p.length;m++)p[m].clear();p.length=0},H.selectBookmarks=function(u){var p=u.state.sublimeBookmarks,m=[];if(p)for(var w=0;w<p.length;w++){var d=p[w].find();d?m.push({anchor:d.from,head:d.to}):p.splice(w--,0)}m.length&&u.setSelections(m,0)};function Z(u,p){u.operation(function(){for(var m=u.listSelections(),w=[],d=[],L=0;L<m.length;L++){var F=m[L];F.empty()?(w.push(L),d.push("")):d.push(p(u.getRange(F.from(),F.to())))}u.replaceSelections(d,"around","case");for(var L=w.length-1,N;L>=0;L--){var F=m[w[L]];if(!(N&&y.cmpPos(F.head,N)>0)){var U=D(u,F.head);N=U.from,u.replaceRange(p(U.word),U.from,U.to)}}})}H.smartBackspace=function(u){if(u.somethingSelected())return y.Pass;u.operation(function(){for(var p=u.listSelections(),m=u.getOption("indentUnit"),w=p.length-1;w>=0;w--){var d=p[w].head,L=u.getRange({line:d.line,ch:0},d),F=y.countColumn(L,null,u.getOption("tabSize")),N=u.findPosH(d,-1,"char",!1);if(L&&!/\S/.test(L)&&F%m==0){var U=new z(d.line,y.findColumn(L,F-m,m));U.ch!=d.ch&&(N=U)}u.replaceRange("",N,d,"+delete")}})},H.delLineRight=function(u){u.operation(function(){for(var p=u.listSelections(),m=p.length-1;m>=0;m--)u.replaceRange("",p[m].anchor,z(p[m].to().line),"+delete");u.scrollIntoView()})},H.upcaseAtCursor=function(u){Z(u,function(p){return p.toUpperCase()})},H.downcaseAtCursor=function(u){Z(u,function(p){return p.toLowerCase()})},H.setSublimeMark=function(u){u.state.sublimeMark&&u.state.sublimeMark.clear(),u.state.sublimeMark=u.setBookmark(u.getCursor())},H.selectToSublimeMark=function(u){var p=u.state.sublimeMark&&u.state.sublimeMark.find();p&&u.setSelection(u.getCursor(),p)},H.deleteToSublimeMark=function(u){var p=u.state.sublimeMark&&u.state.sublimeMark.find();if(p){var m=u.getCursor(),w=p;if(y.cmpPos(m,w)>0){var d=w;w=m,m=d}u.state.sublimeKilled=u.getRange(m,w),u.replaceRange("",m,w)}},H.swapWithSublimeMark=function(u){var p=u.state.sublimeMark&&u.state.sublimeMark.find();p&&(u.state.sublimeMark.clear(),u.state.sublimeMark=u.setBookmark(u.getCursor()),u.setCursor(p))},H.sublimeYank=function(u){u.state.sublimeKilled!=null&&u.replaceSelection(u.state.sublimeKilled,null,"paste")},H.showInCenter=function(u){var p=u.cursorCoords(null,"local");u.scrollTo(null,(p.top+p.bottom)/2-u.getScrollInfo().clientHeight/2)};function O(u){var p=u.getCursor("from"),m=u.getC
|