var Kc=Object.defineProperty;var Ll=Object.getOwnPropertySymbols;var Uc=Object.prototype.hasOwnProperty,Gc=Object.prototype.propertyIsEnumerable;var Ml=(Tt,yt,_e)=>yt in Tt?Kc(Tt,yt,{enumerable:!0,configurable:!0,writable:!0,value:_e}):Tt[yt]=_e,Nl=(Tt,yt)=>{for(var _e in yt||(yt={}))Uc.call(yt,_e)&&Ml(Tt,_e,yt[_e]);if(Ll)for(var _e of Ll(yt))Gc.call(yt,_e)&&Ml(Tt,_e,yt[_e]);return Tt};var nn=(Tt,yt,_e)=>new Promise((Ci,Bn)=>{var Si=Zt=>{try{on(_e.next(Zt))}catch(an){Bn(an)}},Ti=Zt=>{try{on(_e.throw(Zt))}catch(an){Bn(an)}},on=Zt=>Zt.done?Ci(Zt.value):Promise.resolve(Zt.value).then(Si,Ti);on((_e=_e.apply(Tt,yt)).next())});import{e as qc,ac as $c,p as _c,aE as Yc,w as Ol,__tla as Jc}from"./index-f0df2f76.js";import{C as Al,E as Dl}from"./antd-057b41b1.js";import{d as Co,k as Zc,w as Pl,q as Wl,s as Xc,u as zl,o as Qc,b as eu,_ as So,$ as Hl,e as tu,f as ru,a8 as nu}from"./vue-1631514e.js";import{u as iu,__tla as ou}from"./useWindowSizeFn-53b82e7c.js";let Fl,jl,kr,au=Promise.all([(()=>{try{return Jc}catch(Tt){}})(),(()=>{try{return ou}catch(Tt){}})()]).then(()=>nn(void 0,null,function*(){var Tt={exports:{}},yt;function _e(){return yt||(yt=1,function(je,Dt){(function(I,Te){je.exports=Te()})(Al,function(){var I=navigator.userAgent,Te=navigator.platform,q=/gecko\/\d/i.test(I),he=/MSIE \d/.test(I),Ee=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(I),le=/Edge\/(\d+)/.exec(I),F=he||Ee||le,Z=F&&(he?document.documentMode||6:+(le||Ee)[1]),V=!le&&/WebKit\//.test(I),D=V&&/Qt\/\d+\.\d+/.test(I),X=!le&&/Chrome\/(\d+)/.exec(I),pe=X&&+X[1],de=/Opera\//.test(I),We=/Apple Computer/.test(navigator.vendor),He=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(I),Oe=/PhantomJS/.test(I),oe=We&&(/Mobile\/\w+/.test(I)||navigator.maxTouchPoints>2),ee=/Android/.test(I),ce=oe||ee||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(I),ve=oe||/Mac/.test(Te),qe=/\bCrOS\b/.test(I),ct=/win/i.test(Te),Re=de&&I.match(/Version\/(\d*\.\d*)/);Re&&(Re=Number(Re[1])),Re&&Re>=15&&(de=!1,V=!0);var ye=ve&&(D||de&&(Re==null||Re<12.11)),te=q||F&&Z>=9;function m(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var N=function(e,t){var n=e.className,r=m(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 y(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function T(e,t){return y(e).appendChild(t)}function d(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 J=function(){this.id=null,this.f=null,this.time=0,this.handler=Ae(this.onTimeout,this)};J.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},J.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 ue=[""];function ze(e){for(;ue.length<=e;)ue.push(ie(ue)+" ");return ue[e]}function ie(e){return e[e.length-1]}function Ie(e,t){for(var n=[],r=0;r"\x80"&&(e.toUpperCase()!=e.toLowerCase()||O.test(e))}function se(e,t){return t?t.source.indexOf("\\w")>-1&&C(e)?!0:t.test(e):C(e)}function rt(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var lr=/[\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 ln(e){return e.charCodeAt(0)>=768&&lr.test(e)}function Vt(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 Cr(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 Kt=null;function Pt(e,t,n){var r;Kt=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:Kt=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:Kt=i)}return r!=null?r:Kt}var Li=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(c){return c<=247?e.charAt(c):1424<=c&&c<=1524?"R":1536<=c&&c<=1785?t.charAt(c-1536):1774<=c&&c<=2220?"r":8192<=c&&c<=8203?"w":c==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,l=/[1n]/;function s(c,f,h){this.level=c,this.from=f,this.to=h}return function(c,f){var h=f=="ltr"?"L":"R";if(c.length==0||f=="ltr"&&!r.test(c))return!1;for(var b=c.length,v=[],k=0;k-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Pe(e,t){var n=sn(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function mt(e){e.prototype.on=function(t,n){j(this,t,n)},e.prototype.off=function(t,n){ut(this,t,n)}}function dt(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Sr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function cn(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Xt(e){dt(e),Sr(e)}function bt(e){return e.target||e.srcElement}function un(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),ve&&e.ctrlKey&&t==1&&(t=3),t}var Mi=function(){if(F&&Z<9)return!1;var e=d("div");return"draggable"in e||"dragDrop"in e}(),zt;function Ni(e){if(zt==null){var t=d("span","\u200B");T(e,d("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(zt=t.offsetWidth<=1&&t.offsetHeight>2&&!(F&&Z<8))}var n=zt?d("span","\u200B"):d("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var Hr;function Kn(e){if(Hr!=null)return Hr;var t=T(e,document.createTextNode("A\u062EA")),n=M(t,0,1).getBoundingClientRect(),r=M(t,1,2).getBoundingClientRect();return y(e),!n||n.left==n.right?!1:Hr=r.right-n.right<3}var dn=` b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(` `,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),a=o.indexOf("\r");a!=-1?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},sr=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(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},Ut=function(){var e=d("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Gt=null;function Un(e){if(Gt!=null)return Gt;var t=T(e,d("span","x")),n=t.getBoundingClientRect(),r=M(t,0,1).getBoundingClientRect();return Gt=Math.abs(n.left-r.left)>1}var Ft={},cr={};function Gn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ft[e]=t}function Fr(e,t){cr[e]=t}function Lt(e){if(typeof e=="string"&&cr.hasOwnProperty(e))e=cr[e];else if(e&&typeof e.name=="string"&&cr.hasOwnProperty(e.name)){var t=cr[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 Lt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Lt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function ur(e,t){t=Lt(t);var n=Ft[t.name];if(!n)return ur(e,"text/plain");var r=n(e,t);if(dr.hasOwnProperty(t.name)){var i=dr[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 dr={};function qn(e,t){var n=dr.hasOwnProperty(e)?dr[e]:dr[e]={};$(t,n)}function Qt(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 fr(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 fn(e,t,n){return e.startState?e.startState(t,n):!0}var Ue=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};Ue.prototype.eol=function(){return this.pos>=this.string.length},Ue.prototype.sol=function(){return this.pos==this.lineStart},Ue.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ue.prototype.next=function(){if(this.post},Ue.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ue.prototype.skipToEnd=function(){this.pos=this.string.length},Ue.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ue.prototype.backUp=function(e){this.pos-=e},Ue.prototype.column=function(){return this.lastColumnPos0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},Ue.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ue.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ue.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ue.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function G(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?g(n,G(e,n).text.length):Ul(t,G(e,t.line).text.length)}function Ul(e,t){var n=e.ch;return n==null||n>t?g(e.line,t):n<0?g(e.line,0):e}function No(e,t){for(var n=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},$t.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}},$t.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},$t.fromSaved=function(e,t,n){return t instanceof $n?new $t(e,Qt(e.mode,t.state),n,t.lookAhead):new $t(e,Qt(e.mode,t),n)},$t.prototype.save=function(e){var t=e!==!1?Qt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new $n(t,this.maxLookAhead):t};function Oo(e,t,n,r){var i=[e.state.modeGen],o={};Ho(e,t.text,e.doc.mode,n,function(c,f){return i.push(c,f)},o,r);for(var a=n.state,l=function(c){n.baseTokens=i;var f=e.state.overlays[c],h=1,b=0;n.state=!0,Ho(e,t.text,f.mode,n,function(v,k){for(var S=h;bv&&i.splice(h,1,v,i[h+1],A),h+=2,b=Math.min(v,A)}if(k)if(f.opaque)i.splice(S,h-S,v,"overlay "+k),h=S+2;else for(;Se.options.maxHighlightLength&&Qt(e.doc.mode,r.state),o=Oo(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 hn(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new $t(r,!0,t);var o=Gl(e,t,n),a=o>r.first&&G(r,o-1).stateAfter,l=a?$t.fromSaved(r,a,o):new $t(r,fn(r.mode),o);return r.iter(o,t,function(s){Oi(e,s.text,l);var c=l.line;s.stateAfter=c==t-1||c%5==0||c>=i.viewFrom&&ct.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var Po=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Wo(e,t,n,r){var i=e.doc,o=i.mode,a;t=ne(i,t);var l=G(i,t.line),s=hn(e,t.line,n),c=new Ue(l.text,e.options.tabSize,s),f;for(r&&(f=[]);(r||c.pose.options.maxHighlightLength?(l=!1,a&&Oi(e,t,r,f.pos),f.pos=t.length,h=null):h=zo(Ai(n,f,r.state,b),o),b){var v=b[0].name;v&&(h="m-"+(h?v+" "+h:v))}if(!l||c!=h){for(;sa;--l){if(l<=o.first)return o.first;var s=G(o,l-1),c=s.stateAfter;if(c&&(!n||l+(c instanceof $n?c.lookAhead:0)<=o.modeFrontier))return l;var f=K(s.text,null,e.options.tabSize);(i==null||r>f)&&(i=l-1,r=f)}return i}function ql(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=G(e,r).stateAfter;if(i&&(!(i instanceof $n)||r+i.lookAhead=t:o.to>t);(r||(r=[])).push(new _n(a,o.from,s?null:o.to))}}return r}function Xl(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 R=0;R0)){var f=[s,1],h=x(c.from,l.from),b=x(c.to,l.to);(h<0||!a.inclusiveLeft&&!h)&&f.push({from:c.from,to:l.from}),(b>0||!a.inclusiveRight&&!b)&&f.push({from:l.to,to:c.to}),i.splice.apply(i,f),s+=f.length-3}}return i}function Eo(e){var t=e.markedSpans;if(t){for(var n=0;nt)&&(!r||Pi(r,o.marker)<0)&&(r=o.marker)}return r}function Vo(e,t,n,r,i){var o=G(e,t),a=tr&&o.markedSpans;if(a)for(var l=0;l=0&&h<=0||f<=0&&h>=0)&&(f<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?x(c.to,n)>=0:x(c.to,n)>0)||f>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?x(c.from,r)<=0:x(c.from,r)<0)))return!0}}}function jt(e){for(var t;t=Ro(e);)e=t.find(-1,!0).line;return e}function ts(e){for(var t;t=Zn(e);)e=t.find(1,!0).line;return e}function rs(e){for(var t,n;t=Zn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Wi(e,t){var n=G(e,t),r=jt(n);return n==r?t:ke(r)}function Ko(e,t){if(t>e.lastLine())return t;var n=G(e,t),r;if(!hr(e,n))return t;for(;r=Zn(n);)n=r.find(1,!0).line;return ke(n)+1}function hr(e,t){var n=tr&&t.markedSpans;if(n){for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Er=function(e,t,n){this.text=e,Io(this,t),this.height=n?n(this):1};Er.prototype.lineNo=function(){return ke(this)},mt(Er);function ns(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Eo(e),Io(e,n);var i=r?r(e):1;i!=e.height&&Ht(e,i)}function is(e){e.parent=null,Eo(e)}var os={},as={};function Uo(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?as:os;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Go(e,t){var n=W("span",null,null,V?"padding-right: .1px":null),r={pre:W("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=ss,Kn(e.display.measure)&&(a=Wt(o,e.doc.direction))&&(r.addToken=us(r.addToken,a)),r.map=[];var l=t!=e.display.externalMeasured&&ke(o);ds(o,r,Ao(e,o,l)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=Ze(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=Ze(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Ni(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(V){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=Ze(r.pre.className,r.textClass||"")),r}function ls(e){var t=d("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ss(e,t,n,r,i,o,a){if(t){var l=e.splitSpaces?cs(t,e.trailingSpace):t,s=e.cm.state.specialChars,c=!1,f;if(!s.test(t))e.col+=t.length,f=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,f),F&&Z<9&&(c=!0),e.pos+=t.length;else{f=document.createDocumentFragment();for(var h=0;;){s.lastIndex=h;var b=s.exec(t),v=b?b.index-h:t.length-h;if(v){var k=document.createTextNode(l.slice(h,h+v));F&&Z<9?f.appendChild(d("span",[k])):f.appendChild(k),e.map.push(e.pos,e.pos+v,k),e.col+=v,e.pos+=v}if(!b)break;h+=v+1;var S=void 0;if(b[0]==" "){var A=e.cm.options.tabSize,z=A-e.col%A;S=f.appendChild(d("span",ze(z),"cm-tab")),S.setAttribute("role","presentation"),S.setAttribute("cm-text"," "),e.col+=z}else b[0]=="\r"||b[0]==` `?(S=f.appendChild(d("span",b[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),S.setAttribute("cm-text",b[0]),e.col+=1):(S=e.cm.options.specialCharPlaceholder(b[0]),S.setAttribute("cm-text",b[0]),F&&Z<9?f.appendChild(d("span",[S])):f.appendChild(S),e.col+=1);e.map.push(e.pos,e.pos+1,S),e.pos++}}if(e.trailingSpace=l.charCodeAt(t.length-1)==32,n||r||i||c||o||a){var E=n||"";r&&(E+=r),i&&(E+=i);var H=d("span",[f],E,o);if(a)for(var R in a)a.hasOwnProperty(R)&&R!="style"&&R!="class"&&H.setAttribute(R,a[R]);return e.content.appendChild(H)}e.content.appendChild(f)}}function cs(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;ic&&h.from<=c));b++);if(h.to>=f)return e(n,r,i,o,a,l,s);e(n,r.slice(0,h.to-c),i,o,null,l,s),o=null,r=r.slice(h.to-c),c=h.to}}}function qo(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 ds(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var a=1;as||fe.collapsed&&Y.to==s&&Y.from==s)){if(Y.to!=null&&Y.to!=s&&v>Y.to&&(v=Y.to,S=""),fe.className&&(k+=" "+fe.className),fe.css&&(b=(b?b+";":"")+fe.css),fe.startStyle&&Y.from==s&&(A+=" "+fe.startStyle),fe.endStyle&&Y.to==v&&(R||(R=[])).push(fe.endStyle,Y.to),fe.title&&((E||(E={})).title=fe.title),fe.attributes)for(var De in fe.attributes)(E||(E={}))[De]=fe.attributes[De];fe.collapsed&&(!z||Pi(z.marker,fe)<0)&&(z=Y)}else Y.from>s&&v>Y.from&&(v=Y.from)}if(R)for(var at=0;at=l)break;for(var Nt=Math.min(l,v);;){if(f){var kt=s+f.length;if(!z){var Ye=kt>Nt?f.slice(0,Nt-s):f;t.addToken(t,Ye,h?h+k:k,A,s+Ye.length==v?S:"",b,E)}if(kt>=Nt){f=f.slice(Nt-s),s=Nt;break}s=kt,A=""}f=i.slice(o,o=n[c++]),h=Uo(n[c++],t.cm.options)}}}function $o(e,t,n){this.line=t,this.rest=rs(t),this.size=this.rest?ke(ie(this.rest))-n+1:1,this.node=this.text=null,this.hidden=hr(e,t)}function Qn(e,t,n){for(var r=[],i,o=t;o2&&o.push((s.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function ea(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 ks(e,t){t=jt(t);var n=ke(t),r=e.display.externalMeasured=new $o(e.doc,t,n);r.lineN=n;var i=r.built=Go(e,r);return r.text=i.pre,T(e.display.lineMeasure,i.pre),r}function ta(e,t,n,r){return Yt(e,Br(e,t),n,r)}function Ii(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[c+2],l==s&&n==(r.insertLeft?"left":"right")&&(a=n),n=="left"&&i==0)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[(c-=3)+2],a="left";if(n=="right"&&i==s-l)for(;c=0&&(n=e[i]).left==n.right;i--);return n}function Ss(e,t,n,r){var i=na(t.map,n,r),o=i.node,a=i.start,l=i.end,s=i.collapse,c;if(o.nodeType==3){for(var f=0;f<4;f++){for(;a&&ln(t.line.text.charAt(i.coverStart+a));)--a;for(;i.coverStart+l0&&(s=r="right");var h;e.options.lineWrapping&&(h=o.getClientRects()).length>1?c=h[r=="right"?h.length-1:0]:c=o.getBoundingClientRect()}if(F&&Z<9&&!a&&(!c||!c.left&&!c.right)){var b=o.parentNode.getClientRects()[0];b?c={left:b.left,right:b.left+Vr(e.display),top:b.top,bottom:b.bottom}:c=ra}for(var v=c.top-t.rect.top,k=c.bottom-t.rect.top,S=(v+k)/2,A=t.view.measure.heights,z=0;z=r.text.length?(s=r.text.length,c="before"):s<=0&&(s=0,c="after"),!l)return a(c=="before"?s-1:s,c=="before");function f(k,S,A){var z=l[S],E=z.level==1;return a(A?k-1:k,E!=A)}var h=Pt(l,s,c),b=Kt,v=f(s,h,c=="before");return b!=null&&(v.other=f(s,b,c!="before")),v}function ca(e,t){var n=0;t=ne(e.doc,t),e.options.lineWrapping||(n=Vr(e.display)*t.ch);var r=G(e.doc,t.line),i=rr(r)+ei(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Ri(e,t,n,r,i){var o=g(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Vi(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Ri(r.first,0,null,-1,-1);var i=qt(r,n),o=r.first+r.size-1;if(i>o)return Ri(r.first+r.size-1,G(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=G(r,i);;){var l=Ls(e,a,i,t,n),s=es(a,l.ch+(l.xRel>0||l.outside>0?1:0));if(!s)return l;var c=s.find(1);if(c.line==i)return c;a=G(r,i=c.line)}}function ua(e,t,n,r){r-=Bi(t);var i=t.text.length,o=Ve(function(a){return Yt(e,n,a-1).bottom<=r},i,0);return i=Ve(function(a){return Yt(e,n,a).top>r},o,i),{begin:o,end:i}}function da(e,t,n,r){n||(n=Br(e,t));var i=ti(e,t,Yt(e,n,r),"line").top;return ua(e,t,n,i)}function Ki(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function Ls(e,t,n,r,i){i-=rr(t);var o=Br(e,t),a=Bi(t),l=0,s=t.text.length,c=!0,f=Wt(t,e.doc.direction);if(f){var h=(e.options.lineWrapping?Ns:Ms)(e,t,n,o,f,r,i);c=h.level!=1,l=c?h.from:h.to-1,s=c?h.to:h.from-1}var b=null,v=null,k=Ve(function(_){var Y=Yt(e,o,_);return Y.top+=a,Y.bottom+=a,Ki(Y,r,i,!1)?(Y.top<=i&&Y.left<=r&&(b=_,v=Y),!0):!1},l,s),S,A,z=!1;if(v){var E=r-v.left=R.bottom?1:0}return k=Vt(t.text,k,1),Ri(n,k,A,z,r-S)}function Ms(e,t,n,r,i,o,a){var l=Ve(function(h){var b=i[h],v=b.level!=1;return Ki(Et(e,g(n,v?b.to:b.from,v?"before":"after"),"line",t,r),o,a,!0)},0,i.length-1),s=i[l];if(l>0){var c=s.level!=1,f=Et(e,g(n,c?s.from:s.to,c?"after":"before"),"line",t,r);Ki(f,o,a,!0)&&f.top>a&&(s=i[l-1])}return s}function Ns(e,t,n,r,i,o,a){var l=ua(e,t,r,a),s=l.begin,c=l.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var f=null,h=null,b=0;b=c||v.to<=s)){var k=v.level!=1,S=Yt(e,r,k?Math.min(c,v.to)-1:Math.max(s,v.from)).right,A=SA)&&(f=v,h=A)}}return f||(f=i[i.length-1]),f.fromc&&(f={from:f.from,to:c,level:f.level}),f}var Lr;function Rr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Lr==null){Lr=d("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Lr.appendChild(document.createTextNode("x")),Lr.appendChild(d("br"));Lr.appendChild(document.createTextNode("x"))}T(e.measure,Lr);var n=Lr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),y(e.measure),n||1}function Vr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=d("span","xxxxxxxxxx"),n=d("pre",[t],"CodeMirror-line-like");T(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Ui(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:Gi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Gi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function fa(e){var t=Rr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Vr(e.display)-3);return function(i){if(hr(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(c=G(e.doc,s.line).text).length==s.ch){var f=K(c,c.length,e.options.tabSize)-c.length;s=g(s.line,Math.max(0,Math.round((o-Qo(e.display).left)/Vr(e.display))-f))}return s}function Nr(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)tr&&Wi(e.doc,t)i.viewFrom?mr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)mr(e);else if(t<=i.viewFrom){var o=ni(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):mr(e)}else if(n>=i.viewTo){var a=ni(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):mr(e)}else{var l=ni(e,t,t,-1),s=ni(e,n,n+r,1);l&&s?(i.view=i.view.slice(0,l.index).concat(Qn(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):mr(e)}var c=i.externalMeasured;c&&(n=i.lineN&&t=r.viewTo)){var o=r.view[Nr(e,t)];if(o.node!=null){var a=o.changes||(o.changes=[]);U(a,n)==-1&&a.push(n)}}}function mr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ni(e,t,n,r){var i=Nr(e,t),o,a=e.display.view;if(!tr||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(;Wi(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 Os(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Qn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Qn(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Nr(e,n)))),r.viewTo=n}function ha(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(d("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 ii(e,t){return e.top-t.top||e.left-t.left}function As(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=Qo(e.display),l=a.left,s=Math.max(r.sizerWidth,Tr(e)-r.sizer.offsetLeft)-a.right,c=i.direction=="ltr";function f(H,R,_,Y){R<0&&(R=0),R=Math.round(R),Y=Math.round(Y),o.appendChild(d("div",null,"CodeMirror-selected","position: absolute; left: "+H+`px; top: `+R+"px; width: "+(_!=null?_:s-H)+`px; height: `+(Y-R)+"px"))}function h(H,R,_){var Y=G(i,H),fe=Y.text.length,De,at;function Be(Ye,Ct){return ri(e,g(H,Ye),"div",Y,Ct)}function Nt(Ye,Ct,st){var Qe=da(e,Y,null,Ye),Je=Ct=="ltr"==(st=="after")?"left":"right",Ge=st=="after"?Qe.begin:Qe.end-(/\s/.test(Y.text.charAt(Qe.end-1))?2:1);return Be(Ge,Je)[Je]}var kt=Wt(Y,i.direction);return Cr(kt,R||0,_!=null?_:fe,function(Ye,Ct,st,Qe){var Je=st=="ltr",Ge=Be(Ye,Je?"left":"right"),St=Be(Ct-1,Je?"right":"left"),tn=R==null&&Ye==0,xr=_==null&&Ct==fe,ht=Qe==0,Jt=!kt||Qe==kt.length-1;if(St.top-Ge.top<=3){var lt=(c?tn:xr)&&ht,xo=(c?xr:tn)&&Jt,ar=lt?l:(Je?Ge:St).left,Wr=xo?s:(Je?St:Ge).right;f(ar,Ge.top,Wr-ar,Ge.bottom)}else{var zr,vt,rn,ko;Je?(zr=c&&tn&&ht?l:Ge.left,vt=c?s:Nt(Ye,st,"before"),rn=c?l:Nt(Ct,st,"after"),ko=c&&xr&&Jt?s:St.right):(zr=c?Nt(Ye,st,"before"):l,vt=!c&&tn&&ht?s:Ge.right,rn=!c&&xr&&Jt?l:St.left,ko=c?Nt(Ct,st,"after"):s),f(zr,Ge.top,vt-zr,Ge.bottom),Ge.bottom0?t.blinker=setInterval(function(){e.hasFocus()||Kr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function ma(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Ji(e))}function Yi(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Kr(e))},100)}function Ji(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,me(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),V&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),_i(e))}function Kr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Pe(e,"blur",e,t),e.state.focused=!1,N(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function oi(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||v<-.005)&&(ie.display.sizerWidth){var S=Math.ceil(f/Vr(e.display));S>e.display.maxLineLength&&(e.display.maxLineLength=S,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function ga(e){if(e.widgets)for(var t=0;t=a&&(o=qt(t,rr(G(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function Ds(e,t){if(!Ke(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&&!Oe){var a=d("div","\u200B",null,`position: absolute; top: `+(t.top-n.viewOffset-ei(e.display))+`px; height: `+(t.bottom-t.top+_t(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 Ps(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?g(t.line,t.ch+1,"before"):t,t=t.ch?g(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,l=Et(e,t),s=!n||n==t?l:Et(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 c=Zi(e,i),f=e.doc.scrollTop,h=e.doc.scrollLeft;if(c.scrollTop!=null&&(xn(e,c.scrollTop),Math.abs(e.doc.scrollTop-f)>1&&(a=!0)),c.scrollLeft!=null&&(Or(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(a=!0)),!a)break}return i}function Ws(e,t){var n=Zi(e,t);n.scrollTop!=null&&xn(e,n.scrollTop),n.scrollLeft!=null&&Or(e,n.scrollLeft)}function Zi(e,t){var n=e.display,r=Rr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=Ei(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+ji(n),s=t.topl-r;if(t.topi+o){var f=Math.min(t.top,(c?l:t.bottom)-o);f!=i&&(a.scrollTop=f)}var h=e.options.fixedGutter?0:n.gutters.offsetWidth,b=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-h,v=Tr(e)-n.gutters.offsetWidth,k=t.right-t.left>v;return k&&(t.right=t.left+v),t.left<10?a.scrollLeft=0:t.leftv+b-3&&(a.scrollLeft=t.right+(k?0:10)-v),a}function Xi(e,t){t!=null&&(li(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Ur(e){li(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function wn(e,t,n){(t!=null||n!=null)&&li(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function zs(e,t){li(e),e.curOp.scrollToPos=t}function li(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=ca(e,t.from),r=ca(e,t.to);va(e,n,r,t.margin)}}function va(e,t,n,r){var i=Zi(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});wn(e,i.scrollLeft,i.scrollTop)}function xn(e,t){Math.abs(e.doc.scrollTop-t)<2||(q||eo(e,{top:t}),ya(e,t,!0),q&&eo(e),Sn(e,100))}function ya(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 Or(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 kn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+ji(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+_t(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Ar=function(e,t,n){this.cm=n;var r=this.vert=d("div",[d("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=d("div",[d("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),j(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),j(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,F&&Z<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ar.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}},Ar.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ar.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ar.prototype.zeroWidthHack=function(){var e=ve&&!He?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new J,this.disableVert=new J},Ar.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)},Ar.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Cn=function(){};Cn.prototype.update=function(){return{bottom:0,right:0}},Cn.prototype.setScrollLeft=function(){},Cn.prototype.setScrollTop=function(){},Cn.prototype.clear=function(){};function Gr(e,t){t||(t=kn(e));var n=e.display.barWidth,r=e.display.barHeight;ba(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&oi(e),ba(e,kn(e)),n=e.display.barWidth,r=e.display.barHeight}function ba(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 wa={native:Ar,null:Cn};function xa(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&N(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new wa[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),j(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"?Or(e,t):xn(e,t)},e),e.display.scrollbars.addClass&&me(e.display.wrapper,e.display.scrollbars.addClass)}var Hs=0;function Dr(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:++Hs,markArrays:null},fs(e.curOp)}function Pr(e){var t=e.curOp;t&&ps(t,function(n){for(var r=0;r=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new si(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Es(e){e.updatedDisplay=e.mustUpdate&&Qi(e.cm,e.update)}function Is(e){var t=e.cm,n=t.display;e.updatedDisplay&&oi(t),e.barMeasure=kn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ta(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+_t(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Tr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Bs(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=hn(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?Qt(t.mode,r.state):null,s=Oo(e,o,r,!0);l&&(r.state=l),o.styles=s.styles;var c=o.styleClasses,f=s.classes;f?o.styleClasses=f:c&&(o.styleClasses=null);for(var h=!a||a.length!=o.styles.length||c!=f&&(!c||!f||c.bgClass!=f.bgClass||c.textClass!=f.textClass),b=0;!h&&bn)return Sn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Mt(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&&ha(e)==0)return!1;Sa(e)&&(mr(e),t.dims=Ui(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)),tr&&(o=Wi(e.doc,o),a=Ko(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Os(e,o,a),n.viewOffset=rr(G(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=ha(e);if(!l&&s==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var c=Us(e);return s>4&&(n.lineDiv.style.display="none"),qs(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Gs(c),y(n.cursorDiv),y(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Sn(e,400)),n.updateLineNumbers=null,!0}function ka(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==Tr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+ji(e.display)-Ei(e),n.top)}),t.visible=ai(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=ai(e.display,e.doc,n));if(!Qi(e,t))break;oi(e);var i=kn(e);bn(e),Gr(e,i),ro(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 eo(e,t){var n=new si(e,t);if(Qi(e,n)){oi(e),ka(e,n);var r=kn(e);bn(e),Gr(e,r),ro(e,r),n.finish()}}function qs(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function l(k){var S=k.nextSibling;return V&&ve&&e.display.currentWheelTarget==k?k.style.display="none":k.parentNode.removeChild(k),S}for(var s=r.view,c=r.viewFrom,f=0;f-1&&(v=!1),_o(e,h,c,n)),v&&(y(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(p(e.options,c)))),a=h.node.nextSibling}c+=h.size}for(;a;)a=l(a)}function to(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",nt(e,"gutterChanged",e)}function ro(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+_t(e)+"px"}function Ca(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Gi(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"),F&&Z<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!V&&!(q&&ce)&&(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=no(r.gutters,r.lineNumbers),Ta(i),n.init(i)}var ci=0,ir=null;F?ir=-.53:q?ir=15:X?ir=-.7:We&&(ir=-1/3);function La(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 _s(e){var t=La(e);return t.x*=ir,t.y*=ir,t}function Ma(e,t){X&&pe==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=La(t),r=n.x,i=n.y,o=ir;t.deltaMode===0&&(r=t.deltaX,i=t.deltaY,o=1);var a=e.display,l=a.scroller,s=l.scrollWidth>l.clientWidth,c=l.scrollHeight>l.clientHeight;if(r&&s||i&&c){if(i&&ve&&V){e:for(var f=t.target,h=a.view;f!=l;f=f.parentNode)for(var b=0;b=0&&x(e,r.to())<=0)return n}return-1};var Ce=function(e,t){this.anchor=e,this.head=t};Ce.prototype.from=function(){return Xe(this.anchor,this.head)},Ce.prototype.to=function(){return xe(this.anchor,this.head)},Ce.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function It(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(b,v){return x(b.from(),v.from())}),n=U(t,i);for(var o=1;o0:s>=0){var c=Xe(l.from(),a.from()),f=xe(l.to(),a.to()),h=l.empty()?a.from()==a.head:l.from()==l.head;o<=n&&--n,t.splice(--o,2,new Ce(h?f:c,h?c:f))}}return new At(t,n)}function gr(e,t){return new At([new Ce(e,t||e)],0)}function vr(e){return e.text?g(e.from.line+e.text.length-1,ie(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Na(e,t){if(x(e,t.from)<0)return e;if(x(e,t.to)<=0)return vr(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+=vr(t).ch-t.to.ch),g(n,r)}function io(e,t){for(var n=[],r=0;r1&&e.remove(l.line+1,k-1),e.insert(l.line+1,z)}nt(e,"change",e,t)}function yr(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(),ie(e.done)}function za(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=Zs(i,i.lastOp==r)))l=ie(a.changes),x(t.from,t.to)==0&&x(t.from,l.to)==0?l.to=vr(t):a.changes.push(lo(e,t));else{var s=ie(i.done);for((!s||!s.ranges)&&di(e.sel,i.done),a={changes:[lo(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 Xs(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 Qs(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||Xs(e,o,ie(i.done),t))?i.done[i.done.length-1]=t:di(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&Wa(i.undone)}function di(e,t){var n=ie(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Ha(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 ec(e){if(!e)return null;for(var t,n=0;n-1&&(ie(l)[h]=c[h],delete c[h])}}return r}function so(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 Ce(i,t)}else return new Ce(n||t,t)}function fi(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),ft(e,new At([so(e.sel.primary(),t,n,i)],0),r)}function ja(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 h=s.find(r<0?1:-1),b=void 0;if((r<0?f:c)&&(h=Ka(e,h,-r,h&&h.line==t.line?o:null)),h&&h.line==t.line&&(b=x(h,n))&&(r<0?b<0:b>0))return $r(e,h,t,r,i)}var v=s.find(r<0?-1:1);return(r<0?c:f)&&(v=Ka(e,v,r,v.line==t.line?o:null)),v?$r(e,v,t,r,i):null}}return t}function pi(e,t,n,r,i){var o=r||1,a=$r(e,t,n,o,i)||!i&&$r(e,t,n,o,!0)||$r(e,t,n,-o,i)||!i&&$r(e,t,n,-o,!0);return a||(e.cantEdit=!0,g(e.first,0))}function Ka(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?ne(e,g(t.line-1)):null:n>0&&t.ch==(r||G(e,t.line)).text.length?t.line=0;--i)qa(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else qa(e,t)}}function qa(e,t){if(!(t.text.length==1&&t.text[0]==""&&x(t.from,t.to)==0)){var n=io(e,t);za(e,t,n,e.cm?e.cm.curOp.id:NaN),Mn(e,t,n,Di(e,t));var r=[];yr(e,function(i,o){!o&&U(r,i.history)==-1&&(Ja(i.history,t),r.push(i.history)),Mn(i,t,null,Di(i,t))})}}function mi(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,c=0;c=0;--v){var k=b(v);if(k)return k.v}}}}function $a(e,t){if(t!=0&&(e.first+=t,e.sel=new At(Ie(e.sel.ranges,function(i){return new Ce(g(i.anchor.line+t,i.anchor.ch),g(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){wt(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:g(o,G(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=er(e,t.from,t.to),n||(n=io(e,t)),e.cm?nc(e.cm,t,r):ao(e,t,r),hi(e,n,Q),e.cantEdit&&pi(e,g(e.firstLine(),0))&&(e.cantEdit=!1)}}function nc(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=ke(jt(G(r,o.line))),r.iter(s,a.line+1,function(v){if(v==i.maxLine)return l=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Vn(e),ao(r,t,n,fa(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(v){var k=Xn(v);k>i.maxLineLength&&(i.maxLine=v,i.maxLineLength=k,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),ql(r,o.line),Sn(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?wt(e):o.line==a.line&&t.text.length==1&&!Aa(e.doc,t)?pr(e,o.line,"text"):wt(e,o.line,a.line+1,c);var f=pt(e,"changes"),h=pt(e,"change");if(h||f){var b={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};h&&nt(e,"change",e,b),f&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(b)}e.display.selForContextMenu=null}function Yr(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)),_r(e,{from:n,to:r,text:t,origin:i})}function _a(e,t,n,r){n1||!(this.children[0]instanceof On))){var l=[];this.collapse(l),this.children=[new On(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=c,e.display.maxLineLength=f,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&wt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ra(e.doc)),e&&nt(e,"markerCleared",e,this,r,i),t&&Pr(e),this.parent&&this.parent.clear()}},br.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=W("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Vo(e,t.line,t,n,o)||t.line!=n.line&&Vo(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");_l()}o.addToHistory&&za(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l=t.line,s=e.cm,c;if(e.iter(l,n.line+1,function(h){s&&o.collapsed&&!s.options.lineWrapping&&jt(h)==s.display.maxLine&&(c=!0),o.collapsed&&l!=t.line&&Ht(h,0),Jl(h,new _n(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(h){hr(e,h)&&Ht(h,0)}),o.clearOnEnter&&j(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&($l(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Xa,o.atomic=!0),s){if(c&&(s.curOp.updateMaxLine=!0),o.collapsed)wt(s,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var f=t.line;f<=n.line;f++)pr(s,f,"text");o.atomic&&Ra(s.doc),nt(s,"markerAdded",s,o)}return o}var Pn=function(e,t){this.markers=e,this.primary=t;for(var n=0;n=0;s--)_r(this,r[s]);l?Ia(this,l):this.cm&&Ur(this.cm)}),undo:ot(function(){mi(this,"undo")}),redo:ot(function(){mi(this,"redo")}),undoSelection:ot(function(){mi(this,"undo",!0)}),redoSelection:ot(function(){mi(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=ne(this,e),t=ne(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}),ne(this,g(n,t))},indexFromPos:function(e){e=ne(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 f=e.dataTransfer.getData("Text");if(f){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),hi(t.doc,gr(n,n)),h)for(var b=0;b=0;l--)Yr(e.doc,"",r[l].from,r[l].to,"+delete");Ur(e)})}function uo(e,t,n){var r=Vt(e.text,t+n,n);return r<0||r>e.text.length?null:r}function fo(e,t,n){var r=uo(e,t.ch,n);return r==null?null:new g(t.line,r,n<0?"after":"before")}function ho(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var o=Wt(n,t.doc.direction);if(o){var a=i<0?ie(o):o[0],l=i<0==(a.level==1),s=l?"after":"before",c;if(a.level>0||t.doc.direction=="rtl"){var f=Br(t,n);c=i<0?n.text.length-1:0;var h=Yt(t,f,c).top;c=Ve(function(b){return Yt(t,f,b).top==h},i<0==(a.level==1)?a.from:a.to-1,c),s=="before"&&(c=uo(n,c,1))}else c=i<0?a.to:a.from;return new g(r,c,s)}}return new g(r,i<0?n.text.length:0,i<0?"before":"after")}function vc(e,t,n,r){var i=Wt(t,e.doc.direction);if(!i)return fo(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=Pt(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&&b>=f.begin)){var v=h?"before":"after";return new g(n.line,b,v)}}var k=function(z,E,H){for(var R=function(De,at){return at?new g(n.line,l(De,1),"before"):new g(n.line,De,"after")};z>=0&&z0==(_.level!=1),fe=Y?H.begin:l(H.end,-1);if(_.from<=fe&&fe<_.to||(fe=Y?_.from:l(_.to,-1),H.begin<=fe&&fe0?f.end:l(f.begin,-1);return A!=null&&!(r>0&&A==t.text.length)&&(S=k(r>0?0:i.length-1,r,c(A)),S)?S:null}var Hn={selectAll:Ua,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Q)},killLine:function(e){return Xr(e,function(t){if(t.empty()){var n=G(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new g(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),g(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=G(e.doc,i.line-1).text;a&&(i=new g(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),g(i.line-1,a.length-1),i,"+transpose"))}}n.push(new Ce(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Mt(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 jn,En;function Sc(e,t){var n=+new Date;return En&&En.compare(n,e,t)?(jn=En=null,"triple"):jn&&jn.compare(n,e,t)?(En=new mo(n,e,t),jn=null,"double"):(jn=new mo(n,e,t),En=null,"single")}function pl(e){var t=this,n=t.display;if(!(Ke(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,nr(n,e)){V||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!go(t,e)){var r=Mr(t,e),i=un(e),o=r?Sc(r,i):"single";tt(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Tc(t,i,r,o,e))&&(i==1?r?Mc(t,r,o,e):bt(e)==n.scroller&&dt(e):i==2?(r&&fi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(te?t.display.input.onContextMenu(e):Yi(t)))}}}function Tc(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,Fn(e,ol(o,i),i,function(a){if(typeof a=="string"&&(a=Hn[a]),!a)return!1;var l=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),l=a(e,n)!=P}finally{e.state.suppressEdits=!1}return l})}function Lc(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=ve?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(ve?n.altKey:n.ctrlKey)),i}function Mc(e,t,n,r){F?setTimeout(Ae(ma,e),0):e.curOp.focus=ae(Le(e));var i=Lc(e,n,r),o=e.doc.sel,a;e.options.dragDrop&&Mi&&!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)?Nc(e,r,t,i):Oc(e,r,t,i)}function Nc(e,t,n,r){var i=e.display,o=!1,a=it(e,function(c){V&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Yi(e)),ut(i.wrapper.ownerDocument,"mouseup",a),ut(i.wrapper.ownerDocument,"mousemove",l),ut(i.scroller,"dragstart",s),ut(i.scroller,"drop",a),o||(dt(c),r.addNew||fi(e.doc,n,null,null,r.extend),V&&!We||F&&Z==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),l=function(c){o=o||Math.abs(t.clientX-c.clientX)+Math.abs(t.clientY-c.clientY)>=10},s=function(){return o=!0};V&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=!r.moveOnDrag,j(i.wrapper.ownerDocument,"mouseup",a),j(i.wrapper.ownerDocument,"mousemove",l),j(i.scroller,"dragstart",s),j(i.scroller,"drop",a),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function ml(e,t,n){if(n=="char")return new Ce(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Ce(g(t.line,0),ne(e.doc,g(t.line+1,0)));var r=n(e,t);return new Ce(r.from,r.to)}function Oc(e,t,n,r){F&&Yi(e);var i=e.display,o=e.doc;dt(t);var a,l,s=o.sel,c=s.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),l>-1?a=c[l]:a=new Ce(n,n)):(a=o.sel.primary(),l=o.sel.primIndex),r.unit=="rectangle")r.addNew||(a=new Ce(n,n)),n=Mr(e,t,!0,!0),l=-1;else{var f=ml(e,n,r.unit);r.extend?a=so(a,f.anchor,f.head,r.extend):a=f}r.addNew?l==-1?(l=c.length,ft(o,It(e,c.concat([a]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&r.unit=="char"&&!r.extend?(ft(o,It(e,c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):co(o,l,a,be):(l=0,ft(o,new At([a],0),be),s=o.sel);var h=n;function b(H){if(x(h,H)!=0)if(h=H,r.unit=="rectangle"){for(var R=[],_=e.options.tabSize,Y=K(G(o,n.line).text,n.ch,_),fe=K(G(o,H.line).text,H.ch,_),De=Math.min(Y,fe),at=Math.max(Y,fe),Be=Math.min(n.line,H.line),Nt=Math.min(e.lastLine(),Math.max(n.line,H.line));Be<=Nt;Be++){var kt=G(o,Be).text,Ye=Se(kt,De,_);De==at?R.push(new Ce(g(Be,Ye),g(Be,Ye))):kt.length>Ye&&R.push(new Ce(g(Be,Ye),g(Be,Se(kt,at,_))))}R.length||R.push(new Ce(n,n)),ft(o,It(e,s.ranges.slice(0,l).concat(R),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(H)}else{var Ct=a,st=ml(e,H,r.unit),Qe=Ct.anchor,Je;x(st.anchor,Qe)>0?(Je=st.head,Qe=Xe(Ct.from(),st.anchor)):(Je=st.anchor,Qe=xe(Ct.to(),st.head));var Ge=s.ranges.slice(0);Ge[l]=Ac(e,new Ce(ne(o,Qe),Je)),ft(o,It(e,Ge,l),be)}}var v=i.wrapper.getBoundingClientRect(),k=0;function S(H){var R=++k,_=Mr(e,H,!0,r.unit=="rectangle");if(_)if(x(_,h)!=0){e.curOp.focus=ae(Le(e)),b(_);var Y=ai(i,o);(_.line>=Y.to||_.linev.bottom?20:0;fe&&setTimeout(it(e,function(){k==R&&(i.scroller.scrollTop+=fe,S(H))}),50)}}function A(H){e.state.selectingText=!1,k=1/0,H&&(dt(H),i.input.focus()),ut(i.wrapper.ownerDocument,"mousemove",z),ut(i.wrapper.ownerDocument,"mouseup",E),o.history.lastSelOrigin=null}var z=it(e,function(H){H.buttons===0||!un(H)?A(H):S(H)}),E=it(e,A);e.state.selectingText=E,j(i.wrapper.ownerDocument,"mousemove",z),j(i.wrapper.ownerDocument,"mouseup",E)}function Ac(e,t){var n=t.anchor,r=t.head,i=G(e.doc,n.line);if(x(n,r)==0&&n.sticky==r.sticky)return t;var o=Wt(i);if(!o)return t;var a=Pt(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 c;if(r.line!=n.line)c=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var f=Pt(o,r.ch,r.sticky),h=f-a||(r.ch-n.ch)*(l.level==1?-1:1);f==s-1||f==s?c=h<0:c=h>0}var b=o[s+(c?-1:0)],v=c==(b.level==1),k=v?b.from:b.to,S=v?"after":"before";return n.ch==k&&n.sticky==S?t:new Ce(new g(n.line,k,S),r)}function gl(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(b){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&dt(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!pt(e,n))return cn(t);o-=l.top-a.viewOffset;for(var s=0;s=i){var f=qt(e.doc,o),h=e.display.gutterSpecs[s];return Pe(e,n,e,f,h.className,t),cn(t)}}}function go(e,t){return gl(e,t,"gutterClick",!0)}function vl(e,t){nr(e.display,t)||Dc(e,t)||Ke(e,t,"contextmenu")||te||e.display.input.onContextMenu(t)}function Dc(e,t){return pt(e,"gutterContextMenu")?gl(e,t,"gutterContextMenu",!1):!1}function yl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),yn(e)}var Qr={toString:function(){return"CodeMirror.Init"}},bl={},bi={};function Pc(e){var t=e.optionHandlers;function n(r,i,o,a){e.defaults[r]=i,o&&(t[r]=a?function(l,s,c){c!=Qr&&o(l,s,c)}:o)}e.defineOption=n,e.Init=Qr,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,oo(r)},!0),n("indentUnit",2,oo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){Ln(r),yn(r),wt(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 c=0;;){var f=s.text.indexOf(i,c);if(f==-1)break;c=f+i.length,o.push(g(a,f))}a++});for(var l=o.length-1;l>=0;l--)Yr(r.doc,i,o[l],g(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!=Qr&&r.refresh()}),n("specialCharPlaceholder",ls,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",ce?"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",!ct),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){yl(r),Tn(r)},!0),n("keyMap","default",function(r,i,o){var a=vi(i),l=o!=Qr&&vi(o);l&&l.detach&&l.detach(r,a),a.attach&&a.attach(r,l||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,zc,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=no(i,r.options.lineNumbers),Tn(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?Gi(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Gr(r)},!0),n("scrollbarStyle","native",function(r){xa(r),Gr(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=no(r.options.gutters,i),Tn(r)},!0),n("firstLineNumber",1,Tn,!0),n("lineNumberFormatter",function(r){return r},Tn,!0),n("showCursorWhenSelecting",!1,bn,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Kr(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,Wc),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,bn,!0),n("singleCursorHeightPerLine",!0,bn,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Ln,!0),n("addModeClass",!1,Ln,!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,Ln,!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 Wc(e,t,n){var r=n&&n!=Qr;if(!t!=!r){var i=e.display.dragFunctions,o=t?j:ut;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 zc(e){e.options.lineWrapping?(me(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(N(e.display.wrapper,"CodeMirror-wrap"),Hi(e)),qi(e),wt(e),yn(e),setTimeout(function(){return Gr(e)},100)}function Fe(e,t){var n=this;if(!(this instanceof Fe))return new Fe(e,t);this.options=t=t?$(t):{},$(bl,t,!1);var r=t.value;typeof r=="string"?r=new xt(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 $s(e,r,i,t);o.wrapper.CodeMirror=this,yl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),xa(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 J,keySeq:null,specialChars:null},t.autofocus&&!ce&&o.input.focus(),F&&Z<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Hc(this),fc(),Dr(this),this.curOp.forceUpdate=!0,Da(this,r),t.autofocus&&!ce||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Ji(n)},20):Kr(this);for(var a in bi)bi.hasOwnProperty(a)&&bi[a](this,t[a],Qr);Sa(this),t.finishInit&&t.finishInit(this);for(var l=0;l20*20}j(t.scroller,"touchstart",function(s){if(!Ke(e,s)&&!o(s)&&!go(e,s)){t.input.ensurePolled(),clearTimeout(n);var c=+new Date;t.activeTouch={start:c,moved:!1,prev:c-r.end<=300?r:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),j(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),j(t.scroller,"touchend",function(s){var c=t.activeTouch;if(c&&!nr(t,s)&&c.left!=null&&!c.moved&&new Date-c.start<300){var f=e.coordsChar(t.activeTouch,"page"),h;!c.prev||a(c,c.prev)?h=new Ce(f,f):!c.prev.prev||a(c,c.prev.prev)?h=e.findWordAt(f):h=new Ce(g(f.line,0),ne(e.doc,g(f.line+1,0))),e.setSelection(h.anchor,h.head),e.focus(),dt(s)}i()}),j(t.scroller,"touchcancel",i),j(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xn(e,t.scroller.scrollTop),Or(e,t.scroller.scrollLeft,!0),Pe(e,"scroll",e))}),j(t.scroller,"mousewheel",function(s){return Ma(e,s)}),j(t.scroller,"DOMMouseScroll",function(s){return Ma(e,s)}),j(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){Ke(e,s)||Xt(s)},over:function(s){Ke(e,s)||(dc(e,s),Xt(s))},start:function(s){return uc(e,s)},drop:it(e,cc),leave:function(s){Ke(e,s)||tl(e)}};var l=t.input.getField();j(l,"keyup",function(s){return fl.call(e,s)}),j(l,"keydown",it(e,dl)),j(l,"keypress",it(e,hl)),j(l,"focus",function(s){return Ji(e,s)}),j(l,"blur",function(s){return Kr(e,s)})}var vo=[];Fe.defineInitHook=function(e){return vo.push(e)};function In(e,t,n,r){var i=e.doc,o;n==null&&(n="add"),n=="smart"&&(i.mode.indent?o=hn(e,t).state:n="prev");var a=e.options.tabSize,l=G(i,t),s=K(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c=l.text.match(/^\s*/)[0],f;if(!r&&!/\S/.test(l.text))f=0,n="not";else if(n=="smart"&&(f=i.mode.indent(o,l.text.slice(c.length),l.text),f==P||f>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?f=K(G(i,t-1).text,null,a):f=0:n=="add"?f=s+e.options.indentUnit:n=="subtract"?f=s-e.options.indentUnit:typeof n=="number"&&(f=s+n),f=Math.max(0,f);var h="",b=0;if(e.options.indentWithTabs)for(var v=Math.floor(f/a);v;--v)b+=a,h+=" ";if(ba,s=dn(t),c=null;if(l&&r.ranges.length>1)if(Bt&&Bt.text.join(` `)==t){if(r.ranges.length%Bt.text.length==0){c=[];for(var f=0;f=0;b--){var v=r.ranges[b],k=v.from(),S=v.to();v.empty()&&(n&&n>0?k=g(k.line,k.ch-n):e.state.overwrite&&!l?S=g(S.line,Math.min(G(o,S.line).text.length,S.ch+ie(s).length)):l&&Bt&&Bt.lineWise&&Bt.text.join(` `)==s.join(` `)&&(k=S=g(k.line,0)));var A={from:k,to:S,text:c?c[b%c.length]:s,origin:i||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};_r(e.doc,A),nt(e,"inputRead",e,A)}t&&!l&&xl(e,t),Ur(e),e.curOp.updateInput<2&&(e.curOp.updateInput=h),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function wl(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Mt(t,function(){return yo(t,n,0,null,"paste")}),!0}function xl(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=In(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(G(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=In(e,i.head.line,"smart"));a&&nt(e,"electricInput",e,i.head.line)}}}function kl(e){for(var t=[],n=[],r=0;ro&&(In(this,l.head.line,r,!0),o=l.head.line,a==this.doc.sel.primIndex&&Ur(this));else{var s=l.from(),c=l.to(),f=Math.max(o,s.line);o=Math.min(this.lastLine(),c.line-(c.ch?0:1))+1;for(var h=f;h0&&co(this.doc,a,new Ce(s,b[a].to()),Q)}}}),getTokenAt:function(r,i){return Wo(this,r,i)},getLineTokens:function(r,i){return Wo(this,g(r),i,!0)},getTokenTypeAt:function(r){r=ne(this.doc,r);var i=Ao(this,G(this.doc,r.line)),o=0,a=(i.length-1)/2,l=r.ch,s;if(l==0)s=i[2];else for(;;){var c=o+a>>1;if((c?i[c*2-1]:0)>=l)a=c;else if(i[c*2+1]s&&(r=s,a=!0),l=G(this.doc,r)}else l=r;return ti(this,l,{top:0,left:0},i||"page",o||a).top+(a?this.doc.height-rr(l):0)},defaultTextHeight:function(){return Rr(this.display)},defaultCharWidth:function(){return Vr(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=Et(this,ne(this.doc,r));var c=r.bottom,f=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),s.sizer.appendChild(i),a=="over")c=r.top;else if(a=="above"||a=="near"){var h=Math.max(s.wrapper.clientHeight,this.doc.height),b=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(a=="above"||r.bottom+i.offsetHeight>h)&&r.top>i.offsetHeight?c=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=h&&(c=r.bottom),f+i.offsetWidth>b&&(f=b-i.offsetWidth)}i.style.top=c+"px",i.style.left=i.style.right="",l=="right"?(f=s.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(l=="left"?f=0:l=="middle"&&(f=(s.sizer.clientWidth-i.offsetWidth)/2),i.style.left=f+"px"),o&&Ws(this,{left:f,top:c,right:f+i.offsetWidth,bottom:c+i.offsetHeight})},triggerOnKeyDown:gt(dl),triggerOnKeyPress:gt(hl),triggerOnKeyUp:fl,triggerOnMouseDown:gt(pl),execCommand:function(r){if(Hn.hasOwnProperty(r))return Hn[r].call(null,this)},triggerElectric:gt(function(r){xl(this,r)}),findPosH:function(r,i,o,a){var l=1;i<0&&(l=-1,i=-i);for(var s=ne(this.doc,r),c=0;c0&&f(o.charAt(a-1));)--a;for(;l.5||this.options.lineWrapping)&&qi(this),Pe(this,"refresh",this)}),swapDoc:gt(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),Da(this,r),yn(this),this.display.input.reset(),wn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,nt(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}},mt(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 wo(e,t,n,r,i){var o=t,a=n,l=G(e,t.line),s=i&&e.direction=="rtl"?-n:n;function c(){var E=t.line+s;return E=e.first+e.size?!1:(t=new g(E,t.ch,t.sticky),l=G(e,E))}function f(E){var H;if(r=="codepoint"){var R=l.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(R))H=null;else{var _=n>0?R>=55296&&R<56320:R>=56320&&R<57343;H=new g(t.line,Math.max(0,Math.min(l.text.length,t.ch+n*(_?2:1))),-n)}}else i?H=vc(e.cm,l,t,n):H=fo(l,t,n);if(H==null)if(!E&&c())t=ho(i,e.cm,l,t.line,s);else return!1;else t=H;return!0}if(r=="char"||r=="codepoint")f();else if(r=="column")f(!0);else if(r=="word"||r=="group")for(var h=null,b=r=="group",v=e.cm&&e.cm.getHelper(t,"wordChars"),k=!0;!(n<0&&!f(!k));k=!1){var S=l.text.charAt(t.ch)||` `,A=se(S,v)?"w":b&&S==` `?"n":!b||/\s/.test(S)?null:"p";if(b&&!k&&!A&&(A="s"),h&&h!=A){n<0&&(n=1,f(),t.sticky="after");break}if(A&&(h=A),n>0&&!f(!k))break}var z=pi(e,t,o,a,!0);return re(o,z)&&(z.hitSide=!0),z}function Sl(e,t,n,r){var i=e.doc,o=t.left,a;if(r=="page"){var l=Math.min(e.display.wrapper.clientHeight,tt(e).innerHeight||i(e).documentElement.clientHeight),s=Math.max(l-.5*Rr(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 c;c=Vi(e,o,a),!!c.outside;){if(n<0?a<=0:a>=i.height){c.hitSide=!0;break}a+=n*5}return c}var Me=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new J,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Me.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,bo(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}j(i,"paste",function(l){!o(l)||Ke(r,l)||wl(l,r)||Z<=11&&setTimeout(it(r,function(){return t.updateFromDOM()}),20)}),j(i,"compositionstart",function(l){t.composing={data:l.data,done:!1}}),j(i,"compositionupdate",function(l){t.composing||(t.composing={data:l.data,done:!1})}),j(i,"compositionend",function(l){t.composing&&(l.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),j(i,"touchstart",function(){return n.forceCompositionEnd()}),j(i,"input",function(){t.composing||t.readFromDOMSoon()});function a(l){if(!(!o(l)||Ke(r,l))){if(r.somethingSelected())wi({lineWise:!1,text:r.getSelections()}),l.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=kl(r);wi({lineWise:!0,text:s.text}),l.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,Q),r.replaceSelection("",null,"cut")})}else return;if(l.clipboardData){l.clipboardData.clearData();var c=Bt.text.join(` `);if(l.clipboardData.setData("Text",c),l.clipboardData.getData("Text")==c){l.preventDefault();return}}var f=Cl(),h=f.firstChild;bo(h),r.display.lineSpace.insertBefore(f,r.display.lineSpace.firstChild),h.value=Bt.text.join(` `);var b=ae(i.ownerDocument);et(h),setTimeout(function(){r.display.lineSpace.removeChild(f),b.focus(),b==i&&n.showPrimarySelection()},50)}}j(i,"copy",a),j(i,"cut",a)},Me.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Me.prototype.prepareSelection=function(){var e=pa(this.cm,!1);return e.focus=ae(this.div.ownerDocument)==this.div,e},Me.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Me.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Me.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&&Tl(t,r)||{node:l[0].measure.map[2],offset:0},c=i.linee.firstLine()&&(r=g(r.line-1,G(e.doc,r.line-1).length)),i.ch==G(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var o,a,l;r.line==t.viewFrom||(o=Nr(e,r.line))==0?(a=ke(t.view[0].line),l=t.view[0].node):(a=ke(t.view[o].line),l=t.view[o-1].node.nextSibling);var s=Nr(e,i.line),c,f;if(s==t.view.length-1?(c=t.viewTo-1,f=t.lineDiv.lastChild):(c=ke(t.view[s+1].line)-1,f=t.view[s+1].node.previousSibling),!l)return!1;for(var h=e.doc.splitLines(Ec(e,l,f,a,c)),b=er(e.doc,g(a,0),g(c,G(e.doc,c).text.length));h.length>1&&b.length>1;)if(ie(h)==ie(b))h.pop(),b.pop(),c--;else if(h[0]==b[0])h.shift(),b.shift(),a++;else break;for(var v=0,k=0,S=h[0],A=b[0],z=Math.min(S.length,A.length);vr.ch&&E.charCodeAt(E.length-k-1)==H.charCodeAt(H.length-k-1);)v--,k++;h[h.length-1]=E.slice(0,E.length-k).replace(/^\u200b+/,""),h[0]=h[0].slice(v).replace(/\u200b+$/,"");var _=g(a,v),Y=g(c,b.length?ie(b).length-k:0);if(h.length>1||h[0]||x(_,Y))return Yr(e.doc,h,_,Y,"+input"),!0},Me.prototype.ensurePolled=function(){this.forceCompositionEnd()},Me.prototype.reset=function(){this.forceCompositionEnd()},Me.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Me.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))},Me.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Mt(this.cm,function(){return wt(e.cm)})},Me.prototype.setUneditable=function(e){e.contentEditable="false"},Me.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||it(this.cm,yo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},Me.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Me.prototype.onContextMenu=function(){},Me.prototype.resetPosition=function(){},Me.prototype.needsContentAttribute=!0;function Tl(e,t){var n=Ii(e,t.line);if(!n||n.hidden)return null;var r=G(e.doc,t.line),i=ea(n,r,t.line),o=Wt(r,e.doc.direction),a="left";if(o){var l=Pt(o,t.ch);a=l%2?"right":"left"}var s=na(i.map,t.ch,a);return s.offset=s.collapse=="right"?s.end:s.start,s}function jc(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function en(e,t){return t&&(e.bad=!0),e}function Ec(e,t,n,r,i){var o="",a=!1,l=e.doc.lineSeparator(),s=!1;function c(v){return function(k){return k.id==v}}function f(){a&&(o+=l,s&&(o+=l),a=s=!1)}function h(v){v&&(f(),o+=v)}function b(v){if(v.nodeType==1){var k=v.getAttribute("cm-text");if(k){h(k);return}var S=v.getAttribute("cm-marker"),A;if(S){var z=e.findMarks(g(r,0),g(i+1,0),c(+S));z.length&&(A=z[0].find(0))&&h(er(e.doc,A.from,A.to).join(l));return}if(v.getAttribute("contenteditable")=="false")return;var E=/^(pre|div|p|li|table|br)$/i.test(v.nodeName);if(!/^br$/i.test(v.nodeName)&&v.textContent.length==0)return;E&&f();for(var H=0;H=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),j(i,"paste",function(a){Ke(r,a)||wl(a,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function o(a){if(!Ke(r,a)){if(r.somethingSelected())wi({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var l=kl(r);wi({lineWise:!0,text:l.text}),a.type=="cut"?r.setSelections(l.ranges,null,Q):(n.prevInput="",i.value=l.text.join(` `),et(i))}else return;a.type=="cut"&&(r.state.cutIncoming=+new Date)}}j(i,"cut",o),j(i,"copy",o),j(e.scroller,"paste",function(a){if(!(nr(e,a)||Ke(r,a))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var l=new Event("paste");l.clipboardData=a.clipboardData,i.dispatchEvent(l)}}),j(e.lineSpace,"selectstart",function(a){nr(e,a)||dt(a)}),j(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"})}}),j(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},$e.prototype.createField=function(e){this.wrapper=Cl(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;bo(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},$e.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},$e.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=pa(e);if(e.options.moveInputWithCursor){var i=Et(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},$e.prototype.showSelection=function(e){var t=this.cm,n=t.display;T(n.cursorDiv,e.cursors),T(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},$e.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&&et(this.textarea),F&&Z>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",F&&Z>=9&&(this.hasSelection=null));this.resetting=!1}},$e.prototype.getField=function(){return this.textarea},$e.prototype.supportsTouch=function(){return!1},$e.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!ce||ae(this.textarea.ownerDocument)!=this.textarea))try{this.textarea.focus()}catch(e){}},$e.prototype.blur=function(){this.textarea.blur()},$e.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},$e.prototype.receivedFocus=function(){this.slowPoll()},$e.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},$e.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)},$e.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||sr(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(F&&Z>=9&&this.hasSelection===i||ve&&/[\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},$e.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},$e.prototype.onKeyPress=function(){F&&Z>=9&&(this.hasSelection=null),this.fastPoll()},$e.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Mr(n,e),a=r.scroller.scrollTop;if(!o||de)return;var l=n.options.resetSelectionOnContextMenu;l&&n.doc.sel.contains(o)==-1&&it(n,ft)(n.doc,gr(o),Q);var s=i.style.cssText,c=t.wrapper.style.cssText,f=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+`px; z-index: 1000; background: `+(F?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var h;V&&(h=i.ownerDocument.defaultView.scrollY),r.input.focus(),V&&i.ownerDocument.defaultView.scrollTo(null,h),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function b(){if(i.selectionStart!=null){var S=n.somethingSelected(),A="\u200B"+(S?i.value:"");i.value="\u21DA",i.value=A,t.prevInput=S?"":"\u200B",i.selectionStart=1,i.selectionEnd=A.length,r.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=c,i.style.cssText=s,F&&Z<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=a),i.selectionStart!=null)){(!F||F&&Z<9)&&b();var S=0,A=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?it(n,Ua)(n):S++<10?r.detectingSelectAll=setTimeout(A,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(A,200)}}if(F&&Z>=9&&b(),te){Xt(e);var k=function(){ut(window,"mouseup",k),setTimeout(v,20)};j(window,"mouseup",k)}else setTimeout(v,50)},$e.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},$e.prototype.setUneditable=function(){},$e.prototype.needsContentAttribute=!1;function Bc(e,t){if(t=t?$(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=ae(e.ownerDocument);t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=l.getValue()}var i;if(e.form&&(j(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&&(ut(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 Rc(e){e.off=ut,e.on=j,e.wheelEventPixels=_s,e.Doc=xt,e.splitLines=dn,e.countColumn=K,e.findColumn=Se,e.isWordChar=C,e.Pass=P,e.signal=Pe,e.Line=Er,e.changeEnd=vr,e.scrollbarModel=wa,e.Pos=g,e.cmpPos=x,e.modes=Ft,e.mimeModes=cr,e.resolveMode=Lt,e.getMode=ur,e.modeExtensions=dr,e.extendMode=qn,e.copyState=Qt,e.startState=fn,e.innerMode=fr,e.commands=Hn,e.keyMap=or,e.keyName=al,e.isModifierKey=il,e.lookupKey=Zr,e.normalizeKeyMap=gc,e.StringStream=Ue,e.SharedTextMarker=Pn,e.TextMarker=br,e.LineWidget=Dn,e.e_preventDefault=dt,e.e_stopPropagation=Sr,e.e_stop=Xt,e.addClass=me,e.contains=B,e.rmClass=N,e.keyNames=wr}Pc(Fe),Fc(Fe);var Vc="iter insert remove copy getEditor constructor".split(" ");for(var ki in xt.prototype)xt.prototype.hasOwnProperty(ki)&&U(Vc,ki)<0&&(Fe.prototype[ki]=function(e){return function(){return e.apply(this.doc,arguments)}}(xt.prototype[ki]));return mt(xt),Fe.inputStyles={textarea:$e,contenteditable:Me},Fe.defineMode=function(e){!Fe.defaults.mode&&e!="null"&&(Fe.defaults.mode=e),Gn.apply(this,arguments)},Fe.defineMIME=Fr,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){xt.prototype[e]=t},Fe.fromTextArea=Bc,Rc(Fe),Fe.version="5.65.12",Fe})}(Tt)),Tt.exports}var Ci=_e();const Bn=Dl(Ci);kr=(je=>(je.JSON="application/json",je.HTML="htmlmixed",je.JS="javascript",je))(kr||{});var Si={exports:{}};(function(je,Dt){(function(I){I(_e())})(function(I){I.defineMode("javascript",function(Te,q){var he=Te.indentUnit,Ee=q.statementIndent,le=q.jsonld,F=q.json||le,Z=q.trackScope!==!1,V=q.typescript,D=q.wordCharacters||/[\w$\xa1-\uffff]/,X=function(){function u(Xe){return{type:Xe,style:"keyword"}}var p=u("keyword a"),g=u("keyword b"),x=u("keyword c"),re=u("keyword d"),ge=u("operator"),xe={type:"atom",style:"atom"};return{if:u("if"),while:p,with:p,else:g,do:g,try:g,finally:g,return:re,break:re,continue:re,new:u("new"),delete:x,void:x,throw:x,debugger:u("debugger"),var:u("var"),const:u("var"),let:u("var"),function:u("function"),catch:u("catch"),for:u("for"),switch:u("switch"),case:u("case"),default:u("default"),in:ge,typeof:ge,instanceof:ge,true:xe,false:xe,null:xe,undefined:xe,NaN:xe,Infinity:xe,this:u("this"),class:u("class"),super:u("atom"),yield:x,export:u("export"),import:u("import"),extends:x,await:x}}(),pe=/[+\-*&%=<>!?|~^@]/,de=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function We(u){for(var p=!1,g,x=!1;(g=u.next())!=null;){if(!p){if(g=="/"&&!x)return;g=="["?x=!0:x&&g=="]"&&(x=!1)}p=!p&&g=="\\"}}var He,Oe;function oe(u,p,g){return He=u,Oe=g,p}function ee(u,p){var g=u.next();if(g=='"'||g=="'")return p.tokenize=ce(g),p.tokenize(u,p);if(g=="."&&u.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return oe("number","number");if(g=="."&&u.match(".."))return oe("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(g))return oe(g);if(g=="="&&u.eat(">"))return oe("=>","operator");if(g=="0"&&u.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return oe("number","number");if(/\d/.test(g))return u.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),oe("number","number");if(g=="/")return u.eat("*")?(p.tokenize=ve,ve(u,p)):u.eat("/")?(u.skipToEnd(),oe("comment","comment")):qt(u,p,1)?(We(u),u.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),oe("regexp","string-2")):(u.eat("="),oe("operator","operator",u.current()));if(g=="`")return p.tokenize=qe,qe(u,p);if(g=="#"&&u.peek()=="!")return u.skipToEnd(),oe("meta","meta");if(g=="#"&&u.eatWhile(D))return oe("variable","property");if(g=="<"&&u.match("!--")||g=="-"&&u.match("->")&&!/\S/.test(u.string.slice(0,u.start)))return u.skipToEnd(),oe("comment","comment");if(pe.test(g))return(g!=">"||!p.lexical||p.lexical.type!=">")&&(u.eat("=")?(g=="!"||g=="=")&&u.eat("="):/[<>*+\-|&?]/.test(g)&&(u.eat(g),g==">"&&u.eat(g))),g=="?"&&u.eat(".")?oe("."):oe("operator","operator",u.current());if(D.test(g)){u.eatWhile(D);var x=u.current();if(p.lastType!="."){if(X.propertyIsEnumerable(x)){var re=X[x];return oe(re.type,re.style,x)}if(x=="async"&&u.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return oe("async","keyword",x)}return oe("variable","variable",x)}}function ce(u){return function(p,g){var x=!1,re;if(le&&p.peek()=="@"&&p.match(de))return g.tokenize=ee,oe("jsonld-keyword","meta");for(;(re=p.next())!=null&&!(re==u&&!x);)x=!x&&re=="\\";return x||(g.tokenize=ee),oe("string","string")}}function ve(u,p){for(var g=!1,x;x=u.next();){if(x=="/"&&g){p.tokenize=ee;break}g=x=="*"}return oe("comment","comment")}function qe(u,p){for(var g=!1,x;(x=u.next())!=null;){if(!g&&(x=="`"||x=="$"&&u.eat("{"))){p.tokenize=ee;break}g=!g&&x=="\\"}return oe("quasi","string-2",u.current())}var ct="([{}])";function Re(u,p){p.fatArrowAt&&(p.fatArrowAt=null);var g=u.string.indexOf("=>",u.start);if(!(g<0)){if(V){var x=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(u.string.slice(u.start,g));x&&(g=x.index)}for(var re=0,ge=!1,xe=g-1;xe>=0;--xe){var Xe=u.string.charAt(xe),Ot=ct.indexOf(Xe);if(Ot>=0&&Ot<3){if(!re){++xe;break}if(--re==0){Xe=="("&&(ge=!0);break}}else if(Ot>=3&&Ot<6)++re;else if(D.test(Xe))ge=!0;else if(/["'\/`]/.test(Xe))for(;;--xe){if(xe==0)return;var ne=u.string.charAt(xe-1);if(ne==Xe&&u.string.charAt(xe-2)!="\\"){xe--;break}}else if(ge&&!re){++xe;break}}ge&&!re&&(p.fatArrowAt=xe)}}var ye={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function te(u,p,g,x,re,ge){this.indented=u,this.column=p,this.type=g,this.prev=re,this.info=ge,x!=null&&(this.align=x)}function m(u,p){if(!Z)return!1;for(var g=u.localVars;g;g=g.next)if(g.name==p)return!0;for(var x=u.context;x;x=x.prev)for(var g=x.vars;g;g=g.next)if(g.name==p)return!0}function N(u,p,g,x,re){var ge=u.cc;for(y.state=u,y.stream=re,y.marked=null,y.cc=ge,y.style=p,u.lexical.hasOwnProperty("align")||(u.lexical.align=!0);;){var xe=ge.length?ge.pop():F?P:U;if(xe(g,x)){for(;ge.length&&ge[ge.length-1].lex;)ge.pop()();return y.marked?y.marked:g=="variable"&&m(u,x)?"variable-2":p}}}var y={state:null,column:null,marked:null,cc:null};function T(){for(var u=arguments.length-1;u>=0;u--)y.cc.push(arguments[u])}function d(){return T.apply(null,arguments),!0}function W(u,p){for(var g=p;g;g=g.next)if(g.name==u)return!0;return!1}function M(u){var p=y.state;if(y.marked="def",!!Z){if(p.context){if(p.lexical.info=="var"&&p.context&&p.context.block){var g=B(u,p.context);if(g!=null){p.context=g;return}}else if(!W(u,p.localVars)){p.localVars=new Ze(u,p.localVars);return}}q.globalVars&&!W(u,p.globalVars)&&(p.globalVars=new Ze(u,p.globalVars))}}function B(u,p){if(p)if(p.block){var g=B(u,p.prev);return g?g==p.prev?p:new me(g,p.vars,!0):null}else return W(u,p.vars)?p:new me(p.prev,new Ze(u,p.vars),!1);else return null}function ae(u){return u=="public"||u=="private"||u=="protected"||u=="abstract"||u=="readonly"}function me(u,p,g){this.prev=u,this.vars=p,this.block=g}function Ze(u,p){this.name=u,this.next=p}var et=new Ze("this",new Ze("arguments",null));function Le(){y.state.context=new me(y.state.context,y.state.localVars,!1),y.state.localVars=et}function tt(){y.state.context=new me(y.state.context,y.state.localVars,!0),y.state.localVars=null}Le.lex=tt.lex=!0;function Ae(){y.state.localVars=y.state.context.vars,y.state.context=y.state.context.prev}Ae.lex=!0;function $(u,p){var g=function(){var x=y.state,re=x.indented;if(x.lexical.type=="stat")re=x.lexical.indented;else for(var ge=x.lexical;ge&&ge.type==")"&&ge.align;ge=ge.prev)re=ge.indented;x.lexical=new te(re,y.stream.column(),u,null,x.lexical,p)};return g.lex=!0,g}function K(){var u=y.state;u.lexical.prev&&(u.lexical.type==")"&&(u.indented=u.lexical.indented),u.lexical=u.lexical.prev)}K.lex=!0;function J(u){function p(g){return g==u?d():u==";"||g=="}"||g==")"||g=="]"?T():d(p)}return p}function U(u,p){return u=="var"?d($("vardef",p),Xt,J(";"),K):u=="keyword a"?d($("form"),be,U,K):u=="keyword b"?d($("form"),U,K):u=="keyword d"?y.stream.match(/^\s*$/,!1)?d():d($("stat"),Se,J(";"),K):u=="debugger"?d(J(";")):u=="{"?d($("}"),tt,Kt,K,Ae):u==";"?d():u=="if"?(y.state.lexical.info=="else"&&y.state.cc[y.state.cc.length-1]==K&&y.state.cc.pop()(),d($("form"),be,U,K,Hr)):u=="function"?d(Ut):u=="for"?d($("form"),tt,Kn,U,Ae,K):u=="class"||V&&p=="interface"?(y.marked="keyword",d($("form",u=="class"?u:p),Gn,K)):u=="variable"?V&&p=="declare"?(y.marked="keyword",d(U)):V&&(p=="module"||p=="enum"||p=="type")&&y.stream.match(/^\s*\w/,!1)?(y.marked="keyword",p=="enum"?d(jr):p=="type"?d(Un,J("operator"),j,J(";")):d($("form"),bt,J("{"),$("}"),Kt,K,K)):V&&p=="namespace"?(y.marked="keyword",d($("form"),P,U,K)):V&&p=="abstract"?(y.marked="keyword",d(U)):d($("stat"),se):u=="switch"?d($("form"),be,J("{"),$("}","switch"),tt,Kt,K,K,Ae):u=="case"?d(P,J(":")):u=="default"?d(J(":")):u=="catch"?d($("form"),Le,L,U,K,Ae):u=="export"?d($("stat"),dr,K):u=="import"?d($("stat"),Qt,K):u=="async"?d(U):p=="@"?d(P,U):T($("stat"),P,J(";"),K)}function L(u){if(u=="(")return d(Ft,J(")"))}function P(u,p){return Ne(u,p,!1)}function Q(u,p){return Ne(u,p,!0)}function be(u){return u!="("?T():d($(")"),Se,J(")"),K)}function Ne(u,p,g){if(y.state.fatArrowAt==y.stream.start){var x=g?we:Rt;if(u=="(")return d(Le,$(")"),Ve(Ft,")"),K,J("=>"),x,Ae);if(u=="variable")return T(Le,bt,J("=>"),x,Ae)}var re=g?ze:ue;return ye.hasOwnProperty(u)?d(re):u=="function"?d(Ut,re):u=="class"||V&&p=="interface"?(y.marked="keyword",d($("form"),cr,K)):u=="keyword c"||u=="async"?d(g?Q:P):u=="("?d($(")"),Se,J(")"),K,re):u=="operator"||u=="spread"?d(g?Q:P):u=="["?d($("]"),er,K,re):u=="{"?Cr(lr,"}",null,re):u=="quasi"?T(ie,re):u=="new"?d(w(g)):d()}function Se(u){return u.match(/[;\}\)\],]/)?T():T(P)}function ue(u,p){return u==","?d(Se):ze(u,p,!1)}function ze(u,p,g){var x=g==!1?ue:ze,re=g==!1?P:Q;if(u=="=>")return d(Le,g?we:Rt,Ae);if(u=="operator")return/\+\+|--/.test(p)||V&&p=="!"?d(x):V&&p=="<"&&y.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?d($(">"),Ve(j,">"),K,x):p=="?"?d(P,J(":"),re):d(re);if(u=="quasi")return T(ie,x);if(u!=";"){if(u=="(")return Cr(Q,")","call",x);if(u==".")return d(rt,x);if(u=="[")return d($("]"),Se,J("]"),K,x);if(V&&p=="as")return y.marked="keyword",d(j,x);if(u=="regexp")return y.state.lastType=y.marked="operator",y.stream.backUp(y.stream.pos-y.stream.start-1),d(re)}}function ie(u,p){return u!="quasi"?T():p.slice(p.length-2)!="${"?d(ie):d(Se,Ie)}function Ie(u){if(u=="}")return y.marked="string-2",y.state.tokenize=qe,d(ie)}function Rt(u){return Re(y.stream,y.state),T(u=="{"?U:P)}function we(u){return Re(y.stream,y.state),T(u=="{"?U:Q)}function w(u){return function(p){return p=="."?d(u?C:O):p=="variable"&&V?d(dt,u?ze:ue):T(u?Q:P)}}function O(u,p){if(p=="target")return y.marked="keyword",d(ue)}function C(u,p){if(p=="target")return y.marked="keyword",d(ze)}function se(u){return u==":"?d(K,U):T(ue,J(";"),K)}function rt(u){if(u=="variable")return y.marked="property",d()}function lr(u,p){if(u=="async")return y.marked="property",d(lr);if(u=="variable"||y.style=="keyword"){if(y.marked="property",p=="get"||p=="set")return d(ln);var g;return V&&y.state.fatArrowAt==y.stream.start&&(g=y.stream.match(/^\s*:\s*/,!1))&&(y.state.fatArrowAt=y.stream.pos+g[0].length),d(Vt)}else{if(u=="number"||u=="string")return y.marked=le?"property":y.style+" property",d(Vt);if(u=="jsonld-keyword")return d(Vt);if(V&&ae(p))return y.marked="keyword",d(lr);if(u=="[")return d(P,Pt,J("]"),Vt);if(u=="spread")return d(Q,Vt);if(p=="*")return y.marked="keyword",d(lr);if(u==":")return T(Vt)}}function ln(u){return u!="variable"?T(Vt):(y.marked="property",d(Ut))}function Vt(u){if(u==":")return d(Q);if(u=="(")return T(Ut)}function Ve(u,p,g){function x(re,ge){if(g?g.indexOf(re)>-1:re==","){var xe=y.state.lexical;return xe.info=="call"&&(xe.pos=(xe.pos||0)+1),d(function(Xe,Ot){return Xe==p||Ot==p?T():T(u)},x)}return re==p||ge==p?d():g&&g.indexOf(";")>-1?T(u):d(J(p))}return function(re,ge){return re==p||ge==p?d():T(u,x)}}function Cr(u,p,g){for(var x=3;x"),j);if(u=="quasi")return T(Ke,mt)}function sn(u){if(u=="=>")return d(j)}function ut(u){return u.match(/[\}\)\]]/)?d():u==","||u==";"?d(ut):T(Pe,ut)}function Pe(u,p){if(u=="variable"||y.style=="keyword")return y.marked="property",d(Pe);if(p=="?"||u=="number"||u=="string")return d(Pe);if(u==":")return d(j);if(u=="[")return d(J("variable"),Li,J("]"),Pe);if(u=="(")return T(Gt,Pe);if(!u.match(/[;\}\)\],]/))return d()}function Ke(u,p){return u!="quasi"?T():p.slice(p.length-2)!="${"?d(Ke):d(j,Vn)}function Vn(u){if(u=="}")return y.marked="string-2",y.state.tokenize=qe,d(Ke)}function pt(u,p){return u=="variable"&&y.stream.match(/^\s*[?:]/,!1)||p=="?"?d(pt):u==":"?d(j):u=="spread"?d(pt):T(j)}function mt(u,p){if(p=="<")return d($(">"),Ve(j,">"),K,mt);if(p=="|"||u=="."||p=="&")return d(j);if(u=="[")return d(j,J("]"),mt);if(p=="extends"||p=="implements")return y.marked="keyword",d(j);if(p=="?")return d(j,J(":"),j)}function dt(u,p){if(p=="<")return d($(">"),Ve(j,">"),K,mt)}function Sr(){return T(j,cn)}function cn(u,p){if(p=="=")return d(j)}function Xt(u,p){return p=="enum"?(y.marked="keyword",d(jr)):T(bt,Pt,zt,Ni)}function bt(u,p){if(V&&ae(p))return y.marked="keyword",d(bt);if(u=="variable")return M(p),d();if(u=="spread")return d(bt);if(u=="[")return Cr(Mi,"]");if(u=="{")return Cr(un,"}")}function un(u,p){return u=="variable"&&!y.stream.match(/^\s*:/,!1)?(M(p),d(zt)):(u=="variable"&&(y.marked="property"),u=="spread"?d(bt):u=="}"?T():u=="["?d(P,J("]"),J(":"),un):d(J(":"),bt,zt))}function Mi(){return T(bt,zt)}function zt(u,p){if(p=="=")return d(Q)}function Ni(u){if(u==",")return d(Xt)}function Hr(u,p){if(u=="keyword b"&&p=="else")return d($("form","else"),U,K)}function Kn(u,p){if(p=="await")return d(Kn);if(u=="(")return d($(")"),dn,K)}function dn(u){return u=="var"?d(Xt,sr):u=="variable"?d(sr):T(sr)}function sr(u,p){return u==")"?d():u==";"?d(sr):p=="in"||p=="of"?(y.marked="keyword",d(P,sr)):T(P,sr)}function Ut(u,p){if(p=="*")return y.marked="keyword",d(Ut);if(u=="variable")return M(p),d(Ut);if(u=="(")return d(Le,$(")"),Ve(Ft,")"),K,Wt,U,Ae);if(V&&p=="<")return d($(">"),Ve(Sr,">"),K,Ut)}function Gt(u,p){if(p=="*")return y.marked="keyword",d(Gt);if(u=="variable")return M(p),d(Gt);if(u=="(")return d(Le,$(")"),Ve(Ft,")"),K,Wt,Ae);if(V&&p=="<")return d($(">"),Ve(Sr,">"),K,Gt)}function Un(u,p){if(u=="keyword"||u=="variable")return y.marked="type",d(Un);if(p=="<")return d($(">"),Ve(Sr,">"),K)}function Ft(u,p){return p=="@"&&d(P,Ft),u=="spread"?d(Ft):V&&ae(p)?(y.marked="keyword",d(Ft)):V&&u=="this"?d(Pt,zt):T(bt,Pt,zt)}function cr(u,p){return u=="variable"?Gn(u,p):Fr(u,p)}function Gn(u,p){if(u=="variable")return M(p),d(Fr)}function Fr(u,p){if(p=="<")return d($(">"),Ve(Sr,">"),K,Fr);if(p=="extends"||p=="implements"||V&&u==",")return p=="implements"&&(y.marked="keyword"),d(V?j:P,Fr);if(u=="{")return d($("}"),Lt,K)}function Lt(u,p){if(u=="async"||u=="variable"&&(p=="static"||p=="get"||p=="set"||V&&ae(p))&&y.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return y.marked="keyword",d(Lt);if(u=="variable"||y.style=="keyword")return y.marked="property",d(ur,Lt);if(u=="number"||u=="string")return d(ur,Lt);if(u=="[")return d(P,Pt,J("]"),ur,Lt);if(p=="*")return y.marked="keyword",d(Lt);if(V&&u=="(")return T(Gt,Lt);if(u==";"||u==",")return d(Lt);if(u=="}")return d();if(p=="@")return d(P,Lt)}function ur(u,p){if(p=="!"||p=="?")return d(ur);if(u==":")return d(j,zt);if(p=="=")return d(Q);var g=y.state.lexical.prev,x=g&&g.info=="interface";return T(x?Gt:Ut)}function dr(u,p){return p=="*"?(y.marked="keyword",d(G,J(";"))):p=="default"?(y.marked="keyword",d(P,J(";"))):u=="{"?d(Ve(qn,"}"),G,J(";")):T(U)}function qn(u,p){if(p=="as")return y.marked="keyword",d(J("variable"));if(u=="variable")return T(Q,qn)}function Qt(u){return u=="string"?d():u=="("?T(P):u=="."?T(ue):T(fr,fn,G)}function fr(u,p){return u=="{"?Cr(fr,"}"):(u=="variable"&&M(p),p=="*"&&(y.marked="keyword"),d(Ue))}function fn(u){if(u==",")return d(fr,fn)}function Ue(u,p){if(p=="as")return y.marked="keyword",d(fr)}function G(u,p){if(p=="from")return y.marked="keyword",d(P)}function er(u){return u=="]"?d():T(Ve(Q,"]"))}function jr(){return T($("form"),bt,J("{"),$("}"),Ve(Ht,"}"),K,K)}function Ht(){return T(bt,zt)}function ke(u,p){return u.lastType=="operator"||u.lastType==","||pe.test(p.charAt(0))||/[,.]/.test(p.charAt(0))}function qt(u,p,g){return p.tokenize==ee&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(p.lastType)||p.lastType=="quasi"&&/\{\s*$/.test(u.string.slice(0,u.pos-(g||0)))}return{startState:function(u){var p={tokenize:ee,lastType:"sof",cc:[],lexical:new te((u||0)-he,0,"block",!1),localVars:q.localVars,context:q.localVars&&new me(null,null,!1),indented:u||0};return q.globalVars&&typeof q.globalVars=="object"&&(p.globalVars=q.globalVars),p},token:function(u,p){if(u.sol()&&(p.lexical.hasOwnProperty("align")||(p.lexical.align=!1),p.indented=u.indentation(),Re(u,p)),p.tokenize!=ve&&u.eatSpace())return null;var g=p.tokenize(u,p);return He=="comment"?g:(p.lastType=He=="operator"&&(Oe=="++"||Oe=="--")?"incdec":He,N(p,g,He,Oe,u))},indent:function(u,p){if(u.tokenize==ve||u.tokenize==qe)return I.Pass;if(u.tokenize!=ee)return 0;var g=p&&p.charAt(0),x=u.lexical,re;if(!/^\s*else\b/.test(p))for(var ge=u.cc.length-1;ge>=0;--ge){var xe=u.cc[ge];if(xe==K)x=x.prev;else if(xe!=Hr&&xe!=Ae)break}for(;(x.type=="stat"||x.type=="form")&&(g=="}"||(re=u.cc[u.cc.length-1])&&(re==ue||re==ze)&&!/^[,\.=+\-*:?[\(]/.test(p));)x=x.prev;Ee&&x.type==")"&&x.prev.type=="stat"&&(x=x.prev);var Xe=x.type,Ot=g==Xe;return Xe=="vardef"?x.indented+(u.lastType=="operator"||u.lastType==","?x.info.length+1:0):Xe=="form"&&g=="{"?x.indented:Xe=="form"?x.indented+he:Xe=="stat"?x.indented+(ke(u,p)?Ee||he:0):x.info=="switch"&&!Ot&&q.doubleIndentSwitch!=!1?x.indented+(/^(?:case|default)\b/.test(p)?he:2*he):x.align?x.column+(Ot?0:1):x.indented+(Ot?0:he)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:F?null:"/*",blockCommentEnd:F?null:"*/",blockCommentContinue:F?null:" * ",lineComment:F?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:F?"json":"javascript",jsonldMode:le,jsonMode:F,expressionAllowed:qt,skipExpression:function(u){N(u,"atom","atom","true",new I.StringStream("",2,null))}}}),I.registerHelper("wordChars","javascript",/[\w$]/),I.defineMIME("text/javascript","javascript"),I.defineMIME("text/ecmascript","javascript"),I.defineMIME("application/javascript","javascript"),I.defineMIME("application/x-javascript","javascript"),I.defineMIME("application/ecmascript","javascript"),I.defineMIME("application/json",{name:"javascript",json:!0}),I.defineMIME("application/x-json",{name:"javascript",json:!0}),I.defineMIME("application/manifest+json",{name:"javascript",json:!0}),I.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),I.defineMIME("text/typescript",{name:"javascript",typescript:!0}),I.defineMIME("application/typescript",{name:"javascript",typescript:!0})})})();var Ti=Si.exports,on={exports:{}};(function(je,Dt){(function(I){I(_e())})(function(I){I.defineMode("css",function(te,m){var N=m.inline;m.propertyKeywords||(m=I.resolveMode("text/css"));var y=te.indentUnit,T=m.tokenHooks,d=m.documentTypes||{},W=m.mediaTypes||{},M=m.mediaFeatures||{},B=m.mediaValueKeywords||{},ae=m.propertyKeywords||{},me=m.nonStandardPropertyKeywords||{},Ze=m.fontProperties||{},et=m.counterDescriptors||{},Le=m.colorKeywords||{},tt=m.valueKeywords||{},Ae=m.allowNested,$=m.lineComment,K=m.supportsAtComponent===!0,J=te.highlightNonStandardPropertyKeywords!==!1,U,L;function P(w,O){return U=O,w}function Q(w,O){var C=w.next();if(T[C]){var se=T[C](w,O);if(se!==!1)return se}if(C=="@")return w.eatWhile(/[\w\\\-]/),P("def",w.current());if(C=="="||(C=="~"||C=="|")&&w.eat("="))return P(null,"compare");if(C=='"'||C=="'")return O.tokenize=be(C),O.tokenize(w,O);if(C=="#")return w.eatWhile(/[\w\\\-]/),P("atom","hash");if(C=="!")return w.match(/^\s*\w*/),P("keyword","important");if(/\d/.test(C)||C=="."&&w.eat(/\d/))return w.eatWhile(/[\w.%]/),P("number","unit");if(C==="-"){if(/[\d.]/.test(w.peek()))return w.eatWhile(/[\w.%]/),P("number","unit");if(w.match(/^-[\w\\\-]*/))return w.eatWhile(/[\w\\\-]/),w.match(/^\s*:/,!1)?P("variable-2","variable-definition"):P("variable-2","variable");if(w.match(/^\w+-/))return P("meta","meta")}else return/[,+>*\/]/.test(C)?P(null,"select-op"):C=="."&&w.match(/^-?[_a-z][_a-z0-9-]*/i)?P("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(C)?P(null,C):w.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(w.current())&&(O.tokenize=Ne),P("variable callee","variable")):/[\w\\\-]/.test(C)?(w.eatWhile(/[\w\\\-]/),P("property","word")):P(null,null)}function be(w){return function(O,C){for(var se=!1,rt;(rt=O.next())!=null;){if(rt==w&&!se){w==")"&&O.backUp(1);break}se=!se&&rt=="\\"}return(rt==w||!se&&w!=")")&&(C.tokenize=null),P("string","string")}}function Ne(w,O){return w.next(),w.match(/^\s*[\"\')]/,!1)?O.tokenize=null:O.tokenize=be(")"),P(null,"(")}function Se(w,O,C){this.type=w,this.indent=O,this.prev=C}function ue(w,O,C,se){return w.context=new Se(C,O.indentation()+(se===!1?0:y),w.context),C}function ze(w){return w.context.prev&&(w.context=w.context.prev),w.context.type}function ie(w,O,C){return we[C.context.type](w,O,C)}function Ie(w,O,C,se){for(var rt=se||1;rt>0;rt--)C.context=C.context.prev;return ie(w,O,C)}function Rt(w){var O=w.current().toLowerCase();tt.hasOwnProperty(O)?L="atom":Le.hasOwnProperty(O)?L="keyword":L="variable"}var we={};return we.top=function(w,O,C){if(w=="{")return ue(C,O,"block");if(w=="}"&&C.context.prev)return ze(C);if(K&&/@component/i.test(w))return ue(C,O,"atComponentBlock");if(/^@(-moz-)?document$/i.test(w))return ue(C,O,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(w))return ue(C,O,"atBlock");if(/^@(font-face|counter-style)/i.test(w))return C.stateArg=w,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(w))return"keyframes";if(w&&w.charAt(0)=="@")return ue(C,O,"at");if(w=="hash")L="builtin";else if(w=="word")L="tag";else{if(w=="variable-definition")return"maybeprop";if(w=="interpolation")return ue(C,O,"interpolation");if(w==":")return"pseudo";if(Ae&&w=="(")return ue(C,O,"parens")}return C.context.type},we.block=function(w,O,C){if(w=="word"){var se=O.current().toLowerCase();return ae.hasOwnProperty(se)?(L="property","maybeprop"):me.hasOwnProperty(se)?(L=J?"string-2":"property","maybeprop"):Ae?(L=O.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(L+=" error","maybeprop")}else return w=="meta"?"block":!Ae&&(w=="hash"||w=="qualifier")?(L="error","block"):we.top(w,O,C)},we.maybeprop=function(w,O,C){return w==":"?ue(C,O,"prop"):ie(w,O,C)},we.prop=function(w,O,C){if(w==";")return ze(C);if(w=="{"&&Ae)return ue(C,O,"propBlock");if(w=="}"||w=="{")return Ie(w,O,C);if(w=="(")return ue(C,O,"parens");if(w=="hash"&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(O.current()))L+=" error";else if(w=="word")Rt(O);else if(w=="interpolation")return ue(C,O,"interpolation");return"prop"},we.propBlock=function(w,O,C){return w=="}"?ze(C):w=="word"?(L="property","maybeprop"):C.context.type},we.parens=function(w,O,C){return w=="{"||w=="}"?Ie(w,O,C):w==")"?ze(C):w=="("?ue(C,O,"parens"):w=="interpolation"?ue(C,O,"interpolation"):(w=="word"&&Rt(O),"parens")},we.pseudo=function(w,O,C){return w=="meta"?"pseudo":w=="word"?(L="variable-3",C.context.type):ie(w,O,C)},we.documentTypes=function(w,O,C){return w=="word"&&d.hasOwnProperty(O.current())?(L="tag",C.context.type):we.atBlock(w,O,C)},we.atBlock=function(w,O,C){if(w=="(")return ue(C,O,"atBlock_parens");if(w=="}"||w==";")return Ie(w,O,C);if(w=="{")return ze(C)&&ue(C,O,Ae?"block":"top");if(w=="interpolation")return ue(C,O,"interpolation");if(w=="word"){var se=O.current().toLowerCase();se=="only"||se=="not"||se=="and"||se=="or"?L="keyword":W.hasOwnProperty(se)?L="attribute":M.hasOwnProperty(se)?L="property":B.hasOwnProperty(se)?L="keyword":ae.hasOwnProperty(se)?L="property":me.hasOwnProperty(se)?L=J?"string-2":"property":tt.hasOwnProperty(se)?L="atom":Le.hasOwnProperty(se)?L="keyword":L="error"}return C.context.type},we.atComponentBlock=function(w,O,C){return w=="}"?Ie(w,O,C):w=="{"?ze(C)&&ue(C,O,Ae?"block":"top",!1):(w=="word"&&(L="error"),C.context.type)},we.atBlock_parens=function(w,O,C){return w==")"?ze(C):w=="{"||w=="}"?Ie(w,O,C,2):we.atBlock(w,O,C)},we.restricted_atBlock_before=function(w,O,C){return w=="{"?ue(C,O,"restricted_atBlock"):w=="word"&&C.stateArg=="@counter-style"?(L="variable","restricted_atBlock_before"):ie(w,O,C)},we.restricted_atBlock=function(w,O,C){return w=="}"?(C.stateArg=null,ze(C)):w=="word"?(C.stateArg=="@font-face"&&!Ze.hasOwnProperty(O.current().toLowerCase())||C.stateArg=="@counter-style"&&!et.hasOwnProperty(O.current().toLowerCase())?L="error":L="property","maybeprop"):"restricted_atBlock"},we.keyframes=function(w,O,C){return w=="word"?(L="variable","keyframes"):w=="{"?ue(C,O,"top"):ie(w,O,C)},we.at=function(w,O,C){return w==";"?ze(C):w=="{"||w=="}"?Ie(w,O,C):(w=="word"?L="tag":w=="hash"&&(L="builtin"),"at")},we.interpolation=function(w,O,C){return w=="}"?ze(C):w=="{"||w==";"?Ie(w,O,C):(w=="word"?L="variable":w!="variable"&&w!="("&&w!=")"&&(L="error"),"interpolation")},{startState:function(w){return{tokenize:null,state:N?"block":"top",stateArg:null,context:new Se(N?"block":"top",w||0,null)}},token:function(w,O){if(!O.tokenize&&w.eatSpace())return null;var C=(O.tokenize||Q)(w,O);return C&&typeof C=="object"&&(U=C[1],C=C[0]),L=C,U!="comment"&&(O.state=we[O.state](U,w,O)),L},indent:function(w,O){var C=w.context,se=O&&O.charAt(0),rt=C.indent;return C.type=="prop"&&(se=="}"||se==")")&&(C=C.prev),C.prev&&(se=="}"&&(C.type=="block"||C.type=="top"||C.type=="interpolation"||C.type=="restricted_atBlock")?(C=C.prev,rt=C.indent):(se==")"&&(C.type=="parens"||C.type=="atBlock_parens")||se=="{"&&(C.type=="at"||C.type=="atBlock"))&&(rt=Math.max(0,C.indent-y))),rt},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:$,fold:"brace"}});function Te(te){for(var m={},N=0;N")):null:d.match("--")?M(He("comment","-->")):d.match("DOCTYPE",!0,!0)?(d.eatWhile(/[\w\._\-]/),M(Oe(1))):null:d.eat("?")?(d.eatWhile(/[\w\._\-]/),W.tokenize=He("meta","?>"),"meta"):(D=d.eat("/")?"closeTag":"openTag",W.tokenize=de,"tag bracket");if(B=="&"){var ae;return d.eat("#")?d.eat("x")?ae=d.eatWhile(/[a-fA-F\d]/)&&d.eat(";"):ae=d.eatWhile(/[\d]/)&&d.eat(";"):ae=d.eatWhile(/[\w\.\-:]/)&&d.eat(";"),ae?"atom":"error"}else return d.eatWhile(/[^&<]/),null}pe.isInText=!0;function de(d,W){var M=d.next();if(M==">"||M=="/"&&d.eat(">"))return W.tokenize=pe,D=M==">"?"endTag":"selfcloseTag","tag bracket";if(M=="=")return D="equals",null;if(M=="<"){W.tokenize=pe,W.state=qe,W.tagName=W.tagStart=null;var B=W.tokenize(d,W);return B?B+" tag error":"tag error"}else return/[\'\"]/.test(M)?(W.tokenize=We(M),W.stringStartCol=d.column(),W.tokenize(d,W)):(d.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function We(d){var W=function(M,B){for(;!M.eol();)if(M.next()==d){B.tokenize=de;break}return"string"};return W.isInAttribute=!0,W}function He(d,W){return function(M,B){for(;!M.eol();){if(M.match(W)){B.tokenize=pe;break}M.next()}return d}}function Oe(d){return function(W,M){for(var B;(B=W.next())!=null;){if(B=="<")return M.tokenize=Oe(d+1),M.tokenize(W,M);if(B==">")if(d==1){M.tokenize=pe;break}else return M.tokenize=Oe(d-1),M.tokenize(W,M)}return"meta"}}function oe(d){return d&&d.toLowerCase()}function ee(d,W,M){this.prev=d.context,this.tagName=W||"",this.indent=d.indented,this.startOfLine=M,(F.doNotIndent.hasOwnProperty(W)||d.context&&d.context.noIndent)&&(this.noIndent=!0)}function ce(d){d.context&&(d.context=d.context.prev)}function ve(d,W){for(var M;;){if(!d.context||(M=d.context.tagName,!F.contextGrabbers.hasOwnProperty(oe(M))||!F.contextGrabbers[oe(M)].hasOwnProperty(oe(W))))return;ce(d)}}function qe(d,W,M){return d=="openTag"?(M.tagStart=W.column(),ct):d=="closeTag"?Re:qe}function ct(d,W,M){return d=="word"?(M.tagName=W.current(),X="tag",m):F.allowMissingTagName&&d=="endTag"?(X="tag bracket",m(d,W,M)):(X="error",ct)}function Re(d,W,M){if(d=="word"){var B=W.current();return M.context&&M.context.tagName!=B&&F.implicitlyClosed.hasOwnProperty(oe(M.context.tagName))&&ce(M),M.context&&M.context.tagName==B||F.matchClosing===!1?(X="tag",ye):(X="tag error",te)}else return F.allowMissingTagName&&d=="endTag"?(X="tag bracket",ye(d,W,M)):(X="error",te)}function ye(d,W,M){return d!="endTag"?(X="error",ye):(ce(M),qe)}function te(d,W,M){return X="error",ye(d,W,M)}function m(d,W,M){if(d=="word")return X="attribute",N;if(d=="endTag"||d=="selfcloseTag"){var B=M.tagName,ae=M.tagStart;return M.tagName=M.tagStart=null,d=="selfcloseTag"||F.autoSelfClosers.hasOwnProperty(oe(B))?ve(M,B):(ve(M,B),M.context=new ee(M,B,ae==M.indented)),qe}return X="error",m}function N(d,W,M){return d=="equals"?y:(F.allowMissing||(X="error"),m(d,W,M))}function y(d,W,M){return d=="string"?T:d=="word"&&F.allowUnquoted?(X="string",m):(X="error",m(d,W,M))}function T(d,W,M){return d=="string"?T:m(d,W,M)}return{startState:function(d){var W={tokenize:pe,state:qe,indented:d||0,tagName:null,tagStart:null,context:null};return d!=null&&(W.baseIndent=d),W},token:function(d,W){if(!W.tagName&&d.sol()&&(W.indented=d.indentation()),d.eatSpace())return null;D=null;var M=W.tokenize(d,W);return(M||D)&&M!="comment"&&(X=null,W.state=W.state(D||M,d,W),X&&(M=X=="error"?M+" error":X)),M},indent:function(d,W,M){var B=d.context;if(d.tokenize.isInAttribute)return d.tagStart==d.indented?d.stringStartCol+1:d.indented+le;if(B&&B.noIndent)return I.Pass;if(d.tokenize!=de&&d.tokenize!=pe)return M?M.match(/^(\s*)/)[0].length:0;if(d.tagName)return F.multilineTagIndentPastTag!==!1?d.tagStart+d.tagName.length+2:d.tagStart+le*(F.multilineTagIndentFactor||1);if(F.alignCDATA&&/$/,blockCommentStart:"",configuration:F.htmlMode?"html":"xml",helperType:F.htmlMode?"html":"xml",skipAttribute:function(d){d.state==y&&(d.state=m)},xmlCurrentTag:function(d){return d.tagName?{name:d.tagName,close:d.type=="closeTag"}:null},xmlCurrentContext:function(d){for(var W=[],M=d.context;M;M=M.prev)W.push(M.tagName);return W.reverse()}}}),I.defineMIME("text/xml","xml"),I.defineMIME("application/xml","xml"),I.mimeModes.hasOwnProperty("text/html")||I.defineMIME("text/html",{name:"xml",htmlMode:!0})})}()),an.exports}(function(je,Dt){(function(I){I(_e(),El(),Ti,Zt)})(function(I){var Te={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 q(D,X,pe){var de=D.current(),We=de.search(X);return We>-1?D.backUp(de.length-We):de.match(/<\/?$/)&&(D.backUp(de.length),D.match(X,!1)||D.match(de)),pe}var he={};function Ee(D){var X=he[D];return X||(he[D]=new RegExp("\\s+"+D+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function le(D,X){var pe=D.match(Ee(X));return pe?/^\s*(.*?)\s*$/.exec(pe[2])[1]:""}function F(D,X){return new RegExp((X?"^":"")+"","i")}function Z(D,X){for(var pe in D)for(var de=X[pe]||(X[pe]=[]),We=D[pe],He=We.length-1;He>=0;He--)de.unshift(We[He])}function V(D,X){for(var pe=0;pe=0;Oe--)de.script.unshift(["type",He[Oe].matches,He[Oe].mode]);function oe(ee,ce){var ve=pe.token(ee,ce.htmlState),qe=/\btag\b/.test(ve),ct;if(qe&&!/[<>\s\/]/.test(ee.current())&&(ct=ce.htmlState.tagName&&ce.htmlState.tagName.toLowerCase())&&de.hasOwnProperty(ct))ce.inTag=ct+" ";else if(ce.inTag&&qe&&/>$/.test(ee.current())){var Re=/^([\S]+) (.*)/.exec(ce.inTag);ce.inTag=null;var ye=ee.current()==">"&&V(de[Re[1]],Re[2]),te=I.getMode(D,ye),m=F(Re[1],!0),N=F(Re[1],!1);ce.token=function(y,T){return y.match(m,!1)?(T.token=oe,T.localState=T.localMode=null,null):q(y,N,T.localMode.token(y,T.localState))},ce.localMode=te,ce.localState=I.startState(te,pe.indent(ce.htmlState,"",""))}else ce.inTag&&(ce.inTag+=ee.current(),ee.eol()&&(ce.inTag+=" "));return ve}return{startState:function(){var ee=I.startState(pe);return{token:oe,inTag:null,localMode:null,localState:null,htmlState:ee}},copyState:function(ee){var ce;return ee.localState&&(ce=I.copyState(ee.localMode,ee.localState)),{token:ee.token,inTag:ee.inTag,localMode:ee.localMode,localState:ce,htmlState:I.copyState(pe,ee.htmlState)}},token:function(ee,ce){return ce.token(ee,ce)},indent:function(ee,ce,ve){return!ee.localMode||/^\s*<\//.test(ce)?pe.indent(ee.htmlState,ce,ve):ee.localMode.indent?ee.localMode.indent(ee.localState,ce,ve):I.Pass},innerMode:function(ee){return{state:ee.localState||ee.htmlState,mode:ee.localMode||pe}}}},"xml","javascript","css"),I.defineMIME("text/html","htmlmixed")})})();const Il=Co({__name:"CodeMirror",props:{mode:{type:String,default:kr.JSON,validator(je){return Object.values(kr).includes(je)}},value:{type:String,default:""},readonly:{type:Boolean,default:!1}},emits:["change"],setup(je,{emit:Dt}){const I=je,Te=Zc();let q;const he=qc(F,100),Ee=$c();Pl(()=>I.value,V=>nn(this,null,function*(){yield Wl();const D=q==null?void 0:q.getValue();V!==D&&(q==null||q.setValue(V||""))}),{flush:"post"}),Xc(()=>{q==null||q.setOption("mode",I.mode)}),Pl(()=>Ee.getDarkMode,()=>nn(this,null,function*(){le()}),{immediate:!0});function le(){var V;(V=zl(q))==null||V.setOption("theme",Ee.getDarkMode==="light"?"idea":"material-palenight")}function F(){q==null||q.refresh()}function Z(){return nn(this,null,function*(){const V={autoCloseBrackets:!0,autoCloseTags:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers"]};q=Bn(Te.value,Nl({value:"",mode:I.mode,readOnly:I.readonly,tabSize:2,theme:"material-palenight",lineWrapping:!0,lineNumbers:!0},V)),q==null||q.setValue(I.value),le(),q==null||q.on("change",()=>{Dt("change",q==null?void 0:q.getValue())})})}return Qc(()=>nn(this,null,function*(){yield Wl(),Z(),iu(he)})),eu(()=>{q=null}),(V,D)=>(So(),Hl("div",{class:"relative !h-full w-full overflow-hidden",ref_key:"el",ref:Te},null,512))}}),Bl={class:"h-full"},Rl=Co({__name:"CodeEditor",props:{value:{type:[Object,String]},mode:{type:String,default:kr.JSON,validator(je){return Object.values(kr).includes(je)}},readonly:{type:Boolean},autoFormat:{type:Boolean,default:!0}},emits:["change","update:value","format-error"],setup(je,{emit:Dt}){const I=je,Te=tu(()=>{const{value:he,mode:Ee,autoFormat:le}=I;if(!le||Ee!==kr.JSON)return he;let F=he;if(_c(he))try{F=JSON.parse(he)}catch(Z){return Dt("format-error",he),he}return JSON.stringify(F,null,2)});function q(he){Dt("update:value",he),Dt("change",he)}return(he,Ee)=>(So(),Hl("div",Bl,[ru(Il,{value:Te.value,onChange:q,mode:je.mode,readonly:je.readonly},null,8,["value","mode","readonly"])]))}});var Lo={exports:{}};(function(je,Dt){(function(I,Te){je.exports=Te(Yc)})(Al,function(I){return function(){var Te={789:function(le){le.exports=I}},q={};function he(le){var F=q[le];if(F!==void 0)return F.exports;var Z=q[le]={exports:{}};return Te[le](Z,Z.exports,he),Z.exports}he.d=function(le,F){for(var Z in F)he.o(F,Z)&&!he.o(le,Z)&&Object.defineProperty(le,Z,{enumerable:!0,get:F[Z]})},he.o=function(le,F){return Object.prototype.hasOwnProperty.call(le,F)},he.r=function(le){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(le,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(le,"__esModule",{value:!0})};var Ee={};return function(){function le(m,N){(N==null||N>m.length)&&(N=m.length);for(var y=0,T=new Array(N);y1&&arguments[1]!==void 0?arguments[1]:"root",y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,T=arguments.length>3?arguments[3]:void 0,d=T||{},W=d.key,M=d.index,B=d.type,ae=B===void 0?"content":B,me=d.showComma,Ze=me!==void 0&&me,et=d.length,Le=et===void 0?1:et,tt=He(m);if(tt==="array"){var Ae=oe(m.map(function(J,U,L){return Oe(J,"".concat(N,"[").concat(U,"]"),y+1,{index:U,showComma:U!==L.length-1,length:Le,type:ae})}));return[Oe("[",N,y,{showComma:!1,key:W,length:m.length,type:"arrayStart"})[0]].concat(Ae,Oe("]",N,y,{showComma:Ze,length:m.length,type:"arrayEnd"})[0])}if(tt==="object"){var $=Object.keys(m),K=oe($.map(function(J,U,L){return Oe(m[J],/^[a-zA-Z_]\w*$/.test(J)?"".concat(N,".").concat(J):"".concat(N,'["').concat(J,'"]'),y+1,{key:J,showComma:U!==L.length-1,length:Le,type:ae})}));return[Oe("{",N,y,{showComma:!1,key:W,index:M,length:$.length,type:"objectStart"})[0]].concat(K,Oe("}",N,y,{showComma:Ze,length:$.length,type:"objectEnd"})[0])}return[{content:m,level:y,key:W,index:M,path:N,showComma:Ze,length:Le,type:ae}]}function oe(m){if(typeof Array.prototype.flat=="function")return m.flat();for(var N=Z(m),y=[];N.length;){var T=N.shift();Array.isArray(T)?N.unshift.apply(N,Z(T)):y.push(T)}return y}function ee(m){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new WeakMap;if(m==null)return m;if(m instanceof Date)return new Date(m);if(m instanceof RegExp)return new RegExp(m);if(We(m)!=="object")return m;if(N.get(m))return N.get(m);if(Array.isArray(m)){var y=m.map(function(W){return ee(W,N)});return N.set(m,y),y}var T={};for(var d in m)T[d]=ee(m[d],N);return N.set(m,T),T}function ce(m,N){var y=Object.keys(m);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(m);N&&(T=T.filter(function(d){return Object.getOwnPropertyDescriptor(m,d).enumerable})),y.push.apply(y,T)}return y}function ve(m){for(var N=1;N=L,Se=(be=m.pathCollapsible)===null||be===void 0?void 0:be.call(m,Q);return Q.type!=="objectStart"&&Q.type!=="arrayStart"||!Ne&&!Se?P:ye(ye({},P),{},V({},Q.path,1))},{})},B=(0,D.reactive)({translateY:0,visibleData:null,hiddenPaths:M(m.deep)}),ae=(0,D.computed)(function(){for(var L=null,P=[],Q=W.value.length,be=0;beL.length?L.length-Q:Ne;Se<0&&(Se=0);var ue=Se+Q;B.translateY=Se*m.itemHeight,B.visibleData=L.filter(function(ze,ie){return ie>=Se&&ie(So(),nu(zl(Kl),{path:"res",deep:3,showLength:!0,data:je.data},null,8,["data"]))}}),Fl=Ol(Rl),jl=Ol(Mo)}));export{Fl as C,jl as J,kr as M,au as __tla};