var Su=Object.defineProperty;var vl=Object.getOwnPropertySymbols;var Cu=Object.prototype.hasOwnProperty,Tu=Object.prototype.propertyIsEnumerable;var gl=(be,ze,P)=>ze in be?Su(be,ze,{enumerable:!0,configurable:!0,writable:!0,value:P}):be[ze]=P,ml=(be,ze)=>{for(var P in ze||(ze={}))Cu.call(ze,P)&&gl(be,P,ze[P]);if(vl)for(var P of vl(ze))Tu.call(ze,P)&&gl(be,P,ze[P]);return be};var zn=(be,ze,P)=>new Promise((Ce,G)=>{var se=A=>{try{H(P.next(A))}catch(Y){G(Y)}},We=A=>{try{H(P.throw(A))}catch(Y){G(Y)}},H=A=>A.done?Ce(A.value):Promise.resolve(A.value).then(se,We);H((P=P.apply(be,ze)).next())});import{a7 as wl,a as ho,r as Lu,a9 as Mu,aa as yl,ae as bl,K as Ou,h as po,p as Nu,ar as Du,o as vo,e as xl,c5 as Au,c as Pu,bL as Wu,i as zu,fq as Hu,fr as Eu,Q as Fu,X as kl}from"./index.ae52ebae.js";import{u as Iu}from"./useWindowSizeFn.d176b3a5.js";var $r={exports:{}};(function(be,ze){(function(P,Ce){be.exports=Ce()})(wl,function(){var P=navigator.userAgent,Ce=navigator.platform,G=/gecko\/\d/i.test(P),se=/MSIE \d/.test(P),We=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(P),H=/Edge\/(\d+)/.exec(P),A=se||We||H,Y=A&&(se?document.documentMode||6:+(H||We)[1]),j=!H&&/WebKit\//.test(P),le=j&&/Qt\/\d+\.\d+/.test(P),q=!H&&/Chrome\/(\d+)/.exec(P),de=q&&+q[1],he=/Opera\//.test(P),He=/Apple Computer/.test(navigator.vendor),Ee=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(P),Be=/PhantomJS/.test(P),re=He&&(/Mobile\/\w+/.test(P)||navigator.maxTouchPoints>2),ie=/Android/.test(P),ue=re||ie||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(P),we=re||/Mac/.test(Ce),qe=/\bCrOS\b/.test(P),nt=/win/i.test(Ce),ke=he&&P.match(/Version\/(\d*\.\d*)/);ke&&(ke=Number(ke[1])),ke&&ke>=15&&(he=!1,j=!0);var Ue=we&&(le||he&&(ke==null||ke<12.11)),ne=G||A&&Y>=9;function b(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var M=function(e,t){var n=e.className,r=b(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 g(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function C(e,t){return g(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)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}}var $=function(){this.id=null,this.f=null,this.time=0,this.handler=me(this.onTimeout,this)};$.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},$.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var Te=[""];function Xe(e){for(;Te.length<=e;)Te.push(fe(Te)+" ");return Te[e]}function fe(e){return e[e.length-1]}function wt(e,t){for(var n=[],r=0;r"\x80"&&(e.toUpperCase()!=e.toLowerCase()||D.test(e))}function ve(e,t){return t?t.source.indexOf("\\w")>-1&&S(e)?!0:t.test(e):S(e)}function ut(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Nr=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function en(e){return e.charCodeAt(0)>=768&&Nr.test(e)}function It(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function mr(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;ot||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),a.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var Bt=null;function Ot(e,t,n){var r;Bt=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:Bt=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:Bt=i)}return r!=null?r:Bt}var mi=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,l=/[1n]/;function s(u,h,d){this.level=u,this.from=h,this.to=d}return function(u,h){var d=h=="ltr"?"L":"R";if(u.length==0||h=="ltr"&&!r.test(u))return!1;for(var y=u.length,m=[],k=0;k-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Pe(e,t){var n=tn(e,t);if(!!n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function ct(e){e.prototype.on=function(t,n){E(this,t,n)},e.prototype.off=function(t,n){ot(this,t,n)}}function at(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function yr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function rn(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Xt(e){at(e),yr(e)}function pt(e){return e.target||e.srcElement}function nn(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),we&&e.ctrlKey&&t==1&&(t=3),t}var yi=function(){if(A&&Y<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),Dt;function bi(e){if(Dt==null){var t=c("span","\u200B");C(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Dt=t.offsetWidth<=1&&t.offsetHeight>2&&!(A&&Y<8))}var n=Dt?c("span","\u200B"):c("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var Dr;function Fn(e){if(Dr!=null)return Dr;var t=C(e,document.createTextNode("A\u062EA")),n=L(t,0,1).getBoundingClientRect(),r=L(t,1,2).getBoundingClientRect();return g(e),!n||n.left==n.right?!1:Dr=r.right-n.right<3}var on=` 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/)},nr=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Rt=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),_t=null;function In(e){if(_t!=null)return _t;var t=C(e,c("span","x")),n=t.getBoundingClientRect(),r=L(t,0,1).getBoundingClientRect();return _t=Math.abs(n.left-r.left)>1}var Pt={},ir={};function Bn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Pt[e]=t}function Ar(e,t){ir[e]=t}function xt(e){if(typeof e=="string"&&ir.hasOwnProperty(e))e=ir[e];else if(e&&typeof e.name=="string"&&ir.hasOwnProperty(e.name)){var t=ir[e.name];typeof t=="string"&&(t={name:t}),e=w(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return xt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return xt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Yt(e,t){t=xt(t);var n=Pt[t.name];if(!n)return Yt(e,"text/plain");var r=n(e,t);if(or.hasOwnProperty(t.name)){var i=or[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 or={};function Rn(e,t){var n=or.hasOwnProperty(e)?or[e]:or[e]={};K(t,n)}function Zt(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 ar(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 an(e,t,n){return e.startState?e.startState(t,n):!0}var Ke=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};Ke.prototype.eol=function(){return this.pos>=this.string.length},Ke.prototype.sol=function(){return this.pos==this.lineStart},Ke.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ke.prototype.next=function(){if(this.post},Ke.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ke.prototype.skipToEnd=function(){this.pos=this.string.length},Ke.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ke.prototype.backUp=function(e){this.pos-=e},Ke.prototype.column=function(){return this.lastColumnPos0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},Ke.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ke.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ke.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ke.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function U(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?v(n,U(e,n).text.length):Cl(t,U(e,t.line).text.length)}function Cl(e,t){var n=e.ch;return n==null||n>t?v(e.line,t):n<0?v(e.line,0):e}function go(e,t){for(var n=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},jt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},jt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},jt.fromSaved=function(e,t,n){return t instanceof _n?new jt(e,Zt(e.mode,t.state),n,t.lookAhead):new jt(e,Zt(e.mode,t),n)},jt.prototype.save=function(e){var t=e!==!1?Zt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new _n(t,this.maxLookAhead):t};function mo(e,t,n,r){var i=[e.state.modeGen],o={};So(e,t.text,e.doc.mode,n,function(u,h){return i.push(u,h)},o,r);for(var a=n.state,l=function(u){n.baseTokens=i;var h=e.state.overlays[u],d=1,y=0;n.state=!0,So(e,t.text,h.mode,n,function(m,k){for(var T=d;ym&&i.splice(d,1,m,i[d+1],O),d+=2,y=Math.min(m,O)}if(!!k)if(h.opaque)i.splice(T,d-T,m,"overlay "+k),d=T+2;else for(;Te.options.maxHighlightLength&&Zt(e.doc.mode,r.state),o=mo(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function ln(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new jt(r,!0,t);var o=Tl(e,t,n),a=o>r.first&&U(r,o-1).stateAfter,l=a?jt.fromSaved(r,a,o):new jt(r,an(r.mode),o);return r.iter(o,t,function(s){wi(e,s.text,l);var u=l.line;s.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&ut.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var wo=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function xo(e,t,n,r){var i=e.doc,o=i.mode,a;t=ae(i,t);var l=U(i,t.line),s=ln(e,t.line,n),u=new Ke(l.text,e.options.tabSize,s),h;for(r&&(h=[]);(r||u.pose.options.maxHighlightLength?(l=!1,a&&wi(e,t,r,h.pos),h.pos=t.length,d=null):d=ko(xi(n,h,r.state,y),o),y){var m=y[0].name;m&&(d="m-"+(d?m+" "+d:m))}if(!l||u!=d){for(;sa;--l){if(l<=o.first)return o.first;var s=U(o,l-1),u=s.stateAfter;if(u&&(!n||l+(u instanceof _n?u.lookAhead:0)<=o.modeFrontier))return l;var h=R(s.text,null,e.options.tabSize);(i==null||r>h)&&(i=l-1,r=h)}return i}function Ll(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=U(e,r).stateAfter;if(i&&(!(i instanceof _n)||r+i.lookAhead=t:o.to>t);(r||(r=[])).push(new Kn(a,o.from,s?null:o.to))}}return r}function Pl(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t);if(l||o.from==t&&a.type=="bookmark"&&(!n||o.marker.insertLeft)){var s=o.from==null||(a.inclusiveLeft?o.from<=t:o.from0&&l)for(var I=0;I0)){var h=[s,1],d=x(u.from,l.from),y=x(u.to,l.to);(d<0||!a.inclusiveLeft&&!d)&&h.push({from:u.from,to:l.from}),(y>0||!a.inclusiveRight&&!y)&&h.push({from:l.to,to:u.to}),i.splice.apply(i,h),s+=h.length-3}}return i}function Lo(e){var t=e.markedSpans;if(!!t){for(var n=0;nt)&&(!r||Si(r,o.marker)<0)&&(r=o.marker)}return r}function Do(e,t,n,r,i){var o=U(e,t),a=Qt&&o.markedSpans;if(a)for(var l=0;l=0&&d<=0||h<=0&&d>=0)&&(h<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?x(u.to,n)>=0:x(u.to,n)>0)||h>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?x(u.from,r)<=0:x(u.from,r)<0)))return!0}}}function Wt(e){for(var t;t=No(e);)e=t.find(-1,!0).line;return e}function Hl(e){for(var t;t=Gn(e);)e=t.find(1,!0).line;return e}function El(e){for(var t,n;t=Gn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Ci(e,t){var n=U(e,t),r=Wt(n);return n==r?t:Le(r)}function Ao(e,t){if(t>e.lastLine())return t;var n=U(e,t),r;if(!lr(e,n))return t;for(;r=Gn(n);)n=r.find(1,!0).line;return Le(n)+1}function lr(e,t){var n=Qt&&t.markedSpans;if(n){for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Wr=function(e,t,n){this.text=e,Mo(this,t),this.height=n?n(this):1};Wr.prototype.lineNo=function(){return Le(this)},ct(Wr);function Fl(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Lo(e),Mo(e,n);var i=r?r(e):1;i!=e.height&&At(e,i)}function Il(e){e.parent=null,Lo(e)}var Bl={},Rl={};function Po(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Rl:Bl;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Wo(e,t){var n=N("span",null,null,j?"padding-right: .1px":null),r={pre:N("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=Kl,Fn(e.display.measure)&&(a=Nt(o,e.doc.direction))&&(r.addToken=Ul(r.addToken,a)),r.map=[];var l=t!=e.display.externalMeasured&&Le(o);Gl(o,r,yo(e,o,l)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=te(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=te(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(bi(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(j){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Pe(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=te(r.pre.className,r.textClass||"")),r}function _l(e){var t=c("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Kl(e,t,n,r,i,o,a){if(!!t){var l=e.splitSpaces?jl(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,h;if(!s.test(t))e.col+=t.length,h=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,h),A&&Y<9&&(u=!0),e.pos+=t.length;else{h=document.createDocumentFragment();for(var d=0;;){s.lastIndex=d;var y=s.exec(t),m=y?y.index-d:t.length-d;if(m){var k=document.createTextNode(l.slice(d,d+m));A&&Y<9?h.appendChild(c("span",[k])):h.appendChild(k),e.map.push(e.pos,e.pos+m,k),e.col+=m,e.pos+=m}if(!y)break;d+=m+1;var T=void 0;if(y[0]==" "){var O=e.cm.options.tabSize,W=O-e.col%O;T=h.appendChild(c("span",Xe(W),"cm-tab")),T.setAttribute("role","presentation"),T.setAttribute("cm-text"," "),e.col+=W}else y[0]=="\r"||y[0]==` `?(T=h.appendChild(c("span",y[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),T.setAttribute("cm-text",y[0]),e.col+=1):(T=e.cm.options.specialCharPlaceholder(y[0]),T.setAttribute("cm-text",y[0]),A&&Y<9?h.appendChild(c("span",[T])):h.appendChild(T),e.col+=1);e.map.push(e.pos,e.pos+1,T),e.pos++}}if(e.trailingSpace=l.charCodeAt(t.length-1)==32,n||r||i||u||o||a){var F=n||"";r&&(F+=r),i&&(F+=i);var z=c("span",[h],F,o);if(a)for(var I in a)a.hasOwnProperty(I)&&I!="style"&&I!="class"&&z.setAttribute(I,a[I]);return e.content.appendChild(z)}e.content.appendChild(h)}}function jl(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;iu&&d.from<=u));y++);if(d.to>=h)return e(n,r,i,o,a,l,s);e(n,r.slice(0,d.to-u),i,o,null,l,s),o=null,r=r.slice(d.to-u),u=d.to}}}function zo(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 Gl(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var a=1;as||ce.collapsed&&X.to==s&&X.from==s)){if(X.to!=null&&X.to!=s&&m>X.to&&(m=X.to,T=""),ce.className&&(k+=" "+ce.className),ce.css&&(y=(y?y+";":"")+ce.css),ce.startStyle&&X.from==s&&(O+=" "+ce.startStyle),ce.endStyle&&X.to==m&&(I||(I=[])).push(ce.endStyle,X.to),ce.title&&((F||(F={})).title=ce.title),ce.attributes)for(var De in ce.attributes)(F||(F={}))[De]=ce.attributes[De];ce.collapsed&&(!W||Si(W.marker,ce)<0)&&(W=X)}else X.from>s&&m>X.from&&(m=X.from)}if(I)for(var tt=0;tt=l)break;for(var St=Math.min(l,m);;){if(h){var mt=s+h.length;if(!W){var Ye=mt>St?h.slice(0,St-s):h;t.addToken(t,Ye,d?d+k:k,O,s+Ye.length==m?T:"",y,F)}if(mt>=St){h=h.slice(St-s),s=St;break}s=mt,O=""}h=i.slice(o,o=n[u++]),d=Po(n[u++],t.cm.options)}}}function Ho(e,t,n){this.line=t,this.rest=El(t),this.size=this.rest?Le(fe(this.rest))-n+1:1,this.node=this.text=null,this.hidden=lr(e,t)}function Xn(e,t,n){for(var r=[],i,o=t;o2&&o.push((s.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Ko(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function rs(e,t){t=Wt(t);var n=Le(t),r=e.display.externalMeasured=new Ho(e.doc,t,n);r.lineN=n;var i=r.built=Wo(e,r);return r.text=i.pre,C(e.display.lineMeasure,i.pre),r}function jo(e,t,n,r){return Gt(e,Hr(e,t),n,r)}function Di(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(o=s-l,i=o-1,t>=s&&(a="right")),i!=null){if(r=e[u+2],l==s&&n==(r.insertLeft?"left":"right")&&(a=n),n=="left"&&i==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],a="left";if(n=="right"&&i==s-l)for(;u=0&&(n=e[i]).left==n.right;i--);return n}function is(e,t,n,r){var i=Go(t.map,n,r),o=i.node,a=i.start,l=i.end,s=i.collapse,u;if(o.nodeType==3){for(var h=0;h<4;h++){for(;a&&en(t.line.text.charAt(i.coverStart+a));)--a;for(;i.coverStart+l0&&(s=r="right");var d;e.options.lineWrapping&&(d=o.getClientRects()).length>1?u=d[r=="right"?d.length-1:0]:u=o.getBoundingClientRect()}if(A&&Y<9&&!a&&(!u||!u.left&&!u.right)){var y=o.parentNode.getClientRects()[0];y?u={left:y.left,right:y.left+Fr(e.display),top:y.top,bottom:y.bottom}:u=Uo}for(var m=u.top-t.rect.top,k=u.bottom-t.rect.top,T=(m+k)/2,O=t.view.measure.heights,W=0;W=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!l)return a(u=="before"?s-1:s,u=="before");function h(k,T,O){var W=l[T],F=W.level==1;return a(O?k-1:k,F!=O)}var d=Ot(l,s,u),y=Bt,m=h(s,d,u=="before");return y!=null&&(m.other=h(s,y,u!="before")),m}function Qo(e,t){var n=0;t=ae(e.doc,t),e.options.lineWrapping||(n=Fr(e.display)*t.ch);var r=U(e.doc,t.line),i=Vt(r)+Yn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Pi(e,t,n,r,i){var o=v(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Wi(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Pi(r.first,0,null,-1,-1);var i=Kt(r,n),o=r.first+r.size-1;if(i>o)return Pi(r.first+r.size-1,U(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=U(r,i);;){var l=as(e,a,i,t,n),s=zl(a,l.ch+(l.xRel>0||l.outside>0?1:0));if(!s)return l;var u=s.find(1);if(u.line==i)return u;a=U(r,i=u.line)}}function Vo(e,t,n,r){r-=Ai(t);var i=t.text.length,o=Re(function(a){return Gt(e,n,a-1).bottom<=r},i,0);return i=Re(function(a){return Gt(e,n,a).top>r},o,i),{begin:o,end:i}}function $o(e,t,n,r){n||(n=Hr(e,t));var i=Zn(e,t,Gt(e,n,r),"line").top;return Vo(e,t,n,i)}function zi(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function as(e,t,n,r,i){i-=Vt(t);var o=Hr(e,t),a=Ai(t),l=0,s=t.text.length,u=!0,h=Nt(t,e.doc.direction);if(h){var d=(e.options.lineWrapping?ss:ls)(e,t,n,o,h,r,i);u=d.level!=1,l=u?d.from:d.to-1,s=u?d.to:d.from-1}var y=null,m=null,k=Re(function(Q){var X=Gt(e,o,Q);return X.top+=a,X.bottom+=a,zi(X,r,i,!1)?(X.top<=i&&X.left<=r&&(y=Q,m=X),!0):!1},l,s),T,O,W=!1;if(m){var F=r-m.left=I.bottom?1:0}return k=It(t.text,k,1),Pi(n,k,O,W,r-T)}function ls(e,t,n,r,i,o,a){var l=Re(function(d){var y=i[d],m=y.level!=1;return zi(zt(e,v(n,m?y.to:y.from,m?"before":"after"),"line",t,r),o,a,!0)},0,i.length-1),s=i[l];if(l>0){var u=s.level!=1,h=zt(e,v(n,u?s.from:s.to,u?"after":"before"),"line",t,r);zi(h,o,a,!0)&&h.top>a&&(s=i[l-1])}return s}function ss(e,t,n,r,i,o,a){var l=Vo(e,t,r,a),s=l.begin,u=l.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var h=null,d=null,y=0;y=u||m.to<=s)){var k=m.level!=1,T=Gt(e,r,k?Math.min(u,m.to)-1:Math.max(s,m.from)).right,O=TO)&&(h=m,d=O)}}return h||(h=i[i.length-1]),h.fromu&&(h={from:h.from,to:u,level:h.level}),h}var wr;function Er(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(wr==null){wr=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)wr.appendChild(document.createTextNode("x")),wr.appendChild(c("br"));wr.appendChild(document.createTextNode("x"))}C(e.measure,wr);var n=wr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),g(e.measure),n||1}function Fr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),n=c("pre",[t],"CodeMirror-line-like");C(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Hi(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var l=e.display.gutterSpecs[a].className;n[l]=o.offsetLeft+o.clientLeft+i,r[l]=o.clientWidth}return{fixedPos:Ei(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Ei(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ea(e){var t=Er(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Fr(e.display)-3);return function(i){if(lr(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(u=U(e.doc,s.line).text).length==s.ch){var h=R(u,u.length,e.options.tabSize)-u.length;s=v(s.line,Math.max(0,Math.round((o-_o(e.display).left)/Fr(e.display))-h))}return s}function kr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Qt&&Ci(e.doc,t)i.viewFrom?ur(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)ur(e);else if(t<=i.viewFrom){var o=Qn(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):ur(e)}else if(n>=i.viewTo){var a=Qn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):ur(e)}else{var l=Qn(e,t,t,-1),s=Qn(e,n,n+r,1);l&&s?(i.view=i.view.slice(0,l.index).concat(Xn(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):ur(e)}var u=i.externalMeasured;u&&(n=i.lineN&&t=r.viewTo)){var o=r.view[kr(e,t)];if(o.node!=null){var a=o.changes||(o.changes=[]);J(a,n)==-1&&a.push(n)}}}function ur(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Qn(e,t,n,r){var i=kr(e,t),o,a=e.display.view;if(!Qt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var l=e.display.viewFrom,s=0;s0){if(i==a.length-1)return null;o=l+a[i].size-t,i++}else o=l-t;t+=o,n+=o}for(;Ci(e.doc,n)!=n;){if(i==(r<0?0:a.length-1))return null;n+=r*a[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function us(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Xn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Xn(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,kr(e,n)))),r.viewTo=n}function ta(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||s.to().line0?a:e.defaultCharWidth())+"px"}if(r.other){var l=n.appendChild(c("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));l.style.display="",l.style.left=r.other.left+"px",l.style.top=r.other.top+"px",l.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Vn(e,t){return e.top-t.top||e.left-t.left}function fs(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=_o(e.display),l=a.left,s=Math.max(r.sizerWidth,br(e)-r.sizer.offsetLeft)-a.right,u=i.direction=="ltr";function h(z,I,Q,X){I<0&&(I=0),I=Math.round(I),X=Math.round(X),o.appendChild(c("div",null,"CodeMirror-selected","position: absolute; left: "+z+`px; top: `+I+"px; width: "+(Q==null?s-z:Q)+`px; height: `+(X-I)+"px"))}function d(z,I,Q){var X=U(i,z),ce=X.text.length,De,tt;function Ie(Ye,yt){return Jn(e,v(z,Ye),"div",X,yt)}function St(Ye,yt,it){var Qe=$o(e,X,null,Ye),Ze=yt=="ltr"==(it=="after")?"left":"right",je=it=="after"?Qe.begin:Qe.end-(/\s/.test(X.text.charAt(Qe.end-1))?2:1);return Ie(je,Ze)[Ze]}var mt=Nt(X,i.direction);return mr(mt,I||0,Q==null?ce:Q,function(Ye,yt,it,Qe){var Ze=it=="ltr",je=Ie(Ye,Ze?"left":"right"),bt=Ie(yt-1,Ze?"right":"left"),Jr=I==null&&Ye==0,vr=Q==null&&yt==ce,st=Qe==0,qt=!mt||Qe==mt.length-1;if(bt.top-je.top<=3){var rt=(u?Jr:vr)&&st,fo=(u?vr:Jr)&&qt,rr=rt?l:(Ze?je:bt).left,Mr=fo?s:(Ze?bt:je).right;h(rr,je.top,Mr-rr,je.bottom)}else{var Or,dt,Qr,co;Ze?(Or=u&&Jr&&st?l:je.left,dt=u?s:St(Ye,it,"before"),Qr=u?l:St(yt,it,"after"),co=u&&vr&&qt?s:bt.right):(Or=u?St(Ye,it,"before"):l,dt=!u&&Jr&&st?s:je.right,Qr=!u&&vr&&qt?l:bt.left,co=u?St(yt,it,"after"):s),h(Or,je.top,dt-Or,je.bottom),je.bottom0?t.blinker=setInterval(function(){e.hasFocus()||Ir(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function na(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||_i(e))}function Ri(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Ir(e))},100)}function _i(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Pe(e,"focus",e,t),e.state.focused=!0,_(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),j&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Bi(e))}function Ir(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Pe(e,"blur",e,t),e.state.focused=!1,M(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function $n(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.005||m<-.005)&&(ie.display.sizerWidth){var T=Math.ceil(h/Fr(e.display));T>e.display.maxLineLength&&(e.display.maxLineLength=T,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function ia(e){if(e.widgets)for(var t=0;t=a&&(o=Kt(t,Vt(U(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function cs(e,t){if(!_e(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,o=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),i!=null&&!Be){var a=c("div","\u200B",null,`position: absolute; top: `+(t.top-n.viewOffset-Yn(e.display))+`px; height: `+(t.bottom-t.top+Ut(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 hs(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?v(t.line,t.ch+1,"before"):t,t=t.ch?v(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,l=zt(e,t),s=!n||n==t?l:zt(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 u=Ki(e,i),h=e.doc.scrollTop,d=e.doc.scrollLeft;if(u.scrollTop!=null&&(vn(e,u.scrollTop),Math.abs(e.doc.scrollTop-h)>1&&(a=!0)),u.scrollLeft!=null&&(Sr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function ds(e,t){var n=Ki(e,t);n.scrollTop!=null&&vn(e,n.scrollTop),n.scrollLeft!=null&&Sr(e,n.scrollLeft)}function Ki(e,t){var n=e.display,r=Er(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=Ni(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Oi(n),s=t.topl-r;if(t.topi+o){var h=Math.min(t.top,(u?l:t.bottom)-o);h!=i&&(a.scrollTop=h)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,y=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-d,m=br(e)-n.gutters.offsetWidth,k=t.right-t.left>m;return k&&(t.right=t.left+m),t.left<10?a.scrollLeft=0:t.leftm+y-3&&(a.scrollLeft=t.right+(k?0:10)-m),a}function ji(e,t){t!=null&&(ti(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Br(e){ti(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function pn(e,t,n){(t!=null||n!=null)&&ti(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function ps(e,t){ti(e),e.curOp.scrollToPos=t}function ti(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Qo(e,t.from),r=Qo(e,t.to);oa(e,n,r,t.margin)}}function oa(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});pn(e,i.scrollLeft,i.scrollTop)}function vn(e,t){Math.abs(e.doc.scrollTop-t)<2||(G||Gi(e,{top:t}),aa(e,t,!0),G&&Gi(e),yn(e,100))}function aa(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 Sr(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,ca(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function gn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Oi(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+Ut(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Cr=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),E(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),E(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,A&&Y<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Cr.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.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Cr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Cr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Cr.prototype.zeroWidthHack=function(){var e=we&&!Ee?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new $,this.disableVert=new $},Cr.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="";function r(){var i=e.getBoundingClientRect(),o=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},Cr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var mn=function(){};mn.prototype.update=function(){return{bottom:0,right:0}},mn.prototype.setScrollLeft=function(){},mn.prototype.setScrollTop=function(){},mn.prototype.clear=function(){};function Rr(e,t){t||(t=gn(e));var n=e.display.barWidth,r=e.display.barHeight;la(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&$n(e),la(e,gn(e)),n=e.display.barWidth,r=e.display.barHeight}function la(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var sa={native:Cr,null:mn};function ua(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&M(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new sa[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),E(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Sr(e,t):vn(e,t)},e),e.display.scrollbars.addClass&&_(e.display.wrapper,e.display.scrollbars.addClass)}var vs=0;function Tr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++vs,markArrays:null},ql(e.curOp)}function Lr(e){var t=e.curOp;t&&Yl(t,function(n){for(var r=0;r=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ri(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ys(e){e.updatedDisplay=e.mustUpdate&&Ui(e.cm,e.update)}function bs(e){var t=e.cm,n=t.display;e.updatedDisplay&&$n(t),e.barMeasure=gn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=jo(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Ut(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-br(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function ws(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,r=ln(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength?Zt(t.mode,r.state):null,s=mo(e,o,r,!0);l&&(r.state=l),o.styles=s.styles;var u=o.styleClasses,h=s.classes;h?o.styleClasses=h:u&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||u!=h&&(!u||!h||u.bgClass!=h.bgClass||u.textClass!=h.textClass),y=0;!d&&yn)return yn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&kt(e,function(){for(var o=0;o=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&ta(e)==0)return!1;ha(e)&&(ur(e),t.dims=Hi(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Qt&&(o=Ci(e.doc,o),a=Ao(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;us(e,o,a),n.viewOffset=Vt(U(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=ta(e);if(!l&&s==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var u=Cs(e);return s>4&&(n.lineDiv.style.display="none"),Ls(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Ts(u),g(n.cursorDiv),g(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,yn(e,400)),n.updateLineNumbers=null,!0}function fa(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==br(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Oi(e.display)-Ni(e),n.top)}),t.visible=ei(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=ei(e.display,e.doc,n));if(!Ui(e,t))break;$n(e);var i=gn(e);dn(e),Rr(e,i),Xi(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Gi(e,t){var n=new ri(e,t);if(Ui(e,n)){$n(e),fa(e,n);var r=gn(e);dn(e),Rr(e,r),Xi(e,r),n.finish()}}function Ls(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function l(k){var T=k.nextSibling;return j&&we&&e.display.currentWheelTarget==k?k.style.display="none":k.parentNode.removeChild(k),T}for(var s=r.view,u=r.viewFrom,h=0;h-1&&(m=!1),Eo(e,d,u,n)),m&&(g(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(p(e.options,u)))),a=d.node.nextSibling}u+=d.size}for(;a;)a=l(a)}function qi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",Ve(e,"gutterChanged",e)}function Xi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Ut(e)+"px"}function ca(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Ei(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),A&&Y<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!j&&!(G&&ue)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Yi(r.gutters,r.lineNumbers),da(i),n.init(i)}var ni=0,er=null;A?er=-.53:G?er=15:q?er=-.7:He&&(er=-1/3);function pa(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function Os(e){var t=pa(e);return t.x*=er,t.y*=er,t}function va(e,t){q&&de==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var n=pa(t),r=n.x,i=n.y,o=er;t.deltaMode===0&&(r=t.deltaX,i=t.deltaY,o=1);var a=e.display,l=a.scroller,s=l.scrollWidth>l.clientWidth,u=l.scrollHeight>l.clientHeight;if(!!(r&&s||i&&u)){if(i&&we&&j){e:for(var h=t.target,d=a.view;h!=l;h=h.parentNode)for(var y=0;y=0&&x(e,r.to())<=0)return n}return-1};var Me=function(e,t){this.anchor=e,this.head=t};Me.prototype.from=function(){return Je(this.anchor,this.head)},Me.prototype.to=function(){return Se(this.anchor,this.head)},Me.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ht(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(y,m){return x(y.from(),m.from())}),n=J(t,i);for(var o=1;o0:s>=0){var u=Je(l.from(),a.from()),h=Se(l.to(),a.to()),d=l.empty()?a.from()==a.head:l.from()==l.head;o<=n&&--n,t.splice(--o,2,new Me(d?h:u,d?u:h))}}return new Mt(t,n)}function fr(e,t){return new Mt([new Me(e,t||e)],0)}function cr(e){return e.text?v(e.from.line+e.text.length-1,fe(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ga(e,t){if(x(e,t.from)<0)return e;if(x(e,t.to)<=0)return cr(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=cr(t).ch-t.to.ch),v(n,r)}function Zi(e,t){for(var n=[],r=0;r1&&e.remove(l.line+1,k-1),e.insert(l.line+1,W)}Ve(e,"change",e,t)}function hr(e,t,n){function r(i,o,a){if(i.linked)for(var l=0;l1&&!e.done[e.done.length-2].ranges)return e.done.pop(),fe(e.done)}function ka(e,t,n,r){var i=e.history;i.undone.length=0;var o=+new Date,a,l;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(a=As(i,i.lastOp==r)))l=fe(a.changes),x(t.from,t.to)==0&&x(t.from,l.to)==0?l.to=cr(t):a.changes.push(Vi(e,t));else{var s=fe(i.done);for((!s||!s.ranges)&&oi(e.sel,i.done),a={changes:[Vi(e,t)],generation:i.generation},i.done.push(a);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=o,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||Pe(e,"historyAdded")}function Ps(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Ws(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Ps(e,o,fe(i.done),t))?i.done[i.done.length-1]=t:oi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&xa(i.undone)}function oi(e,t){var n=fe(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Sa(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(a){a.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=a.markedSpans),++o})}function zs(e){if(!e)return null;for(var t,n=0;n-1&&(fe(l)[d]=u[d],delete u[d])}}return r}function $i(e,t,n,r){if(r){var i=e.anchor;if(n){var o=x(t,i)<0;o!=x(n,i)<0?(i=t,t=n):o!=x(t,n)<0&&(t=n)}return new Me(i,t)}else return new Me(n||t,t)}function ai(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),lt(e,new Mt([$i(e.sel.primary(),t,n,i)],0),r)}function Ta(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:l.to>t.ch))){if(i&&(Pe(s,"beforeCursorEnter"),s.explicitlyCleared))if(o.markedSpans){--a;continue}else break;if(!s.atomic)continue;if(n){var d=s.find(r<0?1:-1),y=void 0;if((r<0?h:u)&&(d=Aa(e,d,-r,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(y=x(d,n))&&(r<0?y<0:y>0))return Kr(e,d,t,r,i)}var m=s.find(r<0?-1:1);return(r<0?u:h)&&(m=Aa(e,m,r,m.line==t.line?o:null)),m?Kr(e,m,t,r,i):null}}return t}function si(e,t,n,r,i){var o=r||1,a=Kr(e,t,n,o,i)||!i&&Kr(e,t,n,o,!0)||Kr(e,t,n,-o,i)||!i&&Kr(e,t,n,-o,!0);return a||(e.cantEdit=!0,v(e.first,0))}function Aa(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?ae(e,v(t.line-1)):null:n>0&&t.ch==(r||U(e,t.line)).text.length?t.line=0;--i)za(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else za(e,t)}}function za(e,t){if(!(t.text.length==1&&t.text[0]==""&&x(t.from,t.to)==0)){var n=Zi(e,t);ka(e,t,n,e.cm?e.cm.curOp.id:NaN),xn(e,t,n,ki(e,t));var r=[];hr(e,function(i,o){!o&&J(r,i.history)==-1&&(Ia(i.history,t),r.push(i.history)),xn(i,t,null,ki(i,t))})}}function ui(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,o,a=e.sel,l=t=="undo"?i.done:i.undone,s=t=="undo"?i.undone:i.done,u=0;u=0;--m){var k=y(m);if(k)return k.v}}}}function Ha(e,t){if(t!=0&&(e.first+=t,e.sel=new Mt(wt(e.sel.ranges,function(i){return new Me(v(i.anchor.line+t,i.anchor.ch),v(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){vt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:v(o,U(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Jt(e,t.from,t.to),n||(n=Zi(e,t)),e.cm?Fs(e.cm,t,r):Qi(e,t,r),li(e,n,Ne),e.cantEdit&&si(e,v(e.firstLine(),0))&&(e.cantEdit=!1)}}function Fs(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=Le(Wt(U(r,o.line))),r.iter(s,a.line+1,function(m){if(m==i.maxLine)return l=!0,!0})),r.sel.contains(t.from,t.to)>-1&&En(e),Qi(r,t,n,ea(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(m){var k=qn(m);k>i.maxLineLength&&(i.maxLine=m,i.maxLineLength=k,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),Ll(r,o.line),yn(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?vt(e):o.line==a.line&&t.text.length==1&&!ya(e.doc,t)?sr(e,o.line,"text"):vt(e,o.line,a.line+1,u);var h=ft(e,"changes"),d=ft(e,"change");if(d||h){var y={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&Ve(e,"change",e,y),h&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(y)}e.display.selForContextMenu=null}function Ur(e,t,n,r,i){var o;r||(r=n),x(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),jr(e,{from:n,to:r,text:t,origin:i})}function Ea(e,t,n,r){n1||!(this.children[0]instanceof Sn))){var l=[];this.collapse(l),this.children=[new Sn(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,l=a;l10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=h,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&vt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Na(e.doc)),e&&Ve(e,"markerCleared",e,this,r,i),t&&Lr(e),this.parent&&this.parent.clear()}},dr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i0||a==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=N("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Do(e,t.line,t,n,o)||t.line!=n.line&&Do(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ol()}o.addToHistory&&ka(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l=t.line,s=e.cm,u;if(e.iter(l,n.line+1,function(d){s&&o.collapsed&&!s.options.lineWrapping&&Wt(d)==s.display.maxLine&&(u=!0),o.collapsed&&l!=t.line&&At(d,0),Dl(d,new Kn(o,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l}),o.collapsed&&e.iter(t.line,n.line+1,function(d){lr(e,d)&&At(d,0)}),o.clearOnEnter&&E(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Ml(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Ra,o.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),o.collapsed)vt(s,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var h=t.line;h<=n.line;h++)sr(s,h,"text");o.atomic&&Na(s.doc),Ve(s,"markerAdded",s,o)}return o}var Ln=function(e,t){this.markers=e,this.primary=t;for(var n=0;n=0;s--)jr(this,r[s]);l?Ma(this,l):this.cm&&Br(this.cm)}),undo:et(function(){ui(this,"undo")}),redo:et(function(){ui(this,"redo")}),undoSelection:et(function(){ui(this,"undo",!0)}),redoSelection:et(function(){ui(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ae(this,e),t=ae(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l=s.to||s.from==null&&i!=e.line||s.from!=null&&i==t.line&&s.from>=t.ch)&&(!n||n(s.marker))&&r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n}),ae(this,v(n,t))},indexFromPos:function(e){e=ae(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var h=e.dataTransfer.getData("Text");if(h){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),li(t.doc,fr(n,n)),d)for(var y=0;y=0;l--)Ur(e.doc,"",r[l].from,r[l].to,"+delete");Br(e)})}function to(e,t,n){var r=It(e.text,t+n,n);return r<0||r>e.text.length?null:r}function ro(e,t,n){var r=to(e,t.ch,n);return r==null?null:new v(t.line,r,n<0?"after":"before")}function no(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var o=Nt(n,t.doc.direction);if(o){var a=i<0?fe(o):o[0],l=i<0==(a.level==1),s=l?"after":"before",u;if(a.level>0||t.doc.direction=="rtl"){var h=Hr(t,n);u=i<0?n.text.length-1:0;var d=Gt(t,h,u).top;u=Re(function(y){return Gt(t,h,y).top==d},i<0==(a.level==1)?a.from:a.to-1,u),s=="before"&&(u=to(n,u,1))}else u=i<0?a.to:a.from;return new v(r,u,s)}}return new v(r,i<0?n.text.length:0,i<0?"before":"after")}function Qs(e,t,n,r){var i=Nt(t,e.doc.direction);if(!i)return ro(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=Ot(i,n.ch,n.sticky),a=i[o];if(e.doc.direction=="ltr"&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&y>=h.begin)){var m=d?"before":"after";return new v(n.line,y,m)}}var k=function(W,F,z){for(var I=function(De,tt){return tt?new v(n.line,l(De,1),"before"):new v(n.line,De,"after")};W>=0&&W0==(Q.level!=1),ce=X?z.begin:l(z.end,-1);if(Q.from<=ce&&ce0?h.end:l(h.begin,-1);return O!=null&&!(r>0&&O==t.text.length)&&(T=k(r>0?0:i.length-1,r,u(O)),T)?T:null}var Nn={selectAll:Pa,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ne)},killLine:function(e){return Xr(e,function(t){if(t.empty()){var n=U(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new v(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),v(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=U(e.doc,i.line-1).text;a&&(i=new v(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),v(i.line-1,a.length-1),i,"+transpose"))}}n.push(new Me(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return kt(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;re&&x(t,this.pos)==0&&n==this.button};var An,Pn;function iu(e,t){var n=+new Date;return Pn&&Pn.compare(n,e,t)?(An=Pn=null,"triple"):An&&An.compare(n,e,t)?(Pn=new oo(n,e,t),An=null,"double"):(An=new oo(n,e,t),Pn=null,"single")}function rl(e){var t=this,n=t.display;if(!(_e(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,$t(n,e)){j||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!ao(t,e)){var r=xr(t,e),i=nn(e),o=r?iu(r,i):"single";xe(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&ou(t,i,r,o,e))&&(i==1?r?lu(t,r,o,e):pt(e)==n.scroller&&at(e):i==2?(r&&ai(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(ne?t.display.input.onContextMenu(e):Ri(t)))}}}function ou(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=Nn[a]),!a)return!1;var l=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),l=a(e,n)!=Z}finally{e.state.suppressEdits=!1}return l})}function au(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var o=qe?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=we?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(we?n.altKey:n.ctrlKey)),i}function lu(e,t,n,r){A?setTimeout(me(na,e),0):e.curOp.focus=ee(ge(e));var i=au(e,n,r),o=e.doc.sel,a;e.options.dragDrop&&yi&&!e.isReadOnly()&&n=="single"&&(a=o.contains(t))>-1&&(x((a=o.ranges[a]).from(),t)<0||t.xRel>0)&&(x(a.to(),t)>0||t.xRel<0)?su(e,r,t,i):uu(e,r,t,i)}function su(e,t,n,r){var i=e.display,o=!1,a=$e(e,function(u){j&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Ri(e)),ot(i.wrapper.ownerDocument,"mouseup",a),ot(i.wrapper.ownerDocument,"mousemove",l),ot(i.scroller,"dragstart",s),ot(i.scroller,"drop",a),o||(at(u),r.addNew||ai(e.doc,n,null,null,r.extend),j&&!He||A&&Y==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),l=function(u){o=o||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return o=!0};j&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=!r.moveOnDrag,E(i.wrapper.ownerDocument,"mouseup",a),E(i.wrapper.ownerDocument,"mousemove",l),E(i.scroller,"dragstart",s),E(i.scroller,"drop",a),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function nl(e,t,n){if(n=="char")return new Me(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Me(v(t.line,0),ae(e.doc,v(t.line+1,0)));var r=n(e,t);return new Me(r.from,r.to)}function uu(e,t,n,r){A&&Ri(e);var i=e.display,o=e.doc;at(t);var a,l,s=o.sel,u=s.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),l>-1?a=u[l]:a=new Me(n,n)):(a=o.sel.primary(),l=o.sel.primIndex),r.unit=="rectangle")r.addNew||(a=new Me(n,n)),n=xr(e,t,!0,!0),l=-1;else{var h=nl(e,n,r.unit);r.extend?a=$i(a,h.anchor,h.head,r.extend):a=h}r.addNew?l==-1?(l=u.length,lt(o,Ht(e,u.concat([a]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&r.unit=="char"&&!r.extend?(lt(o,Ht(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):eo(o,l,a,Ct):(l=0,lt(o,new Mt([a],0),Ct),s=o.sel);var d=n;function y(z){if(x(d,z)!=0)if(d=z,r.unit=="rectangle"){for(var I=[],Q=e.options.tabSize,X=R(U(o,n.line).text,n.ch,Q),ce=R(U(o,z.line).text,z.ch,Q),De=Math.min(X,ce),tt=Math.max(X,ce),Ie=Math.min(n.line,z.line),St=Math.min(e.lastLine(),Math.max(n.line,z.line));Ie<=St;Ie++){var mt=U(o,Ie).text,Ye=Tt(mt,De,Q);De==tt?I.push(new Me(v(Ie,Ye),v(Ie,Ye))):mt.length>Ye&&I.push(new Me(v(Ie,Ye),v(Ie,Tt(mt,tt,Q))))}I.length||I.push(new Me(n,n)),lt(o,Ht(e,s.ranges.slice(0,l).concat(I),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(z)}else{var yt=a,it=nl(e,z,r.unit),Qe=yt.anchor,Ze;x(it.anchor,Qe)>0?(Ze=it.head,Qe=Je(yt.from(),it.anchor)):(Ze=it.anchor,Qe=Se(yt.to(),it.head));var je=s.ranges.slice(0);je[l]=fu(e,new Me(ae(o,Qe),Ze)),lt(o,Ht(e,je,l),Ct)}}var m=i.wrapper.getBoundingClientRect(),k=0;function T(z){var I=++k,Q=xr(e,z,!0,r.unit=="rectangle");if(!!Q)if(x(Q,d)!=0){e.curOp.focus=ee(ge(e)),y(Q);var X=ei(i,o);(Q.line>=X.to||Q.linem.bottom?20:0;ce&&setTimeout($e(e,function(){k==I&&(i.scroller.scrollTop+=ce,T(z))}),50)}}function O(z){e.state.selectingText=!1,k=1/0,z&&(at(z),i.input.focus()),ot(i.wrapper.ownerDocument,"mousemove",W),ot(i.wrapper.ownerDocument,"mouseup",F),o.history.lastSelOrigin=null}var W=$e(e,function(z){z.buttons===0||!nn(z)?O(z):T(z)}),F=$e(e,O);e.state.selectingText=F,E(i.wrapper.ownerDocument,"mousemove",W),E(i.wrapper.ownerDocument,"mouseup",F)}function fu(e,t){var n=t.anchor,r=t.head,i=U(e.doc,n.line);if(x(n,r)==0&&n.sticky==r.sticky)return t;var o=Nt(i);if(!o)return t;var a=Ot(o,n.ch,n.sticky),l=o[a];if(l.from!=n.ch&&l.to!=n.ch)return t;var s=a+(l.from==n.ch==(l.level!=1)?0:1);if(s==0||s==o.length)return t;var u;if(r.line!=n.line)u=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var h=Ot(o,r.ch,r.sticky),d=h-a||(r.ch-n.ch)*(l.level==1?-1:1);h==s-1||h==s?u=d<0:u=d>0}var y=o[s+(u?-1:0)],m=u==(y.level==1),k=m?y.from:y.to,T=m?"after":"before";return n.ch==k&&n.sticky==T?t:new Me(new v(n.line,k,T),r)}function il(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(y){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&at(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!ft(e,n))return rn(t);o-=l.top-a.viewOffset;for(var s=0;s=i){var h=Kt(e.doc,o),d=e.display.gutterSpecs[s];return Pe(e,n,e,h,d.className,t),rn(t)}}}function ao(e,t){return il(e,t,"gutterClick",!0)}function ol(e,t){$t(e.display,t)||cu(e,t)||_e(e,t,"contextmenu")||ne||e.display.input.onContextMenu(t)}function cu(e,t){return ft(e,"gutterContextMenu")?il(e,t,"gutterContextMenu",!1):!1}function al(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),hn(e)}var Yr={toString:function(){return"CodeMirror.Init"}},ll={},di={};function hu(e){var t=e.optionHandlers;function n(r,i,o,a){e.defaults[r]=i,o&&(t[r]=a?function(l,s,u){u!=Yr&&o(l,s,u)}:o)}e.defineOption=n,e.Init=Yr,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Ji(r)},!0),n("indentUnit",2,Ji,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){wn(r),hn(r),vt(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!!i){var o=[],a=r.doc.first;r.doc.iter(function(s){for(var u=0;;){var h=s.text.indexOf(i,u);if(h==-1)break;u=h+i.length,o.push(v(a,h))}a++});for(var l=o.length-1;l>=0;l--)Ur(r.doc,i,o[l],v(o[l].line,o[l].ch+i.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,i,o){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),o!=Yr&&r.refresh()}),n("specialCharPlaceholder",_l,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",ue?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!nt),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){al(r),bn(r)},!0),n("keyMap","default",function(r,i,o){var a=ci(i),l=o!=Yr&&ci(o);l&&l.detach&&l.detach(r,a),a.attach&&a.attach(r,l||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,pu,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=Yi(i,r.options.lineNumbers),bn(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?Ei(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Rr(r)},!0),n("scrollbarStyle","native",function(r){ua(r),Rr(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=Yi(r.options.gutters,i),bn(r)},!0),n("firstLineNumber",1,bn,!0),n("lineNumberFormatter",function(r){return r},bn,!0),n("showCursorWhenSelecting",!1,dn,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Ir(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,du),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,dn,!0),n("singleCursorHeightPerLine",!0,dn,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,wn,!0),n("addModeClass",!1,wn,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,wn,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function du(e,t,n){var r=n&&n!=Yr;if(!t!=!r){var i=e.display.dragFunctions,o=t?E:ot;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function pu(e){e.options.lineWrapping?(_(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(M(e.display.wrapper,"CodeMirror-wrap"),Li(e)),Fi(e),vt(e),hn(e),setTimeout(function(){return Rr(e)},100)}function Fe(e,t){var n=this;if(!(this instanceof Fe))return new Fe(e,t);this.options=t=t?K(t):{},K(ll,t,!1);var r=t.value;typeof r=="string"?r=new gt(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Fe.inputStyles[t.inputStyle](this),o=this.display=new Ms(e,r,i,t);o.wrapper.CodeMirror=this,al(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ua(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new $,keySeq:null,specialChars:null},t.autofocus&&!ue&&o.input.focus(),A&&Y<11&&setTimeout(function(){return n.display.input.reset(!0)},20),vu(this),qs(),Tr(this),this.curOp.forceUpdate=!0,ba(this,r),t.autofocus&&!ue||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&_i(n)},20):Ir(this);for(var a in di)di.hasOwnProperty(a)&&di[a](this,t[a],Yr);ha(this),t.finishInit&&t.finishInit(this);for(var l=0;l20*20}E(t.scroller,"touchstart",function(s){if(!_e(e,s)&&!o(s)&&!ao(e,s)){t.input.ensurePolled(),clearTimeout(n);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-r.end<=300?r:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),E(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),E(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!$t(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var h=e.coordsChar(t.activeTouch,"page"),d;!u.prev||a(u,u.prev)?d=new Me(h,h):!u.prev.prev||a(u,u.prev.prev)?d=e.findWordAt(h):d=new Me(v(h.line,0),ae(e.doc,v(h.line+1,0))),e.setSelection(d.anchor,d.head),e.focus(),at(s)}i()}),E(t.scroller,"touchcancel",i),E(t.scroller,"scroll",function(){t.scroller.clientHeight&&(vn(e,t.scroller.scrollTop),Sr(e,t.scroller.scrollLeft,!0),Pe(e,"scroll",e))}),E(t.scroller,"mousewheel",function(s){return va(e,s)}),E(t.scroller,"DOMMouseScroll",function(s){return va(e,s)}),E(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){_e(e,s)||Xt(s)},over:function(s){_e(e,s)||(Gs(e,s),Xt(s))},start:function(s){return Us(e,s)},drop:$e(e,js),leave:function(s){_e(e,s)||ja(e)}};var l=t.input.getField();E(l,"keyup",function(s){return el.call(e,s)}),E(l,"keydown",$e(e,$a)),E(l,"keypress",$e(e,tl)),E(l,"focus",function(s){return _i(e,s)}),E(l,"blur",function(s){return Ir(e,s)})}var lo=[];Fe.defineInitHook=function(e){return lo.push(e)};function Wn(e,t,n,r){var i=e.doc,o;n==null&&(n="add"),n=="smart"&&(i.mode.indent?o=ln(e,t).state:n="prev");var a=e.options.tabSize,l=U(i,t),s=R(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var u=l.text.match(/^\s*/)[0],h;if(!r&&!/\S/.test(l.text))h=0,n="not";else if(n=="smart"&&(h=i.mode.indent(o,l.text.slice(u.length),l.text),h==Z||h>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?h=R(U(i,t-1).text,null,a):h=0:n=="add"?h=s+e.options.indentUnit:n=="subtract"?h=s-e.options.indentUnit:typeof n=="number"&&(h=s+n),h=Math.max(0,h);var d="",y=0;if(e.options.indentWithTabs)for(var m=Math.floor(h/a);m;--m)y+=a,d+=" ";if(ya,s=on(t),u=null;if(l&&r.ranges.length>1)if(Et&&Et.text.join(` `)==t){if(r.ranges.length%Et.text.length==0){u=[];for(var h=0;h=0;y--){var m=r.ranges[y],k=m.from(),T=m.to();m.empty()&&(n&&n>0?k=v(k.line,k.ch-n):e.state.overwrite&&!l?T=v(T.line,Math.min(U(o,T.line).text.length,T.ch+fe(s).length)):l&&Et&&Et.lineWise&&Et.text.join(` `)==s.join(` `)&&(k=T=v(k.line,0)));var O={from:k,to:T,text:u?u[y%u.length]:s,origin:i||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};jr(e.doc,O),Ve(e,"inputRead",e,O)}t&&!l&&ul(e,t),Br(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function sl(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&kt(t,function(){return so(t,n,0,null,"paste")}),!0}function ul(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-1){a=Wn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(U(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 fl(e){for(var t=[],n=[],r=0;ro&&(Wn(this,l.head.line,r,!0),o=l.head.line,a==this.doc.sel.primIndex&&Br(this));else{var s=l.from(),u=l.to(),h=Math.max(o,s.line);o=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var d=h;d0&&eo(this.doc,a,new Me(s,y[a].to()),Ne)}}}),getTokenAt:function(r,i){return xo(this,r,i)},getLineTokens:function(r,i){return xo(this,v(r),i,!0)},getTokenTypeAt:function(r){r=ae(this.doc,r);var i=yo(this,U(this.doc,r.line)),o=0,a=(i.length-1)/2,l=r.ch,s;if(l==0)s=i[2];else for(;;){var u=o+a>>1;if((u?i[u*2-1]:0)>=l)a=u;else if(i[u*2+1]s&&(r=s,a=!0),l=U(this.doc,r)}else l=r;return Zn(this,l,{top:0,left:0},i||"page",o||a).top+(a?this.doc.height-Vt(l):0)},defaultTextHeight:function(){return Er(this.display)},defaultCharWidth:function(){return Fr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,o,a,l){var s=this.display;r=zt(this,ae(this.doc,r));var u=r.bottom,h=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),s.sizer.appendChild(i),a=="over")u=r.top;else if(a=="above"||a=="near"){var d=Math.max(s.wrapper.clientHeight,this.doc.height),y=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(a=="above"||r.bottom+i.offsetHeight>d)&&r.top>i.offsetHeight?u=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=d&&(u=r.bottom),h+i.offsetWidth>y&&(h=y-i.offsetWidth)}i.style.top=u+"px",i.style.left=i.style.right="",l=="right"?(h=s.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(l=="left"?h=0:l=="middle"&&(h=(s.sizer.clientWidth-i.offsetWidth)/2),i.style.left=h+"px"),o&&ds(this,{left:h,top:u,right:h+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:ht($a),triggerOnKeyPress:ht(tl),triggerOnKeyUp:el,triggerOnMouseDown:ht(rl),execCommand:function(r){if(Nn.hasOwnProperty(r))return Nn[r].call(null,this)},triggerElectric:ht(function(r){ul(this,r)}),findPosH:function(r,i,o,a){var l=1;i<0&&(l=-1,i=-i);for(var s=ae(this.doc,r),u=0;u0&&h(o.charAt(a-1));)--a;for(;l.5||this.options.lineWrapping)&&Fi(this),Pe(this,"refresh",this)}),swapDoc:ht(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),ba(this,r),hn(this),this.display.input.reset(),pn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Ve(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ct(e),e.registerHelper=function(r,i,o){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=o},e.registerGlobalHelper=function(r,i,o,a){e.registerHelper(r,i,a),n[r]._global.push({pred:o,val:a})}}function uo(e,t,n,r,i){var o=t,a=n,l=U(e,t.line),s=i&&e.direction=="rtl"?-n:n;function u(){var F=t.line+s;return F=e.first+e.size?!1:(t=new v(F,t.ch,t.sticky),l=U(e,F))}function h(F){var z;if(r=="codepoint"){var I=l.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(I))z=null;else{var Q=n>0?I>=55296&&I<56320:I>=56320&&I<57343;z=new v(t.line,Math.max(0,Math.min(l.text.length,t.ch+n*(Q?2:1))),-n)}}else i?z=Qs(e.cm,l,t,n):z=ro(l,t,n);if(z==null)if(!F&&u())t=no(i,e.cm,l,t.line,s);else return!1;else t=z;return!0}if(r=="char"||r=="codepoint")h();else if(r=="column")h(!0);else if(r=="word"||r=="group")for(var d=null,y=r=="group",m=e.cm&&e.cm.getHelper(t,"wordChars"),k=!0;!(n<0&&!h(!k));k=!1){var T=l.text.charAt(t.ch)||` `,O=ve(T,m)?"w":y&&T==` `?"n":!y||/\s/.test(T)?null:"p";if(y&&!k&&!O&&(O="s"),d&&d!=O){n<0&&(n=1,h(),t.sticky="after");break}if(O&&(d=O),n>0&&!h(!k))break}var W=si(e,t,o,a,!0);return oe(o,W)&&(W.hitSide=!0),W}function dl(e,t,n,r){var i=e.doc,o=t.left,a;if(r=="page"){var l=Math.min(e.display.wrapper.clientHeight,xe(e).innerHeight||i(e).documentElement.clientHeight),s=Math.max(l-.5*Er(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 u;u=Wi(e,o,a),!!u.outside;){if(n<0?a<=0:a>=i.height){u.hitSide=!0;break}a+=n*5}return u}var Oe=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new $,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Oe.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,cl(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}E(i,"paste",function(l){!o(l)||_e(r,l)||sl(l,r)||Y<=11&&setTimeout($e(r,function(){return t.updateFromDOM()}),20)}),E(i,"compositionstart",function(l){t.composing={data:l.data,done:!1}}),E(i,"compositionupdate",function(l){t.composing||(t.composing={data:l.data,done:!1})}),E(i,"compositionend",function(l){t.composing&&(l.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),E(i,"touchstart",function(){return n.forceCompositionEnd()}),E(i,"input",function(){t.composing||t.readFromDOMSoon()});function a(l){if(!(!o(l)||_e(r,l))){if(r.somethingSelected())pi({lineWise:!1,text:r.getSelections()}),l.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=fl(r);pi({lineWise:!0,text:s.text}),l.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,Ne),r.replaceSelection("",null,"cut")})}else return;if(l.clipboardData){l.clipboardData.clearData();var u=Et.text.join(` `);if(l.clipboardData.setData("Text",u),l.clipboardData.getData("Text")==u){l.preventDefault();return}}var h=hl(),d=h.firstChild;r.display.lineSpace.insertBefore(h,r.display.lineSpace.firstChild),d.value=Et.text.join(` `);var y=ee(i.ownerDocument);pe(d),setTimeout(function(){r.display.lineSpace.removeChild(h),y.focus(),y==i&&n.showPrimarySelection()},50)}}E(i,"copy",a),E(i,"cut",a)},Oe.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Oe.prototype.prepareSelection=function(){var e=ra(this.cm,!1);return e.focus=ee(this.div.ownerDocument)==this.div,e},Oe.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Oe.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Oe.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&&pl(t,r)||{node:l[0].measure.map[2],offset:0},u=i.linee.firstLine()&&(r=v(r.line-1,U(e.doc,r.line-1).length)),i.ch==U(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var o,a,l;r.line==t.viewFrom||(o=kr(e,r.line))==0?(a=Le(t.view[0].line),l=t.view[0].node):(a=Le(t.view[o].line),l=t.view[o-1].node.nextSibling);var s=kr(e,i.line),u,h;if(s==t.view.length-1?(u=t.viewTo-1,h=t.lineDiv.lastChild):(u=Le(t.view[s+1].line)-1,h=t.view[s+1].node.previousSibling),!l)return!1;for(var d=e.doc.splitLines(yu(e,l,h,a,u)),y=Jt(e.doc,v(a,0),v(u,U(e.doc,u).text.length));d.length>1&&y.length>1;)if(fe(d)==fe(y))d.pop(),y.pop(),u--;else if(d[0]==y[0])d.shift(),y.shift(),a++;else break;for(var m=0,k=0,T=d[0],O=y[0],W=Math.min(T.length,O.length);mr.ch&&F.charCodeAt(F.length-k-1)==z.charCodeAt(z.length-k-1);)m--,k++;d[d.length-1]=F.slice(0,F.length-k).replace(/^\u200b+/,""),d[0]=d[0].slice(m).replace(/\u200b+$/,"");var Q=v(a,m),X=v(u,y.length?fe(y).length-k:0);if(d.length>1||d[0]||x(Q,X))return Ur(e.doc,d,Q,X,"+input"),!0},Oe.prototype.ensurePolled=function(){this.forceCompositionEnd()},Oe.prototype.reset=function(){this.forceCompositionEnd()},Oe.prototype.forceCompositionEnd=function(){!this.composing||(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Oe.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},Oe.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&kt(this.cm,function(){return vt(e.cm)})},Oe.prototype.setUneditable=function(e){e.contentEditable="false"},Oe.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||$e(this.cm,so)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},Oe.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Oe.prototype.onContextMenu=function(){},Oe.prototype.resetPosition=function(){},Oe.prototype.needsContentAttribute=!0;function pl(e,t){var n=Di(e,t.line);if(!n||n.hidden)return null;var r=U(e.doc,t.line),i=Ko(n,r,t.line),o=Nt(r,e.doc.direction),a="left";if(o){var l=Ot(o,t.ch);a=l%2?"right":"left"}var s=Go(i.map,t.ch,a);return s.offset=s.collapse=="right"?s.end:s.start,s}function mu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Zr(e,t){return t&&(e.bad=!0),e}function yu(e,t,n,r,i){var o="",a=!1,l=e.doc.lineSeparator(),s=!1;function u(m){return function(k){return k.id==m}}function h(){a&&(o+=l,s&&(o+=l),a=s=!1)}function d(m){m&&(h(),o+=m)}function y(m){if(m.nodeType==1){var k=m.getAttribute("cm-text");if(k){d(k);return}var T=m.getAttribute("cm-marker"),O;if(T){var W=e.findMarks(v(r,0),v(i+1,0),u(+T));W.length&&(O=W[0].find(0))&&d(Jt(e.doc,O.from,O.to).join(l));return}if(m.getAttribute("contenteditable")=="false")return;var F=/^(pre|div|p|li|table|br)$/i.test(m.nodeName);if(!/^br$/i.test(m.nodeName)&&m.textContent.length==0)return;F&&h();for(var z=0;z=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),E(i,"paste",function(a){_e(r,a)||sl(a,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function o(a){if(!_e(r,a)){if(r.somethingSelected())pi({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var l=fl(r);pi({lineWise:!0,text:l.text}),a.type=="cut"?r.setSelections(l.ranges,null,Ne):(n.prevInput="",i.value=l.text.join(` `),pe(i))}else return;a.type=="cut"&&(r.state.cutIncoming=+new Date)}}E(i,"cut",o),E(i,"copy",o),E(e.scroller,"paste",function(a){if(!($t(e,a)||_e(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)}}),E(e.lineSpace,"selectstart",function(a){$t(e,a)||at(a)}),E(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"})}}),E(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Ge.prototype.createField=function(e){this.wrapper=hl(),this.textarea=this.wrapper.firstChild},Ge.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ge.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=ra(e);if(e.options.moveInputWithCursor){var i=zt(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},Ge.prototype.showSelection=function(e){var t=this.cm,n=t.display;C(n.cursorDiv,e.cursors),C(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ge.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&&pe(this.textarea),A&&Y>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",A&&Y>=9&&(this.hasSelection=null));this.resetting=!1}},Ge.prototype.getField=function(){return this.textarea},Ge.prototype.supportsTouch=function(){return!1},Ge.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!ue||ee(this.textarea.ownerDocument)!=this.textarea))try{this.textarea.focus()}catch(e){}},Ge.prototype.blur=function(){this.textarea.blur()},Ge.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ge.prototype.receivedFocus=function(){this.slowPoll()},Ge.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ge.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)},Ge.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||nr(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(A&&Y>=9&&this.hasSelection===i||we&&/[\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="\u200B"),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var a=0,l=Math.min(r.length,i.length);a1e3||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},Ge.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ge.prototype.onKeyPress=function(){A&&Y>=9&&(this.hasSelection=null),this.fastPoll()},Ge.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=xr(n,e),a=r.scroller.scrollTop;if(!o||he)return;var l=n.options.resetSelectionOnContextMenu;l&&n.doc.sel.contains(o)==-1&&$e(n,lt)(n.doc,fr(o),Ne);var s=i.style.cssText,u=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+`px; z-index: 1000; background: `+(A?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var d;j&&(d=i.ownerDocument.defaultView.scrollY),r.input.focus(),j&&i.ownerDocument.defaultView.scrollTo(null,d),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=m,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function y(){if(i.selectionStart!=null){var T=n.somethingSelected(),O="\u200B"+(T?i.value:"");i.value="\u21DA",i.value=O,t.prevInput=T?"":"\u200B",i.selectionStart=1,i.selectionEnd=O.length,r.selForContextMenu=n.doc.sel}}function m(){if(t.contextMenuPending==m&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,i.style.cssText=s,A&&Y<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=a),i.selectionStart!=null)){(!A||A&&Y<9)&&y();var T=0,O=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?$e(n,Pa)(n):T++<10?r.detectingSelectAll=setTimeout(O,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(O,200)}}if(A&&Y>=9&&y(),ne){Xt(e);var k=function(){ot(window,"mouseup",k),setTimeout(m,20)};E(window,"mouseup",k)}else setTimeout(m,50)},Ge.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ge.prototype.setUneditable=function(){},Ge.prototype.needsContentAttribute=!1;function wu(e,t){if(t=t?K(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=ee(e.ownerDocument);t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=l.getValue()}var i;if(e.form&&(E(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(s){}}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&&(ot(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var l=Fe(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return l}function xu(e){e.off=ot,e.on=E,e.wheelEventPixels=Os,e.Doc=gt,e.splitLines=on,e.countColumn=R,e.findColumn=Tt,e.isWordChar=S,e.Pass=Z,e.signal=Pe,e.Line=Wr,e.changeEnd=cr,e.scrollbarModel=sa,e.Pos=v,e.cmpPos=x,e.modes=Pt,e.mimeModes=ir,e.resolveMode=xt,e.getMode=Yt,e.modeExtensions=or,e.extendMode=Rn,e.copyState=Zt,e.startState=an,e.innerMode=ar,e.commands=Nn,e.keyMap=tr,e.keyName=Ya,e.isModifierKey=qa,e.lookupKey=qr,e.normalizeKeyMap=Js,e.StringStream=Ke,e.SharedTextMarker=Ln,e.TextMarker=dr,e.LineWidget=Tn,e.e_preventDefault=at,e.e_stopPropagation=yr,e.e_stop=Xt,e.addClass=_,e.contains=B,e.rmClass=M,e.keyNames=pr}hu(Fe),gu(Fe);var ku="iter insert remove copy getEditor constructor".split(" ");for(var gi in gt.prototype)gt.prototype.hasOwnProperty(gi)&&J(ku,gi)<0&&(Fe.prototype[gi]=function(e){return function(){return e.apply(this.doc,arguments)}}(gt.prototype[gi]));return ct(gt),Fe.inputStyles={textarea:Ge,contenteditable:Oe},Fe.defineMode=function(e){!Fe.defaults.mode&&e!="null"&&(Fe.defaults.mode=e),Bn.apply(this,arguments)},Fe.defineMIME=Ar,Fe.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Fe.defineMIME("text/plain","null"),Fe.defineExtension=function(e,t){Fe.prototype[e]=t},Fe.defineDocExtension=function(e,t){gt.prototype[e]=t},Fe.fromTextArea=wu,xu(Fe),Fe.version="5.65.10",Fe})})($r);var Bu=$r.exports,Vr=(be=>(be.JSON="application/json",be.HTML="htmlmixed",be.JS="javascript",be))(Vr||{});var Ru={exports:{}};(function(be,ze){(function(P){P($r.exports)})(function(P){P.defineMode("javascript",function(Ce,G){var se=Ce.indentUnit,We=G.statementIndent,H=G.jsonld,A=G.json||H,Y=G.trackScope!==!1,j=G.typescript,le=G.wordCharacters||/[\w$\xa1-\uffff]/,q=function(){function f(Je){return{type:Je,style:"keyword"}}var p=f("keyword a"),v=f("keyword b"),x=f("keyword c"),oe=f("keyword d"),ye=f("operator"),Se={type:"atom",style:"atom"};return{if:f("if"),while:p,with:p,else:v,do:v,try:v,finally:v,return:oe,break:oe,continue:oe,new:f("new"),delete:x,void:x,throw:x,debugger:f("debugger"),var:f("var"),const:f("var"),let:f("var"),function:f("function"),catch:f("catch"),for:f("for"),switch:f("switch"),case:f("case"),default:f("default"),in:ye,typeof:ye,instanceof:ye,true:Se,false:Se,null:Se,undefined:Se,NaN:Se,Infinity:Se,this:f("this"),class:f("class"),super:f("atom"),yield:x,export:f("export"),import:f("import"),extends:x,await:x}}(),de=/[+\-*&%=<>!?|~^@]/,he=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function He(f){for(var p=!1,v,x=!1;(v=f.next())!=null;){if(!p){if(v=="/"&&!x)return;v=="["?x=!0:x&&v=="]"&&(x=!1)}p=!p&&v=="\\"}}var Ee,Be;function re(f,p,v){return Ee=f,Be=v,p}function ie(f,p){var v=f.next();if(v=='"'||v=="'")return p.tokenize=ue(v),p.tokenize(f,p);if(v=="."&&f.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return re("number","number");if(v=="."&&f.match(".."))return re("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(v))return re(v);if(v=="="&&f.eat(">"))return re("=>","operator");if(v=="0"&&f.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return re("number","number");if(/\d/.test(v))return f.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),re("number","number");if(v=="/")return f.eat("*")?(p.tokenize=we,we(f,p)):f.eat("/")?(f.skipToEnd(),re("comment","comment")):Kt(f,p,1)?(He(f),f.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),re("regexp","string-2")):(f.eat("="),re("operator","operator",f.current()));if(v=="`")return p.tokenize=qe,qe(f,p);if(v=="#"&&f.peek()=="!")return f.skipToEnd(),re("meta","meta");if(v=="#"&&f.eatWhile(le))return re("variable","property");if(v=="<"&&f.match("!--")||v=="-"&&f.match("->")&&!/\S/.test(f.string.slice(0,f.start)))return f.skipToEnd(),re("comment","comment");if(de.test(v))return(v!=">"||!p.lexical||p.lexical.type!=">")&&(f.eat("=")?(v=="!"||v=="=")&&f.eat("="):/[<>*+\-|&?]/.test(v)&&(f.eat(v),v==">"&&f.eat(v))),v=="?"&&f.eat(".")?re("."):re("operator","operator",f.current());if(le.test(v)){f.eatWhile(le);var x=f.current();if(p.lastType!="."){if(q.propertyIsEnumerable(x)){var oe=q[x];return re(oe.type,oe.style,x)}if(x=="async"&&f.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return re("async","keyword",x)}return re("variable","variable",x)}}function ue(f){return function(p,v){var x=!1,oe;if(H&&p.peek()=="@"&&p.match(he))return v.tokenize=ie,re("jsonld-keyword","meta");for(;(oe=p.next())!=null&&!(oe==f&&!x);)x=!x&&oe=="\\";return x||(v.tokenize=ie),re("string","string")}}function we(f,p){for(var v=!1,x;x=f.next();){if(x=="/"&&v){p.tokenize=ie;break}v=x=="*"}return re("comment","comment")}function qe(f,p){for(var v=!1,x;(x=f.next())!=null;){if(!v&&(x=="`"||x=="$"&&f.eat("{"))){p.tokenize=ie;break}v=!v&&x=="\\"}return re("quasi","string-2",f.current())}var nt="([{}])";function ke(f,p){p.fatArrowAt&&(p.fatArrowAt=null);var v=f.string.indexOf("=>",f.start);if(!(v<0)){if(j){var x=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(f.string.slice(f.start,v));x&&(v=x.index)}for(var oe=0,ye=!1,Se=v-1;Se>=0;--Se){var Je=f.string.charAt(Se),Lt=nt.indexOf(Je);if(Lt>=0&&Lt<3){if(!oe){++Se;break}if(--oe==0){Je=="("&&(ye=!0);break}}else if(Lt>=3&&Lt<6)++oe;else if(le.test(Je))ye=!0;else if(/["'\/`]/.test(Je))for(;;--Se){if(Se==0)return;var ae=f.string.charAt(Se-1);if(ae==Je&&f.string.charAt(Se-2)!="\\"){Se--;break}}else if(ye&&!oe){++Se;break}}ye&&!oe&&(p.fatArrowAt=Se)}}var Ue={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function ne(f,p,v,x,oe,ye){this.indented=f,this.column=p,this.type=v,this.prev=oe,this.info=ye,x!=null&&(this.align=x)}function b(f,p){if(!Y)return!1;for(var v=f.localVars;v;v=v.next)if(v.name==p)return!0;for(var x=f.context;x;x=x.prev)for(var v=x.vars;v;v=v.next)if(v.name==p)return!0}function M(f,p,v,x,oe){var ye=f.cc;for(g.state=f,g.stream=oe,g.marked=null,g.cc=ye,g.style=p,f.lexical.hasOwnProperty("align")||(f.lexical.align=!0);;){var Se=ye.length?ye.pop():A?Z:J;if(Se(v,x)){for(;ye.length&&ye[ye.length-1].lex;)ye.pop()();return g.marked?g.marked:v=="variable"&&b(f,x)?"variable-2":p}}}var g={state:null,column:null,marked:null,cc:null};function C(){for(var f=arguments.length-1;f>=0;f--)g.cc.push(arguments[f])}function c(){return C.apply(null,arguments),!0}function N(f,p){for(var v=p;v;v=v.next)if(v.name==f)return!0;return!1}function L(f){var p=g.state;if(g.marked="def",!!Y){if(p.context){if(p.lexical.info=="var"&&p.context&&p.context.block){var v=B(f,p.context);if(v!=null){p.context=v;return}}else if(!N(f,p.localVars)){p.localVars=new te(f,p.localVars);return}}G.globalVars&&!N(f,p.globalVars)&&(p.globalVars=new te(f,p.globalVars))}}function B(f,p){if(p)if(p.block){var v=B(f,p.prev);return v?v==p.prev?p:new _(v,p.vars,!0):null}else return N(f,p.vars)?p:new _(p.prev,new te(f,p.vars),!1);else return null}function ee(f){return f=="public"||f=="private"||f=="protected"||f=="abstract"||f=="readonly"}function _(f,p,v){this.prev=f,this.vars=p,this.block=v}function te(f,p){this.name=f,this.next=p}var pe=new te("this",new te("arguments",null));function ge(){g.state.context=new _(g.state.context,g.state.localVars,!1),g.state.localVars=pe}function xe(){g.state.context=new _(g.state.context,g.state.localVars,!0),g.state.localVars=null}ge.lex=xe.lex=!0;function me(){g.state.localVars=g.state.context.vars,g.state.context=g.state.context.prev}me.lex=!0;function K(f,p){var v=function(){var x=g.state,oe=x.indented;if(x.lexical.type=="stat")oe=x.lexical.indented;else for(var ye=x.lexical;ye&&ye.type==")"&&ye.align;ye=ye.prev)oe=ye.indented;x.lexical=new ne(oe,g.stream.column(),f,null,x.lexical,p)};return v.lex=!0,v}function R(){var f=g.state;f.lexical.prev&&(f.lexical.type==")"&&(f.indented=f.lexical.indented),f.lexical=f.lexical.prev)}R.lex=!0;function $(f){function p(v){return v==f?c():f==";"||v=="}"||v==")"||v=="]"?C():c(p)}return p}function J(f,p){return f=="var"?c(K("vardef",p),Xt,$(";"),R):f=="keyword a"?c(K("form"),Ct,J,R):f=="keyword b"?c(K("form"),J,R):f=="keyword d"?g.stream.match(/^\s*$/,!1)?c():c(K("stat"),Tt,$(";"),R):f=="debugger"?c($(";")):f=="{"?c(K("}"),xe,Bt,R,me):f==";"?c():f=="if"?(g.state.lexical.info=="else"&&g.state.cc[g.state.cc.length-1]==R&&g.state.cc.pop()(),c(K("form"),Ct,J,R,Dr)):f=="function"?c(Rt):f=="for"?c(K("form"),xe,Fn,J,me,R):f=="class"||j&&p=="interface"?(g.marked="keyword",c(K("form",f=="class"?f:p),Bn,R)):f=="variable"?j&&p=="declare"?(g.marked="keyword",c(J)):j&&(p=="module"||p=="enum"||p=="type")&&g.stream.match(/^\s*\w/,!1)?(g.marked="keyword",p=="enum"?c(Pr):p=="type"?c(In,$("operator"),E,$(";")):c(K("form"),pt,$("{"),K("}"),Bt,R,R)):j&&p=="namespace"?(g.marked="keyword",c(K("form"),Z,J,R)):j&&p=="abstract"?(g.marked="keyword",c(J)):c(K("stat"),ve):f=="switch"?c(K("form"),Ct,$("{"),K("}","switch"),xe,Bt,R,R,me):f=="case"?c(Z,$(":")):f=="default"?c($(":")):f=="catch"?c(K("form"),ge,V,J,R,me):f=="export"?c(K("stat"),or,R):f=="import"?c(K("stat"),Zt,R):f=="async"?c(J):p=="@"?c(Z,J):C(K("stat"),Z,$(";"),R)}function V(f){if(f=="(")return c(Pt,$(")"))}function Z(f,p){return Ft(f,p,!1)}function Ne(f,p){return Ft(f,p,!0)}function Ct(f){return f!="("?C():c(K(")"),Tt,$(")"),R)}function Ft(f,p,v){if(g.state.fatArrowAt==g.stream.start){var x=v?Ae:gr;if(f=="(")return c(ge,K(")"),Re(Pt,")"),R,$("=>"),x,me);if(f=="variable")return C(ge,pt,$("=>"),x,me)}var oe=v?Xe:Te;return Ue.hasOwnProperty(f)?c(oe):f=="function"?c(Rt,oe):f=="class"||j&&p=="interface"?(g.marked="keyword",c(K("form"),ir,R)):f=="keyword c"||f=="async"?c(v?Ne:Z):f=="("?c(K(")"),Tt,$(")"),R,oe):f=="operator"||f=="spread"?c(v?Ne:Z):f=="["?c(K("]"),Jt,R,oe):f=="{"?mr(Nr,"}",null,oe):f=="quasi"?C(fe,oe):f=="new"?c(w(v)):c()}function Tt(f){return f.match(/[;\}\)\],]/)?C():C(Z)}function Te(f,p){return f==","?c(Tt):Xe(f,p,!1)}function Xe(f,p,v){var x=v==!1?Te:Xe,oe=v==!1?Z:Ne;if(f=="=>")return c(ge,v?Ae:gr,me);if(f=="operator")return/\+\+|--/.test(p)||j&&p=="!"?c(x):j&&p=="<"&&g.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?c(K(">"),Re(E,">"),R,x):p=="?"?c(Z,$(":"),oe):c(oe);if(f=="quasi")return C(fe,x);if(f!=";"){if(f=="(")return mr(Ne,")","call",x);if(f==".")return c(ut,x);if(f=="[")return c(K("]"),Tt,$("]"),R,x);if(j&&p=="as")return g.marked="keyword",c(E,x);if(f=="regexp")return g.state.lastType=g.marked="operator",g.stream.backUp(g.stream.pos-g.stream.start-1),c(oe)}}function fe(f,p){return f!="quasi"?C():p.slice(p.length-2)!="${"?c(fe):c(Tt,wt)}function wt(f){if(f=="}")return g.marked="string-2",g.state.tokenize=qe,c(fe)}function gr(f){return ke(g.stream,g.state),C(f=="{"?J:Z)}function Ae(f){return ke(g.stream,g.state),C(f=="{"?J:Ne)}function w(f){return function(p){return p=="."?c(f?S:D):p=="variable"&&j?c(at,f?Xe:Te):C(f?Ne:Z)}}function D(f,p){if(p=="target")return g.marked="keyword",c(Te)}function S(f,p){if(p=="target")return g.marked="keyword",c(Xe)}function ve(f){return f==":"?c(R,J):C(Te,$(";"),R)}function ut(f){if(f=="variable")return g.marked="property",c()}function Nr(f,p){if(f=="async")return g.marked="property",c(Nr);if(f=="variable"||g.style=="keyword"){if(g.marked="property",p=="get"||p=="set")return c(en);var v;return j&&g.state.fatArrowAt==g.stream.start&&(v=g.stream.match(/^\s*:\s*/,!1))&&(g.state.fatArrowAt=g.stream.pos+v[0].length),c(It)}else{if(f=="number"||f=="string")return g.marked=H?"property":g.style+" property",c(It);if(f=="jsonld-keyword")return c(It);if(j&&ee(p))return g.marked="keyword",c(Nr);if(f=="[")return c(Z,Ot,$("]"),It);if(f=="spread")return c(Ne,It);if(p=="*")return g.marked="keyword",c(Nr);if(f==":")return C(It)}}function en(f){return f!="variable"?C(It):(g.marked="property",c(Rt))}function It(f){if(f==":")return c(Ne);if(f=="(")return C(Rt)}function Re(f,p,v){function x(oe,ye){if(v?v.indexOf(oe)>-1:oe==","){var Se=g.state.lexical;return Se.info=="call"&&(Se.pos=(Se.pos||0)+1),c(function(Je,Lt){return Je==p||Lt==p?C():C(f)},x)}return oe==p||ye==p?c():v&&v.indexOf(";")>-1?C(f):c($(p))}return function(oe,ye){return oe==p||ye==p?c():C(f,x)}}function mr(f,p,v){for(var x=3;x"),E);if(f=="quasi")return C(_e,ct)}function tn(f){if(f=="=>")return c(E)}function ot(f){return f.match(/[\}\)\]]/)?c():f==","||f==";"?c(ot):C(Pe,ot)}function Pe(f,p){if(f=="variable"||g.style=="keyword")return g.marked="property",c(Pe);if(p=="?"||f=="number"||f=="string")return c(Pe);if(f==":")return c(E);if(f=="[")return c($("variable"),mi,$("]"),Pe);if(f=="(")return C(_t,Pe);if(!f.match(/[;\}\)\],]/))return c()}function _e(f,p){return f!="quasi"?C():p.slice(p.length-2)!="${"?c(_e):c(E,En)}function En(f){if(f=="}")return g.marked="string-2",g.state.tokenize=qe,c(_e)}function ft(f,p){return f=="variable"&&g.stream.match(/^\s*[?:]/,!1)||p=="?"?c(ft):f==":"?c(E):f=="spread"?c(ft):C(E)}function ct(f,p){if(p=="<")return c(K(">"),Re(E,">"),R,ct);if(p=="|"||f=="."||p=="&")return c(E);if(f=="[")return c(E,$("]"),ct);if(p=="extends"||p=="implements")return g.marked="keyword",c(E);if(p=="?")return c(E,$(":"),E)}function at(f,p){if(p=="<")return c(K(">"),Re(E,">"),R,ct)}function yr(){return C(E,rn)}function rn(f,p){if(p=="=")return c(E)}function Xt(f,p){return p=="enum"?(g.marked="keyword",c(Pr)):C(pt,Ot,Dt,bi)}function pt(f,p){if(j&&ee(p))return g.marked="keyword",c(pt);if(f=="variable")return L(p),c();if(f=="spread")return c(pt);if(f=="[")return mr(yi,"]");if(f=="{")return mr(nn,"}")}function nn(f,p){return f=="variable"&&!g.stream.match(/^\s*:/,!1)?(L(p),c(Dt)):(f=="variable"&&(g.marked="property"),f=="spread"?c(pt):f=="}"?C():f=="["?c(Z,$("]"),$(":"),nn):c($(":"),pt,Dt))}function yi(){return C(pt,Dt)}function Dt(f,p){if(p=="=")return c(Ne)}function bi(f){if(f==",")return c(Xt)}function Dr(f,p){if(f=="keyword b"&&p=="else")return c(K("form","else"),J,R)}function Fn(f,p){if(p=="await")return c(Fn);if(f=="(")return c(K(")"),on,R)}function on(f){return f=="var"?c(Xt,nr):f=="variable"?c(nr):C(nr)}function nr(f,p){return f==")"?c():f==";"?c(nr):p=="in"||p=="of"?(g.marked="keyword",c(Z,nr)):C(Z,nr)}function Rt(f,p){if(p=="*")return g.marked="keyword",c(Rt);if(f=="variable")return L(p),c(Rt);if(f=="(")return c(ge,K(")"),Re(Pt,")"),R,Nt,J,me);if(j&&p=="<")return c(K(">"),Re(yr,">"),R,Rt)}function _t(f,p){if(p=="*")return g.marked="keyword",c(_t);if(f=="variable")return L(p),c(_t);if(f=="(")return c(ge,K(")"),Re(Pt,")"),R,Nt,me);if(j&&p=="<")return c(K(">"),Re(yr,">"),R,_t)}function In(f,p){if(f=="keyword"||f=="variable")return g.marked="type",c(In);if(p=="<")return c(K(">"),Re(yr,">"),R)}function Pt(f,p){return p=="@"&&c(Z,Pt),f=="spread"?c(Pt):j&&ee(p)?(g.marked="keyword",c(Pt)):j&&f=="this"?c(Ot,Dt):C(pt,Ot,Dt)}function ir(f,p){return f=="variable"?Bn(f,p):Ar(f,p)}function Bn(f,p){if(f=="variable")return L(p),c(Ar)}function Ar(f,p){if(p=="<")return c(K(">"),Re(yr,">"),R,Ar);if(p=="extends"||p=="implements"||j&&f==",")return p=="implements"&&(g.marked="keyword"),c(j?E:Z,Ar);if(f=="{")return c(K("}"),xt,R)}function xt(f,p){if(f=="async"||f=="variable"&&(p=="static"||p=="get"||p=="set"||j&&ee(p))&&g.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return g.marked="keyword",c(xt);if(f=="variable"||g.style=="keyword")return g.marked="property",c(Yt,xt);if(f=="number"||f=="string")return c(Yt,xt);if(f=="[")return c(Z,Ot,$("]"),Yt,xt);if(p=="*")return g.marked="keyword",c(xt);if(j&&f=="(")return C(_t,xt);if(f==";"||f==",")return c(xt);if(f=="}")return c();if(p=="@")return c(Z,xt)}function Yt(f,p){if(p=="!"||p=="?")return c(Yt);if(f==":")return c(E,Dt);if(p=="=")return c(Ne);var v=g.state.lexical.prev,x=v&&v.info=="interface";return C(x?_t:Rt)}function or(f,p){return p=="*"?(g.marked="keyword",c(U,$(";"))):p=="default"?(g.marked="keyword",c(Z,$(";"))):f=="{"?c(Re(Rn,"}"),U,$(";")):C(J)}function Rn(f,p){if(p=="as")return g.marked="keyword",c($("variable"));if(f=="variable")return C(Ne,Rn)}function Zt(f){return f=="string"?c():f=="("?C(Z):f=="."?C(Te):C(ar,an,U)}function ar(f,p){return f=="{"?mr(ar,"}"):(f=="variable"&&L(p),p=="*"&&(g.marked="keyword"),c(Ke))}function an(f){if(f==",")return c(ar,an)}function Ke(f,p){if(p=="as")return g.marked="keyword",c(ar)}function U(f,p){if(p=="from")return g.marked="keyword",c(Z)}function Jt(f){return f=="]"?c():C(Re(Ne,"]"))}function Pr(){return C(K("form"),pt,$("{"),K("}"),Re(At,"}"),R,R)}function At(){return C(pt,Dt)}function Le(f,p){return f.lastType=="operator"||f.lastType==","||de.test(p.charAt(0))||/[,.]/.test(p.charAt(0))}function Kt(f,p,v){return p.tokenize==ie&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(p.lastType)||p.lastType=="quasi"&&/\{\s*$/.test(f.string.slice(0,f.pos-(v||0)))}return{startState:function(f){var p={tokenize:ie,lastType:"sof",cc:[],lexical:new ne((f||0)-se,0,"block",!1),localVars:G.localVars,context:G.localVars&&new _(null,null,!1),indented:f||0};return G.globalVars&&typeof G.globalVars=="object"&&(p.globalVars=G.globalVars),p},token:function(f,p){if(f.sol()&&(p.lexical.hasOwnProperty("align")||(p.lexical.align=!1),p.indented=f.indentation(),ke(f,p)),p.tokenize!=we&&f.eatSpace())return null;var v=p.tokenize(f,p);return Ee=="comment"?v:(p.lastType=Ee=="operator"&&(Be=="++"||Be=="--")?"incdec":Ee,M(p,v,Ee,Be,f))},indent:function(f,p){if(f.tokenize==we||f.tokenize==qe)return P.Pass;if(f.tokenize!=ie)return 0;var v=p&&p.charAt(0),x=f.lexical,oe;if(!/^\s*else\b/.test(p))for(var ye=f.cc.length-1;ye>=0;--ye){var Se=f.cc[ye];if(Se==R)x=x.prev;else if(Se!=Dr&&Se!=me)break}for(;(x.type=="stat"||x.type=="form")&&(v=="}"||(oe=f.cc[f.cc.length-1])&&(oe==Te||oe==Xe)&&!/^[,\.=+\-*:?[\(]/.test(p));)x=x.prev;We&&x.type==")"&&x.prev.type=="stat"&&(x=x.prev);var Je=x.type,Lt=v==Je;return Je=="vardef"?x.indented+(f.lastType=="operator"||f.lastType==","?x.info.length+1:0):Je=="form"&&v=="{"?x.indented:Je=="form"?x.indented+se:Je=="stat"?x.indented+(Le(f,p)?We||se:0):x.info=="switch"&&!Lt&&G.doubleIndentSwitch!=!1?x.indented+(/^(?:case|default)\b/.test(p)?se:2*se):x.align?x.column+(Lt?0:1):x.indented+(Lt?0:se)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:A?null:"/*",blockCommentEnd:A?null:"*/",blockCommentContinue:A?null:" * ",lineComment:A?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:A?"json":"javascript",jsonldMode:H,jsonMode:A,expressionAllowed:Kt,skipExpression:function(f){M(f,"atom","atom","true",new P.StringStream("",2,null))}}}),P.registerHelper("wordChars","javascript",/[\w$]/),P.defineMIME("text/javascript","javascript"),P.defineMIME("text/ecmascript","javascript"),P.defineMIME("application/javascript","javascript"),P.defineMIME("application/x-javascript","javascript"),P.defineMIME("application/ecmascript","javascript"),P.defineMIME("application/json",{name:"javascript",json:!0}),P.defineMIME("application/x-json",{name:"javascript",json:!0}),P.defineMIME("application/manifest+json",{name:"javascript",json:!0}),P.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),P.defineMIME("text/typescript",{name:"javascript",typescript:!0}),P.defineMIME("application/typescript",{name:"javascript",typescript:!0})})})();var _u={exports:{}};(function(be,ze){(function(P){P($r.exports)})(function(P){P.defineMode("css",function(ne,b){var M=b.inline;b.propertyKeywords||(b=P.resolveMode("text/css"));var g=ne.indentUnit,C=b.tokenHooks,c=b.documentTypes||{},N=b.mediaTypes||{},L=b.mediaFeatures||{},B=b.mediaValueKeywords||{},ee=b.propertyKeywords||{},_=b.nonStandardPropertyKeywords||{},te=b.fontProperties||{},pe=b.counterDescriptors||{},ge=b.colorKeywords||{},xe=b.valueKeywords||{},me=b.allowNested,K=b.lineComment,R=b.supportsAtComponent===!0,$=ne.highlightNonStandardPropertyKeywords!==!1,J,V;function Z(w,D){return J=D,w}function Ne(w,D){var S=w.next();if(C[S]){var ve=C[S](w,D);if(ve!==!1)return ve}if(S=="@")return w.eatWhile(/[\w\\\-]/),Z("def",w.current());if(S=="="||(S=="~"||S=="|")&&w.eat("="))return Z(null,"compare");if(S=='"'||S=="'")return D.tokenize=Ct(S),D.tokenize(w,D);if(S=="#")return w.eatWhile(/[\w\\\-]/),Z("atom","hash");if(S=="!")return w.match(/^\s*\w*/),Z("keyword","important");if(/\d/.test(S)||S=="."&&w.eat(/\d/))return w.eatWhile(/[\w.%]/),Z("number","unit");if(S==="-"){if(/[\d.]/.test(w.peek()))return w.eatWhile(/[\w.%]/),Z("number","unit");if(w.match(/^-[\w\\\-]*/))return w.eatWhile(/[\w\\\-]/),w.match(/^\s*:/,!1)?Z("variable-2","variable-definition"):Z("variable-2","variable");if(w.match(/^\w+-/))return Z("meta","meta")}else return/[,+>*\/]/.test(S)?Z(null,"select-op"):S=="."&&w.match(/^-?[_a-z][_a-z0-9-]*/i)?Z("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(S)?Z(null,S):w.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(w.current())&&(D.tokenize=Ft),Z("variable callee","variable")):/[\w\\\-]/.test(S)?(w.eatWhile(/[\w\\\-]/),Z("property","word")):Z(null,null)}function Ct(w){return function(D,S){for(var ve=!1,ut;(ut=D.next())!=null;){if(ut==w&&!ve){w==")"&&D.backUp(1);break}ve=!ve&&ut=="\\"}return(ut==w||!ve&&w!=")")&&(S.tokenize=null),Z("string","string")}}function Ft(w,D){return w.next(),w.match(/^\s*[\"\')]/,!1)?D.tokenize=null:D.tokenize=Ct(")"),Z(null,"(")}function Tt(w,D,S){this.type=w,this.indent=D,this.prev=S}function Te(w,D,S,ve){return w.context=new Tt(S,D.indentation()+(ve===!1?0:g),w.context),S}function Xe(w){return w.context.prev&&(w.context=w.context.prev),w.context.type}function fe(w,D,S){return Ae[S.context.type](w,D,S)}function wt(w,D,S,ve){for(var ut=ve||1;ut>0;ut--)S.context=S.context.prev;return fe(w,D,S)}function gr(w){var D=w.current().toLowerCase();xe.hasOwnProperty(D)?V="atom":ge.hasOwnProperty(D)?V="keyword":V="variable"}var Ae={};return Ae.top=function(w,D,S){if(w=="{")return Te(S,D,"block");if(w=="}"&&S.context.prev)return Xe(S);if(R&&/@component/i.test(w))return Te(S,D,"atComponentBlock");if(/^@(-moz-)?document$/i.test(w))return Te(S,D,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(w))return Te(S,D,"atBlock");if(/^@(font-face|counter-style)/i.test(w))return S.stateArg=w,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(w))return"keyframes";if(w&&w.charAt(0)=="@")return Te(S,D,"at");if(w=="hash")V="builtin";else if(w=="word")V="tag";else{if(w=="variable-definition")return"maybeprop";if(w=="interpolation")return Te(S,D,"interpolation");if(w==":")return"pseudo";if(me&&w=="(")return Te(S,D,"parens")}return S.context.type},Ae.block=function(w,D,S){if(w=="word"){var ve=D.current().toLowerCase();return ee.hasOwnProperty(ve)?(V="property","maybeprop"):_.hasOwnProperty(ve)?(V=$?"string-2":"property","maybeprop"):me?(V=D.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(V+=" error","maybeprop")}else return w=="meta"?"block":!me&&(w=="hash"||w=="qualifier")?(V="error","block"):Ae.top(w,D,S)},Ae.maybeprop=function(w,D,S){return w==":"?Te(S,D,"prop"):fe(w,D,S)},Ae.prop=function(w,D,S){if(w==";")return Xe(S);if(w=="{"&&me)return Te(S,D,"propBlock");if(w=="}"||w=="{")return wt(w,D,S);if(w=="(")return Te(S,D,"parens");if(w=="hash"&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(D.current()))V+=" error";else if(w=="word")gr(D);else if(w=="interpolation")return Te(S,D,"interpolation");return"prop"},Ae.propBlock=function(w,D,S){return w=="}"?Xe(S):w=="word"?(V="property","maybeprop"):S.context.type},Ae.parens=function(w,D,S){return w=="{"||w=="}"?wt(w,D,S):w==")"?Xe(S):w=="("?Te(S,D,"parens"):w=="interpolation"?Te(S,D,"interpolation"):(w=="word"&&gr(D),"parens")},Ae.pseudo=function(w,D,S){return w=="meta"?"pseudo":w=="word"?(V="variable-3",S.context.type):fe(w,D,S)},Ae.documentTypes=function(w,D,S){return w=="word"&&c.hasOwnProperty(D.current())?(V="tag",S.context.type):Ae.atBlock(w,D,S)},Ae.atBlock=function(w,D,S){if(w=="(")return Te(S,D,"atBlock_parens");if(w=="}"||w==";")return wt(w,D,S);if(w=="{")return Xe(S)&&Te(S,D,me?"block":"top");if(w=="interpolation")return Te(S,D,"interpolation");if(w=="word"){var ve=D.current().toLowerCase();ve=="only"||ve=="not"||ve=="and"||ve=="or"?V="keyword":N.hasOwnProperty(ve)?V="attribute":L.hasOwnProperty(ve)?V="property":B.hasOwnProperty(ve)?V="keyword":ee.hasOwnProperty(ve)?V="property":_.hasOwnProperty(ve)?V=$?"string-2":"property":xe.hasOwnProperty(ve)?V="atom":ge.hasOwnProperty(ve)?V="keyword":V="error"}return S.context.type},Ae.atComponentBlock=function(w,D,S){return w=="}"?wt(w,D,S):w=="{"?Xe(S)&&Te(S,D,me?"block":"top",!1):(w=="word"&&(V="error"),S.context.type)},Ae.atBlock_parens=function(w,D,S){return w==")"?Xe(S):w=="{"||w=="}"?wt(w,D,S,2):Ae.atBlock(w,D,S)},Ae.restricted_atBlock_before=function(w,D,S){return w=="{"?Te(S,D,"restricted_atBlock"):w=="word"&&S.stateArg=="@counter-style"?(V="variable","restricted_atBlock_before"):fe(w,D,S)},Ae.restricted_atBlock=function(w,D,S){return w=="}"?(S.stateArg=null,Xe(S)):w=="word"?(S.stateArg=="@font-face"&&!te.hasOwnProperty(D.current().toLowerCase())||S.stateArg=="@counter-style"&&!pe.hasOwnProperty(D.current().toLowerCase())?V="error":V="property","maybeprop"):"restricted_atBlock"},Ae.keyframes=function(w,D,S){return w=="word"?(V="variable","keyframes"):w=="{"?Te(S,D,"top"):fe(w,D,S)},Ae.at=function(w,D,S){return w==";"?Xe(S):w=="{"||w=="}"?wt(w,D,S):(w=="word"?V="tag":w=="hash"&&(V="builtin"),"at")},Ae.interpolation=function(w,D,S){return w=="}"?Xe(S):w=="{"||w==";"?wt(w,D,S):(w=="word"?V="variable":w!="variable"&&w!="("&&w!=")"&&(V="error"),"interpolation")},{startState:function(w){return{tokenize:null,state:M?"block":"top",stateArg:null,context:new Tt(M?"block":"top",w||0,null)}},token:function(w,D){if(!D.tokenize&&w.eatSpace())return null;var S=(D.tokenize||Ne)(w,D);return S&&typeof S=="object"&&(J=S[1],S=S[0]),V=S,J!="comment"&&(D.state=Ae[D.state](J,w,D)),V},indent:function(w,D){var S=w.context,ve=D&&D.charAt(0),ut=S.indent;return S.type=="prop"&&(ve=="}"||ve==")")&&(S=S.prev),S.prev&&(ve=="}"&&(S.type=="block"||S.type=="top"||S.type=="interpolation"||S.type=="restricted_atBlock")?(S=S.prev,ut=S.indent):(ve==")"&&(S.type=="parens"||S.type=="atBlock_parens")||ve=="{"&&(S.type=="at"||S.type=="atBlock"))&&(ut=Math.max(0,S.indent-g))),ut},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:K,fold:"brace"}});function Ce(ne){for(var b={},M=0;M")):null:c.match("--")?L(Ee("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),L(Be(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),N.tokenize=Ee("meta","?>"),"meta"):(le=c.eat("/")?"closeTag":"openTag",N.tokenize=he,"tag bracket");if(B=="&"){var ee;return c.eat("#")?c.eat("x")?ee=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):ee=c.eatWhile(/[\d]/)&&c.eat(";"):ee=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),ee?"atom":"error"}else return c.eatWhile(/[^&<]/),null}de.isInText=!0;function he(c,N){var L=c.next();if(L==">"||L=="/"&&c.eat(">"))return N.tokenize=de,le=L==">"?"endTag":"selfcloseTag","tag bracket";if(L=="=")return le="equals",null;if(L=="<"){N.tokenize=de,N.state=qe,N.tagName=N.tagStart=null;var B=N.tokenize(c,N);return B?B+" tag error":"tag error"}else return/[\'\"]/.test(L)?(N.tokenize=He(L),N.stringStartCol=c.column(),N.tokenize(c,N)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function He(c){var N=function(L,B){for(;!L.eol();)if(L.next()==c){B.tokenize=he;break}return"string"};return N.isInAttribute=!0,N}function Ee(c,N){return function(L,B){for(;!L.eol();){if(L.match(N)){B.tokenize=de;break}L.next()}return c}}function Be(c){return function(N,L){for(var B;(B=N.next())!=null;){if(B=="<")return L.tokenize=Be(c+1),L.tokenize(N,L);if(B==">")if(c==1){L.tokenize=de;break}else return L.tokenize=Be(c-1),L.tokenize(N,L)}return"meta"}}function re(c){return c&&c.toLowerCase()}function ie(c,N,L){this.prev=c.context,this.tagName=N||"",this.indent=c.indented,this.startOfLine=L,(A.doNotIndent.hasOwnProperty(N)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function ue(c){c.context&&(c.context=c.context.prev)}function we(c,N){for(var L;;){if(!c.context||(L=c.context.tagName,!A.contextGrabbers.hasOwnProperty(re(L))||!A.contextGrabbers[re(L)].hasOwnProperty(re(N))))return;ue(c)}}function qe(c,N,L){return c=="openTag"?(L.tagStart=N.column(),nt):c=="closeTag"?ke:qe}function nt(c,N,L){return c=="word"?(L.tagName=N.current(),q="tag",b):A.allowMissingTagName&&c=="endTag"?(q="tag bracket",b(c,N,L)):(q="error",nt)}function ke(c,N,L){if(c=="word"){var B=N.current();return L.context&&L.context.tagName!=B&&A.implicitlyClosed.hasOwnProperty(re(L.context.tagName))&&ue(L),L.context&&L.context.tagName==B||A.matchClosing===!1?(q="tag",Ue):(q="tag error",ne)}else return A.allowMissingTagName&&c=="endTag"?(q="tag bracket",Ue(c,N,L)):(q="error",ne)}function Ue(c,N,L){return c!="endTag"?(q="error",Ue):(ue(L),qe)}function ne(c,N,L){return q="error",Ue(c,N,L)}function b(c,N,L){if(c=="word")return q="attribute",M;if(c=="endTag"||c=="selfcloseTag"){var B=L.tagName,ee=L.tagStart;return L.tagName=L.tagStart=null,c=="selfcloseTag"||A.autoSelfClosers.hasOwnProperty(re(B))?we(L,B):(we(L,B),L.context=new ie(L,B,ee==L.indented)),qe}return q="error",b}function M(c,N,L){return c=="equals"?g:(A.allowMissing||(q="error"),b(c,N,L))}function g(c,N,L){return c=="string"?C:c=="word"&&A.allowUnquoted?(q="string",b):(q="error",b(c,N,L))}function C(c,N,L){return c=="string"?C:b(c,N,L)}return{startState:function(c){var N={tokenize:de,state:qe,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(N.baseIndent=c),N},token:function(c,N){if(!N.tagName&&c.sol()&&(N.indented=c.indentation()),c.eatSpace())return null;le=null;var L=N.tokenize(c,N);return(L||le)&&L!="comment"&&(q=null,N.state=N.state(le||L,c,N),q&&(L=q=="error"?L+" error":q)),L},indent:function(c,N,L){var B=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+H;if(B&&B.noIndent)return P.Pass;if(c.tokenize!=he&&c.tokenize!=de)return L?L.match(/^(\s*)/)[0].length:0;if(c.tagName)return A.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+H*(A.multilineTagIndentFactor||1);if(A.alignCDATA&&/$/,blockCommentStart:"",configuration:A.htmlMode?"html":"xml",helperType:A.htmlMode?"html":"xml",skipAttribute:function(c){c.state==g&&(c.state=b)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var N=[],L=c.context;L;L=L.prev)N.push(L.tagName);return N.reverse()}}}),P.defineMIME("text/xml","xml"),P.defineMIME("application/xml","xml"),P.mimeModes.hasOwnProperty("text/html")||P.defineMIME("text/html",{name:"xml",htmlMode:!0})})})();(function(be,ze){(function(P){P($r.exports,Ku.exports,Ru.exports,_u.exports)})(function(P){var Ce={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function G(le,q,de){var he=le.current(),He=he.search(q);return He>-1?le.backUp(he.length-He):he.match(/<\/?$/)&&(le.backUp(he.length),le.match(q,!1)||le.match(he)),de}var se={};function We(le){var q=se[le];return q||(se[le]=new RegExp("\\s+"+le+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function H(le,q){var de=le.match(We(q));return de?/^\s*(.*?)\s*$/.exec(de[2])[1]:""}function A(le,q){return new RegExp((q?"^":"")+"","i")}function Y(le,q){for(var de in le)for(var he=q[de]||(q[de]=[]),He=le[de],Ee=He.length-1;Ee>=0;Ee--)he.unshift(He[Ee])}function j(le,q){for(var de=0;de=0;Be--)he.script.unshift(["type",Ee[Be].matches,Ee[Be].mode]);function re(ie,ue){var we=de.token(ie,ue.htmlState),qe=/\btag\b/.test(we),nt;if(qe&&!/[<>\s\/]/.test(ie.current())&&(nt=ue.htmlState.tagName&&ue.htmlState.tagName.toLowerCase())&&he.hasOwnProperty(nt))ue.inTag=nt+" ";else if(ue.inTag&&qe&&/>$/.test(ie.current())){var ke=/^([\S]+) (.*)/.exec(ue.inTag);ue.inTag=null;var Ue=ie.current()==">"&&j(he[ke[1]],ke[2]),ne=P.getMode(le,Ue),b=A(ke[1],!0),M=A(ke[1],!1);ue.token=function(g,C){return g.match(b,!1)?(C.token=re,C.localState=C.localMode=null,null):G(g,M,C.localMode.token(g,C.localState))},ue.localMode=ne,ue.localState=P.startState(ne,de.indent(ue.htmlState,"",""))}else ue.inTag&&(ue.inTag+=ie.current(),ie.eol()&&(ue.inTag+=" "));return we}return{startState:function(){var ie=P.startState(de);return{token:re,inTag:null,localMode:null,localState:null,htmlState:ie}},copyState:function(ie){var ue;return ie.localState&&(ue=P.copyState(ie.localMode,ie.localState)),{token:ie.token,inTag:ie.inTag,localMode:ie.localMode,localState:ue,htmlState:P.copyState(de,ie.htmlState)}},token:function(ie,ue){return ue.token(ie,ue)},indent:function(ie,ue,we){return!ie.localMode||/^\s*<\//.test(ue)?de.indent(ie.htmlState,ue,we):ie.localMode.indent?ie.localMode.indent(ie.localState,ue,we):P.Pass},innerMode:function(ie){return{state:ie.localState||ie.htmlState,mode:ie.localMode||de}}}},"xml","javascript","css"),P.defineMIME("text/html","htmlmixed")})})();const ju=ho({__name:"CodeMirror",props:{mode:{type:String,default:Vr.JSON,validator(be){return Object.values(Vr).includes(be)}},value:{type:String,default:""},readonly:{type:Boolean,default:!1}},emits:["change"],setup(be,{emit:ze}){const P=be,Ce=Lu();let G;const se=Au(A,100),We=Mu();yl(()=>P.value,j=>zn(this,null,function*(){yield bl();const le=G==null?void 0:G.getValue();j!==le&&(G==null||G.setValue(j||""))}),{flush:"post"}),Ou(()=>{G==null||G.setOption("mode",P.mode)}),yl(()=>We.getDarkMode,()=>zn(this,null,function*(){H()}),{immediate:!0});function H(){var j;(j=po(G))==null||j.setOption("theme",We.getDarkMode==="light"?"idea":"material-palenight")}function A(){G==null||G.refresh()}function Y(){return zn(this,null,function*(){const j={autoCloseBrackets:!0,autoCloseTags:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers"]};G=Bu(Ce.value,ml({value:"",mode:P.mode,readOnly:P.readonly,tabSize:2,theme:"material-palenight",lineWrapping:!0,lineNumbers:!0},j)),G==null||G.setValue(P.value),H(),G==null||G.on("change",()=>{ze("change",G==null?void 0:G.getValue())})})}return Nu(()=>zn(this,null,function*(){yield bl(),Y(),Iu(se)})),Du(()=>{G=null}),(j,le)=>(vo(),xl("div",{class:"relative !h-full w-full overflow-hidden",ref_key:"el",ref:Ce},null,512))}}),Uu={class:"h-full"},Gu=ho({__name:"CodeEditor",props:{value:{type:[Object,String]},mode:{type:String,default:Vr.JSON,validator(be){return Object.values(Vr).includes(be)}},readonly:{type:Boolean},autoFormat:{type:Boolean,default:!0}},emits:["change","update:value","format-error"],setup(be,{emit:ze}){const P=be,Ce=Pu(()=>{const{value:se,mode:We,autoFormat:H}=P;if(!H||We!==Vr.JSON)return se;let A=se;if(Wu(se))try{A=JSON.parse(se)}catch(Y){return ze("format-error",se),se}return JSON.stringify(A,null,2)});function G(se){ze("update:value",se),ze("change",se)}return(se,We)=>(vo(),xl("div",Uu,[zu(ju,{value:po(Ce),onChange:G,mode:be.mode,readonly:be.readonly},null,8,["value","mode","readonly"])]))}});var Sl={exports:{}};(function(be,ze){(function(P,Ce){be.exports=Ce(Hu)})(wl,function(P){return function(){var Ce={452:function(H){H.exports=P}},G={};function se(H){var A=G[H];if(A!==void 0)return A.exports;var Y=G[H]={exports:{}};return Ce[H](Y,Y.exports,se),Y.exports}se.d=function(H,A){for(var Y in A)se.o(A,Y)&&!se.o(H,Y)&&Object.defineProperty(H,Y,{enumerable:!0,get:A[Y]})},se.o=function(H,A){return Object.prototype.hasOwnProperty.call(H,A)},se.r=function(H){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(H,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(H,"__esModule",{value:!0})};var We={};return function(){se.r(We),se.d(We,{default:function(){return ne}});var H=se(452);function A(b,M){(M==null||M>b.length)&&(M=b.length);for(var g=0,C=new Array(M);g1&&arguments[1]!==void 0?arguments[1]:"root",g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,C=arguments.length>3?arguments[3]:void 0,c=C||{},N=c.key,L=c.index,B=c.type,ee=B===void 0?"content":B,_=c.showComma,te=_!==void 0&&_,pe=c.length,ge=pe===void 0?1:pe,xe=Be(b);if(xe==="array"){var me=b.map(function(J,V,Z){return re(J,"".concat(M,"[").concat(V,"]"),g+1,{index:V,showComma:V!==Z.length-1,length:ge,type:ee})}).reduce(function(J,V){return J.concat(V)},[]);return[re("[",M,g,{showComma:!1,key:N,length:b.length,type:"arrayStart"})[0]].concat(me,re("]",M,g,{showComma:te,length:b.length,type:"arrayEnd"})[0])}if(xe==="object"){var K=Object.keys(b),R=K.map(function(J,V,Z){return re(b[J],J.includes(".")?"".concat(M,'["').concat(J,'"]'):"".concat(M,".").concat(J),g+1,{key:J,showComma:V!==Z.length-1,length:ge,type:ee})}).reduce(function(J,V){return J.concat(V)},[]);return[re("{",M,g,{showComma:!1,key:N,index:L,length:K.length,type:"objectStart"})[0]].concat(R,re("}",M,g,{showComma:te,length:K.length,type:"objectEnd"})[0])}var $=Object.entries({content:b,level:g,key:N,index:L,path:M,showComma:te,length:ge,type:ee}).reduce(function(J,V){var Z=j(V,2),Ne=Z[0],Ct=Z[1];return Ct!==void 0?Ee(Ee({},J),{},q({},Ne,Ct)):J},{});return[$]}function ie(b,M){var g=Object.keys(b);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(b);M&&(C=C.filter(function(c){return Object.getOwnPropertyDescriptor(b,c).enumerable})),g.push.apply(g,C)}return g}function ue(b){for(var M=1;M=b.deep:te.level===b.deep;return te.type!=="objectStart"&&te.type!=="arrayStart"||!pe?_:ke(ke({},_),{},q({},te.path,1))},{})}),N=(0,H.computed)(function(){var _=null;return re(b.data,b.path).reduce(function(te,pe,ge){var xe=ke(ke({},pe),{},{id:ge}),me=c.hiddenPaths[xe.path];if(_&&_.path===xe.path){var K=_.type==="objectStart",R=ke(ke(ke({},_),xe),{},{content:K?"{...}":"[...]",type:K?"objectCollapsed":"arrayCollapsed"});return _=null,te.concat(R)}return me&&!_?(_=xe,te):_?te:te.concat(xe)},[])}),L=(0,H.computed)(function(){var _=b.modelValue;return _&&b.selectableType==="multiple"&&Array.isArray(_)?_:[_]}),B=(0,H.computed)(function(){return!b.selectableType||b.selectOnClickNode||b.showSelectController?"":"When selectableType is not null, selectOnClickNode and showSelectController cannot be false at the same time, because this will cause the selection to fail."}),ee=function(_){if(b.virtual){var te=C.value,pe=b.virtualLines,ge=te&&te.scrollTop||0,xe=Math.floor(ge/b.itemHeight),me=xe<0?0:xe+pe>_.length?_.length-pe:xe;me<0&&(me=0);var K=me+pe;c.translateY=me*b.itemHeight,c.visibleData=_.filter(function(R,$){return $>=me&&$(vo(),Fu(po(qu),{path:"res",deep:3,showLength:!0,data:be.data},null,8,["data"]))}}),Qu=kl(Gu),Vu=kl(Xu);export{Qu as C,Vu as J,Vr as M};