sveast 0.9.2 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core.js +1 -1
- package/entities.js +1 -1
- package/index.d.ts +2 -9
- package/is-valid-type.js +1 -1
- package/lexer.js +3 -3
- package/module.js +1 -1
- package/package.json +1 -1
- package/parse-imports-exports.js +1 -1
- package/parse-module.js +1 -1
- package/parse-sections.js +1 -1
- package/parse.js +1 -1
- package/runes.js +1 -1
- package/shared-1z80250f.js +2 -0
- package/shared-2m9w933n.js +2 -0
- package/shared-3bhr0q10.js +2 -0
- package/shared-3ez2yv7r.js +2 -0
- package/{shared-3yc3kmnb.js → shared-4t495q2a.js} +1 -1
- package/shared-7q3geqgt.js +2 -0
- package/shared-bbp47cz4.js +10 -0
- package/{shared-k5pfyxpa.js → shared-bx03zqyq.js} +2 -2
- package/shared-cr4ebmgx.js +5 -0
- package/{shared-ff56bedk.js → shared-g06vtkxe.js} +2 -2
- package/shared-g7qbtk93.js +3 -0
- package/shared-j1r12f45.js +3 -0
- package/shared-njpj8eam.js +2 -0
- package/shared-qbw8n9am.js +2 -0
- package/shared-saxr459v.js +2 -0
- package/shared-wfjkg544.js +10 -0
- package/shared-wr6wdcs6.js +2 -0
- package/shared-xa3xp3kp.js +3 -0
- package/typescript.d.ts +3 -2
- package/typescript.js +1 -1
- package/walk.d.ts +1 -7
- package/walk.js +1 -1
- package/shared-00hyas4z.js +0 -2
- package/shared-40v3xx3k.js +0 -2
- package/shared-4y1phpr0.js +0 -3
- package/shared-5kdpxrm3.js +0 -5
- package/shared-a454y0yc.js +0 -2
- package/shared-fcgh2ks8.js +0 -2
- package/shared-np5jnnrw.js +0 -2
- package/shared-r6mb2ytj.js +0 -2
- package/shared-t30czg6b.js +0 -2
- package/shared-tgpdmrqm.js +0 -3
- package/shared-wkbh341y.js +0 -2
- package/shared-x7fez4k2.js +0 -3
- package/shared-yxr92tk5.js +0 -10
- package/shared-zd01zsyh.js +0 -10
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{W}from"./shared-3ez2yv7r.js";import{A,c,w,O,ne}from"./shared-cr4ebmgx.js";import{u,y}from"./shared-wfjkg544.js";import{e,Te,Ae,we,Ee,Ce,Ne,_e,Pe,Le,Ie,ue,$e,Re,fe,Oe,qe,De,Be,re,de,Me,me,Fe,Ve,h,We,je,ze,Ue,Ke,Ge,He,Qe,Xe,ye,Ye,Je,Ze,et,tt,it,se,rt,st,nt,xe,ot,at,lt,pt,n,ct,ht,ut,R,Q,T,ft,dt}from"./shared-bbp47cz4.js";import{S,s,i,t,z,U,K,I,G,p,k,H}from"./shared-wr6wdcs6.js";import{v}from"./shared-bx03zqyq.js";import{Y}from"./shared-njpj8eam.js";var Yn=/\r(?!\n)|[\u2028\u2029]/,J=/\s*}/y;function ee(r,o){let l=r.codePointAt(o);if(l===void 0||!u(l,!0))return o;let a=o+(l<=65535?1:2),d=r.codePointAt(a);while(d!==void 0&&y(d,!0))a+=d<=65535?1:2,d=r.codePointAt(a);return a}class be{source;index=0;loc;lfOnly;isTypeScript;typescript;entityNames;css;script;comments;root;stack;fragments;metaTags=new Set;lastAutoClosedTag;nextAngle=-1;nextBrace=-1;constructor(r,o,l,a={}){if(this.source=r,this.loc=a.loc??!1,this.lfOnly=this.loc&&!Yn.test(r),this.isTypeScript=z(r),this.typescript=l.typescript,this.isTypeScript&&!this.typescript)Y();this.entityNames=l.entityNames,this.css=a.css??!0,this.script=a.script??!0,this.comments=a.comments??!0,this.root={type:"Root",start:0,end:o,css:null,js:[],options:null,fragment:{type:"Fragment",nodes:[]},comments:[]},this.stack=[this.root],this.fragments=[this.root.fragment]}match(r){if(r.length===1)return this.source.charCodeAt(this.index)===r.charCodeAt(0);return this.source.startsWith(r,this.index)}matchRegex(r){return r.lastIndex=this.index,r.exec(this.source)?.[0]??null}eat(r,o=!1){if(this.match(r))return this.index+=r.length,!0;if(o)h(this.index,r);return!1}read(r){let o=this.matchRegex(r);if(o)this.index+=o.length;return o}readUntil(r){if(this.index>=this.source.length)n(this.source.length);let o=this.source.indexOf(r,this.index),l=o===-1?this.source.length:o,a=this.source.slice(this.index,l);return this.index=l,a}allowWhitespace(){this.index=t(this.source,this.index)}requireWhitespace(){if(!i(this.source.charCodeAt(this.index)))We(this.index);this.allowWhitespace()}eatClosingBrace(){this.allowWhitespace(),this.eat("}",!0)}sourceLocation(r,o){return this.loc?{start:c(r),end:c(o)}:void 0}readIdentifierName(){let r=this.index,o=ee(this.source,r),l=this.source.slice(r,o);if(this.index=o,R.has(l))ct(r,l);let a={type:"Identifier",name:l,start:r,end:o};if(this.loc)a.loc=this.sourceLocation(r,o);return a}current(){return this.stack[this.stack.length-1]}append(r){this.fragments[this.fragments.length-1].nodes.push(r)}open(r,o){this.append(r),this.stack.push(r),this.fragments.push(o)}setFragment(r){this.fragments[this.fragments.length-1]=r}close(){this.stack.pop(),this.fragments.pop()}}var Jn={"||":1,"??":1,"&&":2,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"+":9,"-":9,"*":10,"/":10,"%":10};function ve(r,o,l,a){return{type:"Literal",start:o,end:l,value:a,raw:r.slice(o,l)}}function pn(r,o){let l=r.charCodeAt(o);if(l===34||l===39){for(let d=o+1;d<r.length;d++){let f=r.charCodeAt(d);if(f===l)return ve(r,o,d+1,r.slice(o+1,d));if(f===92||f===10||f===13)return null}return null}let a=o;for(;a<r.length;a++){let d=r.charCodeAt(a);if(d<48||d>57)break}if(a===o||l===48&&a-o>1)return null;return ve(r,o,a,Number(r.slice(o,a)))}function mt(r,o,l){let a=ee(r,o);if(a===o)return pn(r,o);let d=r.slice(o,a);if(d==="true"||d==="false"||d==="null")return ve(r,o,a,d==="null"?null:d==="true");if(R.has(d))return null;let f={type:"Identifier",start:o,end:a,name:d};for(let m=a;;){let E=r.charCodeAt(m);if(E===40){let C=xt(r,m+1,l);if(!C)return null;f={type:"CallExpression",start:o,end:C.end,callee:f,arguments:C.arguments,optional:!1},m=C.end;continue}let x,g;if(E===46){if(g=ee(r,m+1),g===m+1)return null;x={type:"Identifier",start:m+1,end:g,name:r.slice(m+1,g)}}else if(E===91){if(x=pn(r,m+1),!x||r.charCodeAt(x.end)!==93)return null;g=x.end+1}else return f;f={type:"MemberExpression",start:o,end:g,object:f,property:x,computed:E===91,optional:!1},m=g}}function xt(r,o,l){let a=[],d=t(r,o);if(r.charCodeAt(d)===41)return{arguments:a,end:d+1};for(;;){let f=ie(r,d,l);if(!f)return null;a.push(f),d=t(r,f.end);let m=r.charCodeAt(d);if(m===41)return{arguments:a,end:d+1};if(m!==44)return null;if(d=t(r,d+1),r.charCodeAt(d)===41)return null}}function en(r,o,l){let a=r.charCodeAt(o),d=r.charCodeAt(o+1);if(!(a===33&&d!==61)&&!(a===45&&d!==45&&d!==61))return mt(r,o,l);let f=en(r,t(r,o+1),l);if(!f)return null;return{type:"UnaryExpression",start:o,end:f.end,operator:a===33?"!":"-",prefix:!0,argument:f}}function dn(r,o,l){let a=r.charCodeAt(o),d=r.charCodeAt(o+1);switch(a){case 124:return d===124&&r.charCodeAt(o+2)!==61?"||":null;case 38:return d===38&&r.charCodeAt(o+2)!==61?"&&":null;case 63:return d===63&&r.charCodeAt(o+2)!==61?"??":null;case 61:if(d!==61)return null;return r.charCodeAt(o+2)===61?"===":"==";case 33:if(d!==61)return null;return r.charCodeAt(o+2)===61?"!==":"!=";case 60:case 62:if(l||d===a)return null;if(d===61)return a===60?"<=":">=";return a===60?"<":">";case 43:return d===43||d===61?null:"+";case 45:return d===45||d===61?null:"-";case 42:return d===42||d===61?null:"*";case 47:return d===47||d===42||d===61?null:"/";case 37:return d===61?null:"%";default:return null}}function ke(r,o,l,a){if(fn(r.charCodeAt(o.end)))return o;let d=t(r,o.end),f=dn(r,d,a);if(f===null)return o;let m=Jn[f];if(m<=l)return o;let E=en(r,t(r,d+f.length),a);if(!E)return null;let x=ke(r,E,f==="??"?2:m,a);if(!x)return null;let g;if(f==="||"||f==="&&"||f==="??"){let C=dn(r,t(r,x.end),a);if(f==="??"?C==="||"||C==="&&":C==="??")return null;g={type:"LogicalExpression",start:o.start,end:x.end,left:o,operator:f,right:x}}else g={type:"BinaryExpression",start:o.start,end:x.end,left:o,operator:f,right:x};return ke(r,g,l,a)}function ie(r,o,l){let a=en(r,o,l);if(!a)return null;let d=ke(r,a,-1,l);if(!d||fn(r.charCodeAt(d.end)))return d;let f=t(r,d.end);if(r.charCodeAt(f)!==63)return d;let m=r.charCodeAt(f+1);if(m===46||m===63)return null;let E=ie(r,t(r,f+1),l);if(!E)return null;let x=t(r,E.end);if(r.charCodeAt(x)!==58)return null;let g=ie(r,t(r,x+1),l);if(!g)return null;return{type:"ConditionalExpression",start:d.start,end:g.end,test:d,consequent:E,alternate:g}}function fn(r){return r===125||r===41||r===44||r===58}function St(r,o){let l=r.charCodeAt(t(r,o));return l===125||l===41}function gt(r,o,l){let a=ie(r,o,l);return a&&St(r,a.end)?a:null}function B(r){switch(r.loc={start:w(r.start),end:w(r.end)},r.type){case"MemberExpression":B(r.object),B(r.property);break;case"CallExpression":B(r.callee);for(let o of r.arguments)B(o);break;case"UnaryExpression":B(r.argument);break;case"BinaryExpression":case"LogicalExpression":B(r.left),B(r.right);break;case"ConditionalExpression":B(r.test),B(r.consequent),B(r.alternate);break}}function _(r){let o=!r.loc||r.lfOnly?gt(r.source,r.index,r.isTypeScript):null;if(o){if(r.index=o.end,r.loc)B(o);return o}let{node:l,end:a}=T(r,r.source,r.index);return r.index=a,l}var At=new Set(["server","client","worker","test","default"]);function mn(r,o,l){let{source:a,index:d}=r;if(d>=a.length)n(a.length);let f=U(a,d);if(f===-1)re(a.length,"script");r.index=K(a,f);let m=r.script?Q(r,a.slice(0,f),d):{type:"Program",start:d,end:f,body:[],sourceType:"module"};if(m.start=d,m.loc)Object.assign(m.loc.start,w(o)),Object.assign(m.loc.end,w(r.index));else if(r.loc)m.loc={start:w(o),end:w(r.index)};let E="default";for(let x of l){if(At.has(x.name))Ge(x,x.name);if(x.name==="module"){if(x.value!==!0)Ue(x,x.name);E="module"}if(x.name==="context"){let g=x.value;if(!Array.isArray(g)||g.length!==1||g[0].type!=="Text"||g[0].data!=="module")Ke(x);E="module"}}return{type:"Script",start:o,end:r.index,context:E,content:m,attributes:l}}var yt=/(even|odd|\+?(\d+|\d*n(\s*[+-]\s*\d+)?)|-\d*n(\s*\+\s*\d+))((?=\s*[,)])|\s+of(\s+|(?=[.#[*:&])))/y,Tt=/\d+(\.\d+)?%/y,Et=/\\[0-9a-fA-F]{1,6}(\r\n|\s)?/y,Ct=/\s*>/y,D=-1,gn=34,bt=35,_t=36,vt=38,An=39,Pt=40,kt=41,ae=42,wt=43,Rt=45,Nt=46,yn=47,nn=58,Bt=59,Ot=60,hn=61,Lt=62,Dt=91,rn=92,Wt=93,Ft=94,Tn=123,tn=124,It=125,En=126,oe=[];function Cn(r,o,l){let a=r.index;oe=[];let d=r.css?Gt(r):Mt(r),f=r.index;return r.eat("</style",!0),r.read(Ct),{type:"StyleSheet",start:o,end:r.index,attributes:l,children:d,comments:oe,content:{start:a,end:f,styles:r.source.slice(a,f),comment:null}}}function Mt(r){return r.index=G(r.source,r.index),[]}function Gt(r){let o=[];for(;;){if(q(r,!0),r.match("</style")||r.index>=r.source.length)break;o.push(r.match("@")?bn(r):_n(r))}return o}function bn(r){let o=r.index;r.eat("@",!0);let l=F(r),a=on(r,!0),d=null;if(r.match("{"))d=kn(r);else r.eat(";",!0);return{type:"Atrule",start:o,end:r.index,name:l,prelude:a,block:d}}function _n(r){let o=r.index;return{type:"Rule",prelude:vn(r,!1),block:kn(r),start:o,end:r.index}}function vn(r,o){let l=[];q(r,!0);let a=r.index;while(r.index<r.source.length){l.push(qt(r,o));let d=r.index;if(q(r,!0),r.match(o?")":"{"))return{type:"SelectorList",start:a,end:d,children:l};r.eat(",",!0),q(r,!0)}return n(r.source.length)}function xn(r,o){return{type:"RelativeSelector",combinator:r,selectors:[],start:o,end:-1}}function qt(r,o){let{source:l,index:a}=r,d=[],f=xn(null,r.index);while(r.index<l.length){let m=r.index,E=l.charCodeAt(m),x=f.selectors;if(E===vt)r.index++,x.push({type:"NestingSelector",name:"&",start:m,end:r.index});else if(E===ae)r.index++,x.push(Sn(r,m,"*"));else if(E===bt)r.index++,x.push({type:"IdSelector",name:F(r),start:m,end:r.index});else if(E===Nt)r.index++,x.push({type:"ClassSelector",name:F(r),start:m,end:r.index});else if(E===nn){let P=l.charCodeAt(m+1)===nn;r.index+=P?2:1;let N=F(r),M=null;if(r.eat("("))M=vn(r,!0),r.eat(")",!0);if(P)x.push({type:"PseudoElementSelector",name:N,start:m,end:r.index,...M&&{args:M}});else x.push({type:"PseudoClassSelector",name:N,args:M,start:m,end:r.index})}else if(E===Dt)r.index++,x.push(Ut(r,m));else{let P=o?r.read(yt):null,N=!P&&s(E)?r.read(Tt):null;if(P)x.push({type:"Nth",value:P,start:m,end:r.index});else if(N)x.push({type:"Percentage",value:N,start:m,end:r.index});else if(Pn(l,m)===0){let M=F(r);x.push(Sn(r,m,M))}}let g=r.index;q(r,!1);let C=r.match(",")||r.match(o?")":"{");if(r.index=g,C)return f.end=g,d.push(f),{type:"ComplexSelector",start:a,end:g,children:d};let b=$t(r);if(b){if(f.selectors.length>0)f.end=g,d.push(f);if(f=xn(b,b.start),r.allowWhitespace(),r.match(",")||r.match(o?")":"{"))$e(r.index)}}return n(l.length)}function Sn(r,o,l){let a=l,d;if(r.eat("|"))d=a,a=r.eat("*")?"*":F(r);return{type:"TypeSelector",name:a,...d!==void 0&&{namespace:d},start:o,end:r.index}}function Ut(r,o){let l=r.source;r.allowWhitespace();let a=F(r);r.allowWhitespace();let d=null,f=null,m=l.charCodeAt(r.index);if(m===hn)f="=";else if((m===En||m===Ft||m===_t||m===ae||m===tn)&&l.charCodeAt(r.index+1)===hn)f=l.slice(r.index,r.index+2);if(f)r.index+=f.length,r.allowWhitespace(),d=Xt(r);r.allowWhitespace();let E=r.index;while(Rn(l.charCodeAt(r.index)))r.index++;let x=r.index>E?l.slice(E,r.index):null;return r.allowWhitespace(),r.eat("]",!0),{type:"AttributeSelector",start:o,end:r.index,name:a,matcher:f,value:d,flags:x}}function Pn(r,o){let l=r.charCodeAt(o);if(l===wt||l===En||l===Lt)return 1;if(l===tn&&r.charCodeAt(o+1)===tn)return 2;return 0}function $t(r){let o=r.index;r.allowWhitespace();let l=r.index,a=Pn(r.source,l);if(a>0){r.index+=a;let d=r.index;return r.allowWhitespace(),{type:"Combinator",name:r.source.slice(l,d),start:l,end:d}}if(r.index!==o)return{type:"Combinator",name:" ",start:o,end:r.index};return null}function kn(r){let o=r.index;r.eat("{",!0);let l=[];while(r.index<r.source.length){if(q(r,!0),r.match("}"))break;l.push(Vt(r))}return r.eat("}",!0),{type:"Block",start:o,end:r.index,children:l}}function Vt(r){if(r.match("@"))return bn(r);let o=r.index;on(r,!1);let l=r.source.charCodeAt(r.index);return r.index=o,l===Tn?_n(r):jt(r)}function jt(r){let{source:o,index:l}=r;if(l>=o.length)n(o.length);let a=l;while(a<o.length){let x=o.charCodeAt(a);if(x===nn||i(x))break;a++}let d=o.slice(l,a);r.index=a,r.allowWhitespace(),r.eat(":");let f=r.index;r.allowWhitespace();let m=on(r,!0);if(!m&&!d.startsWith("--"))Ie({start:l,end:f});let E=r.index;if(!r.match("}"))r.eat(";",!0);return{type:"Declaration",start:l,end:E,property:d,value:m}}function on(r,o){let l=r.source,a=l.length,d="",f=r.index,m=null,E=!1,x=!1,g=D,C=r.index;while(C<a){let b=l.charCodeAt(C);if(E){E=!1,C++;continue}if(b===rn){E=!0,C++;continue}if(b===g)g=D;else if(b===kt)x=!1;else if(g===D&&(b===gn||b===An))g=b;else if(b===Pt){if(Ht(l,d,f,C))x=!0}else if((b===Bt||b===Tn||b===It)&&!x&&g===D){if(r.index=C,!o)return"";if(d+=l.slice(f,C),m){let P=d.length-d.trimStart().length;for(let N of m)N.position=Math.max(0,(N.position??0)-P)}return d.trim()}else if(b===yn&&!x&&g===D&&l.charCodeAt(C+1)===ae){d+=l.slice(f,C),r.index=C;let P=wn(r);if(o)P.position=d.length,oe.push(P),m??=[],m.push(P);C=r.index,f=C;continue}C++}return r.index=a,n(a)}function Ht(r,o,l,a){if(a-l>=3)return r.charCodeAt(a-3)===117&&r.charCodeAt(a-2)===114&&r.charCodeAt(a-1)===108;return(o+r.slice(l,a)).endsWith("url")}function Xt(r){let o=r.source,l=D;if(r.eat('"'))l=gn;else if(r.eat("'"))l=An;let a=r.index,d=!1,f=a;while(f<o.length){let m=o.charCodeAt(f);if(d)d=!1;else if(m===rn)d=!0;else if(l===D?m===Wt||i(m):m===l)return r.index=l===D?f:f+1,o.slice(a,f).trim();f++}return r.index=f,n(o.length)}function F(r){let{source:o,index:l}=r,a=o.charCodeAt(l);if(s(a)||a===Rt&&s(o.charCodeAt(l+1)))ue(l);let d="",f=l,m=l;while(m<o.length){let E=o.charCodeAt(m);if(E===rn){d+=o.slice(f,m),r.index=m;let x=r.matchRegex(Et);if(x){let g=String.fromCodePoint(Number.parseInt(x.slice(1),16));d+=g==="\\"?"\\\\":g,m+=x.length}else d+=`\\${o[m+1]}`,m+=2;f=m}else if(E>=160||zt(E))m++;else break}if(d+=o.slice(f,m),r.index=m,d==="")ue(l);return d}function q(r,o){let l=r.source;r.allowWhitespace();for(;;){let a=l.charCodeAt(r.index);if(a===yn&&l.charCodeAt(r.index+1)===ae){let d=wn(r);if(o)oe.push(d)}else if(a===Ot&&r.eat("<!--"))r.readUntil("-->"),r.eat("-->",!0);else break;r.allowWhitespace()}}function wn(r){let o=r.index;r.eat("/*",!0);let l=r.readUntil("*/");return r.eat("*/",!0),{type:"CSSComment",value:l,start:o,end:r.index}}function Rn(r){return r>=65&&r<=90||r>=97&&r<=122}function zt(r){return Rn(r)||s(r)||r===95||r===45}var ln=/<\/textarea(\s[^>]*)?>/iy,Zt=/^![a-zA-Z]+$/,Kt=/^[a-zA-Z][a-zA-Z0-9]*:[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$/,Qt=/^[a-zA-Z][a-zA-Z0-9]*(-[a-zA-Z0-9.\-_\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}]*)?$/u,sn="\\u200C\\u200D",Yt=new RegExp(`^(?:\\p{Lu}[$${sn}\\p{ID_Continue}.]*|\\p{ID_Start}[$${sn}\\p{ID_Continue}]*(?:\\.[$${sn}\\p{ID_Continue}]+)+)$`,"u"),Jt=new Map([["use","UseDirective"],["animate","AnimateDirective"],["bind","BindDirective"],["class","ClassDirective"],["style","StyleDirective"],["on","OnDirective"],["let","LetDirective"],["in","TransitionDirective"],["out","TransitionDirective"],["transition","TransitionDirective"]]),cn=new Map([["svelte:head",["SvelteHead",!0]],["svelte:options",["SvelteOptions",!0]],["svelte:window",["SvelteWindow",!0]],["svelte:document",["SvelteDocument",!0]],["svelte:body",["SvelteBody",!0]],["svelte:element",["SvelteElement",!1]],["svelte:component",["SvelteComponent",!1]],["svelte:self",["SvelteSelf",!1]],["svelte:fragment",["SvelteFragment",!1]],["svelte:boundary",["SvelteBoundary",!1]]]),Nn=[...cn.keys()],er=`${Nn.slice(0,-1).join(", ")} or ${Nn.at(-1)}`,nr=62,Bn=123;function he(r,o){let l=r.index;if(l>=r.source.length)n(r.source.length);let a=k(r.source,l,o);return r.index=a,{name:r.source.slice(l,a),start:l,end:a,loc:r.sourceLocation(l,a)}}var X=(r,o,l,a=l)=>({start:r,end:o,type:"Text",raw:l,data:a});function tr(r){let o=r.charCodeAt(0);if(o>=97&&o<=122&&!r.includes("."))return!1;return Yt.test(r)}function rr(r){let o=!0;for(let l=0;l<r.length&&o;l++){let a=r.charCodeAt(l);o=a>=97&&a<=122||l>0&&a>=48&&a<=57}return o&&r.length>0||Zt.test(r)||Kt.test(r)||Qt.test(r)}function On(r,o){for(let l=r.length-1;l>=0;l--){let a=o(r[l]);if(a!==void 0)return a}return!1}function ir(r,o,l){let a=cn.get(o);if(a)return a[0];if(l)return"Component";if(o==="title"){if(On(r.stack,({type:f})=>{if(f==="SvelteHead")return!0;return f==="RegularElement"||f==="Component"?!1:void 0}))return"TitleElement"}if(o==="slot"){if(!On(r.stack,(f)=>f.type==="RegularElement"&&f.attributes.some((m)=>m.type==="Attribute"&&m.name==="shadowrootmode")?!0:void 0))return"SlotElement"}return"RegularElement"}function te(r){let o=r.index++;if(r.eat("!--")){let l=r.readUntil("-->");r.eat("-->",!0),r.append({type:"Comment",start:o,end:r.index,data:l})}else if(r.eat("/"))or(r,o);else sr(r,o)}function or(r,o){let{name:l}=he(r,!1);if(r.allowWhitespace(),r.eat(">",!0),I(l))ut(o);let a=r.current();while(!("name"in a)||a.name!==l){if(a.type!=="RegularElement"){let d=r.lastAutoClosedTag;if(d?.tag===l)Be(o,l,d.reason);De(o,l)}a.end=o,r.close(),a=r.current()}if(a.end=r.index,r.close(),r.stack.length<(r.lastAutoClosedTag?.depth??0))r.lastAutoClosedTag=void 0}function lr(r,o,l){return{type:r,start:o,end:-1,name:l}}function sr(r,o){let l=he(r,!1),{name:a}=l,d=cn.get(a);if(!d&&a.startsWith("svelte:"))et(l,er);let f=tr(a);if(!f&&!rr(a))lt(l);if(d?.[1]){if(r.metaTags.has(a))Ye(o,a);if(r.current().type!=="Root")Ze(o,a);r.metaTags.add(a)}let m=lr(ir(r,a,f),o,a);if(r.loc)m.name_loc=l.loc;m.attributes=[],m.fragment={type:"Fragment",nodes:[]},r.allowWhitespace();let E=r.current();if(E.type==="RegularElement"&&W(E.name,a))E.end=o,r.close(),r.lastAutoClosedTag={tag:E.name,reason:a,depth:r.stack.length};if((a==="script"||a==="style")&&r.current().type==="Root"){let g=[];m.attributes=g,Fn(r,g,fr),ar(r,m,o,g);return}if(Fn(r,m.attributes,hr),m.type==="SvelteComponent"){let g=Ln(m);if(!g)Xe(o);if(!Dn(g.value))Qe(g.start);m.expression=Wn(g.value)}else if(m.type==="SvelteElement"){let g=Ln(m);if(!g)ye(o);if(g.value===!0)ye(g);m.tag=Dn(g.value)?Wn(g.value):dr(g.value[0])}if(!r.eat("/")&&!I(a))if(r.eat(">",!0),a==="textarea")m.fragment.nodes=Mn(r,(g,C)=>(ln.lastIndex=C,ln.test(g)),"inside <textarea>"),r.read(ln);else if(a==="script"||a==="style")m.fragment.nodes.push(cr(r,`</${a}>`));else{r.open(m,m.fragment);return}else r.eat(">",!0);m.end=r.index,r.append(m)}function cr(r,o){let l=r.index,a=r.source.indexOf(o,l);r.index=a===-1?r.source.length:a;let d=X(l,r.index,r.source.slice(l,r.index));return r.eat(o,!0),d}function ar(r,o,l,a){r.eat(">",!0);let d=ur(r.root.fragment.nodes,l);if(o.name==="style"){let E=Cn(r,l,a);if(E.content.comment=d,r.root.css)He(l);r.root.css=E;return}let f=mn(r,l,a);if(d&&r.comments)f.content.leadingComments=[{type:"Line",value:d.data}];let m=f.context==="module"?"module":"instance";if(r.root[m])ze(l);r.root[m]=f}function ur(r,o){let l=r.length-1;if(l<0||r[l].end!==o)return null;for(let a=l;a>=0;a--){let d=r[a];if(d.type==="Comment")return d;if(d.type!=="Text"||d.data.trim())return null}return null}var pr=(r)=>r.type==="Attribute"&&r.name==="this";function Ln(r){let o=r.attributes.find(pr);if(o)r.attributes.splice(r.attributes.indexOf(o),1);return o}function Dn(r){if(r===!0)return!1;if(!Array.isArray(r))return!0;return r.length===1&&r[0].type==="ExpressionTag"}function Wn(r){return(Array.isArray(r)?r[0]:r).expression}function dr(r){if(r.type!=="Text")return r.expression;return{type:"Literal",value:r.data,raw:`'${r.raw}'`,start:r.start,end:r.end}}function Fn(r,o,l){let a=new Set;for(;;){let d=l(r);if(!d)return;let{type:f}=d;if(f==="Attribute"||f==="BindDirective"||f==="StyleDirective"||f==="ClassDirective"){let m=`${f==="BindDirective"?"Attribute":f}${d.name}`;if(a.has(m))Te(d);if(d.name!=="this")a.add(m)}o.push(d),r.allowWhitespace()}}function an(r,o,l,a,d){return r.loc?{type:"Attribute",start:l,end:a,name:o.name,name_loc:o.loc,value:d}:{type:"Attribute",start:l,end:a,name:o.name,value:d}}function In(r){if(p(r.source.charCodeAt(r.index)))h(r.index,"=")}function fr(r){let o=r.index,l=he(r,!0);if(!l.name)return null;let a=!0;if(r.eat("=")){r.allowWhitespace();let{source:d}=r,f=r.index,m=p(d.charCodeAt(f)),E=-1;if(m){let C=d.indexOf(d[f],f+1);if(C!==-1)E=C+1}if(E===-1){E=f;while(E<d.length&&d.charCodeAt(E)!==nr&&!i(d.charCodeAt(E)))E++;if(E===f)de(f)}r.index=E;let x=m?1:0,g=d.slice(f+x,E-x);a=[X(E-g.length-x,E-x,g,v(g,!0,r.entityNames))]}return In(r),an(r,l,o,r.index,a)}function mr(r){let o=r.index,l=r.match("/*");if(!l&&!r.match("//"))return!1;r.index+=2;let a=r.readUntil(l?"*/":`
|
|
2
|
+
`);if(l)r.eat("*/");let d={type:l?"Block":"Line",start:o,end:r.index,value:a},f=r.sourceLocation(o,r.index);if(f)d.loc=f;if(r.comments)r.root.comments.push(d);return!0}function hr(r){while(mr(r))r.allowWhitespace();let o=r.index;if(r.eat("{"))return xr(r,o);let l=he(r,!0);if(!l.name)return null;let a=r.index;r.allowWhitespace();let d=!0;if(r.eat("=")){if(r.allowWhitespace(),r.match("/>"))d=[X(r.index,r.index+1,"/")],r.index++;else d=Ar(r);a=r.index}else In(r);let f=l.name.indexOf(":"),m=f>0?Jt.get(l.name.slice(0,f)):void 0;return m?gr(r,m,l,f,o,a,d):an(r,l,o,a,d)}function xr(r,o){if(r.allowWhitespace(),r.eat("@attach")){r.requireWhitespace();let d=_(r);return r.eatClosingBrace(),{type:"AttachTag",start:o,end:r.index,expression:d}}if(r.eat("...")){let d=_(r);return r.eatClosingBrace(),{type:"SpreadAttribute",start:o,end:r.index,expression:d}}let l=r.readIdentifierName();if(l.name==="")Ae(o);r.eatClosingBrace();let a={type:"ExpressionTag",start:l.start,end:l.end,expression:l};return an(r,l,o,r.index,a)}function Sr(r){if(r===!0)return;return Array.isArray(r)?r[0]:r}function gr(r,o,l,a,d,f,m){let[E,...x]=l.name.slice(a+1).split("|");if(E==="")qe({start:d,end:d+a+1},l.name);let g={start:d,end:f,type:o,name:E};if(r.loc)g.name_loc=l.loc;if(o==="StyleDirective")return g.modifiers=x,g.value=m,g;let C=Sr(m);if(C&&(Array.isArray(m)&&m.length>1||C.type==="Text"))Oe(C.start);if(g.expression=C?.expression??null,g.modifiers=x,o==="TransitionDirective"){let b=l.name.slice(0,a);g.intro=b!=="out",g.outro=b!=="in"}if((o==="BindDirective"||o==="ClassDirective")&&!g.expression)g.expression={start:d+a+1,end:f,type:"Identifier",name:E};return g}function Ar(r){let o=r.source.charCodeAt(r.index),l=p(o);if(l){if(r.index++,r.source.charCodeAt(r.index)===o)return r.index++,[X(r.index-1,r.index-1,"")]}let a;try{a=Mn(r,l?(d,f)=>d.charCodeAt(f)===o:H,"in attribute value",l?o:void 0)}catch(d){let f=d instanceof e&&d.code==="js_parse_error"?d.position?.[0]:void 0;if(f!==void 0&&r.source.startsWith("/>",f-1))r.index=f,h(f,l?String.fromCharCode(o):"}");throw d}if(l)r.index++;else if(a.length===0)de(r.index);return l||a.length>1||a[0].type==="Text"?a:a[0]}function Mn(r,o,l,a){let{source:d}=r,f=[],m=r.index,E=(x)=>{if(x<=m)return;let g=d.slice(m,x);f.push(X(m,x,g,v(g,!0,r.entityNames)))};while(r.index<d.length){let x=r.index;if(o(d,x))return E(x),f;if(d.charCodeAt(x)!==Bn){if(r.index++,a!==void 0)while(r.index<d.length&&d.charCodeAt(r.index)!==Bn&&d.charCodeAt(r.index)!==a)r.index++;continue}r.index++;let g=d.charCodeAt(r.index);if(g===35||g===64){r.index++;let b=r.index;while(r.index<d.length&&d.charCodeAt(r.index)>=97&&d.charCodeAt(r.index)<=122)r.index++;let P=d.slice(b,r.index);(g===35?Ne:pt)(x,P,l)}E(x),r.allowWhitespace();let C=_(r);r.eatClosingBrace(),f.push({type:"ExpressionTag",start:x,end:r.index,expression:C}),m=r.index}n(d.length)}var yr=new Map([["html","html"],["svg","svg"],["mathml","mathml"],["http://www.w3.org/2000/svg","svg"],["http://www.w3.org/1998/Math/MathML","mathml"]]),Tr=new Map([["type",(r,o)=>{if(o!=="String"&&o!=="Number"&&o!=="Boolean"&&o!=="Array"&&o!=="Object")return!1;return r.type=o,!0}],["reflect",(r,o)=>{if(typeof o!=="boolean")return!1;return r.reflect=o,!0}],["attribute",(r,o)=>{if(typeof o!=="string")return!1;return r.attribute=o,!0}]]),Gn="[a-z0-9_.\\xB7\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u203F-\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u{10000}-\\u{EFFFF}-]",Er=new RegExp(`^[a-z]${Gn}*-${Gn}*$`,"u"),Cr=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" ")),Se=(r)=>(o,l)=>{let a=ge(l);if(typeof a!=="boolean")se(l,"true or false");o[r]=a},br=new Map([["runes",Se("runes")],["immutable",Se("immutable")],["preserveWhitespace",Se("preserveWhitespace")],["accessors",Se("accessors")],["namespace",(r,o)=>{let l=yr.get(ge(o));if(!l)se(o,'"html", "mathml" or "svg"');r.namespace=l}],["css",(r,o)=>{if(ge(o)!=="injected")se(o,'"injected"');r.css="injected"}],["tag",(r,o)=>tt(o)],["customElement",(r,o)=>{let l=vr(o);if(l)r.customElement=l}]]);function Un(r){let o=[],l={start:r.start,end:r.end,attributes:o};for(let a of r.attributes){if(a.type!=="Attribute")it(a);o.push(a);let d=br.get(a.name);if(!d)at(a,a.name);d(l,a)}return l}function ge({value:r}){if(r===!0)return!0;let o=Array.isArray(r)?r:[r];if(o.length===0)return!0;if(o.length>1)return null;let[l]=o;if(l.type==="Text")return l.data;return l.expression.type==="Literal"?l.expression.value:null}function qn(r,o){if(typeof o!=="string")xe(r);if(!o)return;if(!Er.test(o))xe(r);if(Cr.has(o))ot(r)}function un(r){return r.type==="Property"&&!r.computed&&r.key.type==="Identifier"}function _r(r,o){let l=new Map;for(let a of r.properties){if(!un(a))o();if(!l.has(a.key.name))l.set(a.key.name,a.value)}return l}function vr(r){let o=()=>rt(r);if(r.value===!0)o();let l=Array.isArray(r.value)?r.value[0]:r.value;if(l.type==="Text"){let C=ge(r);return qn(r,C),{tag:C}}let{expression:a}=l;if(a.type!=="ObjectExpression"){if(a.type==="Literal"&&a.value===null)return;o()}let d=_r(a,o),f={},m=d.get("tag");if(m){let C=m.type==="Literal"?m.value:void 0;qn(null,C),f.tag=C}let E=d.get("props");if(E){let C=()=>st(r);if(E.type!=="ObjectExpression")C();f.props={};for(let b of E.properties){if(!un(b)||b.value.type!=="ObjectExpression")C();let P={};f.props[b.key.name]=P;for(let N of b.value.properties){if(!un(N)||N.value.type!=="Literal")C();if(!Tr.get(N.key.name)?.(P,N.value.value))C()}}}let x=d.get("shadow");if(x)if(x.type==="ObjectExpression")f.shadow=x;else if(x.type==="Literal"&&(x.value==="open"||x.value==="none"))f.shadow=x.value;else nt(r);let g=d.get("extend");if(g)f.extend=g;return f}var Pr={"{":"}","(":")","[":"]"};function Z(r,o,l=Pr){let a=Object.values(l),d=[],f=o;while(f<r.length){let m=r[f++];if(m==="'"||m==='"'||m==="`")f=kr(r,f,m);else if(Object.hasOwn(l,m))d.push(m);else if(a.includes(m)){let E=l[d.pop()??""];if(m!==E)h(f-1,E);if(d.length===0)return f}}n(r.length)}function kr(r,o,l){let a=o;while(a<r.length){let d=r[a++];if(d===l)return a;if(d==="\\")a++;else if(l==="`"&&d==="$"&&r[a]==="{")a=Z(r,a)}ht(o)}var wr=/\?\s*:/g;function j(r){let o=r.index,l=r.readIdentifierName();if(l.name!=="")return{...l,typeAnnotation:$n(r)};let a=r.source[r.index];if(a!=="{"&&a!=="[")Fe(r.index);r.index=Z(r.source,o);let d=ft(r,r.source.slice(0,r.index),o)??Rr(r,o);ne(d,"ObjectPattern","ArrayPattern");let f=$n(r);if(d.typeAnnotation=f,f)d.end=f.end;return d}function Rr(r,o){let{node:l}=T(r,`${r.source.slice(0,r.index)} = 1`,o);return ne(l,"AssignmentExpression"),l.left}function $n(r){let o=r.index;if(r.allowWhitespace(),!r.eat(":")){r.index=o;return}let l="_ as ",a=r.index-l.length,d=r.source.slice(0,a)+l+r.source.slice(r.index).replace(wr,":"),f=T(r,d,a).node;if(f.type==="AssignmentExpression"){let m=f.right.start;while(d[m]!=="=")m-=1;f=T(r,d.slice(0,m),a).node}if(f.type==="SequenceExpression")f=f.expressions[0];return ne(f,"TSAsExpression"),r.index=f.end,{type:"TSTypeAnnotation",start:o,end:r.index,typeAnnotation:f.typeAnnotation}}var Nr={IfBlock:"if",EachBlock:"each",KeyBlock:"key",AwaitBlock:"await",SnippetBlock:"snippet"},L=()=>({type:"Fragment",nodes:[]});function jn(r,o){if(r.eat("if")){r.requireWhitespace();let l=_(r);r.eatClosingBrace();let a=L();r.open({type:"IfBlock",elseif:!1,start:o,end:-1,test:l,consequent:a,alternate:null},a)}else if(r.eat("each"))Or(r,o);else if(r.eat("await")){r.requireWhitespace();let l=_(r);r.allowWhitespace();let a={type:"AwaitBlock",start:o,end:-1,expression:l,value:null,error:null,pending:null,then:null,catch:null},d=L();if(r.eat("then"))a.value=Vn(r),a.then=d;else if(r.eat("catch"))a.error=Vn(r),a.catch=d;else a.pending=d;r.eat("}",!0),r.open(a,d)}else if(r.eat("key")){r.requireWhitespace();let l=_(r);r.eatClosingBrace();let a=L();r.open({type:"KeyBlock",start:o,end:-1,expression:l,fragment:a},a)}else if(r.eat("snippet"))Lr(r,o);else Me(r.index)}function Vn(r){if(r.matchRegex(J))return r.allowWhitespace(),null;r.requireWhitespace();let o=j(r);return r.allowWhitespace(),o}function Br(r){let o={assertion:null},l=r.end,a=(f)=>{if(f.type==="TSAsExpression"&&f.end===r.end)return o.assertion=f,l=f.expression.end,f.expression;return O(f,a),f},d=r;if(r.type==="TSAsExpression")o.assertion=r,d=r.expression,l=d.end;else O(r,a);return d.end=l,{expression:d,assertion:o.assertion}}function Or(r,o){r.requireWhitespace();let l=r.source,a;while(!a)try{a=_(r)}catch(x){let C=((x instanceof e?x.position:void 0)?.[0]??o)-2;while(C>o&&r.source.slice(C,C+2)!=="as")C-=1;if(C<=o)throw r.source=l,x;r.source=l.slice(0,C)}if(r.source=l,r.allowWhitespace(),!r.match("as")){if(a.type==="SequenceExpression")a=a.expressions[0];let x=Br(a);if(a=x.expression,x.assertion){let g=x.assertion.typeAnnotation.start-2;while(r.source.slice(g,g+2)!=="as")g-=1;r.index=g}}let d=null,f,m;if(r.eat("as"))r.requireWhitespace(),d=j(r);else r.index=a.end;if(r.allowWhitespace(),r.eat(",")){if(r.allowWhitespace(),f=r.readIdentifierName().name,!f)me(r.index);r.allowWhitespace()}if(r.eat("("))r.allowWhitespace(),m=_(r),r.allowWhitespace(),r.eat(")",!0),r.allowWhitespace();r.eat("}",!0);let E=L();r.open({type:"EachBlock",start:o,end:-1,expression:a,body:E,context:d,index:f,key:m},E)}function Lr(r,o){r.requireWhitespace();let l=r.readIdentifierName();if(l.name==="")me(r.index);r.allowWhitespace();let a=r.index,d;if(r.isTypeScript&&r.match("<")){let x=Z(r.source,a,{"<":">"});d=r.source.slice(a+1,x-1),r.index=x}r.allowWhitespace(),r.eat("(",!0);let f=1;while(r.index<r.source.length&&(!r.match(")")||f!==1)){if(r.match("("))f++;if(r.match(")"))f--;r.index+=1}r.eat(")",!0);let{node:m}=T(r,`${r.source.slice(0,r.index)} => {}`,a,!0);r.eatClosingBrace();let E=L();r.open({type:"SnippetBlock",start:o,end:-1,expression:l,typeParams:d,parameters:m.type==="ArrowFunctionExpression"?m.params:void 0,body:E},E)}function Hn(r,o){let l=r.index-1,a=r.current();if(a.type==="IfBlock"){if(!r.eat("else"))h(l,"{:else} or {:else if}");if(r.eat("if"))Ce(l);if(r.allowWhitespace(),a.alternate=L(),r.setFragment(a.alternate),r.eat("if")){r.requireWhitespace();let d=_(r);r.eatClosingBrace();let f=L();r.open({start:o,end:-1,type:"IfBlock",elseif:!0,test:d,consequent:f,alternate:null},f)}else r.eatClosingBrace()}else if(a.type==="EachBlock"){if(!r.eat("else"))h(l,"{:else}");r.eatClosingBrace(),a.fallback=L(),r.setFragment(a.fallback)}else if(a.type==="AwaitBlock"){let d;if(r.eat("then"))d="then";else if(r.eat("catch"))d="catch";else h(l,"{:then ...} or {:catch ...}");if(a[d])we(l,`{:${d}}`);if(!r.eat("}")){r.requireWhitespace();let m=j(r);if(d==="then")a.value=m;else a.error=m;r.eatClosingBrace()}let f=L();a[d]=f,r.setFragment(f)}else Ee(l)}function Xn(r){let o=r.current(),l=Nr[o.type];if(!l)Pe(r.index-1);r.eat(l,!0),r.eatClosingBrace();while(o.type==="IfBlock"&&o.elseif)o.end=r.index,r.close(),o=r.current();o.end=r.index,r.close()}function Dr(r){return r.type==="CallExpression"||r.type==="ChainExpression"&&r.expression.type==="CallExpression"}function zn(r,o){if(r.eat("html")){r.requireWhitespace();let l=_(r);r.eatClosingBrace(),r.append({type:"HtmlTag",start:o,end:r.index,expression:l})}else if(r.eat("debug")){let l=[];if(!r.read(J)){let a=_(r),d=a.type==="SequenceExpression"?a.expressions:[a];for(let f of d){if(f.type!=="Identifier")Re(f.start);l.push(f)}r.eatClosingBrace()}r.append({type:"DebugTag",start:o,end:r.index,identifiers:l})}else if(r.eat("const")){r.requireWhitespace();let l=j(r);r.allowWhitespace(),r.eat("=",!0),r.allowWhitespace();let a=r.index,d=_(r),f=r.index;if(d.type==="SequenceExpression"&&!r.source.slice(a,d.start).includes("("))Le(d);r.eatClosingBrace();let m={type:"VariableDeclarator",id:l,init:d,start:l.start,end:f};r.append({type:"ConstTag",start:o,end:r.index,declaration:{type:"VariableDeclaration",kind:"const",declarations:[m],start:o+2,end:r.index-1}})}else if(r.eat("render")){r.requireWhitespace();let l=_(r);if(!Dr(l))je(l);r.eatClosingBrace(),r.append({type:"RenderTag",start:o,end:r.index,expression:l})}else Ve(r.index)}var Wr=/(?:var|interface|enum)\b/y,Fr=/(?:let|const|type)\b/y;function Zn(r){let o=r.index;if(r.index+=1,r.allowWhitespace(),r.eat("#"))jn(r,o);else if(r.eat(":"))Hn(r,o);else if(r.eat("@"))zn(r,o);else if(r.match("/")&&!r.match("/*")&&!r.match("//"))r.index+=1,Xn(r);else if(!Ir(r,o)){let l=_(r);r.eatClosingBrace(),r.append({type:"ExpressionTag",start:o,end:r.index,expression:l})}}function Ir(r,o){let l=r.index,a=r.matchRegex(Wr);if(a)fe({start:l,end:l+a.length});if(!r.matchRegex(Fr))return!1;let d=r.root.comments.length,f=dt(r,r.source,l);if(f.type==="ExpressionStatement")return r.root.comments.length=d,!1;if(f.type!=="VariableDeclaration"||f.kind!=="let"&&f.kind!=="const")fe(f);return r.index=f.end,r.eatClosingBrace(),r.append({type:"DeclarationTag",start:o,end:r.index,declaration:f}),!0}function Qn(r){let{source:o,index:l}=r;if(r.nextAngle<l)r.nextAngle=Kn(o,"<",l);if(r.nextBrace<l)r.nextBrace=Kn(o,"{",l);let a=Math.min(r.nextAngle,r.nextBrace);r.index=a;let d=o.slice(l,a);r.append({type:"Text",start:l,end:a,raw:d,data:v(d,!1,r.entityNames)})}function Kn(r,o,l){let a=r.indexOf(o,l);return a===-1?r.length:a}function V(r,o,l){let a=le(r,o,l);while(a.index<a.source.length)ce(a);return pe(a)}function le(r,o,l){let a=S(r);return A(a),new be(a.trimEnd(),a.length,l,o)}function pe(r){if(r.stack.length>1){let d=r.current();if(d.end=d.start+1,d.type==="RegularElement")re(d,d.name);_e(d)}let{nodes:o}=r.root.fragment,l=o.findIndex((d)=>d.type==="SvelteOptions"),a=o[l];if(a?.type==="SvelteOptions"){o.splice(l,1),r.root.options=Un(a);let{nodes:d}=a.fragment;if(d.length>0)Je({start:d[0].start,end:d[d.length-1].end},a.name)}return r.root}function ce(r){if(r.match("<"))te(r);else if(r.match("{"))Zn(r);else Qn(r)}
|
|
3
|
+
export{te,V,le,pe,ce};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function yt(t){return{support:"typescript",parser:t}}function xt(t){return{support:"entities",names:t}}function X(t){return t&&"parser"in t?t.parser:void 0}function gt(t){return t&&"names"in t?t.names:void 0}function Y(){throw Error('sveast: parsing TypeScript needs `typescript` from "sveast/typescript": createParser({ typescript }) or createModuleParser({ typescript })')}
|
|
2
|
+
export{yt,xt,X,gt,Y};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{A}from"./shared-cr4ebmgx.js";import{mt}from"./shared-bbp47cz4.js";import{j}from"./shared-xa3xp3kp.js";function b(t,r,o){A(t);let e={isTypeScript:r.typescript??!1,typescript:o,loc:!1,comments:!1,root:{comments:[]}};return mt(e,t,(s)=>j(t,r.localExports??!0,s))}
|
|
2
|
+
export{b};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var lt={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"},ct="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",jt={5:ct,"5module":ct+" export import",6:ct+" const class extends export import super"},At=/^in(stanceof)?$/,Gt=/\p{ID_Start}/u,Ht=/[\p{ID_Continue}\u200c\u200d]/u;function u(t,e){if(t<65)return t===36;if(t<91)return!0;if(t<97)return t===95;if(t<123)return!0;if(t>65535&&e===!1)return!1;return t>=170&&Gt.test(String.fromCodePoint(t))}function y(t,e){if(t<48)return t===36;if(t<58)return!0;if(t<65)return!1;if(t<91)return!0;if(t<97)return t===95;if(t<123)return!0;if(t>65535&&e===!1)return!1;return t>=170&&Ht.test(String.fromCodePoint(t))}var k=function(e,i){if(i===void 0)i={};this.label=e,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null};function T(t,e){return new k(t,{beforeExpr:!0,binop:e})}var P={beforeExpr:!0},E={startsExpr:!0},mt={};function b(t,e){if(e===void 0)e={};return e.keyword=t,mt[t]=new k(t,e)}var n={num:new k("num",E),regexp:new k("regexp",E),string:new k("string",E),name:new k("name",E),privateId:new k("privateId",E),eof:new k("eof"),bracketL:new k("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new k("]"),braceL:new k("{",{beforeExpr:!0,startsExpr:!0}),braceR:new k("}"),parenL:new k("(",{beforeExpr:!0,startsExpr:!0}),parenR:new k(")"),comma:new k(",",P),semi:new k(";",P),colon:new k(":",P),dot:new k("."),question:new k("?",P),questionDot:new k("?."),arrow:new k("=>",P),template:new k("template"),invalidTemplate:new k("invalidTemplate"),ellipsis:new k("...",P),backQuote:new k("`",E),dollarBraceL:new k("${",{beforeExpr:!0,startsExpr:!0}),eq:new k("=",{beforeExpr:!0,isAssign:!0}),assign:new k("_=",{beforeExpr:!0,isAssign:!0}),incDec:new k("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new k("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:T("||",1),logicalAND:T("&&",2),bitwiseOR:T("|",3),bitwiseXOR:T("^",4),bitwiseAND:T("&",5),equality:T("==/!=/===/!==",6),relational:T("</>/<=/>=",7),bitShift:T("<</>>/>>>",8),plusMin:new k("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:T("%",10),star:T("*",10),slash:T("/",10),starstar:new k("**",{beforeExpr:!0}),coalesce:T("??",1),_break:b("break"),_case:b("case",P),_catch:b("catch"),_continue:b("continue"),_debugger:b("debugger"),_default:b("default",P),_do:b("do",{isLoop:!0,beforeExpr:!0}),_else:b("else",P),_finally:b("finally"),_for:b("for",{isLoop:!0}),_function:b("function",E),_if:b("if"),_return:b("return",P),_switch:b("switch"),_throw:b("throw",P),_try:b("try"),_var:b("var"),_const:b("const"),_while:b("while",{isLoop:!0}),_with:b("with"),_new:b("new",{beforeExpr:!0,startsExpr:!0}),_this:b("this",E),_super:b("super",E),_class:b("class",E),_extends:b("extends",P),_export:b("export"),_import:b("import",E),_null:b("null",E),_true:b("true",E),_false:b("false",E),_in:b("in",{beforeExpr:!0,binop:7}),_instanceof:b("instanceof",{beforeExpr:!0,binop:7}),_typeof:b("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:b("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:b("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},N=/\r\n?|\n|\u2028|\u2029/,Yt=new RegExp(N.source,"g");function z(t){return t===10||t===13||t===8232||t===8233}function Et(t,e,i){if(i===void 0)i=t.length;for(var s=e;s<i;s++){var o=t.charCodeAt(s);if(z(o))return s<i-1&&o===13&&t.charCodeAt(s+1)===10?s+2:s+1}return-1}var Nt=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,S=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Tt=Object.prototype,{hasOwnProperty:Qt,toString:Kt}=Tt,Q=Object.hasOwn||function(t,e){return Qt.call(t,e)},wt=Array.isArray||function(t){return Kt.call(t)==="[object Array]"},St=Object.create(null);function tt(t){return St[t]||(St[t]=new RegExp("^(?:"+t.replace(/ /g,"|")+")$"))}function rt(t){if(t<=65535)return String.fromCharCode(t);return t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320)}var Xt=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Y=function(e,i){this.line=e,this.column=i};Y.prototype.offset=function(e){return new Y(this.line,this.column+e)};var at=function(e,i,s){if(this.start=i,this.end=s,e.sourceFile!==null)this.source=e.sourceFile};function Pt(t,e){for(var i=1,s=0;;){var o=Et(t,s,e);if(o<0)return new Y(i,e-s);++i,s=o}}var ut={ecmaVersion:null,sourceType:"script",strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Ct=!1;function Jt(t){var e={};for(var i in ut)e[i]=t&&Q(t,i)?t[i]:ut[i];if(e.ecmaVersion==="latest")e.ecmaVersion=1e8;else if(e.ecmaVersion==null){if(!Ct&&typeof console==="object"&&console.warn)Ct=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
2
|
+
Defaulting to 2020, but this will stop working in the future.`);e.ecmaVersion=11}else if(e.ecmaVersion>=2015)e.ecmaVersion-=2009;if(e.allowReserved==null)e.allowReserved=e.ecmaVersion<5;if(!t||t.allowHashBang==null)e.allowHashBang=e.ecmaVersion>=14;if(wt(e.onToken)){var s=e.onToken;e.onToken=function(o){return s.push(o)}}if(wt(e.onComment))e.onComment=Zt(e,e.onComment);if(e.sourceType==="commonjs"&&e.allowAwaitOutsideFunction)throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return e}function Zt(t,e){return function(i,s,o,h,p,l){var c={type:i?"Block":"Line",value:s,start:o,end:h};if(t.locations)c.loc=new at(this,p,l);if(t.ranges)c.range=[o,h];e.push(c)}}var F=1,O=2,vt=4,It=8,xt=16,_t=32,nt=64,Lt=128,B=256,K=512,Rt=1024,ot=F|O|B;function yt(t,e){return O|(t?vt:0)|(e?It:0)}var et=0,bt=1,R=2,Vt=3,Ft=4,Ot=5,r=function(e,i,s){this.options=e=Jt(e),this.sourceFile=e.sourceFile,this.keywords=tt(jt[e.ecmaVersion>=6?6:e.sourceType==="module"?"5module":5]);var o="";if(e.allowReserved!==!0){if(o=lt[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType==="module")o+=" await"}this.reservedWords=tt(o);var h=(o?o+" ":"")+lt.strict;if(this.reservedWordsStrict=tt(h),this.reservedWordsStrictBind=tt(h+" "+lt.strictBind),this.input=String(i),this.containsEsc=!1,this.pos=s||0,this.curLine=1,e.startLocation)this.lineStart=this.pos-e.startLocation.column,this.curLine=e.startLocation.line;else if(s){if(this.lineStart=this.input.lastIndexOf(`
|
|
3
|
+
`,s-1)+1,this.options.locations)this.curLine=this.input.slice(0,this.lineStart).split(N).length}else this.lineStart=0;if(this.type=n.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=e.sourceType==="module",this.strict=this.inModule||e.strict===!0||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&&e.allowHashBang&&this.input.slice(0,2)==="#!")this.skipLineComment(2);this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?O:F),this.regexpState=null,this.privateNameStack=[]},I={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};r.prototype.parse=function(){var e=this,i=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return e.parseTopLevel(i)})};I.inFunction.get=function(){return(this.currentVarScope().flags&O)>0};I.inGenerator.get=function(){return(this.currentVarScope().flags&It)>0};I.inAsync.get=function(){return(this.currentVarScope().flags&vt)>0};I.canAwait.get=function(){for(var t=this.scopeStack.length-1;t>=0;t--){var e=this.scopeStack[t],i=e.flags;if(i&(B|K))return!1;if(i&O)return(i&vt)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};I.allowReturn.get=function(){if(this.inFunction)return!0;if(this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&F)return!0;return!1};I.allowSuper.get=function(){var t=this.currentThisScope(),e=t.flags;return(e&nt)>0||this.options.allowSuperOutsideMethod};I.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Lt)>0};I.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};I.allowNewDotTarget.get=function(){for(var t=this.scopeStack.length-1;t>=0;t--){var e=this.scopeStack[t],i=e.flags;if(i&(B|K)||i&O&&!(i&xt))return!0}return!1};I.allowUsing.get=function(){var t=this.currentScope(),e=t.flags;if(e&Rt)return!1;if(!this.inModule&&e&F)return!1;return!0};I.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&B)>0};r.extend=function(){var e=[],i=arguments.length;while(i--)e[i]=arguments[i];var s=this;for(var o=0;o<e.length;o++)s=e[o](s);return s};r.parse=function(e,i){return new this(i,e).parse()};r.parseExpressionAt=function(e,i,s){var o=new this(s,e,i);return o.nextToken(),o.parseExpression()};r.tokenizer=function(e,i){return new this(i,e)};Object.defineProperties(r.prototype,I);var A=r.prototype,$t=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;A.strictDirective=function(t){if(this.options.ecmaVersion<5)return!1;for(;;){S.lastIndex=t,t+=S.exec(this.input)[0].length;var e=$t.exec(this.input.slice(t));if(!e)return!1;if((e[1]||e[2])==="use strict"){S.lastIndex=t+e[0].length;var i=S.exec(this.input),s=i.index+i[0].length,o=this.input.charAt(s);return o===";"||o==="}"||N.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(o)||o==="!"&&this.input.charAt(s+1)==="=")}if(t+=e[0].length,S.lastIndex=t,t+=S.exec(this.input)[0].length,this.input[t]===";")t++}};A.eat=function(t){if(this.type===t)return this.next(),!0;else return!1};A.isContextual=function(t){return this.type===n.name&&this.value===t&&!this.containsEsc};A.eatContextual=function(t){if(!this.isContextual(t))return!1;return this.next(),!0};A.catchStackOverflow=function(t){try{return t()}catch(e){if(e instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message)||/\btoo much recursion\b/i.test(e.message)))this.raise(this.start,"Not enough stack space to parse input");else throw e}};A.expectContextual=function(t){if(!this.eatContextual(t))this.unexpected()};A.canInsertSemicolon=function(){return this.type===n.eof||this.type===n.braceR||N.test(this.input.slice(this.lastTokEnd,this.start))};A.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return!0}};A.semicolon=function(){if(!this.eat(n.semi)&&!this.insertSemicolon())this.unexpected()};A.afterTrailingComma=function(t,e){if(this.type===t){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);if(!e)this.next();return!0}};A.expect=function(t){this.eat(t)||this.unexpected()};A.unexpected=function(t){this.raise(t!=null?t:this.start,"Unexpected token")};var ht=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};A.checkPatternErrors=function(t,e){if(!t)return;if(t.trailingComma>-1)this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");var i=e?t.parenthesizedAssign:t.parenthesizedBind;if(i>-1)this.raiseRecoverable(i,e?"Assigning to rvalue":"Parenthesized pattern")};A.checkExpressionErrors=function(t,e){if(!t)return!1;var{shorthandAssign:i,doubleProto:s}=t;if(!e)return i>=0||s>=0;if(i>=0)this.raise(i,"Shorthand property assignments are valid only in destructuring patterns");if(s>=0)this.raiseRecoverable(s,"Redefinition of __proto__ property")};A.checkYieldAwaitInDefaultParams=function(){if(this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos))this.raise(this.yieldPos,"Yield expression cannot be a default value");if(this.awaitPos)this.raise(this.awaitPos,"Await expression cannot be a default value")};A.isSimpleAssignTarget=function(t){if(t.type==="ParenthesizedExpression")return this.isSimpleAssignTarget(t.expression);return t.type==="Identifier"||t.type==="MemberExpression"};var f=r.prototype;f.parseTopLevel=function(t){var e=Object.create(null);if(!t.body)t.body=[];while(this.type!==n.eof){var i=this.parseStatement(null,!0,e);t.body.push(i)}if(this.inModule)for(var s=0,o=Object.keys(this.undefinedExports);s<o.length;s+=1){var h=o[s];this.raiseRecoverable(this.undefinedExports[h].start,"Export '"+h+"' is not defined")}return this.adaptDirectivePrologue(t.body),this.next(),t.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(t,"Program")};var kt={kind:"loop"},te={kind:"switch"};f.isLet=function(t){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;S.lastIndex=this.pos;var e=S.exec(this.input),i=this.pos+e[0].length,s=this.fullCharCodeAt(i);if(s===91||s===92)return!0;if(t)return!1;if(s===123)return!0;if(u(s)){var o=i;do i+=s<=65535?1:2;while(y(s=this.fullCharCodeAt(i)));if(s===92)return!0;var h=this.input.slice(o,i);if(!At.test(h))return!0}return!1};f.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;S.lastIndex=this.pos;var t=S.exec(this.input),e=this.pos+t[0].length,i;return!N.test(this.input.slice(this.pos,e))&&this.input.slice(e,e+8)==="function"&&(e+8===this.input.length||!(y(i=this.fullCharCodeAt(e+8))||i===92))};f.isUsingKeyword=function(t,e){if(this.options.ecmaVersion<17||!this.isContextual(t?"await":"using"))return!1;S.lastIndex=this.pos;var i=S.exec(this.input),s=this.pos+i[0].length;if(N.test(this.input.slice(this.pos,s)))return!1;if(t){var o=s+5,h;if(this.input.slice(s,o)!=="using"||o===this.input.length||y(h=this.fullCharCodeAt(o))||h===92)return!1;S.lastIndex=o;var p=S.exec(this.input);if(s=o+p[0].length,p&&N.test(this.input.slice(o,s)))return!1}var l=this.fullCharCodeAt(s);if(!u(l)&&l!==92)return!1;var c=s;do s+=l<=65535?1:2;while(y(l=this.fullCharCodeAt(s)));if(l===92)return!0;var d=this.input.slice(c,s);if(At.test(d))return!1;if(e&&!t&&d==="of"){S.lastIndex=s;var v=S.exec(this.input);if(s=s+v[0].length,this.input.charCodeAt(s)!==61||(l=this.input.charCodeAt(s+1))===61||l===62)return!1}return!0};f.isAwaitUsing=function(t){return this.isUsingKeyword(!0,t)};f.isUsing=function(t){return this.isUsingKeyword(!1,t)};f.parseStatement=function(t,e,i){var s=this.type,o=this.startNode(),h;if(this.isLet(t))s=n._var,h="let";switch(s){case n._break:case n._continue:return this.parseBreakContinueStatement(o,s.keyword);case n._debugger:return this.parseDebuggerStatement(o);case n._do:return this.parseDoStatement(o);case n._for:return this.parseForStatement(o);case n._function:if(t&&(this.strict||t!=="if"&&t!=="label")&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(o,!1,!t);case n._class:if(t)this.unexpected();return this.parseClass(o,!0);case n._if:return this.parseIfStatement(o);case n._return:return this.parseReturnStatement(o);case n._switch:return this.parseSwitchStatement(o);case n._throw:return this.parseThrowStatement(o);case n._try:return this.parseTryStatement(o);case n._const:case n._var:if(h=h||this.value,t&&h!=="var")this.unexpected();return this.parseVarStatement(o,h);case n._while:return this.parseWhileStatement(o);case n._with:return this.parseWithStatement(o);case n.braceL:return this.parseBlock(!0,o);case n.semi:return this.parseEmptyStatement(o);case n._export:case n._import:if(this.options.ecmaVersion>10&&s===n._import){S.lastIndex=this.pos;var p=S.exec(this.input),l=this.pos+p[0].length,c=this.input.charCodeAt(l);if(c===40||c===46)return this.parseExpressionStatement(o,this.parseExpression())}if(!this.options.allowImportExportEverywhere){if(!e)this.raise(this.start,"'import' and 'export' may only appear at the top level");if(!this.inModule)this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")}return s===n._import?this.parseImport(o):this.parseExport(o,i);default:if(this.isAsyncFunction()){if(t)this.unexpected();return this.next(),this.parseFunctionStatement(o,!0,!t)}var d=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(d){if(!this.allowUsing)this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");if(t)this.raise(this.start,"Using declaration is not allowed in single-statement positions");if(d==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.next(),this.parseVar(o,!1,d),this.semicolon(),this.finishNode(o,"VariableDeclaration")}var v=this.value,g=this.parseExpression();if(s===n.name&&g.type==="Identifier"&&this.eat(n.colon))return this.parseLabeledStatement(o,v,g,t);else return this.parseExpressionStatement(o,g)}};f.parseBreakContinueStatement=function(t,e){var i=e==="break";if(this.next(),this.eat(n.semi)||this.insertSemicolon())t.label=null;else if(this.type!==n.name)this.unexpected();else t.label=this.parseIdent(),this.semicolon();var s=0;for(;s<this.labels.length;++s){var o=this.labels[s];if(t.label==null||o.name===t.label.name){if(o.kind!=null&&(i||o.kind==="loop"))break;if(t.label&&i)break}}if(s===this.labels.length)this.raise(t.start,"Unsyntactic "+e);return this.finishNode(t,i?"BreakStatement":"ContinueStatement")};f.parseDebuggerStatement=function(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")};f.parseDoStatement=function(t){if(this.next(),this.labels.push(kt),t.body=this.parseStatement("do"),this.labels.pop(),this.expect(n._while),t.test=this.parseParenExpression(),this.options.ecmaVersion>=6)this.eat(n.semi);else this.semicolon();return this.finishNode(t,"DoWhileStatement")};f.parseForStatement=function(t){this.next();var e=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(kt),this.enterScope(0),this.expect(n.parenL),this.type===n.semi){if(e>-1)this.unexpected(e);return this.parseFor(t,null)}var i=this.isLet();if(this.type===n._var||this.type===n._const||i){var s=this.startNode(),o=i?"let":this.value;return this.next(),this.parseVar(s,!0,o),this.finishNode(s,"VariableDeclaration"),this.parseForAfterInit(t,s,e)}var h=this.isContextual("let"),p=!1,l=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(l){var c=this.startNode();if(this.next(),l==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.parseVar(c,!0,l),this.finishNode(c,"VariableDeclaration"),this.parseForAfterInit(t,c,e)}var d=this.containsEsc,v=new ht,g=this.start,C=e>-1?this.parseExprSubscripts(v,"await"):this.parseExpression(!0,v);if(this.type===n._in||(p=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(e>-1){if(this.type===n._in)this.unexpected(e);t.await=!0}else if(p&&this.options.ecmaVersion>=8){if(C.start===g&&!d&&C.type==="Identifier"&&C.name==="async")this.unexpected();else if(this.options.ecmaVersion>=9)t.await=!1}if(h&&p)this.raise(C.start,"The left-hand side of a for-of loop may not start with 'let'.");return this.toAssignable(C,!1,v),this.checkLValPattern(C),this.parseForIn(t,C)}else this.checkExpressionErrors(v,!0);if(e>-1)this.unexpected(e);return this.parseFor(t,C)};f.parseForAfterInit=function(t,e,i){if((this.type===n._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&e.declarations.length===1){if(this.type===n._in){if((e.kind==="using"||e.kind==="await using")&&!e.declarations[0].init)this.raise(this.start,"Using declaration is not allowed in for-in loops");if(this.options.ecmaVersion>=9&&i>-1)this.unexpected(i)}else if(this.options.ecmaVersion>=9)t.await=i>-1;return this.parseForIn(t,e)}if(i>-1)this.unexpected(i);return this.parseFor(t,e)};f.parseFunctionStatement=function(t,e,i){return this.next(),this.parseFunction(t,H|(i?0:ft),!1,e)};f.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement("if"),t.alternate=this.eat(n._else)?this.parseStatement("if"):null,this.finishNode(t,"IfStatement")};f.parseReturnStatement=function(t){if(!this.allowReturn)this.raise(this.start,"'return' outside of function");if(this.next(),this.eat(n.semi)||this.insertSemicolon())t.argument=null;else t.argument=this.parseExpression(),this.semicolon();return this.finishNode(t,"ReturnStatement")};f.parseSwitchStatement=function(t){this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(n.braceL),this.labels.push(te),this.enterScope(Rt);var e;for(var i=!1;this.type!==n.braceR;)if(this.type===n._case||this.type===n._default){var s=this.type===n._case;if(e)this.finishNode(e,"SwitchCase");if(t.cases.push(e=this.startNode()),e.consequent=[],this.next(),s)e.test=this.parseExpression();else{if(i)this.raiseRecoverable(this.lastTokStart,"Multiple default clauses");i=!0,e.test=null}this.expect(n.colon)}else{if(!e)this.unexpected();e.consequent.push(this.parseStatement(null))}if(this.exitScope(),e)this.finishNode(e,"SwitchCase");return this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")};f.parseThrowStatement=function(t){if(this.next(),N.test(this.input.slice(this.lastTokEnd,this.start)))this.raise(this.lastTokEnd,"Illegal newline after throw");return t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var ee=[];f.parseCatchClauseParam=function(){var t=this.parseBindingAtom(),e=t.type==="Identifier";return this.enterScope(e?_t:0),this.checkLValPattern(t,e?Ft:R),this.expect(n.parenR),t};f.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===n._catch){var e=this.startNode();if(this.next(),this.eat(n.parenL))e.param=this.parseCatchClauseParam();else{if(this.options.ecmaVersion<10)this.unexpected();e.param=null,this.enterScope(0)}e.body=this.parseBlock(!1),this.exitScope(),t.handler=this.finishNode(e,"CatchClause")}if(t.finalizer=this.eat(n._finally)?this.parseBlock():null,!t.handler&&!t.finalizer)this.raise(t.start,"Missing catch or finally clause");return this.finishNode(t,"TryStatement")};f.parseVarStatement=function(t,e,i){return this.next(),this.parseVar(t,!1,e,i),this.semicolon(),this.finishNode(t,"VariableDeclaration")};f.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(kt),t.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(t,"WhileStatement")};f.parseWithStatement=function(t){if(this.strict)this.raise(this.start,"'with' in strict mode");return this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement("with"),this.finishNode(t,"WithStatement")};f.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")};f.parseLabeledStatement=function(t,e,i,s){for(var o=0,h=this.labels;o<h.length;o+=1){var p=h[o];if(p.name===e)this.raise(i.start,"Label '"+e+"' is already declared")}var l=this.type.isLoop?"loop":this.type===n._switch?"switch":null;for(var c=this.labels.length-1;c>=0;c--){var d=this.labels[c];if(d.statementStart===t.start)d.statementStart=this.start,d.kind=l;else break}return this.labels.push({name:e,kind:l,statementStart:this.start}),t.body=this.parseStatement(s?s.indexOf("label")===-1?s+"label":s:"label"),this.labels.pop(),t.label=i,this.finishNode(t,"LabeledStatement")};f.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")};f.parseBlock=function(t,e,i){if(t===void 0)t=!0;if(e===void 0)e=this.startNode();if(e.body=[],this.expect(n.braceL),t)this.enterScope(0);while(this.type!==n.braceR){var s=this.parseStatement(null);e.body.push(s)}if(i)this.strict=!1;if(this.next(),t)this.exitScope();return this.finishNode(e,"BlockStatement")};f.parseFor=function(t,e){return t.init=e,this.expect(n.semi),t.test=this.type===n.semi?null:this.parseExpression(),this.expect(n.semi),t.update=this.type===n.parenR?null:this.parseExpression(),this.expect(n.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,"ForStatement")};f.parseForIn=function(t,e){var i=this.type===n._in;if(this.next(),e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier"))this.raise(e.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer");return t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(n.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")};f.parseVar=function(t,e,i,s){t.declarations=[],t.kind=i;for(;;){var o=this.startNode();if(this.parseVarId(o,i),this.eat(n.eq))o.init=this.parseMaybeAssign(e);else if(!s&&i==="const"&&!(this.type===n._in||this.options.ecmaVersion>=6&&this.isContextual("of")))this.unexpected();else if(!s&&(i==="using"||i==="await using")&&this.options.ecmaVersion>=17&&this.type!==n._in&&!this.isContextual("of"))this.raise(this.lastTokEnd,"Missing initializer in "+i+" declaration");else if(!s&&o.id.type!=="Identifier"&&!(e&&(this.type===n._in||this.isContextual("of"))))this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value");else o.init=null;if(t.declarations.push(this.finishNode(o,"VariableDeclarator")),!this.eat(n.comma))break}return t};f.parseVarId=function(t,e){t.id=e==="using"||e==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(t.id,e==="var"?bt:R,!1)};var H=1,ft=2,Bt=4;f.parseFunction=function(t,e,i,s,o){if(this.initFunction(t),this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s){if(this.type===n.star&&e&ft)this.unexpected();t.generator=this.eat(n.star)}if(this.options.ecmaVersion>=8)t.async=!!s;if(e&H){if(t.id=e&Bt&&this.type!==n.name?null:this.parseIdent(),t.id&&!(e&ft))this.checkLValSimple(t.id,this.strict||t.generator||t.async?this.treatFunctionsAsVar?bt:R:Vt)}var h=this.yieldPos,p=this.awaitPos,l=this.awaitIdentPos;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(yt(t.async,t.generator)),!(e&H))t.id=this.type===n.name?this.parseIdent():null;return this.parseFunctionParams(t),this.parseFunctionBody(t,i,!1,o),this.yieldPos=h,this.awaitPos=p,this.awaitIdentPos=l,this.finishNode(t,e&H?"FunctionDeclaration":"FunctionExpression")};f.parseFunctionParams=function(t){this.expect(n.parenL),t.params=this.parseBindingList(n.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};f.parseClass=function(t,e){this.next();var i=this.strict;this.strict=!0,this.parseClassId(t,e),this.parseClassSuper(t);var s=this.enterClassBody(),o=this.startNode(),h=!1;o.body=[],this.expect(n.braceL);while(this.type!==n.braceR){var p=this.parseClassElement(t.superClass!==null);if(p){if(o.body.push(p),p.type==="MethodDefinition"&&p.kind==="constructor"){if(h)this.raiseRecoverable(p.start,"Duplicate constructor in the same class");h=!0}else if(p.key&&p.key.type==="PrivateIdentifier"&&ie(s,p))this.raiseRecoverable(p.key.start,"Identifier '#"+p.key.name+"' has already been declared")}}return this.strict=i,this.next(),t.body=this.finishNode(o,"ClassBody"),this.exitClassBody(),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")};f.parseClassElement=function(t){if(this.eat(n.semi))return null;var e=this.options.ecmaVersion,i=this.startNode(),s="",o=!1,h=!1,p="method",l=!1;if(this.eatContextual("static")){if(e>=13&&this.eat(n.braceL))return this.parseClassStaticBlock(i),i;if(this.isClassElementNameStart()||this.type===n.star)l=!0;else s="static"}if(i.static=l,!s&&e>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===n.star)&&!this.canInsertSemicolon())h=!0;else s="async";if(!s&&(e>=9||!h)&&this.eat(n.star))o=!0;if(!s&&!h&&!o){var c=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())p=c;else s=c}if(s)i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=s,this.finishNode(i.key,"Identifier");else this.parseClassElementName(i);if(e<13||this.type===n.parenL||p!=="method"||o||h){var d=!i.static&&it(i,"constructor"),v=d&&t;if(d&&p!=="method")this.raise(i.key.start,"Constructor can't have get/set modifier");i.kind=d?"constructor":p,this.parseClassMethod(i,o,h,v)}else this.parseClassField(i);return i};f.isClassElementNameStart=function(){return this.type===n.name||this.type===n.privateId||this.type===n.num||this.type===n.string||this.type===n.bracketL||this.type.keyword};f.parseClassElementName=function(t){if(this.type===n.privateId){if(this.value==="constructor")this.raise(this.start,"Classes can't have an element named '#constructor'");t.computed=!1,t.key=this.parsePrivateIdent()}else this.parsePropertyName(t)};f.parseClassMethod=function(t,e,i,s){var o=t.key;if(t.kind==="constructor"){if(e)this.raise(o.start,"Constructor can't be a generator");if(i)this.raise(o.start,"Constructor can't be an async method")}else if(t.static&&it(t,"prototype"))this.raise(o.start,"Classes may not have a static property named prototype");var h=t.value=this.parseMethod(e,i,s);if(t.kind==="get"&&h.params.length!==0)this.raiseRecoverable(h.start,"getter should have no params");if(t.kind==="set"&&h.params.length!==1)this.raiseRecoverable(h.start,"setter should have exactly one param");if(t.kind==="set"&&h.params[0].type==="RestElement")this.raiseRecoverable(h.params[0].start,"Setter cannot use rest params");return this.finishNode(t,"MethodDefinition")};f.parseClassField=function(t){if(it(t,"constructor"))this.raise(t.key.start,"Classes can't have a field named 'constructor'");else if(t.static&&it(t,"prototype"))this.raise(t.key.start,"Classes can't have a static field named 'prototype'");if(this.eat(n.eq))this.enterScope(K|nt),t.value=this.parseMaybeAssign(),this.exitScope();else t.value=null;return this.semicolon(),this.finishNode(t,"PropertyDefinition")};f.parseClassStaticBlock=function(t){t.body=[];var e=this.labels;this.labels=[],this.enterScope(B|nt);while(this.type!==n.braceR){var i=this.parseStatement(null);t.body.push(i)}return this.next(),this.exitScope(),this.labels=e,this.finishNode(t,"StaticBlock")};f.parseClassId=function(t,e){if(this.type===n.name){if(t.id=this.parseIdent(),e)this.checkLValSimple(t.id,R,!1)}else{if(e===!0)this.unexpected();t.id=null}};f.parseClassSuper=function(t){t.superClass=this.eat(n._extends)?this.parseExprSubscripts(null,!1):null};f.enterClassBody=function(){var t={declared:Object.create(null),used:[]};return this.privateNameStack.push(t),t.declared};f.exitClassBody=function(){var t=this.privateNameStack.pop(),{declared:e,used:i}=t;if(!this.options.checkPrivateFields)return;var s=this.privateNameStack.length,o=s===0?null:this.privateNameStack[s-1];for(var h=0;h<i.length;++h){var p=i[h];if(!Q(e,p.name))if(o)o.used.push(p);else this.raiseRecoverable(p.start,"Private field '#"+p.name+"' must be declared in an enclosing class")}};function ie(t,e){var i=e.key.name,s=t[i],o="true";if(e.type==="MethodDefinition"&&(e.kind==="get"||e.kind==="set"))o=(e.static?"s":"i")+e.kind;if(s==="iget"&&o==="iset"||s==="iset"&&o==="iget"||s==="sget"&&o==="sset"||s==="sset"&&o==="sget")return t[i]="true",!1;else if(!s)return t[i]=o,!1;else return!0}function it(t,e){var{computed:i,key:s}=t;return!i&&(s.type==="Identifier"&&s.name===e||s.type==="Literal"&&s.value===e)}f.parseExportAllDeclaration=function(t,e){if(this.options.ecmaVersion>=11)if(this.eatContextual("as"))t.exported=this.parseModuleExportName(),this.checkExport(e,t.exported,this.lastTokStart);else t.exported=null;if(this.expectContextual("from"),this.type!==n.string)this.unexpected();if(t.source=this.parseExprAtom(),this.options.ecmaVersion>=16)t.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(t,"ExportAllDeclaration")};f.parseExport=function(t,e){if(this.next(),this.eat(n.star))return this.parseExportAllDeclaration(t,e);if(this.eat(n._default))return this.checkExport(e,"default",this.lastTokStart),t.declaration=this.parseExportDefaultDeclaration(),this.finishNode(t,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(t.declaration=this.parseExportDeclaration(t),t.declaration.type==="VariableDeclaration")this.checkVariableExport(e,t.declaration.declarations);else this.checkExport(e,t.declaration.id,t.declaration.id.start);if(t.specifiers=[],t.source=null,this.options.ecmaVersion>=16)t.attributes=[]}else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from")){if(this.type!==n.string)this.unexpected();if(t.source=this.parseExprAtom(),this.options.ecmaVersion>=16)t.attributes=this.parseWithClause()}else{for(var i=0,s=t.specifiers;i<s.length;i+=1){var o=s[i];if(this.checkUnreserved(o.local),this.checkLocalExport(o.local),o.local.type==="Literal")this.raise(o.local.start,"A string literal cannot be used as an exported binding without `from`.")}if(t.source=null,this.options.ecmaVersion>=16)t.attributes=[]}this.semicolon()}return this.finishNode(t,"ExportNamedDeclaration")};f.parseExportDeclaration=function(t){return this.parseStatement(null)};f.parseExportDefaultDeclaration=function(){var t;if(this.type===n._function||(t=this.isAsyncFunction())){var e=this.startNode();if(this.next(),t)this.next();return this.parseFunction(e,H|Bt,!1,t)}else if(this.type===n._class){var i=this.startNode();return this.parseClass(i,"nullableID")}else{var s=this.parseMaybeAssign();return this.semicolon(),s}};f.checkExport=function(t,e,i){if(!t)return;if(typeof e!=="string")e=e.type==="Identifier"?e.name:e.value;if(Q(t,e))this.raiseRecoverable(i,"Duplicate export '"+e+"'");t[e]=!0};f.checkPatternExport=function(t,e){var i=e.type;if(i==="Identifier")this.checkExport(t,e,e.start);else if(i==="ObjectPattern")for(var s=0,o=e.properties;s<o.length;s+=1){var h=o[s];this.checkPatternExport(t,h)}else if(i==="ArrayPattern")for(var p=0,l=e.elements;p<l.length;p+=1){var c=l[p];if(c)this.checkPatternExport(t,c)}else if(i==="Property")this.checkPatternExport(t,e.value);else if(i==="AssignmentPattern")this.checkPatternExport(t,e.left);else if(i==="RestElement")this.checkPatternExport(t,e.argument)};f.checkVariableExport=function(t,e){if(!t)return;for(var i=0,s=e;i<s.length;i+=1){var o=s[i];this.checkPatternExport(t,o.id)}};f.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};f.parseExportSpecifier=function(t){var e=this.startNode();return e.local=this.parseModuleExportName(),e.exported=this.eatContextual("as")?this.parseModuleExportName():e.local,this.checkExport(t,e.exported,e.exported.start),this.finishNode(e,"ExportSpecifier")};f.parseExportSpecifiers=function(t){var e=[],i=!0;this.expect(n.braceL);while(!this.eat(n.braceR)){if(!i){if(this.expect(n.comma),this.afterTrailingComma(n.braceR))break}else i=!1;e.push(this.parseExportSpecifier(t))}return e};f.parseImport=function(t){if(this.next(),this.type===n.string)t.specifiers=ee,t.source=this.parseExprAtom();else t.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),t.source=this.type===n.string?this.parseExprAtom():this.unexpected();if(this.options.ecmaVersion>=16)t.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(t,"ImportDeclaration")};f.parseImportSpecifier=function(){var t=this.startNode();if(t.imported=this.parseModuleExportName(),this.eatContextual("as"))t.local=this.parseIdent();else this.checkUnreserved(t.imported),t.local=t.imported;return this.checkLValSimple(t.local,R),this.finishNode(t,"ImportSpecifier")};f.parseImportDefaultSpecifier=function(){var t=this.startNode();return t.local=this.parseIdent(),this.checkLValSimple(t.local,R),this.finishNode(t,"ImportDefaultSpecifier")};f.parseImportNamespaceSpecifier=function(){var t=this.startNode();return this.next(),this.expectContextual("as"),t.local=this.parseIdent(),this.checkLValSimple(t.local,R),this.finishNode(t,"ImportNamespaceSpecifier")};f.parseImportSpecifiers=function(){var t=[],e=!0;if(this.type===n.name){if(t.push(this.parseImportDefaultSpecifier()),!this.eat(n.comma))return t}if(this.type===n.star)return t.push(this.parseImportNamespaceSpecifier()),t;this.expect(n.braceL);while(!this.eat(n.braceR)){if(!e){if(this.expect(n.comma),this.afterTrailingComma(n.braceR))break}else e=!1;t.push(this.parseImportSpecifier())}return t};f.parseWithClause=function(){var t=[];if(!this.eat(n._with))return t;this.expect(n.braceL);var e={},i=!0;while(!this.eat(n.braceR)){if(!i){if(this.expect(n.comma),this.afterTrailingComma(n.braceR))break}else i=!1;var s=this.parseImportAttribute(),o=s.key.type==="Identifier"?s.key.name:s.key.value;if(Q(e,o))this.raiseRecoverable(s.key.start,"Duplicate attribute key '"+o+"'");e[o]=!0,t.push(s)}return t};f.parseImportAttribute=function(){var t=this.startNode();if(t.key=this.type===n.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(n.colon),this.type!==n.string)this.unexpected();return t.value=this.parseExprAtom(),this.finishNode(t,"ImportAttribute")};f.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===n.string){var t=this.parseLiteral(this.value);if(Xt.test(t.value))this.raise(t.start,"An export name cannot include a lone surrogate.");return t}return this.parseIdent(!0)};f.adaptDirectivePrologue=function(t){for(var e=0;e<t.length&&this.isDirectiveCandidate(t[e]);++e)t[e].directive=t[e].expression.raw.slice(1,-1)};f.isDirectiveCandidate=function(t){return this.options.ecmaVersion>=5&&t.type==="ExpressionStatement"&&t.expression.type==="Literal"&&typeof t.expression.value==="string"&&(this.input[t.start]==='"'||this.input[t.start]==="'")};var _=r.prototype;_.toAssignable=function(t,e,i){if(this.options.ecmaVersion>=6&&t)switch(t.type){case"Identifier":if(this.inAsync&&t.name==="await")this.raise(t.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":if(t.type="ObjectPattern",i)this.checkPatternErrors(i,!0);for(var s=0,o=t.properties;s<o.length;s+=1){var h=o[s];if(this.toAssignable(h,e),h.type==="RestElement"&&(h.argument.type==="ArrayPattern"||h.argument.type==="ObjectPattern"))this.raise(h.argument.start,"Unexpected token")}break;case"Property":if(t.kind!=="init")this.raise(t.key.start,"Object pattern can't contain getter or setter");this.toAssignable(t.value,e);break;case"ArrayExpression":if(t.type="ArrayPattern",i)this.checkPatternErrors(i,!0);this.toAssignableList(t.elements,e);break;case"SpreadElement":if(t.type="RestElement",this.toAssignable(t.argument,e),t.argument.type==="AssignmentPattern")this.raise(t.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":if(t.operator!=="=")this.raise(t.left.end,"Only '=' operator can be used for specifying default value.");t.type="AssignmentPattern",delete t.operator,this.toAssignable(t.left,e);break;case"ParenthesizedExpression":this.toAssignable(t.expression,e,i);break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!e)break;default:this.raise(t.start,"Assigning to rvalue")}else if(i)this.checkPatternErrors(i,!0);return t};_.toAssignableList=function(t,e){var i=t.length;for(var s=0;s<i;s++){var o=t[s];if(o)this.toAssignable(o,e)}if(i){var h=t[i-1];if(this.options.ecmaVersion===6&&e&&h&&h.type==="RestElement"&&h.argument.type!=="Identifier")this.unexpected(h.argument.start)}return t};_.parseSpread=function(t){var e=this.startNode();return this.next(),e.argument=this.parseMaybeAssign(!1,t),this.finishNode(e,"SpreadElement")};_.parseRestBinding=function(){var t=this.startNode();if(this.next(),this.options.ecmaVersion===6&&this.type!==n.name)this.unexpected();return t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")};_.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case n.bracketL:var t=this.startNode();return this.next(),t.elements=this.parseBindingList(n.bracketR,!0,!0),this.finishNode(t,"ArrayPattern");case n.braceL:return this.parseObj(!0)}return this.parseIdent()};_.parseBindingList=function(t,e,i,s){var o=[],h=!0;while(!this.eat(t)){if(h)h=!1;else this.expect(n.comma);if(e&&this.type===n.comma)o.push(null);else if(i&&this.afterTrailingComma(t))break;else if(this.type===n.ellipsis){var p=this.parseRestBinding();if(this.parseBindingListItem(p),o.push(p),this.type===n.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");this.expect(t);break}else o.push(this.parseAssignableListItem(s))}return o};_.parseAssignableListItem=function(t){var e=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(e),e};_.parseBindingListItem=function(t){return t};_.parseMaybeDefault=function(t,e,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(n.eq))return i;var s=this.startNodeAt(t,e);return s.left=i,s.right=this.parseMaybeAssign(),this.finishNode(s,"AssignmentPattern")};_.checkLValSimple=function(t,e,i){if(e===void 0)e=et;var s=e!==et;switch(t.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(t.name))this.raiseRecoverable(t.start,(s?"Binding ":"Assigning to ")+t.name+" in strict mode");if(s){if(e===R&&t.name==="let")this.raiseRecoverable(t.start,"let is disallowed as a lexically bound name");if(i){if(Q(i,t.name))this.raiseRecoverable(t.start,"Argument name clash");i[t.name]=!0}if(e!==Ot)this.declareName(t.name,e,t.start)}break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(s)this.raiseRecoverable(t.start,"Binding member expression");break;case"ParenthesizedExpression":if(s)this.raiseRecoverable(t.start,"Binding parenthesized expression");return this.checkLValSimple(t.expression,e,i);default:this.raise(t.start,(s?"Binding":"Assigning to")+" rvalue")}};_.checkLValPattern=function(t,e,i){if(e===void 0)e=et;switch(t.type){case"ObjectPattern":for(var s=0,o=t.properties;s<o.length;s+=1){var h=o[s];this.checkLValInnerPattern(h,e,i)}break;case"ArrayPattern":for(var p=0,l=t.elements;p<l.length;p+=1){var c=l[p];if(c)this.checkLValInnerPattern(c,e,i)}break;default:this.checkLValSimple(t,e,i)}};_.checkLValInnerPattern=function(t,e,i){if(e===void 0)e=et;switch(t.type){case"Property":this.checkLValInnerPattern(t.value,e,i);break;case"AssignmentPattern":this.checkLValPattern(t.left,e,i);break;case"RestElement":this.checkLValPattern(t.argument,e,i);break;default:this.checkLValPattern(t,e,i)}};var L=function(e,i,s,o,h){this.token=e,this.isExpr=!!i,this.preserveSpace=!!s,this.override=o,this.generator=!!h},w={b_stat:new L("{",!1),b_expr:new L("{",!0),b_tmpl:new L("${",!1),p_stat:new L("(",!1),p_expr:new L("(",!0),q_tmpl:new L("`",!0,!0,function(t){return t.tryReadTemplateToken()}),f_stat:new L("function",!1),f_expr:new L("function",!0),f_expr_gen:new L("function",!0,!1,null,!0),f_gen:new L("function",!1,!1,null,!0)},j=r.prototype;j.initialContext=function(){return[w.b_stat]};j.curContext=function(){return this.context[this.context.length-1]};j.braceIsBlock=function(t){var e=this.curContext();if(e===w.f_expr||e===w.f_stat)return!0;if(t===n.colon&&(e===w.b_stat||e===w.b_expr))return!e.isExpr;if(t===n._return||t===n.name&&this.exprAllowed)return N.test(this.input.slice(this.lastTokEnd,this.start));if(t===n._else||t===n.semi||t===n.eof||t===n.parenR||t===n.arrow)return!0;if(t===n.braceL)return e===w.b_stat;if(t===n._var||t===n._const||t===n.name)return!1;return!this.exprAllowed};j.inGeneratorContext=function(){for(var t=this.context.length-1;t>=1;t--){var e=this.context[t];if(e.token==="function")return e.generator}return!1};j.updateContext=function(t){var e,i=this.type;if(i.keyword&&t===n.dot)this.exprAllowed=!1;else if(e=i.updateContext)e.call(this,t);else this.exprAllowed=i.beforeExpr};j.overrideContext=function(t){if(this.curContext()!==t)this.context[this.context.length-1]=t};n.parenR.updateContext=n.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var t=this.context.pop();if(t===w.b_stat&&this.curContext().token==="function")t=this.context.pop();this.exprAllowed=!t.isExpr};n.braceL.updateContext=function(t){this.context.push(this.braceIsBlock(t)?w.b_stat:w.b_expr),this.exprAllowed=!0};n.dollarBraceL.updateContext=function(){this.context.push(w.b_tmpl),this.exprAllowed=!0};n.parenL.updateContext=function(t){var e=t===n._if||t===n._for||t===n._with||t===n._while;this.context.push(e?w.p_stat:w.p_expr),this.exprAllowed=!0};n.incDec.updateContext=function(){};n._function.updateContext=n._class.updateContext=function(t){if(t.beforeExpr&&t!==n._else&&!(t===n.semi&&this.curContext()!==w.p_stat)&&!(t===n._return&&N.test(this.input.slice(this.lastTokEnd,this.start)))&&!((t===n.colon||t===n.braceL)&&this.curContext()===w.b_stat))this.context.push(w.f_expr);else this.context.push(w.f_stat);this.exprAllowed=!1};n.colon.updateContext=function(){if(this.curContext().token==="function")this.context.pop();this.exprAllowed=!0};n.backQuote.updateContext=function(){if(this.curContext()===w.q_tmpl)this.context.pop();else this.context.push(w.q_tmpl);this.exprAllowed=!1};n.star.updateContext=function(t){if(t===n._function){var e=this.context.length-1;if(this.context[e]===w.f_expr)this.context[e]=w.f_expr_gen;else this.context[e]=w.f_gen}this.exprAllowed=!0};n.name.updateContext=function(t){var e=!1;if(this.options.ecmaVersion>=6&&t!==n.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())e=!0}this.exprAllowed=e};var m=r.prototype;m.checkPropClash=function(t,e,i){if(this.options.ecmaVersion>=9&&t.type==="SpreadElement")return;if(this.options.ecmaVersion>=6&&(t.computed||t.method||t.shorthand))return;var s=t.key,o;switch(s.type){case"Identifier":o=s.name;break;case"Literal":o=String(s.value);break;default:return}var h=t.kind;if(this.options.ecmaVersion>=6){if(o==="__proto__"&&h==="init"){if(e.proto)if(i){if(i.doubleProto<0)i.doubleProto=s.start}else this.raiseRecoverable(s.start,"Redefinition of __proto__ property");e.proto=!0}return}o="$"+o;var p=e[o];if(p){var l;if(h==="init")l=this.strict&&p.init||p.get||p.set;else l=p.init||p[h];if(l)this.raiseRecoverable(s.start,"Redefinition of property")}else p=e[o]={init:!1,get:!1,set:!1};p[h]=!0};m.parseExpression=function(t,e){var i=this;return this.catchStackOverflow(function(){var{start:s,startLoc:o}=i,h=i.parseMaybeAssign(t,e);if(i.type===n.comma){var p=i.startNodeAt(s,o);p.expressions=[h];while(i.eat(n.comma))p.expressions.push(i.parseMaybeAssign(t,e));return i.finishNode(p,"SequenceExpression")}return h})};m.parseMaybeAssign=function(t,e,i){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(t);else this.exprAllowed=!1;var s=!1,o=-1,h=-1,p=-1;if(e)o=e.parenthesizedAssign,h=e.trailingComma,p=e.doubleProto,e.parenthesizedAssign=e.trailingComma=-1;else e=new ht,s=!0;var l=this.start,c=this.startLoc;if(this.type===n.parenL||this.type===n.name)this.potentialArrowAt=this.start,this.potentialArrowInForAwait=t==="await";var d=this.parseMaybeConditional(t,e);if(i)d=i.call(this,d,l,c);if(this.type.isAssign){var v=this.startNodeAt(l,c);if(v.operator=this.value,this.type===n.eq)d=this.toAssignable(d,!1,e);if(!s)e.parenthesizedAssign=e.trailingComma=e.doubleProto=-1;if(e.shorthandAssign>=d.start)e.shorthandAssign=-1;if(this.type===n.eq)this.checkLValPattern(d);else this.checkLValSimple(d);if(v.left=d,this.next(),v.right=this.parseMaybeAssign(t),p>-1)e.doubleProto=p;return this.finishNode(v,"AssignmentExpression")}else if(s)this.checkExpressionErrors(e,!0);if(o>-1)e.parenthesizedAssign=o;if(h>-1)e.trailingComma=h;return d};m.parseMaybeConditional=function(t,e){var i=this.start,s=this.startLoc,o=this.parseExprOps(t,e);if(this.checkExpressionErrors(e))return o;if(!(o.type==="ArrowFunctionExpression"&&o.start===i)&&this.eat(n.question)){var h=this.startNodeAt(i,s);return h.test=o,h.consequent=this.parseMaybeAssign(),this.expect(n.colon),h.alternate=this.parseMaybeAssign(t),this.finishNode(h,"ConditionalExpression")}return o};m.parseExprOps=function(t,e){var i=this.start,s=this.startLoc,o=this.parseMaybeUnary(e,!1,!1,t);if(this.checkExpressionErrors(e))return o;return o.start===i&&o.type==="ArrowFunctionExpression"?o:this.parseExprOp(o,i,s,-1,t)};m.parseExprOp=function(t,e,i,s,o){var h=this.type.binop;if(h!=null&&(!o||this.type!==n._in)){if(h>s){var p=this.type===n.logicalOR||this.type===n.logicalAND,l=this.type===n.coalesce;if(l)h=n.logicalAND.binop;var c=this.value;this.next();var d=this.start,v=this.startLoc,g=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,o),d,v,h,o),C=this.buildBinary(e,i,t,g,c,p||l);if(p&&this.type===n.coalesce||l&&(this.type===n.logicalOR||this.type===n.logicalAND))this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");return this.parseExprOp(C,e,i,s,o)}}return t};m.buildBinary=function(t,e,i,s,o,h){if(s.type==="PrivateIdentifier")this.raise(s.start,"Private identifier can only be left side of binary expression");var p=this.startNodeAt(t,e);return p.left=i,p.operator=o,p.right=s,this.finishNode(p,h?"LogicalExpression":"BinaryExpression")};m.parseMaybeUnary=function(t,e,i,s){var o=this.start,h=this.startLoc,p;if(this.isContextual("await")&&this.canAwait)p=this.parseAwait(s),e=!0;else if(this.type.prefix){var l=this.startNode(),c=this.type===n.incDec;if(l.operator=this.value,l.prefix=!0,this.next(),l.argument=this.parseMaybeUnary(null,!0,c,s),this.checkExpressionErrors(t,!0),c)this.checkLValSimple(l.argument);else if(this.strict&&l.operator==="delete"&&Mt(l.argument))this.raiseRecoverable(l.start,"Deleting local variable in strict mode");else if(l.operator==="delete"&&dt(l.argument))this.raiseRecoverable(l.start,"Private fields can not be deleted");else e=!0;p=this.finishNode(l,c?"UpdateExpression":"UnaryExpression")}else if(!e&&this.type===n.privateId){if((s||this.privateNameStack.length===0)&&this.options.checkPrivateFields)this.unexpected();if(p=this.parsePrivateIdent(),this.type!==n._in)this.unexpected()}else{if(p=this.parseExprSubscripts(t,s),this.checkExpressionErrors(t))return p;while(this.type.postfix&&!this.canInsertSemicolon()){var d=this.startNodeAt(o,h);d.operator=this.value,d.prefix=!1,d.argument=p,this.checkLValSimple(p),this.next(),p=this.finishNode(d,"UpdateExpression")}}if(!i&&!(p.type==="ArrowFunctionExpression"&&p.start===o)&&this.eat(n.starstar))if(e)this.unexpected(this.lastTokStart);else return this.buildBinary(o,h,p,this.parseMaybeUnary(null,!1,!1,s),"**",!1);else return p};function Mt(t){return t.type==="Identifier"||t.type==="ParenthesizedExpression"&&Mt(t.expression)}function dt(t){return t.type==="MemberExpression"&&t.property.type==="PrivateIdentifier"||t.type==="ChainExpression"&&dt(t.expression)||t.type==="ParenthesizedExpression"&&dt(t.expression)}m.parseExprSubscripts=function(t,e){var i=this.start,s=this.startLoc,o=this.parseExprAtom(t,e);if(o.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return o;var h=this.parseSubscripts(o,i,s,!1,e);if(t&&h.type==="MemberExpression"){if(t.parenthesizedAssign>=h.start)t.parenthesizedAssign=-1;if(t.parenthesizedBind>=h.start)t.parenthesizedBind=-1;if(t.trailingComma>=h.start)t.trailingComma=-1}return h};m.parseSubscripts=function(t,e,i,s,o){var h=this.options.ecmaVersion>=8&&t.type==="Identifier"&&t.name==="async"&&this.lastTokEnd===t.end&&!this.canInsertSemicolon()&&t.end-t.start===5&&this.potentialArrowAt===t.start,p=!1;while(!0){var l=this.parseSubscript(t,e,i,s,h,p,o);if(l.optional)p=!0;if(l===t||l.type==="ArrowFunctionExpression"){if(p){var c=this.startNodeAt(e,i);c.expression=l,l=this.finishNode(c,"ChainExpression")}return l}t=l}};m.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(n.arrow)};m.parseSubscriptAsyncArrow=function(t,e,i,s){return this.parseArrowExpression(this.startNodeAt(t,e),i,!0,s)};m.parseSubscript=function(t,e,i,s,o,h,p){var l=this.options.ecmaVersion>=11,c=l&&this.eat(n.questionDot);if(s&&c)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var d=this.eat(n.bracketL);if(d||c&&this.type!==n.parenL&&this.type!==n.backQuote||this.eat(n.dot)){var v=this.startNodeAt(e,i);if(v.object=t,d)v.property=this.parseExpression(),this.expect(n.bracketR);else if(this.type===n.privateId&&t.type!=="Super")v.property=this.parsePrivateIdent();else v.property=this.parseIdent(this.options.allowReserved!=="never");if(v.computed=!!d,l)v.optional=c;t=this.finishNode(v,"MemberExpression")}else if(!s&&this.eat(n.parenL)){var g=new ht,C=this.yieldPos,G=this.awaitPos,M=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var Z=this.parseExprList(n.parenR,this.options.ecmaVersion>=8,!1,g);if(o&&!c&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(g,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");return this.yieldPos=C,this.awaitPos=G,this.awaitIdentPos=M,this.parseSubscriptAsyncArrow(e,i,Z,p)}this.checkExpressionErrors(g,!0),this.yieldPos=C||this.yieldPos,this.awaitPos=G||this.awaitPos,this.awaitIdentPos=M||this.awaitIdentPos;var U=this.startNodeAt(e,i);if(U.callee=t,U.arguments=Z,l)U.optional=c;t=this.finishNode(U,"CallExpression")}else if(this.type===n.backQuote){if(c||h)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var W=this.startNodeAt(e,i);W.tag=t,W.quasi=this.parseTemplate({isTagged:!0}),t=this.finishNode(W,"TaggedTemplateExpression")}return t};m.parseExprAtom=function(t,e,i){if(this.type===n.slash)this.readRegexp();var s,o=this.potentialArrowAt===this.start;switch(this.type){case n._super:if(!this.allowSuper)this.raise(this.start,"'super' keyword outside a method");if(s=this.startNode(),this.next(),this.type===n.parenL&&!this.allowDirectSuper)this.raise(s.start,"super() call outside constructor of a subclass");if(this.type!==n.dot&&this.type!==n.bracketL&&this.type!==n.parenL)this.unexpected();return this.finishNode(s,"Super");case n._this:return s=this.startNode(),this.next(),this.finishNode(s,"ThisExpression");case n.name:var h=this.start,p=this.startLoc,l=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!l&&c.name==="async"&&!this.canInsertSemicolon()&&this.eat(n._function))return this.overrideContext(w.f_expr),this.parseFunction(this.startNodeAt(h,p),0,!1,!0,e);if(o&&!this.canInsertSemicolon()){if(this.eat(n.arrow))return this.parseArrowExpression(this.startNodeAt(h,p),[c],!1,e);if(this.options.ecmaVersion>=8&&c.name==="async"&&this.type===n.name&&!l&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(c=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(n.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(h,p),[c],!0,e)}}return c;case n.regexp:var d=this.value;return s=this.parseLiteral(d.value),s.regex={pattern:d.pattern,flags:d.flags},s;case n.num:case n.string:return this.parseLiteral(this.value);case n._null:case n._true:case n._false:return s=this.startNode(),s.value=this.type===n._null?null:this.type===n._true,s.raw=this.type.keyword,this.next(),this.finishNode(s,"Literal");case n.parenL:var v=this.start,g=this.parseParenAndDistinguishExpression(o,e);if(t){if(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(g))t.parenthesizedAssign=v;if(t.parenthesizedBind<0)t.parenthesizedBind=v}return g;case n.bracketL:return s=this.startNode(),this.next(),s.elements=this.parseExprList(n.bracketR,!0,!0,t),this.finishNode(s,"ArrayExpression");case n.braceL:return this.overrideContext(w.b_expr),this.parseObj(!1,t);case n._function:return s=this.startNode(),this.next(),this.parseFunction(s,0);case n._class:return this.parseClass(this.startNode(),!1);case n._new:return this.parseNew();case n.backQuote:return this.parseTemplate();case n._import:if(this.options.ecmaVersion>=11)return this.parseExprImport(i);else return this.unexpected();default:return this.parseExprAtomDefault()}};m.parseExprAtomDefault=function(){this.unexpected()};m.parseExprImport=function(t){var e=this.startNode();if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword import");if(this.next(),this.type===n.parenL&&!t)return this.parseDynamicImport(e);else if(this.type===n.dot){var i=this.startNodeAt(e.start,e.loc&&e.loc.start);return i.name="import",e.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(e)}else this.unexpected()};m.parseDynamicImport=function(t){if(this.next(),t.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)if(!this.eat(n.parenR))if(this.expect(n.comma),!this.afterTrailingComma(n.parenR)){if(t.options=this.parseMaybeAssign(),!this.eat(n.parenR)){if(this.expect(n.comma),!this.afterTrailingComma(n.parenR))this.unexpected()}}else t.options=null;else t.options=null;else if(!this.eat(n.parenR)){var e=this.start;if(this.eat(n.comma)&&this.eat(n.parenR))this.raiseRecoverable(e,"Trailing comma is not allowed in import()");else this.unexpected(e)}return this.finishNode(t,"ImportExpression")};m.parseImportMeta=function(t){this.next();var e=this.containsEsc;if(t.property=this.parseIdent(!0),t.property.name!=="meta")this.raiseRecoverable(t.property.start,"The only valid meta property for import is 'import.meta'");if(e)this.raiseRecoverable(t.start,"'import.meta' must not contain escaped characters");if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere)this.raiseRecoverable(t.start,"Cannot use 'import.meta' outside a module");return this.finishNode(t,"MetaProperty")};m.parseLiteral=function(t){var e=this.startNode();if(e.value=t,e.raw=this.input.slice(this.start,this.end),e.raw.charCodeAt(e.raw.length-1)===110)e.bigint=e.value!=null?e.value.toString():e.raw.slice(0,-1).replace(/_/g,"");return this.next(),this.finishNode(e,"Literal")};m.parseParenExpression=function(){this.expect(n.parenL);var t=this.parseExpression();return this.expect(n.parenR),t};m.shouldParseArrow=function(t){return!this.canInsertSemicolon()};m.parseParenAndDistinguishExpression=function(t,e){var i=this.start,s=this.startLoc,o,h=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var p=this.start,l=this.startLoc,c=[],d=!0,v=!1,g=new ht,C=this.yieldPos,G=this.awaitPos,M;this.yieldPos=0,this.awaitPos=0;while(this.type!==n.parenR)if(d?d=!1:this.expect(n.comma),h&&this.afterTrailingComma(n.parenR,!0)){v=!0;break}else if(this.type===n.ellipsis){if(M=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===n.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else c.push(this.parseMaybeAssign(!1,g,this.parseParenItem));var Z=this.lastTokEnd,U=this.lastTokEndLoc;if(this.expect(n.parenR),t&&this.shouldParseArrow(c)&&this.eat(n.arrow))return this.checkPatternErrors(g,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=C,this.awaitPos=G,this.parseParenArrowList(i,s,c,e);if(!c.length||v)this.unexpected(this.lastTokStart);if(M)this.unexpected(M);if(this.checkExpressionErrors(g,!0),this.yieldPos=C||this.yieldPos,this.awaitPos=G||this.awaitPos,c.length>1)o=this.startNodeAt(p,l),o.expressions=c,this.finishNodeAt(o,"SequenceExpression",Z,U);else o=c[0]}else o=this.parseParenExpression();if(this.options.preserveParens){var W=this.startNodeAt(i,s);return W.expression=o,this.finishNode(W,"ParenthesizedExpression")}else return o};m.parseParenItem=function(t){return t};m.parseParenArrowList=function(t,e,i,s){return this.parseArrowExpression(this.startNodeAt(t,e),i,!1,s)};var se=[];m.parseNew=function(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");var t=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===n.dot){var e=this.startNodeAt(t.start,t.loc&&t.loc.start);e.name="new",t.meta=this.finishNode(e,"Identifier"),this.next();var i=this.containsEsc;if(t.property=this.parseIdent(!0),t.property.name!=="target")this.raiseRecoverable(t.property.start,"The only valid meta property for new is 'new.target'");if(i)this.raiseRecoverable(t.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(t.start,"'new.target' can only be used in functions and class static block");return this.finishNode(t,"MetaProperty")}var s=this.start,o=this.startLoc;if(t.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),s,o,!0,!1),t.callee.type==="Super")this.raiseRecoverable(s,"Invalid use of 'super'");if(this.eat(n.parenL))t.arguments=this.parseExprList(n.parenR,this.options.ecmaVersion>=8,!1);else t.arguments=se;return this.finishNode(t,"NewExpression")};m.parseTemplateElement=function(t){var e=t.isTagged,i=this.startNode();if(this.type===n.invalidTemplate){if(!e)this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal");i.value={raw:this.value.replace(/\r\n?/g,`
|
|
4
|
+
`),cooked:null}}else i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
5
|
+
`),cooked:this.value};return this.next(),i.tail=this.type===n.backQuote,this.finishNode(i,"TemplateElement")};m.parseTemplate=function(t){if(t===void 0)t={};var e=t.isTagged;if(e===void 0)e=!1;var i=this.startNode();this.next(),i.expressions=[];var s=this.parseTemplateElement({isTagged:e});i.quasis=[s];while(!s.tail){if(this.type===n.eof)this.raise(this.pos,"Unterminated template literal");this.expect(n.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(n.braceR),i.quasis.push(s=this.parseTemplateElement({isTagged:e}))}return this.next(),this.finishNode(i,"TemplateLiteral")};m.isAsyncProp=function(t){return!t.computed&&t.key.type==="Identifier"&&t.key.name==="async"&&(this.type===n.name||this.type===n.num||this.type===n.string||this.type===n.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===n.star)&&!N.test(this.input.slice(this.lastTokEnd,this.start))};m.parseObj=function(t,e){var i=this.startNode(),s=!0,o={};i.properties=[],this.next();while(!this.eat(n.braceR)){if(!s){if(this.expect(n.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(n.braceR))break}else s=!1;var h=this.parseProperty(t,e);if(!t)this.checkPropClash(h,o,e);i.properties.push(h)}return this.finishNode(i,t?"ObjectPattern":"ObjectExpression")};m.parseProperty=function(t,e){var i=this.startNode(),s,o,h,p;if(this.options.ecmaVersion>=9&&this.eat(n.ellipsis)){if(t){if(i.argument=this.parseIdent(!1),this.type===n.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");return this.finishNode(i,"RestElement")}if(i.argument=this.parseMaybeAssign(!1,e),this.type===n.comma&&e&&e.trailingComma<0)e.trailingComma=this.start;return this.finishNode(i,"SpreadElement")}if(this.options.ecmaVersion>=6){if(i.method=!1,i.shorthand=!1,t||e)h=this.start,p=this.startLoc;if(!t)s=this.eat(n.star)}var l=this.containsEsc;if(this.parsePropertyName(i),!t&&!l&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(i))o=!0,s=this.options.ecmaVersion>=9&&this.eat(n.star),this.parsePropertyName(i);else o=!1;return this.parsePropertyValue(i,t,s,o,h,p,e,l),this.finishNode(i,"Property")};m.parseGetterSetter=function(t){var e=t.key.name;this.parsePropertyName(t),t.value=this.parseMethod(!1),t.kind=e;var i=t.kind==="get"?0:1;if(t.value.params.length!==i){var s=t.value.start;if(t.kind==="get")this.raiseRecoverable(s,"getter should have no params");else this.raiseRecoverable(s,"setter should have exactly one param")}else if(t.kind==="set"&&t.value.params[0].type==="RestElement")this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")};m.parsePropertyValue=function(t,e,i,s,o,h,p,l){if((i||s)&&this.type===n.colon)this.unexpected();if(this.eat(n.colon))t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,p),t.kind="init";else if(this.options.ecmaVersion>=6&&this.type===n.parenL){if(e)this.unexpected();t.method=!0,t.value=this.parseMethod(i,s),t.kind="init"}else if(!e&&!l&&this.options.ecmaVersion>=5&&!t.computed&&t.key.type==="Identifier"&&(t.key.name==="get"||t.key.name==="set")&&(this.type!==n.comma&&this.type!==n.braceR&&this.type!==n.eq)){if(i||s)this.unexpected();this.parseGetterSetter(t)}else if(this.options.ecmaVersion>=6&&!t.computed&&t.key.type==="Identifier"){if(i||s)this.unexpected();if(this.checkUnreserved(t.key),t.key.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=o;if(e)t.value=this.parseMaybeDefault(o,h,this.copyNode(t.key));else if(this.type===n.eq&&p){if(p.shorthandAssign<0)p.shorthandAssign=this.start;t.value=this.parseMaybeDefault(o,h,this.copyNode(t.key))}else t.value=this.copyNode(t.key);t.kind="init",t.shorthand=!0}else this.unexpected()};m.parsePropertyName=function(t){if(this.options.ecmaVersion>=6)if(this.eat(n.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(n.bracketR),t.key;else t.computed=!1;return t.key=this.type===n.num||this.type===n.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};m.initFunction=function(t){if(t.id=null,this.options.ecmaVersion>=6)t.generator=t.expression=!1;if(this.options.ecmaVersion>=8)t.async=!1};m.parseMethod=function(t,e,i){var s=this.startNode(),o=this.yieldPos,h=this.awaitPos,p=this.awaitIdentPos;if(this.initFunction(s),this.options.ecmaVersion>=6)s.generator=t;if(this.options.ecmaVersion>=8)s.async=!!e;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(yt(e,s.generator)|nt|(i?Lt:0)),this.expect(n.parenL),s.params=this.parseBindingList(n.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0,!1),this.yieldPos=o,this.awaitPos=h,this.awaitIdentPos=p,this.finishNode(s,"FunctionExpression")};m.parseArrowExpression=function(t,e,i,s){var o=this.yieldPos,h=this.awaitPos,p=this.awaitIdentPos;if(this.enterScope(yt(i,!1)|xt),this.initFunction(t),this.options.ecmaVersion>=8)t.async=!!i;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0,!1,s),this.yieldPos=o,this.awaitPos=h,this.awaitIdentPos=p,this.finishNode(t,"ArrowFunctionExpression")};m.parseFunctionBody=function(t,e,i,s){var o=e&&this.type!==n.braceL,h=this.strict,p=!1;if(o)t.body=this.parseMaybeAssign(s),t.expression=!0,this.checkParams(t,!1);else{var l=this.options.ecmaVersion>=7&&!this.isSimpleParamList(t.params);if(!h||l){if(p=this.strictDirective(this.end),p&&l)this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list")}var c=this.labels;if(this.labels=[],p)this.strict=!0;if(this.checkParams(t,!h&&!p&&!e&&!i&&this.isSimpleParamList(t.params)),this.strict&&t.id)this.checkLValSimple(t.id,Ot);t.body=this.parseBlock(!1,void 0,p&&!h),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=c}this.exitScope()};m.isSimpleParamList=function(t){for(var e=0,i=t;e<i.length;e+=1){var s=i[e];if(s.type!=="Identifier")return!1}return!0};m.checkParams=function(t,e){var i=Object.create(null);for(var s=0,o=t.params;s<o.length;s+=1){var h=o[s];this.checkLValInnerPattern(h,bt,e?null:i)}};m.parseExprList=function(t,e,i,s){var o=[],h=!0;while(!this.eat(t)){if(!h){if(this.expect(n.comma),e&&this.afterTrailingComma(t))break}else h=!1;var p=void 0;if(i&&this.type===n.comma)p=null;else if(this.type===n.ellipsis){if(p=this.parseSpread(s),s&&this.type===n.comma&&s.trailingComma<0)s.trailingComma=this.start}else p=this.parseMaybeAssign(!1,s);o.push(p)}return o};m.checkUnreserved=function(t){var{start:e,end:i,name:s}=t;if(this.inGenerator&&s==="yield")this.raiseRecoverable(e,"Cannot use 'yield' as identifier inside a generator");if(this.inAsync&&s==="await")this.raiseRecoverable(e,"Cannot use 'await' as identifier inside an async function");if(!(this.currentThisScope().flags&ot)&&s==="arguments")this.raiseRecoverable(e,"Cannot use 'arguments' in class field initializer");if(this.inClassStaticBlock&&(s==="arguments"||s==="await"))this.raise(e,"Cannot use "+s+" in class static initialization block");if(this.keywords.test(s))this.raise(e,"Unexpected keyword '"+s+"'");if(this.options.ecmaVersion<6&&this.input.slice(e,i).indexOf("\\")!==-1)return;var o=this.strict?this.reservedWordsStrict:this.reservedWords;if(o.test(s)){if(!this.inAsync&&s==="await")this.raiseRecoverable(e,"Cannot use keyword 'await' outside an async function");this.raiseRecoverable(e,"The keyword '"+s+"' is reserved")}};m.parseIdent=function(t){var e=this.parseIdentNode();if(this.next(!!t),this.finishNode(e,"Identifier"),!t){if(this.checkUnreserved(e),e.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=e.start}return e};m.parseIdentNode=function(){var t=this.startNode();if(this.type===n.name)t.name=this.value;else if(this.type.keyword){if(t.name=this.type.keyword,(t.name==="class"||t.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.context.pop();this.type=n.name}else this.unexpected();return t};m.parsePrivateIdent=function(){var t=this.startNode();if(this.type===n.privateId)t.name=this.value;else this.unexpected();if(this.next(),this.finishNode(t,"PrivateIdentifier"),this.options.checkPrivateFields)if(this.privateNameStack.length===0)this.raise(t.start,"Private field '#"+t.name+"' must be declared in an enclosing class");else this.privateNameStack[this.privateNameStack.length-1].used.push(t);return t};m.parseYield=function(t){if(!this.yieldPos)this.yieldPos=this.start;var e=this.startNode();if(this.next(),this.type===n.semi||this.canInsertSemicolon()||this.type!==n.star&&!this.type.startsExpr)e.delegate=!1,e.argument=null;else e.delegate=this.eat(n.star),e.argument=this.parseMaybeAssign(t);return this.finishNode(e,"YieldExpression")};m.parseAwait=function(t){if(!this.awaitPos)this.awaitPos=this.start;var e=this.startNode();return this.next(),e.argument=this.parseMaybeUnary(null,!0,!1,t),this.finishNode(e,"AwaitExpression")};var st=r.prototype;st.raise=function(t,e){var i=Pt(this.input,t);if(e+=" ("+i.line+":"+i.column+")",this.sourceFile)e+=" in "+this.sourceFile;var s=SyntaxError(e);throw s.pos=t,s.loc=i,s.raisedAt=this.pos,s};st.raiseRecoverable=st.raise;st.curPosition=function(){if(this.options.locations)return new Y(this.curLine,this.pos-this.lineStart)};var V=r.prototype,re=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};V.enterScope=function(t){this.scopeStack.push(new re(t))};V.exitScope=function(){this.scopeStack.pop()};V.treatFunctionsAsVarInScope=function(t){return t.flags&O||!this.inModule&&t.flags&F};V.declareName=function(t,e,i){var s=!1;if(e===R){var o=this.currentScope();if(s=o.lexical.indexOf(t)>-1||o.functions.indexOf(t)>-1||o.var.indexOf(t)>-1,o.lexical.push(t),this.inModule&&o.flags&F)delete this.undefinedExports[t]}else if(e===Ft){var h=this.currentScope();h.lexical.push(t)}else if(e===Vt){var p=this.currentScope();if(this.treatFunctionsAsVar)s=p.lexical.indexOf(t)>-1;else s=p.lexical.indexOf(t)>-1||p.var.indexOf(t)>-1;p.functions.push(t)}else for(var l=this.scopeStack.length-1;l>=0;--l){var c=this.scopeStack[l];if(c.lexical.indexOf(t)>-1&&!(c.flags&_t&&c.lexical[0]===t)||!this.treatFunctionsAsVarInScope(c)&&c.functions.indexOf(t)>-1){s=!0;break}if(c.var.push(t),this.inModule&&c.flags&F)delete this.undefinedExports[t];if(c.flags&ot)break}if(s)this.raiseRecoverable(i,"Identifier '"+t+"' has already been declared")};V.checkLocalExport=function(t){if(this.scopeStack[0].lexical.indexOf(t.name)===-1&&this.scopeStack[0].var.indexOf(t.name)===-1)this.undefinedExports[t.name]=t};V.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};V.currentVarScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(e.flags&(ot|K|B))return e}};V.currentThisScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(e.flags&(ot|K|B)&&!(e.flags&xt))return e}};var pt=function(e,i,s){if(this.type="",this.start=i,this.end=0,e.options.locations)this.loc=new at(e,s);if(e.options.directSourceFile)this.sourceFile=e.options.directSourceFile;if(e.options.ranges)this.range=[i,0]},X=r.prototype;X.startNode=function(){return new pt(this,this.start,this.startLoc)};X.startNodeAt=function(t,e){return new pt(this,t,e)};function Dt(t,e,i,s){if(t.type=e,t.end=i,this.options.locations)t.loc.end=s;if(this.options.ranges)t.range[1]=i;return t}X.finishNode=function(t,e){return Dt.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)};X.finishNodeAt=function(t,e,i,s){return Dt.call(this,t,e,i,s)};X.copyNode=function(t){var e=new pt(this,t.start,this.startLoc);for(var i in t)e[i]=t[i];return e};var Ut=function(){};Ut.prototype.reset=function(){};r.prototype.validateRegExpFlags=function(){};r.prototype.validateRegExpPattern=function(){};var gt=function(e){if(this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations)this.loc=new at(e,e.startLoc,e.endLoc);if(e.options.ranges)this.range=[e.start,e.end]},x=r.prototype;x.next=function(t){if(!t&&this.type.keyword&&this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword);if(this.options.onToken)this.options.onToken(new gt(this));this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};x.getToken=function(){return this.next(),new gt(this)};if(typeof Symbol<"u")x[Symbol.iterator]=function(){var t=this;return{next:function(){var e=t.getToken();return{done:e.type===n.eof,value:e}}}};x.nextToken=function(){var t=this.curContext();if(!t||!t.preserveSpace)this.skipSpace();if(this.start=this.pos,this.options.locations)this.startLoc=this.curPosition();if(this.pos>=this.input.length)return this.finishToken(n.eof);if(t.override)return t.override(this);else this.readToken(this.fullCharCodeAtPos())};x.readToken=function(t){if(u(t,this.options.ecmaVersion>=6)||t===92)return this.readWord();return this.getTokenFromCode(t)};x.fullCharCodeAt=function(t){var e=this.input.charCodeAt(t);if(e<=55295||e>=56320)return e;var i=this.input.charCodeAt(t+1);return i<=56319||i>=57344?e:(e<<10)+i-56613888};x.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};x.skipBlockComment=function(){var t=this.options.onComment&&this.curPosition(),e=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=i+2,this.options.locations)for(var s=void 0,o=e;(s=Et(this.input,o,this.pos))>-1;)++this.curLine,o=this.lineStart=s;if(this.options.onComment)this.options.onComment(!0,this.input.slice(e+2,i),e,this.pos,t,this.curPosition())};x.skipLineComment=function(t){var e=this.pos,i=this.options.onComment&&this.curPosition(),s=this.input.charCodeAt(this.pos+=t);while(this.pos<this.input.length&&!z(s))s=this.input.charCodeAt(++this.pos);if(this.options.onComment)this.options.onComment(!1,this.input.slice(e+t,this.pos),e,this.pos,i,this.curPosition())};x.skipSpace=function(){t:while(this.pos<this.input.length){var t=this.input.charCodeAt(this.pos);switch(t){case 32:case 160:++this.pos;break;case 13:if(this.input.charCodeAt(this.pos+1)===10)++this.pos;case 10:case 8232:case 8233:if(++this.pos,this.options.locations)++this.curLine,this.lineStart=this.pos;break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break t}break;default:if(t>8&&t<14||t>=5760&&Nt.test(String.fromCharCode(t)))++this.pos;else break t}}};x.finishToken=function(t,e){if(this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();var i=this.type;this.type=t,this.value=e,this.updateContext(i)};x.readToken_dot=function(){var t=this.input.charCodeAt(this.pos+1);if(t>=48&&t<=57)return this.readNumber(!0);var e=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&t===46&&e===46)return this.pos+=3,this.finishToken(n.ellipsis);else return++this.pos,this.finishToken(n.dot)};x.readToken_slash=function(){var t=this.input.charCodeAt(this.pos+1);if(this.exprAllowed)return++this.pos,this.readRegexp();if(t===61)return this.finishOp(n.assign,2);return this.finishOp(n.slash,1)};x.readToken_mult_modulo_exp=function(t){var e=this.input.charCodeAt(this.pos+1),i=1,s=t===42?n.star:n.modulo;if(this.options.ecmaVersion>=7&&t===42&&e===42)++i,s=n.starstar,e=this.input.charCodeAt(this.pos+2);if(e===61)return this.finishOp(n.assign,i+1);return this.finishOp(s,i)};x.readToken_pipe_amp=function(t){var e=this.input.charCodeAt(this.pos+1);if(e===t){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(n.assign,3)}return this.finishOp(t===124?n.logicalOR:n.logicalAND,2)}if(e===61)return this.finishOp(n.assign,2);return this.finishOp(t===124?n.bitwiseOR:n.bitwiseAND,1)};x.readToken_caret=function(){var t=this.input.charCodeAt(this.pos+1);if(t===61)return this.finishOp(n.assign,2);return this.finishOp(n.bitwiseXOR,1)};x.readToken_plus_min=function(t){var e=this.input.charCodeAt(this.pos+1);if(e===t){if(e===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||N.test(this.input.slice(this.lastTokEnd,this.pos))))return this.skipLineComment(3),this.skipSpace(),this.nextToken();return this.finishOp(n.incDec,2)}if(e===61)return this.finishOp(n.assign,2);return this.finishOp(n.plusMin,1)};x.readToken_lt_gt=function(t){var e=this.input.charCodeAt(this.pos+1),i=1;if(e===t){if(i=t===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61)return this.finishOp(n.assign,i+1);return this.finishOp(n.bitShift,i)}if(e===33&&t===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45)return this.skipLineComment(4),this.skipSpace(),this.nextToken();if(e===61)i=2;return this.finishOp(n.relational,i)};x.readToken_eq_excl=function(t){var e=this.input.charCodeAt(this.pos+1);if(e===61)return this.finishOp(n.equality,this.input.charCodeAt(this.pos+2)===61?3:2);if(t===61&&e===62&&this.options.ecmaVersion>=6)return this.pos+=2,this.finishToken(n.arrow);return this.finishOp(t===61?n.eq:n.prefix,1)};x.readToken_question=function(){var t=this.options.ecmaVersion;if(t>=11){var e=this.input.charCodeAt(this.pos+1);if(e===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(n.questionDot,2)}if(e===63){if(t>=12){var s=this.input.charCodeAt(this.pos+2);if(s===61)return this.finishOp(n.assign,3)}return this.finishOp(n.coalesce,2)}}return this.finishOp(n.question,1)};x.readToken_numberSign=function(){var t=this.options.ecmaVersion,e=35;if(t>=13){if(++this.pos,e=this.fullCharCodeAtPos(),u(e,!0)||e===92)return this.finishToken(n.privateId,this.readWord1())}this.raise(this.pos,"Unexpected character '"+rt(e)+"'")};x.getTokenFromCode=function(t){switch(t){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(n.parenL);case 41:return++this.pos,this.finishToken(n.parenR);case 59:return++this.pos,this.finishToken(n.semi);case 44:return++this.pos,this.finishToken(n.comma);case 91:return++this.pos,this.finishToken(n.bracketL);case 93:return++this.pos,this.finishToken(n.bracketR);case 123:return++this.pos,this.finishToken(n.braceL);case 125:return++this.pos,this.finishToken(n.braceR);case 58:return++this.pos,this.finishToken(n.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(n.backQuote);case 48:var e=this.input.charCodeAt(this.pos+1);if(e===120||e===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(e===111||e===79)return this.readRadixNumber(8);if(e===98||e===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(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 63:return this.readToken_question();case 126:return this.finishOp(n.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+rt(t)+"'")};x.finishOp=function(t,e){var i=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,i)};x.readRegexp=function(){var t,e,i=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(i,"Unterminated regular expression");var s=this.input.charAt(this.pos);if(N.test(s))this.raise(i,"Unterminated regular expression");if(!t){if(s==="[")e=!0;else if(s==="]"&&e)e=!1;else if(s==="/"&&!e)break;t=s==="\\"}else t=!1;++this.pos}var o=this.input.slice(i,this.pos);++this.pos;var h=this.pos,p=this.readWord1();if(this.containsEsc)this.unexpected(h);var l=this.regexpState||(this.regexpState=new Ut(this));l.reset(i,o,p),this.validateRegExpFlags(l),this.validateRegExpPattern(l);var c=null;try{c=new RegExp(o,p)}catch(d){}return this.finishToken(n.regexp,{pattern:o,flags:p,value:c})};x.readInt=function(t,e,i){var s=this.options.ecmaVersion>=12&&e===void 0,o=i&&this.input.charCodeAt(this.pos)===48,h=this.pos,p=0,l=0;for(var c=0,d=e==null?1/0:e;c<d;++c,++this.pos){var v=this.input.charCodeAt(this.pos),g=void 0;if(s&&v===95){if(o)this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals");if(l===95)this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore");if(c===0)this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits");l=v;continue}if(v>=97)g=v-97+10;else if(v>=65)g=v-65+10;else if(v>=48&&v<=57)g=v-48;else g=1/0;if(g>=t)break;l=v,p=p*t+g}if(s&&l===95)this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits");if(this.pos===h||e!=null&&this.pos-h!==e)return null;return p};function ae(t,e){if(e)return parseInt(t,8);return parseFloat(t.replace(/_/g,""))}function qt(t){if(typeof BigInt!=="function")return null;return BigInt(t.replace(/_/g,""))}x.readRadixNumber=function(t){var e=this.pos;this.pos+=2;var i=this.readInt(t);if(i==null)this.raise(this.start+2,"Expected number in radix "+t);if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110)i=qt(this.input.slice(e,this.pos)),++this.pos;else if(u(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(n.num,i)};x.readNumber=function(t){var e=this.pos;if(!t&&this.readInt(10,void 0,!0)===null)this.raise(e,"Invalid number");var i=this.pos-e>=2&&this.input.charCodeAt(e)===48;if(i&&this.strict)this.raise(e,"Invalid number");var s=this.input.charCodeAt(this.pos);if(!i&&!t&&this.options.ecmaVersion>=11&&s===110){var o=qt(this.input.slice(e,this.pos));if(++this.pos,u(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(n.num,o)}if(i&&/[89]/.test(this.input.slice(e,this.pos)))i=!1;if(s===46&&!i)++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos);if((s===69||s===101)&&!i){if(s=this.input.charCodeAt(++this.pos),s===43||s===45)++this.pos;if(this.readInt(10)===null)this.raise(e,"Invalid number")}if(u(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");var h=ae(this.input.slice(e,this.pos),i);return this.finishToken(n.num,h)};x.readCodePoint=function(){var t=this.input.charCodeAt(this.pos),e;if(t===123){if(this.options.ecmaVersion<6)this.unexpected();var i=++this.pos;if(e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111)this.invalidStringToken(i,"Code point out of bounds")}else e=this.readHexChar(4);return e};x.readString=function(t){var e="",i=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");var s=this.input.charCodeAt(this.pos);if(s===t)break;if(s===92)e+=this.input.slice(i,this.pos),e+=this.readEscapedChar(!1),i=this.pos;else if(s===8232||s===8233){if(this.options.ecmaVersion<10)this.raise(this.start,"Unterminated string constant");if(++this.pos,this.options.locations)this.curLine++,this.lineStart=this.pos}else{if(z(s))this.raise(this.start,"Unterminated string constant");++this.pos}}return e+=this.input.slice(i,this.pos++),this.finishToken(n.string,e)};var Wt={};x.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t===Wt)this.readInvalidTemplateToken();else throw t}this.inTemplateElement=!1};x.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Wt;else this.raise(t,e)};x.readTmplToken=function(){var t="",e=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&(this.type===n.template||this.type===n.invalidTemplate))if(i===36)return this.pos+=2,this.finishToken(n.dollarBraceL);else return++this.pos,this.finishToken(n.backQuote);return t+=this.input.slice(e,this.pos),this.finishToken(n.template,t)}if(i===92)t+=this.input.slice(e,this.pos),t+=this.readEscapedChar(!0),e=this.pos;else if(z(i)){switch(t+=this.input.slice(e,this.pos),++this.pos,i){case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:t+=`
|
|
6
|
+
`;break;default:t+=String.fromCharCode(i);break}if(this.options.locations)++this.curLine,this.lineStart=this.pos;e=this.pos}else++this.pos}};x.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(n.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":if(this.input[this.pos+1]===`
|
|
7
|
+
`)++this.pos;case`
|
|
8
|
+
`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};x.readEscapedChar=function(t){var e=this.input.charCodeAt(++this.pos);switch(++this.pos,e){case 110:return`
|
|
9
|
+
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return rt(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:if(this.options.locations)this.lineStart=this.pos,++this.curLine;return"";case 56:case 57:if(this.strict)this.invalidStringToken(this.pos-1,"Invalid escape sequence");if(t){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string")}default:if(e>=48&&e<=55){var s=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],o=parseInt(s,8);if(o>255)s=s.slice(0,-1),o=parseInt(s,8);if(this.pos+=s.length-1,e=this.input.charCodeAt(this.pos),(s!=="0"||e===56||e===57)&&(this.strict||t))this.invalidStringToken(this.pos-1-s.length,t?"Octal literal in template string":"Octal literal in strict mode");return String.fromCharCode(o)}if(z(e)){if(this.options.locations)this.lineStart=this.pos,++this.curLine;return""}return String.fromCharCode(e)}};x.readHexChar=function(t){var e=this.pos,i=this.readInt(16,t);if(i===null)this.invalidStringToken(e,"Bad character escape sequence");return i};x.readWord1=function(){this.containsEsc=!1;var t="",e=!0,i=this.pos,s=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var o=this.fullCharCodeAtPos();if(y(o,s))this.pos+=o<=65535?1:2;else if(o===92){this.containsEsc=!0,t+=this.input.slice(i,this.pos);var h=this.pos;if(this.input.charCodeAt(++this.pos)!==117)this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX");++this.pos;var p=this.readCodePoint();if(!(e?u:y)(p,s))this.invalidStringToken(h,"Invalid Unicode escape");t+=rt(p),i=this.pos}else break;e=!1}return t+this.input.slice(i,this.pos)};x.readWord=function(){var t=this.readWord1(),e=n.name;if(this.keywords.test(t))e=mt[t];return this.finishToken(e,t)};var ne="8.18.0";r.acorn={Parser:r,version:ne,defaultOptions:ut,Position:Y,SourceLocation:at,getLineInfo:Pt,Node:pt,TokenType:k,tokTypes:n,keywordTypes:mt,TokContext:L,tokContexts:w,isIdentifierChar:y,isIdentifierStart:u,Token:gt,isNewLine:z,lineBreak:N,lineBreakG:Yt,nonASCIIwhitespace:Nt};function q(t){return(e)=>t(e)}function J(...t){return r.extend(...t)}function D(t,e,i){for(let s=e;s<i;s++){let o=t.charCodeAt(s);if(o===10||o===13||o===8232||o===8233)return!0}return!1}var zt=new WeakMap;function a(t,e){if(t===void 0)return!1;if(t.length<16)return t.includes(e);let i=zt.get(t);if(i===void 0||i.length>t.length)i={names:new Set,length:0},zt.set(t,i);while(i.length<t.length)i.names.add(t[i.length++]);return i.names.has(e)}
|
|
10
|
+
export{u,y,r,q,J,D,a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var f=/<!--[\s\S]*?-->|<script\s+(?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?([^"' >]+)\1[^>]*>/y;function S(n){return n.charCodeAt(0)===65279?n.slice(1):n}function s(n){return n>=48&&n<=57}function i(n){if(n===32||n<=13&&n>=9)return!0;if(n<160)return!1;return n===160||n===5760||n>=8192&&n<=8202||n===8232||n===8233||n===8239||n===8287||n===12288||n===65279}function t(n,r){let e=r;while(e<n.length&&i(n.charCodeAt(e)))e++;return e}function z(n){let r=n.indexOf("<");while(r!==-1){let e=n.charCodeAt(r+1);if(e===33||e===115){f.lastIndex=r;let o=f.exec(n);if(o){if(e===115)return o[2]==="ts";r=n.indexOf("<",f.lastIndex);continue}}r=n.indexOf("<",r+1)}return!1}function U(n,r){let e=n.indexOf("</script",r);while(e!==-1){if(n.charCodeAt(t(n,e+8))===l)return e;e=n.indexOf("</script",e+8)}return-1}function K(n,r){return t(n,r+8)+1}var u=new Set("area base br col command embed hr img input keygen link meta param source track wbr".split(" "));function I(n){return u.has(n)||n.charCodeAt(0)===33&&n.toLowerCase()==="!doctype"}function G(n,r){let e=r;while(e<n.length){let o=n.charCodeAt(e);if(o===47&&n.charCodeAt(e+1)===42){let a=n.indexOf("*/",e+2);e=a===-1?n.length:a+2}else if(o===34||o===39){e++;while(e<n.length){let a=n.charCodeAt(e);if(a===o||a===10)break;e+=a===92?2:1}e++}else if(o===60&&n.startsWith("</style",e))break;else e++}return Math.min(e,n.length)}var x=34,c=39,h=47,b=61,l=62,p=(n)=>n===x||n===c;function k(n,r,e){let o=r;for(;o<n.length;o++){let a=n.charCodeAt(o);if(i(a)||a===h||a===l)break;if(e&&(p(a)||a===b))break}return o}function H(n,r){let e=n.charCodeAt(r);return i(e)||p(e)||e===b||e===60||e===l||e===96||e===h&&n.charCodeAt(r+1)===l}
|
|
2
|
+
export{S,s,i,t,z,U,K,I,G,p,k,H};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{s,i}from"./shared-wr6wdcs6.js";var x=0,d=1,C=2,b=3,N=0,B=1,Y=2,T=3,D=4,w=4,I=5,O=6,ee={await:d,case:d,default:d,delete:d,extends:d,in:d,instanceof:d,new:d,of:d,return:d,throw:d,typeof:d,void:d,yield:d,do:C,else:C,finally:C,try:C,for:w,if:w,while:w,with:w,import:I,export:O},H=10,W=Array(K(128,0)).fill(null);for(let e of Object.entries(ee)){let r=K(e[0].charCodeAt(0),e[0].length),t=W[r]??[];t.push(e),W[r]=t}function K(e,r){return e*(H+1)+r}function z(e,r,t){let f=e.charCodeAt(r);if(f>=128||t-r>H)return b;let l=K(f,t-r),a=W[l];if(a===null)return b;for(let n=0;n<a.length;n++)if(e.startsWith(a[n][0],r))return a[n][1];return b}var U=new Uint8Array(128);for(let e of["az","AZ","09","__","$$","\\\\"])for(let r=e.charCodeAt(0);r<=e.charCodeAt(1);r++)U[r]=1;function o(e){return e>=128?!i(e):U[e]===1}function j(e,r,t){q(e,te(e,r),r,t,void 0)}function ke(e,r){q(e,e.length-1,!1,void 0,r)}function q(e,r,t,f,l){let a=[],n=e.startsWith("#!")?ie(e,2):0,c=x,A=!1,E=!1,h=-1,p=()=>{if(c=x,a.length===0)h=-1};while(n<=r){let k=e.charCodeAt(n);if(k===32||k===10||i(k)){n++;continue}if(k===47){let u=v(e,n);if(u!==-1){n=u;continue}}let F=A,Q=E;if(A=!1,E=!1,o(k)||k===35){let u=n;n=J(e,n+1);let g=F?b:z(e,u,n);if(f!==void 0&&a.length===0&&(g===O?t||Z(e,n):g===I&&X(e,n)))n=Math.max(n,f(h!==-1&&g===O?h:u,u)),p();else if(g===O)c=C;else if(g===w)E=!0,c=b;else c=g===d||g===C?g:b;continue}switch(n++,k){case 34:case 39:{let u=n-1;n=S(e,n,k),l?.(u,n,!1),c=b;break}case 96:{let u=n;n=y(e,n,a),l?.(u,M(e,n),!0),c=e.charCodeAt(n-1)===123?d:b;break}case 47:{let u=c===b?-1:V(e,n);if(u===-1)c=d;else n=P(e,u),c=b;break}case 40:a.push(Q?B:N),c=d;break;case 41:c=a.pop()===B?C:b;break;case 123:a.push(c===d?T:Y),c=x;break;case 125:{let u=a.pop();if(u===D){let g=n;n=y(e,n,a),l?.(g,M(e,n),!0),c=e.charCodeAt(n-1)===123?d:b}else if(u===T)c=b;else p();break}case 59:p();break;case 93:c=b;break;case 46:if(s(e.charCodeAt(n)))n=P(e,n),c=b;else if(e.startsWith("..",n))n+=2,c=d;else A=!0,c=d;break;case 63:if(e.charCodeAt(n)===46&&!s(e.charCodeAt(n+1)))n++,A=!0;c=d;break;case 33:c=c===b&&!i(e.charCodeAt(n-2))?b:d;break;case 43:case 45:if(e.charCodeAt(n)===k&&c===b)n++;else c=d;break;case 61:if(c=e.charCodeAt(n)===62?C:d,c===C)n++;break;case 64:if(a.length===0&&h===-1)h=n-1;c=d;break;default:c=d}}}function _(e,r,t){let f=e.length,l=[],a=r,n=d,c=!1;while(a<f){let A=e.charCodeAt(a);if(A===32||A===10||i(A)){a++;continue}if(A===47){let h=v(e,a);if(h!==-1){a=h;continue}}let E=c;if(c=!1,o(A)||A===35){let h=a;if(a=J(e,a+1),!E&&t?.(h,a))return-1;let p=E?b:z(e,h,a);n=p===d||p===C||p===w?d:b;continue}switch(a++,A){case 34:case 39:a=S(e,a,A),n=b;break;case 96:a=y(e,a,l),n=e.charCodeAt(a-1)===123?d:b;break;case 47:{let h=n===b?-1:V(e,a);if(h===-1)n=d;else a=P(e,h),n=b;break}case 40:l.push(N),n=d;break;case 41:if(l.length===0)return a-1;l.pop(),n=b;break;case 123:l.push(n===d?T:Y),n=x;break;case 125:{if(l.length===0)return a-1;let h=l.pop();if(h===D)a=y(e,a,l),n=e.charCodeAt(a-1)===123?d:b;else n=h===T?b:x;break}case 93:n=b;break;case 46:if(s(e.charCodeAt(a)))a=P(e,a),n=b;else if(e.startsWith("..",a))a+=2,n=d;else c=!0,n=d;break;case 63:if(e.charCodeAt(a)===46&&!s(e.charCodeAt(a+1)))a++,c=!0;n=d;break;case 33:n=n===b&&!i(e.charCodeAt(a-2))?b:d;break;case 43:case 45:if(e.charCodeAt(a)===A&&n===b)a++;else n=d;break;case 61:if(e.charCodeAt(a)===62)a++;n=d;break;default:n=d}}return f}function G(e){return e===10||e===13||e===8232||e===8233}function ie(e,r){for(let t=r;t<e.length;t++)if(G(e.charCodeAt(t)))return t;return e.length}function v(e,r){let t=e.charCodeAt(r+1);if(t===47)return ie(e,r+2);if(t!==42)return-1;let f=e.indexOf("*/",r+2);return f===-1?e.length:f+2}function J(e,r){let t=r;while(t<e.length){let f=e.charCodeAt(t);if(f===92)t+=2;else if(o(f))t++;else break}return t}function P(e,r){let t=r;while(t<e.length&&o(e.charCodeAt(t)))t++;return t}function S(e,r,t){for(let f=r;f<e.length;f++){let l=e.charCodeAt(f);if(l===t)return f+1;if(l===92)f+=e.startsWith(`\r
|
|
2
|
+
`,f+1)?2:1;else if(l===10||l===13)return f}return e.length}function y(e,r,t){for(let f=r;f<e.length;f++){let l=e.charCodeAt(f);if(l===96)return f+1;if(l===92)f++;else if(l===36&&e.charCodeAt(f+1)===123)return t.push(D),f+2}return e.length}function M(e,r){let t=e.charCodeAt(r-1);if(t===96)return r-1;if(t===123&&e.charCodeAt(r-2)===36)return r-2;return r}function V(e,r){let t=!1;for(let f=r;f<e.length;f++){let l=e.charCodeAt(f);if(G(l))return-1;if(l===92)f++;else if(l===91)t=!0;else if(l===93)t=!1;else if(l===47&&!t)return f+1}return-1}function m(e,r){let t=r;while(t<e.length){let f=e.charCodeAt(t);if(i(f)){t++;continue}let l=f===47?v(e,t):-1;if(l===-1)return t;t=l}return e.length}function L(e,r,t){return e.charCodeAt(r)===t.charCodeAt(0)&&e.startsWith(t,r)&&!o(e.charCodeAt(r+t.length))}function X(e,r){let t=e.charCodeAt(m(e,r));return t!==40&&t!==46}function Z(e,r){let t=m(e,r);if(L(e,t,"import"))return!0;if(L(e,t,"type"))t=m(e,t+4);let f=e.charCodeAt(t);if(f===42)return!0;if(f!==123)return!1;for(t++;t<e.length;t++){let l=e.charCodeAt(t);if(l===125)break;if(l===34||l===39)t=S(e,t+1,l)-1;else if(l===47)t=Math.max(t,m(e,t)-1)}return L(e,m(e,t+1),"from")}var R=/import|export/g;function te(e,r){let t=-1;R.lastIndex=0;for(let f=R.exec(e);f!==null;f=R.exec(e)){let l=f.index,a=l+6;if(!o(e.charCodeAt(l-1))&&!o(e.charCodeAt(a))&&(e.charCodeAt(l)===105?X(e,a):r||Z(e,a)))t=l}return t}
|
|
3
|
+
export{o,j,ke,_,ie,P,m,L};
|
package/typescript.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TypeScript support for `createParser` from `sveast/core
|
|
3
|
-
*
|
|
2
|
+
* TypeScript support for `createParser` from `sveast/core` and
|
|
3
|
+
* `createModuleParser` from `sveast/module`, so they parse
|
|
4
|
+
* `<script lang="ts">` and `typescript: true`.
|
|
4
5
|
*/
|
|
5
6
|
export declare const typescript: TypeScriptSupport;
|
|
6
7
|
|
package/typescript.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-wfjkg544.js";import"./shared-cr4ebmgx.js";import"./shared-bbp47cz4.js";import"./shared-7q3geqgt.js";import{l}from"./shared-qbw8n9am.js";import{yt}from"./shared-njpj8eam.js";var t=yt(l);export{t as typescript};
|
package/walk.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The fields of each node type that hold child nodes, in source order.
|
|
3
|
-
* Typed against the AST, so a node type without an entry, or a key that
|
|
4
|
-
* isn't one of its fields, fails typechecking. `tests/walk.test.ts` checks
|
|
5
|
-
* the rest against the corpus: no field that holds a node is missing, and
|
|
6
|
-
* children come in source order.
|
|
7
|
-
*/
|
|
1
|
+
/** The fields of each node type that hold child nodes, in source order. */
|
|
8
2
|
export declare const visitorKeys: {
|
|
9
3
|
readonly Root: readonly ["module", "instance", "fragment", "css"];
|
|
10
4
|
readonly Script: readonly ["attributes", "content"];
|
package/walk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{C,Z,B,kt,M,f,N}from"./shared-g06vtkxe.js";import{Tt}from"./shared-cr4ebmgx.js";export{f as SKIP,M as STOP,Tt as createLocator,C as extractIdentifiers,Z as isReference,kt as markupVisitorKeys,B as visitorKeys,N as walk};
|
package/shared-00hyas4z.js
DELETED
package/shared-40v3xx3k.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var a=/<!--[\s\S]*?-->|<script\s+(?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?([^"' >]+)\1[^>]*>/y;function s(n){if(n===32||n<=13&&n>=9)return!0;if(n<160)return!1;return n===160||n===5760||n>=8192&&n<=8202||n===8232||n===8233||n===8239||n===8287||n===12288||n===65279}function t(n,r){let e=r;while(e<n.length&&s(n.charCodeAt(e)))e++;return e}function V(n){let r=n.indexOf("<");while(r!==-1){let e=n.charCodeAt(r+1);if(e===33||e===115){a.lastIndex=r;let i=a.exec(n);if(i){if(e===115)return i[2]==="ts";r=n.indexOf("<",a.lastIndex);continue}}r=n.indexOf("<",r+1)}return!1}var b=new Set("area base br col command embed hr img input keygen link meta param source track wbr".split(" "));function C(n){return b.has(n)||n.charCodeAt(0)===33&&n.toLowerCase()==="!doctype"}function M(n,r){let e=r;while(e<n.length){let i=n.charCodeAt(e);if(i===47&&n.charCodeAt(e+1)===42){let o=n.indexOf("*/",e+2);e=o===-1?n.length:o+2}else if(i===34||i===39){e++;while(e<n.length){let o=n.charCodeAt(e);if(o===i||o===10)break;e+=o===92?2:1}e++}else if(i===60&&n.startsWith("</style",e))break;else e++}return Math.min(e,n.length)}var u=34,c=39,h=47,p=61,d=62,l=(n)=>n===u||n===c;function v(n,r,e){let i=r;for(;i<n.length;i++){let o=n.charCodeAt(i);if(s(o)||o===h||o===d)break;if(e&&(l(o)||o===p))break}return i}function F(n,r){let e=n.charCodeAt(r);return s(e)||l(e)||e===p||e===60||e===d||e===96||e===h&&n.charCodeAt(r+1)===d}var f={li:["li"],dt:["dt","dd"],dd:["dt","dd"],p:"address article aside blockquote div dl fieldset footer form h1 h2 h3 h4 h5 h6 header hgroup hr main menu nav ol p pre section table ul".split(" "),rt:["rt","rp"],rp:["rt","rp"],optgroup:["optgroup"],option:["option","optgroup"],thead:["tbody","tfoot"],tbody:["tbody","tfoot"],tfoot:["tbody"],tr:["tr","tbody"],td:["td","th","tr"],th:["td","th","tr"]};function B(n,r){return Object.hasOwn(f,n)&&f[n].includes(r)}
|
|
2
|
-
export{B,s,t,V,C,M,l,v,F};
|
package/shared-4y1phpr0.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var H={await:1,case:1,default:1,delete:1,extends:1,in:1,instanceof:1,new:1,of:1,return:1,throw:1,typeof:1,void:1,yield:1,do:2,else:2,finally:2,try:2,for:4,if:4,while:4,with:4,import:5,export:6};var L=Array(g(128,0)).fill(null);for(let e of Object.entries(H)){let A=g(e[0].charCodeAt(0),e[0].length),t=L[A]??[];t.push(e),L[A]=t}function g(e,A){return e*11+A}function V(e,A,t){let a=e.charCodeAt(A);if(a>=128||t-A>10)return 3;let E=g(a,t-A),n=L[E];if(n===null)return 3;for(let o=0;o<n.length;o++)if(e.startsWith(n[o][0],A))return n[o][1];return 3}var x=/\s/,D=new Uint8Array(128);for(let e of["az","AZ","09","__","$$","\\\\"])for(let A=e.charCodeAt(0);A<=e.charCodeAt(1);A++)D[A]=1;function r(e){return e>=128?!x.test(String.fromCharCode(e)):D[e]===1}function T(e){return e<128?e===32||e>=9&&e<=13:x.test(String.fromCharCode(e))}function W(e,A,t){K(e,v(e,A),A,t,void 0)}function ye(e,A){K(e,e.length-1,!1,void 0,A)}function K(e,A,t,a,E){let n=e.length,o=[],i=e.startsWith("#!")?b(e,2):0,O=0,d=!1,R=!1,s=-1,h=()=>{if(O=0,o.length===0)s=-1};while(i<=A){let c=e.charCodeAt(i);if(c===32||c===10||T(c)){i++;continue}if(c===47){let f=e.charCodeAt(i+1);if(f===47){i=b(e,i+2);continue}if(f===42){let l=e.indexOf("*/",i+2);i=l===-1?n:l+2;continue}}let M=d,y=R;if(d=!1,R=!1,r(c)||c===35){let f=i;i++;while(i<n){let U=e.charCodeAt(i);if(U===92)i+=2;else if(r(U))i++;else break}let l=M?3:V(e,f,i);if(a!==void 0&&o.length===0&&(l===6?t||B(e,i):l===5&&w(e,i)))i=Math.max(i,a(s!==-1&&l===6?s:f,f)),h();else if(l===6)O=2;else if(l===4)R=!0,O=3;else O=l===1||l===2?l:3;continue}switch(i++,c){case 34:case 39:{let f=i-1;i=k(e,i,c),E?.(f,i,!1),O=3;break}case 96:{let f=i;i=C(e,i,o),E?.(f,p(e,i),!0),O=e.charCodeAt(i-1)===123?1:3;break}case 47:{let f=O===3?-1:S(e,i);if(f===-1)O=1;else{i=f;while(i<n&&r(e.charCodeAt(i)))i++;O=3}break}case 40:o.push(y?1:0),O=1;break;case 41:O=o.pop()===1?2:3;break;case 123:o.push(O===1?3:2),O=0;break;case 125:{let f=o.pop();if(f===4){let l=i;i=C(e,i,o),E?.(l,p(e,i),!0),O=e.charCodeAt(i-1)===123?1:3}else if(f===3)O=3;else h();break}case 59:h();break;case 93:O=3;break;case 46:if(u(e.charCodeAt(i))){while(i<n&&r(e.charCodeAt(i)))i++;O=3}else if(e.startsWith("..",i))i+=2,O=1;else d=!0,O=1;break;case 63:if(e.charCodeAt(i)===46&&!u(e.charCodeAt(i+1)))i++,d=!0;O=1;break;case 33:O=O===3&&!T(e.charCodeAt(i-2))?3:1;break;case 43:case 45:if(e.charCodeAt(i)===c&&O===3)i++;else O=1;break;case 61:if(O=e.charCodeAt(i)===62?2:1,O===2)i++;break;case 64:if(o.length===0&&s===-1)s=i-1;O=1;break;default:O=1}}}function N(e,A,t){let a=e.length,E=[],n=A,o=1,i=!1;while(n<a){let O=e.charCodeAt(n);if(O===32||O===10||T(O)){n++;continue}if(O===47){let R=e.charCodeAt(n+1);if(R===47){n=b(e,n+2);continue}if(R===42){let s=e.indexOf("*/",n+2);n=s===-1?a:s+2;continue}}let d=i;if(i=!1,r(O)||O===35){let R=n;n++;while(n<a){let h=e.charCodeAt(n);if(h===92)n+=2;else if(r(h))n++;else break}if(!d&&t?.(R,n))return-1;let s=d?3:V(e,R,n);o=s===1||s===2||s===4?1:3;continue}switch(n++,O){case 34:case 39:n=k(e,n,O),o=3;break;case 96:n=C(e,n,E),o=e.charCodeAt(n-1)===123?1:3;break;case 47:{let R=o===3?-1:S(e,n);if(R===-1)o=1;else{n=R;while(n<a&&r(e.charCodeAt(n)))n++;o=3}break}case 40:E.push(0),o=1;break;case 41:if(E.length===0)return n-1;E.pop(),o=3;break;case 123:E.push(o===1?3:2),o=0;break;case 125:{if(E.length===0)return n-1;let R=E.pop();if(R===4)n=C(e,n,E),o=e.charCodeAt(n-1)===123?1:3;else o=R===3?3:0;break}case 93:o=3;break;case 46:if(u(e.charCodeAt(n))){while(n<a&&r(e.charCodeAt(n)))n++;o=3}else if(e.startsWith("..",n))n+=2,o=1;else i=!0,o=1;break;case 63:if(e.charCodeAt(n)===46&&!u(e.charCodeAt(n+1)))n++,i=!0;o=1;break;case 33:o=o===3&&!T(e.charCodeAt(n-2))?3:1;break;case 43:case 45:if(e.charCodeAt(n)===O&&o===3)n++;else o=1;break;case 61:if(e.charCodeAt(n)===62)n++;o=1;break;default:o=1}}return a}function u(e){return e>=48&&e<=57}function b(e,A){for(let t=A;t<e.length;t++){let a=e.charCodeAt(t);if(a===10||a===13||a===8232||a===8233)return t}return e.length}function k(e,A,t){for(let a=A;a<e.length;a++){let E=e.charCodeAt(a);if(E===t)return a+1;if(E===92)a+=e.startsWith(`\r
|
|
2
|
-
`,a+1)?2:1;else if(E===10||E===13)return a}return e.length}function C(e,A,t){for(let a=A;a<e.length;a++){let E=e.charCodeAt(a);if(E===96)return a+1;if(E===92)a++;else if(E===36&&e.charCodeAt(a+1)===123)return t.push(4),a+2}return e.length}function p(e,A){let t=e.charCodeAt(A-1);if(t===96)return A-1;if(t===123&&e.charCodeAt(A-2)===36)return A-2;return A}function S(e,A){let t=!1;for(let a=A;a<e.length;a++){let E=e.charCodeAt(a);if(E===10||E===13||E===8232||E===8233)return-1;if(E===92)a++;else if(E===91)t=!0;else if(E===93)t=!1;else if(E===47&&!t)return a+1}return-1}function m(e,A){for(let t=A;t<e.length;t++){let a=e.charCodeAt(t);if(T(a))continue;if(a===47){let E=e.charCodeAt(t+1);if(E===47){t=b(e,t+2)-1;continue}if(E===42){let n=e.indexOf("*/",t+2);if(n===-1)return e.length;t=n+1;continue}}return t}return e.length}function _(e,A,t){return e.charCodeAt(A)===t.charCodeAt(0)&&e.startsWith(t,A)&&!r(e.charCodeAt(A+t.length))}function w(e,A){let t=e.charCodeAt(m(e,A));return t!==40&&t!==46}function B(e,A){let t=m(e,A);if(_(e,t,"import"))return!0;if(_(e,t,"type"))t=m(e,t+4);let a=e.charCodeAt(t);if(a===42)return!0;if(a!==123)return!1;for(t++;t<e.length;t++){let E=e.charCodeAt(t);if(E===125)break;if(E===34||E===39)t=k(e,t+1,E)-1;else if(E===47)t=Math.max(t,m(e,t)-1)}return _(e,m(e,t+1),"from")}var P=/import|export/g;function v(e,A){let t=-1;P.lastIndex=0;for(let a=P.exec(e);a!==null;a=P.exec(e)){let E=a.index,n=E+6;if(!r(e.charCodeAt(E-1))&&!r(e.charCodeAt(n))&&(e.charCodeAt(E)===105?w(e,n):A||B(e,n)))t=E}return t}
|
|
3
|
-
export{r,W,ye,N,u,m,_};
|
package/shared-5kdpxrm3.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var m=Array(2048).fill(void 0);function g(){m.fill(void 0)}function ft(e,n,t,r){let i=r&2047,o=m[i];if(o!==void 0&&o.length===t-n&&e.startsWith(o,n))return o;let b=e.slice(n,t);return m[i]=b,b}var d="",s=[0],l=0,c=0,u;function T(e){g(),d=e,s=[0],l=0,c=0,u=void 0}function h(e){while(l<=e){let n=d.indexOf(`
|
|
2
|
-
`,l);if(n===-1){l=Number.POSITIVE_INFINITY;return}l=n+1,s.push(l)}}function y(e){let n=[0],t=e.indexOf(`
|
|
3
|
-
`);while(t!==-1)n.push(t+1),t=e.indexOf(`
|
|
4
|
-
`,t+1);return n}function x(e,n,t){let r=0,i=e.length-1;if(n>=e[t])r=t;else i=t-1;if(r<i&&n<e[r+1])i=r;while(r<i){let o=r+i+1>>>1;if(e[o]<=n)r=o;else i=o-1}return r}function p(e){return h(e),c=x(s,e,c),{line:c+1,column:e-s[c],character:e}}var a=/\r\n?|\n|\u2028|\u2029/g,w=/[\r\u2028\u2029]/;function dt(e){if(u===void 0){u=w.test(d)?[]:null,a.lastIndex=0;while(u!==null&&a.exec(d)!==null)u.push(a.lastIndex)}if(u===null)return h(e),x(s,e,c);let n=0,t=u.length;while(n<t){let r=n+t>>>1;if(u[r]<=e)n=r+1;else t=r}return n}function k(e){let{line:n,column:t}=p(e);return{line:n,column:t}}function mt(e){while(s.length<=e+1&&l!==Number.POSITIVE_INFINITY)h(l);if(e>=s.length)return;let n=e+1<s.length?s[e+1]-1:d.length;return d.slice(s[e],n)}function xt(e){let n,t=0;return(r)=>(n??=y(e),t=x(n,r,t),{line:t+1,column:r-n[t]})}function f(e){return typeof e==="object"&&e!==null&&typeof E(e).type==="string"}function E(e){return e}function L(e,n){let t=E(e);for(let r in t){let i=t[r];if(Array.isArray(i)){for(let o=0;o<i.length;o++)if(f(i[o]))i[o]=n(i[o])}else if(f(i))t[r]=n(i)}}function J(e,...n){if(!n.some((t)=>t===e.type))throw Error(`expected ${n.join(" or ")}, got ${e.type}`)}
|
|
5
|
-
export{ft,T,p,dt,k,mt,xt,f,E,L,J};
|
package/shared-a454y0yc.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{T}from"./shared-5kdpxrm3.js";import{pt}from"./shared-yxr92tk5.js";import{W}from"./shared-4y1phpr0.js";function b(t,r,o){T(t);let e={isTypeScript:r.typescript??!1,typescript:o,loc:!1,comments:!1,root:{comments:[]}};return pt(e,t,(s)=>W(t,r.localExports??!0,s))}
|
|
2
|
-
export{b};
|
package/shared-fcgh2ks8.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function ct(t){return{support:"typescript",parser:t}}function ht(t){return{support:"entities",names:t}}function U(t){return t&&"parser"in t?t.parser:void 0}function ut(t){return t&&"names"in t?t.names:void 0}function z(){throw Error('sveast: parsing TypeScript needs `typescript` from "sveast/typescript": createParser({ typescript }) or createModuleParser({ typescript })')}
|
|
2
|
-
export{ct,ht,U,ut,z};
|
package/shared-np5jnnrw.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{I,o}from"./shared-zd01zsyh.js";var N=/(?:\s|\/\/.*|\/\*[\s\S]*?\*\/)*/g,F=new Map([["any","TSAnyKeyword"],["bigint","TSBigIntKeyword"],["boolean","TSBooleanKeyword"],["never","TSNeverKeyword"],["null","TSNullKeyword"],["number","TSNumberKeyword"],["object","TSObjectKeyword"],["string","TSStringKeyword"],["symbol","TSSymbolKeyword"],["undefined","TSUndefinedKeyword"],["unknown","TSUnknownKeyword"],["void","TSVoidKeyword"]]),O=new Set("public private protected readonly declare abstract override static accessor".split(" ")),K=new Set("public private protected readonly override".split(" ")),V=new Set("var let const function class abstract enum interface type namespace module global".split(" ")),H=new Set("var let const function class interface enum".split(" ")),k=new Set(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"]),L=1,U=32,j=256,z=0,G=1,f=2,Q=3,W=4,T=6,C=7,D=256,E=1024,Y=8|E,X=f|D,w=1,J=2,P=40,Z=41,tt=44,_=46,v=58,y=61,R=60,m=123,et=91,S=42,st=35,b=34,A=39,it=SyntaxError("speculative parse failed"),q=I((x)=>{let{tokTypes:s,keywordTypes:M,isIdentifierChar:B,isIdentifierStart:u}=x.acorn,d=new x.acorn.TokenType("@");class g extends x{inType=!1;$4=!1;$5=!1;$7=null;$l=null;$m=!1;$n=!1;$f=null;$9=[[]];$o=0;$t=0;$j=-1;constructor(t,e,r){super(t,e,r);let i=this.options.onComment;if(typeof i==="function")this.options.onComment=(n,a,h,p,c,l)=>{if(h<this.$t)return;this.$t=p,i.call(this,n,a,h,p,c,l)}}reset(){this.inType=!1,this.$4=!1,this.$5=!1,this.$7=null,this.$l=null,this.$m=!1,this.$n=!1,this.$f=null,this.$9=[[]],this.$o=0,this.$t=0,this.$j=-1}getTokenFromCode(t){if(t===64)return++this.pos,this.finishToken(d);return super.getTokenFromCode(t)}readToken_lt_gt(t){if(this.inType)return this.finishOp(s.relational,1);return super.readToken_lt_gt(t)}$a(t){let e=this.inType;this.inType=!0;let r=t();if(this.inType=e,!e&&this.type===s.relational)this.pos=this.start,this.nextToken();return r}$1(){return this.type===s.relational&&this.value==="<"}$p(){if(this.type===s.bitShift&&this.value==="<<")this.pos=this.start+1,this.finishToken(s.relational,"<");return this.$1()}$c(){return this.type===s.relational&&this.value===">"}$u(){return this.type===s.prefix&&this.value==="!"}hasPrecedingLineBreak(){return this.$14(this.lastTokEnd,this.start)}$14(t,e){for(let r=t;r<e;r++){let i=this.input.charCodeAt(r);if(i===10||i===13||i===8232||i===8233)return!0}return!1}$d(t=this.pos){return N.lastIndex=t,N.exec(this.input),N.lastIndex}$2(){return this.input.charCodeAt(this.$d())}$3(){let t=this.$d(),e=t;while(e<this.input.length&&B(this.input.charCodeAt(e)))e++;return this.input.slice(t,e)}$b(){return!this.$14(this.pos,this.$d())}$15(){return this.$b()&&u(this.$2())&&!Object.hasOwn(M,this.$3())}$16(){return{pos:this.pos,type:this.type,value:this.value,start:this.start,end:this.end,startLoc:this.startLoc,endLoc:this.endLoc,lastTokStart:this.lastTokStart,lastTokEnd:this.lastTokEnd,lastTokStartLoc:this.lastTokStartLoc,lastTokEndLoc:this.lastTokEndLoc,curLine:this.curLine,lineStart:this.lineStart,context:this.context.slice(),exprAllowed:this.exprAllowed,containsEsc:this.containsEsc,inType:this.inType,$4:this.$4,$5:this.$5,$7:this.$7,scopes:this.scopeStack.length,privateNames:this.privateNameStack.length,labels:this.labels,labelCount:this.labels.length,strict:this.strict,yieldPos:this.yieldPos,awaitPos:this.awaitPos,awaitIdentPos:this.awaitIdentPos,potentialArrowAt:this.potentialArrowAt,potentialArrowInForAwait:this.potentialArrowInForAwait}}$17(t){this.pos=t.pos,this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,this.startLoc=t.startLoc,this.endLoc=t.endLoc,this.lastTokStart=t.lastTokStart,this.lastTokEnd=t.lastTokEnd,this.lastTokStartLoc=t.lastTokStartLoc,this.lastTokEndLoc=t.lastTokEndLoc,this.curLine=t.curLine,this.lineStart=t.lineStart,this.context=t.context,this.exprAllowed=t.exprAllowed,this.containsEsc=t.containsEsc,this.inType=t.inType,this.$4=t.$4,this.$5=t.$5,this.$7=t.$7,this.scopeStack.length=t.scopes,this.privateNameStack.length=t.privateNames,this.labels=t.labels,this.labels.length=t.labelCount,this.strict=t.strict,this.yieldPos=t.yieldPos,this.awaitPos=t.awaitPos,this.awaitIdentPos=t.awaitIdentPos,this.potentialArrowAt=t.potentialArrowAt,this.potentialArrowInForAwait=t.potentialArrowInForAwait}raise(t,e){if(this.$o>0)throw it;return super.raise(t,e)}$1z(t,e){try{super.raise(t,e)}catch(r){if(r instanceof SyntaxError)r.$20=!0;throw r}throw Error("unreachable")}$g(t,e=!1){let r=this.$16();this.$o++;try{let i=t();if(e||i===void 0)this.$17(r);return i}catch(i){if(!(i instanceof SyntaxError)||!e&&i.$20)throw i;this.$17(r);return}finally{this.$o--}}$v(t){return this.$g(t,!0)===!0}$18(t){if(t.end=this.lastTokEnd,this.options.locations)t.loc.end=this.lastTokEndLoc}$q(t,e){if(t.start=e.start,this.options.locations)t.loc.start=e.loc.start}$6(t=!1){let e=this.startNode();return e.typeAnnotation=this.$a(()=>(this.next(),t?this.$21():this.$0())),this.finishNode(e,"TSTypeAnnotation")}$h(t,e){if(e&&this.eat(s.question))t.optional=!0,this.$18(t);if(this.type===s.colon)t.typeAnnotation=this.$6(),this.$18(t);return t}$21(){if(this.type!==s.name&&this.type!==s._this)return this.$0();if(this.isContextual("asserts")&&this.$b()&&u(this.$2())){let t=this.startNode();if(this.next(),t.parameterName=this.type===s._this?this.$w():this.parseIdent(),this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.$x(t,!0);return t.asserts=!0,t.typeAnnotation=null,this.finishNode(t,"TSTypePredicate")}if(this.$3()==="is"&&this.$b()){let t=this.startNode();return t.parameterName=this.type===s._this?this.$w():this.parseIdent(!0),this.$x(t,!1)}return this.$0()}$x(t,e){this.next();let r=this.startNode();return r.typeAnnotation=this.$0(),t.typeAnnotation=this.finishNode(r,"TSTypeAnnotation"),t.asserts=e,this.finishNode(t,"TSTypePredicate")}$w(){let t=this.startNode();return this.next(),this.finishNode(t,"TSThisType")}parseWholeType(){this.inType=!0,this.nextToken();let t=this.$0();if(this.type!==s.eof)this.unexpected();return t}$0(){let t=this.$19();if(this.$4||this.type!==s._extends||this.hasPrecedingLineBreak())return t;let e=this.startNodeAt(t.start,t.loc?.start);return this.next(),e.checkType=t,e.extendsType=this.$i(!0,()=>this.$19()),this.expect(s.question),e.trueType=this.$i(!1,()=>this.$0()),this.expect(s.colon),e.falseType=this.$i(!1,()=>this.$0()),this.finishNode(e,"TSConditionalType")}$i(t,e){let r=this.$4;this.$4=t;let i=e();return this.$4=r,i}$19(){if(this.$22())return this.$1a("TSFunctionType");if(this.type===s._new||this.isContextual("abstract")&&this.$3()==="new")return this.$1a("TSConstructorType");return this.$1b("TSUnionType",s.bitwiseOR,()=>this.$1b("TSIntersectionType",s.bitwiseAND,()=>this.$1c()))}$1a(t){let e=this.startNode();if(t==="TSConstructorType"){if(e.abstract=this.isContextual("abstract"),e.abstract)this.next();this.next()}return this.$i(!1,()=>this.$r(e,s.arrow)),this.finishNode(e,t)}$r(t,e){if(this.$1())t.typeParameters=this.$8();if(this.expect(s.parenL),t.parameters=this.parseBindingList(s.parenR,!1,!0),this.type===e)t.typeAnnotation=this.$6(!0);else if(e===s.arrow)this.unexpected()}$22(){if(this.$1())return!0;if(this.type!==s.parenL)return!1;return this.$v(()=>{if(this.next(),this.type===s.parenR||this.type===s.ellipsis)return!0;if(this.type===s.name||this.type===s._this)this.next();else if(this.type===s.braceL||this.type===s.bracketL)this.parseBindingAtom();else return!1;let t=this.type;if(t===s.colon||t===s.comma||t===s.question||t===s.eq)return!0;if(t!==s.parenR)return!1;return this.next(),this.type===s.arrow})}$1b(t,e,r){let i=this.startNode(),n=this.eat(e),a=[];do a.push(r());while(this.eat(e));if(a.length===1&&!n)return a[0];return i.types=a,this.finishNode(i,t)}$1c(){if(this.type===s.name&&!this.containsEsc){let t=this.value;if(t==="keyof"||t==="unique"||t==="readonly"){let e=this.startNode();return this.next(),e.operator=t,e.typeAnnotation=this.$1c(),this.finishNode(e,"TSTypeOperator")}if(t==="infer"){let e=this.startNode();this.next();let r=this.startNode();r.name=this.$y();let i=this.$g(()=>this.$23());if(i)r.constraint=i;return e.typeParameter=this.finishNode(r,"TSTypeParameter"),this.finishNode(e,"TSInferType")}}return this.$i(!1,()=>this.$24())}$23(){if(!this.eat(s._extends))return;let t=this.$i(!0,()=>this.$0());if(this.$4||this.type!==s.question)return t;return}$y(){if(this.type!==s.name&&!this.type.keyword)this.unexpected();let t=this.type===s.name?this.value:this.type.keyword;return this.next(),t}$24(){let t=this.$25();while(!this.hasPrecedingLineBreak()&&this.eat(s.bracketL)){let e=this.startNodeAt(t.start,t.loc?.start);if(this.eat(s.bracketR))e.elementType=t,t=this.finishNode(e,"TSArrayType");else e.objectType=t,e.indexType=this.$0(),this.expect(s.bracketR),t=this.finishNode(e,"TSIndexedAccessType")}return t}$25(){switch(this.type){case s.name:case s._void:case s._null:{let t=F.get(this.value);if(t&&(this.type!==s.name||!this.containsEsc&&this.$2()!==_)){let e=this.startNode();return this.next(),this.finishNode(e,t)}return this.$1d()}case s.string:case s.num:case s._true:case s._false:{let t=this.startNode();return t.literal=this.parseExprAtom(),this.finishNode(t,"TSLiteralType")}case s.plusMin:{if(this.value!=="-")break;let t=this.startNode(),e=this.startNode();if(this.next(),this.type!==s.num)this.unexpected();return e.operator="-",e.prefix=!0,e.argument=this.parseExprAtom(),t.literal=this.finishNode(e,"UnaryExpression"),this.finishNode(t,"TSLiteralType")}case s.backQuote:return this.$26();case s._this:{let t=this.$w();if(this.isContextual("is")&&!this.hasPrecedingLineBreak()){let e=this.startNodeAt(t.start,t.loc?.start);return e.parameterName=t,this.$x(e,!1)}return t}case s._typeof:return this.$27();case s._import:return this.$1e();case s.braceL:return this.$28()?this.$29():this.$2a();case s.bracketL:return this.$2b();case s.parenL:{let t=this.startNode();return this.next(),t.typeAnnotation=this.$0(),this.expect(s.parenR),this.finishNode(t,"TSParenthesizedType")}default:if(this.type.keyword)return this.$1d()}return this.unexpected()}$1d(){let t=this.startNode();if(t.typeName=this.$k(),!this.hasPrecedingLineBreak()&&this.$1())t.typeArguments=this.$e();return this.finishNode(t,"TSTypeReference")}$k(){let t=this.parseIdent(!0);while(this.eat(s.dot)){let e=this.startNodeAt(t.start,t.loc?.start);e.left=t,e.right=this.parseIdent(!0),t=this.finishNode(e,"TSQualifiedName")}return t}$27(){let t=this.startNode();if(this.next(),t.exprName=this.type===s._import?this.$1e():this.$k(),!this.hasPrecedingLineBreak()&&this.$1())t.typeArguments=this.$e();return this.finishNode(t,"TSTypeQuery")}$1e(){let t=this.startNode();if(this.next(),t.argument=this.$1f(),this.eat(s.dot))t.qualifier=this.$k();if(this.$1())t.typeArguments=this.$e();return this.finishNode(t,"TSImportType")}$z(){if(this.type!==s.string)this.unexpected();return this.parseExprAtom()}$1f(){this.expect(s.parenL);let t=this.$z();return this.expect(s.parenR),t}$26(){let t=this.startNode(),e=this.startNode();this.next(),e.expressions=[];let r=this.parseTemplateElement({isTagged:!1});e.quasis=[r];while(!r.tail){if(this.type===s.eof)this.raise(this.pos,"Unterminated template literal");this.expect(s.dollarBraceL),e.expressions.push(this.$0()),this.expect(s.braceR),r=this.parseTemplateElement({isTagged:!1}),e.quasis.push(r)}return this.next(),t.literal=this.finishNode(e,"TemplateLiteral"),this.finishNode(t,"TSLiteralType")}$28(){return this.$v(()=>{if(this.next(),this.type===s.plusMin)return this.next(),this.isContextual("readonly");if(this.isContextual("readonly"))this.next();if(this.type!==s.bracketL)return!1;if(this.next(),this.type!==s.name)return!1;return this.next(),this.type===s._in})}$29(){let t=this.startNode();if(this.expect(s.braceL),this.type===s.plusMin)t.readonly=this.value,this.next(),this.expectContextual("readonly");else if(this.eatContextual("readonly"))t.readonly=!0;this.expect(s.bracketL);let e=this.startNode();if(e.name=this.$y(),this.expect(s._in),e.constraint=this.$0(),t.typeParameter=this.finishNode(e,"TSTypeParameter"),t.nameType=this.eatContextual("as")?this.$0():null,this.expect(s.bracketR),this.type===s.plusMin)t.optional=this.value,this.next(),this.expect(s.question);else if(this.eat(s.question))t.optional=!0;if(this.eat(s.colon))t.typeAnnotation=this.$0();return this.semicolon(),this.expect(s.braceR),this.finishNode(t,"TSMappedType")}$2a(){let t=this.startNode();return t.members=this.$1g(),this.finishNode(t,"TSTypeLiteral")}$1g(){this.expect(s.braceL);let t=[];while(!this.eat(s.braceR))t.push(this.$2c());return t}$2c(){let t=this.startNode(),e="TSPropertySignature",r=this.type===s._new?this.$2():-1;if(this.type===s.parenL||this.$1())e="TSCallSignatureDeclaration",this.$r(t,s.colon);else if(r===P||r===R)e="TSConstructSignatureDeclaration",this.next(),this.$r(t,s.colon);else{let i=this.type===s._new?this.parseIdent(!0):null;if(this.isContextual("readonly")&&this.$s(!0))this.next(),t.readonly=!0;if(this.type===s.bracketL&&this.$1h())return this.$1i(t);let n="method";if(i)t.key=i;else{if((this.isContextual("get")||this.isContextual("set"))&&this.$s(!1))n=this.value,this.next();this.parsePropertyName(t)}if(this.eat(s.question))t.optional=!0;if(this.type===s.parenL||this.$1()){if(e="TSMethodSignature",n!=="method")t.kind=n;this.$r(t,s.colon),t.kind=n}else if(this.type===s.colon)t.typeAnnotation=this.$6()}return this.$1j(),this.finishNode(t,e)}$1j(){if(!this.eat(s.comma))this.semicolon()}$1h(){return this.$v(()=>{if(this.next(),this.type!==s.name)return!1;return this.next(),this.type===s.colon})}$1i(t){if(this.expect(s.bracketL),t.parameters=[this.$h(this.parseIdent(),!1)],this.expect(s.bracketR),this.type===s.colon)t.typeAnnotation=this.$6();return this.$1j(),this.finishNode(t,"TSIndexSignature")}$2b(){let t=this.startNode();this.expect(s.bracketL),t.elementTypes=[];while(!this.eat(s.bracketR))if(t.elementTypes.push(this.$2d()),this.type!==s.bracketR)this.expect(s.comma);return this.finishNode(t,"TSTupleType")}$2d(){let t=this.start,e=this.startLoc,r=this.eat(s.ellipsis),i;if((this.type===s.name||this.type.keyword)&&this.$2e()){let n=this.startNode();n.label=this.parseIdent(!0),n.optional=this.eat(s.question),this.expect(s.colon),n.elementType=this.$0(),i=this.finishNode(n,"TSNamedTupleMember")}else if(i=this.$0(),this.eat(s.question)){let n=this.startNodeAt(i.start,i.loc?.start);n.typeAnnotation=i,i=this.finishNode(n,"TSOptionalType")}if(r){let n=this.startNodeAt(t,e);n.typeAnnotation=i,i=this.finishNode(n,"TSRestType")}return i}$2e(){let t=this.$d();if(this.input.charCodeAt(t)===63)t=this.$d(t+1);return this.input.charCodeAt(t)===v}$8(){return this.$a(()=>{let t=this.startNode();this.next(),t.params=[];while(!this.$c()){let e=this.startNode();while((this.type===s._const||this.type===s._in||this.isContextual("out"))&&u(this.$2()))e[this.value]=!0,this.next();if(e.name=this.$y(),this.eat(s._extends))e.constraint=this.$0();if(this.eat(s.eq))e.default=this.$0();if(t.params.push(this.finishNode(e,"TSTypeParameter")),!this.$c()){if(this.expect(s.comma),this.$c())t.extra={trailingComma:this.lastTokStart}}}if(this.next(),t.params.length===0)this.$1z(this.start,"Type parameter list cannot be empty.");return this.finishNode(t,"TSTypeParameterDeclaration")})}$e(){return this.$a(()=>{let t=this.startNode();this.next(),t.params=[];while(!this.$c())if(t.params.push(this.$0()),!this.$c())this.expect(s.comma);if(t.params.length===0)this.unexpected();return this.next(),this.finishNode(t,"TSTypeParameterInstantiation")})}$1k(){let t=[];do{let e=this.startNode();if(e.expression=this.$k(),this.$1())e.typeParameters=this.$e();t.push(this.finishNode(e,"TSExpressionWithTypeArguments"))}while(this.eat(s.comma));return t}$1l(t=!1){if(this.type!==s.name||this.containsEsc){if(this.type===s._const&&this.$3()==="enum")return this.$10(this.startNode());return}if(!this.$2f(this.value))return;if(this.value==="declare")return this.$2g(t);return this.$1m(this.startNode(),this.value)}$2f(t){switch(t){case"interface":case"type":case"namespace":return this.$15();case"enum":return u(this.$2());case"abstract":return this.$b()&&this.$3()==="class";case"module":{let e=this.$2();return this.$b()&&(e===b||e===A||u(e))}case"declare":return this.$b()&&V.has(this.$3());case"global":return this.$b()&&this.$2()===m}return!1}$1m(t,e){switch(e){case"interface":return this.$1n(t);case"type":return this.$2h(t);case"enum":return this.$10(t);case"abstract":return this.$1o(t,!0);case"global":return t.global=!0,t.id=this.parseIdent(),t.body=this.$11(),this.finishNode(t,"TSModuleDeclaration")}return this.$2i(t)}$2g(t){let e=this.$5;this.$5=!0;let r=this.startNode();this.next();let i=this.value;if(i==="const"&&this.$3()==="enum")r.const=!0;if(!t&&H.has(i))r.declare=!0;let n;if(r.const)n=this.$10(r);else if(i==="var"||i==="let"||i==="const")n=this.parseVarStatement(r,i,!0);else if(i==="function")this.next(),n=this.parseFunction(r,w,!1,!1);else if(i==="class")n=this.parseClass(r,!0);else n=this.$1m(r,i);return n.declare=!0,this.$5=e,n}$1o(t,e){return this.next(),t.abstract=!0,this.parseClass(t,e)}$1n(t){if(this.next(),t.id=this.parseIdent(),this.checkLValSimple(t.id,C),this.$1())t.typeParameters=this.$8();return this.$a(()=>{if(this.eat(s._extends))t.extends=this.$1k();let e=this.startNode();e.body=this.$1g(),t.body=this.finishNode(e,"TSInterfaceBody")}),this.finishNode(t,"TSInterfaceDeclaration")}$2h(t){if(this.next(),t.id=this.parseIdent(),this.checkLValSimple(t.id,T),this.$1())t.typeParameters=this.$8();return t.typeAnnotation=this.$a(()=>(this.expect(s.eq),this.$0())),this.semicolon(),this.finishNode(t,"TSTypeAliasDeclaration")}$10(t){if(this.type===s._const)t.const=!0,this.next();this.next(),t.id=this.parseIdent(),this.checkLValSimple(t.id,X),this.expect(s.braceL),t.members=[];while(!this.eat(s.braceR)){let e=this.startNode();if(e.id=this.type===s.string?this.parseExprAtom():this.parseIdent(!0),this.eat(s.eq))e.initializer=this.parseMaybeAssign();if(t.members.push(this.finishNode(e,"TSEnumMember")),this.type!==s.braceR)this.expect(s.comma)}return this.finishNode(t,"TSEnumDeclaration")}$2i(t){if(this.next(),this.type===s.string){if(t.id=this.parseExprAtom(),this.type===s.braceL)t.body=this.$11();else this.semicolon();return this.finishNode(t,"TSModuleDeclaration")}return t.id=this.parseIdent(),this.checkLValSimple(t.id,Y),this.$1p(t)}$1p(t){if(this.eat(s.dot)){let e=this.startNode();e.id=this.parseIdent(),t.body=this.$1p(e)}else t.body=this.$11();return this.finishNode(t,"TSModuleDeclaration")}$11(){this.enterScope(j);let t=this.startNode();this.enterScope(0),this.expect(s.braceL),t.body=[];while(!this.eat(s.braceR))t.body.push(this.parseStatement(null,!0));return this.exitScope(),this.exitScope(),this.finishNode(t,"TSModuleBlock")}$1q(t,e){if(t.isExport=e,t.id=this.parseIdent(),this.checkLValSimple(t.id,f),this.expect(s.eq),this.isContextual("require")&&this.$2()===P){let r=this.startNode();this.next(),r.expression=this.$1f(),t.moduleReference=this.finishNode(r,"TSExternalModuleReference")}else t.moduleReference=this.$k();return this.semicolon(),this.finishNode(t,"TSImportEqualsDeclaration")}$2j(){let t=this.$d();if(this.input.charCodeAt(t)!==y)return!1;let e=this.input.charCodeAt(t+1);return e!==y&&e!==62}parseStatement(t,e,r){if(this.type===d)this.$1r(!0);let i=this.$1l();if(i)return i;return super.parseStatement(t,e,r)}parseVarStatement(t,e,r){return super.parseVarStatement(t,e,r||this.$5)}parseVarId(t,e){if(super.parseVarId(t,e),t.id.type==="Identifier"&&this.$u()&&!this.hasPrecedingLineBreak())this.next(),t.definite=!0;this.$h(t.id,!1)}parseCatchClauseParam(){let t=this.$h(this.parseBindingAtom(),!1),e=t.type==="Identifier";return this.enterScope(e?U:0),this.checkLValPattern(t,e?W:f),this.expect(s.parenR),t}parseImport(t){if(this.next(),t.importKind="value",this.type===s.string)t.specifiers=[],t.source=this.parseExprAtom();else{if(this.isContextual("type")){let e=this.$2();if(e===m||e===S||u(e)&&this.$3()!=="from")t.importKind="type",this.next()}if(this.type===s.name&&this.$2j())return this.$1q(t,!1);t.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),t.source=this.$z()}return this.$1s(t),this.semicolon(),this.finishNode(t,"ImportDeclaration")}parseWithClause(){if(this.isContextual("assert")&&!this.hasPrecedingLineBreak())this.type=s._with;return this.type===s._with?super.parseWithClause():void 0}$1s(t){let e=this.parseWithClause();if(e)t.attributes=e}parseImportSpecifier(){return this.$1t("importKind",()=>super.parseImportSpecifier())}parseExportSpecifier(t){return this.$1t("exportKind",()=>super.parseExportSpecifier(t))}$1t(t,e){let r=this.isContextual("type")?this.$2():-1;if(r===b||r===A||u(r)&&this.$3()!=="as"){let n=this.startNode();this.next();let a=e();return this.$q(a,n),a[t]="type",a}let i=e();return i[t]="value",i}parseExport(t,e){if(this.next(),this.eat(s._import)){if(t.importKind="value",this.isContextual("type")&&u(this.$2())&&this.$3()!=="from")t.importKind="type",this.next();return this.$1q(t,!0)}if(this.eat(s.eq))return t.expression=this.parseExpression(),this.semicolon(),this.finishNode(t,"TSExportAssignment");if(this.eatContextual("as"))return this.expectContextual("namespace"),t.id=this.parseIdent(),this.semicolon(),this.finishNode(t,"TSNamespaceExportDeclaration");if(t.exportKind="value",this.isContextual("type")){let n=this.$2();if(n===m||n===S)t.exportKind="type",this.next()}if(this.eat(s.star))return this.parseExportAllDeclaration(t,e);if(this.eat(s._default)){if(this.isContextual("interface")&&this.$15())t.declaration=this.$1n(this.startNode());else if(this.isContextual("abstract")&&this.$3()==="class")t.declaration=this.$1o(this.startNode(),"nullableID");else t.declaration=this.parseExportDefaultDeclaration();return this.finishNode(t,"ExportDefaultDeclaration")}let r=this.isContextual("declare"),i=this.$1l(!0);if(i||this.shouldParseExportStatement()){if(t.declaration=i??this.parseStatement(null),r||t.declaration.type==="TSInterfaceDeclaration"||t.declaration.type==="TSTypeAliasDeclaration")t.exportKind="type";return t.specifiers=[],t.source=null,this.finishNode(t,"ExportNamedDeclaration")}if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))t.source=this.$z(),this.$1s(t);else{for(let n of t.specifiers)if(this.checkUnreserved(n.local),this.checkLocalExport(n.local),n.local.type==="Literal")this.raise(n.local.start,"A string literal cannot be used as an exported binding without `from`.");t.source=null}return this.semicolon(),this.finishNode(t,"ExportNamedDeclaration")}parseFunction(t,e,r,i,n){let a=e&w;if(a)this.$f=t,this.$j=t.start;super.parseFunction(t,e,r,i,n),this.$f=null;let h=!t.body;if(h)t.type="TSDeclareFunction";if(a&&t.id){if(h){if(this.$5&&this.currentScope().flags&L)this.declareName(t.id.name,E,t.id.start);this.checkLValSimple(t.id,z)}else if(!(e&J)){let p=Q;if(this.strict||t.generator||t.async)p=this.treatFunctionsAsVar?G:f;this.checkLValSimple(t.id,p)}}return t}parseFunctionParams(t){if(this.$1())t.typeParameters=this.$8();if(super.parseFunctionParams(t),this.type===s.colon)t.returnType=this.$6(!0)}parseFunctionBody(t,e,r,i){if(r&&this.type===s.colon)t.returnType=this.$6(!0);if(e||this.type===s.braceL||t.start!==this.$j){super.parseFunctionBody(t,e,r,i);return}this.semicolon(),this.exitScope()}parseMethod(t,e,r){let i=this.$l;this.$l=null;let n=super.parseMethod(t,e,r);if(!n.body)n.type="TSDeclareMethod";if(i)n.typeParameters=i;return n}parseBindingList(t,e,r,i){let n=i===!0||this.$m;return this.$m=!1,super.parseBindingList(t,e,r,n)}$s(t){if(!t&&!this.$b())return!1;let e=this.$2();return e===et||e===m||e===S||e===_||e===st||e===b||e===A||e>=48&&e<=57||u(e)}parseAssignableListItem(t){let e=this.$12(),r=this.start,i=this.startLoc,n,a=!1,h=!1;if(t)while(this.type===s.name&&K.has(this.value)&&!this.containsEsc&&this.$s(!1)){if(this.value==="readonly")a=!0;else if(this.value==="override")h=!0;else n=this.value;this.next()}let p;if(this.type===s._this)p=this.startNode(),p.name="this",this.next(),this.finishNode(p,"Identifier");else p=this.parseBindingAtom();let c=this.type===s.eq?this.parseMaybeDefault(r,i,p):this.parseMaybeDefault(p.start,p.loc?.start,this.$h(p,!0));if(e.length>0)c.decorators=e;if(!n&&!a&&!h)return c;let l=this.startNodeAt(r,i);if(n)l.accessibility=n;if(a)l.readonly=!0;if(h)l.override=!0;return l.parameter=c,this.finishNode(l,"TSParameterProperty")}parseBindingListItem(t){if(t.type==="RestElement")this.$h(t,!0);return t}checkLValSimple(t,e,r){if(this.$f&&t===this.$f.id){this.$f=null;return}if(!e&&k.has(t.type)){this.checkLValSimple(t.expression,e,r);return}switch(t.type){case"TSParameterProperty":this.checkLValInnerPattern(t.parameter,e,r);return;case"Identifier":if(t.name==="this")return}super.checkLValSimple(t,e,r)}toAssignable(t,e,r){if(t&&!e&&k.has(t.type))return t;return super.toAssignable(t,e,r)}declareName(t,e,r){let i=this.currentScope();if(e&E){this.$1u(i,t),i.$1v??=[],i.$1v.push(t);return}if(e===T||e===C){if(i.$13??=[],e===T&&o(i.$13,t))this.raise(r,`type '${t}' has already been declared.`);i.$13.push(t),this.$1u(i,t);return}if(e&D){if(i.$1w??=[],o(i.$1w,t))return;super.declareName(t,f,r),i.$1w.push(t);return}super.declareName(t,e,r)}$1u(t,e){if(this.inModule&&t.flags&L)delete this.undefinedExports[e]}checkLocalExport(t){for(let e=this.scopeStack.length-1;e>=0;e--){let r=this.scopeStack[e];if(o(r.$13,t.name)||o(r.$1v,t.name))return}super.checkLocalExport(t)}checkExport(){}raiseRecoverable(t,e){if(e==="Duplicate constructor in the same class")return;super.raiseRecoverable(t,e)}$12(){let t=[];while(this.type===d)t.push(this.$1x());return t}$1r(t){let e=this.$9[this.$9.length-1];while(this.type===d)e.push(this.$1x());if(this.type===s._export){if(!t)this.unexpected()}else if(this.type!==s._class&&!((this.isContextual("abstract")||this.isContextual("declare"))&&this.$3()==="class"))this.raise(this.start,"Leading decorators must be attached to a class declaration.")}$1x(){let t=this.startNode();this.next(),this.$9.push([]);let e=this.start,r=this.startLoc,i;if(this.type===s.parenL){if(this.next(),i=this.parseExpression(),this.expect(s.parenR),this.options.preserveParens){let a=this.startNodeAt(e,r);a.expression=i,i=this.finishNode(a,"ParenthesizedExpression")}}else{i=this.parseIdent(!1);while(this.eat(s.dot)){let a=this.startNodeAt(e,r);a.object=i,a.property=this.parseIdent(!0),a.computed=!1,i=this.finishNode(a,"MemberExpression")}}let n=this.$p()?this.$e():void 0;if(this.eat(s.parenL)){let a=this.startNodeAt(i.start,i.loc?.start);if(a.callee=i,a.arguments=this.parseExprList(s.parenR,!1,!1),n)a.typeArguments=n;i=this.finishNode(a,"CallExpression")}else if(n){let a=this.startNodeAt(i.start,i.loc?.start);a.expression=i,a.typeArguments=n,i=this.finishNode(a,"TSInstantiationExpression")}return t.expression=i,this.$9.pop(),this.finishNode(t,"Decorator")}shouldParseExportStatement(){return this.type===d||super.shouldParseExportStatement()}parseExprAtom(t,e,r){if(this.type===d)this.$1r(!1);return super.parseExprAtom(t,e,r)}parseProperty(t,e){if(t||this.type!==d)return super.parseProperty(t,e);let r=this.$12(),i=super.parseProperty(t,e);if(i.type==="SpreadElement")this.raise(i.start,"Decorators can't be used with SpreadElement");return i.decorators=r,i}parseClassId(t,e){let r=this.$9.length-1,i=this.$9[r];if(i.length>0)t.decorators=i,this.$q(t,i[0]),this.$9[r]=[];if(!this.isContextual("implements")||e===!0)super.parseClassId(t,e);if(this.$1())t.typeParameters=this.$8()}parseClassSuper(t){if(super.parseClassSuper(t),t.superClass&&this.$1())t.superTypeParameters=this.$e();if(this.eatContextual("implements"))t.implements=this.$a(()=>this.$1k())}parseClassElement(t){if(this.type===d){let h=this.$12();if(this.type===s.braceR)this.raise(this.start,"Decorators must be attached to a class element.");let p=this.parseClassElement(t);return p.decorators=h,this.$q(p,h[0]),p}if(this.eat(s.semi))return null;let e=this.startNode();while(this.type===s.name&&O.has(this.value)&&!this.containsEsc&&this.$s(this.value==="static")){let h=this.value;if(this.next(),h==="static"&&this.type===s.braceL)return this.next(),this.parseClassStaticBlock(e),e;if(h==="public"||h==="private"||h==="protected")e.accessibility=h;else e[h]=!0}if(this.type===s.bracketL&&this.$1h())return this.$1i(e);e.static??=!1;let r="",i=!1,n=!1,a="method";if(this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===s.star)&&!this.canInsertSemicolon())n=!0;else r="async";if(!r&&this.eat(s.star))i=!0;if(!r&&!n&&!i){let h=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())a=h;else r=h}if(r)e.computed=!1,e.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),e.key.name=r,this.finishNode(e.key,"Identifier");else this.parseClassElementName(e);if(this.eat(s.question))e.optional=!0;if(this.type===s.parenL||this.$1()||a!=="method"||i||n){let h=e.key,p=!e.static&&!e.computed&&(h.type==="Identifier"&&h.name==="constructor"||h.type==="Literal"&&h.value==="constructor");if(e.kind=p?"constructor":a,this.$1())e.typeParameters=this.$8();this.$m=p,this.$j=this.start,this.parseClassMethod(e,i,n,p&&t)}else{if(!e.optional&&this.$u())this.next(),e.definite=!0;if(this.type===s.colon)e.typeAnnotation=this.$6();this.parseClassField(e)}return e}parseMaybeAssign(t,e,r){if(this.$p()){let i=this.$g(()=>{let n=this.$8(),a=super.parseMaybeAssign(t,e,r);if(a.type!=="ArrowFunctionExpression")return;return a.typeParameters=n,this.$q(a,n),a});if(i)return i}return super.parseMaybeAssign(t,e,r)}parseMaybeUnary(t,e,r,i){if(this.$p()){let n=this.startNode();return n.typeAnnotation=this.$a(()=>{this.next();let a=this.$0();if(!this.$c())this.unexpected();return this.next(),a}),n.expression=this.parseMaybeUnary(null,!1,!1,i),this.finishNode(n,"TSTypeAssertion")}return super.parseMaybeUnary(t,e,r,i)}parseMaybeConditional(t,e){let r=this.start,i=this.startLoc,n=this.parseExprOps(t,e);if(this.checkExpressionErrors(e))return n;if(this.type===s.question&&!(n.type==="ArrowFunctionExpression"&&n.start===r)&&!this.$2k()){this.next();let a=this.startNodeAt(r,i);return a.test=n,a.consequent=this.parseMaybeAssign(),this.expect(s.colon),a.alternate=this.parseMaybeAssign(t),this.finishNode(a,"ConditionalExpression")}return n}$2k(){let t=this.$d(),e=this.input.charCodeAt(t);if(e===v||e===tt||e===Z)return!0;return e===y&&this.input.charCodeAt(t+1)!==y}parseParenItem(t){return this.$h(t,!0)}$1y(){if(this.type!==s.colon)return!0;let t=this.$g(()=>{let e=this.$6(!0);return this.type===s.arrow&&!this.canInsertSemicolon()?e:void 0});if(!t)return!1;return this.$7=t,!0}shouldParseArrow(t){return this.$1y()&&super.shouldParseArrow(t)}shouldParseAsyncArrow(){return this.$1y()&&super.shouldParseAsyncArrow()}parseArrowExpression(t,e,r,i){if(this.$7)t.returnType=this.$7,this.$7=null;return super.parseArrowExpression(t,e,r,i)}parseExprList(t,e,r,i){if(!this.$n)return super.parseExprList(t,e,r,i);this.$n=!1;let n=[],a=!0;while(!this.eat(t)){if(a)a=!1;else if(this.expect(s.comma),e&&this.afterTrailingComma(t))break;if(this.type===s.ellipsis){let h=this.parseSpread(i);if(this.eat(s.question))h.optional=!0;if(this.type===s.colon)h.typeAnnotation=this.$6();n.push(h)}else n.push(this.parseMaybeAssign(!1,i,this.parseParenItem))}return n}parseSubscript(t,e,r,i,n,a,h){if(this.$u()&&!this.hasPrecedingLineBreak()){let c=this.startNodeAt(e,r);return this.exprAllowed=!1,this.next(),c.expression=t,this.finishNode(c,"TSNonNullExpression")}if(n&&this.$1()){let c=this.$g(()=>this.$2l(e,r,h));if(c)return c}let p=this.type===s.questionDot&&this.$2()===R;if(this.$1()||p||this.type===s.bitShift&&this.value==="<<"){let c=this.$g(()=>{if(p)this.next();this.$p();let l=this.$e();if(this.type===s.parenL&&!i)return l;if(this.type===s.backQuote)return p?void 0:l;if(p)return;if(this.$c()||this.type===s.bitShift||this.type.startsExpr&&this.type!==s.parenL&&!this.hasPrecedingLineBreak())return;return l});if(c){let l=this.startNodeAt(e,r);if(this.type===s.parenL&&!i){if(this.next(),l.callee=t,l.arguments=this.parseExprList(s.parenR,!0,!1),l.typeArguments=c,p)t.optional=!0;if(p||a)l.optional=p;return this.finishNode(l,"CallExpression")}if(this.type===s.backQuote)return l.tag=t,l.quasi=this.parseTemplate({isTagged:!0}),l.typeArguments=c,this.finishNode(l,"TaggedTemplateExpression");return l.expression=t,l.typeArguments=c,this.finishNode(l,"TSInstantiationExpression")}}if(n&&this.type===s.parenL)this.$n=!0;return super.parseSubscript(t,e,r,i,n,a,h)}$2l(t,e,r){let i=this.startNodeAt(t,e);if(i.typeParameters=this.$8(),this.expect(s.parenL),i.params=this.parseBindingList(s.parenR,!1,!0),this.type===s.colon)i.returnType=this.$6(!0);if(this.type!==s.arrow||this.canInsertSemicolon())return;return this.next(),this.parseArrowExpression(i,i.params,!0,r)}parseDynamicImport(t){if(this.next(),t.source=this.parseMaybeAssign(),this.eat(s.comma)&&this.type!==s.parenR)t.arguments=[this.parseExpression()];return this.expect(s.parenR),this.finishNode(t,"ImportExpression")}parseNew(){let t=super.parseNew();if(t.callee?.type!=="TSInstantiationExpression")return t;let e=this.startNodeAt(t.start,t.loc?.start);return e.callee=t.callee.expression,e.typeArguments=t.callee.typeArguments,e.arguments=t.arguments,this.finishNodeAt(e,"NewExpression",t.end,t.loc?.end)}parseExprOp(t,e,r,i,n){if(s._in.binop>i&&this.type===s.name&&(this.value==="as"||this.value==="satisfies")&&!this.containsEsc&&!this.hasPrecedingLineBreak()){let a=this.value==="satisfies",h=this.startNodeAt(e,r);return h.expression=t,h.typeAnnotation=this.$a(()=>{if(this.next(),!a&&this.type===s._const){let p=this.startNode();return p.typeName=this.parseIdent(!0),this.finishNode(p,"TSTypeReference")}return this.$0()}),this.finishNode(h,a?"TSSatisfiesExpression":"TSAsExpression"),this.parseExprOp(h,e,r,i,n)}return super.parseExprOp(t,e,r,i,n)}parseGetterSetter(t){t.kind=t.key.name,super.parseGetterSetter(t)}parsePropertyValue(t,e,r,i,n,a,h,p){if(!e&&this.$1()){if(this.$l=this.$8(),this.type!==s.parenL)this.unexpected();t.kind="init"}return super.parsePropertyValue(t,e,r,i,n,a,h,p)}}return g});
|
|
2
|
-
export{q};
|
package/shared-r6mb2ytj.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{S}from"./shared-k5pfyxpa.js";import{X,te,ie,re}from"./shared-x7fez4k2.js";import{de}from"./shared-tgpdmrqm.js";import{x}from"./shared-3yc3kmnb.js";import{a}from"./shared-00hyas4z.js";function u(t,n,c){let p=te(t,n,c);return y(p),ie(p)}function y(t){let{source:n}=t,{tags:c,comments:p}=de(n),i=t.root.fragment.nodes,f=(e,r)=>{if(r<=e)return;let o=n.slice(e,r),d=o.includes("<")||o.includes("{")?o:S(o,!1,t.entityNames);i.push({type:"Text",start:e,end:r,raw:o,data:d})},s=0,m=0;for(let e of c){for(;m<p.length&&p[m]<e;m+=2){let r=p[m];if(r<s)continue;let o=p[m+1];f(s,r),i.push({type:"Comment",start:r,end:o,data:n.slice(r+4,o-3)}),s=o}if(e<s)continue;f(s,e),t.index=e,X(t);while(t.stack.length>1&&t.index<n.length)re(t);s=t.index}let l=i.filter((e)=>e.type==="SvelteOptions");i.length=0,i.push(...l)}var T={typescript:a,entityNames:x};function ee(t,n){return u(t,n,T)}
|
|
2
|
-
export{ee};
|
package/shared-t30czg6b.js
DELETED
package/shared-tgpdmrqm.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{B,s,t,V,C,M,l,v,F}from"./shared-40v3xx3k.js";import{N}from"./shared-4y1phpr0.js";var E="{",G=60,I=62,g=47,_=61,b=123,A=/<(?:script|style|svelte:options)(?![^\s/>])/g,S=/<\/script\s*>/g,O=/\s*>/y,T=/<\/textarea(\s[^>]*)?>/iy,y="</svelte:options";function H(e){let o=(e.charCodeAt(0)===65279?e.slice(1):e).trimEnd(),n={typescript:V(o),instance:null,module:null,css:null,options:null};return W(o,n,null),n}function de(e){let d={tags:[],comments:[]};return W(e,{typescript:!1,instance:null,module:null,css:null,options:null},d),d}function W(e,d,o){let n=R(e),a=[],i=0;while(i<=n){let r=e.charCodeAt(i);if(r===G)i=X(e,i,a,d,o);else if(r===b)i=w(e,i,a);else i++}}function R(e){let d=-1;A.lastIndex=0;for(let o=A.exec(e);o!==null;o=A.exec(e))d=o.index;return d}function L(e,d){return Math.min(N(e,d)+1,e.length)}function w(e,d,o){let n=t(e,d+1),a=e.charCodeAt(n),i=e.charCodeAt(n+1);if(a===35||a===58||a===64||a===g&&i!==g&&i!==42){n++;while(n<e.length){let r=e.charCodeAt(n);if(r<97||r>122)break;n++}if(a===35)o.push(E);else if(a===g){let r=o.lastIndexOf(E);if(r!==-1)o.length=r}}return L(e,n)}function X(e,d,o,n,a){if(e.startsWith("!--",d+1)){let c=e.indexOf("-->",d+4),x=c===-1?e.length:c+3;if(a&&o.length===0)a.comments.push(d,x);return x}if(e.charCodeAt(d+1)===g){let c=d+2,x=e.slice(c,v(e,c,!1)),p=o.lastIndexOf(x);if(p!==-1)o.length=p;return u(e,t(e,c+x.length))}let i=e.slice(d+1,v(e,d+1,!1)),r=t(e,d+1+i.length),m=o[o.length-1];if(m!==void 0&&B(m,i))o.pop();let f=o.length===0;if(a&&f&&(i==="script"||i==="style"||i==="svelte:options"))a.tags.push(d);if(f&&(i==="script"||i==="style")){let c=[];if(r=u(e,Q(e,r,c)),i==="script"){let p=q(e,d,r,c);if(p.context==="module")n.module??=p;else n.instance??=p;return p.end}let x=P(e,d,r,c);return n.css??=x,x.end}let h=f&&i==="svelte:options"?[]:null;if(r=U(e,r,h),e.charCodeAt(r)===g||C(i)){if(e.charCodeAt(r)===g)r++;r=u(e,r)}else{if(r=u(e,r),i==="textarea")return K(e,r);if(i==="script"||i==="style"){let c=`</${i}>`,x=e.indexOf(c,r);return x===-1?e.length:x+c.length}if(h&&e.startsWith(y,r))r=u(e,t(e,r+y.length));else return o.push(i),r}if(h)n.options??={start:d,end:r,attributes:h};return r}function u(e,d){return e.charCodeAt(d)===I?d+1:d}function q(e,d,o,n){S.lastIndex=o;let a=S.exec(e),i=a?a.index:e.length,r=n.some((m)=>m.name==="module"||m.name==="context");return{start:d,end:a?a.index+a[0].length:e.length,context:r?"module":"default",attributes:n,content:{start:o,end:i}}}function P(e,d,o,n){let a=M(e,o),i=a;if(e.startsWith("</style",i)){i+=7,O.lastIndex=i;let r=O.exec(e);if(r)i+=r[0].length}return{start:d,end:i,attributes:n,content:{start:o,end:a}}}function Q(e,d,o){let n=d;for(;;){let a=n,i=v(e,n,!0);if(i===a)return n;n=i;let r=!0;if(e.charCodeAt(n)===_){let m=t(e,n+1),f=e.charCodeAt(m),h=-1;if(l(f)){let x=e.indexOf(e[m],m+1);if(x!==-1)h=x+1}if(h===-1){h=m;while(h<e.length&&e.charCodeAt(h)!==I&&!s(e.charCodeAt(h)))h++}let c=l(f)?1:0;r=e.slice(m+c,h-c),n=h}o.push({name:e.slice(a,i),value:r,start:a,end:n}),n=t(e,n)}}function U(e,d,o){let n=d;for(;;){for(;;){if(e.startsWith("/*",n)){let f=e.indexOf("*/",n+2);n=f===-1?e.length:f+2}else if(e.startsWith("//",n)){let f=e.indexOf(`
|
|
2
|
-
`,n+2);n=f===-1?e.length:f}else break;n=t(e,n)}let a=n;if(e.charCodeAt(n)===b){n=t(e,L(e,n+1));continue}let i=v(e,n,!0);if(i===a)return n;let r=i,m=!0;if(n=t(e,i),e.charCodeAt(n)===_){let f=t(e,n+1);r=e.startsWith("/>",f)?f+1:D(e,f),m=l(e.charCodeAt(f))?e.slice(f+1,Math.max(f+1,r-1)):e.slice(f,r),n=t(e,r)}o?.push({name:e.slice(a,i),value:m,start:a,end:r})}}function D(e,d){let o=e.charCodeAt(d);if(l(o)){let a=d+1;while(a<e.length){let i=e.charCodeAt(a);if(i===o)return a+1;a=i===b?L(e,a+1):a+1}return e.length}let n=d;while(n<e.length&&!F(e,n))n=e.charCodeAt(n)===b?L(e,n+1):n+1;return n}function K(e,d){let o=d;while(o<e.length){let n=e.charCodeAt(o);if(n===G){if(T.lastIndex=o,T.test(e))return T.lastIndex}o=n===b?L(e,o+1):o+1}return e.length}
|
|
3
|
-
export{H,de};
|
package/shared-wkbh341y.js
DELETED