@joinezco/codeblock 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/editor.d.ts +30 -3
- package/dist/editor.js +416 -43
- package/dist/index.d.ts +5 -1
- package/dist/index.js +5 -1
- package/dist/lsps/index.d.ts +5 -0
- package/dist/lsps/index.js +9 -2
- package/dist/lsps/typescript.d.ts +3 -1
- package/dist/lsps/typescript.js +8 -17
- package/dist/panels/settings.d.ts +22 -0
- package/dist/panels/settings.js +267 -0
- package/dist/panels/terminal.d.ts +3 -0
- package/dist/panels/terminal.js +76 -0
- package/dist/panels/toolbar.d.ts +53 -3
- package/dist/panels/toolbar.js +1336 -164
- package/dist/panels/toolbar.test.js +20 -14
- package/dist/rpc/transport.d.ts +2 -11
- package/dist/rpc/transport.js +19 -35
- package/dist/themes/index.js +226 -13
- package/dist/themes/vscode.js +3 -2
- package/dist/types.d.ts +5 -0
- package/dist/utils/fs.d.ts +22 -3
- package/dist/utils/fs.js +126 -21
- package/dist/utils/lsp.d.ts +26 -15
- package/dist/utils/lsp.js +79 -44
- package/dist/utils/search.d.ts +2 -0
- package/dist/utils/search.js +13 -4
- package/dist/utils/typescript-defaults.d.ts +57 -0
- package/dist/utils/typescript-defaults.js +208 -0
- package/dist/utils/typescript-defaults.test.d.ts +1 -0
- package/dist/utils/typescript-defaults.test.js +197 -0
- package/dist/workers/fs.worker.d.ts +4 -8
- package/dist/workers/fs.worker.js +30 -60
- package/dist/workers/javascript.worker.js +11 -9
- package/package.json +8 -4
- package/dist/assets/clike-C8IJ2oj_.js +0 -1
- package/dist/assets/cmake-BQqOBYOt.js +0 -1
- package/dist/assets/dockerfile-C_y-rIpk.js +0 -1
- package/dist/assets/fs.worker-BwEqZcql.ts +0 -109
- package/dist/assets/go-CTD25R5P.js +0 -1
- package/dist/assets/haskell-BWDZoCOh.js +0 -1
- package/dist/assets/index-9HdhmM_Y.js +0 -1
- package/dist/assets/index-C-QhPFHP.js +0 -3
- package/dist/assets/index-C3BnE2cG.js +0 -222
- package/dist/assets/index-CGx5MZO7.js +0 -6
- package/dist/assets/index-CIuq3uTk.js +0 -1
- package/dist/assets/index-CXFONXS8.js +0 -1
- package/dist/assets/index-D5Z27j1C.js +0 -1
- package/dist/assets/index-DWOBdRjn.js +0 -1
- package/dist/assets/index-Dvu-FFzd.js +0 -1
- package/dist/assets/index-Dx_VuNNd.js +0 -1
- package/dist/assets/index-I0dlv-r3.js +0 -1
- package/dist/assets/index-MGle_v2x.js +0 -1
- package/dist/assets/index-N-GE7HTU.js +0 -1
- package/dist/assets/index-aEsF5o-7.js +0 -2
- package/dist/assets/index-as7ELo0J.js +0 -1
- package/dist/assets/index-gUUzXNuP.js +0 -1
- package/dist/assets/index-pGm0qkrJ.js +0 -13
- package/dist/assets/javascript.worker-C1zGArKk.js +0 -527
- package/dist/assets/lua-BgMRiT3U.js +0 -1
- package/dist/assets/perl-CdXCOZ3F.js +0 -1
- package/dist/assets/process-Dw9K5EnD.js +0 -1357
- package/dist/assets/properties-C78fOPTZ.js +0 -1
- package/dist/assets/ruby-B2Rjki9n.js +0 -1
- package/dist/assets/shell-CjFT_Tl9.js +0 -1
- package/dist/assets/swift-BzpIVaGY.js +0 -1
- package/dist/assets/toml-BXUEaScT.js +0 -1
- package/dist/assets/vb-CmGdzxic.js +0 -1
- package/dist/e2e/example.spec.d.ts +0 -5
- package/dist/e2e/example.spec.js +0 -44
- package/dist/index.html +0 -16
- package/dist/resources/config.json +0 -13
- package/dist/snapshot.bin +0 -0
- package/dist/styles.css +0 -7
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-pGm0qkrJ.js","assets/index-D5Z27j1C.js","assets/index-C-QhPFHP.js","assets/index-Dvu-FFzd.js","assets/index-as7ELo0J.js","assets/index-Dx_VuNNd.js","assets/index-I0dlv-r3.js","assets/index-DWOBdRjn.js","assets/index-MGle_v2x.js","assets/index-9HdhmM_Y.js","assets/index-CGx5MZO7.js","assets/index-aEsF5o-7.js","assets/index-N-GE7HTU.js","assets/index-CIuq3uTk.js","assets/index-CXFONXS8.js","assets/index-gUUzXNuP.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=t(i);fetch(i.href,s)}})();let hw=[],vI=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?vI:hw).push(t=t+n[e])})();function M7(n){if(n<768)return!1;for(let e=0,t=hw.length;;){let r=e+t>>1;if(n<hw[r])t=r;else if(n>=vI[r])e=r+1;else return!0;if(e==t)return!1}}function $C(n){return n>=127462&&n<=127487}const zC=8205;function O7(n,e,t=!0,r=!0){return(t?bI:P7)(n,e,r)}function bI(n,e,t){if(e==n.length)return e;e&&wI(n.charCodeAt(e))&&_I(n.charCodeAt(e-1))&&e--;let r=Wv(n,e);for(e+=UC(r);e<n.length;){let i=Wv(n,e);if(r==zC||i==zC||t&&M7(i))e+=UC(i),r=i;else if($C(i)){let s=0,o=e-2;for(;o>=0&&$C(Wv(n,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function P7(n,e,t){for(;e>0;){let r=bI(n,e-2,t);if(r<e)return r;e--}return 0}function Wv(n,e){let t=n.charCodeAt(e);if(!_I(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return wI(r)?(t-55296<<10)+(r-56320)+65536:t}function wI(n){return n>=56320&&n<57344}function _I(n){return n>=55296&&n<56320}function UC(n){return n<65536?1:2}class vt{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,r){[e,t]=Tc(this,e,t);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(t,this.length,i,1),io.from(i,this.length-(t-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Tc(this,e,t);let r=[];return this.decompose(e,t,r,0),io.from(r,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new ad(this),s=new ad(e);for(let o=t,a=t;;){if(i.next(o),s.next(o),o=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(e=1){return new ad(this,e)}iterRange(e,t=this.length){return new kI(this,e,t)}iterLines(e,t){let r;if(e==null)r=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new xI(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?vt.empty:e.length<=32?new Sn(e):io.from(Sn.split(e,[]))}}class Sn extends vt{constructor(e,t=L7(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,r,i){for(let s=0;;s++){let o=this.text[s],a=i+o.length;if((t?r:a)>=e)return new F7(i,a,r,o);i=a+1,r++}}decompose(e,t,r,i){let s=e<=0&&t>=this.length?this:new Sn(HC(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let o=r.pop(),a=cm(s.text,o.text.slice(),0,s.length);if(a.length<=32)r.push(new Sn(a,o.length+s.length));else{let u=a.length>>1;r.push(new Sn(a.slice(0,u)),new Sn(a.slice(u)))}}else r.push(s)}replace(e,t,r){if(!(r instanceof Sn))return super.replace(e,t,r);[e,t]=Tc(this,e,t);let i=cm(this.text,cm(r.text,HC(this.text,0,e)),t),s=this.length+r.length-(t-e);return i.length<=32?new Sn(i,s):io.from(Sn.split(i,[]),s)}sliceString(e,t=this.length,r=`
|
|
3
|
-
`){[e,t]=Tc(this,e,t);let i="";for(let s=0,o=0;s<=t&&o<this.text.length;o++){let a=this.text[o],u=s+a.length;s>e&&o&&(i+=r),e<u&&t>s&&(i+=a.slice(Math.max(0,e-s),t-s)),s=u+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let r=[],i=-1;for(let s of e)r.push(s),i+=s.length+1,r.length==32&&(t.push(new Sn(r,i)),r=[],i=-1);return i>-1&&t.push(new Sn(r,i)),t}}class io extends vt{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,t,r,i){for(let s=0;;s++){let o=this.children[s],a=i+o.length,u=r+o.lines-1;if((t?u:a)>=e)return o.lineInner(e,t,r,i);i=a+1,r=u+1}}decompose(e,t,r,i){for(let s=0,o=0;o<=t&&s<this.children.length;s++){let a=this.children[s],u=o+a.length;if(e<=u&&t>=o){let l=i&((o<=e?1:0)|(u>=t?2:0));o>=e&&u<=t&&!l?r.push(a):a.decompose(e-o,t-o,r,l)}o=u+1}}replace(e,t,r){if([e,t]=Tc(this,e,t),r.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let o=this.children[i],a=s+o.length;if(e>=s&&t<=a){let u=o.replace(e-s,t-s,r),l=this.lines-o.lines+u.lines;if(u.lines<l>>4&&u.lines>l>>6){let c=this.children.slice();return c[i]=u,new io(c,this.length-(t-e)+r.length)}return super.replace(s,a,u)}s=a+1}return super.replace(e,t,r)}sliceString(e,t=this.length,r=`
|
|
4
|
-
`){[e,t]=Tc(this,e,t);let i="";for(let s=0,o=0;s<this.children.length&&o<=t;s++){let a=this.children[s],u=o+a.length;o>e&&s&&(i+=r),e<u&&t>o&&(i+=a.sliceString(e-o,t-o,r)),o=u+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof io))return 0;let r=0,[i,s,o,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,s+=t){if(i==o||s==a)return r;let u=this.children[i],l=e.children[s];if(u!=l)return r+u.scanIdentical(l,t);r+=u.length+1}}static from(e,t=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let g of e)r+=g.lines;if(r<32){let g=[];for(let m of e)m.flatten(g);return new Sn(g,t)}let i=Math.max(32,r>>5),s=i<<1,o=i>>1,a=[],u=0,l=-1,c=[];function f(g){let m;if(g.lines>s&&g instanceof io)for(let y of g.children)f(y);else g.lines>o&&(u>o||!u)?(d(),a.push(g)):g instanceof Sn&&u&&(m=c[c.length-1])instanceof Sn&&g.lines+m.lines<=32?(u+=g.lines,l+=g.length+1,c[c.length-1]=new Sn(m.text.concat(g.text),m.length+1+g.length)):(u+g.lines>i&&d(),u+=g.lines,l+=g.length+1,c.push(g))}function d(){u!=0&&(a.push(c.length==1?c[0]:io.from(c,l)),l=-1,u=c.length=0)}for(let g of e)f(g);return d(),a.length==1?a[0]:new io(a,t)}}vt.empty=new Sn([""],0);function L7(n){let e=-1;for(let t of n)e+=t.length+1;return e}function cm(n,e,t=0,r=1e9){for(let i=0,s=0,o=!0;s<n.length&&i<=r;s++){let a=n[s],u=i+a.length;u>=t&&(u>r&&(a=a.slice(0,r-i)),i<t&&(a=a.slice(t-i)),o?(e[e.length-1]+=a,o=!1):e.push(a)),i=u+1}return e}function HC(n,e,t){return cm(n,[""],e,t)}class ad{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof Sn?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],s=this.offsets[r],o=s>>1,a=i instanceof Sn?i.text.length:i.children.length;if(o==(t>0?a:0)){if(r==0)return this.done=!0,this.value="",this;t>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[r]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
5
|
-
`,this;e--}else if(i instanceof Sn){let u=i.text[o+(t<0?-1:0)];if(this.offsets[r]+=t,u.length>Math.max(0,e))return this.value=e==0?u:t>0?u.slice(e):u.slice(0,u.length-e),this;e-=u.length}else{let u=i.children[o+(t<0?-1:0)];e>u.length?(e-=u.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,this.nodes.push(u),this.offsets.push(t>0?1:(u instanceof Sn?u.text.length:u.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class kI{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new ad(e,t>r?-1:1),this.pos=t>r?e.length:0,this.from=Math.min(t,r),this.to=Math.max(t,r)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let r=t<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=r?i:t<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class xI{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:r,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(vt.prototype[Symbol.iterator]=function(){return this.iter()},ad.prototype[Symbol.iterator]=kI.prototype[Symbol.iterator]=xI.prototype[Symbol.iterator]=function(){return this});class F7{constructor(e,t,r,i){this.from=e,this.to=t,this.number=r,this.text=i}get length(){return this.to-this.from}}function Tc(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function ur(n,e,t=!0,r=!0){return O7(n,e,t,r)}function N7(n){return n>=56320&&n<57344}function B7(n){return n>=55296&&n<56320}function oi(n,e){let t=n.charCodeAt(e);if(!B7(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return N7(r)?(t-55296<<10)+(r-56320)+65536:t}function Q2(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function so(n){return n<65536?1:2}const dw=/\r\n?|\n/;var ar=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(ar||(ar={}));class mo{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let r=this.sections[t+1];e+=r<0?this.sections[t]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,r=0,i=0;t<this.sections.length;){let s=this.sections[t++],o=this.sections[t++];o<0?(e(r,i,s),i+=s):i+=o,r+=s}}iterChangedRanges(e,t=!1){pw(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let r=this.sections[t++],i=this.sections[t++];i<0?e.push(r,i):e.push(i,r)}return new mo(e)}composeDesc(e){return this.empty?e:e.empty?this:SI(this,e)}mapDesc(e,t=!1){return e.empty?this:gw(this,e,t)}mapPos(e,t=-1,r=ar.Simple){let i=0,s=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],u=this.sections[o++],l=i+a;if(u<0){if(l>e)return s+(e-i);s+=a}else{if(r!=ar.Simple&&l>=e&&(r==ar.TrackDel&&i<e&&l>e||r==ar.TrackBefore&&i<e||r==ar.TrackAfter&&l>e))return null;if(l>e||l==e&&t<0&&!a)return e==i||t<0?s:s+u;s+=u}i=l}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,t=e){for(let r=0,i=0;r<this.sections.length&&i<=t;){let s=this.sections[r++],o=this.sections[r++],a=i+s;if(o>=0&&i<=t&&a>=e)return i<e&&a>t?"cover":!0;i=a}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let r=this.sections[t++],i=this.sections[t++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new mo(e)}static create(e){return new mo(e)}}class On extends mo{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return pw(this,(t,r,i,s,o)=>e=e.replace(i,i+(r-t),o),!1),e}mapDesc(e,t=!1){return gw(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let i=0,s=0;i<t.length;i+=2){let o=t[i],a=t[i+1];if(a>=0){t[i]=a,t[i+1]=o;let u=i>>1;for(;r.length<u;)r.push(vt.empty);r.push(o?e.slice(s,s+o):vt.empty)}s+=o}return new On(t,r)}compose(e){return this.empty?e:e.empty?this:SI(this,e,!0)}map(e,t=!1){return e.empty?this:gw(this,e,t,!0)}iterChanges(e,t=!1){pw(this,e,t)}get desc(){return mo.create(this.sections)}filter(e){let t=[],r=[],i=[],s=new yd(this);e:for(let o=0,a=0;;){let u=o==e.length?1e9:e[o++];for(;a<u||a==u&&s.len==0;){if(s.done)break e;let c=Math.min(s.len,u-a);_r(i,c,-1);let f=s.ins==-1?-1:s.off==0?s.ins:0;_r(t,c,f),f>0&&Va(r,t,s.text),s.forward(c),a+=c}let l=e[o++];for(;a<l;){if(s.done)break e;let c=Math.min(s.len,l-a);_r(t,c,-1),_r(i,c,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(c),a+=c}}return{changes:new On(t,r),filtered:mo.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let r=this.sections[t],i=this.sections[t+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,r){let i=[],s=[],o=0,a=null;function u(c=!1){if(!c&&!i.length)return;o<t&&_r(i,t-o,-1);let f=new On(i,s);a=a?a.compose(f.map(a)):f,i=[],s=[],o=0}function l(c){if(Array.isArray(c))for(let f of c)l(f);else if(c instanceof On){if(c.length!=t)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${t})`);u(),a=a?a.compose(c.map(a)):c}else{let{from:f,to:d=f,insert:g}=c;if(f>d||f<0||d>t)throw new RangeError(`Invalid change range ${f} to ${d} (in doc of length ${t})`);let m=g?typeof g=="string"?vt.of(g.split(r||dw)):g:vt.empty,y=m.length;if(f==d&&y==0)return;f<o&&u(),f>o&&_r(i,f-o,-1),_r(i,d-f,y),Va(s,i,m),o=d}}return l(e),u(!a),a}static empty(e){return new On(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],r=[];for(let i=0;i<e.length;i++){let s=e[i];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,a)=>a&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;r.length<i;)r.push(vt.empty);r[i]=vt.of(s.slice(1)),t.push(s[0],r[i].length)}}}return new On(t,r)}static createSet(e,t){return new On(e,t)}}function _r(n,e,t,r=!1){if(e==0&&t<=0)return;let i=n.length-2;i>=0&&t<=0&&t==n[i+1]?n[i]+=e:i>=0&&e==0&&n[i]==0?n[i+1]+=t:r?(n[i]+=e,n[i+1]+=t):n.push(e,t)}function Va(n,e,t){if(t.length==0)return;let r=e.length-2>>1;if(r<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<r;)n.push(vt.empty);n.push(t)}}function pw(n,e,t){let r=n.inserted;for(let i=0,s=0,o=0;o<n.sections.length;){let a=n.sections[o++],u=n.sections[o++];if(u<0)i+=a,s+=a;else{let l=i,c=s,f=vt.empty;for(;l+=a,c+=u,u&&r&&(f=f.append(r[o-2>>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)a=n.sections[o++],u=n.sections[o++];e(i,l,s,c,f),i=l,s=c}}}function gw(n,e,t,r=!1){let i=[],s=r?[]:null,o=new yd(n),a=new yd(e);for(let u=-1;;){if(o.done&&a.len||a.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&a.ins==-1){let l=Math.min(o.len,a.len);_r(i,l,-1),o.forward(l),a.forward(l)}else if(a.ins>=0&&(o.ins<0||u==o.i||o.off==0&&(a.len<o.len||a.len==o.len&&!t))){let l=a.len;for(_r(i,a.ins,-1);l;){let c=Math.min(o.len,l);o.ins>=0&&u<o.i&&o.len<=c&&(_r(i,0,o.ins),s&&Va(s,i,o.text),u=o.i),o.forward(c),l-=c}a.next()}else if(o.ins>=0){let l=0,c=o.len;for(;c;)if(a.ins==-1){let f=Math.min(c,a.len);l+=f,c-=f,a.forward(f)}else if(a.ins==0&&a.len<c)c-=a.len,a.next();else break;_r(i,l,u<o.i?o.ins:0),s&&u<o.i&&Va(s,i,o.text),u=o.i,o.forward(o.len-c)}else{if(o.done&&a.done)return s?On.createSet(i,s):mo.create(i);throw new Error("Mismatched change set lengths")}}}function SI(n,e,t=!1){let r=[],i=t?[]:null,s=new yd(n),o=new yd(e);for(let a=!1;;){if(s.done&&o.done)return i?On.createSet(r,i):mo.create(r);if(s.ins==0)_r(r,s.len,0,a),s.next();else if(o.len==0&&!o.done)_r(r,0,o.ins,a),i&&Va(i,r,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let u=Math.min(s.len2,o.len),l=r.length;if(s.ins==-1){let c=o.ins==-1?-1:o.off?0:o.ins;_r(r,u,c,a),i&&c&&Va(i,r,o.text)}else o.ins==-1?(_r(r,s.off?0:s.len,u,a),i&&Va(i,r,s.textBit(u))):(_r(r,s.off?0:s.len,o.off?0:o.ins,a),i&&!o.off&&Va(i,r,o.text));a=(s.ins>u||o.ins>=0&&o.len>u)&&(a||r.length>l),s.forward2(u),o.forward(u)}}}}class yd{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?vt.empty:e[t]}textBit(e){let{inserted:t}=this.set,r=this.i-2>>1;return r>=t.length&&!e?vt.empty:t[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}let Rg=class mw{constructor(e,t,r){this.from=e,this.to=t,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,t):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new mw(r,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return me.range(e,t);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return me.range(this.anchor,r)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return me.range(e.anchor,e.head)}static create(e,t,r){return new mw(e,t,r)}};class me{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:me.create(this.ranges.map(r=>r.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new me([this.main],0)}addRange(e,t=!0){return me.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let r=this.ranges.slice();return r[t]=e,me.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new me(e.ranges.map(t=>Rg.fromJSON(t)),e.main)}static single(e,t=e){return new me([me.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<e.length;i++){let s=e[i];if(s.empty?s.from<=r:s.from<r)return me.normalized(e.slice(),t);r=s.to}return new me(e,t)}static cursor(e,t=0,r,i){return Rg.create(e,e,(t==0?0:t<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(e,t,r,i){let s=(r??16777215)<<6|(i==null?7:Math.min(6,i));return t<e?Rg.create(t,e,48|s):Rg.create(e,t,(t>e?8:0)|s)}static normalized(e,t=0){let r=e[t];e.sort((i,s)=>i.from-s.from),t=e.indexOf(r);for(let i=1;i<e.length;i++){let s=e[i],o=e[i-1];if(s.empty?s.from<=o.to:s.from<o.to){let a=o.from,u=Math.max(s.to,o.to);i<=t&&t--,e.splice(--i,2,s.anchor>s.head?me.range(u,a):me.range(a,u))}}return new me(e,t)}}function CI(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let ek=0;class Re{constructor(e,t,r,i,s){this.combine=e,this.compareInput=t,this.compare=r,this.isStatic=i,this.id=ek++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new Re(e.combine||(t=>t),e.compareInput||((t,r)=>t===r),e.compare||(e.combine?(t,r)=>t===r:tk),!!e.static,e.enables)}of(e){return new fm([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new fm(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new fm(e,this,2,t)}from(e,t){return t||(t=r=>r),this.compute([e],r=>t(r.field(e)))}}function tk(n,e){return n==e||n.length==e.length&&n.every((t,r)=>t===e[r])}class fm{constructor(e,t,r,i){this.dependencies=e,this.facet=t,this.type=r,this.value=i,this.id=ek++}dynamicSlot(e){var t;let r=this.value,i=this.facet.compareInput,s=this.id,o=e[s]>>1,a=this.type==2,u=!1,l=!1,c=[];for(let f of this.dependencies)f=="doc"?u=!0:f=="selection"?l=!0:(((t=e[f.id])!==null&&t!==void 0?t:1)&1)==0&&c.push(e[f.id]);return{create(f){return f.values[o]=r(f),1},update(f,d){if(u&&d.docChanged||l&&(d.docChanged||d.selection)||yw(f,c)){let g=r(f);if(a?!VC(g,f.values[o],i):!i(g,f.values[o]))return f.values[o]=g,1}return 0},reconfigure:(f,d)=>{let g,m=d.config.address[s];if(m!=null){let y=Im(d,m);if(this.dependencies.every(b=>b instanceof Re?d.facet(b)===f.facet(b):b instanceof Tn?d.field(b,!1)==f.field(b,!1):!0)||(a?VC(g=r(f),y,i):i(g=r(f),y)))return f.values[o]=y,0}else g=r(f);return f.values[o]=g,1}}}}function VC(n,e,t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!t(n[r],e[r]))return!1;return!0}function yw(n,e){let t=!1;for(let r of e)ud(n,r)&1&&(t=!0);return t}function q7(n,e,t){let r=t.map(u=>n[u.id]),i=t.map(u=>u.type),s=r.filter(u=>!(u&1)),o=n[e.id]>>1;function a(u){let l=[];for(let c=0;c<r.length;c++){let f=Im(u,r[c]);if(i[c]==2)for(let d of f)l.push(d);else l.push(f)}return e.combine(l)}return{create(u){for(let l of r)ud(u,l);return u.values[o]=a(u),1},update(u,l){if(!yw(u,s))return 0;let c=a(u);return e.compare(c,u.values[o])?0:(u.values[o]=c,1)},reconfigure(u,l){let c=yw(u,r),f=l.config.facets[e.id],d=l.facet(e);if(f&&!c&&tk(t,f))return u.values[o]=d,0;let g=a(u);return e.compare(g,d)?(u.values[o]=d,0):(u.values[o]=g,1)}}}const Dg=Re.define({static:!0});class Tn{constructor(e,t,r,i,s){this.id=e,this.createF=t,this.updateF=r,this.compareF=i,this.spec=s,this.provides=void 0}static define(e){let t=new Tn(ek++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Dg).find(r=>r.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:r=>(r.values[t]=this.create(r),1),update:(r,i)=>{let s=r.values[t],o=this.updateF(s,i);return this.compareF(s,o)?0:(r.values[t]=o,1)},reconfigure:(r,i)=>{let s=r.facet(Dg),o=i.facet(Dg),a;return(a=s.find(u=>u.field==this))&&a!=o.find(u=>u.field==this)?(r.values[t]=a.create(r),1):i.config.address[this.id]!=null?(r.values[t]=i.field(this),0):(r.values[t]=this.create(r),1)}}}init(e){return[this,Dg.of({field:this,create:e})]}get extension(){return this}}const Zu={lowest:4,low:3,default:2,high:1,highest:0};function Qf(n){return e=>new EI(e,n)}const hu={highest:Qf(Zu.highest),high:Qf(Zu.high),default:Qf(Zu.default),low:Qf(Zu.low),lowest:Qf(Zu.lowest)};class EI{constructor(e,t){this.inner=e,this.prec=t}}class ga{of(e){return new vw(this,e)}reconfigure(e){return ga.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class vw{constructor(e,t){this.compartment=e,this.inner=t}}class Tm{constructor(e,t,r,i,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=r,this.address=i,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,r){let i=[],s=Object.create(null),o=new Map;for(let d of W7(e,t,o))d instanceof Tn?i.push(d):(s[d.facet.id]||(s[d.facet.id]=[])).push(d);let a=Object.create(null),u=[],l=[];for(let d of i)a[d.id]=l.length<<1,l.push(g=>d.slot(g));let c=r?.config.facets;for(let d in s){let g=s[d],m=g[0].facet,y=c&&c[d]||[];if(g.every(b=>b.type==0))if(a[m.id]=u.length<<1|1,tk(y,g))u.push(r.facet(m));else{let b=m.combine(g.map(w=>w.value));u.push(r&&m.compare(b,r.facet(m))?r.facet(m):b)}else{for(let b of g)b.type==0?(a[b.id]=u.length<<1|1,u.push(b.value)):(a[b.id]=l.length<<1,l.push(w=>b.dynamicSlot(w)));a[m.id]=l.length<<1,l.push(b=>q7(b,m,g))}}let f=l.map(d=>d(a));return new Tm(e,o,f,a,u,s)}}function W7(n,e,t){let r=[[],[],[],[],[]],i=new Map;function s(o,a){let u=i.get(o);if(u!=null){if(u<=a)return;let l=r[u].indexOf(o);l>-1&&r[u].splice(l,1),o instanceof vw&&t.delete(o.compartment)}if(i.set(o,a),Array.isArray(o))for(let l of o)s(l,a);else if(o instanceof vw){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let l=e.get(o.compartment)||o.inner;t.set(o.compartment,l),s(l,a)}else if(o instanceof EI)s(o.inner,o.prec);else if(o instanceof Tn)r[a].push(o),o.provides&&s(o.provides,a);else if(o instanceof fm)r[a].push(o),o.facet.extensions&&s(o.facet.extensions,Zu.default);else{let l=o.extension;if(!l)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(l,a)}}return s(n,Zu.default),r.reduce((o,a)=>o.concat(a))}function ud(n,e){if(e&1)return 2;let t=e>>1,r=n.status[t];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;n.status[t]=4;let i=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|i}function Im(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const AI=Re.define(),bw=Re.define({combine:n=>n.some(e=>e),static:!0}),RI=Re.define({combine:n=>n.length?n[0]:void 0,static:!0}),DI=Re.define(),TI=Re.define(),II=Re.define(),MI=Re.define({combine:n=>n.length?n[0]:!1});class ma{constructor(e,t){this.type=e,this.value=t}static define(){return new j7}}class j7{of(e){return new ma(this,e)}}class $7{constructor(e){this.map=e}of(e){return new Ve(this,e)}}class Ve{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new Ve(this.type,t)}is(e){return this.type==e}static define(e={}){return new $7(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let r=[];for(let i of e){let s=i.map(t);s&&r.push(s)}return r}}Ve.reconfigure=Ve.define();Ve.appendConfig=Ve.define();class Dn{constructor(e,t,r,i,s,o){this.startState=e,this.changes=t,this.selection=r,this.effects=i,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,r&&CI(r,t.newLength),s.some(a=>a.type==Dn.time)||(this.annotations=s.concat(Dn.time.of(Date.now())))}static create(e,t,r,i,s,o){return new Dn(e,t,r,i,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Dn.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}Dn.time=ma.define();Dn.userEvent=ma.define();Dn.addToHistory=ma.define();Dn.remote=ma.define();function z7(n,e){let t=[];for(let r=0,i=0;;){let s,o;if(r<n.length&&(i==e.length||e[i]>=n[r]))s=n[r++],o=n[r++];else if(i<e.length)s=e[i++],o=e[i++];else return t;!t.length||t[t.length-1]<s?t.push(s,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function OI(n,e,t){var r;let i,s,o;return t?(i=e.changes,s=On.empty(e.changes.length),o=n.changes.compose(e.changes)):(i=e.changes.map(n.changes),s=n.changes.mapDesc(e.changes,!0),o=n.changes.compose(i)),{changes:o,selection:e.selection?e.selection.map(s):(r=n.selection)===null||r===void 0?void 0:r.map(i),effects:Ve.mapEffects(n.effects,i).concat(Ve.mapEffects(e.effects,s)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function ww(n,e,t){let r=e.selection,i=vc(e.annotations);return e.userEvent&&(i=i.concat(Dn.userEvent.of(e.userEvent))),{changes:e.changes instanceof On?e.changes:On.of(e.changes||[],t,n.facet(RI)),selection:r&&(r instanceof me?r:me.single(r.anchor,r.head)),effects:vc(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function PI(n,e,t){let r=ww(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(t=!1);let o=!!e[s].sequential;r=OI(r,ww(n,e[s],o?r.changes.newLength:n.doc.length),o)}let i=Dn.create(n,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return H7(t?U7(i):i)}function U7(n){let e=n.startState,t=!0;for(let i of e.facet(DI)){let s=i(n);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:z7(t,s))}if(t!==!0){let i,s;if(t===!1)s=n.changes.invertedDesc,i=On.empty(e.doc.length);else{let o=n.changes.filter(t);i=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}n=Dn.create(e,i,n.selection&&n.selection.map(s),Ve.mapEffects(n.effects,s),n.annotations,n.scrollIntoView)}let r=e.facet(TI);for(let i=r.length-1;i>=0;i--){let s=r[i](n);s instanceof Dn?n=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Dn?n=s[0]:n=PI(e,vc(s),!1)}return n}function H7(n){let e=n.startState,t=e.facet(II),r=n;for(let i=t.length-1;i>=0;i--){let s=t[i](n);s&&Object.keys(s).length&&(r=OI(r,ww(e,s,n.changes.newLength),!0))}return r==n?n:Dn.create(e,n.changes,n.selection,r.effects,r.annotations,r.scrollIntoView)}const V7=[];function vc(n){return n==null?V7:Array.isArray(n)?n:[n]}var sn=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(sn||(sn={}));const G7=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let _w;try{_w=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function K7(n){if(_w)return _w.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||G7.test(t)))return!0}return!1}function Z7(n){return e=>{if(!/\S/.test(e))return sn.Space;if(K7(e))return sn.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return sn.Word;return sn.Other}}class gt{constructor(e,t,r,i,s,o){this.config=e,this.doc=t,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)ud(this,a<<1);this.computeSlot=null}field(e,t=!0){let r=this.config.address[e.id];if(r==null){if(t)throw new RangeError("Field is not present in this state");return}return ud(this,r),Im(this,r)}update(...e){return PI(this,e,!0)}applyTransaction(e){let t=this.config,{base:r,compartments:i}=t;for(let a of e.effects)a.is(ga.reconfigure)?(t&&(i=new Map,t.compartments.forEach((u,l)=>i.set(l,u)),t=null),i.set(a.value.compartment,a.value.extension)):a.is(Ve.reconfigure)?(t=null,r=a.value):a.is(Ve.appendConfig)&&(t=null,r=vc(r).concat(a.value));let s;t?s=e.startState.values.slice():(t=Tm.resolve(r,i,this),s=new gt(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(u,l)=>l.reconfigure(u,this),null).values);let o=e.startState.facet(bw)?e.newSelection:e.newSelection.asSingle();new gt(t,e.newDoc,o,s,(a,u)=>u.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:me.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,r=e(t.ranges[0]),i=this.changes(r.changes),s=[r.range],o=vc(r.effects);for(let a=1;a<t.ranges.length;a++){let u=e(t.ranges[a]),l=this.changes(u.changes),c=l.map(i);for(let d=0;d<a;d++)s[d]=s[d].map(c);let f=i.mapDesc(l,!0);s.push(u.range.map(f)),i=i.compose(c),o=Ve.mapEffects(o,c).concat(Ve.mapEffects(vc(u.effects),f))}return{changes:i,selection:me.create(s,t.mainIndex),effects:o}}changes(e=[]){return e instanceof On?e:On.of(e,this.doc.length,this.facet(gt.lineSeparator))}toText(e){return vt.of(e.split(this.facet(gt.lineSeparator)||dw))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(ud(this,t),Im(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof Tn&&this.config.address[i.id]!=null&&(t[r]=i.spec.toJSON(this.field(e[r]),this))}return t}static fromJSON(e,t={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let s in r)if(Object.prototype.hasOwnProperty.call(e,s)){let o=r[s],a=e[s];i.push(o.init(u=>o.spec.fromJSON(a,u)))}}return gt.create({doc:e.doc,selection:me.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=Tm.resolve(e.extensions||[],new Map),r=e.doc instanceof vt?e.doc:vt.of((e.doc||"").split(t.staticFacet(gt.lineSeparator)||dw)),i=e.selection?e.selection instanceof me?e.selection:me.single(e.selection.anchor,e.selection.head):me.single(0);return CI(i,r.length),t.staticFacet(bw)||(i=i.asSingle()),new gt(t,r,i,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(gt.tabSize)}get lineBreak(){return this.facet(gt.lineSeparator)||`
|
|
6
|
-
`}get readOnly(){return this.facet(MI)}phrase(e,...t){for(let r of this.facet(gt.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>t.length?r:t[s-1]})),e}languageDataAt(e,t,r=-1){let i=[];for(let s of this.facet(AI))for(let o of s(this,t,r))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){return Z7(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:r,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-r,a=e-r;for(;o>0;){let u=ur(t,o,!1);if(s(t.slice(u,o))!=sn.Word)break;o=u}for(;a<i;){let u=ur(t,a);if(s(t.slice(a,u))!=sn.Word)break;a=u}return o==a?null:me.range(o+r,a+r)}}gt.allowMultipleSelections=bw;gt.tabSize=Re.define({combine:n=>n.length?n[0]:4});gt.lineSeparator=RI;gt.readOnly=MI;gt.phrases=Re.define({compare(n,e){let t=Object.keys(n),r=Object.keys(e);return t.length==r.length&&t.every(i=>n[i]==e[i])}});gt.languageData=AI;gt.changeFilter=DI;gt.transactionFilter=TI;gt.transactionExtender=II;ga.reconfigure=Ve.define();function So(n,e,t={}){let r={};for(let i of n)for(let s of Object.keys(i)){let o=i[s],a=r[s];if(a===void 0)r[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(t,s))r[s]=t[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class ll{eq(e){return this==e}range(e,t=e){return kw.create(e,t,this)}}ll.prototype.startSide=ll.prototype.endSide=0;ll.prototype.point=!1;ll.prototype.mapMode=ar.TrackDel;let kw=class LI{constructor(e,t,r){this.from=e,this.to=t,this.value=r}static create(e,t,r){return new LI(e,t,r)}};function xw(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class nk{constructor(e,t,r,i){this.from=e,this.to=t,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,r,i=0){let s=r?this.to:this.from;for(let o=i,a=s.length;;){if(o==a)return o;let u=o+a>>1,l=s[u]-e||(r?this.value[u].endSide:this.value[u].startSide)-t;if(u==o)return l>=0?o:a;l>=0?a=u:o=u+1}}between(e,t,r,i){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(r,1e9,!1,s);s<o;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let r=[],i=[],s=[],o=-1,a=-1;for(let u=0;u<this.value.length;u++){let l=this.value[u],c=this.from[u]+e,f=this.to[u]+e,d,g;if(c==f){let m=t.mapPos(c,l.startSide,l.mapMode);if(m==null||(d=g=m,l.startSide!=l.endSide&&(g=t.mapPos(c,l.endSide),g<d)))continue}else if(d=t.mapPos(c,l.startSide),g=t.mapPos(f,l.endSide),d>g||d==g&&l.startSide>0&&l.endSide<=0)continue;(g-d||l.endSide-l.startSide)<0||(o<0&&(o=d),l.point&&(a=Math.max(a,g-d)),r.push(l),i.push(d-o),s.push(g-o))}return{mapped:r.length?new nk(i,s,r,a):null,pos:o}}}class yt{constructor(e,t,r,i){this.chunkPos=e,this.chunk=t,this.nextLayer=r,this.maxPoint=i}static create(e,t,r,i){return new yt(e,t,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:r=!1,filterFrom:i=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(r&&(t=t.slice().sort(xw)),this.isEmpty)return t.length?yt.of(t):this;let a=new FI(this,null,-1).goto(0),u=0,l=[],c=new la;for(;a.value||u<t.length;)if(u<t.length&&(a.from-t[u].from||a.startSide-t[u].value.startSide)>=0){let f=t[u++];c.addInner(f.from,f.to,f.value)||l.push(f)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(u==t.length||this.chunkEnd(a.chunkIndex)<t[u].from)&&(!o||i>this.chunkEnd(a.chunkIndex)||s<this.chunkPos[a.chunkIndex])&&c.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!o||i>a.to||s<a.from||o(a.from,a.to,a.value))&&(c.addInner(a.from,a.to,a.value)||l.push(kw.create(a.from,a.to,a.value))),a.next());return c.finishInner(this.nextLayer.isEmpty&&!l.length?yt.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],r=[],i=-1;for(let o=0;o<this.chunk.length;o++){let a=this.chunkPos[o],u=this.chunk[o],l=e.touchesRange(a,a+u.length);if(l===!1)i=Math.max(i,u.maxPoint),t.push(u),r.push(e.mapPos(a));else if(l===!0){let{mapped:c,pos:f}=u.map(a,e);c&&(i=Math.max(i,c.maxPoint),t.push(c),r.push(f))}}let s=this.nextLayer.map(e);return t.length==0?s:new yt(r,t,s||yt.empty,i)}between(e,t,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],o=this.chunk[i];if(t>=s&&e<=s+o.length&&o.between(s,e-s,t-s,r)===!1)return}this.nextLayer.between(e,t,r)}}iter(e=0){return vd.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return vd.from(e).goto(t)}static compare(e,t,r,i,s=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),a=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),u=GC(o,a,r),l=new eh(o,u,s),c=new eh(a,u,s);r.iterGaps((f,d,g)=>KC(l,f,c,d,g,i)),r.empty&&r.length==0&&KC(l,0,c,0,0,i)}static eq(e,t,r=0,i){i==null&&(i=999999999);let s=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let a=GC(s,o),u=new eh(s,a,0).goto(r),l=new eh(o,a,0).goto(r);for(;;){if(u.to!=l.to||!Sw(u.active,l.active)||u.point&&(!l.point||!u.point.eq(l.point)))return!1;if(u.to>i)return!0;u.next(),l.next()}}static spans(e,t,r,i,s=-1){let o=new eh(e,null,s).goto(t),a=t,u=o.openStart;for(;;){let l=Math.min(o.to,r);if(o.point){let c=o.activeForPoint(o.to),f=o.pointFrom<t?c.length+1:o.point.startSide<0?c.length:Math.min(c.length,u);i.point(a,l,o.point,c,f,o.pointRank),u=Math.min(o.openEnd(l),c.length)}else l>a&&(i.span(a,l,o.active,u),u=o.openEnd(l));if(o.to>r)return u+(o.point&&o.to>r?1:0);a=o.to,o.next()}}static of(e,t=!1){let r=new la;for(let i of e instanceof kw?[e]:t?X7(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return yt.empty;let t=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=yt.empty;i=i.nextLayer)t=new yt(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}yt.empty=new yt([],[],null,-1);function X7(n){if(n.length>1)for(let e=n[0],t=1;t<n.length;t++){let r=n[t];if(xw(e,r)>0)return n.slice().sort(xw);e=r}return n}yt.empty.nextLayer=yt.empty;class la{finishChunk(e){this.chunks.push(new nk(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,r){this.addInner(e,t,r)||(this.nextLayer||(this.nextLayer=new la)).add(e,t,r)}addInner(e,t,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=t,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let r=t.value.length-1;return this.last=t.value[r],this.lastFrom=t.from[r]+e,this.lastTo=t.to[r]+e,!0}finish(){return this.finishInner(yt.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=yt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function GC(n,e,t){let r=new Map;for(let s of n)for(let o=0;o<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&r.set(s.chunk[o],s.chunkPos[o]);let i=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let a=r.get(s.chunk[o]);a!=null&&(t?t.mapPos(a):a)==s.chunkPos[o]&&!t?.touchesRange(a,a+s.chunk[o].length)&&i.add(s.chunk[o])}return i}class FI{constructor(e,t,r,i=0){this.layer=e,this.skip=t,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],r=e+t.from[this.rangeIndex];if(this.from=r,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class vd{constructor(e){this.heap=e}static from(e,t=null,r=-1){let i=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=r&&i.push(new FI(o,t,r,s));return i.length==1?i[0]:new vd(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let r of this.heap)r.goto(e,t);for(let r=this.heap.length>>1;r>=0;r--)jv(this.heap,r);return this.next(),this}forward(e,t){for(let r of this.heap)r.forward(e,t);for(let r=this.heap.length>>1;r>=0;r--)jv(this.heap,r);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),jv(this.heap,0)}}}function jv(n,e){for(let t=n[e];;){let r=(e<<1)+1;if(r>=n.length)break;let i=n[r];if(r+1<n.length&&i.compare(n[r+1])>=0&&(i=n[r+1],r++),t.compare(i)<0)break;n[r]=t,n[e]=i,e=r}}class eh{constructor(e,t,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=vd.from(e,t,r)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Tg(this.active,e),Tg(this.activeTo,e),Tg(this.activeRank,e),this.minActive=ZC(this.active,this.activeTo)}addActive(e){let t=0,{value:r,to:i,rank:s}=this.cursor;for(;t<this.activeRank.length&&(s-this.activeRank[t]||i-this.activeTo[t])>0;)t++;Ig(this.active,t,r),Ig(this.activeTo,t,i),Ig(this.activeRank,t,s),e&&Ig(e,t,this.cursor.from),this.minActive=ZC(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&Tg(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(r),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&t.push(this.active[r]);return t.reverse()}openEnd(e){let t=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)t++;return t}}function KC(n,e,t,r,i,s){n.goto(e),t.goto(r);let o=r+i,a=r,u=r-e;for(;;){let l=n.to+u-t.to,c=l||n.endSide-t.endSide,f=c<0?n.to+u:t.to,d=Math.min(f,o);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&Sw(n.activeForPoint(n.to),t.activeForPoint(t.to))||s.comparePoint(a,d,n.point,t.point):d>a&&!Sw(n.active,t.active)&&s.compareRange(a,d,n.active,t.active),f>o)break;(l||n.openEnd!=t.openEnd)&&s.boundChange&&s.boundChange(f),a=f,c<=0&&n.next(),c>=0&&t.next()}}function Sw(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t]&&!n[t].eq(e[t]))return!1;return!0}function Tg(n,e){for(let t=e,r=n.length-1;t<r;t++)n[t]=n[t+1];n.pop()}function Ig(n,e,t){for(let r=n.length-1;r>=e;r--)n[r+1]=n[r];n[e]=t}function ZC(n,e){let t=-1,r=1e9;for(let i=0;i<e.length;i++)(e[i]-r||n[i].endSide-n[t].endSide)<0&&(t=i,r=e[i]);return t}function Kc(n,e,t=n.length){let r=0;for(let i=0;i<t&&i<n.length;)n.charCodeAt(i)==9?(r+=e-r%e,i++):(r++,i=ur(n,i));return r}function Cw(n,e,t,r){for(let i=0,s=0;;){if(s>=e)return i;if(i==n.length)break;s+=n.charCodeAt(i)==9?t-s%t:1,i=ur(n,i)}return r===!0?-1:n.length}const Ew="ͼ",XC=typeof Symbol>"u"?"__"+Ew:Symbol.for(Ew),Aw=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),YC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class vo{constructor(e,t){this.rules=[];let{finish:r}=t||{};function i(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,a,u,l){let c=[],f=/^@(\w+)\b/.exec(o[0]),d=f&&f[1]=="keyframes";if(f&&a==null)return u.push(o[0]+";");for(let g in a){let m=a[g];if(/&/.test(g))s(g.split(/,\s*/).map(y=>o.map(b=>y.replace(/&/,b))).reduce((y,b)=>y.concat(b)),m,u);else if(m&&typeof m=="object"){if(!f)throw new RangeError("The value of a property ("+g+") should be a primitive value.");s(i(g),m,c,d)}else m!=null&&c.push(g.replace(/_.*/,"").replace(/[A-Z]/g,y=>"-"+y.toLowerCase())+": "+m+";")}(c.length||d)&&u.push((r&&!f&&!l?o.map(r):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)s(i(o),e[o],this.rules)}getRules(){return this.rules.join(`
|
|
7
|
-
`)}static newName(){let e=YC[XC]||1;return YC[XC]=e+1,Ew+e.toString(36)}static mount(e,t,r){let i=e[Aw],s=r&&r.nonce;i?s&&i.setNonce(s):i=new Y7(e,s),i.mount(Array.isArray(t)?t:[t],e)}}let JC=new Map;class Y7{constructor(e,t){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=JC.get(r);if(s)return e[Aw]=s;this.sheet=new i.CSSStyleSheet,JC.set(r,this)}else this.styleTag=r.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Aw]=this}mount(e,t){let r=this.sheet,i=0,s=0;for(let o=0;o<e.length;o++){let a=e[o],u=this.modules.indexOf(a);if(u<s&&u>-1&&(this.modules.splice(u,1),s--,u=-1),u==-1){if(this.modules.splice(s++,0,a),r)for(let l=0;l<a.rules.length;l++)r.insertRule(a.rules[l],i++)}else{for(;s<u;)i+=this.modules[s++].rules.length;i+=a.rules.length,s++}}if(r)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let o="";for(let u=0;u<this.modules.length;u++)o+=this.modules[u].getRules()+`
|
|
8
|
-
`;this.styleTag.textContent=o;let a=t.head||t;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var iu={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},bd={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},J7=typeof navigator<"u"&&/Mac/.test(navigator.platform),Q7=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ir=0;ir<10;ir++)iu[48+ir]=iu[96+ir]=String(ir);for(var ir=1;ir<=24;ir++)iu[ir+111]="F"+ir;for(var ir=65;ir<=90;ir++)iu[ir]=String.fromCharCode(ir+32),bd[ir]=String.fromCharCode(ir);for(var $v in iu)bd.hasOwnProperty($v)||(bd[$v]=iu[$v]);function eq(n){var e=J7&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||Q7&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?bd:iu)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function wd(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Rw(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function hm(n,e){if(!e.anchorNode)return!1;try{return Rw(n,e.anchorNode)}catch{return!1}}function _d(n){return n.nodeType==3?fl(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function ld(n,e,t,r){return t?QC(n,e,t,r,-1)||QC(n,e,t,r,1):!1}function cl(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Mm(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function QC(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:bo(n))){if(n.nodeName=="DIV")return!1;let s=n.parentNode;if(!s||s.nodeType!=1)return!1;e=cl(n)+(i<0?0:1),n=s}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=i<0?bo(n):0}else return!1}}function bo(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function F1(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function tq(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function NI(n,e){let t=e.width/n.offsetWidth,r=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-n.offsetHeight)<1)&&(r=1),{scaleX:t,scaleY:r}}function nq(n,e,t,r,i,s,o,a){let u=n.ownerDocument,l=u.defaultView||window;for(let c=n,f=!1;c&&!f;)if(c.nodeType==1){let d,g=c==u.body,m=1,y=1;if(g)d=tq(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let x=c.getBoundingClientRect();({scaleX:m,scaleY:y}=NI(c,x)),d={left:x.left,right:x.left+c.clientWidth*m,top:x.top,bottom:x.top+c.clientHeight*y}}let b=0,w=0;if(i=="nearest")e.top<d.top?(w=e.top-(d.top+o),t>0&&e.bottom>d.bottom+w&&(w=e.bottom-d.bottom+o)):e.bottom>d.bottom&&(w=e.bottom-d.bottom+o,t<0&&e.top-w<d.top&&(w=e.top-(d.top+o)));else{let x=e.bottom-e.top,_=d.bottom-d.top;w=(i=="center"&&x<=_?e.top+x/2-_/2:i=="start"||i=="center"&&t<0?e.top-o:e.bottom-_+o)-d.top}if(r=="nearest"?e.left<d.left?(b=e.left-(d.left+s),t>0&&e.right>d.right+b&&(b=e.right-d.right+s)):e.right>d.right&&(b=e.right-d.right+s,t<0&&e.left<d.left+b&&(b=e.left-(d.left+s))):b=(r=="center"?e.left+(e.right-e.left)/2-(d.right-d.left)/2:r=="start"==a?e.left-s:e.right-(d.right-d.left)+s)-d.left,b||w)if(g)l.scrollBy(b,w);else{let x=0,_=0;if(w){let S=c.scrollTop;c.scrollTop+=w/y,_=(c.scrollTop-S)*y}if(b){let S=c.scrollLeft;c.scrollLeft+=b/m,x=(c.scrollLeft-S)*m}e={left:e.left-x,top:e.top-_,right:e.right-x,bottom:e.bottom-_},x&&Math.abs(x-b)<1&&(r="nearest"),_&&Math.abs(_-w)<1&&(i="nearest")}if(g)break;(e.top<d.top||e.bottom>d.bottom||e.left<d.left||e.right>d.right)&&(e={left:Math.max(e.left,d.left),right:Math.min(e.right,d.right),top:Math.max(e.top,d.top),bottom:Math.min(e.bottom,d.bottom)}),c=c.assignedSlot||c.parentNode}else if(c.nodeType==11)c=c.host;else break}function rq(n){let e=n.ownerDocument,t,r;for(let i=n.parentNode;i&&!(i==e.body||t&&r);)if(i.nodeType==1)!r&&i.scrollHeight>i.clientHeight&&(r=i),!t&&i.scrollWidth>i.clientWidth&&(t=i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;return{x:t,y:r}}class iq{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:r}=e;this.set(t,Math.min(e.anchorOffset,t?bo(t):0),r,Math.min(e.focusOffset,r?bo(r):0))}set(e,t,r,i){this.anchorNode=e,this.anchorOffset=t,this.focusNode=r,this.focusOffset=i}}let tc=null;function BI(n){if(n.setActive)return n.setActive();if(tc)return n.focus(tc);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(tc==null?{get preventScroll(){return tc={preventScroll:!0},!0}}:void 0),!tc){tc=!1;for(let t=0;t<e.length;){let r=e[t++],i=e[t++],s=e[t++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=s&&(r.scrollLeft=s)}}}let eE;function fl(n,e,t=e){let r=eE||(eE=document.createRange());return r.setEnd(n,t),r.setStart(n,e),r}function bc(n,e,t,r){let i={key:e,code:e,keyCode:t,which:t,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let s=new KeyboardEvent("keydown",i);s.synthetic=!0,n.dispatchEvent(s);let o=new KeyboardEvent("keyup",i);return o.synthetic=!0,n.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function sq(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function qI(n){for(;n.attributes.length;)n.removeAttributeNode(n.attributes[0])}function oq(n,e){let t=e.focusNode,r=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=r)return!1;for(r=Math.min(r,bo(t));;)if(r){if(t.nodeType!=1)return!1;let i=t.childNodes[r-1];i.contentEditable=="false"?r--:(t=i,r=bo(t))}else{if(t==n)return!0;r=cl(t),t=t.parentNode}}function WI(n){return n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function jI(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&r>0)return{node:t,offset:r};if(t.nodeType==1&&r>0){if(t.contentEditable=="false")return null;t=t.childNodes[r-1],r=bo(t)}else if(t.parentNode&&!Mm(t))r=cl(t),t=t.parentNode;else return null}}function $I(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&r<t.nodeValue.length)return{node:t,offset:r};if(t.nodeType==1&&r<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[r],r=0}else if(t.parentNode&&!Mm(t))r=cl(t)+1,t=t.parentNode;else return null}}class xr{constructor(e,t,r=!0){this.node=e,this.offset=t,this.precise=r}static before(e,t){return new xr(e.parentNode,cl(e),t)}static after(e,t){return new xr(e.parentNode,cl(e)+1,t)}}const rk=[];class jt{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let r of this.children){if(r==e)return t;t+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let r=this.dom,i=null,s;for(let o of this.children){if(o.flags&7){if(!o.dom&&(s=i?i.nextSibling:r.firstChild)){let a=jt.get(s);(!a||!a.parent&&a.canReuseDOM(o))&&o.reuseDOM(s)}o.sync(e,t),o.flags&=-8}if(s=i?i.nextSibling:r.firstChild,t&&!t.written&&t.node==r&&s!=o.dom&&(t.written=!0),o.dom.parentNode==r)for(;s&&s!=o.dom;)s=tE(s);else r.insertBefore(o.dom,s);i=o.dom}for(s=i?i.nextSibling:r.firstChild,s&&t&&t.node==r&&(t.written=!0);s;)s=tE(s)}else if(this.flags&1)for(let r of this.children)r.flags&7&&(r.sync(e,t),r.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let r;if(e==this.dom)r=this.dom.childNodes[t];else{let i=bo(e)==0?0:t==0?-1:1;for(;;){let s=e.parentNode;if(s==this.dom)break;i==0&&s.firstChild!=s.lastChild&&(e==s.firstChild?i=-1:i=1),e=s}i<0?r=e:r=e.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!jt.get(r);)r=r.nextSibling;if(!r)return this.length;for(let i=0,s=0;;i++){let o=this.children[i];if(o.dom==r)return s;s+=o.length+o.breakAfter}}domBoundsAround(e,t,r=0){let i=-1,s=-1,o=-1,a=-1;for(let u=0,l=r,c=r;u<this.children.length;u++){let f=this.children[u],d=l+f.length;if(l<e&&d>t)return f.domBoundsAround(e,t,l);if(d>=e&&i==-1&&(i=u,s=l),l>t&&f.dom.parentNode==this.dom){o=u,a=c;break}c=d,l=d+f.breakAfter}return{from:s,to:a<0?r+this.length:a,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,r=rk){this.markDirty();for(let i=e;i<t;i++){let s=this.children[i];s.parent==this&&r.indexOf(s)<0&&s.destroy()}r.length<250?this.children.splice(e,t-e,...r):this.children=[].concat(this.children.slice(0,e),r,this.children.slice(t));for(let i=0;i<r.length;i++)r[i].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new zI(this.children,e,this.children.length)}childPos(e,t=1){return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,t,r,i,s,o){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}jt.prototype.breakAfter=0;function tE(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class zI{constructor(e,t,r){this.children=e,this.pos=t,this.i=r,this.off=0}findPos(e,t=1){for(;;){if(e>this.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function UI(n,e,t,r,i,s,o,a,u){let{children:l}=n,c=l.length?l[e]:null,f=s.length?s[s.length-1]:null,d=f?f.breakAfter:o;if(!(e==r&&c&&!o&&!d&&s.length<2&&c.merge(t,i,s.length?f:null,t==0,a,u))){if(r<l.length){let g=l[r];g&&(i<g.length||g.breakAfter&&f?.breakAfter)?(e==r&&(g=g.split(i),i=0),!d&&f&&g.merge(0,i,f,!0,0,u)?s[s.length-1]=g:((i||g.children.length&&!g.children[0].length)&&g.merge(0,i,null,!1,0,u),s.push(g))):g?.breakAfter&&(f?f.breakAfter=1:o=1),r++}for(c&&(c.breakAfter=o,t>0&&(!o&&s.length&&c.merge(t,c.length,s[0],!1,a,0)?c.breakAfter=s.shift().breakAfter:(t<c.length||c.children.length&&c.children[c.children.length-1].length==0)&&c.merge(t,c.length,null,!1,a,0),e++));e<r&&s.length;)if(l[r-1].become(s[s.length-1]))r--,s.pop(),u=s.length?0:a;else if(l[e].become(s[0]))e++,s.shift(),a=s.length?0:u;else break;!s.length&&e&&r<l.length&&!l[e-1].breakAfter&&l[r].merge(0,0,l[e-1],!1,a,u)&&e--,(e<r||s.length)&&n.replaceChildren(e,r,s)}}function HI(n,e,t,r,i,s){let o=n.childCursor(),{i:a,off:u}=o.findPos(t,1),{i:l,off:c}=o.findPos(e,-1),f=e-t;for(let d of r)f+=d.length;n.length+=f,UI(n,l,c,a,u,r,0,i,s)}let ai=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Dw=typeof document<"u"?document:{documentElement:{style:{}}};const Tw=/Edge\/(\d+)/.exec(ai.userAgent),VI=/MSIE \d/.test(ai.userAgent),Iw=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ai.userAgent),N1=!!(VI||Iw||Tw),nE=!N1&&/gecko\/(\d+)/i.test(ai.userAgent),zv=!N1&&/Chrome\/(\d+)/.exec(ai.userAgent),aq="webkitFontSmoothing"in Dw.documentElement.style,GI=!N1&&/Apple Computer/.test(ai.vendor),rE=GI&&(/Mobile\/\w+/.test(ai.userAgent)||ai.maxTouchPoints>2);var Te={mac:rE||/Mac/.test(ai.platform),windows:/Win/.test(ai.platform),linux:/Linux|X11/.test(ai.platform),ie:N1,ie_version:VI?Dw.documentMode||6:Iw?+Iw[1]:Tw?+Tw[1]:0,gecko:nE,gecko_version:nE?+(/Firefox\/(\d+)/.exec(ai.userAgent)||[0,0])[1]:0,chrome:!!zv,chrome_version:zv?+zv[1]:0,ios:rE,android:/Android\b/.test(ai.userAgent),safari:GI,webkit_version:aq?+(/\bAppleWebKit\/(\d+)/.exec(ai.userAgent)||[0,0])[1]:0,tabSize:Dw.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const uq=256;class Ms extends jt{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,r){return this.flags&8||r&&(!(r instanceof Ms)||this.length-(t-e)+r.length>uq||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new Ms(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new xr(this.dom,e)}domBoundsAround(e,t,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return lq(this.dom,e,t)}}class ca extends jt{constructor(e,t=[],r=0){super(),this.mark=e,this.children=t,this.length=r;for(let i of t)i.setParent(this)}setAttrs(e){if(qI(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,r,i,s,o){return r&&(!(r instanceof ca&&r.mark.eq(this.mark))||e&&s<=0||t<this.length&&o<=0)?!1:(HI(this,e,t,r?r.children.slice():[],s-1,o-1),this.markDirty(),!0)}split(e){let t=[],r=0,i=-1,s=0;for(let a of this.children){let u=r+a.length;u>e&&t.push(r<e?a.split(e-r):a),i<0&&r>=e&&(i=s),r=u,s++}let o=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new ca(this.mark,t,o)}domAtPos(e){return KI(this,e)}coordsAt(e,t){return XI(this,e,t)}}function lq(n,e,t){let r=n.nodeValue.length;e>r&&(e=r);let i=e,s=e,o=0;e==0&&t<0||e==r&&t>=0?Te.chrome||Te.gecko||(e?(i--,o=1):s<r&&(s++,o=-1)):t<0?i--:s<r&&s++;let a=fl(n,i,s).getClientRects();if(!a.length)return null;let u=a[(o?o<0:t>=0)?0:a.length-1];return Te.safari&&!o&&u.width==0&&(u=Array.prototype.find.call(a,l=>l.width)||u),o?F1(u,o<0):u||null}class Ga extends jt{static create(e,t,r){return new Ga(e,t,r)}constructor(e,t,r){super(),this.widget=e,this.length=t,this.side=r,this.prevWidget=null}split(e){let t=Ga.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,r,i,s,o){return r&&(!(r instanceof Ga)||!this.widget.compare(r.widget)||e>0&&s<=0||t<this.length&&o<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-t),!0)}become(e){return e instanceof Ga&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return vt.empty;let e=this;for(;e.parent;)e=e.parent;let{view:t}=e,r=t&&t.state.doc,i=this.posAtStart;return r?r.slice(i,i+this.length):vt.empty}domAtPos(e){return(this.length?e==0:this.side>0)?xr.before(this.dom):xr.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;let i=this.dom.getClientRects(),s=null;if(!i.length)return null;let o=this.side?this.side<0:e>0;for(let a=o?i.length-1:0;s=i[a],!(e>0?a==0:a==i.length-1||s.top<s.bottom);a+=o?-1:1);return F1(s,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class Ic extends jt{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof Ic&&e.side==this.side}split(){return new Ic(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?xr.before(this.dom):xr.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return vt.empty}get isHidden(){return!0}}Ms.prototype.children=Ga.prototype.children=Ic.prototype.children=rk;function KI(n,e){let t=n.dom,{children:r}=n,i=0;for(let s=0;i<r.length;i++){let o=r[i],a=s+o.length;if(!(a==s&&o.getSide()<=0)){if(e>s&&e<a&&o.dom.parentNode==t)return o.domAtPos(e-s);if(e<=s)break;s=a}}for(let s=i;s>0;s--){let o=r[s-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let s=i;s<r.length;s++){let o=r[s];if(o.dom.parentNode==t)return o.domAtPos(0)}return new xr(t,0)}function ZI(n,e,t){let r,{children:i}=n;t>0&&e instanceof ca&&i.length&&(r=i[i.length-1])instanceof ca&&r.mark.eq(e.mark)?ZI(r,e.children[0],t-1):(i.push(e),e.setParent(n)),n.length+=e.length}function XI(n,e,t){let r=null,i=-1,s=null,o=-1;function a(l,c){for(let f=0,d=0;f<l.children.length&&d<=c;f++){let g=l.children[f],m=d+g.length;m>=c&&(g.children.length?a(g,c-d):(!s||s.isHidden&&(t>0||fq(s,g)))&&(m>c||d==m&&g.getSide()>0)?(s=g,o=c-d):(d<c||d==m&&g.getSide()<0&&!g.isHidden)&&(r=g,i=c-d)),d=m}}a(n,e);let u=(t<0?r:s)||r||s;return u?u.coordsAt(Math.max(0,u==r?i:o),t):cq(n)}function cq(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=_d(e);return t[t.length-1]||null}function fq(n,e){let t=n.coordsAt(0,1),r=e.coordsAt(0,1);return t&&r&&r.top<t.bottom}function Mw(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}const iE=Object.create(null);function Om(n,e,t){if(n==e)return!0;n||(n=iE),e||(e=iE);let r=Object.keys(n),i=Object.keys(e);if(r.length-(t&&r.indexOf(t)>-1?1:0)!=i.length-(t&&i.indexOf(t)>-1?1:0))return!1;for(let s of r)if(s!=t&&(i.indexOf(s)==-1||n[s]!==e[s]))return!1;return!0}function Ow(n,e,t){let r=!1;if(e)for(let i in e)t&&i in t||(r=!0,i=="style"?n.style.cssText="":n.removeAttribute(i));if(t)for(let i in t)e&&e[i]==t[i]||(r=!0,i=="style"?n.style.cssText=t[i]:n.setAttribute(i,t[i]));return r}function hq(n){let e=Object.create(null);for(let t=0;t<n.attributes.length;t++){let r=n.attributes[t];e[r.name]=r.value}return e}class ya{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Ur=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(Ur||(Ur={}));class Be extends ll{constructor(e,t,r,i){super(),this.startSide=e,this.endSide=t,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new np(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return t+=r&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new su(e,t,t,r,e.widget||null,!1)}static replace(e){let t=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:s,end:o}=YI(e,t);r=(s?t?-3e8:-1:5e8)-1,i=(o?t?2e8:1:-6e8)+1}return new su(e,r,i,t,e.widget||null,!0)}static line(e){return new rp(e)}static set(e,t=!1){return yt.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Be.none=yt.empty;class np extends Be{constructor(e){let{start:t,end:r}=YI(e);super(t?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,r;return this==e||e instanceof np&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&Om(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}np.prototype.point=!1;class rp extends Be{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof rp&&this.spec.class==e.spec.class&&Om(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}rp.prototype.mapMode=ar.TrackBefore;rp.prototype.point=!0;class su extends Be{constructor(e,t,r,i,s,o){super(t,r,s,e),this.block=i,this.isReplace=o,this.mapMode=i?t<=0?ar.TrackBefore:ar.TrackAfter:ar.TrackDel}get type(){return this.startSide!=this.endSide?Ur.WidgetRange:this.startSide<=0?Ur.WidgetBefore:Ur.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof su&&dq(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}su.prototype.point=!0;function YI(n,e=!1){let{inclusiveStart:t,inclusiveEnd:r}=n;return t==null&&(t=n.inclusive),r==null&&(r=n.inclusive),{start:t??e,end:r??e}}function dq(n,e){return n==e||!!(n&&e&&n.compare(e))}function dm(n,e,t,r=0){let i=t.length-1;i>=0&&t[i]+r>=n?t[i]=Math.max(t[i],e):t.push(n,e)}class An extends jt{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,r,i,s,o){if(r){if(!(r instanceof An))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),HI(this,e,t,r?r.children.slice():[],s,o),!0}split(e){let t=new An;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i:r,off:i}=this.childPos(e);i&&(t.append(this.children[r].split(i),0),this.children[r].merge(i,this.children[r].length,null,!1,0,0),r++);for(let s=r;s<this.children.length;s++)t.append(this.children[s],0);for(;r>0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Om(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){ZI(this,e,t)}addLineDeco(e){let t=e.spec.attributes,r=e.spec.class;t&&(this.attrs=Mw(t,this.attrs||{})),r&&(this.attrs=Mw({class:r},this.attrs||{}))}domAtPos(e){return KI(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var r;this.dom?this.flags&4&&(qI(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(Ow(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let i=this.dom.lastChild;for(;i&&jt.get(i)instanceof ca;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=jt.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!Te.ios||!this.children.some(s=>s instanceof Ms))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let r of this.children){if(!(r instanceof Ms)||/[^ -~]/.test(r.text))return null;let i=_d(r.dom);if(i.length!=1)return null;e+=i[0].width,t=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let r=XI(this,e,t);if(!this.children.length&&r&&this.parent){let{heightOracle:i}=this.parent.view.viewState,s=r.bottom-r.top;if(Math.abs(s-i.lineHeight)<2&&i.textHeight<s){let o=(s-i.textHeight)/2;return{top:r.top+o,bottom:r.bottom-o,left:r.left,right:r.left}}}return r}become(e){return e instanceof An&&this.children.length==0&&e.children.length==0&&Om(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,t){for(let r=0,i=0;r<e.children.length;r++){let s=e.children[r],o=i+s.length;if(o>=t){if(s instanceof An)return s;if(o>t)break}i=o+s.breakAfter}return null}}class oa extends jt{constructor(e,t,r){super(),this.widget=e,this.length=t,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,t,r,i,s,o){return r&&(!(r instanceof oa)||!this.widget.compare(r.widget)||e>0&&s<=0||t<this.length&&o<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-t),!0)}domAtPos(e){return e==0?xr.before(this.dom):xr.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let r=new oa(this.widget,t,this.deco);return r.breakAfter=this.breakAfter,r}get children(){return rk}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):vt.empty}domBoundsAround(){return null}become(e){return e instanceof oa&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,t){let r=this.widget.coordsAt(this.dom,e,t);return r||(this.widget instanceof Pw?null:F1(this.dom.getBoundingClientRect(),this.length?e==0:t<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:t,endSide:r}=this.deco;return t==r?!1:e<0?t<0:r>0}}class Pw extends ya{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class cd{constructor(e,t,r,i){this.doc=e,this.pos=t,this.end=r,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof oa&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new An),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Mg(new Ic(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof oa)&&this.getLine()}buildText(e,t,r){for(;e>0;){if(this.textOff==this.text.length){let{value:s,lineBreak:o,done:a}=this.cursor.next(this.skip);if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=s,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-r)),this.getLine().append(Mg(new Ms(this.text.slice(this.textOff,this.textOff+i)),t),r),this.atCursorPos=!0,this.textOff+=i,e-=i,r=0}}span(e,t,r,i){this.buildText(t-e,r,i),this.pos=t,this.openStart<0&&(this.openStart=i)}point(e,t,r,i,s,o){if(this.disallowBlockEffectsFor[o]&&r instanceof su){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=t-e;if(r instanceof su)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new oa(r.widget||Mc.block,a,r));else{let u=Ga.create(r.widget||Mc.inline,a,a?0:r.startSide),l=this.atCursorPos&&!u.isEditable&&s<=i.length&&(e<t||r.startSide>0),c=!u.isEditable&&(e<t||s>i.length||r.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!l&&!u.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),l&&(f.append(Mg(new Ic(1),i),s),s=i.length+Math.max(0,s-i.length)),f.append(Mg(u,i),s),this.atCursorPos=c,this.pendingBuffer=c?e<t||s>i.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=s)}static build(e,t,r,i,s){let o=new cd(e,t,r,s);return o.openEnd=yt.spans(i,t,r,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Mg(n,e){for(let t of e)n=new ca(t,[n],n.length);return n}class Mc extends ya{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Mc.inline=new Mc("span");Mc.block=new Mc("div");var nn=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(nn||(nn={}));const hl=nn.LTR,ik=nn.RTL;function JI(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const pq=JI("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),gq=JI("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Lw=Object.create(null),Vs=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);Lw[e]=t,Lw[t]=-e}function QI(n){return n<=247?pq[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?gq[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const mq=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Ka{get dir(){return this.level%2?ik:hl}constructor(e,t,r){this.from=e,this.to=t,this.level=r}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,r,i){let s=-1;for(let o=0;o<e.length;o++){let a=e[o];if(a.from<=t&&a.to>=t){if(a.level==r)return o;(s<0||(i!=0?i<0?a.from<t:a.to>t:e[s].level>a.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function eM(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++){let r=n[t],i=e[t];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!eM(r.inner,i.inner))return!1}return!0}const Wt=[];function yq(n,e,t,r,i){for(let s=0;s<=r.length;s++){let o=s?r[s-1].to:e,a=s<r.length?r[s].from:t,u=s?256:i;for(let l=o,c=u,f=u;l<a;l++){let d=QI(n.charCodeAt(l));d==512?d=c:d==8&&f==4&&(d=16),Wt[l]=d==4?2:d,d&7&&(f=d),c=d}for(let l=o,c=u,f=u;l<a;l++){let d=Wt[l];if(d==128)l<a-1&&c==Wt[l+1]&&c&24?d=Wt[l]=c:Wt[l]=256;else if(d==64){let g=l+1;for(;g<a&&Wt[g]==64;)g++;let m=l&&c==8||g<t&&Wt[g]==8?f==1?1:8:256;for(let y=l;y<g;y++)Wt[y]=m;l=g-1}else d==8&&f==1&&(Wt[l]=1);c=d,d&7&&(f=d)}}}function vq(n,e,t,r,i){let s=i==1?2:1;for(let o=0,a=0,u=0;o<=r.length;o++){let l=o?r[o-1].to:e,c=o<r.length?r[o].from:t;for(let f=l,d,g,m;f<c;f++)if(g=Lw[d=n.charCodeAt(f)])if(g<0){for(let y=a-3;y>=0;y-=3)if(Vs[y+1]==-g){let b=Vs[y+2],w=b&2?i:b&4?b&1?s:i:0;w&&(Wt[f]=Wt[Vs[y]]=w),a=y;break}}else{if(Vs.length==189)break;Vs[a++]=f,Vs[a++]=d,Vs[a++]=u}else if((m=Wt[f])==2||m==1){let y=m==i;u=y?0:1;for(let b=a-3;b>=0;b-=3){let w=Vs[b+2];if(w&2)break;if(y)Vs[b+2]|=2;else{if(w&4)break;Vs[b+2]|=4}}}}}function bq(n,e,t,r){for(let i=0,s=r;i<=t.length;i++){let o=i?t[i-1].to:n,a=i<t.length?t[i].from:e;for(let u=o;u<a;){let l=Wt[u];if(l==256){let c=u+1;for(;;)if(c==a){if(i==t.length)break;c=t[i++].to,a=i<t.length?t[i].from:e}else if(Wt[c]==256)c++;else break;let f=s==1,d=(c<e?Wt[c]:r)==1,g=f==d?f?1:2:r;for(let m=c,y=i,b=y?t[y-1].to:n;m>u;)m==b&&(m=t[--y].from,b=y?t[y-1].to:n),Wt[--m]=g;u=c}else s=l,u++}}}function Fw(n,e,t,r,i,s,o){let a=r%2?2:1;if(r%2==i%2)for(let u=e,l=0;u<t;){let c=!0,f=!1;if(l==s.length||u<s[l].from){let y=Wt[u];y!=a&&(c=!1,f=y==16)}let d=!c&&a==1?[]:null,g=c?r:r+1,m=u;e:for(;;)if(l<s.length&&m==s[l].from){if(f)break e;let y=s[l];if(!c)for(let b=y.to,w=l+1;;){if(b==t)break e;if(w<s.length&&s[w].from==b)b=s[w++].to;else{if(Wt[b]==a)break e;break}}if(l++,d)d.push(y);else{y.from>u&&o.push(new Ka(u,y.from,g));let b=y.direction==hl!=!(g%2);Nw(n,b?r+1:r,i,y.inner,y.from,y.to,o),u=y.to}m=y.to}else{if(m==t||(c?Wt[m]!=a:Wt[m]==a))break;m++}d?Fw(n,u,m,r+1,i,d,o):u<m&&o.push(new Ka(u,m,g)),u=m}else for(let u=t,l=s.length;u>e;){let c=!0,f=!1;if(!l||u>s[l-1].to){let y=Wt[u-1];y!=a&&(c=!1,f=y==16)}let d=!c&&a==1?[]:null,g=c?r:r+1,m=u;e:for(;;)if(l&&m==s[l-1].to){if(f)break e;let y=s[--l];if(!c)for(let b=y.from,w=l;;){if(b==e)break e;if(w&&s[w-1].to==b)b=s[--w].from;else{if(Wt[b-1]==a)break e;break}}if(d)d.push(y);else{y.to<u&&o.push(new Ka(y.to,u,g));let b=y.direction==hl!=!(g%2);Nw(n,b?r+1:r,i,y.inner,y.from,y.to,o),u=y.from}m=y.from}else{if(m==e||(c?Wt[m-1]!=a:Wt[m-1]==a))break;m--}d?Fw(n,m,u,r+1,i,d,o):m<u&&o.push(new Ka(m,u,g)),u=m}}function Nw(n,e,t,r,i,s,o){let a=e%2?2:1;yq(n,i,s,r,a),vq(n,i,s,r,a),bq(i,s,r,a),Fw(n,i,s,e,t,r,o)}function wq(n,e,t){if(!n)return[new Ka(0,0,e==ik?1:0)];if(e==hl&&!t.length&&!mq.test(n))return tM(n.length);if(t.length)for(;n.length>Wt.length;)Wt[Wt.length]=256;let r=[],i=e==hl?0:1;return Nw(n,i,i,t,0,n.length,r),r}function tM(n){return[new Ka(0,n,0)]}let nM="";function _q(n,e,t,r,i){var s;let o=r.head-n.from,a=Ka.find(e,o,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc),u=e[a],l=u.side(i,t);if(o==l){let d=a+=i?1:-1;if(d<0||d>=e.length)return null;u=e[a=d],o=u.side(!i,t),l=u.side(i,t)}let c=ur(n.text,o,u.forward(i,t));(c<u.from||c>u.to)&&(c=l),nM=n.text.slice(Math.min(o,c),Math.max(o,c));let f=a==(i?e.length-1:0)?null:e[a+(i?1:-1)];return f&&c==l&&f.level+(i?0:1)<u.level?me.cursor(f.side(!i,t)+n.from,f.forward(i,t)?1:-1,f.level):me.cursor(c+n.from,u.forward(i,t)?-1:1,u.level)}function kq(n,e,t){for(let r=e;r<t;r++){let i=QI(n.charCodeAt(r));if(i==1)return hl;if(i==2||i==4)return ik}return hl}const rM=Re.define(),iM=Re.define(),sM=Re.define(),oM=Re.define(),Bw=Re.define(),aM=Re.define(),uM=Re.define(),sk=Re.define(),ok=Re.define(),lM=Re.define({combine:n=>n.some(e=>e)}),cM=Re.define({combine:n=>n.some(e=>e)}),fM=Re.define();class wc{constructor(e,t="nearest",r="nearest",i=5,s=5,o=!1){this.range=e,this.y=t,this.x=r,this.yMargin=i,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new wc(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new wc(me.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Og=Ve.define({map:(n,e)=>n.map(e)}),hM=Ve.define();function ci(n,e,t){let r=n.facet(oM);r.length?r[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const na=Re.define({combine:n=>n.length?n[0]:!0});let xq=0;const Zh=Re.define();class mn{constructor(e,t,r,i,s){this.id=e,this.create=t,this.domEventHandlers=r,this.domEventObservers=i,this.extension=s(this)}static define(e,t){const{eventHandlers:r,eventObservers:i,provide:s,decorations:o}=t||{};return new mn(xq++,e,r,i,a=>{let u=[Zh.of(a)];return o&&u.push(kd.of(l=>{let c=l.plugin(a);return c?o(c):Be.none})),s&&u.push(s(a)),u})}static fromClass(e,t){return mn.define(r=>new e(r),t)}}class Uv{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(r){if(ci(t.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){ci(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(r){ci(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const dM=Re.define(),ak=Re.define(),kd=Re.define(),pM=Re.define(),uk=Re.define(),gM=Re.define();function sE(n,e){let t=n.state.facet(gM);if(!t.length)return t;let r=t.map(s=>s instanceof Function?s(n):s),i=[];return yt.spans(r,e.from,e.to,{point(){},span(s,o,a,u){let l=s-e.from,c=o-e.from,f=i;for(let d=a.length-1;d>=0;d--,u--){let g=a[d].spec.bidiIsolate,m;if(g==null&&(g=kq(e.text,l,c)),u>0&&f.length&&(m=f[f.length-1]).to==l&&m.direction==g)m.to=c,f=m.inner;else{let y={from:l,to:c,direction:g,inner:[]};f.push(y),f=y.inner}}}}),i}const mM=Re.define();function lk(n){let e=0,t=0,r=0,i=0;for(let s of n.state.facet(mM)){let o=s(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:e,right:t,top:r,bottom:i}}const Xh=Re.define();class ns{constructor(e,t,r,i){this.fromA=e,this.toA=t,this.fromB=r,this.toB=i}join(e){return new ns(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,r=this;for(;t>0;t--){let i=e[t-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),e.splice(t-1,1)}}return e.splice(t,0,r),e}static extendWithRanges(e,t){if(t.length==0)return e;let r=[];for(let i=0,s=0,o=0,a=0;;i++){let u=i==e.length?null:e[i],l=o-a,c=u?u.fromB:1e9;for(;s<t.length&&t[s]<c;){let f=t[s],d=t[s+1],g=Math.max(a,f),m=Math.min(c,d);if(g<=m&&new ns(g+l,m+l,g,m).addToSet(r),d>c)break;s+=2}if(!u)return r;new ns(u.fromA,u.toA,u.fromB,u.toB).addToSet(r),o=u.toA,a=u.toB}}}class Pm{constructor(e,t,r){this.view=e,this.state=t,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=On.empty(this.startState.doc.length);for(let s of r)this.changes=this.changes.compose(s.changes);let i=[];this.changes.iterChangedRanges((s,o,a,u)=>i.push(new ns(s,o,a,u))),this.changedRanges=i}static create(e,t,r){return new Pm(e,t,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class oE extends jt{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=Be.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new An],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new ns(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:l,toA:c})=>c<this.minWidthFrom||l>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?i=this.domChanged.newSel.head:!Tq(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let s=i>-1?Cq(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:l,to:c}=this.hasComposition;r=new ns(l,c,e.changes.mapPos(l,-1),e.changes.mapPos(c,1)).addToSet(r.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(Te.ie||Te.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.updateDeco(),u=Rq(o,a,e.changes);return r=ns.extendWithRanges(r,u),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,r);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=Te.chrome||Te.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||i.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let s=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.children)o instanceof oa&&o.widget instanceof Pw&&s.push(o.dom);i.updateGaps(s)}updateChildren(e,t,r){let i=r?r.range.addToSet(e.slice()):e,s=this.childCursor(t);for(let o=i.length-1;;o--){let a=o>=0?i[o]:null;if(!a)break;let{fromA:u,toA:l,fromB:c,toB:f}=a,d,g,m,y;if(r&&r.range.fromB<f&&r.range.toB>c){let S=cd.build(this.view.state.doc,c,r.range.fromB,this.decorations,this.dynamicDecorationMap),C=cd.build(this.view.state.doc,r.range.toB,f,this.decorations,this.dynamicDecorationMap);g=S.breakAtStart,m=S.openStart,y=C.openEnd;let A=this.compositionView(r);C.breakAtStart?A.breakAfter=1:C.content.length&&A.merge(A.length,A.length,C.content[0],!1,C.openStart,0)&&(A.breakAfter=C.content[0].breakAfter,C.content.shift()),S.content.length&&A.merge(0,0,S.content[S.content.length-1],!0,0,S.openEnd)&&S.content.pop(),d=S.content.concat(A).concat(C.content)}else({content:d,breakAtStart:g,openStart:m,openEnd:y}=cd.build(this.view.state.doc,c,f,this.decorations,this.dynamicDecorationMap));let{i:b,off:w}=s.findPos(l,1),{i:x,off:_}=s.findPos(u,-1);UI(this,x,_,b,w,d,g,m,y)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let r of t.effects)r.is(hM)&&(this.editContextFormatting=r.value)}compositionView(e){let t=new Ms(e.text.nodeValue);t.flags|=8;for(let{deco:i}of e.marks)t=new ca(i,[t],t.length);let r=new An;return r.append(t,0),r}fixCompositionDOM(e){let t=(s,o)=>{o.flags|=8|(o.children.some(u=>u.flags&7)?1:0),this.markedForComposition.add(o);let a=jt.get(s);a&&a!=o&&(a.dom=null),o.setDOM(s)},r=this.childPos(e.range.fromB,1),i=this.children[r.i];t(e.line,i);for(let s=e.marks.length-1;s>=-1;s--)r=i.childPos(r.off,1),i=i.children[r.i],t(s>=0?e.marks[s].node:e.text,i)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,i=r==this.dom,s=!i&&!(this.view.state.facet(na)||this.dom.tabIndex>-1)&&hm(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||t||s))return;let o=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,u=this.moveToLine(this.domAtPos(a.anchor)),l=a.empty?u:this.moveToLine(this.domAtPos(a.head));if(Te.gecko&&a.empty&&!this.hasComposition&&Sq(u)){let f=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(f,u.node.childNodes[u.offset]||null)),u=l=new xr(f,0),o=!0}let c=this.view.observer.selectionRange;(o||!c.focusNode||(!ld(u.node,u.offset,c.anchorNode,c.anchorOffset)||!ld(l.node,l.offset,c.focusNode,c.focusOffset))&&!this.suppressWidgetCursorChange(c,a))&&(this.view.observer.ignore(()=>{Te.android&&Te.chrome&&this.dom.contains(c.focusNode)&&Dq(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=wd(this.view.root);if(f)if(a.empty){if(Te.gecko){let d=Eq(u.node,u.offset);if(d&&d!=3){let g=(d==1?jI:$I)(u.node,u.offset);g&&(u=new xr(g.node,g.offset))}}f.collapse(u.node,u.offset),a.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=a.bidiLevel)}else if(f.extend){f.collapse(u.node,u.offset);try{f.extend(l.node,l.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([u,l]=[l,u]),d.setEnd(l.node,l.offset),d.setStart(u.node,u.offset),f.removeAllRanges(),f.addRange(d)}s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,l)),this.impreciseAnchor=u.precise?null:new xr(c.anchorNode,c.anchorOffset),this.impreciseHead=l.precise?null:new xr(c.focusNode,c.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&ld(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,r=wd(e.root),{anchorNode:i,anchorOffset:s}=e.observer.selectionRange;if(!r||!t.empty||!t.assoc||!r.modify)return;let o=An.find(this,t.head);if(!o)return;let a=o.posAtStart;if(t.head==a||t.head==a+o.length)return;let u=this.coordsAt(t.head,-1),l=this.coordsAt(t.head,1);if(!u||!l||u.bottom>l.top)return;let c=this.domAtPos(t.head+t.assoc);r.collapse(c.node,c.offset),r.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&r.collapse(i,s)}moveToLine(e){let t=this.dom,r;if(e.node!=t)return e;for(let i=e.offset;!r&&i<t.childNodes.length;i++){let s=jt.get(t.childNodes[i]);s instanceof An&&(r=s.domAtPos(0))}for(let i=e.offset-1;!r&&i>=0;i--){let s=jt.get(t.childNodes[i]);s instanceof An&&(r=s.domAtPos(s.length))}return r?new xr(r.node,r.offset,!0):e}nearest(e){for(let t=e;t;){let r=jt.get(t);if(r&&r.rootView==this)return r;t=t.parentNode}return null}posFromDOM(e,t){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,t)+r.posAtStart}domAtPos(e){let{i:t,off:r}=this.childCursor().findPos(e,-1);for(;t<this.children.length-1;){let i=this.children[t];if(r<i.length||i instanceof An)break;t++,r=0}return this.children[t].domAtPos(r)}coordsAt(e,t){let r=null,i=0;for(let s=this.length,o=this.children.length-1;o>=0;o--){let a=this.children[o],u=s-a.breakAfter,l=u-a.length;if(u<e)break;if(l<=e&&(l<e||a.covers(-1))&&(u>e||a.covers(1))&&(!r||a instanceof An&&!(r instanceof An&&t>=0)))r=a,i=l;else if(r&&l==e&&u==e&&a instanceof oa&&Math.abs(t)<2){if(a.deco.startSide<0)break;o&&(r=null)}s=l}return r?r.coordsAt(e-i,t):null}coordsForChar(e){let{i:t,off:r}=this.childPos(e,1),i=this.children[t];if(!(i instanceof An))return null;for(;i.children.length;){let{i:a,off:u}=i.childPos(r,1);for(;;a++){if(a==i.children.length)return null;if((i=i.children[a]).length)break}r=u}if(!(i instanceof Ms))return null;let s=ur(i.text,r);if(s==r)return null;let o=fl(i.dom,r,s).getClientRects();for(let a=0;a<o.length;a++){let u=o[a];if(a==o.length-1||u.top<u.bottom&&u.left<u.right)return u}return null}measureVisibleLineHeights(e){let t=[],{from:r,to:i}=e,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,u=this.view.textDirection==nn.LTR;for(let l=0,c=0;c<this.children.length;c++){let f=this.children[c],d=l+f.length;if(d>i)break;if(l>=r){let g=f.dom.getBoundingClientRect();if(t.push(g.height),o){let m=f.dom.lastChild,y=m?_d(m):[];if(y.length){let b=y[y.length-1],w=u?b.right-g.left:g.right-b.left;w>a&&(a=w,this.minWidth=s,this.minWidthFrom=l,this.minWidthTo=d)}}}l=d+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?nn.RTL:nn.LTR}measureTextSize(){for(let s of this.children)if(s instanceof An){let o=s.measureTextSize();if(o)return o}let e=document.createElement("div"),t,r,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=_d(e.firstChild)[0];t=e.getBoundingClientRect().height,r=s?s.width/27:7,i=s?s.height:t,e.remove()}),{lineHeight:t,charWidth:r,textHeight:i}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new zI(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let r=0,i=0;;i++){let s=i==t.viewports.length?null:t.viewports[i],o=s?s.from-1:this.length;if(o>r){let a=(t.lineBlockAt(o).bottom-t.lineBlockAt(r).top)/this.view.scaleY;e.push(Be.replace({widget:new Pw(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,o))}if(!s)break;r=s.to+1}return Be.set(e)}updateDeco(){let e=1,t=this.view.state.facet(kd).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,i=this.view.state.facet(pM).map((s,o)=>{let a=typeof s=="function";return a&&(r=!0),a?s(this.view):s});for(i.length&&(this.dynamicDecorationMap[e++]=r,t.push(yt.join(i))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let l=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=l.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let l of this.view.state.facet(fM))try{if(l(this.view,e.range,e))return!0}catch(c){ci(this.view.state,c,"scroll handler")}let{range:t}=e,r=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),i;if(!r)return;!t.empty&&(i=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let s=lk(this.view),o={left:r.left-s.left,top:r.top-s.top,right:r.right+s.right,bottom:r.bottom+s.bottom},{offsetWidth:a,offsetHeight:u}=this.view.scrollDOM;nq(this.view.scrollDOM,o,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yMargin,u),-u),this.view.textDirection==nn.LTR)}}function Sq(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable=="false")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable=="false")}function yM(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let r=jI(t.focusNode,t.focusOffset),i=$I(t.focusNode,t.focusOffset),s=r||i;if(i&&r&&i.node!=r.node){let a=jt.get(i.node);if(!a||a instanceof Ms&&a.text!=i.node.nodeValue)s=i;else if(n.docView.lastCompositionAfterCursor){let u=jt.get(r.node);!u||u instanceof Ms&&u.text!=r.node.nodeValue||(s=i)}}if(n.docView.lastCompositionAfterCursor=s!=r,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function Cq(n,e,t){let r=yM(n,t);if(!r)return null;let{node:i,from:s,to:o}=r,a=i.nodeValue;if(/[\n\r]/.test(a)||n.state.doc.sliceString(r.from,r.to)!=a)return null;let u=e.invertedDesc,l=new ns(u.mapPos(s),u.mapPos(o),s,o),c=[];for(let f=i.parentNode;;f=f.parentNode){let d=jt.get(f);if(d instanceof ca)c.push({node:f,deco:d.mark});else{if(d instanceof An||f.nodeName=="DIV"&&f.parentNode==n.contentDOM)return{range:l,text:i,marks:c,line:f};if(f!=n.contentDOM)c.push({node:f,deco:new np({inclusive:!0,attributes:hq(f),tagName:f.tagName.toLowerCase()})});else return null}}}function Eq(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e<n.childNodes.length&&n.childNodes[e].contentEditable=="false"?2:0)}let Aq=class{constructor(){this.changes=[]}compareRange(e,t){dm(e,t,this.changes)}comparePoint(e,t){dm(e,t,this.changes)}boundChange(e){dm(e,e,this.changes)}};function Rq(n,e,t){let r=new Aq;return yt.compare(n,e,t,r),r.changes}function Dq(n,e){for(let t=n;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function Tq(n,e){let t=!1;return e&&n.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(t=!0)}),t}function Iq(n,e,t=1){let r=n.charCategorizer(e),i=n.doc.lineAt(e),s=e-i.from;if(i.length==0)return me.cursor(e);s==0?t=1:s==i.length&&(t=-1);let o=s,a=s;t<0?o=ur(i.text,s,!1):a=ur(i.text,s);let u=r(i.text.slice(o,a));for(;o>0;){let l=ur(i.text,o,!1);if(r(i.text.slice(l,o))!=u)break;o=l}for(;a<i.length;){let l=ur(i.text,a);if(r(i.text.slice(a,l))!=u)break;a=l}return me.range(o+i.from,a+i.from)}function Mq(n,e){return e.left>n?e.left-n:Math.max(0,n-e.right)}function Oq(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function Hv(n,e){return n.top<e.bottom-1&&n.bottom>e.top+1}function aE(n,e){return e<n.top?{top:e,left:n.left,right:n.right,bottom:n.bottom}:n}function uE(n,e){return e>n.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function qw(n,e,t){let r,i,s,o,a=!1,u,l,c,f;for(let m=n.firstChild;m;m=m.nextSibling){let y=_d(m);for(let b=0;b<y.length;b++){let w=y[b];i&&Hv(i,w)&&(w=aE(uE(w,i.bottom),i.top));let x=Mq(e,w),_=Oq(t,w);if(x==0&&_==0)return m.nodeType==3?lE(m,e,t):qw(m,e,t);if(!r||o>_||o==_&&s>x){r=m,i=w,s=x,o=_;let S=_?t<w.top?-1:1:x?e<w.left?-1:1:0;a=!S||(S>0?b<y.length-1:b>0)}x==0?t>w.bottom&&(!c||c.bottom<w.bottom)?(u=m,c=w):t<w.top&&(!f||f.top>w.top)&&(l=m,f=w):c&&Hv(c,w)?c=uE(c,w.bottom):f&&Hv(f,w)&&(f=aE(f,w.top))}}if(c&&c.bottom>=t?(r=u,i=c):f&&f.top<=t&&(r=l,i=f),!r)return{node:n,offset:0};let d=Math.max(i.left,Math.min(i.right,e));if(r.nodeType==3)return lE(r,d,t);if(a&&r.contentEditable!="false")return qw(r,d,t);let g=Array.prototype.indexOf.call(n.childNodes,r)+(e>=(i.left+i.right)/2?1:0);return{node:n,offset:g}}function lE(n,e,t){let r=n.nodeValue.length,i=-1,s=1e9,o=0;for(let a=0;a<r;a++){let u=fl(n,a,a+1).getClientRects();for(let l=0;l<u.length;l++){let c=u[l];if(c.top==c.bottom)continue;o||(o=e-c.left);let f=(c.top>t?c.top-t:t-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&f<s){let d=e>=(c.left+c.right)/2,g=d;if((Te.chrome||Te.gecko)&&fl(n,a).getBoundingClientRect().left==c.right&&(g=!d),f<=0)return{node:n,offset:a+(g?1:0)};i=a+(g?1:0),s=f}}}return{node:n,offset:i>-1?i:o>0?n.nodeValue.length:0}}function vM(n,e,t,r=-1){var i,s;let o=n.contentDOM.getBoundingClientRect(),a=o.top+n.viewState.paddingTop,u,{docHeight:l}=n.viewState,{x:c,y:f}=e,d=f-a;if(d<0)return 0;if(d>l)return n.state.doc.length;for(let S=n.viewState.heightOracle.textHeight/2,C=!1;u=n.elementAtHeight(d),u.type!=Ur.Text;)for(;d=r>0?u.bottom+S:u.top-S,!(d>=0&&d<=l);){if(C)return t?null:0;C=!0,r=-r}f=a+d;let g=u.from;if(g<n.viewport.from)return n.viewport.from==0?0:t?null:cE(n,o,u,c,f);if(g>n.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:cE(n,o,u,c,f);let m=n.dom.ownerDocument,y=n.root.elementFromPoint?n.root:m,b=y.elementFromPoint(c,f);b&&!n.contentDOM.contains(b)&&(b=null),b||(c=Math.max(o.left+1,Math.min(o.right-1,c)),b=y.elementFromPoint(c,f),b&&!n.contentDOM.contains(b)&&(b=null));let w,x=-1;if(b&&((i=n.docView.nearest(b))===null||i===void 0?void 0:i.isEditable)!=!1){if(m.caretPositionFromPoint){let S=m.caretPositionFromPoint(c,f);S&&({offsetNode:w,offset:x}=S)}else if(m.caretRangeFromPoint){let S=m.caretRangeFromPoint(c,f);S&&({startContainer:w,startOffset:x}=S,(!n.contentDOM.contains(w)||Te.safari&&Pq(w,x,c)||Te.chrome&&Lq(w,x,c))&&(w=void 0))}w&&(x=Math.min(bo(w),x))}if(!w||!n.docView.dom.contains(w)){let S=An.find(n.docView,g);if(!S)return d>u.top+u.height/2?u.to:u.from;({node:w,offset:x}=qw(S.dom,c,f))}let _=n.docView.nearest(w);if(!_)return null;if(_.isWidget&&((s=_.dom)===null||s===void 0?void 0:s.nodeType)==1){let S=_.dom.getBoundingClientRect();return e.y<S.top||e.y<=S.bottom&&e.x<=(S.left+S.right)/2?_.posAtStart:_.posAtEnd}else return _.localPosFromDOM(w,x)+_.posAtStart}function cE(n,e,t,r,i){let s=Math.round((r-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let a=n.viewState.heightOracle.textHeight,u=Math.floor((i-t.top-(n.defaultLineHeight-a)*.5)/a);s+=u*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+Cw(o,s,n.state.tabSize)}function Pq(n,e,t){let r;if(n.nodeType!=3||e!=(r=n.nodeValue.length))return!1;for(let i=n.nextSibling;i;i=i.nextSibling)if(i.nodeType!=1||i.nodeName!="BR")return!1;return fl(n,r-1,r).getBoundingClientRect().left>t}function Lq(n,e,t){if(e!=0)return!1;for(let i=n;;){let s=i.parentNode;if(!s||s.nodeType!=1||s.firstChild!=i)return!1;if(s.classList.contains("cm-line"))break;i=s}let r=n.nodeType==1?n.getBoundingClientRect():fl(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-r.left>5}function Ww(n,e,t){let r=n.lineBlockAt(e);if(Array.isArray(r.type)){let i;for(let s of r.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!i||s.type==Ur.Text&&(i.type!=s.type||(t<0?s.from<e:s.to>e)))&&(i=s)}}return i||r}return r}function Fq(n,e,t,r){let i=Ww(n,e.head,e.assoc||-1),s=!r||i.type!=Ur.Text||!(n.lineWrapping||i.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(s){let o=n.dom.getBoundingClientRect(),a=n.textDirectionAt(i.from),u=n.posAtCoords({x:t==(a==nn.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(u!=null)return me.cursor(u,t?-1:1)}return me.cursor(t?i.to:i.from,t?-1:1)}function fE(n,e,t,r){let i=n.state.doc.lineAt(e.head),s=n.bidiSpans(i),o=n.textDirectionAt(i.from);for(let a=e,u=null;;){let l=_q(i,s,o,a,t),c=nM;if(!l){if(i.number==(t?n.state.doc.lines:1))return a;c=`
|
|
9
|
-
`,i=n.state.doc.line(i.number+(t?1:-1)),s=n.bidiSpans(i),l=n.visualLineSide(i,!t)}if(u){if(!u(c))return a}else{if(!r)return l;u=r(c)}a=l}}function Nq(n,e,t){let r=n.state.charCategorizer(e),i=r(t);return s=>{let o=r(s);return i==sn.Space&&(i=o),i==o}}function Bq(n,e,t,r){let i=e.head,s=t?1:-1;if(i==(t?n.state.doc.length:0))return me.cursor(i,e.assoc);let o=e.goalColumn,a,u=n.contentDOM.getBoundingClientRect(),l=n.coordsAtPos(i,e.assoc||-1),c=n.documentTop;if(l)o==null&&(o=l.left-u.left),a=s<0?l.top:l.bottom;else{let g=n.viewState.lineBlockAt(i);o==null&&(o=Math.min(u.right-u.left,n.defaultCharacterWidth*(i-g.from))),a=(s<0?g.top:g.bottom)+c}let f=u.left+o,d=r??n.viewState.heightOracle.textHeight>>1;for(let g=0;;g+=10){let m=a+(d+g)*s,y=vM(n,{x:f,y:m},!1,s);if(m<u.top||m>u.bottom||(s<0?y<i:y>i)){let b=n.docView.coordsForChar(y),w=!b||m<b.top?-1:1;return me.cursor(y,w,void 0,o)}}}function pm(n,e,t){for(;;){let r=0;for(let i of n)i.between(e-1,e+1,(s,o,a)=>{if(e>s&&e<o){let u=r||t||(e-s<o-e?-1:1);e=u<0?s:o,r=u}});if(!r)return e}}function Vv(n,e,t){let r=pm(n.state.facet(uk).map(i=>i(n)),t.from,e.head>t.from?-1:1);return r==t.from?t:me.cursor(r,r<t.from?1:-1)}const Yh="";class qq{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(gt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Yh}readRange(e,t){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let s=this.text.length;this.readNode(i);let o=i.nextSibling;if(o==t)break;let a=jt.get(i),u=jt.get(o);(a&&u?a.breakAfter:(a?a.breakAfter:Mm(i))||Mm(o)&&(i.nodeName!="BR"||i.cmIgnore)&&this.text.length>s)&&this.lineBreak(),i=o}return this.findPointBefore(r,t),this}readTextNode(e){let t=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,t.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,a;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,r),o=this.lineSeparator.length):(a=i.exec(t))&&(s=a.index,o=a[0].length),this.append(t.slice(r,s<0?t.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let u of this.points)u.node==e&&u.pos>this.text.length&&(u.pos-=o-1);r=s+o}}readNode(e){if(e.cmIgnore)return;let t=jt.get(e),r=t&&t.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==t&&(r.pos=this.text.length)}findPointInside(e,t){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(Wq(e,r.node,r.offset)?t:0))}}function Wq(n,e,t){for(;;){if(!e||t<bo(e))return!1;if(e==n)return!0;t=cl(e)+1,e=e.parentNode}}class hE{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class jq{constructor(e,t,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,r,0))){let a=s||o?[]:Uq(e),u=new qq(a,e.state);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=Hq(a,this.bounds.from)}else{let a=e.observer.selectionRange,u=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!Rw(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),l=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!Rw(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),c=e.viewport;if((Te.ios||Te.chrome)&&e.state.selection.main.empty&&u!=l&&(c.from>0||c.to<e.state.doc.length)){let f=Math.min(u,l),d=Math.max(u,l),g=c.from-f,m=c.to-d;(g==0||g==1||f==0)&&(m==0||m==-1||d==e.state.doc.length)&&(u=0,l=e.state.doc.length)}this.newSel=me.single(l,u)}}}function bM(n,e){let t,{newSel:r}=e,i=n.state.selection.main,s=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:a}=e.bounds,u=i.from,l=null;(s===8||Te.android&&e.text.length<a-o)&&(u=i.to,l="end");let c=zq(n.state.doc.sliceString(o,a,Yh),e.text,u-o,l);c&&(Te.chrome&&s==13&&c.toB==c.from+2&&e.text.slice(c.from,c.toB)==Yh+Yh&&c.toB--,t={from:o+c.from,to:o+c.toA,insert:vt.of(e.text.slice(c.from,c.toB).split(Yh))})}else r&&(!n.hasFocus&&n.state.facet(na)||r.main.eq(i))&&(r=null);if(!t&&!r)return!1;if(!t&&e.typeOver&&!i.empty&&r&&r.main.empty?t={from:i.from,to:i.to,insert:n.state.doc.slice(i.from,i.to)}:(Te.mac||Te.android)&&t&&t.from==t.to&&t.from==i.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(r&&t.insert.length==2&&(r=me.single(r.main.anchor-1,r.main.head-1)),t={from:t.from,to:t.to,insert:vt.of([t.insert.toString().replace("."," ")])}):t&&t.from>=i.from&&t.to<=i.to&&(t.from!=i.from||t.to!=i.to)&&i.to-i.from-(t.to-t.from)<=4?t={from:i.from,to:i.to,insert:n.state.doc.slice(i.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,i.to))}:Te.chrome&&t&&t.from==t.to&&t.from==i.head&&t.insert.toString()==`
|
|
10
|
-
`&&n.lineWrapping&&(r&&(r=me.single(r.main.anchor-1,r.main.head-1)),t={from:i.from,to:i.to,insert:vt.of([" "])}),t)return ck(n,t,r,s);if(r&&!r.main.eq(i)){let o=!1,a="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),a=n.inputState.lastSelectionOrigin),n.dispatch({selection:r,scrollIntoView:o,userEvent:a}),!0}else return!1}function ck(n,e,t,r=-1){if(Te.ios&&n.inputState.flushIOSKey(e))return!0;let i=n.state.selection.main;if(Te.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&n.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&bc(n.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&bc(n.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&bc(n.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,a=()=>o||(o=$q(n,e,t));return n.state.facet(aM).some(u=>u(n,e.from,e.to,s,a))||n.dispatch(a()),!0}function $q(n,e,t){let r,i=n.state,s=i.selection.main;if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let a=s.from<e.from?i.sliceDoc(s.from,e.from):"",u=s.to>e.to?i.sliceDoc(e.to,s.to):"";r=i.replaceSelection(n.state.toText(a+e.insert.sliceString(0,void 0,n.state.lineBreak)+u))}else{let a=i.changes(e),u=t&&t.main.to<=a.newLength?t.main:void 0;if(i.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let l=n.state.sliceDoc(e.from,e.to),c,f=t&&yM(n,t.main.head);if(f){let m=e.insert.length-(e.to-e.from);c={from:f.from,to:f.to-m}}else c=n.state.doc.lineAt(s.head);let d=s.to-e.to,g=s.to-s.from;r=i.changeByRange(m=>{if(m.from==s.from&&m.to==s.to)return{changes:a,range:u||m.map(a)};let y=m.to-d,b=y-l.length;if(m.to-m.from!=g||n.state.sliceDoc(b,y)!=l||m.to>=c.from&&m.from<=c.to)return{range:m};let w=i.changes({from:b,to:y,insert:e.insert}),x=m.to-s.to;return{changes:w,range:u?me.range(Math.max(0,u.anchor+x),Math.max(0,u.head+x)):m.map(w)}})}else r={changes:a,selection:u&&i.selection.replaceRange(u)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:o,scrollIntoView:!0})}function zq(n,e,t,r){let i=Math.min(n.length,e.length),s=0;for(;s<i&&n.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==i&&n.length==e.length)return null;let o=n.length,a=e.length;for(;o>0&&a>0&&n.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(r=="end"){let u=Math.max(0,s-Math.min(o,a));t-=o+u-s}if(o<s&&n.length<e.length){let u=t<=s&&t>=o?s-t:0;s-=u,a=s+(a-o),o=s}else if(a<s){let u=t<=s&&t>=a?s-t:0;s-=u,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function Uq(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:r,focusNode:i,focusOffset:s}=n.observer.selectionRange;return t&&(e.push(new hE(t,r)),(i!=t||s!=r)&&e.push(new hE(i,s))),e}function Hq(n,e){if(n.length==0)return null;let t=n[0].pos,r=n.length==2?n[1].pos:t;return t>-1&&r>-1?me.single(t+e,r+e):null}class Vq{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Te.safari&&e.contentDOM.addEventListener("input",()=>null),Te.gecko&&uW(e.contentDOM.ownerDocument)}handleEvent(e){!eW(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,t);for(let i of r.handlers){if(t.defaultPrevented)break;if(i(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=Gq(e),r=this.handlers,i=this.view.contentDOM;for(let s in t)if(s!="scroll"){let o=!t[s].handlers.length,a=r[s];a&&o!=!a.handlers.length&&(i.removeEventListener(s,this.handleEvent),a=null),a||i.addEventListener(s,this.handleEvent,{passive:o})}for(let s in r)s!="scroll"&&!t[s]&&i.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&_M.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Te.android&&Te.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return Te.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=wM.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||Kq.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,bc(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:Te.safari&&!Te.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function dE(n,e){return(t,r)=>{try{return e.call(n,r,t)}catch(i){ci(t.state,i)}}}function Gq(n){let e=Object.create(null);function t(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of n){let i=r.spec;if(i&&i.domEventHandlers)for(let s in i.domEventHandlers){let o=i.domEventHandlers[s];o&&t(s).handlers.push(dE(r.value,o))}if(i&&i.domEventObservers)for(let s in i.domEventObservers){let o=i.domEventObservers[s];o&&t(s).observers.push(dE(r.value,o))}}for(let r in Os)t(r).handlers.push(Os[r]);for(let r in rs)t(r).observers.push(rs[r]);return e}const wM=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Kq="dthko",_M=[16,17,18,20,91,92,224,225],Pg=6;function Lg(n){return Math.max(0,n)*.7+8}function Zq(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class Xq{constructor(e,t,r,i){this.view=e,this.startEvent=t,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=rq(e.contentDOM),this.atoms=e.state.facet(uk).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(gt.allowMultipleSelections)&&Yq(e,t),this.dragging=Qq(e,t)&&SM(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Zq(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,r=0,i=0,s=0,o=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:a}=this.scrollParents.y.getBoundingClientRect());let u=lk(this.view);e.clientX-u.left<=i+Pg?t=-Lg(i-e.clientX):e.clientX+u.right>=o-Pg&&(t=Lg(e.clientX-o)),e.clientY-u.top<=s+Pg?r=-Lg(s-e.clientY):e.clientY+u.bottom>=a-Pg&&(r=Lg(e.clientY-a)),this.setScrollSpeed(t,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],s=null;if(i.empty){let o=pm(this.atoms,i.from,0);o!=i.from&&(s=me.cursor(o,-1))}else{let o=pm(this.atoms,i.from,-1),a=pm(this.atoms,i.to,1);(o!=i.from||a!=i.to)&&(s=me.range(i.from==i.anchor?o:a,i.from==i.head?o:a))}s&&(t||(t=e.ranges.slice()),t[r]=s)}return t?me.create(t,e.mainIndex):e}select(e){let{view:t}=this,r=this.skipAtoms(this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Yq(n,e){let t=n.state.facet(rM);return t.length?t[0](e):Te.mac?e.metaKey:e.ctrlKey}function Jq(n,e){let t=n.state.facet(iM);return t.length?t[0](e):Te.mac?!e.altKey:!e.ctrlKey}function Qq(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let r=wd(n.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let s=0;s<i.length;s++){let o=i[s];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function eW(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,r;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(r=jt.get(t))&&r.ignoreEvent(e))return!1;return!0}const Os=Object.create(null),rs=Object.create(null),kM=Te.ie&&Te.ie_version<15||Te.ios&&Te.webkit_version<604;function tW(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),xM(n,t.value)},50)}function B1(n,e,t){for(let r of n.facet(e))t=r(t,n);return t}function xM(n,e){e=B1(n.state,sk,e);let{state:t}=n,r,i=1,s=t.toText(e),o=s.lines==t.selection.ranges.length;if(jw!=null&&t.selection.ranges.every(u=>u.empty)&&jw==s.toString()){let u=-1;r=t.changeByRange(l=>{let c=t.doc.lineAt(l.from);if(c.from==u)return{range:l};u=c.from;let f=t.toText((o?s.line(i++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:me.cursor(l.from+f.length)}})}else o?r=t.changeByRange(u=>{let l=s.line(i++);return{changes:{from:u.from,to:u.to,insert:l.text},range:me.cursor(u.from+l.length)}}):r=t.replaceSelection(s);n.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}rs.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};Os.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);rs.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};rs.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Os.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let r of n.state.facet(sM))if(t=r(n,e),t)break;if(!t&&e.button==0&&(t=iW(n,e)),t){let r=!n.hasFocus;n.inputState.startMouseSelection(new Xq(n,e,t,r)),r&&n.observer.ignore(()=>{BI(n.contentDOM);let s=n.root.activeElement;s&&!s.contains(n.contentDOM)&&s.blur()});let i=n.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}return!1};function pE(n,e,t,r){if(r==1)return me.cursor(e,t);if(r==2)return Iq(n.state,e,t);{let i=An.find(n.docView,e),s=n.state.doc.lineAt(i?i.posAtEnd:e),o=i?i.posAtStart:s.from,a=i?i.posAtEnd:s.to;return a<n.state.doc.length&&a==s.to&&a++,me.range(o,a)}}let gE=(n,e,t)=>e>=t.top&&e<=t.bottom&&n>=t.left&&n<=t.right;function nW(n,e,t,r){let i=An.find(n.docView,e);if(!i)return 1;let s=e-i.posAtStart;if(s==0)return 1;if(s==i.length)return-1;let o=i.coordsAt(s,-1);if(o&&gE(t,r,o))return-1;let a=i.coordsAt(s,1);return a&&gE(t,r,a)?1:o&&o.bottom>=r?-1:1}function mE(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:nW(n,t,e.clientX,e.clientY)}}const rW=Te.ie&&Te.ie_version<=11;let yE=null,vE=0,bE=0;function SM(n){if(!rW)return n.detail;let e=yE,t=bE;return yE=n,bE=Date.now(),vE=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(vE+1)%3:1}function iW(n,e){let t=mE(n,e),r=SM(e),i=n.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),i=i.map(s.changes))},get(s,o,a){let u=mE(n,s),l,c=pE(n,u.pos,u.bias,r);if(t.pos!=u.pos&&!o){let f=pE(n,t.pos,t.bias,r),d=Math.min(f.from,c.from),g=Math.max(f.to,c.to);c=d<c.from?me.range(d,g):me.range(g,d)}return o?i.replaceRange(i.main.extend(c.from,c.to)):a&&r==1&&i.ranges.length>1&&(l=sW(i,u.pos))?l:a?i.addRange(c):me.create([c])}}}function sW(n,e){for(let t=0;t<n.ranges.length;t++){let{from:r,to:i}=n.ranges[t];if(r<=e&&i>=e)return me.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}Os.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let i=n.docView.nearest(e.target);if(i&&i.isWidget){let s=i.posAtStart,o=s+i.length;(s>=t.to||o<=t.from)&&(t=me.range(s,o))}}let{inputState:r}=n;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",B1(n.state,ok,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Os.dragend=n=>(n.inputState.draggedContent=null,!1);function wE(n,e,t,r){if(t=B1(n.state,sk,t),!t)return;let i=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=n.inputState,o=r&&s&&Jq(n,e)?{from:s.from,to:s.to}:null,a={from:i,insert:t},u=n.state.changes(o?[o,a]:a);n.focus(),n.dispatch({changes:u,selection:{anchor:u.mapPos(i,-1),head:u.mapPos(i,1)},userEvent:o?"move.drop":"input.drop"}),n.inputState.draggedContent=null}Os.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let r=Array(t.length),i=0,s=()=>{++i==t.length&&wE(n,e,r.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let a=new FileReader;a.onerror=s,a.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[o]=a.result),s()},a.readAsText(t[o])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return wE(n,e,r,!0),!0}return!1};Os.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=kM?null:e.clipboardData;return t?(xM(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(tW(n),!1)};function oW(n,e){let t=n.dom.parentNode;if(!t)return;let r=t.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),n.focus()},50)}function aW(n){let e=[],t=[],r=!1;for(let i of n.selection.ranges)i.empty||(e.push(n.sliceDoc(i.from,i.to)),t.push(i));if(!e.length){let i=-1;for(let{from:s}of n.selection.ranges){let o=n.doc.lineAt(s);o.number>i&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),i=o.number}r=!0}return{text:B1(n,ok,e.join(n.lineBreak)),ranges:t,linewise:r}}let jw=null;Os.copy=Os.cut=(n,e)=>{let{text:t,ranges:r,linewise:i}=aW(n.state);if(!t&&!i)return!1;jw=i?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let s=kM?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(oW(n,t),!1)};const CM=ma.define();function EM(n,e){let t=[];for(let r of n.facet(uM)){let i=r(n,e);i&&t.push(i)}return t.length?n.update({effects:t,annotations:CM.of(!0)}):null}function AM(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=EM(n.state,e);t?n.dispatch(t):n.update([])}},10)}rs.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),AM(n)};rs.blur=n=>{n.observer.clearSelectionRange(),AM(n)};rs.compositionstart=rs.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};rs.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,Te.chrome&&Te.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};rs.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};Os.beforeinput=(n,e)=>{var t,r;if(e.inputType=="insertReplacementText"&&n.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let a=o[0],u=n.posAtDOM(a.startContainer,a.startOffset),l=n.posAtDOM(a.endContainer,a.endOffset);return ck(n,{from:u,to:l,insert:n.state.toText(s)},null),!0}}let i;if(Te.chrome&&Te.android&&(i=wM.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return Te.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),Te.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>rs.compositionend(n,e),20),!1};const _E=new Set;function uW(n){_E.has(n)||(_E.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const kE=["pre-wrap","normal","pre-line","break-spaces"];let Oc=!1;function xE(){Oc=!1}class lW{constructor(e){this.lineWrapping=e,this.doc=vt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let r=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((t-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return kE.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let r=0;r<e.length;r++){let i=e[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(t=!0,this.heightSamples[Math.floor(i*10)]=!0)}return t}refresh(e,t,r,i,s,o){let a=kE.indexOf(e)>-1,u=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=r,this.textHeight=i,this.lineLength=s,u){this.heightSamples={};for(let l=0;l<o.length;l++){let c=o[l];c<0?l++:this.heightSamples[Math.floor(c*10)]=!0}}return u}}class cW{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class oo{constructor(e,t,r,i,s){this.from=e,this.length=t,this.top=r,this.height=i,this._content=s}get type(){return typeof this._content=="number"?Ur.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof su?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new oo(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var tn=function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n}(tn||(tn={}));const gm=.001;class Hr{constructor(e,t,r=2){this.length=e,this.height=t,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>gm&&(Oc=!0),this.height=e)}replace(e,t,r){return Hr.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,r,i){let s=this,o=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:u,toA:l,fromB:c,toB:f}=i[a],d=s.lineAt(u,tn.ByPosNoHeight,r.setDoc(t),0,0),g=d.to>=l?d:s.lineAt(l,tn.ByPosNoHeight,r,0,0);for(f+=g.to-l,l=g.to;a>0&&d.from<=i[a-1].toA;)u=i[a-1].fromA,c=i[a-1].fromB,a--,u<d.from&&(d=s.lineAt(u,tn.ByPosNoHeight,r,0,0));c+=d.from-u,u=d.from;let m=fk.build(r.setDoc(o),e,c,f);s=Lm(s,s.replace(u,l,m))}return s.updateHeight(r,0)}static empty(){return new Ai(0,0)}static of(e){if(e.length==1)return e[0];let t=0,r=e.length,i=0,s=0;for(;;)if(t==r)if(i>s*2){let a=e[t-1];a.break?e.splice(--t,1,a.left,null,a.right):e.splice(--t,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(s>i*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,s-=a.size}else break;else if(i<s){let a=e[t++];a&&(i+=a.size)}else{let a=e[--r];a&&(s+=a.size)}let o=0;return e[t-1]==null?(o=1,t--):e[t]==null&&(o=1,r++),new fW(Hr.of(e.slice(0,t)),o,Hr.of(e.slice(r)))}}function Lm(n,e){return n==e?n:(n.constructor!=e.constructor&&(Oc=!0),e)}Hr.prototype.size=1;class RM extends Hr{constructor(e,t,r){super(e,t),this.deco=r}blockAt(e,t,r,i){return new oo(i,this.length,r,this.height,this.deco||0)}lineAt(e,t,r,i,s){return this.blockAt(0,r,i,s)}forEachLine(e,t,r,i,s,o){e<=s+this.length&&t>=s&&o(this.blockAt(0,r,i,s))}updateHeight(e,t=0,r=!1,i){return i&&i.from<=t&&i.more&&this.setHeight(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ai extends RM{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,r,i){return new oo(i,this.length,r,this.height,this.breaks)}replace(e,t,r){let i=r[0];return r.length==1&&(i instanceof Ai||i instanceof er&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof er?i=new Ai(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):Hr.of(r)}updateHeight(e,t=0,r=!1,i){return i&&i.from<=t&&i.more?this.setHeight(i.heights[i.index++]):(r||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class er extends Hr{constructor(e){super(e,0)}heightMetrics(e,t){let r=e.doc.lineAt(t).number,i=e.doc.lineAt(t+this.length).number,s=i-r+1,o,a=0;if(e.lineWrapping){let u=Math.min(this.height,e.lineHeight*s);o=u/s,this.length>s+1&&(a=(this.height-u)/(this.length-s-1))}else o=this.height/s;return{firstLine:r,lastLine:i,perLine:o,perChar:a}}blockAt(e,t,r,i){let{firstLine:s,lastLine:o,perLine:a,perChar:u}=this.heightMetrics(t,i);if(t.lineWrapping){let l=i+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),c=t.doc.lineAt(l),f=a+c.length*u,d=Math.max(r,e-f/2);return new oo(c.from,c.length,d,f,0)}else{let l=Math.max(0,Math.min(o-s,Math.floor((e-r)/a))),{from:c,length:f}=t.doc.line(s+l);return new oo(c,f,r+a*l,a,0)}}lineAt(e,t,r,i,s){if(t==tn.ByHeight)return this.blockAt(e,r,i,s);if(t==tn.ByPosNoHeight){let{from:g,to:m}=r.doc.lineAt(e);return new oo(g,m-g,0,0,0)}let{firstLine:o,perLine:a,perChar:u}=this.heightMetrics(r,s),l=r.doc.lineAt(e),c=a+l.length*u,f=l.number-o,d=i+a*f+u*(l.from-s-f);return new oo(l.from,l.length,Math.max(i,Math.min(d,i+this.height-c)),c,0)}forEachLine(e,t,r,i,s,o){e=Math.max(e,s),t=Math.min(t,s+this.length);let{firstLine:a,perLine:u,perChar:l}=this.heightMetrics(r,s);for(let c=e,f=i;c<=t;){let d=r.doc.lineAt(c);if(c==e){let m=d.number-a;f+=u*m+l*(e-s-m)}let g=u+l*d.length;o(new oo(d.from,d.length,f,g,0)),f+=g,c=d.to+1}}replace(e,t,r){let i=this.length-t;if(i>0){let s=r[r.length-1];s instanceof er?r[r.length-1]=new er(s.length+i):r.push(null,new er(i-1))}if(e>0){let s=r[0];s instanceof er?r[0]=new er(e+s.length):r.unshift(new er(e-1),null)}return Hr.of(r)}decomposeLeft(e,t){t.push(new er(e-1),null)}decomposeRight(e,t){t.push(null,new er(this.length-e-1))}updateHeight(e,t=0,r=!1,i){let s=t+this.length;if(i&&i.from<=t+this.length&&i.more){let o=[],a=Math.max(t,i.from),u=-1;for(i.from>t&&o.push(new er(i.from-t-1).updateHeight(e,t));a<=s&&i.more;){let c=e.doc.lineAt(a).length;o.length&&o.push(null);let f=i.heights[i.index++];u==-1?u=f:Math.abs(f-u)>=gm&&(u=-2);let d=new Ai(c,f);d.outdated=!1,o.push(d),a+=c+1}a<=s&&o.push(null,new er(s-a).updateHeight(e,a));let l=Hr.of(o);return(u<0||Math.abs(l.height-this.height)>=gm||Math.abs(u-this.heightMetrics(e,t).perLine)>=gm)&&(Oc=!0),Lm(this,l)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class fW extends Hr{constructor(e,t,r){super(e.length+t+r.length,e.height+r.height,t|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,t,r,i){let s=r+this.left.height;return e<s?this.left.blockAt(e,t,r,i):this.right.blockAt(e,t,s,i+this.left.length+this.break)}lineAt(e,t,r,i,s){let o=i+this.left.height,a=s+this.left.length+this.break,u=t==tn.ByHeight?e<o:e<a,l=u?this.left.lineAt(e,t,r,i,s):this.right.lineAt(e,t,r,o,a);if(this.break||(u?l.to<a:l.from>a))return l;let c=t==tn.ByPosNoHeight?tn.ByPosNoHeight:tn.ByPos;return u?l.join(this.right.lineAt(a,c,r,o,a)):this.left.lineAt(a,c,r,i,s).join(l)}forEachLine(e,t,r,i,s,o){let a=i+this.left.height,u=s+this.left.length+this.break;if(this.break)e<u&&this.left.forEachLine(e,t,r,i,s,o),t>=u&&this.right.forEachLine(e,t,r,a,u,o);else{let l=this.lineAt(u,tn.ByPos,r,i,s);e<l.from&&this.left.forEachLine(e,l.from-1,r,i,s,o),l.to>=e&&l.from<=t&&o(l),t>l.to&&this.right.forEachLine(l.to+1,t,r,a,u,o)}}replace(e,t,r){let i=this.left.length+this.break;if(t<i)return this.balanced(this.left.replace(e,t,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,t-i,r));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let a of r)s.push(a);if(e>0&&SE(s,o-1),t<this.length){let a=s.length;this.decomposeRight(t,s),SE(s,a)}return Hr.of(s)}decomposeLeft(e,t){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(r++,e>=r&&t.push(null)),e>r&&this.right.decomposeLeft(e-r,t)}decomposeRight(e,t){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,t);e<r&&this.left.decomposeRight(e,t),this.break&&e<i&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?Hr.of(this.break?[e,null,t]:[e,t]):(this.left=Lm(this.left,e),this.right=Lm(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,r=!1,i){let{left:s,right:o}=this,a=t+s.length+this.break,u=null;return i&&i.from<=t+s.length&&i.more?u=s=s.updateHeight(e,t,r,i):s.updateHeight(e,t,r),i&&i.from<=a+o.length&&i.more?u=o=o.updateHeight(e,a,r,i):o.updateHeight(e,a,r),u?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function SE(n,e){let t,r;n[e]==null&&(t=n[e-1])instanceof er&&(r=n[e+1])instanceof er&&n.splice(e-1,3,new er(t.length+1+r.length))}const hW=5;class fk{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let r=Math.min(t,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Ai?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Ai(r-this.pos,-1)),this.writtenTo=r,t>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,r){if(e<t||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,s=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let o=t-e;r.block?this.addBlock(new RM(o,i,r)):(o||s||i>=hW)&&this.addLineDeco(i,s,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Ai(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let r=new er(t-e);return this.oracle.doc.lineAt(e).to==t&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ai)return e;let t=new Ai(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=t,this.writtenTo=this.pos=this.pos+r}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Ai)&&!this.isCovered?this.nodes.push(new Ai(0,-1)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let i of this.nodes)i instanceof Ai&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,t,r,i){let s=new fk(r,e);return yt.spans(t,r,i,s,0),s.finish(r)}}function dW(n,e,t){let r=new pW;return yt.compare(n,e,t,r,0),r.changes}class pW{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,r,i){(e<t||r&&r.heightRelevant||i&&i.heightRelevant)&&dm(e,t,this.changes,5)}}function gW(n,e){let t=n.getBoundingClientRect(),r=n.ownerDocument,i=r.defaultView||window,s=Math.max(0,t.left),o=Math.min(i.innerWidth,t.right),a=Math.max(0,t.top),u=Math.min(i.innerHeight,t.bottom);for(let l=n.parentNode;l&&l!=r.body;)if(l.nodeType==1){let c=l,f=window.getComputedStyle(c);if((c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let d=c.getBoundingClientRect();s=Math.max(s,d.left),o=Math.min(o,d.right),a=Math.max(a,d.top),u=Math.min(l==n.parentNode?i.innerHeight:u,d.bottom)}l=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(l.nodeType==11)l=l.host;else break;return{left:s-t.left,right:Math.max(s,o)-t.left,top:a-(t.top+e),bottom:Math.max(a,u)-(t.top+e)}}function mW(n){let e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}function yW(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Gv{constructor(e,t,r,i){this.from=e,this.to=t,this.size=r,this.displaySize=i}static same(e,t){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],s=t[r];if(i.from!=s.from||i.to!=s.to||i.size!=s.size)return!1}return!0}draw(e,t){return Be.replace({widget:new vW(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class vW extends ya{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class CE{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=EE,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=nn.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(ak).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new lW(t),this.stateDeco=e.facet(kd).filter(r=>typeof r!="function"),this.heightMap=Hr.empty().applyChanges(this.stateDeco,vt.empty,this.heightOracle.setDoc(e.doc),[new ns(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Be.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let r=0;r<=1;r++){let i=r?t.head:t.anchor;if(!e.some(({from:s,to:o})=>i>=s&&i<=o)){let{from:s,to:o}=this.lineBlockAt(i);e.push(new Fg(s,o))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?EE:new hk(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Jh(e,this.scaler))})}update(e,t=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(kd).filter(c=>typeof c!="function");let i=e.changedRanges,s=ns.extendWithRanges(i,dW(r,this.stateDeco,e?e.changes:On.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);xE(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||Oc)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let u=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<u.from||t.range.head>u.to)||!this.viewportIsAppropriate(u))&&(u=this.getViewport(0,t));let l=u.from!=this.viewport.from||u.to!=this.viewport.to;this.viewport=u,e.flags|=this.updateForViewport(),(l||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(cM)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,r=window.getComputedStyle(t),i=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?nn.RTL:nn.LTR;let o=this.heightOracle.mustRefreshForWrapping(s),a=t.getBoundingClientRect(),u=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let l=0,c=0;if(a.width&&a.height){let{scaleX:S,scaleY:C}=NI(t,a);(S>.005&&Math.abs(this.scaleX-S)>.005||C>.005&&Math.abs(this.scaleY-C)>.005)&&(this.scaleX=S,this.scaleY=C,l|=16,o=u=!0)}let f=(parseInt(r.paddingTop)||0)*this.scaleY,d=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=d)&&(this.paddingTop=f,this.paddingBottom=d,l|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(u=!0),this.editorWidth=e.scrollDOM.clientWidth,l|=16);let g=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=g&&(this.scrollAnchorHeight=-1,this.scrollTop=g),this.scrolledToBottom=WI(e.scrollDOM);let m=(this.printing?yW:gW)(t,this.paddingTop),y=m.top-this.pixelViewport.top,b=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let w=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(w!=this.inView&&(this.inView=w,w&&(u=!0)),!this.inView&&!this.scrollTarget&&!mW(e.dom))return 0;let x=a.width;if((this.contentDOMWidth!=x||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,l|=16),u){let S=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(S)&&(o=!0),o||i.lineWrapping&&Math.abs(x-this.contentDOMWidth)>i.charWidth){let{lineHeight:C,charWidth:A,textHeight:I}=e.docView.measureTextSize();o=C>0&&i.refresh(s,C,A,I,x/A,S),o&&(e.docView.minWidth=0,l|=16)}y>0&&b>0?c=Math.max(y,b):y<0&&b<0&&(c=Math.min(y,b)),xE();for(let C of this.viewports){let A=C.from==this.viewport.from?S:e.docView.measureVisibleLineHeights(C);this.heightMap=(o?Hr.empty().applyChanges(this.stateDeco,vt.empty,this.heightOracle,[new ns(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new cW(C.from,A))}Oc&&(l|=2)}let _=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return _&&(l&2&&(l|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),l|=this.updateForViewport()),(l&2||_)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),l|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),l}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,u=new Fg(i.lineAt(o-r*1e3,tn.ByHeight,s,0,0).from,i.lineAt(a+(1-r)*1e3,tn.ByHeight,s,0,0).to);if(t){let{head:l}=t.range;if(l<u.from||l>u.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(l,tn.ByPos,s,0,0),d;t.y=="center"?d=(f.top+f.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&l<u.from?d=f.top:d=f.bottom-c,u=new Fg(i.lineAt(d-1e3/2,tn.ByHeight,s,0,0).from,i.lineAt(d+c+1e3/2,tn.ByHeight,s,0,0).to)}}return u}mapViewport(e,t){let r=t.mapPos(e.from,-1),i=t.mapPos(e.to,1);return new Fg(this.heightMap.lineAt(r,tn.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,tn.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,tn.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(t,tn.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:a}=this;return(e==0||i<=o-Math.max(10,Math.min(-r,250)))&&(t==this.state.doc.length||s>=a+Math.max(10,Math.min(r,250)))&&i>o-2*1e3&&s<a+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let r=[];for(let i of e)t.touchesRange(i.from,i.to)||r.push(new Gv(t.mapPos(i.from),t.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(e,t){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,s=i>>1,o=i<<1;if(this.defaultTextDirection!=nn.LTR&&!r)return[];let a=[],u=(c,f,d,g)=>{if(f-c<s)return;let m=this.state.selection.main,y=[m.from];m.empty||y.push(m.to);for(let w of y)if(w>c&&w<f){u(c,w-10,d,g),u(w+10,f,d,g);return}let b=wW(e,w=>w.from>=d.from&&w.to<=d.to&&Math.abs(w.from-c)<s&&Math.abs(w.to-f)<s&&!y.some(x=>w.from<x&&w.to>x));if(!b){if(f<d.to&&t&&r&&t.visibleRanges.some(_=>_.from<=f&&_.to>=f)){let _=t.moveToLineBoundary(me.cursor(f),!1,!0).head;_>c&&(f=_)}let w=this.gapSize(d,c,f,g),x=r||w<2e6?w:2e6;b=new Gv(c,f,w,x)}a.push(b)},l=c=>{if(c.length<o||c.type!=Ur.Text)return;let f=bW(c.from,c.to,this.stateDeco);if(f.total<o)return;let d=this.scrollTarget?this.scrollTarget.range.head:null,g,m;if(r){let y=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,b,w;if(d!=null){let x=Bg(f,d),_=((this.visibleBottom-this.visibleTop)/2+y)/c.height;b=x-_,w=x+_}else b=(this.visibleTop-c.top-y)/c.height,w=(this.visibleBottom-c.top+y)/c.height;g=Ng(f,b),m=Ng(f,w)}else{let y=f.total*this.heightOracle.charWidth,b=i*this.heightOracle.charWidth,w=0;if(y>2e6)for(let A of e)A.from>=c.from&&A.from<c.to&&A.size!=A.displaySize&&A.from*this.heightOracle.charWidth+w<this.pixelViewport.left&&(w=A.size-A.displaySize);let x=this.pixelViewport.left+w,_=this.pixelViewport.right+w,S,C;if(d!=null){let A=Bg(f,d),I=((_-x)/2+b)/y;S=A-I,C=A+I}else S=(x-b)/y,C=(_+b)/y;g=Ng(f,S),m=Ng(f,C)}g>c.from&&u(c.from,g,c,f),m<c.to&&u(m,c.to,c,f)};for(let c of this.viewportLines)Array.isArray(c.type)?c.type.forEach(l):l(c);return a}gapSize(e,t,r,i){let s=Bg(i,r)-Bg(i,t);return this.heightOracle.lineWrapping?e.height*s:i.total*this.heightOracle.charWidth*s}updateLineGaps(e){Gv.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Be.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let r=[];yt.spans(t,this.viewport.from,this.viewport.to,{span(s,o){r.push({from:s,to:o})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let s=0;s<r.length&&!(i&8);s++){let o=this.visibleRanges[s],a=r[s];(o.from!=a.from||o.to!=a.to)&&(i|=4,e&&e.mapPos(o.from,-1)==a.from&&e.mapPos(o.to,1)==a.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Jh(this.heightMap.lineAt(e,tn.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Jh(this.heightMap.lineAt(this.scaler.fromDOM(e),tn.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Jh(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Fg{constructor(e,t){this.from=e,this.to=t}}function bW(n,e,t){let r=[],i=n,s=0;return yt.spans(t,n,e,{span(){},point(o,a){o>i&&(r.push({from:i,to:o}),s+=o-i),i=a}},20),i<e&&(r.push({from:i,to:e}),s+=e-i),{total:s,ranges:r}}function Ng({total:n,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let r=Math.floor(n*t);for(let i=0;;i++){let{from:s,to:o}=e[i],a=o-s;if(r<=a)return s+r;r-=a}}function Bg(n,e){let t=0;for(let{from:r,to:i}of n.ranges){if(e<=i){t+=e-r;break}t+=i-r}return t/n.total}function wW(n,e){for(let t of n)if(e(t))return t}const EE={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};class hk{constructor(e,t,r){let i=0,s=0,o=0;this.viewports=r.map(({from:a,to:u})=>{let l=t.lineAt(a,tn.ByPos,e,0,0).top,c=t.lineAt(u,tn.ByPos,e,0,0).bottom;return i+=c-l,{from:a,to:u,top:l,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(t.height-i);for(let a of this.viewports)a.domTop=o+(a.top-s)*this.scale,o=a.domBottom=a.domTop+(a.bottom-a.top),s=a.bottom}toDOM(e){for(let t=0,r=0,i=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.top)return i+(e-r)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);r=s.bottom,i=s.domBottom}}fromDOM(e){for(let t=0,r=0,i=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.domTop)return r+(e-i)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);r=s.bottom,i=s.domBottom}}eq(e){return e instanceof hk?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,r)=>t.from==e.viewports[r].from&&t.to==e.viewports[r].to):!1}}function Jh(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),r=e.toDOM(n.bottom);return new oo(n.from,n.length,t,r-t,Array.isArray(n._content)?n._content.map(i=>Jh(i,e)):n._content)}const qg=Re.define({combine:n=>n.join(" ")}),$w=Re.define({combine:n=>n.indexOf(!0)>-1}),zw=vo.newName(),DM=vo.newName(),TM=vo.newName(),IM={"&light":"."+DM,"&dark":"."+TM};function Uw(n,e,t){return new vo(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return n;if(!t||!t[i])throw new RangeError(`Unsupported selector: ${i}`);return t[i]}):n+" "+r}})}const _W=Uw("."+zw,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},IM),kW={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Kv=Te.ie&&Te.ie_version<=11;class xW{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new iq,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let r of t)this.queue.push(r);(Te.ie&&Te.ie_version<=11||Te.ios&&e.composing)&&t.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(Te.chrome&&Te.chrome_version<126)&&(this.editContext=new CW(e),e.state.facet(na)&&(e.contentDOM.editContext=this.editContext.editContext)),Kv&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,r)=>t!=e[r]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(na)?r.root.activeElement!=this.dom:!hm(this.dom,i))return;let s=i.anchorNode&&r.docView.nearest(i.anchorNode);if(s&&s.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Te.ie&&Te.ie_version<=11||Te.android&&Te.chrome)&&!r.state.selection.main.empty&&i.focusNode&&ld(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=wd(e.root);if(!t)return!1;let r=Te.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&SW(this.view,t)||t;if(!r||this.selectionRange.eq(r))return!1;let i=hm(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&oq(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let r=this.dom;r;)if(r.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=t)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,kW),Kv&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Kv&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var r;if(!this.delayedAndroidKey){let i=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&bc(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,r=-1,i=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(i=!0),t==-1?{from:t,to:r}=o:(t=Math.min(o.from,t),r=Math.max(o.to,r)))}return{from:t,to:r,typeOver:i}}readChange(){let{from:e,to:t,typeOver:r}=this.processRecords(),i=this.selectionChanged&&hm(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new jq(this.view,e,t,r);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let r=this.view.state,i=bM(this.view,t);return this.view.state==r&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let r=AE(t,e.previousSibling||e.target.previousSibling,-1),i=AE(t,e.nextSibling||e.target.nextSibling,1);return{from:r?t.posAfter(r):t.posAtStart,to:i?t.posBefore(i):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(na)!=e.state.facet(na)&&(e.view.contentDOM.editContext=e.state.facet(na)?this.editContext.editContext:null))}destroy(){var e,t,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function AE(n,e,t){for(;e;){let r=jt.get(e);if(r&&r.parent==n)return r;let i=e.parentNode;e=i!=n.dom?i:t>0?e.nextSibling:e.previousSibling}return null}function RE(n,e){let t=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=n.docView.domAtPos(n.state.selection.main.anchor);return ld(o.node,o.offset,i,s)&&([t,r,i,s]=[i,s,t,r]),{anchorNode:t,anchorOffset:r,focusNode:i,focusOffset:s}}function SW(n,e){if(e.getComposedRanges){let i=e.getComposedRanges(n.root)[0];if(i)return RE(n,i)}let t=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),t=i.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",r,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",r,!0),t?RE(n,t):null}class CW{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let i=e.state.selection.main,{anchor:s,head:o}=i,a=this.toEditorPos(r.updateRangeStart),u=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:a,drifted:!1});let l={from:a,to:u,insert:vt.of(r.text.split(`
|
|
11
|
-
`))};if(l.from==this.from&&s<this.from?l.from=s:l.to==this.to&&s>this.to&&(l.to=s),l.from==l.to&&!l.insert.length){let c=me.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));c.main.eq(i)||e.dispatch({selection:c,userEvent:"select"});return}if((Te.mac||Te.android)&&l.from==o-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(l={from:a,to:u,insert:vt.of([r.text.replace("."," ")])}),this.pendingContextChange=l,!e.state.readOnly){let c=this.to-this.from+(l.to-l.from+l.insert.length);ck(e,l,me.single(this.toEditorPos(r.selectionStart,c),this.toEditorPos(r.selectionEnd,c)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=r=>{let i=[],s=null;for(let o=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);o<a;o++){let u=e.coordsForChar(o);s=u&&new DOMRect(u.left,u.top,u.right-u.left,u.bottom-u.top)||s||new DOMRect,i.push(s)}t.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let s of r.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(o!="None"&&a!="None"){let u=this.toEditorPos(s.rangeStart),l=this.toEditorPos(s.rangeEnd);if(u<l){let c=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${a=="Thin"?1:2}px`;i.push(Be.mark({attributes:{style:c}}).range(u,l))}}}e.dispatch({effects:hM.of(Be.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)t.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=wd(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((s,o,a,u,l)=>{if(r)return;let c=l.length-(o-s);if(i&&o>=i.to)if(i.from==s&&i.to==o&&i.insert.eq(l)){i=this.pendingContextChange=null,t+=c,this.to+=c;return}else i=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=c,this.to+=c;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+l.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),l.toString()),this.to+=c}t+=c}),i&&!r&&this.revertPending(e.state),!r}update(e){let t=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),i=this.toContextPos(t.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Ae{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(s=>r(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||sq(e.parent)||document,this.viewState=new CE(e.state||gt.create(e)),e.scrollTo&&e.scrollTo.is(Og)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Zh).map(i=>new Uv(i));for(let i of this.plugins)i.update(this);this.observer=new xW(this),this.inputState=new Vq(this),this.inputState.ensureHandlers(this.plugins),this.docView=new oE(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof Dn?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,r=!1,i,s=this.state;for(let d of e){if(d.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=d.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,a=0,u=null;e.some(d=>d.annotation(CM))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,u=EM(s,o),u||(a=1));let l=this.observer.delayedAndroidKey,c=null;if(l?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(c=null)):this.observer.clear(),s.facet(gt.phrases)!=this.state.facet(gt.phrases))return this.setState(s);i=Pm.create(this,s,e),i.flags|=a;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let d of e){if(f&&(f=f.map(d.changes)),d.scrollIntoView){let{main:g}=d.state.selection;f=new wc(g.empty?g:me.cursor(g.head,g.head>g.anchor?-1:1))}for(let g of d.effects)g.is(Og)&&(f=g.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=Fm.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),t=this.docView.update(i),this.state.facet(Xh)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(qg)!=i.state.facet(qg)&&(this.viewState.mustMeasureContent=!0),(t||r||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!i.empty)for(let d of this.state.facet(Bw))try{d(i)}catch(g){ci(this.state,g,"update listener")}(u||c)&&Promise.resolve().then(()=>{u&&this.state==u.startState&&this.dispatch(u),c&&!bM(this,c)&&l.force&&bc(this.contentDOM,l.key,l.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new CE(e),this.plugins=e.facet(Zh).map(r=>new Uv(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new oE(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Zh),r=e.state.facet(Zh);if(t!=r){let i=[];for(let s of r){let o=t.indexOf(s);if(o<0)i.push(new Uv(s));else{let a=this.plugins[o];a.mustUpdate=e,i.push(a)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);t!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(r){ci(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(o<0)if(WI(r))s=-1,o=this.viewState.heightMap.height;else{let g=this.viewState.scrollAnchorAt(i);s=g.from,o=g.top}this.updateState=1;let u=this.viewState.measure(this);if(!u&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let l=[];u&4||([this.measureRequests,l]=[l,this.measureRequests]);let c=l.map(g=>{try{return g.read(this)}catch(m){return ci(this.state,m),DE}}),f=Pm.create(this,this.state,[]),d=!1;f.flags|=u,t?t.flags|=u:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),d=this.docView.update(f),d&&this.docViewUpdate());for(let g=0;g<l.length;g++)if(c[g]!=DE)try{let m=l[g];m.write&&m.write(c[g],this)}catch(m){ci(this.state,m)}if(d&&this.docView.updateSelection(!0),!f.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let m=(s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o;if(m>1||m<-1){i=i+m,r.scrollTop=i/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let a of this.state.facet(Bw))a(t)}get themeClasses(){return zw+" "+(this.state.facet($w)?TM:DM)+" "+this.state.facet(qg)}updateAttrs(){let e=TE(this,dM,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(na)?"true":"false",class:"cm-content",style:`${Te.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),TE(this,ak,t);let r=this.observer.ignore(()=>{let i=Ow(this.contentDOM,this.contentAttrs,t),s=Ow(this.dom,this.editorAttrs,e);return i||s});return this.editorAttrs=e,this.contentAttrs=t,r}showAnnouncements(e){let t=!0;for(let r of e)for(let i of r.effects)if(i.is(Ae.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Xh);let e=this.state.facet(Ae.cspNonce);vo.mount(this.root,this.styleModules.concat(_W).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.spec!=e)&&this.pluginMap.set(e,t=this.plugins.find(r=>r.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,r){return Vv(this,e,fE(this,e,t,r))}moveByGroup(e,t){return Vv(this,e,fE(this,e,t,r=>Nq(this,e.head,r)))}visualLineSide(e,t){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),s=r[t?r.length-1:0];return me.cursor(s.side(t,i)+e.from,s.forward(!t,i)?1:-1)}moveToLineBoundary(e,t,r=!0){return Fq(this,e,t,r)}moveVertically(e,t,r){return Vv(this,e,Bq(this,e,t,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),vM(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let r=this.docView.coordsAt(e,t);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),s=this.bidiSpans(i),o=s[Ka.find(s,e-i.from,-1,t)];return F1(r,o.dir==nn.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(lM)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>EW)return tM(e.length);let t=this.textDirectionAt(e.from),r;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||eM(s.isolates,r=sE(this,e))))return s.order;r||(r=sE(this,e));let i=wq(e.text,t,r);return this.bidiCache.push(new Fm(e.from,e.to,t,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Te.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{BI(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Og.of(new wc(typeof e=="number"?me.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return Og.of(new wc(me.cursor(r.from),"start","start",r.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return mn.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return mn.define(()=>({}),{eventObservers:e})}static theme(e,t){let r=vo.newName(),i=[qg.of(r),Xh.of(Uw(`.${r}`,e))];return t&&t.dark&&i.push($w.of(!0)),i}static baseTheme(e){return hu.lowest(Xh.of(Uw("."+zw,e,IM)))}static findFromDOM(e){var t;let r=e.querySelector(".cm-content"),i=r&&jt.get(r)||jt.get(e);return((t=i?.rootView)===null||t===void 0?void 0:t.view)||null}}Ae.styleModule=Xh;Ae.inputHandler=aM;Ae.clipboardInputFilter=sk;Ae.clipboardOutputFilter=ok;Ae.scrollHandler=fM;Ae.focusChangeEffect=uM;Ae.perLineTextDirection=lM;Ae.exceptionSink=oM;Ae.updateListener=Bw;Ae.editable=na;Ae.mouseSelectionStyle=sM;Ae.dragMovesSelection=iM;Ae.clickAddsSelectionRange=rM;Ae.decorations=kd;Ae.outerDecorations=pM;Ae.atomicRanges=uk;Ae.bidiIsolatedRanges=gM;Ae.scrollMargins=mM;Ae.darkTheme=$w;Ae.cspNonce=Re.define({combine:n=>n.length?n[0]:""});Ae.contentAttributes=ak;Ae.editorAttributes=dM;Ae.lineWrapping=Ae.contentAttributes.of({class:"cm-lineWrapping"});Ae.announce=Ve.define();const EW=4096,DE={};class Fm{constructor(e,t,r,i,s,o){this.from=e,this.to=t,this.dir=r,this.isolates=i,this.fresh=s,this.order=o}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:nn.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==i&&!t.touchesRange(o.from,o.to)&&r.push(new Fm(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}}function TE(n,e,t){for(let r=n.state.facet(e),i=r.length-1;i>=0;i--){let s=r[i],o=typeof s=="function"?s(n):s;o&&Mw(o,t)}return t}const AW=Te.mac?"mac":Te.windows?"win":Te.linux?"linux":"key";function RW(n,e){const t=n.split(/-(?!$)/);let r=t[t.length-1];r=="Space"&&(r=" ");let i,s,o,a;for(let u=0;u<t.length-1;++u){const l=t[u];if(/^(cmd|meta|m)$/i.test(l))a=!0;else if(/^a(lt)?$/i.test(l))i=!0;else if(/^(c|ctrl|control)$/i.test(l))s=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))e=="mac"?a=!0:s=!0;else throw new Error("Unrecognized modifier name: "+l)}return i&&(r="Alt-"+r),s&&(r="Ctrl-"+r),a&&(r="Meta-"+r),o&&(r="Shift-"+r),r}function Wg(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}const DW=hu.default(Ae.domEventHandlers({keydown(n,e){return OM(MM(e.state),n,e,"editor")}})),Zc=Re.define({enables:DW}),IE=new WeakMap;function MM(n){let e=n.facet(Zc),t=IE.get(e);return t||IE.set(e,t=MW(e.reduce((r,i)=>r.concat(i),[]))),t}function TW(n,e,t){return OM(MM(n.state),e,n,t)}let za=null;const IW=4e3;function MW(n,e=AW){let t=Object.create(null),r=Object.create(null),i=(o,a)=>{let u=r[o];if(u==null)r[o]=a;else if(u!=a)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,a,u,l,c)=>{var f,d;let g=t[o]||(t[o]=Object.create(null)),m=a.split(/ (?!$)/).map(w=>RW(w,e));for(let w=1;w<m.length;w++){let x=m.slice(0,w).join(" ");i(x,!0),g[x]||(g[x]={preventDefault:!0,stopPropagation:!1,run:[_=>{let S=za={view:_,prefix:x,scope:o};return setTimeout(()=>{za==S&&(za=null)},IW),!0}]})}let y=m.join(" ");i(y,!1);let b=g[y]||(g[y]={preventDefault:!1,stopPropagation:!1,run:((d=(f=g._any)===null||f===void 0?void 0:f.run)===null||d===void 0?void 0:d.slice())||[]});u&&b.run.push(u),l&&(b.preventDefault=!0),c&&(b.stopPropagation=!0)};for(let o of n){let a=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let l of a){let c=t[l]||(t[l]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let d in c)c[d].run.push(g=>f(g,Hw))}let u=o[e]||o.key;if(u)for(let l of a)s(l,u,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(l,"Shift-"+u,o.shift,o.preventDefault,o.stopPropagation)}return t}let Hw=null;function OM(n,e,t,r){Hw=e;let i=eq(e),s=oi(i,0),o=so(s)==i.length&&i!=" ",a="",u=!1,l=!1,c=!1;za&&za.view==t&&za.scope==r&&(a=za.prefix+" ",_M.indexOf(e.keyCode)<0&&(l=!0,za=null));let f=new Set,d=b=>{if(b){for(let w of b.run)if(!f.has(w)&&(f.add(w),w(t)))return b.stopPropagation&&(c=!0),!0;b.preventDefault&&(b.stopPropagation&&(c=!0),l=!0)}return!1},g=n[r],m,y;return g&&(d(g[a+Wg(i,e,!o)])?u=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Te.windows&&e.ctrlKey&&e.altKey)&&(m=iu[e.keyCode])&&m!=i?(d(g[a+Wg(m,e,!0)])||e.shiftKey&&(y=bd[e.keyCode])!=i&&y!=m&&d(g[a+Wg(y,e,!1)]))&&(u=!0):o&&e.shiftKey&&d(g[a+Wg(i,e,!0)])&&(u=!0),!u&&d(g._any)&&(u=!0)),l&&(u=!0),u&&c&&e.stopPropagation(),Hw=null,u}class ip{constructor(e,t,r,i,s){this.className=e,this.left=t,this.top=r,this.width=i,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,r){if(r.empty){let i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let s=PM(e);return[new ip(t,i.left-s.left,i.top-s.top,null,i.bottom-i.top)]}else return OW(e,t,r)}}function PM(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==nn.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function ME(n,e,t,r){let i=n.coordsAtPos(e,t*2);if(!i)return r;let s=n.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,a=n.posAtCoords({x:s.left+1,y:o}),u=n.posAtCoords({x:s.right-1,y:o});return a==null||u==null?r:{from:Math.max(r.from,Math.min(a,u)),to:Math.min(r.to,Math.max(a,u))}}function OW(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let r=Math.max(t.from,n.viewport.from),i=Math.min(t.to,n.viewport.to),s=n.textDirection==nn.LTR,o=n.contentDOM,a=o.getBoundingClientRect(),u=PM(n),l=o.querySelector(".cm-line"),c=l&&window.getComputedStyle(l),f=a.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),d=a.right-(c?parseInt(c.paddingRight):0),g=Ww(n,r,1),m=Ww(n,i,-1),y=g.type==Ur.Text?g:null,b=m.type==Ur.Text?m:null;if(y&&(n.lineWrapping||g.widgetLineBreaks)&&(y=ME(n,r,1,y)),b&&(n.lineWrapping||m.widgetLineBreaks)&&(b=ME(n,i,-1,b)),y&&b&&y.from==b.from&&y.to==b.to)return x(_(t.from,t.to,y));{let C=y?_(t.from,null,y):S(g,!1),A=b?_(null,t.to,b):S(m,!0),I=[];return(y||g).to<(b||m).from-(y&&b?1:0)||g.widgetLineBreaks>1&&C.bottom+n.defaultLineHeight/2<A.top?I.push(w(f,C.bottom,d,A.top)):C.bottom<A.top&&n.elementAtHeight((C.bottom+A.top)/2).type==Ur.Text&&(C.bottom=A.top=(C.bottom+A.top)/2),x(C).concat(I).concat(x(A))}function w(C,A,I,W){return new ip(e,C-u.left,A-u.top,I-C,W-A)}function x({top:C,bottom:A,horizontal:I}){let W=[];for(let B=0;B<I.length;B+=2)W.push(w(I[B],C,I[B+1],A));return W}function _(C,A,I){let W=1e9,B=-1e9,K=[];function G(Y,q,te,ae,be){let ye=n.coordsAtPos(Y,Y==I.to?-2:2),De=n.coordsAtPos(te,te==I.from?2:-2);!ye||!De||(W=Math.min(ye.top,De.top,W),B=Math.max(ye.bottom,De.bottom,B),be==nn.LTR?K.push(s&&q?f:ye.left,s&&ae?d:De.right):K.push(!s&&ae?f:De.left,!s&&q?d:ye.right))}let F=C??I.from,R=A??I.to;for(let Y of n.visibleRanges)if(Y.to>F&&Y.from<R)for(let q=Math.max(Y.from,F),te=Math.min(Y.to,R);;){let ae=n.state.doc.lineAt(q);for(let be of n.bidiSpans(ae)){let ye=be.from+ae.from,De=be.to+ae.from;if(ye>=te)break;De>q&&G(Math.max(ye,q),C==null&&ye<=F,Math.min(De,te),A==null&&De>=R,be.dir)}if(q=ae.to+1,q>=te)break}return K.length==0&&G(F,C==null,R,A==null,n.textDirection),{top:W,bottom:B,horizontal:K}}function S(C,A){let I=a.top+(A?C.top:C.bottom);return{top:I,bottom:I,horizontal:[]}}}function PW(n,e){return n.constructor==e.constructor&&n.eq(e)}class LW{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(mm)!=e.state.facet(mm)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,r=e.facet(mm);for(;t<r.length&&r[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((t,r)=>!PW(t,this.drawn[r]))){let t=this.dom.firstChild,r=0;for(let i of e)i.update&&t&&i.constructor&&this.drawn[r].constructor&&i.update(t,this.drawn[r])?(t=t.nextSibling,r++):this.dom.insertBefore(i.draw(),t);for(;t;){let i=t.nextSibling;t.remove(),t=i}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const mm=Re.define();function LM(n){return[mn.define(e=>new LW(e,n)),mm.of(n)]}const xd=Re.define({combine(n){return So(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function FW(n={}){return[xd.of(n),NW,BW,qW,cM.of(!0)]}function FM(n){return n.startState.facet(xd)!=n.state.facet(xd)}const NW=LM({above:!0,markers(n){let{state:e}=n,t=e.facet(xd),r=[];for(let i of e.selection.ranges){let s=i==e.selection.main;if(i.empty||t.drawRangeCursor){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:me.cursor(i.head,i.head>i.anchor?-1:1);for(let u of ip.forRange(n,o,a))r.push(u)}}return r},update(n,e){n.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=FM(n);return t&&OE(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){OE(e.state,n)},class:"cm-cursorLayer"});function OE(n,e){e.style.animationDuration=n.facet(xd).cursorBlinkRate+"ms"}const BW=LM({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:ip.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||FM(n)},class:"cm-selectionLayer"}),qW=hu.highest(Ae.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),NM=Ve.define({map(n,e){return n==null?null:e.mapPos(n)}}),Qh=Tn.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,r)=>r.is(NM)?r.value:t,n)}}),WW=mn.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(Qh);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(Qh)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(Qh),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let r=n.scrollDOM.getBoundingClientRect();return{left:t.left-r.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-r.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(Qh)!=n&&this.view.dispatch({effects:NM.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function jW(){return[Qh,WW]}function PE(n,e,t,r,i){e.lastIndex=0;for(let s=n.iterRange(t,r),o=t,a;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;a=e.exec(s.value);)i(o+a.index,a)}function $W(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let r=[];for(let{from:i,to:s}of t)i=Math.max(n.state.doc.lineAt(i).from,i-e),s=Math.min(n.state.doc.lineAt(s).to,s+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=s:r.push({from:i,to:s});return r}class zW{constructor(e){const{regexp:t,decoration:r,decorate:i,boundary:s,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,i)this.addMatch=(a,u,l,c)=>i(c,l,l+a[0].length,a,u);else if(typeof r=="function")this.addMatch=(a,u,l,c)=>{let f=r(a,u,l);f&&c(l,l+a[0].length,f)};else if(r)this.addMatch=(a,u,l,c)=>c(l,l+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(e){let t=new la,r=t.add.bind(t);for(let{from:i,to:s}of $W(e,this.maxLength))PE(e.state.doc,this.regexp,i,s,(o,a)=>this.addMatch(a,e,o,r));return t.finish()}updateDeco(e,t){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((s,o,a,u)=>{u>=e.view.viewport.from&&a<=e.view.viewport.to&&(r=Math.min(a,r),i=Math.max(u,i))}),e.viewportMoved||i-r>1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,t.map(e.changes),r,i):t}updateRange(e,t,r,i){for(let s of e.visibleRanges){let o=Math.max(s.from,r),a=Math.min(s.to,i);if(a>o){let u=e.state.doc.lineAt(o),l=u.to<a?e.state.doc.lineAt(a):u,c=Math.max(s.from,u.from),f=Math.min(s.to,l.to);if(this.boundary){for(;o>u.from;o--)if(this.boundary.test(u.text[o-1-u.from])){c=o;break}for(;a<l.to;a++)if(this.boundary.test(l.text[a-l.from])){f=a;break}}let d=[],g,m=(y,b,w)=>d.push(w.range(y,b));if(u==l)for(this.regexp.lastIndex=c-u.from;(g=this.regexp.exec(u.text))&&g.index<f-u.from;)this.addMatch(g,e,g.index+u.from,m);else PE(e.state.doc,this.regexp,c,f,(y,b)=>this.addMatch(b,e,y,m));t=t.update({filterFrom:c,filterTo:f,filter:(y,b)=>y<c||b>f,add:d})}}return t}}const Vw=/x/.unicode!=null?"gu":"g",UW=new RegExp(`[\0-\b
|
|
12
|
-
--\u2028\u2029\uFEFF-]`,Vw),HW={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Zv=null;function VW(){var n;if(Zv==null&&typeof document<"u"&&document.body){let e=document.body.style;Zv=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Zv||!1}const ym=Re.define({combine(n){let e=So(n,{render:null,specialChars:UW,addSpecialChars:null});return(e.replaceTabs=!VW())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Vw)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Vw)),e}});function GW(n={}){return[ym.of(n),KW()]}let LE=null;function KW(){return LE||(LE=mn.fromClass(class{constructor(n){this.view=n,this.decorations=Be.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(ym)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new zW({regexp:n.specialChars,decoration:(e,t,r)=>{let{doc:i}=t.state,s=oi(e[0],0);if(s==9){let o=i.lineAt(r),a=t.state.tabSize,u=Kc(o.text,a,r-o.from);return Be.replace({widget:new JW((a-u%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=Be.replace({widget:new YW(n,s)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(ym);n.startState.facet(ym)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const ZW="•";function XW(n){return n>=32?ZW:n==10?"":String.fromCharCode(9216+n)}class YW extends ya{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=XW(this.code),r=e.state.phrase("Control character")+" "+(HW[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,t);if(i)return i;let s=document.createElement("span");return s.textContent=t,s.title=r,s.setAttribute("aria-label",r),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class JW extends ya{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function QW(){return tj}const ej=Be.line({class:"cm-activeLine"}),tj=mn.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let r of n.state.selection.ranges){let i=n.lineBlockAt(r.head);i.from>e&&(t.push(ej.range(i.from)),e=i.from)}return Be.set(t)}},{decorations:n=>n.decorations}),Gw=2e3;function nj(n,e,t){let r=Math.min(e.line,t.line),i=Math.max(e.line,t.line),s=[];if(e.off>Gw||t.off>Gw||e.col<0||t.col<0){let o=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let u=r;u<=i;u++){let l=n.doc.line(u);l.length<=a&&s.push(me.range(l.from+o,l.to+a))}}else{let o=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let u=r;u<=i;u++){let l=n.doc.line(u),c=Cw(l.text,o,n.tabSize,!0);if(c<0)s.push(me.cursor(l.to));else{let f=Cw(l.text,a,n.tabSize);s.push(me.range(l.from+c,l.from+f))}}}return s}function rj(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function FE(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),r=n.state.doc.lineAt(t),i=t-r.from,s=i>Gw?-1:i==r.length?rj(n,e.clientX):Kc(r.text,n.state.tabSize,t-r.from);return{line:r.number,col:s,off:i}}function ij(n,e){let t=FE(n,e),r=n.state.selection;return t?{update(i){if(i.docChanged){let s=i.changes.mapPos(i.startState.doc.line(t.line).from),o=i.state.doc.lineAt(s);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},r=r.map(i.changes)}},get(i,s,o){let a=FE(n,i);if(!a)return r;let u=nj(n.state,t,a);return u.length?o?me.create(u.concat(r.ranges)):me.create(u):r}}:null}function sj(n){let e=t=>t.altKey&&t.button==0;return Ae.mouseSelectionStyle.of((t,r)=>e(r)?ij(t,r):null)}const oj={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},aj={style:"cursor: crosshair"};function uj(n={}){let[e,t]=oj[n.key||"Alt"],r=mn.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||t(i))},keyup(i){(i.keyCode==e||!t(i))&&this.set(!1)},mousemove(i){this.set(t(i))}}});return[r,Ae.contentAttributes.of(i=>{var s;return!((s=i.plugin(r))===null||s===void 0)&&s.isDown?aj:null})]}const th="-10000px";class BM{constructor(e,t,r,i){this.facet=t,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=r(o,s))}update(e,t){var r;let i=e.state.facet(this.facet),s=i.filter(u=>u);if(i===this.input){for(let u of this.tooltipViews)u.update&&u.update(e);return!1}let o=[],a=t?[]:null;for(let u=0;u<s.length;u++){let l=s[u],c=-1;if(l){for(let f=0;f<this.tooltips.length;f++){let d=this.tooltips[f];d&&d.create==l.create&&(c=f)}if(c<0)o[u]=this.createTooltipView(l,u?o[u-1]:null),a&&(a[u]=!!l.above);else{let f=o[u]=this.tooltipViews[c];a&&(a[u]=t[c]),f.update&&f.update(e)}}}for(let u of this.tooltipViews)o.indexOf(u)<0&&(this.removeTooltipView(u),(r=u.destroy)===null||r===void 0||r.call(u));return t&&(a.forEach((u,l)=>t[l]=u),t.length=a.length),this.input=i,this.tooltips=s,this.tooltipViews=o,!0}}function lj(n={}){return vm.of(n)}function cj(n){let e=n.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const vm=Re.define({combine:n=>{var e,t,r;return{position:Te.ios?"absolute":((e=n.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(i=>i.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((r=n.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||cj}}}),NE=new WeakMap,dk=mn.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(vm);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new BM(n,pk,(t,r)=>this.createTooltip(t,r),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,r=n.state.facet(vm);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;t=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),r=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",t.dom.appendChild(i)}return t.dom.style.position=this.position,t.dom.style.top=th,t.dom.style.left="0px",this.container.insertBefore(t.dom,r),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(n=r.destroy)===null||n===void 0||n.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(Te.gecko)t=s.offsetParent!=this.container.ownerDocument.body;else if(s.style.top==th&&s.style.left=="0px"){let o=s.getBoundingClientRect();t=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(t||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(n=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=lk(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let a=this.manager.tooltipViews[o];return a.getCoords?a.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(vm).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{visible:t,space:r,scaleX:i,scaleY:s}=n,o=[];for(let a=0;a<this.manager.tooltips.length;a++){let u=this.manager.tooltips[a],l=this.manager.tooltipViews[a],{dom:c}=l,f=n.pos[a],d=n.size[a];if(!f||u.clip!==!1&&(f.bottom<=Math.max(t.top,r.top)||f.top>=Math.min(t.bottom,r.bottom)||f.right<Math.max(t.left,r.left)-.1||f.left>Math.min(t.right,r.right)+.1)){c.style.top=th;continue}let g=u.arrow?l.dom.querySelector(".cm-tooltip-arrow"):null,m=g?7:0,y=d.right-d.left,b=(e=NE.get(l))!==null&&e!==void 0?e:d.bottom-d.top,w=l.offset||hj,x=this.view.textDirection==nn.LTR,_=d.width>r.right-r.left?x?r.left:r.right-d.width:x?Math.max(r.left,Math.min(f.left-(g?14:0)+w.x,r.right-y)):Math.min(Math.max(r.left,f.left-y+(g?14:0)-w.x),r.right-y),S=this.above[a];!u.strictSide&&(S?f.top-b-m-w.y<r.top:f.bottom+b+m+w.y>r.bottom)&&S==r.bottom-f.bottom>f.top-r.top&&(S=this.above[a]=!S);let C=(S?f.top-r.top:r.bottom-f.bottom)-m;if(C<b&&l.resize!==!1){if(C<this.view.defaultLineHeight){c.style.top=th;continue}NE.set(l,b),c.style.height=(b=C)/s+"px"}else c.style.height&&(c.style.height="");let A=S?f.top-b-m-w.y:f.bottom+m+w.y,I=_+y;if(l.overlap!==!0)for(let W of o)W.left<I&&W.right>_&&W.top<A+b&&W.bottom>A&&(A=S?W.top-b-2-m:W.bottom+m+2);if(this.position=="absolute"?(c.style.top=(A-n.parent.top)/s+"px",BE(c,(_-n.parent.left)/i)):(c.style.top=A/s+"px",BE(c,_/i)),g){let W=f.left+(x?w.x:-w.x)-(_+14-7);g.style.left=W/i+"px"}l.overlap!==!0&&o.push({left:_,top:A,right:I,bottom:A+b}),c.classList.toggle("cm-tooltip-above",S),c.classList.toggle("cm-tooltip-below",!S),l.positioned&&l.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=th}},{eventObservers:{scroll(){this.maybeMeasure()}}});function BE(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+"px")}const fj=Ae.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),hj={x:0,y:0},pk=Re.define({enables:[dk,fj]}),Nm=Re.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class q1{static create(e){return new q1(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new BM(e,Nm,(t,r)=>this.createHostedView(t,r),t=>t.dom.remove())}createHostedView(e,t){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let r of this.manager.tooltipViews){let i=r[e];if(i!==void 0){if(t===void 0)t=i;else if(t!==i)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const dj=pk.compute([Nm],n=>{let e=n.facet(Nm);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var r;return(r=t.end)!==null&&r!==void 0?r:t.pos})),create:q1.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class pj{constructor(e,t,r,i,s){this.view=e,this.source=t,this.field=r,this.setHover=i,this.hoverTime=s,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,r=e.docView.nearest(t.target);if(!r)return;let i,s=1;if(r instanceof Ga)i=r.posAtStart;else{if(i=e.posAtCoords(t),i==null)return;let a=e.coordsAtPos(i);if(!a||t.y<a.top||t.y>a.bottom||t.x<a.left-e.defaultCharacterWidth||t.x>a.right+e.defaultCharacterWidth)return;let u=e.bidiSpans(e.state.doc.lineAt(i)).find(c=>c.from<=i&&c.to>=i),l=u&&u.dir==nn.RTL?-1:1;s=t.x<a.left?-l:l}let o=this.source(e,i,s);if(o?.then){let a=this.pending={pos:i};o.then(u=>{this.pending==a&&(this.pending=null,u&&!(Array.isArray(u)&&!u.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(u)?u:[u])}))},u=>ci(e.state,u,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(dk),t=e?e.manager.tooltips.findIndex(r=>r.create==q1.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:s}=this;if(i.length&&s&&!gj(s.dom,e)||this.pending){let{pos:o}=i[0]||this.pending,a=(r=(t=i[0])===null||t===void 0?void 0:t.end)!==null&&r!==void 0?r:o;(o==a?this.view.posAtCoords(this.lastMove)!=o:!mj(this.view,o,a,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=r=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const jg=4;function gj(n,e){let{left:t,right:r,top:i,bottom:s}=n.getBoundingClientRect(),o;if(o=n.querySelector(".cm-tooltip-arrow")){let a=o.getBoundingClientRect();i=Math.min(a.top,i),s=Math.max(a.bottom,s)}return e.clientX>=t-jg&&e.clientX<=r+jg&&e.clientY>=i-jg&&e.clientY<=s+jg}function mj(n,e,t,r,i,s){let o=n.scrollDOM.getBoundingClientRect(),a=n.documentTop+n.documentPadding.top+n.contentHeight;if(o.left>r||o.right<r||o.top>i||Math.min(o.bottom,a)<i)return!1;let u=n.posAtCoords({x:r,y:i},!1);return u>=e&&u<=t}function qM(n,e={}){let t=Ve.define(),r=Tn.define({create(){return[]},update(i,s){if(i.length&&(e.hideOnChange&&(s.docChanged||s.selection)?i=[]:e.hideOn&&(i=i.filter(o=>!e.hideOn(s,o))),s.docChanged)){let o=[];for(let a of i){let u=s.changes.mapPos(a.pos,-1,ar.TrackDel);if(u!=null){let l=Object.assign(Object.create(null),a);l.pos=u,l.end!=null&&(l.end=s.changes.mapPos(l.end)),o.push(l)}}i=o}for(let o of s.effects)o.is(t)&&(i=o.value),o.is(yj)&&(i=[]);return i},provide:i=>Nm.from(i)});return{active:r,extension:[r,mn.define(i=>new pj(i,n,r,t,e.hoverTime||300)),dj]}}function WM(n,e){let t=n.plugin(dk);if(!t)return null;let r=t.manager.tooltips.indexOf(e);return r<0?null:t.manager.tooltipViews[r]}const yj=Ve.define(),qE=Re.define({combine(n){let e,t;for(let r of n)e=e||r.topContainer,t=t||r.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Sd(n,e){let t=n.plugin(jM),r=t?t.specs.indexOf(e):-1;return r>-1?t.panels[r]:null}const jM=mn.fromClass(class{constructor(n){this.input=n.state.facet(Pc),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(qE);this.top=new $g(n,!0,e.topContainer),this.bottom=new $g(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(qE);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new $g(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new $g(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(Pc);if(t!=this.input){let r=t.filter(u=>u),i=[],s=[],o=[],a=[];for(let u of r){let l=this.specs.indexOf(u),c;l<0?(c=u(n.view),a.push(c)):(c=this.panels[l],c.update&&c.update(n)),i.push(c),(c.top?s:o).push(c)}this.specs=r,this.panels=i,this.top.sync(s),this.bottom.sync(o);for(let u of a)u.dom.classList.add("cm-panel"),u.mount&&u.mount()}else for(let r of this.panels)r.update&&r.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>Ae.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class $g{constructor(e,t,r){this.view=e,this.top=t,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=WE(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=WE(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function WE(n){let e=n.nextSibling;return n.remove(),e}const Pc=Re.define({enables:jM});class fa extends ll{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}fa.prototype.elementClass="";fa.prototype.toDOM=void 0;fa.prototype.mapMode=ar.TrackBefore;fa.prototype.startSide=fa.prototype.endSide=-1;fa.prototype.point=!0;const bm=Re.define(),vj=Re.define(),bj={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>yt.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},fd=Re.define();function wj(n){return[$M(),fd.of(Object.assign(Object.assign({},bj),n))]}const jE=Re.define({combine:n=>n.some(e=>e)});function $M(n){return[_j]}const _j=mn.fromClass(class{constructor(n){this.view=n,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(fd).map(e=>new zE(n,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!n.state.facet(jE),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,r=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(r<(t.to-t.from)*.8)}n.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(jE)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&this.dom.remove();let t=yt.iter(this.view.state.facet(bm),this.view.viewport.from),r=[],i=this.gutters.map(s=>new kj(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(s.type)){let o=!0;for(let a of s.type)if(a.type==Ur.Text&&o){Kw(t,r,a.from);for(let u of i)u.line(this.view,a,r);o=!1}else if(a.widget)for(let u of i)u.widget(this.view,a)}else if(s.type==Ur.Text){Kw(t,r,s.from);for(let o of i)o.line(this.view,s,r)}else if(s.widget)for(let o of i)o.widget(this.view,s);for(let s of i)s.finish();n&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(n){let e=n.startState.facet(fd),t=n.state.facet(fd),r=n.docChanged||n.heightChanged||n.viewportChanged||!yt.eq(n.startState.facet(bm),n.state.facet(bm),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let i of this.gutters)i.update(n)&&(r=!0);else{r=!0;let i=[];for(let s of t){let o=e.indexOf(s);o<0?i.push(new zE(this.view,s)):(this.gutters[o].update(n),i.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),i.indexOf(s)<0&&s.destroy();for(let s of i)this.dom.appendChild(s.dom);this.gutters=i}return r}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove()}},{provide:n=>Ae.scrollMargins.of(e=>{let t=e.plugin(n);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==nn.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function $E(n){return Array.isArray(n)?n:[n]}function Kw(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class kj{constructor(e,t,r){this.gutter=e,this.height=r,this.i=0,this.cursor=yt.iter(e.markers,t.from)}addElement(e,t,r){let{gutter:i}=this,s=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==i.elements.length){let a=new zM(e,o,s,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(e,o,s,r);this.height=t.bottom,this.i++}line(e,t,r){let i=[];Kw(this.cursor,i,t.from),r.length&&(i=i.concat(r));let s=this.gutter.config.lineMarker(e,t,i);s&&i.unshift(s);let o=this.gutter;i.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,i)}widget(e,t){let r=this.gutter.config.widgetMarker(e,t.widget,t),i=r?[r]:null;for(let s of e.state.facet(vj)){let o=s(e,t.widget,t);o&&(i||(i=[])).push(o)}i&&this.addElement(e,t,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class zE{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in t.domEventHandlers)this.dom.addEventListener(r,i=>{let s=i.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let u=s.getBoundingClientRect();o=(u.top+u.bottom)/2}else o=i.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[r](e,a,i)&&i.preventDefault()});this.markers=$E(t.markers(e)),t.initialSpacer&&(this.spacer=new zM(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=$E(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!yt.eq(this.markers,t,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class zM{constructor(e,t,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,r,i)}update(e,t,r,i){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),xj(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,t){let r="cm-gutterElement",i=this.dom.firstChild;for(let s=0,o=0;;){let a=o,u=s<t.length?t[s++]:null,l=!1;if(u){let c=u.elementClass;c&&(r+=" "+c);for(let f=o;f<this.markers.length;f++)if(this.markers[f].compare(u)){a=f,l=!0;break}}else a=this.markers.length;for(;o<a;){let c=this.markers[o++];if(c.toDOM){c.destroy(i);let f=i.nextSibling;i.remove(),i=f}}if(!u)break;u.toDOM&&(l?i=i.nextSibling:this.dom.insertBefore(u.toDOM(e),i)),l&&o++}this.dom.className=r,this.markers=t}destroy(){this.setMarkers(null,[])}}function xj(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].compare(e[t]))return!1;return!0}const Sj=Re.define(),Cj=Re.define(),hc=Re.define({combine(n){return So(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let r=Object.assign({},e);for(let i in t){let s=r[i],o=t[i];r[i]=s?(a,u,l)=>s(a,u,l)||o(a,u,l):o}return r}})}});class Xv extends fa{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Yv(n,e){return n.state.facet(hc).formatNumber(e,n.state)}const Ej=fd.compute([hc],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(Sj)},lineMarker(e,t,r){return r.some(i=>i.toDOM)?null:new Xv(Yv(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,r)=>{for(let i of e.state.facet(Cj)){let s=i(e,t,r);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(hc)!=e.state.facet(hc),initialSpacer(e){return new Xv(Yv(e,UE(e.state.doc.lines)))},updateSpacer(e,t){let r=Yv(t.view,UE(t.view.state.doc.lines));return r==e.number?e:new Xv(r)},domEventHandlers:n.facet(hc).domEventHandlers}));function Aj(n={}){return[hc.of(n),$M(),Ej]}function UE(n){let e=9;for(;e<n;)e=e*10+9;return e}const Rj=new class extends fa{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},Dj=bm.compute(["selection"],n=>{let e=[],t=-1;for(let r of n.selection.ranges){let i=n.doc.lineAt(r.head).from;i>t&&(t=i,e.push(Rj.range(i)))}return yt.of(e)});function Tj(){return Dj}var zg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ij(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function W1(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var e=n.default;if(typeof e=="function"){var t=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var ed={exports:{}};/**
|
|
13
|
-
* @license
|
|
14
|
-
* Lodash <https://lodash.com/>
|
|
15
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
16
|
-
* Released under MIT license <https://lodash.com/license>
|
|
17
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
18
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
19
|
-
*/var Mj=ed.exports,HE;function Oj(){return HE||(HE=1,function(n,e){(function(){var t,r="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",l=500,c="__lodash_placeholder__",f=1,d=2,g=4,m=1,y=2,b=1,w=2,x=4,_=8,S=16,C=32,A=64,I=128,W=256,B=512,K=30,G="...",F=800,R=16,Y=1,q=2,te=3,ae=1/0,be=9007199254740991,ye=17976931348623157e292,De=NaN,we=4294967295,Pe=we-1,Rt=we>>>1,kt=[["ary",I],["bind",b],["bindKey",w],["curry",_],["curryRight",S],["flip",B],["partial",C],["partialRight",A],["rearg",W]],rt="[object Arguments]",Xt="[object Array]",Bn="[object AsyncFunction]",rn="[object Boolean]",yn="[object Date]",Pt="[object DOMException]",Se="[object Error]",Ye="[object Function]",In="[object GeneratorFunction]",Le="[object Map]",$t="[object Number]",Cn="[object Null]",Yt="[object Object]",at="[object Promise]",qn="[object Proxy]",Dt="[object RegExp]",ct="[object Set]",hr="[object String]",ls="[object Symbol]",ka="[object Undefined]",Xr="[object WeakMap]",Fs="[object WeakSet]",dr="[object ArrayBuffer]",En="[object DataView]",Tt="[object Float32Array]",cs="[object Float64Array]",fs="[object Int8Array]",Tr="[object Int16Array]",Oi="[object Int32Array]",hs="[object Uint8Array]",mi="[object Uint8ClampedArray]",ds="[object Uint16Array]",Ns="[object Uint32Array]",Do=/\b__p \+= '';/g,xa=/\b(__p \+=) '' \+/g,To=/(__e\(.*?\)|\b__t\)) \+\n'';/g,pr=/&(?:amp|lt|gt|quot|#39);/g,Bs=/[&<>"']/g,ps=RegExp(pr.source),gs=RegExp(Bs.source),Io=/<%-([\s\S]+?)%>/g,ms=/<%([\s\S]+?)%>/g,Mo=/<%=([\s\S]+?)%>/g,Ir=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Yr=/^\w*$/,Oo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pi=/[\\^$.*+?()[\]{}|]/g,Li=RegExp(Pi.source),ys=/^\s+/,L=/\s/,Jt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Qt=/\{\n\/\* \[wrapped with (.+)\] \*/,qe=/,? & /,z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,de=/[()=,{}\[\]\/\s]/,ke=/\\(\\)?/g,Me=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,xt=/\w*$/,_t=/^[-+]0x[0-9a-f]+$/i,zt=/^0b[01]+$/i,en=/^\[object .+?Constructor\]$/,it=/^0o[0-7]+$/i,Nt=/^(?:0|[1-9]\d*)$/,st=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ut=/($^)/,on=/['\n\r\u2028\u2029\\]/g,Xn="\\ud800-\\udfff",hf="\\u0300-\\u036f",Dp="\\ufe20-\\ufe2f",Cy="\\u20d0-\\u20ff",mu=hf+Dp+Cy,Al="\\u2700-\\u27bf",Rl="a-z\\xdf-\\xf6\\xf8-\\xff",df="\\xac\\xb1\\xd7\\xf7",Tp="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ey="\\u2000-\\u206f",Ay=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ip="A-Z\\xc0-\\xd6\\xd8-\\xde",Mp="\\ufe0e\\ufe0f",Op=df+Tp+Ey+Ay,Dl="['’]",Ry="["+Xn+"]",Tl="["+Op+"]",Il="["+mu+"]",pf="\\d+",qs="["+Al+"]",Pp="["+Rl+"]",Ml="[^"+Xn+Op+pf+Al+Rl+Ip+"]",gf="\\ud83c[\\udffb-\\udfff]",Dy="(?:"+Il+"|"+gf+")",mf="[^"+Xn+"]",yf="(?:\\ud83c[\\udde6-\\uddff]){2}",yu="[\\ud800-\\udbff][\\udc00-\\udfff]",Sa="["+Ip+"]",Ol="\\u200d",Lp="(?:"+Pp+"|"+Ml+")",Ty="(?:"+Sa+"|"+Ml+")",vf="(?:"+Dl+"(?:d|ll|m|re|s|t|ve))?",bf="(?:"+Dl+"(?:D|LL|M|RE|S|T|VE))?",Fp=Dy+"?",wf="["+Mp+"]?",Iy="(?:"+Ol+"(?:"+[mf,yf,yu].join("|")+")"+wf+Fp+")*",My="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Np="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",_f=wf+Fp+Iy,Oy="(?:"+[qs,yf,yu].join("|")+")"+_f,kf="(?:"+[mf+Il+"?",Il,yf,yu,Ry].join("|")+")",Py=RegExp(Dl,"g"),Bp=RegExp(Il,"g"),vs=RegExp(gf+"(?="+gf+")|"+kf+_f,"g"),qp=RegExp([Sa+"?"+Pp+"+"+vf+"(?="+[Tl,Sa,"$"].join("|")+")",Ty+"+"+bf+"(?="+[Tl,Sa+Lp,"$"].join("|")+")",Sa+"?"+Lp+"+"+vf,Sa+"+"+bf,Np,My,pf,Oy].join("|"),"g"),gr=RegExp("["+Ol+Xn+mu+Mp+"]"),Pl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ll=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ws=-1,Qe={};Qe[Tt]=Qe[cs]=Qe[fs]=Qe[Tr]=Qe[Oi]=Qe[hs]=Qe[mi]=Qe[ds]=Qe[Ns]=!0,Qe[rt]=Qe[Xt]=Qe[dr]=Qe[rn]=Qe[En]=Qe[yn]=Qe[Se]=Qe[Ye]=Qe[Le]=Qe[$t]=Qe[Yt]=Qe[Dt]=Qe[ct]=Qe[hr]=Qe[Xr]=!1;var It={};It[rt]=It[Xt]=It[dr]=It[En]=It[rn]=It[yn]=It[Tt]=It[cs]=It[fs]=It[Tr]=It[Oi]=It[Le]=It[$t]=It[Yt]=It[Dt]=It[ct]=It[hr]=It[ls]=It[hs]=It[mi]=It[ds]=It[Ns]=!0,It[Se]=It[Ye]=It[Xr]=!1;var Ly={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Fl={"&":"&","<":"<",">":">",'"':""","'":"'"},bs={"&":"&","<":"<",">":">",""":'"',"'":"'"},vu={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},yi=parseFloat,Ca=parseInt,Nl=typeof zg=="object"&&zg&&zg.Object===Object&&zg,xf=typeof self=="object"&&self&&self.Object===Object&&self,vn=Nl||xf||Function("return this")(),Bl=e&&!e.nodeType&&e,ws=Bl&&!0&&n&&!n.nodeType&&n,bu=ws&&ws.exports===Bl,ql=bu&&Nl.process,Jr=function(){try{var T=ws&&ws.require&&ws.require("util").types;return T||ql&&ql.binding&&ql.binding("util")}catch{}}(),Wp=Jr&&Jr.isArrayBuffer,Sf=Jr&&Jr.isDate,Cf=Jr&&Jr.isMap,Ef=Jr&&Jr.isRegExp,Ea=Jr&&Jr.isSet,Aa=Jr&&Jr.isTypedArray;function Mr(T,j,V){switch(V.length){case 0:return T.call(j);case 1:return T.call(j,V[0]);case 2:return T.call(j,V[0],V[1]);case 3:return T.call(j,V[0],V[1],V[2])}return T.apply(j,V)}function jp(T,j,V,ue){for(var _e=-1,$=T==null?0:T.length;++_e<$;){var ee=T[_e];j(ue,ee,V(ee),T)}return ue}function mr(T,j){for(var V=-1,ue=T==null?0:T.length;++V<ue&&j(T[V],V,T)!==!1;);return T}function Fy(T,j){for(var V=T==null?0:T.length;V--&&j(T[V],V,T)!==!1;);return T}function Af(T,j){for(var V=-1,ue=T==null?0:T.length;++V<ue;)if(!j(T[V],V,T))return!1;return!0}function js(T,j){for(var V=-1,ue=T==null?0:T.length,_e=0,$=[];++V<ue;){var ee=T[V];j(ee,V,T)&&($[_e++]=ee)}return $}function Wl(T,j){var V=T==null?0:T.length;return!!V&&Fi(T,j,0)>-1}function Rf(T,j,V){for(var ue=-1,_e=T==null?0:T.length;++ue<_e;)if(V(j,T[ue]))return!0;return!1}function Bt(T,j){for(var V=-1,ue=T==null?0:T.length,_e=Array(ue);++V<ue;)_e[V]=j(T[V],V,T);return _e}function $s(T,j){for(var V=-1,ue=j.length,_e=T.length;++V<ue;)T[_e+V]=j[V];return T}function Df(T,j,V,ue){var _e=-1,$=T==null?0:T.length;for(ue&&$&&(V=T[++_e]);++_e<$;)V=j(V,T[_e],_e,T);return V}function $p(T,j,V,ue){var _e=T==null?0:T.length;for(ue&&_e&&(V=T[--_e]);_e--;)V=j(V,T[_e],_e,T);return V}function Tf(T,j){for(var V=-1,ue=T==null?0:T.length;++V<ue;)if(j(T[V],V,T))return!0;return!1}var zp=wu("length");function Ny(T){return T.split("")}function By(T){return T.match(z)||[]}function Up(T,j,V){var ue;return V(T,function(_e,$,ee){if(j(_e,$,ee))return ue=$,!1}),ue}function vi(T,j,V,ue){for(var _e=T.length,$=V+(ue?1:-1);ue?$--:++$<_e;)if(j(T[$],$,T))return $;return-1}function Fi(T,j,V){return j===j?Hy(T,j,V):vi(T,Hp,V)}function Po(T,j,V,ue){for(var _e=V-1,$=T.length;++_e<$;)if(ue(T[_e],j))return _e;return-1}function Hp(T){return T!==T}function If(T,j){var V=T==null?0:T.length;return V?Mf(T,j)/V:De}function wu(T){return function(j){return j==null?t:j[T]}}function jl(T){return function(j){return T==null?t:T[j]}}function _u(T,j,V,ue,_e){return _e(T,function($,ee,re){V=ue?(ue=!1,$):j(V,$,ee,re)}),V}function qy(T,j){var V=T.length;for(T.sort(j);V--;)T[V]=T[V].value;return T}function Mf(T,j){for(var V,ue=-1,_e=T.length;++ue<_e;){var $=j(T[ue]);$!==t&&(V=V===t?$:V+$)}return V}function $l(T,j){for(var V=-1,ue=Array(T);++V<T;)ue[V]=j(V);return ue}function Of(T,j){return Bt(j,function(V){return[V,T[V]]})}function Vp(T){return T&&T.slice(0,Kp(T)+1).replace(ys,"")}function Or(T){return function(j){return T(j)}}function Pf(T,j){return Bt(j,function(V){return T[V]})}function ku(T,j){return T.has(j)}function Lf(T,j){for(var V=-1,ue=T.length;++V<ue&&Fi(j,T[V],0)>-1;);return V}function Gp(T,j){for(var V=T.length;V--&&Fi(j,T[V],0)>-1;);return V}function Wy(T,j){for(var V=T.length,ue=0;V--;)T[V]===j&&++ue;return ue}var jy=jl(Ly),Ff=jl(Fl);function Nf(T){return"\\"+vu[T]}function $y(T,j){return T==null?t:T[j]}function Ra(T){return gr.test(T)}function zy(T){return Pl.test(T)}function zl(T){for(var j,V=[];!(j=T.next()).done;)V.push(j.value);return V}function Ul(T){var j=-1,V=Array(T.size);return T.forEach(function(ue,_e){V[++j]=[_e,ue]}),V}function Hl(T,j){return function(V){return T(j(V))}}function _s(T,j){for(var V=-1,ue=T.length,_e=0,$=[];++V<ue;){var ee=T[V];(ee===j||ee===c)&&(T[V]=c,$[_e++]=V)}return $}function Vl(T){var j=-1,V=Array(T.size);return T.forEach(function(ue){V[++j]=ue}),V}function Uy(T){var j=-1,V=Array(T.size);return T.forEach(function(ue){V[++j]=[ue,ue]}),V}function Hy(T,j,V){for(var ue=V-1,_e=T.length;++ue<_e;)if(T[ue]===j)return ue;return-1}function Vy(T,j,V){for(var ue=V+1;ue--;)if(T[ue]===j)return ue;return ue}function Da(T){return Ra(T)?O(T):zp(T)}function Pr(T){return Ra(T)?H(T):Ny(T)}function Kp(T){for(var j=T.length;j--&&L.test(T.charAt(j)););return j}var D=jl(bs);function O(T){for(var j=vs.lastIndex=0;vs.test(T);)++j;return j}function H(T){return T.match(vs)||[]}function X(T){return T.match(qp)||[]}var Q=function T(j){j=j==null?vn:J.defaults(vn.Object(),j,J.pick(vn,Ll));var V=j.Array,ue=j.Date,_e=j.Error,$=j.Function,ee=j.Math,re=j.Object,ce=j.RegExp,Ee=j.String,Oe=j.TypeError,He=V.prototype,Ge=$.prototype,We=re.prototype,Ht=j["__core-js_shared__"],bn=Ge.toString,ft=We.hasOwnProperty,Lo=0,Bf=function(){var h=/[^.]+$/.exec(Ht&&Ht.keys&&Ht.keys.IE_PROTO||"");return h?"Symbol(src)_1."+h:""}(),Zp=We.toString,RL=bn.call(re),DL=vn._,TL=ce("^"+bn.call(ft).replace(Pi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Xp=bu?j.Buffer:t,Ta=j.Symbol,Yp=j.Uint8Array,eS=Xp?Xp.allocUnsafe:t,Jp=Hl(re.getPrototypeOf,re),tS=re.create,nS=We.propertyIsEnumerable,Qp=He.splice,rS=Ta?Ta.isConcatSpreadable:t,qf=Ta?Ta.iterator:t,xu=Ta?Ta.toStringTag:t,eg=function(){try{var h=Ru(re,"defineProperty");return h({},"",{}),h}catch{}}(),IL=j.clearTimeout!==vn.clearTimeout&&j.clearTimeout,ML=ue&&ue.now!==vn.Date.now&&ue.now,OL=j.setTimeout!==vn.setTimeout&&j.setTimeout,tg=ee.ceil,ng=ee.floor,Gy=re.getOwnPropertySymbols,PL=Xp?Xp.isBuffer:t,iS=j.isFinite,LL=He.join,FL=Hl(re.keys,re),Mn=ee.max,yr=ee.min,NL=ue.now,BL=j.parseInt,sS=ee.random,qL=He.reverse,Ky=Ru(j,"DataView"),Wf=Ru(j,"Map"),Zy=Ru(j,"Promise"),Gl=Ru(j,"Set"),jf=Ru(j,"WeakMap"),$f=Ru(re,"create"),rg=jf&&new jf,Kl={},WL=Du(Ky),jL=Du(Wf),$L=Du(Zy),zL=Du(Gl),UL=Du(jf),ig=Ta?Ta.prototype:t,zf=ig?ig.valueOf:t,oS=ig?ig.toString:t;function M(h){if(pn(h)&&!Ze(h)&&!(h instanceof ht)){if(h instanceof Ni)return h;if(ft.call(h,"__wrapped__"))return aC(h)}return new Ni(h)}var Zl=function(){function h(){}return function(p){if(!an(p))return{};if(tS)return tS(p);h.prototype=p;var v=new h;return h.prototype=t,v}}();function sg(){}function Ni(h,p){this.__wrapped__=h,this.__actions__=[],this.__chain__=!!p,this.__index__=0,this.__values__=t}M.templateSettings={escape:Io,evaluate:ms,interpolate:Mo,variable:"",imports:{_:M}},M.prototype=sg.prototype,M.prototype.constructor=M,Ni.prototype=Zl(sg.prototype),Ni.prototype.constructor=Ni;function ht(h){this.__wrapped__=h,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=we,this.__views__=[]}function HL(){var h=new ht(this.__wrapped__);return h.__actions__=Qr(this.__actions__),h.__dir__=this.__dir__,h.__filtered__=this.__filtered__,h.__iteratees__=Qr(this.__iteratees__),h.__takeCount__=this.__takeCount__,h.__views__=Qr(this.__views__),h}function VL(){if(this.__filtered__){var h=new ht(this);h.__dir__=-1,h.__filtered__=!0}else h=this.clone(),h.__dir__*=-1;return h}function GL(){var h=this.__wrapped__.value(),p=this.__dir__,v=Ze(h),k=p<0,E=v?h.length:0,P=s5(0,E,this.__views__),U=P.start,Z=P.end,ne=Z-U,pe=k?Z:U-1,ge=this.__iteratees__,ve=ge.length,Ce=0,Fe=yr(ne,this.__takeCount__);if(!v||!k&&E==ne&&Fe==ne)return TS(h,this.__actions__);var $e=[];e:for(;ne--&&Ce<Fe;){pe+=p;for(var et=-1,ze=h[pe];++et<ve;){var ut=ge[et],pt=ut.iteratee,_i=ut.type,Nr=pt(ze);if(_i==q)ze=Nr;else if(!Nr){if(_i==Y)continue e;break e}}$e[Ce++]=ze}return $e}ht.prototype=Zl(sg.prototype),ht.prototype.constructor=ht;function Su(h){var p=-1,v=h==null?0:h.length;for(this.clear();++p<v;){var k=h[p];this.set(k[0],k[1])}}function KL(){this.__data__=$f?$f(null):{},this.size=0}function ZL(h){var p=this.has(h)&&delete this.__data__[h];return this.size-=p?1:0,p}function XL(h){var p=this.__data__;if($f){var v=p[h];return v===u?t:v}return ft.call(p,h)?p[h]:t}function YL(h){var p=this.__data__;return $f?p[h]!==t:ft.call(p,h)}function JL(h,p){var v=this.__data__;return this.size+=this.has(h)?0:1,v[h]=$f&&p===t?u:p,this}Su.prototype.clear=KL,Su.prototype.delete=ZL,Su.prototype.get=XL,Su.prototype.has=YL,Su.prototype.set=JL;function Fo(h){var p=-1,v=h==null?0:h.length;for(this.clear();++p<v;){var k=h[p];this.set(k[0],k[1])}}function QL(){this.__data__=[],this.size=0}function eF(h){var p=this.__data__,v=og(p,h);if(v<0)return!1;var k=p.length-1;return v==k?p.pop():Qp.call(p,v,1),--this.size,!0}function tF(h){var p=this.__data__,v=og(p,h);return v<0?t:p[v][1]}function nF(h){return og(this.__data__,h)>-1}function rF(h,p){var v=this.__data__,k=og(v,h);return k<0?(++this.size,v.push([h,p])):v[k][1]=p,this}Fo.prototype.clear=QL,Fo.prototype.delete=eF,Fo.prototype.get=tF,Fo.prototype.has=nF,Fo.prototype.set=rF;function No(h){var p=-1,v=h==null?0:h.length;for(this.clear();++p<v;){var k=h[p];this.set(k[0],k[1])}}function iF(){this.size=0,this.__data__={hash:new Su,map:new(Wf||Fo),string:new Su}}function sF(h){var p=vg(this,h).delete(h);return this.size-=p?1:0,p}function oF(h){return vg(this,h).get(h)}function aF(h){return vg(this,h).has(h)}function uF(h,p){var v=vg(this,h),k=v.size;return v.set(h,p),this.size+=v.size==k?0:1,this}No.prototype.clear=iF,No.prototype.delete=sF,No.prototype.get=oF,No.prototype.has=aF,No.prototype.set=uF;function Cu(h){var p=-1,v=h==null?0:h.length;for(this.__data__=new No;++p<v;)this.add(h[p])}function lF(h){return this.__data__.set(h,u),this}function cF(h){return this.__data__.has(h)}Cu.prototype.add=Cu.prototype.push=lF,Cu.prototype.has=cF;function ks(h){var p=this.__data__=new Fo(h);this.size=p.size}function fF(){this.__data__=new Fo,this.size=0}function hF(h){var p=this.__data__,v=p.delete(h);return this.size=p.size,v}function dF(h){return this.__data__.get(h)}function pF(h){return this.__data__.has(h)}function gF(h,p){var v=this.__data__;if(v instanceof Fo){var k=v.__data__;if(!Wf||k.length<i-1)return k.push([h,p]),this.size=++v.size,this;v=this.__data__=new No(k)}return v.set(h,p),this.size=v.size,this}ks.prototype.clear=fF,ks.prototype.delete=hF,ks.prototype.get=dF,ks.prototype.has=pF,ks.prototype.set=gF;function aS(h,p){var v=Ze(h),k=!v&&Tu(h),E=!v&&!k&&La(h),P=!v&&!k&&!E&&Ql(h),U=v||k||E||P,Z=U?$l(h.length,Ee):[],ne=Z.length;for(var pe in h)(p||ft.call(h,pe))&&!(U&&(pe=="length"||E&&(pe=="offset"||pe=="parent")||P&&(pe=="buffer"||pe=="byteLength"||pe=="byteOffset")||jo(pe,ne)))&&Z.push(pe);return Z}function uS(h){var p=h.length;return p?h[ov(0,p-1)]:t}function mF(h,p){return bg(Qr(h),Eu(p,0,h.length))}function yF(h){return bg(Qr(h))}function Xy(h,p,v){(v!==t&&!xs(h[p],v)||v===t&&!(p in h))&&Bo(h,p,v)}function Uf(h,p,v){var k=h[p];(!(ft.call(h,p)&&xs(k,v))||v===t&&!(p in h))&&Bo(h,p,v)}function og(h,p){for(var v=h.length;v--;)if(xs(h[v][0],p))return v;return-1}function vF(h,p,v,k){return Ia(h,function(E,P,U){p(k,E,v(E),U)}),k}function lS(h,p){return h&&Us(p,Wn(p),h)}function bF(h,p){return h&&Us(p,ti(p),h)}function Bo(h,p,v){p=="__proto__"&&eg?eg(h,p,{configurable:!0,enumerable:!0,value:v,writable:!0}):h[p]=v}function Yy(h,p){for(var v=-1,k=p.length,E=V(k),P=h==null;++v<k;)E[v]=P?t:Iv(h,p[v]);return E}function Eu(h,p,v){return h===h&&(v!==t&&(h=h<=v?h:v),p!==t&&(h=h>=p?h:p)),h}function Bi(h,p,v,k,E,P){var U,Z=p&f,ne=p&d,pe=p&g;if(v&&(U=E?v(h,k,E,P):v(h)),U!==t)return U;if(!an(h))return h;var ge=Ze(h);if(ge){if(U=a5(h),!Z)return Qr(h,U)}else{var ve=vr(h),Ce=ve==Ye||ve==In;if(La(h))return OS(h,Z);if(ve==Yt||ve==rt||Ce&&!E){if(U=ne||Ce?{}:JS(h),!Z)return ne?XF(h,bF(U,h)):ZF(h,lS(U,h))}else{if(!It[ve])return E?h:{};U=u5(h,ve,Z)}}P||(P=new ks);var Fe=P.get(h);if(Fe)return Fe;P.set(h,U),AC(h)?h.forEach(function(ze){U.add(Bi(ze,p,v,ze,h,P))}):CC(h)&&h.forEach(function(ze,ut){U.set(ut,Bi(ze,p,v,ut,h,P))});var $e=pe?ne?yv:mv:ne?ti:Wn,et=ge?t:$e(h);return mr(et||h,function(ze,ut){et&&(ut=ze,ze=h[ut]),Uf(U,ut,Bi(ze,p,v,ut,h,P))}),U}function wF(h){var p=Wn(h);return function(v){return cS(v,h,p)}}function cS(h,p,v){var k=v.length;if(h==null)return!k;for(h=re(h);k--;){var E=v[k],P=p[E],U=h[E];if(U===t&&!(E in h)||!P(U))return!1}return!0}function fS(h,p,v){if(typeof h!="function")throw new Oe(o);return Yf(function(){h.apply(t,v)},p)}function Hf(h,p,v,k){var E=-1,P=Wl,U=!0,Z=h.length,ne=[],pe=p.length;if(!Z)return ne;v&&(p=Bt(p,Or(v))),k?(P=Rf,U=!1):p.length>=i&&(P=ku,U=!1,p=new Cu(p));e:for(;++E<Z;){var ge=h[E],ve=v==null?ge:v(ge);if(ge=k||ge!==0?ge:0,U&&ve===ve){for(var Ce=pe;Ce--;)if(p[Ce]===ve)continue e;ne.push(ge)}else P(p,ve,k)||ne.push(ge)}return ne}var Ia=BS(zs),hS=BS(Qy,!0);function _F(h,p){var v=!0;return Ia(h,function(k,E,P){return v=!!p(k,E,P),v}),v}function ag(h,p,v){for(var k=-1,E=h.length;++k<E;){var P=h[k],U=p(P);if(U!=null&&(Z===t?U===U&&!wi(U):v(U,Z)))var Z=U,ne=P}return ne}function kF(h,p,v,k){var E=h.length;for(v=Je(v),v<0&&(v=-v>E?0:E+v),k=k===t||k>E?E:Je(k),k<0&&(k+=E),k=v>k?0:DC(k);v<k;)h[v++]=p;return h}function dS(h,p){var v=[];return Ia(h,function(k,E,P){p(k,E,P)&&v.push(k)}),v}function Yn(h,p,v,k,E){var P=-1,U=h.length;for(v||(v=c5),E||(E=[]);++P<U;){var Z=h[P];p>0&&v(Z)?p>1?Yn(Z,p-1,v,k,E):$s(E,Z):k||(E[E.length]=Z)}return E}var Jy=qS(),pS=qS(!0);function zs(h,p){return h&&Jy(h,p,Wn)}function Qy(h,p){return h&&pS(h,p,Wn)}function ug(h,p){return js(p,function(v){return $o(h[v])})}function Au(h,p){p=Oa(p,h);for(var v=0,k=p.length;h!=null&&v<k;)h=h[Hs(p[v++])];return v&&v==k?h:t}function gS(h,p,v){var k=p(h);return Ze(h)?k:$s(k,v(h))}function Lr(h){return h==null?h===t?ka:Cn:xu&&xu in re(h)?i5(h):y5(h)}function ev(h,p){return h>p}function xF(h,p){return h!=null&&ft.call(h,p)}function SF(h,p){return h!=null&&p in re(h)}function CF(h,p,v){return h>=yr(p,v)&&h<Mn(p,v)}function tv(h,p,v){for(var k=v?Rf:Wl,E=h[0].length,P=h.length,U=P,Z=V(P),ne=1/0,pe=[];U--;){var ge=h[U];U&&p&&(ge=Bt(ge,Or(p))),ne=yr(ge.length,ne),Z[U]=!v&&(p||E>=120&&ge.length>=120)?new Cu(U&&ge):t}ge=h[0];var ve=-1,Ce=Z[0];e:for(;++ve<E&&pe.length<ne;){var Fe=ge[ve],$e=p?p(Fe):Fe;if(Fe=v||Fe!==0?Fe:0,!(Ce?ku(Ce,$e):k(pe,$e,v))){for(U=P;--U;){var et=Z[U];if(!(et?ku(et,$e):k(h[U],$e,v)))continue e}Ce&&Ce.push($e),pe.push(Fe)}}return pe}function EF(h,p,v,k){return zs(h,function(E,P,U){p(k,v(E),P,U)}),k}function Vf(h,p,v){p=Oa(p,h),h=nC(h,p);var k=h==null?h:h[Hs(Wi(p))];return k==null?t:Mr(k,h,v)}function mS(h){return pn(h)&&Lr(h)==rt}function AF(h){return pn(h)&&Lr(h)==dr}function RF(h){return pn(h)&&Lr(h)==yn}function Gf(h,p,v,k,E){return h===p?!0:h==null||p==null||!pn(h)&&!pn(p)?h!==h&&p!==p:DF(h,p,v,k,Gf,E)}function DF(h,p,v,k,E,P){var U=Ze(h),Z=Ze(p),ne=U?Xt:vr(h),pe=Z?Xt:vr(p);ne=ne==rt?Yt:ne,pe=pe==rt?Yt:pe;var ge=ne==Yt,ve=pe==Yt,Ce=ne==pe;if(Ce&&La(h)){if(!La(p))return!1;U=!0,ge=!1}if(Ce&&!ge)return P||(P=new ks),U||Ql(h)?ZS(h,p,v,k,E,P):n5(h,p,ne,v,k,E,P);if(!(v&m)){var Fe=ge&&ft.call(h,"__wrapped__"),$e=ve&&ft.call(p,"__wrapped__");if(Fe||$e){var et=Fe?h.value():h,ze=$e?p.value():p;return P||(P=new ks),E(et,ze,v,k,P)}}return Ce?(P||(P=new ks),r5(h,p,v,k,E,P)):!1}function TF(h){return pn(h)&&vr(h)==Le}function nv(h,p,v,k){var E=v.length,P=E,U=!k;if(h==null)return!P;for(h=re(h);E--;){var Z=v[E];if(U&&Z[2]?Z[1]!==h[Z[0]]:!(Z[0]in h))return!1}for(;++E<P;){Z=v[E];var ne=Z[0],pe=h[ne],ge=Z[1];if(U&&Z[2]){if(pe===t&&!(ne in h))return!1}else{var ve=new ks;if(k)var Ce=k(pe,ge,ne,h,p,ve);if(!(Ce===t?Gf(ge,pe,m|y,k,ve):Ce))return!1}}return!0}function yS(h){if(!an(h)||h5(h))return!1;var p=$o(h)?TL:en;return p.test(Du(h))}function IF(h){return pn(h)&&Lr(h)==Dt}function MF(h){return pn(h)&&vr(h)==ct}function OF(h){return pn(h)&&Cg(h.length)&&!!Qe[Lr(h)]}function vS(h){return typeof h=="function"?h:h==null?ni:typeof h=="object"?Ze(h)?_S(h[0],h[1]):wS(h):WC(h)}function rv(h){if(!Xf(h))return FL(h);var p=[];for(var v in re(h))ft.call(h,v)&&v!="constructor"&&p.push(v);return p}function PF(h){if(!an(h))return m5(h);var p=Xf(h),v=[];for(var k in h)k=="constructor"&&(p||!ft.call(h,k))||v.push(k);return v}function iv(h,p){return h<p}function bS(h,p){var v=-1,k=ei(h)?V(h.length):[];return Ia(h,function(E,P,U){k[++v]=p(E,P,U)}),k}function wS(h){var p=bv(h);return p.length==1&&p[0][2]?eC(p[0][0],p[0][1]):function(v){return v===h||nv(v,h,p)}}function _S(h,p){return _v(h)&&QS(p)?eC(Hs(h),p):function(v){var k=Iv(v,h);return k===t&&k===p?Mv(v,h):Gf(p,k,m|y)}}function lg(h,p,v,k,E){h!==p&&Jy(p,function(P,U){if(E||(E=new ks),an(P))LF(h,p,U,v,lg,k,E);else{var Z=k?k(xv(h,U),P,U+"",h,p,E):t;Z===t&&(Z=P),Xy(h,U,Z)}},ti)}function LF(h,p,v,k,E,P,U){var Z=xv(h,v),ne=xv(p,v),pe=U.get(ne);if(pe){Xy(h,v,pe);return}var ge=P?P(Z,ne,v+"",h,p,U):t,ve=ge===t;if(ve){var Ce=Ze(ne),Fe=!Ce&&La(ne),$e=!Ce&&!Fe&&Ql(ne);ge=ne,Ce||Fe||$e?Ze(Z)?ge=Z:wn(Z)?ge=Qr(Z):Fe?(ve=!1,ge=OS(ne,!0)):$e?(ve=!1,ge=PS(ne,!0)):ge=[]:Jf(ne)||Tu(ne)?(ge=Z,Tu(Z)?ge=TC(Z):(!an(Z)||$o(Z))&&(ge=JS(ne))):ve=!1}ve&&(U.set(ne,ge),E(ge,ne,k,P,U),U.delete(ne)),Xy(h,v,ge)}function kS(h,p){var v=h.length;if(v)return p+=p<0?v:0,jo(p,v)?h[p]:t}function xS(h,p,v){p.length?p=Bt(p,function(P){return Ze(P)?function(U){return Au(U,P.length===1?P[0]:P)}:P}):p=[ni];var k=-1;p=Bt(p,Or(je()));var E=bS(h,function(P,U,Z){var ne=Bt(p,function(pe){return pe(P)});return{criteria:ne,index:++k,value:P}});return qy(E,function(P,U){return KF(P,U,v)})}function FF(h,p){return SS(h,p,function(v,k){return Mv(h,k)})}function SS(h,p,v){for(var k=-1,E=p.length,P={};++k<E;){var U=p[k],Z=Au(h,U);v(Z,U)&&Kf(P,Oa(U,h),Z)}return P}function NF(h){return function(p){return Au(p,h)}}function sv(h,p,v,k){var E=k?Po:Fi,P=-1,U=p.length,Z=h;for(h===p&&(p=Qr(p)),v&&(Z=Bt(h,Or(v)));++P<U;)for(var ne=0,pe=p[P],ge=v?v(pe):pe;(ne=E(Z,ge,ne,k))>-1;)Z!==h&&Qp.call(Z,ne,1),Qp.call(h,ne,1);return h}function CS(h,p){for(var v=h?p.length:0,k=v-1;v--;){var E=p[v];if(v==k||E!==P){var P=E;jo(E)?Qp.call(h,E,1):lv(h,E)}}return h}function ov(h,p){return h+ng(sS()*(p-h+1))}function BF(h,p,v,k){for(var E=-1,P=Mn(tg((p-h)/(v||1)),0),U=V(P);P--;)U[k?P:++E]=h,h+=v;return U}function av(h,p){var v="";if(!h||p<1||p>be)return v;do p%2&&(v+=h),p=ng(p/2),p&&(h+=h);while(p);return v}function tt(h,p){return Sv(tC(h,p,ni),h+"")}function qF(h){return uS(ec(h))}function WF(h,p){var v=ec(h);return bg(v,Eu(p,0,v.length))}function Kf(h,p,v,k){if(!an(h))return h;p=Oa(p,h);for(var E=-1,P=p.length,U=P-1,Z=h;Z!=null&&++E<P;){var ne=Hs(p[E]),pe=v;if(ne==="__proto__"||ne==="constructor"||ne==="prototype")return h;if(E!=U){var ge=Z[ne];pe=k?k(ge,ne,Z):t,pe===t&&(pe=an(ge)?ge:jo(p[E+1])?[]:{})}Uf(Z,ne,pe),Z=Z[ne]}return h}var ES=rg?function(h,p){return rg.set(h,p),h}:ni,jF=eg?function(h,p){return eg(h,"toString",{configurable:!0,enumerable:!1,value:Pv(p),writable:!0})}:ni;function $F(h){return bg(ec(h))}function qi(h,p,v){var k=-1,E=h.length;p<0&&(p=-p>E?0:E+p),v=v>E?E:v,v<0&&(v+=E),E=p>v?0:v-p>>>0,p>>>=0;for(var P=V(E);++k<E;)P[k]=h[k+p];return P}function zF(h,p){var v;return Ia(h,function(k,E,P){return v=p(k,E,P),!v}),!!v}function cg(h,p,v){var k=0,E=h==null?k:h.length;if(typeof p=="number"&&p===p&&E<=Rt){for(;k<E;){var P=k+E>>>1,U=h[P];U!==null&&!wi(U)&&(v?U<=p:U<p)?k=P+1:E=P}return E}return uv(h,p,ni,v)}function uv(h,p,v,k){var E=0,P=h==null?0:h.length;if(P===0)return 0;p=v(p);for(var U=p!==p,Z=p===null,ne=wi(p),pe=p===t;E<P;){var ge=ng((E+P)/2),ve=v(h[ge]),Ce=ve!==t,Fe=ve===null,$e=ve===ve,et=wi(ve);if(U)var ze=k||$e;else pe?ze=$e&&(k||Ce):Z?ze=$e&&Ce&&(k||!Fe):ne?ze=$e&&Ce&&!Fe&&(k||!et):Fe||et?ze=!1:ze=k?ve<=p:ve<p;ze?E=ge+1:P=ge}return yr(P,Pe)}function AS(h,p){for(var v=-1,k=h.length,E=0,P=[];++v<k;){var U=h[v],Z=p?p(U):U;if(!v||!xs(Z,ne)){var ne=Z;P[E++]=U===0?0:U}}return P}function RS(h){return typeof h=="number"?h:wi(h)?De:+h}function bi(h){if(typeof h=="string")return h;if(Ze(h))return Bt(h,bi)+"";if(wi(h))return oS?oS.call(h):"";var p=h+"";return p=="0"&&1/h==-ae?"-0":p}function Ma(h,p,v){var k=-1,E=Wl,P=h.length,U=!0,Z=[],ne=Z;if(v)U=!1,E=Rf;else if(P>=i){var pe=p?null:e5(h);if(pe)return Vl(pe);U=!1,E=ku,ne=new Cu}else ne=p?[]:Z;e:for(;++k<P;){var ge=h[k],ve=p?p(ge):ge;if(ge=v||ge!==0?ge:0,U&&ve===ve){for(var Ce=ne.length;Ce--;)if(ne[Ce]===ve)continue e;p&&ne.push(ve),Z.push(ge)}else E(ne,ve,v)||(ne!==Z&&ne.push(ve),Z.push(ge))}return Z}function lv(h,p){return p=Oa(p,h),h=nC(h,p),h==null||delete h[Hs(Wi(p))]}function DS(h,p,v,k){return Kf(h,p,v(Au(h,p)),k)}function fg(h,p,v,k){for(var E=h.length,P=k?E:-1;(k?P--:++P<E)&&p(h[P],P,h););return v?qi(h,k?0:P,k?P+1:E):qi(h,k?P+1:0,k?E:P)}function TS(h,p){var v=h;return v instanceof ht&&(v=v.value()),Df(p,function(k,E){return E.func.apply(E.thisArg,$s([k],E.args))},v)}function cv(h,p,v){var k=h.length;if(k<2)return k?Ma(h[0]):[];for(var E=-1,P=V(k);++E<k;)for(var U=h[E],Z=-1;++Z<k;)Z!=E&&(P[E]=Hf(P[E]||U,h[Z],p,v));return Ma(Yn(P,1),p,v)}function IS(h,p,v){for(var k=-1,E=h.length,P=p.length,U={};++k<E;){var Z=k<P?p[k]:t;v(U,h[k],Z)}return U}function fv(h){return wn(h)?h:[]}function hv(h){return typeof h=="function"?h:ni}function Oa(h,p){return Ze(h)?h:_v(h,p)?[h]:oC(St(h))}var UF=tt;function Pa(h,p,v){var k=h.length;return v=v===t?k:v,!p&&v>=k?h:qi(h,p,v)}var MS=IL||function(h){return vn.clearTimeout(h)};function OS(h,p){if(p)return h.slice();var v=h.length,k=eS?eS(v):new h.constructor(v);return h.copy(k),k}function dv(h){var p=new h.constructor(h.byteLength);return new Yp(p).set(new Yp(h)),p}function HF(h,p){var v=p?dv(h.buffer):h.buffer;return new h.constructor(v,h.byteOffset,h.byteLength)}function VF(h){var p=new h.constructor(h.source,xt.exec(h));return p.lastIndex=h.lastIndex,p}function GF(h){return zf?re(zf.call(h)):{}}function PS(h,p){var v=p?dv(h.buffer):h.buffer;return new h.constructor(v,h.byteOffset,h.length)}function LS(h,p){if(h!==p){var v=h!==t,k=h===null,E=h===h,P=wi(h),U=p!==t,Z=p===null,ne=p===p,pe=wi(p);if(!Z&&!pe&&!P&&h>p||P&&U&&ne&&!Z&&!pe||k&&U&&ne||!v&&ne||!E)return 1;if(!k&&!P&&!pe&&h<p||pe&&v&&E&&!k&&!P||Z&&v&&E||!U&&E||!ne)return-1}return 0}function KF(h,p,v){for(var k=-1,E=h.criteria,P=p.criteria,U=E.length,Z=v.length;++k<U;){var ne=LS(E[k],P[k]);if(ne){if(k>=Z)return ne;var pe=v[k];return ne*(pe=="desc"?-1:1)}}return h.index-p.index}function FS(h,p,v,k){for(var E=-1,P=h.length,U=v.length,Z=-1,ne=p.length,pe=Mn(P-U,0),ge=V(ne+pe),ve=!k;++Z<ne;)ge[Z]=p[Z];for(;++E<U;)(ve||E<P)&&(ge[v[E]]=h[E]);for(;pe--;)ge[Z++]=h[E++];return ge}function NS(h,p,v,k){for(var E=-1,P=h.length,U=-1,Z=v.length,ne=-1,pe=p.length,ge=Mn(P-Z,0),ve=V(ge+pe),Ce=!k;++E<ge;)ve[E]=h[E];for(var Fe=E;++ne<pe;)ve[Fe+ne]=p[ne];for(;++U<Z;)(Ce||E<P)&&(ve[Fe+v[U]]=h[E++]);return ve}function Qr(h,p){var v=-1,k=h.length;for(p||(p=V(k));++v<k;)p[v]=h[v];return p}function Us(h,p,v,k){var E=!v;v||(v={});for(var P=-1,U=p.length;++P<U;){var Z=p[P],ne=k?k(v[Z],h[Z],Z,v,h):t;ne===t&&(ne=h[Z]),E?Bo(v,Z,ne):Uf(v,Z,ne)}return v}function ZF(h,p){return Us(h,wv(h),p)}function XF(h,p){return Us(h,XS(h),p)}function hg(h,p){return function(v,k){var E=Ze(v)?jp:vF,P=p?p():{};return E(v,h,je(k,2),P)}}function Xl(h){return tt(function(p,v){var k=-1,E=v.length,P=E>1?v[E-1]:t,U=E>2?v[2]:t;for(P=h.length>3&&typeof P=="function"?(E--,P):t,U&&Fr(v[0],v[1],U)&&(P=E<3?t:P,E=1),p=re(p);++k<E;){var Z=v[k];Z&&h(p,Z,k,P)}return p})}function BS(h,p){return function(v,k){if(v==null)return v;if(!ei(v))return h(v,k);for(var E=v.length,P=p?E:-1,U=re(v);(p?P--:++P<E)&&k(U[P],P,U)!==!1;);return v}}function qS(h){return function(p,v,k){for(var E=-1,P=re(p),U=k(p),Z=U.length;Z--;){var ne=U[h?Z:++E];if(v(P[ne],ne,P)===!1)break}return p}}function YF(h,p,v){var k=p&b,E=Zf(h);function P(){var U=this&&this!==vn&&this instanceof P?E:h;return U.apply(k?v:this,arguments)}return P}function WS(h){return function(p){p=St(p);var v=Ra(p)?Pr(p):t,k=v?v[0]:p.charAt(0),E=v?Pa(v,1).join(""):p.slice(1);return k[h]()+E}}function Yl(h){return function(p){return Df(BC(NC(p).replace(Py,"")),h,"")}}function Zf(h){return function(){var p=arguments;switch(p.length){case 0:return new h;case 1:return new h(p[0]);case 2:return new h(p[0],p[1]);case 3:return new h(p[0],p[1],p[2]);case 4:return new h(p[0],p[1],p[2],p[3]);case 5:return new h(p[0],p[1],p[2],p[3],p[4]);case 6:return new h(p[0],p[1],p[2],p[3],p[4],p[5]);case 7:return new h(p[0],p[1],p[2],p[3],p[4],p[5],p[6])}var v=Zl(h.prototype),k=h.apply(v,p);return an(k)?k:v}}function JF(h,p,v){var k=Zf(h);function E(){for(var P=arguments.length,U=V(P),Z=P,ne=Jl(E);Z--;)U[Z]=arguments[Z];var pe=P<3&&U[0]!==ne&&U[P-1]!==ne?[]:_s(U,ne);if(P-=pe.length,P<v)return HS(h,p,dg,E.placeholder,t,U,pe,t,t,v-P);var ge=this&&this!==vn&&this instanceof E?k:h;return Mr(ge,this,U)}return E}function jS(h){return function(p,v,k){var E=re(p);if(!ei(p)){var P=je(v,3);p=Wn(p),v=function(Z){return P(E[Z],Z,E)}}var U=h(p,v,k);return U>-1?E[P?p[U]:U]:t}}function $S(h){return Wo(function(p){var v=p.length,k=v,E=Ni.prototype.thru;for(h&&p.reverse();k--;){var P=p[k];if(typeof P!="function")throw new Oe(o);if(E&&!U&&yg(P)=="wrapper")var U=new Ni([],!0)}for(k=U?k:v;++k<v;){P=p[k];var Z=yg(P),ne=Z=="wrapper"?vv(P):t;ne&&kv(ne[0])&&ne[1]==(I|_|C|W)&&!ne[4].length&&ne[9]==1?U=U[yg(ne[0])].apply(U,ne[3]):U=P.length==1&&kv(P)?U[Z]():U.thru(P)}return function(){var pe=arguments,ge=pe[0];if(U&&pe.length==1&&Ze(ge))return U.plant(ge).value();for(var ve=0,Ce=v?p[ve].apply(this,pe):ge;++ve<v;)Ce=p[ve].call(this,Ce);return Ce}})}function dg(h,p,v,k,E,P,U,Z,ne,pe){var ge=p&I,ve=p&b,Ce=p&w,Fe=p&(_|S),$e=p&B,et=Ce?t:Zf(h);function ze(){for(var ut=arguments.length,pt=V(ut),_i=ut;_i--;)pt[_i]=arguments[_i];if(Fe)var Nr=Jl(ze),ki=Wy(pt,Nr);if(k&&(pt=FS(pt,k,E,Fe)),P&&(pt=NS(pt,P,U,Fe)),ut-=ki,Fe&&ut<pe){var _n=_s(pt,Nr);return HS(h,p,dg,ze.placeholder,v,pt,_n,Z,ne,pe-ut)}var Ss=ve?v:this,Uo=Ce?Ss[h]:h;return ut=pt.length,Z?pt=v5(pt,Z):$e&&ut>1&&pt.reverse(),ge&&ne<ut&&(pt.length=ne),this&&this!==vn&&this instanceof ze&&(Uo=et||Zf(Uo)),Uo.apply(Ss,pt)}return ze}function zS(h,p){return function(v,k){return EF(v,h,p(k),{})}}function pg(h,p){return function(v,k){var E;if(v===t&&k===t)return p;if(v!==t&&(E=v),k!==t){if(E===t)return k;typeof v=="string"||typeof k=="string"?(v=bi(v),k=bi(k)):(v=RS(v),k=RS(k)),E=h(v,k)}return E}}function pv(h){return Wo(function(p){return p=Bt(p,Or(je())),tt(function(v){var k=this;return h(p,function(E){return Mr(E,k,v)})})})}function gg(h,p){p=p===t?" ":bi(p);var v=p.length;if(v<2)return v?av(p,h):p;var k=av(p,tg(h/Da(p)));return Ra(p)?Pa(Pr(k),0,h).join(""):k.slice(0,h)}function QF(h,p,v,k){var E=p&b,P=Zf(h);function U(){for(var Z=-1,ne=arguments.length,pe=-1,ge=k.length,ve=V(ge+ne),Ce=this&&this!==vn&&this instanceof U?P:h;++pe<ge;)ve[pe]=k[pe];for(;ne--;)ve[pe++]=arguments[++Z];return Mr(Ce,E?v:this,ve)}return U}function US(h){return function(p,v,k){return k&&typeof k!="number"&&Fr(p,v,k)&&(v=k=t),p=zo(p),v===t?(v=p,p=0):v=zo(v),k=k===t?p<v?1:-1:zo(k),BF(p,v,k,h)}}function mg(h){return function(p,v){return typeof p=="string"&&typeof v=="string"||(p=ji(p),v=ji(v)),h(p,v)}}function HS(h,p,v,k,E,P,U,Z,ne,pe){var ge=p&_,ve=ge?U:t,Ce=ge?t:U,Fe=ge?P:t,$e=ge?t:P;p|=ge?C:A,p&=~(ge?A:C),p&x||(p&=-4);var et=[h,p,E,Fe,ve,$e,Ce,Z,ne,pe],ze=v.apply(t,et);return kv(h)&&rC(ze,et),ze.placeholder=k,iC(ze,h,p)}function gv(h){var p=ee[h];return function(v,k){if(v=ji(v),k=k==null?0:yr(Je(k),292),k&&iS(v)){var E=(St(v)+"e").split("e"),P=p(E[0]+"e"+(+E[1]+k));return E=(St(P)+"e").split("e"),+(E[0]+"e"+(+E[1]-k))}return p(v)}}var e5=Gl&&1/Vl(new Gl([,-0]))[1]==ae?function(h){return new Gl(h)}:Nv;function VS(h){return function(p){var v=vr(p);return v==Le?Ul(p):v==ct?Uy(p):Of(p,h(p))}}function qo(h,p,v,k,E,P,U,Z){var ne=p&w;if(!ne&&typeof h!="function")throw new Oe(o);var pe=k?k.length:0;if(pe||(p&=-97,k=E=t),U=U===t?U:Mn(Je(U),0),Z=Z===t?Z:Je(Z),pe-=E?E.length:0,p&A){var ge=k,ve=E;k=E=t}var Ce=ne?t:vv(h),Fe=[h,p,v,k,E,ge,ve,P,U,Z];if(Ce&&g5(Fe,Ce),h=Fe[0],p=Fe[1],v=Fe[2],k=Fe[3],E=Fe[4],Z=Fe[9]=Fe[9]===t?ne?0:h.length:Mn(Fe[9]-pe,0),!Z&&p&(_|S)&&(p&=-25),!p||p==b)var $e=YF(h,p,v);else p==_||p==S?$e=JF(h,p,Z):(p==C||p==(b|C))&&!E.length?$e=QF(h,p,v,k):$e=dg.apply(t,Fe);var et=Ce?ES:rC;return iC(et($e,Fe),h,p)}function GS(h,p,v,k){return h===t||xs(h,We[v])&&!ft.call(k,v)?p:h}function KS(h,p,v,k,E,P){return an(h)&&an(p)&&(P.set(p,h),lg(h,p,t,KS,P),P.delete(p)),h}function t5(h){return Jf(h)?t:h}function ZS(h,p,v,k,E,P){var U=v&m,Z=h.length,ne=p.length;if(Z!=ne&&!(U&&ne>Z))return!1;var pe=P.get(h),ge=P.get(p);if(pe&&ge)return pe==p&&ge==h;var ve=-1,Ce=!0,Fe=v&y?new Cu:t;for(P.set(h,p),P.set(p,h);++ve<Z;){var $e=h[ve],et=p[ve];if(k)var ze=U?k(et,$e,ve,p,h,P):k($e,et,ve,h,p,P);if(ze!==t){if(ze)continue;Ce=!1;break}if(Fe){if(!Tf(p,function(ut,pt){if(!ku(Fe,pt)&&($e===ut||E($e,ut,v,k,P)))return Fe.push(pt)})){Ce=!1;break}}else if(!($e===et||E($e,et,v,k,P))){Ce=!1;break}}return P.delete(h),P.delete(p),Ce}function n5(h,p,v,k,E,P,U){switch(v){case En:if(h.byteLength!=p.byteLength||h.byteOffset!=p.byteOffset)return!1;h=h.buffer,p=p.buffer;case dr:return!(h.byteLength!=p.byteLength||!P(new Yp(h),new Yp(p)));case rn:case yn:case $t:return xs(+h,+p);case Se:return h.name==p.name&&h.message==p.message;case Dt:case hr:return h==p+"";case Le:var Z=Ul;case ct:var ne=k&m;if(Z||(Z=Vl),h.size!=p.size&&!ne)return!1;var pe=U.get(h);if(pe)return pe==p;k|=y,U.set(h,p);var ge=ZS(Z(h),Z(p),k,E,P,U);return U.delete(h),ge;case ls:if(zf)return zf.call(h)==zf.call(p)}return!1}function r5(h,p,v,k,E,P){var U=v&m,Z=mv(h),ne=Z.length,pe=mv(p),ge=pe.length;if(ne!=ge&&!U)return!1;for(var ve=ne;ve--;){var Ce=Z[ve];if(!(U?Ce in p:ft.call(p,Ce)))return!1}var Fe=P.get(h),$e=P.get(p);if(Fe&&$e)return Fe==p&&$e==h;var et=!0;P.set(h,p),P.set(p,h);for(var ze=U;++ve<ne;){Ce=Z[ve];var ut=h[Ce],pt=p[Ce];if(k)var _i=U?k(pt,ut,Ce,p,h,P):k(ut,pt,Ce,h,p,P);if(!(_i===t?ut===pt||E(ut,pt,v,k,P):_i)){et=!1;break}ze||(ze=Ce=="constructor")}if(et&&!ze){var Nr=h.constructor,ki=p.constructor;Nr!=ki&&"constructor"in h&&"constructor"in p&&!(typeof Nr=="function"&&Nr instanceof Nr&&typeof ki=="function"&&ki instanceof ki)&&(et=!1)}return P.delete(h),P.delete(p),et}function Wo(h){return Sv(tC(h,t,cC),h+"")}function mv(h){return gS(h,Wn,wv)}function yv(h){return gS(h,ti,XS)}var vv=rg?function(h){return rg.get(h)}:Nv;function yg(h){for(var p=h.name+"",v=Kl[p],k=ft.call(Kl,p)?v.length:0;k--;){var E=v[k],P=E.func;if(P==null||P==h)return E.name}return p}function Jl(h){var p=ft.call(M,"placeholder")?M:h;return p.placeholder}function je(){var h=M.iteratee||Lv;return h=h===Lv?vS:h,arguments.length?h(arguments[0],arguments[1]):h}function vg(h,p){var v=h.__data__;return f5(p)?v[typeof p=="string"?"string":"hash"]:v.map}function bv(h){for(var p=Wn(h),v=p.length;v--;){var k=p[v],E=h[k];p[v]=[k,E,QS(E)]}return p}function Ru(h,p){var v=$y(h,p);return yS(v)?v:t}function i5(h){var p=ft.call(h,xu),v=h[xu];try{h[xu]=t;var k=!0}catch{}var E=Zp.call(h);return k&&(p?h[xu]=v:delete h[xu]),E}var wv=Gy?function(h){return h==null?[]:(h=re(h),js(Gy(h),function(p){return nS.call(h,p)}))}:Bv,XS=Gy?function(h){for(var p=[];h;)$s(p,wv(h)),h=Jp(h);return p}:Bv,vr=Lr;(Ky&&vr(new Ky(new ArrayBuffer(1)))!=En||Wf&&vr(new Wf)!=Le||Zy&&vr(Zy.resolve())!=at||Gl&&vr(new Gl)!=ct||jf&&vr(new jf)!=Xr)&&(vr=function(h){var p=Lr(h),v=p==Yt?h.constructor:t,k=v?Du(v):"";if(k)switch(k){case WL:return En;case jL:return Le;case $L:return at;case zL:return ct;case UL:return Xr}return p});function s5(h,p,v){for(var k=-1,E=v.length;++k<E;){var P=v[k],U=P.size;switch(P.type){case"drop":h+=U;break;case"dropRight":p-=U;break;case"take":p=yr(p,h+U);break;case"takeRight":h=Mn(h,p-U);break}}return{start:h,end:p}}function o5(h){var p=h.match(Qt);return p?p[1].split(qe):[]}function YS(h,p,v){p=Oa(p,h);for(var k=-1,E=p.length,P=!1;++k<E;){var U=Hs(p[k]);if(!(P=h!=null&&v(h,U)))break;h=h[U]}return P||++k!=E?P:(E=h==null?0:h.length,!!E&&Cg(E)&&jo(U,E)&&(Ze(h)||Tu(h)))}function a5(h){var p=h.length,v=new h.constructor(p);return p&&typeof h[0]=="string"&&ft.call(h,"index")&&(v.index=h.index,v.input=h.input),v}function JS(h){return typeof h.constructor=="function"&&!Xf(h)?Zl(Jp(h)):{}}function u5(h,p,v){var k=h.constructor;switch(p){case dr:return dv(h);case rn:case yn:return new k(+h);case En:return HF(h,v);case Tt:case cs:case fs:case Tr:case Oi:case hs:case mi:case ds:case Ns:return PS(h,v);case Le:return new k;case $t:case hr:return new k(h);case Dt:return VF(h);case ct:return new k;case ls:return GF(h)}}function l5(h,p){var v=p.length;if(!v)return h;var k=v-1;return p[k]=(v>1?"& ":"")+p[k],p=p.join(v>2?", ":" "),h.replace(Jt,`{
|
|
20
|
-
/* [wrapped with `+p+`] */
|
|
21
|
-
`)}function c5(h){return Ze(h)||Tu(h)||!!(rS&&h&&h[rS])}function jo(h,p){var v=typeof h;return p=p??be,!!p&&(v=="number"||v!="symbol"&&Nt.test(h))&&h>-1&&h%1==0&&h<p}function Fr(h,p,v){if(!an(v))return!1;var k=typeof p;return(k=="number"?ei(v)&&jo(p,v.length):k=="string"&&p in v)?xs(v[p],h):!1}function _v(h,p){if(Ze(h))return!1;var v=typeof h;return v=="number"||v=="symbol"||v=="boolean"||h==null||wi(h)?!0:Yr.test(h)||!Ir.test(h)||p!=null&&h in re(p)}function f5(h){var p=typeof h;return p=="string"||p=="number"||p=="symbol"||p=="boolean"?h!=="__proto__":h===null}function kv(h){var p=yg(h),v=M[p];if(typeof v!="function"||!(p in ht.prototype))return!1;if(h===v)return!0;var k=vv(v);return!!k&&h===k[0]}function h5(h){return!!Bf&&Bf in h}var d5=Ht?$o:qv;function Xf(h){var p=h&&h.constructor,v=typeof p=="function"&&p.prototype||We;return h===v}function QS(h){return h===h&&!an(h)}function eC(h,p){return function(v){return v==null?!1:v[h]===p&&(p!==t||h in re(v))}}function p5(h){var p=xg(h,function(k){return v.size===l&&v.clear(),k}),v=p.cache;return p}function g5(h,p){var v=h[1],k=p[1],E=v|k,P=E<(b|w|I),U=k==I&&v==_||k==I&&v==W&&h[7].length<=p[8]||k==(I|W)&&p[7].length<=p[8]&&v==_;if(!(P||U))return h;k&b&&(h[2]=p[2],E|=v&b?0:x);var Z=p[3];if(Z){var ne=h[3];h[3]=ne?FS(ne,Z,p[4]):Z,h[4]=ne?_s(h[3],c):p[4]}return Z=p[5],Z&&(ne=h[5],h[5]=ne?NS(ne,Z,p[6]):Z,h[6]=ne?_s(h[5],c):p[6]),Z=p[7],Z&&(h[7]=Z),k&I&&(h[8]=h[8]==null?p[8]:yr(h[8],p[8])),h[9]==null&&(h[9]=p[9]),h[0]=p[0],h[1]=E,h}function m5(h){var p=[];if(h!=null)for(var v in re(h))p.push(v);return p}function y5(h){return Zp.call(h)}function tC(h,p,v){return p=Mn(p===t?h.length-1:p,0),function(){for(var k=arguments,E=-1,P=Mn(k.length-p,0),U=V(P);++E<P;)U[E]=k[p+E];E=-1;for(var Z=V(p+1);++E<p;)Z[E]=k[E];return Z[p]=v(U),Mr(h,this,Z)}}function nC(h,p){return p.length<2?h:Au(h,qi(p,0,-1))}function v5(h,p){for(var v=h.length,k=yr(p.length,v),E=Qr(h);k--;){var P=p[k];h[k]=jo(P,v)?E[P]:t}return h}function xv(h,p){if(!(p==="constructor"&&typeof h[p]=="function")&&p!="__proto__")return h[p]}var rC=sC(ES),Yf=OL||function(h,p){return vn.setTimeout(h,p)},Sv=sC(jF);function iC(h,p,v){var k=p+"";return Sv(h,l5(k,b5(o5(k),v)))}function sC(h){var p=0,v=0;return function(){var k=NL(),E=R-(k-v);if(v=k,E>0){if(++p>=F)return arguments[0]}else p=0;return h.apply(t,arguments)}}function bg(h,p){var v=-1,k=h.length,E=k-1;for(p=p===t?k:p;++v<p;){var P=ov(v,E),U=h[P];h[P]=h[v],h[v]=U}return h.length=p,h}var oC=p5(function(h){var p=[];return h.charCodeAt(0)===46&&p.push(""),h.replace(Oo,function(v,k,E,P){p.push(E?P.replace(ke,"$1"):k||v)}),p});function Hs(h){if(typeof h=="string"||wi(h))return h;var p=h+"";return p=="0"&&1/h==-ae?"-0":p}function Du(h){if(h!=null){try{return bn.call(h)}catch{}try{return h+""}catch{}}return""}function b5(h,p){return mr(kt,function(v){var k="_."+v[0];p&v[1]&&!Wl(h,k)&&h.push(k)}),h.sort()}function aC(h){if(h instanceof ht)return h.clone();var p=new Ni(h.__wrapped__,h.__chain__);return p.__actions__=Qr(h.__actions__),p.__index__=h.__index__,p.__values__=h.__values__,p}function w5(h,p,v){(v?Fr(h,p,v):p===t)?p=1:p=Mn(Je(p),0);var k=h==null?0:h.length;if(!k||p<1)return[];for(var E=0,P=0,U=V(tg(k/p));E<k;)U[P++]=qi(h,E,E+=p);return U}function _5(h){for(var p=-1,v=h==null?0:h.length,k=0,E=[];++p<v;){var P=h[p];P&&(E[k++]=P)}return E}function k5(){var h=arguments.length;if(!h)return[];for(var p=V(h-1),v=arguments[0],k=h;k--;)p[k-1]=arguments[k];return $s(Ze(v)?Qr(v):[v],Yn(p,1))}var x5=tt(function(h,p){return wn(h)?Hf(h,Yn(p,1,wn,!0)):[]}),S5=tt(function(h,p){var v=Wi(p);return wn(v)&&(v=t),wn(h)?Hf(h,Yn(p,1,wn,!0),je(v,2)):[]}),C5=tt(function(h,p){var v=Wi(p);return wn(v)&&(v=t),wn(h)?Hf(h,Yn(p,1,wn,!0),t,v):[]});function E5(h,p,v){var k=h==null?0:h.length;return k?(p=v||p===t?1:Je(p),qi(h,p<0?0:p,k)):[]}function A5(h,p,v){var k=h==null?0:h.length;return k?(p=v||p===t?1:Je(p),p=k-p,qi(h,0,p<0?0:p)):[]}function R5(h,p){return h&&h.length?fg(h,je(p,3),!0,!0):[]}function D5(h,p){return h&&h.length?fg(h,je(p,3),!0):[]}function T5(h,p,v,k){var E=h==null?0:h.length;return E?(v&&typeof v!="number"&&Fr(h,p,v)&&(v=0,k=E),kF(h,p,v,k)):[]}function uC(h,p,v){var k=h==null?0:h.length;if(!k)return-1;var E=v==null?0:Je(v);return E<0&&(E=Mn(k+E,0)),vi(h,je(p,3),E)}function lC(h,p,v){var k=h==null?0:h.length;if(!k)return-1;var E=k-1;return v!==t&&(E=Je(v),E=v<0?Mn(k+E,0):yr(E,k-1)),vi(h,je(p,3),E,!0)}function cC(h){var p=h==null?0:h.length;return p?Yn(h,1):[]}function I5(h){var p=h==null?0:h.length;return p?Yn(h,ae):[]}function M5(h,p){var v=h==null?0:h.length;return v?(p=p===t?1:Je(p),Yn(h,p)):[]}function O5(h){for(var p=-1,v=h==null?0:h.length,k={};++p<v;){var E=h[p];k[E[0]]=E[1]}return k}function fC(h){return h&&h.length?h[0]:t}function P5(h,p,v){var k=h==null?0:h.length;if(!k)return-1;var E=v==null?0:Je(v);return E<0&&(E=Mn(k+E,0)),Fi(h,p,E)}function L5(h){var p=h==null?0:h.length;return p?qi(h,0,-1):[]}var F5=tt(function(h){var p=Bt(h,fv);return p.length&&p[0]===h[0]?tv(p):[]}),N5=tt(function(h){var p=Wi(h),v=Bt(h,fv);return p===Wi(v)?p=t:v.pop(),v.length&&v[0]===h[0]?tv(v,je(p,2)):[]}),B5=tt(function(h){var p=Wi(h),v=Bt(h,fv);return p=typeof p=="function"?p:t,p&&v.pop(),v.length&&v[0]===h[0]?tv(v,t,p):[]});function q5(h,p){return h==null?"":LL.call(h,p)}function Wi(h){var p=h==null?0:h.length;return p?h[p-1]:t}function W5(h,p,v){var k=h==null?0:h.length;if(!k)return-1;var E=k;return v!==t&&(E=Je(v),E=E<0?Mn(k+E,0):yr(E,k-1)),p===p?Vy(h,p,E):vi(h,Hp,E,!0)}function j5(h,p){return h&&h.length?kS(h,Je(p)):t}var $5=tt(hC);function hC(h,p){return h&&h.length&&p&&p.length?sv(h,p):h}function z5(h,p,v){return h&&h.length&&p&&p.length?sv(h,p,je(v,2)):h}function U5(h,p,v){return h&&h.length&&p&&p.length?sv(h,p,t,v):h}var H5=Wo(function(h,p){var v=h==null?0:h.length,k=Yy(h,p);return CS(h,Bt(p,function(E){return jo(E,v)?+E:E}).sort(LS)),k});function V5(h,p){var v=[];if(!(h&&h.length))return v;var k=-1,E=[],P=h.length;for(p=je(p,3);++k<P;){var U=h[k];p(U,k,h)&&(v.push(U),E.push(k))}return CS(h,E),v}function Cv(h){return h==null?h:qL.call(h)}function G5(h,p,v){var k=h==null?0:h.length;return k?(v&&typeof v!="number"&&Fr(h,p,v)?(p=0,v=k):(p=p==null?0:Je(p),v=v===t?k:Je(v)),qi(h,p,v)):[]}function K5(h,p){return cg(h,p)}function Z5(h,p,v){return uv(h,p,je(v,2))}function X5(h,p){var v=h==null?0:h.length;if(v){var k=cg(h,p);if(k<v&&xs(h[k],p))return k}return-1}function Y5(h,p){return cg(h,p,!0)}function J5(h,p,v){return uv(h,p,je(v,2),!0)}function Q5(h,p){var v=h==null?0:h.length;if(v){var k=cg(h,p,!0)-1;if(xs(h[k],p))return k}return-1}function eN(h){return h&&h.length?AS(h):[]}function tN(h,p){return h&&h.length?AS(h,je(p,2)):[]}function nN(h){var p=h==null?0:h.length;return p?qi(h,1,p):[]}function rN(h,p,v){return h&&h.length?(p=v||p===t?1:Je(p),qi(h,0,p<0?0:p)):[]}function iN(h,p,v){var k=h==null?0:h.length;return k?(p=v||p===t?1:Je(p),p=k-p,qi(h,p<0?0:p,k)):[]}function sN(h,p){return h&&h.length?fg(h,je(p,3),!1,!0):[]}function oN(h,p){return h&&h.length?fg(h,je(p,3)):[]}var aN=tt(function(h){return Ma(Yn(h,1,wn,!0))}),uN=tt(function(h){var p=Wi(h);return wn(p)&&(p=t),Ma(Yn(h,1,wn,!0),je(p,2))}),lN=tt(function(h){var p=Wi(h);return p=typeof p=="function"?p:t,Ma(Yn(h,1,wn,!0),t,p)});function cN(h){return h&&h.length?Ma(h):[]}function fN(h,p){return h&&h.length?Ma(h,je(p,2)):[]}function hN(h,p){return p=typeof p=="function"?p:t,h&&h.length?Ma(h,t,p):[]}function Ev(h){if(!(h&&h.length))return[];var p=0;return h=js(h,function(v){if(wn(v))return p=Mn(v.length,p),!0}),$l(p,function(v){return Bt(h,wu(v))})}function dC(h,p){if(!(h&&h.length))return[];var v=Ev(h);return p==null?v:Bt(v,function(k){return Mr(p,t,k)})}var dN=tt(function(h,p){return wn(h)?Hf(h,p):[]}),pN=tt(function(h){return cv(js(h,wn))}),gN=tt(function(h){var p=Wi(h);return wn(p)&&(p=t),cv(js(h,wn),je(p,2))}),mN=tt(function(h){var p=Wi(h);return p=typeof p=="function"?p:t,cv(js(h,wn),t,p)}),yN=tt(Ev);function vN(h,p){return IS(h||[],p||[],Uf)}function bN(h,p){return IS(h||[],p||[],Kf)}var wN=tt(function(h){var p=h.length,v=p>1?h[p-1]:t;return v=typeof v=="function"?(h.pop(),v):t,dC(h,v)});function pC(h){var p=M(h);return p.__chain__=!0,p}function _N(h,p){return p(h),h}function wg(h,p){return p(h)}var kN=Wo(function(h){var p=h.length,v=p?h[0]:0,k=this.__wrapped__,E=function(P){return Yy(P,h)};return p>1||this.__actions__.length||!(k instanceof ht)||!jo(v)?this.thru(E):(k=k.slice(v,+v+(p?1:0)),k.__actions__.push({func:wg,args:[E],thisArg:t}),new Ni(k,this.__chain__).thru(function(P){return p&&!P.length&&P.push(t),P}))});function xN(){return pC(this)}function SN(){return new Ni(this.value(),this.__chain__)}function CN(){this.__values__===t&&(this.__values__=RC(this.value()));var h=this.__index__>=this.__values__.length,p=h?t:this.__values__[this.__index__++];return{done:h,value:p}}function EN(){return this}function AN(h){for(var p,v=this;v instanceof sg;){var k=aC(v);k.__index__=0,k.__values__=t,p?E.__wrapped__=k:p=k;var E=k;v=v.__wrapped__}return E.__wrapped__=h,p}function RN(){var h=this.__wrapped__;if(h instanceof ht){var p=h;return this.__actions__.length&&(p=new ht(this)),p=p.reverse(),p.__actions__.push({func:wg,args:[Cv],thisArg:t}),new Ni(p,this.__chain__)}return this.thru(Cv)}function DN(){return TS(this.__wrapped__,this.__actions__)}var TN=hg(function(h,p,v){ft.call(h,v)?++h[v]:Bo(h,v,1)});function IN(h,p,v){var k=Ze(h)?Af:_F;return v&&Fr(h,p,v)&&(p=t),k(h,je(p,3))}function MN(h,p){var v=Ze(h)?js:dS;return v(h,je(p,3))}var ON=jS(uC),PN=jS(lC);function LN(h,p){return Yn(_g(h,p),1)}function FN(h,p){return Yn(_g(h,p),ae)}function NN(h,p,v){return v=v===t?1:Je(v),Yn(_g(h,p),v)}function gC(h,p){var v=Ze(h)?mr:Ia;return v(h,je(p,3))}function mC(h,p){var v=Ze(h)?Fy:hS;return v(h,je(p,3))}var BN=hg(function(h,p,v){ft.call(h,v)?h[v].push(p):Bo(h,v,[p])});function qN(h,p,v,k){h=ei(h)?h:ec(h),v=v&&!k?Je(v):0;var E=h.length;return v<0&&(v=Mn(E+v,0)),Eg(h)?v<=E&&h.indexOf(p,v)>-1:!!E&&Fi(h,p,v)>-1}var WN=tt(function(h,p,v){var k=-1,E=typeof p=="function",P=ei(h)?V(h.length):[];return Ia(h,function(U){P[++k]=E?Mr(p,U,v):Vf(U,p,v)}),P}),jN=hg(function(h,p,v){Bo(h,v,p)});function _g(h,p){var v=Ze(h)?Bt:bS;return v(h,je(p,3))}function $N(h,p,v,k){return h==null?[]:(Ze(p)||(p=p==null?[]:[p]),v=k?t:v,Ze(v)||(v=v==null?[]:[v]),xS(h,p,v))}var zN=hg(function(h,p,v){h[v?0:1].push(p)},function(){return[[],[]]});function UN(h,p,v){var k=Ze(h)?Df:_u,E=arguments.length<3;return k(h,je(p,4),v,E,Ia)}function HN(h,p,v){var k=Ze(h)?$p:_u,E=arguments.length<3;return k(h,je(p,4),v,E,hS)}function VN(h,p){var v=Ze(h)?js:dS;return v(h,Sg(je(p,3)))}function GN(h){var p=Ze(h)?uS:qF;return p(h)}function KN(h,p,v){(v?Fr(h,p,v):p===t)?p=1:p=Je(p);var k=Ze(h)?mF:WF;return k(h,p)}function ZN(h){var p=Ze(h)?yF:$F;return p(h)}function XN(h){if(h==null)return 0;if(ei(h))return Eg(h)?Da(h):h.length;var p=vr(h);return p==Le||p==ct?h.size:rv(h).length}function YN(h,p,v){var k=Ze(h)?Tf:zF;return v&&Fr(h,p,v)&&(p=t),k(h,je(p,3))}var JN=tt(function(h,p){if(h==null)return[];var v=p.length;return v>1&&Fr(h,p[0],p[1])?p=[]:v>2&&Fr(p[0],p[1],p[2])&&(p=[p[0]]),xS(h,Yn(p,1),[])}),kg=ML||function(){return vn.Date.now()};function QN(h,p){if(typeof p!="function")throw new Oe(o);return h=Je(h),function(){if(--h<1)return p.apply(this,arguments)}}function yC(h,p,v){return p=v?t:p,p=h&&p==null?h.length:p,qo(h,I,t,t,t,t,p)}function vC(h,p){var v;if(typeof p!="function")throw new Oe(o);return h=Je(h),function(){return--h>0&&(v=p.apply(this,arguments)),h<=1&&(p=t),v}}var Av=tt(function(h,p,v){var k=b;if(v.length){var E=_s(v,Jl(Av));k|=C}return qo(h,k,p,v,E)}),bC=tt(function(h,p,v){var k=b|w;if(v.length){var E=_s(v,Jl(bC));k|=C}return qo(p,k,h,v,E)});function wC(h,p,v){p=v?t:p;var k=qo(h,_,t,t,t,t,t,p);return k.placeholder=wC.placeholder,k}function _C(h,p,v){p=v?t:p;var k=qo(h,S,t,t,t,t,t,p);return k.placeholder=_C.placeholder,k}function kC(h,p,v){var k,E,P,U,Z,ne,pe=0,ge=!1,ve=!1,Ce=!0;if(typeof h!="function")throw new Oe(o);p=ji(p)||0,an(v)&&(ge=!!v.leading,ve="maxWait"in v,P=ve?Mn(ji(v.maxWait)||0,p):P,Ce="trailing"in v?!!v.trailing:Ce);function Fe(_n){var Ss=k,Uo=E;return k=E=t,pe=_n,U=h.apply(Uo,Ss),U}function $e(_n){return pe=_n,Z=Yf(ut,p),ge?Fe(_n):U}function et(_n){var Ss=_n-ne,Uo=_n-pe,jC=p-Ss;return ve?yr(jC,P-Uo):jC}function ze(_n){var Ss=_n-ne,Uo=_n-pe;return ne===t||Ss>=p||Ss<0||ve&&Uo>=P}function ut(){var _n=kg();if(ze(_n))return pt(_n);Z=Yf(ut,et(_n))}function pt(_n){return Z=t,Ce&&k?Fe(_n):(k=E=t,U)}function _i(){Z!==t&&MS(Z),pe=0,k=ne=E=Z=t}function Nr(){return Z===t?U:pt(kg())}function ki(){var _n=kg(),Ss=ze(_n);if(k=arguments,E=this,ne=_n,Ss){if(Z===t)return $e(ne);if(ve)return MS(Z),Z=Yf(ut,p),Fe(ne)}return Z===t&&(Z=Yf(ut,p)),U}return ki.cancel=_i,ki.flush=Nr,ki}var e9=tt(function(h,p){return fS(h,1,p)}),t9=tt(function(h,p,v){return fS(h,ji(p)||0,v)});function n9(h){return qo(h,B)}function xg(h,p){if(typeof h!="function"||p!=null&&typeof p!="function")throw new Oe(o);var v=function(){var k=arguments,E=p?p.apply(this,k):k[0],P=v.cache;if(P.has(E))return P.get(E);var U=h.apply(this,k);return v.cache=P.set(E,U)||P,U};return v.cache=new(xg.Cache||No),v}xg.Cache=No;function Sg(h){if(typeof h!="function")throw new Oe(o);return function(){var p=arguments;switch(p.length){case 0:return!h.call(this);case 1:return!h.call(this,p[0]);case 2:return!h.call(this,p[0],p[1]);case 3:return!h.call(this,p[0],p[1],p[2])}return!h.apply(this,p)}}function r9(h){return vC(2,h)}var i9=UF(function(h,p){p=p.length==1&&Ze(p[0])?Bt(p[0],Or(je())):Bt(Yn(p,1),Or(je()));var v=p.length;return tt(function(k){for(var E=-1,P=yr(k.length,v);++E<P;)k[E]=p[E].call(this,k[E]);return Mr(h,this,k)})}),Rv=tt(function(h,p){var v=_s(p,Jl(Rv));return qo(h,C,t,p,v)}),xC=tt(function(h,p){var v=_s(p,Jl(xC));return qo(h,A,t,p,v)}),s9=Wo(function(h,p){return qo(h,W,t,t,t,p)});function o9(h,p){if(typeof h!="function")throw new Oe(o);return p=p===t?p:Je(p),tt(h,p)}function a9(h,p){if(typeof h!="function")throw new Oe(o);return p=p==null?0:Mn(Je(p),0),tt(function(v){var k=v[p],E=Pa(v,0,p);return k&&$s(E,k),Mr(h,this,E)})}function u9(h,p,v){var k=!0,E=!0;if(typeof h!="function")throw new Oe(o);return an(v)&&(k="leading"in v?!!v.leading:k,E="trailing"in v?!!v.trailing:E),kC(h,p,{leading:k,maxWait:p,trailing:E})}function l9(h){return yC(h,1)}function c9(h,p){return Rv(hv(p),h)}function f9(){if(!arguments.length)return[];var h=arguments[0];return Ze(h)?h:[h]}function h9(h){return Bi(h,g)}function d9(h,p){return p=typeof p=="function"?p:t,Bi(h,g,p)}function p9(h){return Bi(h,f|g)}function g9(h,p){return p=typeof p=="function"?p:t,Bi(h,f|g,p)}function m9(h,p){return p==null||cS(h,p,Wn(p))}function xs(h,p){return h===p||h!==h&&p!==p}var y9=mg(ev),v9=mg(function(h,p){return h>=p}),Tu=mS(function(){return arguments}())?mS:function(h){return pn(h)&&ft.call(h,"callee")&&!nS.call(h,"callee")},Ze=V.isArray,b9=Wp?Or(Wp):AF;function ei(h){return h!=null&&Cg(h.length)&&!$o(h)}function wn(h){return pn(h)&&ei(h)}function w9(h){return h===!0||h===!1||pn(h)&&Lr(h)==rn}var La=PL||qv,_9=Sf?Or(Sf):RF;function k9(h){return pn(h)&&h.nodeType===1&&!Jf(h)}function x9(h){if(h==null)return!0;if(ei(h)&&(Ze(h)||typeof h=="string"||typeof h.splice=="function"||La(h)||Ql(h)||Tu(h)))return!h.length;var p=vr(h);if(p==Le||p==ct)return!h.size;if(Xf(h))return!rv(h).length;for(var v in h)if(ft.call(h,v))return!1;return!0}function S9(h,p){return Gf(h,p)}function C9(h,p,v){v=typeof v=="function"?v:t;var k=v?v(h,p):t;return k===t?Gf(h,p,t,v):!!k}function Dv(h){if(!pn(h))return!1;var p=Lr(h);return p==Se||p==Pt||typeof h.message=="string"&&typeof h.name=="string"&&!Jf(h)}function E9(h){return typeof h=="number"&&iS(h)}function $o(h){if(!an(h))return!1;var p=Lr(h);return p==Ye||p==In||p==Bn||p==qn}function SC(h){return typeof h=="number"&&h==Je(h)}function Cg(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=be}function an(h){var p=typeof h;return h!=null&&(p=="object"||p=="function")}function pn(h){return h!=null&&typeof h=="object"}var CC=Cf?Or(Cf):TF;function A9(h,p){return h===p||nv(h,p,bv(p))}function R9(h,p,v){return v=typeof v=="function"?v:t,nv(h,p,bv(p),v)}function D9(h){return EC(h)&&h!=+h}function T9(h){if(d5(h))throw new _e(s);return yS(h)}function I9(h){return h===null}function M9(h){return h==null}function EC(h){return typeof h=="number"||pn(h)&&Lr(h)==$t}function Jf(h){if(!pn(h)||Lr(h)!=Yt)return!1;var p=Jp(h);if(p===null)return!0;var v=ft.call(p,"constructor")&&p.constructor;return typeof v=="function"&&v instanceof v&&bn.call(v)==RL}var Tv=Ef?Or(Ef):IF;function O9(h){return SC(h)&&h>=-be&&h<=be}var AC=Ea?Or(Ea):MF;function Eg(h){return typeof h=="string"||!Ze(h)&&pn(h)&&Lr(h)==hr}function wi(h){return typeof h=="symbol"||pn(h)&&Lr(h)==ls}var Ql=Aa?Or(Aa):OF;function P9(h){return h===t}function L9(h){return pn(h)&&vr(h)==Xr}function F9(h){return pn(h)&&Lr(h)==Fs}var N9=mg(iv),B9=mg(function(h,p){return h<=p});function RC(h){if(!h)return[];if(ei(h))return Eg(h)?Pr(h):Qr(h);if(qf&&h[qf])return zl(h[qf]());var p=vr(h),v=p==Le?Ul:p==ct?Vl:ec;return v(h)}function zo(h){if(!h)return h===0?h:0;if(h=ji(h),h===ae||h===-ae){var p=h<0?-1:1;return p*ye}return h===h?h:0}function Je(h){var p=zo(h),v=p%1;return p===p?v?p-v:p:0}function DC(h){return h?Eu(Je(h),0,we):0}function ji(h){if(typeof h=="number")return h;if(wi(h))return De;if(an(h)){var p=typeof h.valueOf=="function"?h.valueOf():h;h=an(p)?p+"":p}if(typeof h!="string")return h===0?h:+h;h=Vp(h);var v=zt.test(h);return v||it.test(h)?Ca(h.slice(2),v?2:8):_t.test(h)?De:+h}function TC(h){return Us(h,ti(h))}function q9(h){return h?Eu(Je(h),-be,be):h===0?h:0}function St(h){return h==null?"":bi(h)}var W9=Xl(function(h,p){if(Xf(p)||ei(p)){Us(p,Wn(p),h);return}for(var v in p)ft.call(p,v)&&Uf(h,v,p[v])}),IC=Xl(function(h,p){Us(p,ti(p),h)}),Ag=Xl(function(h,p,v,k){Us(p,ti(p),h,k)}),j9=Xl(function(h,p,v,k){Us(p,Wn(p),h,k)}),$9=Wo(Yy);function z9(h,p){var v=Zl(h);return p==null?v:lS(v,p)}var U9=tt(function(h,p){h=re(h);var v=-1,k=p.length,E=k>2?p[2]:t;for(E&&Fr(p[0],p[1],E)&&(k=1);++v<k;)for(var P=p[v],U=ti(P),Z=-1,ne=U.length;++Z<ne;){var pe=U[Z],ge=h[pe];(ge===t||xs(ge,We[pe])&&!ft.call(h,pe))&&(h[pe]=P[pe])}return h}),H9=tt(function(h){return h.push(t,KS),Mr(MC,t,h)});function V9(h,p){return Up(h,je(p,3),zs)}function G9(h,p){return Up(h,je(p,3),Qy)}function K9(h,p){return h==null?h:Jy(h,je(p,3),ti)}function Z9(h,p){return h==null?h:pS(h,je(p,3),ti)}function X9(h,p){return h&&zs(h,je(p,3))}function Y9(h,p){return h&&Qy(h,je(p,3))}function J9(h){return h==null?[]:ug(h,Wn(h))}function Q9(h){return h==null?[]:ug(h,ti(h))}function Iv(h,p,v){var k=h==null?t:Au(h,p);return k===t?v:k}function eB(h,p){return h!=null&&YS(h,p,xF)}function Mv(h,p){return h!=null&&YS(h,p,SF)}var tB=zS(function(h,p,v){p!=null&&typeof p.toString!="function"&&(p=Zp.call(p)),h[p]=v},Pv(ni)),nB=zS(function(h,p,v){p!=null&&typeof p.toString!="function"&&(p=Zp.call(p)),ft.call(h,p)?h[p].push(v):h[p]=[v]},je),rB=tt(Vf);function Wn(h){return ei(h)?aS(h):rv(h)}function ti(h){return ei(h)?aS(h,!0):PF(h)}function iB(h,p){var v={};return p=je(p,3),zs(h,function(k,E,P){Bo(v,p(k,E,P),k)}),v}function sB(h,p){var v={};return p=je(p,3),zs(h,function(k,E,P){Bo(v,E,p(k,E,P))}),v}var oB=Xl(function(h,p,v){lg(h,p,v)}),MC=Xl(function(h,p,v,k){lg(h,p,v,k)}),aB=Wo(function(h,p){var v={};if(h==null)return v;var k=!1;p=Bt(p,function(P){return P=Oa(P,h),k||(k=P.length>1),P}),Us(h,yv(h),v),k&&(v=Bi(v,f|d|g,t5));for(var E=p.length;E--;)lv(v,p[E]);return v});function uB(h,p){return OC(h,Sg(je(p)))}var lB=Wo(function(h,p){return h==null?{}:FF(h,p)});function OC(h,p){if(h==null)return{};var v=Bt(yv(h),function(k){return[k]});return p=je(p),SS(h,v,function(k,E){return p(k,E[0])})}function cB(h,p,v){p=Oa(p,h);var k=-1,E=p.length;for(E||(E=1,h=t);++k<E;){var P=h==null?t:h[Hs(p[k])];P===t&&(k=E,P=v),h=$o(P)?P.call(h):P}return h}function fB(h,p,v){return h==null?h:Kf(h,p,v)}function hB(h,p,v,k){return k=typeof k=="function"?k:t,h==null?h:Kf(h,p,v,k)}var PC=VS(Wn),LC=VS(ti);function dB(h,p,v){var k=Ze(h),E=k||La(h)||Ql(h);if(p=je(p,4),v==null){var P=h&&h.constructor;E?v=k?new P:[]:an(h)?v=$o(P)?Zl(Jp(h)):{}:v={}}return(E?mr:zs)(h,function(U,Z,ne){return p(v,U,Z,ne)}),v}function pB(h,p){return h==null?!0:lv(h,p)}function gB(h,p,v){return h==null?h:DS(h,p,hv(v))}function mB(h,p,v,k){return k=typeof k=="function"?k:t,h==null?h:DS(h,p,hv(v),k)}function ec(h){return h==null?[]:Pf(h,Wn(h))}function yB(h){return h==null?[]:Pf(h,ti(h))}function vB(h,p,v){return v===t&&(v=p,p=t),v!==t&&(v=ji(v),v=v===v?v:0),p!==t&&(p=ji(p),p=p===p?p:0),Eu(ji(h),p,v)}function bB(h,p,v){return p=zo(p),v===t?(v=p,p=0):v=zo(v),h=ji(h),CF(h,p,v)}function wB(h,p,v){if(v&&typeof v!="boolean"&&Fr(h,p,v)&&(p=v=t),v===t&&(typeof p=="boolean"?(v=p,p=t):typeof h=="boolean"&&(v=h,h=t)),h===t&&p===t?(h=0,p=1):(h=zo(h),p===t?(p=h,h=0):p=zo(p)),h>p){var k=h;h=p,p=k}if(v||h%1||p%1){var E=sS();return yr(h+E*(p-h+yi("1e-"+((E+"").length-1))),p)}return ov(h,p)}var _B=Yl(function(h,p,v){return p=p.toLowerCase(),h+(v?FC(p):p)});function FC(h){return Ov(St(h).toLowerCase())}function NC(h){return h=St(h),h&&h.replace(st,jy).replace(Bp,"")}function kB(h,p,v){h=St(h),p=bi(p);var k=h.length;v=v===t?k:Eu(Je(v),0,k);var E=v;return v-=p.length,v>=0&&h.slice(v,E)==p}function xB(h){return h=St(h),h&&gs.test(h)?h.replace(Bs,Ff):h}function SB(h){return h=St(h),h&&Li.test(h)?h.replace(Pi,"\\$&"):h}var CB=Yl(function(h,p,v){return h+(v?"-":"")+p.toLowerCase()}),EB=Yl(function(h,p,v){return h+(v?" ":"")+p.toLowerCase()}),AB=WS("toLowerCase");function RB(h,p,v){h=St(h),p=Je(p);var k=p?Da(h):0;if(!p||k>=p)return h;var E=(p-k)/2;return gg(ng(E),v)+h+gg(tg(E),v)}function DB(h,p,v){h=St(h),p=Je(p);var k=p?Da(h):0;return p&&k<p?h+gg(p-k,v):h}function TB(h,p,v){h=St(h),p=Je(p);var k=p?Da(h):0;return p&&k<p?gg(p-k,v)+h:h}function IB(h,p,v){return v||p==null?p=0:p&&(p=+p),BL(St(h).replace(ys,""),p||0)}function MB(h,p,v){return(v?Fr(h,p,v):p===t)?p=1:p=Je(p),av(St(h),p)}function OB(){var h=arguments,p=St(h[0]);return h.length<3?p:p.replace(h[1],h[2])}var PB=Yl(function(h,p,v){return h+(v?"_":"")+p.toLowerCase()});function LB(h,p,v){return v&&typeof v!="number"&&Fr(h,p,v)&&(p=v=t),v=v===t?we:v>>>0,v?(h=St(h),h&&(typeof p=="string"||p!=null&&!Tv(p))&&(p=bi(p),!p&&Ra(h))?Pa(Pr(h),0,v):h.split(p,v)):[]}var FB=Yl(function(h,p,v){return h+(v?" ":"")+Ov(p)});function NB(h,p,v){return h=St(h),v=v==null?0:Eu(Je(v),0,h.length),p=bi(p),h.slice(v,v+p.length)==p}function BB(h,p,v){var k=M.templateSettings;v&&Fr(h,p,v)&&(p=t),h=St(h),p=Ag({},p,k,GS);var E=Ag({},p.imports,k.imports,GS),P=Wn(E),U=Pf(E,P),Z,ne,pe=0,ge=p.interpolate||Ut,ve="__p += '",Ce=ce((p.escape||Ut).source+"|"+ge.source+"|"+(ge===Mo?Me:Ut).source+"|"+(p.evaluate||Ut).source+"|$","g"),Fe="//# sourceURL="+(ft.call(p,"sourceURL")?(p.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ws+"]")+`
|
|
22
|
-
`;h.replace(Ce,function(ze,ut,pt,_i,Nr,ki){return pt||(pt=_i),ve+=h.slice(pe,ki).replace(on,Nf),ut&&(Z=!0,ve+=`' +
|
|
23
|
-
__e(`+ut+`) +
|
|
24
|
-
'`),Nr&&(ne=!0,ve+=`';
|
|
25
|
-
`+Nr+`;
|
|
26
|
-
__p += '`),pt&&(ve+=`' +
|
|
27
|
-
((__t = (`+pt+`)) == null ? '' : __t) +
|
|
28
|
-
'`),pe=ki+ze.length,ze}),ve+=`';
|
|
29
|
-
`;var $e=ft.call(p,"variable")&&p.variable;if(!$e)ve=`with (obj) {
|
|
30
|
-
`+ve+`
|
|
31
|
-
}
|
|
32
|
-
`;else if(de.test($e))throw new _e(a);ve=(ne?ve.replace(Do,""):ve).replace(xa,"$1").replace(To,"$1;"),ve="function("+($e||"obj")+`) {
|
|
33
|
-
`+($e?"":`obj || (obj = {});
|
|
34
|
-
`)+"var __t, __p = ''"+(Z?", __e = _.escape":"")+(ne?`, __j = Array.prototype.join;
|
|
35
|
-
function print() { __p += __j.call(arguments, '') }
|
|
36
|
-
`:`;
|
|
37
|
-
`)+ve+`return __p
|
|
38
|
-
}`;var et=qC(function(){return $(P,Fe+"return "+ve).apply(t,U)});if(et.source=ve,Dv(et))throw et;return et}function qB(h){return St(h).toLowerCase()}function WB(h){return St(h).toUpperCase()}function jB(h,p,v){if(h=St(h),h&&(v||p===t))return Vp(h);if(!h||!(p=bi(p)))return h;var k=Pr(h),E=Pr(p),P=Lf(k,E),U=Gp(k,E)+1;return Pa(k,P,U).join("")}function $B(h,p,v){if(h=St(h),h&&(v||p===t))return h.slice(0,Kp(h)+1);if(!h||!(p=bi(p)))return h;var k=Pr(h),E=Gp(k,Pr(p))+1;return Pa(k,0,E).join("")}function zB(h,p,v){if(h=St(h),h&&(v||p===t))return h.replace(ys,"");if(!h||!(p=bi(p)))return h;var k=Pr(h),E=Lf(k,Pr(p));return Pa(k,E).join("")}function UB(h,p){var v=K,k=G;if(an(p)){var E="separator"in p?p.separator:E;v="length"in p?Je(p.length):v,k="omission"in p?bi(p.omission):k}h=St(h);var P=h.length;if(Ra(h)){var U=Pr(h);P=U.length}if(v>=P)return h;var Z=v-Da(k);if(Z<1)return k;var ne=U?Pa(U,0,Z).join(""):h.slice(0,Z);if(E===t)return ne+k;if(U&&(Z+=ne.length-Z),Tv(E)){if(h.slice(Z).search(E)){var pe,ge=ne;for(E.global||(E=ce(E.source,St(xt.exec(E))+"g")),E.lastIndex=0;pe=E.exec(ge);)var ve=pe.index;ne=ne.slice(0,ve===t?Z:ve)}}else if(h.indexOf(bi(E),Z)!=Z){var Ce=ne.lastIndexOf(E);Ce>-1&&(ne=ne.slice(0,Ce))}return ne+k}function HB(h){return h=St(h),h&&ps.test(h)?h.replace(pr,D):h}var VB=Yl(function(h,p,v){return h+(v?" ":"")+p.toUpperCase()}),Ov=WS("toUpperCase");function BC(h,p,v){return h=St(h),p=v?t:p,p===t?zy(h)?X(h):By(h):h.match(p)||[]}var qC=tt(function(h,p){try{return Mr(h,t,p)}catch(v){return Dv(v)?v:new _e(v)}}),GB=Wo(function(h,p){return mr(p,function(v){v=Hs(v),Bo(h,v,Av(h[v],h))}),h});function KB(h){var p=h==null?0:h.length,v=je();return h=p?Bt(h,function(k){if(typeof k[1]!="function")throw new Oe(o);return[v(k[0]),k[1]]}):[],tt(function(k){for(var E=-1;++E<p;){var P=h[E];if(Mr(P[0],this,k))return Mr(P[1],this,k)}})}function ZB(h){return wF(Bi(h,f))}function Pv(h){return function(){return h}}function XB(h,p){return h==null||h!==h?p:h}var YB=$S(),JB=$S(!0);function ni(h){return h}function Lv(h){return vS(typeof h=="function"?h:Bi(h,f))}function QB(h){return wS(Bi(h,f))}function e7(h,p){return _S(h,Bi(p,f))}var t7=tt(function(h,p){return function(v){return Vf(v,h,p)}}),n7=tt(function(h,p){return function(v){return Vf(h,v,p)}});function Fv(h,p,v){var k=Wn(p),E=ug(p,k);v==null&&!(an(p)&&(E.length||!k.length))&&(v=p,p=h,h=this,E=ug(p,Wn(p)));var P=!(an(v)&&"chain"in v)||!!v.chain,U=$o(h);return mr(E,function(Z){var ne=p[Z];h[Z]=ne,U&&(h.prototype[Z]=function(){var pe=this.__chain__;if(P||pe){var ge=h(this.__wrapped__),ve=ge.__actions__=Qr(this.__actions__);return ve.push({func:ne,args:arguments,thisArg:h}),ge.__chain__=pe,ge}return ne.apply(h,$s([this.value()],arguments))})}),h}function r7(){return vn._===this&&(vn._=DL),this}function Nv(){}function i7(h){return h=Je(h),tt(function(p){return kS(p,h)})}var s7=pv(Bt),o7=pv(Af),a7=pv(Tf);function WC(h){return _v(h)?wu(Hs(h)):NF(h)}function u7(h){return function(p){return h==null?t:Au(h,p)}}var l7=US(),c7=US(!0);function Bv(){return[]}function qv(){return!1}function f7(){return{}}function h7(){return""}function d7(){return!0}function p7(h,p){if(h=Je(h),h<1||h>be)return[];var v=we,k=yr(h,we);p=je(p),h-=we;for(var E=$l(k,p);++v<h;)p(v);return E}function g7(h){return Ze(h)?Bt(h,Hs):wi(h)?[h]:Qr(oC(St(h)))}function m7(h){var p=++Lo;return St(h)+p}var y7=pg(function(h,p){return h+p},0),v7=gv("ceil"),b7=pg(function(h,p){return h/p},1),w7=gv("floor");function _7(h){return h&&h.length?ag(h,ni,ev):t}function k7(h,p){return h&&h.length?ag(h,je(p,2),ev):t}function x7(h){return If(h,ni)}function S7(h,p){return If(h,je(p,2))}function C7(h){return h&&h.length?ag(h,ni,iv):t}function E7(h,p){return h&&h.length?ag(h,je(p,2),iv):t}var A7=pg(function(h,p){return h*p},1),R7=gv("round"),D7=pg(function(h,p){return h-p},0);function T7(h){return h&&h.length?Mf(h,ni):0}function I7(h,p){return h&&h.length?Mf(h,je(p,2)):0}return M.after=QN,M.ary=yC,M.assign=W9,M.assignIn=IC,M.assignInWith=Ag,M.assignWith=j9,M.at=$9,M.before=vC,M.bind=Av,M.bindAll=GB,M.bindKey=bC,M.castArray=f9,M.chain=pC,M.chunk=w5,M.compact=_5,M.concat=k5,M.cond=KB,M.conforms=ZB,M.constant=Pv,M.countBy=TN,M.create=z9,M.curry=wC,M.curryRight=_C,M.debounce=kC,M.defaults=U9,M.defaultsDeep=H9,M.defer=e9,M.delay=t9,M.difference=x5,M.differenceBy=S5,M.differenceWith=C5,M.drop=E5,M.dropRight=A5,M.dropRightWhile=R5,M.dropWhile=D5,M.fill=T5,M.filter=MN,M.flatMap=LN,M.flatMapDeep=FN,M.flatMapDepth=NN,M.flatten=cC,M.flattenDeep=I5,M.flattenDepth=M5,M.flip=n9,M.flow=YB,M.flowRight=JB,M.fromPairs=O5,M.functions=J9,M.functionsIn=Q9,M.groupBy=BN,M.initial=L5,M.intersection=F5,M.intersectionBy=N5,M.intersectionWith=B5,M.invert=tB,M.invertBy=nB,M.invokeMap=WN,M.iteratee=Lv,M.keyBy=jN,M.keys=Wn,M.keysIn=ti,M.map=_g,M.mapKeys=iB,M.mapValues=sB,M.matches=QB,M.matchesProperty=e7,M.memoize=xg,M.merge=oB,M.mergeWith=MC,M.method=t7,M.methodOf=n7,M.mixin=Fv,M.negate=Sg,M.nthArg=i7,M.omit=aB,M.omitBy=uB,M.once=r9,M.orderBy=$N,M.over=s7,M.overArgs=i9,M.overEvery=o7,M.overSome=a7,M.partial=Rv,M.partialRight=xC,M.partition=zN,M.pick=lB,M.pickBy=OC,M.property=WC,M.propertyOf=u7,M.pull=$5,M.pullAll=hC,M.pullAllBy=z5,M.pullAllWith=U5,M.pullAt=H5,M.range=l7,M.rangeRight=c7,M.rearg=s9,M.reject=VN,M.remove=V5,M.rest=o9,M.reverse=Cv,M.sampleSize=KN,M.set=fB,M.setWith=hB,M.shuffle=ZN,M.slice=G5,M.sortBy=JN,M.sortedUniq=eN,M.sortedUniqBy=tN,M.split=LB,M.spread=a9,M.tail=nN,M.take=rN,M.takeRight=iN,M.takeRightWhile=sN,M.takeWhile=oN,M.tap=_N,M.throttle=u9,M.thru=wg,M.toArray=RC,M.toPairs=PC,M.toPairsIn=LC,M.toPath=g7,M.toPlainObject=TC,M.transform=dB,M.unary=l9,M.union=aN,M.unionBy=uN,M.unionWith=lN,M.uniq=cN,M.uniqBy=fN,M.uniqWith=hN,M.unset=pB,M.unzip=Ev,M.unzipWith=dC,M.update=gB,M.updateWith=mB,M.values=ec,M.valuesIn=yB,M.without=dN,M.words=BC,M.wrap=c9,M.xor=pN,M.xorBy=gN,M.xorWith=mN,M.zip=yN,M.zipObject=vN,M.zipObjectDeep=bN,M.zipWith=wN,M.entries=PC,M.entriesIn=LC,M.extend=IC,M.extendWith=Ag,Fv(M,M),M.add=y7,M.attempt=qC,M.camelCase=_B,M.capitalize=FC,M.ceil=v7,M.clamp=vB,M.clone=h9,M.cloneDeep=p9,M.cloneDeepWith=g9,M.cloneWith=d9,M.conformsTo=m9,M.deburr=NC,M.defaultTo=XB,M.divide=b7,M.endsWith=kB,M.eq=xs,M.escape=xB,M.escapeRegExp=SB,M.every=IN,M.find=ON,M.findIndex=uC,M.findKey=V9,M.findLast=PN,M.findLastIndex=lC,M.findLastKey=G9,M.floor=w7,M.forEach=gC,M.forEachRight=mC,M.forIn=K9,M.forInRight=Z9,M.forOwn=X9,M.forOwnRight=Y9,M.get=Iv,M.gt=y9,M.gte=v9,M.has=eB,M.hasIn=Mv,M.head=fC,M.identity=ni,M.includes=qN,M.indexOf=P5,M.inRange=bB,M.invoke=rB,M.isArguments=Tu,M.isArray=Ze,M.isArrayBuffer=b9,M.isArrayLike=ei,M.isArrayLikeObject=wn,M.isBoolean=w9,M.isBuffer=La,M.isDate=_9,M.isElement=k9,M.isEmpty=x9,M.isEqual=S9,M.isEqualWith=C9,M.isError=Dv,M.isFinite=E9,M.isFunction=$o,M.isInteger=SC,M.isLength=Cg,M.isMap=CC,M.isMatch=A9,M.isMatchWith=R9,M.isNaN=D9,M.isNative=T9,M.isNil=M9,M.isNull=I9,M.isNumber=EC,M.isObject=an,M.isObjectLike=pn,M.isPlainObject=Jf,M.isRegExp=Tv,M.isSafeInteger=O9,M.isSet=AC,M.isString=Eg,M.isSymbol=wi,M.isTypedArray=Ql,M.isUndefined=P9,M.isWeakMap=L9,M.isWeakSet=F9,M.join=q5,M.kebabCase=CB,M.last=Wi,M.lastIndexOf=W5,M.lowerCase=EB,M.lowerFirst=AB,M.lt=N9,M.lte=B9,M.max=_7,M.maxBy=k7,M.mean=x7,M.meanBy=S7,M.min=C7,M.minBy=E7,M.stubArray=Bv,M.stubFalse=qv,M.stubObject=f7,M.stubString=h7,M.stubTrue=d7,M.multiply=A7,M.nth=j5,M.noConflict=r7,M.noop=Nv,M.now=kg,M.pad=RB,M.padEnd=DB,M.padStart=TB,M.parseInt=IB,M.random=wB,M.reduce=UN,M.reduceRight=HN,M.repeat=MB,M.replace=OB,M.result=cB,M.round=R7,M.runInContext=T,M.sample=GN,M.size=XN,M.snakeCase=PB,M.some=YN,M.sortedIndex=K5,M.sortedIndexBy=Z5,M.sortedIndexOf=X5,M.sortedLastIndex=Y5,M.sortedLastIndexBy=J5,M.sortedLastIndexOf=Q5,M.startCase=FB,M.startsWith=NB,M.subtract=D7,M.sum=T7,M.sumBy=I7,M.template=BB,M.times=p7,M.toFinite=zo,M.toInteger=Je,M.toLength=DC,M.toLower=qB,M.toNumber=ji,M.toSafeInteger=q9,M.toString=St,M.toUpper=WB,M.trim=jB,M.trimEnd=$B,M.trimStart=zB,M.truncate=UB,M.unescape=HB,M.uniqueId=m7,M.upperCase=VB,M.upperFirst=Ov,M.each=gC,M.eachRight=mC,M.first=fC,Fv(M,function(){var h={};return zs(M,function(p,v){ft.call(M.prototype,v)||(h[v]=p)}),h}(),{chain:!1}),M.VERSION=r,mr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(h){M[h].placeholder=M}),mr(["drop","take"],function(h,p){ht.prototype[h]=function(v){v=v===t?1:Mn(Je(v),0);var k=this.__filtered__&&!p?new ht(this):this.clone();return k.__filtered__?k.__takeCount__=yr(v,k.__takeCount__):k.__views__.push({size:yr(v,we),type:h+(k.__dir__<0?"Right":"")}),k},ht.prototype[h+"Right"]=function(v){return this.reverse()[h](v).reverse()}}),mr(["filter","map","takeWhile"],function(h,p){var v=p+1,k=v==Y||v==te;ht.prototype[h]=function(E){var P=this.clone();return P.__iteratees__.push({iteratee:je(E,3),type:v}),P.__filtered__=P.__filtered__||k,P}}),mr(["head","last"],function(h,p){var v="take"+(p?"Right":"");ht.prototype[h]=function(){return this[v](1).value()[0]}}),mr(["initial","tail"],function(h,p){var v="drop"+(p?"":"Right");ht.prototype[h]=function(){return this.__filtered__?new ht(this):this[v](1)}}),ht.prototype.compact=function(){return this.filter(ni)},ht.prototype.find=function(h){return this.filter(h).head()},ht.prototype.findLast=function(h){return this.reverse().find(h)},ht.prototype.invokeMap=tt(function(h,p){return typeof h=="function"?new ht(this):this.map(function(v){return Vf(v,h,p)})}),ht.prototype.reject=function(h){return this.filter(Sg(je(h)))},ht.prototype.slice=function(h,p){h=Je(h);var v=this;return v.__filtered__&&(h>0||p<0)?new ht(v):(h<0?v=v.takeRight(-h):h&&(v=v.drop(h)),p!==t&&(p=Je(p),v=p<0?v.dropRight(-p):v.take(p-h)),v)},ht.prototype.takeRightWhile=function(h){return this.reverse().takeWhile(h).reverse()},ht.prototype.toArray=function(){return this.take(we)},zs(ht.prototype,function(h,p){var v=/^(?:filter|find|map|reject)|While$/.test(p),k=/^(?:head|last)$/.test(p),E=M[k?"take"+(p=="last"?"Right":""):p],P=k||/^find/.test(p);E&&(M.prototype[p]=function(){var U=this.__wrapped__,Z=k?[1]:arguments,ne=U instanceof ht,pe=Z[0],ge=ne||Ze(U),ve=function(ut){var pt=E.apply(M,$s([ut],Z));return k&&Ce?pt[0]:pt};ge&&v&&typeof pe=="function"&&pe.length!=1&&(ne=ge=!1);var Ce=this.__chain__,Fe=!!this.__actions__.length,$e=P&&!Ce,et=ne&&!Fe;if(!P&&ge){U=et?U:new ht(this);var ze=h.apply(U,Z);return ze.__actions__.push({func:wg,args:[ve],thisArg:t}),new Ni(ze,Ce)}return $e&&et?h.apply(this,Z):(ze=this.thru(ve),$e?k?ze.value()[0]:ze.value():ze)})}),mr(["pop","push","shift","sort","splice","unshift"],function(h){var p=He[h],v=/^(?:push|sort|unshift)$/.test(h)?"tap":"thru",k=/^(?:pop|shift)$/.test(h);M.prototype[h]=function(){var E=arguments;if(k&&!this.__chain__){var P=this.value();return p.apply(Ze(P)?P:[],E)}return this[v](function(U){return p.apply(Ze(U)?U:[],E)})}}),zs(ht.prototype,function(h,p){var v=M[p];if(v){var k=v.name+"";ft.call(Kl,k)||(Kl[k]=[]),Kl[k].push({name:p,func:v})}}),Kl[dg(t,w).name]=[{name:"wrapper",func:t}],ht.prototype.clone=HL,ht.prototype.reverse=VL,ht.prototype.value=GL,M.prototype.at=kN,M.prototype.chain=xN,M.prototype.commit=SN,M.prototype.next=CN,M.prototype.plant=AN,M.prototype.reverse=RN,M.prototype.toJSON=M.prototype.valueOf=M.prototype.value=DN,M.prototype.first=M.prototype.head,qf&&(M.prototype[qf]=EN),M},J=Q();ws?((ws.exports=J)._=J,Bl._=J):vn._=J}).call(Mj)}(ed,ed.exports)),ed.exports}var Pj=Oj();const Lj=Ae.theme({"&:not(.cm-focused)":{"& .cm-activeLine, & .cm-activeLineGutter":{color:"inherit",backgroundColor:"transparent"}},".cm-toolbar-input":{fontFamily:"var(--cm-font-family)",lineHeight:1.4,border:"none",background:"transparent",outline:"none",fontSize:"16px",color:"var(--cm-toolbar-color)",padding:"0 2px 0 6px",width:"100%",flex:1},".cm-toolbar-input-container":{position:"relative",display:"flex",alignItems:"center",flex:1},".cm-toolbar-panel":{padding:0,background:"var(--cm-toolbar-background)",display:"flex",alignItems:"center"},".cm-command-result > span":{color:"var(--cm-command-result-color)"},".cm-search-result":{color:"var(--cm-search-result-color)",display:"flex",cursor:"pointer","&.cm-command-result":{color:"var(--cm-command-result-color)"},"& > .cm-search-result-icon-container":{width:"var(--cm-gutter-width)","& > .cm-search-result-icon":{fontSize:"16px",textAlign:"right",boxSizing:"border-box",padding:"0 3px 0 5px",width:"var(--cm-gutter-lineno-width)"}},"&:hover":{"& div":{color:"var(--cm-search-result-color-hover)"},backgroundColor:"var(--cm-search-result-bg-hover)"},"&.selected":{"& div":{color:"var(--cm-search-result-color-selected)"},backgroundColor:"var(--cm-search-result-select-bg)"},"& > .cm-search-result-label":{flex:1,padding:"0 2px 0 6px"}},".cm-toolbar-state-icon-container":{width:"var(--cm-gutter-width)"},".cm-toolbar-state-icon":{fontSize:"16px",textAlign:"right",boxSizing:"border-box",padding:"0 3px 0 5px",color:"var(--cm-foreground)",width:"var(--cm-gutter-lineno-width)"},".cm-content":{padding:0},".cm-tooltip":{display:"flex",flexDirection:"column",fontFamily:"var(--cm-font-family)",boxShadow:"-12px 12px 1px rgba(0,0,0,0.3)",fontSize:"1rem",maxWidth:"min(calc(100% - 2rem), 62ch)",border:"2px solid var(--cm-tooltip-border)",overflow:"auto",background:"var(--cm-tooltip-background)",color:"var(--cm-tooltip-color)"},".cm-tooltip a":{color:"var(--cm-link)"},".cm-tooltip-section:not(:first-child)":{borderTop:"none"},".cm-tooltip-lint":{order:-1},".cm-diagnostic":{padding:"3px 6px",whiteSpace:"pre-wrap",marginLeft:0,borderLeft:"none"},".cm-diagnostic-info":{backgroundColor:"var(--cm-diagnostic-info-bg)",color:"var(--cm-diagnostic-info-color)"},".cm-diagnostic-error":{borderLeft:"none",backgroundColor:"var(--cm-diagnostic-error-bg)",color:"var(--cm-diagnostic-error-color)"},".cm-diagnosticSource":{display:"none"},".documentation":{padding:"2px"},".documentation > *":{margin:0,padding:"0.25rem 6px",fontSize:"1rem"},".documentation > p > code":{backgroundColor:"var(--cm-comment-bg)",padding:"2px 4px",margin:"2px 0",display:"inline-block"},".documentation > pre > code":{whiteSpace:"break-spaces"},".cm-diagnosticAction":{display:"none"},".cm-diagnosticText div":{display:"flex",height:"fit-content"},".cm-diagnosticText p":{margin:0},".cm-search-results":{position:"absolute",top:"100%",margin:0,padding:0,background:"var(--cm-toolbar-background)",fontFamily:"var(--cm-font-family)",fontSize:"1rem",listStyleType:"none",width:"100%",maxHeight:"25vh",overflowY:"auto"},".cm-gutters":{borderRight:"none"},".cm-panels-top":{borderBottom:"none"}}),Fj=1024;let Nj=0,Zi=class{constructor(e,t){this.from=e,this.to=t}};class ot{constructor(e={}){this.id=Nj++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Vr.match(e)),t=>{let r=e(t);return r===void 0?null:[this,r]}}}ot.closedBy=new ot({deserialize:n=>n.split(" ")});ot.openedBy=new ot({deserialize:n=>n.split(" ")});ot.group=new ot({deserialize:n=>n.split(" ")});ot.isolate=new ot({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});ot.contextHash=new ot({perNode:!0});ot.lookAhead=new ot({perNode:!0});ot.mounted=new ot({perNode:!0});class Cd{constructor(e,t,r){this.tree=e,this.overlay=t,this.parser=r}static get(e){return e&&e.props&&e.props[ot.mounted.id]}}const Bj=Object.create(null);class Vr{constructor(e,t,r,i=0){this.name=e,this.props=t,this.id=r,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):Bj,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Vr(e.name||"",t,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(ot.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let r in e)for(let i of r.split(" "))t[i]=e[r];return r=>{for(let i=r.prop(ot.group),s=-1;s<(i?i.length:0);s++){let o=t[s<0?r.name:i[s]];if(o)return o}}}}Vr.none=new Vr("",Object.create(null),0,8);class gk{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let r of this.types){let i=null;for(let s of e){let o=s(r);o&&(i||(i=Object.assign({},r.props)),i[o[0].id]=o[1])}t.push(i?new Vr(r.name,i,r.id,r.flags):r)}return new gk(t)}}const Ug=new WeakMap,VE=new WeakMap;var fn;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays"})(fn||(fn={}));class Gt{constructor(e,t,r,i,s){if(this.type=e,this.children=t,this.positions=r,this.length=i,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,a]of s)this.props[typeof o=="number"?o:o.id]=a}}toString(){let e=Cd.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let r of this.children){let i=r.toString();i&&(t&&(t+=","),t+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new Bm(this.topNode,e)}cursorAt(e,t=0,r=0){let i=Ug.get(this)||this.topNode,s=new Bm(i);return s.moveTo(e,t),Ug.set(this,s._tree),s}get topNode(){return new Sr(this,0,0,null)}resolve(e,t=0){let r=Ed(Ug.get(this)||this.topNode,e,t,!1);return Ug.set(this,r),r}resolveInner(e,t=0){let r=Ed(VE.get(this)||this.topNode,e,t,!0);return VE.set(this,r),r}resolveStack(e,t=0){return jj(this,e,t)}iterate(e){let{enter:t,leave:r,from:i=0,to:s=this.length}=e,o=e.mode||0,a=(o&fn.IncludeAnonymous)>0;for(let u=this.cursor(o|fn.IncludeAnonymous);;){let l=!1;if(u.from<=s&&u.to>=i&&(!a&&u.type.isAnonymous||t(u)!==!1)){if(u.firstChild())continue;l=!0}for(;l&&r&&(a||!u.type.isAnonymous)&&r(u),!u.nextSibling();){if(!u.parent())return;l=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:vk(Vr.none,this.children,this.positions,0,this.children.length,0,this.length,(t,r,i)=>new Gt(this.type,t,r,i,this.propValues),e.makeTree||((t,r,i)=>new Gt(Vr.none,t,r,i)))}static build(e){return $j(e)}}Gt.empty=new Gt(Vr.none,[],[],0);class mk{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new mk(this.buffer,this.index)}}class ou{constructor(e,t,r){this.buffer=e,this.length=t,this.set=r}get type(){return Vr.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],r=this.buffer[e+3],i=this.set.types[t],s=i.name;if(/\W/.test(s)&&!i.isError&&(s=JSON.stringify(s)),e+=4,r==e)return s;let o=[];for(;e<r;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,t,r,i,s){let{buffer:o}=this,a=-1;for(let u=e;u!=t&&!(UM(s,i,o[u+1],o[u+2])&&(a=u,r>0));u=o[u+3]);return a}slice(e,t,r){let i=this.buffer,s=new Uint16Array(t-e),o=0;for(let a=e,u=0;a<t;){s[u++]=i[a++],s[u++]=i[a++]-r;let l=s[u++]=i[a++]-r;s[u++]=i[a++]-e,o=Math.max(o,l)}return new ou(s,o,this.set)}}function UM(n,e,t,r){switch(n){case-2:return t<e;case-1:return r>=e&&t<e;case 0:return t<e&&r>e;case 1:return t<=e&&r>e;case 2:return r>e;case 4:return!0}}function Ed(n,e,t,r){for(var i;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let o=!r&&n instanceof Sr&&n.index<0?null:n.parent;if(!o)return n;n=o}let s=r?0:fn.IgnoreOverlays;if(r)for(let o=n,a=o.parent;a;o=a,a=o.parent)o instanceof Sr&&o.index<0&&((i=a.enter(e,t,s))===null||i===void 0?void 0:i.from)!=o.from&&(n=a);for(;;){let o=n.enter(e,t,s);if(!o)return n;n=o}}class HM{cursor(e=0){return new Bm(this,e)}getChild(e,t=null,r=null){let i=GE(this,e,t,r);return i.length?i[0]:null}getChildren(e,t=null,r=null){return GE(this,e,t,r)}resolve(e,t=0){return Ed(this,e,t,!1)}resolveInner(e,t=0){return Ed(this,e,t,!0)}matchContext(e){return Zw(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),r=this;for(;t;){let i=t.lastChild;if(!i||i.to!=t.to)break;i.type.isError&&i.from==i.to?(r=t,t=i.prevSibling):t=i}return r}get node(){return this}get next(){return this.parent}}class Sr extends HM{constructor(e,t,r,i){super(),this._tree=e,this.from=t,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,r,i,s=0){for(let o=this;;){for(let{children:a,positions:u}=o._tree,l=t>0?a.length:-1;e!=l;e+=t){let c=a[e],f=u[e]+o.from;if(UM(i,r,f,f+c.length)){if(c instanceof ou){if(s&fn.ExcludeBuffers)continue;let d=c.findChild(0,c.buffer.length,t,r-f,i);if(d>-1)return new lo(new qj(o,c,e,f),null,d)}else if(s&fn.IncludeAnonymous||!c.type.isAnonymous||yk(c)){let d;if(!(s&fn.IgnoreMounts)&&(d=Cd.get(c))&&!d.overlay)return new Sr(d.tree,f,e,o);let g=new Sr(c,f,e,o);return s&fn.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(t<0?c.children.length-1:0,t,r,i)}}}if(s&fn.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,r=0){let i;if(!(r&fn.IgnoreOverlays)&&(i=Cd.get(this._tree))&&i.overlay){let s=e-this.from;for(let{from:o,to:a}of i.overlay)if((t>0?o<=s:o<s)&&(t<0?a>=s:a>s))return new Sr(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function GE(n,e,t,r){let i=n.cursor(),s=[];if(!i.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=i.type.is(t),!i.nextSibling())return s}for(;;){if(r!=null&&i.type.is(r))return s;if(i.type.is(e)&&s.push(i.node),!i.nextSibling())return r==null?s:[]}}function Zw(n,e,t=e.length-1){for(let r=n;t>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[t]&&e[t]!=r.name)return!1;t--}}return!0}class qj{constructor(e,t,r,i){this.parent=e,this.buffer=t,this.index=r,this.start=i}}class lo extends HM{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,r){super(),this.context=e,this._parent=t,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,t,r){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,r);return s<0?null:new lo(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,r=0){if(r&fn.ExcludeBuffers)return null;let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new lo(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new lo(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new lo(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:r}=this.context,i=this.index+4,s=r.buffer[this.index+3];if(s>i){let o=r.buffer[this.index+1];e.push(r.slice(i,s,o)),t.push(0)}return new Gt(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function VM(n){if(!n.length)return null;let e=0,t=n[0];for(let s=1;s<n.length;s++){let o=n[s];(o.from>t.from||o.to<t.to)&&(t=o,e=s)}let r=t instanceof Sr&&t.index<0?null:t.parent,i=n.slice();return r?i[e]=r:i.splice(e,1),new Wj(i,t)}class Wj{constructor(e,t){this.heads=e,this.node=t}get next(){return VM(this.heads)}}function jj(n,e,t){let r=n.resolveInner(e,t),i=null;for(let s=r instanceof Sr?r:r.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(i||(i=[r])).push(o.resolve(e,t)),s=o}else{let o=Cd.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let a=new Sr(o.tree,o.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(Ed(a,e,t,!1))}}return i?VM(i):r}class Bm{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Sr)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof Sr?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,r,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,r);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,r=this.mode){return this.buffer?r&fn.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&fn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&fn.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(t.findChild(i,this.index,-1,0,4))}else{let i=t.buffer[this.index+3];if(i<(r<0?t.buffer.length:t.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(i.buffer.buffer[s+3]<this.index)return!1;({index:t,parent:r}=i)}else({index:t,_parent:r}=this._tree);for(;r;{index:t,_parent:r}=r)if(t>-1)for(let s=t+e,o=e<0?-1:r._tree.children.length;s!=o;s+=e){let a=r._tree.children[s];if(this.mode&fn.IncludeAnonymous||a instanceof ou||!a.type.isAnonymous||yk(a))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;t=o,r=s+1;break e}i=this.stack[--s]}for(let i=r;i<this.stack.length;i++)t=new lo(this.buffer,t,this.stack[i]);return this.bufferNode=new lo(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&t&&t(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return Zw(this.node.parent,e);let{buffer:t}=this.buffer,{types:r}=t.set;for(let i=e.length-1,s=this.stack.length-1;i>=0;s--){if(s<0)return Zw(this._tree,e,i);let o=r[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function yk(n){return n.children.some(e=>e instanceof ou||!e.type.isAnonymous||yk(e))}function $j(n){var e;let{buffer:t,nodeSet:r,maxBufferLength:i=Fj,reused:s=[],minRepeatType:o=r.types.length}=n,a=Array.isArray(t)?new mk(t,t.length):t,u=r.types,l=0,c=0;function f(C,A,I,W,B,K){let{id:G,start:F,end:R,size:Y}=a,q=c,te=l;for(;Y<0;)if(a.next(),Y==-1){let we=s[G];I.push(we),W.push(F-C);return}else if(Y==-3){l=G;return}else if(Y==-4){c=G;return}else throw new RangeError(`Unrecognized record size: ${Y}`);let ae=u[G],be,ye,De=F-C;if(R-F<=i&&(ye=b(a.pos-A,B))){let we=new Uint16Array(ye.size-ye.skip),Pe=a.pos-ye.size,Rt=we.length;for(;a.pos>Pe;)Rt=w(ye.start,we,Rt);be=new ou(we,R-ye.start,r),De=ye.start-C}else{let we=a.pos-Y;a.next();let Pe=[],Rt=[],kt=G>=o?G:-1,rt=0,Xt=R;for(;a.pos>we;)kt>=0&&a.id==kt&&a.size>=0?(a.end<=Xt-i&&(m(Pe,Rt,F,rt,a.end,Xt,kt,q,te),rt=Pe.length,Xt=a.end),a.next()):K>2500?d(F,we,Pe,Rt):f(F,we,Pe,Rt,kt,K+1);if(kt>=0&&rt>0&&rt<Pe.length&&m(Pe,Rt,F,rt,F,Xt,kt,q,te),Pe.reverse(),Rt.reverse(),kt>-1&&rt>0){let Bn=g(ae,te);be=vk(ae,Pe,Rt,0,Pe.length,0,R-F,Bn,Bn)}else be=y(ae,Pe,Rt,R-F,q-R,te)}I.push(be),W.push(De)}function d(C,A,I,W){let B=[],K=0,G=-1;for(;a.pos>A;){let{id:F,start:R,end:Y,size:q}=a;if(q>4)a.next();else{if(G>-1&&R<G)break;G<0&&(G=Y-i),B.push(F,R,Y),K++,a.next()}}if(K){let F=new Uint16Array(K*4),R=B[B.length-2];for(let Y=B.length-3,q=0;Y>=0;Y-=3)F[q++]=B[Y],F[q++]=B[Y+1]-R,F[q++]=B[Y+2]-R,F[q++]=q;I.push(new ou(F,B[2]-R,r)),W.push(R-C)}}function g(C,A){return(I,W,B)=>{let K=0,G=I.length-1,F,R;if(G>=0&&(F=I[G])instanceof Gt){if(!G&&F.type==C&&F.length==B)return F;(R=F.prop(ot.lookAhead))&&(K=W[G]+F.length+R)}return y(C,I,W,B,K,A)}}function m(C,A,I,W,B,K,G,F,R){let Y=[],q=[];for(;C.length>W;)Y.push(C.pop()),q.push(A.pop()+I-B);C.push(y(r.types[G],Y,q,K-B,F-K,R)),A.push(B-I)}function y(C,A,I,W,B,K,G){if(K){let F=[ot.contextHash,K];G=G?[F].concat(G):[F]}if(B>25){let F=[ot.lookAhead,B];G=G?[F].concat(G):[F]}return new Gt(C,A,I,W,G)}function b(C,A){let I=a.fork(),W=0,B=0,K=0,G=I.end-i,F={size:0,start:0,skip:0};e:for(let R=I.pos-C;I.pos>R;){let Y=I.size;if(I.id==A&&Y>=0){F.size=W,F.start=B,F.skip=K,K+=4,W+=4,I.next();continue}let q=I.pos-Y;if(Y<0||q<R||I.start<G)break;let te=I.id>=o?4:0,ae=I.start;for(I.next();I.pos>q;){if(I.size<0)if(I.size==-3)te+=4;else break e;else I.id>=o&&(te+=4);I.next()}B=ae,W+=Y,K+=te}return(A<0||W==C)&&(F.size=W,F.start=B,F.skip=K),F.size>4?F:void 0}function w(C,A,I){let{id:W,start:B,end:K,size:G}=a;if(a.next(),G>=0&&W<o){let F=I;if(G>4){let R=a.pos-(G-4);for(;a.pos>R;)I=w(C,A,I)}A[--I]=F,A[--I]=K-C,A[--I]=B-C,A[--I]=W}else G==-3?l=W:G==-4&&(c=W);return I}let x=[],_=[];for(;a.pos>0;)f(n.start||0,n.bufferStart||0,x,_,-1,0);let S=(e=n.length)!==null&&e!==void 0?e:x.length?_[0]+x[0].length:0;return new Gt(u[n.topID],x.reverse(),_.reverse(),S)}const KE=new WeakMap;function wm(n,e){if(!n.isAnonymous||e instanceof ou||e.type!=n)return 1;let t=KE.get(e);if(t==null){t=1;for(let r of e.children){if(r.type!=n||!(r instanceof Gt)){t=1;break}t+=wm(n,r)}KE.set(e,t)}return t}function vk(n,e,t,r,i,s,o,a,u){let l=0;for(let m=r;m<i;m++)l+=wm(n,e[m]);let c=Math.ceil(l*1.5/8),f=[],d=[];function g(m,y,b,w,x){for(let _=b;_<w;){let S=_,C=y[_],A=wm(n,m[_]);for(_++;_<w;_++){let I=wm(n,m[_]);if(A+I>=c)break;A+=I}if(_==S+1){if(A>c){let I=m[S];g(I.children,I.positions,0,I.children.length,y[S]+x);continue}f.push(m[S])}else{let I=y[_-1]+m[_-1].length-C;f.push(vk(n,m,y,S,_,C,I,null,u))}d.push(C+x-s)}}return g(e,t,r,i,0),(a||u)(f,d,o)}class $se{constructor(){this.map=new WeakMap}setBuffer(e,t,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(t,r)}getBuffer(e,t){let r=this.map.get(e);return r&&r.get(t)}set(e,t){e instanceof lo?this.setBuffer(e.context.buffer,e.index,t):e instanceof Sr&&this.map.set(e.tree,t)}get(e){return e instanceof lo?this.getBuffer(e.context.buffer,e.index):e instanceof Sr?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class aa{constructor(e,t,r,i,s=!1,o=!1){this.from=e,this.to=t,this.tree=r,this.offset=i,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],r=!1){let i=[new aa(0,e.length,e,0,!1,r)];for(let s of t)s.to>e.length&&i.push(s);return i}static applyChanges(e,t,r=128){if(!t.length)return e;let i=[],s=1,o=e.length?e[0]:null;for(let a=0,u=0,l=0;;a++){let c=a<t.length?t[a]:null,f=c?c.fromA:1e9;if(f-u>=r)for(;o&&o.from<f;){let d=o;if(u>=d.from||f<=d.to||l){let g=Math.max(d.from,u)-l,m=Math.min(d.to,f)-l;d=g>=m?null:new aa(g,m,d.tree,d.offset+l,a>0,!!c)}if(d&&i.push(d),o.to>f)break;o=s<e.length?e[s++]:null}if(!c)break;u=c.toA,l=c.toA-c.toB}return i}}class GM{startParse(e,t,r){return typeof e=="string"&&(e=new zj(e)),r=r?r.length?r.map(i=>new Zi(i.from,i.to)):[new Zi(0,0)]:[new Zi(0,e.length)],this.createParse(e,t||[],r)}parse(e,t,r){let i=this.startParse(e,t,r);for(;;){let s=i.advance();if(s)return s}}}class zj{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function zse(n){return(e,t,r,i)=>new Hj(e,n,t,r,i)}class ZE{constructor(e,t,r,i,s){this.parser=e,this.parse=t,this.overlay=r,this.target=i,this.from=s}}function XE(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class Uj{constructor(e,t,r,i,s,o,a){this.parser=e,this.predicate=t,this.mounts=r,this.index=i,this.start=s,this.target=o,this.prev=a,this.depth=0,this.ranges=[]}}const Xw=new ot({perNode:!0});class Hj{constructor(e,t,r,i,s){this.nest=t,this.input=r,this.fragments=i,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new Gt(r.type,r.children,r.positions,r.length,r.propValues.concat([[Xw,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[ot.mounted.id]=new Cd(t,e.overlay,e.parser),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new Kj(this.fragments),t=null,r=null,i=new Bm(new Sr(this.baseTree,this.ranges[0].from,0,null),fn.IncludeAnonymous|fn.IgnoreMounts);e:for(let s,o;;){let a=!0,u;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)a=!1;else if(e.hasNode(i)){if(t){let l=t.mounts.find(c=>c.frag.from<=i.from&&c.frag.to>=i.to&&c.mount.overlay);if(l)for(let c of l.mount.overlay){let f=c.from+l.pos,d=c.to+l.pos;f>=i.from&&d<=i.to&&!t.ranges.some(g=>g.from<d&&g.to>f)&&t.ranges.push({from:f,to:d})}}a=!1}else if(r&&(o=Vj(r.ranges,i.from,i.to)))a=o!=2;else if(!i.type.isAnonymous&&(s=this.nest(i,this.input))&&(i.from<i.to||!s.overlay)){i.tree||Gj(i);let l=e.findMounts(i.from,s.parser);if(typeof s.overlay=="function")t=new Uj(s.parser,s.overlay,l,this.inner.length,i.from,i.tree,t);else{let c=QE(this.ranges,s.overlay||(i.from<i.to?[new Zi(i.from,i.to)]:[]));c.length&&XE(c),(c.length||!s.overlay)&&this.inner.push(new ZE(s.parser,c.length?s.parser.startParse(this.input,e3(l,c),c):s.parser.startParse(""),s.overlay?s.overlay.map(f=>new Zi(f.from-i.from,f.to-i.from)):null,i.tree,c.length?c[0].from:i.from)),s.overlay?c.length&&(r={ranges:c,depth:0,prev:r}):a=!1}}else if(t&&(u=t.predicate(i))&&(u===!0&&(u=new Zi(i.from,i.to)),u.from<u.to)){let l=t.ranges.length-1;l>=0&&t.ranges[l].to==u.from?t.ranges[l]={from:t.ranges[l].from,to:u.to}:t.ranges.push(u)}if(a&&i.firstChild())t&&t.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(t&&!--t.depth){let l=QE(this.ranges,t.ranges);l.length&&(XE(l),this.inner.splice(t.index,0,new ZE(t.parser,t.parser.startParse(this.input,e3(t.mounts,l),l),t.ranges.map(c=>new Zi(c.from-t.start,c.to-t.start)),t.target,l[0].from))),t=t.prev}r&&!--r.depth&&(r=r.prev)}}}}function Vj(n,e,t){for(let r of n){if(r.from>=t)break;if(r.to>e)return r.from<=e&&r.to>=t?2:1}return 0}function YE(n,e,t,r,i,s){if(e<t){let o=n.buffer[e+1];r.push(n.slice(e,t,o)),i.push(o-s)}}function Gj(n){let{node:e}=n,t=[],r=e.context.buffer;do t.push(n.index),n.parent();while(!n.tree);let i=n.tree,s=i.children.indexOf(r),o=i.children[s],a=o.buffer,u=[s];function l(c,f,d,g,m,y){let b=t[y],w=[],x=[];YE(o,c,b,w,x,g);let _=a[b+1],S=a[b+2];u.push(w.length);let C=y?l(b+4,a[b+3],o.set.types[a[b]],_,S-_,y-1):e.toTree();return w.push(C),x.push(_-g),YE(o,a[b+3],f,w,x,g),new Gt(d,w,x,m)}i.children[s]=l(0,a.length,Vr.none,0,o.length,t.length-1);for(let c of u){let f=n.tree.children[c],d=n.tree.positions[c];n.yield(new Sr(f,d+n.from,c,n._tree))}}class JE{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(fn.IncludeAnonymous|fn.IgnoreMounts)}moveTo(e){let{cursor:t}=this,r=e-this.offset;for(;!this.done&&t.from<r;)t.to>=e&&t.enter(r,1,fn.IgnoreOverlays|fn.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof Gt)t=t.children[0];else break}return!1}}class Kj{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(t=r.tree.prop(Xw))!==null&&t!==void 0?t:r.to,this.inner=new JE(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Xw))!==null&&e!==void 0?e:t.to,this.inner=new JE(t.tree,-t.offset)}}findMounts(e,t){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(r=s.tree)===null||r===void 0?void 0:r.prop(ot.mounted);if(o&&o.parser==t)for(let a=this.fragI;a<this.fragments.length;a++){let u=this.fragments[a];if(u.from>=s.to)break;u.tree==this.curFrag.tree&&i.push({frag:u,pos:s.from-u.offset,mount:o})}}}return i}}function QE(n,e){let t=null,r=e;for(let i=1,s=0;i<n.length;i++){let o=n[i-1].to,a=n[i].from;for(;s<r.length;s++){let u=r[s];if(u.from>=a)break;u.to<=o||(t||(r=t=e.slice()),u.from<o?(t[s]=new Zi(u.from,o),u.to>a&&t.splice(s+1,0,new Zi(a,u.to))):u.to>a?t[s--]=new Zi(a,u.to):t.splice(s--,1))}}return r}function Zj(n,e,t,r){let i=0,s=0,o=!1,a=!1,u=-1e9,l=[];for(;;){let c=i==n.length?1e9:o?n[i].to:n[i].from,f=s==e.length?1e9:a?e[s].to:e[s].from;if(o!=a){let d=Math.max(u,t),g=Math.min(c,f,r);d<g&&l.push(new Zi(d,g))}if(u=Math.min(c,f),u==1e9)break;c==u&&(o?(o=!1,i++):o=!0),f==u&&(a?(a=!1,s++):a=!0)}return l}function e3(n,e){let t=[];for(let{pos:r,mount:i,frag:s}of n){let o=r+(i.overlay?i.overlay[0].from:0),a=o+i.tree.length,u=Math.max(s.from,o),l=Math.min(s.to,a);if(i.overlay){let c=i.overlay.map(d=>new Zi(d.from+r,d.to+r)),f=Zj(e,c,u,l);for(let d=0,g=u;;d++){let m=d==f.length,y=m?l:f[d].from;if(y>g&&t.push(new aa(g,y,i.tree,-o,s.from>=g||s.openStart,s.to<=y||s.openEnd)),m)break;g=f[d].to}}else t.push(new aa(u,l,i.tree,-o,s.from>=o||s.openStart,s.to<=a||s.openEnd))}return t}let Xj=0;class Gi{constructor(e,t,r,i){this.name=e,this.set=t,this.base=r,this.modified=i,this.id=Xj++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let r=typeof e=="string"?e:"?";if(e instanceof Gi&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let i=new Gi(r,[],null,[]);if(i.set.push(i),t)for(let s of t.set)i.set.push(s);return i}static defineModifier(e){let t=new qm(e);return r=>r.modified.indexOf(t)>-1?r:qm.get(r.base||r,r.modified.concat(t).sort((i,s)=>i.id-s.id))}}let Yj=0;class qm{constructor(e){this.name=e,this.instances=[],this.id=Yj++}static get(e,t){if(!t.length)return e;let r=t[0].instances.find(a=>a.base==e&&Jj(t,a.modified));if(r)return r;let i=[],s=new Gi(e.name,i,e,t);for(let a of t)a.instances.push(s);let o=Qj(t);for(let a of e.set)if(!a.modified.length)for(let u of o)i.push(qm.get(a,u));return s}}function Jj(n,e){return n.length==e.length&&n.every((t,r)=>t==e[r])}function Qj(n){let e=[[]];for(let t=0;t<n.length;t++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(n[t]));return e.sort((t,r)=>r.length-t.length)}function e$(n){let e=Object.create(null);for(let t in n){let r=n[t];Array.isArray(r)||(r=[r]);for(let i of t.split(" "))if(i){let s=[],o=2,a=i;for(let f=0;;){if(a=="..."&&f>0&&f+3==i.length){o=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!d)throw new RangeError("Invalid path: "+i);if(s.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),f+=d[0].length,f==i.length)break;let g=i[f++];if(f==i.length&&g=="!"){o=0;break}if(g!="/")throw new RangeError("Invalid path: "+i);a=i.slice(f)}let u=s.length-1,l=s[u];if(!l)throw new RangeError("Invalid path: "+i);let c=new Wm(r,o,u>0?s.slice(0,u):null);e[l]=c.sort(e[l])}}return KM.add(e)}const KM=new ot;class Wm{constructor(e,t,r,i){this.tags=e,this.mode=t,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Wm.empty=new Wm([],2,null);function ZM(n,e){let t=Object.create(null);for(let s of n)if(!Array.isArray(s.tag))t[s.tag.id]=s.class;else for(let o of s.tag)t[o.id]=s.class;let{scope:r,all:i=null}=e||{};return{style:s=>{let o=i;for(let a of s)for(let u of a.set){let l=t[u.id];if(l){o=o?o+" "+l:l;break}}return o},scope:r}}function t$(n,e){let t=null;for(let r of n){let i=r.style(e);i&&(t=t?t+" "+i:i)}return t}function XM(n,e,t,r=0,i=n.length){let s=new r$(r,Array.isArray(e)?e:[e],t);s.highlightRange(n.cursor(),r,i,"",s.highlighters),s.flush(i)}function n$(n,e,t,r,i,s=0,o=n.length){let a=s;function u(l,c){if(!(l<=a)){for(let f=n.slice(a,l),d=0;;){let g=f.indexOf(`
|
|
39
|
-
`,d),m=g<0?f.length:g;if(m>d&&r(f.slice(d,m),c),g<0)break;i(),d=g+1}a=l}}XM(e,t,(l,c,f)=>{u(l,""),u(c,f)},s,o),u(o,"")}class r${constructor(e,t,r){this.at=e,this.highlighters=t,this.span=r,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,r,i,s){let{type:o,from:a,to:u}=e;if(a>=r||u<=t)return;o.isTop&&(s=this.highlighters.filter(g=>!g.scope||g.scope(o)));let l=i,c=i$(e)||Wm.empty,f=t$(s,c.tags);if(f&&(l&&(l+=" "),l+=f,c.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(t,a),l),c.opaque)return;let d=e.tree&&e.tree.prop(ot.mounted);if(d&&d.overlay){let g=e.node.enter(d.overlay[0].from+a,1),m=this.highlighters.filter(b=>!b.scope||b.scope(d.tree.type)),y=e.firstChild();for(let b=0,w=a;;b++){let x=b<d.overlay.length?d.overlay[b]:null,_=x?x.from+a:u,S=Math.max(t,w),C=Math.min(r,_);if(S<C&&y)for(;e.from<C&&(this.highlightRange(e,S,C,i,s),this.startSpan(Math.min(C,e.to),l),!(e.to>=_||!e.nextSibling())););if(!x||_>r)break;w=x.to+a,w>t&&(this.highlightRange(g.cursor(),Math.max(t,x.from+a),Math.min(r,w),"",m),this.startSpan(Math.min(r,w),l))}y&&e.parent()}else if(e.firstChild()){d&&(i="");do if(!(e.to<=t)){if(e.from>=r)break;this.highlightRange(e,t,r,i,s),this.startSpan(Math.min(r,e.to),l)}while(e.nextSibling());e.parent()}}}function i$(n){let e=n.type.prop(KM);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const xe=Gi.define,Hg=xe(),Wa=xe(),t3=xe(Wa),n3=xe(Wa),ja=xe(),Vg=xe(ja),Jv=xe(ja),Ys=xe(),Iu=xe(Ys),Gs=xe(),Ks=xe(),Yw=xe(),nh=xe(Yw),Gg=xe(),oe={comment:Hg,lineComment:xe(Hg),blockComment:xe(Hg),docComment:xe(Hg),name:Wa,variableName:xe(Wa),typeName:t3,tagName:xe(t3),propertyName:n3,attributeName:xe(n3),className:xe(Wa),labelName:xe(Wa),namespace:xe(Wa),macroName:xe(Wa),literal:ja,string:Vg,docString:xe(Vg),character:xe(Vg),attributeValue:xe(Vg),number:Jv,integer:xe(Jv),float:xe(Jv),bool:xe(ja),regexp:xe(ja),escape:xe(ja),color:xe(ja),url:xe(ja),keyword:Gs,self:xe(Gs),null:xe(Gs),atom:xe(Gs),unit:xe(Gs),modifier:xe(Gs),operatorKeyword:xe(Gs),controlKeyword:xe(Gs),definitionKeyword:xe(Gs),moduleKeyword:xe(Gs),operator:Ks,derefOperator:xe(Ks),arithmeticOperator:xe(Ks),logicOperator:xe(Ks),bitwiseOperator:xe(Ks),compareOperator:xe(Ks),updateOperator:xe(Ks),definitionOperator:xe(Ks),typeOperator:xe(Ks),controlOperator:xe(Ks),punctuation:Yw,separator:xe(Yw),bracket:nh,angleBracket:xe(nh),squareBracket:xe(nh),paren:xe(nh),brace:xe(nh),content:Ys,heading:Iu,heading1:xe(Iu),heading2:xe(Iu),heading3:xe(Iu),heading4:xe(Iu),heading5:xe(Iu),heading6:xe(Iu),contentSeparator:xe(Ys),list:xe(Ys),quote:xe(Ys),emphasis:xe(Ys),strong:xe(Ys),link:xe(Ys),monospace:xe(Ys),strikethrough:xe(Ys),inserted:xe(),deleted:xe(),changed:xe(),invalid:xe(),meta:Gg,documentMeta:xe(Gg),annotation:xe(Gg),processingInstruction:xe(Gg),definition:Gi.defineModifier("definition"),constant:Gi.defineModifier("constant"),function:Gi.defineModifier("function"),standard:Gi.defineModifier("standard"),local:Gi.defineModifier("local"),special:Gi.defineModifier("special")};for(let n in oe){let e=oe[n];e instanceof Gi&&(e.name=n)}ZM([{tag:oe.link,class:"tok-link"},{tag:oe.heading,class:"tok-heading"},{tag:oe.emphasis,class:"tok-emphasis"},{tag:oe.strong,class:"tok-strong"},{tag:oe.keyword,class:"tok-keyword"},{tag:oe.atom,class:"tok-atom"},{tag:oe.bool,class:"tok-bool"},{tag:oe.url,class:"tok-url"},{tag:oe.labelName,class:"tok-labelName"},{tag:oe.inserted,class:"tok-inserted"},{tag:oe.deleted,class:"tok-deleted"},{tag:oe.literal,class:"tok-literal"},{tag:oe.string,class:"tok-string"},{tag:oe.number,class:"tok-number"},{tag:[oe.regexp,oe.escape,oe.special(oe.string)],class:"tok-string2"},{tag:oe.variableName,class:"tok-variableName"},{tag:oe.local(oe.variableName),class:"tok-variableName tok-local"},{tag:oe.definition(oe.variableName),class:"tok-variableName tok-definition"},{tag:oe.special(oe.variableName),class:"tok-variableName2"},{tag:oe.definition(oe.propertyName),class:"tok-propertyName tok-definition"},{tag:oe.typeName,class:"tok-typeName"},{tag:oe.namespace,class:"tok-namespace"},{tag:oe.className,class:"tok-className"},{tag:oe.macroName,class:"tok-macroName"},{tag:oe.propertyName,class:"tok-propertyName"},{tag:oe.operator,class:"tok-operator"},{tag:oe.comment,class:"tok-comment"},{tag:oe.meta,class:"tok-meta"},{tag:oe.invalid,class:"tok-invalid"},{tag:oe.punctuation,class:"tok-punctuation"}]);var Qv;const tl=new ot;function YM(n){return Re.define({combine:n?e=>e.concat(n):void 0})}const s$=new ot;class Xi{constructor(e,t,r=[],i=""){this.data=e,this.name=i,gt.prototype.hasOwnProperty("tree")||Object.defineProperty(gt.prototype,"tree",{get(){return lr(this)}}),this.parser=t,this.extension=[au.of(this),gt.languageData.of((s,o,a)=>{let u=r3(s,o,a),l=u.type.prop(tl);if(!l)return[];let c=s.facet(l),f=u.type.prop(s$);if(f){let d=u.resolve(o-u.from,a);for(let g of f)if(g.test(d,s)){let m=s.facet(g.facet);return g.type=="replace"?m:m.concat(c)}}return c})].concat(r)}isActiveAt(e,t,r=-1){return r3(e,t,r).type.prop(tl)==this.data}findRegions(e){let t=e.facet(au);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let r=[],i=(s,o)=>{if(s.prop(tl)==this.data){r.push({from:o,to:o+s.length});return}let a=s.prop(ot.mounted);if(a){if(a.tree.prop(tl)==this.data){if(a.overlay)for(let u of a.overlay)r.push({from:u.from+o,to:u.to+o});else r.push({from:o,to:o+s.length});return}else if(a.overlay){let u=r.length;if(i(a.tree,a.overlay[0].from+o),r.length>u)return}}for(let u=0;u<s.children.length;u++){let l=s.children[u];l instanceof Gt&&i(l,s.positions[u]+o)}};return i(lr(e),0),r}get allowsNesting(){return!0}}Xi.setState=Ve.define();function r3(n,e,t){let r=n.facet(au),i=lr(n).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(e,t,fn.ExcludeBuffers))s.type.isTop&&(i=s);return i}class Jw extends Xi{constructor(e,t,r){super(e,t,[],r),this.parser=t}static define(e){let t=YM(e.languageData);return new Jw(t,e.parser.configure({props:[tl.add(r=>r.isTop?t:void 0)]}),e.name)}configure(e,t){return new Jw(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function lr(n){let e=n.field(Xi.state,!1);return e?e.tree:Gt.empty}class o${constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let r=this.cursorPos-this.string.length;return e<r||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-r,t-r)}}let rh=null;class Lc{constructor(e,t,r=[],i,s,o,a,u){this.parser=e,this.state=t,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=o,this.skipped=a,this.scheduleOn=u,this.parse=null,this.tempSkipped=[]}static create(e,t,r){return new Lc(e,t,[],Gt.empty,0,r,[],null)}startParse(){return this.parser.startParse(new o$(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Gt.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(aa.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(aa.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=rh;rh=this;try{return e()}finally{rh=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=i3(e,t.from,t.to);return e}changes(e,t){let{fragments:r,tree:i,treeLen:s,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let u=[];if(e.iterChangedRanges((l,c,f,d)=>u.push({fromA:l,toA:c,fromB:f,toB:d})),r=aa.applyChanges(r,u),i=Gt.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let l of this.skipped){let c=e.mapPos(l.from,1),f=e.mapPos(l.to,-1);c<f&&a.push({from:c,to:f})}}}return new Lc(this.parser,t,r,i,s,o,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:s}=this.skipped[r];i<e.to&&s>e.from&&(this.fragments=i3(this.fragments,i,s),this.skipped.splice(r--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends GM{createParse(t,r,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let u=rh;if(u){for(let l of i)u.tempSkipped.push(l);e&&(u.scheduleOn=u.scheduleOn?Promise.all([u.scheduleOn,e]):e)}return this.parsedPos=o,new Gt(Vr.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return rh}}function i3(n,e,t){return aa.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class Fc{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,r)||t.takeTree(),new Fc(t)}static init(e){let t=Math.min(3e3,e.doc.length),r=Lc.create(e.facet(au).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new Fc(r)}}Xi.state=Tn.define({create:Fc.init,update(n,e){for(let t of e.effects)if(t.is(Xi.setState))return t.value;return e.startState.facet(au)!=e.state.facet(au)?Fc.init(e.state):n.apply(e)}});let JM=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(JM=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const eb=typeof navigator<"u"&&(!((Qv=navigator.scheduling)===null||Qv===void 0)&&Qv.isInputPending)?()=>navigator.scheduling.isInputPending():null,a$=mn.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Xi.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Xi.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=JM(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,s=r.field(Xi.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!eb?Math.max(25,e.timeRemaining()-5):1e9),a=s.context.treeLen<i&&r.doc.length>i+1e3,u=s.context.work(()=>eb&&eb()||Date.now()>o,i+(a?0:1e5));this.chunkBudget-=Date.now()-t,(u||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Xi.setState.of(new Fc(s.context))})),this.chunkBudget>0&&!(u&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>ci(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),au=Re.define({combine(n){return n.length?n[0]:null},enables:n=>[Xi.state,a$,Ae.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class Hse{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class QM{constructor(e,t,r,i,s,o=void 0){this.name=e,this.alias=t,this.extensions=r,this.filename=i,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:r}=e;if(!t){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(r)}return new QM(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,t,r)}static matchFilename(e,t){for(let i of e)if(i.filename&&i.filename.test(t))return i;let r=/\.([^.]+)$/.exec(t);if(r){for(let i of e)if(i.extensions.indexOf(r[1])>-1)return i}return null}static matchLanguageName(e,t,r=!0){t=t.toLowerCase();for(let i of e)if(i.alias.some(s=>s==t))return i;if(r)for(let i of e)for(let s of i.alias){let o=t.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+s.length])))return i}return null}}const u$=Re.define(),Xc=Re.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function dl(n){let e=n.facet(Xc);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function Ad(n,e){let t="",r=n.tabSize,i=n.facet(Xc)[0];if(i==" "){for(;e>=r;)t+=" ",e-=r;i=" "}for(let s=0;s<e;s++)t+=i;return t}function bk(n,e){n instanceof gt&&(n=new j1(n));for(let r of n.state.facet(u$)){let i=r(n,e);if(i!==void 0)return i}let t=lr(n.state);return t.length>=e?l$(n,t,e):null}class j1{constructor(e,t={}){this.state=e,this.options=t,this.unit=dl(e)}lineAt(e,t=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==e?{text:"",from:e}:(t<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,t);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,t=1){let{text:r,from:i}=this.lineAt(e,t),s=this.countColumn(r,e-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(s+=o-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,t=e.length){return Kc(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:r,from:i}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(i);if(o>-1)return o}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const e6=new ot;function l$(n,e,t){let r=e.resolveStack(t),i=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(i!=r.node){let s=[];for(let o=i;o&&!(o.from==r.node.from&&o.type==r.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)r={node:s[o],next:r}}return t6(r,n,t)}function t6(n,e,t){for(let r=n;r;r=r.next){let i=f$(r.node);if(i)return i(wk.create(e,t,r))}return 0}function c$(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function f$(n){let e=n.type.prop(e6);if(e)return e;let t=n.firstChild,r;if(t&&(r=t.type.prop(ot.closedBy))){let i=n.lastChild,s=i&&r.indexOf(i.name)>-1;return o=>n6(o,!0,1,void 0,s&&!c$(o)?i.from:void 0)}return n.parent==null?h$:null}function h$(){return 0}class wk extends j1{constructor(e,t,r){super(e.state,e.options),this.base=e,this.pos=t,this.context=r}get node(){return this.context.node}static create(e,t,r){return new wk(e,t,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(t.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(d$(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return t6(this.context.next,this.base,this.pos)}}function d$(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function p$(n){let e=n.node,t=e.childAfter(e.from),r=e.lastChild;if(!t)return null;let i=n.options.simulateBreak,s=n.state.doc.lineAt(t.from),o=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let a=t.to;;){let u=e.childAfter(a);if(!u||u==r)return null;if(!u.type.isSkipped){if(u.from>=o)return null;let l=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+l}}a=u.to}}function Vse({closing:n,align:e=!0,units:t=1}){return r=>n6(r,e,t,n)}function n6(n,e,t,r,i){let s=n.textAfter,o=s.match(/^\s*/)[0].length,a=r&&s.slice(o,o+r.length)==r||i==n.pos+o,u=e?p$(n):null;return u?a?n.column(u.from):n.column(u.to):n.baseIndent+(a?0:n.unit*t)}const Gse=n=>n.baseIndent;function Kse({except:n,units:e=1}={}){return t=>{let r=n&&n.test(t.textAfter);return t.baseIndent+(r?0:e*t.unit)}}const g$=200;function m$(){return gt.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:r}=n.newSelection.main,i=t.lineAt(r);if(r>i.from+g$)return n;let s=t.sliceString(i.from,r);if(!e.some(l=>l.test(s)))return n;let{state:o}=n,a=-1,u=[];for(let{head:l}of o.selection.ranges){let c=o.doc.lineAt(l);if(c.from==a)continue;a=c.from;let f=bk(o,c.from);if(f==null)continue;let d=/^\s*/.exec(c.text)[0],g=Ad(o,f);d!=g&&u.push({from:c.from,to:c.from+d.length,insert:g})}return u.length?[n,{changes:u,sequential:!0}]:n})}const y$=Re.define(),v$=new ot;function Zse(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}function b$(n,e,t){let r=lr(n);if(r.length<t)return null;let i=r.resolveStack(t,1),s=null;for(let o=i;o;o=o.next){let a=o.node;if(a.to<=t||a.from>t)continue;if(s&&a.from<e)break;let u=a.type.prop(v$);if(u&&(a.to<r.length-50||r.length==n.doc.length||!w$(a))){let l=u(a,n);l&&l.from<=t&&l.from>=e&&l.to>t&&(s=l)}}return s}function w$(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function jm(n,e,t){for(let r of n.facet(y$)){let i=r(n,e,t);if(i)return i}return b$(n,e,t)}function r6(n,e){let t=e.mapPos(n.from,1),r=e.mapPos(n.to,-1);return t>=r?void 0:{from:t,to:r}}const $1=Ve.define({map:r6}),sp=Ve.define({map:r6});function i6(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(r=>r.from<=t&&r.to>=t)||e.push(n.lineBlockAt(t));return e}const pl=Tn.define({create(){return Be.none},update(n,e){n=n.map(e.changes);for(let t of e.effects)if(t.is($1)&&!_$(n,t.value.from,t.value.to)){let{preparePlaceholder:r}=e.state.facet(a6),i=r?Be.replace({widget:new R$(r(e.state,t.value))}):s3;n=n.update({add:[i.range(t.value.from,t.value.to)]})}else t.is(sp)&&(n=n.update({filter:(r,i)=>t.value.from!=r||t.value.to!=i,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:r}=e.selection.main;n.between(r,r,(i,s)=>{i<r&&s>r&&(t=!0)}),t&&(n=n.update({filterFrom:r,filterTo:r,filter:(i,s)=>s<=r||i>=r}))}return n},provide:n=>Ae.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(r,i)=>{t.push(r,i)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<n.length;){let r=n[t++],i=n[t++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(s3.range(r,i))}return Be.set(e,!0)}});function $m(n,e,t){var r;let i=null;return(r=n.field(pl,!1))===null||r===void 0||r.between(e,t,(s,o)=>{(!i||i.from>s)&&(i={from:s,to:o})}),i}function _$(n,e,t){let r=!1;return n.between(e,e,(i,s)=>{i==e&&s==t&&(r=!0)}),r}function s6(n,e){return n.field(pl,!1)?e:e.concat(Ve.appendConfig.of(u6()))}const k$=n=>{for(let e of i6(n)){let t=jm(n.state,e.from,e.to);if(t)return n.dispatch({effects:s6(n.state,[$1.of(t),o6(n,t)])}),!0}return!1},x$=n=>{if(!n.state.field(pl,!1))return!1;let e=[];for(let t of i6(n)){let r=$m(n.state,t.from,t.to);r&&e.push(sp.of(r),o6(n,r,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function o6(n,e,t=!0){let r=n.state.doc.lineAt(e.from).number,i=n.state.doc.lineAt(e.to).number;return Ae.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${r} ${n.state.phrase("to")} ${i}.`)}const S$=n=>{let{state:e}=n,t=[];for(let r=0;r<e.doc.length;){let i=n.lineBlockAt(r),s=jm(e,i.from,i.to);s&&t.push($1.of(s)),r=(s?n.lineBlockAt(s.to):i).to+1}return t.length&&n.dispatch({effects:s6(n.state,t)}),!!t.length},C$=n=>{let e=n.state.field(pl,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(r,i)=>{t.push(sp.of({from:r,to:i}))}),n.dispatch({effects:t}),!0},E$=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:k$},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:x$},{key:"Ctrl-Alt-[",run:S$},{key:"Ctrl-Alt-]",run:C$}],A$={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},a6=Re.define({combine(n){return So(n,A$)}});function u6(n){return[pl,I$]}function l6(n,e){let{state:t}=n,r=t.facet(a6),i=o=>{let a=n.lineBlockAt(n.posAtDOM(o.target)),u=$m(n.state,a.from,a.to);u&&n.dispatch({effects:sp.of(u)}),o.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(n,i,e);let s=document.createElement("span");return s.textContent=r.placeholderText,s.setAttribute("aria-label",t.phrase("folded code")),s.title=t.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=i,s}const s3=Be.replace({widget:new class extends ya{toDOM(n){return l6(n,null)}}});class R$ extends ya{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return l6(e,this.value)}}const D$={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class tb extends fa{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function T$(n={}){let e=Object.assign(Object.assign({},D$),n),t=new tb(e,!0),r=new tb(e,!1),i=mn.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(au)!=o.state.facet(au)||o.startState.field(pl,!1)!=o.state.field(pl,!1)||lr(o.startState)!=lr(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let a=new la;for(let u of o.viewportLineBlocks){let l=$m(o.state,u.from,u.to)?r:jm(o.state,u.from,u.to)?t:null;l&&a.add(u.from,u.from,l)}return a.finish()}}),{domEventHandlers:s}=e;return[i,wj({class:"cm-foldGutter",markers(o){var a;return((a=o.plugin(i))===null||a===void 0?void 0:a.markers)||yt.empty},initialSpacer(){return new tb(e,!1)},domEventHandlers:Object.assign(Object.assign({},s),{click:(o,a,u)=>{if(s.click&&s.click(o,a,u))return!0;let l=$m(o.state,a.from,a.to);if(l)return o.dispatch({effects:sp.of(l)}),!0;let c=jm(o.state,a.from,a.to);return c?(o.dispatch({effects:$1.of(c)}),!0):!1}})}),u6()]}const I$=Ae.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Yc{constructor(e,t){this.specs=e;let r;function i(a){let u=vo.newName();return(r||(r=Object.create(null)))["."+u]=a,u}const s=typeof t.all=="string"?t.all:t.all?i(t.all):void 0,o=t.scope;this.scope=o instanceof Xi?a=>a.prop(tl)==o.data:o?a=>a==o:void 0,this.style=ZM(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:s}).style,this.module=r?new vo(r):null,this.themeType=t.themeType}static define(e,t){return new Yc(e,t||{})}}const Qw=Re.define(),c6=Re.define({combine(n){return n.length?[n[0]]:null}});function nb(n){let e=n.facet(Qw);return e.length?e:n.facet(c6)}function f6(n,e){let t=[O$],r;return n instanceof Yc&&(n.module&&t.push(Ae.styleModule.of(n.module)),r=n.themeType),e?.fallback?t.push(c6.of(n)):r?t.push(Qw.computeN([Ae.darkTheme],i=>i.facet(Ae.darkTheme)==(r=="dark")?[n]:[])):t.push(Qw.of(n)),t}class M${constructor(e){this.markCache=Object.create(null),this.tree=lr(e.state),this.decorations=this.buildDeco(e,nb(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=lr(e.state),r=nb(e.state),i=r!=nb(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<s.to&&!i&&t.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return Be.none;let r=new la;for(let{from:i,to:s}of e.visibleRanges)XM(this.tree,t,(o,a,u)=>{r.add(o,a,this.markCache[u]||(this.markCache[u]=Be.mark({class:u})))},i,s);return r.finish()}}const O$=hu.high(mn.fromClass(M$,{decorations:n=>n.decorations})),P$=Yc.define([{tag:oe.meta,color:"#404740"},{tag:oe.link,textDecoration:"underline"},{tag:oe.heading,textDecoration:"underline",fontWeight:"bold"},{tag:oe.emphasis,fontStyle:"italic"},{tag:oe.strong,fontWeight:"bold"},{tag:oe.strikethrough,textDecoration:"line-through"},{tag:oe.keyword,color:"#708"},{tag:[oe.atom,oe.bool,oe.url,oe.contentSeparator,oe.labelName],color:"#219"},{tag:[oe.literal,oe.inserted],color:"#164"},{tag:[oe.string,oe.deleted],color:"#a11"},{tag:[oe.regexp,oe.escape,oe.special(oe.string)],color:"#e40"},{tag:oe.definition(oe.variableName),color:"#00f"},{tag:oe.local(oe.variableName),color:"#30a"},{tag:[oe.typeName,oe.namespace],color:"#085"},{tag:oe.className,color:"#167"},{tag:[oe.special(oe.variableName),oe.macroName],color:"#256"},{tag:oe.definition(oe.propertyName),color:"#00c"},{tag:oe.comment,color:"#940"},{tag:oe.invalid,color:"#f00"}]),L$=Ae.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),h6=1e4,d6="()[]{}",p6=Re.define({combine(n){return So(n,{afterCursor:!0,brackets:d6,maxScanDistance:h6,renderMatch:B$})}}),F$=Be.mark({class:"cm-matchingBracket"}),N$=Be.mark({class:"cm-nonmatchingBracket"});function B$(n){let e=[],t=n.matched?F$:N$;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const q$=Tn.define({create(){return Be.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],r=e.state.facet(p6);for(let i of e.state.selection.ranges){if(!i.empty)continue;let s=co(e.state,i.head,-1,r)||i.head>0&&co(e.state,i.head-1,1,r)||r.afterCursor&&(co(e.state,i.head,1,r)||i.head<e.state.doc.length&&co(e.state,i.head+1,-1,r));s&&(t=t.concat(r.renderMatch(s,e.state)))}return Be.set(t,!0)},provide:n=>Ae.decorations.from(n)}),W$=[q$,L$];function j$(n={}){return[p6.of(n),W$]}const $$=new ot;function e_(n,e,t){let r=n.prop(e<0?ot.openedBy:ot.closedBy);if(r)return r;if(n.name.length==1){let i=t.indexOf(n.name);if(i>-1&&i%2==(e<0?1:0))return[t[i+e]]}return null}function t_(n){let e=n.type.prop($$);return e?e(n.node):n}function co(n,e,t,r={}){let i=r.maxScanDistance||h6,s=r.brackets||d6,o=lr(n),a=o.resolveInner(e,t);for(let u=a;u;u=u.parent){let l=e_(u.type,t,s);if(l&&u.from<u.to){let c=t_(u);if(c&&(t>0?e>=c.from&&e<c.to:e>c.from&&e<=c.to))return z$(n,e,t,u,c,l,s)}}return U$(n,e,t,o,a.type,i,s)}function z$(n,e,t,r,i,s,o){let a=r.parent,u={from:i.from,to:i.to},l=0,c=a?.cursor();if(c&&(t<0?c.childBefore(r.from):c.childAfter(r.to)))do if(t<0?c.to<=r.from:c.from>=r.to){if(l==0&&s.indexOf(c.type.name)>-1&&c.from<c.to){let f=t_(c);return{start:u,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(e_(c.type,t,o))l++;else if(e_(c.type,-t,o)){if(l==0){let f=t_(c);return{start:u,end:f&&f.from<f.to?{from:f.from,to:f.to}:void 0,matched:!1}}l--}}while(t<0?c.prevSibling():c.nextSibling());return{start:u,matched:!1}}function U$(n,e,t,r,i,s,o){let a=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),u=o.indexOf(a);if(u<0||u%2==0!=t>0)return null;let l={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let d=0;!c.next().done&&d<=s;){let g=c.value;t<0&&(d+=g.length);let m=e+d*t;for(let y=t>0?0:g.length-1,b=t>0?g.length:-1;y!=b;y+=t){let w=o.indexOf(g[y]);if(!(w<0||r.resolveInner(m+y,1).type!=i))if(w%2==0==t>0)f++;else{if(f==1)return{start:l,end:{from:m+y,to:m+y+1},matched:w>>1==u>>1};f--}}t>0&&(d+=g.length)}return c.done?{start:l,matched:!1}:null}function o3(n,e,t,r=0,i=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let s=i;for(let o=r;o<e;o++)n.charCodeAt(o)==9?s+=t-s%t:s++;return s}class g6{constructor(e,t,r,i){this.string=e,this.tabSize=t,this.indentUnit=r,this.overrideIndent=i,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let t=this.string.charAt(this.pos),r;if(typeof e=="string"?r=t==e:r=t&&(e instanceof RegExp?e.test(t):e(t)),r)return++this.pos,t}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=o3(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:o3(this.string,null,this.tabSize)}match(e,t,r){if(typeof e=="string"){let i=o=>r?o.toLowerCase():o,s=this.string.substr(this.pos,e.length);return i(s)==i(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&t!==!1&&(this.pos+=i[0].length),i)}}current(){return this.string.slice(this.start,this.pos)}}function H$(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||V$,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||kk,mergeTokens:n.mergeTokens!==!1}}function V$(n){if(typeof n!="object")return n;let e={};for(let t in n){let r=n[t];e[t]=r instanceof Array?r.slice():r}return e}const a3=new WeakMap;class $n extends Xi{constructor(e){let t=YM(e.languageData),r=H$(e),i,s=new class extends GM{createParse(o,a,u){return new K$(i,o,a,u)}};super(t,s,[],e.name),this.topNode=Y$(t,this),i=this,this.streamParser=r,this.stateAfter=new ot({perNode:!0}),this.tokenTable=e.tokenTable?new b6(r.tokenTable):X$}static define(e){return new $n(e)}getIndent(e){let t,{overrideIndentation:r}=e.options;r&&(t=a3.get(e.state),t!=null&&t<e.pos-1e4&&(t=void 0));let i=_k(this,e.node.tree,e.node.from,e.node.from,t??e.pos),s,o;if(i?(o=i.state,s=i.pos+1):(o=this.streamParser.startState(e.unit),s=e.node.from),e.pos-s>1e4)return null;for(;s<e.pos;){let u=e.state.doc.lineAt(s),l=Math.min(e.pos,u.to);if(u.length){let c=r?r(u.from):-1,f=new g6(u.text,e.state.tabSize,e.unit,c<0?void 0:c);for(;f.pos<l-u.from;)y6(this.streamParser.token,f,o)}else this.streamParser.blankLine(o,e.unit);if(l==e.pos)break;s=u.to+1}let a=e.lineAt(e.pos);return r&&t==null&&a3.set(e.state,a.from),this.streamParser.indent(o,/^\s*(.*)/.exec(a.text)[1],e)}get allowsNesting(){return!1}}function _k(n,e,t,r,i){let s=t>=r&&t+e.length<=i&&e.prop(n.stateAfter);if(s)return{state:n.streamParser.copyState(s),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let a=e.children[o],u=t+e.positions[o],l=a instanceof Gt&&u<i&&_k(n,a,u,r,i);if(l)return l}return null}function m6(n,e,t,r,i){if(i&&t<=0&&r>=e.length)return e;!i&&t==0&&e.type==n.topNode&&(i=!0);for(let s=e.children.length-1;s>=0;s--){let o=e.positions[s],a=e.children[s],u;if(o<r&&a instanceof Gt){if(!(u=m6(n,a,t-o,r-o,i)))break;return i?new Gt(e.type,e.children.slice(0,s).concat(u),e.positions.slice(0,s+1),o+u.length):u}}return null}function G$(n,e,t,r,i){for(let s of e){let o=s.from+(s.openStart?25:0),a=s.to-(s.openEnd?25:0),u=o<=t&&a>t&&_k(n,s.tree,0-s.offset,t,a),l;if(u&&u.pos<=r&&(l=m6(n,s.tree,t+s.offset,u.pos+s.offset,!1)))return{state:u.state,tree:l}}return{state:n.streamParser.startState(i?dl(i):4),tree:Gt.empty}}class K${constructor(e,t,r,i){this.lang=e,this.input=t,this.fragments=r,this.ranges=i,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=i[i.length-1].to;let s=Lc.get(),o=i[0].from,{state:a,tree:u}=G$(e,r,o,this.to,s?.state);this.state=a,this.parsedPos=this.chunkStart=o+u.length;for(let l=0;l<u.children.length;l++)this.chunks.push(u.children[l]),this.chunkPos.push(u.positions[l]);s&&this.parsedPos<s.viewport.from-1e5&&i.some(l=>l.from<=s.viewport.from&&l.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(dl(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let e=Lc.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),r=Math.min(t,this.chunkStart+2048);for(e&&(r=Math.min(r,e.viewport.to));this.parsedPos<r;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==`
|
|
40
|
-
`&&(t="");else{let r=t.indexOf(`
|
|
41
|
-
`);r>-1&&(t=t.slice(0,r))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),r=e+t.length;for(let i=this.rangeIndex;;){let s=this.ranges[i].to;if(s>=r||(t=t.slice(0,s-(r-t.length)),i++,i==this.ranges.length))break;let o=this.ranges[i].from,a=this.lineAfter(o);t+=a,r=o+a.length}return{line:t,end:r}}skipGapsTo(e,t,r){for(;;){let i=this.ranges[this.rangeIndex].to,s=e+t;if(r>0?i>s:i>=s)break;let o=this.ranges[++this.rangeIndex].from;t+=o-i}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,r,i){let s=4;if(this.ranges.length>1){i=this.skipGapsTo(t,i,1),t+=i;let a=this.chunk.length;i=this.skipGapsTo(r,i,-1),r+=i,s+=this.chunk.length-a}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=r:this.chunk.push(e,t,r,s),i}parseLine(e){let{line:t,end:r}=this.nextLine(),i=0,{streamParser:s}=this.lang,o=new g6(t,e?e.state.tabSize:4,e?dl(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let a=y6(s.token,o,this.state);if(a&&(i=this.emitToken(this.lang.tokenTable.resolve(a),this.parsedPos+o.start,this.parsedPos+o.pos,i)),o.start>1e4)break}this.parsedPos=r,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=Gt.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Z$,topID:0,maxBufferLength:2048,reused:this.chunkReused});e=new Gt(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new Gt(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function y6(n,e,t){e.start=e.pos;for(let r=0;r<10;r++){let i=n(e,t);if(e.pos>e.start)return i}throw new Error("Stream parser failed to advance stream.")}const kk=Object.create(null),Rd=[Vr.none],Z$=new gk(Rd),u3=[],l3=Object.create(null),v6=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])v6[n]=w6(kk,e);class b6{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),v6)}resolve(e){return e?this.table[e]||(this.table[e]=w6(this.extra,e)):0}}const X$=new b6(kk);function rb(n,e){u3.indexOf(n)>-1||(u3.push(n),console.warn(e))}function w6(n,e){let t=[];for(let a of e.split(" ")){let u=[];for(let l of a.split(".")){let c=n[l]||oe[l];c?typeof c=="function"?u.length?u=u.map(c):rb(l,`Modifier ${l} used at start of tag`):u.length?rb(l,`Tag ${l} used as modifier`):u=Array.isArray(c)?c:[c]:rb(l,`Unknown highlighting tag ${l}`)}for(let l of u)t.push(l)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+t.map(a=>a.id),s=l3[i];if(s)return s.id;let o=l3[i]=Vr.define({id:Rd.length,name:r,props:[e$({[r]:t})]});return Rd.push(o),o.id}function Y$(n,e){let t=Vr.define({id:Rd.length,name:"Document",props:[tl.add(()=>n),e6.add(()=>r=>e.getIndent(r))],top:!0});return Rd.push(t),t}nn.RTL,nn.LTR;function J$({theme:n,settings:e={},styles:t=[]}){const r={".cm-gutters":{}},i={};e.background&&(i.backgroundColor=e.background),e.backgroundImage&&(i.backgroundImage=e.backgroundImage),e.foreground&&(i.color=e.foreground),e.fontSize&&(i.fontSize=e.fontSize),Object.keys(i).length>0&&(r["&"]=i),e.fontFamily&&(r["&.cm-editor .cm-scroller"]={fontFamily:e.fontFamily}),e.gutterBackground&&(r[".cm-gutters"].backgroundColor=e.gutterBackground),e.gutterForeground&&(r[".cm-gutters"].color=e.gutterForeground),e.gutterBorder&&(r[".cm-gutters"].borderRightColor=e.gutterBorder),e.caret&&(r[".cm-content"]={caretColor:e.caret},r[".cm-cursor, .cm-dropCursor"]={borderLeftColor:e.caret});const s={};e.gutterActiveForeground&&(s.color=e.gutterActiveForeground),e.lineHighlight&&(r[".cm-activeLine"]={backgroundColor:e.lineHighlight},s.backgroundColor=e.lineHighlight),r[".cm-activeLineGutter"]=s,e.selection&&(r["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:`${e.selection} !important`}),e.selectionMatch&&(r["& .cm-selectionMatch"]={backgroundColor:e.selectionMatch});const o=Ae.theme(r,{dark:n==="dark"}),a=Yc.define(t);return[o,f6(a)]}const Q$={background:"var(--cm-background)",foreground:"var(--cm-foreground)",caret:"var(--cm-caret)",selection:"var(--cm-selection)",selectionMatch:"var(--cm-selection-match)",lineHighlight:"var(--cm-line-highlight)",gutterBackground:"var(--cm-gutter-background)",gutterForeground:"var(--cm-gutter-foreground)",gutterActiveForeground:"var(--cm-gutter-active-foreground)",fontFamily:"var(--cm-font-family)"},ez=[{tag:[oe.keyword,oe.operatorKeyword,oe.modifier,oe.color,oe.constant(oe.name),oe.standard(oe.name),oe.standard(oe.tagName),oe.special(oe.brace),oe.atom,oe.bool,oe.special(oe.variableName)],color:"var(--cm-keyword)"},{tag:[oe.controlKeyword,oe.moduleKeyword],color:"var(--cm-control)"},{tag:[oe.name,oe.deleted,oe.character,oe.macroName,oe.propertyName,oe.variableName,oe.labelName,oe.definition(oe.name)],color:"var(--cm-name)"},{tag:oe.heading,fontWeight:"bold",color:"var(--cm-heading)"},{tag:[oe.typeName,oe.className,oe.tagName,oe.number,oe.changed,oe.annotation,oe.self,oe.namespace],color:"var(--cm-type)"},{tag:[oe.function(oe.variableName),oe.function(oe.propertyName)],color:"var(--cm-function)"},{tag:[oe.number],color:"var(--cm-number)"},{tag:[oe.operator,oe.punctuation,oe.separator,oe.url,oe.escape,oe.regexp],color:"var(--cm-operator)"},{tag:[oe.regexp],color:"var(--cm-regexp)"},{tag:[oe.special(oe.string),oe.processingInstruction,oe.string,oe.inserted],color:"var(--cm-string)"},{tag:[oe.angleBracket],color:"var(--cm-angle-bracket)"},{tag:oe.strong,fontWeight:"bold"},{tag:oe.emphasis,fontStyle:"italic"},{tag:oe.strikethrough,textDecoration:"line-through"},{tag:[oe.meta,oe.comment],color:"var(--cm-comment)"},{tag:oe.link,color:"var(--cm-link)",textDecoration:"underline"},{tag:oe.invalid,color:"var(--cm-invalid)"}];function tz(n){const{theme:e="light",settings:t={},styles:r=[]}={};return J$({theme:e,settings:{...Q$,...t},styles:[...ez,...r]})}const _6=tz(),c3={"--cm-background":"#1e1e1e","--cm-foreground":"#9cdcfe","--cm-caret":"#c6c6c6","--cm-selection":"#6199ff2f","--cm-selection-match":"#72a1ff59","--cm-line-highlight":"#ffffff0f","--cm-gutter-background":"#1e1e1e","--cm-gutter-foreground":"#838383","--cm-gutter-active-foreground":"#ffffff","--cm-keyword":"#569cd6","--cm-control":"#c586c0","--cm-name":"#9cdcfe","--cm-heading":"#9cdcfe","--cm-type":"#4ec9b0","--cm-function":"#dcdcaa","--cm-number":"#b5cea8","--cm-operator":"#d4d4d4","--cm-regexp":"#d16969","--cm-string":"#ce9178","--cm-angle-bracket":"#808080","--cm-comment":"#6a9955","--cm-link":"#4078f2","--cm-invalid":"#ff0000","--cm-search-result-color":"var(--cm-angle-bracket)","--cm-search-result-color-hover":"#ffffff","--cm-command-result-color":"var(--cm-search-result-color-hover)","--cm-toolbar-background":"var(--cm-toolbar-bg-dark)","--cm-toolbar-color":"var(--cm-toolbar-color-dark)","--cm-toolbar-foreground":"#ffffff","--cm-tooltip-color":"var(--cm-gutter-active-foreground)","--cm-tooltip-background":"var(--cm-toolbar-background)","--cm-tooltip-border":"#000000","--cm-diagnostic-error-bg":"#d11","--cm-comment-bg":"rgba(0,0,0,0.32)"},nz=new vo({":root, .cm-editor[data-theme='light'], [data-theme='light'] .cm-editor":{"--cm-font-family":'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace',"--cm-background":"#ffffff","--cm-foreground":"#383a42","--cm-caret":"#000000","--cm-selection":"#add6ff","--cm-selection-match":"#a8ac94","--cm-line-highlight":"#99999914","--cm-gutter-background":"#ffffff","--cm-gutter-foreground":"#237893","--cm-gutter-active-foreground":"#0b216f","--cm-keyword":"#0000ff","--cm-control":"#af00db","--cm-name":"#0070c1","--cm-heading":"#0070c1","--cm-type":"#267f99","--cm-function":"#795e26","--cm-number":"#098658","--cm-operator":"#383a42","--cm-regexp":"#af00db","--cm-string":"#a31515","--cm-angle-bracket":"#383a42","--cm-comment":"#008000","--cm-link":"#4078f2","--cm-invalid":"#e45649","--cm-search-result-color":"#838383","--cm-search-result-color-hover":"var(--cm-toolbar-color)","--cm-search-result-bg-hover":"#2490e94f","--cm-search-result-color-selected":"#ffffff","--cm-search-result-select-bg":"#2490e9","--cm-command-result-color":"var(--cm-toolbar-color)","--cm-toolbar-bg-light":"#f3f3f3","--cm-toolbar-bg-dark":"#2a2a2f","--cm-toolbar-color-light":"#000000","--cm-toolbar-color-dark":"#ffffff","--cm-toolbar-background":"var(--cm-toolbar-bg-light)","--cm-toolbar-color":"var(--cm-toolbar-color-light)","--cm-toolbar-foreground":"var(--cm-foreground)","--cm-tooltip-color":"var(--cm-foreground)","--cm-tooltip-background":"#ffffff","--cm-tooltip-border":"#000000","--cm-diagnostic-info-color":"white","--cm-diagnostic-info-bg":"#545454","--cm-diagnostic-error-color":"white","--cm-diagnostic-error-bg":"#e45649","--cm-comment-bg":"rgba(0,0,0,0.1)"},":root[data-theme='dark'], .cm-editor[data-theme='dark'], [data-theme='dark'] .cm-editor":c3,"@media (prefers-color-scheme: dark)":{":root":c3}}),rz=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),r=Sk(n.state,t.from);return r.line?iz(n):r.block?oz(n):!1};function xk(n,e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let i=n(e,t);return i?(r(t.update(i)),!0):!1}}const iz=xk(lz,0),sz=xk(k6,0),oz=xk((n,e)=>k6(n,e,uz(e)),0);function Sk(n,e){let t=n.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const ih=50;function az(n,{open:e,close:t},r,i){let s=n.sliceDoc(r-ih,r),o=n.sliceDoc(i,i+ih),a=/\s*$/.exec(s)[0].length,u=/^\s*/.exec(o)[0].length,l=s.length-a;if(s.slice(l-e.length,l)==e&&o.slice(u,u+t.length)==t)return{open:{pos:r-a,margin:a&&1},close:{pos:i+u,margin:u&&1}};let c,f;i-r<=2*ih?c=f=n.sliceDoc(r,i):(c=n.sliceDoc(r,r+ih),f=n.sliceDoc(i-ih,i));let d=/^\s*/.exec(c)[0].length,g=/\s*$/.exec(f)[0].length,m=f.length-g-t.length;return c.slice(d,d+e.length)==e&&f.slice(m,m+t.length)==t?{open:{pos:r+d+e.length,margin:/\s/.test(c.charAt(d+e.length))?1:0},close:{pos:i-g-t.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}function uz(n){let e=[];for(let t of n.selection.ranges){let r=n.doc.lineAt(t.from),i=t.to<=r.to?r:n.doc.lineAt(t.to);i.from>r.from&&i.from==t.to&&(i=t.to==r.to+1?r:n.doc.lineAt(t.to-1));let s=e.length-1;s>=0&&e[s].to>r.from?e[s].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function k6(n,e,t=e.selection.ranges){let r=t.map(s=>Sk(e,s.from).block);if(!r.every(s=>s))return null;let i=t.map((s,o)=>az(e,r[o],s.from,s.to));if(n!=2&&!i.every(s=>s))return{changes:e.changes(t.map((s,o)=>i[o]?[]:[{from:s.from,insert:r[o].open+" "},{from:s.to,insert:" "+r[o].close}]))};if(n!=1&&i.some(s=>s)){let s=[];for(let o=0,a;o<i.length;o++)if(a=i[o]){let u=r[o],{open:l,close:c}=a;s.push({from:l.pos-u.open.length,to:l.pos+l.margin},{from:c.pos-c.margin,to:c.pos+u.close.length})}return{changes:s}}return null}function lz(n,e,t=e.selection.ranges){let r=[],i=-1;for(let{from:s,to:o}of t){let a=r.length,u=1e9,l=Sk(e,s).line;if(l){for(let c=s;c<=o;){let f=e.doc.lineAt(c);if(f.from>i&&(s==o||o>f.from)){i=f.from;let d=/^\s*/.exec(f.text)[0].length,g=d==f.length,m=f.text.slice(d,d+l.length)==l?d:-1;d<f.text.length&&d<u&&(u=d),r.push({line:f,comment:m,token:l,indent:d,empty:g,single:!1})}c=f.to+1}if(u<1e9)for(let c=a;c<r.length;c++)r[c].indent<r[c].line.text.length&&(r[c].indent=u);r.length==a+1&&(r[a].single=!0)}}if(n!=2&&r.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:u,indent:l,empty:c,single:f}of r)(f||!c)&&s.push({from:a.from+l,insert:u+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:a,token:u}of r)if(a>=0){let l=o.from+a,c=l+u.length;o.text[c-o.from]==" "&&c++,s.push({from:l,to:c})}return{changes:s}}return null}const n_=ma.define(),cz=ma.define(),fz=Re.define(),x6=Re.define({combine(n){return So(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(r,i)=>e(r,i)||t(r,i)})}}),S6=Tn.define({create(){return fo.empty},update(n,e){let t=e.state.facet(x6),r=e.annotation(n_);if(r){let u=fi.fromTransaction(e,r.selection),l=r.side,c=l==0?n.undone:n.done;return u?c=zm(c,c.length,t.minDepth,u):c=A6(c,e.startState.selection),new fo(l==0?r.rest:c,l==0?c:r.rest)}let i=e.annotation(cz);if((i=="full"||i=="before")&&(n=n.isolate()),e.annotation(Dn.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let s=fi.fromTransaction(e),o=e.annotation(Dn.time),a=e.annotation(Dn.userEvent);return s?n=n.addChanges(s,o,a,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,a,t.newGroupDelay)),(i=="full"||i=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new fo(n.done.map(fi.fromJSON),n.undone.map(fi.fromJSON))}});function hz(n={}){return[S6,x6.of(n),Ae.domEventHandlers({beforeinput(e,t){let r=e.inputType=="historyUndo"?C6:e.inputType=="historyRedo"?r_:null;return r?(e.preventDefault(),r(t)):!1}})]}function z1(n,e){return function({state:t,dispatch:r}){if(!e&&t.readOnly)return!1;let i=t.field(S6,!1);if(!i)return!1;let s=i.pop(n,t,e);return s?(r(s),!0):!1}}const C6=z1(0,!1),r_=z1(1,!1),dz=z1(0,!0),pz=z1(1,!0);class fi{constructor(e,t,r,i,s){this.changes=e,this.effects=t,this.mapped=r,this.startSelection=i,this.selectionsAfter=s}setSelAfter(e){return new fi(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new fi(e.changes&&On.fromJSON(e.changes),[],e.mapped&&mo.fromJSON(e.mapped),e.startSelection&&me.fromJSON(e.startSelection),e.selectionsAfter.map(me.fromJSON))}static fromTransaction(e,t){let r=Yi;for(let i of e.startState.facet(fz)){let s=i(e);s.length&&(r=r.concat(s))}return!r.length&&e.changes.empty?null:new fi(e.changes.invert(e.startState.doc),r,void 0,t||e.startState.selection,Yi)}static selection(e){return new fi(void 0,Yi,void 0,void 0,e)}}function zm(n,e,t,r){let i=e+1>t+20?e-t-1:0,s=n.slice(i,e);return s.push(r),s}function gz(n,e){let t=[],r=!1;return n.iterChangedRanges((i,s)=>t.push(i,s)),e.iterChangedRanges((i,s,o,a)=>{for(let u=0;u<t.length;){let l=t[u++],c=t[u++];a>=l&&o<=c&&(r=!0)}}),r}function mz(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,r)=>t.empty!=e.ranges[r].empty).length===0}function E6(n,e){return n.length?e.length?n.concat(e):n:e}const Yi=[],yz=200;function A6(n,e){if(n.length){let t=n[n.length-1],r=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-yz));return r.length&&r[r.length-1].eq(e)?n:(r.push(e),zm(n,n.length-1,1e9,t.setSelAfter(r)))}else return[fi.selection([e])]}function vz(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function ib(n,e){if(!n.length)return n;let t=n.length,r=Yi;for(;t;){let i=bz(n[t-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let s=n.slice(0,t);return s[t-1]=i,s}else e=i.mapped,t--,r=i.selectionsAfter}return r.length?[fi.selection(r)]:Yi}function bz(n,e,t){let r=E6(n.selectionsAfter.length?n.selectionsAfter.map(a=>a.map(e)):Yi,t);if(!n.changes)return fi.selection(r);let i=n.changes.map(e),s=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(s):s;return new fi(i,Ve.mapEffects(n.effects,e),o,n.startSelection.map(s),r)}const wz=/^(input\.type|delete)($|\.)/;class fo{constructor(e,t,r=0,i=void 0){this.done=e,this.undone=t,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new fo(this.done,this.undone):this}addChanges(e,t,r,i,s){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||wz.test(r))&&(!a.selectionsAfter.length&&t-this.prevTime<i.newGroupDelay&&i.joinToEvent(s,gz(a.changes,e.changes))||r=="input.type.compose")?o=zm(o,o.length-1,i.minDepth,new fi(e.changes.compose(a.changes),E6(Ve.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,Yi)):o=zm(o,o.length,i.minDepth,e),new fo(o,Yi,t,r)}addSelection(e,t,r,i){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:Yi;return s.length>0&&t-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&mz(s[s.length-1],e)?this:new fo(A6(this.done,e),this.undone,t,r)}addMapping(e){return new fo(ib(this.done,e),ib(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,r){let i=e==0?this.done:this.undone;if(i.length==0)return null;let s=i[i.length-1],o=s.selectionsAfter[0]||t.selection;if(r&&s.selectionsAfter.length)return t.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:n_.of({side:e,rest:vz(i),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let a=i.length==1?Yi:i.slice(0,i.length-1);return s.mapped&&(a=ib(a,s.mapped)),t.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:n_.of({side:e,rest:a,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}fo.empty=new fo(Yi,Yi);const _z=[{key:"Mod-z",run:C6,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:r_,preventDefault:!0},{linux:"Ctrl-Shift-z",run:r_,preventDefault:!0},{key:"Mod-u",run:dz,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:pz,preventDefault:!0}];function Jc(n,e){return me.create(n.ranges.map(e),n.mainIndex)}function Co(n,e){return n.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Ps({state:n,dispatch:e},t){let r=Jc(n.selection,t);return r.eq(n.selection,!0)?!1:(e(Co(n,r)),!0)}function U1(n,e){return me.cursor(e?n.to:n.from)}function R6(n,e){return Ps(n,t=>t.empty?n.moveByChar(t,e):U1(t,e))}function Er(n){return n.textDirectionAt(n.state.selection.main.head)==nn.LTR}const D6=n=>R6(n,!Er(n)),T6=n=>R6(n,Er(n));function I6(n,e){return Ps(n,t=>t.empty?n.moveByGroup(t,e):U1(t,e))}const kz=n=>I6(n,!Er(n)),xz=n=>I6(n,Er(n));function Sz(n,e,t){if(e.type.prop(t))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function H1(n,e,t){let r=lr(n).resolveInner(e.head),i=t?ot.closedBy:ot.openedBy;for(let u=e.head;;){let l=t?r.childAfter(u):r.childBefore(u);if(!l)break;Sz(n,l,i)?r=l:u=t?l.to:l.from}let s=r.type.prop(i),o,a;return s&&(o=t?co(n,r.from,1):co(n,r.to,-1))&&o.matched?a=t?o.end.to:o.end.from:a=t?r.to:r.from,me.cursor(a,t?-1:1)}const Cz=n=>Ps(n,e=>H1(n.state,e,!Er(n))),Ez=n=>Ps(n,e=>H1(n.state,e,Er(n)));function M6(n,e){return Ps(n,t=>{if(!t.empty)return U1(t,e);let r=n.moveVertically(t,e);return r.head!=t.head?r:n.moveToLineBoundary(t,e)})}const O6=n=>M6(n,!1),P6=n=>M6(n,!0);function L6(n){let e=n.scrollDOM.clientHeight<n.scrollDOM.scrollHeight-2,t=0,r=0,i;if(e){for(let s of n.state.facet(Ae.scrollMargins)){let o=s(n);o?.top&&(t=Math.max(o?.top,t)),o?.bottom&&(r=Math.max(o?.bottom,r))}i=n.scrollDOM.clientHeight-t-r}else i=(n.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:r,selfScroll:e,height:Math.max(n.defaultLineHeight,i-5)}}function F6(n,e){let t=L6(n),{state:r}=n,i=Jc(r.selection,o=>o.empty?n.moveVertically(o,e,t.height):U1(o,e));if(i.eq(r.selection))return!1;let s;if(t.selfScroll){let o=n.coordsAtPos(r.selection.main.head),a=n.scrollDOM.getBoundingClientRect(),u=a.top+t.marginTop,l=a.bottom-t.marginBottom;o&&o.top>u&&o.bottom<l&&(s=Ae.scrollIntoView(i.main.head,{y:"start",yMargin:o.top-u}))}return n.dispatch(Co(r,i),{effects:s}),!0}const f3=n=>F6(n,!1),i_=n=>F6(n,!0);function du(n,e,t){let r=n.lineBlockAt(e.head),i=n.moveToLineBoundary(e,t);if(i.head==e.head&&i.head!=(t?r.to:r.from)&&(i=n.moveToLineBoundary(e,t,!1)),!t&&i.head==r.from&&r.length){let s=/^\s*/.exec(n.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&e.head!=r.from+s&&(i=me.cursor(r.from+s))}return i}const Az=n=>Ps(n,e=>du(n,e,!0)),Rz=n=>Ps(n,e=>du(n,e,!1)),Dz=n=>Ps(n,e=>du(n,e,!Er(n))),Tz=n=>Ps(n,e=>du(n,e,Er(n))),Iz=n=>Ps(n,e=>me.cursor(n.lineBlockAt(e.head).from,1)),Mz=n=>Ps(n,e=>me.cursor(n.lineBlockAt(e.head).to,-1));function Oz(n,e,t){let r=!1,i=Jc(n.selection,s=>{let o=co(n,s.head,-1)||co(n,s.head,1)||s.head>0&&co(n,s.head-1,1)||s.head<n.doc.length&&co(n,s.head+1,-1);if(!o||!o.end)return s;r=!0;let a=o.start.from==s.head?o.end.to:o.end.from;return me.cursor(a)});return r?(e(Co(n,i)),!0):!1}const Pz=({state:n,dispatch:e})=>Oz(n,e);function as(n,e){let t=Jc(n.state.selection,r=>{let i=e(r);return me.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(Co(n.state,t)),!0)}function N6(n,e){return as(n,t=>n.moveByChar(t,e))}const B6=n=>N6(n,!Er(n)),q6=n=>N6(n,Er(n));function W6(n,e){return as(n,t=>n.moveByGroup(t,e))}const Lz=n=>W6(n,!Er(n)),Fz=n=>W6(n,Er(n)),Nz=n=>as(n,e=>H1(n.state,e,!Er(n))),Bz=n=>as(n,e=>H1(n.state,e,Er(n)));function j6(n,e){return as(n,t=>n.moveVertically(t,e))}const $6=n=>j6(n,!1),z6=n=>j6(n,!0);function U6(n,e){return as(n,t=>n.moveVertically(t,e,L6(n).height))}const h3=n=>U6(n,!1),d3=n=>U6(n,!0),qz=n=>as(n,e=>du(n,e,!0)),Wz=n=>as(n,e=>du(n,e,!1)),jz=n=>as(n,e=>du(n,e,!Er(n))),$z=n=>as(n,e=>du(n,e,Er(n))),zz=n=>as(n,e=>me.cursor(n.lineBlockAt(e.head).from)),Uz=n=>as(n,e=>me.cursor(n.lineBlockAt(e.head).to)),p3=({state:n,dispatch:e})=>(e(Co(n,{anchor:0})),!0),g3=({state:n,dispatch:e})=>(e(Co(n,{anchor:n.doc.length})),!0),m3=({state:n,dispatch:e})=>(e(Co(n,{anchor:n.selection.main.anchor,head:0})),!0),y3=({state:n,dispatch:e})=>(e(Co(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),Hz=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),Vz=({state:n,dispatch:e})=>{let t=V1(n).map(({from:r,to:i})=>me.range(r,Math.min(i+1,n.doc.length)));return e(n.update({selection:me.create(t),userEvent:"select"})),!0},Gz=({state:n,dispatch:e})=>{let t=Jc(n.selection,r=>{let i=lr(n),s=i.resolveStack(r.from,1);if(r.empty){let o=i.resolveStack(r.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:a}=o;if((a.from<r.from&&a.to>=r.to||a.to>r.to&&a.from<=r.from)&&o.next)return me.range(a.to,a.from)}return r});return t.eq(n.selection)?!1:(e(Co(n,t)),!0)},Kz=({state:n,dispatch:e})=>{let t=n.selection,r=null;return t.ranges.length>1?r=me.create([t.main]):t.main.empty||(r=me.create([me.cursor(t.main.head)])),r?(e(Co(n,r)),!0):!1};function op(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:r}=n,i=r.changeByRange(s=>{let{from:o,to:a}=s;if(o==a){let u=e(s);u<o?(t="delete.backward",u=Kg(n,u,!1)):u>o&&(t="delete.forward",u=Kg(n,u,!0)),o=Math.min(o,u),a=Math.max(a,u)}else o=Kg(n,o,!1),a=Kg(n,a,!0);return o==a?{range:s}:{changes:{from:o,to:a},range:me.cursor(o,o<s.head?-1:1)}});return i.changes.empty?!1:(n.dispatch(r.update(i,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?Ae.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function Kg(n,e,t){if(n instanceof Ae)for(let r of n.state.facet(Ae.atomicRanges).map(i=>i(n)))r.between(e,e,(i,s)=>{i<e&&s>e&&(e=t?s:i)});return e}const H6=(n,e,t)=>op(n,r=>{let i=r.from,{state:s}=n,o=s.doc.lineAt(i),a,u;if(t&&!e&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(a=o.text.slice(0,i-o.from))){if(a[a.length-1]==" ")return i-1;let l=Kc(a,s.tabSize),c=l%dl(s)||dl(s);for(let f=0;f<c&&a[a.length-1-f]==" ";f++)i--;u=i}else u=ur(o.text,i-o.from,e,e)+o.from,u==i&&o.number!=(e?s.doc.lines:1)?u+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(u-o.from,i-o.from))&&(u=ur(o.text,u-o.from,!1,!1)+o.from);return u}),s_=n=>H6(n,!1,!0),V6=n=>H6(n,!0,!1),G6=(n,e)=>op(n,t=>{let r=t.head,{state:i}=n,s=i.doc.lineAt(r),o=i.charCategorizer(r);for(let a=null;;){if(r==(e?s.to:s.from)){r==t.head&&s.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let u=ur(s.text,r-s.from,e)+s.from,l=s.text.slice(Math.min(r,u)-s.from,Math.max(r,u)-s.from),c=o(l);if(a!=null&&c!=a)break;(l!=" "||r!=t.head)&&(a=c),r=u}return r}),K6=n=>G6(n,!1),Zz=n=>G6(n,!0),Xz=n=>op(n,e=>{let t=n.lineBlockAt(e.head).to;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),Yz=n=>op(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),Jz=n=>op(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),Qz=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:vt.of(["",""])},range:me.cursor(r.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},eU=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(r=>{if(!r.empty||r.from==0||r.from==n.doc.length)return{range:r};let i=r.from,s=n.doc.lineAt(i),o=i==s.from?i-1:ur(s.text,i-s.from,!1)+s.from,a=i==s.to?i+1:ur(s.text,i-s.from,!0)+s.from;return{changes:{from:o,to:a,insert:n.doc.slice(i,a).append(n.doc.slice(o,i))},range:me.cursor(a)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function V1(n){let e=[],t=-1;for(let r of n.selection.ranges){let i=n.doc.lineAt(r.from),s=n.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=n.doc.lineAt(r.to-1)),t>=i.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(r)}else e.push({from:i.from,to:s.to,ranges:[r]});t=s.number+1}return e}function Z6(n,e,t){if(n.readOnly)return!1;let r=[],i=[];for(let s of V1(n)){if(t?s.to==n.doc.length:s.from==0)continue;let o=n.doc.lineAt(t?s.to+1:s.from-1),a=o.length+1;if(t){r.push({from:s.to,to:o.to},{from:s.from,insert:o.text+n.lineBreak});for(let u of s.ranges)i.push(me.range(Math.min(n.doc.length,u.anchor+a),Math.min(n.doc.length,u.head+a)))}else{r.push({from:o.from,to:s.from},{from:s.to,insert:n.lineBreak+o.text});for(let u of s.ranges)i.push(me.range(u.anchor-a,u.head-a))}}return r.length?(e(n.update({changes:r,scrollIntoView:!0,selection:me.create(i,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const tU=({state:n,dispatch:e})=>Z6(n,e,!1),nU=({state:n,dispatch:e})=>Z6(n,e,!0);function X6(n,e,t){if(n.readOnly)return!1;let r=[];for(let i of V1(n))t?r.push({from:i.from,insert:n.doc.slice(i.from,i.to)+n.lineBreak}):r.push({from:i.to,insert:n.lineBreak+n.doc.slice(i.from,i.to)});return e(n.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const rU=({state:n,dispatch:e})=>X6(n,e,!1),iU=({state:n,dispatch:e})=>X6(n,e,!0),sU=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(V1(e).map(({from:i,to:s})=>(i>0?i--:s<e.doc.length&&s++,{from:i,to:s}))),r=Jc(e.selection,i=>{let s;if(n.lineWrapping){let o=n.lineBlockAt(i.head),a=n.coordsAtPos(i.head,i.assoc||1);a&&(s=o.bottom+n.documentTop-a.bottom+n.defaultLineHeight/2)}return n.moveVertically(i,!0,s)}).map(t);return n.dispatch({changes:t,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function oU(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=lr(n).resolveInner(e),r=t.childBefore(e),i=t.childAfter(e),s;return r&&i&&r.to<=e&&i.from>=e&&(s=r.type.prop(ot.closedBy))&&s.indexOf(i.name)>-1&&n.doc.lineAt(r.to).from==n.doc.lineAt(i.from).from&&!/\S/.test(n.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const v3=Y6(!1),aU=Y6(!0);function Y6(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:s,to:o}=i,a=e.doc.lineAt(s),u=!n&&s==o&&oU(e,s);n&&(s=o=(o<=a.to?a:e.doc.lineAt(o)).to);let l=new j1(e,{simulateBreak:s,simulateDoubleBreak:!!u}),c=bk(l,s);for(c==null&&(c=Kc(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));o<a.to&&/\s/.test(a.text[o-a.from]);)o++;u?{from:s,to:o}=u:s>a.from&&s<a.from+100&&!/\S/.test(a.text.slice(0,s))&&(s=a.from);let f=["",Ad(e,c)];return u&&f.push(Ad(e,l.lineIndent(a.from,-1))),{changes:{from:s,to:o,insert:vt.of(f)},range:me.cursor(s+1+f[1].length)}});return t(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Ck(n,e){let t=-1;return n.changeByRange(r=>{let i=[];for(let o=r.from;o<=r.to;){let a=n.doc.lineAt(o);a.number>t&&(r.empty||r.to>a.from)&&(e(a,i,r),t=a.number),o=a.to+1}let s=n.changes(i);return{changes:i,range:me.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const uU=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),r=new j1(n,{overrideIndentation:s=>{let o=t[s];return o??-1}}),i=Ck(n,(s,o,a)=>{let u=bk(r,s.from);if(u==null)return;/\S/.test(s.text)||(u=0);let l=/^\s*/.exec(s.text)[0],c=Ad(n,u);(l!=c||a.from<s.from+l.length)&&(t[s.from]=u,o.push({from:s.from,to:s.from+l.length,insert:c}))});return i.changes.empty||e(n.update(i,{userEvent:"indent"})),!0},J6=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Ck(n,(t,r)=>{r.push({from:t.from,insert:n.facet(Xc)})}),{userEvent:"input.indent"})),!0),Q6=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Ck(n,(t,r)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let s=Kc(i,n.tabSize),o=0,a=Ad(n,Math.max(0,s-dl(n)));for(;o<i.length&&o<a.length&&i.charCodeAt(o)==a.charCodeAt(o);)o++;r.push({from:t.from+o,to:t.from+i.length,insert:a.slice(o)})}),{userEvent:"delete.dedent"})),!0),lU=n=>(n.setTabFocusMode(),!0),cU=[{key:"Ctrl-b",run:D6,shift:B6,preventDefault:!0},{key:"Ctrl-f",run:T6,shift:q6},{key:"Ctrl-p",run:O6,shift:$6},{key:"Ctrl-n",run:P6,shift:z6},{key:"Ctrl-a",run:Iz,shift:zz},{key:"Ctrl-e",run:Mz,shift:Uz},{key:"Ctrl-d",run:V6},{key:"Ctrl-h",run:s_},{key:"Ctrl-k",run:Xz},{key:"Ctrl-Alt-h",run:K6},{key:"Ctrl-o",run:Qz},{key:"Ctrl-t",run:eU},{key:"Ctrl-v",run:i_}],fU=[{key:"ArrowLeft",run:D6,shift:B6,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:kz,shift:Lz,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Dz,shift:jz,preventDefault:!0},{key:"ArrowRight",run:T6,shift:q6,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:xz,shift:Fz,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Tz,shift:$z,preventDefault:!0},{key:"ArrowUp",run:O6,shift:$6,preventDefault:!0},{mac:"Cmd-ArrowUp",run:p3,shift:m3},{mac:"Ctrl-ArrowUp",run:f3,shift:h3},{key:"ArrowDown",run:P6,shift:z6,preventDefault:!0},{mac:"Cmd-ArrowDown",run:g3,shift:y3},{mac:"Ctrl-ArrowDown",run:i_,shift:d3},{key:"PageUp",run:f3,shift:h3},{key:"PageDown",run:i_,shift:d3},{key:"Home",run:Rz,shift:Wz,preventDefault:!0},{key:"Mod-Home",run:p3,shift:m3},{key:"End",run:Az,shift:qz,preventDefault:!0},{key:"Mod-End",run:g3,shift:y3},{key:"Enter",run:v3,shift:v3},{key:"Mod-a",run:Hz},{key:"Backspace",run:s_,shift:s_},{key:"Delete",run:V6},{key:"Mod-Backspace",mac:"Alt-Backspace",run:K6},{key:"Mod-Delete",mac:"Alt-Delete",run:Zz},{mac:"Mod-Backspace",run:Yz},{mac:"Mod-Delete",run:Jz}].concat(cU.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),hU=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Cz,shift:Nz},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Ez,shift:Bz},{key:"Alt-ArrowUp",run:tU},{key:"Shift-Alt-ArrowUp",run:rU},{key:"Alt-ArrowDown",run:nU},{key:"Shift-Alt-ArrowDown",run:iU},{key:"Escape",run:Kz},{key:"Mod-Enter",run:aU},{key:"Alt-l",mac:"Ctrl-l",run:Vz},{key:"Mod-i",run:Gz,preventDefault:!0},{key:"Mod-[",run:Q6},{key:"Mod-]",run:J6},{key:"Mod-Alt-\\",run:uU},{key:"Shift-Mod-k",run:sU},{key:"Shift-Mod-\\",run:Pz},{key:"Mod-/",run:rz},{key:"Alt-A",run:sz},{key:"Ctrl-m",mac:"Shift-Alt-m",run:lU}].concat(fU),dU={key:"Tab",run:J6,shift:Q6},pU="modulepreload",gU=function(n){return"/"+n},b3={},mt=function(e,t,r){let i=Promise.resolve();if(t&&t.length>0){let u=function(l){return Promise.all(l.map(c=>Promise.resolve(c).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=o?.nonce||o?.getAttribute("nonce");i=u(t.map(l=>{if(l=gU(l),l in b3)return;b3[l]=!0;const c=l.endsWith(".css"),f=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${f}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":pU,c||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),c)return new Promise((g,m)=>{d.addEventListener("load",g),d.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})},w3=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var sb,_3;function mU(){if(_3)return sb;_3=1,sb=n;function n(r,i,s){r instanceof RegExp&&(r=e(r,s)),i instanceof RegExp&&(i=e(i,s));var o=t(r,i,s);return o&&{start:o[0],end:o[1],pre:s.slice(0,o[0]),body:s.slice(o[0]+r.length,o[1]),post:s.slice(o[1]+i.length)}}function e(r,i){var s=i.match(r);return s?s[0]:null}n.range=t;function t(r,i,s){var o,a,u,l,c,f=s.indexOf(r),d=s.indexOf(i,f+1),g=f;if(f>=0&&d>0){if(r===i)return[f,d];for(o=[],u=s.length;g>=0&&!c;)g==f?(o.push(g),f=s.indexOf(r,g+1)):o.length==1?c=[o.pop(),d]:(a=o.pop(),a<u&&(u=a,l=d),d=s.indexOf(i,g+1)),g=f<d&&f>=0?f:d;o.length&&(c=[u,l])}return c}return sb}var ob,k3;function yU(){if(k3)return ob;k3=1;var n=mU();ob=c;var e="\0SLASH"+Math.random()+"\0",t="\0OPEN"+Math.random()+"\0",r="\0CLOSE"+Math.random()+"\0",i="\0COMMA"+Math.random()+"\0",s="\0PERIOD"+Math.random()+"\0";function o(b){return parseInt(b,10)==b?parseInt(b,10):b.charCodeAt(0)}function a(b){return b.split("\\\\").join(e).split("\\{").join(t).split("\\}").join(r).split("\\,").join(i).split("\\.").join(s)}function u(b){return b.split(e).join("\\").split(t).join("{").split(r).join("}").split(i).join(",").split(s).join(".")}function l(b){if(!b)return[""];var w=[],x=n("{","}",b);if(!x)return b.split(",");var _=x.pre,S=x.body,C=x.post,A=_.split(",");A[A.length-1]+="{"+S+"}";var I=l(C);return C.length&&(A[A.length-1]+=I.shift(),A.push.apply(A,I)),w.push.apply(w,A),w}function c(b){return b?(b.substr(0,2)==="{}"&&(b="\\{\\}"+b.substr(2)),y(a(b),!0).map(u)):[]}function f(b){return"{"+b+"}"}function d(b){return/^-?0\d/.test(b)}function g(b,w){return b<=w}function m(b,w){return b>=w}function y(b,w){var x=[],_=n("{","}",b);if(!_)return[b];var S=_.pre,C=_.post.length?y(_.post,!1):[""];if(/\$$/.test(_.pre))for(var A=0;A<C.length;A++){var I=S+"{"+_.body+"}"+C[A];x.push(I)}else{var W=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(_.body),B=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(_.body),K=W||B,G=_.body.indexOf(",")>=0;if(!K&&!G)return _.post.match(/,.*\}/)?(b=_.pre+"{"+_.body+r+_.post,y(b)):[b];var F;if(K)F=_.body.split(/\.\./);else if(F=l(_.body),F.length===1&&(F=y(F[0],!1).map(f),F.length===1))return C.map(function(Xt){return _.pre+F[0]+Xt});var R;if(K){var Y=o(F[0]),q=o(F[1]),te=Math.max(F[0].length,F[1].length),ae=F.length==3?Math.abs(o(F[2])):1,be=g,ye=q<Y;ye&&(ae*=-1,be=m);var De=F.some(d);R=[];for(var we=Y;be(we,q);we+=ae){var Pe;if(B)Pe=String.fromCharCode(we),Pe==="\\"&&(Pe="");else if(Pe=String(we),De){var Rt=te-Pe.length;if(Rt>0){var kt=new Array(Rt+1).join("0");we<0?Pe="-"+kt+Pe.slice(1):Pe=kt+Pe}}R.push(Pe)}}else{R=[];for(var rt=0;rt<F.length;rt++)R.push.apply(R,y(F[rt],!1))}for(var rt=0;rt<R.length;rt++)for(var A=0;A<C.length;A++){var I=S+R[rt]+C[A];(!w||K||I)&&x.push(I)}}return x}return ob}var vU=yU();const bU=Ij(vU),wU=1024*64,Um=n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>wU)throw new TypeError("pattern is too long")},_U={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},sh=n=>n.replace(/[[\]\\-]/g,"\\$&"),kU=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),x3=n=>n.join(""),xU=(n,e)=>{const t=e;if(n.charAt(t)!=="[")throw new Error("not in a brace expression");const r=[],i=[];let s=t+1,o=!1,a=!1,u=!1,l=!1,c=t,f="";e:for(;s<n.length;){const y=n.charAt(s);if((y==="!"||y==="^")&&s===t+1){l=!0,s++;continue}if(y==="]"&&o&&!u){c=s+1;break}if(o=!0,y==="\\"&&!u){u=!0,s++;continue}if(y==="["&&!u){for(const[b,[w,x,_]]of Object.entries(_U))if(n.startsWith(b,s)){if(f)return["$.",!1,n.length-t,!0];s+=b.length,_?i.push(w):r.push(w),a=a||x;continue e}}if(u=!1,f){y>f?r.push(sh(f)+"-"+sh(y)):y===f&&r.push(sh(y)),f="",s++;continue}if(n.startsWith("-]",s+1)){r.push(sh(y+"-")),s+=2;continue}if(n.startsWith("-",s+1)){f=y,s+=2;continue}r.push(sh(y)),s++}if(c<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,n.length-t,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){const y=r[0].length===2?r[0].slice(-1):r[0];return[kU(y),!1,c-t,!1]}const d="["+(l?"^":"")+x3(r)+"]",g="["+(l?"":"^")+x3(i)+"]";return[r.length&&i.length?"("+d+"|"+g+")":r.length?d:g,a,c-t,!0]},td=(n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),SU=new Set(["!","?","+","*","@"]),S3=n=>SU.has(n),CU="(?!(?:^|/)\\.\\.?(?:$|/))",Zg="(?!\\.)",EU=new Set(["[","."]),AU=new Set(["..","."]),RU=new Set("().*{}+?[]^$\\!"),DU=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ek="[^/]",C3=Ek+"*?",E3=Ek+"+?";class Wr{type;#n;#r;#s=!1;#e=[];#t;#o;#u;#a=!1;#i;#l;#f=!1;constructor(e,t,r={}){this.type=e,e&&(this.#r=!0),this.#t=t,this.#n=this.#t?this.#t.#n:this,this.#i=this.#n===this?r:this.#n.#i,this.#u=this.#n===this?[]:this.#n.#u,e==="!"&&!this.#n.#a&&this.#u.push(this),this.#o=this.#t?this.#t.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(const e of this.#e)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#l!==void 0?this.#l:this.type?this.#l=this.type+"("+this.#e.map(e=>String(e)).join("|")+")":this.#l=this.#e.map(e=>String(e)).join("")}#d(){if(this!==this.#n)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let e;for(;e=this.#u.pop();){if(e.type!=="!")continue;let t=e,r=t.#t;for(;r;){for(let i=t.#o+1;!r.type&&i<r.#e.length;i++)for(const s of e.#e){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#e[i])}t=r,r=t.#t}}return this}push(...e){for(const t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof Wr&&t.#t===this))throw new Error("invalid part: "+t);this.#e.push(t)}}toJSON(){const e=this.type===null?this.#e.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#e.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#a&&this.#t?.type==="!")&&e.push({}),e}isStart(){if(this.#n===this)return!0;if(!this.#t?.isStart())return!1;if(this.#o===0)return!0;const e=this.#t;for(let t=0;t<this.#o;t++){const r=e.#e[t];if(!(r instanceof Wr&&r.type==="!"))return!1}return!0}isEnd(){if(this.#n===this||this.#t?.type==="!")return!0;if(!this.#t?.isEnd())return!1;if(!this.type)return this.#t?.isEnd();const e=this.#t?this.#t.#e.length:0;return this.#o===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){const t=new Wr(this.type,e);for(const r of this.#e)t.copyIn(r);return t}static#c(e,t,r,i){let s=!1,o=!1,a=-1,u=!1;if(t.type===null){let g=r,m="";for(;g<e.length;){const y=e.charAt(g++);if(s||y==="\\"){s=!s,m+=y;continue}if(o){g===a+1?(y==="^"||y==="!")&&(u=!0):y==="]"&&!(g===a+2&&u)&&(o=!1),m+=y;continue}else if(y==="["){o=!0,a=g,u=!1,m+=y;continue}if(!i.noext&&S3(y)&&e.charAt(g)==="("){t.push(m),m="";const b=new Wr(y,t);g=Wr.#c(e,b,g,i),t.push(b);continue}m+=y}return t.push(m),g}let l=r+1,c=new Wr(null,t);const f=[];let d="";for(;l<e.length;){const g=e.charAt(l++);if(s||g==="\\"){s=!s,d+=g;continue}if(o){l===a+1?(g==="^"||g==="!")&&(u=!0):g==="]"&&!(l===a+2&&u)&&(o=!1),d+=g;continue}else if(g==="["){o=!0,a=l,u=!1,d+=g;continue}if(S3(g)&&e.charAt(l)==="("){c.push(d),d="";const m=new Wr(g,c);c.push(m),l=Wr.#c(e,m,l,i);continue}if(g==="|"){c.push(d),d="",f.push(c),c=new Wr(null,t);continue}if(g===")")return d===""&&t.#e.length===0&&(t.#f=!0),c.push(d),d="",t.push(...f,c),l;d+=g}return t.type=null,t.#r=void 0,t.#e=[e.substring(r-1)],l}static fromGlob(e,t={}){const r=new Wr(null,void 0,t);return Wr.#c(e,r,0,t),r}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();const e=this.toString(),[t,r,i,s]=this.toRegExpSource();if(!(i||this.#r||this.#i.nocase&&!this.#i.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;const a=(this.#i.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#i}toRegExpSource(e){const t=e??!!this.#i.dot;if(this.#n===this&&this.#d(),!this.type){const u=this.isStart()&&this.isEnd(),l=this.#e.map(g=>{const[m,y,b,w]=typeof g=="string"?Wr.#p(g,this.#r,u):g.toRegExpSource(e);return this.#r=this.#r||b,this.#s=this.#s||w,m}).join("");let c="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&AU.has(this.#e[0]))){const m=EU,y=t&&m.has(l.charAt(0))||l.startsWith("\\.")&&m.has(l.charAt(2))||l.startsWith("\\.\\.")&&m.has(l.charAt(4)),b=!t&&!e&&m.has(l.charAt(0));c=y?CU:b?Zg:""}let f="";return this.isEnd()&&this.#n.#a&&this.#t?.type==="!"&&(f="(?:$|\\/)"),[c+l+f,td(l),this.#r=!!this.#r,this.#s]}const r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:";let s=this.#h(t);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){const u=this.toString();return this.#e=[u],this.type=null,this.#r=void 0,[u,td(this.toString()),!1,!1]}let o=!r||e||t||!Zg?"":this.#h(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#f)a=(this.isStart()&&!t?Zg:"")+E3;else{const u=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Zg:"")+C3+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+u}return[a,td(s),this.#r=!!this.#r,this.#s]}#h(e){return this.#e.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");const[r,i,s,o]=t.toRegExpSource(e);return this.#s=this.#s||o,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#p(e,t,r=!1){let i=!1,s="",o=!1;for(let a=0;a<e.length;a++){const u=e.charAt(a);if(i){i=!1,s+=(RU.has(u)?"\\":"")+u;continue}if(u==="\\"){a===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){const[l,c,f,d]=xU(e,a);if(f){s+=l,o=o||c,a+=f-1,t=t||d;continue}}if(u==="*"){r&&e==="*"?s+=E3:s+=C3,t=!0;continue}if(u==="?"){s+=Ek,t=!0;continue}s+=DU(u)}return[s,td(e),!!t,o]}}const TU=(n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&");var ab={};const Gr=(n,e,t={})=>(Um(e),!t.nocomment&&e.charAt(0)==="#"?!1:new G1(e,t).match(n)),IU=/^\*+([^+@!?\*\[\(]*)$/,MU=n=>e=>!e.startsWith(".")&&e.endsWith(n),OU=n=>e=>e.endsWith(n),PU=n=>(n=n.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(n)),LU=n=>(n=n.toLowerCase(),e=>e.toLowerCase().endsWith(n)),FU=/^\*+\.\*+$/,NU=n=>!n.startsWith(".")&&n.includes("."),BU=n=>n!=="."&&n!==".."&&n.includes("."),qU=/^\.\*+$/,WU=n=>n!=="."&&n!==".."&&n.startsWith("."),jU=/^\*+$/,$U=n=>n.length!==0&&!n.startsWith("."),zU=n=>n.length!==0&&n!=="."&&n!=="..",UU=/^\?+([^+@!?\*\[\(]*)?$/,HU=([n,e=""])=>{const t=eO([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},VU=([n,e=""])=>{const t=tO([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},GU=([n,e=""])=>{const t=tO([n]);return e?r=>t(r)&&r.endsWith(e):t},KU=([n,e=""])=>{const t=eO([n]);return e?r=>t(r)&&r.endsWith(e):t},eO=([n])=>{const e=n.length;return t=>t.length===e&&!t.startsWith(".")},tO=([n])=>{const e=n.length;return t=>t.length===e&&t!=="."&&t!==".."},nO=typeof process=="object"&&process?typeof ab=="object"&&ab&&ab.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",A3={win32:{sep:"\\"},posix:{sep:"/"}},ZU=nO==="win32"?A3.win32.sep:A3.posix.sep;Gr.sep=ZU;const Ui=Symbol("globstar **");Gr.GLOBSTAR=Ui;const XU="[^/]",YU=XU+"*?",JU="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",QU="(?:(?!(?:\\/|^)\\.).)*?",eH=(n,e={})=>t=>Gr(t,n,e);Gr.filter=eH;const $i=(n,e={})=>Object.assign({},n,e),tH=n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return Gr;const e=Gr;return Object.assign((r,i,s={})=>e(r,i,$i(n,s)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,$i(n,s))}static defaults(i){return e.defaults($i(n,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,o={}){super(i,s,$i(n,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,$i(n,s))}},unescape:(r,i={})=>e.unescape(r,$i(n,i)),escape:(r,i={})=>e.escape(r,$i(n,i)),filter:(r,i={})=>e.filter(r,$i(n,i)),defaults:r=>e.defaults($i(n,r)),makeRe:(r,i={})=>e.makeRe(r,$i(n,i)),braceExpand:(r,i={})=>e.braceExpand(r,$i(n,i)),match:(r,i,s={})=>e.match(r,i,$i(n,s)),sep:e.sep,GLOBSTAR:Ui})};Gr.defaults=tH;const rO=(n,e={})=>(Um(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:bU(n));Gr.braceExpand=rO;const nH=(n,e={})=>new G1(n,e).makeRe();Gr.makeRe=nH;const rH=(n,e,t={})=>{const r=new G1(e,t);return n=n.filter(i=>r.match(i)),r.options.nonull&&!n.length&&n.push(e),n};Gr.match=rH;const R3=/[?*]|[+@!]\(.*?\)|\[|\]/,iH=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class G1{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){Um(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||nO,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const e of this.set)for(const t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){const e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);const r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){const u=s[0]===""&&s[1]===""&&(s[2]==="?"||!R3.test(s[2]))&&!R3.test(s[3]),l=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map(c=>this.parse(c))];if(l)return[s[0],...s.slice(1).map(c=>this.parse(c))]}return s.map(u=>this.parse(u))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){const o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++)e[r][i]==="**"&&(e[r][i]="*");const{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let i=r;for(;t[i+1]==="**";)i++;i!==r&&t.splice(r,i-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,i)=>{const s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){const s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(t=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){const i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let o=i;for(;r[o+1]==="**";)o++;o>i&&r.splice(i+1,o-i);let a=r[i+1];const u=r[i+2],l=r[i+3];if(a!==".."||!u||u==="."||u===".."||!l||l==="."||l==="..")continue;t=!0,r.splice(i,1);const c=r.slice(0);c[i]="**",e.push(c),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){const a=r[o];o===1&&a===""&&r[0]===""||(a==="."||a==="")&&(t=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){const o=r[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;const u=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...u),r.length===0&&r.push(""),s-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){const i=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(i){e[t]=[],e[r]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!1){let i=0,s=0,o=[],a="";for(;i<e.length&&s<t.length;)if(e[i]===t[s])o.push(a==="b"?t[s]:e[i]),i++,s++;else if(r&&e[i]==="**"&&t[s]===e[i+1])o.push(e[i]),i++;else if(r&&t[s]==="**"&&e[i]===t[s+1])o.push(t[s]),s++;else if(e[i]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,s++}else if(t[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(t[s]),i++,s++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;const e=this.pattern;let t=!1,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){const i=this.options;if(this.isWindows){const y=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),b=!y&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),w=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),x=!w&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),_=b?3:y?0:void 0,S=x?3:w?0:void 0;if(typeof _=="number"&&typeof S=="number"){const[C,A]=[e[_],t[S]];C.toLowerCase()===A.toLowerCase()&&(t[S]=C,S>_?t=t.slice(S):_>S&&(e=e.slice(_)))}}const{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var o=0,a=0,u=e.length,l=t.length;o<u&&a<l;o++,a++){this.debug("matchOne loop");var c=t[a],f=e[o];if(this.debug(t,c,f),c===!1)return!1;if(c===Ui){this.debug("GLOBSTAR",[t,c,f]);var d=o,g=a+1;if(g===l){for(this.debug("** at the end");o<u;o++)if(e[o]==="."||e[o]===".."||!i.dot&&e[o].charAt(0)===".")return!1;return!0}for(;d<u;){var m=e[d];if(this.debug(`
|
|
42
|
-
globstar while`,e,d,t,g,m),this.matchOne(e.slice(d),t.slice(g),r))return this.debug("globstar found match!",d,u,m),!0;if(m==="."||m===".."||!i.dot&&m.charAt(0)==="."){this.debug("dot detected!",e,d,t,g);break}this.debug("globstar swallow a segment, and continue"),d++}return!!(r&&(this.debug(`
|
|
43
|
-
>>> no match, partial?`,e,d,t,g),d===u))}let y;if(typeof c=="string"?(y=f===c,this.debug("string match",c,f,y)):(y=c.test(f),this.debug("pattern match",c,f,y)),!y)return!1}if(o===u&&a===l)return!0;if(o===u)return r;if(a===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return rO(this.pattern,this.options)}parse(e){Um(e);const t=this.options;if(e==="**")return Ui;if(e==="")return"";let r,i=null;(r=e.match(jU))?i=t.dot?zU:$U:(r=e.match(IU))?i=(t.nocase?t.dot?LU:PU:t.dot?OU:MU)(r[1]):(r=e.match(UU))?i=(t.nocase?t.dot?VU:HU:t.dot?GU:KU)(r):(r=e.match(FU))?i=t.dot?BU:NU:(r=e.match(qU))&&(i=WU);const s=Wr.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const e=this.set;if(!e.length)return this.regexp=!1,this.regexp;const t=this.options,r=t.noglobstar?YU:t.dot?JU:QU,i=new Set(t.nocase?["i"]:[]);let s=e.map(u=>{const l=u.map(c=>{if(c instanceof RegExp)for(const f of c.flags.split(""))i.add(f);return typeof c=="string"?iH(c):c===Ui?Ui:c._src});return l.forEach((c,f)=>{const d=l[f+1],g=l[f-1];c!==Ui||g===Ui||(g===void 0?d!==void 0&&d!==Ui?l[f+1]="(?:\\/|"+r+"\\/)?"+d:l[f]=r:d===void 0?l[f-1]=g+"(?:\\/|"+r+")?":d!==Ui&&(l[f-1]=g+"(?:\\/|\\/"+r+"\\/)"+d,l[f+1]=Ui))}),l.filter(c=>c!==Ui).join("/")}).join("|");const[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;const r=this.options;this.isWindows&&(e=e.split("\\").join("/"));const i=this.slashSplit(e);this.debug(this.pattern,"split",i);const s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<s.length;a++){const u=s[a];let l=i;if(r.matchBase&&u.length===1&&(l=[o]),this.matchOne(l,u,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return Gr.defaults(e).Minimatch}}Gr.AST=Wr;Gr.Minimatch=G1;Gr.escape=TU;Gr.unescape=td;var oh={},ah={},D3;function sH(){if(D3)return ah;D3=1,Object.defineProperty(ah,"__esModule",{value:!0}),ah.isFloat32=void 0;const n=new DataView(new ArrayBuffer(4)),e=t=>(n.setFloat32(0,t),t===n.getFloat32(0));return ah.isFloat32=e,ah}var uh={},T3;function iO(){if(T3)return uh;T3=1,Object.defineProperty(uh,"__esModule",{value:!0}),uh.JsonPackExtension=void 0;let n=class{constructor(t,r){this.tag=t,this.val=r}};return uh.JsonPackExtension=n,uh}var lh={},ch={},fh={},I3;function oH(){if(I3)return fh;I3=1,Object.defineProperty(fh,"__esModule",{value:!0}),fh.Slice=void 0;let n=class{constructor(t,r,i,s){this.uint8=t,this.view=r,this.start=i,this.end=s}subarray(){return this.uint8.subarray(this.start,this.end)}};return fh.Slice=n,fh}var M3;function sO(){if(M3)return ch;M3=1,Object.defineProperty(ch,"__esModule",{value:!0}),ch.Writer=void 0;const n=oH(),e=new Uint8Array([]),t=new DataView(e.buffer),r=typeof Buffer=="function",i=r?Buffer.prototype.utf8Write:null,s=r?Buffer.from:null,o=typeof TextEncoder<"u"?new TextEncoder:null;let a=class{constructor(l=64*1024){this.allocSize=l,this.view=t,this.x0=0,this.x=0,this.uint8=new Uint8Array(l),this.size=l,this.view=new DataView(this.uint8.buffer)}grow(l){const c=this.x0,f=this.x,d=this.uint8,g=new Uint8Array(l),m=new DataView(g.buffer),y=d.subarray(c,f);g.set(y,0),this.x=f-c,this.x0=0,this.uint8=g,this.size=l,this.view=m}ensureCapacity(l){const c=this.size,f=c-this.x;if(f<l){const d=c-this.x0,g=l-f,m=d+g;this.grow(m<=this.allocSize?this.allocSize:m*2)}}move(l){this.ensureCapacity(l),this.x+=l}reset(){this.x0=this.x}newBuffer(l){const c=this.uint8=new Uint8Array(l);this.size=l,this.view=new DataView(c.buffer),this.x=this.x0=0}flush(){const l=this.uint8.subarray(this.x0,this.x);return this.x0=this.x,l}flushSlice(){const l=new n.Slice(this.uint8,this.view,this.x0,this.x);return this.x0=this.x,l}u8(l){this.ensureCapacity(1),this.uint8[this.x++]=l}u16(l){this.ensureCapacity(2),this.view.setUint16(this.x,l),this.x+=2}u32(l){this.ensureCapacity(4),this.view.setUint32(this.x,l),this.x+=4}i32(l){this.ensureCapacity(4),this.view.setInt32(this.x,l),this.x+=4}u64(l){this.ensureCapacity(8),this.view.setBigUint64(this.x,BigInt(l)),this.x+=8}f64(l){this.ensureCapacity(8),this.view.setFloat64(this.x,l),this.x+=8}u8u16(l,c){this.ensureCapacity(3);let f=this.x;this.uint8[f++]=l,this.uint8[f++]=c>>>8,this.uint8[f++]=c&255,this.x=f}u8u32(l,c){this.ensureCapacity(5);let f=this.x;this.uint8[f++]=l,this.view.setUint32(f,c),this.x=f+4}u8u64(l,c){this.ensureCapacity(9);let f=this.x;this.uint8[f++]=l,this.view.setBigUint64(f,BigInt(c)),this.x=f+8}u8f32(l,c){this.ensureCapacity(5);let f=this.x;this.uint8[f++]=l,this.view.setFloat32(f,c),this.x=f+4}u8f64(l,c){this.ensureCapacity(9);let f=this.x;this.uint8[f++]=l,this.view.setFloat64(f,c),this.x=f+8}buf(l,c){this.ensureCapacity(c);const f=this.x;this.uint8.set(l,f),this.x=f+c}utf8(l){const c=l.length*4;if(c<168)return this.utf8Native(l);if(i){const f=i.call(this.uint8,l,this.x,c);return this.x+=f,f}else if(s){const f=this.uint8,d=f.byteOffset+this.x,m=s(f.buffer).subarray(d,d+c).write(l,0,c,"utf8");return this.x+=m,m}else if(c>1024&&o){const f=o.encodeInto(l,this.uint8.subarray(this.x,this.x+c)).written;return this.x+=f,f}return this.utf8Native(l)}utf8Native(l){const c=l.length,f=this.uint8;let d=this.x,g=0;for(;g<c;){let y=l.charCodeAt(g++);if((y&4294967168)===0){f[d++]=y;continue}else if((y&4294965248)===0)f[d++]=y>>6&31|192;else{if(y>=55296&&y<=56319&&g<c){const b=l.charCodeAt(g);(b&64512)===56320&&(g++,y=((y&1023)<<10)+(b&1023)+65536)}(y&4294901760)===0?(f[d++]=y>>12&15|224,f[d++]=y>>6&63|128):(f[d++]=y>>18&7|240,f[d++]=y>>12&63|128,f[d++]=y>>6&63|128)}f[d++]=y&63|128}const m=d-this.x;return this.x=d,m}ascii(l){const c=l.length;this.ensureCapacity(c);const f=this.uint8;let d=this.x,g=0;for(;g<c;)f[d++]=l.charCodeAt(g++);this.x=d}};return ch.Writer=a,ch}var O3;function aH(){if(O3)return lh;O3=1,Object.defineProperty(lh,"__esModule",{value:!0}),lh.CborEncoderFast=void 0;const n=sO(),e=Number.isSafeInteger;let t=class{constructor(i=new n.Writer){this.writer=i}encode(i){return this.writeAny(i),this.writer.flush()}encodeToSlice(i){return this.writeAny(i),this.writer.flushSlice()}writeAny(i){switch(typeof i){case"number":return this.writeNumber(i);case"string":return this.writeStr(i);case"boolean":return this.writer.u8(244+ +i);case"object":{if(!i)return this.writer.u8(246);switch(i.constructor){case Array:return this.writeArr(i);default:return this.writeObj(i)}}}}writeCbor(){this.writer.u8u16(217,55799)}writeEnd(){this.writer.u8(255)}writeNull(){this.writer.u8(246)}writeBoolean(i){i?this.writer.u8(245):this.writer.u8(244)}writeNumber(i){e(i)?this.writeInteger(i):typeof i=="bigint"?this.writeBigInt(i):this.writeFloat(i)}writeBigInt(i){i>=0?this.writeBigUint(i):this.writeBigSint(i)}writeBigUint(i){if(i<=Number.MAX_SAFE_INTEGER)return this.writeUInteger(Number(i));this.writer.u8u64(27,i)}writeBigSint(i){if(i>=Number.MIN_SAFE_INTEGER)return this.encodeNint(Number(i));const s=-BigInt(1)-i;this.writer.u8u64(59,s)}writeInteger(i){i>=0?this.writeUInteger(i):this.encodeNint(i)}writeUInteger(i){const s=this.writer;s.ensureCapacity(9);const o=s.uint8;let a=s.x;i<=23?o[a++]=0+i:i<=255?(o[a++]=24,o[a++]=i):i<=65535?(o[a++]=25,s.view.setUint16(a,i),a+=2):i<=4294967295?(o[a++]=26,s.view.setUint32(a,i),a+=4):(o[a++]=27,s.view.setBigUint64(a,BigInt(i)),a+=8),s.x=a}encodeNumber(i){this.writeNumber(i)}encodeInteger(i){this.writeInteger(i)}encodeUint(i){this.writeUInteger(i)}encodeNint(i){const s=-1-i,o=this.writer;o.ensureCapacity(9);const a=o.uint8;let u=o.x;s<24?a[u++]=32+s:s<=255?(a[u++]=56,a[u++]=s):s<=65535?(a[u++]=57,o.view.setUint16(u,s),u+=2):s<=4294967295?(a[u++]=58,o.view.setUint32(u,s),u+=4):(a[u++]=59,o.view.setBigUint64(u,BigInt(s)),u+=8),o.x=u}writeFloat(i){this.writer.u8f64(251,i)}writeBin(i){const s=i.length;this.writeBinHdr(s),this.writer.buf(i,s)}writeBinHdr(i){const s=this.writer;i<=23?s.u8(64+i):i<=255?s.u16(22528+i):i<=65535?s.u8u16(89,i):i<=4294967295?s.u8u32(90,i):s.u8u64(91,i)}writeStr(i){const s=this.writer,a=i.length*4;s.ensureCapacity(5+a);const u=s.uint8;let l=s.x;a<=23?s.x++:a<=255?(u[s.x++]=120,l=s.x,s.x++):a<=65535?(u[s.x++]=121,l=s.x,s.x+=2):(u[s.x++]=122,l=s.x,s.x+=4);const c=s.utf8(i);a<=23?u[l]=96+c:a<=255?u[l]=c:a<=65535?s.view.setUint16(l,c):s.view.setUint32(l,c)}writeStrHdr(i){const s=this.writer;i<=23?s.u8(96+i):i<=255?s.u16(30720+i):i<=65535?s.u8u16(121,i):s.u8u32(122,i)}writeAsciiStr(i){this.writeStrHdr(i.length),this.writer.ascii(i)}writeArr(i){const s=i.length;this.writeArrHdr(s);for(let o=0;o<s;o++)this.writeAny(i[o])}writeArrHdr(i){const s=this.writer;i<=23?s.u8(128+i):i<=255?s.u16(38912+i):i<=65535?s.u8u16(153,i):i<=4294967295?s.u8u32(154,i):s.u8u64(155,i)}writeObj(i){const s=Object.keys(i),o=s.length;this.writeObjHdr(o);for(let a=0;a<o;a++){const u=s[a];this.writeStr(u),this.writeAny(i[u])}}writeObjHdr(i){const s=this.writer;i<=23?s.u8(160+i):i<=255?s.u16(47104+i):i<=65535?s.u8u16(185,i):i<=4294967295?s.u8u32(186,i):s.u8u64(187,i)}writeMapHdr(i){this.writeObjHdr(i)}writeStartMap(){this.writer.u8(191)}writeTag(i,s){this.writeTagHdr(i),this.writeAny(s)}writeTagHdr(i){const s=this.writer;i<=23?s.u8(192+i):i<=255?s.u16(55296+i):i<=65535?s.u8u16(217,i):i<=4294967295?s.u8u32(218,i):s.u8u64(219,i)}writeTkn(i){const s=this.writer;i<=23?s.u8(224+i):i<=255&&s.u16(63488+i)}writeStartStr(){this.writer.u8(127)}writeStrChunk(i){throw new Error("Not implemented")}writeEndStr(){throw new Error("Not implemented")}writeStartBin(){this.writer.u8(95)}writeBinChunk(i){throw new Error("Not implemented")}writeEndBin(){throw new Error("Not implemented")}writeStartArr(){this.writer.u8(159)}writeArrChunk(i){throw new Error("Not implemented")}writeEndArr(){this.writer.u8(255)}writeStartObj(){this.writer.u8(191)}writeObjChunk(i,s){throw new Error("Not implemented")}writeEndObj(){this.writer.u8(255)}};return lh.CborEncoderFast=t,lh}var hh={},P3;function Ak(){if(P3)return hh;P3=1,Object.defineProperty(hh,"__esModule",{value:!0}),hh.JsonPackValue=void 0;let n=class{constructor(t){this.val=t}};return hh.JsonPackValue=n,hh}var L3;function uH(){if(L3)return oh;L3=1,Object.defineProperty(oh,"__esModule",{value:!0}),oh.CborEncoder=void 0;const n=sH(),e=iO(),t=aH(),r=Ak();let i=class extends t.CborEncoderFast{writeUnknown(o){this.writeNull()}writeAny(o){switch(typeof o){case"number":return this.writeNumber(o);case"string":return this.writeStr(o);case"boolean":return this.writer.u8(244+ +o);case"object":{if(!o)return this.writer.u8(246);switch(o.constructor){case Object:return this.writeObj(o);case Array:return this.writeArr(o);case Uint8Array:return this.writeBin(o);case Map:return this.writeMap(o);case e.JsonPackExtension:return this.writeTag(o.tag,o.val);case r.JsonPackValue:const u=o.val;return this.writer.buf(u,u.length);default:return o instanceof Uint8Array?this.writeBin(o):Array.isArray(o)?this.writeArr(o):o instanceof Map?this.writeMap(o):this.writeUnknown(o)}}case"undefined":return this.writeUndef();case"bigint":return this.writeBigInt(o);default:return this.writeUnknown(o)}}writeFloat(o){(0,n.isFloat32)(o)?this.writer.u8f32(250,o):this.writer.u8f64(251,o)}writeMap(o){this.writeMapHdr(o.size),o.forEach((a,u)=>{this.writeAny(u),this.writeAny(a)})}writeUndef(){this.writer.u8(247)}};return oh.CborEncoder=i,oh}var lH=uH(),dh={},ph={},o_=function(n,e){return o_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])},o_(n,e)};function oO(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");o_(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Hm=function(){return Hm=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Hm.apply(this,arguments)};function aO(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function uO(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s}function lO(n,e){return function(t,r){e(t,r,n)}}function cO(n,e,t,r,i,s){function o(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=r.kind,u=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&n?r.static?n:n.prototype:null,c=e||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),f,d=!1,g=t.length-1;g>=0;g--){var m={};for(var y in r)m[y]=y==="access"?{}:r[y];for(var y in r.access)m.access[y]=r.access[y];m.addInitializer=function(w){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(w||null))};var b=(0,t[g])(a==="accessor"?{get:c.get,set:c.set}:c[u],m);if(a==="accessor"){if(b===void 0)continue;if(b===null||typeof b!="object")throw new TypeError("Object expected");(f=o(b.get))&&(c.get=f),(f=o(b.set))&&(c.set=f),(f=o(b.init))&&i.unshift(f)}else(f=o(b))&&(a==="field"?i.unshift(f):c[u]=f)}l&&Object.defineProperty(l,r.name,c),d=!0}function fO(n,e,t){for(var r=arguments.length>2,i=0;i<e.length;i++)t=r?e[i].call(n,t):e[i].call(n);return r?t:void 0}function hO(n){return typeof n=="symbol"?n:"".concat(n)}function dO(n,e,t){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(n,"name",{configurable:!0,value:t?"".concat(t," ",e):e})}function pO(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)}function gO(n,e,t,r){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(c){try{l(r.next(c))}catch(f){o(f)}}function u(c){try{l(r.throw(c))}catch(f){o(f)}}function l(c){c.done?s(c.value):i(c.value).then(a,u)}l((r=r.apply(n,e||[])).next())})}function mO(n,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(t=0)),t;)try{if(r=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,i=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){t.label=l[1];break}if(l[0]===6&&t.label<s[1]){t.label=s[1],s=l;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(l);break}s[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(n,t)}catch(c){l=[6,c],i=0}finally{r=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var K1=Object.create?function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]};function yO(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&K1(e,n,t)}function Vm(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Rk(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return s}function vO(){for(var n=[],e=0;e<arguments.length;e++)n=n.concat(Rk(arguments[e]));return n}function bO(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var r=Array(n),i=0,e=0;e<t;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)r[i]=s[o];return r}function wO(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return n.concat(s||Array.prototype.slice.call(e))}function Nc(n){return this instanceof Nc?(this.v=n,this):new Nc(n)}function _O(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(g){return function(m){return Promise.resolve(m).then(g,f)}}function a(g,m){r[g]&&(i[g]=function(y){return new Promise(function(b,w){s.push([g,y,b,w])>1||u(g,y)})},m&&(i[g]=m(i[g])))}function u(g,m){try{l(r[g](m))}catch(y){d(s[0][3],y)}}function l(g){g.value instanceof Nc?Promise.resolve(g.value.v).then(c,f):d(s[0][2],g)}function c(g){u("next",g)}function f(g){u("throw",g)}function d(g,m){g(m),s.shift(),s.length&&u(s[0][0],s[0][1])}}function kO(n){var e,t;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,s){e[i]=n[i]?function(o){return(t=!t)?{value:Nc(n[i](o)),done:!1}:s?s(o):o}:s}}function xO(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof Vm=="function"?Vm(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(s){t[s]=n[s]&&function(o){return new Promise(function(a,u){o=n[s](o),i(a,u,o.done,o.value)})}}function i(s,o,a,u){Promise.resolve(u).then(function(l){s({value:l,done:a})},o)}}function SO(n,e){return Object.defineProperty?Object.defineProperty(n,"raw",{value:e}):n.raw=e,n}var cH=Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e},a_=function(n){return a_=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},a_(n)};function CO(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t=a_(n),r=0;r<t.length;r++)t[r]!=="default"&&K1(e,n,t[r]);return cH(e,n),e}function EO(n){return n&&n.__esModule?n:{default:n}}function AO(n,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(n):r?r.value:e.get(n)}function RO(n,e,t,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(n,t):i?i.value=t:e.set(n,t),t}function DO(n,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?e===n:n.has(e)}function TO(n,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var r,i;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],t&&(i=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");i&&(r=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),n.stack.push({value:e,dispose:r,async:t})}else t&&n.stack.push({async:!0});return e}var fH=typeof SuppressedError=="function"?SuppressedError:function(n,e,t){var r=new Error(t);return r.name="SuppressedError",r.error=n,r.suppressed=e,r};function IO(n){function e(s){n.error=n.hasError?new fH(s,n.error,"An error was suppressed during disposal."):s,n.hasError=!0}var t,r=0;function i(){for(;t=n.stack.pop();)try{if(!t.async&&r===1)return r=0,n.stack.push(t),Promise.resolve().then(i);if(t.dispose){var s=t.dispose.call(t.value);if(t.async)return r|=2,Promise.resolve(s).then(i,function(o){return e(o),i()})}else r|=1}catch(o){e(o)}if(r===1)return n.hasError?Promise.reject(n.error):Promise.resolve();if(n.hasError)throw n.error}return i()}function MO(n,e){return typeof n=="string"&&/^\.\.?\//.test(n)?n.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(t,r,i,s,o){return r?e?".jsx":".js":i&&(!s||!o)?t:i+s+"."+o.toLowerCase()+"js"}):n}const hH={__extends:oO,__assign:Hm,__rest:aO,__decorate:uO,__param:lO,__esDecorate:cO,__runInitializers:fO,__propKey:hO,__setFunctionName:dO,__metadata:pO,__awaiter:gO,__generator:mO,__createBinding:K1,__exportStar:yO,__values:Vm,__read:Rk,__spread:vO,__spreadArrays:bO,__spreadArray:wO,__await:Nc,__asyncGenerator:_O,__asyncDelegator:kO,__asyncValues:xO,__makeTemplateObject:SO,__importStar:CO,__importDefault:EO,__classPrivateFieldGet:AO,__classPrivateFieldSet:RO,__classPrivateFieldIn:DO,__addDisposableResource:TO,__disposeResources:IO,__rewriteRelativeImportExtension:MO},dH=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:TO,get __assign(){return Hm},__asyncDelegator:kO,__asyncGenerator:_O,__asyncValues:xO,__await:Nc,__awaiter:gO,__classPrivateFieldGet:AO,__classPrivateFieldIn:DO,__classPrivateFieldSet:RO,__createBinding:K1,__decorate:uO,__disposeResources:IO,__esDecorate:cO,__exportStar:yO,__extends:oO,__generator:mO,__importDefault:EO,__importStar:CO,__makeTemplateObject:SO,__metadata:pO,__param:lO,__propKey:hO,__read:Rk,__rest:aO,__rewriteRelativeImportExtension:MO,__runInitializers:fO,__setFunctionName:dO,__spread:vO,__spreadArray:wO,__spreadArrays:bO,__values:Vm,default:hH},Symbol.toStringTag,{value:"Module"})),Z1=W1(dH);var gh={},F3;function pH(){if(F3)return gh;F3=1,Object.defineProperty(gh,"__esModule",{value:!0}),gh.decodeF16=void 0;const n=Math.pow,e=t=>{const r=(t&31744)>>10,i=t&1023;return(t>>15?-1:1)*(r?r===31?i?NaN:1/0:n(2,r-15)*(1+i/1024):6103515625e-14*(i/1024))};return gh.decodeF16=e,gh}var mh={},yh={},Xg={},Mu={},N3;function gH(){if(N3)return Mu;N3=1,Object.defineProperty(Mu,"__esModule",{value:!0}),Mu.decodeAsciiMax15=Mu.decodeAscii=void 0;const n=String.fromCharCode,e=(r,i,s)=>{const o=[];for(let a=0;a<s;a++){const u=r[i++];if(u&128)return;o.push(u)}return n.apply(String,o)};Mu.decodeAscii=e;const t=(r,i,s)=>{if(s<4)if(s<2){if(s===0)return"";{const o=r[i++];if((o&128)>1){i-=1;return}return n(o)}}else{const o=r[i++],a=r[i++];if((o&128)>0||(a&128)>0){i-=2;return}if(s<3)return n(o,a);const u=r[i++];if((u&128)>0){i-=3;return}return n(o,a,u)}else{const o=r[i++],a=r[i++],u=r[i++],l=r[i++];if((o&128)>0||(a&128)>0||(u&128)>0||(l&128)>0){i-=4;return}if(s<6){if(s===4)return n(o,a,u,l);{const c=r[i++];if((c&128)>0){i-=5;return}return n(o,a,u,l,c)}}else if(s<8){const c=r[i++],f=r[i++];if((c&128)>0||(f&128)>0){i-=6;return}if(s<7)return n(o,a,u,l,c,f);const d=r[i++];if((d&128)>0){i-=7;return}return n(o,a,u,l,c,f,d)}else{const c=r[i++],f=r[i++],d=r[i++],g=r[i++];if((c&128)>0||(f&128)>0||(d&128)>0||(g&128)>0){i-=8;return}if(s<10){if(s===8)return n(o,a,u,l,c,f,d,g);{const m=r[i++];if((m&128)>0){i-=9;return}return n(o,a,u,l,c,f,d,g,m)}}else if(s<12){const m=r[i++],y=r[i++];if((m&128)>0||(y&128)>0){i-=10;return}if(s<11)return n(o,a,u,l,c,f,d,g,m,y);const b=r[i++];if((b&128)>0){i-=11;return}return n(o,a,u,l,c,f,d,g,m,y,b)}else{const m=r[i++],y=r[i++],b=r[i++],w=r[i++];if((m&128)>0||(y&128)>0||(b&128)>0||(w&128)>0){i-=12;return}if(s<14){if(s===12)return n(o,a,u,l,c,f,d,g,m,y,b,w);{const x=r[i++];if((x&128)>0){i-=13;return}return n(o,a,u,l,c,f,d,g,m,y,b,w,x)}}else{const x=r[i++],_=r[i++];if((x&128)>0||(_&128)>0){i-=14;return}if(s<15)return n(o,a,u,l,c,f,d,g,m,y,b,w,x,_);const S=r[i++];if((S&128)>0){i-=15;return}return n(o,a,u,l,c,f,d,g,m,y,b,w,x,_,S)}}}}};return Mu.decodeAsciiMax15=t,Mu}var Yg={},B3;function mH(){if(B3)return Yg;B3=1,Object.defineProperty(Yg,"__esModule",{value:!0});const n=String.fromCharCode;return Yg.default=(e,t,r)=>{let i=t;const s=i+r,o=[];for(;i<s;){let a=e[i++];if((a&128)!==0){const u=e[i++]&63;if((a&224)===192)a=(a&31)<<6|u;else{const l=e[i++]&63;if((a&240)===224)a=(a&31)<<12|u<<6|l;else if((a&248)===240){const c=e[i++]&63;let f=(a&7)<<18|u<<12|l<<6|c;if(f>65535){f-=65536;const d=f>>>10&1023|55296;a=56320|f&1023,o.push(d)}else a=f}}}o.push(a)}return n.apply(String,o)},Yg}var q3;function yH(){if(q3)return Xg;q3=1,Object.defineProperty(Xg,"__esModule",{value:!0});const n=Z1,e=gH(),t=n.__importDefault(mH()),r=typeof Buffer<"u",i=r?Buffer.prototype.utf8Slice:null,s=r?Buffer.from:null,o=(c,f,d)=>(0,e.decodeAsciiMax15)(c,f,d)??(0,t.default)(c,f,d),a=(c,f,d)=>(0,e.decodeAscii)(c,f,d)??(0,t.default)(c,f,d),u=i?(c,f,d)=>i.call(c,f,f+d):s?(c,f,d)=>s(c).subarray(f,f+d).toString("utf8"):t.default,l=(c,f,d)=>d<16?o(c,f,d):d<32?a(c,f,d):u(c,f,d);return Xg.default=l,Xg}var W3;function vH(){if(W3)return yh;W3=1,Object.defineProperty(yh,"__esModule",{value:!0}),yh.decodeUtf8=void 0;const e=Z1.__importDefault(yH());return yh.decodeUtf8=e.default,yh}var j3;function bH(){if(j3)return mh;j3=1,Object.defineProperty(mh,"__esModule",{value:!0}),mh.Reader=void 0;const n=vH();let e=class{constructor(){this.uint8=new Uint8Array([]),this.view=new DataView(this.uint8.buffer),this.x=0}reset(r){this.x=0,this.uint8=r,this.view=new DataView(r.buffer,r.byteOffset,r.length)}peak(){return this.view.getUint8(this.x)}skip(r){this.x+=r}buf(r){const i=this.x+r,s=this.uint8.subarray(this.x,i);return this.x=i,s}u8(){return this.uint8[this.x++]}i8(){return this.view.getInt8(this.x++)}u16(){let r=this.x;const i=(this.uint8[r++]<<8)+this.uint8[r++];return this.x=r,i}i16(){const r=this.view.getInt16(this.x);return this.x+=2,r}u32(){const r=this.view.getUint32(this.x);return this.x+=4,r}i32(){const r=this.view.getInt32(this.x);return this.x+=4,r}u64(){const r=this.view.getBigUint64(this.x);return this.x+=8,r}i64(){const r=this.view.getBigInt64(this.x);return this.x+=8,r}f32(){const r=this.x;return this.x+=4,this.view.getFloat32(r)}f64(){const r=this.x;return this.x+=8,this.view.getFloat64(r)}utf8(r){const i=this.x;return this.x+=r,(0,n.decodeUtf8)(this.uint8,i,r)}ascii(r){const i=this.uint8;let s="";const o=this.x+r;for(let a=this.x;a<o;a++)s+=String.fromCharCode(i[a]);return this.x=o,s}};return mh.Reader=e,mh}var Jg={},vh={},Qg={},$3;function wH(){if($3)return Qg;$3=1,Object.defineProperty(Qg,"__esModule",{value:!0});const n=String.fromCharCode;return Qg.default=(e,t,r)=>{let i=t;const s=i+r;let o="";for(;i<s;){const a=e[i++];if((a&128)===0){o+=n(a);continue}const u=e[i++]&63;if((a&224)===192){o+=n((a&31)<<6|u);continue}const l=e[i++]&63;if((a&240)===224){o+=n((a&31)<<12|u<<6|l);continue}if((a&248)===240){const c=e[i++]&63;let f=(a&7)<<18|u<<12|l<<6|c;if(f>65535){f-=65536;const d=f>>>10&1023|55296;f=56320|f&1023,o+=n(d,f)}else o+=n(f)}else o+=n(a)}return o},Qg}var z3;function _H(){if(z3)return vh;z3=1,Object.defineProperty(vh,"__esModule",{value:!0}),vh.CachedUtf8Decoder=void 0;const e=Z1.__importDefault(wH());let t=1+Math.round(Math.random()*((-1>>>0)-1));function r(o,a){return t^=t<<13,t^=t>>>17,t^=t<<5,(t>>>0)%(a-o+1)+o}class i{constructor(a,u){this.bytes=a,this.value=u}}let s=class{constructor(){this.caches=[];for(let a=0;a<31;a++)this.caches.push([])}get(a,u,l){const c=this.caches[l-1],f=c.length;e:for(let d=0;d<f;d++){const g=c[d],m=g.bytes;for(let y=0;y<l;y++)if(m[y]!==a[u+y])continue e;return g.value}return null}store(a,u){const l=this.caches[a.length-1],c=new i(a,u);l.length>=16?l[r(0,15)]=c:l.push(c)}decode(a,u,l){if(!l)return"";const c=this.get(a,u,l);if(c!==null)return c;const f=(0,e.default)(a,u,l),d=Uint8Array.prototype.slice.call(a,u,u+l);return this.store(d,f),f}};return vh.CachedUtf8Decoder=s,vh}var U3;function kH(){if(U3)return Jg;U3=1,Object.defineProperty(Jg,"__esModule",{value:!0});const n=_H();return Jg.default=new n.CachedUtf8Decoder,Jg}var H3;function xH(){if(H3)return ph;H3=1,Object.defineProperty(ph,"__esModule",{value:!0}),ph.CborDecoderBase=void 0;const n=Z1,e=pH(),t=iO(),r=Ak(),i=bH(),s=n.__importDefault(kH());let o=class{constructor(u=new i.Reader,l=s.default){this.reader=u,this.keyDecoder=l}read(u){return this.reader.reset(u),this.val()}decode(u){return this.reader.reset(u),this.val()}val(){const l=this.reader.u8(),c=l>>5,f=l&31;return c<4?c<2?c===0?this.readUint(f):this.readNint(f):c===2?this.readBin(f):this.readStr(f):c<6?c===4?this.readArr(f):this.readObj(f):c===6?this.readTag(f):this.readTkn(f)}readAnyRaw(u){const l=u>>5,c=u&31;return l<4?l<2?l===0?this.readUint(c):this.readNint(c):l===2?this.readBin(c):this.readStr(c):l<6?l===4?this.readArr(c):this.readObj(c):l===6?this.readTag(c):this.readTkn(c)}readMinorLen(u){if(u<24)return u;switch(u){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());case 31:return-1;default:throw 1}}readUint(u){if(u<25)return u===24?this.reader.u8():u;if(u<27)return u===25?this.reader.u16():this.reader.u32();{const l=this.reader.u64();return l>9007199254740991?l:Number(l)}}readNint(u){if(u<25)return u===24?-this.reader.u8()-1:-u-1;if(u<27)return u===25?-this.reader.u16()-1:-this.reader.u32()-1;{const l=this.reader.u64();return l>9007199254740991-1?-l-BigInt(1):-Number(l)-1}}readBin(u){const l=this.reader;if(u<=23)return l.buf(u);switch(u){case 24:return l.buf(l.u8());case 25:return l.buf(l.u16());case 26:return l.buf(l.u32());case 27:return l.buf(Number(l.u64()));case 31:{let c=0;const f=[];for(;this.reader.peak()!==255;){const y=this.readBinChunk();c+=y.length,f.push(y)}this.reader.x++;const d=new Uint8Array(c);let g=0;const m=f.length;for(let y=0;y<m;y++){const b=f[y];d.set(b,g),g+=b.length}return d}default:throw 1}}readBinChunk(){const u=this.reader.u8(),l=u>>5,c=u&31;if(l!==2)throw 2;if(c>27)throw 3;return this.readBin(c)}readAsStr(){const l=this.reader.u8(),c=l>>5,f=l&31;if(c!==3)throw 11;return this.readStr(f)}readStr(u){const l=this.reader;if(u<=23)return l.utf8(u);switch(u){case 24:return l.utf8(l.u8());case 25:return l.utf8(l.u16());case 26:return l.utf8(l.u32());case 27:return l.utf8(Number(l.u64()));case 31:{let c="";for(;l.peak()!==255;)c+=this.readStrChunk();return this.reader.x++,c}default:throw 1}}readStrLen(u){if(u<=23)return u;switch(u){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());default:throw 1}}readStrChunk(){const u=this.reader.u8(),l=u>>5,c=u&31;if(l!==3)throw 4;if(c>27)throw 5;return this.readStr(c)}readArr(u){const l=this.readMinorLen(u);return l>=0?this.readArrRaw(l):this.readArrIndef()}readArrRaw(u){const l=[];for(let c=0;c<u;c++)l.push(this.val());return l}readArrIndef(){const u=[];for(;this.reader.peak()!==255;)u.push(this.val());return this.reader.x++,u}readObj(u){if(u<28){let l=u;switch(u){case 24:l=this.reader.u8();break;case 25:l=this.reader.u16();break;case 26:l=this.reader.u32();break;case 27:l=Number(this.reader.u64());break}const c={};for(let f=0;f<l;f++){const d=this.key();if(d==="__proto__")throw 6;const g=this.val();c[d]=g}return c}else{if(u===31)return this.readObjIndef();throw 1}}readObjRaw(u){const l={};for(let c=0;c<u;c++){const f=this.key(),d=this.val();l[f]=d}return l}readObjIndef(){const u={};for(;this.reader.peak()!==255;){const l=this.key();if(this.reader.peak()===255)throw 7;const c=this.val();u[l]=c}return this.reader.x++,u}key(){const u=this.reader.u8(),l=u>>5,c=u&31;if(l!==3)return String(this.readAnyRaw(u));const f=this.readStrLen(c);if(f>31)return this.reader.utf8(f);const d=this.keyDecoder.decode(this.reader.uint8,this.reader.x,f);return this.reader.skip(f),d}readTag(u){if(u<=23)return this.readTagRaw(u);switch(u){case 24:return this.readTagRaw(this.reader.u8());case 25:return this.readTagRaw(this.reader.u16());case 26:return this.readTagRaw(this.reader.u32());case 27:return this.readTagRaw(Number(this.reader.u64()));default:throw 1}}readTagRaw(u){return new t.JsonPackExtension(u,this.val())}readTkn(u){switch(u){case 20:return!1;case 21:return!0;case 22:return null;case 23:return;case 24:return new r.JsonPackValue(this.reader.u8());case 25:return this.f16();case 26:return this.reader.f32();case 27:return this.reader.f64()}if(u<=23)return new r.JsonPackValue(u);throw 1}f16(){return(0,e.decodeF16)(this.reader.u16())}};return ph.CborDecoderBase=o,ph}var V3;function SH(){if(V3)return dh;V3=1,Object.defineProperty(dh,"__esModule",{value:!0}),dh.CborDecoder=void 0;const n=xH(),e=Ak();let t=class extends n.CborDecoderBase{readAsMap(){const i=this.reader.u8(),s=i>>5,o=i&31;switch(s){case 5:return this.readMap(o);default:throw 0}}readMap(i){const s=this.readMinorLen(i);return s>=0?this.readMapRaw(s):this.readMapIndef()}readMapRaw(i){const s=new Map;for(let o=0;o<i;o++){const a=this.val(),u=this.val();s.set(a,u)}return s}readMapIndef(){const i=new Map;for(;this.reader.peak()!==255;){const s=this.val();if(this.reader.peak()===255)throw 7;const o=this.val();i.set(s,o)}return this.reader.x++,i}skipN(i){for(let s=0;s<i;s++)this.skipAny()}skipAny(){this.skipAnyRaw(this.reader.u8())}skipAnyRaw(i){const s=i>>5,o=i&31;switch(s){case 0:case 1:this.skipUNint(o);break;case 2:this.skipBin(o);break;case 3:this.skipStr(o);break;case 4:this.skipArr(o);break;case 5:this.skipObj(o);break;case 7:this.skipTkn(o);break;case 6:this.skipTag(o);break}}skipMinorLen(i){if(i<=23)return i;switch(i){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());case 31:return-1;default:throw 1}}skipUNint(i){if(!(i<=23))switch(i){case 24:return this.reader.skip(1);case 25:return this.reader.skip(2);case 26:return this.reader.skip(4);case 27:return this.reader.skip(8);default:throw 1}}skipBin(i){const s=this.skipMinorLen(i);if(s>=0)this.reader.skip(s);else{for(;this.reader.peak()!==255;)this.skipBinChunk();this.reader.x++}}skipBinChunk(){const i=this.reader.u8(),s=i>>5,o=i&31;if(s!==2)throw 2;if(o>27)throw 3;this.skipBin(o)}skipStr(i){const s=this.skipMinorLen(i);if(s>=0)this.reader.skip(s);else{for(;this.reader.peak()!==255;)this.skipStrChunk();this.reader.x++}}skipStrChunk(){const i=this.reader.u8(),s=i>>5,o=i&31;if(s!==3)throw 4;if(o>27)throw 5;this.skipStr(o)}skipArr(i){const s=this.skipMinorLen(i);if(s>=0)this.skipN(s);else{for(;this.reader.peak()!==255;)this.skipAny();this.reader.x++}}skipObj(i){const s=this.readMinorLen(i);if(s>=0)return this.skipN(s*2);for(;this.reader.peak()!==255;){if(this.skipAny(),this.reader.peak()===255)throw 7;this.skipAny()}this.reader.x++}skipTag(i){if(this.skipMinorLen(i)<0)throw 1;this.skipAny()}skipTkn(i){switch(i){case 24:this.reader.skip(1);return;case 25:this.reader.skip(2);return;case 26:this.reader.skip(4);return;case 27:this.reader.skip(8);return}if(!(i<=23))throw 1}validate(i,s=0,o=i.length){this.reader.reset(i),this.reader.x=s;const a=s;if(this.skipAny(),this.reader.x-a!==o)throw 8}decodeLevel(i){return this.reader.reset(i),this.readLevel()}readLevel(){const i=this.reader.u8(),s=i>>5,o=i&31;switch(s){case 4:return this.readArrLevel(o);case 5:return this.readObjLevel(o);default:return super.readAnyRaw(i)}}readPrimitiveOrVal(){switch(this.reader.peak()>>5){case 4:case 5:return this.readAsValue();default:return this.val()}}readAsValue(){const i=this.reader,s=i.x;this.skipAny();const o=i.x;return new e.JsonPackValue(i.uint8.subarray(s,o))}readObjLevel(i){const s=this.readMinorLen(i);return s>=0?this.readObjRawLevel(s):this.readObjIndefLevel()}readObjRawLevel(i){const s={};for(let o=0;o<i;o++){const a=this.key(),u=this.readPrimitiveOrVal();s[a]=u}return s}readObjIndefLevel(){const i={};for(;this.reader.peak()!==255;){const s=this.key();if(this.reader.peak()===255)throw 7;const o=this.readPrimitiveOrVal();i[s]=o}return this.reader.x++,i}readArrLevel(i){const s=this.readMinorLen(i);return s>=0?this.readArrRawLevel(s):this.readArrIndefLevel()}readArrRawLevel(i){const s=[];for(let o=0;o<i;o++)s.push(this.readPrimitiveOrVal());return s}readArrIndefLevel(){const i=[];for(;this.reader.peak()!==255;)i.push(this.readPrimitiveOrVal());return this.reader.x++,i}readHdr(i){const s=this.reader.u8();if(s>>5!==i)throw 0;const a=s&31;if(a<24)return a;switch(a){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());case 31:return-1}throw 1}readStrHdr(){return this.readHdr(3)}readObjHdr(){return this.readHdr(5)}readArrHdr(){return this.readHdr(4)}findKey(i){const s=this.readObjHdr();for(let o=0;o<s;o++){if(this.key()===i)return this;this.skipAny()}throw 9}findIndex(i){const s=this.readArrHdr();if(i>=s)throw 10;for(let o=0;o<i;o++)this.skipAny();return this}find(i){for(let s=0;s<i.length;s++){const o=i[s];typeof o=="string"?this.findKey(o):this.findIndex(o)}return this}};return dh.CborDecoder=t,dh}var CH=SH(),EH=sO();const AH=new EH.Writer(1024*32);new lH.CborEncoder(AH);const RH=new CH.CborDecoder,DH=typeof process<"u"&&process.versions?.node,OO=n=>n.length>=2&&n[0]===31&&n[1]===139,TH=async n=>{if(console.debug("decompressData: Starting decompression, data length:",n.length),console.debug("decompressData: First few bytes:",Array.from(n.slice(0,10)).map(e=>"0x"+e.toString(16).padStart(2,"0")).join(" ")),!OO(n))return console.debug("decompressData: Data does not appear to be gzip compressed, returning as-is"),n;if(console.debug("decompressData: Data appears to be gzip compressed"),DH){console.debug("decompressData: Using Node.js zlib");const{gunzip:e}=await mt(async()=>{const{gunzip:s}=await Promise.resolve().then(()=>w3);return{gunzip:s}},void 0),{promisify:t}=await mt(async()=>{const{promisify:s}=await Promise.resolve().then(()=>w3);return{promisify:s}},void 0),r=t(e),i=new Uint8Array(await r(n));return console.debug("decompressData: Node.js decompression successful, result length:",i.length),i}else{if(console.debug("decompressData: Using browser DecompressionStream"),typeof DecompressionStream>"u")return console.warn("decompressData: DecompressionStream not available, assuming uncompressed data"),n;try{const e=new DecompressionStream("gzip"),t=e.writable.getWriter(),r=e.readable.getReader();console.debug("decompressData: Writing data to decompression stream"),t.write(new Uint8Array(n)),t.close();const i=[];let s=!1;for(console.debug("decompressData: Reading decompressed chunks");!s;){const{value:l,done:c}=await r.read();s=c,l&&(console.debug("decompressData: Received chunk of length:",l.length),i.push(l))}const o=i.reduce((l,c)=>l+c.length,0);console.debug("decompressData: Total decompressed length:",o);const a=new Uint8Array(o);let u=0;for(const l of i)a.set(l,u),u+=l.length;return console.debug("decompressData: Browser decompression successful"),a}catch(e){return console.warn("decompressData: Browser decompression failed, returning original data:",e),n}}};typeof process<"u"&&process.cwd();var G3;(n=>{n.take=async({fs:e,path:t,filter:r,separator:i="/"})=>{if(r&&!await r(t))return null;const s=await e.stat(t);if(s.isDirectory()){const o=await e.readdir(t),a={},u=t.endsWith(i)?t:t+i;for(const l of o){const c=await n.take({fs:e,path:`${u}${l}`,separator:i,filter:r});c&&(a[l]=c)}return[0,{},a]}else if(s.isFile()){const o=await e.readFile(t),a=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);return[1,s,a]}else if(s.isSymbolicLink())return[2,{target:await e.readlink(t,{encoding:"utf8"})}];return null},n.mount=async(e,{fs:t,path:r="/",separator:i="/"})=>{try{console.debug("Snapshot.mount: Starting mount process"),console.debug("Snapshot.mount: Buffer type:",typeof e),console.debug("Snapshot.mount: Buffer length:",e?.byteLength||e?.length||"unknown"),console.debug("Snapshot.mount: Buffer constructor:",e?.constructor?.name);const s=e instanceof Uint8Array?e:new Uint8Array(e);console.debug("Snapshot.mount: Converted to Uint8Array, length:",s.length);const o=OO(s);console.debug("Snapshot.mount: Data appears compressed:",o);let a;try{a=await TH(s),console.debug("Snapshot.mount: Successfully processed buffer, decompressed length:",a.length)}catch(l){console.warn("Snapshot.mount: Decompression failed, using original buffer:",l),a=s}console.debug("Snapshot.mount: Attempting to decode CBOR data...");const u=await RH.decode(a);console.debug("Snapshot.mount: Successfully decoded snapshot, type:",typeof u),console.debug("Snapshot.mount: Snapshot structure:",Array.isArray(u)?`Array[${u.length}]`:u),u?(console.debug("Snapshot.mount: Starting fromSnapshot process..."),await PO(u,{fs:t,path:r,separator:i}),console.debug("Snapshot.mount: Successfully mounted snapshot")):console.warn("Snapshot.mount: Decoded snapshot is null or undefined")}catch(s){throw console.error("Snapshot.mount: Failed to mount snapshot:",s),s}},n.loadAndMount=async(e,{fs:t,path:r="/",separator:i="/"})=>{try{console.debug("Snapshot.loadAndMount: Starting direct load from URL:",e);const s=await fetch(e);if(!s.ok)throw new Error(`Failed to fetch snapshot: ${s.status} ${s.statusText}`);console.debug("Snapshot.loadAndMount: Response received, content-length:",s.headers.get("content-length"));const o=await s.arrayBuffer(),a=new Uint8Array(o);console.debug("Snapshot.loadAndMount: Downloaded buffer length:",a.length),await n.mount(a,{fs:t,path:r,separator:i})}catch(s){throw console.error("Snapshot.loadAndMount: Failed to load and mount snapshot:",s),s}}})(G3||(G3={}));const PO=async(n,{fs:e,path:t="/",separator:r="/"})=>{if(n)switch(n[0]){case 0:{t.endsWith(r)||(t=t+r);const[,,i]=n;e.mkdirSync(t,{recursive:!0});for(const[s,o]of Object.entries(i))await PO(o,{fs:e,path:`${t}${s}`,separator:r});break}case 1:{const[,,i]=n;e.writeFileSync(t,i);break}case 2:{const[,{target:i}]=n;e.symlinkSync(i,t);break}}},IH=(n,e=1024)=>{const t=n.split(/\r?\n/,e).filter(l=>l.trim().length>0),r={};let i=new Set,s=0,o=0,a=" ";for(const l of t){const c=l.match(/^(\s+)/);if(!c)continue;const f=c[0];f.includes(" ")?s++:o++,i.add(f),r[f]=(r[f]||0)+1}if(Object.keys(r).length===0)return null;a=s>o?" ":" ";const u=Array.from(i).filter(l=>l.startsWith(a)).map(l=>l.length);if(u.length>0){const l=(...f)=>f.reduce((d,g)=>g===0?d:l(g,d%g)),c=l(...u);return a.repeat(c)}return null};class LO{constructor(e,t,r,i){this.state=e,this.pos=t,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=lr(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),r=Math.max(t.from,this.pos-250),i=t.text.slice(r-t.from,this.pos-t.from),s=i.search(FO(e,!1));return s<0?null:{from:r+s,to:this.pos,text:i.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function K3(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function MH(n){let e=Object.create(null),t=Object.create(null);for(let{label:i}of n){e[i[0]]=!0;for(let s=1;s<i.length;s++)t[i[s]]=!0}let r=K3(e)+K3(t)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function OH(n){let e=n.map(i=>typeof i=="string"?{label:i}:i),[t,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:MH(e);return i=>{let s=i.matchBefore(r);return s||i.explicit?{from:s?s.from:i.pos,options:e,validFor:t}:null}}function uoe(n,e){return t=>{for(let r=lr(t.state).resolveInner(t.pos,-1);r;r=r.parent){if(n.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(t)}}class Z3{constructor(e,t,r,i){this.completion=e,this.source=t,this.match=r,this.score=i}}function sl(n){return n.selection.main.from}function FO(n,e){var t;let{source:r}=n,i=e&&r[0]!="^",s=r[r.length-1]!="$";return!i&&!s?n:new RegExp(`${i?"^":""}(?:${r})${s?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const Dk=ma.define();function u_(n,e,t,r){let{main:i}=n.selection,s=t-i.from,o=r-i.from;return Object.assign(Object.assign({},n.changeByRange(a=>{if(a!=i&&t!=r&&n.sliceDoc(a.from+s,a.from+o)!=n.sliceDoc(t,r))return{range:a};let u=n.toText(e);return{changes:{from:a.from+s,to:r==i.from?a.to:a.from+o,insert:u},range:me.cursor(a.from+s+u.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}const X3=new WeakMap;function PH(n){if(!Array.isArray(n))return n;let e=X3.get(n);return e||X3.set(n,e=OH(n)),e}const Gm=Ve.define(),Dd=Ve.define();class LH{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let r=oi(e,t),i=so(r);this.chars.push(r);let s=e.slice(t,t+i),o=s.toUpperCase();this.folded.push(oi(o==s?s.toLowerCase():o,0)),t+=i}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:r,any:i,precise:s,byWord:o}=this;if(t.length==1){let x=oi(e,0),_=so(x),S=_==e.length?0:-100;if(x!=t[0])if(x==r[0])S+=-200;else return null;return this.ret(S,[0,_])}let a=e.indexOf(this.pattern);if(a==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let u=t.length,l=0;if(a<0){for(let x=0,_=Math.min(e.length,200);x<_&&l<u;){let S=oi(e,x);(S==t[l]||S==r[l])&&(i[l++]=x),x+=so(S)}if(l<u)return null}let c=0,f=0,d=!1,g=0,m=-1,y=-1,b=/[a-z]/.test(e),w=!0;for(let x=0,_=Math.min(e.length,200),S=0;x<_&&f<u;){let C=oi(e,x);a<0&&(c<u&&C==t[c]&&(s[c++]=x),g<u&&(C==t[g]||C==r[g]?(g==0&&(m=x),y=x+1,g++):g=0));let A,I=C<255?C>=48&&C<=57||C>=97&&C<=122?2:C>=65&&C<=90?1:0:(A=Q2(C))!=A.toLowerCase()?1:A!=A.toUpperCase()?2:0;(!x||I==1&&b||S==0&&I!=0)&&(t[f]==C||r[f]==C&&(d=!0)?o[f++]=x:o.length&&(w=!1)),S=I,x+=so(C)}return f==u&&o[0]==0&&w?this.result(-100+(d?-200:0),o,e):g==u&&m==0?this.ret(-200-e.length+(y==e.length?0:-100),[0,y]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):g==u?this.ret(-900-e.length,[m,y]):f==u?this.result(-100+(d?-200:0)+-700+(w?0:-1100),o,e):t.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,t,r){let i=[],s=0;for(let o of t){let a=o+(this.astral?so(oi(r,o)):1);s&&i[s-1]==o?i[s-1]=a:(i[s++]=o,i[s++]=a)}return this.ret(e-r.length,i)}}class FH{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),r=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return r==null?null:(this.matched=[0,t.length],this.score=r+(e.length==this.pattern.length?0:-100),this)}}const Vn=Re.define({combine(n){return So(n,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:NH,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>r=>Y3(e(r),t(r)),optionClass:(e,t)=>r=>Y3(e(r),t(r)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function Y3(n,e){return n?e?n+" "+e:n:e}function NH(n,e,t,r,i,s){let o=n.textDirection==nn.RTL,a=o,u=!1,l="top",c,f,d=e.left-i.left,g=i.right-e.right,m=r.right-r.left,y=r.bottom-r.top;if(a&&d<Math.min(m,g)?a=!1:!a&&g<Math.min(m,d)&&(a=!0),m<=(a?d:g))c=Math.max(i.top,Math.min(t.top,i.bottom-y))-e.top,f=Math.min(400,a?d:g);else{u=!0,f=Math.min(400,(o?e.right:i.right-e.left)-30);let x=i.bottom-e.bottom;x>=y||x>e.top?c=t.bottom-e.top:(l="bottom",c=e.bottom-t.top)}let b=(e.bottom-e.top)/s.offsetHeight,w=(e.right-e.left)/s.offsetWidth;return{style:`${l}: ${c/b}px; max-width: ${f/w}px`,class:"cm-completionInfo-"+(u?o?"left-narrow":"right-narrow":a?"left":"right")}}function BH(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),t.type&&r.classList.add(...t.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(t,r,i,s){let o=document.createElement("span");o.className="cm-completionLabel";let a=t.displayLabel||t.label,u=0;for(let l=0;l<s.length;){let c=s[l++],f=s[l++];c>u&&o.appendChild(document.createTextNode(a.slice(u,c)));let d=o.appendChild(document.createElement("span"));d.appendChild(document.createTextNode(a.slice(c,f))),d.className="cm-completionMatchedText",u=f}return u<a.length&&o.appendChild(document.createTextNode(a.slice(u))),o},position:50},{render(t){if(!t.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=t.detail,r},position:80}),e.sort((t,r)=>t.position-r.position).map(t=>t.render)}function ub(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let i=Math.floor(e/t);return{from:i*t,to:(i+1)*t}}let r=Math.floor((n-e)/t);return{from:n-(r+1)*t,to:n-r*t}}class qH{constructor(e,t,r){this.view=e,this.stateField=t,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:u=>this.placeInfo(u),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:s,selected:o}=i.open,a=e.state.facet(Vn);this.optionContent=BH(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=ub(s.length,o,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",u=>{let{options:l}=e.state.field(t).open;for(let c=u.target,f;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(f=/-(\d+)$/.exec(c.id))&&+f[1]<l.length){this.applyCompletion(e,l[+f[1]]),u.preventDefault();return}}),this.dom.addEventListener("focusout",u=>{let l=e.state.field(this.stateField,!1);l&&l.tooltip&&e.state.facet(Vn).closeOnBlur&&u.relatedTarget!=e.contentDOM&&e.dispatch({effects:Dd.of(null)})}),this.showOptions(s,i.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:s,selected:o,disabled:a}=r.open;(!i.open||i.open.options!=s)&&(this.range=ub(s.length,o,e.state.facet(Vn).maxRenderedOptions),this.showOptions(s,r.id)),this.updateSel(),a!=((t=i.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of t.split(" "))r&&this.dom.classList.add(r);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=ub(t.options.length,t.selected,this.view.state.facet(Vn).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let s=typeof i=="string"?document.createTextNode(i):i(r);if(!s)return;"then"in s?s.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,r)}).catch(o=>ci(this.view.state,o,"completion info")):this.addInfoPane(s,r)}}addInfoPane(e,t){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:s}=e;r.appendChild(i),this.infoDestroy=s||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),t=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return t&&jH(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return i.top>Math.min(s.bottom,t.bottom)-10||i.bottom<Math.max(s.top,t.top)+10?null:this.view.state.facet(Vn).positionInfo(this.view,t,i,r,s,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,r){const i=document.createElement("ul");i.id=t,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions")),i.addEventListener("mousedown",o=>{o.target==i&&o.preventDefault()});let s=null;for(let o=r.from;o<r.to;o++){let{completion:a,match:u}=e[o],{section:l}=a;if(l){let d=typeof l=="string"?l:l.name;if(d!=s&&(o>r.from||r.from==0))if(s=d,typeof l!="string"&&l.header)i.appendChild(l.header(l));else{let g=i.appendChild(document.createElement("completion-section"));g.textContent=d}}const c=i.appendChild(document.createElement("li"));c.id=t+"-"+o,c.setAttribute("role","option");let f=this.optionClass(a);f&&(c.className=f);for(let d of this.optionContent){let g=d(a,this.view.state,this.view,u);g&&c.appendChild(g)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function WH(n,e){return t=>new qH(t,n,e)}function jH(n,e){let t=n.getBoundingClientRect(),r=e.getBoundingClientRect(),i=t.height/n.offsetHeight;r.top<t.top?n.scrollTop-=(t.top-r.top)/i:r.bottom>t.bottom&&(n.scrollTop+=(r.bottom-t.bottom)/i)}function J3(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function $H(n,e){let t=[],r=null,i=l=>{t.push(l);let{section:c}=l.completion;if(c){r||(r=[]);let f=typeof c=="string"?c:c.name;r.some(d=>d.name==f)||r.push(typeof c=="string"?{name:f}:c)}},s=e.facet(Vn);for(let l of n)if(l.hasResult()){let c=l.result.getMatch;if(l.result.filter===!1)for(let f of l.result.options)i(new Z3(f,l.source,c?c(f):[],1e9-t.length));else{let f=e.sliceDoc(l.from,l.to),d,g=s.filterStrict?new FH(f):new LH(f);for(let m of l.result.options)if(d=g.match(m.label)){let y=m.displayLabel?c?c(m,d.matched):[]:d.matched;i(new Z3(m,l.source,y,d.score+(m.boost||0)))}}}if(r){let l=Object.create(null),c=0,f=(d,g)=>{var m,y;return((m=d.rank)!==null&&m!==void 0?m:1e9)-((y=g.rank)!==null&&y!==void 0?y:1e9)||(d.name<g.name?-1:1)};for(let d of r.sort(f))c-=1e5,l[d.name]=c;for(let d of t){let{section:g}=d.completion;g&&(d.score+=l[typeof g=="string"?g:g.name])}}let o=[],a=null,u=s.compareCompletions;for(let l of t.sort((c,f)=>f.score-c.score||u(c.completion,f.completion))){let c=l.completion;!a||a.label!=c.label||a.detail!=c.detail||a.type!=null&&c.type!=null&&a.type!=c.type||a.apply!=c.apply||a.boost!=c.boost?o.push(l):J3(l.completion)>J3(a)&&(o[o.length-1]=l),a=l.completion}return o}class dc{constructor(e,t,r,i,s,o){this.options=e,this.attrs=t,this.tooltip=r,this.timestamp=i,this.selected=s,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new dc(this.options,Q3(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,r,i,s,o){if(i&&!o&&e.some(l=>l.isPending))return i.setDisabled();let a=$H(e,t);if(!a.length)return i&&e.some(l=>l.isPending)?i.setDisabled():null;let u=t.facet(Vn).selectOnOpen?0:-1;if(i&&i.selected!=u&&i.selected!=-1){let l=i.options[i.selected].completion;for(let c=0;c<a.length;c++)if(a[c].completion==l){u=c;break}}return new dc(a,Q3(r,u),{pos:e.reduce((l,c)=>c.hasResult()?Math.min(l,c.from):l,1e8),create:KH,above:s.aboveCursor},i?i.timestamp:Date.now(),u,!1)}map(e){return new dc(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new dc(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Km{constructor(e,t,r){this.active=e,this.id=t,this.open=r}static start(){return new Km(VH,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,r=t.facet(Vn),s=(r.override||t.languageDataAt("autocomplete",sl(t)).map(PH)).map(u=>(this.active.find(c=>c.source==u)||new Ji(u,this.active.some(c=>c.state!=0)?1:0)).update(e,r));s.length==this.active.length&&s.every((u,l)=>u==this.active[l])&&(s=this.active);let o=this.open,a=e.effects.some(u=>u.is(Tk));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||s.some(u=>u.hasResult()&&e.changes.touchesRange(u.from,u.to))||!zH(s,this.active)||a?o=dc.build(s,t,this.id,o,r,a):o&&o.disabled&&!s.some(u=>u.isPending)&&(o=null),!o&&s.every(u=>!u.isPending)&&s.some(u=>u.hasResult())&&(s=s.map(u=>u.hasResult()?new Ji(u.source,0):u));for(let u of e.effects)u.is(BO)&&(o=o&&o.setSelected(u.value,this.id));return s==this.active&&o==this.open?this:new Km(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?UH:HH}}function zH(n,e){if(n==e)return!0;for(let t=0,r=0;;){for(;t<n.length&&!n[t].hasResult();)t++;for(;r<e.length&&!e[r].hasResult();)r++;let i=t==n.length,s=r==e.length;if(i||s)return i==s;if(n[t++].result!=e[r++].result)return!1}}const UH={"aria-autocomplete":"list"},HH={};function Q3(n,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":n};return e>-1&&(t["aria-activedescendant"]=n+"-"+e),t}const VH=[];function NO(n,e){if(n.isUserEvent("input.complete")){let r=n.annotation(Dk);if(r&&e.activateOnCompletion(r))return 12}let t=n.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class Ji{constructor(e,t,r=!1){this.source=e,this.state=t,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let r=NO(e,t),i=this;(r&8||r&16&&this.touches(e))&&(i=new Ji(i.source,0)),r&4&&i.state==0&&(i=new Ji(this.source,1)),i=i.updateFor(e,r);for(let s of e.effects)if(s.is(Gm))i=new Ji(i.source,1,s.value);else if(s.is(Dd))i=new Ji(i.source,0);else if(s.is(Tk))for(let o of s.value)o.source==i.source&&(i=o);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(sl(e.state))}}class _c extends Ji{constructor(e,t,r,i,s,o){super(e,3,t),this.limit=r,this.result=i,this.from=s,this.to=o}hasResult(){return!0}updateFor(e,t){var r;if(!(t&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let s=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=sl(e.state);if(a>o||!i||t&2&&(sl(e.startState)==this.from||a<this.limit))return new Ji(this.source,t&4?1:0);let u=e.changes.mapPos(this.limit);return GH(i.validFor,e.state,s,o)?new _c(this.source,this.explicit,u,i,s,o):i.update&&(i=i.update(i,s,o,new LO(e.state,a,!1)))?new _c(this.source,this.explicit,u,i,i.from,(r=i.to)!==null&&r!==void 0?r:sl(e.state)):new Ji(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new _c(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Ji(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function GH(n,e,t,r){if(!n)return!1;let i=e.sliceDoc(t,r);return typeof n=="function"?n(i,t,r,e):FO(n,!0).test(i)}const Tk=Ve.define({map(n,e){return n.map(t=>t.map(e))}}),BO=Ve.define(),ui=Tn.define({create(){return Km.start()},update(n,e){return n.update(e)},provide:n=>[pk.from(n,e=>e.tooltip),Ae.contentAttributes.from(n,e=>e.attrs)]});function Ik(n,e){const t=e.completion.apply||e.completion.label;let r=n.state.field(ui).active.find(i=>i.source==e.source);return r instanceof _c?(typeof t=="string"?n.dispatch(Object.assign(Object.assign({},u_(n.state,t,r.from,r.to)),{annotations:Dk.of(e.completion)})):t(n,e.completion,r.from,r.to),!0):!1}const KH=WH(ui,Ik);function e0(n,e="option"){return t=>{let r=t.state.field(ui,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<t.state.facet(Vn).interactionDelay)return!1;let i=1,s;e=="page"&&(s=WM(t,r.open.tooltip))&&(i=Math.max(2,Math.floor(s.dom.offsetHeight/s.dom.querySelector("li").offsetHeight)-1));let{length:o}=r.open.options,a=r.open.selected>-1?r.open.selected+i*(n?1:-1):n?0:o-1;return a<0?a=e=="page"?0:o-1:a>=o&&(a=e=="page"?o-1:0),t.dispatch({effects:BO.of(a)}),!0}}const ZH=n=>{let e=n.state.field(ui,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<n.state.facet(Vn).interactionDelay?!1:Ik(n,e.open.options[e.open.selected])},eA=n=>n.state.field(ui,!1)?(n.dispatch({effects:Gm.of(!0)}),!0):!1,XH=n=>{let e=n.state.field(ui,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:Dd.of(null)}),!0)};class YH{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const JH=50,QH=1e3,eV=mn.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(ui).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(ui),t=n.state.facet(Vn);if(!n.selectionSet&&!n.docChanged&&n.startState.field(ui)==e)return;let r=n.transactions.some(s=>{let o=NO(s,t);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;s<this.running.length;s++){let o=this.running[s];if(r||o.context.abortOnDocChange&&n.docChanged||o.updates.length+n.transactions.length>JH&&Date.now()-o.time>QH){for(let a of o.context.abortListeners)try{a()}catch(u){ci(this.view.state,u)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(s=>s.effects.some(o=>o.is(Gm)))&&(this.pendingStart=!0);let i=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.isPending&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let s of n.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(ui);for(let t of e.active)t.isPending&&!this.running.some(r=>r.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Vn).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=sl(e),r=new LO(e,t,n.explicit,this.view),i=new YH(n,r);this.running.push(i),Promise.resolve(n.source(r)).then(s=>{i.context.aborted||(i.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:Dd.of(null)}),ci(this.view.state,s)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Vn).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Vn),r=this.view.state.field(ui);for(let i=0;i<this.running.length;i++){let s=this.running[i];if(s.done===void 0)continue;if(this.running.splice(i--,1),s.done){let a=sl(s.updates.length?s.updates[0].startState:this.view.state),u=Math.min(a,s.done.from+(s.active.explicit?0:1)),l=new _c(s.active.source,s.active.explicit,u,s.done,s.done.from,(n=s.done.to)!==null&&n!==void 0?n:a);for(let c of s.updates)l=l.update(c,t);if(l.hasResult()){e.push(l);continue}}let o=r.active.find(a=>a.source==s.active.source);if(o&&o.isPending)if(s.done==null){let a=new Ji(s.active.source,0);for(let u of s.updates)a=a.update(u,t);a.isPending||e.push(a)}else this.startQuery(o)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:Tk.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(ui,!1);if(e&&e.tooltip&&this.view.state.facet(Vn).closeOnBlur){let t=e.open&&WM(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Dd.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Gm.of(!1)}),20),this.composing=0}}}),tV=typeof navigator=="object"&&/Win/.test(navigator.platform),nV=hu.highest(Ae.domEventHandlers({keydown(n,e){let t=e.state.field(ui,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(tV&&n.altKey)||n.metaKey)return!1;let r=t.open.options[t.open.selected],i=t.active.find(o=>o.source==r.source),s=r.completion.commitCharacters||i.result.commitCharacters;return s&&s.indexOf(n.key)>-1&&Ik(e,r),!1}})),qO=Ae.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class rV{constructor(e,t,r,i){this.field=e,this.line=t,this.from=r,this.to=i}}class Mk{constructor(e,t,r){this.field=e,this.from=t,this.to=r}map(e){let t=e.mapPos(this.from,-1,ar.TrackDel),r=e.mapPos(this.to,1,ar.TrackDel);return t==null||r==null?null:new Mk(this.field,t,r)}}class Ok{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let r=[],i=[t],s=e.doc.lineAt(t),o=/^\s*/.exec(s.text)[0];for(let u of this.lines){if(r.length){let l=o,c=/^\t*/.exec(u)[0].length;for(let f=0;f<c;f++)l+=e.facet(Xc);i.push(t+l.length-c),u=l+u.slice(c)}r.push(u),t+=u.length+1}let a=this.fieldPositions.map(u=>new Mk(u.field,i[u.line]+u.from,i[u.line]+u.to));return{text:r,ranges:a}}static parse(e){let t=[],r=[],i=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(o);){let a=s[1]?+s[1]:null,u=s[2]||s[3]||"",l=-1,c=u.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f<t.length;f++)(a!=null?t[f].seq==a:c&&t[f].name==c)&&(l=f);if(l<0){let f=0;for(;f<t.length&&(a==null||t[f].seq!=null&&t[f].seq<a);)f++;t.splice(f,0,{seq:a,name:c}),l=f;for(let d of i)d.field>=l&&d.field++}i.push(new rV(l,r.length,s.index,s.index+c.length)),o=o.slice(0,s.index)+u+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(a,u,l)=>{for(let c of i)c.line==r.length&&c.from>l&&(c.from--,c.to--);return u}),r.push(o)}return new Ok(r,i)}}let iV=Be.widget({widget:new class extends ya{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),sV=Be.mark({class:"cm-snippetField"});class Qc{constructor(e,t){this.ranges=e,this.active=t,this.deco=Be.set(e.map(r=>(r.from==r.to?iV:sV).range(r.from,r.to)))}map(e){let t=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;t.push(i)}return new Qc(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(r=>r.field==this.active&&r.from<=t.from&&r.to>=t.to))}}const ap=Ve.define({map(n,e){return n&&n.map(e)}}),oV=Ve.define(),Td=Tn.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(ap))return t.value;if(t.is(oV)&&n)return new Qc(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>Ae.decorations.from(n,e=>e?e.deco:Be.none)});function Pk(n,e){return me.create(n.filter(t=>t.field==e).map(t=>me.range(t.from,t.to)))}function WO(n){let e=Ok.parse(n);return(t,r,i,s)=>{let{text:o,ranges:a}=e.instantiate(t.state,i),{main:u}=t.state.selection,l={changes:{from:i,to:s==u.from?u.to:s,insert:vt.of(o)},scrollIntoView:!0,annotations:r?[Dk.of(r),Dn.userEvent.of("input.complete")]:void 0};if(a.length&&(l.selection=Pk(a,0)),a.some(c=>c.field>0)){let c=new Qc(a,0),f=l.effects=[ap.of(c)];t.state.field(Td,!1)===void 0&&f.push(Ve.appendConfig.of([Td,fV,hV,qO]))}t.dispatch(t.state.update(l))}}function jO(n){return({state:e,dispatch:t})=>{let r=e.field(Td,!1);if(!r||n<0&&r.active==0)return!1;let i=r.active+n,s=n>0&&!r.ranges.some(o=>o.field==i+n);return t(e.update({selection:Pk(r.ranges,i),effects:ap.of(s?null:new Qc(r.ranges,i)),scrollIntoView:!0})),!0}}const aV=({state:n,dispatch:e})=>n.field(Td,!1)?(e(n.update({effects:ap.of(null)})),!0):!1,uV=jO(1),lV=jO(-1),cV=[{key:"Tab",run:uV,shift:lV},{key:"Escape",run:aV}],tA=Re.define({combine(n){return n.length?n[0]:cV}}),fV=hu.highest(Zc.compute([tA],n=>n.facet(tA)));function loe(n,e){return Object.assign(Object.assign({},e),{apply:WO(n)})}const hV=Ae.domEventHandlers({mousedown(n,e){let t=e.state.field(Td,!1),r;if(!t||(r=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let i=t.ranges.find(s=>s.from<=r&&s.to>=r);return!i||i.field==t.active?!1:(e.dispatch({selection:Pk(t.ranges,i.field),effects:ap.of(t.ranges.some(s=>s.field>i.field)?new Qc(t.ranges,i.field):null),scrollIntoView:!0}),!0)}}),Id={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},nl=Ve.define({map(n,e){let t=e.mapPos(n,-1,ar.TrackAfter);return t??void 0}}),Lk=new class extends ll{};Lk.startSide=1;Lk.endSide=-1;const $O=Tn.define({create(){return yt.empty},update(n,e){if(n=n.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:r=>r>=t.from&&r<=t.to})}for(let t of e.effects)t.is(nl)&&(n=n.update({add:[Lk.range(t.value,t.value+1)]}));return n}});function dV(){return[gV,$O]}const lb="()[]{}<>«»»«[]{}";function zO(n){for(let e=0;e<lb.length;e+=2)if(lb.charCodeAt(e)==n)return lb.charAt(e+1);return Q2(n<128?n:n+1)}function UO(n,e){return n.languageDataAt("closeBrackets",e)[0]||Id}const pV=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),gV=Ae.inputHandler.of((n,e,t,r)=>{if((pV?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let i=n.state.selection.main;if(r.length>2||r.length==2&&so(oi(r,0))==1||e!=i.from||t!=i.to)return!1;let s=vV(n.state,r);return s?(n.dispatch(s),!0):!1}),mV=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let r=UO(n,n.selection.main.head).brackets||Id.brackets,i=null,s=n.changeByRange(o=>{if(o.empty){let a=bV(n.doc,o.head);for(let u of r)if(u==a&&X1(n.doc,o.head)==zO(oi(u,0)))return{changes:{from:o.head-u.length,to:o.head+u.length},range:me.cursor(o.head-u.length)}}return{range:i=o}});return i||e(n.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},yV=[{key:"Backspace",run:mV}];function vV(n,e){let t=UO(n,n.selection.main.head),r=t.brackets||Id.brackets;for(let i of r){let s=zO(oi(i,0));if(e==i)return s==i?kV(n,i,r.indexOf(i+i+i)>-1,t):wV(n,i,s,t.before||Id.before);if(e==s&&HO(n,n.selection.main.from))return _V(n,i,s)}return null}function HO(n,e){let t=!1;return n.field($O).between(0,n.doc.length,r=>{r==e&&(t=!0)}),t}function X1(n,e){let t=n.sliceString(e,e+2);return t.slice(0,so(oi(t,0)))}function bV(n,e){let t=n.sliceString(e-2,e);return so(oi(t,0))==t.length?t:t.slice(1)}function wV(n,e,t,r){let i=null,s=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:nl.of(o.to+e.length),range:me.range(o.anchor+e.length,o.head+e.length)};let a=X1(n.doc,o.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:e+t,from:o.head},effects:nl.of(o.head+e.length),range:me.cursor(o.head+e.length)}:{range:i=o}});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function _V(n,e,t){let r=null,i=n.changeByRange(s=>s.empty&&X1(n.doc,s.head)==t?{changes:{from:s.head,to:s.head+t.length,insert:t},range:me.cursor(s.head+t.length)}:r={range:s});return r?null:n.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function kV(n,e,t,r){let i=r.stringPrefixes||Id.stringPrefixes,s=null,o=n.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:nl.of(a.to+e.length),range:me.range(a.anchor+e.length,a.head+e.length)};let u=a.head,l=X1(n.doc,u),c;if(l==e){if(nA(n,u))return{changes:{insert:e+e,from:u},effects:nl.of(u+e.length),range:me.cursor(u+e.length)};if(HO(n,u)){let d=t&&n.sliceDoc(u,u+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:u,to:u+d.length,insert:d},range:me.cursor(u+d.length)}}}else{if(t&&n.sliceDoc(u-2*e.length,u)==e+e&&(c=rA(n,u-2*e.length,i))>-1&&nA(n,c))return{changes:{insert:e+e+e+e,from:u},effects:nl.of(u+e.length),range:me.cursor(u+e.length)};if(n.charCategorizer(u)(l)!=sn.Word&&rA(n,u,i)>-1&&!xV(n,u,e,i))return{changes:{insert:e+e,from:u},effects:nl.of(u+e.length),range:me.cursor(u+e.length)}}return{range:s=a}});return s?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function nA(n,e){let t=lr(n).resolveInner(e+1);return t.parent&&t.from==e}function xV(n,e,t,r){let i=lr(n).resolveInner(e,-1),s=r.reduce((o,a)=>Math.max(o,a.length),0);for(let o=0;o<5;o++){let a=n.sliceDoc(i.from,Math.min(i.to,i.from+t.length+s)),u=a.indexOf(t);if(!u||u>-1&&r.indexOf(a.slice(0,u))>-1){let c=i.firstChild;for(;c&&c.from==i.from&&c.to-c.from>t.length+u;){if(n.sliceDoc(c.to-t.length,c.to)==t)return!1;c=c.firstChild}return!0}let l=i.to==e&&i.parent;if(!l)break;i=l}return!1}function rA(n,e,t){let r=n.charCategorizer(e);if(r(n.sliceDoc(e-1,e))!=sn.Word)return e;for(let i of t){let s=e-i.length;if(n.sliceDoc(s,e)==i&&r(n.sliceDoc(s-1,s))!=sn.Word)return s}return-1}function SV(n={}){return[nV,ui,Vn.of(n),eV,CV,qO]}const VO=[{key:"Ctrl-Space",run:eA},{mac:"Alt-`",run:eA},{key:"Escape",run:XH},{key:"ArrowDown",run:e0(!0)},{key:"ArrowUp",run:e0(!1)},{key:"PageDown",run:e0(!0,"page")},{key:"PageUp",run:e0(!1,"page")},{key:"Enter",run:ZH}],CV=hu.highest(Zc.computeN([Vn],n=>n.facet(Vn).defaultKeymap?[VO]:[]));function qt(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var i=t[r];typeof i=="string"?n.setAttribute(r,i):i!=null&&(n[r]=i)}e++}for(;e<arguments.length;e++)GO(n,arguments[e]);return n}function GO(n,e){if(typeof e=="string")n.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)n.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)GO(n,e[t]);else throw new RangeError("Unsupported child node: "+e)}const iA=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class Bc{constructor(e,t,r=0,i=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=s?a=>s(iA(a)):iA,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return oi(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Q2(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=so(e);let i=this.normalize(t);if(i.length)for(let s=0,o=r;;s++){let a=i.charCodeAt(s),u=this.match(a,o,this.bufferPos+this.bufferStart);if(s==i.length-1){if(u)return this.value=u,this;break}o==r&&s<t.length&&t.charCodeAt(s)==a&&o++}}}match(e,t,r){let i=null;for(let s=0;s<this.matches.length;s+=2){let o=this.matches[s],a=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?i={from:this.matches[s+1],to:r}:(this.matches[s]++,a=!0)),a||(this.matches.splice(s,2),s-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?i={from:t,to:r}:this.matches.push(1,t)),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}typeof Symbol<"u"&&(Bc.prototype[Symbol.iterator]=function(){return this});const KO={from:-1,to:-1,match:/.*/.exec("")},Fk="gm"+(/x/.unicode==null?"":"u");class ZO{constructor(e,t,r,i=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=KO,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new XO(e,t,r,i,s);this.re=new RegExp(t,Fk+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=e.iter();let o=e.lineAt(i);this.curLineStart=o.from,this.matchPos=Zm(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let r=this.curLineStart+t.index,i=r+t[0].length;if(this.matchPos=Zm(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<i||r>this.value.to)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const cb=new WeakMap;class kc{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,r){let i=cb.get(e);if(!i||i.from>=r||i.to<=t){let a=new kc(t,e.sliceString(t,r));return cb.set(e,a),a}if(i.from==t&&i.to==r)return i;let{text:s,from:o}=i;return o>t&&(s=e.sliceString(t,o)+s,o=t),i.to<r&&(s+=e.sliceString(i.to,r)),cb.set(e,new kc(o,s)),new kc(t,s.slice(t-o,r-o))}}class XO{constructor(e,t,r,i,s){this.text=e,this.to=s,this.done=!1,this.value=KO,this.matchPos=Zm(e,i),this.re=new RegExp(t,Fk+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=kc.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let r=this.flat.from+t.index,i=r+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this.matchPos=Zm(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=kc.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(ZO.prototype[Symbol.iterator]=XO.prototype[Symbol.iterator]=function(){return this});function EV(n){try{return new RegExp(n,Fk),!0}catch{return!1}}function Zm(n,e){if(e>=n.length)return e;let t=n.lineAt(e),r;for(;e<t.to&&(r=t.text.charCodeAt(e-t.from))>=56320&&r<57344;)e++;return e}function l_(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=qt("input",{class:"cm-textfield",name:"line",value:e}),r=qt("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),n.dispatch({effects:hd.of(!1)}),n.focus()):s.keyCode==13&&(s.preventDefault(),i())},onsubmit:s=>{s.preventDefault(),i()}},qt("label",n.state.phrase("Go to line"),": ",t)," ",qt("button",{class:"cm-button",type:"submit"},n.state.phrase("go")),qt("button",{name:"close",onclick:()=>{n.dispatch({effects:hd.of(!1)}),n.focus()},"aria-label":n.state.phrase("close"),type:"button"},["×"]));function i(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!s)return;let{state:o}=n,a=o.doc.lineAt(o.selection.main.head),[,u,l,c,f]=s,d=c?+c.slice(1):0,g=l?+l:a.number;if(l&&f){let b=g/100;u&&(b=b*(u=="-"?-1:1)+a.number/o.doc.lines),g=Math.round(o.doc.lines*b)}else l&&u&&(g=g*(u=="-"?-1:1)+a.number);let m=o.doc.line(Math.max(1,Math.min(o.doc.lines,g))),y=me.cursor(m.from+Math.max(0,Math.min(d,m.length)));n.dispatch({effects:[hd.of(!1),Ae.scrollIntoView(y.from,{y:"center"})],selection:y}),n.focus()}return{dom:r}}const hd=Ve.define(),sA=Tn.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(hd)&&(n=t.value);return n},provide:n=>Pc.from(n,e=>e?l_:null)}),AV=n=>{let e=Sd(n,l_);if(!e){let t=[hd.of(!0)];n.state.field(sA,!1)==null&&t.push(Ve.appendConfig.of([sA,RV])),n.dispatch({effects:t}),e=Sd(n,l_)}return e&&e.dom.querySelector("input").select(),!0},RV=Ae.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),DV={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},TV=Re.define({combine(n){return So(n,DV,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function IV(n){return[FV,LV]}const MV=Be.mark({class:"cm-selectionMatch"}),OV=Be.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function oA(n,e,t,r){return(t==0||n(e.sliceDoc(t-1,t))!=sn.Word)&&(r==e.doc.length||n(e.sliceDoc(r,r+1))!=sn.Word)}function PV(n,e,t,r){return n(e.sliceDoc(t,t+1))==sn.Word&&n(e.sliceDoc(r-1,r))==sn.Word}const LV=mn.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(TV),{state:t}=n,r=t.selection;if(r.ranges.length>1)return Be.none;let i=r.main,s,o=null;if(i.empty){if(!e.highlightWordAroundCursor)return Be.none;let u=t.wordAt(i.head);if(!u)return Be.none;o=t.charCategorizer(i.head),s=t.sliceDoc(u.from,u.to)}else{let u=i.to-i.from;if(u<e.minSelectionLength||u>200)return Be.none;if(e.wholeWords){if(s=t.sliceDoc(i.from,i.to),o=t.charCategorizer(i.head),!(oA(o,t,i.from,i.to)&&PV(o,t,i.from,i.to)))return Be.none}else if(s=t.sliceDoc(i.from,i.to),!s)return Be.none}let a=[];for(let u of n.visibleRanges){let l=new Bc(t.doc,s,u.from,u.to);for(;!l.next().done;){let{from:c,to:f}=l.value;if((!o||oA(o,t,c,f))&&(i.empty&&c<=i.from&&f>=i.to?a.push(OV.range(c,f)):(c>=i.to||f<=i.from)&&a.push(MV.range(c,f)),a.length>e.maxMatches))return Be.none}}return Be.set(a)}},{decorations:n=>n.decorations}),FV=Ae.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),NV=({state:n,dispatch:e})=>{let{selection:t}=n,r=me.create(t.ranges.map(i=>n.wordAt(i.head)||me.cursor(i.head)),t.mainIndex);return r.eq(t)?!1:(e(n.update({selection:r})),!0)};function BV(n,e){let{main:t,ranges:r}=n.selection,i=n.wordAt(t.head),s=i&&i.from==t.from&&i.to==t.to;for(let o=!1,a=new Bc(n.doc,e,r[r.length-1].to);;)if(a.next(),a.done){if(o)return null;a=new Bc(n.doc,e,0,Math.max(0,r[r.length-1].from-1)),o=!0}else{if(o&&r.some(u=>u.from==a.value.from))continue;if(s){let u=n.wordAt(a.value.from);if(!u||u.from!=a.value.from||u.to!=a.value.to)continue}return a.value}}const qV=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(s=>s.from===s.to))return NV({state:n,dispatch:e});let r=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(s=>n.sliceDoc(s.from,s.to)!=r))return!1;let i=BV(n,r);return i?(e(n.update({selection:n.selection.addRange(me.range(i.from,i.to),!1),effects:Ae.scrollIntoView(i.to)})),!0):!1},ef=Re.define({combine(n){return So(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new YV(e),scrollToMatch:e=>Ae.scrollIntoView(e)})}});class YO{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||EV(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,r)=>r=="n"?`
|
|
44
|
-
`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new zV(this):new jV(this)}getCursor(e,t=0,r){let i=e.doc?e:gt.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?ac(this,i,t,r):oc(this,i,t,r)}}class JO{constructor(e){this.spec=e}}function oc(n,e,t,r){return new Bc(e.doc,n.unquoted,t,r,n.caseSensitive?void 0:i=>i.toLowerCase(),n.wholeWord?WV(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function WV(n,e){return(t,r,i,s)=>((s>t||s+i.length<r)&&(s=Math.max(0,t-2),i=n.sliceString(s,Math.min(n.length,r+2))),(e(Xm(i,t-s))!=sn.Word||e(Ym(i,t-s))!=sn.Word)&&(e(Ym(i,r-s))!=sn.Word||e(Xm(i,r-s))!=sn.Word))}class jV extends JO{constructor(e){super(e)}nextMatch(e,t,r){let i=oc(this.spec,e,r,e.doc.length).nextOverlapping();if(i.done){let s=Math.min(e.doc.length,t+this.spec.unquoted.length);i=oc(this.spec,e,0,s).nextOverlapping()}return i.done||i.value.from==t&&i.value.to==r?null:i.value}prevMatchInRange(e,t,r){for(let i=r;;){let s=Math.max(t,i-1e4-this.spec.unquoted.length),o=oc(this.spec,e,s,i),a=null;for(;!o.nextOverlapping().done;)a=o.value;if(a)return a;if(s==t)return null;i-=1e4}}prevMatch(e,t,r){let i=this.prevMatchInRange(e,0,t);return i||(i=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=t||i.to!=r)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let r=oc(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let s=oc(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}function ac(n,e,t,r){return new ZO(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?$V(e.charCategorizer(e.selection.main.head)):void 0},t,r)}function Xm(n,e){return n.slice(ur(n,e,!1),e)}function Ym(n,e){return n.slice(e,ur(n,e))}function $V(n){return(e,t,r)=>!r[0].length||(n(Xm(r.input,r.index))!=sn.Word||n(Ym(r.input,r.index))!=sn.Word)&&(n(Ym(r.input,r.index+r[0].length))!=sn.Word||n(Xm(r.input,r.index+r[0].length))!=sn.Word)}class zV extends JO{nextMatch(e,t,r){let i=ac(this.spec,e,r,e.doc.length).next();return i.done&&(i=ac(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,r){for(let i=1;;i++){let s=Math.max(t,r-i*1e4),o=ac(this.spec,e,s,r),a=null;for(;!o.next().done;)a=o.value;if(a&&(s==t||a.from>s+10))return a;if(s==t)return null}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let s=+r.slice(0,i);if(s>0&&s<e.match.length)return e.match[s]+r.slice(i)}return t})}matchAll(e,t){let r=ac(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let s=ac(this.spec,e,Math.max(0,t-250),Math.min(r+250,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}const Md=Ve.define(),Nk=Ve.define(),eu=Tn.define({create(n){return new fb(c_(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Md)?n=new fb(t.value.create(),n.panel):t.is(Nk)&&(n=new fb(n.query,t.value?Bk:null));return n},provide:n=>Pc.from(n,e=>e.panel)});class fb{constructor(e,t){this.query=e,this.panel=t}}const UV=Be.mark({class:"cm-searchMatch"}),HV=Be.mark({class:"cm-searchMatch cm-searchMatch-selected"}),VV=mn.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(eu))}update(n){let e=n.state.field(eu);(e!=n.startState.field(eu)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return Be.none;let{view:t}=this,r=new la;for(let i=0,s=t.visibleRanges,o=s.length;i<o;i++){let{from:a,to:u}=s[i];for(;i<o-1&&u>s[i+1].from-500;)u=s[++i].to;n.highlight(t.state,a,u,(l,c)=>{let f=t.state.selection.ranges.some(d=>d.from==l&&d.to==c);r.add(l,c,f?HV:UV)})}return r.finish()}},{decorations:n=>n.decorations});function up(n){return e=>{let t=e.state.field(eu,!1);return t&&t.query.spec.valid?n(e,t):tP(e)}}const Jm=up((n,{query:e})=>{let{to:t}=n.state.selection.main,r=e.nextMatch(n.state,t,t);if(!r)return!1;let i=me.single(r.from,r.to),s=n.state.facet(ef);return n.dispatch({selection:i,effects:[qk(n,r),s.scrollToMatch(i.main,n)],userEvent:"select.search"}),eP(n),!0}),Qm=up((n,{query:e})=>{let{state:t}=n,{from:r}=t.selection.main,i=e.prevMatch(t,r,r);if(!i)return!1;let s=me.single(i.from,i.to),o=n.state.facet(ef);return n.dispatch({selection:s,effects:[qk(n,i),o.scrollToMatch(s.main,n)],userEvent:"select.search"}),eP(n),!0}),GV=up((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:me.create(t.map(r=>me.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),KV=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:r,to:i}=t.main,s=[],o=0;for(let a=new Bc(n.doc,n.sliceDoc(r,i));!a.next().done;){if(s.length>1e3)return!1;a.value.from==r&&(o=s.length),s.push(me.range(a.value.from,a.value.to))}return e(n.update({selection:me.create(s,o),userEvent:"select.search.matches"})),!0},aA=up((n,{query:e})=>{let{state:t}=n,{from:r,to:i}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,r,r);if(!s)return!1;let o=s,a=[],u,l,c=[];if(o.from==r&&o.to==i&&(l=t.toText(e.getReplacement(o)),a.push({from:o.from,to:o.to,insert:l}),o=e.nextMatch(t,o.from,o.to),c.push(Ae.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(r).number)+"."))),o){let f=a.length==0||a[0].from>=s.to?0:s.to-s.from-l.length;u=me.single(o.from-f,o.to-f),c.push(qk(n,o)),c.push(t.facet(ef).scrollToMatch(u.main,n))}return n.dispatch({changes:a,selection:u,effects:c,userEvent:"input.replace"}),!0}),ZV=up((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(i=>{let{from:s,to:o}=i;return{from:s,to:o,insert:e.getReplacement(i)}});if(!t.length)return!1;let r=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:Ae.announce.of(r),userEvent:"input.replace.all"}),!0});function Bk(n){return n.state.facet(ef).createPanel(n)}function c_(n,e){var t,r,i,s,o;let a=n.selection.main,u=a.empty||a.to>a.from+100?"":n.sliceDoc(a.from,a.to);if(e&&!u)return e;let l=n.facet(ef);return new YO({search:((t=e?.literal)!==null&&t!==void 0?t:l.literal)?u:u.replace(/\n/g,"\\n"),caseSensitive:(r=e?.caseSensitive)!==null&&r!==void 0?r:l.caseSensitive,literal:(i=e?.literal)!==null&&i!==void 0?i:l.literal,regexp:(s=e?.regexp)!==null&&s!==void 0?s:l.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:l.wholeWord})}function QO(n){let e=Sd(n,Bk);return e&&e.dom.querySelector("[main-field]")}function eP(n){let e=QO(n);e&&e==n.root.activeElement&&e.select()}const tP=n=>{let e=n.state.field(eu,!1);if(e&&e.panel){let t=QO(n);if(t&&t!=n.root.activeElement){let r=c_(n.state,e.query.spec);r.valid&&n.dispatch({effects:Md.of(r)}),t.focus(),t.select()}}else n.dispatch({effects:[Nk.of(!0),e?Md.of(c_(n.state,e.query.spec)):Ve.appendConfig.of(QV)]});return!0},nP=n=>{let e=n.state.field(eu,!1);if(!e||!e.panel)return!1;let t=Sd(n,Bk);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:Nk.of(!1)}),!0},XV=[{key:"Mod-f",run:tP,scope:"editor search-panel"},{key:"F3",run:Jm,shift:Qm,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Jm,shift:Qm,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:nP,scope:"editor search-panel"},{key:"Mod-Shift-l",run:KV},{key:"Mod-Alt-g",run:AV},{key:"Mod-d",run:qV,preventDefault:!0}];class YV{constructor(e){this.view=e;let t=this.query=e.state.field(eu).query.spec;this.commit=this.commit.bind(this),this.searchField=qt("input",{value:t.search,placeholder:xi(e,"Find"),"aria-label":xi(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=qt("input",{value:t.replace,placeholder:xi(e,"Replace"),"aria-label":xi(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=qt("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=qt("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=qt("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function r(i,s,o){return qt("button",{class:"cm-button",name:i,onclick:s,type:"button"},o)}this.dom=qt("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>Jm(e),[xi(e,"next")]),r("prev",()=>Qm(e),[xi(e,"previous")]),r("select",()=>GV(e),[xi(e,"all")]),qt("label",null,[this.caseField,xi(e,"match case")]),qt("label",null,[this.reField,xi(e,"regexp")]),qt("label",null,[this.wordField,xi(e,"by word")]),...e.state.readOnly?[]:[qt("br"),this.replaceField,r("replace",()=>aA(e),[xi(e,"replace")]),r("replaceAll",()=>ZV(e),[xi(e,"replace all")])],qt("button",{name:"close",onclick:()=>nP(e),"aria-label":xi(e,"close"),type:"button"},["×"])])}commit(){let e=new YO({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Md.of(e)}))}keydown(e){TW(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Qm:Jm)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),aA(this.view))}update(e){for(let t of e.transactions)for(let r of t.effects)r.is(Md)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(ef).top}}function xi(n,e){return n.state.phrase(e)}const t0=30,n0=/[\s\.,:;?!]/;function qk(n,{from:e,to:t}){let r=n.state.doc.lineAt(e),i=n.state.doc.lineAt(t).to,s=Math.max(r.from,e-t0),o=Math.min(i,t+t0),a=n.state.sliceDoc(s,o);if(s!=r.from){for(let u=0;u<t0;u++)if(!n0.test(a[u+1])&&n0.test(a[u])){a=a.slice(u);break}}if(o!=i){for(let u=a.length-1;u>a.length-t0;u--)if(!n0.test(a[u-1])&&n0.test(a[u])){a=a.slice(0,u);break}}return Ae.announce.of(`${n.state.phrase("current match")}. ${a} ${n.state.phrase("on line")} ${r.number}.`)}const JV=Ae.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),QV=[eu,hu.low(VV),JV],hb={},eG={javascript:async()=>{const{javascript:n}=await mt(async()=>{const{javascript:e}=await import("./index-pGm0qkrJ.js");return{javascript:e}},__vite__mapDeps([0,1]));return n({jsx:!0,typescript:!0})},python:async()=>{const{python:n}=await mt(async()=>{const{python:e}=await import("./index-C-QhPFHP.js");return{python:e}},__vite__mapDeps([2,1]));return n()},rust:async()=>{const{rust:n}=await mt(async()=>{const{rust:e}=await import("./index-Dvu-FFzd.js");return{rust:e}},__vite__mapDeps([3,1]));return n()},html:async()=>{const{html:n}=await mt(async()=>{const{html:e}=await import("./index-as7ELo0J.js");return{html:e}},__vite__mapDeps([4,1,5,0]));return n()},css:async()=>{const{css:n}=await mt(async()=>{const{css:e}=await import("./index-Dx_VuNNd.js");return{css:e}},__vite__mapDeps([5,1]));return n()},scss:async()=>{const{sass:n}=await mt(async()=>{const{sass:e}=await import("./index-I0dlv-r3.js");return{sass:e}},__vite__mapDeps([6,1,5]));return n({indented:!1})},less:async()=>{const{less:n}=await mt(async()=>{const{less:e}=await import("./index-DWOBdRjn.js");return{less:e}},__vite__mapDeps([7,5,1]));return n()},json:async()=>{const{json:n}=await mt(async()=>{const{json:e}=await import("./index-MGle_v2x.js");return{json:e}},__vite__mapDeps([8,1]));return n()},xml:async()=>{const{xml:n}=await mt(async()=>{const{xml:e}=await import("./index-9HdhmM_Y.js");return{xml:e}},__vite__mapDeps([9,1]));return n()},markdown:async()=>{const{markdown:n}=await mt(async()=>{const{markdown:e}=await import("./index-CGx5MZO7.js");return{markdown:e}},__vite__mapDeps([10,4,1,5,0]));return n()},sql:async()=>{const{sql:n}=await mt(async()=>{const{sql:e}=await import("./index-aEsF5o-7.js");return{sql:e}},__vite__mapDeps([11,1]));return n()},php:async()=>{const{php:n}=await mt(async()=>{const{php:e}=await import("./index-N-GE7HTU.js");return{php:e}},__vite__mapDeps([12,1,4,5,0]));return n()},java:async()=>{const{java:n}=await mt(async()=>{const{java:e}=await import("./index-CIuq3uTk.js");return{java:e}},__vite__mapDeps([13,1]));return n()},cpp:async()=>{const{cpp:n}=await mt(async()=>{const{cpp:e}=await import("./index-CXFONXS8.js");return{cpp:e}},__vite__mapDeps([14,1]));return n()},c:async()=>{const{cpp:n}=await mt(async()=>{const{cpp:e}=await import("./index-CXFONXS8.js");return{cpp:e}},__vite__mapDeps([14,1]));return n()},yaml:async()=>{const{yaml:n}=await mt(async()=>{const{yaml:e}=await import("./index-gUUzXNuP.js");return{yaml:e}},__vite__mapDeps([15,1]));return n()},ruby:async()=>{const{ruby:n}=await mt(async()=>{const{ruby:e}=await import("./ruby-B2Rjki9n.js");return{ruby:e}},[]);return $n.define(n)},csharp:async()=>{const{csharp:n}=await mt(async()=>{const{csharp:e}=await import("./clike-C8IJ2oj_.js");return{csharp:e}},[]);return $n.define(n)},go:async()=>{const{go:n}=await mt(async()=>{const{go:e}=await import("./go-CTD25R5P.js");return{go:e}},[]);return $n.define(n)},swift:async()=>{const{swift:n}=await mt(async()=>{const{swift:e}=await import("./swift-BzpIVaGY.js");return{swift:e}},[]);return $n.define(n)},kotlin:async()=>{const{kotlin:n}=await mt(async()=>{const{kotlin:e}=await import("./clike-C8IJ2oj_.js");return{kotlin:e}},[]);return $n.define(n)},scala:async()=>{const{scala:n}=await mt(async()=>{const{scala:e}=await import("./clike-C8IJ2oj_.js");return{scala:e}},[]);return $n.define(n)},vb:async()=>{const{vb:n}=await mt(async()=>{const{vb:e}=await import("./vb-CmGdzxic.js");return{vb:e}},[]);return $n.define(n)},haskell:async()=>{const{haskell:n}=await mt(async()=>{const{haskell:e}=await import("./haskell-BWDZoCOh.js");return{haskell:e}},[]);return $n.define(n)},lua:async()=>{const{lua:n}=await mt(async()=>{const{lua:e}=await import("./lua-BgMRiT3U.js");return{lua:e}},[]);return $n.define(n)},perl:async()=>{const{perl:n}=await mt(async()=>{const{perl:e}=await import("./perl-CdXCOZ3F.js");return{perl:e}},[]);return $n.define(n)},bash:async()=>{const{shell:n}=await mt(async()=>{const{shell:e}=await import("./shell-CjFT_Tl9.js");return{shell:e}},[]);return $n.define(n)},toml:async()=>{const{toml:n}=await mt(async()=>{const{toml:e}=await import("./toml-BXUEaScT.js");return{toml:e}},[]);return $n.define(n)},ini:async()=>{const{properties:n}=await mt(async()=>{const{properties:e}=await import("./properties-C78fOPTZ.js");return{properties:e}},[]);return $n.define(n)},dockerfile:async()=>{const{dockerFile:n}=await mt(async()=>{const{dockerFile:e}=await import("./dockerfile-C_y-rIpk.js");return{dockerFile:e}},[]);return $n.define(n)},makefile:async()=>{const{cmake:n}=await mt(async()=>{const{cmake:e}=await import("./cmake-BQqOBYOt.js");return{cmake:e}},[]);return $n.define(n)},gitignore:async()=>{const{properties:n}=await mt(async()=>{const{properties:e}=await import("./properties-C78fOPTZ.js");return{properties:e}},[]);return $n.define(n)}},uA=async n=>{if(hb[n])return hb[n];const e=eG[n],t=await e();return hb[n]=t,t},e1={javascript:"javascript",js:"javascript",typescript:"javascript",ts:"javascript",jsx:"javascript",tsx:"javascript",python:"python",py:"python",ruby:"ruby",rb:"ruby",php:"php",java:"java",cpp:"cpp",c:"c",csharp:"csharp",cs:"csharp",go:"go",swift:"swift",kotlin:"kotlin",kt:"kotlin",rust:"rust",rs:"rust",scala:"scala",vb:"vb",haskell:"haskell",hs:"haskell",lua:"lua",perl:"perl",pl:"perl",bash:"bash",shell:"bash",sh:"bash",zsh:"bash",mysql:"sql",sql:"sql",html:"html",css:"css",scss:"scss",less:"less",json:"json",yaml:"yaml",yml:"yaml",xml:"xml",markdown:"markdown",md:"markdown",toml:"toml",ini:"ini",conf:"ini",log:"ini",env:"ini",dockerfile:"dockerfile",makefile:"makefile",dockerignore:"gitignore",gitignore:"gitignore"};class lA{constructor(e,t,r){this.from=e,this.to=t,this.diagnostic=r}}class Xu{constructor(e,t,r){this.diagnostics=e,this.panel=t,this.selected=r}static init(e,t,r){let i=r.facet(Od).markerFilter;i&&(e=i(e,r));let s=e.slice().sort((c,f)=>c.from-f.from||c.to-f.to),o=new la,a=[],u=0;for(let c=0;;){let f=c==s.length?null:s[c];if(!f&&!a.length)break;let d,g;for(a.length?(d=u,g=a.reduce((y,b)=>Math.min(y,b.to),f&&f.from>d?f.from:1e8)):(d=f.from,g=f.to,a.push(f),c++);c<s.length;){let y=s[c];if(y.from==d&&(y.to>y.from||y.to==d))a.push(y),c++,g=Math.min(y.to,g);else{g=Math.min(y.from,g);break}}let m=hG(a);if(a.some(y=>y.from==y.to||y.from==y.to-1&&r.doc.lineAt(y.from).to==y.from))o.add(d,d,Be.widget({widget:new uG(m),diagnostics:a.slice()}));else{let y=a.reduce((b,w)=>w.markClass?b+" "+w.markClass:b,"");o.add(d,g,Be.mark({class:"cm-lintRange cm-lintRange-"+m+y,diagnostics:a.slice(),inclusiveEnd:a.some(b=>b.to>g)}))}u=g;for(let y=0;y<a.length;y++)a[y].to<=u&&a.splice(y--,1)}let l=o.finish();return new Xu(l,t,qc(l))}}function qc(n,e=null,t=0){let r=null;return n.between(t,1e9,(i,s,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!r)r=new lA(i,s,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new lA(r.from,s,r.diagnostic)}}),r}function tG(n,e){let t=e.pos,r=e.end||t,i=n.state.facet(Od).hideOn(n,t,r);if(i!=null)return i;let s=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(o=>o.is(Wk))||n.changes.touchesRange(s.from,Math.max(s.to,r)))}function rP(n,e){return n.field(hi,!1)?e:e.concat(Ve.appendConfig.of(dG))}function cA(n,e){return{effects:rP(n,[Wk.of(e)])}}const Wk=Ve.define(),jk=Ve.define(),iP=Ve.define(),hi=Tn.define({create(){return new Xu(Be.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),r=null,i=n.panel;if(n.selected){let s=e.changes.mapPos(n.selected.from,1);r=qc(t,n.selected.diagnostic,s)||qc(t,null,s)}!t.size&&i&&e.state.facet(Od).autoPanel&&(i=null),n=new Xu(t,i,r)}for(let t of e.effects)if(t.is(Wk)){let r=e.state.facet(Od).autoPanel?t.value.length?Pd.open:null:n.panel;n=Xu.init(t.value,r,e.state)}else t.is(jk)?n=new Xu(n.diagnostics,t.value?Pd.open:null,n.selected):t.is(iP)&&(n=new Xu(n.diagnostics,n.panel,t.value));return n},provide:n=>[Pc.from(n,e=>e.panel),Ae.decorations.from(n,e=>e.diagnostics)]}),nG=Be.mark({class:"cm-lintRange cm-lintRange-active"});function rG(n,e,t){let{diagnostics:r}=n.state.field(hi),i,s=-1,o=-1;r.between(e-(t<0?1:0),e+(t>0?1:0),(u,l,{spec:c})=>{if(e>=u&&e<=l&&(u==l||(e>u||t>0)&&(e<l||t<0)))return i=c.diagnostics,s=u,o=l,!1});let a=n.state.facet(Od).tooltipFilter;return i&&a&&(i=a(i,n.state)),i?{pos:s,end:o,above:n.state.doc.lineAt(s).to<o,create(){return{dom:iG(n,i)}}}:null}function iG(n,e){return qt("ul",{class:"cm-tooltip-lint"},e.map(t=>oP(n,t,!1)))}const sG=n=>{let e=n.state.field(hi,!1);(!e||!e.panel)&&n.dispatch({effects:rP(n.state,[jk.of(!0)])});let t=Sd(n,Pd.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},fA=n=>{let e=n.state.field(hi,!1);return!e||!e.panel?!1:(n.dispatch({effects:jk.of(!1)}),!0)},oG=n=>{let e=n.state.field(hi,!1);if(!e)return!1;let t=n.state.selection.main,r=e.diagnostics.iter(t.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==t.from&&r.to==t.to)?!1:(n.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},aG=[{key:"Mod-Shift-m",run:sG,preventDefault:!0},{key:"F8",run:oG}],Od=Re.define({combine(n){return Object.assign({sources:n.map(e=>e.source).filter(e=>e!=null)},So(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?r=>e(r)||t(r):e:t}))}});function sP(n){let e=[];if(n)e:for(let{name:t}of n){for(let r=0;r<t.length;r++){let i=t[r];if(/[a-zA-Z]/.test(i)&&!e.some(s=>s.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function oP(n,e,t){var r;let i=t?sP(e.actions):[];return qt("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},qt("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((s,o)=>{let a=!1,u=d=>{if(d.preventDefault(),a)return;a=!0;let g=qc(n.state.field(hi).diagnostics,e);g&&s.apply(n,g.from,g.to)},{name:l}=s,c=i[o]?l.indexOf(i[o]):-1,f=c<0?l:[l.slice(0,c),qt("u",l.slice(c,c+1)),l.slice(c+1)];return qt("button",{type:"button",class:"cm-diagnosticAction",onclick:u,onmousedown:u,"aria-label":` Action: ${l}${c<0?"":` (access key "${i[o]})"`}.`},f)}),e.source&&qt("div",{class:"cm-diagnosticSource"},e.source))}class uG extends ya{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return qt("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class hA{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=oP(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Pd{constructor(e){this.view=e,this.items=[];let t=i=>{if(i.keyCode==27)fA(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=sP(s.actions);for(let a=0;a<o.length;a++)if(o[a].toUpperCase().charCodeAt(0)==i.keyCode){let u=qc(this.view.state.field(hi).diagnostics,s);u&&s.actions[a].apply(e,u.from,u.to)}}else return;i.preventDefault()},r=i=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(i.target)&&this.moveSelection(s)};this.list=qt("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:r}),this.dom=qt("div",{class:"cm-panel-lint"},this.list,qt("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>fA(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(hi).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(hi),r=0,i=!1,s=null,o=new Set;for(e.between(0,this.view.state.doc.length,(a,u,{spec:l})=>{for(let c of l.diagnostics){if(o.has(c))continue;o.add(c);let f=-1,d;for(let g=r;g<this.items.length;g++)if(this.items[g].diagnostic==c){f=g;break}f<0?(d=new hA(this.view,c),this.items.splice(r,0,d),i=!0):(d=this.items[f],f>r&&(this.items.splice(r,f-r),i=!0)),t&&d.diagnostic==t.diagnostic?d.dom.hasAttribute("aria-selected")||(d.dom.setAttribute("aria-selected","true"),s=d):d.dom.hasAttribute("aria-selected")&&d.dom.removeAttribute("aria-selected"),r++}});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();this.items.length==0&&(this.items.push(new hA(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:u})=>{let l=u.height/this.list.offsetHeight;a.top<u.top?this.list.scrollTop-=(u.top-a.top)/l:a.bottom>u.bottom&&(this.list.scrollTop+=(a.bottom-u.bottom)/l)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function t(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)t();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(hi),r=qc(t.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:iP.of(r)})}static open(e){return new Pd(e)}}function lG(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(n)}</svg>')`}function r0(n){return lG(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${n}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const cG=Ae.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:r0("#d11")},".cm-lintRange-warning":{backgroundImage:r0("orange")},".cm-lintRange-info":{backgroundImage:r0("#999")},".cm-lintRange-hint":{backgroundImage:r0("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function fG(n){return n=="error"?4:n=="warning"?3:n=="info"?2:1}function hG(n){let e="hint",t=1;for(let r of n){let i=fG(r.severity);i>t&&(t=i,e=r.severity)}return e}const dG=[hi,Ae.decorations.compute([hi],n=>{let{selected:e,panel:t}=n.field(hi);return!e||!t||e.from==e.to?Be.none:Be.set([nG.range(e.from,e.to)])}),qM(rG,{hideOn:tG}),cG];function pG(n,e){let t=n.field(hi,!1);if(t&&t.diagnostics.size){let r=[],i=[];for(let s=yt.iter([t.diagnostics]);;s.next()){for(let o=0;o<r.length;o++)(!s.value||s.value.spec.diagnostics.indexOf(r[o])<0)&&(r.splice(o,1),i.splice(o--,1));if(!s.value)break;for(let o of s.value.spec.diagnostics)r.indexOf(o)<0&&(r.push(o),i.push(s.from));s.to}}}var bh={},Ou={},i0={exports:{}},dA;function aP(){if(dA)return i0.exports;dA=1;var n=typeof Reflect=="object"?Reflect:null,e=n&&typeof n.apply=="function"?n.apply:function(C,A,I){return Function.prototype.apply.call(C,A,I)},t;n&&typeof n.ownKeys=="function"?t=n.ownKeys:Object.getOwnPropertySymbols?t=function(C){return Object.getOwnPropertyNames(C).concat(Object.getOwnPropertySymbols(C))}:t=function(C){return Object.getOwnPropertyNames(C)};function r(S){console&&console.warn&&console.warn(S)}var i=Number.isNaN||function(C){return C!==C};function s(){s.init.call(this)}i0.exports=s,i0.exports.once=w,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(S){if(typeof S!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof S)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(S){if(typeof S!="number"||S<0||i(S))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+S+".");o=S}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(C){if(typeof C!="number"||C<0||i(C))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+C+".");return this._maxListeners=C,this};function u(S){return S._maxListeners===void 0?s.defaultMaxListeners:S._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(C){for(var A=[],I=1;I<arguments.length;I++)A.push(arguments[I]);var W=C==="error",B=this._events;if(B!==void 0)W=W&&B.error===void 0;else if(!W)return!1;if(W){var K;if(A.length>0&&(K=A[0]),K instanceof Error)throw K;var G=new Error("Unhandled error."+(K?" ("+K.message+")":""));throw G.context=K,G}var F=B[C];if(F===void 0)return!1;if(typeof F=="function")e(F,this,A);else for(var R=F.length,Y=m(F,R),I=0;I<R;++I)e(Y[I],this,A);return!0};function l(S,C,A,I){var W,B,K;if(a(A),B=S._events,B===void 0?(B=S._events=Object.create(null),S._eventsCount=0):(B.newListener!==void 0&&(S.emit("newListener",C,A.listener?A.listener:A),B=S._events),K=B[C]),K===void 0)K=B[C]=A,++S._eventsCount;else if(typeof K=="function"?K=B[C]=I?[A,K]:[K,A]:I?K.unshift(A):K.push(A),W=u(S),W>0&&K.length>W&&!K.warned){K.warned=!0;var G=new Error("Possible EventEmitter memory leak detected. "+K.length+" "+String(C)+" listeners added. Use emitter.setMaxListeners() to increase limit");G.name="MaxListenersExceededWarning",G.emitter=S,G.type=C,G.count=K.length,r(G)}return S}s.prototype.addListener=function(C,A){return l(this,C,A,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(C,A){return l(this,C,A,!0)};function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(S,C,A){var I={fired:!1,wrapFn:void 0,target:S,type:C,listener:A},W=c.bind(I);return W.listener=A,I.wrapFn=W,W}s.prototype.once=function(C,A){return a(A),this.on(C,f(this,C,A)),this},s.prototype.prependOnceListener=function(C,A){return a(A),this.prependListener(C,f(this,C,A)),this},s.prototype.removeListener=function(C,A){var I,W,B,K,G;if(a(A),W=this._events,W===void 0)return this;if(I=W[C],I===void 0)return this;if(I===A||I.listener===A)--this._eventsCount===0?this._events=Object.create(null):(delete W[C],W.removeListener&&this.emit("removeListener",C,I.listener||A));else if(typeof I!="function"){for(B=-1,K=I.length-1;K>=0;K--)if(I[K]===A||I[K].listener===A){G=I[K].listener,B=K;break}if(B<0)return this;B===0?I.shift():y(I,B),I.length===1&&(W[C]=I[0]),W.removeListener!==void 0&&this.emit("removeListener",C,G||A)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(C){var A,I,W;if(I=this._events,I===void 0)return this;if(I.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):I[C]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete I[C]),this;if(arguments.length===0){var B=Object.keys(I),K;for(W=0;W<B.length;++W)K=B[W],K!=="removeListener"&&this.removeAllListeners(K);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(A=I[C],typeof A=="function")this.removeListener(C,A);else if(A!==void 0)for(W=A.length-1;W>=0;W--)this.removeListener(C,A[W]);return this};function d(S,C,A){var I=S._events;if(I===void 0)return[];var W=I[C];return W===void 0?[]:typeof W=="function"?A?[W.listener||W]:[W]:A?b(W):m(W,W.length)}s.prototype.listeners=function(C){return d(this,C,!0)},s.prototype.rawListeners=function(C){return d(this,C,!1)},s.listenerCount=function(S,C){return typeof S.listenerCount=="function"?S.listenerCount(C):g.call(S,C)},s.prototype.listenerCount=g;function g(S){var C=this._events;if(C!==void 0){var A=C[S];if(typeof A=="function")return 1;if(A!==void 0)return A.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function m(S,C){for(var A=new Array(C),I=0;I<C;++I)A[I]=S[I];return A}function y(S,C){for(;C+1<S.length;C++)S[C]=S[C+1];S.pop()}function b(S){for(var C=new Array(S.length),A=0;A<C.length;++A)C[A]=S[A].listener||S[A];return C}function w(S,C){return new Promise(function(A,I){function W(K){S.removeListener(C,B),I(K)}function B(){typeof S.removeListener=="function"&&S.removeListener("error",W),A([].slice.call(arguments))}_(S,C,B,{once:!0}),C!=="error"&&x(S,W,{once:!0})})}function x(S,C,A){typeof S.on=="function"&&_(S,"error",C,A)}function _(S,C,A,I){if(typeof S.on=="function")I.once?S.once(C,A):S.on(C,A);else if(typeof S.addEventListener=="function")S.addEventListener(C,function W(B){I.once&&S.removeEventListener(C,W),A(B)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof S)}return i0.exports}var pA;function gG(){return pA||(pA=1,function(n){var e=Ou&&Ou.__awaiter||function(s,o,a,u){function l(c){return c instanceof a?c:new a(function(f){f(c)})}return new(a||(a=Promise))(function(c,f){function d(y){try{m(u.next(y))}catch(b){f(b)}}function g(y){try{m(u.throw(y))}catch(b){f(b)}}function m(y){y.done?c(y.value):l(y.value).then(d,g)}m((u=u.apply(s,o||[])).next())})},t=Ou&&Ou.__generator||function(s,o){var a={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},u,l,c,f;return f={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function d(m){return function(y){return g([m,y])}}function g(m){if(u)throw new TypeError("Generator is already executing.");for(;a;)try{if(u=1,l&&(c=m[0]&2?l.return:m[0]?l.throw||((c=l.return)&&c.call(l),0):l.next)&&!(c=c.call(l,m[1])).done)return c;switch(l=0,c&&(m=[m[0]&2,c.value]),m[0]){case 0:case 1:c=m;break;case 4:return a.label++,{value:m[1],done:!1};case 5:a.label++,l=m[1],m=[0];continue;case 7:m=a.ops.pop(),a.trys.pop();continue;default:if(c=a.trys,!(c=c.length>0&&c[c.length-1])&&(m[0]===6||m[0]===2)){a=0;continue}if(m[0]===3&&(!c||m[1]>c[0]&&m[1]<c[3])){a.label=m[1];break}if(m[0]===6&&a.label<c[1]){a.label=c[1],c=m;break}if(c&&a.label<c[2]){a.label=c[2],a.ops.push(m);break}c[2]&&a.ops.pop(),a.trys.pop();continue}m=o.call(s,a)}catch(y){m=[6,y],l=0}finally{u=c=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}};Object.defineProperty(n,"__esModule",{value:!0}),n.defaultNextRequest=void 0;var r=aP();n.defaultNextRequest=function(){var s=-1;return function(){return++s}};var i=function(){function s(o,a){a===void 0&&(a=n.defaultNextRequest()),this.batch=[],this.batchStarted=!1,this.lastId=-1,this.transports=o,this.requests={},this.connectPromise=this.connect(),this.requestChannel=new r.EventEmitter,this.nextID=a}return s.prototype.connect=function(){var o=this;return Promise.all(this.transports.map(function(a){return e(o,void 0,void 0,function(){return t(this,function(u){switch(u.label){case 0:return a.subscribe("error",this.handleError.bind(this)),a.subscribe("notification",this.handleNotification.bind(this)),[4,a.connect()];case 1:return u.sent(),[2]}})})}))},s.prototype.getPrimaryTransport=function(){return this.transports[0]},s.prototype.request=function(o,a,u){return a===void 0&&(a=!1),e(this,void 0,void 0,function(){var l,c,f,d,g=this;return t(this,function(m){return l=this.nextID().toString(),c=a?null:l,f={request:this.makeRequest(o.method,o.params||[],c),internalID:l},this.batchStarted?(d=new Promise(function(y,b){g.batch.push({resolve:y,reject:b,request:f})}),[2,d]):[2,this.getPrimaryTransport().sendData(f,u)]})})},s.prototype.close=function(){this.requestChannel.removeAllListeners(),this.transports.forEach(function(o){o.unsubscribe(),o.close()})},s.prototype.startBatch=function(){this.batchStarted=!0},s.prototype.stopBatch=function(){if(this.batchStarted===!1)throw new Error("cannot end that which has never started");if(this.batch.length===0){this.batchStarted=!1;return}this.getPrimaryTransport().sendData(this.batch),this.batch=[],this.batchStarted=!1},s.prototype.makeRequest=function(o,a,u){return u?{jsonrpc:"2.0",id:u,method:o,params:a}:{jsonrpc:"2.0",method:o,params:a}},s.prototype.handleError=function(o){this.requestChannel.emit("error",o)},s.prototype.handleNotification=function(o){this.requestChannel.emit("notification",o)},s}();n.default=i}(Ou)),Ou}var nc={},wh={},_h={},kh={},gA;function lp(){return gA||(gA=1,function(n){var e=kh&&kh.__extends||function(){var r=function(i,s){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var u in a)a.hasOwnProperty(u)&&(o[u]=a[u])},r(i,s)};return function(i,s){r(i,s);function o(){this.constructor=i}i.prototype=s===null?Object.create(s):(o.prototype=s.prototype,new o)}}();Object.defineProperty(n,"__esModule",{value:!0}),n.convertJSONToRPCError=n.JSONRPCError=n.ERR_UNKNOWN=n.ERR_MISSIING_ID=n.ERR_TIMEOUT=void 0,n.ERR_TIMEOUT=7777,n.ERR_MISSIING_ID=7878,n.ERR_UNKNOWN=7979;var t=function(r){e(i,r);function i(s,o,a){var u=this.constructor,l=r.call(this,s)||this;return l.message=s,l.code=o,l.data=a,Object.setPrototypeOf(l,u.prototype),l}return i}(Error);n.JSONRPCError=t,n.convertJSONToRPCError=function(r){if(r.error){var i=r.error,s=i.message,o=i.code,a=i.data;return new t(s,o,a)}return new t("Unknown error",n.ERR_UNKNOWN,r)}}(kh)),kh}var mA;function mG(){if(mA)return _h;mA=1,Object.defineProperty(_h,"__esModule",{value:!0}),_h.TransportRequestManager=void 0;var n=aP(),e=lp(),t=function(){function r(){this.pendingRequest={},this.pendingBatchRequest={},this.transportEventChannel=new n.EventEmitter}return r.prototype.addRequest=function(i,s){return this.transportEventChannel.emit("pending",i),i instanceof Array?(this.addBatchReq(i,s),Promise.resolve()):this.addReq(i.internalID,s)},r.prototype.settlePendingRequest=function(i,s){var o=this;i.forEach(function(a){var u=o.pendingRequest[a.internalID];if(delete o.pendingBatchRequest[a.internalID],u!==void 0){if(s){u.reject(s);return}u.resolve(),(a.request.id===null||a.request.id===void 0)&&delete o.pendingRequest[a.internalID]}})},r.prototype.isPendingRequest=function(i){return this.pendingRequest.hasOwnProperty(i)},r.prototype.resolveResponse=function(i,s){s===void 0&&(s=!0);var o=i;try{return o=JSON.parse(i),this.checkJSONRPC(o)===!1?void 0:o instanceof Array?this.resolveBatch(o,s):this.resolveRes(o,s)}catch{var a=new e.JSONRPCError("Bad response format",e.ERR_UNKNOWN,i);return s&&this.transportEventChannel.emit("error",a),a}},r.prototype.addBatchReq=function(i,s){var o=this;return i.forEach(function(a){var u=a.resolve,l=a.reject,c=a.request.internalID;o.pendingBatchRequest[c]=!0,o.pendingRequest[c]={resolve:u,reject:l}}),Promise.resolve()},r.prototype.addReq=function(i,s){var o=this;return new Promise(function(a,u){s!==null&&s&&o.setRequestTimeout(i,s,u),o.pendingRequest[i]={resolve:a,reject:u}})},r.prototype.checkJSONRPC=function(i){var s=[i];return i instanceof Array&&(s=i),s.every(function(o){return o.result!==void 0||o.error!==void 0||o.method!==void 0})},r.prototype.processResult=function(i,s){if(i.error){var o=e.convertJSONToRPCError(i);s.reject(o);return}s.resolve(i.result)},r.prototype.resolveBatch=function(i,s){var o=this,a=i.map(function(l){return o.resolveRes(l,s)}),u=a.filter(function(l){return l});if(u.length>0)return u[0]},r.prototype.resolveRes=function(i,s){var o=i.id,a=i.error,u=this.pendingRequest[o];if(u){delete this.pendingRequest[o],this.processResult(i,u),this.transportEventChannel.emit("response",i);return}if(o===void 0&&a===void 0){this.transportEventChannel.emit("notification",i);return}var l;return a&&(l=e.convertJSONToRPCError(i)),s&&a&&l&&this.transportEventChannel.emit("error",l),l},r.prototype.setRequestTimeout=function(i,s,o){var a=this;setTimeout(function(){delete a.pendingRequest[i],o(new e.JSONRPCError("Request timeout request took longer than "+s+" ms to resolve",e.ERR_TIMEOUT))},s)},r}();return _h.TransportRequestManager=t,_h}var yA;function tf(){if(yA)return wh;yA=1,Object.defineProperty(wh,"__esModule",{value:!0}),wh.Transport=void 0;var n=mG(),e=function(){function t(){this.transportRequestManager=new n.TransportRequestManager,this.transportRequestManager.transportEventChannel.on("error",function(){})}return t.prototype.subscribe=function(r,i){this.transportRequestManager.transportEventChannel.addListener(r,i)},t.prototype.unsubscribe=function(r,i){if(!r)return this.transportRequestManager.transportEventChannel.removeAllListeners();r&&i&&this.transportRequestManager.transportEventChannel.removeListener(r,i)},t.prototype.parseData=function(r){return r instanceof Array?r.map(function(i){return i.request.request}):r.request},t}();return wh.Transport=e,wh}var db={},vA;function cp(){return vA||(vA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.getNotifications=n.getBatchRequests=n.isNotification=void 0,n.isNotification=function(e){return e.request.id===void 0||e.request.id===null},n.getBatchRequests=function(e){return e instanceof Array?e.filter(function(t){var r=t.request.request.id;return r!=null}).map(function(t){return t.request}):[]},n.getNotifications=function(e){return e instanceof Array?e.filter(function(t){return n.isNotification(t.request)}).map(function(t){return t.request}):n.isNotification(e)?[e]:[]}}(db)),db}var bA;function yG(){if(bA)return nc;bA=1;var n=nc&&nc.__extends||function(){var s=function(o,a){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,l){u.__proto__=l}||function(u,l){for(var c in l)l.hasOwnProperty(c)&&(u[c]=l[c])},s(o,a)};return function(o,a){s(o,a);function u(){this.constructor=o}o.prototype=a===null?Object.create(a):(u.prototype=a.prototype,new u)}}();Object.defineProperty(nc,"__esModule",{value:!0});var e=tf(),t=cp(),r=lp(),i=function(s){n(o,s);function o(a,u,l){var c=s.call(this)||this;return c.connection=a,c.reqUri=u,c.resUri=l,c}return o.prototype.connect=function(){var a=this;return this.connection.on(this.resUri,function(u){a.transportRequestManager.resolveResponse(u)}),Promise.resolve()},o.prototype.sendData=function(a,u){u===void 0&&(u=null);var l=this.transportRequestManager.addRequest(a,u),c=t.getNotifications(a),f=this.parseData(a);try{return this.connection.emit(this.reqUri,f),this.transportRequestManager.settlePendingRequest(c),l}catch(g){var d=new r.JSONRPCError(g.message,r.ERR_UNKNOWN,g);return this.transportRequestManager.settlePendingRequest(c,d),Promise.reject(d)}},o.prototype.close=function(){this.connection.removeAllListeners()},o}(e.Transport);return nc.default=i,nc}var ri={},sr=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{},jr={searchParams:"URLSearchParams"in sr,iterable:"Symbol"in sr&&"iterator"in Symbol,blob:"FileReader"in sr&&"Blob"in sr&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in sr,arrayBuffer:"ArrayBuffer"in sr};function vG(n){return n&&DataView.prototype.isPrototypeOf(n)}if(jr.arrayBuffer)var bG=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],wG=ArrayBuffer.isView||function(n){return n&&bG.indexOf(Object.prototype.toString.call(n))>-1};function nf(n){if(typeof n!="string"&&(n=String(n)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(n)||n==="")throw new TypeError('Invalid character in header field name: "'+n+'"');return n.toLowerCase()}function $k(n){return typeof n!="string"&&(n=String(n)),n}function zk(n){var e={next:function(){var t=n.shift();return{done:t===void 0,value:t}}};return jr.iterable&&(e[Symbol.iterator]=function(){return e}),e}function Fn(n){this.map={},n instanceof Fn?n.forEach(function(e,t){this.append(t,e)},this):Array.isArray(n)?n.forEach(function(e){if(e.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])},this):n&&Object.getOwnPropertyNames(n).forEach(function(e){this.append(e,n[e])},this)}Fn.prototype.append=function(n,e){n=nf(n),e=$k(e);var t=this.map[n];this.map[n]=t?t+", "+e:e};Fn.prototype.delete=function(n){delete this.map[nf(n)]};Fn.prototype.get=function(n){return n=nf(n),this.has(n)?this.map[n]:null};Fn.prototype.has=function(n){return this.map.hasOwnProperty(nf(n))};Fn.prototype.set=function(n,e){this.map[nf(n)]=$k(e)};Fn.prototype.forEach=function(n,e){for(var t in this.map)this.map.hasOwnProperty(t)&&n.call(e,this.map[t],t,this)};Fn.prototype.keys=function(){var n=[];return this.forEach(function(e,t){n.push(t)}),zk(n)};Fn.prototype.values=function(){var n=[];return this.forEach(function(e){n.push(e)}),zk(n)};Fn.prototype.entries=function(){var n=[];return this.forEach(function(e,t){n.push([t,e])}),zk(n)};jr.iterable&&(Fn.prototype[Symbol.iterator]=Fn.prototype.entries);function pb(n){if(!n._noBody){if(n.bodyUsed)return Promise.reject(new TypeError("Already read"));n.bodyUsed=!0}}function uP(n){return new Promise(function(e,t){n.onload=function(){e(n.result)},n.onerror=function(){t(n.error)}})}function _G(n){var e=new FileReader,t=uP(e);return e.readAsArrayBuffer(n),t}function kG(n){var e=new FileReader,t=uP(e),r=/charset=([A-Za-z0-9_-]+)/.exec(n.type),i=r?r[1]:"utf-8";return e.readAsText(n,i),t}function xG(n){for(var e=new Uint8Array(n),t=new Array(e.length),r=0;r<e.length;r++)t[r]=String.fromCharCode(e[r]);return t.join("")}function wA(n){if(n.slice)return n.slice(0);var e=new Uint8Array(n.byteLength);return e.set(new Uint8Array(n)),e.buffer}function lP(){return this.bodyUsed=!1,this._initBody=function(n){this.bodyUsed=this.bodyUsed,this._bodyInit=n,n?typeof n=="string"?this._bodyText=n:jr.blob&&Blob.prototype.isPrototypeOf(n)?this._bodyBlob=n:jr.formData&&FormData.prototype.isPrototypeOf(n)?this._bodyFormData=n:jr.searchParams&&URLSearchParams.prototype.isPrototypeOf(n)?this._bodyText=n.toString():jr.arrayBuffer&&jr.blob&&vG(n)?(this._bodyArrayBuffer=wA(n.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):jr.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(n)||wG(n))?this._bodyArrayBuffer=wA(n):this._bodyText=n=Object.prototype.toString.call(n):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof n=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):jr.searchParams&&URLSearchParams.prototype.isPrototypeOf(n)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},jr.blob&&(this.blob=function(){var n=pb(this);if(n)return n;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var n=pb(this);return n||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(jr.blob)return this.blob().then(_G);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var n=pb(this);if(n)return n;if(this._bodyBlob)return kG(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(xG(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},jr.formData&&(this.formData=function(){return this.text().then(EG)}),this.json=function(){return this.text().then(JSON.parse)},this}var SG=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function CG(n){var e=n.toUpperCase();return SG.indexOf(e)>-1?e:n}function gl(n,e){if(!(this instanceof gl))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e=e||{};var t=e.body;if(n instanceof gl){if(n.bodyUsed)throw new TypeError("Already read");this.url=n.url,this.credentials=n.credentials,e.headers||(this.headers=new Fn(n.headers)),this.method=n.method,this.mode=n.mode,this.signal=n.signal,!t&&n._bodyInit!=null&&(t=n._bodyInit,n.bodyUsed=!0)}else this.url=String(n);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new Fn(e.headers)),this.method=CG(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in sr){var s=new AbortController;return s.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&t)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(t),(this.method==="GET"||this.method==="HEAD")&&(e.cache==="no-store"||e.cache==="no-cache")){var r=/([?&])_=[^&]*/;if(r.test(this.url))this.url=this.url.replace(r,"$1_="+new Date().getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}gl.prototype.clone=function(){return new gl(this,{body:this._bodyInit})};function EG(n){var e=new FormData;return n.trim().split("&").forEach(function(t){if(t){var r=t.split("="),i=r.shift().replace(/\+/g," "),s=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(s))}}),e}function AG(n){var e=new Fn,t=n.replace(/\r?\n[\t ]+/g," ");return t.split("\r").map(function(r){return r.indexOf(`
|
|
45
|
-
`)===0?r.substr(1,r.length):r}).forEach(function(r){var i=r.split(":"),s=i.shift().trim();if(s){var o=i.join(":").trim();try{e.append(s,o)}catch(a){console.warn("Response "+a.message)}}}),e}lP.call(gl.prototype);function wo(n,e){if(!(this instanceof wo))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=e.status===void 0?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText===void 0?"":""+e.statusText,this.headers=new Fn(e.headers),this.url=e.url||"",this._initBody(n)}lP.call(wo.prototype);wo.prototype.clone=function(){return new wo(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Fn(this.headers),url:this.url})};wo.error=function(){var n=new wo(null,{status:200,statusText:""});return n.ok=!1,n.status=0,n.type="error",n};var RG=[301,302,303,307,308];wo.redirect=function(n,e){if(RG.indexOf(e)===-1)throw new RangeError("Invalid status code");return new wo(null,{status:e,headers:{location:n}})};var Yu=sr.DOMException;try{new Yu}catch{Yu=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},Yu.prototype=Object.create(Error.prototype),Yu.prototype.constructor=Yu}function cP(n,e){return new Promise(function(t,r){var i=new gl(n,e);if(i.signal&&i.signal.aborted)return r(new Yu("Aborted","AbortError"));var s=new XMLHttpRequest;function o(){s.abort()}s.onload=function(){var l={statusText:s.statusText,headers:AG(s.getAllResponseHeaders()||"")};i.url.indexOf("file://")===0&&(s.status<200||s.status>599)?l.status=200:l.status=s.status,l.url="responseURL"in s?s.responseURL:l.headers.get("X-Request-URL");var c="response"in s?s.response:s.responseText;setTimeout(function(){t(new wo(c,l))},0)},s.onerror=function(){setTimeout(function(){r(new TypeError("Network request failed"))},0)},s.ontimeout=function(){setTimeout(function(){r(new TypeError("Network request timed out"))},0)},s.onabort=function(){setTimeout(function(){r(new Yu("Aborted","AbortError"))},0)};function a(l){try{return l===""&&sr.location.href?sr.location.href:l}catch{return l}}if(s.open(i.method,a(i.url),!0),i.credentials==="include"?s.withCredentials=!0:i.credentials==="omit"&&(s.withCredentials=!1),"responseType"in s&&(jr.blob?s.responseType="blob":jr.arrayBuffer&&(s.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof Fn||sr.Headers&&e.headers instanceof sr.Headers)){var u=[];Object.getOwnPropertyNames(e.headers).forEach(function(l){u.push(nf(l)),s.setRequestHeader(l,$k(e.headers[l]))}),i.headers.forEach(function(l,c){u.indexOf(c)===-1&&s.setRequestHeader(c,l)})}else i.headers.forEach(function(l,c){s.setRequestHeader(c,l)});i.signal&&(i.signal.addEventListener("abort",o),s.onreadystatechange=function(){s.readyState===4&&i.signal.removeEventListener("abort",o)}),s.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}cP.polyfill=!0;sr.fetch||(sr.fetch=cP,sr.Headers=Fn,sr.Request=gl,sr.Response=wo);var gb,_A;function DG(){return _A||(_A=1,gb=self.fetch.bind(self)),gb}var kA;function TG(){if(kA)return ri;kA=1;var n=ri&&ri.__extends||function(){var l=function(c,f){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,g){d.__proto__=g}||function(d,g){for(var m in g)g.hasOwnProperty(m)&&(d[m]=g[m])},l(c,f)};return function(c,f){l(c,f);function d(){this.constructor=c}c.prototype=f===null?Object.create(f):(d.prototype=f.prototype,new d)}}(),e=ri&&ri.__awaiter||function(l,c,f,d){function g(m){return m instanceof f?m:new f(function(y){y(m)})}return new(f||(f=Promise))(function(m,y){function b(_){try{x(d.next(_))}catch(S){y(S)}}function w(_){try{x(d.throw(_))}catch(S){y(S)}}function x(_){_.done?m(_.value):g(_.value).then(b,w)}x((d=d.apply(l,c||[])).next())})},t=ri&&ri.__generator||function(l,c){var f={label:0,sent:function(){if(m[0]&1)throw m[1];return m[1]},trys:[],ops:[]},d,g,m,y;return y={next:b(0),throw:b(1),return:b(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function b(x){return function(_){return w([x,_])}}function w(x){if(d)throw new TypeError("Generator is already executing.");for(;f;)try{if(d=1,g&&(m=x[0]&2?g.return:x[0]?g.throw||((m=g.return)&&m.call(g),0):g.next)&&!(m=m.call(g,x[1])).done)return m;switch(g=0,m&&(x=[x[0]&2,m.value]),x[0]){case 0:case 1:m=x;break;case 4:return f.label++,{value:x[1],done:!1};case 5:f.label++,g=x[1],x=[0];continue;case 7:x=f.ops.pop(),f.trys.pop();continue;default:if(m=f.trys,!(m=m.length>0&&m[m.length-1])&&(x[0]===6||x[0]===2)){f=0;continue}if(x[0]===3&&(!m||x[1]>m[0]&&x[1]<m[3])){f.label=x[1];break}if(x[0]===6&&f.label<m[1]){f.label=m[1],m=x;break}if(m&&f.label<m[2]){f.label=m[2],f.ops.push(x);break}m[2]&&f.ops.pop(),f.trys.pop();continue}x=c.call(l,f)}catch(_){x=[6,_],g=0}finally{d=m=0}if(x[0]&5)throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}},r=ri&&ri.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(ri,"__esModule",{value:!0}),ri.HTTPTransport=void 0;var i=r(DG()),s=tf(),o=cp(),a=lp(),u=function(l){n(c,l);function c(f,d){var g=l.call(this)||this;return g.onlyNotifications=function(m){return m instanceof Array?m.every(function(y){return y.request.request.id===null||y.request.request.id===void 0}):m.request.id===null||m.request.id===void 0},g.uri=f,g.credentials=d&&d.credentials,g.headers=c.setupHeaders(d&&d.headers),g.injectedFetcher=d?.fetcher,g}return c.prototype.connect=function(){return Promise.resolve()},c.prototype.sendData=function(f,d){return d===void 0&&(d=null),e(this,void 0,void 0,function(){var g,m,y,b,w,x,S,_,S;return t(this,function(C){switch(C.label){case 0:g=this.transportRequestManager.addRequest(f,d),m=o.getNotifications(f),y=o.getBatchRequests(f),b=this.injectedFetcher||i.default,C.label=1;case 1:return C.trys.push([1,4,,5]),[4,b(this.uri,{method:"POST",headers:this.headers,body:JSON.stringify(this.parseData(f)),credentials:this.credentials})];case 2:return w=C.sent(),this.transportRequestManager.settlePendingRequest(m),this.onlyNotifications(f)?[2,Promise.resolve()]:[4,w.text()];case 3:return x=C.sent(),S=this.transportRequestManager.resolveResponse(x),S?(this.transportRequestManager.settlePendingRequest(y,S),[2,Promise.reject(S)]):[3,5];case 4:return _=C.sent(),S=new a.JSONRPCError(_.message,a.ERR_UNKNOWN,_),this.transportRequestManager.settlePendingRequest(m,S),this.transportRequestManager.settlePendingRequest(o.getBatchRequests(f),S),[2,Promise.reject(S)];case 5:return[2,g]}})})},c.prototype.close=function(){},c.setupHeaders=function(f){var d=new Headers(f);return d.set("Content-Type","application/json"),d},c}(s.Transport);return ri.HTTPTransport=u,ri.default=u,ri}var zi={},uc=null;typeof WebSocket<"u"?uc=WebSocket:typeof MozWebSocket<"u"?uc=MozWebSocket:typeof global<"u"?uc=global.WebSocket||global.MozWebSocket:typeof window<"u"?uc=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(uc=self.WebSocket||self.MozWebSocket);const IG=uc,MG=Object.freeze(Object.defineProperty({__proto__:null,default:IG},Symbol.toStringTag,{value:"Module"})),OG=W1(MG);var xA;function PG(){if(xA)return zi;xA=1;var n=zi&&zi.__extends||function(){var l=function(c,f){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,g){d.__proto__=g}||function(d,g){for(var m in g)g.hasOwnProperty(m)&&(d[m]=g[m])},l(c,f)};return function(c,f){l(c,f);function d(){this.constructor=c}c.prototype=f===null?Object.create(f):(d.prototype=f.prototype,new d)}}(),e=zi&&zi.__awaiter||function(l,c,f,d){function g(m){return m instanceof f?m:new f(function(y){y(m)})}return new(f||(f=Promise))(function(m,y){function b(_){try{x(d.next(_))}catch(S){y(S)}}function w(_){try{x(d.throw(_))}catch(S){y(S)}}function x(_){_.done?m(_.value):g(_.value).then(b,w)}x((d=d.apply(l,c||[])).next())})},t=zi&&zi.__generator||function(l,c){var f={label:0,sent:function(){if(m[0]&1)throw m[1];return m[1]},trys:[],ops:[]},d,g,m,y;return y={next:b(0),throw:b(1),return:b(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function b(x){return function(_){return w([x,_])}}function w(x){if(d)throw new TypeError("Generator is already executing.");for(;f;)try{if(d=1,g&&(m=x[0]&2?g.return:x[0]?g.throw||((m=g.return)&&m.call(g),0):g.next)&&!(m=m.call(g,x[1])).done)return m;switch(g=0,m&&(x=[x[0]&2,m.value]),x[0]){case 0:case 1:m=x;break;case 4:return f.label++,{value:x[1],done:!1};case 5:f.label++,g=x[1],x=[0];continue;case 7:x=f.ops.pop(),f.trys.pop();continue;default:if(m=f.trys,!(m=m.length>0&&m[m.length-1])&&(x[0]===6||x[0]===2)){f=0;continue}if(x[0]===3&&(!m||x[1]>m[0]&&x[1]<m[3])){f.label=x[1];break}if(x[0]===6&&f.label<m[1]){f.label=m[1],m=x;break}if(m&&f.label<m[2]){f.label=m[2],f.ops.push(x);break}m[2]&&f.ops.pop(),f.trys.pop();continue}x=c.call(l,f)}catch(_){x=[6,_],g=0}finally{d=m=0}if(x[0]&5)throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}},r=zi&&zi.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(zi,"__esModule",{value:!0});var i=r(OG),s=tf(),o=cp(),a=lp(),u=function(l){n(c,l);function c(f){var d=l.call(this)||this;return d.uri=f,d.connection=new i.default(f),d}return c.prototype.connect=function(){var f=this;return new Promise(function(d,g){var m=function(){f.connection.removeEventListener("open",m),d()};f.connection.addEventListener("open",m),f.connection.addEventListener("message",function(y){var b=y.data;f.transportRequestManager.resolveResponse(b)})})},c.prototype.sendData=function(f,d){return d===void 0&&(d=5e3),e(this,void 0,void 0,function(){var g,m,y;return t(this,function(b){g=this.transportRequestManager.addRequest(f,d),m=o.getNotifications(f);try{this.connection.send(JSON.stringify(this.parseData(f))),this.transportRequestManager.settlePendingRequest(m)}catch(w){y=new a.JSONRPCError(w.message,a.ERR_UNKNOWN,w),this.transportRequestManager.settlePendingRequest(m,y),this.transportRequestManager.settlePendingRequest(o.getBatchRequests(f),y),g=Promise.reject(y)}return[2,g]})})},c.prototype.close=function(){this.connection.close()},c}(s.Transport);return zi.default=u,zi}var Zs={},SA;function LG(){if(SA)return Zs;SA=1;var n=Zs&&Zs.__extends||function(){var a=function(u,l){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,f){c.__proto__=f}||function(c,f){for(var d in f)f.hasOwnProperty(d)&&(c[d]=f[d])},a(u,l)};return function(u,l){a(u,l);function c(){this.constructor=u}u.prototype=l===null?Object.create(l):(c.prototype=l.prototype,new c)}}(),e=Zs&&Zs.__awaiter||function(a,u,l,c){function f(d){return d instanceof l?d:new l(function(g){g(d)})}return new(l||(l=Promise))(function(d,g){function m(w){try{b(c.next(w))}catch(x){g(x)}}function y(w){try{b(c.throw(w))}catch(x){g(x)}}function b(w){w.done?d(w.value):f(w.value).then(m,y)}b((c=c.apply(a,u||[])).next())})},t=Zs&&Zs.__generator||function(a,u){var l={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},c,f,d,g;return g={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function m(b){return function(w){return y([b,w])}}function y(b){if(c)throw new TypeError("Generator is already executing.");for(;l;)try{if(c=1,f&&(d=b[0]&2?f.return:b[0]?f.throw||((d=f.return)&&d.call(f),0):f.next)&&!(d=d.call(f,b[1])).done)return d;switch(f=0,d&&(b=[b[0]&2,d.value]),b[0]){case 0:case 1:d=b;break;case 4:return l.label++,{value:b[1],done:!1};case 5:l.label++,f=b[1],b=[0];continue;case 7:b=l.ops.pop(),l.trys.pop();continue;default:if(d=l.trys,!(d=d.length>0&&d[d.length-1])&&(b[0]===6||b[0]===2)){l=0;continue}if(b[0]===3&&(!d||b[1]>d[0]&&b[1]<d[3])){l.label=b[1];break}if(b[0]===6&&l.label<d[1]){l.label=d[1],d=b;break}if(d&&l.label<d[2]){l.label=d[2],l.ops.push(b);break}d[2]&&l.ops.pop(),l.trys.pop();continue}b=u.call(a,l)}catch(w){b=[6,w],f=0}finally{c=d=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}};Object.defineProperty(Zs,"__esModule",{value:!0});var r=tf(),i=cp(),s=function(a){var u=400,l=window.screen.height,c=0,f=0;return window.open(a,"inspector:popup","left="+c+",top="+f+",width="+u+",height="+l+",resizable,scrollbars=yes,status=1")},o=function(a){n(u,a);function u(l){var c=a.call(this)||this;return c.messageHandler=function(f){c.transportRequestManager.resolveResponse(JSON.stringify(f.data))},c.uri=l,c.postMessageID="post-message-transport-"+Math.random(),c}return u.prototype.createWindow=function(l){return new Promise(function(c,f){var d;d=s(l),setTimeout(function(){c(d)},3e3)})},u.prototype.connect=function(){var l=this,c=/^(http|https):\/\/.*$/;return new Promise(function(f,d){return e(l,void 0,void 0,function(){var g;return t(this,function(m){switch(m.label){case 0:return c.test(this.uri)||d(new Error("Bad URI")),g=this,[4,this.createWindow(this.uri)];case 1:return g.frame=m.sent(),window.addEventListener("message",this.messageHandler),f(),[2]}})})})},u.prototype.sendData=function(l,c){return e(this,void 0,void 0,function(){var f,d;return t(this,function(g){return f=this.transportRequestManager.addRequest(l,null),d=i.getNotifications(l),this.frame&&(this.frame.postMessage(l.request,this.uri),this.transportRequestManager.settlePendingRequest(d)),[2,f]})})},u.prototype.close=function(){this.frame&&(window.removeEventListener("message",this.messageHandler),this.frame.close())},u}(r.Transport);return Zs.default=o,Zs}var Xs={},CA;function FG(){if(CA)return Xs;CA=1;var n=Xs&&Xs.__extends||function(){var o=function(a,u){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,c){l.__proto__=c}||function(l,c){for(var f in c)c.hasOwnProperty(f)&&(l[f]=c[f])},o(a,u)};return function(a,u){o(a,u);function l(){this.constructor=a}a.prototype=u===null?Object.create(u):(l.prototype=u.prototype,new l)}}(),e=Xs&&Xs.__awaiter||function(o,a,u,l){function c(f){return f instanceof u?f:new u(function(d){d(f)})}return new(u||(u=Promise))(function(f,d){function g(b){try{y(l.next(b))}catch(w){d(w)}}function m(b){try{y(l.throw(b))}catch(w){d(w)}}function y(b){b.done?f(b.value):c(b.value).then(g,m)}y((l=l.apply(o,a||[])).next())})},t=Xs&&Xs.__generator||function(o,a){var u={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},l,c,f,d;return d={next:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function g(y){return function(b){return m([y,b])}}function m(y){if(l)throw new TypeError("Generator is already executing.");for(;u;)try{if(l=1,c&&(f=y[0]&2?c.return:y[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,y[1])).done)return f;switch(c=0,f&&(y=[y[0]&2,f.value]),y[0]){case 0:case 1:f=y;break;case 4:return u.label++,{value:y[1],done:!1};case 5:u.label++,c=y[1],y=[0];continue;case 7:y=u.ops.pop(),u.trys.pop();continue;default:if(f=u.trys,!(f=f.length>0&&f[f.length-1])&&(y[0]===6||y[0]===2)){u=0;continue}if(y[0]===3&&(!f||y[1]>f[0]&&y[1]<f[3])){u.label=y[1];break}if(y[0]===6&&u.label<f[1]){u.label=f[1],f=y;break}if(f&&u.label<f[2]){u.label=f[2],u.ops.push(y);break}f[2]&&u.ops.pop(),u.trys.pop();continue}y=a.call(o,u)}catch(b){y=[6,b],c=0}finally{l=f=0}if(y[0]&5)throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}};Object.defineProperty(Xs,"__esModule",{value:!0});var r=tf(),i=cp(),s=function(o){n(a,o);function a(u){var l=o.call(this)||this;return l.messageHandler=function(c){l.transportRequestManager.resolveResponse(JSON.stringify(c.data))},l.uri=u,l.postMessageID="post-message-transport-"+Math.random(),l}return a.prototype.createWindow=function(u){var l=this;return new Promise(function(c,f){var d,g=document.createElement("iframe");g.setAttribute("id",l.postMessageID),g.setAttribute("width","0px"),g.setAttribute("height","0px"),g.setAttribute("style","visiblity:hidden;border:none;outline:none;"),g.addEventListener("load",function(){c(d)}),g.setAttribute("src",u),window.document.body.appendChild(g),d=g.contentWindow})},a.prototype.connect=function(){var u=this,l=/^(http|https):\/\/.*$/;return new Promise(function(c,f){return e(u,void 0,void 0,function(){var d;return t(this,function(g){switch(g.label){case 0:return l.test(this.uri)||f(new Error("Bad URI")),d=this,[4,this.createWindow(this.uri)];case 1:return d.frame=g.sent(),window.addEventListener("message",this.messageHandler),c(),[2]}})})})},a.prototype.sendData=function(u,l){return e(this,void 0,void 0,function(){var c,f;return t(this,function(d){return c=this.transportRequestManager.addRequest(u,null),f=i.getNotifications(u),this.frame&&(this.frame.postMessage(u.request,"*"),this.transportRequestManager.settlePendingRequest(f)),[2,c]})})},a.prototype.close=function(){var u=document.getElementById(this.postMessageID);u?.remove(),window.removeEventListener("message",this.messageHandler)},a}(r.Transport);return Xs.default=s,Xs}var Fa={},EA;function NG(){if(EA)return Fa;EA=1;var n=Fa&&Fa.__awaiter||function(r,i,s,o){function a(u){return u instanceof s?u:new s(function(l){l(u)})}return new(s||(s=Promise))(function(u,l){function c(g){try{d(o.next(g))}catch(m){l(m)}}function f(g){try{d(o.throw(g))}catch(m){l(m)}}function d(g){g.done?u(g.value):a(g.value).then(c,f)}d((o=o.apply(r,i||[])).next())})},e=Fa&&Fa.__generator||function(r,i){var s={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,l;return l={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function c(d){return function(g){return f([d,g])}}function f(d){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,a&&(u=d[0]&2?a.return:d[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,d[1])).done)return u;switch(a=0,u&&(d=[d[0]&2,u.value]),d[0]){case 0:case 1:u=d;break;case 4:return s.label++,{value:d[1],done:!1};case 5:s.label++,a=d[1],d=[0];continue;case 7:d=s.ops.pop(),s.trys.pop();continue;default:if(u=s.trys,!(u=u.length>0&&u[u.length-1])&&(d[0]===6||d[0]===2)){s=0;continue}if(d[0]===3&&(!u||d[1]>u[0]&&d[1]<u[3])){s.label=d[1];break}if(d[0]===6&&s.label<u[1]){s.label=u[1],u=d;break}if(u&&s.label<u[2]){s.label=u[2],s.ops.push(d);break}u[2]&&s.ops.pop(),s.trys.pop();continue}d=i.call(r,s)}catch(g){d=[6,g],a=0}finally{o=u=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}};Object.defineProperty(Fa,"__esModule",{value:!0});var t=function(){function r(i){this.requestManager=i}return r.prototype.startBatch=function(){return this.requestManager.startBatch()},r.prototype.stopBatch=function(){return this.requestManager.stopBatch()},r.prototype.request=function(i,s){return n(this,void 0,void 0,function(){return e(this,function(o){switch(o.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:o.sent(),o.label=2;case 2:return[2,this.requestManager.request(i,!1,s)]}})})},r.prototype.notify=function(i){return n(this,void 0,void 0,function(){return e(this,function(s){switch(s.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:s.sent(),s.label=2;case 2:return[2,this.requestManager.request(i,!0,null)]}})})},r.prototype.onNotification=function(i){this.requestManager.requestChannel.addListener("notification",i)},r.prototype.onError=function(i){this.requestManager.requestChannel.addListener("error",i)},r.prototype.close=function(){this.requestManager.close()},r}();return Fa.default=t,Fa}var AA;function BG(){return AA||(AA=1,function(n){var e=bh&&bh.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(n,"__esModule",{value:!0}),n.PostMessageIframeTransport=n.PostMessageWindowTransport=n.JSONRPCError=n.WebSocketTransport=n.EventEmitterTransport=n.HTTPTransport=n.RequestManager=n.Client=void 0;var t=e(gG());n.RequestManager=t.default;var r=e(yG());n.EventEmitterTransport=r.default;var i=e(TG());n.HTTPTransport=i.default;var s=e(PG());n.WebSocketTransport=s.default;var o=e(LG());n.PostMessageWindowTransport=o.default;var a=e(FG());n.PostMessageIframeTransport=a.default;var u=lp();Object.defineProperty(n,"JSONRPCError",{enumerable:!0,get:function(){return u.JSONRPCError}});var l=e(NG());n.Client=l.default,n.default=l.default}(bh)),bh}var RA=BG(),Pu={},Lu={},s0={},mb={},Ne={},Jn={},DA;function fp(){if(DA)return Jn;DA=1,Object.defineProperty(Jn,"__esModule",{value:!0}),Jn.stringArray=Jn.array=Jn.func=Jn.error=Jn.number=Jn.string=Jn.boolean=void 0;function n(a){return a===!0||a===!1}Jn.boolean=n;function e(a){return typeof a=="string"||a instanceof String}Jn.string=e;function t(a){return typeof a=="number"||a instanceof Number}Jn.number=t;function r(a){return a instanceof Error}Jn.error=r;function i(a){return typeof a=="function"}Jn.func=i;function s(a){return Array.isArray(a)}Jn.array=s;function o(a){return s(a)&&a.every(u=>e(u))}return Jn.stringArray=o,Jn}var TA;function fP(){if(TA)return Ne;TA=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.Message=Ne.NotificationType9=Ne.NotificationType8=Ne.NotificationType7=Ne.NotificationType6=Ne.NotificationType5=Ne.NotificationType4=Ne.NotificationType3=Ne.NotificationType2=Ne.NotificationType1=Ne.NotificationType0=Ne.NotificationType=Ne.RequestType9=Ne.RequestType8=Ne.RequestType7=Ne.RequestType6=Ne.RequestType5=Ne.RequestType4=Ne.RequestType3=Ne.RequestType2=Ne.RequestType1=Ne.RequestType=Ne.RequestType0=Ne.AbstractMessageSignature=Ne.ParameterStructures=Ne.ResponseError=Ne.ErrorCodes=void 0;const n=fp();var e;(function(F){F.ParseError=-32700,F.InvalidRequest=-32600,F.MethodNotFound=-32601,F.InvalidParams=-32602,F.InternalError=-32603,F.jsonrpcReservedErrorRangeStart=-32099,F.serverErrorStart=-32099,F.MessageWriteError=-32099,F.MessageReadError=-32098,F.PendingResponseRejected=-32097,F.ConnectionInactive=-32096,F.ServerNotInitialized=-32002,F.UnknownErrorCode=-32001,F.jsonrpcReservedErrorRangeEnd=-32e3,F.serverErrorEnd=-32e3})(e||(Ne.ErrorCodes=e={}));class t extends Error{constructor(R,Y,q){super(Y),this.code=n.number(R)?R:e.UnknownErrorCode,this.data=q,Object.setPrototypeOf(this,t.prototype)}toJson(){const R={code:this.code,message:this.message};return this.data!==void 0&&(R.data=this.data),R}}Ne.ResponseError=t;class r{constructor(R){this.kind=R}static is(R){return R===r.auto||R===r.byName||R===r.byPosition}toString(){return this.kind}}Ne.ParameterStructures=r,r.auto=new r("auto"),r.byPosition=new r("byPosition"),r.byName=new r("byName");class i{constructor(R,Y){this.method=R,this.numberOfParams=Y}get parameterStructures(){return r.auto}}Ne.AbstractMessageSignature=i;class s extends i{constructor(R){super(R,0)}}Ne.RequestType0=s;class o extends i{constructor(R,Y=r.auto){super(R,1),this._parameterStructures=Y}get parameterStructures(){return this._parameterStructures}}Ne.RequestType=o;class a extends i{constructor(R,Y=r.auto){super(R,1),this._parameterStructures=Y}get parameterStructures(){return this._parameterStructures}}Ne.RequestType1=a;class u extends i{constructor(R){super(R,2)}}Ne.RequestType2=u;class l extends i{constructor(R){super(R,3)}}Ne.RequestType3=l;class c extends i{constructor(R){super(R,4)}}Ne.RequestType4=c;class f extends i{constructor(R){super(R,5)}}Ne.RequestType5=f;class d extends i{constructor(R){super(R,6)}}Ne.RequestType6=d;class g extends i{constructor(R){super(R,7)}}Ne.RequestType7=g;class m extends i{constructor(R){super(R,8)}}Ne.RequestType8=m;class y extends i{constructor(R){super(R,9)}}Ne.RequestType9=y;class b extends i{constructor(R,Y=r.auto){super(R,1),this._parameterStructures=Y}get parameterStructures(){return this._parameterStructures}}Ne.NotificationType=b;class w extends i{constructor(R){super(R,0)}}Ne.NotificationType0=w;class x extends i{constructor(R,Y=r.auto){super(R,1),this._parameterStructures=Y}get parameterStructures(){return this._parameterStructures}}Ne.NotificationType1=x;class _ extends i{constructor(R){super(R,2)}}Ne.NotificationType2=_;class S extends i{constructor(R){super(R,3)}}Ne.NotificationType3=S;class C extends i{constructor(R){super(R,4)}}Ne.NotificationType4=C;class A extends i{constructor(R){super(R,5)}}Ne.NotificationType5=A;class I extends i{constructor(R){super(R,6)}}Ne.NotificationType6=I;class W extends i{constructor(R){super(R,7)}}Ne.NotificationType7=W;class B extends i{constructor(R){super(R,8)}}Ne.NotificationType8=B;class K extends i{constructor(R){super(R,9)}}Ne.NotificationType9=K;var G;return function(F){function R(te){const ae=te;return ae&&n.string(ae.method)&&(n.string(ae.id)||n.number(ae.id))}F.isRequest=R;function Y(te){const ae=te;return ae&&n.string(ae.method)&&te.id===void 0}F.isNotification=Y;function q(te){const ae=te;return ae&&(ae.result!==void 0||!!ae.error)&&(n.string(ae.id)||n.number(ae.id)||ae.id===null)}F.isResponse=q}(G||(Ne.Message=G={})),Ne}var Ho={},IA;function hP(){if(IA)return Ho;IA=1;var n;Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.LRUCache=Ho.LinkedMap=Ho.Touch=void 0;var e;(function(i){i.None=0,i.First=1,i.AsOld=i.First,i.Last=2,i.AsNew=i.Last})(e||(Ho.Touch=e={}));class t{constructor(){this[n]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(s){return this._map.has(s)}get(s,o=e.None){const a=this._map.get(s);if(a)return o!==e.None&&this.touch(a,o),a.value}set(s,o,a=e.None){let u=this._map.get(s);if(u)u.value=o,a!==e.None&&this.touch(u,a);else{switch(u={key:s,value:o,next:void 0,previous:void 0},a){case e.None:this.addItemLast(u);break;case e.First:this.addItemFirst(u);break;case e.Last:this.addItemLast(u);break;default:this.addItemLast(u);break}this._map.set(s,u),this._size++}return this}delete(s){return!!this.remove(s)}remove(s){const o=this._map.get(s);if(o)return this._map.delete(s),this.removeItem(o),this._size--,o.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const s=this._head;return this._map.delete(s.key),this.removeItem(s),this._size--,s.value}forEach(s,o){const a=this._state;let u=this._head;for(;u;){if(o?s.bind(o)(u.value,u.key,this):s(u.value,u.key,this),this._state!==a)throw new Error("LinkedMap got modified during iteration.");u=u.next}}keys(){const s=this._state;let o=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const u={value:o.key,done:!1};return o=o.next,u}else return{value:void 0,done:!0}}};return a}values(){const s=this._state;let o=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const u={value:o.value,done:!1};return o=o.next,u}else return{value:void 0,done:!0}}};return a}entries(){const s=this._state;let o=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const u={value:[o.key,o.value],done:!1};return o=o.next,u}else return{value:void 0,done:!0}}};return a}[(n=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let o=this._head,a=this.size;for(;o&&a>s;)this._map.delete(o.key),o=o.next,a--;this._head=o,this._size=a,o&&(o.previous=void 0),this._state++}addItemFirst(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw new Error("Invalid list");this._head=s,this._state++}addItemLast(s){if(!this._head&&!this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw new Error("Invalid list");this._tail=s,this._state++}removeItem(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw new Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw new Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{const o=s.next,a=s.previous;if(!o||!a)throw new Error("Invalid list");o.previous=a,a.next=o}s.next=void 0,s.previous=void 0,this._state++}touch(s,o){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(o!==e.First&&o!==e.Last)){if(o===e.First){if(s===this._head)return;const a=s.next,u=s.previous;s===this._tail?(u.next=void 0,this._tail=u):(a.previous=u,u.next=a),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(o===e.Last){if(s===this._tail)return;const a=s.next,u=s.previous;s===this._head?(a.previous=void 0,this._head=a):(a.previous=u,u.next=a),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){const s=[];return this.forEach((o,a)=>{s.push([a,o])}),s}fromJSON(s){this.clear();for(const[o,a]of s)this.set(o,a)}}Ho.LinkedMap=t;class r extends t{constructor(s,o=1){super(),this._limit=s,this._ratio=Math.min(Math.max(0,o),1)}get limit(){return this._limit}set limit(s){this._limit=s,this.checkTrim()}get ratio(){return this._ratio}set ratio(s){this._ratio=Math.min(Math.max(0,s),1),this.checkTrim()}get(s,o=e.AsNew){return super.get(s,o)}peek(s){return super.get(s,e.None)}set(s,o){return super.set(s,o,e.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}return Ho.LRUCache=r,Ho}var xh={},MA;function qG(){if(MA)return xh;MA=1,Object.defineProperty(xh,"__esModule",{value:!0}),xh.Disposable=void 0;var n;return function(e){function t(r){return{dispose:r}}e.create=t}(n||(xh.Disposable=n={})),xh}var Fu={},o0={},OA;function kl(){if(OA)return o0;OA=1,Object.defineProperty(o0,"__esModule",{value:!0});let n;function e(){if(n===void 0)throw new Error("No runtime abstraction layer installed");return n}return function(t){function r(i){if(i===void 0)throw new Error("No runtime abstraction layer provided");n=i}t.install=r}(e||(e={})),o0.default=e,o0}var PA;function hp(){if(PA)return Fu;PA=1,Object.defineProperty(Fu,"__esModule",{value:!0}),Fu.Emitter=Fu.Event=void 0;const n=kl();var e;(function(i){const s={dispose(){}};i.None=function(){return s}})(e||(Fu.Event=e={}));class t{add(s,o=null,a){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(s),this._contexts.push(o),Array.isArray(a)&&a.push({dispose:()=>this.remove(s,o)})}remove(s,o=null){if(!this._callbacks)return;let a=!1;for(let u=0,l=this._callbacks.length;u<l;u++)if(this._callbacks[u]===s)if(this._contexts[u]===o){this._callbacks.splice(u,1),this._contexts.splice(u,1);return}else a=!0;if(a)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...s){if(!this._callbacks)return[];const o=[],a=this._callbacks.slice(0),u=this._contexts.slice(0);for(let l=0,c=a.length;l<c;l++)try{o.push(a[l].apply(u[l],s))}catch(f){(0,n.default)().console.error(f)}return o}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class r{constructor(s){this._options=s}get event(){return this._event||(this._event=(s,o,a)=>{this._callbacks||(this._callbacks=new t),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(s,o);const u={dispose:()=>{this._callbacks&&(this._callbacks.remove(s,o),u.dispose=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(a)&&a.push(u),u}),this._event}fire(s){this._callbacks&&this._callbacks.invoke.call(this._callbacks,s)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return Fu.Emitter=r,r._noop=function(){},Fu}var Nu={},LA;function Uk(){if(LA)return Nu;LA=1,Object.defineProperty(Nu,"__esModule",{value:!0}),Nu.CancellationTokenSource=Nu.CancellationToken=void 0;const n=kl(),e=fp(),t=hp();var r;(function(a){a.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:t.Event.None}),a.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:t.Event.None});function u(l){const c=l;return c&&(c===a.None||c===a.Cancelled||e.boolean(c.isCancellationRequested)&&!!c.onCancellationRequested)}a.is=u})(r||(Nu.CancellationToken=r={}));const i=Object.freeze(function(a,u){const l=(0,n.default)().timer.setTimeout(a.bind(u),0);return{dispose(){l.dispose()}}});class s{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?i:(this._emitter||(this._emitter=new t.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class o{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=r.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=r.None}}return Nu.CancellationTokenSource=o,Nu}var Bu={},FA;function WG(){if(FA)return Bu;FA=1,Object.defineProperty(Bu,"__esModule",{value:!0}),Bu.SharedArrayReceiverStrategy=Bu.SharedArraySenderStrategy=void 0;const n=Uk();var e;(function(o){o.Continue=0,o.Cancelled=1})(e||(e={}));class t{constructor(){this.buffers=new Map}enableCancellation(a){if(a.id===null)return;const u=new SharedArrayBuffer(4),l=new Int32Array(u,0,1);l[0]=e.Continue,this.buffers.set(a.id,u),a.$cancellationData=u}async sendCancellation(a,u){const l=this.buffers.get(u);if(l===void 0)return;const c=new Int32Array(l,0,1);Atomics.store(c,0,e.Cancelled)}cleanup(a){this.buffers.delete(a)}dispose(){this.buffers.clear()}}Bu.SharedArraySenderStrategy=t;class r{constructor(a){this.data=new Int32Array(a,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===e.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class i{constructor(a){this.token=new r(a)}cancel(){}dispose(){}}class s{constructor(){this.kind="request"}createCancellationTokenSource(a){const u=a.$cancellationData;return u===void 0?new n.CancellationTokenSource:new i(u)}}return Bu.SharedArrayReceiverStrategy=s,Bu}var Vo={},Sh={},NA;function dP(){if(NA)return Sh;NA=1,Object.defineProperty(Sh,"__esModule",{value:!0}),Sh.Semaphore=void 0;const n=kl();class e{constructor(r=1){if(r<=0)throw new Error("Capacity must be greater than 0");this._capacity=r,this._active=0,this._waiting=[]}lock(r){return new Promise((i,s)=>{this._waiting.push({thunk:r,resolve:i,reject:s}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,n.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const r=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const i=r.thunk();i instanceof Promise?i.then(s=>{this._active--,r.resolve(s),this.runNext()},s=>{this._active--,r.reject(s),this.runNext()}):(this._active--,r.resolve(i),this.runNext())}catch(i){this._active--,r.reject(i),this.runNext()}}}return Sh.Semaphore=e,Sh}var BA;function jG(){if(BA)return Vo;BA=1,Object.defineProperty(Vo,"__esModule",{value:!0}),Vo.ReadableStreamMessageReader=Vo.AbstractMessageReader=Vo.MessageReader=void 0;const n=kl(),e=fp(),t=hp(),r=dP();var i;(function(u){function l(c){let f=c;return f&&e.func(f.listen)&&e.func(f.dispose)&&e.func(f.onError)&&e.func(f.onClose)&&e.func(f.onPartialMessage)}u.is=l})(i||(Vo.MessageReader=i={}));class s{constructor(){this.errorEmitter=new t.Emitter,this.closeEmitter=new t.Emitter,this.partialMessageEmitter=new t.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(l){this.errorEmitter.fire(this.asError(l))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(l){this.partialMessageEmitter.fire(l)}asError(l){return l instanceof Error?l:new Error(`Reader received error. Reason: ${e.string(l.message)?l.message:"unknown"}`)}}Vo.AbstractMessageReader=s;var o;(function(u){function l(c){let f,d;const g=new Map;let m;const y=new Map;if(c===void 0||typeof c=="string")f=c??"utf-8";else{if(f=c.charset??"utf-8",c.contentDecoder!==void 0&&(d=c.contentDecoder,g.set(d.name,d)),c.contentDecoders!==void 0)for(const b of c.contentDecoders)g.set(b.name,b);if(c.contentTypeDecoder!==void 0&&(m=c.contentTypeDecoder,y.set(m.name,m)),c.contentTypeDecoders!==void 0)for(const b of c.contentTypeDecoders)y.set(b.name,b)}return m===void 0&&(m=(0,n.default)().applicationJson.decoder,y.set(m.name,m)),{charset:f,contentDecoder:d,contentDecoders:g,contentTypeDecoder:m,contentTypeDecoders:y}}u.fromOptions=l})(o||(o={}));class a extends s{constructor(l,c){super(),this.readable=l,this.options=o.fromOptions(c),this.buffer=(0,n.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new r.Semaphore(1)}set partialMessageTimeout(l){this._partialMessageTimeout=l}get partialMessageTimeout(){return this._partialMessageTimeout}listen(l){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=l;const c=this.readable.onData(f=>{this.onData(f)});return this.readable.onError(f=>this.fireError(f)),this.readable.onClose(()=>this.fireClose()),c}onData(l){try{for(this.buffer.append(l);;){if(this.nextMessageLength===-1){const f=this.buffer.tryReadHeaders(!0);if(!f)return;const d=f.get("content-length");if(!d){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
46
|
-
${JSON.stringify(Object.fromEntries(f))}`));return}const g=parseInt(d);if(isNaN(g)){this.fireError(new Error(`Content-Length value must be a number. Got ${d}`));return}this.nextMessageLength=g}const c=this.buffer.tryReadBody(this.nextMessageLength);if(c===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const f=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(c):c,d=await this.options.contentTypeDecoder.decode(f,this.options);this.callback(d)}).catch(f=>{this.fireError(f)})}}catch(c){this.fireError(c)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,n.default)().timer.setTimeout((l,c)=>{this.partialMessageTimer=void 0,l===this.messageToken&&(this.firePartialMessage({messageToken:l,waitingTime:c}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}return Vo.ReadableStreamMessageReader=a,Vo}var Go={},qA;function $G(){if(qA)return Go;qA=1,Object.defineProperty(Go,"__esModule",{value:!0}),Go.WriteableStreamMessageWriter=Go.AbstractMessageWriter=Go.MessageWriter=void 0;const n=kl(),e=fp(),t=dP(),r=hp(),i="Content-Length: ",s=`\r
|
|
47
|
-
`;var o;(function(c){function f(d){let g=d;return g&&e.func(g.dispose)&&e.func(g.onClose)&&e.func(g.onError)&&e.func(g.write)}c.is=f})(o||(Go.MessageWriter=o={}));class a{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f,d,g){this.errorEmitter.fire([this.asError(f),d,g])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(f){return f instanceof Error?f:new Error(`Writer received error. Reason: ${e.string(f.message)?f.message:"unknown"}`)}}Go.AbstractMessageWriter=a;var u;(function(c){function f(d){return d===void 0||typeof d=="string"?{charset:d??"utf-8",contentTypeEncoder:(0,n.default)().applicationJson.encoder}:{charset:d.charset??"utf-8",contentEncoder:d.contentEncoder,contentTypeEncoder:d.contentTypeEncoder??(0,n.default)().applicationJson.encoder}}c.fromOptions=f})(u||(u={}));class l extends a{constructor(f,d){super(),this.writable=f,this.options=u.fromOptions(d),this.errorCount=0,this.writeSemaphore=new t.Semaphore(1),this.writable.onError(g=>this.fireError(g)),this.writable.onClose(()=>this.fireClose())}async write(f){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(f,this.options).then(g=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(g):g).then(g=>{const m=[];return m.push(i,g.byteLength.toString(),s),m.push(s),this.doWrite(f,m,g)},g=>{throw this.fireError(g),g}))}async doWrite(f,d,g){try{return await this.writable.write(d.join(""),"ascii"),this.writable.write(g)}catch(m){return this.handleError(m,f),Promise.reject(m)}}handleError(f,d){this.errorCount++,this.fireError(f,d,this.errorCount)}end(){this.writable.end()}}return Go.WriteableStreamMessageWriter=l,Go}var Ch={},WA;function zG(){if(WA)return Ch;WA=1,Object.defineProperty(Ch,"__esModule",{value:!0}),Ch.AbstractMessageBuffer=void 0;const n=13,e=10,t=`\r
|
|
48
|
-
`;class r{constructor(s="utf-8"){this._encoding=s,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(s){const o=typeof s=="string"?this.fromString(s,this._encoding):s;this._chunks.push(o),this._totalLength+=o.byteLength}tryReadHeaders(s=!1){if(this._chunks.length===0)return;let o=0,a=0,u=0,l=0;e:for(;a<this._chunks.length;){const g=this._chunks[a];for(u=0;u<g.length;){switch(g[u]){case n:switch(o){case 0:o=1;break;case 2:o=3;break;default:o=0}break;case e:switch(o){case 1:o=2;break;case 3:o=4,u++;break e;default:o=0}break;default:o=0}u++}l+=g.byteLength,a++}if(o!==4)return;const c=this._read(l+u),f=new Map,d=this.toString(c,"ascii").split(t);if(d.length<2)return f;for(let g=0;g<d.length-2;g++){const m=d[g],y=m.indexOf(":");if(y===-1)throw new Error(`Message header must separate key and value using ':'
|
|
49
|
-
${m}`);const b=m.substr(0,y),w=m.substr(y+1).trim();f.set(s?b.toLowerCase():b,w)}return f}tryReadBody(s){if(!(this._totalLength<s))return this._read(s)}get numberOfBytes(){return this._totalLength}_read(s){if(s===0)return this.emptyBuffer();if(s>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===s){const l=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(l)}if(this._chunks[0].byteLength>s){const l=this._chunks[0],c=this.asNative(l,s);return this._chunks[0]=l.slice(s),this._totalLength-=s,c}const o=this.allocNative(s);let a=0,u=0;for(;s>0;){const l=this._chunks[u];if(l.byteLength>s){const c=l.slice(0,s);o.set(c,a),a+=s,this._chunks[u]=l.slice(s),this._totalLength-=s,s-=s}else o.set(l,a),a+=l.byteLength,this._chunks.shift(),this._totalLength-=l.byteLength,s-=l.byteLength}return o}}return Ch.AbstractMessageBuffer=r,Ch}var yb={},jA;function UG(){return jA||(jA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.createMessageConnection=n.ConnectionOptions=n.MessageStrategy=n.CancellationStrategy=n.CancellationSenderStrategy=n.CancellationReceiverStrategy=n.RequestCancellationReceiverStrategy=n.IdCancellationReceiverStrategy=n.ConnectionStrategy=n.ConnectionError=n.ConnectionErrors=n.LogTraceNotification=n.SetTraceNotification=n.TraceFormat=n.TraceValues=n.Trace=n.NullLogger=n.ProgressType=n.ProgressToken=void 0;const e=kl(),t=fp(),r=fP(),i=hP(),s=hp(),o=Uk();var a;(function(R){R.type=new r.NotificationType("$/cancelRequest")})(a||(a={}));var u;(function(R){function Y(q){return typeof q=="string"||typeof q=="number"}R.is=Y})(u||(n.ProgressToken=u={}));var l;(function(R){R.type=new r.NotificationType("$/progress")})(l||(l={}));class c{constructor(){}}n.ProgressType=c;var f;(function(R){function Y(q){return t.func(q)}R.is=Y})(f||(f={})),n.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var d;(function(R){R[R.Off=0]="Off",R[R.Messages=1]="Messages",R[R.Compact=2]="Compact",R[R.Verbose=3]="Verbose"})(d||(n.Trace=d={}));var g;(function(R){R.Off="off",R.Messages="messages",R.Compact="compact",R.Verbose="verbose"})(g||(n.TraceValues=g={})),function(R){function Y(te){if(!t.string(te))return R.Off;switch(te=te.toLowerCase(),te){case"off":return R.Off;case"messages":return R.Messages;case"compact":return R.Compact;case"verbose":return R.Verbose;default:return R.Off}}R.fromString=Y;function q(te){switch(te){case R.Off:return"off";case R.Messages:return"messages";case R.Compact:return"compact";case R.Verbose:return"verbose";default:return"off"}}R.toString=q}(d||(n.Trace=d={}));var m;(function(R){R.Text="text",R.JSON="json"})(m||(n.TraceFormat=m={})),function(R){function Y(q){return t.string(q)?(q=q.toLowerCase(),q==="json"?R.JSON:R.Text):R.Text}R.fromString=Y}(m||(n.TraceFormat=m={}));var y;(function(R){R.type=new r.NotificationType("$/setTrace")})(y||(n.SetTraceNotification=y={}));var b;(function(R){R.type=new r.NotificationType("$/logTrace")})(b||(n.LogTraceNotification=b={}));var w;(function(R){R[R.Closed=1]="Closed",R[R.Disposed=2]="Disposed",R[R.AlreadyListening=3]="AlreadyListening"})(w||(n.ConnectionErrors=w={}));class x extends Error{constructor(Y,q){super(q),this.code=Y,Object.setPrototypeOf(this,x.prototype)}}n.ConnectionError=x;var _;(function(R){function Y(q){const te=q;return te&&t.func(te.cancelUndispatched)}R.is=Y})(_||(n.ConnectionStrategy=_={}));var S;(function(R){function Y(q){const te=q;return te&&(te.kind===void 0||te.kind==="id")&&t.func(te.createCancellationTokenSource)&&(te.dispose===void 0||t.func(te.dispose))}R.is=Y})(S||(n.IdCancellationReceiverStrategy=S={}));var C;(function(R){function Y(q){const te=q;return te&&te.kind==="request"&&t.func(te.createCancellationTokenSource)&&(te.dispose===void 0||t.func(te.dispose))}R.is=Y})(C||(n.RequestCancellationReceiverStrategy=C={}));var A;(function(R){R.Message=Object.freeze({createCancellationTokenSource(q){return new o.CancellationTokenSource}});function Y(q){return S.is(q)||C.is(q)}R.is=Y})(A||(n.CancellationReceiverStrategy=A={}));var I;(function(R){R.Message=Object.freeze({sendCancellation(q,te){return q.sendNotification(a.type,{id:te})},cleanup(q){}});function Y(q){const te=q;return te&&t.func(te.sendCancellation)&&t.func(te.cleanup)}R.is=Y})(I||(n.CancellationSenderStrategy=I={}));var W;(function(R){R.Message=Object.freeze({receiver:A.Message,sender:I.Message});function Y(q){const te=q;return te&&A.is(te.receiver)&&I.is(te.sender)}R.is=Y})(W||(n.CancellationStrategy=W={}));var B;(function(R){function Y(q){const te=q;return te&&t.func(te.handleMessage)}R.is=Y})(B||(n.MessageStrategy=B={}));var K;(function(R){function Y(q){const te=q;return te&&(W.is(te.cancellationStrategy)||_.is(te.connectionStrategy)||B.is(te.messageStrategy))}R.is=Y})(K||(n.ConnectionOptions=K={}));var G;(function(R){R[R.New=1]="New",R[R.Listening=2]="Listening",R[R.Closed=3]="Closed",R[R.Disposed=4]="Disposed"})(G||(G={}));function F(R,Y,q,te){const ae=q!==void 0?q:n.NullLogger;let be=0,ye=0,De=0;const we="2.0";let Pe;const Rt=new Map;let kt;const rt=new Map,Xt=new Map;let Bn,rn=new i.LinkedMap,yn=new Map,Pt=new Set,Se=new Map,Ye=d.Off,In=m.Text,Le,$t=G.New;const Cn=new s.Emitter,Yt=new s.Emitter,at=new s.Emitter,qn=new s.Emitter,Dt=new s.Emitter,ct=te&&te.cancellationStrategy?te.cancellationStrategy:W.Message;function hr(z){if(z===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+z.toString()}function ls(z){return z===null?"res-unknown-"+(++De).toString():"res-"+z.toString()}function ka(){return"not-"+(++ye).toString()}function Xr(z,de){r.Message.isRequest(de)?z.set(hr(de.id),de):r.Message.isResponse(de)?z.set(ls(de.id),de):z.set(ka(),de)}function Fs(z){}function dr(){return $t===G.Listening}function En(){return $t===G.Closed}function Tt(){return $t===G.Disposed}function cs(){($t===G.New||$t===G.Listening)&&($t=G.Closed,Yt.fire(void 0))}function fs(z){Cn.fire([z,void 0,void 0])}function Tr(z){Cn.fire(z)}R.onClose(cs),R.onError(fs),Y.onClose(cs),Y.onError(Tr);function Oi(){Bn||rn.size===0||(Bn=(0,e.default)().timer.setImmediate(()=>{Bn=void 0,mi()}))}function hs(z){r.Message.isRequest(z)?Ns(z):r.Message.isNotification(z)?xa(z):r.Message.isResponse(z)?Do(z):To(z)}function mi(){if(rn.size===0)return;const z=rn.shift();try{const de=te?.messageStrategy;B.is(de)?de.handleMessage(z,hs):hs(z)}finally{Oi()}}const ds=z=>{try{if(r.Message.isNotification(z)&&z.method===a.type.method){const de=z.params.id,ke=hr(de),Me=rn.get(ke);if(r.Message.isRequest(Me)){const _t=te?.connectionStrategy,zt=_t&&_t.cancelUndispatched?_t.cancelUndispatched(Me,Fs):void 0;if(zt&&(zt.error!==void 0||zt.result!==void 0)){rn.delete(ke),Se.delete(de),zt.id=Me.id,gs(zt,z.method,Date.now()),Y.write(zt).catch(()=>ae.error("Sending response for canceled message failed."));return}}const xt=Se.get(de);if(xt!==void 0){xt.cancel(),ms(z);return}else Pt.add(de)}Xr(rn,z)}finally{Oi()}};function Ns(z){if(Tt())return;function de(it,Nt,st){const Ut={jsonrpc:we,id:z.id};it instanceof r.ResponseError?Ut.error=it.toJson():Ut.result=it===void 0?null:it,gs(Ut,Nt,st),Y.write(Ut).catch(()=>ae.error("Sending response failed."))}function ke(it,Nt,st){const Ut={jsonrpc:we,id:z.id,error:it.toJson()};gs(Ut,Nt,st),Y.write(Ut).catch(()=>ae.error("Sending response failed."))}function Me(it,Nt,st){it===void 0&&(it=null);const Ut={jsonrpc:we,id:z.id,result:it};gs(Ut,Nt,st),Y.write(Ut).catch(()=>ae.error("Sending response failed."))}Io(z);const xt=Rt.get(z.method);let _t,zt;xt&&(_t=xt.type,zt=xt.handler);const en=Date.now();if(zt||Pe){const it=z.id??String(Date.now()),Nt=S.is(ct.receiver)?ct.receiver.createCancellationTokenSource(it):ct.receiver.createCancellationTokenSource(z);z.id!==null&&Pt.has(z.id)&&Nt.cancel(),z.id!==null&&Se.set(it,Nt);try{let st;if(zt)if(z.params===void 0){if(_t!==void 0&&_t.numberOfParams!==0){ke(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${z.method} defines ${_t.numberOfParams} params but received none.`),z.method,en);return}st=zt(Nt.token)}else if(Array.isArray(z.params)){if(_t!==void 0&&_t.parameterStructures===r.ParameterStructures.byName){ke(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${z.method} defines parameters by name but received parameters by position`),z.method,en);return}st=zt(...z.params,Nt.token)}else{if(_t!==void 0&&_t.parameterStructures===r.ParameterStructures.byPosition){ke(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${z.method} defines parameters by position but received parameters by name`),z.method,en);return}st=zt(z.params,Nt.token)}else Pe&&(st=Pe(z.method,z.params,Nt.token));const Ut=st;st?Ut.then?Ut.then(on=>{Se.delete(it),de(on,z.method,en)},on=>{Se.delete(it),on instanceof r.ResponseError?ke(on,z.method,en):on&&t.string(on.message)?ke(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${z.method} failed with message: ${on.message}`),z.method,en):ke(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${z.method} failed unexpectedly without providing any details.`),z.method,en)}):(Se.delete(it),de(st,z.method,en)):(Se.delete(it),Me(st,z.method,en))}catch(st){Se.delete(it),st instanceof r.ResponseError?de(st,z.method,en):st&&t.string(st.message)?ke(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${z.method} failed with message: ${st.message}`),z.method,en):ke(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${z.method} failed unexpectedly without providing any details.`),z.method,en)}}else ke(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${z.method}`),z.method,en)}function Do(z){if(!Tt())if(z.id===null)z.error?ae.error(`Received response message without id: Error is:
|
|
50
|
-
${JSON.stringify(z.error,void 0,4)}`):ae.error("Received response message without id. No further error information provided.");else{const de=z.id,ke=yn.get(de);if(Mo(z,ke),ke!==void 0){yn.delete(de);try{if(z.error){const Me=z.error;ke.reject(new r.ResponseError(Me.code,Me.message,Me.data))}else if(z.result!==void 0)ke.resolve(z.result);else throw new Error("Should never happen.")}catch(Me){Me.message?ae.error(`Response handler '${ke.method}' failed with message: ${Me.message}`):ae.error(`Response handler '${ke.method}' failed unexpectedly.`)}}}}function xa(z){if(Tt())return;let de,ke;if(z.method===a.type.method){const Me=z.params.id;Pt.delete(Me),ms(z);return}else{const Me=rt.get(z.method);Me&&(ke=Me.handler,de=Me.type)}if(ke||kt)try{if(ms(z),ke)if(z.params===void 0)de!==void 0&&de.numberOfParams!==0&&de.parameterStructures!==r.ParameterStructures.byName&&ae.error(`Notification ${z.method} defines ${de.numberOfParams} params but received none.`),ke();else if(Array.isArray(z.params)){const Me=z.params;z.method===l.type.method&&Me.length===2&&u.is(Me[0])?ke({token:Me[0],value:Me[1]}):(de!==void 0&&(de.parameterStructures===r.ParameterStructures.byName&&ae.error(`Notification ${z.method} defines parameters by name but received parameters by position`),de.numberOfParams!==z.params.length&&ae.error(`Notification ${z.method} defines ${de.numberOfParams} params but received ${Me.length} arguments`)),ke(...Me))}else de!==void 0&&de.parameterStructures===r.ParameterStructures.byPosition&&ae.error(`Notification ${z.method} defines parameters by position but received parameters by name`),ke(z.params);else kt&&kt(z.method,z.params)}catch(Me){Me.message?ae.error(`Notification handler '${z.method}' failed with message: ${Me.message}`):ae.error(`Notification handler '${z.method}' failed unexpectedly.`)}else at.fire(z)}function To(z){if(!z){ae.error("Received empty message.");return}ae.error(`Received message which is neither a response nor a notification message:
|
|
51
|
-
${JSON.stringify(z,null,4)}`);const de=z;if(t.string(de.id)||t.number(de.id)){const ke=de.id,Me=yn.get(ke);Me&&Me.reject(new Error("The received response has neither a result nor an error property."))}}function pr(z){if(z!=null)switch(Ye){case d.Verbose:return JSON.stringify(z,null,4);case d.Compact:return JSON.stringify(z);default:return}}function Bs(z){if(!(Ye===d.Off||!Le))if(In===m.Text){let de;(Ye===d.Verbose||Ye===d.Compact)&&z.params&&(de=`Params: ${pr(z.params)}
|
|
52
|
-
|
|
53
|
-
`),Le.log(`Sending request '${z.method} - (${z.id})'.`,de)}else Ir("send-request",z)}function ps(z){if(!(Ye===d.Off||!Le))if(In===m.Text){let de;(Ye===d.Verbose||Ye===d.Compact)&&(z.params?de=`Params: ${pr(z.params)}
|
|
54
|
-
|
|
55
|
-
`:de=`No parameters provided.
|
|
56
|
-
|
|
57
|
-
`),Le.log(`Sending notification '${z.method}'.`,de)}else Ir("send-notification",z)}function gs(z,de,ke){if(!(Ye===d.Off||!Le))if(In===m.Text){let Me;(Ye===d.Verbose||Ye===d.Compact)&&(z.error&&z.error.data?Me=`Error data: ${pr(z.error.data)}
|
|
58
|
-
|
|
59
|
-
`:z.result?Me=`Result: ${pr(z.result)}
|
|
60
|
-
|
|
61
|
-
`:z.error===void 0&&(Me=`No result returned.
|
|
62
|
-
|
|
63
|
-
`)),Le.log(`Sending response '${de} - (${z.id})'. Processing request took ${Date.now()-ke}ms`,Me)}else Ir("send-response",z)}function Io(z){if(!(Ye===d.Off||!Le))if(In===m.Text){let de;(Ye===d.Verbose||Ye===d.Compact)&&z.params&&(de=`Params: ${pr(z.params)}
|
|
64
|
-
|
|
65
|
-
`),Le.log(`Received request '${z.method} - (${z.id})'.`,de)}else Ir("receive-request",z)}function ms(z){if(!(Ye===d.Off||!Le||z.method===b.type.method))if(In===m.Text){let de;(Ye===d.Verbose||Ye===d.Compact)&&(z.params?de=`Params: ${pr(z.params)}
|
|
66
|
-
|
|
67
|
-
`:de=`No parameters provided.
|
|
68
|
-
|
|
69
|
-
`),Le.log(`Received notification '${z.method}'.`,de)}else Ir("receive-notification",z)}function Mo(z,de){if(!(Ye===d.Off||!Le))if(In===m.Text){let ke;if((Ye===d.Verbose||Ye===d.Compact)&&(z.error&&z.error.data?ke=`Error data: ${pr(z.error.data)}
|
|
70
|
-
|
|
71
|
-
`:z.result?ke=`Result: ${pr(z.result)}
|
|
72
|
-
|
|
73
|
-
`:z.error===void 0&&(ke=`No result returned.
|
|
74
|
-
|
|
75
|
-
`)),de){const Me=z.error?` Request failed: ${z.error.message} (${z.error.code}).`:"";Le.log(`Received response '${de.method} - (${z.id})' in ${Date.now()-de.timerStart}ms.${Me}`,ke)}else Le.log(`Received response ${z.id} without active response promise.`,ke)}else Ir("receive-response",z)}function Ir(z,de){if(!Le||Ye===d.Off)return;const ke={isLSPMessage:!0,type:z,message:de,timestamp:Date.now()};Le.log(ke)}function Yr(){if(En())throw new x(w.Closed,"Connection is closed.");if(Tt())throw new x(w.Disposed,"Connection is disposed.")}function Oo(){if(dr())throw new x(w.AlreadyListening,"Connection is already listening")}function Pi(){if(!dr())throw new Error("Call listen() first.")}function Li(z){return z===void 0?null:z}function ys(z){if(z!==null)return z}function L(z){return z!=null&&!Array.isArray(z)&&typeof z=="object"}function Jt(z,de){switch(z){case r.ParameterStructures.auto:return L(de)?ys(de):[Li(de)];case r.ParameterStructures.byName:if(!L(de))throw new Error("Received parameters by name but param is not an object literal.");return ys(de);case r.ParameterStructures.byPosition:return[Li(de)];default:throw new Error(`Unknown parameter structure ${z.toString()}`)}}function Qt(z,de){let ke;const Me=z.numberOfParams;switch(Me){case 0:ke=void 0;break;case 1:ke=Jt(z.parameterStructures,de[0]);break;default:ke=[];for(let xt=0;xt<de.length&&xt<Me;xt++)ke.push(Li(de[xt]));if(de.length<Me)for(let xt=de.length;xt<Me;xt++)ke.push(null);break}return ke}const qe={sendNotification:(z,...de)=>{Yr();let ke,Me;if(t.string(z)){ke=z;const _t=de[0];let zt=0,en=r.ParameterStructures.auto;r.ParameterStructures.is(_t)&&(zt=1,en=_t);let it=de.length;const Nt=it-zt;switch(Nt){case 0:Me=void 0;break;case 1:Me=Jt(en,de[zt]);break;default:if(en===r.ParameterStructures.byName)throw new Error(`Received ${Nt} parameters for 'by Name' notification parameter structure.`);Me=de.slice(zt,it).map(st=>Li(st));break}}else{const _t=de;ke=z.method,Me=Qt(z,_t)}const xt={jsonrpc:we,method:ke,params:Me};return ps(xt),Y.write(xt).catch(_t=>{throw ae.error("Sending notification failed."),_t})},onNotification:(z,de)=>{Yr();let ke;return t.func(z)?kt=z:de&&(t.string(z)?(ke=z,rt.set(z,{type:void 0,handler:de})):(ke=z.method,rt.set(z.method,{type:z,handler:de}))),{dispose:()=>{ke!==void 0?rt.delete(ke):kt=void 0}}},onProgress:(z,de,ke)=>{if(Xt.has(de))throw new Error(`Progress handler for token ${de} already registered`);return Xt.set(de,ke),{dispose:()=>{Xt.delete(de)}}},sendProgress:(z,de,ke)=>qe.sendNotification(l.type,{token:de,value:ke}),onUnhandledProgress:qn.event,sendRequest:(z,...de)=>{Yr(),Pi();let ke,Me,xt;if(t.string(z)){ke=z;const it=de[0],Nt=de[de.length-1];let st=0,Ut=r.ParameterStructures.auto;r.ParameterStructures.is(it)&&(st=1,Ut=it);let on=de.length;o.CancellationToken.is(Nt)&&(on=on-1,xt=Nt);const Xn=on-st;switch(Xn){case 0:Me=void 0;break;case 1:Me=Jt(Ut,de[st]);break;default:if(Ut===r.ParameterStructures.byName)throw new Error(`Received ${Xn} parameters for 'by Name' request parameter structure.`);Me=de.slice(st,on).map(hf=>Li(hf));break}}else{const it=de;ke=z.method,Me=Qt(z,it);const Nt=z.numberOfParams;xt=o.CancellationToken.is(it[Nt])?it[Nt]:void 0}const _t=be++;let zt;xt&&(zt=xt.onCancellationRequested(()=>{const it=ct.sender.sendCancellation(qe,_t);return it===void 0?(ae.log(`Received no promise from cancellation strategy when cancelling id ${_t}`),Promise.resolve()):it.catch(()=>{ae.log(`Sending cancellation messages for id ${_t} failed`)})}));const en={jsonrpc:we,id:_t,method:ke,params:Me};return Bs(en),typeof ct.sender.enableCancellation=="function"&&ct.sender.enableCancellation(en),new Promise(async(it,Nt)=>{const st=Xn=>{it(Xn),ct.sender.cleanup(_t),zt?.dispose()},Ut=Xn=>{Nt(Xn),ct.sender.cleanup(_t),zt?.dispose()},on={method:ke,timerStart:Date.now(),resolve:st,reject:Ut};try{await Y.write(en),yn.set(_t,on)}catch(Xn){throw ae.error("Sending request failed."),on.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,Xn.message?Xn.message:"Unknown reason")),Xn}})},onRequest:(z,de)=>{Yr();let ke=null;return f.is(z)?(ke=void 0,Pe=z):t.string(z)?(ke=null,de!==void 0&&(ke=z,Rt.set(z,{handler:de,type:void 0}))):de!==void 0&&(ke=z.method,Rt.set(z.method,{type:z,handler:de})),{dispose:()=>{ke!==null&&(ke!==void 0?Rt.delete(ke):Pe=void 0)}}},hasPendingResponse:()=>yn.size>0,trace:async(z,de,ke)=>{let Me=!1,xt=m.Text;ke!==void 0&&(t.boolean(ke)?Me=ke:(Me=ke.sendNotification||!1,xt=ke.traceFormat||m.Text)),Ye=z,In=xt,Ye===d.Off?Le=void 0:Le=de,Me&&!En()&&!Tt()&&await qe.sendNotification(y.type,{value:d.toString(z)})},onError:Cn.event,onClose:Yt.event,onUnhandledNotification:at.event,onDispose:Dt.event,end:()=>{Y.end()},dispose:()=>{if(Tt())return;$t=G.Disposed,Dt.fire(void 0);const z=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const de of yn.values())de.reject(z);yn=new Map,Se=new Map,Pt=new Set,rn=new i.LinkedMap,t.func(Y.dispose)&&Y.dispose(),t.func(R.dispose)&&R.dispose()},listen:()=>{Yr(),Oo(),$t=G.Listening,R.listen(ds)},inspect:()=>{(0,e.default)().console.log("inspect")}};return qe.onNotification(b.type,z=>{if(Ye===d.Off||!Le)return;const de=Ye===d.Verbose||Ye===d.Compact;Le.log(z.message,de?z.verbose:void 0)}),qe.onNotification(l.type,z=>{const de=Xt.get(z.token);de?de(z.value):qn.fire(z)}),qe}n.createMessageConnection=F}(yb)),yb}var $A;function f_(){return $A||($A=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ProgressType=n.ProgressToken=n.createMessageConnection=n.NullLogger=n.ConnectionOptions=n.ConnectionStrategy=n.AbstractMessageBuffer=n.WriteableStreamMessageWriter=n.AbstractMessageWriter=n.MessageWriter=n.ReadableStreamMessageReader=n.AbstractMessageReader=n.MessageReader=n.SharedArrayReceiverStrategy=n.SharedArraySenderStrategy=n.CancellationToken=n.CancellationTokenSource=n.Emitter=n.Event=n.Disposable=n.LRUCache=n.Touch=n.LinkedMap=n.ParameterStructures=n.NotificationType9=n.NotificationType8=n.NotificationType7=n.NotificationType6=n.NotificationType5=n.NotificationType4=n.NotificationType3=n.NotificationType2=n.NotificationType1=n.NotificationType0=n.NotificationType=n.ErrorCodes=n.ResponseError=n.RequestType9=n.RequestType8=n.RequestType7=n.RequestType6=n.RequestType5=n.RequestType4=n.RequestType3=n.RequestType2=n.RequestType1=n.RequestType0=n.RequestType=n.Message=n.RAL=void 0,n.MessageStrategy=n.CancellationStrategy=n.CancellationSenderStrategy=n.CancellationReceiverStrategy=n.ConnectionError=n.ConnectionErrors=n.LogTraceNotification=n.SetTraceNotification=n.TraceFormat=n.TraceValues=n.Trace=void 0;const e=fP();Object.defineProperty(n,"Message",{enumerable:!0,get:function(){return e.Message}}),Object.defineProperty(n,"RequestType",{enumerable:!0,get:function(){return e.RequestType}}),Object.defineProperty(n,"RequestType0",{enumerable:!0,get:function(){return e.RequestType0}}),Object.defineProperty(n,"RequestType1",{enumerable:!0,get:function(){return e.RequestType1}}),Object.defineProperty(n,"RequestType2",{enumerable:!0,get:function(){return e.RequestType2}}),Object.defineProperty(n,"RequestType3",{enumerable:!0,get:function(){return e.RequestType3}}),Object.defineProperty(n,"RequestType4",{enumerable:!0,get:function(){return e.RequestType4}}),Object.defineProperty(n,"RequestType5",{enumerable:!0,get:function(){return e.RequestType5}}),Object.defineProperty(n,"RequestType6",{enumerable:!0,get:function(){return e.RequestType6}}),Object.defineProperty(n,"RequestType7",{enumerable:!0,get:function(){return e.RequestType7}}),Object.defineProperty(n,"RequestType8",{enumerable:!0,get:function(){return e.RequestType8}}),Object.defineProperty(n,"RequestType9",{enumerable:!0,get:function(){return e.RequestType9}}),Object.defineProperty(n,"ResponseError",{enumerable:!0,get:function(){return e.ResponseError}}),Object.defineProperty(n,"ErrorCodes",{enumerable:!0,get:function(){return e.ErrorCodes}}),Object.defineProperty(n,"NotificationType",{enumerable:!0,get:function(){return e.NotificationType}}),Object.defineProperty(n,"NotificationType0",{enumerable:!0,get:function(){return e.NotificationType0}}),Object.defineProperty(n,"NotificationType1",{enumerable:!0,get:function(){return e.NotificationType1}}),Object.defineProperty(n,"NotificationType2",{enumerable:!0,get:function(){return e.NotificationType2}}),Object.defineProperty(n,"NotificationType3",{enumerable:!0,get:function(){return e.NotificationType3}}),Object.defineProperty(n,"NotificationType4",{enumerable:!0,get:function(){return e.NotificationType4}}),Object.defineProperty(n,"NotificationType5",{enumerable:!0,get:function(){return e.NotificationType5}}),Object.defineProperty(n,"NotificationType6",{enumerable:!0,get:function(){return e.NotificationType6}}),Object.defineProperty(n,"NotificationType7",{enumerable:!0,get:function(){return e.NotificationType7}}),Object.defineProperty(n,"NotificationType8",{enumerable:!0,get:function(){return e.NotificationType8}}),Object.defineProperty(n,"NotificationType9",{enumerable:!0,get:function(){return e.NotificationType9}}),Object.defineProperty(n,"ParameterStructures",{enumerable:!0,get:function(){return e.ParameterStructures}});const t=hP();Object.defineProperty(n,"LinkedMap",{enumerable:!0,get:function(){return t.LinkedMap}}),Object.defineProperty(n,"LRUCache",{enumerable:!0,get:function(){return t.LRUCache}}),Object.defineProperty(n,"Touch",{enumerable:!0,get:function(){return t.Touch}});const r=qG();Object.defineProperty(n,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const i=hp();Object.defineProperty(n,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(n,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const s=Uk();Object.defineProperty(n,"CancellationTokenSource",{enumerable:!0,get:function(){return s.CancellationTokenSource}}),Object.defineProperty(n,"CancellationToken",{enumerable:!0,get:function(){return s.CancellationToken}});const o=WG();Object.defineProperty(n,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return o.SharedArraySenderStrategy}}),Object.defineProperty(n,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return o.SharedArrayReceiverStrategy}});const a=jG();Object.defineProperty(n,"MessageReader",{enumerable:!0,get:function(){return a.MessageReader}}),Object.defineProperty(n,"AbstractMessageReader",{enumerable:!0,get:function(){return a.AbstractMessageReader}}),Object.defineProperty(n,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return a.ReadableStreamMessageReader}});const u=$G();Object.defineProperty(n,"MessageWriter",{enumerable:!0,get:function(){return u.MessageWriter}}),Object.defineProperty(n,"AbstractMessageWriter",{enumerable:!0,get:function(){return u.AbstractMessageWriter}}),Object.defineProperty(n,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return u.WriteableStreamMessageWriter}});const l=zG();Object.defineProperty(n,"AbstractMessageBuffer",{enumerable:!0,get:function(){return l.AbstractMessageBuffer}});const c=UG();Object.defineProperty(n,"ConnectionStrategy",{enumerable:!0,get:function(){return c.ConnectionStrategy}}),Object.defineProperty(n,"ConnectionOptions",{enumerable:!0,get:function(){return c.ConnectionOptions}}),Object.defineProperty(n,"NullLogger",{enumerable:!0,get:function(){return c.NullLogger}}),Object.defineProperty(n,"createMessageConnection",{enumerable:!0,get:function(){return c.createMessageConnection}}),Object.defineProperty(n,"ProgressToken",{enumerable:!0,get:function(){return c.ProgressToken}}),Object.defineProperty(n,"ProgressType",{enumerable:!0,get:function(){return c.ProgressType}}),Object.defineProperty(n,"Trace",{enumerable:!0,get:function(){return c.Trace}}),Object.defineProperty(n,"TraceValues",{enumerable:!0,get:function(){return c.TraceValues}}),Object.defineProperty(n,"TraceFormat",{enumerable:!0,get:function(){return c.TraceFormat}}),Object.defineProperty(n,"SetTraceNotification",{enumerable:!0,get:function(){return c.SetTraceNotification}}),Object.defineProperty(n,"LogTraceNotification",{enumerable:!0,get:function(){return c.LogTraceNotification}}),Object.defineProperty(n,"ConnectionErrors",{enumerable:!0,get:function(){return c.ConnectionErrors}}),Object.defineProperty(n,"ConnectionError",{enumerable:!0,get:function(){return c.ConnectionError}}),Object.defineProperty(n,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return c.CancellationReceiverStrategy}}),Object.defineProperty(n,"CancellationSenderStrategy",{enumerable:!0,get:function(){return c.CancellationSenderStrategy}}),Object.defineProperty(n,"CancellationStrategy",{enumerable:!0,get:function(){return c.CancellationStrategy}}),Object.defineProperty(n,"MessageStrategy",{enumerable:!0,get:function(){return c.MessageStrategy}});const f=kl();n.RAL=f.default}(mb)),mb}var zA;function HG(){if(zA)return s0;zA=1,Object.defineProperty(s0,"__esModule",{value:!0});const n=f_();class e extends n.AbstractMessageBuffer{constructor(u="utf-8"){super(u),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return e.emptyBuffer}fromString(u,l){return new TextEncoder().encode(u)}toString(u,l){return l==="ascii"?this.asciiDecoder.decode(u):new TextDecoder(l).decode(u)}asNative(u,l){return l===void 0?u:u.slice(0,l)}allocNative(u){return new Uint8Array(u)}}e.emptyBuffer=new Uint8Array(0);class t{constructor(u){this.socket=u,this._onData=new n.Emitter,this._messageListener=l=>{l.data.arrayBuffer().then(f=>{this._onData.fire(new Uint8Array(f))},()=>{(0,n.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(u){return this.socket.addEventListener("close",u),n.Disposable.create(()=>this.socket.removeEventListener("close",u))}onError(u){return this.socket.addEventListener("error",u),n.Disposable.create(()=>this.socket.removeEventListener("error",u))}onEnd(u){return this.socket.addEventListener("end",u),n.Disposable.create(()=>this.socket.removeEventListener("end",u))}onData(u){return this._onData.event(u)}}class r{constructor(u){this.socket=u}onClose(u){return this.socket.addEventListener("close",u),n.Disposable.create(()=>this.socket.removeEventListener("close",u))}onError(u){return this.socket.addEventListener("error",u),n.Disposable.create(()=>this.socket.removeEventListener("error",u))}onEnd(u){return this.socket.addEventListener("end",u),n.Disposable.create(()=>this.socket.removeEventListener("end",u))}write(u,l){if(typeof u=="string"){if(l!==void 0&&l!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${l}`);this.socket.send(u)}else this.socket.send(u);return Promise.resolve()}end(){this.socket.close()}}const i=new TextEncoder,s=Object.freeze({messageBuffer:Object.freeze({create:a=>new e(a)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(a,u)=>{if(u.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${u.charset}`);return Promise.resolve(i.encode(JSON.stringify(a,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(a,u)=>{if(!(a instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(u.charset).decode(a)))}})}),stream:Object.freeze({asReadableStream:a=>new t(a),asWritableStream:a=>new r(a)}),console,timer:Object.freeze({setTimeout(a,u,...l){const c=setTimeout(a,u,...l);return{dispose:()=>clearTimeout(c)}},setImmediate(a,...u){const l=setTimeout(a,0,...u);return{dispose:()=>clearTimeout(l)}},setInterval(a,u,...l){const c=setInterval(a,u,...l);return{dispose:()=>clearInterval(c)}}})});function o(){return s}return function(a){function u(){n.RAL.install(s)}a.install=u}(o||(o={})),s0.default=o,s0}var UA;function rf(){return UA||(UA=1,function(n){var e=Lu&&Lu.__createBinding||(Object.create?function(u,l,c,f){f===void 0&&(f=c);var d=Object.getOwnPropertyDescriptor(l,c);(!d||("get"in d?!l.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return l[c]}}),Object.defineProperty(u,f,d)}:function(u,l,c,f){f===void 0&&(f=c),u[f]=l[c]}),t=Lu&&Lu.__exportStar||function(u,l){for(var c in u)c!=="default"&&!Object.prototype.hasOwnProperty.call(l,c)&&e(l,u,c)};Object.defineProperty(n,"__esModule",{value:!0}),n.createMessageConnection=n.BrowserMessageWriter=n.BrowserMessageReader=void 0,HG().default.install();const i=f_();t(f_(),n);class s extends i.AbstractMessageReader{constructor(l){super(),this._onData=new i.Emitter,this._messageListener=c=>{this._onData.fire(c.data)},l.addEventListener("error",c=>this.fireError(c)),l.onmessage=this._messageListener}listen(l){return this._onData.event(l)}}n.BrowserMessageReader=s;class o extends i.AbstractMessageWriter{constructor(l){super(),this.port=l,this.errorCount=0,l.addEventListener("error",c=>this.fireError(c))}write(l){try{return this.port.postMessage(l),Promise.resolve()}catch(c){return this.handleError(c,l),Promise.reject(c)}}handleError(l,c){this.errorCount++,this.fireError(l,c,this.errorCount)}end(){}}n.BrowserMessageWriter=o;function a(u,l,c,f){return c===void 0&&(c=i.NullLogger),i.ConnectionStrategy.is(f)&&(f={connectionStrategy:f}),(0,i.createMessageConnection)(u,l,c,f)}n.createMessageConnection=a}(Lu)),Lu}var vb,HA;function VA(){return HA||(HA=1,vb=rf()),vb}var qu={},h_;(function(n){function e(t){return typeof t=="string"}n.is=e})(h_||(h_={}));var t1;(function(n){function e(t){return typeof t=="string"}n.is=e})(t1||(t1={}));var d_;(function(n){n.MIN_VALUE=-2147483648,n.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&n.MIN_VALUE<=t&&t<=n.MAX_VALUE}n.is=e})(d_||(d_={}));var Ld;(function(n){n.MIN_VALUE=0,n.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&n.MIN_VALUE<=t&&t<=n.MAX_VALUE}n.is=e})(Ld||(Ld={}));var Ki;(function(n){function e(r,i){return r===Number.MAX_VALUE&&(r=Ld.MAX_VALUE),i===Number.MAX_VALUE&&(i=Ld.MAX_VALUE),{line:r,character:i}}n.create=e;function t(r){let i=r;return ie.objectLiteral(i)&&ie.uinteger(i.line)&&ie.uinteger(i.character)}n.is=t})(Ki||(Ki={}));var gn;(function(n){function e(r,i,s,o){if(ie.uinteger(r)&&ie.uinteger(i)&&ie.uinteger(s)&&ie.uinteger(o))return{start:Ki.create(r,i),end:Ki.create(s,o)};if(Ki.is(r)&&Ki.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${s}, ${o}]`)}n.create=e;function t(r){let i=r;return ie.objectLiteral(i)&&Ki.is(i.start)&&Ki.is(i.end)}n.is=t})(gn||(gn={}));var Fd;(function(n){function e(r,i){return{uri:r,range:i}}n.create=e;function t(r){let i=r;return ie.objectLiteral(i)&&gn.is(i.range)&&(ie.string(i.uri)||ie.undefined(i.uri))}n.is=t})(Fd||(Fd={}));var p_;(function(n){function e(r,i,s,o){return{targetUri:r,targetRange:i,targetSelectionRange:s,originSelectionRange:o}}n.create=e;function t(r){let i=r;return ie.objectLiteral(i)&&gn.is(i.targetRange)&&ie.string(i.targetUri)&&gn.is(i.targetSelectionRange)&&(gn.is(i.originSelectionRange)||ie.undefined(i.originSelectionRange))}n.is=t})(p_||(p_={}));var n1;(function(n){function e(r,i,s,o){return{red:r,green:i,blue:s,alpha:o}}n.create=e;function t(r){const i=r;return ie.objectLiteral(i)&&ie.numberRange(i.red,0,1)&&ie.numberRange(i.green,0,1)&&ie.numberRange(i.blue,0,1)&&ie.numberRange(i.alpha,0,1)}n.is=t})(n1||(n1={}));var g_;(function(n){function e(r,i){return{range:r,color:i}}n.create=e;function t(r){const i=r;return ie.objectLiteral(i)&&gn.is(i.range)&&n1.is(i.color)}n.is=t})(g_||(g_={}));var m_;(function(n){function e(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}n.create=e;function t(r){const i=r;return ie.objectLiteral(i)&&ie.string(i.label)&&(ie.undefined(i.textEdit)||yo.is(i))&&(ie.undefined(i.additionalTextEdits)||ie.typedArray(i.additionalTextEdits,yo.is))}n.is=t})(m_||(m_={}));var y_;(function(n){n.Comment="comment",n.Imports="imports",n.Region="region"})(y_||(y_={}));var v_;(function(n){function e(r,i,s,o,a,u){const l={startLine:r,endLine:i};return ie.defined(s)&&(l.startCharacter=s),ie.defined(o)&&(l.endCharacter=o),ie.defined(a)&&(l.kind=a),ie.defined(u)&&(l.collapsedText=u),l}n.create=e;function t(r){const i=r;return ie.objectLiteral(i)&&ie.uinteger(i.startLine)&&ie.uinteger(i.startLine)&&(ie.undefined(i.startCharacter)||ie.uinteger(i.startCharacter))&&(ie.undefined(i.endCharacter)||ie.uinteger(i.endCharacter))&&(ie.undefined(i.kind)||ie.string(i.kind))}n.is=t})(v_||(v_={}));var r1;(function(n){function e(r,i){return{location:r,message:i}}n.create=e;function t(r){let i=r;return ie.defined(i)&&Fd.is(i.location)&&ie.string(i.message)}n.is=t})(r1||(r1={}));var b_;(function(n){n.Error=1,n.Warning=2,n.Information=3,n.Hint=4})(b_||(b_={}));var w_;(function(n){n.Unnecessary=1,n.Deprecated=2})(w_||(w_={}));var __;(function(n){function e(t){const r=t;return ie.objectLiteral(r)&&ie.string(r.href)}n.is=e})(__||(__={}));var Nd;(function(n){function e(r,i,s,o,a,u){let l={range:r,message:i};return ie.defined(s)&&(l.severity=s),ie.defined(o)&&(l.code=o),ie.defined(a)&&(l.source=a),ie.defined(u)&&(l.relatedInformation=u),l}n.create=e;function t(r){var i;let s=r;return ie.defined(s)&&gn.is(s.range)&&ie.string(s.message)&&(ie.number(s.severity)||ie.undefined(s.severity))&&(ie.integer(s.code)||ie.string(s.code)||ie.undefined(s.code))&&(ie.undefined(s.codeDescription)||ie.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(ie.string(s.source)||ie.undefined(s.source))&&(ie.undefined(s.relatedInformation)||ie.typedArray(s.relatedInformation,r1.is))}n.is=t})(Nd||(Nd={}));var ml;(function(n){function e(r,i,...s){let o={title:r,command:i};return ie.defined(s)&&s.length>0&&(o.arguments=s),o}n.create=e;function t(r){let i=r;return ie.defined(i)&&ie.string(i.title)&&ie.string(i.command)}n.is=t})(ml||(ml={}));var yo;(function(n){function e(s,o){return{range:s,newText:o}}n.replace=e;function t(s,o){return{range:{start:s,end:s},newText:o}}n.insert=t;function r(s){return{range:s,newText:""}}n.del=r;function i(s){const o=s;return ie.objectLiteral(o)&&ie.string(o.newText)&&gn.is(o.range)}n.is=i})(yo||(yo={}));var ol;(function(n){function e(r,i,s){const o={label:r};return i!==void 0&&(o.needsConfirmation=i),s!==void 0&&(o.description=s),o}n.create=e;function t(r){const i=r;return ie.objectLiteral(i)&&ie.string(i.label)&&(ie.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(ie.string(i.description)||i.description===void 0)}n.is=t})(ol||(ol={}));var or;(function(n){function e(t){const r=t;return ie.string(r)}n.is=e})(or||(or={}));var ta;(function(n){function e(s,o,a){return{range:s,newText:o,annotationId:a}}n.replace=e;function t(s,o,a){return{range:{start:s,end:s},newText:o,annotationId:a}}n.insert=t;function r(s,o){return{range:s,newText:"",annotationId:o}}n.del=r;function i(s){const o=s;return yo.is(o)&&(ol.is(o.annotationId)||or.is(o.annotationId))}n.is=i})(ta||(ta={}));var Bd;(function(n){function e(r,i){return{textDocument:r,edits:i}}n.create=e;function t(r){let i=r;return ie.defined(i)&&qd.is(i.textDocument)&&Array.isArray(i.edits)}n.is=t})(Bd||(Bd={}));var Wc;(function(n){function e(r,i,s){let o={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}n.create=e;function t(r){let i=r;return i&&i.kind==="create"&&ie.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||ie.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||ie.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||or.is(i.annotationId))}n.is=t})(Wc||(Wc={}));var jc;(function(n){function e(r,i,s,o){let a={kind:"rename",oldUri:r,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(a.options=s),o!==void 0&&(a.annotationId=o),a}n.create=e;function t(r){let i=r;return i&&i.kind==="rename"&&ie.string(i.oldUri)&&ie.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||ie.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||ie.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||or.is(i.annotationId))}n.is=t})(jc||(jc={}));var $c;(function(n){function e(r,i,s){let o={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}n.create=e;function t(r){let i=r;return i&&i.kind==="delete"&&ie.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||ie.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||ie.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||or.is(i.annotationId))}n.is=t})($c||($c={}));var i1;(function(n){function e(t){let r=t;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>ie.string(i.kind)?Wc.is(i)||jc.is(i)||$c.is(i):Bd.is(i)))}n.is=e})(i1||(i1={}));class a0{constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,r){let i,s;if(r===void 0?i=yo.insert(e,t):or.is(r)?(s=r,i=ta.insert(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(r),i=ta.insert(e,t,s)),this.edits.push(i),s!==void 0)return s}replace(e,t,r){let i,s;if(r===void 0?i=yo.replace(e,t):or.is(r)?(s=r,i=ta.replace(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(r),i=ta.replace(e,t,s)),this.edits.push(i),s!==void 0)return s}delete(e,t){let r,i;if(t===void 0?r=yo.del(e):or.is(t)?(i=t,r=ta.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(t),r=ta.del(e,i)),this.edits.push(r),i!==void 0)return i}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}}class GA{constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let r;if(or.is(e)?r=e:(r=this.nextId(),t=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(t===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=t,this._size++,r}nextId(){return this._counter++,this._counter.toString()}}class VG{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new GA(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(Bd.is(t)){const r=new a0(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(t=>{const r=new a0(e.changes[t]);this._textEditChanges[t]=r})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(qd.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const t={uri:e.uri,version:e.version};let r=this._textEditChanges[t.uri];if(!r){const i=[],s={textDocument:t,edits:i};this._workspaceEdit.documentChanges.push(s),r=new a0(i,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let r=[];this._workspaceEdit.changes[e]=r,t=new a0(r),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new GA,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;ol.is(t)||or.is(t)?i=t:r=t;let s,o;if(i===void 0?s=Wc.create(e,r):(o=or.is(i)?i:this._changeAnnotations.manage(i),s=Wc.create(e,r,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}renameFile(e,t,r,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let s;ol.is(r)||or.is(r)?s=r:i=r;let o,a;if(s===void 0?o=jc.create(e,t,i):(a=or.is(s)?s:this._changeAnnotations.manage(s),o=jc.create(e,t,i,a)),this._workspaceEdit.documentChanges.push(o),a!==void 0)return a}deleteFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;ol.is(t)||or.is(t)?i=t:r=t;let s,o;if(i===void 0?s=$c.create(e,r):(o=or.is(i)?i:this._changeAnnotations.manage(i),s=$c.create(e,r,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}}var k_;(function(n){function e(r){return{uri:r}}n.create=e;function t(r){let i=r;return ie.defined(i)&&ie.string(i.uri)}n.is=t})(k_||(k_={}));var x_;(function(n){function e(r,i){return{uri:r,version:i}}n.create=e;function t(r){let i=r;return ie.defined(i)&&ie.string(i.uri)&&ie.integer(i.version)}n.is=t})(x_||(x_={}));var qd;(function(n){function e(r,i){return{uri:r,version:i}}n.create=e;function t(r){let i=r;return ie.defined(i)&&ie.string(i.uri)&&(i.version===null||ie.integer(i.version))}n.is=t})(qd||(qd={}));var S_;(function(n){function e(r,i,s,o){return{uri:r,languageId:i,version:s,text:o}}n.create=e;function t(r){let i=r;return ie.defined(i)&&ie.string(i.uri)&&ie.string(i.languageId)&&ie.integer(i.version)&&ie.string(i.text)}n.is=t})(S_||(S_={}));var s1;(function(n){n.PlainText="plaintext",n.Markdown="markdown";function e(t){const r=t;return r===n.PlainText||r===n.Markdown}n.is=e})(s1||(s1={}));var zc;(function(n){function e(t){const r=t;return ie.objectLiteral(t)&&s1.is(r.kind)&&ie.string(r.value)}n.is=e})(zc||(zc={}));var C_;(function(n){n.Text=1,n.Method=2,n.Function=3,n.Constructor=4,n.Field=5,n.Variable=6,n.Class=7,n.Interface=8,n.Module=9,n.Property=10,n.Unit=11,n.Value=12,n.Enum=13,n.Keyword=14,n.Snippet=15,n.Color=16,n.File=17,n.Reference=18,n.Folder=19,n.EnumMember=20,n.Constant=21,n.Struct=22,n.Event=23,n.Operator=24,n.TypeParameter=25})(C_||(C_={}));var E_;(function(n){n.PlainText=1,n.Snippet=2})(E_||(E_={}));var A_;(function(n){n.Deprecated=1})(A_||(A_={}));var R_;(function(n){function e(r,i,s){return{newText:r,insert:i,replace:s}}n.create=e;function t(r){const i=r;return i&&ie.string(i.newText)&&gn.is(i.insert)&&gn.is(i.replace)}n.is=t})(R_||(R_={}));var D_;(function(n){n.asIs=1,n.adjustIndentation=2})(D_||(D_={}));var T_;(function(n){function e(t){const r=t;return r&&(ie.string(r.detail)||r.detail===void 0)&&(ie.string(r.description)||r.description===void 0)}n.is=e})(T_||(T_={}));var I_;(function(n){function e(t){return{label:t}}n.create=e})(I_||(I_={}));var M_;(function(n){function e(t,r){return{items:t||[],isIncomplete:!!r}}n.create=e})(M_||(M_={}));var Wd;(function(n){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}n.fromPlainText=e;function t(r){const i=r;return ie.string(i)||ie.objectLiteral(i)&&ie.string(i.language)&&ie.string(i.value)}n.is=t})(Wd||(Wd={}));var O_;(function(n){function e(t){let r=t;return!!r&&ie.objectLiteral(r)&&(zc.is(r.contents)||Wd.is(r.contents)||ie.typedArray(r.contents,Wd.is))&&(t.range===void 0||gn.is(t.range))}n.is=e})(O_||(O_={}));var P_;(function(n){function e(t,r){return r?{label:t,documentation:r}:{label:t}}n.create=e})(P_||(P_={}));var L_;(function(n){function e(t,r,...i){let s={label:t};return ie.defined(r)&&(s.documentation=r),ie.defined(i)?s.parameters=i:s.parameters=[],s}n.create=e})(L_||(L_={}));var F_;(function(n){n.Text=1,n.Read=2,n.Write=3})(F_||(F_={}));var N_;(function(n){function e(t,r){let i={range:t};return ie.number(r)&&(i.kind=r),i}n.create=e})(N_||(N_={}));var B_;(function(n){n.File=1,n.Module=2,n.Namespace=3,n.Package=4,n.Class=5,n.Method=6,n.Property=7,n.Field=8,n.Constructor=9,n.Enum=10,n.Interface=11,n.Function=12,n.Variable=13,n.Constant=14,n.String=15,n.Number=16,n.Boolean=17,n.Array=18,n.Object=19,n.Key=20,n.Null=21,n.EnumMember=22,n.Struct=23,n.Event=24,n.Operator=25,n.TypeParameter=26})(B_||(B_={}));var q_;(function(n){n.Deprecated=1})(q_||(q_={}));var W_;(function(n){function e(t,r,i,s,o){let a={name:t,kind:r,location:{uri:s,range:i}};return o&&(a.containerName=o),a}n.create=e})(W_||(W_={}));var j_;(function(n){function e(t,r,i,s){return s!==void 0?{name:t,kind:r,location:{uri:i,range:s}}:{name:t,kind:r,location:{uri:i}}}n.create=e})(j_||(j_={}));var $_;(function(n){function e(r,i,s,o,a,u){let l={name:r,detail:i,kind:s,range:o,selectionRange:a};return u!==void 0&&(l.children=u),l}n.create=e;function t(r){let i=r;return i&&ie.string(i.name)&&ie.number(i.kind)&&gn.is(i.range)&&gn.is(i.selectionRange)&&(i.detail===void 0||ie.string(i.detail))&&(i.deprecated===void 0||ie.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}n.is=t})($_||($_={}));var z_;(function(n){n.Empty="",n.QuickFix="quickfix",n.Refactor="refactor",n.RefactorExtract="refactor.extract",n.RefactorInline="refactor.inline",n.RefactorRewrite="refactor.rewrite",n.Source="source",n.SourceOrganizeImports="source.organizeImports",n.SourceFixAll="source.fixAll"})(z_||(z_={}));var jd;(function(n){n.Invoked=1,n.Automatic=2})(jd||(jd={}));var U_;(function(n){function e(r,i,s){let o={diagnostics:r};return i!=null&&(o.only=i),s!=null&&(o.triggerKind=s),o}n.create=e;function t(r){let i=r;return ie.defined(i)&&ie.typedArray(i.diagnostics,Nd.is)&&(i.only===void 0||ie.typedArray(i.only,ie.string))&&(i.triggerKind===void 0||i.triggerKind===jd.Invoked||i.triggerKind===jd.Automatic)}n.is=t})(U_||(U_={}));var H_;(function(n){function e(r,i,s){let o={title:r},a=!0;return typeof i=="string"?(a=!1,o.kind=i):ml.is(i)?o.command=i:o.edit=i,a&&s!==void 0&&(o.kind=s),o}n.create=e;function t(r){let i=r;return i&&ie.string(i.title)&&(i.diagnostics===void 0||ie.typedArray(i.diagnostics,Nd.is))&&(i.kind===void 0||ie.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||ml.is(i.command))&&(i.isPreferred===void 0||ie.boolean(i.isPreferred))&&(i.edit===void 0||i1.is(i.edit))}n.is=t})(H_||(H_={}));var V_;(function(n){function e(r,i){let s={range:r};return ie.defined(i)&&(s.data=i),s}n.create=e;function t(r){let i=r;return ie.defined(i)&&gn.is(i.range)&&(ie.undefined(i.command)||ml.is(i.command))}n.is=t})(V_||(V_={}));var G_;(function(n){function e(r,i){return{tabSize:r,insertSpaces:i}}n.create=e;function t(r){let i=r;return ie.defined(i)&&ie.uinteger(i.tabSize)&&ie.boolean(i.insertSpaces)}n.is=t})(G_||(G_={}));var K_;(function(n){function e(r,i,s){return{range:r,target:i,data:s}}n.create=e;function t(r){let i=r;return ie.defined(i)&&gn.is(i.range)&&(ie.undefined(i.target)||ie.string(i.target))}n.is=t})(K_||(K_={}));var Z_;(function(n){function e(r,i){return{range:r,parent:i}}n.create=e;function t(r){let i=r;return ie.objectLiteral(i)&&gn.is(i.range)&&(i.parent===void 0||n.is(i.parent))}n.is=t})(Z_||(Z_={}));var X_;(function(n){n.namespace="namespace",n.type="type",n.class="class",n.enum="enum",n.interface="interface",n.struct="struct",n.typeParameter="typeParameter",n.parameter="parameter",n.variable="variable",n.property="property",n.enumMember="enumMember",n.event="event",n.function="function",n.method="method",n.macro="macro",n.keyword="keyword",n.modifier="modifier",n.comment="comment",n.string="string",n.number="number",n.regexp="regexp",n.operator="operator",n.decorator="decorator"})(X_||(X_={}));var Y_;(function(n){n.declaration="declaration",n.definition="definition",n.readonly="readonly",n.static="static",n.deprecated="deprecated",n.abstract="abstract",n.async="async",n.modification="modification",n.documentation="documentation",n.defaultLibrary="defaultLibrary"})(Y_||(Y_={}));var J_;(function(n){function e(t){const r=t;return ie.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}n.is=e})(J_||(J_={}));var Q_;(function(n){function e(r,i){return{range:r,text:i}}n.create=e;function t(r){const i=r;return i!=null&&gn.is(i.range)&&ie.string(i.text)}n.is=t})(Q_||(Q_={}));var e2;(function(n){function e(r,i,s){return{range:r,variableName:i,caseSensitiveLookup:s}}n.create=e;function t(r){const i=r;return i!=null&&gn.is(i.range)&&ie.boolean(i.caseSensitiveLookup)&&(ie.string(i.variableName)||i.variableName===void 0)}n.is=t})(e2||(e2={}));var t2;(function(n){function e(r,i){return{range:r,expression:i}}n.create=e;function t(r){const i=r;return i!=null&&gn.is(i.range)&&(ie.string(i.expression)||i.expression===void 0)}n.is=t})(t2||(t2={}));var n2;(function(n){function e(r,i){return{frameId:r,stoppedLocation:i}}n.create=e;function t(r){const i=r;return ie.defined(i)&&gn.is(r.stoppedLocation)}n.is=t})(n2||(n2={}));var o1;(function(n){n.Type=1,n.Parameter=2;function e(t){return t===1||t===2}n.is=e})(o1||(o1={}));var a1;(function(n){function e(r){return{value:r}}n.create=e;function t(r){const i=r;return ie.objectLiteral(i)&&(i.tooltip===void 0||ie.string(i.tooltip)||zc.is(i.tooltip))&&(i.location===void 0||Fd.is(i.location))&&(i.command===void 0||ml.is(i.command))}n.is=t})(a1||(a1={}));var r2;(function(n){function e(r,i,s){const o={position:r,label:i};return s!==void 0&&(o.kind=s),o}n.create=e;function t(r){const i=r;return ie.objectLiteral(i)&&Ki.is(i.position)&&(ie.string(i.label)||ie.typedArray(i.label,a1.is))&&(i.kind===void 0||o1.is(i.kind))&&i.textEdits===void 0||ie.typedArray(i.textEdits,yo.is)&&(i.tooltip===void 0||ie.string(i.tooltip)||zc.is(i.tooltip))&&(i.paddingLeft===void 0||ie.boolean(i.paddingLeft))&&(i.paddingRight===void 0||ie.boolean(i.paddingRight))}n.is=t})(r2||(r2={}));var i2;(function(n){function e(t){return{kind:"snippet",value:t}}n.createSnippet=e})(i2||(i2={}));var s2;(function(n){function e(t,r,i,s){return{insertText:t,filterText:r,range:i,command:s}}n.create=e})(s2||(s2={}));var o2;(function(n){function e(t){return{items:t}}n.create=e})(o2||(o2={}));var a2;(function(n){n.Invoked=0,n.Automatic=1})(a2||(a2={}));var u2;(function(n){function e(t,r){return{range:t,text:r}}n.create=e})(u2||(u2={}));var l2;(function(n){function e(t,r){return{triggerKind:t,selectedCompletionInfo:r}}n.create=e})(l2||(l2={}));var c2;(function(n){function e(t){const r=t;return ie.objectLiteral(r)&&t1.is(r.uri)&&ie.string(r.name)}n.is=e})(c2||(c2={}));const GG=[`
|
|
76
|
-
`,`\r
|
|
77
|
-
`,"\r"];var f2;(function(n){function e(s,o,a,u){return new KG(s,o,a,u)}n.create=e;function t(s){let o=s;return!!(ie.defined(o)&&ie.string(o.uri)&&(ie.undefined(o.languageId)||ie.string(o.languageId))&&ie.uinteger(o.lineCount)&&ie.func(o.getText)&&ie.func(o.positionAt)&&ie.func(o.offsetAt))}n.is=t;function r(s,o){let a=s.getText(),u=i(o,(c,f)=>{let d=c.range.start.line-f.range.start.line;return d===0?c.range.start.character-f.range.start.character:d}),l=a.length;for(let c=u.length-1;c>=0;c--){let f=u[c],d=s.offsetAt(f.range.start),g=s.offsetAt(f.range.end);if(g<=l)a=a.substring(0,d)+f.newText+a.substring(g,a.length);else throw new Error("Overlapping edit");l=d}return a}n.applyEdits=r;function i(s,o){if(s.length<=1)return s;const a=s.length/2|0,u=s.slice(0,a),l=s.slice(a);i(u,o),i(l,o);let c=0,f=0,d=0;for(;c<u.length&&f<l.length;)o(u[c],l[f])<=0?s[d++]=u[c++]:s[d++]=l[f++];for(;c<u.length;)s[d++]=u[c++];for(;f<l.length;)s[d++]=l[f++];return s}})(f2||(f2={}));let KG=class{constructor(e,t,r,i){this._uri=e,this._languageId=t,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(t,r)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],t=this._content,r=!0;for(let i=0;i<t.length;i++){r&&(e.push(i),r=!1);let s=t.charAt(i);r=s==="\r"||s===`
|
|
78
|
-
`,s==="\r"&&i+1<t.length&&t.charAt(i+1)===`
|
|
79
|
-
`&&i++}r&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),r=0,i=t.length;if(i===0)return Ki.create(0,e);for(;r<i;){let o=Math.floor((r+i)/2);t[o]>e?i=o:r=o+1}let s=r-1;return Ki.create(s,e-t[s])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let r=t[e.line],i=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}};var ie;(function(n){const e=Object.prototype.toString;function t(g){return typeof g<"u"}n.defined=t;function r(g){return typeof g>"u"}n.undefined=r;function i(g){return g===!0||g===!1}n.boolean=i;function s(g){return e.call(g)==="[object String]"}n.string=s;function o(g){return e.call(g)==="[object Number]"}n.number=o;function a(g,m,y){return e.call(g)==="[object Number]"&&m<=g&&g<=y}n.numberRange=a;function u(g){return e.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}n.integer=u;function l(g){return e.call(g)==="[object Number]"&&0<=g&&g<=2147483647}n.uinteger=l;function c(g){return e.call(g)==="[object Function]"}n.func=c;function f(g){return g!==null&&typeof g=="object"}n.objectLiteral=f;function d(g,m){return Array.isArray(g)&&g.every(m)}n.typedArray=d})(ie||(ie={}));const ZG=Object.freeze(Object.defineProperty({__proto__:null,get AnnotatedTextEdit(){return ta},get ChangeAnnotation(){return ol},get ChangeAnnotationIdentifier(){return or},get CodeAction(){return H_},get CodeActionContext(){return U_},get CodeActionKind(){return z_},get CodeActionTriggerKind(){return jd},get CodeDescription(){return __},get CodeLens(){return V_},get Color(){return n1},get ColorInformation(){return g_},get ColorPresentation(){return m_},get Command(){return ml},get CompletionItem(){return I_},get CompletionItemKind(){return C_},get CompletionItemLabelDetails(){return T_},get CompletionItemTag(){return A_},get CompletionList(){return M_},get CreateFile(){return Wc},get DeleteFile(){return $c},get Diagnostic(){return Nd},get DiagnosticRelatedInformation(){return r1},get DiagnosticSeverity(){return b_},get DiagnosticTag(){return w_},get DocumentHighlight(){return N_},get DocumentHighlightKind(){return F_},get DocumentLink(){return K_},get DocumentSymbol(){return $_},get DocumentUri(){return h_},EOL:GG,get FoldingRange(){return v_},get FoldingRangeKind(){return y_},get FormattingOptions(){return G_},get Hover(){return O_},get InlayHint(){return r2},get InlayHintKind(){return o1},get InlayHintLabelPart(){return a1},get InlineCompletionContext(){return l2},get InlineCompletionItem(){return s2},get InlineCompletionList(){return o2},get InlineCompletionTriggerKind(){return a2},get InlineValueContext(){return n2},get InlineValueEvaluatableExpression(){return t2},get InlineValueText(){return Q_},get InlineValueVariableLookup(){return e2},get InsertReplaceEdit(){return R_},get InsertTextFormat(){return E_},get InsertTextMode(){return D_},get Location(){return Fd},get LocationLink(){return p_},get MarkedString(){return Wd},get MarkupContent(){return zc},get MarkupKind(){return s1},get OptionalVersionedTextDocumentIdentifier(){return qd},get ParameterInformation(){return P_},get Position(){return Ki},get Range(){return gn},get RenameFile(){return jc},get SelectedCompletionInfo(){return u2},get SelectionRange(){return Z_},get SemanticTokenModifiers(){return Y_},get SemanticTokenTypes(){return X_},get SemanticTokens(){return J_},get SignatureInformation(){return L_},get StringValue(){return i2},get SymbolInformation(){return W_},get SymbolKind(){return B_},get SymbolTag(){return q_},get TextDocument(){return f2},get TextDocumentEdit(){return Bd},get TextDocumentIdentifier(){return k_},get TextDocumentItem(){return S_},get TextEdit(){return yo},get URI(){return t1},get VersionedTextDocumentIdentifier(){return x_},WorkspaceChange:VG,get WorkspaceEdit(){return i1},get WorkspaceFolder(){return c2},get WorkspaceSymbol(){return j_},get integer(){return d_},get uinteger(){return Ld}},Symbol.toStringTag,{value:"Module"})),Hk=W1(ZG);var Br={},KA;function dn(){if(KA)return Br;KA=1,Object.defineProperty(Br,"__esModule",{value:!0}),Br.ProtocolNotificationType=Br.ProtocolNotificationType0=Br.ProtocolRequestType=Br.ProtocolRequestType0=Br.RegistrationType=Br.MessageDirection=void 0;const n=rf();var e;(function(a){a.clientToServer="clientToServer",a.serverToClient="serverToClient",a.both="both"})(e||(Br.MessageDirection=e={}));class t{constructor(u){this.method=u}}Br.RegistrationType=t;class r extends n.RequestType0{constructor(u){super(u)}}Br.ProtocolRequestType0=r;class i extends n.RequestType{constructor(u){super(u,n.ParameterStructures.byName)}}Br.ProtocolRequestType=i;class s extends n.NotificationType0{constructor(u){super(u)}}Br.ProtocolNotificationType0=s;class o extends n.NotificationType{constructor(u){super(u,n.ParameterStructures.byName)}}return Br.ProtocolNotificationType=o,Br}var bb={},kn={},ZA;function Vk(){if(ZA)return kn;ZA=1,Object.defineProperty(kn,"__esModule",{value:!0}),kn.objectLiteral=kn.typedArray=kn.stringArray=kn.array=kn.func=kn.error=kn.number=kn.string=kn.boolean=void 0;function n(l){return l===!0||l===!1}kn.boolean=n;function e(l){return typeof l=="string"||l instanceof String}kn.string=e;function t(l){return typeof l=="number"||l instanceof Number}kn.number=t;function r(l){return l instanceof Error}kn.error=r;function i(l){return typeof l=="function"}kn.func=i;function s(l){return Array.isArray(l)}kn.array=s;function o(l){return s(l)&&l.every(c=>e(c))}kn.stringArray=o;function a(l,c){return Array.isArray(l)&&l.every(c)}kn.typedArray=a;function u(l){return l!==null&&typeof l=="object"}return kn.objectLiteral=u,kn}var Eh={},XA;function XG(){if(XA)return Eh;XA=1,Object.defineProperty(Eh,"__esModule",{value:!0}),Eh.ImplementationRequest=void 0;const n=dn();var e;return function(t){t.method="textDocument/implementation",t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)}(e||(Eh.ImplementationRequest=e={})),Eh}var Ah={},YA;function YG(){if(YA)return Ah;YA=1,Object.defineProperty(Ah,"__esModule",{value:!0}),Ah.TypeDefinitionRequest=void 0;const n=dn();var e;return function(t){t.method="textDocument/typeDefinition",t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)}(e||(Ah.TypeDefinitionRequest=e={})),Ah}var Wu={},JA;function JG(){if(JA)return Wu;JA=1,Object.defineProperty(Wu,"__esModule",{value:!0}),Wu.DidChangeWorkspaceFoldersNotification=Wu.WorkspaceFoldersRequest=void 0;const n=dn();var e;(function(r){r.method="workspace/workspaceFolders",r.messageDirection=n.MessageDirection.serverToClient,r.type=new n.ProtocolRequestType0(r.method)})(e||(Wu.WorkspaceFoldersRequest=e={}));var t;return function(r){r.method="workspace/didChangeWorkspaceFolders",r.messageDirection=n.MessageDirection.clientToServer,r.type=new n.ProtocolNotificationType(r.method)}(t||(Wu.DidChangeWorkspaceFoldersNotification=t={})),Wu}var Rh={},QA;function QG(){if(QA)return Rh;QA=1,Object.defineProperty(Rh,"__esModule",{value:!0}),Rh.ConfigurationRequest=void 0;const n=dn();var e;return function(t){t.method="workspace/configuration",t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType(t.method)}(e||(Rh.ConfigurationRequest=e={})),Rh}var ju={},eR;function eK(){if(eR)return ju;eR=1,Object.defineProperty(ju,"__esModule",{value:!0}),ju.ColorPresentationRequest=ju.DocumentColorRequest=void 0;const n=dn();var e;(function(r){r.method="textDocument/documentColor",r.messageDirection=n.MessageDirection.clientToServer,r.type=new n.ProtocolRequestType(r.method)})(e||(ju.DocumentColorRequest=e={}));var t;return function(r){r.method="textDocument/colorPresentation",r.messageDirection=n.MessageDirection.clientToServer,r.type=new n.ProtocolRequestType(r.method)}(t||(ju.ColorPresentationRequest=t={})),ju}var $u={},tR;function tK(){if(tR)return $u;tR=1,Object.defineProperty($u,"__esModule",{value:!0}),$u.FoldingRangeRefreshRequest=$u.FoldingRangeRequest=void 0;const n=dn();var e;(function(r){r.method="textDocument/foldingRange",r.messageDirection=n.MessageDirection.clientToServer,r.type=new n.ProtocolRequestType(r.method)})(e||($u.FoldingRangeRequest=e={}));var t;return function(r){r.method="workspace/foldingRange/refresh",r.messageDirection=n.MessageDirection.serverToClient,r.type=new n.ProtocolRequestType0(r.method)}(t||($u.FoldingRangeRefreshRequest=t={})),$u}var Dh={},nR;function nK(){if(nR)return Dh;nR=1,Object.defineProperty(Dh,"__esModule",{value:!0}),Dh.DeclarationRequest=void 0;const n=dn();var e;return function(t){t.method="textDocument/declaration",t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)}(e||(Dh.DeclarationRequest=e={})),Dh}var Th={},rR;function rK(){if(rR)return Th;rR=1,Object.defineProperty(Th,"__esModule",{value:!0}),Th.SelectionRangeRequest=void 0;const n=dn();var e;return function(t){t.method="textDocument/selectionRange",t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)}(e||(Th.SelectionRangeRequest=e={})),Th}var Ko={},iR;function iK(){if(iR)return Ko;iR=1,Object.defineProperty(Ko,"__esModule",{value:!0}),Ko.WorkDoneProgressCancelNotification=Ko.WorkDoneProgressCreateRequest=Ko.WorkDoneProgress=void 0;const n=rf(),e=dn();var t;(function(s){s.type=new n.ProgressType;function o(a){return a===s.type}s.is=o})(t||(Ko.WorkDoneProgress=t={}));var r;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=e.MessageDirection.serverToClient,s.type=new e.ProtocolRequestType(s.method)})(r||(Ko.WorkDoneProgressCreateRequest=r={}));var i;return function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolNotificationType(s.method)}(i||(Ko.WorkDoneProgressCancelNotification=i={})),Ko}var Zo={},sR;function sK(){if(sR)return Zo;sR=1,Object.defineProperty(Zo,"__esModule",{value:!0}),Zo.CallHierarchyOutgoingCallsRequest=Zo.CallHierarchyIncomingCallsRequest=Zo.CallHierarchyPrepareRequest=void 0;const n=dn();var e;(function(i){i.method="textDocument/prepareCallHierarchy",i.messageDirection=n.MessageDirection.clientToServer,i.type=new n.ProtocolRequestType(i.method)})(e||(Zo.CallHierarchyPrepareRequest=e={}));var t;(function(i){i.method="callHierarchy/incomingCalls",i.messageDirection=n.MessageDirection.clientToServer,i.type=new n.ProtocolRequestType(i.method)})(t||(Zo.CallHierarchyIncomingCallsRequest=t={}));var r;return function(i){i.method="callHierarchy/outgoingCalls",i.messageDirection=n.MessageDirection.clientToServer,i.type=new n.ProtocolRequestType(i.method)}(r||(Zo.CallHierarchyOutgoingCallsRequest=r={})),Zo}var qr={},oR;function oK(){if(oR)return qr;oR=1,Object.defineProperty(qr,"__esModule",{value:!0}),qr.SemanticTokensRefreshRequest=qr.SemanticTokensRangeRequest=qr.SemanticTokensDeltaRequest=qr.SemanticTokensRequest=qr.SemanticTokensRegistrationType=qr.TokenFormat=void 0;const n=dn();var e;(function(a){a.Relative="relative"})(e||(qr.TokenFormat=e={}));var t;(function(a){a.method="textDocument/semanticTokens",a.type=new n.RegistrationType(a.method)})(t||(qr.SemanticTokensRegistrationType=t={}));var r;(function(a){a.method="textDocument/semanticTokens/full",a.messageDirection=n.MessageDirection.clientToServer,a.type=new n.ProtocolRequestType(a.method),a.registrationMethod=t.method})(r||(qr.SemanticTokensRequest=r={}));var i;(function(a){a.method="textDocument/semanticTokens/full/delta",a.messageDirection=n.MessageDirection.clientToServer,a.type=new n.ProtocolRequestType(a.method),a.registrationMethod=t.method})(i||(qr.SemanticTokensDeltaRequest=i={}));var s;(function(a){a.method="textDocument/semanticTokens/range",a.messageDirection=n.MessageDirection.clientToServer,a.type=new n.ProtocolRequestType(a.method),a.registrationMethod=t.method})(s||(qr.SemanticTokensRangeRequest=s={}));var o;return function(a){a.method="workspace/semanticTokens/refresh",a.messageDirection=n.MessageDirection.serverToClient,a.type=new n.ProtocolRequestType0(a.method)}(o||(qr.SemanticTokensRefreshRequest=o={})),qr}var Ih={},aR;function aK(){if(aR)return Ih;aR=1,Object.defineProperty(Ih,"__esModule",{value:!0}),Ih.ShowDocumentRequest=void 0;const n=dn();var e;return function(t){t.method="window/showDocument",t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType(t.method)}(e||(Ih.ShowDocumentRequest=e={})),Ih}var Mh={},uR;function uK(){if(uR)return Mh;uR=1,Object.defineProperty(Mh,"__esModule",{value:!0}),Mh.LinkedEditingRangeRequest=void 0;const n=dn();var e;return function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)}(e||(Mh.LinkedEditingRangeRequest=e={})),Mh}var Qn={},lR;function lK(){if(lR)return Qn;lR=1,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.WillDeleteFilesRequest=Qn.DidDeleteFilesNotification=Qn.DidRenameFilesNotification=Qn.WillRenameFilesRequest=Qn.DidCreateFilesNotification=Qn.WillCreateFilesRequest=Qn.FileOperationPatternKind=void 0;const n=dn();var e;(function(u){u.file="file",u.folder="folder"})(e||(Qn.FileOperationPatternKind=e={}));var t;(function(u){u.method="workspace/willCreateFiles",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method)})(t||(Qn.WillCreateFilesRequest=t={}));var r;(function(u){u.method="workspace/didCreateFiles",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolNotificationType(u.method)})(r||(Qn.DidCreateFilesNotification=r={}));var i;(function(u){u.method="workspace/willRenameFiles",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method)})(i||(Qn.WillRenameFilesRequest=i={}));var s;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolNotificationType(u.method)})(s||(Qn.DidRenameFilesNotification=s={}));var o;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolNotificationType(u.method)})(o||(Qn.DidDeleteFilesNotification=o={}));var a;return function(u){u.method="workspace/willDeleteFiles",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method)}(a||(Qn.WillDeleteFilesRequest=a={})),Qn}var Xo={},cR;function cK(){if(cR)return Xo;cR=1,Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.MonikerRequest=Xo.MonikerKind=Xo.UniquenessLevel=void 0;const n=dn();var e;(function(i){i.document="document",i.project="project",i.group="group",i.scheme="scheme",i.global="global"})(e||(Xo.UniquenessLevel=e={}));var t;(function(i){i.$import="import",i.$export="export",i.local="local"})(t||(Xo.MonikerKind=t={}));var r;return function(i){i.method="textDocument/moniker",i.messageDirection=n.MessageDirection.clientToServer,i.type=new n.ProtocolRequestType(i.method)}(r||(Xo.MonikerRequest=r={})),Xo}var Yo={},fR;function fK(){if(fR)return Yo;fR=1,Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.TypeHierarchySubtypesRequest=Yo.TypeHierarchySupertypesRequest=Yo.TypeHierarchyPrepareRequest=void 0;const n=dn();var e;(function(i){i.method="textDocument/prepareTypeHierarchy",i.messageDirection=n.MessageDirection.clientToServer,i.type=new n.ProtocolRequestType(i.method)})(e||(Yo.TypeHierarchyPrepareRequest=e={}));var t;(function(i){i.method="typeHierarchy/supertypes",i.messageDirection=n.MessageDirection.clientToServer,i.type=new n.ProtocolRequestType(i.method)})(t||(Yo.TypeHierarchySupertypesRequest=t={}));var r;return function(i){i.method="typeHierarchy/subtypes",i.messageDirection=n.MessageDirection.clientToServer,i.type=new n.ProtocolRequestType(i.method)}(r||(Yo.TypeHierarchySubtypesRequest=r={})),Yo}var zu={},hR;function hK(){if(hR)return zu;hR=1,Object.defineProperty(zu,"__esModule",{value:!0}),zu.InlineValueRefreshRequest=zu.InlineValueRequest=void 0;const n=dn();var e;(function(r){r.method="textDocument/inlineValue",r.messageDirection=n.MessageDirection.clientToServer,r.type=new n.ProtocolRequestType(r.method)})(e||(zu.InlineValueRequest=e={}));var t;return function(r){r.method="workspace/inlineValue/refresh",r.messageDirection=n.MessageDirection.serverToClient,r.type=new n.ProtocolRequestType0(r.method)}(t||(zu.InlineValueRefreshRequest=t={})),zu}var Jo={},dR;function dK(){if(dR)return Jo;dR=1,Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.InlayHintRefreshRequest=Jo.InlayHintResolveRequest=Jo.InlayHintRequest=void 0;const n=dn();var e;(function(i){i.method="textDocument/inlayHint",i.messageDirection=n.MessageDirection.clientToServer,i.type=new n.ProtocolRequestType(i.method)})(e||(Jo.InlayHintRequest=e={}));var t;(function(i){i.method="inlayHint/resolve",i.messageDirection=n.MessageDirection.clientToServer,i.type=new n.ProtocolRequestType(i.method)})(t||(Jo.InlayHintResolveRequest=t={}));var r;return function(i){i.method="workspace/inlayHint/refresh",i.messageDirection=n.MessageDirection.serverToClient,i.type=new n.ProtocolRequestType0(i.method)}(r||(Jo.InlayHintRefreshRequest=r={})),Jo}var Si={},pR;function pK(){if(pR)return Si;pR=1,Object.defineProperty(Si,"__esModule",{value:!0}),Si.DiagnosticRefreshRequest=Si.WorkspaceDiagnosticRequest=Si.DocumentDiagnosticRequest=Si.DocumentDiagnosticReportKind=Si.DiagnosticServerCancellationData=void 0;const n=rf(),e=Vk(),t=dn();var r;(function(u){function l(c){const f=c;return f&&e.boolean(f.retriggerRequest)}u.is=l})(r||(Si.DiagnosticServerCancellationData=r={}));var i;(function(u){u.Full="full",u.Unchanged="unchanged"})(i||(Si.DocumentDiagnosticReportKind=i={}));var s;(function(u){u.method="textDocument/diagnostic",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method),u.partialResult=new n.ProgressType})(s||(Si.DocumentDiagnosticRequest=s={}));var o;(function(u){u.method="workspace/diagnostic",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method),u.partialResult=new n.ProgressType})(o||(Si.WorkspaceDiagnosticRequest=o={}));var a;return function(u){u.method="workspace/diagnostic/refresh",u.messageDirection=t.MessageDirection.serverToClient,u.type=new t.ProtocolRequestType0(u.method)}(a||(Si.DiagnosticRefreshRequest=a={})),Si}var un={},gR;function gK(){if(gR)return un;gR=1,Object.defineProperty(un,"__esModule",{value:!0}),un.DidCloseNotebookDocumentNotification=un.DidSaveNotebookDocumentNotification=un.DidChangeNotebookDocumentNotification=un.NotebookCellArrayChange=un.DidOpenNotebookDocumentNotification=un.NotebookDocumentSyncRegistrationType=un.NotebookDocument=un.NotebookCell=un.ExecutionSummary=un.NotebookCellKind=void 0;const n=Hk,e=Vk(),t=dn();var r;(function(g){g.Markup=1,g.Code=2;function m(y){return y===1||y===2}g.is=m})(r||(un.NotebookCellKind=r={}));var i;(function(g){function m(w,x){const _={executionOrder:w};return(x===!0||x===!1)&&(_.success=x),_}g.create=m;function y(w){const x=w;return e.objectLiteral(x)&&n.uinteger.is(x.executionOrder)&&(x.success===void 0||e.boolean(x.success))}g.is=y;function b(w,x){return w===x?!0:w==null||x===null||x===void 0?!1:w.executionOrder===x.executionOrder&&w.success===x.success}g.equals=b})(i||(un.ExecutionSummary=i={}));var s;(function(g){function m(x,_){return{kind:x,document:_}}g.create=m;function y(x){const _=x;return e.objectLiteral(_)&&r.is(_.kind)&&n.DocumentUri.is(_.document)&&(_.metadata===void 0||e.objectLiteral(_.metadata))}g.is=y;function b(x,_){const S=new Set;return x.document!==_.document&&S.add("document"),x.kind!==_.kind&&S.add("kind"),x.executionSummary!==_.executionSummary&&S.add("executionSummary"),(x.metadata!==void 0||_.metadata!==void 0)&&!w(x.metadata,_.metadata)&&S.add("metadata"),(x.executionSummary!==void 0||_.executionSummary!==void 0)&&!i.equals(x.executionSummary,_.executionSummary)&&S.add("executionSummary"),S}g.diff=b;function w(x,_){if(x===_)return!0;if(x==null||_===null||_===void 0||typeof x!=typeof _||typeof x!="object")return!1;const S=Array.isArray(x),C=Array.isArray(_);if(S!==C)return!1;if(S&&C){if(x.length!==_.length)return!1;for(let A=0;A<x.length;A++)if(!w(x[A],_[A]))return!1}if(e.objectLiteral(x)&&e.objectLiteral(_)){const A=Object.keys(x),I=Object.keys(_);if(A.length!==I.length||(A.sort(),I.sort(),!w(A,I)))return!1;for(let W=0;W<A.length;W++){const B=A[W];if(!w(x[B],_[B]))return!1}}return!0}})(s||(un.NotebookCell=s={}));var o;(function(g){function m(b,w,x,_){return{uri:b,notebookType:w,version:x,cells:_}}g.create=m;function y(b){const w=b;return e.objectLiteral(w)&&e.string(w.uri)&&n.integer.is(w.version)&&e.typedArray(w.cells,s.is)}g.is=y})(o||(un.NotebookDocument=o={}));var a;(function(g){g.method="notebookDocument/sync",g.messageDirection=t.MessageDirection.clientToServer,g.type=new t.RegistrationType(g.method)})(a||(un.NotebookDocumentSyncRegistrationType=a={}));var u;(function(g){g.method="notebookDocument/didOpen",g.messageDirection=t.MessageDirection.clientToServer,g.type=new t.ProtocolNotificationType(g.method),g.registrationMethod=a.method})(u||(un.DidOpenNotebookDocumentNotification=u={}));var l;(function(g){function m(b){const w=b;return e.objectLiteral(w)&&n.uinteger.is(w.start)&&n.uinteger.is(w.deleteCount)&&(w.cells===void 0||e.typedArray(w.cells,s.is))}g.is=m;function y(b,w,x){const _={start:b,deleteCount:w};return x!==void 0&&(_.cells=x),_}g.create=y})(l||(un.NotebookCellArrayChange=l={}));var c;(function(g){g.method="notebookDocument/didChange",g.messageDirection=t.MessageDirection.clientToServer,g.type=new t.ProtocolNotificationType(g.method),g.registrationMethod=a.method})(c||(un.DidChangeNotebookDocumentNotification=c={}));var f;(function(g){g.method="notebookDocument/didSave",g.messageDirection=t.MessageDirection.clientToServer,g.type=new t.ProtocolNotificationType(g.method),g.registrationMethod=a.method})(f||(un.DidSaveNotebookDocumentNotification=f={}));var d;return function(g){g.method="notebookDocument/didClose",g.messageDirection=t.MessageDirection.clientToServer,g.type=new t.ProtocolNotificationType(g.method),g.registrationMethod=a.method}(d||(un.DidCloseNotebookDocumentNotification=d={})),un}var Oh={},mR;function mK(){if(mR)return Oh;mR=1,Object.defineProperty(Oh,"__esModule",{value:!0}),Oh.InlineCompletionRequest=void 0;const n=dn();var e;return function(t){t.method="textDocument/inlineCompletion",t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)}(e||(Oh.InlineCompletionRequest=e={})),Oh}var yR;function yK(){return yR||(yR=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.WorkspaceSymbolRequest=n.CodeActionResolveRequest=n.CodeActionRequest=n.DocumentSymbolRequest=n.DocumentHighlightRequest=n.ReferencesRequest=n.DefinitionRequest=n.SignatureHelpRequest=n.SignatureHelpTriggerKind=n.HoverRequest=n.CompletionResolveRequest=n.CompletionRequest=n.CompletionTriggerKind=n.PublishDiagnosticsNotification=n.WatchKind=n.RelativePattern=n.FileChangeType=n.DidChangeWatchedFilesNotification=n.WillSaveTextDocumentWaitUntilRequest=n.WillSaveTextDocumentNotification=n.TextDocumentSaveReason=n.DidSaveTextDocumentNotification=n.DidCloseTextDocumentNotification=n.DidChangeTextDocumentNotification=n.TextDocumentContentChangeEvent=n.DidOpenTextDocumentNotification=n.TextDocumentSyncKind=n.TelemetryEventNotification=n.LogMessageNotification=n.ShowMessageRequest=n.ShowMessageNotification=n.MessageType=n.DidChangeConfigurationNotification=n.ExitNotification=n.ShutdownRequest=n.InitializedNotification=n.InitializeErrorCodes=n.InitializeRequest=n.WorkDoneProgressOptions=n.TextDocumentRegistrationOptions=n.StaticRegistrationOptions=n.PositionEncodingKind=n.FailureHandlingKind=n.ResourceOperationKind=n.UnregistrationRequest=n.RegistrationRequest=n.DocumentSelector=n.NotebookCellTextDocumentFilter=n.NotebookDocumentFilter=n.TextDocumentFilter=void 0,n.MonikerRequest=n.MonikerKind=n.UniquenessLevel=n.WillDeleteFilesRequest=n.DidDeleteFilesNotification=n.WillRenameFilesRequest=n.DidRenameFilesNotification=n.WillCreateFilesRequest=n.DidCreateFilesNotification=n.FileOperationPatternKind=n.LinkedEditingRangeRequest=n.ShowDocumentRequest=n.SemanticTokensRegistrationType=n.SemanticTokensRefreshRequest=n.SemanticTokensRangeRequest=n.SemanticTokensDeltaRequest=n.SemanticTokensRequest=n.TokenFormat=n.CallHierarchyPrepareRequest=n.CallHierarchyOutgoingCallsRequest=n.CallHierarchyIncomingCallsRequest=n.WorkDoneProgressCancelNotification=n.WorkDoneProgressCreateRequest=n.WorkDoneProgress=n.SelectionRangeRequest=n.DeclarationRequest=n.FoldingRangeRefreshRequest=n.FoldingRangeRequest=n.ColorPresentationRequest=n.DocumentColorRequest=n.ConfigurationRequest=n.DidChangeWorkspaceFoldersNotification=n.WorkspaceFoldersRequest=n.TypeDefinitionRequest=n.ImplementationRequest=n.ApplyWorkspaceEditRequest=n.ExecuteCommandRequest=n.PrepareRenameRequest=n.RenameRequest=n.PrepareSupportDefaultBehavior=n.DocumentOnTypeFormattingRequest=n.DocumentRangesFormattingRequest=n.DocumentRangeFormattingRequest=n.DocumentFormattingRequest=n.DocumentLinkResolveRequest=n.DocumentLinkRequest=n.CodeLensRefreshRequest=n.CodeLensResolveRequest=n.CodeLensRequest=n.WorkspaceSymbolResolveRequest=void 0,n.InlineCompletionRequest=n.DidCloseNotebookDocumentNotification=n.DidSaveNotebookDocumentNotification=n.DidChangeNotebookDocumentNotification=n.NotebookCellArrayChange=n.DidOpenNotebookDocumentNotification=n.NotebookDocumentSyncRegistrationType=n.NotebookDocument=n.NotebookCell=n.ExecutionSummary=n.NotebookCellKind=n.DiagnosticRefreshRequest=n.WorkspaceDiagnosticRequest=n.DocumentDiagnosticRequest=n.DocumentDiagnosticReportKind=n.DiagnosticServerCancellationData=n.InlayHintRefreshRequest=n.InlayHintResolveRequest=n.InlayHintRequest=n.InlineValueRefreshRequest=n.InlineValueRequest=n.TypeHierarchySupertypesRequest=n.TypeHierarchySubtypesRequest=n.TypeHierarchyPrepareRequest=void 0;const e=dn(),t=Hk,r=Vk(),i=XG();Object.defineProperty(n,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const s=YG();Object.defineProperty(n,"TypeDefinitionRequest",{enumerable:!0,get:function(){return s.TypeDefinitionRequest}});const o=JG();Object.defineProperty(n,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return o.WorkspaceFoldersRequest}}),Object.defineProperty(n,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return o.DidChangeWorkspaceFoldersNotification}});const a=QG();Object.defineProperty(n,"ConfigurationRequest",{enumerable:!0,get:function(){return a.ConfigurationRequest}});const u=eK();Object.defineProperty(n,"DocumentColorRequest",{enumerable:!0,get:function(){return u.DocumentColorRequest}}),Object.defineProperty(n,"ColorPresentationRequest",{enumerable:!0,get:function(){return u.ColorPresentationRequest}});const l=tK();Object.defineProperty(n,"FoldingRangeRequest",{enumerable:!0,get:function(){return l.FoldingRangeRequest}}),Object.defineProperty(n,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return l.FoldingRangeRefreshRequest}});const c=nK();Object.defineProperty(n,"DeclarationRequest",{enumerable:!0,get:function(){return c.DeclarationRequest}});const f=rK();Object.defineProperty(n,"SelectionRangeRequest",{enumerable:!0,get:function(){return f.SelectionRangeRequest}});const d=iK();Object.defineProperty(n,"WorkDoneProgress",{enumerable:!0,get:function(){return d.WorkDoneProgress}}),Object.defineProperty(n,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return d.WorkDoneProgressCreateRequest}}),Object.defineProperty(n,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return d.WorkDoneProgressCancelNotification}});const g=sK();Object.defineProperty(n,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return g.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(n,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return g.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(n,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return g.CallHierarchyPrepareRequest}});const m=oK();Object.defineProperty(n,"TokenFormat",{enumerable:!0,get:function(){return m.TokenFormat}}),Object.defineProperty(n,"SemanticTokensRequest",{enumerable:!0,get:function(){return m.SemanticTokensRequest}}),Object.defineProperty(n,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return m.SemanticTokensDeltaRequest}}),Object.defineProperty(n,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return m.SemanticTokensRangeRequest}}),Object.defineProperty(n,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return m.SemanticTokensRefreshRequest}}),Object.defineProperty(n,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return m.SemanticTokensRegistrationType}});const y=aK();Object.defineProperty(n,"ShowDocumentRequest",{enumerable:!0,get:function(){return y.ShowDocumentRequest}});const b=uK();Object.defineProperty(n,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return b.LinkedEditingRangeRequest}});const w=lK();Object.defineProperty(n,"FileOperationPatternKind",{enumerable:!0,get:function(){return w.FileOperationPatternKind}}),Object.defineProperty(n,"DidCreateFilesNotification",{enumerable:!0,get:function(){return w.DidCreateFilesNotification}}),Object.defineProperty(n,"WillCreateFilesRequest",{enumerable:!0,get:function(){return w.WillCreateFilesRequest}}),Object.defineProperty(n,"DidRenameFilesNotification",{enumerable:!0,get:function(){return w.DidRenameFilesNotification}}),Object.defineProperty(n,"WillRenameFilesRequest",{enumerable:!0,get:function(){return w.WillRenameFilesRequest}}),Object.defineProperty(n,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return w.DidDeleteFilesNotification}}),Object.defineProperty(n,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return w.WillDeleteFilesRequest}});const x=cK();Object.defineProperty(n,"UniquenessLevel",{enumerable:!0,get:function(){return x.UniquenessLevel}}),Object.defineProperty(n,"MonikerKind",{enumerable:!0,get:function(){return x.MonikerKind}}),Object.defineProperty(n,"MonikerRequest",{enumerable:!0,get:function(){return x.MonikerRequest}});const _=fK();Object.defineProperty(n,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return _.TypeHierarchyPrepareRequest}}),Object.defineProperty(n,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return _.TypeHierarchySubtypesRequest}}),Object.defineProperty(n,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return _.TypeHierarchySupertypesRequest}});const S=hK();Object.defineProperty(n,"InlineValueRequest",{enumerable:!0,get:function(){return S.InlineValueRequest}}),Object.defineProperty(n,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return S.InlineValueRefreshRequest}});const C=dK();Object.defineProperty(n,"InlayHintRequest",{enumerable:!0,get:function(){return C.InlayHintRequest}}),Object.defineProperty(n,"InlayHintResolveRequest",{enumerable:!0,get:function(){return C.InlayHintResolveRequest}}),Object.defineProperty(n,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return C.InlayHintRefreshRequest}});const A=pK();Object.defineProperty(n,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return A.DiagnosticServerCancellationData}}),Object.defineProperty(n,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return A.DocumentDiagnosticReportKind}}),Object.defineProperty(n,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return A.DocumentDiagnosticRequest}}),Object.defineProperty(n,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return A.WorkspaceDiagnosticRequest}}),Object.defineProperty(n,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return A.DiagnosticRefreshRequest}});const I=gK();Object.defineProperty(n,"NotebookCellKind",{enumerable:!0,get:function(){return I.NotebookCellKind}}),Object.defineProperty(n,"ExecutionSummary",{enumerable:!0,get:function(){return I.ExecutionSummary}}),Object.defineProperty(n,"NotebookCell",{enumerable:!0,get:function(){return I.NotebookCell}}),Object.defineProperty(n,"NotebookDocument",{enumerable:!0,get:function(){return I.NotebookDocument}}),Object.defineProperty(n,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return I.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(n,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return I.DidOpenNotebookDocumentNotification}}),Object.defineProperty(n,"NotebookCellArrayChange",{enumerable:!0,get:function(){return I.NotebookCellArrayChange}}),Object.defineProperty(n,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return I.DidChangeNotebookDocumentNotification}}),Object.defineProperty(n,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return I.DidSaveNotebookDocumentNotification}}),Object.defineProperty(n,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return I.DidCloseNotebookDocumentNotification}});const W=mK();Object.defineProperty(n,"InlineCompletionRequest",{enumerable:!0,get:function(){return W.InlineCompletionRequest}});var B;(function(L){function Jt(Qt){const qe=Qt;return r.string(qe)||r.string(qe.language)||r.string(qe.scheme)||r.string(qe.pattern)}L.is=Jt})(B||(n.TextDocumentFilter=B={}));var K;(function(L){function Jt(Qt){const qe=Qt;return r.objectLiteral(qe)&&(r.string(qe.notebookType)||r.string(qe.scheme)||r.string(qe.pattern))}L.is=Jt})(K||(n.NotebookDocumentFilter=K={}));var G;(function(L){function Jt(Qt){const qe=Qt;return r.objectLiteral(qe)&&(r.string(qe.notebook)||K.is(qe.notebook))&&(qe.language===void 0||r.string(qe.language))}L.is=Jt})(G||(n.NotebookCellTextDocumentFilter=G={}));var F;(function(L){function Jt(Qt){if(!Array.isArray(Qt))return!1;for(let qe of Qt)if(!r.string(qe)&&!B.is(qe)&&!G.is(qe))return!1;return!0}L.is=Jt})(F||(n.DocumentSelector=F={}));var R;(function(L){L.method="client/registerCapability",L.messageDirection=e.MessageDirection.serverToClient,L.type=new e.ProtocolRequestType(L.method)})(R||(n.RegistrationRequest=R={}));var Y;(function(L){L.method="client/unregisterCapability",L.messageDirection=e.MessageDirection.serverToClient,L.type=new e.ProtocolRequestType(L.method)})(Y||(n.UnregistrationRequest=Y={}));var q;(function(L){L.Create="create",L.Rename="rename",L.Delete="delete"})(q||(n.ResourceOperationKind=q={}));var te;(function(L){L.Abort="abort",L.Transactional="transactional",L.TextOnlyTransactional="textOnlyTransactional",L.Undo="undo"})(te||(n.FailureHandlingKind=te={}));var ae;(function(L){L.UTF8="utf-8",L.UTF16="utf-16",L.UTF32="utf-32"})(ae||(n.PositionEncodingKind=ae={}));var be;(function(L){function Jt(Qt){const qe=Qt;return qe&&r.string(qe.id)&&qe.id.length>0}L.hasId=Jt})(be||(n.StaticRegistrationOptions=be={}));var ye;(function(L){function Jt(Qt){const qe=Qt;return qe&&(qe.documentSelector===null||F.is(qe.documentSelector))}L.is=Jt})(ye||(n.TextDocumentRegistrationOptions=ye={}));var De;(function(L){function Jt(qe){const z=qe;return r.objectLiteral(z)&&(z.workDoneProgress===void 0||r.boolean(z.workDoneProgress))}L.is=Jt;function Qt(qe){const z=qe;return z&&r.boolean(z.workDoneProgress)}L.hasWorkDoneProgress=Qt})(De||(n.WorkDoneProgressOptions=De={}));var we;(function(L){L.method="initialize",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(we||(n.InitializeRequest=we={}));var Pe;(function(L){L.unknownProtocolVersion=1})(Pe||(n.InitializeErrorCodes=Pe={}));var Rt;(function(L){L.method="initialized",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolNotificationType(L.method)})(Rt||(n.InitializedNotification=Rt={}));var kt;(function(L){L.method="shutdown",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType0(L.method)})(kt||(n.ShutdownRequest=kt={}));var rt;(function(L){L.method="exit",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolNotificationType0(L.method)})(rt||(n.ExitNotification=rt={}));var Xt;(function(L){L.method="workspace/didChangeConfiguration",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolNotificationType(L.method)})(Xt||(n.DidChangeConfigurationNotification=Xt={}));var Bn;(function(L){L.Error=1,L.Warning=2,L.Info=3,L.Log=4,L.Debug=5})(Bn||(n.MessageType=Bn={}));var rn;(function(L){L.method="window/showMessage",L.messageDirection=e.MessageDirection.serverToClient,L.type=new e.ProtocolNotificationType(L.method)})(rn||(n.ShowMessageNotification=rn={}));var yn;(function(L){L.method="window/showMessageRequest",L.messageDirection=e.MessageDirection.serverToClient,L.type=new e.ProtocolRequestType(L.method)})(yn||(n.ShowMessageRequest=yn={}));var Pt;(function(L){L.method="window/logMessage",L.messageDirection=e.MessageDirection.serverToClient,L.type=new e.ProtocolNotificationType(L.method)})(Pt||(n.LogMessageNotification=Pt={}));var Se;(function(L){L.method="telemetry/event",L.messageDirection=e.MessageDirection.serverToClient,L.type=new e.ProtocolNotificationType(L.method)})(Se||(n.TelemetryEventNotification=Se={}));var Ye;(function(L){L.None=0,L.Full=1,L.Incremental=2})(Ye||(n.TextDocumentSyncKind=Ye={}));var In;(function(L){L.method="textDocument/didOpen",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolNotificationType(L.method)})(In||(n.DidOpenTextDocumentNotification=In={}));var Le;(function(L){function Jt(qe){let z=qe;return z!=null&&typeof z.text=="string"&&z.range!==void 0&&(z.rangeLength===void 0||typeof z.rangeLength=="number")}L.isIncremental=Jt;function Qt(qe){let z=qe;return z!=null&&typeof z.text=="string"&&z.range===void 0&&z.rangeLength===void 0}L.isFull=Qt})(Le||(n.TextDocumentContentChangeEvent=Le={}));var $t;(function(L){L.method="textDocument/didChange",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolNotificationType(L.method)})($t||(n.DidChangeTextDocumentNotification=$t={}));var Cn;(function(L){L.method="textDocument/didClose",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolNotificationType(L.method)})(Cn||(n.DidCloseTextDocumentNotification=Cn={}));var Yt;(function(L){L.method="textDocument/didSave",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolNotificationType(L.method)})(Yt||(n.DidSaveTextDocumentNotification=Yt={}));var at;(function(L){L.Manual=1,L.AfterDelay=2,L.FocusOut=3})(at||(n.TextDocumentSaveReason=at={}));var qn;(function(L){L.method="textDocument/willSave",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolNotificationType(L.method)})(qn||(n.WillSaveTextDocumentNotification=qn={}));var Dt;(function(L){L.method="textDocument/willSaveWaitUntil",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(Dt||(n.WillSaveTextDocumentWaitUntilRequest=Dt={}));var ct;(function(L){L.method="workspace/didChangeWatchedFiles",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolNotificationType(L.method)})(ct||(n.DidChangeWatchedFilesNotification=ct={}));var hr;(function(L){L.Created=1,L.Changed=2,L.Deleted=3})(hr||(n.FileChangeType=hr={}));var ls;(function(L){function Jt(Qt){const qe=Qt;return r.objectLiteral(qe)&&(t.URI.is(qe.baseUri)||t.WorkspaceFolder.is(qe.baseUri))&&r.string(qe.pattern)}L.is=Jt})(ls||(n.RelativePattern=ls={}));var ka;(function(L){L.Create=1,L.Change=2,L.Delete=4})(ka||(n.WatchKind=ka={}));var Xr;(function(L){L.method="textDocument/publishDiagnostics",L.messageDirection=e.MessageDirection.serverToClient,L.type=new e.ProtocolNotificationType(L.method)})(Xr||(n.PublishDiagnosticsNotification=Xr={}));var Fs;(function(L){L.Invoked=1,L.TriggerCharacter=2,L.TriggerForIncompleteCompletions=3})(Fs||(n.CompletionTriggerKind=Fs={}));var dr;(function(L){L.method="textDocument/completion",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(dr||(n.CompletionRequest=dr={}));var En;(function(L){L.method="completionItem/resolve",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(En||(n.CompletionResolveRequest=En={}));var Tt;(function(L){L.method="textDocument/hover",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(Tt||(n.HoverRequest=Tt={}));var cs;(function(L){L.Invoked=1,L.TriggerCharacter=2,L.ContentChange=3})(cs||(n.SignatureHelpTriggerKind=cs={}));var fs;(function(L){L.method="textDocument/signatureHelp",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(fs||(n.SignatureHelpRequest=fs={}));var Tr;(function(L){L.method="textDocument/definition",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(Tr||(n.DefinitionRequest=Tr={}));var Oi;(function(L){L.method="textDocument/references",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(Oi||(n.ReferencesRequest=Oi={}));var hs;(function(L){L.method="textDocument/documentHighlight",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(hs||(n.DocumentHighlightRequest=hs={}));var mi;(function(L){L.method="textDocument/documentSymbol",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(mi||(n.DocumentSymbolRequest=mi={}));var ds;(function(L){L.method="textDocument/codeAction",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(ds||(n.CodeActionRequest=ds={}));var Ns;(function(L){L.method="codeAction/resolve",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(Ns||(n.CodeActionResolveRequest=Ns={}));var Do;(function(L){L.method="workspace/symbol",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(Do||(n.WorkspaceSymbolRequest=Do={}));var xa;(function(L){L.method="workspaceSymbol/resolve",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(xa||(n.WorkspaceSymbolResolveRequest=xa={}));var To;(function(L){L.method="textDocument/codeLens",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(To||(n.CodeLensRequest=To={}));var pr;(function(L){L.method="codeLens/resolve",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(pr||(n.CodeLensResolveRequest=pr={}));var Bs;(function(L){L.method="workspace/codeLens/refresh",L.messageDirection=e.MessageDirection.serverToClient,L.type=new e.ProtocolRequestType0(L.method)})(Bs||(n.CodeLensRefreshRequest=Bs={}));var ps;(function(L){L.method="textDocument/documentLink",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(ps||(n.DocumentLinkRequest=ps={}));var gs;(function(L){L.method="documentLink/resolve",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(gs||(n.DocumentLinkResolveRequest=gs={}));var Io;(function(L){L.method="textDocument/formatting",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(Io||(n.DocumentFormattingRequest=Io={}));var ms;(function(L){L.method="textDocument/rangeFormatting",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(ms||(n.DocumentRangeFormattingRequest=ms={}));var Mo;(function(L){L.method="textDocument/rangesFormatting",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(Mo||(n.DocumentRangesFormattingRequest=Mo={}));var Ir;(function(L){L.method="textDocument/onTypeFormatting",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(Ir||(n.DocumentOnTypeFormattingRequest=Ir={}));var Yr;(function(L){L.Identifier=1})(Yr||(n.PrepareSupportDefaultBehavior=Yr={}));var Oo;(function(L){L.method="textDocument/rename",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(Oo||(n.RenameRequest=Oo={}));var Pi;(function(L){L.method="textDocument/prepareRename",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(Pi||(n.PrepareRenameRequest=Pi={}));var Li;(function(L){L.method="workspace/executeCommand",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(Li||(n.ExecuteCommandRequest=Li={}));var ys;(function(L){L.method="workspace/applyEdit",L.messageDirection=e.MessageDirection.serverToClient,L.type=new e.ProtocolRequestType("workspace/applyEdit")})(ys||(n.ApplyWorkspaceEditRequest=ys={}))}(bb)),bb}var Ph={},vR;function vK(){if(vR)return Ph;vR=1,Object.defineProperty(Ph,"__esModule",{value:!0}),Ph.createProtocolConnection=void 0;const n=rf();function e(t,r,i,s){return n.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,n.createMessageConnection)(t,r,i,s)}return Ph.createProtocolConnection=e,Ph}var bR;function bK(){return bR||(bR=1,function(n){var e=qu&&qu.__createBinding||(Object.create?function(s,o,a,u){u===void 0&&(u=a);var l=Object.getOwnPropertyDescriptor(o,a);(!l||("get"in l?!o.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(s,u,l)}:function(s,o,a,u){u===void 0&&(u=a),s[u]=o[a]}),t=qu&&qu.__exportStar||function(s,o){for(var a in s)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,s,a)};Object.defineProperty(n,"__esModule",{value:!0}),n.LSPErrorCodes=n.createProtocolConnection=void 0,t(rf(),n),t(Hk,n),t(dn(),n),t(yK(),n);var r=vK();Object.defineProperty(n,"createProtocolConnection",{enumerable:!0,get:function(){return r.createProtocolConnection}});var i;(function(s){s.lspReservedErrorRangeStart=-32899,s.RequestFailed=-32803,s.ServerCancelled=-32802,s.ContentModified=-32801,s.RequestCancelled=-32800,s.lspReservedErrorRangeEnd=-32800})(i||(n.LSPErrorCodes=i={}))}(qu)),qu}var wR;function wK(){return wR||(wR=1,function(n){var e=Pu&&Pu.__createBinding||(Object.create?function(s,o,a,u){u===void 0&&(u=a);var l=Object.getOwnPropertyDescriptor(o,a);(!l||("get"in l?!o.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(s,u,l)}:function(s,o,a,u){u===void 0&&(u=a),s[u]=o[a]}),t=Pu&&Pu.__exportStar||function(s,o){for(var a in s)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,s,a)};Object.defineProperty(n,"__esModule",{value:!0}),n.createProtocolConnection=void 0;const r=VA();t(VA(),n),t(bK(),n);function i(s,o,a,u){return(0,r.createMessageConnection)(s,o,a,u)}n.createProtocolConnection=i}(Pu)),Pu}var ra=wK();function Gk(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let xl=Gk();function pP(n){xl=n}const dd={exec:()=>null};function Et(n,e=""){let t=typeof n=="string"?n:n.source;const r={replace:(i,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace($r.caret,"$1"),t=t.replace(i,o),r},getRegex:()=>new RegExp(t,e)};return r}const $r={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},_K=/^(?:[ \t]*(?:\n|$))+/,kK=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,xK=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,dp=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,SK=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Kk=/(?:[*+-]|\d{1,9}[.)])/,gP=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,mP=Et(gP).replace(/bull/g,Kk).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),CK=Et(gP).replace(/bull/g,Kk).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Zk=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,EK=/^[^\n]+/,Xk=/(?!\s*\])(?:\\.|[^\[\]\\])+/,AK=Et(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Xk).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),RK=Et(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Kk).getRegex(),Y1="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Yk=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,DK=Et("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Yk).replace("tag",Y1).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),yP=Et(Zk).replace("hr",dp).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Y1).getRegex(),TK=Et(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",yP).getRegex(),Jk={blockquote:TK,code:kK,def:AK,fences:xK,heading:SK,hr:dp,html:DK,lheading:mP,list:RK,newline:_K,paragraph:yP,table:dd,text:EK},_R=Et("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",dp).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Y1).getRegex(),IK={...Jk,lheading:CK,table:_R,paragraph:Et(Zk).replace("hr",dp).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",_R).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Y1).getRegex()},MK={...Jk,html:Et(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Yk).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:dd,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Et(Zk).replace("hr",dp).replace("heading",` *#{1,6} *[^
|
|
80
|
-
]`).replace("lheading",mP).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},OK=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,PK=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,vP=/^( {2,}|\\)\n(?!\s*$)/,LK=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,J1=/[\p{P}\p{S}]/u,Qk=/[\s\p{P}\p{S}]/u,bP=/[^\s\p{P}\p{S}]/u,FK=Et(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Qk).getRegex(),wP=/(?!~)[\p{P}\p{S}]/u,NK=/(?!~)[\s\p{P}\p{S}]/u,BK=/(?:[^\s\p{P}\p{S}]|~)/u,qK=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,_P=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,WK=Et(_P,"u").replace(/punct/g,J1).getRegex(),jK=Et(_P,"u").replace(/punct/g,wP).getRegex(),kP="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",$K=Et(kP,"gu").replace(/notPunctSpace/g,bP).replace(/punctSpace/g,Qk).replace(/punct/g,J1).getRegex(),zK=Et(kP,"gu").replace(/notPunctSpace/g,BK).replace(/punctSpace/g,NK).replace(/punct/g,wP).getRegex(),UK=Et("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,bP).replace(/punctSpace/g,Qk).replace(/punct/g,J1).getRegex(),HK=Et(/\\(punct)/,"gu").replace(/punct/g,J1).getRegex(),VK=Et(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),GK=Et(Yk).replace("(?:-->|$)","-->").getRegex(),KK=Et("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",GK).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),u1=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ZK=Et(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",u1).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),xP=Et(/^!?\[(label)\]\[(ref)\]/).replace("label",u1).replace("ref",Xk).getRegex(),SP=Et(/^!?\[(ref)\](?:\[\])?/).replace("ref",Xk).getRegex(),XK=Et("reflink|nolink(?!\\()","g").replace("reflink",xP).replace("nolink",SP).getRegex(),ex={_backpedal:dd,anyPunctuation:HK,autolink:VK,blockSkip:qK,br:vP,code:PK,del:dd,emStrongLDelim:WK,emStrongRDelimAst:$K,emStrongRDelimUnd:UK,escape:OK,link:ZK,nolink:SP,punctuation:FK,reflink:xP,reflinkSearch:XK,tag:KK,text:LK,url:dd},YK={...ex,link:Et(/^!?\[(label)\]\((.*?)\)/).replace("label",u1).getRegex(),reflink:Et(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",u1).getRegex()},h2={...ex,emStrongRDelimAst:zK,emStrongLDelim:jK,url:Et(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},JK={...h2,br:Et(vP).replace("{2,}","*").getRegex(),text:Et(h2.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},u0={normal:Jk,gfm:IK,pedantic:MK},Lh={normal:ex,gfm:h2,breaks:JK,pedantic:YK},QK={"&":"&","<":"<",">":">",'"':""","'":"'"},kR=n=>QK[n];function Js(n,e){if(e){if($r.escapeTest.test(n))return n.replace($r.escapeReplace,kR)}else if($r.escapeTestNoEncode.test(n))return n.replace($r.escapeReplaceNoEncode,kR);return n}function xR(n){try{n=encodeURI(n).replace($r.percentDecode,"%")}catch{return null}return n}function SR(n,e){const t=n.replace($r.findPipe,(s,o,a)=>{let u=!1,l=o;for(;--l>=0&&a[l]==="\\";)u=!u;return u?"|":" |"}),r=t.split($r.splitPipe);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace($r.slashPipe,"|");return r}function Fh(n,e,t){const r=n.length;if(r===0)return"";let i=0;for(;i<r&&n.charAt(r-i-1)===e;)i++;return n.slice(0,r-i)}function eZ(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let r=0;r<n.length;r++)if(n[r]==="\\")r++;else if(n[r]===e[0])t++;else if(n[r]===e[1]&&(t--,t<0))return r;return t>0?-2:-1}function CR(n,e,t,r,i){const s=e.href,o=e.title||null,a=n[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;const u={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:s,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,u}function tZ(n,e,t){const r=n.match(t.other.indentCodeCompensation);if(r===null)return e;const i=r[1];return e.split(`
|
|
81
|
-
`).map(s=>{const o=s.match(t.other.beginningSpace);if(o===null)return s;const[a]=o;return a.length>=i.length?s.slice(i.length):s}).join(`
|
|
82
|
-
`)}class l1{options;rules;lexer;constructor(e){this.options=e||xl}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const r=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Fh(r,`
|
|
83
|
-
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const r=t[0],i=tZ(r,t[3]||"",this.rules);return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(this.rules.other.endingHash.test(r)){const i=Fh(r,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(r=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Fh(t[0],`
|
|
84
|
-
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let r=Fh(t[0],`
|
|
85
|
-
`).split(`
|
|
86
|
-
`),i="",s="";const o=[];for(;r.length>0;){let a=!1;const u=[];let l;for(l=0;l<r.length;l++)if(this.rules.other.blockquoteStart.test(r[l]))u.push(r[l]),a=!0;else if(!a)u.push(r[l]);else break;r=r.slice(l);const c=u.join(`
|
|
87
|
-
`),f=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
88
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
|
|
89
|
-
${c}`:c,s=s?`${s}
|
|
90
|
-
${f}`:f;const d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,o,!0),this.lexer.state.top=d,r.length===0)break;const g=o.at(-1);if(g?.type==="code")break;if(g?.type==="blockquote"){const m=g,y=m.raw+`
|
|
91
|
-
`+r.join(`
|
|
92
|
-
`),b=this.blockquote(y);o[o.length-1]=b,i=i.substring(0,i.length-m.raw.length)+b.raw,s=s.substring(0,s.length-m.text.length)+b.text;break}else if(g?.type==="list"){const m=g,y=m.raw+`
|
|
93
|
-
`+r.join(`
|
|
94
|
-
`),b=this.list(y);o[o.length-1]=b,i=i.substring(0,i.length-g.raw.length)+b.raw,s=s.substring(0,s.length-m.raw.length)+b.raw,r=y.substring(o.at(-1).raw.length).split(`
|
|
95
|
-
`);continue}}return{type:"blockquote",raw:i,tokens:o,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim();const i=r.length>1,s={type:"list",raw:"",ordered:i,start:i?+r.slice(0,-1):"",loose:!1,items:[]};r=i?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=i?r:"[*+-]");const o=this.rules.other.listItemRegex(r);let a=!1;for(;e;){let l=!1,c="",f="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let d=t[2].split(`
|
|
96
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,x=>" ".repeat(3*x.length)),g=e.split(`
|
|
97
|
-
`,1)[0],m=!d.trim(),y=0;if(this.options.pedantic?(y=2,f=d.trimStart()):m?y=t[1].length+1:(y=t[2].search(this.rules.other.nonSpaceChar),y=y>4?1:y,f=d.slice(y),y+=t[1].length),m&&this.rules.other.blankLine.test(g)&&(c+=g+`
|
|
98
|
-
`,e=e.substring(g.length+1),l=!0),!l){const x=this.rules.other.nextBulletRegex(y),_=this.rules.other.hrRegex(y),S=this.rules.other.fencesBeginRegex(y),C=this.rules.other.headingBeginRegex(y),A=this.rules.other.htmlBeginRegex(y);for(;e;){const I=e.split(`
|
|
99
|
-
`,1)[0];let W;if(g=I,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),W=g):W=g.replace(this.rules.other.tabCharGlobal," "),S.test(g)||C.test(g)||A.test(g)||x.test(g)||_.test(g))break;if(W.search(this.rules.other.nonSpaceChar)>=y||!g.trim())f+=`
|
|
100
|
-
`+W.slice(y);else{if(m||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(d)||C.test(d)||_.test(d))break;f+=`
|
|
101
|
-
`+g}!m&&!g.trim()&&(m=!0),c+=I+`
|
|
102
|
-
`,e=e.substring(I.length+1),d=W.slice(y)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(a=!0));let b=null,w;this.options.gfm&&(b=this.rules.other.listIsTask.exec(f),b&&(w=b[0]!=="[ ] ",f=f.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:c,task:!!b,checked:w,loose:!1,text:f,tokens:[]}),s.raw+=c}const u=s.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let l=0;l<s.items.length;l++)if(this.lexer.state.top=!1,s.items[l].tokens=this.lexer.blockTokens(s.items[l].text,[]),!s.loose){const c=s.items[l].tokens.filter(d=>d.type==="space"),f=c.length>0&&c.some(d=>this.rules.other.anyLine.test(d.raw));s.loose=f}if(s.loose)for(let l=0;l<s.items.length;l++)s.items[l].loose=!0;return s}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const r=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:i,title:s}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const r=SR(t[1]),i=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
103
|
-
`):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===i.length){for(const a of i)this.rules.other.tableAlignRight.test(a)?o.align.push("right"):this.rules.other.tableAlignCenter.test(a)?o.align.push("center"):this.rules.other.tableAlignLeft.test(a)?o.align.push("left"):o.align.push(null);for(let a=0;a<r.length;a++)o.header.push({text:r[a],tokens:this.lexer.inline(r[a]),header:!0,align:o.align[a]});for(const a of s)o.rows.push(SR(a,o.header.length).map((u,l)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:o.align[l]})));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const r=t[1].charAt(t[1].length-1)===`
|
|
104
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;const o=Fh(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{const o=eZ(t[2],"()");if(o===-2)return;if(o>-1){const u=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,u).trim(),t[3]=""}}let i=t[2],s="";if(this.options.pedantic){const o=this.rules.other.pedanticHrefTitle.exec(i);o&&(i=o[1],s=o[3])}else s=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i=i.slice(1):i=i.slice(1,-1)),CR(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){const i=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[i.toLowerCase()];if(!s){const o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return CR(r,s,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!i||i[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(i[1]||i[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const o=[...i[0]].length-1;let a,u,l=o,c=0;const f=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,t=t.slice(-1*e.length+o);(i=f.exec(t))!=null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(u=[...a].length,i[3]||i[4]){l+=u;continue}else if((i[5]||i[6])&&o%3&&!((o+u)%3)){c+=u;continue}if(l-=u,l>0)continue;u=Math.min(u,u+l+c);const d=[...i[0]][0].length,g=e.slice(0,o+i.index+d+u);if(Math.min(o,u)%2){const y=g.slice(1,-1);return{type:"em",raw:g,text:y,tokens:this.lexer.inlineTokens(y)}}const m=g.slice(2,-2);return{type:"strong",raw:g,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(this.rules.other.newLineCharGlobal," ");const i=this.rules.other.nonSpaceChar.test(r),s=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return i&&s&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:t[0],text:r}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let r,i;return t[2]==="@"?(r=t[1],i="mailto:"+r):(r=t[1],i=r),{type:"link",raw:t[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let r,i;if(t[2]==="@")r=t[0],i="mailto:"+r;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);r=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const r=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:r}}}}class Qi{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||xl,this.options.tokenizer=this.options.tokenizer||new l1,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:$r,block:u0.normal,inline:Lh.normal};this.options.pedantic?(t.block=u0.pedantic,t.inline=Lh.pedantic):this.options.gfm&&(t.block=u0.gfm,this.options.breaks?t.inline=Lh.breaks:t.inline=Lh.gfm),this.tokenizer.rules=t}static get rules(){return{block:u0,inline:Lh}}static lex(e,t){return new Qi(t).lex(e)}static lexInline(e,t){return new Qi(t).inlineTokens(e)}lex(e){e=e.replace($r.carriageReturn,`
|
|
105
|
-
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const r=this.inlineQueue[t];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){for(this.options.pedantic&&(e=e.replace($r.tabCharGlobal," ").replace($r.spaceLine,""));e;){let i;if(this.options.extensions?.block?.some(o=>(i=o.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);const o=t.at(-1);i.raw.length===1&&o!==void 0?o.raw+=`
|
|
106
|
-
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);const o=t.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
|
|
107
|
-
`+i.raw,o.text+=`
|
|
108
|
-
`+i.text,this.inlineQueue.at(-1).src=o.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);const o=t.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
|
|
109
|
-
`+i.raw,o.text+=`
|
|
110
|
-
`+i.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let s=e;if(this.options.extensions?.startBlock){let o=1/0;const a=e.slice(1);let u;this.options.extensions.startBlock.forEach(l=>{u=l.call({lexer:this},a),typeof u=="number"&&u>=0&&(o=Math.min(o,u))}),o<1/0&&o>=0&&(s=e.substring(0,o+1))}if(this.state.top&&(i=this.tokenizer.paragraph(s))){const o=t.at(-1);r&&o?.type==="paragraph"?(o.raw+=`
|
|
111
|
-
`+i.raw,o.text+=`
|
|
112
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(i),r=s.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);const o=t.at(-1);o?.type==="text"?(o.raw+=`
|
|
113
|
-
`+i.raw,o.text+=`
|
|
114
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(i);continue}if(e){const o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r=e,i=null;if(this.tokens.links){const a=Object.keys(this.tokens.links);if(a.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)a.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,o="";for(;e;){s||(o=""),s=!1;let a;if(this.options.extensions?.inline?.some(l=>(a=l.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);const l=t.at(-1);a.type==="text"&&l?.type==="text"?(l.raw+=a.raw,l.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,r,o)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let u=e;if(this.options.extensions?.startInline){let l=1/0;const c=e.slice(1);let f;this.options.extensions.startInline.forEach(d=>{f=d.call({lexer:this},c),typeof f=="number"&&f>=0&&(l=Math.min(l,f))}),l<1/0&&l>=0&&(u=e.substring(0,l+1))}if(a=this.tokenizer.inlineText(u)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(o=a.raw.slice(-1)),s=!0;const l=t.at(-1);l?.type==="text"?(l.raw+=a.raw,l.text+=a.text):t.push(a);continue}if(e){const l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return t}}class c1{options;parser;constructor(e){this.options=e||xl}space(e){return""}code({text:e,lang:t,escaped:r}){const i=(t||"").match($r.notSpaceStart)?.[0],s=e.replace($r.endingNewline,"")+`
|
|
115
|
-
`;return i?'<pre><code class="language-'+Js(i)+'">'+(r?s:Js(s,!0))+`</code></pre>
|
|
116
|
-
`:"<pre><code>"+(r?s:Js(s,!0))+`</code></pre>
|
|
117
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
118
|
-
${this.parser.parse(e)}</blockquote>
|
|
119
|
-
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
120
|
-
`}hr(e){return`<hr>
|
|
121
|
-
`}list(e){const t=e.ordered,r=e.start;let i="";for(let a=0;a<e.items.length;a++){const u=e.items[a];i+=this.listitem(u)}const s=t?"ol":"ul",o=t&&r!==1?' start="'+r+'"':"";return"<"+s+o+`>
|
|
122
|
-
`+i+"</"+s+`>
|
|
123
|
-
`}listitem(e){let t="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+Js(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
|
124
|
-
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
125
|
-
`}table(e){let t="",r="";for(let s=0;s<e.header.length;s++)r+=this.tablecell(e.header[s]);t+=this.tablerow({text:r});let i="";for(let s=0;s<e.rows.length;s++){const o=e.rows[s];r="";for(let a=0;a<o.length;a++)r+=this.tablecell(o[a]);i+=this.tablerow({text:r})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
|
|
126
|
-
<thead>
|
|
127
|
-
`+t+`</thead>
|
|
128
|
-
`+i+`</table>
|
|
129
|
-
`}tablerow({text:e}){return`<tr>
|
|
130
|
-
${e}</tr>
|
|
131
|
-
`}tablecell(e){const t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
|
|
132
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Js(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){const i=this.parser.parseInline(r),s=xR(e);if(s===null)return i;e=s;let o='<a href="'+e+'"';return t&&(o+=' title="'+Js(t)+'"'),o+=">"+i+"</a>",o}image({href:e,title:t,text:r,tokens:i}){i&&(r=this.parser.parseInline(i,this.parser.textRenderer));const s=xR(e);if(s===null)return Js(r);e=s;let o=`<img src="${e}" alt="${r}"`;return t&&(o+=` title="${Js(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Js(e.text)}}class tx{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class es{options;renderer;textRenderer;constructor(e){this.options=e||xl,this.options.renderer=this.options.renderer||new c1,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new tx}static parse(e,t){return new es(t).parse(e)}static parseInline(e,t){return new es(t).parseInline(e)}parse(e,t=!0){let r="";for(let i=0;i<e.length;i++){const s=e[i];if(this.options.extensions?.renderers?.[s.type]){const a=s,u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){r+=u||"";continue}}const o=s;switch(o.type){case"space":{r+=this.renderer.space(o);continue}case"hr":{r+=this.renderer.hr(o);continue}case"heading":{r+=this.renderer.heading(o);continue}case"code":{r+=this.renderer.code(o);continue}case"table":{r+=this.renderer.table(o);continue}case"blockquote":{r+=this.renderer.blockquote(o);continue}case"list":{r+=this.renderer.list(o);continue}case"html":{r+=this.renderer.html(o);continue}case"paragraph":{r+=this.renderer.paragraph(o);continue}case"text":{let a=o,u=this.renderer.text(a);for(;i+1<e.length&&e[i+1].type==="text";)a=e[++i],u+=`
|
|
133
|
-
`+this.renderer.text(a);t?r+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):r+=u;continue}default:{const a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}parseInline(e,t=this.renderer){let r="";for(let i=0;i<e.length;i++){const s=e[i];if(this.options.extensions?.renderers?.[s.type]){const a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=a||"";continue}}const o=s;switch(o.type){case"escape":{r+=t.text(o);break}case"html":{r+=t.html(o);break}case"link":{r+=t.link(o);break}case"image":{r+=t.image(o);break}case"strong":{r+=t.strong(o);break}case"em":{r+=t.em(o);break}case"codespan":{r+=t.codespan(o);break}case"br":{r+=t.br(o);break}case"del":{r+=t.del(o);break}case"text":{r+=t.text(o);break}default:{const a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}}class _m{options;block;constructor(e){this.options=e||xl}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Qi.lex:Qi.lexInline}provideParser(){return this.block?es.parse:es.parseInline}}class nZ{defaults=Gk();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=es;Renderer=c1;TextRenderer=tx;Lexer=Qi;Tokenizer=l1;Hooks=_m;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(const i of e)switch(r=r.concat(t.call(this,i)),i.type){case"table":{const s=i;for(const o of s.header)r=r.concat(this.walkTokens(o.tokens,t));for(const o of s.rows)for(const a of o)r=r.concat(this.walkTokens(a.tokens,t));break}case"list":{const s=i;r=r.concat(this.walkTokens(s.items,t));break}default:{const s=i;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(o=>{const a=s[o].flat(1/0);r=r.concat(this.walkTokens(a,t))}):s.tokens&&(r=r.concat(this.walkTokens(s.tokens,t)))}}return r}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{const i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const o=t.renderers[s.name];o?t.renderers[s.name]=function(...a){let u=s.renderer.apply(this,a);return u===!1&&(u=o.apply(this,a)),u}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=t[s.level];o?o.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),i.extensions=t),r.renderer){const s=this.defaults.renderer||new c1(this.defaults);for(const o in r.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;const a=o,u=r.renderer[a],l=s[a];s[a]=(...c)=>{let f=u.apply(s,c);return f===!1&&(f=l.apply(s,c)),f||""}}i.renderer=s}if(r.tokenizer){const s=this.defaults.tokenizer||new l1(this.defaults);for(const o in r.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;const a=o,u=r.tokenizer[a],l=s[a];s[a]=(...c)=>{let f=u.apply(s,c);return f===!1&&(f=l.apply(s,c)),f}}i.tokenizer=s}if(r.hooks){const s=this.defaults.hooks||new _m;for(const o in r.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;const a=o,u=r.hooks[a],l=s[a];_m.passThroughHooks.has(o)?s[a]=c=>{if(this.defaults.async)return Promise.resolve(u.call(s,c)).then(d=>l.call(s,d));const f=u.call(s,c);return l.call(s,f)}:s[a]=(...c)=>{let f=u.apply(s,c);return f===!1&&(f=l.apply(s,c)),f}}i.hooks=s}if(r.walkTokens){const s=this.defaults.walkTokens,o=r.walkTokens;i.walkTokens=function(a){let u=[];return u.push(o.call(this,a)),s&&(u=u.concat(s.call(this,a))),u}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Qi.lex(e,t??this.defaults)}parser(e,t){return es.parse(e,t??this.defaults)}parseMarkdown(e){return(r,i)=>{const s={...i},o={...this.defaults,...s},a=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&s.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const u=o.hooks?o.hooks.provideLexer():e?Qi.lex:Qi.lexInline,l=o.hooks?o.hooks.provideParser():e?es.parse:es.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(r):r).then(c=>u(c,o)).then(c=>o.hooks?o.hooks.processAllTokens(c):c).then(c=>o.walkTokens?Promise.all(this.walkTokens(c,o.walkTokens)).then(()=>c):c).then(c=>l(c,o)).then(c=>o.hooks?o.hooks.postprocess(c):c).catch(a);try{o.hooks&&(r=o.hooks.preprocess(r));let c=u(r,o);o.hooks&&(c=o.hooks.processAllTokens(c)),o.walkTokens&&this.walkTokens(c,o.walkTokens);let f=l(c,o);return o.hooks&&(f=o.hooks.postprocess(f)),f}catch(c){return a(c)}}}onError(e,t){return r=>{if(r.message+=`
|
|
134
|
-
Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+Js(r.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(r);throw r}}}const yl=new nZ;function Ct(n,e){return yl.parse(n,e)}Ct.options=Ct.setOptions=function(n){return yl.setOptions(n),Ct.defaults=yl.defaults,pP(Ct.defaults),Ct};Ct.getDefaults=Gk;Ct.defaults=xl;Ct.use=function(...n){return yl.use(...n),Ct.defaults=yl.defaults,pP(Ct.defaults),Ct};Ct.walkTokens=function(n,e){return yl.walkTokens(n,e)};Ct.parseInline=yl.parseInline;Ct.Parser=es;Ct.parser=es.parse;Ct.Renderer=c1;Ct.TextRenderer=tx;Ct.Lexer=Qi;Ct.lexer=Qi.lex;Ct.Tokenizer=l1;Ct.Hooks=_m;Ct.parse=Ct;Ct.options;Ct.setOptions;Ct.use;Ct.walkTokens;Ct.parseInline;es.parse;Qi.lex;function zn(n,e){if(e.line>=n.lines)return e.character===0?n.length:void 0;const t=n.line(e.line+1).from+e.character;if(!(t>n.length))return t}function As(n,e){return zn(n,e)||0}function Ua(n,e){const t=n.lineAt(e);return{character:e-t.from,line:t.number-1}}const f1=new Ct.Renderer,rZ=f1.code;f1.code=n=>n.text.trim()?rZ.call(f1,n):"";function CP(n){return Ct(n,{async:!1,gfm:!0,breaks:!0,renderer:f1})}function Rs(n,e=CP){if(!n)return"";if(aZ(n)){let t=n.value;return n.kind==="markdown"&&(t=e(t.trim())),t}return Array.isArray(n)?n.map(t=>Rs(t,e)).filter(Boolean).join(`
|
|
135
|
-
|
|
136
|
-
`):typeof n=="string"?n:""}function iZ(n){if(n.length===0)return"";if(n.length===1)return n[0]||"";n.sort();const e=n[0]||"",t=n[n.length-1]||"";let r=0;for(;r<e.length&&e[r]===t[r];)r++;return e.substring(0,r)}function sZ(n){if(n.length===0)return;const e=n.map(o=>o.textEdit?.newText||o.label),t=iZ(e);if(t==="")return;const r=[];for(let o=0;o<t.length;o++){const a=t.slice(0,o+1);if(a.length>0){const u=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");r.push(u)}}const i=r.join("|");return new RegExp(`(${i})$`)}function oZ(n){return n?.range!==void 0}function aZ(n){return n.kind!==void 0}function Ei(n,e){const t=document.createElement("div");t.className="cm-error-message",t.style.cssText=`
|
|
137
|
-
position: absolute;
|
|
138
|
-
padding: 8px;
|
|
139
|
-
background: #fee;
|
|
140
|
-
border: 1px solid #fcc;
|
|
141
|
-
border-radius: 4px;
|
|
142
|
-
color: #c00;
|
|
143
|
-
font-size: 14px;
|
|
144
|
-
z-index: 100;
|
|
145
|
-
max-width: 300px;
|
|
146
|
-
box-shadow: 0 2px 8px rgba(0,0,0,.15);
|
|
147
|
-
`,t.textContent=e;const r=n.coordsAtPos(n.state.selection.main.head);r&&(t.style.left=`${r.left}px`,t.style.top=`${r.bottom+5}px`),document.body.appendChild(t),setTimeout(()=>{t.style.opacity="0",t.style.transition="opacity 0.2s",setTimeout(()=>t.remove(),200)},3e3)}function h1(n){if(n==null)return!0;if(Array.isArray(n))return n.length===0||n.every(h1);if(typeof n=="string")return ER(n);const e=n.value;return typeof e=="string"?ER(e):!1}function ER(n){return n==null?!0:typeof n=="string"?n.trim()===""||/^[\s\n`]*$/.test(n):!1}function uZ(n,e){const t=[];return e.iterChanges((r,i,s,o,a)=>{const u=a.toString();if(r===0&&i===n.length){t.push({text:u});return}const l=Ua(n,r),c=Ua(n,i);t.push({range:{start:l,end:c},text:u})}),t.sort((r,i)=>{if(!r.range)return 1;if(!i.range)return-1;const s=r.range.start.line??-1,o=i.range.start.line??-1;if(s!==o)return o-s;const a=r.range.start.character??-1;return(i.range.start.character??-1)-a}),t}const lZ=Object.fromEntries(Object.entries(ra.CompletionItemKind).map(([n,e])=>[e,n]));var d2;(function(n){n.PlainText=1,n.Snippet=2})(d2||(d2={}));function cZ(n){return n.replaceAll(/\\\\/g,"").replaceAll(/(\$(\d+))/g,(t,r,i)=>"${"+i+"}")}function fZ(n,e){const{detail:t,labelDetails:r,label:i,kind:s,textEdit:o,insertText:a,documentation:u,additionalTextEdits:l,insertTextFormat:c}=n,f={label:i,detail:r?.detail||t,apply(d,g,m,y){if(o&&oZ(o)?d.dispatch(u_(d.state,o.newText,As(d.state.doc,o.range.start),As(d.state.doc,o.range.end))):a&&c===d2.Snippet&&e.useSnippetOnCompletion?WO(cZ(a))(d,null,m,y):d.dispatch(u_(d.state,i,m,y)),!l)return;const b=l.sort(({range:{end:w}},{range:{end:x}})=>As(d.state.doc,w)<As(d.state.doc,x)?1:As(d.state.doc,w)>As(d.state.doc,x)?-1:0);for(const w of b)d.dispatch(d.state.update({changes:{from:As(d.state.doc,w.range.start),to:zn(d.state.doc,w.range.end),insert:w.newText}}))},type:s&&lZ[s].toLowerCase()};return e.hasResolveProvider&&e.resolveItem?f.info=async()=>{try{const d=await e.resolveItem?.(n),g=document.createElement("div");g.classList.add("documentation");const m=d?.documentation||u;return!m||h1(m)?null:(e.allowHTMLContent?g.innerHTML=Rs(m,e.markdownRenderer):g.textContent=Rs(m,e.markdownRenderer),g)}catch(d){if(console.error("Failed to resolve completion item:",d),h1(u))return null;if(u){const g=document.createElement("div");return g.classList.add("documentation"),e.allowHTMLContent?g.innerHTML=Rs(u,e.markdownRenderer):g.textContent=Rs(u,e.markdownRenderer),g}return null}}:u&&(f.info=()=>{const d=document.createElement("div");return d.classList.add("documentation"),e.allowHTMLContent?d.innerHTML=Rs(u,e.markdownRenderer):d.textContent=Rs(u,e.markdownRenderer),d}),f}function hZ(n,e,t){const r=[e?dZ(e):pZ,t==="python"?gZ:void 0].filter(Boolean);let i=n;if(e){const s=e.toLowerCase();/^\w+$/.test(s)&&(i=i.filter(({label:o,filterText:a})=>(a??o).toLowerCase().startsWith(s)))}for(const s of r)i.sort(s);return i}function dZ(n){return(e,t)=>{const r=e.sortText??e.label,i=t.sortText??t.label;switch(!0){case(r.startsWith(n)&&!i.startsWith(n)):return-1;case(!r.startsWith(n)&&i.startsWith(n)):return 1}return r.localeCompare(i)}}function pZ(n,e){const t=n.sortText??n.label,r=e.sortText??e.label;return t.localeCompare(r)}function gZ(n,e){const t=n.label.endsWith("="),r=e.label.endsWith("=");return t&&!r?-1:!t&&r?1:0}function EP(n){const e=new Proxy({},{get(){throw new Error(n)}});return function(r){return r.at(-1)??e}}const AP=Re.define({combine:EP("No document URI provided. Either pass a one into the extension or use documentUri.of().")}),RP=Re.define({combine:EP("No language ID provided. Either pass a one into the extension or use languageId.of().")}),mZ=1e4;class yZ{ready;capabilities;initializePromise;rootUri;workspaceFolders;timeout;transport;requestManager;client;initializationOptions;clientCapabilities;notificationListeners=new Set;constructor({rootUri:e,workspaceFolders:t,transport:r,initializationOptions:i,capabilities:s,timeout:o=mZ,getWorkspaceConfiguration:a}){this.rootUri=e,this.workspaceFolders=t,this.transport=r,this.initializationOptions=i,this.clientCapabilities=s,this.timeout=o,this.ready=!1,this.capabilities=null,this.requestManager=new RA.RequestManager([this.transport]),this.client=new RA.Client(this.requestManager),this.client.onNotification(l=>{this.processNotification(l)});const u=this.transport;u?.connection&&u.connection.addEventListener("message",l=>{const c=JSON.parse(l.data);c.method==="workspace/configuration"&&a?u.connection.send(JSON.stringify({jsonrpc:"2.0",id:c.id,result:a(c.params)})):c.method&&c.id&&u.connection.send(JSON.stringify({jsonrpc:"2.0",id:c.id,result:null}))}),this.initializePromise=this.initialize()}getInitializationOptions(){const e={textDocument:{hover:{dynamicRegistration:!0,contentFormat:["markdown","plaintext"]},moniker:{},synchronization:{dynamicRegistration:!0,willSave:!1,didSave:!1,willSaveWaitUntil:!1},codeAction:{dynamicRegistration:!0,codeActionLiteralSupport:{codeActionKind:{valueSet:["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},resolveSupport:{properties:["edit"]}},completion:{dynamicRegistration:!0,completionItem:{snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:["markdown","plaintext"],deprecatedSupport:!1,preselectSupport:!1},contextSupport:!1},signatureHelp:{dynamicRegistration:!0,signatureInformation:{documentationFormat:["markdown","plaintext"]}},declaration:{dynamicRegistration:!0,linkSupport:!0},definition:{dynamicRegistration:!0,linkSupport:!0},typeDefinition:{dynamicRegistration:!0,linkSupport:!0},implementation:{dynamicRegistration:!0,linkSupport:!0},rename:{dynamicRegistration:!0,prepareSupport:!0}},workspace:{didChangeConfiguration:{dynamicRegistration:!0}}};return{capabilities:this.clientCapabilities?typeof this.clientCapabilities=="function"?this.clientCapabilities(e):this.clientCapabilities:e,initializationOptions:this.initializationOptions,processId:null,rootUri:this.rootUri,workspaceFolders:this.workspaceFolders}}async initialize(){const{capabilities:e}=await this.request("initialize",this.getInitializationOptions(),this.timeout*3);this.capabilities=e,this.notify("initialized",{}),this.ready=!0}close(){this.client.close()}textDocumentDidOpen(e){return this.notify("textDocument/didOpen",e)}textDocumentDidChange(e){return this.notify("textDocument/didChange",e)}async textDocumentHover(e){return await this.request("textDocument/hover",e,this.timeout)}async textDocumentCompletion(e){return await this.request("textDocument/completion",e,this.timeout)}async completionItemResolve(e){return await this.request("completionItem/resolve",e,this.timeout)}async textDocumentDefinition(e){return await this.request("textDocument/definition",e,this.timeout)}async textDocumentCodeAction(e){return await this.request("textDocument/codeAction",e,this.timeout)}async textDocumentRename(e){return await this.request("textDocument/rename",e,this.timeout)}async textDocumentPrepareRename(e){return await this.request("textDocument/prepareRename",e,this.timeout)}async textDocumentSignatureHelp(e){return await this.request("textDocument/signatureHelp",e,this.timeout)}onNotification(e){return this.notificationListeners.add(e),()=>this.notificationListeners.delete(e)}request(e,t,r){return this.client.request({method:e,params:t},r)}notify(e,t){return this.client.notify({method:e,params:t})}processNotification(e){this.notificationListeners.forEach(t=>t(e))}}const AR=console.log;function vZ(){return String(Date.now()+Math.random())}class bZ{documentVersion;pluginId;client;documentUri;languageId;view;allowHTMLContent;useSnippetOnCompletion;sendIncrementalChanges;featureOptions;onGoToDefinition;markdownRenderer;disposeListener;constructor(e){const{client:t,documentUri:r,languageId:i,view:s,featureOptions:o,sendIncrementalChanges:a=!0,allowHTMLContent:u=!1,useSnippetOnCompletion:l=!1,onGoToDefinition:c,markdownRenderer:f=CP}=e;this.documentVersion=0,this.pluginId=vZ(),this.client=t,this.documentUri=r,this.languageId=i,this.view=s,this.allowHTMLContent=u,this.useSnippetOnCompletion=l,this.sendIncrementalChanges=a,this.featureOptions=o,this.onGoToDefinition=c,this.markdownRenderer=f,this.disposeListener=t.onNotification(this.processNotification.bind(this)),this.initialize({documentText:this.view.state.doc.toString()})}update({state:e,docChanged:t,startState:{doc:r},changes:i}){t&&(this.sendIncrementalChanges?this.sendChanges(uZ(r,i)):this.sendChanges([{text:e.doc.toString()}]))}destroy(){this.disposeListener?.()}async initialize({documentText:e}){this.client.initializePromise&&await this.client.initializePromise,await this.client.textDocumentDidOpen({textDocument:{uri:this.documentUri,languageId:this.languageId,text:e,version:this.documentVersion}})}async sendChanges(e){if(this.client.ready)try{await this.client.textDocumentDidChange({textDocument:{uri:this.documentUri,version:++this.documentVersion},contentChanges:e})}catch(t){console.error(t)}}requestDiagnostics(e){this.sendChanges([{text:e.state.doc.toString()}])}async requestHoverTooltip(e,{line:t,character:r}){if(!this.featureOptions.hoverEnabled||!(this.client.ready&&this.client.capabilities?.hoverProvider))return null;const i=await this.client.textDocumentHover({textDocument:{uri:this.documentUri},position:{line:t,character:r}});if(!i)return null;const{contents:s,range:o}=i;let a=zn(e.state.doc,{line:t,character:r}),u;if(o&&(a=zn(e.state.doc,o.start),u=zn(e.state.doc,o.end)),a==null||h1(s))return null;const l=document.createElement("div");return l.classList.add("documentation","cm-lsp-hover-tooltip"),this.allowHTMLContent?l.innerHTML=Rs(s,this.markdownRenderer):l.textContent=Rs(s,this.markdownRenderer),{pos:a,end:u,create:c=>({dom:l}),above:!0}}async requestCompletion(e,{line:t,character:r},{triggerKind:i,triggerCharacter:s}){if(!this.featureOptions.completionEnabled||!(this.client.ready&&this.client.capabilities?.completionProvider))return null;const o=await this.client.textDocumentCompletion({textDocument:{uri:this.documentUri},position:{line:t,character:r},context:{triggerKind:i,triggerCharacter:s}});if(!o)return null;const a="items"in o?o.items:o,u=sZ(a),l=u?e.matchBefore(u):e.matchBefore(/[a-zA-Z0-9]+/);let{pos:c}=e;const f=hZ(a,l?.text,this.languageId);l&&(c=l.from);const d=f.map(g=>fZ(g,{allowHTMLContent:this.allowHTMLContent,useSnippetOnCompletion:this.useSnippetOnCompletion,hasResolveProvider:this.client.capabilities?.completionProvider?.resolveProvider??!1,resolveItem:this.client.completionItemResolve.bind(this.client)}));return{from:c,options:d,filter:!1}}async requestDefinition(e,{line:t,character:r}){if(!this.featureOptions.definitionEnabled||!(this.client.ready&&this.client.capabilities?.definitionProvider))return;const i=await this.client.textDocumentDefinition({textDocument:{uri:this.documentUri},position:{line:t,character:r}});if(!i)return;const s=Array.isArray(i)?i:[i];if(s.length===0)return;const o=s[0];if(!o)return;const a="uri"in o?o.uri:o.targetUri,u="range"in o?o.range:o.targetRange,l=a!==this.documentUri,c={uri:a,range:u,isExternalDocument:l};return l||e.dispatch(e.state.update({selection:{anchor:As(e.state.doc,u.start),head:zn(e.state.doc,u.end)}})),this.onGoToDefinition&&this.onGoToDefinition(c),c}processNotification(e){try{switch(e.method){case"textDocument/publishDiagnostics":this.processDiagnostics(e.params)}}catch(t){AR(t)}}lastSeenDiagnosticsVersion=0;async processDiagnostics(e){if(e.uri!==this.documentUri)return;if(e.version!=null&&e.version>this.lastSeenDiagnosticsVersion&&(this.lastSeenDiagnosticsVersion=e.version,this.clearDiagnostics()),!this.featureOptions.diagnosticsEnabled){this.clearDiagnostics();return}const r={[ra.DiagnosticSeverity.Error]:"error",[ra.DiagnosticSeverity.Warning]:"warning",[ra.DiagnosticSeverity.Information]:"info",[ra.DiagnosticSeverity.Hint]:"info"},i=e.diagnostics.map(async({range:o,message:a,severity:u,code:l,source:c})=>{const d=(await this.requestCodeActions(o,[l]))?.map(m=>({name:"command"in m&&typeof m.command=="object"&&m.command?.title||m.title,apply:async()=>{if("edit"in m&&m.edit?.changes){const y=m.edit.changes[this.documentUri];if(!y)return;for(const b of y)this.view.dispatch(this.view.state.update({changes:{from:As(this.view.state.doc,b.range.start),to:zn(this.view.state.doc,b.range.end),insert:b.newText}}))}"command"in m&&m.command&&AR("Executing command:",m.command)}}));return{from:As(this.view.state.doc,o.start),to:As(this.view.state.doc,o.end),severity:r[u??ra.DiagnosticSeverity.Error],message:a,renderMessage:()=>{const m=document.createElement("div");return m.innerHTML=this.markdownRenderer(a),m},source:c||this.languageId,markClass:this.pluginId,actions:d}}),s=await Promise.all(i);this.addDiagnostics(s)}addDiagnostics(e){if(e.length===0)return;const t=this.view.state;pG(t);const r=new Set(e.map(s=>s.source).filter(Boolean)),i=e.filter(s=>!r.has(s.source));this.view.dispatch(cA(t,[...i,...e]))}clearDiagnostics(){this.view.dispatch(cA(this.view.state,[]))}async requestCodeActions(e,t){return!this.featureOptions.codeActionsEnabled||!(this.client.ready&&this.client.capabilities?.codeActionProvider)?null:await this.client.textDocumentCodeAction({textDocument:{uri:this.documentUri},range:e,context:{diagnostics:[{range:e,code:t[0],source:this.languageId,message:""}]}})}async requestRename(e,{line:t,character:r}){if(this.featureOptions.renameEnabled){if(!this.client.ready){Ei(e,"Language server not ready");return}if(!this.client.capabilities?.renameProvider){Ei(e,"Rename not supported by language server");return}try{const i=await this.client.textDocumentPrepareRename({textDocument:{uri:this.documentUri},position:{line:t,character:r}}).catch(()=>this.prepareRenameFallback(e,{line:t,character:r}));if(!i||"defaultBehavior"in i){Ei(e,"Cannot rename this symbol");return}const s=document.createElement("div");s.className="cm-rename-popup",s.style.cssText="position: absolute; padding: 4px; background: white; border: 1px solid #ddd; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 99;";const o=document.createElement("input");o.type="text",o.style.cssText="width: 200px; padding: 4px; border: 1px solid #ddd;";const a="range"in i?i.range:i,u=zn(e.state.doc,a.start);if(u==null)return;const l=zn(e.state.doc,a.end);o.value=e.state.doc.sliceString(u,l),s.appendChild(o);const c=e.coordsAtPos(u);if(!c)return;s.style.left=`${c.left}px`,s.style.top=`${c.bottom+5}px`;const f=async()=>{const g=o.value.trim();if(!g){Ei(e,"New name cannot be empty"),s.remove();return}if(g===o.defaultValue){s.remove();return}try{const m=await this.client.textDocumentRename({textDocument:{uri:this.documentUri},position:{line:t,character:r},newName:g});await this.applyRenameEdit(e,m)}catch(m){Ei(e,`Rename failed: ${m instanceof Error?m.message:"Unknown error"}`)}finally{s.remove()}};o.addEventListener("keydown",g=>{g.key==="Enter"?f():g.key==="Escape"&&s.remove(),g.stopPropagation()});const d=g=>{s.contains(g.target)||(s.remove(),document.removeEventListener("mousedown",d))};document.addEventListener("mousedown",d),document.body.appendChild(s),o.focus(),o.select()}catch(i){Ei(e,`Rename failed: ${i instanceof Error?i.message:"Unknown error"}`)}}}async requestSignatureHelp(e,{line:t,character:r},i=void 0){if(!(this.featureOptions.signatureHelpEnabled&&this.client.ready&&this.client.capabilities?.signatureHelpProvider))return null;try{const s=await this.client.textDocumentSignatureHelp({textDocument:{uri:this.documentUri},position:{line:t,character:r},context:{isRetrigger:!1,triggerKind:1,triggerCharacter:i}});if(!s?.signatures||s.signatures.length===0)return null;const o=this.createTooltipContainer(),a=s.activeSignature??0,u=s.signatures[a]||s.signatures[0];if(!u)return null;const l=s.activeParameter??u.activeParameter??0,c=this.createSignatureElement(u,l);o.appendChild(c),u.documentation&&o.appendChild(this.createDocumentationElement(u.documentation));const f=u.parameters?.[l];f?.documentation&&o.appendChild(this.createParameterDocElement(f.documentation));const d=zn(e.state.doc,{line:t,character:r});return d==null?null:{pos:d,end:d,create:g=>({dom:o}),above:!1}}catch(s){return console.error("Signature help error:",s),null}}async showSignatureHelpTooltip(e,t,r){const i=await this.requestSignatureHelp(e,Ua(e.state.doc,t),r);if(i){const{pos:s,create:o}=i,a=o(e),u=document.createElement("div");u.className="cm-tooltip cm-signature-tooltip",u.style.position="absolute",u.appendChild(a.dom);const l=e.coordsAtPos(s);if(l){u.style.left=`${l.left}px`,u.style.top=`${l.bottom+5}px`,document.body.appendChild(u),setTimeout(()=>{u.remove()},1e4);const c=()=>{u.remove(),e.dom.removeEventListener("keydown",c),e.dom.removeEventListener("mousedown",c)};e.dom.addEventListener("keydown",c),e.dom.addEventListener("mousedown",c)}}}createTooltipContainer(){const e=document.createElement("div");return e.classList.add("cm-signature-help"),e.style.cssText="padding: 6px; max-width: 400px;",e}createSignatureElement(e,t){const r=document.createElement("div");if(r.classList.add("cm-signature"),r.style.cssText="font-family: monospace; margin-bottom: 4px;",!e.label||typeof e.label!="string")return r.textContent="Signature information unavailable",r;const i=e.label,s=e.parameters||[];if(s.length===0||!s[t])return r.textContent=i,r;const o=s[t].label;return typeof o=="string"?this.allowHTMLContent?r.innerHTML=i.replace(o,`<strong class="cm-signature-active-param">${o}</strong>`):r.textContent=i.replace(o,`«${o}»`):Array.isArray(o)&&o.length===2?this.applyRangeHighlighting(r,i,o[0],o[1]):r.textContent=i,r}applyRangeHighlighting(e,t,r,i){e.textContent="";const s=t.substring(0,r),o=t.substring(r,i),a=t.substring(i);e.appendChild(document.createTextNode(s));const u=document.createElement("span");u.classList.add("cm-signature-active-param"),u.style.cssText="font-weight: bold; text-decoration: underline;",u.textContent=o,e.appendChild(u),e.appendChild(document.createTextNode(a))}createDocumentationElement(e){const t=document.createElement("div");t.classList.add("cm-signature-docs"),t.style.cssText="margin-top: 4px; color: #666;";const r=Rs(e,this.markdownRenderer);return this.allowHTMLContent?t.innerHTML=r:t.textContent=r,t}createParameterDocElement(e){const t=document.createElement("div");t.classList.add("cm-parameter-docs"),t.style.cssText="margin-top: 4px; font-style: italic; border-top: 1px solid #eee; padding-top: 4px;";const r=Rs(e,this.markdownRenderer);return this.allowHTMLContent?t.innerHTML=r:t.textContent=r,t}prepareRenameFallback(e,{line:t,character:r}){const s=e.state.doc.line(t+1).text,o=/\w+/g;let a,u=r,l=r;for(;(a=o.exec(s))!==null;){const c=a.index,f=a.index+a[0].length;if(r>=c&&r<=f){u=c,l=f;break}}return u===r&&l===r?null:{range:{start:{line:t,character:u},end:{line:t,character:l}},placeholder:s.slice(u,l)}}async applyRenameEdit(e,t){if(!t)return Ei(e,"No edit returned from language server"),!1;const r=t.changes??{},i=t.documentChanges??[];if(Object.keys(r).length===0&&i.length===0)return Ei(e,"No changes to apply"),!1;if(i.length>0)for(const s of i){if("textDocument"in s){if(s.textDocument.uri!==this.documentUri){Ei(e,"Multi-file rename not supported yet");continue}const u=s.edits.sort((l,c)=>{const f=zn(e.state.doc,l.range.start);return(zn(e.state.doc,c.range.start)??0)-(f??0)}).map(l=>({from:zn(e.state.doc,l.range.start)??0,to:zn(e.state.doc,l.range.end)??0,insert:l.newText}));return e.dispatch(e.state.update({changes:u})),!0}return Ei(e,"File creation, deletion, or renaming operations not supported yet"),!1}else if(Object.keys(r).length>0)for(const[s,o]of Object.entries(r)){if(s!==this.documentUri){Ei(e,"Multi-file rename not supported yet");continue}const u=o.sort((l,c)=>{const f=zn(e.state.doc,l.range.start);return(zn(e.state.doc,c.range.start)??0)-(f??0)}).map(l=>({from:zn(e.state.doc,l.range.start)??0,to:zn(e.state.doc,l.range.end)??0,insert:l.newText}));e.dispatch(e.state.update({changes:u}))}return!1}}function wZ(n){let e=null;const t={rename:"F2",goToDefinition:"F12",signatureHelp:"Mod-Shift-Space",...n.keyboardShortcuts},r=n.client,i={diagnosticsEnabled:!0,hoverEnabled:!0,completionEnabled:!0,definitionEnabled:!0,renameEnabled:!0,codeActionsEnabled:!0,signatureHelpEnabled:!0,signatureActivateOnTyping:!1,...n},s=[mn.define(o=>(e=new bZ({client:r,documentUri:n.documentUri??o.state.facet(AP),languageId:n.languageId??o.state.facet(RP),view:o,featureOptions:i,sendIncrementalChanges:n.sendIncrementalChanges,allowHTMLContent:n.allowHTMLContent,useSnippetOnCompletion:n.useSnippetOnCompletion,onGoToDefinition:n.onGoToDefinition,markdownRenderer:n.markdownRenderer}),e))];return s.push(Zc.of([{key:t.signatureHelp,run:o=>{if(!(e&&i.signatureHelpEnabled))return!1;const a=o.state.selection.main.head;return e.showSignatureHelpTooltip(o,a),!0}},{key:t.rename,run:o=>{if(!(e&&i.renameEnabled))return!1;const a=o.state.selection.main.head;return e.requestRename(o,Ua(o.state.doc,a)),!0}},{key:t.goToDefinition,run:o=>{if(!(e&&i.definitionEnabled))return!1;const a=o.state.selection.main.head;return e.requestDefinition(o,Ua(o.state.doc,a)).catch(u=>Ei(o,`Go to definition failed: ${u instanceof Error?u.message:"Unknown error"}`)),!0}}])),i.hoverEnabled&&s.push(qM((o,a)=>e==null?null:e.requestHoverTooltip(o,Ua(o.state.doc,a)),n.hoverConfig)),i.signatureHelpEnabled&&s.push(Ae.updateListener.of(async o=>{if(!(e&&o.docChanged)||!e.client.capabilities?.signatureHelpProvider||!i.signatureActivateOnTyping)return;const a=e.client.capabilities.signatureHelpProvider.triggerCharacters||["(",","];let u;const l=o.changes;let c=!1,f=-1;l.iterChanges((d,g,m,y,b)=>{if(c)return;const w=b.toString();if(w){for(const x of a)if(w.includes(x)){c=!0,f=y,u=x;break}}}),c&&f>=0&&e.showSignatureHelpTooltip(o.view,f,u)})),i.completionEnabled&&s.push(SV({...n.completionConfig,override:[async o=>{if(e==null)return null;const{state:a,pos:u}=o,l=_Z(o,e.client.capabilities?.completionProvider?.triggerCharacters??[],n.completionMatchBefore);return l==null?null:await e.requestCompletion(o,Ua(a.doc,u),l)},...n.completionConfig?.override||[]]})),s.push(Ae.domEventHandlers({click:(o,a)=>{if(i.definitionEnabled&&t.goToDefinition==="ctrlcmd"&&(o.ctrlKey||o.metaKey)){const u=a.posAtCoords({x:o.clientX,y:o.clientY});u&&e&&(e.requestDefinition(a,Ua(a.state.doc,u)).catch(l=>Ei(a,`Go to definition failed: ${l instanceof Error?l.message:"Unknown error"}`)),o.preventDefault())}}})),s}function _Z(n,e,t){const{state:r,pos:i,explicit:s}=n,o=r.doc.lineAt(i);let a=ra.CompletionTriggerKind.Invoked,u;const l=o.text[i-o.from-1]||"",c=e?.includes(l);return!s&&c&&(a=ra.CompletionTriggerKind.TriggerCharacter,u=l),a===ra.CompletionTriggerKind.Invoked&&!n.matchBefore(t||/(\w+|\w+\.|\/|,)$/)?null:{triggerKind:a,triggerCharacter:u}}/**
|
|
148
|
-
* @license
|
|
149
|
-
* Copyright 2019 Google LLC
|
|
150
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
151
|
-
*/const DP=Symbol("Comlink.proxy"),kZ=Symbol("Comlink.endpoint"),xZ=Symbol("Comlink.releaseProxy"),wb=Symbol("Comlink.finalizer"),km=Symbol("Comlink.thrown"),TP=n=>typeof n=="object"&&n!==null||typeof n=="function",SZ={canHandle:n=>TP(n)&&n[DP],serialize(n){const{port1:e,port2:t}=new MessageChannel;return IP(n,e),[t,[t]]},deserialize(n){return n.start(),nx(n)}},CZ={canHandle:n=>TP(n)&&km in n,serialize({value:n}){let e;return n instanceof Error?e={isError:!0,value:{message:n.message,name:n.name,stack:n.stack}}:e={isError:!1,value:n},[e,[]]},deserialize(n){throw n.isError?Object.assign(new Error(n.value.message),n.value):n.value}},pp=new Map([["proxy",SZ],["throw",CZ]]);function EZ(n,e){for(const t of n)if(e===t||t==="*"||t instanceof RegExp&&t.test(e))return!0;return!1}function IP(n,e=globalThis,t=["*"]){e.addEventListener("message",function r(i){if(!i||!i.data)return;if(!EZ(t,i.origin)){console.warn(`Invalid origin '${i.origin}' for comlink proxy`);return}const{id:s,type:o,path:a}=Object.assign({path:[]},i.data),u=(i.data.argumentList||[]).map(Ju);let l;try{const c=a.slice(0,-1).reduce((d,g)=>d[g],n),f=a.reduce((d,g)=>d[g],n);switch(o){case"GET":l=f;break;case"SET":c[a.slice(-1)[0]]=Ju(i.data.value),l=!0;break;case"APPLY":l=f.apply(c,u);break;case"CONSTRUCT":{const d=new f(...u);l=Q1(d)}break;case"ENDPOINT":{const{port1:d,port2:g}=new MessageChannel;IP(n,g),l=LP(d,[d])}break;case"RELEASE":l=void 0;break;default:return}}catch(c){l={value:c,[km]:0}}Promise.resolve(l).catch(c=>({value:c,[km]:0})).then(c=>{const[f,d]=g1(c);e.postMessage(Object.assign(Object.assign({},f),{id:s}),d),o==="RELEASE"&&(e.removeEventListener("message",r),MP(e),wb in n&&typeof n[wb]=="function"&&n[wb]())}).catch(c=>{const[f,d]=g1({value:new TypeError("Unserializable return value"),[km]:0});e.postMessage(Object.assign(Object.assign({},f),{id:s}),d)})}),e.start&&e.start()}function AZ(n){return n.constructor.name==="MessagePort"}function MP(n){AZ(n)&&n.close()}function nx(n,e){const t=new Map;return n.addEventListener("message",function(i){const{data:s}=i;if(!s||!s.id)return;const o=t.get(s.id);if(o)try{o(s)}finally{t.delete(s.id)}}),p2(n,t,[],e)}function l0(n){if(n)throw new Error("Proxy has been released and is not useable")}function OP(n){return lc(n,new Map,{type:"RELEASE"}).then(()=>{MP(n)})}const d1=new WeakMap,p1="FinalizationRegistry"in globalThis&&new FinalizationRegistry(n=>{const e=(d1.get(n)||0)-1;d1.set(n,e),e===0&&OP(n)});function RZ(n,e){const t=(d1.get(e)||0)+1;d1.set(e,t),p1&&p1.register(n,e,n)}function DZ(n){p1&&p1.unregister(n)}function p2(n,e,t=[],r=function(){}){let i=!1;const s=new Proxy(r,{get(o,a){if(l0(i),a===xZ)return()=>{DZ(s),OP(n),e.clear(),i=!0};if(a==="then"){if(t.length===0)return{then:()=>s};const u=lc(n,e,{type:"GET",path:t.map(l=>l.toString())}).then(Ju);return u.then.bind(u)}return p2(n,e,[...t,a])},set(o,a,u){l0(i);const[l,c]=g1(u);return lc(n,e,{type:"SET",path:[...t,a].map(f=>f.toString()),value:l},c).then(Ju)},apply(o,a,u){l0(i);const l=t[t.length-1];if(l===kZ)return lc(n,e,{type:"ENDPOINT"}).then(Ju);if(l==="bind")return p2(n,e,t.slice(0,-1));const[c,f]=RR(u);return lc(n,e,{type:"APPLY",path:t.map(d=>d.toString()),argumentList:c},f).then(Ju)},construct(o,a){l0(i);const[u,l]=RR(a);return lc(n,e,{type:"CONSTRUCT",path:t.map(c=>c.toString()),argumentList:u},l).then(Ju)}});return RZ(s,n),s}function TZ(n){return Array.prototype.concat.apply([],n)}function RR(n){const e=n.map(g1);return[e.map(t=>t[0]),TZ(e.map(t=>t[1]))]}const PP=new WeakMap;function LP(n,e){return PP.set(n,e),n}function Q1(n){return Object.assign(n,{[DP]:!0})}function g1(n){for(const[e,t]of pp)if(t.canHandle(n)){const[r,i]=t.serialize(n);return[{type:"HANDLER",name:e,value:r},i]}return[{type:"RAW",value:n},PP.get(n)||[]]}function Ju(n){switch(n.type){case"HANDLER":return pp.get(n.name).deserialize(n.value);case"RAW":return n.value}}function lc(n,e,t,r){return new Promise(i=>{const s=IZ();e.set(s,i),n.start&&n.start(),n.postMessage(Object.assign({id:s},t),r)})}function IZ(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var MZ=tf();const DR=n=>n.request.id===void 0||n.request.id===null,OZ=n=>n instanceof Array?n.filter(e=>DR(e.request)).map(e=>e.request):DR(n)?[n]:[];class PZ extends MZ.Transport{constructor(e){super(),this.port=e,this.postMessageID=`post-message-transport-${Math.random()}`}postMessageID;messageHandler=e=>{console.debug("LSP <<-",e.data),!e.data.result&&e.data.method!=="textDocument/publishDiagnostics"?console.debug(e.data):this.transportRequestManager.resolveResponse(JSON.stringify(e.data))};connect(){return new Promise(async e=>{this.port.addEventListener("message",this.messageHandler),e()})}async sendData(e){console.debug("LSP ->>",e);const t=this.transportRequestManager.addRequest(e,null),r=OZ(e);return this.port&&(this.port.postMessage(e.request),this.transportRequestManager.settlePendingRequest(r)),t}close(){}}const TR={};function LZ(n){let e=TR[n];if(e)return e;e=TR[n]=[];for(let t=0;t<128;t++){const r=String.fromCharCode(t);e.push(r)}for(let t=0;t<n.length;t++){const r=n.charCodeAt(t);e[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return e}function Uc(n,e){typeof e!="string"&&(e=Uc.defaultChars);const t=LZ(e);return n.replace(/(%[a-f0-9]{2})+/gi,function(r){let i="";for(let s=0,o=r.length;s<o;s+=3){const a=parseInt(r.slice(s+1,s+3),16);if(a<128){i+=t[a];continue}if((a&224)===192&&s+3<o){const u=parseInt(r.slice(s+4,s+6),16);if((u&192)===128){const l=a<<6&1984|u&63;l<128?i+="��":i+=String.fromCharCode(l),s+=3;continue}}if((a&240)===224&&s+6<o){const u=parseInt(r.slice(s+4,s+6),16),l=parseInt(r.slice(s+7,s+9),16);if((u&192)===128&&(l&192)===128){const c=a<<12&61440|u<<6&4032|l&63;c<2048||c>=55296&&c<=57343?i+="���":i+=String.fromCharCode(c),s+=6;continue}}if((a&248)===240&&s+9<o){const u=parseInt(r.slice(s+4,s+6),16),l=parseInt(r.slice(s+7,s+9),16),c=parseInt(r.slice(s+10,s+12),16);if((u&192)===128&&(l&192)===128&&(c&192)===128){let f=a<<18&1835008|u<<12&258048|l<<6&4032|c&63;f<65536||f>1114111?i+="����":(f-=65536,i+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),s+=9;continue}}i+="�"}return i})}Uc.defaultChars=";/?:@&=+$,#";Uc.componentChars="";const IR={};function FZ(n){let e=IR[n];if(e)return e;e=IR[n]=[];for(let t=0;t<128;t++){const r=String.fromCharCode(t);/^[0-9a-z]$/i.test(r)?e.push(r):e.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2))}for(let t=0;t<n.length;t++)e[n.charCodeAt(t)]=n[t];return e}function gp(n,e,t){typeof e!="string"&&(t=e,e=gp.defaultChars),typeof t>"u"&&(t=!0);const r=FZ(e);let i="";for(let s=0,o=n.length;s<o;s++){const a=n.charCodeAt(s);if(t&&a===37&&s+2<o&&/^[0-9a-f]{2}$/i.test(n.slice(s+1,s+3))){i+=n.slice(s,s+3),s+=2;continue}if(a<128){i+=r[a];continue}if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&s+1<o){const u=n.charCodeAt(s+1);if(u>=56320&&u<=57343){i+=encodeURIComponent(n[s]+n[s+1]),s++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(n[s])}return i}gp.defaultChars=";/?:@&=+$,-_.!~*'()#";gp.componentChars="-_.!~*'()";function rx(n){let e="";return e+=n.protocol||"",e+=n.slashes?"//":"",e+=n.auth?n.auth+"@":"",n.hostname&&n.hostname.indexOf(":")!==-1?e+="["+n.hostname+"]":e+=n.hostname||"",e+=n.port?":"+n.port:"",e+=n.pathname||"",e+=n.search||"",e+=n.hash||"",e}function m1(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const NZ=/^([a-z0-9.+-]+:)/i,BZ=/:[0-9]*$/,qZ=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,WZ=["<",">",'"',"`"," ","\r",`
|
|
152
|
-
`," "],jZ=["{","}","|","\\","^","`"].concat(WZ),$Z=["'"].concat(jZ),MR=["%","/","?",";","#"].concat($Z),OR=["/","?","#"],zZ=255,PR=/^[+a-z0-9A-Z_-]{0,63}$/,UZ=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,LR={javascript:!0,"javascript:":!0},FR={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function ix(n,e){if(n&&n instanceof m1)return n;const t=new m1;return t.parse(n,e),t}m1.prototype.parse=function(n,e){let t,r,i,s=n;if(s=s.trim(),!e&&n.split("#").length===1){const l=qZ.exec(s);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}let o=NZ.exec(s);if(o&&(o=o[0],t=o.toLowerCase(),this.protocol=o,s=s.substr(o.length)),(e||o||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=s.substr(0,2)==="//",i&&!(o&&LR[o])&&(s=s.substr(2),this.slashes=!0)),!LR[o]&&(i||o&&!FR[o])){let l=-1;for(let m=0;m<OR.length;m++)r=s.indexOf(OR[m]),r!==-1&&(l===-1||r<l)&&(l=r);let c,f;l===-1?f=s.lastIndexOf("@"):f=s.lastIndexOf("@",l),f!==-1&&(c=s.slice(0,f),s=s.slice(f+1),this.auth=c),l=-1;for(let m=0;m<MR.length;m++)r=s.indexOf(MR[m]),r!==-1&&(l===-1||r<l)&&(l=r);l===-1&&(l=s.length),s[l-1]===":"&&l--;const d=s.slice(0,l);s=s.slice(l),this.parseHost(d),this.hostname=this.hostname||"";const g=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!g){const m=this.hostname.split(/\./);for(let y=0,b=m.length;y<b;y++){const w=m[y];if(w&&!w.match(PR)){let x="";for(let _=0,S=w.length;_<S;_++)w.charCodeAt(_)>127?x+="x":x+=w[_];if(!x.match(PR)){const _=m.slice(0,y),S=m.slice(y+1),C=w.match(UZ);C&&(_.push(C[1]),S.unshift(C[2])),S.length&&(s=S.join(".")+s),this.hostname=_.join(".");break}}}}this.hostname.length>zZ&&(this.hostname=""),g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=s.indexOf("#");a!==-1&&(this.hash=s.substr(a),s=s.slice(0,a));const u=s.indexOf("?");return u!==-1&&(this.search=s.substr(u),s=s.slice(0,u)),s&&(this.pathname=s),FR[t]&&this.hostname&&!this.pathname&&(this.pathname=""),this};m1.prototype.parseHost=function(n){let e=BZ.exec(n);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),n=n.substr(0,n.length-e.length)),n&&(this.hostname=n)};const HZ=Object.freeze(Object.defineProperty({__proto__:null,decode:Uc,encode:gp,format:rx,parse:ix},Symbol.toStringTag,{value:"Module"})),FP=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,NP=/[\0-\x1F\x7F-\x9F]/,VZ=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,sx=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,BP=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,qP=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,GZ=Object.freeze(Object.defineProperty({__proto__:null,Any:FP,Cc:NP,Cf:VZ,P:sx,S:BP,Z:qP},Symbol.toStringTag,{value:"Module"})),KZ=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(n=>n.charCodeAt(0))),ZZ=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(n=>n.charCodeAt(0)));var _b;const XZ=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),YZ=(_b=String.fromCodePoint)!==null&&_b!==void 0?_b:function(n){let e="";return n>65535&&(n-=65536,e+=String.fromCharCode(n>>>10&1023|55296),n=56320|n&1023),e+=String.fromCharCode(n),e};function JZ(n){var e;return n>=55296&&n<=57343||n>1114111?65533:(e=XZ.get(n))!==null&&e!==void 0?e:n}var Gn;(function(n){n[n.NUM=35]="NUM",n[n.SEMI=59]="SEMI",n[n.EQUALS=61]="EQUALS",n[n.ZERO=48]="ZERO",n[n.NINE=57]="NINE",n[n.LOWER_A=97]="LOWER_A",n[n.LOWER_F=102]="LOWER_F",n[n.LOWER_X=120]="LOWER_X",n[n.LOWER_Z=122]="LOWER_Z",n[n.UPPER_A=65]="UPPER_A",n[n.UPPER_F=70]="UPPER_F",n[n.UPPER_Z=90]="UPPER_Z"})(Gn||(Gn={}));const QZ=32;var Za;(function(n){n[n.VALUE_LENGTH=49152]="VALUE_LENGTH",n[n.BRANCH_LENGTH=16256]="BRANCH_LENGTH",n[n.JUMP_TABLE=127]="JUMP_TABLE"})(Za||(Za={}));function g2(n){return n>=Gn.ZERO&&n<=Gn.NINE}function eX(n){return n>=Gn.UPPER_A&&n<=Gn.UPPER_F||n>=Gn.LOWER_A&&n<=Gn.LOWER_F}function tX(n){return n>=Gn.UPPER_A&&n<=Gn.UPPER_Z||n>=Gn.LOWER_A&&n<=Gn.LOWER_Z||g2(n)}function nX(n){return n===Gn.EQUALS||tX(n)}var Un;(function(n){n[n.EntityStart=0]="EntityStart",n[n.NumericStart=1]="NumericStart",n[n.NumericDecimal=2]="NumericDecimal",n[n.NumericHex=3]="NumericHex",n[n.NamedEntity=4]="NamedEntity"})(Un||(Un={}));var Ha;(function(n){n[n.Legacy=0]="Legacy",n[n.Strict=1]="Strict",n[n.Attribute=2]="Attribute"})(Ha||(Ha={}));class rX{constructor(e,t,r){this.decodeTree=e,this.emitCodePoint=t,this.errors=r,this.state=Un.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ha.Strict}startEntity(e){this.decodeMode=e,this.state=Un.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Un.EntityStart:return e.charCodeAt(t)===Gn.NUM?(this.state=Un.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Un.NamedEntity,this.stateNamedEntity(e,t));case Un.NumericStart:return this.stateNumericStart(e,t);case Un.NumericDecimal:return this.stateNumericDecimal(e,t);case Un.NumericHex:return this.stateNumericHex(e,t);case Un.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|QZ)===Gn.LOWER_X?(this.state=Un.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Un.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,r,i){if(t!==r){const s=r-t;this.result=this.result*Math.pow(i,s)+parseInt(e.substr(t,s),i),this.consumed+=s}}stateNumericHex(e,t){const r=t;for(;t<e.length;){const i=e.charCodeAt(t);if(g2(i)||eX(i))t+=1;else return this.addToNumericResult(e,r,t,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(e,r,t,16),-1}stateNumericDecimal(e,t){const r=t;for(;t<e.length;){const i=e.charCodeAt(t);if(g2(i))t+=1;else return this.addToNumericResult(e,r,t,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(e,r,t,10),-1}emitNumericEntity(e,t){var r;if(this.consumed<=t)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Gn.SEMI)this.consumed+=1;else if(this.decodeMode===Ha.Strict)return 0;return this.emitCodePoint(JZ(this.result),this.consumed),this.errors&&(e!==Gn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&Za.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const o=e.charCodeAt(t);if(this.treeIndex=iX(r,i,this.treeIndex+Math.max(1,s),o),this.treeIndex<0)return this.result===0||this.decodeMode===Ha.Attribute&&(s===0||nX(o))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&Za.VALUE_LENGTH)>>14,s!==0){if(o===Gn.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Ha.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:r}=this,i=(r[t]&Za.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,r){const{decodeTree:i}=this;return this.emitCodePoint(t===1?i[e]&~Za.VALUE_LENGTH:i[e+1],r),t===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case Un.NamedEntity:return this.result!==0&&(this.decodeMode!==Ha.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Un.NumericDecimal:return this.emitNumericEntity(0,2);case Un.NumericHex:return this.emitNumericEntity(0,3);case Un.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Un.EntityStart:return 0}}}function WP(n){let e="";const t=new rX(n,r=>e+=YZ(r));return function(i,s){let o=0,a=0;for(;(a=i.indexOf("&",a))>=0;){e+=i.slice(o,a),t.startEntity(s);const l=t.write(i,a+1);if(l<0){o=a+t.end();break}o=a+l,a=l===0?o+1:o}const u=e+i.slice(o);return e="",u}}function iX(n,e,t,r){const i=(e&Za.BRANCH_LENGTH)>>7,s=e&Za.JUMP_TABLE;if(i===0)return s!==0&&r===s?t:-1;if(s){const u=r-s;return u<0||u>=i?-1:n[t+u]-1}let o=t,a=o+i-1;for(;o<=a;){const u=o+a>>>1,l=n[u];if(l<r)o=u+1;else if(l>r)a=u-1;else return n[u+i]}return-1}const sX=WP(KZ);WP(ZZ);function jP(n,e=Ha.Legacy){return sX(n,e)}function oX(n){return Object.prototype.toString.call(n)}function ox(n){return oX(n)==="[object String]"}const aX=Object.prototype.hasOwnProperty;function uX(n,e){return aX.call(n,e)}function ey(n){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if(typeof t!="object")throw new TypeError(t+"must be object");Object.keys(t).forEach(function(r){n[r]=t[r]})}}),n}function $P(n,e,t){return[].concat(n.slice(0,e),t,n.slice(e+1))}function ax(n){return!(n>=55296&&n<=57343||n>=64976&&n<=65007||(n&65535)===65535||(n&65535)===65534||n>=0&&n<=8||n===11||n>=14&&n<=31||n>=127&&n<=159||n>1114111)}function y1(n){if(n>65535){n-=65536;const e=55296+(n>>10),t=56320+(n&1023);return String.fromCharCode(e,t)}return String.fromCharCode(n)}const zP=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,lX=/&([a-z#][a-z0-9]{1,31});/gi,cX=new RegExp(zP.source+"|"+lX.source,"gi"),fX=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function hX(n,e){if(e.charCodeAt(0)===35&&fX.test(e)){const r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return ax(r)?y1(r):n}const t=jP(n);return t!==n?t:n}function dX(n){return n.indexOf("\\")<0?n:n.replace(zP,"$1")}function Hc(n){return n.indexOf("\\")<0&&n.indexOf("&")<0?n:n.replace(cX,function(e,t,r){return t||hX(e,r)})}const pX=/[&<>"]/,gX=/[&<>"]/g,mX={"&":"&","<":"<",">":">",'"':"""};function yX(n){return mX[n]}function uu(n){return pX.test(n)?n.replace(gX,yX):n}const vX=/[.?*+^$[\]\\(){}|-]/g;function bX(n){return n.replace(vX,"\\$&")}function Kt(n){switch(n){case 9:case 32:return!0}return!1}function $d(n){if(n>=8192&&n<=8202)return!0;switch(n){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function zd(n){return sx.test(n)||BP.test(n)}function Ud(n){switch(n){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function ty(n){return n=n.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(n=n.replace(/ẞ/g,"ß")),n.toLowerCase().toUpperCase()}const wX={mdurl:HZ,ucmicro:GZ},_X=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:$P,assign:ey,escapeHtml:uu,escapeRE:bX,fromCodePoint:y1,has:uX,isMdAsciiPunct:Ud,isPunctChar:zd,isSpace:Kt,isString:ox,isValidEntityCode:ax,isWhiteSpace:$d,lib:wX,normalizeReference:ty,unescapeAll:Hc,unescapeMd:dX},Symbol.toStringTag,{value:"Module"}));function kX(n,e,t){let r,i,s,o;const a=n.posMax,u=n.pos;for(n.pos=e+1,r=1;n.pos<a;){if(s=n.src.charCodeAt(n.pos),s===93&&(r--,r===0)){i=!0;break}if(o=n.pos,n.md.inline.skipToken(n),s===91){if(o===n.pos-1)r++;else if(t)return n.pos=u,-1}}let l=-1;return i&&(l=n.pos),n.pos=u,l}function xX(n,e,t){let r,i=e;const s={ok:!1,pos:0,str:""};if(n.charCodeAt(i)===60){for(i++;i<t;){if(r=n.charCodeAt(i),r===10||r===60)return s;if(r===62)return s.pos=i+1,s.str=Hc(n.slice(e+1,i)),s.ok=!0,s;if(r===92&&i+1<t){i+=2;continue}i++}return s}let o=0;for(;i<t&&(r=n.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<t){if(n.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(o++,o>32))return s;if(r===41){if(o===0)break;o--}i++}return e===i||o!==0||(s.str=Hc(n.slice(e,i)),s.pos=i,s.ok=!0),s}function SX(n,e,t,r){let i,s=e;const o={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(s>=t)return o;let a=n.charCodeAt(s);if(a!==34&&a!==39&&a!==40)return o;e++,s++,a===40&&(a=41),o.marker=a}for(;s<t;){if(i=n.charCodeAt(s),i===o.marker)return o.pos=s+1,o.str+=Hc(n.slice(e,s)),o.ok=!0,o;if(i===40&&o.marker===41)return o;i===92&&s+1<t&&s++,s++}return o.can_continue=!0,o.str+=Hc(n.slice(e,s)),o}const CX=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:xX,parseLinkLabel:kX,parseLinkTitle:SX},Symbol.toStringTag,{value:"Module"})),Eo={};Eo.code_inline=function(n,e,t,r,i){const s=n[e];return"<code"+i.renderAttrs(s)+">"+uu(s.content)+"</code>"};Eo.code_block=function(n,e,t,r,i){const s=n[e];return"<pre"+i.renderAttrs(s)+"><code>"+uu(n[e].content)+`</code></pre>
|
|
153
|
-
`};Eo.fence=function(n,e,t,r,i){const s=n[e],o=s.info?Hc(s.info).trim():"";let a="",u="";if(o){const c=o.split(/(\s+)/g);a=c[0],u=c.slice(2).join("")}let l;if(t.highlight?l=t.highlight(s.content,a,u)||uu(s.content):l=uu(s.content),l.indexOf("<pre")===0)return l+`
|
|
154
|
-
`;if(o){const c=s.attrIndex("class"),f=s.attrs?s.attrs.slice():[];c<0?f.push(["class",t.langPrefix+a]):(f[c]=f[c].slice(),f[c][1]+=" "+t.langPrefix+a);const d={attrs:f};return`<pre><code${i.renderAttrs(d)}>${l}</code></pre>
|
|
155
|
-
`}return`<pre><code${i.renderAttrs(s)}>${l}</code></pre>
|
|
156
|
-
`};Eo.image=function(n,e,t,r,i){const s=n[e];return s.attrs[s.attrIndex("alt")][1]=i.renderInlineAsText(s.children,t,r),i.renderToken(n,e,t)};Eo.hardbreak=function(n,e,t){return t.xhtmlOut?`<br />
|
|
157
|
-
`:`<br>
|
|
158
|
-
`};Eo.softbreak=function(n,e,t){return t.breaks?t.xhtmlOut?`<br />
|
|
159
|
-
`:`<br>
|
|
160
|
-
`:`
|
|
161
|
-
`};Eo.text=function(n,e){return uu(n[e].content)};Eo.html_block=function(n,e){return n[e].content};Eo.html_inline=function(n,e){return n[e].content};function sf(){this.rules=ey({},Eo)}sf.prototype.renderAttrs=function(e){let t,r,i;if(!e.attrs)return"";for(i="",t=0,r=e.attrs.length;t<r;t++)i+=" "+uu(e.attrs[t][0])+'="'+uu(e.attrs[t][1])+'"';return i};sf.prototype.renderToken=function(e,t,r){const i=e[t];let s="";if(i.hidden)return"";i.block&&i.nesting!==-1&&t&&e[t-1].hidden&&(s+=`
|
|
162
|
-
`),s+=(i.nesting===-1?"</":"<")+i.tag,s+=this.renderAttrs(i),i.nesting===0&&r.xhtmlOut&&(s+=" /");let o=!1;if(i.block&&(o=!0,i.nesting===1&&t+1<e.length)){const a=e[t+1];(a.type==="inline"||a.hidden||a.nesting===-1&&a.tag===i.tag)&&(o=!1)}return s+=o?`>
|
|
163
|
-
`:">",s};sf.prototype.renderInline=function(n,e,t){let r="";const i=this.rules;for(let s=0,o=n.length;s<o;s++){const a=n[s].type;typeof i[a]<"u"?r+=i[a](n,s,e,t,this):r+=this.renderToken(n,s,e)}return r};sf.prototype.renderInlineAsText=function(n,e,t){let r="";for(let i=0,s=n.length;i<s;i++)switch(n[i].type){case"text":r+=n[i].content;break;case"image":r+=this.renderInlineAsText(n[i].children,e,t);break;case"html_inline":case"html_block":r+=n[i].content;break;case"softbreak":case"hardbreak":r+=`
|
|
164
|
-
`;break}return r};sf.prototype.render=function(n,e,t){let r="";const i=this.rules;for(let s=0,o=n.length;s<o;s++){const a=n[s].type;a==="inline"?r+=this.renderInline(n[s].children,e,t):typeof i[a]<"u"?r+=i[a](n,s,e,t,this):r+=this.renderToken(n,s,e,t)}return r};function pi(){this.__rules__=[],this.__cache__=null}pi.prototype.__find__=function(n){for(let e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===n)return e;return-1};pi.prototype.__compile__=function(){const n=this,e=[""];n.__rules__.forEach(function(t){t.enabled&&t.alt.forEach(function(r){e.indexOf(r)<0&&e.push(r)})}),n.__cache__={},e.forEach(function(t){n.__cache__[t]=[],n.__rules__.forEach(function(r){r.enabled&&(t&&r.alt.indexOf(t)<0||n.__cache__[t].push(r.fn))})})};pi.prototype.at=function(n,e,t){const r=this.__find__(n),i=t||{};if(r===-1)throw new Error("Parser rule not found: "+n);this.__rules__[r].fn=e,this.__rules__[r].alt=i.alt||[],this.__cache__=null};pi.prototype.before=function(n,e,t,r){const i=this.__find__(n),s=r||{};if(i===-1)throw new Error("Parser rule not found: "+n);this.__rules__.splice(i,0,{name:e,enabled:!0,fn:t,alt:s.alt||[]}),this.__cache__=null};pi.prototype.after=function(n,e,t,r){const i=this.__find__(n),s=r||{};if(i===-1)throw new Error("Parser rule not found: "+n);this.__rules__.splice(i+1,0,{name:e,enabled:!0,fn:t,alt:s.alt||[]}),this.__cache__=null};pi.prototype.push=function(n,e,t){const r=t||{};this.__rules__.push({name:n,enabled:!0,fn:e,alt:r.alt||[]}),this.__cache__=null};pi.prototype.enable=function(n,e){Array.isArray(n)||(n=[n]);const t=[];return n.forEach(function(r){const i=this.__find__(r);if(i<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!0,t.push(r)},this),this.__cache__=null,t};pi.prototype.enableOnly=function(n,e){Array.isArray(n)||(n=[n]),this.__rules__.forEach(function(t){t.enabled=!1}),this.enable(n,e)};pi.prototype.disable=function(n,e){Array.isArray(n)||(n=[n]);const t=[];return n.forEach(function(r){const i=this.__find__(r);if(i<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!1,t.push(r)},this),this.__cache__=null,t};pi.prototype.getRules=function(n){return this.__cache__===null&&this.__compile__(),this.__cache__[n]||[]};function Ls(n,e,t){this.type=n,this.tag=e,this.attrs=null,this.map=null,this.nesting=t,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}Ls.prototype.attrIndex=function(e){if(!this.attrs)return-1;const t=this.attrs;for(let r=0,i=t.length;r<i;r++)if(t[r][0]===e)return r;return-1};Ls.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]};Ls.prototype.attrSet=function(e,t){const r=this.attrIndex(e),i=[e,t];r<0?this.attrPush(i):this.attrs[r]=i};Ls.prototype.attrGet=function(e){const t=this.attrIndex(e);let r=null;return t>=0&&(r=this.attrs[t][1]),r};Ls.prototype.attrJoin=function(e,t){const r=this.attrIndex(e);r<0?this.attrPush([e,t]):this.attrs[r][1]=this.attrs[r][1]+" "+t};function UP(n,e,t){this.src=n,this.env=t,this.tokens=[],this.inlineMode=!1,this.md=e}UP.prototype.Token=Ls;const EX=/\r\n?|\n/g,AX=/\0/g;function RX(n){let e;e=n.src.replace(EX,`
|
|
165
|
-
`),e=e.replace(AX,"�"),n.src=e}function DX(n){let e;n.inlineMode?(e=new n.Token("inline","",0),e.content=n.src,e.map=[0,1],e.children=[],n.tokens.push(e)):n.md.block.parse(n.src,n.md,n.env,n.tokens)}function TX(n){const e=n.tokens;for(let t=0,r=e.length;t<r;t++){const i=e[t];i.type==="inline"&&n.md.inline.parse(i.content,n.md,n.env,i.children)}}function IX(n){return/^<a[>\s]/i.test(n)}function MX(n){return/^<\/a\s*>/i.test(n)}function OX(n){const e=n.tokens;if(n.md.options.linkify)for(let t=0,r=e.length;t<r;t++){if(e[t].type!=="inline"||!n.md.linkify.pretest(e[t].content))continue;let i=e[t].children,s=0;for(let o=i.length-1;o>=0;o--){const a=i[o];if(a.type==="link_close"){for(o--;i[o].level!==a.level&&i[o].type!=="link_open";)o--;continue}if(a.type==="html_inline"&&(IX(a.content)&&s>0&&s--,MX(a.content)&&s++),!(s>0)&&a.type==="text"&&n.md.linkify.test(a.content)){const u=a.content;let l=n.md.linkify.match(u);const c=[];let f=a.level,d=0;l.length>0&&l[0].index===0&&o>0&&i[o-1].type==="text_special"&&(l=l.slice(1));for(let g=0;g<l.length;g++){const m=l[g].url,y=n.md.normalizeLink(m);if(!n.md.validateLink(y))continue;let b=l[g].text;l[g].schema?l[g].schema==="mailto:"&&!/^mailto:/i.test(b)?b=n.md.normalizeLinkText("mailto:"+b).replace(/^mailto:/,""):b=n.md.normalizeLinkText(b):b=n.md.normalizeLinkText("http://"+b).replace(/^http:\/\//,"");const w=l[g].index;if(w>d){const C=new n.Token("text","",0);C.content=u.slice(d,w),C.level=f,c.push(C)}const x=new n.Token("link_open","a",1);x.attrs=[["href",y]],x.level=f++,x.markup="linkify",x.info="auto",c.push(x);const _=new n.Token("text","",0);_.content=b,_.level=f,c.push(_);const S=new n.Token("link_close","a",-1);S.level=--f,S.markup="linkify",S.info="auto",c.push(S),d=l[g].lastIndex}if(d<u.length){const g=new n.Token("text","",0);g.content=u.slice(d),g.level=f,c.push(g)}e[t].children=i=$P(i,o,c)}}}}const HP=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,PX=/\((c|tm|r)\)/i,LX=/\((c|tm|r)\)/ig,FX={c:"©",r:"®",tm:"™"};function NX(n,e){return FX[e.toLowerCase()]}function BX(n){let e=0;for(let t=n.length-1;t>=0;t--){const r=n[t];r.type==="text"&&!e&&(r.content=r.content.replace(LX,NX)),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function qX(n){let e=0;for(let t=n.length-1;t>=0;t--){const r=n[t];r.type==="text"&&!e&&HP.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function WX(n){let e;if(n.md.options.typographer)for(e=n.tokens.length-1;e>=0;e--)n.tokens[e].type==="inline"&&(PX.test(n.tokens[e].content)&&BX(n.tokens[e].children),HP.test(n.tokens[e].content)&&qX(n.tokens[e].children))}const jX=/['"]/,NR=/['"]/g,BR="’";function c0(n,e,t){return n.slice(0,e)+t+n.slice(e+1)}function $X(n,e){let t;const r=[];for(let i=0;i<n.length;i++){const s=n[i],o=n[i].level;for(t=r.length-1;t>=0&&!(r[t].level<=o);t--);if(r.length=t+1,s.type!=="text")continue;let a=s.content,u=0,l=a.length;e:for(;u<l;){NR.lastIndex=u;const c=NR.exec(a);if(!c)break;let f=!0,d=!0;u=c.index+1;const g=c[0]==="'";let m=32;if(c.index-1>=0)m=a.charCodeAt(c.index-1);else for(t=i-1;t>=0&&!(n[t].type==="softbreak"||n[t].type==="hardbreak");t--)if(n[t].content){m=n[t].content.charCodeAt(n[t].content.length-1);break}let y=32;if(u<l)y=a.charCodeAt(u);else for(t=i+1;t<n.length&&!(n[t].type==="softbreak"||n[t].type==="hardbreak");t++)if(n[t].content){y=n[t].content.charCodeAt(0);break}const b=Ud(m)||zd(String.fromCharCode(m)),w=Ud(y)||zd(String.fromCharCode(y)),x=$d(m),_=$d(y);if(_?f=!1:w&&(x||b||(f=!1)),x?d=!1:b&&(_||w||(d=!1)),y===34&&c[0]==='"'&&m>=48&&m<=57&&(d=f=!1),f&&d&&(f=b,d=w),!f&&!d){g&&(s.content=c0(s.content,c.index,BR));continue}if(d)for(t=r.length-1;t>=0;t--){let S=r[t];if(r[t].level<o)break;if(S.single===g&&r[t].level===o){S=r[t];let C,A;g?(C=e.md.options.quotes[2],A=e.md.options.quotes[3]):(C=e.md.options.quotes[0],A=e.md.options.quotes[1]),s.content=c0(s.content,c.index,A),n[S.token].content=c0(n[S.token].content,S.pos,C),u+=A.length-1,S.token===i&&(u+=C.length-1),a=s.content,l=a.length,r.length=t;continue e}}f?r.push({token:i,pos:c.index,single:g,level:o}):d&&g&&(s.content=c0(s.content,c.index,BR))}}}function zX(n){if(n.md.options.typographer)for(let e=n.tokens.length-1;e>=0;e--)n.tokens[e].type!=="inline"||!jX.test(n.tokens[e].content)||$X(n.tokens[e].children,n)}function UX(n){let e,t;const r=n.tokens,i=r.length;for(let s=0;s<i;s++){if(r[s].type!=="inline")continue;const o=r[s].children,a=o.length;for(e=0;e<a;e++)o[e].type==="text_special"&&(o[e].type="text");for(e=t=0;e<a;e++)o[e].type==="text"&&e+1<a&&o[e+1].type==="text"?o[e+1].content=o[e].content+o[e+1].content:(e!==t&&(o[t]=o[e]),t++);e!==t&&(o.length=t)}}const kb=[["normalize",RX],["block",DX],["inline",TX],["linkify",OX],["replacements",WX],["smartquotes",zX],["text_join",UX]];function ux(){this.ruler=new pi;for(let n=0;n<kb.length;n++)this.ruler.push(kb[n][0],kb[n][1])}ux.prototype.process=function(n){const e=this.ruler.getRules("");for(let t=0,r=e.length;t<r;t++)e[t](n)};ux.prototype.State=UP;function Ao(n,e,t,r){this.src=n,this.md=e,this.env=t,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const i=this.src;for(let s=0,o=0,a=0,u=0,l=i.length,c=!1;o<l;o++){const f=i.charCodeAt(o);if(!c)if(Kt(f)){a++,f===9?u+=4-u%4:u++;continue}else c=!0;(f===10||o===l-1)&&(f!==10&&o++,this.bMarks.push(s),this.eMarks.push(o),this.tShift.push(a),this.sCount.push(u),this.bsCount.push(0),c=!1,a=0,u=0,s=o+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}Ao.prototype.push=function(n,e,t){const r=new Ls(n,e,t);return r.block=!0,t<0&&this.level--,r.level=this.level,t>0&&this.level++,this.tokens.push(r),r};Ao.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};Ao.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e};Ao.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t;e++){const r=this.src.charCodeAt(e);if(!Kt(r))break}return e};Ao.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!Kt(this.src.charCodeAt(--e)))return e+1;return e};Ao.prototype.skipChars=function(e,t){for(let r=this.src.length;e<r&&this.src.charCodeAt(e)===t;e++);return e};Ao.prototype.skipCharsBack=function(e,t,r){if(e<=r)return e;for(;e>r;)if(t!==this.src.charCodeAt(--e))return e+1;return e};Ao.prototype.getLines=function(e,t,r,i){if(e>=t)return"";const s=new Array(t-e);for(let o=0,a=e;a<t;a++,o++){let u=0;const l=this.bMarks[a];let c=l,f;for(a+1<t||i?f=this.eMarks[a]+1:f=this.eMarks[a];c<f&&u<r;){const d=this.src.charCodeAt(c);if(Kt(d))d===9?u+=4-(u+this.bsCount[a])%4:u++;else if(c-l<this.tShift[a])u++;else break;c++}u>r?s[o]=new Array(u-r+1).join(" ")+this.src.slice(c,f):s[o]=this.src.slice(c,f)}return s.join("")};Ao.prototype.Token=Ls;const HX=65536;function xb(n,e){const t=n.bMarks[e]+n.tShift[e],r=n.eMarks[e];return n.src.slice(t,r)}function qR(n){const e=[],t=n.length;let r=0,i=n.charCodeAt(r),s=!1,o=0,a="";for(;r<t;)i===124&&(s?(a+=n.substring(o,r-1),o=r):(e.push(a+n.substring(o,r)),a="",o=r+1)),s=i===92,r++,i=n.charCodeAt(r);return e.push(a+n.substring(o)),e}function VX(n,e,t,r){if(e+2>t)return!1;let i=e+1;if(n.sCount[i]<n.blkIndent||n.sCount[i]-n.blkIndent>=4)return!1;let s=n.bMarks[i]+n.tShift[i];if(s>=n.eMarks[i])return!1;const o=n.src.charCodeAt(s++);if(o!==124&&o!==45&&o!==58||s>=n.eMarks[i])return!1;const a=n.src.charCodeAt(s++);if(a!==124&&a!==45&&a!==58&&!Kt(a)||o===45&&Kt(a))return!1;for(;s<n.eMarks[i];){const S=n.src.charCodeAt(s);if(S!==124&&S!==45&&S!==58&&!Kt(S))return!1;s++}let u=xb(n,e+1),l=u.split("|");const c=[];for(let S=0;S<l.length;S++){const C=l[S].trim();if(!C){if(S===0||S===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(C))return!1;C.charCodeAt(C.length-1)===58?c.push(C.charCodeAt(0)===58?"center":"right"):C.charCodeAt(0)===58?c.push("left"):c.push("")}if(u=xb(n,e).trim(),u.indexOf("|")===-1||n.sCount[e]-n.blkIndent>=4)return!1;l=qR(u),l.length&&l[0]===""&&l.shift(),l.length&&l[l.length-1]===""&&l.pop();const f=l.length;if(f===0||f!==c.length)return!1;if(r)return!0;const d=n.parentType;n.parentType="table";const g=n.md.block.ruler.getRules("blockquote"),m=n.push("table_open","table",1),y=[e,0];m.map=y;const b=n.push("thead_open","thead",1);b.map=[e,e+1];const w=n.push("tr_open","tr",1);w.map=[e,e+1];for(let S=0;S<l.length;S++){const C=n.push("th_open","th",1);c[S]&&(C.attrs=[["style","text-align:"+c[S]]]);const A=n.push("inline","",0);A.content=l[S].trim(),A.children=[],n.push("th_close","th",-1)}n.push("tr_close","tr",-1),n.push("thead_close","thead",-1);let x,_=0;for(i=e+2;i<t&&!(n.sCount[i]<n.blkIndent);i++){let S=!1;for(let A=0,I=g.length;A<I;A++)if(g[A](n,i,t,!0)){S=!0;break}if(S||(u=xb(n,i).trim(),!u)||n.sCount[i]-n.blkIndent>=4||(l=qR(u),l.length&&l[0]===""&&l.shift(),l.length&&l[l.length-1]===""&&l.pop(),_+=f-l.length,_>HX))break;if(i===e+2){const A=n.push("tbody_open","tbody",1);A.map=x=[e+2,0]}const C=n.push("tr_open","tr",1);C.map=[i,i+1];for(let A=0;A<f;A++){const I=n.push("td_open","td",1);c[A]&&(I.attrs=[["style","text-align:"+c[A]]]);const W=n.push("inline","",0);W.content=l[A]?l[A].trim():"",W.children=[],n.push("td_close","td",-1)}n.push("tr_close","tr",-1)}return x&&(n.push("tbody_close","tbody",-1),x[1]=i),n.push("table_close","table",-1),y[1]=i,n.parentType=d,n.line=i,!0}function GX(n,e,t){if(n.sCount[e]-n.blkIndent<4)return!1;let r=e+1,i=r;for(;r<t;){if(n.isEmpty(r)){r++;continue}if(n.sCount[r]-n.blkIndent>=4){r++,i=r;continue}break}n.line=i;const s=n.push("code_block","code",0);return s.content=n.getLines(e,i,4+n.blkIndent,!1)+`
|
|
166
|
-
`,s.map=[e,n.line],!0}function KX(n,e,t,r){let i=n.bMarks[e]+n.tShift[e],s=n.eMarks[e];if(n.sCount[e]-n.blkIndent>=4||i+3>s)return!1;const o=n.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let a=i;i=n.skipChars(i,o);let u=i-a;if(u<3)return!1;const l=n.src.slice(a,i),c=n.src.slice(i,s);if(o===96&&c.indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;let f=e,d=!1;for(;f++,!(f>=t||(i=a=n.bMarks[f]+n.tShift[f],s=n.eMarks[f],i<s&&n.sCount[f]<n.blkIndent));)if(n.src.charCodeAt(i)===o&&!(n.sCount[f]-n.blkIndent>=4)&&(i=n.skipChars(i,o),!(i-a<u)&&(i=n.skipSpaces(i),!(i<s)))){d=!0;break}u=n.sCount[e],n.line=f+(d?1:0);const g=n.push("fence","code",0);return g.info=c,g.content=n.getLines(e+1,f,u,!0),g.markup=l,g.map=[e,n.line],!0}function ZX(n,e,t,r){let i=n.bMarks[e]+n.tShift[e],s=n.eMarks[e];const o=n.lineMax;if(n.sCount[e]-n.blkIndent>=4||n.src.charCodeAt(i)!==62)return!1;if(r)return!0;const a=[],u=[],l=[],c=[],f=n.md.block.ruler.getRules("blockquote"),d=n.parentType;n.parentType="blockquote";let g=!1,m;for(m=e;m<t;m++){const _=n.sCount[m]<n.blkIndent;if(i=n.bMarks[m]+n.tShift[m],s=n.eMarks[m],i>=s)break;if(n.src.charCodeAt(i++)===62&&!_){let C=n.sCount[m]+1,A,I;n.src.charCodeAt(i)===32?(i++,C++,I=!1,A=!0):n.src.charCodeAt(i)===9?(A=!0,(n.bsCount[m]+C)%4===3?(i++,C++,I=!1):I=!0):A=!1;let W=C;for(a.push(n.bMarks[m]),n.bMarks[m]=i;i<s;){const B=n.src.charCodeAt(i);if(Kt(B))B===9?W+=4-(W+n.bsCount[m]+(I?1:0))%4:W++;else break;i++}g=i>=s,u.push(n.bsCount[m]),n.bsCount[m]=n.sCount[m]+1+(A?1:0),l.push(n.sCount[m]),n.sCount[m]=W-C,c.push(n.tShift[m]),n.tShift[m]=i-n.bMarks[m];continue}if(g)break;let S=!1;for(let C=0,A=f.length;C<A;C++)if(f[C](n,m,t,!0)){S=!0;break}if(S){n.lineMax=m,n.blkIndent!==0&&(a.push(n.bMarks[m]),u.push(n.bsCount[m]),c.push(n.tShift[m]),l.push(n.sCount[m]),n.sCount[m]-=n.blkIndent);break}a.push(n.bMarks[m]),u.push(n.bsCount[m]),c.push(n.tShift[m]),l.push(n.sCount[m]),n.sCount[m]=-1}const y=n.blkIndent;n.blkIndent=0;const b=n.push("blockquote_open","blockquote",1);b.markup=">";const w=[e,0];b.map=w,n.md.block.tokenize(n,e,m);const x=n.push("blockquote_close","blockquote",-1);x.markup=">",n.lineMax=o,n.parentType=d,w[1]=n.line;for(let _=0;_<c.length;_++)n.bMarks[_+e]=a[_],n.tShift[_+e]=c[_],n.sCount[_+e]=l[_],n.bsCount[_+e]=u[_];return n.blkIndent=y,!0}function XX(n,e,t,r){const i=n.eMarks[e];if(n.sCount[e]-n.blkIndent>=4)return!1;let s=n.bMarks[e]+n.tShift[e];const o=n.src.charCodeAt(s++);if(o!==42&&o!==45&&o!==95)return!1;let a=1;for(;s<i;){const l=n.src.charCodeAt(s++);if(l!==o&&!Kt(l))return!1;l===o&&a++}if(a<3)return!1;if(r)return!0;n.line=e+1;const u=n.push("hr","hr",0);return u.map=[e,n.line],u.markup=Array(a+1).join(String.fromCharCode(o)),!0}function WR(n,e){const t=n.eMarks[e];let r=n.bMarks[e]+n.tShift[e];const i=n.src.charCodeAt(r++);if(i!==42&&i!==45&&i!==43)return-1;if(r<t){const s=n.src.charCodeAt(r);if(!Kt(s))return-1}return r}function jR(n,e){const t=n.bMarks[e]+n.tShift[e],r=n.eMarks[e];let i=t;if(i+1>=r)return-1;let s=n.src.charCodeAt(i++);if(s<48||s>57)return-1;for(;;){if(i>=r)return-1;if(s=n.src.charCodeAt(i++),s>=48&&s<=57){if(i-t>=10)return-1;continue}if(s===41||s===46)break;return-1}return i<r&&(s=n.src.charCodeAt(i),!Kt(s))?-1:i}function YX(n,e){const t=n.level+2;for(let r=e+2,i=n.tokens.length-2;r<i;r++)n.tokens[r].level===t&&n.tokens[r].type==="paragraph_open"&&(n.tokens[r+2].hidden=!0,n.tokens[r].hidden=!0,r+=2)}function JX(n,e,t,r){let i,s,o,a,u=e,l=!0;if(n.sCount[u]-n.blkIndent>=4||n.listIndent>=0&&n.sCount[u]-n.listIndent>=4&&n.sCount[u]<n.blkIndent)return!1;let c=!1;r&&n.parentType==="paragraph"&&n.sCount[u]>=n.blkIndent&&(c=!0);let f,d,g;if((g=jR(n,u))>=0){if(f=!0,o=n.bMarks[u]+n.tShift[u],d=Number(n.src.slice(o,g-1)),c&&d!==1)return!1}else if((g=WR(n,u))>=0)f=!1;else return!1;if(c&&n.skipSpaces(g)>=n.eMarks[u])return!1;if(r)return!0;const m=n.src.charCodeAt(g-1),y=n.tokens.length;f?(a=n.push("ordered_list_open","ol",1),d!==1&&(a.attrs=[["start",d]])):a=n.push("bullet_list_open","ul",1);const b=[u,0];a.map=b,a.markup=String.fromCharCode(m);let w=!1;const x=n.md.block.ruler.getRules("list"),_=n.parentType;for(n.parentType="list";u<t;){s=g,i=n.eMarks[u];const S=n.sCount[u]+g-(n.bMarks[u]+n.tShift[u]);let C=S;for(;s<i;){const q=n.src.charCodeAt(s);if(q===9)C+=4-(C+n.bsCount[u])%4;else if(q===32)C++;else break;s++}const A=s;let I;A>=i?I=1:I=C-S,I>4&&(I=1);const W=S+I;a=n.push("list_item_open","li",1),a.markup=String.fromCharCode(m);const B=[u,0];a.map=B,f&&(a.info=n.src.slice(o,g-1));const K=n.tight,G=n.tShift[u],F=n.sCount[u],R=n.listIndent;if(n.listIndent=n.blkIndent,n.blkIndent=W,n.tight=!0,n.tShift[u]=A-n.bMarks[u],n.sCount[u]=C,A>=i&&n.isEmpty(u+1)?n.line=Math.min(n.line+2,t):n.md.block.tokenize(n,u,t,!0),(!n.tight||w)&&(l=!1),w=n.line-u>1&&n.isEmpty(n.line-1),n.blkIndent=n.listIndent,n.listIndent=R,n.tShift[u]=G,n.sCount[u]=F,n.tight=K,a=n.push("list_item_close","li",-1),a.markup=String.fromCharCode(m),u=n.line,B[1]=u,u>=t||n.sCount[u]<n.blkIndent||n.sCount[u]-n.blkIndent>=4)break;let Y=!1;for(let q=0,te=x.length;q<te;q++)if(x[q](n,u,t,!0)){Y=!0;break}if(Y)break;if(f){if(g=jR(n,u),g<0)break;o=n.bMarks[u]+n.tShift[u]}else if(g=WR(n,u),g<0)break;if(m!==n.src.charCodeAt(g-1))break}return f?a=n.push("ordered_list_close","ol",-1):a=n.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(m),b[1]=u,n.line=u,n.parentType=_,l&&YX(n,y),!0}function QX(n,e,t,r){let i=n.bMarks[e]+n.tShift[e],s=n.eMarks[e],o=e+1;if(n.sCount[e]-n.blkIndent>=4||n.src.charCodeAt(i)!==91)return!1;function a(x){const _=n.lineMax;if(x>=_||n.isEmpty(x))return null;let S=!1;if(n.sCount[x]-n.blkIndent>3&&(S=!0),n.sCount[x]<0&&(S=!0),!S){const I=n.md.block.ruler.getRules("reference"),W=n.parentType;n.parentType="reference";let B=!1;for(let K=0,G=I.length;K<G;K++)if(I[K](n,x,_,!0)){B=!0;break}if(n.parentType=W,B)return null}const C=n.bMarks[x]+n.tShift[x],A=n.eMarks[x];return n.src.slice(C,A+1)}let u=n.src.slice(i,s+1);s=u.length;let l=-1;for(i=1;i<s;i++){const x=u.charCodeAt(i);if(x===91)return!1;if(x===93){l=i;break}else if(x===10){const _=a(o);_!==null&&(u+=_,s=u.length,o++)}else if(x===92&&(i++,i<s&&u.charCodeAt(i)===10)){const _=a(o);_!==null&&(u+=_,s=u.length,o++)}}if(l<0||u.charCodeAt(l+1)!==58)return!1;for(i=l+2;i<s;i++){const x=u.charCodeAt(i);if(x===10){const _=a(o);_!==null&&(u+=_,s=u.length,o++)}else if(!Kt(x))break}const c=n.md.helpers.parseLinkDestination(u,i,s);if(!c.ok)return!1;const f=n.md.normalizeLink(c.str);if(!n.md.validateLink(f))return!1;i=c.pos;const d=i,g=o,m=i;for(;i<s;i++){const x=u.charCodeAt(i);if(x===10){const _=a(o);_!==null&&(u+=_,s=u.length,o++)}else if(!Kt(x))break}let y=n.md.helpers.parseLinkTitle(u,i,s);for(;y.can_continue;){const x=a(o);if(x===null)break;u+=x,i=s,s=u.length,o++,y=n.md.helpers.parseLinkTitle(u,i,s,y)}let b;for(i<s&&m!==i&&y.ok?(b=y.str,i=y.pos):(b="",i=d,o=g);i<s;){const x=u.charCodeAt(i);if(!Kt(x))break;i++}if(i<s&&u.charCodeAt(i)!==10&&b)for(b="",i=d,o=g;i<s;){const x=u.charCodeAt(i);if(!Kt(x))break;i++}if(i<s&&u.charCodeAt(i)!==10)return!1;const w=ty(u.slice(1,l));return w?(r||(typeof n.env.references>"u"&&(n.env.references={}),typeof n.env.references[w]>"u"&&(n.env.references[w]={title:b,href:f}),n.line=o),!0):!1}const eY=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],tY="[a-zA-Z_:][a-zA-Z0-9:._-]*",nY="[^\"'=<>`\\x00-\\x20]+",rY="'[^']*'",iY='"[^"]*"',sY="(?:"+nY+"|"+rY+"|"+iY+")",oY="(?:\\s+"+tY+"(?:\\s*=\\s*"+sY+")?)",VP="<[A-Za-z][A-Za-z0-9\\-]*"+oY+"*\\s*\\/?>",GP="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",aY="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",uY="<[?][\\s\\S]*?[?]>",lY="<![A-Za-z][^>]*>",cY="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",fY=new RegExp("^(?:"+VP+"|"+GP+"|"+aY+"|"+uY+"|"+lY+"|"+cY+")"),hY=new RegExp("^(?:"+VP+"|"+GP+")"),rc=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+eY.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(hY.source+"\\s*$"),/^$/,!1]];function dY(n,e,t,r){let i=n.bMarks[e]+n.tShift[e],s=n.eMarks[e];if(n.sCount[e]-n.blkIndent>=4||!n.md.options.html||n.src.charCodeAt(i)!==60)return!1;let o=n.src.slice(i,s),a=0;for(;a<rc.length&&!rc[a][0].test(o);a++);if(a===rc.length)return!1;if(r)return rc[a][2];let u=e+1;if(!rc[a][1].test(o)){for(;u<t&&!(n.sCount[u]<n.blkIndent);u++)if(i=n.bMarks[u]+n.tShift[u],s=n.eMarks[u],o=n.src.slice(i,s),rc[a][1].test(o)){o.length!==0&&u++;break}}n.line=u;const l=n.push("html_block","",0);return l.map=[e,u],l.content=n.getLines(e,u,n.blkIndent,!0),!0}function pY(n,e,t,r){let i=n.bMarks[e]+n.tShift[e],s=n.eMarks[e];if(n.sCount[e]-n.blkIndent>=4)return!1;let o=n.src.charCodeAt(i);if(o!==35||i>=s)return!1;let a=1;for(o=n.src.charCodeAt(++i);o===35&&i<s&&a<=6;)a++,o=n.src.charCodeAt(++i);if(a>6||i<s&&!Kt(o))return!1;if(r)return!0;s=n.skipSpacesBack(s,i);const u=n.skipCharsBack(s,35,i);u>i&&Kt(n.src.charCodeAt(u-1))&&(s=u),n.line=e+1;const l=n.push("heading_open","h"+String(a),1);l.markup="########".slice(0,a),l.map=[e,n.line];const c=n.push("inline","",0);c.content=n.src.slice(i,s).trim(),c.map=[e,n.line],c.children=[];const f=n.push("heading_close","h"+String(a),-1);return f.markup="########".slice(0,a),!0}function gY(n,e,t){const r=n.md.block.ruler.getRules("paragraph");if(n.sCount[e]-n.blkIndent>=4)return!1;const i=n.parentType;n.parentType="paragraph";let s=0,o,a=e+1;for(;a<t&&!n.isEmpty(a);a++){if(n.sCount[a]-n.blkIndent>3)continue;if(n.sCount[a]>=n.blkIndent){let g=n.bMarks[a]+n.tShift[a];const m=n.eMarks[a];if(g<m&&(o=n.src.charCodeAt(g),(o===45||o===61)&&(g=n.skipChars(g,o),g=n.skipSpaces(g),g>=m))){s=o===61?1:2;break}}if(n.sCount[a]<0)continue;let d=!1;for(let g=0,m=r.length;g<m;g++)if(r[g](n,a,t,!0)){d=!0;break}if(d)break}if(!s)return!1;const u=n.getLines(e,a,n.blkIndent,!1).trim();n.line=a+1;const l=n.push("heading_open","h"+String(s),1);l.markup=String.fromCharCode(o),l.map=[e,n.line];const c=n.push("inline","",0);c.content=u,c.map=[e,n.line-1],c.children=[];const f=n.push("heading_close","h"+String(s),-1);return f.markup=String.fromCharCode(o),n.parentType=i,!0}function mY(n,e,t){const r=n.md.block.ruler.getRules("paragraph"),i=n.parentType;let s=e+1;for(n.parentType="paragraph";s<t&&!n.isEmpty(s);s++){if(n.sCount[s]-n.blkIndent>3||n.sCount[s]<0)continue;let l=!1;for(let c=0,f=r.length;c<f;c++)if(r[c](n,s,t,!0)){l=!0;break}if(l)break}const o=n.getLines(e,s,n.blkIndent,!1).trim();n.line=s;const a=n.push("paragraph_open","p",1);a.map=[e,n.line];const u=n.push("inline","",0);return u.content=o,u.map=[e,n.line],u.children=[],n.push("paragraph_close","p",-1),n.parentType=i,!0}const f0=[["table",VX,["paragraph","reference"]],["code",GX],["fence",KX,["paragraph","reference","blockquote","list"]],["blockquote",ZX,["paragraph","reference","blockquote","list"]],["hr",XX,["paragraph","reference","blockquote","list"]],["list",JX,["paragraph","reference","blockquote"]],["reference",QX],["html_block",dY,["paragraph","reference","blockquote"]],["heading",pY,["paragraph","reference","blockquote"]],["lheading",gY],["paragraph",mY]];function ny(){this.ruler=new pi;for(let n=0;n<f0.length;n++)this.ruler.push(f0[n][0],f0[n][1],{alt:(f0[n][2]||[]).slice()})}ny.prototype.tokenize=function(n,e,t){const r=this.ruler.getRules(""),i=r.length,s=n.md.options.maxNesting;let o=e,a=!1;for(;o<t&&(n.line=o=n.skipEmptyLines(o),!(o>=t||n.sCount[o]<n.blkIndent));){if(n.level>=s){n.line=t;break}const u=n.line;let l=!1;for(let c=0;c<i;c++)if(l=r[c](n,o,t,!1),l){if(u>=n.line)throw new Error("block rule didn't increment state.line");break}if(!l)throw new Error("none of the block rules matched");n.tight=!a,n.isEmpty(n.line-1)&&(a=!0),o=n.line,o<t&&n.isEmpty(o)&&(a=!0,o++,n.line=o)}};ny.prototype.parse=function(n,e,t,r){if(!n)return;const i=new this.State(n,e,t,r);this.tokenize(i,i.line,i.lineMax)};ny.prototype.State=Ao;function mp(n,e,t,r){this.src=n,this.env=t,this.md=e,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}mp.prototype.pushPending=function(){const n=new Ls("text","",0);return n.content=this.pending,n.level=this.pendingLevel,this.tokens.push(n),this.pending="",n};mp.prototype.push=function(n,e,t){this.pending&&this.pushPending();const r=new Ls(n,e,t);let i=null;return t<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,t>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r};mp.prototype.scanDelims=function(n,e){const t=this.posMax,r=this.src.charCodeAt(n),i=n>0?this.src.charCodeAt(n-1):32;let s=n;for(;s<t&&this.src.charCodeAt(s)===r;)s++;const o=s-n,a=s<t?this.src.charCodeAt(s):32,u=Ud(i)||zd(String.fromCharCode(i)),l=Ud(a)||zd(String.fromCharCode(a)),c=$d(i),f=$d(a),d=!f&&(!l||c||u),g=!c&&(!u||f||l);return{can_open:d&&(e||!g||u),can_close:g&&(e||!d||l),length:o}};mp.prototype.Token=Ls;function yY(n){switch(n){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function vY(n,e){let t=n.pos;for(;t<n.posMax&&!yY(n.src.charCodeAt(t));)t++;return t===n.pos?!1:(e||(n.pending+=n.src.slice(n.pos,t)),n.pos=t,!0)}const bY=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function wY(n,e){if(!n.md.options.linkify||n.linkLevel>0)return!1;const t=n.pos,r=n.posMax;if(t+3>r||n.src.charCodeAt(t)!==58||n.src.charCodeAt(t+1)!==47||n.src.charCodeAt(t+2)!==47)return!1;const i=n.pending.match(bY);if(!i)return!1;const s=i[1],o=n.md.linkify.matchAtStart(n.src.slice(t-s.length));if(!o)return!1;let a=o.url;if(a.length<=s.length)return!1;a=a.replace(/\*+$/,"");const u=n.md.normalizeLink(a);if(!n.md.validateLink(u))return!1;if(!e){n.pending=n.pending.slice(0,-s.length);const l=n.push("link_open","a",1);l.attrs=[["href",u]],l.markup="linkify",l.info="auto";const c=n.push("text","",0);c.content=n.md.normalizeLinkText(a);const f=n.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return n.pos+=a.length-s.length,!0}function _Y(n,e){let t=n.pos;if(n.src.charCodeAt(t)!==10)return!1;const r=n.pending.length-1,i=n.posMax;if(!e)if(r>=0&&n.pending.charCodeAt(r)===32)if(r>=1&&n.pending.charCodeAt(r-1)===32){let s=r-1;for(;s>=1&&n.pending.charCodeAt(s-1)===32;)s--;n.pending=n.pending.slice(0,s),n.push("hardbreak","br",0)}else n.pending=n.pending.slice(0,-1),n.push("softbreak","br",0);else n.push("softbreak","br",0);for(t++;t<i&&Kt(n.src.charCodeAt(t));)t++;return n.pos=t,!0}const lx=[];for(let n=0;n<256;n++)lx.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(n){lx[n.charCodeAt(0)]=1});function kY(n,e){let t=n.pos;const r=n.posMax;if(n.src.charCodeAt(t)!==92||(t++,t>=r))return!1;let i=n.src.charCodeAt(t);if(i===10){for(e||n.push("hardbreak","br",0),t++;t<r&&(i=n.src.charCodeAt(t),!!Kt(i));)t++;return n.pos=t,!0}let s=n.src[t];if(i>=55296&&i<=56319&&t+1<r){const a=n.src.charCodeAt(t+1);a>=56320&&a<=57343&&(s+=n.src[t+1],t++)}const o="\\"+s;if(!e){const a=n.push("text_special","",0);i<256&&lx[i]!==0?a.content=s:a.content=o,a.markup=o,a.info="escape"}return n.pos=t+1,!0}function xY(n,e){let t=n.pos;if(n.src.charCodeAt(t)!==96)return!1;const i=t;t++;const s=n.posMax;for(;t<s&&n.src.charCodeAt(t)===96;)t++;const o=n.src.slice(i,t),a=o.length;if(n.backticksScanned&&(n.backticks[a]||0)<=i)return e||(n.pending+=o),n.pos+=a,!0;let u=t,l;for(;(l=n.src.indexOf("`",u))!==-1;){for(u=l+1;u<s&&n.src.charCodeAt(u)===96;)u++;const c=u-l;if(c===a){if(!e){const f=n.push("code_inline","code",0);f.markup=o,f.content=n.src.slice(t,l).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return n.pos=u,!0}n.backticks[c]=l}return n.backticksScanned=!0,e||(n.pending+=o),n.pos+=a,!0}function SY(n,e){const t=n.pos,r=n.src.charCodeAt(t);if(e||r!==126)return!1;const i=n.scanDelims(n.pos,!0);let s=i.length;const o=String.fromCharCode(r);if(s<2)return!1;let a;s%2&&(a=n.push("text","",0),a.content=o,s--);for(let u=0;u<s;u+=2)a=n.push("text","",0),a.content=o+o,n.delimiters.push({marker:r,length:0,token:n.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return n.pos+=i.length,!0}function $R(n,e){let t;const r=[],i=e.length;for(let s=0;s<i;s++){const o=e[s];if(o.marker!==126||o.end===-1)continue;const a=e[o.end];t=n.tokens[o.token],t.type="s_open",t.tag="s",t.nesting=1,t.markup="~~",t.content="",t=n.tokens[a.token],t.type="s_close",t.tag="s",t.nesting=-1,t.markup="~~",t.content="",n.tokens[a.token-1].type==="text"&&n.tokens[a.token-1].content==="~"&&r.push(a.token-1)}for(;r.length;){const s=r.pop();let o=s+1;for(;o<n.tokens.length&&n.tokens[o].type==="s_close";)o++;o--,s!==o&&(t=n.tokens[o],n.tokens[o]=n.tokens[s],n.tokens[s]=t)}}function CY(n){const e=n.tokens_meta,t=n.tokens_meta.length;$R(n,n.delimiters);for(let r=0;r<t;r++)e[r]&&e[r].delimiters&&$R(n,e[r].delimiters)}const KP={tokenize:SY,postProcess:CY};function EY(n,e){const t=n.pos,r=n.src.charCodeAt(t);if(e||r!==95&&r!==42)return!1;const i=n.scanDelims(n.pos,r===42);for(let s=0;s<i.length;s++){const o=n.push("text","",0);o.content=String.fromCharCode(r),n.delimiters.push({marker:r,length:i.length,token:n.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return n.pos+=i.length,!0}function zR(n,e){const t=e.length;for(let r=t-1;r>=0;r--){const i=e[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const s=e[i.end],o=r>0&&e[r-1].end===i.end+1&&e[r-1].marker===i.marker&&e[r-1].token===i.token-1&&e[i.end+1].token===s.token+1,a=String.fromCharCode(i.marker),u=n.tokens[i.token];u.type=o?"strong_open":"em_open",u.tag=o?"strong":"em",u.nesting=1,u.markup=o?a+a:a,u.content="";const l=n.tokens[s.token];l.type=o?"strong_close":"em_close",l.tag=o?"strong":"em",l.nesting=-1,l.markup=o?a+a:a,l.content="",o&&(n.tokens[e[r-1].token].content="",n.tokens[e[i.end+1].token].content="",r--)}}function AY(n){const e=n.tokens_meta,t=n.tokens_meta.length;zR(n,n.delimiters);for(let r=0;r<t;r++)e[r]&&e[r].delimiters&&zR(n,e[r].delimiters)}const ZP={tokenize:EY,postProcess:AY};function RY(n,e){let t,r,i,s,o="",a="",u=n.pos,l=!0;if(n.src.charCodeAt(n.pos)!==91)return!1;const c=n.pos,f=n.posMax,d=n.pos+1,g=n.md.helpers.parseLinkLabel(n,n.pos,!0);if(g<0)return!1;let m=g+1;if(m<f&&n.src.charCodeAt(m)===40){for(l=!1,m++;m<f&&(t=n.src.charCodeAt(m),!(!Kt(t)&&t!==10));m++);if(m>=f)return!1;if(u=m,i=n.md.helpers.parseLinkDestination(n.src,m,n.posMax),i.ok){for(o=n.md.normalizeLink(i.str),n.md.validateLink(o)?m=i.pos:o="",u=m;m<f&&(t=n.src.charCodeAt(m),!(!Kt(t)&&t!==10));m++);if(i=n.md.helpers.parseLinkTitle(n.src,m,n.posMax),m<f&&u!==m&&i.ok)for(a=i.str,m=i.pos;m<f&&(t=n.src.charCodeAt(m),!(!Kt(t)&&t!==10));m++);}(m>=f||n.src.charCodeAt(m)!==41)&&(l=!0),m++}if(l){if(typeof n.env.references>"u")return!1;if(m<f&&n.src.charCodeAt(m)===91?(u=m+1,m=n.md.helpers.parseLinkLabel(n,m),m>=0?r=n.src.slice(u,m++):m=g+1):m=g+1,r||(r=n.src.slice(d,g)),s=n.env.references[ty(r)],!s)return n.pos=c,!1;o=s.href,a=s.title}if(!e){n.pos=d,n.posMax=g;const y=n.push("link_open","a",1),b=[["href",o]];y.attrs=b,a&&b.push(["title",a]),n.linkLevel++,n.md.inline.tokenize(n),n.linkLevel--,n.push("link_close","a",-1)}return n.pos=m,n.posMax=f,!0}function DY(n,e){let t,r,i,s,o,a,u,l,c="";const f=n.pos,d=n.posMax;if(n.src.charCodeAt(n.pos)!==33||n.src.charCodeAt(n.pos+1)!==91)return!1;const g=n.pos+2,m=n.md.helpers.parseLinkLabel(n,n.pos+1,!1);if(m<0)return!1;if(s=m+1,s<d&&n.src.charCodeAt(s)===40){for(s++;s<d&&(t=n.src.charCodeAt(s),!(!Kt(t)&&t!==10));s++);if(s>=d)return!1;for(l=s,a=n.md.helpers.parseLinkDestination(n.src,s,n.posMax),a.ok&&(c=n.md.normalizeLink(a.str),n.md.validateLink(c)?s=a.pos:c=""),l=s;s<d&&(t=n.src.charCodeAt(s),!(!Kt(t)&&t!==10));s++);if(a=n.md.helpers.parseLinkTitle(n.src,s,n.posMax),s<d&&l!==s&&a.ok)for(u=a.str,s=a.pos;s<d&&(t=n.src.charCodeAt(s),!(!Kt(t)&&t!==10));s++);else u="";if(s>=d||n.src.charCodeAt(s)!==41)return n.pos=f,!1;s++}else{if(typeof n.env.references>"u")return!1;if(s<d&&n.src.charCodeAt(s)===91?(l=s+1,s=n.md.helpers.parseLinkLabel(n,s),s>=0?i=n.src.slice(l,s++):s=m+1):s=m+1,i||(i=n.src.slice(g,m)),o=n.env.references[ty(i)],!o)return n.pos=f,!1;c=o.href,u=o.title}if(!e){r=n.src.slice(g,m);const y=[];n.md.inline.parse(r,n.md,n.env,y);const b=n.push("image","img",0),w=[["src",c],["alt",""]];b.attrs=w,b.children=y,b.content=r,u&&w.push(["title",u])}return n.pos=s,n.posMax=d,!0}const TY=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,IY=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function MY(n,e){let t=n.pos;if(n.src.charCodeAt(t)!==60)return!1;const r=n.pos,i=n.posMax;for(;;){if(++t>=i)return!1;const o=n.src.charCodeAt(t);if(o===60)return!1;if(o===62)break}const s=n.src.slice(r+1,t);if(IY.test(s)){const o=n.md.normalizeLink(s);if(!n.md.validateLink(o))return!1;if(!e){const a=n.push("link_open","a",1);a.attrs=[["href",o]],a.markup="autolink",a.info="auto";const u=n.push("text","",0);u.content=n.md.normalizeLinkText(s);const l=n.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return n.pos+=s.length+2,!0}if(TY.test(s)){const o=n.md.normalizeLink("mailto:"+s);if(!n.md.validateLink(o))return!1;if(!e){const a=n.push("link_open","a",1);a.attrs=[["href",o]],a.markup="autolink",a.info="auto";const u=n.push("text","",0);u.content=n.md.normalizeLinkText(s);const l=n.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return n.pos+=s.length+2,!0}return!1}function OY(n){return/^<a[>\s]/i.test(n)}function PY(n){return/^<\/a\s*>/i.test(n)}function LY(n){const e=n|32;return e>=97&&e<=122}function FY(n,e){if(!n.md.options.html)return!1;const t=n.posMax,r=n.pos;if(n.src.charCodeAt(r)!==60||r+2>=t)return!1;const i=n.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!LY(i))return!1;const s=n.src.slice(r).match(fY);if(!s)return!1;if(!e){const o=n.push("html_inline","",0);o.content=s[0],OY(o.content)&&n.linkLevel++,PY(o.content)&&n.linkLevel--}return n.pos+=s[0].length,!0}const NY=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,BY=/^&([a-z][a-z0-9]{1,31});/i;function qY(n,e){const t=n.pos,r=n.posMax;if(n.src.charCodeAt(t)!==38||t+1>=r)return!1;if(n.src.charCodeAt(t+1)===35){const s=n.src.slice(t).match(NY);if(s){if(!e){const o=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),a=n.push("text_special","",0);a.content=ax(o)?y1(o):y1(65533),a.markup=s[0],a.info="entity"}return n.pos+=s[0].length,!0}}else{const s=n.src.slice(t).match(BY);if(s){const o=jP(s[0]);if(o!==s[0]){if(!e){const a=n.push("text_special","",0);a.content=o,a.markup=s[0],a.info="entity"}return n.pos+=s[0].length,!0}}}return!1}function UR(n){const e={},t=n.length;if(!t)return;let r=0,i=-2;const s=[];for(let o=0;o<t;o++){const a=n[o];if(s.push(0),(n[r].marker!==a.marker||i!==a.token-1)&&(r=o),i=a.token,a.length=a.length||0,!a.close)continue;e.hasOwnProperty(a.marker)||(e[a.marker]=[-1,-1,-1,-1,-1,-1]);const u=e[a.marker][(a.open?3:0)+a.length%3];let l=r-s[r]-1,c=l;for(;l>u;l-=s[l]+1){const f=n[l];if(f.marker===a.marker&&f.open&&f.end<0){let d=!1;if((f.close||a.open)&&(f.length+a.length)%3===0&&(f.length%3!==0||a.length%3!==0)&&(d=!0),!d){const g=l>0&&!n[l-1].open?s[l-1]+1:0;s[o]=o-l+g,s[l]=g,a.open=!1,f.end=o,f.close=!1,c=-1,i=-2;break}}}c!==-1&&(e[a.marker][(a.open?3:0)+(a.length||0)%3]=c)}}function WY(n){const e=n.tokens_meta,t=n.tokens_meta.length;UR(n.delimiters);for(let r=0;r<t;r++)e[r]&&e[r].delimiters&&UR(e[r].delimiters)}function jY(n){let e,t,r=0;const i=n.tokens,s=n.tokens.length;for(e=t=0;e<s;e++)i[e].nesting<0&&r--,i[e].level=r,i[e].nesting>0&&r++,i[e].type==="text"&&e+1<s&&i[e+1].type==="text"?i[e+1].content=i[e].content+i[e+1].content:(e!==t&&(i[t]=i[e]),t++);e!==t&&(i.length=t)}const Sb=[["text",vY],["linkify",wY],["newline",_Y],["escape",kY],["backticks",xY],["strikethrough",KP.tokenize],["emphasis",ZP.tokenize],["link",RY],["image",DY],["autolink",MY],["html_inline",FY],["entity",qY]],Cb=[["balance_pairs",WY],["strikethrough",KP.postProcess],["emphasis",ZP.postProcess],["fragments_join",jY]];function yp(){this.ruler=new pi;for(let n=0;n<Sb.length;n++)this.ruler.push(Sb[n][0],Sb[n][1]);this.ruler2=new pi;for(let n=0;n<Cb.length;n++)this.ruler2.push(Cb[n][0],Cb[n][1])}yp.prototype.skipToken=function(n){const e=n.pos,t=this.ruler.getRules(""),r=t.length,i=n.md.options.maxNesting,s=n.cache;if(typeof s[e]<"u"){n.pos=s[e];return}let o=!1;if(n.level<i){for(let a=0;a<r;a++)if(n.level++,o=t[a](n,!0),n.level--,o){if(e>=n.pos)throw new Error("inline rule didn't increment state.pos");break}}else n.pos=n.posMax;o||n.pos++,s[e]=n.pos};yp.prototype.tokenize=function(n){const e=this.ruler.getRules(""),t=e.length,r=n.posMax,i=n.md.options.maxNesting;for(;n.pos<r;){const s=n.pos;let o=!1;if(n.level<i){for(let a=0;a<t;a++)if(o=e[a](n,!1),o){if(s>=n.pos)throw new Error("inline rule didn't increment state.pos");break}}if(o){if(n.pos>=r)break;continue}n.pending+=n.src[n.pos++]}n.pending&&n.pushPending()};yp.prototype.parse=function(n,e,t,r){const i=new this.State(n,e,t,r);this.tokenize(i);const s=this.ruler2.getRules(""),o=s.length;for(let a=0;a<o;a++)s[a](i)};yp.prototype.State=mp;function $Y(n){const e={};n=n||{},e.src_Any=FP.source,e.src_Cc=NP.source,e.src_Z=qP.source,e.src_P=sx.source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");const t="[><|]";return e.src_pseudo_letter="(?:(?!"+t+"|"+e.src_ZPCc+")"+e.src_Any+")",e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|"+t+"|"+e.src_ZPCc+")(?!"+(n["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|"+t+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+e.src_ZCc+"|[.]|$)|"+(n["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+e.src_ZCc+"|$)|;(?!"+e.src_ZCc+"|$)|\\!+(?!"+e.src_ZCc+"|[!]|$)|\\?(?!"+e.src_ZCc+"|[?]|$))+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy="(^|"+t+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}function m2(n){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(r){n[r]=t[r]})}),n}function ry(n){return Object.prototype.toString.call(n)}function zY(n){return ry(n)==="[object String]"}function UY(n){return ry(n)==="[object Object]"}function HY(n){return ry(n)==="[object RegExp]"}function HR(n){return ry(n)==="[object Function]"}function VY(n){return n.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const XP={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function GY(n){return Object.keys(n||{}).reduce(function(e,t){return e||XP.hasOwnProperty(t)},!1)}const KY={"http:":{validate:function(n,e,t){const r=n.slice(e);return t.re.http||(t.re.http=new RegExp("^\\/\\/"+t.re.src_auth+t.re.src_host_port_strict+t.re.src_path,"i")),t.re.http.test(r)?r.match(t.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(n,e,t){const r=n.slice(e);return t.re.no_http||(t.re.no_http=new RegExp("^"+t.re.src_auth+"(?:localhost|(?:(?:"+t.re.src_domain+")\\.)+"+t.re.src_domain_root+")"+t.re.src_port+t.re.src_host_terminator+t.re.src_path,"i")),t.re.no_http.test(r)?e>=3&&n[e-3]===":"||e>=3&&n[e-3]==="/"?0:r.match(t.re.no_http)[0].length:0}},"mailto:":{validate:function(n,e,t){const r=n.slice(e);return t.re.mailto||(t.re.mailto=new RegExp("^"+t.re.src_email_name+"@"+t.re.src_host_strict,"i")),t.re.mailto.test(r)?r.match(t.re.mailto)[0].length:0}}},ZY="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",XY="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function YY(n){n.__index__=-1,n.__text_cache__=""}function JY(n){return function(e,t){const r=e.slice(t);return n.test(r)?r.match(n)[0].length:0}}function VR(){return function(n,e){e.normalize(n)}}function v1(n){const e=n.re=$Y(n.__opts__),t=n.__tlds__.slice();n.onCompile(),n.__tlds_replaced__||t.push(ZY),t.push(e.src_xn),e.src_tlds=t.join("|");function r(a){return a.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");const i=[];n.__compiled__={};function s(a,u){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+u)}Object.keys(n.__schemas__).forEach(function(a){const u=n.__schemas__[a];if(u===null)return;const l={validate:null,link:null};if(n.__compiled__[a]=l,UY(u)){HY(u.validate)?l.validate=JY(u.validate):HR(u.validate)?l.validate=u.validate:s(a,u),HR(u.normalize)?l.normalize=u.normalize:u.normalize?s(a,u):l.normalize=VR();return}if(zY(u)){i.push(a);return}s(a,u)}),i.forEach(function(a){n.__compiled__[n.__schemas__[a]]&&(n.__compiled__[a].validate=n.__compiled__[n.__schemas__[a]].validate,n.__compiled__[a].normalize=n.__compiled__[n.__schemas__[a]].normalize)}),n.__compiled__[""]={validate:null,normalize:VR()};const o=Object.keys(n.__compiled__).filter(function(a){return a.length>0&&n.__compiled__[a]}).map(VY).join("|");n.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+o+")","i"),n.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+o+")","ig"),n.re.schema_at_start=RegExp("^"+n.re.schema_search.source,"i"),n.re.pretest=RegExp("("+n.re.schema_test.source+")|("+n.re.host_fuzzy_test.source+")|@","i"),YY(n)}function QY(n,e){const t=n.__index__,r=n.__last_index__,i=n.__text_cache__.slice(t,r);this.schema=n.__schema__.toLowerCase(),this.index=t+e,this.lastIndex=r+e,this.raw=i,this.text=i,this.url=i}function y2(n,e){const t=new QY(n,e);return n.__compiled__[t.schema].normalize(t,n),t}function Ii(n,e){if(!(this instanceof Ii))return new Ii(n,e);e||GY(n)&&(e=n,n={}),this.__opts__=m2({},XP,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=m2({},KY,n),this.__compiled__={},this.__tlds__=XY,this.__tlds_replaced__=!1,this.re={},v1(this)}Ii.prototype.add=function(e,t){return this.__schemas__[e]=t,v1(this),this};Ii.prototype.set=function(e){return this.__opts__=m2(this.__opts__,e),this};Ii.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let t,r,i,s,o,a,u,l,c;if(this.re.schema_test.test(e)){for(u=this.re.schema_search,u.lastIndex=0;(t=u.exec(e))!==null;)if(s=this.testSchemaAt(e,t[2],u.lastIndex),s){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+s;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=e.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l<this.__index__)&&(r=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(o=r.index+r[1].length,(this.__index__<0||o<this.__index__)&&(this.__schema__="",this.__index__=o,this.__last_index__=r.index+r[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(c=e.indexOf("@"),c>=0&&(i=e.match(this.re.email_fuzzy))!==null&&(o=i.index+i[1].length,a=i.index+i[0].length,(this.__index__<0||o<this.__index__||o===this.__index__&&a>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=a))),this.__index__>=0};Ii.prototype.pretest=function(e){return this.re.pretest.test(e)};Ii.prototype.testSchemaAt=function(e,t,r){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,r,this):0};Ii.prototype.match=function(e){const t=[];let r=0;this.__index__>=0&&this.__text_cache__===e&&(t.push(y2(this,r)),r=this.__last_index__);let i=r?e.slice(r):e;for(;this.test(i);)t.push(y2(this,r)),i=i.slice(this.__last_index__),r+=this.__last_index__;return t.length?t:null};Ii.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;const t=this.re.schema_at_start.exec(e);if(!t)return null;const r=this.testSchemaAt(e,t[2],t[0].length);return r?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+r,y2(this,0)):null};Ii.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,i,s){return r!==s[i-1]}).reverse(),v1(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,v1(this),this)};Ii.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)};Ii.prototype.onCompile=function(){};const xc=2147483647,ho=36,cx=1,Hd=26,eJ=38,tJ=700,YP=72,JP=128,QP="-",nJ=/^xn--/,rJ=/[^\0-\x7F]/,iJ=/[\x2E\u3002\uFF0E\uFF61]/g,sJ={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Eb=ho-cx,po=Math.floor,Ab=String.fromCharCode;function $a(n){throw new RangeError(sJ[n])}function oJ(n,e){const t=[];let r=n.length;for(;r--;)t[r]=e(n[r]);return t}function e8(n,e){const t=n.split("@");let r="";t.length>1&&(r=t[0]+"@",n=t[1]),n=n.replace(iJ,".");const i=n.split("."),s=oJ(i,e).join(".");return r+s}function t8(n){const e=[];let t=0;const r=n.length;for(;t<r;){const i=n.charCodeAt(t++);if(i>=55296&&i<=56319&&t<r){const s=n.charCodeAt(t++);(s&64512)==56320?e.push(((i&1023)<<10)+(s&1023)+65536):(e.push(i),t--)}else e.push(i)}return e}const aJ=n=>String.fromCodePoint(...n),uJ=function(n){return n>=48&&n<58?26+(n-48):n>=65&&n<91?n-65:n>=97&&n<123?n-97:ho},GR=function(n,e){return n+22+75*(n<26)-((e!=0)<<5)},n8=function(n,e,t){let r=0;for(n=t?po(n/tJ):n>>1,n+=po(n/e);n>Eb*Hd>>1;r+=ho)n=po(n/Eb);return po(r+(Eb+1)*n/(n+eJ))},r8=function(n){const e=[],t=n.length;let r=0,i=JP,s=YP,o=n.lastIndexOf(QP);o<0&&(o=0);for(let a=0;a<o;++a)n.charCodeAt(a)>=128&&$a("not-basic"),e.push(n.charCodeAt(a));for(let a=o>0?o+1:0;a<t;){const u=r;for(let c=1,f=ho;;f+=ho){a>=t&&$a("invalid-input");const d=uJ(n.charCodeAt(a++));d>=ho&&$a("invalid-input"),d>po((xc-r)/c)&&$a("overflow"),r+=d*c;const g=f<=s?cx:f>=s+Hd?Hd:f-s;if(d<g)break;const m=ho-g;c>po(xc/m)&&$a("overflow"),c*=m}const l=e.length+1;s=n8(r-u,l,u==0),po(r/l)>xc-i&&$a("overflow"),i+=po(r/l),r%=l,e.splice(r++,0,i)}return String.fromCodePoint(...e)},i8=function(n){const e=[];n=t8(n);const t=n.length;let r=JP,i=0,s=YP;for(const u of n)u<128&&e.push(Ab(u));const o=e.length;let a=o;for(o&&e.push(QP);a<t;){let u=xc;for(const c of n)c>=r&&c<u&&(u=c);const l=a+1;u-r>po((xc-i)/l)&&$a("overflow"),i+=(u-r)*l,r=u;for(const c of n)if(c<r&&++i>xc&&$a("overflow"),c===r){let f=i;for(let d=ho;;d+=ho){const g=d<=s?cx:d>=s+Hd?Hd:d-s;if(f<g)break;const m=f-g,y=ho-g;e.push(Ab(GR(g+m%y,0))),f=po(m/y)}e.push(Ab(GR(f,0))),s=n8(i,l,a===o),i=0,++a}++i,++r}return e.join("")},lJ=function(n){return e8(n,function(e){return nJ.test(e)?r8(e.slice(4).toLowerCase()):e})},cJ=function(n){return e8(n,function(e){return rJ.test(e)?"xn--"+i8(e):e})},s8={version:"2.3.1",ucs2:{decode:t8,encode:aJ},decode:r8,encode:i8,toASCII:cJ,toUnicode:lJ},fJ={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},hJ={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},dJ={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},pJ={default:fJ,zero:hJ,commonmark:dJ},gJ=/^(vbscript|javascript|file|data):/,mJ=/^data:image\/(gif|png|jpeg|webp);/;function yJ(n){const e=n.trim().toLowerCase();return gJ.test(e)?mJ.test(e):!0}const o8=["http:","https:","mailto:"];function vJ(n){const e=ix(n,!0);if(e.hostname&&(!e.protocol||o8.indexOf(e.protocol)>=0))try{e.hostname=s8.toASCII(e.hostname)}catch{}return gp(rx(e))}function bJ(n){const e=ix(n,!0);if(e.hostname&&(!e.protocol||o8.indexOf(e.protocol)>=0))try{e.hostname=s8.toUnicode(e.hostname)}catch{}return Uc(rx(e),Uc.defaultChars+"%")}function is(n,e){if(!(this instanceof is))return new is(n,e);e||ox(n)||(e=n||{},n="default"),this.inline=new yp,this.block=new ny,this.core=new ux,this.renderer=new sf,this.linkify=new Ii,this.validateLink=yJ,this.normalizeLink=vJ,this.normalizeLinkText=bJ,this.utils=_X,this.helpers=ey({},CX),this.options={},this.configure(n),e&&this.set(e)}is.prototype.set=function(n){return ey(this.options,n),this};is.prototype.configure=function(n){const e=this;if(ox(n)){const t=n;if(n=pJ[t],!n)throw new Error('Wrong `markdown-it` preset "'+t+'", check name')}if(!n)throw new Error("Wrong `markdown-it` preset, can't be empty");return n.options&&e.set(n.options),n.components&&Object.keys(n.components).forEach(function(t){n.components[t].rules&&e[t].ruler.enableOnly(n.components[t].rules),n.components[t].rules2&&e[t].ruler2.enableOnly(n.components[t].rules2)}),this};is.prototype.enable=function(n,e){let t=[];Array.isArray(n)||(n=[n]),["core","block","inline"].forEach(function(i){t=t.concat(this[i].ruler.enable(n,!0))},this),t=t.concat(this.inline.ruler2.enable(n,!0));const r=n.filter(function(i){return t.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};is.prototype.disable=function(n,e){let t=[];Array.isArray(n)||(n=[n]),["core","block","inline"].forEach(function(i){t=t.concat(this[i].ruler.disable(n,!0))},this),t=t.concat(this.inline.ruler2.disable(n,!0));const r=n.filter(function(i){return t.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};is.prototype.use=function(n){const e=[this].concat(Array.prototype.slice.call(arguments,1));return n.apply(n,e),this};is.prototype.parse=function(n,e){if(typeof n!="string")throw new Error("Input data should be a String");const t=new this.core.State(n,this,e);return this.core.process(t),t.tokens};is.prototype.render=function(n,e){return e=e||{},this.renderer.render(this.parse(n,e),this.options,e)};is.prototype.parseInline=function(n,e){const t=new this.core.State(n,this,e);return t.inlineMode=!0,this.core.process(t),t.tokens};is.prototype.renderInline=function(n,e){return e=e||{},this.renderer.render(this.parseInline(n,e),this.options,e)};const KR=new Map,ZR=new Map,XR=new Map;var v2;(n=>{async function e(r,i){let s,o;switch(console.debug("language",{language:r}),r){case"javascript":case"typescript":if(s=ZR.get("javascript"),o=XR.get("javascript"),console.debug("got worker",{worker:o,factory:s}),!s){o=new SharedWorker(new URL("/assets/javascript.worker-C1zGArKk.js",import.meta.url),{type:"module"}),o.port.start(),XR.set("javascript",o);const{createLanguageServer:a}=nx(o.port);s=a,ZR.set("javascript",s)}break}return await s?.(Q1({fs:i})),{worker:o}}n.worker=e;async function t({fs:r,language:i,path:s,view:o}){let a=KR.get(i),u;const l=`file:///${s}`;if(!a){const{worker:c}=await n.worker(i,r);if(!c)return null;console.debug("got worker",{worker:c}),a=new yZ({transport:new PZ(c.port),rootUri:"file:///",workspaceFolders:[{name:"workspace",uri:"file:///"}]})}return KR.set(i,a),u={client:a,extension:[]},u.extension=wZ({client:u.client,documentUri:l,languageId:i,allowHTMLContent:!0,markdownRenderer(c){const f=b1.get(o.state),d=_6[1].find(y=>y.value instanceof Yc)?.value,g=f.language?.parser;return is({highlight:y=>AJ(y,g,d)}).render(c)}}),u}n.client=t})(v2||(v2={}));function h0(n){return"type"in n}function wJ(n){return"score"in n}const Qs=Ve.define(),nd=Tn.define({create(){return[]},update(n,e){for(let t of e.effects)if(t.is(Qs))return t.value;return n}}),YR=(n,e)=>(n%e+e)%e;function Qo(n,e){queueMicrotask(()=>{try{n.dispatch(e)}catch(t){console.error(t)}})}function _J(n){const e=n.toLowerCase();return Object.keys(e1).some(t=>t.toLowerCase()===e||e1[t].toLowerCase()===e)}function kJ(n){const e=n.toLowerCase();return{javascript:"🟨",js:"🟨",typescript:"🔷",ts:"🔷",jsx:"⚛️",tsx:"⚛️",python:"🐍",py:"🐍",ruby:"💎",rb:"💎",php:"🐘",java:"☕",cpp:"⚙️",c:"⚙️",csharp:"🔷",cs:"🔷",go:"🐹",swift:"🦉",kotlin:"🟣",kt:"🟣",rust:"🦀",rs:"🦀",scala:"🔴",vb:"🔵",haskell:"🎭",hs:"🎭",lua:"🌙",perl:"🐪",pl:"🐪",bash:"🐚",shell:"🐚",sh:"🐚",zsh:"🐚",mysql:"🗃️",sql:"🗃️",html:"🌐",css:"🎨",scss:"🎨",less:"🎨",json:"📋",yaml:"⚙️",yml:"⚙️",xml:"📄",toml:"⚙️",ini:"⚙️",conf:"⚙️",log:"📄",env:"🔧",markdown:"📝",md:"📝",dockerfile:"🐳",makefile:"🔨",dockerignore:"🐳",gitignore:"📝"}[e]||"📄"}function JR(n,e,t){const r=[],i=e.state.field(Xa),s=i.path&&!i.loading,o=_J(n),a=t.length>0&&t[0].id===n;if(n.trim()){if(!a){const u={id:o?"Create new file":`Create new file "${n}"`,type:"create-file",icon:o?kJ(n):"📄",query:n,requiresInput:o};r.push(u)}if(s&&!o&&!a){const u={id:`Rename to "${n}"`,type:"rename-file",icon:"✏️",query:n};r.push(u)}}return r}const xJ=n=>{let{filepath:e,language:t,index:r}=n.state.facet(Vd);const i=document.createElement("div");i.className="cm-toolbar-panel";const s=document.createElement("div");s.className="cm-toolbar-state-icon",s.textContent="📄";const o=document.createElement("div");o.className="cm-toolbar-state-icon-container",o.appendChild(s),i.appendChild(o);const a=document.createElement("div");a.className="cm-toolbar-input-container",i.appendChild(a);const u=document.createElement("input");u.type="text",u.value=e||t||"",u.className="cm-toolbar-input",a.appendChild(u);const l=document.createElement("ul");l.className="cm-search-results",i.appendChild(l);let c=0,f={active:!1,type:"create-file",originalQuery:""};function d(){const B=n.dom.querySelector(".cm-gutters");if(B){const K=B.getBoundingClientRect().width;i.style.setProperty("--cm-gutter-width",`${K}px`);const G=B.querySelector(".cm-lineNumbers");if(G){const F=G.getBoundingClientRect().width;i.style.setProperty("--cm-gutter-lineno-width",`${F}px`)}}}let g=null;function m(){const B=n.dom.querySelector(".cm-gutters");B&&window.ResizeObserver&&(g=new ResizeObserver(()=>{d()}),g.observe(B))}d(),m();const y=(B,K)=>{const G=document.createElement("li");G.className=`cm-search-result ${h0(B)?"cm-command-result":"cm-file-result"}`;const F=document.createElement("div");F.className="cm-search-result-icon-container";const R=document.createElement("div");R.className="cm-search-result-icon",R.textContent=h0(B)?B.icon:"📄",F.appendChild(R),G.appendChild(F);const Y=document.createElement("div");return Y.className="cm-search-result-label",Y.textContent=B.id,G.appendChild(Y),K===c&&G.classList.add("selected"),G.addEventListener("mousedown",q=>{q.preventDefault()}),G.addEventListener("click",()=>w(B)),G};function b(){const B=n.state.field(nd),K=[],G=B.filter(h0),F=B.filter(wJ);let R=0;G.forEach(Y=>{K.push(y(Y,R)),R++}),F.forEach(Y=>{K.push(y(Y,R)),R++}),l.replaceChildren(...K)}function w(B){h0(B)?C(B):A(B)}function x(){f.active?s.textContent=f.type==="create-file"?"📄":"✏️":s.textContent="📄"}function _(B,K,G){f={active:!0,type:B,originalQuery:K,languageExtension:G},x(),u.value="",u.placeholder=G?`filename.${G}`:"filename",u.focus(),Qo(n,{effects:Qs.of([])})}function S(){f={active:!1,type:"create-file",originalQuery:""},x(),u.placeholder=""}function C(B){if(B.type==="create-file")if(B.requiresInput)_("create-file",B.query,B.query);else{const K=B.query.includes(".")?B.query:`${B.query}.txt`;u.value=K,Qo(n,{effects:[Qs.of([]),Qu.of({path:K})]})}else if(B.type==="rename-file"){const K=n.state.field(Xa);if(K.path){const G=B.query.includes(".")?B.query:`${B.query}.txt`;u.value=G,console.log(`Rename ${K.path} to ${G}`),Qo(n,{effects:[Qs.of([]),Qu.of({path:G})]})}}}function A(B){u.value=B.id,Qo(n,{effects:[Qs.of([]),Qu.of({path:B.id})]})}function I(B){if(!(!f.active||!B.trim())){if(f.type==="create-file"){const K=f.languageExtension&&!B.includes(".")?`${B}.${f.languageExtension}`:B;u.value=K,Qo(n,{effects:[Qs.of([]),Qu.of({path:K})]})}else if(f.type==="rename-file"){const K=n.state.field(Xa);if(K.path){const G=B.includes(".")?B:`${B}.txt`;u.value=G,console.log(`Rename ${K.path} to ${G}`),Qo(n,{effects:[Qs.of([]),Qu.of({path:G})]})}}S()}}function W(B){i.contains(B.target)||Qo(n,{effects:Qs.of([])})}return u.addEventListener("click",()=>{if(!f.active){const B=u.value;let K=[];if(B.trim()){const G=(r?.search(B,{fuzzy:!0,prefix:!0})||[]).slice(0,100),F=JR(B,n,G);K=G.concat(F)}Qo(n,{effects:Qs.of(K)}),document.addEventListener("click",W)}}),u.addEventListener("input",B=>{const K=B.target.value;if(c=0,f.active)return;let G=[];if(K.trim()){const F=(r?.search(K,{fuzzy:!0,prefix:!0})||[]).slice(0,1e3),R=JR(K,n,F);G.push(...R),G.push(...F)}Qo(n,{effects:Qs.of(G)})}),u.addEventListener("keydown",B=>{if(f.active){B.key==="Enter"?(B.preventDefault(),I(u.value)):B.key==="Escape"&&(B.preventDefault(),S(),u.value=f.originalQuery);return}const K=n.state.field(nd);B.key==="ArrowDown"?(B.preventDefault(),K.length&&(c=YR(c+1,K.length),b())):B.key==="ArrowUp"?(B.preventDefault(),K.length&&(c=YR(c-1,K.length),b())):B.key==="Enter"&&K.length&&c>=0&&(B.preventDefault(),w(K[c]))}),{dom:i,top:!0,update(B){const K=B.startState.field(nd),G=B.state.field(nd);K!==G&&(b(),G.length===0&&document.removeEventListener("click",W))},destroy(){document.removeEventListener("click",W),g&&(g.disconnect(),g=null)}}},Vd=Re.define({combine:n=>n[0]}),SJ=new ga,b1=new ga,a8=new ga,u8=new ga,l8=new ga,Qu=Ve.define(),c8=Ve.define(),CJ=Ve.define(),Xa=Tn.define({create(n){const e=n.facet(Vd);return e.filepath?{path:e.filepath,content:"",language:null,loading:!0}:{path:null,content:e.content||"",language:e.language||null,loading:!1}},update(n,e){for(let t of e.effects){if(t.is(Qu))return{path:t.value.path,content:"",language:null,loading:!0};if(t.is(c8))return{path:t.value.path,content:t.value.content,language:t.value.language,loading:!1}}return n}});function d0(n,e){queueMicrotask(()=>{try{n.dispatch(e)}catch(t){console.error(t)}})}const EJ=[{key:"ArrowUp",run:n=>{const e=n.state.selection.main,t=n.state.doc.lineAt(e.head),r=n.dom.querySelector(".cm-toolbar-input");return t.number===1&&r?(r.focus(),!0):!1}}],AJ=(n,e,t)=>{let r=document.createElement("pre");function i(o,a){let u=document.createTextNode(o);if(a){let l=document.createElement("span");l.appendChild(u),l.className=a,u=l}r.appendChild(u)}function s(){r.appendChild(document.createTextNode(`
|
|
167
|
-
`))}return n$(n,e.parse(n),t,i,s),r.getHTML()},RJ=({content:n,fs:e,cwd:t,filepath:r,language:i,toolbar:s=!0,index:o})=>[SJ.of(Vd.of({content:n,fs:e,filepath:r,cwd:t,language:i,toolbar:s,index:o})),Xa,b1.of([]),a8.of([]),u8.of(Xc.of(" ")),l8.of(gt.readOnly.of(!1)),lj({position:"fixed"}),Pc.of(s?xJ:null),Lj,DJ,Zc.of(EJ.concat([dU])),_6,nd],DJ=mn.define(n=>{vo.mount(document,nz);let{fs:e}=n.state.facet(Vd);const t=Pj.debounce(async()=>{const l=n.state.field(Xa);l.path&&await e.writeFile(l.path,n.state.doc.toString()).catch(console.error)},500);let r=null;async function i(l){if(!l)return;const c=await uA(e1[l]);d0(n,{effects:[b1.reconfigure(c||[])]})}async function s(l){if(l&&r!==l){r=l;try{const c=l.split(".").pop()?.toLowerCase(),f=(c?e1[c]??null:u)||"markdown";let d=f?await uA(f):null;d0(n,{effects:[b1.reconfigure(d||[])]});const m=await e.exists(l)?await e.readFile(l):"",y=IH(m)||" ";let b=f?await v2.client({view:n,language:f,path:l,fs:e}):null;d0(n,{changes:{from:0,to:n.state.doc.length,insert:m},effects:[u8.reconfigure(Xc.of(y)),c8.of({path:l,content:m,language:f}),a8.reconfigure([AP.of(`file:///${l}`),RP.of(f||""),...b?[b]:[]])]})}catch(c){console.error("Failed to open file",c)}finally{r=null}}}const{path:o,loading:a,language:u}=n.state.field(Xa);return!o&&u&&i(u),o&&a&&s(o),{update(l){for(let g of l.transactions.flatMap(m=>m.effects))if(g.is(Qu)&&queueMicrotask(()=>s(g.value.path)),g.is(CJ)){const m=g.value.dark;l.view.dom.setAttribute("data-theme",m?"dark":"light")}const c=l.startState.field(Xa),f=l.state.field(Xa);c.loading!==f.loading&&d0(n,{effects:l8.reconfigure(gt.readOnly.of(f.loading))}),l.docChanged&&t();const d=l.state.facet(Vd).fs;e!==d&&(e=d)}}}),TJ=[Aj(),Tj(),GW(),hz(),T$(),FW(),jW(),gt.allowMultipleSelections.of(!0),m$(),f6(P$,{fallback:!0}),j$(),dV(),sj(),uj(),QW(),IV(),Zc.of([...yV,...hU,...XV,..._z,...E$,...VO,...aG])];function IJ({parent:n,fs:e,filepath:t,language:r,content:i="",cwd:s="/",toolbar:o=!0,index:a,dark:u}){const l=gt.create({doc:i,extensions:[TJ,RJ({content:i,fs:e,filepath:t,cwd:s,language:r,toolbar:o,index:a})]});return new Ae({state:l,parent:n})}const QR=pp.get("proxy"),MJ={canHandle(n){return n&&typeof n=="object"&&typeof n.next=="function"&&(typeof n[Symbol.iterator]=="function"||typeof n[Symbol.asyncIterator]=="function")},serialize(n){return QR.serialize(Q1(n))},async*deserialize(n){const e=QR.deserialize(n);for(;;){const{value:t,done:r}=await e.next();if(r)break;yield t}}},OJ={canHandle:n=>n&&typeof n=="object"&&n.signal instanceof AbortSignal,serialize:n=>{const{signal:e,...t}=n,{port1:r,port2:i}=new MessageChannel;return e.addEventListener("abort",()=>{r.postMessage({}),r.close()},{once:!0}),[{port:i,...t},[i]]},deserialize:n=>{const{port:e,...t}=n,r=new AbortController;return e.onmessage=()=>{r.abort(),e.close()},{signal:r.signal,...t}}};var Uu={},Hu={},Vu={},Nh={},p0={},eD;function PJ(){if(eD)return p0;eD=1,Object.defineProperty(p0,"__esModule",{value:!0}),p0.binarySearch=n;function n(e,t){let r=0,i=e.length-1,s;for(;r<=i;){const u=Math.floor((r+i)/2),l=e[u];if(l<t)r=u+1;else if(l>t)i=u-1;else{r=u,i=u,s=u;break}}const o=Math.max(Math.min(r,i,e.length-1),0),a=Math.min(Math.max(r,i,0),e.length-1);return{low:o,high:a,match:s}}return p0}var g0={},tD;function f8(){if(tD)return g0;tD=1,Object.defineProperty(g0,"__esModule",{value:!0}),g0.translateOffset=e;let n=!1;function e(t,r,i,s,o=s){if(!r.every((c,f)=>f===0||r[f-1]<=c)){for(let c=0;c<r.length;c++){const f=r[c],d=s[c];if(t>=f&&t<=f+d){const g=o[c],m=i[c];let y=Math.min(t-f,g);return m+y}}n||(n=!0,console.warn("fromOffsets should be sorted in ascending order"))}let u=0,l=r.length-1;for(;u<=l;){const c=Math.floor((u+l)/2),f=r[c],d=s[c];if(t>=f&&t<=f+d){const g=o[c],m=i[c];let y=Math.min(t-f,g);return m+y}else t<f?l=c-1:u=c+1}}return g0}var nD;function LJ(){if(nD)return Nh;nD=1,Object.defineProperty(Nh,"__esModule",{value:!0}),Nh.SourceMap=void 0;const n=PJ(),e=f8();class t{constructor(s){this.mappings=s}toSourceRange(s,o,a,u){return this.findMatchingStartEnd(s,o,a,"generatedOffsets",u)}toGeneratedRange(s,o,a,u){return this.findMatchingStartEnd(s,o,a,"sourceOffsets",u)}toSourceLocation(s,o){return this.findMatchingOffsets(s,"generatedOffsets",o)}toGeneratedLocation(s,o){return this.findMatchingOffsets(s,"sourceOffsets",o)}*findMatchingOffsets(s,o,a){const u=this.getMemoBasedOnRange(o);if(u.offsets.length===0)return;const{low:l,high:c}=(0,n.binarySearch)(u.offsets,s),f=new Set,d=o=="sourceOffsets"?"generatedOffsets":"sourceOffsets";for(let g=l;g<=c;g++)for(const m of u.mappings[g]){if(f.has(m)||(f.add(m),a&&!a(m.data)))continue;const y=(0,e.translateOffset)(s,m[o],m[d],r(m,o),r(m,d));y!==void 0&&(yield[y,m])}}*findMatchingStartEnd(s,o,a,u,l){const c=u=="sourceOffsets"?"generatedOffsets":"sourceOffsets",f=[];let d=!1;for(const[g,m]of this.findMatchingOffsets(s,u)){if(l&&!l(m.data))continue;f.push([g,m]);const y=(0,e.translateOffset)(o,m[u],m[c],r(m,u),r(m,c));y!==void 0&&(d=!0,yield[g,y,m,m])}if(!d&&a){for(const[g,m]of f)for(const[y,b]of this.findMatchingOffsets(o,u))if(!(l&&!l(b.data)||y<g)){yield[g,y,m,b];break}}}getMemoBasedOnRange(s){return s==="sourceOffsets"?this.sourceCodeOffsetsMemo??=this.createMemo("sourceOffsets"):this.generatedCodeOffsetsMemo??=this.createMemo("generatedOffsets")}createMemo(s){const o=new Set;for(const l of this.mappings)for(let c=0;c<l[s].length;c++)o.add(l[s][c]),o.add(l[s][c]+r(l,s)[c]);const a=[...o].sort((l,c)=>l-c),u=a.map(()=>new Set);for(const l of this.mappings)for(let c=0;c<l[s].length;c++){const f=(0,n.binarySearch)(a,l[s][c]).match,d=(0,n.binarySearch)(a,l[s][c]+r(l,s)[c]).match;for(let g=f;g<=d;g++)u[g].add(l)}return{offsets:a,mappings:u}}}Nh.SourceMap=t;function r(i,s){return s=="sourceOffsets"?i.lengths:i.generatedLengths??i.lengths}return Nh}var rD;function b2(){return rD||(rD=1,function(n){var e=Vu&&Vu.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(r,o,a)}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),t=Vu&&Vu.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,r,s)};Object.defineProperty(n,"__esModule",{value:!0}),t(LJ(),n),t(f8(),n)}(Vu)),Vu}var wt={},iD;function FJ(){if(iD)return wt;iD=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.isHoverEnabled=n,wt.isInlayHintsEnabled=e,wt.isCodeLensEnabled=t,wt.isMonikerEnabled=r,wt.isInlineValueEnabled=i,wt.isSemanticTokensEnabled=s,wt.isCallHierarchyEnabled=o,wt.isTypeHierarchyEnabled=a,wt.isRenameEnabled=u,wt.isDefinitionEnabled=l,wt.isTypeDefinitionEnabled=c,wt.isReferencesEnabled=f,wt.isImplementationEnabled=d,wt.isHighlightEnabled=g,wt.isSymbolsEnabled=m,wt.isFoldingRangesEnabled=y,wt.isSelectionRangesEnabled=b,wt.isLinkedEditingEnabled=w,wt.isColorEnabled=x,wt.isDocumentLinkEnabled=_,wt.isDiagnosticsEnabled=S,wt.isCodeActionsEnabled=C,wt.isFormattingEnabled=A,wt.isCompletionEnabled=I,wt.isAutoInsertEnabled=W,wt.isSignatureHelpEnabled=B,wt.shouldReportDiagnostics=K,wt.resolveRenameNewName=G,wt.resolveRenameEditText=F,wt.findOverlapCodeRange=R;function n(q){return!!q.semantic}function e(q){return!!q.semantic}function t(q){return!!q.semantic}function r(q){return!!q.semantic}function i(q){return!!q.semantic}function s(q){return typeof q.semantic=="object"?q.semantic.shouldHighlight?.()??!0:!!q.semantic}function o(q){return!!q.navigation}function a(q){return!!q.navigation}function u(q){return typeof q.navigation=="object"?q.navigation.shouldRename?.()??!0:!!q.navigation}function l(q){return!!q.navigation}function c(q){return!!q.navigation}function f(q){return!!q.navigation}function d(q){return!!q.navigation}function g(q){return!!q.navigation}function m(q){return!!q.structure}function y(q){return!!q.structure}function b(q){return!!q.structure}function w(q){return!!q.structure}function x(q){return!!q.structure}function _(q){return!!q.structure}function S(q){return!!q.verification}function C(q){return!!q.verification}function A(q){return!!q.format}function I(q){return!!q.completion}function W(q){return!!q.completion}function B(q){return!!q.completion}function K(q,te,ae){return typeof q.verification=="object"?q.verification.shouldReport?.(te,ae)??!0:!!q.verification}function G(q,te){return typeof te.navigation=="object"?te.navigation.resolveRenameNewName?.(q)??q:q}function F(q,te){return typeof te.navigation=="object"?te.navigation.resolveRenameEditText?.(q)??q:q}function R(q,te,ae,be){let ye,De;for(const[we,Pe]of ae.toGeneratedLocation(q))if(be(Pe.data)){ye=we;break}for(const[we,Pe]of ae.toGeneratedLocation(te))if(be(Pe.data)){De=we;break}if(ye===void 0||De===void 0){for(const we of ae.mappings)if(be(we.data)){const Pe=we.sourceOffsets[0],Rt=we.sourceOffsets[we.sourceOffsets.length-1]+we.lengths[we.lengths.length-1],kt=Y(q,te,Pe,Rt);if(kt){const rt=kt.start-Pe+we.generatedOffsets[0],Xt=(we.generatedLengths??we.lengths)[we.generatedOffsets.length-1],Bn=Math.min(kt.end-we.sourceOffsets[we.sourceOffsets.length-1],Xt),rn=we.generatedOffsets[we.generatedOffsets.length-1]+Bn;ye=ye===void 0?rt:Math.min(ye,rt),De=De===void 0?rn:Math.max(De,rn)}}}if(ye!==void 0&&De!==void 0)return{start:ye,end:De}}function Y(q,te,ae,be){const ye=Math.max(q,ae),De=Math.min(te,be);if(!(ye>De))return{start:ye,end:De}}return wt}var Bh={},sD;function oD(){if(sD)return Bh;sD=1,Object.defineProperty(Bh,"__esModule",{value:!0}),Bh.LinkedCodeMap=void 0;const n=b2();class e extends n.SourceMap{*getLinkedOffsets(r){for(const i of this.toGeneratedLocation(r))yield i[0];for(const i of this.toSourceLocation(r))yield i[0]}}return Bh.LinkedCodeMap=e,Bh}var Rb={},aD;function NJ(){return aD||(aD=1,Object.defineProperty(Rb,"__esModule",{value:!0})),Rb}var qh={},uD;function BJ(){if(uD)return qh;uD=1,Object.defineProperty(qh,"__esModule",{value:!0}),qh.FileMap=void 0;class n extends Map{constructor(t){super(),this.caseSensitive=t,this.originalFileNames=new Map}keys(){return this.originalFileNames.values()}get(t){return super.get(this.normalizeId(t))}has(t){return super.has(this.normalizeId(t))}set(t,r){return this.originalFileNames.set(this.normalizeId(t),t),super.set(this.normalizeId(t),r)}delete(t){return this.originalFileNames.delete(this.normalizeId(t)),super.delete(this.normalizeId(t))}clear(){return this.originalFileNames.clear(),super.clear()}normalizeId(t){return this.caseSensitive?t:t.toLowerCase()}}return qh.FileMap=n,qh}var lD;function Ft(){return lD||(lD=1,function(n){var e=Hu&&Hu.__createBinding||(Object.create?function(l,c,f,d){d===void 0&&(d=f);var g=Object.getOwnPropertyDescriptor(c,f);(!g||("get"in g?!c.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return c[f]}}),Object.defineProperty(l,d,g)}:function(l,c,f,d){d===void 0&&(d=f),l[d]=c[f]}),t=Hu&&Hu.__exportStar||function(l,c){for(var f in l)f!=="default"&&!Object.prototype.hasOwnProperty.call(c,f)&&e(c,l,f)};Object.defineProperty(n,"__esModule",{value:!0}),n.defaultMapperFactory=n.SourceMap=void 0,n.createLanguage=a,n.forEachEmbeddedCode=u;var r=b2();Object.defineProperty(n,"SourceMap",{enumerable:!0,get:function(){return r.SourceMap}}),t(FJ(),n),t(oD(),n),t(NJ(),n),t(BJ(),n);const i=b2(),s=oD(),o=l=>new i.SourceMap(l);n.defaultMapperFactory=o;function a(l,c,f,d){const g=new WeakMap,m=new WeakMap,y=new WeakMap,b={mapperFactory:n.defaultMapperFactory,plugins:l,scripts:{fromVirtualCode(_){return g.get(_)},get(_,S=!0,C=!1){f(_,S,C);const A=c.get(_);return A?.isAssociationDirty&&this.set(_,A.snapshot,A.languageId),c.get(_)},set(_,S,C,A=l){if(!C){for(const W of l)if(C=W.getLanguageId?.(_),C)break}if(!C){console.warn(`languageId not found for ${_}`);return}let I=!1;for(const W of l)if(W.isAssociatedFileOnly?.(_,C)){I=!0;break}if(c.has(_)){const W=c.get(_);if(W.languageId!==C||W.associatedOnly!==I)return this.delete(_),w(W),this.set(_,S,C);if(I)W.snapshot!==S&&(W.snapshot=S,w(W));else if(W.isAssociationDirty||W.snapshot!==S){W.snapshot!==S&&(W.snapshot=S,w(W));const B=x(W);if(W.generated){const{updateVirtualCode:K,createVirtualCode:G}=W.generated.languagePlugin,F=K?K(_,W.generated.root,S,B):G?.(_,C,S,B);if(F){W.generated.root=F,W.generated.embeddedCodes.clear();for(const R of u(W.generated.root))g.set(R,W),W.generated.embeddedCodes.set(R.id,R);return W}else{this.delete(_);return}}}else return W}else{const W={id:_,languageId:C,snapshot:S,associatedIds:new Set,targetIds:new Set,associatedOnly:I};if(c.set(_,W),I)return W;for(const B of A){const K=B.createVirtualCode?.(_,C,S,x(W));if(K){W.generated={root:K,languagePlugin:B,embeddedCodes:new Map};for(const G of u(K))g.set(G,W),W.generated.embeddedCodes.set(G.id,G);break}}return W}},delete(_){const S=c.get(_);S&&(S.generated?.languagePlugin.disposeVirtualCode?.(_,S.generated.root),c.delete(_),w(S))}},maps:{get(_,S){let C=m.get(_.snapshot);if(C||m.set(_.snapshot,C=new WeakMap),!C.has(S.snapshot)){const A=_.associatedScriptMappings?.get(S.id)??_.mappings;C.set(S.snapshot,b.mapperFactory(A))}return C.get(S.snapshot)},*forEach(_){const S=g.get(_);if(yield[S,this.get(_,S)],_.associatedScriptMappings)for(const[C]of _.associatedScriptMappings){const A=c.get(C);A&&(yield[A,this.get(_,A)])}}},linkedCodeMaps:{get(_){const S=g.get(_);let C=y.get(_.snapshot);return C?.[0]!==S.snapshot&&y.set(_.snapshot,C=[S.snapshot,_.linkedCodeMappings?new s.LinkedCodeMap(_.linkedCodeMappings):void 0]),C[1]}}};return b;function w(_){_.targetIds.forEach(S=>{const C=c.get(S);C&&(C.isAssociationDirty=!0,d?.(C.id))})}function x(_){for(const S of _.associatedIds)c.get(S)?.targetIds.delete(_.id);return _.associatedIds.clear(),_.isAssociationDirty=!1,{getAssociatedScript(S){f(S,!0,!0);const C=c.get(S);return C&&(C.targetIds.add(_.id),_.associatedIds.add(C.id)),C}}}}function*u(l){if(yield l,l.embeddedCodes)for(const c of l.embeddedCodes)yield*u(c)}}(Hu)),Hu}var Db={};class Gd{constructor(e,t,r,i){this._uri=e,this._languageId=t,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const t=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(t,r)}return this._content}update(e,t){for(const r of e)if(Gd.isIncremental(r)){const i=d8(r.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(o,this._content.length);const a=Math.max(i.start.line,0),u=Math.max(i.end.line,0);let l=this._lineOffsets;const c=cD(r.text,!1,s);if(u-a===c.length)for(let d=0,g=c.length;d<g;d++)l[d+a+1]=c[d];else c.length<1e4?l.splice(a+1,u-a,...c):this._lineOffsets=l=l.slice(0,a+1).concat(c,l.slice(u+1));const f=r.text.length-(o-s);if(f!==0)for(let d=a+1+c.length,g=l.length;d<g;d++)l[d]=l[d]+f}else if(Gd.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=t}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=cD(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);const t=this.getLineOffsets();let r=0,i=t.length;if(i===0)return{line:0,character:e};for(;r<i;){const o=Math.floor((r+i)/2);t[o]>e?i=o:r=o+1}const s=r-1;return e=this.ensureBeforeEOL(e,t[s]),{line:s,character:e-t[s]}}offsetAt(e){const t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;const r=t[e.line];if(e.character<=0)return r;const i=e.line+1<t.length?t[e.line+1]:this._content.length,s=Math.min(r+e.character,i);return this.ensureBeforeEOL(s,r)}ensureBeforeEOL(e,t){for(;e>t&&h8(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const t=e;return t!=null&&typeof t.text=="string"&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength=="number")}static isFull(e){const t=e;return t!=null&&typeof t.text=="string"&&t.range===void 0&&t.rangeLength===void 0}}var w2;(function(n){function e(i,s,o,a){return new Gd(i,s,o,a)}n.create=e;function t(i,s,o){if(i instanceof Gd)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}n.update=t;function r(i,s){const o=i.getText(),a=_2(s.map(qJ),(c,f)=>{const d=c.range.start.line-f.range.start.line;return d===0?c.range.start.character-f.range.start.character:d});let u=0;const l=[];for(const c of a){const f=i.offsetAt(c.range.start);if(f<u)throw new Error("Overlapping edit");f>u&&l.push(o.substring(u,f)),c.newText.length&&l.push(c.newText),u=i.offsetAt(c.range.end)}return l.push(o.substr(u)),l.join("")}n.applyEdits=r})(w2||(w2={}));function _2(n,e){if(n.length<=1)return n;const t=n.length/2|0,r=n.slice(0,t),i=n.slice(t);_2(r,e),_2(i,e);let s=0,o=0,a=0;for(;s<r.length&&o<i.length;)e(r[s],i[o])<=0?n[a++]=r[s++]:n[a++]=i[o++];for(;s<r.length;)n[a++]=r[s++];for(;o<i.length;)n[a++]=i[o++];return n}function cD(n,e,t=0){const r=e?[t]:[];for(let i=0;i<n.length;i++){const s=n.charCodeAt(i);h8(s)&&(s===13&&i+1<n.length&&n.charCodeAt(i+1)===10&&i++,r.push(t+i+1))}return r}function h8(n){return n===13||n===10}function d8(n){const e=n.start,t=n.end;return e.line>t.line||e.line===t.line&&e.character>t.character?{start:t,end:e}:n}function qJ(n){const e=d8(n.range);return e!==n.range?{newText:n.newText,range:e}:n}const WJ=Object.freeze(Object.defineProperty({__proto__:null,get TextDocument(){return w2}},Symbol.toStringTag,{value:"Module"})),p8=W1(WJ);var xm={exports:{}},jJ=xm.exports,fD;function Kr(){return fD||(fD=1,function(n,e){(function(t,r){n.exports=r()})(jJ,()=>(()=>{var t={975:o=>{function a(c){if(typeof c!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(c))}function u(c,f){for(var d,g="",m=0,y=-1,b=0,w=0;w<=c.length;++w){if(w<c.length)d=c.charCodeAt(w);else{if(d===47)break;d=47}if(d===47){if(!(y===w-1||b===1))if(y!==w-1&&b===2){if(g.length<2||m!==2||g.charCodeAt(g.length-1)!==46||g.charCodeAt(g.length-2)!==46){if(g.length>2){var x=g.lastIndexOf("/");if(x!==g.length-1){x===-1?(g="",m=0):m=(g=g.slice(0,x)).length-1-g.lastIndexOf("/"),y=w,b=0;continue}}else if(g.length===2||g.length===1){g="",m=0,y=w,b=0;continue}}f&&(g.length>0?g+="/..":g="..",m=2)}else g.length>0?g+="/"+c.slice(y+1,w):g=c.slice(y+1,w),m=w-y-1;y=w,b=0}else d===46&&b!==-1?++b:b=-1}return g}var l={resolve:function(){for(var c,f="",d=!1,g=arguments.length-1;g>=-1&&!d;g--){var m;g>=0?m=arguments[g]:(c===void 0&&(c=process.cwd()),m=c),a(m),m.length!==0&&(f=m+"/"+f,d=m.charCodeAt(0)===47)}return f=u(f,!d),d?f.length>0?"/"+f:"/":f.length>0?f:"."},normalize:function(c){if(a(c),c.length===0)return".";var f=c.charCodeAt(0)===47,d=c.charCodeAt(c.length-1)===47;return(c=u(c,!f)).length!==0||f||(c="."),c.length>0&&d&&(c+="/"),f?"/"+c:c},isAbsolute:function(c){return a(c),c.length>0&&c.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var c,f=0;f<arguments.length;++f){var d=arguments[f];a(d),d.length>0&&(c===void 0?c=d:c+="/"+d)}return c===void 0?".":l.normalize(c)},relative:function(c,f){if(a(c),a(f),c===f||(c=l.resolve(c))===(f=l.resolve(f)))return"";for(var d=1;d<c.length&&c.charCodeAt(d)===47;++d);for(var g=c.length,m=g-d,y=1;y<f.length&&f.charCodeAt(y)===47;++y);for(var b=f.length-y,w=m<b?m:b,x=-1,_=0;_<=w;++_){if(_===w){if(b>w){if(f.charCodeAt(y+_)===47)return f.slice(y+_+1);if(_===0)return f.slice(y+_)}else m>w&&(c.charCodeAt(d+_)===47?x=_:_===0&&(x=0));break}var S=c.charCodeAt(d+_);if(S!==f.charCodeAt(y+_))break;S===47&&(x=_)}var C="";for(_=d+x+1;_<=g;++_)_!==g&&c.charCodeAt(_)!==47||(C.length===0?C+="..":C+="/..");return C.length>0?C+f.slice(y+x):(y+=x,f.charCodeAt(y)===47&&++y,f.slice(y))},_makeLong:function(c){return c},dirname:function(c){if(a(c),c.length===0)return".";for(var f=c.charCodeAt(0),d=f===47,g=-1,m=!0,y=c.length-1;y>=1;--y)if((f=c.charCodeAt(y))===47){if(!m){g=y;break}}else m=!1;return g===-1?d?"/":".":d&&g===1?"//":c.slice(0,g)},basename:function(c,f){if(f!==void 0&&typeof f!="string")throw new TypeError('"ext" argument must be a string');a(c);var d,g=0,m=-1,y=!0;if(f!==void 0&&f.length>0&&f.length<=c.length){if(f.length===c.length&&f===c)return"";var b=f.length-1,w=-1;for(d=c.length-1;d>=0;--d){var x=c.charCodeAt(d);if(x===47){if(!y){g=d+1;break}}else w===-1&&(y=!1,w=d+1),b>=0&&(x===f.charCodeAt(b)?--b==-1&&(m=d):(b=-1,m=w))}return g===m?m=w:m===-1&&(m=c.length),c.slice(g,m)}for(d=c.length-1;d>=0;--d)if(c.charCodeAt(d)===47){if(!y){g=d+1;break}}else m===-1&&(y=!1,m=d+1);return m===-1?"":c.slice(g,m)},extname:function(c){a(c);for(var f=-1,d=0,g=-1,m=!0,y=0,b=c.length-1;b>=0;--b){var w=c.charCodeAt(b);if(w!==47)g===-1&&(m=!1,g=b+1),w===46?f===-1?f=b:y!==1&&(y=1):f!==-1&&(y=-1);else if(!m){d=b+1;break}}return f===-1||g===-1||y===0||y===1&&f===g-1&&f===d+1?"":c.slice(f,g)},format:function(c){if(c===null||typeof c!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof c);return function(f,d){var g=d.dir||d.root,m=d.base||(d.name||"")+(d.ext||"");return g?g===d.root?g+m:g+"/"+m:m}(0,c)},parse:function(c){a(c);var f={root:"",dir:"",base:"",ext:"",name:""};if(c.length===0)return f;var d,g=c.charCodeAt(0),m=g===47;m?(f.root="/",d=1):d=0;for(var y=-1,b=0,w=-1,x=!0,_=c.length-1,S=0;_>=d;--_)if((g=c.charCodeAt(_))!==47)w===-1&&(x=!1,w=_+1),g===46?y===-1?y=_:S!==1&&(S=1):y!==-1&&(S=-1);else if(!x){b=_+1;break}return y===-1||w===-1||S===0||S===1&&y===w-1&&y===b+1?w!==-1&&(f.base=f.name=b===0&&m?c.slice(1,w):c.slice(b,w)):(b===0&&m?(f.name=c.slice(1,y),f.base=c.slice(1,w)):(f.name=c.slice(b,y),f.base=c.slice(b,w)),f.ext=c.slice(y,w)),b>0?f.dir=c.slice(0,b-1):m&&(f.dir="/"),f},sep:"/",delimiter:":",win32:null,posix:null};l.posix=l,o.exports=l},70:(o,a)=>{if(Object.defineProperty(a,"__esModule",{value:!0}),a.isWindows=void 0,typeof process=="object")a.isWindows=process.platform==="win32";else if(typeof navigator=="object"){let u=navigator.userAgent;a.isWindows=u.indexOf("Windows")>=0}},231:(o,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.uriToFsPath=a.URI=void 0;const l=u(70),c=/^\w[\w\d+.-]*$/,f=/^\//,d=/^\/\//;function g(F,R){if(!F.scheme&&R)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${F.authority}", path: "${F.path}", query: "${F.query}", fragment: "${F.fragment}"}`);if(F.scheme&&!c.test(F.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(F.path){if(F.authority){if(!f.test(F.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(d.test(F.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const m="",y="/",b=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class w{static isUri(R){return R instanceof w||!!R&&typeof R.authority=="string"&&typeof R.fragment=="string"&&typeof R.path=="string"&&typeof R.query=="string"&&typeof R.scheme=="string"&&typeof R.fsPath=="string"&&typeof R.with=="function"&&typeof R.toString=="function"}scheme;authority;path;query;fragment;constructor(R,Y,q,te,ae,be=!1){typeof R=="object"?(this.scheme=R.scheme||m,this.authority=R.authority||m,this.path=R.path||m,this.query=R.query||m,this.fragment=R.fragment||m):(this.scheme=function(ye,De){return ye||De?ye:"file"}(R,be),this.authority=Y||m,this.path=function(ye,De){switch(ye){case"https":case"http":case"file":De?De[0]!==y&&(De=y+De):De=y}return De}(this.scheme,q||m),this.query=te||m,this.fragment=ae||m,g(this,be))}get fsPath(){return I(this,!1)}with(R){if(!R)return this;let{scheme:Y,authority:q,path:te,query:ae,fragment:be}=R;return Y===void 0?Y=this.scheme:Y===null&&(Y=m),q===void 0?q=this.authority:q===null&&(q=m),te===void 0?te=this.path:te===null&&(te=m),ae===void 0?ae=this.query:ae===null&&(ae=m),be===void 0?be=this.fragment:be===null&&(be=m),Y===this.scheme&&q===this.authority&&te===this.path&&ae===this.query&&be===this.fragment?this:new _(Y,q,te,ae,be)}static parse(R,Y=!1){const q=b.exec(R);return q?new _(q[2]||m,G(q[4]||m),G(q[5]||m),G(q[7]||m),G(q[9]||m),Y):new _(m,m,m,m,m)}static file(R){let Y=m;if(l.isWindows&&(R=R.replace(/\\/g,y)),R[0]===y&&R[1]===y){const q=R.indexOf(y,2);q===-1?(Y=R.substring(2),R=y):(Y=R.substring(2,q),R=R.substring(q)||y)}return new _("file",Y,R,m,m)}static from(R){const Y=new _(R.scheme,R.authority,R.path,R.query,R.fragment);return g(Y,!0),Y}toString(R=!1){return W(this,R)}toJSON(){return this}static revive(R){if(R){if(R instanceof w)return R;{const Y=new _(R);return Y._formatted=R.external,Y._fsPath=R._sep===x?R.fsPath:null,Y}}return R}}a.URI=w;const x=l.isWindows?1:void 0;class _ extends w{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=I(this,!1)),this._fsPath}toString(R=!1){return R?W(this,!0):(this._formatted||(this._formatted=W(this,!1)),this._formatted)}toJSON(){const R={$mid:1};return this._fsPath&&(R.fsPath=this._fsPath,R._sep=x),this._formatted&&(R.external=this._formatted),this.path&&(R.path=this.path),this.scheme&&(R.scheme=this.scheme),this.authority&&(R.authority=this.authority),this.query&&(R.query=this.query),this.fragment&&(R.fragment=this.fragment),R}}const S={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function C(F,R,Y){let q,te=-1;for(let ae=0;ae<F.length;ae++){const be=F.charCodeAt(ae);if(be>=97&&be<=122||be>=65&&be<=90||be>=48&&be<=57||be===45||be===46||be===95||be===126||R&&be===47||Y&&be===91||Y&&be===93||Y&&be===58)te!==-1&&(q+=encodeURIComponent(F.substring(te,ae)),te=-1),q!==void 0&&(q+=F.charAt(ae));else{q===void 0&&(q=F.substr(0,ae));const ye=S[be];ye!==void 0?(te!==-1&&(q+=encodeURIComponent(F.substring(te,ae)),te=-1),q+=ye):te===-1&&(te=ae)}}return te!==-1&&(q+=encodeURIComponent(F.substring(te))),q!==void 0?q:F}function A(F){let R;for(let Y=0;Y<F.length;Y++){const q=F.charCodeAt(Y);q===35||q===63?(R===void 0&&(R=F.substr(0,Y)),R+=S[q]):R!==void 0&&(R+=F[Y])}return R!==void 0?R:F}function I(F,R){let Y;return Y=F.authority&&F.path.length>1&&F.scheme==="file"?`//${F.authority}${F.path}`:F.path.charCodeAt(0)===47&&(F.path.charCodeAt(1)>=65&&F.path.charCodeAt(1)<=90||F.path.charCodeAt(1)>=97&&F.path.charCodeAt(1)<=122)&&F.path.charCodeAt(2)===58?R?F.path.substr(1):F.path[1].toLowerCase()+F.path.substr(2):F.path,l.isWindows&&(Y=Y.replace(/\//g,"\\")),Y}function W(F,R){const Y=R?A:C;let q="",{scheme:te,authority:ae,path:be,query:ye,fragment:De}=F;if(te&&(q+=te,q+=":"),(ae||te==="file")&&(q+=y,q+=y),ae){let we=ae.indexOf("@");if(we!==-1){const Pe=ae.substr(0,we);ae=ae.substr(we+1),we=Pe.lastIndexOf(":"),we===-1?q+=Y(Pe,!1,!1):(q+=Y(Pe.substr(0,we),!1,!1),q+=":",q+=Y(Pe.substr(we+1),!1,!0)),q+="@"}ae=ae.toLowerCase(),we=ae.lastIndexOf(":"),we===-1?q+=Y(ae,!1,!0):(q+=Y(ae.substr(0,we),!1,!0),q+=ae.substr(we))}if(be){if(be.length>=3&&be.charCodeAt(0)===47&&be.charCodeAt(2)===58){const we=be.charCodeAt(1);we>=65&&we<=90&&(be=`/${String.fromCharCode(we+32)}:${be.substr(3)}`)}else if(be.length>=2&&be.charCodeAt(1)===58){const we=be.charCodeAt(0);we>=65&&we<=90&&(be=`${String.fromCharCode(we+32)}:${be.substr(2)}`)}q+=Y(be,!0,!1)}return ye&&(q+="?",q+=Y(ye,!1,!1)),De&&(q+="#",q+=R?De:C(De,!1,!1)),q}function B(F){try{return decodeURIComponent(F)}catch{return F.length>3?F.substr(0,3)+B(F.substr(3)):F}}a.uriToFsPath=I;const K=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function G(F){return F.match(K)?F.replace(K,R=>B(R)):F}},552:function(o,a,u){var l=this&&this.__createBinding||(Object.create?function(b,w,x,_){_===void 0&&(_=x);var S=Object.getOwnPropertyDescriptor(w,x);S&&!("get"in S?!w.__esModule:S.writable||S.configurable)||(S={enumerable:!0,get:function(){return w[x]}}),Object.defineProperty(b,_,S)}:function(b,w,x,_){_===void 0&&(_=x),b[_]=w[x]}),c=this&&this.__setModuleDefault||(Object.create?function(b,w){Object.defineProperty(b,"default",{enumerable:!0,value:w})}:function(b,w){b.default=w}),f=this&&this.__importStar||function(b){if(b&&b.__esModule)return b;var w={};if(b!=null)for(var x in b)x!=="default"&&Object.prototype.hasOwnProperty.call(b,x)&&l(w,b,x);return c(w,b),w};Object.defineProperty(a,"__esModule",{value:!0}),a.Utils=void 0;const d=f(u(975)),g=d.posix||d,m="/";var y;(function(b){b.joinPath=function(w,...x){return w.with({path:g.join(w.path,...x)})},b.resolvePath=function(w,...x){let _=w.path,S=!1;_[0]!==m&&(_=m+_,S=!0);let C=g.resolve(_,...x);return S&&C[0]===m&&!w.authority&&(C=C.substring(1)),w.with({path:C})},b.dirname=function(w){if(w.path.length===0||w.path===m)return w;let x=g.dirname(w.path);return x.length===1&&x.charCodeAt(0)===46&&(x=""),w.with({path:x})},b.basename=function(w){return g.basename(w.path)},b.extname=function(w){return g.extname(w.path)}})(y||(a.Utils=y={}))}},r={};function i(o){var a=r[o];if(a!==void 0)return a.exports;var u=r[o]={exports:{}};return t[o].call(u.exports,u,u.exports,i),u.exports}var s={};return(()=>{var o=s;Object.defineProperty(o,"__esModule",{value:!0}),o.Utils=o.URI=void 0;const a=i(231);Object.defineProperty(o,"URI",{enumerable:!0,get:function(){return a.URI}});const u=i(552);Object.defineProperty(o,"Utils",{enumerable:!0,get:function(){return u.Utils}})})(),s})())}(xm)),xm.exports}var m0={},Wh={},hD;function lt(){return hD||(hD=1,Object.defineProperty(Wh,"__esModule",{value:!0}),Wh.NoneCancellationToken=void 0,Wh.NoneCancellationToken={isCancellationRequested:!1,onCancellationRequested:()=>({dispose:()=>{}})}),Wh}var ii={},dD;function At(){if(dD)return ii;dD=1,Object.defineProperty(ii,"__esModule",{value:!0}),ii.documentFeatureWorker=n,ii.languageFeatureWorker=e,ii.safeCall=t,ii.forEachEmbeddedDocument=r,ii.getSourceRange=i,ii.getGeneratedRange=s,ii.getSourceRanges=o,ii.getGeneratedRanges=a,ii.getSourcePositions=u,ii.getGeneratedPositions=l,ii.getLinkedCodePositions=c;function n(f,d,g,m,y,b){return e(f,d,()=>{},function*(w){g(w)&&(yield)},m,y,b)}async function e(f,d,g,m,y,b,w){let x;const _=f.decodeEmbeddedDocumentUri(d);if(_?x=f.language.scripts.get(_[0]):x=f.language.scripts.get(d),!x)return;let S=[];if(_){const A=x.generated?.embeddedCodes.get(_[1]);if(A){const I=[f.documents.get(x.id,x.languageId,x.snapshot),f.documents.get(d,A.languageId,A.snapshot),f.language.maps.get(A,x)];await C(I,!1)}}else if(x.generated)for(const A of r(f,x,x.generated.root))S.length&&!w||await C(A,!0);else{const A=f.documents.get(d,x.languageId,x.snapshot),I=g();for(const[W,B]of Object.entries(f.plugins)){if(f.disabledServicePlugins.has(B[1]))continue;const K=await t(()=>y(B,A,I,void 0),`Language service plugin "${B[0].name}" (${W}) failed to provide document feature for ${A.uri}.`);if(!K)continue;const G=b(K,void 0);if(G&&(S.push(G),!w))break}}if(w&&S.length>0)return w(S);if(S.length>0)return S[0];async function C(A,I){for(const W of m(A))if(!(S.length&&!w))for(const[B,K]of Object.entries(f.plugins)){if(f.disabledServicePlugins.has(K[1])||S.length&&!w)continue;const G=await t(()=>y(K,A[1],W,A),`Language service plugin "${K[0].name}" (${B}) failed to provide document feature for ${A[1].uri}.`);if(G)if(I){const F=b(G,A);F&&S.push(F)}else S.push(G)}}}async function t(f,d){try{return await f()}catch(g){console.warn(d,g)}}function*r(f,d,g){if(g.embeddedCodes)for(const y of g.embeddedCodes)yield*r(f,d,y);const m=f.encodeEmbeddedDocumentUri(d.id,g.id);f.disabledEmbeddedDocumentUris.get(m)||(yield[f.documents.get(d.id,d.languageId,d.snapshot),f.documents.get(m,g.languageId,g.snapshot),f.language.maps.get(g,d)])}function i(f,d,g){for(const m of o(f,d,g))return m}function s(f,d,g){for(const m of a(f,d,g))return m}function*o([f,d,g],m,y){for(const[b,w]of g.toSourceRange(d.offsetAt(m.start),d.offsetAt(m.end),!0,y))yield{start:f.positionAt(b),end:f.positionAt(w)}}function*a([f,d,g],m,y){for(const[b,w]of g.toGeneratedRange(f.offsetAt(m.start),f.offsetAt(m.end),!0,y))yield{start:d.positionAt(b),end:d.positionAt(w)}}function*u([f,d,g],m,y=()=>!0){for(const b of g.toSourceLocation(d.offsetAt(m),y))yield f.positionAt(b[0])}function*l([f,d,g],m,y=()=>!0){for(const b of g.toGeneratedLocation(f.offsetAt(m),y))yield d.positionAt(b[0])}function*c(f,d,g){for(const m of d.getLinkedOffsets(f.offsetAt(g)))yield f.positionAt(m)}return ii}var pD;function $J(){if(pD)return m0;pD=1,Object.defineProperty(m0,"__esModule",{value:!0}),m0.register=r;const n=Ft(),e=lt(),t=At();function r(i){return(s,o,a,u=e.NoneCancellationToken)=>(0,t.languageFeatureWorker)(i,s,()=>({selection:o,change:a}),function*(l){for(const c of(0,t.getGeneratedPositions)(l,o,n.isAutoInsertEnabled))for(const f of l[2].toGeneratedLocation(a.rangeOffset)){yield{selection:c,change:{text:a.text,rangeOffset:f[0],rangeLength:a.rangeLength}};break}},(l,c,f)=>{if(!u.isCancellationRequested)return l[1].provideAutoInsertSnippet?.(c,f.selection,f.change,u)},l=>l)}return m0}var y0={},Ci={},gD;function va(){if(gD)return Ci;gD=1,Object.defineProperty(Ci,"__esModule",{value:!0}),Ci.createLocationSet=n,Ci.withCodeAction=e,Ci.withTextEdits=t,Ci.withDocumentChanges=r,Ci.withDiagnostics=i,Ci.withLocations=s,Ci.withLocationLinks=o,Ci.withCallHierarchyIncomingCalls=a,Ci.withCallHierarchyOutgoingCalls=u,Ci.withRanges=l;function n(){const f=new Set;return{add:d,has:g};function d(y){return g(y)?!1:(f.add(m(y)),!0)}function g(y){return f.has(m(y))}function m(y){return[y.uri,y.range.start.line,y.range.start.character,y.range.end.line,y.range.end.character].join(":")}}function e(f){return c(f,d=>[d.title].join(":"))}function t(f){return c(f,d=>[d.range.start.line,d.range.start.character,d.range.end.line,d.range.end.character,d.newText].join(":"))}function r(f){return c(f,d=>JSON.stringify(d))}function i(f){return c(f,d=>[d.range.start.line,d.range.start.character,d.range.end.line,d.range.end.character,d.source,d.code,d.severity,d.message].join(":"))}function s(f){return c(f,d=>[d.uri,d.range.start.line,d.range.start.character,d.range.end.line,d.range.end.character].join(":"))}function o(f){return c(f,d=>[d.targetUri,d.targetSelectionRange.start.line,d.targetSelectionRange.start.character,d.targetSelectionRange.end.line,d.targetSelectionRange.end.character].join(":"))}function a(f){return c(f,d=>[d.from.uri,d.from.range.start.line,d.from.range.start.character,d.from.range.end.line,d.from.range.end.character].join(":"))}function u(f){return c(f,d=>[d.to.uri,d.to.range.start.line,d.to.range.start.character,d.to.range.end.line,d.to.range.end.character].join(":"))}function l(f){return c(f,d=>[d.start.line,d.start.character,d.end.line,d.end.character].join(":"))}function c(f,d){const g=new Map;for(const m of f.reverse())g.set(d(m),m);return[...g.values()]}return Ci}var mD;function zJ(){if(mD)return y0;mD=1,Object.defineProperty(y0,"__esModule",{value:!0}),y0.register=s;const n=Ft(),e=Kr(),t=lt(),r=va(),i=At();function s(o){return{getCallHierarchyItems(u,l,c=t.NoneCancellationToken){return(0,i.languageFeatureWorker)(o,u,()=>l,f=>(0,i.getGeneratedPositions)(f,l,n.isCallHierarchyEnabled),async(f,d,g,m)=>{if(c.isCancellationRequested)return;const y=await f[1].provideCallHierarchyItems?.(d,g,c);return y?.forEach(b=>{b.data={uri:u.toString(),original:{data:b.data},pluginIndex:o.plugins.indexOf(f),embeddedDocumentUri:m?.[1].uri}}),y},(f,d)=>d?f.map(g=>a(g,[])?.[0]).filter(g=>!!g):f,f=>r.withLocations(f.flat()))},getTypeHierarchyItems(u,l,c=t.NoneCancellationToken){return(0,i.languageFeatureWorker)(o,u,()=>l,f=>(0,i.getGeneratedPositions)(f,l,n.isTypeHierarchyEnabled),async(f,d,g,m)=>{if(c.isCancellationRequested)return;const y=await f[1].provideTypeHierarchyItems?.(d,g,c);return y?.forEach(b=>{b.data={uri:u.toString(),original:{data:b.data},pluginIndex:o.plugins.indexOf(f),embeddedDocumentUri:m?.[1].uri}}),y},(f,d)=>d?f.map(g=>a(g,[])?.[0]).filter(g=>!!g):f,f=>r.withLocations(f.flat()))},async getCallHierarchyIncomingCalls(u,l){const c=u.data;let f=[];if(c){const d=o.plugins[c.pluginIndex];if(!d[1].provideCallHierarchyIncomingCalls)return f;if(Object.assign(u,c.original),c.embeddedDocumentUri){if(!!o.decodeEmbeddedDocumentUri(e.URI.parse(c.embeddedDocumentUri))){const m=await d[1].provideCallHierarchyIncomingCalls(u,l);for(const y of m){const b=a(y.from,y.fromRanges);b&&f.push({from:b[0],fromRanges:b[1]})}}}else{const g=await d[1].provideCallHierarchyIncomingCalls(u,l);for(const m of g){const y=a(m.from,m.fromRanges);y&&f.push({from:y[0],fromRanges:y[1]})}}}return r.withCallHierarchyIncomingCalls(f)},async getCallHierarchyOutgoingCalls(u,l){const c=u.data;let f=[];if(c){const d=o.plugins[c.pluginIndex];if(!d[1].provideCallHierarchyOutgoingCalls)return f;if(Object.assign(u,c.original),c.embeddedDocumentUri){if(!!o.decodeEmbeddedDocumentUri(e.URI.parse(c.embeddedDocumentUri))){const m=await d[1].provideCallHierarchyOutgoingCalls(u,l);for(const y of m){const b=a(y.to,y.fromRanges);b&&f.push({to:b[0],fromRanges:b[1]})}}}else{const g=await d[1].provideCallHierarchyOutgoingCalls(u,l);for(const m of g){const y=a(m.to,m.fromRanges);y&&f.push({to:y[0],fromRanges:y[1]})}}}return r.withCallHierarchyOutgoingCalls(f)},async getTypeHierarchySupertypes(u,l){const c=u.data;if(c){const f=o.plugins[c.pluginIndex];if(!f[1].provideTypeHierarchySupertypes)return[];if(Object.assign(u,c.original),c.embeddedDocumentUri){if(!!o.decodeEmbeddedDocumentUri(e.URI.parse(c.embeddedDocumentUri)))return(await f[1].provideTypeHierarchySupertypes(u,l)).map(m=>a(m,[])?.[0]).filter(m=>!!m)}else return(await f[1].provideTypeHierarchySupertypes(u,l)).map(g=>a(g,[])?.[0]).filter(g=>!!g)}},async getTypeHierarchySubtypes(u,l){const c=u.data;if(c){const f=o.plugins[c.pluginIndex];if(!f[1].provideTypeHierarchySubtypes)return[];if(Object.assign(u,c.original),c.embeddedDocumentUri){if(!!o.decodeEmbeddedDocumentUri(e.URI.parse(c.embeddedDocumentUri)))return(await f[1].provideTypeHierarchySubtypes(u,l)).map(m=>a(m,[])?.[0]).filter(m=>!!m)}else return(await f[1].provideTypeHierarchySubtypes(u,l)).map(g=>a(g,[])?.[0]).filter(g=>!!g)}}};function a(u,l){const c=o.decodeEmbeddedDocumentUri(e.URI.parse(u.uri)),f=c&&o.language.scripts.get(c[0]),d=c&&f?.generated?.embeddedCodes.get(c[1]);if(!f||!d)return[u,l];const g=o.documents.get(o.encodeEmbeddedDocumentUri(f.id,d.id),d.languageId,d.snapshot);for(const[m,y]of o.language.maps.forEach(d)){const b=o.documents.get(m.id,m.languageId,m.snapshot),w=[b,g,y];let x=(0,i.getSourceRange)(w,u.range);x||(x={start:b.positionAt(0),end:b.positionAt(b.getText().length)});const _=(0,i.getSourceRange)(w,u.selectionRange);if(!_)continue;const S=l.map(A=>(0,i.getSourceRange)(w,A)).filter(A=>!!A);return[{...u,name:u.name===g.uri.substring(g.uri.lastIndexOf("/")+1)?b.uri.substring(b.uri.lastIndexOf("/")+1):u.name,uri:b.uri,range:{start:x.start,end:x.end},selectionRange:{start:_.start,end:_.end}},S]}}}return y0}var v0={},jn={},yD;function Ar(){if(yD)return jn;yD=1,Object.defineProperty(jn,"__esModule",{value:!0}),jn.transformDocumentLinkTarget=r,jn.transformMarkdown=i,jn.transformCompletionItem=s,jn.transformCompletionList=o,jn.transformDocumentSymbol=a,jn.transformFoldingRanges=u,jn.transformHover=l,jn.transformLocation=c,jn.transformLocations=f,jn.transformSelectionRange=d,jn.transformSelectionRanges=g,jn.transformTextEdit=m,jn.transformWorkspaceSymbol=b,jn.transformWorkspaceEdit=w,jn.pushEditToDocumentChanges=x;const n=Ft(),e=Kr(),t=At();function r(_,S){let C=e.URI.parse(_);const A=S.decodeEmbeddedDocumentUri(C);if(!A)return C;const I=C.fragment.match(/^L(\d+)(,(\d+))?(-L(\d+)(,(\d+))?)?$/),W=S.language.scripts.get(A[0]),B=W?.generated?.embeddedCodes.get(A[1]);if(C=A[0],I&&W&&B){const K=S.documents.get(S.encodeEmbeddedDocumentUri(W.id,B.id),B.languageId,B.snapshot);for(const[G,F]of S.language.maps.forEach(B)){if(!F.mappings.some(ae=>(0,n.isDocumentLinkEnabled)(ae.data)))continue;const Y=[S.documents.get(G.id,G.languageId,G.snapshot),K,F],q=Number(I[1])-1,te=Number(I[3]??1)-1;if(I[5]!==void 0){const ae=Number(I[5])-1,be=Number(I[7]??1)-1,ye=(0,t.getSourceRange)(Y,{start:{line:q,character:te},end:{line:ae,character:be}});if(ye){C=C.with({fragment:"L"+(ye.start.line+1)+","+(ye.start.character+1)+"-L"+(ye.end.line+1)+","+(ye.end.character+1)});break}}else{let ae=!1;for(const be of(0,t.getSourcePositions)(Y,{line:q,character:te})){ae=!0,C=C.with({fragment:"L"+(be.line+1)+","+(be.character+1)});break}if(ae)break}}}return C}function i(_,S){return _.replace(/(?!\()volar-embedded-content:\/\/\w+\/[^)]+/g,C=>{const A=C.split("|");return A[0]=r(A[0],S).toString(),A.join("|")})}function s(_,S,C,A){return{..._,additionalTextEdits:_.additionalTextEdits?.map(I=>m(I,S,C)).filter(I=>!!I),textEdit:_.textEdit?m(_.textEdit,S,C):void 0,documentation:_.documentation?typeof _.documentation=="string"?i(_.documentation,A):_.documentation.kind==="markdown"?{kind:"markdown",value:i(_.documentation.value,A)}:_.documentation:void 0}}function o(_,S,C,A){return{isIncomplete:_.isIncomplete,itemDefaults:_.itemDefaults?{..._.itemDefaults,editRange:_.itemDefaults.editRange?"replace"in _.itemDefaults.editRange?{insert:S(_.itemDefaults.editRange.insert),replace:S(_.itemDefaults.editRange.replace)}:S(_.itemDefaults.editRange):void 0}:void 0,items:_.items.map(I=>s(I,S,C,A))}}function a(_,S){const C=S(_.range);if(!C)return;const A=S(_.selectionRange);if(A)return{..._,range:C,selectionRange:A,children:_.children?.map(I=>a(I,S)).filter(I=>!!I)}}function u(_,S){const C=[];for(const A of _){const I=S({start:{line:A.startLine,character:A.startCharacter??0},end:{line:A.endLine,character:A.endCharacter??0}});I&&(A.startLine=I.start.line,A.endLine=I.end.line,A.startCharacter!==void 0&&(A.startCharacter=I.start.character),A.endCharacter!==void 0&&(A.endCharacter=I.end.character),C.push(A))}return C}function l(_,S){if(!_?.range)return _;const C=S(_.range);if(C)return{..._,range:C}}function c(_,S){const C=S(_.range);if(C)return{..._,range:C}}function f(_,S){return _.map(C=>c(C,S)).filter(C=>!!C)}function d(_,S){const C=S(_.range);if(!C)return;const A=_.parent?d(_.parent,S):void 0;return{range:C,parent:A}}function g(_,S){return _.map(C=>d(C,S)).filter(C=>!!C)}function m(_,S,C){if("range"in _){let A=S(_.range);if(A)return{..._,range:A};const I=y(S,_.range,_.newText,C);if(I)return{..._,range:I.range,newText:I.newText}}else if("replace"in _&&"insert"in _){const A=S(_.insert),I=A?S(_.replace):void 0;if(A&&I)return{..._,insert:A,replace:I};const W=y(S,_.insert,_.newText,C),B=W?y(S,_.replace,_.newText,C):void 0;if(W&&B&&W.newText===B.newText)return{..._,insert:W.range,replace:B.range,newText:W.newText}}}function y(_,S,C,A){if(S.start.line===S.end.line&&S.end.character>S.start.character){let I=S.start.character;for(;C.length&&S.end.character>I;){const W={line:S.start.line,character:S.start.character+1};if(A.getText({start:S.start,end:W})===C[0]){C=C.slice(1),I++;const B=_({start:W,end:S.end});if(B)return{newText:C,range:B}}else break}}}function b(_,S){if(!("range"in _.location))return _;const C=S(_.location);if(C)return{..._,location:C}}function w(_,S,C,A={}){const I={};let W=!1;for(const B in _.changeAnnotations){I.changeAnnotations??={};const K=_.changeAnnotations[B],G=S.decodeEmbeddedDocumentUri(e.URI.parse(B)),F=G&&S.language.scripts.get(G[0]),R=G&&F?.generated?.embeddedCodes.get(G[1]);if(F&&R)for(const[Y]of S.language.maps.forEach(R)){const q=Y.id.toString();I.changeAnnotations[q]=K;break}else I.changeAnnotations[B]=K}for(const B in _.changes){I.changes??={};const K=S.decodeEmbeddedDocumentUri(e.URI.parse(B)),G=K&&S.language.scripts.get(K[0]),F=K&&G?.generated?.embeddedCodes.get(K[1]);if(G&&F){const R=S.documents.get(S.encodeEmbeddedDocumentUri(G.id,F.id),F.languageId,F.snapshot);for(const[Y,q]of S.language.maps.forEach(F)){const te=S.documents.get(Y.id,Y.languageId,Y.snapshot),ae=[te,R,q],be=_.changes[B];for(const ye of be)if(C==="rename"||C==="fileName"||C==="codeAction"){let De;const we=(0,t.getSourceRange)(ae,ye.range,Pe=>(De=Pe,(0,n.isRenameEnabled)(Pe)));we&&(I.changes[te.uri]??=[],I.changes[te.uri].push({newText:(0,n.resolveRenameEditText)(ye.newText,De),range:we}),W=!0)}else{const De=(0,t.getSourceRange)(ae,ye.range);De&&(I.changes[te.uri]??=[],I.changes[te.uri].push({newText:ye.newText,range:De}),W=!0)}}}else I.changes[B]=_.changes[B],W=!0}if(_.documentChanges)for(const B of _.documentChanges){I.documentChanges??=[];let K;if("textDocument"in B){const G=S.decodeEmbeddedDocumentUri(e.URI.parse(B.textDocument.uri)),F=G&&S.language.scripts.get(G[0]),R=G&&F?.generated?.embeddedCodes.get(G[1]);if(F&&R){const Y=S.documents.get(S.encodeEmbeddedDocumentUri(F.id,R.id),R.languageId,R.snapshot);for(const[q,te]of S.language.maps.forEach(R)){const ae=S.documents.get(q.id,q.languageId,q.snapshot),be=[ae,Y,te];K={textDocument:{uri:ae.uri,version:A[ae.uri]??null},edits:[]};for(const ye of B.edits)if(C==="rename"||C==="fileName"||C==="codeAction"){let De;const we=(0,t.getSourceRange)(be,ye.range,Pe=>(De=Pe,(0,n.isRenameEnabled)(Pe)));we&&K.edits.push({annotationId:"annotationId"in ye?ye.annotationId:void 0,newText:(0,n.resolveRenameEditText)(ye.newText,De),range:we})}else{const De=(0,t.getSourceRange)(be,ye.range);De&&K.edits.push({annotationId:"annotationId"in ye?ye.annotationId:void 0,newText:ye.newText,range:De})}K.edits.length||(K=void 0)}}else K=B}else if(B.kind==="create")K=B;else if(B.kind==="rename"){const G=S.decodeEmbeddedDocumentUri(e.URI.parse(B.oldUri)),F=G&&S.language.scripts.get(G[0]),R=G&&F?.generated?.embeddedCodes.get(G[1]);if(R)for(const[Y]of S.language.maps.forEach(R))K={kind:"rename",oldUri:Y.id.toString(),newUri:B.newUri,options:B.options,annotationId:B.annotationId};else K=B}else if(B.kind==="delete"){const G=S.decodeEmbeddedDocumentUri(e.URI.parse(B.uri)),F=G&&S.language.scripts.get(G[0]),R=G&&F?.generated?.embeddedCodes.get(G[1]);if(R)for(const[Y]of S.language.maps.forEach(R))K={kind:"delete",uri:Y.id.toString(),options:B.options,annotationId:B.annotationId};else K=B}K&&(x(I.documentChanges,K),W=!0)}if(W)return I}function x(_,S){const C=_.find(A=>"textDocument"in A&&"textDocument"in S&&A.textDocument.uri===S.textDocument.uri);C?C.edits.push(...S.edits):_.push(S)}return jn}var vD;function UJ(){if(vD)return v0;vD=1,Object.defineProperty(v0,"__esModule",{value:!0}),v0.register=s;const n=Ft(),e=lt(),t=va(),r=At(),i=Ar();function s(o){return async(a,u,l,c=e.NoneCancellationToken)=>{if(!o.language.scripts.get(a))return;const d=new WeakSet;return await(0,r.languageFeatureWorker)(o,a,()=>({range:u,codeActionContext:l}),function*(g){const m={diagnostics:(0,i.transformLocations)(l.diagnostics,b=>(0,r.getGeneratedRange)(g,b)),only:l.only},y=(0,n.findOverlapCodeRange)(g[0].offsetAt(u.start),g[0].offsetAt(u.end),g[2],n.isCodeActionsEnabled);y&&(yield{range:{start:g[1].positionAt(y.start),end:g[1].positionAt(y.end)},codeActionContext:m})},async(g,m,{range:y,codeActionContext:b})=>{if(c.isCancellationRequested)return;const w=o.plugins.indexOf(g),x=b.diagnostics.filter(S=>{const C=S.data;return C&&C.version!==m.version?!1:C?.pluginIndex===w}).map(S=>{const C=S.data;return{...S,...C.original}}),_=await g[1].provideCodeActions?.(m,y,{...b,diagnostics:x},c);if(_?.forEach(S=>{g[1].resolveCodeAction?S.data={uri:a.toString(),version:m.version,original:{data:S.data,edit:S.edit},pluginIndex:o.plugins.indexOf(g)}:delete S.data}),_&&g[1].transformCodeAction)for(let S=0;S<_.length;S++){const C=g[1].transformCodeAction(_[S]);C&&(_[S]=C,d.add(C))}return _},g=>g.map(m=>{if(d.has(m))return m;if(m.edit){const y=(0,i.transformWorkspaceEdit)(m.edit,o,"codeAction");if(!y)return;m.edit=y}return m}).filter(m=>!!m),g=>t.withCodeAction(g.flat()))}}return v0}var b0={},bD;function HJ(){if(bD)return b0;bD=1,Object.defineProperty(b0,"__esModule",{value:!0}),b0.register=r;const n=Ft(),e=lt(),t=At();function r(i){return async(s,o=e.NoneCancellationToken)=>await(0,t.documentFeatureWorker)(i,s,a=>a[2].mappings.some(u=>(0,n.isCodeLensEnabled)(u.data)),async(a,u)=>{if(o.isCancellationRequested)return;let l=await a[1].provideCodeLenses?.(u,o);const c=i.plugins.indexOf(a);l?.forEach(g=>{a[1].resolveCodeLens?g.data={kind:"normal",uri:s.toString(),original:{data:g.data},pluginIndex:c}:delete g.data});const d=(await a[1].provideReferencesCodeLensRanges?.(u,o))?.map(g=>({range:g,data:{kind:"references",sourceFileUri:s.toString(),workerFileUri:u.uri,workerFileRange:g,pluginIndex:c}}));return l=[...l??[],...d??[]],l},(a,u)=>u?a.map(l=>{const c=(0,t.getSourceRange)(u,l.range,n.isCodeLensEnabled);if(c)return{...l,range:c}}).filter(l=>!!l):a,a=>a.flat())??[]}return b0}var w0={},wD;function VJ(){if(wD)return w0;wD=1,Object.defineProperty(w0,"__esModule",{value:!0}),w0.register=r;const n=Ft(),e=lt(),t=At();function r(i){return(s,o,a,u=e.NoneCancellationToken)=>(0,t.languageFeatureWorker)(i,s,()=>a,function*(l){for(const c of(0,t.getGeneratedRanges)(l,a,n.isColorEnabled))yield c},(l,c,f)=>{if(!u.isCancellationRequested)return l[1].provideColorPresentations?.(c,o,f,u)},(l,c)=>c?l.map(f=>{if(f.textEdit){const d=(0,t.getSourceRange)(c,f.textEdit.range);if(!d)return;f.textEdit.range=d}if(f.additionalTextEdits)for(const d of f.additionalTextEdits){const g=(0,t.getSourceRange)(c,d.range);if(!g)return;d.range=g}return f}).filter(f=>!!f):l)}return w0}var _0={},_D;function GJ(){if(_D)return _0;_D=1,Object.defineProperty(_0,"__esModule",{value:!0}),_0.register=s;const n=Ft(),e=Kr(),t=lt(),r=At(),i=Ar();function s(o){let a;return async(u,l,c={triggerKind:1},f=t.NoneCancellationToken)=>{let d,g;const m=o.decodeEmbeddedDocumentUri(u);if(m?d=o.language.scripts.get(m[0])?.generated?.embeddedCodes.get(m[1]):(g=o.language.scripts.get(u),d=g),!d)return{isIncomplete:!1,items:[]};if(c?.triggerKind===3&&a?.uri.toString()===u.toString())for(const w of a.results){if(!w.list?.isIncomplete)continue;const x=o.plugins.findIndex(_=>_[1]===w.plugin);if(w.embeddedDocumentUri){const _=o.decodeEmbeddedDocumentUri(w.embeddedDocumentUri),S=_&&o.language.scripts.get(_[0]),C=_&&S?.generated?.embeddedCodes.get(_[1]);if(!S||!C)continue;const A=o.documents.get(o.encodeEmbeddedDocumentUri(S.id,C.id),C.languageId,C.snapshot);for(const[I,W]of o.language.maps.forEach(C)){const K=[o.documents.get(I.id,I.languageId,I.snapshot),A,W];for(const G of(0,r.getGeneratedPositions)(K,l,F=>(0,n.isCompletionEnabled)(F)))if(w.plugin.provideCompletionItems&&(w.list=await w.plugin.provideCompletionItems(A,G,c,f),!!w.list)){for(const F of w.list.items)w.plugin.resolveCompletionItem?F.data={uri:u.toString(),original:{additionalTextEdits:F.additionalTextEdits,textEdit:F.textEdit,data:F.data},pluginIndex:x,embeddedDocumentUri:A.uri}:delete F.data;w.list=(0,i.transformCompletionList)(w.list,F=>(0,r.getSourceRange)(K,F),A,o)}}}else{if(!w.plugin.provideCompletionItems)continue;const _=o.documents.get(u,d.languageId,d.snapshot);if(w.list=await w.plugin.provideCompletionItems(_,l,c,f),!w.list)continue;for(const S of w.list.items)w.plugin.resolveCompletionItem?S.data={uri:u.toString(),original:{additionalTextEdits:S.additionalTextEdits,textEdit:S.textEdit,data:S.data},pluginIndex:x,embeddedDocumentUri:void 0}:delete S.data}}else{a={uri:u,results:[]};let w=!0,x;const _=[...o.plugins].filter(C=>!o.disabledServicePlugins.has(C[1])).sort((C,A)=>y(C[1],A[1])),S=async(C,A,I,W)=>{for(const B of _){if(f.isCancellationRequested)break;if(!B[1].provideCompletionItems||B[1].isAdditionalCompletion&&!w||c?.triggerCharacter&&!B[0].capabilities.completionProvider?.triggerCharacters?.includes(c.triggerCharacter))continue;const K=W&&typeof W.completion=="object"&&W.completion.isAdditional||B[1].isAdditionalCompletion;if(x&&(!K||x!==C.uri)||B[1].isAdditionalCompletion&&a?.results.some(R=>R.plugin===B[1]))continue;let G=await B[1].provideCompletionItems(C,A,c,f);if(!G||!G.items.length)continue;typeof W?.completion=="object"&&W.completion.onlyImport&&(G.items=G.items.filter(R=>!!R.labelDetails)),K||(x=C.uri);const F=o.plugins.indexOf(B);for(const R of G.items)B[1].resolveCompletionItem?R.data={uri:u.toString(),original:{additionalTextEdits:R.additionalTextEdits,textEdit:R.textEdit,data:R.data},pluginIndex:F,embeddedDocumentUri:I?C.uri:void 0}:delete R.data;I&&(G=(0,i.transformCompletionList)(G,R=>(0,r.getSourceRange)(I,R,n.isCompletionEnabled),C,o)),a?.results.push({embeddedDocumentUri:I?e.URI.parse(C.uri):void 0,plugin:B[1],list:G})}w=!1};if(g?.generated)for(const C of(0,r.forEachEmbeddedDocument)(o,g,g.generated.root)){let A;for(const I of(0,r.getGeneratedPositions)(C,l,W=>(A=W,(0,n.isCompletionEnabled)(W))))await S(C[1],I,C,A)}else{const C=o.documents.get(u,d.languageId,d.snapshot);await S(C,l)}}return b(a.results.map(w=>w.list));function y(w,x){return(x.isAdditionalCompletion?-1:1)-(w.isAdditionalCompletion?-1:1)}function b(w){return{isIncomplete:w.some(x=>x?.isIncomplete),itemDefaults:w.find(x=>x?.itemDefaults)?.itemDefaults,items:w.map(x=>x?.items??[]).flat()}}}}return _0}var k0={},kD;function KJ(){if(kD)return k0;kD=1,Object.defineProperty(k0,"__esModule",{value:!0}),k0.register=i;const n=Kr(),e=lt(),t=va(),r=At();function i(o,a,u){return(l,c,f=e.NoneCancellationToken)=>(0,r.languageFeatureWorker)(o,l,()=>c,d=>(0,r.getGeneratedPositions)(d,c,u),async(d,g,m)=>{if(f.isCancellationRequested)return;const y=t.createLocationSet(),b=[];return await w(g,m,void 0),b;async function w(x,_,S){const C=d[1][a];if(!C||y.has({uri:x.uri,range:{start:_,end:_}}))return;y.add({uri:x.uri,range:{start:_,end:_}});const A=await C?.(x,_,f)??[];for(const I of A){let W=!1;y.add({uri:I.targetUri,range:{start:I.targetRange.start,end:I.targetRange.start}});const B=o.decodeEmbeddedDocumentUri(n.URI.parse(I.targetUri)),K=B&&o.language.scripts.get(B[0]),G=B&&K?.generated?.embeddedCodes.get(B[1]),F=G&&K?o.language.linkedCodeMaps.get(G):void 0;if(K&&G&&F){const R=o.documents.get(o.encodeEmbeddedDocumentUri(K.id,G.id),G.languageId,G.snapshot);for(const Y of(0,r.getLinkedCodePositions)(R,F,I.targetSelectionRange.start))y.has({uri:R.uri,range:{start:Y,end:Y}})||(W=!0,await w(R,Y,S??I))}W||(S?b.push({...I,originSelectionRange:S.originSelectionRange}):b.push(I))}}},(d,g)=>d.map(m=>{if(m.originSelectionRange&&g){const _=s(g,m.originSelectionRange,c);if(!_)return;m.originSelectionRange=_}let y=!1;const b=o.decodeEmbeddedDocumentUri(n.URI.parse(m.targetUri)),w=b&&o.language.scripts.get(b[0]),x=b&&w?.generated?.embeddedCodes.get(b[1]);if(w&&x){const _=o.documents.get(o.encodeEmbeddedDocumentUri(w.id,x.id),x.languageId,x.snapshot);for(const[S,C]of o.language.maps.forEach(x)){const A=o.documents.get(S.id,S.languageId,S.snapshot),I=[A,_,C],W=(0,r.getSourceRange)(I,m.targetSelectionRange);if(!W)continue;y=!0;let B=(0,r.getSourceRange)(I,m.targetRange);m.targetUri=A.uri,m.targetRange=B??W,m.targetSelectionRange=W}if(a==="provideDefinition"&&!y){for(const[S]of o.language.maps.forEach(x))if(S.id.toString()!==l.toString())return{...m,targetUri:S.id.toString(),targetRange:{start:{line:0,character:0},end:{line:0,character:0}},targetSelectionRange:{start:{line:0,character:0},end:{line:0,character:0}}};return}}return m}).filter(m=>!!m),d=>t.withLocationLinks(d.flat()))}function s(o,a,u){let l;for(const c of(0,r.getSourceRanges)(o,a))if(l||(l=c),(c.start.line<u.line||c.start.line===u.line&&c.start.character<=u.character)&&(c.end.line>u.line||c.end.line===u.line&&c.end.character>=u.character))return c;return l}return k0}var Na={},Gu={},xD;function vp(){if(xD)return Gu;xD=1,Object.defineProperty(Gu,"__esModule",{value:!0}),Gu.isInsideRange=n,Gu.isEqualRange=e,Gu.stringToSnapshot=t,Gu.sleep=r;function n(i,s){return!(s.start.line<i.start.line||s.end.line>i.end.line||s.start.line===i.start.line&&s.start.character<i.start.character||s.end.line===i.end.line&&s.end.character>i.end.character)}function e(i,s){return i.start.line===s.start.line&&i.start.character===s.start.character&&i.end.line===s.end.line&&i.end.character===s.end.character}function t(i){return{getText:(s,o)=>i.substring(s,o),getLength:()=>i.length,getChangeRange:()=>{}}}function r(i){return new Promise(s=>setTimeout(s,i))}return Gu}var x0={},SD;function fx(){if(SD)return x0;SD=1,Object.defineProperty(x0,"__esModule",{value:!0}),x0.createUriMap=n;function n(e=!1){const t=new Map,r=new Map,i=new Map;return{get size(){return t.size},get[Symbol.toStringTag](){return"UriMap"},[Symbol.iterator](){return this.entries()},clear(){return r.clear(),i.clear(),t.clear()},values(){return t.values()},*keys(){for(const o of t.keys())yield i.get(o)},*entries(){for(const[o,a]of t.entries())yield[i.get(o),a]},forEach(o,a){for(const[u,l]of this.entries())o.call(a,l,u,this)},delete(o){return t.delete(s(o))},get(o){return t.get(s(o))},has(o){return t.has(s(o))},set(o,a){return t.set(s(o),a),this}};function s(o){const a=o.toString();if(!r.has(a)){let u=o.toString();e||(u=u.toLowerCase()),r.set(a,u),i.set(u,o)}return r.get(a)}}return x0}var CD;function hx(){if(CD)return Na;CD=1,Object.defineProperty(Na,"__esModule",{value:!0}),Na.errorMarkups=void 0,Na.register=a,Na.transformDiagnostic=u,Na.updateRange=l;const n=Ft(),e=Kr(),t=lt(),r=vp(),i=va(),s=At(),o=fx();Na.errorMarkups=(0,o.createUriMap)();function a(f){const d=(0,o.createUriMap)(),g={semantic:new Map,syntactic:new Map};return f.env.onDidChangeConfiguration?.(()=>{d.clear(),g.semantic.clear(),g.syntactic.clear()}),async(m,y,b=t.NoneCancellationToken)=>{let w;const x=f.decodeEmbeddedDocumentUri(m);if(x?w=f.language.scripts.get(x[0])?.generated?.embeddedCodes.get(x[1]):w=f.language.scripts.get(m),!w)return[];const _=f.documents.get(m,w.languageId,w.snapshot),S=d.get(m)??d.set(m,{semantic:{errors:[]},syntactic:{errors:[]}}).get(m);let C=!1,A=!1,I=0;for(const G of Object.values(S)){const F=G.snapshot,R=G.document,Y=F?w.snapshot.getChangeRange(F):void 0;if(G.snapshot=w.snapshot,G.document=_,!C&&R&&Y){const q={range:{start:R.positionAt(Y.span.start),end:R.positionAt(Y.span.start+Y.span.length)},newEnd:_.positionAt(Y.span.start+Y.newLength)};for(const te of G.errors)if(!l(te.range,q)){C=!0;break}}}return await K("syntactic",g.syntactic,S.syntactic),W(),await K("semantic",g.semantic,S.semantic),B();function W(){A&&!C&&(y?.(B()),A=!1)}function B(){return Object.values(S).flatMap(({errors:G})=>G)}async function K(G,F,R){const Y=await(0,s.documentFeatureWorker)(f,m,q=>q[2].mappings.some(te=>(0,n.isDiagnosticsEnabled)(te.data)),async(q,te)=>{const ae=q[0].capabilities.diagnosticProvider?.interFileDependencies;if(G==="semantic"!==ae||(Date.now()-I>=10&&(await(0,r.sleep)(10),I=Date.now()),b.isCancellationRequested))return;const be=f.plugins.indexOf(q),ye=F.get(be)??F.set(be,new Map).get(be),De=ye.get(te.uri);if(!ae&&De&&De.documentVersion===te.version)return De.errors;const we=await q[1].provideDiagnostics?.(te,b)||[];return we.forEach(Pe=>{Pe.data={uri:m.toString(),version:te.version,pluginIndex:be,isFormat:!1,original:{data:Pe.data},documentUri:te.uri}}),A=!0,ye.set(te.uri,{documentVersion:te.version,errors:we}),we},(q,te)=>q.map(ae=>u(f,ae,te)).filter(ae=>!!ae),q=>i.withDiagnostics(q.flat()));Y&&(R.errors=Y,R.snapshot=w?.snapshot)}}}function u(f,d,g){let m={...d};if(g){const y=(0,s.getSourceRange)(g,d.range,b=>(0,n.shouldReportDiagnostics)(b,d.source,d.code));if(!y)return;m.range=y}if(m.relatedInformation){const y=[];for(const b of m.relatedInformation){const w=f.decodeEmbeddedDocumentUri(e.URI.parse(b.location.uri)),x=w&&f.language.scripts.get(w[0]),_=w&&x?.generated?.embeddedCodes.get(w[1]);if(x&&_){const S=f.documents.get(f.encodeEmbeddedDocumentUri(x.id,_.id),_.languageId,_.snapshot);for(const[C,A]of f.language.maps.forEach(_)){const I=f.documents.get(C.id,C.languageId,C.snapshot),W=[I,S,A],B=(0,s.getSourceRange)(W,b.location.range,K=>(0,n.shouldReportDiagnostics)(K,void 0,void 0));B&&y.push({location:{uri:I.uri,range:B},message:b.message})}}else y.push(b)}m.relatedInformation=y}return m}function l(f,d){if(c(f.start,d,!1)&&c(f.end,d,!0))return f.end.line===f.start.line&&f.end.character<=f.start.character&&f.end.character++,f}function c(f,d,g){if(d.range.end.line>f.line){if(d.newEnd.line>f.line)return!0;if(d.newEnd.line===f.line)return f.character=Math.min(f.character,d.newEnd.character),!0;if(d.newEnd.line<f.line)return f.line=d.newEnd.line,f.character=d.newEnd.character,!0}else if(d.range.end.line===f.line){const m=d.newEnd.character-d.range.end.character;if(f.character>=d.range.end.character){if(d.newEnd.line!==d.range.end.line)f.line=d.newEnd.line,f.character=d.newEnd.character+f.character-d.range.end.character;else if(g?d.range.end.character<f.character:d.range.end.character<=f.character)f.character+=m;else{const y=d.range.end.character-f.character;-m>y&&(f.character+=m+y)}return!0}else{if(d.newEnd.line===d.range.end.line){const y=d.range.end.character-f.character;-m>y&&(f.character+=m+y)}else d.newEnd.line<d.range.end.line&&(f.line=d.newEnd.line,f.character=d.newEnd.character);return!0}}else if(d.range.end.line<f.line)return f.line+=d.newEnd.line-d.range.end.line,!0;return!1}return Na}var S0={},ED;function ZJ(){if(ED)return S0;ED=1,Object.defineProperty(S0,"__esModule",{value:!0}),S0.register=r;const n=Ft(),e=lt(),t=At();function r(i){return(s,o=e.NoneCancellationToken)=>(0,t.documentFeatureWorker)(i,s,a=>a[2].mappings.some(u=>(0,n.isColorEnabled)(u.data)),(a,u)=>{if(!o.isCancellationRequested)return a[1].provideDocumentColors?.(u,o)},(a,u)=>u?a.map(l=>{const c=(0,t.getSourceRange)(u,l.range,n.isColorEnabled);if(c)return{range:c,color:l.color}}).filter(l=>!!l):a,a=>a.flat())}return S0}var C0={},AD;function XJ(){if(AD)return C0;AD=1,Object.defineProperty(C0,"__esModule",{value:!0}),C0.register=r;const n=lt(),e=At(),t=Ar();function r(i){return(s,o,a,u=n.NoneCancellationToken)=>(0,e.languageFeatureWorker)(i,s,()=>o,function*(l){for(const c of(0,e.getGeneratedPositions)(l,o))yield c},(l,c,f)=>{if(!u.isCancellationRequested)return l[1].provideDocumentDropEdits?.(c,f,a,u)},l=>(l.additionalEdit&&(l.additionalEdit=(0,t.transformWorkspaceEdit)(l.additionalEdit,i,void 0)),l))}return C0}var E0={},RD;function YJ(){if(RD)return E0;RD=1,Object.defineProperty(E0,"__esModule",{value:!0}),E0.register=o;const n=Ft(),e=p8,t=Kr(),r=lt(),i=vp(),s=At();function o(l){return async(c,f,d,g,m=r.NoneCancellationToken)=>{const y=l.language.scripts.get(c);if(!y)return;let b=l.documents.get(c,y.languageId,y.snapshot);if(d??={start:b.positionAt(0),end:b.positionAt(b.getText().length)},!y.generated)return g?(await S(b,b,y,void 0,0,g.position,g.ch))?.edits:(await S(b,b,y,void 0,0,d,void 0))?.edits;const w=new Map,x=b.offsetAt(d.start),_=b.offsetAt(d.end);for(const C of(0,n.forEachEmbeddedCode)(y.generated.root)){const A=l.language.maps.get(C,y);if(A){const I=(0,n.findOverlapCodeRange)(x,_,A,n.isFormattingEnabled);if(I){I.start===A.mappings[0].generatedOffsets[0]&&(I.start=0);const W=A.mappings[A.mappings.length-1];I.end===W.generatedOffsets[W.generatedOffsets.length-1]+(W.generatedLengths??W.lengths)[W.lengths.length-1]&&(I.end=C.snapshot.getLength()),w.set(C.id,I)}}}try{const C=b;let A=y.snapshot,I=l.language.scripts.set(t.URI.parse(y.id.toString()+".tmp"),y.snapshot,y.languageId,[y.generated.languagePlugin])?.generated?.root;if(!I)return;let W=[];for(let G=0;(W=a(l,y.id,I,G)).length>0;G++){let F=[];for(const R of W){if(!R.mappings.some(be=>(0,n.isFormattingEnabled)(be.data)))continue;const Y=w.get(R.id);if(!Y||[...(0,n.forEachEmbeddedCode)(R)].some(be=>{if(be===R)return!1;const ye=w.get(be.id);return ye&&ye.end-ye.start>=Y.end-Y.start}))continue;const te=[l.documents.get(c,y.languageId,A),l.documents.get(l.encodeEmbeddedDocumentUri(c,R.id),R.languageId,R.snapshot),l.language.mapperFactory(R.mappings)];let ae;if(g)for(const be of(0,s.getGeneratedPositions)(te,g.position)){ae=await S(te[0],te[1],y,R,G,be,g.ch);break}else Y&&(ae=await S(te[0],te[1],y,R,G,{start:te[1].positionAt(Y.start),end:te[1].positionAt(Y.end)}));if(ae)for(const be of ae.edits){const ye=(0,s.getSourceRange)(te,be.range);ye&&F.push({newText:be.newText,range:ye})}}if(F.length>0){const R=e.TextDocument.applyEdits(b,F);if(b=e.TextDocument.create(b.uri,b.languageId,b.version+1,R),A=(0,i.stringToSnapshot)(R),I=l.language.scripts.set(t.URI.parse(y.id.toString()+".tmp"),A,y.languageId,[y.generated.languagePlugin])?.generated?.root,!I)break}}return b.getText()===C.getText()?void 0:[{range:{start:C.positionAt(0),end:C.positionAt(C.getText().length)},newText:b.getText()}]}finally{l.language.scripts.delete(t.URI.parse(y.id.toString()+".tmp"))}async function S(C,A,I,W,B,K,G){if(l.disabledEmbeddedDocumentUris.get(t.URI.parse(A.uri)))return;let F;if(K??={start:A.positionAt(0),end:A.positionAt(A.getText().length)},W){if(F={level:B,initialIndentLevel:0},W.mappings.length){const Y=W.mappings[0].sourceOffsets[0],q=C.positionAt(Y);F.initialIndentLevel=u(C.getText(),C.offsetAt({line:q.line,character:0}),f)}for(const R of l.plugins)l.disabledServicePlugins.has(R[1])||(F=await R[1].resolveEmbeddedCodeFormattingOptions?.(I,W,F,m)??F)}for(const R of l.plugins){if(l.disabledServicePlugins.has(R[1]))continue;if(m.isCancellationRequested)break;let Y;try{G!==void 0&&K&&"line"in K&&"character"in K?R[0].capabilities.documentOnTypeFormattingProvider?.triggerCharacters?.includes(G)&&(Y=await R[1].provideOnTypeFormattingEdits?.(A,K,G,f,F,m)):G===void 0&&K&&"start"in K&&"end"in K&&(Y=await R[1].provideDocumentFormattingEdits?.(A,K,f,F,m))}catch(q){console.warn(q)}if(Y)return{plugin:R,edits:Y}}}}}function a(l,c,f,d){const g=[[f]];for(;;){if(g.length>d)return g[d];const m=[];for(const y of g[g.length-1])if(y.embeddedCodes)for(const b of y.embeddedCodes)l.disabledEmbeddedDocumentUris.get(l.encodeEmbeddedDocumentUri(c,b.id))||m.push(b);g.push(m)}}function u(l,c,f){let d=0;const g=f.tabSize||4;for(;c<l.length;){const m=l.charAt(c);if(m===" ")d++;else if(m===" ")d+=g;else break;c++}return Math.floor(d/g)}return E0}var A0={},DD;function JJ(){if(DD)return A0;DD=1,Object.defineProperty(A0,"__esModule",{value:!0}),A0.register=s;const n=Ft(),e=Kr(),t=lt(),r=va(),i=At();function s(o){return(a,u,l=t.NoneCancellationToken)=>(0,i.languageFeatureWorker)(o,a,()=>u,c=>(0,i.getGeneratedPositions)(c,u,n.isHighlightEnabled),async(c,f,d)=>{if(l.isCancellationRequested)return;const g=r.createLocationSet(),m=[];return await y(f,d),m;async function y(b,w){if(!c[1].provideDocumentHighlights||g.has({uri:b.uri,range:{start:w,end:w}}))return;g.add({uri:b.uri,range:{start:w,end:w}});const x=await c[1].provideDocumentHighlights(b,w,l)??[];for(const _ of x){let S=!1;g.add({uri:b.uri,range:{start:_.range.start,end:_.range.start}});const C=o.decodeEmbeddedDocumentUri(e.URI.parse(b.uri)),A=C&&o.language.scripts.get(C[0]),I=C&&A?.generated?.embeddedCodes.get(C[1]),W=I&&A?o.language.linkedCodeMaps.get(I):void 0;if(A&&I&&W){const B=o.documents.get(o.encodeEmbeddedDocumentUri(A.id,I.id),I.languageId,I.snapshot);for(const K of(0,i.getLinkedCodePositions)(B,W,_.range.start))g.has({uri:B.uri,range:{start:K,end:K}})||(S=!0,await y(B,K))}S||m.push(_)}}},(c,f)=>c.map(d=>{if(!f)return d;const g=(0,i.getSourceRange)(f,d.range,n.isHighlightEnabled);if(g)return{...d,range:g}}).filter(d=>!!d),c=>c.flat())}return A0}var R0={},TD;function QJ(){if(TD)return R0;TD=1,Object.defineProperty(R0,"__esModule",{value:!0}),R0.register=i;const n=Ft(),e=lt(),t=At(),r=Ar();function i(s){return async(o,a=e.NoneCancellationToken)=>await(0,t.documentFeatureWorker)(s,o,u=>u[2].mappings.some(l=>(0,n.isDocumentLinkEnabled)(l.data)),async(u,l)=>{if(a.isCancellationRequested)return;const c=await u[1].provideDocumentLinks?.(l,a);for(const f of c??[])u[1].resolveDocumentLink?f.data={uri:o.toString(),original:{data:f.data},pluginIndex:s.plugins.indexOf(u)}:delete f.data;return c},(u,l)=>l?u.map(c=>{const f=(0,t.getSourceRange)(l,c.range,n.isDocumentLinkEnabled);if(f)return c={...c,range:f},c.target&&(c.target=(0,r.transformDocumentLinkTarget)(c.target,s).toString()),c}).filter(c=>!!c):u,u=>u.flat())??[]}return R0}var D0={},jh={},ID;function eQ(){if(ID)return jh;ID=1,Object.defineProperty(jh,"__esModule",{value:!0}),jh.SemanticTokensBuilder=void 0;let n=class{constructor(){this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(t,r,i,s,o){let a=t,u=r;this._dataLen>0&&(a-=this._prevLine,a===0&&(u-=this._prevChar)),this._data[this._dataLen++]=a,this._data[this._dataLen++]=u,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._data[this._dataLen++]=o,this._prevLine=t,this._prevChar=r}get id(){return this._id.toString()}build(){return{resultId:this.id,data:this._data}}};return jh.SemanticTokensBuilder=n,jh}var MD;function tQ(){if(MD)return D0;MD=1,Object.defineProperty(D0,"__esModule",{value:!0}),D0.register=i;const n=Ft(),e=eQ(),t=lt(),r=At();function i(o){return async(a,u,l,c,f=t.NoneCancellationToken)=>{const d=o.language.scripts.get(a);if(!d)return;const g=o.documents.get(a,d.languageId,d.snapshot);u||(u={start:{line:0,character:0},end:{line:g.lineCount-1,character:g.getText().length}});const m=await(0,r.languageFeatureWorker)(o,a,()=>u,function*(y){const b=(0,n.findOverlapCodeRange)(y[0].offsetAt(u.start),y[0].offsetAt(u.end),y[2],n.isSemanticTokensEnabled);b&&(yield{start:y[1].positionAt(b.start),end:y[1].positionAt(b.end)})},(y,b,w)=>{if(!f?.isCancellationRequested)return y[1].provideDocumentSemanticTokens?.(b,w,l,f)},(y,b)=>b?y.map(w=>{const x=(0,r.getSourceRange)(b,{start:{line:w[0],character:w[1]},end:{line:w[0],character:w[1]+w[2]}},n.isSemanticTokensEnabled);if(x)return[x.start.line,x.start.character,x.end.character-x.start.character,w[3],w[4]]}).filter(w=>!!w):y,y=>y.flat());if(m)return s(m)}}function s(o){const a=new e.SemanticTokensBuilder,u=o.sort((l,c)=>l[0]-c[0]===0?l[1]-c[1]:l[0]-c[0]);for(const l of u)a.push(...l);return a.build()}return D0}var T0={},OD;function nQ(){if(OD)return T0;OD=1,Object.defineProperty(T0,"__esModule",{value:!0}),T0.register=s;const n=Ft(),e=lt(),t=vp(),r=At(),i=Ar();function s(a){return(u,l=e.NoneCancellationToken)=>(0,r.documentFeatureWorker)(a,u,c=>c[2].mappings.some(f=>(0,n.isSymbolsEnabled)(f.data)),(c,f)=>{if(!l.isCancellationRequested)return c[1].provideDocumentSymbols?.(f,l)},(c,f)=>f?c.map(d=>(0,i.transformDocumentSymbol)(d,g=>(0,r.getSourceRange)(f,g,n.isSymbolsEnabled))).filter(d=>!!d):c,c=>{for(let f=0;f<c.length;f++)for(let d=0;d<c.length;d++)f!==d&&(c[f]=c[f].filter(g=>{for(const m of o(c[d]))if((0,t.isInsideRange)(m.range,g.range))return m.children??=[],m.children.push(g),!1;return!0}));return c.flat()})}function*o(a){for(const u of a)u.children&&(yield*o(u.children)),yield u}return T0}var I0={},PD;function rQ(){if(PD)return I0;PD=1,Object.defineProperty(I0,"__esModule",{value:!0}),I0.register=s;const n=Ft(),e=Kr(),t=lt(),r=va(),i=At();function s(o){return(a,u=t.NoneCancellationToken)=>(0,i.documentFeatureWorker)(o,a,()=>!0,async(l,c)=>{if(!u.isCancellationRequested)return await l[1].provideFileReferences?.(c,u)??[]},l=>l.map(c=>{const f=o.decodeEmbeddedDocumentUri(e.URI.parse(c.uri)),d=f&&o.language.scripts.get(f[0]),g=f&&d?.generated?.embeddedCodes.get(f[1]);if(!d||!g)return c;const m=o.documents.get(o.encodeEmbeddedDocumentUri(d.id,g.id),g.languageId,g.snapshot);for(const[y,b]of o.language.maps.forEach(g)){const w=o.documents.get(y.id,y.languageId,y.snapshot),x=[w,m,b],_=(0,i.getSourceRange)(x,c.range,n.isReferencesEnabled);if(_)return c.uri=w.uri,c.range=_,c}}).filter(c=>!!c),l=>r.withLocations(l.flat()))}return I0}var M0={},LD;function iQ(){if(LD)return M0;LD=1,Object.defineProperty(M0,"__esModule",{value:!0}),M0.register=r;const n=lt(),e=va(),t=Ar();function r(i){return async(s,o,a=n.NoneCancellationToken)=>{for(const u of i.plugins){if(i.disabledServicePlugins.has(u[1]))continue;if(a.isCancellationRequested)break;if(!u[1].provideFileRenameEdits)continue;const l=await u[1].provideFileRenameEdits(s,o,a);if(l){const c=(0,t.transformWorkspaceEdit)(l,i,"fileName");return c?.documentChanges&&(c.documentChanges=e.withDocumentChanges(c.documentChanges)),c}}}}return M0}var O0={},FD;function sQ(){if(FD)return O0;FD=1,Object.defineProperty(O0,"__esModule",{value:!0}),O0.register=i;const n=Ft(),e=lt(),t=At(),r=Ar();function i(s){return(o,a=e.NoneCancellationToken)=>(0,t.documentFeatureWorker)(s,o,u=>u[2].mappings.some(l=>(0,n.isFoldingRangesEnabled)(l.data)),(u,l)=>{if(!a.isCancellationRequested)return u[1].provideFoldingRanges?.(l,a)},(u,l)=>l?(0,r.transformFoldingRanges)(u,c=>(0,t.getSourceRange)(l,c,n.isFoldingRangesEnabled)):u,u=>u.flat())}return O0}var P0={},ND;function oQ(){if(ND)return P0;ND=1,Object.defineProperty(P0,"__esModule",{value:!0}),P0.register=o;const n=Ft(),e=lt(),t=vp(),r=At(),i=Ar(),s=hx();function o(a){return async(l,c,f=e.NoneCancellationToken)=>{let d=await(0,r.languageFeatureWorker)(a,l,()=>c,m=>(0,r.getGeneratedPositions)(m,c,n.isHoverEnabled),(m,y,b)=>{if(!f.isCancellationRequested)return m[1].provideHover?.(y,b,f)},(m,y)=>(!y||!m.range||(m.range=(0,r.getSourceRange)(y,m.range,n.isHoverEnabled)),m),m=>({contents:{kind:"markdown",value:m.map(u).flat().join(`
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
`)},range:m.find(y=>y.range&&(0,t.isInsideRange)(y.range,{start:c,end:c}))?.range??m[0].range}));const g=s.errorMarkups.get(l);if(g)for(const m of g)(0,t.isInsideRange)(m.error.range,{start:c,end:c})&&(d??={contents:{kind:"markdown",value:""}},d.range=m.error.range,(typeof d.contents!="object"||typeof d.contents!="string")&&(d.contents={kind:"markdown",value:d.contents}),d.contents.value&&(d.contents.value+=`
|
|
172
|
-
|
|
173
|
-
---
|
|
174
|
-
|
|
175
|
-
`),d.contents.value+=m.markup.value);return d};function u(l){return typeof l.contents=="string"?[(0,i.transformMarkdown)(l.contents,a)]:Array.isArray(l.contents)?l.contents.map(c=>typeof c=="string"?(0,i.transformMarkdown)(c,a):c.language==="md"?`\`\`\`${c.language}
|
|
176
|
-
${(0,i.transformMarkdown)(c.value,a)}
|
|
177
|
-
\`\`\``:`\`\`\`${c.language}
|
|
178
|
-
${c.value}
|
|
179
|
-
\`\`\``):"kind"in l.contents?l.contents.kind==="markdown"?[(0,i.transformMarkdown)(l.contents.value,a)]:[l.contents.value]:l.contents.language==="md"?[`\`\`\`${l.contents.language}
|
|
180
|
-
${(0,i.transformMarkdown)(l.contents.value,a)}
|
|
181
|
-
\`\`\``]:[`\`\`\`${l.contents.language}
|
|
182
|
-
${l.contents.value}
|
|
183
|
-
\`\`\``]}}return P0}var L0={},BD;function aQ(){if(BD)return L0;BD=1,Object.defineProperty(L0,"__esModule",{value:!0}),L0.register=i;const n=Ft(),e=lt(),t=At(),r=Ar();function i(s){return async(o,a,u=e.NoneCancellationToken)=>{if(s.language.scripts.get(o))return(0,t.languageFeatureWorker)(s,o,()=>a,function*(c){const f=(0,n.findOverlapCodeRange)(c[0].offsetAt(a.start),c[0].offsetAt(a.end),c[2],n.isInlayHintsEnabled);f&&(yield{start:c[1].positionAt(f.start),end:c[1].positionAt(f.end)})},async(c,f,d)=>{if(u.isCancellationRequested)return;const g=await c[1].provideInlayHints?.(f,d,u);return g?.forEach(m=>{c[1].resolveInlayHint?m.data={uri:o.toString(),original:{data:m.data},pluginIndex:s.plugins.indexOf(c)}:delete m.data}),g},(c,f)=>f?c.map(d=>{const g=d.textEdits?.map(m=>(0,r.transformTextEdit)(m,y=>(0,t.getSourceRange)(f,y),f[1])).filter(m=>!!m);for(const m of(0,t.getSourcePositions)(f,d.position,n.isInlayHintsEnabled))return{...d,position:m,textEdits:g}}).filter(d=>!!d):c,c=>c.flat())}}return L0}var F0={},qD;function uQ(){if(qD)return F0;qD=1,Object.defineProperty(F0,"__esModule",{value:!0}),F0.register=r;const n=Ft(),e=lt(),t=At();function r(i){return(s,o,a=e.NoneCancellationToken)=>(0,t.languageFeatureWorker)(i,s,()=>o,u=>(0,t.getGeneratedPositions)(u,o,n.isMonikerEnabled),(u,l,c)=>{if(!a.isCancellationRequested)return u[1].provideMoniker?.(l,c,a)},u=>u,u=>u.flat())}return F0}var N0={},WD;function lQ(){if(WD)return N0;WD=1,Object.defineProperty(N0,"__esModule",{value:!0}),N0.register=r;const n=Ft(),e=lt(),t=At();function r(i){return(s,o,a,u=e.NoneCancellationToken)=>(0,t.languageFeatureWorker)(i,s,()=>o,l=>(0,t.getGeneratedRanges)(l,o,n.isInlineValueEnabled),(l,c,f)=>{if(!u.isCancellationRequested)return l[1].provideInlineValues?.(c,f,a,u)},(l,c)=>c?l.map(f=>{const d=(0,t.getSourceRange)(c,f.range,n.isInlineValueEnabled);if(d)return f.range=d,f}).filter(f=>!!f):l,l=>l.flat())}return N0}var B0={},jD;function cQ(){if(jD)return B0;jD=1,Object.defineProperty(B0,"__esModule",{value:!0}),B0.register=r;const n=Ft(),e=lt(),t=At();function r(i){return(s,o,a=e.NoneCancellationToken)=>(0,t.languageFeatureWorker)(i,s,()=>o,function*(u){for(const l of(0,t.getGeneratedPositions)(u,o,n.isLinkedEditingEnabled))yield l},(u,l,c)=>{if(!a.isCancellationRequested)return u[1].provideLinkedEditingRanges?.(l,c,a)},(u,l)=>l?{wordPattern:u.wordPattern,ranges:u.ranges.map(c=>(0,t.getSourceRange)(l,c,n.isLinkedEditingEnabled)).filter(c=>!!c)}:u)}return B0}var q0={},$D;function g8(){if($D)return q0;$D=1,Object.defineProperty(q0,"__esModule",{value:!0}),q0.register=s;const n=Ft(),e=Kr(),t=lt(),r=va(),i=At();function s(o){return(a,u,l,c=t.NoneCancellationToken)=>(0,i.languageFeatureWorker)(o,a,()=>u,f=>(0,i.getGeneratedPositions)(f,u,n.isReferencesEnabled),async(f,d,g)=>{if(c.isCancellationRequested)return;const m=r.createLocationSet(),y=[];return await b(d,g),y;async function b(w,x){if(!f[1].provideReferences||m.has({uri:w.uri,range:{start:x,end:x}}))return;m.add({uri:w.uri,range:{start:x,end:x}});const _=await f[1].provideReferences(w,x,l,c)??[];for(const S of _){let C=!1;m.add({uri:S.uri,range:{start:S.range.start,end:S.range.start}});const A=o.decodeEmbeddedDocumentUri(e.URI.parse(S.uri)),I=A&&o.language.scripts.get(A[0]),W=A&&I?.generated?.embeddedCodes.get(A[1]),B=W&&I?o.language.linkedCodeMaps.get(W):void 0;if(I&&W&&B){const K=o.documents.get(o.encodeEmbeddedDocumentUri(I.id,W.id),W.languageId,W.snapshot);for(const G of(0,i.getLinkedCodePositions)(K,B,S.range.start))m.has({uri:K.uri,range:{start:G,end:G}})||(C=!0,await b(K,G))}C||y.push(S)}}},f=>{const d=[];for(const g of f){const m=o.decodeEmbeddedDocumentUri(e.URI.parse(g.uri)),y=m&&o.language.scripts.get(m[0]),b=m&&y?.generated?.embeddedCodes.get(m[1]);if(y&&b){const w=o.documents.get(o.encodeEmbeddedDocumentUri(y.id,b.id),b.languageId,b.snapshot);for(const[x,_]of o.language.maps.forEach(b)){const S=o.documents.get(x.id,x.languageId,x.snapshot),C=[S,w,_],A=(0,i.getSourceRange)(C,g.range,n.isReferencesEnabled);A&&d.push({uri:S.uri,range:A})}}else d.push(g)}return d},f=>r.withLocations(f.flat()))}return q0}var $h={},zD;function m8(){if(zD)return $h;zD=1,Object.defineProperty($h,"__esModule",{value:!0}),$h.register=o,$h.mergeWorkspaceEdits=a;const n=Ft(),e=Kr(),t=lt(),r=va(),i=At(),s=Ar();function o(u){return(l,c,f,d=t.NoneCancellationToken)=>(0,i.languageFeatureWorker)(u,l,()=>({position:c,newName:f}),function*(g){let m;for(const y of(0,i.getGeneratedPositions)(g,c,b=>(m=b,(0,n.isRenameEnabled)(b))))yield{position:y,newName:(0,n.resolveRenameNewName)(f,m)}},async(g,m,y)=>{if(d.isCancellationRequested)return;const b=r.createLocationSet();let w;return await x(m,y.position,y.newName),w;async function x(_,S,C){if(!g[1].provideRenameEdits||b.has({uri:_.uri,range:{start:S,end:S}}))return;b.add({uri:_.uri,range:{start:S,end:S}});const A=await g[1].provideRenameEdits(_,S,C,d);if(A){if(w||(w={}),A.changes)for(const I in A.changes){const W=A.changes[I];for(const B of W){let K=!1;b.add({uri:I,range:{start:B.range.start,end:B.range.start}});const G=u.decodeEmbeddedDocumentUri(e.URI.parse(I)),F=G&&u.language.scripts.get(G[0]),R=G&&F?.generated?.embeddedCodes.get(G[1]),Y=R&&F?u.language.linkedCodeMaps.get(R):void 0;if(F&&R&&Y){const q=u.documents.get(u.encodeEmbeddedDocumentUri(F.id,R.id),R.languageId,R.snapshot);for(const te of(0,i.getLinkedCodePositions)(q,Y,B.range.start))b.has({uri:q.uri,range:{start:te,end:te}})||(K=!0,await x(q,te,C))}K||(w.changes||(w.changes={}),w.changes[I]||(w.changes[I]=[]),w.changes[I].push(B))}}if(A.changeAnnotations)for(const I in A.changeAnnotations)w.changeAnnotations||(w.changeAnnotations={}),w.changeAnnotations[I]=A.changeAnnotations[I];A.documentChanges&&(w.documentChanges||(w.documentChanges=[]),w.documentChanges=w.documentChanges.concat(A.documentChanges))}}},g=>(0,s.transformWorkspaceEdit)(g,u,"rename"),g=>{const m=g[0],y=g.slice(1);if(a(m,...y),m.changes)for(const b in m.changes)m.changes[b]=r.withTextEdits(m.changes[b]);return g[0]})}function a(u,...l){for(const c of l){for(const f in c.changeAnnotations)u.changeAnnotations||(u.changeAnnotations={}),u.changeAnnotations[f]=c.changeAnnotations[f];for(const f in c.changes){u.changes||(u.changes={}),u.changes[f]||(u.changes[f]=[]);const d=c.changes[f];u.changes[f]=u.changes[f].concat(d)}if(c.documentChanges){u.documentChanges||(u.documentChanges=[]);for(const f of c.documentChanges)(0,s.pushEditToDocumentChanges)(u.documentChanges,f)}}}return $h}var W0={},UD;function fQ(){if(UD)return W0;UD=1,Object.defineProperty(W0,"__esModule",{value:!0}),W0.register=r;const n=Ft(),e=lt(),t=At();function r(i){return(s,o,a=e.NoneCancellationToken)=>(0,t.languageFeatureWorker)(i,s,()=>o,u=>(0,t.getGeneratedPositions)(u,o,n.isRenameEnabled),(u,l,c)=>{if(!a.isCancellationRequested)return u[1].provideRenameRange?.(l,c,a)},(u,l)=>l&&"start"in u&&"end"in u?(0,t.getSourceRange)(l,u):u,u=>{for(const l of u)if("start"in l&&"end"in l)return l;return u[0]})}return W0}var j0={},HD;function hQ(){if(HD)return j0;HD=1,Object.defineProperty(j0,"__esModule",{value:!0}),j0.register=s;const n=Ft(),e=lt(),t=vp(),r=At(),i=Ar();function s(o){return(a,u,l=e.NoneCancellationToken)=>(0,r.languageFeatureWorker)(o,a,()=>u,function*(c){const f=u.map(d=>{for(const g of(0,r.getGeneratedPositions)(c,d,n.isSelectionRangesEnabled))return g}).filter(d=>!!d);f.length&&(yield f)},async(c,f,d)=>{if(l.isCancellationRequested)return;const g=await c[1].provideSelectionRanges?.(f,d,l);if(g&&g.length!==d.length){console.error("Selection ranges count should be equal to positions count:",c[0].name,g.length,d.length);return}return g},(c,f)=>f?(0,i.transformSelectionRanges)(c,d=>(0,r.getSourceRange)(f,d,n.isSelectionRangesEnabled)):c,c=>{const f=[];for(let d=0;d<u.length;d++){let g=[];for(const m of c)g.push(m[d]);g=g.sort((m,y)=>(0,t.isInsideRange)(m.range,y.range)?1:(0,t.isInsideRange)(y.range,m.range)?-1:0);for(let m=1;m<g.length;m++){let y=g[m-1];const b=g[m];for(;y.parent&&(0,t.isInsideRange)(b.range,y.parent.range)&&!(0,t.isEqualRange)(b.range,y.parent.range);)y=y.parent;y&&(y.parent=b)}f.push(g[0])}return f})}return j0}var $0={},VD;function dQ(){if(VD)return $0;VD=1,Object.defineProperty($0,"__esModule",{value:!0}),$0.register=r;const n=Ft(),e=lt(),t=At();function r(i){return(s,o,a={triggerKind:1,isRetrigger:!1},u=e.NoneCancellationToken)=>(0,t.languageFeatureWorker)(i,s,()=>o,l=>(0,t.getGeneratedPositions)(l,o,n.isSignatureHelpEnabled),(l,c,f)=>{if(!u.isCancellationRequested&&!(a?.triggerKind===2&&a.triggerCharacter&&!(a.isRetrigger?l[0].capabilities.signatureHelpProvider?.retriggerCharacters:l[0].capabilities.signatureHelpProvider?.triggerCharacters)?.includes(a.triggerCharacter)))return l[1].provideSignatureHelp?.(c,f,a,u)},l=>l)}return $0}var z0={},GD;function pQ(){if(GD)return z0;GD=1,Object.defineProperty(z0,"__esModule",{value:!0}),z0.register=r;const n=Kr(),e=lt(),t=hx();function r(i){return async(s=e.NoneCancellationToken)=>{const o=[];for(const a of i.plugins){if(i.disabledServicePlugins.has(a[1]))continue;if(s.isCancellationRequested)break;if(!a[1].provideWorkspaceDiagnostics)continue;const u=await a[1].provideWorkspaceDiagnostics(s);if(!u)continue;const l=u.map(c=>{const f=i.decodeEmbeddedDocumentUri(n.URI.parse(c.uri)),d=f&&i.language.scripts.get(f[0]),g=f&&d?.generated?.embeddedCodes.get(f[1]);if(g&&d){if(c.kind==="unchanged")return{...c,uri:d.id.toString()};{const m=i.language.maps.get(g,d),y=[i.documents.get(d.id,d.languageId,d.snapshot),i.documents.get(i.encodeEmbeddedDocumentUri(d.id,g.id),g.languageId,g.snapshot),m];return{...c,items:c.items.map(b=>(0,t.transformDiagnostic)(i,b,y)).filter(b=>!!b)}}}else return c.kind==="unchanged"?c:{...c,items:c.items.map(m=>(0,t.transformDiagnostic)(i,m,void 0)).filter(m=>!!m)}});o.push(...l)}return o}}return z0}var U0={},KD;function gQ(){if(KD)return U0;KD=1,Object.defineProperty(U0,"__esModule",{value:!0}),U0.register=i;const n=Kr(),e=lt(),t=At(),r=Ar();function i(s){return async(o,a=e.NoneCancellationToken)=>{const u=[];for(const l of s.plugins){if(s.disabledServicePlugins.has(l[1]))continue;if(a.isCancellationRequested)break;if(!l[1].provideWorkspaceSymbols)continue;const c=await l[1].provideWorkspaceSymbols(o,a);if(!c)continue;const f=c.map(d=>(0,r.transformWorkspaceSymbol)(d,g=>{const m=s.decodeEmbeddedDocumentUri(n.URI.parse(g.uri)),y=m&&s.language.scripts.get(m[0]),b=m&&y?.generated?.embeddedCodes.get(m[1]);if(y&&b){const w=s.documents.get(s.encodeEmbeddedDocumentUri(y.id,b.id),b.languageId,b.snapshot);for(const[x,_]of s.language.maps.forEach(b)){const S=s.documents.get(x.id,x.languageId,x.snapshot),C=[S,w,_],A=(0,t.getSourceRange)(C,g.range);if(A)return{uri:S.uri,range:A}}}else return g})).filter(d=>!!d);f?.forEach(d=>{l[1].resolveWorkspaceSymbol?d.data={original:{data:d.data},pluginIndex:s.plugins.indexOf(l)}:delete d.data}),u.push(f)}return u.flat()}}return U0}var H0={},ZD;function mQ(){if(ZD)return H0;ZD=1,Object.defineProperty(H0,"__esModule",{value:!0}),H0.register=t;const n=lt(),e=Ar();function t(r){return async(i,s=n.NoneCancellationToken)=>{const o=i.data;if(o){const a=r.plugins[o.pluginIndex];if(!a[1].resolveCodeAction)return delete i.data,i;Object.assign(i,o.original),i=await a[1].resolveCodeAction(i,s),i=a[1].transformCodeAction?.(i)??(i.edit?{...i,edit:(0,e.transformWorkspaceEdit)(i.edit,r,"codeAction",{[o.uri]:o.version})}:i)}return delete i.data,i}}return H0}var V0={},XD;function yQ(){if(XD)return V0;XD=1,Object.defineProperty(V0,"__esModule",{value:!0}),V0.register=r;const n=Kr(),e=lt(),t=g8();function r(i){const s=t.register(i);return async(o,a=e.NoneCancellationToken)=>{const u=o.data;if(u?.kind==="normal"){const l=i.plugins[u.pluginIndex];if(!l[1].resolveCodeLens)return delete o.data,o;Object.assign(o,u.original),o=await l[1].resolveCodeLens(o,a)}else if(u?.kind==="references"){const l=await s(n.URI.parse(u.sourceFileUri),o.range.start,{includeDeclaration:!1},a)??[];o.command=i.commands.showReferences.create(u.sourceFileUri,o.range.start,l)}return delete o.data,o}}return V0}var G0={},YD;function vQ(){if(YD)return G0;YD=1,Object.defineProperty(G0,"__esModule",{value:!0}),G0.register=i;const n=Kr(),e=lt(),t=At(),r=Ar();function i(s){return async(o,a=e.NoneCancellationToken)=>{const u=o.data;if(u){const l=s.plugins[u.pluginIndex];if(!l[1].resolveCompletionItem)return delete o.data,o;if(o=Object.assign(o,u.original),u.embeddedDocumentUri){const c=s.decodeEmbeddedDocumentUri(n.URI.parse(u.embeddedDocumentUri)),f=c&&s.language.scripts.get(c[0]),d=c&&f?.generated?.embeddedCodes.get(c[1]);if(f&&d){const g=s.documents.get(s.encodeEmbeddedDocumentUri(f.id,d.id),d.languageId,d.snapshot);for(const[m,y]of s.language.maps.forEach(d)){const w=[s.documents.get(m.id,m.languageId,m.snapshot),g,y];o=await l[1].resolveCompletionItem(o,a),o=l[1].transformCompletionItem?.(o)??(0,r.transformCompletionItem)(o,x=>(0,t.getSourceRange)(w,x),g,s)}}}else o=await l[1].resolveCompletionItem(o,a)}return o.detail!==o.detail+".ts"&&(o.detail=o.detail),delete o.data,o}}return G0}var K0={},JD;function bQ(){if(JD)return K0;JD=1,Object.defineProperty(K0,"__esModule",{value:!0}),K0.register=t;const n=lt(),e=Ar();function t(r){return async(i,s=n.NoneCancellationToken)=>{const o=i.data;if(o){const a=r.plugins[o.pluginIndex];if(!a[1].resolveDocumentLink)return delete i.data,i;Object.assign(i,o.original),i=await a[1].resolveDocumentLink(i,s),i.target&&(i.target=(0,e.transformDocumentLinkTarget)(i.target,r).toString())}return delete i.data,i}}return K0}var Z0={},QD;function wQ(){if(QD)return Z0;QD=1,Object.defineProperty(Z0,"__esModule",{value:!0}),Z0.register=e;const n=lt();function e(t){return async(r,i=n.NoneCancellationToken)=>{const s=r.data;if(s){const o=t.plugins[s.pluginIndex];if(!o[1].resolveInlayHint)return delete r.data,r;Object.assign(r,s.original),r=await o[1].resolveInlayHint(r,i)}return delete r.data,r}}return Z0}var X0={},eT;function _Q(){if(eT)return X0;eT=1,Object.defineProperty(X0,"__esModule",{value:!0}),X0.register=e;const n=lt();function e(t){return async(r,i=n.NoneCancellationToken)=>{const s=r.data;if(s){const o=t.plugins[s.pluginIndex];if(!o[1].resolveWorkspaceSymbol)return delete r.data,r;Object.assign(r,s.original),r=await o[1].resolveWorkspaceSymbol(r,i)}return delete r.data,r}}return X0}var tT;function kQ(){return tT||(tT=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.embeddedContentScheme=void 0,n.createLanguageService=Xt,n.decodeEmbeddedDocumentUri=Bn,n.encodeEmbeddedDocumentUri=rn;const e=Ft(),t=p8,r=Kr(),i=$J(),s=zJ(),o=UJ(),a=HJ(),u=VJ(),l=GJ(),c=KJ(),f=hx(),d=ZJ(),g=XJ(),m=YJ(),y=JJ(),b=QJ(),w=tQ(),x=nQ(),_=rQ(),S=iQ(),C=sQ(),A=oQ(),I=aQ(),W=uQ(),B=lQ(),K=cQ(),G=g8(),F=m8(),R=fQ(),Y=hQ(),q=dQ(),te=pQ(),ae=gQ(),be=mQ(),ye=yQ(),De=vQ(),we=bQ(),Pe=wQ(),Rt=_Q(),kt=lt(),rt=fx();n.embeddedContentScheme="volar-embedded-content";function Xt(Pt,Se,Ye,In){const Le=(0,rt.createUriMap)(),$t=new WeakMap,Cn={language:Pt,project:In,getLanguageService:()=>Yt,documents:{get(at,qn,Dt){$t.has(Dt)||$t.set(Dt,(0,rt.createUriMap)());const ct=$t.get(Dt);if(!ct.has(at)){const hr=Le.get(at)??0;Le.set(at,hr+1),ct.set(at,t.TextDocument.create(at.toString(),qn,hr,Dt.getText(0,Dt.getLength())))}return ct.get(at)}},env:Ye,inject:(at,...qn)=>{for(const Dt of Cn.plugins){if(Cn.disabledServicePlugins.has(Dt[1]))continue;const ct=Dt[1].provide?.[at];if(ct)return ct(...qn)}},plugins:[],commands:{rename:{create(at,qn){return{title:"",command:"editor.action.rename",arguments:[at,qn]}},is(at){return at.command==="editor.action.rename"}},showReferences:{create(at,qn,Dt){return{title:Dt.length===1?"1 reference":`${Dt.length} references`,command:"editor.action.showReferences",arguments:[at,qn,Dt]}},is(at){return at.command==="editor.action.showReferences"}},setSelection:{create(at){return{title:"",command:"setSelection",arguments:[{selection:{selectionStartLineNumber:at.line+1,positionLineNumber:at.line+1,selectionStartColumn:at.character+1,positionColumn:at.character+1}}]}},is(at){return at.command==="setSelection"}}},disabledEmbeddedDocumentUris:(0,rt.createUriMap)(),disabledServicePlugins:new WeakSet,decodeEmbeddedDocumentUri:Bn,encodeEmbeddedDocumentUri:rn};for(const at of Se)Cn.plugins.push([at,at.create(Cn)]);const Yt=yn(Se,Cn);return Yt}function Bn(Pt){if(Pt.scheme===n.embeddedContentScheme){const Se=decodeURIComponent(Pt.authority),Ye=decodeURIComponent(Pt.path.substring(1));return[r.URI.parse(Ye),Se]}}function rn(Pt,Se){return Se!==Se.toLowerCase()&&console.error(`embeddedContentId must be lowercase: ${Se}`),r.URI.from({scheme:n.embeddedContentScheme,authority:encodeURIComponent(Se),path:"/"+encodeURIComponent(Pt.toString())})}function yn(Pt,Se){const Ye=Pt.map(Le=>Le.capabilities.semanticTokensProvider?.legend?.tokenModifiers??[]).flat(),In=Pt.map(Le=>Le.capabilities.semanticTokensProvider?.legend?.tokenTypes??[]).flat();return{semanticTokenLegend:{tokenModifiers:[...new Set(Ye)],tokenTypes:[...new Set(In)]},commands:Pt.map(Le=>Le.capabilities.executeCommandProvider?.commands??[]).flat(),triggerCharacters:Pt.map(Le=>Le.capabilities.completionProvider?.triggerCharacters??[]).flat(),autoFormatTriggerCharacters:Pt.map(Le=>Le.capabilities.documentOnTypeFormattingProvider?.triggerCharacters??[]).flat(),signatureHelpTriggerCharacters:Pt.map(Le=>Le.capabilities.signatureHelpProvider?.triggerCharacters??[]).flat(),signatureHelpRetriggerCharacters:Pt.map(Le=>Le.capabilities.signatureHelpProvider?.retriggerCharacters??[]).flat(),executeCommand(Le,$t,Cn=kt.NoneCancellationToken){for(const Yt of Se.plugins)if(!Se.disabledServicePlugins.has(Yt[1])&&!(!Yt[1].executeCommand||!Yt[0].capabilities.executeCommandProvider?.commands.includes(Le)))return Yt[1].executeCommand(Le,$t,Cn)},getDocumentFormattingEdits:m.register(Se),getFoldingRanges:C.register(Se),getSelectionRanges:Y.register(Se),getLinkedEditingRanges:K.register(Se),getDocumentSymbols:x.register(Se),getDocumentColors:d.register(Se),getColorPresentations:u.register(Se),getDiagnostics:f.register(Se),getWorkspaceDiagnostics:te.register(Se),getReferences:G.register(Se),getFileReferences:_.register(Se),getDeclaration:c.register(Se,"provideDeclaration",e.isDefinitionEnabled),getDefinition:c.register(Se,"provideDefinition",e.isDefinitionEnabled),getTypeDefinition:c.register(Se,"provideTypeDefinition",e.isTypeDefinitionEnabled),getImplementations:c.register(Se,"provideImplementation",e.isImplementationEnabled),getRenameRange:R.register(Se),getRenameEdits:F.register(Se),getFileRenameEdits:S.register(Se),getSemanticTokens:w.register(Se),getHover:A.register(Se),getCompletionItems:l.register(Se),getCodeActions:o.register(Se),getSignatureHelp:q.register(Se),getCodeLenses:a.register(Se),getDocumentHighlights:y.register(Se),getDocumentLinks:b.register(Se),getWorkspaceSymbols:ae.register(Se),getAutoInsertSnippet:i.register(Se),getDocumentDropEdits:g.register(Se),getInlayHints:I.register(Se),getMoniker:W.register(Se),getInlineValue:B.register(Se),resolveCodeAction:be.register(Se),resolveCompletionItem:De.register(Se),resolveCodeLens:ye.register(Se),resolveDocumentLink:we.register(Se),resolveInlayHint:Pe.register(Se),resolveWorkspaceSymbol:Rt.register(Se),...s.register(Se),dispose:()=>Se.plugins.forEach(Le=>Le[1].dispose?.()),context:Se}}}(Db)),Db}var zh={},nT;function xQ(){if(nT)return zh;nT=1,Object.defineProperty(zh,"__esModule",{value:!0}),zh.FileType=void 0;var n;return function(e){e[e.Unknown=0]="Unknown",e[e.File=1]="File",e[e.Directory=2]="Directory",e[e.SymbolicLink=64]="SymbolicLink"}(n||(zh.FileType=n={})),zh}var rT;function SQ(){return rT||(rT=1,function(n){var e=Uu&&Uu.__createBinding||(Object.create?function(i,s,o,a){a===void 0&&(a=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,a,u)}:function(i,s,o,a){a===void 0&&(a=o),i[a]=s[o]}),t=Uu&&Uu.__exportStar||function(i,s){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),n.mergeWorkspaceEdits=void 0,t(Ft(),n),t(kQ(),n);var r=m8();Object.defineProperty(n,"mergeWorkspaceEdits",{enumerable:!0,get:function(){return r.mergeWorkspaceEdits}}),t(xQ(),n),t(Ar(),n),t(fx(),n)}(Uu)),Uu}var br=SQ();pp.set("asyncGenerator",MJ);pp.set("watchOptions",OJ);var w1;(n=>{n.fromJswasi=async t=>{t.initializing?(console.log("awaiting",t.initializing),await t.initializing):(console.log("reinit",t.initializing),await t.init());const r=f=>{switch(f){case 3:return br.FileType.Directory;case 7:return br.FileType.SymbolicLink;default:return br.FileType.File}},i=f=>f&&f.startsWith("/")?f:`/${f??""}`,s=t.constants??{},o=s.WASI_ESUCCESS??0,a=s.WASI_EEXIST??20,u=s.WASI_O_TRUNC??16,l=s.WASI_O_CREAT??1,c=s.WASI_O_DIRECTORY??131072;return{async readFile(f){const d=i(f),{desc:g,err:m}=await t.topLevelFs.open(d);if(m!==o)throw new Error(`readFile open failed (${m}) for ${d}`);const{content:y,err:b}=await g.read_str();if(b!==o)throw new Error(`readFile read_str failed (${b}) for ${d}`);return g.close(),y},async writeFile(f,d){const g=i(f),{desc:m,err:y}=await t.topLevelFs.open(g,0,l|u);if(y!==o)throw new Error(`writeFile open failed (${y}) for ${g}`);const w=new TextEncoder().encode(d),{err:x}=await m.pwrite(w.buffer,0n);if(m.close(),x!==o)throw new Error(`writeFile pwrite failed (${x}) for ${g}`)},async*watch(f,{signal:d}){await new Promise(g=>{if(d.aborted)return g();const m=()=>g();d.addEventListener("abort",m,{once:!0})})},async mkdir(f,d){const g=i(f);if(d?.recursive){const m=g.split("/").filter(Boolean);let y="/";for(const b of m){y=y==="/"?`/${b}`:`${y}/${b}`;const w=await t.topLevelFs.createDir(y);if(w!==o&&w!==a)throw new Error(`mkdir recursive failed (${w}) at ${y}`)}}else{const m=await t.topLevelFs.createDir(g);if(m!==o)throw new Error(`mkdir failed (${m}) for ${g}`)}},async readDir(f){const d=i(f),{desc:g,err:m}=await t.topLevelFs.open(d,0,c);if(m!==o)throw new Error(`readDir open failed (${m}) for ${d}`);const{err:y,dirents:b}=await g.readdir(!0);if(y!==o)throw new Error(`readDir readdir failed (${y}) for ${d}`);return b.map(w=>[w.name,r(w.d_type)])},async exists(f){const d=i(f),{desc:g,err:m}=await t.topLevelFs.open(d);if(m!==o)return!1;const y=await g.getFilestat();return g.close(),y.err===o},async stat(f){const d=i(f),{desc:g,err:m}=await t.topLevelFs.open(d);if(m!==o)return null;const y=await g.getFilestat();if(g.close(),y.err!==o)return null;const b=y.filestat,w=x=>new Date(Number(x/1000000n));return{name:d,atime:w(b.atim),mtime:w(b.mtim),ctime:w(b.ctim),size:Number(b.size),type:r(b.filetype)}}}},n.fromMemfs=t=>({async readFile(r){return t.promises.readFile(r,{encoding:"utf-8"})},async writeFile(r,i){await t.promises.writeFile(r,i)},async*watch(r,{signal:i}){for await(const s of await t.promises.watch(r,{signal:i,encoding:"utf-8",recursive:!0}))yield s},async mkdir(r,i){await t.promises.mkdir(r,i)},async readDir(r){return(await t.readdirSync(r,{withFileTypes:!0,encoding:"utf-8"})).map(s=>{let o=br.FileType.File;switch(s.mode&61440){case 16384:o=br.FileType.Directory;break;case 40960:o=br.FileType.SymbolicLink;break}return[s.name,o]})},async exists(r){return t.existsSync(r)},async stat(r){try{const i=await t.promises.stat(r);let s=br.FileType.File;switch(i.mode&61440){case 16384:s=br.FileType.Directory;break;case 40960:s=br.FileType.SymbolicLink;break}return{name:r,atime:i.atime,mtime:i.mtime,ctime:i.ctime,size:i.size,type:s}}catch{return null}}}),n.fromNodelike=t=>({async readFile(r){return t.readFile(r,{encoding:"utf-8"})},async writeFile(r,i){await t.writeFile(r,i)},async*watch(r,{signal:i}){for await(const s of await t.watch(r,{signal:i,encoding:"utf-8",recursive:!0}))yield s},async mkdir(r,i){await t.mkdir(r,i)},async readDir(r){return(await t.readdir(r,{withFileTypes:!0,encoding:"utf-8"})).map(s=>{let o=br.FileType.File;switch(s.stats.mode&61440){case 16384:o=br.FileType.Directory;break;case 40960:o=br.FileType.SymbolicLink;break}return[s.path,o]})},async exists(r){try{return await t.access(r),!0}catch{return!1}},async stat(r){try{const i=await t.stat(r);let s=br.FileType.File;switch(i.mode&61440){case 16384:s=br.FileType.Directory;break;case 40960:s=br.FileType.SymbolicLink;break}return{name:r,atime:i.atime,mtime:i.mtime,ctime:i.ctime,size:i.size,type:s}}catch{return null}}}),n.worker=async t=>{const r=new URL("/assets/fs.worker-BwEqZcql.ts",import.meta.url),i=new SharedWorker(r,{type:"module"});i.port.start();const s=nx(i.port);let o;return t?typeof t=="string"?{fs:o}=await s.mountFromUrl({url:t,mountPoint:"/"}):{fs:o}=await s.mount(LP({buffer:t,mountPoint:"/"},[t])):{fs:o}=await s.mount({mountPoint:"/"}),Q1(n.fromMemfs(o))};async function*e(t,r){const i=await t.readDir(r);for(const[s,o]of i){const a=`${r==="/"?"":r}/${s}`;o===br.FileType.Directory?yield*e(t,a):yield a}}n.walk=e})(w1||(w1={}));const CQ="ENTRIES",y8="KEYS",v8="VALUES",rr="";class Tb{constructor(e,t){const r=e._tree,i=Array.from(r.keys());this.set=e,this._type=t,this._path=i.length>0?[{node:r,keys:i}]:[]}next(){const e=this.dive();return this.backtrack(),e}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:e,keys:t}=ic(this._path);if(ic(t)===rr)return{done:!1,value:this.result()};const r=e.get(ic(t));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const e=ic(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:e})=>ic(e)).filter(e=>e!==rr).join("")}value(){return ic(this._path).node.get(rr)}result(){switch(this._type){case v8:return this.value();case y8:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const ic=n=>n[n.length-1],EQ=(n,e,t)=>{const r=new Map;if(e===void 0)return r;const i=e.length+1,s=i+t,o=new Uint8Array(s*i).fill(t+1);for(let a=0;a<i;++a)o[a]=a;for(let a=1;a<s;++a)o[a*i]=a;return b8(n,e,t,r,o,1,i,""),r},b8=(n,e,t,r,i,s,o,a)=>{const u=s*o;e:for(const l of n.keys())if(l===rr){const c=i[u-1];c<=t&&r.set(a,[n.get(l),c])}else{let c=s;for(let f=0;f<l.length;++f,++c){const d=l[f],g=o*c,m=g-o;let y=i[g];const b=Math.max(0,c-t-1),w=Math.min(o-1,c+t);for(let x=b;x<w;++x){const _=d!==e[x],S=i[m+x]+ +_,C=i[m+x+1]+1,A=i[g+x]+1,I=i[g+x+1]=Math.min(S,C,A);I<y&&(y=I)}if(y>t)continue e}b8(n.get(l),e,t,r,i,c,o,a+l)}};class Ya{constructor(e=new Map,t=""){this._size=void 0,this._tree=e,this._prefix=t}atPrefix(e){if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");const[t,r]=_1(this._tree,e.slice(this._prefix.length));if(t===void 0){const[i,s]=dx(r);for(const o of i.keys())if(o!==rr&&o.startsWith(s)){const a=new Map;return a.set(o.slice(s.length),i.get(o)),new Ya(a,e)}}return new Ya(t,e)}clear(){this._size=void 0,this._tree.clear()}delete(e){return this._size=void 0,AQ(this._tree,e)}entries(){return new Tb(this,CQ)}forEach(e){for(const[t,r]of this)e(t,r,this)}fuzzyGet(e,t){return EQ(this._tree,e,t)}get(e){const t=k2(this._tree,e);return t!==void 0?t.get(rr):void 0}has(e){const t=k2(this._tree,e);return t!==void 0&&t.has(rr)}keys(){return new Tb(this,y8)}set(e,t){if(typeof e!="string")throw new Error("key must be a string");return this._size=void 0,Ib(this._tree,e).set(rr,t),this}get size(){if(this._size)return this._size;this._size=0;const e=this.entries();for(;!e.next().done;)this._size+=1;return this._size}update(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;const r=Ib(this._tree,e);return r.set(rr,t(r.get(rr))),this}fetch(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;const r=Ib(this._tree,e);let i=r.get(rr);return i===void 0&&r.set(rr,i=t()),i}values(){return new Tb(this,v8)}[Symbol.iterator](){return this.entries()}static from(e){const t=new Ya;for(const[r,i]of e)t.set(r,i);return t}static fromObject(e){return Ya.from(Object.entries(e))}}const _1=(n,e,t=[])=>{if(e.length===0||n==null)return[n,t];for(const r of n.keys())if(r!==rr&&e.startsWith(r))return t.push([n,r]),_1(n.get(r),e.slice(r.length),t);return t.push([n,e]),_1(void 0,"",t)},k2=(n,e)=>{if(e.length===0||n==null)return n;for(const t of n.keys())if(t!==rr&&e.startsWith(t))return k2(n.get(t),e.slice(t.length))},Ib=(n,e)=>{const t=e.length;e:for(let r=0;n&&r<t;){for(const s of n.keys())if(s!==rr&&e[r]===s[0]){const o=Math.min(t-r,s.length);let a=1;for(;a<o&&e[r+a]===s[a];)++a;const u=n.get(s);if(a===s.length)n=u;else{const l=new Map;l.set(s.slice(a),u),n.set(e.slice(r,r+a),l),n.delete(s),n=l}r+=a;continue e}const i=new Map;return n.set(e.slice(r),i),i}return n},AQ=(n,e)=>{const[t,r]=_1(n,e);if(t!==void 0){if(t.delete(rr),t.size===0)w8(r);else if(t.size===1){const[i,s]=t.entries().next().value;_8(r,i,s)}}},w8=n=>{if(n.length===0)return;const[e,t]=dx(n);if(e.delete(t),e.size===0)w8(n.slice(0,-1));else if(e.size===1){const[r,i]=e.entries().next().value;r!==rr&&_8(n.slice(0,-1),r,i)}},_8=(n,e,t)=>{if(n.length===0)return;const[r,i]=dx(n);r.set(i+e,t),r.delete(i)},dx=n=>n[n.length-1],px="or",k8="and",RQ="and_not";class al{constructor(e){if(e?.fields==null)throw new Error('MiniSearch: option "fields" must be provided');const t=e.autoVacuum==null||e.autoVacuum===!0?Pb:e.autoVacuum;this._options={...Ob,...e,autoVacuum:t,searchOptions:{...iT,...e.searchOptions||{}},autoSuggestOptions:{...OQ,...e.autoSuggestOptions||{}}},this._index=new Ya,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=S2,this.addFields(this._options.fields)}add(e){const{extractField:t,tokenize:r,processTerm:i,fields:s,idField:o}=this._options,a=t(e,o);if(a==null)throw new Error(`MiniSearch: document does not have ID field "${o}"`);if(this._idToShortId.has(a))throw new Error(`MiniSearch: duplicate ID ${a}`);const u=this.addDocumentId(a);this.saveStoredFields(u,e);for(const l of s){const c=t(e,l);if(c==null)continue;const f=r(c.toString(),l),d=this._fieldIds[l],g=new Set(f).size;this.addFieldLength(u,d,this._documentCount-1,g);for(const m of f){const y=i(m,l);if(Array.isArray(y))for(const b of y)this.addTerm(d,u,b);else y&&this.addTerm(d,u,y)}}}addAll(e){for(const t of e)this.add(t)}addAllAsync(e,t={}){const{chunkSize:r=10}=t,i={chunk:[],promise:Promise.resolve()},{chunk:s,promise:o}=e.reduce(({chunk:a,promise:u},l,c)=>(a.push(l),(c+1)%r===0?{chunk:[],promise:u.then(()=>new Promise(f=>setTimeout(f,0))).then(()=>this.addAll(a))}:{chunk:a,promise:u}),i);return o.then(()=>this.addAll(s))}remove(e){const{tokenize:t,processTerm:r,extractField:i,fields:s,idField:o}=this._options,a=i(e,o);if(a==null)throw new Error(`MiniSearch: document does not have ID field "${o}"`);const u=this._idToShortId.get(a);if(u==null)throw new Error(`MiniSearch: cannot remove document with ID ${a}: it is not in the index`);for(const l of s){const c=i(e,l);if(c==null)continue;const f=t(c.toString(),l),d=this._fieldIds[l],g=new Set(f).size;this.removeFieldLength(u,d,this._documentCount,g);for(const m of f){const y=r(m,l);if(Array.isArray(y))for(const b of y)this.removeTerm(d,u,b);else y&&this.removeTerm(d,u,y)}}this._storedFields.delete(u),this._documentIds.delete(u),this._idToShortId.delete(a),this._fieldLength.delete(u),this._documentCount-=1}removeAll(e){if(e)for(const t of e)this.remove(t);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Ya,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(e){const t=this._idToShortId.get(e);if(t==null)throw new Error(`MiniSearch: cannot discard document with ID ${e}: it is not in the index`);this._idToShortId.delete(e),this._documentIds.delete(t),this._storedFields.delete(t),(this._fieldLength.get(t)||[]).forEach((r,i)=>{this.removeFieldLength(t,i,this._documentCount,r)}),this._fieldLength.delete(t),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:e,minDirtCount:t,batchSize:r,batchWait:i}=this._options.autoVacuum;this.conditionalVacuum({batchSize:r,batchWait:i},{minDirtCount:t,minDirtFactor:e})}discardAll(e){const t=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const r of e)this.discard(r)}finally{this._options.autoVacuum=t}this.maybeAutoVacuum()}replace(e){const{idField:t,extractField:r}=this._options,i=r(e,t);this.discard(i),this.add(e)}vacuum(e={}){return this.conditionalVacuum(e)}conditionalVacuum(e,t){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const r=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=S2,this.performVacuuming(e,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)}async performVacuuming(e,t){const r=this._dirtCount;if(this.vacuumConditionsMet(t)){const i=e.batchSize||x2.batchSize,s=e.batchWait||x2.batchWait;let o=1;for(const[a,u]of this._index){for(const[l,c]of u)for(const[f]of c)this._documentIds.has(f)||(c.size<=1?u.delete(l):c.delete(f));this._index.get(a).size===0&&this._index.delete(a),o%i===0&&await new Promise(l=>setTimeout(l,s)),o+=1}this._dirtCount-=r}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(e){if(e==null)return!0;let{minDirtCount:t,minDirtFactor:r}=e;return t=t||Pb.minDirtCount,r=r||Pb.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=r}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(e){return this._idToShortId.has(e)}getStoredFields(e){const t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)}search(e,t={}){const{searchOptions:r}=this._options,i={...r,...t},s=this.executeQuery(e,t),o=[];for(const[a,{score:u,terms:l,match:c}]of s){const f=l.length||1,d={id:this._documentIds.get(a),score:u*f,terms:Object.keys(c),queryTerms:l,match:c};Object.assign(d,this._storedFields.get(a)),(i.filter==null||i.filter(d))&&o.push(d)}return e===al.wildcard&&i.boostDocument==null||o.sort(oT),o}autoSuggest(e,t={}){t={...this._options.autoSuggestOptions,...t};const r=new Map;for(const{score:s,terms:o}of this.search(e,t)){const a=o.join(" "),u=r.get(a);u!=null?(u.score+=s,u.count+=1):r.set(a,{score:s,terms:o,count:1})}const i=[];for(const[s,{score:o,terms:a,count:u}]of r)i.push({suggestion:s,terms:a,score:o/u});return i.sort(oT),i}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)}static async loadJSONAsync(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(e),t)}static getDefault(e){if(Ob.hasOwnProperty(e))return Mb(Ob,e);throw new Error(`MiniSearch: unknown option "${e}"`)}static loadJS(e,t){const{index:r,documentIds:i,fieldLength:s,storedFields:o,serializationVersion:a}=e,u=this.instantiateMiniSearch(e,t);u._documentIds=Y0(i),u._fieldLength=Y0(s),u._storedFields=Y0(o);for(const[l,c]of u._documentIds)u._idToShortId.set(c,l);for(const[l,c]of r){const f=new Map;for(const d of Object.keys(c)){let g=c[d];a===1&&(g=g.ds),f.set(parseInt(d,10),Y0(g))}u._index.set(l,f)}return u}static async loadJSAsync(e,t){const{index:r,documentIds:i,fieldLength:s,storedFields:o,serializationVersion:a}=e,u=this.instantiateMiniSearch(e,t);u._documentIds=await J0(i),u._fieldLength=await J0(s),u._storedFields=await J0(o);for(const[c,f]of u._documentIds)u._idToShortId.set(f,c);let l=0;for(const[c,f]of r){const d=new Map;for(const g of Object.keys(f)){let m=f[g];a===1&&(m=m.ds),d.set(parseInt(g,10),await J0(m))}++l%1e3===0&&await x8(0),u._index.set(c,d)}return u}static instantiateMiniSearch(e,t){const{documentCount:r,nextId:i,fieldIds:s,averageFieldLength:o,dirtCount:a,serializationVersion:u}=e;if(u!==1&&u!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const l=new al(t);return l._documentCount=r,l._nextId=i,l._idToShortId=new Map,l._fieldIds=s,l._avgFieldLength=o,l._dirtCount=a||0,l._index=new Ya,l}executeQuery(e,t={}){if(e===al.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){const d={...t,...e,queries:void 0},g=e.queries.map(m=>this.executeQuery(m,d));return this.combineResults(g,d.combineWith)}const{tokenize:r,processTerm:i,searchOptions:s}=this._options,o={tokenize:r,processTerm:i,...s,...t},{tokenize:a,processTerm:u}=o,f=a(e).flatMap(d=>u(d)).filter(d=>!!d).map(MQ(o)).map(d=>this.executeQuerySpec(d,o));return this.combineResults(f,o.combineWith)}executeQuerySpec(e,t){const r={...this._options.searchOptions,...t},i=(r.fields||this._options.fields).reduce((y,b)=>({...y,[b]:Mb(r.boost,b)||1}),{}),{boostDocument:s,weights:o,maxFuzzy:a,bm25:u}=r,{fuzzy:l,prefix:c}={...iT.weights,...o},f=this._index.get(e.term),d=this.termResults(e.term,e.term,1,e.termBoost,f,i,s,u);let g,m;if(e.prefix&&(g=this._index.atPrefix(e.term)),e.fuzzy){const y=e.fuzzy===!0?.2:e.fuzzy,b=y<1?Math.min(a,Math.round(e.term.length*y)):y;b&&(m=this._index.fuzzyGet(e.term,b))}if(g)for(const[y,b]of g){const w=y.length-e.term.length;if(!w)continue;m?.delete(y);const x=c*y.length/(y.length+.3*w);this.termResults(e.term,y,x,e.termBoost,b,i,s,u,d)}if(m)for(const y of m.keys()){const[b,w]=m.get(y);if(!w)continue;const x=l*y.length/(y.length+w);this.termResults(e.term,y,x,e.termBoost,b,i,s,u,d)}return d}executeWildcardQuery(e){const t=new Map,r={...this._options.searchOptions,...e};for(const[i,s]of this._documentIds){const o=r.boostDocument?r.boostDocument(s,"",this._storedFields.get(i)):1;t.set(i,{score:o,terms:[],match:{}})}return t}combineResults(e,t=px){if(e.length===0)return new Map;const r=t.toLowerCase(),i=DQ[r];if(!i)throw new Error(`Invalid combination operator: ${t}`);return e.reduce(i)||new Map}toJSON(){const e=[];for(const[t,r]of this._index){const i={};for(const[s,o]of r)i[s]=Object.fromEntries(o);e.push([t,i])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:e,serializationVersion:2}}termResults(e,t,r,i,s,o,a,u,l=new Map){if(s==null)return l;for(const c of Object.keys(o)){const f=o[c],d=this._fieldIds[c],g=s.get(d);if(g==null)continue;let m=g.size;const y=this._avgFieldLength[d];for(const b of g.keys()){if(!this._documentIds.has(b)){this.removeTerm(d,b,t),m-=1;continue}const w=a?a(this._documentIds.get(b),t,this._storedFields.get(b)):1;if(!w)continue;const x=g.get(b),_=this._fieldLength.get(b)[d],S=IQ(x,m,this._documentCount,_,y,u),C=r*i*f*w*S,A=l.get(b);if(A){A.score+=C,PQ(A.terms,e);const I=Mb(A.match,t);I?I.push(c):A.match[t]=[c]}else l.set(b,{score:C,terms:[e],match:{[t]:[c]}})}}return l}addTerm(e,t,r){const i=this._index.fetch(r,aT);let s=i.get(e);if(s==null)s=new Map,s.set(t,1),i.set(e,s);else{const o=s.get(t);s.set(t,(o||0)+1)}}removeTerm(e,t,r){if(!this._index.has(r)){this.warnDocumentChanged(t,e,r);return}const i=this._index.fetch(r,aT),s=i.get(e);s==null||s.get(t)==null?this.warnDocumentChanged(t,e,r):s.get(t)<=1?s.size<=1?i.delete(e):s.delete(t):s.set(t,s.get(t)-1),this._index.get(r).size===0&&this._index.delete(r)}warnDocumentChanged(e,t,r){for(const i of Object.keys(this._fieldIds))if(this._fieldIds[i]===t){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(e)} has changed before removal: term "${r}" was not present in field "${i}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(e){const t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t}addFields(e){for(let t=0;t<e.length;t++)this._fieldIds[e[t]]=t}addFieldLength(e,t,r,i){let s=this._fieldLength.get(e);s==null&&this._fieldLength.set(e,s=[]),s[t]=i;const a=(this._avgFieldLength[t]||0)*r+i;this._avgFieldLength[t]=a/(r+1)}removeFieldLength(e,t,r,i){if(r===1){this._avgFieldLength[t]=0;return}const s=this._avgFieldLength[t]*r-i;this._avgFieldLength[t]=s/(r-1)}saveStoredFields(e,t){const{storeFields:r,extractField:i}=this._options;if(r==null||r.length===0)return;let s=this._storedFields.get(e);s==null&&this._storedFields.set(e,s={});for(const o of r){const a=i(t,o);a!==void 0&&(s[o]=a)}}}al.wildcard=Symbol("*");const Mb=(n,e)=>Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0,DQ={[px]:(n,e)=>{for(const t of e.keys()){const r=n.get(t);if(r==null)n.set(t,e.get(t));else{const{score:i,terms:s,match:o}=e.get(t);r.score=r.score+i,r.match=Object.assign(r.match,o),sT(r.terms,s)}}return n},[k8]:(n,e)=>{const t=new Map;for(const r of e.keys()){const i=n.get(r);if(i==null)continue;const{score:s,terms:o,match:a}=e.get(r);sT(i.terms,o),t.set(r,{score:i.score+s,terms:i.terms,match:Object.assign(i.match,a)})}return t},[RQ]:(n,e)=>{for(const t of e.keys())n.delete(t);return n}},TQ={k:1.2,b:.7,d:.5},IQ=(n,e,t,r,i,s)=>{const{k:o,b:a,d:u}=s;return Math.log(1+(t-e+.5)/(e+.5))*(u+n*(o+1)/(n+o*(1-a+a*r/i)))},MQ=n=>(e,t,r)=>{const i=typeof n.fuzzy=="function"?n.fuzzy(e,t,r):n.fuzzy||!1,s=typeof n.prefix=="function"?n.prefix(e,t,r):n.prefix===!0,o=typeof n.boostTerm=="function"?n.boostTerm(e,t,r):1;return{term:e,fuzzy:i,prefix:s,termBoost:o}},Ob={idField:"id",extractField:(n,e)=>n[e],tokenize:n=>n.split(LQ),processTerm:n=>n.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(n,e)=>{typeof console?.[n]=="function"&&console[n](e)},autoVacuum:!0},iT={combineWith:px,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:TQ},OQ={combineWith:k8,prefix:(n,e,t)=>e===t.length-1},x2={batchSize:1e3,batchWait:10},S2={minDirtFactor:.1,minDirtCount:20},Pb={...x2,...S2},PQ=(n,e)=>{n.includes(e)||n.push(e)},sT=(n,e)=>{for(const t of e)n.includes(t)||n.push(t)},oT=({score:n},{score:e})=>e-n,aT=()=>new Map,Y0=n=>{const e=new Map;for(const t of Object.keys(n))e.set(parseInt(t,10),n[t]);return e},J0=async n=>{const e=new Map;let t=0;for(const r of Object.keys(n))e.set(parseInt(r,10),n[r]),++t%1e3===0&&await x8(0);return e},x8=n=>new Promise(e=>setTimeout(e,n)),LQ=/[\n\r\p{Z}\p{P}]+/u,FQ=["path"],NQ=n=>!n.endsWith(".crswap");class pc{constructor(e){this.index=e}search(...e){const t=this.index.search(...e),r=this.highlight(t);return t.map((i,s)=>({...i,highlights:r[s]}))}highlight(e){for(const t of e)for(const[r,i]of Object.entries(t.match));return[]}async save(e,t){try{const r=t.substring(0,t.lastIndexOf("/"));r&&await e.mkdir(r,{recursive:!0}),await e.writeFile(t,JSON.stringify(this.index))}catch(r){console.error("Failed to save search index:",r)}finally{return this}}static from(e,t){const r=al.loadJSON(e,{fields:t,idField:"path"});return new pc(r)}static async get(e,t,r=FQ){const i=await e.exists(t)?await e.readFile(t):null;return i?pc.from(i,r):pc.build(e,{fields:r,idField:"path"}).then(s=>s.save(e,t))}static async build(e,{filter:t=NQ,...r}){const i=new al({...r});for await(const s of w1.walk(e,"/"))t(s)&&(i.has(s.slice(1))||i.add({path:s.slice(1)}));return new pc(i)}}const gc=0,Uh=1,C2=130,N=0,Pn=2,Xe=8,Q0=10,uT=13,BQ=14,qQ=19,go=20,Ue=28,tr=31,WQ=32,iy=42,gx=43,Rn=44,jQ=45,S8=53,_o=54,Sm=55,Kd=56,bp=58,$Q=59,zQ=71,E2=75,C8=9,UQ=0,HQ=1,E8=2,zr=3,lu=4,VQ=6,Is=7,GQ=31,mx=1,KQ=4,ZQ=32,XQ=65472,A8=64,xn=1,R8=BigInt(1),Sc=BigInt(2),YQ=BigInt(4);BigInt(8);const D8=BigInt(16),JQ=BigInt(32),Cc=BigInt(64),T8=BigInt(128);BigInt(256);BigInt(512);BigInt(1024);BigInt(2048);BigInt(4096);BigInt(8192);BigInt(16384);BigInt(32768);BigInt(65536);BigInt(131072);const lT=BigInt(262144);BigInt(524288);BigInt(1048576);const k1=BigInt(2097152);BigInt(4194304);const QQ=BigInt(8388608);BigInt(16777216);BigInt(33554432);BigInt(67108864);const I8=BigInt(134217728);BigInt(268435456);const wr=BigInt(536870911),mc=R8|Sc|D8|T8|k1|I8,Ec=R8|Cc|D8|T8|k1|I8,eee=0,of=1,yx=2,Ti=1,Ds=2,x1=4,vx=8,tee=0,nee=2,bx=0,sy=1,wx=2,cT=1,fT=2,hT=4,dT=8,ts=0,ree=1,ul=2,pT=0,gT=1,mT=2,yT=3,iee=4,see=5,oee=6,aee=7;class _x{fdstat;path;getFdstat(){return this.fdstat}async initialize(e){return this.path=e,N}getPath(){return this.path}async setFdstatFlags(e){return this.fdstat.fs_flags=e,N}async setFdstatRights(e,t){return this.fdstat.fs_rights_base=e,this.fdstat.fs_rights_inheriting=t,N}async ioctl(e,t){return $Q}async mountFs(e){return{err:bp,fs:void 0}}duplicateFd(){}}class kx extends _x{isatty(){return!1}async readdir(e){return{err:_o,dirents:void 0}}}class xx extends _x{async close(){return tr}async read(e,t){return{err:tr,buffer:void 0}}async read_str(){return{err:tr,content:void 0}}async pread(e,t){return{err:tr,buffer:void 0}}async arrayBuffer(){return{err:tr,buffer:void 0}}async write(e){return{err:tr,written:-1n}}async pwrite(e,t){return{err:tr,written:-1n}}async seek(e,t){return{err:tr,offset:-1n}}async writableStream(){return{err:tr,stream:void 0}}isatty(){return!1}async truncate(e){return tr}addPollSub(e,t,r){return Promise.resolve({userdata:e,error:bp,eventType:t,nbytes:0n})}}class M8 extends _x{constructor(e,t,r){super(),this.fdstat={fs_flags:e,fs_rights_base:t,fs_rights_inheriting:r,fs_filetype:E8}}async getFilestat(){return{err:Xe,filestat:void 0}}async setFilestatTimes(e,t){return Xe}async close(){return Xe}async read(e,t){return{err:Xe,buffer:void 0}}async read_str(){return{err:Xe,content:void 0}}async pread(e,t){return{err:Xe,buffer:void 0}}async arrayBuffer(){return{err:Xe,buffer:void 0}}async write(e){return{err:Xe,written:-1n}}async pwrite(e,t){return{err:Xe,written:-1n}}async seek(e,t){return{err:Xe,offset:-1n}}async readdir(e){return{err:Xe,dirents:void 0}}async writableStream(){return{err:Xe,stream:void 0}}async truncate(e){return Xe}addPollSub(e,t,r){return Promise.resolve({userdata:e,error:bp,eventType:t,nbytes:0n})}}class A2 extends M8{eventMask;signalSub;events;stopResolver;constructor(e,t,r,i){super(e,t,r),this.eventMask=i,this.events=ts,this.stopResolver=void 0,this.signalSub=void 0}getFilestat(){return Promise.resolve({err:N,filestat:{dev:0n,ino:0n,filetype:this.fdstat.fs_filetype,nlink:0n,size:0n,mtim:0n,atim:0n,ctim:0n}})}async setFilestatTimes(e,t){return N}async close(){return this.stopResolver&&this.stopResolver.resolve(this),N}async read(e,t){if(e<4)return{err:iy,buffer:void 0};const r=new ArrayBuffer(4),i=new Uint32Array(r);return i[0]=this.events,this.events=ts,Promise.resolve({err:N,buffer:r})}isatty(){return!1}addPollSub(e,t,r){return new Promise(i=>{this.events!==ts?i({userdata:e,eventType:this.events,nbytes:4n,error:N}):this.signalSub={pid:r,userdata:e,tag:t,resolve:i}})}sendEvents(e){this.events|=e&this.eventMask,this.events!==ts&&this.signalSub!==void 0&&(this.signalSub.resolve({userdata:this.signalSub.userdata,error:N,eventType:of,nbytes:4n}),this.signalSub=void 0)}obtainEvents(e){const t=this.events&e;return this.events^=t,t}makeNotifier(e){return this.eventMask&ul?(this.stopResolver!==void 0&&this.stopResolver.resolve(this),this.stopResolver=e,N):(e.reject(),Ue)}}function em(n){const e=[];let t="",r=n,i="",s=0;for(;r!=="";)r.indexOf("/")!==-1?i=r.substr(0,r.indexOf("/")):i=r,r=r.substr(i.length+1),i===".."?s>0&&(s-=1):i==="."||i!=""&&(e[s]=i,s+=1);return t=`/${e.slice(0,s).join("/")}`,t=t.replace("/./","/"),t}function vT(n){const e=Math.trunc(n),t=BigInt(Math.round((n-e)*1e6));return BigInt(e)*BigInt(1e6)+t}function Hn(n){return n=="/"?"/":n.slice(n.lastIndexOf("/")+1)}function no(n){let e=n.lastIndexOf("/");return e<1&&e++,n.slice(0,e)}function Lb(n){switch(n.toLowerCase().trim()){case"yes":case"on":case"true":return!0;case"no":case"off":case"false":return!1;default:return}}function uee(n){return`[${String((window.performance.now()/1e3).toFixed(6)).padStart(12," ")}] ${n}`}function Fb(n){const e=["B","kB","MB","GB","TB","PB"];let t=n,r=0;for(;t>=1024&&r+1<e.length;)t/=1024,r+=1;return`${t.toFixed(1)}${e[r]}`}async function lee(n,e,t,r,i){const s=i.getDesc(1);let o=` PID TTY TIME CMD\r
|
|
184
|
-
`;for(const[u,l]of Object.entries(n.processInfos)){const f=Math.floor(new Date().getTime()/1e3)-l.timestamp,d=f%60,g=(f-d)/60%60,m=(f-d-g*60)/60/60;o+=`${` ${u}`.slice(-5)} pts/0 ${`00${m}`.slice(-2)}:${`00${g}`.slice(-2)}:${`00${d}`.slice(-2)} ${l.cmd.split("/").slice(-1)[0]}\r
|
|
185
|
-
`}o+=`-1 pts/0 00:00:00 ps\r
|
|
186
|
-
`;const a=new TextEncoder().encode(o);return await s.write(a.buffer),s.close(),0}async function cee(n,e,t,r,i){const s=i.getDesc(1),o=performance.memory.jsHeapSizeLimit,a=performance.memory.usedJSHeapSize;let u="",l="",c="";t.length>1&&t[1]==="-h"?(u=Fb(o),l=Fb(a),c=Fb(o-a)):(u=`${Math.round(o/1024)}`,l=`${Math.round(a/1024)}`,c=`${Math.round((o-a)/1024)}`);let f=` total used available\r
|
|
187
|
-
`;f+=`Mem: ${` ${u}`.slice(-10)} ${` ${l}`.slice(-10)} ${` ${c}`.slice(-10)}\r
|
|
188
|
-
`;const d=new TextEncoder().encode(f);return await s.write(d.buffer),gc}async function fee(n,e,t,r,i){return location.reload(),gc}function wp(n){return new Promise((e,t)=>{n.oncomplete=n.onsuccess=()=>e(n.result),n.onabort=n.onerror=()=>t(n.error)})}function hee(n,e){const t=Promise.resolve().then(()=>{const r=indexedDB.open(n);return r.onupgradeneeded=()=>r.result.createObjectStore(e),wp(r)});return(r,i)=>t.then(s=>i(s.transaction(e,r).objectStore(e)))}let Nb;function oy(){return Nb||(Nb=hee("keyval-store","keyval")),Nb}function dee(n,e=oy()){return e("readonly",t=>wp(t.get(n)))}function pee(n,e,t=oy()){return t("readwrite",r=>(r.put(e,n),wp(r.transaction)))}function gee(n,e=oy()){return e("readwrite",t=>(t.delete(n),wp(t.transaction)))}function mee(n,e){return n("readonly",t=>(t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},wp(t.transaction)))}function yee(n=oy()){const e=[];return mee(n,t=>e.push(t.key)).then(()=>e)}async function bT(n){gee(n)}async function vl(n){return dee(n)}async function cc(n,e){pee(n,e)}async function vee(){return yee()}async function rd(n){return(await(await navigator.storage.getDirectory()).resolve(n)).join("/")}async function bee(n,e){return navigator.storage.getDirectory().then(async t=>await t.getDirectoryHandle(n,{create:e}))}async function wee(){try{const n=await showDirectoryPicker();return{err:N,handle:n}}catch{return{err:Rn,handle:void 0}}}function id(n,e){switch(n.name){case"NotAllowedError":return Pn;case"TypeMismatchError":return e?_o:tr;case"NotFoundError":return Rn;case"InvalidModificationError":return Sm;case"QuotaExceededError":return qQ;default:return Ue}}function O8(n,e,t,r,i){n.keepMetadata=i,n.keepMetadata&&(n.metadataPath=""),n.fdstat={fs_flags:e,fs_rights_base:t,fs_rights_inheriting:r,fs_filetype:void 0}}async function S1(n){n.keepMetadata&&n.metadataPath===""&&(n.metadataPath=await rd(n.handle))}async function P8(n,e,t){if(n.keepMetadata){let r=await vl(n.metadataPath);e!==void 0&&(r.atim=e),t!==void 0&&(r.mtim=t),(e!==void 0||t!==void 0)&&await cc(n.metadataPath,r)}return N}class ro extends kx{handle;static defaultFilestat={dev:0n,ino:0n,filetype:lu,nlink:1n,size:0n,atim:0n,mtim:0n,ctim:0n};metadataPath;keepMetadata;cursor;writer;file;constructor(e,t,r,i,s){super(),this.handle=e,this.cursor=0n,O8(this,t,r,i,s),this.file=void 0}async initialize(e){const t=await super.initialize(e);if(t!==N)return t;await S1(this);const r=BigInt((await this.__getFile()).file?.size);let i;if(this.keepMetadata){const s=await vl(this.metadataPath);if(s==null)return Rn;i=s.filetype}else i=ro.defaultFilestat.filetype;return this.fdstat.fs_filetype=i,this.fdstat.fs_flags&mx&&(this.cursor=r),N}async getWriter(){return this.writer||(this.writer=await this.handle.createWritable({keepExistingData:!0})),this.writer}async __getFile(){if(!this.file)try{const e=await this.handle.getFile();return this.file=e,{err:N,file:e}}catch{return{err:Pn,file:void 0}}return{err:N,file:this.file}}async read(e){const{err:t,file:r}=await this.__getFile();if(t!==N)return{err:t,buffer:void 0};const i=Number(this.cursor)+e,s=await r.slice(Number(this.cursor),Number(i)).arrayBuffer();return this.cursor+=BigInt(s.byteLength),{err:N,buffer:s}}async read_str(){const{err:e,file:t}=await this.__getFile();return e!==N?{err:e,content:void 0}:{err:N,content:await t.text()}}async pread(e,t){const{err:r,file:i}=await this.__getFile();if(r!==N)return{err:r,buffer:void 0};const s=BigInt((await this.__getFile()).file?.size),o=s<t+BigInt(e)?s:this.cursor+BigInt(e);return{err:N,buffer:await i.slice(Number(t),Number(o)).arrayBuffer()}}async seek(e,t){const r=BigInt((await this.__getFile()).file?.size);switch(t){case sy:if(this.cursor+e<0n)return{offset:this.cursor,err:Ue};this.cursor+=e;break;case bx:if(e<0n)return{offset:this.cursor,err:Ue};this.cursor=e;break;case wx:if(r<-e)return{offset:this.cursor,err:Ue};this.cursor=r+e;break;default:return{offset:this.cursor,err:Ue}}return{err:N,offset:this.cursor}}async setFilestatTimes(e,t){return P8(this,e,t)}async write(e){await(await this.getWriter()).write({type:"write",position:Number(this.cursor),data:e});let t=BigInt(e.byteLength);return this.cursor+=t,{err:N,written:t}}async pwrite(e,t){await(await this.getWriter()).write({type:"write",position:Number(t),data:e});let r=BigInt(e.byteLength);return{err:N,written:r}}async writableStream(){return{err:N,stream:await this.getWriter()}}async truncate(e){try{await(await this.getWriter()).write({type:"truncate",size:Number(e)})}catch(t){return t instanceof DOMException?id(t,!1):Ue}return await this.flush(),this.cursor=0n,N}async arrayBuffer(){let e=await(await this.handle.getFile()).arrayBuffer();return{err:N,buffer:e}}async flush(){if(this.writer){const e=this.writer;this.writer=null;try{await e?.close()}catch{}}}async close(){return await this.flush(),N}async getFilestat(){let e=this.keepMetadata?await vl(this.metadataPath):ro.defaultFilestat;return e===void 0?{err:Kd,filestat:void 0}:(e.size=BigInt((await this.__getFile()).file?.size),{err:N,filestat:e})}async addPollSub(e,t,r){const i=BigInt(this.file?this.file.size:(await this.__getFile()).file.size);return{userdata:e,error:N,eventType:t,nbytes:i}}}class Cs extends xx{handle;metadataPath;keepMetadata;static defaultFilestat={dev:0n,ino:0n,filetype:zr,nlink:1n,size:4096n,atim:0n,mtim:0n,ctim:0n};entries;constructor(e,t,r,i,s){super(),this.handle=e,O8(this,t,r,i,s),this.fdstat.fs_filetype=zr,this.entries=[]}async initialize(e){const t=await super.initialize(e);return t!==N?t:(await S1(this),N)}async getFilestat(){if(this.keepMetadata){const e=await vl(this.metadataPath);return e===void 0?{err:Kd,filestat:void 0}:{err:N,filestat:e}}else return{err:N,filestat:Cs.defaultFilestat}}async setFilestatTimes(e,t){return P8(this,e,t)}async readdir(e){let t=N;if(e||this.entries.length===0){this.entries=[];var r=1n;for await(const[i,s]of this.handle.entries()){if(i.endsWith(".crswap"))continue;let o;this.keepMetadata?o=await vl(`${this.metadataPath}/${i}`):o=s instanceof FileSystemDirectoryHandle?Cs.defaultFilestat:ro.defaultFilestat,o===void 0?t=Kd:this.entries.push({d_next:r++,d_ino:o.ino,name:i,d_type:o.filetype})}}return{err:t,dirents:this.entries}}}class L8{rootHandle;keepMetadata;fsname(){return"FsaFilesystem"}getRootHandle(){return this.rootHandle}async getHandle(e,t,r){let i,s,o=!0,a=r===void 0?this.getRootHandle():r;try{for(e.startsWith("/")?s=1:s=0,i=e.indexOf("/",s);i!=-1;i=e.indexOf("/",s))a=await a.getDirectoryHandle(e.slice(s,i)),s=i+1;let u;o=t;let l=e.slice(s);return l===""?u=a:t?u=await a.getDirectoryHandle(l):u=await a.getFileHandle(l),{handle:u,err:N,index:-1}}catch(u){let l;try{l=id(u,o)}catch{l=Ue}return{index:i,err:l,handle:a}}}async unlinkat(e,t,r){let i;if(e!==void 0)if(e instanceof Cs)i=e.handle;else return Ue;let{err:s,handle:o}=await this.getHandle(no(t),!0,i);if(s!==N)return s;let a=Hn(t);try{let u=(await this.getHandle(a,r,o)).err;return u!==N?u:(o.removeEntry(a,{recursive:!1}),await bT(`${await rd(o)}/${t}`),N)}catch(u){let l=Ue;return u instanceof DOMException&&(l=id(u,!0)),l}}async mkdirat(e,t){let r;if(e!==void 0)if(e instanceof Cs)r=e.handle;else return Ue;let{err:i,handle:s}=await this.getHandle(no(t),!0,r);if(i!==N)return i;let o=Hn(t);if({err:i}=await this.getHandle(o,!0,s),i===N)return go;if(i!==Rn)return i;try{s=await s.getDirectoryHandle(t,{create:!0})}catch(a){if(a instanceof DOMException){const u=id(a,!0);if(u!==N)return u}}return this.keepMetadata&&await cc(await rd(s),{dev:0n,ino:0n,filetype:zr,nlink:1n,size:4096n,mtim:0n,atim:0n,ctim:0n}),N}async symlinkat(e,t,r){let i;if(t!==void 0)if(t instanceof Cs)i=t.handle;else return Ue;let{err:s,handle:o}=await this.getHandle(no(r),!0,i);if(s!==N)return s;let a=Hn(r);if({err:s}=await this.getHandle(a,!1,o),s===N||s===tr)return go;if(s!==Rn)return s;let u=await o.getFileHandle(r,{create:!0}),l=await u.createWritable();return await l.write(e),await l.close(),this.keepMetadata&&await cc(await rd(u),{dev:0n,ino:0n,filetype:Is,nlink:1n,size:BigInt(e.length),mtim:0n,atim:0n,ctim:0n}),N}async getFilestat(e){if(this.keepMetadata){const t=this.getRootHandle().name+e,r=await vl(t);return{filestat:r,err:r?N:Rn}}else{const{err:t}=await this.getHandle(e,!0,void 0);switch(t){case _o:return{err:N,filestat:Cs.defaultFilestat};case N:return{err:N,filestat:ro.defaultFilestat};default:return{err:t,filestat:void 0}}}}async open(e,t,r,i,s,o,a){let u=await this.getHandle(e,!0,void 0),l=u.err,c=u.index,f;switch(l){case N:{r&Ti?r&x1?l=go:l=tr:l=u.err,c=u.index,f=new Cs(u.handle,o,i,s,this.keepMetadata);break}case _o:if(c===-1){if(r&Ds&&!(t&xn))break;const d=await this.getHandle(Hn(e),!1,u.handle);d.err===N&&(r&Ti&&r&x1?l=go:r&Ds||(l=d.err),f=new ro(d.handle,o,i,s,this.keepMetadata));break}else if(t&xn){const d=await this.getHandle(Hn(e.slice(0,c)),!1,u.handle);d.err===N&&(f=new ro(d.handle,o,i,s,this.keepMetadata));break}case Rn:{if(r&Ti&&c===-1)try{const d=await u.handle.getFileHandle(Hn(e),{create:!0});l=N,f=new ro(d,o,i,s,this.keepMetadata),this.keepMetadata&&(f.metadataPath=await rd(d),await cc(f.metadataPath,{dev:0n,ino:0n,filetype:lu,nlink:1n,size:0n,mtim:0n,atim:0n,ctim:0n}))}catch(d){d instanceof DOMException?l=id(d,!1):l=Ue}break}}return{err:l,index:c,desc:f}}async renameat(e,t,r,i){if(e!==void 0&&!(e instanceof Cs))return Ue;const{handle:o,err:a}=await this.getHandle(t,!1,e.handle);if(a===tr)return E2;if(a!==N)return a;const u=new ro(o,0,wr,wr,this.keepMetadata);await S1(u);const l=await u.getFilestat();if(l.err!==N)return l.err;if(l.filestat.filetype===Is)return E2;if(r!==void 0&&!(r instanceof Cs))return Ue;const{handle:c,err:f}=await this.getHandle(no(i),!0,r.handle);if(f!==N)return f;const d=await c.getFileHandle(Hn(i),{create:!0}),g=new ro(d,0,wr,wr,this.keepMetadata);for(await S1(g);;){const{err:m,buffer:y}=await u.read(2048);if(m!==N)return m;if(y.byteLength===0)break;if((await g.write(y)).err!==N)return m}return await u.close(),await g.close(),await cc(g.metadataPath,l.filestat),await this.unlinkat(e,t,!1),N}async initialize(e){const t=e;this.keepMetadata=t.keepMetadata===void 0?!1:Lb(t.keepMetadata);const r=t.create===void 0?!1:Lb(t.create);if(t.prompt===void 0?!1:Lb(t.prompt)){if(this.keepMetadata||t.name!==void 0||r)return Ue;const{err:s,handle:o}=await wee();if(s===N)this.rootHandle=o;else return s}else if(t.name!==void 0)this.rootHandle=await bee(t.name,r),this.keepMetadata&&await vl(t.name)===void 0&&await cc(t.name,Cs.defaultFilestat);else return Ue;return N}async mknodat(e,t,r,i){return Ue}async cleanup(){if(!this.keepMetadata)return;const e=this.rootHandle.name;await Promise.all((await vee()).map(async t=>{t.startsWith(e)&&(await this.open(t.replace(e,""),0,0,wr,wr,0,0)).err===Rn&&await bT(t)}))}}async function _ee(n,e){const[t,r,i]=n.data,s=e.processInfos[t].cmd,o=s.substr(s.lastIndexOf("/")+1);switch(r){case"console":{console.log(`%c [dbg (%c${o}:${t}%c)] %c ${i}`,"background:black; color: white;","background:black; color:yellow;","background: black; color:white;","background:default; color: default;");break}case"proc_exit":{e.processInfos[t].env.DEBUG==="1"&&console.log(`%c [dbg (%c${o}:${t}%c)] %c exited with result code ${i}`,"background:black; color: white;","background:black; color:yellow;","background: black; color:white;","background:default; color: default;"),await e.terminateProcess(t,i);break}case"chdir":{const{dir:u,sharedBuffer:l}=i,c=new Int32Array(l,0,1);e.processInfos[t].cwd=u,Atomics.store(c,0,0),Atomics.notify(c,0);break}case"getcwd":{const{bufLen:u,sharedBuffer:l}=i,c=new Int32Array(l,0,1),f=new Uint32Array(l,4,1),d=new Uint8Array(l,8,u);let g=N;const m=e.processInfos[t].cwd;u<m.length?(f[0]=u,g=iy):(f[0]=m.length,d.set(new TextEncoder().encode(m),0)),Atomics.store(c,0,g),Atomics.notify(c,0);break}case"isatty":{const{sharedBuffer:u,fd:l}=i,c=new Int32Array(u,0,1),f=new Int32Array(u,4,1);let d;const{fds:g}=e.processInfos[t];g.getDesc(l)!==void 0?(f[0]=Number(g.getDesc(l).isatty()),d=N):d=Xe,Atomics.store(c,0,d),Atomics.notify(c,0);break}case"getpid":{const{sharedBuffer:u}=i,l=new Int32Array(u,0,1),c=new Int32Array(u,4,1);c[0]=e.processInfos[t].id,Atomics.store(l,0,N),Atomics.notify(l,0);break}case"set_env":{const{key:u,value:l,sharedBuffer:c}=i,f=new Int32Array(c,0,1);e.processInfos[t].env[u]=l,Atomics.store(f,0,0),Atomics.notify(f,0);break}case"set_echo":{const{shouldEcho:u,sharedBuffer:l}=i,c=new Int32Array(l,0,1);e.processInfos[t].shouldEcho=u==="1",Atomics.store(c,0,0),Atomics.notify(c,0);break}case"spawn":{const{path:u,args:l,env:c,sharedBuffer:f,background:d,redirects:g}=i,m=new Int32Array(f,0,1),y=new Int32Array(f,4,1);y[0]=-1,l.splice(0,0,u.split("/").pop());let b=gc;const w=e.processInfos[t].fds.clone();for(let _=0;_<g.length&&b==gc;_++){const S=g[_],C=S.type,A=S.fd_dst;switch(C){case pT:case gT:case mT:case yT:{const I=S.path;let W=Ti,B=0,K=0n;switch(C){case pT:{W=0,K|=mc;break}case gT:{W|=vx,K|=Ec;break}case mT:{B|=mx,K|=Ec;break}case yT:{K|=Ec|mc;break}default:{b=Uh,console.log(`Spawn: program should not enter here for redirect type ${S.type}.`);continue}}const{desc:G,err:F}=await e.filesystem.open(I,xn,W,B,K,K,t);if(F!==N){console.log(`Spawn: cannot open file at "${I}", error: ${F}`),b=Uh;break}let R=w.getDesc(A);R!==void 0&&R.close(),w.setFd(A,new Ac(G));break}case iee:case see:case oee:{if(w.getDesc(S.fd_src)!==void 0){let I=w.getDesc(A);I!==void 0&&I.close(),w.duplicateFd(S.fd_src,A)}else console.log(`Spawn: cannot duplicate fd=${S.fd_src}, it is closed.`),b=Uh;break}case aee:{let I=w.getDesc(A);I!==void 0?(I.close(),w.freeFd(A)):(console.log(`Spawn: cannot close fd=${S.fd_src}, it is already closed.`),b=Uh);break}default:console.log(`Spawn: redirect type ${S.type} not found.`),b=Uh}}if(b!=gc){Atomics.store(m,0,b),Atomics.notify(m,0);break}let x=!0;switch(u){case"/usr/bin/ps":{const _=await lee(e,t,l,c,w);Atomics.store(m,0,_),Atomics.notify(m,0);break}case"/usr/bin/free":{const _=await cee(e,t,l,c,w);Atomics.store(m,0,_),Atomics.notify(m,0);break}case"/usr/bin/reset":{const _=await fee();Atomics.store(m,0,_),Atomics.notify(m,0);break}default:{x=!1;let _=e.processInfos[t].terminationNotifier;if(_!==null?_.obtainEvents(ul)!=0:!1){await w.tearDown(),Atomics.store(m,0,C2),Atomics.notify(m,0);break}try{const C=await e.spawnProcess(t,d?null:m,u,w,l,c,d,e.processInfos[t].cwd);if(Atomics.store(y,0,C),c.DEBUG==="1"){const A=u.split("/").slice(-1)[0];console.log(`%c [dbg (%c${A}:${C}%c)] %c spawned by ${o}:${t}`,"background:black; color: white;","background:black; color:yellow;","background: black; color:white;","background:default; color: default;")}}catch{console.log("Failed spawning process")}if(d){let C=gc;(_!==null?_.obtainEvents(ul)!=0:!1)&&(C=C2),Atomics.store(m,0,C),Atomics.notify(m,0)}}}x&&await w.tearDown();break}case"fd_prestat_get":{const{sharedBuffer:u,fd:l}=i,c=new Int32Array(u,0,1),f=new Int32Array(u,4,1),d=new Uint8Array(u,8,1);let g;const{fds:m}=e.processInfos[t];l>2&&l<4?(d[0]=tee,f[0]=Hn(m.getDesc(l).getPath()).length,g=N):g=Xe,Atomics.store(c,0,g),Atomics.notify(c,0);break}case"path_symlink":{const{sharedBuffer:u,targetPath:l,linkFd:c,linkPath:f}=i,d=new Int32Array(u,0,1),{fds:g}=e.processInfos[t];let m;g.getDesc(c)===void 0?m=Xe:m=await e.filesystem.addSymlink(l,f,g.getDesc(c),t),Atomics.store(d,0,m),Atomics.notify(d,0);break}case"path_link":{const{sharedBuffer:u,oldFd:l}=i,c=new Int32Array(u,0,1);let f;const{fds:d}=e.processInfos[t];if(d.getDesc(l)!==void 0){const g=new TextEncoder().encode("hard links are not supported");f=(await d.getDesc(nee).write(g.buffer)).err}else f=Xe;Atomics.store(c,0,f),Atomics.notify(c,0);break}case"path_readlink":{const{sharedBuffer:u,fd:l,path:c,bufferLen:f}=i,d=new Int32Array(u,0,1),g=new Int32Array(u,4,1),m=new Uint8Array(u,8,f);let y=N;const{fds:b}=e.processInfos[t];if(b.getDesc(l)!==void 0){let w;({err:y,path:w}=await e.filesystem.readLink(b.getDesc(l),c,t)),y===N?w.length>f?g[0]=f:(m.set(new TextEncoder().encode(w),0),g[0]=w.length):y=Ue}else y=Xe;Atomics.store(d,0,y),Atomics.notify(d,0);break}case"fd_prestat_dir_name":{const{sharedBuffer:u,fd:l,pathLen:c}=i,f=new Int32Array(u,0,1),d=new Uint8Array(u,4,c);let g;const{fds:m}=e.processInfos[t];m.getDesc(l)!==void 0?(d.set(new TextEncoder().encode(Hn(m.getDesc(l).getPath())),0),g=N):g=Xe,Atomics.store(f,0,g),Atomics.notify(f,0);break}case"fd_write":{const{sharedBuffer:u,fd:l,content:c}=i,f=new Int32Array(u,0,1),d=new Int32Array(u,4,1),{fds:g}=e.processInfos[t];let m,y;if(g.getDesc(l)!==void 0){const b=g.getDesc(l).getFdstat();if(y=b.fs_filetype,y===zr)m=tr;else if(y===Is)m=Ue;else if((b.fs_rights_base&Cc)===0n)m=Pn;else{const w=await g.getDesc(l).write(c.buffer);m=w.err,d[0]=Number(w.written)}}else m=Xe;Atomics.store(f,0,m),Atomics.notify(f,0);break}case"fd_pread":case"fd_read":{const{sharedBuffer:u,fd:l,len:c,offset:f}=i,{fds:d}=e.processInfos[t],g=new Int32Array(u,0,1),m=new Uint8Array(u,8,c);let y;const b=new Int32Array(u,4,1);let w;if(d.getDesc(l)===void 0)y=Xe;else if(w=d.getDesc(l).getFdstat(),(w.fs_rights_base&Sc)==0n)y=Pn;else if(w.fs_filetype===zr)y=tr;else if(w.fs_filetype===Is)y=Ue;else{let x;f?x=await d.getDesc(l).pread(c,f):x=await d.getDesc(l).read(c,t),y=x.err,m.set(new Uint8Array(x.buffer)),b[0]=x.buffer.byteLength}Atomics.store(g,0,y),Atomics.notify(g,0);break}case"path_open":{const{sharedBuffer:u,dirFd:l,path:c,lookupFlags:f,openFlags:d,fsRightsBase:g,fsRightsInheriting:m,fdFlags:y}=i,b=new Int32Array(u,0,1),w=new Int32Array(u,4,1);let x;const{fds:_}=e.processInfos[t];if(_.getDesc(l)!==void 0)if(d&Ti&&d&Ds)x=Ue;else{let S;({err:x,desc:S}=await e.filesystem.openat(_.getDesc(l),c,f,d,y,g,m,t)),x===N&&(w[0]=_.addFile(S))}else x=Xe;Atomics.store(b,0,x),Atomics.notify(b,0);break}case"fd_close":{const{sharedBuffer:u,fd:l}=i,c=new Int32Array(u,0,1);let f;const{fds:d}=e.processInfos[t];d.getDesc(l)!==void 0?(await d.getDesc(l).close(),d.freeFd(l),f=N):f=Xe,Atomics.store(c,0,f),Atomics.notify(c,0);break}case"path_filestat_get":case"fd_filestat_get":{const{sharedBuffer:u,fd:l,path:c,lookupFlags:f}=i,d=new Int32Array(u,0,1),g=new DataView(u,4);let m=N;const{fds:y}=e.processInfos[t];let b=y.getDesc(l);if(b===void 0)m=Xe;else{let w=b.getFdstat();if(c&&w.fs_rights_base&lT||!c&&w.fs_rights_base&k1){let x;if(c!==void 0){let _=await e.filesystem.openat(b,c,f,0,0,0n,0n,t);m=_.err,_.err===N&&(x=_.desc)}else x=b;if(x!==void 0){if((c&&w.fs_rights_base&lT||!c&&w.fs_rights_base&k1)&&m===N){let _=await x.getFilestat();_.err!=N?m=_.err:(g.setBigUint64(0,_.filestat.dev,!0),g.setBigUint64(8,_.filestat.ino,!0),g.setUint8(16,_.filestat.filetype),g.setBigUint64(24,_.filestat.nlink,!0),g.setBigUint64(32,_.filestat.size,!0),g.setBigUint64(40,_.filestat.atim,!0),g.setBigUint64(48,_.filestat.mtim,!0),g.setBigUint64(56,_.filestat.ctim,!0))}c!==void 0&&await x.close()}}else m=Pn}Atomics.store(d,0,m),Atomics.notify(d,0);break}case"fd_seek":{const{sharedBuffer:u,fd:l,offset:c,whence:f}=i,d=new Int32Array(u,0,1),g=new BigUint64Array(u,8,1);let m;const{fds:y}=e.processInfos[t];if(y.getDesc(l)===void 0)m=Xe;else{const b=y.getDesc(l).getFdstat();if((b.fs_rights_base&YQ)!==0n)if(b.fs_filetype!==zr){const w=await y.getDesc(l).seek(c,f);g[0]=w.offset,m=w.err}else m=Xe;else m=Pn}Atomics.store(d,0,m),Atomics.notify(d,0);break}case"fd_readdir":{const{sharedBuffer:u,fd:l,cookie:c,bufLen:f}=i,d=new Int32Array(u,0,1),g=new Uint32Array(u,4,1),m=new DataView(u,8,f);let y=0,b;const{fds:w}=e.processInfos[t];if(w.getDesc(l)!==void 0&&w.getDesc(l).getFdstat().fs_filetype===zr){let x=(await w.getDesc(l).readdir(c===0n)).dirents;for(let _=Number(c);_<x.length;_+=1){const S=x[_],C=new TextEncoder().encode(S.name);if(y+8>f){y+=8;break}if(m.setBigUint64(y,BigInt(_+1),!0),y+=8,y+8>=f){y+=8;break}if(m.setBigUint64(y,S.d_ino,!0),y+=8,y+4>=f){y+=4;break}if(m.setUint32(y,C.byteLength,!0),y+=4,y+4>=f){y+=4;break}if(m.setUint8(y,S.d_type),y+=4,y+C.byteLength>f){y+=C.byteLength;break}new Uint8Array(u,8).set(C,y),y+=C.byteLength}g[0]=y>f?f:y,b=N}else b=Xe;Atomics.store(d,0,b),Atomics.notify(d,0);break}case"path_unlink_file":case"path_remove_directory":{const{sharedBuffer:u,fd:l,path:c}=i,f=new Int32Array(u,0,1);let d;const{fds:g}=e.processInfos[t];g.getDesc(l)!==void 0?d=await e.filesystem.removeEntry(c,r!=="path_unlink_file",g.getDesc(l),t):d=Xe,Atomics.store(f,0,d),Atomics.notify(f,0);break}case"path_create_directory":{const{sharedBuffer:u,fd:l,path:c}=i,f=new Int32Array(u,0,1);let d;const{fds:g}=e.processInfos[t];g.getDesc(l)!==void 0?d=await e.filesystem.createDir(c,g.getDesc(l),t):d=Xe,Atomics.store(f,0,d),Atomics.notify(f,0);break}case"fd_fdstat_get":{const{sharedBuffer:u,fd:l}=i,c=new Int32Array(u,0,1),f=new Uint8Array(u,4,1),d=new BigUint64Array(u,8,1),g=new BigUint64Array(u,16,1),m=new Uint8Array(u,24,1);let y;const{fds:b}=e.processInfos[t];let w=b.getFdEntry(l);if(w!==void 0){const x=w.desc.getFdstat();f[0]=x.fs_filetype,m[0]=x.fs_flags|w.fdFlags,d[0]=x.fs_rights_base,g[0]=x.fs_rights_inheriting,y=N}else y=Xe;Atomics.store(c,0,y),Atomics.notify(c,0);break}case"path_rename":{const{sharedBuffer:u,oldFd:l,oldPath:c,newFd:f,newPath:d}=i,g=new Int32Array(u,0,1),{fds:m}=e.processInfos[t];let y=await e.filesystem.move(m.getDesc(l),c,m.getDesc(f),d,t);Atomics.store(g,0,y),Atomics.notify(g,0);break}case"fd_tell":{const{sharedBuffer:u,fd:l}=i,c=new BigInt64Array(u,0,1),f=new Int32Array(u,8,1),{fds:d}=e.processInfos[t];let g;if(d.getDesc(l)!==void 0){let m=d.getDesc(l).getFdstat();(m.fs_rights_base&JQ)!==0n?m.fs_filetype===lu||m.fs_filetype===Is?(c[0]=BigInt((await d.getDesc(l).seek(0n,sy)).offset),g=N):g=Xe:g=Pn}else g=Xe;Atomics.store(f,0,g),Atomics.notify(f,0);break}case"path_filestat_set_times":case"fd_filestat_set_times":{const{sharedBuffer:u,st_atim:l,flags:c,st_mtim:f,fst_flags:d,fd:g,path:m}=i;let y=Xe;const b=new Int32Array(u,0,1),{fds:w}=e.processInfos[t];let x=w.getDesc(g);if(x&&m!==void 0){const _=await e.filesystem.openat(x,m,c);x=_.desc,y=_.err}if(x)if(!(x.getFdstat().fs_rights_base&QQ))y=Pn;else if((d&fT)!==0&&(d&cT)!==0||(d&dT)!==0&&(d&hT)!==0)y=Ue;else{let S,C;(d&cT)!==0?C=l:(d&fT)!==0&&(C=vT(performance.now())),(d&hT)!==0?S=f:(d&dT)!==0&&(S=vT(performance.now())),y=await x.setFilestatTimes(C,S)}Atomics.store(b,0,y),Atomics.notify(b,0);break}case"fd_fdstat_set_flags":{const{sharedBuffer:u,fd:l,flags:c}=i,f=new Int32Array(u,0,1),{fds:d}=e.processInfos[t];let g=N,m=d.getFdEntry(l);if(m===void 0)g=Xe;else if((c&ZQ)===0){let y=c&GQ;g=await m.desc.setFdstatFlags(y)}else m.fdFlags=c&XQ;Atomics.store(f,0,g),Atomics.notify(f,0);break}case"fd_renumber":{const{sharedBuffer:u,fd:l,newFd:c}=i,f=new Int32Array(u,0,1),{fds:d}=e.processInfos[t];let g=N,m=d.getFdEntry(l),y=d.getFdEntry(c);m===void 0?g=Xe:(y!==void 0&&(await y.desc.close(),d.freeFd(c)),d.duplicateFd(l,c)),Atomics.store(f,0,g),Atomics.notify(f,0);break}case"poll_oneoff":{const{sharedBuffer:u,subs:l,eventBuf:c}=i,f=new Int32Array(u,0,2),{fds:d}=e.processInfos[t];let g=[];await Promise.any(l.map(w=>{let x;switch(w.eventType){case eee:x=new Promise(_=>{setTimeout(()=>{_({userdata:w.userdata,error:N,eventType:w.eventType,nbytes:0n})},Number(w.event.timeout/1000000n))});break;case yx:case of:{const _=x=d.getDesc(w.event.fd);_===void 0?x=Promise.resolve({userdata:w.userdata,error:Xe,eventType:w.eventType,nbytes:0n}):x=_.addPollSub(w.userdata,w.eventType,t);break}default:x=new Promise(_=>{_({userdata:w.userdata,error:Ue,eventType:ts,nbytes:0n})})}return x.then(_=>g.push(_))}));const m=new DataView(c,0);let y=g.length,b=0;g.forEach(w=>{m.setBigUint64(b,w.userdata,!0),b+=8,m.setUint16(b,w.error,!0),b+=2,m.setUint8(b,w.eventType),b+=6,m.setBigUint64(b,w.nbytes,!0),b+=8,b+=8}),Atomics.store(f,1,y),Atomics.store(f,0,N),Atomics.notify(f,0);break}case"event_source_fd":{const{sharedBuffer:u,eventMask:l}=i,c=new Int32Array(u,0,1),f=new Int32Array(u,4,1);let d=new A2(0,wr,wr,l),g=e.processInfos[t].fds;var a=g.addFile(d);g.fdt[a].fdFlags=A8,Atomics.store(f,0,a),Atomics.store(c,0,0),Atomics.notify(c,0);break}case"attach_sigint":{const{sharedBuffer:u,fd:l}=i,c=e.attachSigint(l,t),f=new Int32Array(u,0,1);Atomics.store(f,0,c),Atomics.notify(f,0);break}case"clean_inodes":{const{sharedBuffer:u}=i,l=new Int32Array(u,0,1);await Promise.all(Object.values(e.filesystem.getMounts()).map(async c=>{c instanceof L8&&c.cleanup()})),Atomics.store(l,0,0),Atomics.notify(l,0);break}case"kill":{const{sharedBuffer:u,processId:l,signalNumber:c}=i,f=new Int32Array(u,0,1);let d=N;c!==C8?(console.log(`Process=${l} send usupported singnal: ${c}!`),d=Ue):e.processInfos[l]===void 0?(console.log(`Process=${l} send singnal to process ${l} that does not exist!`),d=zQ):await e.terminateProcess(l,128+c),Atomics.store(f,0,d),Atomics.notify(f,0);break}case"ioctl":{const{sharedBuffer:u,fd:l,command:c}=i,f=new Int32Array(u,0,1),d=new Uint8Array(u,4),{fds:g}=e.processInfos[t];let m=g.getDesc(l);if(l===void 0){Atomics.store(f,0,Xe),Atomics.notify(f,0);break}const y=await m.ioctl(c,d);Atomics.store(f,0,y),Atomics.notify(f,0);break}case"mount":{const{sharedBuffer:u,sourceFd:l,sourcePath:c,targetFd:f,targetPath:d,filesystemType:g,mountFlags:m,data:y}=i;let b=N;const w=new Int32Array(u,0,1),{fds:x}=e.processInfos[t];let _;l>=0&&(_=x.getDesc(l),_===void 0&&(b=Xe));let S;f>=0&&(S=x.getDesc(f),S===void 0&&(b=Xe));let C={};for(const A of y.split(",")){if(A==="")continue;const I=A.split("=");if(I.length!==2){b=Ue;break}C[I[0]]=I[1]}b===N&&(b=await e.filesystem.addMount(_,c,S,d,g,m,C,t)),Atomics.store(w,0,b),Atomics.notify(w,0);break}case"umount":{const{sharedBuffer:u,path:l}=i,c=new Int32Array(u,0,1);Atomics.store(c,0,e.filesystem.removeMount(l)),Atomics.notify(c,0);break}case"mknod":{const{sharedBuffer:u,path:l,dev:c}=i,f=new Int32Array(u,0,1);Atomics.store(f,0,await e.filesystem.mknodat(void 0,l,c,t)),Atomics.notify(f,0);break}default:throw new Error(`Unhandled syscall: ${r}`)}}const pd="/home/ant",F8={PATH:"/usr/bin:/usr/local/bin",PWD:pd,OLDPWD:pd,TMPDIR:"/tmp",TERM:"xterm-256color",HOME:pd,SHELL:"/usr/bin/wash",LANG:"en_US.UTF-8",USER:"ant",HOSTNAME:"browser",PYTHONHOME:"/",PS1:"\x1B[1;34m\\u@\\h \x1B[1;33m\\w$\x1B[0m ",PS2:"> "};class Ac{desc;fdFlags;constructor(e){if(e===void 0)throw"DescriptorEntry must not contain undefined descriptor!";this.desc=e,this.fdFlags=e.getFdstat().fs_flags}}class ay{fdt={};freeFds=[];topFd;constructor(e){this.fdt={...e},this.topFd=Object.keys(e).length-1}clone(){var e=new ay([]);e.freeFds=this.freeFds.slice(0);for(let t in this.fdt)(this.fdt[t].fdFlags&A8)===0?(e.fdt[t]=new Ac(this.fdt[t].desc),e.fdt[t].desc.duplicateFd()):e.freeFds.push(Number(t));return e.freeFds.sort(),e.topFd=this.topFd,e}addFile(e){if(e===void 0)throw"Entry is undefined";let t=new Ac(e),r=this.freeFds.shift();if(r!==void 0)return this.fdt[r]=t,r;for(r=++this.topFd;this.fdt[r]!==void 0;)r=++this.topFd;return this.fdt[r]=t,r}freeFd(e){if(!(e in this.fdt))throw"descriptor not present in descriptor table";delete this.fdt[e],this.freeFds.push(e)}replaceFd(e,t){if(!(e in this.fdt))throw"descriptor not present in descriptor table";if(t===void 0)throw"Entry is undefined";this.fdt[e]=t}getFdEntry(e){return this.fdt[e]}getDesc(e){return this.fdt[e]!==void 0?this.fdt[e].desc:void 0}setFd(e,t){this.prepareToStoreFd(e),this.fdt[e]!==void 0&&console.log(`setFd: overwrite opened fd = ${e}`),this.fdt[e]=t}duplicateFd(e,t){this.prepareToStoreFd(t),this.fdt[t]!==void 0&&console.log(`duplicateFd: overwrite opened fd = ${t}`),this.fdt[t]=new Ac(this.fdt[e].desc),this.fdt[t].desc.duplicateFd()}prepareToStoreFd(e){let t=this.freeFds.findIndex(r=>r==e);t>=0&&this.freeFds.splice(t,1)}tearDown(){return Promise.all(Object.values(this.fdt).map(async e=>{e!==void 0?e.desc!==void 0?e.desc.close():console.error("Descriptor entry has undefined descriptor!"):console.error("Descriptor entry is undefined!")}))}}class kee{id;cmd;worker;fds;parentId;parentLock;callback;env;cwd;isJob;foreground;shouldEcho=!0;terminationNotifier=null;timestamp;children;constructor(e,t,r,i,s,o,a,u,l,c,f){this.id=e,this.cmd=t,this.worker=r,this.fds=i,this.parentId=s,this.parentLock=o,this.callback=a,this.env=u,this.cwd=l,this.isJob=c,this.foreground=f,this.timestamp=Math.floor(new Date().getTime()/1e3),this.children=[]}}class xee{scriptName;filesystem;driverManager;processInfos;nextProcessId=0;compiledModules={};constructor(e,t,r,i={}){this.scriptName=e,this.filesystem=t,this.driverManager=r,this.processInfos=i}async syscallCallback(e,t){if(this.driverManager!==void 0){const r=this.driverManager.getDriver(1);if(r!==void 0){r.wrapCallback(async()=>{await _ee(e,t)});return}}}async spawnProcess(e,t,r,i,s,o,a,u,l=null){const c=this.nextProcessId;this.nextProcessId+=1;const f=new Worker(this.scriptName,{type:"module"});if(l===null&&this.processInfos[e]!=null&&(l=this.processInfos[e].foreground),e!==null&&(this.processInfos[e].children.push(c),t!==null&&(this.processInfos[e].foreground=null)),this.processInfos[c]=new kee(c,r,f,i,e,t,this.syscallCallback,o,u,a,l),f.onmessage=d=>this.syscallCallback(d,this),l!==null){const g=this.driverManager.getDriver(l.maj).terminals[l.min];g!=null&&(g.foregroundPid=c)}try{if(!this.compiledModules[r]){const{err:d,desc:g}=await this.filesystem.open(r,xn);if(d!==N)return console.error(`No such binary: ${r}`),await this.terminateProcess(c,d),d;this.compiledModules[r]=await WebAssembly.compile((await g.arrayBuffer()).buffer)}}catch(d){let g;throw d.message==="WebAssembly.compile(): BufferSource argument is empty"?g=N:g=jQ,await this.terminateProcess(c,g),Error("invalid binary")}return!a&&e!=null&&this.processInfos[e].terminationNotifier!==null&&this.processInfos[e].terminationNotifier.obtainEvents(ul)!=ts?this.terminateProcess(c,C2):this.processInfos[c].worker.postMessage(["start",this.compiledModules[r],c,s,o]),c}async terminateProcess(e,t=0){const r=this.processInfos[e];if(this.processInfos[e].fds.tearDown(),r.parentId!==null&&(this.processInfos[this.processInfos[e].parentId].foreground=r.foreground,this.processInfos[r.parentId].children.splice(r.children.indexOf(e),1),r.foreground!==null)){const i=this.driverManager.getDriver(r.foreground.maj);i.terminals[r.foreground.min].foregroundPid=r.parentId}r.worker.terminate(),r.children.forEach(i=>this.terminateProcess(i,128+C8)),e!==0&&r.parentLock!=null&&(Atomics.store(r.parentLock,0,t),Atomics.notify(r.parentLock,0)),e===0&&(window.alive=!1,window.exitCode=t),delete this.processInfos[e]}publishEvent(e,t){if(e&ul&&!this.processInfos[t].terminationNotifier){this.terminateProcess(t,128+ul);return}for(const r of Object.values(this.processInfos[t].fds.fdt))r.desc instanceof A2&&r.desc.sendEvents(e)}attachSigint(e,t){const r=this.processInfos[t].fds.getDesc(e);if(r===void 0)return Xe;if(!(r instanceof A2))return Ue;let i;return new Promise((s,o)=>{i=r.makeNotifier({resolve:s,reject:o}),i===N&&(this.processInfos[t].terminationNotifier=r)}).then(s=>{this.processInfos[t]!==void 0&&this.processInfos[t].terminationNotifier===s&&(this.processInfos[t].terminationNotifier=null)}),i}}var Vc=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},ao=[],Hi=[],See=typeof Uint8Array<"u"?Uint8Array:Array,Sx=!1;function N8(){Sx=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,t=n.length;e<t;++e)ao[e]=n[e],Hi[n.charCodeAt(e)]=e;Hi[45]=62,Hi[95]=63}function Cee(n){Sx||N8();var e,t,r,i,s,o,a=n.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s=n[a-2]==="="?2:n[a-1]==="="?1:0,o=new See(a*3/4-s),r=s>0?a-4:a;var u=0;for(e=0,t=0;e<r;e+=4,t+=3)i=Hi[n.charCodeAt(e)]<<18|Hi[n.charCodeAt(e+1)]<<12|Hi[n.charCodeAt(e+2)]<<6|Hi[n.charCodeAt(e+3)],o[u++]=i>>16&255,o[u++]=i>>8&255,o[u++]=i&255;return s===2?(i=Hi[n.charCodeAt(e)]<<2|Hi[n.charCodeAt(e+1)]>>4,o[u++]=i&255):s===1&&(i=Hi[n.charCodeAt(e)]<<10|Hi[n.charCodeAt(e+1)]<<4|Hi[n.charCodeAt(e+2)]>>2,o[u++]=i>>8&255,o[u++]=i&255),o}function Eee(n){return ao[n>>18&63]+ao[n>>12&63]+ao[n>>6&63]+ao[n&63]}function Aee(n,e,t){for(var r,i=[],s=e;s<t;s+=3)r=(n[s]<<16)+(n[s+1]<<8)+n[s+2],i.push(Eee(r));return i.join("")}function wT(n){Sx||N8();for(var e,t=n.length,r=t%3,i="",s=[],o=16383,a=0,u=t-r;a<u;a+=o)s.push(Aee(n,a,a+o>u?u:a+o));return r===1?(e=n[t-1],i+=ao[e>>2],i+=ao[e<<4&63],i+="=="):r===2&&(e=(n[t-2]<<8)+n[t-1],i+=ao[e>>10],i+=ao[e>>4&63],i+=ao[e<<2&63],i+="="),s.push(i),s.join("")}function uy(n,e,t,r,i){var s,o,a=i*8-r-1,u=(1<<a)-1,l=u>>1,c=-7,f=t?i-1:0,d=t?-1:1,g=n[e+f];for(f+=d,s=g&(1<<-c)-1,g>>=-c,c+=a;c>0;s=s*256+n[e+f],f+=d,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=r;c>0;o=o*256+n[e+f],f+=d,c-=8);if(s===0)s=1-l;else{if(s===u)return o?NaN:(g?-1:1)*(1/0);o=o+Math.pow(2,r),s=s-l}return(g?-1:1)*o*Math.pow(2,s-r)}function B8(n,e,t,r,i,s){var o,a,u,l=s*8-i-1,c=(1<<l)-1,f=c>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=r?0:s-1,m=r?1:-1,y=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+f>=1?e+=d/u:e+=d*Math.pow(2,1-f),e*u>=2&&(o++,u/=2),o+f>=c?(a=0,o=c):o+f>=1?(a=(e*u-1)*Math.pow(2,i),o=o+f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;n[t+g]=a&255,g+=m,a/=256,i-=8);for(o=o<<i|a,l+=i;l>0;n[t+g]=o&255,g+=m,o/=256,l-=8);n[t+g-m]|=y*128}var Ree={}.toString,q8=Array.isArray||function(n){return Ree.call(n)=="[object Array]"};/*!
|
|
189
|
-
* The buffer module from node.js, for the browser.
|
|
190
|
-
*
|
|
191
|
-
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
192
|
-
* @license MIT
|
|
193
|
-
*/var Dee=50;he.TYPED_ARRAY_SUPPORT=Vc.TYPED_ARRAY_SUPPORT!==void 0?Vc.TYPED_ARRAY_SUPPORT:!0;function R2(){return he.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function ia(n,e){if(R2()<e)throw new RangeError("Invalid typed array length");return he.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(e),n.__proto__=he.prototype):(n===null&&(n=new he(e)),n.length=e),n}function he(n,e,t){if(!he.TYPED_ARRAY_SUPPORT&&!(this instanceof he))return new he(n,e,t);if(typeof n=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return Cx(this,n)}return W8(this,n,e,t)}he.poolSize=8192;he._augment=function(n){return n.__proto__=he.prototype,n};function W8(n,e,t,r){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?Mee(n,e,t,r):typeof e=="string"?Iee(n,e,t):Oee(n,e)}he.from=function(n,e,t){return W8(null,n,e,t)};he.TYPED_ARRAY_SUPPORT&&(he.prototype.__proto__=Uint8Array.prototype,he.__proto__=Uint8Array);function j8(n){if(typeof n!="number")throw new TypeError('"size" argument must be a number');if(n<0)throw new RangeError('"size" argument must not be negative')}function Tee(n,e,t,r){return j8(e),e<=0?ia(n,e):t!==void 0?typeof r=="string"?ia(n,e).fill(t,r):ia(n,e).fill(t):ia(n,e)}he.alloc=function(n,e,t){return Tee(null,n,e,t)};function Cx(n,e){if(j8(e),n=ia(n,e<0?0:Ex(e)|0),!he.TYPED_ARRAY_SUPPORT)for(var t=0;t<e;++t)n[t]=0;return n}he.allocUnsafe=function(n){return Cx(null,n)};he.allocUnsafeSlow=function(n){return Cx(null,n)};function Iee(n,e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!he.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var r=$8(e,t)|0;n=ia(n,r);var i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function D2(n,e){var t=e.length<0?0:Ex(e.length)|0;n=ia(n,t);for(var r=0;r<t;r+=1)n[r]=e[r]&255;return n}function Mee(n,e,t,r){if(e.byteLength,t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(r||0))throw new RangeError("'length' is out of bounds");return t===void 0&&r===void 0?e=new Uint8Array(e):r===void 0?e=new Uint8Array(e,t):e=new Uint8Array(e,t,r),he.TYPED_ARRAY_SUPPORT?(n=e,n.__proto__=he.prototype):n=D2(n,e),n}function Oee(n,e){if(ko(e)){var t=Ex(e.length)|0;return n=ia(n,t),n.length===0||e.copy(n,0,0,t),n}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||Jee(e.length)?ia(n,0):D2(n,e);if(e.type==="Buffer"&&q8(e.data))return D2(n,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Ex(n){if(n>=R2())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+R2().toString(16)+" bytes");return n|0}he.isBuffer=X8;function ko(n){return!!(n!=null&&n._isBuffer)}he.compare=function(e,t){if(!ko(e)||!ko(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,i=t.length,s=0,o=Math.min(r,i);s<o;++s)if(e[s]!==t[s]){r=e[s],i=t[s];break}return r<i?-1:i<r?1:0};he.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};he.concat=function(e,t){if(!q8(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return he.alloc(0);var r;if(t===void 0)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var i=he.allocUnsafe(t),s=0;for(r=0;r<e.length;++r){var o=e[r];if(!ko(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,s),s+=o.length}return i};function $8(n,e){if(ko(n))return n.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(n)||n instanceof ArrayBuffer))return n.byteLength;typeof n!="string"&&(n=""+n);var t=n.length;if(t===0)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return C1(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Z8(n).length;default:if(r)return C1(n).length;e=(""+e).toLowerCase(),r=!0}}he.byteLength=$8;function Pee(n,e,t){var r=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(n||(n="utf8");;)switch(n){case"hex":return Uee(this,e,t);case"utf8":case"utf-8":return H8(this,e,t);case"ascii":return $ee(this,e,t);case"latin1":case"binary":return zee(this,e,t);case"base64":return Wee(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Hee(this,e,t);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),r=!0}}he.prototype._isBuffer=!0;function rl(n,e,t){var r=n[e];n[e]=n[t],n[t]=r}he.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)rl(this,t,t+1);return this};he.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)rl(this,t,t+3),rl(this,t+1,t+2);return this};he.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)rl(this,t,t+7),rl(this,t+1,t+6),rl(this,t+2,t+5),rl(this,t+3,t+4);return this};he.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?H8(this,0,e):Pee.apply(this,arguments)};he.prototype.equals=function(e){if(!ko(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:he.compare(this,e)===0};he.prototype.inspect=function(){var e="",t=Dee;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"};he.prototype.compare=function(e,t,r,i,s){if(!ko(e))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),r===void 0&&(r=e?e.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),t<0||r>e.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&t>=r)return 0;if(i>=s)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,i>>>=0,s>>>=0,this===e)return 0;for(var o=s-i,a=r-t,u=Math.min(o,a),l=this.slice(i,s),c=e.slice(t,r),f=0;f<u;++f)if(l[f]!==c[f]){o=l[f],a=c[f];break}return o<a?-1:a<o?1:0};function z8(n,e,t,r,i){if(n.length===0)return-1;if(typeof t=="string"?(r=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=i?0:n.length-1),t<0&&(t=n.length+t),t>=n.length){if(i)return-1;t=n.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e=="string"&&(e=he.from(e,r)),ko(e))return e.length===0?-1:_T(n,e,t,r,i);if(typeof e=="number")return e=e&255,he.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(n,e,t):Uint8Array.prototype.lastIndexOf.call(n,e,t):_T(n,[e],t,r,i);throw new TypeError("val must be string, number or Buffer")}function _T(n,e,t,r,i){var s=1,o=n.length,a=e.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(n.length<2||e.length<2)return-1;s=2,o/=2,a/=2,t/=2}function u(g,m){return s===1?g[m]:g.readUInt16BE(m*s)}var l;if(i){var c=-1;for(l=t;l<o;l++)if(u(n,l)===u(e,c===-1?0:l-c)){if(c===-1&&(c=l),l-c+1===a)return c*s}else c!==-1&&(l-=l-c),c=-1}else for(t+a>o&&(t=o-a),l=t;l>=0;l--){for(var f=!0,d=0;d<a;d++)if(u(n,l+d)!==u(e,d)){f=!1;break}if(f)return l}return-1}he.prototype.includes=function(e,t,r){return this.indexOf(e,t,r)!==-1};he.prototype.indexOf=function(e,t,r){return z8(this,e,t,r,!0)};he.prototype.lastIndexOf=function(e,t,r){return z8(this,e,t,r,!1)};function Lee(n,e,t,r){t=Number(t)||0;var i=n.length-t;r?(r=Number(r),r>i&&(r=i)):r=i;var s=e.length;if(s%2!==0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var o=0;o<r;++o){var a=parseInt(e.substr(o*2,2),16);if(isNaN(a))return o;n[t+o]=a}return o}function Fee(n,e,t,r){return fy(C1(e,n.length-t),n,t,r)}function U8(n,e,t,r){return fy(Xee(e),n,t,r)}function Nee(n,e,t,r){return U8(n,e,t,r)}function Bee(n,e,t,r){return fy(Z8(e),n,t,r)}function qee(n,e,t,r){return fy(Yee(e,n.length-t),n,t,r)}he.prototype.write=function(e,t,r,i){if(t===void 0)i="utf8",r=this.length,t=0;else if(r===void 0&&typeof t=="string")i=t,r=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(r)?(r=r|0,i===void 0&&(i="utf8")):(i=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-t;if((r===void 0||r>s)&&(r=s),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return Lee(this,e,t,r);case"utf8":case"utf-8":return Fee(this,e,t,r);case"ascii":return U8(this,e,t,r);case"latin1":case"binary":return Nee(this,e,t,r);case"base64":return Bee(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qee(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};he.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Wee(n,e,t){return e===0&&t===n.length?wT(n):wT(n.slice(e,t))}function H8(n,e,t){t=Math.min(n.length,t);for(var r=[],i=e;i<t;){var s=n[i],o=null,a=s>239?4:s>223?3:s>191?2:1;if(i+a<=t){var u,l,c,f;switch(a){case 1:s<128&&(o=s);break;case 2:u=n[i+1],(u&192)===128&&(f=(s&31)<<6|u&63,f>127&&(o=f));break;case 3:u=n[i+1],l=n[i+2],(u&192)===128&&(l&192)===128&&(f=(s&15)<<12|(u&63)<<6|l&63,f>2047&&(f<55296||f>57343)&&(o=f));break;case 4:u=n[i+1],l=n[i+2],c=n[i+3],(u&192)===128&&(l&192)===128&&(c&192)===128&&(f=(s&15)<<18|(u&63)<<12|(l&63)<<6|c&63,f>65535&&f<1114112&&(o=f))}}o===null?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|o&1023),r.push(o),i+=a}return jee(r)}var kT=4096;function jee(n){var e=n.length;if(e<=kT)return String.fromCharCode.apply(String,n);for(var t="",r=0;r<e;)t+=String.fromCharCode.apply(String,n.slice(r,r+=kT));return t}function $ee(n,e,t){var r="";t=Math.min(n.length,t);for(var i=e;i<t;++i)r+=String.fromCharCode(n[i]&127);return r}function zee(n,e,t){var r="";t=Math.min(n.length,t);for(var i=e;i<t;++i)r+=String.fromCharCode(n[i]);return r}function Uee(n,e,t){var r=n.length;(!e||e<0)&&(e=0),(!t||t<0||t>r)&&(t=r);for(var i="",s=e;s<t;++s)i+=Zee(n[s]);return i}function Hee(n,e,t){for(var r=n.slice(e,t),i="",s=0;s<r.length;s+=2)i+=String.fromCharCode(r[s]+r[s+1]*256);return i}he.prototype.slice=function(e,t){var r=this.length;e=~~e,t=t===void 0?r:~~t,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),t<e&&(t=e);var i;if(he.TYPED_ARRAY_SUPPORT)i=this.subarray(e,t),i.__proto__=he.prototype;else{var s=t-e;i=new he(s,void 0);for(var o=0;o<s;++o)i[o]=this[o+e]}return i};function Zn(n,e,t){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+e>t)throw new RangeError("Trying to access beyond buffer length")}he.prototype.readUIntLE=function(e,t,r){e=e|0,t=t|0,r||Zn(e,t,this.length);for(var i=this[e],s=1,o=0;++o<t&&(s*=256);)i+=this[e+o]*s;return i};he.prototype.readUIntBE=function(e,t,r){e=e|0,t=t|0,r||Zn(e,t,this.length);for(var i=this[e+--t],s=1;t>0&&(s*=256);)i+=this[e+--t]*s;return i};he.prototype.readUInt8=function(e,t){return t||Zn(e,1,this.length),this[e]};he.prototype.readUInt16LE=function(e,t){return t||Zn(e,2,this.length),this[e]|this[e+1]<<8};he.prototype.readUInt16BE=function(e,t){return t||Zn(e,2,this.length),this[e]<<8|this[e+1]};he.prototype.readUInt32LE=function(e,t){return t||Zn(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};he.prototype.readUInt32BE=function(e,t){return t||Zn(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};he.prototype.readIntLE=function(e,t,r){e=e|0,t=t|0,r||Zn(e,t,this.length);for(var i=this[e],s=1,o=0;++o<t&&(s*=256);)i+=this[e+o]*s;return s*=128,i>=s&&(i-=Math.pow(2,8*t)),i};he.prototype.readIntBE=function(e,t,r){e=e|0,t=t|0,r||Zn(e,t,this.length);for(var i=t,s=1,o=this[e+--i];i>0&&(s*=256);)o+=this[e+--i]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*t)),o};he.prototype.readInt8=function(e,t){return t||Zn(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};he.prototype.readInt16LE=function(e,t){t||Zn(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};he.prototype.readInt16BE=function(e,t){t||Zn(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};he.prototype.readInt32LE=function(e,t){return t||Zn(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};he.prototype.readInt32BE=function(e,t){return t||Zn(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};he.prototype.readFloatLE=function(e,t){return t||Zn(e,4,this.length),uy(this,e,!0,23,4)};he.prototype.readFloatBE=function(e,t){return t||Zn(e,4,this.length),uy(this,e,!1,23,4)};he.prototype.readDoubleLE=function(e,t){return t||Zn(e,8,this.length),uy(this,e,!0,52,8)};he.prototype.readDoubleBE=function(e,t){return t||Zn(e,8,this.length),uy(this,e,!1,52,8)};function gi(n,e,t,r,i,s){if(!ko(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(t+r>n.length)throw new RangeError("Index out of range")}he.prototype.writeUIntLE=function(e,t,r,i){if(e=+e,t=t|0,r=r|0,!i){var s=Math.pow(2,8*r)-1;gi(this,e,t,r,s,0)}var o=1,a=0;for(this[t]=e&255;++a<r&&(o*=256);)this[t+a]=e/o&255;return t+r};he.prototype.writeUIntBE=function(e,t,r,i){if(e=+e,t=t|0,r=r|0,!i){var s=Math.pow(2,8*r)-1;gi(this,e,t,r,s,0)}var o=r-1,a=1;for(this[t+o]=e&255;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+r};he.prototype.writeUInt8=function(e,t,r){return e=+e,t=t|0,r||gi(this,e,t,1,255,0),he.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e&255,t+1};function ly(n,e,t,r){e<0&&(e=65535+e+1);for(var i=0,s=Math.min(n.length-t,2);i<s;++i)n[t+i]=(e&255<<8*(r?i:1-i))>>>(r?i:1-i)*8}he.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t|0,r||gi(this,e,t,2,65535,0),he.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):ly(this,e,t,!0),t+2};he.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=t|0,r||gi(this,e,t,2,65535,0),he.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):ly(this,e,t,!1),t+2};function cy(n,e,t,r){e<0&&(e=4294967295+e+1);for(var i=0,s=Math.min(n.length-t,4);i<s;++i)n[t+i]=e>>>(r?i:3-i)*8&255}he.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=t|0,r||gi(this,e,t,4,4294967295,0),he.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255):cy(this,e,t,!0),t+4};he.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=t|0,r||gi(this,e,t,4,4294967295,0),he.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):cy(this,e,t,!1),t+4};he.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t=t|0,!i){var s=Math.pow(2,8*r-1);gi(this,e,t,r,s-1,-s)}var o=0,a=1,u=0;for(this[t]=e&255;++o<r&&(a*=256);)e<0&&u===0&&this[t+o-1]!==0&&(u=1),this[t+o]=(e/a>>0)-u&255;return t+r};he.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t=t|0,!i){var s=Math.pow(2,8*r-1);gi(this,e,t,r,s-1,-s)}var o=r-1,a=1,u=0;for(this[t+o]=e&255;--o>=0&&(a*=256);)e<0&&u===0&&this[t+o+1]!==0&&(u=1),this[t+o]=(e/a>>0)-u&255;return t+r};he.prototype.writeInt8=function(e,t,r){return e=+e,t=t|0,r||gi(this,e,t,1,127,-128),he.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=e&255,t+1};he.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t|0,r||gi(this,e,t,2,32767,-32768),he.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):ly(this,e,t,!0),t+2};he.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t|0,r||gi(this,e,t,2,32767,-32768),he.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):ly(this,e,t,!1),t+2};he.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t|0,r||gi(this,e,t,4,2147483647,-2147483648),he.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):cy(this,e,t,!0),t+4};he.prototype.writeInt32BE=function(e,t,r){return e=+e,t=t|0,r||gi(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),he.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):cy(this,e,t,!1),t+4};function V8(n,e,t,r,i,s){if(t+r>n.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function G8(n,e,t,r,i){return i||V8(n,e,t,4),B8(n,e,t,r,23,4),t+4}he.prototype.writeFloatLE=function(e,t,r){return G8(this,e,t,!0,r)};he.prototype.writeFloatBE=function(e,t,r){return G8(this,e,t,!1,r)};function K8(n,e,t,r,i){return i||V8(n,e,t,8),B8(n,e,t,r,52,8),t+8}he.prototype.writeDoubleLE=function(e,t,r){return K8(this,e,t,!0,r)};he.prototype.writeDoubleBE=function(e,t,r){return K8(this,e,t,!1,r)};he.prototype.copy=function(e,t,r,i){if(r||(r=0),!i&&i!==0&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<r&&(i=r),i===r||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-r&&(i=e.length-t+r);var s=i-r,o;if(this===e&&r<t&&t<i)for(o=s-1;o>=0;--o)e[o+t]=this[o+r];else if(s<1e3||!he.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+s),t);return s};he.prototype.fill=function(e,t,r,i){if(typeof e=="string"){if(typeof t=="string"?(i=t,t=0,r=this.length):typeof r=="string"&&(i=r,r=this.length),e.length===1){var s=e.charCodeAt(0);s<256&&(e=s)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!he.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof e=="number"&&(e=e&255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;t=t>>>0,r=r===void 0?this.length:r>>>0,e||(e=0);var o;if(typeof e=="number")for(o=t;o<r;++o)this[o]=e;else{var a=ko(e)?e:C1(new he(e,i).toString()),u=a.length;for(o=0;o<r-t;++o)this[o+t]=a[o%u]}return this};var Vee=/[^+\/0-9A-Za-z-_]/g;function Gee(n){if(n=Kee(n).replace(Vee,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function Kee(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function Zee(n){return n<16?"0"+n.toString(16):n.toString(16)}function C1(n,e){e=e||1/0;for(var t,r=n.length,i=null,s=[],o=0;o<r;++o){if(t=n.charCodeAt(o),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===r){(e-=3)>-1&&s.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,t<128){if((e-=1)<0)break;s.push(t)}else if(t<2048){if((e-=2)<0)break;s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}function Xee(n){for(var e=[],t=0;t<n.length;++t)e.push(n.charCodeAt(t)&255);return e}function Yee(n,e){for(var t,r,i,s=[],o=0;o<n.length&&!((e-=2)<0);++o)t=n.charCodeAt(o),r=t>>8,i=t%256,s.push(i),s.push(r);return s}function Z8(n){return Cee(Gee(n))}function fy(n,e,t,r){for(var i=0;i<r&&!(i+t>=e.length||i>=n.length);++i)e[i+t]=n[i];return i}function Jee(n){return n!==n}function X8(n){return n!=null&&(!!n._isBuffer||Y8(n)||Qee(n))}function Y8(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function Qee(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&Y8(n.slice(0,0))}var Zd=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zt(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function dt(n,e){return e={exports:{}},n(e,e.exports),e.exports}var ete=Math.ceil,tte=Math.floor,Ax=function(n){return isNaN(n=+n)?0:(n>0?tte:ete)(n)},Rx=function(n){if(n==null)throw TypeError("Can't call method on "+n);return n},nte=function(n){return function(e,t){var r=String(Rx(e)),i=Ax(t),s=r.length,o,a;return i<0||i>=s?"":(o=r.charCodeAt(i),o<55296||o>56319||i+1===s||(a=r.charCodeAt(i+1))<56320||a>57343?r.charAt(i):r.slice(i,i+2))}},rte=!0,Ke=dt(function(n){var e=n.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=e)}),Lt=dt(function(n){var e=n.exports={version:"2.6.12"};typeof __e=="number"&&(__e=e)});Lt.version;var bl=function(n){if(typeof n!="function")throw TypeError(n+" is not a function!");return n},Kn=function(n,e,t){if(bl(n),e===void 0)return n;switch(t){case 1:return function(r){return n.call(e,r)};case 2:return function(r,i){return n.call(e,r,i)};case 3:return function(r,i,s){return n.call(e,r,i,s)}}return function(){return n.apply(e,arguments)}},Ln=function(n){return typeof n=="object"?n!==null:typeof n=="function"},Cr=function(n){if(!Ln(n))throw TypeError(n+" is not an object!");return n},ba=function(n){try{return!!n()}catch{return!0}},Mi=!ba(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}),T2=Ke.document,ite=Ln(T2)&&Ln(T2.createElement),E1=function(n){return ite?T2.createElement(n):{}},J8=!Mi&&!ba(function(){return Object.defineProperty(E1("div"),"a",{get:function(){return 7}}).a!=7}),_p=function(n,e){if(!Ln(n))return n;var t,r;if(typeof(t=n.toString)=="function"&&!Ln(r=t.call(n))||typeof(t=n.valueOf)=="function"&&!Ln(r=t.call(n)))return r;throw TypeError("Can't convert object to primitive value")},ste=Object.defineProperty,ote=Mi?Object.defineProperty:function(e,t,r){if(Cr(e),t=_p(t),Cr(r),J8)try{return ste(e,t,r)}catch{}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e},us={f:ote},wl=function(n,e){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:e}},pu=Mi?function(n,e,t){return us.f(n,e,wl(1,t))}:function(n,e,t){return n[e]=t,n},ate={}.hasOwnProperty,Ot=function(n,e){return ate.call(n,e)},tm="prototype",kr=function(n,e,t){var r=n&kr.F,i=n&kr.G,s=n&kr.S,o=n&kr.P,a=n&kr.B,u=n&kr.W,l=i?Lt:Lt[e]||(Lt[e]={}),c=l[tm],f=i?Ke:s?Ke[e]:(Ke[e]||{})[tm],d,g,m;i&&(t=e);for(d in t)g=!r&&f&&f[d]!==void 0,!(g&&Ot(l,d))&&(m=g?f[d]:t[d],l[d]=i&&typeof f[d]!="function"?t[d]:a&&g?Kn(m,Ke):u&&f[d]==m?function(y){var b=function(w,x,_){if(this instanceof y){switch(arguments.length){case 0:return new y;case 1:return new y(w);case 2:return new y(w,x)}return new y(w,x,_)}return y.apply(this,arguments)};return b[tm]=y[tm],b}(m):o&&typeof m=="function"?Kn(Function.call,m):m,o&&((l.virtual||(l.virtual={}))[d]=m,n&kr.R&&c&&!c[d]&&pu(c,d,m)))};kr.F=1;kr.G=2;kr.S=4;kr.P=8;kr.B=16;kr.W=32;kr.U=64;kr.R=128;var Ie=kr,Dx=pu,ha={},ute={}.toString,_l=function(n){return ute.call(n).slice(8,-1)},Tx=Object("z").propertyIsEnumerable(0)?Object:function(n){return _l(n)=="String"?n.split(""):Object(n)},Ro=function(n){return Tx(Rx(n))},lte=Math.min,hy=function(n){return n>0?lte(Ax(n),9007199254740991):0},cte=Math.max,fte=Math.min,hte=function(n,e){return n=Ax(n),n<0?cte(n+e,0):fte(n,e)},dte=function(n){return function(e,t,r){for(var i=Ro(e),s=hy(i.length),o=hte(r,s);s>o;o++)if(o in i&&i[o]===t)return o||0;return-1}},kp=dt(function(n){var e="__core-js_shared__",t=Ke[e]||(Ke[e]={});(n.exports=function(r,i){return t[r]||(t[r]=i!==void 0?i:{})})("versions",[]).push({version:Lt.version,mode:"pure",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})}),pte=0,gte=Math.random(),dy=function(n){return"Symbol(".concat(n===void 0?"":n,")_",(++pte+gte).toString(36))},xT=kp("keys"),Ix=function(n){return xT[n]||(xT[n]=dy(n))},mte=dte(),yte=Ix("IE_PROTO"),Q8=function(n,e){var t=Ro(n),r=0,i=[],s;for(s in t)s!=yte&&Ot(t,s)&&i.push(s);for(;e.length>r;)Ot(t,s=e[r++])&&(~mte(i,s)||i.push(s));return i},A1="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),Xd=Object.keys||function(e){return Q8(e,A1)},vte=Mi?Object.defineProperties:function(e,t){Cr(e);for(var r=Xd(t),i=r.length,s=0,o;i>s;)us.f(e,o=r[s++],t[o]);return e},ST=Ke.document,I2=ST&&ST.documentElement,bte=Ix("IE_PROTO"),Bb=function(){},M2="prototype",Cm=function(){var n=E1("iframe"),e=A1.length,t="<",r=">",i;for(n.style.display="none",I2.appendChild(n),n.src="javascript:",i=n.contentWindow.document,i.open(),i.write(t+"script"+r+"document.F=Object"+t+"/script"+r),i.close(),Cm=i.F;e--;)delete Cm[M2][A1[e]];return Cm()},cu=Object.create||function(e,t){var r;return e!==null?(Bb[M2]=Cr(e),r=new Bb,Bb[M2]=null,r[bte]=e):r=Cm(),t===void 0?r:vte(r,t)},Nn=dt(function(n){var e=kp("wks"),t=Ke.Symbol,r=typeof t=="function",i=n.exports=function(s){return e[s]||(e[s]=r&&t[s]||(r?t:dy)("Symbol."+s))};i.store=e}),wte=us.f,CT=Nn("toStringTag"),Sl=function(n,e,t){n&&!Ot(n=t?n:n.prototype,CT)&&wte(n,CT,{configurable:!0,value:e})},e4={};pu(e4,Nn("iterator"),function(){return this});var _te=function(n,e,t){n.prototype=cu(e4,{next:wl(1,t)}),Sl(n,e+" Iterator")},af=function(n){return Object(Rx(n))},ET=Ix("IE_PROTO"),kte=Object.prototype,t4=Object.getPrototypeOf||function(n){return n=af(n),Ot(n,ET)?n[ET]:typeof n.constructor=="function"&&n instanceof n.constructor?n.constructor.prototype:n instanceof Object?kte:null},qb=Nn("iterator"),Wb=!([].keys&&"next"in[].keys()),xte="@@iterator",AT="keys",nm="values",Ste=function(){return this},Mx=function(n,e,t,r,i,s,o){_te(t,e,r);var a=function(_){if(!Wb&&_ in f)return f[_];switch(_){case AT:return function(){return new t(this,_)};case nm:return function(){return new t(this,_)}}return function(){return new t(this,_)}},u=e+" Iterator",l=i==nm,c=!1,f=n.prototype,d=f[qb]||f[xte]||i&&f[i],g=d||a(i),m=i?l?a("entries"):g:void 0,y=e=="Array"&&f.entries||d,b,w,x;if(y&&(x=t4(y.call(new n)),x!==Object.prototype&&x.next&&Sl(x,u,!0)),l&&d&&d.name!==nm&&(c=!0,g=function(){return d.call(this)}),o&&(Wb||c||!f[qb])&&pu(f,qb,g),ha[e]=g,ha[u]=Ste,i)if(b={values:l?g:a(nm),keys:s?g:a(AT),entries:m},o)for(w in b)w in f||Dx(f,w,b[w]);else Ie(Ie.P+Ie.F*(Wb||c),e,b);return b},Cte=nte();Mx(String,"String",function(n){this._t=String(n),this._i=0},function(){var n=this._t,e=this._i,t;return e>=n.length?{value:void 0,done:!0}:(t=Cte(n,e),this._i+=t.length,{value:t,done:!1})});var Ja=function(n,e){return{value:e,done:!!n}};Mx(Array,"Array",function(n,e){this._t=Ro(n),this._i=0,this._k=e},function(){var n=this._t,e=this._k,t=this._i++;return!n||t>=n.length?(this._t=void 0,Ja(1)):e=="keys"?Ja(0,t):e=="values"?Ja(0,n[t]):Ja(0,[t,n[t]])},"values");ha.Arguments=ha.Array;var RT=Nn("toStringTag"),DT="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(",");for(var jb=0;jb<DT.length;jb++){var $b=DT[jb],TT=Ke[$b],zb=TT&&TT.prototype;zb&&!zb[RT]&&pu(zb,RT,$b),ha[$b]=ha.Array}var Ete=Nn,Ox={f:Ete},Ate=Ox.f("iterator"),n4=dt(function(n){n.exports={default:Ate,__esModule:!0}});Zt(n4);var ss=dt(function(n){var e=dy("meta"),t=us.f,r=0,i=Object.isExtensible||function(){return!0},s=!ba(function(){return i(Object.preventExtensions({}))}),o=function(f){t(f,e,{value:{i:"O"+ ++r,w:{}}})},a=function(f,d){if(!Ln(f))return typeof f=="symbol"?f:(typeof f=="string"?"S":"P")+f;if(!Ot(f,e)){if(!i(f))return"F";if(!d)return"E";o(f)}return f[e].i},u=function(f,d){if(!Ot(f,e)){if(!i(f))return!0;if(!d)return!1;o(f)}return f[e].w},l=function(f){return s&&c.NEED&&i(f)&&!Ot(f,e)&&o(f),f},c=n.exports={KEY:e,NEED:!1,fastKey:a,getWeak:u,onFreeze:l}});ss.KEY;ss.NEED;ss.fastKey;ss.getWeak;ss.onFreeze;var Rte=us.f,Px=function(n){var e=Lt.Symbol||(Lt.Symbol={});n.charAt(0)!="_"&&!(n in e)&&Rte(e,n,{value:Ox.f(n)})},Dte=Object.getOwnPropertySymbols,uf={f:Dte},Tte={}.propertyIsEnumerable,py={f:Tte},Ite=function(n){var e=Xd(n),t=uf.f;if(t)for(var r=t(n),i=py.f,s=0,o;r.length>s;)i.call(n,o=r[s++])&&e.push(o);return e},O2=Array.isArray||function(e){return _l(e)=="Array"},Mte=A1.concat("length","prototype"),Ote=Object.getOwnPropertyNames||function(e){return Q8(e,Mte)},r4={f:Ote},i4=r4.f,Pte={}.toString,s4=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Lte=function(n){try{return i4(n)}catch{return s4.slice()}},Fte=function(e){return s4&&Pte.call(e)=="[object Window]"?Lte(e):i4(Ro(e))},o4={f:Fte},IT=Object.getOwnPropertyDescriptor,Nte=Mi?IT:function(e,t){if(e=Ro(e),t=_p(t),J8)try{return IT(e,t)}catch{}if(Ot(e,t))return wl(!py.f.call(e,t),e[t])},gy={f:Nte},Bte=ss.KEY,a4=gy.f,el=us.f,u4=o4.f,di=Ke.Symbol,R1=Ke.JSON,rm=R1&&R1.stringify,tu="prototype",li=Nn("_hidden"),MT=Nn("toPrimitive"),qte={}.propertyIsEnumerable,Hh=kp("symbol-registry"),da=kp("symbols"),xp=kp("op-symbols"),Ts=Object[tu],lf=typeof di=="function"&&!!uf.f,Ub=Ke.QObject,P2=!Ub||!Ub[tu]||!Ub[tu].findChild,L2=Mi&&ba(function(){return cu(el({},"a",{get:function(){return el(this,"a",{value:7}).a}})).a!=7})?function(n,e,t){var r=a4(Ts,e);r&&delete Ts[e],el(n,e,t),r&&n!==Ts&&el(Ts,e,r)}:el,OT=function(n){var e=da[n]=cu(di[tu]);return e._k=n,e},F2=lf&&typeof di.iterator=="symbol"?function(n){return typeof n=="symbol"}:function(n){return n instanceof di},my=function(e,t,r){return e===Ts&&my(xp,t,r),Cr(e),t=_p(t),Cr(r),Ot(da,t)?(r.enumerable?(Ot(e,li)&&e[li][t]&&(e[li][t]=!1),r=cu(r,{enumerable:wl(0,!1)})):(Ot(e,li)||el(e,li,wl(1,{})),e[li][t]=!0),L2(e,t,r)):el(e,t,r)},l4=function(e,t){Cr(e);for(var r=Ite(t=Ro(t)),i=0,s=r.length,o;s>i;)my(e,o=r[i++],t[o]);return e},Wte=function(e,t){return t===void 0?cu(e):l4(cu(e),t)},jte=function(e){var t=qte.call(this,e=_p(e));return this===Ts&&Ot(da,e)&&!Ot(xp,e)?!1:t||!Ot(this,e)||!Ot(da,e)||Ot(this,li)&&this[li][e]?t:!0},c4=function(e,t){if(e=Ro(e),t=_p(t),!(e===Ts&&Ot(da,t)&&!Ot(xp,t))){var r=a4(e,t);return r&&Ot(da,t)&&!(Ot(e,li)&&e[li][t])&&(r.enumerable=!0),r}},f4=function(e){for(var t=u4(Ro(e)),r=[],i=0,s;t.length>i;)!Ot(da,s=t[i++])&&s!=li&&s!=Bte&&r.push(s);return r},h4=function(e){for(var t=e===Ts,r=u4(t?xp:Ro(e)),i=[],s=0,o;r.length>s;)Ot(da,o=r[s++])&&(!t||Ot(Ts,o))&&i.push(da[o]);return i};lf||(di=function(){if(this instanceof di)throw TypeError("Symbol is not a constructor!");var e=dy(arguments.length>0?arguments[0]:void 0),t=function(r){this===Ts&&t.call(xp,r),Ot(this,li)&&Ot(this[li],e)&&(this[li][e]=!1),L2(this,e,wl(1,r))};return Mi&&P2&&L2(Ts,e,{configurable:!0,set:t}),OT(e)},Dx(di[tu],"toString",function(){return this._k}),gy.f=c4,us.f=my,r4.f=o4.f=f4,py.f=jte,uf.f=h4,Ox.f=function(n){return OT(Nn(n))});Ie(Ie.G+Ie.W+Ie.F*!lf,{Symbol:di});for(var PT="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),LT=0;PT.length>LT;)Nn(PT[LT++]);for(var FT=Xd(Nn.store),NT=0;FT.length>NT;)Px(FT[NT++]);Ie(Ie.S+Ie.F*!lf,"Symbol",{for:function(n){return Ot(Hh,n+="")?Hh[n]:Hh[n]=di(n)},keyFor:function(e){if(!F2(e))throw TypeError(e+" is not a symbol!");for(var t in Hh)if(Hh[t]===e)return t},useSetter:function(){P2=!0},useSimple:function(){P2=!1}});Ie(Ie.S+Ie.F*!lf,"Object",{create:Wte,defineProperty:my,defineProperties:l4,getOwnPropertyDescriptor:c4,getOwnPropertyNames:f4,getOwnPropertySymbols:h4});var $te=ba(function(){uf.f(1)});Ie(Ie.S+Ie.F*$te,"Object",{getOwnPropertySymbols:function(e){return uf.f(af(e))}});R1&&Ie(Ie.S+Ie.F*(!lf||ba(function(){var n=di();return rm([n])!="[null]"||rm({a:n})!="{}"||rm(Object(n))!="{}"})),"JSON",{stringify:function(e){for(var t=[e],r=1,i,s;arguments.length>r;)t.push(arguments[r++]);if(s=i=t[1],!(!Ln(i)&&e===void 0||F2(e)))return O2(i)||(i=function(o,a){if(typeof s=="function"&&(a=s.call(this,o,a)),!F2(a))return a}),t[1]=i,rm.apply(R1,t)}});di[tu][MT]||pu(di[tu],MT,di[tu].valueOf);Sl(di,"Symbol");Sl(Math,"Math",!0);Sl(Ke.JSON,"JSON",!0);Px("asyncIterator");Px("observable");var zte=Lt.Symbol,d4=dt(function(n){n.exports={default:zte,__esModule:!0}});Zt(d4);var Lx=dt(function(n,e){e.__esModule=!0;var t=s(n4),r=s(d4),i=typeof r.default=="function"&&typeof t.default=="symbol"?function(o){return typeof o}:function(o){return o&&typeof r.default=="function"&&o.constructor===r.default&&o!==r.default.prototype?"symbol":typeof o};function s(o){return o&&o.__esModule?o:{default:o}}e.default=typeof r.default=="function"&&i(t.default)==="symbol"?function(o){return typeof o>"u"?"undefined":i(o)}:function(o){return o&&typeof r.default=="function"&&o.constructor===r.default&&o!==r.default.prototype?"symbol":typeof o>"u"?"undefined":i(o)}}),Ute=Zt(Lx),im=Object.assign,p4=!im||ba(function(){var n={},e={},t=Symbol(),r="abcdefghijklmnopqrst";return n[t]=7,r.split("").forEach(function(i){e[i]=i}),im({},n)[t]!=7||Object.keys(im({},e)).join("")!=r})?function(e,t){for(var r=af(e),i=arguments.length,s=1,o=uf.f,a=py.f;i>s;)for(var u=Tx(arguments[s++]),l=o?Xd(u).concat(o(u)):Xd(u),c=l.length,f=0,d;c>f;)d=l[f++],(!Mi||a.call(u,d))&&(r[d]=u[d]);return r}:im;Ie(Ie.S+Ie.F,"Object",{assign:p4});var Hte=Lt.Object.assign,g4=dt(function(n){n.exports={default:Hte,__esModule:!0}});Zt(g4);var Vte=dt(function(n,e){e.__esModule=!0;var t=r(g4);function r(i){return i&&i.__esModule?i:{default:i}}e.default=t.default||function(i){for(var s=1;s<arguments.length;s++){var o=arguments[s];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(i[a]=o[a])}return i}}),fc=Zt(Vte),m4=function(n,e,t,r){try{return r?e(Cr(t)[0],t[1]):e(t)}catch(s){var i=n.return;throw i!==void 0&&Cr(i.call(n)),s}},Gte=Nn("iterator"),Kte=Array.prototype,y4=function(n){return n!==void 0&&(ha.Array===n||Kte[Gte]===n)},BT=function(n,e,t){e in n?us.f(n,e,wl(0,t)):n[e]=t},Zte=Nn("toStringTag"),Xte=_l(function(){return arguments}())=="Arguments",Yte=function(n,e){try{return n[e]}catch{}},yy=function(n){var e,t,r;return n===void 0?"Undefined":n===null?"Null":typeof(t=Yte(e=Object(n),Zte))=="string"?t:Xte?_l(e):(r=_l(e))=="Object"&&typeof e.callee=="function"?"Arguments":r},Jte=Nn("iterator"),Fx=Lt.getIteratorMethod=function(n){if(n!=null)return n[Jte]||n["@@iterator"]||ha[yy(n)]},N2=Nn("iterator"),v4=!1;try{var Qte=[7][N2]();Qte.return=function(){v4=!0}}catch{}var b4=function(n,e){if(!v4)return!1;var t=!1;try{var r=[7],i=r[N2]();i.next=function(){return{done:t=!0}},r[N2]=function(){return i},n(r)}catch{}return t};Ie(Ie.S+Ie.F*!b4(function(n){}),"Array",{from:function(e){var t=af(e),r=typeof this=="function"?this:Array,i=arguments.length,s=i>1?arguments[1]:void 0,o=s!==void 0,a=0,u=Fx(t),l,c,f,d;if(o&&(s=Kn(s,i>2?arguments[2]:void 0,2)),u!=null&&!(r==Array&&y4(u)))for(d=u.call(t),c=new r;!(f=d.next()).done;a++)BT(c,a,o?m4(d,s,[f.value,a],!0):f.value);else for(l=hy(t.length),c=new r(l);l>a;a++)BT(c,a,o?s(t[a],a):t[a]);return c.length=a,c}});var ene=Lt.Array.from,w4=dt(function(n){n.exports={default:ene,__esModule:!0}});Zt(w4);var tne=dt(function(n,e){e.__esModule=!0;var t=r(w4);function r(i){return i&&i.__esModule?i:{default:i}}e.default=function(i){if(Array.isArray(i)){for(var s=0,o=Array(i.length);s<i.length;s++)o[s]=i[s];return o}else return(0,t.default)(i)}}),ln=Zt(tne),nne=Nn("iterator"),rne=Lt.isIterable=function(n){var e=Object(n);return e[nne]!==void 0||"@@iterator"in e||ha.hasOwnProperty(yy(e))},ine=rne,_4=dt(function(n){n.exports={default:ine,__esModule:!0}});Zt(_4);var sne=Lt.getIterator=function(n){var e=Fx(n);if(typeof e!="function")throw TypeError(n+" is not iterable!");return Cr(e.call(n))},one=sne,k4=dt(function(n){n.exports={default:one,__esModule:!0}});Zt(k4);var ane=dt(function(n,e){e.__esModule=!0;var t=i(_4),r=i(k4);function i(s){return s&&s.__esModule?s:{default:s}}e.default=function(){function s(o,a){var u=[],l=!0,c=!1,f=void 0;try{for(var d=(0,r.default)(o),g;!(l=(g=d.next()).done)&&(u.push(g.value),!(a&&u.length===a));l=!0);}catch(m){c=!0,f=m}finally{try{!l&&d.return&&d.return()}finally{if(c)throw f}}return u}return function(o,a){if(Array.isArray(o))return o;if((0,t.default)(Object(o)))return s(o,a);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()}),si=Zt(ane),une=dt(function(n,e){e.__esModule=!0,e.default=function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}}),fr=Zt(une);Ie(Ie.S+Ie.F*!Mi,"Object",{defineProperty:us.f});var lne=Lt.Object,cne=function(e,t,r){return lne.defineProperty(e,t,r)},x4=dt(function(n){n.exports={default:cne,__esModule:!0}});Zt(x4);var fne=dt(function(n,e){e.__esModule=!0;var t=r(x4);function r(i){return i&&i.__esModule?i:{default:i}}e.default=function(){function i(s,o){for(var a=0;a<o.length;a++){var u=o[a];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),(0,t.default)(s,u.key,u)}}return function(s,o,a){return o&&i(s.prototype,o),a&&i(s,a),s}}()}),Rr=Zt(fne);function S4(){throw new Error("setTimeout has not been defined")}function C4(){throw new Error("clearTimeout has not been defined")}var Ba=S4,qa=C4;typeof Vc.setTimeout=="function"&&(Ba=setTimeout);typeof Vc.clearTimeout=="function"&&(qa=clearTimeout);function E4(n){if(Ba===setTimeout)return setTimeout(n,0);if((Ba===S4||!Ba)&&setTimeout)return Ba=setTimeout,setTimeout(n,0);try{return Ba(n,0)}catch{try{return Ba.call(null,n,0)}catch{return Ba.call(this,n,0)}}}function hne(n){if(qa===clearTimeout)return clearTimeout(n);if((qa===C4||!qa)&&clearTimeout)return qa=clearTimeout,clearTimeout(n);try{return qa(n)}catch{try{return qa.call(null,n)}catch{return qa.call(this,n)}}}var sa=[],Rc=!1,il,Em=-1;function dne(){!Rc||!il||(Rc=!1,il.length?sa=il.concat(sa):Em=-1,sa.length&&A4())}function A4(){if(!Rc){var n=E4(dne);Rc=!0;for(var e=sa.length;e;){for(il=sa,sa=[];++Em<e;)il&&il[Em].run();Em=-1,e=sa.length}il=null,Rc=!1,hne(n)}}function Zr(n){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];sa.push(new R4(n,e)),sa.length===1&&!Rc&&E4(A4)}function R4(n,e){this.fun=n,this.array=e}R4.prototype.run=function(){this.fun.apply(null,this.array)};var pne={},Vh=Vc.performance||{};Vh.now||Vh.mozNow||Vh.msNow||Vh.oNow||Vh.webkitNow;var Am={env:pne};function gne(n,e){for(var t=0,r=n.length-1;r>=0;r--){var i=n[r];i==="."?n.splice(r,1):i===".."?(n.splice(r,1),t++):t&&(n.splice(r,1),t--)}if(e)for(;t--;t)n.unshift("..");return n}function mne(n){var e=yne(n),t=bne(n,-1)==="/";return n=gne(D4(n.split("/"),function(r){return!!r}),!e).join("/"),!n&&!e&&(n="."),n&&t&&(n+="/"),(e?"/":"")+n}function yne(n){return n.charAt(0)==="/"}function vne(){var n=Array.prototype.slice.call(arguments,0);return mne(D4(n,function(e,t){if(typeof e!="string")throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))}var Hb={join:vne};function D4(n,e){if(n.filter)return n.filter(e);for(var t=[],r=0;r<n.length;r++)e(n[r],r,n)&&t.push(n[r]);return t}var bne="ab".substr(-1)==="b"?function(n,e,t){return n.substr(e,t)}:function(n,e,t){return e<0&&(e=n.length+e),n.substr(e,t)},wne=dt(function(n,e){(function(t,r){n.exports=r()})(Zd,function(){function t(r,i){return new Proxy({},{getPrototypeOf:function(o){return Reflect.getPrototypeOf(r[i])},setPrototypeOf:function(o,a){return Reflect.setPrototypeOf(r[i],a)},isExtensible:function(o){return Reflect.isExtensible(r[i])},preventExtensions:function(o){return Reflect.preventExtensions(r[i])},getOwnPropertyDescriptor:function(o,a){return Reflect.getOwnPropertyDescriptor(r[i],a)},defineProperty:function(o,a,u){return Reflect.defineProperty(r[i],a,u)},get:function(o,a){var u=Reflect.get(r[i],a);return typeof u=="function"&&(u=u.bind(r[i])),u},set:function(o,a,u){return Reflect.set(r[i],a,u)},has:function(o,a){return Reflect.has(r[i],a)},deleteProperty:function(o,a){return Reflect.delete(r[i],a)},ownKeys:function(o){return Reflect.ownKeys(r[i])},apply:function(o,a,u){return Reflect.apply(r[i],a,u)},construct:function(o,a,u){return Reflect.construct(r[i],a,u)}})}return t})}),Nx=function(n,e){var t=(Lt.Object||{})[n]||Object[n],r={};r[n]=e(t),Ie(Ie.S+Ie.F*ba(function(){t(1)}),"Object",r)},_ne=ss.onFreeze;Nx("freeze",function(n){return function(t){return n&&Ln(t)?n(_ne(t)):t}});var kne=Lt.Object.freeze,xne=dt(function(n){n.exports={default:kne,__esModule:!0}}),Sne=Zt(xne),se=Sne({O_RDONLY:0,O_WRONLY:1,O_RDWR:2,O_ACCMODE:3,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,COPYFILE_EXCL:1,SEEK_SET:0,SEEK_CUR:1,SEEK_END:2,MAP_SHARED:1,MAP_PRIVATE:2}),Rm=function(){function n(e){fr(this,n),this.dev=e.dev||0,this.ino=e.ino,this.mode=e.mode,this.nlink=e.nlink,this.uid=e.uid,this.gid=e.gid,this.rdev=e.rdev||0,this.size=e.size,this.blksize=void 0,this.blocks=void 0,this.atime=e.atime,this.mtime=e.mtime,this.ctime=e.ctime,this.birthtime=e.birthtime}return Rr(n,[{key:"isFile",value:function(){return(this.mode&se.S_IFMT)==se.S_IFREG}},{key:"isDirectory",value:function(){return(this.mode&se.S_IFMT)==se.S_IFDIR}},{key:"isBlockDevice",value:function(){return(this.mode&se.S_IFMT)==se.S_IFBLK}},{key:"isCharacterDevice",value:function(){return(this.mode&se.S_IFMT)==se.S_IFCHR}},{key:"isSymbolicLink",value:function(){return(this.mode&se.S_IFMT)==se.S_IFLNK}},{key:"isFIFO",value:function(){return(this.mode&se.S_IFMT)==se.S_IFIFO}},{key:"isSocket",value:function(){return(this.mode&se.S_IFMT)==se.S_IFSOCK}}]),n}(),Cne=function(){function n(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];fr(this,n),this._iNodeMgr=e,this._iNode=t,this._curPath=r,e.refINode(t)}return Rr(n,[{key:"changeDir",value:function(t,r){this._iNodeMgr.refINode(t),this._iNodeMgr.unrefINode(this._iNode),this._iNode=t,this._curPath=r}},{key:"getINode",value:function(){return this._iNode}},{key:"getPathStack",value:function(){return[].concat(ln(this._curPath))}},{key:"getPath",value:function(){return"/"+this._curPath.join("/")}}]),n}(),eo=0,B2=0,Ene=se.S_IRWXU|se.S_IRGRP|se.S_IXGRP|se.S_IROTH|se.S_IXOTH,Vi=se.S_IRUSR|se.S_IWUSR|se.S_IRGRP|se.S_IWGRP|se.S_IROTH|se.S_IWOTH,q2=se.S_IRWXU|se.S_IRWXG|se.S_IRWXO,T4=se.S_IRWXU|se.S_IRWXG|se.S_IRWXO;function Gh(n,e){return n&~e}function Ane(n,e,t){return n===t.uid?(t.mode&se.S_IRWXU)>>6:e===t.gid?(t.mode&se.S_IRWXG)>>3:t.mode&se.S_IRWXO}function Rne(n,e,t,r){return(n&Ane(e,t,r))===n}var vy=function(n,e,t){for(var r in e)pu(n,r,e[r]);return n},Yd=function(n,e,t,r){if(!(n instanceof e)||r!==void 0&&r in n)throw TypeError(t+": incorrect invocation!");return n},fu=dt(function(n){var e={},t={},r=n.exports=function(i,s,o,a,u){var l=u?function(){return i}:Fx(i),c=Kn(o,a,s?2:1),f=0,d,g,m,y;if(typeof l!="function")throw TypeError(i+" is not iterable!");if(y4(l)){for(d=hy(i.length);d>f;f++)if(y=s?c(Cr(g=i[f])[0],g[1]):c(i[f]),y===e||y===t)return y}else for(m=l.call(i);!(g=m.next()).done;)if(y=m4(m,c,g.value,s),y===e||y===t)return y};r.BREAK=e,r.RETURN=t}),qT=Nn("species"),I4=function(n){var e=typeof Lt[n]=="function"?Lt[n]:Ke[n];Mi&&e&&!e[qT]&&us.f(e,qT,{configurable:!0,get:function(){return this}})},Di=function(n,e){if(!Ln(n)||n._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return n},Dne=us.f,M4=ss.fastKey,Kh=Mi?"_s":"size",sm=function(n,e){var t=M4(e),r;if(t!=="F")return n._i[t];for(r=n._f;r;r=r.n)if(r.k==e)return r},Vb={getConstructor:function(n,e,t,r){var i=n(function(s,o){Yd(s,i,e,"_i"),s._t=e,s._i=cu(null),s._f=void 0,s._l=void 0,s[Kh]=0,o!=null&&fu(o,t,s[r],s)});return vy(i.prototype,{clear:function(){for(var o=Di(this,e),a=o._i,u=o._f;u;u=u.n)u.r=!0,u.p&&(u.p=u.p.n=void 0),delete a[u.i];o._f=o._l=void 0,o[Kh]=0},delete:function(s){var o=Di(this,e),a=sm(o,s);if(a){var u=a.n,l=a.p;delete o._i[a.i],a.r=!0,l&&(l.n=u),u&&(u.p=l),o._f==a&&(o._f=u),o._l==a&&(o._l=l),o[Kh]--}return!!a},forEach:function(o){Di(this,e);for(var a=Kn(o,arguments.length>1?arguments[1]:void 0,3),u;u=u?u.n:this._f;)for(a(u.v,u.k,this);u&&u.r;)u=u.p},has:function(o){return!!sm(Di(this,e),o)}}),Mi&&Dne(i.prototype,"size",{get:function(){return Di(this,e)[Kh]}}),i},def:function(n,e,t){var r=sm(n,e),i,s;return r?r.v=t:(n._l=r={i:s=M4(e,!0),k:e,v:t,p:i=n._l,n:void 0,r:!1},n._f||(n._f=r),i&&(i.n=r),n[Kh]++,s!=="F"&&(n._i[s]=r)),n},getEntry:sm,setStrong:function(n,e,t){Mx(n,e,function(r,i){this._t=Di(r,e),this._k=i,this._l=void 0},function(){for(var r=this,i=r._k,s=r._l;s&&s.r;)s=s.p;return!r._t||!(r._l=s=s?s.n:r._t._f)?(r._t=void 0,Ja(1)):i=="keys"?Ja(0,s.k):i=="values"?Ja(0,s.v):Ja(0,[s.k,s.v])},t?"entries":"values",!t,!0),I4(e)}},Tne=Nn("species"),Ine=function(n){var e;return O2(n)&&(e=n.constructor,typeof e=="function"&&(e===Array||O2(e.prototype))&&(e=void 0),Ln(e)&&(e=e[Tne],e===null&&(e=void 0))),e===void 0?Array:e},Mne=function(n,e){return new(Ine(n))(e)},by=function(n,e){var t=n==1,r=n==2,i=n==3,s=n==4,o=n==6,a=n==5||o,u=Mne;return function(l,c,f){for(var d=af(l),g=Tx(d),m=Kn(c,f,3),y=hy(g.length),b=0,w=t?u(l,y):r?u(l,0):void 0,x,_;y>b;b++)if((a||b in g)&&(x=g[b],_=m(x,b,d),n)){if(t)w[b]=_;else if(_)switch(n){case 3:return!0;case 5:return x;case 6:return b;case 2:w.push(x)}else if(s)return!1}return o?-1:i||s?s:w}},One=us.f,Pne=by(0),O4=function(n,e,t,r,i,s){var o=Ke[n],a=o,u="set",l=a&&a.prototype,c={};return!Mi||typeof a!="function"||!(s||l.forEach&&!ba(function(){new a().entries().next()}))?(a=r.getConstructor(e,n,i,u),vy(a.prototype,t),ss.NEED=!0):(a=e(function(f,d){Yd(f,a,n,"_c"),f._c=new o,d!=null&&fu(d,i,f[u],f)}),Pne("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(f){var d=f=="add"||f=="set";f in l&&!(s&&f=="clear")&&pu(a.prototype,f,function(g,m){if(Yd(this,a,f),!d&&s&&!Ln(g))return f=="get"?void 0:!1;var y=this._c[f](g===0?0:g,m);return d?this:y})}),s||One(a.prototype,"size",{get:function(){return this._c.size}})),Sl(a,n),c[n]=a,Ie(Ie.G+Ie.W+Ie.F,c),s||r.setStrong(a,n,i),a},Gb="Map";O4(Gb,function(n){return function(){return n(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var t=Vb.getEntry(Di(this,Gb),e);return t&&t.v},set:function(e,t){return Vb.def(Di(this,Gb),e===0?0:e,t)}},Vb,!0);var Lne=function(n,e){var t=[];return fu(n,!1,t.push,t,e),t},Fne=function(n){return function(){if(yy(this)!=n)throw TypeError(n+"#toJSON isn't generic");return Lne(this)}};Ie(Ie.P+Ie.R,"Map",{toJSON:Fne("Map")});var P4=function(n){Ie(Ie.S,n,{of:function(){for(var t=arguments.length,r=new Array(t);t--;)r[t]=arguments[t];return new this(r)}})};P4("Map");var L4=function(n){Ie(Ie.S,n,{from:function(t){var r=arguments[1],i,s,o,a;return bl(this),i=r!==void 0,i&&bl(r),t==null?new this:(s=[],i?(o=0,a=Kn(r,arguments[2],2),fu(t,!1,function(u){s.push(a(u,o++))})):fu(t,!1,s.push,s),new this(s))}})};L4("Map");var Nne=Lt.Map,Bne=dt(function(n){n.exports={default:Nne,__esModule:!0}}),Jd=Zt(Bne);Nx("getPrototypeOf",function(){return function(e){return t4(af(e))}});var qne=Lt.Object.getPrototypeOf,F4=dt(function(n){n.exports={default:qne,__esModule:!0}}),Vt=Zt(F4),Wne=dt(function(n,e){e.__esModule=!0;var t=r(Lx);function r(i){return i&&i.__esModule?i:{default:i}}e.default=function(i,s){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s&&((typeof s>"u"?"undefined":(0,t.default)(s))==="object"||typeof s=="function")?s:i}}),wa=Zt(Wne),jne=function(n,e){if(Cr(n),!Ln(e)&&e!==null)throw TypeError(e+": can't set as prototype!")},$ne={set:Object.setPrototypeOf||("__proto__"in{}?function(n,e,t){try{t=Kn(Function.call,gy.f(Object.prototype,"__proto__").set,2),t(n,[]),e=!(n instanceof Array)}catch{e=!0}return function(i,s){return jne(i,s),e?i.__proto__=s:t(i,s),i}}({},!1):void 0)};Ie(Ie.S,"Object",{setPrototypeOf:$ne.set});var zne=Lt.Object.setPrototypeOf,N4=dt(function(n){n.exports={default:zne,__esModule:!0}});Zt(N4);Ie(Ie.S,"Object",{create:cu});var Une=Lt.Object,Hne=function(e,t){return Une.create(e,t)},B4=dt(function(n){n.exports={default:Hne,__esModule:!0}});Zt(B4);var Vne=dt(function(n,e){e.__esModule=!0;var t=s(N4),r=s(B4),i=s(Lx);function s(o){return o&&o.__esModule?o:{default:o}}e.default=function(o,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function, not "+(typeof a>"u"?"undefined":(0,i.default)(a)));o.prototype=(0,r.default)(a&&a.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),a&&(t.default?(0,t.default)(o,a):o.__proto__=a)}}),_a=Zt(Vne),Gne=dt(function(n,e){(function(t,r){r(e)})(Zd,function(t){function r(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}function i(D,O){return O={exports:{}},D(O,O.exports),O.exports}var s=function(D,O){return{value:O,done:!!D}},o={},a={}.toString,u=function(D){return a.call(D).slice(8,-1)},l=Object("z").propertyIsEnumerable(0)?Object:function(D){return u(D)=="String"?D.split(""):Object(D)},c=function(D){if(D==null)throw TypeError("Can't call method on "+D);return D},f=function(D){return l(c(D))},d=i(function(D){var O=D.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=O)}),g=i(function(D){var O=D.exports={version:"2.4.0"};typeof __e=="number"&&(__e=O)});g.version;var m=function(D){if(typeof D!="function")throw TypeError(D+" is not a function!");return D},y=function(D,O,H){if(m(D),O===void 0)return D;switch(H){case 1:return function(X){return D.call(O,X)};case 2:return function(X,Q){return D.call(O,X,Q)};case 3:return function(X,Q,J){return D.call(O,X,Q,J)}}return function(){return D.apply(O,arguments)}},b=function(D){return typeof D=="object"?D!==null:typeof D=="function"},w=function(D){if(!b(D))throw TypeError(D+" is not an object!");return D},x=function(D){try{return!!D()}catch{return!0}},_=!x(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}),S=d.document,C=b(S)&&b(S.createElement),A=function(D){return C?S.createElement(D):{}},I=!_&&!x(function(){return Object.defineProperty(A("div"),"a",{get:function(){return 7}}).a!=7}),W=function(D,O){if(!b(D))return D;var H,X;if(typeof(H=D.toString)=="function"&&!b(X=H.call(D))||typeof(H=D.valueOf)=="function"&&!b(X=H.call(D)))return X;throw TypeError("Can't convert object to primitive value")},B=Object.defineProperty,K=_?Object.defineProperty:function(O,H,X){if(w(O),H=W(H),w(X),I)try{return B(O,H,X)}catch{}if("get"in X||"set"in X)throw TypeError("Accessors not supported!");return"value"in X&&(O[H]=X.value),O},G={f:K},F=function(D,O){return{enumerable:!(D&1),configurable:!(D&2),writable:!(D&4),value:O}},R=_?function(D,O,H){return G.f(D,O,F(1,H))}:function(D,O,H){return D[O]=H,D},Y="prototype",q=function(D,O,H){var X=D&q.F,Q=D&q.G,J=D&q.S,T=D&q.P,j=D&q.B,V=D&q.W,ue=Q?g:g[O]||(g[O]={}),_e=ue[Y],$=Q?d:J?d[O]:(d[O]||{})[Y],ee,re,ce;Q&&(H=O);for(ee in H)re=!X&&$&&$[ee]!==void 0,!(re&&ee in ue)&&(ce=re?$[ee]:H[ee],ue[ee]=Q&&typeof $[ee]!="function"?H[ee]:j&&re?y(ce,d):V&&$[ee]==ce?function(Ee){var Oe=function(He,Ge,We){if(this instanceof Ee){switch(arguments.length){case 0:return new Ee;case 1:return new Ee(He);case 2:return new Ee(He,Ge)}return new Ee(He,Ge,We)}return Ee.apply(this,arguments)};return Oe[Y]=Ee[Y],Oe}(ce):T&&typeof ce=="function"?y(Function.call,ce):ce,T&&((ue.virtual||(ue.virtual={}))[ee]=ce,D&q.R&&_e&&!_e[ee]&&R(_e,ee,ce)))};q.F=1,q.G=2,q.S=4,q.P=8,q.B=16,q.W=32,q.U=64,q.R=128;var te=q,ae=R,be={}.hasOwnProperty,ye=function(D,O){return be.call(D,O)},De=Math.ceil,we=Math.floor,Pe=function(D){return isNaN(D=+D)?0:(D>0?we:De)(D)},Rt=Math.min,kt=function(D){return D>0?Rt(Pe(D),9007199254740991):0},rt=Math.max,Xt=Math.min,Bn=function(D,O){return D=Pe(D),D<0?rt(D+O,0):Xt(D,O)},rn=function(D){return function(O,H,X){for(var Q=f(O),J=kt(Q.length),T=Bn(X,J);J>T;T++)if(T in Q&&Q[T]===H)return T||0;return-1}},yn="__core-js_shared__",Pt=d[yn]||(d[yn]={}),Se=function(D){return Pt[D]||(Pt[D]={})},Ye=0,In=Math.random(),Le=function(D){return"Symbol(".concat(D===void 0?"":D,")_",(++Ye+In).toString(36))},$t=Se("keys"),Cn=function(D){return $t[D]||($t[D]=Le(D))},Yt=rn(),at=Cn("IE_PROTO"),qn=function(D,O){var H=f(D),X=0,Q=[],J;for(J in H)J!=at&&ye(H,J)&&Q.push(J);for(;O.length>X;)ye(H,J=O[X++])&&(~Yt(Q,J)||Q.push(J));return Q},Dt="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),ct=Object.keys||function(O){return qn(O,Dt)},hr=_?Object.defineProperties:function(O,H){w(O);for(var X=ct(H),Q=X.length,J=0,T;Q>J;)G.f(O,T=X[J++],H[T]);return O},ls=d.document&&document.documentElement,ka=Cn("IE_PROTO"),Xr=function(){},Fs="prototype",dr=function(){var D=A("iframe"),O=Dt.length,H="<",X=">",Q;for(D.style.display="none",ls.appendChild(D),D.src="javascript:",Q=D.contentWindow.document,Q.open(),Q.write(H+"script"+X+"document.F=Object"+H+"/script"+X),Q.close(),dr=Q.F;O--;)delete dr[Fs][Dt[O]];return dr()},En=Object.create||function(O,H){var X;return O!==null?(Xr[Fs]=w(O),X=new Xr,Xr[Fs]=null,X[ka]=O):X=dr(),H===void 0?X:hr(X,H)},Tt=i(function(D){var O=Se("wks"),H=d.Symbol,X=typeof H=="function",Q=D.exports=function(J){return O[J]||(O[J]=X&&H[J]||(X?H:Le)("Symbol."+J))};Q.store=O}),cs=G.f,fs=Tt("toStringTag"),Tr=function(D,O,H){D&&!ye(D=H?D:D.prototype,fs)&&cs(D,fs,{configurable:!0,value:O})},Oi={};R(Oi,Tt("iterator"),function(){return this});var hs=function(D,O,H){D.prototype=En(Oi,{next:F(1,H)}),Tr(D,O+" Iterator")},mi=function(D){return Object(c(D))},ds=Cn("IE_PROTO"),Ns=Object.prototype,Do=Object.getPrototypeOf||function(D){return D=mi(D),ye(D,ds)?D[ds]:typeof D.constructor=="function"&&D instanceof D.constructor?D.constructor.prototype:D instanceof Object?Ns:null},xa=Tt("iterator"),To=!([].keys&&"next"in[].keys()),pr="@@iterator",Bs="keys",ps="values",gs=function(){return this},Io=function(D,O,H,X,Q,J,T){hs(H,O,X);var j=function(Ge){if(!To&&Ge in $)return $[Ge];switch(Ge){case Bs:return function(){return new H(this,Ge)};case ps:return function(){return new H(this,Ge)}}return function(){return new H(this,Ge)}},V=O+" Iterator",ue=Q==ps,_e=!1,$=D.prototype,ee=$[xa]||$[pr]||Q&&$[Q],re=ee||j(Q),ce=Q?ue?j("entries"):re:void 0,Ee=O=="Array"&&$.entries||ee,Oe,He;return Ee&&(He=Do(Ee.call(new D)),He!==Object.prototype&&Tr(He,V,!0)),ue&&ee&&ee.name!==ps&&(_e=!0,re=function(){return ee.call(this)}),o[O]=re,o[V]=gs,Q&&(Oe={values:ue?re:j(ps),keys:j(Bs),entries:ce},te(te.P+te.F*(To||_e),O,Oe)),Oe};Io(Array,"Array",function(D,O){this._t=f(D),this._i=0,this._k=O},function(){var D=this._t,O=this._k,H=this._i++;return!D||H>=D.length?(this._t=void 0,s(1)):O=="keys"?s(0,H):O=="values"?s(0,D[H]):s(0,[H,D[H]])},"values"),o.Arguments=o.Array;for(var ms=Tt("toStringTag"),Mo=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],Ir=0;Ir<5;Ir++){var Yr=Mo[Ir],Oo=d[Yr],Pi=Oo&&Oo.prototype;Pi&&!Pi[ms]&&R(Pi,ms,Yr),o[Yr]=o.Array}var Li=function(D){return function(O,H){var X=String(c(O)),Q=Pe(H),J=X.length,T,j;return Q<0||Q>=J?"":(T=X.charCodeAt(Q),T<55296||T>56319||Q+1===J||(j=X.charCodeAt(Q+1))<56320||j>57343?X.charAt(Q):X.slice(Q,Q+2))}},ys=Li();Io(String,"String",function(D){this._t=String(D),this._i=0},function(){var D=this._t,O=this._i,H;return O>=D.length?{value:void 0,done:!0}:(H=ys(D,O),this._i+=H.length,{value:H,done:!1})});var L=Tt("toStringTag"),Jt=u(function(){return arguments}())=="Arguments",Qt=function(D,O){try{return D[O]}catch{}},qe=function(D){var O,H,X;return D===void 0?"Undefined":D===null?"Null":typeof(H=Qt(O=Object(D),L))=="string"?H:Jt?u(O):(X=u(O))=="Object"&&typeof O.callee=="function"?"Arguments":X},z=Tt("iterator"),de=g.isIterable=function(D){var O=Object(D);return O[z]!==void 0||"@@iterator"in O||o.hasOwnProperty(qe(O))},ke=de,Me=i(function(D){D.exports={default:ke,__esModule:!0}});r(Me);var xt=Tt("iterator"),_t=g.getIteratorMethod=function(D){if(D!=null)return D[xt]||D["@@iterator"]||o[qe(D)]},zt=g.getIterator=function(D){var O=_t(D);if(typeof O!="function")throw TypeError(D+" is not iterable!");return w(O.call(D))},en=zt,it=i(function(D){D.exports={default:en,__esModule:!0}});r(it);var Nt=i(function(D,O){O.__esModule=!0;var H=Q(Me),X=Q(it);function Q(J){return J&&J.__esModule?J:{default:J}}O.default=function(){function J(T,j){var V=[],ue=!0,_e=!1,$=void 0;try{for(var ee=(0,X.default)(T),re;!(ue=(re=ee.next()).done)&&(V.push(re.value),!(j&&V.length===j));ue=!0);}catch(ce){_e=!0,$=ce}finally{try{!ue&&ee.return&&ee.return()}finally{if(_e)throw $}}return V}return function(T,j){if(Array.isArray(T))return T;if((0,H.default)(Object(T)))return J(T,j);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()}),st=r(Nt),Ut=i(function(D,O){O.__esModule=!0,O.default=function(H,X){if(!(H instanceof X))throw new TypeError("Cannot call a class as a function")}}),on=r(Ut);te(te.S+te.F*!_,"Object",{defineProperty:G.f});var Xn=g.Object,hf=function(O,H,X){return Xn.defineProperty(O,H,X)},Dp=i(function(D){D.exports={default:hf,__esModule:!0}});r(Dp);var Cy=i(function(D,O){O.__esModule=!0;var H=X(Dp);function X(Q){return Q&&Q.__esModule?Q:{default:Q}}O.default=function(){function Q(J,T){for(var j=0;j<T.length;j++){var V=T[j];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),(0,H.default)(J,V.key,V)}}return function(J,T,j){return T&&Q(J.prototype,T),j&&Q(J,j),J}}()}),mu=r(Cy);function Al(D,O,H){var X=void 0,Q=void 0;return D.allocate(O,function(J){var T=J.counter,j=J.changed,V=J.tree;O=T,X=j,Q=V},H),[O,X,Q]}function Rl(D,O,H){var X=void 0,Q=void 0;return D.deallocate(O,function(J){var T=J.changed,j=J.tree;X=T,Q=j},H),[X,Q]}function df(D,O){var H=void 0;return D.check(O,function(X){H=X}),!!H}var Tp=function(D,O){var H=(g.Object||{})[D]||Object[D],X={};X[D]=O(H),te(te.S+te.F*x(function(){H(1)}),"Object",X)};Tp("keys",function(){return function(O){return ct(mi(O))}});var Ey=g.Object.keys,Ay=i(function(D){D.exports={default:Ey,__esModule:!0}}),Ip=r(Ay);Tp("getPrototypeOf",function(){return function(O){return Do(mi(O))}});var Mp=g.Object.getPrototypeOf,Op=i(function(D){D.exports={default:Mp,__esModule:!0}}),Dl=r(Op),Ry=Tt,Tl={f:Ry},Il=Tl.f("iterator"),pf=i(function(D){D.exports={default:Il,__esModule:!0}});r(pf);var qs=i(function(D){var O=Le("meta"),H=G.f,X=0,Q=Object.isExtensible||function(){return!0},J=!x(function(){return Q(Object.preventExtensions({}))}),T=function($){H($,O,{value:{i:"O"+ ++X,w:{}}})},j=function($,ee){if(!b($))return typeof $=="symbol"?$:(typeof $=="string"?"S":"P")+$;if(!ye($,O)){if(!Q($))return"F";if(!ee)return"E";T($)}return $[O].i},V=function($,ee){if(!ye($,O)){if(!Q($))return!0;if(!ee)return!1;T($)}return $[O].w},ue=function($){return J&&_e.NEED&&Q($)&&!ye($,O)&&T($),$},_e=D.exports={KEY:O,NEED:!1,fastKey:j,getWeak:V,onFreeze:ue}});qs.KEY,qs.NEED,qs.fastKey,qs.getWeak,qs.onFreeze;var Pp=G.f,Ml=function(D){var O=g.Symbol||(g.Symbol={});D.charAt(0)!="_"&&!(D in O)&&Pp(O,D,{value:Tl.f(D)})},gf=function(D,O){for(var H=f(D),X=ct(H),Q=X.length,J=0,T;Q>J;)if(H[T=X[J++]]===O)return T},Dy=Object.getOwnPropertySymbols,mf={f:Dy},yf={}.propertyIsEnumerable,yu={f:yf},Sa=function(D){var O=ct(D),H=mf.f;if(H)for(var X=H(D),Q=yu.f,J=0,T;X.length>J;)Q.call(D,T=X[J++])&&O.push(T);return O},Ol=Array.isArray||function(O){return u(O)=="Array"},Lp=Dt.concat("length","prototype"),Ty=Object.getOwnPropertyNames||function(O){return qn(O,Lp)},vf={f:Ty},bf=vf.f,Fp={}.toString,wf=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Iy=function(D){try{return bf(D)}catch{return wf.slice()}},My=function(O){return wf&&Fp.call(O)=="[object Window]"?Iy(O):bf(f(O))},Np={f:My},_f=Object.getOwnPropertyDescriptor,Oy=_?_f:function(O,H){if(O=f(O),H=W(H),I)try{return _f(O,H)}catch{}if(ye(O,H))return F(!yu.f.call(O,H),O[H])},kf={f:Oy},Py=qs.KEY,Bp=kf.f,vs=G.f,qp=Np.f,gr=d.Symbol,Pl=d.JSON,Ll=Pl&&Pl.stringify,Ws="prototype",Qe=Tt("_hidden"),It=Tt("toPrimitive"),Ly={}.propertyIsEnumerable,Fl=Se("symbol-registry"),bs=Se("symbols"),vu=Se("op-symbols"),yi=Object[Ws],Ca=typeof gr=="function",Nl=d.QObject,xf=!Nl||!Nl[Ws]||!Nl[Ws].findChild,vn=_&&x(function(){return En(vs({},"a",{get:function(){return vs(this,"a",{value:7}).a}})).a!=7})?function(D,O,H){var X=Bp(yi,O);X&&delete yi[O],vs(D,O,H),X&&D!==yi&&vs(yi,O,X)}:vs,Bl=function(D){var O=bs[D]=En(gr[Ws]);return O._k=D,O},ws=Ca&&typeof gr.iterator=="symbol"?function(D){return typeof D=="symbol"}:function(D){return D instanceof gr},bu=function(O,H,X){return O===yi&&bu(vu,H,X),w(O),H=W(H),w(X),ye(bs,H)?(X.enumerable?(ye(O,Qe)&&O[Qe][H]&&(O[Qe][H]=!1),X=En(X,{enumerable:F(0,!1)})):(ye(O,Qe)||vs(O,Qe,F(1,{})),O[Qe][H]=!0),vn(O,H,X)):vs(O,H,X)},ql=function(O,H){w(O);for(var X=Sa(H=f(H)),Q=0,J=X.length,T;J>Q;)bu(O,T=X[Q++],H[T]);return O},Jr=function(O,H){return H===void 0?En(O):ql(En(O),H)},Wp=function(O){var H=Ly.call(this,O=W(O));return this===yi&&ye(bs,O)&&!ye(vu,O)?!1:H||!ye(this,O)||!ye(bs,O)||ye(this,Qe)&&this[Qe][O]?H:!0},Sf=function(O,H){if(O=f(O),H=W(H),!(O===yi&&ye(bs,H)&&!ye(vu,H))){var X=Bp(O,H);return X&&ye(bs,H)&&!(ye(O,Qe)&&O[Qe][H])&&(X.enumerable=!0),X}},Cf=function(O){for(var H=qp(f(O)),X=[],Q=0,J;H.length>Q;)!ye(bs,J=H[Q++])&&J!=Qe&&J!=Py&&X.push(J);return X},Ef=function(O){for(var H=O===yi,X=qp(H?vu:f(O)),Q=[],J=0,T;X.length>J;)ye(bs,T=X[J++])&&(!H||ye(yi,T))&&Q.push(bs[T]);return Q};Ca||(gr=function(){if(this instanceof gr)throw TypeError("Symbol is not a constructor!");var O=Le(arguments.length>0?arguments[0]:void 0),H=function(X){this===yi&&H.call(vu,X),ye(this,Qe)&&ye(this[Qe],O)&&(this[Qe][O]=!1),vn(this,O,F(1,X))};return _&&xf&&vn(yi,O,{configurable:!0,set:H}),Bl(O)},ae(gr[Ws],"toString",function(){return this._k}),kf.f=Sf,G.f=bu,vf.f=Np.f=Cf,yu.f=Wp,mf.f=Ef,Tl.f=function(D){return Bl(Tt(D))}),te(te.G+te.W+te.F*!Ca,{Symbol:gr});for(var Ea="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),Aa=0;Ea.length>Aa;)Tt(Ea[Aa++]);for(var Ea=ct(Tt.store),Aa=0;Ea.length>Aa;)Ml(Ea[Aa++]);te(te.S+te.F*!Ca,"Symbol",{for:function(D){return ye(Fl,D+="")?Fl[D]:Fl[D]=gr(D)},keyFor:function(O){if(ws(O))return gf(Fl,O);throw TypeError(O+" is not a symbol!")},useSetter:function(){xf=!0},useSimple:function(){xf=!1}}),te(te.S+te.F*!Ca,"Object",{create:Jr,defineProperty:bu,defineProperties:ql,getOwnPropertyDescriptor:Sf,getOwnPropertyNames:Cf,getOwnPropertySymbols:Ef}),Pl&&te(te.S+te.F*(!Ca||x(function(){var D=gr();return Ll([D])!="[null]"||Ll({a:D})!="{}"||Ll(Object(D))!="{}"})),"JSON",{stringify:function(O){if(!(O===void 0||ws(O))){for(var H=[O],X=1,Q,J;arguments.length>X;)H.push(arguments[X++]);return Q=H[1],typeof Q=="function"&&(J=Q),(J||!Ol(Q))&&(Q=function(T,j){if(J&&(j=J.call(this,T,j)),!ws(j))return j}),H[1]=Q,Ll.apply(Pl,H)}}}),gr[Ws][It]||R(gr[Ws],It,gr[Ws].valueOf),Tr(gr,"Symbol"),Tr(Math,"Math",!0),Tr(d.JSON,"JSON",!0),Ml("asyncIterator"),Ml("observable");var Mr=g.Symbol,jp=i(function(D){D.exports={default:Mr,__esModule:!0}});r(jp);var mr=i(function(D,O){O.__esModule=!0;var H=J(pf),X=J(jp),Q=typeof X.default=="function"&&typeof H.default=="symbol"?function(T){return typeof T}:function(T){return T&&typeof X.default=="function"&&T.constructor===X.default&&T!==X.default.prototype?"symbol":typeof T};function J(T){return T&&T.__esModule?T:{default:T}}O.default=typeof X.default=="function"&&Q(H.default)==="symbol"?function(T){return typeof T>"u"?"undefined":Q(T)}:function(T){return T&&typeof X.default=="function"&&T.constructor===X.default&&T!==X.default.prototype?"symbol":typeof T>"u"?"undefined":Q(T)}});r(mr);var Fy=i(function(D,O){O.__esModule=!0;var H=X(mr);function X(Q){return Q&&Q.__esModule?Q:{default:Q}}O.default=function(Q,J){if(!Q)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return J&&((typeof J>"u"?"undefined":(0,H.default)(J))==="object"||typeof J=="function")?J:Q}}),Af=r(Fy),js=function(D,O){if(w(D),!b(O)&&O!==null)throw TypeError(O+": can't set as prototype!")},Wl={set:Object.setPrototypeOf||("__proto__"in{}?function(D,O,H){try{H=y(Function.call,kf.f(Object.prototype,"__proto__").set,2),H(D,[]),O=!(D instanceof Array)}catch{O=!0}return function(Q,J){return js(Q,J),O?Q.__proto__=J:H(Q,J),Q}}({},!1):void 0)};te(te.S,"Object",{setPrototypeOf:Wl.set});var Rf=g.Object.setPrototypeOf,Bt=i(function(D){D.exports={default:Rf,__esModule:!0}});r(Bt),te(te.S,"Object",{create:En});var $s=g.Object,Df=function(O,H){return $s.create(O,H)},$p=i(function(D){D.exports={default:Df,__esModule:!0}});r($p);var Tf=i(function(D,O){O.__esModule=!0;var H=J(Bt),X=J($p),Q=J(mr);function J(T){return T&&T.__esModule?T:{default:T}}O.default=function(T,j){if(typeof j!="function"&&j!==null)throw new TypeError("Super expression must either be null or a function, not "+(typeof j>"u"?"undefined":(0,Q.default)(j)));T.prototype=(0,X.default)(j&&j.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),j&&(H.default?(0,H.default)(T,j):T.__proto__=j)}}),zp=r(Tf),Ny=i(function(D,O){/**
|
|
194
|
-
* @license BitSet.js v5.0.3 4/3/2018
|
|
195
|
-
* http://www.xarg.org/2014/03/javascript-bit-array/
|
|
196
|
-
*
|
|
197
|
-
* Copyright (c) 2016, Robert Eisele (robert@xarg.org)
|
|
198
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
199
|
-
**/(function(H){var X=32,Q=5;function J($){return $-=$>>>1&1431655765,$=($&858993459)+($>>>2&858993459),($+($>>>4)&252645135)*16843009>>>24}function T($,ee){for(var re=0,ce=0;ce<$.length;ce++){re*=2;var Ee=($[ce]+re)/ee|0;re=($[ce]+re)%ee,$[ce]=Ee}return re}function j($,ee){if(ee==null){$.data=[0,0,0,0,0,0,0,0,0,0],$._=0;return}if(ee instanceof V){$.data=ee.data,$._=ee._;return}switch(typeof ee){case"number":$.data=[ee|0],$._=0;break;case"string":var re=2,ce=X;ee.indexOf("0b")===0?ee=ee.substr(2):ee.indexOf("0x")===0&&(ee=ee.substr(2),re=16,ce=8),$.data=[],$._=0;var Ee=ee.length-ce,Oe=ee.length;do{var He=parseInt(ee.slice(Ee>0?Ee:0,Oe),re);if(isNaN(He))throw SyntaxError("Invalid param");if($.data.push(He|0),Ee<=0)break;Ee-=ce,Oe-=ce}while(!0);break;default:$.data=[0];var Ge=$.data;if(ee instanceof Array){for(var We=ee.length-1;We>=0;We--){var Ht=ee[We];Ht===1/0?$._=-1:(ue($,Ht),Ge[Ht>>>Q]|=1<<Ht)}break}if(Uint8Array&&ee instanceof Uint8Array){var bn=8;ue($,ee.length*bn);for(var We=0;We<ee.length;We++)for(var ft=ee[We],Lo=0;Lo<bn;Lo++){var Bf=We*bn+Lo;Ge[Bf>>>Q]|=(ft>>Lo&1)<<Bf}break}throw SyntaxError("Invalid param")}}function V($){if(!(this instanceof V))return new V($);j(this,$),this.data=this.data.slice()}function ue($,ee){for(var re=ee>>>Q,ce=$.data,Ee=$._,Oe=ce.length;re>=Oe;re--)ce.push(Ee)}var _e={data:[],_:0};V.prototype={data:[],_:0,set:function($,ee){return $|=0,ue(this,$),ee===void 0||ee?this.data[$>>>Q]|=1<<$:this.data[$>>>Q]&=~(1<<$),this},get:function($){$|=0;var ee=this.data,re=$>>>Q;return re>ee.length?this._&1:ee[re]>>>$&1},not:function(){for(var $=this.clone(),ee=$.data,re=0;re<ee.length;re++)ee[re]=~ee[re];return $._=~$._,$},and:function($){j(_e,$);var ee=this.clone(),re=ee.data,ce=_e.data,Ee=ce.length,Oe=_e._,He=ee._;He!==0&&ue(ee,Ee*X-1);for(var Ge=re.length,We=Math.min(Ee,Ge),Ht=0;Ht<We;Ht++)re[Ht]&=ce[Ht];for(;Ht<Ge;Ht++)re[Ht]&=Oe;return ee._&=Oe,ee},or:function($){j(_e,$);for(var ee=this.clone(),re=ee.data,ce=_e.data,Ee=ce.length-1,Oe=re.length-1,He=Math.min(Oe,Ee),Ge=Ee;Ge>He;Ge--)re[Ge]=ce[Ge];for(;Ge>=0;Ge--)re[Ge]|=ce[Ge];return ee._|=_e._,ee},xor:function($){j(_e,$);var ee=this.clone(),re=ee.data,ce=_e.data,Ee=ee._,Oe=_e._,He=0,Ge=re.length-1,We=ce.length-1;for(He=Ge;He>We;He--)re[He]^=Oe;for(He=We;He>Ge;He--)re[He]=Ee^ce[He];for(;He>=0;He--)re[He]^=ce[He];return ee._^=Oe,ee},andNot:function($){return this.and(new V($).flip())},flip:function($,ee){if($===void 0){for(var re=this.data,ce=0;ce<re.length;ce++)re[ce]=~re[ce];this._=~this._}else if(ee===void 0)ue(this,$),this.data[$>>>Q]^=1<<$;else if(0<=$&&$<=ee){ue(this,ee);for(var ce=$;ce<=ee;ce++)this.data[ce>>>Q]^=1<<ce}return this},clear:function($,ee){var re=this.data;if($===void 0){for(var ce=re.length-1;ce>=0;ce--)re[ce]=0;this._=0}else if(ee===void 0)$|=0,ue(this,$),re[$>>>Q]&=~(1<<$);else if($<=ee){ue(this,ee);for(var ce=$;ce<=ee;ce++)re[ce>>>Q]&=~(1<<ce)}return this},slice:function($,ee){if($===void 0)return this.clone();if(ee===void 0){ee=this.data.length*X;var re=Object.create(V.prototype);re._=this._,re.data=[0];for(var ce=$;ce<=ee;ce++)re.set(ce-$,this.get(ce));return re}else if($<=ee&&0<=$){var re=Object.create(V.prototype);re.data=[0];for(var ce=$;ce<=ee;ce++)re.set(ce-$,this.get(ce));return re}return null},setRange:function($,ee,re){for(var ce=$;ce<=ee;ce++)this.set(ce,re);return this},clone:function(){var $=Object.create(V.prototype);return $.data=this.data.slice(),$._=this._,$},toArray:Math.clz32?function(){for(var $=[],ee=this.data,re=ee.length-1;re>=0;re--)for(var ce=ee[re];ce!==0;){var Ee=31-Math.clz32(ce);ce^=1<<Ee,$.unshift(re*X+Ee)}return this._!==0&&$.push(1/0),$}:function(){for(var $=[],ee=this.data,re=0;re<ee.length;re++)for(var ce=ee[re];ce!==0;){var Ee=ce&-ce;ce^=Ee,$.push(re*X+J(Ee-1))}return this._!==0&&$.push(1/0),$},toString:function($){var ee=this.data;if($||($=2),($&$-1)===0&&$<36){for(var re="",ce=2+Math.log(4294967295)/Math.log($)|0,Ee=ee.length-1;Ee>=0;Ee--){var Oe=ee[Ee];Oe<0&&(Oe+=4294967296);var He=Oe.toString($);re!==""&&(re+="0".repeat(ce-He.length-1)),re+=He}return this._===0?(re=re.replace(/^0+/,""),re===""&&(re="0"),re):(re="1111"+re,re.replace(/^1+/,"...1111"))}else{if(2>$||$>36)throw SyntaxError("Invalid base");for(var re=[],Ge=[],Ee=ee.length;Ee--;)for(var We=X;We--;)Ge.push(ee[Ee]>>>We&1);do re.unshift(T(Ge,$).toString($));while(!Ge.every(function(bn){return bn===0}));return re.join("")}},isEmpty:function(){if(this._!==0)return!1;for(var $=this.data,ee=$.length-1;ee>=0;ee--)if($[ee]!==0)return!1;return!0},cardinality:function(){if(this._!==0)return 1/0;for(var $=0,ee=this.data,re=0;re<ee.length;re++){var ce=ee[re];ce!==0&&($+=J(ce))}return $},msb:Math.clz32?function(){if(this._!==0)return 1/0;for(var $=this.data,ee=$.length;ee-- >0;){var re=Math.clz32($[ee]);if(re!==X)return ee*X+X-1-re}return 1/0}:function(){if(this._!==0)return 1/0;for(var $=this.data,ee=$.length;ee-- >0;){var re=$[ee],ce=0;if(re){for(;(re>>>=1)>0;ce++);return ee*X+ce}}return 1/0},ntz:function(){for(var $=this.data,ee=0;ee<$.length;ee++){var re=$[ee];if(re!==0)return re=(re^re-1)>>>1,ee*X+J(re)}return 1/0},lsb:function(){for(var $=this.data,ee=0;ee<$.length;ee++){var re=$[ee],ce=0;if(re){for(var Ee=re&-re;Ee>>>=1;ce++);return X*ee+ce}}return this._&1},equals:function($){j(_e,$);var ee=this.data,re=_e.data,ce=this._,Ee=_e._,Oe=ee.length-1,He=re.length-1;if(Ee!==ce)return!1;for(var Ge=Oe<He?Oe:He,We=0;We<=Ge;We++)if(ee[We]!==re[We])return!1;for(We=Oe;We>He;We--)if(ee[We]!==Ee)return!1;for(We=He;We>Oe;We--)if(re[We]!==ce)return!1;return!0}},V.fromBinaryString=function($){return new V("0b"+$)},V.fromHexString=function($){return new V("0x"+$)},V.Random=function($){($===void 0||$<0)&&($=X);for(var ee=$%X,re=[],ce=Math.ceil($/X),Ee=Object.create(V.prototype),Oe=0;Oe<ce;Oe++)re.push(Math.random()*4294967296|0);return ee>0&&(re[ce-1]&=(1<<ee)-1),Ee.data=re,Ee._=0,Ee},Object.defineProperty(O,"__esModule",{value:!0}),V.default=V,V.BitSet=V,D.exports=V})()}),By=r(Ny);function Up(D){return new By(new Uint8Array(D/8-1)).flip(0,D-1)}function vi(D,O){return D.set(O,0)}function Fi(D,O){return D.set(O,1)}function Po(D){return D.isEmpty()}function Hp(D,O){return D.cardinality()===O}function If(D){var O=D.ntz();return O===1/0&&(O=null),O}function wu(D,O){return!D.get(O)}var jl=function D(O,H,X,Q,J){on(this,D),this.blockSize=O,this.shrink=H,this.begin=X,this.depth=Q,this.bitMap=J||Up(O)},_u=function(D){zp(O,D);function O(H,X,Q,J){return on(this,O),Af(this,(O.__proto__||Dl(O)).call(this,H,X,Q,0,J))}return mu(O,[{key:"allocate",value:function(X,Q,J){var T=void 0;if(X==null?T=If(this.bitMap):T=X-this.begin,T!==null&&T<this.blockSize)if(wu(this.bitMap,T))Q({counter:this.begin+T,changed:!1,bitMap:this.bitMap,tree:this});else{var j=void 0,V=void 0;!J||J.has(this)?(j=this.bitMap,vi(j,T),V=this):(j=this.bitMap.clone(),vi(j,T),V=new O(this.blockSize,this.shrink,this.begin,j),J.add(V)),Q({counter:this.begin+T,changed:!0,bitMap:j,tree:V})}else{var ue=new qy(this.blockSize,this.shrink,this.begin,this.depth+1);J&&(J.add(ue),J.add(ue.bitMap)),ue.bitMapTrees[0]=this,Po(this.bitMap)&&vi(ue.bitMap,0),ue.allocate(X,Q,J)}}},{key:"deallocate",value:function(X,Q,J){var T=X-this.begin;if(T>=0&&T<this.blockSize)if(wu(this.bitMap,T)){var j=void 0,V=void 0;!J||J.has(this)?(j=this.bitMap,Fi(j,T),V=this):(j=this.bitMap.clone(),Fi(j,T),V=new O(this.blockSize,this.shrink,this.begin,j),J.add(V)),Q({exists:!0,changed:!0,bitMap:j,tree:V})}else Q({exists:!0,changed:!1,bitMap:this.bitMap,tree:this});else Q({exists:!1,changed:!1,bitMap:this.bitMap,tree:this})}},{key:"check",value:function(X,Q){var J=X-this.begin;J>=0&&J<this.blockSize?wu(this.bitMap,J)?Q(!0):Q(!1):Q(null)}}]),O}(jl),qy=function(D){zp(O,D);function O(H,X,Q,J,T,j){on(this,O);var V=Af(this,(O.__proto__||Dl(O)).call(this,H,X,Q,J,T));return V.bitMapTrees=j||[],V}return mu(O,[{key:"allocate",value:function(X,Q,J){var T=this,j=void 0;if(X==null?j=If(this.bitMap):j=Math.floor((X-this.begin)/Math.pow(this.blockSize,this.depth)),j!=null&&this.bitMapTrees[j]){var V=j;this.bitMapTrees[j].allocate(X,function(Oe){var He=Oe.counter,Ge=Oe.changed,We=Oe.bitMap,Ht=Oe.tree,bn=T.bitMap,ft=T;if(Ge){if(!J&&Po(We))vi(bn,V);else if(J&&J.has(T))Po(We)&&(J.has(T.bitMap)||(bn=T.bitMap.clone(),J.add(bn),T.bitMap=bn),vi(bn,V)),ft.bitMapTrees[V]=Ht;else if(J){Po(We)&&(bn=T.bitMap.clone(),J.add(bn),vi(bn,V));var Lo=T.bitMapTrees.slice();Lo[V]=Ht,ft=new O(T.blockSize,T.shrink,T.begin,T.depth,bn,Lo),J.add(ft)}}Q({counter:He,changed:Ge,bitMap:bn,tree:ft})},J)}else if(j===null||j>=this.blockSize){var ue=new O(this.blockSize,this.shrink,this.begin,this.depth+1);J&&(J.add(ue),J.add(ue.bitMap)),ue.bitMapTrees[0]=this,Po(this.bitMap)&&vi(ue.bitMap,0),ue.allocate(X,Q,J)}else{var _e=this.begin+j*Math.pow(this.blockSize,this.depth),$=this.depth-1,ee=void 0;$===0?ee=new _u(this.blockSize,this.shrink,_e):ee=new O(this.blockSize,this.shrink,_e,$),J&&(J.add(ee),J.add(ee.bitMap));var re=void 0;if(!J||J.has(this))this.bitMapTrees[j]=ee,re=this;else{var ce=this.bitMapTrees.slice();ce[j]=ee,re=new O(this.blockSize,this.shrink,this.begin,this.depth,this.bitMap,ce),J.add(re)}var Ee=j;ee.allocate(X,function(Oe){var He=Oe.counter,Ge=Oe.changed,We=Oe.bitMap;Oe.tree;var Ht=T.bitMap;We&&Po(We)&&(J&&!J.has(T.bitMap)&&(Ht=T.bitMap.clone(),J.add(Ht),re.bitMap=Ht),vi(Ht,Ee)),Q({counter:He,changed:Ge,bitMap:Ht,tree:re})},J)}}},{key:"deallocate",value:function(X,Q,J){var T=this,j=Math.floor((X-this.begin)/Math.pow(this.blockSize,this.depth));if(this.bitMapTrees[j]){var V=Po(this.bitMapTrees[j].bitMap);this.bitMapTrees[j].deallocate(X,function(ue){var _e=ue.exists,$=ue.changed,ee=ue.bitMap,re=ue.tree,ce=T.bitMap,Ee=T;if(!_e)Q({exists:_e,changed:$,bitMap:ce,tree:Ee});else{if($){if(!J&&V)Fi(ce,j);else if(J&&J.has(T))V&&(J.has(T.bitMap)||(ce=T.bitMap.clone(),J.add(ce),T.bitMap=ce),Fi(ce,j)),Ee.bitMapTrees[j]=re;else if(J){V&&(ce=T.bitMap.clone(),J.add(ce),Fi(ce,j));var Oe=T.bitMapTrees.slice();Oe[j]=re,Ee=new O(T.blockSize,T.shrink,T.begin,T.depth,ce,Oe),J.add(Ee)}T.shrink&&(re instanceof _u&&Hp(ee,T.blockSize)||re instanceof O&&Ip(re.bitMapTrees).length===0)&&delete Ee.bitMapTrees[j]}Q({exists:!0,changed:$,bitMap:ce,tree:Ee})}},J)}else Q({exists:!1,changed:!1,bitMap:this.bitMap,tree:this})}},{key:"check",value:function(X,Q){var J=Math.floor((X-this.begin)/Math.pow(this.blockSize,this.depth));this.bitMapTrees[J]?this.bitMapTrees[J].check(X,function(T){Q(T)}):Q(null)}}]),O}(jl),Mf=function(){function D(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:32,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,Q=arguments[3];if(on(this,D),H%32!==0)throw new RangeError("Blocksize for Counter must be a multiple of 32");this._begin=O,this._tree=Q||new _u(H,X,0)}return mu(D,[{key:"allocate",value:function(H){if(H!=null){if(H<this._begin)throw new RangeError("counter needs to be greater or equal to the beginning offset");H=H-this._begin}var X=Al(this._tree,H),Q=st(X,3),J=Q[0],T=Q[1],j=Q[2];return this._tree=j,H==null?J+this._begin:T}},{key:"deallocate",value:function(H){var X=Rl(this._tree,H-this._begin),Q=st(X,2),J=Q[0],T=Q[1];return this._tree=T,J}},{key:"check",value:function(H){return df(this._tree,H-this._begin)}}]),D}(),$l=function(D,O,H){for(var X in O)R(D,X,O[X]);return D},Of=function(D,O,H,X){if(!(D instanceof O)||X!==void 0&&X in D)throw TypeError(H+": incorrect invocation!");return D},Vp=function(D,O,H,X){try{return X?O(w(H)[0],H[1]):O(H)}catch(J){var Q=D.return;throw Q!==void 0&&w(Q.call(D)),J}},Or=Tt("iterator"),Pf=Array.prototype,ku=function(D){return D!==void 0&&(o.Array===D||Pf[Or]===D)},Lf=i(function(D){var O={},H={},X=D.exports=function(Q,J,T,j,V){var ue=V?function(){return Q}:_t(Q),_e=y(T,j,J?2:1),$=0,ee,re,ce,Ee;if(typeof ue!="function")throw TypeError(Q+" is not iterable!");if(ku(ue)){for(ee=kt(Q.length);ee>$;$++)if(Ee=J?_e(w(re=Q[$])[0],re[1]):_e(Q[$]),Ee===O||Ee===H)return Ee}else for(ce=ue.call(Q);!(re=ce.next()).done;)if(Ee=Vp(ce,_e,re.value,J),Ee===O||Ee===H)return Ee};X.BREAK=O,X.RETURN=H}),Gp=Tt("species"),Wy=function(D){var O;return Ol(D)&&(O=D.constructor,typeof O=="function"&&(O===Array||Ol(O.prototype))&&(O=void 0),b(O)&&(O=O[Gp],O===null&&(O=void 0))),O===void 0?Array:O},jy=function(D,O){return new(Wy(D))(O)},Ff=function(D,O){var H=D==1,X=D==2,Q=D==3,J=D==4,T=D==6,j=D==5||T,V=jy;return function(ue,_e,$){for(var ee=mi(ue),re=l(ee),ce=y(_e,$,3),Ee=kt(re.length),Oe=0,He=H?V(ue,Ee):X?V(ue,0):void 0,Ge,We;Ee>Oe;Oe++)if((j||Oe in re)&&(Ge=re[Oe],We=ce(Ge,Oe,ee),D)){if(H)He[Oe]=We;else if(We)switch(D){case 3:return!0;case 5:return Ge;case 6:return Oe;case 2:He.push(Ge)}else if(J)return!1}return T?-1:Q||J?J:He}},Nf=qs.getWeak,$y=Ff(5),Ra=Ff(6),zy=0,zl=function(D){return D._l||(D._l=new Ul)},Ul=function(){this.a=[]},Hl=function(D,O){return $y(D.a,function(H){return H[0]===O})};Ul.prototype={get:function(D){var O=Hl(this,D);if(O)return O[1]},has:function(D){return!!Hl(this,D)},set:function(D,O){var H=Hl(this,D);H?H[1]=O:this.a.push([D,O])},delete:function(D){var O=Ra(this.a,function(H){return H[0]===D});return~O&&this.a.splice(O,1),!!~O}};var _s={getConstructor:function(D,O,H,X){var Q=D(function(J,T){Of(J,Q,O,"_i"),J._i=zy++,J._l=void 0,T!=null&&Lf(T,H,J[X],J)});return $l(Q.prototype,{delete:function(J){if(!b(J))return!1;var T=Nf(J);return T===!0?zl(this).delete(J):T&&ye(T,this._i)&&delete T[this._i]},has:function(T){if(!b(T))return!1;var j=Nf(T);return j===!0?zl(this).has(T):j&&ye(j,this._i)}}),Q},def:function(D,O,H){var X=Nf(w(O),!0);return X===!0?zl(D).set(O,H):X[D._i]=H,D},ufstore:zl},Vl=G.f,Uy=Ff(0),Hy=function(D,O,H,X,Q,J){var T=d[D],j=T,V="add",ue=j&&j.prototype,_e={};return!_||typeof j!="function"?(j=X.getConstructor(O,D,Q,V),$l(j.prototype,H),qs.NEED=!0):(j=O(function($,ee){Of($,j,D,"_c"),$._c=new T,ee!=null&&Lf(ee,Q,$[V],$)}),Uy("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function($){var ee=$=="add"||$=="set";$ in ue&&$!="clear"&&R(j.prototype,$,function(re,ce){if(Of(this,j,$),!ee&&J&&!b(re))return $=="get"?void 0:!1;var Ee=this._c[$](re===0?0:re,ce);return ee?this:Ee})}),"size"in ue&&Vl(j.prototype,"size",{get:function(){return this._c.size}})),Tr(j,D),_e[D]=j,te(te.G+te.W+te.F,_e),j};Hy("WeakSet",function(D){return function(){return D(this,arguments.length>0?arguments[0]:void 0)}},{add:function(O){return _s.def(this,O,!0)}},_s,!1,!0);var Vy=g.WeakSet,Da=i(function(D){D.exports={default:Vy,__esModule:!0}}),Pr=r(Da),Kp=function(){function D(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:32,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,Q=arguments[3];if(on(this,D),H%32!==0)throw new RangeError("Blocksize for Counter must be a multiple of 32");this._begin=O,this._blockSize=H,this._shrink=X,this._tree=Q||new _u(H,X,0)}return mu(D,[{key:"allocate",value:function(H){if(H!=null){if(H<this._begin)throw new RangeError("counter needs to be greater or equal to the beginning offset");H=H-this._begin}var X=Al(this._tree,H,new Pr),Q=st(X,3),J=Q[0],T=Q[1],j=Q[2],V=void 0;return T?V=new D(this._begin,this._blockSize,this._shrink,j):V=this,H==null?[J+this._begin,V]:[T,V]}},{key:"deallocate",value:function(H){var X=Rl(this._tree,H-this._begin,new Pr),Q=st(X,2),J=Q[0],T=Q[1],j=void 0;return J?j=new D(this._begin,this._blockSize,this._shrink,T):j=this,[J,j]}},{key:"check",value:function(H){return df(this._tree,H-this._begin)}},{key:"transaction",value:function(H){var X=this,Q=new Pr,J=this._tree,T=!1,j={allocate:function(ue){if(ue!=null){if(ue<X._begin)throw new RangeError("counter needs to be greater or equal to the beginning offset");ue=ue-X._begin}var _e=Al(J,ue,Q),$=st(_e,3),ee=$[0],re=$[1],ce=$[2];return T=re,J=ce,ue==null?ee+X._begin:T},deallocate:function(ue){var _e=Rl(J,ue-X._begin,Q),$=st(_e,2),ee=$[0],re=$[1];return T=ee,J=re,T},check:function(ue){return df(J,ue-X._begin)}};return H(j),T?new D(this._begin,this._blockSize,this._shrink,J):this}}]),D}();t.default=Mf,t.CounterImmutable=Kp,Object.defineProperty(t,"__esModule",{value:!0})})}),D1=Zt(Gne),Kne=12,T1=20,q4=Math.pow(2,Kne)-1,W4=Math.pow(2,T1)-1,W2=0,j2=0,yc=function(n){_a(e,n);function e(t,r){fr(this,e);var i=wa(this,(e.__proto__||Vt(e)).call(this,r));return i.code=t,i}return e}(Error);Object.defineProperty(yc,"ERROR_RANGE",{value:1});Object.defineProperty(yc,"ERROR_CONFLICT",{value:2});var Bx=function(){function n(){fr(this,n),this._chrCounterMaj=new D1(W2),this._chrDevices=new Jd}return Rr(n,[{key:"getChr",value:function(t,r){var i=this._chrDevices.get(t);if(i){var s=si(i,1),o=s[0];return o.get(r)}}},{key:"registerChr",value:function(t,r,i){var s=void 0,o=void 0,a=void 0,u=void 0;try{if(r===void 0)r=this._chrCounterMaj.allocate(),s=r;else{var l=this._chrDevices.get(r);if(!l)this._chrCounterMaj.allocate(r),s=r;else{var c=si(l,2);u=c[0],a=c[1]}}if((!u||!a)&&(a=new D1(j2),u=new Jd),i===void 0)i=a.allocate(),o=i;else if(!u.has(i))a.allocate(i),o=i;else throw new yc(yc.ERROR_CONFLICT);if(r>q4||r<W2||i>W4||i<j2)throw new yc(yc.ERROR_RANGE);u.set(i,t),this._chrDevices.set(r,[u,a]);return}catch(f){throw s!=null&&this._chrCounterMaj.deallocate(s),o!=null&&a&&a.deallocate(o),f}}},{key:"deregisterChr",value:function(t,r){var i=this._chrDevices.get(t);if(i){var s=si(i,2),o=s[0],a=s[1];o.delete(r)&&a.deallocate(r),o.size||(this._chrDevices.delete(t),this._chrCounterMaj.deallocate(t))}}}]),n}();function to(n,e){return n<<T1|e}function j4(n){var e=n>>T1,t=n&(1<<T1)-1;return[e,t]}var Kb=ss.getWeak,Zne=by(5),Xne=by(6),Yne=0,om=function(n){return n._l||(n._l=new $4)},$4=function(){this.a=[]},Zb=function(n,e){return Zne(n.a,function(t){return t[0]===e})};$4.prototype={get:function(n){var e=Zb(this,n);if(e)return e[1]},has:function(n){return!!Zb(this,n)},set:function(n,e){var t=Zb(this,n);t?t[1]=e:this.a.push([n,e])},delete:function(n){var e=Xne(this.a,function(t){return t[0]===n});return~e&&this.a.splice(e,1),!!~e}};var am={getConstructor:function(n,e,t,r){var i=n(function(s,o){Yd(s,i,e,"_i"),s._t=e,s._i=Yne++,s._l=void 0,o!=null&&fu(o,t,s[r],s)});return vy(i.prototype,{delete:function(s){if(!Ln(s))return!1;var o=Kb(s);return o===!0?om(Di(this,e)).delete(s):o&&Ot(o,this._i)&&delete o[this._i]},has:function(o){if(!Ln(o))return!1;var a=Kb(o);return a===!0?om(Di(this,e)).has(o):a&&Ot(a,this._i)}}),i},def:function(n,e,t){var r=Kb(Cr(e),!0);return r===!0?om(n).set(e,t):r[n._i]=t,n},ufstore:om};dt(function(n){var e=by(0),t=Di,r=!Ke.ActiveXObject&&"ActiveXObject"in Ke,i="WeakMap",s=ss.getWeak,o=Object.isExtensible,a=am.ufstore,u,l=function(d){return function(){return d(this,arguments.length>0?arguments[0]:void 0)}},c={get:function(g){if(Ln(g)){var m=s(g);return m===!0?a(Di(this,i)).get(g):m?m[this._i]:void 0}},set:function(g,m){return am.def(Di(this,i),g,m)}},f=n.exports=O4(i,l,c,am,!0,!0);t&&r&&(u=am.getConstructor(l,i),p4(u.prototype,c),ss.NEED=!0,e(["delete","has","get","set"],function(d){var g=f.prototype,m=g[d];Dx(g,d,function(y,b){if(Ln(y)&&!o(y)){this._f||(this._f=new u);var w=this._f[d](y,b);return d=="set"?this:w}return m.call(this,y,b)})}))});P4("WeakMap");L4("WeakMap");var Jne=Lt.WeakMap,Qne=dt(function(n){n.exports={default:Jne,__esModule:!0}}),ere=Zt(Qne),tre=Nn("species"),z4=function(n,e){var t=Cr(n).constructor,r;return t===void 0||(r=Cr(t)[tre])==null?e:bl(r)},nre=function(n,e,t){switch(e.length){case 0:return n();case 1:return n(e[0]);case 2:return n(e[0],e[1]);case 3:return n(e[0],e[1],e[2]);case 4:return n(e[0],e[1],e[2],e[3])}return n.apply(t,e)},WT=Ke.process,$2=Ke.setImmediate,jT=Ke.clearImmediate,$T=Ke.MessageChannel,Xb=Ke.Dispatch,Yb=0,gd={},zT="onreadystatechange",Ku,Jb,Qb,sd=function(){var n=+this;if(gd.hasOwnProperty(n)){var e=gd[n];delete gd[n],e()}},UT=function(n){sd.call(n.data)};(!$2||!jT)&&($2=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return gd[++Yb]=function(){nre(typeof e=="function"?e:Function(e),t)},Ku(Yb),Yb},jT=function(e){delete gd[e]},_l(WT)=="process"?Ku=function(n){WT.nextTick(Kn(sd,n,1))}:Xb&&Xb.now?Ku=function(n){Xb.now(Kn(sd,n,1))}:$T?(Jb=new $T,Qb=Jb.port2,Jb.port1.onmessage=UT,Ku=Kn(Qb.postMessage,Qb,1)):Ke.addEventListener&&typeof postMessage=="function"&&!Ke.importScripts?(Ku=function(n){Ke.postMessage(n+"","*")},Ke.addEventListener("message",UT,!1)):zT in E1("script")?Ku=function(n){I2.appendChild(E1("script"))[zT]=function(){I2.removeChild(this),sd.call(n)}}:Ku=function(n){setTimeout(Kn(sd,n,1),0)});var U4={set:$2},rre=U4.set,HT=Ke.MutationObserver||Ke.WebKitMutationObserver,z2=Ke.process,ew=Ke.Promise,VT=_l(z2)=="process",ire=function(){var n,e,t,r=function(){var a,u;for(VT&&(a=z2.domain)&&a.exit();n;){u=n.fn,n=n.next;try{u()}catch(l){throw n?t():e=void 0,l}}e=void 0,a&&a.enter()};if(VT)t=function(){z2.nextTick(r)};else if(HT&&!(Ke.navigator&&Ke.navigator.standalone)){var i=!0,s=document.createTextNode("");new HT(r).observe(s,{characterData:!0}),t=function(){s.data=i=!i}}else if(ew&&ew.resolve){var o=ew.resolve(void 0);t=function(){o.then(r)}}else t=function(){rre.call(Ke,r)};return function(a){var u={fn:a,next:void 0};e&&(e.next=u),n||(n=u,t()),e=u}};function sre(n){var e,t;this.promise=new n(function(r,i){if(e!==void 0||t!==void 0)throw TypeError("Bad Promise constructor");e=r,t=i}),this.resolve=bl(e),this.reject=bl(t)}var ore=function(n){return new sre(n)},wy={f:ore},I1=function(n){try{return{e:!1,v:n()}}catch(e){return{e:!0,v:e}}},GT=Ke.navigator,are=GT&>.userAgent||"",U2=function(n,e){if(Cr(n),Ln(e)&&e.constructor===n)return e;var t=wy.f(n),r=t.resolve;return r(e),t.promise},H4=U4.set,V4=ire(),gu="Promise",G4=Ke.TypeError,Gc=Ke.process,KT=Gc&&Gc.versions,ure=KT&&KT.v8||"",uo=Ke[gu],Qd=yy(Gc)=="process",Dm=function(){},um,K4,ZT,qx,ep=K4=wy.f,_y=!!function(){try{var n=uo.resolve(1),e=(n.constructor={})[Nn("species")]=function(t){t(Dm,Dm)};return(Qd||typeof PromiseRejectionEvent=="function")&&n.then(Dm)instanceof e&&ure.indexOf("6.6")!==0&&are.indexOf("Chrome/66")===-1}catch{}}(),Z4=function(n){var e;return Ln(n)&&typeof(e=n.then)=="function"?e:!1},Wx=function(n,e){if(!n._n){n._n=!0;var t=n._c;V4(function(){for(var r=n._v,i=n._s==1,s=0,o=function(a){var u=i?a.ok:a.fail,l=a.resolve,c=a.reject,f=a.domain,d,g,m;try{u?(i||(n._h==2&&cre(n),n._h=1),u===!0?d=r:(f&&f.enter(),d=u(r),f&&(f.exit(),m=!0)),d===a.promise?c(G4("Promise-chain cycle")):(g=Z4(d))?g.call(d,l,c):l(d)):c(r)}catch(y){f&&!m&&f.exit(),c(y)}};t.length>s;)o(t[s++]);n._c=[],n._n=!1,e&&!n._h&&lre(n)})}},lre=function(n){H4.call(Ke,function(){var e=n._v,t=XT(n),r,i,s;if(t&&(r=I1(function(){Qd?Gc.emit("unhandledRejection",e,n):(i=Ke.onunhandledrejection)?i({promise:n,reason:e}):(s=Ke.console)&&s.error&&s.error("Unhandled promise rejection",e)}),n._h=Qd||XT(n)?2:1),n._a=void 0,t&&r.e)throw r.v})},XT=function(n){return n._h!==1&&(n._a||n._c).length===0},cre=function(n){H4.call(Ke,function(){var e;Qd?Gc.emit("rejectionHandled",n):(e=Ke.onrejectionhandled)&&e({promise:n,reason:n._v})})},Dc=function(n){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=n,e._s=2,e._a||(e._a=e._c.slice()),Wx(e,!0))},H2=function(n){var e=this,t;if(!e._d){e._d=!0,e=e._w||e;try{if(e===n)throw G4("Promise can't be resolved itself");(t=Z4(n))?V4(function(){var r={_w:e,_d:!1};try{t.call(n,Kn(H2,r,1),Kn(Dc,r,1))}catch(i){Dc.call(r,i)}}):(e._v=n,e._s=1,Wx(e,!1))}catch(r){Dc.call({_w:e,_d:!1},r)}}};_y||(uo=function(e){Yd(this,uo,gu,"_h"),bl(e),um.call(this);try{e(Kn(H2,this,1),Kn(Dc,this,1))}catch(t){Dc.call(this,t)}},um=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},um.prototype=vy(uo.prototype,{then:function(e,t){var r=ep(z4(this,uo));return r.ok=typeof e=="function"?e:!0,r.fail=typeof t=="function"&&t,r.domain=Qd?Gc.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&Wx(this,!1),r.promise},catch:function(n){return this.then(void 0,n)}}),ZT=function(){var n=new um;this.promise=n,this.resolve=Kn(H2,n,1),this.reject=Kn(Dc,n,1)},wy.f=ep=function(n){return n===uo||n===qx?new ZT(n):K4(n)});Ie(Ie.G+Ie.W+Ie.F*!_y,{Promise:uo});Sl(uo,gu);I4(gu);qx=Lt[gu];Ie(Ie.S+Ie.F*!_y,gu,{reject:function(e){var t=ep(this),r=t.reject;return r(e),t.promise}});Ie(Ie.S+Ie.F*rte,gu,{resolve:function(e){return U2(this===qx?uo:this,e)}});Ie(Ie.S+Ie.F*!(_y&&b4(function(n){uo.all(n).catch(Dm)})),gu,{all:function(e){var t=this,r=ep(t),i=r.resolve,s=r.reject,o=I1(function(){var a=[],u=0,l=1;fu(e,!1,function(c){var f=u++,d=!1;a.push(void 0),l++,t.resolve(c).then(function(g){d||(d=!0,a[f]=g,--l||i(a))},s)}),--l||i(a)});return o.e&&s(o.v),r.promise},race:function(e){var t=this,r=ep(t),i=r.reject,s=I1(function(){fu(e,!1,function(o){t.resolve(o).then(r.resolve,i)})});return s.e&&i(s.v),r.promise}});Ie(Ie.P+Ie.R,"Promise",{finally:function(n){var e=z4(this,Lt.Promise||Ke.Promise),t=typeof n=="function";return this.then(t?function(r){return U2(e,n()).then(function(){return r})}:n,t?function(r){return U2(e,n()).then(function(){throw r})}:n)}});Ie(Ie.S,"Promise",{try:function(n){var e=wy.f(this),t=I1(n);return(t.e?e.reject:e.resolve)(t.v),e.promise}});var fre=Lt.Promise,hre=dt(function(n){n.exports={default:fre,__esModule:!0}}),tw=Zt(hre);Ie(Ie.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}});var dre=Lt.Math.log2,pre=dt(function(n){n.exports={default:dre,__esModule:!0}}),gre=Zt(pre);function M1(n,e){if(n.maxByteLength<e){var t=1<<Math.ceil(gre(e)),r=new ArrayBuffer(e,{maxByteLength:t}),i=new Uint8Array(n),s=new Uint8Array(r);return s.set(i),r}return n.byteLength<e&&n.resize(e),n}function V2(n,e){var t=n.byteLength+e.byteLength,r=n;n.maxByteLength<t&&(newBuf=M1(n,t),newBuf.set(e,n.byteLength),r=newBuf);var i=new Uint8Array(r),s=new Uint8Array(e);return i.set(s,n.byteLength),newBuf}function YT(n){var e=new ArrayBuffer(n.byteLength,{maxByteLength:n.maxByteLength}),t=new Uint8Array(n),r=new Uint8Array(e);return r.set(t,n.byteLength),e}var Sp=function(){function n(e,t){fr(this,n);var r=new Date;this._metadata=new Rm(fc({},e,{mode:e.mode,nlink:e.nlink||0,atime:r,mtime:r,ctime:r,birthtime:r})),this._iNodeMgr=t}return Rr(n,[{key:"getMetadata",value:function(){return this._metadata}}]),n}(),Ri=function(n){_a(e,n);function e(t,r){fr(this,e);var i=wa(this,(e.__proto__||Vt(e)).call(this,{ino:t.ino,uid:t.uid,gid:t.gid,mode:se.S_IFREG|t.mode&~se.S_IFMT,size:t.data?t.data.byteLength:0},r));return i._data=t.data?t.data:new ArrayBuffer(0),i}return Rr(e,[{key:"getData",value:function(){return this._data}},{key:"setData",value:function(r){this._data=r}},{key:"read",value:function(){}},{key:"write",value:function(r,i,s){var o=this._data,a=void 0;if(s)o=V2(o,r),a=r.byteLength;else{i=o.byteLength<i?o.byteLength:i;var u=o.byteLength-i,l=r.byteLength-u;l>0&&(o=M1(o,o.byteLength+l)),a=r.byteLength;var c=new Uint8Array(o);c.set(new Uint8Array(r),i)}return this._data=o,this._metadata.size=this._data.byteLength,a}},{key:"destructor",value:function(){}}]),e}(Sp),cn=function(n){_a(e,n);function e(t,r){fr(this,e),t.parent===void 0&&(t.parent=t.ino);var i=void 0;t.parent===t.ino?i=2:(i=1,r.linkINode(r.getINode(t.parent)));var s=wa(this,(e.__proto__||Vt(e)).call(this,{ino:t.ino,mode:se.S_IFDIR|t.mode&~se.S_IFMT,uid:t.uid,gid:t.gid,nlink:i,size:4096},r));return s._dir=new Jd([[".",t.ino],["..",t.parent]]),s}return Rr(e,[{key:"getEntries",value:function(){return this._metadata.atime=new Date,this._dir.entries()}},{key:"getEntryIndex",value:function(r){return this._dir.get(r)}},{key:"getEntry",value:function(r){var i=this._dir.get(r);if(i!==void 0)return this._iNodeMgr.getINode(i)}},{key:"addEntry",value:function(r,i){if(r==="."||r==="..")throw new Error("Not allowed to add `.` or `..` entries");var s=new Date;this._metadata.mtime=s,this._metadata.ctime=s,this._iNodeMgr.linkINode(this._iNodeMgr.getINode(i)),this._dir.set(r,i)}},{key:"deleteEntry",value:function(r){if(r==="."||r==="..")throw new Error("Not allowed to delete `.` or `..` entries");var i=this._dir.get(r);if(i!==void 0){var s=new Date;this._metadata.mtime=s,this._metadata.ctime=s,this._dir.delete(r),this._iNodeMgr.unlinkINode(this._iNodeMgr.getINode(i))}}},{key:"renameEntry",value:function(r,i){if(r==="."||r===".."||i==="."||r==="..")throw new Error("Not allowed to rename `.` or `..` entries");var s=this._dir.get(r);if(s!=null){var o=new Date;this._metadata.mtime=o,this._metadata.ctime=o,this._dir.delete(r),this._dir.set(i,s)}}},{key:"destructor",value:function(){if(this._dir.get(".")!==this._dir.get("..")){var r=this._dir.get("..");r!=null&&this._iNodeMgr.unlinkINode(this._iNodeMgr.getINode(r))}}}]),e}(Sp),md=function(n){_a(e,n);function e(t,r){fr(this,e);var i=wa(this,(e.__proto__||Vt(e)).call(this,{ino:t.ino,mode:se.S_IFLNK|t.mode&~se.S_IFMT,uid:t.uid,gid:t.gid,size:new TextEncoder().encode(t.link).byteLength},r));return i._link=t.link,i}return Rr(e,[{key:"getLink",value:function(){return this._link}},{key:"destructor",value:function(){}}]),e}(Sp),ua=function(n){_a(e,n);function e(t,r){fr(this,e);var i=wa(this,(e.__proto__||Vt(e)).call(this,{ino:t.ino,mode:se.S_IFCHR|t.mode&~se.S_IFMT,uid:t.uid,gid:t.gid,rdev:t.rdev,size:0},r));return i.teardown=t.teardown,i}return Rr(e,[{key:"getFileDesOps",value:function(){var r=j4(this.getMetadata().rdev),i=si(r,2),s=i[0],o=i[1];return this._iNodeMgr._devMgr.getChr(s,o)}},{key:"destructor",value:function(){this.teardown!==void 0&&this.teardown()}}]),e}(Sp),jx=function(n){_a(e,n);function e(t,r){fr(this,e);var i=wa(this,(e.__proto__||Vt(e)).call(this,{ino:t.ino,mode:se.S_IFIFO|t.mode&~se.S_IFMT,uid:t.uid,gid:t.gid,size:0},r));return i.KERN_W=0,i.KERN_R=1,i.CLOSERM=2,i.teardown=t.teardown,i.reader=-1,i.writer=-1,i.messages=[],i.readQueue=[],i.pollQueue=[],i.mode=0,i}return Rr(e,[{key:"setMode",value:function(r,i){i?this.mode|=1<<r:this.mode&=~(1<<r)}},{key:"isKernW",value:function(){return(this.mode&1<<this.KERN_W)!==0}},{key:"isKernR",value:function(){return(this.mode&1<<this.KERN_R)!==0}},{key:"isCloserm",value:function(){return(this.mode&1<<this.CLOSERM)!==0}},{key:"notify",value:function(r){for(var i=this.pollQueue.shift();i!==void 0;i=this.pollQueue.shift())i(r)}},{key:"sendEof",value:function(){for(var r=this.readQueue.shift();r!==void 0;r=this.readQueue.shift())r(new ArrayBuffer);this.notify(0)}},{key:"write",value:function(r){var i=this.readQueue.shift();if(i!==void 0){i(r);return}this.messages.push(r),this.notify(r.byteLength)}},{key:"read",value:function(){var r=this,i=this.messages.shift();return i===void 0?this.writer===0?new ArrayBuffer:new tw(function(s){r.readQueue.push(s)}):i}},{key:"addPollSub",value:function(){var r=this;return this.messages.length!==0?tw.resolve(this.messages[0].byteLength):new tw(function(i){r.pollQueue.push(i)})}},{key:"destructor",value:function(){this.teardown!==void 0&&this.teardown()}}]),e}(Sp),X4=function(){function n(e){fr(this,n),this._counter=new D1(1),this._iNodes=new Jd,this._iNodeRefs=new ere,this._devMgr=e}return Rr(n,[{key:"createINode",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};r.ino=this._counter.allocate(),r.mode=typeof r.mode=="number"?r.mode:0,r.uid=typeof r.uid=="number"?r.uid:eo,r.gid=typeof r.gid=="number"?r.gid:B2;var i=new t(r,this);return this._iNodes.set(r.ino,i),this._iNodeRefs.set(i,0),[i,r.ino]}},{key:"getINode",value:function(t){return this._iNodes.get(t)}},{key:"linkINode",value:function(t){t&&++t.getMetadata().nlink}},{key:"unlinkINode",value:function(t){t&&(--t.getMetadata().nlink,this._gcINode(t))}},{key:"refINode",value:function(t){if(t){var r=this._iNodeRefs.get(t);r!==void 0&&this._iNodeRefs.set(t,r+1)}}},{key:"unrefINode",value:function(t){if(t){var r=this._iNodeRefs.get(t);r!==void 0&&(this._iNodeRefs.set(t,r-1),this._gcINode(t))}}},{key:"_gcINode",value:function(t){var r=t.getMetadata(),i=r.nlink+this._iNodeRefs.get(t);if(i===0||i===1&&t instanceof cn){var s=r.ino;t.destructor(),this._iNodes.delete(s),this._counter.deallocate(s)}}}]),n}(),mre=dt(function(n){/*!
|
|
200
|
-
* prr
|
|
201
|
-
* (c) 2013 Rod Vagg <rod@vagg.org>
|
|
202
|
-
* https://github.com/rvagg/prr
|
|
203
|
-
* License: MIT
|
|
204
|
-
*/(function(e,t,r){n.exports?n.exports=r():t[e]=r()})("prr",Zd,function(){var e=typeof Object.defineProperty=="function"?function(i,s,o){return Object.defineProperty(i,s,o),i}:function(i,s,o){return i[s]=o.value,i},t=function(i,s){var o=typeof s=="object",a=!o&&typeof s=="string",u=function(l){return o?!!s[l]:a?s.indexOf(l[0])>-1:!1};return{enumerable:u("enumerable"),configurable:u("configurable"),writable:u("writable"),value:i}},r=function(i,s,o,a){var u;if(a=t(o,a),typeof s=="object"){for(u in s)Object.hasOwnProperty.call(s,u)&&(a.value=s[u],e(i,u,a));return i}return e(i,s,a)};return r})});function Y4(n,e,t){e&&typeof e!="string"&&(e=e.message||e.name),mre(this,{type:n,name:n,cause:typeof e!="string"?e:t,message:e},"ewr")}function $x(n,e){Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),Y4.call(this,"CustomError",n,e)}$x.prototype=new Error;function yre(n,e,t){var r=function(i,s){Y4.call(this,e,i,s),e=="FilesystemError"&&(this.code=this.cause.code,this.path=this.cause.path,this.errno=this.cause.errno,this.message=(n.errno[this.cause.errno]?n.errno[this.cause.errno].description:this.cause.message)+(this.cause.path?" ["+this.cause.path+"]":"")),Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,r)};return r.prototype=t?new t:new $x,r}var vre=function(n){var e=function(t,r){return yre(n,t,r)};return{CustomError:$x,FilesystemError:e("FilesystemError"),createError:e}},Cp=dt(function(n){var e=n.exports.all=[{errno:-2,code:"ENOENT",description:"no such file or directory"},{errno:-1,code:"UNKNOWN",description:"unknown error"},{errno:0,code:"OK",description:"success"},{errno:1,code:"EOF",description:"end of file"},{errno:2,code:"EADDRINFO",description:"getaddrinfo error"},{errno:3,code:"EACCES",description:"permission denied"},{errno:4,code:"EAGAIN",description:"resource temporarily unavailable"},{errno:5,code:"EADDRINUSE",description:"address already in use"},{errno:6,code:"EADDRNOTAVAIL",description:"address not available"},{errno:7,code:"EAFNOSUPPORT",description:"address family not supported"},{errno:8,code:"EALREADY",description:"connection already in progress"},{errno:9,code:"EBADF",description:"bad file descriptor"},{errno:10,code:"EBUSY",description:"resource busy or locked"},{errno:11,code:"ECONNABORTED",description:"software caused connection abort"},{errno:12,code:"ECONNREFUSED",description:"connection refused"},{errno:13,code:"ECONNRESET",description:"connection reset by peer"},{errno:14,code:"EDESTADDRREQ",description:"destination address required"},{errno:15,code:"EFAULT",description:"bad address in system call argument"},{errno:16,code:"EHOSTUNREACH",description:"host is unreachable"},{errno:17,code:"EINTR",description:"interrupted system call"},{errno:18,code:"EINVAL",description:"invalid argument"},{errno:19,code:"EISCONN",description:"socket is already connected"},{errno:20,code:"EMFILE",description:"too many open files"},{errno:21,code:"EMSGSIZE",description:"message too long"},{errno:22,code:"ENETDOWN",description:"network is down"},{errno:23,code:"ENETUNREACH",description:"network is unreachable"},{errno:24,code:"ENFILE",description:"file table overflow"},{errno:25,code:"ENOBUFS",description:"no buffer space available"},{errno:26,code:"ENOMEM",description:"not enough memory"},{errno:27,code:"ENOTDIR",description:"not a directory"},{errno:28,code:"EISDIR",description:"illegal operation on a directory"},{errno:29,code:"ENONET",description:"machine is not on the network"},{errno:31,code:"ENOTCONN",description:"socket is not connected"},{errno:32,code:"ENOTSOCK",description:"socket operation on non-socket"},{errno:33,code:"ENOTSUP",description:"operation not supported on socket"},{errno:34,code:"ENOENT",description:"no such file or directory"},{errno:35,code:"ENOSYS",description:"function not implemented"},{errno:36,code:"EPIPE",description:"broken pipe"},{errno:37,code:"EPROTO",description:"protocol error"},{errno:38,code:"EPROTONOSUPPORT",description:"protocol not supported"},{errno:39,code:"EPROTOTYPE",description:"protocol wrong type for socket"},{errno:40,code:"ETIMEDOUT",description:"connection timed out"},{errno:41,code:"ECHARSET",description:"invalid Unicode character"},{errno:42,code:"EAIFAMNOSUPPORT",description:"address family for hostname not supported"},{errno:44,code:"EAISERVICE",description:"servname not supported for ai_socktype"},{errno:45,code:"EAISOCKTYPE",description:"ai_socktype not supported"},{errno:46,code:"ESHUTDOWN",description:"cannot send after transport endpoint shutdown"},{errno:47,code:"EEXIST",description:"file already exists"},{errno:48,code:"ESRCH",description:"no such process"},{errno:49,code:"ENAMETOOLONG",description:"name too long"},{errno:50,code:"EPERM",description:"operation not permitted"},{errno:51,code:"ELOOP",description:"too many symbolic links encountered"},{errno:52,code:"EXDEV",description:"cross-device link not permitted"},{errno:53,code:"ENOTEMPTY",description:"directory not empty"},{errno:54,code:"ENOSPC",description:"no space left on device"},{errno:55,code:"EIO",description:"i/o error"},{errno:56,code:"EROFS",description:"read-only file system"},{errno:57,code:"ENODEV",description:"no such device"},{errno:58,code:"ESPIPE",description:"invalid seek"},{errno:59,code:"ECANCELED",description:"operation canceled"}];n.exports.errno={},n.exports.code={},e.forEach(function(t){n.exports.errno[t.errno]=t,n.exports.code[t.code]=t}),n.exports.custom=vre(n.exports),n.exports.create=n.exports.custom.createError});Cp.all;Cp.errno;var fe=Cp.code;Cp.custom;Cp.create;var le=function(n){_a(e,n);function e(t,r,i,s){fr(this,e);var o=t.code+": "+t.description;r!=null&&(o+=", "+r,i!=null&&(o+=" -> "+i));var a=wa(this,(e.__proto__||Vt(e)).call(this,o));return a.errno=t.errno,a.code=t.code,a.errnoDescription=t.description,s!=null&&(a.syscall=s),a}return Rr(e,[{key:"setPaths",value:function(r,i){var s=this.code+": "+this.errnoDescription+", "+r;i!=null&&(s+=" -> "+i),this.message=s}},{key:"setSyscall",value:function(r){this.syscall=r}}]),e}(Error),bre=function(){function n(e,t){fr(this,n),this._iNode=e,this._flags=t,this._pos=0}return Rr(n,[{key:"getINode",value:function(){return this._iNode}},{key:"getFlags",value:function(){return this._flags}},{key:"setFlags",value:function(t){this._flags=t}},{key:"getPos",value:function(){return this._pos}},{key:"setPos",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:se.SEEK_SET,i=this.getINode(),s=void 0;switch(!0){case i instanceof Ri:case i instanceof cn:switch(r){case se.SEEK_SET:s=t;break;case se.SEEK_CUR:s=this._pos+t;break;case se.SEEK_END:s=i.getData().length+t;break;default:s=this._pos}if(s<0)throw new le(fe.EINVAL);this._pos=s;break;case i instanceof ua:var o=i.getFileDesOps();if(o)if(o.setPos)o.setPos(this,t,r);else throw new le(fe.ESPIPE);else throw new le(fe.ENXIO);break;default:throw new le(fe.ESPIPE)}}},{key:"read",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,i=void 0;r===null?i=this._pos:i=r;var s=this._iNode,o=void 0;switch(!0){case s instanceof Ri:var a=s.getData(),u=s.getMetadata();o=a.copy(t,0,i),u.atime=new Date;break;case s instanceof ua:var l=s.getFileDesOps();if(l)if(l.read)o=l.read(this,t,i);else throw new le(fe.EINVAL);else throw new le(fe.ENXIO);break;default:throw new le(fe.EINVAL)}return r===null&&(this._pos=i+o),o}},{key:"write",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=void 0;r===null?s=this._pos:s=r;var o=this._iNode,a=void 0;switch(!0){case o instanceof Ri:var u=o.getData(),l=o.getMetadata();if((this.getFlags()|i)&se.O_APPEND)s=u.length,u=he.concat([u,t]),a=t.length;else{if(s>u.length)u=he.concat([u,he.alloc(s-u.length),he.allocUnsafe(t.length)]);else if(s<=u.length){var c=u.length-s,f=t.length-c;f>0&&(u=he.concat([u,he.allocUnsafe(f)]))}a=t.copy(u,s)}o.setData(u);var d=new Date;l.mtime=d,l.ctime=d,l.size=u.length;break;case o instanceof ua:var g=o.getFileDesOps();if(g)if(g.write)a=g.write(this,t,s,i);else throw new le(fe.EINVAL);else throw new le(fe.ENXIO);break;default:throw new le(fe.EINVAL)}return r===null&&(this._pos=s+a),a}}]),n}(),J4=function(){function n(e){fr(this,n),this._counter=new D1(0),this._fds=new Jd,this._iNodeMgr=e}return Rr(n,[{key:"createFd",value:function(t,r){this._iNodeMgr.refINode(t);var i=this._counter.allocate(),s=new bre(t,r);if(t instanceof ua){var o=t.getFileDesOps();if(o)o.open&&o.open(s);else throw new le(fe.ENXIO)}return this._fds.set(i,s),[s,i]}},{key:"getFd",value:function(t){return this._fds.get(t)}},{key:"dupFd",value:function(t){var r=this._fds.get(t);if(r){this._iNodeMgr.refINode(r.getINode());var i=this._counter.allocate();return this._fds.set(i,r),t}}},{key:"deleteFd",value:function(t){var r=this._fds.get(t);if(r){var i=r.getINode();if(i instanceof ua){var s=i.getFileDesOps();if(s)s.close&&s.close(r);else throw new le(fe.ENXIO)}this._fds.delete(t),this._counter.deallocate(t),this._iNodeMgr.unrefINode(i)}}}]),n}(),wre=gy.f;Nx("getOwnPropertyDescriptor",function(){return function(e,t){return wre(Ro(e),t)}});var _re=Lt.Object,kre=function(e,t){return _re.getOwnPropertyDescriptor(e,t)},Q4=dt(function(n){n.exports={default:kre,__esModule:!0}});Zt(Q4);var xre=dt(function(n,e){e.__esModule=!0;var t=i(F4),r=i(Q4);function i(s){return s&&s.__esModule?s:{default:s}}e.default=function s(o,a,u){o===null&&(o=Function.prototype);var l=(0,r.default)(o,a);if(l===void 0){var c=(0,t.default)(o);return c===null?void 0:s(c,a,u)}else{if("value"in l)return l.value;var f=l.get;return f===void 0?void 0:f.call(u)}}}),nr=Zt(xre),nw;function nu(){}nu.prototype=Object.create(null);function bt(){bt.init.call(this)}bt.EventEmitter=bt;bt.usingDomains=!1;bt.prototype.domain=void 0;bt.prototype._events=void 0;bt.prototype._maxListeners=void 0;bt.defaultMaxListeners=10;bt.init=function(){this.domain=null,bt.usingDomains&&nw.active&&!(this instanceof nw.Domain)&&(this.domain=nw.active),(!this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=new nu,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};bt.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this};function eL(n){return n._maxListeners===void 0?bt.defaultMaxListeners:n._maxListeners}bt.prototype.getMaxListeners=function(){return eL(this)};function Sre(n,e,t){if(e)n.call(t);else for(var r=n.length,i=Ep(n,r),s=0;s<r;++s)i[s].call(t)}function Cre(n,e,t,r){if(e)n.call(t,r);else for(var i=n.length,s=Ep(n,i),o=0;o<i;++o)s[o].call(t,r)}function Ere(n,e,t,r,i){if(e)n.call(t,r,i);else for(var s=n.length,o=Ep(n,s),a=0;a<s;++a)o[a].call(t,r,i)}function Are(n,e,t,r,i,s){if(e)n.call(t,r,i,s);else for(var o=n.length,a=Ep(n,o),u=0;u<o;++u)a[u].call(t,r,i,s)}function Rre(n,e,t,r){if(e)n.apply(t,r);else for(var i=n.length,s=Ep(n,i),o=0;o<i;++o)s[o].apply(t,r)}bt.prototype.emit=function(e){var t,r,i,s,o,a,u,l=e==="error";if(a=this._events,a)l=l&&a.error==null;else if(!l)return!1;if(u=this.domain,l){if(t=arguments[1],u)t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=u,t.domainThrown=!1,u.emit("error",t);else{if(t instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}return!1}if(r=a[e],!r)return!1;var f=typeof r=="function";switch(i=arguments.length,i){case 1:Sre(r,f,this);break;case 2:Cre(r,f,this,arguments[1]);break;case 3:Ere(r,f,this,arguments[1],arguments[2]);break;case 4:Are(r,f,this,arguments[1],arguments[2],arguments[3]);break;default:for(s=new Array(i-1),o=1;o<i;o++)s[o-1]=arguments[o];Rre(r,f,this,s)}return!0};function tL(n,e,t,r){var i,s,o;if(typeof t!="function")throw new TypeError('"listener" argument must be a function');if(s=n._events,s?(s.newListener&&(n.emit("newListener",e,t.listener?t.listener:t),s=n._events),o=s[e]):(s=n._events=new nu,n._eventsCount=0),!o)o=s[e]=t,++n._eventsCount;else if(typeof o=="function"?o=s[e]=r?[t,o]:[o,t]:r?o.unshift(t):o.push(t),!o.warned&&(i=eL(n),i&&i>0&&o.length>i)){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=n,a.type=e,a.count=o.length,Dre(a)}return n}function Dre(n){typeof console.warn=="function"?console.warn(n):console.log(n)}bt.prototype.addListener=function(e,t){return tL(this,e,t,!1)};bt.prototype.on=bt.prototype.addListener;bt.prototype.prependListener=function(e,t){return tL(this,e,t,!0)};function nL(n,e,t){var r=!1;function i(){n.removeListener(e,i),r||(r=!0,t.apply(n,arguments))}return i.listener=t,i}bt.prototype.once=function(e,t){if(typeof t!="function")throw new TypeError('"listener" argument must be a function');return this.on(e,nL(this,e,t)),this};bt.prototype.prependOnceListener=function(e,t){if(typeof t!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(e,nL(this,e,t)),this};bt.prototype.removeListener=function(e,t){var r,i,s,o,a;if(typeof t!="function")throw new TypeError('"listener" argument must be a function');if(i=this._events,!i)return this;if(r=i[e],!r)return this;if(r===t||r.listener&&r.listener===t)--this._eventsCount===0?this._events=new nu:(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if(typeof r!="function"){for(s=-1,o=r.length;o-- >0;)if(r[o]===t||r[o].listener&&r[o].listener===t){a=r[o].listener,s=o;break}if(s<0)return this;if(r.length===1){if(r[0]=void 0,--this._eventsCount===0)return this._events=new nu,this;delete i[e]}else Tre(r,s);i.removeListener&&this.emit("removeListener",e,a||t)}return this};bt.prototype.removeAllListeners=function(e){var t,r;if(r=this._events,!r)return this;if(!r.removeListener)return arguments.length===0?(this._events=new nu,this._eventsCount=0):r[e]&&(--this._eventsCount===0?this._events=new nu:delete r[e]),this;if(arguments.length===0){for(var i=Object.keys(r),s=0,o;s<i.length;++s)o=i[s],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=new nu,this._eventsCount=0,this}if(t=r[e],typeof t=="function")this.removeListener(e,t);else if(t)do this.removeListener(e,t[t.length-1]);while(t[0]);return this};bt.prototype.listeners=function(e){var t,r,i=this._events;return i?(t=i[e],t?typeof t=="function"?r=[t.listener||t]:r=Ire(t):r=[]):r=[],r};bt.listenerCount=function(n,e){return typeof n.listenerCount=="function"?n.listenerCount(e):rL.call(n,e)};bt.prototype.listenerCount=rL;function rL(n){var e=this._events;if(e){var t=e[n];if(typeof t=="function")return 1;if(t)return t.length}return 0}bt.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function Tre(n,e){for(var t=e,r=t+1,i=n.length;r<i;t+=1,r+=1)n[t]=n[r];n.pop()}function Ep(n,e){for(var t=new Array(e);e--;)t[e]=n[e];return t}function Ire(n){for(var e=new Array(n.length),t=0;t<e.length;++t)e[t]=n[t].listener||n[t];return e}var G2;typeof Object.create=="function"?G2=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:G2=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e};var cf=G2,Mre=/%[sdj%]/g;function Ore(n){if(!Ux(n)){for(var e=[],t=0;t<arguments.length;t++)e.push(ru(arguments[t]));return e.join(" ")}for(var t=1,r=arguments,i=r.length,s=String(n).replace(Mre,function(a){if(a==="%%")return"%";if(t>=i)return a;switch(a){case"%s":return String(r[t++]);case"%d":return Number(r[t++]);case"%j":try{return JSON.stringify(r[t++])}catch{return"[Circular]"}default:return a}}),o=r[t];t<i;o=r[++t])zx(o)||!Ap(o)?s+=" "+o:s+=" "+ru(o);return s}function iL(n,e){if(Qa(Vc.process))return function(){return iL(n,e).apply(this,arguments)};if(Am.noDeprecation===!0)return n;var t=!1;function r(){if(!t){if(Am.throwDeprecation)throw new Error(e);Am.traceDeprecation?console.trace(e):console.error(e),t=!0}return n.apply(this,arguments)}return r}var lm={},rw;function Pre(n){if(Qa(rw)&&(rw=Am.env.NODE_DEBUG||""),n=n.toUpperCase(),!lm[n])if(new RegExp("\\b"+n+"\\b","i").test(rw)){var e=0;lm[n]=function(){var t=Ore.apply(null,arguments);console.error("%s %d: %s",n,e,t)}}else lm[n]=function(){};return lm[n]}function ru(n,e){var t={seen:[],stylize:Fre};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),sL(e)?t.showHidden=e:e&&zre(t,e),Qa(t.showHidden)&&(t.showHidden=!1),Qa(t.depth)&&(t.depth=2),Qa(t.colors)&&(t.colors=!1),Qa(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=Lre),O1(t,n,t.depth)}ru.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};ru.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function Lre(n,e){var t=ru.styles[e];return t?"\x1B["+ru.colors[t][0]+"m"+n+"\x1B["+ru.colors[t][1]+"m":n}function Fre(n,e){return n}function Nre(n){var e={};return n.forEach(function(t,r){e[t]=!0}),e}function O1(n,e,t){if(n.customInspect&&e&&aw(e.inspect)&&e.inspect!==ru&&!(e.constructor&&e.constructor.prototype===e)){var r=e.inspect(t,n);return Ux(r)||(r=O1(n,r,t)),r}var i=Bre(n,e);if(i)return i;var s=Object.keys(e),o=Nre(s);if(n.showHidden&&(s=Object.getOwnPropertyNames(e)),ow(e)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return iw(e);if(s.length===0){if(aw(e)){var a=e.name?": "+e.name:"";return n.stylize("[Function"+a+"]","special")}if(sw(e))return n.stylize(RegExp.prototype.toString.call(e),"regexp");if(JT(e))return n.stylize(Date.prototype.toString.call(e),"date");if(ow(e))return iw(e)}var u="",l=!1,c=["{","}"];if(jre(e)&&(l=!0,c=["[","]"]),aw(e)){var f=e.name?": "+e.name:"";u=" [Function"+f+"]"}if(sw(e)&&(u=" "+RegExp.prototype.toString.call(e)),JT(e)&&(u=" "+Date.prototype.toUTCString.call(e)),ow(e)&&(u=" "+iw(e)),s.length===0&&(!l||e.length==0))return c[0]+u+c[1];if(t<0)return sw(e)?n.stylize(RegExp.prototype.toString.call(e),"regexp"):n.stylize("[Object]","special");n.seen.push(e);var d;return l?d=qre(n,e,t,o,s):d=s.map(function(g){return K2(n,e,t,o,g,l)}),n.seen.pop(),Wre(d,u,c)}function Bre(n,e){if(Qa(e))return n.stylize("undefined","undefined");if(Ux(e)){var t="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return n.stylize(t,"string")}if($re(e))return n.stylize(""+e,"number");if(sL(e))return n.stylize(""+e,"boolean");if(zx(e))return n.stylize("null","null")}function iw(n){return"["+Error.prototype.toString.call(n)+"]"}function qre(n,e,t,r,i){for(var s=[],o=0,a=e.length;o<a;++o)oL(e,String(o))?s.push(K2(n,e,t,r,String(o),!0)):s.push("");return i.forEach(function(u){u.match(/^\d+$/)||s.push(K2(n,e,t,r,u,!0))}),s}function K2(n,e,t,r,i,s){var o,a,u;if(u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},u.get?u.set?a=n.stylize("[Getter/Setter]","special"):a=n.stylize("[Getter]","special"):u.set&&(a=n.stylize("[Setter]","special")),oL(r,i)||(o="["+i+"]"),a||(n.seen.indexOf(u.value)<0?(zx(t)?a=O1(n,u.value,null):a=O1(n,u.value,t-1),a.indexOf(`
|
|
205
|
-
`)>-1&&(s?a=a.split(`
|
|
206
|
-
`).map(function(l){return" "+l}).join(`
|
|
207
|
-
`).substr(2):a=`
|
|
208
|
-
`+a.split(`
|
|
209
|
-
`).map(function(l){return" "+l}).join(`
|
|
210
|
-
`))):a=n.stylize("[Circular]","special")),Qa(o)){if(s&&i.match(/^\d+$/))return a;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=n.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=n.stylize(o,"string"))}return o+": "+a}function Wre(n,e,t){var r=n.reduce(function(i,s){return s.indexOf(`
|
|
211
|
-
`)>=0,i+s.replace(/\u001b\[\d\d?m/g,"").length+1},0);return r>60?t[0]+(e===""?"":e+`
|
|
212
|
-
`)+" "+n.join(`,
|
|
213
|
-
`)+" "+t[1]:t[0]+e+" "+n.join(", ")+" "+t[1]}function jre(n){return Array.isArray(n)}function sL(n){return typeof n=="boolean"}function zx(n){return n===null}function $re(n){return typeof n=="number"}function Ux(n){return typeof n=="string"}function Qa(n){return n===void 0}function sw(n){return Ap(n)&&Hx(n)==="[object RegExp]"}function Ap(n){return typeof n=="object"&&n!==null}function JT(n){return Ap(n)&&Hx(n)==="[object Date]"}function ow(n){return Ap(n)&&(Hx(n)==="[object Error]"||n instanceof Error)}function aw(n){return typeof n=="function"}function Hx(n){return Object.prototype.toString.call(n)}function zre(n,e){if(!e||!Ap(e))return n;for(var t=Object.keys(e),r=t.length;r--;)n[t[r]]=e[t[r]];return n}function oL(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Cl(){this.head=null,this.tail=null,this.length=0}Cl.prototype.push=function(n){var e={data:n,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length};Cl.prototype.unshift=function(n){var e={data:n,next:this.head};this.length===0&&(this.tail=e),this.head=e,++this.length};Cl.prototype.shift=function(){if(this.length!==0){var n=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,n}};Cl.prototype.clear=function(){this.head=this.tail=null,this.length=0};Cl.prototype.join=function(n){if(this.length===0)return"";for(var e=this.head,t=""+e.data;e=e.next;)t+=n+e.data;return t};Cl.prototype.concat=function(n){if(this.length===0)return he.alloc(0);if(this.length===1)return this.head.data;for(var e=he.allocUnsafe(n>>>0),t=this.head,r=0;t;)t.data.copy(e,r),r+=t.data.length,t=t.next;return e};var Ure=he.isEncoding||function(n){switch(n&&n.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Hre(n){if(n&&!Ure(n))throw new Error("Unknown encoding: "+n)}function Rp(n){switch(this.encoding=(n||"utf8").toLowerCase().replace(/[-_]/,""),Hre(n),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=Gre;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=Kre;break;default:this.write=Vre;return}this.charBuffer=new he(6),this.charReceived=0,this.charLength=0}Rp.prototype.write=function(n){for(var e="";this.charLength;){var t=n.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:n.length;if(n.copy(this.charBuffer,this.charReceived,0,t),this.charReceived+=t,this.charReceived<this.charLength)return"";n=n.slice(t,n.length),e=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var i=e.charCodeAt(e.length-1);if(i>=55296&&i<=56319){this.charLength+=this.surrogateSize,e="";continue}if(this.charReceived=this.charLength=0,n.length===0)return e;break}this.detectIncompleteChar(n);var r=n.length;this.charLength&&(n.copy(this.charBuffer,0,n.length-this.charReceived,r),r-=this.charReceived),e+=n.toString(this.encoding,0,r);var r=e.length-1,i=e.charCodeAt(r);if(i>=55296&&i<=56319){var s=this.surrogateSize;return this.charLength+=s,this.charReceived+=s,this.charBuffer.copy(this.charBuffer,s,0,s),n.copy(this.charBuffer,0,0,s),e.substring(0,r)}return e};Rp.prototype.detectIncompleteChar=function(n){for(var e=n.length>=3?3:n.length;e>0;e--){var t=n[n.length-e];if(e==1&&t>>5==6){this.charLength=2;break}if(e<=2&&t>>4==14){this.charLength=3;break}if(e<=3&&t>>3==30){this.charLength=4;break}}this.charReceived=e};Rp.prototype.end=function(n){var e="";if(n&&n.length&&(e=this.write(n)),this.charReceived){var t=this.charReceived,r=this.charBuffer,i=this.encoding;e+=r.slice(0,t).toString(i)}return e};function Vre(n){return n.toString(this.encoding)}function Gre(n){this.charReceived=n.length%2,this.charLength=this.charReceived?2:0}function Kre(n){this.charReceived=n.length%3,this.charLength=this.charReceived?3:0}hn.ReadableState=aL;var Mt=Pre("stream");cf(hn,bt);function Zre(n,e,t){if(typeof n.prependListener=="function")return n.prependListener(e,t);!n._events||!n._events[e]?n.on(e,t):Array.isArray(n._events[e])?n._events[e].unshift(t):n._events[e]=[t,n._events[e]]}function Xre(n,e){return n.listeners(e).length}function aL(n,e){n=n||{},this.objectMode=!!n.objectMode,e instanceof os&&(this.objectMode=this.objectMode||!!n.readableObjectMode);var t=n.highWaterMark,r=this.objectMode?16:16*1024;this.highWaterMark=t||t===0?t:r,this.highWaterMark=~~this.highWaterMark,this.buffer=new Cl,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=n.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,n.encoding&&(this.decoder=new Rp(n.encoding),this.encoding=n.encoding)}function hn(n){if(!(this instanceof hn))return new hn(n);this._readableState=new aL(n,this),this.readable=!0,n&&typeof n.read=="function"&&(this._read=n.read),bt.call(this)}hn.prototype.push=function(n,e){var t=this._readableState;return!t.objectMode&&typeof n=="string"&&(e=e||t.defaultEncoding,e!==t.encoding&&(n=he.from(n,e),e="")),uL(this,t,n,e,!1)};hn.prototype.unshift=function(n){var e=this._readableState;return uL(this,e,n,"",!0)};hn.prototype.isPaused=function(){return this._readableState.flowing===!1};function uL(n,e,t,r,i){var s=Qre(e,t);if(s)n.emit("error",s);else if(t===null)e.reading=!1,eie(n,e);else if(e.objectMode||t&&t.length>0)if(e.ended&&!i){var o=new Error("stream.push() after EOF");n.emit("error",o)}else if(e.endEmitted&&i){var a=new Error("stream.unshift() after end event");n.emit("error",a)}else{var u;e.decoder&&!i&&!r&&(t=e.decoder.write(t),u=!e.objectMode&&t.length===0),i||(e.reading=!1),u||(e.flowing&&e.length===0&&!e.sync?(n.emit("data",t),n.read(0)):(e.length+=e.objectMode?1:t.length,i?e.buffer.unshift(t):e.buffer.push(t),e.needReadable&&ky(n))),tie(n,e)}else i||(e.reading=!1);return Yre(e)}function Yre(n){return!n.ended&&(n.needReadable||n.length<n.highWaterMark||n.length===0)}hn.prototype.setEncoding=function(n){return this._readableState.decoder=new Rp(n),this._readableState.encoding=n,this};var QT=8388608;function Jre(n){return n>=QT?n=QT:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function eI(n,e){return n<=0||e.length===0&&e.ended?0:e.objectMode?1:n!==n?e.flowing&&e.length?e.buffer.head.data.length:e.length:(n>e.highWaterMark&&(e.highWaterMark=Jre(n)),n<=e.length?n:e.ended?e.length:(e.needReadable=!0,0))}hn.prototype.read=function(n){Mt("read",n),n=parseInt(n,10);var e=this._readableState,t=n;if(n!==0&&(e.emittedReadable=!1),n===0&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return Mt("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?uw(this):ky(this),null;if(n=eI(n,e),n===0&&e.ended)return e.length===0&&uw(this),null;var r=e.needReadable;Mt("need readable",r),(e.length===0||e.length-n<e.highWaterMark)&&(r=!0,Mt("length less than watermark",r)),e.ended||e.reading?(r=!1,Mt("reading or ended",r)):r&&(Mt("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(n=eI(t,e)));var i;return n>0?i=lL(n,e):i=null,i===null?(e.needReadable=!0,n=0):e.length-=n,e.length===0&&(e.ended||(e.needReadable=!0),t!==n&&e.ended&&uw(this)),i!==null&&this.emit("data",i),i};function Qre(n,e){var t=null;return!X8(e)&&typeof e!="string"&&e!==null&&e!==void 0&&!n.objectMode&&(t=new TypeError("Invalid non-string/buffer chunk")),t}function eie(n,e){if(!e.ended){if(e.decoder){var t=e.decoder.end();t&&t.length&&(e.buffer.push(t),e.length+=e.objectMode?1:t.length)}e.ended=!0,ky(n)}}function ky(n){var e=n._readableState;e.needReadable=!1,e.emittedReadable||(Mt("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?Zr(tI,n):tI(n))}function tI(n){Mt("emit readable"),n.emit("readable"),Vx(n)}function tie(n,e){e.readingMore||(e.readingMore=!0,Zr(nie,n,e))}function nie(n,e){for(var t=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(Mt("maybeReadMore read 0"),n.read(0),t!==e.length);)t=e.length;e.readingMore=!1}hn.prototype._read=function(n){this.emit("error",new Error("not implemented"))};hn.prototype.pipe=function(n,e){var t=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=n;break;case 1:r.pipes=[r.pipes,n];break;default:r.pipes.push(n);break}r.pipesCount+=1,Mt("pipe count=%d opts=%j",r.pipesCount,e);var i=!e||e.end!==!1,s=i?a:c;r.endEmitted?Zr(s):t.once("end",s),n.on("unpipe",o);function o(w){Mt("onunpipe"),w===t&&c()}function a(){Mt("onend"),n.end()}var u=rie(t);n.on("drain",u);var l=!1;function c(){Mt("cleanup"),n.removeListener("close",m),n.removeListener("finish",y),n.removeListener("drain",u),n.removeListener("error",g),n.removeListener("unpipe",o),t.removeListener("end",a),t.removeListener("end",c),t.removeListener("data",d),l=!0,r.awaitDrain&&(!n._writableState||n._writableState.needDrain)&&u()}var f=!1;t.on("data",d);function d(w){Mt("ondata"),f=!1;var x=n.write(w);x===!1&&!f&&((r.pipesCount===1&&r.pipes===n||r.pipesCount>1&&cL(r.pipes,n)!==-1)&&!l&&(Mt("false write response, pause",t._readableState.awaitDrain),t._readableState.awaitDrain++,f=!0),t.pause())}function g(w){Mt("onerror",w),b(),n.removeListener("error",g),Xre(n,"error")===0&&n.emit("error",w)}Zre(n,"error",g);function m(){n.removeListener("finish",y),b()}n.once("close",m);function y(){Mt("onfinish"),n.removeListener("close",m),b()}n.once("finish",y);function b(){Mt("unpipe"),t.unpipe(n)}return n.emit("pipe",t),r.flowing||(Mt("pipe resume"),t.resume()),n};function rie(n){return function(){var e=n._readableState;Mt("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,e.awaitDrain===0&&n.listeners("data").length&&(e.flowing=!0,Vx(n))}}hn.prototype.unpipe=function(n){var e=this._readableState;if(e.pipesCount===0)return this;if(e.pipesCount===1)return n&&n!==e.pipes?this:(n||(n=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,n&&n.emit("unpipe",this),this);if(!n){var t=e.pipes,r=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i<r;i++)t[i].emit("unpipe",this);return this}var s=cL(e.pipes,n);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),n.emit("unpipe",this),this)};hn.prototype.on=function(n,e){var t=bt.prototype.on.call(this,n,e);if(n==="data")this._readableState.flowing!==!1&&this.resume();else if(n==="readable"){var r=this._readableState;!r.endEmitted&&!r.readableListening&&(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&ky(this):Zr(iie,this))}return t};hn.prototype.addListener=hn.prototype.on;function iie(n){Mt("readable nexttick read 0"),n.read(0)}hn.prototype.resume=function(){var n=this._readableState;return n.flowing||(Mt("resume"),n.flowing=!0,sie(this,n)),this};function sie(n,e){e.resumeScheduled||(e.resumeScheduled=!0,Zr(oie,n,e))}function oie(n,e){e.reading||(Mt("resume read 0"),n.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,n.emit("resume"),Vx(n),e.flowing&&!e.reading&&n.read(0)}hn.prototype.pause=function(){return Mt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Mt("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function Vx(n){var e=n._readableState;for(Mt("flow",e.flowing);e.flowing&&n.read()!==null;);}hn.prototype.wrap=function(n){var e=this._readableState,t=!1,r=this;n.on("end",function(){if(Mt("wrapped end"),e.decoder&&!e.ended){var o=e.decoder.end();o&&o.length&&r.push(o)}r.push(null)}),n.on("data",function(o){if(Mt("wrapped data"),e.decoder&&(o=e.decoder.write(o)),!(e.objectMode&&o==null)&&!(!e.objectMode&&(!o||!o.length))){var a=r.push(o);a||(t=!0,n.pause())}});for(var i in n)this[i]===void 0&&typeof n[i]=="function"&&(this[i]=function(o){return function(){return n[o].apply(n,arguments)}}(i));var s=["error","close","destroy","pause","resume"];return fie(s,function(o){n.on(o,r.emit.bind(r,o))}),r._read=function(o){Mt("wrapped _read",o),t&&(t=!1,n.resume())},r};hn._fromList=lL;function lL(n,e){if(e.length===0)return null;var t;return e.objectMode?t=e.buffer.shift():!n||n>=e.length?(e.decoder?t=e.buffer.join(""):e.buffer.length===1?t=e.buffer.head.data:t=e.buffer.concat(e.length),e.buffer.clear()):t=aie(n,e.buffer,e.decoder),t}function aie(n,e,t){var r;return n<e.head.data.length?(r=e.head.data.slice(0,n),e.head.data=e.head.data.slice(n)):n===e.head.data.length?r=e.shift():r=t?uie(n,e):lie(n,e),r}function uie(n,e){var t=e.head,r=1,i=t.data;for(n-=i.length;t=t.next;){var s=t.data,o=n>s.length?s.length:n;if(o===s.length?i+=s:i+=s.slice(0,n),n-=o,n===0){o===s.length?(++r,t.next?e.head=t.next:e.head=e.tail=null):(e.head=t,t.data=s.slice(o));break}++r}return e.length-=r,i}function lie(n,e){var t=he.allocUnsafe(n),r=e.head,i=1;for(r.data.copy(t),n-=r.data.length;r=r.next;){var s=r.data,o=n>s.length?s.length:n;if(s.copy(t,t.length-n,0,o),n-=o,n===0){o===s.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=s.slice(o));break}++i}return e.length-=i,t}function uw(n){var e=n._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,Zr(cie,e,n))}function cie(n,e){!n.endEmitted&&n.length===0&&(n.endEmitted=!0,e.readable=!1,e.emit("end"))}function fie(n,e){for(var t=0,r=n.length;t<r;t++)e(n[t],t)}function cL(n,e){for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t;return-1}cr.WritableState=Gx;cf(cr,bt);function hie(){}function die(n,e,t){this.chunk=n,this.encoding=e,this.callback=t,this.next=null}function Gx(n,e){Object.defineProperty(this,"buffer",{get:iL(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),n=n||{},this.objectMode=!!n.objectMode,e instanceof os&&(this.objectMode=this.objectMode||!!n.writableObjectMode);var t=n.highWaterMark,r=this.objectMode?16:16*1024;this.highWaterMark=t||t===0?t:r,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=n.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=n.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(s){wie(e,s)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new pL(this)}Gx.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t};function cr(n){if(!(this instanceof cr)&&!(this instanceof os))return new cr(n);this._writableState=new Gx(n,this),this.writable=!0,n&&(typeof n.write=="function"&&(this._write=n.write),typeof n.writev=="function"&&(this._writev=n.writev)),bt.call(this)}cr.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function pie(n,e){var t=new Error("write after end");n.emit("error",t),Zr(e,t)}function gie(n,e,t,r){var i=!0,s=!1;return t===null?s=new TypeError("May not write null values to stream"):!he.isBuffer(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(s=new TypeError("Invalid non-string/buffer chunk")),s&&(n.emit("error",s),Zr(r,s),i=!1),i}cr.prototype.write=function(n,e,t){var r=this._writableState,i=!1;return typeof e=="function"&&(t=e,e=null),he.isBuffer(n)?e="buffer":e||(e=r.defaultEncoding),typeof t!="function"&&(t=hie),r.ended?pie(this,t):gie(this,r,n,t)&&(r.pendingcb++,i=yie(this,r,n,e,t)),i};cr.prototype.cork=function(){var n=this._writableState;n.corked++};cr.prototype.uncork=function(){var n=this._writableState;n.corked&&(n.corked--,!n.writing&&!n.corked&&!n.finished&&!n.bufferProcessing&&n.bufferedRequest&&fL(this,n))};cr.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this};function mie(n,e,t){return!n.objectMode&&n.decodeStrings!==!1&&typeof e=="string"&&(e=he.from(e,t)),e}function yie(n,e,t,r,i){t=mie(e,t,r),he.isBuffer(t)&&(r="buffer");var s=e.objectMode?1:t.length;e.length+=s;var o=e.length<e.highWaterMark;if(o||(e.needDrain=!0),e.writing||e.corked){var a=e.lastBufferedRequest;e.lastBufferedRequest=new die(t,r,i),a?a.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else Z2(n,e,!1,s,t,r,i);return o}function Z2(n,e,t,r,i,s,o){e.writelen=r,e.writecb=o,e.writing=!0,e.sync=!0,t?n._writev(i,e.onwrite):n._write(i,s,e.onwrite),e.sync=!1}function vie(n,e,t,r,i){--e.pendingcb,t?Zr(i,r):i(r),n._writableState.errorEmitted=!0,n.emit("error",r)}function bie(n){n.writing=!1,n.writecb=null,n.length-=n.writelen,n.writelen=0}function wie(n,e){var t=n._writableState,r=t.sync,i=t.writecb;if(bie(t),e)vie(n,t,r,e,i);else{var s=hL(t);!s&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&fL(n,t),r?Zr(nI,n,t,s,i):nI(n,t,s,i)}}function nI(n,e,t,r){t||_ie(n,e),e.pendingcb--,r(),dL(n,e)}function _ie(n,e){e.length===0&&e.needDrain&&(e.needDrain=!1,n.emit("drain"))}function fL(n,e){e.bufferProcessing=!0;var t=e.bufferedRequest;if(n._writev&&t&&t.next){var r=e.bufferedRequestCount,i=new Array(r),s=e.corkedRequestsFree;s.entry=t;for(var o=0;t;)i[o]=t,t=t.next,o+=1;Z2(n,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new pL(e)}else{for(;t;){var a=t.chunk,u=t.encoding,l=t.callback,c=e.objectMode?1:a.length;if(Z2(n,e,!1,c,a,u,l),t=t.next,e.writing)break}t===null&&(e.lastBufferedRequest=null)}e.bufferedRequestCount=0,e.bufferedRequest=t,e.bufferProcessing=!1}cr.prototype._write=function(n,e,t){t(new Error("not implemented"))};cr.prototype._writev=null;cr.prototype.end=function(n,e,t){var r=this._writableState;typeof n=="function"?(t=n,n=null,e=null):typeof e=="function"&&(t=e,e=null),n!=null&&this.write(n,e),r.corked&&(r.corked=1,this.uncork()),!r.ending&&!r.finished&&kie(this,r,t)};function hL(n){return n.ending&&n.length===0&&n.bufferedRequest===null&&!n.finished&&!n.writing}function rI(n,e){e.prefinished||(e.prefinished=!0,n.emit("prefinish"))}function dL(n,e){var t=hL(e);return t&&(e.pendingcb===0?(rI(n,e),e.finished=!0,n.emit("finish")):rI(n,e)),t}function kie(n,e,t){e.ending=!0,dL(n,e),t&&(e.finished?Zr(t):n.once("finish",t)),e.ended=!0,n.writable=!1}function pL(n){var e=this;this.next=null,this.entry=null,this.finish=function(t){var r=e.entry;for(e.entry=null;r;){var i=r.callback;n.pendingcb--,i(t),r=r.next}n.corkedRequestsFree?n.corkedRequestsFree.next=e:n.corkedRequestsFree=e}}cf(os,hn);var iI=Object.keys(cr.prototype);for(var lw=0;lw<iI.length;lw++){var cw=iI[lw];os.prototype[cw]||(os.prototype[cw]=cr.prototype[cw])}function os(n){if(!(this instanceof os))return new os(n);hn.call(this,n),cr.call(this,n),n&&n.readable===!1&&(this.readable=!1),n&&n.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,n&&n.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",xie)}function xie(){this.allowHalfOpen||this._writableState.ended||Zr(Sie,this)}function Sie(n){n.end()}cf(xo,os);function Cie(n){this.afterTransform=function(e,t){return Eie(n,e,t)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function Eie(n,e,t){var r=n._transformState;r.transforming=!1;var i=r.writecb;if(!i)return n.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,t!=null&&n.push(t),i(e);var s=n._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&n._read(s.highWaterMark)}function xo(n){if(!(this instanceof xo))return new xo(n);os.call(this,n),this._transformState=new Cie(this);var e=this;this._readableState.needReadable=!0,this._readableState.sync=!1,n&&(typeof n.transform=="function"&&(this._transform=n.transform),typeof n.flush=="function"&&(this._flush=n.flush)),this.once("prefinish",function(){typeof this._flush=="function"?this._flush(function(t){sI(e,t)}):sI(e)})}xo.prototype.push=function(n,e){return this._transformState.needTransform=!1,os.prototype.push.call(this,n,e)};xo.prototype._transform=function(n,e,t){throw new Error("Not implemented")};xo.prototype._write=function(n,e,t){var r=this._transformState;if(r.writecb=t,r.writechunk=n,r.writeencoding=e,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};xo.prototype._read=function(n){var e=this._transformState;e.writechunk!==null&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};function sI(n,e){if(e)return n.emit("error",e);var t=n._writableState,r=n._transformState;if(t.length)throw new Error("Calling transform done when ws.length != 0");if(r.transforming)throw new Error("Calling transform done when still transforming");return n.push(null)}cf(tp,xo);function tp(n){if(!(this instanceof tp))return new tp(n);xo.call(this,n)}tp.prototype._transform=function(n,e,t){t(null,n)};cf(pa,bt);pa.Readable=hn;pa.Writable=cr;pa.Duplex=os;pa.Transform=xo;pa.PassThrough=tp;pa.Stream=pa;function pa(){bt.call(this)}pa.prototype.pipe=function(n,e){var t=this;function r(c){n.writable&&n.write(c)===!1&&t.pause&&t.pause()}t.on("data",r);function i(){t.readable&&t.resume&&t.resume()}n.on("drain",i),!n._isStdio&&(!e||e.end!==!1)&&(t.on("end",o),t.on("close",a));var s=!1;function o(){s||(s=!0,n.end())}function a(){s||(s=!0,typeof n.destroy=="function"&&n.destroy())}function u(c){if(l(),bt.listenerCount(this,"error")===0)throw c}t.on("error",u),n.on("error",u);function l(){t.removeListener("data",r),n.removeListener("drain",i),t.removeListener("end",o),t.removeListener("close",a),t.removeListener("error",u),n.removeListener("error",u),t.removeListener("end",l),t.removeListener("close",l),n.removeListener("close",l)}return t.on("end",l),t.on("close",l),n.on("close",l),n.emit("pipe",t),n};var oI=function(n){_a(e,n);function e(t,r,i){fr(this,e);var s=wa(this,(e.__proto__||Vt(e)).call(this,{highWaterMark:r.highWaterMark,encoding:r.encoding}));return s._fs=i,s.bytesRead=0,s.path=t,s.fd=r.fd===void 0?null:r.fd,s.flags=r.flags===void 0?"r":r.flags,s.mode=r.mode===void 0?Vi:r.mode,s.autoClose=r.autoClose===void 0?!0:r.autoClose,s.start=r.start,s.end=r.end===void 0?1/0:r.end,s.pos=r.start,typeof s.fd!="number"&&s._open(),nr(e.prototype.__proto__||Vt(e.prototype),"on",s).call(s,"end",function(){s.autoClose&&s.destroy()}),s}return Rr(e,[{key:"_open",value:function(){var r=this;this._fs.open(this.path,this.flags,this.mode,function(i,s){if(i){r.autoClose&&r.destroy(),nr(e.prototype.__proto__||Vt(e.prototype),"emit",r).call(r,"error",i);return}r.fd=s,nr(e.prototype.__proto__||Vt(e.prototype),"emit",r).call(r,"open",s),nr(e.prototype.__proto__||Vt(e.prototype),"read",r).call(r)})}},{key:"_read",value:function(r){var i=this;if(typeof this.fd!="number"){nr(e.prototype.__proto__||Vt(e.prototype),"once",this).call(this,"open",function(){i._read(r)});return}if(!this.destroyed){if(this.pos!=null&&(r=Math.min(this.end-this.pos+1,r)),r<=0){this.push(null);return}this._fs.read(this.fd,he.allocUnsafe(r),0,r,this.pos,function(s,o,a){if(s){i.autoClose&&i.destroy(),nr(e.prototype.__proto__||Vt(e.prototype),"emit",i).call(i,"error",s);return}o>0?(i.bytesRead+=o,i.push(a.slice(0,o))):i.push(null)}),this.pos!=null&&(this.pos+=r)}}},{key:"_destroy",value:function(r,i){this._close(function(s){i(r||s)})}},{key:"_close",value:function(r){var i=this;if(r&&nr(e.prototype.__proto__||Vt(e.prototype),"once",this).call(this,"close",r),typeof this.fd!="number"){nr(e.prototype.__proto__||Vt(e.prototype),"once",this).call(this,"open",function(){i._close()});return}if(this.closed)return Zr(function(){return nr(e.prototype.__proto__||Vt(e.prototype),"emit",i).call(i,"close")});this.closed=!0,this._fs.close(this.fd,function(s){s?i.emit("error",s):i.emit("close")}),this.fd=null}}]),e}(hn),aI=function(n){_a(e,n);function e(t,r,i){fr(this,e);var s=wa(this,(e.__proto__||Vt(e)).call(this,{highWaterMark:r.highWaterMark}));return s._fs=i,s.bytesWritten=0,s.path=t,s.fd=r.fd===void 0?null:r.fd,s.flags=r.flags===void 0?"w":r.flags,s.mode=r.mode===void 0?Vi:r.mode,s.autoClose=r.autoClose===void 0?!0:r.autoClose,s.start=r.start,s.pos=s.start,r.encoding&&nr(e.prototype.__proto__||Vt(e.prototype),"setDefaultEncoding",s).call(s,r.encoding),typeof s.fd!="number"&&s._open(),nr(e.prototype.__proto__||Vt(e.prototype),"on",s).call(s,"finish",function(){s.autoClose&&s.destroy()}),s}return Rr(e,[{key:"_open",value:function(){var r=this;this._fs.open(this.path,this.flags,this.mode,function(i,s){if(i){r.autoClose&&r.destroy(),nr(e.prototype.__proto__||Vt(e.prototype),"emit",r).call(r,"error",i);return}r.fd=s,nr(e.prototype.__proto__||Vt(e.prototype),"emit",r).call(r,"open",s)})}},{key:"_write",value:function(r,i,s){var o=this;if(typeof this.fd!="number")return nr(e.prototype.__proto__||Vt(e.prototype),"once",this).call(this,"open",function(){o._write(r,i,s)});this._fs.write(this.fd,r,0,r.length,this.pos,function(a,u){if(a){o.autoClose&&o.destroy(),s(a);return}o.bytesWritten+=u,s()}),this.pos!==void 0&&(this.pos+=r.length)}},{key:"_writev",value:function(r,i){this._write(he.concat(r.map(function(s){return s.chunk})),void 0,i)}},{key:"_destroy",value:function(r,i){this._close(function(s){i(r||s)})}},{key:"_close",value:function(r){var i=this;if(r&&nr(e.prototype.__proto__||Vt(e.prototype),"once",this).call(this,"close",r),typeof this.fd!="number"){nr(e.prototype.__proto__||Vt(e.prototype),"once",this).call(this,"open",function(){i._close()});return}if(this.closed)return Zr(function(){return nr(e.prototype.__proto__||Vt(e.prototype),"emit",i).call(i,"close")});this.closed=!0,this._fs.close(this.fd,function(s){s?i.emit("error",s):i.emit("close")}),this.fd=null}},{key:"_final",value:function(r){r()}}]),e}(cr),uI=Hb.posix?Hb.posix.join:Hb.join,nt=function(e){if(e)throw e},gL=function(){function n(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:18,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Bx,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new X4(r),s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:new J4(i);fr(this,n);var o=void 0;if(typeof t=="number"){if(o=i.getINode(t),!(o instanceof cn))throw TypeError("rootIndex must point to a root directory")}else{var a=i.createINode(cn,{mode:Ene,uid:eo,gid:B2}),u=si(a,1);o=u[0]}this._uid=eo,this._gid=B2,this._umask=e,this._devMgr=r,this._iNodeMgr=i,this._fdMgr=s,this._root=o,this._cwd=new Cne(i,o),this.constants=se,this.ReadStream=oI,this.WriteStream=aI}return Rr(n,[{key:"getUmask",value:function(){return this._umask}},{key:"setUmask",value:function(t){this._umask=t}},{key:"getUid",value:function(){return this._uid}},{key:"setUid",value:function(t){this._uid=t}},{key:"getGid",value:function(){return this._gid}},{key:"setGid",value:function(t){this._gid=t}},{key:"getCwd",value:function(){return this._cwd.getPath()}},{key:"chdir",value:function(t){t=this._getPath(t);var r=this._navigate(t,!0);if(!r.target)throw new le(fe.ENOENT,t);if(!(r.target instanceof cn))throw new le(fe.ENOTDIR,t);if(!this._checkPermissions(se.X_OK,r.target.getMetadata()))throw new le(fe.EACCES,t);this._cwd.changeDir(r.target,r.pathStack)}},{key:"access",value:function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];var o=i.findIndex(function(u){return typeof u=="function"}),a=i[o]||nt;o=o>=0?o:i.length,this._callAsync(this.accessSync.bind(this),[t].concat(ln(i.slice(0,o))),a,a)}},{key:"accessSync",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:se.F_OK;t=this._getPath(t);var i=this._navigate(t,!0).target;if(!i)throw new le(fe.ENOENT,t);if(r!==se.F_OK&&!this._checkPermissions(r,i.getMetadata()))throw new le(fe.EACCES,t)}},{key:"appendFile",value:function(t,r){for(var i=arguments.length,s=Array(i>2?i-2:0),o=2;o<i;o++)s[o-2]=arguments[o];var a=s.findIndex(function(l){return typeof l=="function"}),u=s[a]||nt;a=a>=0?a:s.length,this._callAsync(this.appendFileSync.bind(this),[t,r].concat(ln(s.slice(0,a))),u,u)}},{key:"appendFileSync",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"undefined",i=arguments[2];i=this._getOptions({encoding:"utf8",mode:Vi,flag:"a"},i),r=this._getBuffer(r,i.encoding);var s=void 0;try{var o=void 0;if(typeof t=="number"){if(o=this._fdMgr.getFd(t),!o)throw new le(fe.EBADF,null,null,"appendFile");if(!(o.getFlags()&(se.O_WRONLY|se.O_RDWR)))throw new le(fe.EBADF,null,null,"appendFile")}else{var a=this._openSync(t,i.flag,i.mode),u=si(a,2);o=u[0],s=u[1]}try{o.write(r,null,se.O_APPEND)}catch(l){throw l instanceof RangeError?new le(fe.EFBIG,null,null,"appendFile"):l}}finally{s!==void 0&&this.closeSync(s)}}},{key:"chmod",value:function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nt;this._callAsync(this.chmodSync.bind(this),[t,r],i,i)}},{key:"chmodSync",value:function(t,r){t=this._getPath(t);var i=this._navigate(t,!0).target;if(!i)throw new le(fe.ENOENT,t);if(typeof r!="number")throw new TypeError("mode must be an integer");var s=i.getMetadata();if(this._uid!==eo&&this._uid!==s.uid)throw new le(fe.EPERM,null,null,"chmod");s.mode=s.mode&se.S_IFMT|r}},{key:"chown",value:function(t,r,i){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:nt;this._callAsync(this.chownSync.bind(this),[t,r,i],s,s)}},{key:"chownSync",value:function(t,r,i){t=this._getPath(t);var s=this._navigate(t,!0).target;if(!s)throw new le(fe.ENOENT,t);var o=s.getMetadata();if(this._uid!==eo){if(o.uid!==this._uid)throw new le(fe.EPERM,null,null,"chown");if(this._uid!==r)throw new le(fe.EPERM,null,null,"chown")}typeof r=="number"&&(o.uid=r),typeof i=="number"&&(o.gid=i)}},{key:"chownr",value:function(t,r,i){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:nt;this._callAsync(this.chownrSync.bind(this),[t,r,i],s,s)}},{key:"chownrSync",value:function(t,r,i){var s=this;t=this._getPath(t),this.chownSync(t,r,i);var o=void 0;try{o=this.readdirSync(t)}catch(a){if(a&&a.code==="ENOTDIR")return;throw a}o.forEach(function(a){var u=uI(t,a);s.lstatSync(u).isSymbolicLink()||s.chownrSync(u,r,i)})}},{key:"close",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nt;this._callAsync(this.closeSync.bind(this),[t],r,r)}},{key:"closeSync",value:function(t){if(!this._fdMgr.getFd(t))throw new le(fe.EBADF,null,null,"close");this._fdMgr.deleteFd(t)}},{key:"copyFile",value:function(t,r){for(var i=arguments.length,s=Array(i>2?i-2:0),o=2;o<i;o++)s[o-2]=arguments[o];var a=s.findIndex(function(l){return typeof l=="function"}),u=s[a]||nt;a=a>=0?a:s.length,this._callAsync(this.copyFileSync.bind(this),[t,r].concat(ln(s.slice(0,a))),u,u)}},{key:"copyFileSync",value:function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;t=this._getPath(t),r=this._getPath(r);var s=void 0,o=void 0,a=void 0,u=void 0;try{var l=this._openSync(t,se.O_RDONLY),c=si(l,2);s=c[0],o=c[1];var f=s.getINode();if(f instanceof cn)throw new le(fe.EBADF,t,r);var d=se.WRONLY|se.O_CREAT;i&se.COPYFILE_EXCL&&(d|=se.O_EXCL);var g=this._openSync(r,d,f.getMetadata().mode),m=si(g,2);a=m[0],u=m[1];var y=a.getINode();if(y instanceof Ri)y.setData(YT(f.getData()));else throw new le(fe.EINVAL,t,r)}finally{o!==void 0&&this.closeSync(o),u!==void 0&&this.closeSync(u)}}},{key:"createReadStream",value:function(t,r){if(t=this._getPath(t),r=this._getOptions({flags:"r",encoding:null,fd:null,mode:Vi,autoClose:!0,end:1/0},r),r.start!==void 0&&r.start>r.end)throw new RangeError("ERR_VALUE_OUT_OF_RANGE");return new oI(t,r,this)}},{key:"createWriteStream",value:function(t,r){if(t=this._getPath(t),r=this._getOptions({flags:"w",defaultEncoding:"utf8",fd:null,mode:Vi,autoClose:!0},r),r.start!==void 0&&r.start<0)throw new RangeError("ERR_VALUE_OUT_OF_RANGE");return new aI(t,r,this)}},{key:"exists",value:function(t,r){r||(r=function(){}),this._callAsync(this.existsSync.bind(this),[t],r,r)}},{key:"existsSync",value:function(t){t=this._getPath(t);try{return!!this._navigate(t,!0).target}catch{return!1}}},{key:"fallocate",value:function(t,r,i){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:nt;this._callAsync(this.fallocateSync.bind(this),[t,r,i],s,s)}},{key:"fallocateSync",value:function(t,r,i){if(r<0||i<=0)throw new le(fe.EINVAL,null,null,"fallocate");var s=this._fdMgr.getFd(t);if(!s)throw new le(fe.EBADF,null,null,"fallocate");var o=s.getINode();if(!(o instanceof Ri))throw new le(fe.ENODEV,null,null,"fallocate");if(!(s.getFlags()&(se.O_WRONLY|se.O_RDWR)))throw new le(fe.EBADF,null,null,"fallocate");var a=o.getData(),u=o.getMetadata();if(r+i>a.length){var l=void 0;try{l=M1(a,r+i-a.length)}catch(c){throw c instanceof RangeError?new le(fe.EFBIG,null,null,"fallocate"):c}o.setData(l),u.size=l.length}u.ctime=new Date}},{key:"mmap",value:function(t,r,i){for(var s=arguments.length,o=Array(s>3?s-3:0),a=3;a<s;a++)o[a-3]=arguments[a];var u=o.findIndex(function(c){return typeof c=="function"}),l=o[u]||nt;u=u>=0?u:o.length,this._callAsync(this.mmapSync.bind(this),[t,r,i].concat(ln(o.slice(0,u))),function(c){return l(null,c)},l)}},{key:"mmapSync",value:function(t,r,i){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(t<1||s<0)throw new le(fe.EINVAL,null,null,"mmap");var o=this._fdMgr.getFd(i);if(!o)throw new le(fe.EBADF,null,null,"mmap");var a=o.getFlags()&se.O_ACCMODE;if(a===se.O_WRONLY)throw new le(fe.EACCES,null,null,"mmap");var u=o.getINode();if(!(u instanceof Ri))throw new le(fe.ENODEV,null,null,"mmap");switch(r){case se.MAP_PRIVATE:return YT(u.getData().slice(s,s+t));case se.MAP_SHARED:if(a!==se.O_RDWR)throw new le(fe.EACCES,null,null,"mmap");return wne(u,"_data").slice(s,s+t);default:throw new le(fe.EINVAL,null,null,"mmap")}}},{key:"fchmod",value:function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nt;this._callAsync(this.fchmodSync.bind(this),[t,r],i,i)}},{key:"fchmodSync",value:function(t,r){var i=this._fdMgr.getFd(t);if(!i)throw new le(fe.EBADF,null,null,"fchmod");if(typeof r!="number")throw new TypeError("mode must be an integer");var s=i.getINode().getMetadata();if(this._uid!==eo&&this._uid!==s.uid)throw new le(fe.EPERM,null,null,"fchmod");s.mode=s.mode&se.S_IMFT|r}},{key:"fchown",value:function(t,r,i){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:nt;this._callAsync(this.fchmodSync.bind(this),[t,r,i],s,s)}},{key:"fchownSync",value:function(t,r,i){var s=this._fdMgr.getFd(t);if(!s)throw new le(fe.EBADF,null,null,"fchown");var o=s.getINode().getMetadata();if(this._uid!==eo){if(o.uid!==this._uid)throw new le(fe.EPERM,null,null,"fchown");if(this._uid!==r)throw new le(fe.EPERM,null,null,"fchown")}typeof r=="number"&&(o.uid=r),typeof i=="number"&&(o.gid=i)}},{key:"fdatasync",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nt;this._callAsync(this.fchmodSync.bind(this),[t],r,r)}},{key:"fdatasyncSync",value:function(t){if(!this._fdMgr.getFd(t))throw new le(fe.EBADF,null,null,"fdatasync")}},{key:"fstat",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nt;this._callAsync(this.fstatSync.bind(this),[t],function(i){return r(null,i)},r)}},{key:"fstatSync",value:function(t){var r=this._fdMgr.getFd(t);if(!r)throw new le(fe.EBADF,null,null,"fstat");return new Rm(fc({},r.getINode().getMetadata()))}},{key:"fsync",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nt;this._callAsync(this.fsyncSync.bind(this),[t],r,r)}},{key:"fsyncSync",value:function(t){if(!this._fdMgr.getFd(t))throw new le(fe.EBADF,null,null,"fsync")}},{key:"ftruncate",value:function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];var o=i.findIndex(function(u){return typeof u=="function"}),a=i[o]||nt;o=o>=0?o:i.length,this._callAsync(this.ftruncateSync.bind(this),[t].concat(ln(i.slice(0,o))),a,a)}},{key:"ftruncateSync",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(r<0)throw new le(fe.EINVAL,null,null,"ftruncate");var i=this._fdMgr.getFd(t);if(!i)throw new le(fe.EBADF,null,null,"ftruncate");var s=i.getINode();if(!(s instanceof Ri))throw new le(fe.EINVAL,null,null,"ftruncate");if(!(i.getFlags()&(se.O_WRONLY|se.O_RDWR)))throw new le(fe.EINVAL,null,null,"ftruncate");var o=s.getData(),a=s.getMetadata(),u=void 0;try{r>o.length?(u=M1(o,r),s.setData(u)):r<o.length?(o.resize(r),s.setData(u)):u=o}catch(c){throw c instanceof RangeError?new le(fe.EFBIG,null,null,"ftruncate"):c}var l=new Date;a.mtime=l,a.ctime=l,a.size=u.length,i.setPos(Math.min(u.length,i.getPos()))}},{key:"futimes",value:function(t,r,i){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:nt;this._callAsync(this.futimesSync.bind(this),[t,r,i],s,s)}},{key:"futimesSync",value:function(t,r,i){var s=this._fdMgr.getFd(t);if(!s)throw new le(fe.EBADF,null,null,"futimes");var o=s.getINode().getMetadata(),a=void 0,u=void 0;if(typeof r=="number")a=new Date(r*1e3);else if(typeof r=="string")a=new Date(parseInt(r)*1e3);else if(r instanceof Date)a=r;else throw TypeError("atime and mtime must be dates or unixtime in seconds");if(typeof i=="number")u=new Date(i*1e3);else if(typeof i=="string")u=new Date(parseInt(i)*1e3);else if(i instanceof Date)u=i;else throw TypeError("atime and mtime must be dates or unixtime in seconds");o.atime=a,o.mtime=u,o.ctime=new Date}},{key:"lchmod",value:function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nt;this._callAsync(this.lchmodSync.bind(this),[t,r],i,i)}},{key:"lchmodSync",value:function(t,r){t=this._getPath(t);var i=this._navigate(t,!1).target;if(!i)throw new le(fe.ENOENT,t);if(typeof r!="number")throw new TypeError("mode must be an integer");var s=i.getMetadata();if(this._uid!==eo&&this._uid!==s.uid)throw new le(fe.EPERM,null,null,"lchmod");s.mode=s.mode&se.S_IFMT|r}},{key:"lchown",value:function(t,r,i){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:nt;this._callAsync(this.lchownSync.bind(this),[t,r,i],s,s)}},{key:"lchownSync",value:function(t,r,i){t=this._getPath(t);var s=this._navigate(t,!1).target;if(!s)throw new le(fe.ENOENT,t);var o=s.getMetadata();if(this._uid!==eo){if(o.uid!==this._uid)throw new le(fe.EPERM,null,null,"lchown");if(this._uid!==r)throw new le(fe.EPERM,null,null,"lchown")}typeof r=="number"&&(o.uid=r),typeof i=="number"&&(o.gid=i)}},{key:"link",value:function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nt;this._callAsync(this.linkSync.bind(this),[t,r],i,i)}},{key:"linkSync",value:function(t,r){t=this._getPath(t),r=this._getPath(r);var i=void 0,s=void 0;if(i=this._navigate(t,!1),s=this._navigate(r,!1),!i.target)throw new le(fe.ENOENT,t,r,"link");if(i.target instanceof cn)throw new le(fe.EPERM,t,r,"link");if(s.target)throw new le(fe.EEXIST,t,r,"link");if(s.dir.getMetadata().nlink<2)throw new le(fe.ENOENT,t,r,"link");if(!this._checkPermissions(se.W_OK,s.dir.getMetadata()))throw new le(fe.EACCES,t,r,"link");var o=i.dir.getEntryIndex(i.name);s.dir.addEntry(s.name,o),i.target.getMetadata().ctime=new Date}},{key:"lseek",value:function(t,r){for(var i=arguments.length,s=Array(i>2?i-2:0),o=2;o<i;o++)s[o-2]=arguments[o];var a=s.findIndex(function(l){return typeof l=="function"}),u=s[a]||nt;a=a>=0?a:s.length,this._callAsync(this.lseekSync.bind(this),[t,r].concat(ln(s.slice(0,a))),u,u)}},{key:"lseekSync",value:function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:se.SEEK_SET,s=this._fdMgr.getFd(t);if(!s)throw new le(fe.EBADF,null,null,"lseek");if([se.SEEK_SET,se.SEEK_CUR,se.SEEK_END].indexOf(i)===-1)throw new le(fe.EINVAL,null,null,"lseek");try{s.setPos(r,i)}catch(o){throw o instanceof le&&o.setSyscall("lseek"),o}}},{key:"lstat",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nt;this._callAsync(this.lstatSync.bind(this),[t],function(i){return r(null,i)},r)}},{key:"lstatSync",value:function(t){t=this._getPath(t);var r=this._navigate(t,!1).target;if(r)return new Rm(fc({},r.getMetadata()));throw new le(fe.ENOENT,t)}},{key:"mkdir",value:function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];var o=i.findIndex(function(u){return typeof u=="function"}),a=i[o]||nt;o=o>=0?o:i.length,this._callAsync(this.mkdirSync.bind(this),[t].concat(ln(i.slice(0,o))),a,a)}},{key:"mkdirSync",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:q2;t=this._getPath(t),t=t.replace(/(.+?)\/+$/,"$1");var i=this._navigate(t,!0);if(i.target)throw new le(fe.EEXIST,t,null,"mkdir");if(!i.target&&i.remaining)throw new le(fe.ENOENT,t,null,"mkdir");if(!i.target){if(i.dir.getMetadata().nlink<2)throw new le(fe.ENOENT,t,null,"mkdir");if(!this._checkPermissions(se.W_OK,i.dir.getMetadata()))throw new le(fe.EACCES,t,null,"mkdir");var s=this._iNodeMgr.createINode(cn,{mode:Gh(r,this._umask),uid:this._uid,gid:this._gid,parent:i.dir.getEntryIndex(".")}),o=si(s,2),a=o[1];i.dir.addEntry(i.name,a)}}},{key:"mkdirp",value:function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];var o=i.findIndex(function(u){return typeof u=="function"}),a=i[o]||nt;o=o>=0?o:i.length,this._callAsync(this.mkdirpSync.bind(this),[t].concat(ln(i.slice(0,o))),a,a)}},{key:"mkdirpSync",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:q2;t=this._getPath(t),t=t.replace(/(.+?)\/+$/,"$1");for(var i=void 0,s=void 0,o=void 0,a=this._navigate(t,!0);;)if(a.target){if(a.target instanceof cn)break;throw new le(fe.ENOTDIR,t)}else{if(a.dir.getMetadata().nlink<2)throw new le(fe.ENOENT,t);if(!this._checkPermissions(se.W_OK,a.dir.getMetadata()))throw new le(fe.EACCES,t);var u=this._iNodeMgr.createINode(cn,{mode:Gh(r,this._umask),uid:this._uid,gid:this._gid,parent:a.dir.getEntryIndex(".")}),l=si(u,2);if(i=l[0],s=l[1],a.dir.addEntry(a.name,s),a.remaining)o=i,a=this._navigateFrom(o,a.remaining,!0);else break}}},{key:"mkdtemp",value:function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];var o=i.findIndex(function(u){return typeof u=="function"}),a=i[o]||nt;o=o>=0?o:i.length,this._callAsync(this.mkdtempSync.bind(this),[t].concat(ln(i.slice(0,o))),function(u){return a(null,u)},a)}},{key:"mknod",value:function(t,r,i,s){for(var o=arguments.length,a=Array(o>4?o-4:0),u=4;u<o;u++)a[u-4]=arguments[u];var l=a.findIndex(function(f){return typeof f=="function"}),c=a[l]||nt;l=l>=0?l:a.length,this._callAsync(this.mknodSync.bind(this),[t,r,i,s].concat(ln(a.slice(0,l))),c,c)}},{key:"mknodSync",value:function(t,r,i,s){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:Vi;t=this._getPath(t);var a=this._navigate(t,!1);if(a.target)throw new le(fe.EEXIST,t,null,"mknod");if(a.dir.getMetadata().nlink<2)throw new le(fe.ENOENT,t,null,"mknod");if(!this._checkPermissions(se.W_OK,a.dir.getMetadata()))throw new le(fe.EACCES,t,null,"mknod");var u=void 0;switch(r){case se.S_IFREG:var l=this._iNodeMgr.createINode(Ri,{mode:Gh(o,this._umask),uid:this._uid,gid:this._gid}),c=si(l,2);u=c[1];break;case se.S_IFCHR:if(typeof i!="number"||typeof s!="number")throw TypeError("major and minor must set as numbers when creating device nodes");if(i>q4||s>W4||s<W2||s<j2)throw new le(fe.EINVAL,t,null,"mknod");var f=this._iNodeMgr.createINode(ua,{mode:Gh(o,this._umask),uid:this._uid,gid:this._gid,rdev:to(i,s)}),d=si(f,2);u=d[1];break;default:throw new le(fe.EPERM,t,null,"mknod")}a.dir.addEntry(a.name,u)}},{key:"open",value:function(t,r){for(var i=arguments.length,s=Array(i>2?i-2:0),o=2;o<i;o++)s[o-2]=arguments[o];var a=s.findIndex(function(l){return typeof l=="function"}),u=s[a]||nt;a=a>=0?a:s.length,this._callAsync(this.openSync.bind(this),[t,r].concat(ln(s.slice(0,a))),function(l){return u(null,l)},u)}},{key:"openSync",value:function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Vi;return this._openSync(t,r,i)[1]}},{key:"_openSync",value:function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Vi;if(t=this._getPath(t),typeof r=="string")switch(r){case"r":case"rs":r=se.O_RDONLY;break;case"r+":case"rs+":r=se.O_RDWR;break;case"w":r=se.O_WRONLY|se.O_CREAT|se.O_TRUNC;break;case"wx":r=se.O_WRONLY|se.O_CREAT|se.O_TRUNC|se.O_EXCL;break;case"w+":r=se.O_RDWR|se.O_CREAT|se.O_TRUNC;break;case"wx+":r=se.O_RDWR|se.O_CREAT|se.O_TRUNC|se.O_EXCL;break;case"a":r=se.O_WRONLY|se.O_APPEND|se.O_CREAT;break;case"ax":r=se.O_WRONLY|se.O_APPEND|se.O_CREAT|se.O_EXCL;break;case"a+":r=se.O_RDWR|se.O_APPEND|se.O_CREAT;break;case"ax+":r=se.O_RDWR|se.O_APPEND|se.O_CREAT|se.O_EXCL;break;default:throw new TypeError("Unknown file open flag: "+r)}if(typeof r!="number")throw new TypeError("Unknown file open flag: "+r);var s=this._navigate(t,!1);if(s.target instanceof md){if(r&se.O_NOFOLLOW)throw new le(fe.ELOOP,t,null,"open");s=this._navigateFrom(s.dir,s.name+s.remaining,!0,void 0,void 0,t)}var o=s.target;if(o){if(r&se.O_CREAT&&r&se.O_EXCL)throw new le(fe.EEXIST,t,null,"open");if(o instanceof cn&&r&(se.O_WRONLY|r&se.O_RDWR))throw new le(fe.EISDIR,t,null,"open");if(r&se.O_DIRECTORY&&!(o instanceof cn))throw new le(fe.ENOTDIR,t,null,"open");r&se.O_TRUNC&&o instanceof Ri&&r&(se.O_WRONLY|se.O_RDWR)&&o.setData(new ArrayBuffer(0));var c=void 0;if(r&se.O_RDWR?c=se.R_OK|se.W_OK:r&se.O_WRONLY?c=se.W_OK:c=se.R_OK,!this._checkPermissions(c,o.getMetadata()))throw new le(fe.EACCES,t,null,"open")}else if(!s.remaining&&r&se.O_CREAT){if(s.dir.getMetadata().nlink<2)throw new le(fe.ENOENT,t,null,"open");if(!this._checkPermissions(se.W_OK,s.dir.getMetadata()))throw new le(fe.EACCES,t,null,"open");var a=void 0,u=this._iNodeMgr.createINode(Ri,{mode:Gh(i,this._umask),uid:this._uid,gid:this._gid}),l=si(u,2);o=l[0],a=l[1],s.dir.addEntry(s.name,a)}else throw new le(fe.ENOENT,t,null,"open");try{var f=this._fdMgr.createFd(o,r);return f}catch(d){throw d instanceof le&&(d.setPaths(t),d.setSyscall("open")),d}}},{key:"read",value:function(t,r){for(var i=arguments.length,s=Array(i>2?i-2:0),o=2;o<i;o++)s[o-2]=arguments[o];var a=s.findIndex(function(l){return typeof l=="function"}),u=s[a]||nt;a=a>=0?a:s.length,this._callAsync(this.readSync.bind(this),[t,r].concat(ln(s.slice(0,a))),function(l){return u(null,l,r)},u)}},{key:"readSync",value:function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,a=this._fdMgr.getFd(t);if(!a)throw new le(fe.EBADF,null,null,"read");if(typeof o=="number"&&o<0)throw new le(fe.EINVAL,null,null,"read");if(a.getINode().getMetadata().isDirectory())throw new le(fe.EISDIR,null,null,"read");var u=a.getFlags();if(u&se.O_WRONLY)throw new le(fe.EBADF,null,null,"read");if(i<0||i>r.length)throw new RangeError("Offset is out of bounds");if(s<0||s>r.length)throw new RangeError("Length extends beyond buffer");r=this._getBuffer(r).slice(i,i+s);var l=void 0;try{l=a.read(r,o)}catch(c){throw c instanceof le&&(c.syscall="read"),c}return l}},{key:"readdir",value:function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];var o=i.findIndex(function(u){return typeof u=="function"}),a=i[o]||nt;o=o>=0?o:i.length,this._callAsync(this.readdirSync.bind(this),[t].concat(ln(i.slice(0,o))),function(u){return a(null,u)},a)}},{key:"readFile",value:function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];var o=i.findIndex(function(u){return typeof u=="function"}),a=i[o]||nt;o=o>=0?o:i.length,this._callAsync(this.readFileSync.bind(this),[t].concat(ln(i.slice(0,o))),function(u){return a(null,u)},a)}},{key:"readFileSync",value:function(t,r){r=this._getOptions({encoding:null,flag:"r"},r);var i=void 0;try{var s=new ArrayBuffer(4096),o=new ArrayBuffer(0),a=null;if(typeof t=="number")for(;a!==0;)a=this.readSync(t,s,0,s.length),o=V2(o,s.slice(0,a));else for(i=this.openSync(t,r.flag);a!==0;)a=this.readSync(i,s,0,s.length),o=V2(o,s.slice(0,a));return r.encoding?o.toString(r.encoding):o}finally{i!==void 0&&this.closeSync(i)}}},{key:"readlink",value:function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];var o=i.findIndex(function(u){return typeof u=="function"}),a=i[o]||nt;o=o>=0?o:i.length,this._callAsync(this.readlinkSync.bind(this),[t].concat(ln(i.slice(0,o))),function(u){return a(null,u)},a)}},{key:"rename",value:function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nt;this._callAsync(this.renameSync.bind(this),[t,r],i,i)}},{key:"renameSync",value:function(t,r){t=this._getPath(t),r=this._getPath(r);var i=this._navigate(t,!1),s=this._navigate(r,!1);if(!i.target)throw new le(fe.ENOENT,t,r,"rename");if(i.target instanceof cn){if(s.target&&!(s.target instanceof cn))throw new le(fe.ENOTDIR,t,r,"rename");if(i.target===this._root||s.target===this._root)throw new le(fe.EBUSY,t,r,"rename");if(s.target&&[].concat(ln(s.target.getEntries())).length-2)throw new le(fe.ENOTEMPTY,t,r,"rename");if(i.name==="."||i.name===".."||s.name==="."||s.name==="..")throw new le(fe.EBUSY,t,r,"rename");if(i.pathStack.length<s.pathStack.length){for(var o=!0,a=0;a<i.pathStack.length;++a)if(i.pathStack[a]!==s.pathStack[a]){o=!1;break}if(o)throw new le(fe.EINVAL,t,r,"rename")}}else if(s.target&&s.target instanceof cn)throw new le(fe.EISDIR,t,r,"rename");if(!this._checkPermissions(se.W_OK,i.dir.getMetadata())||!this._checkPermissions(se.W_OK,s.dir.getMetadata()))throw new le(fe.EACCES,t,r,"rename");if(i.dir===s.dir){i.dir.renameEntry(i.name,s.name);return}var u=i.dir.getEntryIndex(i.name);if(s.target)s.target.getMetadata().ctime=new Date,s.dir.deleteEntry(s.name),s.dir.addEntry(s.name,u);else{if(s.dir.getMetadata().nlink<2)throw new le(fe.ENOENT,t,r,"rename");s.dir.addEntry(s.name,u)}i.target.getMetadata().ctime=new Date,i.dir.deleteEntry(i.name)}},{key:"rmdir",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nt;this._callAsync(this.rmdirSync.bind(this),[t],r,r)}},{key:"rmdirSync",value:function(t){t=this._getPath(t),t=t.replace(/(.+?)\/+$/,"$1");var r=this._navigate(t,!1);if(!r.name)throw new le(fe.EBUSY,t,null,"rmdir");if(r.name==="."||r.name==="..")throw new le(fe.EINVAL,t,null,"rmdir");if(!r.target)throw new le(fe.ENOENT,t,null,"rmdir");if(!(r.target instanceof cn))throw new le(fe.ENOTDIR,t,null,"rmdir");if([].concat(ln(r.target.getEntries())).length-2)throw new le(fe.ENOTEMPTY,t,null,"rmdir");if(!this._checkPermissions(se.W_OK,r.dir.getMetadata()))throw new le(fe.EACCES,t,null,"rmdir");r.dir.deleteEntry(r.name)}},{key:"stat",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nt;this._callAsync(this.statSync.bind(this),[t],function(i){return r(null,i)},r)}},{key:"statSync",value:function(t){t=this._getPath(t);var r=this._navigate(t,!0).target;if(r)return new Rm(fc({},r.getMetadata()));throw new le(fe.ENOENT,t)}},{key:"symlink",value:function(t,r){for(var i=arguments.length,s=Array(i>2?i-2:0),o=2;o<i;o++)s[o-2]=arguments[o];var a=s.findIndex(function(l){return typeof l=="function"}),u=s[a]||nt;a=a>=0?a:s.length,this._callAsync(this.symlinkSync.bind(this),[t,r].concat(ln(s.slice(0,a))),u,u)}},{key:"symlinkSync",value:function(t,r){if(t=this._getPath(t),r=this._getPath(r),!t)throw new le(fe.ENOENT,r,t,"symlink");var i=this._navigate(r,!1);if(i.target)throw new le(fe.EEXIST,r,t,"symlink");if(i.dir.getMetadata().nlink<2)throw new le(fe.ENOENT,r,t,"symlink");if(!this._checkPermissions(se.W_OK,i.dir.getMetadata()))throw new le(fe.EACCES,r,t,"symlink");var s=this._iNodeMgr.createINode(md,{mode:T4,uid:this._uid,gid:this._gid,link:t}),o=si(s,2),a=o[1];i.dir.addEntry(i.name,a)}},{key:"truncate",value:function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];var o=i.findIndex(function(u){return typeof u=="function"}),a=i[o]||nt;o=o>=0?o:i.length,this._callAsync(this.truncateSync.bind(this),[t].concat(ln(i.slice(0,o))),a,a)}},{key:"truncateSync",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(r<0)throw new le(fe.EINVAL,null,null,"ftruncate");if(typeof t=="number")this.ftruncateSync(t,r);else{t=this._getPath(t);var i=void 0;try{i=this.openSync(t,se.O_WRONLY),this.ftruncateSync(i,r)}finally{i!==void 0&&this.closeSync(i)}}}},{key:"unlink",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nt;this._callAsync(this.unlinkSync.bind(this),[t],r,r)}},{key:"unlinkSync",value:function(t){t=this._getPath(t);var r=this._navigate(t,!1);if(!r.target)throw new le(fe.ENOENT,t);if(!this._checkPermissions(se.W_OK,r.dir.getMetadata()))throw new le(fe.EACCES,t);if(r.target instanceof cn)throw new le(fe.EISDIR,t);r.target.getMetadata().ctime=new Date,r.dir.deleteEntry(r.name)}},{key:"utimes",value:function(t,r,i){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:nt;this._callAsync(this.utimesSync.bind(this),[t,r,i],s,s)}},{key:"utimesSync",value:function(t,r,i){t=this._getPath(t);var s=this._navigate(t,!0).target;if(!s)throw new le(fe.ENOENT,t,null,"utimes");var o=s.getMetadata(),a=void 0,u=void 0;if(typeof r=="number")a=new Date(r*1e3);else if(typeof r=="string")a=new Date(parseInt(r)*1e3);else if(r instanceof Date)a=r;else throw TypeError("atime and mtime must be dates or unixtime in seconds");if(typeof i=="number")u=new Date(i*1e3);else if(typeof i=="string")u=new Date(parseInt(i)*1e3);else if(i instanceof Date)u=i;else throw TypeError("atime and mtime must be dates or unixtime in seconds");o.atime=a,o.mtime=u,o.ctime=new Date}},{key:"write",value:function(t,r){for(var i=arguments.length,s=Array(i>2?i-2:0),o=2;o<i;o++)s[o-2]=arguments[o];var a=s.findIndex(function(l){return typeof l=="function"}),u=s[a]||nt;a=a>=0?a:s.length,this._callAsync(this.writeSync.bind(this),[t,r].concat(ln(s.slice(0,a))),function(l){return u(null,l,r)},u)}},{key:"writeSync",value:function(t,r,i,s){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,a=this._fdMgr.getFd(t);if(!a)throw new le(fe.EBADF,null,null,"write");if(typeof o=="number"&&o<0)throw new le(fe.EINVAL,null,null,"write");var u=a.getFlags();if(!(u&(se.O_WRONLY|se.O_RDWR)))throw new le(fe.EBADF,null,null,"write");var l=void 0;if(typeof r=="string")o=typeof i=="number"?i:null,s=typeof s=="string"?s:"utf8",l=this._getBuffer(r,s);else{if(i=typeof i=="number"?i:0,i<0||i>r.length)throw new RangeError("Offset is out of bounds");if(s=typeof s=="number"?s:r.length,s<0||s>r.length)throw new RangeError("Length is out of bounds");l=this._getBuffer(r).slice(i,i+s)}try{return a.write(l,o)}catch(c){throw c instanceof RangeError?new le(fe.EFBIG,null,null,"write"):(c instanceof le&&c.setSyscall("write"),c)}}},{key:"writeFile",value:function(t,r){for(var i=arguments.length,s=Array(i>2?i-2:0),o=2;o<i;o++)s[o-2]=arguments[o];var a=s.findIndex(function(l){return typeof l=="function"}),u=s[a]||nt;a=a>=0?a:s.length,this._callAsync(this.writeFileSync.bind(this),[t,r].concat(ln(s.slice(0,a))),u,u)}},{key:"writeFileSync",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"undefined",i=arguments[2];i=this._getOptions({encoding:"utf8",mode:Vi,flag:"w"},i);var s=void 0;try{var o=this._getBuffer(r,i.encoding);typeof t=="number"?this.writeSync(t,o,0,o.length,0):(s=this.openSync(t,i.flag,i.mode),this.writeSync(s,o,0,o.length,0))}finally{s!==void 0&&this.closeSync(s)}}},{key:"_callAsync",value:function(t,r,i,s){Zr(function(){try{var o=t.apply(void 0,ln(r));o=o===void 0?null:o,i(o)}catch(a){s(a)}})}},{key:"_getPath",value:function(t){if(typeof t=="string")return t;if(t instanceof ArrayBuffer)return new TextDecoder().decode(t);if((typeof t>"u"?"undefined":Ute(t))==="object"&&typeof t.pathname=="string")return this._getPathFromURL(t);throw new TypeError("path must be a string or Buffer or URL")}},{key:"_getPathFromURL",value:function(t){if(t.hostname)throw new TypeError("ERR_INVALID_FILE_URL_HOST");var r=t.pathname;if(r.match(/%2[fF]/))throw new TypeError("ERR_INVALID_FILE_URL_PATH");return decodeURIComponent(r)}},{key:"_getOptions",value:function(t,r){return typeof r=="string"?fc({},t,{encoding:r}):fc({},t,r)}},{key:"_checkPermissions",value:function(t,r){return this._uid!==eo?Rne(t,this._uid,this._gid,r):!0}},{key:"_parsePath",value:function(t){var r=t.match(/^([\s\S]*?)(?:\/+|$)([\s\S]*)/);if(r){var i=r[1]||"",s=r[2]||"";return{segment:i,rest:s}}else throw new Error("Could not parse pathS: "+t)}},{key:"_navigate",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;if(t===void 0)throw new le(fe.ENOENT,i);return t=t.replace(/\/+/,"/"),t=t.replace(/\/$/,"/."),t[0]==="/"||t===""?(t=t.substring(1),t?this._navigateFrom(this._root,t,r,[],i):{dir:this._root,target:this._root,name:"",remaining:"",pathStack:[]}):this._navigateFrom(this._cwd.getINode(),t,r,this._cwd.getPathStack(),i)}},{key:"_navigateFrom",value:function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:r;if(!r)throw new le(fe.ENOENT,o);if(!this._checkPermissions(se.X_OK,t.getMetadata()))throw new le(fe.EACCES,o);var a=this._parsePath(r);a.segment!=="."&&(a.segment===".."?s.pop():s.push(a.segment));var u=void 0,l=void 0,c=t.getEntry(a.segment);if(c instanceof Ri||c instanceof ua||c instanceof jx){if(!a.rest)return{dir:t,target:c,name:a.segment,remaining:"",pathStack:s};throw new le(fe.ENOTDIR,o)}else if(c instanceof cn){if(!a.rest)return{dir:t,target:c,name:a.segment,remaining:"",pathStack:s};u=c,l=a.rest}else if(c instanceof md){if(!i)return{dir:t,target:c,name:a.segment,remaining:a.rest,pathStack:s};if(l=uI(c.getLink(),a.rest),l[0]==="/")return this._navigate(l,i,o);s.pop(),u=t}else return{dir:t,target:null,name:a.segment,remaining:a.rest,pathStack:s};return this._navigateFrom(u,l,i,s,o)}}]),n}(),Aie={setPos:function(e,t,r){e._pos=0},read:function(e,t,r){return 0},write:function(e,t,r,i){return t.length}},Rie={setPos:function(e,t,r){e._pos=0},read:function(e,t,r){return t.fill(0),t.length},write:function(e,t,r,i){return t.length}},Die={setPos:function(e,t,r){e._pos=0},read:function(e,t,r){return t.fill(0),t.length},write:function(e,t,r,i){throw new le(fe.ENOSPC)}},od;typeof window<"u"?od=window:typeof Zd<"u"?od=Zd:typeof self<"u"?od=self:od={};var sc=od,mL={},lI=Object.freeze({default:mL}),cI=lI&&mL||lI;function Tie(n){if(sc.crypto&&sc.crypto.getRandomValues)return sc.crypto.getRandomValues(n);if(typeof sc.msCrypto=="object"&&typeof sc.msCrypto.getRandomValues=="function")return sc.msCrypto.getRandomValues(n);if(cI.randomBytes){if(!(n instanceof Uint8Array))throw new TypeError("expected Uint8Array");if(n.length>65536){var e=new Error;throw e.code=22,e.message="Failed to execute 'getRandomValues' on 'Crypto': The ArrayBufferView's byte length ("+n.length+") exceeds the number of bytes of entropy available via this API (65536).",e.name="QuotaExceededError",e}var t=cI.randomBytes(n.length);return n.set(t),n}else throw new Error("No secure random number generator available.")}var Iie=Tie;function Mie(){var n=new Uint8Array(1);return Iie(n),n[0]}var Oie=Mie;function Pie(n){for(var e="",t=0;t<n;t++)e+=String.fromCharCode(Oie());return e}var Lie=Pie,yL={setPos:function(e,t,r){e._pos=0},read:function(e,t,r){var i=he.from(Lie(t.length),"ascii");return i.copy(t),i.length},write:function(e,t,r,i){return t.length}},ff=new Bx;ff.registerChr(Aie,1,3);ff.registerChr(Rie,1,5);ff.registerChr(Die,1,7);ff.registerChr(yL,1,8);ff.registerChr(yL,1,9);var Dr=new gL(void 0,void 0,ff);Dr.mkdirSync("/dev");Dr.chmodSync("/dev",509);Dr.mknodSync("/dev/null",se.S_IFCHR,1,3);Dr.mknodSync("/dev/zero",se.S_IFCHR,1,5);Dr.mknodSync("/dev/full",se.S_IFCHR,1,7);Dr.mknodSync("/dev/random",se.S_IFCHR,1,8);Dr.mknodSync("/dev/urandom",se.S_IFCHR,1,9);Dr.chmodSync("/dev/null",438);Dr.chmodSync("/dev/zero",438);Dr.chmodSync("/dev/full",438);Dr.chmodSync("/dev/random",438);Dr.chmodSync("/dev/urandom",438);Dr.mkdirSync("/tmp");Dr.chmodSync("/tmp",511);Dr.mkdirSync("/root");Dr.chmodSync("/root",448);function Kx(n){switch(n.mode&se.S_IFMT){case se.S_IFREG:return lu;case se.S_IFDIR:return zr;case se.S_IFBLK:return HQ;case se.S_IFCHR:return E8;case se.S_IFLNK:return Is;case se.S_IFIFO:return lu;case se.S_IFSOCK:return VQ;default:return UQ}}function xy(n){return{dev:BigInt(n.dev),ino:BigInt(n.ino),nlink:BigInt(n.nlink),filetype:Kx(n),size:BigInt(n.size),atim:BigInt(n.atime),mtim:BigInt(n.mtime),ctim:BigInt(n.ctime)}}class vL{virtualFs;constructor(){const e=new Bx,t=new X4(e),[r,i]=t.createINode(cn,{}),s=new J4(t);this.virtualFs=new gL(18,i,e,t,s)}fsname(){return"VirtualFilesystem"}async mkdirat(e,t){let r,i;if(e===void 0)r=this.virtualFs._navigate(t,!1);else if(e instanceof ea)i=e,r=this.virtualFs._navigateFrom(i.dir,t,!1);else return Ue;if(r.target)return go;const[s,o]=this.virtualFs._iNodeMgr.createINode(cn,{mode:q2,uid:0,gid:0,parent:r.dir._dir["."]});return r.dir.addEntry(t,o),N}async getFilestat(e){try{const t=this.virtualFs.statSync(e);return{err:N,filestat:xy(t)}}catch(t){return t.errno}}async unlinkat(e,t,r){try{let i;if(e===void 0)i=this.virtualFs._navigate(t,!1);else if(e instanceof ea)i=this.virtualFs._navigateFrom(e.dir,t,!1);else return Ue;if(!i.target)return Rn;if(r)i.target instanceof cn;else if(i instanceof cn)return tr;return i.dir.deleteEntry(i.name),N}catch(i){return i.errno}}async open(e,t,r,i,s,o,a){const u=this.virtualFs._navigate(e,!1);if(u.target){let l,c;u.remaining?(l=_o,c=e.length-u.remaining.length-1):(c=-1,r&Ti&&r&x1?l=go:l=N);let f;return u.target instanceof cn?f=new ea(o,i,s,u.target,this.virtualFs._iNodeMgr):(u.target instanceof Ri||u.target instanceof md)&&!(r&Ds)?f=new fI(o,i,s,this.virtualFs._fdMgr.createFd(u.target,se.O_RDWR)[0]):(f=new ea(o,i,s,u.dir,this.virtualFs._iNodeMgr),r&Ds?l=_o:(u.target instanceof ua||u.target instanceof jx)&&(l=gx)),{err:l,index:c,desc:f}}else if(r&Ti){let[l,c]=this.virtualFs._iNodeMgr.createINode(Ri,{mode:Vi,uid:0,gid:0});u.dir.addEntry(u.name,c);const[f,d]=this.virtualFs._fdMgr.createFd(l,se.O_RDWR);return{err:N,index:-1,desc:new fI(o,i,s,f)}}else return{err:Rn,index:-1,desc:new ea(o,i,s,u.dir,this.virtualFs._iNodeMgr)}}async renameat(e,t,r,i){let s,o;if(e===void 0)s=this.virtualFs._navigate(t,!1);else if(e instanceof ea)o=e,s=this.virtualFs._navigateFrom(o.dir,t,!1);else return Ue;let a,u;if(r===void 0)a=this.virtualFs._navigate(i,!1);else if(r instanceof ea)u=r,a=this.virtualFs._navigateFrom(u.dir,i,!1);else return Ue;if(!s.target)return Rn;if(a.target)return go;if(a.remaining.length!==0)return Rn;const l=s.dir.getEntryIndex(s.name);return a.dir.addEntry(a.name,l),s.dir.deleteEntry(s.name,l),N}async symlinkat(e,t,r){let i,s;if(t===void 0)i=this.virtualFs._navigate(r,!1);else if(t instanceof ea)s=t,i=this.virtualFs._navigateFrom(s.dir,r,!1);else return Ue;if(i.target)return go;const[o,a]=this.virtualFs._iNodeMgr.createINode(md,{mode:T4,uid:0,gid:0,link:e});return s.dir.addEntry(i.name,a),N}async initialize(e){return N}async mknodat(e,t,r,i){return Ue}}function bL(n,e,t,r,i){n.fdstat={fs_flags:e,fs_rights_base:t,fs_rights_inheriting:r,fs_filetype:Kx(i)}}class Fie extends WritableStream{constructor(e){super({async write(t){await e.write(t.buffer),new WritableStream}})}}class fI extends kx{desc;cursor;constructor(e,t,r,i){super(),this.desc=i,bL(this,e,t,r,i._iNode.getMetadata()),e&mx&&this.fdstat.fs_filetype!==Is?this.cursor=i._iNode._data.byteLength:this.cursor=0}async arrayBuffer(){return{err:N,buffer:this.desc._iNode._data}}async pread(e,t){return{err:N,buffer:this.desc._iNode._data.slice(Number(t),e+Number(t))}}async read(e){const t=this.desc._iNode._data.slice(this.cursor,this.cursor+e);return this.cursor+=t.byteLength,{err:N,buffer:t}}async read_str(){let e;return this.fdstat.fs_filetype===lu?new TextDecoder().decode(e=this.desc._iNode._data):e=this.desc._iNode._link,{err:N,content:e}}async write(e){try{const t=await this.desc._iNode.write(e,this.cursor);return this.cursor+=t,{err:N,written:t}}catch(t){return{err:t.errno,written:0n}}}async pwrite(e,t){try{return{err:N,written:await this.desc._iNode.write(e,Number(t))}}catch(r){return r.errno}}async seek(e,t){let r;switch(this.fdstat.fs_filetype===Is?r=BigInt((await this.desc._iNode._link).length):r=BigInt((await this.desc._iNode._data).byteLength),t){case sy:if(this.cursor+Number(e)<0n)return{offset:BigInt(this.cursor),err:Ue};this.cursor+=Number(e);break;case bx:if(e<0n)return{offset:BigInt(this.cursor),err:Ue};this.cursor=Number(e);break;case wx:if(r<-e)return{offset:BigInt(this.cursor),err:Ue};this.cursor=Number(r+e);break;default:return{offset:BigInt(this.cursor),err:Ue}}return{err:N,offset:BigInt(this.cursor)}}async truncate(e){try{return this.desc._iNode._data.resize(Number(e)),N}catch(t){return t.errno}}async writableStream(){try{return{err:N,stream:new Fie(this)}}catch(e){return e.errno}}async getFilestat(){return{err:N,filestat:xy(this.desc._iNode.getMetadata())}}async setFilestatTimes(e,t){return t!==void 0&&(this.desc._iNode._metadata.mtime=t),e!==void 0&&(this.desc._iNode._metadata.atime=e),N}async close(){return N}addPollSub(e,t,r){return Promise.resolve({userdata:e,eventType:t,error:N,nbytes:BigInt(this.desc._iNode._data.byteLength)})}}class ea extends xx{dir;inodeMgr;dirents;constructor(e,t,r,i,s){super(),this.dir=i,this.inodeMgr=s,bL(this,e,t,r,i.getMetadata()),this.dirents=void 0}async readdir(e){try{return(this.dirents===void 0||e)&&(this.dirents=Array.from(this.dir._dir).filter(([t,r])=>t!=="."&&t!=="..").map(([t,r],i)=>({d_next:BigInt(i+1),d_ino:BigInt(r),name:t,d_type:Kx(this.inodeMgr.getINode(r).getMetadata())}))),{err:N,dirents:this.dirents}}catch(t){return{err:t.errno,dirents:[]}}}async getFilestat(){return{err:N,filestat:xy(this.dir.getMetadata())}}async setFilestatTimes(e,t){return t!==void 0&&(this.dir._metadata.mtime=t),e!==void 0&&(this.dir._metadata.atime=e),N}}class El extends M8{ino;constructor(e,t,r,i){super(e,t,r),this.ino=i}async getFilestat(){return{err:N,filestat:xy(this.ino._metadata)}}}class Nie extends El{remover;constructor(e,t,r,i,s){super(e,t,r,i),this.remover=s,(t&Cc)!==0n?this.ino.writer===-1?this.ino.writer=1:this.ino.writer++:(t&Sc)!==0n&&(this.ino.reader===-1?this.ino.reader=1:this.ino.reader++)}isatty(){return!1}async read(e){let t=await this.ino.read();return t.byteLength>e&&t.resize(e),{err:N,buffer:t}}async write(e){return await this.ino.write(e),{err:N,written:BigInt(e.byteLength)}}async addPollSub(e,t,r){const i=BigInt(await this.ino.addPollSub());return{userdata:e,error:N,eventType:t,nbytes:i}}async ioctl(e,t){return this.ino.setMode(e,t[0]!==0),Promise.resolve(N)}close(){return(this.fdstat.fs_rights_base&Cc)!==0n&&(this.ino.writer--,this.ino.writer===0&&this.ino.sendEof()),(this.fdstat.fs_rights_base&Sc)!==0n&&this.ino.reader--,this.ino.isCloserm()&&this.ino.writer===0&&this.ino.reader===0&&this.remover(),Promise.resolve(N)}duplicateFd(){(this.fdstat.fs_rights_base&Cc)!==0n&&this.ino.writer++,(this.fdstat.fs_rights_base&Sc)!==0n&&this.ino.reader++}}class wL extends vL{driverManager;async initialize(e){const t=e;return this.driverManager=t.driverManager,N}fsname(){return"DeviceFilesystem"}async mknodat(e,t,r){let i,s;if(e===void 0)i=this.virtualFs._navigate(t,!1);else if(e instanceof ea)s=e,i=this.virtualFs._navigateFrom(s.dir,t,!1);else return Ue;if(i.target)return go;if(r<0){const[o,a]=this.virtualFs._iNodeMgr.createINode(jx,{mode:Vi,uid:0,gid:0,parent:i.dir._dir["."]});i.dir.addEntry(t,a)}else{const[o,a]=this.virtualFs._iNodeMgr.createINode(ua,{mode:Vi,uid:0,gid:0,rdev:r,parent:i.dir._dir["."]});i.dir.addEntry(t,a)}return N}async open(e,t,r,i,s,o,a){let u=await super.open(e,t,r,i,s,o,a);if(u.err!==gx)return u;const l=this.virtualFs._navigateFrom(u.desc.dir,Hn(e),!1),c=()=>{try{u.desc.dir.deleteEntry(Hn(e))}catch{}};if(l.target._metadata.isCharacterDevice()){const[f,d]=j4(l.target._metadata.rdev),g=this.driverManager.getDriver(f),{err:m,desc:y}=await g.getDesc(d,o,i,s,l.target);return m!==N?u:{err:N,index:-1,desc:y}}else return a!==-1&&(l.target.isKernW()&&(i&Cc)!==0n||l.target.isKernR()&&(i&Sc)!==0n)?{err:Pn,index:-1,desc:void 0}:{err:N,index:-1,desc:new Nie(o,i,s,l.target,c)}}}async function Bie(n,e){let t=new wL;return await n.initialize(e,t),await t.initialize({driverManager:n}),await t.mknodat(void 0,"null",to(0,0)),await t.mknodat(void 0,"zero",to(0,1)),await t.mknodat(void 0,"urandom",to(0,2)),await t.mknodat(void 0,"ttyH0",to(1,0)),await t.mknodat(void 0,"ttyH1",to(1,1)),await t.mknodat(void 0,"wget0",to(2,0)),await t.mknodat(void 0,"ws0",to(3,0)),t}const qie=40,Wie={fsa:L8,vfs:vL,devfs:wL};async function _L(n,e){const t=Wie[n];if(t){const r=new t;return{err:await r.initialize(e),filesystem:r}}return{err:Ue,filesystem:void 0}}class jie{mounts;watchers;constructor(){this.mounts={},this.watchers=new Set}abspath(e,t){if(e!==void 0&&!t.startsWith("/")){const r=e.getPath();return t.length===0?r:`${r==="/"?"":r}/${t}`}return t}emit(e,t){if(!t)return;const r=em(t);for(const i of Array.from(this.watchers)){if(i.signal.aborted){this.watchers.delete(i);continue}const s=i.path;let o=!1,a=null;if(r===s)o=!0,a=Hn(r);else{const u=s==="/"?"/":s+"/";r.startsWith(u)&&(o=!0,a=r.slice(u.length))}o&&a!==null&&i.enqueue({eventType:e,filename:a,fullPath:r})}}async getDescInfo(e,t,r=0,i=0,s=wr,o=wr,a=0,u=qie){let l=em(e),c,f;for(c=l.length;c>0;c=l.lastIndexOf("/",c-1)){let y=l.slice(0,c);if(f=this.mounts[y],f!==void 0)break}if(f===void 0&&(f=this.mounts["/"]),f===void 0)throw new Error("No filesystem mounted at root");let{err:d,index:g,desc:m}=await f.open(l.slice(c),r,i,s,o,a,t);if(m){const y=g>-1?l.slice(0,c+g):l;if(await m.initialize(y)!==N)return{desc:void 0,err:Kd,fs:void 0,path:l}}if(r&xn)switch(d){case N:case _o:{let y=m.getFdstat();if(y!==void 0&&y.fs_filetype===Is){if(u===0)return{desc:m,err:WQ,fs:f,path:l};let{err:b,content:w}=await m.read_str();if(b!==N)return{desc:void 0,err:d,fs:f,path:void 0};let x;if(w.startsWith("/"))if(g!==-1){const _=l.slice(c+g);x=w.concat(_)}else x=w;else{let _=g===-1?m.getPath().lastIndexOf("/"):m.getPath().lastIndexOf("/",c+g-1),S=l.slice(0,_+1);if(d===N)x=S.concat(w);else{let C=l.slice(c+g);x=S.concat(w,C)}}return await this.getDescInfo(x,t,r,i,s,o,a,u-1)}break}default:return{desc:void 0,err:d,fs:f,path:void 0}}return d===N?(i&vx&&(await m.truncate(0n),this.emit("change",l)),{desc:m,err:d,fs:f,path:l}):{desc:void 0,err:d,fs:f,path:l}}async open(e,t=0,r=0,i=0,s=wr,o=wr,a=-1){return await this.getDescInfo(e,a,t,r,s,o,i)}async openat(e,t,r=0,i=0,s=0,o=wr,a=wr,u=-1){let l=this.abspath(e,t);return await this.getDescInfo(l,u,r,i,o,a,s)}async createDir(e,t=void 0,r=-1){let i=this.abspath(t,e);i.endsWith("/")&&(i=i.slice(0,-1));const{desc:s,fs:o,err:a}=await this.getDescInfo(no(i),r,xn);if(a!==N)return a;const u=await o.mkdirat(s,Hn(i));return u===N&&this.emit("rename",i),u}async addSymlink(e,t,r=void 0,i=-1){let s;r!==void 0&&!t.startsWith("/")?s=`${r.getPath()}/${t}`:s=t;const{desc:o,fs:a,err:u}=await this.getDescInfo(no(s),i,xn);if(u!==N)return u;const l=await a.symlinkat(e,o,Hn(t));return l===N&&this.emit("rename",em(s)),l}async mknodat(e,t,r,i){let s=this.abspath(e,t);const{desc:o,fs:a,err:u}=await this.getDescInfo(no(s),i,xn);if(u!==N)return u;const l=await a.mknodat(o,Hn(s),r,{});return l===N&&this.emit("rename",s),l}async removeEntry(e,t,r=void 0,i=-1){let s=this.abspath(r,e);const{desc:o,fs:a,err:u}=await this.getDescInfo(no(s),i,xn);if(u!==N)return u;const l=await a.unlinkat(o,Hn(s),t);return l===N&&this.emit("rename",s),l}async move(e,t,r,i,s=-1){const o=this.abspath(e,t),a=no(o),u=this.abspath(r,i),l=no(u);if(Object.keys(this.mounts).some(w=>{w.startsWith(o)})||o.startsWith(u))return Q0;const c=await this.getDescInfo(a,s,xn,Ds);if(c.err!==N)return c.err;const f=await this.getDescInfo(o,s,xn);if(f.err!==N)return f.err;const d=await f.desc.getFilestat();if(d.err!==N)return d.err;const g=d.filestat,m=await this.getDescInfo(l,s,xn,Ds);if(m.err!==N)return m.err;const y=await this.getDescInfo(u,s,xn);if(y.err===N){const w=await y.desc.getFilestat();if(w.err!==N)return w.err;const x=w.filestat;if(g.dev!==x.dev)return E2;if(x.filetype===zr){if(g.filetype!==zr)return _o;const{err:_,dirents:S}=await y.desc.readdir(!1);if(_!==N)return _;if(S.length!==0)return Sm}}const b=await m.fs.renameat(c.desc,Hn(o),m.desc,Hn(u));return b===N&&(this.emit("rename",o),this.emit("rename",u)),b}async addMount(e,t,r,i,s,o,a,u=-1){const l=this.abspath(r,i);let c;if(l!=="/"){if(c=await this.getDescInfo(l,u,xn,Ds),c.err!==N)return c.err;if((await c.desc.readdir(!0)).dirents.length!==0)return Sm}else if(this.mounts["/"]!==void 0)return Q0;const f=this.abspath(e,t);let d;if(f===""){const g=await _L(s,a);if(g.err!==N)return g.err;d=g.filesystem}else{const g=await this.getDescInfo(f,u,xn,Ds);if(g.err!==N)return g.err;const m=await g.desc.mountFs(a);if(m.err!==N)return m.err;d=m.fs}return this.mounts[l]=d,N}async addMountFs(e,t,r=-1){if(this.mounts[e]!==void 0)return Q0;if(e==="/")return this.mounts[e]=t,N;let i=await this.getDescInfo(e,r,xn,Ds);return i.err!==N?i.err:(await i.desc.readdir(!0)).dirents.length===0?(this.mounts[e]=t,N):Sm}removeMount(e){return Object.keys(this.mounts).every(t=>t===e||!t.startsWith(e))?this.mounts[e]?(delete this.mounts[e],N):Rn:Q0}async readLink(e,t,r=-1){let{err:i,desc:s}=await this.openat(e,t,0,0,0,wr,wr,r);if(i!==N)return{err:i,path:void 0};if(s.getFdstat().fs_filetype!==Is)return{err:Ue,path:void 0};const{err:a,content:u}=await s.read_str();return{err:a,path:u}}async*watch(e,t){const r=em(e),i=t?.signal;if(!i)throw new Error("watch requires AbortSignal in options.signal");const s=[];let o=null;const a=()=>{const f=o;o=null,f&&f()},l={path:r,enqueue:f=>{s.push({eventType:f.eventType,filename:f.filename}),a()},signal:i};this.watchers.add(l);const c=()=>a();i.addEventListener("abort",c);try{for(;!i.aborted;){if(s.length===0){await new Promise(f=>{if(i.aborted)return f();o=()=>f()});continue}for(;s.length;)yield s.shift()}}finally{i.removeEventListener("abort",c),this.watchers.delete(l)}}getMounts(){return this.mounts}}class $ie extends kx{procNode;contents;cursor;constructor(e,t,r,i){super(),this.procNode=i,this.fdstat={fs_flags:e,fs_rights_base:t,fs_rights_inheriting:r,fs_filetype:this.procNode.getFilestat().filetype};const s=new TextEncoder().encode(this.procNode.read());this.contents=s.buffer,this.cursor=0n}addPollSub(e,t,r){return Promise.resolve({userdata:e,eventType:t,nbytes:BigInt(this.contents.byteLength),error:N})}arrayBuffer(){return Promise.resolve({err:N,buffer:this.contents})}close(){return Promise.resolve(N)}getFilestat(){return Promise.resolve({err:N,filestat:this.procNode.getFilestat()})}pread(e,t){const r=this.contents.slice(Number(t),Number(t)+e);return Promise.resolve({err:N,buffer:r})}pwrite(e,t){return Promise.resolve({err:Pn,written:0n})}read(e,t){const r=this.contents.slice(Number(this.cursor),Number(this.cursor)+e);return this.cursor+=BigInt(r.byteLength),Promise.resolve({err:N,buffer:r})}read_str(){return Promise.resolve({err:N,content:new TextDecoder().decode(this.contents)})}seek(e,t){const r=BigInt(this.contents.byteLength);switch(t){case sy:if(this.cursor+e<0n)return Promise.resolve({offset:this.cursor,err:Ue});this.cursor+=e;break;case bx:if(e<0n)return Promise.resolve({offset:this.cursor,err:Ue});this.cursor=e;break;case wx:if(r<-e)return Promise.resolve({offset:this.cursor,err:Ue});this.cursor=r+e;break;default:return Promise.resolve({offset:this.cursor,err:Ue})}return Promise.resolve({err:N,offset:this.cursor})}setFilestatTimes(e,t){return Promise.resolve(Xe)}truncate(e){return Promise.resolve(Pn)}writableStream(){return Promise.resolve({err:Pn,stream:void 0})}write(e){return Promise.resolve({err:Pn,written:0n})}}class zie extends xx{procNode;dirents;constructor(e,t,r,i){super(),this.procNode=i,this.fdstat={fs_flags:e,fs_rights_base:t,fs_rights_inheriting:r,fs_filetype:zr}}async readdir(e){if(this.dirents===void 0||e){const t=this.procNode.listNodes();if(t.err!==N)return{err:t.err,dirents:void 0};this.dirents=Object.entries(t.nodes).map(([r,i],s)=>({d_next:BigInt(s+1),d_ino:0n,name:r,d_type:i.getFilestat().filetype}))}return{err:N,dirents:this.dirents}}getFilestat(){return Promise.resolve({err:N,filestat:this.procNode.getFilestat()})}setFilestatTimes(e,t){return Promise.resolve(Xe)}}let P1;function Uie(n){P1=n}function Hie(n){return new Yx(n)}class Zx{static filestat={dev:0n,ino:0n,filetype:Is,nlink:1n,size:0n,mtim:0n,atim:0n,ctim:0n};constructor(){}getFilestat(){return Zx.filestat}}class Xx{static filestat={dev:0n,ino:0n,filetype:lu,nlink:1n,size:0n,mtim:0n,atim:0n,ctim:0n};getFilestat(){return Xx.filestat}}class Sy{pid;static filestat={dev:0n,ino:0n,filetype:zr,nlink:1n,size:0n,mtim:0n,atim:0n,ctim:0n};constructor(e){this.pid=e}getFilestat(){return Sy.filestat}}class hI extends Xx{read(){return Object.entries(P1.filesystem.getMounts()).map(([e,t])=>`${e} ${t.fsname()}`).join(`
|
|
214
|
-
`)+`
|
|
215
|
-
`}}class dI extends Zx{pid;constructor(e){super(),this.pid=e}read(){return this.pid.toString()}}class Yx extends Sy{static specialNodes={self:dI};listNodes(){let e={};for(const[t,r]of Object.entries(Yx.specialNodes))e[t]=new r(this.pid);for(const t of Object.keys(P1.processInfos))e[t.toString()]=new L1(Number(t));return{err:N,nodes:e}}getNode(e){if(e==="")return{err:N,node:this};const t=Number(e);if(isNaN(t)){if(e==="self")return{err:N,node:new dI(this.pid)}}else if(P1.processInfos[t]!==void 0)return{err:N,node:new L1(t)};return{err:Rn,node:void 0}}}class L1 extends Sy{static specialNodes={mountinfo:hI};listNodes(){let e={};for(const[t,r]of Object.entries(L1.specialNodes))e[t]=new r(this.pid);return{err:N,nodes:e}}getNode(e){switch(e){case"mountinfo":return{err:N,node:new hI};default:return{err:Rn,node:void 0}}}}class Vie{processManager;constructor(e){this.processManager=e,Uie(this.processManager)}fsname(){return"ProcFilesystem"}mkdirat(e,t){return Promise.resolve(Pn)}getFilestat(e){return Promise.resolve({err:bp,filestat:void 0})}open(e,t,r,i,s,o,a){let u=Hie(a),l=N,c=-1,f=e.startsWith("/")?0:-1,d=e.indexOf("/",f+1);do{const y=d===-1?e.slice(f+1):e.slice(f+1,d);if(u.getFilestat().filetype!==zr){l=_o,c=f;break}const b=u.getNode(y);if(b.err!==N){l=b.err,c=d;break}u=b.node;const w=e.indexOf("/",d+1);f=d,d=w}while(f!==-1);f===-1&&(c=-1,l===N?r&Ds&&u.getFilestat().filetype!==zr?l=_o:r&Ti&&r&x1&&(l=go):l===Rn&&r&Ti&&(l=Pn));let g;const m=u.getFilestat().filetype;if(m===zr)g=new zie(o,i,s,u);else{const y=u;g=new $ie(o,i,s,y)}return Promise.resolve({err:l,index:c,desc:g})}unlinkat(e,t,r){return Promise.resolve(Pn)}renameat(e,t,r,i){return Promise.resolve(Pn)}symlinkat(e,t,r){return Promise.resolve(Pn)}initialize(e){return Promise.resolve(N)}mknodat(e,t,r,i){return Promise.resolve(Pn)}}class Gie{devices;async initDriver(){return this.devices={0:Jx,1:Kie,2:Zie},N}async initDevice(e){return N}async teardownDevice(e){return N}async teardownDriver(){return N}async getDesc(e,t,r,i,s){return{desc:new this.devices[e](t,r,i,s),err:N}}}class Jx extends El{isatty(){return!1}async read(e,t){return{err:N,buffer:new ArrayBuffer(0)}}async pread(e,t){return{err:N,buffer:new ArrayBuffer(0)}}async arrayBuffer(){return{err:N,buffer:new ArrayBuffer(0)}}async read_str(){return{err:N,content:""}}async write(e){return{err:N,written:BigInt(e.byteLength)}}async pwrite(e,t){return{err:N,written:BigInt(e.byteLength)}}async seek(e,t){return{err:N,offset:0n}}async truncate(e){return N}}class Kie extends Jx{async read(e,t){let r=new ArrayBuffer(e);return new Uint8Array(r).fill(0,0,e),{err:N,buffer:r}}async pread(e,t){return this.read(e)}}class Zie extends Jx{async read(e,t){let r=new ArrayBuffer(e),i=new Uint8Array(r);for(var s=0;s<e;s++)i.set([Math.floor(Math.random()*256)],s);return{err:N,buffer:r}}async pread(e,t){return this.read(e)}}const Xie=1,Yie=2,Jie=8,Qie=32,ese=64,pI=128,X2=256,kL=1024,tse=4096,nse=1,xL=4,rse=48,SL=128,CL=1,Es=2,Y2=8,EL=16,AL=32,ise=64,sse=32768;class ose{bufSize;start;end;buffers;constructor(e=65536){this.bufSize=e,this.start=0,this.end=0,this.buffers=[],this.getNewBuffer()}getNewBuffer(){this.buffers.push(new ArrayBuffer(this.bufSize)),this.end=0}discardBuffer(){this.start=0,this.buffers.length===1&&(this.end=0),this.buffers.shift()}push(e){let t=0;for(;t<e.length;){(this.end>=this.bufSize||this.buffers.length===0)&&this.getNewBuffer();const r=new Uint8Array(this.buffers[this.buffers.length-1],this.end,this.bufSize-this.end),{written:i,read:s}=new TextEncoder().encodeInto(e.slice(t),r);if(t+=s,this.end+=i,this.end<this.bufSize&&t<e.length){const o=new TextEncoder().encode(e[t]),a=this.bufSize-this.end;r.set(o.slice(0,a),this.end-r.byteOffset),this.getNewBuffer(),new Uint8Array(this.buffers[this.buffers.length-1],this.end,this.bufSize-this.end).set(o.slice(a)),t++,this.end+=o.length-a}}}pop(e,t){let r=0;for(;r<t;){let i=t-r;if(this.buffers.length===1?i>this.end-this.start&&(i=this.end-this.start):i>this.bufSize-this.start&&(i=this.bufSize-this.start),i===0)break;const s=new Uint8Array(this.buffers[0],this.start,i);e.set(s,r),this.start+=i,r+=i,this.start>=this.bufSize&&this.discardBuffer()}return r}length(){if(this.buffers.length<=1)return this.end-this.start;{const e=this.buffers.length>2?this.buffers.length*this.bufSize:0;return this.bufSize-this.start+this.end+e}}}class ase{foregroundPid;bufRequestQueue;subs;termios;driverBuffer;driverBufferCursor;userBuffer;constructor(e,t=65536){this.bufRequestQueue=[],this.subs=[],this.termios=e,this.driverBuffer="",this.driverBufferCursor=0,this.userBuffer=new ose(t)}splitBuf(e){const t=new ArrayBuffer(e),r=new Uint8Array(t),i=this.userBuffer.pop(r,e);return t.slice(0,i)}detectBreakCondition(e){for(let t=2;t<e.length;++t)if(e.charCodeAt(t)!==0)return t;return e.length}stripOffBytes(e){let t="";for(let r=0;r<e.length;++r){let i=e.charCodeAt(r);t+=String.fromCharCode(i&127)[0]}return t}pushDriverInputBuffer(e){(this.termios.lFlag&Y2)!==0&&this.printTerminal(e),this.driverBuffer=this.driverBuffer.slice(0,this.driverBufferCursor)+e+this.driverBuffer.slice(this.driverBufferCursor),this.driverBufferCursor+=e.length}pushNLDriverInputBuffer(){this.driverBuffer+=`
|
|
216
|
-
`,(this.termios.lFlag&Es)!==0&&(((this.termios.lFlag&Y2)!==0||(this.termios.lFlag&ise)!==0)&&this.printTerminal(`\r
|
|
217
|
-
`),this.flushDriverInputBuffer())}flushDriverInputBuffer(){this.userBuffer.push(this.driverBuffer),this.driverBuffer="",this.driverBufferCursor=0}resolveUserReadRequests(){if(this.userBuffer.length()!==0)for(;this.userBuffer.length()!==0&&this.bufRequestQueue.length>0;){let e=this.bufRequestQueue.shift();const t=new ArrayBuffer(e.len),r=new Uint8Array(t),i=this.userBuffer.pop(r,e.len);e.resolve({err:N,buffer:t.slice(0,i)})}else{let e=this.bufRequestQueue.filter(t=>t.pid===this.foregroundPid);this.bufRequestQueue=this.bufRequestQueue.filter(t=>t.pid!==this.foregroundPid),e.forEach(t=>t.resolve({err:N,buffer:new ArrayBuffer(0)}))}}processTerminalInput(e,t){let r=this.termios.iFlag,i=this.termios.cFlag,s=this.termios.lFlag;if((i&SL)!==0){for((r&Qie)!==0&&(t=this.stripOffBytes(t));t.length>0;){let o=t.charCodeAt(0);if(o===0&&t.length>1&&t.charCodeAt(1)===0){const a=this.detectBreakCondition(t);(r&Xie)===0&&((r&Yie)===0?(r&Jie)===0?this.driverBuffer+="\0":this.driverBuffer+="ÿ\0\0":this.flushDriverInputBuffer()),t=t.slice(a);continue}switch(o){case 10:{(s&Es)!==0?(r&ese)!==0?(r&pI)===0&&((r&X2)!==0?this.pushNLDriverInputBuffer():this.pushDriverInputBuffer("\r")):this.pushNLDriverInputBuffer():this.pushNLDriverInputBuffer();break}case 13:{(s&Es)!==0?(r&pI)===0&&((r&X2)!==0?this.pushNLDriverInputBuffer():this.pushDriverInputBuffer("\r")):this.pushDriverInputBuffer("\r");break}case 17:case 19:{(r&kL)!==0||this.pushDriverInputBuffer(t[0]);break}case 3:case 26:case 28:{(s&CL)!==0?o===3&&this.foregroundPid!=null&&e.publishEvent(ul,this.foregroundPid):this.pushDriverInputBuffer(t[0]);break}case 4:{(s&Es)!==0?(this.flushDriverInputBuffer(),this.resolveUserReadRequests()):this.pushDriverInputBuffer(t[0]);break}case 21:{(s&Es)!==0&&(s&AL)!==0?this.removeFromCursorToLeft(this.driverBufferCursor):this.pushDriverInputBuffer(t[0]);break}case 127:{(s&Es)!==0&&(s&EL)!==0?this.removeFromCursorToLeft(1):this.pushDriverInputBuffer(t[0]);break}case 27:{if((s&Es)!==0)if(t[1]==="["){switch(t[2]){case"C":{this.moveCursorRight(1);break}case"D":{this.moveCursorLeft(1);break}}t=t.slice(3);continue}else{t=t.slice(2);continue}else this.pushDriverInputBuffer(t[0]);break}default:{this.pushDriverInputBuffer(t[0]);break}}t=t.slice(1)}if((s&Es)===0&&this.flushDriverInputBuffer(),this.userBuffer.length()!==0&&this.resolveUserReadRequests(),this.userBuffer.length()!==0){for(const o of this.subs)o.resolve({userdata:o.userdata,error:N,nbytes:BigInt(this.userBuffer.length()),eventType:of});this.subs.length=0}}}dataForUser(){return this.userBuffer.length()}readToUser(e){return this.splitBuf(e)}sendTerminalOutput(e){return(this.termios.oFlag&xL)!==0&&(e=e.replaceAll(`
|
|
218
|
-
`,`\r
|
|
219
|
-
`)),this.printTerminal(e),e}}const use={iFlag:X2|kL|tse,oFlag:nse|xL,cFlag:rse|SL,lFlag:AL|EL|Y2|sse|Es|CL};class lse extends ase{terminal;constructor(e){super({...use}),this.terminal=e,this.terminal.setInsertMode((this.termios.lFlag&Es)!==0)}printTerminal(e){this.terminal.io.print(e)}moveCursorRight(e){let t=e>=this.driverBuffer.length-this.driverBufferCursor?this.driverBuffer.length-this.driverBufferCursor:e;t!==0&&(this.terminal.io.print(`\x1B[${t}C`),this.driverBufferCursor+=t)}moveCursorLeft(e){let t=e>=this.driverBufferCursor?this.driverBufferCursor:e;t!==0&&(this.terminal.io.print(`\x1B[${t}D`),this.driverBufferCursor-=t)}removeFromCursorToLeft(e){let t=e>=this.driverBufferCursor?this.driverBufferCursor:e;t!==0&&(this.terminal.cursorLeft(t),this.terminal.io.print(`\x1B[${t}P`),this.driverBuffer=this.driverBuffer.slice(0,this.driverBufferCursor-t)+this.driverBuffer.slice(this.driverBufferCursor),this.driverBufferCursor-=t)}getScreenSize(){let e=this.terminal.scrollPort_.getScreenSize();return{cellsWidth:this.terminal.screenSize.width,cellsHeight:this.terminal.screenSize.height,pxWidth:e.width,pxHeight:e.height}}}class cse{maxTty;freedTerminals;processManager;terminals;async initDriver(e){const t=e;return this.processManager=t.processManager,this.terminals=[],this.freedTerminals=[],this.maxTty=0,N}__initFsaDropImport(e,t,r,i){t.addEventListener("dragover",function(a){a.stopPropagation(),a.preventDefault(),a.dataTransfer.dropEffect="copy"},!1);const s=this;t.addEventListener("drop",async function(o){o.stopPropagation(),o.preventDefault();const a=i.processInfos[s.terminals[e].foregroundPid].cwd;await Promise.all((Object.values(o.dataTransfer.items)||[]).map(async u=>{let l=await u.getAsFileSystemHandle(),c=`${a}/${l.name}`;if(l.kind==="file"){const f=(await l.getFile()).stream(),d=await i.filesystem.open(c,Ti);if(d.err!==N)return;const{err:g,stream:m}=await d.desc.writableStream();return new Promise(async y=>{await f.pipeTo(m),r&&r(c,l.name),y()})}else if(l.kind==="directory"){const f=`/tmp/temp_mount_${l.name}`;await i.filesystem.createDir(f);let{err:d,filesystem:g}=await _L("fsa",{dir:l,keepMetadata:!1});if(d!==N)return;await i.filesystem.addMountFs(f,g),await i.spawnProcess(0,null,"/usr/bin/wash",new ay({0:void 0,1:void 0,2:void 0,3:new Ac((await i.filesystem.open("/")).desc)}),["/usr/bin/wash","-c",`cp -r ${f} ${c} ; umount ${f}`],F8,!1,pd)}}))})}__initTerminal(e){const t=new lse(e);t.terminal.installKeyboard(),t.terminal.keyboard.bindings.addBindings({"Ctrl-R":"PASS"});const r=s=>{t.processTerminalInput(this.processManager,s)},i=t.terminal.io.push();return i.onVTKeystroke=r,i.sendString=r,i.onTerminalResize=(s,o)=>{t.foregroundPid!=null&&this.processManager.publishEvent(ree,t.foregroundPid)},t}async initDevice(e){const t=e;let r=this.freedTerminals.pop();r||(r=this.maxTty++);const i=this.__initTerminal(t.terminal);return this.terminals[r]=i,this.__initFsaDropImport(r,t.terminal.div_.getElementsByTagName("iframe")[0].contentWindow,()=>{},this.processManager),N}async teardownDevice(e){return this.terminals[e]?(delete this.terminals[e],this.freedTerminals.push(e),N):Rn}async teardownDriver(){return N}async getDesc(e,t,r,i,s){return this.terminals[e]===void 0?{err:gx,desc:void 0}:{err:N,desc:new fse(t,r,i,s,this.terminals[e])}}async wrapCallback(e){try{await e()}catch(t){throw Object.values(this.terminals).forEach(r=>{r.terminal.io.println(`[ERROR] Unrecoverable kernel error: ${t}`)}),t}}}class fse extends El{hterm;constructor(e,t,r,i,s){super(e,t,r,i),this.hterm=s}isatty(){return!0}async write(e){const t=this.hterm.sendTerminalOutput(new TextDecoder().decode(e));return window.stdoutAttached&&(window.buffer+=t),{err:N,written:BigInt(e.byteLength)}}async read(e,t){return this.hterm.dataForUser()>0?{err:N,buffer:this.hterm.readToUser(e)}:this.fdstat.fs_flags&KQ?{err:N,buffer:new ArrayBuffer(0)}:new Promise(r=>{this.hterm.bufRequestQueue.push({len:e,pid:t,resolve:r})})}async ioctl(e,t){let r=iy;switch(e){case 1:{if(t.byteLength<16)break;const i=new Int32Array(t.buffer,t.byteOffset);i[0]=this.hterm.termios.iFlag,i[1]=this.hterm.termios.oFlag,i[2]=this.hterm.termios.cFlag,i[3]=this.hterm.termios.lFlag,r=N;break}case 2:{if(t.byteLength<16)break;const i=new Int32Array(t.buffer,t.byteOffset);this.hterm.termios.iFlag=i[0],this.hterm.termios.oFlag=i[1],this.hterm.termios.cFlag=i[2],this.hterm.termios.lFlag=i[3],this.hterm.terminal.setInsertMode((this.hterm.termios.lFlag&Es)!==0),r=N;break}case 19:{if(t.byteLength<8)break;const i=await this.hterm.getScreenSize(),s=new Uint16Array(t.buffer,t.byteOffset);s[0]=i.cellsHeight,s[1]=i.cellsWidth,s[2]=i.pxWidth,s[3]=i.pxHeight,r=N;break}default:{1<=e&&e<=96&&2147767344<=e&&e<=2147767360&&35073<=e&&e<=35079?r=bp:r=Ue;break}}return r}addPollSub(e,t,r){switch(t){case yx:return Promise.resolve({userdata:e,error:N,eventType:t,nbytes:0n});case of:return this.hterm.dataForUser()===0?new Promise(i=>{this.hterm.subs.push({pid:r,userdata:e,tag:t,resolve:i})}):Promise.resolve({userdata:e,error:N,eventType:t,nbytes:BigInt(this.hterm.dataForUser())});default:return Promise.resolve({userdata:e,error:Ue,eventType:ts,nbytes:0n})}}}class hse{responses;topResponseId;devfs;initDriver(e){return this.topResponseId=1,this.responses={},this.devfs=e.devfs,Promise.resolve(N)}teardownDriver(e){return Promise.resolve(N)}initDevice(e){return Promise.resolve(N)}teardownDevice(e,t){return Promise.resolve(N)}async makeRequest(e){try{return this.responses[this.topResponseId]=await fetch(e),this.devfs.mknodat(void 0,`wget0r${this.topResponseId}`,to(2,this.topResponseId)),{err:N,minor:this.topResponseId++}}catch(t){return console.log(t),{err:Ue,minor:-1}}}async getDesc(e,t,r,i,s){return e===0?{err:N,desc:new dse(t,r,i,s,this)}:this.responses[e]===void 0?{desc:void 0,err:Rn}:{err:N,desc:new pse(t,r,i,s,this.responses[e],()=>this.invalidateResponse(e))}}async invalidateResponse(e){return delete this.responses[e],this.devfs.unlinkat(void 0,`wget0r${e}`,!1)}}class dse extends El{driver;constructor(e,t,r,i,s){super(e,t,r,i),this.driver=s}isatty(){return!1}async write(e){const t=new TextDecoder().decode(e),{err:r,minor:i}=await this.driver.makeRequest(t);return{err:r,written:BigInt(i)}}}class pse extends El{response;invalidate;currentBuffer;body;headers;hCursor;bCursor;constructor(e,t,r,i,s,o){super(e,t,r,i),this.response=s,this.invalidate=o,this.currentBuffer=1,this.hCursor=0,this.bCursor=0;let a=[];for(const[l,c]of this.response.headers.entries())a.push(`${l}: ${c}`);const u=new TextEncoder().encode(a.join(`
|
|
220
|
-
`));this.headers=u.buffer}isatty(){return!1}async read(e,t){let r;return this.currentBuffer===1?(this.body===void 0&&(this.body=await this.response.arrayBuffer()),r=this.body.slice(this.bCursor,this.bCursor+e),this.bCursor+=r.byteLength):(r=this.headers.slice(this.hCursor,this.hCursor+e),this.hCursor+=r.byteLength),{err:N,buffer:r}}close(){return this.invalidate()}async ioctl(e,t){switch(e){case 0:{if(t===void 0||t.byteLength<4)return iy;const r=new Int32Array(t.buffer,t.byteOffset);return r[0]=this.response.status,N}case 2:return this.currentBuffer=1,N;case 1:return this.currentBuffer=0,N;default:return Ue}}}function gse(n,e){let t,r=e.data;r instanceof ArrayBuffer?t=r:t=new TextEncoder().encode(r).buffer;let i={start:0,buf:t};for(;i.start<i.buf.byteLength&&n.requestQueue.length>0;){const s=n.requestQueue.shift(),o=t.slice(i.start,i.start+s.len);s.resolve({err:N,buffer:o}),i.start+=s.len}if(!(i.start>=i.buf.byteLength)){n.msgBuffer.push({start:0,buf:t});for(let s=n.pollQueue.shift();s!==void 0;s=n.pollQueue.shift())s.resolve({userdata:s.userdata,error:N,nbytes:BigInt(t.byteLength),eventType:of})}}class mse{websocketsDevices;topSocketId;devfs;initDriver(e){return this.websocketsDevices={},this.topSocketId=1,this.devfs=e.devfs,Promise.resolve(N)}teardownDriver(e){return Promise.resolve(N)}initDevice(e){return Promise.resolve(N)}teardownDevice(e,t){return Promise.resolve(N)}async createConnectionDevice(e){const t=this.topSocketId;let r=await this.devfs.mknodat(void 0,`ws0s${t}`,to(3,t));return r!==N?{err:r,minor:void 0}:(this.topSocketId++,this.websocketsDevices[t]=e,{err:N,minor:t})}async getDesc(e,t,r,i,s){if(e===0)return{err:N,desc:new yse(t,r,i,s,this)};if(this.websocketsDevices[e]===void 0)return{desc:void 0,err:Rn};const o=this.websocketsDevices[e];if(o.socket.readyState!==WebSocket.OPEN)return{err:S8,desc:void 0};const a=new vse(t,r,i,s,o,()=>this.invalidateConnectionDevice(e));return o.fdCount++,{err:N,desc:a}}async invalidateConnectionDevice(e){return delete this.websocketsDevices[e],this.devfs.unlinkat(void 0,`ws0s${e}`,!1)}}class yse extends El{driver;constructor(e,t,r,i,s){super(e,t,r,i),this.driver=s}isatty(){return!1}async write(e){const t=new TextDecoder().decode(e);let r;try{r=new WebSocket(t)}catch{return Promise.resolve({err:Ue,written:-1n})}let i={socket:r,msgBuffer:[],requestQueue:[],pollQueue:[],fdCount:0};const s=new Promise(l=>{r.onerror=c=>{l(BQ)}}),o=new Promise(l=>{r.onopen=c=>{l(N)}});r.binaryType="arraybuffer",r.onmessage=l=>gse(i,l),r.onclose=l=>{for(let c=i.requestQueue.shift();c!==void 0;c=i.requestQueue.shift())c.resolve({err:N,buffer:new ArrayBuffer(0)});for(let c=i.pollQueue.shift();c!==void 0;c=i.pollQueue.shift())c.resolve({userdata:c.userdata,error:N,nbytes:0n,eventType:ts})};let a=await Promise.race([s,o]);if(a!==N)return{err:a,written:-1n};r.onerror=l=>{for(let c=i.requestQueue.shift();c!==void 0;c=i.requestQueue.shift())c.resolve({err:uT,buffer:new ArrayBuffer(0)});for(let c=i.pollQueue.shift();c!==void 0;c=i.pollQueue.shift())c.resolve({userdata:c.userdata,error:uT,nbytes:0n,eventType:ts})};let u=await this.driver.createConnectionDevice(i);return u.err!==N?{err:u.err,written:-1n}:{err:u.err,written:BigInt(u.minor)}}}class vse extends El{connection;invalidate;constructor(e,t,r,i,s,o){super(e,t,r,i),this.connection=s,this.invalidate=o}isatty(){return!1}write(e){return this.connection.socket.readyState!==WebSocket.OPEN?Promise.resolve({err:S8,written:0n}):(this.connection.socket.send(e),Promise.resolve({err:N,written:BigInt(e.byteLength)}))}read(e,t){let r=this.connection.msgBuffer[0];if(r!==void 0){const i=r.buf.byteLength-r.start;let s;return i>e?(s=r.buf.slice(r.start,r.start+e),r.start+=e):(s=r.buf.slice(r.start),this.connection.msgBuffer.shift()),Promise.resolve({err:N,buffer:s})}return this.connection.socket.readyState>WebSocket.OPEN?Promise.resolve({err:N,buffer:new ArrayBuffer(0)}):new Promise(i=>{this.connection.requestQueue.push({len:e,resolve:i})})}addPollSub(e,t,r){switch(t){case yx:return this.connection.socket.readyState>WebSocket.OPEN?Promise.resolve({userdata:e,error:N,eventType:ts,nbytes:0n}):Promise.resolve({userdata:e,error:N,eventType:t,nbytes:BigInt(Number.MAX_SAFE_INTEGER)});case of:{if(this.connection.msgBuffer.length===0)return this.connection.socket.readyState>WebSocket.OPEN?Promise.resolve({userdata:e,error:N,eventType:ts,nbytes:0n}):new Promise(o=>{this.connection.pollQueue.push({pid:r,userdata:e,tag:t,resolve:o})});let i=this.connection.msgBuffer[0],s=i.buf.byteLength-i.start;return Promise.resolve({userdata:e,error:N,eventType:t,nbytes:BigInt(s)})}default:return Promise.resolve({userdata:e,error:Ue,eventType:ts,nbytes:0n})}}close(){return this.connection.fdCount--,this.connection.fdCount>0?Promise.resolve(N):(this.connection.socket.readyState===WebSocket.OPEN&&this.connection.socket.close(1e3),this.invalidate())}duplicateFd(){this.connection.fdCount++}}class bse{drivers;constructor(){this.drivers={}}async initialize(e,t){const r=new Gie;let i=await r.initDriver();if(i!==N)return i;const s=new cse;if(i=await s.initDriver({processManager:e}),i!==N)return i;const o=new hse;if(i=await o.initDriver({devfs:t}),i!==N)return i;const a=new mse;return i=await a.initDriver({devfs:t}),i!=N?i:(this.drivers[0]=r,this.drivers[1]=s,this.drivers[2]=o,this.drivers[3]=a,N)}attachDevice(e,t){return this.drivers[t].initDevice(e)}getDriver(e){return this.drivers[e]}}var wse=URL.createObjectURL(new Blob([(function(){function n(){}if(n.prototype={onmessage:function(a){try{if(a.data.type==="extract")this.untarBuffer(a.data.buffer);else throw new Error("Unknown message type: "+a.data.type)}catch(u){this.postError(u)}},postError:function(a){this.postMessage({type:"error",data:{message:a.message}})},postLog:function(a,u){this.postMessage({type:"log",data:{level:a,msg:u}})},untarBuffer:function(a){try{for(var u=new o(a);u.hasNext();){var l=u.next();this.postMessage({type:"extract",data:l},[l.buffer])}this.postMessage({type:"complete"})}catch(c){this.postError(c)}},postMessage:function(a,u){self.postMessage(a,u)}},typeof self<"u"){var e=new n;self.onmessage=function(a){e.onmessage(a)}}function t(a){for(var u="",l=0;l<a.length;){var c=a[l++];if(c>127){if(c>191&&c<224){if(l>=a.length)throw"UTF-8 decode: incomplete 2-byte sequence";c=(c&31)<<6|a[l]&63}else if(c>223&&c<240){if(l+1>=a.length)throw"UTF-8 decode: incomplete 3-byte sequence";c=(c&15)<<12|(a[l]&63)<<6|a[++l]&63}else if(c>239&&c<248){if(l+2>=a.length)throw"UTF-8 decode: incomplete 4-byte sequence";c=(c&7)<<18|(a[l]&63)<<12|(a[++l]&63)<<6|a[++l]&63}else throw"UTF-8 decode: unknown multibyte start 0x"+c.toString(16)+" at index "+(l-1);++l}if(c<=65535)u+=String.fromCharCode(c);else if(c<=1114111)c-=65536,u+=String.fromCharCode(c>>10|55296),u+=String.fromCharCode(c&1023|56320);else throw"UTF-8 decode: code point 0x"+c.toString(16)+" exceeds UTF-16 reach"}return u}function r(a){this._fields=a}r.parse=function(a){for(var u=new Uint8Array(a),l=[];u.length>0;){var c=parseInt(t(u.subarray(0,u.indexOf(32)))),f=t(u.subarray(0,c)),d=f.match(/^\d+ ([^=]+)=(.*)\n$/);if(d===null)throw new Error("Invalid PAX header data format.");var g=d[1],m=d[2];m.length===0?m=null:m.match(/^\d+$/)!==null&&(m=parseInt(m));var y={name:g,value:m};l.push(y),u=u.subarray(c)}return new r(l)},r.prototype={applyHeader:function(a){this._fields.forEach(function(u){var l=u.name,c=u.value;l==="path"?(l="name",a.prefix!==void 0&&delete a.prefix):l==="linkpath"&&(l="linkname"),c===null?delete a[l]:a[l]=c})}};function i(){}function s(a){this._bufferView=new DataView(a),this._position=0}s.prototype={readString:function(a){for(var u=1,l=a*u,c=[],f=0;f<a;++f){var d=this._bufferView.getUint8(this.position()+f*u,!0);if(d!==0)c.push(d);else break}return this.seek(l),String.fromCharCode.apply(null,c)},readBuffer:function(a){var u;if(typeof ArrayBuffer.prototype.slice=="function")u=this._bufferView.buffer.slice(this.position(),this.position()+a);else{u=new ArrayBuffer(a);var l=new Uint8Array(u),c=new Uint8Array(this._bufferView.buffer,this.position(),a);l.set(c)}return this.seek(a),u},seek:function(a){this._position+=a},peekUint32:function(){return this._bufferView.getUint32(this.position(),!0)},position:function(a){if(a===void 0)return this._position;this._position=a},size:function(){return this._bufferView.byteLength}};function o(a){this._stream=new s(a),this._globalPaxHeader=null}o.prototype={hasNext:function(){return this._stream.position()+4<this._stream.size()&&this._stream.peekUint32()!==0},next:function(){return this._readNextFile()},_readNextFile:function(){var a=this._stream,u=new i,l=!1,c=null,f=a.position(),d=f+512;switch(u.name=a.readString(100),u.mode=a.readString(8),u.uid=parseInt(a.readString(8)),u.gid=parseInt(a.readString(8)),u.size=parseInt(a.readString(12),8),u.mtime=parseInt(a.readString(12),8),u.checksum=parseInt(a.readString(8)),u.type=a.readString(1),u.linkname=a.readString(100),u.ustarFormat=a.readString(6),u.ustarFormat.indexOf("ustar")>-1&&(u.version=a.readString(2),u.uname=a.readString(32),u.gname=a.readString(32),u.devmajor=parseInt(a.readString(8)),u.devminor=parseInt(a.readString(8)),u.namePrefix=a.readString(155),u.namePrefix.length>0&&(u.name=u.namePrefix+"/"+u.name)),a.position(d),u.type){case"0":case"":u.buffer=a.readBuffer(u.size);break;case"1":break;case"2":break;case"3":break;case"4":break;case"5":break;case"6":break;case"7":break;case"g":l=!0,this._globalPaxHeader=r.parse(a.readBuffer(u.size));break;case"x":l=!0,c=r.parse(a.readBuffer(u.size));break}u.buffer===void 0&&(u.buffer=new ArrayBuffer(0));var g=d+u.size;return u.size%512!==0&&(g+=512-u.size%512),a.position(g),l&&(u=this._readNextFile()),this._globalPaxHeader!==null&&this._globalPaxHeader.applyHeader(u),c!==null&&c.applyHeader(u),u}}}).toString().slice(11,-1)],{type:"test/javascript"}));function _se(n){if(typeof Promise!="function")throw new Error("Promise implementation not available in this environment.");var e=[],t=[];function r(o){for(var a=0,u=e.length;a<u;++a)e[a](o);t.push(o)}var i=new Promise(function(o,a){n(o,a,r)});i.progress=function(o){if(typeof o!="function")throw new Error("cb is not a function.");for(var a=0,u=t.length;a<u;++a)o(t[a]);return e.push(o),i};var s=i.then;return i.then=function(o,a,u){return s.call(i,o,a),u!==void 0&&i.progress(u),i},i}var J2=window||void 0,kse=J2.URL||J2.webkitURL;function xse(n){if(!(n instanceof ArrayBuffer))throw new TypeError("arrayBuffer is not an instance of ArrayBuffer.");if(!J2.Worker)throw new Error("Worker implementation is not available in this environment.");return new _se(function(e,t,r){var i=new Worker(wse),s=[];i.onerror=function(o){t(o)},i.onmessage=function(o){switch(o=o.data,o.type){case"log":console[o.data.level]("Worker: "+o.data.msg);break;case"extract":var a=Cse(o.data);s.push(a),r(a);break;case"complete":i.terminate(),e(s);break;case"error":i.terminate(),t(new Error(o.data.message));break;default:i.terminate(),t(new Error("Unknown message from worker: "+o.type));break}},i.postMessage({type:"extract",buffer:n},[n])})}var Sse={blob:{get:function(){return this._blob||(this._blob=new Blob([this.buffer]))}},getBlobUrl:{value:function(){return this._blobUrl||(this._blobUrl=kse.createObjectURL(this.blob))}},readAsString:{value:function(){for(var n=this.buffer,e=n.byteLength,t=1,r=new DataView(n),i=[],s=0;s<e;++s){var o=r.getUint8(s*t,!0);i.push(o)}return this._string=String.fromCharCode.apply(null,i)}},readAsJSON:{value:function(){return JSON.parse(this.readAsString())}}};function Cse(n){return Object.defineProperties(n,Sse),n}const Ese="/dev/initr.kfifo",Ase="/dev/initw.kfifo";class Rse{fifow;fifor;tfs;async initialize(e){this.tfs=e;let t;return t=await e.open(Ase,xn,0,0,mc,mc),t.err!==N||(this.fifor=t.desc,t=await e.open(Ese,xn,0,0,Ec,Ec),t.err!==N)?t.err:(this.fifow=t.desc,N)}async spawn(e,t){const r=new TextEncoder().encode(JSON.stringify({Spawn:{cmd:e,args:t,kern:!0}}));await this.fifow.write(r.buffer);const{err:i,buffer:s}=await this.fifor.read(64);if(i!==N)throw new Error("Could not spawn process");const o=new TextDecoder().decode(s).split(" "),a=Number(o[0]),u=Number(o[1]);let l=await this.tfs.open(`/dev/spawn_stdin.${a}`,0,0,0,Ec);if(l.err!==N)throw new Error("Could not open stdin descriptor");const c=l.desc;if(l=await this.tfs.open(`/dev/spawn_stdout.${a}`,0,0,0,mc),l.err!==N)throw new Error("Could not open stdout descriptor");const f=l.desc;if(l=await this.tfs.open(`/dev/spawn_stderr.${a}`,0,0,0,mc),l.err!==N)throw new Error("Could not open stderr descriptor");const d=l.desc;return{stdin:c,stdout:f,stderr:d,pid:u}}}class Dse{processManager;topLevelFs;driverManager;deviceFilesystem;devFsPromise;initializing;jsInterface;__printk(e){console.log("printk: ",e);try{this.driverManager.getDriver(1).terminals[0].terminal.io.println(uee(e))}catch{}}constructor(){this.driverManager=new bse,this.topLevelFs=new jie,this.processManager=new xee(new URL("/assets/process-Dw9K5EnD.js",import.meta.url),this.topLevelFs,this.driverManager),this.devFsPromise=Bie(this.driverManager,this.processManager).then(e=>{this.deviceFilesystem=e}),this.jsInterface=new Rse}async attachDevice(e,t){return await this.devFsPromise,this.driverManager.attachDevice(e,t)}async tearDown(e){e("Starting purge...");const t=await navigator.storage.getDirectory();e("Cleaning storage...");for await(const r of t.keys())e(`Removing ${r}...`),await t.removeEntry(r,{recursive:!0});e("Cleaning metadata..."),await new Promise(r=>{window.indexedDB.databases().then(i=>{Promise.all(i.map(s=>{window.indexedDB.deleteDatabase(s.name)})).then(r)})}),e("Purge complete")}async init(e,t=!0){let r,i;this.initializing=new Promise((s,o)=>{r=s,i=o});try{if(console.log("awaitning devFsPromise"),await this.devFsPromise,console.log("devFsPromise resolved"),!navigator.storage.getDirectory){this.__printk("Your browser doesn't support File System Access API yet."),this.__printk("We recommend using Chrome for the time being.");return}if(t&&(this.__printk("Registering service worker"),!await Pse())){this.__printk("Service Worker registration failed");return}if(typeof SharedArrayBuffer>"u"){t?(this.__printk("SharedArrayBuffer undefined, reloading page"),window.location.href=window.location.href):this.__printk("SharedArrayBuffer undefined, aborting");return}e==null&&(this.__printk("Reading kernel config"),e=await Lse(this.topLevelFs)),await yI(this.topLevelFs,e.mountConfig)!==N&&this.__printk("Failed to mount root filesystem"),this.__printk("Reading init system");const{err:s}=await this.topLevelFs.open(e.init,xn);if(s!==N){this.__printk("Init system not present"),this.__printk("Starting rootfs initialization");let l=e.rootfs;l===void 0&&(this.__printk("Rootfs image not configured in kernel config, using default"),l="https://antmicro.github.io/jswasi-rootfs/rootfs.tar.gz");const c=await fetch(l),f=c.headers.get("Content-Encoding");let d=c.body;if(f==="gzip")d=gI(d);else if(!f){const g=c.headers.get("Content-Type");(g==="application/gzip"||g==="application/x-gzip")&&(d=gI(d))}if(s===Kd){this.__printk("Root filesystem corrupted, attempting recovery mode"),this.topLevelFs.removeMount("/");const g=Ise;await yI(this.topLevelFs,g),this.__printk("VirtualFilesystem mounted on /"),await mI(this.topLevelFs,await new Response(d).arrayBuffer()),await Mse(this.topLevelFs)}else await mI(this.topLevelFs,await new Response(d).arrayBuffer());this.__printk("Rootfs initialized")}await this.topLevelFs.createDir("/dev"),this.__printk("Mounting device filesystem"),await this.topLevelFs.addMountFs("/dev",this.deviceFilesystem),await this.topLevelFs.createDir("/proc"),this.__printk("Mounting proc filesystem"),await this.topLevelFs.addMountFs("/proc",new Vie(this.processManager)),await this.topLevelFs.createDir("/tmp"),this.__printk("Mounting temp filesystem"),await this.topLevelFs.addMount(void 0,"",void 0,"/tmp","vfs",0n,{});let o=await this.topLevelFs.open("/");if(o.err){this.__printk("Could not open root file descriptor for the init system");return}const u=(await this.topLevelFs.open("/dev/ttyH0")).err===N?{maj:1,min:0}:null;this.__printk("Starting init"),r(!0),await this.processManager.spawnProcess(null,null,e.init,new ay({3:new Ac(o.desc)}),e.initArgs,F8,!1,pd,u),console.log("spawned init process")}catch(s){console.error("Error initializing:",s),i(s)}}}const Tse="fsa0",fw="/config.json",Ise={fsType:"vfs",opts:{}};async function Mse(n){const{err:e,desc:t}=await n.open("/etc/motd",xn,Ti|vx);if(e!==N)return;const r=new TextEncoder().encode(`
|
|
221
|
-
[WARNING] Could not mount filesystem, volatile filesystem used as root for recovery
|
|
222
|
-
`);await t.write(r.buffer),await t.close()}async function Ose(n,e,t,r=!0){const{err:i,desc:s}=await n.open(e,xn,Ti);if(i!==N)return console.warn(`Unable to resolve path for ${e}`),i;if(r||(await s.getFilestat()).filestat.size===0n){await s.truncate(0n);const o=await fetch(t);if(o.status!=200)return Rn;{const{err:a,stream:u}=await s.writableStream();if(a!=N)return a;await o.body?.pipeTo(u)}}return await s.close(),N}function gI(n){const e=new DecompressionStream("gzip");return n.pipeThrough(e)}async function mI(n,e){const t=await xse(e);for(const r of t)switch(r.type){case"":case"0":{let{err:i,desc:s}=await n.open(r.name,0,Ti);if(i!==N)throw Error("Corrupted rootfs image");const o=(await s.writableStream()).stream;await r.blob.stream().pipeTo(o),await s.close();break}case"5":{if(await n.createDir(r.name)!==N)throw Error("Corrupted rootfs image");break}case"2":{if(await n.addSymlink(r.linkname,r.name)!==N)throw Error("Corrupted rootfs image");break}}}function Pse(n,e){if(typeof navigator>"u"||!("serviceWorker"in navigator))return Promise.resolve(!1);let t;try{t=new URL("data:text/javascript;base64,InVzZSBzdHJpY3QiOwpjb25zdCBDQUNIRV9OQU1FID0gIndhc2gtY2FjaGUiOwpjb25zdCB1cmxzVG9DYWNoZSA9IFsKICAgICIuL3Byb2Nlc3MuanMiLAogICAgIi4vc3lzY2FsbHMuanMiLAogICAgIi4vdXRpbHMuanMiLAogICAgIi4vcHJvY2Vzcy1tYW5hZ2VyLmpzIiwKICAgICIuL3R5cGVzLmpzIiwKICAgICIuL2RldmljZXMuanMiLAogICAgIi4vYnJvd3Nlci1hcHBzLmpzIiwKICAgICIuL2ZpbGVzeXN0ZW0vcHJvYy1maWxlc3lzdGVtL3Byb2MtZmlsZXN5c3RlbS5qcyIsCiAgICAiLi9maWxlc3lzdGVtL3Byb2MtZmlsZXN5c3RlbS9wcm9jLXRyZWUuanMiLAogICAgIi4vZmlsZXN5c3RlbS9wcm9jLWZpbGVzeXN0ZW0vcHJvYy1kZXNjcmlwdG9ycy5qcyIsCiAgICAiLi9maWxlc3lzdGVtL3RvcC1sZXZlbC1mcy5qcyIsCiAgICAiLi9maWxlc3lzdGVtL2ZpbGVzeXN0ZW0uanMiLAogICAgIi4vZmlsZXN5c3RlbS9mc2EtZmlsZXN5c3RlbS91dGlscy5qcyIsCiAgICAiLi9maWxlc3lzdGVtL2ZzYS1maWxlc3lzdGVtL2ZzYS1maWxlc3lzdGVtLmpzIiwKICAgICIuL2ZpbGVzeXN0ZW0vZnNhLWZpbGVzeXN0ZW0vZnNhLWRlc2NyaXB0b3JzLmpzIiwKICAgICIuL2ZpbGVzeXN0ZW0vZnNhLWZpbGVzeXN0ZW0vbWV0YWRhdGEuanMiLAogICAgIi4vZmlsZXN5c3RlbS92aXJ0dWFsLWZpbGVzeXN0ZW0vdmlydHVhbC1maWxlc3lzdGVtLmpzIiwKICAgICIuL2ZpbGVzeXN0ZW0vdmlydHVhbC1maWxlc3lzdGVtL3Rlcm1pbmFscy9odGVybS10ZXJtaW5hbC5qcyIsCiAgICAiLi9maWxlc3lzdGVtL3ZpcnR1YWwtZmlsZXN5c3RlbS90ZXJtaW5hbHMvdGVybWluYWwuanMiLAogICAgIi4vZmlsZXN5c3RlbS92aXJ0dWFsLWZpbGVzeXN0ZW0vdGVybWluYWxzL3Rlcm1pb3MuanMiLAogICAgIi4vZmlsZXN5c3RlbS92aXJ0dWFsLWZpbGVzeXN0ZW0vZGV2aWNlcy9kcml2ZXItbWFuYWdlci5qcyIsCiAgICAiLi9maWxlc3lzdGVtL3ZpcnR1YWwtZmlsZXN5c3RlbS9kZXZpY2VzL2RldmljZS1maWxlc3lzdGVtLmpzIiwKICAgICIuL2ZpbGVzeXN0ZW0vdmlydHVhbC1maWxlc3lzdGVtL2RldmljZXMvZmlmby5qcyIsCiAgICAiLi9maWxlc3lzdGVtL3ZpcnR1YWwtZmlsZXN5c3RlbS9kZXZpY2VzL3dnZXQtZGV2aWNlLmpzIiwKICAgICIuL2ZpbGVzeXN0ZW0vdmlydHVhbC1maWxlc3lzdGVtL2RldmljZXMvbWVtLWRldmljZXMuanMiLAogICAgIi4vZmlsZXN5c3RlbS92aXJ0dWFsLWZpbGVzeXN0ZW0vZGV2aWNlcy9hYnN0cmFjdC1kZXZpY2UtZGVzY3JpcHRvci5qcyIsCiAgICAiLi9qc3dhc2kuanMiLAogICAgIi4vY29uc3RhbnRzLmpzIiwKICAgICIuL3NlcnZpY2Utd29ya2VyLmpzIiwKICAgICIuL3RoaXJkX3BhcnR5L2h0ZXJtLmpzIiwKICAgICIuL3RoaXJkX3BhcnR5L3Zmcy5qcyIsCiAgICAiLi90aGlyZF9wYXJ0eS9pZGIta2V5dmFsLmpzIiwKXTsKc2VsZi5hZGRFdmVudExpc3RlbmVyKCJpbnN0YWxsIiwgYXN5bmMgKCkgPT4gewogICAgY29uc3QgY2FjaGUgPSBhd2FpdCBjYWNoZXMub3BlbihDQUNIRV9OQU1FKTsKICAgIGF3YWl0IGNhY2hlLmFkZEFsbCh1cmxzVG9DYWNoZSk7Cn0pOwphc3luYyBmdW5jdGlvbiBoYW5kbGVGZXRjaChyZXF1ZXN0KSB7CiAgICByZXR1cm4gY2FjaGVzLm1hdGNoKHJlcXVlc3QpLnRoZW4oYXN5bmMgKHJlc3BvbnNlKSA9PiB7CiAgICAgICAgaWYgKHJlc3BvbnNlID09PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgaWYgKHJlcXVlc3QubW9kZSA9PT0gIm5vLWNvcnMiKSB7CiAgICAgICAgICAgICAgICByZXF1ZXN0ID0gbmV3IFJlcXVlc3QocmVxdWVzdC51cmwsIHsKICAgICAgICAgICAgICAgICAgICBjYWNoZTogcmVxdWVzdC5jYWNoZSwKICAgICAgICAgICAgICAgICAgICBjcmVkZW50aWFsczogIm9taXQiLAogICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHJlcXVlc3QuaGVhZGVycywKICAgICAgICAgICAgICAgICAgICBpbnRlZ3JpdHk6IHJlcXVlc3QuaW50ZWdyaXR5LAogICAgICAgICAgICAgICAgICAgIC8vIEB0cy1pZ25vcmUKICAgICAgICAgICAgICAgICAgICBkZXN0aW5hdGlvbjogcmVxdWVzdC5kZXN0aW5hdGlvbiwKICAgICAgICAgICAgICAgICAgICBrZWVwYWxpdmU6IHJlcXVlc3Qua2VlcGFsaXZlLAogICAgICAgICAgICAgICAgICAgIG1ldGhvZDogcmVxdWVzdC5tZXRob2QsCiAgICAgICAgICAgICAgICAgICAgbW9kZTogcmVxdWVzdC5tb2RlLAogICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiByZXF1ZXN0LnJlZGlyZWN0LAogICAgICAgICAgICAgICAgICAgIHJlZmVycmVyOiByZXF1ZXN0LnJlZmVycmVyLAogICAgICAgICAgICAgICAgICAgIHJlZmVycmVyUG9saWN5OiByZXF1ZXN0LnJlZmVycmVyUG9saWN5LAogICAgICAgICAgICAgICAgICAgIHNpZ25hbDogcmVxdWVzdC5zaWduYWwsCiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgfQogICAgICAgICAgICByZXNwb25zZSA9IGF3YWl0IGZldGNoKHJlcXVlc3QpOwogICAgICAgIH0KICAgICAgICBpZiAocmVzcG9uc2Uuc3RhdHVzID09PSAwKQogICAgICAgICAgICByZXR1cm4gcmVzcG9uc2U7CiAgICAgICAgY29uc3QgaGVhZGVycyA9IG5ldyBIZWFkZXJzKHJlc3BvbnNlLmhlYWRlcnMpOwogICAgICAgIGhlYWRlcnMuc2V0KCJDcm9zcy1PcmlnaW4tRW1iZWRkZXItUG9saWN5IiwgInJlcXVpcmUtY29ycCIpOwogICAgICAgIGhlYWRlcnMuc2V0KCJDcm9zcy1PcmlnaW4tT3BlbmVyLVBvbGljeSIsICJzYW1lLW9yaWdpbiIpOwogICAgICAgIHJldHVybiBuZXcgUmVzcG9uc2UocmVzcG9uc2UuYm9keSwgewogICAgICAgICAgICBzdGF0dXM6IHJlc3BvbnNlLnN0YXR1cywKICAgICAgICAgICAgc3RhdHVzVGV4dDogcmVzcG9uc2Uuc3RhdHVzVGV4dCwKICAgICAgICAgICAgaGVhZGVycwogICAgICAgIH0pOwogICAgfSk7Cn0Kc2VsZi5hZGRFdmVudExpc3RlbmVyKCJmZXRjaCIsIChldmVudCkgPT4gewogICAgY29uc3QgZmV0Y2hFdmVudCA9IGV2ZW50OwogICAgY29uc3QgcmVxdWVzdCA9IGZldGNoRXZlbnQucmVxdWVzdDsKICAgIGZldGNoRXZlbnQucmVzcG9uZFdpdGgoaGFuZGxlRmV0Y2gocmVxdWVzdCkpOwp9KTsK",import.meta.url)}catch{t="service-worker.js"}return new Promise(r=>{navigator.serviceWorker.register(t,void 0).then(i=>{i?(i.onupdatefound=()=>r(!0),i.active&&r(!0)):r(!1)},i=>r(!1))})}async function Lse(n){await n.addMount(void 0,"",void 0,"/","fsa",0n,{name:Tse,create:"true",keepMetadata:"false"});let e;const{err:t,desc:r}=await n.open(fw);if(t===N){let{err:i,content:s}=await r.read_str();if(i===N)try{e=JSON.parse(s)}catch{}await r.close()}if(e===void 0){await Ose(n,fw,"resources/config.json");const{desc:i}=await n.open(fw),{content:s}=await i.read_str();e=JSON.parse(s)}return n.removeMount("/"),e}function yI(n,e){return n.addMount(void 0,"",void 0,"/",e.fsType,0n,e.opts)}async function Fse(){const n=new Dse;return console.log("have jswasi",n),await n.init(),console.log("jswasi initialized",n),await w1.fromJswasi(n)}const Qx=await Fse();console.log("got fs",Qx);const Nse=document.getElementById("editor"),Bse=".codeblock/index.json",qse=await pc.get(Qx,Bse);IJ({parent:Nse,fs:Qx,language:"ts",toolbar:!0,index:qse,cwd:"/"});export{gt as A,tl as B,LO as C,Fj as D,Ae as E,QM as F,Lc as G,Gse as H,fn as I,s$ as J,Hse as L,gk as N,GM as P,Gt as T,Jw as a,Zse as b,Kse as c,uoe as d,OH as e,v$ as f,lr as g,Vr as h,e6 as i,ot as j,Vse as k,$se as l,loe as m,$$ as n,me as o,Gi as p,zse as q,y$ as r,e$ as s,oe as t,hu as u,Zc as v,Xi as w,YM as x,Kc as y,Xc as z};
|