diff --git a/docs/_app/immutable/chunks/4.4fec7683.js b/docs/_app/immutable/chunks/4.d3e95b29.js similarity index 72% rename from docs/_app/immutable/chunks/4.4fec7683.js rename to docs/_app/immutable/chunks/4.d3e95b29.js index 9e8e699..cf91a84 100644 --- a/docs/_app/immutable/chunks/4.4fec7683.js +++ b/docs/_app/immutable/chunks/4.d3e95b29.js @@ -1,13 +1,13 @@ -var jp=Object.defineProperty;var Vp=(s,e,t)=>e in s?jp(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var qe=(s,e,t)=>(Vp(s,typeof e!="symbol"?e+"":e,t),t),Hp=(s,e,t)=>{if(!e.has(s))throw TypeError("Cannot "+t)};var ol=(s,e,t)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,t)};var Ns=(s,e,t)=>(Hp(s,e,"access private method"),t);import{a as Fp,d as Wp,s as qp}from"./data.2bee4aae.js";import{s as be,f as x,g as A,h as P,d as _,j as k,i as S,r as de,u as _t,l as I,a as Q,m as z,c as ee,v as ie,w as y,y as ue,n as re,C as Tt,e as ce,k as it,J as Dr,K as Eo,E as Et,F as Ot,G as Dt,L as Pr,M as Uf,p as Ye,H as Kf,z as Oo,A as Me,x as Te,N as Pn,D as Nr,O as pa,B as Ve,t as as,P as ri,Q as Jf,R as ln,S as ma,T as Gf,o as Do,U as cr,q as ga,V as Up,W as ba}from"./scheduler.8d4e2d99.js";import{S as _e,i as ke,a as w,t as T,g as Se,c as xe,f as _a,b as U,d as G,m as K,e as J,h as on,n as ka,l as Kp}from"./index.e9e8ac0c.js";import{M as Jp,f as Gp}from"./Markdown.8506a4bc.js";import{n as Yp}from"./stores.23fc378a.js";import{e as Oe,u as Xp,d as Zp}from"./each.5f097185.js";import{w as ot,r as Qp,k as em}from"./singletons.6475323f.js";import{_ as Mn}from"./preload-helper.a4192956.js";import{s as va}from"./index.9ff153fe.js";function ya(s,e){const t={},n={},i={$$scope:1};let r=s.length;for(;r--;){const l=s[r],o=e[r];if(o){for(const a in l)a in o||(n[a]=1);for(const a in o)i[a]||(t[a]=o[a],i[a]=1);s[r]=o}else for(const a in l)i[a]=1}for(const l in n)l in t||(t[l]=void 0);return t}function wa(s){return typeof s=="object"&&s!==null?s:{}}async function tm({params:s}){const e=Fp(Wp,s.slug);return{title:e.title,slug:s.slug,repl:e.files}}const lS=Object.freeze(Object.defineProperty({__proto__:null,load:tm},Symbol.toStringTag,{value:"Module"}));function Sa(s,e,t){const n=s.slice();return n[3]=e[t],n[5]=t,n}function xa(s){let e,t=s[3]+"",n,i,r,l;function o(){return s[2](s[5])}return{c(){e=x("button"),n=I(t),i=Q(),this.h()},l(a){e=A(a,"BUTTON",{class:!0});var h=P(e);n=z(h,t),i=ee(h),h.forEach(_),this.h()},h(){k(e,"class","svelte-o6j61a"),ie(e,"selected",s[0]===s[5])},m(a,h){S(a,e,h),y(e,n),y(e,i),r||(l=ue(e,"click",o),r=!0)},p(a,h){s=a,h&2&&t!==(t=s[3]+"")&&re(n,t),h&1&&ie(e,"selected",s[0]===s[5])},d(a){a&&_(e),r=!1,l()}}}function nm(s){let e,t=Oe(s[1]),n=[];for(let i=0;it(0,i=l);return s.$$set=l=>{"labels"in l&&t(1,n=l.labels),"offset"in l&&t(0,i=l.offset)},[i,n,r]}class sm extends _e{constructor(e){super(),ke(this,e,im,nm,be,{labels:1,offset:0})}}class De{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,n){[e,t]=Ti(this,e,t);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),an.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Ti(this,e,t);let n=[];return this.decompose(e,t,n,0),an.from(n,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),n=this.length-this.scanIdentical(e,-1),i=new ts(this),r=new ts(e);for(let l=t,o=t;;){if(i.next(l),r.next(l),l=0,i.lineBreak!=r.lineBreak||i.done!=r.done||i.value!=r.value)return!1;if(o+=i.value.length,i.done||o>=n)return!0}}iter(e=1){return new ts(this,e)}iterRange(e,t=this.length){return new Yf(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Xf(n)}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]?De.empty:e.length<=32?new Ke(e):an.from(Ke.split(e,[]))}}class Ke extends De{constructor(e,t=rm(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,i){for(let r=0;;r++){let l=this.text[r],o=i+l.length;if((t?n:o)>=e)return new lm(i,o,n,l);i=o+1,n++}}decompose(e,t,n,i){let r=e<=0&&t>=this.length?this:new Ke(Aa(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let l=n.pop(),o=er(r.text,l.text.slice(),0,r.length);if(o.length<=32)n.push(new Ke(o,l.length+r.length));else{let a=o.length>>1;n.push(new Ke(o.slice(0,a)),new Ke(o.slice(a)))}}else n.push(r)}replace(e,t,n){if(!(n instanceof Ke))return super.replace(e,t,n);[e,t]=Ti(this,e,t);let i=er(this.text,er(n.text,Aa(this.text,0,e)),t),r=this.length+n.length-(t-e);return i.length<=32?new Ke(i,r):an.from(Ke.split(i,[]),r)}sliceString(e,t=this.length,n=` +var jp=Object.defineProperty;var Vp=(s,e,t)=>e in s?jp(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var qe=(s,e,t)=>(Vp(s,typeof e!="symbol"?e+"":e,t),t),Hp=(s,e,t)=>{if(!e.has(s))throw TypeError("Cannot "+t)};var ol=(s,e,t)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,t)};var Ns=(s,e,t)=>(Hp(s,e,"access private method"),t);import{a as Fp,d as Wp,s as qp}from"./data.58f39500.js";import{s as be,f as x,g as A,h as P,d as _,j as k,i as S,r as de,u as _t,l as I,a as Q,m as z,c as ee,v as ie,w as y,y as ue,n as re,C as Tt,e as ce,k as it,J as Dr,K as Eo,E as Et,F as Ot,G as Dt,L as Pr,M as Uf,p as Ye,H as Kf,z as Oo,A as Me,x as Te,N as Pn,D as Nr,O as pa,B as Ve,t as as,P as ri,Q as Jf,R as ln,S as ma,T as Gf,o as Do,U as cr,q as ga,V as Up,W as ba}from"./scheduler.8d4e2d99.js";import{S as _e,i as ke,a as w,t as T,g as Se,c as xe,f as _a,b as U,d as G,m as K,e as J,h as on,n as ka,l as Kp}from"./index.e9e8ac0c.js";import{M as Jp,f as Gp}from"./Markdown.9968e4f5.js";import{n as Yp}from"./stores.b8409277.js";import{e as Oe,u as Xp,d as Zp}from"./each.5f097185.js";import{w as ot,r as Qp,k as em}from"./singletons.5d1b3ade.js";import{_ as Mn}from"./preload-helper.a4192956.js";import{s as va}from"./index.9ff153fe.js";function ya(s,e){const t={},n={},i={$$scope:1};let r=s.length;for(;r--;){const l=s[r],o=e[r];if(o){for(const a in l)a in o||(n[a]=1);for(const a in o)i[a]||(t[a]=o[a],i[a]=1);s[r]=o}else for(const a in l)i[a]=1}for(const l in n)l in t||(t[l]=void 0);return t}function wa(s){return typeof s=="object"&&s!==null?s:{}}async function tm({params:s}){const e=Fp(Wp,s.slug);return{title:e.title,slug:s.slug,repl:e.files}}const lS=Object.freeze(Object.defineProperty({__proto__:null,load:tm},Symbol.toStringTag,{value:"Module"}));function Sa(s,e,t){const n=s.slice();return n[3]=e[t],n[5]=t,n}function xa(s){let e,t=s[3]+"",n,i,r,l;function o(){return s[2](s[5])}return{c(){e=x("button"),n=I(t),i=Q(),this.h()},l(a){e=A(a,"BUTTON",{class:!0});var h=P(e);n=z(h,t),i=ee(h),h.forEach(_),this.h()},h(){k(e,"class","svelte-o6j61a"),ie(e,"selected",s[0]===s[5])},m(a,h){S(a,e,h),y(e,n),y(e,i),r||(l=ue(e,"click",o),r=!0)},p(a,h){s=a,h&2&&t!==(t=s[3]+"")&&re(n,t),h&1&&ie(e,"selected",s[0]===s[5])},d(a){a&&_(e),r=!1,l()}}}function nm(s){let e,t=Oe(s[1]),n=[];for(let i=0;it(0,i=l);return s.$$set=l=>{"labels"in l&&t(1,n=l.labels),"offset"in l&&t(0,i=l.offset)},[i,n,r]}class sm extends _e{constructor(e){super(),ke(this,e,im,nm,be,{labels:1,offset:0})}}class De{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,n){[e,t]=Ti(this,e,t);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),an.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Ti(this,e,t);let n=[];return this.decompose(e,t,n,0),an.from(n,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),n=this.length-this.scanIdentical(e,-1),i=new ts(this),r=new ts(e);for(let l=t,o=t;;){if(i.next(l),r.next(l),l=0,i.lineBreak!=r.lineBreak||i.done!=r.done||i.value!=r.value)return!1;if(o+=i.value.length,i.done||o>=n)return!0}}iter(e=1){return new ts(this,e)}iterRange(e,t=this.length){return new Yf(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Xf(n)}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]?De.empty:e.length<=32?new Ke(e):an.from(Ke.split(e,[]))}}class Ke extends De{constructor(e,t=rm(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,i){for(let r=0;;r++){let l=this.text[r],o=i+l.length;if((t?n:o)>=e)return new lm(i,o,n,l);i=o+1,n++}}decompose(e,t,n,i){let r=e<=0&&t>=this.length?this:new Ke(Aa(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let l=n.pop(),o=er(r.text,l.text.slice(),0,r.length);if(o.length<=32)n.push(new Ke(o,l.length+r.length));else{let a=o.length>>1;n.push(new Ke(o.slice(0,a)),new Ke(o.slice(a)))}}else n.push(r)}replace(e,t,n){if(!(n instanceof Ke))return super.replace(e,t,n);[e,t]=Ti(this,e,t);let i=er(this.text,er(n.text,Aa(this.text,0,e)),t),r=this.length+n.length-(t-e);return i.length<=32?new Ke(i,r):an.from(Ke.split(i,[]),r)}sliceString(e,t=this.length,n=` `){[e,t]=Ti(this,e,t);let i="";for(let r=0,l=0;r<=t&&le&&l&&(i+=n),er&&(i+=o.slice(Math.max(0,e-r),t-r)),r=a+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],i=-1;for(let r of e)n.push(r),i+=r.length+1,n.length==32&&(t.push(new Ke(n,i)),n=[],i=-1);return i>-1&&t.push(new Ke(n,i)),t}}class an extends De{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,i){for(let r=0;;r++){let l=this.children[r],o=i+l.length,a=n+l.lines-1;if((t?a:o)>=e)return l.lineInner(e,t,n,i);i=o+1,n=a+1}}decompose(e,t,n,i){for(let r=0,l=0;l<=t&&r=l){let h=i&((l<=e?1:0)|(a>=t?2:0));l>=e&&a<=t&&!h?n.push(o):o.decompose(e-l,t-l,n,h)}l=a+1}}replace(e,t,n){if([e,t]=Ti(this,e,t),n.lines=r&&t<=o){let a=l.replace(e-r,t-r,n),h=this.lines-l.lines+a.lines;if(a.lines>5-1&&a.lines>h>>5+1){let c=this.children.slice();return c[i]=a,new an(c,this.length-(t-e)+n.length)}return super.replace(r,o,a)}r=o+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=` `){[e,t]=Ti(this,e,t);let i="";for(let r=0,l=0;re&&r&&(i+=n),el&&(i+=o.sliceString(e-l,t-l,n)),l=a+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof an))return 0;let n=0,[i,r,l,o]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,r+=t){if(i==l||r==o)return n;let a=this.children[i],h=e.children[r];if(a!=h)return n+a.scanIdentical(h,t);n+=a.length+1}}static from(e,t=e.reduce((n,i)=>n+i.length+1,-1)){let n=0;for(let d of e)n+=d.lines;if(n<32){let d=[];for(let p of e)p.flatten(d);return new Ke(d,t)}let i=Math.max(32,n>>5),r=i<<1,l=i>>1,o=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof an)for(let m of d.children)f(m);else d.lines>l&&(a>l||!a)?(u(),o.push(d)):d instanceof Ke&&a&&(p=c[c.length-1])instanceof Ke&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new Ke(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>i&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(o.push(c.length==1?c[0]:an.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),o.length==1?o[0]:new an(o,t)}}De.empty=new Ke([""],0);function rm(s){let e=-1;for(let t of s)e+=t.length+1;return e}function er(s,e,t=0,n=1e9){for(let i=0,r=0,l=!0;r=t&&(a>n&&(o=o.slice(0,n-i)),i0?1:(e instanceof Ke?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],r=this.offsets[n],l=r>>1,o=i instanceof Ke?i.text.length:i.children.length;if(l==(t>0?o:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=` `,this;e--}else if(i instanceof Ke){let a=i.text[l+(t<0?-1:0)];if(this.offsets[n]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=i.children[l+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof Ke?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Yf{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new ts(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}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 n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=n?i:t<0?i.slice(i.length-n):i.slice(0,n),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 Xf{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(De.prototype[Symbol.iterator]=function(){return this.iter()},ts.prototype[Symbol.iterator]=Yf.prototype[Symbol.iterator]=Xf.prototype[Symbol.iterator]=function(){return this});class lm{constructor(e,t,n,i){this.from=e,this.to=t,this.number=n,this.text=i}get length(){return this.to-this.from}}function Ti(s,e,t){return e=Math.max(0,Math.min(s.length,e)),[e,Math.max(e,Math.min(s.length,t))]}let xi="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(s=>s?parseInt(s,36):1);for(let s=1;ss)return xi[e-1]<=s;return!1}function Ca(s){return s>=127462&&s<=127487}const Ma=8205;function mt(s,e,t=!0,n=!0){return(t?Zf:am)(s,e,n)}function Zf(s,e,t){if(e==s.length)return e;e&&Qf(s.charCodeAt(e))&&eu(s.charCodeAt(e-1))&&e--;let n=ns(s,e);for(e+=Dl(n);e=0&&Ca(ns(s,l));)r++,l-=2;if(r%2==0)break;e+=2}else break}return e}function am(s,e,t){for(;e>0;){let n=Zf(s,e-2,t);if(n=56320&&s<57344}function eu(s){return s>=55296&&s<56320}function ns(s,e){let t=s.charCodeAt(e);if(!eu(t)||e+1==s.length)return t;let n=s.charCodeAt(e+1);return Qf(n)?(t-55296<<10)+(n-56320)+65536:t}function oS(s){return s<=65535?String.fromCharCode(s):(s-=65536,String.fromCharCode((s>>10)+55296,(s&1023)+56320))}function Dl(s){return s<65536?1:2}const Pl=/\r\n?|\n/;var vt=function(s){return s[s.Simple=0]="Simple",s[s.TrackDel=1]="TrackDel",s[s.TrackBefore=2]="TrackBefore",s[s.TrackAfter=3]="TrackAfter",s}(vt||(vt={}));class mn{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-i);r+=o}else{if(n!=vt.Simple&&h>=e&&(n==vt.TrackDel&&ie||n==vt.TrackBefore&&ie))return null;if(h>e||h==e&&t<0&&!o)return e==i||t<0?r:r+a;r+=a}i=h}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return r}touchesRange(e,t=e){for(let n=0,i=0;n=0&&i<=t&&o>=e)return it?"cover":!0;i=o}return!1}toString(){let e="";for(let t=0;t=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 mn(e)}static create(e){return new mn(e)}}class Ge extends mn{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 Nl(this,(t,n,i,r,l)=>e=e.replace(i,i+(n-t),l),!1),e}mapDesc(e,t=!1){return Bl(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let i=0,r=0;i=0){t[i]=o,t[i+1]=l;let a=i>>1;for(;n.length0&&jn(n,t,r.text),r.forward(c),o+=c}let h=e[l++];for(;o>1].toJSON()))}return e}static of(e,t,n){let i=[],r=[],l=0,o=null;function a(c=!1){if(!c&&!i.length)return;lu||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d=="string"?De.of(d.split(n||Pl)):d:De.empty,m=p.length;if(f==u&&m==0)return;fl&&ht(i,f-l,-1),ht(i,u-f,m),jn(r,i,p),l=u}}return h(e),a(!o),o}static empty(e){return new Ge(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let i=0;io&&typeof l!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;n.length=0&&t<=0&&t==s[i+1]?s[i]+=e:e==0&&s[i]==0?s[i+1]+=t:n?(s[i]+=e,s[i+1]+=t):s.push(e,t)}function jn(s,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n>1])),!(t||l==s.sections.length||s.sections[l+1]<0);)o=s.sections[l++],a=s.sections[l++];e(i,h,r,c,f),i=h,r=c}}}function Bl(s,e,t,n=!1){let i=[],r=n?[]:null,l=new hs(s),o=new hs(e);for(let a=-1;;)if(l.ins==-1&&o.ins==-1){let h=Math.min(l.len,o.len);ht(i,h,-1),l.forward(h),o.forward(h)}else if(o.ins>=0&&(l.ins<0||a==l.i||l.off==0&&(o.len=0&&a=0){let h=0,c=l.len;for(;c;)if(o.ins==-1){let f=Math.min(c,o.len);h+=f,c-=f,o.forward(f)}else if(o.ins==0&&o.lena||l.ins>=0&&l.len>a)&&(o||n.length>h),r.forward2(a),l.forward(a)}}}}class hs{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?De.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?De.empty:t[n].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)}}class oi{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}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 n,i;return this.empty?n=i=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new oi(n,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return q.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return q.range(this.anchor,n)}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 q.range(e.anchor,e.head)}static create(e,t,n){return new oi(e,t,n)}}class q{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:q.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;ne.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 q(e.ranges.map(t=>oi.fromJSON(t)),e.main)}static single(e,t=e){return new q([q.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 n=0,i=0;ie?8:0)|r)}static normalized(e,t=0){let n=e[t];e.sort((i,r)=>i.from-r.from),t=e.indexOf(n);for(let i=1;ir.head?q.range(a,o):q.range(o,a))}}return new q(e,t)}}function nu(s,e){for(let t of s.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Po=0;class le{constructor(e,t,n,i,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=i,this.id=Po++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(e={}){return new le(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:No),!!e.static,e.enables)}of(e){return new tr([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new tr(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new tr(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}}function No(s,e){return s==e||s.length==e.length&&s.every((t,n)=>t===e[n])}class tr{constructor(e,t,n,i){this.dependencies=e,this.facet=t,this.type=n,this.value=i,this.id=Po++}dynamicSlot(e){var t;let n=this.value,i=this.facet.compareInput,r=this.id,l=e[r]>>1,o=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||c.push(e[f.id]);return{create(f){return f.values[l]=n(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||Ll(f,c)){let d=n(f);if(o?!Ta(d,f.values[l],i):!i(d,f.values[l]))return f.values[l]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let m=ur(u,p);if(this.dependencies.every(g=>g instanceof le?u.facet(g)===f.facet(g):g instanceof Nt?u.field(g,!1)==f.field(g,!1):!0)||(o?Ta(d=n(f),m,i):i(d=n(f),m)))return f.values[l]=m,0}else d=n(f);return f.values[l]=d,1}}}}function Ta(s,e,t){if(s.length!=e.length)return!1;for(let n=0;ns[a.id]),i=t.map(a=>a.type),r=n.filter(a=>!(a&1)),l=s[e.id]>>1;function o(a){let h=[];for(let c=0;cn===i),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Ea).find(n=>n.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,i)=>{let r=n.values[t],l=this.updateF(r,i);return this.compareF(r,l)?0:(n.values[t]=l,1)},reconfigure:(n,i)=>i.config.address[this.id]!=null?(n.values[t]=i.field(this),0):(n.values[t]=this.create(n),1)}}init(e){return[this,Ea.of({field:this,create:e})]}get extension(){return this}}const li={lowest:4,low:3,default:2,high:1,highest:0};function Wi(s){return e=>new iu(e,s)}const Br={highest:Wi(li.highest),high:Wi(li.high),default:Wi(li.default),low:Wi(li.low),lowest:Wi(li.lowest)};class iu{constructor(e,t){this.inner=e,this.prec=t}}class Lt{of(e){return new $l(this,e)}reconfigure(e){return Lt.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class $l{constructor(e,t){this.compartment=e,this.inner=t}}class fr{constructor(e,t,n,i,r,l){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=i,this.staticValues=r,this.facets=l,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let i=[],r=Object.create(null),l=new Map;for(let u of cm(e,t,l))u instanceof Nt?i.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let o=Object.create(null),a=[],h=[];for(let u of i)o[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=n==null?void 0:n.config.facets;for(let u in r){let d=r[u],p=d[0].facet,m=c&&c[u]||[];if(d.every(g=>g.type==0))if(o[p.id]=a.length<<1|1,No(m,d))a.push(n.facet(p));else{let g=p.combine(d.map(b=>b.value));a.push(n&&p.compare(g,n.facet(p))?n.facet(p):g)}else{for(let g of d)g.type==0?(o[g.id]=a.length<<1|1,a.push(g.value)):(o[g.id]=h.length<<1,h.push(b=>g.dynamicSlot(b)));o[p.id]=h.length<<1,h.push(g=>hm(g,p,d))}}let f=h.map(u=>u(o));return new fr(e,l,f,o,a,r)}}function cm(s,e,t){let n=[[],[],[],[],[]],i=new Map;function r(l,o){let a=i.get(l);if(a!=null){if(a<=o)return;let h=n[a].indexOf(l);h>-1&&n[a].splice(h,1),l instanceof $l&&t.delete(l.compartment)}if(i.set(l,o),Array.isArray(l))for(let h of l)r(h,o);else if(l instanceof $l){if(t.has(l.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(l.compartment)||l.inner;t.set(l.compartment,h),r(h,o)}else if(l instanceof iu)r(l.inner,l.prec);else if(l instanceof Nt)n[o].push(l),l.provides&&r(l.provides,o);else if(l instanceof tr)n[o].push(l),l.facet.extensions&&r(l.facet.extensions,li.default);else{let h=l.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${l}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,o)}}return r(s,li.default),n.reduce((l,o)=>l.concat(o))}function is(s,e){if(e&1)return 2;let t=e>>1,n=s.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;s.status[t]=4;let i=s.computeSlot(s,s.config.dynamicSlots[t]);return s.status[t]=2|i}function ur(s,e){return e&1?s.config.staticValues[e>>1]:s.values[e>>1]}const su=le.define(),Rl=le.define({combine:s=>s.some(e=>e),static:!0}),ru=le.define({combine:s=>s.length?s[0]:void 0,static:!0}),lu=le.define(),ou=le.define(),au=le.define(),hu=le.define({combine:s=>s.length?s[0]:!1});class Yn{constructor(e,t){this.type=e,this.value=t}static define(){return new fm}}class fm{of(e){return new Yn(this,e)}}class um{constructor(e){this.map=e}of(e){return new Ne(this,e)}}class Ne{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 Ne(this.type,t)}is(e){return this.type==e}static define(e={}){return new um(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let i of e){let r=i.map(t);r&&n.push(r)}return n}}Ne.reconfigure=Ne.define();Ne.appendConfig=Ne.define();class Xe{constructor(e,t,n,i,r,l){this.startState=e,this.changes=t,this.selection=n,this.effects=i,this.annotations=r,this.scrollIntoView=l,this._doc=null,this._state=null,n&&nu(n,t.newLength),r.some(o=>o.type==Xe.time)||(this.annotations=r.concat(Xe.time.of(Date.now())))}static create(e,t,n,i,r,l){return new Xe(e,t,n,i,r,l)}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(Xe.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}Xe.time=Yn.define();Xe.userEvent=Yn.define();Xe.addToHistory=Yn.define();Xe.remote=Yn.define();function dm(s,e){let t=[];for(let n=0,i=0;;){let r,l;if(n=s[n]))r=s[n++],l=s[n++];else if(i=0;i--){let r=n[i](s);r instanceof Xe?s=r:Array.isArray(r)&&r.length==1&&r[0]instanceof Xe?s=r[0]:s=fu(e,Ai(r),!1)}return s}function mm(s){let e=s.startState,t=e.facet(au),n=s;for(let i=t.length-1;i>=0;i--){let r=t[i](s);r&&Object.keys(r).length&&(n=cu(n,Il(e,r,s.changes.newLength),!0))}return n==s?s:Xe.create(e,s.changes,s.selection,n.effects,n.annotations,n.scrollIntoView)}const gm=[];function Ai(s){return s==null?gm:Array.isArray(s)?s:[s]}var xn=function(s){return s[s.Word=0]="Word",s[s.Space=1]="Space",s[s.Other=2]="Other",s}(xn||(xn={}));const bm=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let zl;try{zl=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function _m(s){if(zl)return zl.test(s);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||bm.test(t)))return!0}return!1}function km(s){return e=>{if(!/\S/.test(e))return xn.Space;if(_m(e))return xn.Word;for(let t=0;t-1)return xn.Word;return xn.Other}}class ye{constructor(e,t,n,i,r,l){this.config=e,this.doc=t,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=r,l&&(l._state=this);for(let o=0;oi.set(h,a)),t=null),i.set(o.value.compartment,o.value.extension)):o.is(Ne.reconfigure)?(t=null,n=o.value):o.is(Ne.appendConfig)&&(t=null,n=Ai(n).concat(o.value));let r;t?r=e.startState.values.slice():(t=fr.resolve(n,i,this),r=new ye(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let l=e.startState.facet(Rl)?e.newSelection:e.newSelection.asSingle();new ye(t,e.newDoc,l,r,(o,a)=>a.update(o,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:q.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),i=this.changes(n.changes),r=[n.range],l=Ai(n.effects);for(let o=1;ol.spec.fromJSON(o,a)))}}return ye.create({doc:e.doc,selection:q.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=fr.resolve(e.extensions||[],new Map),n=e.doc instanceof De?e.doc:De.of((e.doc||"").split(t.staticFacet(ye.lineSeparator)||Pl)),i=e.selection?e.selection instanceof q?e.selection:q.single(e.selection.anchor,e.selection.head):q.single(0);return nu(i,n.length),t.staticFacet(Rl)||(i=i.asSingle()),new ye(t,n,i,t.dynamicSlots.map(()=>null),(r,l)=>l.create(r),null)}get tabSize(){return this.facet(ye.tabSize)}get lineBreak(){return this.facet(ye.lineSeparator)||` -`}get readOnly(){return this.facet(hu)}phrase(e,...t){for(let n of this.facet(ye.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,i)=>{if(i=="$")return"$";let r=+(i||1);return!r||r>t.length?n:t[r-1]})),e}languageDataAt(e,t,n=-1){let i=[];for(let r of this.facet(su))for(let l of r(this,t,n))Object.prototype.hasOwnProperty.call(l,e)&&i.push(l[e]);return i}charCategorizer(e){return km(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:i}=this.doc.lineAt(e),r=this.charCategorizer(e),l=e-n,o=e-n;for(;l>0;){let a=mt(t,l,!1);if(r(t.slice(a,l))!=xn.Word)break;l=a}for(;os.length?s[0]:4});ye.lineSeparator=ru;ye.readOnly=hu;ye.phrases=le.define({compare(s,e){let t=Object.keys(s),n=Object.keys(e);return t.length==n.length&&t.every(i=>s[i]==e[i])}});ye.languageData=su;ye.changeFilter=lu;ye.transactionFilter=ou;ye.transactionExtender=au;Lt.reconfigure=Ne.define();function Pi(s,e,t={}){let n={};for(let i of s)for(let r of Object.keys(i)){let l=i[r],o=n[r];if(o===void 0)n[r]=l;else if(!(o===l||l===void 0))if(Object.hasOwnProperty.call(t,r))n[r]=t[r](o,l);else throw new Error("Config merge conflict for field "+r)}for(let i in e)n[i]===void 0&&(n[i]=e[i]);return n}class Ei{eq(e){return this==e}range(e,t=e){return jl.create(e,t,this)}}Ei.prototype.startSide=Ei.prototype.endSide=0;Ei.prototype.point=!1;Ei.prototype.mapMode=vt.TrackDel;let jl=class uu{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new uu(e,t,n)}};function Vl(s,e){return s.from-e.from||s.value.startSide-e.value.startSide}class Bo{constructor(e,t,n,i){this.from=e,this.to=t,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,i=0){let r=n?this.to:this.from;for(let l=i,o=r.length;;){if(l==o)return l;let a=l+o>>1,h=r[a]-e||(n?this.value[a].endSide:this.value[a].startSide)-t;if(a==l)return h>=0?l:o;h>=0?o=a:l=a+1}}between(e,t,n,i){for(let r=this.findIndex(t,-1e9,!0),l=this.findIndex(n,1e9,!1,r);rd||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(l<0&&(l=u),h.point&&(o=Math.max(o,d-u)),n.push(h),i.push(u-l),r.push(d-l))}return{mapped:n.length?new Bo(i,r,n,o):null,pos:l}}}class Ee{constructor(e,t,n,i){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=i}static create(e,t,n,i){return new Ee(e,t,n,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:n=!1,filterFrom:i=0,filterTo:r=this.length}=e,l=e.filter;if(t.length==0&&!l)return this;if(n&&(t=t.slice().sort(Vl)),this.isEmpty)return t.length?Ee.of(t):this;let o=new du(this,null,-1).goto(0),a=0,h=[],c=new ai;for(;o.value||a=0){let f=t[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else o.rangeIndex==1&&o.chunkIndexthis.chunkEnd(o.chunkIndex)||ro.to||r=r&&e<=r+l.length&&l.between(r,e-r,t-r,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return cs.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return cs.from(e).goto(t)}static compare(e,t,n,i,r=-1){let l=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),o=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=Oa(l,o,n),h=new qi(l,a,r),c=new qi(o,a,r);n.iterGaps((f,u,d)=>Da(h,f,c,u,d,i)),n.empty&&n.length==0&&Da(h,0,c,0,0,i)}static eq(e,t,n=0,i){i==null&&(i=1e9-1);let r=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),l=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(r.length!=l.length)return!1;if(!r.length)return!0;let o=Oa(r,l),a=new qi(r,o,0).goto(n),h=new qi(l,o,0).goto(n);for(;;){if(a.to!=h.to||!Hl(a.active,h.active)||a.point&&(!h.point||!a.point.eq(h.point)))return!1;if(a.to>i)return!0;a.next(),h.next()}}static spans(e,t,n,i,r=-1){let l=new qi(e,null,r).goto(t),o=t,a=l.openStart;for(;;){let h=Math.min(l.to,n);if(l.point){let c=l.activeForPoint(l.to),f=l.pointFromo&&(i.span(o,h,l.active,a),a=l.openEnd(h));if(l.to>n)return a+(l.point&&l.to>n?1:0);o=l.to,l.next()}}static of(e,t=!1){let n=new ai;for(let i of e instanceof jl?[e]:t?vm(e):e)n.add(i.from,i.to,i.value);return n.finish()}static join(e){if(!e.length)return Ee.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let i=e[n];i!=Ee.empty;i=i.nextLayer)t=new Ee(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}Ee.empty=new Ee([],[],null,-1);function vm(s){if(s.length>1)for(let e=s[0],t=1;t0)return s.slice().sort(Vl);e=n}return s}Ee.empty.nextLayer=Ee.empty;class ai{finishChunk(e){this.chunks.push(new Bo(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,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new ai)).add(e,t,n)}addInner(e,t,n){let i=e-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||n.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=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.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 n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(Ee.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=Ee.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Oa(s,e,t){let n=new Map;for(let r of s)for(let l=0;l=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&i.push(new du(l,t,n,r));return i.length==1?i[0]:new cs(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)al(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)al(this.heap,n);(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(),al(this.heap,0)}}}function al(s,e){for(let t=s[e];;){let n=(e<<1)+1;if(n>=s.length)break;let i=s[n];if(n+1=0&&(i=s[n+1],n++),t.compare(i)<0)break;s[n]=t,s[e]=i,e=n}}class qi{constructor(e,t,n){this.minPoint=n,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=cs.from(e,t,n)}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){Bs(this.active,e),Bs(this.activeTo,e),Bs(this.activeRank,e),this.minActive=Pa(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:i,rank:r}=this.cursor;for(;t0;)t++;Ls(this.active,t,n),Ls(this.activeTo,t,i),Ls(this.activeRank,t,r),e&&Ls(e,t,this.cursor.from),this.minActive=Pa(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=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),n&&Bs(n,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&n[i]=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function Da(s,e,t,n,i,r){s.goto(e),t.goto(n);let l=n+i,o=n,a=n-e;for(;;){let h=s.to+a-t.to||s.endSide-t.endSide,c=h<0?s.to+a:t.to,f=Math.min(c,l);if(s.point||t.point?s.point&&t.point&&(s.point==t.point||s.point.eq(t.point))&&Hl(s.activeForPoint(s.to),t.activeForPoint(t.to))||r.comparePoint(o,f,s.point,t.point):f>o&&!Hl(s.active,t.active)&&r.compareRange(o,f,s.active,t.active),c>l)break;o=c,h<=0&&s.next(),h>=0&&t.next()}}function Hl(s,e){if(s.length!=e.length)return!1;for(let t=0;t=e;n--)s[n+1]=s[n];s[e]=t}function Pa(s,e){let t=-1,n=1e9;for(let i=0;i=e)return i;if(i==s.length)break;r+=s.charCodeAt(i)==9?t-r%t:1,i=mt(s,i)}return n===!0?-1:s.length}function ym(s,e,t,n,i,r){let l=hl(t,s,e),o=hl(n,s,e),a=hl(i,s,e);return l<0&&(l+=e),o<0&&(o+=e),a=r==="min"?Math.max(l,Math.min(o,a)):Math.min(o,Math.max(l,a)),i.endsWith("%")?e?`${100*a/e}%`:"0%":`${a}px`}function hl(s,e,t){const n=parseFloat(s);if(s.endsWith("px"))return n;if(s.endsWith("%"))return t*n/100;if(s.endsWith("rem"))return n*parseFloat(getComputedStyle(document.documentElement).fontSize);if(s.endsWith("em"))return n*parseFloat(getComputedStyle(e).fontSize);throw new Error(`Invalid length: ${s}`)}const wm=s=>({}),Na=s=>({}),Sm=s=>({}),Ba=s=>({});function La(s){let e,t,n,i;return{c(){e=x("div"),this.h()},l(r){e=A(r,"DIV",{class:!0}),P(e).forEach(_),this.h()},h(){k(e,"class",t=s[1]+" divider svelte-mwcui7"),ie(e,"disabled",s[3])},m(r,l){S(r,e,l),n||(i=Uf(s[10].call(null,e,s[16])),n=!0)},p(r,l){l&2&&t!==(t=r[1]+" divider svelte-mwcui7")&&k(e,"class",t),l&10&&ie(e,"disabled",r[3])},d(r){r&&_(e),n=!1,i()}}}function $a(s){let e;return{c(){e=x("div"),this.h()},l(t){e=A(t,"DIV",{class:!0}),P(e).forEach(_),this.h()},h(){k(e,"class","mousecatcher svelte-mwcui7")},m(t,n){S(t,e,n)},d(t){t&&_(e)}}}function xm(s){let e,t,n,i,r,l,o,a,h,c;const f=s[15].a,u=Tt(f,s,s[14],Ba),d=s[15].b,p=Tt(d,s,s[14],Na);let m=s[2]!=="0%"&&s[2]!=="100%"&&La(s),g=s[8]&&$a();return{c(){e=x("div"),t=x("div"),u&&u.c(),n=Q(),i=x("div"),p&&p.c(),r=Q(),m&&m.c(),a=Q(),g&&g.c(),h=ce(),this.h()},l(b){e=A(b,"DIV",{"data-pane":!0,class:!0,style:!0});var v=P(e);t=A(v,"DIV",{class:!0});var O=P(t);u&&u.l(O),O.forEach(_),n=ee(v),i=A(v,"DIV",{class:!0});var M=P(i);p&&p.l(M),M.forEach(_),r=ee(v),m&&m.l(v),v.forEach(_),a=ee(b),g&&g.l(b),h=ce(),this.h()},h(){k(t,"class","pane svelte-mwcui7"),k(i,"class","pane svelte-mwcui7"),k(e,"data-pane",s[0]),k(e,"class",l="container "+s[1]+" svelte-mwcui7"),it(e,"--pos",s[7]),Dr(()=>s[18].call(e))},m(b,v){S(b,e,v),y(e,t),u&&u.m(t,null),y(e,n),y(e,i),p&&p.m(i,null),y(e,r),m&&m.m(e,null),s[17](e),o=Eo(e,s[18].bind(e)),S(b,a,v),g&&g.m(b,v),S(b,h,v),c=!0},p(b,[v]){u&&u.p&&(!c||v&16384)&&Et(u,f,b,b[14],c?Dt(f,b[14],v,Sm):Ot(b[14]),Ba),p&&p.p&&(!c||v&16384)&&Et(p,d,b,b[14],c?Dt(d,b[14],v,wm):Ot(b[14]),Na),b[2]!=="0%"&&b[2]!=="100%"?m?m.p(b,v):(m=La(b),m.c(),m.m(e,null)):m&&(m.d(1),m=null),(!c||v&1)&&k(e,"data-pane",b[0]),(!c||v&2&&l!==(l="container "+b[1]+" svelte-mwcui7"))&&k(e,"class",l),(!c||v&128)&&it(e,"--pos",b[7]),b[8]?g||(g=$a(),g.c(),g.m(h.parentNode,h)):g&&(g.d(1),g=null)},i(b){c||(w(u,b),w(p,b),c=!0)},o(b){T(u,b),T(p,b),c=!1},d(b){b&&(_(e),_(a),_(h)),u&&u.d(b),p&&p.d(b),m&&m.d(),s[17](null),o(),g&&g.d(b)}}}function Am(s,e,t){let n,{$$slots:i={},$$scope:r}=e;const l=Pr();let{id:o=void 0}=e,{type:a}=e,{pos:h="50%"}=e,{min:c="0%"}=e,{max:f="100%"}=e,{disabled:u=!1}=e,{priority:d="min"}=e,p,m=!1,g=0,b=0;function v(E,V){if(u)return;const{top:$,left:F}=p.getBoundingClientRect(),R=a==="horizontal"?E-F:V-$,D=a==="horizontal"?g:b;t(7,n=h.endsWith("%")?`${100*R/D}%`:`${R}px`),l("change")}function O(E,V){const $=F=>{if(F.pointerType==="mouse"&&F.button===2||F.pointerType!=="mouse"&&!F.isPrimary)return;E.setPointerCapture(F.pointerId),F.preventDefault(),t(8,m=!0);const R=()=>{t(8,m=!1),E.setPointerCapture(F.pointerId),window.removeEventListener("pointermove",V,!1),window.removeEventListener("pointerup",R,!1)};window.addEventListener("pointermove",V,!1),window.addEventListener("pointerup",R,!1)};return E.addEventListener("pointerdown",$,{capture:!0,passive:!1}),{destroy(){E.removeEventListener("pointerdown",$)}}}const M=E=>v(E.clientX,E.clientY);function B(E){Ye[E?"unshift":"push"](()=>{p=E,t(4,p)})}function N(){g=this.clientWidth,b=this.clientHeight,t(5,g),t(6,b)}return s.$$set=E=>{"id"in E&&t(0,o=E.id),"type"in E&&t(1,a=E.type),"pos"in E&&t(2,h=E.pos),"min"in E&&t(11,c=E.min),"max"in E&&t(12,f=E.max),"disabled"in E&&t(3,u=E.disabled),"priority"in E&&t(13,d=E.priority),"$$scope"in E&&t(14,r=E.$$scope)},s.$$.update=()=>{s.$$.dirty&4&&t(7,n=h),s.$$.dirty&14578&&p&&t(7,n=ym(p,a==="horizontal"?g:b,c,f,n,d))},[o,a,h,u,p,g,b,n,m,v,O,c,f,d,r,i,M,B,N]}class pu extends _e{constructor(e){super(),ke(this,e,Am,xm,be,{id:0,type:1,pos:2,min:11,max:12,disabled:3,priority:13})}}function Cm(){return new Worker(""+new URL("../workers/index-99560f9a.js",import.meta.url).href)}const cl=new Map;let fl=1;class Mm{constructor({packages_url:e,svelte_url:t,onstatus:n}){qe(this,"worker");const i=`${e}:${t}`;if(!cl.has(i)){const r=new Cm;r.postMessage({type:"init",packages_url:e,svelte_url:t}),cl.set(i,r)}this.worker=cl.get(i),this.handlers=new Map,this.worker.addEventListener("message",r=>{const l=this.handlers.get(r.data.uid);if(l){if(r.data.type==="status"){n(r.data.message);return}n(null),l(r.data),this.handlers.delete(r.data.uid)}})}bundle(e){return new Promise(t=>{this.handlers.set(fl,t),this.worker.postMessage({uid:fl,type:"bundle",files:e}),fl+=1})}destroy(){this.worker.terminate()}}const mu=Symbol("repl");function di(){return Oo(mu)}function Tm(s){Kf(mu,s)}function $e(s){return`${s.name}.${s.type}`}function Ra(s,e,t){const n=s.slice();n[37]=e[t],n[40]=t;const i=$e(n[37]);return n[38]=i,n}function Em(s){const e=s.slice(),t=e[4].find(n=>$e(n)===e[1]);return e[41]=t,e}function Ia(s){let e,t=[],n=new Map,i,r,l='',o,a,h=Oe(s[4]);const c=f=>f[37].name;for(let f=0;f',c,f,u=s[0]&&s[37].modified&&ja();function d(){return s[23](s[37])}function p(...b){return s[24](s[37],...b)}function m(){return s[25](s[38])}function g(...b){return s[26](s[38],...b)}return{c(){e=x("div"),n=I(t),i=I("."),l=I(r),u&&u.c(),o=Q(),a=x("span"),a.innerHTML=h,this.h()},l(b){e=A(b,"DIV",{class:!0,title:!0});var v=P(e);n=z(v,t),i=z(v,"."),l=z(v,r),u&&u.l(v),v.forEach(_),o=ee(b),a=A(b,"SPAN",{class:!0,"data-svelte-h":!0}),Te(a)!=="svelte-1v5c9kn"&&(a.innerHTML=h),this.h()},h(){k(e,"class","editable svelte-1fyxfyn"),k(e,"title","edit component name"),k(a,"class","remove svelte-1fyxfyn")},m(b,v){S(b,e,v),y(e,n),y(e,i),y(e,l),u&&u.m(e,null),S(b,o,v),S(b,a,v),c||(f=[ue(e,"click",d),ue(e,"keyup",p),ue(a,"click",m),ue(a,"keyup",g)],c=!0)},p(b,v){s=b,v[0]&16&&t!==(t=s[37].name+"")&&re(n,t),v[0]&16&&r!==(r=s[37].type+"")&&re(l,r),s[0]&&s[37].modified?u||(u=ja(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},d(b){b&&(_(e),_(o),_(a)),u&&u.d(),c=!1,Pn(f)}}}function za(s){let e,t=s[41]&&Va(s);return{c(){t&&t.c(),e=ce()},l(n){t&&t.l(n),e=ce()},m(n,i){t&&t.m(n,i),S(n,e,i)},p(n,i){n[41]?t?t.p(n,i):(t=Va(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(n){n&&_(e),t&&t.d(n)}}}function Dm(s){let e,t,n=s[0]&&s[37].modified&&Ha();return{c(){e=x("div"),t=I("App.svelte"),n&&n.c(),this.h()},l(i){e=A(i,"DIV",{class:!0});var r=P(e);t=z(r,"App.svelte"),n&&n.l(r),r.forEach(_),this.h()},h(){k(e,"class","uneditable svelte-1fyxfyn")},m(i,r){S(i,e,r),y(e,t),n&&n.m(e,null)},p(i,r){i[0]&&i[37].modified?n||(n=Ha(),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&_(e),n&&n.d()}}}function ja(s){let e;return{c(){e=I("*")},l(t){e=z(t,"*")},m(t,n){S(t,e,n)},d(t){t&&_(e)}}}function Va(s){let e,t=s[2]+(/\./.test(s[2])?"":`.${s[41].type}`),n,i,r,l,o;function a(...h){return s[22](s[41],...h)}return{c(){e=x("span"),n=I(t),i=Q(),r=x("input"),this.h()},l(h){e=A(h,"SPAN",{class:!0});var c=P(e);n=z(c,t),c.forEach(_),i=ee(h),r=A(h,"INPUT",{spellcheck:!0,class:!0}),this.h()},h(){k(e,"class","input-sizer svelte-1fyxfyn"),r.autofocus=!0,k(r,"spellcheck",!1),k(r,"class","svelte-1fyxfyn"),ie(r,"duplicate",s[16](s[41]))},m(h,c){S(h,e,c),y(e,n),S(h,i,c),S(h,r,c),ri(r,s[2]),r.focus(),l||(o=[ue(r,"input",s[21]),ue(r,"focus",s[14]),ue(r,"blur",s[12]),ue(r,"keydown",a)],l=!0)},p(h,c){s=h,c[0]&22&&t!==(t=s[2]+(/\./.test(s[2])?"":`.${s[41].type}`))&&re(n,t),c[0]&4&&r.value!==s[2]&&ri(r,s[2]),c[0]&65554&&ie(r,"duplicate",s[16](s[41]))},d(h){h&&(_(e),_(i),_(r)),l=!1,Pn(o)}}}function Ha(s){let e;return{c(){e=I("*")},l(t){e=z(t,"*")},m(t,n){S(t,e,n)},d(t){t&&_(e)}}}function Fa(s,e){let t,n,i,r,l,o,a;function h(m,g){return m[37].name==="App"&&m[38]!==m[1]?Dm:m[38]===m[1]?za:Om}function c(m,g){return g===za?Em(m):m}let f=h(e),u=f(c(e,f));function d(){return e[27](e[38])}function p(...m){return e[28](e[38],...m)}return{key:s,first:null,c(){t=x("div"),n=x("i"),i=Q(),u.c(),this.h()},l(m){t=A(m,"DIV",{id:!0,class:!0,role:!0,tabindex:!0,draggable:!0});var g=P(t);n=A(g,"I",{class:!0}),P(n).forEach(_),i=ee(g),u.l(g),g.forEach(_),this.h()},h(){k(n,"class","drag-handle svelte-1fyxfyn"),k(t,"id",r=e[37].name),k(t,"class","button svelte-1fyxfyn"),k(t,"role","button"),k(t,"tabindex","0"),k(t,"draggable",l=e[38]!==e[1]),ie(t,"active",e[38]===e[5]),ie(t,"draggable",e[38]!==e[1]&&e[40]!==0),ie(t,"drag-over",e[3]===e[37].name),this.first=t},m(m,g){S(m,t,g),y(t,n),y(t,i),u.m(t,null),o||(a=[ue(t,"click",d),ue(t,"keyup",p),ue(t,"dblclick",Nr(Nm)),ue(t,"dragstart",e[17]),ue(t,"dragover",pa(e[19])),ue(t,"dragleave",e[18]),ue(t,"drop",pa(e[20]))],o=!0)},p(m,g){e=m,f===(f=h(e))&&u?u.p(c(e,f),g):(u.d(1),u=f(c(e,f)),u&&(u.c(),u.m(t,null))),g[0]&16&&r!==(r=e[37].name)&&k(t,"id",r),g[0]&18&&l!==(l=e[38]!==e[1])&&k(t,"draggable",l),g[0]&48&&ie(t,"active",e[38]===e[5]),g[0]&18&&ie(t,"draggable",e[38]!==e[1]&&e[40]!==0),g[0]&24&&ie(t,"drag-over",e[3]===e[37].name)},d(m){m&&_(t),u.d(),o=!1,Pn(a)}}}function Pm(s){let e,t=s[4].length&&Ia(s);return{c(){e=x("div"),t&&t.c(),this.h()},l(n){e=A(n,"DIV",{class:!0});var i=P(e);t&&t.l(i),i.forEach(_),this.h()},h(){k(e,"class","component-selector svelte-1fyxfyn")},m(n,i){S(n,e,i),t&&t.m(e,null)},p(n,i){n[4].length?t?t.p(n,i):(t=Ia(n),t.c(),t.m(e,null)):t&&(t.d(1),t=null)},i:de,o:de,d(n){n&&_(e),t&&t.d()}}}const Nm=()=>{};function Bm(s,e,t){let n,i,r,l,{show_modified:o}=e;const a=Pr(),{files:h,handle_select:c,module_editor:f,rebundle:u,selected:d,selected_name:p,EDITOR_STATE_MAP:m}=di();Me(s,h,X=>t(4,n=X)),Me(s,f,X=>t(32,l=X)),Me(s,d,X=>t(31,i=X)),Me(s,p,X=>t(5,r=X));let g=null,b="";function v(X){r!==X&&(t(1,g=null),c(X))}function O(X){r===$e(X)&&(t(1,g=$e(X)),t(2,b=X.name))}async function M(){const X=/(.+)\.(svelte|js|json|md|css)$/.exec(b??""),pe=n.find(Ae=>$e(Ae)===g);if(!pe||(pe.name=X?X[1]:b,!i))return;if($(i)){let Ae=1,lt=i.name;do{const Vt=n.find(Gt=>$e(Gt)===$e(pe)&&Gt.source===i.source);if(!Vt)break;Vt.name=`${lt}_${Ae++}`}while($(i));const St=n.findIndex(Vt=>$e(Vt)===$e(pe));Ve(h,n[St]=pe,n)}const et=n.findIndex(Ae=>$e(Ae)===$e(pe));if(X!=null&&X[2]&&Ve(h,n[et].type=X[2],n),g){const Ae=m.get(g);Ae&&(m.set($e(pe),Ae),m.delete(g))}t(1,g=null),c($e(pe)),h.set(n),await as(),l==null||l.focus(),u()}function B(X){const pe=n.find(lt=>$e(lt)===X),et=n.findIndex(lt=>$e(lt)===X);!pe||!confirm(`Are you sure you want to delete ${$e(pe)}?`)||(Ve(h,n=n.filter(lt=>$e(lt)!==X),n),a("remove",{files:n,diff:pe}),m.delete($e(pe)),c(Ve(p,r=et===1?"App.svelte":$e(pe),r)))}async function N(X){await as(),X.currentTarget.select()}let E=1;function V(){const X={name:E++?`Component${E}`:"Component1",type:"svelte",source:"",modified:!0};Ve(h,n=n.concat(X),n),t(1,g=$e(X)),t(2,b=X.name),c(g),u(),a("add",{files:n,diff:X}),h.set(n)}function $(X){return n.find(pe=>JSON.stringify(pe)!==JSON.stringify(i)&&pe.name===X.name)}let F=null,R=null;function D(X){F=X.currentTarget.id}function C(){t(3,R=null)}function W(X){t(3,R=X.currentTarget.id)}function ne(){if(F&&R){const X=n.findIndex(Ae=>Ae.name===F),pe=n.findIndex(Ae=>Ae.name===R),et=n[X];n.splice(X,1),Ve(h,n=n.slice(0,pe).concat(et).concat(n.slice(pe)),n)}F=t(3,R=null)}function Y(){b=this.value,t(2,b)}const he=(X,pe)=>{pe.key==="Enter"&&(pe.preventDefault(),$(X)||pe.currentTarget.blur())},j=X=>O(X),fe=(X,pe)=>pe.key===" "&&O(X),ge=X=>B(X),Re=(X,pe)=>pe.key===" "&&B(X),we=X=>v(X),dt=(X,pe)=>pe.key===" "&&v(X);return s.$$set=X=>{"show_modified"in X&&t(0,o=X.show_modified)},[o,g,b,R,n,r,h,f,d,p,v,O,M,B,N,V,$,D,C,W,ne,Y,he,j,fe,ge,Re,we,dt]}class Lm extends _e{constructor(e){super(),ke(this,e,Bm,Pm,be,{show_modified:0},null,[-1,-1])}}const Wl="ͼ",Wa=typeof Symbol>"u"?"__"+Wl:Symbol.for(Wl),ql=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),qa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class qn{constructor(e,t){this.rules=[];let{finish:n}=t||{};function i(l){return/^@/.test(l)?[l]:l.split(/,\s*/)}function r(l,o,a,h){let c=[],f=/^@(\w+)\b/.exec(l[0]),u=f&&f[1]=="keyframes";if(f&&o==null)return a.push(l[0]+";");for(let d in o){let p=o[d];if(/&/.test(d))r(d.split(/,\s*/).map(m=>l.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(i(d),p,c,u)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(c.length||u)&&a.push((n&&!f&&!h?l.map(n):l).join(", ")+" {"+c.join(" ")+"}")}for(let l in e)r(i(l),e[l],this.rules)}getRules(){return this.rules.join(` +`}get readOnly(){return this.facet(hu)}phrase(e,...t){for(let n of this.facet(ye.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,i)=>{if(i=="$")return"$";let r=+(i||1);return!r||r>t.length?n:t[r-1]})),e}languageDataAt(e,t,n=-1){let i=[];for(let r of this.facet(su))for(let l of r(this,t,n))Object.prototype.hasOwnProperty.call(l,e)&&i.push(l[e]);return i}charCategorizer(e){return km(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:i}=this.doc.lineAt(e),r=this.charCategorizer(e),l=e-n,o=e-n;for(;l>0;){let a=mt(t,l,!1);if(r(t.slice(a,l))!=xn.Word)break;l=a}for(;os.length?s[0]:4});ye.lineSeparator=ru;ye.readOnly=hu;ye.phrases=le.define({compare(s,e){let t=Object.keys(s),n=Object.keys(e);return t.length==n.length&&t.every(i=>s[i]==e[i])}});ye.languageData=su;ye.changeFilter=lu;ye.transactionFilter=ou;ye.transactionExtender=au;Lt.reconfigure=Ne.define();function Pi(s,e,t={}){let n={};for(let i of s)for(let r of Object.keys(i)){let l=i[r],o=n[r];if(o===void 0)n[r]=l;else if(!(o===l||l===void 0))if(Object.hasOwnProperty.call(t,r))n[r]=t[r](o,l);else throw new Error("Config merge conflict for field "+r)}for(let i in e)n[i]===void 0&&(n[i]=e[i]);return n}class Ei{eq(e){return this==e}range(e,t=e){return jl.create(e,t,this)}}Ei.prototype.startSide=Ei.prototype.endSide=0;Ei.prototype.point=!1;Ei.prototype.mapMode=vt.TrackDel;let jl=class uu{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new uu(e,t,n)}};function Vl(s,e){return s.from-e.from||s.value.startSide-e.value.startSide}class Bo{constructor(e,t,n,i){this.from=e,this.to=t,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,i=0){let r=n?this.to:this.from;for(let l=i,o=r.length;;){if(l==o)return l;let a=l+o>>1,h=r[a]-e||(n?this.value[a].endSide:this.value[a].startSide)-t;if(a==l)return h>=0?l:o;h>=0?o=a:l=a+1}}between(e,t,n,i){for(let r=this.findIndex(t,-1e9,!0),l=this.findIndex(n,1e9,!1,r);rd||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(l<0&&(l=u),h.point&&(o=Math.max(o,d-u)),n.push(h),i.push(u-l),r.push(d-l))}return{mapped:n.length?new Bo(i,r,n,o):null,pos:l}}}class Ee{constructor(e,t,n,i){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=i}static create(e,t,n,i){return new Ee(e,t,n,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:n=!1,filterFrom:i=0,filterTo:r=this.length}=e,l=e.filter;if(t.length==0&&!l)return this;if(n&&(t=t.slice().sort(Vl)),this.isEmpty)return t.length?Ee.of(t):this;let o=new du(this,null,-1).goto(0),a=0,h=[],c=new ai;for(;o.value||a=0){let f=t[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else o.rangeIndex==1&&o.chunkIndexthis.chunkEnd(o.chunkIndex)||ro.to||r=r&&e<=r+l.length&&l.between(r,e-r,t-r,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return cs.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return cs.from(e).goto(t)}static compare(e,t,n,i,r=-1){let l=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),o=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=Oa(l,o,n),h=new qi(l,a,r),c=new qi(o,a,r);n.iterGaps((f,u,d)=>Da(h,f,c,u,d,i)),n.empty&&n.length==0&&Da(h,0,c,0,0,i)}static eq(e,t,n=0,i){i==null&&(i=1e9-1);let r=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),l=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(r.length!=l.length)return!1;if(!r.length)return!0;let o=Oa(r,l),a=new qi(r,o,0).goto(n),h=new qi(l,o,0).goto(n);for(;;){if(a.to!=h.to||!Hl(a.active,h.active)||a.point&&(!h.point||!a.point.eq(h.point)))return!1;if(a.to>i)return!0;a.next(),h.next()}}static spans(e,t,n,i,r=-1){let l=new qi(e,null,r).goto(t),o=t,a=l.openStart;for(;;){let h=Math.min(l.to,n);if(l.point){let c=l.activeForPoint(l.to),f=l.pointFromo&&(i.span(o,h,l.active,a),a=l.openEnd(h));if(l.to>n)return a+(l.point&&l.to>n?1:0);o=l.to,l.next()}}static of(e,t=!1){let n=new ai;for(let i of e instanceof jl?[e]:t?vm(e):e)n.add(i.from,i.to,i.value);return n.finish()}static join(e){if(!e.length)return Ee.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let i=e[n];i!=Ee.empty;i=i.nextLayer)t=new Ee(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}Ee.empty=new Ee([],[],null,-1);function vm(s){if(s.length>1)for(let e=s[0],t=1;t0)return s.slice().sort(Vl);e=n}return s}Ee.empty.nextLayer=Ee.empty;class ai{finishChunk(e){this.chunks.push(new Bo(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,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new ai)).add(e,t,n)}addInner(e,t,n){let i=e-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||n.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=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.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 n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(Ee.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=Ee.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Oa(s,e,t){let n=new Map;for(let r of s)for(let l=0;l=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&i.push(new du(l,t,n,r));return i.length==1?i[0]:new cs(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)al(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)al(this.heap,n);(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(),al(this.heap,0)}}}function al(s,e){for(let t=s[e];;){let n=(e<<1)+1;if(n>=s.length)break;let i=s[n];if(n+1=0&&(i=s[n+1],n++),t.compare(i)<0)break;s[n]=t,s[e]=i,e=n}}class qi{constructor(e,t,n){this.minPoint=n,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=cs.from(e,t,n)}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){Bs(this.active,e),Bs(this.activeTo,e),Bs(this.activeRank,e),this.minActive=Pa(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:i,rank:r}=this.cursor;for(;t0;)t++;Ls(this.active,t,n),Ls(this.activeTo,t,i),Ls(this.activeRank,t,r),e&&Ls(e,t,this.cursor.from),this.minActive=Pa(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=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),n&&Bs(n,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&n[i]=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function Da(s,e,t,n,i,r){s.goto(e),t.goto(n);let l=n+i,o=n,a=n-e;for(;;){let h=s.to+a-t.to||s.endSide-t.endSide,c=h<0?s.to+a:t.to,f=Math.min(c,l);if(s.point||t.point?s.point&&t.point&&(s.point==t.point||s.point.eq(t.point))&&Hl(s.activeForPoint(s.to),t.activeForPoint(t.to))||r.comparePoint(o,f,s.point,t.point):f>o&&!Hl(s.active,t.active)&&r.compareRange(o,f,s.active,t.active),c>l)break;o=c,h<=0&&s.next(),h>=0&&t.next()}}function Hl(s,e){if(s.length!=e.length)return!1;for(let t=0;t=e;n--)s[n+1]=s[n];s[e]=t}function Pa(s,e){let t=-1,n=1e9;for(let i=0;i=e)return i;if(i==s.length)break;r+=s.charCodeAt(i)==9?t-r%t:1,i=mt(s,i)}return n===!0?-1:s.length}function ym(s,e,t,n,i,r){let l=hl(t,s,e),o=hl(n,s,e),a=hl(i,s,e);return l<0&&(l+=e),o<0&&(o+=e),a=r==="min"?Math.max(l,Math.min(o,a)):Math.min(o,Math.max(l,a)),i.endsWith("%")?e?`${100*a/e}%`:"0%":`${a}px`}function hl(s,e,t){const n=parseFloat(s);if(s.endsWith("px"))return n;if(s.endsWith("%"))return t*n/100;if(s.endsWith("rem"))return n*parseFloat(getComputedStyle(document.documentElement).fontSize);if(s.endsWith("em"))return n*parseFloat(getComputedStyle(e).fontSize);throw new Error(`Invalid length: ${s}`)}const wm=s=>({}),Na=s=>({}),Sm=s=>({}),Ba=s=>({});function La(s){let e,t,n,i;return{c(){e=x("div"),this.h()},l(r){e=A(r,"DIV",{class:!0}),P(e).forEach(_),this.h()},h(){k(e,"class",t=s[1]+" divider svelte-mwcui7"),ie(e,"disabled",s[3])},m(r,l){S(r,e,l),n||(i=Uf(s[10].call(null,e,s[16])),n=!0)},p(r,l){l&2&&t!==(t=r[1]+" divider svelte-mwcui7")&&k(e,"class",t),l&10&&ie(e,"disabled",r[3])},d(r){r&&_(e),n=!1,i()}}}function $a(s){let e;return{c(){e=x("div"),this.h()},l(t){e=A(t,"DIV",{class:!0}),P(e).forEach(_),this.h()},h(){k(e,"class","mousecatcher svelte-mwcui7")},m(t,n){S(t,e,n)},d(t){t&&_(e)}}}function xm(s){let e,t,n,i,r,l,o,a,h,c;const f=s[15].a,u=Tt(f,s,s[14],Ba),d=s[15].b,p=Tt(d,s,s[14],Na);let m=s[2]!=="0%"&&s[2]!=="100%"&&La(s),g=s[8]&&$a();return{c(){e=x("div"),t=x("div"),u&&u.c(),n=Q(),i=x("div"),p&&p.c(),r=Q(),m&&m.c(),a=Q(),g&&g.c(),h=ce(),this.h()},l(b){e=A(b,"DIV",{"data-pane":!0,class:!0,style:!0});var v=P(e);t=A(v,"DIV",{class:!0});var O=P(t);u&&u.l(O),O.forEach(_),n=ee(v),i=A(v,"DIV",{class:!0});var M=P(i);p&&p.l(M),M.forEach(_),r=ee(v),m&&m.l(v),v.forEach(_),a=ee(b),g&&g.l(b),h=ce(),this.h()},h(){k(t,"class","pane svelte-mwcui7"),k(i,"class","pane svelte-mwcui7"),k(e,"data-pane",s[0]),k(e,"class",l="container "+s[1]+" svelte-mwcui7"),it(e,"--pos",s[7]),Dr(()=>s[18].call(e))},m(b,v){S(b,e,v),y(e,t),u&&u.m(t,null),y(e,n),y(e,i),p&&p.m(i,null),y(e,r),m&&m.m(e,null),s[17](e),o=Eo(e,s[18].bind(e)),S(b,a,v),g&&g.m(b,v),S(b,h,v),c=!0},p(b,[v]){u&&u.p&&(!c||v&16384)&&Et(u,f,b,b[14],c?Dt(f,b[14],v,Sm):Ot(b[14]),Ba),p&&p.p&&(!c||v&16384)&&Et(p,d,b,b[14],c?Dt(d,b[14],v,wm):Ot(b[14]),Na),b[2]!=="0%"&&b[2]!=="100%"?m?m.p(b,v):(m=La(b),m.c(),m.m(e,null)):m&&(m.d(1),m=null),(!c||v&1)&&k(e,"data-pane",b[0]),(!c||v&2&&l!==(l="container "+b[1]+" svelte-mwcui7"))&&k(e,"class",l),(!c||v&128)&&it(e,"--pos",b[7]),b[8]?g||(g=$a(),g.c(),g.m(h.parentNode,h)):g&&(g.d(1),g=null)},i(b){c||(w(u,b),w(p,b),c=!0)},o(b){T(u,b),T(p,b),c=!1},d(b){b&&(_(e),_(a),_(h)),u&&u.d(b),p&&p.d(b),m&&m.d(),s[17](null),o(),g&&g.d(b)}}}function Am(s,e,t){let n,{$$slots:i={},$$scope:r}=e;const l=Pr();let{id:o=void 0}=e,{type:a}=e,{pos:h="50%"}=e,{min:c="0%"}=e,{max:f="100%"}=e,{disabled:u=!1}=e,{priority:d="min"}=e,p,m=!1,g=0,b=0;function v(E,V){if(u)return;const{top:$,left:F}=p.getBoundingClientRect(),R=a==="horizontal"?E-F:V-$,D=a==="horizontal"?g:b;t(7,n=h.endsWith("%")?`${100*R/D}%`:`${R}px`),l("change")}function O(E,V){const $=F=>{if(F.pointerType==="mouse"&&F.button===2||F.pointerType!=="mouse"&&!F.isPrimary)return;E.setPointerCapture(F.pointerId),F.preventDefault(),t(8,m=!0);const R=()=>{t(8,m=!1),E.setPointerCapture(F.pointerId),window.removeEventListener("pointermove",V,!1),window.removeEventListener("pointerup",R,!1)};window.addEventListener("pointermove",V,!1),window.addEventListener("pointerup",R,!1)};return E.addEventListener("pointerdown",$,{capture:!0,passive:!1}),{destroy(){E.removeEventListener("pointerdown",$)}}}const M=E=>v(E.clientX,E.clientY);function B(E){Ye[E?"unshift":"push"](()=>{p=E,t(4,p)})}function N(){g=this.clientWidth,b=this.clientHeight,t(5,g),t(6,b)}return s.$$set=E=>{"id"in E&&t(0,o=E.id),"type"in E&&t(1,a=E.type),"pos"in E&&t(2,h=E.pos),"min"in E&&t(11,c=E.min),"max"in E&&t(12,f=E.max),"disabled"in E&&t(3,u=E.disabled),"priority"in E&&t(13,d=E.priority),"$$scope"in E&&t(14,r=E.$$scope)},s.$$.update=()=>{s.$$.dirty&4&&t(7,n=h),s.$$.dirty&14578&&p&&t(7,n=ym(p,a==="horizontal"?g:b,c,f,n,d))},[o,a,h,u,p,g,b,n,m,v,O,c,f,d,r,i,M,B,N]}class pu extends _e{constructor(e){super(),ke(this,e,Am,xm,be,{id:0,type:1,pos:2,min:11,max:12,disabled:3,priority:13})}}function Cm(){return new Worker(""+new URL("../workers/index-99560f9a.js",import.meta.url).href)}const cl=new Map;let fl=1;class Mm{constructor({packages_url:e,svelte_url:t,onstatus:n}){qe(this,"worker");const i=`${e}:${t}`;if(!cl.has(i)){const r=new Cm;r.postMessage({type:"init",packages_url:e,svelte_url:t}),cl.set(i,r)}this.worker=cl.get(i),this.handlers=new Map,this.worker.addEventListener("message",r=>{const l=this.handlers.get(r.data.uid);if(l){if(r.data.type==="status"){n(r.data.message);return}n(null),l(r.data),this.handlers.delete(r.data.uid)}})}bundle(e){return new Promise(t=>{this.handlers.set(fl,t),this.worker.postMessage({uid:fl,type:"bundle",files:e}),fl+=1})}destroy(){this.worker.terminate()}}const mu=Symbol("repl");function di(){return Oo(mu)}function Tm(s){Kf(mu,s)}function $e(s){return`${s.name}.${s.type}`}function Ra(s,e,t){const n=s.slice();n[37]=e[t],n[40]=t;const i=$e(n[37]);return n[38]=i,n}function Em(s){const e=s.slice(),t=e[4].find(n=>$e(n)===e[1]);return e[41]=t,e}function Ia(s){let e,t=[],n=new Map,i,r,l='',o,a,h=Oe(s[4]);const c=f=>f[37].name;for(let f=0;f',c,f,u=s[0]&&s[37].modified&&ja();function d(){return s[23](s[37])}function p(...b){return s[24](s[37],...b)}function m(){return s[25](s[38])}function g(...b){return s[26](s[38],...b)}return{c(){e=x("div"),n=I(t),i=I("."),l=I(r),u&&u.c(),o=Q(),a=x("span"),a.innerHTML=h,this.h()},l(b){e=A(b,"DIV",{class:!0,title:!0});var v=P(e);n=z(v,t),i=z(v,"."),l=z(v,r),u&&u.l(v),v.forEach(_),o=ee(b),a=A(b,"SPAN",{class:!0,"data-svelte-h":!0}),Te(a)!=="svelte-1v5c9kn"&&(a.innerHTML=h),this.h()},h(){k(e,"class","editable svelte-1fyxfyn"),k(e,"title","edit component name"),k(a,"class","remove svelte-1fyxfyn")},m(b,v){S(b,e,v),y(e,n),y(e,i),y(e,l),u&&u.m(e,null),S(b,o,v),S(b,a,v),c||(f=[ue(e,"click",d),ue(e,"keyup",p),ue(a,"click",m),ue(a,"keyup",g)],c=!0)},p(b,v){s=b,v[0]&16&&t!==(t=s[37].name+"")&&re(n,t),v[0]&16&&r!==(r=s[37].type+"")&&re(l,r),s[0]&&s[37].modified?u||(u=ja(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},d(b){b&&(_(e),_(o),_(a)),u&&u.d(),c=!1,Pn(f)}}}function za(s){let e,t=s[41]&&Va(s);return{c(){t&&t.c(),e=ce()},l(n){t&&t.l(n),e=ce()},m(n,i){t&&t.m(n,i),S(n,e,i)},p(n,i){n[41]?t?t.p(n,i):(t=Va(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(n){n&&_(e),t&&t.d(n)}}}function Dm(s){let e,t,n=s[0]&&s[37].modified&&Ha();return{c(){e=x("div"),t=I("App.svelte"),n&&n.c(),this.h()},l(i){e=A(i,"DIV",{class:!0});var r=P(e);t=z(r,"App.svelte"),n&&n.l(r),r.forEach(_),this.h()},h(){k(e,"class","uneditable svelte-1fyxfyn")},m(i,r){S(i,e,r),y(e,t),n&&n.m(e,null)},p(i,r){i[0]&&i[37].modified?n||(n=Ha(),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&_(e),n&&n.d()}}}function ja(s){let e;return{c(){e=I("*")},l(t){e=z(t,"*")},m(t,n){S(t,e,n)},d(t){t&&_(e)}}}function Va(s){let e,t=s[2]+(/\./.test(s[2])?"":`.${s[41].type}`),n,i,r,l,o;function a(...h){return s[22](s[41],...h)}return{c(){e=x("span"),n=I(t),i=Q(),r=x("input"),this.h()},l(h){e=A(h,"SPAN",{class:!0});var c=P(e);n=z(c,t),c.forEach(_),i=ee(h),r=A(h,"INPUT",{spellcheck:!0,class:!0}),this.h()},h(){k(e,"class","input-sizer svelte-1fyxfyn"),r.autofocus=!0,k(r,"spellcheck",!1),k(r,"class","svelte-1fyxfyn"),ie(r,"duplicate",s[16](s[41]))},m(h,c){S(h,e,c),y(e,n),S(h,i,c),S(h,r,c),ri(r,s[2]),r.focus(),l||(o=[ue(r,"input",s[21]),ue(r,"focus",s[14]),ue(r,"blur",s[12]),ue(r,"keydown",a)],l=!0)},p(h,c){s=h,c[0]&22&&t!==(t=s[2]+(/\./.test(s[2])?"":`.${s[41].type}`))&&re(n,t),c[0]&4&&r.value!==s[2]&&ri(r,s[2]),c[0]&65554&&ie(r,"duplicate",s[16](s[41]))},d(h){h&&(_(e),_(i),_(r)),l=!1,Pn(o)}}}function Ha(s){let e;return{c(){e=I("*")},l(t){e=z(t,"*")},m(t,n){S(t,e,n)},d(t){t&&_(e)}}}function Fa(s,e){let t,n,i,r,l,o,a;function h(m,g){return m[37].name==="App"&&m[38]!==m[1]?Dm:m[38]===m[1]?za:Om}function c(m,g){return g===za?Em(m):m}let f=h(e),u=f(c(e,f));function d(){return e[27](e[38])}function p(...m){return e[28](e[38],...m)}return{key:s,first:null,c(){t=x("div"),n=x("i"),i=Q(),u.c(),this.h()},l(m){t=A(m,"DIV",{id:!0,class:!0,role:!0,tabindex:!0,draggable:!0});var g=P(t);n=A(g,"I",{class:!0}),P(n).forEach(_),i=ee(g),u.l(g),g.forEach(_),this.h()},h(){k(n,"class","drag-handle svelte-1fyxfyn"),k(t,"id",r=e[37].name),k(t,"class","button svelte-1fyxfyn"),k(t,"role","button"),k(t,"tabindex","0"),k(t,"draggable",l=e[38]!==e[1]),ie(t,"active",e[38]===e[5]),ie(t,"draggable",e[38]!==e[1]&&e[40]!==0),ie(t,"drag-over",e[3]===e[37].name),this.first=t},m(m,g){S(m,t,g),y(t,n),y(t,i),u.m(t,null),o||(a=[ue(t,"click",d),ue(t,"keyup",p),ue(t,"dblclick",Nr(Nm)),ue(t,"dragstart",e[17]),ue(t,"dragover",pa(e[19])),ue(t,"dragleave",e[18]),ue(t,"drop",pa(e[20]))],o=!0)},p(m,g){e=m,f===(f=h(e))&&u?u.p(c(e,f),g):(u.d(1),u=f(c(e,f)),u&&(u.c(),u.m(t,null))),g[0]&16&&r!==(r=e[37].name)&&k(t,"id",r),g[0]&18&&l!==(l=e[38]!==e[1])&&k(t,"draggable",l),g[0]&48&&ie(t,"active",e[38]===e[5]),g[0]&18&&ie(t,"draggable",e[38]!==e[1]&&e[40]!==0),g[0]&24&&ie(t,"drag-over",e[3]===e[37].name)},d(m){m&&_(t),u.d(),o=!1,Pn(a)}}}function Pm(s){let e,t=s[4].length&&Ia(s);return{c(){e=x("div"),t&&t.c(),this.h()},l(n){e=A(n,"DIV",{class:!0});var i=P(e);t&&t.l(i),i.forEach(_),this.h()},h(){k(e,"class","component-selector svelte-1fyxfyn")},m(n,i){S(n,e,i),t&&t.m(e,null)},p(n,i){n[4].length?t?t.p(n,i):(t=Ia(n),t.c(),t.m(e,null)):t&&(t.d(1),t=null)},i:de,o:de,d(n){n&&_(e),t&&t.d()}}}const Nm=()=>{};function Bm(s,e,t){let n,i,r,l,{show_modified:o}=e;const a=Pr(),{files:h,handle_select:c,module_editor:f,rebundle:u,selected:d,selected_name:p,EDITOR_STATE_MAP:m}=di();Me(s,h,X=>t(4,n=X)),Me(s,f,X=>t(32,l=X)),Me(s,d,X=>t(31,i=X)),Me(s,p,X=>t(5,r=X));let g=null,b="";function v(X){r!==X&&(t(1,g=null),c(X))}function O(X){r===$e(X)&&(t(1,g=$e(X)),t(2,b=X.name))}async function M(){const X=/(.+)\.(svelte|js|json|md|css)$/.exec(b??""),pe=n.find(Ae=>$e(Ae)===g);if(!pe||(pe.name=X?X[1]:b,!i))return;if($(i)){let Ae=1,lt=i.name;do{const Vt=n.find(Gt=>$e(Gt)===$e(pe)&&Gt.source===i.source);if(!Vt)break;Vt.name=`${lt}_${Ae++}`}while($(i));const St=n.findIndex(Vt=>$e(Vt)===$e(pe));Ve(h,n[St]=pe,n)}const et=n.findIndex(Ae=>$e(Ae)===$e(pe));if(X!=null&&X[2]&&Ve(h,n[et].type=X[2],n),g){const Ae=m.get(g);Ae&&(m.set($e(pe),Ae),m.delete(g))}t(1,g=null),c($e(pe)),h.set(n),await as(),l==null||l.focus(),u()}function B(X){const pe=n.find(lt=>$e(lt)===X),et=n.findIndex(lt=>$e(lt)===X);!pe||!confirm(`Are you sure you want to delete ${$e(pe)}?`)||(Ve(h,n=n.filter(lt=>$e(lt)!==X),n),a("remove",{files:n,diff:pe}),m.delete($e(pe)),c(Ve(p,r=et===1?"App.svelte":$e(pe),r)))}async function N(X){await as(),X.currentTarget.select()}let E=1;function V(){const X={name:E++?`Component${E}`:"Component1",type:"svelte",source:"",modified:!0};Ve(h,n=n.concat(X),n),t(1,g=$e(X)),t(2,b=X.name),c(g),u(),a("add",{files:n,diff:X}),h.set(n)}function $(X){return n.find(pe=>JSON.stringify(pe)!==JSON.stringify(i)&&pe.name===X.name)}let F=null,R=null;function D(X){F=X.currentTarget.id}function C(){t(3,R=null)}function W(X){t(3,R=X.currentTarget.id)}function ne(){if(F&&R){const X=n.findIndex(Ae=>Ae.name===F),pe=n.findIndex(Ae=>Ae.name===R),et=n[X];n.splice(X,1),Ve(h,n=n.slice(0,pe).concat(et).concat(n.slice(pe)),n)}F=t(3,R=null)}function Y(){b=this.value,t(2,b)}const he=(X,pe)=>{pe.key==="Enter"&&(pe.preventDefault(),$(X)||pe.currentTarget.blur())},j=X=>O(X),fe=(X,pe)=>pe.key===" "&&O(X),ge=X=>B(X),Re=(X,pe)=>pe.key===" "&&B(X),we=X=>v(X),dt=(X,pe)=>pe.key===" "&&v(X);return s.$$set=X=>{"show_modified"in X&&t(0,o=X.show_modified)},[o,g,b,R,n,r,h,f,d,p,v,O,M,B,N,V,$,D,C,W,ne,Y,he,j,fe,ge,Re,we,dt]}class Lm extends _e{constructor(e){super(),ke(this,e,Bm,Pm,be,{show_modified:0},null,[-1,-1])}}const Wl="ͼ",Wa=typeof Symbol>"u"?"__"+Wl:Symbol.for(Wl),ql=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),qa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class qn{constructor(e,t){this.rules=[];let{finish:n}=t||{};function i(l){return/^@/.test(l)?[l]:l.split(/,\s*/)}function r(l,o,a,h){let c=[],f=/^@(\w+)\b/.exec(l[0]),u=f&&f[1]=="keyframes";if(f&&o==null)return a.push(l[0]+";");for(let d in o){let p=o[d];if(/&/.test(d))r(d.split(/,\s*/).map(m=>l.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(i(d),p,c,u)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(c.length||u)&&a.push((n&&!f&&!h?l.map(n):l).join(", ")+" {"+c.join(" ")+"}")}for(let l in e)r(i(l),e[l],this.rules)}getRules(){return this.rules.join(` `)}static newName(){let e=qa[Wa]||1;return qa[Wa]=e+1,Wl+e.toString(36)}static mount(e,t,n){let i=e[ql],r=n&&n.nonce;i?r&&i.setNonce(r):i=new $m(e,r),i.mount(Array.isArray(t)?t:[t])}}let Ua=new Map;class $m{constructor(e,t){let n=e.ownerDocument||e,i=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let r=Ua.get(n);if(r)return e.adoptedStyleSheets=[r.sheet,...e.adoptedStyleSheets],e[ql]=r;this.sheet=new i.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],Ua.set(n,this)}else{this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let r=e.head||e;r.insertBefore(this.styleTag,r.firstChild)}this.modules=[],e[ql]=this}mount(e){let t=this.sheet,n=0,i=0;for(let r=0;r-1&&(this.modules.splice(o,1),i--,o=-1),o==-1){if(this.modules.splice(i++,0,l),t)for(let a=0;a",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Rm=typeof navigator<"u"&&/Mac/.test(navigator.platform),Im=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var st=0;st<10;st++)Un[48+st]=Un[96+st]=String(st);for(var st=1;st<=24;st++)Un[st+111]="F"+st;for(var st=65;st<=90;st++)Un[st]=String.fromCharCode(st+32),fs[st]=String.fromCharCode(st);for(var ul in Un)fs.hasOwnProperty(ul)||(fs[ul]=Un[ul]);function zm(s){var e=Rm&&s.metaKey&&s.shiftKey&&!s.ctrlKey&&!s.altKey||Im&&s.shiftKey&&s.key&&s.key.length==1||s.key=="Unidentified",t=!e&&s.key||(s.shiftKey?fs:Un)[s.keyCode]||s.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 dr(s){let e;return s.nodeType==11?e=s.getSelection?s:s.ownerDocument:e=s,e.getSelection()}function Ul(s,e){return e?s==e||s.contains(e.nodeType!=1?e.parentNode:e):!1}function jm(s){let e=s.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function nr(s,e){if(!e.anchorNode)return!1;try{return Ul(s,e.anchorNode)}catch{return!1}}function us(s){return s.nodeType==3?hi(s,0,s.nodeValue.length).getClientRects():s.nodeType==1?s.getClientRects():[]}function ss(s,e,t,n){return t?Ka(s,e,t,n,-1)||Ka(s,e,t,n,1):!1}function ds(s){for(var e=0;;e++)if(s=s.previousSibling,!s)return e}function Ka(s,e,t,n,i){for(;;){if(s==t&&e==n)return!0;if(e==(i<0?0:Tn(s))){if(s.nodeName=="DIV")return!1;let r=s.parentNode;if(!r||r.nodeType!=1)return!1;e=ds(s)+(i<0?0:1),s=r}else if(s.nodeType==1){if(s=s.childNodes[e+(i<0?-1:0)],s.nodeType==1&&s.contentEditable=="false")return!1;e=i<0?Tn(s):0}else return!1}}function Tn(s){return s.nodeType==3?s.nodeValue.length:s.childNodes.length}function Lo(s,e){let t=e?s.left:s.right;return{left:t,right:t,top:s.top,bottom:s.bottom}}function Vm(s){return{left:0,right:s.innerWidth,top:0,bottom:s.innerHeight}}function gu(s,e){let t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-s.offsetWidth)<1)&&(t=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-s.offsetHeight)<1)&&(n=1),{scaleX:t,scaleY:n}}function Hm(s,e,t,n,i,r,l,o){let a=s.ownerDocument,h=a.defaultView||window;for(let c=s,f=!1;c&&!f;)if(c.nodeType==1){let u,d=c==a.body,p=1,m=1;if(d)u=Vm(h);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 v=c.getBoundingClientRect();({scaleX:p,scaleY:m}=gu(c,v)),u={left:v.left,right:v.left+c.clientWidth*p,top:v.top,bottom:v.top+c.clientHeight*m}}let g=0,b=0;if(i=="nearest")e.top0&&e.bottom>u.bottom+b&&(b=e.bottom-u.bottom+b+l)):e.bottom>u.bottom&&(b=e.bottom-u.bottom+l,t<0&&e.top-b0&&e.right>u.right+g&&(g=e.right-u.right+g+r)):e.right>u.right&&(g=e.right-u.right+r,t<0&&e.leftt.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class Wm{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:n}=e;this.set(t,Math.min(e.anchorOffset,t?Tn(t):0),n,Math.min(e.focusOffset,n?Tn(n):0))}set(e,t,n,i){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=i}}let ki=null;function bu(s){if(s.setActive)return s.setActive();if(ki)return s.focus(ki);let e=[];for(let t=s;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(s.focus(ki==null?{get preventScroll(){return ki={preventScroll:!0},!0}}:void 0),!ki){ki=!1;for(let t=0;tMath.max(1,s.scrollHeight-s.clientHeight-4)}class ct{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new ct(e.parentNode,ds(e),t)}static after(e,t){return new ct(e.parentNode,ds(e)+1,t)}}const $o=[];class je{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 n of this.children){if(n==e)return t;t+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let n=this.dom,i=null,r;for(let l of this.children){if(l.flags&7){if(!l.dom&&(r=i?i.nextSibling:n.firstChild)){let o=je.get(r);(!o||!o.parent&&o.canReuseDOM(l))&&l.reuseDOM(r)}l.sync(e,t),l.flags&=-8}if(r=i?i.nextSibling:n.firstChild,t&&!t.written&&t.node==n&&r!=l.dom&&(t.written=!0),l.dom.parentNode==n)for(;r&&r!=l.dom;)r=Ga(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,r&&t&&t.node==n&&(t.written=!0);r;)r=Ga(r)}else if(this.flags&1)for(let n of this.children)n.flags&7&&(n.sync(e,t),n.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let n;if(e==this.dom)n=this.dom.childNodes[t];else{let i=Tn(e)==0?0:t==0?-1:1;for(;;){let r=e.parentNode;if(r==this.dom)break;i==0&&r.firstChild!=r.lastChild&&(e==r.firstChild?i=-1:i=1),e=r}i<0?n=e:n=e.nextSibling}if(n==this.dom.firstChild)return 0;for(;n&&!je.get(n);)n=n.nextSibling;if(!n)return this.length;for(let i=0,r=0;;i++){let l=this.children[i];if(l.dom==n)return r;r+=l.length+l.breakAfter}}domBoundsAround(e,t,n=0){let i=-1,r=-1,l=-1,o=-1;for(let a=0,h=n,c=n;at)return f.domBoundsAround(e,t,h);if(u>=e&&i==-1&&(i=a,r=h),h>t&&f.dom.parentNode==this.dom){l=a,o=c;break}c=u,h=u+f.breakAfter}return{from:r,to:o<0?n+this.length:o,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:l=0?this.children[l].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,n=$o){this.markDirty();for(let i=e;ithis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function yu(s,e,t,n,i,r,l,o,a){let{children:h}=s,c=h.length?h[e]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:l;if(!(e==n&&c&&!l&&!u&&r.length<2&&c.merge(t,i,r.length?f:null,t==0,o,a))){if(n0&&(!l&&r.length&&c.merge(t,c.length,r[0],!1,o,0)?c.breakAfter=r.shift().breakAfter:(t2);var se={mac:Za||/Mac/.test(Mt.platform),windows:/Win/.test(Mt.platform),linux:/Linux|X11/.test(Mt.platform),ie:Lr,ie_version:Su?Kl.documentMode||6:Gl?+Gl[1]:Jl?+Jl[1]:0,gecko:Ya,gecko_version:Ya?+(/Firefox\/(\d+)/.exec(Mt.userAgent)||[0,0])[1]:0,chrome:!!dl,chrome_version:dl?+dl[1]:0,ios:Za,android:/Android\b/.test(Mt.userAgent),webkit:Xa,safari:xu,webkit_version:Xa?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:Kl.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Km=256;class En extends je{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,n){return this.flags&8||n&&(!(n instanceof En)||this.length-(t-e)+n.length>Km||n.flags&8)?!1:(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new En(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 ct(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return Jm(this.dom,e,t)}}class On extends je{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let i of t)i.setParent(this)}setAttrs(e){if(_u(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,n,i,r,l){return n&&(!(n instanceof On&&n.mark.eq(this.mark))||e&&r<=0||te&&t.push(n=e&&(i=r),n=a,r++}let l=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new On(this.mark,t,l)}domAtPos(e){return Au(this,e)}coordsAt(e,t){return Mu(this,e,t)}}function Jm(s,e,t){let n=s.nodeValue.length;e>n&&(e=n);let i=e,r=e,l=0;e==0&&t<0||e==n&&t>=0?se.chrome||se.gecko||(e?(i--,l=1):r=0)?0:o.length-1];return se.safari&&!l&&a.width==0&&(a=Array.prototype.find.call(o,h=>h.width)||a),l?Lo(a,l<0):a||null}class Vn extends je{static create(e,t,n){return new Vn(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=Vn.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,n,i,r,l){return n&&(!(n instanceof Vn)||!this.widget.compare(n.widget)||e>0&&r<=0||t0)?ct.before(this.dom):ct.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let i=this.dom.getClientRects(),r=null;if(!i.length)return null;let l=this.side?this.side<0:e>0;for(let o=l?i.length-1:0;r=i[o],!(e>0?o==0:o==i.length-1||r.top0?ct.before(this.dom):ct.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return De.empty}get isHidden(){return!0}}En.prototype.children=Vn.prototype.children=Oi.prototype.children=$o;function Au(s,e){let t=s.dom,{children:n}=s,i=0;for(let r=0;ir&&e0;r--){let l=n[r-1];if(l.dom.parentNode==t)return l.domAtPos(l.length)}for(let r=i;r0&&e instanceof On&&i.length&&(n=i[i.length-1])instanceof On&&n.mark.eq(e.mark)?Cu(n,e.children[0],t-1):(i.push(e),e.setParent(s)),s.length+=e.length}function Mu(s,e,t){let n=null,i=-1,r=null,l=-1;function o(h,c){for(let f=0,u=0;f=c&&(d.children.length?o(d,c-u):(!r||r.isHidden&&t>0)&&(p>c||u==p&&d.getSide()>0)?(r=d,l=c-u):(u-1?1:0)!=i.length-(t&&i.indexOf(t)>-1?1:0))return!1;for(let r of n)if(r!=t&&(i.indexOf(r)==-1||s[r]!==e[r]))return!1;return!0}function Xl(s,e,t){let n=!1;if(e)for(let i in e)t&&i in t||(n=!0,i=="style"?s.style.cssText="":s.removeAttribute(i));if(t)for(let i in t)e&&e[i]==t[i]||(n=!0,i=="style"?s.style.cssText=t[i]:s.setAttribute(i,t[i]));return n}function Ym(s){let e=Object.create(null);for(let t=0;t0&&this.children[n-1].length==0;)this.children[--n].destroy();return this.children.length=n,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){Ro(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Cu(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=Yl(t,this.attrs||{})),n&&(this.attrs=Yl({class:n},this.attrs||{}))}domAtPos(e){return Au(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?this.flags&4&&(_u(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&&(Xl(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&&je.get(i)instanceof On;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((n=je.get(i))===null||n===void 0?void 0:n.isEditable)==!1&&(!se.ios||!this.children.some(r=>r instanceof En))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let n of this.children){if(!(n instanceof En)||/[^ -~]/.test(n.text))return null;let i=us(n.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 n=Mu(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:i}=this.parent.view.viewState,r=n.bottom-n.top;if(Math.abs(r-i.lineHeight)<2&&i.textHeight=t){if(r instanceof Je)return r;if(l>t)break}i=l+r.breakAfter}return null}}class Wn extends je{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,i,r,l){return n&&(!(n instanceof Wn)||!this.widget.compare(n.widget)||e>0&&r<=0||t0}}class pi{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,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var gt=function(s){return s[s.Text=0]="Text",s[s.WidgetBefore=1]="WidgetBefore",s[s.WidgetAfter=2]="WidgetAfter",s[s.WidgetRange=3]="WidgetRange",s}(gt||(gt={}));class Be extends Ei{constructor(e,t,n,i){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=i}get heightRelevant(){return!1}static mark(e){return new Ss(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Kn(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,i;if(e.isBlockGap)n=-5e8,i=4e8;else{let{start:r,end:l}=Tu(e,t);n=(r?t?-3e8:-1:5e8)-1,i=(l?t?2e8:1:-6e8)+1}return new Kn(e,n,i,t,e.widget||null,!0)}static line(e){return new xs(e)}static set(e,t=!1){return Ee.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Be.none=Ee.empty;class Ss extends Be{constructor(e){let{start:t,end:n}=Tu(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof Ss&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((n=e.attrs)===null||n===void 0?void 0:n.class))&&Ro(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)}}Ss.prototype.point=!1;class xs extends Be{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof xs&&this.spec.class==e.spec.class&&Ro(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)}}xs.prototype.mapMode=vt.TrackBefore;xs.prototype.point=!0;class Kn extends Be{constructor(e,t,n,i,r,l){super(t,n,r,e),this.block=i,this.isReplace=l,this.mapMode=i?t<=0?vt.TrackBefore:vt.TrackAfter:vt.TrackDel}get type(){return this.startSide!=this.endSide?gt.WidgetRange:this.startSide<=0?gt.WidgetBefore:gt.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Kn&&Xm(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)}}Kn.prototype.point=!0;function Tu(s,e=!1){let{inclusiveStart:t,inclusiveEnd:n}=s;return t==null&&(t=s.inclusive),n==null&&(n=s.inclusive),{start:t??e,end:n??e}}function Xm(s,e){return s==e||!!(s&&e&&s.compare(e))}function Zl(s,e,t,n=0){let i=t.length-1;i>=0&&t[i]+n>=s?t[i]=Math.max(t[i],e):t.push(s,e)}class rs{constructor(e,t,n,i){this.doc=e,this.pos=t,this.end=n,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 Wn&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Je),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append($s(new Oi(-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 Wn)&&this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:l,done:o}=this.cursor.next(this.skip);if(this.skip=0,o)throw new Error("Ran out of text content when drawing inline views");if(l){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=r,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append($s(new En(this.text.slice(this.textOff,this.textOff+i)),t),n),this.atCursorPos=!0,this.textOff+=i,e-=i,n=0}}span(e,t,n,i){this.buildText(t-e,n,i),this.pos=t,this.openStart<0&&(this.openStart=i)}point(e,t,n,i,r,l){if(this.disallowBlockEffectsFor[l]&&n instanceof Kn){if(n.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 o=t-e;if(n instanceof Kn)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Wn(n.widget||new eh("div"),o,n));else{let a=Vn.create(n.widget||new eh("span"),o,o?0:n.startSide),h=this.atCursorPos&&!a.isEditable&&r<=i.length&&(e0),c=!a.isEditable&&(ei.length||n.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!h&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),h&&(f.append($s(new Oi(1),i),r),r=i.length+Math.max(0,r-i.length)),f.append($s(a,i),r),this.atCursorPos=c,this.pendingBuffer=c?ei.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);o&&(this.textOff+o<=this.text.length?this.textOff+=o:(this.skip+=o-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,n,i,r){let l=new rs(e,t,n,r);return l.openEnd=Ee.spans(i,t,n,l),l.openStart<0&&(l.openStart=l.openEnd),l.finish(l.openEnd),l}}function $s(s,e){for(let t of e)s=new On(t,[s],s.length);return s}class eh extends pi{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}}var He=function(s){return s[s.LTR=0]="LTR",s[s.RTL=1]="RTL",s}(He||(He={}));const ci=He.LTR,Io=He.RTL;function Eu(s){let e=[];for(let t=0;t=t){if(o.level==n)return l;(r<0||(i!=0?i<0?o.fromt:e[r].level>o.level))&&(r=l)}}if(r<0)throw new RangeError("Index out of range");return r}}function Du(s,e){if(s.length!=e.length)return!1;for(let t=0;t=0;m-=3)if(en[m+1]==-d){let g=en[m+2],b=g&2?i:g&4?g&1?r:i:0;b&&(Ie[f]=Ie[en[m]]=b),o=m;break}}else{if(en.length==189)break;en[o++]=f,en[o++]=u,en[o++]=a}else if((p=Ie[f])==2||p==1){let m=p==i;a=m?0:1;for(let g=o-3;g>=0;g-=3){let b=en[g+2];if(b&2)break;if(m)en[g+2]|=2;else{if(b&4)break;en[g+2]|=4}}}}}function ig(s,e,t,n){for(let i=0,r=n;i<=t.length;i++){let l=i?t[i-1].to:s,o=ia;)p==g&&(p=t[--m].from,g=m?t[m-1].to:s),Ie[--p]=d;a=c}else r=h,a++}}}function eo(s,e,t,n,i,r,l){let o=n%2?2:1;if(n%2==i%2)for(let a=e,h=0;aa&&l.push(new Hn(a,m.from,d));let g=m.direction==ci!=!(d%2);to(s,g?n+1:n,i,m.inner,m.from,m.to,l),a=m.to}p=m.to}else{if(p==t||(c?Ie[p]!=o:Ie[p]==o))break;p++}u?eo(s,a,p,n+1,i,u,l):ae;){let c=!0,f=!1;if(!h||a>r[h-1].to){let m=Ie[a-1];m!=o&&(c=!1,f=m==16)}let u=!c&&o==1?[]:null,d=c?n:n+1,p=a;e:for(;;)if(h&&p==r[h-1].to){if(f)break e;let m=r[--h];if(!c)for(let g=m.from,b=h;;){if(g==e)break e;if(b&&r[b-1].to==g)g=r[--b].from;else{if(Ie[g-1]==o)break e;break}}if(u)u.push(m);else{m.toIe.length;)Ie[Ie.length]=256;let n=[],i=e==ci?0:1;return to(s,i,i,t,0,s.length,n),n}function Pu(s){return[new Hn(0,s,0)]}let Nu="";function rg(s,e,t,n,i){var r;let l=n.head-s.from,o=Hn.find(e,l,(r=n.bidiLevel)!==null&&r!==void 0?r:-1,n.assoc),a=e[o],h=a.side(i,t);if(l==h){let u=o+=i?1:-1;if(u<0||u>=e.length)return null;a=e[o=u],l=a.side(!i,t),h=a.side(i,t)}let c=mt(s.text,l,a.forward(i,t));(ca.to)&&(c=h),Nu=s.text.slice(Math.min(l,c),Math.max(l,c));let f=o==(i?e.length-1:0)?null:e[o+(i?1:-1)];return f&&c==h&&f.level+(i?0:1)s.some(e=>e)}),Vu=le.define({combine:s=>s.some(e=>e)});class Mi{constructor(e,t="nearest",n="nearest",i=5,r=5,l=!1){this.range=e,this.y=t,this.x=n,this.yMargin=i,this.xMargin=r,this.isSnapshot=l}map(e){return e.empty?this:new Mi(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 Mi(q.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Rs=Ne.define({map:(s,e)=>s.map(e)});function An(s,e,t){let n=s.facet(Ru);n.length?n[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const $r=le.define({combine:s=>s.length?s[0]:!0});let og=0;const Yi=le.define();class rt{constructor(e,t,n,i,r){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=i,this.extension=r(this)}static define(e,t){const{eventHandlers:n,eventObservers:i,provide:r,decorations:l}=t||{};return new rt(og++,e,n,i,o=>{let a=[Yi.of(o)];return l&&a.push(ps.of(h=>{let c=h.plugin(o);return c?l(c):Be.none})),r&&a.push(r(o)),a})}static fromClass(e,t){return rt.define(n=>new e(n),t)}}class pl{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(n){if(An(t.state,n,"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){An(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(n){An(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Hu=le.define(),zo=le.define(),ps=le.define(),Fu=le.define(),jo=le.define(),Wu=le.define();function th(s,e){let t=s.state.facet(Wu);if(!t.length)return t;let n=t.map(r=>r instanceof Function?r(s):r),i=[];return Ee.spans(n,e.from,e.to,{point(){},span(r,l,o,a){let h=r-e.from,c=l-e.from,f=i;for(let u=o.length-1;u>=0;u--,a--){let d=o[u].spec.bidiIsolate,p;if(d==null&&(d=lg(e.text,h,c)),a>0&&f.length&&(p=f[f.length-1]).to==h&&p.direction==d)p.to=c,f=p.inner;else{let m={from:h,to:c,direction:d,inner:[]};f.push(m),f=m.inner}}}}),i}const qu=le.define();function Uu(s){let e=0,t=0,n=0,i=0;for(let r of s.state.facet(qu)){let l=r(s);l&&(l.left!=null&&(e=Math.max(e,l.left)),l.right!=null&&(t=Math.max(t,l.right)),l.top!=null&&(n=Math.max(n,l.top)),l.bottom!=null&&(i=Math.max(i,l.bottom)))}return{left:e,right:t,top:n,bottom:i}}const Xi=le.define();class It{constructor(e,t,n,i){this.fromA=e,this.toA=t,this.fromB=n,this.toB=i}join(e){return new It(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,n=this;for(;t>0;t--){let i=e[t-1];if(!(i.fromA>n.toA)){if(i.toAc)break;r+=2}if(!a)return n;new It(a.fromA,a.toA,a.fromB,a.toB).addToSet(n),l=a.toA,o=a.toB}}}class pr{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=Ge.empty(this.startState.doc.length);for(let r of n)this.changes=this.changes.compose(r.changes);let i=[];this.changes.iterChangedRanges((r,l,o,a)=>i.push(new It(r,l,o,a))),this.changedRanges=i}static create(e,t,n){return new pr(e,t,n)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>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 nh extends je{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,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 Je],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new It(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:h,toA:c})=>cthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let i=-1;this.view.inputState.composing>=0&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?i=this.domChanged.newSel.head:!pg(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let r=i>-1?hg(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:h,to:c}=this.hasComposition;n=new It(h,c,e.changes.mapPos(h,-1),e.changes.mapPos(c,1)).addToSet(n.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(se.ie||se.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let l=this.decorations,o=this.updateDeco(),a=ug(l,o,e.changes);return n=It.extendWithRanges(n,a),!(this.flags&7)&&n.length==0?!1:(this.updateInner(n,e.startState.doc.length,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);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 l=se.chrome||se.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,l),this.flags&=-8,l&&(l.written||i.selectionRange.focusNode!=l.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(l=>l.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to=0?i[l]:null;if(!o)break;let{fromA:a,toA:h,fromB:c,toB:f}=o,u,d,p,m;if(n&&n.range.fromBc){let M=rs.build(this.view.state.doc,c,n.range.fromB,this.decorations,this.dynamicDecorationMap),B=rs.build(this.view.state.doc,n.range.toB,f,this.decorations,this.dynamicDecorationMap);d=M.breakAtStart,p=M.openStart,m=B.openEnd;let N=this.compositionView(n);B.breakAtStart?N.breakAfter=1:B.content.length&&N.merge(N.length,N.length,B.content[0],!1,B.openStart,0)&&(N.breakAfter=B.content[0].breakAfter,B.content.shift()),M.content.length&&N.merge(0,0,M.content[M.content.length-1],!0,0,M.openEnd)&&M.content.pop(),u=M.content.concat(N).concat(B.content)}else({content:u,breakAtStart:d,openStart:p,openEnd:m}=rs.build(this.view.state.doc,c,f,this.decorations,this.dynamicDecorationMap));let{i:g,off:b}=r.findPos(h,1),{i:v,off:O}=r.findPos(a,-1);yu(this,v,O,g,b,u,d,p,m)}n&&this.fixCompositionDOM(n)}compositionView(e){let t=new En(e.text.nodeValue);t.flags|=8;for(let{deco:i}of e.marks)t=new On(i,[t],t.length);let n=new Je;return n.append(t,0),n}fixCompositionDOM(e){let t=(r,l)=>{l.flags|=8|(l.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(l);let o=je.get(r);o&&o!=l&&(o.dom=null),l.setDOM(r)},n=this.childPos(e.range.fromB,1),i=this.children[n.i];t(e.line,i);for(let r=e.marks.length-1;r>=-1;r--)n=i.childPos(n.off,1),i=i.children[n.i],t(r>=0?e.marks[r].node:e.text,i)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let n=this.view.root.activeElement,i=n==this.dom,r=!i&&nr(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(i||t||r))return;let l=this.forceSelection;this.forceSelection=!1;let o=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(o.anchor)),h=o.empty?a:this.moveToLine(this.domAtPos(o.head));if(se.gecko&&o.empty&&!this.hasComposition&&ag(a)){let f=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(f,a.node.childNodes[a.offset]||null)),a=h=new ct(f,0),l=!0}let c=this.view.observer.selectionRange;(l||!c.focusNode||(!ss(a.node,a.offset,c.anchorNode,c.anchorOffset)||!ss(h.node,h.offset,c.focusNode,c.focusOffset))&&!this.suppressWidgetCursorChange(c,o))&&(this.view.observer.ignore(()=>{se.android&&se.chrome&&this.dom.contains(c.focusNode)&&dg(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=dr(this.view.root);if(f)if(o.empty){if(se.gecko){let u=cg(a.node,a.offset);if(u&&u!=3){let d=Ju(a.node,a.offset,u==1?1:-1);d&&(a=new ct(d.node,d.offset))}}f.collapse(a.node,a.offset),o.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=o.bidiLevel)}else if(f.extend){f.collapse(a.node,a.offset);try{f.extend(h.node,h.offset)}catch{}}else{let u=document.createRange();o.anchor>o.head&&([a,h]=[h,a]),u.setEnd(h.node,h.offset),u.setStart(a.node,a.offset),f.removeAllRanges(),f.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(a,h)),this.impreciseAnchor=a.precise?null:new ct(c.anchorNode,c.anchorOffset),this.impreciseHead=h.precise?null:new ct(c.focusNode,c.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&ss(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,n=dr(e.root),{anchorNode:i,anchorOffset:r}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let l=Je.find(this,t.head);if(!l)return;let o=l.posAtStart;if(t.head==o||t.head==o+l.length)return;let a=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!a||!h||a.bottom>h.top)return;let c=this.domAtPos(t.head+t.assoc);n.collapse(c.node,c.offset),n.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&&n.collapse(i,r)}moveToLine(e){let t=this.dom,n;if(e.node!=t)return e;for(let i=e.offset;!n&&i=0;i--){let r=je.get(t.childNodes[i]);r instanceof Je&&(n=r.domAtPos(r.length))}return n?new ct(n.node,n.offset,!0):e}nearest(e){for(let t=e;t;){let n=je.get(t);if(n&&n.rootView==this)return n;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t=0;l--){let o=this.children[l],a=r-o.breakAfter,h=a-o.length;if(ae||o.covers(1))&&(!n||o instanceof Je&&!(n instanceof Je&&t>=0))&&(n=o,i=h),r=h}return n?n.coordsAt(e-i,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),i=this.children[t];if(!(i instanceof Je))return null;for(;i.children.length;){let{i:o,off:a}=i.childPos(n,1);for(;;o++){if(o==i.children.length)return null;if((i=i.children[o]).length)break}n=a}if(!(i instanceof En))return null;let r=mt(i.text,n);if(r==n)return null;let l=hi(i.dom,n,r).getClientRects();for(let o=0;oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,a=this.view.textDirection==He.LTR;for(let h=0,c=0;ci)break;if(h>=n){let d=f.dom.getBoundingClientRect();if(t.push(d.height),l){let p=f.dom.lastChild,m=p?us(p):[];if(m.length){let g=m[m.length-1],b=a?g.right-d.left:d.right-g.left;b>o&&(o=b,this.minWidth=r,this.minWidthFrom=h,this.minWidthTo=u)}}}h=u+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?He.RTL:He.LTR}measureTextSize(){for(let r of this.children)if(r instanceof Je){let l=r.measureTextSize();if(l)return l}let e=document.createElement("div"),t,n,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 r=us(e.firstChild)[0];t=e.getBoundingClientRect().height,n=r?r.width/27:7,i=r?r.height:t,e.remove()}),{lineHeight:t,charWidth:n,textHeight:i}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new vu(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,i=0;;i++){let r=i==t.viewports.length?null:t.viewports[i],l=r?r.from-1:this.length;if(l>n){let o=(t.lineBlockAt(l).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(Be.replace({widget:new ih(o),block:!0,inclusive:!0,isBlockGap:!0}).range(n,l))}if(!r)break;n=r.to+1}return Be.set(e)}updateDeco(){let e=this.view.state.facet(ps).map((i,r)=>(this.dynamicDecorationMap[r]=typeof i=="function")?i(this.view):i),t=!1,n=this.view.state.facet(Fu).map((i,r)=>{let l=typeof i=="function";return l&&(t=!0),l?i(this.view):i});n.length&&(this.dynamicDecorationMap[e.length]=t,e.push(Ee.join(n)));for(let i=e.length;it.anchor?-1:1),i;if(!n)return;!t.empty&&(i=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,i.left),top:Math.min(n.top,i.top),right:Math.max(n.right,i.right),bottom:Math.max(n.bottom,i.bottom)});let r=Uu(this.view),l={left:n.left-r.left,top:n.top-r.top,right:n.right+r.right,bottom:n.bottom+r.bottom},{offsetWidth:o,offsetHeight:a}=this.view.scrollDOM;Hm(this.view.scrollDOM,l,t.head0)n=n.childNodes[i-1],i=Tn(n);else break}if(t>=0)for(let n=s,i=e;;){if(n.nodeType==3)return{node:n,offset:i};if(n.nodeType==1&&i=0)n=n.childNodes[i],i=0;else break}return null}function cg(s,e){return s.nodeType!=1?0:(e&&s.childNodes[e-1].contentEditable=="false"?1:0)|(e{ne.from&&(t=!0)}),t}function mg(s,e,t=1){let n=s.charCategorizer(e),i=s.doc.lineAt(e),r=e-i.from;if(i.length==0)return q.cursor(e);r==0?t=1:r==i.length&&(t=-1);let l=r,o=r;t<0?l=mt(i.text,r,!1):o=mt(i.text,r);let a=n(i.text.slice(l,o));for(;l>0;){let h=mt(i.text,l,!1);if(n(i.text.slice(h,l))!=a)break;l=h}for(;os?e.left-s:Math.max(0,s-e.right)}function bg(s,e){return e.top>s?e.top-s:Math.max(0,s-e.bottom)}function ml(s,e){return s.tope.top+1}function sh(s,e){return es.bottom?{top:s.top,left:s.left,right:s.right,bottom:e}:s}function io(s,e,t){let n,i,r,l,o=!1,a,h,c,f;for(let p=s.firstChild;p;p=p.nextSibling){let m=us(p);for(let g=0;gO||l==O&&r>v){n=p,i=b,r=v,l=O;let M=O?t0?g0)}v==0?t>b.bottom&&(!c||c.bottomb.top)&&(h=p,f=b):c&&ml(c,b)?c=rh(c,b.bottom):f&&ml(f,b)&&(f=sh(f,b.top))}}if(c&&c.bottom>=t?(n=a,i=c):f&&f.top<=t&&(n=h,i=f),!n)return{node:s,offset:0};let u=Math.max(i.left,Math.min(i.right,e));if(n.nodeType==3)return lh(n,u,t);if(o&&n.contentEditable!="false")return io(n,u,t);let d=Array.prototype.indexOf.call(s.childNodes,n)+(e>=(i.left+i.right)/2?1:0);return{node:s,offset:d}}function lh(s,e,t){let n=s.nodeValue.length,i=-1,r=1e9,l=0;for(let o=0;ot?c.top-t:t-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&f=(c.left+c.right)/2,d=u;if((se.chrome||se.gecko)&&hi(s,o).getBoundingClientRect().left==c.right&&(d=!u),f<=0)return{node:s,offset:o+(d?1:0)};i=o+(d?1:0),r=f}}}return{node:s,offset:i>-1?i:l>0?s.nodeValue.length:0}}function Gu(s,e,t,n=-1){var i,r;let l=s.contentDOM.getBoundingClientRect(),o=l.top+s.viewState.paddingTop,a,{docHeight:h}=s.viewState,{x:c,y:f}=e,u=f-o;if(u<0)return 0;if(u>h)return s.state.doc.length;for(let M=s.viewState.heightOracle.textHeight/2,B=!1;a=s.elementAtHeight(u),a.type!=gt.Text;)for(;u=n>0?a.bottom+M:a.top-M,!(u>=0&&u<=h);){if(B)return t?null:0;B=!0,n=-n}f=o+u;let d=a.from;if(ds.viewport.to)return s.viewport.to==s.state.doc.length?s.state.doc.length:t?null:oh(s,l,a,c,f);let p=s.dom.ownerDocument,m=s.root.elementFromPoint?s.root:p,g=m.elementFromPoint(c,f);g&&!s.contentDOM.contains(g)&&(g=null),g||(c=Math.max(l.left+1,Math.min(l.right-1,c)),g=m.elementFromPoint(c,f),g&&!s.contentDOM.contains(g)&&(g=null));let b,v=-1;if(g&&((i=s.docView.nearest(g))===null||i===void 0?void 0:i.isEditable)!=!1){if(p.caretPositionFromPoint){let M=p.caretPositionFromPoint(c,f);M&&({offsetNode:b,offset:v}=M)}else if(p.caretRangeFromPoint){let M=p.caretRangeFromPoint(c,f);M&&({startContainer:b,startOffset:v}=M,(!s.contentDOM.contains(b)||se.safari&&_g(b,v,c)||se.chrome&&kg(b,v,c))&&(b=void 0))}}if(!b||!s.docView.dom.contains(b)){let M=Je.find(s.docView,d);if(!M)return u>a.top+a.height/2?a.to:a.from;({node:b,offset:v}=io(M.dom,c,f))}let O=s.docView.nearest(b);if(!O)return null;if(O.isWidget&&((r=O.dom)===null||r===void 0?void 0:r.nodeType)==1){let M=O.dom.getBoundingClientRect();return e.ys.defaultLineHeight*1.5){let o=s.viewState.heightOracle.textHeight,a=Math.floor((i-t.top-(s.defaultLineHeight-o)*.5)/o);r+=a*s.viewState.heightOracle.lineLength}let l=s.state.sliceDoc(t.from,t.to);return t.from+Fl(l,r,s.state.tabSize)}function _g(s,e,t){let n;if(s.nodeType!=3||e!=(n=s.nodeValue.length))return!1;for(let i=s.nextSibling;i;i=i.nextSibling)if(i.nodeType!=1||i.nodeName!="BR")return!1;return hi(s,n-1,n).getBoundingClientRect().left>t}function kg(s,e,t){if(e!=0)return!1;for(let i=s;;){let r=i.parentNode;if(!r||r.nodeType!=1||r.firstChild!=i)return!1;if(r.classList.contains("cm-line"))break;i=r}let n=s.nodeType==1?s.getBoundingClientRect():hi(s,0,Math.max(s.nodeValue.length,1)).getBoundingClientRect();return t-n.left>5}function so(s,e){let t=s.lineBlockAt(e);if(Array.isArray(t.type)){for(let n of t.type)if(n.to>e||n.to==e&&(n.to==t.to||n.type==gt.Text))return n}return t}function vg(s,e,t,n){let i=so(s,e.head),r=!n||i.type!=gt.Text||!(s.lineWrapping||i.widgetLineBreaks)?null:s.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(r){let l=s.dom.getBoundingClientRect(),o=s.textDirectionAt(i.from),a=s.posAtCoords({x:t==(o==He.LTR)?l.right-1:l.left+1,y:(r.top+r.bottom)/2});if(a!=null)return q.cursor(a,t?-1:1)}return q.cursor(t?i.to:i.from,t?-1:1)}function ah(s,e,t,n){let i=s.state.doc.lineAt(e.head),r=s.bidiSpans(i),l=s.textDirectionAt(i.from);for(let o=e,a=null;;){let h=rg(i,r,l,o,t),c=Nu;if(!h){if(i.number==(t?s.state.doc.lines:1))return o;c=` `,i=s.state.doc.line(i.number+(t?1:-1)),r=s.bidiSpans(i),h=s.visualLineSide(i,!t)}if(a){if(!a(c))return o}else{if(!n)return h;a=n(c)}o=h}}function yg(s,e,t){let n=s.state.charCategorizer(e),i=n(t);return r=>{let l=n(r);return i==xn.Space&&(i=l),i==l}}function wg(s,e,t,n){let i=e.head,r=t?1:-1;if(i==(t?s.state.doc.length:0))return q.cursor(i,e.assoc);let l=e.goalColumn,o,a=s.contentDOM.getBoundingClientRect(),h=s.coordsAtPos(i,e.assoc||-1),c=s.documentTop;if(h)l==null&&(l=h.left-a.left),o=r<0?h.top:h.bottom;else{let d=s.viewState.lineBlockAt(i);l==null&&(l=Math.min(a.right-a.left,s.defaultCharacterWidth*(i-d.from))),o=(r<0?d.top:d.bottom)+c}let f=a.left+l,u=n??s.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=o+(u+d)*r,m=Gu(s,{x:f,y:p},!1,r);if(pa.bottom||(r<0?mi)){let g=s.docView.coordsForChar(m),b=!g||p{if(e>r&&ei(s)),t.from,e.head>t.from?-1:1);return n==t.from?t:q.cursor(n,nnull),se.gecko&&zg(e.contentDOM.ownerDocument)}handleEvent(e){!Dg(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let n=this.handlers[e];if(n){for(let i of n.observers)i(this.view,t);for(let i of n.handlers){if(t.defaultPrevented)break;if(i(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=xg(e),n=this.handlers,i=this.view.contentDOM;for(let r in t)if(r!="scroll"){let l=!t[r].handlers.length,o=n[r];o&&l!=!o.handlers.length&&(i.removeEventListener(r,this.handleEvent),o=null),o||i.addEventListener(r,this.handleEvent,{passive:l})}for(let r in n)r!="scroll"&&!t[r]&&i.removeEventListener(r,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&Date.now()n.keyCode==e.keyCode))&&!e.ctrlKey||Ag.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(){let e=this.pendingIOSKey;return e?(this.pendingIOSKey=void 0,Ci(this.view.contentDOM,e.key,e.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:se.safari&&!se.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.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 hh(s,e){return(t,n)=>{try{return e.call(s,n,t)}catch(i){An(t.state,i)}}}function xg(s){let e=Object.create(null);function t(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of s){let i=n.spec;if(i&&i.domEventHandlers)for(let r in i.domEventHandlers){let l=i.domEventHandlers[r];l&&t(r).handlers.push(hh(n.value,l))}if(i&&i.domEventObservers)for(let r in i.domEventObservers){let l=i.domEventObservers[r];l&&t(r).observers.push(hh(n.value,l))}}for(let n in Ut)t(n).handlers.push(Ut[n]);for(let n in Kt)t(n).observers.push(Kt[n]);return e}const Yu=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Ag="dthko",Xu=[16,17,18,20,91,92,224,225],Is=6;function zs(s){return Math.max(0,s)*.7+8}function Cg(s,e){return Math.max(Math.abs(s.clientX-e.clientX),Math.abs(s.clientY-e.clientY))}class Mg{constructor(e,t,n,i){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=Fm(e.contentDOM),this.atoms=e.state.facet(jo).map(l=>l(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(ye.allowMultipleSelections)&&Tg(e,t),this.dragging=Og(e,t)&&td(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Cg(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,i=0,r=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},l=Uu(this.view);e.clientX-l.left<=r.left+Is?n=-zs(r.left-e.clientX):e.clientX+l.right>=r.right-Is&&(n=zs(e.clientX-r.right)),e.clientY-l.top<=r.top+Is?i=-zs(r.top-e.clientY):e.clientY+l.bottom>=r.bottom-Is&&(i=zs(e.clientY-r.bottom)),this.setScrollSpeed(n,i)}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(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;nthis.select(this.lastEvent),20)}}function Tg(s,e){let t=s.state.facet(Bu);return t.length?t[0](e):se.mac?e.metaKey:e.ctrlKey}function Eg(s,e){let t=s.state.facet(Lu);return t.length?t[0](e):se.mac?!e.altKey:!e.ctrlKey}function Og(s,e){let{main:t}=s.state.selection;if(t.empty)return!1;let n=dr(s.root);if(!n||n.rangeCount==0)return!0;let i=n.getRangeAt(0).getClientRects();for(let r=0;r=e.clientX&&l.top<=e.clientY&&l.bottom>=e.clientY)return!0}return!1}function Dg(s,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,n;t!=s.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(n=je.get(t))&&n.ignoreEvent(e))return!1;return!0}const Ut=Object.create(null),Kt=Object.create(null),Zu=se.ie&&se.ie_version<15||se.ios&&se.webkit_version<604;function Pg(s){let e=s.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{s.focus(),t.remove(),Qu(s,t.value)},50)}function Qu(s,e){let{state:t}=s,n,i=1,r=t.toText(e),l=r.lines==t.selection.ranges.length;if(ro!=null&&t.selection.ranges.every(a=>a.empty)&&ro==r.toString()){let a=-1;n=t.changeByRange(h=>{let c=t.doc.lineAt(h.from);if(c.from==a)return{range:h};a=c.from;let f=t.toText((l?r.line(i++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:q.cursor(h.from+f.length)}})}else l?n=t.changeByRange(a=>{let h=r.line(i++);return{changes:{from:a.from,to:a.to,insert:h.text},range:q.cursor(a.from+h.length)}}):n=t.replaceSelection(r);s.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}Kt.scroll=s=>{s.inputState.lastScrollTop=s.scrollDOM.scrollTop,s.inputState.lastScrollLeft=s.scrollDOM.scrollLeft};Ut.keydown=(s,e)=>(s.inputState.setSelectionOrigin("select"),e.keyCode==27&&(s.inputState.lastEscPress=Date.now()),!1);Kt.touchstart=(s,e)=>{s.inputState.lastTouchTime=Date.now(),s.inputState.setSelectionOrigin("select.pointer")};Kt.touchmove=s=>{s.inputState.setSelectionOrigin("select.pointer")};Ut.mousedown=(s,e)=>{if(s.observer.flush(),s.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let n of s.state.facet($u))if(t=n(s,e),t)break;if(!t&&e.button==0&&(t=Lg(s,e)),t){let n=!s.hasFocus;s.inputState.startMouseSelection(new Mg(s,e,t,n)),n&&s.observer.ignore(()=>bu(s.contentDOM));let i=s.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}return!1};function ch(s,e,t,n){if(n==1)return q.cursor(e,t);if(n==2)return mg(s.state,e,t);{let i=Je.find(s.docView,e),r=s.state.doc.lineAt(i?i.posAtEnd:e),l=i?i.posAtStart:r.from,o=i?i.posAtEnd:r.to;return os>=e.top&&s<=e.bottom,fh=(s,e,t)=>ed(e,t)&&s>=t.left&&s<=t.right;function Ng(s,e,t,n){let i=Je.find(s.docView,e);if(!i)return 1;let r=e-i.posAtStart;if(r==0)return 1;if(r==i.length)return-1;let l=i.coordsAt(r,-1);if(l&&fh(t,n,l))return-1;let o=i.coordsAt(r,1);return o&&fh(t,n,o)?1:l&&ed(n,l)?-1:1}function uh(s,e){let t=s.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:Ng(s,t,e.clientX,e.clientY)}}const Bg=se.ie&&se.ie_version<=11;let dh=null,ph=0,mh=0;function td(s){if(!Bg)return s.detail;let e=dh,t=mh;return dh=s,mh=Date.now(),ph=!e||t>Date.now()-400&&Math.abs(e.clientX-s.clientX)<2&&Math.abs(e.clientY-s.clientY)<2?(ph+1)%3:1}function Lg(s,e){let t=uh(s,e),n=td(e),i=s.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),i=i.map(r.changes))},get(r,l,o){let a=uh(s,r),h,c=ch(s,a.pos,a.bias,n);if(t.pos!=a.pos&&!l){let f=ch(s,t.pos,t.bias,n),u=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=u1&&(h=$g(i,a.pos))?h:o?i.addRange(c):q.create([c])}}}function $g(s,e){for(let t=0;t=e)return q.create(s.ranges.slice(0,t).concat(s.ranges.slice(t+1)),s.mainIndex==t?0:s.mainIndex-(s.mainIndex>t?1:0))}return null}Ut.dragstart=(s,e)=>{let{selection:{main:t}}=s.state;if(e.target.draggable){let i=s.docView.nearest(e.target);if(i&&i.isWidget){let r=i.posAtStart,l=r+i.length;(r>=t.to||l<=t.from)&&(t=q.range(r,l))}}let{inputState:n}=s;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",s.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};Ut.dragend=s=>(s.inputState.draggedContent=null,!1);function gh(s,e,t,n){if(!t)return;let i=s.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=s.inputState,l=n&&r&&Eg(s,e)?{from:r.from,to:r.to}:null,o={from:i,insert:t},a=s.state.changes(l?[l,o]:o);s.focus(),s.dispatch({changes:a,selection:{anchor:a.mapPos(i,-1),head:a.mapPos(i,1)},userEvent:l?"move.drop":"input.drop"}),s.inputState.draggedContent=null}Ut.drop=(s,e)=>{if(!e.dataTransfer)return!1;if(s.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let n=Array(t.length),i=0,r=()=>{++i==t.length&&gh(s,e,n.filter(l=>l!=null).join(s.state.lineBreak),!1)};for(let l=0;l{/[\x00-\x08\x0e-\x1f]{2}/.test(o.result)||(n[l]=o.result),r()},o.readAsText(t[l])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return gh(s,e,n,!0),!0}return!1};Ut.paste=(s,e)=>{if(s.state.readOnly)return!0;s.observer.flush();let t=Zu?null:e.clipboardData;return t?(Qu(s,t.getData("text/plain")||t.getData("text/uri-text")),!0):(Pg(s),!1)};function Rg(s,e){let t=s.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),s.focus()},50)}function Ig(s){let e=[],t=[],n=!1;for(let i of s.selection.ranges)i.empty||(e.push(s.sliceDoc(i.from,i.to)),t.push(i));if(!e.length){let i=-1;for(let{from:r}of s.selection.ranges){let l=s.doc.lineAt(r);l.number>i&&(e.push(l.text),t.push({from:l.from,to:Math.min(s.doc.length,l.to+1)})),i=l.number}n=!0}return{text:e.join(s.lineBreak),ranges:t,linewise:n}}let ro=null;Ut.copy=Ut.cut=(s,e)=>{let{text:t,ranges:n,linewise:i}=Ig(s.state);if(!t&&!i)return!1;ro=i?t:null,e.type=="cut"&&!s.state.readOnly&&s.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let r=Zu?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",t),!0):(Rg(s,t),!1)};const nd=Yn.define();function id(s,e){let t=[];for(let n of s.facet(zu)){let i=n(s,e);i&&t.push(i)}return t?s.update({effects:t,annotations:nd.of(!0)}):null}function sd(s){setTimeout(()=>{let e=s.hasFocus;if(e!=s.inputState.notifiedFocused){let t=id(s.state,e);t?s.dispatch(t):s.update([])}},10)}Kt.focus=s=>{s.inputState.lastFocusTime=Date.now(),!s.scrollDOM.scrollTop&&(s.inputState.lastScrollTop||s.inputState.lastScrollLeft)&&(s.scrollDOM.scrollTop=s.inputState.lastScrollTop,s.scrollDOM.scrollLeft=s.inputState.lastScrollLeft),sd(s)};Kt.blur=s=>{s.observer.clearSelectionRange(),sd(s)};Kt.compositionstart=Kt.compositionupdate=s=>{s.inputState.compositionFirstChange==null&&(s.inputState.compositionFirstChange=!0),s.inputState.composing<0&&(s.inputState.composing=0)};Kt.compositionend=s=>{s.inputState.composing=-1,s.inputState.compositionEndedAt=Date.now(),s.inputState.compositionPendingKey=!0,s.inputState.compositionPendingChange=s.observer.pendingRecords().length>0,s.inputState.compositionFirstChange=null,se.chrome&&se.android?s.observer.flushSoon():s.inputState.compositionPendingChange?Promise.resolve().then(()=>s.observer.flush()):setTimeout(()=>{s.inputState.composing<0&&s.docView.hasComposition&&s.update([])},50)};Kt.contextmenu=s=>{s.inputState.lastContextMenu=Date.now()};Ut.beforeinput=(s,e)=>{var t;let n;if(se.chrome&&se.android&&(n=Yu.find(i=>i.inputType==e.inputType))&&(s.observer.delayAndroidKey(n.key,n.keyCode),n.key=="Backspace"||n.key=="Delete")){let i=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>i+10&&s.hasFocus&&(s.contentDOM.blur(),s.focus())},100)}return!1};const bh=new Set;function zg(s){bh.has(s)||(bh.add(s),s.addEventListener("copy",()=>{}),s.addEventListener("cut",()=>{}))}const _h=["pre-wrap","normal","pre-line","break-spaces"];class jg{constructor(e){this.lineWrapping=e,this.doc=De.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}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 _h.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.textHeight=i,this.lineLength=r,a){this.heightSamples={};for(let h=0;h0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>sr&&(e.heightChanged=!0),this.height=t)}replace(e,t,n){return bt.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,i){let r=this,l=n.doc;for(let o=i.length-1;o>=0;o--){let{fromA:a,toA:h,fromB:c,toB:f}=i[o],u=r.lineAt(a,ze.ByPosNoHeight,n.setDoc(t),0,0),d=u.to>=h?u:r.lineAt(h,ze.ByPosNoHeight,n,0,0);for(f+=d.to-h,h=d.to;o>0&&u.from<=i[o-1].toA;)a=i[o-1].fromA,c=i[o-1].fromB,o--,ar*2){let o=e[t-1];o.break?e.splice(--t,1,o.left,null,o.right):e.splice(--t,1,o.left,o.right),n+=1+o.break,i-=o.size}else if(r>i*2){let o=e[n];o.break?e.splice(n,1,o.left,null,o.right):e.splice(n,1,o.left,o.right),n+=2+o.break,r-=o.size}else break;else if(i=r&&l(this.blockAt(0,n,i,r))}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more&&this.setHeight(e,i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ct extends rd{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,i){return new hn(i,this.length,n,this.height,this.breaks)}replace(e,t,n){let i=n[0];return n.length==1&&(i instanceof Ct||i instanceof nt&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof nt?i=new Ct(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):bt.of(n)}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more?this.setHeight(e,i.heights[i.index++]):(n||this.outdated)&&this.setHeight(e,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 nt extends bt{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,i=e.doc.lineAt(t+this.length).number,r=i-n+1,l,o=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);l=a/r,this.length>r+1&&(o=(this.height-a)/(this.length-r-1))}else l=this.height/r;return{firstLine:n,lastLine:i,perLine:l,perChar:o}}blockAt(e,t,n,i){let{firstLine:r,lastLine:l,perLine:o,perChar:a}=this.heightMetrics(t,i);if(t.lineWrapping){let h=i+Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length),c=t.doc.lineAt(h),f=o+c.length*a,u=Math.max(n,e-f/2);return new hn(c.from,c.length,u,f,0)}else{let h=Math.max(0,Math.min(l-r,Math.floor((e-n)/o))),{from:c,length:f}=t.doc.line(r+h);return new hn(c,f,n+o*h,o,0)}}lineAt(e,t,n,i,r){if(t==ze.ByHeight)return this.blockAt(e,n,i,r);if(t==ze.ByPosNoHeight){let{from:d,to:p}=n.doc.lineAt(e);return new hn(d,p-d,0,0,0)}let{firstLine:l,perLine:o,perChar:a}=this.heightMetrics(n,r),h=n.doc.lineAt(e),c=o+h.length*a,f=h.number-l,u=i+o*f+a*(h.from-r-f);return new hn(h.from,h.length,Math.max(i,Math.min(u,i+this.height-c)),c,0)}forEachLine(e,t,n,i,r,l){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:o,perLine:a,perChar:h}=this.heightMetrics(n,r);for(let c=e,f=i;c<=t;){let u=n.doc.lineAt(c);if(c==e){let p=u.number-o;f+=a*p+h*(e-r-p)}let d=a+h*u.length;l(new hn(u.from,u.length,f,d,0)),f+=d,c=u.to+1}}replace(e,t,n){let i=this.length-t;if(i>0){let r=n[n.length-1];r instanceof nt?n[n.length-1]=new nt(r.length+i):n.push(null,new nt(i-1))}if(e>0){let r=n[0];r instanceof nt?n[0]=new nt(e+r.length):n.unshift(new nt(e-1),null)}return bt.of(n)}decomposeLeft(e,t){t.push(new nt(e-1),null)}decomposeRight(e,t){t.push(null,new nt(this.length-e-1))}updateHeight(e,t=0,n=!1,i){let r=t+this.length;if(i&&i.from<=t+this.length&&i.more){let l=[],o=Math.max(t,i.from),a=-1;for(i.from>t&&l.push(new nt(i.from-t-1).updateHeight(e,t));o<=r&&i.more;){let c=e.doc.lineAt(o).length;l.length&&l.push(null);let f=i.heights[i.index++];a==-1?a=f:Math.abs(f-a)>=sr&&(a=-2);let u=new Ct(c,f);u.outdated=!1,l.push(u),o+=c+1}o<=r&&l.push(null,new nt(r-o).updateHeight(e,o));let h=bt.of(l);return(a<0||Math.abs(h.height-this.height)>=sr||Math.abs(a-this.heightMetrics(e,t).perLine)>=sr)&&(e.heightChanged=!0),h}else(n||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Hg extends bt{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,i){let r=n+this.left.height;return eo))return h;let c=t==ze.ByPosNoHeight?ze.ByPosNoHeight:ze.ByPos;return a?h.join(this.right.lineAt(o,c,n,l,o)):this.left.lineAt(o,c,n,i,r).join(h)}forEachLine(e,t,n,i,r,l){let o=i+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,n,o,a,l);else{let h=this.lineAt(a,ze.ByPos,n,i,r);e=e&&h.from<=t&&l(h),t>h.to&&this.right.forEachLine(h.to+1,t,n,o,a,l)}}replace(e,t,n){let i=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-i,t-i,n));let r=[];e>0&&this.decomposeLeft(e,r);let l=r.length;for(let o of n)r.push(o);if(e>0&&kh(r,l-1),t=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,i=n+this.break;if(e>=i)return this.right.decomposeRight(e-i,t);e2*t.size||t.size>2*e.size?bt.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=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,n=!1,i){let{left:r,right:l}=this,o=t+r.length+this.break,a=null;return i&&i.from<=t+r.length&&i.more?a=r=r.updateHeight(e,t,n,i):r.updateHeight(e,t,n),i&&i.from<=o+l.length&&i.more?a=l=l.updateHeight(e,o,n,i):l.updateHeight(e,o,n),a?this.balanced(r,l):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function kh(s,e){let t,n;s[e]==null&&(t=s[e-1])instanceof nt&&(n=s[e+1])instanceof nt&&s.splice(e-1,3,new nt(t.length+1+n.length))}const Fg=5;class Vo{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 n=Math.min(t,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Ct?i.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new Ct(n-this.pos,-1)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e=Fg)&&this.addLineDeco(i,r,l)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new Ct(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new nt(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ct)return e;let t=new Ct(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,n){let i=this.ensureLine();i.length+=n,i.collapsed+=n,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Ct)&&!this.isCovered?this.nodes.push(new Ct(0,-1)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let u=c.getBoundingClientRect();r=Math.max(r,u.left),l=Math.min(l,u.right),o=Math.max(o,u.top),a=h==s.parentNode?u.bottom:Math.min(a,u.bottom)}h=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:r-t.left,right:Math.max(r,l)-t.left,top:o-(t.top+e),bottom:Math.max(o,a)-(t.top+e)}}function Kg(s,e){let t=s.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class bl{constructor(e,t,n){this.from=e,this.to=t,this.size=n}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;ntypeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new jg(t),this.stateDeco=e.facet(ps).filter(n=>typeof n!="function"),this.heightMap=bt.empty().applyChanges(this.stateDeco,De.empty,this.heightOracle.setDoc(e.doc),[new It(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Be.set(this.lineGaps.map(n=>n.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let i=n?t.head:t.anchor;if(!e.some(({from:r,to:l})=>i>=r&&i<=l)){let{from:r,to:l}=this.lineBlockAt(i);e.push(new js(r,l))}}this.viewports=e.sort((n,i)=>n.from-i.from),this.scaler=this.heightMap.height<=7e6?yh:new Xg(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:Zi(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(ps).filter(c=>typeof c!="function");let i=e.changedRanges,r=It.extendWithRanges(i,Wg(n,this.stateDeco,e?e.changes:Ge.empty(this.state.doc.length))),l=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=l&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let h=!e.changes.empty||e.flags&2||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),h&&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(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Vu)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),i=this.heightOracle,r=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?He.RTL:He.LTR;let l=this.heightOracle.mustRefreshForWrapping(r),o=t.getBoundingClientRect(),a=l||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let h=0,c=0;if(o.width&&o.height){let{scaleX:M,scaleY:B}=gu(t,o);(this.scaleX!=M||this.scaleY!=B)&&(this.scaleX=M,this.scaleY=B,h|=8,l=a=!0)}let f=(parseInt(n.paddingTop)||0)*this.scaleY,u=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,h|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=8);let d=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=ku(e.scrollDOM);let p=(this.printing?Kg:Ug)(t,this.paddingTop),m=p.top-this.pixelViewport.top,g=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let b=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(b!=this.inView&&(this.inView=b,b&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let v=o.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,h|=8),a){let M=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(M)&&(l=!0),l||i.lineWrapping&&Math.abs(v-this.contentDOMWidth)>i.charWidth){let{lineHeight:B,charWidth:N,textHeight:E}=e.docView.measureTextSize();l=B>0&&i.refresh(r,B,N,E,v/N,M),l&&(e.docView.minWidth=0,h|=8)}m>0&&g>0?c=Math.max(m,g):m<0&&g<0&&(c=Math.min(m,g)),i.heightChanged=!1;for(let B of this.viewports){let N=B.from==this.viewport.from?M:e.docView.measureVisibleLineHeights(B);this.heightMap=(l?bt.empty().applyChanges(this.stateDeco,De.empty,this.heightOracle,[new It(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,l,new Vg(B.from,N))}i.heightChanged&&(h|=2)}let O=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return O&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(h&2||O)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,r=this.heightOracle,{visibleTop:l,visibleBottom:o}=this,a=new js(i.lineAt(l-n*1e3,ze.ByHeight,r,0,0).from,i.lineAt(o+(1-n)*1e3,ze.ByHeight,r,0,0).to);if(t){let{head:h}=t.range;if(ha.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(h,ze.ByPos,r,0,0),u;t.y=="center"?u=(f.top+f.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&h=o+Math.max(10,Math.min(n,250)))&&i>l-2*1e3&&r>1,l=i<<1;if(this.defaultTextDirection!=He.LTR&&!n)return[];let o=[],a=(h,c,f,u)=>{if(c-hh&&gg.from>=f.from&&g.to<=f.to&&Math.abs(g.from-h)g.fromb));if(!m){if(cg.from<=c&&g.to>=c)){let g=t.moveToLineBoundary(q.cursor(c),!1,!0).head;g>h&&(c=g)}m=new bl(h,c,this.gapSize(f,h,c,u))}o.push(m)};for(let h of this.viewportLines){if(h.lengthh.from&&a(h.from,u,h,c),dt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];Ee.spans(e,this.viewport.from,this.viewport.to,{span(i,r){t.push({from:i,to:r})},point(){}},20);let n=t.length!=this.visibleRanges.length||this.visibleRanges.some((i,r)=>i.from!=t[r].from||i.to!=t[r].to);return this.visibleRanges=t,n?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Zi(this.heightMap.lineAt(e,ze.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return Zi(this.heightMap.lineAt(this.scaler.fromDOM(e),ze.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 Zi(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 js{constructor(e,t){this.from=e,this.to=t}}function Gg(s,e,t){let n=[],i=s,r=0;return Ee.spans(t,s,e,{span(){},point(l,o){l>i&&(n.push({from:i,to:l}),r+=l-i),i=o}},20),i=1)return e[e.length-1].to;let n=Math.floor(s*t);for(let i=0;;i++){let{from:r,to:l}=e[i],o=l-r;if(n<=o)return r+n;n-=o}}function Hs(s,e){let t=0;for(let{from:n,to:i}of s.ranges){if(e<=i){t+=e-n;break}t+=i-n}return t/s.total}function Yg(s,e){for(let t of s)if(e(t))return t}const yh={toDOM(s){return s},fromDOM(s){return s},scale:1};class Xg{constructor(e,t,n){let i=0,r=0,l=0;this.viewports=n.map(({from:o,to:a})=>{let h=t.lineAt(o,ze.ByPos,e,0,0).top,c=t.lineAt(a,ze.ByPos,e,0,0).bottom;return i+=c-h,{from:o,to:a,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(t.height-i);for(let o of this.viewports)o.domTop=l+(o.top-r)*this.scale,l=o.domBottom=o.domTop+(o.bottom-o.top),r=o.bottom}toDOM(e){for(let t=0,n=0,i=0;;t++){let r=tZi(i,e)):s._content)}const Fs=le.define({combine:s=>s.join(" ")}),lo=le.define({combine:s=>s.indexOf(!0)>-1}),oo=qn.newName(),ld=qn.newName(),od=qn.newName(),ad={"&light":"."+ld,"&dark":"."+od};function ao(s,e,t){return new qn(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,i=>{if(i=="&")return s;if(!t||!t[i])throw new RangeError(`Unsupported selector: ${i}`);return t[i]}):s+" "+n}})}const Zg=ao("."+oo,{"&":{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},".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:"#444"},".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},"&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"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,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"}},ad),Qi="￿";class Qg{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(ye.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Qi}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let i=e;;){this.findPointBefore(n,i);let r=this.text.length;this.readNode(i);let l=i.nextSibling;if(l==t)break;let o=je.get(i),a=je.get(l);(o&&a?o.breakAfter:(o?o.breakAfter:wh(i))||wh(l)&&(i.nodeName!="BR"||i.cmIgnore)&&this.text.length>r)&&this.lineBreak(),i=l}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,l=1,o;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,n),l=this.lineSeparator.length):(o=i.exec(t))&&(r=o.index,l=o[0].length),this.append(t.slice(n,r<0?t.length:r)),r<0)break;if(this.lineBreak(),l>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=l-1);n=r+l}}readNode(e){if(e.cmIgnore)return;let t=je.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let i=n.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 n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(e0(e,n.node,n.offset)?t:0))}}function e0(s,e,t){for(;;){if(!e||t-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let o=r||l?[]:s0(e),a=new Qg(o,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=r0(o,this.bounds.from)}else{let o=e.observer.selectionRange,a=r&&r.node==o.focusNode&&r.offset==o.focusOffset||!Ul(e.contentDOM,o.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(o.focusNode,o.focusOffset),h=l&&l.node==o.anchorNode&&l.offset==o.anchorOffset||!Ul(e.contentDOM,o.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(o.anchorNode,o.anchorOffset),c=e.viewport;if((se.ios||se.chrome)&&e.state.selection.main.empty&&a!=h&&(c.from>0||c.toDate.now()-100?s.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:o}=e.bounds,a=i.from,h=null;(r===8||se.android&&e.text.length=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:s.state.doc.slice(i.from,t.from).append(t.insert).append(s.state.doc.slice(t.to,i.to))}:(se.mac||se.android)&&t&&t.from==t.to&&t.from==i.head-1&&/^\. ?$/.test(t.insert.toString())&&s.contentDOM.getAttribute("autocorrect")=="off"?(n&&t.insert.length==2&&(n=q.single(n.main.anchor-1,n.main.head-1)),t={from:i.from,to:i.to,insert:De.of([" "])}):se.chrome&&t&&t.from==t.to&&t.from==i.head&&t.insert.toString()==` `&&s.lineWrapping&&(n&&(n=q.single(n.main.anchor-1,n.main.head-1)),t={from:i.from,to:i.to,insert:De.of([" "])}),t){if(se.ios&&s.inputState.flushIOSKey()||se.android&&(t.from==i.from&&t.to==i.to&&t.insert.length==1&&t.insert.lines==2&&Ci(s.contentDOM,"Enter",13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.lengthi.head)&&Ci(s.contentDOM,"Backspace",8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&Ci(s.contentDOM,"Delete",46)))return!0;let l=t.insert.toString();s.inputState.composing>=0&&s.inputState.composing++;let o,a=()=>o||(o=n0(s,t,n));return s.state.facet(Iu).some(h=>h(s,t.from,t.to,l,a))||s.dispatch(a()),!0}else if(n&&!n.main.eq(i)){let l=!1,o="select";return s.inputState.lastSelectionTime>Date.now()-50&&(s.inputState.lastSelectionOrigin=="select"&&(l=!0),o=s.inputState.lastSelectionOrigin),s.dispatch({selection:n,scrollIntoView:l,userEvent:o}),!0}else return!1}function n0(s,e,t){let n,i=s.state,r=i.selection.main;if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&s.inputState.composing<0){let o=r.frome.to?i.sliceDoc(e.to,r.to):"";n=i.replaceSelection(s.state.toText(o+e.insert.sliceString(0,void 0,s.state.lineBreak)+a))}else{let o=i.changes(e),a=t&&t.main.to<=o.newLength?t.main:void 0;if(i.selection.ranges.length>1&&s.inputState.composing>=0&&e.to<=r.to&&e.to>=r.to-10){let h=s.state.sliceDoc(e.from,e.to),c,f=t&&Ku(s,t.main.head);if(f){let p=e.insert.length-(e.to-e.from);c={from:f.from,to:f.to-p}}else c=s.state.doc.lineAt(r.head);let u=r.to-e.to,d=r.to-r.from;n=i.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:o,range:a||p.map(o)};let m=p.to-u,g=m-h.length;if(p.to-p.from!=d||s.state.sliceDoc(g,m)!=h||p.to>=c.from&&p.from<=c.to)return{range:p};let b=i.changes({from:g,to:m,insert:e.insert}),v=p.to-r.to;return{changes:b,range:a?q.range(Math.max(0,a.anchor+v),Math.max(0,a.head+v)):p.map(b)}})}else n={changes:o,selection:a&&i.selection.replaceRange(a)}}let l="input.type";return(s.composing||s.inputState.compositionPendingChange&&s.inputState.compositionEndedAt>Date.now()-50)&&(s.inputState.compositionPendingChange=!1,l+=".compose",s.inputState.compositionFirstChange&&(l+=".start",s.inputState.compositionFirstChange=!1)),i.update(n,{userEvent:l,scrollIntoView:!0})}function i0(s,e,t,n){let i=Math.min(s.length,e.length),r=0;for(;r0&&o>0&&s.charCodeAt(l-1)==e.charCodeAt(o-1);)l--,o--;if(n=="end"){let a=Math.max(0,r-Math.min(l,o));t-=l+a-r}if(l=l?r-t:0;r-=a,o=r+(o-l),l=r}else if(o=o?r-t:0;r-=a,l=r+(l-o),o=r}return{from:r,toA:l,toB:o}}function s0(s){let e=[];if(s.root.activeElement!=s.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:i,focusOffset:r}=s.observer.selectionRange;return t&&(e.push(new Sh(t,n)),(i!=t||r!=n)&&e.push(new Sh(i,r))),e}function r0(s,e){if(s.length==0)return null;let t=s[0].pos,n=s.length==2?s[1].pos:t;return t>-1&&n>-1?q.single(t+e,n+e):null}const l0={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},_l=se.ie&&se.ie_version<=11;class o0{constructor(e){this.view=e,this.active=!1,this.selectionRange=new Wm,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.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let n of t)this.queue.push(n);(se.ie&&se.ie_version<=11||se.ios&&e.composing)&&t.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),_l&&(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),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){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.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){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,n)=>t!=e[n]))){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:n}=this,i=this.selectionRange;if(n.state.facet($r)?n.root.activeElement!=this.dom:!nr(n.dom,i))return;let r=i.anchorNode&&n.docView.nearest(i.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(se.ie&&se.ie_version<=11||se.android&&se.chrome)&&!n.state.selection.main.empty&&i.focusNode&&ss(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=se.safari&&e.root.nodeType==11&&jm(this.dom.ownerDocument)==this.dom&&a0(this.view)||dr(e.root);if(!t||this.selectionRange.eq(t))return!1;let n=nr(this.dom,t);return n&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&Ci(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{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,n=-1,i=!1;for(let r of e){let l=this.readMutation(r);l&&(l.typeOver&&(i=!0),t==-1?{from:t,to:n}=l:(t=Math.min(l.from,t),n=Math.max(l.to,n)))}return{from:t,to:n,typeOver:i}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),i=this.selectionChanged&&nr(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 r=new t0(this.view,e,t,n);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}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 n=this.view.state,i=hd(this.view,t);return this.view.state==n&&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 n=xh(t,e.previousSibling||e.target.previousSibling,-1),i=xh(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):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),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),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.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)}}function xh(s,e,t){for(;e;){let n=je.get(e);if(n&&n.parent==s)return n;let i=e.parentNode;e=i!=s.dom?i:t>0?e.nextSibling:e.previousSibling}return null}function a0(s){let e=null;function t(a){a.preventDefault(),a.stopImmediatePropagation(),e=a.getTargetRanges()[0]}if(s.contentDOM.addEventListener("beforeinput",t,!0),s.dom.ownerDocument.execCommand("indent"),s.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let n=e.startContainer,i=e.startOffset,r=e.endContainer,l=e.endOffset,o=s.docView.domAtPos(s.state.selection.main.anchor);return ss(o.node,o.offset,r,l)&&([n,i,r,l]=[r,l,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:l}}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.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){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:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(n=>n.forEach(i=>t(i,this)))||(n=>this.update(n)),this.dispatch=this.dispatch.bind(this),this._root=e.root||qm(e.parent)||document,this.viewState=new vh(e.state||ye.create(e)),e.scrollTo&&e.scrollTo.is(Rs)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Yi).map(n=>new pl(n));for(let n of this.plugins)n.update(this);this.observer=new o0(this),this.inputState=new Sg(this),this.inputState.ensureHandlers(this.plugins),this.docView=new nh(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let t=e.length==1&&e[0]instanceof Xe?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,n=!1,i,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let l=this.hasFocus,o=0,a=null;e.some(u=>u.annotation(nd))?(this.inputState.notifiedFocused=l,o=1):l!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=l,a=id(r,l),a||(o=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(ye.phrases)!=this.state.facet(ye.phrases))return this.setState(r);i=pr.create(this,r,e),i.flags|=o;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new Mi(d.empty?d:q.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is(Rs)&&(f=d.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=mr.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),t=this.docView.update(i),this.state.facet(Xi)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(Fs)!=i.state.facet(Fs)&&(this.viewState.mustMeasureContent=!0),(t||n||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!i.empty)for(let u of this.state.facet(no))try{u(i)}catch(d){An(this.state,d,"update listener")}(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!hd(this,c)&&h.force&&Ci(this.contentDOM,h.key,h.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 n of this.plugins)n.destroy(this);this.viewState=new vh(e),this.plugins=e.facet(Yi).map(n=>new pl(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new nh(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(Yi),n=e.state.facet(Yi);if(t!=n){let i=[];for(let r of n){let l=t.indexOf(r);if(l<0)i.push(new pl(r));else{let o=this.plugins[l];o.mustUpdate=e,i.push(o)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i-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,n=this.scrollDOM,i=n.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:l}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(l=-1),this.viewState.scrollAnchorHeight=-1;try{for(let o=0;;o++){if(l<0)if(ku(n))r=-1,l=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(i);r=d.from,l=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(o>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];a&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(d=>{try{return d.read(this)}catch(p){return An(this.state,p),Ah}}),f=pr.create(this,this.state,[]),u=!1;f.flags|=a,t?t.flags|=a:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f));for(let d=0;d1||p<-1){i=i+p,n.scrollTop=i/this.scaleY,l=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let o of this.state.facet(no))o(t)}get themeClasses(){return oo+" "+(this.state.facet(lo)?od:ld)+" "+this.state.facet(Fs)}updateAttrs(){let e=Ch(this,Hu,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet($r)?"true":"false",class:"cm-content",style:`${se.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Ch(this,zo,t);let n=this.observer.ignore(()=>{let i=Xl(this.contentDOM,this.contentAttrs,t),r=Xl(this.dom,this.editorAttrs,e);return i||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let i of n.effects)if(i.is(ae.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Xi);let e=this.state.facet(ae.cspNonce);qn.mount(this.root,this.styleModules.concat(Zg).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;tn.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,n){return gl(this,e,ah(this,e,t,n))}moveByGroup(e,t){return gl(this,e,ah(this,e,t,n=>yg(this,e.head,n)))}visualLineSide(e,t){let n=this.bidiSpans(e),i=this.textDirectionAt(e.from),r=n[t?n.length-1:0];return q.cursor(r.side(t,i)+e.from,r.forward(!t,i)?1:-1)}moveToLineBoundary(e,t,n=!0){return vg(this,e,t,n)}moveVertically(e,t,n){return gl(this,e,wg(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),Gu(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let i=this.state.doc.lineAt(e),r=this.bidiSpans(i),l=r[Hn.find(r,e-i.from,-1,t)];return Lo(n,l.dir==He.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(ju)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>h0)return Pu(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||Du(r.isolates,n=th(this,e))))return r.order;n||(n=th(this,e));let i=sg(e.text,t,n);return this.bidiCache.push(new mr(e.from,e.to,t,n,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||se.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{bu(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(){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 Rs.of(new Mi(typeof e=="number"?q.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return Rs.of(new Mi(q.cursor(n.from),"start","start",n.top-e,t,!0))}static domEventHandlers(e){return rt.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return rt.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=qn.newName(),i=[Fs.of(n),Xi.of(ao(`.${n}`,e))];return t&&t.dark&&i.push(lo.of(!0)),i}static baseTheme(e){return Br.lowest(Xi.of(ao("."+oo,e,ad)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),i=n&&je.get(n)||je.get(e);return((t=i==null?void 0:i.rootView)===null||t===void 0?void 0:t.view)||null}}ae.styleModule=Xi;ae.inputHandler=Iu;ae.focusChangeEffect=zu;ae.perLineTextDirection=ju;ae.exceptionSink=Ru;ae.updateListener=no;ae.editable=$r;ae.mouseSelectionStyle=$u;ae.dragMovesSelection=Lu;ae.clickAddsSelectionRange=Bu;ae.decorations=ps;ae.outerDecorations=Fu;ae.atomicRanges=jo;ae.bidiIsolatedRanges=Wu;ae.scrollMargins=qu;ae.darkTheme=lo;ae.cspNonce=le.define({combine:s=>s.length?s[0]:""});ae.contentAttributes=zo;ae.editorAttributes=Hu;ae.lineWrapping=ae.contentAttributes.of({class:"cm-lineWrapping"});ae.announce=Ne.define();const h0=4096,Ah={};class mr{constructor(e,t,n,i,r,l){this.from=e,this.to=t,this.dir=n,this.isolates=i,this.fresh=r,this.order=l}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let n=[],i=e.length?e[e.length-1].dir:He.LTR;for(let r=Math.max(0,e.length-10);r=0;i--){let r=n[i],l=typeof r=="function"?r(s):r;l&&Yl(l,t)}return t}const c0=se.mac?"mac":se.windows?"win":se.linux?"linux":"key";function f0(s,e){const t=s.split(/-(?!$)/);let n=t[t.length-1];n=="Space"&&(n=" ");let i,r,l,o;for(let a=0;an.concat(i),[]))),t}function hS(s,e,t){return ud(fd(s.state),e,s,t)}let zn=null;const d0=4e3;function p0(s,e=c0){let t=Object.create(null),n=Object.create(null),i=(l,o)=>{let a=n[l];if(a==null)n[l]=o;else if(a!=o)throw new Error("Key binding "+l+" is used both as a regular binding and as a multi-stroke prefix")},r=(l,o,a,h,c)=>{var f,u;let d=t[l]||(t[l]=Object.create(null)),p=o.split(/ (?!$)/).map(b=>f0(b,e));for(let b=1;b{let M=zn={view:O,prefix:v,scope:l};return setTimeout(()=>{zn==M&&(zn=null)},d0),!0}]})}let m=p.join(" ");i(m,!1);let g=d[m]||(d[m]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&g.run.push(a),h&&(g.preventDefault=!0),c&&(g.stopPropagation=!0)};for(let l of s){let o=l.scope?l.scope.split(" "):["editor"];if(l.any)for(let h of o){let c=t[h]||(t[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let f in c)c[f].run.push(l.any)}let a=l[e]||l.key;if(a)for(let h of o)r(h,a,l.run,l.preventDefault,l.stopPropagation),l.shift&&r(h,"Shift-"+a,l.shift,l.preventDefault,l.stopPropagation)}return t}function ud(s,e,t,n){let i=zm(e),r=ns(i,0),l=Dl(r)==i.length&&i!=" ",o="",a=!1,h=!1,c=!1;zn&&zn.view==t&&zn.scope==n&&(o=zn.prefix+" ",Xu.indexOf(e.keyCode)<0&&(h=!0,zn=null));let f=new Set,u=g=>{if(g){for(let b of g.run)if(!f.has(b)&&(f.add(b),b(t,e)))return g.stopPropagation&&(c=!0),!0;g.preventDefault&&(g.stopPropagation&&(c=!0),h=!0)}return!1},d=s[n],p,m;return d&&(u(d[o+Ws(i,e,!l)])?a=!0:l&&(e.altKey||e.metaKey||e.ctrlKey)&&!(se.windows&&e.ctrlKey&&e.altKey)&&(p=Un[e.keyCode])&&p!=i?(u(d[o+Ws(p,e,!0)])||e.shiftKey&&(m=fs[e.keyCode])!=i&&m!=p&&u(d[o+Ws(m,e,!1)]))&&(a=!0):l&&e.shiftKey&&u(d[o+Ws(i,e,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),h&&(a=!0),a&&c&&e.stopPropagation(),a}class As{constructor(e,t,n,i,r){this.className=e,this.left=t,this.top=n,this.width=i,this.height=r}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,n){if(n.empty){let i=e.coordsAtPos(n.head,n.assoc||1);if(!i)return[];let r=dd(e);return[new As(t,i.left-r.left,i.top-r.top,null,i.bottom-i.top)]}else return m0(e,t,n)}}function dd(s){let e=s.scrollDOM.getBoundingClientRect();return{left:(s.textDirection==He.LTR?e.left:e.right-s.scrollDOM.clientWidth*s.scaleX)-s.scrollDOM.scrollLeft*s.scaleX,top:e.top-s.scrollDOM.scrollTop*s.scaleY}}function Th(s,e,t){let n=q.cursor(e);return{from:Math.max(t.from,s.moveToLineBoundary(n,!1,!0).from),to:Math.min(t.to,s.moveToLineBoundary(n,!0,!0).from),type:gt.Text}}function m0(s,e,t){if(t.to<=s.viewport.from||t.from>=s.viewport.to)return[];let n=Math.max(t.from,s.viewport.from),i=Math.min(t.to,s.viewport.to),r=s.textDirection==He.LTR,l=s.contentDOM,o=l.getBoundingClientRect(),a=dd(s),h=l.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),f=o.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),u=o.right-(c?parseInt(c.paddingRight):0),d=so(s,n),p=so(s,i),m=d.type==gt.Text?d:null,g=p.type==gt.Text?p:null;if(m&&(s.lineWrapping||d.widgetLineBreaks)&&(m=Th(s,n,m)),g&&(s.lineWrapping||p.widgetLineBreaks)&&(g=Th(s,i,g)),m&&g&&m.from==g.from)return v(O(t.from,t.to,m));{let B=m?O(t.from,null,m):M(d,!1),N=g?O(null,t.to,g):M(p,!0),E=[];return(m||d).to<(g||p).from-(m&&g?1:0)||d.widgetLineBreaks>1&&B.bottom+s.defaultLineHeight/2D&&W.from=Y)break;ge>ne&&R(Math.max(fe,ne),B==null&&fe<=D,Math.min(ge,Y),N==null&&ge>=C,j.dir)}if(ne=he.to+1,ne>=Y)break}return F.length==0&&R(D,B==null,C,N==null,s.textDirection),{top:V,bottom:$,horizontal:F}}function M(B,N){let E=o.top+(N?B.top:B.bottom);return{top:E,bottom:E,horizontal:[]}}}function g0(s,e){return s.constructor==e.constructor&&s.eq(e)}class b0{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(rr)!=e.state.facet(rr)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}setOrder(e){let t=0,n=e.facet(rr);for(;t!g0(t,this.drawn[n]))){let t=this.dom.firstChild,n=0;for(let i of e)i.update&&t&&i.constructor&&this.drawn[n].constructor&&i.update(t,this.drawn[n])?(t=t.nextSibling,n++):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 rr=le.define();function pd(s){return[rt.define(e=>new b0(e,s)),rr.of(s)]}const md=!se.ios,ms=le.define({combine(s){return Pi(s,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function cS(s={}){return[ms.of(s),_0,k0,v0,Vu.of(!0)]}function gd(s){return s.startState.facet(ms)!=s.state.facet(ms)}const _0=pd({above:!0,markers(s){let{state:e}=s,t=e.facet(ms),n=[];for(let i of e.selection.ranges){let r=i==e.selection.main;if(i.empty?!r||md:t.drawRangeCursor){let l=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",o=i.empty?i:q.cursor(i.head,i.head>i.anchor?-1:1);for(let a of As.forRange(s,l,o))n.push(a)}}return n},update(s,e){s.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=gd(s);return t&&Eh(s.state,e),s.docChanged||s.selectionSet||t},mount(s,e){Eh(e.state,s)},class:"cm-cursorLayer"});function Eh(s,e){e.style.animationDuration=s.facet(ms).cursorBlinkRate+"ms"}const k0=pd({above:!1,markers(s){return s.state.selection.ranges.map(e=>e.empty?[]:As.forRange(s,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(s,e){return s.docChanged||s.selectionSet||s.viewportChanged||gd(s)},class:"cm-selectionLayer"}),ho={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};md&&(ho[".cm-line"].caretColor="transparent !important",ho[".cm-content"]={caretColor:"transparent !important"});const v0=Br.highest(ae.theme(ho)),bd=Ne.define({map(s,e){return s==null?null:e.mapPos(s)}}),es=Nt.define({create(){return null},update(s,e){return s!=null&&(s=e.changes.mapPos(s)),e.effects.reduce((t,n)=>n.is(bd)?n.value:t,s)}}),y0=rt.fromClass(class{constructor(s){this.view=s,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(s){var e;let t=s.state.field(es);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"),(s.startState.field(es)!=t||s.docChanged||s.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:s}=this,e=s.state.field(es),t=e!=null&&s.coordsAtPos(e);if(!t)return null;let n=s.scrollDOM.getBoundingClientRect();return{left:t.left-n.left+s.scrollDOM.scrollLeft*s.scaleX,top:t.top-n.top+s.scrollDOM.scrollTop*s.scaleY,height:t.bottom-t.top}}drawCursor(s){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;s?(this.cursor.style.left=s.left/e+"px",this.cursor.style.top=s.top/t+"px",this.cursor.style.height=s.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(s){this.view.state.field(es)!=s&&this.view.dispatch({effects:bd.of(s)})}},{eventObservers:{dragover(s){this.setDropPos(this.view.posAtCoords({x:s.clientX,y:s.clientY}))},dragleave(s){(s.target==this.view.contentDOM||!this.view.contentDOM.contains(s.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function fS(){return[es,y0]}function Oh(s,e,t,n,i){e.lastIndex=0;for(let r=s.iterRange(t,n),l=t,o;!r.next().done;l+=r.value.length)if(!r.lineBreak)for(;o=e.exec(r.value);)i(l+o.index,o)}function w0(s,e){let t=s.visibleRanges;if(t.length==1&&t[0].from==s.viewport.from&&t[0].to==s.viewport.to)return t;let n=[];for(let{from:i,to:r}of t)i=Math.max(s.state.doc.lineAt(i).from,i-e),r=Math.min(s.state.doc.lineAt(r).to,r+e),n.length&&n[n.length-1].to>=i?n[n.length-1].to=r:n.push({from:i,to:r});return n}class S0{constructor(e){const{regexp:t,decoration:n,decorate:i,boundary:r,maxLength:l=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=(o,a,h,c)=>i(c,h,h+o[0].length,o,a);else if(typeof n=="function")this.addMatch=(o,a,h,c)=>{let f=n(o,a,h);f&&c(h,h+o[0].length,f)};else if(n)this.addMatch=(o,a,h,c)=>c(h,h+o[0].length,n);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=l}createDeco(e){let t=new ai,n=t.add.bind(t);for(let{from:i,to:r}of w0(e,this.maxLength))Oh(e.state.doc,this.regexp,i,r,(l,o)=>this.addMatch(o,e,l,n));return t.finish()}updateDeco(e,t){let n=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((r,l,o,a)=>{a>e.view.viewport.from&&o1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,t.map(e.changes),n,i):t}updateRange(e,t,n,i){for(let r of e.visibleRanges){let l=Math.max(r.from,n),o=Math.min(r.to,i);if(o>l){let a=e.state.doc.lineAt(l),h=a.toa.from;l--)if(this.boundary.test(a.text[l-1-a.from])){c=l;break}for(;ou.push(b.range(m,g));if(a==h)for(this.regexp.lastIndex=c-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(g,e,m,p));t=t.update({filterFrom:c,filterTo:f,filter:(m,g)=>mf,add:u})}}return t}}const co=/x/.unicode!=null?"gu":"g",x0=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,co),A0={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 kl=null;function C0(){var s;if(kl==null&&typeof document<"u"&&document.body){let e=document.body.style;kl=((s=e.tabSize)!==null&&s!==void 0?s:e.MozTabSize)!=null}return kl||!1}const lr=le.define({combine(s){let e=Pi(s,{render:null,specialChars:x0,addSpecialChars:null});return(e.replaceTabs=!C0())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,co)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,co)),e}});function uS(s={}){return[lr.of(s),M0()]}let Dh=null;function M0(){return Dh||(Dh=rt.fromClass(class{constructor(s){this.view=s,this.decorations=Be.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(s.state.facet(lr)),this.decorations=this.decorator.createDeco(s)}makeDecorator(s){return new S0({regexp:s.specialChars,decoration:(e,t,n)=>{let{doc:i}=t.state,r=ns(e[0],0);if(r==9){let l=i.lineAt(n),o=t.state.tabSize,a=Ni(l.text,o,n-l.from);return Be.replace({widget:new D0((o-a%o)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=Be.replace({widget:new O0(s,r)}))},boundary:s.replaceTabs?void 0:/[^]/})}update(s){let e=s.state.facet(lr);s.startState.facet(lr)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(s.view)):this.decorations=this.decorator.updateDeco(s,this.decorations)}},{decorations:s=>s.decorations}))}const T0="•";function E0(s){return s>=32?T0:s==10?"␤":String.fromCharCode(9216+s)}class O0 extends pi{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=E0(this.code),n=e.state.phrase("Control character")+" "+(A0[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,n,t);if(i)return i;let r=document.createElement("span");return r.textContent=t,r.title=n,r.setAttribute("aria-label",n),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class D0 extends pi{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 dS(){return N0}const P0=Be.line({class:"cm-activeLine"}),N0=rt.fromClass(class{constructor(s){this.decorations=this.getDeco(s)}update(s){(s.docChanged||s.selectionSet)&&(this.decorations=this.getDeco(s.view))}getDeco(s){let e=-1,t=[];for(let n of s.state.selection.ranges){let i=s.lineBlockAt(n.head);i.from>e&&(t.push(P0.range(i.from)),e=i.from)}return Be.set(t)}},{decorations:s=>s.decorations}),fo=2e3;function B0(s,e,t){let n=Math.min(e.line,t.line),i=Math.max(e.line,t.line),r=[];if(e.off>fo||t.off>fo||e.col<0||t.col<0){let l=Math.min(e.off,t.off),o=Math.max(e.off,t.off);for(let a=n;a<=i;a++){let h=s.doc.line(a);h.length<=o&&r.push(q.range(h.from+l,h.to+o))}}else{let l=Math.min(e.col,t.col),o=Math.max(e.col,t.col);for(let a=n;a<=i;a++){let h=s.doc.line(a),c=Fl(h.text,l,s.tabSize,!0);if(c<0)r.push(q.cursor(h.to));else{let f=Fl(h.text,o,s.tabSize);r.push(q.range(h.from+c,h.from+f))}}}return r}function L0(s,e){let t=s.coordsAtPos(s.viewport.from);return t?Math.round(Math.abs((t.left-e)/s.defaultCharacterWidth)):-1}function Ph(s,e){let t=s.posAtCoords({x:e.clientX,y:e.clientY},!1),n=s.state.doc.lineAt(t),i=t-n.from,r=i>fo?-1:i==n.length?L0(s,e.clientX):Ni(n.text,s.state.tabSize,t-n.from);return{line:n.number,col:r,off:i}}function $0(s,e){let t=Ph(s,e),n=s.state.selection;return t?{update(i){if(i.docChanged){let r=i.changes.mapPos(i.startState.doc.line(t.line).from),l=i.state.doc.lineAt(r);t={line:l.number,col:t.col,off:Math.min(t.off,l.length)},n=n.map(i.changes)}},get(i,r,l){let o=Ph(s,i);if(!o)return n;let a=B0(s.state,t,o);return a.length?l?q.create(a.concat(n.ranges)):q.create(a):n}}:null}function pS(s){let e=(s==null?void 0:s.eventFilter)||(t=>t.altKey&&t.button==0);return ae.mouseSelectionStyle.of((t,n)=>e(n)?$0(t,n):null)}const R0={Alt:[18,s=>!!s.altKey],Control:[17,s=>!!s.ctrlKey],Shift:[16,s=>!!s.shiftKey],Meta:[91,s=>!!s.metaKey]},I0={style:"cursor: crosshair"};function mS(s={}){let[e,t]=R0[s.key||"Alt"],n=rt.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[n,ae.contentAttributes.of(i=>{var r;return!((r=i.plugin(n))===null||r===void 0)&&r.isDown?I0:null})]}const Ui="-10000px";class _d{constructor(e,t,n,i){this.facet=t,this.createTooltipView=n,this.removeTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(l=>l);let r=null;this.tooltipViews=this.tooltips.map(l=>r=n(l,r))}update(e,t){var n;let i=e.state.facet(this.facet),r=i.filter(a=>a);if(i===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let l=[],o=t?[]:null;for(let a=0;at[h]=a),t.length=o.length),this.input=i,this.tooltips=r,this.tooltipViews=l,!0}}function z0(s){let{win:e}=s;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const vl=le.define({combine:s=>{var e,t,n;return{position:se.ios?"absolute":((e=s.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=s.find(i=>i.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((n=s.find(i=>i.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||z0}}}),Nh=new WeakMap,Ho=rt.fromClass(class{constructor(s){this.view=s,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=s.state.facet(vl);this.position=e.position,this.parent=e.parent,this.classes=s.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 _d(s,kd,(t,n)=>this.createTooltip(t,n),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(),s.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 s of this.manager.tooltipViews)this.intersectionObserver.observe(s.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(s){s.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(s,this.above);e&&this.observeIntersection();let t=e||s.geometryChanged,n=s.state.facet(vl);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;t=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.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(s,e){let t=s.create(this.view),n=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),s.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",t.dom.insertBefore(i,n)}return t.dom.style.position=this.position,t.dom.style.top=Ui,t.dom.style.left="0px",this.container.insertBefore(t.dom,n),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var s,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),(s=n.destroy)===null||s===void 0||s.call(n);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 s=this.view.dom.getBoundingClientRect(),e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(se.gecko)n=i.offsetParent!=this.container.ownerDocument.body;else if(i.style.top==Ui&&i.style.left=="0px"){let r=i.getBoundingClientRect();n=Math.abs(r.top+1e4)>1||Math.abs(r.left)>1}}if(n||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(e=i.width/this.parent.offsetWidth,t=i.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:s,parent:this.parent?this.container.getBoundingClientRect():s,pos:this.manager.tooltips.map((i,r)=>{let l=this.manager.tooltipViews[r];return l.getCoords?l.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(vl).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(s){var e;if(s.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let o of this.manager.tooltipViews)o.dom.style.position="absolute"}let{editor:t,space:n,scaleX:i,scaleY:r}=s,l=[];for(let o=0;o=Math.min(t.bottom,n.bottom)||f.rightMath.min(t.right,n.right)+.1){c.style.top=Ui;continue}let d=a.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,m=u.right-u.left,g=(e=Nh.get(h))!==null&&e!==void 0?e:u.bottom-u.top,b=h.offset||V0,v=this.view.textDirection==He.LTR,O=u.width>n.right-n.left?v?n.left:n.right-u.width:v?Math.min(f.left-(d?14:0)+b.x,n.right-m):Math.max(n.left,f.left-m+(d?14:0)-b.x),M=this.above[o];!a.strictSide&&(M?f.top-(u.bottom-u.top)-b.yn.bottom)&&M==n.bottom-f.bottom>f.top-n.top&&(M=this.above[o]=!M);let B=(M?f.top-n.top:n.bottom-f.bottom)-p;if(BO&&V.topN&&(N=M?V.top-g-2-p:V.bottom+p+2);if(this.position=="absolute"?(c.style.top=(N-s.parent.top)/r+"px",c.style.left=(O-s.parent.left)/i+"px"):(c.style.top=N/r+"px",c.style.left=O/i+"px"),d){let V=f.left+(v?b.x:-b.x)-(O+14-7);d.style.left=V/i+"px"}h.overlap!==!0&&l.push({left:O,top:N,right:E,bottom:N+g}),c.classList.toggle("cm-tooltip-above",M),c.classList.toggle("cm-tooltip-below",!M),h.positioned&&h.positioned(s.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 s of this.manager.tooltipViews)s.dom.style.top=Ui}},{eventObservers:{scroll(){this.maybeMeasure()}}}),j0=ae.baseTheme({".cm-tooltip":{zIndex:100,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:`${7*2}px`,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"}}}),V0={x:0,y:0},kd=le.define({enables:[Ho,j0]}),gr=le.define({combine:s=>s.reduce((e,t)=>e.concat(t),[])});class Rr{static create(e){return new Rr(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new _d(e,gr,(t,n)=>this.createHostedView(t,n),t=>t.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}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 n of this.manager.tooltipViews){let i=n[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 H0=kd.compute([gr],s=>{let e=s.facet(gr);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var n;return(n=t.end)!==null&&n!==void 0?n:t.pos})),create:Rr.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class F0{constructor(e,t,n,i,r){this.view=e,this.source=t,this.field=n,this.setHover=i,this.hoverTime=r,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;eo.bottom||t.xo.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(i)).find(c=>c.from<=i&&c.to>=i),h=a&&a.dir==He.RTL?-1:1;r=t.x{this.pending==o&&(this.pending=null,a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])}))},a=>An(e.state,a,"hover tooltip"))}else l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])})}get tooltip(){let e=this.view.plugin(Ho),t=e?e.manager.tooltips.findIndex(n=>n.create==Rr.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;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:r}=this;if(i.length&&r&&!W0(r.dom,e)||this.pending){let{pos:l}=i[0]||this.pending,o=(n=(t=i[0])===null||t===void 0?void 0:t.end)!==null&&n!==void 0?n:l;(l==o?this.view.posAtCoords(this.lastMove)!=l:!q0(this.view,l,o,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:n}=this;n&&n.dom.contains(e.relatedTarget)?this.watchTooltipLeave(n.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(n.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 qs=4;function W0(s,e){let t=s.getBoundingClientRect();return e.clientX>=t.left-qs&&e.clientX<=t.right+qs&&e.clientY>=t.top-qs&&e.clientY<=t.bottom+qs}function q0(s,e,t,n,i,r){let l=s.scrollDOM.getBoundingClientRect(),o=s.documentTop+s.documentPadding.top+s.contentHeight;if(l.left>n||l.righti||Math.min(l.bottom,o)=e&&a<=t}function gS(s,e={}){let t=Ne.define(),n=Nt.define({create(){return[]},update(i,r){if(i.length&&(e.hideOnChange&&(r.docChanged||r.selection)?i=[]:e.hideOn&&(i=i.filter(l=>!e.hideOn(r,l))),r.docChanged))for(let l of i){let o=r.changes.mapPos(l.pos,-1,vt.TrackDel);if(o!=null){let a=Object.assign(Object.create(null),l);a.pos=o,a.end!=null&&(a.end=r.changes.mapPos(a.end))}}for(let l of r.effects)l.is(t)&&(i=l.value),l.is(U0)&&(i=[]);return i},provide:i=>gr.from(i)});return[n,rt.define(i=>new F0(i,s,n,t,e.hoverTime||300)),H0]}function bS(s,e){let t=s.plugin(Ho);if(!t)return null;let n=t.manager.tooltips.indexOf(e);return n<0?null:t.manager.tooltipViews[n]}const U0=Ne.define(),Bh=le.define({combine(s){let e,t;for(let n of s)e=e||n.topContainer,t=t||n.bottomContainer;return{topContainer:e,bottomContainer:t}}});function _S(s,e){let t=s.plugin(vd),n=t?t.specs.indexOf(e):-1;return n>-1?t.panels[n]:null}const vd=rt.fromClass(class{constructor(s){this.input=s.state.facet($h),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(s));let e=s.state.facet(Bh);this.top=new Us(s,!0,e.topContainer),this.bottom=new Us(s,!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(s){let e=s.state.facet(Bh);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Us(s.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Us(s.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=s.state.facet($h);if(t!=this.input){let n=t.filter(a=>a),i=[],r=[],l=[],o=[];for(let a of n){let h=this.specs.indexOf(a),c;h<0?(c=a(s.view),o.push(c)):(c=this.panels[h],c.update&&c.update(s)),i.push(c),(c.top?r:l).push(c)}this.specs=n,this.panels=i,this.top.sync(r),this.bottom.sync(l);for(let a of o)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let n of this.panels)n.update&&n.update(s)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:s=>ae.scrollMargins.of(e=>{let t=e.plugin(s);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Us{constructor(e,t,n){this.view=e,this.top=t,this.container=n,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=Lh(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Lh(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 Lh(s){let e=s.nextSibling;return s.remove(),e}const $h=le.define({enables:vd});class Dn extends Ei{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Dn.prototype.elementClass="";Dn.prototype.toDOM=void 0;Dn.prototype.mapMode=vt.TrackBefore;Dn.prototype.startSide=Dn.prototype.endSide=-1;Dn.prototype.point=!0;const or=le.define(),K0={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ee.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},ls=le.define();function J0(s){return[yd(),ls.of(Object.assign(Object.assign({},K0),s))]}const uo=le.define({combine:s=>s.some(e=>e)});function yd(s){let e=[G0];return s&&s.fixed===!1&&e.push(uo.of(!0)),e}const G0=rt.fromClass(class{constructor(s){this.view=s,this.prevViewport=s.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=s.state.facet(ls).map(e=>new Ih(s,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!s.state.facet(uo),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),s.scrollDOM.insertBefore(this.dom,s.contentDOM)}update(s){if(this.updateGutters(s)){let e=this.prevViewport,t=s.view.viewport,n=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(n<(t.to-t.from)*.8)}s.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(uo)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=s.view.viewport}syncGutters(s){let e=this.dom.nextSibling;s&&this.dom.remove();let t=Ee.iter(this.view.state.facet(or),this.view.viewport.from),n=[],i=this.gutters.map(r=>new Y0(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(r.type)){let l=!0;for(let o of r.type)if(o.type==gt.Text&&l){po(t,n,o.from);for(let a of i)a.line(this.view,o,n);l=!1}else if(o.widget)for(let a of i)a.widget(this.view,o)}else if(r.type==gt.Text){po(t,n,r.from);for(let l of i)l.line(this.view,r,n)}else if(r.widget)for(let l of i)l.widget(this.view,r);for(let r of i)r.finish();s&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(s){let e=s.startState.facet(ls),t=s.state.facet(ls),n=s.docChanged||s.heightChanged||s.viewportChanged||!Ee.eq(s.startState.facet(or),s.state.facet(or),s.view.viewport.from,s.view.viewport.to);if(e==t)for(let i of this.gutters)i.update(s)&&(n=!0);else{n=!0;let i=[];for(let r of t){let l=e.indexOf(r);l<0?i.push(new Ih(this.view,r)):(this.gutters[l].update(s),i.push(this.gutters[l]))}for(let r of this.gutters)r.dom.remove(),i.indexOf(r)<0&&r.destroy();for(let r of i)this.dom.appendChild(r.dom);this.gutters=i}return n}destroy(){for(let s of this.gutters)s.destroy();this.dom.remove()}},{provide:s=>ae.scrollMargins.of(e=>{let t=e.plugin(s);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==He.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function Rh(s){return Array.isArray(s)?s:[s]}function po(s,e,t){for(;s.value&&s.from<=t;)s.from==t&&e.push(s.value),s.next()}class Y0{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=Ee.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:i}=this,r=(t.top-this.height)/e.scaleY,l=t.height/e.scaleY;if(this.i==i.elements.length){let o=new wd(e,l,r,n);i.elements.push(o),i.dom.appendChild(o.dom)}else i.elements[this.i].update(e,l,r,n);this.height=t.bottom,this.i++}line(e,t,n){let i=[];po(this.cursor,i,t.from),n.length&&(i=i.concat(n));let r=this.gutter.config.lineMarker(e,t,i);r&&i.unshift(r);let l=this.gutter;i.length==0&&!l.config.renderEmptyElements||this.addElement(e,t,i)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t);n&&this.addElement(e,t,[n])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Ih{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 n in t.domEventHandlers)this.dom.addEventListener(n,i=>{let r=i.target,l;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let a=r.getBoundingClientRect();l=(a.top+a.bottom)/2}else l=i.clientY;let o=e.lineBlockAtHeight(l-e.documentTop);t.domEventHandlers[n](e,o,i)&&i.preventDefault()});this.markers=Rh(t.markers(e)),t.initialSpacer&&(this.spacer=new wd(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=Rh(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 n=e.view.viewport;return!Ee.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class wd{constructor(e,t,n,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,i)}update(e,t,n,i){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),X0(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,t){let n="cm-gutterElement",i=this.dom.firstChild;for(let r=0,l=0;;){let o=l,a=rr(o,a,h)||l(o,a,h):l}return n}})}});class yl extends Dn{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function wl(s,e){return s.state.facet(wi).formatNumber(e,s.state)}const Q0=ls.compute([wi],s=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(Z0)},lineMarker(e,t,n){return n.some(i=>i.toDOM)?null:new yl(wl(e,e.state.doc.lineAt(t.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(wi)!=e.state.facet(wi),initialSpacer(e){return new yl(wl(e,zh(e.state.doc.lines)))},updateSpacer(e,t){let n=wl(t.view,zh(t.view.state.doc.lines));return n==e.number?e:new yl(n)},domEventHandlers:s.facet(wi).domEventHandlers}));function kS(s={}){return[wi.of(s),yd(),Q0]}function zh(s){let e=9;for(;e{let e=[],t=-1;for(let n of s.selection.ranges){let i=s.doc.lineAt(n.head).from;i>t&&(t=i,e.push(e1.range(i)))}return Ee.of(e)});function vS(){return t1}const n1=1024;let i1=0;class $t{constructor(e,t){this.from=e,this.to=t}}class ve{constructor(e={}){this.id=i1++,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=wt.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}}ve.closedBy=new ve({deserialize:s=>s.split(" ")});ve.openedBy=new ve({deserialize:s=>s.split(" ")});ve.group=new ve({deserialize:s=>s.split(" ")});ve.isolate=new ve({deserialize:s=>{if(s&&s!="rtl"&&s!="ltr"&&s!="auto")throw new RangeError("Invalid value for isolate: "+s);return s||"auto"}});ve.contextHash=new ve({perNode:!0});ve.lookAhead=new ve({perNode:!0});ve.mounted=new ve({perNode:!0});class gs{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[ve.mounted.id]}}const s1=Object.create(null);class wt{constructor(e,t,n,i=0){this.name=e,this.props=t,this.id=n,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):s1,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new wt(e.name||"",t,e.id,n);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(i)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[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(ve.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let i of n.split(" "))t[i]=e[n];return n=>{for(let i=n.prop(ve.group),r=-1;r<(i?i.length:0);r++){let l=t[r<0?n.name:i[r]];if(l)return l}}}}wt.none=new wt("",Object.create(null),0,8);class Sd{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(l|We.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=i&&(!o&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&n&&(o||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;h=!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:qo(wt.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,i)=>new Ze(this.type,t,n,i,this.propValues),e.makeTree||((t,n,i)=>new Ze(wt.none,t,n,i)))}static build(e){return a1(e)}}Ze.empty=new Ze(wt.none,[],[],0);class Fo{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 Fo(this.buffer,this.index)}}class Jn{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return wt.none}toString(){let e=[];for(let t=0;t0));a=l[a+3]);return o}slice(e,t,n){let i=this.buffer,r=new Uint16Array(t-e),l=0;for(let o=e,a=0;o=e&&te;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function bs(s,e,t,n){for(var i;s.from==s.to||(t<1?s.from>=e:s.from>e)||(t>-1?s.to<=e:s.to0?o.length:-1;e!=h;e+=t){let c=o[e],f=a[e]+l.from;if(xd(i,n,f,f+c.length)){if(c instanceof Jn){if(r&We.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,n-f,i);if(u>-1)return new cn(new r1(l,c,e,f),null,u)}else if(r&We.IncludeAnonymous||!c.type.isAnonymous||Wo(c)){let u;if(!(r&We.IgnoreMounts)&&(u=gs.get(c))&&!u.overlay)return new ft(u.tree,f,e,l);let d=new ft(c,f,e,l);return r&We.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,n,i)}}}if(r&We.IncludeAnonymous||!l.type.isAnonymous||(l.index>=0?e=l.index+t:e=t<0?-1:l._parent._tree.children.length,l=l._parent,!l))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,n=0){let i;if(!(n&We.IgnoreOverlays)&&(i=gs.get(this._tree))&&i.overlay){let r=e-this.from;for(let{from:l,to:o}of i.overlay)if((t>0?l<=r:l=r:o>r))return new ft(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}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 Vh(s,e,t,n){let i=s.cursor(),r=[];if(!i.firstChild())return r;if(t!=null){for(let l=!1;!l;)if(l=i.type.is(t),!i.nextSibling())return r}for(;;){if(n!=null&&i.type.is(n))return r;if(i.type.is(e)&&r.push(i.node),!i.nextSibling())return n==null?r:[]}}function mo(s,e,t=e.length-1){for(let n=s.parent;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}class r1{constructor(e,t,n,i){this.parent=e,this.buffer=t,this.index=n,this.start=i}}class cn extends Ad{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,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new cn(this.context,this,r)}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,n=0){if(n&We.ExcludeBuffers)return null;let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new cn(this.context,this,r)}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 cn(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 cn(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,i=this.index+4,r=n.buffer[this.index+3];if(r>i){let l=n.buffer[this.index+1];e.push(n.slice(i,r,l)),t.push(0)}return new Ze(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Cd(s){if(!s.length)return null;let e=0,t=s[0];for(let r=1;rt.from||l.to=e){let o=new ft(l.tree,l.overlay[0].from+r.from,-1,r);(i||(i=[n])).push(bs(o,e,t,!1))}}return i?Cd(i):n}class br{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 ft)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.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:n,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return e?e instanceof ft?(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,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:i}=this.buffer,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,n);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}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,n=this.mode){return this.buffer?n&We.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&We.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&We.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,n=this.stack.length-1;if(e<0){let i=n<0?0:this.stack[n]+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<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(i)}return n<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,n,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let r=t+e,l=e<0?-1:n._tree.children.length;r!=l;r+=e){let o=n._tree.children[r];if(this.mode&We.IncludeAnonymous||o instanceof Jn||!o.type.isAnonymous||Wo(o))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=0;){for(let l=e;l;l=l._parent)if(l.index==i){if(i==this.index)return l;t=l,n=r+1;break e}i=this.stack[--r]}for(let i=n;i=0;r--){if(r<0)return mo(this.node,e,i);let l=n[t.buffer[this.stack[r]]];if(!l.isAnonymous){if(e[i]&&e[i]!=l.name)return!1;i--}}return!0}}function Wo(s){return s.children.some(e=>e instanceof Jn||!e.type.isAnonymous||Wo(e))}function a1(s){var e;let{buffer:t,nodeSet:n,maxBufferLength:i=n1,reused:r=[],minRepeatType:l=n.types.length}=s,o=Array.isArray(t)?new Fo(t,t.length):t,a=n.types,h=0,c=0;function f(B,N,E,V,$,F){let{id:R,start:D,end:C,size:W}=o,ne=c;for(;W<0;)if(o.next(),W==-1){let ge=r[R];E.push(ge),V.push(D-B);return}else if(W==-3){h=R;return}else if(W==-4){c=R;return}else throw new RangeError(`Unrecognized record size: ${W}`);let Y=a[R],he,j,fe=D-B;if(C-D<=i&&(j=g(o.pos-N,$))){let ge=new Uint16Array(j.size-j.skip),Re=o.pos-j.size,we=ge.length;for(;o.pos>Re;)we=b(j.start,ge,we);he=new Jn(ge,C-j.start,n),fe=j.start-B}else{let ge=o.pos-W;o.next();let Re=[],we=[],dt=R>=l?R:-1,X=0,pe=C;for(;o.pos>ge;)dt>=0&&o.id==dt&&o.size>=0?(o.end<=pe-i&&(p(Re,we,D,X,o.end,pe,dt,ne),X=Re.length,pe=o.end),o.next()):F>2500?u(D,ge,Re,we):f(D,ge,Re,we,dt,F+1);if(dt>=0&&X>0&&X-1&&X>0){let et=d(Y);he=qo(Y,Re,we,0,Re.length,0,C-D,et,et)}else he=m(Y,Re,we,C-D,ne-C)}E.push(he),V.push(fe)}function u(B,N,E,V){let $=[],F=0,R=-1;for(;o.pos>N;){let{id:D,start:C,end:W,size:ne}=o;if(ne>4)o.next();else{if(R>-1&&C=0;W-=3)D[ne++]=$[W],D[ne++]=$[W+1]-C,D[ne++]=$[W+2]-C,D[ne++]=ne;E.push(new Jn(D,$[2]-C,n)),V.push(C-B)}}function d(B){return(N,E,V)=>{let $=0,F=N.length-1,R,D;if(F>=0&&(R=N[F])instanceof Ze){if(!F&&R.type==B&&R.length==V)return R;(D=R.prop(ve.lookAhead))&&($=E[F]+R.length+D)}return m(B,N,E,V,$)}}function p(B,N,E,V,$,F,R,D){let C=[],W=[];for(;B.length>V;)C.push(B.pop()),W.push(N.pop()+E-$);B.push(m(n.types[R],C,W,F-$,D-F)),N.push($-E)}function m(B,N,E,V,$=0,F){if(h){let R=[ve.contextHash,h];F=F?[R].concat(F):[R]}if($>25){let R=[ve.lookAhead,$];F=F?[R].concat(F):[R]}return new Ze(B,N,E,V,F)}function g(B,N){let E=o.fork(),V=0,$=0,F=0,R=E.end-i,D={size:0,start:0,skip:0};e:for(let C=E.pos-B;E.pos>C;){let W=E.size;if(E.id==N&&W>=0){D.size=V,D.start=$,D.skip=F,F+=4,V+=4,E.next();continue}let ne=E.pos-W;if(W<0||ne=l?4:0,he=E.start;for(E.next();E.pos>ne;){if(E.size<0)if(E.size==-3)Y+=4;else break e;else E.id>=l&&(Y+=4);E.next()}$=he,V+=W,F+=Y}return(N<0||V==B)&&(D.size=V,D.start=$,D.skip=F),D.size>4?D:void 0}function b(B,N,E){let{id:V,start:$,end:F,size:R}=o;if(o.next(),R>=0&&V4){let C=o.pos-(R-4);for(;o.pos>C;)E=b(B,N,E)}N[--E]=D,N[--E]=F-B,N[--E]=$-B,N[--E]=V}else R==-3?h=V:R==-4&&(c=V);return E}let v=[],O=[];for(;o.pos>0;)f(s.start||0,s.bufferStart||0,v,O,-1,0);let M=(e=s.length)!==null&&e!==void 0?e:v.length?O[0]+v[0].length:0;return new Ze(a[s.topID],v.reverse(),O.reverse(),M)}const Hh=new WeakMap;function ar(s,e){if(!s.isAnonymous||e instanceof Jn||e.type!=s)return 1;let t=Hh.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=s||!(n instanceof Ze)){t=1;break}t+=ar(s,n)}Hh.set(e,t)}return t}function qo(s,e,t,n,i,r,l,o,a){let h=0;for(let p=n;p=c)break;N+=E}if(O==M+1){if(N>c){let E=p[M];d(E.children,E.positions,0,E.children.length,m[M]+v);continue}f.push(p[M])}else{let E=m[O-1]+p[O-1].length-B;f.push(qo(s,p,m,M,O,B,E,null,a))}u.push(B+v-r)}}return d(e,t,n,i,0),(o||a)(f,u,l)}class yS{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof cn?this.setBuffer(e.context.buffer,e.index,t):e instanceof ft&&this.map.set(e.tree,t)}get(e){return e instanceof cn?this.getBuffer(e.context.buffer,e.index):e instanceof ft?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 Cn{constructor(e,t,n,i,r=!1,l=!1){this.from=e,this.to=t,this.tree=n,this.offset=i,this.open=(r?1:0)|(l?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let i=[new Cn(0,e.length,e,0,!1,n)];for(let r of t)r.to>e.length&&i.push(r);return i}static applyChanges(e,t,n=128){if(!t.length)return e;let i=[],r=1,l=e.length?e[0]:null;for(let o=0,a=0,h=0;;o++){let c=o=n)for(;l&&l.from=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new Cn(d,p,u.tree,u.offset+h,o>0,!!c)}if(u&&i.push(u),l.to>f)break;l=rnew $t(i.from,i.to)):[new $t(0,0)]:[new $t(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let i=this.startParse(e,t,n);for(;;){let r=i.advance();if(r)return r}}};class c1{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 SS(s){return(e,t,n,i)=>new u1(e,s,t,n,i)}class Fh{constructor(e,t,n,i,r){this.parser=e,this.parse=t,this.overlay=n,this.target=i,this.from=r}}function Wh(s){if(!s.length||s.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(s))}class f1{constructor(e,t,n,i,r,l,o){this.parser=e,this.predicate=t,this.mounts=n,this.index=i,this.start=r,this.target=l,this.prev=o,this.depth=0,this.ranges=[]}}const go=new ve({perNode:!0});class u1{constructor(e,t,n,i,r){this.nest=t,this.input=n,this.fragments=i,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new Ze(n.type,n.children,n.positions,n.length,n.propValues.concat([[go,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[ve.mounted.id]=new gs(t,e.overlay,e.parser),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)o=!1;else if(e.hasNode(i)){if(t){let h=t.mounts.find(c=>c.frag.from<=i.from&&c.frag.to>=i.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=i.from&&u<=i.to&&!t.ranges.some(d=>d.fromf)&&t.ranges.push({from:f,to:u})}}o=!1}else if(n&&(l=d1(n.ranges,i.from,i.to)))o=l!=2;else if(!i.type.isAnonymous&&(r=this.nest(i,this.input))&&(i.fromnew $t(f.from-i.from,f.to-i.from)):null,i.tree,c.length?c[0].from:i.from)),r.overlay?c.length&&(n={ranges:c,depth:0,prev:n}):o=!1}}else t&&(a=t.predicate(i))&&(a===!0&&(a=new $t(i.from,i.to)),a.fromnew $t(c.from-t.start,c.to-t.start)),t.target,h[0].from))),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}}function d1(s,e,t){for(let n of s){if(n.from>=t)break;if(n.to>e)return n.from<=e&&n.to>=t?2:1}return 0}function qh(s,e,t,n,i,r){if(e=e&&t.enter(n,1,We.IgnoreOverlays|We.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 Ze)t=t.children[0];else break}return!1}}class m1{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(t=n.tree.prop(go))!==null&&t!==void 0?t:n.to,this.inner=new Uh(n.tree,-n.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(go))!==null&&e!==void 0?e:t.to,this.inner=new Uh(t.tree,-t.offset)}}findMounts(e,t){var n;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let l=(n=r.tree)===null||n===void 0?void 0:n.prop(ve.mounted);if(l&&l.parser==t)for(let o=this.fragI;o=r.to)break;a.tree==this.curFrag.tree&&i.push({frag:a,pos:r.from-a.offset,mount:l})}}}return i}}function Kh(s,e){let t=null,n=e;for(let i=1,r=0;i=o)break;a.to<=l||(t||(n=t=e.slice()),a.fromo&&t.splice(r+1,0,new $t(o,a.to))):a.to>o?t[r--]=new $t(o,a.to):t.splice(r--,1))}}return n}function g1(s,e,t,n){let i=0,r=0,l=!1,o=!1,a=-1e9,h=[];for(;;){let c=i==s.length?1e9:l?s[i].to:s[i].from,f=r==e.length?1e9:o?e[r].to:e[r].from;if(l!=o){let u=Math.max(a,t),d=Math.min(c,f,n);unew $t(u.from+n,u.to+n)),f=g1(e,c,a,h);for(let u=0,d=a;;u++){let p=u==f.length,m=p?h:f[u].from;if(m>d&&t.push(new Cn(d,m,i.tree,-l,r.from>=d||r.openStart,r.to<=m||r.openEnd)),p)break;d=f[u].to}}else t.push(new Cn(a,h,i.tree,-l,r.from>=l||r.openStart,r.to<=o||r.openEnd))}return t}let b1=0;class rn{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=b1++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new rn([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new _r;return t=>t.modified.indexOf(e)>-1?t:_r.get(t.base||t,t.modified.concat(e).sort((n,i)=>n.id-i.id))}}let _1=0;class _r{constructor(){this.instances=[],this.id=_1++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(o=>o.base==e&&k1(t,o.modified));if(n)return n;let i=[],r=new rn(i,e,t);for(let o of t)o.instances.push(r);let l=v1(t);for(let o of e.set)if(!o.modified.length)for(let a of l)i.push(_r.get(o,a));return r}}function k1(s,e){return s.length==e.length&&s.every((t,n)=>t==e[n])}function v1(s){let e=[[]];for(let t=0;tn.length-t.length)}function y1(s){let e=Object.create(null);for(let t in s){let n=s[t];Array.isArray(n)||(n=[n]);for(let i of t.split(" "))if(i){let r=[],l=2,o=i;for(let f=0;;){if(o=="..."&&f>0&&f+3==i.length){l=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!u)throw new RangeError("Invalid path: "+i);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==i.length)break;let d=i[f++];if(f==i.length&&d=="!"){l=0;break}if(d!="/")throw new RangeError("Invalid path: "+i);o=i.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+i);let c=new kr(n,l,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return Md.add(e)}const Md=new ve;class kr{constructor(e,t,n,i){this.tags=e,this.mode=t,this.context=n,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let l=i;for(let o of r)for(let a of o.set){let h=t[a.id];if(h){l=l?l+" "+h:h;break}}return l},scope:n}}function w1(s,e){let t=null;for(let n of s){let i=n.style(e);i&&(t=t?t+" "+i:i)}return t}function S1(s,e,t,n=0,i=s.length){let r=new x1(n,Array.isArray(e)?e:[e],t);r.highlightRange(s.cursor(),n,i,"",r.highlighters),r.flush(i)}class x1{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,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,n,i,r){let{type:l,from:o,to:a}=e;if(o>=n||a<=t)return;l.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(l)));let h=i,c=A1(e)||kr.empty,f=w1(r,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(t,o),h),c.opaque)return;let u=e.tree&&e.tree.prop(ve.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+o,1),p=this.highlighters.filter(g=>!g.scope||g.scope(u.tree.type)),m=e.firstChild();for(let g=0,b=o;;g++){let v=g=O||!e.nextSibling())););if(!v||O>n)break;b=v.to+o,b>t&&(this.highlightRange(d.cursor(),Math.max(t,v.from+o),Math.min(n,b),"",p),this.startSpan(Math.min(n,b),h))}m&&e.parent()}else if(e.firstChild()){u&&(i="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,i,r),this.startSpan(Math.min(n,e.to),h)}while(e.nextSibling());e.parent()}}}function A1(s){let e=s.type.prop(Md);for(;e&&e.context&&!s.matchContext(e.context);)e=e.next;return e||null}const Z=rn.define,Js=Z(),Rn=Z(),Gh=Z(Rn),Yh=Z(Rn),In=Z(),Gs=Z(In),Sl=Z(In),sn=Z(),ii=Z(sn),tn=Z(),nn=Z(),bo=Z(),Ki=Z(bo),Ys=Z(),L={comment:Js,lineComment:Z(Js),blockComment:Z(Js),docComment:Z(Js),name:Rn,variableName:Z(Rn),typeName:Gh,tagName:Z(Gh),propertyName:Yh,attributeName:Z(Yh),className:Z(Rn),labelName:Z(Rn),namespace:Z(Rn),macroName:Z(Rn),literal:In,string:Gs,docString:Z(Gs),character:Z(Gs),attributeValue:Z(Gs),number:Sl,integer:Z(Sl),float:Z(Sl),bool:Z(In),regexp:Z(In),escape:Z(In),color:Z(In),url:Z(In),keyword:tn,self:Z(tn),null:Z(tn),atom:Z(tn),unit:Z(tn),modifier:Z(tn),operatorKeyword:Z(tn),controlKeyword:Z(tn),definitionKeyword:Z(tn),moduleKeyword:Z(tn),operator:nn,derefOperator:Z(nn),arithmeticOperator:Z(nn),logicOperator:Z(nn),bitwiseOperator:Z(nn),compareOperator:Z(nn),updateOperator:Z(nn),definitionOperator:Z(nn),typeOperator:Z(nn),controlOperator:Z(nn),punctuation:bo,separator:Z(bo),bracket:Ki,angleBracket:Z(Ki),squareBracket:Z(Ki),paren:Z(Ki),brace:Z(Ki),content:sn,heading:ii,heading1:Z(ii),heading2:Z(ii),heading3:Z(ii),heading4:Z(ii),heading5:Z(ii),heading6:Z(ii),contentSeparator:Z(sn),list:Z(sn),quote:Z(sn),emphasis:Z(sn),strong:Z(sn),link:Z(sn),monospace:Z(sn),strikethrough:Z(sn),inserted:Z(),deleted:Z(),changed:Z(),invalid:Z(),meta:Ys,documentMeta:Z(Ys),annotation:Z(Ys),processingInstruction:Z(Ys),definition:rn.defineModifier(),constant:rn.defineModifier(),function:rn.defineModifier(),standard:rn.defineModifier(),local:rn.defineModifier(),special:rn.defineModifier()};Td([{tag:L.link,class:"tok-link"},{tag:L.heading,class:"tok-heading"},{tag:L.emphasis,class:"tok-emphasis"},{tag:L.strong,class:"tok-strong"},{tag:L.keyword,class:"tok-keyword"},{tag:L.atom,class:"tok-atom"},{tag:L.bool,class:"tok-bool"},{tag:L.url,class:"tok-url"},{tag:L.labelName,class:"tok-labelName"},{tag:L.inserted,class:"tok-inserted"},{tag:L.deleted,class:"tok-deleted"},{tag:L.literal,class:"tok-literal"},{tag:L.string,class:"tok-string"},{tag:L.number,class:"tok-number"},{tag:[L.regexp,L.escape,L.special(L.string)],class:"tok-string2"},{tag:L.variableName,class:"tok-variableName"},{tag:L.local(L.variableName),class:"tok-variableName tok-local"},{tag:L.definition(L.variableName),class:"tok-variableName tok-definition"},{tag:L.special(L.variableName),class:"tok-variableName2"},{tag:L.definition(L.propertyName),class:"tok-propertyName tok-definition"},{tag:L.typeName,class:"tok-typeName"},{tag:L.namespace,class:"tok-namespace"},{tag:L.className,class:"tok-className"},{tag:L.macroName,class:"tok-macroName"},{tag:L.propertyName,class:"tok-propertyName"},{tag:L.operator,class:"tok-operator"},{tag:L.comment,class:"tok-comment"},{tag:L.meta,class:"tok-meta"},{tag:L.invalid,class:"tok-invalid"},{tag:L.punctuation,class:"tok-punctuation"}]);var xl;const Si=new ve;function C1(s){return le.define({combine:s?e=>e.concat(s):void 0})}const M1=new ve;class qt{constructor(e,t,n=[],i=""){this.data=e,this.name=i,ye.prototype.hasOwnProperty("tree")||Object.defineProperty(ye.prototype,"tree",{get(){return Pt(this)}}),this.parser=t,this.extension=[Gn.of(this),ye.languageData.of((r,l,o)=>{let a=Xh(r,l,o),h=a.type.prop(Si);if(!h)return[];let c=r.facet(h),f=a.type.prop(M1);if(f){let u=a.resolve(l-a.from,o);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(n)}isActiveAt(e,t,n=-1){return Xh(e,t,n).type.prop(Si)==this.data}findRegions(e){let t=e.facet(Gn);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],i=(r,l)=>{if(r.prop(Si)==this.data){n.push({from:l,to:l+r.length});return}let o=r.prop(ve.mounted);if(o){if(o.tree.prop(Si)==this.data){if(o.overlay)for(let a of o.overlay)n.push({from:a.from+l,to:a.to+l});else n.push({from:l,to:l+r.length});return}else if(o.overlay){let a=n.length;if(i(o.tree,o.overlay[0].from+l),n.length>a)return}}for(let a=0;an.isTop?t:void 0)]}),e.name)}configure(e,t){return new _o(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Pt(s){let e=s.field(qt.state,!1);return e?e.tree:Ze.empty}class T1{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 n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let Ji=null;class vr{constructor(e,t,n=[],i,r,l,o,a){this.parser=e,this.state=t,this.fragments=n,this.tree=i,this.treeLen=r,this.viewport=l,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new vr(e,t,[],Ze.empty,0,n,[],null)}startParse(){return this.parser.startParse(new T1(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Ze.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;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.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(Cn.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Ji;Ji=this;try{return e()}finally{Ji=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Zh(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:i,treeLen:r,viewport:l,skipped:o}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),n=Cn.applyChanges(n,a),i=Ze.empty,r=0,l={from:e.mapPos(l.from,-1),to:e.mapPos(l.to,1)},this.skipped.length){o=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=Zh(this.fragments,i,r),this.skipped.splice(n--,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 h1{createParse(t,n,i){let r=i[0].from,l=i[i.length-1].to;return{parsedPos:r,advance(){let a=Ji;if(a){for(let h of i)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=l,new Ze(wt.none,[],[],l-r)},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 Ji}}function Zh(s,e,t){return Cn.applyChanges(s,[{fromA:e,toA:t,fromB:e,toB:t}])}class Di{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),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new Di(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=vr.create(e.facet(Gn).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new Di(n)}}qt.state=Nt.define({create:Di.init,update(s,e){for(let t of e.effects)if(t.is(qt.setState))return t.value;return e.startState.facet(Gn)!=e.state.facet(Gn)?Di.init(e.state):s.apply(e)}});let Ed=s=>{let e=setTimeout(()=>s(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Ed=s=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(s,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Al=typeof navigator<"u"&&(!((xl=navigator.scheduling)===null||xl===void 0)&&xl.isInputPending)?()=>navigator.scheduling.isInputPending():null,E1=rt.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(qt.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(qt.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Ed(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndi+1e3,a=r.context.work(()=>Al&&Al()||Date.now()>l,i+(o?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:qt.setState.of(new Di(r.context))})),this.chunkBudget>0&&!(a&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>An(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()}}}),Gn=le.define({combine(s){return s.length?s[0]:null},enables:s=>[qt.state,E1,ae.contentAttributes.compute([s],e=>{let t=e.facet(s);return t&&t.name?{"data-language":t.name}:{}})]});class AS{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class Od{constructor(e,t,n,i,r,l=void 0){this.name=e,this.alias=t,this.extensions=n,this.filename=i,this.loadFunc=r,this.support=l,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:n}=e;if(!t){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(n)}return new Od(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,t,n)}static matchFilename(e,t){for(let i of e)if(i.filename&&i.filename.test(t))return i;let n=/\.([^.]+)$/.exec(t);if(n){for(let i of e)if(i.extensions.indexOf(n[1])>-1)return i}return null}static matchLanguageName(e,t,n=!0){t=t.toLowerCase();for(let i of e)if(i.alias.some(r=>r==t))return i;if(n)for(let i of e)for(let r of i.alias){let l=t.indexOf(r);if(l>-1&&(r.length>2||!/\w/.test(t[l-1])&&!/\w/.test(t[l+r.length])))return i}return null}}const O1=le.define(),Ir=le.define({combine:s=>{if(!s.length)return" ";let e=s[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(s[0]));return e}});function yr(s){let e=s.facet(Ir);return e.charCodeAt(0)==9?s.tabSize*e.length:e.length}function _s(s,e){let t="",n=s.tabSize,i=s.facet(Ir)[0];if(i==" "){for(;e>=n;)t+=" ",e-=n;i=" "}for(let r=0;r=e?P1(s,t,e):null}class zr{constructor(e,t={}){this.state=e,this.options=t,this.unit=yr(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:r}=this.options;return i!=null&&i>=n.from&&i<=n.to?r&&i==e?{text:"",from:e}:(t<0?i-1&&(r+=l-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return Ni(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:i}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let l=r(i);if(l>-1)return l}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const D1=new ve;function P1(s,e,t){let n=e.resolveStack(t),i=n.node.enterUnfinishedNodesBefore(t);if(i!=n.node){let r=[];for(let l=i;l!=n.node;l=l.parent)r.push(l);for(let l=r.length-1;l>=0;l--)n={node:r[l],next:n}}return Dd(n,s,t)}function Dd(s,e,t){for(let n=s;n;n=n.next){let i=B1(n.node);if(i)return i(Ko.create(e,t,n))}return 0}function N1(s){return s.pos==s.options.simulateBreak&&s.options.simulateDoubleBreak}function B1(s){let e=s.type.prop(D1);if(e)return e;let t=s.firstChild,n;if(t&&(n=t.type.prop(ve.closedBy))){let i=s.lastChild,r=i&&n.indexOf(i.name)>-1;return l=>Pd(l,!0,1,void 0,r&&!N1(l)?i.from:void 0)}return s.parent==null?L1:null}function L1(){return 0}class Ko extends zr{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new Ko(e,t,n)}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 n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if($1(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return Dd(this.context.next,this.base,this.pos)}}function $1(s,e){for(let t=e;t;t=t.parent)if(s==t)return!0;return!1}function R1(s){let e=s.node,t=e.childAfter(e.from),n=e.lastChild;if(!t)return null;let i=s.options.simulateBreak,r=s.state.doc.lineAt(t.from),l=i==null||i<=r.from?r.to:Math.min(r.to,i);for(let o=t.to;;){let a=e.childAfter(o);if(!a||a==n)return null;if(!a.type.isSkipped)return a.fromPd(n,e,t,s)}function Pd(s,e,t,n,i){let r=s.textAfter,l=r.match(/^\s*/)[0].length,o=n&&r.slice(l,l+n.length)==n||i==s.pos+l,a=e?R1(s):null;return a?o?s.column(a.from):s.column(a.to):s.baseIndent+(o?0:s.unit*t)}const MS=s=>s.baseIndent;function TS({except:s,units:e=1}={}){return t=>{let n=s&&s.test(t.textAfter);return t.baseIndent+(n?0:e*t.unit)}}const I1=200;function ES(){return ye.transactionFilter.of(s=>{if(!s.docChanged||!s.isUserEvent("input.type")&&!s.isUserEvent("input.complete"))return s;let e=s.startState.languageDataAt("indentOnInput",s.startState.selection.main.head);if(!e.length)return s;let t=s.newDoc,{head:n}=s.newSelection.main,i=t.lineAt(n);if(n>i.from+I1)return s;let r=t.sliceString(i.from,n);if(!e.some(h=>h.test(r)))return s;let{state:l}=s,o=-1,a=[];for(let{head:h}of l.selection.ranges){let c=l.doc.lineAt(h);if(c.from==o)continue;o=c.from;let f=Uo(l,c.from);if(f==null)continue;let u=/^\s*/.exec(c.text)[0],d=_s(l,f);u!=d&&a.push({from:c.from,to:c.from+u.length,insert:d})}return a.length?[s,{changes:a,sequential:!0}]:s})}const z1=le.define(),j1=new ve;function OS(s){let e=s.firstChild,t=s.lastChild;return e&&e.tot)continue;if(r&&o.from=e&&h.to>t&&(r=h)}}return r}function H1(s){let e=s.lastChild;return e&&e.to==s.to&&e.type.isError}function wr(s,e,t){for(let n of s.facet(z1)){let i=n(s,e,t);if(i)return i}return V1(s,e,t)}function Nd(s,e){let t=e.mapPos(s.from,1),n=e.mapPos(s.to,-1);return t>=n?void 0:{from:t,to:n}}const jr=Ne.define({map:Nd}),Cs=Ne.define({map:Nd});function Bd(s){let e=[];for(let{head:t}of s.state.selection.ranges)e.some(n=>n.from<=t&&n.to>=t)||e.push(s.lineBlockAt(t));return e}const fi=Nt.define({create(){return Be.none},update(s,e){s=s.map(e.changes);for(let t of e.effects)if(t.is(jr)&&!F1(s,t.value.from,t.value.to)){let{preparePlaceholder:n}=e.state.facet(Jo),i=n?Be.replace({widget:new G1(n(e.state,t.value))}):Qh;s=s.update({add:[i.range(t.value.from,t.value.to)]})}else t.is(Cs)&&(s=s.update({filter:(n,i)=>t.value.from!=n||t.value.to!=i,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:n}=e.selection.main;s.between(n,n,(i,r)=>{in&&(t=!0)}),t&&(s=s.update({filterFrom:n,filterTo:n,filter:(i,r)=>r<=n||i>=n}))}return s},provide:s=>ae.decorations.from(s),toJSON(s,e){let t=[];return s.between(0,e.doc.length,(n,i)=>{t.push(n,i)}),t},fromJSON(s){if(!Array.isArray(s)||s.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{(!i||i.from>r)&&(i={from:r,to:l})}),i}function F1(s,e,t){let n=!1;return s.between(e,e,(i,r)=>{i==e&&r==t&&(n=!0)}),n}function Ld(s,e){return s.field(fi,!1)?e:e.concat(Ne.appendConfig.of(Rd()))}const W1=s=>{for(let e of Bd(s)){let t=wr(s.state,e.from,e.to);if(t)return s.dispatch({effects:Ld(s.state,[jr.of(t),$d(s,t)])}),!0}return!1},q1=s=>{if(!s.state.field(fi,!1))return!1;let e=[];for(let t of Bd(s)){let n=Sr(s.state,t.from,t.to);n&&e.push(Cs.of(n),$d(s,n,!1))}return e.length&&s.dispatch({effects:e}),e.length>0};function $d(s,e,t=!0){let n=s.state.doc.lineAt(e.from).number,i=s.state.doc.lineAt(e.to).number;return ae.announce.of(`${s.state.phrase(t?"Folded lines":"Unfolded lines")} ${n} ${s.state.phrase("to")} ${i}.`)}const U1=s=>{let{state:e}=s,t=[];for(let n=0;n{let e=s.state.field(fi,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,s.state.doc.length,(n,i)=>{t.push(Cs.of({from:n,to:i}))}),s.dispatch({effects:t}),!0},DS=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:W1},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:q1},{key:"Ctrl-Alt-[",run:U1},{key:"Ctrl-Alt-]",run:K1}],J1={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Jo=le.define({combine(s){return Pi(s,J1)}});function Rd(s){let e=[fi,X1];return s&&e.push(Jo.of(s)),e}function Id(s,e){let{state:t}=s,n=t.facet(Jo),i=l=>{let o=s.lineBlockAt(s.posAtDOM(l.target)),a=Sr(s.state,o.from,o.to);a&&s.dispatch({effects:Cs.of(a)}),l.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(s,i,e);let r=document.createElement("span");return r.textContent=n.placeholderText,r.setAttribute("aria-label",t.phrase("folded code")),r.title=t.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=i,r}const Qh=Be.replace({widget:new class extends pi{toDOM(s){return Id(s,null)}}});class G1 extends pi{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Id(e,this.value)}}const Y1={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Cl extends Dn{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 PS(s={}){let e=Object.assign(Object.assign({},Y1),s),t=new Cl(e,!0),n=new Cl(e,!1),i=rt.fromClass(class{constructor(l){this.from=l.viewport.from,this.markers=this.buildMarkers(l)}update(l){(l.docChanged||l.viewportChanged||l.startState.facet(Gn)!=l.state.facet(Gn)||l.startState.field(fi,!1)!=l.state.field(fi,!1)||Pt(l.startState)!=Pt(l.state)||e.foldingChanged(l))&&(this.markers=this.buildMarkers(l.view))}buildMarkers(l){let o=new ai;for(let a of l.viewportLineBlocks){let h=Sr(l.state,a.from,a.to)?n:wr(l.state,a.from,a.to)?t:null;h&&o.add(a.from,a.from,h)}return o.finish()}}),{domEventHandlers:r}=e;return[i,J0({class:"cm-foldGutter",markers(l){var o;return((o=l.plugin(i))===null||o===void 0?void 0:o.markers)||Ee.empty},initialSpacer(){return new Cl(e,!1)},domEventHandlers:Object.assign(Object.assign({},r),{click:(l,o,a)=>{if(r.click&&r.click(l,o,a))return!0;let h=Sr(l.state,o.from,o.to);if(h)return l.dispatch({effects:Cs.of(h)}),!0;let c=wr(l.state,o.from,o.to);return c?(l.dispatch({effects:jr.of(c)}),!0):!1}})}),Rd()]}const X1=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 Ms{constructor(e,t){this.specs=e;let n;function i(o){let a=qn.newName();return(n||(n=Object.create(null)))["."+a]=o,a}const r=typeof t.all=="string"?t.all:t.all?i(t.all):void 0,l=t.scope;this.scope=l instanceof qt?o=>o.prop(Si)==l.data:l?o=>o==l:void 0,this.style=Td(e.map(o=>({tag:o.tag,class:o.class||i(Object.assign({},o,{tag:null}))})),{all:r}).style,this.module=n?new qn(n):null,this.themeType=t.themeType}static define(e,t){return new Ms(e,t||{})}}const ko=le.define(),zd=le.define({combine(s){return s.length?[s[0]]:null}});function Ml(s){let e=s.facet(ko);return e.length?e:s.facet(zd)}function Z1(s,e){let t=[eb],n;return s instanceof Ms&&(s.module&&t.push(ae.styleModule.of(s.module)),n=s.themeType),e!=null&&e.fallback?t.push(zd.of(s)):n?t.push(ko.computeN([ae.darkTheme],i=>i.facet(ae.darkTheme)==(n=="dark")?[s]:[])):t.push(ko.of(s)),t}class Q1{constructor(e){this.markCache=Object.create(null),this.tree=Pt(e.state),this.decorations=this.buildDeco(e,Ml(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Pt(e.state),n=Ml(e.state),i=n!=Ml(e.startState),{viewport:r}=e.view,l=e.changes.mapPos(this.decoratedTo,1);t.length=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=l):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return Be.none;let n=new ai;for(let{from:i,to:r}of e.visibleRanges)S1(this.tree,t,(l,o,a)=>{n.add(l,o,this.markCache[a]||(this.markCache[a]=Be.mark({class:a})))},i,r);return n.finish()}}const eb=Br.high(rt.fromClass(Q1,{decorations:s=>s.decorations})),NS=Ms.define([{tag:L.meta,color:"#404740"},{tag:L.link,textDecoration:"underline"},{tag:L.heading,textDecoration:"underline",fontWeight:"bold"},{tag:L.emphasis,fontStyle:"italic"},{tag:L.strong,fontWeight:"bold"},{tag:L.strikethrough,textDecoration:"line-through"},{tag:L.keyword,color:"#708"},{tag:[L.atom,L.bool,L.url,L.contentSeparator,L.labelName],color:"#219"},{tag:[L.literal,L.inserted],color:"#164"},{tag:[L.string,L.deleted],color:"#a11"},{tag:[L.regexp,L.escape,L.special(L.string)],color:"#e40"},{tag:L.definition(L.variableName),color:"#00f"},{tag:L.local(L.variableName),color:"#30a"},{tag:[L.typeName,L.namespace],color:"#085"},{tag:L.className,color:"#167"},{tag:[L.special(L.variableName),L.macroName],color:"#256"},{tag:L.definition(L.propertyName),color:"#00c"},{tag:L.comment,color:"#940"},{tag:L.invalid,color:"#f00"}]),tb=ae.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),jd=1e4,Vd="()[]{}",Hd=le.define({combine(s){return Pi(s,{afterCursor:!0,brackets:Vd,maxScanDistance:jd,renderMatch:sb})}}),nb=Be.mark({class:"cm-matchingBracket"}),ib=Be.mark({class:"cm-nonmatchingBracket"});function sb(s){let e=[],t=s.matched?nb:ib;return e.push(t.range(s.start.from,s.start.to)),s.end&&e.push(t.range(s.end.from,s.end.to)),e}const rb=Nt.define({create(){return Be.none},update(s,e){if(!e.docChanged&&!e.selection)return s;let t=[],n=e.state.facet(Hd);for(let i of e.state.selection.ranges){if(!i.empty)continue;let r=fn(e.state,i.head,-1,n)||i.head>0&&fn(e.state,i.head-1,1,n)||n.afterCursor&&(fn(e.state,i.head,1,n)||i.headae.decorations.from(s)}),lb=[rb,tb];function BS(s={}){return[Hd.of(s),lb]}const ob=new ve;function vo(s,e,t){let n=s.prop(e<0?ve.openedBy:ve.closedBy);if(n)return n;if(s.name.length==1){let i=t.indexOf(s.name);if(i>-1&&i%2==(e<0?1:0))return[t[i+e]]}return null}function yo(s){let e=s.type.prop(ob);return e?e(s.node):s}function fn(s,e,t,n={}){let i=n.maxScanDistance||jd,r=n.brackets||Vd,l=Pt(s),o=l.resolveInner(e,t);for(let a=o;a;a=a.parent){let h=vo(a.type,t,r);if(h&&a.from0?e>=c.from&&ec.from&&e<=c.to))return ab(s,e,t,a,c,h,r)}}return hb(s,e,t,l,o.type,i,r)}function ab(s,e,t,n,i,r,l){let o=n.parent,a={from:i.from,to:i.to},h=0,c=o==null?void 0:o.cursor();if(c&&(t<0?c.childBefore(n.from):c.childAfter(n.to)))do if(t<0?c.to<=n.from:c.from>=n.to){if(h==0&&r.indexOf(c.type.name)>-1&&c.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=s.doc.iterRange(e,t>0?s.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let m=t>0?0:d.length-1,g=t>0?d.length:-1;m!=g;m+=t){let b=l.indexOf(d[m]);if(!(b<0||n.resolveInner(p+m,1).type!=i))if(b%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+m,to:p+m+1},matched:b>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}const cb=Object.create(null),ec=[wt.none],tc=[],nc=Object.create(null),fb=Object.create(null);for(let[s,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"]])fb[s]=ub(cb,e);function Tl(s,e){tc.indexOf(s)>-1||(tc.push(s),console.warn(e))}function ub(s,e){let t=[];for(let o of e.split(" ")){let a=[];for(let h of o.split(".")){let c=s[h]||L[h];c?typeof c=="function"?a.length?a=a.map(c):Tl(h,`Modifier ${h} used at start of tag`):a.length?Tl(h,`Tag ${h} used as modifier`):a=Array.isArray(c)?c:[c]:Tl(h,`Unknown highlighting tag ${h}`)}for(let h of a)t.push(h)}if(!t.length)return 0;let n=e.replace(/ /g,"_"),i=n+" "+t.map(o=>o.id),r=nc[i];if(r)return r.id;let l=nc[i]=wt.define({id:ec.length,name:n,props:[y1({[n]:t})]});return ec.push(l),l.id}He.RTL,He.LTR;const db=s=>{let{state:e}=s,t=e.doc.lineAt(e.selection.main.from),n=Yo(s.state,t.from);return n.line?pb(s):n.block?gb(s):!1};function Go(s,e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=s(e,t);return i?(n(t.update(i)),!0):!1}}const pb=Go(kb,0),mb=Go(Fd,0),gb=Go((s,e)=>Fd(s,e,_b(e)),0);function Yo(s,e){let t=s.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const Gi=50;function bb(s,{open:e,close:t},n,i){let r=s.sliceDoc(n-Gi,n),l=s.sliceDoc(i,i+Gi),o=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(l)[0].length,h=r.length-o;if(r.slice(h-e.length,h)==e&&l.slice(a,a+t.length)==t)return{open:{pos:n-o,margin:o&&1},close:{pos:i+a,margin:a&&1}};let c,f;i-n<=2*Gi?c=f=s.sliceDoc(n,i):(c=s.sliceDoc(n,n+Gi),f=s.sliceDoc(i-Gi,i));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:n+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:i-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function _b(s){let e=[];for(let t of s.selection.ranges){let n=s.doc.lineAt(t.from),i=t.to<=n.to?n:s.doc.lineAt(t.to),r=e.length-1;r>=0&&e[r].to>n.from?e[r].to=i.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:i.to})}return e}function Fd(s,e,t=e.selection.ranges){let n=t.map(r=>Yo(e,r.from).block);if(!n.every(r=>r))return null;let i=t.map((r,l)=>bb(e,n[l],r.from,r.to));if(s!=2&&!i.every(r=>r))return{changes:e.changes(t.map((r,l)=>i[l]?[]:[{from:r.from,insert:n[l].open+" "},{from:r.to,insert:" "+n[l].close}]))};if(s!=1&&i.some(r=>r)){let r=[];for(let l=0,o;li&&(r==l||l>f.from)){i=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:o,token:a,indent:h,empty:c,single:f}of n)(f||!c)&&r.push({from:o.from+h,insert:a+" "});let l=e.changes(r);return{changes:l,selection:e.selection.map(l,1)}}else if(s!=1&&n.some(r=>r.comment>=0)){let r=[];for(let{line:l,comment:o,token:a}of n)if(o>=0){let h=l.from+o,c=h+a.length;l.text[c-l.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const wo=Yn.define(),vb=Yn.define(),yb=le.define(),Wd=le.define({combine(s){return Pi(s,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,i)=>e(n,i)||t(n,i)})}}),Xo=Nt.define({create(){return un.empty},update(s,e){let t=e.state.facet(Wd),n=e.annotation(wo);if(n){let a=yt.fromTransaction(e,n.selection),h=n.side,c=h==0?s.undone:s.done;return a?c=xr(c,c.length,t.minDepth,a):c=Kd(c,e.startState.selection),new un(h==0?n.rest:c,h==0?c:n.rest)}let i=e.annotation(vb);if((i=="full"||i=="before")&&(s=s.isolate()),e.annotation(Xe.addToHistory)===!1)return e.changes.empty?s:s.addMapping(e.changes.desc);let r=yt.fromTransaction(e),l=e.annotation(Xe.time),o=e.annotation(Xe.userEvent);return r?s=s.addChanges(r,l,o,t,e):e.selection&&(s=s.addSelection(e.startState.selection,l,o,t.newGroupDelay)),(i=="full"||i=="after")&&(s=s.isolate()),s},toJSON(s){return{done:s.done.map(e=>e.toJSON()),undone:s.undone.map(e=>e.toJSON())}},fromJSON(s){return new un(s.done.map(yt.fromJSON),s.undone.map(yt.fromJSON))}});function LS(s={}){return[Xo,Wd.of(s),ae.domEventHandlers({beforeinput(e,t){let n=e.inputType=="historyUndo"?qd:e.inputType=="historyRedo"?So:null;return n?(e.preventDefault(),n(t)):!1}})]}const ic=Xo;function Vr(s,e){return function({state:t,dispatch:n}){if(!e&&t.readOnly)return!1;let i=t.field(Xo,!1);if(!i)return!1;let r=i.pop(s,t,e);return r?(n(r),!0):!1}}const qd=Vr(0,!1),So=Vr(1,!1),wb=Vr(0,!0),Sb=Vr(1,!0);class yt{constructor(e,t,n,i,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=i,this.selectionsAfter=r}setSelAfter(e){return new yt(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;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:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new yt(e.changes&&Ge.fromJSON(e.changes),[],e.mapped&&mn.fromJSON(e.mapped),e.startSelection&&q.fromJSON(e.startSelection),e.selectionsAfter.map(q.fromJSON))}static fromTransaction(e,t){let n=Rt;for(let i of e.startState.facet(yb)){let r=i(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new yt(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,Rt)}static selection(e){return new yt(void 0,Rt,void 0,void 0,e)}}function xr(s,e,t,n){let i=e+1>t+20?e-t-1:0,r=s.slice(i,e);return r.push(n),r}function xb(s,e){let t=[],n=!1;return s.iterChangedRanges((i,r)=>t.push(i,r)),e.iterChangedRanges((i,r,l,o)=>{for(let a=0;a=h&&l<=c&&(n=!0)}}),n}function Ab(s,e){return s.ranges.length==e.ranges.length&&s.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length===0}function Ud(s,e){return s.length?e.length?s.concat(e):s:e}const Rt=[],Cb=200;function Kd(s,e){if(s.length){let t=s[s.length-1],n=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-Cb));return n.length&&n[n.length-1].eq(e)?s:(n.push(e),xr(s,s.length-1,1e9,t.setSelAfter(n)))}else return[yt.selection([e])]}function Mb(s){let e=s[s.length-1],t=s.slice();return t[s.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function El(s,e){if(!s.length)return s;let t=s.length,n=Rt;for(;t;){let i=Tb(s[t-1],e,n);if(i.changes&&!i.changes.empty||i.effects.length){let r=s.slice(0,t);return r[t-1]=i,r}else e=i.mapped,t--,n=i.selectionsAfter}return n.length?[yt.selection(n)]:Rt}function Tb(s,e,t){let n=Ud(s.selectionsAfter.length?s.selectionsAfter.map(o=>o.map(e)):Rt,t);if(!s.changes)return yt.selection(n);let i=s.changes.map(e),r=e.mapDesc(s.changes,!0),l=s.mapped?s.mapped.composeDesc(r):r;return new yt(i,Ne.mapEffects(s.effects,e),l,s.startSelection.map(r),n)}const Eb=/^(input\.type|delete)($|\.)/;class un{constructor(e,t,n=0,i=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=i}isolate(){return this.prevTime?new un(this.done,this.undone):this}addChanges(e,t,n,i,r){let l=this.done,o=l[l.length-1];return o&&o.changes&&!o.changes.empty&&e.changes&&(!n||Eb.test(n))&&(!o.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?s.moveByChar(t,e):Hr(t,e))}function ut(s){return s.textDirectionAt(s.state.selection.main.head)==He.LTR}const Gd=s=>Jd(s,!ut(s)),Yd=s=>Jd(s,ut(s));function Xd(s,e){return Jt(s,t=>t.empty?s.moveByGroup(t,e):Hr(t,e))}const Ob=s=>Xd(s,!ut(s)),Db=s=>Xd(s,ut(s));function Pb(s,e,t){if(e.type.prop(t))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(s.sliceDoc(e.from,e.to)))||e.firstChild}function Fr(s,e,t){let n=Pt(s).resolveInner(e.head),i=t?ve.closedBy:ve.openedBy;for(let a=e.head;;){let h=t?n.childAfter(a):n.childBefore(a);if(!h)break;Pb(s,h,i)?n=h:a=t?h.to:h.from}let r=n.type.prop(i),l,o;return r&&(l=t?fn(s,n.from,1):fn(s,n.to,-1))&&l.matched?o=t?l.end.to:l.end.from:o=t?n.to:n.from,q.cursor(o,t?-1:1)}const Nb=s=>Jt(s,e=>Fr(s.state,e,!ut(s))),Bb=s=>Jt(s,e=>Fr(s.state,e,ut(s)));function Zd(s,e){return Jt(s,t=>{if(!t.empty)return Hr(t,e);let n=s.moveVertically(t,e);return n.head!=t.head?n:s.moveToLineBoundary(t,e)})}const Qd=s=>Zd(s,!1),ep=s=>Zd(s,!0);function tp(s){let e=s.scrollDOM.clientHeightl.empty?s.moveVertically(l,e,t.height):Hr(l,e));if(i.eq(n.selection))return!1;let r;if(t.selfScroll){let l=s.coordsAtPos(n.selection.main.head),o=s.scrollDOM.getBoundingClientRect(),a=o.top+t.marginTop,h=o.bottom-t.marginBottom;l&&l.top>a&&l.bottomnp(s,!1),xo=s=>np(s,!0);function Xn(s,e,t){let n=s.lineBlockAt(e.head),i=s.moveToLineBoundary(e,t);if(i.head==e.head&&i.head!=(t?n.to:n.from)&&(i=s.moveToLineBoundary(e,t,!1)),!t&&i.head==n.from&&n.length){let r=/^\s*/.exec(s.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;r&&e.head!=n.from+r&&(i=q.cursor(n.from+r))}return i}const Lb=s=>Jt(s,e=>Xn(s,e,!0)),$b=s=>Jt(s,e=>Xn(s,e,!1)),Rb=s=>Jt(s,e=>Xn(s,e,!ut(s))),Ib=s=>Jt(s,e=>Xn(s,e,ut(s))),zb=s=>Jt(s,e=>q.cursor(s.lineBlockAt(e.head).from,1)),jb=s=>Jt(s,e=>q.cursor(s.lineBlockAt(e.head).to,-1));function Vb(s,e,t){let n=!1,i=Bi(s.selection,r=>{let l=fn(s,r.head,-1)||fn(s,r.head,1)||r.head>0&&fn(s,r.head-1,1)||r.headVb(s,e,!1);function zt(s,e){let t=Bi(s.state.selection,n=>{let i=e(n);return q.range(n.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return t.eq(s.state.selection)?!1:(s.dispatch(gn(s.state,t)),!0)}function ip(s,e){return zt(s,t=>s.moveByChar(t,e))}const sp=s=>ip(s,!ut(s)),rp=s=>ip(s,ut(s));function lp(s,e){return zt(s,t=>s.moveByGroup(t,e))}const Fb=s=>lp(s,!ut(s)),Wb=s=>lp(s,ut(s)),qb=s=>zt(s,e=>Fr(s.state,e,!ut(s))),Ub=s=>zt(s,e=>Fr(s.state,e,ut(s)));function op(s,e){return zt(s,t=>s.moveVertically(t,e))}const ap=s=>op(s,!1),hp=s=>op(s,!0);function cp(s,e){return zt(s,t=>s.moveVertically(t,e,tp(s).height))}const rc=s=>cp(s,!1),lc=s=>cp(s,!0),Kb=s=>zt(s,e=>Xn(s,e,!0)),Jb=s=>zt(s,e=>Xn(s,e,!1)),Gb=s=>zt(s,e=>Xn(s,e,!ut(s))),Yb=s=>zt(s,e=>Xn(s,e,ut(s))),Xb=s=>zt(s,e=>q.cursor(s.lineBlockAt(e.head).from)),Zb=s=>zt(s,e=>q.cursor(s.lineBlockAt(e.head).to)),oc=({state:s,dispatch:e})=>(e(gn(s,{anchor:0})),!0),ac=({state:s,dispatch:e})=>(e(gn(s,{anchor:s.doc.length})),!0),hc=({state:s,dispatch:e})=>(e(gn(s,{anchor:s.selection.main.anchor,head:0})),!0),cc=({state:s,dispatch:e})=>(e(gn(s,{anchor:s.selection.main.anchor,head:s.doc.length})),!0),Qb=({state:s,dispatch:e})=>(e(s.update({selection:{anchor:0,head:s.doc.length},userEvent:"select"})),!0),e_=({state:s,dispatch:e})=>{let t=Wr(s).map(({from:n,to:i})=>q.range(n,Math.min(i+1,s.doc.length)));return e(s.update({selection:q.create(t),userEvent:"select"})),!0},t_=({state:s,dispatch:e})=>{let t=Bi(s.selection,n=>{var i;let r=Pt(s).resolveStack(n.from,1);for(let l=r;l;l=l.next){let{node:o}=l;if((o.from=n.to||o.to>n.to&&o.from<=n.from)&&(!((i=o.parent)===null||i===void 0)&&i.parent))return q.range(o.to,o.from)}return n});return e(gn(s,t)),!0},n_=({state:s,dispatch:e})=>{let t=s.selection,n=null;return t.ranges.length>1?n=q.create([t.main]):t.main.empty||(n=q.create([q.cursor(t.main.head)])),n?(e(gn(s,n)),!0):!1};function Ts(s,e){if(s.state.readOnly)return!1;let t="delete.selection",{state:n}=s,i=n.changeByRange(r=>{let{from:l,to:o}=r;if(l==o){let a=e(r);al&&(t="delete.forward",a=Xs(s,a,!0)),l=Math.min(l,a),o=Math.max(o,a)}else l=Xs(s,l,!1),o=Xs(s,o,!0);return l==o?{range:r}:{changes:{from:l,to:o},range:q.cursor(l,li(s)))n.between(e,e,(i,r)=>{ie&&(e=t?r:i)});return e}const fp=(s,e)=>Ts(s,t=>{let n=t.from,{state:i}=s,r=i.doc.lineAt(n),l,o;if(!e&&n>r.from&&nfp(s,!1),up=s=>fp(s,!0),dp=(s,e)=>Ts(s,t=>{let n=t.head,{state:i}=s,r=i.doc.lineAt(n),l=i.charCategorizer(n);for(let o=null;;){if(n==(e?r.to:r.from)){n==t.head&&r.number!=(e?i.doc.lines:1)&&(n+=e?1:-1);break}let a=mt(r.text,n-r.from,e)+r.from,h=r.text.slice(Math.min(n,a)-r.from,Math.max(n,a)-r.from),c=l(h);if(o!=null&&c!=o)break;(h!=" "||n!=t.head)&&(o=c),n=a}return n}),pp=s=>dp(s,!1),i_=s=>dp(s,!0),s_=s=>Ts(s,e=>{let t=s.lineBlockAt(e.head).to;return e.headTs(s,e=>{let t=s.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),l_=s=>Ts(s,e=>{let t=s.moveToLineBoundary(e,!0).head;return e.head{if(s.readOnly)return!1;let t=s.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:De.of(["",""])},range:q.cursor(n.from)}));return e(s.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},a_=({state:s,dispatch:e})=>{if(s.readOnly)return!1;let t=s.changeByRange(n=>{if(!n.empty||n.from==0||n.from==s.doc.length)return{range:n};let i=n.from,r=s.doc.lineAt(i),l=i==r.from?i-1:mt(r.text,i-r.from,!1)+r.from,o=i==r.to?i+1:mt(r.text,i-r.from,!0)+r.from;return{changes:{from:l,to:o,insert:s.doc.slice(i,o).append(s.doc.slice(l,i))},range:q.cursor(o)}});return t.changes.empty?!1:(e(s.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Wr(s){let e=[],t=-1;for(let n of s.selection.ranges){let i=s.doc.lineAt(n.from),r=s.doc.lineAt(n.to);if(!n.empty&&n.to==r.from&&(r=s.doc.lineAt(n.to-1)),t>=i.number){let l=e[e.length-1];l.to=r.to,l.ranges.push(n)}else e.push({from:i.from,to:r.to,ranges:[n]});t=r.number+1}return e}function mp(s,e,t){if(s.readOnly)return!1;let n=[],i=[];for(let r of Wr(s)){if(t?r.to==s.doc.length:r.from==0)continue;let l=s.doc.lineAt(t?r.to+1:r.from-1),o=l.length+1;if(t){n.push({from:r.to,to:l.to},{from:r.from,insert:l.text+s.lineBreak});for(let a of r.ranges)i.push(q.range(Math.min(s.doc.length,a.anchor+o),Math.min(s.doc.length,a.head+o)))}else{n.push({from:l.from,to:r.from},{from:r.to,insert:s.lineBreak+l.text});for(let a of r.ranges)i.push(q.range(a.anchor-o,a.head-o))}}return n.length?(e(s.update({changes:n,scrollIntoView:!0,selection:q.create(i,s.selection.mainIndex),userEvent:"move.line"})),!0):!1}const h_=({state:s,dispatch:e})=>mp(s,e,!1),c_=({state:s,dispatch:e})=>mp(s,e,!0);function gp(s,e,t){if(s.readOnly)return!1;let n=[];for(let i of Wr(s))t?n.push({from:i.from,insert:s.doc.slice(i.from,i.to)+s.lineBreak}):n.push({from:i.to,insert:s.lineBreak+s.doc.slice(i.from,i.to)});return e(s.update({changes:n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const f_=({state:s,dispatch:e})=>gp(s,e,!1),u_=({state:s,dispatch:e})=>gp(s,e,!0),d_=s=>{if(s.state.readOnly)return!1;let{state:e}=s,t=e.changes(Wr(e).map(({from:i,to:r})=>(i>0?i--:rs.moveVertically(i,!0)).map(t);return s.dispatch({changes:t,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function p_(s,e){if(/\(\)|\[\]|\{\}/.test(s.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=Pt(s).resolveInner(e),n=t.childBefore(e),i=t.childAfter(e),r;return n&&i&&n.to<=e&&i.from>=e&&(r=n.type.prop(ve.closedBy))&&r.indexOf(i.name)>-1&&s.doc.lineAt(n.to).from==s.doc.lineAt(i.from).from&&!/\S/.test(s.sliceDoc(n.to,i.from))?{from:n.to,to:i.from}:null}const m_=bp(!1),g_=bp(!0);function bp(s){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{let{from:r,to:l}=i,o=e.doc.lineAt(r),a=!s&&r==l&&p_(e,r);s&&(r=l=(l<=o.to?o:e.doc.lineAt(l)).to);let h=new zr(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=Uo(h,r);for(c==null&&(c=Ni(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));lo.from&&r{let i=[];for(let l=n.from;l<=n.to;){let o=s.doc.lineAt(l);o.number>t&&(n.empty||n.to>o.from)&&(e(o,i,n),t=o.number),l=o.to+1}let r=s.changes(i);return{changes:i,range:q.range(r.mapPos(n.anchor,1),r.mapPos(n.head,1))}})}const b_=({state:s,dispatch:e})=>{if(s.readOnly)return!1;let t=Object.create(null),n=new zr(s,{overrideIndentation:r=>{let l=t[r];return l??-1}}),i=Zo(s,(r,l,o)=>{let a=Uo(n,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=_s(s,a);(h!=c||o.froms.readOnly?!1:(e(s.update(Zo(s,(t,n)=>{n.push({from:t.from,insert:s.facet(Ir)})}),{userEvent:"input.indent"})),!0),kp=({state:s,dispatch:e})=>s.readOnly?!1:(e(s.update(Zo(s,(t,n)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let r=Ni(i,s.tabSize),l=0,o=_s(s,Math.max(0,r-yr(s)));for(;l({mac:s.key,run:s.run,shift:s.shift}))),v_=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Nb,shift:qb},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Bb,shift:Ub},{key:"Alt-ArrowUp",run:h_},{key:"Shift-Alt-ArrowUp",run:f_},{key:"Alt-ArrowDown",run:c_},{key:"Shift-Alt-ArrowDown",run:u_},{key:"Escape",run:n_},{key:"Mod-Enter",run:g_},{key:"Alt-l",mac:"Ctrl-l",run:e_},{key:"Mod-i",run:t_,preventDefault:!0},{key:"Mod-[",run:kp},{key:"Mod-]",run:_p},{key:"Mod-Alt-\\",run:b_},{key:"Shift-Mod-k",run:d_},{key:"Shift-Mod-\\",run:Hb},{key:"Mod-/",run:db},{key:"Alt-A",run:mb}].concat(k_),y_={key:"Tab",run:_p,shift:kp};let pt=[],w_=(s,e)=>{let t,n=[],i={lc:0,l:e||0,value:s,set(r){i.value=r,i.notify()},get(){return i.lc||i.listen(()=>{})(),i.value},notify(r){t=n;let l=!pt.length;for(let o=0;o{n===t&&(n=n.slice());let o=n.indexOf(r);~o&&(n.splice(o,2),i.lc--,i.lc||i.off())}},subscribe(r,l){let o=i.listen(r,l);return r(i.value),o},off(){}};return i},S_=(s={})=>{let e=w_(s);return e.setKey=function(t,n){typeof n>"u"?t in e.value&&(e.value={...e.value},delete e.value[t],e.notify(t)):e.value[t]!==n&&(e.value={...e.value,[t]:n},e.notify(t))},e};var x_=()=>S_({view:null,extensions:null,value:null}),A_=(s,e)=>{if(Fn(e))throw new Error("No options provided. At least `value` is required.");let{value:t,instanceStore:n,onChangeBehavior:i={kind:"debounce",duration:50}}=e,r,l=new Promise(E=>r=E),o,a=[];const h=new Lt,c=new Lt,f=new Lt,u=new Lt,d=new Lt,p=new Lt,m=new Lt,g=new Lt,b=ae.updateListener.of(E=>N(E));async function v(E){return Promise.all([b,p.of(bc(E)),m.of(await mc(E)),h.of(await fc(E)??[]),cd.of([...v_,...E.useTabs?[y_]:[]]),c.of(await uc(E)),f.of(dc(E)),u.of(await pc(E)),d.of(gc(E)),g.of(await _c(E))])}function O(E){const V=o.state.doc.toString();vi(V,t)||(t=V,s.dispatchEvent(new CustomEvent("codemirror:textChange",{detail:t}))),n==null||n.set({value:t,view:o,extensions:a}),s.dispatchEvent(new CustomEvent("codemirror:change",{detail:E}))}const{kind:M="debounce",duration:B=50}=i;let N=M==="debounce"?kc(O,B):vc(O,B);return(async()=>{a=await v(e);const E=ye.create({doc:t,extensions:a,selection:{anchor:e.cursorPos??0,head:e.cursorPos??0}});o=new ae({state:E,parent:s}),Fn(e.cursorPos)||o.focus(),r()})(),{async update(E){var D,C;await l;const V={};vi(t,E.value)||(t=E.value,V.changes={from:0,to:o.state.doc.length,insert:t}),!Fn(E.cursorPos)&&!vi(e.cursorPos,E.cursorPos)&&(V.selection={anchor:E.cursorPos??0,head:E.cursorPos??0},o.focus());async function $(W,ne,Y){V.effects=V.effects??[];const he=V.effects;let j=!0;for(const fe of ne){const ge=E[fe],Re=e[fe];if(!Fn(ge)&&(j=!1,!vi(ge,Re)))return he.push(W.reconfigure(await Y(E)))}j&&he.push(W.reconfigure([]))}await Promise.all([$(h,["setup"],fc),$(c,["lang"],uc),$(u,["useTabs","tabSize"],pc),$(f,["theme"],dc),$(p,["extensions"],bc),$(d,["readonly"],gc),$(m,["autocomplete"],mc),$(g,["lint","lintOptions"],_c)]),o.dispatch(V);const{kind:F="debounce",duration:R=50}=E.onChangeBehavior??{kind:"debounce",duration:50};(!vi((D=e.onChangeBehavior)==null?void 0:D.kind,F)||!vi((C=e.onChangeBehavior)==null?void 0:C.duration,R))&&(N=F==="debounce"?kc(O,R):vc(O,R)),e=E,a=await v(E)},destroy(){l.then(()=>o==null?void 0:o.destroy())}}};async function fc(s){const{setup:e}=s;if(Fn(e))return[];if(e==="basic")return(await Mn(()=>import("./basic-setup-BJSL5TOQ.2cc7c9c3.js"),["./basic-setup-BJSL5TOQ.2cc7c9c3.js","./index.614fdcfc.js","./index.5d200881.js"],import.meta.url)).default(s);if(e==="minimal")return(await Mn(()=>import("./minimal-setup-Y523JPZT.101cfff5.js"),[],import.meta.url)).default(s);throw new Error("`setup` can only be `basic` or `minimal`. If you wish to provide another setup, pass through `extensions` prop.")}async function uc({lang:s,langMap:e}){if(Fn(s))return[];if(typeof s=="string"){if(!e)throw new Error("`langMap` is required when `lang` is a string.");if(!(s in e))throw new Error(`Language "${s}" is not defined in \`langMap\`.`);return await e[s]()}return s}function dc({theme:s,styles:e}){return[s,e&&ae.theme(e)].filter(Boolean)}async function pc({useTabs:s=!1,tabSize:e=2}){return[ye.tabSize.of(e),Ir.of(s?" ":" ".repeat(e))]}async function mc({autocomplete:s}){if(Fn(s))return[];const{autocompletion:e}=await Mn(()=>import("./index.614fdcfc.js"),[],import.meta.url);return e(typeof s=="object"&&s?s:{})}function gc({readonly:s}){return ye.readOnly.of(!!s)}function bc({extensions:s}){return s??[]}async function _c({lint:s,lintOptions:e={}}){if(Fn(s))return[];if(!C_(s))throw new Error("`lint` must be a function.");const{linter:t}=await Mn(()=>import("./index.5d200881.js").then(n=>n.i),[],import.meta.url);return t(s,e)}var vi=(s,e)=>s===e,Fn=s=>typeof s>"u",C_=s=>typeof s=="function";function kc(s,e,t=!1){let n;return function(...r){const l=this;n?clearTimeout(n):t&&s.apply(l,r),n=setTimeout(o,e||100);function o(){t||s.apply(l,r),n=null}}}function vc(s,e){let t,n=!1;function i(r){if(t){s.apply(r,t),setTimeout(i,e,r),t=null;return}n=!1}return function(...l){const o=this;if(n){t=l;return}s.apply(o,l),n=!0,setTimeout(i,e,o)}}function M_(s){let e;const t=s[7].default,n=Tt(t,s,s[6],null);return{c(){n&&n.c()},l(i){n&&n.l(i)},m(i,r){n&&n.m(i,r),e=!0},p(i,r){n&&n.p&&(!e||r&64)&&Et(n,t,i,i[6],e?Dt(t,i[6],r,null):Ot(i[6]),null)},i(i){e||(w(n,i),e=!0)},o(i){T(n,i),e=!1},d(i){n&&n.d(i)}}}function T_(s){let e,t=s[4](s[1])+"",n,i,r;return{c(){e=x("button"),n=I(t),this.h()},l(l){e=A(l,"BUTTON",{class:!0});var o=P(e);n=z(o,t),o.forEach(_),this.h()},h(){k(e,"class","svelte-1w145fq"),ie(e,"navigable",s[1].filename)},m(l,o){S(l,e,o),y(e,n),i||(r=[ue(e,"click",s[8]),ue(e,"keyup",s[9])],i=!0)},p(l,o){o&2&&t!==(t=l[4](l[1])+"")&&re(n,t),o&2&&ie(e,"navigable",l[1].filename)},i:de,o:de,d(l){l&&_(e),i=!1,Pn(r)}}}function E_(s){let e,t,n,i,r,l;const o=[T_,M_],a=[];function h(c,f){return c[1]?0:1}return t=h(s),n=a[t]=o[t](s),{c(){e=x("div"),n.c(),this.h()},l(c){e=A(c,"DIV",{class:!0});var f=P(e);n.l(f),f.forEach(_),this.h()},h(){k(e,"class",i="message "+s[0]+" svelte-1w145fq"),ie(e,"truncate",s[2])},m(c,f){S(c,e,f),a[t].m(e,null),l=!0},p(c,[f]){let u=t;t=h(c),t===u?a[t].p(c,f):(Se(),T(a[u],1,1,()=>{a[u]=null}),xe(),n=a[t],n?n.p(c,f):(n=a[t]=o[t](c),n.c()),w(n,1),n.m(e,null)),(!l||f&1&&i!==(i="message "+c[0]+" svelte-1w145fq"))&&k(e,"class",i),(!l||f&5)&&ie(e,"truncate",c[2])},i(c){l||(w(n),c&&Dr(()=>{l&&(r||(r=_a(e,va,{duration:100},!0)),r.run(1))}),l=!0)},o(c){T(n),c&&(r||(r=_a(e,va,{duration:100},!1)),r.run(0)),l=!1},d(c){c&&_(e),a[t].d(),c&&r&&r.end()}}}function O_(s,e,t){let{$$slots:n={},$$scope:i}=e,{kind:r="info"}=e,{details:l=void 0}=e,{filename:o=void 0}=e,{truncate:a=!1}=e;const{go_to_warning_pos:h}=di();function c(d){let p=d.message||"[missing message]",m=[];return d.filename&&d.filename!==o&&m.push(d.filename),d.start&&m.push(d.start.line,d.start.column),p+(m.length?` (${m.join(":")})`:"")}const f=()=>h(l),u=d=>d.key===" "&&h(l);return s.$$set=d=>{"kind"in d&&t(0,r=d.kind),"details"in d&&t(1,l=d.details),"filename"in d&&t(5,o=d.filename),"truncate"in d&&t(2,a=d.truncate),"$$scope"in d&&t(6,i=d.$$scope)},[r,l,a,h,c,o,i,n,f,u]}class Li extends _e{constructor(e){super(),ke(this,e,O_,E_,be,{kind:0,details:1,filename:5,truncate:2})}}const D_=ae.theme({"&":{color:"var(--sk-code-base)",backgroundColor:"transparent"},".cm-content":{caretColor:"var(--sk-theme-3)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--sk-theme-3)"},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"var(--sk-selection-color)"},".cm-panels":{backgroundColor:"var(--sk-back-2)",color:"var(--sk-text-2)"},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"var(--sk-theme-2)"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:"var(--sk-back-3)",border:"none"},".cm-activeLineGutter":{backgroundColor:"var(--sk-back-4)"},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:"var(--sk-back-3)"},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:"var(--sk-back-3)",borderBottomColor:"var(--sk-back-3)"},".cm-tooltip-autocomplete":{color:"var(--sk-text-2) !important",perspective:"1px","& > ul > li[aria-selected]":{backgroundColor:"var(--sk-back-4)",color:"var(--sk-text-1) !important"}}},{dark:!0}),P_=Ms.define([{tag:L.keyword,color:"var(--sk-code-keyword)"},{tag:[L.name,L.deleted,L.character,L.propertyName,L.macroName],color:"var(--sk-code-base)"},{tag:[L.function(L.variableName),L.labelName],color:"var(--sk-code-tags)"},{tag:[L.color,L.constant(L.name),L.standard(L.name)],color:"var(--sk-code-base)"},{tag:[L.definition(L.name),L.separator],color:"var(--sk-code-base)"},{tag:[L.typeName,L.className,L.number,L.changed,L.annotation,L.modifier,L.self,L.namespace],color:"var(--sk-code-tags)"},{tag:[L.operator,L.operatorKeyword,L.url,L.escape,L.regexp,L.link,L.special(L.string)],color:"var(--sk-code-base)"},{tag:[L.meta,L.comment],color:"var(--sk-code-comment)"},{tag:L.strong,fontWeight:"bold"},{tag:L.emphasis,fontStyle:"italic"},{tag:L.strikethrough,textDecoration:"line-through"},{tag:L.link,color:"var(--sk-code-base)",textDecoration:"underline"},{tag:L.heading,fontWeight:"bold",color:"var(--sk-text-1)"},{tag:[L.atom,L.bool],color:"var(--sk-code-atom)"},{tag:[L.processingInstruction,L.string,L.inserted],color:"var(--sk-code-string)"},{tag:L.invalid,color:"#ff008c"}]),yc=[D_,Z1(P_)];function wc(s){let e,t,n,i,r,l;return r=new Li({props:{kind:"info",$$slots:{default:[N_]},$$scope:{ctx:s}}}),{c(){e=x("pre"),t=I(s[5]),n=Q(),i=x("div"),U(r.$$.fragment),this.h()},l(o){e=A(o,"PRE",{style:!0,class:!0});var a=P(e);t=z(a,s[5]),a.forEach(_),n=ee(o),i=A(o,"DIV",{style:!0});var h=P(i);G(r.$$.fragment,h),h.forEach(_),this.h()},h(){it(e,"position","absolute"),it(e,"left","0"),it(e,"top","0"),k(e,"class","svelte-1s16tri"),it(i,"position","absolute"),it(i,"width","100%"),it(i,"bottom","0")},m(o,a){S(o,e,a),y(e,t),S(o,n,a),S(o,i,a),K(r,i,null),l=!0},p(o,a){(!l||a[0]&32)&&re(t,o[5]);const h={};a[1]&4&&(h.$$scope={dirty:a,ctx:o}),r.$set(h)},i(o){l||(w(r.$$.fragment,o),l=!0)},o(o){T(r.$$.fragment,o),l=!1},d(o){o&&(_(e),_(n),_(i)),J(r)}}}function N_(s){let e;return{c(){e=I("loading editor...")},l(t){e=z(t,"loading editor...")},m(t,n){S(t,e,n)},d(t){t&&_(e)}}}function B_(s){let e,t,n,i,r,l=!s[4].view&&wc(s);return{c(){e=x("div"),l&&l.c(),this.h()},l(o){e=A(o,"DIV",{class:!0});var a=P(e);l&&l.l(a),a.forEach(_),this.h()},h(){k(e,"class","codemirror-container svelte-1s16tri")},m(o,a){S(o,e,a),l&&l.m(e,null),n=!0,i||(r=[Uf(t=A_.call(null,e,{value:s[5],setup:"basic",useTabs:s[2],tabSize:2,theme:yc,readonly:s[1],cursorPos:s[7],lang:s[6],langMap:{js:Sc,json:xc,md:Ac,css:Cc,svelte:Mc},lint:s[0],lintOptions:{delay:200},autocomplete:s[3],extensions:[s[10]],instanceStore:s[9]})),ue(e,"codemirror:textChange",s[25])],i=!0)},p(o,a){o[4].view?l&&(Se(),T(l,1,1,()=>{l=null}),xe()):l?(l.p(o,a),a[0]&16&&w(l,1)):(l=wc(o),l.c(),w(l,1),l.m(e,null)),t&&Jf(t.update)&&a[0]&239&&t.update.call(null,{value:o[5],setup:"basic",useTabs:o[2],tabSize:2,theme:yc,readonly:o[1],cursorPos:o[7],lang:o[6],langMap:{js:Sc,json:xc,md:Ac,css:Cc,svelte:Mc},lint:o[0],lintOptions:{delay:200},autocomplete:o[3],extensions:[o[10]],instanceStore:o[9]})},i(o){n||(w(l),n=!0)},o(o){T(l),n=!1},d(o){o&&_(e),l&&l.d(),i=!1,Pn(r)}}}const vp=ot(0),Sc=()=>Mn(()=>import("./index.e147cb76.js").then(s=>s.i),["./index.e147cb76.js","./index.550c9230.js","./scheduler.8d4e2d99.js","./index.614fdcfc.js"],import.meta.url).then(s=>s.javascript()),xc=()=>Mn(()=>import("./index.9f306bca.js"),["./index.9f306bca.js","./index.550c9230.js","./scheduler.8d4e2d99.js"],import.meta.url).then(s=>s.json()),Ac=()=>Mn(()=>import("./index.2515104d.js"),["./index.2515104d.js","./index.614fdcfc.js","./index.5e7c3b16.js","./index.550c9230.js","./scheduler.8d4e2d99.js","./index.126efea4.js","./index.e147cb76.js"],import.meta.url).then(s=>s.markdown()),Cc=()=>Mn(()=>import("./index.126efea4.js"),["./index.126efea4.js","./index.550c9230.js","./scheduler.8d4e2d99.js"],import.meta.url).then(s=>s.css()),Mc=()=>Mn(()=>import("./index.047ec805.js"),["./index.047ec805.js","./index.550c9230.js","./scheduler.8d4e2d99.js","./index.126efea4.js","./index.e147cb76.js","./index.614fdcfc.js","./index.5e7c3b16.js"],import.meta.url).then(s=>s.svelte());function L_(s,e,t){let n,{errorLoc:i=null}=e,{diagnostics:r=void 0}=e,{readonly:l=!1}=e,{tab:o=!0}=e,{autocomplete:a=!0}=e;const h=Pr();let c="",f="svelte";async function u(j){d(j)}async function d(j){if(n.view&&(await as(),j.lang&&j.lang!==f&&t(6,f=j.lang),j.code!==void 0)){const{scrollLeft:fe,scrollTop:ge}=n.view.scrollDOM;t(5,c=j.code),Ve(F,n.view.scrollDOM.scrollTop=ge,n),Ve(F,n.view.scrollDOM.scrollLeft=fe,n)}}function p(j){t(7,ne=j)}let m;const g=new Promise(j=>t(23,m=j));function b(){var j;(j=n.view)==null||j.requestMeasure()}function v(){var j;(j=n.view)==null||j.focus()}function O(){var j;return(j=n.view)==null?void 0:j.state.toJSON({history:ic})}function M(j){var fe;n.view&&(n.view.setState(ye.fromJSON(j,{extensions:W,doc:j.doc},{history:ic})),(fe=n.view)==null||fe.dispatch({changes:{from:0,to:n.view.state.doc.length,insert:j.doc},effects:[Ne.reconfigure.of(n.extensions??[])]}))}async function B(){var j,fe;await as(),(j=n.view)==null||j.setState(ye.create({extensions:W,doc:""})),(fe=n.view)==null||fe.dispatch({changes:{from:0,to:n.view.state.doc.length,insert:""},effects:[Ne.reconfigure.of(n.extensions??[])]})}const N=Ne.define(),E=Nt.define({create(){return Be.none},update(j,fe){j=j.map(fe.changes);for(let ge of fe.effects)ge.is(N)&&(j=j.update({add:ge.value,sort:!0}));return j},provide:j=>ae.decorations.from(j)});function V({from:j,to:fe,className:ge="mark-text"}){var we;const Re=Be.mark({class:ge});(we=n.view)==null||we.dispatch({effects:[Ne.appendConfig.of(E),N.of([Re.range(j,fe)])]})}function $(){var j;(j=n.view)==null||j.dispatch({effects:Ne.reconfigure.of(n.extensions??[])})}const F=x_();Me(s,F,j=>t(4,n=j));let R,D,C=!1,W=[],ne=0;const Y=ae.updateListener.of(j=>{j.selectionSet&&vp.set(j.state.selection.main.head)}),he=({detail:j})=>{t(5,c=j),h("change",{value:c})};return s.$$set=j=>{"errorLoc"in j&&t(11,i=j.errorLoc),"diagnostics"in j&&t(0,r=j.diagnostics),"readonly"in j&&t(1,l=j.readonly),"tab"in j&&t(2,o=j.tab),"autocomplete"in j&&t(3,a=j.autocomplete)},s.$$.update=()=>{s.$$.dirty[0]&8388624&&n.view&&m(),s.$$.dirty[0]&16&&n.view&&R&&D&&b(),s.$$.dirty[0]&16779264&&i&&(V({from:i.character,to:i.character+1,className:"error-loc"}),i.line)},[r,l,o,a,n,c,f,ne,h,F,Y,i,u,d,p,g,b,v,O,M,B,V,$,m,C,he]}class qr extends _e{constructor(e){super(),ke(this,e,L_,B_,be,{errorLoc:11,diagnostics:0,readonly:1,tab:2,autocomplete:3,set:12,update:13,setCursor:14,isReady:15,resize:16,focus:17,getEditorState:18,setEditorState:19,clearEditorState:20,markText:21,unmarkText:22},null,[-1,-1])}get set(){return this.$$.ctx[12]}get update(){return this.$$.ctx[13]}get setCursor(){return this.$$.ctx[14]}get isReady(){return this.$$.ctx[15]}get resize(){return this.$$.ctx[16]}get focus(){return this.$$.ctx[17]}get getEditorState(){return this.$$.ctx[18]}get setEditorState(){return this.$$.ctx[19]}get clearEditorState(){return this.$$.ctx[20]}get markText(){return this.$$.ctx[21]}get unmarkText(){return this.$$.ctx[22]}}function Tc(s,e,t){const n=s.slice();return n[17]=e[t],n}function $_(s){let e,t,n=Oe(s[3]),i=[];for(let l=0;lT(i[l],1,1,()=>{i[l]=null});return{c(){for(let l=0;l0?1:-1}return~(l=u(s))&&(o=f[l]=c[l](s)),{c(){e=x("div"),t=x("div"),U(n.$$.fragment),i=Q(),r=x("div"),o&&o.c(),this.h()},l(d){e=A(d,"DIV",{class:!0});var p=P(e);t=A(p,"DIV",{class:!0,translate:!0});var m=P(t);G(n.$$.fragment,m),m.forEach(_),i=ee(p),r=A(p,"DIV",{class:!0});var g=P(r);o&&o.l(g),g.forEach(_),p.forEach(_),this.h()},h(){k(t,"class","editor notranslate svelte-62nfk2"),k(t,"translate","no"),k(r,"class","info svelte-62nfk2"),k(e,"class","editor-wrapper svelte-62nfk2")},m(d,p){S(d,e,p),y(e,t),K(n,t,null),y(e,i),y(e,r),~l&&f[l].m(r,null),a=!0},p(d,[p]){const m={};p&1&&(m.errorLoc=d[0]),p&2&&(m.autocomplete=d[1]),n.$set(m);let g=l;l=u(d),l===g?~l&&f[l].p(d,p):(o&&(Se(),T(f[g],1,1,()=>{f[g]=null}),xe()),~l?(o=f[l],o?o.p(d,p):(o=f[l]=c[l](d),o.c()),w(o,1),o.m(r,null)):o=null)},i(d){a||(w(n.$$.fragment,d),w(o),a=!0)},o(d){T(n.$$.fragment,d),T(o),a=!1},d(d){d&&_(e),s[15](null),J(n),~l&&f[l].d()}}}function z_(s,e,t){let n,i,r,l,o,{errorLoc:a=null}=e,{autocomplete:h}=e;function c(){o==null||o.focus()}const{bundle:f,handle_change:u,module_editor:d,selected:p,bundling:m}=di();Me(s,f,M=>t(14,l=M)),Me(s,d,M=>t(5,o=M)),Me(s,p,M=>t(13,i=M)),Me(s,m,M=>t(16,r=M));let g=null,b=[];async function v(){return await r,[...i&&(g==null?void 0:g.filename)===$e(i)?[{from:g.start.character,to:g.end.character,severity:"error",message:g.message}]:[],...b.filter(M=>i&&M.filename===$e(i)).map(M=>({from:M.start.character,to:M.end.character,severity:"warning",message:M.message}))]}function O(M){Ye[M?"unshift":"push"](()=>{o=M,d.set(o)})}return s.$$set=M=>{"errorLoc"in M&&t(0,a=M.errorLoc),"autocomplete"in M&&t(1,h=M.autocomplete)},s.$$.update=()=>{s.$$.dirty&8192&&t(4,n=(i==null?void 0:i.name)+"."+(i==null?void 0:i.type)),s.$$.dirty&16384&&l&&(t(2,g=l==null?void 0:l.error),t(3,b=(l==null?void 0:l.warnings)??[]))},[a,h,g,b,n,o,f,u,d,p,m,v,c,i,l,O]}class j_ extends _e{constructor(e){super(),ke(this,e,z_,I_,be,{errorLoc:0,autocomplete:1,focus:12})}get focus(){return this.$$.ctx[12]}}function V_(s){let e,t,n;return{c(){e=x("input"),this.h()},l(i){e=A(i,"INPUT",{type:!0,class:!0}),this.h()},h(){k(e,"type","checkbox"),k(e,"class","svelte-1ja98dc")},m(i,r){S(i,e,r),e.checked=s[0],t||(n=ue(e,"change",s[1]),t=!0)},p(i,[r]){r&1&&(e.checked=i[0])},i:de,o:de,d(i){i&&_(e),t=!1,n()}}}function H_(s,e,t){let{checked:n=!1}=e;function i(){n=this.checked,t(0,n)}return s.$$set=r=>{"checked"in r&&t(0,n=r.checked)},[n,i]}class yi extends _e{constructor(e){super(),ke(this,e,H_,V_,be,{checked:0})}}function F_(s){let e,t,n="input",i,r,l,o,a,h,c="output",f;function u(p){s[1](p)}let d={};return s[0]!==void 0&&(d.checked=s[0]),l=new yi({props:d}),Ye.push(()=>on(l,"checked",u)),{c(){e=x("label"),t=x("span"),t.textContent=n,i=Q(),r=x("span"),U(l.$$.fragment),a=Q(),h=x("span"),h.textContent=c,this.h()},l(p){e=A(p,"LABEL",{class:!0});var m=P(e);t=A(m,"SPAN",{style:!0,class:!0,"data-svelte-h":!0}),Te(t)!=="svelte-iwcvz2"&&(t.textContent=n),i=ee(m),r=A(m,"SPAN",{style:!0,class:!0});var g=P(r);G(l.$$.fragment,g),g.forEach(_),a=ee(m),h=A(m,"SPAN",{class:!0,"data-svelte-h":!0}),Te(h)!=="svelte-4pjs0t"&&(h.textContent=c),m.forEach(_),this.h()},h(){it(t,"text-align","right"),k(t,"class","svelte-l6oyfu"),ie(t,"active",!s[0]),it(r,"display","grid"),it(r,"place-items","center"),k(r,"class","svelte-l6oyfu"),k(h,"class","svelte-l6oyfu"),ie(h,"active",s[0]),k(e,"class","input-output-toggle svelte-l6oyfu")},m(p,m){S(p,e,m),y(e,t),y(e,i),y(e,r),K(l,r,null),y(e,a),y(e,h),f=!0},p(p,[m]){(!f||m&1)&&ie(t,"active",!p[0]);const g={};!o&&m&1&&(o=!0,g.checked=p[0],ln(()=>o=!1)),l.$set(g),(!f||m&1)&&ie(h,"active",p[0])},i(p){f||(w(l.$$.fragment,p),f=!0)},o(p){T(l.$$.fragment,p),f=!1},d(p){p&&_(e),J(l)}}}function W_(s,e,t){let{checked:n=!1}=e;function i(r){n=r,t(0,n)}return s.$$set=r=>{"checked"in r&&t(0,n=r.checked)},[n,i]}class q_ extends _e{constructor(e){super(),ke(this,e,W_,F_,be,{checked:0})}}function Qo(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Zn=Qo();function yp(s){Zn=s}const wp=/[&<>"']/,U_=new RegExp(wp.source,"g"),Sp=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,K_=new RegExp(Sp.source,"g"),J_={"&":"&","<":"<",">":">",'"':""","'":"'"},Oc=s=>J_[s];function at(s,e){if(e){if(wp.test(s))return s.replace(U_,Oc)}else if(Sp.test(s))return s.replace(K_,Oc);return s}const G_=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function xp(s){return s.replace(G_,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const Y_=/(^|[^\[])\^/g;function Le(s,e){s=typeof s=="string"?s:s.source,e=e||"";const t={replace:(n,i)=>(i=i.source||i,i=i.replace(Y_,"$1"),s=s.replace(n,i),t),getRegex:()=>new RegExp(s,e)};return t}const X_=/[^\w:]/g,Z_=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Dc(s,e,t){if(s){let n;try{n=decodeURIComponent(xp(t)).replace(X_,"").toLowerCase()}catch{return null}if(n.indexOf("javascript:")===0||n.indexOf("vbscript:")===0||n.indexOf("data:")===0)return null}e&&!Z_.test(t)&&(t=nk(e,t));try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}const Zs={},Q_=/^[^:]+:\/*[^/]*$/,ek=/^([^:]+:)[\s\S]*$/,tk=/^([^:]+:\/*[^/]*)[\s\S]*$/;function nk(s,e){Zs[" "+s]||(Q_.test(s)?Zs[" "+s]=s+"/":Zs[" "+s]=hr(s,"/",!0)),s=Zs[" "+s];const t=s.indexOf(":")===-1;return e.substring(0,2)==="//"?t?e:s.replace(ek,"$1")+e:e.charAt(0)==="/"?t?e:s.replace(tk,"$1")+e:s+e}const Ar={exec:function(){}};function Pc(s,e){const t=s.replace(/\|/g,(r,l,o)=>{let a=!1,h=l;for(;--h>=0&&o[h]==="\\";)a=!a;return a?"|":" |"}),n=t.split(/ \|/);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>e)n.splice(e);else for(;n.length{let{doc:i}=t.state,r=ns(e[0],0);if(r==9){let l=i.lineAt(n),o=t.state.tabSize,a=Ni(l.text,o,n-l.from);return Be.replace({widget:new D0((o-a%o)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=Be.replace({widget:new O0(s,r)}))},boundary:s.replaceTabs?void 0:/[^]/})}update(s){let e=s.state.facet(lr);s.startState.facet(lr)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(s.view)):this.decorations=this.decorator.updateDeco(s,this.decorations)}},{decorations:s=>s.decorations}))}const T0="•";function E0(s){return s>=32?T0:s==10?"␤":String.fromCharCode(9216+s)}class O0 extends pi{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=E0(this.code),n=e.state.phrase("Control character")+" "+(A0[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,n,t);if(i)return i;let r=document.createElement("span");return r.textContent=t,r.title=n,r.setAttribute("aria-label",n),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class D0 extends pi{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 dS(){return N0}const P0=Be.line({class:"cm-activeLine"}),N0=rt.fromClass(class{constructor(s){this.decorations=this.getDeco(s)}update(s){(s.docChanged||s.selectionSet)&&(this.decorations=this.getDeco(s.view))}getDeco(s){let e=-1,t=[];for(let n of s.state.selection.ranges){let i=s.lineBlockAt(n.head);i.from>e&&(t.push(P0.range(i.from)),e=i.from)}return Be.set(t)}},{decorations:s=>s.decorations}),fo=2e3;function B0(s,e,t){let n=Math.min(e.line,t.line),i=Math.max(e.line,t.line),r=[];if(e.off>fo||t.off>fo||e.col<0||t.col<0){let l=Math.min(e.off,t.off),o=Math.max(e.off,t.off);for(let a=n;a<=i;a++){let h=s.doc.line(a);h.length<=o&&r.push(q.range(h.from+l,h.to+o))}}else{let l=Math.min(e.col,t.col),o=Math.max(e.col,t.col);for(let a=n;a<=i;a++){let h=s.doc.line(a),c=Fl(h.text,l,s.tabSize,!0);if(c<0)r.push(q.cursor(h.to));else{let f=Fl(h.text,o,s.tabSize);r.push(q.range(h.from+c,h.from+f))}}}return r}function L0(s,e){let t=s.coordsAtPos(s.viewport.from);return t?Math.round(Math.abs((t.left-e)/s.defaultCharacterWidth)):-1}function Ph(s,e){let t=s.posAtCoords({x:e.clientX,y:e.clientY},!1),n=s.state.doc.lineAt(t),i=t-n.from,r=i>fo?-1:i==n.length?L0(s,e.clientX):Ni(n.text,s.state.tabSize,t-n.from);return{line:n.number,col:r,off:i}}function $0(s,e){let t=Ph(s,e),n=s.state.selection;return t?{update(i){if(i.docChanged){let r=i.changes.mapPos(i.startState.doc.line(t.line).from),l=i.state.doc.lineAt(r);t={line:l.number,col:t.col,off:Math.min(t.off,l.length)},n=n.map(i.changes)}},get(i,r,l){let o=Ph(s,i);if(!o)return n;let a=B0(s.state,t,o);return a.length?l?q.create(a.concat(n.ranges)):q.create(a):n}}:null}function pS(s){let e=(s==null?void 0:s.eventFilter)||(t=>t.altKey&&t.button==0);return ae.mouseSelectionStyle.of((t,n)=>e(n)?$0(t,n):null)}const R0={Alt:[18,s=>!!s.altKey],Control:[17,s=>!!s.ctrlKey],Shift:[16,s=>!!s.shiftKey],Meta:[91,s=>!!s.metaKey]},I0={style:"cursor: crosshair"};function mS(s={}){let[e,t]=R0[s.key||"Alt"],n=rt.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[n,ae.contentAttributes.of(i=>{var r;return!((r=i.plugin(n))===null||r===void 0)&&r.isDown?I0:null})]}const Ui="-10000px";class _d{constructor(e,t,n,i){this.facet=t,this.createTooltipView=n,this.removeTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(l=>l);let r=null;this.tooltipViews=this.tooltips.map(l=>r=n(l,r))}update(e,t){var n;let i=e.state.facet(this.facet),r=i.filter(a=>a);if(i===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let l=[],o=t?[]:null;for(let a=0;at[h]=a),t.length=o.length),this.input=i,this.tooltips=r,this.tooltipViews=l,!0}}function z0(s){let{win:e}=s;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const vl=le.define({combine:s=>{var e,t,n;return{position:se.ios?"absolute":((e=s.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=s.find(i=>i.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((n=s.find(i=>i.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||z0}}}),Nh=new WeakMap,Ho=rt.fromClass(class{constructor(s){this.view=s,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=s.state.facet(vl);this.position=e.position,this.parent=e.parent,this.classes=s.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 _d(s,kd,(t,n)=>this.createTooltip(t,n),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(),s.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 s of this.manager.tooltipViews)this.intersectionObserver.observe(s.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(s){s.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(s,this.above);e&&this.observeIntersection();let t=e||s.geometryChanged,n=s.state.facet(vl);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;t=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.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(s,e){let t=s.create(this.view),n=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),s.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",t.dom.insertBefore(i,n)}return t.dom.style.position=this.position,t.dom.style.top=Ui,t.dom.style.left="0px",this.container.insertBefore(t.dom,n),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var s,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),(s=n.destroy)===null||s===void 0||s.call(n);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 s=this.view.dom.getBoundingClientRect(),e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(se.gecko)n=i.offsetParent!=this.container.ownerDocument.body;else if(i.style.top==Ui&&i.style.left=="0px"){let r=i.getBoundingClientRect();n=Math.abs(r.top+1e4)>1||Math.abs(r.left)>1}}if(n||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(e=i.width/this.parent.offsetWidth,t=i.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:s,parent:this.parent?this.container.getBoundingClientRect():s,pos:this.manager.tooltips.map((i,r)=>{let l=this.manager.tooltipViews[r];return l.getCoords?l.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(vl).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(s){var e;if(s.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let o of this.manager.tooltipViews)o.dom.style.position="absolute"}let{editor:t,space:n,scaleX:i,scaleY:r}=s,l=[];for(let o=0;o=Math.min(t.bottom,n.bottom)||f.rightMath.min(t.right,n.right)+.1){c.style.top=Ui;continue}let d=a.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,m=u.right-u.left,g=(e=Nh.get(h))!==null&&e!==void 0?e:u.bottom-u.top,b=h.offset||V0,v=this.view.textDirection==He.LTR,O=u.width>n.right-n.left?v?n.left:n.right-u.width:v?Math.min(f.left-(d?14:0)+b.x,n.right-m):Math.max(n.left,f.left-m+(d?14:0)-b.x),M=this.above[o];!a.strictSide&&(M?f.top-(u.bottom-u.top)-b.yn.bottom)&&M==n.bottom-f.bottom>f.top-n.top&&(M=this.above[o]=!M);let B=(M?f.top-n.top:n.bottom-f.bottom)-p;if(BO&&V.topN&&(N=M?V.top-g-2-p:V.bottom+p+2);if(this.position=="absolute"?(c.style.top=(N-s.parent.top)/r+"px",c.style.left=(O-s.parent.left)/i+"px"):(c.style.top=N/r+"px",c.style.left=O/i+"px"),d){let V=f.left+(v?b.x:-b.x)-(O+14-7);d.style.left=V/i+"px"}h.overlap!==!0&&l.push({left:O,top:N,right:E,bottom:N+g}),c.classList.toggle("cm-tooltip-above",M),c.classList.toggle("cm-tooltip-below",!M),h.positioned&&h.positioned(s.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 s of this.manager.tooltipViews)s.dom.style.top=Ui}},{eventObservers:{scroll(){this.maybeMeasure()}}}),j0=ae.baseTheme({".cm-tooltip":{zIndex:100,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:`${7*2}px`,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"}}}),V0={x:0,y:0},kd=le.define({enables:[Ho,j0]}),gr=le.define({combine:s=>s.reduce((e,t)=>e.concat(t),[])});class Rr{static create(e){return new Rr(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new _d(e,gr,(t,n)=>this.createHostedView(t,n),t=>t.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}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 n of this.manager.tooltipViews){let i=n[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 H0=kd.compute([gr],s=>{let e=s.facet(gr);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var n;return(n=t.end)!==null&&n!==void 0?n:t.pos})),create:Rr.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class F0{constructor(e,t,n,i,r){this.view=e,this.source=t,this.field=n,this.setHover=i,this.hoverTime=r,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;eo.bottom||t.xo.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(i)).find(c=>c.from<=i&&c.to>=i),h=a&&a.dir==He.RTL?-1:1;r=t.x{this.pending==o&&(this.pending=null,a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])}))},a=>An(e.state,a,"hover tooltip"))}else l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])})}get tooltip(){let e=this.view.plugin(Ho),t=e?e.manager.tooltips.findIndex(n=>n.create==Rr.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;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:r}=this;if(i.length&&r&&!W0(r.dom,e)||this.pending){let{pos:l}=i[0]||this.pending,o=(n=(t=i[0])===null||t===void 0?void 0:t.end)!==null&&n!==void 0?n:l;(l==o?this.view.posAtCoords(this.lastMove)!=l:!q0(this.view,l,o,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:n}=this;n&&n.dom.contains(e.relatedTarget)?this.watchTooltipLeave(n.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(n.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 qs=4;function W0(s,e){let t=s.getBoundingClientRect();return e.clientX>=t.left-qs&&e.clientX<=t.right+qs&&e.clientY>=t.top-qs&&e.clientY<=t.bottom+qs}function q0(s,e,t,n,i,r){let l=s.scrollDOM.getBoundingClientRect(),o=s.documentTop+s.documentPadding.top+s.contentHeight;if(l.left>n||l.righti||Math.min(l.bottom,o)=e&&a<=t}function gS(s,e={}){let t=Ne.define(),n=Nt.define({create(){return[]},update(i,r){if(i.length&&(e.hideOnChange&&(r.docChanged||r.selection)?i=[]:e.hideOn&&(i=i.filter(l=>!e.hideOn(r,l))),r.docChanged)){let l=[];for(let o of i){let a=r.changes.mapPos(o.pos,-1,vt.TrackDel);if(a!=null){let h=Object.assign(Object.create(null),o);h.pos=a,h.end!=null&&(h.end=r.changes.mapPos(h.end)),l.push(h)}}i=l}for(let l of r.effects)l.is(t)&&(i=l.value),l.is(U0)&&(i=[]);return i},provide:i=>gr.from(i)});return[n,rt.define(i=>new F0(i,s,n,t,e.hoverTime||300)),H0]}function bS(s,e){let t=s.plugin(Ho);if(!t)return null;let n=t.manager.tooltips.indexOf(e);return n<0?null:t.manager.tooltipViews[n]}const U0=Ne.define(),Bh=le.define({combine(s){let e,t;for(let n of s)e=e||n.topContainer,t=t||n.bottomContainer;return{topContainer:e,bottomContainer:t}}});function _S(s,e){let t=s.plugin(vd),n=t?t.specs.indexOf(e):-1;return n>-1?t.panels[n]:null}const vd=rt.fromClass(class{constructor(s){this.input=s.state.facet($h),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(s));let e=s.state.facet(Bh);this.top=new Us(s,!0,e.topContainer),this.bottom=new Us(s,!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(s){let e=s.state.facet(Bh);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Us(s.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Us(s.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=s.state.facet($h);if(t!=this.input){let n=t.filter(a=>a),i=[],r=[],l=[],o=[];for(let a of n){let h=this.specs.indexOf(a),c;h<0?(c=a(s.view),o.push(c)):(c=this.panels[h],c.update&&c.update(s)),i.push(c),(c.top?r:l).push(c)}this.specs=n,this.panels=i,this.top.sync(r),this.bottom.sync(l);for(let a of o)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let n of this.panels)n.update&&n.update(s)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:s=>ae.scrollMargins.of(e=>{let t=e.plugin(s);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Us{constructor(e,t,n){this.view=e,this.top=t,this.container=n,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=Lh(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Lh(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 Lh(s){let e=s.nextSibling;return s.remove(),e}const $h=le.define({enables:vd});class Dn extends Ei{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Dn.prototype.elementClass="";Dn.prototype.toDOM=void 0;Dn.prototype.mapMode=vt.TrackBefore;Dn.prototype.startSide=Dn.prototype.endSide=-1;Dn.prototype.point=!0;const or=le.define(),K0={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ee.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},ls=le.define();function J0(s){return[yd(),ls.of(Object.assign(Object.assign({},K0),s))]}const uo=le.define({combine:s=>s.some(e=>e)});function yd(s){let e=[G0];return s&&s.fixed===!1&&e.push(uo.of(!0)),e}const G0=rt.fromClass(class{constructor(s){this.view=s,this.prevViewport=s.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=s.state.facet(ls).map(e=>new Ih(s,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!s.state.facet(uo),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),s.scrollDOM.insertBefore(this.dom,s.contentDOM)}update(s){if(this.updateGutters(s)){let e=this.prevViewport,t=s.view.viewport,n=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(n<(t.to-t.from)*.8)}s.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(uo)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=s.view.viewport}syncGutters(s){let e=this.dom.nextSibling;s&&this.dom.remove();let t=Ee.iter(this.view.state.facet(or),this.view.viewport.from),n=[],i=this.gutters.map(r=>new Y0(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(r.type)){let l=!0;for(let o of r.type)if(o.type==gt.Text&&l){po(t,n,o.from);for(let a of i)a.line(this.view,o,n);l=!1}else if(o.widget)for(let a of i)a.widget(this.view,o)}else if(r.type==gt.Text){po(t,n,r.from);for(let l of i)l.line(this.view,r,n)}else if(r.widget)for(let l of i)l.widget(this.view,r);for(let r of i)r.finish();s&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(s){let e=s.startState.facet(ls),t=s.state.facet(ls),n=s.docChanged||s.heightChanged||s.viewportChanged||!Ee.eq(s.startState.facet(or),s.state.facet(or),s.view.viewport.from,s.view.viewport.to);if(e==t)for(let i of this.gutters)i.update(s)&&(n=!0);else{n=!0;let i=[];for(let r of t){let l=e.indexOf(r);l<0?i.push(new Ih(this.view,r)):(this.gutters[l].update(s),i.push(this.gutters[l]))}for(let r of this.gutters)r.dom.remove(),i.indexOf(r)<0&&r.destroy();for(let r of i)this.dom.appendChild(r.dom);this.gutters=i}return n}destroy(){for(let s of this.gutters)s.destroy();this.dom.remove()}},{provide:s=>ae.scrollMargins.of(e=>{let t=e.plugin(s);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==He.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function Rh(s){return Array.isArray(s)?s:[s]}function po(s,e,t){for(;s.value&&s.from<=t;)s.from==t&&e.push(s.value),s.next()}class Y0{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=Ee.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:i}=this,r=(t.top-this.height)/e.scaleY,l=t.height/e.scaleY;if(this.i==i.elements.length){let o=new wd(e,l,r,n);i.elements.push(o),i.dom.appendChild(o.dom)}else i.elements[this.i].update(e,l,r,n);this.height=t.bottom,this.i++}line(e,t,n){let i=[];po(this.cursor,i,t.from),n.length&&(i=i.concat(n));let r=this.gutter.config.lineMarker(e,t,i);r&&i.unshift(r);let l=this.gutter;i.length==0&&!l.config.renderEmptyElements||this.addElement(e,t,i)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t);n&&this.addElement(e,t,[n])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Ih{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 n in t.domEventHandlers)this.dom.addEventListener(n,i=>{let r=i.target,l;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let a=r.getBoundingClientRect();l=(a.top+a.bottom)/2}else l=i.clientY;let o=e.lineBlockAtHeight(l-e.documentTop);t.domEventHandlers[n](e,o,i)&&i.preventDefault()});this.markers=Rh(t.markers(e)),t.initialSpacer&&(this.spacer=new wd(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=Rh(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 n=e.view.viewport;return!Ee.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class wd{constructor(e,t,n,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,i)}update(e,t,n,i){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),X0(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,t){let n="cm-gutterElement",i=this.dom.firstChild;for(let r=0,l=0;;){let o=l,a=rr(o,a,h)||l(o,a,h):l}return n}})}});class yl extends Dn{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function wl(s,e){return s.state.facet(wi).formatNumber(e,s.state)}const Q0=ls.compute([wi],s=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(Z0)},lineMarker(e,t,n){return n.some(i=>i.toDOM)?null:new yl(wl(e,e.state.doc.lineAt(t.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(wi)!=e.state.facet(wi),initialSpacer(e){return new yl(wl(e,zh(e.state.doc.lines)))},updateSpacer(e,t){let n=wl(t.view,zh(t.view.state.doc.lines));return n==e.number?e:new yl(n)},domEventHandlers:s.facet(wi).domEventHandlers}));function kS(s={}){return[wi.of(s),yd(),Q0]}function zh(s){let e=9;for(;e{let e=[],t=-1;for(let n of s.selection.ranges){let i=s.doc.lineAt(n.head).from;i>t&&(t=i,e.push(e1.range(i)))}return Ee.of(e)});function vS(){return t1}const n1=1024;let i1=0;class $t{constructor(e,t){this.from=e,this.to=t}}class ve{constructor(e={}){this.id=i1++,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=wt.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}}ve.closedBy=new ve({deserialize:s=>s.split(" ")});ve.openedBy=new ve({deserialize:s=>s.split(" ")});ve.group=new ve({deserialize:s=>s.split(" ")});ve.isolate=new ve({deserialize:s=>{if(s&&s!="rtl"&&s!="ltr"&&s!="auto")throw new RangeError("Invalid value for isolate: "+s);return s||"auto"}});ve.contextHash=new ve({perNode:!0});ve.lookAhead=new ve({perNode:!0});ve.mounted=new ve({perNode:!0});class gs{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[ve.mounted.id]}}const s1=Object.create(null);class wt{constructor(e,t,n,i=0){this.name=e,this.props=t,this.id=n,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):s1,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new wt(e.name||"",t,e.id,n);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(i)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[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(ve.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let i of n.split(" "))t[i]=e[n];return n=>{for(let i=n.prop(ve.group),r=-1;r<(i?i.length:0);r++){let l=t[r<0?n.name:i[r]];if(l)return l}}}}wt.none=new wt("",Object.create(null),0,8);class Sd{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(l|We.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=i&&(!o&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&n&&(o||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;h=!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:qo(wt.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,i)=>new Ze(this.type,t,n,i,this.propValues),e.makeTree||((t,n,i)=>new Ze(wt.none,t,n,i)))}static build(e){return a1(e)}}Ze.empty=new Ze(wt.none,[],[],0);class Fo{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 Fo(this.buffer,this.index)}}class Jn{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return wt.none}toString(){let e=[];for(let t=0;t0));a=l[a+3]);return o}slice(e,t,n){let i=this.buffer,r=new Uint16Array(t-e),l=0;for(let o=e,a=0;o=e&&te;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function bs(s,e,t,n){for(var i;s.from==s.to||(t<1?s.from>=e:s.from>e)||(t>-1?s.to<=e:s.to0?o.length:-1;e!=h;e+=t){let c=o[e],f=a[e]+l.from;if(xd(i,n,f,f+c.length)){if(c instanceof Jn){if(r&We.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,n-f,i);if(u>-1)return new cn(new r1(l,c,e,f),null,u)}else if(r&We.IncludeAnonymous||!c.type.isAnonymous||Wo(c)){let u;if(!(r&We.IgnoreMounts)&&(u=gs.get(c))&&!u.overlay)return new ft(u.tree,f,e,l);let d=new ft(c,f,e,l);return r&We.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,n,i)}}}if(r&We.IncludeAnonymous||!l.type.isAnonymous||(l.index>=0?e=l.index+t:e=t<0?-1:l._parent._tree.children.length,l=l._parent,!l))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,n=0){let i;if(!(n&We.IgnoreOverlays)&&(i=gs.get(this._tree))&&i.overlay){let r=e-this.from;for(let{from:l,to:o}of i.overlay)if((t>0?l<=r:l=r:o>r))return new ft(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}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 Vh(s,e,t,n){let i=s.cursor(),r=[];if(!i.firstChild())return r;if(t!=null){for(let l=!1;!l;)if(l=i.type.is(t),!i.nextSibling())return r}for(;;){if(n!=null&&i.type.is(n))return r;if(i.type.is(e)&&r.push(i.node),!i.nextSibling())return n==null?r:[]}}function mo(s,e,t=e.length-1){for(let n=s.parent;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}class r1{constructor(e,t,n,i){this.parent=e,this.buffer=t,this.index=n,this.start=i}}class cn extends Ad{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,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new cn(this.context,this,r)}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,n=0){if(n&We.ExcludeBuffers)return null;let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new cn(this.context,this,r)}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 cn(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 cn(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,i=this.index+4,r=n.buffer[this.index+3];if(r>i){let l=n.buffer[this.index+1];e.push(n.slice(i,r,l)),t.push(0)}return new Ze(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Cd(s){if(!s.length)return null;let e=0,t=s[0];for(let r=1;rt.from||l.to=e){let o=new ft(l.tree,l.overlay[0].from+r.from,-1,r);(i||(i=[n])).push(bs(o,e,t,!1))}}return i?Cd(i):n}class br{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 ft)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.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:n,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return e?e instanceof ft?(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,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:i}=this.buffer,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,n);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}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,n=this.mode){return this.buffer?n&We.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&We.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&We.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,n=this.stack.length-1;if(e<0){let i=n<0?0:this.stack[n]+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<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(i)}return n<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,n,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let r=t+e,l=e<0?-1:n._tree.children.length;r!=l;r+=e){let o=n._tree.children[r];if(this.mode&We.IncludeAnonymous||o instanceof Jn||!o.type.isAnonymous||Wo(o))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=0;){for(let l=e;l;l=l._parent)if(l.index==i){if(i==this.index)return l;t=l,n=r+1;break e}i=this.stack[--r]}for(let i=n;i=0;r--){if(r<0)return mo(this.node,e,i);let l=n[t.buffer[this.stack[r]]];if(!l.isAnonymous){if(e[i]&&e[i]!=l.name)return!1;i--}}return!0}}function Wo(s){return s.children.some(e=>e instanceof Jn||!e.type.isAnonymous||Wo(e))}function a1(s){var e;let{buffer:t,nodeSet:n,maxBufferLength:i=n1,reused:r=[],minRepeatType:l=n.types.length}=s,o=Array.isArray(t)?new Fo(t,t.length):t,a=n.types,h=0,c=0;function f(B,N,E,V,$,F){let{id:R,start:D,end:C,size:W}=o,ne=c;for(;W<0;)if(o.next(),W==-1){let ge=r[R];E.push(ge),V.push(D-B);return}else if(W==-3){h=R;return}else if(W==-4){c=R;return}else throw new RangeError(`Unrecognized record size: ${W}`);let Y=a[R],he,j,fe=D-B;if(C-D<=i&&(j=g(o.pos-N,$))){let ge=new Uint16Array(j.size-j.skip),Re=o.pos-j.size,we=ge.length;for(;o.pos>Re;)we=b(j.start,ge,we);he=new Jn(ge,C-j.start,n),fe=j.start-B}else{let ge=o.pos-W;o.next();let Re=[],we=[],dt=R>=l?R:-1,X=0,pe=C;for(;o.pos>ge;)dt>=0&&o.id==dt&&o.size>=0?(o.end<=pe-i&&(p(Re,we,D,X,o.end,pe,dt,ne),X=Re.length,pe=o.end),o.next()):F>2500?u(D,ge,Re,we):f(D,ge,Re,we,dt,F+1);if(dt>=0&&X>0&&X-1&&X>0){let et=d(Y);he=qo(Y,Re,we,0,Re.length,0,C-D,et,et)}else he=m(Y,Re,we,C-D,ne-C)}E.push(he),V.push(fe)}function u(B,N,E,V){let $=[],F=0,R=-1;for(;o.pos>N;){let{id:D,start:C,end:W,size:ne}=o;if(ne>4)o.next();else{if(R>-1&&C=0;W-=3)D[ne++]=$[W],D[ne++]=$[W+1]-C,D[ne++]=$[W+2]-C,D[ne++]=ne;E.push(new Jn(D,$[2]-C,n)),V.push(C-B)}}function d(B){return(N,E,V)=>{let $=0,F=N.length-1,R,D;if(F>=0&&(R=N[F])instanceof Ze){if(!F&&R.type==B&&R.length==V)return R;(D=R.prop(ve.lookAhead))&&($=E[F]+R.length+D)}return m(B,N,E,V,$)}}function p(B,N,E,V,$,F,R,D){let C=[],W=[];for(;B.length>V;)C.push(B.pop()),W.push(N.pop()+E-$);B.push(m(n.types[R],C,W,F-$,D-F)),N.push($-E)}function m(B,N,E,V,$=0,F){if(h){let R=[ve.contextHash,h];F=F?[R].concat(F):[R]}if($>25){let R=[ve.lookAhead,$];F=F?[R].concat(F):[R]}return new Ze(B,N,E,V,F)}function g(B,N){let E=o.fork(),V=0,$=0,F=0,R=E.end-i,D={size:0,start:0,skip:0};e:for(let C=E.pos-B;E.pos>C;){let W=E.size;if(E.id==N&&W>=0){D.size=V,D.start=$,D.skip=F,F+=4,V+=4,E.next();continue}let ne=E.pos-W;if(W<0||ne=l?4:0,he=E.start;for(E.next();E.pos>ne;){if(E.size<0)if(E.size==-3)Y+=4;else break e;else E.id>=l&&(Y+=4);E.next()}$=he,V+=W,F+=Y}return(N<0||V==B)&&(D.size=V,D.start=$,D.skip=F),D.size>4?D:void 0}function b(B,N,E){let{id:V,start:$,end:F,size:R}=o;if(o.next(),R>=0&&V4){let C=o.pos-(R-4);for(;o.pos>C;)E=b(B,N,E)}N[--E]=D,N[--E]=F-B,N[--E]=$-B,N[--E]=V}else R==-3?h=V:R==-4&&(c=V);return E}let v=[],O=[];for(;o.pos>0;)f(s.start||0,s.bufferStart||0,v,O,-1,0);let M=(e=s.length)!==null&&e!==void 0?e:v.length?O[0]+v[0].length:0;return new Ze(a[s.topID],v.reverse(),O.reverse(),M)}const Hh=new WeakMap;function ar(s,e){if(!s.isAnonymous||e instanceof Jn||e.type!=s)return 1;let t=Hh.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=s||!(n instanceof Ze)){t=1;break}t+=ar(s,n)}Hh.set(e,t)}return t}function qo(s,e,t,n,i,r,l,o,a){let h=0;for(let p=n;p=c)break;N+=E}if(O==M+1){if(N>c){let E=p[M];d(E.children,E.positions,0,E.children.length,m[M]+v);continue}f.push(p[M])}else{let E=m[O-1]+p[O-1].length-B;f.push(qo(s,p,m,M,O,B,E,null,a))}u.push(B+v-r)}}return d(e,t,n,i,0),(o||a)(f,u,l)}class yS{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof cn?this.setBuffer(e.context.buffer,e.index,t):e instanceof ft&&this.map.set(e.tree,t)}get(e){return e instanceof cn?this.getBuffer(e.context.buffer,e.index):e instanceof ft?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 Cn{constructor(e,t,n,i,r=!1,l=!1){this.from=e,this.to=t,this.tree=n,this.offset=i,this.open=(r?1:0)|(l?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let i=[new Cn(0,e.length,e,0,!1,n)];for(let r of t)r.to>e.length&&i.push(r);return i}static applyChanges(e,t,n=128){if(!t.length)return e;let i=[],r=1,l=e.length?e[0]:null;for(let o=0,a=0,h=0;;o++){let c=o=n)for(;l&&l.from=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new Cn(d,p,u.tree,u.offset+h,o>0,!!c)}if(u&&i.push(u),l.to>f)break;l=rnew $t(i.from,i.to)):[new $t(0,0)]:[new $t(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let i=this.startParse(e,t,n);for(;;){let r=i.advance();if(r)return r}}};class c1{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 SS(s){return(e,t,n,i)=>new u1(e,s,t,n,i)}class Fh{constructor(e,t,n,i,r){this.parser=e,this.parse=t,this.overlay=n,this.target=i,this.from=r}}function Wh(s){if(!s.length||s.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(s))}class f1{constructor(e,t,n,i,r,l,o){this.parser=e,this.predicate=t,this.mounts=n,this.index=i,this.start=r,this.target=l,this.prev=o,this.depth=0,this.ranges=[]}}const go=new ve({perNode:!0});class u1{constructor(e,t,n,i,r){this.nest=t,this.input=n,this.fragments=i,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new Ze(n.type,n.children,n.positions,n.length,n.propValues.concat([[go,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[ve.mounted.id]=new gs(t,e.overlay,e.parser),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)o=!1;else if(e.hasNode(i)){if(t){let h=t.mounts.find(c=>c.frag.from<=i.from&&c.frag.to>=i.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=i.from&&u<=i.to&&!t.ranges.some(d=>d.fromf)&&t.ranges.push({from:f,to:u})}}o=!1}else if(n&&(l=d1(n.ranges,i.from,i.to)))o=l!=2;else if(!i.type.isAnonymous&&(r=this.nest(i,this.input))&&(i.fromnew $t(f.from-i.from,f.to-i.from)):null,i.tree,c.length?c[0].from:i.from)),r.overlay?c.length&&(n={ranges:c,depth:0,prev:n}):o=!1}}else t&&(a=t.predicate(i))&&(a===!0&&(a=new $t(i.from,i.to)),a.fromnew $t(c.from-t.start,c.to-t.start)),t.target,h[0].from))),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}}function d1(s,e,t){for(let n of s){if(n.from>=t)break;if(n.to>e)return n.from<=e&&n.to>=t?2:1}return 0}function qh(s,e,t,n,i,r){if(e=e&&t.enter(n,1,We.IgnoreOverlays|We.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 Ze)t=t.children[0];else break}return!1}}class m1{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(t=n.tree.prop(go))!==null&&t!==void 0?t:n.to,this.inner=new Uh(n.tree,-n.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(go))!==null&&e!==void 0?e:t.to,this.inner=new Uh(t.tree,-t.offset)}}findMounts(e,t){var n;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let l=(n=r.tree)===null||n===void 0?void 0:n.prop(ve.mounted);if(l&&l.parser==t)for(let o=this.fragI;o=r.to)break;a.tree==this.curFrag.tree&&i.push({frag:a,pos:r.from-a.offset,mount:l})}}}return i}}function Kh(s,e){let t=null,n=e;for(let i=1,r=0;i=o)break;a.to<=l||(t||(n=t=e.slice()),a.fromo&&t.splice(r+1,0,new $t(o,a.to))):a.to>o?t[r--]=new $t(o,a.to):t.splice(r--,1))}}return n}function g1(s,e,t,n){let i=0,r=0,l=!1,o=!1,a=-1e9,h=[];for(;;){let c=i==s.length?1e9:l?s[i].to:s[i].from,f=r==e.length?1e9:o?e[r].to:e[r].from;if(l!=o){let u=Math.max(a,t),d=Math.min(c,f,n);unew $t(u.from+n,u.to+n)),f=g1(e,c,a,h);for(let u=0,d=a;;u++){let p=u==f.length,m=p?h:f[u].from;if(m>d&&t.push(new Cn(d,m,i.tree,-l,r.from>=d||r.openStart,r.to<=m||r.openEnd)),p)break;d=f[u].to}}else t.push(new Cn(a,h,i.tree,-l,r.from>=l||r.openStart,r.to<=o||r.openEnd))}return t}let b1=0;class rn{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=b1++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new rn([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new _r;return t=>t.modified.indexOf(e)>-1?t:_r.get(t.base||t,t.modified.concat(e).sort((n,i)=>n.id-i.id))}}let _1=0;class _r{constructor(){this.instances=[],this.id=_1++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(o=>o.base==e&&k1(t,o.modified));if(n)return n;let i=[],r=new rn(i,e,t);for(let o of t)o.instances.push(r);let l=v1(t);for(let o of e.set)if(!o.modified.length)for(let a of l)i.push(_r.get(o,a));return r}}function k1(s,e){return s.length==e.length&&s.every((t,n)=>t==e[n])}function v1(s){let e=[[]];for(let t=0;tn.length-t.length)}function y1(s){let e=Object.create(null);for(let t in s){let n=s[t];Array.isArray(n)||(n=[n]);for(let i of t.split(" "))if(i){let r=[],l=2,o=i;for(let f=0;;){if(o=="..."&&f>0&&f+3==i.length){l=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!u)throw new RangeError("Invalid path: "+i);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==i.length)break;let d=i[f++];if(f==i.length&&d=="!"){l=0;break}if(d!="/")throw new RangeError("Invalid path: "+i);o=i.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+i);let c=new kr(n,l,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return Md.add(e)}const Md=new ve;class kr{constructor(e,t,n,i){this.tags=e,this.mode=t,this.context=n,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let l=i;for(let o of r)for(let a of o.set){let h=t[a.id];if(h){l=l?l+" "+h:h;break}}return l},scope:n}}function w1(s,e){let t=null;for(let n of s){let i=n.style(e);i&&(t=t?t+" "+i:i)}return t}function S1(s,e,t,n=0,i=s.length){let r=new x1(n,Array.isArray(e)?e:[e],t);r.highlightRange(s.cursor(),n,i,"",r.highlighters),r.flush(i)}class x1{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,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,n,i,r){let{type:l,from:o,to:a}=e;if(o>=n||a<=t)return;l.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(l)));let h=i,c=A1(e)||kr.empty,f=w1(r,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(t,o),h),c.opaque)return;let u=e.tree&&e.tree.prop(ve.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+o,1),p=this.highlighters.filter(g=>!g.scope||g.scope(u.tree.type)),m=e.firstChild();for(let g=0,b=o;;g++){let v=g=O||!e.nextSibling())););if(!v||O>n)break;b=v.to+o,b>t&&(this.highlightRange(d.cursor(),Math.max(t,v.from+o),Math.min(n,b),"",p),this.startSpan(Math.min(n,b),h))}m&&e.parent()}else if(e.firstChild()){u&&(i="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,i,r),this.startSpan(Math.min(n,e.to),h)}while(e.nextSibling());e.parent()}}}function A1(s){let e=s.type.prop(Md);for(;e&&e.context&&!s.matchContext(e.context);)e=e.next;return e||null}const Z=rn.define,Js=Z(),Rn=Z(),Gh=Z(Rn),Yh=Z(Rn),In=Z(),Gs=Z(In),Sl=Z(In),sn=Z(),ii=Z(sn),tn=Z(),nn=Z(),bo=Z(),Ki=Z(bo),Ys=Z(),L={comment:Js,lineComment:Z(Js),blockComment:Z(Js),docComment:Z(Js),name:Rn,variableName:Z(Rn),typeName:Gh,tagName:Z(Gh),propertyName:Yh,attributeName:Z(Yh),className:Z(Rn),labelName:Z(Rn),namespace:Z(Rn),macroName:Z(Rn),literal:In,string:Gs,docString:Z(Gs),character:Z(Gs),attributeValue:Z(Gs),number:Sl,integer:Z(Sl),float:Z(Sl),bool:Z(In),regexp:Z(In),escape:Z(In),color:Z(In),url:Z(In),keyword:tn,self:Z(tn),null:Z(tn),atom:Z(tn),unit:Z(tn),modifier:Z(tn),operatorKeyword:Z(tn),controlKeyword:Z(tn),definitionKeyword:Z(tn),moduleKeyword:Z(tn),operator:nn,derefOperator:Z(nn),arithmeticOperator:Z(nn),logicOperator:Z(nn),bitwiseOperator:Z(nn),compareOperator:Z(nn),updateOperator:Z(nn),definitionOperator:Z(nn),typeOperator:Z(nn),controlOperator:Z(nn),punctuation:bo,separator:Z(bo),bracket:Ki,angleBracket:Z(Ki),squareBracket:Z(Ki),paren:Z(Ki),brace:Z(Ki),content:sn,heading:ii,heading1:Z(ii),heading2:Z(ii),heading3:Z(ii),heading4:Z(ii),heading5:Z(ii),heading6:Z(ii),contentSeparator:Z(sn),list:Z(sn),quote:Z(sn),emphasis:Z(sn),strong:Z(sn),link:Z(sn),monospace:Z(sn),strikethrough:Z(sn),inserted:Z(),deleted:Z(),changed:Z(),invalid:Z(),meta:Ys,documentMeta:Z(Ys),annotation:Z(Ys),processingInstruction:Z(Ys),definition:rn.defineModifier(),constant:rn.defineModifier(),function:rn.defineModifier(),standard:rn.defineModifier(),local:rn.defineModifier(),special:rn.defineModifier()};Td([{tag:L.link,class:"tok-link"},{tag:L.heading,class:"tok-heading"},{tag:L.emphasis,class:"tok-emphasis"},{tag:L.strong,class:"tok-strong"},{tag:L.keyword,class:"tok-keyword"},{tag:L.atom,class:"tok-atom"},{tag:L.bool,class:"tok-bool"},{tag:L.url,class:"tok-url"},{tag:L.labelName,class:"tok-labelName"},{tag:L.inserted,class:"tok-inserted"},{tag:L.deleted,class:"tok-deleted"},{tag:L.literal,class:"tok-literal"},{tag:L.string,class:"tok-string"},{tag:L.number,class:"tok-number"},{tag:[L.regexp,L.escape,L.special(L.string)],class:"tok-string2"},{tag:L.variableName,class:"tok-variableName"},{tag:L.local(L.variableName),class:"tok-variableName tok-local"},{tag:L.definition(L.variableName),class:"tok-variableName tok-definition"},{tag:L.special(L.variableName),class:"tok-variableName2"},{tag:L.definition(L.propertyName),class:"tok-propertyName tok-definition"},{tag:L.typeName,class:"tok-typeName"},{tag:L.namespace,class:"tok-namespace"},{tag:L.className,class:"tok-className"},{tag:L.macroName,class:"tok-macroName"},{tag:L.propertyName,class:"tok-propertyName"},{tag:L.operator,class:"tok-operator"},{tag:L.comment,class:"tok-comment"},{tag:L.meta,class:"tok-meta"},{tag:L.invalid,class:"tok-invalid"},{tag:L.punctuation,class:"tok-punctuation"}]);var xl;const Si=new ve;function C1(s){return le.define({combine:s?e=>e.concat(s):void 0})}const M1=new ve;class qt{constructor(e,t,n=[],i=""){this.data=e,this.name=i,ye.prototype.hasOwnProperty("tree")||Object.defineProperty(ye.prototype,"tree",{get(){return Pt(this)}}),this.parser=t,this.extension=[Gn.of(this),ye.languageData.of((r,l,o)=>{let a=Xh(r,l,o),h=a.type.prop(Si);if(!h)return[];let c=r.facet(h),f=a.type.prop(M1);if(f){let u=a.resolve(l-a.from,o);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(n)}isActiveAt(e,t,n=-1){return Xh(e,t,n).type.prop(Si)==this.data}findRegions(e){let t=e.facet(Gn);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],i=(r,l)=>{if(r.prop(Si)==this.data){n.push({from:l,to:l+r.length});return}let o=r.prop(ve.mounted);if(o){if(o.tree.prop(Si)==this.data){if(o.overlay)for(let a of o.overlay)n.push({from:a.from+l,to:a.to+l});else n.push({from:l,to:l+r.length});return}else if(o.overlay){let a=n.length;if(i(o.tree,o.overlay[0].from+l),n.length>a)return}}for(let a=0;an.isTop?t:void 0)]}),e.name)}configure(e,t){return new _o(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Pt(s){let e=s.field(qt.state,!1);return e?e.tree:Ze.empty}class T1{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 n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let Ji=null;class vr{constructor(e,t,n=[],i,r,l,o,a){this.parser=e,this.state=t,this.fragments=n,this.tree=i,this.treeLen=r,this.viewport=l,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new vr(e,t,[],Ze.empty,0,n,[],null)}startParse(){return this.parser.startParse(new T1(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Ze.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;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.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(Cn.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Ji;Ji=this;try{return e()}finally{Ji=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Zh(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:i,treeLen:r,viewport:l,skipped:o}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),n=Cn.applyChanges(n,a),i=Ze.empty,r=0,l={from:e.mapPos(l.from,-1),to:e.mapPos(l.to,1)},this.skipped.length){o=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=Zh(this.fragments,i,r),this.skipped.splice(n--,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 h1{createParse(t,n,i){let r=i[0].from,l=i[i.length-1].to;return{parsedPos:r,advance(){let a=Ji;if(a){for(let h of i)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=l,new Ze(wt.none,[],[],l-r)},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 Ji}}function Zh(s,e,t){return Cn.applyChanges(s,[{fromA:e,toA:t,fromB:e,toB:t}])}class Di{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),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new Di(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=vr.create(e.facet(Gn).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new Di(n)}}qt.state=Nt.define({create:Di.init,update(s,e){for(let t of e.effects)if(t.is(qt.setState))return t.value;return e.startState.facet(Gn)!=e.state.facet(Gn)?Di.init(e.state):s.apply(e)}});let Ed=s=>{let e=setTimeout(()=>s(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Ed=s=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(s,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Al=typeof navigator<"u"&&(!((xl=navigator.scheduling)===null||xl===void 0)&&xl.isInputPending)?()=>navigator.scheduling.isInputPending():null,E1=rt.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(qt.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(qt.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Ed(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndi+1e3,a=r.context.work(()=>Al&&Al()||Date.now()>l,i+(o?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:qt.setState.of(new Di(r.context))})),this.chunkBudget>0&&!(a&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>An(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()}}}),Gn=le.define({combine(s){return s.length?s[0]:null},enables:s=>[qt.state,E1,ae.contentAttributes.compute([s],e=>{let t=e.facet(s);return t&&t.name?{"data-language":t.name}:{}})]});class AS{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class Od{constructor(e,t,n,i,r,l=void 0){this.name=e,this.alias=t,this.extensions=n,this.filename=i,this.loadFunc=r,this.support=l,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:n}=e;if(!t){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(n)}return new Od(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,t,n)}static matchFilename(e,t){for(let i of e)if(i.filename&&i.filename.test(t))return i;let n=/\.([^.]+)$/.exec(t);if(n){for(let i of e)if(i.extensions.indexOf(n[1])>-1)return i}return null}static matchLanguageName(e,t,n=!0){t=t.toLowerCase();for(let i of e)if(i.alias.some(r=>r==t))return i;if(n)for(let i of e)for(let r of i.alias){let l=t.indexOf(r);if(l>-1&&(r.length>2||!/\w/.test(t[l-1])&&!/\w/.test(t[l+r.length])))return i}return null}}const O1=le.define(),Ir=le.define({combine:s=>{if(!s.length)return" ";let e=s[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(s[0]));return e}});function yr(s){let e=s.facet(Ir);return e.charCodeAt(0)==9?s.tabSize*e.length:e.length}function _s(s,e){let t="",n=s.tabSize,i=s.facet(Ir)[0];if(i==" "){for(;e>=n;)t+=" ",e-=n;i=" "}for(let r=0;r=e?P1(s,t,e):null}class zr{constructor(e,t={}){this.state=e,this.options=t,this.unit=yr(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:r}=this.options;return i!=null&&i>=n.from&&i<=n.to?r&&i==e?{text:"",from:e}:(t<0?i-1&&(r+=l-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return Ni(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:i}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let l=r(i);if(l>-1)return l}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const D1=new ve;function P1(s,e,t){let n=e.resolveStack(t),i=n.node.enterUnfinishedNodesBefore(t);if(i!=n.node){let r=[];for(let l=i;l!=n.node;l=l.parent)r.push(l);for(let l=r.length-1;l>=0;l--)n={node:r[l],next:n}}return Dd(n,s,t)}function Dd(s,e,t){for(let n=s;n;n=n.next){let i=B1(n.node);if(i)return i(Ko.create(e,t,n))}return 0}function N1(s){return s.pos==s.options.simulateBreak&&s.options.simulateDoubleBreak}function B1(s){let e=s.type.prop(D1);if(e)return e;let t=s.firstChild,n;if(t&&(n=t.type.prop(ve.closedBy))){let i=s.lastChild,r=i&&n.indexOf(i.name)>-1;return l=>Pd(l,!0,1,void 0,r&&!N1(l)?i.from:void 0)}return s.parent==null?L1:null}function L1(){return 0}class Ko extends zr{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new Ko(e,t,n)}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 n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if($1(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return Dd(this.context.next,this.base,this.pos)}}function $1(s,e){for(let t=e;t;t=t.parent)if(s==t)return!0;return!1}function R1(s){let e=s.node,t=e.childAfter(e.from),n=e.lastChild;if(!t)return null;let i=s.options.simulateBreak,r=s.state.doc.lineAt(t.from),l=i==null||i<=r.from?r.to:Math.min(r.to,i);for(let o=t.to;;){let a=e.childAfter(o);if(!a||a==n)return null;if(!a.type.isSkipped)return a.fromPd(n,e,t,s)}function Pd(s,e,t,n,i){let r=s.textAfter,l=r.match(/^\s*/)[0].length,o=n&&r.slice(l,l+n.length)==n||i==s.pos+l,a=e?R1(s):null;return a?o?s.column(a.from):s.column(a.to):s.baseIndent+(o?0:s.unit*t)}const MS=s=>s.baseIndent;function TS({except:s,units:e=1}={}){return t=>{let n=s&&s.test(t.textAfter);return t.baseIndent+(n?0:e*t.unit)}}const I1=200;function ES(){return ye.transactionFilter.of(s=>{if(!s.docChanged||!s.isUserEvent("input.type")&&!s.isUserEvent("input.complete"))return s;let e=s.startState.languageDataAt("indentOnInput",s.startState.selection.main.head);if(!e.length)return s;let t=s.newDoc,{head:n}=s.newSelection.main,i=t.lineAt(n);if(n>i.from+I1)return s;let r=t.sliceString(i.from,n);if(!e.some(h=>h.test(r)))return s;let{state:l}=s,o=-1,a=[];for(let{head:h}of l.selection.ranges){let c=l.doc.lineAt(h);if(c.from==o)continue;o=c.from;let f=Uo(l,c.from);if(f==null)continue;let u=/^\s*/.exec(c.text)[0],d=_s(l,f);u!=d&&a.push({from:c.from,to:c.from+u.length,insert:d})}return a.length?[s,{changes:a,sequential:!0}]:s})}const z1=le.define(),j1=new ve;function OS(s){let e=s.firstChild,t=s.lastChild;return e&&e.tot)continue;if(r&&o.from=e&&h.to>t&&(r=h)}}return r}function H1(s){let e=s.lastChild;return e&&e.to==s.to&&e.type.isError}function wr(s,e,t){for(let n of s.facet(z1)){let i=n(s,e,t);if(i)return i}return V1(s,e,t)}function Nd(s,e){let t=e.mapPos(s.from,1),n=e.mapPos(s.to,-1);return t>=n?void 0:{from:t,to:n}}const jr=Ne.define({map:Nd}),Cs=Ne.define({map:Nd});function Bd(s){let e=[];for(let{head:t}of s.state.selection.ranges)e.some(n=>n.from<=t&&n.to>=t)||e.push(s.lineBlockAt(t));return e}const fi=Nt.define({create(){return Be.none},update(s,e){s=s.map(e.changes);for(let t of e.effects)if(t.is(jr)&&!F1(s,t.value.from,t.value.to)){let{preparePlaceholder:n}=e.state.facet(Jo),i=n?Be.replace({widget:new G1(n(e.state,t.value))}):Qh;s=s.update({add:[i.range(t.value.from,t.value.to)]})}else t.is(Cs)&&(s=s.update({filter:(n,i)=>t.value.from!=n||t.value.to!=i,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:n}=e.selection.main;s.between(n,n,(i,r)=>{in&&(t=!0)}),t&&(s=s.update({filterFrom:n,filterTo:n,filter:(i,r)=>r<=n||i>=n}))}return s},provide:s=>ae.decorations.from(s),toJSON(s,e){let t=[];return s.between(0,e.doc.length,(n,i)=>{t.push(n,i)}),t},fromJSON(s){if(!Array.isArray(s)||s.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{(!i||i.from>r)&&(i={from:r,to:l})}),i}function F1(s,e,t){let n=!1;return s.between(e,e,(i,r)=>{i==e&&r==t&&(n=!0)}),n}function Ld(s,e){return s.field(fi,!1)?e:e.concat(Ne.appendConfig.of(Rd()))}const W1=s=>{for(let e of Bd(s)){let t=wr(s.state,e.from,e.to);if(t)return s.dispatch({effects:Ld(s.state,[jr.of(t),$d(s,t)])}),!0}return!1},q1=s=>{if(!s.state.field(fi,!1))return!1;let e=[];for(let t of Bd(s)){let n=Sr(s.state,t.from,t.to);n&&e.push(Cs.of(n),$d(s,n,!1))}return e.length&&s.dispatch({effects:e}),e.length>0};function $d(s,e,t=!0){let n=s.state.doc.lineAt(e.from).number,i=s.state.doc.lineAt(e.to).number;return ae.announce.of(`${s.state.phrase(t?"Folded lines":"Unfolded lines")} ${n} ${s.state.phrase("to")} ${i}.`)}const U1=s=>{let{state:e}=s,t=[];for(let n=0;n{let e=s.state.field(fi,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,s.state.doc.length,(n,i)=>{t.push(Cs.of({from:n,to:i}))}),s.dispatch({effects:t}),!0},DS=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:W1},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:q1},{key:"Ctrl-Alt-[",run:U1},{key:"Ctrl-Alt-]",run:K1}],J1={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Jo=le.define({combine(s){return Pi(s,J1)}});function Rd(s){let e=[fi,X1];return s&&e.push(Jo.of(s)),e}function Id(s,e){let{state:t}=s,n=t.facet(Jo),i=l=>{let o=s.lineBlockAt(s.posAtDOM(l.target)),a=Sr(s.state,o.from,o.to);a&&s.dispatch({effects:Cs.of(a)}),l.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(s,i,e);let r=document.createElement("span");return r.textContent=n.placeholderText,r.setAttribute("aria-label",t.phrase("folded code")),r.title=t.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=i,r}const Qh=Be.replace({widget:new class extends pi{toDOM(s){return Id(s,null)}}});class G1 extends pi{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Id(e,this.value)}}const Y1={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Cl extends Dn{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 PS(s={}){let e=Object.assign(Object.assign({},Y1),s),t=new Cl(e,!0),n=new Cl(e,!1),i=rt.fromClass(class{constructor(l){this.from=l.viewport.from,this.markers=this.buildMarkers(l)}update(l){(l.docChanged||l.viewportChanged||l.startState.facet(Gn)!=l.state.facet(Gn)||l.startState.field(fi,!1)!=l.state.field(fi,!1)||Pt(l.startState)!=Pt(l.state)||e.foldingChanged(l))&&(this.markers=this.buildMarkers(l.view))}buildMarkers(l){let o=new ai;for(let a of l.viewportLineBlocks){let h=Sr(l.state,a.from,a.to)?n:wr(l.state,a.from,a.to)?t:null;h&&o.add(a.from,a.from,h)}return o.finish()}}),{domEventHandlers:r}=e;return[i,J0({class:"cm-foldGutter",markers(l){var o;return((o=l.plugin(i))===null||o===void 0?void 0:o.markers)||Ee.empty},initialSpacer(){return new Cl(e,!1)},domEventHandlers:Object.assign(Object.assign({},r),{click:(l,o,a)=>{if(r.click&&r.click(l,o,a))return!0;let h=Sr(l.state,o.from,o.to);if(h)return l.dispatch({effects:Cs.of(h)}),!0;let c=wr(l.state,o.from,o.to);return c?(l.dispatch({effects:jr.of(c)}),!0):!1}})}),Rd()]}const X1=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 Ms{constructor(e,t){this.specs=e;let n;function i(o){let a=qn.newName();return(n||(n=Object.create(null)))["."+a]=o,a}const r=typeof t.all=="string"?t.all:t.all?i(t.all):void 0,l=t.scope;this.scope=l instanceof qt?o=>o.prop(Si)==l.data:l?o=>o==l:void 0,this.style=Td(e.map(o=>({tag:o.tag,class:o.class||i(Object.assign({},o,{tag:null}))})),{all:r}).style,this.module=n?new qn(n):null,this.themeType=t.themeType}static define(e,t){return new Ms(e,t||{})}}const ko=le.define(),zd=le.define({combine(s){return s.length?[s[0]]:null}});function Ml(s){let e=s.facet(ko);return e.length?e:s.facet(zd)}function Z1(s,e){let t=[eb],n;return s instanceof Ms&&(s.module&&t.push(ae.styleModule.of(s.module)),n=s.themeType),e!=null&&e.fallback?t.push(zd.of(s)):n?t.push(ko.computeN([ae.darkTheme],i=>i.facet(ae.darkTheme)==(n=="dark")?[s]:[])):t.push(ko.of(s)),t}class Q1{constructor(e){this.markCache=Object.create(null),this.tree=Pt(e.state),this.decorations=this.buildDeco(e,Ml(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Pt(e.state),n=Ml(e.state),i=n!=Ml(e.startState),{viewport:r}=e.view,l=e.changes.mapPos(this.decoratedTo,1);t.length=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=l):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return Be.none;let n=new ai;for(let{from:i,to:r}of e.visibleRanges)S1(this.tree,t,(l,o,a)=>{n.add(l,o,this.markCache[a]||(this.markCache[a]=Be.mark({class:a})))},i,r);return n.finish()}}const eb=Br.high(rt.fromClass(Q1,{decorations:s=>s.decorations})),NS=Ms.define([{tag:L.meta,color:"#404740"},{tag:L.link,textDecoration:"underline"},{tag:L.heading,textDecoration:"underline",fontWeight:"bold"},{tag:L.emphasis,fontStyle:"italic"},{tag:L.strong,fontWeight:"bold"},{tag:L.strikethrough,textDecoration:"line-through"},{tag:L.keyword,color:"#708"},{tag:[L.atom,L.bool,L.url,L.contentSeparator,L.labelName],color:"#219"},{tag:[L.literal,L.inserted],color:"#164"},{tag:[L.string,L.deleted],color:"#a11"},{tag:[L.regexp,L.escape,L.special(L.string)],color:"#e40"},{tag:L.definition(L.variableName),color:"#00f"},{tag:L.local(L.variableName),color:"#30a"},{tag:[L.typeName,L.namespace],color:"#085"},{tag:L.className,color:"#167"},{tag:[L.special(L.variableName),L.macroName],color:"#256"},{tag:L.definition(L.propertyName),color:"#00c"},{tag:L.comment,color:"#940"},{tag:L.invalid,color:"#f00"}]),tb=ae.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),jd=1e4,Vd="()[]{}",Hd=le.define({combine(s){return Pi(s,{afterCursor:!0,brackets:Vd,maxScanDistance:jd,renderMatch:sb})}}),nb=Be.mark({class:"cm-matchingBracket"}),ib=Be.mark({class:"cm-nonmatchingBracket"});function sb(s){let e=[],t=s.matched?nb:ib;return e.push(t.range(s.start.from,s.start.to)),s.end&&e.push(t.range(s.end.from,s.end.to)),e}const rb=Nt.define({create(){return Be.none},update(s,e){if(!e.docChanged&&!e.selection)return s;let t=[],n=e.state.facet(Hd);for(let i of e.state.selection.ranges){if(!i.empty)continue;let r=fn(e.state,i.head,-1,n)||i.head>0&&fn(e.state,i.head-1,1,n)||n.afterCursor&&(fn(e.state,i.head,1,n)||i.headae.decorations.from(s)}),lb=[rb,tb];function BS(s={}){return[Hd.of(s),lb]}const ob=new ve;function vo(s,e,t){let n=s.prop(e<0?ve.openedBy:ve.closedBy);if(n)return n;if(s.name.length==1){let i=t.indexOf(s.name);if(i>-1&&i%2==(e<0?1:0))return[t[i+e]]}return null}function yo(s){let e=s.type.prop(ob);return e?e(s.node):s}function fn(s,e,t,n={}){let i=n.maxScanDistance||jd,r=n.brackets||Vd,l=Pt(s),o=l.resolveInner(e,t);for(let a=o;a;a=a.parent){let h=vo(a.type,t,r);if(h&&a.from0?e>=c.from&&ec.from&&e<=c.to))return ab(s,e,t,a,c,h,r)}}return hb(s,e,t,l,o.type,i,r)}function ab(s,e,t,n,i,r,l){let o=n.parent,a={from:i.from,to:i.to},h=0,c=o==null?void 0:o.cursor();if(c&&(t<0?c.childBefore(n.from):c.childAfter(n.to)))do if(t<0?c.to<=n.from:c.from>=n.to){if(h==0&&r.indexOf(c.type.name)>-1&&c.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=s.doc.iterRange(e,t>0?s.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let m=t>0?0:d.length-1,g=t>0?d.length:-1;m!=g;m+=t){let b=l.indexOf(d[m]);if(!(b<0||n.resolveInner(p+m,1).type!=i))if(b%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+m,to:p+m+1},matched:b>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}const cb=Object.create(null),ec=[wt.none],tc=[],nc=Object.create(null),fb=Object.create(null);for(let[s,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"]])fb[s]=ub(cb,e);function Tl(s,e){tc.indexOf(s)>-1||(tc.push(s),console.warn(e))}function ub(s,e){let t=[];for(let o of e.split(" ")){let a=[];for(let h of o.split(".")){let c=s[h]||L[h];c?typeof c=="function"?a.length?a=a.map(c):Tl(h,`Modifier ${h} used at start of tag`):a.length?Tl(h,`Tag ${h} used as modifier`):a=Array.isArray(c)?c:[c]:Tl(h,`Unknown highlighting tag ${h}`)}for(let h of a)t.push(h)}if(!t.length)return 0;let n=e.replace(/ /g,"_"),i=n+" "+t.map(o=>o.id),r=nc[i];if(r)return r.id;let l=nc[i]=wt.define({id:ec.length,name:n,props:[y1({[n]:t})]});return ec.push(l),l.id}He.RTL,He.LTR;const db=s=>{let{state:e}=s,t=e.doc.lineAt(e.selection.main.from),n=Yo(s.state,t.from);return n.line?pb(s):n.block?gb(s):!1};function Go(s,e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=s(e,t);return i?(n(t.update(i)),!0):!1}}const pb=Go(kb,0),mb=Go(Fd,0),gb=Go((s,e)=>Fd(s,e,_b(e)),0);function Yo(s,e){let t=s.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const Gi=50;function bb(s,{open:e,close:t},n,i){let r=s.sliceDoc(n-Gi,n),l=s.sliceDoc(i,i+Gi),o=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(l)[0].length,h=r.length-o;if(r.slice(h-e.length,h)==e&&l.slice(a,a+t.length)==t)return{open:{pos:n-o,margin:o&&1},close:{pos:i+a,margin:a&&1}};let c,f;i-n<=2*Gi?c=f=s.sliceDoc(n,i):(c=s.sliceDoc(n,n+Gi),f=s.sliceDoc(i-Gi,i));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:n+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:i-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function _b(s){let e=[];for(let t of s.selection.ranges){let n=s.doc.lineAt(t.from),i=t.to<=n.to?n:s.doc.lineAt(t.to),r=e.length-1;r>=0&&e[r].to>n.from?e[r].to=i.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:i.to})}return e}function Fd(s,e,t=e.selection.ranges){let n=t.map(r=>Yo(e,r.from).block);if(!n.every(r=>r))return null;let i=t.map((r,l)=>bb(e,n[l],r.from,r.to));if(s!=2&&!i.every(r=>r))return{changes:e.changes(t.map((r,l)=>i[l]?[]:[{from:r.from,insert:n[l].open+" "},{from:r.to,insert:" "+n[l].close}]))};if(s!=1&&i.some(r=>r)){let r=[];for(let l=0,o;li&&(r==l||l>f.from)){i=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:o,token:a,indent:h,empty:c,single:f}of n)(f||!c)&&r.push({from:o.from+h,insert:a+" "});let l=e.changes(r);return{changes:l,selection:e.selection.map(l,1)}}else if(s!=1&&n.some(r=>r.comment>=0)){let r=[];for(let{line:l,comment:o,token:a}of n)if(o>=0){let h=l.from+o,c=h+a.length;l.text[c-l.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const wo=Yn.define(),vb=Yn.define(),yb=le.define(),Wd=le.define({combine(s){return Pi(s,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,i)=>e(n,i)||t(n,i)})}}),Xo=Nt.define({create(){return un.empty},update(s,e){let t=e.state.facet(Wd),n=e.annotation(wo);if(n){let a=yt.fromTransaction(e,n.selection),h=n.side,c=h==0?s.undone:s.done;return a?c=xr(c,c.length,t.minDepth,a):c=Kd(c,e.startState.selection),new un(h==0?n.rest:c,h==0?c:n.rest)}let i=e.annotation(vb);if((i=="full"||i=="before")&&(s=s.isolate()),e.annotation(Xe.addToHistory)===!1)return e.changes.empty?s:s.addMapping(e.changes.desc);let r=yt.fromTransaction(e),l=e.annotation(Xe.time),o=e.annotation(Xe.userEvent);return r?s=s.addChanges(r,l,o,t,e):e.selection&&(s=s.addSelection(e.startState.selection,l,o,t.newGroupDelay)),(i=="full"||i=="after")&&(s=s.isolate()),s},toJSON(s){return{done:s.done.map(e=>e.toJSON()),undone:s.undone.map(e=>e.toJSON())}},fromJSON(s){return new un(s.done.map(yt.fromJSON),s.undone.map(yt.fromJSON))}});function LS(s={}){return[Xo,Wd.of(s),ae.domEventHandlers({beforeinput(e,t){let n=e.inputType=="historyUndo"?qd:e.inputType=="historyRedo"?So:null;return n?(e.preventDefault(),n(t)):!1}})]}const ic=Xo;function Vr(s,e){return function({state:t,dispatch:n}){if(!e&&t.readOnly)return!1;let i=t.field(Xo,!1);if(!i)return!1;let r=i.pop(s,t,e);return r?(n(r),!0):!1}}const qd=Vr(0,!1),So=Vr(1,!1),wb=Vr(0,!0),Sb=Vr(1,!0);class yt{constructor(e,t,n,i,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=i,this.selectionsAfter=r}setSelAfter(e){return new yt(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;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:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new yt(e.changes&&Ge.fromJSON(e.changes),[],e.mapped&&mn.fromJSON(e.mapped),e.startSelection&&q.fromJSON(e.startSelection),e.selectionsAfter.map(q.fromJSON))}static fromTransaction(e,t){let n=Rt;for(let i of e.startState.facet(yb)){let r=i(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new yt(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,Rt)}static selection(e){return new yt(void 0,Rt,void 0,void 0,e)}}function xr(s,e,t,n){let i=e+1>t+20?e-t-1:0,r=s.slice(i,e);return r.push(n),r}function xb(s,e){let t=[],n=!1;return s.iterChangedRanges((i,r)=>t.push(i,r)),e.iterChangedRanges((i,r,l,o)=>{for(let a=0;a=h&&l<=c&&(n=!0)}}),n}function Ab(s,e){return s.ranges.length==e.ranges.length&&s.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length===0}function Ud(s,e){return s.length?e.length?s.concat(e):s:e}const Rt=[],Cb=200;function Kd(s,e){if(s.length){let t=s[s.length-1],n=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-Cb));return n.length&&n[n.length-1].eq(e)?s:(n.push(e),xr(s,s.length-1,1e9,t.setSelAfter(n)))}else return[yt.selection([e])]}function Mb(s){let e=s[s.length-1],t=s.slice();return t[s.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function El(s,e){if(!s.length)return s;let t=s.length,n=Rt;for(;t;){let i=Tb(s[t-1],e,n);if(i.changes&&!i.changes.empty||i.effects.length){let r=s.slice(0,t);return r[t-1]=i,r}else e=i.mapped,t--,n=i.selectionsAfter}return n.length?[yt.selection(n)]:Rt}function Tb(s,e,t){let n=Ud(s.selectionsAfter.length?s.selectionsAfter.map(o=>o.map(e)):Rt,t);if(!s.changes)return yt.selection(n);let i=s.changes.map(e),r=e.mapDesc(s.changes,!0),l=s.mapped?s.mapped.composeDesc(r):r;return new yt(i,Ne.mapEffects(s.effects,e),l,s.startSelection.map(r),n)}const Eb=/^(input\.type|delete)($|\.)/;class un{constructor(e,t,n=0,i=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=i}isolate(){return this.prevTime?new un(this.done,this.undone):this}addChanges(e,t,n,i,r){let l=this.done,o=l[l.length-1];return o&&o.changes&&!o.changes.empty&&e.changes&&(!n||Eb.test(n))&&(!o.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?s.moveByChar(t,e):Hr(t,e))}function ut(s){return s.textDirectionAt(s.state.selection.main.head)==He.LTR}const Gd=s=>Jd(s,!ut(s)),Yd=s=>Jd(s,ut(s));function Xd(s,e){return Jt(s,t=>t.empty?s.moveByGroup(t,e):Hr(t,e))}const Ob=s=>Xd(s,!ut(s)),Db=s=>Xd(s,ut(s));function Pb(s,e,t){if(e.type.prop(t))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(s.sliceDoc(e.from,e.to)))||e.firstChild}function Fr(s,e,t){let n=Pt(s).resolveInner(e.head),i=t?ve.closedBy:ve.openedBy;for(let a=e.head;;){let h=t?n.childAfter(a):n.childBefore(a);if(!h)break;Pb(s,h,i)?n=h:a=t?h.to:h.from}let r=n.type.prop(i),l,o;return r&&(l=t?fn(s,n.from,1):fn(s,n.to,-1))&&l.matched?o=t?l.end.to:l.end.from:o=t?n.to:n.from,q.cursor(o,t?-1:1)}const Nb=s=>Jt(s,e=>Fr(s.state,e,!ut(s))),Bb=s=>Jt(s,e=>Fr(s.state,e,ut(s)));function Zd(s,e){return Jt(s,t=>{if(!t.empty)return Hr(t,e);let n=s.moveVertically(t,e);return n.head!=t.head?n:s.moveToLineBoundary(t,e)})}const Qd=s=>Zd(s,!1),ep=s=>Zd(s,!0);function tp(s){let e=s.scrollDOM.clientHeightl.empty?s.moveVertically(l,e,t.height):Hr(l,e));if(i.eq(n.selection))return!1;let r;if(t.selfScroll){let l=s.coordsAtPos(n.selection.main.head),o=s.scrollDOM.getBoundingClientRect(),a=o.top+t.marginTop,h=o.bottom-t.marginBottom;l&&l.top>a&&l.bottomnp(s,!1),xo=s=>np(s,!0);function Xn(s,e,t){let n=s.lineBlockAt(e.head),i=s.moveToLineBoundary(e,t);if(i.head==e.head&&i.head!=(t?n.to:n.from)&&(i=s.moveToLineBoundary(e,t,!1)),!t&&i.head==n.from&&n.length){let r=/^\s*/.exec(s.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;r&&e.head!=n.from+r&&(i=q.cursor(n.from+r))}return i}const Lb=s=>Jt(s,e=>Xn(s,e,!0)),$b=s=>Jt(s,e=>Xn(s,e,!1)),Rb=s=>Jt(s,e=>Xn(s,e,!ut(s))),Ib=s=>Jt(s,e=>Xn(s,e,ut(s))),zb=s=>Jt(s,e=>q.cursor(s.lineBlockAt(e.head).from,1)),jb=s=>Jt(s,e=>q.cursor(s.lineBlockAt(e.head).to,-1));function Vb(s,e,t){let n=!1,i=Bi(s.selection,r=>{let l=fn(s,r.head,-1)||fn(s,r.head,1)||r.head>0&&fn(s,r.head-1,1)||r.headVb(s,e,!1);function zt(s,e){let t=Bi(s.state.selection,n=>{let i=e(n);return q.range(n.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return t.eq(s.state.selection)?!1:(s.dispatch(gn(s.state,t)),!0)}function ip(s,e){return zt(s,t=>s.moveByChar(t,e))}const sp=s=>ip(s,!ut(s)),rp=s=>ip(s,ut(s));function lp(s,e){return zt(s,t=>s.moveByGroup(t,e))}const Fb=s=>lp(s,!ut(s)),Wb=s=>lp(s,ut(s)),qb=s=>zt(s,e=>Fr(s.state,e,!ut(s))),Ub=s=>zt(s,e=>Fr(s.state,e,ut(s)));function op(s,e){return zt(s,t=>s.moveVertically(t,e))}const ap=s=>op(s,!1),hp=s=>op(s,!0);function cp(s,e){return zt(s,t=>s.moveVertically(t,e,tp(s).height))}const rc=s=>cp(s,!1),lc=s=>cp(s,!0),Kb=s=>zt(s,e=>Xn(s,e,!0)),Jb=s=>zt(s,e=>Xn(s,e,!1)),Gb=s=>zt(s,e=>Xn(s,e,!ut(s))),Yb=s=>zt(s,e=>Xn(s,e,ut(s))),Xb=s=>zt(s,e=>q.cursor(s.lineBlockAt(e.head).from)),Zb=s=>zt(s,e=>q.cursor(s.lineBlockAt(e.head).to)),oc=({state:s,dispatch:e})=>(e(gn(s,{anchor:0})),!0),ac=({state:s,dispatch:e})=>(e(gn(s,{anchor:s.doc.length})),!0),hc=({state:s,dispatch:e})=>(e(gn(s,{anchor:s.selection.main.anchor,head:0})),!0),cc=({state:s,dispatch:e})=>(e(gn(s,{anchor:s.selection.main.anchor,head:s.doc.length})),!0),Qb=({state:s,dispatch:e})=>(e(s.update({selection:{anchor:0,head:s.doc.length},userEvent:"select"})),!0),e_=({state:s,dispatch:e})=>{let t=Wr(s).map(({from:n,to:i})=>q.range(n,Math.min(i+1,s.doc.length)));return e(s.update({selection:q.create(t),userEvent:"select"})),!0},t_=({state:s,dispatch:e})=>{let t=Bi(s.selection,n=>{var i;let r=Pt(s).resolveStack(n.from,1);for(let l=r;l;l=l.next){let{node:o}=l;if((o.from=n.to||o.to>n.to&&o.from<=n.from)&&(!((i=o.parent)===null||i===void 0)&&i.parent))return q.range(o.to,o.from)}return n});return e(gn(s,t)),!0},n_=({state:s,dispatch:e})=>{let t=s.selection,n=null;return t.ranges.length>1?n=q.create([t.main]):t.main.empty||(n=q.create([q.cursor(t.main.head)])),n?(e(gn(s,n)),!0):!1};function Ts(s,e){if(s.state.readOnly)return!1;let t="delete.selection",{state:n}=s,i=n.changeByRange(r=>{let{from:l,to:o}=r;if(l==o){let a=e(r);al&&(t="delete.forward",a=Xs(s,a,!0)),l=Math.min(l,a),o=Math.max(o,a)}else l=Xs(s,l,!1),o=Xs(s,o,!0);return l==o?{range:r}:{changes:{from:l,to:o},range:q.cursor(l,li(s)))n.between(e,e,(i,r)=>{ie&&(e=t?r:i)});return e}const fp=(s,e)=>Ts(s,t=>{let n=t.from,{state:i}=s,r=i.doc.lineAt(n),l,o;if(!e&&n>r.from&&nfp(s,!1),up=s=>fp(s,!0),dp=(s,e)=>Ts(s,t=>{let n=t.head,{state:i}=s,r=i.doc.lineAt(n),l=i.charCategorizer(n);for(let o=null;;){if(n==(e?r.to:r.from)){n==t.head&&r.number!=(e?i.doc.lines:1)&&(n+=e?1:-1);break}let a=mt(r.text,n-r.from,e)+r.from,h=r.text.slice(Math.min(n,a)-r.from,Math.max(n,a)-r.from),c=l(h);if(o!=null&&c!=o)break;(h!=" "||n!=t.head)&&(o=c),n=a}return n}),pp=s=>dp(s,!1),i_=s=>dp(s,!0),s_=s=>Ts(s,e=>{let t=s.lineBlockAt(e.head).to;return e.headTs(s,e=>{let t=s.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),l_=s=>Ts(s,e=>{let t=s.moveToLineBoundary(e,!0).head;return e.head{if(s.readOnly)return!1;let t=s.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:De.of(["",""])},range:q.cursor(n.from)}));return e(s.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},a_=({state:s,dispatch:e})=>{if(s.readOnly)return!1;let t=s.changeByRange(n=>{if(!n.empty||n.from==0||n.from==s.doc.length)return{range:n};let i=n.from,r=s.doc.lineAt(i),l=i==r.from?i-1:mt(r.text,i-r.from,!1)+r.from,o=i==r.to?i+1:mt(r.text,i-r.from,!0)+r.from;return{changes:{from:l,to:o,insert:s.doc.slice(i,o).append(s.doc.slice(l,i))},range:q.cursor(o)}});return t.changes.empty?!1:(e(s.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Wr(s){let e=[],t=-1;for(let n of s.selection.ranges){let i=s.doc.lineAt(n.from),r=s.doc.lineAt(n.to);if(!n.empty&&n.to==r.from&&(r=s.doc.lineAt(n.to-1)),t>=i.number){let l=e[e.length-1];l.to=r.to,l.ranges.push(n)}else e.push({from:i.from,to:r.to,ranges:[n]});t=r.number+1}return e}function mp(s,e,t){if(s.readOnly)return!1;let n=[],i=[];for(let r of Wr(s)){if(t?r.to==s.doc.length:r.from==0)continue;let l=s.doc.lineAt(t?r.to+1:r.from-1),o=l.length+1;if(t){n.push({from:r.to,to:l.to},{from:r.from,insert:l.text+s.lineBreak});for(let a of r.ranges)i.push(q.range(Math.min(s.doc.length,a.anchor+o),Math.min(s.doc.length,a.head+o)))}else{n.push({from:l.from,to:r.from},{from:r.to,insert:s.lineBreak+l.text});for(let a of r.ranges)i.push(q.range(a.anchor-o,a.head-o))}}return n.length?(e(s.update({changes:n,scrollIntoView:!0,selection:q.create(i,s.selection.mainIndex),userEvent:"move.line"})),!0):!1}const h_=({state:s,dispatch:e})=>mp(s,e,!1),c_=({state:s,dispatch:e})=>mp(s,e,!0);function gp(s,e,t){if(s.readOnly)return!1;let n=[];for(let i of Wr(s))t?n.push({from:i.from,insert:s.doc.slice(i.from,i.to)+s.lineBreak}):n.push({from:i.to,insert:s.lineBreak+s.doc.slice(i.from,i.to)});return e(s.update({changes:n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const f_=({state:s,dispatch:e})=>gp(s,e,!1),u_=({state:s,dispatch:e})=>gp(s,e,!0),d_=s=>{if(s.state.readOnly)return!1;let{state:e}=s,t=e.changes(Wr(e).map(({from:i,to:r})=>(i>0?i--:rs.moveVertically(i,!0)).map(t);return s.dispatch({changes:t,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function p_(s,e){if(/\(\)|\[\]|\{\}/.test(s.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=Pt(s).resolveInner(e),n=t.childBefore(e),i=t.childAfter(e),r;return n&&i&&n.to<=e&&i.from>=e&&(r=n.type.prop(ve.closedBy))&&r.indexOf(i.name)>-1&&s.doc.lineAt(n.to).from==s.doc.lineAt(i.from).from&&!/\S/.test(s.sliceDoc(n.to,i.from))?{from:n.to,to:i.from}:null}const m_=bp(!1),g_=bp(!0);function bp(s){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{let{from:r,to:l}=i,o=e.doc.lineAt(r),a=!s&&r==l&&p_(e,r);s&&(r=l=(l<=o.to?o:e.doc.lineAt(l)).to);let h=new zr(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=Uo(h,r);for(c==null&&(c=Ni(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));lo.from&&r{let i=[];for(let l=n.from;l<=n.to;){let o=s.doc.lineAt(l);o.number>t&&(n.empty||n.to>o.from)&&(e(o,i,n),t=o.number),l=o.to+1}let r=s.changes(i);return{changes:i,range:q.range(r.mapPos(n.anchor,1),r.mapPos(n.head,1))}})}const b_=({state:s,dispatch:e})=>{if(s.readOnly)return!1;let t=Object.create(null),n=new zr(s,{overrideIndentation:r=>{let l=t[r];return l??-1}}),i=Zo(s,(r,l,o)=>{let a=Uo(n,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=_s(s,a);(h!=c||o.froms.readOnly?!1:(e(s.update(Zo(s,(t,n)=>{n.push({from:t.from,insert:s.facet(Ir)})}),{userEvent:"input.indent"})),!0),kp=({state:s,dispatch:e})=>s.readOnly?!1:(e(s.update(Zo(s,(t,n)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let r=Ni(i,s.tabSize),l=0,o=_s(s,Math.max(0,r-yr(s)));for(;l({mac:s.key,run:s.run,shift:s.shift}))),v_=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Nb,shift:qb},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Bb,shift:Ub},{key:"Alt-ArrowUp",run:h_},{key:"Shift-Alt-ArrowUp",run:f_},{key:"Alt-ArrowDown",run:c_},{key:"Shift-Alt-ArrowDown",run:u_},{key:"Escape",run:n_},{key:"Mod-Enter",run:g_},{key:"Alt-l",mac:"Ctrl-l",run:e_},{key:"Mod-i",run:t_,preventDefault:!0},{key:"Mod-[",run:kp},{key:"Mod-]",run:_p},{key:"Mod-Alt-\\",run:b_},{key:"Shift-Mod-k",run:d_},{key:"Shift-Mod-\\",run:Hb},{key:"Mod-/",run:db},{key:"Alt-A",run:mb}].concat(k_),y_={key:"Tab",run:_p,shift:kp};let pt=[],w_=(s,e)=>{let t,n=[],i={lc:0,l:e||0,value:s,set(r){i.value=r,i.notify()},get(){return i.lc||i.listen(()=>{})(),i.value},notify(r){t=n;let l=!pt.length;for(let o=0;o{n===t&&(n=n.slice());let o=n.indexOf(r);~o&&(n.splice(o,2),i.lc--,i.lc||i.off())}},subscribe(r,l){let o=i.listen(r,l);return r(i.value),o},off(){}};return i},S_=(s={})=>{let e=w_(s);return e.setKey=function(t,n){typeof n>"u"?t in e.value&&(e.value={...e.value},delete e.value[t],e.notify(t)):e.value[t]!==n&&(e.value={...e.value,[t]:n},e.notify(t))},e};var x_=()=>S_({view:null,extensions:null,value:null}),A_=(s,e)=>{if(Fn(e))throw new Error("No options provided. At least `value` is required.");let{value:t,instanceStore:n,onChangeBehavior:i={kind:"debounce",duration:50}}=e,r,l=new Promise(E=>r=E),o,a=[];const h=new Lt,c=new Lt,f=new Lt,u=new Lt,d=new Lt,p=new Lt,m=new Lt,g=new Lt,b=ae.updateListener.of(E=>N(E));async function v(E){return Promise.all([b,p.of(bc(E)),m.of(await mc(E)),h.of(await fc(E)??[]),cd.of([...v_,...E.useTabs?[y_]:[]]),c.of(await uc(E)),f.of(dc(E)),u.of(await pc(E)),d.of(gc(E)),g.of(await _c(E))])}function O(E){const V=o.state.doc.toString();vi(V,t)||(t=V,s.dispatchEvent(new CustomEvent("codemirror:textChange",{detail:t}))),n==null||n.set({value:t,view:o,extensions:a}),s.dispatchEvent(new CustomEvent("codemirror:change",{detail:E}))}const{kind:M="debounce",duration:B=50}=i;let N=M==="debounce"?kc(O,B):vc(O,B);return(async()=>{a=await v(e);const E=ye.create({doc:t,extensions:a,selection:{anchor:e.cursorPos??0,head:e.cursorPos??0}});o=new ae({state:E,parent:s}),Fn(e.cursorPos)||o.focus(),r()})(),{async update(E){var D,C;await l;const V={};vi(t,E.value)||(t=E.value,V.changes={from:0,to:o.state.doc.length,insert:t}),!Fn(E.cursorPos)&&!vi(e.cursorPos,E.cursorPos)&&(V.selection={anchor:E.cursorPos??0,head:E.cursorPos??0},o.focus());async function $(W,ne,Y){V.effects=V.effects??[];const he=V.effects;let j=!0;for(const fe of ne){const ge=E[fe],Re=e[fe];if(!Fn(ge)&&(j=!1,!vi(ge,Re)))return he.push(W.reconfigure(await Y(E)))}j&&he.push(W.reconfigure([]))}await Promise.all([$(h,["setup"],fc),$(c,["lang"],uc),$(u,["useTabs","tabSize"],pc),$(f,["theme"],dc),$(p,["extensions"],bc),$(d,["readonly"],gc),$(m,["autocomplete"],mc),$(g,["lint","lintOptions"],_c)]),o.dispatch(V);const{kind:F="debounce",duration:R=50}=E.onChangeBehavior??{kind:"debounce",duration:50};(!vi((D=e.onChangeBehavior)==null?void 0:D.kind,F)||!vi((C=e.onChangeBehavior)==null?void 0:C.duration,R))&&(N=F==="debounce"?kc(O,R):vc(O,R)),e=E,a=await v(E)},destroy(){l.then(()=>o==null?void 0:o.destroy())}}};async function fc(s){const{setup:e}=s;if(Fn(e))return[];if(e==="basic")return(await Mn(()=>import("./basic-setup-BJSL5TOQ.ce1ca664.js"),["./basic-setup-BJSL5TOQ.ce1ca664.js","./index.f7bb3215.js","./index.1eeec0a0.js"],import.meta.url)).default(s);if(e==="minimal")return(await Mn(()=>import("./minimal-setup-Y523JPZT.b318bad4.js"),[],import.meta.url)).default(s);throw new Error("`setup` can only be `basic` or `minimal`. If you wish to provide another setup, pass through `extensions` prop.")}async function uc({lang:s,langMap:e}){if(Fn(s))return[];if(typeof s=="string"){if(!e)throw new Error("`langMap` is required when `lang` is a string.");if(!(s in e))throw new Error(`Language "${s}" is not defined in \`langMap\`.`);return await e[s]()}return s}function dc({theme:s,styles:e}){return[s,e&&ae.theme(e)].filter(Boolean)}async function pc({useTabs:s=!1,tabSize:e=2}){return[ye.tabSize.of(e),Ir.of(s?" ":" ".repeat(e))]}async function mc({autocomplete:s}){if(Fn(s))return[];const{autocompletion:e}=await Mn(()=>import("./index.f7bb3215.js"),[],import.meta.url);return e(typeof s=="object"&&s?s:{})}function gc({readonly:s}){return ye.readOnly.of(!!s)}function bc({extensions:s}){return s??[]}async function _c({lint:s,lintOptions:e={}}){if(Fn(s))return[];if(!C_(s))throw new Error("`lint` must be a function.");const{linter:t}=await Mn(()=>import("./index.1eeec0a0.js").then(n=>n.i),[],import.meta.url);return t(s,e)}var vi=(s,e)=>s===e,Fn=s=>typeof s>"u",C_=s=>typeof s=="function";function kc(s,e,t=!1){let n;return function(...r){const l=this;n?clearTimeout(n):t&&s.apply(l,r),n=setTimeout(o,e||100);function o(){t||s.apply(l,r),n=null}}}function vc(s,e){let t,n=!1;function i(r){if(t){s.apply(r,t),setTimeout(i,e,r),t=null;return}n=!1}return function(...l){const o=this;if(n){t=l;return}s.apply(o,l),n=!0,setTimeout(i,e,o)}}function M_(s){let e;const t=s[7].default,n=Tt(t,s,s[6],null);return{c(){n&&n.c()},l(i){n&&n.l(i)},m(i,r){n&&n.m(i,r),e=!0},p(i,r){n&&n.p&&(!e||r&64)&&Et(n,t,i,i[6],e?Dt(t,i[6],r,null):Ot(i[6]),null)},i(i){e||(w(n,i),e=!0)},o(i){T(n,i),e=!1},d(i){n&&n.d(i)}}}function T_(s){let e,t=s[4](s[1])+"",n,i,r;return{c(){e=x("button"),n=I(t),this.h()},l(l){e=A(l,"BUTTON",{class:!0});var o=P(e);n=z(o,t),o.forEach(_),this.h()},h(){k(e,"class","svelte-1w145fq"),ie(e,"navigable",s[1].filename)},m(l,o){S(l,e,o),y(e,n),i||(r=[ue(e,"click",s[8]),ue(e,"keyup",s[9])],i=!0)},p(l,o){o&2&&t!==(t=l[4](l[1])+"")&&re(n,t),o&2&&ie(e,"navigable",l[1].filename)},i:de,o:de,d(l){l&&_(e),i=!1,Pn(r)}}}function E_(s){let e,t,n,i,r,l;const o=[T_,M_],a=[];function h(c,f){return c[1]?0:1}return t=h(s),n=a[t]=o[t](s),{c(){e=x("div"),n.c(),this.h()},l(c){e=A(c,"DIV",{class:!0});var f=P(e);n.l(f),f.forEach(_),this.h()},h(){k(e,"class",i="message "+s[0]+" svelte-1w145fq"),ie(e,"truncate",s[2])},m(c,f){S(c,e,f),a[t].m(e,null),l=!0},p(c,[f]){let u=t;t=h(c),t===u?a[t].p(c,f):(Se(),T(a[u],1,1,()=>{a[u]=null}),xe(),n=a[t],n?n.p(c,f):(n=a[t]=o[t](c),n.c()),w(n,1),n.m(e,null)),(!l||f&1&&i!==(i="message "+c[0]+" svelte-1w145fq"))&&k(e,"class",i),(!l||f&5)&&ie(e,"truncate",c[2])},i(c){l||(w(n),c&&Dr(()=>{l&&(r||(r=_a(e,va,{duration:100},!0)),r.run(1))}),l=!0)},o(c){T(n),c&&(r||(r=_a(e,va,{duration:100},!1)),r.run(0)),l=!1},d(c){c&&_(e),a[t].d(),c&&r&&r.end()}}}function O_(s,e,t){let{$$slots:n={},$$scope:i}=e,{kind:r="info"}=e,{details:l=void 0}=e,{filename:o=void 0}=e,{truncate:a=!1}=e;const{go_to_warning_pos:h}=di();function c(d){let p=d.message||"[missing message]",m=[];return d.filename&&d.filename!==o&&m.push(d.filename),d.start&&m.push(d.start.line,d.start.column),p+(m.length?` (${m.join(":")})`:"")}const f=()=>h(l),u=d=>d.key===" "&&h(l);return s.$$set=d=>{"kind"in d&&t(0,r=d.kind),"details"in d&&t(1,l=d.details),"filename"in d&&t(5,o=d.filename),"truncate"in d&&t(2,a=d.truncate),"$$scope"in d&&t(6,i=d.$$scope)},[r,l,a,h,c,o,i,n,f,u]}class Li extends _e{constructor(e){super(),ke(this,e,O_,E_,be,{kind:0,details:1,filename:5,truncate:2})}}const D_=ae.theme({"&":{color:"var(--sk-code-base)",backgroundColor:"transparent"},".cm-content":{caretColor:"var(--sk-theme-3)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--sk-theme-3)"},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"var(--sk-selection-color)"},".cm-panels":{backgroundColor:"var(--sk-back-2)",color:"var(--sk-text-2)"},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"var(--sk-theme-2)"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:"var(--sk-back-3)",border:"none"},".cm-activeLineGutter":{backgroundColor:"var(--sk-back-4)"},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:"var(--sk-back-3)"},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:"var(--sk-back-3)",borderBottomColor:"var(--sk-back-3)"},".cm-tooltip-autocomplete":{color:"var(--sk-text-2) !important",perspective:"1px","& > ul > li[aria-selected]":{backgroundColor:"var(--sk-back-4)",color:"var(--sk-text-1) !important"}}},{dark:!0}),P_=Ms.define([{tag:L.keyword,color:"var(--sk-code-keyword)"},{tag:[L.name,L.deleted,L.character,L.propertyName,L.macroName],color:"var(--sk-code-base)"},{tag:[L.function(L.variableName),L.labelName],color:"var(--sk-code-tags)"},{tag:[L.color,L.constant(L.name),L.standard(L.name)],color:"var(--sk-code-base)"},{tag:[L.definition(L.name),L.separator],color:"var(--sk-code-base)"},{tag:[L.typeName,L.className,L.number,L.changed,L.annotation,L.modifier,L.self,L.namespace],color:"var(--sk-code-tags)"},{tag:[L.operator,L.operatorKeyword,L.url,L.escape,L.regexp,L.link,L.special(L.string)],color:"var(--sk-code-base)"},{tag:[L.meta,L.comment],color:"var(--sk-code-comment)"},{tag:L.strong,fontWeight:"bold"},{tag:L.emphasis,fontStyle:"italic"},{tag:L.strikethrough,textDecoration:"line-through"},{tag:L.link,color:"var(--sk-code-base)",textDecoration:"underline"},{tag:L.heading,fontWeight:"bold",color:"var(--sk-text-1)"},{tag:[L.atom,L.bool],color:"var(--sk-code-atom)"},{tag:[L.processingInstruction,L.string,L.inserted],color:"var(--sk-code-string)"},{tag:L.invalid,color:"#ff008c"}]),yc=[D_,Z1(P_)];function wc(s){let e,t,n,i,r,l;return r=new Li({props:{kind:"info",$$slots:{default:[N_]},$$scope:{ctx:s}}}),{c(){e=x("pre"),t=I(s[5]),n=Q(),i=x("div"),U(r.$$.fragment),this.h()},l(o){e=A(o,"PRE",{style:!0,class:!0});var a=P(e);t=z(a,s[5]),a.forEach(_),n=ee(o),i=A(o,"DIV",{style:!0});var h=P(i);G(r.$$.fragment,h),h.forEach(_),this.h()},h(){it(e,"position","absolute"),it(e,"left","0"),it(e,"top","0"),k(e,"class","svelte-1s16tri"),it(i,"position","absolute"),it(i,"width","100%"),it(i,"bottom","0")},m(o,a){S(o,e,a),y(e,t),S(o,n,a),S(o,i,a),K(r,i,null),l=!0},p(o,a){(!l||a[0]&32)&&re(t,o[5]);const h={};a[1]&4&&(h.$$scope={dirty:a,ctx:o}),r.$set(h)},i(o){l||(w(r.$$.fragment,o),l=!0)},o(o){T(r.$$.fragment,o),l=!1},d(o){o&&(_(e),_(n),_(i)),J(r)}}}function N_(s){let e;return{c(){e=I("loading editor...")},l(t){e=z(t,"loading editor...")},m(t,n){S(t,e,n)},d(t){t&&_(e)}}}function B_(s){let e,t,n,i,r,l=!s[4].view&&wc(s);return{c(){e=x("div"),l&&l.c(),this.h()},l(o){e=A(o,"DIV",{class:!0});var a=P(e);l&&l.l(a),a.forEach(_),this.h()},h(){k(e,"class","codemirror-container svelte-1s16tri")},m(o,a){S(o,e,a),l&&l.m(e,null),n=!0,i||(r=[Uf(t=A_.call(null,e,{value:s[5],setup:"basic",useTabs:s[2],tabSize:2,theme:yc,readonly:s[1],cursorPos:s[7],lang:s[6],langMap:{js:Sc,json:xc,md:Ac,css:Cc,svelte:Mc},lint:s[0],lintOptions:{delay:200},autocomplete:s[3],extensions:[s[10]],instanceStore:s[9]})),ue(e,"codemirror:textChange",s[25])],i=!0)},p(o,a){o[4].view?l&&(Se(),T(l,1,1,()=>{l=null}),xe()):l?(l.p(o,a),a[0]&16&&w(l,1)):(l=wc(o),l.c(),w(l,1),l.m(e,null)),t&&Jf(t.update)&&a[0]&239&&t.update.call(null,{value:o[5],setup:"basic",useTabs:o[2],tabSize:2,theme:yc,readonly:o[1],cursorPos:o[7],lang:o[6],langMap:{js:Sc,json:xc,md:Ac,css:Cc,svelte:Mc},lint:o[0],lintOptions:{delay:200},autocomplete:o[3],extensions:[o[10]],instanceStore:o[9]})},i(o){n||(w(l),n=!0)},o(o){T(l),n=!1},d(o){o&&_(e),l&&l.d(),i=!1,Pn(r)}}}const vp=ot(0),Sc=()=>Mn(()=>import("./index.b7370d0a.js").then(s=>s.i),["./index.b7370d0a.js","./index.85d7a4c4.js","./scheduler.8d4e2d99.js","./index.f7bb3215.js"],import.meta.url).then(s=>s.javascript()),xc=()=>Mn(()=>import("./index.eefcc910.js"),["./index.eefcc910.js","./index.85d7a4c4.js","./scheduler.8d4e2d99.js"],import.meta.url).then(s=>s.json()),Ac=()=>Mn(()=>import("./index.a3e636e9.js"),["./index.a3e636e9.js","./index.f7bb3215.js","./index.a4ffebf4.js","./index.85d7a4c4.js","./scheduler.8d4e2d99.js","./index.55f58a35.js","./index.b7370d0a.js"],import.meta.url).then(s=>s.markdown()),Cc=()=>Mn(()=>import("./index.55f58a35.js"),["./index.55f58a35.js","./index.85d7a4c4.js","./scheduler.8d4e2d99.js"],import.meta.url).then(s=>s.css()),Mc=()=>Mn(()=>import("./index.eaa2cc31.js"),["./index.eaa2cc31.js","./index.85d7a4c4.js","./scheduler.8d4e2d99.js","./index.55f58a35.js","./index.b7370d0a.js","./index.f7bb3215.js","./index.a4ffebf4.js"],import.meta.url).then(s=>s.svelte());function L_(s,e,t){let n,{errorLoc:i=null}=e,{diagnostics:r=void 0}=e,{readonly:l=!1}=e,{tab:o=!0}=e,{autocomplete:a=!0}=e;const h=Pr();let c="",f="svelte";async function u(j){d(j)}async function d(j){if(n.view&&(await as(),j.lang&&j.lang!==f&&t(6,f=j.lang),j.code!==void 0)){const{scrollLeft:fe,scrollTop:ge}=n.view.scrollDOM;t(5,c=j.code),Ve(F,n.view.scrollDOM.scrollTop=ge,n),Ve(F,n.view.scrollDOM.scrollLeft=fe,n)}}function p(j){t(7,ne=j)}let m;const g=new Promise(j=>t(23,m=j));function b(){var j;(j=n.view)==null||j.requestMeasure()}function v(){var j;(j=n.view)==null||j.focus()}function O(){var j;return(j=n.view)==null?void 0:j.state.toJSON({history:ic})}function M(j){var fe;n.view&&(n.view.setState(ye.fromJSON(j,{extensions:W,doc:j.doc},{history:ic})),(fe=n.view)==null||fe.dispatch({changes:{from:0,to:n.view.state.doc.length,insert:j.doc},effects:[Ne.reconfigure.of(n.extensions??[])]}))}async function B(){var j,fe;await as(),(j=n.view)==null||j.setState(ye.create({extensions:W,doc:""})),(fe=n.view)==null||fe.dispatch({changes:{from:0,to:n.view.state.doc.length,insert:""},effects:[Ne.reconfigure.of(n.extensions??[])]})}const N=Ne.define(),E=Nt.define({create(){return Be.none},update(j,fe){j=j.map(fe.changes);for(let ge of fe.effects)ge.is(N)&&(j=j.update({add:ge.value,sort:!0}));return j},provide:j=>ae.decorations.from(j)});function V({from:j,to:fe,className:ge="mark-text"}){var we;const Re=Be.mark({class:ge});(we=n.view)==null||we.dispatch({effects:[Ne.appendConfig.of(E),N.of([Re.range(j,fe)])]})}function $(){var j;(j=n.view)==null||j.dispatch({effects:Ne.reconfigure.of(n.extensions??[])})}const F=x_();Me(s,F,j=>t(4,n=j));let R,D,C=!1,W=[],ne=0;const Y=ae.updateListener.of(j=>{j.selectionSet&&vp.set(j.state.selection.main.head)}),he=({detail:j})=>{t(5,c=j),h("change",{value:c})};return s.$$set=j=>{"errorLoc"in j&&t(11,i=j.errorLoc),"diagnostics"in j&&t(0,r=j.diagnostics),"readonly"in j&&t(1,l=j.readonly),"tab"in j&&t(2,o=j.tab),"autocomplete"in j&&t(3,a=j.autocomplete)},s.$$.update=()=>{s.$$.dirty[0]&8388624&&n.view&&m(),s.$$.dirty[0]&16&&n.view&&R&&D&&b(),s.$$.dirty[0]&16779264&&i&&(V({from:i.character,to:i.character+1,className:"error-loc"}),i.line)},[r,l,o,a,n,c,f,ne,h,F,Y,i,u,d,p,g,b,v,O,M,B,V,$,m,C,he]}class qr extends _e{constructor(e){super(),ke(this,e,L_,B_,be,{errorLoc:11,diagnostics:0,readonly:1,tab:2,autocomplete:3,set:12,update:13,setCursor:14,isReady:15,resize:16,focus:17,getEditorState:18,setEditorState:19,clearEditorState:20,markText:21,unmarkText:22},null,[-1,-1])}get set(){return this.$$.ctx[12]}get update(){return this.$$.ctx[13]}get setCursor(){return this.$$.ctx[14]}get isReady(){return this.$$.ctx[15]}get resize(){return this.$$.ctx[16]}get focus(){return this.$$.ctx[17]}get getEditorState(){return this.$$.ctx[18]}get setEditorState(){return this.$$.ctx[19]}get clearEditorState(){return this.$$.ctx[20]}get markText(){return this.$$.ctx[21]}get unmarkText(){return this.$$.ctx[22]}}function Tc(s,e,t){const n=s.slice();return n[17]=e[t],n}function $_(s){let e,t,n=Oe(s[3]),i=[];for(let l=0;lT(i[l],1,1,()=>{i[l]=null});return{c(){for(let l=0;l0?1:-1}return~(l=u(s))&&(o=f[l]=c[l](s)),{c(){e=x("div"),t=x("div"),U(n.$$.fragment),i=Q(),r=x("div"),o&&o.c(),this.h()},l(d){e=A(d,"DIV",{class:!0});var p=P(e);t=A(p,"DIV",{class:!0,translate:!0});var m=P(t);G(n.$$.fragment,m),m.forEach(_),i=ee(p),r=A(p,"DIV",{class:!0});var g=P(r);o&&o.l(g),g.forEach(_),p.forEach(_),this.h()},h(){k(t,"class","editor notranslate svelte-62nfk2"),k(t,"translate","no"),k(r,"class","info svelte-62nfk2"),k(e,"class","editor-wrapper svelte-62nfk2")},m(d,p){S(d,e,p),y(e,t),K(n,t,null),y(e,i),y(e,r),~l&&f[l].m(r,null),a=!0},p(d,[p]){const m={};p&1&&(m.errorLoc=d[0]),p&2&&(m.autocomplete=d[1]),n.$set(m);let g=l;l=u(d),l===g?~l&&f[l].p(d,p):(o&&(Se(),T(f[g],1,1,()=>{f[g]=null}),xe()),~l?(o=f[l],o?o.p(d,p):(o=f[l]=c[l](d),o.c()),w(o,1),o.m(r,null)):o=null)},i(d){a||(w(n.$$.fragment,d),w(o),a=!0)},o(d){T(n.$$.fragment,d),T(o),a=!1},d(d){d&&_(e),s[15](null),J(n),~l&&f[l].d()}}}function z_(s,e,t){let n,i,r,l,o,{errorLoc:a=null}=e,{autocomplete:h}=e;function c(){o==null||o.focus()}const{bundle:f,handle_change:u,module_editor:d,selected:p,bundling:m}=di();Me(s,f,M=>t(14,l=M)),Me(s,d,M=>t(5,o=M)),Me(s,p,M=>t(13,i=M)),Me(s,m,M=>t(16,r=M));let g=null,b=[];async function v(){return await r,[...i&&(g==null?void 0:g.filename)===$e(i)?[{from:g.start.character,to:g.end.character,severity:"error",message:g.message}]:[],...b.filter(M=>i&&M.filename===$e(i)).map(M=>({from:M.start.character,to:M.end.character,severity:"warning",message:M.message}))]}function O(M){Ye[M?"unshift":"push"](()=>{o=M,d.set(o)})}return s.$$set=M=>{"errorLoc"in M&&t(0,a=M.errorLoc),"autocomplete"in M&&t(1,h=M.autocomplete)},s.$$.update=()=>{s.$$.dirty&8192&&t(4,n=(i==null?void 0:i.name)+"."+(i==null?void 0:i.type)),s.$$.dirty&16384&&l&&(t(2,g=l==null?void 0:l.error),t(3,b=(l==null?void 0:l.warnings)??[]))},[a,h,g,b,n,o,f,u,d,p,m,v,c,i,l,O]}class j_ extends _e{constructor(e){super(),ke(this,e,z_,I_,be,{errorLoc:0,autocomplete:1,focus:12})}get focus(){return this.$$.ctx[12]}}function V_(s){let e,t,n;return{c(){e=x("input"),this.h()},l(i){e=A(i,"INPUT",{type:!0,class:!0}),this.h()},h(){k(e,"type","checkbox"),k(e,"class","svelte-1ja98dc")},m(i,r){S(i,e,r),e.checked=s[0],t||(n=ue(e,"change",s[1]),t=!0)},p(i,[r]){r&1&&(e.checked=i[0])},i:de,o:de,d(i){i&&_(e),t=!1,n()}}}function H_(s,e,t){let{checked:n=!1}=e;function i(){n=this.checked,t(0,n)}return s.$$set=r=>{"checked"in r&&t(0,n=r.checked)},[n,i]}class yi extends _e{constructor(e){super(),ke(this,e,H_,V_,be,{checked:0})}}function F_(s){let e,t,n="input",i,r,l,o,a,h,c="output",f;function u(p){s[1](p)}let d={};return s[0]!==void 0&&(d.checked=s[0]),l=new yi({props:d}),Ye.push(()=>on(l,"checked",u)),{c(){e=x("label"),t=x("span"),t.textContent=n,i=Q(),r=x("span"),U(l.$$.fragment),a=Q(),h=x("span"),h.textContent=c,this.h()},l(p){e=A(p,"LABEL",{class:!0});var m=P(e);t=A(m,"SPAN",{style:!0,class:!0,"data-svelte-h":!0}),Te(t)!=="svelte-iwcvz2"&&(t.textContent=n),i=ee(m),r=A(m,"SPAN",{style:!0,class:!0});var g=P(r);G(l.$$.fragment,g),g.forEach(_),a=ee(m),h=A(m,"SPAN",{class:!0,"data-svelte-h":!0}),Te(h)!=="svelte-4pjs0t"&&(h.textContent=c),m.forEach(_),this.h()},h(){it(t,"text-align","right"),k(t,"class","svelte-l6oyfu"),ie(t,"active",!s[0]),it(r,"display","grid"),it(r,"place-items","center"),k(r,"class","svelte-l6oyfu"),k(h,"class","svelte-l6oyfu"),ie(h,"active",s[0]),k(e,"class","input-output-toggle svelte-l6oyfu")},m(p,m){S(p,e,m),y(e,t),y(e,i),y(e,r),K(l,r,null),y(e,a),y(e,h),f=!0},p(p,[m]){(!f||m&1)&&ie(t,"active",!p[0]);const g={};!o&&m&1&&(o=!0,g.checked=p[0],ln(()=>o=!1)),l.$set(g),(!f||m&1)&&ie(h,"active",p[0])},i(p){f||(w(l.$$.fragment,p),f=!0)},o(p){T(l.$$.fragment,p),f=!1},d(p){p&&_(e),J(l)}}}function W_(s,e,t){let{checked:n=!1}=e;function i(r){n=r,t(0,n)}return s.$$set=r=>{"checked"in r&&t(0,n=r.checked)},[n,i]}class q_ extends _e{constructor(e){super(),ke(this,e,W_,F_,be,{checked:0})}}function Qo(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Zn=Qo();function yp(s){Zn=s}const wp=/[&<>"']/,U_=new RegExp(wp.source,"g"),Sp=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,K_=new RegExp(Sp.source,"g"),J_={"&":"&","<":"<",">":">",'"':""","'":"'"},Oc=s=>J_[s];function at(s,e){if(e){if(wp.test(s))return s.replace(U_,Oc)}else if(Sp.test(s))return s.replace(K_,Oc);return s}const G_=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function xp(s){return s.replace(G_,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const Y_=/(^|[^\[])\^/g;function Le(s,e){s=typeof s=="string"?s:s.source,e=e||"";const t={replace:(n,i)=>(i=i.source||i,i=i.replace(Y_,"$1"),s=s.replace(n,i),t),getRegex:()=>new RegExp(s,e)};return t}const X_=/[^\w:]/g,Z_=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Dc(s,e,t){if(s){let n;try{n=decodeURIComponent(xp(t)).replace(X_,"").toLowerCase()}catch{return null}if(n.indexOf("javascript:")===0||n.indexOf("vbscript:")===0||n.indexOf("data:")===0)return null}e&&!Z_.test(t)&&(t=nk(e,t));try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}const Zs={},Q_=/^[^:]+:\/*[^/]*$/,ek=/^([^:]+:)[\s\S]*$/,tk=/^([^:]+:\/*[^/]*)[\s\S]*$/;function nk(s,e){Zs[" "+s]||(Q_.test(s)?Zs[" "+s]=s+"/":Zs[" "+s]=hr(s,"/",!0)),s=Zs[" "+s];const t=s.indexOf(":")===-1;return e.substring(0,2)==="//"?t?e:s.replace(ek,"$1")+e:e.charAt(0)==="/"?t?e:s.replace(tk,"$1")+e:s+e}const Ar={exec:function(){}};function Pc(s,e){const t=s.replace(/\|/g,(r,l,o)=>{let a=!1,h=l;for(;--h>=0&&o[h]==="\\";)a=!a;return a?"|":" |"}),n=t.split(/ \|/);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>e)n.splice(e);else for(;n.length{const r=i.match(/^\s+/);if(r===null)return i;const[l]=r;return l.length>=n.length?i.slice(n.length):i}).join(` `)}class Cr{constructor(e){this.options=e||Zn}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 n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:hr(n,` `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],i=rk(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(/#$/.test(n)){const i=hr(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const n=t[0].replace(/^ *>[ \t]?/gm,""),i=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(n);return this.lexer.state.top=i,{type:"blockquote",raw:t[0],tokens:r,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,i,r,l,o,a,h,c,f,u,d,p,m=t[1].trim();const g=m.length>1,b={type:"list",raw:"",ordered:g,start:g?+m.slice(0,-1):"",loose:!1,items:[]};m=g?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=g?m:"[*+-]");const v=new RegExp(`^( {0,3}${m})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;e&&(p=!1,!(!(t=v.exec(e))||this.rules.block.hr.test(e)));){if(n=t[0],e=e.substring(n.length),c=t[2].split(` diff --git a/docs/_app/immutable/chunks/Markdown.8506a4bc.js b/docs/_app/immutable/chunks/Markdown.9968e4f5.js similarity index 97% rename from docs/_app/immutable/chunks/Markdown.8506a4bc.js rename to docs/_app/immutable/chunks/Markdown.9968e4f5.js index 940deba..31131e2 100644 --- a/docs/_app/immutable/chunks/Markdown.8506a4bc.js +++ b/docs/_app/immutable/chunks/Markdown.9968e4f5.js @@ -1 +1 @@ -import{_ as u}from"./preload-helper.a4192956.js";import{s as T,f as E,a as $,g as w,h as P,c as C,d as f,j as A,i as p,w as L,$ as M,l as q,m as S,n as j,x as z,r as h,C as F,E as G,F as H,G as N,q as g,e as k}from"./scheduler.8d4e2d99.js";import{S as B,i as J,g as O,t as m,c as R,a as d,b,d as K,m as D,e as I}from"./index.e9e8ac0c.js";const et={home:async()=>(await u(()=>import("./page.3c2d17ba.js"),["./page.3c2d17ba.js","./scheduler.8d4e2d99.js","./index.e9e8ac0c.js","./SveltyPicker.4b99d2dd.js","./each.5f097185.js","./index.a4c1e395.js","./index.9ff153fe.js","..\\assets\\SveltyPicker.60a34377.css"],import.meta.url)).default,properties:async()=>(await u(()=>import("./page.20a06ef7.js"),["./page.20a06ef7.js","./scheduler.8d4e2d99.js","./index.e9e8ac0c.js"],import.meta.url)).default,principles:async()=>(await u(()=>import("./page.d29df604.js"),["./page.d29df604.js","./scheduler.8d4e2d99.js","./index.e9e8ac0c.js"],import.meta.url)).default,formatting:async()=>(await u(()=>import("./page.96e47517.js"),["./page.96e47517.js","./scheduler.8d4e2d99.js","./index.e9e8ac0c.js"],import.meta.url)).default,"auto-commit":async()=>(await u(()=>import("./page.83013094.js"),["./page.83013094.js","./scheduler.8d4e2d99.js","./index.e9e8ac0c.js"],import.meta.url)).default,"disabling-dates":async()=>(await u(()=>import("./page.1b8dffa3.js"),["./page.1b8dffa3.js","./scheduler.8d4e2d99.js","./index.e9e8ac0c.js"],import.meta.url)).default,slots:async()=>(await u(()=>import("./page.de0a1021.js"),["./page.de0a1021.js","./scheduler.8d4e2d99.js","./index.e9e8ac0c.js"],import.meta.url)).default,events:async()=>(await u(()=>import("./page.61b9f2bc.js"),["./page.61b9f2bc.js","./scheduler.8d4e2d99.js","./index.e9e8ac0c.js"],import.meta.url)).default,theme:async()=>(await u(()=>import("./page.1c83d577.js"),["./page.1c83d577.js","./scheduler.8d4e2d99.js","./index.e9e8ac0c.js"],import.meta.url)).default,localization:async()=>(await u(()=>import("./page.5499a55c.js"),["./page.5499a55c.js","./scheduler.8d4e2d99.js","./index.e9e8ac0c.js","./index.a4c1e395.js"],import.meta.url)).default,"global-config":async()=>(await u(()=>import("./page.43e0a86f.js"),["./page.43e0a86f.js","./scheduler.8d4e2d99.js","./index.e9e8ac0c.js"],import.meta.url)).default};function V(r){let t,o;return{c(){t=E("h1"),o=q(r[0])},l(e){t=w(e,"H1",{});var a=P(t);o=S(a,r[0]),a.forEach(f)},m(e,a){p(e,t,a),L(t,o)},p(e,a){a&1&&j(o,e[0])},d(e){e&&f(t)}}}function Q(r){let t,o="loading ...";return{c(){t=E("div"),t.textContent=o,this.h()},l(e){t=w(e,"DIV",{class:!0,"data-svelte-h":!0}),z(t)!=="svelte-va05nw"&&(t.textContent=o),this.h()},h(){A(t,"class","text-center")},m(e,a){p(e,t,a)},p:h,i:h,o:h,d(e){e&&f(t)}}}function U(r){let t;const o=r[4].default,e=F(o,r,r[3],null);return{c(){e&&e.c()},l(a){e&&e.l(a)},m(a,s){e&&e.m(a,s),t=!0},p(a,s){e&&e.p&&(!t||s&8)&&G(e,o,a,a[3],t?N(o,a[3],s,null):H(a[3]),null)},i(a){t||(d(e,a),t=!0)},o(a){m(e,a),t=!1},d(a){e&&e.d(a)}}}function W(r){let t,o,e;var a=r[1];function s(i,_){return{}}return a&&(t=g(a,s())),{c(){t&&b(t.$$.fragment),o=k()},l(i){t&&K(t.$$.fragment,i),o=k()},m(i,_){t&&D(t,i,_),p(i,o,_),e=!0},p(i,_){if(_&2&&a!==(a=i[1])){if(t){O();const n=t;m(n.$$.fragment,1,0,()=>{I(n,1)}),R()}a?(t=g(a,s()),b(t.$$.fragment),d(t.$$.fragment,1),D(t,o.parentNode,o)):t=null}},i(i){e||(t&&d(t.$$.fragment,i),e=!0)},o(i){t&&m(t.$$.fragment,i),e=!1},d(i){i&&f(o),t&&I(t,i)}}}function X(r){let t,o,e,a,s,i=r[0]&&V(r);const _=[W,U,Q],n=[];function y(l,c){return l[1]?0:l[2].default?1:2}return e=y(r),a=n[e]=_[e](r),{c(){t=E("div"),i&&i.c(),o=$(),a.c(),this.h()},l(l){t=w(l,"DIV",{class:!0});var c=P(t);i&&i.l(c),o=C(c),a.l(c),c.forEach(f),this.h()},h(){A(t,"class","markdown-container svelte-1i37ee3")},m(l,c){p(l,t,c),i&&i.m(t,null),L(t,o),n[e].m(t,null),s=!0},p(l,[c]){l[0]?i?i.p(l,c):(i=V(l),i.c(),i.m(t,o)):i&&(i.d(1),i=null);let v=e;e=y(l),e===v?n[e].p(l,c):(O(),m(n[v],1,1,()=>{n[v]=null}),R(),a=n[e],a?a.p(l,c):(a=n[e]=_[e](l),a.c()),d(a,1),a.m(t,null))},i(l){s||(d(a),s=!0)},o(l){m(a),s=!1},d(l){l&&f(t),i&&i.d(),n[e].d()}}}function Y(r,t,o){let{$$slots:e={},$$scope:a}=t;const s=M(e);let{title:i}=t,{content:_}=t;return r.$$set=n=>{"title"in n&&o(0,i=n.title),"content"in n&&o(1,_=n.content),"$$scope"in n&&o(3,a=n.$$scope)},[i,_,s,a,e]}class at extends B{constructor(t){super(),J(this,t,Y,X,T,{title:0,content:1})}}export{at as M,et as f}; +import{_ as u}from"./preload-helper.a4192956.js";import{s as T,f as E,a as $,g as w,h as P,c as C,d as f,j as A,i as p,w as L,$ as M,l as q,m as S,n as j,x as z,r as h,C as F,E as G,F as H,G as N,q as g,e as k}from"./scheduler.8d4e2d99.js";import{S as B,i as J,g as O,t as m,c as R,a as d,b,d as K,m as D,e as I}from"./index.e9e8ac0c.js";const et={home:async()=>(await u(()=>import("./page.678a93c0.js"),["./page.678a93c0.js","./scheduler.8d4e2d99.js","./index.e9e8ac0c.js","./SveltyPicker.855fb4f3.js","./each.5f097185.js","./index.a4c1e395.js","./index.9ff153fe.js","..\\assets\\SveltyPicker.60a34377.css"],import.meta.url)).default,properties:async()=>(await u(()=>import("./page.20a06ef7.js"),["./page.20a06ef7.js","./scheduler.8d4e2d99.js","./index.e9e8ac0c.js"],import.meta.url)).default,principles:async()=>(await u(()=>import("./page.d29df604.js"),["./page.d29df604.js","./scheduler.8d4e2d99.js","./index.e9e8ac0c.js"],import.meta.url)).default,formatting:async()=>(await u(()=>import("./page.96e47517.js"),["./page.96e47517.js","./scheduler.8d4e2d99.js","./index.e9e8ac0c.js"],import.meta.url)).default,"auto-commit":async()=>(await u(()=>import("./page.83013094.js"),["./page.83013094.js","./scheduler.8d4e2d99.js","./index.e9e8ac0c.js"],import.meta.url)).default,"disabling-dates":async()=>(await u(()=>import("./page.1b8dffa3.js"),["./page.1b8dffa3.js","./scheduler.8d4e2d99.js","./index.e9e8ac0c.js"],import.meta.url)).default,slots:async()=>(await u(()=>import("./page.de0a1021.js"),["./page.de0a1021.js","./scheduler.8d4e2d99.js","./index.e9e8ac0c.js"],import.meta.url)).default,events:async()=>(await u(()=>import("./page.61b9f2bc.js"),["./page.61b9f2bc.js","./scheduler.8d4e2d99.js","./index.e9e8ac0c.js"],import.meta.url)).default,theme:async()=>(await u(()=>import("./page.1c83d577.js"),["./page.1c83d577.js","./scheduler.8d4e2d99.js","./index.e9e8ac0c.js"],import.meta.url)).default,localization:async()=>(await u(()=>import("./page.5499a55c.js"),["./page.5499a55c.js","./scheduler.8d4e2d99.js","./index.e9e8ac0c.js","./index.a4c1e395.js"],import.meta.url)).default,"global-config":async()=>(await u(()=>import("./page.43e0a86f.js"),["./page.43e0a86f.js","./scheduler.8d4e2d99.js","./index.e9e8ac0c.js"],import.meta.url)).default};function V(r){let t,o;return{c(){t=E("h1"),o=q(r[0])},l(e){t=w(e,"H1",{});var a=P(t);o=S(a,r[0]),a.forEach(f)},m(e,a){p(e,t,a),L(t,o)},p(e,a){a&1&&j(o,e[0])},d(e){e&&f(t)}}}function Q(r){let t,o="loading ...";return{c(){t=E("div"),t.textContent=o,this.h()},l(e){t=w(e,"DIV",{class:!0,"data-svelte-h":!0}),z(t)!=="svelte-va05nw"&&(t.textContent=o),this.h()},h(){A(t,"class","text-center")},m(e,a){p(e,t,a)},p:h,i:h,o:h,d(e){e&&f(t)}}}function U(r){let t;const o=r[4].default,e=F(o,r,r[3],null);return{c(){e&&e.c()},l(a){e&&e.l(a)},m(a,s){e&&e.m(a,s),t=!0},p(a,s){e&&e.p&&(!t||s&8)&&G(e,o,a,a[3],t?N(o,a[3],s,null):H(a[3]),null)},i(a){t||(d(e,a),t=!0)},o(a){m(e,a),t=!1},d(a){e&&e.d(a)}}}function W(r){let t,o,e;var a=r[1];function s(i,_){return{}}return a&&(t=g(a,s())),{c(){t&&b(t.$$.fragment),o=k()},l(i){t&&K(t.$$.fragment,i),o=k()},m(i,_){t&&D(t,i,_),p(i,o,_),e=!0},p(i,_){if(_&2&&a!==(a=i[1])){if(t){O();const n=t;m(n.$$.fragment,1,0,()=>{I(n,1)}),R()}a?(t=g(a,s()),b(t.$$.fragment),d(t.$$.fragment,1),D(t,o.parentNode,o)):t=null}},i(i){e||(t&&d(t.$$.fragment,i),e=!0)},o(i){t&&m(t.$$.fragment,i),e=!1},d(i){i&&f(o),t&&I(t,i)}}}function X(r){let t,o,e,a,s,i=r[0]&&V(r);const _=[W,U,Q],n=[];function y(l,c){return l[1]?0:l[2].default?1:2}return e=y(r),a=n[e]=_[e](r),{c(){t=E("div"),i&&i.c(),o=$(),a.c(),this.h()},l(l){t=w(l,"DIV",{class:!0});var c=P(t);i&&i.l(c),o=C(c),a.l(c),c.forEach(f),this.h()},h(){A(t,"class","markdown-container svelte-1i37ee3")},m(l,c){p(l,t,c),i&&i.m(t,null),L(t,o),n[e].m(t,null),s=!0},p(l,[c]){l[0]?i?i.p(l,c):(i=V(l),i.c(),i.m(t,o)):i&&(i.d(1),i=null);let v=e;e=y(l),e===v?n[e].p(l,c):(O(),m(n[v],1,1,()=>{n[v]=null}),R(),a=n[e],a?a.p(l,c):(a=n[e]=_[e](l),a.c()),d(a,1),a.m(t,null))},i(l){s||(d(a),s=!0)},o(l){m(a),s=!1},d(l){l&&f(t),i&&i.d(),n[e].d()}}}function Y(r,t,o){let{$$slots:e={},$$scope:a}=t;const s=M(e);let{title:i}=t,{content:_}=t;return r.$$set=n=>{"title"in n&&o(0,i=n.title),"content"in n&&o(1,_=n.content),"$$scope"in n&&o(3,a=n.$$scope)},[i,_,s,a,e]}class at extends B{constructor(t){super(),J(this,t,Y,X,T,{title:0,content:1})}}export{at as M,et as f}; diff --git a/docs/_app/immutable/chunks/SveltyPicker.4b99d2dd.js b/docs/_app/immutable/chunks/SveltyPicker.4b99d2dd.js deleted file mode 100644 index 030907f..0000000 --- a/docs/_app/immutable/chunks/SveltyPicker.4b99d2dd.js +++ /dev/null @@ -1,4 +0,0 @@ -import{s as Nt,f as V,l as he,a as x,af as Re,g as I,h as R,m as de,d as v,c as $,ag as Ne,x as Dt,j as b,v as z,i as j,w as Y,y as X,n as ge,N as He,L as Vt,k as $t,J as Ke,u as ht,Q as zn,O as Wn,t as qn,p as kt,e as Pe,r as Il,C as Gn,E as Xn,F as Kn,G as Zn,o as Pl,M as Jn,W as Bt,U as Ee}from"./scheduler.8d4e2d99.js";import{S as It,i as Pt,a as le,g as Ve,t as ue,c as Ie,j as Ct,k as Lt,f as tt,b as Qn,d as xn,m as $n,e as el}from"./index.e9e8ac0c.js";import{e as oe,u as gt,d as Ut,o as tl}from"./each.5f097185.js";import{e as Ll}from"./index.a4c1e395.js";import{c as Ul,f as Ge}from"./index.9ff153fe.js";const jl={theme:"sdt-calendar-colors",format:"yyyy-mm-dd",formatType:"standard",displayFormat:null,displayFormatType:null,minuteIncrement:1,weekStart:1,inputClasses:"",todayBtnClasses:"sdt-action-btn sdt-today-btn",clearBtnClasses:"sdt-action-btn sdt-clear-btn",hourOnly:!1,todayBtn:!0,clearBtn:!0,clearToggle:!0,autocommit:!0,i18n:Ll},Fe=0,We=1,ke=2,zl=3;function ct(t,e,n,l){var _,y;if(t instanceof Date)return t;const i=l==="php"?{date:"Y-m-d",datetime:"Y-m-d H:i",datetime_s:"Y-m-d H:i:s"}:{date:"yyyy-mm-dd",datetime:"yyyy-mm-dd hh:ii",datetime_s:"yyyy-mm-dd hh:ii:ss"};let s,a;/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(t)?s=Be.parseFormat(i.date,l):/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(t)?s=Be.parseFormat(i.datetime,l):/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(t)?s=Be.parseFormat(i.datetime_s,l):(/^([01]*\d|2[0-3])([0-5]\d)(?:[ ]([ap][m]|[AP][M]))?$/.test(t)&&(a=(_=t.match(/^([01]*\d|2[0-3])([0-5]\d)(?:[ ]([ap][m]|[AP][M]))?$/))==null?void 0:_.slice(1).filter(C=>C)),s=Be.parseFormat(e,l));const r=a||t&&t.toString().match(Be.nonpunctuation)||[];t=new Date,t.setHours(0,0,0,0);const o={},{setters_order:u,setters_map:c}=Be.setters(l);let f,g;if(r.length!==s.parts.length&&s.parts.includes("S")){const C=(y=r[s.parts.indexOf("S")-1].match(/(\d+)([a-zA-Z]+)/))==null?void 0:y.slice(1,3);r.splice(s.parts.indexOf("S")-1,1,...C)}if(r.length===s.parts.length){for(var h=0,m=s.parts.length;hl.setHours(i),h:(l,i)=>l.setHours(i),HH:(l,i)=>l.setHours(i===12?0:i),H:(l,i)=>l.setHours(i===12?0:i),i:(l,i)=>l.setMinutes(i),s:(l,i)=>l.setSeconds(i),yyyy:(l,i)=>l.setFullYear(i),yy:(l,i)=>l.setFullYear((i<50?2e3:1900)+i),m:(l,i)=>{for(i-=1;i<0;)i+=12;for(i%=12,l.setMonth(i);l.getMonth()!==i;){if(isNaN(l.getMonth()))return l;l.setDate(l.getDate()-1)}return l},d:(l,i)=>l.setDate(i),p:(l,i)=>l.setHours(i===1&&l.getHours()<12?l.getHours()+12:l.getHours()),t:(l,i)=>l.setTime(i),mm:()=>{},M:()=>{},MM:()=>{},ii:()=>{},ss:()=>{},dd:()=>{},D:()=>{},DD:()=>{},P:()=>{}},n.mm=n.M=n.MM=n.m,n.ii=n.i,n.ss=n.s,n.dd=n.D=n.DD=n.d,n.P=n.p):(e=["Y","yy","m","M","F","n","d","D","j","l","N","S","H","G","h","g","i","s","p","P","U"],n={H:(l,i)=>l.setHours(i),G:(l,i)=>l.setHours(i),h:(l,i)=>l.setHours(i===12?0:i),g:(l,i)=>l.setHours(i===12?0:i),i:(l,i)=>l.setMinutes(i),s:(l,i)=>l.setSeconds(i),Y:(l,i)=>l.setFullYear(i),yy:(l,i)=>l.setFullYear((i<50?2e3:1900)+i),m:(l,i)=>{for(i-=1;i<0;)i+=12;for(i%=12,l.setMonth(i);l.getMonth()!==i;){if(isNaN(l.getMonth()))return l;l.setDate(l.getDate()-1)}return l},n:(l,i)=>l.setMonth(i-1),d:(l,i)=>l.setDate(i),a:(l,i)=>l.setHours(i===1?l.getHours()+12:l.getHours()),U:(l,i)=>l.setTime(i*1e3)},n.F=n.M=n.m,n.D=n.j=n.l=n.N=n.d,n.A=n.a),{setters_order:e,setters_map:n}}};function Wl(t,e,n,l,i){if(n===Fe){let W=10,L=20;const H=-1,A=[];let p=[],P=t.getFullYear()-t.getFullYear()%10;P-=P%20?12:10,P%10&&(W=12,L=22);for(let T=0;T<32;T++)p.push(P+T),p.length===4&&(A.push(p),p=[]);let O=[];return e[0]||(e[0]=new Date),e[0].getFullYear()>=P&&O.push(e[0].getFullYear()%P),{years:A,todayMark:H,nextFrom:L,prevTo:W,selectionMark:O}}if(n===We){let W=[],L=[],H=12,A=24;const p=t.toISOString().split("T")[0].substring(0,8),P=new Date(p+"01 00:00:00"),O=P.getFullYear()-1;P.setFullYear(O);let T=0;for(let w=0;w<3;w++){for(let E=0;E<12;E++)P.setMonth(E),L.push(l.monthsShort[E%12]),L.length===4&&(W.push(L),L=[]);P.setFullYear(P.getFullYear()+1)}let B=[];return e[0]||(e[0]=new Date),e[0].getFullYear()-O>=0&&e[0].getFullYear()-O<=2&&B.push(e[0].getMonth()+(e[0].getFullYear()-O||0)*12),{months:W,todayMark:T,nextFrom:A,prevTo:H,selectionMark:B}}let s=t||new Date,a=s.getFullYear(),r=s.getMonth();s.getDate(),s.getHours();let o=new Date,u=new Date(a,r-1,28,0,0,0,0),c=nl(u.getFullYear(),u.getMonth());u.setDate(c),u.setDate(c-(u.getDay()-i+7)%7);let f=new Date(u);f.setDate(f.getDate()+42);let g=f.valueOf(),h=[],m=[],M=-1,_=[],y=0,C=42,F=0;for(;u.valueOf()a||u.getFullYear()===a&&u.getMonth()>r)&&(C=F-1),u.setDate(u.getDate()+1),u.getFullYear()===o.getFullYear()&&u.getMonth()===o.getMonth()&&u.getDate()===o.getDate()&&(M=F),_.length!==e.length&&e.map(W=>{u.getFullYear()===W.getFullYear()&&u.getMonth()===W.getMonth()&&u.getDate()===W.getDate()&&_.push(F)}),m.length===7&&(h.push(m),m=[]);return{grid:h,days:h,todayMark:M,prevTo:y,nextFrom:C,selectionMark:_}}function ql(t,{duration:e=400,start:n=0,end:l=1,opacity:i=0}){const s=getComputedStyle(t),a=+s.opacity,r=s.transform==="none"?"":s.transform,o=1-n,u=a*(1-i);return l=l||1,{delay:0,duration:e,easing:Ul,css:(c,f)=>` - transform: ${r} scale(${l!==1?n+l*f:1-o*f}); - opacity: ${a-u*f}; - `}}function en(t,e,n){const l=t.slice();return l[48]=e[n],l[50]=n,l}function tn(t,e,n){const l=t.slice();l[51]=e[n],l[55]=n;const i=l[50]*7+l[55];l[52]=i;const s=l[51].getTime();return l[53]=s,l}function nn(t,e,n){const l=t.slice();return l[56]=e[n],l}function ln(t,e,n){const l=t.slice();return l[48]=e[n],l[50]=n,l}function sn(t,e,n){const l=t.slice();l[60]=e[n],l[55]=n;const i=l[50]*4+l[55];return l[52]=i,l}function on(t,e,n){const l=t.slice();return l[48]=e[n],l[50]=n,l}function rn(t,e,n){const l=t.slice();l[63]=e[n],l[55]=n;const i=l[50]*4+l[55];return l[52]=i,l}function an(t){let e,n,l,i,s,a;return{c(){e=V("button"),n=Re("svg"),l=Re("path"),this.h()},l(r){e=I(r,"BUTTON",{type:!0,class:!0,title:!0});var o=R(e);n=Ne(o,"svg",{class:!0,xmlns:!0,viewBox:!0,width:!0,height:!0});var u=R(n);l=Ne(u,"path",{"fill-rule":!0,d:!0}),R(l).forEach(v),u.forEach(v),o.forEach(v),this.h()},h(){b(l,"fill-rule","evenodd"),b(l,"d","M1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0zM8 0a8 8 0 100 16A8 8 0 008 0zm.5 4.75a.75.75 0 00-1.5 0v3.5a.75.75 0 00.471.696l2.5 1a.75.75 0 00.557-1.392L8.5 7.742V4.75z"),b(n,"class","sdt-svg svelte-hexbpx"),b(n,"xmlns","http://www.w3.org/2000/svg"),b(n,"viewBox","0 0 16 16"),b(n,"width","16"),b(n,"height","16"),b(e,"type","button"),b(e,"class","std-btn std-btn-header icon-btn sdt-time-icon svelte-hexbpx"),b(e,"title",i=t[3].timeView)},m(r,o){j(r,e,o),Y(e,n),Y(n,l),s||(a=X(e,"click",t[28]),s=!0)},p(r,o){o[0]&8&&i!==(i=r[3].timeView)&&b(e,"title",i)},d(r){r&&v(e),s=!1,a()}}}function un(t){let e,n,l,i,s,a,r,o,u=oe(t[15].years),c=[];for(let f=0;f{a&&(s&&s.end(1),i=Ct(n,t[18],{duration:nt,start:t[20],opacity:1}),i.start())}),a=!0)},o(f){i&&i.invalidate(),f&&(s=Lt(n,t[18],{duration:nt,end:t[19],start:1})),a=!1},d(f){f&&v(e),ht(c,f),f&&s&&s.end(),r=!1,He(o)}}}function fn(t,e){let n,l,i=e[63]+"",s,a,r,o;function u(){return e[39](e[63])}return{key:t,first:null,c(){n=V("td"),l=V("button"),s=he(i),this.h()},l(c){n=I(c,"TD",{class:!0});var f=R(n);l=I(f,"BUTTON",{type:!0,class:!0});var g=R(l);s=de(g,i),g.forEach(v),f.forEach(v),this.h()},h(){b(l,"type","button"),b(l,"class","std-btn svelte-hexbpx"),l.disabled=a=e[22](new Date(e[63],e[7].getMonth(),e[7].getDate())),z(l,"not-current",!e[21](e[52])),b(n,"class","sdt-cal-td svelte-hexbpx"),z(n,"is-selected",e[15].selectionMark.includes(e[52])),this.first=n},m(c,f){j(c,n,f),Y(n,l),Y(l,s),r||(o=X(l,"click",u),r=!0)},p(c,f){e=c,f[0]&32768&&i!==(i=e[63]+"")&&ge(s,i),f[0]&32896&&a!==(a=e[22](new Date(e[63],e[7].getMonth(),e[7].getDate())))&&(l.disabled=a),f[0]&2129920&&z(l,"not-current",!e[21](e[52])),f[0]&32768&&z(n,"is-selected",e[15].selectionMark.includes(e[52]))},d(c){c&&v(n),r=!1,o()}}}function cn(t){let e,n=[],l=new Map,i,s=oe(t[48]);const a=r=>r[55];for(let r=0;r{a&&(s&&s.end(1),i=Ct(n,t[18],{duration:nt,start:t[20],opacity:1}),i.start())}),a=!0)},o(f){i&&i.invalidate(),f&&(s=Lt(n,t[18],{duration:nt,end:t[19],start:1})),a=!1},d(f){f&&v(e),ht(c,f),f&&s&&s.end(),r=!1,He(o)}}}function dn(t,e){let n,l,i=e[60]+"",s,a,r,o;function u(){return e[41](e[60])}return{key:t,first:null,c(){n=V("td"),l=V("button"),s=he(i),this.h()},l(c){n=I(c,"TD",{class:!0});var f=R(n);l=I(f,"BUTTON",{class:!0,type:!0});var g=R(l);s=de(g,i),g.forEach(v),f.forEach(v),this.h()},h(){b(l,"class","std-btn svelte-hexbpx"),b(l,"type","button"),l.disabled=a=e[22](new Date(e[7].getFullYear(),e[3].monthsShort.indexOf(e[60]),e[7].getDate())),z(l,"not-current",!e[21](e[52])),b(n,"class","sdt-cal-td svelte-hexbpx"),z(n,"is-selected",e[52]===e[15].selectionMark[0]),this.first=n},m(c,f){j(c,n,f),Y(n,l),Y(l,s),r||(o=X(l,"click",u),r=!0)},p(c,f){e=c,f[0]&32768&&i!==(i=e[60]+"")&&ge(s,i),f[0]&32904&&a!==(a=e[22](new Date(e[7].getFullYear(),e[3].monthsShort.indexOf(e[60]),e[7].getDate())))&&(l.disabled=a),f[0]&2129920&&z(l,"not-current",!e[21](e[52])),f[0]&32768&&z(n,"is-selected",e[52]===e[15].selectionMark[0])},d(c){c&&v(n),r=!1,o()}}}function gn(t){let e,n=[],l=new Map,i,s=oe(t[48]);const a=r=>r[55];for(let r=0;r{r&&(a&&a.end(1),s=Ct(n,t[18],{duration:nt,start:.5,opacity:1}),s.start())}),r=!0)},o(m){s&&s.invalidate(),m&&(a=Lt(n,t[18],{duration:nt,start:Math.abs(t[9])})),r=!1},d(m){m&&v(e),ht(f,m),ht(h,m),m&&a&&a.end(),o=!1,u()}}}function _n(t){let e,n=t[56]+"",l;return{c(){e=V("th"),l=he(n),this.h()},l(i){e=I(i,"TH",{class:!0});var s=R(e);l=de(s,n),s.forEach(v),this.h()},h(){b(e,"class","sdt-cal-th svelte-hexbpx")},m(i,s){j(i,e,s),Y(e,l)},p(i,s){s[0]&131072&&n!==(n=i[56]+"")&&ge(l,n)},d(i){i&&v(e)}}}function bn(t,e){let n,l,i=e[51].getDate()+"",s,a,r,o;function u(){return e[43](e[51])}return{key:t,first:null,c(){n=V("td"),l=V("button"),s=he(i),this.h()},l(c){n=I(c,"TD",{class:!0});var f=R(n);l=I(f,"BUTTON",{type:!0,class:!0});var g=R(l);s=de(g,i),g.forEach(v),f.forEach(v),this.h()},h(){b(l,"type","button"),b(l,"class","std-btn sdt-btn-day svelte-hexbpx"),l.disabled=a=(e[16]||e[2]||e[6])&&e[22](e[51]),z(l,"not-current",!e[21](e[50]*7+e[55])),b(n,"class","sdt-cal-td svelte-hexbpx"),z(n,"sdt-today",e[52]===e[15].todayMark),z(n,"in-range",e[30](e[53])),z(n,"is-selected",e[14].includes(e[53])),z(n,"in-range-hover",e[5]&&e[31](e[53],e[0])),this.first=n},m(c,f){j(c,n,f),Y(n,l),Y(l,s),r||(o=[X(l,"click",u),X(n,"mouseover",function(){zn(e[29](e[51]))&&e[29](e[51]).apply(this,arguments)}),X(n,"mouseout",e[29]())],r=!0)},p(c,f){e=c,f[0]&32768&&i!==(i=e[51].getDate()+"")&&ge(s,i),f[0]&98372&&a!==(a=(e[16]||e[2]||e[6])&&e[22](e[51]))&&(l.disabled=a),f[0]&2129920&&z(l,"not-current",!e[21](e[50]*7+e[55])),f[0]&32768&&z(n,"sdt-today",e[52]===e[15].todayMark),f[0]&1073774592&&z(n,"in-range",e[30](e[53])),f[0]&49152&&z(n,"is-selected",e[14].includes(e[53])),f[0]&32801|f[1]&1&&z(n,"in-range-hover",e[5]&&e[31](e[53],e[0]))},d(c){c&&v(n),r=!1,He(o)}}}function pn(t){let e,n=[],l=new Map,i,s=oe(t[48]);const a=r=>r[55];for(let r=0;r{P=null}),Ie()),B[8]===We?O?(O.p(B,w),w[0]&256&&le(O,1)):(O=hn(B),O.c(),le(O,1),O.m(F,L)):O&&(Ve(),ue(O,1,1,()=>{O=null}),Ie()),B[8]===ke?T?(T.p(B,w),w[0]&256&&le(T,1)):(T=mn(B),T.c(),le(T,1),T.m(F,null)):T&&(Ve(),ue(T,1,1,()=>{T=null}),Ie()),w[0]&1024&&z(F,"is-grid",B[10])},i(B){le(P),le(O),le(T)},o(B){ue(P),ue(O),ue(T)},d(B){B&&(v(e),v(C),v(F)),p&&p.d(),P&&P.d(),O&&O.d(),T&&T.d(),H=!1,He(A)}}}let nt=400;const Te=222,ft=148;function Xl(t,e,n){var Je;let l,i,s,a,r,o,u,c,{wid:f}=e,{dates:g}=e,{startDate:h=null}=e,{endDate:m=null}=e,{weekStart:M=1}=e,{initialView:_=ke}=e,{i18n:y}=e,{enableTimeToggle:C=!1}=e,{isRange:F=!1}=e,{hoverDate:W=null}=e,{additionalDisableFn:L}=e;function H(k,S){if(O!==ke){n(8,O=ke),n(9,T=1),n(7,p=new Date(A||new Date));return}if(!A){_e(new Date,{keyboard:!0});return}let U=new Date(A);switch(k){case"PageDown":S=!0;case"ArrowDown":S?U.setMonth(A.getMonth()+1):U.setDate(A.getDate()+7),S&&U.getMonth()===A.getMonth()&&U.setDate(0),_e(U,{keyboard:!0});break;case"PageUp":S=!0;case"ArrowUp":S?U.setMonth(A.getMonth()-1):U.setDate(A.getDate()-7),S&&U.getMonth()===A.getMonth()&&U.setDate(0),_e(U,{keyboard:!0});break;case"ArrowLeft":S?U.setFullYear(A.getFullYear()-1):U.setDate(A.getDate()-1),_e(U,{keyboard:!0});break;case"ArrowRight":S?U.setFullYear(A.getFullYear()+1):U.setDate(A.getDate()+1),_e(U,{keyboard:!0});break}}let A=g[f]||null,p=f===1?(()=>{if(g.length===2&&g[1]&&(g[0].getMonth()!=g[1].getMonth()||g[0].getFullYear()!=g[1].getFullYear()))return g[1];const k=new Date(g[0]||new Date);return k.setMonth(k.getMonth()+1),k})():new Date(((Je=g[0])==null?void 0:Je.valueOf())||new Date);const P=Vt();let O=_,T=-2,B=!1,w=Te,E=null;function N(k){return o.prevTo<=k&&kk||m&&m<=k||L&&L(k))return!0;break;case We:const S=k.getFullYear(),U=l==null?void 0:l.getFullYear(),G=m==null?void 0:m.getFullYear();if(l&&(U===S&&l.getMonth()>k.getMonth()||U>S)||m&&(G===S&&m.getMonth()k.getFullYear()||m&&m.getFullYear()ve.getFullYear():k.getFullYear()+S*10ve.getFullYear():k.getFullYear()+Sve.getFullYear()*100+ve.getMonth():k.getFullYear()*100+k.getMonth()+S28&&U.setDate(U.getDate()-3),U.setMonth(p.getMonth()+k*S),n(7,p=U),n(12,E=null),n(11,w=O===Fe?p.getFullYear()%20>=10?Te:ft:Te)}function re(k){if(O===ke)return J(k);if(n(12,E=()=>{J(k)}),O===Fe){n(11,w=w===ft?k===-1?w-Te:Te+ft:k===-1?w-Te:w+ft);return}n(11,w=k===-1?w-Te:w+Te)}function Oe(){if(n(9,T=-1),n(10,B=!0),O&&n(8,O--,O),O===Fe){const k=Math.floor(p.getFullYear()/10)*10%20===0;n(11,w=k?ft:Te)}}function _e(k,{keyboard:S}={}){switch(n(9,T=1),n(10,B=!0),O){case 0:p.setFullYear(k),n(7,p);break;case 1:p.setMonth(y.monthsShort.indexOf(k)),n(7,p);break;case 2:if(Q(k)||L&&L(k))return;const U=new Date(k.getFullYear(),k.getMonth(),k.getDate());A&&(U.setMinutes(A.getMinutes()),U.setHours(A.getHours())),A=U,S&&(p.getFullYear()!==U.getFullYear()||p.getFullYear()===U.getFullYear()&&p.getMonth()!==U.getMonth())&&(p.setFullYear(U.getFullYear()),p.getDate()>28&&p.setDate(28),p.setMonth(U.getMonth()),n(7,p)),P("date",{value:A,update:"date",isKeyboard:S});break}O=r[0]&&k=S&&r[0]>=k)}const fe=()=>re(-1),ie=()=>re(1),me=k=>{_e(k)},se=()=>E&&E(),we=k=>{_e(k)},ee=()=>E&&E(),K=k=>{_e(k)};return t.$$set=k=>{"wid"in k&&n(32,f=k.wid),"dates"in k&&n(1,g=k.dates),"startDate"in k&&n(33,h=k.startDate),"endDate"in k&&n(2,m=k.endDate),"weekStart"in k&&n(34,M=k.weekStart),"initialView"in k&&n(35,_=k.initialView),"i18n"in k&&n(3,y=k.i18n),"enableTimeToggle"in k&&n(4,C=k.enableTimeToggle),"isRange"in k&&n(5,F=k.isRange),"hoverDate"in k&&n(0,W=k.hoverDate),"additionalDisableFn"in k&&n(6,L=k.additionalDisableFn)},t.$$.update=()=>{t.$$.dirty[1]&4&&n(16,l=h?new Date(h.getFullYear(),h.getMonth(),h.getDate(),0,0,0,0):null),t.$$.dirty[0]&512&&n(20,i=T<1?1.5:.5),t.$$.dirty[0]&512&&n(19,s=T<1?1:1.5),t.$$.dirty[0]&512&&n(18,a=T===-2?Ge:T!==null?ql:()=>({})),t.$$.dirty[0]&2&&n(14,r=g.map(k=>(k=new Date(k),k.setHours(0,0),k.getTime()))),t.$$.dirty[0]&394|t.$$.dirty[1]&8&&n(15,o=Wl(p,g,O,y,M)),t.$$.dirty[0]&8|t.$$.dirty[1]&8&&n(17,u=y.daysMin.concat(...y.daysMin.slice(1)).slice(M,7+M)),t.$$.dirty[0]&2&&g.length===0&&(A=null),t.$$.dirty[0]&392&&n(13,c=y&&q(O,p))},[W,g,m,y,C,F,L,p,O,T,B,w,E,c,r,o,l,u,a,s,i,N,Q,Z,re,Oe,_e,Ze,D,ae,be,pe,f,h,M,_,H,fe,ie,me,se,we,ee,K]}class Kl extends It{constructor(e){super(),Pt(this,e,Xl,Gl,Nt,{wid:32,dates:1,startDate:33,endDate:2,weekStart:34,initialView:35,i18n:3,enableTimeToggle:4,isRange:5,hoverDate:0,additionalDisableFn:6,handleGridNav:36},null,[-1,-1,-1])}get handleGridNav(){return this.$$.ctx[36]}}function yn(t,e,n){const l=t.slice();return l[37]=e[n],l[39]=n,l}function wn(t,e,n){const l=t.slice();return l[37]=e[n],l[39]=n,l}function vn(t){let e,n,l,i,s,a;return{c(){e=V("button"),n=Re("svg"),l=Re("path"),this.h()},l(r){e=I(r,"BUTTON",{type:!0,class:!0,title:!0});var o=R(e);n=Ne(o,"svg",{class:!0,xmlns:!0,viewBox:!0,width:!0,height:!0});var u=R(n);l=Ne(u,"path",{"fill-rule":!0,d:!0}),R(l).forEach(v),u.forEach(v),o.forEach(v),this.h()},h(){b(l,"fill-rule","evenodd"),b(l,"d","M6.75 0a.75.75 0 01.75.75V3h9V.75a.75.75 0 011.5 0V3h2.75c.966 0 1.75.784 1.75 1.75v16a1.75 1.75 0 01-1.75 1.75H3.25a1.75 1.75 0 01-1.75-1.75v-16C1.5 3.784 2.284 3 3.25 3H6V.75A.75.75 0 016.75 0zm-3.5 4.5a.25.25 0 00-.25.25V8h18V4.75a.25.25 0 00-.25-.25H3.25zM21 9.5H3v11.25c0 .138.112.25.25.25h17.5a.25.25 0 00.25-.25V9.5z"),b(n,"class","sdt-svg svelte-bn8ebp"),b(n,"xmlns","http://www.w3.org/2000/svg"),b(n,"viewBox","0 0 24 24"),b(n,"width","20"),b(n,"height","20"),b(e,"type","button"),b(e,"class","sdt-time-btn sdt-back-btn svelte-bn8ebp"),b(e,"title",i=t[5].backToDate)},m(r,o){j(r,e,o),Y(e,n),Y(n,l),s||(a=X(e,"click",t[22]),s=!0)},p(r,o){o[0]&32&&i!==(i=r[5].backToDate)&&b(e,"title",i)},d(r){r&&v(e),s=!1,a()}}}function Zl(t){let e,n=t[16](t[9],t[3])+"",l,i,s;function a(u,c){return u[3]?xl:Ql}let r=a(t),o=r(t);return{c(){e=V("span"),l=he(n),i=x(),o.c(),s=Pe(),this.h()},l(u){e=I(u,"SPAN",{class:!0});var c=R(e);l=de(c,n),c.forEach(v),i=$(u),o.l(u),s=Pe(),this.h()},h(){b(e,"class","sdt-time-figure svelte-bn8ebp")},m(u,c){j(u,e,c),Y(e,l),j(u,i,c),o.m(u,c),j(u,s,c)},p(u,c){c[0]&520&&n!==(n=u[16](u[9],u[3])+"")&&ge(l,n),r===(r=a(u))&&o?o.p(u,c):(o.d(1),o=r(u),o&&(o.c(),o.m(s.parentNode,s)))},d(u){u&&(v(e),v(i),v(s)),o.d(u)}}}function Jl(t){let e,n=t[16](t[9],t[3])+"",l,i,s,a=":",r,o,u=t[16](t[8],!1)+"",c,f,g;return{c(){e=V("button"),l=he(n),i=x(),s=V("span"),s.textContent=a,r=x(),o=V("button"),c=he(u),this.h()},l(h){e=I(h,"BUTTON",{type:!0,class:!0});var m=R(e);l=de(m,n),m.forEach(v),i=$(h),s=I(h,"SPAN",{"data-svelte-h":!0}),Dt(s)!=="svelte-5vnx5k"&&(s.textContent=a),r=$(h),o=I(h,"BUTTON",{type:!0,class:!0});var M=R(o);c=de(M,u),M.forEach(v),this.h()},h(){b(e,"type","button"),b(e,"class","sdt-time-btn sdt-time-figure svelte-bn8ebp"),z(e,"is-active",!t[6]),b(o,"type","button"),b(o,"class","sdt-time-btn sdt-time-figure svelte-bn8ebp"),z(o,"is-active",t[6])},m(h,m){j(h,e,m),Y(e,l),j(h,i,m),j(h,s,m),j(h,r,m),j(h,o,m),Y(o,c),f||(g=[X(e,"click",t[28]),X(o,"click",t[29])],f=!0)},p(h,m){m[0]&520&&n!==(n=h[16](h[9],h[3])+"")&&ge(l,n),m[0]&64&&z(e,"is-active",!h[6]),m[0]&256&&u!==(u=h[16](h[8],!1)+"")&&ge(c,u),m[0]&64&&z(o,"is-active",h[6])},d(h){h&&(v(e),v(i),v(s),v(r),v(o)),f=!1,He(g)}}}function Ql(t){let e,n=":",l,i,s="00";return{c(){e=V("span"),e.textContent=n,l=x(),i=V("span"),i.textContent=s,this.h()},l(a){e=I(a,"SPAN",{"data-svelte-h":!0}),Dt(e)!=="svelte-5vnx5k"&&(e.textContent=n),l=$(a),i=I(a,"SPAN",{class:!0,"data-svelte-h":!0}),Dt(i)!=="svelte-15oc2gl"&&(i.textContent=s),this.h()},h(){b(i,"class","sdt-time-figure svelte-bn8ebp")},m(a,r){j(a,e,r),j(a,l,r),j(a,i,r)},p:Il,d(a){a&&(v(e),v(l),v(i))}}}function xl(t){let e,n=(t[13]?t[5].meridiem[1]:t[5].meridiem[0]).toUpperCase()+"",l;return{c(){e=V("span"),l=he(n),this.h()},l(i){e=I(i,"SPAN",{class:!0});var s=R(e);l=de(s,n),s.forEach(v),this.h()},h(){b(e,"class","sdt-time-figure svelte-bn8ebp")},m(i,s){j(i,e,s),Y(e,l)},p(i,s){s[0]&8224&&n!==(n=(i[13]?i[5].meridiem[1]:i[5].meridiem[0]).toUpperCase()+"")&&ge(l,n)},d(i){i&&v(e)}}}function kn(t){let e,n,l=(t[13]?t[5].meridiem[1]:t[5].meridiem[0])+"",i,s,a,r;return{c(){e=V("div"),n=V("button"),i=he(l),this.h()},l(o){e=I(o,"DIV",{class:!0});var u=R(e);n=I(u,"BUTTON",{type:!0,class:!0,"data-value":!0});var c=R(n);i=de(c,l),c.forEach(v),u.forEach(v),this.h()},h(){b(n,"type","button"),b(n,"class","sdt-time-btn sdt-time-figure is-active svelte-bn8ebp"),b(n,"data-value",s=t[13]?t[9]%12:t[9]+12),b(e,"class","sdt-meridian svelte-bn8ebp")},m(o,u){j(o,e,u),Y(e,n),Y(n,i),a||(r=X(n,"click",t[20]),a=!0)},p(o,u){u[0]&8224&&l!==(l=(o[13]?o[5].meridiem[1]:o[5].meridiem[0])+"")&&ge(i,l),u[0]&8704&&s!==(s=o[13]?o[9]%12:o[9]+12)&&b(n,"data-value",s)},d(o){o&&v(e),a=!1,r()}}}function Dn(t,e){let n,l=e[37].val+"",i,s,a,r,o,u;return{key:t,first:null,c(){n=V("button"),i=he(l),this.h()},l(c){n=I(c,"BUTTON",{type:!0,style:!0,class:!0,"data-value":!0});var f=R(n);i=de(f,l),f.forEach(v),this.h()},h(){b(n,"type","button"),b(n,"style",s=`left:${e[37].x}px; top:${e[37].y}px;`),b(n,"class","sdt-tick svelte-bn8ebp"),b(n,"data-value",a=e[37].val),n.disabled=r=(e[0]||e[1])&&e[7]&&e[18](e[37].val,!1),z(n,"outer-tick",e[6]),z(n,"is-selected",e[17](e[9],e[37].val,e[39])),this.first=n},m(c,f){j(c,n,f),Y(n,i),u=!0},p(c,f){e=c,(!u||f[0]&32768)&&l!==(l=e[37].val+"")&&ge(i,l),(!u||f[0]&32768&&s!==(s=`left:${e[37].x}px; top:${e[37].y}px;`))&&b(n,"style",s),(!u||f[0]&32768&&a!==(a=e[37].val))&&b(n,"data-value",a),(!u||f[0]&32899&&r!==(r=(e[0]||e[1])&&e[7]&&e[18](e[37].val,!1)))&&(n.disabled=r),(!u||f[0]&64)&&z(n,"outer-tick",e[6]),(!u||f[0]&164352)&&z(n,"is-selected",e[17](e[9],e[37].val,e[39]))},i(c){u||(c&&Ke(()=>{u&&(o||(o=tt(n,Ge,{duration:200},!0)),o.run(1))}),u=!0)},o(c){c&&(o||(o=tt(n,Ge,{duration:200},!1)),o.run(0)),u=!1},d(c){c&&v(n),c&&o&&o.end()}}}function Mn(t){let e,n=t[37].val+"",l,i,s,a,r,o;return{c(){e=V("button"),l=he(n),this.h()},l(u){e=I(u,"BUTTON",{type:!0,style:!0,class:!0,"data-value":!0});var c=R(e);l=de(c,n),c.forEach(v),this.h()},h(){b(e,"type","button"),b(e,"style",i=`left:${t[37].x}px; top:${t[37].y}px;`),b(e,"class","sdt-tick svelte-bn8ebp"),b(e,"data-value",s=t[37].val),e.disabled=a=(t[0]||t[1])&&t[7]&&t[18](t[37].val,!1),z(e,"outer-tick",t[3]&&!t[6]),z(e,"is-selected",t[17](t[6]?t[8]:t[9],t[37].val,t[39]))},m(u,c){j(u,e,c),Y(e,l),o=!0},p(u,c){(!o||c[0]&16384)&&n!==(n=u[37].val+"")&&ge(l,n),(!o||c[0]&16384&&i!==(i=`left:${u[37].x}px; top:${u[37].y}px;`))&&b(e,"style",i),(!o||c[0]&16384&&s!==(s=u[37].val))&&b(e,"data-value",s),(!o||c[0]&16515&&a!==(a=(u[0]||u[1])&&u[7]&&u[18](u[37].val,!1)))&&(e.disabled=a),(!o||c[0]&72)&&z(e,"outer-tick",u[3]&&!u[6]),(!o||c[0]&148288)&&z(e,"is-selected",u[17](u[6]?u[8]:u[9],u[37].val,u[39]))},i(u){o||(u&&Ke(()=>{o&&(r||(r=tt(e,Ge,{duration:200},!0)),r.run(1))}),o=!0)},o(u){u&&(r||(r=tt(e,Ge,{duration:200},!1)),r.run(0)),o=!1},d(u){u&&v(e),u&&r&&r.end()}}}function $l(t){let e,n,l,i,s,a,r,o,u,c,f,g=[],h=new Map,m,M,_,y,C,F=t[4]&&vn(t);function W(w,E){return w[2]?Zl:Jl}let L=W(t),H=L(t),A=t[3]&&kn(t),p=oe(t[15]);const P=w=>w[37].val;for(let w=0;wue(T[w],1,1,()=>{T[w]=null});return{c(){e=V("div"),n=V("div"),F&&F.c(),l=x(),H.c(),i=x(),A&&A.c(),s=x(),a=V("div"),r=V("div"),o=x(),u=V("div"),c=V("div"),f=x();for(let w=0;w{M=Ct(e,Ge,{duration:200}),M.start()})),_=!0}},o(w){for(let E=0;E=9||ee<3?-1:1)*q),val:be?ee*5||ae:ee?ee+pe:ae});return we}function B(D,q){return q?i&&D===12?12:D<10||D%12<10?`0${D%12}`:D%12:D<10?`0${D}`:D}function w(D,q,ae){return H?q===D||ae===0&&ae===D:_?i&&q==12&&D===12||!i&&q==12&&D===0?!0:q===(D?D%12:12):+q>12?(ae?a*ae+12:0)===D:q==="00"||q==="12"?D===12&&parseInt(q)==12||q==="00"&&D===0:q===D}function E(D,q=!1){return typeof D=="string"&&(D=parseInt(D)),g&&h&&r?H||q?g.getHours()===p.getHours()&&g.getMinutes()>D||h.getHours()===p.getHours()&&h.getMinutes()D||h.getHours()D:g.getHours()>D:h&&h.getDate()===p.getDate()&&h.getMonth()===p.getMonth()&&h.getFullYear()===p.getFullYear()?H||q?h.getHours()===p.getHours()&&h.getMinutes()s?s+M:s-M),p[pe](be)}else if(H){const be=L.getBoundingClientRect(),pe=D.clientX-be.left,fe=D.clientY-be.top,ie=130,me=130;let se=null;switch(pe>ie?se=fe>me?2:1:se=fe>me?3:4,se){case 1:q=pe-ie,ae=me-fe;break;case 2:q=pe-ie,ae=fe-me;break;case 3:q=ie-pe,ae=fe-me;break;case 4:q=ie-pe,ae=me-fe;break}const we=Math.sqrt(q*q+ae*ae),ee=90-Math.asin(q/we)*(180/Math.PI);let K=0;switch(se){case 1:K=90-ee;break;case 2:K=ee+90;break;case 3:K=270-ee;break;case 4:K=ee+270;break}K=Math.round(K/6/M)*M,K>=60&&(K=0),p.setMinutes(K)}n(7,p),n(23,f),A||(P(H?"minute":"hour",{value:p,isKeyboard:D.type==="keyboard",dateIndex:c}),D.type!=="keyboard"&&!H&&!m&&n(6,H=!0))}function Q(D){const q=parseInt(D.target.dataset.value);p.setHours(q),n(7,p),n(23,f),P(H?"minute":"hour",{value:p,isKeyboard:!0})}function Z(D){n(11,A=D.type==="mousedown")}function J(){P("switch","date")}const re=()=>n(6,H=!1),Oe=()=>n(6,H=!0),_e=D=>{A&&N(D)};function Ze(D){kt[D?"unshift":"push"](()=>{L=D,n(10,L)})}return t.$$set=D=>{"wid"in D&&n(24,c=D.wid),"date"in D&&n(23,f=D.date),"startDate"in D&&n(0,g=D.startDate),"endDate"in D&&n(1,h=D.endDate),"hourOnly"in D&&n(2,m=D.hourOnly),"minuteIncrement"in D&&n(25,M=D.minuteIncrement),"showMeridian"in D&&n(3,_=D.showMeridian),"hasDateComponent"in D&&n(4,y=D.hasDateComponent),"i18n"in D&&n(5,C=D.i18n)},t.$$.update=()=>{if(t.$$.dirty[0]&8388736&&f!==p&&f&&n(7,p=f),t.$$.dirty[0]&131){let D=!1;g&&g.toDateString()===p.toDateString()&&(E(p.getHours())&&(p.setHours(g.getHours()),D=!0),E(p.getMinutes(),!0)&&(p.setMinutes(g.getMinutes()),D=!0)),h&&h.toDateString()===p.toDateString()&&(E(p.getHours())&&(p.setHours(h.getHours()),D=!0),E(p.getMinutes(),!0)&&(p.setMinutes(h.getMinutes()),D=!0)),D&&qn().then(()=>P("time",p))}if(t.$$.dirty[0]&128&&n(9,l=p?p.getHours():0),t.$$.dirty[0]&520&&n(13,i=_?l>=12:!1),t.$$.dirty[0]&128&&n(8,s=p?p.getMinutes():0),t.$$.dirty[0]&840){let D=H?s*6:l%12*30;n(12,O=H||_||l<12?`transform: rotateZ(${D}deg);`:`transform: rotateZ(${D}deg); height: calc(25% + 1px)`)}t.$$.dirty[0]&64&&(a=H?5:1),t.$$.dirty[0]&3&&(r=g&&h&&["getFullYear","getMonth","getDate"].every(D=>h[D]()===g[D]())),t.$$.dirty[0]&64&&n(15,o=T(H?220:180,110,"00",!1,0)),t.$$.dirty[0]&64&&n(14,u=T(H?180:120,110,H?"00":"12",H,12)),t.$$.dirty[0]&64&&P("time-switch",H)},[g,h,m,_,y,C,H,p,s,l,L,A,O,i,u,o,B,w,E,N,Q,Z,J,f,c,M,F,W,re,Oe,_e,Ze]}class ti extends It{constructor(e){super(),Pt(this,e,ei,$l,Nt,{wid:24,date:23,startDate:0,endDate:1,hourOnly:2,minuteIncrement:25,showMeridian:3,hasDateComponent:4,i18n:5,showMinuteView:26,makeTick:27},null,[-1,-1])}get showMinuteView(){return this.$$.ctx[26]}get makeTick(){return this.$$.ctx[27]}}const Mt=Math.min,qe=Math.max,Tt=Math.round,vt=Math.floor,Le=t=>({x:t,y:t}),ni={left:"right",right:"left",bottom:"top",top:"bottom"},li={start:"end",end:"start"};function Tn(t,e,n){return qe(t,Mt(e,n))}function jt(t,e){return typeof t=="function"?t(e):t}function lt(t){return t.split("-")[0]}function zt(t){return t.split("-")[1]}function ll(t){return t==="x"?"y":"x"}function il(t){return t==="y"?"height":"width"}function Wt(t){return["top","bottom"].includes(lt(t))?"y":"x"}function sl(t){return ll(Wt(t))}function ii(t,e,n){n===void 0&&(n=!1);const l=zt(t),i=sl(t),s=il(i);let a=i==="x"?l===(n?"end":"start")?"right":"left":l==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=Ft(a)),[a,Ft(a)]}function si(t){const e=Ft(t);return[Rt(t),e,Rt(e)]}function Rt(t){return t.replace(/start|end/g,e=>li[e])}function oi(t,e,n){const l=["left","right"],i=["right","left"],s=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:l:e?l:i;case"left":case"right":return e?s:a;default:return[]}}function ri(t,e,n,l){const i=zt(t);let s=oi(lt(t),n==="start",l);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(Rt)))),s}function Ft(t){return t.replace(/left|right|bottom|top/g,e=>ni[e])}function ai(t){return{top:0,right:0,bottom:0,left:0,...t}}function ui(t){return typeof t!="number"?ai(t):{top:t,right:t,bottom:t,left:t}}function Et(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function Fn(t,e,n){let{reference:l,floating:i}=t;const s=Wt(e),a=sl(e),r=il(a),o=lt(e),u=s==="y",c=l.x+l.width/2-i.width/2,f=l.y+l.height/2-i.height/2,g=l[r]/2-i[r]/2;let h;switch(o){case"top":h={x:c,y:l.y-i.height};break;case"bottom":h={x:c,y:l.y+l.height};break;case"right":h={x:l.x+l.width,y:f};break;case"left":h={x:l.x-i.width,y:f};break;default:h={x:l.x,y:l.y}}switch(zt(e)){case"start":h[a]-=g*(n&&u?-1:1);break;case"end":h[a]+=g*(n&&u?-1:1);break}return h}const fi=async(t,e,n)=>{const{placement:l="bottom",strategy:i="absolute",middleware:s=[],platform:a}=n,r=s.filter(Boolean),o=await(a.isRTL==null?void 0:a.isRTL(e));let u=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:c,y:f}=Fn(u,l,o),g=l,h={},m=0;for(let M=0;MB<=0)){var P,O;const B=(((P=s.flip)==null?void 0:P.index)||0)+1,w=L[B];if(w)return{data:{index:B,overflows:p},reset:{placement:w}};let E=(O=p.filter(N=>N.overflows[0]<=0).sort((N,Q)=>N.overflows[1]-Q.overflows[1])[0])==null?void 0:O.placement;if(!E)switch(h){case"bestFit":{var T;const N=(T=p.map(Q=>[Q.placement,Q.overflows.filter(Z=>Z>0).reduce((Z,J)=>Z+J,0)]).sort((Q,Z)=>Q[1]-Z[1])[0])==null?void 0:T[0];N&&(E=N);break}case"initialPlacement":E=r;break}if(i!==E)return{reset:{placement:E}}}return{}}}},hi=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:l,placement:i}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:r={fn:_=>{let{x:y,y:C}=_;return{x:y,y:C}}},...o}=jt(t,e),u={x:n,y:l},c=await ol(e,o),f=Wt(lt(i)),g=ll(f);let h=u[g],m=u[f];if(s){const _=g==="y"?"top":"left",y=g==="y"?"bottom":"right",C=h+c[_],F=h-c[y];h=Tn(C,h,F)}if(a){const _=f==="y"?"top":"left",y=f==="y"?"bottom":"right",C=m+c[_],F=m-c[y];m=Tn(C,m,F)}const M=r.fn({...e,[g]:h,[f]:m});return{...M,data:{x:M.x-n,y:M.y-l}}}}};function Ue(t){return rl(t)?(t.nodeName||"").toLowerCase():"#document"}function ye(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ae(t){var e;return(e=(rl(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function rl(t){return t instanceof Node||t instanceof ye(t).Node}function Ye(t){return t instanceof Element||t instanceof ye(t).Element}function Ce(t){return t instanceof HTMLElement||t instanceof ye(t).HTMLElement}function En(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ye(t).ShadowRoot}function mt(t){const{overflow:e,overflowX:n,overflowY:l,display:i}=De(t);return/auto|scroll|overlay|hidden|clip/.test(e+l+n)&&!["inline","contents"].includes(i)}function di(t){return["table","td","th"].includes(Ue(t))}function qt(t){const e=Gt(),n=De(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(l=>(n.willChange||"").includes(l))||["paint","layout","strict","content"].some(l=>(n.contain||"").includes(l))}function gi(t){let e=it(t);for(;Ce(e)&&!Ot(e);){if(qt(e))return e;e=it(e)}return null}function Gt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ot(t){return["html","body","#document"].includes(Ue(t))}function De(t){return ye(t).getComputedStyle(t)}function St(t){return Ye(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function it(t){if(Ue(t)==="html")return t;const e=t.assignedSlot||t.parentNode||En(t)&&t.host||Ae(t);return En(e)?e.host:e}function al(t){const e=it(t);return Ot(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ce(e)&&mt(e)?e:al(e)}function dt(t,e,n){var l;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=al(t),s=i===((l=t.ownerDocument)==null?void 0:l.body),a=ye(i);return s?e.concat(a,a.visualViewport||[],mt(i)?i:[],a.frameElement&&n?dt(a.frameElement):[]):e.concat(i,dt(i,[],n))}function ul(t){const e=De(t);let n=parseFloat(e.width)||0,l=parseFloat(e.height)||0;const i=Ce(t),s=i?t.offsetWidth:n,a=i?t.offsetHeight:l,r=Tt(n)!==s||Tt(l)!==a;return r&&(n=s,l=a),{width:n,height:l,$:r}}function Xt(t){return Ye(t)?t:t.contextElement}function et(t){const e=Xt(t);if(!Ce(e))return Le(1);const n=e.getBoundingClientRect(),{width:l,height:i,$:s}=ul(e);let a=(s?Tt(n.width):n.width)/l,r=(s?Tt(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!r||!Number.isFinite(r))&&(r=1),{x:a,y:r}}const mi=Le(0);function fl(t){const e=ye(t);return!Gt()||!e.visualViewport?mi:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function _i(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ye(t)?!1:e}function Xe(t,e,n,l){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=Xt(t);let a=Le(1);e&&(l?Ye(l)&&(a=et(l)):a=et(t));const r=_i(s,n,l)?fl(s):Le(0);let o=(i.left+r.x)/a.x,u=(i.top+r.y)/a.y,c=i.width/a.x,f=i.height/a.y;if(s){const g=ye(s),h=l&&Ye(l)?ye(l):l;let m=g,M=m.frameElement;for(;M&&l&&h!==m;){const _=et(M),y=M.getBoundingClientRect(),C=De(M),F=y.left+(M.clientLeft+parseFloat(C.paddingLeft))*_.x,W=y.top+(M.clientTop+parseFloat(C.paddingTop))*_.y;o*=_.x,u*=_.y,c*=_.x,f*=_.y,o+=F,u+=W,m=ye(M),M=m.frameElement}}return Et({width:c,height:f,x:o,y:u})}const bi=[":popover-open",":modal"];function cl(t){return bi.some(e=>{try{return t.matches(e)}catch{return!1}})}function pi(t){let{elements:e,rect:n,offsetParent:l,strategy:i}=t;const s=i==="fixed",a=Ae(l),r=e?cl(e.floating):!1;if(l===a||r&&s)return n;let o={scrollLeft:0,scrollTop:0},u=Le(1);const c=Le(0),f=Ce(l);if((f||!f&&!s)&&((Ue(l)!=="body"||mt(a))&&(o=St(l)),Ce(l))){const g=Xe(l);u=et(l),c.x=g.x+l.clientLeft,c.y=g.y+l.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-o.scrollLeft*u.x+c.x,y:n.y*u.y-o.scrollTop*u.y+c.y}}function yi(t){return Array.from(t.getClientRects())}function hl(t){return Xe(Ae(t)).left+St(t).scrollLeft}function wi(t){const e=Ae(t),n=St(t),l=t.ownerDocument.body,i=qe(e.scrollWidth,e.clientWidth,l.scrollWidth,l.clientWidth),s=qe(e.scrollHeight,e.clientHeight,l.scrollHeight,l.clientHeight);let a=-n.scrollLeft+hl(t);const r=-n.scrollTop;return De(l).direction==="rtl"&&(a+=qe(e.clientWidth,l.clientWidth)-i),{width:i,height:s,x:a,y:r}}function vi(t,e){const n=ye(t),l=Ae(t),i=n.visualViewport;let s=l.clientWidth,a=l.clientHeight,r=0,o=0;if(i){s=i.width,a=i.height;const u=Gt();(!u||u&&e==="fixed")&&(r=i.offsetLeft,o=i.offsetTop)}return{width:s,height:a,x:r,y:o}}function ki(t,e){const n=Xe(t,!0,e==="fixed"),l=n.top+t.clientTop,i=n.left+t.clientLeft,s=Ce(t)?et(t):Le(1),a=t.clientWidth*s.x,r=t.clientHeight*s.y,o=i*s.x,u=l*s.y;return{width:a,height:r,x:o,y:u}}function Cn(t,e,n){let l;if(e==="viewport")l=vi(t,n);else if(e==="document")l=wi(Ae(t));else if(Ye(e))l=ki(e,n);else{const i=fl(t);l={...e,x:e.x-i.x,y:e.y-i.y}}return Et(l)}function dl(t,e){const n=it(t);return n===e||!Ye(n)||Ot(n)?!1:De(n).position==="fixed"||dl(n,e)}function Di(t,e){const n=e.get(t);if(n)return n;let l=dt(t,[],!1).filter(r=>Ye(r)&&Ue(r)!=="body"),i=null;const s=De(t).position==="fixed";let a=s?it(t):t;for(;Ye(a)&&!Ot(a);){const r=De(a),o=qt(a);!o&&r.position==="fixed"&&(i=null),(s?!o&&!i:!o&&r.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||mt(a)&&!o&&dl(t,a))?l=l.filter(c=>c!==a):i=r,a=it(a)}return e.set(t,l),l}function Mi(t){let{element:e,boundary:n,rootBoundary:l,strategy:i}=t;const a=[...n==="clippingAncestors"?Di(e,this._c):[].concat(n),l],r=a[0],o=a.reduce((u,c)=>{const f=Cn(e,c,i);return u.top=qe(f.top,u.top),u.right=Mt(f.right,u.right),u.bottom=Mt(f.bottom,u.bottom),u.left=qe(f.left,u.left),u},Cn(e,r,i));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}}function Ti(t){const{width:e,height:n}=ul(t);return{width:e,height:n}}function Fi(t,e,n){const l=Ce(e),i=Ae(e),s=n==="fixed",a=Xe(t,!0,s,e);let r={scrollLeft:0,scrollTop:0};const o=Le(0);if(l||!l&&!s)if((Ue(e)!=="body"||mt(i))&&(r=St(e)),l){const f=Xe(e,!0,s,e);o.x=f.x+e.clientLeft,o.y=f.y+e.clientTop}else i&&(o.x=hl(i));const u=a.left+r.scrollLeft-o.x,c=a.top+r.scrollTop-o.y;return{x:u,y:c,width:a.width,height:a.height}}function On(t,e){return!Ce(t)||De(t).position==="fixed"?null:e?e(t):t.offsetParent}function gl(t,e){const n=ye(t);if(!Ce(t)||cl(t))return n;let l=On(t,e);for(;l&&di(l)&&De(l).position==="static";)l=On(l,e);return l&&(Ue(l)==="html"||Ue(l)==="body"&&De(l).position==="static"&&!qt(l))?n:l||gi(t)||n}const Ei=async function(t){const e=this.getOffsetParent||gl,n=this.getDimensions;return{reference:Fi(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,...await n(t.floating)}}};function Ci(t){return De(t).direction==="rtl"}const Oi={convertOffsetParentRelativeRectToViewportRelativeRect:pi,getDocumentElement:Ae,getClippingRect:Mi,getOffsetParent:gl,getElementRects:Ei,getClientRects:yi,getDimensions:Ti,getScale:et,isElement:Ye,isRTL:Ci};function Si(t,e){let n=null,l;const i=Ae(t);function s(){var r;clearTimeout(l),(r=n)==null||r.disconnect(),n=null}function a(r,o){r===void 0&&(r=!1),o===void 0&&(o=1),s();const{left:u,top:c,width:f,height:g}=t.getBoundingClientRect();if(r||e(),!f||!g)return;const h=vt(c),m=vt(i.clientWidth-(u+f)),M=vt(i.clientHeight-(c+g)),_=vt(u),C={rootMargin:-h+"px "+-m+"px "+-M+"px "+-_+"px",threshold:qe(0,Mt(1,o))||1};let F=!0;function W(L){const H=L[0].intersectionRatio;if(H!==o){if(!F)return a();H?a(!1,H):l=setTimeout(()=>{a(!1,1e-7)},100)}F=!1}try{n=new IntersectionObserver(W,{...C,root:i.ownerDocument})}catch{n=new IntersectionObserver(W,C)}n.observe(t)}return a(!0),s}function Yi(t,e,n,l){l===void 0&&(l={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:r=typeof IntersectionObserver=="function",animationFrame:o=!1}=l,u=Xt(t),c=i||s?[...u?dt(u):[],...dt(e)]:[];c.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const f=u&&r?Si(u,n):null;let g=-1,h=null;a&&(h=new ResizeObserver(y=>{let[C]=y;C&&C.target===u&&h&&(h.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var F;(F=h)==null||F.observe(e)})),n()}),u&&!o&&h.observe(u),h.observe(e));let m,M=o?Xe(t):null;o&&_();function _(){const y=Xe(t);M&&(y.x!==M.x||y.y!==M.y||y.width!==M.width||y.height!==M.height)&&n(),M=y,m=requestAnimationFrame(_)}return n(),()=>{var y;c.forEach(C=>{i&&C.removeEventListener("scroll",n),s&&C.removeEventListener("resize",n)}),f==null||f(),(y=h)==null||y.disconnect(),h=null,o&&cancelAnimationFrame(m)}}const Hi=hi,Ai=ci,Bi=(t,e,n)=>{const l=new Map,i={platform:Oi,...n},s={...i.platform,_c:l};return fi(t,e,{...i,platform:s})};function Ri(t){if((t==null?void 0:t.previousElementSibling)===null)return;const e=t==null?void 0:t.previousElementSibling,n=Yi(e,t,()=>Bi(e,t,{placement:"bottom-start",middleware:[Hi({padding:5}),Ai()]}).then(({x:l,y:i})=>{Object.assign(t.style,{left:`${l}px`,top:`${i}px`})}));return{destroy(){n()}}}function Ni(t,e,n,l,i){let s=t?Array.isArray(t)?t:t.split(","):[];s=s.map(o=>o.replace(/(:\d+):\d+/,"$1"));let a=s,r=e?Array.isArray(e)?e:[e]:a.map(o=>ct(o,n,l,i));return r&&e&&(s=r.map(o=>$e(o,n,l,i))),{valueArray:s,prevValue:a,innerDates:r}}function Vi(t,e){return t==="auto"?e.match(/g|hh?|ii?/i)&&e.match(/y|m|d/i)?"datetime":e.match(/g|hh?|ii?/i)?"time":"date":t}const Ii=t=>({isTodayDisabled:t[1]&2048,currentMode:t[0]&67108864,i18n:t[0]&16777216}),Sn=t=>({onCancel:t[49],onConfirm:t[78],onClear:t[48],onToday:t[47],isTodayDisabled:t[42],currentMode:t[26],i18n:t[24]});function Yn(t,e,n){const l=t.slice();return l[98]=e[n],l[99]=e,l[100]=n,l}const Pi=t=>({value:t[0]&1,displayValue:t[1]&1,disabled:t[0]&32,isDirty:t[1]&128}),Hn=t=>({value:t[0],displayValue:t[31],disabled:t[5],isDirty:t[38],onKeyDown:t[50],onInputFocus:t[53],onInputBlur:t[54]});function An(t){let e,n,l,i=!t[9]&&Bn(t);return{c(){e=V("input"),n=x(),i&&i.c(),l=Pe(),this.h()},l(s){e=I(s,"INPUT",{type:!0,name:!0}),n=$(s),i&&i.l(s),l=Pe(),this.h()},h(){b(e,"type","hidden"),b(e,"name",t[4]),e.value=t[0]},m(s,a){j(s,e,a),j(s,n,a),i&&i.m(s,a),j(s,l,a)},p(s,a){a[0]&16&&b(e,"name",s[4]),a[0]&1&&(e.value=s[0]),s[9]?i&&(i.d(1),i=null):i?i.p(s,a):(i=Bn(s),i.c(),i.m(l.parentNode,l))},d(s){s&&(v(e),v(n),v(l)),i&&i.d(s)}}}function Bn(t){let e,n,l,i,s,a;return{c(){e=V("input"),this.h()},l(r){e=I(r,"INPUT",{type:!0,id:!0,tabindex:!0,name:!0,placeholder:!0,autocomplete:!0,inputmode:!0,class:!0}),this.h()},h(){b(e,"type","text"),b(e,"id",t[3]),b(e,"tabindex","0"),b(e,"name",n=t[4].endsWith("]")?t[4].substring(0,t[4].length-1)+"_input]":t[4]+"_input"),e.value=t[31],b(e,"placeholder",t[6]),e.disabled=t[5],e.required=t[7],b(e,"autocomplete","off"),b(e,"inputmode","none"),b(e,"class",l=Ee(t[17])+" svelte-ergyxs"),e.readOnly=i=t[25]&&!t[11]&&!t[8],z(e,"value-dirty",!t[22]&&t[38])},m(r,o){j(r,e,o),t[74](e),s||(a=[X(e,"input",function(){zn(t[11]?t[51]:jn)&&(t[11]?t[51]:jn).apply(this,arguments)}),Jn(t[43].call(null,e,t[44])),X(e,"focus",t[53]),X(e,"blur",t[54]),X(e,"click",t[75]),X(e,"input",t[72]),X(e,"change",t[73]),X(e,"keydown",t[50])],s=!0)},p(r,o){t=r,o[0]&8&&b(e,"id",t[3]),o[0]&16&&n!==(n=t[4].endsWith("]")?t[4].substring(0,t[4].length-1)+"_input]":t[4]+"_input")&&b(e,"name",n),o[1]&1&&e.value!==t[31]&&(e.value=t[31]),o[0]&64&&b(e,"placeholder",t[6]),o[0]&32&&(e.disabled=t[5]),o[0]&128&&(e.required=t[7]),o[0]&131072&&l!==(l=Ee(t[17])+" svelte-ergyxs")&&b(e,"class",l),o[0]&33556736&&i!==(i=t[25]&&!t[11]&&!t[8])&&(e.readOnly=i),o[0]&4325376|o[1]&128&&z(e,"value-dirty",!t[22]&&t[38])},d(r){r&&v(e),t[74](null),s=!1,He(a)}}}function Li(t){let e,n=!t[1]&&An(t);return{c(){n&&n.c(),e=Pe()},l(l){n&&n.l(l),e=Pe()},m(l,i){n&&n.m(l,i),j(l,e,i)},p(l,i){l[1]?n&&(n.d(1),n=null):n?n.p(l,i):(n=An(l),n.c(),n.m(e.parentNode,e))},d(l){l&&v(e),n&&n.d(l)}}}function Rn(t){let e,n,l=[],i=new Map,s,a,r,o,u,c,f=oe(t[37]);const g=_=>_[100];for(let _=0;_{o&&(r||(r=tt(e,t[41],{duration:200},!0)),r.run(1))}),o=!0}},o(_){for(let y=0;yt[77](e,n,l),a=()=>t[77](null,n,l);let r={wid:t[100],date:t[30][t[100]],startDate:t[29],endDate:t[28],hasDateComponent:t[27]!=="time",showMeridian:t[13].match(t[14]==="php"?"a|A":"p|P")!==null,i18n:t[24],minuteIncrement:t[15],hourOnly:t[23]};return e=new ti({props:r}),s(),e.$on("hour",t[45]),e.$on("minute",t[45]),e.$on("switch",t[52]),e.$on("time-switch",t[56]),{c(){Qn(e.$$.fragment)},l(o){xn(e.$$.fragment,o)},m(o,u){$n(e,o,u),i=!0},p(o,u){(n!==o[99]||l!==o[100])&&(a(),n=o[99],l=o[100],s());const c={};u[1]&64&&(c.wid=o[100]),u[0]&1073741824|u[1]&64&&(c.date=o[30][o[100]]),u[0]&536870912&&(c.startDate=o[29]),u[0]&268435456&&(c.endDate=o[28]),u[0]&134217728&&(c.hasDateComponent=o[27]!=="time"),u[0]&24576&&(c.showMeridian=o[13].match(o[14]==="php"?"a|A":"p|P")!==null),u[0]&16777216&&(c.i18n=o[24]),u[0]&32768&&(c.minuteIncrement=o[15]),u[0]&8388608&&(c.hourOnly=o[23]),e.$set(c)},i(o){i||(le(e.$$.fragment,o),i=!0)},o(o){ue(e.$$.fragment,o),i=!1},d(o){a(),el(e,o)}}}function ji(t){var i;let e,n,l={wid:t[100],dates:t[30],isRange:t[8],startDate:t[29],endDate:t[28],enableTimeToggle:(i=t[27])==null?void 0:i.includes("time"),initialView:t[2]>2?2:t[2],hoverDate:t[32],additionalDisableFn:t[10],i18n:t[24],weekStart:t[16]};return e=new Kl({props:l}),t[76](e),e.$on("date",t[45]),e.$on("switch",t[52]),e.$on("internal_hoverUpdate",t[55]),{c(){Qn(e.$$.fragment)},l(s){xn(e.$$.fragment,s)},m(s,a){$n(e,s,a),n=!0},p(s,a){var o;const r={};a[1]&64&&(r.wid=s[100]),a[0]&1073741824&&(r.dates=s[30]),a[0]&256&&(r.isRange=s[8]),a[0]&536870912&&(r.startDate=s[29]),a[0]&268435456&&(r.endDate=s[28]),a[0]&134217728&&(r.enableTimeToggle=(o=s[27])==null?void 0:o.includes("time")),a[0]&4&&(r.initialView=s[2]>2?2:s[2]),a[1]&2&&(r.hoverDate=s[32]),a[0]&1024&&(r.additionalDisableFn=s[10]),a[0]&16777216&&(r.i18n=s[24]),a[0]&65536&&(r.weekStart=s[16]),e.$set(r)},i(s){n||(le(e.$$.fragment,s),n=!0)},o(s){ue(e.$$.fragment,s),n=!1},d(s){t[76](null),el(e,s)}}}function Nn(t,e){let n,l,i,s,a;const r=[ji,Ui],o=[];function u(c,f){return c[26]==="date"?0:1}return l=u(e),i=o[l]=r[l](e),{key:t,first:null,c(){n=V("div"),i.c(),s=x(),this.h()},l(c){n=I(c,"DIV",{class:!0});var f=R(n);i.l(f),s=$(f),f.forEach(v),this.h()},h(){b(n,"class","sdt-widget svelte-ergyxs"),this.first=n},m(c,f){j(c,n,f),o[l].m(n,null),Y(n,s),a=!0},p(c,f){e=c;let g=l;l=u(e),l===g?o[l].p(e,f):(Ve(),ue(o[g],1,1,()=>{o[g]=null}),Ie(),i=o[l],i?i.p(e,f):(i=o[l]=r[l](e),i.c()),le(i,1),i.m(n,s))},i(c){a||(le(i),a=!0)},o(c){ue(i),a=!1},d(c){c&&v(n),o[l].d()}}}function Vn(t){let e,n,l=!t[36]&&In(t),i=(t[20]||t[21])&&Pn(t);return{c(){e=V("div"),l&&l.c(),n=x(),i&&i.c(),this.h()},l(s){e=I(s,"DIV",{class:!0});var a=R(e);l&&l.l(a),n=$(a),i&&i.l(a),a.forEach(v),this.h()},h(){b(e,"class","sdt-btn-row svelte-ergyxs")},m(s,a){j(s,e,a),l&&l.m(e,null),Y(e,n),i&&i.m(e,null)},p(s,a){s[36]?l&&(l.d(1),l=null):l?l.p(s,a):(l=In(s),l.c(),l.m(e,n)),s[20]||s[21]?i?i.p(s,a):(i=Pn(s),i.c(),i.m(e,null)):i&&(i.d(1),i=null)},d(s){s&&v(e),l&&l.d(),i&&i.d()}}}function In(t){let e,n,l=t[24].cancelBtn+"",i,s,a,r,o=t[24].okBtn+"",u,c,f,g;return{c(){e=V("span"),n=V("button"),i=he(l),a=x(),r=V("button"),u=he(o),this.h()},l(h){e=I(h,"SPAN",{});var m=R(e);n=I(m,"BUTTON",{type:!0,class:!0});var M=R(n);i=de(M,l),M.forEach(v),a=$(m),r=I(m,"BUTTON",{type:!0,class:!0});var _=R(r);u=de(_,o),_.forEach(v),m.forEach(v),this.h()},h(){b(n,"type","button"),b(n,"class",s=Ee(t[19])+" svelte-ergyxs"),b(r,"type","button"),b(r,"class",c=Ee(t[18])+" svelte-ergyxs")},m(h,m){j(h,e,m),Y(e,n),Y(n,i),Y(e,a),Y(e,r),Y(r,u),f||(g=[X(n,"click",t[49]),X(r,"click",t[79])],f=!0)},p(h,m){m[0]&16777216&&l!==(l=h[24].cancelBtn+"")&&ge(i,l),m[0]&524288&&s!==(s=Ee(h[19])+" svelte-ergyxs")&&b(n,"class",s),m[0]&16777216&&o!==(o=h[24].okBtn+"")&&ge(u,o),m[0]&262144&&c!==(c=Ee(h[18])+" svelte-ergyxs")&&b(r,"class",c)},d(h){h&&v(e),f=!1,He(g)}}}function Pn(t){let e,n,l=t[20]&&t[26]==="date"&&Ln(t),i=t[21]&&Un(t);return{c(){e=V("span"),l&&l.c(),n=x(),i&&i.c()},l(s){e=I(s,"SPAN",{});var a=R(e);l&&l.l(a),n=$(a),i&&i.l(a),a.forEach(v)},m(s,a){j(s,e,a),l&&l.m(e,null),Y(e,n),i&&i.m(e,null)},p(s,a){s[20]&&s[26]==="date"?l?l.p(s,a):(l=Ln(s),l.c(),l.m(e,n)):l&&(l.d(1),l=null),s[21]?i?i.p(s,a):(i=Un(s),i.c(),i.m(e,null)):i&&(i.d(1),i=null)},d(s){s&&v(e),l&&l.d(),i&&i.d()}}}function Ln(t){let e,n=t[24].todayBtn+"",l,i,s,a;return{c(){e=V("button"),l=he(n),this.h()},l(r){e=I(r,"BUTTON",{type:!0,class:!0});var o=R(e);l=de(o,n),o.forEach(v),this.h()},h(){b(e,"type","button"),b(e,"class",i=Ee(t[18])+" svelte-ergyxs"),e.disabled=t[42]},m(r,o){j(r,e,o),Y(e,l),s||(a=X(e,"click",t[47]),s=!0)},p(r,o){o[0]&16777216&&n!==(n=r[24].todayBtn+"")&&ge(l,n),o[0]&262144&&i!==(i=Ee(r[18])+" svelte-ergyxs")&&b(e,"class",i),o[1]&2048&&(e.disabled=r[42])},d(r){r&&v(e),s=!1,a()}}}function Un(t){let e,n=t[24].clearBtn+"",l,i,s,a;return{c(){e=V("button"),l=he(n),this.h()},l(r){e=I(r,"BUTTON",{type:!0,class:!0});var o=R(e);l=de(o,n),o.forEach(v),this.h()},h(){b(e,"type","button"),b(e,"class",i=Ee(t[19])+" svelte-ergyxs")},m(r,o){j(r,e,o),Y(e,l),s||(a=X(e,"click",t[48]),s=!0)},p(r,o){o[0]&16777216&&n!==(n=r[24].clearBtn+"")&&ge(l,n),o[0]&524288&&i!==(i=Ee(r[19])+" svelte-ergyxs")&&b(e,"class",i)},d(r){r&&v(e),s=!1,a()}}}function zi(t){let e,n=(!t[36]||!0)&&Vn(t);return{c(){n&&n.c(),e=Pe()},l(l){n&&n.l(l),e=Pe()},m(l,i){n&&n.m(l,i),j(l,e,i)},p(l,i){l[36],n?n.p(l,i):(n=Vn(l),n.c(),n.m(e.parentNode,e))},d(l){l&&v(e),n&&n.d(l)}}}function Wi(t){let e,n,l;const i=t[70].inputs,s=Gn(i,t,t[69],Hn),a=s||Li(t);let r=t[35]&&t[25]&&Rn(t);return{c(){e=V("span"),a&&a.c(),n=x(),r&&r.c(),this.h()},l(o){e=I(o,"SPAN",{class:!0});var u=R(e);a&&a.l(u),n=$(u),r&&r.l(u),u.forEach(v),this.h()},h(){b(e,"class","std-component-wrap svelte-ergyxs")},m(o,u){j(o,e,u),a&&a.m(e,null),Y(e,n),r&&r.m(e,null),l=!0},p(o,u){s?s.p&&(!l||u[0]&33|u[1]&129|u[2]&128)&&Xn(s,i,o,o[69],l?Zn(i,o[69],u,Pi):Kn(o[69]),Hn):a&&a.p&&(!l||u[0]&37882875|u[1]&149)&&a.p(o,l?u:[-1,-1,-1,-1]),o[35]&&o[25]?r?(r.p(o,u),u[0]&33554432|u[1]&16&&le(r,1)):(r=Rn(o),r.c(),le(r,1),r.m(e,null)):r&&(Ve(),ue(r,1,1,()=>{r=null}),Ie())},i(o){l||(le(a,o),le(r),l=!0)},o(o){ue(a,o),ue(r),l=!1},d(o){o&&v(e),a&&a.d(o),r&&r.d()}}}const ce=jl;function qi(t){return t?[{ref:null},{ref:null}]:[{ref:null}]}const jn=()=>{};function Gi(t,e,n){let l,i,s,a,r,o,u,c,f,g,h,m,{$$slots:M={},$$scope:_}=e,{inputId:y=""}=e,{name:C="date"}=e,{disabled:F=!1}=e,{placeholder:W=null}=e,{required:L=!1}=e,{value:H=null}=e,{initialDate:A=null}=e,{isRange:p=!1}=e,{startDate:P=null}=e,{endDate:O=null}=e,{pickerOnly:T=!1}=e,{startView:B=ke}=e,{mode:w="auto"}=e,{disableDatesFn:E=null}=e,{manualInput:N=!1}=e,{theme:Q=ce.theme}=e,{format:Z=ce.format}=e,{formatType:J=ce.formatType}=e,{displayFormat:re=ce.displayFormat}=e,{displayFormatType:Oe=ce.displayFormatType}=e,{minuteIncrement:_e=ce.minuteIncrement}=e,{weekStart:Ze=ce.weekStart}=e,{inputClasses:D=ce.inputClasses}=e,{todayBtnClasses:q=ce.todayBtnClasses}=e,{clearBtnClasses:ae=ce.clearBtnClasses}=e,{todayBtn:be=ce.todayBtn}=e,{clearBtn:pe=ce.clearBtn}=e,{clearToggle:fe=ce.clearToggle}=e,{autocommit:ie=ce.autocommit}=e,{hourOnly:me=ce.hourOnly}=e,{i18n:se=ce.i18n}=e,{validatorAction:we=null}=e,{ce_valueElement:ee=null}=e,{ce_displayElement:K=null}=e,{positionResolver:Je=Ri}=e;const k=Vt();let{valueArray:S,prevValue:U,innerDates:G}=Ni(H,A,Z,se,J);!H&&A&&(H=p?S:S[0]);let ve=Z,st=T,_t=[...S],je=rt(),Qe=pt(),Kt,Me=B===zl?"time":"date",ot=!1,Yt=K,ml=we?we.shift():()=>{},_l=we||[],bt,Ht;function bl(d,ne,te,xe,ut,ze){return!d||ne&&(te==="datetime"||ut.length!==2)?!1:xe==="minute"||te===xe||ze&&xe==="hour"}function pl(d){d.join("")!==U.join("")&&(n(30,G=d.filter(ne=>ne).map(ne=>ct(ne,Z,se,J))),U=d,je=rt(),n(31,Qe=pt()))}function yl(d){const ne=Array.isArray(d)?d.join(","):d;je!==ne&&(n(67,S=(ne||"").split(",")),_t=S)}function wl(d,ne){ve!==d&&G.length&&(n(67,S=G.map(te=>$e(te,d,se,J))),U=S,n(31,Qe=pt()),ve=d,w==="auto"&&n(27,u=d.match(/g|hh?|ii?/i)&&d.match(/y|m|d/i)?"datetime":d.match(/g|hh?|ii?/i)?"time":"date"),je=rt(),Se(!0))}function pt(){return G.sort((d,ne)=>d-ne).map(d=>$e(d,re||Z,se,Oe||J)).join(" - ")}function vl(){return p?S.length===2?S:null:S[0]||null}function rt(){return S.join(",")}function Zt(d){return d.join(",")!==_t.join(",")}function Jt(){n(2,B=ke),ot=!1,u==="datetime"?setTimeout(()=>{T||n(35,l=!1),n(26,Me="date")},ie?300:0):T||n(35,l=!1)}function kl(d,ne){d==="date"&&u==="datetime"&&(p&&S.length===2||!p)?n(26,Me="time"):d==="hour"&&!me&&o[ne].ref.showMinuteView()}function yt({type:d,detail:ne}){let{value:te,isKeyboard:xe,dateIndex:ut}=ne;if(te&&!p&&G.length&&G[0].getFullYear()===te.getFullYear()&&G[0].getMonth()===te.getMonth()&&G[0].getDate()===te.getDate()&&u==="date"&&!L&&fe&&(te=null),p){if(d==="date")n(30,G=te?(G.length===2?[te]:G.concat(te)).map(ze=>ze.getTime()).sort().map(ze=>new Date(ze)):[]);else if(te&&ut!==void 0)n(30,G[ut]=te,G);else if(d==="datetime")n(30,G[0]=te,G),n(30,G[1]=te,G);else throw new Error(`Unhandled event type: '${d}'`);n(67,S=G.map(ze=>$e(ze,Z,se,J)))}else n(30,G=te?[te]:[]),n(67,S=te?[$e(te,Z,se,J)]:[]);xe||(n(68,Ht=d),kl(d,ut||0)),qn().then(()=>f&&Se(!xe))}function Se(d){n(0,H=vl()),je=rt(),_t=[...S],n(31,Qe=pt()),n(38,m=Zt(S)),Fl(!0),k("change",p?S:S[0]||null),k("dateChange",{value:p?S:S[0]||null,dateValue:p?G:G[0]||null,displayValue:Qe,valueFormat:Z,displayFormat:re}),d&&Jt()}function Dl(){const d=new Date,ne=G[0]||d;yt(new CustomEvent(u,{detail:{dateIndex:0,value:new Date(d.getFullYear(),d.getMonth(),d.getDate(),p?0:ne.getHours(),p?0:ne.getMinutes(),0),isKeyboard:!1}})),p&&yt(new CustomEvent(u,{detail:{dateIndex:1,value:new Date(d.getFullYear(),d.getMonth(),d.getDate(),23,59,59,999),isKeyboard:!1}})),Se(!0)}function wt(){n(67,S=[]),U=[],n(30,G=[]),je="",ie&&Se()}function At(){n(67,S=[..._t]),je=rt(),Jt(),k("cancel")}function Qt(d){if(l||(["Backspace","Delete"].includes(d.key)&&!L&&wt(),d.key==="Enter"&&at()),!l&&d.key!=="Tab"){n(35,l=d.key!=="Shift"),d.preventDefault();return}switch(d.key){case"PageDown":case"PageUp":case"ArrowDown":case"ArrowUp":case"ArrowLeft":case"ArrowRight":if(d.preventDefault(),p)return;Me==="date"?bt.handleGridNav(d.key,d.shiftKey):o[0].ref.makeTick(["ArrowDown","ArrowLeft","PageDown"].includes(d.key)?-1:1);break;case"Escape":ie?wt():At();break;case"Backspace":if(N&&!p)return;case"Delete":!L&&wt();break;case"Enter":if(st&&d.preventDefault(),S.length===0){n(35,l=!1);return}if(Me==="time"&&!ot)return o[0].ref.showMinuteView();if(u==="datetime"&&Me!=="time"){n(26,Me="time");return}Se(u==="date"||u.includes("time")&&ot);break;case"Tab":l&&(n(35,l=!1),d.preventDefault());case"F5":break;default:!N&&d.preventDefault()}}function Ml(d){d.preventDefault(),d.stopPropagation();const ne=ct(d.target.value,re||Z,se,Oe||J);$e(ne,re||Z,se,Oe||J)===d.target.value&&yt(new CustomEvent("date",{detail:{value:ne,isKeyboard:!0}}))}function Tl(d){n(2,B=ke),n(26,Me=d.detail),ot=!1}function at(){n(25,st=!0),n(35,l=!0)}function xt(){n(25,st=!1),c?Se(!1):At(),!K&&k("blur")}function Fl(d){ee&&K&&(n(57,ee.value=S.join(",")||"",ee),n(1,K.value=Qe,K),ee.dispatchEvent(new Event("input")),K.dispatchEvent(new Event("input"))),d&&k("input",je)}function El({detail:d}){n(32,Kt=d)}function Cl(d){ot=d.detail}Pl(()=>{K&&(n(1,K.onfocus=at,K),n(1,K.onblur=xt,K),n(1,K.onclick=()=>!l&&at(),K),n(1,K.onkeydown=Qt,K))});function Ol(d){Bt.call(this,t,d)}function Sl(d){Bt.call(this,t,d)}function Yl(d){Bt.call(this,t,d)}function Hl(d){kt[d?"unshift":"push"](()=>{Yt=d,n(33,Yt)})}const Al=()=>{!l&&at()};function Bl(d){kt[d?"unshift":"push"](()=>{bt=d,n(34,bt)})}function Rl(d,ne,te){kt[d?"unshift":"push"](()=>{ne[te].ref=d,n(37,o),n(8,p)})}const Nl=()=>Se(!0),Vl=()=>Se(!0);return t.$$set=d=>{"inputId"in d&&n(3,y=d.inputId),"name"in d&&n(4,C=d.name),"disabled"in d&&n(5,F=d.disabled),"placeholder"in d&&n(6,W=d.placeholder),"required"in d&&n(7,L=d.required),"value"in d&&n(0,H=d.value),"initialDate"in d&&n(58,A=d.initialDate),"isRange"in d&&n(8,p=d.isRange),"startDate"in d&&n(59,P=d.startDate),"endDate"in d&&n(60,O=d.endDate),"pickerOnly"in d&&n(9,T=d.pickerOnly),"startView"in d&&n(2,B=d.startView),"mode"in d&&n(61,w=d.mode),"disableDatesFn"in d&&n(10,E=d.disableDatesFn),"manualInput"in d&&n(11,N=d.manualInput),"theme"in d&&n(12,Q=d.theme),"format"in d&&n(13,Z=d.format),"formatType"in d&&n(14,J=d.formatType),"displayFormat"in d&&n(62,re=d.displayFormat),"displayFormatType"in d&&n(63,Oe=d.displayFormatType),"minuteIncrement"in d&&n(15,_e=d.minuteIncrement),"weekStart"in d&&n(16,Ze=d.weekStart),"inputClasses"in d&&n(17,D=d.inputClasses),"todayBtnClasses"in d&&n(18,q=d.todayBtnClasses),"clearBtnClasses"in d&&n(19,ae=d.clearBtnClasses),"todayBtn"in d&&n(20,be=d.todayBtn),"clearBtn"in d&&n(21,pe=d.clearBtn),"clearToggle"in d&&n(64,fe=d.clearToggle),"autocommit"in d&&n(22,ie=d.autocommit),"hourOnly"in d&&n(23,me=d.hourOnly),"i18n"in d&&n(24,se=d.i18n),"validatorAction"in d&&n(65,we=d.validatorAction),"ce_valueElement"in d&&n(57,ee=d.ce_valueElement),"ce_displayElement"in d&&n(1,K=d.ce_displayElement),"positionResolver"in d&&n(66,Je=d.positionResolver),"$$scope"in d&&n(69,_=d.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&512&&n(35,l=T),t.$$.dirty[0]&16801792|t.$$.dirty[1]&268435456&&n(29,i=P?ct(P,Z,se,J):null),t.$$.dirty[0]&16801792|t.$$.dirty[1]&536870912&&n(28,s=O?new Date(ct(O,Z,se,J).setSeconds(1)):null),t.$$.dirty[0]&805306368&&n(42,a=i&&i>new Date||s&&s({}):Ge),t.$$.dirty[0]&256&&n(37,o=qi(p)),t.$$.dirty[0]&8192|t.$$.dirty[1]&1073741824&&n(27,u=Vi(w,Z)),t.$$.dirty[0]&201326592&&u==="time"&&Me!==u&&n(26,Me=u),t.$$.dirty[0]&138412288&&n(36,c=ie&&(p&&u==="date"||!p)),t.$$.dirty[0]&146800896|t.$$.dirty[2]&96&&(f=bl(ie,p,u,Ht,S,me)),t.$$.dirty[0]&33554434&&K&&n(1,K.readOnly=st,K),t.$$.dirty[0]&512&&n(40,g=!!T),t.$$.dirty[0]&512|t.$$.dirty[2]&16&&n(39,h=T?()=>{}:Je),t.$$.dirty[2]&32&&n(38,m=Zt(S)),t.$$.dirty[0]&1&&yl(H),t.$$.dirty[2]&32&&pl(S),t.$$.dirty[0]&8192|t.$$.dirty[2]&1&&wl(Z)},[H,K,B,y,C,F,W,L,p,T,E,N,Q,Z,J,_e,Ze,D,q,ae,be,pe,ie,me,se,st,Me,u,s,i,G,Qe,Kt,Yt,bt,l,c,o,m,h,g,r,a,ml,_l,yt,Se,Dl,wt,At,Qt,Ml,Tl,at,xt,El,Cl,ee,A,P,O,w,re,Oe,fe,we,Je,S,Ht,_,M,Ol,Sl,Yl,Hl,Al,Bl,Rl,Nl,Vl]}class xi extends It{constructor(e){super(),Pt(this,e,Gi,Wi,Nt,{inputId:3,name:4,disabled:5,placeholder:6,required:7,value:0,initialDate:58,isRange:8,startDate:59,endDate:60,pickerOnly:9,startView:2,mode:61,disableDatesFn:10,manualInput:11,theme:12,format:13,formatType:14,displayFormat:62,displayFormatType:63,minuteIncrement:15,weekStart:16,inputClasses:17,todayBtnClasses:18,clearBtnClasses:19,todayBtn:20,clearBtn:21,clearToggle:64,autocommit:22,hourOnly:23,i18n:24,validatorAction:65,ce_valueElement:57,ce_displayElement:1,positionResolver:66},null,[-1,-1,-1,-1])}}export{xi as S}; diff --git a/docs/_app/immutable/chunks/SveltyPicker.855fb4f3.js b/docs/_app/immutable/chunks/SveltyPicker.855fb4f3.js new file mode 100644 index 0000000..8dc78ca --- /dev/null +++ b/docs/_app/immutable/chunks/SveltyPicker.855fb4f3.js @@ -0,0 +1,4 @@ +import{s as Nt,f as V,l as he,a as x,af as Re,g as I,h as R,m as de,d as v,c as $,ag as Ne,x as Dt,j as b,v as z,i as j,w as S,y as X,n as ge,N as He,L as Vt,k as $t,J as Ke,u as ht,Q as zn,O as Wn,t as qn,p as kt,e as Pe,r as Il,C as Gn,E as Xn,F as Kn,G as Zn,o as Pl,M as Jn,W as Bt,U as Ee}from"./scheduler.8d4e2d99.js";import{S as It,i as Pt,a as le,g as Ve,t as ue,c as Ie,j as Ct,k as Lt,f as tt,b as Qn,d as xn,m as $n,e as el}from"./index.e9e8ac0c.js";import{e as oe,u as gt,d as Ut,o as tl}from"./each.5f097185.js";import{e as Ll}from"./index.a4c1e395.js";import{c as Ul,f as Ge}from"./index.9ff153fe.js";const jl={theme:"sdt-calendar-colors",format:"yyyy-mm-dd",formatType:"standard",displayFormat:null,displayFormatType:null,minuteIncrement:1,weekStart:1,inputClasses:"",todayBtnClasses:"sdt-action-btn sdt-today-btn",clearBtnClasses:"sdt-action-btn sdt-clear-btn",hourOnly:!1,todayBtn:!0,clearBtn:!0,clearToggle:!0,autocommit:!0,i18n:Ll},Fe=0,We=1,ke=2,zl=3;function ct(t,e,n,l){var _,y;if(t instanceof Date)return t;const i=l==="php"?{date:"Y-m-d",datetime:"Y-m-d H:i",datetime_s:"Y-m-d H:i:s"}:{date:"yyyy-mm-dd",datetime:"yyyy-mm-dd hh:ii",datetime_s:"yyyy-mm-dd hh:ii:ss"};let s,a;/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(t)?s=Be.parseFormat(i.date,l):/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(t)?s=Be.parseFormat(i.datetime,l):/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(t)?s=Be.parseFormat(i.datetime_s,l):(/^([01]*\d|2[0-3])([0-5]\d)(?:[ ]([ap][m]|[AP][M]))?$/.test(t)&&(a=(_=t.match(/^([01]*\d|2[0-3])([0-5]\d)(?:[ ]([ap][m]|[AP][M]))?$/))==null?void 0:_.slice(1).filter(C=>C)),s=Be.parseFormat(e,l));const r=a||t&&t.toString().match(Be.nonpunctuation)||[];t=new Date,t.setHours(0,0,0,0);const o={},{setters_order:u,setters_map:c}=Be.setters(l);let f,g;if(r.length!==s.parts.length&&s.parts.includes("S")){const C=(y=r[s.parts.indexOf("S")-1].match(/(\d+)([a-zA-Z]+)/))==null?void 0:y.slice(1,3);r.splice(s.parts.indexOf("S")-1,1,...C)}if(r.length===s.parts.length){for(var h=0,m=s.parts.length;hl.setHours(i),h:(l,i)=>l.setHours(i),HH:(l,i)=>l.setHours(i===12?0:i),H:(l,i)=>l.setHours(i===12?0:i),i:(l,i)=>l.setMinutes(i),s:(l,i)=>l.setSeconds(i),yyyy:(l,i)=>l.setFullYear(i),yy:(l,i)=>l.setFullYear((i<50?2e3:1900)+i),m:(l,i)=>{for(i-=1;i<0;)i+=12;for(i%=12,l.setMonth(i);l.getMonth()!==i;){if(isNaN(l.getMonth()))return l;l.setDate(l.getDate()-1)}return l},d:(l,i)=>l.setDate(i),p:(l,i)=>l.setHours(i===1&&l.getHours()<12?l.getHours()+12:l.getHours()),t:(l,i)=>l.setTime(i),mm:()=>{},M:()=>{},MM:()=>{},ii:()=>{},ss:()=>{},dd:()=>{},D:()=>{},DD:()=>{},P:()=>{}},n.mm=n.M=n.MM=n.m,n.ii=n.i,n.ss=n.s,n.dd=n.D=n.DD=n.d,n.P=n.p):(e=["Y","yy","m","M","F","n","d","D","j","l","N","S","H","G","h","g","i","s","p","P","U"],n={H:(l,i)=>l.setHours(i),G:(l,i)=>l.setHours(i),h:(l,i)=>l.setHours(i===12?0:i),g:(l,i)=>l.setHours(i===12?0:i),i:(l,i)=>l.setMinutes(i),s:(l,i)=>l.setSeconds(i),Y:(l,i)=>l.setFullYear(i),yy:(l,i)=>l.setFullYear((i<50?2e3:1900)+i),m:(l,i)=>{for(i-=1;i<0;)i+=12;for(i%=12,l.setMonth(i);l.getMonth()!==i;){if(isNaN(l.getMonth()))return l;l.setDate(l.getDate()-1)}return l},n:(l,i)=>l.setMonth(i-1),d:(l,i)=>l.setDate(i),a:(l,i)=>l.setHours(i===1?l.getHours()+12:l.getHours()),U:(l,i)=>l.setTime(i*1e3)},n.F=n.M=n.m,n.D=n.j=n.l=n.N=n.d,n.A=n.a),{setters_order:e,setters_map:n}}};function Wl(t,e,n,l,i){if(n===Fe){let W=10,L=20;const H=-1,A=[];let p=[],P=t.getFullYear()-t.getFullYear()%10;P-=P%20?12:10,P%10&&(W=12,L=22);for(let T=0;T<32;T++)p.push(P+T),p.length===4&&(A.push(p),p=[]);let O=[];return e[0]||(e[0]=new Date),e[0].getFullYear()>=P&&O.push(e[0].getFullYear()%P),{years:A,todayMark:H,nextFrom:L,prevTo:W,selectionMark:O}}if(n===We){let W=[],L=[],H=12,A=24;const p=t.toISOString().split("T")[0].substring(0,8),P=new Date(p+"01 00:00:00"),O=P.getFullYear()-1;P.setFullYear(O);let T=0;for(let w=0;w<3;w++){for(let E=0;E<12;E++)P.setMonth(E),L.push(l.monthsShort[E%12]),L.length===4&&(W.push(L),L=[]);P.setFullYear(P.getFullYear()+1)}let B=[];return e[0]||(e[0]=new Date),e[0].getFullYear()-O>=0&&e[0].getFullYear()-O<=2&&B.push(e[0].getMonth()+(e[0].getFullYear()-O||0)*12),{months:W,todayMark:T,nextFrom:A,prevTo:H,selectionMark:B}}let s=t||new Date,a=s.getFullYear(),r=s.getMonth();s.getDate(),s.getHours();let o=new Date,u=new Date(a,r-1,28,0,0,0,0),c=nl(u.getFullYear(),u.getMonth());u.setDate(c),u.setDate(c-(u.getDay()-i+7)%7);let f=new Date(u);f.setDate(f.getDate()+42);let g=f.valueOf(),h=[],m=[],M=-1,_=[],y=0,C=42,F=0;for(;u.valueOf()a||u.getFullYear()===a&&u.getMonth()>r)&&(C=F-1),u.setDate(u.getDate()+1),u.getFullYear()===o.getFullYear()&&u.getMonth()===o.getMonth()&&u.getDate()===o.getDate()&&(M=F),_.length!==e.length&&e.map(W=>{u.getFullYear()===W.getFullYear()&&u.getMonth()===W.getMonth()&&u.getDate()===W.getDate()&&_.push(F)}),m.length===7&&(h.push(m),m=[]);return{grid:h,days:h,todayMark:M,prevTo:y,nextFrom:C,selectionMark:_}}function ql(t,{duration:e=400,start:n=0,end:l=1,opacity:i=0}){const s=getComputedStyle(t),a=+s.opacity,r=s.transform==="none"?"":s.transform,o=1-n,u=a*(1-i);return l=l||1,{delay:0,duration:e,easing:Ul,css:(c,f)=>` + transform: ${r} scale(${l!==1?n+l*f:1-o*f}); + opacity: ${a-u*f}; + `}}function en(t,e,n){const l=t.slice();return l[48]=e[n],l[50]=n,l}function tn(t,e,n){const l=t.slice();l[51]=e[n],l[55]=n;const i=l[50]*7+l[55];l[52]=i;const s=l[51].getTime();return l[53]=s,l}function nn(t,e,n){const l=t.slice();return l[56]=e[n],l}function ln(t,e,n){const l=t.slice();return l[48]=e[n],l[50]=n,l}function sn(t,e,n){const l=t.slice();l[60]=e[n],l[55]=n;const i=l[50]*4+l[55];return l[52]=i,l}function on(t,e,n){const l=t.slice();return l[48]=e[n],l[50]=n,l}function rn(t,e,n){const l=t.slice();l[63]=e[n],l[55]=n;const i=l[50]*4+l[55];return l[52]=i,l}function an(t){let e,n,l,i,s,a;return{c(){e=V("button"),n=Re("svg"),l=Re("path"),this.h()},l(r){e=I(r,"BUTTON",{type:!0,class:!0,title:!0});var o=R(e);n=Ne(o,"svg",{class:!0,xmlns:!0,viewBox:!0,width:!0,height:!0});var u=R(n);l=Ne(u,"path",{"fill-rule":!0,d:!0}),R(l).forEach(v),u.forEach(v),o.forEach(v),this.h()},h(){b(l,"fill-rule","evenodd"),b(l,"d","M1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0zM8 0a8 8 0 100 16A8 8 0 008 0zm.5 4.75a.75.75 0 00-1.5 0v3.5a.75.75 0 00.471.696l2.5 1a.75.75 0 00.557-1.392L8.5 7.742V4.75z"),b(n,"class","sdt-svg svelte-hexbpx"),b(n,"xmlns","http://www.w3.org/2000/svg"),b(n,"viewBox","0 0 16 16"),b(n,"width","16"),b(n,"height","16"),b(e,"type","button"),b(e,"class","std-btn std-btn-header icon-btn sdt-time-icon svelte-hexbpx"),b(e,"title",i=t[3].timeView)},m(r,o){j(r,e,o),S(e,n),S(n,l),s||(a=X(e,"click",t[28]),s=!0)},p(r,o){o[0]&8&&i!==(i=r[3].timeView)&&b(e,"title",i)},d(r){r&&v(e),s=!1,a()}}}function un(t){let e,n,l,i,s,a,r,o,u=oe(t[15].years),c=[];for(let f=0;f{a&&(s&&s.end(1),i=Ct(n,t[18],{duration:nt,start:t[20],opacity:1}),i.start())}),a=!0)},o(f){i&&i.invalidate(),f&&(s=Lt(n,t[18],{duration:nt,end:t[19],start:1})),a=!1},d(f){f&&v(e),ht(c,f),f&&s&&s.end(),r=!1,He(o)}}}function fn(t,e){let n,l,i=e[63]+"",s,a,r,o;function u(){return e[39](e[63])}return{key:t,first:null,c(){n=V("td"),l=V("button"),s=he(i),this.h()},l(c){n=I(c,"TD",{class:!0});var f=R(n);l=I(f,"BUTTON",{type:!0,class:!0});var g=R(l);s=de(g,i),g.forEach(v),f.forEach(v),this.h()},h(){b(l,"type","button"),b(l,"class","std-btn svelte-hexbpx"),l.disabled=a=e[22](new Date(e[63],e[7].getMonth(),e[7].getDate())),z(l,"not-current",!e[21](e[52])),b(n,"class","sdt-cal-td svelte-hexbpx"),z(n,"is-selected",e[15].selectionMark.includes(e[52])),this.first=n},m(c,f){j(c,n,f),S(n,l),S(l,s),r||(o=X(l,"click",u),r=!0)},p(c,f){e=c,f[0]&32768&&i!==(i=e[63]+"")&&ge(s,i),f[0]&32896&&a!==(a=e[22](new Date(e[63],e[7].getMonth(),e[7].getDate())))&&(l.disabled=a),f[0]&2129920&&z(l,"not-current",!e[21](e[52])),f[0]&32768&&z(n,"is-selected",e[15].selectionMark.includes(e[52]))},d(c){c&&v(n),r=!1,o()}}}function cn(t){let e,n=[],l=new Map,i,s=oe(t[48]);const a=r=>r[55];for(let r=0;r{a&&(s&&s.end(1),i=Ct(n,t[18],{duration:nt,start:t[20],opacity:1}),i.start())}),a=!0)},o(f){i&&i.invalidate(),f&&(s=Lt(n,t[18],{duration:nt,end:t[19],start:1})),a=!1},d(f){f&&v(e),ht(c,f),f&&s&&s.end(),r=!1,He(o)}}}function dn(t,e){let n,l,i=e[60]+"",s,a,r,o;function u(){return e[41](e[60])}return{key:t,first:null,c(){n=V("td"),l=V("button"),s=he(i),this.h()},l(c){n=I(c,"TD",{class:!0});var f=R(n);l=I(f,"BUTTON",{class:!0,type:!0});var g=R(l);s=de(g,i),g.forEach(v),f.forEach(v),this.h()},h(){b(l,"class","std-btn svelte-hexbpx"),b(l,"type","button"),l.disabled=a=e[22](new Date(e[7].getFullYear(),e[3].monthsShort.indexOf(e[60]),e[7].getDate())),z(l,"not-current",!e[21](e[52])),b(n,"class","sdt-cal-td svelte-hexbpx"),z(n,"is-selected",e[52]===e[15].selectionMark[0]),this.first=n},m(c,f){j(c,n,f),S(n,l),S(l,s),r||(o=X(l,"click",u),r=!0)},p(c,f){e=c,f[0]&32768&&i!==(i=e[60]+"")&&ge(s,i),f[0]&32904&&a!==(a=e[22](new Date(e[7].getFullYear(),e[3].monthsShort.indexOf(e[60]),e[7].getDate())))&&(l.disabled=a),f[0]&2129920&&z(l,"not-current",!e[21](e[52])),f[0]&32768&&z(n,"is-selected",e[52]===e[15].selectionMark[0])},d(c){c&&v(n),r=!1,o()}}}function gn(t){let e,n=[],l=new Map,i,s=oe(t[48]);const a=r=>r[55];for(let r=0;r{r&&(a&&a.end(1),s=Ct(n,t[18],{duration:nt,start:.5,opacity:1}),s.start())}),r=!0)},o(m){s&&s.invalidate(),m&&(a=Lt(n,t[18],{duration:nt,start:Math.abs(t[9])})),r=!1},d(m){m&&v(e),ht(f,m),ht(h,m),m&&a&&a.end(),o=!1,u()}}}function _n(t){let e,n=t[56]+"",l;return{c(){e=V("th"),l=he(n),this.h()},l(i){e=I(i,"TH",{class:!0});var s=R(e);l=de(s,n),s.forEach(v),this.h()},h(){b(e,"class","sdt-cal-th svelte-hexbpx")},m(i,s){j(i,e,s),S(e,l)},p(i,s){s[0]&131072&&n!==(n=i[56]+"")&&ge(l,n)},d(i){i&&v(e)}}}function bn(t,e){let n,l,i=e[51].getDate()+"",s,a,r,o;function u(){return e[43](e[51])}return{key:t,first:null,c(){n=V("td"),l=V("button"),s=he(i),this.h()},l(c){n=I(c,"TD",{class:!0});var f=R(n);l=I(f,"BUTTON",{type:!0,class:!0});var g=R(l);s=de(g,i),g.forEach(v),f.forEach(v),this.h()},h(){b(l,"type","button"),b(l,"class","std-btn sdt-btn-day svelte-hexbpx"),l.disabled=a=(e[16]||e[2]||e[6])&&e[22](e[51]),z(l,"not-current",!e[21](e[50]*7+e[55])),b(n,"class","sdt-cal-td svelte-hexbpx"),z(n,"sdt-today",e[52]===e[15].todayMark),z(n,"in-range",e[30](e[53])),z(n,"is-selected",e[14].includes(e[53])),z(n,"in-range-hover",e[5]&&e[31](e[53],e[0])),this.first=n},m(c,f){j(c,n,f),S(n,l),S(l,s),r||(o=[X(l,"click",u),X(n,"mouseover",function(){zn(e[29](e[51]))&&e[29](e[51]).apply(this,arguments)}),X(n,"mouseout",e[29]())],r=!0)},p(c,f){e=c,f[0]&32768&&i!==(i=e[51].getDate()+"")&&ge(s,i),f[0]&98372&&a!==(a=(e[16]||e[2]||e[6])&&e[22](e[51]))&&(l.disabled=a),f[0]&2129920&&z(l,"not-current",!e[21](e[50]*7+e[55])),f[0]&32768&&z(n,"sdt-today",e[52]===e[15].todayMark),f[0]&1073774592&&z(n,"in-range",e[30](e[53])),f[0]&49152&&z(n,"is-selected",e[14].includes(e[53])),f[0]&32801|f[1]&1&&z(n,"in-range-hover",e[5]&&e[31](e[53],e[0]))},d(c){c&&v(n),r=!1,He(o)}}}function pn(t){let e,n=[],l=new Map,i,s=oe(t[48]);const a=r=>r[55];for(let r=0;r{P=null}),Ie()),B[8]===We?O?(O.p(B,w),w[0]&256&&le(O,1)):(O=hn(B),O.c(),le(O,1),O.m(F,L)):O&&(Ve(),ue(O,1,1,()=>{O=null}),Ie()),B[8]===ke?T?(T.p(B,w),w[0]&256&&le(T,1)):(T=mn(B),T.c(),le(T,1),T.m(F,null)):T&&(Ve(),ue(T,1,1,()=>{T=null}),Ie()),w[0]&1024&&z(F,"is-grid",B[10])},i(B){le(P),le(O),le(T)},o(B){ue(P),ue(O),ue(T)},d(B){B&&(v(e),v(C),v(F)),p&&p.d(),P&&P.d(),O&&O.d(),T&&T.d(),H=!1,He(A)}}}let nt=400;const Te=222,ft=148;function Xl(t,e,n){var Je;let l,i,s,a,r,o,u,c,{wid:f}=e,{dates:g}=e,{startDate:h=null}=e,{endDate:m=null}=e,{weekStart:M=1}=e,{initialView:_=ke}=e,{i18n:y}=e,{enableTimeToggle:C=!1}=e,{isRange:F=!1}=e,{hoverDate:W=null}=e,{additionalDisableFn:L}=e;function H(D,Y){if(O!==ke){n(8,O=ke),n(9,T=1),n(7,p=new Date(A||new Date));return}if(!A){_e(new Date,{keyboard:!0});return}let U=new Date(A);switch(D){case"PageDown":Y=!0;case"ArrowDown":Y?U.setMonth(A.getMonth()+1):U.setDate(A.getDate()+7),Y&&U.getMonth()===A.getMonth()&&U.setDate(0),_e(U,{keyboard:!0});break;case"PageUp":Y=!0;case"ArrowUp":Y?U.setMonth(A.getMonth()-1):U.setDate(A.getDate()-7),Y&&U.getMonth()===A.getMonth()&&U.setDate(0),_e(U,{keyboard:!0});break;case"ArrowLeft":Y?U.setFullYear(A.getFullYear()-1):U.setDate(A.getDate()-1),_e(U,{keyboard:!0});break;case"ArrowRight":Y?U.setFullYear(A.getFullYear()+1):U.setDate(A.getDate()+1),_e(U,{keyboard:!0});break}}let A=g[f]||null,p=f===1?(()=>{if(g.length===2&&g[1]&&(g[0].getMonth()!=g[1].getMonth()||g[0].getFullYear()!=g[1].getFullYear()))return g[1];const D=new Date(g[0]||new Date);return D.setMonth(D.getMonth()+1),D})():new Date(((Je=g[0])==null?void 0:Je.valueOf())||new Date);const P=Vt();let O=_,T=-2,B=!1,w=Te,E=null;function N(D){return o.prevTo<=D&&DD||m&&m<=D||L&&L(D))return!0;break;case We:const Y=D.getFullYear(),U=l==null?void 0:l.getFullYear(),G=m==null?void 0:m.getFullYear();if(l&&(U===Y&&l.getMonth()>D.getMonth()||U>Y)||m&&(G===Y&&m.getMonth()D.getFullYear()||m&&m.getFullYear()ve.getFullYear():D.getFullYear()+Y*10ve.getFullYear():D.getFullYear()+Yve.getFullYear()*100+ve.getMonth():D.getFullYear()*100+D.getMonth()+Y28&&U.setDate(U.getDate()-3),U.setMonth(p.getMonth()+D*Y),n(7,p=U),n(12,E=null),n(11,w=O===Fe?p.getFullYear()%20>=10?Te:ft:Te)}function re(D){if(O===ke)return J(D);if(n(12,E=()=>{J(D)}),O===Fe){n(11,w=w===ft?D===-1?w-Te:Te+ft:D===-1?w-Te:w+ft);return}n(11,w=D===-1?w-Te:w+Te)}function Oe(){if(n(9,T=-1),n(10,B=!0),O&&n(8,O--,O),O===Fe){const D=Math.floor(p.getFullYear()/10)*10%20===0;n(11,w=D?ft:Te)}}function _e(D,{keyboard:Y}={}){switch(n(9,T=1),n(10,B=!0),O){case 0:p.setFullYear(D),n(7,p);break;case 1:p.setMonth(y.monthsShort.indexOf(D)),n(7,p);break;case 2:if(Q(D)||L&&L(D))return;const U=new Date(D.getFullYear(),D.getMonth(),D.getDate());A&&(U.setMinutes(A.getMinutes()),U.setHours(A.getHours())),A=U,Y&&(p.getFullYear()!==U.getFullYear()||p.getFullYear()===U.getFullYear()&&p.getMonth()!==U.getMonth())&&(p.setFullYear(U.getFullYear()),p.getDate()>28&&p.setDate(28),p.setMonth(U.getMonth()),n(7,p)),P("date",{value:A,update:"date",isKeyboard:Y});break}O=r[0]&&D=Y&&r[0]>=D)}const fe=()=>re(-1),ie=()=>re(1),me=D=>{_e(D)},se=()=>E&&E(),we=D=>{_e(D)},ee=()=>E&&E(),K=D=>{_e(D)};return t.$$set=D=>{"wid"in D&&n(32,f=D.wid),"dates"in D&&n(1,g=D.dates),"startDate"in D&&n(33,h=D.startDate),"endDate"in D&&n(2,m=D.endDate),"weekStart"in D&&n(34,M=D.weekStart),"initialView"in D&&n(35,_=D.initialView),"i18n"in D&&n(3,y=D.i18n),"enableTimeToggle"in D&&n(4,C=D.enableTimeToggle),"isRange"in D&&n(5,F=D.isRange),"hoverDate"in D&&n(0,W=D.hoverDate),"additionalDisableFn"in D&&n(6,L=D.additionalDisableFn)},t.$$.update=()=>{t.$$.dirty[1]&4&&n(16,l=h?new Date(h.getFullYear(),h.getMonth(),h.getDate(),0,0,0,0):null),t.$$.dirty[0]&512&&n(20,i=T<1?1.5:.5),t.$$.dirty[0]&512&&n(19,s=T<1?1:1.5),t.$$.dirty[0]&512&&n(18,a=T===-2?Ge:T!==null?ql:()=>({})),t.$$.dirty[0]&2&&n(14,r=g.map(D=>(D=new Date(D),D.setHours(0,0),D.getTime()))),t.$$.dirty[0]&394|t.$$.dirty[1]&8&&n(15,o=Wl(p,g,O,y,M)),t.$$.dirty[0]&8|t.$$.dirty[1]&8&&n(17,u=y.daysMin.concat(...y.daysMin.slice(1)).slice(M,7+M)),t.$$.dirty[0]&2&&g.length===0&&(A=null),t.$$.dirty[0]&392&&n(13,c=y&&q(O,p))},[W,g,m,y,C,F,L,p,O,T,B,w,E,c,r,o,l,u,a,s,i,N,Q,Z,re,Oe,_e,Ze,k,ae,be,pe,f,h,M,_,H,fe,ie,me,se,we,ee,K]}class Kl extends It{constructor(e){super(),Pt(this,e,Xl,Gl,Nt,{wid:32,dates:1,startDate:33,endDate:2,weekStart:34,initialView:35,i18n:3,enableTimeToggle:4,isRange:5,hoverDate:0,additionalDisableFn:6,handleGridNav:36},null,[-1,-1,-1])}get handleGridNav(){return this.$$.ctx[36]}}function yn(t,e,n){const l=t.slice();return l[37]=e[n],l[39]=n,l}function wn(t,e,n){const l=t.slice();return l[37]=e[n],l[39]=n,l}function vn(t){let e,n,l,i,s,a;return{c(){e=V("button"),n=Re("svg"),l=Re("path"),this.h()},l(r){e=I(r,"BUTTON",{type:!0,class:!0,title:!0});var o=R(e);n=Ne(o,"svg",{class:!0,xmlns:!0,viewBox:!0,width:!0,height:!0});var u=R(n);l=Ne(u,"path",{"fill-rule":!0,d:!0}),R(l).forEach(v),u.forEach(v),o.forEach(v),this.h()},h(){b(l,"fill-rule","evenodd"),b(l,"d","M6.75 0a.75.75 0 01.75.75V3h9V.75a.75.75 0 011.5 0V3h2.75c.966 0 1.75.784 1.75 1.75v16a1.75 1.75 0 01-1.75 1.75H3.25a1.75 1.75 0 01-1.75-1.75v-16C1.5 3.784 2.284 3 3.25 3H6V.75A.75.75 0 016.75 0zm-3.5 4.5a.25.25 0 00-.25.25V8h18V4.75a.25.25 0 00-.25-.25H3.25zM21 9.5H3v11.25c0 .138.112.25.25.25h17.5a.25.25 0 00.25-.25V9.5z"),b(n,"class","sdt-svg svelte-bn8ebp"),b(n,"xmlns","http://www.w3.org/2000/svg"),b(n,"viewBox","0 0 24 24"),b(n,"width","20"),b(n,"height","20"),b(e,"type","button"),b(e,"class","sdt-time-btn sdt-back-btn svelte-bn8ebp"),b(e,"title",i=t[5].backToDate)},m(r,o){j(r,e,o),S(e,n),S(n,l),s||(a=X(e,"click",t[22]),s=!0)},p(r,o){o[0]&32&&i!==(i=r[5].backToDate)&&b(e,"title",i)},d(r){r&&v(e),s=!1,a()}}}function Zl(t){let e,n=t[16](t[9],t[3])+"",l,i,s;function a(u,c){return u[3]?xl:Ql}let r=a(t),o=r(t);return{c(){e=V("span"),l=he(n),i=x(),o.c(),s=Pe(),this.h()},l(u){e=I(u,"SPAN",{class:!0});var c=R(e);l=de(c,n),c.forEach(v),i=$(u),o.l(u),s=Pe(),this.h()},h(){b(e,"class","sdt-time-figure svelte-bn8ebp")},m(u,c){j(u,e,c),S(e,l),j(u,i,c),o.m(u,c),j(u,s,c)},p(u,c){c[0]&520&&n!==(n=u[16](u[9],u[3])+"")&&ge(l,n),r===(r=a(u))&&o?o.p(u,c):(o.d(1),o=r(u),o&&(o.c(),o.m(s.parentNode,s)))},d(u){u&&(v(e),v(i),v(s)),o.d(u)}}}function Jl(t){let e,n=t[16](t[9],t[3])+"",l,i,s,a=":",r,o,u=t[16](t[8],!1)+"",c,f,g;return{c(){e=V("button"),l=he(n),i=x(),s=V("span"),s.textContent=a,r=x(),o=V("button"),c=he(u),this.h()},l(h){e=I(h,"BUTTON",{type:!0,class:!0});var m=R(e);l=de(m,n),m.forEach(v),i=$(h),s=I(h,"SPAN",{"data-svelte-h":!0}),Dt(s)!=="svelte-5vnx5k"&&(s.textContent=a),r=$(h),o=I(h,"BUTTON",{type:!0,class:!0});var M=R(o);c=de(M,u),M.forEach(v),this.h()},h(){b(e,"type","button"),b(e,"class","sdt-time-btn sdt-time-figure svelte-bn8ebp"),z(e,"is-active",!t[6]),b(o,"type","button"),b(o,"class","sdt-time-btn sdt-time-figure svelte-bn8ebp"),z(o,"is-active",t[6])},m(h,m){j(h,e,m),S(e,l),j(h,i,m),j(h,s,m),j(h,r,m),j(h,o,m),S(o,c),f||(g=[X(e,"click",t[28]),X(o,"click",t[29])],f=!0)},p(h,m){m[0]&520&&n!==(n=h[16](h[9],h[3])+"")&&ge(l,n),m[0]&64&&z(e,"is-active",!h[6]),m[0]&256&&u!==(u=h[16](h[8],!1)+"")&&ge(c,u),m[0]&64&&z(o,"is-active",h[6])},d(h){h&&(v(e),v(i),v(s),v(r),v(o)),f=!1,He(g)}}}function Ql(t){let e,n=":",l,i,s="00";return{c(){e=V("span"),e.textContent=n,l=x(),i=V("span"),i.textContent=s,this.h()},l(a){e=I(a,"SPAN",{"data-svelte-h":!0}),Dt(e)!=="svelte-5vnx5k"&&(e.textContent=n),l=$(a),i=I(a,"SPAN",{class:!0,"data-svelte-h":!0}),Dt(i)!=="svelte-15oc2gl"&&(i.textContent=s),this.h()},h(){b(i,"class","sdt-time-figure svelte-bn8ebp")},m(a,r){j(a,e,r),j(a,l,r),j(a,i,r)},p:Il,d(a){a&&(v(e),v(l),v(i))}}}function xl(t){let e,n=(t[13]?t[5].meridiem[1]:t[5].meridiem[0]).toUpperCase()+"",l;return{c(){e=V("span"),l=he(n),this.h()},l(i){e=I(i,"SPAN",{class:!0});var s=R(e);l=de(s,n),s.forEach(v),this.h()},h(){b(e,"class","sdt-time-figure svelte-bn8ebp")},m(i,s){j(i,e,s),S(e,l)},p(i,s){s[0]&8224&&n!==(n=(i[13]?i[5].meridiem[1]:i[5].meridiem[0]).toUpperCase()+"")&&ge(l,n)},d(i){i&&v(e)}}}function kn(t){let e,n,l=(t[13]?t[5].meridiem[1]:t[5].meridiem[0])+"",i,s,a,r;return{c(){e=V("div"),n=V("button"),i=he(l),this.h()},l(o){e=I(o,"DIV",{class:!0});var u=R(e);n=I(u,"BUTTON",{type:!0,class:!0,"data-value":!0});var c=R(n);i=de(c,l),c.forEach(v),u.forEach(v),this.h()},h(){b(n,"type","button"),b(n,"class","sdt-time-btn sdt-time-figure is-active svelte-bn8ebp"),b(n,"data-value",s=t[13]?t[9]%12:t[9]+12),b(e,"class","sdt-meridian svelte-bn8ebp")},m(o,u){j(o,e,u),S(e,n),S(n,i),a||(r=X(n,"click",t[20]),a=!0)},p(o,u){u[0]&8224&&l!==(l=(o[13]?o[5].meridiem[1]:o[5].meridiem[0])+"")&&ge(i,l),u[0]&8704&&s!==(s=o[13]?o[9]%12:o[9]+12)&&b(n,"data-value",s)},d(o){o&&v(e),a=!1,r()}}}function Dn(t,e){let n,l=e[37].val+"",i,s,a,r,o,u;return{key:t,first:null,c(){n=V("button"),i=he(l),this.h()},l(c){n=I(c,"BUTTON",{type:!0,style:!0,class:!0,"data-value":!0});var f=R(n);i=de(f,l),f.forEach(v),this.h()},h(){b(n,"type","button"),b(n,"style",s=`left:${e[37].x}px; top:${e[37].y}px;`),b(n,"class","sdt-tick svelte-bn8ebp"),b(n,"data-value",a=e[37].val),n.disabled=r=(e[0]||e[1])&&e[7]&&e[18](e[37].val,!1),z(n,"outer-tick",e[6]),z(n,"is-selected",e[17](e[9],e[37].val,e[39])),this.first=n},m(c,f){j(c,n,f),S(n,i),u=!0},p(c,f){e=c,(!u||f[0]&32768)&&l!==(l=e[37].val+"")&&ge(i,l),(!u||f[0]&32768&&s!==(s=`left:${e[37].x}px; top:${e[37].y}px;`))&&b(n,"style",s),(!u||f[0]&32768&&a!==(a=e[37].val))&&b(n,"data-value",a),(!u||f[0]&32899&&r!==(r=(e[0]||e[1])&&e[7]&&e[18](e[37].val,!1)))&&(n.disabled=r),(!u||f[0]&64)&&z(n,"outer-tick",e[6]),(!u||f[0]&164352)&&z(n,"is-selected",e[17](e[9],e[37].val,e[39]))},i(c){u||(c&&Ke(()=>{u&&(o||(o=tt(n,Ge,{duration:200},!0)),o.run(1))}),u=!0)},o(c){c&&(o||(o=tt(n,Ge,{duration:200},!1)),o.run(0)),u=!1},d(c){c&&v(n),c&&o&&o.end()}}}function Mn(t){let e,n=t[37].val+"",l,i,s,a,r,o;return{c(){e=V("button"),l=he(n),this.h()},l(u){e=I(u,"BUTTON",{type:!0,style:!0,class:!0,"data-value":!0});var c=R(e);l=de(c,n),c.forEach(v),this.h()},h(){b(e,"type","button"),b(e,"style",i=`left:${t[37].x}px; top:${t[37].y}px;`),b(e,"class","sdt-tick svelte-bn8ebp"),b(e,"data-value",s=t[37].val),e.disabled=a=(t[0]||t[1])&&t[7]&&t[18](t[37].val,!1),z(e,"outer-tick",t[3]&&!t[6]),z(e,"is-selected",t[17](t[6]?t[8]:t[9],t[37].val,t[39]))},m(u,c){j(u,e,c),S(e,l),o=!0},p(u,c){(!o||c[0]&16384)&&n!==(n=u[37].val+"")&&ge(l,n),(!o||c[0]&16384&&i!==(i=`left:${u[37].x}px; top:${u[37].y}px;`))&&b(e,"style",i),(!o||c[0]&16384&&s!==(s=u[37].val))&&b(e,"data-value",s),(!o||c[0]&16515&&a!==(a=(u[0]||u[1])&&u[7]&&u[18](u[37].val,!1)))&&(e.disabled=a),(!o||c[0]&72)&&z(e,"outer-tick",u[3]&&!u[6]),(!o||c[0]&148288)&&z(e,"is-selected",u[17](u[6]?u[8]:u[9],u[37].val,u[39]))},i(u){o||(u&&Ke(()=>{o&&(r||(r=tt(e,Ge,{duration:200},!0)),r.run(1))}),o=!0)},o(u){u&&(r||(r=tt(e,Ge,{duration:200},!1)),r.run(0)),o=!1},d(u){u&&v(e),u&&r&&r.end()}}}function $l(t){let e,n,l,i,s,a,r,o,u,c,f,g=[],h=new Map,m,M,_,y,C,F=t[4]&&vn(t);function W(w,E){return w[2]?Zl:Jl}let L=W(t),H=L(t),A=t[3]&&kn(t),p=oe(t[15]);const P=w=>w[37].val;for(let w=0;wue(T[w],1,1,()=>{T[w]=null});return{c(){e=V("div"),n=V("div"),F&&F.c(),l=x(),H.c(),i=x(),A&&A.c(),s=x(),a=V("div"),r=V("div"),o=x(),u=V("div"),c=V("div"),f=x();for(let w=0;w{M=Ct(e,Ge,{duration:200}),M.start()})),_=!0}},o(w){for(let E=0;E=9||ee<3?-1:1)*q),val:be?ee*5||ae:ee?ee+pe:ae});return we}function B(k,q){return q?i&&k===12?12:k<10||k%12<10?`0${k%12}`:k%12:k<10?`0${k}`:k}function w(k,q,ae){return H?q===k||ae===0&&ae===k:_?i&&q==12&&k===12||!i&&q==12&&k===0?!0:q===(k?k%12:12):+q>12?(ae?a*ae+12:0)===k:q==="00"||q==="12"?k===12&&parseInt(q)==12||q==="00"&&k===0:q===k}function E(k,q=!1){return typeof k=="string"&&(k=parseInt(k)),g&&h&&r?H||q?g.getHours()===p.getHours()&&g.getMinutes()>k||h.getHours()===p.getHours()&&h.getMinutes()k||h.getHours()k:g.getHours()>k:h&&h.getDate()===p.getDate()&&h.getMonth()===p.getMonth()&&h.getFullYear()===p.getFullYear()?H||q?h.getHours()===p.getHours()&&h.getMinutes()s?s+M:s-M),p[pe](be)}else if(H){const be=L.getBoundingClientRect(),pe=k.clientX-be.left,fe=k.clientY-be.top,ie=130,me=130;let se=null;switch(pe>ie?se=fe>me?2:1:se=fe>me?3:4,se){case 1:q=pe-ie,ae=me-fe;break;case 2:q=pe-ie,ae=fe-me;break;case 3:q=ie-pe,ae=fe-me;break;case 4:q=ie-pe,ae=me-fe;break}const we=Math.sqrt(q*q+ae*ae),ee=90-Math.asin(q/we)*(180/Math.PI);let K=0;switch(se){case 1:K=90-ee;break;case 2:K=ee+90;break;case 3:K=270-ee;break;case 4:K=ee+270;break}K=Math.round(K/6/M)*M,K>=60&&(K=0),p.setMinutes(K)}n(7,p),n(23,f),A||(P(H?"minute":"hour",{value:p,isKeyboard:k.type==="keyboard",dateIndex:c}),k.type!=="keyboard"&&!H&&!m&&n(6,H=!0))}function Q(k){const q=parseInt(k.target.dataset.value);p.setHours(q),n(7,p),n(23,f),P(H?"minute":"hour",{value:p,isKeyboard:!0})}function Z(k){n(11,A=k.type==="mousedown")}function J(){P("switch","date")}const re=()=>n(6,H=!1),Oe=()=>n(6,H=!0),_e=k=>{A&&N(k)};function Ze(k){kt[k?"unshift":"push"](()=>{L=k,n(10,L)})}return t.$$set=k=>{"wid"in k&&n(24,c=k.wid),"date"in k&&n(23,f=k.date),"startDate"in k&&n(0,g=k.startDate),"endDate"in k&&n(1,h=k.endDate),"hourOnly"in k&&n(2,m=k.hourOnly),"minuteIncrement"in k&&n(25,M=k.minuteIncrement),"showMeridian"in k&&n(3,_=k.showMeridian),"hasDateComponent"in k&&n(4,y=k.hasDateComponent),"i18n"in k&&n(5,C=k.i18n)},t.$$.update=()=>{if(t.$$.dirty[0]&8388736&&f!==p&&f&&n(7,p=f),t.$$.dirty[0]&131){let k=!1;g&&g.toDateString()===p.toDateString()&&(E(p.getHours())&&(p.setHours(g.getHours()),k=!0),E(p.getMinutes(),!0)&&(p.setMinutes(g.getMinutes()),k=!0)),h&&h.toDateString()===p.toDateString()&&(E(p.getHours())&&(p.setHours(h.getHours()),k=!0),E(p.getMinutes(),!0)&&(p.setMinutes(h.getMinutes()),k=!0)),k&&qn().then(()=>P("time",p))}if(t.$$.dirty[0]&128&&n(9,l=p?p.getHours():0),t.$$.dirty[0]&520&&n(13,i=_?l>=12:!1),t.$$.dirty[0]&128&&n(8,s=p?p.getMinutes():0),t.$$.dirty[0]&840){let k=H?s*6:l%12*30;n(12,O=H||_||l<12?`transform: rotateZ(${k}deg);`:`transform: rotateZ(${k}deg); height: calc(25% + 1px)`)}t.$$.dirty[0]&64&&(a=H?5:1),t.$$.dirty[0]&3&&(r=g&&h&&["getFullYear","getMonth","getDate"].every(k=>h[k]()===g[k]())),t.$$.dirty[0]&64&&n(15,o=T(H?220:180,110,"00",!1,0)),t.$$.dirty[0]&64&&n(14,u=T(H?180:120,110,H?"00":"12",H,12)),t.$$.dirty[0]&64&&P("time-switch",H)},[g,h,m,_,y,C,H,p,s,l,L,A,O,i,u,o,B,w,E,N,Q,Z,J,f,c,M,F,W,re,Oe,_e,Ze]}class ti extends It{constructor(e){super(),Pt(this,e,ei,$l,Nt,{wid:24,date:23,startDate:0,endDate:1,hourOnly:2,minuteIncrement:25,showMeridian:3,hasDateComponent:4,i18n:5,showMinuteView:26,makeTick:27},null,[-1,-1])}get showMinuteView(){return this.$$.ctx[26]}get makeTick(){return this.$$.ctx[27]}}const Mt=Math.min,qe=Math.max,Tt=Math.round,vt=Math.floor,Le=t=>({x:t,y:t}),ni={left:"right",right:"left",bottom:"top",top:"bottom"},li={start:"end",end:"start"};function Tn(t,e,n){return qe(t,Mt(e,n))}function jt(t,e){return typeof t=="function"?t(e):t}function lt(t){return t.split("-")[0]}function zt(t){return t.split("-")[1]}function ll(t){return t==="x"?"y":"x"}function il(t){return t==="y"?"height":"width"}function Wt(t){return["top","bottom"].includes(lt(t))?"y":"x"}function sl(t){return ll(Wt(t))}function ii(t,e,n){n===void 0&&(n=!1);const l=zt(t),i=sl(t),s=il(i);let a=i==="x"?l===(n?"end":"start")?"right":"left":l==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=Ft(a)),[a,Ft(a)]}function si(t){const e=Ft(t);return[Rt(t),e,Rt(e)]}function Rt(t){return t.replace(/start|end/g,e=>li[e])}function oi(t,e,n){const l=["left","right"],i=["right","left"],s=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:l:e?l:i;case"left":case"right":return e?s:a;default:return[]}}function ri(t,e,n,l){const i=zt(t);let s=oi(lt(t),n==="start",l);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(Rt)))),s}function Ft(t){return t.replace(/left|right|bottom|top/g,e=>ni[e])}function ai(t){return{top:0,right:0,bottom:0,left:0,...t}}function ui(t){return typeof t!="number"?ai(t):{top:t,right:t,bottom:t,left:t}}function Et(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function Fn(t,e,n){let{reference:l,floating:i}=t;const s=Wt(e),a=sl(e),r=il(a),o=lt(e),u=s==="y",c=l.x+l.width/2-i.width/2,f=l.y+l.height/2-i.height/2,g=l[r]/2-i[r]/2;let h;switch(o){case"top":h={x:c,y:l.y-i.height};break;case"bottom":h={x:c,y:l.y+l.height};break;case"right":h={x:l.x+l.width,y:f};break;case"left":h={x:l.x-i.width,y:f};break;default:h={x:l.x,y:l.y}}switch(zt(e)){case"start":h[a]-=g*(n&&u?-1:1);break;case"end":h[a]+=g*(n&&u?-1:1);break}return h}const fi=async(t,e,n)=>{const{placement:l="bottom",strategy:i="absolute",middleware:s=[],platform:a}=n,r=s.filter(Boolean),o=await(a.isRTL==null?void 0:a.isRTL(e));let u=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:c,y:f}=Fn(u,l,o),g=l,h={},m=0;for(let M=0;MB<=0)){var P,O;const B=(((P=s.flip)==null?void 0:P.index)||0)+1,w=L[B];if(w)return{data:{index:B,overflows:p},reset:{placement:w}};let E=(O=p.filter(N=>N.overflows[0]<=0).sort((N,Q)=>N.overflows[1]-Q.overflows[1])[0])==null?void 0:O.placement;if(!E)switch(h){case"bestFit":{var T;const N=(T=p.map(Q=>[Q.placement,Q.overflows.filter(Z=>Z>0).reduce((Z,J)=>Z+J,0)]).sort((Q,Z)=>Q[1]-Z[1])[0])==null?void 0:T[0];N&&(E=N);break}case"initialPlacement":E=r;break}if(i!==E)return{reset:{placement:E}}}return{}}}},hi=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:l,placement:i}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:r={fn:_=>{let{x:y,y:C}=_;return{x:y,y:C}}},...o}=jt(t,e),u={x:n,y:l},c=await ol(e,o),f=Wt(lt(i)),g=ll(f);let h=u[g],m=u[f];if(s){const _=g==="y"?"top":"left",y=g==="y"?"bottom":"right",C=h+c[_],F=h-c[y];h=Tn(C,h,F)}if(a){const _=f==="y"?"top":"left",y=f==="y"?"bottom":"right",C=m+c[_],F=m-c[y];m=Tn(C,m,F)}const M=r.fn({...e,[g]:h,[f]:m});return{...M,data:{x:M.x-n,y:M.y-l}}}}};function Ue(t){return rl(t)?(t.nodeName||"").toLowerCase():"#document"}function ye(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ae(t){var e;return(e=(rl(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function rl(t){return t instanceof Node||t instanceof ye(t).Node}function Ye(t){return t instanceof Element||t instanceof ye(t).Element}function Ce(t){return t instanceof HTMLElement||t instanceof ye(t).HTMLElement}function En(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ye(t).ShadowRoot}function mt(t){const{overflow:e,overflowX:n,overflowY:l,display:i}=De(t);return/auto|scroll|overlay|hidden|clip/.test(e+l+n)&&!["inline","contents"].includes(i)}function di(t){return["table","td","th"].includes(Ue(t))}function qt(t){const e=Gt(),n=De(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(l=>(n.willChange||"").includes(l))||["paint","layout","strict","content"].some(l=>(n.contain||"").includes(l))}function gi(t){let e=it(t);for(;Ce(e)&&!Ot(e);){if(qt(e))return e;e=it(e)}return null}function Gt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ot(t){return["html","body","#document"].includes(Ue(t))}function De(t){return ye(t).getComputedStyle(t)}function St(t){return Ye(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function it(t){if(Ue(t)==="html")return t;const e=t.assignedSlot||t.parentNode||En(t)&&t.host||Ae(t);return En(e)?e.host:e}function al(t){const e=it(t);return Ot(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ce(e)&&mt(e)?e:al(e)}function dt(t,e,n){var l;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=al(t),s=i===((l=t.ownerDocument)==null?void 0:l.body),a=ye(i);return s?e.concat(a,a.visualViewport||[],mt(i)?i:[],a.frameElement&&n?dt(a.frameElement):[]):e.concat(i,dt(i,[],n))}function ul(t){const e=De(t);let n=parseFloat(e.width)||0,l=parseFloat(e.height)||0;const i=Ce(t),s=i?t.offsetWidth:n,a=i?t.offsetHeight:l,r=Tt(n)!==s||Tt(l)!==a;return r&&(n=s,l=a),{width:n,height:l,$:r}}function Xt(t){return Ye(t)?t:t.contextElement}function et(t){const e=Xt(t);if(!Ce(e))return Le(1);const n=e.getBoundingClientRect(),{width:l,height:i,$:s}=ul(e);let a=(s?Tt(n.width):n.width)/l,r=(s?Tt(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!r||!Number.isFinite(r))&&(r=1),{x:a,y:r}}const mi=Le(0);function fl(t){const e=ye(t);return!Gt()||!e.visualViewport?mi:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function _i(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ye(t)?!1:e}function Xe(t,e,n,l){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=Xt(t);let a=Le(1);e&&(l?Ye(l)&&(a=et(l)):a=et(t));const r=_i(s,n,l)?fl(s):Le(0);let o=(i.left+r.x)/a.x,u=(i.top+r.y)/a.y,c=i.width/a.x,f=i.height/a.y;if(s){const g=ye(s),h=l&&Ye(l)?ye(l):l;let m=g,M=m.frameElement;for(;M&&l&&h!==m;){const _=et(M),y=M.getBoundingClientRect(),C=De(M),F=y.left+(M.clientLeft+parseFloat(C.paddingLeft))*_.x,W=y.top+(M.clientTop+parseFloat(C.paddingTop))*_.y;o*=_.x,u*=_.y,c*=_.x,f*=_.y,o+=F,u+=W,m=ye(M),M=m.frameElement}}return Et({width:c,height:f,x:o,y:u})}const bi=[":popover-open",":modal"];function cl(t){return bi.some(e=>{try{return t.matches(e)}catch{return!1}})}function pi(t){let{elements:e,rect:n,offsetParent:l,strategy:i}=t;const s=i==="fixed",a=Ae(l),r=e?cl(e.floating):!1;if(l===a||r&&s)return n;let o={scrollLeft:0,scrollTop:0},u=Le(1);const c=Le(0),f=Ce(l);if((f||!f&&!s)&&((Ue(l)!=="body"||mt(a))&&(o=St(l)),Ce(l))){const g=Xe(l);u=et(l),c.x=g.x+l.clientLeft,c.y=g.y+l.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-o.scrollLeft*u.x+c.x,y:n.y*u.y-o.scrollTop*u.y+c.y}}function yi(t){return Array.from(t.getClientRects())}function hl(t){return Xe(Ae(t)).left+St(t).scrollLeft}function wi(t){const e=Ae(t),n=St(t),l=t.ownerDocument.body,i=qe(e.scrollWidth,e.clientWidth,l.scrollWidth,l.clientWidth),s=qe(e.scrollHeight,e.clientHeight,l.scrollHeight,l.clientHeight);let a=-n.scrollLeft+hl(t);const r=-n.scrollTop;return De(l).direction==="rtl"&&(a+=qe(e.clientWidth,l.clientWidth)-i),{width:i,height:s,x:a,y:r}}function vi(t,e){const n=ye(t),l=Ae(t),i=n.visualViewport;let s=l.clientWidth,a=l.clientHeight,r=0,o=0;if(i){s=i.width,a=i.height;const u=Gt();(!u||u&&e==="fixed")&&(r=i.offsetLeft,o=i.offsetTop)}return{width:s,height:a,x:r,y:o}}function ki(t,e){const n=Xe(t,!0,e==="fixed"),l=n.top+t.clientTop,i=n.left+t.clientLeft,s=Ce(t)?et(t):Le(1),a=t.clientWidth*s.x,r=t.clientHeight*s.y,o=i*s.x,u=l*s.y;return{width:a,height:r,x:o,y:u}}function Cn(t,e,n){let l;if(e==="viewport")l=vi(t,n);else if(e==="document")l=wi(Ae(t));else if(Ye(e))l=ki(e,n);else{const i=fl(t);l={...e,x:e.x-i.x,y:e.y-i.y}}return Et(l)}function dl(t,e){const n=it(t);return n===e||!Ye(n)||Ot(n)?!1:De(n).position==="fixed"||dl(n,e)}function Di(t,e){const n=e.get(t);if(n)return n;let l=dt(t,[],!1).filter(r=>Ye(r)&&Ue(r)!=="body"),i=null;const s=De(t).position==="fixed";let a=s?it(t):t;for(;Ye(a)&&!Ot(a);){const r=De(a),o=qt(a);!o&&r.position==="fixed"&&(i=null),(s?!o&&!i:!o&&r.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||mt(a)&&!o&&dl(t,a))?l=l.filter(c=>c!==a):i=r,a=it(a)}return e.set(t,l),l}function Mi(t){let{element:e,boundary:n,rootBoundary:l,strategy:i}=t;const a=[...n==="clippingAncestors"?Di(e,this._c):[].concat(n),l],r=a[0],o=a.reduce((u,c)=>{const f=Cn(e,c,i);return u.top=qe(f.top,u.top),u.right=Mt(f.right,u.right),u.bottom=Mt(f.bottom,u.bottom),u.left=qe(f.left,u.left),u},Cn(e,r,i));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}}function Ti(t){const{width:e,height:n}=ul(t);return{width:e,height:n}}function Fi(t,e,n){const l=Ce(e),i=Ae(e),s=n==="fixed",a=Xe(t,!0,s,e);let r={scrollLeft:0,scrollTop:0};const o=Le(0);if(l||!l&&!s)if((Ue(e)!=="body"||mt(i))&&(r=St(e)),l){const f=Xe(e,!0,s,e);o.x=f.x+e.clientLeft,o.y=f.y+e.clientTop}else i&&(o.x=hl(i));const u=a.left+r.scrollLeft-o.x,c=a.top+r.scrollTop-o.y;return{x:u,y:c,width:a.width,height:a.height}}function On(t,e){return!Ce(t)||De(t).position==="fixed"?null:e?e(t):t.offsetParent}function gl(t,e){const n=ye(t);if(!Ce(t)||cl(t))return n;let l=On(t,e);for(;l&&di(l)&&De(l).position==="static";)l=On(l,e);return l&&(Ue(l)==="html"||Ue(l)==="body"&&De(l).position==="static"&&!qt(l))?n:l||gi(t)||n}const Ei=async function(t){const e=this.getOffsetParent||gl,n=this.getDimensions;return{reference:Fi(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,...await n(t.floating)}}};function Ci(t){return De(t).direction==="rtl"}const Oi={convertOffsetParentRelativeRectToViewportRelativeRect:pi,getDocumentElement:Ae,getClippingRect:Mi,getOffsetParent:gl,getElementRects:Ei,getClientRects:yi,getDimensions:Ti,getScale:et,isElement:Ye,isRTL:Ci};function Si(t,e){let n=null,l;const i=Ae(t);function s(){var r;clearTimeout(l),(r=n)==null||r.disconnect(),n=null}function a(r,o){r===void 0&&(r=!1),o===void 0&&(o=1),s();const{left:u,top:c,width:f,height:g}=t.getBoundingClientRect();if(r||e(),!f||!g)return;const h=vt(c),m=vt(i.clientWidth-(u+f)),M=vt(i.clientHeight-(c+g)),_=vt(u),C={rootMargin:-h+"px "+-m+"px "+-M+"px "+-_+"px",threshold:qe(0,Mt(1,o))||1};let F=!0;function W(L){const H=L[0].intersectionRatio;if(H!==o){if(!F)return a();H?a(!1,H):l=setTimeout(()=>{a(!1,1e-7)},100)}F=!1}try{n=new IntersectionObserver(W,{...C,root:i.ownerDocument})}catch{n=new IntersectionObserver(W,C)}n.observe(t)}return a(!0),s}function Yi(t,e,n,l){l===void 0&&(l={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:r=typeof IntersectionObserver=="function",animationFrame:o=!1}=l,u=Xt(t),c=i||s?[...u?dt(u):[],...dt(e)]:[];c.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const f=u&&r?Si(u,n):null;let g=-1,h=null;a&&(h=new ResizeObserver(y=>{let[C]=y;C&&C.target===u&&h&&(h.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var F;(F=h)==null||F.observe(e)})),n()}),u&&!o&&h.observe(u),h.observe(e));let m,M=o?Xe(t):null;o&&_();function _(){const y=Xe(t);M&&(y.x!==M.x||y.y!==M.y||y.width!==M.width||y.height!==M.height)&&n(),M=y,m=requestAnimationFrame(_)}return n(),()=>{var y;c.forEach(C=>{i&&C.removeEventListener("scroll",n),s&&C.removeEventListener("resize",n)}),f==null||f(),(y=h)==null||y.disconnect(),h=null,o&&cancelAnimationFrame(m)}}const Hi=hi,Ai=ci,Bi=(t,e,n)=>{const l=new Map,i={platform:Oi,...n},s={...i.platform,_c:l};return fi(t,e,{...i,platform:s})};function Ri(t){if((t==null?void 0:t.previousElementSibling)===null)return;const e=t==null?void 0:t.previousElementSibling,n=Yi(e,t,()=>Bi(e,t,{placement:"bottom-start",middleware:[Hi({padding:5}),Ai()]}).then(({x:l,y:i})=>{Object.assign(t.style,{left:`${l}px`,top:`${i}px`})}));return{destroy(){n()}}}function Ni(t,e,n,l,i){let s=t?Array.isArray(t)?t:t.split(","):[];s=s.map(o=>o.replace(/(:\d+):\d+/,"$1"));let a=s,r=e?Array.isArray(e)?e:[e]:a.map(o=>ct(o,n,l,i));return r&&e&&(s=r.map(o=>$e(o,n,l,i))),{valueArray:s,prevValue:a,innerDates:r}}function Vi(t,e){return t==="auto"?e.match(/g|hh?|ii?/i)&&e.match(/y|m|d/i)?"datetime":e.match(/g|hh?|ii?/i)?"time":"date":t}const Ii=t=>({isTodayDisabled:t[1]&2048,currentMode:t[0]&67108864,i18n:t[0]&16777216}),Sn=t=>({onCancel:t[49],onConfirm:t[78],onClear:t[48],onToday:t[47],isTodayDisabled:t[42],currentMode:t[26],i18n:t[24]});function Yn(t,e,n){const l=t.slice();return l[98]=e[n],l[99]=e,l[100]=n,l}const Pi=t=>({value:t[0]&1,displayValue:t[1]&1,disabled:t[0]&32,isDirty:t[1]&128}),Hn=t=>({value:t[0],displayValue:t[31],disabled:t[5],isDirty:t[38],onKeyDown:t[50],onInputFocus:t[53],onInputBlur:t[54]});function An(t){let e,n,l,i=!t[9]&&Bn(t);return{c(){e=V("input"),n=x(),i&&i.c(),l=Pe(),this.h()},l(s){e=I(s,"INPUT",{type:!0,name:!0}),n=$(s),i&&i.l(s),l=Pe(),this.h()},h(){b(e,"type","hidden"),b(e,"name",t[4]),e.value=t[0]},m(s,a){j(s,e,a),j(s,n,a),i&&i.m(s,a),j(s,l,a)},p(s,a){a[0]&16&&b(e,"name",s[4]),a[0]&1&&(e.value=s[0]),s[9]?i&&(i.d(1),i=null):i?i.p(s,a):(i=Bn(s),i.c(),i.m(l.parentNode,l))},d(s){s&&(v(e),v(n),v(l)),i&&i.d(s)}}}function Bn(t){let e,n,l,i,s,a;return{c(){e=V("input"),this.h()},l(r){e=I(r,"INPUT",{type:!0,id:!0,tabindex:!0,name:!0,placeholder:!0,autocomplete:!0,inputmode:!0,class:!0}),this.h()},h(){b(e,"type","text"),b(e,"id",t[3]),b(e,"tabindex","0"),b(e,"name",n=t[4].endsWith("]")?t[4].substring(0,t[4].length-1)+"_input]":t[4]+"_input"),e.value=t[31],b(e,"placeholder",t[6]),e.disabled=t[5],e.required=t[7],b(e,"autocomplete","off"),b(e,"inputmode","none"),b(e,"class",l=Ee(t[17])+" svelte-ergyxs"),e.readOnly=i=t[25]&&!t[11]&&!t[8],z(e,"value-dirty",!t[22]&&t[38])},m(r,o){j(r,e,o),t[74](e),s||(a=[X(e,"input",function(){zn(t[11]?t[51]:jn)&&(t[11]?t[51]:jn).apply(this,arguments)}),Jn(t[43].call(null,e,t[44])),X(e,"focus",t[53]),X(e,"blur",t[54]),X(e,"click",t[75]),X(e,"input",t[72]),X(e,"change",t[73]),X(e,"keydown",t[50])],s=!0)},p(r,o){t=r,o[0]&8&&b(e,"id",t[3]),o[0]&16&&n!==(n=t[4].endsWith("]")?t[4].substring(0,t[4].length-1)+"_input]":t[4]+"_input")&&b(e,"name",n),o[1]&1&&e.value!==t[31]&&(e.value=t[31]),o[0]&64&&b(e,"placeholder",t[6]),o[0]&32&&(e.disabled=t[5]),o[0]&128&&(e.required=t[7]),o[0]&131072&&l!==(l=Ee(t[17])+" svelte-ergyxs")&&b(e,"class",l),o[0]&33556736&&i!==(i=t[25]&&!t[11]&&!t[8])&&(e.readOnly=i),o[0]&4325376|o[1]&128&&z(e,"value-dirty",!t[22]&&t[38])},d(r){r&&v(e),t[74](null),s=!1,He(a)}}}function Li(t){let e,n=!t[1]&&An(t);return{c(){n&&n.c(),e=Pe()},l(l){n&&n.l(l),e=Pe()},m(l,i){n&&n.m(l,i),j(l,e,i)},p(l,i){l[1]?n&&(n.d(1),n=null):n?n.p(l,i):(n=An(l),n.c(),n.m(e.parentNode,e))},d(l){l&&v(e),n&&n.d(l)}}}function Rn(t){let e,n,l=[],i=new Map,s,a,r,o,u,c,f=oe(t[37]);const g=_=>_[100];for(let _=0;_{o&&(r||(r=tt(e,t[41],{duration:200},!0)),r.run(1))}),o=!0}},o(_){for(let y=0;yt[77](e,n,l),a=()=>t[77](null,n,l);let r={wid:t[100],date:t[30][t[100]],startDate:t[29],endDate:t[28],hasDateComponent:t[27]!=="time",showMeridian:t[13].match(t[14]==="php"?"a|A":"p|P")!==null,i18n:t[24],minuteIncrement:t[15],hourOnly:t[23]};return e=new ti({props:r}),s(),e.$on("hour",t[45]),e.$on("minute",t[45]),e.$on("switch",t[52]),e.$on("time-switch",t[56]),{c(){Qn(e.$$.fragment)},l(o){xn(e.$$.fragment,o)},m(o,u){$n(e,o,u),i=!0},p(o,u){(n!==o[99]||l!==o[100])&&(a(),n=o[99],l=o[100],s());const c={};u[1]&64&&(c.wid=o[100]),u[0]&1073741824|u[1]&64&&(c.date=o[30][o[100]]),u[0]&536870912&&(c.startDate=o[29]),u[0]&268435456&&(c.endDate=o[28]),u[0]&134217728&&(c.hasDateComponent=o[27]!=="time"),u[0]&24576&&(c.showMeridian=o[13].match(o[14]==="php"?"a|A":"p|P")!==null),u[0]&16777216&&(c.i18n=o[24]),u[0]&32768&&(c.minuteIncrement=o[15]),u[0]&8388608&&(c.hourOnly=o[23]),e.$set(c)},i(o){i||(le(e.$$.fragment,o),i=!0)},o(o){ue(e.$$.fragment,o),i=!1},d(o){a(),el(e,o)}}}function ji(t){var i;let e,n,l={wid:t[100],dates:t[30],isRange:t[8],startDate:t[29],endDate:t[28],enableTimeToggle:(i=t[27])==null?void 0:i.includes("time"),initialView:t[2]>2?2:t[2],hoverDate:t[32],additionalDisableFn:t[10],i18n:t[24],weekStart:t[16]};return e=new Kl({props:l}),t[76](e),e.$on("date",t[45]),e.$on("switch",t[52]),e.$on("internal_hoverUpdate",t[55]),{c(){Qn(e.$$.fragment)},l(s){xn(e.$$.fragment,s)},m(s,a){$n(e,s,a),n=!0},p(s,a){var o;const r={};a[1]&64&&(r.wid=s[100]),a[0]&1073741824&&(r.dates=s[30]),a[0]&256&&(r.isRange=s[8]),a[0]&536870912&&(r.startDate=s[29]),a[0]&268435456&&(r.endDate=s[28]),a[0]&134217728&&(r.enableTimeToggle=(o=s[27])==null?void 0:o.includes("time")),a[0]&4&&(r.initialView=s[2]>2?2:s[2]),a[1]&2&&(r.hoverDate=s[32]),a[0]&1024&&(r.additionalDisableFn=s[10]),a[0]&16777216&&(r.i18n=s[24]),a[0]&65536&&(r.weekStart=s[16]),e.$set(r)},i(s){n||(le(e.$$.fragment,s),n=!0)},o(s){ue(e.$$.fragment,s),n=!1},d(s){t[76](null),el(e,s)}}}function Nn(t,e){let n,l,i,s,a;const r=[ji,Ui],o=[];function u(c,f){return c[26]==="date"?0:1}return l=u(e),i=o[l]=r[l](e),{key:t,first:null,c(){n=V("div"),i.c(),s=x(),this.h()},l(c){n=I(c,"DIV",{class:!0});var f=R(n);i.l(f),s=$(f),f.forEach(v),this.h()},h(){b(n,"class","sdt-widget svelte-ergyxs"),this.first=n},m(c,f){j(c,n,f),o[l].m(n,null),S(n,s),a=!0},p(c,f){e=c;let g=l;l=u(e),l===g?o[l].p(e,f):(Ve(),ue(o[g],1,1,()=>{o[g]=null}),Ie(),i=o[l],i?i.p(e,f):(i=o[l]=r[l](e),i.c()),le(i,1),i.m(n,s))},i(c){a||(le(i),a=!0)},o(c){ue(i),a=!1},d(c){c&&v(n),o[l].d()}}}function Vn(t){let e,n,l=!t[36]&&In(t),i=(t[20]||t[21])&&Pn(t);return{c(){e=V("div"),l&&l.c(),n=x(),i&&i.c(),this.h()},l(s){e=I(s,"DIV",{class:!0});var a=R(e);l&&l.l(a),n=$(a),i&&i.l(a),a.forEach(v),this.h()},h(){b(e,"class","sdt-btn-row svelte-ergyxs")},m(s,a){j(s,e,a),l&&l.m(e,null),S(e,n),i&&i.m(e,null)},p(s,a){s[36]?l&&(l.d(1),l=null):l?l.p(s,a):(l=In(s),l.c(),l.m(e,n)),s[20]||s[21]?i?i.p(s,a):(i=Pn(s),i.c(),i.m(e,null)):i&&(i.d(1),i=null)},d(s){s&&v(e),l&&l.d(),i&&i.d()}}}function In(t){let e,n,l=t[24].cancelBtn+"",i,s,a,r,o=t[24].okBtn+"",u,c,f,g;return{c(){e=V("span"),n=V("button"),i=he(l),a=x(),r=V("button"),u=he(o),this.h()},l(h){e=I(h,"SPAN",{});var m=R(e);n=I(m,"BUTTON",{type:!0,class:!0});var M=R(n);i=de(M,l),M.forEach(v),a=$(m),r=I(m,"BUTTON",{type:!0,class:!0});var _=R(r);u=de(_,o),_.forEach(v),m.forEach(v),this.h()},h(){b(n,"type","button"),b(n,"class",s=Ee(t[19])+" svelte-ergyxs"),b(r,"type","button"),b(r,"class",c=Ee(t[18])+" svelte-ergyxs")},m(h,m){j(h,e,m),S(e,n),S(n,i),S(e,a),S(e,r),S(r,u),f||(g=[X(n,"click",t[49]),X(r,"click",t[79])],f=!0)},p(h,m){m[0]&16777216&&l!==(l=h[24].cancelBtn+"")&&ge(i,l),m[0]&524288&&s!==(s=Ee(h[19])+" svelte-ergyxs")&&b(n,"class",s),m[0]&16777216&&o!==(o=h[24].okBtn+"")&&ge(u,o),m[0]&262144&&c!==(c=Ee(h[18])+" svelte-ergyxs")&&b(r,"class",c)},d(h){h&&v(e),f=!1,He(g)}}}function Pn(t){let e,n,l=t[20]&&t[26]==="date"&&Ln(t),i=t[21]&&Un(t);return{c(){e=V("span"),l&&l.c(),n=x(),i&&i.c()},l(s){e=I(s,"SPAN",{});var a=R(e);l&&l.l(a),n=$(a),i&&i.l(a),a.forEach(v)},m(s,a){j(s,e,a),l&&l.m(e,null),S(e,n),i&&i.m(e,null)},p(s,a){s[20]&&s[26]==="date"?l?l.p(s,a):(l=Ln(s),l.c(),l.m(e,n)):l&&(l.d(1),l=null),s[21]?i?i.p(s,a):(i=Un(s),i.c(),i.m(e,null)):i&&(i.d(1),i=null)},d(s){s&&v(e),l&&l.d(),i&&i.d()}}}function Ln(t){let e,n=t[24].todayBtn+"",l,i,s,a;return{c(){e=V("button"),l=he(n),this.h()},l(r){e=I(r,"BUTTON",{type:!0,class:!0});var o=R(e);l=de(o,n),o.forEach(v),this.h()},h(){b(e,"type","button"),b(e,"class",i=Ee(t[18])+" svelte-ergyxs"),e.disabled=t[42]},m(r,o){j(r,e,o),S(e,l),s||(a=X(e,"click",t[47]),s=!0)},p(r,o){o[0]&16777216&&n!==(n=r[24].todayBtn+"")&&ge(l,n),o[0]&262144&&i!==(i=Ee(r[18])+" svelte-ergyxs")&&b(e,"class",i),o[1]&2048&&(e.disabled=r[42])},d(r){r&&v(e),s=!1,a()}}}function Un(t){let e,n=t[24].clearBtn+"",l,i,s,a;return{c(){e=V("button"),l=he(n),this.h()},l(r){e=I(r,"BUTTON",{type:!0,class:!0});var o=R(e);l=de(o,n),o.forEach(v),this.h()},h(){b(e,"type","button"),b(e,"class",i=Ee(t[19])+" svelte-ergyxs")},m(r,o){j(r,e,o),S(e,l),s||(a=X(e,"click",t[48]),s=!0)},p(r,o){o[0]&16777216&&n!==(n=r[24].clearBtn+"")&&ge(l,n),o[0]&524288&&i!==(i=Ee(r[19])+" svelte-ergyxs")&&b(e,"class",i)},d(r){r&&v(e),s=!1,a()}}}function zi(t){let e,n=(!t[36]||!0)&&Vn(t);return{c(){n&&n.c(),e=Pe()},l(l){n&&n.l(l),e=Pe()},m(l,i){n&&n.m(l,i),j(l,e,i)},p(l,i){l[36],n?n.p(l,i):(n=Vn(l),n.c(),n.m(e.parentNode,e))},d(l){l&&v(e),n&&n.d(l)}}}function Wi(t){let e,n,l;const i=t[70].inputs,s=Gn(i,t,t[69],Hn),a=s||Li(t);let r=t[35]&&t[25]&&Rn(t);return{c(){e=V("span"),a&&a.c(),n=x(),r&&r.c(),this.h()},l(o){e=I(o,"SPAN",{class:!0});var u=R(e);a&&a.l(u),n=$(u),r&&r.l(u),u.forEach(v),this.h()},h(){b(e,"class","std-component-wrap svelte-ergyxs")},m(o,u){j(o,e,u),a&&a.m(e,null),S(e,n),r&&r.m(e,null),l=!0},p(o,u){s?s.p&&(!l||u[0]&33|u[1]&129|u[2]&128)&&Xn(s,i,o,o[69],l?Zn(i,o[69],u,Pi):Kn(o[69]),Hn):a&&a.p&&(!l||u[0]&37882875|u[1]&149)&&a.p(o,l?u:[-1,-1,-1,-1]),o[35]&&o[25]?r?(r.p(o,u),u[0]&33554432|u[1]&16&&le(r,1)):(r=Rn(o),r.c(),le(r,1),r.m(e,null)):r&&(Ve(),ue(r,1,1,()=>{r=null}),Ie())},i(o){l||(le(a,o),le(r),l=!0)},o(o){ue(a,o),ue(r),l=!1},d(o){o&&v(e),a&&a.d(o),r&&r.d()}}}const ce=jl;function qi(t){return t?[{ref:null},{ref:null}]:[{ref:null}]}const jn=()=>{};function Gi(t,e,n){let l,i,s,a,r,o,u,c,f,g,h,m,{$$slots:M={},$$scope:_}=e,{inputId:y=""}=e,{name:C="date"}=e,{disabled:F=!1}=e,{placeholder:W=null}=e,{required:L=!1}=e,{value:H=null}=e,{initialDate:A=null}=e,{isRange:p=!1}=e,{startDate:P=null}=e,{endDate:O=null}=e,{pickerOnly:T=!1}=e,{startView:B=ke}=e,{mode:w="auto"}=e,{disableDatesFn:E=null}=e,{manualInput:N=!1}=e,{theme:Q=ce.theme}=e,{format:Z=ce.format}=e,{formatType:J=ce.formatType}=e,{displayFormat:re=ce.displayFormat}=e,{displayFormatType:Oe=ce.displayFormatType}=e,{minuteIncrement:_e=ce.minuteIncrement}=e,{weekStart:Ze=ce.weekStart}=e,{inputClasses:k=ce.inputClasses}=e,{todayBtnClasses:q=ce.todayBtnClasses}=e,{clearBtnClasses:ae=ce.clearBtnClasses}=e,{todayBtn:be=ce.todayBtn}=e,{clearBtn:pe=ce.clearBtn}=e,{clearToggle:fe=ce.clearToggle}=e,{autocommit:ie=ce.autocommit}=e,{hourOnly:me=ce.hourOnly}=e,{i18n:se=ce.i18n}=e,{validatorAction:we=null}=e,{ce_valueElement:ee=null}=e,{ce_displayElement:K=null}=e,{positionResolver:Je=Ri}=e;const D=Vt();let{valueArray:Y,prevValue:U,innerDates:G}=Ni(H,A,Z,se,J);!H&&A&&(H=p?Y:Y[0]);let ve=Z,st=T,_t=[...Y],je=rt(),Qe=pt(),Kt,Me=B===zl?"time":"date",ot=!1,Yt=K,ml=we?we.shift():()=>{},_l=we||[],bt,Ht;function bl(d,ne,te,xe,ut,ze){return!d||ne&&(te==="datetime"||ut.length!==2)?!1:xe==="minute"||te===xe||ze&&xe==="hour"}function pl(d){d.join("")!==U.join("")&&(n(30,G=d.filter(ne=>ne).map(ne=>ct(ne,Z,se,J))),U=d,je=rt(),n(31,Qe=pt()))}function yl(d){const ne=Array.isArray(d)?d.join(","):d;je!==ne&&(n(67,Y=(ne||"").split(",")),_t=Y)}function wl(d,ne){ve!==d&&G.length&&(n(67,Y=G.map(te=>$e(te,d,se,J))),U=Y,n(31,Qe=pt()),ve=d,w==="auto"&&n(27,u=d.match(/g|hh?|ii?/i)&&d.match(/y|m|d/i)?"datetime":d.match(/g|hh?|ii?/i)?"time":"date"),je=rt(),Se(!0))}function pt(){return G.sort((d,ne)=>d-ne).map(d=>$e(d,re||Z,se,Oe||J)).join(" - ")}function vl(){return p?Y.length===2?Y:null:Y[0]||null}function rt(){return Y.join(",")}function Zt(d){return d.join(",")!==_t.join(",")}function Jt(){n(2,B=ke),ot=!1,u==="datetime"?setTimeout(()=>{T||n(35,l=!1),n(26,Me="date")},ie?300:0):T||n(35,l=!1)}function kl(d,ne){d==="date"&&u==="datetime"&&(p&&Y.length===2||!p)?n(26,Me="time"):d==="hour"&&!me&&o[ne].ref.showMinuteView()}function yt({type:d,detail:ne}){let{value:te,isKeyboard:xe,dateIndex:ut}=ne;if(te&&!p&&G.length&&G[0].getFullYear()===te.getFullYear()&&G[0].getMonth()===te.getMonth()&&G[0].getDate()===te.getDate()&&u==="date"&&!L&&fe&&(te=null),p){if(d==="date")n(30,G=te?(G.length===2?[te]:G.concat(te)).map(ze=>ze.getTime()).sort().map(ze=>new Date(ze)):[]);else if(te&&ut!==void 0)n(30,G[ut]=te,G);else if(d==="datetime")n(30,G[0]=te,G),n(30,G[1]=te,G);else throw new Error(`Unhandled event type: '${d}'`);n(67,Y=G.map(ze=>$e(ze,Z,se,J)))}else n(30,G=te?[te]:[]),n(67,Y=te?[$e(te,Z,se,J)]:[]);xe||(n(68,Ht=d),kl(d,ut||0)),qn().then(()=>f&&Se(!xe))}function Se(d){n(0,H=vl()),je=rt(),_t=[...Y],n(31,Qe=pt()),n(38,m=Zt(Y)),Fl(!0),D("change",p?Y:Y[0]||null),D("dateChange",{value:p?Y:Y[0]||null,dateValue:p?G:G[0]||null,displayValue:Qe,valueFormat:Z,displayFormat:re}),d&&Jt()}function Dl(){const d=new Date,ne=G[0]||d;yt(new CustomEvent(u,{detail:{dateIndex:0,value:new Date(d.getFullYear(),d.getMonth(),d.getDate(),p?0:ne.getHours(),p?0:ne.getMinutes(),0),isKeyboard:!1}})),p&&yt(new CustomEvent(u,{detail:{dateIndex:1,value:new Date(d.getFullYear(),d.getMonth(),d.getDate(),23,59,59,999),isKeyboard:!1}})),Se(!0)}function wt(){n(67,Y=[]),U=[],n(30,G=[]),je="",ie&&Se()}function At(){n(67,Y=[..._t]),je=rt(),Jt(),D("cancel")}function Qt(d){if(l||(["Backspace","Delete"].includes(d.key)&&!L&&wt(),d.key==="Enter"&&at()),!l&&d.key!=="Tab"){n(35,l=d.key!=="Shift"),d.preventDefault();return}switch(d.key){case"PageDown":case"PageUp":case"ArrowDown":case"ArrowUp":case"ArrowLeft":case"ArrowRight":if(d.preventDefault(),p)return;Me==="date"?bt.handleGridNav(d.key,d.shiftKey):o[0].ref.makeTick(["ArrowDown","ArrowLeft","PageDown"].includes(d.key)?-1:1);break;case"Escape":ie?wt():At();break;case"Backspace":if(N&&!p)return;case"Delete":!L&&wt();break;case"Enter":if(st&&d.preventDefault(),Y.length===0){n(35,l=!1);return}if(Me==="time"&&!ot)return o[0].ref.showMinuteView();if(u==="datetime"&&Me!=="time"){n(26,Me="time");return}Se(u==="date"||u.includes("time")&&ot);break;case"Tab":l&&(n(35,l=!1),d.preventDefault());case"F5":break;default:!N&&d.preventDefault()}}function Ml(d){d.preventDefault(),d.stopPropagation();const ne=ct(d.target.value,re||Z,se,Oe||J);$e(ne,re||Z,se,Oe||J)===d.target.value&&yt(new CustomEvent("date",{detail:{value:ne,isKeyboard:!0}}))}function Tl(d){n(2,B=ke),n(26,Me=d.detail),ot=!1}function at(){n(25,st=!0),n(35,l=!0)}function xt(){n(25,st=!1),c?Se(!1):At(),!K&&D("blur")}function Fl(d){ee&&K&&(n(57,ee.value=Y.join(",")||"",ee),n(1,K.value=Qe,K),ee.dispatchEvent(new Event("input")),K.dispatchEvent(new Event("input"))),d&&D("input",je)}function El({detail:d}){n(32,Kt=d)}function Cl(d){ot=d.detail}Pl(()=>{K&&(n(1,K.onfocus=at,K),n(1,K.onblur=xt,K),n(1,K.onclick=()=>!l&&at(),K),n(1,K.onkeydown=Qt,K))});function Ol(d){Bt.call(this,t,d)}function Sl(d){Bt.call(this,t,d)}function Yl(d){Bt.call(this,t,d)}function Hl(d){kt[d?"unshift":"push"](()=>{Yt=d,n(33,Yt)})}const Al=()=>{!l&&at()};function Bl(d){kt[d?"unshift":"push"](()=>{bt=d,n(34,bt)})}function Rl(d,ne,te){kt[d?"unshift":"push"](()=>{ne[te].ref=d,n(37,o),n(8,p)})}const Nl=()=>Se(!0),Vl=()=>Se(!0);return t.$$set=d=>{"inputId"in d&&n(3,y=d.inputId),"name"in d&&n(4,C=d.name),"disabled"in d&&n(5,F=d.disabled),"placeholder"in d&&n(6,W=d.placeholder),"required"in d&&n(7,L=d.required),"value"in d&&n(0,H=d.value),"initialDate"in d&&n(58,A=d.initialDate),"isRange"in d&&n(8,p=d.isRange),"startDate"in d&&n(59,P=d.startDate),"endDate"in d&&n(60,O=d.endDate),"pickerOnly"in d&&n(9,T=d.pickerOnly),"startView"in d&&n(2,B=d.startView),"mode"in d&&n(61,w=d.mode),"disableDatesFn"in d&&n(10,E=d.disableDatesFn),"manualInput"in d&&n(11,N=d.manualInput),"theme"in d&&n(12,Q=d.theme),"format"in d&&n(13,Z=d.format),"formatType"in d&&n(14,J=d.formatType),"displayFormat"in d&&n(62,re=d.displayFormat),"displayFormatType"in d&&n(63,Oe=d.displayFormatType),"minuteIncrement"in d&&n(15,_e=d.minuteIncrement),"weekStart"in d&&n(16,Ze=d.weekStart),"inputClasses"in d&&n(17,k=d.inputClasses),"todayBtnClasses"in d&&n(18,q=d.todayBtnClasses),"clearBtnClasses"in d&&n(19,ae=d.clearBtnClasses),"todayBtn"in d&&n(20,be=d.todayBtn),"clearBtn"in d&&n(21,pe=d.clearBtn),"clearToggle"in d&&n(64,fe=d.clearToggle),"autocommit"in d&&n(22,ie=d.autocommit),"hourOnly"in d&&n(23,me=d.hourOnly),"i18n"in d&&n(24,se=d.i18n),"validatorAction"in d&&n(65,we=d.validatorAction),"ce_valueElement"in d&&n(57,ee=d.ce_valueElement),"ce_displayElement"in d&&n(1,K=d.ce_displayElement),"positionResolver"in d&&n(66,Je=d.positionResolver),"$$scope"in d&&n(69,_=d.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&512&&n(35,l=T),t.$$.dirty[0]&16801792|t.$$.dirty[1]&268435456&&n(29,i=P?ct(P,Z,se,J):null),t.$$.dirty[0]&16801792|t.$$.dirty[1]&536870912&&n(28,s=O?new Date(ct(O,Z,se,J).setSeconds(1)):null),t.$$.dirty[0]&805306368&&n(42,a=i&&i>new Date||s&&s({}):Ge),t.$$.dirty[0]&256&&n(37,o=qi(p)),t.$$.dirty[0]&8192|t.$$.dirty[1]&1073741824&&n(27,u=Vi(w,Z)),t.$$.dirty[0]&201326592&&u==="time"&&Me!==u&&n(26,Me=u),t.$$.dirty[0]&138412288&&n(36,c=ie&&(p&&u==="date"||!p)),t.$$.dirty[0]&146800896|t.$$.dirty[2]&96&&(f=bl(ie,p,u,Ht,Y,me)),t.$$.dirty[0]&33554434&&K&&n(1,K.readOnly=st,K),t.$$.dirty[0]&512&&n(40,g=!!T),t.$$.dirty[0]&512|t.$$.dirty[2]&16&&n(39,h=T?()=>{}:Je),t.$$.dirty[2]&32&&n(38,m=Zt(Y)),t.$$.dirty[0]&1&&yl(H),t.$$.dirty[2]&32&&pl(Y),t.$$.dirty[0]&8192|t.$$.dirty[2]&1&&wl(Z)},[H,K,B,y,C,F,W,L,p,T,E,N,Q,Z,J,_e,Ze,k,q,ae,be,pe,ie,me,se,st,Me,u,s,i,G,Qe,Kt,Yt,bt,l,c,o,m,h,g,r,a,ml,_l,yt,Se,Dl,wt,At,Qt,Ml,Tl,at,xt,El,Cl,ee,A,P,O,w,re,Oe,fe,we,Je,Y,Ht,_,M,Ol,Sl,Yl,Hl,Al,Bl,Rl,Nl,Vl]}class xi extends It{constructor(e){super(),Pt(this,e,Gi,Wi,Nt,{inputId:3,name:4,disabled:5,placeholder:6,required:7,value:0,initialDate:58,isRange:8,startDate:59,endDate:60,pickerOnly:9,startView:2,mode:61,disableDatesFn:10,manualInput:11,theme:12,format:13,formatType:14,displayFormat:62,displayFormatType:63,minuteIncrement:15,weekStart:16,inputClasses:17,todayBtnClasses:18,clearBtnClasses:19,todayBtn:20,clearBtn:21,clearToggle:64,autocommit:22,hourOnly:23,i18n:24,validatorAction:65,ce_valueElement:57,ce_displayElement:1,positionResolver:66},null,[-1,-1,-1,-1])}}export{xi as S}; diff --git a/docs/_app/immutable/chunks/basic-setup-BJSL5TOQ.2cc7c9c3.js b/docs/_app/immutable/chunks/basic-setup-BJSL5TOQ.ce1ca664.js similarity index 99% rename from docs/_app/immutable/chunks/basic-setup-BJSL5TOQ.2cc7c9c3.js rename to docs/_app/immutable/chunks/basic-setup-BJSL5TOQ.ce1ca664.js index 078ee01..5351f35 100644 --- a/docs/_app/immutable/chunks/basic-setup-BJSL5TOQ.2cc7c9c3.js +++ b/docs/_app/immutable/chunks/basic-setup-BJSL5TOQ.ce1ca664.js @@ -1,2 +1,2 @@ -import{closeBrackets as ge,autocompletion as xe,closeBracketsKeymap as Se,completionKeymap as ye}from"./index.614fdcfc.js";import{V as j,F as d,x,G as Me,H as be,J as ve,K as R,S as W,M as ee,O as te,Q as m,E as p,k as Ce,R as re,U as ne,m as se,W as ie,X as ke,Y as Le,Z as We,_ as Ae,$ as Fe,a0 as Ee,a1 as De,a2 as Re,a3 as qe,a4 as Pe,a5 as Te,a6 as we,a7 as Ie,a8 as Oe,a9 as $e,aa as Ke,l as _e,ab as Qe,ac as Be,ad as ze,ae as He}from"./4.4fec7683.js";import{c as h,l as Ne}from"./index.5d200881.js";const U=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class v{constructor(e,r,n=0,s=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,s),this.bufferStart=n,this.normalize=i?l=>i(U(l)):U,this.query=this.normalize(r)}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 Me(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 r=be(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=ve(e);let s=this.normalize(r);for(let i=0,a=n;;i++){let l=s.charCodeAt(i),o=this.match(l,a,this.bufferPos+this.bufferStart);if(i==s.length-1){if(o)return this.value=o,this;break}a==n&&ithis.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 r=this.matchPos<=this.to&&this.re.exec(this.curLine);if(r){let n=this.curLineStart+r.index,s=n+r[0].length;if(this.matchPos=q(this.text,s+(n==s?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=n||s.to<=r){let l=new b(r,e.sliceString(r,n));return K.set(e,l),l}if(s.from==r&&s.to==n)return s;let{text:i,from:a}=s;return a>r&&(i=e.sliceString(r,a)+i,a=r),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==e&&(this.re.lastIndex=e+1,r=this.re.exec(this.flat.text)),r){let n=this.flat.from+r.index,s=n+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this.matchPos=q(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=b.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(ae.prototype[Symbol.iterator]=oe.prototype[Symbol.iterator]=function(){return this});function Ve(t){try{return new RegExp(t,z),!0}catch{return!1}}function q(t,e){if(e>=t.length)return e;let r=t.lineAt(e),n;for(;e=56320&&n<57344;)e++;return e}function Q(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),r=h("input",{class:"cm-textfield",name:"line",value:e}),n=h("form",{class:"cm-gotoLine",onkeydown:i=>{i.keyCode==27?(i.preventDefault(),t.dispatch({effects:P.of(!1)}),t.focus()):i.keyCode==13&&(i.preventDefault(),s())},onsubmit:i=>{i.preventDefault(),s()}},h("label",t.state.phrase("Go to line"),": ",r)," ",h("button",{class:"cm-button",type:"submit"},t.state.phrase("go")));function s(){let i=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(r.value);if(!i)return;let{state:a}=t,l=a.doc.lineAt(a.selection.main.head),[,o,c,u,g]=i,F=u?+u.slice(1):0,k=c?+c:l.number;if(c&&g){let $=k/100;o&&($=$*(o=="-"?-1:1)+l.number/a.doc.lines),k=Math.round(a.doc.lines*$)}else c&&o&&(k=k*(o=="-"?-1:1)+l.number);let G=a.doc.line(Math.max(1,Math.min(a.doc.lines,k))),J=p.cursor(G.from+Math.max(0,Math.min(F,G.length)));t.dispatch({effects:[P.of(!1),x.scrollIntoView(J.from,{y:"center"})],selection:J}),t.focus()}return{dom:n}}const P=W.define(),X=re.define({create(){return!0},update(t,e){for(let r of e.effects)r.is(P)&&(t=r.value);return t},provide:t=>ne.from(t,e=>e?Q:null)}),Ge=t=>{let e=R(t,Q);if(!e){let r=[P.of(!0)];t.state.field(X,!1)==null&&r.push(W.appendConfig.of([X,Je])),t.dispatch({effects:r}),e=R(t,Q)}return e&&e.dom.querySelector("input").select(),!0},Je=x.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),Ue={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},ce=ee.define({combine(t){return te(t,Ue,{highlightWordAroundCursor:(e,r)=>e||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function Xe(t){let e=[tt,et];return t&&e.push(ce.of(t)),e}const Ye=d.mark({class:"cm-selectionMatch"}),Ze=d.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Y(t,e,r,n){return(r==0||t(e.sliceDoc(r-1,r))!=m.Word)&&(n==e.doc.length||t(e.sliceDoc(n,n+1))!=m.Word)}function je(t,e,r,n){return t(e.sliceDoc(r,r+1))==m.Word&&t(e.sliceDoc(n-1,n))==m.Word}const et=j.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(ce),{state:r}=t,n=r.selection;if(n.ranges.length>1)return d.none;let s=n.main,i,a=null;if(s.empty){if(!e.highlightWordAroundCursor)return d.none;let o=r.wordAt(s.head);if(!o)return d.none;a=r.charCategorizer(s.head),i=r.sliceDoc(o.from,o.to)}else{let o=s.to-s.from;if(o200)return d.none;if(e.wholeWords){if(i=r.sliceDoc(s.from,s.to),a=r.charCategorizer(s.head),!(Y(a,r,s.from,s.to)&&je(a,r,s.from,s.to)))return d.none}else if(i=r.sliceDoc(s.from,s.to),!i)return d.none}let l=[];for(let o of t.visibleRanges){let c=new v(r.doc,i,o.from,o.to);for(;!c.next().done;){let{from:u,to:g}=c.value;if((!a||Y(a,r,u,g))&&(s.empty&&u<=s.from&&g>=s.to?l.push(Ze.range(u,g)):(u>=s.to||g<=s.from)&&l.push(Ye.range(u,g)),l.length>e.maxMatches))return d.none}}return d.set(l)}},{decorations:t=>t.decorations}),tt=x.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),rt=({state:t,dispatch:e})=>{let{selection:r}=t,n=p.create(r.ranges.map(s=>t.wordAt(s.head)||p.cursor(s.head)),r.mainIndex);return n.eq(r)?!1:(e(t.update({selection:n})),!0)};function nt(t,e){let{main:r,ranges:n}=t.selection,s=t.wordAt(r.head),i=s&&s.from==r.from&&s.to==r.to;for(let a=!1,l=new v(t.doc,e,n[n.length-1].to);;)if(l.next(),l.done){if(a)return null;l=new v(t.doc,e,0,Math.max(0,n[n.length-1].from-1)),a=!0}else{if(a&&n.some(o=>o.from==l.value.from))continue;if(i){let o=t.wordAt(l.value.from);if(!o||o.from!=l.value.from||o.to!=l.value.to)continue}return l.value}}const st=({state:t,dispatch:e})=>{let{ranges:r}=t.selection;if(r.some(i=>i.from===i.to))return rt({state:t,dispatch:e});let n=t.sliceDoc(r[0].from,r[0].to);if(t.selection.ranges.some(i=>t.sliceDoc(i.from,i.to)!=n))return!1;let s=nt(t,n);return s?(e(t.update({selection:t.selection.addRange(p.range(s.from,s.to),!1),effects:x.scrollIntoView(s.to)})),!0):!1},C=ee.define({combine(t){return te(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new gt(e),scrollToMatch:e=>x.scrollIntoView(e)})}});class he{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||Ve(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(r,n)=>n=="n"?` +import{closeBrackets as ge,autocompletion as xe,closeBracketsKeymap as Se,completionKeymap as ye}from"./index.f7bb3215.js";import{V as j,F as d,x,G as Me,H as be,J as ve,K as R,S as W,M as ee,O as te,Q as m,E as p,k as Ce,R as re,U as ne,m as se,W as ie,X as ke,Y as Le,Z as We,_ as Ae,$ as Fe,a0 as Ee,a1 as De,a2 as Re,a3 as qe,a4 as Pe,a5 as Te,a6 as we,a7 as Ie,a8 as Oe,a9 as $e,aa as Ke,l as _e,ab as Qe,ac as Be,ad as ze,ae as He}from"./4.d3e95b29.js";import{c as h,l as Ne}from"./index.1eeec0a0.js";const U=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class v{constructor(e,r,n=0,s=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,s),this.bufferStart=n,this.normalize=i?l=>i(U(l)):U,this.query=this.normalize(r)}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 Me(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 r=be(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=ve(e);let s=this.normalize(r);for(let i=0,a=n;;i++){let l=s.charCodeAt(i),o=this.match(l,a,this.bufferPos+this.bufferStart);if(i==s.length-1){if(o)return this.value=o,this;break}a==n&&ithis.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 r=this.matchPos<=this.to&&this.re.exec(this.curLine);if(r){let n=this.curLineStart+r.index,s=n+r[0].length;if(this.matchPos=q(this.text,s+(n==s?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=n||s.to<=r){let l=new b(r,e.sliceString(r,n));return K.set(e,l),l}if(s.from==r&&s.to==n)return s;let{text:i,from:a}=s;return a>r&&(i=e.sliceString(r,a)+i,a=r),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==e&&(this.re.lastIndex=e+1,r=this.re.exec(this.flat.text)),r){let n=this.flat.from+r.index,s=n+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this.matchPos=q(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=b.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(ae.prototype[Symbol.iterator]=oe.prototype[Symbol.iterator]=function(){return this});function Ve(t){try{return new RegExp(t,z),!0}catch{return!1}}function q(t,e){if(e>=t.length)return e;let r=t.lineAt(e),n;for(;e=56320&&n<57344;)e++;return e}function Q(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),r=h("input",{class:"cm-textfield",name:"line",value:e}),n=h("form",{class:"cm-gotoLine",onkeydown:i=>{i.keyCode==27?(i.preventDefault(),t.dispatch({effects:P.of(!1)}),t.focus()):i.keyCode==13&&(i.preventDefault(),s())},onsubmit:i=>{i.preventDefault(),s()}},h("label",t.state.phrase("Go to line"),": ",r)," ",h("button",{class:"cm-button",type:"submit"},t.state.phrase("go")));function s(){let i=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(r.value);if(!i)return;let{state:a}=t,l=a.doc.lineAt(a.selection.main.head),[,o,c,u,g]=i,F=u?+u.slice(1):0,k=c?+c:l.number;if(c&&g){let $=k/100;o&&($=$*(o=="-"?-1:1)+l.number/a.doc.lines),k=Math.round(a.doc.lines*$)}else c&&o&&(k=k*(o=="-"?-1:1)+l.number);let G=a.doc.line(Math.max(1,Math.min(a.doc.lines,k))),J=p.cursor(G.from+Math.max(0,Math.min(F,G.length)));t.dispatch({effects:[P.of(!1),x.scrollIntoView(J.from,{y:"center"})],selection:J}),t.focus()}return{dom:n}}const P=W.define(),X=re.define({create(){return!0},update(t,e){for(let r of e.effects)r.is(P)&&(t=r.value);return t},provide:t=>ne.from(t,e=>e?Q:null)}),Ge=t=>{let e=R(t,Q);if(!e){let r=[P.of(!0)];t.state.field(X,!1)==null&&r.push(W.appendConfig.of([X,Je])),t.dispatch({effects:r}),e=R(t,Q)}return e&&e.dom.querySelector("input").select(),!0},Je=x.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),Ue={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},ce=ee.define({combine(t){return te(t,Ue,{highlightWordAroundCursor:(e,r)=>e||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function Xe(t){let e=[tt,et];return t&&e.push(ce.of(t)),e}const Ye=d.mark({class:"cm-selectionMatch"}),Ze=d.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Y(t,e,r,n){return(r==0||t(e.sliceDoc(r-1,r))!=m.Word)&&(n==e.doc.length||t(e.sliceDoc(n,n+1))!=m.Word)}function je(t,e,r,n){return t(e.sliceDoc(r,r+1))==m.Word&&t(e.sliceDoc(n-1,n))==m.Word}const et=j.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(ce),{state:r}=t,n=r.selection;if(n.ranges.length>1)return d.none;let s=n.main,i,a=null;if(s.empty){if(!e.highlightWordAroundCursor)return d.none;let o=r.wordAt(s.head);if(!o)return d.none;a=r.charCategorizer(s.head),i=r.sliceDoc(o.from,o.to)}else{let o=s.to-s.from;if(o200)return d.none;if(e.wholeWords){if(i=r.sliceDoc(s.from,s.to),a=r.charCategorizer(s.head),!(Y(a,r,s.from,s.to)&&je(a,r,s.from,s.to)))return d.none}else if(i=r.sliceDoc(s.from,s.to),!i)return d.none}let l=[];for(let o of t.visibleRanges){let c=new v(r.doc,i,o.from,o.to);for(;!c.next().done;){let{from:u,to:g}=c.value;if((!a||Y(a,r,u,g))&&(s.empty&&u<=s.from&&g>=s.to?l.push(Ze.range(u,g)):(u>=s.to||g<=s.from)&&l.push(Ye.range(u,g)),l.length>e.maxMatches))return d.none}}return d.set(l)}},{decorations:t=>t.decorations}),tt=x.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),rt=({state:t,dispatch:e})=>{let{selection:r}=t,n=p.create(r.ranges.map(s=>t.wordAt(s.head)||p.cursor(s.head)),r.mainIndex);return n.eq(r)?!1:(e(t.update({selection:n})),!0)};function nt(t,e){let{main:r,ranges:n}=t.selection,s=t.wordAt(r.head),i=s&&s.from==r.from&&s.to==r.to;for(let a=!1,l=new v(t.doc,e,n[n.length-1].to);;)if(l.next(),l.done){if(a)return null;l=new v(t.doc,e,0,Math.max(0,n[n.length-1].from-1)),a=!0}else{if(a&&n.some(o=>o.from==l.value.from))continue;if(i){let o=t.wordAt(l.value.from);if(!o||o.from!=l.value.from||o.to!=l.value.to)continue}return l.value}}const st=({state:t,dispatch:e})=>{let{ranges:r}=t.selection;if(r.some(i=>i.from===i.to))return rt({state:t,dispatch:e});let n=t.sliceDoc(r[0].from,r[0].to);if(t.selection.ranges.some(i=>t.sliceDoc(i.from,i.to)!=n))return!1;let s=nt(t,n);return s?(e(t.update({selection:t.selection.addRange(p.range(s.from,s.to),!1),effects:x.scrollIntoView(s.to)})),!0):!1},C=ee.define({combine(t){return te(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new gt(e),scrollToMatch:e=>x.scrollIntoView(e)})}});class he{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||Ve(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(r,n)=>n=="n"?` `:n=="r"?"\r":n=="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 ot(this):new lt(this)}getCursor(e,r=0,n){let s=e.doc?e:se.create({doc:e});return n==null&&(n=s.doc.length),this.regexp?M(this,s,r,n):y(this,s,r,n)}}class ue{constructor(e){this.spec=e}}function y(t,e,r,n){return new v(e.doc,t.unquoted,r,n,t.caseSensitive?void 0:s=>s.toLowerCase(),t.wholeWord?it(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function it(t,e){return(r,n,s,i)=>((i>r||i+s.length=r)return null;s.push(n.value)}return s}highlight(e,r,n,s){let i=y(this.spec,e,Math.max(0,r-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)s(i.value.from,i.value.to)}}function M(t,e,r,n){return new ae(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?at(e.charCategorizer(e.selection.main.head)):void 0},r,n)}function T(t,e){return t.slice(ie(t,e,!1),e)}function w(t,e){return t.slice(e,ie(t,e))}function at(t){return(e,r,n)=>!n[0].length||(t(T(n.input,n.index))!=m.Word||t(w(n.input,n.index))!=m.Word)&&(t(w(n.input,n.index+n[0].length))!=m.Word||t(T(n.input,n.index+n[0].length))!=m.Word)}class ot extends ue{nextMatch(e,r,n){let s=M(this.spec,e,n,e.doc.length).next();return s.done&&(s=M(this.spec,e,0,r).next()),s.done?null:s.value}prevMatchInRange(e,r,n){for(let s=1;;s++){let i=Math.max(r,n-s*1e4),a=M(this.spec,e,i,n),l=null;for(;!a.next().done;)l=a.value;if(l&&(i==r||l.from>i+10))return l;if(i==r)return null}}prevMatch(e,r,n){return this.prevMatchInRange(e,0,r)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(r,n)=>n=="$"?"$":n=="&"?e.match[0]:n!="0"&&+n=r)return null;s.push(n.value)}return s}highlight(e,r,n,s){let i=M(this.spec,e,Math.max(0,r-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)s(i.value.from,i.value.to)}}const L=W.define(),H=W.define(),S=re.define({create(t){return new _(B(t).create(),null)},update(t,e){for(let r of e.effects)r.is(L)?t=new _(r.value.create(),t.panel):r.is(H)&&(t=new _(t.query,r.value?N:null));return t},provide:t=>ne.from(t,e=>e.panel)});class _{constructor(e,r){this.query=e,this.panel=r}}const ct=d.mark({class:"cm-searchMatch"}),ht=d.mark({class:"cm-searchMatch cm-searchMatch-selected"}),ut=j.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(S))}update(t){let e=t.state.field(S);(e!=t.startState.field(S)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return d.none;let{view:r}=this,n=new ke;for(let s=0,i=r.visibleRanges,a=i.length;si[s+1].from-2*250;)o=i[++s].to;t.highlight(r.state,l,o,(c,u)=>{let g=r.state.selection.ranges.some(F=>F.from==c&&F.to==u);n.add(c,u,g?ht:ct)})}return n.finish()}},{decorations:t=>t.decorations});function A(t){return e=>{let r=e.state.field(S,!1);return r&&r.query.spec.valid?t(e,r):me(e)}}const I=A((t,{query:e})=>{let{to:r}=t.state.selection.main,n=e.nextMatch(t.state,r,r);if(!n)return!1;let s=p.single(n.from,n.to),i=t.state.facet(C);return t.dispatch({selection:s,effects:[V(t,n),i.scrollToMatch(s.main,t)],userEvent:"select.search"}),de(t),!0}),O=A((t,{query:e})=>{let{state:r}=t,{from:n}=r.selection.main,s=e.prevMatch(r,n,n);if(!s)return!1;let i=p.single(s.from,s.to),a=t.state.facet(C);return t.dispatch({selection:i,effects:[V(t,s),a.scrollToMatch(i.main,t)],userEvent:"select.search"}),de(t),!0}),ft=A((t,{query:e})=>{let r=e.matchAll(t.state,1e3);return!r||!r.length?!1:(t.dispatch({selection:p.create(r.map(n=>p.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),dt=({state:t,dispatch:e})=>{let r=t.selection;if(r.ranges.length>1||r.main.empty)return!1;let{from:n,to:s}=r.main,i=[],a=0;for(let l=new v(t.doc,t.sliceDoc(n,s));!l.next().done;){if(i.length>1e3)return!1;l.value.from==n&&(a=i.length),i.push(p.range(l.value.from,l.value.to))}return e(t.update({selection:p.create(i,a),userEvent:"select.search.matches"})),!0},Z=A((t,{query:e})=>{let{state:r}=t,{from:n,to:s}=r.selection.main;if(r.readOnly)return!1;let i=e.nextMatch(r,n,n);if(!i)return!1;let a=[],l,o,c=[];if(i.from==n&&i.to==s&&(o=r.toText(e.getReplacement(i)),a.push({from:i.from,to:i.to,insert:o}),i=e.nextMatch(r,i.from,i.to),c.push(x.announce.of(r.phrase("replaced match on line $",r.doc.lineAt(n).number)+"."))),i){let u=a.length==0||a[0].from>=i.to?0:i.to-i.from-o.length;l=p.single(i.from-u,i.to-u),c.push(V(t,i)),c.push(r.facet(C).scrollToMatch(l.main,t))}return t.dispatch({changes:a,selection:l,effects:c,userEvent:"input.replace"}),!0}),mt=A((t,{query:e})=>{if(t.state.readOnly)return!1;let r=e.matchAll(t.state,1e9).map(s=>{let{from:i,to:a}=s;return{from:i,to:a,insert:e.getReplacement(s)}});if(!r.length)return!1;let n=t.state.phrase("replaced $ matches",r.length)+".";return t.dispatch({changes:r,effects:x.announce.of(n),userEvent:"input.replace.all"}),!0});function N(t){return t.state.facet(C).createPanel(t)}function B(t,e){var r,n,s,i,a;let l=t.selection.main,o=l.empty||l.to>l.from+100?"":t.sliceDoc(l.from,l.to);if(e&&!o)return e;let c=t.facet(C);return new he({search:((r=e==null?void 0:e.literal)!==null&&r!==void 0?r:c.literal)?o:o.replace(/\n/g,"\\n"),caseSensitive:(n=e==null?void 0:e.caseSensitive)!==null&&n!==void 0?n:c.caseSensitive,literal:(s=e==null?void 0:e.literal)!==null&&s!==void 0?s:c.literal,regexp:(i=e==null?void 0:e.regexp)!==null&&i!==void 0?i:c.regexp,wholeWord:(a=e==null?void 0:e.wholeWord)!==null&&a!==void 0?a:c.wholeWord})}function fe(t){let e=R(t,N);return e&&e.dom.querySelector("[main-field]")}function de(t){let e=fe(t);e&&e==t.root.activeElement&&e.select()}const me=t=>{let e=t.state.field(S,!1);if(e&&e.panel){let r=fe(t);if(r&&r!=t.root.activeElement){let n=B(t.state,e.query.spec);n.valid&&t.dispatch({effects:L.of(n)}),r.focus(),r.select()}}else t.dispatch({effects:[H.of(!0),e?L.of(B(t.state,e.query.spec)):W.appendConfig.of(St)]});return!0},pe=t=>{let e=t.state.field(S,!1);if(!e||!e.panel)return!1;let r=R(t,N);return r&&r.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:H.of(!1)}),!0},pt=[{key:"Mod-f",run:me,scope:"editor search-panel"},{key:"F3",run:I,shift:O,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:I,shift:O,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:pe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:dt},{key:"Mod-Alt-g",run:Ge},{key:"Mod-d",run:st,preventDefault:!0}];class gt{constructor(e){this.view=e;let r=this.query=e.state.field(S).query.spec;this.commit=this.commit.bind(this),this.searchField=h("input",{value:r.search,placeholder:f(e,"Find"),"aria-label":f(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=h("input",{value:r.replace,placeholder:f(e,"Replace"),"aria-label":f(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=h("input",{type:"checkbox",name:"case",form:"",checked:r.caseSensitive,onchange:this.commit}),this.reField=h("input",{type:"checkbox",name:"re",form:"",checked:r.regexp,onchange:this.commit}),this.wordField=h("input",{type:"checkbox",name:"word",form:"",checked:r.wholeWord,onchange:this.commit});function n(s,i,a){return h("button",{class:"cm-button",name:s,onclick:i,type:"button"},a)}this.dom=h("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,n("next",()=>I(e),[f(e,"next")]),n("prev",()=>O(e),[f(e,"previous")]),n("select",()=>ft(e),[f(e,"all")]),h("label",null,[this.caseField,f(e,"match case")]),h("label",null,[this.reField,f(e,"regexp")]),h("label",null,[this.wordField,f(e,"by word")]),...e.state.readOnly?[]:[h("br"),this.replaceField,n("replace",()=>Z(e),[f(e,"replace")]),n("replaceAll",()=>mt(e),[f(e,"replace all")])],h("button",{name:"close",onclick:()=>pe(e),"aria-label":f(e,"close"),type:"button"},["×"])])}commit(){let e=new he({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:L.of(e)}))}keydown(e){Le(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?O:I)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Z(this.view))}update(e){for(let r of e.transactions)for(let n of r.effects)n.is(L)&&!n.value.eq(this.query)&&this.setQuery(n.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(C).top}}function f(t,e){return t.state.phrase(e)}const E=30,D=/[\s\.,:;?!]/;function V(t,{from:e,to:r}){let n=t.state.doc.lineAt(e),s=t.state.doc.lineAt(r).to,i=Math.max(n.from,e-E),a=Math.min(s,r+E),l=t.state.sliceDoc(i,a);if(i!=n.from){for(let o=0;ol.length-E;o--)if(!D.test(l[o-1])&&D.test(l[o])){l=l.slice(0,o);break}}return x.announce.of(`${t.state.phrase("current match")}. ${l} ${t.state.phrase("on line")} ${n.number}.`)}const xt=x.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"}}),St=[S,Ce.low(ut),xt];var vt=t=>[We(),Ae(),Fe(),Ee(),De(),Re(),qe(),Pe(),Te(we,{fallback:!0}),Ie(),ge(),se.allowMultipleSelections.of(!0),t.autocomplete!==!1?xe():[],Oe(),$e(),Ke(),Xe(),_e.of([].concat(Se,Qe,pt,Be,ze,ye,Ne,t.useTabs?[He]:[]))];export{vt as default}; diff --git a/docs/_app/immutable/chunks/data.2bee4aae.js b/docs/_app/immutable/chunks/data.58f39500.js similarity index 87% rename from docs/_app/immutable/chunks/data.2bee4aae.js rename to docs/_app/immutable/chunks/data.58f39500.js index 9129632..6631412 100644 --- a/docs/_app/immutable/chunks/data.2bee4aae.js +++ b/docs/_app/immutable/chunks/data.58f39500.js @@ -1,40 +1,40 @@ -import{X as Rr,Y as dg,Z as pt,_ as dh}from"./scheduler.8d4e2d99.js";function Sr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function fh(e,r){for(var t="",a=0,n=-1,i=0,o,u=0;u<=e.length;++u){if(u2){var s=t.lastIndexOf("/");if(s!==t.length-1){s===-1?(t="",a=0):(t=t.slice(0,s),a=t.length-1-t.lastIndexOf("/")),n=u,i=0;continue}}else if(t.length===2||t.length===1){t="",a=0,n=u,i=0;continue}}r&&(t.length>0?t+="/..":t="..",a=2)}else t.length>0?t+="/"+e.slice(n+1,u):t=e.slice(n+1,u),a=u-n-1;n=u,i=0}else o===46&&i!==-1?++i:i=-1}return t}function wie(e,r){var t=r.dir||r.root,a=r.base||(r.name||"")+(r.ext||"");return t?t===r.root?t+a:t+e+a:a}var Zt={resolve:function(){for(var r="",t=!1,a,n=arguments.length-1;n>=-1&&!t;n--){var i;n>=0?i=arguments[n]:(a===void 0&&(a=Rr.cwd()),i=a),Sr(i),i.length!==0&&(r=i+"/"+r,t=i.charCodeAt(0)===47)}return r=fh(r,!t),t?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(r){if(Sr(r),r.length===0)return".";var t=r.charCodeAt(0)===47,a=r.charCodeAt(r.length-1)===47;return r=fh(r,!t),r.length===0&&!t&&(r="."),r.length>0&&a&&(r+="/"),t?"/"+r:r},isAbsolute:function(r){return Sr(r),r.length>0&&r.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var r,t=0;t0&&(r===void 0?r=a:r+="/"+a)}return r===void 0?".":Zt.normalize(r)},relative:function(r,t){if(Sr(r),Sr(t),r===t||(r=Zt.resolve(r),t=Zt.resolve(t),r===t))return"";for(var a=1;al){if(t.charCodeAt(o+p)===47)return t.slice(o+p+1);if(p===0)return t.slice(o+p)}else i>l&&(r.charCodeAt(a+p)===47?c=p:p===0&&(c=0));break}var f=r.charCodeAt(a+p),C=t.charCodeAt(o+p);if(f!==C)break;f===47&&(c=p)}var y="";for(p=a+c+1;p<=n;++p)(p===n||r.charCodeAt(p)===47)&&(y.length===0?y+="..":y+="/..");return y.length>0?y+t.slice(o+c):(o+=c,t.charCodeAt(o)===47&&++o,t.slice(o))},_makeLong:function(r){return r},dirname:function(r){if(Sr(r),r.length===0)return".";for(var t=r.charCodeAt(0),a=t===47,n=-1,i=!0,o=r.length-1;o>=1;--o)if(t=r.charCodeAt(o),t===47){if(!i){n=o;break}}else i=!1;return n===-1?a?"/":".":a&&n===1?"//":r.slice(0,n)},basename:function(r,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Sr(r);var a=0,n=-1,i=!0,o;if(t!==void 0&&t.length>0&&t.length<=r.length){if(t.length===r.length&&t===r)return"";var u=t.length-1,s=-1;for(o=r.length-1;o>=0;--o){var l=r.charCodeAt(o);if(l===47){if(!i){a=o+1;break}}else s===-1&&(i=!1,s=o+1),u>=0&&(l===t.charCodeAt(u)?--u===-1&&(n=o):(u=-1,n=s))}return a===n?n=s:n===-1&&(n=r.length),r.slice(a,n)}else{for(o=r.length-1;o>=0;--o)if(r.charCodeAt(o)===47){if(!i){a=o+1;break}}else n===-1&&(i=!1,n=o+1);return n===-1?"":r.slice(a,n)}},extname:function(r){Sr(r);for(var t=-1,a=0,n=-1,i=!0,o=0,u=r.length-1;u>=0;--u){var s=r.charCodeAt(u);if(s===47){if(!i){a=u+1;break}continue}n===-1&&(i=!1,n=u+1),s===46?t===-1?t=u:o!==1&&(o=1):t!==-1&&(o=-1)}return t===-1||n===-1||o===0||o===1&&t===n-1&&t===a+1?"":r.slice(t,n)},format:function(r){if(r===null||typeof r!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof r);return wie("/",r)},parse:function(r){Sr(r);var t={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return t;var a=r.charCodeAt(0),n=a===47,i;n?(t.root="/",i=1):i=0;for(var o=-1,u=0,s=-1,l=!0,c=r.length-1,p=0;c>=i;--c){if(a=r.charCodeAt(c),a===47){if(!l){u=c+1;break}continue}s===-1&&(l=!1,s=c+1),a===46?o===-1?o=c:p!==1&&(p=1):o!==-1&&(p=-1)}return o===-1||s===-1||p===0||p===1&&o===s-1&&o===u+1?s!==-1&&(u===0&&n?t.base=t.name=r.slice(1,s):t.base=t.name=r.slice(u,s)):(u===0&&n?(t.name=r.slice(1,o),t.base=r.slice(1,s)):(t.name=r.slice(u,o),t.base=r.slice(u,s)),t.ext=r.slice(o,s)),u>0?t.dir=r.slice(0,u-1):n&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};Zt.posix=Zt;var Cie=Zt;const nr=dg(Cie);var kie=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],fg=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],Aie="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",hg="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Nc={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},jc="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",_ie={5:jc,"5module":jc+" export import",6:jc+" const class extends export import super"},Die=/^in(stanceof)?$/,Eie=new RegExp("["+hg+"]"),Sie=new RegExp("["+hg+Aie+"]");function id(e,r){for(var t=65536,a=0;ae)return!1;if(t+=r[a+1],t>=e)return!0}return!1}function Wr(e,r){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Eie.test(String.fromCharCode(e)):r===!1?!1:id(e,fg)}function na(e,r){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Sie.test(String.fromCharCode(e)):r===!1?!1:id(e,fg)||id(e,kie)}var ve=function(r,t){t===void 0&&(t={}),this.label=r,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function lr(e,r){return new ve(e,{beforeExpr:!0,binop:r})}var ur={beforeExpr:!0},Xe={startsExpr:!0},Zd={};function ce(e,r){return r===void 0&&(r={}),r.keyword=e,Zd[e]=new ve(e,r)}var d={num:new ve("num",Xe),regexp:new ve("regexp",Xe),string:new ve("string",Xe),name:new ve("name",Xe),privateId:new ve("privateId",Xe),eof:new ve("eof"),bracketL:new ve("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new ve("]"),braceL:new ve("{",{beforeExpr:!0,startsExpr:!0}),braceR:new ve("}"),parenL:new ve("(",{beforeExpr:!0,startsExpr:!0}),parenR:new ve(")"),comma:new ve(",",ur),semi:new ve(";",ur),colon:new ve(":",ur),dot:new ve("."),question:new ve("?",ur),questionDot:new ve("?."),arrow:new ve("=>",ur),template:new ve("template"),invalidTemplate:new ve("invalidTemplate"),ellipsis:new ve("...",ur),backQuote:new ve("`",Xe),dollarBraceL:new ve("${",{beforeExpr:!0,startsExpr:!0}),eq:new ve("=",{beforeExpr:!0,isAssign:!0}),assign:new ve("_=",{beforeExpr:!0,isAssign:!0}),incDec:new ve("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new ve("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:lr("||",1),logicalAND:lr("&&",2),bitwiseOR:lr("|",3),bitwiseXOR:lr("^",4),bitwiseAND:lr("&",5),equality:lr("==/!=/===/!==",6),relational:lr("/<=/>=",7),bitShift:lr("<>/>>>",8),plusMin:new ve("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:lr("%",10),star:lr("*",10),slash:lr("/",10),starstar:new ve("**",{beforeExpr:!0}),coalesce:lr("??",1),_break:ce("break"),_case:ce("case",ur),_catch:ce("catch"),_continue:ce("continue"),_debugger:ce("debugger"),_default:ce("default",ur),_do:ce("do",{isLoop:!0,beforeExpr:!0}),_else:ce("else",ur),_finally:ce("finally"),_for:ce("for",{isLoop:!0}),_function:ce("function",Xe),_if:ce("if"),_return:ce("return",ur),_switch:ce("switch"),_throw:ce("throw",ur),_try:ce("try"),_var:ce("var"),_const:ce("const"),_while:ce("while",{isLoop:!0}),_with:ce("with"),_new:ce("new",{beforeExpr:!0,startsExpr:!0}),_this:ce("this",Xe),_super:ce("super",Xe),_class:ce("class",Xe),_extends:ce("extends",ur),_export:ce("export"),_import:ce("import",Xe),_null:ce("null",Xe),_true:ce("true",Xe),_false:ce("false",Xe),_in:ce("in",{beforeExpr:!0,binop:7}),_instanceof:ce("instanceof",{beforeExpr:!0,binop:7}),_typeof:ce("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:ce("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:ce("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},yr=/\r\n?|\n|\u2028|\u2029/,Rie=new RegExp(yr.source,"g");function ca(e){return e===10||e===13||e===8232||e===8233}function vg(e,r,t){t===void 0&&(t=e.length);for(var a=r;a>10)+55296,(e&1023)+56320))}var $ie=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Na=function(r,t){this.line=r,this.column=t};Na.prototype.offset=function(r){return new Na(this.line,this.column+r)};var ui=function(r,t,a){this.start=t,this.end=a,r.sourceFile!==null&&(this.source=r.sourceFile)};function bg(e,r){for(var t=1,a=0;;){var n=vg(e,a,r);if(n<0)return new Na(t,r-a);++t,a=n}}var od={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},mh=!1;function Fie(e){var r={};for(var t in od)r[t]=e&&Qa(e,t)?e[t]:od[t];if(r.ecmaVersion==="latest"?r.ecmaVersion=1e8:r.ecmaVersion==null?(!mh&&typeof console=="object"&&console.warn&&(mh=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required. -Defaulting to 2020, but this will stop working in the future.`)),r.ecmaVersion=11):r.ecmaVersion>=2015&&(r.ecmaVersion-=2009),r.allowReserved==null&&(r.allowReserved=r.ecmaVersion<5),(!e||e.allowHashBang==null)&&(r.allowHashBang=r.ecmaVersion>=14),hh(r.onToken)){var a=r.onToken;r.onToken=function(n){return a.push(n)}}return hh(r.onComment)&&(r.onComment=Oie(r,r.onComment)),r}function Oie(e,r){return function(t,a,n,i,o,u){var s={type:t?"Block":"Line",value:a,start:n,end:i};e.locations&&(s.loc=new ui(this,o,u)),e.ranges&&(s.range=[n,i]),r.push(s)}}var ja=1,pa=2,ef=4,yg=8,xg=16,wg=32,rf=64,Cg=128,Ka=256,tf=ja|pa|Ka;function af(e,r){return pa|(e?ef:0)|(r?yg:0)}var Vn=0,nf=1,Kr=2,kg=3,Ag=4,_g=5,Oe=function(r,t,a){this.options=r=Fie(r),this.sourceFile=r.sourceFile,this.keywords=at(_ie[r.ecmaVersion>=6?6:r.sourceType==="module"?"5module":5]);var n="";r.allowReserved!==!0&&(n=Nc[r.ecmaVersion>=6?6:r.ecmaVersion===5?5:3],r.sourceType==="module"&&(n+=" await")),this.reservedWords=at(n);var i=(n?n+" ":"")+Nc.strict;this.reservedWordsStrict=at(i),this.reservedWordsStrictBind=at(i+" "+Nc.strictBind),this.input=String(t),this.containsEsc=!1,a?(this.pos=a,this.lineStart=this.input.lastIndexOf(` -`,a-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(yr).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=d.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=r.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&r.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(ja),this.regexpState=null,this.privateNameStack=[]},Br={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};Oe.prototype.parse=function(){var r=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(r)};Br.inFunction.get=function(){return(this.currentVarScope().flags&pa)>0};Br.inGenerator.get=function(){return(this.currentVarScope().flags&yg)>0&&!this.currentVarScope().inClassFieldInit};Br.inAsync.get=function(){return(this.currentVarScope().flags&ef)>0&&!this.currentVarScope().inClassFieldInit};Br.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var r=this.scopeStack[e];if(r.inClassFieldInit||r.flags&Ka)return!1;if(r.flags&pa)return(r.flags&ef)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Br.allowSuper.get=function(){var e=this.currentThisScope(),r=e.flags,t=e.inClassFieldInit;return(r&rf)>0||t||this.options.allowSuperOutsideMethod};Br.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Cg)>0};Br.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Br.allowNewDotTarget.get=function(){var e=this.currentThisScope(),r=e.flags,t=e.inClassFieldInit;return(r&(pa|Ka))>0||t};Br.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Ka)>0};Oe.extend=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];for(var a=this,n=0;n=,?^&]/.test(n)||n==="!"&&this.input.charAt(a+1)==="=")}e+=r[0].length,hr.lastIndex=e,e+=hr.exec(this.input)[0].length,this.input[e]===";"&&e++}};Ye.eat=function(e){return this.type===e?(this.next(),!0):!1};Ye.isContextual=function(e){return this.type===d.name&&this.value===e&&!this.containsEsc};Ye.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};Ye.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};Ye.canInsertSemicolon=function(){return this.type===d.eof||this.type===d.braceR||yr.test(this.input.slice(this.lastTokEnd,this.start))};Ye.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};Ye.semicolon=function(){!this.eat(d.semi)&&!this.insertSemicolon()&&this.unexpected()};Ye.afterTrailingComma=function(e,r){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),r||this.next(),!0};Ye.expect=function(e){this.eat(e)||this.unexpected()};Ye.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var ci=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Ye.checkPatternErrors=function(e,r){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var t=r?e.parenthesizedAssign:e.parenthesizedBind;t>-1&&this.raiseRecoverable(t,r?"Assigning to rvalue":"Parenthesized pattern")}};Ye.checkExpressionErrors=function(e,r){if(!e)return!1;var t=e.shorthandAssign,a=e.doubleProto;if(!r)return t>=0||a>=0;t>=0&&this.raise(t,"Shorthand property assignments are valid only in destructuring patterns"),a>=0&&this.raiseRecoverable(a,"Redefinition of __proto__ property")};Ye.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&a<56320)return!0;if(Wr(a,!0)){for(var n=t+1;na(a=this.input.charCodeAt(n),!0);)++n;if(a===92||a>55295&&a<56320)return!0;var i=this.input.slice(t,n);if(!Die.test(i))return!0}return!1};H.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;hr.lastIndex=this.pos;var e=hr.exec(this.input),r=this.pos+e[0].length,t;return!yr.test(this.input.slice(this.pos,r))&&this.input.slice(r,r+8)==="function"&&(r+8===this.input.length||!(na(t=this.input.charCodeAt(r+8))||t>55295&&t<56320))};H.parseStatement=function(e,r,t){var a=this.type,n=this.startNode(),i;switch(this.isLet(e)&&(a=d._var,i="let"),a){case d._break:case d._continue:return this.parseBreakContinueStatement(n,a.keyword);case d._debugger:return this.parseDebuggerStatement(n);case d._do:return this.parseDoStatement(n);case d._for:return this.parseForStatement(n);case d._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(n,!1,!e);case d._class:return e&&this.unexpected(),this.parseClass(n,!0);case d._if:return this.parseIfStatement(n);case d._return:return this.parseReturnStatement(n);case d._switch:return this.parseSwitchStatement(n);case d._throw:return this.parseThrowStatement(n);case d._try:return this.parseTryStatement(n);case d._const:case d._var:return i=i||this.value,e&&i!=="var"&&this.unexpected(),this.parseVarStatement(n,i);case d._while:return this.parseWhileStatement(n);case d._with:return this.parseWithStatement(n);case d.braceL:return this.parseBlock(!0,n);case d.semi:return this.parseEmptyStatement(n);case d._export:case d._import:if(this.options.ecmaVersion>10&&a===d._import){hr.lastIndex=this.pos;var o=hr.exec(this.input),u=this.pos+o[0].length,s=this.input.charCodeAt(u);if(s===40||s===46)return this.parseExpressionStatement(n,this.parseExpression())}return this.options.allowImportExportEverywhere||(r||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),a===d._import?this.parseImport(n):this.parseExport(n,t);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(n,!0,!e);var l=this.value,c=this.parseExpression();return a===d.name&&c.type==="Identifier"&&this.eat(d.colon)?this.parseLabeledStatement(n,l,c,e):this.parseExpressionStatement(n,c)}};H.parseBreakContinueStatement=function(e,r){var t=r==="break";this.next(),this.eat(d.semi)||this.insertSemicolon()?e.label=null:this.type!==d.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var a=0;a=6?this.eat(d.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};H.parseForStatement=function(e){this.next();var r=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(of),this.enterScope(0),this.expect(d.parenL),this.type===d.semi)return r>-1&&this.unexpected(r),this.parseFor(e,null);var t=this.isLet();if(this.type===d._var||this.type===d._const||t){var a=this.startNode(),n=t?"let":this.value;return this.next(),this.parseVar(a,!0,n),this.finishNode(a,"VariableDeclaration"),(this.type===d._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&a.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===d._in?r>-1&&this.unexpected(r):e.await=r>-1),this.parseForIn(e,a)):(r>-1&&this.unexpected(r),this.parseFor(e,a))}var i=this.isContextual("let"),o=!1,u=new ci,s=this.parseExpression(r>-1?"await":!0,u);return this.type===d._in||(o=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===d._in?r>-1&&this.unexpected(r):e.await=r>-1),i&&o&&this.raise(s.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(s,!1,u),this.checkLValPattern(s),this.parseForIn(e,s)):(this.checkExpressionErrors(u,!0),r>-1&&this.unexpected(r),this.parseFor(e,s))};H.parseFunctionStatement=function(e,r,t){return this.next(),this.parseFunction(e,Fa|(t?0:sd),!1,r)};H.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(d._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};H.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(d.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};H.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(d.braceL),this.labels.push(Lie),this.enterScope(0);for(var r,t=!1;this.type!==d.braceR;)if(this.type===d._case||this.type===d._default){var a=this.type===d._case;r&&this.finishNode(r,"SwitchCase"),e.cases.push(r=this.startNode()),r.consequent=[],this.next(),a?r.test=this.parseExpression():(t&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),t=!0,r.test=null),this.expect(d.colon)}else r||this.unexpected(),r.consequent.push(this.parseStatement(null));return this.exitScope(),r&&this.finishNode(r,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};H.parseThrowStatement=function(e){return this.next(),yr.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Iie=[];H.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),r=e.type==="Identifier";return this.enterScope(r?wg:0),this.checkLValPattern(e,r?Ag:Kr),this.expect(d.parenR),e};H.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===d._catch){var r=this.startNode();this.next(),this.eat(d.parenL)?r.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),r.param=null,this.enterScope(0)),r.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(r,"CatchClause")}return e.finalizer=this.eat(d._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};H.parseVarStatement=function(e,r,t){return this.next(),this.parseVar(e,!1,r,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")};H.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(of),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};H.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};H.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};H.parseLabeledStatement=function(e,r,t,a){for(var n=0,i=this.labels;n=0;s--){var l=this.labels[s];if(l.statementStart===e.start)l.statementStart=this.start,l.kind=u;else break}return this.labels.push({name:r,kind:u,statementStart:this.start}),e.body=this.parseStatement(a?a.indexOf("label")===-1?a+"label":a:"label"),this.labels.pop(),e.label=t,this.finishNode(e,"LabeledStatement")};H.parseExpressionStatement=function(e,r){return e.expression=r,this.semicolon(),this.finishNode(e,"ExpressionStatement")};H.parseBlock=function(e,r,t){for(e===void 0&&(e=!0),r===void 0&&(r=this.startNode()),r.body=[],this.expect(d.braceL),e&&this.enterScope(0);this.type!==d.braceR;){var a=this.parseStatement(null);r.body.push(a)}return t&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(r,"BlockStatement")};H.parseFor=function(e,r){return e.init=r,this.expect(d.semi),e.test=this.type===d.semi?null:this.parseExpression(),this.expect(d.semi),e.update=this.type===d.parenR?null:this.parseExpression(),this.expect(d.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};H.parseForIn=function(e,r){var t=this.type===d._in;return this.next(),r.type==="VariableDeclaration"&&r.declarations[0].init!=null&&(!t||this.options.ecmaVersion<8||this.strict||r.kind!=="var"||r.declarations[0].id.type!=="Identifier")&&this.raise(r.start,(t?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=r,e.right=t?this.parseExpression():this.parseMaybeAssign(),this.expect(d.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,t?"ForInStatement":"ForOfStatement")};H.parseVar=function(e,r,t,a){for(e.declarations=[],e.kind=t;;){var n=this.startNode();if(this.parseVarId(n,t),this.eat(d.eq)?n.init=this.parseMaybeAssign(r):!a&&t==="const"&&!(this.type===d._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!a&&n.id.type!=="Identifier"&&!(r&&(this.type===d._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):n.init=null,e.declarations.push(this.finishNode(n,"VariableDeclarator")),!this.eat(d.comma))break}return e};H.parseVarId=function(e,r){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,r==="var"?nf:Kr,!1)};var Fa=1,sd=2,Dg=4;H.parseFunction=function(e,r,t,a,n){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!a)&&(this.type===d.star&&r&sd&&this.unexpected(),e.generator=this.eat(d.star)),this.options.ecmaVersion>=8&&(e.async=!!a),r&Fa&&(e.id=r&Dg&&this.type!==d.name?null:this.parseIdent(),e.id&&!(r&sd)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?nf:Kr:kg));var i=this.yieldPos,o=this.awaitPos,u=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(af(e.async,e.generator)),r&Fa||(e.id=this.type===d.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,t,!1,n),this.yieldPos=i,this.awaitPos=o,this.awaitIdentPos=u,this.finishNode(e,r&Fa?"FunctionDeclaration":"FunctionExpression")};H.parseFunctionParams=function(e){this.expect(d.parenL),e.params=this.parseBindingList(d.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};H.parseClass=function(e,r){this.next();var t=this.strict;this.strict=!0,this.parseClassId(e,r),this.parseClassSuper(e);var a=this.enterClassBody(),n=this.startNode(),i=!1;for(n.body=[],this.expect(d.braceL);this.type!==d.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(n.body.push(o),o.type==="MethodDefinition"&&o.kind==="constructor"?(i&&this.raiseRecoverable(o.start,"Duplicate constructor in the same class"),i=!0):o.key&&o.key.type==="PrivateIdentifier"&&Bie(a,o)&&this.raiseRecoverable(o.key.start,"Identifier '#"+o.key.name+"' has already been declared"))}return this.strict=t,this.next(),e.body=this.finishNode(n,"ClassBody"),this.exitClassBody(),this.finishNode(e,r?"ClassDeclaration":"ClassExpression")};H.parseClassElement=function(e){if(this.eat(d.semi))return null;var r=this.options.ecmaVersion,t=this.startNode(),a="",n=!1,i=!1,o="method",u=!1;if(this.eatContextual("static")){if(r>=13&&this.eat(d.braceL))return this.parseClassStaticBlock(t),t;this.isClassElementNameStart()||this.type===d.star?u=!0:a="static"}if(t.static=u,!a&&r>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===d.star)&&!this.canInsertSemicolon()?i=!0:a="async"),!a&&(r>=9||!i)&&this.eat(d.star)&&(n=!0),!a&&!i&&!n){var s=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?o=s:a=s)}if(a?(t.computed=!1,t.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),t.key.name=a,this.finishNode(t.key,"Identifier")):this.parseClassElementName(t),r<13||this.type===d.parenL||o!=="method"||n||i){var l=!t.static&&zn(t,"constructor"),c=l&&e;l&&o!=="method"&&this.raise(t.key.start,"Constructor can't have get/set modifier"),t.kind=l?"constructor":o,this.parseClassMethod(t,n,i,c)}else this.parseClassField(t);return t};H.isClassElementNameStart=function(){return this.type===d.name||this.type===d.privateId||this.type===d.num||this.type===d.string||this.type===d.bracketL||this.type.keyword};H.parseClassElementName=function(e){this.type===d.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};H.parseClassMethod=function(e,r,t,a){var n=e.key;e.kind==="constructor"?(r&&this.raise(n.start,"Constructor can't be a generator"),t&&this.raise(n.start,"Constructor can't be an async method")):e.static&&zn(e,"prototype")&&this.raise(n.start,"Classes may not have a static property named prototype");var i=e.value=this.parseMethod(r,t,a);return e.kind==="get"&&i.params.length!==0&&this.raiseRecoverable(i.start,"getter should have no params"),e.kind==="set"&&i.params.length!==1&&this.raiseRecoverable(i.start,"setter should have exactly one param"),e.kind==="set"&&i.params[0].type==="RestElement"&&this.raiseRecoverable(i.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};H.parseClassField=function(e){if(zn(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&zn(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(d.eq)){var r=this.currentThisScope(),t=r.inClassFieldInit;r.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),r.inClassFieldInit=t}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};H.parseClassStaticBlock=function(e){e.body=[];var r=this.labels;for(this.labels=[],this.enterScope(Ka|rf);this.type!==d.braceR;){var t=this.parseStatement(null);e.body.push(t)}return this.next(),this.exitScope(),this.labels=r,this.finishNode(e,"StaticBlock")};H.parseClassId=function(e,r){this.type===d.name?(e.id=this.parseIdent(),r&&this.checkLValSimple(e.id,Kr,!1)):(r===!0&&this.unexpected(),e.id=null)};H.parseClassSuper=function(e){e.superClass=this.eat(d._extends)?this.parseExprSubscripts(null,!1):null};H.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};H.exitClassBody=function(){var e=this.privateNameStack.pop(),r=e.declared,t=e.used;if(this.options.checkPrivateFields)for(var a=this.privateNameStack.length,n=a===0?null:this.privateNameStack[a-1],i=0;i=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(r,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==d.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};H.parseExport=function(e,r){if(this.next(),this.eat(d.star))return this.parseExportAllDeclaration(e,r);if(this.eat(d._default))return this.checkExport(r,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(r,e.declaration.declarations):this.checkExport(r,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(r),this.eatContextual("from"))this.type!==d.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var t=0,a=e.specifiers;t=13&&this.type===d.string){var e=this.parseLiteral(this.value);return $ie.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};H.adaptDirectivePrologue=function(e){for(var r=0;r=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var xr=Oe.prototype;xr.toAssignable=function(e,r,t){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",t&&this.checkPatternErrors(t,!0);for(var a=0,n=e.properties;a=8&&!u&&s.name==="async"&&!this.canInsertSemicolon()&&this.eat(d._function))return this.overrideContext(_e.f_expr),this.parseFunction(this.startNodeAt(i,o),0,!1,!0,r);if(n&&!this.canInsertSemicolon()){if(this.eat(d.arrow))return this.parseArrowExpression(this.startNodeAt(i,o),[s],!1,r);if(this.options.ecmaVersion>=8&&s.name==="async"&&this.type===d.name&&!u&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return s=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(d.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(i,o),[s],!0,r)}return s;case d.regexp:var l=this.value;return a=this.parseLiteral(l.value),a.regex={pattern:l.pattern,flags:l.flags},a;case d.num:case d.string:return this.parseLiteral(this.value);case d._null:case d._true:case d._false:return a=this.startNode(),a.value=this.type===d._null?null:this.type===d._true,a.raw=this.type.keyword,this.next(),this.finishNode(a,"Literal");case d.parenL:var c=this.start,p=this.parseParenAndDistinguishExpression(n,r);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(p)&&(e.parenthesizedAssign=c),e.parenthesizedBind<0&&(e.parenthesizedBind=c)),p;case d.bracketL:return a=this.startNode(),this.next(),a.elements=this.parseExprList(d.bracketR,!0,!0,e),this.finishNode(a,"ArrayExpression");case d.braceL:return this.overrideContext(_e.b_expr),this.parseObj(!1,e);case d._function:return a=this.startNode(),this.next(),this.parseFunction(a,0);case d._class:return this.parseClass(this.startNode(),!1);case d._new:return this.parseNew();case d.backQuote:return this.parseTemplate();case d._import:return this.options.ecmaVersion>=11?this.parseExprImport(t):this.unexpected();default:return this.parseExprAtomDefault()}};J.parseExprAtomDefault=function(){this.unexpected()};J.parseExprImport=function(e){var r=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===d.parenL&&!e)return this.parseDynamicImport(r);if(this.type===d.dot){var t=this.startNodeAt(r.start,r.loc&&r.loc.start);return t.name="import",r.meta=this.finishNode(t,"Identifier"),this.parseImportMeta(r)}else this.unexpected()};J.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(d.parenR)){var r=this.start;this.eat(d.comma)&&this.eat(d.parenR)?this.raiseRecoverable(r,"Trailing comma is not allowed in import()"):this.unexpected(r)}return this.finishNode(e,"ImportExpression")};J.parseImportMeta=function(e){this.next();var r=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),r&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};J.parseLiteral=function(e){var r=this.startNode();return r.value=e,r.raw=this.input.slice(this.start,this.end),r.raw.charCodeAt(r.raw.length-1)===110&&(r.bigint=r.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(r,"Literal")};J.parseParenExpression=function(){this.expect(d.parenL);var e=this.parseExpression();return this.expect(d.parenR),e};J.shouldParseArrow=function(e){return!this.canInsertSemicolon()};J.parseParenAndDistinguishExpression=function(e,r){var t=this.start,a=this.startLoc,n,i=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,u=this.startLoc,s=[],l=!0,c=!1,p=new ci,f=this.yieldPos,C=this.awaitPos,y;for(this.yieldPos=0,this.awaitPos=0;this.type!==d.parenR;)if(l?l=!1:this.expect(d.comma),i&&this.afterTrailingComma(d.parenR,!0)){c=!0;break}else if(this.type===d.ellipsis){y=this.start,s.push(this.parseParenItem(this.parseRestBinding())),this.type===d.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else s.push(this.parseMaybeAssign(!1,p,this.parseParenItem));var D=this.lastTokEnd,k=this.lastTokEndLoc;if(this.expect(d.parenR),e&&this.shouldParseArrow(s)&&this.eat(d.arrow))return this.checkPatternErrors(p,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=C,this.parseParenArrowList(t,a,s,r);(!s.length||c)&&this.unexpected(this.lastTokStart),y&&this.unexpected(y),this.checkExpressionErrors(p,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=C||this.awaitPos,s.length>1?(n=this.startNodeAt(o,u),n.expressions=s,this.finishNodeAt(n,"SequenceExpression",D,k)):n=s[0]}else n=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(t,a);return g.expression=n,this.finishNode(g,"ParenthesizedExpression")}else return n};J.parseParenItem=function(e){return e};J.parseParenArrowList=function(e,r,t,a){return this.parseArrowExpression(this.startNodeAt(e,r),t,!1,a)};var Mie=[];J.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===d.dot){var r=this.startNodeAt(e.start,e.loc&&e.loc.start);r.name="new",e.meta=this.finishNode(r,"Identifier"),this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),t&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var a=this.start,n=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),a,n,!0,!1),this.eat(d.parenL)?e.arguments=this.parseExprList(d.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Mie,this.finishNode(e,"NewExpression")};J.parseTemplateElement=function(e){var r=e.isTagged,t=this.startNode();return this.type===d.invalidTemplate?(r||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),t.value={raw:this.value,cooked:null}):t.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,` -`),cooked:this.value},this.next(),t.tail=this.type===d.backQuote,this.finishNode(t,"TemplateElement")};J.parseTemplate=function(e){e===void 0&&(e={});var r=e.isTagged;r===void 0&&(r=!1);var t=this.startNode();this.next(),t.expressions=[];var a=this.parseTemplateElement({isTagged:r});for(t.quasis=[a];!a.tail;)this.type===d.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(d.dollarBraceL),t.expressions.push(this.parseExpression()),this.expect(d.braceR),t.quasis.push(a=this.parseTemplateElement({isTagged:r}));return this.next(),this.finishNode(t,"TemplateLiteral")};J.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===d.name||this.type===d.num||this.type===d.string||this.type===d.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===d.star)&&!yr.test(this.input.slice(this.lastTokEnd,this.start))};J.parseObj=function(e,r){var t=this.startNode(),a=!0,n={};for(t.properties=[],this.next();!this.eat(d.braceR);){if(a)a=!1;else if(this.expect(d.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(d.braceR))break;var i=this.parseProperty(e,r);e||this.checkPropClash(i,n,r),t.properties.push(i)}return this.finishNode(t,e?"ObjectPattern":"ObjectExpression")};J.parseProperty=function(e,r){var t=this.startNode(),a,n,i,o;if(this.options.ecmaVersion>=9&&this.eat(d.ellipsis))return e?(t.argument=this.parseIdent(!1),this.type===d.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(t,"RestElement")):(t.argument=this.parseMaybeAssign(!1,r),this.type===d.comma&&r&&r.trailingComma<0&&(r.trailingComma=this.start),this.finishNode(t,"SpreadElement"));this.options.ecmaVersion>=6&&(t.method=!1,t.shorthand=!1,(e||r)&&(i=this.start,o=this.startLoc),e||(a=this.eat(d.star)));var u=this.containsEsc;return this.parsePropertyName(t),!e&&!u&&this.options.ecmaVersion>=8&&!a&&this.isAsyncProp(t)?(n=!0,a=this.options.ecmaVersion>=9&&this.eat(d.star),this.parsePropertyName(t)):n=!1,this.parsePropertyValue(t,e,a,n,i,o,r,u),this.finishNode(t,"Property")};J.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var r=e.kind==="get"?0:1;if(e.value.params.length!==r){var t=e.value.start;e.kind==="get"?this.raiseRecoverable(t,"getter should have no params"):this.raiseRecoverable(t,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};J.parsePropertyValue=function(e,r,t,a,n,i,o,u){(t||a)&&this.type===d.colon&&this.unexpected(),this.eat(d.colon)?(e.value=r?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init"):this.options.ecmaVersion>=6&&this.type===d.parenL?(r&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(t,a)):!r&&!u&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==d.comma&&this.type!==d.braceR&&this.type!==d.eq?((t||a)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((t||a)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=n),e.kind="init",r?e.value=this.parseMaybeDefault(n,i,this.copyNode(e.key)):this.type===d.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(n,i,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};J.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(d.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(d.bracketR),e.key;e.computed=!1}return e.key=this.type===d.num||this.type===d.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};J.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};J.parseMethod=function(e,r,t){var a=this.startNode(),n=this.yieldPos,i=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(a),this.options.ecmaVersion>=6&&(a.generator=e),this.options.ecmaVersion>=8&&(a.async=!!r),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(af(r,a.generator)|rf|(t?Cg:0)),this.expect(d.parenL),a.params=this.parseBindingList(d.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(a,!1,!0,!1),this.yieldPos=n,this.awaitPos=i,this.awaitIdentPos=o,this.finishNode(a,"FunctionExpression")};J.parseArrowExpression=function(e,r,t,a){var n=this.yieldPos,i=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(af(t,!1)|xg),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(r,!0),this.parseFunctionBody(e,!0,!1,a),this.yieldPos=n,this.awaitPos=i,this.awaitIdentPos=o,this.finishNode(e,"ArrowFunctionExpression")};J.parseFunctionBody=function(e,r,t,a){var n=r&&this.type!==d.braceL,i=this.strict,o=!1;if(n)e.body=this.parseMaybeAssign(a),e.expression=!0,this.checkParams(e,!1);else{var u=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!i||u)&&(o=this.strictDirective(this.end),o&&u&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var s=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!i&&!o&&!r&&!t&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,_g),e.body=this.parseBlock(!1,void 0,o&&!i),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=s}this.exitScope()};J.isSimpleParamList=function(e){for(var r=0,t=e;r-1||n.functions.indexOf(e)>-1||n.var.indexOf(e)>-1,n.lexical.push(e),this.inModule&&n.flags&ja&&delete this.undefinedExports[e]}else if(r===Ag){var i=this.currentScope();i.lexical.push(e)}else if(r===kg){var o=this.currentScope();this.treatFunctionsAsVar?a=o.lexical.indexOf(e)>-1:a=o.lexical.indexOf(e)>-1||o.var.indexOf(e)>-1,o.functions.push(e)}else for(var u=this.scopeStack.length-1;u>=0;--u){var s=this.scopeStack[u];if(s.lexical.indexOf(e)>-1&&!(s.flags&wg&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){a=!0;break}if(s.var.push(e),this.inModule&&s.flags&ja&&delete this.undefinedExports[e],s.flags&tf)break}a&&this.raiseRecoverable(t,"Identifier '"+e+"' has already been declared")};dt.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};dt.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};dt.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var r=this.scopeStack[e];if(r.flags&tf)return r}};dt.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var r=this.scopeStack[e];if(r.flags&tf&&!(r.flags&xg))return r}};var pi=function(r,t,a){this.type="",this.start=t,this.end=0,r.options.locations&&(this.loc=new ui(r,a)),r.options.directSourceFile&&(this.sourceFile=r.options.directSourceFile),r.options.ranges&&(this.range=[t,0])},Xa=Oe.prototype;Xa.startNode=function(){return new pi(this,this.start,this.startLoc)};Xa.startNodeAt=function(e,r){return new pi(this,e,r)};function Sg(e,r,t,a){return e.type=r,e.end=t,this.options.locations&&(e.loc.end=a),this.options.ranges&&(e.range[1]=t),e}Xa.finishNode=function(e,r){return Sg.call(this,e,r,this.lastTokEnd,this.lastTokEndLoc)};Xa.finishNodeAt=function(e,r,t,a){return Sg.call(this,e,r,t,a)};Xa.copyNode=function(e){var r=new pi(this,e.start,this.startLoc);for(var t in e)r[t]=e[t];return r};var Rg="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Pg=Rg+" Extended_Pictographic",qg=Pg,$g=qg+" EBase EComp EMod EPres ExtPict",Fg=$g,jie=Fg,Uie={9:Rg,10:Pg,11:qg,12:$g,13:Fg,14:jie},Vie="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",zie={9:"",10:"",11:"",12:"",13:"",14:Vie},gh="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Og="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Tg=Og+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Lg=Tg+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Ig=Lg+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Bg=Ig+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Hie=Bg+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz",Gie={9:Og,10:Tg,11:Lg,12:Ig,13:Bg,14:Hie},Mg={};function Wie(e){var r=Mg[e]={binary:at(Uie[e]+" "+gh),binaryOfStrings:at(zie[e]),nonBinary:{General_Category:at(gh),Script:at(Gie[e])}};r.nonBinary.Script_Extensions=r.nonBinary.Script,r.nonBinary.gc=r.nonBinary.General_Category,r.nonBinary.sc=r.nonBinary.Script,r.nonBinary.scx=r.nonBinary.Script_Extensions}for(var Uc=0,bh=[9,10,11,12,13,14];Uc=6?"uy":"")+(r.options.ecmaVersion>=9?"s":"")+(r.options.ecmaVersion>=13?"d":"")+(r.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Mg[r.options.ecmaVersion>=14?14:r.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};Mr.prototype.reset=function(r,t,a){var n=a.indexOf("v")!==-1,i=a.indexOf("u")!==-1;this.start=r|0,this.source=t+"",this.flags=a,n&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=i&&this.parser.options.ecmaVersion>=9)};Mr.prototype.raise=function(r){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+r)};Mr.prototype.at=function(r,t){t===void 0&&(t=!1);var a=this.source,n=a.length;if(r>=n)return-1;var i=a.charCodeAt(r);if(!(t||this.switchU)||i<=55295||i>=57344||r+1>=n)return i;var o=a.charCodeAt(r+1);return o>=56320&&o<=57343?(i<<10)+o-56613888:i};Mr.prototype.nextIndex=function(r,t){t===void 0&&(t=!1);var a=this.source,n=a.length;if(r>=n)return n;var i=a.charCodeAt(r),o;return!(t||this.switchU)||i<=55295||i>=57344||r+1>=n||(o=a.charCodeAt(r+1))<56320||o>57343?r+1:r+2};Mr.prototype.current=function(r){return r===void 0&&(r=!1),this.at(this.pos,r)};Mr.prototype.lookahead=function(r){return r===void 0&&(r=!1),this.at(this.nextIndex(this.pos,r),r)};Mr.prototype.advance=function(r){r===void 0&&(r=!1),this.pos=this.nextIndex(this.pos,r)};Mr.prototype.eat=function(r,t){return t===void 0&&(t=!1),this.current(t)===r?(this.advance(t),!0):!1};Mr.prototype.eatChars=function(r,t){t===void 0&&(t=!1);for(var a=this.pos,n=0,i=r;n-1&&this.raise(e.start,"Duplicate regular expression flag"),o==="u"&&(a=!0),o==="v"&&(n=!0)}this.options.ecmaVersion>=15&&a&&n&&this.raise(e.start,"Invalid regular expression flag")};V.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))};V.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var r=0,t=e.backReferenceNames;r=9&&(t=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!t,!0}return e.pos=r,!1};V.regexp_eatQuantifier=function(e,r){return r===void 0&&(r=!1),this.regexp_eatQuantifierPrefix(e,r)?(e.eat(63),!0):!1};V.regexp_eatQuantifierPrefix=function(e,r){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,r)};V.regexp_eatBracedQuantifier=function(e,r){var t=e.pos;if(e.eat(123)){var a=0,n=-1;if(this.regexp_eatDecimalDigits(e)&&(a=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue),e.eat(125)))return n!==-1&&n=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};V.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};V.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};V.regexp_eatSyntaxCharacter=function(e){var r=e.current();return Ng(r)?(e.lastIntValue=r,e.advance(),!0):!1};function Ng(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}V.regexp_eatPatternCharacters=function(e){for(var r=e.pos,t=0;(t=e.current())!==-1&&!Ng(t);)e.advance();return e.pos!==r};V.regexp_eatExtendedPatternCharacter=function(e){var r=e.current();return r!==-1&&r!==36&&!(r>=40&&r<=43)&&r!==46&&r!==63&&r!==91&&r!==94&&r!==124?(e.advance(),!0):!1};V.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){e.groupNames.indexOf(e.lastStringValue)!==-1&&e.raise("Duplicate capture group name"),e.groupNames.push(e.lastStringValue);return}e.raise("Invalid group")}};V.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};V.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=ot(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=ot(e.lastIntValue);return!0}return!1};V.regexp_eatRegExpIdentifierStart=function(e){var r=e.pos,t=this.options.ecmaVersion>=11,a=e.current(t);return e.advance(t),a===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,t)&&(a=e.lastIntValue),Qie(a)?(e.lastIntValue=a,!0):(e.pos=r,!1)};function Qie(e){return Wr(e,!0)||e===36||e===95}V.regexp_eatRegExpIdentifierPart=function(e){var r=e.pos,t=this.options.ecmaVersion>=11,a=e.current(t);return e.advance(t),a===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,t)&&(a=e.lastIntValue),Kie(a)?(e.lastIntValue=a,!0):(e.pos=r,!1)};function Kie(e){return na(e,!0)||e===36||e===95||e===8204||e===8205}V.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};V.regexp_eatBackReference=function(e){var r=e.pos;if(this.regexp_eatDecimalEscape(e)){var t=e.lastIntValue;if(e.switchU)return t>e.maxBackReference&&(e.maxBackReference=t),!0;if(t<=e.numCapturingParens)return!0;e.pos=r}return!1};V.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};V.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};V.regexp_eatCControlLetter=function(e){var r=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=r}return!1};V.regexp_eatZero=function(e){return e.current()===48&&!di(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};V.regexp_eatControlEscape=function(e){var r=e.current();return r===116?(e.lastIntValue=9,e.advance(),!0):r===110?(e.lastIntValue=10,e.advance(),!0):r===118?(e.lastIntValue=11,e.advance(),!0):r===102?(e.lastIntValue=12,e.advance(),!0):r===114?(e.lastIntValue=13,e.advance(),!0):!1};V.regexp_eatControlLetter=function(e){var r=e.current();return jg(r)?(e.lastIntValue=r%32,e.advance(),!0):!1};function jg(e){return e>=65&&e<=90||e>=97&&e<=122}V.regexp_eatRegExpUnicodeEscapeSequence=function(e,r){r===void 0&&(r=!1);var t=e.pos,a=r||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var n=e.lastIntValue;if(a&&n>=55296&&n<=56319){var i=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(n-55296)*1024+(o-56320)+65536,!0}e.pos=i,e.lastIntValue=n}return!0}if(a&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Xie(e.lastIntValue))return!0;a&&e.raise("Invalid unicode escape"),e.pos=t}return!1};function Xie(e){return e>=0&&e<=1114111}V.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var r=e.current();return r!==99&&(!e.switchN||r!==107)?(e.lastIntValue=r,e.advance(),!0):!1};V.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var r=e.current();if(r>=49&&r<=57){do e.lastIntValue=10*e.lastIntValue+(r-48),e.advance();while((r=e.current())>=48&&r<=57);return!0}return!1};var Ug=0,Yr=1,mr=2;V.regexp_eatCharacterClassEscape=function(e){var r=e.current();if(Jie(r))return e.lastIntValue=-1,e.advance(),Yr;var t=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((t=r===80)||r===112)){e.lastIntValue=-1,e.advance();var a;if(e.eat(123)&&(a=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return t&&a===mr&&e.raise("Invalid property name"),a;e.raise("Invalid property name")}return Ug};function Jie(e){return e===100||e===68||e===115||e===83||e===119||e===87}V.regexp_eatUnicodePropertyValueExpression=function(e){var r=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var t=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var a=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,t,a),Yr}}if(e.pos=r,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,n)}return Ug};V.regexp_validateUnicodePropertyNameAndValue=function(e,r,t){Qa(e.unicodeProperties.nonBinary,r)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[r].test(t)||e.raise("Invalid property value")};V.regexp_validateUnicodePropertyNameOrValue=function(e,r){if(e.unicodeProperties.binary.test(r))return Yr;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(r))return mr;e.raise("Invalid property name")};V.regexp_eatUnicodePropertyName=function(e){var r=0;for(e.lastStringValue="";Vg(r=e.current());)e.lastStringValue+=ot(r),e.advance();return e.lastStringValue!==""};function Vg(e){return jg(e)||e===95}V.regexp_eatUnicodePropertyValue=function(e){var r=0;for(e.lastStringValue="";Zie(r=e.current());)e.lastStringValue+=ot(r),e.advance();return e.lastStringValue!==""};function Zie(e){return Vg(e)||di(e)}V.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};V.regexp_eatCharacterClass=function(e){if(e.eat(91)){var r=e.eat(94),t=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),r&&t===mr&&e.raise("Negated character class may contain strings"),!0}return!1};V.regexp_classContents=function(e){return e.current()===93?Yr:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),Yr)};V.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var r=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var t=e.lastIntValue;e.switchU&&(r===-1||t===-1)&&e.raise("Invalid character class"),r!==-1&&t!==-1&&r>t&&e.raise("Range out of order in character class")}}};V.regexp_eatClassAtom=function(e){var r=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var t=e.current();(t===99||Gg(t))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=r}var a=e.current();return a!==93?(e.lastIntValue=a,e.advance(),!0):!1};V.regexp_eatClassEscape=function(e){var r=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=r}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};V.regexp_classSetExpression=function(e){var r=Yr,t;if(!this.regexp_eatClassSetRange(e))if(t=this.regexp_eatClassSetOperand(e)){t===mr&&(r=mr);for(var a=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(t=this.regexp_eatClassSetOperand(e))){t!==mr&&(r=Yr);continue}e.raise("Invalid character in character class")}if(a!==e.pos)return r;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(a!==e.pos)return r}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(t=this.regexp_eatClassSetOperand(e),!t)return r;t===mr&&(r=mr)}};V.regexp_eatClassSetRange=function(e){var r=e.pos;if(this.regexp_eatClassSetCharacter(e)){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var a=e.lastIntValue;return t!==-1&&a!==-1&&t>a&&e.raise("Range out of order in character class"),!0}e.pos=r}return!1};V.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?Yr:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};V.regexp_eatNestedClass=function(e){var r=e.pos;if(e.eat(91)){var t=e.eat(94),a=this.regexp_classContents(e);if(e.eat(93))return t&&a===mr&&e.raise("Negated character class may contain strings"),a;e.pos=r}if(e.eat(92)){var n=this.regexp_eatCharacterClassEscape(e);if(n)return n;e.pos=r}return null};V.regexp_eatClassStringDisjunction=function(e){var r=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var t=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return t}else e.raise("Invalid escape");e.pos=r}return null};V.regexp_classStringDisjunctionContents=function(e){for(var r=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===mr&&(r=mr);return r};V.regexp_classString=function(e){for(var r=0;this.regexp_eatClassSetCharacter(e);)r++;return r===1?Yr:mr};V.regexp_eatClassSetCharacter=function(e){var r=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=r,!1);var t=e.current();return t<0||t===e.lookahead()&&eoe(t)||roe(t)?!1:(e.advance(),e.lastIntValue=t,!0)};function eoe(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function roe(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}V.regexp_eatClassSetReservedPunctuator=function(e){var r=e.current();return toe(r)?(e.lastIntValue=r,e.advance(),!0):!1};function toe(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}V.regexp_eatClassControlLetter=function(e){var r=e.current();return di(r)||r===95?(e.lastIntValue=r%32,e.advance(),!0):!1};V.regexp_eatHexEscapeSequence=function(e){var r=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=r}return!1};V.regexp_eatDecimalDigits=function(e){var r=e.pos,t=0;for(e.lastIntValue=0;di(t=e.current());)e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();return e.pos!==r};function di(e){return e>=48&&e<=57}V.regexp_eatHexDigits=function(e){var r=e.pos,t=0;for(e.lastIntValue=0;zg(t=e.current());)e.lastIntValue=16*e.lastIntValue+Hg(t),e.advance();return e.pos!==r};function zg(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Hg(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}V.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var r=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;r<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=r*64+t*8+e.lastIntValue:e.lastIntValue=r*8+t}else e.lastIntValue=r;return!0}return!1};V.regexp_eatOctalDigit=function(e){var r=e.current();return Gg(r)?(e.lastIntValue=r-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Gg(e){return e>=48&&e<=55}V.regexp_eatFixedHexDigits=function(e,r){var t=e.pos;e.lastIntValue=0;for(var a=0;a=this.input.length)return this.finishToken(d.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};ue.readToken=function(e){return Wr(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};ue.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var r=this.input.charCodeAt(this.pos+1);return r<=56319||r>=57344?e:(e<<10)+r-56613888};ue.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),r=this.pos,t=this.input.indexOf("*/",this.pos+=2);if(t===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=t+2,this.options.locations)for(var a=void 0,n=r;(a=vg(this.input,n,this.pos))>-1;)++this.curLine,n=this.lineStart=a;this.options.onComment&&this.options.onComment(!0,this.input.slice(r+2,t),r,this.pos,e,this.curPosition())};ue.skipLineComment=function(e){for(var r=this.pos,t=this.options.onComment&&this.curPosition(),a=this.input.charCodeAt(this.pos+=e);this.pos8&&e<14||e>=5760&&mg.test(String.fromCharCode(e)))++this.pos;else break e}}};ue.finishToken=function(e,r){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var t=this.type;this.type=e,this.value=r,this.updateContext(t)};ue.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var r=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&r===46?(this.pos+=3,this.finishToken(d.ellipsis)):(++this.pos,this.finishToken(d.dot))};ue.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(d.assign,2):this.finishOp(d.slash,1)};ue.readToken_mult_modulo_exp=function(e){var r=this.input.charCodeAt(this.pos+1),t=1,a=e===42?d.star:d.modulo;return this.options.ecmaVersion>=7&&e===42&&r===42&&(++t,a=d.starstar,r=this.input.charCodeAt(this.pos+2)),r===61?this.finishOp(d.assign,t+1):this.finishOp(a,t)};ue.readToken_pipe_amp=function(e){var r=this.input.charCodeAt(this.pos+1);if(r===e){if(this.options.ecmaVersion>=12){var t=this.input.charCodeAt(this.pos+2);if(t===61)return this.finishOp(d.assign,3)}return this.finishOp(e===124?d.logicalOR:d.logicalAND,2)}return r===61?this.finishOp(d.assign,2):this.finishOp(e===124?d.bitwiseOR:d.bitwiseAND,1)};ue.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(d.assign,2):this.finishOp(d.bitwiseXOR,1)};ue.readToken_plus_min=function(e){var r=this.input.charCodeAt(this.pos+1);return r===e?r===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||yr.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(d.incDec,2):r===61?this.finishOp(d.assign,2):this.finishOp(d.plusMin,1)};ue.readToken_lt_gt=function(e){var r=this.input.charCodeAt(this.pos+1),t=1;return r===e?(t=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+t)===61?this.finishOp(d.assign,t+1):this.finishOp(d.bitShift,t)):r===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(r===61&&(t=2),this.finishOp(d.relational,t))};ue.readToken_eq_excl=function(e){var r=this.input.charCodeAt(this.pos+1);return r===61?this.finishOp(d.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&r===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(d.arrow)):this.finishOp(e===61?d.eq:d.prefix,1)};ue.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var r=this.input.charCodeAt(this.pos+1);if(r===46){var t=this.input.charCodeAt(this.pos+2);if(t<48||t>57)return this.finishOp(d.questionDot,2)}if(r===63){if(e>=12){var a=this.input.charCodeAt(this.pos+2);if(a===61)return this.finishOp(d.assign,3)}return this.finishOp(d.coalesce,2)}}return this.finishOp(d.question,1)};ue.readToken_numberSign=function(){var e=this.options.ecmaVersion,r=35;if(e>=13&&(++this.pos,r=this.fullCharCodeAtPos(),Wr(r,!0)||r===92))return this.finishToken(d.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+ot(r)+"'")};ue.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(d.parenL);case 41:return++this.pos,this.finishToken(d.parenR);case 59:return++this.pos,this.finishToken(d.semi);case 44:return++this.pos,this.finishToken(d.comma);case 91:return++this.pos,this.finishToken(d.bracketL);case 93:return++this.pos,this.finishToken(d.bracketR);case 123:return++this.pos,this.finishToken(d.braceL);case 125:return++this.pos,this.finishToken(d.braceR);case 58:return++this.pos,this.finishToken(d.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(d.backQuote);case 48:var r=this.input.charCodeAt(this.pos+1);if(r===120||r===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(r===111||r===79)return this.readRadixNumber(8);if(r===98||r===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(d.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+ot(e)+"'")};ue.finishOp=function(e,r){var t=this.input.slice(this.pos,this.pos+r);return this.pos+=r,this.finishToken(e,t)};ue.readRegexp=function(){for(var e,r,t=this.pos;;){this.pos>=this.input.length&&this.raise(t,"Unterminated regular expression");var a=this.input.charAt(this.pos);if(yr.test(a)&&this.raise(t,"Unterminated regular expression"),e)e=!1;else{if(a==="[")r=!0;else if(a==="]"&&r)r=!1;else if(a==="/"&&!r)break;e=a==="\\"}++this.pos}var n=this.input.slice(t,this.pos);++this.pos;var i=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(i);var u=this.regexpState||(this.regexpState=new Mr(this));u.reset(t,n,o),this.validateRegExpFlags(u),this.validateRegExpPattern(u);var s=null;try{s=new RegExp(n,o)}catch{}return this.finishToken(d.regexp,{pattern:n,flags:o,value:s})};ue.readInt=function(e,r,t){for(var a=this.options.ecmaVersion>=12&&r===void 0,n=t&&this.input.charCodeAt(this.pos)===48,i=this.pos,o=0,u=0,s=0,l=r??1/0;s=97?p=c-97+10:c>=65?p=c-65+10:c>=48&&c<=57?p=c-48:p=1/0,p>=e)break;u=c,o=o*e+p}return a&&u===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===i||r!=null&&this.pos-i!==r?null:o};function aoe(e,r){return r?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function Wg(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}ue.readRadixNumber=function(e){var r=this.pos;this.pos+=2;var t=this.readInt(e);return t==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(t=Wg(this.input.slice(r,this.pos)),++this.pos):Wr(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(d.num,t)};ue.readNumber=function(e){var r=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(r,"Invalid number");var t=this.pos-r>=2&&this.input.charCodeAt(r)===48;t&&this.strict&&this.raise(r,"Invalid number");var a=this.input.charCodeAt(this.pos);if(!t&&!e&&this.options.ecmaVersion>=11&&a===110){var n=Wg(this.input.slice(r,this.pos));return++this.pos,Wr(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(d.num,n)}t&&/[89]/.test(this.input.slice(r,this.pos))&&(t=!1),a===46&&!t&&(++this.pos,this.readInt(10),a=this.input.charCodeAt(this.pos)),(a===69||a===101)&&!t&&(a=this.input.charCodeAt(++this.pos),(a===43||a===45)&&++this.pos,this.readInt(10)===null&&this.raise(r,"Invalid number")),Wr(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var i=aoe(this.input.slice(r,this.pos),t);return this.finishToken(d.num,i)};ue.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),r;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;r=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,r>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else r=this.readHexChar(4);return r};ue.readString=function(e){for(var r="",t=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var a=this.input.charCodeAt(this.pos);if(a===e)break;a===92?(r+=this.input.slice(t,this.pos),r+=this.readEscapedChar(!1),t=this.pos):a===8232||a===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(ca(a)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return r+=this.input.slice(t,this.pos++),this.finishToken(d.string,r)};var Yg={};ue.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Yg)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};ue.invalidStringToken=function(e,r){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Yg;this.raise(e,r)};ue.readTmplToken=function(){for(var e="",r=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var t=this.input.charCodeAt(this.pos);if(t===96||t===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===d.template||this.type===d.invalidTemplate)?t===36?(this.pos+=2,this.finishToken(d.dollarBraceL)):(++this.pos,this.finishToken(d.backQuote)):(e+=this.input.slice(r,this.pos),this.finishToken(d.template,e));if(t===92)e+=this.input.slice(r,this.pos),e+=this.readEscapedChar(!0),r=this.pos;else if(ca(t)){switch(e+=this.input.slice(r,this.pos),++this.pos,t){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=` +import{X as Rr,Y as dg,Z as pt,_ as fh}from"./scheduler.8d4e2d99.js";function Sr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function hh(e,r){for(var t="",a=0,n=-1,i=0,o,u=0;u<=e.length;++u){if(u2){var s=t.lastIndexOf("/");if(s!==t.length-1){s===-1?(t="",a=0):(t=t.slice(0,s),a=t.length-1-t.lastIndexOf("/")),n=u,i=0;continue}}else if(t.length===2||t.length===1){t="",a=0,n=u,i=0;continue}}r&&(t.length>0?t+="/..":t="..",a=2)}else t.length>0?t+="/"+e.slice(n+1,u):t=e.slice(n+1,u),a=u-n-1;n=u,i=0}else o===46&&i!==-1?++i:i=-1}return t}function wie(e,r){var t=r.dir||r.root,a=r.base||(r.name||"")+(r.ext||"");return t?t===r.root?t+a:t+e+a:a}var Zt={resolve:function(){for(var r="",t=!1,a,n=arguments.length-1;n>=-1&&!t;n--){var i;n>=0?i=arguments[n]:(a===void 0&&(a=Rr.cwd()),i=a),Sr(i),i.length!==0&&(r=i+"/"+r,t=i.charCodeAt(0)===47)}return r=hh(r,!t),t?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(r){if(Sr(r),r.length===0)return".";var t=r.charCodeAt(0)===47,a=r.charCodeAt(r.length-1)===47;return r=hh(r,!t),r.length===0&&!t&&(r="."),r.length>0&&a&&(r+="/"),t?"/"+r:r},isAbsolute:function(r){return Sr(r),r.length>0&&r.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var r,t=0;t0&&(r===void 0?r=a:r+="/"+a)}return r===void 0?".":Zt.normalize(r)},relative:function(r,t){if(Sr(r),Sr(t),r===t||(r=Zt.resolve(r),t=Zt.resolve(t),r===t))return"";for(var a=1;al){if(t.charCodeAt(o+p)===47)return t.slice(o+p+1);if(p===0)return t.slice(o+p)}else i>l&&(r.charCodeAt(a+p)===47?c=p:p===0&&(c=0));break}var f=r.charCodeAt(a+p),C=t.charCodeAt(o+p);if(f!==C)break;f===47&&(c=p)}var y="";for(p=a+c+1;p<=n;++p)(p===n||r.charCodeAt(p)===47)&&(y.length===0?y+="..":y+="/..");return y.length>0?y+t.slice(o+c):(o+=c,t.charCodeAt(o)===47&&++o,t.slice(o))},_makeLong:function(r){return r},dirname:function(r){if(Sr(r),r.length===0)return".";for(var t=r.charCodeAt(0),a=t===47,n=-1,i=!0,o=r.length-1;o>=1;--o)if(t=r.charCodeAt(o),t===47){if(!i){n=o;break}}else i=!1;return n===-1?a?"/":".":a&&n===1?"//":r.slice(0,n)},basename:function(r,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Sr(r);var a=0,n=-1,i=!0,o;if(t!==void 0&&t.length>0&&t.length<=r.length){if(t.length===r.length&&t===r)return"";var u=t.length-1,s=-1;for(o=r.length-1;o>=0;--o){var l=r.charCodeAt(o);if(l===47){if(!i){a=o+1;break}}else s===-1&&(i=!1,s=o+1),u>=0&&(l===t.charCodeAt(u)?--u===-1&&(n=o):(u=-1,n=s))}return a===n?n=s:n===-1&&(n=r.length),r.slice(a,n)}else{for(o=r.length-1;o>=0;--o)if(r.charCodeAt(o)===47){if(!i){a=o+1;break}}else n===-1&&(i=!1,n=o+1);return n===-1?"":r.slice(a,n)}},extname:function(r){Sr(r);for(var t=-1,a=0,n=-1,i=!0,o=0,u=r.length-1;u>=0;--u){var s=r.charCodeAt(u);if(s===47){if(!i){a=u+1;break}continue}n===-1&&(i=!1,n=u+1),s===46?t===-1?t=u:o!==1&&(o=1):t!==-1&&(o=-1)}return t===-1||n===-1||o===0||o===1&&t===n-1&&t===a+1?"":r.slice(t,n)},format:function(r){if(r===null||typeof r!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof r);return wie("/",r)},parse:function(r){Sr(r);var t={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return t;var a=r.charCodeAt(0),n=a===47,i;n?(t.root="/",i=1):i=0;for(var o=-1,u=0,s=-1,l=!0,c=r.length-1,p=0;c>=i;--c){if(a=r.charCodeAt(c),a===47){if(!l){u=c+1;break}continue}s===-1&&(l=!1,s=c+1),a===46?o===-1?o=c:p!==1&&(p=1):o!==-1&&(p=-1)}return o===-1||s===-1||p===0||p===1&&o===s-1&&o===u+1?s!==-1&&(u===0&&n?t.base=t.name=r.slice(1,s):t.base=t.name=r.slice(u,s)):(u===0&&n?(t.name=r.slice(1,o),t.base=r.slice(1,s)):(t.name=r.slice(u,o),t.base=r.slice(u,s)),t.ext=r.slice(o,s)),u>0?t.dir=r.slice(0,u-1):n&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};Zt.posix=Zt;var Cie=Zt;const nr=dg(Cie);var kie=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],fg=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],Aie="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",hg="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Nc={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},jc="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",_ie={5:jc,"5module":jc+" export import",6:jc+" const class extends export import super"},Die=/^in(stanceof)?$/,Eie=new RegExp("["+hg+"]"),Sie=new RegExp("["+hg+Aie+"]");function od(e,r){for(var t=65536,a=0;ae)return!1;if(t+=r[a+1],t>=e)return!0}return!1}function Wr(e,r){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Eie.test(String.fromCharCode(e)):r===!1?!1:od(e,fg)}function na(e,r){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Sie.test(String.fromCharCode(e)):r===!1?!1:od(e,fg)||od(e,kie)}var ve=function(r,t){t===void 0&&(t={}),this.label=r,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function lr(e,r){return new ve(e,{beforeExpr:!0,binop:r})}var ur={beforeExpr:!0},Xe={startsExpr:!0},ef={};function ce(e,r){return r===void 0&&(r={}),r.keyword=e,ef[e]=new ve(e,r)}var d={num:new ve("num",Xe),regexp:new ve("regexp",Xe),string:new ve("string",Xe),name:new ve("name",Xe),privateId:new ve("privateId",Xe),eof:new ve("eof"),bracketL:new ve("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new ve("]"),braceL:new ve("{",{beforeExpr:!0,startsExpr:!0}),braceR:new ve("}"),parenL:new ve("(",{beforeExpr:!0,startsExpr:!0}),parenR:new ve(")"),comma:new ve(",",ur),semi:new ve(";",ur),colon:new ve(":",ur),dot:new ve("."),question:new ve("?",ur),questionDot:new ve("?."),arrow:new ve("=>",ur),template:new ve("template"),invalidTemplate:new ve("invalidTemplate"),ellipsis:new ve("...",ur),backQuote:new ve("`",Xe),dollarBraceL:new ve("${",{beforeExpr:!0,startsExpr:!0}),eq:new ve("=",{beforeExpr:!0,isAssign:!0}),assign:new ve("_=",{beforeExpr:!0,isAssign:!0}),incDec:new ve("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new ve("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:lr("||",1),logicalAND:lr("&&",2),bitwiseOR:lr("|",3),bitwiseXOR:lr("^",4),bitwiseAND:lr("&",5),equality:lr("==/!=/===/!==",6),relational:lr("/<=/>=",7),bitShift:lr("<>/>>>",8),plusMin:new ve("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:lr("%",10),star:lr("*",10),slash:lr("/",10),starstar:new ve("**",{beforeExpr:!0}),coalesce:lr("??",1),_break:ce("break"),_case:ce("case",ur),_catch:ce("catch"),_continue:ce("continue"),_debugger:ce("debugger"),_default:ce("default",ur),_do:ce("do",{isLoop:!0,beforeExpr:!0}),_else:ce("else",ur),_finally:ce("finally"),_for:ce("for",{isLoop:!0}),_function:ce("function",Xe),_if:ce("if"),_return:ce("return",ur),_switch:ce("switch"),_throw:ce("throw",ur),_try:ce("try"),_var:ce("var"),_const:ce("const"),_while:ce("while",{isLoop:!0}),_with:ce("with"),_new:ce("new",{beforeExpr:!0,startsExpr:!0}),_this:ce("this",Xe),_super:ce("super",Xe),_class:ce("class",Xe),_extends:ce("extends",ur),_export:ce("export"),_import:ce("import",Xe),_null:ce("null",Xe),_true:ce("true",Xe),_false:ce("false",Xe),_in:ce("in",{beforeExpr:!0,binop:7}),_instanceof:ce("instanceof",{beforeExpr:!0,binop:7}),_typeof:ce("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:ce("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:ce("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},yr=/\r\n?|\n|\u2028|\u2029/,Rie=new RegExp(yr.source,"g");function ca(e){return e===10||e===13||e===8232||e===8233}function vg(e,r,t){t===void 0&&(t=e.length);for(var a=r;a>10)+55296,(e&1023)+56320))}var $ie=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Na=function(r,t){this.line=r,this.column=t};Na.prototype.offset=function(r){return new Na(this.line,this.column+r)};var ui=function(r,t,a){this.start=t,this.end=a,r.sourceFile!==null&&(this.source=r.sourceFile)};function bg(e,r){for(var t=1,a=0;;){var n=vg(e,a,r);if(n<0)return new Na(t,r-a);++t,a=n}}var sd={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},gh=!1;function Fie(e){var r={};for(var t in sd)r[t]=e&&Qa(e,t)?e[t]:sd[t];if(r.ecmaVersion==="latest"?r.ecmaVersion=1e8:r.ecmaVersion==null?(!gh&&typeof console=="object"&&console.warn&&(gh=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required. +Defaulting to 2020, but this will stop working in the future.`)),r.ecmaVersion=11):r.ecmaVersion>=2015&&(r.ecmaVersion-=2009),r.allowReserved==null&&(r.allowReserved=r.ecmaVersion<5),(!e||e.allowHashBang==null)&&(r.allowHashBang=r.ecmaVersion>=14),vh(r.onToken)){var a=r.onToken;r.onToken=function(n){return a.push(n)}}return vh(r.onComment)&&(r.onComment=Oie(r,r.onComment)),r}function Oie(e,r){return function(t,a,n,i,o,u){var s={type:t?"Block":"Line",value:a,start:n,end:i};e.locations&&(s.loc=new ui(this,o,u)),e.ranges&&(s.range=[n,i]),r.push(s)}}var ja=1,pa=2,rf=4,yg=8,xg=16,wg=32,tf=64,Cg=128,Ka=256,af=ja|pa|Ka;function nf(e,r){return pa|(e?rf:0)|(r?yg:0)}var Vn=0,of=1,Kr=2,kg=3,Ag=4,_g=5,Oe=function(r,t,a){this.options=r=Fie(r),this.sourceFile=r.sourceFile,this.keywords=at(_ie[r.ecmaVersion>=6?6:r.sourceType==="module"?"5module":5]);var n="";r.allowReserved!==!0&&(n=Nc[r.ecmaVersion>=6?6:r.ecmaVersion===5?5:3],r.sourceType==="module"&&(n+=" await")),this.reservedWords=at(n);var i=(n?n+" ":"")+Nc.strict;this.reservedWordsStrict=at(i),this.reservedWordsStrictBind=at(i+" "+Nc.strictBind),this.input=String(t),this.containsEsc=!1,a?(this.pos=a,this.lineStart=this.input.lastIndexOf(` +`,a-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(yr).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=d.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=r.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&r.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(ja),this.regexpState=null,this.privateNameStack=[]},Br={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};Oe.prototype.parse=function(){var r=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(r)};Br.inFunction.get=function(){return(this.currentVarScope().flags&pa)>0};Br.inGenerator.get=function(){return(this.currentVarScope().flags&yg)>0&&!this.currentVarScope().inClassFieldInit};Br.inAsync.get=function(){return(this.currentVarScope().flags&rf)>0&&!this.currentVarScope().inClassFieldInit};Br.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var r=this.scopeStack[e];if(r.inClassFieldInit||r.flags&Ka)return!1;if(r.flags&pa)return(r.flags&rf)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Br.allowSuper.get=function(){var e=this.currentThisScope(),r=e.flags,t=e.inClassFieldInit;return(r&tf)>0||t||this.options.allowSuperOutsideMethod};Br.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Cg)>0};Br.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Br.allowNewDotTarget.get=function(){var e=this.currentThisScope(),r=e.flags,t=e.inClassFieldInit;return(r&(pa|Ka))>0||t};Br.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Ka)>0};Oe.extend=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];for(var a=this,n=0;n=,?^&]/.test(n)||n==="!"&&this.input.charAt(a+1)==="=")}e+=r[0].length,hr.lastIndex=e,e+=hr.exec(this.input)[0].length,this.input[e]===";"&&e++}};Ye.eat=function(e){return this.type===e?(this.next(),!0):!1};Ye.isContextual=function(e){return this.type===d.name&&this.value===e&&!this.containsEsc};Ye.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};Ye.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};Ye.canInsertSemicolon=function(){return this.type===d.eof||this.type===d.braceR||yr.test(this.input.slice(this.lastTokEnd,this.start))};Ye.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};Ye.semicolon=function(){!this.eat(d.semi)&&!this.insertSemicolon()&&this.unexpected()};Ye.afterTrailingComma=function(e,r){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),r||this.next(),!0};Ye.expect=function(e){this.eat(e)||this.unexpected()};Ye.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var ci=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Ye.checkPatternErrors=function(e,r){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var t=r?e.parenthesizedAssign:e.parenthesizedBind;t>-1&&this.raiseRecoverable(t,r?"Assigning to rvalue":"Parenthesized pattern")}};Ye.checkExpressionErrors=function(e,r){if(!e)return!1;var t=e.shorthandAssign,a=e.doubleProto;if(!r)return t>=0||a>=0;t>=0&&this.raise(t,"Shorthand property assignments are valid only in destructuring patterns"),a>=0&&this.raiseRecoverable(a,"Redefinition of __proto__ property")};Ye.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&a<56320)return!0;if(Wr(a,!0)){for(var n=t+1;na(a=this.input.charCodeAt(n),!0);)++n;if(a===92||a>55295&&a<56320)return!0;var i=this.input.slice(t,n);if(!Die.test(i))return!0}return!1};H.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;hr.lastIndex=this.pos;var e=hr.exec(this.input),r=this.pos+e[0].length,t;return!yr.test(this.input.slice(this.pos,r))&&this.input.slice(r,r+8)==="function"&&(r+8===this.input.length||!(na(t=this.input.charCodeAt(r+8))||t>55295&&t<56320))};H.parseStatement=function(e,r,t){var a=this.type,n=this.startNode(),i;switch(this.isLet(e)&&(a=d._var,i="let"),a){case d._break:case d._continue:return this.parseBreakContinueStatement(n,a.keyword);case d._debugger:return this.parseDebuggerStatement(n);case d._do:return this.parseDoStatement(n);case d._for:return this.parseForStatement(n);case d._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(n,!1,!e);case d._class:return e&&this.unexpected(),this.parseClass(n,!0);case d._if:return this.parseIfStatement(n);case d._return:return this.parseReturnStatement(n);case d._switch:return this.parseSwitchStatement(n);case d._throw:return this.parseThrowStatement(n);case d._try:return this.parseTryStatement(n);case d._const:case d._var:return i=i||this.value,e&&i!=="var"&&this.unexpected(),this.parseVarStatement(n,i);case d._while:return this.parseWhileStatement(n);case d._with:return this.parseWithStatement(n);case d.braceL:return this.parseBlock(!0,n);case d.semi:return this.parseEmptyStatement(n);case d._export:case d._import:if(this.options.ecmaVersion>10&&a===d._import){hr.lastIndex=this.pos;var o=hr.exec(this.input),u=this.pos+o[0].length,s=this.input.charCodeAt(u);if(s===40||s===46)return this.parseExpressionStatement(n,this.parseExpression())}return this.options.allowImportExportEverywhere||(r||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),a===d._import?this.parseImport(n):this.parseExport(n,t);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(n,!0,!e);var l=this.value,c=this.parseExpression();return a===d.name&&c.type==="Identifier"&&this.eat(d.colon)?this.parseLabeledStatement(n,l,c,e):this.parseExpressionStatement(n,c)}};H.parseBreakContinueStatement=function(e,r){var t=r==="break";this.next(),this.eat(d.semi)||this.insertSemicolon()?e.label=null:this.type!==d.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var a=0;a=6?this.eat(d.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};H.parseForStatement=function(e){this.next();var r=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(sf),this.enterScope(0),this.expect(d.parenL),this.type===d.semi)return r>-1&&this.unexpected(r),this.parseFor(e,null);var t=this.isLet();if(this.type===d._var||this.type===d._const||t){var a=this.startNode(),n=t?"let":this.value;return this.next(),this.parseVar(a,!0,n),this.finishNode(a,"VariableDeclaration"),(this.type===d._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&a.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===d._in?r>-1&&this.unexpected(r):e.await=r>-1),this.parseForIn(e,a)):(r>-1&&this.unexpected(r),this.parseFor(e,a))}var i=this.isContextual("let"),o=!1,u=new ci,s=this.parseExpression(r>-1?"await":!0,u);return this.type===d._in||(o=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===d._in?r>-1&&this.unexpected(r):e.await=r>-1),i&&o&&this.raise(s.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(s,!1,u),this.checkLValPattern(s),this.parseForIn(e,s)):(this.checkExpressionErrors(u,!0),r>-1&&this.unexpected(r),this.parseFor(e,s))};H.parseFunctionStatement=function(e,r,t){return this.next(),this.parseFunction(e,Fa|(t?0:ld),!1,r)};H.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(d._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};H.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(d.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};H.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(d.braceL),this.labels.push(Lie),this.enterScope(0);for(var r,t=!1;this.type!==d.braceR;)if(this.type===d._case||this.type===d._default){var a=this.type===d._case;r&&this.finishNode(r,"SwitchCase"),e.cases.push(r=this.startNode()),r.consequent=[],this.next(),a?r.test=this.parseExpression():(t&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),t=!0,r.test=null),this.expect(d.colon)}else r||this.unexpected(),r.consequent.push(this.parseStatement(null));return this.exitScope(),r&&this.finishNode(r,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};H.parseThrowStatement=function(e){return this.next(),yr.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Iie=[];H.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),r=e.type==="Identifier";return this.enterScope(r?wg:0),this.checkLValPattern(e,r?Ag:Kr),this.expect(d.parenR),e};H.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===d._catch){var r=this.startNode();this.next(),this.eat(d.parenL)?r.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),r.param=null,this.enterScope(0)),r.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(r,"CatchClause")}return e.finalizer=this.eat(d._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};H.parseVarStatement=function(e,r,t){return this.next(),this.parseVar(e,!1,r,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")};H.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(sf),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};H.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};H.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};H.parseLabeledStatement=function(e,r,t,a){for(var n=0,i=this.labels;n=0;s--){var l=this.labels[s];if(l.statementStart===e.start)l.statementStart=this.start,l.kind=u;else break}return this.labels.push({name:r,kind:u,statementStart:this.start}),e.body=this.parseStatement(a?a.indexOf("label")===-1?a+"label":a:"label"),this.labels.pop(),e.label=t,this.finishNode(e,"LabeledStatement")};H.parseExpressionStatement=function(e,r){return e.expression=r,this.semicolon(),this.finishNode(e,"ExpressionStatement")};H.parseBlock=function(e,r,t){for(e===void 0&&(e=!0),r===void 0&&(r=this.startNode()),r.body=[],this.expect(d.braceL),e&&this.enterScope(0);this.type!==d.braceR;){var a=this.parseStatement(null);r.body.push(a)}return t&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(r,"BlockStatement")};H.parseFor=function(e,r){return e.init=r,this.expect(d.semi),e.test=this.type===d.semi?null:this.parseExpression(),this.expect(d.semi),e.update=this.type===d.parenR?null:this.parseExpression(),this.expect(d.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};H.parseForIn=function(e,r){var t=this.type===d._in;return this.next(),r.type==="VariableDeclaration"&&r.declarations[0].init!=null&&(!t||this.options.ecmaVersion<8||this.strict||r.kind!=="var"||r.declarations[0].id.type!=="Identifier")&&this.raise(r.start,(t?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=r,e.right=t?this.parseExpression():this.parseMaybeAssign(),this.expect(d.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,t?"ForInStatement":"ForOfStatement")};H.parseVar=function(e,r,t,a){for(e.declarations=[],e.kind=t;;){var n=this.startNode();if(this.parseVarId(n,t),this.eat(d.eq)?n.init=this.parseMaybeAssign(r):!a&&t==="const"&&!(this.type===d._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!a&&n.id.type!=="Identifier"&&!(r&&(this.type===d._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):n.init=null,e.declarations.push(this.finishNode(n,"VariableDeclarator")),!this.eat(d.comma))break}return e};H.parseVarId=function(e,r){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,r==="var"?of:Kr,!1)};var Fa=1,ld=2,Dg=4;H.parseFunction=function(e,r,t,a,n){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!a)&&(this.type===d.star&&r&ld&&this.unexpected(),e.generator=this.eat(d.star)),this.options.ecmaVersion>=8&&(e.async=!!a),r&Fa&&(e.id=r&Dg&&this.type!==d.name?null:this.parseIdent(),e.id&&!(r&ld)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?of:Kr:kg));var i=this.yieldPos,o=this.awaitPos,u=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(nf(e.async,e.generator)),r&Fa||(e.id=this.type===d.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,t,!1,n),this.yieldPos=i,this.awaitPos=o,this.awaitIdentPos=u,this.finishNode(e,r&Fa?"FunctionDeclaration":"FunctionExpression")};H.parseFunctionParams=function(e){this.expect(d.parenL),e.params=this.parseBindingList(d.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};H.parseClass=function(e,r){this.next();var t=this.strict;this.strict=!0,this.parseClassId(e,r),this.parseClassSuper(e);var a=this.enterClassBody(),n=this.startNode(),i=!1;for(n.body=[],this.expect(d.braceL);this.type!==d.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(n.body.push(o),o.type==="MethodDefinition"&&o.kind==="constructor"?(i&&this.raiseRecoverable(o.start,"Duplicate constructor in the same class"),i=!0):o.key&&o.key.type==="PrivateIdentifier"&&Bie(a,o)&&this.raiseRecoverable(o.key.start,"Identifier '#"+o.key.name+"' has already been declared"))}return this.strict=t,this.next(),e.body=this.finishNode(n,"ClassBody"),this.exitClassBody(),this.finishNode(e,r?"ClassDeclaration":"ClassExpression")};H.parseClassElement=function(e){if(this.eat(d.semi))return null;var r=this.options.ecmaVersion,t=this.startNode(),a="",n=!1,i=!1,o="method",u=!1;if(this.eatContextual("static")){if(r>=13&&this.eat(d.braceL))return this.parseClassStaticBlock(t),t;this.isClassElementNameStart()||this.type===d.star?u=!0:a="static"}if(t.static=u,!a&&r>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===d.star)&&!this.canInsertSemicolon()?i=!0:a="async"),!a&&(r>=9||!i)&&this.eat(d.star)&&(n=!0),!a&&!i&&!n){var s=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?o=s:a=s)}if(a?(t.computed=!1,t.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),t.key.name=a,this.finishNode(t.key,"Identifier")):this.parseClassElementName(t),r<13||this.type===d.parenL||o!=="method"||n||i){var l=!t.static&&zn(t,"constructor"),c=l&&e;l&&o!=="method"&&this.raise(t.key.start,"Constructor can't have get/set modifier"),t.kind=l?"constructor":o,this.parseClassMethod(t,n,i,c)}else this.parseClassField(t);return t};H.isClassElementNameStart=function(){return this.type===d.name||this.type===d.privateId||this.type===d.num||this.type===d.string||this.type===d.bracketL||this.type.keyword};H.parseClassElementName=function(e){this.type===d.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};H.parseClassMethod=function(e,r,t,a){var n=e.key;e.kind==="constructor"?(r&&this.raise(n.start,"Constructor can't be a generator"),t&&this.raise(n.start,"Constructor can't be an async method")):e.static&&zn(e,"prototype")&&this.raise(n.start,"Classes may not have a static property named prototype");var i=e.value=this.parseMethod(r,t,a);return e.kind==="get"&&i.params.length!==0&&this.raiseRecoverable(i.start,"getter should have no params"),e.kind==="set"&&i.params.length!==1&&this.raiseRecoverable(i.start,"setter should have exactly one param"),e.kind==="set"&&i.params[0].type==="RestElement"&&this.raiseRecoverable(i.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};H.parseClassField=function(e){if(zn(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&zn(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(d.eq)){var r=this.currentThisScope(),t=r.inClassFieldInit;r.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),r.inClassFieldInit=t}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};H.parseClassStaticBlock=function(e){e.body=[];var r=this.labels;for(this.labels=[],this.enterScope(Ka|tf);this.type!==d.braceR;){var t=this.parseStatement(null);e.body.push(t)}return this.next(),this.exitScope(),this.labels=r,this.finishNode(e,"StaticBlock")};H.parseClassId=function(e,r){this.type===d.name?(e.id=this.parseIdent(),r&&this.checkLValSimple(e.id,Kr,!1)):(r===!0&&this.unexpected(),e.id=null)};H.parseClassSuper=function(e){e.superClass=this.eat(d._extends)?this.parseExprSubscripts(null,!1):null};H.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};H.exitClassBody=function(){var e=this.privateNameStack.pop(),r=e.declared,t=e.used;if(this.options.checkPrivateFields)for(var a=this.privateNameStack.length,n=a===0?null:this.privateNameStack[a-1],i=0;i=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(r,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==d.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};H.parseExport=function(e,r){if(this.next(),this.eat(d.star))return this.parseExportAllDeclaration(e,r);if(this.eat(d._default))return this.checkExport(r,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(r,e.declaration.declarations):this.checkExport(r,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(r),this.eatContextual("from"))this.type!==d.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var t=0,a=e.specifiers;t=13&&this.type===d.string){var e=this.parseLiteral(this.value);return $ie.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};H.adaptDirectivePrologue=function(e){for(var r=0;r=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var xr=Oe.prototype;xr.toAssignable=function(e,r,t){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",t&&this.checkPatternErrors(t,!0);for(var a=0,n=e.properties;a=8&&!u&&s.name==="async"&&!this.canInsertSemicolon()&&this.eat(d._function))return this.overrideContext(_e.f_expr),this.parseFunction(this.startNodeAt(i,o),0,!1,!0,r);if(n&&!this.canInsertSemicolon()){if(this.eat(d.arrow))return this.parseArrowExpression(this.startNodeAt(i,o),[s],!1,r);if(this.options.ecmaVersion>=8&&s.name==="async"&&this.type===d.name&&!u&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return s=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(d.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(i,o),[s],!0,r)}return s;case d.regexp:var l=this.value;return a=this.parseLiteral(l.value),a.regex={pattern:l.pattern,flags:l.flags},a;case d.num:case d.string:return this.parseLiteral(this.value);case d._null:case d._true:case d._false:return a=this.startNode(),a.value=this.type===d._null?null:this.type===d._true,a.raw=this.type.keyword,this.next(),this.finishNode(a,"Literal");case d.parenL:var c=this.start,p=this.parseParenAndDistinguishExpression(n,r);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(p)&&(e.parenthesizedAssign=c),e.parenthesizedBind<0&&(e.parenthesizedBind=c)),p;case d.bracketL:return a=this.startNode(),this.next(),a.elements=this.parseExprList(d.bracketR,!0,!0,e),this.finishNode(a,"ArrayExpression");case d.braceL:return this.overrideContext(_e.b_expr),this.parseObj(!1,e);case d._function:return a=this.startNode(),this.next(),this.parseFunction(a,0);case d._class:return this.parseClass(this.startNode(),!1);case d._new:return this.parseNew();case d.backQuote:return this.parseTemplate();case d._import:return this.options.ecmaVersion>=11?this.parseExprImport(t):this.unexpected();default:return this.parseExprAtomDefault()}};J.parseExprAtomDefault=function(){this.unexpected()};J.parseExprImport=function(e){var r=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===d.parenL&&!e)return this.parseDynamicImport(r);if(this.type===d.dot){var t=this.startNodeAt(r.start,r.loc&&r.loc.start);return t.name="import",r.meta=this.finishNode(t,"Identifier"),this.parseImportMeta(r)}else this.unexpected()};J.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(d.parenR)){var r=this.start;this.eat(d.comma)&&this.eat(d.parenR)?this.raiseRecoverable(r,"Trailing comma is not allowed in import()"):this.unexpected(r)}return this.finishNode(e,"ImportExpression")};J.parseImportMeta=function(e){this.next();var r=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),r&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};J.parseLiteral=function(e){var r=this.startNode();return r.value=e,r.raw=this.input.slice(this.start,this.end),r.raw.charCodeAt(r.raw.length-1)===110&&(r.bigint=r.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(r,"Literal")};J.parseParenExpression=function(){this.expect(d.parenL);var e=this.parseExpression();return this.expect(d.parenR),e};J.shouldParseArrow=function(e){return!this.canInsertSemicolon()};J.parseParenAndDistinguishExpression=function(e,r){var t=this.start,a=this.startLoc,n,i=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,u=this.startLoc,s=[],l=!0,c=!1,p=new ci,f=this.yieldPos,C=this.awaitPos,y;for(this.yieldPos=0,this.awaitPos=0;this.type!==d.parenR;)if(l?l=!1:this.expect(d.comma),i&&this.afterTrailingComma(d.parenR,!0)){c=!0;break}else if(this.type===d.ellipsis){y=this.start,s.push(this.parseParenItem(this.parseRestBinding())),this.type===d.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else s.push(this.parseMaybeAssign(!1,p,this.parseParenItem));var D=this.lastTokEnd,k=this.lastTokEndLoc;if(this.expect(d.parenR),e&&this.shouldParseArrow(s)&&this.eat(d.arrow))return this.checkPatternErrors(p,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=C,this.parseParenArrowList(t,a,s,r);(!s.length||c)&&this.unexpected(this.lastTokStart),y&&this.unexpected(y),this.checkExpressionErrors(p,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=C||this.awaitPos,s.length>1?(n=this.startNodeAt(o,u),n.expressions=s,this.finishNodeAt(n,"SequenceExpression",D,k)):n=s[0]}else n=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(t,a);return g.expression=n,this.finishNode(g,"ParenthesizedExpression")}else return n};J.parseParenItem=function(e){return e};J.parseParenArrowList=function(e,r,t,a){return this.parseArrowExpression(this.startNodeAt(e,r),t,!1,a)};var Mie=[];J.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===d.dot){var r=this.startNodeAt(e.start,e.loc&&e.loc.start);r.name="new",e.meta=this.finishNode(r,"Identifier"),this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),t&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var a=this.start,n=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),a,n,!0,!1),this.eat(d.parenL)?e.arguments=this.parseExprList(d.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Mie,this.finishNode(e,"NewExpression")};J.parseTemplateElement=function(e){var r=e.isTagged,t=this.startNode();return this.type===d.invalidTemplate?(r||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),t.value={raw:this.value,cooked:null}):t.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,` +`),cooked:this.value},this.next(),t.tail=this.type===d.backQuote,this.finishNode(t,"TemplateElement")};J.parseTemplate=function(e){e===void 0&&(e={});var r=e.isTagged;r===void 0&&(r=!1);var t=this.startNode();this.next(),t.expressions=[];var a=this.parseTemplateElement({isTagged:r});for(t.quasis=[a];!a.tail;)this.type===d.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(d.dollarBraceL),t.expressions.push(this.parseExpression()),this.expect(d.braceR),t.quasis.push(a=this.parseTemplateElement({isTagged:r}));return this.next(),this.finishNode(t,"TemplateLiteral")};J.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===d.name||this.type===d.num||this.type===d.string||this.type===d.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===d.star)&&!yr.test(this.input.slice(this.lastTokEnd,this.start))};J.parseObj=function(e,r){var t=this.startNode(),a=!0,n={};for(t.properties=[],this.next();!this.eat(d.braceR);){if(a)a=!1;else if(this.expect(d.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(d.braceR))break;var i=this.parseProperty(e,r);e||this.checkPropClash(i,n,r),t.properties.push(i)}return this.finishNode(t,e?"ObjectPattern":"ObjectExpression")};J.parseProperty=function(e,r){var t=this.startNode(),a,n,i,o;if(this.options.ecmaVersion>=9&&this.eat(d.ellipsis))return e?(t.argument=this.parseIdent(!1),this.type===d.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(t,"RestElement")):(t.argument=this.parseMaybeAssign(!1,r),this.type===d.comma&&r&&r.trailingComma<0&&(r.trailingComma=this.start),this.finishNode(t,"SpreadElement"));this.options.ecmaVersion>=6&&(t.method=!1,t.shorthand=!1,(e||r)&&(i=this.start,o=this.startLoc),e||(a=this.eat(d.star)));var u=this.containsEsc;return this.parsePropertyName(t),!e&&!u&&this.options.ecmaVersion>=8&&!a&&this.isAsyncProp(t)?(n=!0,a=this.options.ecmaVersion>=9&&this.eat(d.star),this.parsePropertyName(t)):n=!1,this.parsePropertyValue(t,e,a,n,i,o,r,u),this.finishNode(t,"Property")};J.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var r=e.kind==="get"?0:1;if(e.value.params.length!==r){var t=e.value.start;e.kind==="get"?this.raiseRecoverable(t,"getter should have no params"):this.raiseRecoverable(t,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};J.parsePropertyValue=function(e,r,t,a,n,i,o,u){(t||a)&&this.type===d.colon&&this.unexpected(),this.eat(d.colon)?(e.value=r?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init"):this.options.ecmaVersion>=6&&this.type===d.parenL?(r&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(t,a)):!r&&!u&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==d.comma&&this.type!==d.braceR&&this.type!==d.eq?((t||a)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((t||a)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=n),e.kind="init",r?e.value=this.parseMaybeDefault(n,i,this.copyNode(e.key)):this.type===d.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(n,i,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};J.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(d.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(d.bracketR),e.key;e.computed=!1}return e.key=this.type===d.num||this.type===d.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};J.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};J.parseMethod=function(e,r,t){var a=this.startNode(),n=this.yieldPos,i=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(a),this.options.ecmaVersion>=6&&(a.generator=e),this.options.ecmaVersion>=8&&(a.async=!!r),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(nf(r,a.generator)|tf|(t?Cg:0)),this.expect(d.parenL),a.params=this.parseBindingList(d.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(a,!1,!0,!1),this.yieldPos=n,this.awaitPos=i,this.awaitIdentPos=o,this.finishNode(a,"FunctionExpression")};J.parseArrowExpression=function(e,r,t,a){var n=this.yieldPos,i=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(nf(t,!1)|xg),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(r,!0),this.parseFunctionBody(e,!0,!1,a),this.yieldPos=n,this.awaitPos=i,this.awaitIdentPos=o,this.finishNode(e,"ArrowFunctionExpression")};J.parseFunctionBody=function(e,r,t,a){var n=r&&this.type!==d.braceL,i=this.strict,o=!1;if(n)e.body=this.parseMaybeAssign(a),e.expression=!0,this.checkParams(e,!1);else{var u=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!i||u)&&(o=this.strictDirective(this.end),o&&u&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var s=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!i&&!o&&!r&&!t&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,_g),e.body=this.parseBlock(!1,void 0,o&&!i),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=s}this.exitScope()};J.isSimpleParamList=function(e){for(var r=0,t=e;r-1||n.functions.indexOf(e)>-1||n.var.indexOf(e)>-1,n.lexical.push(e),this.inModule&&n.flags&ja&&delete this.undefinedExports[e]}else if(r===Ag){var i=this.currentScope();i.lexical.push(e)}else if(r===kg){var o=this.currentScope();this.treatFunctionsAsVar?a=o.lexical.indexOf(e)>-1:a=o.lexical.indexOf(e)>-1||o.var.indexOf(e)>-1,o.functions.push(e)}else for(var u=this.scopeStack.length-1;u>=0;--u){var s=this.scopeStack[u];if(s.lexical.indexOf(e)>-1&&!(s.flags&wg&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){a=!0;break}if(s.var.push(e),this.inModule&&s.flags&ja&&delete this.undefinedExports[e],s.flags&af)break}a&&this.raiseRecoverable(t,"Identifier '"+e+"' has already been declared")};dt.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};dt.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};dt.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var r=this.scopeStack[e];if(r.flags&af)return r}};dt.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var r=this.scopeStack[e];if(r.flags&af&&!(r.flags&xg))return r}};var pi=function(r,t,a){this.type="",this.start=t,this.end=0,r.options.locations&&(this.loc=new ui(r,a)),r.options.directSourceFile&&(this.sourceFile=r.options.directSourceFile),r.options.ranges&&(this.range=[t,0])},Xa=Oe.prototype;Xa.startNode=function(){return new pi(this,this.start,this.startLoc)};Xa.startNodeAt=function(e,r){return new pi(this,e,r)};function Sg(e,r,t,a){return e.type=r,e.end=t,this.options.locations&&(e.loc.end=a),this.options.ranges&&(e.range[1]=t),e}Xa.finishNode=function(e,r){return Sg.call(this,e,r,this.lastTokEnd,this.lastTokEndLoc)};Xa.finishNodeAt=function(e,r,t,a){return Sg.call(this,e,r,t,a)};Xa.copyNode=function(e){var r=new pi(this,e.start,this.startLoc);for(var t in e)r[t]=e[t];return r};var Rg="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Pg=Rg+" Extended_Pictographic",qg=Pg,$g=qg+" EBase EComp EMod EPres ExtPict",Fg=$g,jie=Fg,Uie={9:Rg,10:Pg,11:qg,12:$g,13:Fg,14:jie},Vie="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",zie={9:"",10:"",11:"",12:"",13:"",14:Vie},bh="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Og="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Tg=Og+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Lg=Tg+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Ig=Lg+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Bg=Ig+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Hie=Bg+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz",Gie={9:Og,10:Tg,11:Lg,12:Ig,13:Bg,14:Hie},Mg={};function Wie(e){var r=Mg[e]={binary:at(Uie[e]+" "+bh),binaryOfStrings:at(zie[e]),nonBinary:{General_Category:at(bh),Script:at(Gie[e])}};r.nonBinary.Script_Extensions=r.nonBinary.Script,r.nonBinary.gc=r.nonBinary.General_Category,r.nonBinary.sc=r.nonBinary.Script,r.nonBinary.scx=r.nonBinary.Script_Extensions}for(var Uc=0,yh=[9,10,11,12,13,14];Uc=6?"uy":"")+(r.options.ecmaVersion>=9?"s":"")+(r.options.ecmaVersion>=13?"d":"")+(r.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Mg[r.options.ecmaVersion>=14?14:r.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};Mr.prototype.reset=function(r,t,a){var n=a.indexOf("v")!==-1,i=a.indexOf("u")!==-1;this.start=r|0,this.source=t+"",this.flags=a,n&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=i&&this.parser.options.ecmaVersion>=9)};Mr.prototype.raise=function(r){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+r)};Mr.prototype.at=function(r,t){t===void 0&&(t=!1);var a=this.source,n=a.length;if(r>=n)return-1;var i=a.charCodeAt(r);if(!(t||this.switchU)||i<=55295||i>=57344||r+1>=n)return i;var o=a.charCodeAt(r+1);return o>=56320&&o<=57343?(i<<10)+o-56613888:i};Mr.prototype.nextIndex=function(r,t){t===void 0&&(t=!1);var a=this.source,n=a.length;if(r>=n)return n;var i=a.charCodeAt(r),o;return!(t||this.switchU)||i<=55295||i>=57344||r+1>=n||(o=a.charCodeAt(r+1))<56320||o>57343?r+1:r+2};Mr.prototype.current=function(r){return r===void 0&&(r=!1),this.at(this.pos,r)};Mr.prototype.lookahead=function(r){return r===void 0&&(r=!1),this.at(this.nextIndex(this.pos,r),r)};Mr.prototype.advance=function(r){r===void 0&&(r=!1),this.pos=this.nextIndex(this.pos,r)};Mr.prototype.eat=function(r,t){return t===void 0&&(t=!1),this.current(t)===r?(this.advance(t),!0):!1};Mr.prototype.eatChars=function(r,t){t===void 0&&(t=!1);for(var a=this.pos,n=0,i=r;n-1&&this.raise(e.start,"Duplicate regular expression flag"),o==="u"&&(a=!0),o==="v"&&(n=!0)}this.options.ecmaVersion>=15&&a&&n&&this.raise(e.start,"Invalid regular expression flag")};V.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))};V.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var r=0,t=e.backReferenceNames;r=9&&(t=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!t,!0}return e.pos=r,!1};V.regexp_eatQuantifier=function(e,r){return r===void 0&&(r=!1),this.regexp_eatQuantifierPrefix(e,r)?(e.eat(63),!0):!1};V.regexp_eatQuantifierPrefix=function(e,r){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,r)};V.regexp_eatBracedQuantifier=function(e,r){var t=e.pos;if(e.eat(123)){var a=0,n=-1;if(this.regexp_eatDecimalDigits(e)&&(a=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue),e.eat(125)))return n!==-1&&n=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};V.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};V.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};V.regexp_eatSyntaxCharacter=function(e){var r=e.current();return Ng(r)?(e.lastIntValue=r,e.advance(),!0):!1};function Ng(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}V.regexp_eatPatternCharacters=function(e){for(var r=e.pos,t=0;(t=e.current())!==-1&&!Ng(t);)e.advance();return e.pos!==r};V.regexp_eatExtendedPatternCharacter=function(e){var r=e.current();return r!==-1&&r!==36&&!(r>=40&&r<=43)&&r!==46&&r!==63&&r!==91&&r!==94&&r!==124?(e.advance(),!0):!1};V.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){e.groupNames.indexOf(e.lastStringValue)!==-1&&e.raise("Duplicate capture group name"),e.groupNames.push(e.lastStringValue);return}e.raise("Invalid group")}};V.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};V.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=ot(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=ot(e.lastIntValue);return!0}return!1};V.regexp_eatRegExpIdentifierStart=function(e){var r=e.pos,t=this.options.ecmaVersion>=11,a=e.current(t);return e.advance(t),a===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,t)&&(a=e.lastIntValue),Qie(a)?(e.lastIntValue=a,!0):(e.pos=r,!1)};function Qie(e){return Wr(e,!0)||e===36||e===95}V.regexp_eatRegExpIdentifierPart=function(e){var r=e.pos,t=this.options.ecmaVersion>=11,a=e.current(t);return e.advance(t),a===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,t)&&(a=e.lastIntValue),Kie(a)?(e.lastIntValue=a,!0):(e.pos=r,!1)};function Kie(e){return na(e,!0)||e===36||e===95||e===8204||e===8205}V.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};V.regexp_eatBackReference=function(e){var r=e.pos;if(this.regexp_eatDecimalEscape(e)){var t=e.lastIntValue;if(e.switchU)return t>e.maxBackReference&&(e.maxBackReference=t),!0;if(t<=e.numCapturingParens)return!0;e.pos=r}return!1};V.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};V.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};V.regexp_eatCControlLetter=function(e){var r=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=r}return!1};V.regexp_eatZero=function(e){return e.current()===48&&!di(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};V.regexp_eatControlEscape=function(e){var r=e.current();return r===116?(e.lastIntValue=9,e.advance(),!0):r===110?(e.lastIntValue=10,e.advance(),!0):r===118?(e.lastIntValue=11,e.advance(),!0):r===102?(e.lastIntValue=12,e.advance(),!0):r===114?(e.lastIntValue=13,e.advance(),!0):!1};V.regexp_eatControlLetter=function(e){var r=e.current();return jg(r)?(e.lastIntValue=r%32,e.advance(),!0):!1};function jg(e){return e>=65&&e<=90||e>=97&&e<=122}V.regexp_eatRegExpUnicodeEscapeSequence=function(e,r){r===void 0&&(r=!1);var t=e.pos,a=r||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var n=e.lastIntValue;if(a&&n>=55296&&n<=56319){var i=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(n-55296)*1024+(o-56320)+65536,!0}e.pos=i,e.lastIntValue=n}return!0}if(a&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Xie(e.lastIntValue))return!0;a&&e.raise("Invalid unicode escape"),e.pos=t}return!1};function Xie(e){return e>=0&&e<=1114111}V.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var r=e.current();return r!==99&&(!e.switchN||r!==107)?(e.lastIntValue=r,e.advance(),!0):!1};V.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var r=e.current();if(r>=49&&r<=57){do e.lastIntValue=10*e.lastIntValue+(r-48),e.advance();while((r=e.current())>=48&&r<=57);return!0}return!1};var Ug=0,Yr=1,mr=2;V.regexp_eatCharacterClassEscape=function(e){var r=e.current();if(Jie(r))return e.lastIntValue=-1,e.advance(),Yr;var t=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((t=r===80)||r===112)){e.lastIntValue=-1,e.advance();var a;if(e.eat(123)&&(a=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return t&&a===mr&&e.raise("Invalid property name"),a;e.raise("Invalid property name")}return Ug};function Jie(e){return e===100||e===68||e===115||e===83||e===119||e===87}V.regexp_eatUnicodePropertyValueExpression=function(e){var r=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var t=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var a=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,t,a),Yr}}if(e.pos=r,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,n)}return Ug};V.regexp_validateUnicodePropertyNameAndValue=function(e,r,t){Qa(e.unicodeProperties.nonBinary,r)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[r].test(t)||e.raise("Invalid property value")};V.regexp_validateUnicodePropertyNameOrValue=function(e,r){if(e.unicodeProperties.binary.test(r))return Yr;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(r))return mr;e.raise("Invalid property name")};V.regexp_eatUnicodePropertyName=function(e){var r=0;for(e.lastStringValue="";Vg(r=e.current());)e.lastStringValue+=ot(r),e.advance();return e.lastStringValue!==""};function Vg(e){return jg(e)||e===95}V.regexp_eatUnicodePropertyValue=function(e){var r=0;for(e.lastStringValue="";Zie(r=e.current());)e.lastStringValue+=ot(r),e.advance();return e.lastStringValue!==""};function Zie(e){return Vg(e)||di(e)}V.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};V.regexp_eatCharacterClass=function(e){if(e.eat(91)){var r=e.eat(94),t=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),r&&t===mr&&e.raise("Negated character class may contain strings"),!0}return!1};V.regexp_classContents=function(e){return e.current()===93?Yr:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),Yr)};V.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var r=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var t=e.lastIntValue;e.switchU&&(r===-1||t===-1)&&e.raise("Invalid character class"),r!==-1&&t!==-1&&r>t&&e.raise("Range out of order in character class")}}};V.regexp_eatClassAtom=function(e){var r=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var t=e.current();(t===99||Gg(t))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=r}var a=e.current();return a!==93?(e.lastIntValue=a,e.advance(),!0):!1};V.regexp_eatClassEscape=function(e){var r=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=r}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};V.regexp_classSetExpression=function(e){var r=Yr,t;if(!this.regexp_eatClassSetRange(e))if(t=this.regexp_eatClassSetOperand(e)){t===mr&&(r=mr);for(var a=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(t=this.regexp_eatClassSetOperand(e))){t!==mr&&(r=Yr);continue}e.raise("Invalid character in character class")}if(a!==e.pos)return r;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(a!==e.pos)return r}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(t=this.regexp_eatClassSetOperand(e),!t)return r;t===mr&&(r=mr)}};V.regexp_eatClassSetRange=function(e){var r=e.pos;if(this.regexp_eatClassSetCharacter(e)){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var a=e.lastIntValue;return t!==-1&&a!==-1&&t>a&&e.raise("Range out of order in character class"),!0}e.pos=r}return!1};V.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?Yr:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};V.regexp_eatNestedClass=function(e){var r=e.pos;if(e.eat(91)){var t=e.eat(94),a=this.regexp_classContents(e);if(e.eat(93))return t&&a===mr&&e.raise("Negated character class may contain strings"),a;e.pos=r}if(e.eat(92)){var n=this.regexp_eatCharacterClassEscape(e);if(n)return n;e.pos=r}return null};V.regexp_eatClassStringDisjunction=function(e){var r=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var t=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return t}else e.raise("Invalid escape");e.pos=r}return null};V.regexp_classStringDisjunctionContents=function(e){for(var r=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===mr&&(r=mr);return r};V.regexp_classString=function(e){for(var r=0;this.regexp_eatClassSetCharacter(e);)r++;return r===1?Yr:mr};V.regexp_eatClassSetCharacter=function(e){var r=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=r,!1);var t=e.current();return t<0||t===e.lookahead()&&eoe(t)||roe(t)?!1:(e.advance(),e.lastIntValue=t,!0)};function eoe(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function roe(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}V.regexp_eatClassSetReservedPunctuator=function(e){var r=e.current();return toe(r)?(e.lastIntValue=r,e.advance(),!0):!1};function toe(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}V.regexp_eatClassControlLetter=function(e){var r=e.current();return di(r)||r===95?(e.lastIntValue=r%32,e.advance(),!0):!1};V.regexp_eatHexEscapeSequence=function(e){var r=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=r}return!1};V.regexp_eatDecimalDigits=function(e){var r=e.pos,t=0;for(e.lastIntValue=0;di(t=e.current());)e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();return e.pos!==r};function di(e){return e>=48&&e<=57}V.regexp_eatHexDigits=function(e){var r=e.pos,t=0;for(e.lastIntValue=0;zg(t=e.current());)e.lastIntValue=16*e.lastIntValue+Hg(t),e.advance();return e.pos!==r};function zg(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Hg(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}V.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var r=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;r<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=r*64+t*8+e.lastIntValue:e.lastIntValue=r*8+t}else e.lastIntValue=r;return!0}return!1};V.regexp_eatOctalDigit=function(e){var r=e.current();return Gg(r)?(e.lastIntValue=r-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Gg(e){return e>=48&&e<=55}V.regexp_eatFixedHexDigits=function(e,r){var t=e.pos;e.lastIntValue=0;for(var a=0;a=this.input.length)return this.finishToken(d.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};ue.readToken=function(e){return Wr(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};ue.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var r=this.input.charCodeAt(this.pos+1);return r<=56319||r>=57344?e:(e<<10)+r-56613888};ue.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),r=this.pos,t=this.input.indexOf("*/",this.pos+=2);if(t===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=t+2,this.options.locations)for(var a=void 0,n=r;(a=vg(this.input,n,this.pos))>-1;)++this.curLine,n=this.lineStart=a;this.options.onComment&&this.options.onComment(!0,this.input.slice(r+2,t),r,this.pos,e,this.curPosition())};ue.skipLineComment=function(e){for(var r=this.pos,t=this.options.onComment&&this.curPosition(),a=this.input.charCodeAt(this.pos+=e);this.pos8&&e<14||e>=5760&&mg.test(String.fromCharCode(e)))++this.pos;else break e}}};ue.finishToken=function(e,r){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var t=this.type;this.type=e,this.value=r,this.updateContext(t)};ue.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var r=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&r===46?(this.pos+=3,this.finishToken(d.ellipsis)):(++this.pos,this.finishToken(d.dot))};ue.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(d.assign,2):this.finishOp(d.slash,1)};ue.readToken_mult_modulo_exp=function(e){var r=this.input.charCodeAt(this.pos+1),t=1,a=e===42?d.star:d.modulo;return this.options.ecmaVersion>=7&&e===42&&r===42&&(++t,a=d.starstar,r=this.input.charCodeAt(this.pos+2)),r===61?this.finishOp(d.assign,t+1):this.finishOp(a,t)};ue.readToken_pipe_amp=function(e){var r=this.input.charCodeAt(this.pos+1);if(r===e){if(this.options.ecmaVersion>=12){var t=this.input.charCodeAt(this.pos+2);if(t===61)return this.finishOp(d.assign,3)}return this.finishOp(e===124?d.logicalOR:d.logicalAND,2)}return r===61?this.finishOp(d.assign,2):this.finishOp(e===124?d.bitwiseOR:d.bitwiseAND,1)};ue.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(d.assign,2):this.finishOp(d.bitwiseXOR,1)};ue.readToken_plus_min=function(e){var r=this.input.charCodeAt(this.pos+1);return r===e?r===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||yr.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(d.incDec,2):r===61?this.finishOp(d.assign,2):this.finishOp(d.plusMin,1)};ue.readToken_lt_gt=function(e){var r=this.input.charCodeAt(this.pos+1),t=1;return r===e?(t=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+t)===61?this.finishOp(d.assign,t+1):this.finishOp(d.bitShift,t)):r===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(r===61&&(t=2),this.finishOp(d.relational,t))};ue.readToken_eq_excl=function(e){var r=this.input.charCodeAt(this.pos+1);return r===61?this.finishOp(d.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&r===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(d.arrow)):this.finishOp(e===61?d.eq:d.prefix,1)};ue.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var r=this.input.charCodeAt(this.pos+1);if(r===46){var t=this.input.charCodeAt(this.pos+2);if(t<48||t>57)return this.finishOp(d.questionDot,2)}if(r===63){if(e>=12){var a=this.input.charCodeAt(this.pos+2);if(a===61)return this.finishOp(d.assign,3)}return this.finishOp(d.coalesce,2)}}return this.finishOp(d.question,1)};ue.readToken_numberSign=function(){var e=this.options.ecmaVersion,r=35;if(e>=13&&(++this.pos,r=this.fullCharCodeAtPos(),Wr(r,!0)||r===92))return this.finishToken(d.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+ot(r)+"'")};ue.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(d.parenL);case 41:return++this.pos,this.finishToken(d.parenR);case 59:return++this.pos,this.finishToken(d.semi);case 44:return++this.pos,this.finishToken(d.comma);case 91:return++this.pos,this.finishToken(d.bracketL);case 93:return++this.pos,this.finishToken(d.bracketR);case 123:return++this.pos,this.finishToken(d.braceL);case 125:return++this.pos,this.finishToken(d.braceR);case 58:return++this.pos,this.finishToken(d.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(d.backQuote);case 48:var r=this.input.charCodeAt(this.pos+1);if(r===120||r===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(r===111||r===79)return this.readRadixNumber(8);if(r===98||r===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(d.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+ot(e)+"'")};ue.finishOp=function(e,r){var t=this.input.slice(this.pos,this.pos+r);return this.pos+=r,this.finishToken(e,t)};ue.readRegexp=function(){for(var e,r,t=this.pos;;){this.pos>=this.input.length&&this.raise(t,"Unterminated regular expression");var a=this.input.charAt(this.pos);if(yr.test(a)&&this.raise(t,"Unterminated regular expression"),e)e=!1;else{if(a==="[")r=!0;else if(a==="]"&&r)r=!1;else if(a==="/"&&!r)break;e=a==="\\"}++this.pos}var n=this.input.slice(t,this.pos);++this.pos;var i=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(i);var u=this.regexpState||(this.regexpState=new Mr(this));u.reset(t,n,o),this.validateRegExpFlags(u),this.validateRegExpPattern(u);var s=null;try{s=new RegExp(n,o)}catch{}return this.finishToken(d.regexp,{pattern:n,flags:o,value:s})};ue.readInt=function(e,r,t){for(var a=this.options.ecmaVersion>=12&&r===void 0,n=t&&this.input.charCodeAt(this.pos)===48,i=this.pos,o=0,u=0,s=0,l=r??1/0;s=97?p=c-97+10:c>=65?p=c-65+10:c>=48&&c<=57?p=c-48:p=1/0,p>=e)break;u=c,o=o*e+p}return a&&u===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===i||r!=null&&this.pos-i!==r?null:o};function aoe(e,r){return r?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function Wg(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}ue.readRadixNumber=function(e){var r=this.pos;this.pos+=2;var t=this.readInt(e);return t==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(t=Wg(this.input.slice(r,this.pos)),++this.pos):Wr(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(d.num,t)};ue.readNumber=function(e){var r=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(r,"Invalid number");var t=this.pos-r>=2&&this.input.charCodeAt(r)===48;t&&this.strict&&this.raise(r,"Invalid number");var a=this.input.charCodeAt(this.pos);if(!t&&!e&&this.options.ecmaVersion>=11&&a===110){var n=Wg(this.input.slice(r,this.pos));return++this.pos,Wr(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(d.num,n)}t&&/[89]/.test(this.input.slice(r,this.pos))&&(t=!1),a===46&&!t&&(++this.pos,this.readInt(10),a=this.input.charCodeAt(this.pos)),(a===69||a===101)&&!t&&(a=this.input.charCodeAt(++this.pos),(a===43||a===45)&&++this.pos,this.readInt(10)===null&&this.raise(r,"Invalid number")),Wr(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var i=aoe(this.input.slice(r,this.pos),t);return this.finishToken(d.num,i)};ue.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),r;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;r=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,r>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else r=this.readHexChar(4);return r};ue.readString=function(e){for(var r="",t=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var a=this.input.charCodeAt(this.pos);if(a===e)break;a===92?(r+=this.input.slice(t,this.pos),r+=this.readEscapedChar(!1),t=this.pos):a===8232||a===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(ca(a)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return r+=this.input.slice(t,this.pos++),this.finishToken(d.string,r)};var Yg={};ue.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Yg)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};ue.invalidStringToken=function(e,r){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Yg;this.raise(e,r)};ue.readTmplToken=function(){for(var e="",r=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var t=this.input.charCodeAt(this.pos);if(t===96||t===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===d.template||this.type===d.invalidTemplate)?t===36?(this.pos+=2,this.finishToken(d.dollarBraceL)):(++this.pos,this.finishToken(d.backQuote)):(e+=this.input.slice(r,this.pos),this.finishToken(d.template,e));if(t===92)e+=this.input.slice(r,this.pos),e+=this.readEscapedChar(!0),r=this.pos;else if(ca(t)){switch(e+=this.input.slice(r,this.pos),++this.pos,t){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=` `;break;default:e+=String.fromCharCode(t);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),r=this.pos}else++this.pos}};ue.readInvalidTemplateToken=function(){for(;this.pos=48&&r<=55){var a=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],n=parseInt(a,8);return n>255&&(a=a.slice(0,-1),n=parseInt(a,8)),this.pos+=a.length-1,r=this.input.charCodeAt(this.pos),(a!=="0"||r===56||r===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-a.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(n)}return ca(r)?"":String.fromCharCode(r)}};ue.readHexChar=function(e){var r=this.pos,t=this.readInt(16,e);return t===null&&this.invalidStringToken(r,"Bad character escape sequence"),t};ue.readWord1=function(){this.containsEsc=!1;for(var e="",r=!0,t=this.pos,a=this.options.ecmaVersion>=6;this.posthis.should_skip=!0,remove:()=>this.should_remove=!0,replace:r=>this.replacement=r}}replace(r,t,a,n){r&&t&&(a!=null?r[t][a]=n:r[t]=n)}remove(r,t,a){r&&t&&(a!=null?r[t].splice(a,1):delete r[t])}}class soe extends ooe{constructor(r,t){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:a=>this.replacement=a},this.enter=r,this.leave=t}visit(r,t,a,n){if(r){if(this.enter){const o=this.should_skip,u=this.should_remove,s=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,r,t,a,n),this.replacement&&(r=this.replacement,this.replace(t,a,n,r)),this.should_remove&&this.remove(t,a,n);const l=this.should_skip,c=this.should_remove;if(this.should_skip=o,this.should_remove=u,this.replacement=s,l)return r;if(c)return null}let i;for(i in r){const o=r[i];if(o&&typeof o=="object")if(Array.isArray(o)){const u=o;for(let s=0;s({onComment:(t,a,n,i)=>{if(t&&/\n/.test(a)){let o=n;for(;o>0&&r[o-1]!==` -`;)o-=1;let u=o;for(;/[ \t]/.test(r[u]);)u+=1;const s=r.slice(o,u);a=a.replace(new RegExp(`^${s}`,"gm"),"")}e.push({type:t?"Block":"Line",value:a,start:n,end:i})},enter(t){let a;for(;e[0]&&e[0].starts?`#${l}`:u?`@${l}`:i);const n=e[0]||t;a.has_trailing_newline=a.type==="Line"||/\n/.test(r.slice(a.end,n.start)),(t.leadingComments||(t.leadingComments=[])).push(a)}},leave(t){if(e[0]){const a=r.slice(t.end,e[0].start);/^[,) \t]*$/.test(a)&&(t.trailingComments=[e.shift()])}}});var ud={exports:{}};(function(e,r){(function(t,a){a(r)})(pt,function(t){const a=",".charCodeAt(0),n=";".charCodeAt(0),i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=new Uint8Array(64),u=new Uint8Array(128);for(let g=0;g>>=1,h&&(E=-2147483648|-E),x[_]+=E,v}function f(g,v,x){return v>=x?!1:g.charCodeAt(v)!==a}function C(g){g.sort(y)}function y(g,v){return g[0]-v[0]}function D(g){const v=new Int32Array(5),x=1024*16,_=x-36,E=new Uint8Array(x),w=E.subarray(0,_);let b=0,h="";for(let m=0;m0&&(b===x&&(h+=s.decode(E),b=0),E[b++]=n),S.length!==0){v[0]=0;for(let A=0;A_&&(h+=s.decode(w),E.copyWithin(0,_,b),b-=_),A>0&&(E[b++]=a),b=k(E,b,v,M,0),M.length!==1&&(b=k(E,b,v,M,1),b=k(E,b,v,M,2),b=k(E,b,v,M,3),M.length!==4&&(b=k(E,b,v,M,4)))}}}return h+s.decode(E.subarray(0,b))}function k(g,v,x,_,E){const w=_[E];let b=w-x[E];x[E]=w,b=b<0?-b<<1|1:b<<1;do{let h=b&31;b>>>=5,b>0&&(h|=32),g[v++]=o[h]}while(b>0);return v}t.decode=l,t.encode=D,Object.defineProperty(t,"__esModule",{value:!0})})})(ud,ud.exports);var Kg=ud.exports;const uoe={"@":"AT","#":"HASH"},coe=e=>{let r=e[0];for(let t=1;t`_${ld}_${uoe[a]}_${n}`)},cd=(e,r)=>{for(let t=0;t{for(let t=0;t{for(let t=0;t{const{onComment:t}=Qg(e,r);return{ecmaVersion:2022,sourceType:"module",allowAwaitOutsideFunction:!0,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,onComment:t}},doe=(e,r,t,a)=>{a.forEach(o=>{o.value=o.value.replace(Pr,(u,s)=>+s in t?t[+s]:u)});const{enter:n,leave:i}=Qg(a,e);return loe(r,{enter:n,leave(o){if(o.type==="Identifier"){Pr.lastIndex=0;const u=Pr.exec(o.name);if(u)if(u[1]){if(+u[1]in t){let s=t[+u[1]];typeof s=="string"?s={type:"Identifier",name:s,leadingComments:o.leadingComments,trailingComments:o.trailingComments}:typeof s=="number"&&(s={type:"Literal",value:s,leadingComments:o.leadingComments,trailingComments:o.trailingComments}),this.replace(s||Ct)}}else o.name=`${u[2]?"@":"#"}${u[4]}`}if(o.type==="Literal"&&typeof o.value=="string"){Pr.lastIndex=0;const u=o.value.replace(Pr,(l,c)=>+c in t?t[+c]:l),s=u!==o.value;o.value=u,s&&o.raw&&(o.raw=`${o.raw[0]}${JSON.stringify(o.value).slice(1,-1)}${o.raw[o.raw.length-1]}`)}o.type==="TemplateElement"&&(Pr.lastIndex=0,o.value.raw=o.value.raw.replace(Pr,(u,s)=>+s in t?t[+s]:u)),(o.type==="Program"||o.type==="BlockStatement")&&(o.body=cd(o.body,[])),(o.type==="ObjectExpression"||o.type==="ObjectPattern")&&(o.properties=Xg(o.properties,[])),(o.type==="ArrayExpression"||o.type==="ArrayPattern")&&(o.elements=Ea(o.elements,[])),(o.type==="FunctionExpression"||o.type==="FunctionDeclaration"||o.type==="ArrowFunctionExpression")&&(o.params=Ea(o.params,[])),(o.type==="CallExpression"||o.type==="NewExpression")&&(o.arguments=Ea(o.arguments,[])),(o.type==="ImportDeclaration"||o.type==="ExportNamedDeclaration")&&(o.specifiers=Ea(o.specifiers,[])),o.type==="ForStatement"&&(o.init=o.init===Ct?null:o.init,o.test=o.test===Ct?null:o.test,o.update=o.update===Ct?null:o.update),i(o)}})};function Jg(e,...r){const t=coe(e),a=[];try{let n=ioe(t,0,poe(a,t));const i=/\S+/.exec(t.slice(n.end));if(i)throw new Error(`Unexpected token '${i[0]}'`);return n=doe(t,n,r,a),n}catch(n){foe(t,n)}}function foe(e,r){throw Pr.lastIndex=0,e=e.replace(Pr,(t,a,n,i,o)=>n?`@${o}`:i?`#${o}`:"${...}"),console.log(`failed to parse: -${e}`),r}const qn=0,N=1,re=2,qe=3,Ce=4,Nr=5,fi=6,He=7,Ze=8,ee=9,Q=10,Ee=11,oe=12,ke=13,Ja=14,er=15,Re=16,rr=17,jr=18,ir=19,Er=20,De=21,te=22,je=23,gr=24,Ue=25,hoe=0;function Be(e){return e>=48&&e<=57}function st(e){return Be(e)||e>=65&&e<=70||e>=97&&e<=102}function lf(e){return e>=65&&e<=90}function voe(e){return e>=97&&e<=122}function moe(e){return lf(e)||voe(e)}function goe(e){return e>=128}function Gn(e){return moe(e)||goe(e)||e===95}function Zg(e){return Gn(e)||Be(e)||e===45}function boe(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function Wn(e){return e===10||e===13||e===12}function Et(e){return Wn(e)||e===32||e===9}function Ir(e,r){return!(e!==92||Wn(r)||r===hoe)}function $n(e,r,t){return e===45?Gn(r)||r===45||Ir(r,t):Gn(e)?!0:e===92?Ir(e,r):!1}function Vc(e,r,t){return e===43||e===45?Be(r)?2:r===46&&Be(t)?3:0:e===46?Be(r)?2:0:Be(e)?1:0}function eb(e){return e===65279||e===65534?1:0}const pd=new Array(128),yoe=128,Fn=130,rb=131,uf=132,tb=133;for(let e=0;ee.length)return!1;for(let n=r;n=0&&Et(e.charCodeAt(r));r--);return r+1}function sn(e,r){for(;r=55296&&r<=57343||r>1114111)&&(r=65533),String.fromCodePoint(r)}const nb=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token"],woe=16*1024;function Yn(e=null,r){return e===null||e.length0?eb(r.charCodeAt(0)):0,n=Yn(e.lines,t),i=Yn(e.columns,t);let o=e.startLine,u=e.startColumn;for(let s=a;s{}){r=String(r||"");const a=r.length,n=Yn(this.offsetAndType,r.length+1),i=Yn(this.balance,r.length+1);let o=0,u=0,s=0,l=-1;for(this.offsetAndType=null,this.balance=null,t(r,(c,p,f)=>{switch(c){default:i[o]=a;break;case u:{let C=s&cr;for(s=i[C],u=s>>Xr,i[o]=C,i[C++]=o;C>Xr:qn}lookupOffset(r){return r+=this.tokenIndex,r0?r>Xr,this.tokenEnd=t&cr):(this.tokenIndex=this.tokenCount,this.next())}next(){let r=this.tokenIndex+1;r>Xr,this.tokenEnd=r&cr):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=qn,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===ke||this.tokenType===Ue;)this.next()}skipUntilBalanced(r,t){let a=r,n,i;e:for(;a0?this.offsetAndType[a-1]&cr:this.firstCharOffset,t(this.source.charCodeAt(i))){case 1:break e;case 2:a++;break e;default:this.balance[n]===a&&(a=n)}}this.skip(a-this.tokenIndex)}forEachToken(r){for(let t=0,a=this.firstCharOffset;t>Xr;a=o,r(u,n,o,t)}}dump(){const r=new Array(this.tokenCount);return this.forEachToken((t,a,n,i)=>{r[i]={idx:i,type:nb[t],chunk:this.source.substring(a,n),balance:this.balance[i]}}),r}}function vi(e,r){function t(p){return p=e.length){lString(c+C+1).padStart(s)+" |"+f).join(` -`)}const i=e.split(/\r\n?|\n|\f/),o=Math.max(1,r-a)-1,u=Math.min(r+a,i.length+1),s=Math.max(4,String(u).length)+1;let l=0;t+=(Ah.length-1)*(i[r-1].substr(0,t-1).match(/\t/g)||[]).length,t>Wc&&(l=t-kh+3,t=kh-2);for(let c=o;c<=u;c++)c>=0&&c0&&i[c].length>l?"…":"")+i[c].substr(l,Wc-2)+(i[c].length>l+Wc-1?"…":""));return[n(o,r),new Array(t+s+2).join("-")+"^",n(r,u)].filter(Boolean).join(` -`)}function Dh(e,r,t,a,n){return Object.assign(mi("SyntaxError",e),{source:r,offset:t,line:a,column:n,sourceFragment(o){return _h({source:r,line:a,column:n},isNaN(o)?0:o)},get formattedMessage(){return`Parse error: ${e} -`+_h({source:r,line:a,column:n},2)}})}function Doe(e){const r=this.createList();let t=!1;const a={recognizer:e};for(;!this.eof;){switch(this.tokenType){case Ue:this.next();continue;case ke:t=!0,this.next();continue}let n=e.getNode.call(this,a);if(n===void 0)break;t&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,n,r,a),t=!1),r.push(n)}return t&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,r,a),r}const Eh=()=>{},Eoe=33,Soe=35,Yc=59,Sh=123,Rh=0;function Roe(e){return function(){return this[e]()}}function Qc(e){const r=Object.create(null);for(const t in e){const a=e[t],n=a.parse||a;n&&(r[t]=n)}return r}function Poe(e){const r={context:Object.create(null),scope:Object.assign(Object.create(null),e.scope),atrule:Qc(e.atrule),pseudo:Qc(e.pseudo),node:Qc(e.node)};for(const t in e.parseContext)switch(typeof e.parseContext[t]){case"function":r.context[t]=e.parseContext[t];break;case"string":r.context[t]=Roe(e.parseContext[t]);break}return{config:r,...r,...r.node}}function qoe(e){let r="",t="",a=!1,n=Eh,i=!1;const o=new koe,u=Object.assign(new _oe,Poe(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:Doe,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(l){return l===Sh?1:0},consumeUntilLeftCurlyBracketOrSemicolon(l){return l===Sh||l===Yc?1:0},consumeUntilExclamationMarkOrSemicolon(l){return l===Eoe||l===Yc?1:0},consumeUntilSemicolonIncluded(l){return l===Yc?2:0},createList(){return new Ie},createSingleNodeList(l){return new Ie().appendData(l)},getFirstListNode(l){return l&&l.first},getLastListNode(l){return l&&l.last},parseWithFallback(l,c){const p=this.tokenIndex;try{return l.call(this)}catch(f){if(i)throw f;const C=c.call(this,p);return i=!0,n(f,C),i=!1,C}},lookupNonWSType(l){let c;do if(c=this.lookupType(l++),c!==ke)return c;while(c!==Rh);return Rh},charCodeAt(l){return l>=0&&lC.toUpperCase());let p=`${/[[\](){}]/.test(c)?`"${c}"`:c} is expected`,f=this.tokenStart;switch(l){case N:this.tokenType===re||this.tokenType===He?(f=this.tokenEnd-1,p="Identifier is expected but function found"):p="Identifier is expected";break;case Ce:this.isDelim(Soe)&&(this.next(),f++,p="Name is expected");break;case Ee:this.tokenType===Q&&(f=this.tokenEnd,p="Percent sign is expected");break}this.error(p,f)}this.next()},eatIdent(l){(this.tokenType!==N||this.lookupValue(0,l)===!1)&&this.error(`Identifier "${l}" is expected`),this.next()},eatDelim(l){this.isDelim(l)||this.error(`Delim "${String.fromCharCode(l)}" is expected`),this.next()},getLocation(l,c){return a?o.getLocationRange(l,c,t):null},getLocationFromList(l){if(a){const c=this.getFirstListNode(l),p=this.getLastListNode(l);return o.getLocationRange(c!==null?c.loc.start.offset-o.startOffset:this.tokenStart,p!==null?p.loc.end.offset-o.startOffset:this.tokenStart,t)}return null},error(l,c){const p=typeof c<"u"&&c",a=!!c.positions,n=typeof c.onParseError=="function"?c.onParseError:Eh,i=!1,u.parseAtrulePrelude="parseAtrulePrelude"in c?!!c.parseAtrulePrelude:!0,u.parseRulePrelude="parseRulePrelude"in c?!!c.parseRulePrelude:!0,u.parseValue="parseValue"in c?!!c.parseValue:!0,u.parseCustomProperty="parseCustomProperty"in c?!!c.parseCustomProperty:!1;const{context:p="default",onComment:f}=c;if(!(p in u.context))throw new Error("Unknown context `"+p+"`");typeof f=="function"&&u.forEachToken((y,D,k)=>{if(y===Ue){const g=u.getLocation(D,k),v=Ua(r,k-2,k,"*/")?r.slice(D+2,k-2):r.slice(D+2,k);f(v,g)}});const C=u.context[p].call(u,c);return u.eof||u.error(),C},{SyntaxError:Dh,config:u.config})}var cf={},pf={},Ph="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");pf.encode=function(e){if(0<=e&&e>1;return r?-t:t}cf.encode=function(r){var t="",a,n=$oe(r);do a=n&sb,n>>>=df,n>0&&(a|=lb),t+=ib.encode(a);while(n>0);return t};cf.decode=function(r,t,a){var n=r.length,i=0,o=0,u,s;do{if(t>=n)throw new Error("Expected more digits in base 64 VLQ value.");if(s=ib.decode(r.charCodeAt(t++)),s===-1)throw new Error("Invalid base64 digit: "+r.charAt(t-1));u=!!(s&lb),s&=sb,i=i+(s<o&&m.pop(),j}}var s=u(function(m){var S=m,A=n(m);if(A){if(!A.path)return m;S=A.path}for(var M=e.isAbsolute(S),j=[],X=0,W=0;;)if(X=W,W=S.indexOf("/",X),W===-1){j.push(S.slice(X));break}else for(j.push(S.slice(X,W));W=0;W--)Z=j[W],Z==="."?j.splice(W,1):Z===".."?pe++:pe>0&&(Z===""?(j.splice(W+1,pe),pe=0):(j.splice(W,2),pe--));return S=j.join("/"),S===""&&(S=M?"/":"."),A?(A.path=S,i(A)):S});e.normalize=s;function l(h,m){h===""&&(h="."),m===""&&(m=".");var S=n(m),A=n(h);if(A&&(h=A.path||"/"),S&&!S.scheme)return A&&(S.scheme=A.scheme),i(S);if(S||m.match(a))return m;if(A&&!A.host&&!A.path)return A.host=m,i(A);var M=m.charAt(0)==="/"?m:s(h.replace(/\/+$/,"")+"/"+m);return A?(A.path=M,i(A)):M}e.join=l,e.isAbsolute=function(h){return h.charAt(0)==="/"||t.test(h)};function c(h,m){h===""&&(h="."),h=h.replace(/\/$/,"");for(var S=0;m.indexOf(h+"/")!==0;){var A=h.lastIndexOf("/");if(A<0||(h=h.slice(0,A),h.match(/^([^\/]+:\/)?\/*$/)))return m;++S}return Array(S+1).join("../")+m.substr(h.length+1)}e.relative=c;var p=function(){var h=Object.create(null);return!("__proto__"in h)}();function f(h){return h}function C(h){return D(h)?"$"+h:h}e.toSetString=p?f:C;function y(h){return D(h)?h.slice(1):h}e.fromSetString=p?f:y;function D(h){if(!h)return!1;var m=h.length;if(m<9||h.charCodeAt(m-1)!==95||h.charCodeAt(m-2)!==95||h.charCodeAt(m-3)!==111||h.charCodeAt(m-4)!==116||h.charCodeAt(m-5)!==111||h.charCodeAt(m-6)!==114||h.charCodeAt(m-7)!==112||h.charCodeAt(m-8)!==95||h.charCodeAt(m-9)!==95)return!1;for(var S=m-10;S>=0;S--)if(h.charCodeAt(S)!==36)return!1;return!0}function k(h,m,S){var A=_(h.source,m.source);return A!==0||(A=h.originalLine-m.originalLine,A!==0)||(A=h.originalColumn-m.originalColumn,A!==0||S)||(A=h.generatedColumn-m.generatedColumn,A!==0)||(A=h.generatedLine-m.generatedLine,A!==0)?A:_(h.name,m.name)}e.compareByOriginalPositions=k;function g(h,m,S){var A;return A=h.originalLine-m.originalLine,A!==0||(A=h.originalColumn-m.originalColumn,A!==0||S)||(A=h.generatedColumn-m.generatedColumn,A!==0)||(A=h.generatedLine-m.generatedLine,A!==0)?A:_(h.name,m.name)}e.compareByOriginalPositionsNoSource=g;function v(h,m,S){var A=h.generatedLine-m.generatedLine;return A!==0||(A=h.generatedColumn-m.generatedColumn,A!==0||S)||(A=_(h.source,m.source),A!==0)||(A=h.originalLine-m.originalLine,A!==0)||(A=h.originalColumn-m.originalColumn,A!==0)?A:_(h.name,m.name)}e.compareByGeneratedPositionsDeflated=v;function x(h,m,S){var A=h.generatedColumn-m.generatedColumn;return A!==0||S||(A=_(h.source,m.source),A!==0)||(A=h.originalLine-m.originalLine,A!==0)||(A=h.originalColumn-m.originalColumn,A!==0)?A:_(h.name,m.name)}e.compareByGeneratedPositionsDeflatedNoLine=x;function _(h,m){return h===m?0:h===null?1:m===null?-1:h>m?1:-1}function E(h,m){var S=h.generatedLine-m.generatedLine;return S!==0||(S=h.generatedColumn-m.generatedColumn,S!==0)||(S=_(h.source,m.source),S!==0)||(S=h.originalLine-m.originalLine,S!==0)||(S=h.originalColumn-m.originalColumn,S!==0)?S:_(h.name,m.name)}e.compareByGeneratedPositionsInflated=E;function w(h){return JSON.parse(h.replace(/^\)]}'[^\n]*\n/,""))}e.parseSourceMapInput=w;function b(h,m,S){if(m=m||"",h&&(h[h.length-1]!=="/"&&m[0]!=="/"&&(h+="/"),m=h+m),S){var A=n(S);if(!A)throw new Error("sourceMapURL could not be parsed");if(A.path){var M=A.path.lastIndexOf("/");M>=0&&(A.path=A.path.substring(0,M+1))}m=l(i(A),m)}return s(m)}e.computeSourceURL=b})(gi);var ub={},ff=gi,hf=Object.prototype.hasOwnProperty,At=typeof Map<"u";function Qr(){this._array=[],this._set=At?new Map:Object.create(null)}Qr.fromArray=function(r,t){for(var a=new Qr,n=0,i=r.length;n=0)return t}else{var a=ff.toSetString(r);if(hf.call(this._set,a))return this._set[a]}throw new Error('"'+r+'" is not in the set.')};Qr.prototype.at=function(r){if(r>=0&&rt||a==t&&i>=n||pb.compareByGeneratedPositionsInflated(e,r)<=0}function bi(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}bi.prototype.unsortedForEach=function(r,t){this._array.forEach(r,t)};bi.prototype.add=function(r){Ooe(this._last,r)?(this._last=r,this._array.push(r)):(this._sorted=!1,this._array.push(r))};bi.prototype.toArray=function(){return this._sorted||(this._array.sort(pb.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};cb.MappingList=bi;var ga=cf,$e=gi,Qn=ub.ArraySet,Toe=cb.MappingList;function br(e){e||(e={}),this._file=$e.getArg(e,"file",null),this._sourceRoot=$e.getArg(e,"sourceRoot",null),this._skipValidation=$e.getArg(e,"skipValidation",!1),this._sources=new Qn,this._names=new Qn,this._mappings=new Toe,this._sourcesContents=null}br.prototype._version=3;br.fromSourceMap=function(r){var t=r.sourceRoot,a=new br({file:r.file,sourceRoot:t});return r.eachMapping(function(n){var i={generated:{line:n.generatedLine,column:n.generatedColumn}};n.source!=null&&(i.source=n.source,t!=null&&(i.source=$e.relative(t,i.source)),i.original={line:n.originalLine,column:n.originalColumn},n.name!=null&&(i.name=n.name)),a.addMapping(i)}),r.sources.forEach(function(n){var i=n;t!==null&&(i=$e.relative(t,n)),a._sources.has(i)||a._sources.add(i);var o=r.sourceContentFor(n);o!=null&&a.setSourceContent(n,o)}),a};br.prototype.addMapping=function(r){var t=$e.getArg(r,"generated"),a=$e.getArg(r,"original",null),n=$e.getArg(r,"source",null),i=$e.getArg(r,"name",null);this._skipValidation||this._validateMapping(t,a,n,i),n!=null&&(n=String(n),this._sources.has(n)||this._sources.add(n)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:a!=null&&a.line,originalColumn:a!=null&&a.column,source:n,name:i})};br.prototype.setSourceContent=function(r,t){var a=r;this._sourceRoot!=null&&(a=$e.relative(this._sourceRoot,a)),t!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[$e.toSetString(a)]=t):this._sourcesContents&&(delete this._sourcesContents[$e.toSetString(a)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};br.prototype.applySourceMap=function(r,t,a){var n=t;if(t==null){if(r.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);n=r.file}var i=this._sourceRoot;i!=null&&(n=$e.relative(i,n));var o=new Qn,u=new Qn;this._mappings.unsortedForEach(function(s){if(s.source===n&&s.originalLine!=null){var l=r.originalPositionFor({line:s.originalLine,column:s.originalColumn});l.source!=null&&(s.source=l.source,a!=null&&(s.source=$e.join(a,s.source)),i!=null&&(s.source=$e.relative(i,s.source)),s.originalLine=l.line,s.originalColumn=l.column,l.name!=null&&(s.name=l.name))}var c=s.source;c!=null&&!o.has(c)&&o.add(c);var p=s.name;p!=null&&!u.has(p)&&u.add(p)},this),this._sources=o,this._names=u,r.sources.forEach(function(s){var l=r.sourceContentFor(s);l!=null&&(a!=null&&(s=$e.join(a,s)),i!=null&&(s=$e.relative(i,s)),this.setSourceContent(s,l))},this)};br.prototype._validateMapping=function(r,t,a,n){if(t&&typeof t.line!="number"&&typeof t.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(r&&"line"in r&&"column"in r&&r.line>0&&r.column>=0&&!t&&!a&&!n)){if(r&&"line"in r&&"column"in r&&t&&"line"in t&&"column"in t&&r.line>0&&r.column>=0&&t.line>0&&t.column>=0&&a)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:r,source:a,original:t,name:n}))}};br.prototype._serializeMappings=function(){for(var r=0,t=1,a=0,n=0,i=0,o=0,u="",s,l,c,p,f=this._mappings.toArray(),C=0,y=f.length;C0){if(!$e.compareByGeneratedPositionsInflated(l,f[C-1]))continue;s+=","}s+=ga.encode(l.generatedColumn-r),r=l.generatedColumn,l.source!=null&&(p=this._sources.indexOf(l.source),s+=ga.encode(p-o),o=p,s+=ga.encode(l.originalLine-1-n),n=l.originalLine-1,s+=ga.encode(l.originalColumn-a),a=l.originalColumn,l.name!=null&&(c=this._names.indexOf(l.name),s+=ga.encode(c-i),i=c)),u+=s}return u};br.prototype._generateSourcesContent=function(r,t){return r.map(function(a){if(!this._sourcesContents)return null;t!=null&&(a=$e.relative(t,a));var n=$e.toSetString(a);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)};br.prototype.toJSON=function(){var r={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(r.file=this._file),this._sourceRoot!=null&&(r.sourceRoot=this._sourceRoot),this._sourcesContents&&(r.sourcesContent=this._generateSourcesContent(r.sources,r.sourceRoot)),r};br.prototype.toString=function(){return JSON.stringify(this.toJSON())};var Loe=br;const qh=new Set(["Atrule","Selector","Declaration"]);function Ioe(e){const r=new Loe,t={line:1,column:0},a={line:0,column:0},n={line:1,column:0},i={generated:n};let o=1,u=0,s=!1;const l=e.node;e.node=function(f){if(f.loc&&f.loc.start&&qh.has(f.type)){const C=f.loc.start.line,y=f.loc.start.column-1;(a.line!==C||a.column!==y)&&(a.line=C,a.column=y,t.line=o,t.column=u,s&&(s=!1,(t.line!==n.line||t.column!==n.column)&&r.addMapping(i)),s=!0,r.addMapping({source:f.loc.source,original:a,generated:t}))}l.call(this,f),s&&qh.has(f.type)&&(n.line=o,n.column=u)};const c=e.emit;e.emit=function(f,C,y){for(let D=0;D{if(e===ee&&(e=r),typeof e=="string"){const t=e.charCodeAt(0);return t>127?32768:t<<8}return e},db=[[N,N],[N,re],[N,He],[N,Ze],[N,"-"],[N,Q],[N,Ee],[N,oe],[N,er],[N,De],[qe,N],[qe,re],[qe,He],[qe,Ze],[qe,"-"],[qe,Q],[qe,Ee],[qe,oe],[qe,er],[Ce,N],[Ce,re],[Ce,He],[Ce,Ze],[Ce,"-"],[Ce,Q],[Ce,Ee],[Ce,oe],[Ce,er],[oe,N],[oe,re],[oe,He],[oe,Ze],[oe,"-"],[oe,Q],[oe,Ee],[oe,oe],[oe,er],["#",N],["#",re],["#",He],["#",Ze],["#","-"],["#",Q],["#",Ee],["#",oe],["#",er],["-",N],["-",re],["-",He],["-",Ze],["-","-"],["-",Q],["-",Ee],["-",oe],["-",er],[Q,N],[Q,re],[Q,He],[Q,Ze],[Q,Q],[Q,Ee],[Q,oe],[Q,"%"],[Q,er],["@",N],["@",re],["@",He],["@",Ze],["@","-"],["@",er],[".",Q],[".",Ee],[".",oe],["+",Q],["+",Ee],["+",oe],["/","*"]],Noe=db.concat([[N,Ce],[oe,Ce],[Ce,Ce],[qe,De],[qe,Nr],[qe,Re],[Ee,Ee],[Ee,oe],[Ee,re],[Ee,"-"],[te,N],[te,re],[te,Ee],[te,oe],[te,Ce],[te,"-"]]);function fb(e){const r=new Set(e.map(([t,a])=>Kc(t)<<16|Kc(a)));return function(t,a,n){const i=Kc(a,n),o=n.charCodeAt(0);return(o===Moe&&a!==N&&a!==re&&a!==er||o===Boe?r.has(t<<16|o<<8):r.has(t<<16|i))&&this.emit(" ",ke,!0),i}}const joe=fb(db),hb=fb(Noe),$h=Object.freeze(Object.defineProperty({__proto__:null,safe:hb,spec:joe},Symbol.toStringTag,{value:"Module"})),Uoe=92;function Voe(e,r){if(typeof r=="function"){let t=null;e.children.forEach(a=>{t!==null&&r.call(this,t),this.node(a),t=a});return}e.children.forEach(this.node,this)}function zoe(e){vi(e,(r,t,a)=>{this.token(r,e.slice(t,a))})}function Hoe(e){const r=new Map;for(let t in e.node){const a=e.node[t];typeof(a.generate||a)=="function"&&r.set(t,a.generate||a)}return function(t,a){let n="",i=0,o={node(s){if(r.has(s.type))r.get(s.type).call(u,s);else throw new Error("Unknown node type: "+s.type)},tokenBefore:hb,token(s,l){i=this.tokenBefore(i,s,l),this.emit(l,s,!1),s===ee&&l.charCodeAt(0)===Uoe&&this.emit(` -`,ke,!0)},emit(s){n+=s},result(){return n}};a&&(typeof a.decorator=="function"&&(o=a.decorator(o)),a.sourceMap&&(o=Ioe(o)),a.mode in $h&&(o.tokenBefore=$h[a.mode]));const u={node:s=>o.node(s),children:Voe,token:(s,l)=>o.token(s,l),tokenize:zoe};return o.node(t),o.result()}}function Goe(e){return{fromPlainObject(r){return e(r,{enter(t){t.children&&!(t.children instanceof Ie)&&(t.children=new Ie().fromArray(t.children))}}),r},toPlainObject(r){return e(r,{leave(t){t.children&&t.children instanceof Ie&&(t.children=t.children.toArray())}}),r}}}const{hasOwnProperty:vf}=Object.prototype,Sa=function(){};function Fh(e){return typeof e=="function"?e:Sa}function Oh(e,r){return function(t,a,n){t.type===r&&e.call(this,t,a,n)}}function Woe(e,r){const t=r.structure,a=[];for(const n in t){if(vf.call(t,n)===!1)continue;let i=t[n];const o={name:n,type:!1,nullable:!1};Array.isArray(i)||(i=[i]);for(const u of i)u===null?o.nullable=!0:typeof u=="string"?o.type="node":Array.isArray(u)&&(o.type="list");o.type&&a.push(o)}return a.length?{context:r.walkContext,fields:a}:null}function Yoe(e){const r={};for(const t in e.node)if(vf.call(e.node,t)){const a=e.node[t];if(!a.structure)throw new Error("Missed `structure` field in `"+t+"` node type definition");r[t]=Woe(t,a)}return r}function Th(e,r){const t=e.fields.slice(),a=e.context,n=typeof a=="string";return r&&t.reverse(),function(i,o,u,s){let l;n&&(l=o[a],o[a]=i);for(const c of t){const p=i[c.name];if(!c.nullable||p){if(c.type==="list"){if(r?p.reduceRight(s,!1):p.reduce(s,!1))return!0}else if(u(p))return!0}}n&&(o[a]=l)}}function Lh({StyleSheet:e,Atrule:r,Rule:t,Block:a,DeclarationList:n}){return{Atrule:{StyleSheet:e,Atrule:r,Rule:t,Block:a},Rule:{StyleSheet:e,Atrule:r,Rule:t,Block:a},Declaration:{StyleSheet:e,Atrule:r,Rule:t,Block:a,DeclarationList:n}}}function Qoe(e){const r=Yoe(e),t={},a={},n=Symbol("break-walk"),i=Symbol("skip-node");for(const l in r)vf.call(r,l)&&r[l]!==null&&(t[l]=Th(r[l],!1),a[l]=Th(r[l],!0));const o=Lh(t),u=Lh(a),s=function(l,c){function p(g,v,x){const _=f.call(k,g,v,x);return _===n?!0:_===i?!1:!!(y.hasOwnProperty(g.type)&&y[g.type](g,k,p,D)||C.call(k,g,v,x)===n)}let f=Sa,C=Sa,y=t,D=(g,v,x,_)=>g||p(v,x,_);const k={break:n,skip:i,root:l,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof c=="function")f=c;else if(c&&(f=Fh(c.enter),C=Fh(c.leave),c.reverse&&(y=a),c.visit)){if(o.hasOwnProperty(c.visit))y=c.reverse?u[c.visit]:o[c.visit];else if(!r.hasOwnProperty(c.visit))throw new Error("Bad value `"+c.visit+"` for `visit` option (should be: "+Object.keys(r).sort().join(", ")+")");f=Oh(f,c.visit),C=Oh(C,c.visit)}if(f===Sa&&C===Sa)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");p(l)};return s.break=n,s.skip=i,s.find=function(l,c){let p=null;return s(l,function(f,C,y){if(c.call(this,f,C,y))return p=f,n}),p},s.findLast=function(l,c){let p=null;return s(l,{reverse:!0,enter(f,C,y){if(c.call(this,f,C,y))return p=f,n}}),p},s.findAll=function(l,c){const p=[];return s(l,function(f,C,y){c.call(this,f,C,y)&&p.push(f)}),p},s}function Koe(e){return e}function Xoe(e){const{min:r,max:t,comma:a}=e;return r===0&&t===0?a?"#?":"*":r===0&&t===1?"?":r===1&&t===0?a?"#":"+":r===1&&t===1?"":(a?"#":"")+(r===t?"{"+r+"}":"{"+r+","+(t!==0?t:"")+"}")}function Joe(e){switch(e.type){case"Range":return" ["+(e.min===null?"-∞":e.min)+","+(e.max===null?"∞":e.max)+"]";default:throw new Error("Unknown node type `"+e.type+"`")}}function Zoe(e,r,t,a){const n=e.combinator===" "||a?e.combinator:" "+e.combinator+" ",i=e.terms.map(o=>mf(o,r,t,a)).join(n);return e.explicit||t?(a||i[0]===","?"[":"[ ")+i+(a?"]":" ]"):i}function mf(e,r,t,a){let n;switch(e.type){case"Group":n=Zoe(e,r,t,a)+(e.disallowEmpty?"!":"");break;case"Multiplier":return mf(e.term,r,t,a)+r(Xoe(e),e);case"Type":n="<"+e.name+(e.opts?r(Joe(e.opts),e.opts):"")+">";break;case"Property":n="<'"+e.name+"'>";break;case"Keyword":n=e.name;break;case"AtKeyword":n="@"+e.name;break;case"Function":n=e.name+"(";break;case"String":case"Token":n=e.value;break;case"Comma":n=",";break;default:throw new Error("Unknown node type `"+e.type+"`")}return r(n,e)}function gf(e,r){let t=Koe,a=!1,n=!1;return typeof r=="function"?t=r:r&&(a=!!r.forceBraces,n=!!r.compact,typeof r.decorate=="function"&&(t=r.decorate)),mf(e,t,a,n)}const Ih={offset:0,line:1,column:1};function ese(e,r){const t=e.tokens,a=e.longestMatch,n=a1?(c=un(i||r,"end")||Ra(Ih,l),p=Ra(c)):(c=un(i,"start")||Ra(un(r,"start")||Ih,l.slice(0,o)),p=un(i,"end")||Ra(c,l.substr(o,u))),{css:l,mismatchOffset:o,mismatchLength:u,start:c,end:p}}function un(e,r){const t=e&&e.loc&&e.loc[r];return t?"line"in t?Ra(t):t:null}function Ra({offset:e,line:r,column:t},a){const n={offset:e,line:r,column:t};if(a){const i=a.split(/\n|\r\n?|\f/);n.offset+=a.length,n.line+=i.length-1,n.column=i.length===1?n.column+a.length:i.pop().length+1}return n}const ba=function(e,r){const t=mi("SyntaxReferenceError",e+(r?" `"+r+"`":""));return t.reference=r,t},rse=function(e,r,t,a){const n=mi("SyntaxMatchError",e),{css:i,mismatchOffset:o,mismatchLength:u,start:s,end:l}=ese(a,t);return n.rawMessage=e,n.syntax=r?gf(r):"",n.css=i,n.mismatchOffset=o,n.mismatchLength=u,n.message=e+` +`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return ot(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var t=this.pos-1;this.invalidStringToken(t,"Invalid escape sequence in template string")}default:if(r>=48&&r<=55){var a=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],n=parseInt(a,8);return n>255&&(a=a.slice(0,-1),n=parseInt(a,8)),this.pos+=a.length-1,r=this.input.charCodeAt(this.pos),(a!=="0"||r===56||r===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-a.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(n)}return ca(r)?"":String.fromCharCode(r)}};ue.readHexChar=function(e){var r=this.pos,t=this.readInt(16,e);return t===null&&this.invalidStringToken(r,"Bad character escape sequence"),t};ue.readWord1=function(){this.containsEsc=!1;for(var e="",r=!0,t=this.pos,a=this.options.ecmaVersion>=6;this.posthis.should_skip=!0,remove:()=>this.should_remove=!0,replace:r=>this.replacement=r}}replace(r,t,a,n){r&&t&&(a!=null?r[t][a]=n:r[t]=n)}remove(r,t,a){r&&t&&(a!=null?r[t].splice(a,1):delete r[t])}}class soe extends ooe{constructor(r,t){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:a=>this.replacement=a},this.enter=r,this.leave=t}visit(r,t,a,n){if(r){if(this.enter){const o=this.should_skip,u=this.should_remove,s=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,r,t,a,n),this.replacement&&(r=this.replacement,this.replace(t,a,n,r)),this.should_remove&&this.remove(t,a,n);const l=this.should_skip,c=this.should_remove;if(this.should_skip=o,this.should_remove=u,this.replacement=s,l)return r;if(c)return null}let i;for(i in r){const o=r[i];if(o&&typeof o=="object")if(Array.isArray(o)){const u=o;for(let s=0;s({onComment:(t,a,n,i)=>{if(t&&/\n/.test(a)){let o=n;for(;o>0&&r[o-1]!==` +`;)o-=1;let u=o;for(;/[ \t]/.test(r[u]);)u+=1;const s=r.slice(o,u);a=a.replace(new RegExp(`^${s}`,"gm"),"")}e.push({type:t?"Block":"Line",value:a,start:n,end:i})},enter(t){let a;for(;e[0]&&e[0].starts?`#${l}`:u?`@${l}`:i);const n=e[0]||t;a.has_trailing_newline=a.type==="Line"||/\n/.test(r.slice(a.end,n.start)),(t.leadingComments||(t.leadingComments=[])).push(a)}},leave(t){if(e[0]){const a=r.slice(t.end,e[0].start);/^[,) \t]*$/.test(a)&&(t.trailingComments=[e.shift()])}}});var cd={exports:{}};(function(e,r){(function(t,a){a(r)})(pt,function(t){const a=",".charCodeAt(0),n=";".charCodeAt(0),i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=new Uint8Array(64),u=new Uint8Array(128);for(let g=0;g>>=1,h&&(E=-2147483648|-E),x[_]+=E,v}function f(g,v,x){return v>=x?!1:g.charCodeAt(v)!==a}function C(g){g.sort(y)}function y(g,v){return g[0]-v[0]}function D(g){const v=new Int32Array(5),x=1024*16,_=x-36,E=new Uint8Array(x),w=E.subarray(0,_);let b=0,h="";for(let m=0;m0&&(b===x&&(h+=s.decode(E),b=0),E[b++]=n),S.length!==0){v[0]=0;for(let A=0;A_&&(h+=s.decode(w),E.copyWithin(0,_,b),b-=_),A>0&&(E[b++]=a),b=k(E,b,v,M,0),M.length!==1&&(b=k(E,b,v,M,1),b=k(E,b,v,M,2),b=k(E,b,v,M,3),M.length!==4&&(b=k(E,b,v,M,4)))}}}return h+s.decode(E.subarray(0,b))}function k(g,v,x,_,E){const w=_[E];let b=w-x[E];x[E]=w,b=b<0?-b<<1|1:b<<1;do{let h=b&31;b>>>=5,b>0&&(h|=32),g[v++]=o[h]}while(b>0);return v}t.decode=l,t.encode=D,Object.defineProperty(t,"__esModule",{value:!0})})})(cd,cd.exports);var Kg=cd.exports;const uoe={"@":"AT","#":"HASH"},coe=e=>{let r=e[0];for(let t=1;t`_${ud}_${uoe[a]}_${n}`)},pd=(e,r)=>{for(let t=0;t{for(let t=0;t{for(let t=0;t{const{onComment:t}=Qg(e,r);return{ecmaVersion:2022,sourceType:"module",allowAwaitOutsideFunction:!0,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,onComment:t}},doe=(e,r,t,a)=>{a.forEach(o=>{o.value=o.value.replace(Pr,(u,s)=>+s in t?t[+s]:u)});const{enter:n,leave:i}=Qg(a,e);return loe(r,{enter:n,leave(o){if(o.type==="Identifier"){Pr.lastIndex=0;const u=Pr.exec(o.name);if(u)if(u[1]){if(+u[1]in t){let s=t[+u[1]];typeof s=="string"?s={type:"Identifier",name:s,leadingComments:o.leadingComments,trailingComments:o.trailingComments}:typeof s=="number"&&(s={type:"Literal",value:s,leadingComments:o.leadingComments,trailingComments:o.trailingComments}),this.replace(s||Ct)}}else o.name=`${u[2]?"@":"#"}${u[4]}`}if(o.type==="Literal"&&typeof o.value=="string"){Pr.lastIndex=0;const u=o.value.replace(Pr,(l,c)=>+c in t?t[+c]:l),s=u!==o.value;o.value=u,s&&o.raw&&(o.raw=`${o.raw[0]}${JSON.stringify(o.value).slice(1,-1)}${o.raw[o.raw.length-1]}`)}o.type==="TemplateElement"&&(Pr.lastIndex=0,o.value.raw=o.value.raw.replace(Pr,(u,s)=>+s in t?t[+s]:u)),(o.type==="Program"||o.type==="BlockStatement")&&(o.body=pd(o.body,[])),(o.type==="ObjectExpression"||o.type==="ObjectPattern")&&(o.properties=Xg(o.properties,[])),(o.type==="ArrayExpression"||o.type==="ArrayPattern")&&(o.elements=Ea(o.elements,[])),(o.type==="FunctionExpression"||o.type==="FunctionDeclaration"||o.type==="ArrowFunctionExpression")&&(o.params=Ea(o.params,[])),(o.type==="CallExpression"||o.type==="NewExpression")&&(o.arguments=Ea(o.arguments,[])),(o.type==="ImportDeclaration"||o.type==="ExportNamedDeclaration")&&(o.specifiers=Ea(o.specifiers,[])),o.type==="ForStatement"&&(o.init=o.init===Ct?null:o.init,o.test=o.test===Ct?null:o.test,o.update=o.update===Ct?null:o.update),i(o)}})};function Jg(e,...r){const t=coe(e),a=[];try{let n=ioe(t,0,poe(a,t));const i=/\S+/.exec(t.slice(n.end));if(i)throw new Error(`Unexpected token '${i[0]}'`);return n=doe(t,n,r,a),n}catch(n){foe(t,n)}}function foe(e,r){throw Pr.lastIndex=0,e=e.replace(Pr,(t,a,n,i,o)=>n?`@${o}`:i?`#${o}`:"${...}"),console.log(`failed to parse: +${e}`),r}const qn=0,N=1,re=2,qe=3,Ce=4,Nr=5,fi=6,He=7,Ze=8,ee=9,Q=10,Ee=11,oe=12,ke=13,Ja=14,er=15,Re=16,rr=17,jr=18,ir=19,Er=20,De=21,te=22,je=23,gr=24,Ue=25,hoe=0;function Be(e){return e>=48&&e<=57}function st(e){return Be(e)||e>=65&&e<=70||e>=97&&e<=102}function uf(e){return e>=65&&e<=90}function voe(e){return e>=97&&e<=122}function moe(e){return uf(e)||voe(e)}function goe(e){return e>=128}function Gn(e){return moe(e)||goe(e)||e===95}function Zg(e){return Gn(e)||Be(e)||e===45}function boe(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function Wn(e){return e===10||e===13||e===12}function Et(e){return Wn(e)||e===32||e===9}function Ir(e,r){return!(e!==92||Wn(r)||r===hoe)}function $n(e,r,t){return e===45?Gn(r)||r===45||Ir(r,t):Gn(e)?!0:e===92?Ir(e,r):!1}function Vc(e,r,t){return e===43||e===45?Be(r)?2:r===46&&Be(t)?3:0:e===46?Be(r)?2:0:Be(e)?1:0}function eb(e){return e===65279||e===65534?1:0}const dd=new Array(128),yoe=128,Fn=130,rb=131,cf=132,tb=133;for(let e=0;ee.length)return!1;for(let n=r;n=0&&Et(e.charCodeAt(r));r--);return r+1}function sn(e,r){for(;r=55296&&r<=57343||r>1114111)&&(r=65533),String.fromCodePoint(r)}const nb=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token"],woe=16*1024;function Yn(e=null,r){return e===null||e.length0?eb(r.charCodeAt(0)):0,n=Yn(e.lines,t),i=Yn(e.columns,t);let o=e.startLine,u=e.startColumn;for(let s=a;s{}){r=String(r||"");const a=r.length,n=Yn(this.offsetAndType,r.length+1),i=Yn(this.balance,r.length+1);let o=0,u=0,s=0,l=-1;for(this.offsetAndType=null,this.balance=null,t(r,(c,p,f)=>{switch(c){default:i[o]=a;break;case u:{let C=s&cr;for(s=i[C],u=s>>Xr,i[o]=C,i[C++]=o;C>Xr:qn}lookupOffset(r){return r+=this.tokenIndex,r0?r>Xr,this.tokenEnd=t&cr):(this.tokenIndex=this.tokenCount,this.next())}next(){let r=this.tokenIndex+1;r>Xr,this.tokenEnd=r&cr):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=qn,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===ke||this.tokenType===Ue;)this.next()}skipUntilBalanced(r,t){let a=r,n,i;e:for(;a0?this.offsetAndType[a-1]&cr:this.firstCharOffset,t(this.source.charCodeAt(i))){case 1:break e;case 2:a++;break e;default:this.balance[n]===a&&(a=n)}}this.skip(a-this.tokenIndex)}forEachToken(r){for(let t=0,a=this.firstCharOffset;t>Xr;a=o,r(u,n,o,t)}}dump(){const r=new Array(this.tokenCount);return this.forEachToken((t,a,n,i)=>{r[i]={idx:i,type:nb[t],chunk:this.source.substring(a,n),balance:this.balance[i]}}),r}}function vi(e,r){function t(p){return p=e.length){lString(c+C+1).padStart(s)+" |"+f).join(` +`)}const i=e.split(/\r\n?|\n|\f/),o=Math.max(1,r-a)-1,u=Math.min(r+a,i.length+1),s=Math.max(4,String(u).length)+1;let l=0;t+=(_h.length-1)*(i[r-1].substr(0,t-1).match(/\t/g)||[]).length,t>Wc&&(l=t-Ah+3,t=Ah-2);for(let c=o;c<=u;c++)c>=0&&c0&&i[c].length>l?"…":"")+i[c].substr(l,Wc-2)+(i[c].length>l+Wc-1?"…":""));return[n(o,r),new Array(t+s+2).join("-")+"^",n(r,u)].filter(Boolean).join(` +`)}function Eh(e,r,t,a,n){return Object.assign(mi("SyntaxError",e),{source:r,offset:t,line:a,column:n,sourceFragment(o){return Dh({source:r,line:a,column:n},isNaN(o)?0:o)},get formattedMessage(){return`Parse error: ${e} +`+Dh({source:r,line:a,column:n},2)}})}function Doe(e){const r=this.createList();let t=!1;const a={recognizer:e};for(;!this.eof;){switch(this.tokenType){case Ue:this.next();continue;case ke:t=!0,this.next();continue}let n=e.getNode.call(this,a);if(n===void 0)break;t&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,n,r,a),t=!1),r.push(n)}return t&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,r,a),r}const Sh=()=>{},Eoe=33,Soe=35,Yc=59,Rh=123,Ph=0;function Roe(e){return function(){return this[e]()}}function Qc(e){const r=Object.create(null);for(const t in e){const a=e[t],n=a.parse||a;n&&(r[t]=n)}return r}function Poe(e){const r={context:Object.create(null),scope:Object.assign(Object.create(null),e.scope),atrule:Qc(e.atrule),pseudo:Qc(e.pseudo),node:Qc(e.node)};for(const t in e.parseContext)switch(typeof e.parseContext[t]){case"function":r.context[t]=e.parseContext[t];break;case"string":r.context[t]=Roe(e.parseContext[t]);break}return{config:r,...r,...r.node}}function qoe(e){let r="",t="",a=!1,n=Sh,i=!1;const o=new koe,u=Object.assign(new _oe,Poe(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:Doe,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(l){return l===Rh?1:0},consumeUntilLeftCurlyBracketOrSemicolon(l){return l===Rh||l===Yc?1:0},consumeUntilExclamationMarkOrSemicolon(l){return l===Eoe||l===Yc?1:0},consumeUntilSemicolonIncluded(l){return l===Yc?2:0},createList(){return new Ie},createSingleNodeList(l){return new Ie().appendData(l)},getFirstListNode(l){return l&&l.first},getLastListNode(l){return l&&l.last},parseWithFallback(l,c){const p=this.tokenIndex;try{return l.call(this)}catch(f){if(i)throw f;const C=c.call(this,p);return i=!0,n(f,C),i=!1,C}},lookupNonWSType(l){let c;do if(c=this.lookupType(l++),c!==ke)return c;while(c!==Ph);return Ph},charCodeAt(l){return l>=0&&lC.toUpperCase());let p=`${/[[\](){}]/.test(c)?`"${c}"`:c} is expected`,f=this.tokenStart;switch(l){case N:this.tokenType===re||this.tokenType===He?(f=this.tokenEnd-1,p="Identifier is expected but function found"):p="Identifier is expected";break;case Ce:this.isDelim(Soe)&&(this.next(),f++,p="Name is expected");break;case Ee:this.tokenType===Q&&(f=this.tokenEnd,p="Percent sign is expected");break}this.error(p,f)}this.next()},eatIdent(l){(this.tokenType!==N||this.lookupValue(0,l)===!1)&&this.error(`Identifier "${l}" is expected`),this.next()},eatDelim(l){this.isDelim(l)||this.error(`Delim "${String.fromCharCode(l)}" is expected`),this.next()},getLocation(l,c){return a?o.getLocationRange(l,c,t):null},getLocationFromList(l){if(a){const c=this.getFirstListNode(l),p=this.getLastListNode(l);return o.getLocationRange(c!==null?c.loc.start.offset-o.startOffset:this.tokenStart,p!==null?p.loc.end.offset-o.startOffset:this.tokenStart,t)}return null},error(l,c){const p=typeof c<"u"&&c",a=!!c.positions,n=typeof c.onParseError=="function"?c.onParseError:Sh,i=!1,u.parseAtrulePrelude="parseAtrulePrelude"in c?!!c.parseAtrulePrelude:!0,u.parseRulePrelude="parseRulePrelude"in c?!!c.parseRulePrelude:!0,u.parseValue="parseValue"in c?!!c.parseValue:!0,u.parseCustomProperty="parseCustomProperty"in c?!!c.parseCustomProperty:!1;const{context:p="default",onComment:f}=c;if(!(p in u.context))throw new Error("Unknown context `"+p+"`");typeof f=="function"&&u.forEachToken((y,D,k)=>{if(y===Ue){const g=u.getLocation(D,k),v=Ua(r,k-2,k,"*/")?r.slice(D+2,k-2):r.slice(D+2,k);f(v,g)}});const C=u.context[p].call(u,c);return u.eof||u.error(),C},{SyntaxError:Eh,config:u.config})}var pf={},df={},qh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");df.encode=function(e){if(0<=e&&e>1;return r?-t:t}pf.encode=function(r){var t="",a,n=$oe(r);do a=n&sb,n>>>=ff,n>0&&(a|=lb),t+=ib.encode(a);while(n>0);return t};pf.decode=function(r,t,a){var n=r.length,i=0,o=0,u,s;do{if(t>=n)throw new Error("Expected more digits in base 64 VLQ value.");if(s=ib.decode(r.charCodeAt(t++)),s===-1)throw new Error("Invalid base64 digit: "+r.charAt(t-1));u=!!(s&lb),s&=sb,i=i+(s<o&&m.pop(),j}}var s=u(function(m){var S=m,A=n(m);if(A){if(!A.path)return m;S=A.path}for(var M=e.isAbsolute(S),j=[],X=0,W=0;;)if(X=W,W=S.indexOf("/",X),W===-1){j.push(S.slice(X));break}else for(j.push(S.slice(X,W));W=0;W--)Z=j[W],Z==="."?j.splice(W,1):Z===".."?pe++:pe>0&&(Z===""?(j.splice(W+1,pe),pe=0):(j.splice(W,2),pe--));return S=j.join("/"),S===""&&(S=M?"/":"."),A?(A.path=S,i(A)):S});e.normalize=s;function l(h,m){h===""&&(h="."),m===""&&(m=".");var S=n(m),A=n(h);if(A&&(h=A.path||"/"),S&&!S.scheme)return A&&(S.scheme=A.scheme),i(S);if(S||m.match(a))return m;if(A&&!A.host&&!A.path)return A.host=m,i(A);var M=m.charAt(0)==="/"?m:s(h.replace(/\/+$/,"")+"/"+m);return A?(A.path=M,i(A)):M}e.join=l,e.isAbsolute=function(h){return h.charAt(0)==="/"||t.test(h)};function c(h,m){h===""&&(h="."),h=h.replace(/\/$/,"");for(var S=0;m.indexOf(h+"/")!==0;){var A=h.lastIndexOf("/");if(A<0||(h=h.slice(0,A),h.match(/^([^\/]+:\/)?\/*$/)))return m;++S}return Array(S+1).join("../")+m.substr(h.length+1)}e.relative=c;var p=function(){var h=Object.create(null);return!("__proto__"in h)}();function f(h){return h}function C(h){return D(h)?"$"+h:h}e.toSetString=p?f:C;function y(h){return D(h)?h.slice(1):h}e.fromSetString=p?f:y;function D(h){if(!h)return!1;var m=h.length;if(m<9||h.charCodeAt(m-1)!==95||h.charCodeAt(m-2)!==95||h.charCodeAt(m-3)!==111||h.charCodeAt(m-4)!==116||h.charCodeAt(m-5)!==111||h.charCodeAt(m-6)!==114||h.charCodeAt(m-7)!==112||h.charCodeAt(m-8)!==95||h.charCodeAt(m-9)!==95)return!1;for(var S=m-10;S>=0;S--)if(h.charCodeAt(S)!==36)return!1;return!0}function k(h,m,S){var A=_(h.source,m.source);return A!==0||(A=h.originalLine-m.originalLine,A!==0)||(A=h.originalColumn-m.originalColumn,A!==0||S)||(A=h.generatedColumn-m.generatedColumn,A!==0)||(A=h.generatedLine-m.generatedLine,A!==0)?A:_(h.name,m.name)}e.compareByOriginalPositions=k;function g(h,m,S){var A;return A=h.originalLine-m.originalLine,A!==0||(A=h.originalColumn-m.originalColumn,A!==0||S)||(A=h.generatedColumn-m.generatedColumn,A!==0)||(A=h.generatedLine-m.generatedLine,A!==0)?A:_(h.name,m.name)}e.compareByOriginalPositionsNoSource=g;function v(h,m,S){var A=h.generatedLine-m.generatedLine;return A!==0||(A=h.generatedColumn-m.generatedColumn,A!==0||S)||(A=_(h.source,m.source),A!==0)||(A=h.originalLine-m.originalLine,A!==0)||(A=h.originalColumn-m.originalColumn,A!==0)?A:_(h.name,m.name)}e.compareByGeneratedPositionsDeflated=v;function x(h,m,S){var A=h.generatedColumn-m.generatedColumn;return A!==0||S||(A=_(h.source,m.source),A!==0)||(A=h.originalLine-m.originalLine,A!==0)||(A=h.originalColumn-m.originalColumn,A!==0)?A:_(h.name,m.name)}e.compareByGeneratedPositionsDeflatedNoLine=x;function _(h,m){return h===m?0:h===null?1:m===null?-1:h>m?1:-1}function E(h,m){var S=h.generatedLine-m.generatedLine;return S!==0||(S=h.generatedColumn-m.generatedColumn,S!==0)||(S=_(h.source,m.source),S!==0)||(S=h.originalLine-m.originalLine,S!==0)||(S=h.originalColumn-m.originalColumn,S!==0)?S:_(h.name,m.name)}e.compareByGeneratedPositionsInflated=E;function w(h){return JSON.parse(h.replace(/^\)]}'[^\n]*\n/,""))}e.parseSourceMapInput=w;function b(h,m,S){if(m=m||"",h&&(h[h.length-1]!=="/"&&m[0]!=="/"&&(h+="/"),m=h+m),S){var A=n(S);if(!A)throw new Error("sourceMapURL could not be parsed");if(A.path){var M=A.path.lastIndexOf("/");M>=0&&(A.path=A.path.substring(0,M+1))}m=l(i(A),m)}return s(m)}e.computeSourceURL=b})(gi);var ub={},hf=gi,vf=Object.prototype.hasOwnProperty,At=typeof Map<"u";function Qr(){this._array=[],this._set=At?new Map:Object.create(null)}Qr.fromArray=function(r,t){for(var a=new Qr,n=0,i=r.length;n=0)return t}else{var a=hf.toSetString(r);if(vf.call(this._set,a))return this._set[a]}throw new Error('"'+r+'" is not in the set.')};Qr.prototype.at=function(r){if(r>=0&&rt||a==t&&i>=n||pb.compareByGeneratedPositionsInflated(e,r)<=0}function bi(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}bi.prototype.unsortedForEach=function(r,t){this._array.forEach(r,t)};bi.prototype.add=function(r){Ooe(this._last,r)?(this._last=r,this._array.push(r)):(this._sorted=!1,this._array.push(r))};bi.prototype.toArray=function(){return this._sorted||(this._array.sort(pb.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};cb.MappingList=bi;var ga=pf,$e=gi,Qn=ub.ArraySet,Toe=cb.MappingList;function br(e){e||(e={}),this._file=$e.getArg(e,"file",null),this._sourceRoot=$e.getArg(e,"sourceRoot",null),this._skipValidation=$e.getArg(e,"skipValidation",!1),this._sources=new Qn,this._names=new Qn,this._mappings=new Toe,this._sourcesContents=null}br.prototype._version=3;br.fromSourceMap=function(r){var t=r.sourceRoot,a=new br({file:r.file,sourceRoot:t});return r.eachMapping(function(n){var i={generated:{line:n.generatedLine,column:n.generatedColumn}};n.source!=null&&(i.source=n.source,t!=null&&(i.source=$e.relative(t,i.source)),i.original={line:n.originalLine,column:n.originalColumn},n.name!=null&&(i.name=n.name)),a.addMapping(i)}),r.sources.forEach(function(n){var i=n;t!==null&&(i=$e.relative(t,n)),a._sources.has(i)||a._sources.add(i);var o=r.sourceContentFor(n);o!=null&&a.setSourceContent(n,o)}),a};br.prototype.addMapping=function(r){var t=$e.getArg(r,"generated"),a=$e.getArg(r,"original",null),n=$e.getArg(r,"source",null),i=$e.getArg(r,"name",null);this._skipValidation||this._validateMapping(t,a,n,i),n!=null&&(n=String(n),this._sources.has(n)||this._sources.add(n)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:a!=null&&a.line,originalColumn:a!=null&&a.column,source:n,name:i})};br.prototype.setSourceContent=function(r,t){var a=r;this._sourceRoot!=null&&(a=$e.relative(this._sourceRoot,a)),t!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[$e.toSetString(a)]=t):this._sourcesContents&&(delete this._sourcesContents[$e.toSetString(a)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};br.prototype.applySourceMap=function(r,t,a){var n=t;if(t==null){if(r.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);n=r.file}var i=this._sourceRoot;i!=null&&(n=$e.relative(i,n));var o=new Qn,u=new Qn;this._mappings.unsortedForEach(function(s){if(s.source===n&&s.originalLine!=null){var l=r.originalPositionFor({line:s.originalLine,column:s.originalColumn});l.source!=null&&(s.source=l.source,a!=null&&(s.source=$e.join(a,s.source)),i!=null&&(s.source=$e.relative(i,s.source)),s.originalLine=l.line,s.originalColumn=l.column,l.name!=null&&(s.name=l.name))}var c=s.source;c!=null&&!o.has(c)&&o.add(c);var p=s.name;p!=null&&!u.has(p)&&u.add(p)},this),this._sources=o,this._names=u,r.sources.forEach(function(s){var l=r.sourceContentFor(s);l!=null&&(a!=null&&(s=$e.join(a,s)),i!=null&&(s=$e.relative(i,s)),this.setSourceContent(s,l))},this)};br.prototype._validateMapping=function(r,t,a,n){if(t&&typeof t.line!="number"&&typeof t.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(r&&"line"in r&&"column"in r&&r.line>0&&r.column>=0&&!t&&!a&&!n)){if(r&&"line"in r&&"column"in r&&t&&"line"in t&&"column"in t&&r.line>0&&r.column>=0&&t.line>0&&t.column>=0&&a)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:r,source:a,original:t,name:n}))}};br.prototype._serializeMappings=function(){for(var r=0,t=1,a=0,n=0,i=0,o=0,u="",s,l,c,p,f=this._mappings.toArray(),C=0,y=f.length;C0){if(!$e.compareByGeneratedPositionsInflated(l,f[C-1]))continue;s+=","}s+=ga.encode(l.generatedColumn-r),r=l.generatedColumn,l.source!=null&&(p=this._sources.indexOf(l.source),s+=ga.encode(p-o),o=p,s+=ga.encode(l.originalLine-1-n),n=l.originalLine-1,s+=ga.encode(l.originalColumn-a),a=l.originalColumn,l.name!=null&&(c=this._names.indexOf(l.name),s+=ga.encode(c-i),i=c)),u+=s}return u};br.prototype._generateSourcesContent=function(r,t){return r.map(function(a){if(!this._sourcesContents)return null;t!=null&&(a=$e.relative(t,a));var n=$e.toSetString(a);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)};br.prototype.toJSON=function(){var r={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(r.file=this._file),this._sourceRoot!=null&&(r.sourceRoot=this._sourceRoot),this._sourcesContents&&(r.sourcesContent=this._generateSourcesContent(r.sources,r.sourceRoot)),r};br.prototype.toString=function(){return JSON.stringify(this.toJSON())};var Loe=br;const $h=new Set(["Atrule","Selector","Declaration"]);function Ioe(e){const r=new Loe,t={line:1,column:0},a={line:0,column:0},n={line:1,column:0},i={generated:n};let o=1,u=0,s=!1;const l=e.node;e.node=function(f){if(f.loc&&f.loc.start&&$h.has(f.type)){const C=f.loc.start.line,y=f.loc.start.column-1;(a.line!==C||a.column!==y)&&(a.line=C,a.column=y,t.line=o,t.column=u,s&&(s=!1,(t.line!==n.line||t.column!==n.column)&&r.addMapping(i)),s=!0,r.addMapping({source:f.loc.source,original:a,generated:t}))}l.call(this,f),s&&$h.has(f.type)&&(n.line=o,n.column=u)};const c=e.emit;e.emit=function(f,C,y){for(let D=0;D{if(e===ee&&(e=r),typeof e=="string"){const t=e.charCodeAt(0);return t>127?32768:t<<8}return e},db=[[N,N],[N,re],[N,He],[N,Ze],[N,"-"],[N,Q],[N,Ee],[N,oe],[N,er],[N,De],[qe,N],[qe,re],[qe,He],[qe,Ze],[qe,"-"],[qe,Q],[qe,Ee],[qe,oe],[qe,er],[Ce,N],[Ce,re],[Ce,He],[Ce,Ze],[Ce,"-"],[Ce,Q],[Ce,Ee],[Ce,oe],[Ce,er],[oe,N],[oe,re],[oe,He],[oe,Ze],[oe,"-"],[oe,Q],[oe,Ee],[oe,oe],[oe,er],["#",N],["#",re],["#",He],["#",Ze],["#","-"],["#",Q],["#",Ee],["#",oe],["#",er],["-",N],["-",re],["-",He],["-",Ze],["-","-"],["-",Q],["-",Ee],["-",oe],["-",er],[Q,N],[Q,re],[Q,He],[Q,Ze],[Q,Q],[Q,Ee],[Q,oe],[Q,"%"],[Q,er],["@",N],["@",re],["@",He],["@",Ze],["@","-"],["@",er],[".",Q],[".",Ee],[".",oe],["+",Q],["+",Ee],["+",oe],["/","*"]],Noe=db.concat([[N,Ce],[oe,Ce],[Ce,Ce],[qe,De],[qe,Nr],[qe,Re],[Ee,Ee],[Ee,oe],[Ee,re],[Ee,"-"],[te,N],[te,re],[te,Ee],[te,oe],[te,Ce],[te,"-"]]);function fb(e){const r=new Set(e.map(([t,a])=>Kc(t)<<16|Kc(a)));return function(t,a,n){const i=Kc(a,n),o=n.charCodeAt(0);return(o===Moe&&a!==N&&a!==re&&a!==er||o===Boe?r.has(t<<16|o<<8):r.has(t<<16|i))&&this.emit(" ",ke,!0),i}}const joe=fb(db),hb=fb(Noe),Fh=Object.freeze(Object.defineProperty({__proto__:null,safe:hb,spec:joe},Symbol.toStringTag,{value:"Module"})),Uoe=92;function Voe(e,r){if(typeof r=="function"){let t=null;e.children.forEach(a=>{t!==null&&r.call(this,t),this.node(a),t=a});return}e.children.forEach(this.node,this)}function zoe(e){vi(e,(r,t,a)=>{this.token(r,e.slice(t,a))})}function Hoe(e){const r=new Map;for(let t in e.node){const a=e.node[t];typeof(a.generate||a)=="function"&&r.set(t,a.generate||a)}return function(t,a){let n="",i=0,o={node(s){if(r.has(s.type))r.get(s.type).call(u,s);else throw new Error("Unknown node type: "+s.type)},tokenBefore:hb,token(s,l){i=this.tokenBefore(i,s,l),this.emit(l,s,!1),s===ee&&l.charCodeAt(0)===Uoe&&this.emit(` +`,ke,!0)},emit(s){n+=s},result(){return n}};a&&(typeof a.decorator=="function"&&(o=a.decorator(o)),a.sourceMap&&(o=Ioe(o)),a.mode in Fh&&(o.tokenBefore=Fh[a.mode]));const u={node:s=>o.node(s),children:Voe,token:(s,l)=>o.token(s,l),tokenize:zoe};return o.node(t),o.result()}}function Goe(e){return{fromPlainObject(r){return e(r,{enter(t){t.children&&!(t.children instanceof Ie)&&(t.children=new Ie().fromArray(t.children))}}),r},toPlainObject(r){return e(r,{leave(t){t.children&&t.children instanceof Ie&&(t.children=t.children.toArray())}}),r}}}const{hasOwnProperty:mf}=Object.prototype,Sa=function(){};function Oh(e){return typeof e=="function"?e:Sa}function Th(e,r){return function(t,a,n){t.type===r&&e.call(this,t,a,n)}}function Woe(e,r){const t=r.structure,a=[];for(const n in t){if(mf.call(t,n)===!1)continue;let i=t[n];const o={name:n,type:!1,nullable:!1};Array.isArray(i)||(i=[i]);for(const u of i)u===null?o.nullable=!0:typeof u=="string"?o.type="node":Array.isArray(u)&&(o.type="list");o.type&&a.push(o)}return a.length?{context:r.walkContext,fields:a}:null}function Yoe(e){const r={};for(const t in e.node)if(mf.call(e.node,t)){const a=e.node[t];if(!a.structure)throw new Error("Missed `structure` field in `"+t+"` node type definition");r[t]=Woe(t,a)}return r}function Lh(e,r){const t=e.fields.slice(),a=e.context,n=typeof a=="string";return r&&t.reverse(),function(i,o,u,s){let l;n&&(l=o[a],o[a]=i);for(const c of t){const p=i[c.name];if(!c.nullable||p){if(c.type==="list"){if(r?p.reduceRight(s,!1):p.reduce(s,!1))return!0}else if(u(p))return!0}}n&&(o[a]=l)}}function Ih({StyleSheet:e,Atrule:r,Rule:t,Block:a,DeclarationList:n}){return{Atrule:{StyleSheet:e,Atrule:r,Rule:t,Block:a},Rule:{StyleSheet:e,Atrule:r,Rule:t,Block:a},Declaration:{StyleSheet:e,Atrule:r,Rule:t,Block:a,DeclarationList:n}}}function Qoe(e){const r=Yoe(e),t={},a={},n=Symbol("break-walk"),i=Symbol("skip-node");for(const l in r)mf.call(r,l)&&r[l]!==null&&(t[l]=Lh(r[l],!1),a[l]=Lh(r[l],!0));const o=Ih(t),u=Ih(a),s=function(l,c){function p(g,v,x){const _=f.call(k,g,v,x);return _===n?!0:_===i?!1:!!(y.hasOwnProperty(g.type)&&y[g.type](g,k,p,D)||C.call(k,g,v,x)===n)}let f=Sa,C=Sa,y=t,D=(g,v,x,_)=>g||p(v,x,_);const k={break:n,skip:i,root:l,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof c=="function")f=c;else if(c&&(f=Oh(c.enter),C=Oh(c.leave),c.reverse&&(y=a),c.visit)){if(o.hasOwnProperty(c.visit))y=c.reverse?u[c.visit]:o[c.visit];else if(!r.hasOwnProperty(c.visit))throw new Error("Bad value `"+c.visit+"` for `visit` option (should be: "+Object.keys(r).sort().join(", ")+")");f=Th(f,c.visit),C=Th(C,c.visit)}if(f===Sa&&C===Sa)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");p(l)};return s.break=n,s.skip=i,s.find=function(l,c){let p=null;return s(l,function(f,C,y){if(c.call(this,f,C,y))return p=f,n}),p},s.findLast=function(l,c){let p=null;return s(l,{reverse:!0,enter(f,C,y){if(c.call(this,f,C,y))return p=f,n}}),p},s.findAll=function(l,c){const p=[];return s(l,function(f,C,y){c.call(this,f,C,y)&&p.push(f)}),p},s}function Koe(e){return e}function Xoe(e){const{min:r,max:t,comma:a}=e;return r===0&&t===0?a?"#?":"*":r===0&&t===1?"?":r===1&&t===0?a?"#":"+":r===1&&t===1?"":(a?"#":"")+(r===t?"{"+r+"}":"{"+r+","+(t!==0?t:"")+"}")}function Joe(e){switch(e.type){case"Range":return" ["+(e.min===null?"-∞":e.min)+","+(e.max===null?"∞":e.max)+"]";default:throw new Error("Unknown node type `"+e.type+"`")}}function Zoe(e,r,t,a){const n=e.combinator===" "||a?e.combinator:" "+e.combinator+" ",i=e.terms.map(o=>gf(o,r,t,a)).join(n);return e.explicit||t?(a||i[0]===","?"[":"[ ")+i+(a?"]":" ]"):i}function gf(e,r,t,a){let n;switch(e.type){case"Group":n=Zoe(e,r,t,a)+(e.disallowEmpty?"!":"");break;case"Multiplier":return gf(e.term,r,t,a)+r(Xoe(e),e);case"Type":n="<"+e.name+(e.opts?r(Joe(e.opts),e.opts):"")+">";break;case"Property":n="<'"+e.name+"'>";break;case"Keyword":n=e.name;break;case"AtKeyword":n="@"+e.name;break;case"Function":n=e.name+"(";break;case"String":case"Token":n=e.value;break;case"Comma":n=",";break;default:throw new Error("Unknown node type `"+e.type+"`")}return r(n,e)}function bf(e,r){let t=Koe,a=!1,n=!1;return typeof r=="function"?t=r:r&&(a=!!r.forceBraces,n=!!r.compact,typeof r.decorate=="function"&&(t=r.decorate)),gf(e,t,a,n)}const Bh={offset:0,line:1,column:1};function ese(e,r){const t=e.tokens,a=e.longestMatch,n=a1?(c=un(i||r,"end")||Ra(Bh,l),p=Ra(c)):(c=un(i,"start")||Ra(un(r,"start")||Bh,l.slice(0,o)),p=un(i,"end")||Ra(c,l.substr(o,u))),{css:l,mismatchOffset:o,mismatchLength:u,start:c,end:p}}function un(e,r){const t=e&&e.loc&&e.loc[r];return t?"line"in t?Ra(t):t:null}function Ra({offset:e,line:r,column:t},a){const n={offset:e,line:r,column:t};if(a){const i=a.split(/\n|\r\n?|\f/);n.offset+=a.length,n.line+=i.length-1,n.column=i.length===1?n.column+a.length:i.pop().length+1}return n}const ba=function(e,r){const t=mi("SyntaxReferenceError",e+(r?" `"+r+"`":""));return t.reference=r,t},rse=function(e,r,t,a){const n=mi("SyntaxMatchError",e),{css:i,mismatchOffset:o,mismatchLength:u,start:s,end:l}=ese(a,t);return n.rawMessage=e,n.syntax=r?bf(r):"",n.css=i,n.mismatchOffset=o,n.mismatchLength=u,n.message=e+` syntax: `+n.syntax+` value: `+(i||"")+` - --------`+new Array(n.mismatchOffset+1).join("-")+"^",Object.assign(n,s),n.loc={source:t&&t.loc&&t.loc.source||"",start:s,end:l},n},cn=new Map,Ot=new Map,Kn=45,Xc=tse,Bh=ase;function bf(e,r){return r=r||0,e.length-r>=2&&e.charCodeAt(r)===Kn&&e.charCodeAt(r+1)===Kn}function vb(e,r){if(r=r||0,e.length-r>=3&&e.charCodeAt(r)===Kn&&e.charCodeAt(r+1)!==Kn){const t=e.indexOf("-",r+2);if(t!==-1)return e.substring(r,t+1)}return""}function tse(e){if(cn.has(e))return cn.get(e);const r=e.toLowerCase();let t=cn.get(r);if(t===void 0){const a=bf(r,0),n=a?"":vb(r,0);t=Object.freeze({basename:r.substr(n.length),name:r,prefix:n,vendor:n,custom:a})}return cn.set(e,t),t}function ase(e){if(Ot.has(e))return Ot.get(e);let r=e,t=e[0];t==="/"?t=e[1]==="/"?"//":"/":t!=="_"&&t!=="*"&&t!=="$"&&t!=="#"&&t!=="+"&&t!=="&"&&(t="");const a=bf(r,t.length);if(!a&&(r=r.toLowerCase(),Ot.has(r))){const u=Ot.get(r);return Ot.set(e,u),u}const n=a?"":vb(r,t.length),i=r.substr(0,t.length+n.length),o=Object.freeze({basename:r.substr(i.length),name:r.substr(t.length),hack:t,vendor:n,prefix:i,custom:a});return Ot.set(e,o),o}const mb=["initial","inherit","unset","revert","revert-layer"],Va=43,qr=45,Jc=110,Tt=!0,nse=!1;function fd(e,r){return e!==null&&e.type===ee&&e.value.charCodeAt(0)===r}function Oa(e,r,t){for(;e!==null&&(e.type===ke||e.type===Ue);)e=t(++r);return r}function et(e,r,t,a){if(!e)return 0;const n=e.value.charCodeAt(r);if(n===Va||n===qr){if(t)return 0;r++}for(;r6)return 0}return a}function pn(e,r,t){if(!e)return 0;for(;hd(t(r),bb);){if(++e>6)return 0;r++}return r}function use(e,r){let t=0;if(e===null||e.type!==N||!ra(e.value,0,sse)||(e=r(++t),e===null))return 0;if(hd(e,ose))return e=r(++t),e===null?0:e.type===N?pn(Pa(e,0,!0),++t,r):hd(e,bb)?pn(1,++t,r):0;if(e.type===Q){const a=Pa(e,1,!0);return a===0?0:(e=r(++t),e===null?t:e.type===oe||e.type===Q?!lse(e,gb)||!Pa(e,1,!1)?0:t+1:pn(a,t,r))}return e.type===oe?pn(Pa(e,1,!0),++t,r):0}const cse=["calc(","-moz-calc(","-webkit-calc("],yf=new Map([[re,te],[De,te],[ir,Er],[je,gr]]);function Dr(e,r){return re.max&&typeof e.max!="string")return!0}return!1}function pse(e,r){let t=0,a=[],n=0;e:do{switch(e.type){case gr:case te:case Er:if(e.type!==t)break e;if(t=a.pop(),a.length===0){n++;break e}break;case re:case De:case ir:case je:a.push(t),t=yf.get(e.type);break}n++}while(e=r(n));return n}function fr(e){return function(r,t,a){return r===null?0:r.type===re&&xb(r.value,cse)?pse(r,t):e(r,t,a)}}function we(e){return function(r){return r===null||r.type!==e?0:1}}function dse(e){if(e===null||e.type!==N)return 0;const r=e.value.toLowerCase();return xb(r,mb)||yb(r,"default")?0:1}function fse(e){return e===null||e.type!==N||Dr(e.value,0)!==45||Dr(e.value,1)!==45?0:1}function hse(e){if(e===null||e.type!==Ce)return 0;const r=e.value.length;if(r!==4&&r!==5&&r!==7&&r!==9)return 0;for(let t=1;t",start:s,end:l},n},cn=new Map,Ot=new Map,Kn=45,Xc=tse,Mh=ase;function yf(e,r){return r=r||0,e.length-r>=2&&e.charCodeAt(r)===Kn&&e.charCodeAt(r+1)===Kn}function vb(e,r){if(r=r||0,e.length-r>=3&&e.charCodeAt(r)===Kn&&e.charCodeAt(r+1)!==Kn){const t=e.indexOf("-",r+2);if(t!==-1)return e.substring(r,t+1)}return""}function tse(e){if(cn.has(e))return cn.get(e);const r=e.toLowerCase();let t=cn.get(r);if(t===void 0){const a=yf(r,0),n=a?"":vb(r,0);t=Object.freeze({basename:r.substr(n.length),name:r,prefix:n,vendor:n,custom:a})}return cn.set(e,t),t}function ase(e){if(Ot.has(e))return Ot.get(e);let r=e,t=e[0];t==="/"?t=e[1]==="/"?"//":"/":t!=="_"&&t!=="*"&&t!=="$"&&t!=="#"&&t!=="+"&&t!=="&"&&(t="");const a=yf(r,t.length);if(!a&&(r=r.toLowerCase(),Ot.has(r))){const u=Ot.get(r);return Ot.set(e,u),u}const n=a?"":vb(r,t.length),i=r.substr(0,t.length+n.length),o=Object.freeze({basename:r.substr(i.length),name:r.substr(t.length),hack:t,vendor:n,prefix:i,custom:a});return Ot.set(e,o),o}const mb=["initial","inherit","unset","revert","revert-layer"],Va=43,qr=45,Jc=110,Tt=!0,nse=!1;function hd(e,r){return e!==null&&e.type===ee&&e.value.charCodeAt(0)===r}function Oa(e,r,t){for(;e!==null&&(e.type===ke||e.type===Ue);)e=t(++r);return r}function et(e,r,t,a){if(!e)return 0;const n=e.value.charCodeAt(r);if(n===Va||n===qr){if(t)return 0;r++}for(;r6)return 0}return a}function pn(e,r,t){if(!e)return 0;for(;vd(t(r),bb);){if(++e>6)return 0;r++}return r}function use(e,r){let t=0;if(e===null||e.type!==N||!ra(e.value,0,sse)||(e=r(++t),e===null))return 0;if(vd(e,ose))return e=r(++t),e===null?0:e.type===N?pn(Pa(e,0,!0),++t,r):vd(e,bb)?pn(1,++t,r):0;if(e.type===Q){const a=Pa(e,1,!0);return a===0?0:(e=r(++t),e===null?t:e.type===oe||e.type===Q?!lse(e,gb)||!Pa(e,1,!1)?0:t+1:pn(a,t,r))}return e.type===oe?pn(Pa(e,1,!0),++t,r):0}const cse=["calc(","-moz-calc(","-webkit-calc("],xf=new Map([[re,te],[De,te],[ir,Er],[je,gr]]);function Dr(e,r){return re.max&&typeof e.max!="string")return!0}return!1}function pse(e,r){let t=0,a=[],n=0;e:do{switch(e.type){case gr:case te:case Er:if(e.type!==t)break e;if(t=a.pop(),a.length===0){n++;break e}break;case re:case De:case ir:case je:a.push(t),t=xf.get(e.type);break}n++}while(e=r(n));return n}function fr(e){return function(r,t,a){return r===null?0:r.type===re&&xb(r.value,cse)?pse(r,t):e(r,t,a)}}function we(e){return function(r){return r===null||r.type!==e?0:1}}function dse(e){if(e===null||e.type!==N)return 0;const r=e.value.toLowerCase();return xb(r,mb)||yb(r,"default")?0:1}function fse(e){return e===null||e.type!==N||Dr(e.value,0)!==45||Dr(e.value,1)!==45?0:1}function hse(e){if(e===null||e.type!==Ce)return 0;const r=e.value.length;if(r!==4&&r!==5&&r!==7&&r!==9)return 0;for(let t=1;t/[a-zA-Z0-9\-]/.test(String.fromCharCode(r))?1:0),Hh={" ":1,"&&":2,"||":3,"|":4};function Zn(e){return e.substringToPos(e.findWsEnd(e.pos))}function oa(e){let r=e.pos;for(;r=128||za[t]===0)break}return e.pos===r&&e.error("Expect a keyword"),e.substringToPos(r)}function ei(e){let r=e.pos;for(;r57)break}return e.pos===r&&e.error("Expect a number"),e.substringToPos(r)}function Wse(e){const r=e.str.indexOf("'",e.pos+1);return r===-1&&(e.pos=e.str.length,e.error("Expect an apostrophe")),e.substringToPos(r+1)}function Gh(e){let r=null,t=null;return e.eat(Jn),r=ei(e),e.charCode()===Cf?(e.pos++,e.charCode()!==Vh&&(t=ei(e))):t=r,e.eat(Vh),{min:Number(r),max:t?Number(t):0}}function Yse(e){let r=null,t=!1;switch(e.charCode()){case _b:e.pos++,r={min:0,max:0};break;case wf:e.pos++,r={min:1,max:0};break;case vd:e.pos++,r={min:0,max:1};break;case xf:e.pos++,t=!0,e.charCode()===Jn?r=Gh(e):e.charCode()===vd?(e.pos++,r={min:0,max:0}):r={min:1,max:0};break;case Jn:r=Gh(e);break;default:return null}return{type:"Multiplier",comma:t,min:r.min,max:r.max,term:null}}function sa(e,r){const t=Yse(e);return t!==null?(t.term=r,e.charCode()===xf&&e.charCodeAt(e.pos-1)===wf?sa(e,t):t):r}function ep(e){const r=e.peek();return r===""?null:{type:"Token",value:r}}function Qse(e){let r;return e.eat(kf),e.eat(Xn),r=oa(e),e.eat(Xn),e.eat(Db),sa(e,{type:"Property",name:r})}function Kse(e){let r=null,t=null,a=1;return e.eat(xi),e.charCode()===jh&&(e.peek(),a=-1),a==-1&&e.charCode()===zh?e.peek():(r=a*Number(ei(e)),za[e.charCode()]!==0&&(r+=oa(e))),Zn(e),e.eat(Cf),Zn(e),e.charCode()===zh?e.peek():(a=1,e.charCode()===jh&&(e.peek(),a=-1),t=a*Number(ei(e)),za[e.charCode()]!==0&&(t+=oa(e))),e.eat(Af),{type:"Range",min:r,max:t}}function Xse(e){let r,t=null;return e.eat(kf),r=oa(e),e.charCode()===Ab&&e.nextCharCode()===Hse&&(e.pos+=2,r+="()"),e.charCodeAt(e.findWsEnd(e.pos))===xi&&(Zn(e),t=Kse(e)),e.eat(Db),sa(e,{type:"Type",name:r,opts:t})}function Jse(e){const r=oa(e);return e.charCode()===Ab?(e.pos++,{type:"Function",name:r}):sa(e,{type:"Keyword",name:r})}function Zse(e,r){function t(n,i){return{type:"Group",terms:n,combinator:i,disallowEmpty:!1,explicit:!1}}let a;for(r=Object.keys(r).sort((n,i)=>Hh[n]-Hh[i]);r.length>0;){a=r.shift();let n=0,i=0;for(;n1&&(e.splice(i,n-i,t(e.slice(i,n),a)),n=i+1),i=-1))}i!==-1&&r.length&&e.splice(i,n-i,t(e.slice(i,n),a))}return a}function Eb(e){const r=[],t={};let a,n=null,i=e.pos;for(;a=rle(e);)a.type!=="Spaces"&&(a.type==="Combinator"?((n===null||n.type==="Combinator")&&(e.pos=i,e.error("Unexpected combinator")),t[a.value]=!0):n!==null&&n.type!=="Combinator"&&(t[" "]=!0,r.push({type:"Combinator",value:" "})),r.push(a),n=a,i=e.pos);return n!==null&&n.type==="Combinator"&&(e.pos-=i,e.error("Unexpected combinator")),{type:"Group",terms:r,combinator:Zse(r,t)||" ",disallowEmpty:!1,explicit:!1}}function ele(e){let r;return e.eat(xi),r=Eb(e),e.eat(Af),r.explicit=!0,e.charCode()===kb&&(e.pos++,r.disallowEmpty=!0),r}function rle(e){let r=e.charCode();if(r<128&&za[r]===1)return Jse(e);switch(r){case Af:break;case xi:return sa(e,ele(e));case kf:return e.nextCharCode()===Xn?Qse(e):Xse(e);case Uh:return{type:"Combinator",value:e.substringToPos(e.pos+(e.nextCharCode()===Uh?2:1))};case Nh:return e.pos++,e.eat(Nh),{type:"Combinator",value:"&&"};case Cf:return e.pos++,{type:"Comma"};case Xn:return sa(e,{type:"String",value:Wse(e)});case zse:case Nse:case jse:case Vse:case Use:return{type:"Spaces",value:Zn(e)};case Gse:return r=e.nextCharCode(),r<128&&za[r]===1?(e.pos++,{type:"AtKeyword",name:oa(e)}):ep(e);case _b:case wf:case vd:case xf:case kb:break;case Jn:if(r=e.nextCharCode(),r<48||r>57)return ep(e);break;default:return ep(e)}}function Sb(e){const r=new Mse(e),t=Eb(r);return r.pos!==e.length&&r.error("Unexpected input"),t.terms.length===1&&t.terms[0].type==="Group"?t.terms[0]:t}const qa=function(){};function Wh(e){return typeof e=="function"?e:qa}function tle(e,r,t){function a(o){switch(n.call(t,o),o.type){case"Group":o.terms.forEach(a);break;case"Multiplier":a(o.term);break;case"Type":case"Property":case"Keyword":case"AtKeyword":case"Function":case"String":case"Token":case"Comma":break;default:throw new Error("Unknown type: "+o.type)}i.call(t,o)}let n=qa,i=qa;if(typeof r=="function"?n=r:r&&(n=Wh(r.enter),i=Wh(r.leave)),n===qa&&i===qa)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");a(e)}const ale={decorator(e){const r=[];let t=null;return{...e,node(a){const n=t;t=a,e.node.call(this,a),t=n},emit(a,n,i){r.push({type:n,value:a,node:i?null:t})},result(){return r}}}};function nle(e){const r=[];return vi(e,(t,a,n)=>r.push({type:t,value:e.slice(a,n),node:null})),r}function ile(e,r){return typeof e=="string"?nle(e):r.generate(e,ale)}const me={type:"Match"},ye={type:"Mismatch"},_f={type:"DisallowEmpty"},ole=40,sle=41;function ze(e,r,t){return r===me&&t===ye||e===me&&r===me&&t===me?e:(e.type==="If"&&e.else===ye&&r===me&&(r=e.then,e=e.match),{type:"If",match:e,then:r,else:t})}function Rb(e){return e.length>2&&e.charCodeAt(e.length-2)===ole&&e.charCodeAt(e.length-1)===sle}function Yh(e){return e.type==="Keyword"||e.type==="AtKeyword"||e.type==="Function"||e.type==="Type"&&Rb(e.name)}function md(e,r,t){switch(e){case" ":{let a=me;for(let n=r.length-1;n>=0;n--){const i=r[n];a=ze(i,a,ye)}return a}case"|":{let a=ye,n=null;for(let i=r.length-1;i>=0;i--){let o=r[i];if(Yh(o)&&(n===null&&i>0&&Yh(r[i-1])&&(n=Object.create(null),a=ze({type:"Enum",map:n},me,a)),n!==null)){const u=(Rb(o.name)?o.name.slice(0,-1):o.name).toLowerCase();if(!(u in n)){n[u]=o;continue}}n=null,a=ze(o,me,a)}return a}case"&&":{if(r.length>5)return{type:"MatchOnce",terms:r,all:!0};let a=ye;for(let n=r.length-1;n>=0;n--){const i=r[n];let o;r.length>1?o=md(e,r.filter(function(u){return u!==i}),!1):o=me,a=ze(i,o,a)}return a}case"||":{if(r.length>5)return{type:"MatchOnce",terms:r,all:!1};let a=t?me:ye;for(let n=r.length-1;n>=0;n--){const i=r[n];let o;r.length>1?o=md(e,r.filter(function(u){return u!==i}),!0):o=me,a=ze(i,o,a)}return a}}}function lle(e){let r=me,t=Df(e.term);if(e.max===0)t=ze(t,_f,ye),r=ze(t,null,ye),r.then=ze(me,me,r),e.comma&&(r.then.else=ze({type:"Comma",syntax:e},r,ye));else for(let a=e.min||1;a<=e.max;a++)e.comma&&r!==me&&(r=ze({type:"Comma",syntax:e},r,ye)),r=ze(t,ze(me,me,r),ye);if(e.min===0)r=ze(me,me,r);else for(let a=0;a=65&&n<=90&&(n=n|32),n!==a)return!1}return!0}function hle(e){return e.type!==ee?!1:e.value!=="?"}function Jh(e){return e===null?!0:e.type===jr||e.type===re||e.type===De||e.type===ir||e.type===je||hle(e)}function Zh(e){return e===null?!0:e.type===te||e.type===Er||e.type===gr||e.type===ee&&e.value==="/"}function vle(e,r,t){function a(){do v++,g=vx&&(x=v)}function l(){p={syntax:r.syntax,opts:r.syntax.opts||p!==null&&p.opts||null,prev:p},_={type:bd,syntax:r.syntax,token:_.token,prev:_}}function c(){_.type===bd?_=_.prev:_={type:Pb,syntax:p.syntax,token:_.token,prev:_},p=p.prev}let p=null,f=null,C=null,y=null,D=0,k=null,g=null,v=-1,x=0,_={type:ule,syntax:null,token:null,prev:null};for(a();k===null&&++DC.tokenIndex)&&(C=y,y=!1);else if(C===null){k=ple;break}r=C.nextState,f=C.thenStack,p=C.syntaxStack,_=C.matchStack,v=C.tokenIndex,g=vv){for(;v":"<'"+r.name+"'>"));if(y!==!1&&g!==null&&r.type==="Type"&&(r.name==="custom-ident"&&g.type===N||r.name==="length"&&g.value==="0")){y===null&&(y=i(r,C)),r=ye;break}l(),r=h.match;break}case"Keyword":{const b=r.name;if(g!==null){let h=g.value;if(h.indexOf("\\")!==-1&&(h=h.replace(/\\[09].*$/,"")),rp(h,b)){s(),r=me;break}}r=ye;break}case"AtKeyword":case"Function":if(g!==null&&rp(g.value,r.name)){s(),r=me;break}r=ye;break;case"Token":if(g!==null&&g.value===r.value){s(),r=me;break}r=ye;break;case"Comma":g!==null&&g.type===jr?Jh(_.token)?r=ye:(s(),r=Zh(g)?ye:me):r=Jh(_.token)||Zh(g)?me:ye;break;case"String":let E="",w=v;for(;wt.type==="Type"&&t.name===r)}function gle(e,r){return Ef(this,e,t=>t.type==="Property"&&t.name===r)}function ble(e){return Ef(this,e,r=>r.type==="Keyword")}function Ef(e,r,t){const a=qb.call(e,r);return a===null?!1:a.some(t)}const yle=Object.freeze(Object.defineProperty({__proto__:null,getTrace:qb,isKeyword:ble,isProperty:gle,isType:mle},Symbol.toStringTag,{value:"Module"}));function $b(e){return"node"in e?e.node:$b(e.match[0])}function Fb(e){return"node"in e?e.node:Fb(e.match[e.match.length-1])}function rv(e,r,t,a,n){function i(u){if(u.syntax!==null&&u.syntax.type===a&&u.syntax.name===n){const s=$b(u),l=Fb(u);e.syntax.walk(r,function(c,p,f){if(c===s){const C=new Ie;do{if(C.appendData(p.data),p.data===l)break;p=p.next}while(p!==null);o.push({parent:f,nodes:C})}})}Array.isArray(u.match)&&u.match.forEach(i)}const o=[];return t.matched!==null&&i(t.matched),o}const{hasOwnProperty:Ta}=Object.prototype;function tp(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&e>=0}function tv(e){return!!e&&tp(e.offset)&&tp(e.line)&&tp(e.column)}function xle(e,r){return function(a,n){if(!a||a.constructor!==Object)return n(a,"Type of node should be an Object");for(let i in a){let o=!0;if(Ta.call(a,i)!==!1){if(i==="type")a.type!==e&&n(a,"Wrong node type `"+a.type+"`, expected `"+e+"`");else if(i==="loc"){if(a.loc===null)continue;if(a.loc&&a.loc.constructor===Object)if(typeof a.loc.source!="string")i+=".source";else if(!tv(a.loc.start))i+=".start";else if(!tv(a.loc.end))i+=".end";else continue;o=!1}else if(r.hasOwnProperty(i)){o=!1;for(let u=0;!o&&u");else if(Array.isArray(l))o.push("List");else throw new Error("Wrong value `"+l+"` in `"+e+"."+i+"` structure definition")}n[i]=o.join(" | ")}return{docs:n,check:xle(e,a)}}function Cle(e){const r={};if(e.node){for(const t in e.node)if(Ta.call(e.node,t)){const a=e.node[t];if(a.structure)r[t]=wle(t,a);else throw new Error("Missed `structure` field in `"+t+"` node type definition")}}return r}const kle=gd(mb.join(" | "));function yd(e,r,t){const a={};for(const n in e)e[n].syntax&&(a[n]=t?e[n].syntax:gf(e[n].syntax,{compact:r}));return a}function Ale(e,r,t){const a={};for(const[n,i]of Object.entries(e))a[n]={prelude:i.prelude&&(t?i.prelude.syntax:gf(i.prelude.syntax,{compact:r})),descriptors:i.descriptors&&yd(i.descriptors,r,t)};return a}function _le(e){for(let r=0;r(a[n]=this.createDescriptor(t.descriptors[n],"AtruleDescriptor",n,r),a),Object.create(null)):null})}addProperty_(r,t){t&&(this.properties[r]=this.createDescriptor(t,"Property",r))}addType_(r,t){t&&(this.types[r]=this.createDescriptor(t,"Type",r))}checkAtruleName(r){if(!this.getAtrule(r))return new ba("Unknown at-rule","@"+r)}checkAtrulePrelude(r,t){const a=this.checkAtruleName(r);if(a)return a;const n=this.getAtrule(r);if(!n.prelude&&t)return new SyntaxError("At-rule `@"+r+"` should not contain a prelude");if(n.prelude&&!t&&!Lt(this,n.prelude,"",!1).matched)return new SyntaxError("At-rule `@"+r+"` should contain a prelude")}checkAtruleDescriptorName(r,t){const a=this.checkAtruleName(r);if(a)return a;const n=this.getAtrule(r),i=Xc(t);if(!n.descriptors)return new SyntaxError("At-rule `@"+r+"` has no known descriptors");if(!n.descriptors[i.name]&&!n.descriptors[i.basename])return new ba("Unknown at-rule descriptor",t)}checkPropertyName(r){if(!this.getProperty(r))return new ba("Unknown property",r)}matchAtrulePrelude(r,t){const a=this.checkAtrulePrelude(r,t);if(a)return Ar(null,a);const n=this.getAtrule(r);return n.prelude?Lt(this,n.prelude,t||"",!1):Ar(null,null)}matchAtruleDescriptor(r,t,a){const n=this.checkAtruleDescriptorName(r,t);if(n)return Ar(null,n);const i=this.getAtrule(r),o=Xc(t);return Lt(this,i.descriptors[o.name]||i.descriptors[o.basename],a,!1)}matchDeclaration(r){return r.type!=="Declaration"?Ar(null,new Error("Not a Declaration node")):this.matchProperty(r.property,r.value)}matchProperty(r,t){if(Bh(r).custom)return Ar(null,new Error("Lexer matching doesn't applicable for custom properties"));const a=this.checkPropertyName(r);return a?Ar(null,a):Lt(this,this.getProperty(r),t,!0)}matchType(r,t){const a=this.getType(r);return a?Lt(this,a,t,!1):Ar(null,new ba("Unknown type",r))}match(r,t){return typeof r!="string"&&(!r||!r.type)?Ar(null,new ba("Bad syntax")):((typeof r=="string"||!r.match)&&(r=this.createDescriptor(r,"Type","anonymous")),Lt(this,r,t,!1))}findValueFragments(r,t,a,n){return rv(this,t,this.matchProperty(r,t),a,n)}findDeclarationValueFragments(r,t,a){return rv(this,r.value,this.matchDeclaration(r),t,a)}findAllFragments(r,t,a){const n=[];return this.syntax.walk(r,{visit:"Declaration",enter:i=>{n.push.apply(n,this.findDeclarationValueFragments(i,t,a))}}),n}getAtrule(r,t=!0){const a=Xc(r);return(a.vendor&&t?this.atrules[a.name]||this.atrules[a.basename]:this.atrules[a.name])||null}getAtrulePrelude(r,t=!0){const a=this.getAtrule(r,t);return a&&a.prelude||null}getAtruleDescriptor(r,t){return this.atrules.hasOwnProperty(r)&&this.atrules.declarators&&this.atrules[r].declarators[t]||null}getProperty(r,t=!0){const a=Bh(r);return(a.vendor&&t?this.properties[a.name]||this.properties[a.basename]:this.properties[a.name])||null}getType(r){return hasOwnProperty.call(this.types,r)?this.types[r]:null}validate(){function r(n,i,o,u){if(o.has(i))return o.get(i);o.set(i,!1),u.syntax!==null&&tle(u.syntax,function(s){if(s.type!=="Type"&&s.type!=="Property")return;const l=s.type==="Type"?n.types:n.properties,c=s.type==="Type"?t:a;(!hasOwnProperty.call(l,s.name)||r(n,s.name,c,l[s.name]))&&o.set(i,!0)},this)}let t=new Map,a=new Map;for(const n in this.types)r(this,n,t,this.types[n]);for(const n in this.properties)r(this,n,a,this.properties[n]);return t=[...t.keys()].filter(n=>t.get(n)),a=[...a.keys()].filter(n=>a.get(n)),t.length||a.length?{types:t,properties:a}:null}dump(r,t){return{generic:this.generic,units:this.units,types:yd(this.types,!t,r),properties:yd(this.properties,!t,r),atrules:Ale(this.atrules,!t,r)}}toString(){return JSON.stringify(this.dump())}}function ap(e,r){return typeof r=="string"&&/^\s*\|/.test(r)?typeof e=="string"?e+r:r.replace(/^\s*\|\s*/,""):r||null}function nv(e,r){const t=Object.create(null);for(const[a,n]of Object.entries(e))if(n){t[a]={};for(const i of Object.keys(n))r.includes(i)&&(t[a][i]=n[i])}return t}function xd(e,r){const t={...e};for(const[a,n]of Object.entries(r))switch(a){case"generic":t[a]=!!n;break;case"units":t[a]={...e[a]};for(const[i,o]of Object.entries(n))t[a][i]=Array.isArray(o)?o:[];break;case"atrules":t[a]={...e[a]};for(const[i,o]of Object.entries(n)){const u=t[a][i]||{},s=t[a][i]={prelude:u.prelude||null,descriptors:{...u.descriptors}};if(o){s.prelude=o.prelude?ap(s.prelude,o.prelude):s.prelude||null;for(const[l,c]of Object.entries(o.descriptors||{}))s.descriptors[l]=c?ap(s.descriptors[l],c):null;Object.keys(s.descriptors).length||(s.descriptors=null)}}break;case"types":case"properties":t[a]={...e[a]};for(const[i,o]of Object.entries(n))t[a][i]=ap(t[a][i],o);break;case"scope":t[a]={...e[a]};for(const[i,o]of Object.entries(n))t[a][i]={...t[a][i],...o};break;case"parseContext":t[a]={...e[a],...n};break;case"atrule":case"pseudo":t[a]={...e[a],...nv(n,["parse"])};break;case"node":t[a]={...e[a],...nv(n,["name","structure","parse","generate","walkContext"])};break}return t}function Ob(e){const r=qoe(e),t=Qoe(e),a=Hoe(e),{fromPlainObject:n,toPlainObject:i}=Goe(t),o={lexer:null,createLexer:u=>new av(u,o,o.lexer.structure),tokenize:vi,parse:r,generate:a,walk:t,find:t.find,findLast:t.findLast,findAll:t.findAll,fromPlainObject:n,toPlainObject:i,fork(u){const s=xd({},e);return Ob(typeof u=="function"?u(s,Object.assign):xd(s,u))}};return o.lexer=new av({generic:!0,units:e.units,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},o),o}const Dle=e=>Ob(xd({},e)),Ele={generic:!0,units:{angle:["deg","grad","rad","turn"],decibel:["db"],flex:["fr"],frequency:["hz","khz"],length:["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],resolution:["dpi","dpcm","dppx","x"],semitones:["st"],time:["s","ms"]},types:{"abs()":"abs( )","absolute-size":"xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large","acos()":"acos( )","alpha-value":"|","angle-percentage":"|","angular-color-hint":"","angular-color-stop":"&&?","angular-color-stop-list":"[ [, ]?]# , ","animateable-feature":"scroll-position|contents|","asin()":"asin( )","atan()":"atan( )","atan2()":"atan2( , )",attachment:"scroll|fixed|local","attr()":"attr( ? [, ]? )","attr-matcher":"['~'|'|'|'^'|'$'|'*']? '='","attr-modifier":"i|s","attribute-selector":"'[' ']'|'[' [|] ? ']'","auto-repeat":"repeat( [auto-fill|auto-fit] , [? ]+ ? )","auto-track-list":"[? [|]]* ? [? [|]]* ?",axis:"block|inline|vertical|horizontal","baseline-position":"[first|last]? baseline","basic-shape":"||||","bg-image":"none|","bg-layer":"|| [/ ]?||||||||","bg-position":"[[left|center|right|top|bottom|]|[left|center|right|] [top|center|bottom|]|[center|[left|right] ?]&&[center|[top|bottom] ?]]","bg-size":"[|auto]{1,2}|cover|contain","blur()":"blur( )","blend-mode":"normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity",box:"border-box|padding-box|content-box","brightness()":"brightness( )","calc()":"calc( )","calc-sum":" [['+'|'-'] ]*","calc-product":" ['*' |'/' ]*","calc-value":"||||( )","calc-constant":"e|pi|infinity|-infinity|NaN","cf-final-image":"|","cf-mixing-image":"?&&","circle()":"circle( []? [at ]? )","clamp()":"clamp( #{3} )","class-selector":"'.' ","clip-source":"",color:"|||||||||currentcolor|","color-stop":"|","color-stop-angle":"{1,2}","color-stop-length":"{1,2}","color-stop-list":"[ [, ]?]# , ",combinator:"'>'|'+'|'~'|['||']","common-lig-values":"[common-ligatures|no-common-ligatures]","compat-auto":"searchfield|textarea|push-button|slider-horizontal|checkbox|radio|square-button|menulist|listbox|meter|progress-bar|button","composite-style":"clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor","compositing-operator":"add|subtract|intersect|exclude","compound-selector":"[? * [ *]*]!","compound-selector-list":"#","complex-selector":" [? ]*","complex-selector-list":"#","conic-gradient()":"conic-gradient( [from ]? [at ]? , )","contextual-alt-values":"[contextual|no-contextual]","content-distribution":"space-between|space-around|space-evenly|stretch","content-list":"[|contents||||||]+","content-position":"center|start|end|flex-start|flex-end","content-replacement":"","contrast()":"contrast( [] )","cos()":"cos( )",counter:"|","counter()":"counter( , ? )","counter-name":"","counter-style":"|symbols( )","counter-style-name":"","counters()":"counters( , , ? )","cross-fade()":"cross-fade( , ? )","cubic-bezier-timing-function":"ease|ease-in|ease-out|ease-in-out|cubic-bezier( , , , )","deprecated-system-color":"ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText","discretionary-lig-values":"[discretionary-ligatures|no-discretionary-ligatures]","display-box":"contents|none","display-inside":"flow|flow-root|table|flex|grid|ruby","display-internal":"table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container","display-legacy":"inline-block|inline-list-item|inline-table|inline-flex|inline-grid","display-listitem":"?&&[flow|flow-root]?&&list-item","display-outside":"block|inline|run-in","drop-shadow()":"drop-shadow( {2,3} ? )","east-asian-variant-values":"[jis78|jis83|jis90|jis04|simplified|traditional]","east-asian-width-values":"[full-width|proportional-width]","element()":"element( , [first|start|last|first-except]? )|element( )","ellipse()":"ellipse( [{2}]? [at ]? )","ending-shape":"circle|ellipse","env()":"env( , ? )","exp()":"exp( )","explicit-track-list":"[? ]+ ?","family-name":"|+","feature-tag-value":" [|on|off]?","feature-type":"@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation","feature-value-block":" '{' '}'","feature-value-block-list":"+","feature-value-declaration":" : + ;","feature-value-declaration-list":"","feature-value-name":"","fill-rule":"nonzero|evenodd","filter-function":"|||||||||","filter-function-list":"[|]+","final-bg-layer":"<'background-color'>|||| [/ ]?||||||||","fixed-breadth":"","fixed-repeat":"repeat( [] , [? ]+ ? )","fixed-size":"|minmax( , )|minmax( , )","font-stretch-absolute":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|","font-variant-css21":"[normal|small-caps]","font-weight-absolute":"normal|bold|","frequency-percentage":"|","general-enclosed":"[ )]|( )","generic-family":"serif|sans-serif|cursive|fantasy|monospace|-apple-system","generic-name":"serif|sans-serif|cursive|fantasy|monospace","geometry-box":"|fill-box|stroke-box|view-box",gradient:"||||||<-legacy-gradient>","grayscale()":"grayscale( )","grid-line":"auto||[&&?]|[span&&[||]]","historical-lig-values":"[historical-ligatures|no-historical-ligatures]","hsl()":"hsl( [/ ]? )|hsl( , , , ? )","hsla()":"hsla( [/ ]? )|hsla( , , , ? )",hue:"|","hue-rotate()":"hue-rotate( )","hwb()":"hwb( [|none] [|none] [|none] [/ [|none]]? )","hypot()":"hypot( # )",image:"||||||","image()":"image( ? [? , ?]! )","image-set()":"image-set( # )","image-set-option":"[|] [||type( )]","image-src":"|","image-tags":"ltr|rtl","inflexible-breadth":"|min-content|max-content|auto","inset()":"inset( {1,4} [round <'border-radius'>]? )","invert()":"invert( )","keyframes-name":"|","keyframe-block":"# { }","keyframe-block-list":"+","keyframe-selector":"from|to|","lab()":"lab( [||none] [||none] [||none] [/ [|none]]? )","layer()":"layer( )","layer-name":" ['.' ]*","lch()":"lch( [||none] [||none] [|none] [/ [|none]]? )","leader()":"leader( )","leader-type":"dotted|solid|space|","length-percentage":"|","line-names":"'[' * ']'","line-name-list":"[|]+","line-style":"none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset","line-width":"|thin|medium|thick","linear-color-hint":"","linear-color-stop":" ?","linear-gradient()":"linear-gradient( [|to ]? , )","log()":"log( , ? )","mask-layer":"|| [/ ]?||||||[|no-clip]||||","mask-position":"[|left|center|right] [|top|center|bottom]?","mask-reference":"none||","mask-source":"","masking-mode":"alpha|luminance|match-source","matrix()":"matrix( #{6} )","matrix3d()":"matrix3d( #{16} )","max()":"max( # )","media-and":" [and ]+","media-condition":"|||","media-condition-without-or":"||","media-feature":"( [||] )","media-in-parens":"( )||","media-not":"not ","media-or":" [or ]+","media-query":"|[not|only]? [and ]?","media-query-list":"#","media-type":"","mf-boolean":"","mf-name":"","mf-plain":" : ","mf-range":" ['<'|'>']? '='? | ['<'|'>']? '='? | '<' '='? '<' '='? | '>' '='? '>' '='? ","mf-value":"|||","min()":"min( # )","minmax()":"minmax( [|min-content|max-content|auto] , [||min-content|max-content|auto] )","mod()":"mod( , )","name-repeat":"repeat( [|auto-fill] , + )","named-color":"transparent|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen|<-non-standard-color>","namespace-prefix":"","ns-prefix":"[|'*']? '|'","number-percentage":"|","numeric-figure-values":"[lining-nums|oldstyle-nums]","numeric-fraction-values":"[diagonal-fractions|stacked-fractions]","numeric-spacing-values":"[proportional-nums|tabular-nums]",nth:"|even|odd","opacity()":"opacity( [] )","overflow-position":"unsafe|safe","outline-radius":"|","page-body":"? [; ]?| ","page-margin-box":" '{' '}'","page-margin-box-type":"@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom","page-selector-list":"[#]?","page-selector":"+| *","page-size":"A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger","path()":"path( [ ,]? )","paint()":"paint( , ? )","perspective()":"perspective( [|none] )","polygon()":"polygon( ? , [ ]# )",position:"[[left|center|right]||[top|center|bottom]|[left|center|right|] [top|center|bottom|]?|[[left|right] ]&&[[top|bottom] ]]","pow()":"pow( , )","pseudo-class-selector":"':' |':' ')'","pseudo-element-selector":"':' ","pseudo-page":": [left|right|first|blank]",quote:"open-quote|close-quote|no-open-quote|no-close-quote","radial-gradient()":"radial-gradient( [||]? [at ]? , )",ratio:" [/ ]?","relative-selector":"? ","relative-selector-list":"#","relative-size":"larger|smaller","rem()":"rem( , )","repeat-style":"repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}","repeating-conic-gradient()":"repeating-conic-gradient( [from ]? [at ]? , )","repeating-linear-gradient()":"repeating-linear-gradient( [|to ]? , )","repeating-radial-gradient()":"repeating-radial-gradient( [||]? [at ]? , )","reversed-counter-name":"reversed( )","rgb()":"rgb( {3} [/ ]? )|rgb( {3} [/ ]? )|rgb( #{3} , ? )|rgb( #{3} , ? )","rgba()":"rgba( {3} [/ ]? )|rgba( {3} [/ ]? )|rgba( #{3} , ? )|rgba( #{3} , ? )","rotate()":"rotate( [|] )","rotate3d()":"rotate3d( , , , [|] )","rotateX()":"rotateX( [|] )","rotateY()":"rotateY( [|] )","rotateZ()":"rotateZ( [|] )","round()":"round( ? , , )","rounding-strategy":"nearest|up|down|to-zero","saturate()":"saturate( )","scale()":"scale( [|]#{1,2} )","scale3d()":"scale3d( [|]#{3} )","scaleX()":"scaleX( [|] )","scaleY()":"scaleY( [|] )","scaleZ()":"scaleZ( [|] )",scroller:"root|nearest","self-position":"center|start|end|self-start|self-end|flex-start|flex-end","shape-radius":"|closest-side|farthest-side","sign()":"sign( )","skew()":"skew( [|] , [|]? )","skewX()":"skewX( [|] )","skewY()":"skewY( [|] )","sepia()":"sepia( )",shadow:"inset?&&{2,4}&&?","shadow-t":"[{2,3}&&?]",shape:"rect( , , , )|rect( )","shape-box":"|margin-box","side-or-corner":"[left|right]||[top|bottom]","sin()":"sin( )","single-animation":"