sveld 0.37.8 → 0.38.0

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/lib/browser.js CHANGED
@@ -1,272 +1,262 @@
1
- var Pp=Object.defineProperty;var Ap=(e)=>e;function kp(e,t){this[e]=Ap.bind(null,t)}var wp=(e,t)=>{for(var n in t)Pp(e,n,{get:t[n],enumerable:!0,configurable:!0,set:kp.bind(t,n)})};function Np(e){return e}function We(e){return typeof e==="object"&&e!==null}function Cs(e){return We(e)&&e.type==="VariableDeclaration"&&Array.isArray(e.declarations)}function Tt(e){return We(e)&&e.type==="Literal"}function ye(e){return We(e)&&e.type==="Identifier"&&typeof e.name==="string"}function Wt(e){return We(e)&&e.type==="MemberExpression"}function Ke(e){return We(e)&&e.type==="ObjectExpression"&&Array.isArray(e.properties)}function Dp(e){return We(e)&&e.type==="CallExpression"}function ct(e,t){if(!Dp(e))return!1;return!!e.callee&&We(e.callee)&&e.callee.type==="Identifier"&&e.callee.name===t}function Et(e){if(We(e)&&(e.type==="TSAsExpression"||e.type==="TSSatisfiesExpression")&&"expression"in e)return Et(e.expression);return e}function Ss(e){if(We(e)&&(e.type==="TSAsExpression"||e.type==="TSSatisfiesExpression")&&"typeAnnotation"in e)return e.typeAnnotation;return}function _p(e){return We(e)&&e.type==="NewExpression"}function kr(e,t){if(!_p(e))return!1;return!!e.callee&&We(e.callee)&&e.callee.type==="Identifier"&&e.callee.name===t}function vs(e){if(!We(e)||typeof e.type!=="string")return null;if(e.type==="Literal"){let t=e.value;if(typeof t==="string")return t;return t==null?null:String(t)}if(e.type==="TemplateLiteral"){let t=e.quasis;if(t?.length===1){let n=t[0]?.value?.cooked;return n==null?null:n}}return null}var Ps={a:"HTMLAnchorElement",abbr:"HTMLElement",address:"HTMLElement",applet:"HTMLUnknownElement",area:"HTMLAreaElement",article:"HTMLElement",aside:"HTMLElement",audio:"HTMLAudioElement",b:"HTMLElement",base:"HTMLBaseElement",basefont:"HTMLElement",bdi:"HTMLElement",bdo:"HTMLElement",blockquote:"HTMLQuoteElement",body:"HTMLBodyElement",br:"HTMLBRElement",button:"HTMLButtonElement",canvas:"HTMLCanvasElement",caption:"HTMLTableCaptionElement",cite:"HTMLElement",code:"HTMLElement",col:"HTMLTableColElement",colgroup:"HTMLTableColElement",data:"HTMLDataElement",datalist:"HTMLDataListElement",dd:"HTMLElement",del:"HTMLModElement",details:"HTMLDetailsElement",dfn:"HTMLElement",dialog:"HTMLDialogElement",dir:"HTMLDirectoryElement",div:"HTMLDivElement",dl:"HTMLDListElement",dt:"HTMLElement",em:"HTMLElement",embed:"HTMLEmbedElement",fieldset:"HTMLFieldSetElement",figcaption:"HTMLElement",figure:"HTMLElement",font:"HTMLFontElement",footer:"HTMLElement",form:"HTMLFormElement",frame:"HTMLFrameElement",frameset:"HTMLFrameSetElement",h1:"HTMLHeadingElement",h2:"HTMLHeadingElement",h3:"HTMLHeadingElement",h4:"HTMLHeadingElement",h5:"HTMLHeadingElement",h6:"HTMLHeadingElement",head:"HTMLHeadElement",header:"HTMLElement",hgroup:"HTMLElement",hr:"HTMLHRElement",html:"HTMLHtmlElement",i:"HTMLElement",iframe:"HTMLIFrameElement",img:"HTMLImageElement",input:"HTMLInputElement",ins:"HTMLModElement",kbd:"HTMLElement",label:"HTMLLabelElement",legend:"HTMLLegendElement",li:"HTMLLIElement",link:"HTMLLinkElement",main:"HTMLElement",map:"HTMLMapElement",mark:"HTMLElement",marquee:"HTMLMarqueeElement",menu:"HTMLMenuElement",meta:"HTMLMetaElement",meter:"HTMLMeterElement",nav:"HTMLElement",noscript:"HTMLElement",object:"HTMLObjectElement",ol:"HTMLOListElement",optgroup:"HTMLOptGroupElement",option:"HTMLOptionElement",output:"HTMLOutputElement",p:"HTMLParagraphElement",param:"HTMLParamElement",picture:"HTMLPictureElement",pre:"HTMLPreElement",progress:"HTMLProgressElement",q:"HTMLQuoteElement",rp:"HTMLElement",rt:"HTMLElement",ruby:"HTMLElement",s:"HTMLElement",samp:"HTMLElement",script:"HTMLScriptElement",search:"HTMLElement",section:"HTMLElement",select:"HTMLSelectElement",slot:"HTMLSlotElement",small:"HTMLElement",source:"HTMLSourceElement",span:"HTMLSpanElement",strong:"HTMLElement",style:"HTMLStyleElement",sub:"HTMLElement",summary:"HTMLElement",sup:"HTMLElement",table:"HTMLTableElement",tbody:"HTMLTableSectionElement",td:"HTMLTableCellElement",template:"HTMLTemplateElement",textarea:"HTMLTextAreaElement",tfoot:"HTMLTableSectionElement",th:"HTMLTableCellElement",thead:"HTMLTableSectionElement",time:"HTMLTimeElement",title:"HTMLTitleElement",tr:"HTMLTableRowElement",track:"HTMLTrackElement",u:"HTMLElement",ul:"HTMLUListElement",var:"HTMLElement",video:"HTMLVideoElement",wbr:"HTMLElement"};function Ip(e){return e in Ps}function As(e){if(Ip(e))return Ps[e];return"HTMLElement"}var It=Symbol("sveld.parsedComponentTypeScriptMetadata");function wr(e){return e[It]}var Lp=/\w/;function Rp(e,t){let n=e.trim();if(!n.startsWith("{")||!n.endsWith("}"))return;let r=n.slice(1,-1),i=[],o=0,s="";for(let c of r)if(c==="{"||c==="<"||c==="("||c==="[")o++,s+=c;else if(c==="}"||c===">"||c===")"||c==="]")o--,s+=c;else if((c===";"||c===",")&&o===0)i.push(s.trim()),s="";else s+=c;if(s.trim())i.push(s.trim());for(let c of i){if(!c.startsWith(t))continue;let l=c.slice(t.length);if(l.length>0&&Lp.test(l[0]))continue;let d=l.trimStart();if(d.startsWith("?"))d=d.slice(1).trimStart();if(d.startsWith(":"))return d.slice(1).trim()}return}function Fn(e,t,n){let r=n;if(r.computed||r.object?.type!=="Identifier"||r.property?.type!=="Identifier")return;let i=r.object.name,o=r.property.name;if(!i||!o)return;if(e.wholePropsLocals.has(i))return t.getPropTypeByLocalOrPublic(o);let s=t.getPropTypeByLocalOrPublic(i)??t.findVariableTypeAndDescription(i)?.type;if(!s)return;return Rp(s,o)}var Nr=/^\s+/,ks=/\s/,Mp=/^@[^\s/]+(?=\s|$)/,Op=/^@(\S+)\s*/,Bp=new Set(["extends","extendProps","generics","template","typedef"]);function cn(e){let t=0;while(t<e.length){let n=e.charCodeAt(t);if(n!==32&&n!==9&&n!==13&&n!==10&&!ks.test(e[t]))break;t++}return t}function Fp(e,t){let n=e.slice(cn(e)),r=!1;if(t)n=n.slice(3),r=!0;else if(n.startsWith("*")&&!n.startsWith("*/"))n=n.slice(1),r=!0;let i=n.slice(0,cn(n));n=n.slice(i.length);let o=n.trimEnd(),s=o.endsWith("*/")?o.slice(0,-2).trimEnd():n;return{indent:r?i.slice(1):i,content:s}}function $p(e,t,n){let r=n>t&&e.charCodeAt(n-1)===13?n-1:n;return e.slice(t,r)}function Vp(e){let t=[],n=0;while(!0){let r=e.indexOf("/**",n);if(r===-1)break;let i=e.lastIndexOf(`
2
- `,r-1)+1;if(e.charCodeAt(r+3)===42||e.slice(i,r).trim()!==""){n=r+1;continue}let o=[],s=i,c=!1,l=0;while(s<=e.length){let d=e.indexOf(`
3
- `,s),u=d===-1?e.length:d,y=$p(e,s,u),{indent:g,content:b}=Fp(y,o.length===0);o.push({raw:y,start:s,number:o.length,indent:g,content:b});let P=y.trimEnd();if(P.endsWith("*/")){c=!0,l=s+P.length,n=u;break}if(d===-1)break;s=d+1}if(!c)break;t.push({start:r,end:l,lines:o})}return t}function jp(e){let t=e;if(t.length>0&&t[0].content==="")t=t.slice(1);if(t.length>0&&t[t.length-1].content==="")t=t.slice(0,-1);return t}function Hp(e){let t=[[]],n=!1;for(let r of e){if(Mp.test(r.content)&&!n)t.push([r]);else t[t.length-1].push(r);if($n(r.content))n=!n}return t}function $n(e){return qp(e,"```")%2===1}function qp(e,t){let n=0,r=e.indexOf(t);while(r!==-1)n++,r=e.indexOf(t,r+t.length);return n}function ws(e){return e.map((t)=>t.indent+t.content).join(`
4
- `)}function Up(e,t){let n=t;while(n<e.length-1&&e[n].content.trim()==="")n++;if(e[n].content[0]!=="{")return null;let r=0,i,o=!1,s=[],c=n;for(;c<e.length;c++){let u=e[c].content,y=0;for(let g of u){if(y++,i!==void 0){if(o)o=!1;else if(g==="\\")o=!0;else if(g===i)i=void 0;continue}if(g==='"'||g==="'"||g==="`")i=g;else if(g==="{")r++;else if(g==="}")r--;if(r===0)break}if(s.push(y),r===0)break}if(r!==0)return null;let l=c;return{type:s.map((u,y)=>{let g=n+y,b=e[g].content.slice(0,u);if(e[g].content=e[g].content.slice(u).replace(Nr,""),g>0)e[g].continuesType=!0;return y===0?b:e[g].indent+b}).join(`
5
- `).slice(1,-1),endIndex:l}}function Gp(e){let t=e.content.match(Nr)?.[0]??"",n=e.content.slice(t.length),r=0,i=0;for(let d of n){if(r===0&&ks.test(d))break;if(d==="[")r++;if(d==="]")r--;i++}let o=r===0?n.slice(0,i):"";if(!o)return null;let s=o,c=!1,l;if(o.startsWith("[")&&o.endsWith("]")){c=!0;let u=o.slice(1,-1).split("=");if(s=u[0].trim(),u.length>1)l=u.slice(1).join("=").trim();if(!s)return null}if(s.length>1&&(s[0]==='"'||s[0]==="'")&&s[s.length-1]===s[0])s=s.slice(1,-1);return e.content=n.slice(i).replace(Nr,""),{name:s,optional:c,default:l}}function Wp(e){let t=e[0],n=t.content.match(Op),r=n?n[1]:"",i=n?t.content.slice(n[0].length):t.content,o=i.trimEnd(),s=e.slice(1).map((b)=>b.indent+b.content),c=(o?[o,...s]:s).join(`
6
- `);t.content=i,t.tag=r;let l=Up(e,0),d=l?.type??"",u=l?.endIndex??0;if(Bp.has(r))while(u<e.length-1&&e[u].content.trim()==="")u++;let y=Gp(e[u]),g=ws(e.slice(u));return{tag:r,name:y?.name??"",type:d,optional:y?.optional??!1,default:y?.default,description:g,text:c,lines:e}}function Kp(e,t,n){let r=jp(e);r.forEach((s,c)=>{s.number=c});let i=Hp(r),o=i.slice(1).map(Wp);return{description:ws(i[0]),tags:o,start:t,end:n,lines:r}}function Dr(e){return Vp(e).map(({start:t,end:n,lines:r})=>Kp(r,t,n))}var _r={"prop-unknown-type":"sveld/prop-unknown-type","context-any-type":"sveld/context-any-type","slot-missing-type":"sveld/slot-missing-type","event-no-source":"sveld/event-no-source","dispatch-escapes":"sveld/dispatch-escapes","example-compile-error":"sveld/example-compile-error","example-syntax-error":"sveld/example-syntax-error","syntax-skipped":"sveld/syntax-skipped","rest-props-unresolved":"sveld/rest-props-unresolved","context-duplicate-key":"sveld/context-duplicate-key","context-key-unresolved":"sveld/context-key-unresolved","context-value-unresolved":"sveld/context-value-unresolved","spread-unresolved":"sveld/spread-unresolved","export-unresolved":"sveld/export-unresolved","module-export-conflict":"sveld/module-export-conflict","extend-props-target-missing":"sveld/extend-props-target-missing","extend-props-duplicate":"sveld/extend-props-duplicate","extend-props-override":"sveld/extend-props-override","jsdoc-unknown-tag":"sveld/jsdoc-unknown-tag","typedef-duplicate":"sveld/typedef-duplicate","property-duplicate":"sveld/property-duplicate","generics-conflict":"sveld/generics-conflict","event-description-ambiguous":"sveld/event-description-ambiguous","jsdoc-tag-dropped":"sveld/jsdoc-tag-dropped","internal-typedef-referenced":"sveld/internal-typedef-referenced","types-inline-unresolved":"sveld/types-inline-unresolved","cross-file-unresolved":"sveld/cross-file-unresolved","export-ambiguous":"sveld/export-ambiguous"},zp={"prop-unknown-type":"warning","context-any-type":"warning","slot-missing-type":"warning","event-no-source":"warning","dispatch-escapes":"warning","example-compile-error":"error","example-syntax-error":"error","syntax-skipped":"error","rest-props-unresolved":"warning","context-duplicate-key":"warning","context-key-unresolved":"warning","context-value-unresolved":"warning","spread-unresolved":"warning","export-unresolved":"warning","module-export-conflict":"warning","extend-props-target-missing":"error","extend-props-duplicate":"warning","extend-props-override":"warning","jsdoc-unknown-tag":"warning","typedef-duplicate":"warning","property-duplicate":"warning","generics-conflict":"warning","event-description-ambiguous":"warning","jsdoc-tag-dropped":"warning","internal-typedef-referenced":"error","types-inline-unresolved":"warning","cross-file-unresolved":"warning","export-ambiguous":"warning"};function Vn(e){return{...e,code:_r[e.kind],severity:zp[e.kind]}}function pe(e,t,n,r,i){e.diagnosticRecords.push(Ir(e,t,n,r,i))}function Ir(e,t,n,r,i){return Vn({component:e.componentFilePath,kind:t,name:n,message:r,...i?{source:i}:{},...Lr(e,t,n)?{ignored:!0}:{}})}function Ns(e,t){return`${e}:${t}`}function dt(e,t,n,r){if(!r||r.length===0)return;let i=Ns(t,n),o=e.sveldIgnoreDirectives.get(i)??new Set;for(let s of r)o.add(s);e.sveldIgnoreDirectives.set(i,o)}function Lr(e,t,n){let r=e.sveldIgnoreDirectives.get(Ns(t,n));if(!r)return!1;return r.has("")||r.has(_r[t])}function Jp(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let o=e[i];if(o==="<"||o==="("||o==="["||o==="{")n++;else if(o===">"||o===")"||o==="]"||o==="}")n=Math.max(n-1,0);else if(n===0&&(o===";"||o===","))t.push(e.slice(r,i)),r=i+1}return t.push(e.slice(r)),t}function Xp(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];if(r==="<"||r==="("||r==="["||r==="{")t++;else if(r===">"||r===")"||r==="]"||r==="}")t=Math.max(t-1,0);else if(t===0&&r===":")return n}return-1}var Yp=/^\{([\s\S]*)\}$/,Qp=/^[A-Za-z_$][\w$]*$/;function pn(e){let t=e.trim(),n=Yp.exec(t);if(!n)return null;let r=n[1].trim();if(r==="")return[];let i=[];for(let o of Jp(r)){let s=o.trim();if(!s)continue;let c=Xp(s);if(c===-1)return null;let l=s.slice(0,c).trim(),d=s.slice(c+1).trim();if(!d)return null;let u=!1;if(l.endsWith("?"))u=!0,l=l.slice(0,-1).trim();if(!Qp.test(l))return null;i.push({name:l,type:d,optional:u})}return i}var jn=/[\r\n]+/g;function Zp(e){if(e.sourceLineStartOffsetsCache)return e.sourceLineStartOffsetsCache;let t=[0];if(e.source){let n=e.source.indexOf(`
1
+ var Xc=Object.defineProperty;var Yc=(e)=>e;function Qc(e,t){this[e]=Yc.bind(null,t)}var Zc=(e,t)=>{for(var n in t)Xc(e,n,{get:t[n],enumerable:!0,configurable:!0,set:Qc.bind(t,n)})};function el(e){return e}var $e=Symbol("sveld.parsedComponentTypeScriptMetadata");function Ts(e){return e[$e]}function be(e){return typeof e==="object"&&e!==null}function vs(e){return be(e)&&e.type==="VariableDeclaration"&&Array.isArray(e.declarations)}function pt(e){return be(e)&&e.type==="Literal"}function Y(e){return be(e)&&e.type==="Identifier"&&typeof e.name==="string"}function bt(e){return be(e)&&e.type==="MemberExpression"}function Te(e){return be(e)&&e.type==="ObjectExpression"&&Array.isArray(e.properties)}function tl(e){return be(e)&&e.type==="CallExpression"}function Me(e,t){if(!tl(e))return!1;return!!e.callee&&be(e.callee)&&e.callee.type==="Identifier"&&e.callee.name===t}function Xe(e){if(be(e)&&(e.type==="TSAsExpression"||e.type==="TSSatisfiesExpression")&&"expression"in e)return Xe(e.expression);return e}function Ss(e){if(be(e)&&(e.type==="TSAsExpression"||e.type==="TSSatisfiesExpression")&&"typeAnnotation"in e)return e.typeAnnotation;return}function nl(e){return be(e)&&e.type==="NewExpression"}function yr(e,t){if(!nl(e))return!1;return!!e.callee&&be(e.callee)&&e.callee.type==="Identifier"&&e.callee.name===t}function Es(e){if(!be(e)||typeof e.type!=="string")return null;if(e.type==="Literal"){let t=e.value;if(typeof t==="string")return t;return t==null?null:String(t)}if(e.type==="TemplateLiteral"){let t=e.quasis;if(t?.length===1){let n=t[0]?.value?.cooked;return n==null?null:n}}return null}function ie(e){if(!e||typeof e!=="object"||!("type"in e))return;if(Y(e))return e.name;if(pt(e))return e.value==null?void 0:String(e.value);return}function Tt(e,t,n=0,r=e.length,i=0){let a=i;for(let s=n;s<r;s++){let p=e.charCodeAt(s);if(p===34||p===39||p===96){s=rl(e,s,r);continue}if(p===123||p===40||p===91||p===60)a++;else if(p===125||p===41||p===93||p===62&&e.charCodeAt(s-1)!==61){if(a>0)a--}if(t?.(s,a)===!0)break}return a}function rl(e,t,n){let r=e.charCodeAt(t);for(let i=t+1;i<n;i++){let a=e.charCodeAt(i);if(a===92)i++;else if(a===r)return i}return n-1}function se(e,t){let n=[],r=0;return Tt(e,(i,a)=>{if(a===0&&t.includes(e[i]))n.push(e.slice(r,i)),r=i+1;return!1}),n.push(e.slice(r)),n}function dn(e,t){let n=-1;return Tt(e,(r,i)=>{if(i===0&&t.includes(e[r]))n=r;return n!==-1}),n}function il(e){let t=-1;return Tt(e,(n,r)=>{if(r===0&&e[n]==="="&&e[n+1]===">")t=n;return t!==-1}),t}function vt(e,t){let n=-1;return Tt(e,(r,i)=>{if(i===0)n=r;return n!==-1},t),n}function Cs(e){if(!e)return;let t=il(e);if(t===-1)return;return e.slice(t+2).trim()||void 0}function gr(){return{syntaxMode:"legacy",scriptLanguage:void 0,source:void 0,parsed:void 0,runesOptionOverride:void 0,sourceLineStartOffsetsCache:void 0,sourceLineHint:void 0,parsedJsDocByText:new Map,jsDocBlocksByStart:new Map,functionDocCommentStarts:new Set,rest_props:void 0,extends:void 0,customElementTag:void 0,customElement:void 0,componentComment:void 0,componentCommentSource:void 0,generics:null,scriptGenericsAttribute:void 0,diagnosticRecords:[],componentFilePath:"",props:new Map,moduleExports:new Map,propLocalToPublicName:new Map,reactive_vars:new Set,funcDecls:new Map,vars:new Set,valueImportBindingsByLocalName:new Map,pendingCallDefaultCandidates:[],pendingConstDefaultCandidates:[],pendingContextKeyCandidates:[],pendingDispatchEscapeCandidates:[],deferredEventNoSourceDiagnostics:[],runesPropsDeclarationMetadataByDeclaratorStart:new Map,typedRunesPropsDeclarations:[],explicitPropTypesByName:new Map,explicitVariableTypesByName:new Map,explicitVariableTypeNodesByName:new Map,typeImportBindingsByLocalName:new Map,localTypeDeclarationsByName:new Map,additionalTypeDependencyNodes:[],wholePropsLocals:new Set,restPropLocals:new Set,componentScope:new Map,scopeDeclarations:new Map,activeScopes:[],slots:new Map,snippetPropLocals:new Set,cssParts:[],cssProperties:[],deferredSlotBlockGenerics:[],events:new Map,eventDescriptions:new Map,forwardedEvents:new Map,jsDocEventNames:new Set,untypedJsDocEventNames:new Set,jsDocEventSources:new Map,bindings:new Map,contexts:new Map,typedefs:new Map,typedefMembersByName:new Map,variableInfoCache:new Map,variableInfoCacheBuilt:!1,sveldIgnoreDirectives:new Map}}function xr(e,t){return e.propLocalToPublicName.get(t)??t}function fn(e,t,n=t){e.propLocalToPublicName.set(n,t)}function br(e,t){return e.props.get(xr(e,t))}function Ot(e,t){return br(e,t)?.type}var Tr={"prop-unknown-type":"sveld/prop-unknown-type","context-any-type":"sveld/context-any-type","slot-missing-type":"sveld/slot-missing-type","event-no-source":"sveld/event-no-source","dispatch-escapes":"sveld/dispatch-escapes","example-compile-error":"sveld/example-compile-error","example-syntax-error":"sveld/example-syntax-error","syntax-skipped":"sveld/syntax-skipped","type-syntax-error":"sveld/type-syntax-error","rest-props-unresolved":"sveld/rest-props-unresolved","context-duplicate-key":"sveld/context-duplicate-key","context-key-unresolved":"sveld/context-key-unresolved","context-value-unresolved":"sveld/context-value-unresolved","spread-unresolved":"sveld/spread-unresolved","export-unresolved":"sveld/export-unresolved","module-export-conflict":"sveld/module-export-conflict","extend-props-target-missing":"sveld/extend-props-target-missing","extend-props-duplicate":"sveld/extend-props-duplicate","extend-props-override":"sveld/extend-props-override","jsdoc-unknown-tag":"sveld/jsdoc-unknown-tag","typedef-duplicate":"sveld/typedef-duplicate","property-duplicate":"sveld/property-duplicate","generics-conflict":"sveld/generics-conflict","event-description-ambiguous":"sveld/event-description-ambiguous","jsdoc-tag-dropped":"sveld/jsdoc-tag-dropped","internal-typedef-referenced":"sveld/internal-typedef-referenced","cross-file-unresolved":"sveld/cross-file-unresolved","export-ambiguous":"sveld/export-ambiguous"},sl={"prop-unknown-type":"warning","context-any-type":"warning","slot-missing-type":"warning","event-no-source":"warning","dispatch-escapes":"warning","example-compile-error":"error","example-syntax-error":"error","syntax-skipped":"error","type-syntax-error":"error","rest-props-unresolved":"warning","context-duplicate-key":"warning","context-key-unresolved":"warning","context-value-unresolved":"warning","spread-unresolved":"warning","export-unresolved":"warning","module-export-conflict":"warning","extend-props-target-missing":"error","extend-props-duplicate":"warning","extend-props-override":"warning","jsdoc-unknown-tag":"warning","typedef-duplicate":"warning","property-duplicate":"warning","generics-conflict":"warning","event-description-ambiguous":"warning","jsdoc-tag-dropped":"warning","internal-typedef-referenced":"error","cross-file-unresolved":"warning","export-ambiguous":"warning"};function hn(e){return{...e,code:Tr[e.kind],severity:sl[e.kind]}}function G(e,t,n,r,i){e.diagnosticRecords.push(vr(e,t,n,r,i))}function vr(e,t,n,r,i){return hn({component:e.componentFilePath,kind:t,name:n,message:r,...i?{source:i}:{},...Sr(e,t,n)?{ignored:!0}:{}})}function Ps(e,t){return`${e}:${t}`}function Oe(e,t,n,r){if(!r||r.length===0)return;let i=Ps(t,n),a=e.sveldIgnoreDirectives.get(i)??new Set;for(let s of r)a.add(s);e.sveldIgnoreDirectives.set(i,a)}function Sr(e,t,n){let r=e.sveldIgnoreDirectives.get(Ps(t,n));if(!r)return!1;return r.has("")||r.has(Tr[t])}var Er="/**",As="*",mn="*/",al="```",Cr=/^\s+/,ks=/\s/,ol=/^@[^\s/]+(?=\s|$)/,pl=/^@(\S+)\s*/,cl=new Set(["extends","extendProps","generics","template","typedef"]);function Bt(e){let t=0;while(t<e.length){let n=e.charCodeAt(t);if(n!==32&&n!==9&&n!==13&&n!==10&&!ks.test(e[t]))break;t++}return t}function ll(e,t){let n=e.slice(Bt(e)),r=!1;if(t)n=n.slice(Er.length),r=!0;else if(n.startsWith(As)&&!n.startsWith(mn))n=n.slice(As.length),r=!0;let i=n.slice(0,Bt(n));n=n.slice(i.length);let a=n.trimEnd(),s=a.endsWith(mn)?a.slice(0,-mn.length).trimEnd():n;return{indent:r?i.slice(1):i,content:s}}function ul(e,t,n){let r=n>t&&e.charCodeAt(n-1)===13?n-1:n;return e.slice(t,r)}function dl(e){let t=[],n=0;while(!0){let r=e.indexOf(Er,n);if(r===-1)break;let i=e.lastIndexOf(`
2
+ `,r-1)+1;if(e.charCodeAt(r+Er.length)===42||e.slice(i,r).trim()!==""){n=r+1;continue}let a=[],s=i,p=!1,c=0;while(s<=e.length){let d=e.indexOf(`
3
+ `,s),u=d===-1?e.length:d,y=ul(e,s,u),{indent:x,content:g}=ll(y,a.length===0);a.push({raw:y,start:s,number:a.length,indent:x,content:g});let C=y.trimEnd();if(C.endsWith(mn)){p=!0,c=s+C.length,n=u;break}if(d===-1)break;s=d+1}if(!p)break;t.push({start:r,end:c,lines:a})}return t}function fl(e){let t=e;if(t.length>0&&t[0].content==="")t=t.slice(1);if(t.length>0&&t[t.length-1].content==="")t=t.slice(0,-1);return t}function hl(e){let t=[[]],n=!1;for(let r of e){if(ol.test(r.content)&&!n)t.push([r]);else t[t.length-1].push(r);if(Ft(r.content))n=!n}return t}function Ft(e){return ml(e,al)%2===1}function ml(e,t){let n=0,r=e.indexOf(t);while(r!==-1)n++,r=e.indexOf(t,r+t.length);return n}function ws(e){return e.map((t)=>t.indent+t.content).join(`
4
+ `)}function yl(e,t){let n=t;while(n<e.length-1&&e[n].content.trim()==="")n++;if(e[n].content[0]!=="{")return null;let r=e.slice(n).map((d)=>d.content).join(`
5
+ `),i=vt(r,0);if(i===-1)return null;let a=[],s=i+1;for(let d=n;s>0;d++){let u=e[d].content.length;a.push(Math.min(s,u)),s-=u+1}let p=n+a.length-1;return{type:a.map((d,u)=>{let y=n+u,x=e[y].content.slice(0,d);if(e[y].content=e[y].content.slice(d).replace(Cr,""),y>0)e[y].continuesType=!0;return u===0?x:e[y].indent+x}).join(`
6
+ `).slice(1,-1),endIndex:p}}function gl(e){let t=e.content.match(Cr)?.[0]??"",n=e.content.slice(t.length),r=0,i=0;for(let d of n){if(r===0&&ks.test(d))break;if(d==="[")r++;if(d==="]")r--;i++}let a=r===0?n.slice(0,i):"";if(!a)return null;let s=a,p=!1,c;if(a.startsWith("[")&&a.endsWith("]")){p=!0;let u=a.slice(1,-1).split("=");if(s=u[0].trim(),u.length>1)c=u.slice(1).join("=").trim();if(!s)return null}if(s.length>1&&(s[0]==='"'||s[0]==="'")&&s[s.length-1]===s[0])s=s.slice(1,-1);return e.content=n.slice(i).replace(Cr,""),{name:s,optional:p,default:c}}function xl(e){let t=e[0],n=t.content.match(pl),r=n?n[1]:"",i=n?t.content.slice(n[0].length):t.content,a=i.trimEnd(),s=e.slice(1).map((g)=>g.indent+g.content),p=(a?[a,...s]:s).join(`
7
+ `);t.content=i,t.tag=r;let c=yl(e,0),d=c?.type??"",u=c?.endIndex??0;if(cl.has(r))while(u<e.length-1&&e[u].content.trim()==="")u++;let y=gl(e[u]),x=ws(e.slice(u));return{tag:r,name:y?.name??"",type:d,optional:y?.optional??!1,default:y?.default,description:x,text:p,lines:e}}function bl(e,t,n){let r=fl(e);r.forEach((s,p)=>{s.number=p});let i=hl(r),a=i.slice(1).map(xl);return{description:ws(i[0]),tags:a,start:t,end:n,lines:r}}function yn(e){return dl(e).map(({start:t,end:n,lines:r})=>bl(r,t,n))}var Tl=/\*\//g;function Ve(e){return e.replace(Tl,"*\\/")}function Ye(e){return e.map((t)=>`${t.name}${t.optional?"?":""}: ${t.type}`).join(", ")}function he(e){return e===void 0||e===""?void 0:e}var vl=new Intl.Collator("en");function je(e,t){return vl.compare(e,t)}var Sl=/\s/;function Pr(e,t,n){let r=t;while(r<n){let i=e[r];if(i==="/"&&e[r+1]==="/"){let a=e.indexOf(`
8
+ `,r+2);if(a===-1||a>=n)return!0;r=a+1}else if(i==="/"&&e[r+1]==="*"&&e[r+2]!=="*"){let a=e.indexOf("*/",r+2);if(a===-1||a+2>n)return!1;r=a+2}else if(i===" "||i===`
9
+ `||i==="\t"||i==="\r"||Sl.test(i))r++;else return!1}return!0}var El=/^-\s*/;function gn(e){let t=[],n,r=!1;for(let i of e){let a=Ft(i);if(n!==void 0){if(a)t.push(i.trim()),n=void 0;else t.push(i.slice(Math.min(n,Bt(i))).trimEnd());continue}let s=i.trim();if(s===""){r=t.length>0;continue}if(r)t.push("");if(r=!1,t.push(s),a)n=Bt(i)}return t.join(`
10
+ `).trimEnd()}function He(e){if(e===void 0)return;let t=e.replace(El,"").trim();return t===""?"":t}function Ds(e){let t=e.name?`${e.name} ${e.description}`:e.description;return He(gn(t.split(`
11
+ `)))}function Ar(e){let t=0;while(e[t+1]?.continuesType)t++;return t}var xn=new Set(["since","example","see"]),kr=new Set(["bindable","default","required"]);function Cl(e){return e.length>0?e.map((t)=>({name:t.tag,body:t.text})):void 0}function bn(e){let t=e.trim();return t===""?!0:t}function Pl(e){let t=e;if(!t.startsWith("/*"))t=`/*${t}`;if(!t.endsWith("*/"))t+="*/";return t}function Qe(e){if(e==="*")return"any";return e.trim()}var Al=new Set(["type","param","returns","return","extends","extendProps","restProps","slot","snippet","event","typedef","callback","bindable","deprecated","ignore","internal","csspart","cssprop","cssproperty"]);function wr(e,t){let n=e.parsedJsDocByText.get(t);if(n===void 0)n=yn(t),e.parsedJsDocByText.set(t,n);return n}function Nr(e){let t=e[0]?.tags??[],n,r=[],i,a,s,p=!1,c=[],d=[],u=[];for(let y of t)if(y.tag==="type")n=y;else if(y.tag==="param")r.push(y);else if(y.tag==="returns"||y.tag==="return")i=y;else if(y.tag==="deprecated")s??=bn(y.text);else if(y.tag==="ignore"||y.tag==="internal")p=!0;else if(y.tag==="sveld-ignore")u.push(y.name);else if(xn.has(y.tag))d.push(y);else if(y.tag==="bindable"){if(y.type)continue;let x=`${y.name}${y.description?` ${y.description}`:""}`.trim();if(x==="readonly"||x==="writable")a??=x}else if(!Al.has(y.tag))c.push(y);return{type:n,param:r,returns:i,binding:a,deprecated:s,internal:p,additional:c,passthrough:d,ignore:u,description:e[0]?.description}}function kl(e,t){if(typeof t.start!=="number"||typeof t.end!=="number")return;let n=e.jsDocBlocksByStart.get(t.start);if(n===void 0||n.end!==t.end)return;return[n]}function wl(e){if(!e||e.length===0)return;let t=e[e.length-1];return t&&typeof t==="object"&&"value"in t?t:void 0}function Is(e,t,n){if(!t||t.length===0||n===void 0||!e.source)return;for(let r=t.length-1;r>=0;r--){let i=t[r];if(!i||typeof i!=="object"||!("value"in i)||!("end"in i))continue;if(typeof i.end!=="number"||!("start"in i)||typeof i.start!=="number")continue;if("type"in i&&i.type==="Line"||!String(i.value).startsWith("*"))continue;if(Pr(e.source,i.end,n))return i}return}function _s(e){let t=new Set,n=(i)=>{let{leadingComments:a,start:s}=i,p=Is(e,a,s);if(p)t.add(p.start)};for(let i of e.funcDecls.values())n(i);let r=[{root:e.parsed?.module,isModule:!0},{root:e.parsed?.instance,isModule:!1}];for(let{root:i,isModule:a}of r)for(let s of i?.content.body??[]){let p=s.type==="ExportNamedDeclaration",c=s.type==="ExportNamedDeclaration"?s.declaration:s;if(c?.type==="FunctionDeclaration"){if(p)n(s)}else if(c?.type==="ClassDeclaration"&&a){n(p?s:c);for(let d of c.body.body)if(d.type==="MethodDefinition")n(d)}else if(c?.type==="VariableDeclaration"&&(a||!p||c.kind==="const")&&c.declarations.length===1&&Nl.has(c.declarations[0].init?.type??""))n(s)}return t}var Nl=new Set(["ArrowFunctionExpression","FunctionExpression"]);function ne(e,t){if(!t?.leadingComments)return;let n=Is(e,t.leadingComments,t.start);if(!n)return;return _l(e,[n])}function Dr(e,t){if(!t?.leadingComments)return;return ne(e,t)}function Dl(e,t,n){let r=e;if(t)r=`${e} extends ${t}`;if(n)r+=` = ${n}`;return r}var Il=/^[^\s,]+/,Ns=/^\s*,\s*([^\s,]+)/;function Ir(e,t){let n=e.optional?e.name:Il.exec(e.name)?.[0];if(!n)return[];let r=[{name:n,constraint:Dl(n,t,e.default)}],i=`${e.optional?"":e.name.slice(n.length)} ${e.description}`;for(let a=Ns.exec(i);a;a=Ns.exec(i))r.push({name:a[1],constraint:a[1]}),i=i.slice(a[0].length);return r}function _l(e,t){if(!t)return;let n=wl(t);if(!n)return;let r=kl(e,n)??wr(e,Pl(n.value)),{type:i,param:a,returns:s,binding:p,deprecated:c,internal:d,additional:u,passthrough:y,ignore:x,description:g}=Nr(r),C,v,w,R;if(i)C=Qe(i.type);if(a.length>0)v=a.filter((_)=>!_.name.includes(".")).map((_)=>({name:_.name,type:Qe(_.type),description:He(gn(_.description.split(`
12
+ `))),optional:_.optional||!1}));if(s)w=Qe(s.type);let B,L=u;if(typeof n.start==="number"&&e.functionDocCommentStarts.has(n.start)){let _=u.filter((j)=>j.tag==="template"&&j.name);if(_.length>0)B=_.flatMap((j)=>Ir(j,Qe(j.type))).map(({constraint:j})=>j).join(", "),L=u.filter((j)=>j.tag!=="template")}let k=he(g?.trim());if(k||L.length>0){let _=[];if(k)_.push(k);for(let j of L)_.push(`@${j.tag}${j.text?` ${j.text}`:""}`);R=_.join(`
13
+ `)}return{type:C,params:v,returnType:w,description:R,binding:p,deprecated:c,tags:Cl(y),sveldIgnore:x.length>0?x:void 0,internal:d,typeParameters:B}}function Ll(e,t,n,r,i){for(let a of e){if(a.type!=="Block"||a.start<n||a.end>r)continue;i.push({start:a.start,end:a.end,isJsDoc:a.end-a.start>4&&t.startsWith("/**",a.start)})}}function Ls(e,t,n){if(!e||typeof e!=="object"||!("type"in e))return;let r=e;if(r.type==="FunctionDeclaration"){if(r.id?.type==="Identifier"&&r.id.name)n.push({name:r.id.name,start:t});return}if(r.type==="VariableDeclaration"){for(let i of r.declarations??[])if(i?.id?.type==="Identifier"&&i.id.name)n.push({name:i.id.name,start:t})}}function Rl(e){let t=[];for(let n of e){if(!n||typeof n!=="object"||!("type"in n))continue;let r=n;if(r.start===void 0)continue;if(r.type==="ExportNamedDeclaration"&&r.declaration)Ls(r.declaration,r.start,t);else Ls(r,r.start,t)}return t}function Ml(e,t,n){let r=0,i=e.length;while(r<i){let a=r+i>>>1;if(e[a].end<=t)r=a+1;else i=a}for(let a=r-1;a>=0;a--){let s=e[a];if(!s.isJsDoc)continue;return Pr(n,s.end,t)?s:void 0}return}function Ol(e){let t=new Map;if(!e.source)return t;let n=[e.parsed?.module,e.parsed?.instance],r=[],i=[],a=e.parsed?.comments??[];for(let s of n){let p=s?.content;if(!p)continue;Ll(a,e.source,p.start,p.end,r),i.push(...Rl(p.body))}r.sort((s,p)=>s.end-p.end);for(let s of i){let p=Ml(r,s.start,e.source);if(!p)continue;let c=wr(e,e.source.slice(p.start,p.end)),{type:d,description:u,ignore:y,internal:x}=Nr(c);if(y.length>0)Oe(e,"context-any-type",s.name,y);if(!d&&!u&&!x)continue;t.set(s.name,{type:d?Qe(d.type):void 0,description:u||d&&Ds(d),internal:x||void 0})}return t}function Rs(e,t){if(!e.variableInfoCacheBuilt)e.variableInfoCache=Ol(e),e.variableInfoCacheBuilt=!0;return e.variableInfoCache.get(t)}function Ze(e,t){let n=br(e,t);if(n?.type)return{type:n.type,description:n.description,internal:n.internal};let r=Rs(e,t),i=e.explicitVariableTypesByName.get(t);if(i)return{type:i,description:r?.description,internal:r?.internal};if(!r?.type)return null;return{type:r.type,description:r.description,internal:r.internal}}function Ms(e,t){let n=Rs(e,t);return{...n?.description?{description:n.description}:{},...n?.internal?{internal:!0}:{}}}function et(e,t){for(let r of e.vars)if(r.declarations.some((a)=>a.id&&typeof a.id==="object"&&("type"in a.id)&&a.id.type==="Identifier"&&("name"in a.id)&&a.id.name===t))return ne(e,r);let n=e.funcDecls.get(t);if(n)return ne(e,n);return}var Bl=/\w/;function Fl(e,t){let n=e.trim();if(!n.startsWith("{")||!n.endsWith("}"))return;let r=se(n.slice(1,-1),";,").map((i)=>i.trim());for(let i of r){if(!i.startsWith(t))continue;let a=i.slice(t.length);if(a.length>0&&Bl.test(a[0]))continue;let s=a.trimStart();if(s.startsWith("?"))s=s.slice(1).trimStart();if(s.startsWith(":"))return s.slice(1).trim()}return}function Tn(e,t){let n=t;if(n.computed||n.object?.type!=="Identifier"||n.property?.type!=="Identifier")return;let r=n.object.name,i=n.property.name;if(!r||!i)return;if(e.wholePropsLocals.has(r))return Ot(e,i);let a=Ot(e,r)??Ze(e,r)?.type;if(!a)return;return Fl(a,i)}var $l=/(?:_|[^\p{ID_Continue}$])+/u,Vl=/^[\p{ID_Start}$]/u;function vn(e){let r=`${e.split($l).map((i)=>i.charAt(0).toUpperCase()+i.slice(1)).join("")}Context`;return Vl.test(r)?r:`_${r}`}var jl=/^\{([\s\S]*)\}$/,Hl=/^[A-Za-z_$][\w$]*$/;function qe(e){let t=e.trim(),n=jl.exec(t);if(!n)return null;let r=n[1].trim();if(r==="")return[];let i=[];for(let a of se(r,";,")){let s=a.trim();if(!s)continue;let p=dn(s,":");if(p===-1)return null;let c=s.slice(0,p).trim(),d=s.slice(p+1).trim();if(!d)return null;let u=!1;if(c.endsWith("?"))u=!0,c=c.slice(0,-1).trim();if(!Hl.test(c))return null;i.push({name:c,type:d,optional:u})}return i}var Sn=/[\r\n]+/g;function ql(e){if(e.sourceLineStartOffsetsCache)return e.sourceLineStartOffsetsCache;let t=[0];if(e.source){let n=e.source.indexOf(`
7
14
  `);while(n!==-1)t.push(n+1),n=e.source.indexOf(`
8
- `,n+1)}return e.sourceLineStartOffsetsCache=t,t}function Ds(e,t){if(!e.source||t<0||t>e.source.length)return;let n=Zp(e),r=e.sourceLineHint;if(r!==void 0)for(let s=r;s<=r+1&&s<n.length;s++){let c=n[s],l=n[s+1]??Number.POSITIVE_INFINITY;if(t>=c&&t<l)return e.sourceLineHint=s,{line:s+1,column:t-c}}let i=0,o=n.length-1;while(i<=o){let s=i+o>>>1,c=n[s],l=n[s+1]??Number.POSITIVE_INFINITY;if(t<c)o=s-1;else if(t>=l)i=s+1;else return e.sourceLineHint=s,{line:s+1,column:t-c}}return}function Hn(e,t,n){if(t===void 0||n===void 0||n<t)return;let r=Ds(e,t),i=Ds(e,n);if(!r||!i)return;return{start:r,end:i}}function oe(e,t){if(!t||typeof t!=="object")return;let n="start"in t&&typeof t.start==="number"?t.start:void 0,r="end"in t&&typeof t.end==="number"?t.end:void 0;return Hn(e,n,r)}function He(e,t){if(!t||t.length===0)return;let n=[...t];while(n.length>1){let l=n[n.length-1];if(l.tag!==void 0||!l.raw.trim().endsWith("*/"))break;n.pop()}let r=n[0],i=r.raw.indexOf(`@${r.tag??""}`),o=r.start+Math.max(i,0),s=n[n.length-1],c=s.start+s.raw.length;return Hn(e,o,c)}function le(e,t,n){return e.source?.slice(t,n)}function qe(e,t){if(!t||typeof t!=="object")return;let n="start"in t&&typeof t.start==="number"?t.start:void 0,r="end"in t&&typeof t.end==="number"?t.end:void 0;if(n===void 0||r===void 0)return;return le(e,n,r)?.replace(jn," ")}var el=/\*\//g;function ft(e){return e.replace(el,"*\\/")}function Ct(e){return e.map((t)=>`${t.name}${t.optional?"?":""}: ${t.type}`).join(", ")}function ze(e){return e===void 0||e===""?void 0:e}var tl=new Intl.Collator("en");function ht(e,t){return tl.compare(e,t)}var nl=/[A-Za-z_$][\w$]*/g;function rl(e,t){if(!t)return!1;let n=new Set(t[0].split(",").map((r)=>r.trim()));for(let[r]of e.matchAll(nl))if(n.has(r))return!0;return!1}function Rr(e,t){if(t===void 0)return;return e.runesPropsDeclarationMetadataByDeclaratorStart.get(t)}function _s(e,t,n){return Rr(e,t)?.props.get(n)}function Is(e){if(!e||typeof e!=="object"||!("type"in e))return;if(e.type==="Identifier"&&"name"in e&&typeof e.name==="string")return e.name;if(e.type==="TSQualifiedName"&&"right"in e&&e.right&&typeof e.right==="object"&&"name"in e.right&&typeof e.right.name==="string")return e.right.name;return}function Ls(e){if(!e||typeof e!=="object"||!("type"in e))return;if(e.type==="Identifier"&&"name"in e&&typeof e.name==="string")return e.name;if(e.type==="TSQualifiedName"&&"left"in e&&e.left&&typeof e.left==="object")return Ls(e.left);return}function mt(e,t){let n=t?.start,r=t?.end;if(n===void 0||r===void 0)return;return le(e,n+1,r)?.trim()}function Lt(e,t){let n=t?.start,r=t?.end;if(n===void 0||r===void 0)return;return le(e,n,r)?.trim()}function Ie(e,t,n,r,i=new Set){if(!t?.type)return;switch(t.type){case"TSInterfaceDeclaration":for(let o of t.extends??[])Ie(e,{type:"TSTypeReference",typeName:o.expression,typeParameters:o.typeParameters},n,r,i);Ie(e,{type:"TSTypeLiteral",members:t.body?.body},n,r,i);return;case"TSTypeAliasDeclaration":case"TSParenthesizedType":case"TSTypeAnnotation":Ie(e,t.typeAnnotation,n,r,i);return;case"TSIntersectionType":case"TSUnionType":for(let o of t.types??[])Ie(e,o,n,r,i);return;case"TSTypeLiteral":for(let o of t.members??[]){if(o?.type!=="TSPropertySignature")continue;Ie(e,o.typeAnnotation?.typeAnnotation,n,r,i)}return;case"TSTypeReference":{let o=Ls(t.typeName);if(o){if(e.typeImportBindingsByLocalName.has(o)||e.valueImportBindingsByLocalName.has(o))n.add(o);let c=e.localTypeDeclarationsByName.get(o);if(c&&!i.has(o))r.add(o),i.add(o),Ie(e,c.node,n,r,i),i.delete(o)}let s=t.typeArguments??t.typeParameters;if(s&&typeof s==="object"){let c=s;for(let l of c.params??[])Ie(e,l,n,r,i)}return}case"TSArrayType":case"TSRestType":case"TSOptionalType":case"TSIndexedAccessType":case"TSTypeOperator":case"TSExpressionWithTypeArguments":case"TSTupleType":case"TSConditionalType":case"TSInferType":case"TSMappedType":case"TSFunctionType":case"TSConstructorType":case"TSTypeQuery":case"TSImportType":case"TSLiteralType":case"TSTypePredicate":case"TSNamedTupleMember":break;default:break}for(let o in t){let s=t[o];if(!s||typeof s!=="object")continue;if(Array.isArray(s)){for(let c of s){if(!c||typeof c!=="object"||!("type"in c))continue;Ie(e,c,n,r,i)}continue}if("type"in s)Ie(e,s,n,r,i)}}function il(e,t){let n=new Map;for(let r of Array.from(t).sort()){let i=e.typeImportBindingsByLocalName.get(r),o=i?void 0:e.valueImportBindingsByLocalName.get(r),s=i??(o?{importedName:o.importedName,localName:o.localName,source:o.source,specifierType:"named"}:void 0);if(!s)continue;let c=n.get(s.source)??{default:[],named:[],namespace:[]};if(s.specifierType==="default")c.default.push(s.localName);else if(s.specifierType==="namespace")c.namespace.push(s.localName);else c.named.push({imported:s.importedName,local:s.localName});n.set(s.source,c)}return Array.from(n.entries()).sort(([r],[i])=>ht(r,i)).map(([r,i])=>{if(i.namespace.length>0)return i.namespace.map((l)=>`import type * as ${l} from "${r}";`).join(`
9
- `);let o=i.named.map(({imported:l,local:d})=>{if(!l||l===d)return d;return`${l} as ${d}`}),s=i.default[0],c=o.length>0?`{ ${o.join(", ")} }`:"";if(s&&c)return`import type ${s}, ${c} from "${r}";`;if(s)return`import type ${s} from "${r}";`;return`import type ${c} from "${r}";`})}function Ae(e,t){if(t)e.additionalTypeDependencyNodes.push(t)}function sl(e){if(!e.const)return;let t=e.id?.name;if(!t)return;let n=[];for(let r of e.members??[]){let i=r.initializer;if(i?.type!=="Literal")return;let o=i.value;if(typeof o==="string")n.push(JSON.stringify(o));else if(typeof o==="number")n.push(String(o));else return}if(n.length===0)return;return`type ${t} = ${n.join(" | ")};`}function Rs(e,t){let n=sl(t);if(n)return n;if(t.start===void 0||t.end===void 0)return;let r=le(e,t.start,t.end)?.trim();return r?`declare ${r}`:void 0}function Mr(e,t){let n=[];for(let r of t.params??[]){let i=r.type==="TSParameterProperty"&&r.parameter?r.parameter:r;if(i.type==="RestElement"){Ae(e,i.typeAnnotation?.typeAnnotation),n.push({name:i.argument?.name??"rest",type:mt(e,i.typeAnnotation),optional:!1,rest:!0});continue}let o=i.type==="AssignmentPattern",s=o?i.left:i;Ae(e,s?.typeAnnotation?.typeAnnotation),n.push({name:s?.name??"arg",type:mt(e,s?.typeAnnotation),optional:o||i.optional===!0,rest:!1})}Ae(e,t.returnType?.typeAnnotation);for(let r of t.typeParameters?.params??[])Ae(e,r.constraint),Ae(e,r.default);return{params:n,returnType:mt(e,t.returnType),typeParameters:Lt(e,t.typeParameters)||void 0}}function Or(e,t){let{params:n,returnType:r,typeParameters:i}=Mr(e,t),o=n.map(({name:c,type:l,optional:d,rest:u})=>u?`...${c}: ${l??"any[]"}`:`${c}${d?"?":""}: ${l??"any"}`),s=r!==void 0||i!==void 0||n.some((c)=>c.type!==void 0);return{signature:`${i??""}(${o.join(", ")}) => ${r??"any"}`,hasAnnotations:s}}function Ms(e){let t=e.pendingCallDefaultCandidates.length>0?e.pendingCallDefaultCandidates.slice():void 0,n=e.pendingConstDefaultCandidates.length>0?e.pendingConstDefaultCandidates.slice():void 0,r=e.pendingContextKeyCandidates.length>0?e.pendingContextKeyCandidates.slice():void 0,i=e.pendingDispatchEscapeCandidates.length>0?e.pendingDispatchEscapeCandidates.slice():void 0,o=e.deferredEventNoSourceDiagnostics.length>0?e.deferredEventNoSourceDiagnostics.slice():void 0,s=i&&e.untypedJsDocEventNames.size>0?Array.from(e.untypedJsDocEventNames):void 0,c={...t?{pendingCallDefaultCandidates:t}:{},...n?{pendingConstDefaultCandidates:n}:{},...r?{pendingContextKeyCandidates:r}:{},...i?{pendingDispatchEscapeCandidates:i}:{},...o?{deferredEventNoSourceDiagnostics:o}:{},...s?{untypedJsDocEventNames:s}:{}},l=t!==void 0||n!==void 0||r!==void 0||i!==void 0,d=new Set,u=new Set;for(let D of e.additionalTypeDependencyNodes)Ie(e,D,d,u);let y=Array.from(e.localTypeDeclarationsByName.values()).filter((D)=>D.exported).sort((D,j)=>D.start-j.start);for(let D of y)Ie(e,D.node,d,u);let g=y.map((D)=>`export ${D.code}`),b=e.typedRunesPropsDeclarations.length===1?e.typedRunesPropsDeclarations[0]:void 0,P=b?.canonicalType;if(b&&P){for(let D of b.referencedImportedTypes)d.add(D);for(let D of b.referencedLocalTypes)u.add(D)}if(!P&&d.size===0&&u.size===0&&g.length===0)return l?{canonicalPropNames:[],localTypeDeclarations:[],typeImportStatements:[],...c}:void 0;let N=Array.from(u).map((D)=>e.localTypeDeclarationsByName.get(D)).filter((D)=>D!==void 0&&!D.exported).sort((D,j)=>D.start-j.start).map((D)=>D.code);return{...P?{canonicalPropsType:P}:{},canonicalPropNames:b&&P?Array.from(b.props.keys()).sort():[],localTypeDeclarations:N,...g.length>0?{moduleTypeDeclarations:g}:{},typeImportStatements:il(e,d),referencesComponentGenerics:P?rl(P,e.generics):!1,...c}}function qn(e,t){let n=t.source?.value;if(typeof n!=="string"||t.importKind==="type")return;for(let r of t.specifiers??[]){if(r.type!=="ImportSpecifier"||r.importKind==="type")continue;let i=r.local?.name;if(!i)continue;let o=r.imported?.name??(typeof r.imported?.value==="string"?r.imported.value:i);e.valueImportBindingsByLocalName.set(i,{localName:i,importedName:o,source:n})}}function ln(e){return[e.importedName,...e.members??[]].join(".")}function Br(e,t){let n=[],r=t;while(r.type==="MemberExpression"){if(r.computed||!ye(r.property))return;n.unshift(r.property.name),r=r.object}if(!ye(r))return;let i=r.name,o=(c,l,d)=>d.length>0?{source:c,importedName:l,members:d}:{source:c,importedName:l},s=e.valueImportBindingsByLocalName.get(i);if(s)return o(s.source,s.importedName,n);for(let c of[e.parsed?.instance,e.parsed?.module])for(let l of(c?St(c):void 0)??[]){let d=l,u=d.source?.value;if(d.type!=="ImportDeclaration"||d.importKind==="type"||typeof u!=="string")continue;let y=d.specifiers?.find((g)=>g.local?.name===i);if(y?.type==="ImportDefaultSpecifier")return o(u,"default",n);if(y?.type==="ImportNamespaceSpecifier"&&n.length>0)return o(u,n[0],n.slice(1))}return}function Un(e,t){if(!Wt(t))return;return Br(e,t)}function St(e){let t=e,n=t.type==="Program"?t.body:t.content?.body??t.body;return Array.isArray(n)?n:void 0}function Os(e){let t=new Map,n=e?St(e):void 0;if(!n)return t;for(let r of n){let i=r;if(i.type!=="ImportDeclaration"||i.importKind==="type")continue;let o=i.source?.value;if(typeof o!=="string")continue;for(let s of i.specifiers??[]){let c=s.local?.name;if(!c||s.importKind==="type")continue;let l;if(s.type==="ImportDefaultSpecifier")l="default";else if(s.type==="ImportNamespaceSpecifier")l="*";else l=s.imported?.name??String(s.imported?.value??c);t.set(c,{from:o,imported:l})}}return t}function Fr(e,t){if(!t)return;let n=St(t);if(!n)return;for(let r of n){let i=r;if(i.type==="ImportDeclaration"){qn(e,i);continue}let o=i.type==="ExportNamedDeclaration"&&i.declaration?i.declaration:i;if(o.type==="FunctionDeclaration"){let s=o;if(s.id?.name)e.funcDecls.set(s.id.name,s)}}}function un(e,t,n,r){if(ze(n)===void 0)return;if(e.trackPropLocalName(n),t.props.has(n)){let i=t.props.get(n);t.props.set(n,{...i,...r})}else t.props.set(n,r)}function dn(e,t,n,r){if(t.pendingCallDefault)e.pendingCallDefaultCandidates.push({propName:n,location:r,...t.pendingCallDefault});if(t.pendingConstDefault)e.pendingConstDefaultCandidates.push({propName:n,location:r,...t.pendingConstDefault})}var al=/[^\S\r\n]*[\r\n]\s*/g;function pt(e,t,n,r=0){let i,o,s=!1;if(!n||typeof n!=="object"||!("type"in n))return{value:i,type:o,isFunction:s};let c=$s(e,t,n);if(n.type==="ObjectExpression"||n.type==="BinaryExpression"||n.type==="ArrayExpression"||n.type==="ArrowFunctionExpression"||n.type==="FunctionExpression"){let l=n;if("start"in l&&"end"in l&&typeof l.start==="number"&&typeof l.end==="number")i=le(t,l.start,l.end)?.replace(jn," ");if(s=n.type==="ArrowFunctionExpression"||n.type==="FunctionExpression",n.type==="BinaryExpression")o=Je(e,t,n,r);else if(n.type==="ObjectExpression"||n.type==="ArrayExpression"){let{start:d,end:u}=l;o=$r(n)?pl(t,d,u,i):void 0}if(n.type==="ArrowFunctionExpression"||n.type==="FunctionExpression")o=js(n),i=Fs(t,n)}else if(n.type==="UnaryExpression"){let l=n;if("start"in l&&"end"in l&&typeof l.start==="number"&&typeof l.end==="number")i=le(t,l.start,l.end);o=Je(e,t,l,r)}else if(n.type==="LogicalExpression"||n.type==="ConditionalExpression"||n.type==="SequenceExpression"){let{start:l,end:d}=n,u=l===void 0||d===void 0?void 0:le(t,l,d)?.replace(al," ");i=u!==void 0&&n.type==="SequenceExpression"?`(${u})`:u,o=Je(e,t,n,r)}else if(n.type==="NewExpression"){let l=n;if("start"in l&&"end"in l&&typeof l.start==="number"&&typeof l.end==="number")i=le(t,l.start,l.end);if(l.callee&&typeof l.callee==="object"&&"type"in l.callee&&l.callee.type==="Identifier"){let d=l.callee.name;if(d==="Date")o="Date";else if(d==="Map")o="Map<any, any>";else if(d==="Set")o="Set<any>";else if(d==="WeakMap")o="WeakMap<object, any>";else if(d==="WeakSet")o="WeakSet<object>";else if(d==="Array")o="any[]";else if(d==="RegExp"||d==="Regexp")o="RegExp";else if(d==="Error")o="Error";else o=d}}else if(n.type==="CallExpression"){let l=n;if("start"in l&&"end"in l&&typeof l.start==="number"&&typeof l.end==="number")i=le(t,l.start,l.end);let d=l.callee,u=d&&typeof d==="object"&&"type"in d&&d.type==="Identifier"?d.name:void 0;if((u==="$derived"||u==="$state")&&l.arguments.length===1&&r<5)return{...pt(e,t,l.arguments[0],r+1),value:i,defaultValue:c};if(u){let y=ul(e,t,u);if(y)return{value:i,type:void 0,isFunction:!1,defaultValue:c,resolvedType:y};if(t.funcDecls.has(u)||dl(t,u))return{value:i,type:void 0,isFunction:!1,defaultValue:c,pendingCallDefault:{calleeName:u}};let g=t.valueImportBindingsByLocalName.get(u);if(g)return{value:i,type:void 0,isFunction:!1,defaultValue:c,pendingCallDefault:{calleeName:u,importSource:g.source,importedName:g.importedName}}}return{value:i,type:void 0,isFunction:!1,defaultValue:c,pendingCallDefault:{calleeName:u??ll(t,d)}}}else if(n.type==="Identifier"){let l=n;if(r<5){let u=Wn(t,l.name);if(u){let y=pt(e,t,u,r+1),g=e.resolveLocalVarJSDoc(l.name);return{...y,resolvedType:g?.type??y.resolvedType,resolvedDescription:g?.description??y.resolvedDescription,resolvedParams:g?.params??y.resolvedParams,resolvedReturnType:g?.returnType??y.resolvedReturnType}}if(t.funcDecls.has(l.name)){let y=e.resolveLocalVarJSDoc(l.name),g=t.funcDecls.get(l.name);return{value:g?Fs(t,g):void 0,type:void 0,isFunction:!0,defaultValue:g?$s(e,t,g):void 0,resolvedType:y?.type??yl(y,g),resolvedDescription:y?.description,resolvedParams:y?.params,resolvedReturnType:y?.returnType}}}if("start"in l&&"end"in l&&typeof l.start==="number"&&typeof l.end==="number")i=le(t,l.start,l.end);let d=t.valueImportBindingsByLocalName.get(l.name);if(d)return{value:i,type:o,isFunction:s,defaultValue:c,pendingConstDefault:{importSource:d.source,importedName:d.importedName}}}else if(n.type==="MemberExpression"){let l=n;if("start"in l&&"end"in l&&typeof l.start==="number"&&typeof l.end==="number")i=le(t,l.start,l.end);if(e.isNumericConstant(n))o="number";let d=Un(t,n);if(d)return{value:i,type:o,isFunction:s,defaultValue:c,pendingConstDefault:{importSource:d.source,importedName:d.importedName,...d.members?{members:d.members}:{}}}}else if(n.type==="TemplateLiteral"){let l=n;if("start"in l&&"end"in l&&typeof l.start==="number"&&typeof l.end==="number")i=le(t,l.start,l.end);o="string"}else if("raw"in n&&typeof n.raw==="string")i=n.raw,o=fn(n);return{value:i,type:o,isFunction:s,defaultValue:c}}function fn(e){if("regex"in e&&e.regex)return"RegExp";if("bigint"in e&&e.bigint)return"bigint";return e.value==null?void 0:typeof e.value}var ol=new Set(["-","*","/","%","**","<<",">>",">>>","&","|","^"]),cl=new Set(["==","!=","===","!==","<","<=",">",">=","in","instanceof"]);function Je(e,t,n,r){if(!n||typeof n!=="object"||!("type"in n))return;switch(n.type){case"UnaryExpression":{let i=n;if(i.operator==="!"||i.operator==="delete")return"boolean";if(i.operator==="typeof")return"string";if(i.operator==="void")return;if(i.operator==="+")return"number";return Je(e,t,i.argument,r)==="bigint"?"bigint":"number"}case"BinaryExpression":{let i=n;if(cl.has(i.operator))return"boolean";let o=Je(e,t,i.left,r),s=Je(e,t,i.right,r);if(o==="bigint"&&s==="bigint")return"bigint";if(ol.has(i.operator))return"number";if(i.operator!=="+")return;if(o==="string"||s==="string")return"string";if(o==="number"&&s==="number")return"number";return}case"LogicalExpression":{let i=n;return Bs([Je(e,t,i.left,r),Je(e,t,i.right,r)])}case"ConditionalExpression":{let i=n;return Bs([Je(e,t,i.consequent,r),Je(e,t,i.alternate,r)])}case"SequenceExpression":{let i=n.expressions;return Je(e,t,i[i.length-1],r)}case"Identifier":{let i=n.name;if(i==="NaN"||i==="Infinity")return"number";if(i==="undefined")return;let o=e.findVariableTypeAndDescription(i)?.type;if(o)return o;if(r>=5)return;return Je(e,t,Wn(t,i),r+1)}default:{if(r>=5)return;let i=pt(e,t,n,r+1);return i.type??i.resolvedType}}}function Bs(e){let t=new Set;for(let n of e){if(n===void 0)return;t.add(n.includes("=>")?`(${n})`:n)}return t.size===1?e[0]:[...t].join(" | ")}function pl(e,t,n,r){if(r===void 0||t===void 0||n===void 0)return r;let i=e.parsed?.comments??[],o="",s=t;for(let c of i){if(c.start<t||c.end>n)continue;o+=le(e,s,c.start)??"",s=c.end}if(s===t)return r;return o+=le(e,s,n)??"",o.replace(jn," ")}function $r(e){if(!e||typeof e!=="object"||!("type"in e))return!1;switch(e.type){case"Literal":return!(("regex"in e)&&e.regex);case"TemplateLiteral":return e.expressions.length===0;case"Identifier":return e.name==="undefined";case"UnaryExpression":{let t=e,n=t.argument;return t.operator==="-"&&n?.type==="Literal"&&(typeof n.value==="number"||typeof n.value==="bigint")}case"ArrayExpression":return e.elements.every((t)=>t!==null&&$r(t));case"ObjectExpression":return e.properties.every((t)=>t.type==="Property"&&t.kind==="init"&&!t.computed&&!t.method&&!t.shorthand&&(t.key.type==="Identifier"||t.key.type==="Literal")&&$r(t.value));default:return!1}}function Gn(e,t,n){let r=Wn(t,n);if(!r||typeof r!=="object"||!("type"in r))return;if(r.type==="CallExpression"){let i=r,o=qe(t,i.callee);if(o==="$state"||o==="$state.raw"||o==="$derived"){let s=i.typeArguments?.params?.[0];if(s)return Ae(t,s),qe(t,s);if(o==="$state.raw")return pt(e,t,i.arguments[0],1).type}}return pt(e,t,r).type}function Wn(e,t){for(let n of e.vars)for(let r of n.declarations)if(r.id&&typeof r.id==="object"&&"type"in r.id&&r.id.type==="Identifier"&&"name"in r.id&&r.id.name===t&&r.init)return r.init;return}function Kt(e,t){for(let n of e.vars){if(n.kind!=="const")continue;for(let r of n.declarations)if(r.id&&typeof r.id==="object"&&"type"in r.id&&r.id.type==="Identifier"&&"name"in r.id&&r.id.name===t&&r.init)return r.init}return}function ll(e,t){if(t&&typeof t==="object"&&"start"in t&&"end"in t&&typeof t.start==="number"&&typeof t.end==="number")return le(e,t.start,t.end)??"call";return"call"}function ul(e,t,n){let r=e.resolveLocalVarJSDoc(n);if(r?.returnType)return r.returnType;let i=t.funcDecls.get(n)??Vs(t,n);if(!i)return;let o=ml(t,i);if(o)return o;let s=fl(t,n);if(s)return s;let c=Hs(i);return c==="any"?void 0:c}function dl(e,t){return Vs(e,t)!==void 0}function Vs(e,t){let n=Wn(e,t);if(!n||typeof n!=="object"||!("type"in n))return;if(n.type==="ArrowFunctionExpression"||n.type==="FunctionExpression")return n;return}function fl(e,t){for(let n of e.vars)for(let r of n.declarations){let i=r.id;if(!i||typeof i!=="object"||!("type"in i)||i.type!=="Identifier"||!("name"in i)||i.name!==t)continue;let o=i.typeAnnotation;if(o?.type!=="TSTypeAnnotation")return;let s=o.typeAnnotation;if(!s||typeof s.start!=="number"||typeof s.end!=="number")return;return hl(le(e,s.start,s.end))}return}function hl(e){if(!e)return;let t=e.lastIndexOf("=>");if(t===-1)return;return e.slice(t+2).trim()||void 0}function ml(e,t){let n=t.returnType;if(n?.type!=="TSTypeAnnotation")return;let r=n.typeAnnotation;if(!r||typeof r.start!=="number"||typeof r.end!=="number")return;return le(e,r.start,r.end)}function yl(e,t){let n=e?.returnType??"any",r=e?.params;if(r&&r.length>0)return`(${Ct(r)}) => ${n}`;if(e?.returnType)return`() => ${n}`;if(t)return js(t);return"(...args: any[]) => any"}function js(e){return`(${gl(e)}) => ${Hs(e)}`}function gl(e){let t=e.params;if(!Array.isArray(t)||t.length===0)return"...args: any[]";let n=[];for(let r of t)if(r&&typeof r==="object"&&"type"in r&&r.type==="Identifier"&&"name"in r&&typeof r.name==="string")n.push(`${r.name}: any`);else return"...args: any[]";return n.join(", ")}function Hs(e){if(e.async||e.generator)return"any";let t=e.body,n;if(t&&typeof t==="object"&&"type"in t&&t.type==="BlockStatement"){if(n=xl(t),n.length===0)return"any"}else n=[t];let r=null;for(let i of n){let o=bl(i);if(!o)return"any";if(r===null)r=o;else if(r!==o)return"any"}return r??"any"}function xl(e){let t=[];return Vr(e,t),t}function Vr(e,t){if(!e||typeof e!=="object")return;let n=e;if(typeof n.type!=="string")return;if(n.type==="FunctionDeclaration"||n.type==="FunctionExpression"||n.type==="ArrowFunctionExpression")return;if(n.type==="ReturnStatement")t.push(n.argument??null);for(let r in n){if(r==="leadingComments")continue;let i=n[r];if(!i||typeof i!=="object")continue;if(Array.isArray(i))for(let o=0;o<i.length;o++)Vr(i[o],t);else Vr(i,t)}}function bl(e){if(!e||typeof e!=="object"||!("type"in e))return null;switch(e.type){case"Literal":{let t=e.value;if(typeof t==="string")return"string";if(typeof t==="number")return"number";if(typeof t==="boolean")return"boolean";return null}case"TemplateLiteral":return"string";case"CallExpression":{let t=e.callee;if(t&&typeof t==="object"&&"type"in t&&t.type==="Identifier"){let n=t.name;if(n==="String")return"string";if(n==="Number")return"number";if(n==="Boolean")return"boolean"}return null}default:return null}}function qs(e){if(ct(e,"$bindable"))return{init:e.arguments[0],bindable:!0};return{init:e,bindable:!1}}function Tl(e,t){let n=t.params;if(!Array.isArray(n)||n.length===0)return"";let r=n[0],i=n[n.length-1];if(typeof r.start!=="number"||typeof i.end!=="number")return"";return le(e,r.start,i.end)??""}function Fs(e,t){if(t.generator)return;let n=t.body;if(!n||typeof n!=="object"||!("type"in n))return;let r=Tl(e,t),i=t.async?"async ":"",o=(c,l)=>c&&typeof c==="object"&&("type"in c)&&c.type==="ObjectExpression"?`(${l})`:l;if(n.type!=="BlockStatement"){let c=qe(e,n);return c===void 0?void 0:`${i}(${r}) => ${o(n,c)}`}let s=n.body;if(s.length===0)return`${i}(${r}) => {}`;if(s.length===1){let c=s[0];if(c&&typeof c==="object"&&"type"in c&&c.type==="ReturnStatement"){let l=c.argument;if(l){let d=qe(e,l);if(d!==void 0)return`${i}(${r}) => ${o(l,d)}`}}}return}function $s(e,t,n){let r=qe(t,n);if(!r||!n||typeof n!=="object"||!("type"in n))return;let i="expression";if(n.type==="Literal"||n.type==="UnaryExpression")i="literal";else if(n.type==="TemplateLiteral")i=n.expressions.length===0?"literal":"expression";else if(n.type==="ArrayExpression")i="array";else if(n.type==="ObjectExpression")i="object";else if(n.type==="ArrowFunctionExpression"||n.type==="FunctionExpression"||n.type==="FunctionDeclaration")i="function";let o={raw:r,kind:i};if(i==="literal"||i==="array"||i==="object"){let s=jr(e,n);if(s.ok)o.value=s.value}return o}function jr(e,t){if(!t||typeof t!=="object"||!("type"in t))return{ok:!1};if(t.type==="Literal"){let n=t.value;return typeof n==="bigint"||"regex"in t?{ok:!1}:{ok:!0,value:n}}if(t.type==="UnaryExpression"){let n=t,r=n.argument;if(!r||typeof r!=="object"||!("type"in r)||r.type!=="Literal")return{ok:!1};let i=r.value;if(typeof i==="number"){if(n.operator==="-")return{ok:!0,value:-i};if(n.operator==="+")return{ok:!0,value:i}}if(typeof i==="boolean"&&n.operator==="!")return{ok:!0,value:!i};return{ok:!1}}if(t.type==="TemplateLiteral"){let n=t;if(n.expressions.length>0||n.quasis.length!==1)return{ok:!1};return{ok:!0,value:n.quasis[0].value.cooked??n.quasis[0].value.raw}}if(t.type==="ArrayExpression"){let n=t,r=[];for(let i of n.elements){if(!i)return{ok:!1};let o=jr(e,i);if(!o.ok)return{ok:!1};r.push(o.value)}return{ok:!0,value:r}}if(t.type==="ObjectExpression"){let n=t,r={};for(let i of n.properties){if(i.type!=="Property"||i.computed)return{ok:!1};let o=e.getPropertyName(i.key);if(!o)return{ok:!1};let s=jr(e,i.value);if(!s.ok)return{ok:!1};r[o]=s.value}return{ok:!0,value:r}}return{ok:!1}}function De(e,t,n){if(!t||e.has(t))return;e.set(t,n)}function hn(e,t){for(let n=e.activeScopes.length-1;n>=0;n-=1){let r=e.activeScopes[n]?.get(t);if(!r)continue;return r.kind==="prop"?r.publicPropName:void 0}return}function mn(e,t){for(let n=e.activeScopes.length-1;n>=0;n-=1){let r=e.activeScopes[n];if(r===e.componentScope)return!1;if(r?.has(t))return!0}return!1}function Kn(e,t){let n=t;while(Wt(n))n=n.object;return ye(n)&&mn(e,n.name)}function ge(e,t=new Set){if(!e||typeof e!=="object"||!("type"in e))return t;switch(e.type){case"Identifier":t.add(e.name);break;case"AssignmentPattern":ge(e.left,t);break;case"ArrayPattern":for(let n of e.elements)ge(n??void 0,t);break;case"ObjectPattern":for(let n of e.properties)if(n.type==="Property")ge(n.value,t);else if(n.type==="RestElement")ge(n.argument,t);break;case"RestElement":ge(e.argument,t);break}return t}function qr(e,t){if(!t||typeof t!=="object"||!("type"in t))return;if(t.type==="Identifier"){let r=hn(e,t.name);if(r)e.reactive_vars.add(r);return}let n=ge(t);for(let r of n){let i=hn(e,r);if(i)e.reactive_vars.add(i)}}function yn(e){if(!e||typeof e!=="object"||!("type"in e))return!1;switch(String(e.type)){case"BlockStatement":case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"CatchClause":case"EachBlock":case"AwaitBlock":return!0;default:return!1}}function Us(e){if(!e||typeof e!=="object"||!("type"in e))return!1;let t=String(e.type);return t==="FunctionDeclaration"||t==="FunctionExpression"||t==="ArrowFunctionExpression"}function El(e,t){let n=e.scopeDeclarations.get(t);if(!n)n=new Map,e.scopeDeclarations.set(t,n);return n}function Cl(e,t,n){let r=[];if(n.id.type==="Identifier")return r.push({kind:"local",name:n.id.name}),r;if(n.id.type!=="ObjectPattern")return r;for(let i of n.id.properties){if(i.type==="RestElement"){if(i.argument.type==="Identifier")r.push({kind:"local",name:i.argument.name});continue}if(i.computed)continue;let o=e.getPropertyName(i.key);if(!o)continue;let s;if(i.value.type==="Identifier")s=i.value.name;else if(i.value.type==="AssignmentPattern"&&i.value.left.type==="Identifier")s=i.value.left.name;if(!s)continue;r.push({kind:"prop",name:s,publicPropName:o})}return r}function Hr(e,t,n,r,i){if(!Cs(t))return;let o=i?.allowRunesProps??!1,s=i?.forceProp??!1,c=t;for(let l of c.declarations){if(o&&ct(Et(l.init),"$props")){for(let y of Cl(e,c,l))De(y.kind==="prop"?n:r,y.name,y.kind==="prop"?{kind:"prop",publicPropName:y.publicPropName}:{kind:"local"});continue}let d=c.kind==="var"?r:n,u=s?"prop":"local";for(let y of ge(l.id))De(d,y,u==="prop"?{kind:"prop",publicPropName:y}:{kind:"local"})}}function Sl(e,t){if("id"in e&&e.id&&typeof e.id==="object"&&"name"in e.id&&typeof e.id.name==="string")De(t,e.id.name,{kind:"local"});for(let n of e.params)for(let r of ge(n))De(t,r,{kind:"local"})}function vl(e,t,n,r){if(!Array.isArray(t))return;for(let i of t){if(!i||typeof i!=="object"||!("type"in i))continue;switch(i.type){case"VariableDeclaration":Hr(e,i,n,r);break;case"FunctionDeclaration":if(i.id?.name)De(n,i.id.name,{kind:"local"});break;case"ClassDeclaration":if(i.id?.name)De(n,i.id.name,{kind:"local"});break}}}function Pl(e,t){for(let{local:n,exported:r}of t){if(n.type!=="Identifier")continue;let i=r.type==="Identifier"?r.name:String(r.value);if(e.componentScope.get(n.name)?.kind==="prop")continue;e.componentScope.set(n.name,{kind:"prop",publicPropName:i})}}function Al(e,t,n){if(!n||typeof n!=="object")return;let r="content"in n&&n.content&&typeof n.content==="object"&&"body"in n.content&&Array.isArray(n.content.body)?n.content:("body"in n)&&Array.isArray(n.body)?n:void 0;if(!r||!("body"in r)||!Array.isArray(r.body))return;for(let i of r.body){if(!i||typeof i!=="object"||!("type"in i))continue;switch(i.type){case"ImportDeclaration":for(let o of i.specifiers??[])if(o.local?.name)De(t.componentScope,o.local.name,{kind:"local"});break;case"VariableDeclaration":Hr(e,i,t.componentScope,t.componentScope,{allowRunesProps:!0});break;case"FunctionDeclaration":if(i.id?.name)De(t.componentScope,i.id.name,{kind:"local"});break;case"ClassDeclaration":if(i.id?.name)De(t.componentScope,i.id.name,{kind:"local"});break;case"ExportNamedDeclaration":if(!i.declaration||typeof i.declaration!=="object"||!("type"in i.declaration)){if(i.source==null)Pl(t,i.specifiers??[]);break}if(i.declaration.type==="VariableDeclaration")Hr(e,i.declaration,t.componentScope,t.componentScope,{forceProp:!0});else if(i.declaration.type==="FunctionDeclaration"&&i.declaration.id?.name)De(t.componentScope,i.declaration.id.name,{kind:"prop",publicPropName:i.declaration.id.name});break}}}function Gs(e,t){t.componentScope.clear(),t.scopeDeclarations=new Map,t.activeScopes.length=0,Al(e,t,t.parsed?.instance)}function Ws(e){return{varScopeStack:[e.componentScope]}}function Ks(e,t,n,r){if(!yn(r))return;let i=El(t,r),o=n.varScopeStack[n.varScopeStack.length-1]??t.componentScope;switch(String(r.type)){case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":Sl(r,i);break;case"BlockStatement":vl(e,r.body,i,o);break;case"CatchClause":if("param"in r)for(let c of ge(r.param))De(i,c,{kind:"local"});break;case"EachBlock":{let c=r;for(let l of ge(c.context))De(i,l,{kind:"local"});if(typeof c.index==="string")De(i,c.index,{kind:"local"});else if(c.index&&"name"in c.index)De(i,c.index.name,{kind:"local"});break}case"AwaitBlock":{let c=r;for(let l of ge(c.value))De(i,l,{kind:"local"});for(let l of ge(c.error))De(i,l,{kind:"local"});break}}if(Us(r))n.varScopeStack.push(i);return i}function zs(e,t){if(Us(t))e.varScopeStack.pop()}function Gr(e,t,n){let r=t.findVariableTypeAndDescription(n);if(r&&r.type===e.explicitVariableTypesByName.get(n))Ae(e,e.explicitVariableTypeNodesByName.get(n));return r}function zn(e,t,n,r=!0){let i=Gr(e,t,n);if(i||!r)return i;let o=Gn(t,e,n);return o?{type:o,...t.findVariableJsDoc(n)}:null}function kl(e,t,n,r){if(!ye(n))return null;let i=Kt(e,n.name);if(Ke(i))return ta(e,t,i,r).properties;let o=zn(e,t,n.name);return o?pn(o.type):null}function wl(e,t,n){return t.properties.some((r)=>r.type==="Property"&&r.kind==="get"&&e.getPropertyName(r.key)===n)}function Js(e,t,n){if(!t||typeof t!=="object"||!(n in t))return;let r=t[n];if(!r||typeof r!=="object"||!("typeAnnotation"in r))return;return qe(e,r.typeAnnotation)}function Nl(e){let t=e?.body.body;if(t?.length!==1||t[0].type!=="ReturnStatement")return;return t[0].argument??void 0}function Dl(e,t,n,r,i,o){if(ye(o)){let s=zn(e,t,o.name);if(s)return s;return pe(e,"context-any-type",r,`Context "${n}" property "${r}" has no type annotation; defaulted to "any".`,oe(e,i)),{type:"any"}}if(o?.type==="ArrowFunctionExpression"||o?.type==="FunctionExpression")return{type:`(${o.params.map((c)=>`${ye(c)?c.name||"arg":"arg"}: any`).join(", ")}) => any`};if(Tt(o))return{type:fn(o)??"null"};return{type:"any"}}function ta(e,t,n,r){let i=[],o=!1;for(let s of n.properties){if(s.type==="SpreadElement"){let y=kl(e,t,s.argument,r);if(y)i.push(...y);else o=!0,pe(e,"spread-unresolved",r,`Context "${r}" spreads a value sveld can't resolve; its shape is widened to "Record<string, any>".`,oe(e,s));continue}if(s.type!=="Property")continue;let c=t.getPropertyName(s.key);if(!c)continue;if(s.kind==="set"&&wl(t,n,c))continue;let l=s.kind==="get"||s.kind==="set"?s.value:void 0,d=l?s.kind==="get"?Js(e,l,"returnType"):Js(e,l.params[0],"typeAnnotation"):void 0,u=d?{type:d}:Dl(e,t,r,c,s,s.kind==="get"?Nl(l):s.kind==="set"?void 0:s.value);i.push({name:c,type:u.type,description:u.description,optional:!1,...u.internal?{internal:!0}:{}})}return{properties:i,hasUnresolvedSpread:o}}var _l=/(?:_|[^\p{ID_Continue}$])+/u,Il=/^[\p{ID_Start}$]/u;function Ur(e){let r=`${e.split(_l).map((i)=>i.charAt(0).toUpperCase()+i.slice(1)).join("")}Context`;return Il.test(r)?r:`_${r}`}function Xs(e,t,n,r){let{properties:i,hasUnresolvedSpread:o}=ta(e,t,n,r);return{key:r,typeName:Ur(r),properties:i,description:void 0,...o?{hasUnresolvedSpread:o}:{}}}function Ys(e,t,n,r){if(Ke(n))return Xs(e,t,n,r);else if(ye(n)){let i=n.name,o=zn(e,t,i,!1),s=o?void 0:Kt(e,i);if(Ke(s))return Xs(e,t,s,r);let c=o??zn(e,t,i);if(c){let l=pn(c.type);return{key:r,typeName:Ur(r),...l?{}:{type:c.type},properties:l??[],description:c.description,...c.internal?{internal:!0}:{}}}return pe(e,"context-any-type",i,`Context "${r}" variable "${i}" has no type annotation; defaulted to "any".`,oe(e,n)),{key:r,typeName:Ur(r),type:"any",properties:[]}}return null}function Qs(e){let t=e.callee;if(!t||typeof t!=="object"||!("type"in t))return null;let n=t.type==="Identifier"&&t.name==="Symbol",r=t.type==="MemberExpression"&&!t.computed&&t.object.type==="Identifier"&&t.object.name==="Symbol"&&t.property.type==="Identifier"&&t.property.name==="for";if(!n&&!r)return null;let i=e.arguments[0];if(!i||typeof i!=="object"||!("type"in i))return"";if(i.type==="Literal"&&typeof i.value==="string")return i.value;if(i.type==="TemplateLiteral"&&i.quasis?.length===1)return i.quasis[0].value.cooked??"";return""}function Zs(e){return{kind:"pending",importSource:e.source,importedName:e.importedName,...e.members?{members:e.members}:{}}}function na(e,t,n=0){if(!t||typeof t!=="object"||!("type"in t))return{kind:"unresolved"};let r=t;if(r.type==="Literal"||r.type==="TemplateLiteral"){let i=vs(r);return i==null?{kind:"unresolved"}:{kind:"resolved",key:i}}if(r.type==="CallExpression"||r.type==="NewExpression"){let i=Qs(r);return i==null?{kind:"unresolved"}:{kind:"resolved",key:i}}if(r.type==="Identifier"){if(n>=5)return{kind:"unresolved"};let i=Kt(e,r.name);if(i&&typeof i==="object"&&"type"in i){let s=i;if((s.type==="CallExpression"||s.type==="NewExpression")&&Qs(s)==="")return{kind:"resolved",key:r.name};return na(e,s,n+1)}let o=n===0&&mn(e,r.name)?void 0:e.valueImportBindingsByLocalName.get(r.name);return o?Zs(o):{kind:"unresolved"}}if(r.type==="MemberExpression"){let i=n===0&&Kn(e,r)?void 0:Un(e,r);if(i)return Zs(i)}return{kind:"unresolved"}}function ea(e,t,n,r,i){let o=qe(e,r)??"";pe(e,"context-value-unresolved",t,`setContext(${n}, ${o}): the value isn't an object literal or a variable, so sveld can't describe its shape; the context is skipped.`,i)}function ra(e,t,n,r){if(!n||typeof n!=="object"||!("type"in n)||n.type!=="CallExpression")return;let i=n,o=i.arguments[0];if(!o)return;let s=na(e,o);if(s.kind==="unresolved"||s.kind==="resolved"&&!s.key){let y=qe(e,o)??"";pe(e,"context-key-unresolved",y,`setContext key \`${y}\` isn't a string literal, const-bound string, Symbol(), or imported \`export const\` string; the context is skipped.`,oe(e,n));return}let c=i.arguments[1];if(!c)return;let l=oe(e,n);if(s.kind==="pending"){let y=ln(s),g=Ys(e,t,c,y);if(g)e.pendingContextKeyCandidates.push({importSource:s.importSource,importedName:s.importedName,...s.members?{members:s.members}:{},...g.type===void 0?{}:{type:g.type},properties:g.properties,description:g.description,...g.hasUnresolvedSpread?{hasUnresolvedSpread:!0}:{},...g.internal?{internal:!0}:{},source:l});else ea(e,y,y,c,l);return}let d=s.key,u=Ys(e,t,c,d);if(!u){ea(e,d,JSON.stringify(d),c,l);return}if(e.contexts.has(d)){pe(e,"context-duplicate-key",d,`setContext("${d}", ...) was called more than once; only the first call's shape is used.`,l);return}e.contexts.set(d,{...u,source:l})}var Ll=/\n/g,Rl=/^[A-Za-z_$][\w$]*$/;function Wr(e,t,n){return{variableType:(r)=>{if(n?.has(r))return;return Gr(t,e,r)?.type??Gn(e,t,r)},getPropertyName:(r)=>e.getPropertyName(r)}}function gn(e,t,n){if(!t||typeof t!=="object"||!("type"in t))return n;if(ye(t)){if(!mn(e,t.name))return n;let i=n??new Set;return i.add(t.name),i}let r=n;if(Ke(t)){for(let i of t.properties)if(i.type==="Property")r=gn(e,i.value,r)}else if(t.type==="ArrayExpression")for(let i of t.elements)r=gn(e,i,r);return r}function Kr(e,t){if(ye(t))return e.variableType(t.name);return Ml(e,t)}function Ml(e,t){if(!t||typeof t!=="object"||!("type"in t))return;if(Ke(t))return sa(e,t);if(t.type==="ArrayExpression")return aa(e,t);return}function ia(e,t){if(!t||typeof t!=="object"||!("type"in t))return"any";if(ye(t))return e.variableType(t.name)??"any";if(Tt(t))return fn(t)??"null";if(Ke(t))return sa(e,t);if(t.type==="ArrayExpression")return aa(e,t);return"any"}function sa(e,t){if(t.properties.length===0)return"Record<string, never>";let n=[],r=!1;for(let i of t.properties){let o=i.type==="Property"&&!i.computed?e.getPropertyName(i.key):void 0;if(i.type!=="Property"||!o){r=!0;continue}n.push({name:o,type:ia(e,i.value)})}if(!r)return xn(n);if(n.length===0)return"Record<string, any>";return xn([...n,{name:"[key: string]",type:"any"}])}function aa(e,t){let n=new Set(t.elements.filter((r)=>r!=null).map((r)=>ia(e,r)));if(n.size===0)return"any[]";if(n.size===1)return`${[...n][0]}[]`;return`(${[...n].join(" | ")})[]`}function oa(e,t){for(let[n,r]of e.arguments.entries()){if(ye(r)&&r.name===t)return{argumentIndex:n};if(!Ke(r))continue;for(let i of r.properties){if(i.type!=="Property"||!ye(i.value))continue;if(i.value.name!==t)continue;let o=!i.computed&&ye(i.key)?i.key.name:void 0;return{argumentIndex:n,property:o??""}}}return}function ca(e,t){let n=ht(e.name,t.name);if(n!==0)return n;let r=ht(e.type,t.type);if(r!==0)return r;if(e.type==="forwarded"&&t.type==="forwarded"){let i=ht(e.element,t.element);if(i!==0)return i}return ht(e.detail??"",t.detail??"")}function zr(e){return typeof e==="string"?JSON.stringify(e):String(e)}function vt(e,{name:t,detail:n,has_argument:r,description:i,deprecated:o,tags:s,internal:c,source:l}){if(t===void 0)return;let d=!r&&!n?"null":ze(n),u=i,y=e.events.get(t);if(y?.type==="forwarded")e.events.set(t,{type:"dispatched",name:t,detail:d,description:u||y.description,deprecated:o??y.deprecated,tags:s??y.tags,...c||y.internal?{internal:!0}:{},source:l||y.source});else if(y){let g=y.tags??s,b=e.untypedJsDocEventNames.delete(t);e.events.set(t,{...y,detail:y.detail===void 0||b?d:y.detail,description:y.description||u,deprecated:y.deprecated??o,tags:g,...y.internal||c?{internal:!0}:{},source:l||y.source})}else e.events.set(t,{type:"dispatched",name:t,detail:d,description:u,deprecated:o,tags:s,...c?{internal:!0}:{},source:l})}function pa(e,t){let n=t.arguments[0],r=kr(n,"CustomEvent");if(!r&&!kr(n,"Event"))return;let i=n.arguments[0],o=Tt(i)?i.value:void 0;if(o==null)return;let s=r?n.arguments[1]:void 0,c=!1,l;if(Ke(s)){let d=s.properties.find((u)=>u.type==="Property"&&ye(u.key)&&u.key.name==="detail");if(d?.type==="Property")c=!0,l=d.value}return{name:String(o),detail:l,hasArgument:c,nestedBoundNames:gn(e,l),source:oe(e,t)}}function la(e,t,n){let r=Kr(Wr(e,t,n.nestedBoundNames),n.detail),i=r===void 0&&Tt(n.detail)?n.detail.value:void 0;vt(t,{name:n.name,detail:r??(i==null?"":zr(i)),has_argument:n.hasArgument,source:n.source})}function xn(e,t,n=!1){if(e.length===0)return"null";let r=e.map(({name:i,type:o,description:s,optional:c,default:l})=>{let d=c?"?":"",u=Rl.test(i)||i.startsWith("[")?i:JSON.stringify(i),y=s||"";if(l&&y)y=`${y} @default ${l}`;else if(l)y=`@default ${l}`;if(y=ft(y),y){if(n)return`${y.includes(`
15
+ `,n+1)}return e.sourceLineStartOffsetsCache=t,t}function Os(e,t){if(!e.source||t<0||t>e.source.length)return;let n=ql(e),r=e.sourceLineHint;if(r!==void 0)for(let s=r;s<=r+1&&s<n.length;s++){let p=n[s],c=n[s+1]??Number.POSITIVE_INFINITY;if(t>=p&&t<c)return e.sourceLineHint=s,{line:s+1,column:t-p}}let i=0,a=n.length-1;while(i<=a){let s=i+a>>>1,p=n[s],c=n[s+1]??Number.POSITIVE_INFINITY;if(t<p)a=s-1;else if(t>=c)i=s+1;else return e.sourceLineHint=s,{line:s+1,column:t-p}}return}function En(e,t,n){if(t===void 0||n===void 0||n<t)return;let r=Os(e,t),i=Os(e,n);if(!r||!i)return;return{start:r,end:i}}function H(e,t){if(!t||typeof t!=="object")return;let n="start"in t&&typeof t.start==="number"?t.start:void 0,r="end"in t&&typeof t.end==="number"?t.end:void 0;return En(e,n,r)}function me(e,t){if(!t||t.length===0)return;let n=[...t];while(n.length>1){let c=n[n.length-1];if(c.tag!==void 0||!c.raw.trim().endsWith("*/"))break;n.pop()}let r=n[0],i=r.raw.indexOf(`@${r.tag??""}`),a=r.start+Math.max(i,0),s=n[n.length-1],p=s.start+s.raw.length;return En(e,a,p)}function z(e,t,n){return e.source?.slice(t,n)}function ye(e,t){if(!t||typeof t!=="object")return;let n="start"in t&&typeof t.start==="number"?t.start:void 0,r="end"in t&&typeof t.end==="number"?t.end:void 0;if(n===void 0||r===void 0)return;return z(e,n,r)?.replace(Sn," ")}function Cn(e,t){if(t===void 0)return;return e.runesPropsDeclarationMetadataByDeclaratorStart.get(t)}function Bs(e,t,n){return Cn(e,t)?.props.get(n)}function Fs(e){if(!e||typeof e!=="object"||!("type"in e))return;if(e.type==="Identifier"&&"name"in e&&typeof e.name==="string")return e.name;if(e.type==="TSQualifiedName"&&"right"in e&&e.right&&typeof e.right==="object"&&"name"in e.right&&typeof e.right.name==="string")return e.right.name;return}function $s(e){if(!e||typeof e!=="object"||!("type"in e))return;if(e.type==="Identifier"&&"name"in e&&typeof e.name==="string")return e.name;if(e.type==="TSQualifiedName"&&"left"in e&&e.left&&typeof e.left==="object")return $s(e.left);return}function Ue(e,t){let n=t?.start,r=t?.end;if(n===void 0||r===void 0)return;return z(e,n+1,r)?.trim()}function ct(e,t){let n=t?.start,r=t?.end;if(n===void 0||r===void 0)return;return z(e,n,r)?.trim()}function ae(e,t,n,r,i=new Set){if(!t?.type)return;switch(t.type){case"TSInterfaceDeclaration":for(let a of t.extends??[])ae(e,{type:"TSTypeReference",typeName:a.expression,typeParameters:a.typeParameters},n,r,i);ae(e,{type:"TSTypeLiteral",members:t.body?.body},n,r,i);return;case"TSTypeAliasDeclaration":case"TSParenthesizedType":case"TSTypeAnnotation":ae(e,t.typeAnnotation,n,r,i);return;case"TSIntersectionType":case"TSUnionType":for(let a of t.types??[])ae(e,a,n,r,i);return;case"TSTypeLiteral":for(let a of t.members??[]){if(a?.type!=="TSPropertySignature")continue;ae(e,a.typeAnnotation?.typeAnnotation,n,r,i)}return;case"TSTypeReference":{let a=$s(t.typeName);if(a){if(e.typeImportBindingsByLocalName.has(a)||e.valueImportBindingsByLocalName.has(a))n.add(a);let p=e.localTypeDeclarationsByName.get(a);if(p&&!i.has(a))r.add(a),i.add(a),ae(e,p.node,n,r,i),i.delete(a)}let s=t.typeArguments??t.typeParameters;if(s&&typeof s==="object"){let p=s;for(let c of p.params??[])ae(e,c,n,r,i)}return}case"TSArrayType":case"TSRestType":case"TSOptionalType":case"TSIndexedAccessType":case"TSTypeOperator":case"TSExpressionWithTypeArguments":case"TSTupleType":case"TSConditionalType":case"TSInferType":case"TSMappedType":case"TSFunctionType":case"TSConstructorType":case"TSTypeQuery":case"TSImportType":case"TSLiteralType":case"TSTypePredicate":case"TSNamedTupleMember":break;default:break}for(let a in t){let s=t[a];if(!s||typeof s!=="object")continue;if(Array.isArray(s)){for(let p of s){if(!p||typeof p!=="object"||!("type"in p))continue;ae(e,p,n,r,i)}continue}if("type"in s)ae(e,s,n,r,i)}}function Ul(e,t){let n=new Map;for(let r of Array.from(t).sort()){let i=e.typeImportBindingsByLocalName.get(r),a=i?void 0:e.valueImportBindingsByLocalName.get(r),s=i??(a?{importedName:a.importedName,localName:a.localName,source:a.source,specifierType:"named"}:void 0);if(!s)continue;let p=n.get(s.source)??{default:[],named:[],namespace:[]};if(s.specifierType==="default")p.default.push(s.localName);else if(s.specifierType==="namespace")p.namespace.push(s.localName);else p.named.push({imported:s.importedName,local:s.localName});n.set(s.source,p)}return Array.from(n.entries()).sort(([r],[i])=>je(r,i)).map(([r,i])=>{if(i.namespace.length>0)return i.namespace.map((c)=>`import type * as ${c} from "${r}";`).join(`
16
+ `);let a=i.named.map(({imported:c,local:d})=>{if(!c||c===d)return d;return`${c} as ${d}`}),s=i.default[0],p=a.length>0?`{ ${a.join(", ")} }`:"";if(s&&p)return`import type ${s}, ${p} from "${r}";`;if(s)return`import type ${s} from "${r}";`;return`import type ${p} from "${r}";`})}function te(e,t){if(t)e.additionalTypeDependencyNodes.push(t)}function Gl(e){if(!e.const)return;let t=e.id?.name;if(!t)return;let n=[];for(let r of e.members??[]){let i=r.initializer;if(i?.type!=="Literal")return;let a=i.value;if(typeof a==="string")n.push(JSON.stringify(a));else if(typeof a==="number")n.push(String(a));else return}if(n.length===0)return;return`type ${t} = ${n.join(" | ")};`}function Vs(e,t){let n=Gl(t);if(n)return n;if(t.start===void 0||t.end===void 0)return;let r=z(e,t.start,t.end)?.trim();return r?`declare ${r}`:void 0}function _r(e,t){let n=[];for(let r of t.params??[]){let i=r.type==="TSParameterProperty"&&r.parameter?r.parameter:r;if(i.type==="RestElement"){te(e,i.typeAnnotation?.typeAnnotation),n.push({name:i.argument?.name??"rest",type:Ue(e,i.typeAnnotation),optional:!1,rest:!0});continue}let a=i.type==="AssignmentPattern",s=a?i.left:i;te(e,s?.typeAnnotation?.typeAnnotation),n.push({name:s?.name??"arg",type:Ue(e,s?.typeAnnotation),optional:a||i.optional===!0,rest:!1})}te(e,t.returnType?.typeAnnotation);for(let r of t.typeParameters?.params??[])te(e,r.constraint),te(e,r.default);return{params:n,returnType:Ue(e,t.returnType),typeParameters:ct(e,t.typeParameters)||void 0}}function js(e,t){let{params:n,returnType:r,typeParameters:i}=_r(e,t),a=n.map(({name:p,type:c,optional:d,rest:u})=>u?`...${p}: ${c??"any[]"}`:`${p}${d?"?":""}: ${c??"any"}`),s=r!==void 0||i!==void 0||n.some((p)=>p.type!==void 0);return{signature:`${i??""}(${a.join(", ")}) => ${r??"any"}`,hasAnnotations:s}}function Hs(e){let t=e.pendingCallDefaultCandidates.length>0?e.pendingCallDefaultCandidates.slice():void 0,n=e.pendingConstDefaultCandidates.length>0?e.pendingConstDefaultCandidates.slice():void 0,r=e.pendingContextKeyCandidates.length>0?e.pendingContextKeyCandidates.slice():void 0,i=e.pendingDispatchEscapeCandidates.length>0?e.pendingDispatchEscapeCandidates.slice():void 0;if(!t&&!n&&!r&&!i)return;let a=e.deferredEventNoSourceDiagnostics.length>0?e.deferredEventNoSourceDiagnostics.slice():void 0,s=i&&e.untypedJsDocEventNames.size>0?Array.from(e.untypedJsDocEventNames):void 0;return{...t?{pendingCallDefaultCandidates:t}:{},...n?{pendingConstDefaultCandidates:n}:{},...r?{pendingContextKeyCandidates:r}:{},...i?{pendingDispatchEscapeCandidates:i}:{},...a?{deferredEventNoSourceDiagnostics:a}:{},...s?{untypedJsDocEventNames:s}:{}}}function qs(e){let t=new Set,n=new Set;for(let c of e.additionalTypeDependencyNodes)ae(e,c,t,n);let r=Array.from(e.localTypeDeclarationsByName.values()).filter((c)=>c.exported).sort((c,d)=>c.start-d.start);for(let c of r)ae(e,c.node,t,n);let i=r.map((c)=>`export ${c.code}`),a=e.typedRunesPropsDeclarations.length===1?e.typedRunesPropsDeclarations[0]:void 0,s=a?.canonicalType;if(a&&s){for(let c of a.referencedImportedTypes)t.add(c);for(let c of a.referencedLocalTypes)n.add(c)}if(!s&&t.size===0&&n.size===0&&i.length===0)return;let p=Array.from(n).map((c)=>e.localTypeDeclarationsByName.get(c)).filter((c)=>c!==void 0&&!c.exported).sort((c,d)=>c.start-d.start).map((c)=>c.code);return{...s?{canonicalPropsType:s}:{},canonicalPropNames:a&&s?Array.from(a.props.keys()).sort():[],localTypeDeclarations:p,...i.length>0?{moduleTypeDeclarations:i}:{},typeImportStatements:Ul(e,t)}}function $t(e,t){let n=t.source.value;if(typeof n!=="string"||t.importKind==="type")return;for(let r of t.specifiers){if(r.type!=="ImportSpecifier"||r.importKind==="type")continue;let i=r.local.name;if(!i)continue;let{imported:a}=r,s=a.type==="Identifier"?a.name:typeof a.value==="string"?a.value:i;e.valueImportBindingsByLocalName.set(i,{localName:i,importedName:s,source:n})}}function Vt(e){return[e.importedName,...e.members??[]].join(".")}function Lr(e,t){let n=[],r=t;while(r.type==="MemberExpression"){if(r.computed||!Y(r.property))return;n.unshift(r.property.name),r=r.object}if(!Y(r))return;let i=r.name,a=(p,c,d)=>d.length>0?{source:p,importedName:c,members:d}:{source:p,importedName:c},s=e.valueImportBindingsByLocalName.get(i);if(s)return a(s.source,s.importedName,n);for(let p of[e.parsed?.instance,e.parsed?.module])for(let c of p?.content.body??[]){if(c.type!=="ImportDeclaration")continue;let d=c,u=d.source.value;if(d.importKind==="type"||typeof u!=="string")continue;let y=d.specifiers.find((x)=>x.local.name===i);if(y?.type==="ImportDefaultSpecifier")return a(u,"default",n);if(y?.type==="ImportNamespaceSpecifier"&&n.length>0)return a(u,n[0],n.slice(1))}return}function Pn(e,t){if(!bt(t))return;return Lr(e,t)}function Us(e){let t=new Map;for(let n of e.content.body){if(n.type!=="ImportDeclaration")continue;let r=n;if(r.importKind==="type")continue;let i=r.source.value;if(typeof i!=="string")continue;for(let a of r.specifiers){let s=a.local.name;if(!s||a.importKind==="type")continue;let p;if(a.type==="ImportDefaultSpecifier")p="default";else if(a.type==="ImportNamespaceSpecifier")p="*";else if(a.imported.type==="Identifier")p=a.imported.name;else p=String(a.imported.value??s);t.set(s,{from:i,imported:p})}}return t}function Rr(e,t){for(let n of t?.content.body??[]){if(n.type==="ImportDeclaration"){$t(e,n);continue}let r=n.type==="ExportNamedDeclaration"&&n.declaration?n.declaration:n;if(r.type==="FunctionDeclaration"&&r.id?.name)e.funcDecls.set(r.id.name,r)}}function St(e,t,n){if(he(t)===void 0)return;if(fn(e,t),e.props.has(t)){let r=e.props.get(t);e.props.set(t,{...r,...n})}else e.props.set(t,n)}function An(e,t,n,r){if(t.pendingCallDefault)e.pendingCallDefaultCandidates.push({propName:n,location:r,...t.pendingCallDefault});if(t.pendingConstDefault)e.pendingConstDefaultCandidates.push({propName:n,location:r,...t.pendingConstDefault})}var Wl=/[^\S\r\n]*[\r\n]\s*/g;function Ge(e,t,n=0){let r,i,a=!1;if(!t||typeof t!=="object"||!("type"in t))return{value:r,type:i,isFunction:a};let s=zs(e,t);if(t.type==="ObjectExpression"||t.type==="BinaryExpression"||t.type==="ArrayExpression"||t.type==="ArrowFunctionExpression"||t.type==="FunctionExpression"){let p=t;if("start"in p&&"end"in p&&typeof p.start==="number"&&typeof p.end==="number")r=z(e,p.start,p.end)?.replace(Sn," ");if(a=t.type==="ArrowFunctionExpression"||t.type==="FunctionExpression",t.type==="BinaryExpression")i=ve(e,t,n);else if(t.type==="ObjectExpression"||t.type==="ArrayExpression"){let{start:c,end:d}=p;i=Mr(t)?Jl(e,c,d,r):void 0}if(t.type==="ArrowFunctionExpression"||t.type==="FunctionExpression")i=Js(t),r=Ws(e,t)}else if(t.type==="UnaryExpression"){let p=t;if("start"in p&&"end"in p&&typeof p.start==="number"&&typeof p.end==="number")r=z(e,p.start,p.end);i=ve(e,p,n)}else if(t.type==="LogicalExpression"||t.type==="ConditionalExpression"||t.type==="SequenceExpression"){let{start:p,end:c}=t,d=p===void 0||c===void 0?void 0:z(e,p,c)?.replace(Wl," ");r=d!==void 0&&t.type==="SequenceExpression"?`(${d})`:d,i=ve(e,t,n)}else if(t.type==="NewExpression"){let p=t;if("start"in p&&"end"in p&&typeof p.start==="number"&&typeof p.end==="number")r=z(e,p.start,p.end);if(p.callee&&typeof p.callee==="object"&&"type"in p.callee&&p.callee.type==="Identifier"){let c=p.callee.name;if(c==="Date")i="Date";else if(c==="Map")i="Map<any, any>";else if(c==="Set")i="Set<any>";else if(c==="WeakMap")i="WeakMap<object, any>";else if(c==="WeakSet")i="WeakSet<object>";else if(c==="Array")i="any[]";else if(c==="RegExp"||c==="Regexp")i="RegExp";else if(c==="Error")i="Error";else i=c}}else if(t.type==="CallExpression"){let p=t;if("start"in p&&"end"in p&&typeof p.start==="number"&&typeof p.end==="number")r=z(e,p.start,p.end);let c=p.callee,d=c&&typeof c==="object"&&"type"in c&&c.type==="Identifier"?c.name:void 0;if((d==="$derived"||d==="$state")&&p.arguments.length===1&&n<5)return{...Ge(e,p.arguments[0],n+1),value:r,defaultValue:s};if(d){let u=Yl(e,d);if(u)return{value:r,type:void 0,isFunction:!1,defaultValue:s,resolvedType:u};if(e.funcDecls.has(d)||Ql(e,d))return{value:r,type:void 0,isFunction:!1,defaultValue:s,pendingCallDefault:{calleeName:d}};let y=e.valueImportBindingsByLocalName.get(d);if(y)return{value:r,type:void 0,isFunction:!1,defaultValue:s,pendingCallDefault:{calleeName:d,importSource:y.source,importedName:y.importedName}}}return{value:r,type:void 0,isFunction:!1,defaultValue:s,pendingCallDefault:{calleeName:d??Xl(e,c)}}}else if(t.type==="Identifier"){let p=t;if(n<5){let d=wn(e,p.name);if(d){let u=Ge(e,d,n+1),y=et(e,p.name);return{...u,resolvedType:y?.type??u.resolvedType,resolvedDescription:y?.description??u.resolvedDescription,resolvedParams:y?.params??u.resolvedParams,resolvedReturnType:y?.returnType??u.resolvedReturnType}}if(e.funcDecls.has(p.name)){let u=et(e,p.name),y=e.funcDecls.get(p.name);return{value:y?Ws(e,y):void 0,type:void 0,isFunction:!0,defaultValue:y?zs(e,y):void 0,resolvedType:u?.type??tu(u,y),resolvedDescription:u?.description,resolvedParams:u?.params,resolvedReturnType:u?.returnType}}}if("start"in p&&"end"in p&&typeof p.start==="number"&&typeof p.end==="number")r=z(e,p.start,p.end);let c=e.valueImportBindingsByLocalName.get(p.name);if(c)return{value:r,type:i,isFunction:a,defaultValue:s,pendingConstDefault:{importSource:c.source,importedName:c.importedName}}}else if(t.type==="MemberExpression"){let p=t;if("start"in p&&"end"in p&&typeof p.start==="number"&&typeof p.end==="number")r=z(e,p.start,p.end);if(pu(t))i="number";let c=Pn(e,t);if(c)return{value:r,type:i,isFunction:a,defaultValue:s,pendingConstDefault:{importSource:c.source,importedName:c.importedName,...c.members?{members:c.members}:{}}}}else if(t.type==="TemplateLiteral"){let p=t;if("start"in p&&"end"in p&&typeof p.start==="number"&&typeof p.end==="number")r=z(e,p.start,p.end);i="string"}else if("raw"in t&&typeof t.raw==="string")r=t.raw,i=jt(t);return{value:r,type:i,isFunction:a,defaultValue:s}}function jt(e){if("regex"in e&&e.regex)return"RegExp";if("bigint"in e&&e.bigint)return"bigint";return e.value==null?void 0:typeof e.value}var zl=new Set(["-","*","/","%","**","<<",">>",">>>","&","|","^"]),Kl=new Set(["==","!=","===","!==","<","<=",">",">=","in","instanceof"]);function ve(e,t,n){if(!t||typeof t!=="object"||!("type"in t))return;switch(t.type){case"UnaryExpression":{let r=t;if(r.operator==="!"||r.operator==="delete")return"boolean";if(r.operator==="typeof")return"string";if(r.operator==="void")return;if(r.operator==="+")return"number";return ve(e,r.argument,n)==="bigint"?"bigint":"number"}case"BinaryExpression":{let r=t;if(Kl.has(r.operator))return"boolean";let i=ve(e,r.left,n),a=ve(e,r.right,n);if(i==="bigint"&&a==="bigint")return"bigint";if(zl.has(r.operator))return"number";if(r.operator!=="+")return;if(i==="string"||a==="string")return"string";if(i==="number"&&a==="number")return"number";return}case"LogicalExpression":{let r=t;return Gs([ve(e,r.left,n),ve(e,r.right,n)])}case"ConditionalExpression":{let r=t;return Gs([ve(e,r.consequent,n),ve(e,r.alternate,n)])}case"SequenceExpression":{let r=t.expressions;return ve(e,r[r.length-1],n)}case"Identifier":{let r=t.name;if(r==="NaN"||r==="Infinity")return"number";if(r==="undefined")return;let i=Ze(e,r)?.type;if(i)return i;if(n>=5)return;return ve(e,wn(e,r),n+1)}default:{if(n>=5)return;let r=Ge(e,t,n+1);return r.type??r.resolvedType}}}function Gs(e){let t=new Set;for(let n of e){if(n===void 0)return;t.add(n.includes("=>")?`(${n})`:n)}return t.size===1?e[0]:[...t].join(" | ")}function Jl(e,t,n,r){if(r===void 0||t===void 0||n===void 0)return r;let i=e.parsed?.comments??[],a="",s=t;for(let p of i){if(p.start<t||p.end>n)continue;a+=z(e,s,p.start)??"",s=p.end}if(s===t)return r;return a+=z(e,s,n)??"",a.replace(Sn," ")}function Mr(e){if(!e||typeof e!=="object"||!("type"in e))return!1;switch(e.type){case"Literal":return!(("regex"in e)&&e.regex);case"TemplateLiteral":return e.expressions.length===0;case"Identifier":return e.name==="undefined";case"UnaryExpression":{let t=e,n=t.argument;return t.operator==="-"&&n?.type==="Literal"&&(typeof n.value==="number"||typeof n.value==="bigint")}case"ArrayExpression":return e.elements.every((t)=>t!==null&&Mr(t));case"ObjectExpression":return e.properties.every((t)=>t.type==="Property"&&t.kind==="init"&&!t.computed&&!t.method&&!t.shorthand&&(t.key.type==="Identifier"||t.key.type==="Literal")&&Mr(t.value));default:return!1}}function kn(e,t){let n=wn(e,t);if(!n||typeof n!=="object"||!("type"in n))return;if(n.type==="CallExpression"){let r=n,i=ye(e,r.callee);if(i==="$state"||i==="$state.raw"||i==="$derived"){let a=r.typeArguments?.params?.[0];if(a)return te(e,a),ye(e,a);if(i==="$state.raw")return Ge(e,r.arguments[0],1).type}}return Ge(e,n).type}function wn(e,t){for(let n of e.vars)for(let r of n.declarations)if(r.id&&typeof r.id==="object"&&"type"in r.id&&r.id.type==="Identifier"&&"name"in r.id&&r.id.name===t&&r.init)return r.init;return}function Et(e,t){for(let n of e.vars){if(n.kind!=="const")continue;for(let r of n.declarations)if(r.id&&typeof r.id==="object"&&"type"in r.id&&r.id.type==="Identifier"&&"name"in r.id&&r.id.name===t&&r.init)return r.init}return}function Xl(e,t){if(t&&typeof t==="object"&&"start"in t&&"end"in t&&typeof t.start==="number"&&typeof t.end==="number")return z(e,t.start,t.end)??"call";return"call"}function Yl(e,t){let n=et(e,t);if(n?.returnType)return n.returnType;let r=e.funcDecls.get(t)??Ks(e,t);if(!r)return;let i=eu(e,r);if(i)return i;let a=Zl(e,t);if(a)return a;let s=Xs(r);return s==="any"?void 0:s}function Ql(e,t){return Ks(e,t)!==void 0}function Ks(e,t){let n=wn(e,t);if(!n||typeof n!=="object"||!("type"in n))return;if(n.type==="ArrowFunctionExpression"||n.type==="FunctionExpression")return n;return}function Zl(e,t){for(let n of e.vars)for(let r of n.declarations){let i=r.id;if(!i||typeof i!=="object"||!("type"in i)||i.type!=="Identifier"||!("name"in i)||i.name!==t)continue;let s=i.typeAnnotation;if(s?.type!=="TSTypeAnnotation")return;let p=s.typeAnnotation;if(!p||typeof p.start!=="number"||typeof p.end!=="number")return;return Cs(z(e,p.start,p.end))}return}function eu(e,t){let n=t.returnType;if(n?.type!=="TSTypeAnnotation")return;let r=n.typeAnnotation;if(!r||typeof r.start!=="number"||typeof r.end!=="number")return;return z(e,r.start,r.end)}function tu(e,t){let n=e?.returnType??"any",r=e?.params;if(r&&r.length>0)return`(${Ye(r)}) => ${n}`;if(e?.returnType)return`() => ${n}`;if(t)return Js(t);return"(...args: any[]) => any"}function Js(e){return`(${nu(e)}) => ${Xs(e)}`}function nu(e){let t=e.params;if(!Array.isArray(t)||t.length===0)return"...args: any[]";let n=[];for(let r of t)if(r&&typeof r==="object"&&"type"in r&&r.type==="Identifier"&&"name"in r&&typeof r.name==="string")n.push(`${r.name}: any`);else return"...args: any[]";return n.join(", ")}function Xs(e){if(e.async||e.generator)return"any";let t=e.body,n;if(t&&typeof t==="object"&&"type"in t&&t.type==="BlockStatement"){if(n=ru(t),n.length===0)return"any"}else n=[t];let r=null;for(let i of n){let a=iu(i);if(!a)return"any";if(r===null)r=a;else if(r!==a)return"any"}return r??"any"}function ru(e){let t=[];return Or(e,t),t}function Or(e,t){if(!e||typeof e!=="object")return;let n=e;if(typeof n.type!=="string")return;if(n.type==="FunctionDeclaration"||n.type==="FunctionExpression"||n.type==="ArrowFunctionExpression")return;if(n.type==="ReturnStatement")t.push(n.argument??null);for(let r in n){if(r==="leadingComments")continue;let i=n[r];if(!i||typeof i!=="object")continue;if(Array.isArray(i))for(let a=0;a<i.length;a++)Or(i[a],t);else Or(i,t)}}function iu(e){if(!e||typeof e!=="object"||!("type"in e))return null;switch(e.type){case"Literal":{let t=e.value;if(typeof t==="string")return"string";if(typeof t==="number")return"number";if(typeof t==="boolean")return"boolean";return null}case"TemplateLiteral":return"string";case"CallExpression":{let t=e.callee;if(t&&typeof t==="object"&&"type"in t&&t.type==="Identifier"){let n=t.name;if(n==="String")return"string";if(n==="Number")return"number";if(n==="Boolean")return"boolean"}return null}default:return null}}function Ys(e){if(Me(e,"$bindable"))return{init:e.arguments[0],bindable:!0};return{init:e,bindable:!1}}function su(e,t){let n=t.params;if(!Array.isArray(n)||n.length===0)return"";let r=n[0],i=n[n.length-1];if(typeof r.start!=="number"||typeof i.end!=="number")return"";return z(e,r.start,i.end)??""}function Ws(e,t){if(t.generator)return;let n=t.body;if(!n||typeof n!=="object"||!("type"in n))return;let r=su(e,t),i=t.async?"async ":"",a=(p,c)=>p&&typeof p==="object"&&("type"in p)&&p.type==="ObjectExpression"?`(${c})`:c;if(n.type!=="BlockStatement"){let p=ye(e,n);return p===void 0?void 0:`${i}(${r}) => ${a(n,p)}`}let s=n.body;if(s.length===0)return`${i}(${r}) => {}`;if(s.length===1){let p=s[0];if(p&&typeof p==="object"&&"type"in p&&p.type==="ReturnStatement"){let c=p.argument;if(c){let d=ye(e,c);if(d!==void 0)return`${i}(${r}) => ${a(c,d)}`}}}return}function zs(e,t){let n=ye(e,t);if(!n||!t||typeof t!=="object"||!("type"in t))return;let r="expression";if(t.type==="Literal"||t.type==="UnaryExpression")r="literal";else if(t.type==="TemplateLiteral")r=t.expressions.length===0?"literal":"expression";else if(t.type==="ArrayExpression")r="array";else if(t.type==="ObjectExpression")r="object";else if(t.type==="ArrowFunctionExpression"||t.type==="FunctionExpression"||t.type==="FunctionDeclaration")r="function";let i={raw:n,kind:r};if(r==="literal"||r==="array"||r==="object"){let a=Br(t);if(a.ok)i.value=a.value}return i}function Br(e){if(!e||typeof e!=="object"||!("type"in e))return{ok:!1};if(e.type==="Literal"){let t=e.value;return typeof t==="bigint"||"regex"in e?{ok:!1}:{ok:!0,value:t}}if(e.type==="UnaryExpression"){let t=e,n=t.argument;if(!n||typeof n!=="object"||!("type"in n)||n.type!=="Literal")return{ok:!1};let r=n.value;if(typeof r==="number"){if(t.operator==="-")return{ok:!0,value:-r};if(t.operator==="+")return{ok:!0,value:r}}if(typeof r==="boolean"&&t.operator==="!")return{ok:!0,value:!r};return{ok:!1}}if(e.type==="TemplateLiteral"){let t=e;if(t.expressions.length>0||t.quasis.length!==1)return{ok:!1};return{ok:!0,value:t.quasis[0].value.cooked??t.quasis[0].value.raw}}if(e.type==="ArrayExpression"){let t=e,n=[];for(let r of t.elements){if(!r)return{ok:!1};let i=Br(r);if(!i.ok)return{ok:!1};n.push(i.value)}return{ok:!0,value:n}}if(e.type==="ObjectExpression"){let t=e,n={};for(let r of t.properties){if(r.type!=="Property"||r.computed)return{ok:!1};let i=ie(r.key);if(!i)return{ok:!1};let a=Br(r.value);if(!a.ok)return{ok:!1};n[i]=a.value}return{ok:!0,value:n}}return{ok:!1}}var au=new Set(["POSITIVE_INFINITY","NEGATIVE_INFINITY","MAX_VALUE","MIN_VALUE","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","EPSILON","NaN"]),ou=new Set(["PI","E","LN2","LN10","LOG2E","LOG10E","SQRT2","SQRT1_2"]);function pu(e){if(!e||typeof e!=="object"||!("type"in e))return!1;if(e.type!=="MemberExpression")return!1;let t=e,n=t.object&&"name"in t.object?t.object.name:void 0,r=t.property&&"name"in t.property?t.property.name:void 0;if(!n||!r)return!1;if(n==="Number")return au.has(r);if(n==="Math")return ou.has(r);return!1}function oe(e,t,n){if(!t||e.has(t))return;e.set(t,n)}function Ht(e,t){for(let n=e.activeScopes.length-1;n>=0;n-=1){let r=e.activeScopes[n]?.get(t);if(!r)continue;return r.kind==="prop"?r.publicPropName:void 0}return}function qt(e,t){for(let n=e.activeScopes.length-1;n>=0;n-=1){let r=e.activeScopes[n];if(r===e.componentScope)return!1;if(r?.has(t))return!0}return!1}function Nn(e,t){let n=t;while(bt(n))n=n.object;return Y(n)&&qt(e,n.name)}function Q(e,t=new Set){if(!e||typeof e!=="object"||!("type"in e))return t;switch(e.type){case"Identifier":t.add(e.name);break;case"AssignmentPattern":Q(e.left,t);break;case"ArrayPattern":for(let n of e.elements)Q(n??void 0,t);break;case"ObjectPattern":for(let n of e.properties)if(n.type==="Property")Q(n.value,t);else if(n.type==="RestElement")Q(n.argument,t);break;case"RestElement":Q(e.argument,t);break}return t}function $r(e,t){if(!t||typeof t!=="object"||!("type"in t))return;if(t.type==="Identifier"){let r=Ht(e,t.name);if(r)e.reactive_vars.add(r);return}let n=Q(t);for(let r of n){let i=Ht(e,r);if(i)e.reactive_vars.add(i)}}function Ut(e){if(!e||typeof e!=="object"||!("type"in e))return!1;switch(String(e.type)){case"BlockStatement":case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"CatchClause":case"EachBlock":case"AwaitBlock":return!0;default:return!1}}function Qs(e){if(!e||typeof e!=="object"||!("type"in e))return!1;let t=String(e.type);return t==="FunctionDeclaration"||t==="FunctionExpression"||t==="ArrowFunctionExpression"}function cu(e,t){let n=e.scopeDeclarations.get(t);if(!n)n=new Map,e.scopeDeclarations.set(t,n);return n}function lu(e){let t=[];if(e.id.type==="Identifier")return t.push({kind:"local",name:e.id.name}),t;if(e.id.type!=="ObjectPattern")return t;for(let n of e.id.properties){if(n.type==="RestElement"){if(n.argument.type==="Identifier")t.push({kind:"local",name:n.argument.name});continue}if(n.computed)continue;let r=ie(n.key);if(!r)continue;let i;if(n.value.type==="Identifier")i=n.value.name;else if(n.value.type==="AssignmentPattern"&&n.value.left.type==="Identifier")i=n.value.left.name;if(!i)continue;t.push({kind:"prop",name:i,publicPropName:r})}return t}function Fr(e,t,n,r){if(!vs(e))return;let i=r?.allowRunesProps??!1,a=r?.forceProp??!1,s=e;for(let p of s.declarations){if(i&&Me(Xe(p.init),"$props")){for(let u of lu(p))oe(u.kind==="prop"?t:n,u.name,u.kind==="prop"?{kind:"prop",publicPropName:u.publicPropName}:{kind:"local"});continue}let c=s.kind==="var"?n:t,d=a?"prop":"local";for(let u of Q(p.id))oe(c,u,d==="prop"?{kind:"prop",publicPropName:u}:{kind:"local"})}}function uu(e,t){if("id"in e&&e.id&&typeof e.id==="object"&&"name"in e.id&&typeof e.id.name==="string")oe(t,e.id.name,{kind:"local"});for(let n of e.params)for(let r of Q(n))oe(t,r,{kind:"local"})}function du(e,t,n){if(!Array.isArray(e))return;for(let r of e){if(!r||typeof r!=="object"||!("type"in r))continue;switch(r.type){case"VariableDeclaration":Fr(r,t,n);break;case"FunctionDeclaration":if(r.id?.name)oe(t,r.id.name,{kind:"local"});break;case"ClassDeclaration":if(r.id?.name)oe(t,r.id.name,{kind:"local"});break}}}function fu(e,t){for(let{local:n,exported:r}of t){if(n.type!=="Identifier")continue;let i=r.type==="Identifier"?r.name:String(r.value);if(e.componentScope.get(n.name)?.kind==="prop")continue;e.componentScope.set(n.name,{kind:"prop",publicPropName:i})}}function hu(e,t){for(let n of t?.content.body??[])switch(n.type){case"ImportDeclaration":for(let r of n.specifiers)if(r.local.name)oe(e.componentScope,r.local.name,{kind:"local"});break;case"VariableDeclaration":Fr(n,e.componentScope,e.componentScope,{allowRunesProps:!0});break;case"FunctionDeclaration":if(n.id?.name)oe(e.componentScope,n.id.name,{kind:"local"});break;case"ClassDeclaration":if(n.id?.name)oe(e.componentScope,n.id.name,{kind:"local"});break;case"ExportNamedDeclaration":if(!n.declaration){if(n.source==null)fu(e,n.specifiers);break}if(n.declaration.type==="VariableDeclaration")Fr(n.declaration,e.componentScope,e.componentScope,{forceProp:!0});else if(n.declaration.type==="FunctionDeclaration"&&n.declaration.id?.name)oe(e.componentScope,n.declaration.id.name,{kind:"prop",publicPropName:n.declaration.id.name});break}}function Zs(e){e.componentScope.clear(),e.scopeDeclarations=new Map,e.activeScopes.length=0,hu(e,e.parsed?.instance)}function ea(e){return{varScopeStack:[e.componentScope]}}function ta(e,t,n){if(!Ut(n))return;let r=cu(e,n),i=t.varScopeStack[t.varScopeStack.length-1]??e.componentScope;switch(n.type){case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":uu(n,r);break;case"BlockStatement":du(n.body,r,i);break;case"CatchClause":for(let a of Q(n.param))oe(r,a,{kind:"local"});break;case"EachBlock":for(let a of Q(n.context))oe(r,a,{kind:"local"});if(typeof n.index==="string")oe(r,n.index,{kind:"local"});break;case"AwaitBlock":for(let a of Q(n.value))oe(r,a,{kind:"local"});for(let a of Q(n.error))oe(r,a,{kind:"local"});break}if(Qs(n))t.varScopeStack.push(r);return r}function na(e,t){if(Qs(t))e.varScopeStack.pop()}function Vr(e,t){let n=Ze(e,t);if(n&&n.type===e.explicitVariableTypesByName.get(t))te(e,e.explicitVariableTypeNodesByName.get(t));return n}function Dn(e,t,n=!0){let r=Vr(e,t);if(r||!n)return r;let i=kn(e,t);return i?{type:i,...Ms(e,t)}:null}function mu(e,t,n){if(!Y(t))return null;let r=Et(e,t.name);if(Te(r))return ca(e,r,n).properties;let i=Dn(e,t.name);return i?qe(i.type):null}function yu(e,t){return e.properties.some((n)=>n.type==="Property"&&n.kind==="get"&&ie(n.key)===t)}function ra(e,t,n){if(!t||typeof t!=="object"||!(n in t))return;let r=t[n];if(!r||typeof r!=="object"||!("typeAnnotation"in r))return;return ye(e,r.typeAnnotation)}function gu(e){let t=e?.body.body;if(t?.length!==1||t[0].type!=="ReturnStatement")return;return t[0].argument??void 0}function xu(e,t,n,r,i){if(Y(i)){let a=Dn(e,i.name);if(a)return a;return G(e,"context-any-type",n,`Context "${t}" property "${n}" has no type annotation; defaulted to "any".`,H(e,r)),{type:"any"}}if(i?.type==="ArrowFunctionExpression"||i?.type==="FunctionExpression")return{type:`(${i.params.map((s)=>`${Y(s)?s.name||"arg":"arg"}: any`).join(", ")}) => any`};if(pt(i))return{type:jt(i)??"null"};return{type:"any"}}function ca(e,t,n){let r=[],i=!1;for(let a of t.properties){if(a.type==="SpreadElement"){let u=mu(e,a.argument,n);if(u)r.push(...u);else i=!0,G(e,"spread-unresolved",n,`Context "${n}" spreads a value sveld can't resolve; its shape is widened to "Record<string, any>".`,H(e,a));continue}if(a.type!=="Property")continue;let s=ie(a.key);if(!s)continue;if(a.kind==="set"&&yu(t,s))continue;let p=a.kind==="get"||a.kind==="set"?a.value:void 0,c=p?a.kind==="get"?ra(e,p,"returnType"):ra(e,p.params[0],"typeAnnotation"):void 0,d=c?{type:c}:xu(e,n,s,a,a.kind==="get"?gu(p):a.kind==="set"?void 0:a.value);r.push({name:s,type:d.type,description:d.description,optional:!1,...d.internal?{internal:!0}:{}})}return{properties:r,hasUnresolvedSpread:i}}function ia(e,t,n){let{properties:r,hasUnresolvedSpread:i}=ca(e,t,n);return{key:n,typeName:vn(n),properties:r,description:void 0,...i?{hasUnresolvedSpread:i}:{}}}function sa(e,t,n){if(Te(t))return ia(e,t,n);else if(Y(t)){let r=t.name,i=Dn(e,r,!1),a=i?void 0:Et(e,r);if(Te(a))return ia(e,a,n);let s=i??Dn(e,r);if(s){let p=qe(s.type);return{key:n,typeName:vn(n),...p?{}:{type:s.type},properties:p??[],description:s.description,...s.internal?{internal:!0}:{}}}return G(e,"context-any-type",r,`Context "${n}" variable "${r}" has no type annotation; defaulted to "any".`,H(e,t)),{key:n,typeName:vn(n),type:"any",properties:[]}}return null}function aa(e){let t=e.callee;if(!t||typeof t!=="object"||!("type"in t))return null;let n=t.type==="Identifier"&&t.name==="Symbol",r=t.type==="MemberExpression"&&!t.computed&&t.object.type==="Identifier"&&t.object.name==="Symbol"&&t.property.type==="Identifier"&&t.property.name==="for";if(!n&&!r)return null;let i=e.arguments[0];if(!i||typeof i!=="object"||!("type"in i))return"";if(i.type==="Literal"&&typeof i.value==="string")return i.value;if(i.type==="TemplateLiteral"&&i.quasis?.length===1)return i.quasis[0].value.cooked??"";return""}function oa(e){return{kind:"pending",importSource:e.source,importedName:e.importedName,...e.members?{members:e.members}:{}}}function la(e,t,n=0){if(!t||typeof t!=="object"||!("type"in t))return{kind:"unresolved"};let r=t;if(r.type==="Literal"||r.type==="TemplateLiteral"){let i=Es(r);return i==null?{kind:"unresolved"}:{kind:"resolved",key:i}}if(r.type==="CallExpression"||r.type==="NewExpression"){let i=aa(r);return i==null?{kind:"unresolved"}:{kind:"resolved",key:i}}if(r.type==="Identifier"){if(n>=5)return{kind:"unresolved"};let i=Et(e,r.name);if(i&&typeof i==="object"&&"type"in i){let s=i;if((s.type==="CallExpression"||s.type==="NewExpression")&&aa(s)==="")return{kind:"resolved",key:r.name};return la(e,s,n+1)}let a=n===0&&qt(e,r.name)?void 0:e.valueImportBindingsByLocalName.get(r.name);return a?oa(a):{kind:"unresolved"}}if(r.type==="MemberExpression"){let i=n===0&&Nn(e,r)?void 0:Pn(e,r);if(i)return oa(i)}return{kind:"unresolved"}}function pa(e,t,n,r,i){let a=ye(e,r)??"";G(e,"context-value-unresolved",t,`setContext(${n}, ${a}): the value isn't an object literal or a variable, so sveld can't describe its shape; the context is skipped.`,i)}function ua(e,t){if(!t||typeof t!=="object"||!("type"in t)||t.type!=="CallExpression")return;let n=t,r=n.arguments[0];if(!r)return;let i=la(e,r);if(i.kind==="unresolved"||i.kind==="resolved"&&!i.key){let d=ye(e,r)??"";G(e,"context-key-unresolved",d,`setContext key \`${d}\` isn't a string literal, const-bound string, Symbol(), or imported \`export const\` string; the context is skipped.`,H(e,t));return}let a=n.arguments[1];if(!a)return;let s=H(e,t);if(i.kind==="pending"){let d=Vt(i),u=sa(e,a,d);if(u)e.pendingContextKeyCandidates.push({importSource:i.importSource,importedName:i.importedName,...i.members?{members:i.members}:{},...u.type===void 0?{}:{type:u.type},properties:u.properties,description:u.description,...u.hasUnresolvedSpread?{hasUnresolvedSpread:!0}:{},...u.internal?{internal:!0}:{},source:s});else pa(e,d,d,a,s);return}let p=i.key,c=sa(e,a,p);if(!c){pa(e,p,JSON.stringify(p),a,s);return}if(e.contexts.has(p)){G(e,"context-duplicate-key",p,`setContext("${p}", ...) was called more than once; only the first call's shape is used.`,s);return}e.contexts.set(p,{...c,source:s})}var bu=new Set(["Component","SvelteComponent","SvelteSelf"]),Tu=new Set(["RegularElement","SvelteElement"]);function Gt(e){return bu.has(e)}function Wt(e){return Tu.has(e)}var vu=/\n/g,Su=/^[A-Za-z_$][\w$]*$/;function jr(e,t){return{variableType:(n)=>{if(t?.has(n))return;return Vr(e,n)?.type??kn(e,n)}}}function zt(e,t,n){if(!t||typeof t!=="object"||!("type"in t))return n;if(Y(t)){if(!qt(e,t.name))return n;let i=n??new Set;return i.add(t.name),i}let r=n;if(Te(t)){for(let i of t.properties)if(i.type==="Property")r=zt(e,i.value,r)}else if(t.type==="ArrayExpression")for(let i of t.elements)r=zt(e,i,r);return r}function Hr(e,t){if(Y(t))return e.variableType(t.name);return Eu(e,t)}function Eu(e,t){if(!t||typeof t!=="object"||!("type"in t))return;if(Te(t))return fa(e,t);if(t.type==="ArrayExpression")return ha(e,t);return}function da(e,t){if(!t||typeof t!=="object"||!("type"in t))return"any";if(Y(t))return e.variableType(t.name)??"any";if(pt(t))return jt(t)??"null";if(Te(t))return fa(e,t);if(t.type==="ArrayExpression")return ha(e,t);return"any"}function fa(e,t){if(t.properties.length===0)return"Record<string, never>";let n=[],r=!1;for(let i of t.properties){let a=i.type==="Property"&&!i.computed?ie(i.key):void 0;if(i.type!=="Property"||!a){r=!0;continue}n.push({name:a,type:da(e,i.value)})}if(!r)return Kt(n);if(n.length===0)return"Record<string, any>";return Kt([...n,{name:"[key: string]",type:"any"}])}function ha(e,t){let n=new Set(t.elements.filter((r)=>r!=null).map((r)=>da(e,r)));if(n.size===0)return"any[]";if(n.size===1)return`${[...n][0]}[]`;return`(${[...n].join(" | ")})[]`}function ma(e,t){for(let[n,r]of e.arguments.entries()){if(Y(r)&&r.name===t)return{argumentIndex:n};if(!Te(r))continue;for(let i of r.properties){if(i.type!=="Property"||!Y(i.value))continue;if(i.value.name!==t)continue;let a=!i.computed&&Y(i.key)?i.key.name:void 0;return{argumentIndex:n,property:a??""}}}return}function qr(e){return typeof e==="string"?JSON.stringify(e):String(e)}function tt(e,{name:t,detail:n,has_argument:r,description:i,deprecated:a,tags:s,internal:p,source:c}){if(t===void 0)return;let d=!r&&!n?"null":he(n),u=i,y=e.events.get(t);if(y?.type==="forwarded")e.events.set(t,{type:"dispatched",name:t,detail:d,description:u||y.description,deprecated:a??y.deprecated,tags:s??y.tags,...p||y.internal?{internal:!0}:{},source:c||y.source});else if(y){let x=y.tags??s,g=e.untypedJsDocEventNames.delete(t);e.events.set(t,{...y,detail:y.detail===void 0||g?d:y.detail,description:y.description||u,deprecated:y.deprecated??a,tags:x,...y.internal||p?{internal:!0}:{},source:c||y.source})}else e.events.set(t,{type:"dispatched",name:t,detail:d,description:u,deprecated:a,tags:s,...p?{internal:!0}:{},source:c})}function ya(e,t){let n=t.arguments[0],r=yr(n,"CustomEvent");if(!r&&!yr(n,"Event"))return;let i=n.arguments[0],a=pt(i)?i.value:void 0;if(a==null)return;let s=r?n.arguments[1]:void 0,p=!1,c;if(Te(s)){let d=s.properties.find((u)=>u.type==="Property"&&Y(u.key)&&u.key.name==="detail");if(d?.type==="Property")p=!0,c=d.value}return{name:String(a),detail:c,hasArgument:p,nestedBoundNames:zt(e,c),source:H(e,t)}}function ga(e,t){let n=Hr(jr(e,t.nestedBoundNames),t.detail),r=n===void 0&&pt(t.detail)?t.detail.value:void 0;tt(e,{name:t.name,detail:n??(r==null?"":qr(r)),has_argument:t.hasArgument,source:t.source})}function Kt(e,t,n=!1){if(e.length===0)return"null";let r=e.map(({name:i,type:a,description:s,optional:p,default:c})=>{let d=p?"?":"",u=Su.test(i)||i.startsWith("[")?i:JSON.stringify(i),y=s||"";if(c&&y)y=`${y} @default ${c}`;else if(c)y=`@default ${c}`;if(y=Ve(y),y){if(n)return`${y.includes(`
10
17
  `)?`/**
11
18
  ${y.split(`
12
- `).map((b)=>b?` * ${b}`:" *").join(`
19
+ `).map((g)=>g?` * ${g}`:" *").join(`
13
20
  `)}
14
21
  */`:`/** ${y} */`}
15
- ${u}${d}: ${o};`;return`/** ${y.replace(Ll," ")} */ ${u}${d}: ${o};`}return`${u}${d}: ${o};`}).join(n?`
22
+ ${u}${d}: ${a};`;return`/** ${y.replace(vu," ")} */ ${u}${d}: ${a};`}return`${u}${d}: ${a};`}).join(n?`
16
23
  `:" ");return n?`{
17
24
  ${r}
18
- }`:`{ ${r} }`}var Ol=/^[A-Za-z_$][\w$]*/,Bl=/[A-Za-z_$][\w$]*/g,ua=/^(?:const|in|out)\s+/;function lt(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let o=e[i];if(o==="<"||o==="("||o==="["||o==="{")n++;else if(o===">"||o===")"||o==="]"||o==="}")n=Math.max(n-1,0);else if(o===","&&n===0)t.push(e.slice(r,i)),r=i+1}return t.push(e.slice(r)),t}function da(e){let t=lt(e).map((r)=>r.trim()).filter((r)=>r.length>0);if(t.length===0)return null;return[t.map((r)=>{let i=r;while(ua.test(i))i=i.replace(ua,"");return i.match(Ol)?.[0]??r}).join(", "),t.join(", ")]}function fa(e,t,n){let r=e.scriptGenericsAttribute?.value;if(!r)return;for(let[i]of r.matchAll(Bl)){if(e.typeImportBindingsByLocalName.has(i))t.add(i);if(n.has(i))continue;let o=e.localTypeDeclarationsByName.get(i);if(!o)continue;n.add(i),Ie(e,o.node,t,n)}}var Fl=null;function $l(e,t,n){let r={value:void 0,replace:!1};if(!n||typeof n!=="object"||!("type"in n))return r;if(n.type==="Identifier")r.value=n.name,r.replace=!0;else if(n.type==="Literal")r.value=String(n.value);else if(n.type==="MemberExpression")r.value=Fn(e,t,n);else if((n.type==="ObjectExpression"||n.type==="TemplateLiteral")&&"start"in n&&"end"in n&&typeof n.start==="number"&&typeof n.end==="number")r.value=le(e,n.start,n.end);return r}function Vl(e,t,n){if(!ye(n))return null;let r=Kt(e,n.name);if(Ke(r))return Jr(e,t,r).slot_props;let i=t.findVariableTypeAndDescription(n.name);if(!i)return null;let o=pn(i.type);if(!o)return null;let s={};for(let c of o)s[c.name]={value:c.type,replace:!1};return s}function Jr(e,t,n){let r={},i=!1;for(let o of n.properties){if(o.type==="SpreadElement"){let c=Vl(e,t,o.argument);if(c)Object.assign(r,c);else i=!0,pe(e,"spread-unresolved","slot_props",`Slot props spread a value sveld can't resolve; its shape is widened to "Record<string, any>".`,oe(e,o));continue}if(o.type!=="Property"||o.computed)continue;let s=t.getPropertyName(o.key);if(!s)continue;r[s]=$l(e,t,o.value)}return{slot_props:r,hasUnresolvedSpread:i}}function jl(e,t){if(!t||typeof t!=="object"||!("type"in t))return null;if(t.type==="Identifier"){let o=t,s=e.propLocalToPublicName.get(o.name);if(!s)return null;return{publicName:s,trackingName:o.name}}if(t.type!=="MemberExpression")return null;let n=t,r=n.object&&typeof n.object==="object"&&"type"in n.object&&n.object.type==="Identifier"?n.object.name:void 0;if(!r||!e.wholePropsLocals.has(r))return null;let i;if(!n.computed&&n.property&&typeof n.property==="object"&&"type"in n.property){if(n.property.type==="Identifier")i=n.property.name;else if(n.property.type==="Literal"&&n.property.value!=null)i=String(n.property.value)}else if(n.computed&&n.property&&typeof n.property==="object"&&"type"in n.property&&n.property.type==="Literal"&&"value"in n.property&&n.property.value!=null)i=String(n.property.value);if(!i)return null;return{publicName:i,trackingName:i}}function ha(e,t){let n=t;if(n&&typeof n==="object"&&"type"in n&&n.type==="ChainExpression")n=n.expression;if(!n||typeof n!=="object"||!("type"in n)||n.type!=="CallExpression")return null;let r=n;if(!r.callee||typeof r.callee!=="object"||!("type"in r.callee))return null;let i=jl(e,r.callee);if(!i)return null;return{...i,arguments:r.arguments}}function bn(e,{slot_name:t,slot_props:n,slot_props_unresolved_spread:r,slot_fallback:i,slot_description:o,slot_deprecated:s,slot_tags:c,slot_internal:l,source:d}){let u=t===void 0||t==="",y=u?Fl:t??"",g=ze(i),b=n===void 0||n===""?void 0:n,P=o?.trim()||void 0;if(e.slots.has(y)){let N=e.slots.get(y);if(N)e.slots.set(y,{...N,default:N.default??u,fallback:g,slot_props:N.slot_props===void 0?b:N.slot_props,slot_props_unresolved_spread:N.slot_props_unresolved_spread||r,description:N.description||P,deprecated:N.deprecated??s,tags:N.tags||c,...N.internal||l?{internal:!0}:{},source:d||N.source})}else e.slots.set(y,{name:y,default:u,fallback:g,slot_props:b,slot_props_unresolved_spread:r,description:P,deprecated:s,tags:c,...l?{internal:!0}:{},source:d})}var Hl=/\s*=\s*/;function ql(e){let t=e.indexOf("<");if(t===-1||!e.endsWith(">"))return e;let n=e.slice(0,t),r=e.slice(t+1,-1),i=lt(r).map((o)=>o.trim().replace(Hl," = ")).join(", ");return`${n}<${i}>`}var Ul=/\s/;function Zr(e,t,n){let r=t;while(r<n){let i=e[r];if(i==="/"&&e[r+1]==="/"){let o=e.indexOf(`
19
- `,r+2);if(o===-1||o>=n)return!0;r=o+1}else if(i==="/"&&e[r+1]==="*"&&e[r+2]!=="*"){let o=e.indexOf("*/",r+2);if(o===-1||o+2>n)return!1;r=o+2}else if(i===" "||i===`
20
- `||i==="\t"||i==="\r"||Ul.test(i))r++;else return!1}return!0}var Gl=/;$/,Wl=/^-\s*/;function ei(e){let t=[],n,r=!1;for(let i of e){let o=$n(i);if(n!==void 0){if(o)t.push(i.trim()),n=void 0;else t.push(i.slice(Math.min(n,cn(i))).trimEnd());continue}let s=i.trim();if(s===""){r=t.length>0;continue}if(r)t.push("");if(r=!1,t.push(s),o)n=cn(i)}return t.join(`
21
- `).trimEnd()}function Pt(e){if(e===void 0)return;let t=e.replace(Wl,"").trim();return t===""?"":t}function ga(e){let t=e.name?`${e.name} ${e.description}`:e.description;return Pt(ei(t.split(`
22
- `)))}var Kl=new Set(["restProps","slot","snippet","event","typedef","callback"]),Xr=new Set(["property","type"]),zl=new Set(["slot","snippet","typedef","callback"]);function Jn(e){if(!e||e.length===0)return;return e[xa(e)].content}function xa(e){let t=0;while(e[t+1]?.continuesType)t++;return t}function ma(e){return!e||!e.tag&&!e.continuesType&&e.content.trim()===""}function Jl(e){return e.text.split(`
23
- `).length===e.lines.length}function Yr(e,t){if(t<=0)return e;return e.split(`
24
- `).slice(0,-t).join(`
25
- `).trimEnd()}var ba=new Set(["since","example","see"]),Xl=new Set(["bindable","default","required"]);function Yl(e){return e.length>0?e.map((t)=>({name:t.tag,body:t.text})):void 0}function Qr(e){let t=e.trim();return t===""?!0:t}function Ql(e){let t=e.trim().replace(Gl,"").trimEnd();if(!t.startsWith("{")||!t.endsWith("}"))return!1;let n=0,r=null;for(let i=0;i<t.length;i++){let o=t[i];if(r!==null){if(o==="\\"){i++;continue}if(o===r)r=null;continue}if(o==='"'||o==="'"||o==="`"){r=o;continue}if(o==="{"||o==="["||o==="(")n++;else if(o==="}"||o==="]"||o===")"){if(n--,n===0&&i<t.length-1)return!1}}return n===0}function Zl(e){let t=e;if(!t.startsWith("/*"))t=`/*${t}`;if(!t.endsWith("*/"))t+="*/";return t}var eu=new Set(["type","param","returns","return","extends","extendProps","restProps","slot","snippet","event","typedef","callback","bindable","deprecated","ignore","internal","csspart","cssprop","cssproperty"]);function ti(e,t){let n=e.parsedJsDocByText.get(t);if(n===void 0)n=Dr(t),e.parsedJsDocByText.set(t,n);return n}function ni(e){let t=e[0]?.tags??[],n,r=[],i,o,s,c=!1,l=[],d=[],u=[];for(let y of t)if(y.tag==="type")n=y;else if(y.tag==="param")r.push(y);else if(y.tag==="returns"||y.tag==="return")i=y;else if(y.tag==="deprecated")s??=Qr(y.text);else if(y.tag==="ignore"||y.tag==="internal")c=!0;else if(y.tag==="sveld-ignore")u.push(y.name);else if(ba.has(y.tag))d.push(y);else if(y.tag==="bindable"){if(y.type)continue;let g=`${y.name}${y.description?` ${y.description}`:""}`.trim();if(g==="readonly"||g==="writable")o??=g}else if(!eu.has(y.tag))l.push(y);return{type:n,param:r,returns:i,binding:o,deprecated:s,internal:c,additional:l,passthrough:d,ignore:u,description:e[0]?.description}}function tu(e,t){if(typeof t.start!=="number"||typeof t.end!=="number")return;let n=e.jsDocBlocksByStart.get(t.start);if(n===void 0||n.end!==t.end)return;return[n]}function nu(e){if(!e||e.length===0)return;let t=e[e.length-1];return t&&typeof t==="object"&&"value"in t?t:void 0}function Ta(e,t,n){if(!t||t.length===0||n===void 0||!e.source)return;for(let r=t.length-1;r>=0;r--){let i=t[r];if(!i||typeof i!=="object"||!("value"in i)||!("end"in i))continue;if(typeof i.end!=="number"||!("start"in i)||typeof i.start!=="number")continue;if("type"in i&&i.type==="Line"||!String(i.value).startsWith("*"))continue;if(Zr(e.source,i.end,n))return i}return}function ru(e){let t=new Set,n=(i)=>{let{leadingComments:o,start:s}=i,c=Ta(e,o,s);if(c)t.add(c.start)};for(let i of e.funcDecls.values())n(i);let r=[{root:e.parsed?.module,isModule:!0},{root:e.parsed?.instance,isModule:!1}];for(let{root:i,isModule:o}of r)for(let s of(i&&St(i))??[]){let c=s,l=c.type==="ExportNamedDeclaration",d=l?c.declaration:c;if(d?.type==="FunctionDeclaration"){if(l)n(c)}else if(d?.type==="ClassDeclaration"&&o){n(l?c:d);for(let u of d.body?.body??[])if(u.type==="MethodDefinition")n(u)}else if(d?.type==="VariableDeclaration"&&(o||!l||d.kind==="const")&&d.declarations?.length===1&&iu.has(d.declarations[0].init?.type??""))n(c)}return t}var iu=new Set(["ArrowFunctionExpression","FunctionExpression"]);function Ue(e,t,n){if(!n?.leadingComments)return;let r=Ta(e,n.leadingComments,n.start);if(!r)return;return uu(e,t,[r])}function Ea(e,t,n){if(!n?.leadingComments)return;return Ue(e,t,n)}function su(e,t,n){let r=e;if(t)r=`${e} extends ${t}`;if(n)r+=` = ${n}`;return r}var au=/^[^\s,]+/,ya=/^\s*,\s*([^\s,]+)/;function Ca(e,t){let n=e.optional?e.name:au.exec(e.name)?.[0];if(!n)return[];let r=[{name:n,constraint:su(n,t,e.default)}],i=`${e.optional?"":e.name.slice(n.length)} ${e.description}`;for(let o=ya.exec(i);o;o=ya.exec(i))r.push({name:o[1],constraint:o[1]}),i=i.slice(o[0].length);return r}var ou=/[\w$]+/g,cu=new Set(["property","param","returns","return"]);function pu(e,t,n){let r=[e[t].type];for(let o=t+1;cu.has(e[o]?.tag);o++)r.push(e[o].type);let i=new Set(r.join(" ").match(ou));return n.some(({name:o})=>i.has(o))}function lu(e){let t=e?.trim();return!t||t==="object"||t==="Object"}function uu(e,t,n){if(!n)return;let r=nu(n);if(!r)return;let i=tu(e,r)??ti(e,Zl(r.value)),{type:o,param:s,returns:c,binding:l,deprecated:d,internal:u,additional:y,passthrough:g,ignore:b,description:P}=ni(i),N,D,j,U;if(o)N=t.aliasType(o.type);if(s.length>0)D=s.filter((G)=>!G.name.includes(".")).map((G)=>({name:G.name,type:t.aliasType(G.type),description:Pt(ei(G.description.split(`
26
- `))),optional:G.optional||!1}));if(c)j=t.aliasType(c.type);let v,w=y;if(typeof r.start==="number"&&e.functionDocCommentStarts.has(r.start)){let G=y.filter((X)=>X.tag==="template"&&X.name);if(G.length>0)v=G.flatMap((X)=>Ca(X,t.aliasType(X.type))).map(({constraint:X})=>X).join(", "),w=y.filter((X)=>X.tag!=="template")}let M=ze(P?.trim());if(M||w.length>0){let G=[];if(M)G.push(M);for(let X of w)G.push(`@${X.tag}${X.text?` ${X.text}`:""}`);U=G.join(`
27
- `)}return{type:N,params:D,returnType:j,description:U,binding:l,deprecated:d,tags:Yl(g),sveldIgnore:b.length>0?b:void 0,internal:u,typeParameters:v}}function Sa(e,t,n=e.source){if(!n)return;let r=!1,i=!1,o=!1,s=new Set,c=()=>{if(r&&i&&!o){o=!0;let P=e.componentFilePath?` in ${e.componentFilePath}`:"";console.warn(`Warning: Both @generics and @template tags are used to declare component generics${P}; their declarations are combined in the order encountered.`)}},l=(P,N)=>{if(s.has(P))pe(e,"generics-conflict",P,`Duplicate generic name "${P}".`,N);else s.add(P)},d=(P,N)=>{if(e.generics){let j=lt(e.generics[0]).map((U)=>U.trim()).indexOf(P.trim());if(j!==-1){let U=lt(e.generics[1]).map((v)=>v.trim());U[j]=N,e.generics=[e.generics[0],U.join(", ")];return}}t.accumulateGeneric(P,N)},u=(P,N)=>{if(e.typedefs.has(P))pe(e,"typedef-duplicate",P,`Duplicate typedef/callback name "${P}"; the later declaration overwrites the earlier one.`,N)},y=(P,N,D,j)=>{let U=P.findIndex((v)=>v.name===N.name);if(U===-1)P.push(N);else{let v=D?` of "${D}"`:"";pe(e,"property-duplicate",N.name,`Duplicate property "${N.name}"${v}; the later declaration overwrites the earlier one.`,j),P[U]=N}},g=n.includes("@template")?ru(e):new Set;e.functionDocCommentStarts=g;let b=Dr(n);for(let P of b)e.jsDocBlocksByStart.set(P.start,P);for(let{tags:P,description:N,lines:D,start:j}of b){let U=g.has(j),v,w,M,G,X=!1,be,a,p=[],f=[],m=[],E,S,k,x,C=[],T=!1,L=[],_,A,I,O=[],H=!1,K=[],W,J,ae=!1,Y=!0,ce=[],we,Z=!1,Se=[],Ne=(R)=>{if(Se.length===0)return ql(R);let Q=`${R}<${Se.join(", ")}>`;return Se.length=0,Q},ve=new Map,Pe=new Set,Ve=new Set,bt,at;for(let R of P)if(R.lines.length>0)Pe.add(R.lines[0].number);for(let R of D)if(R.continuesType)Pe.add(R.number);let qt=new Set,sn=!1,Bn=!1;for(let R of D){if(!R.tag&&!R.continuesType&&R.content&&(Bn||R.content.trim()!=="}"))ve.set(R.number,R.content);if(R.tag!==void 0||R.continuesType)sn=!0;else if(!R.content.trim());else if(sn&&(R.indent||Bn))qt.add(R.number);else sn=!1;if($n(R.content))Bn=!Bn}let vr=(R,Q)=>{let fe=Q?Q.text.split(`
28
- `):[],q=Q?.line;for(let ie of R){if(q!==void 0&&ie-q>1){let ue=q+1;while(ue<ie&&ma(D[ue]))ue++;if(ue===ie)for(let Te=q+1;Te<ie;Te++)fe.push("")}let rt=D[ie];fe.push(rt.indent+rt.content),q=ie}return ei(fe)},Tp=(R)=>{if(R.length===0)return;let Q=R[0].number,fe=[],q=!1;for(let ie=Q-1;ie>=0;ie--){if(Pe.has(ie)||qt.has(ie)||Ve.has(ie))break;if(ve.has(ie))fe.unshift(ie),q=!0;else if(q&&!ma(D[ie]))break}if(fe.length===0)return;for(let ie of fe)Ve.add(ie);return bt?.(fe[0]),vr(fe)},Pr=(R,Q)=>{if(!Jl(R)){for(let q=1;q<R.lines.length;q++)Ve.add(R.lines[q].number);return}let fe=R.lines[R.lines.length-1].number;at=(q)=>Q(fe-q+1)},Ut=(R,Q,fe=!1)=>{let q=Pt(Jn(R)),ie=Q!==void 0&&Kl.has(Q.tag)&&!Pt(Jn(Q.lines)),rt=fe&&(Q===void 0||!Xr.has(Q.tag)),ue=[];for(let Te=1;Te<R.length;Te++){let de=R[Te];if((ie||rt)&&!qt.has(de.number))continue;if(!ve.get(de.number)?.trim()||Ve.has(de.number))continue;ue.push(de.number),Ve.add(de.number)}if(ue.length===0)return q;return vr(ue,{text:q??"",line:R[xa(R)].number})},Ep=(R,Q,fe,q)=>{if(v===void 0||M)return;if(a!==void 0&&qt.has(a+1))return;if(q?.tag!=="event"&&!Xr.has(q?.tag??""))return;if(Pt(Jn(fe)))return;let ie=Q?`@${R} "${Q}"`:`@${R}`;pe(e,"event-description-ambiguous",v,`Text after @event "${v}" was used as the description of ${ie}. Move it above the tag it describes, indent it as a continuation line, or give each event its own comment block.`,He(e,fe))},an=(R)=>{let{tag:Q,name:fe,lines:q}=P[R],ie=Tp(q);if(ie)Ep(Q,fe,q,P[R-1]);return ie},Ar=()=>{if(v!==void 0){let R=w&&w!=="object"&&w!=="Object"?w:void 0,Q;if(R)Q=R;else if(m.length>0)Q=xn(m,v,!0);else Q=w||"";if(a!==void 0){let q;for(let ue of P){let Te=ue.lines[0]?.number;if(typeof Te!=="number")continue;if(Te<=a)continue;if(Xr.has(ue.tag))continue;q=Te;break}let ie=[],rt=Array.from(ve.keys()).sort((ue,Te)=>ue-Te);for(let ue of rt){if(ue<=a)continue;if(q!==void 0&&ue>=q)continue;if(Ve.has(ue))continue;if(ve.get(ue)?.trim())ie.push(ue),Ve.add(ue)}if(ie.length>0)M=vr(ie,M?{text:M,line:a}:void 0)}let fe=Q===""&&(!e.events.has(v)||e.untypedJsDocEventNames.has(v));if(vt(e,{name:v,detail:Q,has_argument:!1,description:M,deprecated:G,tags:p.length>0?p:void 0,internal:X||void 0,source:be}),fe)e.untypedJsDocEventNames.add(v);e.eventDescriptions.set(v,M),e.jsDocEventNames.add(v),e.jsDocEventSources.set(v,be),dt(e,"event-no-source",v,f),m.length=0,v=void 0,w=void 0,M=void 0,G=void 0,X=!1,be=void 0,a=void 0,p=[],f=[]}},Ts=()=>{if(E!==void 0){let R,Q;if(L.length>0)R=xn(L,void 0,!0),Q=`type ${E} = ${R};`;else if(S)R=S,Q=Ql(R)?`interface ${E} ${R}`:`type ${E} = ${R};`;else R="{}",Q=`type ${E} = ${R};`;u(E,x),e.typedefs.set(E,{type:R,name:E,description:ze(k),ts:Q,tags:C.length>0?C:void 0,...T?{internal:!0}:{},source:x}),L.length=0,E=void 0,S=void 0,k=void 0,x=void 0,C=[],T=!1}},Es=()=>{if(_!==void 0){let fe=`(${K.map(({name:ie,type:rt,optional:ue})=>`${ie}${ue?"?":""}: ${rt}`).join(", ")}) => ${W||"void"}`,q=`type ${_} = ${fe};`;u(_,I),e.typedefs.set(_,{type:fe,name:_,description:ze(A),ts:q,tags:O.length>0?O:void 0,...H?{internal:!0}:{},source:I}),K.length=0,W=void 0,_=void 0,A=void 0,I=void 0,O=[],H=!1}},Cp=P.some((R)=>R.tag==="slot"||R.tag==="snippet"),Sp=P.some((R)=>R.tag==="extends"||R.tag==="extendProps"),vp=P.some((R)=>R.tag==="slot"||R.tag==="snippet"||R.tag==="event"||R.tag==="typedef"||R.tag==="callback");for(let R=0;R<P.length;R++){let{tag:Q,type:fe,name:q,description:ie,optional:rt,default:ue,text:Te,lines:de}=P[R],Gt=P[R+1],je=t.aliasType(fe);switch(bt=at,at=void 0,Q){case"extends":case"extendProps":if(e.extends!==void 0)pe(e,"extend-props-duplicate",q,`A second @extends/@extendProps tag ("${q}") overwrote the first ("${e.extends.interface}"); only one is used.`,He(e,de));if(e.extends={interface:q,import:je},Y)Y=!1;break;case"restProps":{let ee=q?ie?`${q} ${ie}`:q:ie,xe=Pt(ee),Oe=xe||an(R);if(!Oe&&Y&&!ae&&N)Oe=N,ae=!0;let ot={type:"Element",name:je,description:Oe||void 0};if(e.rest_props=ot,xe)Pr(P[R],(on)=>{ot.description=Pt(Yr(ee,on))||void 0});if(Y)Y=!1;break}case"slot":case"snippet":{let ee=Ut(de,Gt);if(!ee&&Y&&!ae&&N)ee=N,ae=!0;if(!ee&&ce.length===0)ee=an(R);if(Y)Y=!1;let xe=je;if(!xe)xe="Record<string, never>",pe(e,"slot-missing-type",q||"default",`@${Q}${q?` "${q}"`:""} is missing a required {Type} annotation; falling back to "${xe}".`,He(e,de));bn(e,{slot_name:q,slot_props:xe,slot_description:ee||void 0,slot_deprecated:we,slot_tags:ce.length>0?[...ce]:void 0,slot_internal:Z||void 0,source:He(e,de)}),ce.length=0,we=void 0,Z=!1;{let Oe=q===void 0||q===""?null:q;J=(ot)=>{let on=e.slots.get(Oe);if(on)on.tags=[...on.tags??[],ot]}}break}case"csspart":{let ee=Ut(de,Gt);e.cssParts.push({name:q,...ee?{description:ee}:{}});break}case"cssprop":case"cssproperty":{let ee=Ut(de,Gt);e.cssProperties.push({name:q,...je?{type:je}:{},...ue===void 0?{}:{default:ue},...ee?{description:ee}:{}});break}case"event":{let ee=Pt(Jn(de))||an(R);if(Ar(),v=q,w=je,a=de.length>0?de[0].number:void 0,M=ee,!M&&Y&&!ae&&N)M=N,ae=!0;if(be=He(e,de),ce.length>0)p.push(...ce),ce.length=0;if(J=(xe)=>p.push(xe),Y)Y=!1;break}case"type":if(v!==void 0)w=je;break;case"param":if(_!==void 0)K.push({name:q,type:je,optional:rt||!1});break;case"returns":case"return":if(_!==void 0)W=je;break;case"property":{let ee={name:q,type:je,description:Ut(de,Gt,v!==void 0),optional:rt||!1,default:ue};if(v!==void 0)y(m,ee,v,He(e,de));else if(E!==void 0&&lu(S))y(L,ee,E,He(e,de));break}case"typedef":{if(Ts(),E=Ne(q),S=je,x=He(e,de),k=Ut(de,Gt)||an(R),!k&&Y&&!ae&&N)k=N,ae=!0;if(ce.length>0)C.push(...ce),ce.length=0;if(T=Z,Z=!1,J=(ee)=>C.push(ee),Y)Y=!1;break}case"callback":{if(Es(),_=Ne(q),I=He(e,de),A=Ut(de,Gt)||an(R),!A&&Y&&!ae&&N)A=N,ae=!0;if(ce.length>0)O.push(...ce),ce.length=0;if(H=Z,Z=!1,J=(ee)=>O.push(ee),Y)Y=!1;break}case"generics":{let ee=je||q;for(let xe of lt(q))l(xe.trim(),He(e,de));if(r=!0,c(),d(q,ee),Y)Y=!1;break}case"template":{let ee=Ca(P[R],je),xe=R+1;while(P[xe]?.tag==="template")xe++;let Oe=P[xe];if((Oe?.tag==="typedef"||Oe?.tag==="callback")&&!Oe.name.includes("<")&&pu(P,xe,ee)){Se.push(...ee.map(({constraint:ot})=>ot));break}if(Cp&&!Sp){e.deferredSlotBlockGenerics.push(...ee);break}if(U)break;for(let ot of ee)l(ot.name,He(e,de)),d(ot.name,ot.constraint);if(i=!0,c(),Y)Y=!1;break}case"deprecated":{let ee=v!==void 0;if(ee?G!==void 0:we!==void 0)break;let xe=(Oe)=>{if(ee)G=Oe;else we=Oe};xe(Qr(Te)),Pr(P[R],(Oe)=>{xe(Qr(Yr(Te,Oe)))});break}case"ignore":case"internal":{if(v===void 0)Z=!0;else X=!0;break}case"sveld-ignore":if(v!==void 0)f.push(q);break;case"enum":case"class":case"implements":case"this":case"namespace":case"memberof":case"module":case"file":case"overview":break;default:{let ee={name:Q,body:Te};if(Pr(P[R],(xe)=>{ee.body=Yr(Te,xe)}),!ba.has(Q)&&!Xl.has(Q))pe(e,"jsdoc-unknown-tag",Q,`Unknown JSDoc tag "@${Q}"; passed through unchanged. If this is a typo, fix the tag name.`,He(e,de));if(J)J(ee);else ce.push(ee)}break}if(zl.has(Q))Ar()}if(Ar(),Ts(),Es(),vp&&ce.length>0){for(let R of ce)pe(e,"jsdoc-tag-dropped",R.name,`@${R.name} could not attach to a @slot/@snippet/@event/@typedef/@callback tag in the same comment block and was dropped.`);ce.length=0}}}var du=new Set(["MethodDefinition","PropertyDefinition","AccessorProperty"]);function fu(e){if(e.computed||!e.key)return;if(e.key.type==="Identifier")return e.key.name;if(e.key.type==="Literal"&&(typeof e.key.value==="string"||typeof e.key.value==="number"))return String(e.key.value);return}function va(e){return e==="private"||e==="protected"}function zt(e){return{...e?.description?{description:e.description}:{},...e?.deprecated===void 0?{}:{deprecated:e.deprecated},...e?.tags?{tags:e.tags}:{}}}function Aa(e){return e?.slice(1,-1).trim()||void 0}function ri(e,t,n){let r=Mr(e,t),i=new Map((n?.params??[]).map((l)=>[l.name,l])),o=r.params.map(({name:l,type:d,optional:u,rest:y})=>{let g=i.get(l);return{name:y?`...${l}`:l,type:d??g?.type??(y?"any[]":"any"),...g?.description?{description:g.description}:{},...!y&&(u||g?.optional)?{optional:!0}:{}}}),s=r.returnType??n?.returnType??(t.async?"Promise<any>":void 0),c=Aa(r.typeParameters)??n?.typeParameters;return{...o.length>0?{params:o}:{},...s?{returnType:s}:{},...c?{typeParameters:c}:{}}}function ka(e,t,n){let r=[],i=new Map,o=new Set,s=new Set,c,l=-1;for(let y of n.body?.body??[]){let g=y;if(!du.has(g.type)||va(g.accessibility))continue;let b=fu(g);if(b===void 0)continue;let P=Ue(e,t,g);if(P?.internal)continue;let N=`${g.static?"static ":""}${b}`,D={...g.static?{static:!0}:{},...g.optional?{optional:!0}:{},...g.abstract?{abstract:!0}:{}};if(g.type!=="MethodDefinition"){if(Ae(e,g.typeAnnotation?.typeAnnotation),!g.static)s.add(b);r.push({kind:"property",name:b,type:mt(e,g.typeAnnotation)??P?.type??"any",...D,...g.readonly?{readonly:!0}:{},...zt(P)});continue}let j=g.value,U=g.typeParameters?{...j,typeParameters:g.typeParameters}:j;if(g.kind==="constructor"){let v=ri(e,U,P);r.push({kind:"constructor",name:"constructor",params:v.params,...zt(P)}),l=r.length,c=U.body?.body,(U.params??[]).forEach((M,G)=>{if(M.type!=="TSParameterProperty"||va(M.accessibility))return;let X=v.params?.[G];if(!X)return;s.add(X.name),r.push({kind:"property",name:X.name,type:X.type,...M.readonly?{readonly:!0}:{},...X.description?{description:X.description}:{}})});continue}if(g.kind==="get"||g.kind==="set"){let v=ri(e,U,P),w=g.kind==="get"?v.returnType??P?.type:v.params?.[0]?.type??P?.type,M=i.get(N);if(M){if(g.kind==="set")M.readonly=void 0;if(w&&w!=="any"&&(M.type==="any"||g.kind==="get"))M.type=w;if(!M.description&&!M.deprecated)Object.assign(M,zt(P));continue}let G={kind:"property",name:b,type:w??"any",...D,...g.kind==="get"?{readonly:!0}:{},...zt(P)};i.set(N,G),r.push(G);continue}if(U.type==="TSDeclareMethod"&&!g.abstract)o.add(N);else if(U.type!=="TSDeclareMethod"&&o.has(N))continue;r.push({kind:"method",name:b,...D,...ri(e,U,P),...zt(P)})}if(e.scriptLanguage!=="ts"&&c)r.splice(l,0,...mu(e,t,c,s));for(let y of n.typeParameters?.params??[])Ae(e,y.constraint),Ae(e,y.default);let d=Aa(Lt(e,n.typeParameters)),u=hu(e,n);return{members:r,...d?{typeParameters:d}:{},...u}}function hu(e,t){let n={},r=t.superClass;if(r){if(n.extends=Lt(e,{start:r.start,end:t.superTypeParameters?.end??r.end}),r.type==="Identifier")Pa(e,r,t.superTypeParameters)}let i=(t.implements??[]).map((o)=>(Pa(e,o.expression,o.typeParameters),Lt(e,o))).filter((o)=>Boolean(o));if(i.length>0)n.implements=i;return n}function Pa(e,t,n){Ae(e,{type:"TSTypeReference",typeName:t,...n?{typeParameters:n}:{}})}function mu(e,t,n,r){let i=[];for(let o of n){let s=o.type==="ExpressionStatement"?o.expression:void 0;if(s?.type!=="AssignmentExpression"||s.operator!=="=")continue;let c=s.left;if(c?.type!=="MemberExpression"||c.computed||c.object?.type!=="ThisExpression")continue;let l=c.property?.type==="Identifier"?c.property.name:void 0;if(!l||r.has(l))continue;r.add(l);let d=Ue(e,t,o);if(d?.internal)continue;i.push({kind:"property",name:l,type:d?.type??"any",...zt(d)})}return i}function ii(){return{syntaxMode:"legacy",scriptLanguage:void 0,source:void 0,parsed:void 0,runesOptionOverride:void 0,sourceLineStartOffsetsCache:void 0,sourceLineHint:void 0,parsedJsDocByText:new Map,jsDocBlocksByStart:new Map,functionDocCommentStarts:new Set,rest_props:void 0,extends:void 0,customElementTag:void 0,customElement:void 0,componentComment:void 0,componentCommentSource:void 0,generics:null,scriptGenericsAttribute:void 0,diagnosticRecords:[],componentFilePath:"",props:new Map,moduleExports:new Map,propLocalToPublicName:new Map,reactive_vars:new Set,funcDecls:new Map,vars:new Set,valueImportBindingsByLocalName:new Map,pendingCallDefaultCandidates:[],pendingConstDefaultCandidates:[],pendingContextKeyCandidates:[],pendingDispatchEscapeCandidates:[],deferredEventNoSourceDiagnostics:[],runesPropsDeclarationMetadataByDeclaratorStart:new Map,typedRunesPropsDeclarations:[],explicitPropTypesByName:new Map,explicitVariableTypesByName:new Map,explicitVariableTypeNodesByName:new Map,typeImportBindingsByLocalName:new Map,localTypeDeclarationsByName:new Map,additionalTypeDependencyNodes:[],wholePropsLocals:new Set,restPropLocals:new Set,componentScope:new Map,scopeDeclarations:new Map,activeScopes:[],slots:new Map,snippetPropLocals:new Set,cssParts:[],cssProperties:[],deferredSlotBlockGenerics:[],events:new Map,eventDescriptions:new Map,forwardedEvents:new Map,jsDocEventNames:new Set,untypedJsDocEventNames:new Set,jsDocEventSources:new Map,bindings:new Map,contexts:new Map,typedefs:new Map,variableInfoCache:new Map,variableInfoCacheBuilt:!1,sveldIgnoreDirectives:new Map}}var yu=new Set(["Component","SvelteComponent","SvelteSelf"]),gu=new Set(["RegularElement","SvelteElement"]);function Tn(e){return yu.has(e)}function En(e){return gu.has(e)}function xu({hasTypeScriptType:e,hasJSDocType:t,inferredType:n,finalType:r}){if(e)return"typescript";if(t)return"jsdoc";if(n!==void 0)return"default";if(r!==void 0)return"inferred";return"unknown"}function Cn(e){let t=e.explicitType??e.jsdocType??e.resolvedType??e.typeSeed,n=e.jsdocParams??e.resolvedParams,r=e.jsdocReturnType??e.resolvedReturnType;if((e.isFunctionDeclaration?t==="() => any":e.initializerIsFunction&&t===e.typeSeed)&&r){let d=e.jsdocTypeParameters?`<${e.jsdocTypeParameters}>`:"";t=n&&n.length>0?`${d}(${Ct(n)}) => ${r}`:`${d}() => ${r}`}let o=e.jsdocDescription??e.resolvedDescription;if(o===void 0&&t!==void 0)o=e.typedefs?.get(t)?.description;let s=xu({hasTypeScriptType:e.explicitType!==void 0,hasJSDocType:e.jsdocType!==void 0||e.jsdocParams!==void 0||e.jsdocReturnType!==void 0||e.resolvedType!==void 0,inferredType:e.inferredTypeForSource,finalType:t}),c=e.initializerIsFunction||e.isFunctionDeclaration||e.inferIsFunctionFromTypeSignature===!0&&(!!e.jsdocParams?.length||e.jsdocReturnType!==void 0||!!e.jsdocType?.includes("=>")||!!e.resolvedType?.includes("=>")||!!e.explicitType?.includes("=>")),l=c?e.jsdocTypeParameters:void 0;return{type:t,typeSource:s,description:o,params:n,returnType:r,isFunction:c,typeParameters:l}}function bu(e){if(!e||typeof e!=="object"||!("type"in e))return;let t=String(e.type),n=Tn(t);if(!n&&!En(t))return;let r="name"in e&&typeof e.name==="string"?e.name:void 0;if(!r)return;let i=n?{type:"InlineComponent",name:r}:{type:"Element",name:r};if(r==="svelte:element"&&"tag"in e&&e.tag&&typeof e.tag==="object"){let o=e.tag;if(o.type==="Literal"&&typeof o.value==="string")i.thisValue=o.value}return i}function wa(e,t){let n=bu(t);if(!n)return;if(e.rest_props===void 0){e.rest_props=n;return}if(e.rest_props.type==="InlineComponent"&&n.type==="Element")e.rest_props=n}function ai(e){return e==="TSTypeAnnotation"||e==="TSTypeAliasDeclaration"||e==="TSInterfaceDeclaration"||e==="TSTypeParameterDeclaration"||e==="TSTypeParameterInstantiation"}function oi(e,t,n,r){si(e,null,null,t,n,r?.skipTypeOnlySubtrees===!0)}function si(e,t,n,r,i,o){r(e,t,n);let s=e.type;if((s==="Identifier"||s==="Literal"||s==="Text")&&e.typeAnnotation===void 0){if(i)i(e);return}if(o&&s.charCodeAt(0)===84&&ai(s)){if(i)i(e);return}for(let c in e){if(c==="leadingComments")continue;let l=e[c];if(!l||typeof l!=="object")continue;if(Array.isArray(l))for(let d=0;d<l.length;d++){let u=l[d];if(u&&typeof u==="object"&&typeof u.type==="string")si(u,e,c,r,i,o)}else if(typeof l.type==="string")si(l,e,c,r,i,o)}if(i)i(e)}var _a=new Set(["$state","$derived","$effect","$props","$bindable","$inspect","$host"]);function Tu(e,t){switch(t?.type){case"MemberExpression":return t.computed||e===t.object;case"MethodDefinition":return!!t.computed;case"MetaProperty":return e===t.meta;case"PropertyDefinition":return t.computed||e===t.value;case"Property":return t.computed||e===t.value;case"ExportSpecifier":case"ImportSpecifier":return e===t.local;case"LabeledStatement":case"BreakStatement":case"ContinueStatement":return!1;default:return!0}}var Eu=Array.from(_a);function Na(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===95||e===36}function Cu(e){if(e.includes("\\u"))return!0;for(let t of Eu){let n=e.indexOf(t);while(n!==-1){if(!Na(e.charCodeAt(n-1))&&!Na(e.charCodeAt(n+t.length)))return!0;n=e.indexOf(t,n+1)}}return!1}function Su(e,t){for(let n=t.length-1;n>=0;n-=1)if(t[n]?.has(e))return!0;return!1}function vu(e){let t=new Set;if(!e||typeof e!=="object"||!("type"in e))return t;switch(String(e.type)){case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":{let n=e;if(n.id?.name)t.add(n.id.name);for(let r of n.params??[])ge(r,t);break}case"BlockStatement":Xn(e.body,t);break;case"CatchClause":ge(e.param,t);break;case"EachBlock":{let n=e;if(ge(n.context,t),typeof n.index==="string")t.add(n.index);else if(n.index?.name)t.add(n.index.name);break}case"AwaitBlock":{let n=e;ge(n.value,t),ge(n.error,t);break}}return t}function Xn(e,t){if(!Array.isArray(e))return;for(let n of e){if(!n||typeof n!=="object"||!("type"in n))continue;switch(String(n.type)){case"ImportDeclaration":for(let r of n.specifiers??[])if(r.local?.name)t.add(r.local.name);break;case"VariableDeclaration":for(let r of n.declarations??[])ge(r.id,t);break;case"FunctionDeclaration":case"ClassDeclaration":{let r=n.id?.name;if(r)t.add(r);break}case"ExportNamedDeclaration":{let r=n.declaration;if(r&&typeof r==="object"&&"type"in r)Xn([r],t);break}}}}function ci(e,t){if(!e||typeof e!=="object")return!1;return pi(e,void 0,[...t])}function pi(e,t,n){if(ai(e.type))return!1;let r=yn(e);if(r)n.push(vu(e));let i=!1;if(t&&e.type==="Identifier"&&e.name!==void 0&&_a.has(e.name)&&!t.type.startsWith("TS")&&Tu(e,t)&&!Su(e.name,n))i=!0;else for(let o in e){if(o==="leadingComments")continue;let s=e[o];if(!s||typeof s!=="object")continue;if(Array.isArray(s)){for(let c=0;c<s.length;c++){let l=s[c];if(l&&typeof l==="object"&&typeof l.type==="string"){if(pi(l,e,n)){i=!0;break}}}if(i)break}else if(typeof s.type==="string"){if(pi(s,e,n)){i=!0;break}}}if(r)n.pop();return i}function Da(e){if(!e||typeof e!=="object")return;if("content"in e){let t=e.content,n=t&&typeof t==="object"&&"body"in t?t.body:void 0;if(Array.isArray(n))return n}if("body"in e&&Array.isArray(e.body))return e.body;return}function Ia(e){if(e.runesOptionOverride!==void 0)return e.runesOptionOverride?"runes":"legacy";let t=e.parsed;if(!t)return"legacy";if(e.source!==void 0&&!Cu(e.source))return"legacy";let n=new Set;Xn(Da(t.module),n);let r=new Set;return Xn(Da(t.instance),r),ci(t.module,[n])||ci(t.instance,[n,r])||ci(t.fragment,[n,r])?"runes":"legacy"}var Pu=/[A-Za-z_$][\w$]*/g;function Au(e,t,n){let r=new Map,i=t.typeParameters?.params,o=n.typeArguments?.params;if(!i?.length||!o?.length)return r;for(let s=0;s<i.length;s++){let c=i[s]?.name,l=o[s];if(!c||l?.start===void 0||l?.end===void 0)continue;let d=le(e,l.start,l.end)?.trim();if(d)r.set(c,d)}return r}function ku(e,t){if(t.size===0)return e;return e.replace(Pu,(n)=>t.get(n)??n)}function Jt(e,t,n,r,i=new Set){let o=new Map;if(!n?.type)return o;let s=(c)=>{for(let l of c){if(l?.type!=="TSPropertySignature"||l.computed)continue;if(!l.key)continue;let d=e.getPropertyName(l.key);if(!d)continue;let u=l.typeAnnotation?.start,y=l.typeAnnotation?.end;if(u===void 0||y===void 0)continue;let g=le(t,u+1,y)?.trim();if(!g)continue;Ae(t,l.typeAnnotation?.typeAnnotation),o.set(d,{type:g,optional:l.optional===!0,source:oe(t,l)})}};switch(n.type){case"TSTypeLiteral":s(n.members??[]);break;case"TSInterfaceDeclaration":s(n.body?.body??[]);break;case"TSTypeAliasDeclaration":{let c=Jt(e,t,n.typeAnnotation,r,i);for(let[l,d]of c)o.set(l,d);break}case"TSTypeReference":{let c=Is(n.typeName);if(!c||i.has(c))break;let l=r.get(c);if(!l)break;i.add(c);let d=Jt(e,t,l,r,i);i.delete(c);let u=Au(t,l,n);for(let[y,g]of d)o.set(y,u.size===0?g:{...g,type:ku(g.type,u)});break}case"TSIntersectionType":for(let c of n.types??[]){let l=Jt(e,t,c,r,i);for(let[d,u]of l)o.set(d,u)}break;case"TSParenthesizedType":{let c=Jt(e,t,n.typeAnnotation,r,i);for(let[l,d]of c)o.set(l,d);break}}return o}function wu(e){let t={};for(let[n,r]of Object.entries(e))t[n]={...r.attribute===void 0?{}:{attribute:r.attribute},...r.reflect===void 0?{}:{reflect:r.reflect},...r.type===void 0?{}:{type:r.type}};return t}function li(e,t,n){if(t.type==="ImportDeclaration"&&t.source?.value)for(let i of t.specifiers??[]){let o=i.local?.name;if(!o)continue;if(!(t.importKind==="type"||i.importKind==="type"))continue;let c,l;if(i.type==="ImportSpecifier")c="named",l=i.imported?.type==="Identifier"?i.imported.name:typeof i.imported?.value==="string"?i.imported.value:void 0;else if(i.type==="ImportDefaultSpecifier")c="default";else if(i.type==="ImportNamespaceSpecifier")c="namespace";if(!c)continue;e.typeImportBindingsByLocalName.set(o,{importedName:l,localName:o,source:String(t.source.value),specifierType:c})}let r=t.type==="TSEnumDeclaration";if((r||t.type==="TSInterfaceDeclaration"||t.type==="TSTypeAliasDeclaration")&&t.id?.name&&t.start!==void 0&&t.end!==void 0){let i=r?Rs(e,t):le(e,t.start,t.end)?.trim();e.localTypeDeclarationsByName.set(t.id.name,{code:i??"",node:t,start:t.start,...n?{exported:n}:{}})}}function La(e,t,n){if(t.runesPropsDeclarationMetadataByDeclaratorStart.clear(),t.explicitPropTypesByName.clear(),t.explicitVariableTypesByName.clear(),t.explicitVariableTypeNodesByName.clear(),t.typeImportBindingsByLocalName.clear(),t.localTypeDeclarationsByName.clear(),t.additionalTypeDependencyNodes.length=0,t.typedRunesPropsDeclarations.length=0,!t.source)return;let r=n;t.scriptLanguage=e.resolveScriptLanguage(r);let i=r.options?.customElement;t.customElementTag=i?.tag,t.customElement=i?{...i.tag===void 0?{}:{tag:i.tag},...i.shadow==="open"||i.shadow==="none"?{shadow:i.shadow}:{},...i.props?{props:wu(i.props)}:{},...i.extend===void 0?{}:{extend:!0}}:void 0,t.runesOptionOverride=r.options?.runes,t.scriptGenericsAttribute=e.resolveScriptGenericsAttribute(r);let o=r.module?.content?.body??[],s=new Set;for(let l of o){if(!l?.type)continue;if(l.type==="ExportNamedDeclaration"&&l.declaration)li(t,l.declaration,!0);else if(l.type==="ExportNamedDeclaration"&&!l.source)for(let d of l.specifiers??[]){let u=d.local?.name;if(u&&u===d.exported?.name)s.add(u)}else li(t,l,!1)}for(let l of s){let d=t.localTypeDeclarationsByName.get(l);if(d)d.exported=!0}let c=r.instance?.content?.body??[];for(let l of c){if(!l?.type)continue;if(li(t,l,!1),l.type==="ExportNamedDeclaration"&&l.declaration?.type==="VariableDeclaration")for(let d of l.declaration.declarations??[]){if(d.id?.type!=="Identifier"||!d.id.name)continue;let u=mt(t,d.id.typeAnnotation);if(u)t.explicitPropTypesByName.set(d.id.name,u),Ae(t,d.id.typeAnnotation?.typeAnnotation)}else if(l.type==="VariableDeclaration")for(let d of l.declarations??[]){if(d.id?.type!=="Identifier"||!d.id.name)continue;let u=mt(t,d.id.typeAnnotation);if(u){t.explicitVariableTypesByName.set(d.id.name,u);let y=d.id.typeAnnotation?.typeAnnotation;if(y)t.explicitVariableTypeNodesByName.set(d.id.name,y)}}}for(let l of c){if(!l||typeof l!=="object"||!("declarations"in l))continue;for(let d of l.declarations??[]){if(!ct(Et(d.init),"$props"))continue;let u=d.id?.typeAnnotation?void 0:Ss(d.init),y=d.id?.typeAnnotation?.typeAnnotation??u,g=d.id?.typeAnnotation?mt(t,d.id.typeAnnotation):Lt(t,u),b=Jt(e,t,y,new Map(Array.from(t.localTypeDeclarationsByName.entries(),([D,j])=>[D,j.node]))),P=new Set,N=new Set;if(Ie(t,y,P,N),fa(t,P,N),d.start!==void 0){let D={canonicalType:g,props:b,referencedImportedTypes:P,referencedLocalTypes:N};if(t.runesPropsDeclarationMetadataByDeclaratorStart.set(d.start,D),g)t.typedRunesPropsDeclarations.push(D)}}}}function Ra(e,t,n){for(let r of n.declarations){if(!ct(Et(r.init),"$props"))continue;if(r.id.type==="Identifier"){t.wholePropsLocals.add(r.id.name),t.restPropLocals.add(r.id.name);let s=Rr(t,r.start);if(s)for(let[c,l]of s.props)un(e,t,c,{name:c,kind:"let",type:l.type,typeSource:"typescript",isFunction:!1,isFunctionDeclaration:!1,isRequired:!l.optional,constant:!1,reactive:!1,source:l.source});continue}if(r.id.type!=="ObjectPattern")continue;let i=Ue(t,e,n),o=r.id.properties.filter((s)=>{if(s.type!=="Property"||s.computed)return!1;if(!e.getPropertyName(s.key))return!1;if(s.value.type==="Identifier")return!0;return s.value.type==="AssignmentPattern"&&s.value.left.type==="Identifier"}).length;for(let s of r.id.properties){if(s.type==="RestElement"){if(s.argument.type==="Identifier")t.restPropLocals.add(s.argument.name);continue}let c=e.getPropertyName(s.key);if(!c)continue;let l,d;if(s.value.type==="Identifier")l=s.value.name;else{let p=s.value;l=p.left.name,d=p.right}if(!l)continue;if(e.trackPropLocalName(c,l),c==="children")t.snippetPropLocals.add(l);let u=Ea(t,e,s)??(o===1?i:void 0),y=_s(t,r.start,c),{init:g,bindable:b}=qs(d),P=g==null?{isFunction:!1}:pt(e,t,g),{value:N,type:D,isFunction:j,defaultValue:U}=P,v=y?.type===void 0&&u?.type===void 0?P.resolvedType:void 0;dn(t,P,c,"props");let{type:w,typeSource:M,description:G,params:X,returnType:be,isFunction:a}=Cn({explicitType:y?.type,typeSeed:D,inferredTypeForSource:D,jsdocType:u?.type,jsdocDescription:u?.description,jsdocParams:u?.params,jsdocReturnType:u?.returnType,resolvedType:v,resolvedDescription:P.resolvedDescription,resolvedParams:P.resolvedParams,resolvedReturnType:P.resolvedReturnType,initializerIsFunction:j,isFunctionDeclaration:!1,inferIsFunctionFromTypeSignature:!0});if(b)t.reactive_vars.add(c);dt(t,"prop-unknown-type",c,u?.sveldIgnore),un(e,t,c,{name:c,...l===c?{}:{localName:l},kind:"let",description:G,binding:u?.binding,deprecated:u?.deprecated,tags:u?.tags,...u?.internal?{internal:!0}:{},...b?{bindable:!0}:{},type:w,typeSource:M,value:N,defaultValue:U,params:X,returnType:be,isFunction:a,isFunctionDeclaration:!1,isRequired:!b&&g==null&&y?.optional!==!0,constant:!1,reactive:b,source:oe(t,s)})}}}function Nu(e){let n=e.indexOf("EventDispatcher");if(n===-1)return;let r=n+15;while(e[r]===" ")r++;if(e[r]!=="<")return;let i=0,o=r;for(;r<e.length;r++)if(e[r]==="<")i++;else if(e[r]===">"){if(i--,i===0)return e.slice(o+1,r)}return}function Ma(e,t){let n=e[t];for(let r=t+1;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===n)return r;return e.length}function Du(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let o=e[i];if(o==='"'||o==="'")i=Ma(e,i);else if(o==="{"||o==="("||o==="["||o==="<")n++;else if(o==="}"||o===")"||o==="]"||o===">")n=Math.max(n-1,0);else if(n===0&&(o===";"||o===","))t.push(e.slice(r,i)),r=i+1}return t.push(e.slice(r)),t.map((i)=>i.trim()).filter((i)=>i.length>0)}var _u=/^["']|["']$/g,Iu=/\?$/,Lu=/^\{/,Ru=/\}$/;function Mu(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];if(r==='"'||r==="'")n=Ma(e,n);else if(r==="{"||r==="("||r==="["||r==="<")t++;else if(r==="}"||r===")"||r==="]"||r===">")t=Math.max(t-1,0);else if(t===0&&r===":"){let i=e.slice(0,n).trim().replace(Iu,"").replace(_u,""),o=e.slice(n+1).trim();if(!i||!o)return;return{name:i,type:o}}}return}function Oa(e,t,n,r,i){if(n){let l=new Map(Array.from(t.localTypeDeclarationsByName.entries(),([u,y])=>[u,y.node])),d=Jt(e,t,n,l);for(let[u,y]of d)vt(t,{name:u,detail:y.type,has_argument:!0,source:y.source});return}let o=e.resolveLocalVarJSDoc(r)?.type,s=o?Nu(o):void 0;if(!s)return;let c=s.trim().replace(Lu,"").replace(Ru,"");for(let l of Du(c)){let d=Mu(l);if(!d)continue;vt(t,{name:d.name,detail:d.type,has_argument:!0,source:i})}}function Ba(e,t){if(e.syntaxMode!=="runes")return;for(let[n,r]of Array.from(e.events.entries())){if(r.type!=="dispatched")continue;if(t.has(n)||e.forwardedEvents.has(n))continue;let i=`on${n}`,o=e.props.get(i);if(!o)continue;let s=o.type!==void 0||o.params!==void 0||o.returnType!==void 0,c=r.detail===void 0||r.detail==="undefined"||r.detail==="null"?"() => void":`(detail: ${r.detail}) => void`;e.props.set(i,{...o,description:o.description??r.description,type:s?o.type:c,typeSource:s?o.typeSource:"inferred",isFunction:!0}),e.events.delete(n)}}var Fa=new Set(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion","TSInstantiationExpression"]);function ui(e){return e!==null&&typeof e==="object"&&typeof e.type==="string"}function $a(e){if(!Fa.has(e.type))return e;let t=e.expression;while(t&&Fa.has(t.type))t=t.expression;return t??e}function Yn(e){if(!ui(e))return;di(e)}function di(e){for(let t in e){if(t==="leadingComments")continue;let n=e[t];if(!n||typeof n!=="object")continue;if(Array.isArray(n))for(let r=0;r<n.length;r++){let i=n[r];if(!ui(i))continue;let o=$a(i);if(o!==i)n[r]=o;di(o)}else if(ui(n)){let r=$a(n);if(r!==n)e[t]=r;di(r)}}}function Ou(e,t,n,r,i){for(let o of e){if(o.type!=="Block"||o.start<n||o.end>r)continue;i.push({start:o.start,end:o.end,isJsDoc:o.end-o.start>4&&t.startsWith("/**",o.start)})}}function Va(e,t,n){if(!e||typeof e!=="object"||!("type"in e))return;let r=e;if(r.type==="FunctionDeclaration"){if(r.id?.type==="Identifier"&&r.id.name)n.push({name:r.id.name,start:t});return}if(r.type==="VariableDeclaration"){for(let i of r.declarations??[])if(i?.id?.type==="Identifier"&&i.id.name)n.push({name:i.id.name,start:t})}}function Bu(e){let t=[];for(let n of e){if(!n||typeof n!=="object"||!("type"in n))continue;let r=n;if(r.start===void 0)continue;if(r.type==="ExportNamedDeclaration"&&r.declaration)Va(r.declaration,r.start,t);else Va(r,r.start,t)}return t}function Fu(e,t,n){let r=0,i=e.length;while(r<i){let o=r+i>>>1;if(e[o].end<=t)r=o+1;else i=o}for(let o=r-1;o>=0;o--){let s=e[o];if(!s.isJsDoc)continue;return Zr(n,s.end,t)?s:void 0}return}function ja(e,t){let n=new Map;if(!e.source)return n;let r=[e.parsed?.module,e.parsed?.instance],i=[],o=[],s=e.parsed?.comments??[];for(let c of r){let l=c?.content;if(!l?.body||l.start===void 0||l.end===void 0)continue;Ou(s,e.source,l.start,l.end,i),o.push(...Bu(l.body))}i.sort((c,l)=>c.end-l.end);for(let c of o){let l=Fu(i,c.start,e.source);if(!l)continue;let d=ti(e,e.source.slice(l.start,l.end)),{type:u,description:y,ignore:g,internal:b}=ni(d);if(g.length>0)dt(e,"context-any-type",c.name,g);if(!u&&!y&&!b)continue;n.set(c.name,{type:u?t.aliasType(u.type):void 0,description:y||u&&ga(u),internal:b||void 0})}return n}var $u={li:{direct:["li"]},dt:{descendant:["dt","dd"]},dd:{descendant:["dt","dd"]},p:{descendant:["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"]},rt:{descendant:["rt","rp"]},rp:{descendant:["rt","rp"]},optgroup:{descendant:["optgroup"]},option:{descendant:["option","optgroup"]},thead:{direct:["tbody","tfoot"]},tbody:{direct:["tbody","tfoot"]},tfoot:{direct:["tbody"]},tr:{direct:["tr","tbody"]},td:{direct:["td","th","tr"]},th:{direct:["td","th","tr"]}};function Ha(e,t){let n=$u[e];if(!n)return!1;if(!t)return!0;return(n.direct??n.descendant??[]).includes(t)}var Ai={};wp(Ai,{Node:()=>kn,Parser:()=>me,Position:()=>Xt,SourceLocation:()=>Pn,TokContext:()=>Qe,Token:()=>pr,TokenType:()=>se,defaultOptions:()=>Zn,getLineInfo:()=>Ti,isIdentifierChar:()=>Fe,isIdentifierStart:()=>Le,isNewLine:()=>Mt,keywordTypes:()=>ir,lineBreak:()=>Re,lineBreakG:()=>Xa,nonASCIIwhitespace:()=>bi,parse:()=>Ed,parseExpressionAt:()=>Cd,tokContexts:()=>he,tokTypes:()=>h,tokenizer:()=>Sd,version:()=>Do});var Vu=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],Ka=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],ju="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",za="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",fi={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"},hi="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",Hu={5:hi,"5module":hi+" export import",6:hi+" const class extends export import super"},Ja=/^in(stanceof)?$/,qu=new RegExp("["+za+"]"),Uu=new RegExp("["+za+ju+"]");function mi(e,t){var n=65536;for(var r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function Le(e,t){if(e<65)return e===36;if(e<91)return!0;if(e<97)return e===95;if(e<123)return!0;if(e<=65535)return e>=170&&qu.test(String.fromCharCode(e));if(t===!1)return!1;return mi(e,Ka)}function Fe(e,t){if(e<48)return e===36;if(e<58)return!0;if(e<65)return!1;if(e<91)return!0;if(e<97)return e===95;if(e<123)return!0;if(e<=65535)return e>=170&&Uu.test(String.fromCharCode(e));if(t===!1)return!1;return mi(e,Ka)||mi(e,Vu)}var se=function(t,n){if(n===void 0)n={};this.label=t,this.keyword=n.keyword,this.beforeExpr=!!n.beforeExpr,this.startsExpr=!!n.startsExpr,this.isLoop=!!n.isLoop,this.isAssign=!!n.isAssign,this.prefix=!!n.prefix,this.postfix=!!n.postfix,this.binop=n.binop||null,this.updateContext=null};function Xe(e,t){return new se(e,{beforeExpr:!0,binop:t})}var Ye={beforeExpr:!0},Be={startsExpr:!0},ir={};function re(e,t){if(t===void 0)t={};return t.keyword=e,ir[e]=new se(e,t)}var h={num:new se("num",Be),regexp:new se("regexp",Be),string:new se("string",Be),name:new se("name",Be),privateId:new se("privateId",Be),eof:new se("eof"),bracketL:new se("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new se("]"),braceL:new se("{",{beforeExpr:!0,startsExpr:!0}),braceR:new se("}"),parenL:new se("(",{beforeExpr:!0,startsExpr:!0}),parenR:new se(")"),comma:new se(",",Ye),semi:new se(";",Ye),colon:new se(":",Ye),dot:new se("."),question:new se("?",Ye),questionDot:new se("?."),arrow:new se("=>",Ye),template:new se("template"),invalidTemplate:new se("invalidTemplate"),ellipsis:new se("...",Ye),backQuote:new se("`",Be),dollarBraceL:new se("${",{beforeExpr:!0,startsExpr:!0}),eq:new se("=",{beforeExpr:!0,isAssign:!0}),assign:new se("_=",{beforeExpr:!0,isAssign:!0}),incDec:new se("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new se("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:Xe("||",1),logicalAND:Xe("&&",2),bitwiseOR:Xe("|",3),bitwiseXOR:Xe("^",4),bitwiseAND:Xe("&",5),equality:Xe("==/!=/===/!==",6),relational:Xe("</>/<=/>=",7),bitShift:Xe("<</>>/>>>",8),plusMin:new se("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:Xe("%",10),star:Xe("*",10),slash:Xe("/",10),starstar:new se("**",{beforeExpr:!0}),coalesce:Xe("??",1),_break:re("break"),_case:re("case",Ye),_catch:re("catch"),_continue:re("continue"),_debugger:re("debugger"),_default:re("default",Ye),_do:re("do",{isLoop:!0,beforeExpr:!0}),_else:re("else",Ye),_finally:re("finally"),_for:re("for",{isLoop:!0}),_function:re("function",Be),_if:re("if"),_return:re("return",Ye),_switch:re("switch"),_throw:re("throw",Ye),_try:re("try"),_var:re("var"),_const:re("const"),_while:re("while",{isLoop:!0}),_with:re("with"),_new:re("new",{beforeExpr:!0,startsExpr:!0}),_this:re("this",Be),_super:re("super",Be),_class:re("class",Be),_extends:re("extends",Ye),_export:re("export"),_import:re("import",Be),_null:re("null",Be),_true:re("true",Be),_false:re("false",Be),_in:re("in",{beforeExpr:!0,binop:7}),_instanceof:re("instanceof",{beforeExpr:!0,binop:7}),_typeof:re("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:re("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:re("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Re=/\r\n?|\n|\u2028|\u2029/,Xa=new RegExp(Re.source,"g");function Mt(e){return e===10||e===13||e===8232||e===8233}function Ya(e,t,n){if(n===void 0)n=e.length;for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(Mt(i))return r<n-1&&i===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var bi=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Ee=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Qa=Object.prototype,{hasOwnProperty:Gu,toString:Wu}=Qa,Yt=Object.hasOwn||function(e,t){return Gu.call(e,t)},qa=Array.isArray||function(e){return Wu.call(e)==="[object Array]"},Ua=Object.create(null);function At(e){return Ua[e]||(Ua[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function yt(e){if(e<=65535)return String.fromCharCode(e);return e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320)}var Ku=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Xt=function(t,n){this.line=t,this.column=n};Xt.prototype.offset=function(t){return new Xt(this.line,this.column+t)};var Pn=function(t,n,r){if(this.start=n,this.end=r,t.sourceFile!==null)this.source=t.sourceFile};function Ti(e,t){for(var n=1,r=0;;){var i=Ya(e,r,t);if(i<0)return new Xt(n,t-r);++n,r=i}}var Zn={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},Ga=!1;function zu(e){var t={};for(var n in Zn)t[n]=e&&Yt(e,n)?e[n]:Zn[n];if(t.ecmaVersion==="latest")t.ecmaVersion=1e8;else if(t.ecmaVersion==null){if(!Ga&&typeof console==="object"&&console.warn)Ga=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
29
- Defaulting to 2020, but this will stop working in the future.`);t.ecmaVersion=11}else if(t.ecmaVersion>=2015)t.ecmaVersion-=2009;if(t.allowReserved==null)t.allowReserved=t.ecmaVersion<5;if(!e||e.allowHashBang==null)t.allowHashBang=t.ecmaVersion>=14;if(qa(t.onToken)){var r=t.onToken;t.onToken=function(i){return r.push(i)}}if(qa(t.onComment))t.onComment=Ju(t,t.onComment);if(t.sourceType==="commonjs"&&t.allowAwaitOutsideFunction)throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return t}function Ju(e,t){return function(n,r,i,o,s,c){var l={type:n?"Block":"Line",value:r,start:i,end:o};if(e.locations)l.loc=new Pn(this,s,c);if(e.ranges)l.range=[i,o];t.push(l)}}var Rt=1,Ot=2,Ei=4,Za=8,Ci=16,eo=32,sr=64,to=128,Bt=256,An=512,no=1024,ar=Rt|Ot|Bt;function Si(e,t){return Ot|(e?Ei:0)|(t?Za:0)}var er=0,vi=1,xt=2,ro=3,io=4,so=5,me=function(t,n,r){this.options=t=zu(t),this.sourceFile=t.sourceFile,this.keywords=At(Hu[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var i="";if(t.allowReserved!==!0){if(i=fi[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module")i+=" await"}this.reservedWords=At(i);var o=(i?i+" ":"")+fi.strict;if(this.reservedWordsStrict=At(o),this.reservedWordsStrictBind=At(o+" "+fi.strictBind),this.input=String(n),this.containsEsc=!1,this.pos=r||0,this.curLine=1,t.startLocation)this.lineStart=this.pos-t.startLocation.column,this.curLine=t.startLocation.line;else if(r){if(this.lineStart=this.input.lastIndexOf(`
30
- `,r-1)+1,this.options.locations)this.curLine=this.input.slice(0,this.lineStart).split(Re).length}else this.lineStart=0;if(this.type=h.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=t.sourceType==="module",this.strict=this.inModule||t.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&&t.allowHashBang&&this.input.slice(0,2)==="#!")this.skipLineComment(2);this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?Ot:Rt),this.regexpState=null,this.privateNameStack=[]},et={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}};me.prototype.parse=function(){var t=this,n=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return t.parseTopLevel(n)})};et.inFunction.get=function(){return(this.currentVarScope().flags&Ot)>0};et.inGenerator.get=function(){return(this.currentVarScope().flags&Za)>0};et.inAsync.get=function(){return(this.currentVarScope().flags&Ei)>0};et.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],n=t.flags;if(n&(Bt|An))return!1;if(n&Ot)return(n&Ei)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};et.allowReturn.get=function(){if(this.inFunction)return!0;if(this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&Rt)return!0;return!1};et.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags;return(t&sr)>0||this.options.allowSuperOutsideMethod};et.allowDirectSuper.get=function(){return(this.currentThisScope().flags&to)>0};et.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};et.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],n=t.flags;if(n&(Bt|An)||n&Ot&&!(n&Ci))return!0}return!1};et.allowUsing.get=function(){var e=this.currentScope(),t=e.flags;if(t&no)return!1;if(!this.inModule&&t&Rt)return!1;return!0};et.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Bt)>0};me.extend=function(){var t=[],n=arguments.length;while(n--)t[n]=arguments[n];var r=this;for(var i=0;i<t.length;i++)r=t[i](r);return r};me.parse=function(t,n){return new this(n,t).parse()};me.parseExpressionAt=function(t,n,r){var i=new this(r,t,n);return i.nextToken(),i.parseExpression()};me.tokenizer=function(t,n){return new this(n,t)};Object.defineProperties(me.prototype,et);var _e=me.prototype,Xu=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;_e.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){Ee.lastIndex=e,e+=Ee.exec(this.input)[0].length;var t=Xu.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){Ee.lastIndex=e+t[0].length;var n=Ee.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===";"||i==="}"||Re.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i==="!"&&this.input.charAt(r+1)==="=")}if(e+=t[0].length,Ee.lastIndex=e,e+=Ee.exec(this.input)[0].length,this.input[e]===";")e++}};_e.eat=function(e){if(this.type===e)return this.next(),!0;else return!1};_e.isContextual=function(e){return this.type===h.name&&this.value===e&&!this.containsEsc};_e.eatContextual=function(e){if(!this.isContextual(e))return!1;return this.next(),!0};_e.catchStackOverflow=function(e){try{return e()}catch(t){if(t instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(t.message)||/\btoo much recursion\b/i.test(t.message)))this.raise(this.start,"Not enough stack space to parse input");else throw t}};_e.expectContextual=function(e){if(!this.eatContextual(e))this.unexpected()};_e.canInsertSemicolon=function(){return this.type===h.eof||this.type===h.braceR||Re.test(this.input.slice(this.lastTokEnd,this.start))};_e.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return!0}};_e.semicolon=function(){if(!this.eat(h.semi)&&!this.insertSemicolon())this.unexpected()};_e.afterTrailingComma=function(e,t){if(this.type===e){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);if(!t)this.next();return!0}};_e.expect=function(e){this.eat(e)||this.unexpected()};_e.unexpected=function(e){this.raise(e!=null?e:this.start,"Unexpected token")};var or=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};_e.checkPatternErrors=function(e,t){if(!e)return;if(e.trailingComma>-1)this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var n=t?e.parenthesizedAssign:e.parenthesizedBind;if(n>-1)this.raiseRecoverable(n,t?"Assigning to rvalue":"Parenthesized pattern")};_e.checkExpressionErrors=function(e,t){if(!e)return!1;var{shorthandAssign:n,doubleProto:r}=e;if(!t)return n>=0||r>=0;if(n>=0)this.raise(n,"Shorthand property assignments are valid only in destructuring patterns");if(r>=0)this.raiseRecoverable(r,"Redefinition of __proto__ property")};_e.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")};_e.isSimpleAssignTarget=function(e){if(e.type==="ParenthesizedExpression")return this.isSimpleAssignTarget(e.expression);return e.type==="Identifier"||e.type==="MemberExpression"};var V=me.prototype;V.parseTopLevel=function(e){var t=Object.create(null);if(!e.body)e.body=[];while(this.type!==h.eof){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var o=i[r];this.raiseRecoverable(this.undefinedExports[o].start,"Export '"+o+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(e,"Program")};var Pi={kind:"loop"},Yu={kind:"switch"};V.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;Ee.lastIndex=this.pos;var t=Ee.exec(this.input),n=this.pos+t[0].length,r=this.fullCharCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123)return!0;if(Le(r)){var i=n;do n+=r<=65535?1:2;while(Fe(r=this.fullCharCodeAt(n)));if(r===92)return!0;var o=this.input.slice(i,n);if(!Ja.test(o))return!0}return!1};V.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Ee.lastIndex=this.pos;var e=Ee.exec(this.input),t=this.pos+e[0].length,n;return!Re.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(Fe(n=this.fullCharCodeAt(t+8))||n===92))};V.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;Ee.lastIndex=this.pos;var n=Ee.exec(this.input),r=this.pos+n[0].length;if(Re.test(this.input.slice(this.pos,r)))return!1;if(e){var i=r+5,o;if(this.input.slice(r,i)!=="using"||i===this.input.length||Fe(o=this.fullCharCodeAt(i))||o===92)return!1;Ee.lastIndex=i;var s=Ee.exec(this.input);if(r=i+s[0].length,s&&Re.test(this.input.slice(i,r)))return!1}var c=this.fullCharCodeAt(r);if(!Le(c)&&c!==92)return!1;var l=r;do r+=c<=65535?1:2;while(Fe(c=this.fullCharCodeAt(r)));if(c===92)return!0;var d=this.input.slice(l,r);if(Ja.test(d))return!1;if(t&&!e&&d==="of"){Ee.lastIndex=r;var u=Ee.exec(this.input);if(r=r+u[0].length,this.input.charCodeAt(r)!==61||(c=this.input.charCodeAt(r+1))===61||c===62)return!1}return!0};V.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)};V.isUsing=function(e){return this.isUsingKeyword(!1,e)};V.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),o;if(this.isLet(e))r=h._var,o="let";switch(r){case h._break:case h._continue:return this.parseBreakContinueStatement(i,r.keyword);case h._debugger:return this.parseDebuggerStatement(i);case h._do:return this.parseDoStatement(i);case h._for:return this.parseForStatement(i);case h._function:if(e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(i,!1,!e);case h._class:if(e)this.unexpected();return this.parseClass(i,!0);case h._if:return this.parseIfStatement(i);case h._return:return this.parseReturnStatement(i);case h._switch:return this.parseSwitchStatement(i);case h._throw:return this.parseThrowStatement(i);case h._try:return this.parseTryStatement(i);case h._const:case h._var:if(o=o||this.value,e&&o!=="var")this.unexpected();return this.parseVarStatement(i,o);case h._while:return this.parseWhileStatement(i);case h._with:return this.parseWithStatement(i);case h.braceL:return this.parseBlock(!0,i);case h.semi:return this.parseEmptyStatement(i);case h._export:case h._import:if(this.options.ecmaVersion>10&&r===h._import){Ee.lastIndex=this.pos;var s=Ee.exec(this.input),c=this.pos+s[0].length,l=this.input.charCodeAt(c);if(l===40||l===46)return this.parseExpressionStatement(i,this.parseExpression())}if(!this.options.allowImportExportEverywhere){if(!t)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 r===h._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction()){if(e)this.unexpected();return this.next(),this.parseFunctionStatement(i,!0,!e)}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(e)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(i,!1,d),this.semicolon(),this.finishNode(i,"VariableDeclaration")}var u=this.value,y=this.parseExpression();if(r===h.name&&y.type==="Identifier"&&this.eat(h.colon))return this.parseLabeledStatement(i,u,y,e);else return this.parseExpressionStatement(i,y)}};V.parseBreakContinueStatement=function(e,t){var n=t==="break";if(this.next(),this.eat(h.semi)||this.insertSemicolon())e.label=null;else if(this.type!==h.name)this.unexpected();else e.label=this.parseIdent(),this.semicolon();var r=0;for(;r<this.labels.length;++r){var i=this.labels[r];if(e.label==null||i.name===e.label.name){if(i.kind!=null&&(n||i.kind==="loop"))break;if(e.label&&n)break}}if(r===this.labels.length)this.raise(e.start,"Unsyntactic "+t);return this.finishNode(e,n?"BreakStatement":"ContinueStatement")};V.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};V.parseDoStatement=function(e){if(this.next(),this.labels.push(Pi),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(h._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6)this.eat(h.semi);else this.semicolon();return this.finishNode(e,"DoWhileStatement")};V.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Pi),this.enterScope(0),this.expect(h.parenL),this.type===h.semi){if(t>-1)this.unexpected(t);return this.parseFor(e,null)}var n=this.isLet();if(this.type===h._var||this.type===h._const||n){var r=this.startNode(),i=n?"let":this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,"VariableDeclaration"),this.parseForAfterInit(e,r,t)}var o=this.isContextual("let"),s=!1,c=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(c){var l=this.startNode();if(this.next(),c==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.parseVar(l,!0,c),this.finishNode(l,"VariableDeclaration"),this.parseForAfterInit(e,l,t)}var d=this.containsEsc,u=new or,y=this.start,g=t>-1?this.parseExprSubscripts(u,"await"):this.parseExpression(!0,u);if(this.type===h._in||(s=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(t>-1){if(this.type===h._in)this.unexpected(t);e.await=!0}else if(s&&this.options.ecmaVersion>=8){if(g.start===y&&!d&&g.type==="Identifier"&&g.name==="async")this.unexpected();else if(this.options.ecmaVersion>=9)e.await=!1}if(o&&s)this.raise(g.start,"The left-hand side of a for-of loop may not start with 'let'.");return this.toAssignable(g,!1,u),this.checkLValPattern(g),this.parseForIn(e,g)}else this.checkExpressionErrors(u,!0);if(t>-1)this.unexpected(t);return this.parseFor(e,g)};V.parseForAfterInit=function(e,t,n){if((this.type===h._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&t.declarations.length===1){if(this.type===h._in){if((t.kind==="using"||t.kind==="await using")&&!t.declarations[0].init)this.raise(this.start,"Using declaration is not allowed in for-in loops");if(this.options.ecmaVersion>=9&&n>-1)this.unexpected(n)}else if(this.options.ecmaVersion>=9)e.await=n>-1;return this.parseForIn(e,t)}if(n>-1)this.unexpected(n);return this.parseFor(e,t)};V.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,vn|(n?0:yi),!1,t)};V.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(h._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};V.parseReturnStatement=function(e){if(!this.allowReturn)this.raise(this.start,"'return' outside of function");if(this.next(),this.eat(h.semi)||this.insertSemicolon())e.argument=null;else e.argument=this.parseExpression(),this.semicolon();return this.finishNode(e,"ReturnStatement")};V.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(h.braceL),this.labels.push(Yu),this.enterScope(no);var t;for(var n=!1;this.type!==h.braceR;)if(this.type===h._case||this.type===h._default){var r=this.type===h._case;if(t)this.finishNode(t,"SwitchCase");if(e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r)t.test=this.parseExpression();else{if(n)this.raiseRecoverable(this.lastTokStart,"Multiple default clauses");n=!0,t.test=null}this.expect(h.colon)}else{if(!t)this.unexpected();t.consequent.push(this.parseStatement(null))}if(this.exitScope(),t)this.finishNode(t,"SwitchCase");return this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};V.parseThrowStatement=function(e){if(this.next(),Re.test(this.input.slice(this.lastTokEnd,this.start)))this.raise(this.lastTokEnd,"Illegal newline after throw");return e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Qu=[];V.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?eo:0),this.checkLValPattern(e,t?io:xt),this.expect(h.parenR),e};V.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===h._catch){var t=this.startNode();if(this.next(),this.eat(h.parenL))t.param=this.parseCatchClauseParam();else{if(this.options.ecmaVersion<10)this.unexpected();t.param=null,this.enterScope(0)}t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}if(e.finalizer=this.eat(h._finally)?this.parseBlock():null,!e.handler&&!e.finalizer)this.raise(e.start,"Missing catch or finally clause");return this.finishNode(e,"TryStatement")};V.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,"VariableDeclaration")};V.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Pi),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};V.parseWithStatement=function(e){if(this.strict)this.raise(this.start,"'with' in strict mode");return this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};V.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};V.parseLabeledStatement=function(e,t,n,r){for(var i=0,o=this.labels;i<o.length;i+=1){var s=o[i];if(s.name===t)this.raise(n.start,"Label '"+t+"' is already declared")}var c=this.type.isLoop?"loop":this.type===h._switch?"switch":null;for(var l=this.labels.length-1;l>=0;l--){var d=this.labels[l];if(d.statementStart===e.start)d.statementStart=this.start,d.kind=c;else break}return this.labels.push({name:t,kind:c,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")};V.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};V.parseBlock=function(e,t,n){if(e===void 0)e=!0;if(t===void 0)t=this.startNode();if(t.body=[],this.expect(h.braceL),e)this.enterScope(0);while(this.type!==h.braceR){var r=this.parseStatement(null);t.body.push(r)}if(n)this.strict=!1;if(this.next(),e)this.exitScope();return this.finishNode(t,"BlockStatement")};V.parseFor=function(e,t){return e.init=t,this.expect(h.semi),e.test=this.type===h.semi?null:this.parseExpression(),this.expect(h.semi),e.update=this.type===h.parenR?null:this.parseExpression(),this.expect(h.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};V.parseForIn=function(e,t){var n=this.type===h._in;if(this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier"))this.raise(t.start,(n?"for-in":"for-of")+" loop variable declaration may not have an initializer");return e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(h.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,n?"ForInStatement":"ForOfStatement")};V.parseVar=function(e,t,n,r){e.declarations=[],e.kind=n;for(;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(h.eq))i.init=this.parseMaybeAssign(t);else if(!r&&n==="const"&&!(this.type===h._in||this.options.ecmaVersion>=6&&this.isContextual("of")))this.unexpected();else if(!r&&(n==="using"||n==="await using")&&this.options.ecmaVersion>=17&&this.type!==h._in&&!this.isContextual("of"))this.raise(this.lastTokEnd,"Missing initializer in "+n+" declaration");else if(!r&&i.id.type!=="Identifier"&&!(t&&(this.type===h._in||this.isContextual("of"))))this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value");else i.init=null;if(e.declarations.push(this.finishNode(i,"VariableDeclarator")),!this.eat(h.comma))break}return e};V.parseVarId=function(e,t){e.id=t==="using"||t==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?vi:xt,!1)};var vn=1,yi=2,ao=4;V.parseFunction=function(e,t,n,r,i){if(this.initFunction(e),this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r){if(this.type===h.star&&t&yi)this.unexpected();e.generator=this.eat(h.star)}if(this.options.ecmaVersion>=8)e.async=!!r;if(t&vn){if(e.id=t&ao&&this.type!==h.name?null:this.parseIdent(),e.id&&!(t&yi))this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?vi:xt:ro)}var o=this.yieldPos,s=this.awaitPos,c=this.awaitIdentPos;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Si(e.async,e.generator)),!(t&vn))e.id=this.type===h.name?this.parseIdent():null;return this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=o,this.awaitPos=s,this.awaitIdentPos=c,this.finishNode(e,t&vn?"FunctionDeclaration":"FunctionExpression")};V.parseFunctionParams=function(e){this.expect(h.parenL),e.params=this.parseBindingList(h.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};V.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),o=!1;i.body=[],this.expect(h.braceL);while(this.type!==h.braceR){var s=this.parseClassElement(e.superClass!==null);if(s){if(i.body.push(s),s.type==="MethodDefinition"&&s.kind==="constructor"){if(o)this.raiseRecoverable(s.start,"Duplicate constructor in the same class");o=!0}else if(s.key&&s.key.type==="PrivateIdentifier"&&Zu(r,s))this.raiseRecoverable(s.key.start,"Identifier '#"+s.key.name+"' has already been declared")}}return this.strict=n,this.next(),e.body=this.finishNode(i,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};V.parseClassElement=function(e){if(this.eat(h.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r="",i=!1,o=!1,s="method",c=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(h.braceL))return this.parseClassStaticBlock(n),n;if(this.isClassElementNameStart()||this.type===h.star)c=!0;else r="static"}if(n.static=c,!r&&t>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===h.star)&&!this.canInsertSemicolon())o=!0;else r="async";if(!r&&(t>=9||!o)&&this.eat(h.star))i=!0;if(!r&&!o&&!i){var l=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())s=l;else r=l}if(r)n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,"Identifier");else this.parseClassElementName(n);if(t<13||this.type===h.parenL||s!=="method"||i||o){var d=!n.static&&tr(n,"constructor"),u=d&&e;if(d&&s!=="method")this.raise(n.key.start,"Constructor can't have get/set modifier");n.kind=d?"constructor":s,this.parseClassMethod(n,i,o,u)}else this.parseClassField(n);return n};V.isClassElementNameStart=function(){return this.type===h.name||this.type===h.privateId||this.type===h.num||this.type===h.string||this.type===h.bracketL||this.type.keyword};V.parseClassElementName=function(e){if(this.type===h.privateId){if(this.value==="constructor")this.raise(this.start,"Classes can't have an element named '#constructor'");e.computed=!1,e.key=this.parsePrivateIdent()}else this.parsePropertyName(e)};V.parseClassMethod=function(e,t,n,r){var i=e.key;if(e.kind==="constructor"){if(t)this.raise(i.start,"Constructor can't be a generator");if(n)this.raise(i.start,"Constructor can't be an async method")}else if(e.static&&tr(e,"prototype"))this.raise(i.start,"Classes may not have a static property named prototype");var o=e.value=this.parseMethod(t,n,r);if(e.kind==="get"&&o.params.length!==0)this.raiseRecoverable(o.start,"getter should have no params");if(e.kind==="set"&&o.params.length!==1)this.raiseRecoverable(o.start,"setter should have exactly one param");if(e.kind==="set"&&o.params[0].type==="RestElement")this.raiseRecoverable(o.params[0].start,"Setter cannot use rest params");return this.finishNode(e,"MethodDefinition")};V.parseClassField=function(e){if(tr(e,"constructor"))this.raise(e.key.start,"Classes can't have a field named 'constructor'");else if(e.static&&tr(e,"prototype"))this.raise(e.key.start,"Classes can't have a static field named 'prototype'");if(this.eat(h.eq))this.enterScope(An|sr),e.value=this.parseMaybeAssign(),this.exitScope();else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};V.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;this.labels=[],this.enterScope(Bt|sr);while(this.type!==h.braceR){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};V.parseClassId=function(e,t){if(this.type===h.name){if(e.id=this.parseIdent(),t)this.checkLValSimple(e.id,xt,!1)}else{if(t===!0)this.unexpected();e.id=null}};V.parseClassSuper=function(e){e.superClass=this.eat(h._extends)?this.parseExprSubscripts(null,!1):null};V.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};V.exitClassBody=function(){var e=this.privateNameStack.pop(),{declared:t,used:n}=e;if(!this.options.checkPrivateFields)return;var r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1];for(var o=0;o<n.length;++o){var s=n[o];if(!Yt(t,s.name))if(i)i.used.push(s);else this.raiseRecoverable(s.start,"Private field '#"+s.name+"' must be declared in an enclosing class")}};function Zu(e,t){var n=t.key.name,r=e[n],i="true";if(t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set"))i=(t.static?"s":"i")+t.kind;if(r==="iget"&&i==="iset"||r==="iset"&&i==="iget"||r==="sget"&&i==="sset"||r==="sset"&&i==="sget")return e[n]="true",!1;else if(!r)return e[n]=i,!1;else return!0}function tr(e,t){var{computed:n,key:r}=e;return!n&&(r.type==="Identifier"&&r.name===t||r.type==="Literal"&&r.value===t)}V.parseExportAllDeclaration=function(e,t){if(this.options.ecmaVersion>=11)if(this.eatContextual("as"))e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart);else e.exported=null;if(this.expectContextual("from"),this.type!==h.string)this.unexpected();if(e.source=this.parseExprAtom(),this.options.ecmaVersion>=16)e.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};V.parseExport=function(e,t){if(this.next(),this.eat(h.star))return this.parseExportAllDeclaration(e,t);if(this.eat(h._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration")this.checkVariableExport(t,e.declaration.declarations);else this.checkExport(t,e.declaration.id,e.declaration.id.start);if(e.specifiers=[],e.source=null,this.options.ecmaVersion>=16)e.attributes=[]}else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from")){if(this.type!==h.string)this.unexpected();if(e.source=this.parseExprAtom(),this.options.ecmaVersion>=16)e.attributes=this.parseWithClause()}else{for(var n=0,r=e.specifiers;n<r.length;n+=1){var i=r[n];if(this.checkUnreserved(i.local),this.checkLocalExport(i.local),i.local.type==="Literal")this.raise(i.local.start,"A string literal cannot be used as an exported binding without `from`.")}if(e.source=null,this.options.ecmaVersion>=16)e.attributes=[]}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};V.parseExportDeclaration=function(e){return this.parseStatement(null)};V.parseExportDefaultDeclaration=function(){var e;if(this.type===h._function||(e=this.isAsyncFunction())){var t=this.startNode();if(this.next(),e)this.next();return this.parseFunction(t,vn|ao,!1,e)}else if(this.type===h._class){var n=this.startNode();return this.parseClass(n,"nullableID")}else{var r=this.parseMaybeAssign();return this.semicolon(),r}};V.checkExport=function(e,t,n){if(!e)return;if(typeof t!=="string")t=t.type==="Identifier"?t.name:t.value;if(Yt(e,t))this.raiseRecoverable(n,"Duplicate export '"+t+"'");e[t]=!0};V.checkPatternExport=function(e,t){var n=t.type;if(n==="Identifier")this.checkExport(e,t,t.start);else if(n==="ObjectPattern")for(var r=0,i=t.properties;r<i.length;r+=1){var o=i[r];this.checkPatternExport(e,o)}else if(n==="ArrayPattern")for(var s=0,c=t.elements;s<c.length;s+=1){var l=c[s];if(l)this.checkPatternExport(e,l)}else if(n==="Property")this.checkPatternExport(e,t.value);else if(n==="AssignmentPattern")this.checkPatternExport(e,t.left);else if(n==="RestElement")this.checkPatternExport(e,t.argument)};V.checkVariableExport=function(e,t){if(!e)return;for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}};V.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};V.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")};V.parseExportSpecifiers=function(e){var t=[],n=!0;this.expect(h.braceL);while(!this.eat(h.braceR)){if(!n){if(this.expect(h.comma),this.afterTrailingComma(h.braceR))break}else n=!1;t.push(this.parseExportSpecifier(e))}return t};V.parseImport=function(e){if(this.next(),this.type===h.string)e.specifiers=Qu,e.source=this.parseExprAtom();else e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===h.string?this.parseExprAtom():this.unexpected();if(this.options.ecmaVersion>=16)e.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(e,"ImportDeclaration")};V.parseImportSpecifier=function(){var e=this.startNode();if(e.imported=this.parseModuleExportName(),this.eatContextual("as"))e.local=this.parseIdent();else this.checkUnreserved(e.imported),e.local=e.imported;return this.checkLValSimple(e.local,xt),this.finishNode(e,"ImportSpecifier")};V.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,xt),this.finishNode(e,"ImportDefaultSpecifier")};V.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,xt),this.finishNode(e,"ImportNamespaceSpecifier")};V.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===h.name){if(e.push(this.parseImportDefaultSpecifier()),!this.eat(h.comma))return e}if(this.type===h.star)return e.push(this.parseImportNamespaceSpecifier()),e;this.expect(h.braceL);while(!this.eat(h.braceR)){if(!t){if(this.expect(h.comma),this.afterTrailingComma(h.braceR))break}else t=!1;e.push(this.parseImportSpecifier())}return e};V.parseWithClause=function(){var e=[];if(!this.eat(h._with))return e;this.expect(h.braceL);var t={},n=!0;while(!this.eat(h.braceR)){if(!n){if(this.expect(h.comma),this.afterTrailingComma(h.braceR))break}else n=!1;var r=this.parseImportAttribute(),i=r.key.type==="Identifier"?r.key.name:r.key.value;if(Yt(t,i))this.raiseRecoverable(r.key.start,"Duplicate attribute key '"+i+"'");t[i]=!0,e.push(r)}return e};V.parseImportAttribute=function(){var e=this.startNode();if(e.key=this.type===h.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(h.colon),this.type!==h.string)this.unexpected();return e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")};V.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===h.string){var e=this.parseLiteral(this.value);if(Ku.test(e.value))this.raise(e.start,"An export name cannot include a lone surrogate.");return e}return this.parseIdent(!0)};V.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)};V.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value==="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var tt=me.prototype;tt.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":if(this.inAsync&&e.name==="await")this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":if(e.type="ObjectPattern",n)this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var o=i[r];if(this.toAssignable(o,t),o.type==="RestElement"&&(o.argument.type==="ArrayPattern"||o.argument.type==="ObjectPattern"))this.raise(o.argument.start,"Unexpected token")}break;case"Property":if(e.kind!=="init")this.raise(e.key.start,"Object pattern can't contain getter or setter");this.toAssignable(e.value,t);break;case"ArrayExpression":if(e.type="ArrayPattern",n)this.checkPatternErrors(n,!0);this.toAssignableList(e.elements,t);break;case"SpreadElement":if(e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern")this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":if(e.operator!=="=")this.raise(e.left.end,"Only '=' operator can be used for specifying default value.");e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,n);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else if(n)this.checkPatternErrors(n,!0);return e};tt.toAssignableList=function(e,t){var n=e.length;for(var r=0;r<n;r++){var i=e[r];if(i)this.toAssignable(i,t)}if(n){var o=e[n-1];if(this.options.ecmaVersion===6&&t&&o&&o.type==="RestElement"&&o.argument.type!=="Identifier")this.unexpected(o.argument.start)}return e};tt.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")};tt.parseRestBinding=function(){var e=this.startNode();if(this.next(),this.options.ecmaVersion===6&&this.type!==h.name)this.unexpected();return e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};tt.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case h.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(h.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case h.braceL:return this.parseObj(!0)}return this.parseIdent()};tt.parseBindingList=function(e,t,n,r){var i=[],o=!0;while(!this.eat(e)){if(o)o=!1;else this.expect(h.comma);if(t&&this.type===h.comma)i.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===h.ellipsis){var s=this.parseRestBinding();if(this.parseBindingListItem(s),i.push(s),this.type===h.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");this.expect(e);break}else i.push(this.parseAssignableListItem(r))}return i};tt.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t};tt.parseBindingListItem=function(e){return e};tt.parseMaybeDefault=function(e,t,n){if(n=n||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(h.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")};tt.checkLValSimple=function(e,t,n){if(t===void 0)t=er;var r=t!==er;switch(e.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(e.name))this.raiseRecoverable(e.start,(r?"Binding ":"Assigning to ")+e.name+" in strict mode");if(r){if(t===xt&&e.name==="let")this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name");if(n){if(Yt(n,e.name))this.raiseRecoverable(e.start,"Argument name clash");n[e.name]=!0}if(t!==so)this.declareName(e.name,t,e.start)}break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(r)this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":if(r)this.raiseRecoverable(e.start,"Binding parenthesized expression");return this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?"Binding":"Assigning to")+" rvalue")}};tt.checkLValPattern=function(e,t,n){if(t===void 0)t=er;switch(e.type){case"ObjectPattern":for(var r=0,i=e.properties;r<i.length;r+=1){var o=i[r];this.checkLValInnerPattern(o,t,n)}break;case"ArrayPattern":for(var s=0,c=e.elements;s<c.length;s+=1){var l=c[s];if(l)this.checkLValInnerPattern(l,t,n)}break;default:this.checkLValSimple(e,t,n)}};tt.checkLValInnerPattern=function(e,t,n){if(t===void 0)t=er;switch(e.type){case"Property":this.checkLValInnerPattern(e.value,t,n);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,n);break;case"RestElement":this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var Qe=function(t,n,r,i,o){this.token=t,this.isExpr=!!n,this.preserveSpace=!!r,this.override=i,this.generator=!!o},he={b_stat:new Qe("{",!1),b_expr:new Qe("{",!0),b_tmpl:new Qe("${",!1),p_stat:new Qe("(",!1),p_expr:new Qe("(",!0),q_tmpl:new Qe("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new Qe("function",!1),f_expr:new Qe("function",!0),f_expr_gen:new Qe("function",!0,!1,null,!0),f_gen:new Qe("function",!1,!1,null,!0)},Qt=me.prototype;Qt.initialContext=function(){return[he.b_stat]};Qt.curContext=function(){return this.context[this.context.length-1]};Qt.braceIsBlock=function(e){var t=this.curContext();if(t===he.f_expr||t===he.f_stat)return!0;if(e===h.colon&&(t===he.b_stat||t===he.b_expr))return!t.isExpr;if(e===h._return||e===h.name&&this.exprAllowed)return Re.test(this.input.slice(this.lastTokEnd,this.start));if(e===h._else||e===h.semi||e===h.eof||e===h.parenR||e===h.arrow)return!0;if(e===h.braceL)return t===he.b_stat;if(e===h._var||e===h._const||e===h.name)return!1;return!this.exprAllowed};Qt.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return!1};Qt.updateContext=function(e){var t,n=this.type;if(n.keyword&&e===h.dot)this.exprAllowed=!1;else if(t=n.updateContext)t.call(this,e);else this.exprAllowed=n.beforeExpr};Qt.overrideContext=function(e){if(this.curContext()!==e)this.context[this.context.length-1]=e};h.parenR.updateContext=h.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();if(e===he.b_stat&&this.curContext().token==="function")e=this.context.pop();this.exprAllowed=!e.isExpr};h.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?he.b_stat:he.b_expr),this.exprAllowed=!0};h.dollarBraceL.updateContext=function(){this.context.push(he.b_tmpl),this.exprAllowed=!0};h.parenL.updateContext=function(e){var t=e===h._if||e===h._for||e===h._with||e===h._while;this.context.push(t?he.p_stat:he.p_expr),this.exprAllowed=!0};h.incDec.updateContext=function(){};h._function.updateContext=h._class.updateContext=function(e){if(e.beforeExpr&&e!==h._else&&!(e===h.semi&&this.curContext()!==he.p_stat)&&!(e===h._return&&Re.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===h.colon||e===h.braceL)&&this.curContext()===he.b_stat))this.context.push(he.f_expr);else this.context.push(he.f_stat);this.exprAllowed=!1};h.colon.updateContext=function(){if(this.curContext().token==="function")this.context.pop();this.exprAllowed=!0};h.backQuote.updateContext=function(){if(this.curContext()===he.q_tmpl)this.context.pop();else this.context.push(he.q_tmpl);this.exprAllowed=!1};h.star.updateContext=function(e){if(e===h._function){var t=this.context.length-1;if(this.context[t]===he.f_expr)this.context[t]=he.f_expr_gen;else this.context[t]=he.f_gen}this.exprAllowed=!0};h.name.updateContext=function(e){var t=!1;if(this.options.ecmaVersion>=6&&e!==h.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())t=!0}this.exprAllowed=t};var z=me.prototype;z.checkPropClash=function(e,t,n){if(this.options.ecmaVersion>=9&&e.type==="SpreadElement")return;if(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))return;var r=e.key,i;switch(r.type){case"Identifier":i=r.name;break;case"Literal":i=String(r.value);break;default:return}var o=e.kind;if(this.options.ecmaVersion>=6){if(i==="__proto__"&&o==="init"){if(t.proto)if(n){if(n.doubleProto<0)n.doubleProto=r.start}else this.raiseRecoverable(r.start,"Redefinition of __proto__ property");t.proto=!0}return}i="$"+i;var s=t[i];if(s){var c;if(o==="init")c=this.strict&&s.init||s.get||s.set;else c=s.init||s[o];if(c)this.raiseRecoverable(r.start,"Redefinition of property")}else s=t[i]={init:!1,get:!1,set:!1};s[o]=!0};z.parseExpression=function(e,t){var n=this;return this.catchStackOverflow(function(){var{start:r,startLoc:i}=n,o=n.parseMaybeAssign(e,t);if(n.type===h.comma){var s=n.startNodeAt(r,i);s.expressions=[o];while(n.eat(h.comma))s.expressions.push(n.parseMaybeAssign(e,t));return n.finishNode(s,"SequenceExpression")}return o})};z.parseMaybeAssign=function(e,t,n){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(e);else this.exprAllowed=!1;var r=!1,i=-1,o=-1,s=-1;if(t)i=t.parenthesizedAssign,o=t.trailingComma,s=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1;else t=new or,r=!0;var c=this.start,l=this.startLoc;if(this.type===h.parenL||this.type===h.name)this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await";var d=this.parseMaybeConditional(e,t);if(n)d=n.call(this,d,c,l);if(this.type.isAssign){var u=this.startNodeAt(c,l);if(u.operator=this.value,this.type===h.eq)d=this.toAssignable(d,!1,t);if(!r)t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1;if(t.shorthandAssign>=d.start)t.shorthandAssign=-1;if(this.type===h.eq)this.checkLValPattern(d);else this.checkLValSimple(d);if(u.left=d,this.next(),u.right=this.parseMaybeAssign(e),s>-1)t.doubleProto=s;return this.finishNode(u,"AssignmentExpression")}else if(r)this.checkExpressionErrors(t,!0);if(i>-1)t.parenthesizedAssign=i;if(o>-1)t.trailingComma=o;return d};z.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(!(i.type==="ArrowFunctionExpression"&&i.start===n)&&this.eat(h.question)){var o=this.startNodeAt(n,r);return o.test=i,o.consequent=this.parseMaybeAssign(),this.expect(h.colon),o.alternate=this.parseMaybeAssign(e),this.finishNode(o,"ConditionalExpression")}return i};z.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);if(this.checkExpressionErrors(t))return i;return i.start===n&&i.type==="ArrowFunctionExpression"?i:this.parseExprOp(i,n,r,-1,e)};z.parseExprOp=function(e,t,n,r,i){var o=this.type.binop;if(o!=null&&(!i||this.type!==h._in)){if(o>r){var s=this.type===h.logicalOR||this.type===h.logicalAND,c=this.type===h.coalesce;if(c)o=h.logicalAND.binop;var l=this.value;this.next();var d=this.start,u=this.startLoc,y=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),d,u,o,i),g=this.buildBinary(t,n,e,y,l,s||c);if(s&&this.type===h.coalesce||c&&(this.type===h.logicalOR||this.type===h.logicalAND))this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");return this.parseExprOp(g,t,n,r,i)}}return e};z.buildBinary=function(e,t,n,r,i,o){if(r.type==="PrivateIdentifier")this.raise(r.start,"Private identifier can only be left side of binary expression");var s=this.startNodeAt(e,t);return s.left=n,s.operator=i,s.right=r,this.finishNode(s,o?"LogicalExpression":"BinaryExpression")};z.parseMaybeUnary=function(e,t,n,r){var i=this.start,o=this.startLoc,s;if(this.isContextual("await")&&this.canAwait)s=this.parseAwait(r),t=!0;else if(this.type.prefix){var c=this.startNode(),l=this.type===h.incDec;if(c.operator=this.value,c.prefix=!0,this.next(),c.argument=this.parseMaybeUnary(null,!0,l,r),this.checkExpressionErrors(e,!0),l)this.checkLValSimple(c.argument);else if(this.strict&&c.operator==="delete"&&oo(c.argument))this.raiseRecoverable(c.start,"Deleting local variable in strict mode");else if(c.operator==="delete"&&gi(c.argument))this.raiseRecoverable(c.start,"Private fields can not be deleted");else t=!0;s=this.finishNode(c,l?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===h.privateId){if((r||this.privateNameStack.length===0)&&this.options.checkPrivateFields)this.unexpected();if(s=this.parsePrivateIdent(),this.type!==h._in)this.unexpected()}else{if(s=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return s;while(this.type.postfix&&!this.canInsertSemicolon()){var d=this.startNodeAt(i,o);d.operator=this.value,d.prefix=!1,d.argument=s,this.checkLValSimple(s),this.next(),s=this.finishNode(d,"UpdateExpression")}}if(!n&&!(s.type==="ArrowFunctionExpression"&&s.start===i)&&this.eat(h.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(i,o,s,this.parseMaybeUnary(null,!1,!1,r),"**",!1);else return s};function oo(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&oo(e.expression)}function gi(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&gi(e.expression)||e.type==="ParenthesizedExpression"&&gi(e.expression)}z.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprAtom(e,t);if(i.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return i;var o=this.parseSubscripts(i,n,r,!1,t);if(e&&o.type==="MemberExpression"){if(e.parenthesizedAssign>=o.start)e.parenthesizedAssign=-1;if(e.parenthesizedBind>=o.start)e.parenthesizedBind=-1;if(e.trailingComma>=o.start)e.trailingComma=-1}return o};z.parseSubscripts=function(e,t,n,r,i){var o=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,s=!1;while(!0){var c=this.parseSubscript(e,t,n,r,o,s,i);if(c.optional)s=!0;if(c===e||c.type==="ArrowFunctionExpression"){if(s){var l=this.startNodeAt(t,n);l.expression=c,c=this.finishNode(l,"ChainExpression")}return c}e=c}};z.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(h.arrow)};z.parseSubscriptAsyncArrow=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,r)};z.parseSubscript=function(e,t,n,r,i,o,s){var c=this.options.ecmaVersion>=11,l=c&&this.eat(h.questionDot);if(r&&l)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var d=this.eat(h.bracketL);if(d||l&&this.type!==h.parenL&&this.type!==h.backQuote||this.eat(h.dot)){var u=this.startNodeAt(t,n);if(u.object=e,d)u.property=this.parseExpression(),this.expect(h.bracketR);else if(this.type===h.privateId&&e.type!=="Super")u.property=this.parsePrivateIdent();else u.property=this.parseIdent(this.options.allowReserved!=="never");if(u.computed=!!d,c)u.optional=l;e=this.finishNode(u,"MemberExpression")}else if(!r&&this.eat(h.parenL)){var y=new or,g=this.yieldPos,b=this.awaitPos,P=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var N=this.parseExprList(h.parenR,this.options.ecmaVersion>=8,!1,y);if(i&&!l&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(y,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");return this.yieldPos=g,this.awaitPos=b,this.awaitIdentPos=P,this.parseSubscriptAsyncArrow(t,n,N,s)}this.checkExpressionErrors(y,!0),this.yieldPos=g||this.yieldPos,this.awaitPos=b||this.awaitPos,this.awaitIdentPos=P||this.awaitIdentPos;var D=this.startNodeAt(t,n);if(D.callee=e,D.arguments=N,c)D.optional=l;e=this.finishNode(D,"CallExpression")}else if(this.type===h.backQuote){if(l||o)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var j=this.startNodeAt(t,n);j.tag=e,j.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(j,"TaggedTemplateExpression")}return e};z.parseExprAtom=function(e,t,n){if(this.type===h.slash)this.readRegexp();var r,i=this.potentialArrowAt===this.start;switch(this.type){case h._super:if(!this.allowSuper)this.raise(this.start,"'super' keyword outside a method");if(r=this.startNode(),this.next(),this.type===h.parenL&&!this.allowDirectSuper)this.raise(r.start,"super() call outside constructor of a subclass");if(this.type!==h.dot&&this.type!==h.bracketL&&this.type!==h.parenL)this.unexpected();return this.finishNode(r,"Super");case h._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case h.name:var o=this.start,s=this.startLoc,c=this.containsEsc,l=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!c&&l.name==="async"&&!this.canInsertSemicolon()&&this.eat(h._function))return this.overrideContext(he.f_expr),this.parseFunction(this.startNodeAt(o,s),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(h.arrow))return this.parseArrowExpression(this.startNodeAt(o,s),[l],!1,t);if(this.options.ecmaVersion>=8&&l.name==="async"&&this.type===h.name&&!c&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(l=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(h.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(o,s),[l],!0,t)}}return l;case h.regexp:var d=this.value;return r=this.parseLiteral(d.value),r.regex={pattern:d.pattern,flags:d.flags},r;case h.num:case h.string:return this.parseLiteral(this.value);case h._null:case h._true:case h._false:return r=this.startNode(),r.value=this.type===h._null?null:this.type===h._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,"Literal");case h.parenL:var u=this.start,y=this.parseParenAndDistinguishExpression(i,t);if(e){if(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(y))e.parenthesizedAssign=u;if(e.parenthesizedBind<0)e.parenthesizedBind=u}return y;case h.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(h.bracketR,!0,!0,e),this.finishNode(r,"ArrayExpression");case h.braceL:return this.overrideContext(he.b_expr),this.parseObj(!1,e);case h._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case h._class:return this.parseClass(this.startNode(),!1);case h._new:return this.parseNew();case h.backQuote:return this.parseTemplate();case h._import:if(this.options.ecmaVersion>=11)return this.parseExprImport(n);else return this.unexpected();default:return this.parseExprAtomDefault()}};z.parseExprAtomDefault=function(){this.unexpected()};z.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword import");if(this.next(),this.type===h.parenL&&!e)return this.parseDynamicImport(t);else if(this.type===h.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name="import",t.meta=this.finishNode(n,"Identifier"),this.parseImportMeta(t)}else this.unexpected()};z.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)if(!this.eat(h.parenR))if(this.expect(h.comma),!this.afterTrailingComma(h.parenR)){if(e.options=this.parseMaybeAssign(),!this.eat(h.parenR)){if(this.expect(h.comma),!this.afterTrailingComma(h.parenR))this.unexpected()}}else e.options=null;else e.options=null;else if(!this.eat(h.parenR)){var t=this.start;if(this.eat(h.comma)&&this.eat(h.parenR))this.raiseRecoverable(t,"Trailing comma is not allowed in import()");else this.unexpected(t)}return this.finishNode(e,"ImportExpression")};z.parseImportMeta=function(e){this.next();var t=this.containsEsc;if(e.property=this.parseIdent(!0),e.property.name!=="meta")this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'");if(t)this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters");if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere)this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module");return this.finishNode(e,"MetaProperty")};z.parseLiteral=function(e){var t=this.startNode();if(t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110)t.bigint=t.value!=null?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"");return this.next(),this.finishNode(t,"Literal")};z.parseParenExpression=function(){this.expect(h.parenL);var e=this.parseExpression();return this.expect(h.parenR),e};z.shouldParseArrow=function(e){return!this.canInsertSemicolon()};z.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,o=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s=this.start,c=this.startLoc,l=[],d=!0,u=!1,y=new or,g=this.yieldPos,b=this.awaitPos,P;this.yieldPos=0,this.awaitPos=0;while(this.type!==h.parenR)if(d?d=!1:this.expect(h.comma),o&&this.afterTrailingComma(h.parenR,!0)){u=!0;break}else if(this.type===h.ellipsis){if(P=this.start,l.push(this.parseParenItem(this.parseRestBinding())),this.type===h.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else l.push(this.parseMaybeAssign(!1,y,this.parseParenItem));var N=this.lastTokEnd,D=this.lastTokEndLoc;if(this.expect(h.parenR),e&&this.shouldParseArrow(l)&&this.eat(h.arrow))return this.checkPatternErrors(y,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=g,this.awaitPos=b,this.parseParenArrowList(n,r,l,t);if(!l.length||u)this.unexpected(this.lastTokStart);if(P)this.unexpected(P);if(this.checkExpressionErrors(y,!0),this.yieldPos=g||this.yieldPos,this.awaitPos=b||this.awaitPos,l.length>1)i=this.startNodeAt(s,c),i.expressions=l,this.finishNodeAt(i,"SequenceExpression",N,D);else i=l[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var j=this.startNodeAt(n,r);return j.expression=i,this.finishNode(j,"ParenthesizedExpression")}else return i};z.parseParenItem=function(e){return e};z.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var ed=[];z.parseNew=function(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===h.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var n=this.containsEsc;if(e.property=this.parseIdent(!0),e.property.name!=="target")this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'");if(n)this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block");return this.finishNode(e,"MetaProperty")}var r=this.start,i=this.startLoc;if(e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,i,!0,!1),e.callee.type==="Super")this.raiseRecoverable(r,"Invalid use of 'super'");if(this.eat(h.parenL))e.arguments=this.parseExprList(h.parenR,this.options.ecmaVersion>=8,!1);else e.arguments=ed;return this.finishNode(e,"NewExpression")};z.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();if(this.type===h.invalidTemplate){if(!t)this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal");n.value={raw:this.value.replace(/\r\n?/g,`
25
+ }`:`{ ${r} }`}function Cu({hasTypeScriptType:e,hasJSDocType:t,inferredType:n,finalType:r}){if(e)return"typescript";if(t)return"jsdoc";if(n!==void 0)return"default";if(r!==void 0)return"inferred";return"unknown"}function In(e){let t=e.explicitType??e.jsdocType??e.resolvedType??e.typeSeed,n=e.jsdocParams??e.resolvedParams,r=e.jsdocReturnType??e.resolvedReturnType;if((e.isFunctionDeclaration?t==="() => any":e.initializerIsFunction&&t===e.typeSeed)&&r){let d=e.jsdocTypeParameters?`<${e.jsdocTypeParameters}>`:"";t=n&&n.length>0?`${d}(${Ye(n)}) => ${r}`:`${d}() => ${r}`}let a=e.jsdocDescription??e.resolvedDescription;if(a===void 0&&t!==void 0)a=e.typedefs?.get(t)?.description;let s=Cu({hasTypeScriptType:e.explicitType!==void 0,hasJSDocType:e.jsdocType!==void 0||e.jsdocParams!==void 0||e.jsdocReturnType!==void 0||e.resolvedType!==void 0,inferredType:e.inferredTypeForSource,finalType:t}),p=e.initializerIsFunction||e.isFunctionDeclaration||e.inferIsFunctionFromTypeSignature===!0&&(!!e.jsdocParams?.length||e.jsdocReturnType!==void 0||!!e.jsdocType?.includes("=>")||!!e.resolvedType?.includes("=>")||!!e.explicitType?.includes("=>")),c=p?e.jsdocTypeParameters:void 0;return{type:t,typeSource:s,description:a,params:n,returnType:r,isFunction:p,typeParameters:c}}function _n(e){if(e?.type==="Identifier")return e.name;return typeof e?.value==="string"?e.value:void 0}function xa(e,t){for(let n of e?.body??[]){let r=n.type==="ExportNamedDeclaration"&&n.declaration?n.declaration:n;if(r.type==="VariableDeclaration"){let i=r.declarations.find((a)=>a.id.type==="Identifier"?a.id.name===t:Q(a.id).has(t));if(i)return{declaration:r,declarator:i,statement:n}}else if((r.type==="FunctionDeclaration"||r.type==="ClassDeclaration")&&r.id?.name===t)return{declaration:r,statement:n}}return}function Pu(e,t){for(let n of e?.body??[]){if(n.type!=="LabeledStatement"||n.label.name!=="$")continue;if(n.body.type!=="ExpressionStatement")continue;let r=n.body.expression;if(r.type!=="AssignmentExpression"||r.operator!=="=")continue;if(!Q(r.left).has(t))continue;let i={type:"VariableDeclarator",id:r.left,init:r.right};return{declaration:{type:"VariableDeclaration",kind:"let",declarations:[i]},declarator:i,statement:n}}return}function Au(e){if(e==="var")return"let";if(e==="using"||e==="await using")return"const";return e}function Ur(e,t,n,r,i){let a=_n(n.local),s=_n(n.exported);if(!a||!s)return;if(t.source!=null)return{localName:a,exportedName:s};let p=xa(r,a);if(!p&&i==="instance")p=xa(e.parsed?.module?.content,a)??Pu(r,a);return{localName:a,exportedName:s,...p}}function Gr(e,t,n,r){let i=t.source?.value,a=typeof i==="string"?`it re-exports from "${i}"`:e.valueImportBindingsByLocalName.has(n)?"it re-exports an imported binding":"no matching local declaration was found";G(e,"export-unresolved",r,`export "${r}" was skipped because ${a}; sveld only resolves exports of a local declaration.`,H(e,t))}function Ln(e,t,n){if(!n)return ne(e,t);let r=t.specifiers.length===1?ne(e,t):void 0,i=ne(e,n.statement);if(!r||!i)return r??i;let a=Object.fromEntries(Object.entries(r).filter(([,s])=>s!==void 0));return{...i,...a,internal:r.internal||i.internal}}function Wr(e,t,n,r){let i=[];if(t.type==="FunctionDeclaration"){let c=t;if(!c.id?.name)return i;let d=e.scriptLanguage==="ts"?js(e,c):void 0;return i.push({prop_name:n?.exportedName??c.id.name,kind:"function",isFunctionDeclaration:!0,value:void 0,typeSeed:d?.hasAnnotations?void 0:"() => any",explicitType:d?.hasAnnotations?d.signature:void 0,initializerIsFunction:!0,isRequired:!1,localName:c.id.name,defaultValue:void 0,inferredTypeForSource:void 0,resolvedJSDoc:void 0}),i}if(t.type!=="VariableDeclaration")return i;let a=t,s=Au(a.kind),p=n?.declarator?[n.declarator]:a.declarations;for(let c of p){if(!c||typeof c!=="object"||!("id"in c))continue;let{id:d,init:u}=c;if(!d||typeof d!=="object")continue;if(d.type!=="Identifier"){for(let B of Q(d)){if(n&&n.localName!==B)continue;i.push({prop_name:n?.exportedName??B,kind:s,isFunctionDeclaration:!1,value:void 0,typeSeed:void 0,explicitType:void 0,initializerIsFunction:!1,isRequired:!1,localName:B,defaultValue:void 0,inferredTypeForSource:void 0,resolvedJSDoc:void 0})}continue}let y=d.name,x=n?.exportedName??y,g=u==null?{isFunction:!1}:Ge(e,u),{value:C,type:v,isFunction:w,defaultValue:R}=g;An(e,g,x,r),i.push({prop_name:x,kind:s,isFunctionDeclaration:!1,value:C,typeSeed:v,explicitType:e.explicitPropTypesByName.get(y),initializerIsFunction:w,isRequired:s==="let"&&u==null,localName:y,defaultValue:R,inferredTypeForSource:v,resolvedJSDoc:g})}return i}function zr(e,t,n){let{resolvedJSDoc:r}=t;return In({explicitType:t.explicitType,typeSeed:t.typeSeed,inferredTypeForSource:t.inferredTypeForSource,jsdocType:n?.type,jsdocDescription:n?.description,jsdocParams:n?.params,jsdocReturnType:n?.returnType,jsdocTypeParameters:n?.typeParameters,resolvedType:r?.resolvedType,resolvedDescription:r?.resolvedDescription,resolvedParams:r?.resolvedParams,resolvedReturnType:r?.resolvedReturnType,initializerIsFunction:t.initializerIsFunction,isFunctionDeclaration:t.isFunctionDeclaration,typedefs:e.typedefs})}function ku(e,t,n){G(e,"export-unresolved",n,`export "${n}" was skipped because a class can't be a prop; export it from the module script instead.`,H(e,t))}function ba(e,t,n,r){if(n.type==="ClassDeclaration"){if(n.id)ku(e,t,r?.exportedName??n.id.name);return}let i=Wr(e,n,r,"props");if(i.length===0)return;let a=Ln(e,t,r);for(let s of i){let{prop_name:p,kind:c,localName:d}=s,{type:u,typeSource:y,description:x,params:g,returnType:C,isFunction:v,typeParameters:w}=zr(e,s,a);Oe(e,"prop-unknown-type",p,a?.sveldIgnore),St(e,p,{name:p,...d!==void 0&&d!==p?{localName:d}:{},kind:c,description:x,binding:a?.binding,deprecated:a?.deprecated,tags:a?.tags,...a?.internal?{internal:!0}:{},type:u,typeSource:y,value:s.value,defaultValue:s.defaultValue,params:g,returnType:C,typeParameters:w,isFunction:v,isFunctionDeclaration:s.isFunctionDeclaration,isRequired:s.isRequired,constant:c==="const",reactive:e.reactive_vars.has(p),source:H(e,t)})}}function Ta(e,t,n){if(t.declaration!=null){ba(e,t,t.declaration);return}for(let r of t.specifiers){let i=Ur(e,t,r,n,"instance");if(!i)continue;if(i.declaration)ba(e,t,i.declaration,i);else Gr(e,t,i.localName,i.exportedName)}}function wu(e){if(!e||typeof e!=="object"||!("type"in e))return;let t=String(e.type),n=Gt(t);if(!n&&!Wt(t))return;let r="name"in e&&typeof e.name==="string"?e.name:void 0;if(!r)return;let i=n?{type:"InlineComponent",name:r}:{type:"Element",name:r};if(r==="svelte:element"&&"tag"in e&&e.tag&&typeof e.tag==="object"){let a=e.tag;if(a.type==="Literal"&&typeof a.value==="string")i.thisValue=a.value}return i}function va(e,t){let n=wu(t);if(!n)return;if(e.rest_props===void 0){e.rest_props=n;return}if(e.rest_props.type==="InlineComponent"&&n.type==="Element")e.rest_props=n}var Nu=/^[A-Za-z_$][\w$]*/,Du=/[A-Za-z_$][\w$]*/g,Sa=/^(?:const|in|out)\s+/;function Ea(e){let t=se(e,",").map((r)=>r.trim()).filter((r)=>r.length>0);if(t.length===0)return null;return[t.map((r)=>{let i=r;while(Sa.test(i))i=i.replace(Sa,"");return i.match(Nu)?.[0]??r}).join(", "),t.join(", ")]}function Ca(e,t,n){let r=e.scriptGenericsAttribute?.value;if(!r)return;for(let[i]of r.matchAll(Du)){if(e.typeImportBindingsByLocalName.has(i))t.add(i);if(n.has(i))continue;let a=e.localTypeDeclarationsByName.get(i);if(!a)continue;n.add(i),ae(e,a.node,t,n)}}function Rn(e,t,n){if(e.generics)e.generics=[`${e.generics[0]}, ${t}`,`${e.generics[1]}, ${n}`];else e.generics=[t,n]}function Kr(e){if(!Array.isArray(e.value))return;return e.value.map((t)=>t.type==="Text"?t.data:"").join("").trim()}function Pa(e){let t=[e.instance,e.module].filter((r)=>r!==void 0),n=!1;for(let r of t){let i=r.attributes.find((s)=>s.name==="lang");if(!i){n=!0;continue}if(Kr(i)?.toLowerCase()==="ts")return"ts"}return n?"js":void 0}function Aa(e,t){let n=t.instance?.attributes.find((p)=>p.name==="generics");if(!n)return;let r=H(e,n),i=t.instance?.attributes.find((p)=>p.name==="lang");if((i?Kr(i)?.toLowerCase():void 0)!=="ts"){G(e,"syntax-skipped","generics",'<script generics="..."> requires lang="ts"; the generics attribute was ignored because the script is not TypeScript.',r);return}let s=Kr(n);if(!s)return;return{value:s,source:r}}var Iu=/[A-Za-z_$][\w$]*/g;function _u(e,t,n){let r=new Map,i=t.typeParameters?.params,a=n.typeArguments?.params;if(!i?.length||!a?.length)return r;for(let s=0;s<i.length;s++){let p=i[s]?.name,c=a[s];if(!p||c?.start===void 0||c?.end===void 0)continue;let d=z(e,c.start,c.end)?.trim();if(d)r.set(p,d)}return r}function Lu(e,t){if(t.size===0)return e;return e.replace(Iu,(n)=>t.get(n)??n)}function Ct(e,t,n,r=new Set){let i=new Map;if(!t?.type)return i;let a=(s)=>{for(let p of s){if(p?.type!=="TSPropertySignature"||p.computed)continue;if(!p.key)continue;let c=ie(p.key);if(!c)continue;let d=p.typeAnnotation?.start,u=p.typeAnnotation?.end;if(d===void 0||u===void 0)continue;let y=z(e,d+1,u)?.trim();if(!y)continue;te(e,p.typeAnnotation?.typeAnnotation);let x=Dr(e,p);i.set(c,{type:y,optional:p.optional===!0,source:H(e,p),...x?{jsdoc:x}:{}})}};switch(t.type){case"TSTypeLiteral":a(t.members??[]);break;case"TSInterfaceDeclaration":a(t.body?.body??[]);break;case"TSTypeAliasDeclaration":{let s=Ct(e,t.typeAnnotation,n,r);for(let[p,c]of s)i.set(p,c);break}case"TSTypeReference":{let s=Fs(t.typeName);if(!s||r.has(s))break;let p=n.get(s);if(!p)break;r.add(s);let c=Ct(e,p,n,r);r.delete(s);let d=_u(e,p,t);for(let[u,y]of c)i.set(u,d.size===0?y:{...y,type:Lu(y.type,d)});break}case"TSIntersectionType":for(let s of t.types??[]){let p=Ct(e,s,n,r);for(let[c,d]of p)i.set(c,d)}break;case"TSParenthesizedType":{let s=Ct(e,t.typeAnnotation,n,r);for(let[p,c]of s)i.set(p,c);break}}return i}function ka(e){return e?.content.body??[]}function Ru(e){let t={};for(let[n,r]of Object.entries(e))t[n]={...r.attribute===void 0?{}:{attribute:r.attribute},...r.reflect===void 0?{}:{reflect:r.reflect},...r.type===void 0?{}:{type:r.type}};return t}function Jr(e,t,n){if(t.type==="ImportDeclaration"&&t.source?.value)for(let i of t.specifiers??[]){let a=i.local?.name;if(!a)continue;if(!(t.importKind==="type"||i.importKind==="type"))continue;let p,c;if(i.type==="ImportSpecifier")p="named",c=i.imported?.type==="Identifier"?i.imported.name:typeof i.imported?.value==="string"?i.imported.value:void 0;else if(i.type==="ImportDefaultSpecifier")p="default";else if(i.type==="ImportNamespaceSpecifier")p="namespace";if(!p)continue;e.typeImportBindingsByLocalName.set(a,{importedName:c,localName:a,source:String(t.source.value),specifierType:p})}let r=t.type==="TSEnumDeclaration";if((r||t.type==="TSInterfaceDeclaration"||t.type==="TSTypeAliasDeclaration")&&t.id?.name&&t.start!==void 0&&t.end!==void 0){let i=r?Vs(e,t):z(e,t.start,t.end)?.trim();e.localTypeDeclarationsByName.set(t.id.name,{code:i??"",node:t,start:t.start,...n?{exported:n}:{}})}}function Na(e,t){if(e.runesPropsDeclarationMetadataByDeclaratorStart.clear(),e.explicitPropTypesByName.clear(),e.explicitVariableTypesByName.clear(),e.explicitVariableTypeNodesByName.clear(),e.typeImportBindingsByLocalName.clear(),e.localTypeDeclarationsByName.clear(),e.additionalTypeDependencyNodes.length=0,e.typedRunesPropsDeclarations.length=0,!e.source)return;e.scriptLanguage=Pa(t);let n=t.options?.customElement;e.customElementTag=n?.tag,e.customElement=n?{...n.tag===void 0?{}:{tag:n.tag},...n.shadow==="open"||n.shadow==="none"?{shadow:n.shadow}:{},...n.props?{props:Ru(n.props)}:{},...n.extend===void 0?{}:{extend:!0}}:void 0,e.runesOptionOverride=t.options?.runes,e.scriptGenericsAttribute=Aa(e,t);let r=ka(t.module),i=new Set;for(let s of r){if(!s?.type)continue;if(s.type==="ExportNamedDeclaration"&&s.declaration)Jr(e,s.declaration,!0);else if(s.type==="ExportNamedDeclaration"&&!s.source)for(let p of s.specifiers??[]){let c=p.local?.name;if(c&&c===p.exported?.name)i.add(c)}else Jr(e,s,!1)}for(let s of i){let p=e.localTypeDeclarationsByName.get(s);if(p)p.exported=!0}let a=ka(t.instance);for(let s of a){if(!s?.type)continue;if(Jr(e,s,!1),s.type==="ExportNamedDeclaration"&&s.declaration?.type==="VariableDeclaration")for(let p of s.declaration.declarations??[]){if(p.id?.type!=="Identifier"||!p.id.name)continue;let c=Ue(e,p.id.typeAnnotation);if(c)e.explicitPropTypesByName.set(p.id.name,c),te(e,p.id.typeAnnotation?.typeAnnotation)}else if(s.type==="VariableDeclaration")for(let p of s.declarations??[]){if(p.id?.type!=="Identifier"||!p.id.name)continue;let c=Ue(e,p.id.typeAnnotation);if(c){e.explicitVariableTypesByName.set(p.id.name,c);let d=p.id.typeAnnotation?.typeAnnotation;if(d)e.explicitVariableTypeNodesByName.set(p.id.name,d)}}}for(let s of a){if(!s||typeof s!=="object"||!("declarations"in s))continue;for(let p of s.declarations??[]){if(!Me(Xe(p.init),"$props"))continue;let c=p.id?.typeAnnotation?void 0:Ss(p.init),d=p.id?.typeAnnotation?.typeAnnotation??c,u=p.id?.typeAnnotation?Ue(e,p.id.typeAnnotation):ct(e,c),y=Ct(e,d,new Map(Array.from(e.localTypeDeclarationsByName.entries(),([C,v])=>[C,v.node]))),x=new Set,g=new Set;if(ae(e,d,x,g),Ca(e,x,g),p.start!==void 0){let C={canonicalType:u,props:y,referencedImportedTypes:x,referencedLocalTypes:g};if(e.runesPropsDeclarationMetadataByDeclaratorStart.set(p.start,C),u)e.typedRunesPropsDeclarations.push(C)}}}}function wa(e,t){let n=t?.trim();if(!n)return;let r=e.typedefMembersByName.get(n)??qe(n);return r?new Map(r.map((i)=>[i.name,i])):void 0}function Da(e,t){for(let n of t.declarations){if(!Me(Xe(n.init),"$props"))continue;if(n.id.type==="Identifier"){e.wholePropsLocals.add(n.id.name),e.restPropLocals.add(n.id.name);let s=Cn(e,n.start),p=s?.props.size?void 0:wa(e,ne(e,t)?.type);for(let c of p?.values()??[])St(e,c.name,{name:c.name,kind:"let",description:c.description,type:c.type,typeSource:"jsdoc",isFunction:c.type.includes("=>"),isFunctionDeclaration:!1,isRequired:!c.optional,constant:!1,reactive:!1});if(s)for(let[c,d]of s.props)St(e,c,{name:c,kind:"let",description:d.jsdoc?.description,deprecated:d.jsdoc?.deprecated,tags:d.jsdoc?.tags,type:d.type,typeSource:"typescript",isFunction:!1,isFunctionDeclaration:!1,isRequired:!d.optional,constant:!1,reactive:!1,source:d.source});continue}if(n.id.type!=="ObjectPattern")continue;let r=ne(e,t),i=Cn(e,n.start)?.props.size?void 0:wa(e,r?.type),a=n.id.properties.filter((s)=>{if(s.type!=="Property"||s.computed)return!1;if(!ie(s.key))return!1;if(s.value.type==="Identifier")return!0;return s.value.type==="AssignmentPattern"&&s.value.left.type==="Identifier"}).length;for(let s of n.id.properties){if(s.type==="RestElement"){if(s.argument.type==="Identifier")e.restPropLocals.add(s.argument.name);continue}let p=ie(s.key);if(!p)continue;let c,d;if(s.value.type==="Identifier")c=s.value.name;else{let f=s.value;c=f.left.name,d=f.right}if(!c)continue;if(fn(e,p,c),p==="children")e.snippetPropLocals.add(c);let u=i?.get(p),y=Bs(e,n.start,p),x=Dr(e,s)??y?.jsdoc??(a===1&&!i?r:void 0),{init:g,bindable:C}=Ys(d),v=g==null?{isFunction:!1}:Ge(e,g),{value:w,type:R,isFunction:B,defaultValue:L}=v,k=y?.type===void 0&&x?.type===void 0?v.resolvedType:void 0;An(e,v,p,"props");let{type:_,typeSource:j,description:Fe,params:ot,returnType:o,isFunction:l}=In({explicitType:y?.type,typeSeed:R,inferredTypeForSource:R,jsdocType:x?.type??u?.type,jsdocDescription:x?.description??u?.description,jsdocParams:x?.params,jsdocReturnType:x?.returnType,resolvedType:k,resolvedDescription:v.resolvedDescription,resolvedParams:v.resolvedParams,resolvedReturnType:v.resolvedReturnType,initializerIsFunction:B,isFunctionDeclaration:!1,inferIsFunctionFromTypeSignature:!0});if(C)e.reactive_vars.add(p);Oe(e,"prop-unknown-type",p,x?.sveldIgnore),St(e,p,{name:p,...c===p?{}:{localName:c},kind:"let",description:Fe,binding:x?.binding,deprecated:x?.deprecated,tags:x?.tags,...x?.internal?{internal:!0}:{},...C?{bindable:!0}:{},type:_,typeSource:j,value:w,defaultValue:L,params:ot,returnType:o,isFunction:l,isFunctionDeclaration:!1,isRequired:!C&&g==null&&y?.optional!==!0&&u?.optional!==!0,constant:!1,reactive:C,source:H(e,s)})}}}function Mu(e){let n=e.indexOf("EventDispatcher");if(n===-1)return;let r=n+15;while(e[r]===" ")r++;if(e[r]!=="<")return;let i=vt(e,r);return i===-1?void 0:e.slice(r+1,i)}var Ou=/^["']|["']$/g,Bu=/\?$/,Fu=/^\{/,$u=/\}$/;function Vu(e){let t=dn(e,":");if(t===-1)return;let n=e.slice(0,t).trim().replace(Bu,"").replace(Ou,""),r=e.slice(t+1).trim();if(!n||!r)return;return{name:n,type:r}}function Ia(e,t,n,r){if(t){let p=new Map(Array.from(e.localTypeDeclarationsByName.entries(),([d,u])=>[d,u.node])),c=Ct(e,t,p);for(let[d,u]of c)tt(e,{name:d,detail:u.type,has_argument:!0,source:u.source});return}let i=et(e,n)?.type,a=i?Mu(i):void 0;if(!a)return;let s=a.trim().replace(Fu,"").replace($u,"");for(let p of se(s,";,")){let c=Vu(p.trim());if(!c)continue;tt(e,{name:c.name,detail:c.type,has_argument:!0,source:r})}}function _a(e,t){if(e.syntaxMode!=="runes")return;for(let[n,r]of Array.from(e.events.entries())){if(r.type!=="dispatched")continue;if(t.has(n)||e.forwardedEvents.has(n))continue;let i=`on${n}`,a=e.props.get(i);if(!a)continue;let s=a.type!==void 0||a.params!==void 0||a.returnType!==void 0,p=r.detail===void 0||r.detail==="undefined"||r.detail==="null"?"() => void":`(detail: ${r.detail}) => void`;e.props.set(i,{...a,description:a.description??r.description,type:s?a.type:p,typeSource:s?a.typeSource:"inferred",isFunction:!0}),e.events.delete(n)}}var Jt=null;function ju(e,t){let n={value:void 0,replace:!1};if(!t||typeof t!=="object"||!("type"in t))return n;if(t.type==="Identifier")n.value=t.name,n.replace=!0;else if(t.type==="Literal")n.value=String(t.value);else if(t.type==="MemberExpression")n.value=Tn(e,t);else if((t.type==="ObjectExpression"||t.type==="TemplateLiteral")&&"start"in t&&"end"in t&&typeof t.start==="number"&&typeof t.end==="number")n.value=z(e,t.start,t.end);return n}function Hu(e,t){if(!Y(t))return null;let n=Et(e,t.name);if(Te(n))return Xr(e,n).slot_props;let r=Ze(e,t.name);if(!r)return null;let i=qe(r.type);if(!i)return null;let a={};for(let s of i)a[s.name]={value:s.type,replace:!1};return a}function Xr(e,t){let n={},r=!1;for(let i of t.properties){if(i.type==="SpreadElement"){let s=Hu(e,i.argument);if(s)Object.assign(n,s);else r=!0,G(e,"spread-unresolved","slot_props",`Slot props spread a value sveld can't resolve; its shape is widened to "Record<string, any>".`,H(e,i));continue}if(i.type!=="Property"||i.computed)continue;let a=ie(i.key);if(!a)continue;n[a]=ju(e,i.value)}return{slot_props:n,hasUnresolvedSpread:r}}function qu(e,t){if(!t||typeof t!=="object"||!("type"in t))return null;if(t.type==="Identifier"){let a=t,s=e.propLocalToPublicName.get(a.name);if(!s)return null;return{publicName:s,trackingName:a.name}}if(t.type!=="MemberExpression")return null;let n=t,r=n.object&&typeof n.object==="object"&&"type"in n.object&&n.object.type==="Identifier"?n.object.name:void 0;if(!r||!e.wholePropsLocals.has(r))return null;let i;if(!n.computed&&n.property&&typeof n.property==="object"&&"type"in n.property){if(n.property.type==="Identifier")i=n.property.name;else if(n.property.type==="Literal"&&n.property.value!=null)i=String(n.property.value)}else if(n.computed&&n.property&&typeof n.property==="object"&&"type"in n.property&&n.property.type==="Literal"&&"value"in n.property&&n.property.value!=null)i=String(n.property.value);if(!i)return null;return{publicName:i,trackingName:i}}function La(e,t){let n=t;if(n&&typeof n==="object"&&"type"in n&&n.type==="ChainExpression")n=n.expression;if(!n||typeof n!=="object"||!("type"in n)||n.type!=="CallExpression")return null;let r=n;if(!r.callee||typeof r.callee!=="object"||!("type"in r.callee))return null;let i=qu(e,r.callee);if(!i)return null;return{...i,arguments:r.arguments}}function Xt(e,{slot_name:t,slot_props:n,slot_props_unresolved_spread:r,slot_fallback:i,slot_description:a,slot_deprecated:s,slot_tags:p,slot_internal:c,source:d}){let u=t===void 0||t==="",y=u?Jt:t??"",x=he(i),g=n===void 0||n===""?void 0:n,C=a?.trim()||void 0;if(e.slots.has(y)){let v=e.slots.get(y);if(v)e.slots.set(y,{...v,default:v.default??u,fallback:x,slot_props:v.slot_props===void 0?g:v.slot_props,slot_props_unresolved_spread:v.slot_props_unresolved_spread||r,description:v.description||C,deprecated:v.deprecated??s,tags:v.tags||p,...v.internal||c?{internal:!0}:{},source:d||v.source})}else e.slots.set(y,{name:y,default:u,fallback:x,slot_props:g,slot_props_unresolved_spread:r,description:C,deprecated:s,tags:p,...c?{internal:!0}:{},source:d})}function Qr(e){return e==="TSTypeAnnotation"||e==="TSTypeAliasDeclaration"||e==="TSInterfaceDeclaration"||e==="TSTypeParameterDeclaration"||e==="TSTypeParameterInstantiation"}function Mn(e,t,n,r){Yr(e,null,null,t,n,r?.skipTypeOnlySubtrees===!0)}function Yr(e,t,n,r,i,a){r(e,t,n);let s=e,p=e.type;if((p==="Identifier"||p==="Literal"||p==="Text")&&s.typeAnnotation===void 0){if(i)i(e);return}if(a&&p.charCodeAt(0)===84&&Qr(p)){if(i)i(e);return}for(let c in s){if(c==="leadingComments")continue;let d=s[c];if(!d||typeof d!=="object")continue;if(Array.isArray(d))for(let u=0;u<d.length;u++){let y=d[u];if(y&&typeof y==="object"&&typeof y.type==="string")Yr(y,e,c,r,i,a)}else if(typeof d.type==="string")Yr(d,e,c,r,i,a)}if(i)i(e)}var Ra=/^@component/,Uu=/\r/g,Gu=new Set(["AssignmentExpression","UpdateExpression","CallExpression","SpreadAttribute","FunctionDeclaration","ImportDeclaration","VariableDeclaration","ExportNamedDeclaration","Comment","SlotElement","RenderTag","OnDirective","BindDirective"]);function Ma(e){return e&&"id"in e&&e.id&&"name"in e.id?e.id.name:void 0}function Wu(e,t,n,r){let i=n.callee.type==="Identifier"?n.callee.name:void 0;if(i==="createEventDispatcher"){let a=Ma(r);if(a!==void 0)t.dispatcherName=a,t.dispatcherDeclaratorNode=r;t.dispatcherTypeArgument=n.typeArguments?.params?.[0]}if(i==="$host"){let a=Ma(r);if(a!==void 0)t.hostLocalNames.add(a)}if(i==="setContext")ua(e,n);if(n.arguments.length>0){if(t.callsWithArguments.push(n),Nn(e,n.callee))t.locallyBoundCalls.add(n)}if(i)t.callees.push({name:i,arguments:n.arguments,node:n,nestedBoundDetailNames:zt(e,n.arguments[1])});if(bt(n.callee)&&Y(n.callee.property)&&n.callee.property.name==="dispatchEvent"&&(Me(n.callee.object,"$host")||Y(n.callee.object)&&t.hostLocalNames.has(n.callee.object.name))){let a=ya(e,n);if(a)t.hostDispatchedEventNames.add(a.name),t.hostDispatches.push(a)}}function zu(e,t){let n=t,r=n.attributes?.find((p)=>p.name==="name")?.value,i=(Array.isArray(r)?r[0]:void 0)?.data,a=(n.attributes||[]).filter((p)=>p.name!=="name").reduce((p,c)=>{let d={value:void 0,replace:!1},u=c.value;if(u===void 0||u===!0)return p;let y=Array.isArray(u)?u[0]:u;if(y){let{type:x,expression:g,raw:C,start:v,end:w}=y;if(x==="Text"&&C!==void 0)d.value=JSON.stringify(C);else if(!Array.isArray(u)&&x==="ExpressionTag"&&g&&typeof g==="object"&&"type"in g&&g.type==="Identifier"&&"name"in g&&g.name===c.name)d.value=g.name,d.replace=!0;if(g&&typeof g==="object"&&"type"in g){if(g.type==="Literal"&&"value"in g){let R=g.value;d.value=typeof R==="string"?JSON.stringify(R):String(R)}else if(g.type==="MemberExpression")d.value=Tn(e,g);else if(g.type!=="Identifier"){if(v!==void 0&&w!==void 0){if(g.type==="ObjectExpression"||g.type==="TemplateLiteral")d.value=z(e,v+1,w-1)}}}}if(c.name)p[c.name]=d;return p},{}),s=t.fragment.nodes.map(({start:p,end:c})=>z(e,p,c)??"").join("").trim();Xt(e,{slot_name:i,slot_props:a,slot_fallback:s,source:H(e,t)})}function Ku(e,t){let n=La(e,t.expression);if(!n)return;let r,i=!1;if(n.arguments.length===0)r={};else if(n.arguments.length===1&&typeof n.arguments[0]==="object"&&n.arguments[0]&&"type"in n.arguments[0]&&n.arguments[0].type==="ObjectExpression"){let p=Xr(e,n.arguments[0]);r=p.slot_props,i=p.hasUnresolvedSpread}let a=n.publicName==="children"?void 0:n.publicName,s=a===void 0?Jt:a;if(r!==void 0)Xt(e,{slot_name:a,slot_props:r,slot_props_unresolved_spread:i||void 0,source:H(e,t)});if(r!==void 0||e.slots.has(s))e.snippetPropLocals.add(n.trackingName)}function Ju(e,t,n){let r=t.name;if(t.expression!=null||!r)return;if(n==null||!("name"in n))return;let i=typeof n.name==="string"?n.name:void 0,a=n.type;if(!i||!a)return;let s=Gt(a)?{type:"InlineComponent",name:i}:{type:"Element",name:i};e.forwardedEvents.set(r,s);let p=e.events.get(r),c=e.eventDescriptions.get(r),d=p?.deprecated,u=p?.internal;if(!p)e.events.set(r,{type:"forwarded",name:r,element:s,description:c,deprecated:d,...u?{internal:!0}:{},source:H(e,t)});else if(p.type==="forwarded"&&c&&!p.description)e.events.set(r,{...p,description:c,deprecated:p.deprecated??d,...p.internal||u?{internal:!0}:{},source:p.source||H(e,t)})}function Xu(e,t,n){if(!(n&&(Wt(n.type)||Gt(n.type))))return;let r=t.expression.type==="Identifier"?t.expression.name:void 0;if(r){let i=Ht(e,r);if(i)e.reactive_vars.add(i)}if(Wt(n.type)&&t.name==="this"&&r&&"name"in n&&typeof n.name==="string"){let i=Ht(e,r);if(!i)return;let a=n.name;if(e.bindings.has(i)){let s=e.bindings.get(i);if(s&&!s.elements.includes(a))e.bindings.set(i,{...s,elements:[...s.elements,a]})}else e.bindings.set(i,{elements:[a]})}}function Oa(e){let t={dispatcherName:void 0,dispatcherDeclaratorNode:void 0,dispatcherTypeArgument:void 0,hostLocalNames:new Set,hostDispatchedEventNames:new Set,hostDispatches:[],callees:[],callsWithArguments:[],locallyBoundCalls:new Set},n={type:"ComponentRoot",instance:e.parsed?.instance,fragment:e.parsed?.fragment};Zs(e),e.activeScopes.push(e.componentScope);let r=ea(e);return Mn(n,(i,a)=>{let s=ta(e,r,i);if(s)e.activeScopes.push(s);if(!Gu.has(i.type))return;switch(i.type){case"AssignmentExpression":$r(e,i.left);break;case"UpdateExpression":$r(e,i.argument);break;case"CallExpression":Wu(e,t,i,a);break;case"SpreadAttribute":{let p=i.expression.type==="Identifier"?i.expression.name:void 0;if(p==="$$restProps"||e.restPropLocals.has(p??""))va(e,a);break}case"FunctionDeclaration":if(i.id?.name)e.funcDecls.set(i.id.name,i);break;case"ImportDeclaration":$t(e,i);break;case"VariableDeclaration":if(e.vars.add(i),a?.type==="Program"&&i.declarations.some((p)=>Me(Xe(p.init),"$props")))Da(e,i);break;case"ExportNamedDeclaration":Ta(e,i,a?.type==="Program"?a:null);break;case"Comment":{let p=i.data.trim();if(Ra.test(p))e.componentComment=p.replace(Ra,"").replace(Uu,""),e.componentCommentSource=H(e,i);break}case"SlotElement":zu(e,i);break;case"RenderTag":Ku(e,i);break;case"OnDirective":Ju(e,i,a);break;case"BindDirective":Xu(e,i,a);break}},(i)=>{if(Ut(i))e.activeScopes.pop(),na(r,i)},{skipTypeOnlySubtrees:!0}),t}var Ba={a:"HTMLAnchorElement",abbr:"HTMLElement",address:"HTMLElement",applet:"HTMLUnknownElement",area:"HTMLAreaElement",article:"HTMLElement",aside:"HTMLElement",audio:"HTMLAudioElement",b:"HTMLElement",base:"HTMLBaseElement",basefont:"HTMLElement",bdi:"HTMLElement",bdo:"HTMLElement",blockquote:"HTMLQuoteElement",body:"HTMLBodyElement",br:"HTMLBRElement",button:"HTMLButtonElement",canvas:"HTMLCanvasElement",caption:"HTMLTableCaptionElement",cite:"HTMLElement",code:"HTMLElement",col:"HTMLTableColElement",colgroup:"HTMLTableColElement",data:"HTMLDataElement",datalist:"HTMLDataListElement",dd:"HTMLElement",del:"HTMLModElement",details:"HTMLDetailsElement",dfn:"HTMLElement",dialog:"HTMLDialogElement",dir:"HTMLDirectoryElement",div:"HTMLDivElement",dl:"HTMLDListElement",dt:"HTMLElement",em:"HTMLElement",embed:"HTMLEmbedElement",fieldset:"HTMLFieldSetElement",figcaption:"HTMLElement",figure:"HTMLElement",font:"HTMLFontElement",footer:"HTMLElement",form:"HTMLFormElement",frame:"HTMLFrameElement",frameset:"HTMLFrameSetElement",h1:"HTMLHeadingElement",h2:"HTMLHeadingElement",h3:"HTMLHeadingElement",h4:"HTMLHeadingElement",h5:"HTMLHeadingElement",h6:"HTMLHeadingElement",head:"HTMLHeadElement",header:"HTMLElement",hgroup:"HTMLElement",hr:"HTMLHRElement",html:"HTMLHtmlElement",i:"HTMLElement",iframe:"HTMLIFrameElement",img:"HTMLImageElement",input:"HTMLInputElement",ins:"HTMLModElement",kbd:"HTMLElement",label:"HTMLLabelElement",legend:"HTMLLegendElement",li:"HTMLLIElement",link:"HTMLLinkElement",main:"HTMLElement",map:"HTMLMapElement",mark:"HTMLElement",marquee:"HTMLMarqueeElement",menu:"HTMLMenuElement",meta:"HTMLMetaElement",meter:"HTMLMeterElement",nav:"HTMLElement",noscript:"HTMLElement",object:"HTMLObjectElement",ol:"HTMLOListElement",optgroup:"HTMLOptGroupElement",option:"HTMLOptionElement",output:"HTMLOutputElement",p:"HTMLParagraphElement",param:"HTMLParamElement",picture:"HTMLPictureElement",pre:"HTMLPreElement",progress:"HTMLProgressElement",q:"HTMLQuoteElement",rp:"HTMLElement",rt:"HTMLElement",ruby:"HTMLElement",s:"HTMLElement",samp:"HTMLElement",script:"HTMLScriptElement",search:"HTMLElement",section:"HTMLElement",select:"HTMLSelectElement",slot:"HTMLSlotElement",small:"HTMLElement",source:"HTMLSourceElement",span:"HTMLSpanElement",strong:"HTMLElement",style:"HTMLStyleElement",sub:"HTMLElement",summary:"HTMLElement",sup:"HTMLElement",table:"HTMLTableElement",tbody:"HTMLTableSectionElement",td:"HTMLTableCellElement",template:"HTMLTemplateElement",textarea:"HTMLTextAreaElement",tfoot:"HTMLTableSectionElement",th:"HTMLTableCellElement",thead:"HTMLTableSectionElement",time:"HTMLTimeElement",title:"HTMLTitleElement",tr:"HTMLTableRowElement",track:"HTMLTrackElement",u:"HTMLElement",ul:"HTMLUListElement",var:"HTMLElement",video:"HTMLVideoElement",wbr:"HTMLElement"};function Yu(e){return e in Ba}function Fa(e){if(Yu(e))return Ba[e];return"HTMLElement"}var di={};Zc(di,{Node:()=>tn,Parser:()=>X,Position:()=>Pt,SourceLocation:()=>Zt,TokContext:()=>Ce,Token:()=>zn,TokenType:()=>U,defaultOptions:()=>Bn,getLineInfo:()=>ai,isIdentifierChar:()=>de,isIdentifierStart:()=>pe,isNewLine:()=>ut,keywordTypes:()=>Hn,lineBreak:()=>ce,lineBreakG:()=>Wa,nonASCIIwhitespace:()=>si,parse:()=>Ld,parseExpressionAt:()=>Rd,tokContexts:()=>J,tokTypes:()=>h,tokenizer:()=>Md,version:()=>Ao});var Qu=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],qa=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],Zu="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",Ua="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Zr={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"},ei="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",ed={5:ei,"5module":ei+" export import",6:ei+" const class extends export import super"},Ga=/^in(stanceof)?$/,td=new RegExp("["+Ua+"]"),nd=new RegExp("["+Ua+Zu+"]");function ti(e,t){var n=65536;for(var r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function pe(e,t){if(e<65)return e===36;if(e<91)return!0;if(e<97)return e===95;if(e<123)return!0;if(e<=65535)return e>=170&&td.test(String.fromCharCode(e));if(t===!1)return!1;return ti(e,qa)}function de(e,t){if(e<48)return e===36;if(e<58)return!0;if(e<65)return!1;if(e<91)return!0;if(e<97)return e===95;if(e<123)return!0;if(e<=65535)return e>=170&&nd.test(String.fromCharCode(e));if(t===!1)return!1;return ti(e,qa)||ti(e,Qu)}var U=function(t,n){if(n===void 0)n={};this.label=t,this.keyword=n.keyword,this.beforeExpr=!!n.beforeExpr,this.startsExpr=!!n.startsExpr,this.isLoop=!!n.isLoop,this.isAssign=!!n.isAssign,this.prefix=!!n.prefix,this.postfix=!!n.postfix,this.binop=n.binop||null,this.updateContext=null};function Se(e,t){return new U(e,{beforeExpr:!0,binop:t})}var Ee={beforeExpr:!0},ue={startsExpr:!0},Hn={};function q(e,t){if(t===void 0)t={};return t.keyword=e,Hn[e]=new U(e,t)}var h={num:new U("num",ue),regexp:new U("regexp",ue),string:new U("string",ue),name:new U("name",ue),privateId:new U("privateId",ue),eof:new U("eof"),bracketL:new U("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new U("]"),braceL:new U("{",{beforeExpr:!0,startsExpr:!0}),braceR:new U("}"),parenL:new U("(",{beforeExpr:!0,startsExpr:!0}),parenR:new U(")"),comma:new U(",",Ee),semi:new U(";",Ee),colon:new U(":",Ee),dot:new U("."),question:new U("?",Ee),questionDot:new U("?."),arrow:new U("=>",Ee),template:new U("template"),invalidTemplate:new U("invalidTemplate"),ellipsis:new U("...",Ee),backQuote:new U("`",ue),dollarBraceL:new U("${",{beforeExpr:!0,startsExpr:!0}),eq:new U("=",{beforeExpr:!0,isAssign:!0}),assign:new U("_=",{beforeExpr:!0,isAssign:!0}),incDec:new U("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new U("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:Se("||",1),logicalAND:Se("&&",2),bitwiseOR:Se("|",3),bitwiseXOR:Se("^",4),bitwiseAND:Se("&",5),equality:Se("==/!=/===/!==",6),relational:Se("</>/<=/>=",7),bitShift:Se("<</>>/>>>",8),plusMin:new U("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:Se("%",10),star:Se("*",10),slash:Se("/",10),starstar:new U("**",{beforeExpr:!0}),coalesce:Se("??",1),_break:q("break"),_case:q("case",Ee),_catch:q("catch"),_continue:q("continue"),_debugger:q("debugger"),_default:q("default",Ee),_do:q("do",{isLoop:!0,beforeExpr:!0}),_else:q("else",Ee),_finally:q("finally"),_for:q("for",{isLoop:!0}),_function:q("function",ue),_if:q("if"),_return:q("return",Ee),_switch:q("switch"),_throw:q("throw",Ee),_try:q("try"),_var:q("var"),_const:q("const"),_while:q("while",{isLoop:!0}),_with:q("with"),_new:q("new",{beforeExpr:!0,startsExpr:!0}),_this:q("this",ue),_super:q("super",ue),_class:q("class",ue),_extends:q("extends",Ee),_export:q("export"),_import:q("import",ue),_null:q("null",ue),_true:q("true",ue),_false:q("false",ue),_in:q("in",{beforeExpr:!0,binop:7}),_instanceof:q("instanceof",{beforeExpr:!0,binop:7}),_typeof:q("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:q("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:q("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},ce=/\r\n?|\n|\u2028|\u2029/,Wa=new RegExp(ce.source,"g");function ut(e){return e===10||e===13||e===8232||e===8233}function za(e,t,n){if(n===void 0)n=e.length;for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(ut(i))return r<n-1&&i===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var si=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Z=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Ka=Object.prototype,{hasOwnProperty:rd,toString:id}=Ka,At=Object.hasOwn||function(e,t){return rd.call(e,t)},$a=Array.isArray||function(e){return id.call(e)==="[object Array]"},Va=Object.create(null);function nt(e){return Va[e]||(Va[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function We(e){if(e<=65535)return String.fromCharCode(e);return e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320)}var sd=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Pt=function(t,n){this.line=t,this.column=n};Pt.prototype.offset=function(t){return new Pt(this.line,this.column+t)};var Zt=function(t,n,r){if(this.start=n,this.end=r,t.sourceFile!==null)this.source=t.sourceFile};function ai(e,t){for(var n=1,r=0;;){var i=za(e,r,t);if(i<0)return new Pt(n,t-r);++n,r=i}}var Bn={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},ja=!1;function ad(e){var t={};for(var n in Bn)t[n]=e&&At(e,n)?e[n]:Bn[n];if(t.ecmaVersion==="latest")t.ecmaVersion=1e8;else if(t.ecmaVersion==null){if(!ja&&typeof console==="object"&&console.warn)ja=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
26
+ Defaulting to 2020, but this will stop working in the future.`);t.ecmaVersion=11}else if(t.ecmaVersion>=2015)t.ecmaVersion-=2009;if(t.allowReserved==null)t.allowReserved=t.ecmaVersion<5;if(!e||e.allowHashBang==null)t.allowHashBang=t.ecmaVersion>=14;if($a(t.onToken)){var r=t.onToken;t.onToken=function(i){return r.push(i)}}if($a(t.onComment))t.onComment=od(t,t.onComment);if(t.sourceType==="commonjs"&&t.allowAwaitOutsideFunction)throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return t}function od(e,t){return function(n,r,i,a,s,p){var c={type:n?"Block":"Line",value:r,start:i,end:a};if(e.locations)c.loc=new Zt(this,s,p);if(e.ranges)c.range=[i,a];t.push(c)}}var lt=1,dt=2,oi=4,Ja=8,pi=16,Xa=32,qn=64,Ya=128,ft=256,en=512,Qa=1024,Un=lt|dt|ft;function ci(e,t){return dt|(e?oi:0)|(t?Ja:0)}var Fn=0,li=1,Ke=2,Za=3,eo=4,to=5,X=function(t,n,r){this.options=t=ad(t),this.sourceFile=t.sourceFile,this.keywords=nt(ed[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var i="";if(t.allowReserved!==!0){if(i=Zr[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module")i+=" await"}this.reservedWords=nt(i);var a=(i?i+" ":"")+Zr.strict;if(this.reservedWordsStrict=nt(a),this.reservedWordsStrictBind=nt(a+" "+Zr.strictBind),this.input=String(n),this.containsEsc=!1,this.pos=r||0,this.curLine=1,t.startLocation)this.lineStart=this.pos-t.startLocation.column,this.curLine=t.startLocation.line;else if(r){if(this.lineStart=this.input.lastIndexOf(`
27
+ `,r-1)+1,this.options.locations)this.curLine=this.input.slice(0,this.lineStart).split(ce).length}else this.lineStart=0;if(this.type=h.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=t.sourceType==="module",this.strict=this.inModule||t.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&&t.allowHashBang&&this.input.slice(0,2)==="#!")this.skipLineComment(2);this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?dt:lt),this.regexpState=null,this.privateNameStack=[]},Ae={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}};X.prototype.parse=function(){var t=this,n=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return t.parseTopLevel(n)})};Ae.inFunction.get=function(){return(this.currentVarScope().flags&dt)>0};Ae.inGenerator.get=function(){return(this.currentVarScope().flags&Ja)>0};Ae.inAsync.get=function(){return(this.currentVarScope().flags&oi)>0};Ae.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],n=t.flags;if(n&(ft|en))return!1;if(n&dt)return(n&oi)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Ae.allowReturn.get=function(){if(this.inFunction)return!0;if(this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&lt)return!0;return!1};Ae.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags;return(t&qn)>0||this.options.allowSuperOutsideMethod};Ae.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Ya)>0};Ae.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Ae.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],n=t.flags;if(n&(ft|en)||n&dt&&!(n&pi))return!0}return!1};Ae.allowUsing.get=function(){var e=this.currentScope(),t=e.flags;if(t&Qa)return!1;if(!this.inModule&&t&lt)return!1;return!0};Ae.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&ft)>0};X.extend=function(){var t=[],n=arguments.length;while(n--)t[n]=arguments[n];var r=this;for(var i=0;i<t.length;i++)r=t[i](r);return r};X.parse=function(t,n){return new this(n,t).parse()};X.parseExpressionAt=function(t,n,r){var i=new this(r,t,n);return i.nextToken(),i.parseExpression()};X.tokenizer=function(t,n){return new this(n,t)};Object.defineProperties(X.prototype,Ae);var re=X.prototype,pd=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;re.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){Z.lastIndex=e,e+=Z.exec(this.input)[0].length;var t=pd.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){Z.lastIndex=e+t[0].length;var n=Z.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===";"||i==="}"||ce.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i==="!"&&this.input.charAt(r+1)==="=")}if(e+=t[0].length,Z.lastIndex=e,e+=Z.exec(this.input)[0].length,this.input[e]===";")e++}};re.eat=function(e){if(this.type===e)return this.next(),!0;else return!1};re.isContextual=function(e){return this.type===h.name&&this.value===e&&!this.containsEsc};re.eatContextual=function(e){if(!this.isContextual(e))return!1;return this.next(),!0};re.catchStackOverflow=function(e){try{return e()}catch(t){if(t instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(t.message)||/\btoo much recursion\b/i.test(t.message)))this.raise(this.start,"Not enough stack space to parse input");else throw t}};re.expectContextual=function(e){if(!this.eatContextual(e))this.unexpected()};re.canInsertSemicolon=function(){return this.type===h.eof||this.type===h.braceR||ce.test(this.input.slice(this.lastTokEnd,this.start))};re.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return!0}};re.semicolon=function(){if(!this.eat(h.semi)&&!this.insertSemicolon())this.unexpected()};re.afterTrailingComma=function(e,t){if(this.type===e){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);if(!t)this.next();return!0}};re.expect=function(e){this.eat(e)||this.unexpected()};re.unexpected=function(e){this.raise(e!=null?e:this.start,"Unexpected token")};var Gn=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};re.checkPatternErrors=function(e,t){if(!e)return;if(e.trailingComma>-1)this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var n=t?e.parenthesizedAssign:e.parenthesizedBind;if(n>-1)this.raiseRecoverable(n,t?"Assigning to rvalue":"Parenthesized pattern")};re.checkExpressionErrors=function(e,t){if(!e)return!1;var{shorthandAssign:n,doubleProto:r}=e;if(!t)return n>=0||r>=0;if(n>=0)this.raise(n,"Shorthand property assignments are valid only in destructuring patterns");if(r>=0)this.raiseRecoverable(r,"Redefinition of __proto__ property")};re.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")};re.isSimpleAssignTarget=function(e){if(e.type==="ParenthesizedExpression")return this.isSimpleAssignTarget(e.expression);return e.type==="Identifier"||e.type==="MemberExpression"};var I=X.prototype;I.parseTopLevel=function(e){var t=Object.create(null);if(!e.body)e.body=[];while(this.type!==h.eof){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,"Export '"+a+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(e,"Program")};var ui={kind:"loop"},cd={kind:"switch"};I.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;Z.lastIndex=this.pos;var t=Z.exec(this.input),n=this.pos+t[0].length,r=this.fullCharCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123)return!0;if(pe(r)){var i=n;do n+=r<=65535?1:2;while(de(r=this.fullCharCodeAt(n)));if(r===92)return!0;var a=this.input.slice(i,n);if(!Ga.test(a))return!0}return!1};I.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Z.lastIndex=this.pos;var e=Z.exec(this.input),t=this.pos+e[0].length,n;return!ce.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(de(n=this.fullCharCodeAt(t+8))||n===92))};I.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;Z.lastIndex=this.pos;var n=Z.exec(this.input),r=this.pos+n[0].length;if(ce.test(this.input.slice(this.pos,r)))return!1;if(e){var i=r+5,a;if(this.input.slice(r,i)!=="using"||i===this.input.length||de(a=this.fullCharCodeAt(i))||a===92)return!1;Z.lastIndex=i;var s=Z.exec(this.input);if(r=i+s[0].length,s&&ce.test(this.input.slice(i,r)))return!1}var p=this.fullCharCodeAt(r);if(!pe(p)&&p!==92)return!1;var c=r;do r+=p<=65535?1:2;while(de(p=this.fullCharCodeAt(r)));if(p===92)return!0;var d=this.input.slice(c,r);if(Ga.test(d))return!1;if(t&&!e&&d==="of"){Z.lastIndex=r;var u=Z.exec(this.input);if(r=r+u[0].length,this.input.charCodeAt(r)!==61||(p=this.input.charCodeAt(r+1))===61||p===62)return!1}return!0};I.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)};I.isUsing=function(e){return this.isUsingKeyword(!1,e)};I.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),a;if(this.isLet(e))r=h._var,a="let";switch(r){case h._break:case h._continue:return this.parseBreakContinueStatement(i,r.keyword);case h._debugger:return this.parseDebuggerStatement(i);case h._do:return this.parseDoStatement(i);case h._for:return this.parseForStatement(i);case h._function:if(e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(i,!1,!e);case h._class:if(e)this.unexpected();return this.parseClass(i,!0);case h._if:return this.parseIfStatement(i);case h._return:return this.parseReturnStatement(i);case h._switch:return this.parseSwitchStatement(i);case h._throw:return this.parseThrowStatement(i);case h._try:return this.parseTryStatement(i);case h._const:case h._var:if(a=a||this.value,e&&a!=="var")this.unexpected();return this.parseVarStatement(i,a);case h._while:return this.parseWhileStatement(i);case h._with:return this.parseWithStatement(i);case h.braceL:return this.parseBlock(!0,i);case h.semi:return this.parseEmptyStatement(i);case h._export:case h._import:if(this.options.ecmaVersion>10&&r===h._import){Z.lastIndex=this.pos;var s=Z.exec(this.input),p=this.pos+s[0].length,c=this.input.charCodeAt(p);if(c===40||c===46)return this.parseExpressionStatement(i,this.parseExpression())}if(!this.options.allowImportExportEverywhere){if(!t)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 r===h._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction()){if(e)this.unexpected();return this.next(),this.parseFunctionStatement(i,!0,!e)}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(e)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(i,!1,d),this.semicolon(),this.finishNode(i,"VariableDeclaration")}var u=this.value,y=this.parseExpression();if(r===h.name&&y.type==="Identifier"&&this.eat(h.colon))return this.parseLabeledStatement(i,u,y,e);else return this.parseExpressionStatement(i,y)}};I.parseBreakContinueStatement=function(e,t){var n=t==="break";if(this.next(),this.eat(h.semi)||this.insertSemicolon())e.label=null;else if(this.type!==h.name)this.unexpected();else e.label=this.parseIdent(),this.semicolon();var r=0;for(;r<this.labels.length;++r){var i=this.labels[r];if(e.label==null||i.name===e.label.name){if(i.kind!=null&&(n||i.kind==="loop"))break;if(e.label&&n)break}}if(r===this.labels.length)this.raise(e.start,"Unsyntactic "+t);return this.finishNode(e,n?"BreakStatement":"ContinueStatement")};I.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};I.parseDoStatement=function(e){if(this.next(),this.labels.push(ui),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(h._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6)this.eat(h.semi);else this.semicolon();return this.finishNode(e,"DoWhileStatement")};I.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(ui),this.enterScope(0),this.expect(h.parenL),this.type===h.semi){if(t>-1)this.unexpected(t);return this.parseFor(e,null)}var n=this.isLet();if(this.type===h._var||this.type===h._const||n){var r=this.startNode(),i=n?"let":this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,"VariableDeclaration"),this.parseForAfterInit(e,r,t)}var a=this.isContextual("let"),s=!1,p=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(p){var c=this.startNode();if(this.next(),p==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.parseVar(c,!0,p),this.finishNode(c,"VariableDeclaration"),this.parseForAfterInit(e,c,t)}var d=this.containsEsc,u=new Gn,y=this.start,x=t>-1?this.parseExprSubscripts(u,"await"):this.parseExpression(!0,u);if(this.type===h._in||(s=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(t>-1){if(this.type===h._in)this.unexpected(t);e.await=!0}else if(s&&this.options.ecmaVersion>=8){if(x.start===y&&!d&&x.type==="Identifier"&&x.name==="async")this.unexpected();else if(this.options.ecmaVersion>=9)e.await=!1}if(a&&s)this.raise(x.start,"The left-hand side of a for-of loop may not start with 'let'.");return this.toAssignable(x,!1,u),this.checkLValPattern(x),this.parseForIn(e,x)}else this.checkExpressionErrors(u,!0);if(t>-1)this.unexpected(t);return this.parseFor(e,x)};I.parseForAfterInit=function(e,t,n){if((this.type===h._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&t.declarations.length===1){if(this.type===h._in){if((t.kind==="using"||t.kind==="await using")&&!t.declarations[0].init)this.raise(this.start,"Using declaration is not allowed in for-in loops");if(this.options.ecmaVersion>=9&&n>-1)this.unexpected(n)}else if(this.options.ecmaVersion>=9)e.await=n>-1;return this.parseForIn(e,t)}if(n>-1)this.unexpected(n);return this.parseFor(e,t)};I.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,Qt|(n?0:ni),!1,t)};I.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(h._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};I.parseReturnStatement=function(e){if(!this.allowReturn)this.raise(this.start,"'return' outside of function");if(this.next(),this.eat(h.semi)||this.insertSemicolon())e.argument=null;else e.argument=this.parseExpression(),this.semicolon();return this.finishNode(e,"ReturnStatement")};I.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(h.braceL),this.labels.push(cd),this.enterScope(Qa);var t;for(var n=!1;this.type!==h.braceR;)if(this.type===h._case||this.type===h._default){var r=this.type===h._case;if(t)this.finishNode(t,"SwitchCase");if(e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r)t.test=this.parseExpression();else{if(n)this.raiseRecoverable(this.lastTokStart,"Multiple default clauses");n=!0,t.test=null}this.expect(h.colon)}else{if(!t)this.unexpected();t.consequent.push(this.parseStatement(null))}if(this.exitScope(),t)this.finishNode(t,"SwitchCase");return this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};I.parseThrowStatement=function(e){if(this.next(),ce.test(this.input.slice(this.lastTokEnd,this.start)))this.raise(this.lastTokEnd,"Illegal newline after throw");return e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var ld=[];I.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?Xa:0),this.checkLValPattern(e,t?eo:Ke),this.expect(h.parenR),e};I.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===h._catch){var t=this.startNode();if(this.next(),this.eat(h.parenL))t.param=this.parseCatchClauseParam();else{if(this.options.ecmaVersion<10)this.unexpected();t.param=null,this.enterScope(0)}t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}if(e.finalizer=this.eat(h._finally)?this.parseBlock():null,!e.handler&&!e.finalizer)this.raise(e.start,"Missing catch or finally clause");return this.finishNode(e,"TryStatement")};I.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,"VariableDeclaration")};I.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(ui),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};I.parseWithStatement=function(e){if(this.strict)this.raise(this.start,"'with' in strict mode");return this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};I.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};I.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1){var s=a[i];if(s.name===t)this.raise(n.start,"Label '"+t+"' is already declared")}var p=this.type.isLoop?"loop":this.type===h._switch?"switch":null;for(var c=this.labels.length-1;c>=0;c--){var d=this.labels[c];if(d.statementStart===e.start)d.statementStart=this.start,d.kind=p;else break}return this.labels.push({name:t,kind:p,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")};I.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};I.parseBlock=function(e,t,n){if(e===void 0)e=!0;if(t===void 0)t=this.startNode();if(t.body=[],this.expect(h.braceL),e)this.enterScope(0);while(this.type!==h.braceR){var r=this.parseStatement(null);t.body.push(r)}if(n)this.strict=!1;if(this.next(),e)this.exitScope();return this.finishNode(t,"BlockStatement")};I.parseFor=function(e,t){return e.init=t,this.expect(h.semi),e.test=this.type===h.semi?null:this.parseExpression(),this.expect(h.semi),e.update=this.type===h.parenR?null:this.parseExpression(),this.expect(h.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};I.parseForIn=function(e,t){var n=this.type===h._in;if(this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier"))this.raise(t.start,(n?"for-in":"for-of")+" loop variable declaration may not have an initializer");return e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(h.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,n?"ForInStatement":"ForOfStatement")};I.parseVar=function(e,t,n,r){e.declarations=[],e.kind=n;for(;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(h.eq))i.init=this.parseMaybeAssign(t);else if(!r&&n==="const"&&!(this.type===h._in||this.options.ecmaVersion>=6&&this.isContextual("of")))this.unexpected();else if(!r&&(n==="using"||n==="await using")&&this.options.ecmaVersion>=17&&this.type!==h._in&&!this.isContextual("of"))this.raise(this.lastTokEnd,"Missing initializer in "+n+" declaration");else if(!r&&i.id.type!=="Identifier"&&!(t&&(this.type===h._in||this.isContextual("of"))))this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value");else i.init=null;if(e.declarations.push(this.finishNode(i,"VariableDeclarator")),!this.eat(h.comma))break}return e};I.parseVarId=function(e,t){e.id=t==="using"||t==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?li:Ke,!1)};var Qt=1,ni=2,no=4;I.parseFunction=function(e,t,n,r,i){if(this.initFunction(e),this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r){if(this.type===h.star&&t&ni)this.unexpected();e.generator=this.eat(h.star)}if(this.options.ecmaVersion>=8)e.async=!!r;if(t&Qt){if(e.id=t&no&&this.type!==h.name?null:this.parseIdent(),e.id&&!(t&ni))this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?li:Ke:Za)}var a=this.yieldPos,s=this.awaitPos,p=this.awaitIdentPos;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ci(e.async,e.generator)),!(t&Qt))e.id=this.type===h.name?this.parseIdent():null;return this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=a,this.awaitPos=s,this.awaitIdentPos=p,this.finishNode(e,t&Qt?"FunctionDeclaration":"FunctionExpression")};I.parseFunctionParams=function(e){this.expect(h.parenL),e.params=this.parseBindingList(h.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};I.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),a=!1;i.body=[],this.expect(h.braceL);while(this.type!==h.braceR){var s=this.parseClassElement(e.superClass!==null);if(s){if(i.body.push(s),s.type==="MethodDefinition"&&s.kind==="constructor"){if(a)this.raiseRecoverable(s.start,"Duplicate constructor in the same class");a=!0}else if(s.key&&s.key.type==="PrivateIdentifier"&&ud(r,s))this.raiseRecoverable(s.key.start,"Identifier '#"+s.key.name+"' has already been declared")}}return this.strict=n,this.next(),e.body=this.finishNode(i,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};I.parseClassElement=function(e){if(this.eat(h.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r="",i=!1,a=!1,s="method",p=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(h.braceL))return this.parseClassStaticBlock(n),n;if(this.isClassElementNameStart()||this.type===h.star)p=!0;else r="static"}if(n.static=p,!r&&t>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===h.star)&&!this.canInsertSemicolon())a=!0;else r="async";if(!r&&(t>=9||!a)&&this.eat(h.star))i=!0;if(!r&&!a&&!i){var c=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())s=c;else r=c}if(r)n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,"Identifier");else this.parseClassElementName(n);if(t<13||this.type===h.parenL||s!=="method"||i||a){var d=!n.static&&$n(n,"constructor"),u=d&&e;if(d&&s!=="method")this.raise(n.key.start,"Constructor can't have get/set modifier");n.kind=d?"constructor":s,this.parseClassMethod(n,i,a,u)}else this.parseClassField(n);return n};I.isClassElementNameStart=function(){return this.type===h.name||this.type===h.privateId||this.type===h.num||this.type===h.string||this.type===h.bracketL||this.type.keyword};I.parseClassElementName=function(e){if(this.type===h.privateId){if(this.value==="constructor")this.raise(this.start,"Classes can't have an element named '#constructor'");e.computed=!1,e.key=this.parsePrivateIdent()}else this.parsePropertyName(e)};I.parseClassMethod=function(e,t,n,r){var i=e.key;if(e.kind==="constructor"){if(t)this.raise(i.start,"Constructor can't be a generator");if(n)this.raise(i.start,"Constructor can't be an async method")}else if(e.static&&$n(e,"prototype"))this.raise(i.start,"Classes may not have a static property named prototype");var a=e.value=this.parseMethod(t,n,r);if(e.kind==="get"&&a.params.length!==0)this.raiseRecoverable(a.start,"getter should have no params");if(e.kind==="set"&&a.params.length!==1)this.raiseRecoverable(a.start,"setter should have exactly one param");if(e.kind==="set"&&a.params[0].type==="RestElement")this.raiseRecoverable(a.params[0].start,"Setter cannot use rest params");return this.finishNode(e,"MethodDefinition")};I.parseClassField=function(e){if($n(e,"constructor"))this.raise(e.key.start,"Classes can't have a field named 'constructor'");else if(e.static&&$n(e,"prototype"))this.raise(e.key.start,"Classes can't have a static field named 'prototype'");if(this.eat(h.eq))this.enterScope(en|qn),e.value=this.parseMaybeAssign(),this.exitScope();else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};I.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;this.labels=[],this.enterScope(ft|qn);while(this.type!==h.braceR){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};I.parseClassId=function(e,t){if(this.type===h.name){if(e.id=this.parseIdent(),t)this.checkLValSimple(e.id,Ke,!1)}else{if(t===!0)this.unexpected();e.id=null}};I.parseClassSuper=function(e){e.superClass=this.eat(h._extends)?this.parseExprSubscripts(null,!1):null};I.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};I.exitClassBody=function(){var e=this.privateNameStack.pop(),{declared:t,used:n}=e;if(!this.options.checkPrivateFields)return;var r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1];for(var a=0;a<n.length;++a){var s=n[a];if(!At(t,s.name))if(i)i.used.push(s);else this.raiseRecoverable(s.start,"Private field '#"+s.name+"' must be declared in an enclosing class")}};function ud(e,t){var n=t.key.name,r=e[n],i="true";if(t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set"))i=(t.static?"s":"i")+t.kind;if(r==="iget"&&i==="iset"||r==="iset"&&i==="iget"||r==="sget"&&i==="sset"||r==="sset"&&i==="sget")return e[n]="true",!1;else if(!r)return e[n]=i,!1;else return!0}function $n(e,t){var{computed:n,key:r}=e;return!n&&(r.type==="Identifier"&&r.name===t||r.type==="Literal"&&r.value===t)}I.parseExportAllDeclaration=function(e,t){if(this.options.ecmaVersion>=11)if(this.eatContextual("as"))e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart);else e.exported=null;if(this.expectContextual("from"),this.type!==h.string)this.unexpected();if(e.source=this.parseExprAtom(),this.options.ecmaVersion>=16)e.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};I.parseExport=function(e,t){if(this.next(),this.eat(h.star))return this.parseExportAllDeclaration(e,t);if(this.eat(h._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration")this.checkVariableExport(t,e.declaration.declarations);else this.checkExport(t,e.declaration.id,e.declaration.id.start);if(e.specifiers=[],e.source=null,this.options.ecmaVersion>=16)e.attributes=[]}else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from")){if(this.type!==h.string)this.unexpected();if(e.source=this.parseExprAtom(),this.options.ecmaVersion>=16)e.attributes=this.parseWithClause()}else{for(var n=0,r=e.specifiers;n<r.length;n+=1){var i=r[n];if(this.checkUnreserved(i.local),this.checkLocalExport(i.local),i.local.type==="Literal")this.raise(i.local.start,"A string literal cannot be used as an exported binding without `from`.")}if(e.source=null,this.options.ecmaVersion>=16)e.attributes=[]}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};I.parseExportDeclaration=function(e){return this.parseStatement(null)};I.parseExportDefaultDeclaration=function(){var e;if(this.type===h._function||(e=this.isAsyncFunction())){var t=this.startNode();if(this.next(),e)this.next();return this.parseFunction(t,Qt|no,!1,e)}else if(this.type===h._class){var n=this.startNode();return this.parseClass(n,"nullableID")}else{var r=this.parseMaybeAssign();return this.semicolon(),r}};I.checkExport=function(e,t,n){if(!e)return;if(typeof t!=="string")t=t.type==="Identifier"?t.name:t.value;if(At(e,t))this.raiseRecoverable(n,"Duplicate export '"+t+"'");e[t]=!0};I.checkPatternExport=function(e,t){var n=t.type;if(n==="Identifier")this.checkExport(e,t,t.start);else if(n==="ObjectPattern")for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n==="ArrayPattern")for(var s=0,p=t.elements;s<p.length;s+=1){var c=p[s];if(c)this.checkPatternExport(e,c)}else if(n==="Property")this.checkPatternExport(e,t.value);else if(n==="AssignmentPattern")this.checkPatternExport(e,t.left);else if(n==="RestElement")this.checkPatternExport(e,t.argument)};I.checkVariableExport=function(e,t){if(!e)return;for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}};I.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};I.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")};I.parseExportSpecifiers=function(e){var t=[],n=!0;this.expect(h.braceL);while(!this.eat(h.braceR)){if(!n){if(this.expect(h.comma),this.afterTrailingComma(h.braceR))break}else n=!1;t.push(this.parseExportSpecifier(e))}return t};I.parseImport=function(e){if(this.next(),this.type===h.string)e.specifiers=ld,e.source=this.parseExprAtom();else e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===h.string?this.parseExprAtom():this.unexpected();if(this.options.ecmaVersion>=16)e.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(e,"ImportDeclaration")};I.parseImportSpecifier=function(){var e=this.startNode();if(e.imported=this.parseModuleExportName(),this.eatContextual("as"))e.local=this.parseIdent();else this.checkUnreserved(e.imported),e.local=e.imported;return this.checkLValSimple(e.local,Ke),this.finishNode(e,"ImportSpecifier")};I.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,Ke),this.finishNode(e,"ImportDefaultSpecifier")};I.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,Ke),this.finishNode(e,"ImportNamespaceSpecifier")};I.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===h.name){if(e.push(this.parseImportDefaultSpecifier()),!this.eat(h.comma))return e}if(this.type===h.star)return e.push(this.parseImportNamespaceSpecifier()),e;this.expect(h.braceL);while(!this.eat(h.braceR)){if(!t){if(this.expect(h.comma),this.afterTrailingComma(h.braceR))break}else t=!1;e.push(this.parseImportSpecifier())}return e};I.parseWithClause=function(){var e=[];if(!this.eat(h._with))return e;this.expect(h.braceL);var t={},n=!0;while(!this.eat(h.braceR)){if(!n){if(this.expect(h.comma),this.afterTrailingComma(h.braceR))break}else n=!1;var r=this.parseImportAttribute(),i=r.key.type==="Identifier"?r.key.name:r.key.value;if(At(t,i))this.raiseRecoverable(r.key.start,"Duplicate attribute key '"+i+"'");t[i]=!0,e.push(r)}return e};I.parseImportAttribute=function(){var e=this.startNode();if(e.key=this.type===h.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(h.colon),this.type!==h.string)this.unexpected();return e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")};I.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===h.string){var e=this.parseLiteral(this.value);if(sd.test(e.value))this.raise(e.start,"An export name cannot include a lone surrogate.");return e}return this.parseIdent(!0)};I.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)};I.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value==="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var ke=X.prototype;ke.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":if(this.inAsync&&e.name==="await")this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":if(e.type="ObjectPattern",n)this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];if(this.toAssignable(a,t),a.type==="RestElement"&&(a.argument.type==="ArrayPattern"||a.argument.type==="ObjectPattern"))this.raise(a.argument.start,"Unexpected token")}break;case"Property":if(e.kind!=="init")this.raise(e.key.start,"Object pattern can't contain getter or setter");this.toAssignable(e.value,t);break;case"ArrayExpression":if(e.type="ArrayPattern",n)this.checkPatternErrors(n,!0);this.toAssignableList(e.elements,t);break;case"SpreadElement":if(e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern")this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":if(e.operator!=="=")this.raise(e.left.end,"Only '=' operator can be used for specifying default value.");e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,n);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else if(n)this.checkPatternErrors(n,!0);return e};ke.toAssignableList=function(e,t){var n=e.length;for(var r=0;r<n;r++){var i=e[r];if(i)this.toAssignable(i,t)}if(n){var a=e[n-1];if(this.options.ecmaVersion===6&&t&&a&&a.type==="RestElement"&&a.argument.type!=="Identifier")this.unexpected(a.argument.start)}return e};ke.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")};ke.parseRestBinding=function(){var e=this.startNode();if(this.next(),this.options.ecmaVersion===6&&this.type!==h.name)this.unexpected();return e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};ke.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case h.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(h.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case h.braceL:return this.parseObj(!0)}return this.parseIdent()};ke.parseBindingList=function(e,t,n,r){var i=[],a=!0;while(!this.eat(e)){if(a)a=!1;else this.expect(h.comma);if(t&&this.type===h.comma)i.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===h.ellipsis){var s=this.parseRestBinding();if(this.parseBindingListItem(s),i.push(s),this.type===h.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");this.expect(e);break}else i.push(this.parseAssignableListItem(r))}return i};ke.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t};ke.parseBindingListItem=function(e){return e};ke.parseMaybeDefault=function(e,t,n){if(n=n||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(h.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")};ke.checkLValSimple=function(e,t,n){if(t===void 0)t=Fn;var r=t!==Fn;switch(e.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(e.name))this.raiseRecoverable(e.start,(r?"Binding ":"Assigning to ")+e.name+" in strict mode");if(r){if(t===Ke&&e.name==="let")this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name");if(n){if(At(n,e.name))this.raiseRecoverable(e.start,"Argument name clash");n[e.name]=!0}if(t!==to)this.declareName(e.name,t,e.start)}break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(r)this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":if(r)this.raiseRecoverable(e.start,"Binding parenthesized expression");return this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?"Binding":"Assigning to")+" rvalue")}};ke.checkLValPattern=function(e,t,n){if(t===void 0)t=Fn;switch(e.type){case"ObjectPattern":for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,t,n)}break;case"ArrayPattern":for(var s=0,p=e.elements;s<p.length;s+=1){var c=p[s];if(c)this.checkLValInnerPattern(c,t,n)}break;default:this.checkLValSimple(e,t,n)}};ke.checkLValInnerPattern=function(e,t,n){if(t===void 0)t=Fn;switch(e.type){case"Property":this.checkLValInnerPattern(e.value,t,n);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,n);break;case"RestElement":this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var Ce=function(t,n,r,i,a){this.token=t,this.isExpr=!!n,this.preserveSpace=!!r,this.override=i,this.generator=!!a},J={b_stat:new Ce("{",!1),b_expr:new Ce("{",!0),b_tmpl:new Ce("${",!1),p_stat:new Ce("(",!1),p_expr:new Ce("(",!0),q_tmpl:new Ce("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new Ce("function",!1),f_expr:new Ce("function",!0),f_expr_gen:new Ce("function",!0,!1,null,!0),f_gen:new Ce("function",!1,!1,null,!0)},kt=X.prototype;kt.initialContext=function(){return[J.b_stat]};kt.curContext=function(){return this.context[this.context.length-1]};kt.braceIsBlock=function(e){var t=this.curContext();if(t===J.f_expr||t===J.f_stat)return!0;if(e===h.colon&&(t===J.b_stat||t===J.b_expr))return!t.isExpr;if(e===h._return||e===h.name&&this.exprAllowed)return ce.test(this.input.slice(this.lastTokEnd,this.start));if(e===h._else||e===h.semi||e===h.eof||e===h.parenR||e===h.arrow)return!0;if(e===h.braceL)return t===J.b_stat;if(e===h._var||e===h._const||e===h.name)return!1;return!this.exprAllowed};kt.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return!1};kt.updateContext=function(e){var t,n=this.type;if(n.keyword&&e===h.dot)this.exprAllowed=!1;else if(t=n.updateContext)t.call(this,e);else this.exprAllowed=n.beforeExpr};kt.overrideContext=function(e){if(this.curContext()!==e)this.context[this.context.length-1]=e};h.parenR.updateContext=h.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();if(e===J.b_stat&&this.curContext().token==="function")e=this.context.pop();this.exprAllowed=!e.isExpr};h.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?J.b_stat:J.b_expr),this.exprAllowed=!0};h.dollarBraceL.updateContext=function(){this.context.push(J.b_tmpl),this.exprAllowed=!0};h.parenL.updateContext=function(e){var t=e===h._if||e===h._for||e===h._with||e===h._while;this.context.push(t?J.p_stat:J.p_expr),this.exprAllowed=!0};h.incDec.updateContext=function(){};h._function.updateContext=h._class.updateContext=function(e){if(e.beforeExpr&&e!==h._else&&!(e===h.semi&&this.curContext()!==J.p_stat)&&!(e===h._return&&ce.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===h.colon||e===h.braceL)&&this.curContext()===J.b_stat))this.context.push(J.f_expr);else this.context.push(J.f_stat);this.exprAllowed=!1};h.colon.updateContext=function(){if(this.curContext().token==="function")this.context.pop();this.exprAllowed=!0};h.backQuote.updateContext=function(){if(this.curContext()===J.q_tmpl)this.context.pop();else this.context.push(J.q_tmpl);this.exprAllowed=!1};h.star.updateContext=function(e){if(e===h._function){var t=this.context.length-1;if(this.context[t]===J.f_expr)this.context[t]=J.f_expr_gen;else this.context[t]=J.f_gen}this.exprAllowed=!0};h.name.updateContext=function(e){var t=!1;if(this.options.ecmaVersion>=6&&e!==h.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())t=!0}this.exprAllowed=t};var M=X.prototype;M.checkPropClash=function(e,t,n){if(this.options.ecmaVersion>=9&&e.type==="SpreadElement")return;if(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))return;var r=e.key,i;switch(r.type){case"Identifier":i=r.name;break;case"Literal":i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6){if(i==="__proto__"&&a==="init"){if(t.proto)if(n){if(n.doubleProto<0)n.doubleProto=r.start}else this.raiseRecoverable(r.start,"Redefinition of __proto__ property");t.proto=!0}return}i="$"+i;var s=t[i];if(s){var p;if(a==="init")p=this.strict&&s.init||s.get||s.set;else p=s.init||s[a];if(p)this.raiseRecoverable(r.start,"Redefinition of property")}else s=t[i]={init:!1,get:!1,set:!1};s[a]=!0};M.parseExpression=function(e,t){var n=this;return this.catchStackOverflow(function(){var{start:r,startLoc:i}=n,a=n.parseMaybeAssign(e,t);if(n.type===h.comma){var s=n.startNodeAt(r,i);s.expressions=[a];while(n.eat(h.comma))s.expressions.push(n.parseMaybeAssign(e,t));return n.finishNode(s,"SequenceExpression")}return a})};M.parseMaybeAssign=function(e,t,n){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(e);else this.exprAllowed=!1;var r=!1,i=-1,a=-1,s=-1;if(t)i=t.parenthesizedAssign,a=t.trailingComma,s=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1;else t=new Gn,r=!0;var p=this.start,c=this.startLoc;if(this.type===h.parenL||this.type===h.name)this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await";var d=this.parseMaybeConditional(e,t);if(n)d=n.call(this,d,p,c);if(this.type.isAssign){var u=this.startNodeAt(p,c);if(u.operator=this.value,this.type===h.eq)d=this.toAssignable(d,!1,t);if(!r)t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1;if(t.shorthandAssign>=d.start)t.shorthandAssign=-1;if(this.type===h.eq)this.checkLValPattern(d);else this.checkLValSimple(d);if(u.left=d,this.next(),u.right=this.parseMaybeAssign(e),s>-1)t.doubleProto=s;return this.finishNode(u,"AssignmentExpression")}else if(r)this.checkExpressionErrors(t,!0);if(i>-1)t.parenthesizedAssign=i;if(a>-1)t.trailingComma=a;return d};M.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(!(i.type==="ArrowFunctionExpression"&&i.start===n)&&this.eat(h.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(h.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,"ConditionalExpression")}return i};M.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);if(this.checkExpressionErrors(t))return i;return i.start===n&&i.type==="ArrowFunctionExpression"?i:this.parseExprOp(i,n,r,-1,e)};M.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==h._in)){if(a>r){var s=this.type===h.logicalOR||this.type===h.logicalAND,p=this.type===h.coalesce;if(p)a=h.logicalAND.binop;var c=this.value;this.next();var d=this.start,u=this.startLoc,y=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),d,u,a,i),x=this.buildBinary(t,n,e,y,c,s||p);if(s&&this.type===h.coalesce||p&&(this.type===h.logicalOR||this.type===h.logicalAND))this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");return this.parseExprOp(x,t,n,r,i)}}return e};M.buildBinary=function(e,t,n,r,i,a){if(r.type==="PrivateIdentifier")this.raise(r.start,"Private identifier can only be left side of binary expression");var s=this.startNodeAt(e,t);return s.left=n,s.operator=i,s.right=r,this.finishNode(s,a?"LogicalExpression":"BinaryExpression")};M.parseMaybeUnary=function(e,t,n,r){var i=this.start,a=this.startLoc,s;if(this.isContextual("await")&&this.canAwait)s=this.parseAwait(r),t=!0;else if(this.type.prefix){var p=this.startNode(),c=this.type===h.incDec;if(p.operator=this.value,p.prefix=!0,this.next(),p.argument=this.parseMaybeUnary(null,!0,c,r),this.checkExpressionErrors(e,!0),c)this.checkLValSimple(p.argument);else if(this.strict&&p.operator==="delete"&&ro(p.argument))this.raiseRecoverable(p.start,"Deleting local variable in strict mode");else if(p.operator==="delete"&&ri(p.argument))this.raiseRecoverable(p.start,"Private fields can not be deleted");else t=!0;s=this.finishNode(p,c?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===h.privateId){if((r||this.privateNameStack.length===0)&&this.options.checkPrivateFields)this.unexpected();if(s=this.parsePrivateIdent(),this.type!==h._in)this.unexpected()}else{if(s=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return s;while(this.type.postfix&&!this.canInsertSemicolon()){var d=this.startNodeAt(i,a);d.operator=this.value,d.prefix=!1,d.argument=s,this.checkLValSimple(s),this.next(),s=this.finishNode(d,"UpdateExpression")}}if(!n&&!(s.type==="ArrowFunctionExpression"&&s.start===i)&&this.eat(h.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(i,a,s,this.parseMaybeUnary(null,!1,!1,r),"**",!1);else return s};function ro(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&ro(e.expression)}function ri(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&ri(e.expression)||e.type==="ParenthesizedExpression"&&ri(e.expression)}M.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprAtom(e,t);if(i.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return i;var a=this.parseSubscripts(i,n,r,!1,t);if(e&&a.type==="MemberExpression"){if(e.parenthesizedAssign>=a.start)e.parenthesizedAssign=-1;if(e.parenthesizedBind>=a.start)e.parenthesizedBind=-1;if(e.trailingComma>=a.start)e.trailingComma=-1}return a};M.parseSubscripts=function(e,t,n,r,i){var a=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,s=!1;while(!0){var p=this.parseSubscript(e,t,n,r,a,s,i);if(p.optional)s=!0;if(p===e||p.type==="ArrowFunctionExpression"){if(s){var c=this.startNodeAt(t,n);c.expression=p,p=this.finishNode(c,"ChainExpression")}return p}e=p}};M.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(h.arrow)};M.parseSubscriptAsyncArrow=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,r)};M.parseSubscript=function(e,t,n,r,i,a,s){var p=this.options.ecmaVersion>=11,c=p&&this.eat(h.questionDot);if(r&&c)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var d=this.eat(h.bracketL);if(d||c&&this.type!==h.parenL&&this.type!==h.backQuote||this.eat(h.dot)){var u=this.startNodeAt(t,n);if(u.object=e,d)u.property=this.parseExpression(),this.expect(h.bracketR);else if(this.type===h.privateId&&e.type!=="Super")u.property=this.parsePrivateIdent();else u.property=this.parseIdent(this.options.allowReserved!=="never");if(u.computed=!!d,p)u.optional=c;e=this.finishNode(u,"MemberExpression")}else if(!r&&this.eat(h.parenL)){var y=new Gn,x=this.yieldPos,g=this.awaitPos,C=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var v=this.parseExprList(h.parenR,this.options.ecmaVersion>=8,!1,y);if(i&&!c&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(y,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");return this.yieldPos=x,this.awaitPos=g,this.awaitIdentPos=C,this.parseSubscriptAsyncArrow(t,n,v,s)}this.checkExpressionErrors(y,!0),this.yieldPos=x||this.yieldPos,this.awaitPos=g||this.awaitPos,this.awaitIdentPos=C||this.awaitIdentPos;var w=this.startNodeAt(t,n);if(w.callee=e,w.arguments=v,p)w.optional=c;e=this.finishNode(w,"CallExpression")}else if(this.type===h.backQuote){if(c||a)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var R=this.startNodeAt(t,n);R.tag=e,R.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(R,"TaggedTemplateExpression")}return e};M.parseExprAtom=function(e,t,n){if(this.type===h.slash)this.readRegexp();var r,i=this.potentialArrowAt===this.start;switch(this.type){case h._super:if(!this.allowSuper)this.raise(this.start,"'super' keyword outside a method");if(r=this.startNode(),this.next(),this.type===h.parenL&&!this.allowDirectSuper)this.raise(r.start,"super() call outside constructor of a subclass");if(this.type!==h.dot&&this.type!==h.bracketL&&this.type!==h.parenL)this.unexpected();return this.finishNode(r,"Super");case h._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case h.name:var a=this.start,s=this.startLoc,p=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!p&&c.name==="async"&&!this.canInsertSemicolon()&&this.eat(h._function))return this.overrideContext(J.f_expr),this.parseFunction(this.startNodeAt(a,s),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(h.arrow))return this.parseArrowExpression(this.startNodeAt(a,s),[c],!1,t);if(this.options.ecmaVersion>=8&&c.name==="async"&&this.type===h.name&&!p&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(c=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(h.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(a,s),[c],!0,t)}}return c;case h.regexp:var d=this.value;return r=this.parseLiteral(d.value),r.regex={pattern:d.pattern,flags:d.flags},r;case h.num:case h.string:return this.parseLiteral(this.value);case h._null:case h._true:case h._false:return r=this.startNode(),r.value=this.type===h._null?null:this.type===h._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,"Literal");case h.parenL:var u=this.start,y=this.parseParenAndDistinguishExpression(i,t);if(e){if(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(y))e.parenthesizedAssign=u;if(e.parenthesizedBind<0)e.parenthesizedBind=u}return y;case h.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(h.bracketR,!0,!0,e),this.finishNode(r,"ArrayExpression");case h.braceL:return this.overrideContext(J.b_expr),this.parseObj(!1,e);case h._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case h._class:return this.parseClass(this.startNode(),!1);case h._new:return this.parseNew();case h.backQuote:return this.parseTemplate();case h._import:if(this.options.ecmaVersion>=11)return this.parseExprImport(n);else return this.unexpected();default:return this.parseExprAtomDefault()}};M.parseExprAtomDefault=function(){this.unexpected()};M.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword import");if(this.next(),this.type===h.parenL&&!e)return this.parseDynamicImport(t);else if(this.type===h.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name="import",t.meta=this.finishNode(n,"Identifier"),this.parseImportMeta(t)}else this.unexpected()};M.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)if(!this.eat(h.parenR))if(this.expect(h.comma),!this.afterTrailingComma(h.parenR)){if(e.options=this.parseMaybeAssign(),!this.eat(h.parenR)){if(this.expect(h.comma),!this.afterTrailingComma(h.parenR))this.unexpected()}}else e.options=null;else e.options=null;else if(!this.eat(h.parenR)){var t=this.start;if(this.eat(h.comma)&&this.eat(h.parenR))this.raiseRecoverable(t,"Trailing comma is not allowed in import()");else this.unexpected(t)}return this.finishNode(e,"ImportExpression")};M.parseImportMeta=function(e){this.next();var t=this.containsEsc;if(e.property=this.parseIdent(!0),e.property.name!=="meta")this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'");if(t)this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters");if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere)this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module");return this.finishNode(e,"MetaProperty")};M.parseLiteral=function(e){var t=this.startNode();if(t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110)t.bigint=t.value!=null?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"");return this.next(),this.finishNode(t,"Literal")};M.parseParenExpression=function(){this.expect(h.parenL);var e=this.parseExpression();return this.expect(h.parenR),e};M.shouldParseArrow=function(e){return!this.canInsertSemicolon()};M.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s=this.start,p=this.startLoc,c=[],d=!0,u=!1,y=new Gn,x=this.yieldPos,g=this.awaitPos,C;this.yieldPos=0,this.awaitPos=0;while(this.type!==h.parenR)if(d?d=!1:this.expect(h.comma),a&&this.afterTrailingComma(h.parenR,!0)){u=!0;break}else if(this.type===h.ellipsis){if(C=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===h.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else c.push(this.parseMaybeAssign(!1,y,this.parseParenItem));var v=this.lastTokEnd,w=this.lastTokEndLoc;if(this.expect(h.parenR),e&&this.shouldParseArrow(c)&&this.eat(h.arrow))return this.checkPatternErrors(y,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=x,this.awaitPos=g,this.parseParenArrowList(n,r,c,t);if(!c.length||u)this.unexpected(this.lastTokStart);if(C)this.unexpected(C);if(this.checkExpressionErrors(y,!0),this.yieldPos=x||this.yieldPos,this.awaitPos=g||this.awaitPos,c.length>1)i=this.startNodeAt(s,p),i.expressions=c,this.finishNodeAt(i,"SequenceExpression",v,w);else i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var R=this.startNodeAt(n,r);return R.expression=i,this.finishNode(R,"ParenthesizedExpression")}else return i};M.parseParenItem=function(e){return e};M.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var dd=[];M.parseNew=function(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===h.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var n=this.containsEsc;if(e.property=this.parseIdent(!0),e.property.name!=="target")this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'");if(n)this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block");return this.finishNode(e,"MetaProperty")}var r=this.start,i=this.startLoc;if(e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,i,!0,!1),e.callee.type==="Super")this.raiseRecoverable(r,"Invalid use of 'super'");if(this.eat(h.parenL))e.arguments=this.parseExprList(h.parenR,this.options.ecmaVersion>=8,!1);else e.arguments=dd;return this.finishNode(e,"NewExpression")};M.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();if(this.type===h.invalidTemplate){if(!t)this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal");n.value={raw:this.value.replace(/\r\n?/g,`
31
28
  `),cooked:null}}else n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
32
- `),cooked:this.value};return this.next(),n.tail=this.type===h.backQuote,this.finishNode(n,"TemplateElement")};z.parseTemplate=function(e){if(e===void 0)e={};var t=e.isTagged;if(t===void 0)t=!1;var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});n.quasis=[r];while(!r.tail){if(this.type===h.eof)this.raise(this.pos,"Unterminated template literal");this.expect(h.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(h.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}))}return this.next(),this.finishNode(n,"TemplateLiteral")};z.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===h.name||this.type===h.num||this.type===h.string||this.type===h.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===h.star)&&!Re.test(this.input.slice(this.lastTokEnd,this.start))};z.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};n.properties=[],this.next();while(!this.eat(h.braceR)){if(!r){if(this.expect(h.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(h.braceR))break}else r=!1;var o=this.parseProperty(e,t);if(!e)this.checkPropClash(o,i,t);n.properties.push(o)}return this.finishNode(n,e?"ObjectPattern":"ObjectExpression")};z.parseProperty=function(e,t){var n=this.startNode(),r,i,o,s;if(this.options.ecmaVersion>=9&&this.eat(h.ellipsis)){if(e){if(n.argument=this.parseIdent(!1),this.type===h.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");return this.finishNode(n,"RestElement")}if(n.argument=this.parseMaybeAssign(!1,t),this.type===h.comma&&t&&t.trailingComma<0)t.trailingComma=this.start;return this.finishNode(n,"SpreadElement")}if(this.options.ecmaVersion>=6){if(n.method=!1,n.shorthand=!1,e||t)o=this.start,s=this.startLoc;if(!e)r=this.eat(h.star)}var c=this.containsEsc;if(this.parsePropertyName(n),!e&&!c&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n))i=!0,r=this.options.ecmaVersion>=9&&this.eat(h.star),this.parsePropertyName(n);else i=!1;return this.parsePropertyValue(n,e,r,i,o,s,t,c),this.finishNode(n,"Property")};z.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var n=e.kind==="get"?0:1;if(e.value.params.length!==n){var r=e.value.start;if(e.kind==="get")this.raiseRecoverable(r,"getter should have no params");else this.raiseRecoverable(r,"setter should have exactly one param")}else if(e.kind==="set"&&e.value.params[0].type==="RestElement")this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};z.parsePropertyValue=function(e,t,n,r,i,o,s,c){if((n||r)&&this.type===h.colon)this.unexpected();if(this.eat(h.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,s),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===h.parenL){if(t)this.unexpected();e.method=!0,e.value=this.parseMethod(n,r),e.kind="init"}else if(!t&&!c&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&(this.type!==h.comma&&this.type!==h.braceR&&this.type!==h.eq)){if(n||r)this.unexpected();this.parseGetterSetter(e)}else if(this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"){if(n||r)this.unexpected();if(this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=i;if(t)e.value=this.parseMaybeDefault(i,o,this.copyNode(e.key));else if(this.type===h.eq&&s){if(s.shorthandAssign<0)s.shorthandAssign=this.start;e.value=this.parseMaybeDefault(i,o,this.copyNode(e.key))}else e.value=this.copyNode(e.key);e.kind="init",e.shorthand=!0}else this.unexpected()};z.parsePropertyName=function(e){if(this.options.ecmaVersion>=6)if(this.eat(h.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(h.bracketR),e.key;else e.computed=!1;return e.key=this.type===h.num||this.type===h.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};z.initFunction=function(e){if(e.id=null,this.options.ecmaVersion>=6)e.generator=e.expression=!1;if(this.options.ecmaVersion>=8)e.async=!1};z.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;if(this.initFunction(r),this.options.ecmaVersion>=6)r.generator=e;if(this.options.ecmaVersion>=8)r.async=!!t;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Si(t,r.generator)|sr|(n?to:0)),this.expect(h.parenL),r.params=this.parseBindingList(h.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(r,"FunctionExpression")};z.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;if(this.enterScope(Si(n,!1)|Ci),this.initFunction(e),this.options.ecmaVersion>=8)e.async=!!n;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")};z.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==h.braceL,o=this.strict,s=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var c=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);if(!o||c){if(s=this.strictDirective(this.end),s&&c)this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list")}var l=this.labels;if(this.labels=[],s)this.strict=!0;if(this.checkParams(e,!o&&!s&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id)this.checkLValSimple(e.id,so);e.body=this.parseBlock(!1,void 0,s&&!o),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=l}this.exitScope()};z.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1){var r=n[t];if(r.type!=="Identifier")return!1}return!0};z.checkParams=function(e,t){var n=Object.create(null);for(var r=0,i=e.params;r<i.length;r+=1){var o=i[r];this.checkLValInnerPattern(o,vi,t?null:n)}};z.parseExprList=function(e,t,n,r){var i=[],o=!0;while(!this.eat(e)){if(!o){if(this.expect(h.comma),t&&this.afterTrailingComma(e))break}else o=!1;var s=void 0;if(n&&this.type===h.comma)s=null;else if(this.type===h.ellipsis){if(s=this.parseSpread(r),r&&this.type===h.comma&&r.trailingComma<0)r.trailingComma=this.start}else s=this.parseMaybeAssign(!1,r);i.push(s)}return i};z.checkUnreserved=function(e){var{start:t,end:n,name:r}=e;if(this.inGenerator&&r==="yield")this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator");if(this.inAsync&&r==="await")this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function");if(!(this.currentThisScope().flags&ar)&&r==="arguments")this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer");if(this.inClassStaticBlock&&(r==="arguments"||r==="await"))this.raise(t,"Cannot use "+r+" in class static initialization block");if(this.keywords.test(r))this.raise(t,"Unexpected keyword '"+r+"'");if(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf("\\")!==-1)return;var i=this.strict?this.reservedWordsStrict:this.reservedWords;if(i.test(r)){if(!this.inAsync&&r==="await")this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function");this.raiseRecoverable(t,"The keyword '"+r+"' is reserved")}};z.parseIdent=function(e){var t=this.parseIdentNode();if(this.next(!!e),this.finishNode(t,"Identifier"),!e){if(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=t.start}return t};z.parseIdentNode=function(){var e=this.startNode();if(this.type===h.name)e.name=this.value;else if(this.type.keyword){if(e.name=this.type.keyword,(e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.context.pop();this.type=h.name}else this.unexpected();return e};z.parsePrivateIdent=function(){var e=this.startNode();if(this.type===h.privateId)e.name=this.value;else this.unexpected();if(this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields)if(this.privateNameStack.length===0)this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class");else this.privateNameStack[this.privateNameStack.length-1].used.push(e);return e};z.parseYield=function(e){if(!this.yieldPos)this.yieldPos=this.start;var t=this.startNode();if(this.next(),this.type===h.semi||this.canInsertSemicolon()||this.type!==h.star&&!this.type.startsExpr)t.delegate=!1,t.argument=null;else t.delegate=this.eat(h.star),t.argument=this.parseMaybeAssign(e);return this.finishNode(t,"YieldExpression")};z.parseAwait=function(e){if(!this.awaitPos)this.awaitPos=this.start;var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var nr=me.prototype;nr.raise=function(e,t){var n=Ti(this.input,e);if(t+=" ("+n.line+":"+n.column+")",this.sourceFile)t+=" in "+this.sourceFile;var r=SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r};nr.raiseRecoverable=nr.raise;nr.curPosition=function(){if(this.options.locations)return new Xt(this.curLine,this.pos-this.lineStart)};var kt=me.prototype,td=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[]};kt.enterScope=function(e){this.scopeStack.push(new td(e))};kt.exitScope=function(){this.scopeStack.pop()};kt.treatFunctionsAsVarInScope=function(e){return e.flags&Ot||!this.inModule&&e.flags&Rt};kt.declareName=function(e,t,n){var r=!1;if(t===xt){var i=this.currentScope();if(r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&Rt)delete this.undefinedExports[e]}else if(t===io){var o=this.currentScope();o.lexical.push(e)}else if(t===ro){var s=this.currentScope();if(this.treatFunctionsAsVar)r=s.lexical.indexOf(e)>-1;else r=s.lexical.indexOf(e)>-1||s.var.indexOf(e)>-1;s.functions.push(e)}else for(var c=this.scopeStack.length-1;c>=0;--c){var l=this.scopeStack[c];if(l.lexical.indexOf(e)>-1&&!(l.flags&eo&&l.lexical[0]===e)||!this.treatFunctionsAsVarInScope(l)&&l.functions.indexOf(e)>-1){r=!0;break}if(l.var.push(e),this.inModule&&l.flags&Rt)delete this.undefinedExports[e];if(l.flags&ar)break}if(r)this.raiseRecoverable(n,"Identifier '"+e+"' has already been declared")};kt.checkLocalExport=function(e){if(this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1)this.undefinedExports[e.name]=e};kt.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};kt.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(ar|An|Bt))return t}};kt.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(ar|An|Bt)&&!(t.flags&Ci))return t}};var kn=function(t,n,r){if(this.type="",this.start=n,this.end=0,t.options.locations)this.loc=new Pn(t,r);if(t.options.directSourceFile)this.sourceFile=t.options.directSourceFile;if(t.options.ranges)this.range=[n,0]},wn=me.prototype;wn.startNode=function(){return new kn(this,this.start,this.startLoc)};wn.startNodeAt=function(e,t){return new kn(this,e,t)};function co(e,t,n,r){if(e.type=t,e.end=n,this.options.locations)e.loc.end=r;if(this.options.ranges)e.range[1]=n;return e}wn.finishNode=function(e,t){return co.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};wn.finishNodeAt=function(e,t,n,r){return co.call(this,e,t,n,r)};wn.copyNode=function(e){var t=new kn(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var nd="Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz",po="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",lo=po+" Extended_Pictographic",uo=lo,fo=uo+" EBase EComp EMod EPres ExtPict",ho=fo,rd=ho,id={9:po,10:lo,11:uo,12:fo,13:ho,14:rd},sd="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",ad={9:"",10:"",11:"",12:"",13:"",14:sd},Wa="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",mo="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",yo=mo+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",go=yo+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",xo=go+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",bo=xo+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",od=bo+" "+nd,cd={9:mo,10:yo,11:go,12:xo,13:bo,14:od},To={};function pd(e){var t=To[e]={binary:At(id[e]+" "+Wa),binaryOfStrings:At(ad[e]),nonBinary:{General_Category:At(Wa),Script:At(cd[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(Sn=0,Qn=[9,10,11,12,13,14];Sn<Qn.length;Sn+=1)xi=Qn[Sn],pd(xi);var xi,Sn,Qn,B=me.prototype,rr=function(t,n){this.parent=t,this.base=n||this};rr.prototype.separatedFrom=function(t){for(var n=this;n;n=n.parent)for(var r=t;r;r=r.parent)if(n.base===r.base&&n!==r)return!0;return!1};rr.prototype.sibling=function(){return new rr(this.parent,this.base)};var ut=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":"")+(t.options.ecmaVersion>=15?"v":""),this.unicodeProperties=To[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};ut.prototype.reset=function(t,n,r){var i=r.indexOf("v")!==-1,o=r.indexOf("u")!==-1;if(this.start=t|0,this.source=n+"",this.flags=r,i&&this.parser.options.ecmaVersion>=15)this.switchU=!0,this.switchV=!0,this.switchN=!0;else this.switchU=o&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=o&&this.parser.options.ecmaVersion>=9};ut.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)};ut.prototype.at=function(t,n){if(n===void 0)n=!1;var r=this.source,i=r.length;if(t>=i)return-1;var o=r.charCodeAt(t);if(!(n||this.switchU)||o<=55295||o>=57344||t+1>=i)return o;var s=r.charCodeAt(t+1);return s>=56320&&s<=57343?(o<<10)+s-56613888:o};ut.prototype.nextIndex=function(t,n){if(n===void 0)n=!1;var r=this.source,i=r.length;if(t>=i)return i;var o=r.charCodeAt(t),s;if(!(n||this.switchU)||o<=55295||o>=57344||t+1>=i||(s=r.charCodeAt(t+1))<56320||s>57343)return t+1;return t+2};ut.prototype.current=function(t){if(t===void 0)t=!1;return this.at(this.pos,t)};ut.prototype.lookahead=function(t){if(t===void 0)t=!1;return this.at(this.nextIndex(this.pos,t),t)};ut.prototype.advance=function(t){if(t===void 0)t=!1;this.pos=this.nextIndex(this.pos,t)};ut.prototype.eat=function(t,n){if(n===void 0)n=!1;if(this.current(n)===t)return this.advance(n),!0;return!1};ut.prototype.eatChars=function(t,n){if(n===void 0)n=!1;var r=this.pos;for(var i=0,o=t;i<o.length;i+=1){var s=o[i],c=this.at(r,n);if(c===-1||c!==s)return!1;r=this.nextIndex(r,n)}return this.pos=r,!0};B.validateRegExpFlags=function(e){var{validFlags:t,flags:n}=e,r=!1,i=!1;for(var o=0;o<n.length;o++){var s=n.charAt(o);if(t.indexOf(s)===-1)this.raise(e.start,"Invalid regular expression flag");if(n.indexOf(s,o+1)>-1)this.raise(e.start,"Duplicate regular expression flag");if(s==="u")r=!0;if(s==="v")i=!0}if(this.options.ecmaVersion>=15&&r&&i)this.raise(e.start,"Invalid regular expression flag")};function ld(e){for(var t in e)return!0;return!1}B.validateRegExpPattern=function(e){if(this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&ld(e.groupNames))e.switchN=!0,this.regexp_pattern(e)};B.regexp_pattern=function(e){if(e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length){if(e.eat(41))e.raise("Unmatched ')'");if(e.eat(93)||e.eat(125))e.raise("Lone quantifier brackets")}if(e.maxBackReference>e.numCapturingParens)e.raise("Invalid escape");for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];if(!e.groupNames[r])e.raise("Invalid named capture referenced")}};B.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;if(t)e.branchID=new rr(e.branchID,null);this.regexp_alternative(e);while(e.eat(124)){if(t)e.branchID=e.branchID.sibling();this.regexp_alternative(e)}if(t)e.branchID=e.branchID.parent;if(this.regexp_eatQuantifier(e,!0))e.raise("Nothing to repeat");if(e.eat(123))e.raise("Lone quantifier brackets")};B.regexp_alternative=function(e){while(e.pos<e.source.length&&this.regexp_eatTerm(e));};B.regexp_eatTerm=function(e){if(this.regexp_eatAssertion(e)){if(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)){if(e.switchU)e.raise("Invalid quantifier")}return!0}if(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))return this.regexp_eatQuantifier(e),!0;return!1};B.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9)n=e.eat(60);if(e.eat(61)||e.eat(33)){if(this.regexp_disjunction(e),!e.eat(41))e.raise("Unterminated group");return e.lastAssertionIsQuantifiable=!n,!0}}return e.pos=t,!1};B.regexp_eatQuantifier=function(e,t){if(t===void 0)t=!1;if(this.regexp_eatQuantifierPrefix(e,t))return e.eat(63),!0;return!1};B.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};B.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)){if(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e))i=e.lastIntValue;if(e.eat(125)){if(i!==-1&&i<r&&!t)e.raise("numbers out of order in {} quantifier");return!0}}if(e.switchU&&!t)e.raise("Incomplete quantifier");e.pos=n}return!1};B.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)};B.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1};B.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var n=this.regexp_eatModifiers(e),r=e.eat(45);if(n||r){for(var i=0;i<n.length;i++){var o=n.charAt(i);if(n.indexOf(o,i+1)>-1)e.raise("Duplicate regular expression modifiers")}if(r){var s=this.regexp_eatModifiers(e);if(!n&&!s&&e.current()===58)e.raise("Invalid regular expression modifiers");for(var c=0;c<s.length;c++){var l=s.charAt(c);if(s.indexOf(l,c+1)>-1||n.indexOf(l)>-1)e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1};B.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9)this.regexp_groupSpecifier(e);else if(e.current()===63)e.raise("Invalid group");if(this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};B.regexp_eatModifiers=function(e){var t="",n=0;while((n=e.current())!==-1&&ud(n))t+=yt(n),e.advance();return t};function ud(e){return e===105||e===109||e===115}B.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};B.regexp_eatInvalidBracedQuantifier=function(e){if(this.regexp_eatBracedQuantifier(e,!0))e.raise("Nothing to repeat");return!1};B.regexp_eatSyntaxCharacter=function(e){var t=e.current();if(Eo(t))return e.lastIntValue=t,e.advance(),!0;return!1};function Eo(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}B.regexp_eatPatternCharacters=function(e){var t=e.pos,n=0;while((n=e.current())!==-1&&!Eo(n))e.advance();return e.pos!==t};B.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();if(t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124)return e.advance(),!0;return!1};B.regexp_groupSpecifier=function(e){if(e.eat(63)){if(!this.regexp_eatGroupName(e))e.raise("Invalid group");var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n)if(t)for(var r=0,i=n;r<i.length;r+=1){var o=i[r];if(!o.separatedFrom(e.branchID))e.raise("Duplicate capture group name")}else e.raise("Duplicate capture group name");if(t)(n||(e.groupNames[e.lastStringValue]=[])).push(e.branchID);else e.groupNames[e.lastStringValue]=!0}};B.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};B.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){e.lastStringValue+=yt(e.lastIntValue);while(this.regexp_eatRegExpIdentifierPart(e))e.lastStringValue+=yt(e.lastIntValue);return!0}return!1};B.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);if(e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n))r=e.lastIntValue;if(dd(r))return e.lastIntValue=r,!0;return e.pos=t,!1};function dd(e){return Le(e,!0)||e===36||e===95}B.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);if(e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n))r=e.lastIntValue;if(fd(r))return e.lastIntValue=r,!0;return e.pos=t,!1};function fd(e){return Fe(e,!0)||e===36||e===95||e===8204||e===8205}B.regexp_eatAtomEscape=function(e){if(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))return!0;if(e.switchU){if(e.current()===99)e.raise("Invalid unicode escape");e.raise("Invalid escape")}return!1};B.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU){if(n>e.maxBackReference)e.maxBackReference=n;return!0}if(n<=e.numCapturingParens)return!0;e.pos=t}return!1};B.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};B.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};B.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1};B.regexp_eatZero=function(e){if(e.current()===48&&!cr(e.lookahead()))return e.lastIntValue=0,e.advance(),!0;return!1};B.regexp_eatControlEscape=function(e){var t=e.current();if(t===116)return e.lastIntValue=9,e.advance(),!0;if(t===110)return e.lastIntValue=10,e.advance(),!0;if(t===118)return e.lastIntValue=11,e.advance(),!0;if(t===102)return e.lastIntValue=12,e.advance(),!0;if(t===114)return e.lastIntValue=13,e.advance(),!0;return!1};B.regexp_eatControlLetter=function(e){var t=e.current();if(Co(t))return e.lastIntValue=t%32,e.advance(),!0;return!1};function Co(e){return e>=65&&e<=90||e>=97&&e<=122}B.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){if(t===void 0)t=!1;var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var o=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(s>=56320&&s<=57343)return e.lastIntValue=(i-55296)*1024+(s-56320)+65536,!0}e.pos=o,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&hd(e.lastIntValue))return!0;if(r)e.raise("Invalid unicode escape");e.pos=n}return!1};function hd(e){return e>=0&&e<=1114111}B.regexp_eatIdentityEscape=function(e){if(e.switchU){if(this.regexp_eatSyntaxCharacter(e))return!0;if(e.eat(47))return e.lastIntValue=47,!0;return!1}var t=e.current();if(t!==99&&(!e.switchN||t!==107))return e.lastIntValue=t,e.advance(),!0;return!1};B.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var So=0,gt=1,Ze=2;B.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(md(t))return e.lastIntValue=-1,e.advance(),gt;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125)){if(n&&r===Ze)e.raise("Invalid property name");return r}e.raise("Invalid property name")}return So};function md(e){return e===100||e===68||e===115||e===83||e===119||e===87}B.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),gt}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return So};B.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){if(!Yt(e.unicodeProperties.nonBinary,t))e.raise("Invalid property name");if(!e.unicodeProperties.nonBinary[t].test(n))e.raise("Invalid property value")};B.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return gt;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return Ze;e.raise("Invalid property name")};B.regexp_eatUnicodePropertyName=function(e){var t=0;e.lastStringValue="";while(vo(t=e.current()))e.lastStringValue+=yt(t),e.advance();return e.lastStringValue!==""};function vo(e){return Co(e)||e===95}B.regexp_eatUnicodePropertyValue=function(e){var t=0;e.lastStringValue="";while(yd(t=e.current()))e.lastStringValue+=yt(t),e.advance();return e.lastStringValue!==""};function yd(e){return vo(e)||cr(e)}B.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};B.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);if(!e.eat(93))e.raise("Unterminated character class");if(t&&n===Ze)e.raise("Negated character class may contain strings");return!0}return!1};B.regexp_classContents=function(e){if(e.current()===93)return gt;if(e.switchV)return this.regexp_classSetExpression(e);return this.regexp_nonEmptyClassRanges(e),gt};B.regexp_nonEmptyClassRanges=function(e){while(this.regexp_eatClassAtom(e)){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;if(e.switchU&&(t===-1||n===-1))e.raise("Invalid character class");if(t!==-1&&n!==-1&&t>n)e.raise("Range out of order in character class")}}};B.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();if(n===99||ko(n))e.raise("Invalid class escape");e.raise("Invalid escape")}e.pos=t}var r=e.current();if(r!==93)return e.lastIntValue=r,e.advance(),!0;return!1};B.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};B.regexp_classSetExpression=function(e){var t=gt,n;if(this.regexp_eatClassSetRange(e));else if(n=this.regexp_eatClassSetOperand(e)){if(n===Ze)t=Ze;var r=e.pos;while(e.eatChars([38,38])){if(e.current()!==38&&(n=this.regexp_eatClassSetOperand(e))){if(n!==Ze)t=gt;continue}e.raise("Invalid character in character class")}if(r!==e.pos)return t;while(e.eatChars([45,45])){if(this.regexp_eatClassSetOperand(e))continue;e.raise("Invalid character in character class")}if(r!==e.pos)return t}else e.raise("Invalid character in character class");for(;;){if(this.regexp_eatClassSetRange(e))continue;if(n=this.regexp_eatClassSetOperand(e),!n)return t;if(n===Ze)t=Ze}};B.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;if(n!==-1&&r!==-1&&n>r)e.raise("Range out of order in character class");return!0}e.pos=t}return!1};B.regexp_eatClassSetOperand=function(e){if(this.regexp_eatClassSetCharacter(e))return gt;return this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};B.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93)){if(n&&r===Ze)e.raise("Negated character class may contain strings");return r}e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null};B.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise("Invalid escape");e.pos=t}return null};B.regexp_classStringDisjunctionContents=function(e){var t=this.regexp_classString(e);while(e.eat(124))if(this.regexp_classString(e)===Ze)t=Ze;return t};B.regexp_classString=function(e){var t=0;while(this.regexp_eatClassSetCharacter(e))t++;return t===1?gt:Ze};B.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e))return!0;if(e.eat(98))return e.lastIntValue=8,!0;return e.pos=t,!1}var n=e.current();if(n<0||n===e.lookahead()&&gd(n))return!1;if(xd(n))return!1;return e.advance(),e.lastIntValue=n,!0};function gd(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function xd(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}B.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();if(bd(t))return e.lastIntValue=t,e.advance(),!0;return!1};function bd(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}B.regexp_eatClassControlLetter=function(e){var t=e.current();if(cr(t)||t===95)return e.lastIntValue=t%32,e.advance(),!0;return!1};B.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;if(e.switchU)e.raise("Invalid escape");e.pos=t}return!1};B.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;e.lastIntValue=0;while(cr(n=e.current()))e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function cr(e){return e>=48&&e<=57}B.regexp_eatHexDigits=function(e){var t=e.pos,n=0;e.lastIntValue=0;while(Po(n=e.current()))e.lastIntValue=16*e.lastIntValue+Ao(n),e.advance();return e.pos!==t};function Po(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ao(e){if(e>=65&&e<=70)return 10+(e-65);if(e>=97&&e<=102)return 10+(e-97);return e-48}B.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;if(t<=3&&this.regexp_eatOctalDigit(e))e.lastIntValue=t*64+n*8+e.lastIntValue;else e.lastIntValue=t*8+n}else e.lastIntValue=t;return!0}return!1};B.regexp_eatOctalDigit=function(e){var t=e.current();if(ko(t))return e.lastIntValue=t-48,e.advance(),!0;return e.lastIntValue=0,!1};function ko(e){return e>=48&&e<=55}B.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!Po(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+Ao(i),e.advance()}return!0};var pr=function(t){if(this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations)this.loc=new Pn(t,t.startLoc,t.endLoc);if(t.options.ranges)this.range=[t.start,t.end]},te=me.prototype;te.next=function(e){if(!e&&this.type.keyword&&this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword);if(this.options.onToken)this.options.onToken(new pr(this));this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};te.getToken=function(){return this.next(),new pr(this)};if(typeof Symbol<"u")te[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===h.eof,value:t}}}};te.nextToken=function(){var e=this.curContext();if(!e||!e.preserveSpace)this.skipSpace();if(this.start=this.pos,this.options.locations)this.startLoc=this.curPosition();if(this.pos>=this.input.length)return this.finishToken(h.eof);if(e.override)return e.override(this);else this.readToken(this.fullCharCodeAtPos())};te.readToken=function(e){if(Le(e,this.options.ecmaVersion>=6)||e===92)return this.readWord();return this.getTokenFromCode(e)};te.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var n=this.input.charCodeAt(e+1);return n<=56319||n>=57344?t:(t<<10)+n-56613888};te.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};te.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(n===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=Ya(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;if(this.options.onComment)this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())};te.skipLineComment=function(e){var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);while(this.pos<this.input.length&&!Mt(r))r=this.input.charCodeAt(++this.pos);if(this.options.onComment)this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())};te.skipSpace=function(){e:while(this.pos<this.input.length){var e=this.input.charCodeAt(this.pos);switch(e){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 e}break;default:if(e>8&&e<14||e>=5760&&bi.test(String.fromCharCode(e)))++this.pos;else break e}}};te.finishToken=function(e,t){if(this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();var n=this.type;this.type=e,this.value=t,this.updateContext(n)};te.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&e===46&&t===46)return this.pos+=3,this.finishToken(h.ellipsis);else return++this.pos,this.finishToken(h.dot)};te.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);if(this.exprAllowed)return++this.pos,this.readRegexp();if(e===61)return this.finishOp(h.assign,2);return this.finishOp(h.slash,1)};te.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?h.star:h.modulo;if(this.options.ecmaVersion>=7&&e===42&&t===42)++n,r=h.starstar,t=this.input.charCodeAt(this.pos+2);if(t===61)return this.finishOp(h.assign,n+1);return this.finishOp(r,n)};te.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var n=this.input.charCodeAt(this.pos+2);if(n===61)return this.finishOp(h.assign,3)}return this.finishOp(e===124?h.logicalOR:h.logicalAND,2)}if(t===61)return this.finishOp(h.assign,2);return this.finishOp(e===124?h.bitwiseOR:h.bitwiseAND,1)};te.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);if(e===61)return this.finishOp(h.assign,2);return this.finishOp(h.bitwiseXOR,1)};te.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||Re.test(this.input.slice(this.lastTokEnd,this.pos))))return this.skipLineComment(3),this.skipSpace(),this.nextToken();return this.finishOp(h.incDec,2)}if(t===61)return this.finishOp(h.assign,2);return this.finishOp(h.plusMin,1)};te.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;if(t===e){if(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61)return this.finishOp(h.assign,n+1);return this.finishOp(h.bitShift,n)}if(t===33&&e===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(t===61)n=2;return this.finishOp(h.relational,n)};te.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===61)return this.finishOp(h.equality,this.input.charCodeAt(this.pos+2)===61?3:2);if(e===61&&t===62&&this.options.ecmaVersion>=6)return this.pos+=2,this.finishToken(h.arrow);return this.finishOp(e===61?h.eq:h.prefix,1)};te.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(h.questionDot,2)}if(t===63){if(e>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(h.assign,3)}return this.finishOp(h.coalesce,2)}}return this.finishOp(h.question,1)};te.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13){if(++this.pos,t=this.fullCharCodeAtPos(),Le(t,!0)||t===92)return this.finishToken(h.privateId,this.readWord1())}this.raise(this.pos,"Unexpected character '"+yt(t)+"'")};te.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(h.parenL);case 41:return++this.pos,this.finishToken(h.parenR);case 59:return++this.pos,this.finishToken(h.semi);case 44:return++this.pos,this.finishToken(h.comma);case 91:return++this.pos,this.finishToken(h.bracketL);case 93:return++this.pos,this.finishToken(h.bracketR);case 123:return++this.pos,this.finishToken(h.braceL);case 125:return++this.pos,this.finishToken(h.braceR);case 58:return++this.pos,this.finishToken(h.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(h.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(h.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+yt(e)+"'")};te.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)};te.readRegexp=function(){var e,t,n=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(n,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(Re.test(r))this.raise(n,"Unterminated regular expression");if(!e){if(r==="[")t=!0;else if(r==="]"&&t)t=!1;else if(r==="/"&&!t)break;e=r==="\\"}else e=!1;++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var o=this.pos,s=this.readWord1();if(this.containsEsc)this.unexpected(o);var c=this.regexpState||(this.regexpState=new ut(this));c.reset(n,i,s),this.validateRegExpFlags(c),this.validateRegExpPattern(c);var l=null;try{l=new RegExp(i,s)}catch(d){}return this.finishToken(h.regexp,{pattern:i,flags:s,value:l})};te.readInt=function(e,t,n){var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,o=this.pos,s=0,c=0;for(var l=0,d=t==null?1/0:t;l<d;++l,++this.pos){var u=this.input.charCodeAt(this.pos),y=void 0;if(r&&u===95){if(i)this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals");if(c===95)this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore");if(l===0)this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits");c=u;continue}if(u>=97)y=u-97+10;else if(u>=65)y=u-65+10;else if(u>=48&&u<=57)y=u-48;else y=1/0;if(y>=e)break;c=u,s=s*e+y}if(r&&c===95)this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits");if(this.pos===o||t!=null&&this.pos-o!==t)return null;return s};function Td(e,t){if(t)return parseInt(e,8);return parseFloat(e.replace(/_/g,""))}function wo(e){if(typeof BigInt!=="function")return null;return BigInt(e.replace(/_/g,""))}te.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);if(n==null)this.raise(this.start+2,"Expected number in radix "+e);if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110)n=wo(this.input.slice(t,this.pos)),++this.pos;else if(Le(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(h.num,n)};te.readNumber=function(e){var t=this.pos;if(!e&&this.readInt(10,void 0,!0)===null)this.raise(t,"Invalid number");var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;if(n&&this.strict)this.raise(t,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=wo(this.input.slice(t,this.pos));if(++this.pos,Le(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(h.num,i)}if(n&&/[89]/.test(this.input.slice(t,this.pos)))n=!1;if(r===46&&!n)++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos);if((r===69||r===101)&&!n){if(r=this.input.charCodeAt(++this.pos),r===43||r===45)++this.pos;if(this.readInt(10)===null)this.raise(t,"Invalid number")}if(Le(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");var o=Td(this.input.slice(t,this.pos),n);return this.finishToken(h.num,o)};te.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){if(this.options.ecmaVersion<6)this.unexpected();var n=++this.pos;if(t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111)this.invalidStringToken(n,"Code point out of bounds")}else t=this.readHexChar(4);return t};te.readString=function(e){var t="",n=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;if(r===92)t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos;else if(r===8232||r===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(Mt(r))this.raise(this.start,"Unterminated string constant");++this.pos}}return t+=this.input.slice(n,this.pos++),this.finishToken(h.string,t)};var No={};te.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===No)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};te.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw No;else this.raise(e,t)};te.readTmplToken=function(){var e="",t=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated template");var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&(this.type===h.template||this.type===h.invalidTemplate))if(n===36)return this.pos+=2,this.finishToken(h.dollarBraceL);else return++this.pos,this.finishToken(h.backQuote);return e+=this.input.slice(t,this.pos),this.finishToken(h.template,e)}if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Mt(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:e+=`
33
- `;break;default:e+=String.fromCharCode(n);break}if(this.options.locations)++this.curLine,this.lineStart=this.pos;t=this.pos}else++this.pos}};te.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(h.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":if(this.input[this.pos+1]===`
29
+ `),cooked:this.value};return this.next(),n.tail=this.type===h.backQuote,this.finishNode(n,"TemplateElement")};M.parseTemplate=function(e){if(e===void 0)e={};var t=e.isTagged;if(t===void 0)t=!1;var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});n.quasis=[r];while(!r.tail){if(this.type===h.eof)this.raise(this.pos,"Unterminated template literal");this.expect(h.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(h.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}))}return this.next(),this.finishNode(n,"TemplateLiteral")};M.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===h.name||this.type===h.num||this.type===h.string||this.type===h.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===h.star)&&!ce.test(this.input.slice(this.lastTokEnd,this.start))};M.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};n.properties=[],this.next();while(!this.eat(h.braceR)){if(!r){if(this.expect(h.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(h.braceR))break}else r=!1;var a=this.parseProperty(e,t);if(!e)this.checkPropClash(a,i,t);n.properties.push(a)}return this.finishNode(n,e?"ObjectPattern":"ObjectExpression")};M.parseProperty=function(e,t){var n=this.startNode(),r,i,a,s;if(this.options.ecmaVersion>=9&&this.eat(h.ellipsis)){if(e){if(n.argument=this.parseIdent(!1),this.type===h.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");return this.finishNode(n,"RestElement")}if(n.argument=this.parseMaybeAssign(!1,t),this.type===h.comma&&t&&t.trailingComma<0)t.trailingComma=this.start;return this.finishNode(n,"SpreadElement")}if(this.options.ecmaVersion>=6){if(n.method=!1,n.shorthand=!1,e||t)a=this.start,s=this.startLoc;if(!e)r=this.eat(h.star)}var p=this.containsEsc;if(this.parsePropertyName(n),!e&&!p&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n))i=!0,r=this.options.ecmaVersion>=9&&this.eat(h.star),this.parsePropertyName(n);else i=!1;return this.parsePropertyValue(n,e,r,i,a,s,t,p),this.finishNode(n,"Property")};M.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var n=e.kind==="get"?0:1;if(e.value.params.length!==n){var r=e.value.start;if(e.kind==="get")this.raiseRecoverable(r,"getter should have no params");else this.raiseRecoverable(r,"setter should have exactly one param")}else if(e.kind==="set"&&e.value.params[0].type==="RestElement")this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};M.parsePropertyValue=function(e,t,n,r,i,a,s,p){if((n||r)&&this.type===h.colon)this.unexpected();if(this.eat(h.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,s),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===h.parenL){if(t)this.unexpected();e.method=!0,e.value=this.parseMethod(n,r),e.kind="init"}else if(!t&&!p&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&(this.type!==h.comma&&this.type!==h.braceR&&this.type!==h.eq)){if(n||r)this.unexpected();this.parseGetterSetter(e)}else if(this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"){if(n||r)this.unexpected();if(this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=i;if(t)e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key));else if(this.type===h.eq&&s){if(s.shorthandAssign<0)s.shorthandAssign=this.start;e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))}else e.value=this.copyNode(e.key);e.kind="init",e.shorthand=!0}else this.unexpected()};M.parsePropertyName=function(e){if(this.options.ecmaVersion>=6)if(this.eat(h.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(h.bracketR),e.key;else e.computed=!1;return e.key=this.type===h.num||this.type===h.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};M.initFunction=function(e){if(e.id=null,this.options.ecmaVersion>=6)e.generator=e.expression=!1;if(this.options.ecmaVersion>=8)e.async=!1};M.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,a=this.awaitPos,s=this.awaitIdentPos;if(this.initFunction(r),this.options.ecmaVersion>=6)r.generator=e;if(this.options.ecmaVersion>=8)r.async=!!t;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ci(t,r.generator)|qn|(n?Ya:0)),this.expect(h.parenL),r.params=this.parseBindingList(h.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=s,this.finishNode(r,"FunctionExpression")};M.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,a=this.awaitPos,s=this.awaitIdentPos;if(this.enterScope(ci(n,!1)|pi),this.initFunction(e),this.options.ecmaVersion>=8)e.async=!!n;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")};M.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==h.braceL,a=this.strict,s=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var p=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);if(!a||p){if(s=this.strictDirective(this.end),s&&p)this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list")}var c=this.labels;if(this.labels=[],s)this.strict=!0;if(this.checkParams(e,!a&&!s&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id)this.checkLValSimple(e.id,to);e.body=this.parseBlock(!1,void 0,s&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()};M.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1){var r=n[t];if(r.type!=="Identifier")return!1}return!0};M.checkParams=function(e,t){var n=Object.create(null);for(var r=0,i=e.params;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,li,t?null:n)}};M.parseExprList=function(e,t,n,r){var i=[],a=!0;while(!this.eat(e)){if(!a){if(this.expect(h.comma),t&&this.afterTrailingComma(e))break}else a=!1;var s=void 0;if(n&&this.type===h.comma)s=null;else if(this.type===h.ellipsis){if(s=this.parseSpread(r),r&&this.type===h.comma&&r.trailingComma<0)r.trailingComma=this.start}else s=this.parseMaybeAssign(!1,r);i.push(s)}return i};M.checkUnreserved=function(e){var{start:t,end:n,name:r}=e;if(this.inGenerator&&r==="yield")this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator");if(this.inAsync&&r==="await")this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function");if(!(this.currentThisScope().flags&Un)&&r==="arguments")this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer");if(this.inClassStaticBlock&&(r==="arguments"||r==="await"))this.raise(t,"Cannot use "+r+" in class static initialization block");if(this.keywords.test(r))this.raise(t,"Unexpected keyword '"+r+"'");if(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf("\\")!==-1)return;var i=this.strict?this.reservedWordsStrict:this.reservedWords;if(i.test(r)){if(!this.inAsync&&r==="await")this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function");this.raiseRecoverable(t,"The keyword '"+r+"' is reserved")}};M.parseIdent=function(e){var t=this.parseIdentNode();if(this.next(!!e),this.finishNode(t,"Identifier"),!e){if(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=t.start}return t};M.parseIdentNode=function(){var e=this.startNode();if(this.type===h.name)e.name=this.value;else if(this.type.keyword){if(e.name=this.type.keyword,(e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.context.pop();this.type=h.name}else this.unexpected();return e};M.parsePrivateIdent=function(){var e=this.startNode();if(this.type===h.privateId)e.name=this.value;else this.unexpected();if(this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields)if(this.privateNameStack.length===0)this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class");else this.privateNameStack[this.privateNameStack.length-1].used.push(e);return e};M.parseYield=function(e){if(!this.yieldPos)this.yieldPos=this.start;var t=this.startNode();if(this.next(),this.type===h.semi||this.canInsertSemicolon()||this.type!==h.star&&!this.type.startsExpr)t.delegate=!1,t.argument=null;else t.delegate=this.eat(h.star),t.argument=this.parseMaybeAssign(e);return this.finishNode(t,"YieldExpression")};M.parseAwait=function(e){if(!this.awaitPos)this.awaitPos=this.start;var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var Vn=X.prototype;Vn.raise=function(e,t){var n=ai(this.input,e);if(t+=" ("+n.line+":"+n.column+")",this.sourceFile)t+=" in "+this.sourceFile;var r=SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r};Vn.raiseRecoverable=Vn.raise;Vn.curPosition=function(){if(this.options.locations)return new Pt(this.curLine,this.pos-this.lineStart)};var rt=X.prototype,fd=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[]};rt.enterScope=function(e){this.scopeStack.push(new fd(e))};rt.exitScope=function(){this.scopeStack.pop()};rt.treatFunctionsAsVarInScope=function(e){return e.flags&dt||!this.inModule&&e.flags&lt};rt.declareName=function(e,t,n){var r=!1;if(t===Ke){var i=this.currentScope();if(r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&lt)delete this.undefinedExports[e]}else if(t===eo){var a=this.currentScope();a.lexical.push(e)}else if(t===Za){var s=this.currentScope();if(this.treatFunctionsAsVar)r=s.lexical.indexOf(e)>-1;else r=s.lexical.indexOf(e)>-1||s.var.indexOf(e)>-1;s.functions.push(e)}else for(var p=this.scopeStack.length-1;p>=0;--p){var c=this.scopeStack[p];if(c.lexical.indexOf(e)>-1&&!(c.flags&Xa&&c.lexical[0]===e)||!this.treatFunctionsAsVarInScope(c)&&c.functions.indexOf(e)>-1){r=!0;break}if(c.var.push(e),this.inModule&&c.flags&lt)delete this.undefinedExports[e];if(c.flags&Un)break}if(r)this.raiseRecoverable(n,"Identifier '"+e+"' has already been declared")};rt.checkLocalExport=function(e){if(this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1)this.undefinedExports[e.name]=e};rt.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};rt.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(Un|en|ft))return t}};rt.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(Un|en|ft)&&!(t.flags&pi))return t}};var tn=function(t,n,r){if(this.type="",this.start=n,this.end=0,t.options.locations)this.loc=new Zt(t,r);if(t.options.directSourceFile)this.sourceFile=t.options.directSourceFile;if(t.options.ranges)this.range=[n,0]},nn=X.prototype;nn.startNode=function(){return new tn(this,this.start,this.startLoc)};nn.startNodeAt=function(e,t){return new tn(this,e,t)};function io(e,t,n,r){if(e.type=t,e.end=n,this.options.locations)e.loc.end=r;if(this.options.ranges)e.range[1]=n;return e}nn.finishNode=function(e,t){return io.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};nn.finishNodeAt=function(e,t,n,r){return io.call(this,e,t,n,r)};nn.copyNode=function(e){var t=new tn(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var hd="Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz",so="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",ao=so+" Extended_Pictographic",oo=ao,po=oo+" EBase EComp EMod EPres ExtPict",co=po,md=co,yd={9:so,10:ao,11:oo,12:po,13:co,14:md},gd="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",xd={9:"",10:"",11:"",12:"",13:"",14:gd},Ha="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",lo="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",uo=lo+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",fo=uo+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",ho=fo+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",mo=ho+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",bd=mo+" "+hd,Td={9:lo,10:uo,11:fo,12:ho,13:mo,14:bd},yo={};function vd(e){var t=yo[e]={binary:nt(yd[e]+" "+Ha),binaryOfStrings:nt(xd[e]),nonBinary:{General_Category:nt(Ha),Script:nt(Td[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(Yt=0,On=[9,10,11,12,13,14];Yt<On.length;Yt+=1)ii=On[Yt],vd(ii);var ii,Yt,On,N=X.prototype,jn=function(t,n){this.parent=t,this.base=n||this};jn.prototype.separatedFrom=function(t){for(var n=this;n;n=n.parent)for(var r=t;r;r=r.parent)if(n.base===r.base&&n!==r)return!0;return!1};jn.prototype.sibling=function(){return new jn(this.parent,this.base)};var Be=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":"")+(t.options.ecmaVersion>=15?"v":""),this.unicodeProperties=yo[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};Be.prototype.reset=function(t,n,r){var i=r.indexOf("v")!==-1,a=r.indexOf("u")!==-1;if(this.start=t|0,this.source=n+"",this.flags=r,i&&this.parser.options.ecmaVersion>=15)this.switchU=!0,this.switchV=!0,this.switchN=!0;else this.switchU=a&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=a&&this.parser.options.ecmaVersion>=9};Be.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)};Be.prototype.at=function(t,n){if(n===void 0)n=!1;var r=this.source,i=r.length;if(t>=i)return-1;var a=r.charCodeAt(t);if(!(n||this.switchU)||a<=55295||a>=57344||t+1>=i)return a;var s=r.charCodeAt(t+1);return s>=56320&&s<=57343?(a<<10)+s-56613888:a};Be.prototype.nextIndex=function(t,n){if(n===void 0)n=!1;var r=this.source,i=r.length;if(t>=i)return i;var a=r.charCodeAt(t),s;if(!(n||this.switchU)||a<=55295||a>=57344||t+1>=i||(s=r.charCodeAt(t+1))<56320||s>57343)return t+1;return t+2};Be.prototype.current=function(t){if(t===void 0)t=!1;return this.at(this.pos,t)};Be.prototype.lookahead=function(t){if(t===void 0)t=!1;return this.at(this.nextIndex(this.pos,t),t)};Be.prototype.advance=function(t){if(t===void 0)t=!1;this.pos=this.nextIndex(this.pos,t)};Be.prototype.eat=function(t,n){if(n===void 0)n=!1;if(this.current(n)===t)return this.advance(n),!0;return!1};Be.prototype.eatChars=function(t,n){if(n===void 0)n=!1;var r=this.pos;for(var i=0,a=t;i<a.length;i+=1){var s=a[i],p=this.at(r,n);if(p===-1||p!==s)return!1;r=this.nextIndex(r,n)}return this.pos=r,!0};N.validateRegExpFlags=function(e){var{validFlags:t,flags:n}=e,r=!1,i=!1;for(var a=0;a<n.length;a++){var s=n.charAt(a);if(t.indexOf(s)===-1)this.raise(e.start,"Invalid regular expression flag");if(n.indexOf(s,a+1)>-1)this.raise(e.start,"Duplicate regular expression flag");if(s==="u")r=!0;if(s==="v")i=!0}if(this.options.ecmaVersion>=15&&r&&i)this.raise(e.start,"Invalid regular expression flag")};function Sd(e){for(var t in e)return!0;return!1}N.validateRegExpPattern=function(e){if(this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&Sd(e.groupNames))e.switchN=!0,this.regexp_pattern(e)};N.regexp_pattern=function(e){if(e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length){if(e.eat(41))e.raise("Unmatched ')'");if(e.eat(93)||e.eat(125))e.raise("Lone quantifier brackets")}if(e.maxBackReference>e.numCapturingParens)e.raise("Invalid escape");for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];if(!e.groupNames[r])e.raise("Invalid named capture referenced")}};N.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;if(t)e.branchID=new jn(e.branchID,null);this.regexp_alternative(e);while(e.eat(124)){if(t)e.branchID=e.branchID.sibling();this.regexp_alternative(e)}if(t)e.branchID=e.branchID.parent;if(this.regexp_eatQuantifier(e,!0))e.raise("Nothing to repeat");if(e.eat(123))e.raise("Lone quantifier brackets")};N.regexp_alternative=function(e){while(e.pos<e.source.length&&this.regexp_eatTerm(e));};N.regexp_eatTerm=function(e){if(this.regexp_eatAssertion(e)){if(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)){if(e.switchU)e.raise("Invalid quantifier")}return!0}if(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))return this.regexp_eatQuantifier(e),!0;return!1};N.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9)n=e.eat(60);if(e.eat(61)||e.eat(33)){if(this.regexp_disjunction(e),!e.eat(41))e.raise("Unterminated group");return e.lastAssertionIsQuantifiable=!n,!0}}return e.pos=t,!1};N.regexp_eatQuantifier=function(e,t){if(t===void 0)t=!1;if(this.regexp_eatQuantifierPrefix(e,t))return e.eat(63),!0;return!1};N.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};N.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)){if(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e))i=e.lastIntValue;if(e.eat(125)){if(i!==-1&&i<r&&!t)e.raise("numbers out of order in {} quantifier");return!0}}if(e.switchU&&!t)e.raise("Incomplete quantifier");e.pos=n}return!1};N.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)};N.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1};N.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var n=this.regexp_eatModifiers(e),r=e.eat(45);if(n||r){for(var i=0;i<n.length;i++){var a=n.charAt(i);if(n.indexOf(a,i+1)>-1)e.raise("Duplicate regular expression modifiers")}if(r){var s=this.regexp_eatModifiers(e);if(!n&&!s&&e.current()===58)e.raise("Invalid regular expression modifiers");for(var p=0;p<s.length;p++){var c=s.charAt(p);if(s.indexOf(c,p+1)>-1||n.indexOf(c)>-1)e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1};N.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9)this.regexp_groupSpecifier(e);else if(e.current()===63)e.raise("Invalid group");if(this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};N.regexp_eatModifiers=function(e){var t="",n=0;while((n=e.current())!==-1&&Ed(n))t+=We(n),e.advance();return t};function Ed(e){return e===105||e===109||e===115}N.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};N.regexp_eatInvalidBracedQuantifier=function(e){if(this.regexp_eatBracedQuantifier(e,!0))e.raise("Nothing to repeat");return!1};N.regexp_eatSyntaxCharacter=function(e){var t=e.current();if(go(t))return e.lastIntValue=t,e.advance(),!0;return!1};function go(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}N.regexp_eatPatternCharacters=function(e){var t=e.pos,n=0;while((n=e.current())!==-1&&!go(n))e.advance();return e.pos!==t};N.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();if(t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124)return e.advance(),!0;return!1};N.regexp_groupSpecifier=function(e){if(e.eat(63)){if(!this.regexp_eatGroupName(e))e.raise("Invalid group");var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n)if(t)for(var r=0,i=n;r<i.length;r+=1){var a=i[r];if(!a.separatedFrom(e.branchID))e.raise("Duplicate capture group name")}else e.raise("Duplicate capture group name");if(t)(n||(e.groupNames[e.lastStringValue]=[])).push(e.branchID);else e.groupNames[e.lastStringValue]=!0}};N.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};N.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){e.lastStringValue+=We(e.lastIntValue);while(this.regexp_eatRegExpIdentifierPart(e))e.lastStringValue+=We(e.lastIntValue);return!0}return!1};N.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);if(e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n))r=e.lastIntValue;if(Cd(r))return e.lastIntValue=r,!0;return e.pos=t,!1};function Cd(e){return pe(e,!0)||e===36||e===95}N.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);if(e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n))r=e.lastIntValue;if(Pd(r))return e.lastIntValue=r,!0;return e.pos=t,!1};function Pd(e){return de(e,!0)||e===36||e===95||e===8204||e===8205}N.regexp_eatAtomEscape=function(e){if(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))return!0;if(e.switchU){if(e.current()===99)e.raise("Invalid unicode escape");e.raise("Invalid escape")}return!1};N.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU){if(n>e.maxBackReference)e.maxBackReference=n;return!0}if(n<=e.numCapturingParens)return!0;e.pos=t}return!1};N.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};N.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};N.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1};N.regexp_eatZero=function(e){if(e.current()===48&&!Wn(e.lookahead()))return e.lastIntValue=0,e.advance(),!0;return!1};N.regexp_eatControlEscape=function(e){var t=e.current();if(t===116)return e.lastIntValue=9,e.advance(),!0;if(t===110)return e.lastIntValue=10,e.advance(),!0;if(t===118)return e.lastIntValue=11,e.advance(),!0;if(t===102)return e.lastIntValue=12,e.advance(),!0;if(t===114)return e.lastIntValue=13,e.advance(),!0;return!1};N.regexp_eatControlLetter=function(e){var t=e.current();if(xo(t))return e.lastIntValue=t%32,e.advance(),!0;return!1};function xo(e){return e>=65&&e<=90||e>=97&&e<=122}N.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){if(t===void 0)t=!1;var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(s>=56320&&s<=57343)return e.lastIntValue=(i-55296)*1024+(s-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Ad(e.lastIntValue))return!0;if(r)e.raise("Invalid unicode escape");e.pos=n}return!1};function Ad(e){return e>=0&&e<=1114111}N.regexp_eatIdentityEscape=function(e){if(e.switchU){if(this.regexp_eatSyntaxCharacter(e))return!0;if(e.eat(47))return e.lastIntValue=47,!0;return!1}var t=e.current();if(t!==99&&(!e.switchN||t!==107))return e.lastIntValue=t,e.advance(),!0;return!1};N.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var bo=0,ze=1,Pe=2;N.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(kd(t))return e.lastIntValue=-1,e.advance(),ze;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125)){if(n&&r===Pe)e.raise("Invalid property name");return r}e.raise("Invalid property name")}return bo};function kd(e){return e===100||e===68||e===115||e===83||e===119||e===87}N.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),ze}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return bo};N.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){if(!At(e.unicodeProperties.nonBinary,t))e.raise("Invalid property name");if(!e.unicodeProperties.nonBinary[t].test(n))e.raise("Invalid property value")};N.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return ze;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return Pe;e.raise("Invalid property name")};N.regexp_eatUnicodePropertyName=function(e){var t=0;e.lastStringValue="";while(To(t=e.current()))e.lastStringValue+=We(t),e.advance();return e.lastStringValue!==""};function To(e){return xo(e)||e===95}N.regexp_eatUnicodePropertyValue=function(e){var t=0;e.lastStringValue="";while(wd(t=e.current()))e.lastStringValue+=We(t),e.advance();return e.lastStringValue!==""};function wd(e){return To(e)||Wn(e)}N.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};N.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);if(!e.eat(93))e.raise("Unterminated character class");if(t&&n===Pe)e.raise("Negated character class may contain strings");return!0}return!1};N.regexp_classContents=function(e){if(e.current()===93)return ze;if(e.switchV)return this.regexp_classSetExpression(e);return this.regexp_nonEmptyClassRanges(e),ze};N.regexp_nonEmptyClassRanges=function(e){while(this.regexp_eatClassAtom(e)){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;if(e.switchU&&(t===-1||n===-1))e.raise("Invalid character class");if(t!==-1&&n!==-1&&t>n)e.raise("Range out of order in character class")}}};N.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();if(n===99||Eo(n))e.raise("Invalid class escape");e.raise("Invalid escape")}e.pos=t}var r=e.current();if(r!==93)return e.lastIntValue=r,e.advance(),!0;return!1};N.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};N.regexp_classSetExpression=function(e){var t=ze,n;if(this.regexp_eatClassSetRange(e));else if(n=this.regexp_eatClassSetOperand(e)){if(n===Pe)t=Pe;var r=e.pos;while(e.eatChars([38,38])){if(e.current()!==38&&(n=this.regexp_eatClassSetOperand(e))){if(n!==Pe)t=ze;continue}e.raise("Invalid character in character class")}if(r!==e.pos)return t;while(e.eatChars([45,45])){if(this.regexp_eatClassSetOperand(e))continue;e.raise("Invalid character in character class")}if(r!==e.pos)return t}else e.raise("Invalid character in character class");for(;;){if(this.regexp_eatClassSetRange(e))continue;if(n=this.regexp_eatClassSetOperand(e),!n)return t;if(n===Pe)t=Pe}};N.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;if(n!==-1&&r!==-1&&n>r)e.raise("Range out of order in character class");return!0}e.pos=t}return!1};N.regexp_eatClassSetOperand=function(e){if(this.regexp_eatClassSetCharacter(e))return ze;return this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};N.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93)){if(n&&r===Pe)e.raise("Negated character class may contain strings");return r}e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null};N.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise("Invalid escape");e.pos=t}return null};N.regexp_classStringDisjunctionContents=function(e){var t=this.regexp_classString(e);while(e.eat(124))if(this.regexp_classString(e)===Pe)t=Pe;return t};N.regexp_classString=function(e){var t=0;while(this.regexp_eatClassSetCharacter(e))t++;return t===1?ze:Pe};N.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e))return!0;if(e.eat(98))return e.lastIntValue=8,!0;return e.pos=t,!1}var n=e.current();if(n<0||n===e.lookahead()&&Nd(n))return!1;if(Dd(n))return!1;return e.advance(),e.lastIntValue=n,!0};function Nd(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function Dd(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}N.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();if(Id(t))return e.lastIntValue=t,e.advance(),!0;return!1};function Id(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}N.regexp_eatClassControlLetter=function(e){var t=e.current();if(Wn(t)||t===95)return e.lastIntValue=t%32,e.advance(),!0;return!1};N.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;if(e.switchU)e.raise("Invalid escape");e.pos=t}return!1};N.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;e.lastIntValue=0;while(Wn(n=e.current()))e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function Wn(e){return e>=48&&e<=57}N.regexp_eatHexDigits=function(e){var t=e.pos,n=0;e.lastIntValue=0;while(vo(n=e.current()))e.lastIntValue=16*e.lastIntValue+So(n),e.advance();return e.pos!==t};function vo(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function So(e){if(e>=65&&e<=70)return 10+(e-65);if(e>=97&&e<=102)return 10+(e-97);return e-48}N.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;if(t<=3&&this.regexp_eatOctalDigit(e))e.lastIntValue=t*64+n*8+e.lastIntValue;else e.lastIntValue=t*8+n}else e.lastIntValue=t;return!0}return!1};N.regexp_eatOctalDigit=function(e){var t=e.current();if(Eo(t))return e.lastIntValue=t-48,e.advance(),!0;return e.lastIntValue=0,!1};function Eo(e){return e>=48&&e<=55}N.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!vo(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+So(i),e.advance()}return!0};var zn=function(t){if(this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations)this.loc=new Zt(t,t.startLoc,t.endLoc);if(t.options.ranges)this.range=[t.start,t.end]},F=X.prototype;F.next=function(e){if(!e&&this.type.keyword&&this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword);if(this.options.onToken)this.options.onToken(new zn(this));this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};F.getToken=function(){return this.next(),new zn(this)};if(typeof Symbol<"u")F[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===h.eof,value:t}}}};F.nextToken=function(){var e=this.curContext();if(!e||!e.preserveSpace)this.skipSpace();if(this.start=this.pos,this.options.locations)this.startLoc=this.curPosition();if(this.pos>=this.input.length)return this.finishToken(h.eof);if(e.override)return e.override(this);else this.readToken(this.fullCharCodeAtPos())};F.readToken=function(e){if(pe(e,this.options.ecmaVersion>=6)||e===92)return this.readWord();return this.getTokenFromCode(e)};F.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var n=this.input.charCodeAt(e+1);return n<=56319||n>=57344?t:(t<<10)+n-56613888};F.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};F.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(n===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=za(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;if(this.options.onComment)this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())};F.skipLineComment=function(e){var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);while(this.pos<this.input.length&&!ut(r))r=this.input.charCodeAt(++this.pos);if(this.options.onComment)this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())};F.skipSpace=function(){e:while(this.pos<this.input.length){var e=this.input.charCodeAt(this.pos);switch(e){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 e}break;default:if(e>8&&e<14||e>=5760&&si.test(String.fromCharCode(e)))++this.pos;else break e}}};F.finishToken=function(e,t){if(this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();var n=this.type;this.type=e,this.value=t,this.updateContext(n)};F.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&e===46&&t===46)return this.pos+=3,this.finishToken(h.ellipsis);else return++this.pos,this.finishToken(h.dot)};F.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);if(this.exprAllowed)return++this.pos,this.readRegexp();if(e===61)return this.finishOp(h.assign,2);return this.finishOp(h.slash,1)};F.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?h.star:h.modulo;if(this.options.ecmaVersion>=7&&e===42&&t===42)++n,r=h.starstar,t=this.input.charCodeAt(this.pos+2);if(t===61)return this.finishOp(h.assign,n+1);return this.finishOp(r,n)};F.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var n=this.input.charCodeAt(this.pos+2);if(n===61)return this.finishOp(h.assign,3)}return this.finishOp(e===124?h.logicalOR:h.logicalAND,2)}if(t===61)return this.finishOp(h.assign,2);return this.finishOp(e===124?h.bitwiseOR:h.bitwiseAND,1)};F.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);if(e===61)return this.finishOp(h.assign,2);return this.finishOp(h.bitwiseXOR,1)};F.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||ce.test(this.input.slice(this.lastTokEnd,this.pos))))return this.skipLineComment(3),this.skipSpace(),this.nextToken();return this.finishOp(h.incDec,2)}if(t===61)return this.finishOp(h.assign,2);return this.finishOp(h.plusMin,1)};F.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;if(t===e){if(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61)return this.finishOp(h.assign,n+1);return this.finishOp(h.bitShift,n)}if(t===33&&e===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(t===61)n=2;return this.finishOp(h.relational,n)};F.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===61)return this.finishOp(h.equality,this.input.charCodeAt(this.pos+2)===61?3:2);if(e===61&&t===62&&this.options.ecmaVersion>=6)return this.pos+=2,this.finishToken(h.arrow);return this.finishOp(e===61?h.eq:h.prefix,1)};F.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(h.questionDot,2)}if(t===63){if(e>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(h.assign,3)}return this.finishOp(h.coalesce,2)}}return this.finishOp(h.question,1)};F.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13){if(++this.pos,t=this.fullCharCodeAtPos(),pe(t,!0)||t===92)return this.finishToken(h.privateId,this.readWord1())}this.raise(this.pos,"Unexpected character '"+We(t)+"'")};F.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(h.parenL);case 41:return++this.pos,this.finishToken(h.parenR);case 59:return++this.pos,this.finishToken(h.semi);case 44:return++this.pos,this.finishToken(h.comma);case 91:return++this.pos,this.finishToken(h.bracketL);case 93:return++this.pos,this.finishToken(h.bracketR);case 123:return++this.pos,this.finishToken(h.braceL);case 125:return++this.pos,this.finishToken(h.braceR);case 58:return++this.pos,this.finishToken(h.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(h.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(h.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+We(e)+"'")};F.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)};F.readRegexp=function(){var e,t,n=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(n,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(ce.test(r))this.raise(n,"Unterminated regular expression");if(!e){if(r==="[")t=!0;else if(r==="]"&&t)t=!1;else if(r==="/"&&!t)break;e=r==="\\"}else e=!1;++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var a=this.pos,s=this.readWord1();if(this.containsEsc)this.unexpected(a);var p=this.regexpState||(this.regexpState=new Be(this));p.reset(n,i,s),this.validateRegExpFlags(p),this.validateRegExpPattern(p);var c=null;try{c=new RegExp(i,s)}catch(d){}return this.finishToken(h.regexp,{pattern:i,flags:s,value:c})};F.readInt=function(e,t,n){var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,a=this.pos,s=0,p=0;for(var c=0,d=t==null?1/0:t;c<d;++c,++this.pos){var u=this.input.charCodeAt(this.pos),y=void 0;if(r&&u===95){if(i)this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals");if(p===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");p=u;continue}if(u>=97)y=u-97+10;else if(u>=65)y=u-65+10;else if(u>=48&&u<=57)y=u-48;else y=1/0;if(y>=e)break;p=u,s=s*e+y}if(r&&p===95)this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits");if(this.pos===a||t!=null&&this.pos-a!==t)return null;return s};function _d(e,t){if(t)return parseInt(e,8);return parseFloat(e.replace(/_/g,""))}function Co(e){if(typeof BigInt!=="function")return null;return BigInt(e.replace(/_/g,""))}F.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);if(n==null)this.raise(this.start+2,"Expected number in radix "+e);if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110)n=Co(this.input.slice(t,this.pos)),++this.pos;else if(pe(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(h.num,n)};F.readNumber=function(e){var t=this.pos;if(!e&&this.readInt(10,void 0,!0)===null)this.raise(t,"Invalid number");var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;if(n&&this.strict)this.raise(t,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=Co(this.input.slice(t,this.pos));if(++this.pos,pe(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(h.num,i)}if(n&&/[89]/.test(this.input.slice(t,this.pos)))n=!1;if(r===46&&!n)++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos);if((r===69||r===101)&&!n){if(r=this.input.charCodeAt(++this.pos),r===43||r===45)++this.pos;if(this.readInt(10)===null)this.raise(t,"Invalid number")}if(pe(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");var a=_d(this.input.slice(t,this.pos),n);return this.finishToken(h.num,a)};F.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){if(this.options.ecmaVersion<6)this.unexpected();var n=++this.pos;if(t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111)this.invalidStringToken(n,"Code point out of bounds")}else t=this.readHexChar(4);return t};F.readString=function(e){var t="",n=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;if(r===92)t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos;else if(r===8232||r===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(ut(r))this.raise(this.start,"Unterminated string constant");++this.pos}}return t+=this.input.slice(n,this.pos++),this.finishToken(h.string,t)};var Po={};F.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Po)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};F.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Po;else this.raise(e,t)};F.readTmplToken=function(){var e="",t=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated template");var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&(this.type===h.template||this.type===h.invalidTemplate))if(n===36)return this.pos+=2,this.finishToken(h.dollarBraceL);else return++this.pos,this.finishToken(h.backQuote);return e+=this.input.slice(t,this.pos),this.finishToken(h.template,e)}if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(ut(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:e+=`
30
+ `;break;default:e+=String.fromCharCode(n);break}if(this.options.locations)++this.curLine,this.lineStart=this.pos;t=this.pos}else++this.pos}};F.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(h.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":if(this.input[this.pos+1]===`
34
31
  `)++this.pos;case`
35
- `:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};te.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
36
- `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return yt(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(e){var n=this.pos-1;this.invalidStringToken(n,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);if(i>255)r=r.slice(0,-1),i=parseInt(r,8);if(this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!=="0"||t===56||t===57)&&(this.strict||e))this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode");return String.fromCharCode(i)}if(Mt(t)){if(this.options.locations)this.lineStart=this.pos,++this.curLine;return""}return String.fromCharCode(t)}};te.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);if(n===null)this.invalidStringToken(t,"Bad character escape sequence");return n};te.readWord1=function(){this.containsEsc=!1;var e="",t=!0,n=this.pos,r=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var i=this.fullCharCodeAtPos();if(Fe(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var o=this.pos;if(this.input.charCodeAt(++this.pos)!==117)this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX");++this.pos;var s=this.readCodePoint();if(!(t?Le:Fe)(s,r))this.invalidStringToken(o,"Invalid Unicode escape");e+=yt(s),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)};te.readWord=function(){var e=this.readWord1(),t=h.name;if(this.keywords.test(e))t=ir[e];return this.finishToken(t,e)};var Do="8.18.0";me.acorn={Parser:me,version:Do,defaultOptions:Zn,Position:Xt,SourceLocation:Pn,getLineInfo:Ti,Node:kn,TokenType:se,tokTypes:h,keywordTypes:ir,TokContext:Qe,tokContexts:he,isIdentifierChar:Fe,isIdentifierStart:Le,Token:pr,isNewLine:Mt,lineBreak:Re,lineBreakG:Xa,nonASCIIwhitespace:bi};function Ed(e,t){return me.parse(e,t)}function Cd(e,t,n){return me.parseExpressionAt(e,t,n)}function Sd(e,t){return me.tokenizer(e,t)}var Ge=!0,vd=new WeakMap;function Pd(e){let t=e.Parser.acorn||e,n=vd.get(t);if(!n){let c=function(M){return M===b.name||M===b.string||M===b.num||N.includes(M)||j.includes(M)},l=function(M){return M===b.name||N.includes(M)||j.includes(M)},d=function(M){return M===b.name||j.includes(M)},u=function(M){return M===D.abstract||M===D.declare||M===D.enum||M===D.module||M===D.namespace||M===D.interface||M===D.type},y=function(M){return M===D.keyof||M===D.readonly||M===D.unique},g=function(M){return M===b.invalidTemplate},{tokTypes:b,keywordTypes:P}=t,N=Object.values(P),D=s(),j=Object.values(D),U=o(),v=i(),w=new RegExp(`^(?:${Object.keys(D).join("|")})$`);U.jsxTagStart.updateContext=function(){this.context.push(v.tc_expr),this.context.push(v.tc_oTag),this.exprAllowed=!1},U.jsxTagEnd.updateContext=function(M){let G=this.context.pop();if(G===v.tc_oTag&&M===b.slash||G===v.tc_cTag)this.context.pop(),this.exprAllowed=this.curContext()===v.tc_expr;else this.exprAllowed=!0},n={tokTypes:{...D,...U},tokContexts:{...v},keywordsRegExp:w,tokenIsLiteralPropertyName:c,tokenIsKeywordOrIdentifier:l,tokenIsIdentifier:d,tokenIsTSDeclarationStart:u,tokenIsTSTypeOperator:y,tokenIsTemplate:g}}return n;function r(c,l={}){return new t.TokenType("name",l)}function i(){return{tc_oTag:new t.TokContext("<tag",!1,!1),tc_cTag:new t.TokContext("</tag",!1,!1),tc_expr:new t.TokContext("<tag>...</tag>",!0,!0)}}function o(){return{at:new t.TokenType("@"),jsxName:new t.TokenType("jsxName"),jsxText:new t.TokenType("jsxText",{beforeExpr:!0}),jsxTagStart:new t.TokenType("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new t.TokenType("jsxTagEnd")}}function s(){return{assert:r("assert",{startsExpr:Ge}),asserts:r("asserts",{startsExpr:Ge}),global:r("global",{startsExpr:Ge}),keyof:r("keyof",{startsExpr:Ge}),readonly:r("readonly",{startsExpr:Ge}),unique:r("unique",{startsExpr:Ge}),abstract:r("abstract",{startsExpr:Ge}),declare:r("declare",{startsExpr:Ge}),enum:r("enum",{startsExpr:Ge}),module:r("module",{startsExpr:Ge}),namespace:r("namespace",{startsExpr:Ge}),interface:r("interface",{startsExpr:Ge}),type:r("type",{startsExpr:Ge})}}}var Ad=1048576,Nn=2097152,en=1,dr=2,kd=4,Di=8,wd=16,Fo=64,$o=128,Nd=256,Dd=512,Vo=1024,zg=en|dr|Di|$o,Jg=en|0|Di|0,Xg=en|0|kd|0,Yg=en|0|wd|0,Qg=0|dr|0|$o,Zg=0|dr|0|0,_d=en|dr|Di|Nd,ex=0|Vo,tx=0|Fo,nx=en|0|0|Fo,rx=_d|Dd,ix=0|Vo,jo=4,Ho=2,qo=1,sx=Ho|qo,ax=Ho|jo,ox=qo|jo,Id=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/y,_o=new RegExp("(?=("+Id.source+"))\\1"+/(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source,"y"),Dn=class{constructor(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}};function Ld(e,t){let n="true";if(t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set"))n=(t.static?"s":"i")+t.kind;if(e==="iget"&&n==="iset"||e==="iset"&&n==="iget"||e==="sget"&&n==="sset"||e==="sset"&&n==="sget")return[!1,"true"];if(!e)return[!1,n];return[!0,e]}function Io(e,t){let{computed:n,key:r}=e;return!n&&(r.type==="Identifier"&&r.name===t||r.type==="Literal"&&r.value===t)}var F={AbstractMethodHasImplementation:({methodName:e})=>`Method '${e}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:e})=>`Property '${e}' cannot have an initializer because it is marked abstract.`,AccesorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccesorCannotHaveTypeParameters:"An accessor cannot have type parameters.",CannotFindName:({name:e})=>`Cannot find name '${e}'.`,ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:e})=>`'declare' is not allowed in ${e}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:()=>"Accessibility modifier already seen.",DuplicateModifier:({modifier:e})=>`Duplicate modifier: '${e}'.`,EmptyHeritageClauseType:({token:e})=>`'${e}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",IncompatibleModifiers:({modifiers:e})=>`'${e[0]}' modifier cannot be used with '${e[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:e})=>`Index signatures cannot have an accessibility modifier ('${e}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidModifierOnTypeMember:({modifier:e})=>`'${e}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:e})=>`'${e}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:e})=>`'${e}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:e})=>`'${e[0]}' modifier must precede '${e[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifer:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:e})=>`Private elements cannot have an accessibility modifier ('${e}').`,PrivateMethodsHasAccessibility:({modifier:e})=>`Private methods cannot have an accessibility modifier ('${e}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccesorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccesorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccesorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:e})=>`Single type parameter ${e} should have a trailing comma. Example usage: <${e},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",GenericsEndWithComma:"Trailing comma is not allowed at the end of generics.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:e})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${e}.`,LetInLexicalBinding:"'let' is not allowed to be used as a name in 'let' or 'const' declarations."},ur={UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",TrailingDecorator:"Decorators must be attached to a class element.",SpreadElementDecorator:"Decorators can't be used with SpreadElement"};function Rd(e,t,n){let{tokTypes:r}=n,{tokTypes:i}=t;return class extends e{takeDecorators(s){let c=this.decoratorStack[this.decoratorStack.length-1];if(c.length)s.decorators=c,this.resetStartLocationFromNode(s,c[0]),this.decoratorStack[this.decoratorStack.length-1]=[]}parseDecorators(s){let c=this.decoratorStack[this.decoratorStack.length-1];while(this.match(i.at)){let l=this.parseDecorator();c.push(l)}if(this.match(r._export)){if(!s)this.unexpected()}else if(!this.canHaveLeadingDecorator())this.raise(this.start,ur.UnexpectedLeadingDecorator)}parseDecorator(){let s=this.startNode();this.next(),this.decoratorStack.push([]);let c=this.start,l=this.startLoc,d;if(this.match(r.parenL)){let u=this.start,y=this.startLoc;if(this.next(),d=this.parseExpression(),this.expect(r.parenR),this.options.preserveParens){let g=this.startNodeAt(u,y);g.expression=d,d=this.finishNode(g,"ParenthesizedExpression")}}else{d=this.parseIdent(!1);while(this.eat(r.dot)){let u=this.startNodeAt(c,l);u.object=d,u.property=this.parseIdent(!0),u.computed=!1,d=this.finishNode(u,"MemberExpression")}}return s.expression=this.parseMaybeDecoratorArguments(d),this.decoratorStack.pop(),this.finishNode(s,"Decorator")}parseMaybeDecoratorArguments(s){if(this.eat(r.parenL)){let c=this.startNodeAtNode(s);return c.callee=s,c.arguments=this.parseExprList(r.parenR,!1),this.finishNode(c,"CallExpression")}return s}}}var Lo={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"},Md=/^[\da-fA-F]+$/,Od=/^\d+$/;function _n(e){if(!e)return e;if(e.type==="JSXIdentifier")return e.name;if(e.type==="JSXNamespacedName")return e.namespace.name+":"+e.name.name;if(e.type==="JSXMemberExpression")return _n(e.object)+"."+_n(e.property)}function Bd(e,t,n,r){let i=e.tokTypes,o=t.tokTypes,{isNewLine:s,isIdentifierChar:c}=e,l=Object.assign({allowNamespaces:!0,allowNamespacedObjects:!0},r||{});return class extends n{jsx_readToken(){let u="",y=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated JSX contents");let g=this.input.charCodeAt(this.pos);switch(g){case 60:case 123:if(this.pos===this.start){if(g===60&&this.exprAllowed)return++this.pos,this.finishToken(o.jsxTagStart);return this.getTokenFromCode(g)}return u+=this.input.slice(y,this.pos),this.finishToken(o.jsxText,u);case 38:u+=this.input.slice(y,this.pos),u+=this.jsx_readEntity(),y=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(g===62?"&gt;":"&rbrace;")+'` or `{"'+this.input[this.pos]+'"}`?');default:if(s(g))u+=this.input.slice(y,this.pos),u+=this.jsx_readNewLine(!0),y=this.pos;else++this.pos}}}jsx_readNewLine(u){let y=this.input.charCodeAt(this.pos),g;if(++this.pos,y===13&&this.input.charCodeAt(this.pos)===10)++this.pos,g=u?`
32
+ `:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};F.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
33
+ `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return We(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(e){var n=this.pos-1;this.invalidStringToken(n,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);if(i>255)r=r.slice(0,-1),i=parseInt(r,8);if(this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!=="0"||t===56||t===57)&&(this.strict||e))this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode");return String.fromCharCode(i)}if(ut(t)){if(this.options.locations)this.lineStart=this.pos,++this.curLine;return""}return String.fromCharCode(t)}};F.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);if(n===null)this.invalidStringToken(t,"Bad character escape sequence");return n};F.readWord1=function(){this.containsEsc=!1;var e="",t=!0,n=this.pos,r=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var i=this.fullCharCodeAtPos();if(de(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;if(this.input.charCodeAt(++this.pos)!==117)this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX");++this.pos;var s=this.readCodePoint();if(!(t?pe:de)(s,r))this.invalidStringToken(a,"Invalid Unicode escape");e+=We(s),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)};F.readWord=function(){var e=this.readWord1(),t=h.name;if(this.keywords.test(e))t=Hn[e];return this.finishToken(t,e)};var Ao="8.18.0";X.acorn={Parser:X,version:Ao,defaultOptions:Bn,Position:Pt,SourceLocation:Zt,getLineInfo:ai,Node:tn,TokenType:U,tokTypes:h,keywordTypes:Hn,TokContext:Ce,tokContexts:J,isIdentifierChar:de,isIdentifierStart:pe,Token:zn,isNewLine:ut,lineBreak:ce,lineBreakG:Wa,nonASCIIwhitespace:si};function Ld(e,t){return X.parse(e,t)}function Rd(e,t,n){return X.parseExpressionAt(e,t,n)}function Md(e,t){return X.tokenizer(e,t)}var ge=!0,Od=new WeakMap;function Bd(e){let t=e.Parser.acorn||e,n=Od.get(t);if(!n){let p=function(_){return _===g.name||_===g.string||_===g.num||v.includes(_)||R.includes(_)},c=function(_){return _===g.name||v.includes(_)||R.includes(_)},d=function(_){return _===g.name||R.includes(_)},u=function(_){return _===w.abstract||_===w.declare||_===w.enum||_===w.module||_===w.namespace||_===w.interface||_===w.type},y=function(_){return _===w.keyof||_===w.readonly||_===w.unique},x=function(_){return _===g.invalidTemplate},{tokTypes:g,keywordTypes:C}=t,v=Object.values(C),w=s(),R=Object.values(w),B=a(),L=i(),k=new RegExp(`^(?:${Object.keys(w).join("|")})$`);B.jsxTagStart.updateContext=function(){this.context.push(L.tc_expr),this.context.push(L.tc_oTag),this.exprAllowed=!1},B.jsxTagEnd.updateContext=function(_){let j=this.context.pop();if(j===L.tc_oTag&&_===g.slash||j===L.tc_cTag)this.context.pop(),this.exprAllowed=this.curContext()===L.tc_expr;else this.exprAllowed=!0},n={tokTypes:{...w,...B},tokContexts:{...L},keywordsRegExp:k,tokenIsLiteralPropertyName:p,tokenIsKeywordOrIdentifier:c,tokenIsIdentifier:d,tokenIsTSDeclarationStart:u,tokenIsTSTypeOperator:y,tokenIsTemplate:x}}return n;function r(p,c={}){return new t.TokenType("name",c)}function i(){return{tc_oTag:new t.TokContext("<tag",!1,!1),tc_cTag:new t.TokContext("</tag",!1,!1),tc_expr:new t.TokContext("<tag>...</tag>",!0,!0)}}function a(){return{at:new t.TokenType("@"),jsxName:new t.TokenType("jsxName"),jsxText:new t.TokenType("jsxText",{beforeExpr:!0}),jsxTagStart:new t.TokenType("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new t.TokenType("jsxTagEnd")}}function s(){return{assert:r("assert",{startsExpr:ge}),asserts:r("asserts",{startsExpr:ge}),global:r("global",{startsExpr:ge}),keyof:r("keyof",{startsExpr:ge}),readonly:r("readonly",{startsExpr:ge}),unique:r("unique",{startsExpr:ge}),abstract:r("abstract",{startsExpr:ge}),declare:r("declare",{startsExpr:ge}),enum:r("enum",{startsExpr:ge}),module:r("module",{startsExpr:ge}),namespace:r("namespace",{startsExpr:ge}),interface:r("interface",{startsExpr:ge}),type:r("type",{startsExpr:ge})}}}var Fd=1048576,rn=2097152,Nt=1,Xn=2,$d=4,yi=8,Vd=16,Ro=64,Mo=128,jd=256,Hd=512,Oo=1024,l0=Nt|Xn|yi|Mo,u0=Nt|0|yi|0,d0=Nt|0|$d|0,f0=Nt|0|Vd|0,h0=0|Xn|0|Mo,m0=0|Xn|0|0,qd=Nt|Xn|yi|jd,y0=0|Oo,g0=0|Ro,x0=Nt|0|0|Ro,b0=qd|Hd,T0=0|Oo,Bo=4,Fo=2,$o=1,v0=Fo|$o,S0=Fo|Bo,E0=$o|Bo,Ud=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/y,ko=new RegExp("(?=("+Ud.source+"))\\1"+/(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source,"y"),sn=class{constructor(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}};function Gd(e,t){let n="true";if(t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set"))n=(t.static?"s":"i")+t.kind;if(e==="iget"&&n==="iset"||e==="iset"&&n==="iget"||e==="sget"&&n==="sset"||e==="sset"&&n==="sget")return[!1,"true"];if(!e)return[!1,n];return[!0,e]}function wo(e,t){let{computed:n,key:r}=e;return!n&&(r.type==="Identifier"&&r.name===t||r.type==="Literal"&&r.value===t)}var D={AbstractMethodHasImplementation:({methodName:e})=>`Method '${e}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:e})=>`Property '${e}' cannot have an initializer because it is marked abstract.`,AccesorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccesorCannotHaveTypeParameters:"An accessor cannot have type parameters.",CannotFindName:({name:e})=>`Cannot find name '${e}'.`,ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:e})=>`'declare' is not allowed in ${e}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:()=>"Accessibility modifier already seen.",DuplicateModifier:({modifier:e})=>`Duplicate modifier: '${e}'.`,EmptyHeritageClauseType:({token:e})=>`'${e}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",IncompatibleModifiers:({modifiers:e})=>`'${e[0]}' modifier cannot be used with '${e[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:e})=>`Index signatures cannot have an accessibility modifier ('${e}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidModifierOnTypeMember:({modifier:e})=>`'${e}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:e})=>`'${e}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:e})=>`'${e}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:e})=>`'${e[0]}' modifier must precede '${e[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifer:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:e})=>`Private elements cannot have an accessibility modifier ('${e}').`,PrivateMethodsHasAccessibility:({modifier:e})=>`Private methods cannot have an accessibility modifier ('${e}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccesorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccesorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccesorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:e})=>`Single type parameter ${e} should have a trailing comma. Example usage: <${e},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",GenericsEndWithComma:"Trailing comma is not allowed at the end of generics.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:e})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${e}.`,LetInLexicalBinding:"'let' is not allowed to be used as a name in 'let' or 'const' declarations."},Jn={UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",TrailingDecorator:"Decorators must be attached to a class element.",SpreadElementDecorator:"Decorators can't be used with SpreadElement"};function Wd(e,t,n){let{tokTypes:r}=n,{tokTypes:i}=t;return class extends e{takeDecorators(s){let p=this.decoratorStack[this.decoratorStack.length-1];if(p.length)s.decorators=p,this.resetStartLocationFromNode(s,p[0]),this.decoratorStack[this.decoratorStack.length-1]=[]}parseDecorators(s){let p=this.decoratorStack[this.decoratorStack.length-1];while(this.match(i.at)){let c=this.parseDecorator();p.push(c)}if(this.match(r._export)){if(!s)this.unexpected()}else if(!this.canHaveLeadingDecorator())this.raise(this.start,Jn.UnexpectedLeadingDecorator)}parseDecorator(){let s=this.startNode();this.next(),this.decoratorStack.push([]);let p=this.start,c=this.startLoc,d;if(this.match(r.parenL)){let u=this.start,y=this.startLoc;if(this.next(),d=this.parseExpression(),this.expect(r.parenR),this.options.preserveParens){let x=this.startNodeAt(u,y);x.expression=d,d=this.finishNode(x,"ParenthesizedExpression")}}else{d=this.parseIdent(!1);while(this.eat(r.dot)){let u=this.startNodeAt(p,c);u.object=d,u.property=this.parseIdent(!0),u.computed=!1,d=this.finishNode(u,"MemberExpression")}}return s.expression=this.parseMaybeDecoratorArguments(d),this.decoratorStack.pop(),this.finishNode(s,"Decorator")}parseMaybeDecoratorArguments(s){if(this.eat(r.parenL)){let p=this.startNodeAtNode(s);return p.callee=s,p.arguments=this.parseExprList(r.parenR,!1),this.finishNode(p,"CallExpression")}return s}}}var No={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"},zd=/^[\da-fA-F]+$/,Kd=/^\d+$/;function an(e){if(!e)return e;if(e.type==="JSXIdentifier")return e.name;if(e.type==="JSXNamespacedName")return e.namespace.name+":"+e.name.name;if(e.type==="JSXMemberExpression")return an(e.object)+"."+an(e.property)}function Jd(e,t,n,r){let i=e.tokTypes,a=t.tokTypes,{isNewLine:s,isIdentifierChar:p}=e,c=Object.assign({allowNamespaces:!0,allowNamespacedObjects:!0},r||{});return class extends n{jsx_readToken(){let u="",y=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated JSX contents");let x=this.input.charCodeAt(this.pos);switch(x){case 60:case 123:if(this.pos===this.start){if(x===60&&this.exprAllowed)return++this.pos,this.finishToken(a.jsxTagStart);return this.getTokenFromCode(x)}return u+=this.input.slice(y,this.pos),this.finishToken(a.jsxText,u);case 38:u+=this.input.slice(y,this.pos),u+=this.jsx_readEntity(),y=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(x===62?"&gt;":"&rbrace;")+'` or `{"'+this.input[this.pos]+'"}`?');default:if(s(x))u+=this.input.slice(y,this.pos),u+=this.jsx_readNewLine(!0),y=this.pos;else++this.pos}}}jsx_readNewLine(u){let y=this.input.charCodeAt(this.pos),x;if(++this.pos,y===13&&this.input.charCodeAt(this.pos)===10)++this.pos,x=u?`
37
34
  `:`\r
38
- `;else g=String.fromCharCode(y);if(this.options.locations)++this.curLine,this.lineStart=this.pos;return g}jsx_readString(u){let y="",g=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");let b=this.input.charCodeAt(this.pos);if(b===u)break;if(b===38)y+=this.input.slice(g,this.pos),y+=this.jsx_readEntity(),g=this.pos;else if(s(b))y+=this.input.slice(g,this.pos),y+=this.jsx_readNewLine(!1),g=this.pos;else++this.pos}return y+=this.input.slice(g,this.pos++),this.finishToken(i.string,y)}jsx_readEntity(){let u="",y=0,g,b=this.input[this.pos];if(b!=="&")this.raise(this.pos,"Entity must start with an ampersand");let P=++this.pos;while(this.pos<this.input.length&&y++<10){if(b=this.input[this.pos++],b===";"){if(u[0]==="#"){let N;if(u[1]==="x"||u[1]==="X"){if(u=u.substr(2),Md.test(u))N=parseInt(u,16)}else if(u=u.substr(1),Od.test(u))N=parseInt(u,10);if(N!==void 0&&N<=1114111)g=String.fromCodePoint(N)}else if(Object.prototype.hasOwnProperty.call(Lo,u))g=Lo[u];break}u+=b}if(g===void 0)return this.pos=P,"&";return g}jsx_readWord(){let u,y=this.pos;do u=this.input.charCodeAt(++this.pos);while(c(u)||u===45);return this.finishToken(o.jsxName,this.input.slice(y,this.pos))}jsx_parseIdentifier(){let u=this.startNode();if(this.type===o.jsxName)u.name=this.value;else if(this.type.keyword)u.name=this.type.keyword;else this.unexpected();return this.next(),this.finishNode(u,"JSXIdentifier")}jsx_parseNamespacedName(){let u=this.start,y=this.startLoc,g=this.jsx_parseIdentifier();if(!l.allowNamespaces||!this.eat(i.colon))return g;var b=this.startNodeAt(u,y);return b.namespace=g,b.name=this.jsx_parseIdentifier(),this.finishNode(b,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===o.jsxTagEnd)return"";let u=this.start,y=this.startLoc,g=this.jsx_parseNamespacedName();if(this.type===i.dot&&g.type==="JSXNamespacedName"&&!l.allowNamespacedObjects)this.unexpected();while(this.eat(i.dot)){let b=this.startNodeAt(u,y);b.object=g,b.property=this.jsx_parseIdentifier(),g=this.finishNode(b,"JSXMemberExpression")}return g}jsx_parseAttributeValue(){switch(this.type){case i.braceL:let u=this.jsx_parseExpressionContainer();if(u.expression.type==="JSXEmptyExpression")this.raise(u.start,"JSX attributes must only be assigned a non-empty expression");return u;case o.jsxTagStart:case i.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let u=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(u,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let u=this.startNode();if(this.next(),this.eat(i.ellipsis))return u.expression=this.parseExpression(),this.expect(i.braceR),this.finishNode(u,"JSXSpreadChild");return u.expression=this.type===i.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(i.braceR),this.finishNode(u,"JSXExpressionContainer")}jsx_parseAttribute(){let u=this.startNode();if(this.eat(i.braceL))return this.expect(i.ellipsis),u.argument=this.parseMaybeAssign(),this.expect(i.braceR),this.finishNode(u,"JSXSpreadAttribute");return u.name=this.jsx_parseNamespacedName(),u.value=this.eat(i.eq)?this.jsx_parseAttributeValue():null,this.finishNode(u,"JSXAttribute")}jsx_parseOpeningElementAt(u,y){let g=this.startNodeAt(u,y);g.attributes=[];let b=this.jsx_parseElementName();if(b)g.name=b;while(this.type!==i.slash&&this.type!==o.jsxTagEnd)g.attributes.push(this.jsx_parseAttribute());return g.selfClosing=this.eat(i.slash),this.expect(o.jsxTagEnd),this.finishNode(g,b?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(u,y){let g=this.startNodeAt(u,y),b=this.jsx_parseElementName();if(b)g.name=b;return this.expect(o.jsxTagEnd),this.finishNode(g,b?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(u,y){let g=this.startNodeAt(u,y),b=[],P=this.jsx_parseOpeningElementAt(u,y),N=null;if(!P.selfClosing){e:for(;;)switch(this.type){case o.jsxTagStart:if(u=this.start,y=this.startLoc,this.next(),this.eat(i.slash)){N=this.jsx_parseClosingElementAt(u,y);break e}b.push(this.jsx_parseElementAt(u,y));break;case o.jsxText:b.push(this.parseExprAtom());break;case i.braceL:b.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}if(_n(N.name)!==_n(P.name))this.raise(N.start,"Expected corresponding JSX closing tag for <"+_n(P.name)+">")}let D=P.name?"Element":"Fragment";if(g["opening"+D]=P,g["closing"+D]=N,g.children=b,this.type===i.relational&&this.value==="<")this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag");return this.finishNode(g,"JSX"+D)}jsx_parseText(){let u=this.parseLiteral(this.value);return u.type="JSXText",u}jsx_parseElement(){let u=this.start,y=this.startLoc;return this.next(),this.jsx_parseElementAt(u,y)}}}function Fd(e,t,n){let{tokTypes:r}=t,{tokTypes:i}=n;return class extends e{parseMaybeImportAttributes(s){if(this.type===i._with||this.type===r.assert){this.next();let c=this.parseImportAttributes();if(c)s.attributes=c}}parseImportAttributes(){this.expect(i.braceL);let s=this.parseWithEntries();return this.expect(i.braceR),s}parseWithEntries(){let s=[],c=new Set;do{if(this.type===i.braceR)break;let l=this.startNode(),d;if(this.type===i.string)d=this.parseLiteral(this.value);else d=this.parseIdent(!0);if(this.next(),l.key=d,c.has(l.key.name))this.raise(this.pos,"Duplicated key in attributes");if(c.add(l.key.name),this.type!==i.string)this.raise(this.pos,"Only string is supported as an attribute value");l.value=this.parseLiteral(this.value),s.push(this.finishNode(l,"ImportAttribute"))}while(this.eat(i.comma));return s}}}var ki=["onToken","onComment","onInsertedSemicolon","onTrailingComma"];function Uo(){return{_tag:"BufferedParserEvents",segments:[]}}var $d=Uo();function Ro(e){return e.segments.length>0}var Vd=class{constructor(e,t){this.options=e,this.state=t,this.callbacks={},this.callbackWrappers={},this.frames=[],this.undoLog=[],this.hasCallbacks=this.captureCallbacks()}get active(){return this.frames.length>0}begin(){let e={_tag:"ParseEffectFrame",depth:this.frames.length,undoMark:this.undoLog.length,checkpoint:this.state?.capture()};if(this.frames.push(e),e.depth===0&&this.hasCallbacks)this.activateCallbacks();return e}commit(e){this.close(e);let t=this.currentFrame();if(t){if(e.output)this.appendOutput(this.outputFor(t),e.output);return}if(this.undoLog.length=e.undoMark,e.output)this.flush(e.output)}rollback(e){this.close(e),this.unwind(e.undoMark),this.restore(e)}rollbackWithEvents(e){return this.close(e),this.unwind(e.undoMark),this.restore(e),e.output??$d}replay(e){if(!Ro(e))return;let t=this.currentFrame();if(t){this.appendOutput(this.outputFor(t),e);return}this.flush(e)}set(e,t,n){this.willSet(e,t),e[t]=n}remove(e,t){this.willSet(e,t),delete e[t]}append(e,t){this.willAppend(e),e.push(t)}pop(e){return this.willMutateTail(e,1),e.pop()}truncate(e,t){if(t<e.length)this.willMutateTail(e,e.length-t);else this.willAppend(e);e.length=t}modify(e,t,n){let[r,i]=n(e[t]);return this.set(e,t,i),r}willAppend(e){if(!this.active)return;this.undoLog.push({_tag:"ArrayLength",target:e,length:e.length})}willMutateTail(e,t){if(!this.active)return;let n=Math.max(0,e.length-t);this.undoLog.push({_tag:"ArrayTail",target:e,start:n,values:e.slice(n)})}willSet(e,t){if(!this.active)return;let n=e;this.undoLog.push({_tag:"Property",target:n,key:t,had:Object.prototype.hasOwnProperty.call(n,t),value:n[t]})}captureCallbacks(){let e=!1;for(let t of ki){let n=this.options[t];if(!n)continue;e=!0,this.callbacks[t]=n,this.callbackWrappers[t]=(...r)=>{this.emit({name:t,args:r})}}return e}activateCallbacks(){for(let e of ki){let t=this.callbackWrappers[e];if(t)this.options[e]=t}}deactivateCallbacks(){for(let e of ki){let t=this.callbacks[e];if(t)this.options[e]=t}}emit(e){let t=this.currentFrame();if(!t){this.invoke(e);return}let n=this.outputFor(t).segments,r=n[n.length-1];if(Array.isArray(r))r.push(e);else n.push([e])}appendOutput(e,t){if(Ro(t))e.segments.push(t)}outputFor(e){return e.output??=Uo()}flush(e){let t=[];for(let n=e.segments.length-1;n>=0;n--)t.push(e.segments[n]);while(t.length>0){let n=t.pop();if(Array.isArray(n)){for(let r of n)this.invoke(r);continue}for(let r=n.segments.length-1;r>=0;r--)t.push(n.segments[r])}}invoke(e){this.callbacks[e.name]?.apply(this.options,e.args)}currentFrame(){return this.frames[this.frames.length-1]}close(e){if(this.currentFrame()!==e||e.depth!==this.frames.length-1)throw Error("Parse effect scopes must be closed in order");if(this.frames.pop(),this.frames.length===0&&this.hasCallbacks)this.deactivateCallbacks()}restore(e){if(this.state)this.state.restore(e.checkpoint)}unwind(e){for(let t=this.undoLog.length-1;t>=e;t--){let n=this.undoLog[t];switch(n._tag){case"ArrayLength":if(n.target.length<n.length)throw Error("A parse effect shortened an append-only array");n.target.length=n.length;break;case"ArrayTail":n.target.length=n.start;for(let r of n.values)n.target.push(r);break;case"Property":if(n.had)n.target[n.key]=n.value;else delete n.target[n.key];break}}this.undoLog.length=e}};function Zt(e,t,n){if(e.length===t)return e;if(e.length<t)throw Error(`A parse branch shortened the ${n} below its checkpoint`);return e.length=t,e}function jd(e){return{lookahead:e.getCurLookaheadState(),context:e.context,contextLength:e.context.length,scopeStack:e.scopeStack,scopeStackLength:e.scopeStack.length,importsStack:e.importsStack,importsStackLength:e.importsStack.length,labels:e.labels,labelsLength:e.labels.length,privateNameStack:e.privateNameStack,privateNameStackLength:e.privateNameStack.length,decoratorStack:e.decoratorStack,decoratorStackLength:e.decoratorStack.length,strict:e.strict,potentialArrowAt:e.potentialArrowAt,potentialArrowInForAwait:e.potentialArrowInForAwait,yieldPos:e.yieldPos,awaitPos:e.awaitPos,awaitIdentPos:e.awaitIdentPos,preValue:e.preValue,preToken:e.preToken,isLookahead:e.isLookahead,isAmbientContext:e.isAmbientContext,inAbstractClass:e.inAbstractClass,inType:e.inType,inDisallowConditionalTypesContext:e.inDisallowConditionalTypesContext,maybeInArrowParameters:e.maybeInArrowParameters,shouldParseArrowReturnType:e.shouldParseArrowReturnType,shouldParseAsyncArrowReturnType:e.shouldParseAsyncArrowReturnType,importOrExportOuterKind:e.importOrExportOuterKind}}function Hd(e,t){e.setLookaheadTokenState(t.lookahead),e.context=Zt(t.context,t.contextLength,"token context stack"),e.scopeStack=Zt(t.scopeStack,t.scopeStackLength,"scope stack"),e.importsStack=Zt(t.importsStack,t.importsStackLength,"import stack"),e.labels=Zt(t.labels,t.labelsLength,"label stack"),e.privateNameStack=Zt(t.privateNameStack,t.privateNameStackLength,"private-name stack"),e.decoratorStack=Zt(t.decoratorStack,t.decoratorStackLength,"decorator stack"),e.strict=t.strict,e.potentialArrowAt=t.potentialArrowAt,e.potentialArrowInForAwait=t.potentialArrowInForAwait,e.yieldPos=t.yieldPos,e.awaitPos=t.awaitPos,e.awaitIdentPos=t.awaitIdentPos,e.regexpState=null,e.preValue=t.preValue,e.preToken=t.preToken,e.isLookahead=t.isLookahead,e.isAmbientContext=t.isAmbientContext,e.inAbstractClass=t.inAbstractClass,e.inType=t.inType,e.inDisallowConditionalTypesContext=t.inDisallowConditionalTypesContext,e.maybeInArrowParameters=t.maybeInArrowParameters,e.shouldParseArrowReturnType=t.shouldParseArrowReturnType,e.shouldParseAsyncArrowReturnType=t.shouldParseAsyncArrowReturnType,e.importOrExportOuterKind=t.importOrExportOuterKind}function qd(e){return{capture:()=>jd(e),restore:(t)=>Hd(e,t)}}function Ud(e,t){let{acornTokenTypes:n,typeScriptTokenTypes:r,scope:i}=t,o=i.SCOPE_TOP|i.SCOPE_FUNCTION|i.SCOPE_CLASS_STATIC_BLOCK;return class extends e{constructor(c,l,d){super(c,l,d);this.parseEffects=new Vd(this.options,qd(this))}overrideContext(c){if(this.curContext()!==c)this.parseEffects?.willMutateTail(this.context,1);return super.overrideContext(c)}takeDecorators(c){let l=this.decoratorStack.length-1;if(this.decoratorStack[l].length>0)this.parseEffects?.willSet(this.decoratorStack,String(l));return super.takeDecorators(c)}parseDecorators(c){let l=this.decoratorStack[this.decoratorStack.length-1];return this.parseEffects?.willAppend(l),super.parseDecorators(c)}parseDecorator(){return this.parseEffects?.willAppend(this.decoratorStack),super.parseDecorator()}parseIdentNode(){if((this.type.keyword==="class"||this.type.keyword==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.parseEffects?.willMutateTail(this.context,1);return super.parseIdentNode()}parseLabeledStatement(c,l,d,u){for(let y=this.labels.length-1;y>=0;y--){let g=this.labels[y];if(g.statementStart!==c.start)break;this.parseEffects?.willSet(g,"statementStart"),this.parseEffects?.willSet(g,"kind")}return this.parseEffects?.willAppend(this.labels),super.parseLabeledStatement(c,l,d,u)}enterClassBody(){return this.parseEffects?.willAppend(this.privateNameStack),super.enterClassBody()}exitClassBody(){let c=this.privateNameStack[this.privateNameStack.length-2];if(c)this.parseEffects?.willAppend(c.used);return this.parseEffects?.willMutateTail(this.privateNameStack,1),super.exitClassBody()}parsePrivateIdent(){if(this.options.checkPrivateFields&&this.privateNameStack.length>0){let c=this.privateNameStack[this.privateNameStack.length-1];this.parseEffects?.willAppend(c.used)}return super.parsePrivateIdent()}parseClassField(c){return this.parseEffects?.willSet(this.currentThisScope(),"inClassFieldInit"),super.parseClassField(c)}updateContext(c){let{type:l}=this;if(l===n.parenR||l===n.braceR||l===n.braceL||l===n.dollarBraceL||l===n.parenL||l===n._function||l===n._class||l===n.colon||l===n.backQuote||l===n.star||l===r.jsxTagStart||l===r.jsxTagEnd||l===n.slash&&c===r.jsxTagStart)this.parseEffects?.willMutateTail(this.context,2);return super.updateContext(c)}enterScope(c){return this.parseEffects?.willAppend(this.scopeStack),super.enterScope(c)}exitScope(){return this.parseEffects?.willMutateTail(this.scopeStack,1),super.exitScope()}declareName(c,l,d){let u=this.parseEffects;if(u?.active)if(l===i.BIND_LEXICAL){let y=this.currentScope();if(u.willAppend(y.lexical),this.inModule&&y.flags&i.SCOPE_TOP)u.willSet(this.undefinedExports,c)}else if(l===i.BIND_SIMPLE_CATCH)u.willAppend(this.currentScope().lexical);else if(l===i.BIND_FUNCTION)u.willAppend(this.currentScope().functions);else for(let y=this.scopeStack.length-1;y>=0;y--){let g=this.scopeStack[y];if(u.willAppend(g.var),this.inModule&&g.flags&i.SCOPE_TOP)u.willSet(this.undefinedExports,c);if(g.flags&o)break}return super.declareName(c,l,d)}checkLocalExport(c){return this.parseEffects?.willSet(this.undefinedExports,c.name),super.checkLocalExport(c)}}}var wi=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;function Mo(e){if(!e)throw Error("Assert fail")}function Gd(e){return e==="accessor"}function Wd(e){return e==="in"||e==="out"}var lr=1,Oo=2,Kd=4,ne={SCOPE_TOP:1,SCOPE_FUNCTION:2,SCOPE_ASYNC:4,SCOPE_GENERATOR:8,SCOPE_ARROW:16,SCOPE_SIMPLE_CATCH:32,SCOPE_SUPER:64,SCOPE_DIRECT_SUPER:128,SCOPE_CLASS_STATIC_BLOCK:256,SCOPE_VAR:256,BIND_NONE:0,BIND_VAR:1,BIND_LEXICAL:2,BIND_FUNCTION:3,BIND_SIMPLE_CATCH:4,BIND_OUTSIDE:5,BIND_TS_TYPE:6,BIND_TS_INTERFACE:7,BIND_TS_NAMESPACE:1032,BIND_FLAGS_TS_EXPORT_ONLY:1024,BIND_FLAGS_TS_IMPORT:4096,BIND_FLAGS_TS_ENUM:256,BIND_FLAGS_TS_CONST_ENUM:512,BIND_TS_ENUM:258,BIND_TS_CONST_ENUM:770,BIND_FLAGS_CLASS:128};function Ni(e,t){return ne.SCOPE_FUNCTION|(e?ne.SCOPE_ASYNC:0)|(t?ne.SCOPE_GENERATOR:0)}function zd(e){if(e.type!=="MemberExpression")return!1;let{computed:t,property:n}=e;if(t&&(n.type!=="TemplateLiteral"||n.expressions.length>0))return!1;return Go(e.object)}function Jd(e){return e.type==="UnaryExpression"&&(e.operator==="-"||e.operator==="+")&&e.argument.type==="Literal"&&(typeof e.argument.value==="number"||typeof e.argument.value==="bigint")}function Go(e){if(e.type==="Identifier")return!0;if(e.type!=="MemberExpression")return!1;if(e.computed)return!1;return Go(e.object)}function Bo(e){return e==="private"||e==="public"||e==="protected"}function Xd(e){return Boolean(e.startsExpr)}function Yd(e){if(e==null)throw Error(`Unexpected ${e} value.`);return e}function Qd(e){switch(e){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function Wo(e){let{dts:t=!1}=e||{},n=!!e?.jsx;return function(r){let i=r.acorn||Ai,o=Pd(i),{tokTypes:s,keywordTypes:c,isIdentifierStart:l,lineBreak:d,isNewLine:u,tokContexts:y,isIdentifierChar:g}=i,{tokTypes:b,tokContexts:P,keywordsRegExp:N,tokenIsLiteralPropertyName:D,tokenIsTemplate:j,tokenIsTSDeclarationStart:U,tokenIsIdentifier:v,tokenIsKeywordOrIdentifier:w,tokenIsTSTypeOperator:M}=o;function G(a,p,f=a.length){for(let m=p;m<f;m++){let E=a.charCodeAt(m);if(u(E))return m<f-1&&E===13&&a.charCodeAt(m+1)===10?m+2:m+1}return-1}if(r=Rd(r,o,i),e?.jsx)r=Bd(i,o,r,typeof e.jsx==="boolean"?{}:e.jsx);r=Fd(r,o,i);let X=Ud(r,{acornTokenTypes:s,typeScriptTokenTypes:b,scope:ne});class be extends X{constructor(a,p,f){super(a,p,f);this.preValue=null,this.preToken=null,this.isLookahead=!1,this.isAmbientContext=!1,this.inAbstractClass=!1,this.inType=!1,this.inDisallowConditionalTypesContext=!1,this.maybeInArrowParameters=!1,this.shouldParseArrowReturnType=void 0,this.shouldParseAsyncArrowReturnType=void 0,this.decoratorStack=[[]],this.importsStack=[[]],this.importOrExportOuterKind=void 0,this.tsParseConstModifier=(m)=>{this.tsParseModifiers({modified:m,allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:F.InvalidModifierOnTypeParameterPositions})},this.ecmaVersion=this.options.ecmaVersion}static get acornTypeScript(){return o}get acornTypeScript(){return o}getTokenFromCodeInType(a){if(a===62)return this.finishOp(s.relational,1);if(a===60)return this.finishOp(s.relational,1);return super.getTokenFromCode(a)}readToken(a){if(!this.inType){let p=this.curContext();if(p===P.tc_expr)return this.jsx_readToken();if(p===P.tc_oTag||p===P.tc_cTag){if(l(a))return this.jsx_readWord();if(a==62)return++this.pos,this.finishToken(b.jsxTagEnd);if((a===34||a===39)&&p==P.tc_oTag)return this.jsx_readString(a)}if(a===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33)if(++this.pos,e?.jsx)return this.finishToken(b.jsxTagStart);else return this.finishToken(s.relational,"<")}return super.readToken(a)}getTokenFromCode(a){if(this.inType)return this.getTokenFromCodeInType(a);if(a===64)return++this.pos,this.finishToken(b.at);return super.getTokenFromCode(a)}isAbstractClass(){return this.ts_isContextual(b.abstract)&&this.lookahead().type===s._class}isDeclareClass(){if(!this.ts_isContextual(b.declare))return!1;let a=this.nextTokenStart();if(this.isUnparsedContextual(a,"class"))return!0;if(!this.isUnparsedContextual(a,"abstract"))return!1;let p=this.nextTokenStartSince(a+8);return this.isUnparsedContextual(p,"class")}finishNode(a,p){if(a.type!==""&&a.end!==0)return a;return super.finishNode(a,p)}tryParse(a){let p={},f=this.beginParseEffectScope(),m;try{m=a(()=>{throw p})}catch(E){let S=E===p;if(!S&&!(E instanceof SyntaxError))throw this.parseEffects.rollback(f),E;let k={events:this.parseEffects.rollbackWithEvents(f),selected:!1};return S?{node:null,error:null,thrown:!1,aborted:!0,failState:k}:{node:null,error:E,thrown:!0,aborted:!1,failState:k}}return this.parseEffects.commit(f),{node:m,error:null,thrown:!1,aborted:!1,failState:null}}setOptionalParametersError(a,p){a.optionalParametersLoc=p?.loc??this.startLoc}reScan_lt_gt(){if(this.type===s.relational)this.pos-=1,this.readToken_lt_gt(this.fullCharCodeAtPos())}reScan_lt(){let{type:a}=this;if(a===s.bitShift)return this.pos-=2,this.finishOp(s.relational,1),s.relational;return a}resetEndLocation(a,p=this.lastTokEnd,f=this.lastTokEndLoc){if(a.end=p,a.loc.end=f,this.options.ranges)a.range[1]=p}startNodeAtNode(a){return super.startNodeAt(a.start,a.loc.start)}nextTokenStart(){return this.nextTokenStartSince(this.pos)}tsHasSomeModifiers(a,p){return p.some((f)=>{if(Bo(f))return a.accessibility===f;return!!a[f]})}tsIsStartOfStaticBlocks(){return this.isContextual("static")&&this.lookaheadCharCode()===123}tsCheckForInvalidTypeCasts(a){a.forEach((p)=>{if(p?.type==="TSTypeCastExpression")this.raise(p.typeAnnotation.start,F.UnexpectedTypeAnnotation)})}atPossibleAsyncArrow(a){return a.type==="Identifier"&&a.name==="async"&&this.lastTokEnd===a.end&&!this.canInsertSemicolon()&&a.end-a.start===5&&a.start===this.potentialArrowAt}tsIsIdentifier(){return v(this.type)}tsTryParseTypeOrTypePredicateAnnotation(){return this.match(s.colon)?this.tsParseTypeOrTypePredicateAnnotation(s.colon):void 0}tsTryParseGenericAsyncArrowFunction(a,p,f){if(!this.tsMatchLeftRelational())return;let m=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let E=this.tsTryParseAndCatch(()=>{let S=this.startNodeAt(a,p);return S.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(S),S.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(s.arrow),S});if(this.maybeInArrowParameters=m,!E)return;return this.parseArrowExpression(E,E.params,!0,f)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()!==s.relational)return;return this.tsParseTypeArguments(!0)}tsInNoContext(a){let p=this.context;this.context=[p[0]];try{return a()}finally{this.context=p}}tsTryParseTypeAnnotation(){return this.match(s.colon)?this.tsParseTypeAnnotation():void 0}isUnparsedContextual(a,p){let f=a+p.length;if(this.input.slice(a,f)===p){let m=this.input.charCodeAt(f);return!(g(m)||(m&64512)===55296)}return!1}isAbstractConstructorSignature(){return this.ts_isContextual(b.abstract)&&this.lookahead().type===s._new}nextTokenStartSince(a){return wi.lastIndex=a,wi.test(this.input)?wi.lastIndex:a}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}createLookaheadState(){this.value=null,this.context=[this.curContext()]}getCurLookaheadState(){return{endLoc:this.endLoc,lastTokEnd:this.lastTokEnd,lastTokStart:this.lastTokStart,lastTokStartLoc:this.lastTokStartLoc,pos:this.pos,value:this.value,type:this.type,exprAllowed:this.exprAllowed,start:this.start,end:this.end,context:this.context,startLoc:this.startLoc,lastTokEndLoc:this.lastTokEndLoc,curLine:this.curLine,lineStart:this.lineStart,containsEsc:this.containsEsc}}setLookaheadTokenState(a){this.pos=a.pos,this.value=a.value,this.exprAllowed=a.exprAllowed,this.endLoc=a.endLoc,this.lastTokEnd=a.lastTokEnd,this.lastTokStart=a.lastTokStart,this.lastTokStartLoc=a.lastTokStartLoc,this.type=a.type,this.start=a.start,this.end=a.end,this.startLoc=a.startLoc,this.lastTokEndLoc=a.lastTokEndLoc,this.curLine=a.curLine,this.lineStart=a.lineStart,this.containsEsc=a.containsEsc}setLookaheadState(a){this.setLookaheadTokenState(a),this.context=a.context&&a.context.slice()}beginParseEffectScope(){return this.parseEffects.begin()}selectTryParseResult(a){let p=a.failState;if(!p)return;if(p.selected)throw Error("A parse branch result can only be selected once");p.selected=!0,this.parseEffects.replay(p.events)}tsLookAhead(a){let p=this.beginParseEffectScope();try{return a()}finally{this.parseEffects.rollback(p)}}lookahead(a){let p=this.getCurLookaheadState(),f=this.context,m=this.preValue,E=this.preToken,S=this.isLookahead;try{if(this.createLookaheadState(),this.isLookahead=!0,a!==void 0)for(let k=0;k<a;k++)this.nextToken();else this.nextToken();return this.getCurLookaheadState()}finally{this.setLookaheadTokenState(p),this.context=f,this.preValue=m,this.preToken=E,this.isLookahead=S}}readWord(){let a=this.readWord1(),p=s.name;if(this.keywords.test(a))p=c[a];else if(new RegExp(N).test(a))p=b[a];return this.finishToken(p,a)}skipBlockComment(){let a;if(!this.isLookahead)a=this.options.onComment&&this.curPosition();let p=this.pos,f=this.input.indexOf("*/",this.pos+=2);if(f===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=f+2,this.options.locations)for(let m,E=p;(m=G(this.input,E,this.pos))>-1;)++this.curLine,E=this.lineStart=m;if(this.isLookahead)return;if(this.options.onComment)this.options.onComment(!0,this.input.slice(p+2,f),p,this.pos,a,this.curPosition())}skipLineComment(a){let p=this.pos,f;if(!this.isLookahead)f=this.options.onComment&&this.curPosition();let m=this.input.charCodeAt(this.pos+=a);while(this.pos<this.input.length&&!u(m))m=this.input.charCodeAt(++this.pos);if(this.isLookahead)return;if(this.options.onComment)this.options.onComment(!1,this.input.slice(p+a,this.pos),p,this.pos,f,this.curPosition())}finishToken(a,p){if(this.preValue=this.value,this.preToken=this.type,this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();let f=this.type;if(this.type=a,this.value=p,!this.isLookahead)this.updateContext(f)}resetStartLocation(a,p,f){if(a.start=p,a.loc.start=f,this.options.ranges)a.range[0]=p}isLineTerminator(){return this.eat(s.semi)||super.canInsertSemicolon()}hasFollowingLineBreak(){return _o.lastIndex=this.end,_o.test(this.input)}addExtra(a,p,f,m=!0){if(!a)return;let E=a.extra=a.extra||{};if(m)E[p]=f;else Object.defineProperty(E,p,{enumerable:m,value:f})}isLiteralPropertyName(){return D(this.type)}hasPrecedingLineBreak(){return d.test(this.input.slice(this.lastTokEnd,this.start))}createIdentifier(a,p){return a.name=p,this.finishNode(a,"Identifier")}resetStartLocationFromNode(a,p){this.resetStartLocation(a,p.start,p.loc.start)}isThisParam(a){return a.type==="Identifier"&&a.name==="this"}isLookaheadContextual(a){let p=this.nextTokenStart();return this.isUnparsedContextual(p,a)}ts_type_isContextual(a,p){return a===p&&!this.containsEsc}ts_isContextual(a){return this.type===a&&!this.containsEsc}ts_isContextualWithState(a,p){return a.type===p&&!a.containsEsc}isContextualWithState(a,p){return p.type===s.name&&p.value===a&&!p.containsEsc}tsIsStartOfMappedType(){if(this.next(),this.eat(s.plusMin))return this.ts_isContextual(b.readonly);if(this.ts_isContextual(b.readonly))this.next();if(!this.match(s.bracketL))return!1;if(this.next(),!this.tsIsIdentifier())return!1;return this.next(),this.match(s._in)}tsInDisallowConditionalTypesContext(a){let p=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!0;try{return a()}finally{this.inDisallowConditionalTypesContext=p}}tsTryParseType(){return this.tsEatThenParseType(s.colon)}match(a){return this.type===a}matchJsx(a){return this.type===o.tokTypes[a]}ts_eatWithState(a,p,f){let m=f.type;if(a===m){for(let E=0;E<p;E++)this.next();return!0}else return!1}ts_eatContextualWithState(a,p,f){if(N.test(a)){if(this.ts_isContextualWithState(f,b[a])){for(let m=0;m<p;m++)this.next();return!0}return!1}else{if(!this.isContextualWithState(a,f))return!1;for(let m=0;m<p;m++)this.next();return!0}}canHaveLeadingDecorator(){return this.match(s._class)||this.isAbstractClass()||this.isDeclareClass()}eatContextual(a){if(N.test(a)){if(this.ts_isContextual(b[a]))return this.next(),!0;return!1}else return super.eatContextual(a)}tsIsExternalModuleReference(){return this.isContextual("require")&&this.lookaheadCharCode()===40}tsParseExternalModuleReference(){let a=this.startNode();if(this.expectContextual("require"),this.expect(s.parenL),!this.match(s.string))this.unexpected();return a.expression=this.parseExprAtom(),this.expect(s.parenR),this.finishNode(a,"TSExternalModuleReference")}tsParseEntityName(a=!0){let p=this.parseIdent(a);while(this.eat(s.dot)){let f=this.startNodeAtNode(p);f.left=p,f.right=this.parseIdent(a),p=this.finishNode(f,"TSQualifiedName")}return p}tsParseEnumMember(){let a=this.startNode();if(a.id=this.match(s.string)?this.parseLiteral(this.value):this.parseIdent(!0),this.eat(s.eq))a.initializer=this.parseMaybeAssign();return this.finishNode(a,"TSEnumMember")}tsParseEnumDeclaration(a,p={}){if(p.const)a.const=!0;if(p.declare)a.declare=!0;this.expectContextual("enum"),a.id=this.parseIdent();let f=p.const?ne.BIND_TS_CONST_ENUM:ne.BIND_TS_ENUM;return this.checkLValSimple(a.id,f),this.expect(s.braceL),a.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(s.braceR),this.finishNode(a,"TSEnumDeclaration")}tsParseModuleBlock(){let a=this.startNode();this.enterScope(Ad),this.expect(s.braceL),a.body=[];while(this.type!==s.braceR){let p=this.parseStatement(null,!0);a.body.push(p)}return this.next(),super.exitScope(),this.finishNode(a,"TSModuleBlock")}tsParseAmbientExternalModuleDeclaration(a){if(this.ts_isContextual(b.global))a.global=!0,a.id=this.parseIdent();else if(this.match(s.string))a.id=this.parseLiteral(this.value);else this.unexpected();if(this.match(s.braceL))this.enterScope(Nn),a.body=this.tsParseModuleBlock(),super.exitScope();else super.semicolon();return this.finishNode(a,"TSModuleDeclaration")}tsTryParseDeclare(a){if(this.isLineTerminator())return;let p=this.type,f;if(this.isContextual("let"))p=s._var,f="let";return this.tsInAmbientContext(()=>{if(p===s._function)return a.declare=!0,this.parseFunctionStatement(a,!1,!0);if(p===s._class)return a.declare=!0,this.parseClass(a,!0);if(p===b.enum)return this.tsParseEnumDeclaration(a,{declare:!0});if(p===b.global)return this.tsParseAmbientExternalModuleDeclaration(a);if(p===s._const||p===s._var){if(!this.match(s._const)||!this.isLookaheadContextual("enum"))return a.declare=!0,this.parseVarStatement(a,f||this.value,!0);return this.expect(s._const),this.tsParseEnumDeclaration(a,{const:!0,declare:!0})}if(p===b.interface){let m=this.tsParseInterfaceDeclaration(a,{declare:!0});if(m)return m}if(v(p))return this.tsParseDeclaration(a,this.value,!0)})}tsIsListTerminator(a){switch(a){case"EnumMembers":case"TypeMembers":return this.match(s.braceR);case"HeritageClauseElement":return this.match(s.braceL);case"TupleElementTypes":return this.match(s.bracketR);case"TypeParametersOrArguments":return this.tsMatchRightRelational()}}tsParseDelimitedListWorker(a,p,f,m){let E=[],S=-1;for(;;){if(this.tsIsListTerminator(a))break;S=-1;let k=p();if(k==null)return;if(E.push(k),this.eat(s.comma)){S=this.lastTokStart;continue}if(this.tsIsListTerminator(a))break;if(f)this.expect(s.comma);return}if(m)m.value=S;return E}tsParseDelimitedList(a,p,f){return Yd(this.tsParseDelimitedListWorker(a,p,!0,f))}tsParseBracketedList(a,p,f,m,E){if(!m)if(f)this.expect(s.bracketL);else this.expect(s.relational);let S=this.tsParseDelimitedList(a,p,E);if(f)this.expect(s.bracketR);else this.expect(s.relational);return S}tsParseTypeParameterName(){return this.parseIdent().name}tsEatThenParseType(a){return!this.match(a)?void 0:this.tsNextThenParseType()}tsExpectThenParseType(a){return this.tsDoThenParseType(()=>this.expect(a))}tsNextThenParseType(){return this.tsDoThenParseType(()=>this.next())}tsDoThenParseType(a){return this.tsInType(()=>(a(),this.tsParseType()))}tsSkipParameterStart(){if(v(this.type)||this.match(s._this))return this.next(),!0;if(this.match(s.braceL))try{return this.parseObj(!0),!0}catch{return!1}if(this.match(s.bracketL)){this.next();try{return this.parseBindingList(s.bracketR,!0,!0),!0}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){if(this.next(),this.match(s.parenR)||this.match(s.ellipsis))return!0;if(this.tsSkipParameterStart()){if(this.match(s.colon)||this.match(s.comma)||this.match(s.question)||this.match(s.eq))return!0;if(this.match(s.parenR)){if(this.next(),this.match(s.arrow))return!0}}return!1}tsIsStartOfFunctionType(){if(this.tsMatchLeftRelational())return!0;return this.match(s.parenL)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsInAllowConditionalTypesContext(a){let p=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!1;try{return a()}finally{this.inDisallowConditionalTypesContext=p}}tsParseBindingListForSignature(){return super.parseBindingList(s.parenR,!0,!0).map((a)=>{if(a.type!=="Identifier"&&a.type!=="RestElement"&&a.type!=="ObjectPattern"&&a.type!=="ArrayPattern")this.raise(a.start,F.UnsupportedSignatureParameterKind({type:a.type}));return a})}tsParseTypePredicateAsserts(){if(this.type!==b.asserts)return!1;let a=this.containsEsc;if(this.next(),!v(this.type)&&!this.match(s._this))return!1;if(a)this.raise(this.lastTokStart,"Escape sequence in keyword asserts");return!0}tsParseThisTypeNode(){let a=this.startNode();return this.next(),this.finishNode(a,"TSThisType")}tsParseTypeAnnotation(a=!0,p=this.startNode()){return this.tsInType(()=>{if(a)this.expect(s.colon);p.typeAnnotation=this.tsParseType()}),this.finishNode(p,"TSTypeAnnotation")}tsParseThisTypePredicate(a){this.next();let p=this.startNodeAtNode(a);return p.parameterName=a,p.typeAnnotation=this.tsParseTypeAnnotation(!1),p.asserts=!1,this.finishNode(p,"TSTypePredicate")}tsParseThisTypeOrThisTypePredicate(){let a=this.tsParseThisTypeNode();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.tsParseThisTypePredicate(a);else return a}tsParseTypePredicatePrefix(){let a=this.parseIdent();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.next(),a}tsParseTypeOrTypePredicateAnnotation(a){return this.tsInType(()=>{let p=this.startNode();this.expect(a);let f=this.startNode(),m=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(m){let x=this.tsParseTypeAnnotation(!1);return f.parameterName=m,f.typeAnnotation=x,f.asserts=!1,p.typeAnnotation=this.finishNode(f,"TSTypePredicate"),this.finishNode(p,"TSTypeAnnotation")}let E=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(E&&this.match(s._this)){let x=this.tsParseThisTypeOrThisTypePredicate();if(x.type==="TSThisType")f.parameterName=x,f.asserts=!0,f.typeAnnotation=null,x=this.finishNode(f,"TSTypePredicate");else this.resetStartLocationFromNode(x,f),x.asserts=!0;return p.typeAnnotation=x,this.finishNode(p,"TSTypeAnnotation")}let S=E&&this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!S){if(!E)return this.tsParseTypeAnnotation(!1,p);return f.parameterName=this.parseIdent(),f.asserts=E,f.typeAnnotation=null,p.typeAnnotation=this.finishNode(f,"TSTypePredicate"),this.finishNode(p,"TSTypeAnnotation")}let k=this.tsParseTypeAnnotation(!1);return f.parameterName=S,f.typeAnnotation=k,f.asserts=E,p.typeAnnotation=this.finishNode(f,"TSTypePredicate"),this.finishNode(p,"TSTypeAnnotation")})}tsFillSignature(a,p){let f=a===s.arrow,m="parameters",E="typeAnnotation";if(p.typeParameters=this.tsTryParseTypeParameters(),this.expect(s.parenL),p.parameters=this.tsParseBindingListForSignature(),f)p.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(a);else if(this.match(a))p.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(a)}tsTryNextParseConstantContext(){if(this.lookahead().type!==s._const)return null;this.next();let a=this.tsParseTypeReference();if(a.typeParameters||a.typeArguments)this.raise(a.typeName.start,F.CannotFindName({name:"const"}));return a}tsParseFunctionOrConstructorType(a,p){let f=this.startNode();if(a==="TSConstructorType"){if(f.abstract=!!p,p)this.next();this.next()}return this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(s.arrow,f)),this.finishNode(f,a)}tsParseUnionOrIntersectionType(a,p,f){let m=this.startNode(),E=this.eat(f),S=[];do S.push(p());while(this.eat(f));if(S.length===1&&!E)return S[0];return m.types=S,this.finishNode(m,a)}tsCheckTypeAnnotationForReadOnly(a){switch(a.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(a.start,F.UnexpectedReadonly)}}tsParseTypeOperator(){let a=this.startNode(),p=this.value;if(this.next(),a.operator=p,a.typeAnnotation=this.tsParseTypeOperatorOrHigher(),p==="readonly")this.tsCheckTypeAnnotationForReadOnly(a);return this.finishNode(a,"TSTypeOperator")}tsParseConstraintForInferType(){if(this.eat(s._extends)){let a=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.inDisallowConditionalTypesContext||!this.match(s.question))return a}}tsParseInferType(){let a=this.startNode();this.expectContextual("infer");let p=this.startNode();return p.name=this.tsParseTypeParameterName(),p.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),a.typeParameter=this.finishNode(p,"TSTypeParameter"),this.finishNode(a,"TSInferType")}tsParseLiteralTypeNode(){let a=this.startNode();return a.literal=(()=>{switch(this.type){case s.num:case s.string:case s._true:case s._false:return this.parseExprAtom();default:this.unexpected()}})(),this.finishNode(a,"TSLiteralType")}tsParseImportType(){let a=this.startNode();if(this.expect(s._import),this.expect(s.parenL),!this.match(s.string))this.raise(this.start,F.UnsupportedImportTypeArgument);if(a.argument=this.parseExprAtom(),this.expect(s.parenR),this.eat(s.dot))a.qualifier=this.tsParseEntityName();if(this.tsMatchLeftRelational())a.typeArguments=this.tsParseTypeArguments();return this.finishNode(a,"TSImportType")}tsParseTypeQuery(){let a=this.startNode();if(this.expect(s._typeof),this.match(s._import))a.exprName=this.tsParseImportType();else a.exprName=this.tsParseEntityName();if(!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational())a.typeArguments=this.tsParseTypeArguments();return this.finishNode(a,"TSTypeQuery")}tsParseMappedTypeParameter(){let a=this.startNode();return a.name=this.tsParseTypeParameterName(),a.constraint=this.tsExpectThenParseType(s._in),this.finishNode(a,"TSTypeParameter")}tsParseMappedType(){let a=this.startNode();if(this.expect(s.braceL),this.match(s.plusMin))a.readonly=this.value,this.next(),this.expectContextual("readonly");else if(this.eatContextual("readonly"))a.readonly=!0;if(this.expect(s.bracketL),a.typeParameter=this.tsParseMappedTypeParameter(),a.nameType=this.eatContextual("as")?this.tsParseType():null,this.expect(s.bracketR),this.match(s.plusMin))a.optional=this.value,this.next(),this.expect(s.question);else if(this.eat(s.question))a.optional=!0;return a.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(s.braceR),this.finishNode(a,"TSMappedType")}tsParseTypeLiteral(){let a=this.startNode();return a.members=this.tsParseObjectTypeMembers(),this.finishNode(a,"TSTypeLiteral")}tsIsTupleElementLabel(){if(!w(this.type))return!1;let a=this.lookahead();if(a.type===s.colon)return!0;if(a.type!==s.question)return!1;return this.lookahead(2).type===s.colon}tsParseTupleElementType(){let a=this.startLoc,p=this.start,f=this.eat(s.ellipsis),m;if(this.tsIsTupleElementLabel()){let E=this.startNode();E.label=this.parseIdent(!0),E.optional=this.eat(s.question),this.expect(s.colon),E.elementType=this.tsParseType(),m=this.finishNode(E,"TSNamedTupleMember")}else{m=this.tsParseType();let E=this.eat(s.question);if(this.eat(s.colon))this.raise(m.start,F.InvalidTupleMemberLabel);if(E){let S=this.startNodeAtNode(m);S.typeAnnotation=m,m=this.finishNode(S,"TSOptionalType")}}if(f){let E=this.startNodeAt(p,a);E.typeAnnotation=m,m=this.finishNode(E,"TSRestType")}return m}tsParseTupleType(){let a=this.startNode();a.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let p=!1;return a.elementTypes.forEach((f)=>{let{type:m}=f;if(p&&m!=="TSRestType"&&m!=="TSOptionalType"&&!(m==="TSNamedTupleMember"&&f.optional))this.raise(f.start,F.OptionalTypeBeforeRequired);if(p||=m==="TSNamedTupleMember"&&f.optional||m==="TSOptionalType",m==="TSRestType")f=f.typeAnnotation}),this.finishNode(a,"TSTupleType")}tsParseTemplateLiteralType(){let a=this.startNode();return a.literal=this.parseTemplate({isTagged:!1}),this.finishNode(a,"TSLiteralType")}tsParseTypeReference(){let a=this.startNode();if(a.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational())a.typeArguments=this.tsParseTypeArguments();return this.finishNode(a,"TSTypeReference")}tsMatchLeftRelational(){return this.match(s.relational)&&this.value==="<"}tsMatchRightRelational(){return this.match(s.relational)&&this.value===">"}tsParseParenthesizedType(){let a=this.startNode();return this.expect(s.parenL),a.typeAnnotation=this.tsParseType(),this.expect(s.parenR),this.finishNode(a,"TSParenthesizedType")}tsParseNonArrayType(){switch(this.type){case s.string:case s.num:case s._true:case s._false:return this.tsParseLiteralTypeNode();case s.plusMin:if(this.value==="-"){let a=this.startNode();if(this.lookahead().type!==s.num)this.unexpected();return a.literal=this.parseMaybeUnary(),this.finishNode(a,"TSLiteralType")}break;case s._this:return this.tsParseThisTypeOrThisTypePredicate();case s._typeof:return this.tsParseTypeQuery();case s._import:return this.tsParseImportType();case s.braceL:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case s.bracketL:return this.tsParseTupleType();case s.parenL:return this.tsParseParenthesizedType();case s.backQuote:case s.dollarBraceL:return this.tsParseTemplateLiteralType();default:{let{type:a}=this;if(w(a)||a===s._void||a===s._null){let p=a===s._void?"TSVoidKeyword":a===s._null?"TSNullKeyword":Qd(this.value);if(p!==void 0&&this.lookaheadCharCode()!==46){let f=this.startNode();return this.next(),this.finishNode(f,p)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let a=this.tsParseNonArrayType();while(!this.hasPrecedingLineBreak()&&this.eat(s.bracketL))if(this.match(s.bracketR)){let p=this.startNodeAtNode(a);p.elementType=a,this.expect(s.bracketR),a=this.finishNode(p,"TSArrayType")}else{let p=this.startNodeAtNode(a);p.objectType=a,p.indexType=this.tsParseType(),this.expect(s.bracketR),a=this.finishNode(p,"TSIndexedAccessType")}return a}tsParseTypeOperatorOrHigher(){return M(this.type)&&!this.containsEsc?this.tsParseTypeOperator():this.isContextual("infer")?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),s.bitwiseAND)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),s.bitwiseOR)}tsParseNonConditionalType(){if(this.tsIsStartOfFunctionType())return this.tsParseFunctionOrConstructorType("TSFunctionType");if(this.match(s._new))return this.tsParseFunctionOrConstructorType("TSConstructorType");else if(this.isAbstractConstructorSignature())return this.tsParseFunctionOrConstructorType("TSConstructorType",!0);return this.tsParseUnionTypeOrHigher()}tsParseType(){Mo(this.inType);let a=this.tsParseNonConditionalType();if(this.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(s._extends))return a;let p=this.startNodeAtNode(a);return p.checkType=a,p.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(s.question),p.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(s.colon),p.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(p,"TSConditionalType")}tsIsUnambiguouslyIndexSignature(){if(this.next(),v(this.type))return this.next(),this.match(s.colon);return!1}tsInType(a){let p=this.inType;this.inType=!0;try{return a()}finally{this.inType=p}}tsTryParseIndexSignature(a){if(!(this.match(s.bracketL)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(s.bracketL);let p=this.parseIdent();p.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(p),this.expect(s.bracketR),a.parameters=[p];let f=this.tsTryParseTypeAnnotation();if(f)a.typeAnnotation=f;return this.tsParseTypeMemberSemicolon(),this.finishNode(a,"TSIndexSignature")}tsParseNoneModifiers(a){this.tsParseModifiers({modified:a,allowedModifiers:[],disallowedModifiers:["in","out"],errorTemplate:F.InvalidModifierOnTypeParameterPositions})}tsParseTypeParameter(a=this.tsParseNoneModifiers.bind(this)){let p=this.startNode();return a(p),p.name=this.tsParseTypeParameterName(),p.constraint=this.tsEatThenParseType(s._extends),p.default=this.tsEatThenParseType(s.eq),this.finishNode(p,"TSTypeParameter")}tsParseTypeParameters(a){let p=this.startNode();if(this.tsMatchLeftRelational()||this.matchJsx("jsxTagStart"))this.next();else this.unexpected();let f={value:-1};if(p.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,a),!1,!0,f),p.params.length===0)this.raise(this.start,F.EmptyTypeParameters);if(f.value!==-1)this.addExtra(p,"trailingComma",f.value);return this.finishNode(p,"TSTypeParameterDeclaration")}tsTryParseTypeParameters(a){if(this.tsMatchLeftRelational())return this.tsParseTypeParameters(a)}tsTryParse(a){let p=this.beginParseEffectScope(),f;try{f=a()}catch(m){throw this.parseEffects.rollback(p),m}if(f!==void 0&&f!==!1)return this.parseEffects.commit(p),f;this.parseEffects.rollback(p);return}tsTokenCanFollowModifier(){return(this.match(s.bracketL)||this.match(s.braceL)||this.match(s.star)||this.match(s.ellipsis)||this.match(s.privateId)||this.isLiteralPropertyName())&&!this.hasPrecedingLineBreak()}tsNextTokenCanFollowModifier(){return this.next(!0),this.tsTokenCanFollowModifier()}tsParseModifier(a,p){let f=this.value;if(a.indexOf(f)!==-1&&!this.containsEsc){if(p&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return f}return}tsParseModifiersByMap({modified:a,map:p}){for(let f of Object.keys(p))a[f]=p[f]}tsParseModifiers({modified:a,allowedModifiers:p,disallowedModifiers:f,stopOnStartOfClassStaticBlock:m,errorTemplate:E=F.InvalidModifierOnTypeMember}){let S={},k=(C,T,L,_)=>{if(T===L&&a[_])this.raise(C.column,F.InvalidModifiersOrder({orderedModifiers:[L,_]}))},x=(C,T,L,_)=>{if(a[L]&&T===_||a[_]&&T===L)this.raise(C.column,F.IncompatibleModifiers({modifiers:[L,_]}))};for(;;){let C=this.startLoc,T=this.tsParseModifier(p.concat(f??[]),m);if(!T)break;if(Bo(T))if(a.accessibility)this.raise(this.start,F.DuplicateAccessibilityModifier());else k(C,T,T,"override"),k(C,T,T,"static"),k(C,T,T,"readonly"),k(C,T,T,"accessor"),S.accessibility=T,a.accessibility=T;else if(Wd(T))if(a[T])this.raise(this.start,F.DuplicateModifier({modifier:T}));else k(C,T,"in","out"),S[T]=T,a[T]=!0;else if(Gd(T))if(a[T])this.raise(this.start,F.DuplicateModifier({modifier:T}));else x(C,T,"accessor","readonly"),x(C,T,"accessor","override"),S[T]=T,a[T]=!0;else if(T==="const")if(a[T])this.raise(this.start,F.DuplicateModifier({modifier:T}));else S[T]=T,a[T]=!0;else if(Object.hasOwnProperty.call(a,T))this.raise(this.start,F.DuplicateModifier({modifier:T}));else k(C,T,"static","readonly"),k(C,T,"static","override"),k(C,T,"override","readonly"),k(C,T,"abstract","override"),x(C,T,"declare","override"),x(C,T,"static","abstract"),S[T]=T,a[T]=!0;if(f?.includes(T))this.raise(this.start,E)}return S}tsParseInOutModifiers(a){this.tsParseModifiers({modified:a,allowedModifiers:["in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:F.InvalidModifierOnTypeParameter})}tsParseClassTypeParameterModifiers(a){this.tsParseModifiers({modified:a,allowedModifiers:["const","in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:F.InvalidModifierOnTypeParameter})}parseMaybeUnary(a,p,f,m){if(!e?.jsx&&this.tsMatchLeftRelational())return this.tsParseTypeAssertion();else return super.parseMaybeUnary(a,p,f,m)}tsParseTypeAssertion(){if(n)this.raise(this.start,F.ReservedTypeAssertion);let a=this.tryParse(()=>{let p=this.startNode(),f=this.tsTryNextParseConstantContext();return p.typeAnnotation=f||this.tsNextThenParseType(),this.expect(s.relational),p.expression=this.parseMaybeUnary(),this.finishNode(p,"TSTypeAssertion")});if(a.error)return this.tsParseTypeParameters(this.tsParseConstModifier);else return a.node}tsParseTypeArguments(a=!1){let p=this.startNode();if(p.params=this.tsInType(()=>this.tsInNoContext(()=>(this.expect(s.relational),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),p.params.length===0)this.raise(this.start,F.EmptyTypeArguments);if(a&&this.curContext()!==P.tc_oTag)this.reScan_lt_gt();if(!this.tsMatchRightRelational())this.unexpected();return this.exprAllowed=!1,this.next(),this.finishNode(p,"TSTypeParameterInstantiation")}tsParseHeritageClause(a){let p=this.start,f=this.tsParseDelimitedList("HeritageClauseElement",()=>{let m=this.startNode();if(m.expression=this.tsParseEntityName(),this.tsMatchLeftRelational())m.typeParameters=this.tsParseTypeArguments();return this.finishNode(m,"TSExpressionWithTypeArguments")});if(!f.length)this.raise(p,F.EmptyHeritageClauseType({token:a}));return f}tsParseTypeMemberSemicolon(){if(!this.eat(s.comma)&&!this.isLineTerminator())this.expect(s.semi)}tsTryParseAndCatch(a){let p=this.tryParse((f)=>a()||f());if(p.aborted||!p.node)return;return p.node}tsParseSignatureMember(a,p){return this.tsFillSignature(s.colon,p),this.tsParseTypeMemberSemicolon(),this.finishNode(p,a)}tsParsePropertyOrMethodSignature(a,p){if(this.eat(s.question))a.optional=!0;let f=a;if(this.match(s.parenL)||this.tsMatchLeftRelational()){if(p)this.raise(a.start,F.ReadonlyForMethodSignature);let m=f;if(m.kind&&this.tsMatchLeftRelational())this.raise(this.start,F.AccesorCannotHaveTypeParameters);this.tsFillSignature(s.colon,m),this.tsParseTypeMemberSemicolon();let E="parameters",S="typeAnnotation";if(m.kind==="get"){if(m[E].length>0){if(this.raise(this.start,"A 'get' accesor must not have any formal parameters."),this.isThisParam(m[E][0]))this.raise(this.start,F.AccesorCannotDeclareThisParameter)}}else if(m.kind==="set"){if(m[E].length!==1)this.raise(this.start,"A 'get' accesor must not have any formal parameters.");else{let k=m[E][0];if(this.isThisParam(k))this.raise(this.start,F.AccesorCannotDeclareThisParameter);if(k.type==="Identifier"&&k.optional)this.raise(this.start,F.SetAccesorCannotHaveOptionalParameter);if(k.type==="RestElement")this.raise(this.start,F.SetAccesorCannotHaveRestParameter)}if(m[S])this.raise(m[S].start,F.SetAccesorCannotHaveReturnType)}else m.kind="method";return this.finishNode(m,"TSMethodSignature")}else{let m=f;if(p)m.readonly=!0;let E=this.tsTryParseTypeAnnotation();if(E)m.typeAnnotation=E;return this.tsParseTypeMemberSemicolon(),this.finishNode(m,"TSPropertySignature")}}tsParseTypeMember(){let a=this.startNode();if(this.match(s.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSCallSignatureDeclaration",a);if(this.match(s._new)){let f=this.startNode();if(this.next(),this.match(s.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSConstructSignatureDeclaration",a);else return a.key=this.createIdentifier(f,"new"),this.tsParsePropertyOrMethodSignature(a,!1)}this.tsParseModifiers({modified:a,allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]});let p=this.tsTryParseIndexSignature(a);if(p)return p;if(this.parsePropertyName(a),!a.computed&&a.key.type==="Identifier"&&(a.key.name==="get"||a.key.name==="set")&&this.tsTokenCanFollowModifier())a.kind=a.key.name,this.parsePropertyName(a);return this.tsParsePropertyOrMethodSignature(a,!!a.readonly)}tsParseList(a,p){let f=[];while(!this.tsIsListTerminator(a))f.push(p());return f}tsParseObjectTypeMembers(){this.expect(s.braceL);let a=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(s.braceR),a}tsParseInterfaceDeclaration(a,p={}){if(this.hasFollowingLineBreak())return null;if(this.expectContextual("interface"),p.declare)a.declare=!0;if(v(this.type)){a.id=this.parseIdent(),this.checkLValSimple(a.id,ne.BIND_TS_INTERFACE);let m=this.currentScope();this.maybeExportDefined(m,a.id.name)}else a.id=null,this.raise(this.start,F.MissingInterfaceName);if(a.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.eat(s._extends))a.extends=this.tsParseHeritageClause("extends");let f=this.startNode();return f.body=this.tsParseInterfaceBody(),a.body=this.finishNode(f,"TSInterfaceBody"),this.finishNode(a,"TSInterfaceDeclaration")}tsParseInterfaceBody(){this.expect(s.braceL);let a=this.inType;this.inType=!0;let p=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.inType=a,this.expect(s.braceR),p}tsParseAbstractDeclaration(a){if(this.match(s._class))return a.abstract=!0,this.parseClass(a,!0);else if(this.ts_isContextual(b.interface)){if(!this.hasFollowingLineBreak())return a.abstract=!0,this.tsParseInterfaceDeclaration(a)}else this.unexpected(a.start)}tsIsDeclarationStart(){return U(this.type)}tsParseExpressionStatement(a,p){switch(p.name){case"declare":{let f=this.tsTryParseDeclare(a);if(f)return f.declare=!0,f;break}case"global":if(this.match(s.braceL)){this.enterScope(Nn);let f=a;return f.global=!0,f.id=p,f.body=this.tsParseModuleBlock(),super.exitScope(),this.finishNode(f,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(a,p.name,!1)}}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsIsExportDefaultSpecifier(){let{type:a}=this,p=this.isAsyncFunction(),f=this.isLet();if(v(a)){if(p&&!this.containsEsc||f)return!1;if((a===b.type||a===b.interface)&&!this.containsEsc){let S=this.lookahead();if(v(S.type)&&!this.isContextualWithState("from",S)||S.type===s.braceL)return!1}}else if(!this.match(s._default))return!1;let m=this.nextTokenStart(),E=this.isUnparsedContextual(m,"from");if(this.input.charCodeAt(m)===44||v(this.type)&&E)return!0;if(this.match(s._default)&&E){let S=this.input.charCodeAt(this.nextTokenStartSince(m+4));return S===34||S===39}return!1}tsInAmbientContext(a){let p=this.isAmbientContext;this.isAmbientContext=!0;try{return a()}finally{this.isAmbientContext=p}}tsCheckLineTerminator(a){if(a){if(this.hasFollowingLineBreak())return!1;return this.next(),!0}return!this.isLineTerminator()}tsParseModuleOrNamespaceDeclaration(a,p=!1){if(a.id=this.parseIdent(),!p)this.checkLValSimple(a.id,ne.BIND_TS_NAMESPACE);if(this.eat(s.dot)){let f=this.startNode();this.tsParseModuleOrNamespaceDeclaration(f,!0),a.body=f}else this.enterScope(Nn),a.body=this.tsParseModuleBlock(),super.exitScope();return this.finishNode(a,"TSModuleDeclaration")}checkLValSimple(a,p=ne.BIND_NONE,f){while(a.type==="TSNonNullExpression"||a.type==="TSAsExpression"||a.type==="TSSatisfiesExpression"||a.type==="TSTypeAssertion")a=a.expression;return super.checkLValSimple(a,p,f)}isSimpleAssignTarget(a){while(a.type==="TSNonNullExpression"||a.type==="TSAsExpression"||a.type==="TSSatisfiesExpression"||a.type==="TSTypeAssertion")a=a.expression;return super.isSimpleAssignTarget(a)}tsParseTypeAliasDeclaration(a){a.id=this.parseIdent(),this.checkLValSimple(a.id,ne.BIND_TS_TYPE);let p=this.currentScope();return this.maybeExportDefined(p,a.id.name),a.typeAnnotation=this.tsInType(()=>{if(a.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.expect(s.eq),this.ts_isContextual(b.interface)&&this.lookahead().type!==s.dot){let f=this.startNode();return this.next(),this.finishNode(f,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(a,"TSTypeAliasDeclaration")}tsParseDeclaration(a,p,f){switch(p){case"abstract":if(this.tsCheckLineTerminator(f)&&(this.match(s._class)||v(this.type)))return this.tsParseAbstractDeclaration(a);break;case"module":if(this.tsCheckLineTerminator(f)){if(this.match(s.string))return this.tsParseAmbientExternalModuleDeclaration(a);else if(v(this.type))return this.tsParseModuleOrNamespaceDeclaration(a)}break;case"namespace":if(this.tsCheckLineTerminator(f)&&v(this.type))return this.tsParseModuleOrNamespaceDeclaration(a);break;case"type":if(this.tsCheckLineTerminator(f)&&v(this.type))return this.tsParseTypeAliasDeclaration(a);break}}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.value,!0)}tsParseImportEqualsDeclaration(a,p){a.isExport=p||!1,a.id=this.parseIdent(),this.checkLValSimple(a.id,ne.BIND_LEXICAL),super.expect(s.eq);let f=this.tsParseModuleReference();if(a.importKind==="type"&&f.type!=="TSExternalModuleReference")this.raise(f.start,F.ImportAliasHasImportType);return a.moduleReference=f,super.semicolon(),this.finishNode(a,"TSImportEqualsDeclaration")}isExportDefaultSpecifier(){if(this.tsIsDeclarationStart())return!1;let{type:a}=this;if(v(a)){if(this.isContextual("async")||this.isContextual("let"))return!1;if((a===b.type||a===b.interface)&&!this.containsEsc){let m=this.lookahead();if(v(m.type)&&!this.isContextualWithState("from",m)||m.type===s.braceL)return!1}}else if(!this.match(s._default))return!1;let p=this.nextTokenStart(),f=this.isUnparsedContextual(p,"from");if(this.input.charCodeAt(p)===44||v(this.type)&&f)return!0;if(this.match(s._default)&&f){let m=this.input.charCodeAt(this.nextTokenStartSince(p+4));return m===34||m===39}return!1}parseTemplate({isTagged:a=!1}={}){let p=this.startNode();this.next(),p.expressions=[];let f=this.parseTemplateElement({isTagged:a});p.quasis=[f];while(!f.tail){if(this.type===s.eof)this.raise(this.pos,"Unterminated template literal");this.expect(s.dollarBraceL),p.expressions.push(this.inType?this.tsParseType():this.parseExpression()),this.expect(s.braceR),p.quasis.push(f=this.parseTemplateElement({isTagged:a}))}return this.next(),this.finishNode(p,"TemplateLiteral")}parseFunction(a,p,f,m,E){if(this.initFunction(a),this.ecmaVersion>=9||this.ecmaVersion>=6&&!m){if(this.type===s.star&&p&Oo)this.unexpected();a.generator=this.eat(s.star)}if(this.ecmaVersion>=8)a.async=!!m;if(p&lr)a.id=p&Kd&&this.type!==s.name?null:this.parseIdent();let S=this.yieldPos,k=this.awaitPos,x=this.awaitIdentPos,C=this.maybeInArrowParameters;if(this.maybeInArrowParameters=!1,this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ni(a.async,a.generator)),!(p&lr))a.id=this.type===s.name?this.parseIdent():null;this.parseFunctionParams(a);let T=p&lr;if(this.parseFunctionBody(a,f,!1,E,{isFunctionDeclaration:T}),T&&this.isAmbientContext&&a.id){if(this.currentScope().flags&ne.SCOPE_TOP)this.declareName(a.id.name,ne.BIND_FLAGS_TS_EXPORT_ONLY,a.id.start)}if(this.yieldPos=S,this.awaitPos=k,this.awaitIdentPos=x,p&lr&&a.id&&!(p&Oo))if(a.body)this.checkLValSimple(a.id,this.strict||a.generator||a.async?this.treatFunctionsAsVar?ne.BIND_VAR:ne.BIND_LEXICAL:ne.BIND_FUNCTION);else this.checkLValSimple(a.id,ne.BIND_NONE);return this.maybeInArrowParameters=C,this.finishNode(a,T?"FunctionDeclaration":"FunctionExpression")}parseFunctionBody(a,p=!1,f=!1,m=!1,E){if(this.match(s.colon))a.returnType=this.tsParseTypeOrTypePredicateAnnotation(s.colon);let S=E?.isFunctionDeclaration?"TSDeclareFunction":E?.isClassMethod?"TSDeclareMethod":void 0;if(S&&!this.match(s.braceL)&&this.isLineTerminator())return this.exitScope(),this.finishNode(a,S);if(S==="TSDeclareFunction"&&this.isAmbientContext){if(this.raise(a.start,F.DeclareFunctionHasImplementation),a.declare)return super.parseFunctionBody(a,p,f,!1),this.finishNode(a,S)}return super.parseFunctionBody(a,p,f,m),a}parseNew(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");let a=this.startNode(),p=this.parseIdent(!0);if(this.ecmaVersion>=6&&this.eat(s.dot)){a.meta=p;let k=this.containsEsc;if(a.property=this.parseIdent(!0),a.property.name!=="target")this.raiseRecoverable(a.property.start,"The only valid meta property for new is 'new.target'");if(k)this.raiseRecoverable(a.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(a.start,"'new.target' can only be used in functions and class static block");return this.finishNode(a,"MetaProperty")}let f=this.start,m=this.startLoc,E=this.type===s._import;if(a.callee=this.parseSubscripts(this.parseExprAtom(),f,m,!0,!1),E&&a.callee.type==="ImportExpression")this.raise(f,"Cannot use new with import()");let{callee:S}=a;if(S.type==="TSInstantiationExpression"&&!S.extra?.parenthesized)a.typeArguments=S.typeArguments,a.callee=S.expression;if(this.eat(s.parenL))a.arguments=this.parseExprList(s.parenR,this.ecmaVersion>=8,!1);else a.arguments=[];return this.finishNode(a,"NewExpression")}parseExprOp(a,p,f,m,E){if(s._in.binop>m&&!this.hasPrecedingLineBreak()){let S;if(this.isContextual("as"))S="TSAsExpression";if(this.isContextual("satisfies"))S="TSSatisfiesExpression";if(S){let k=this.startNodeAt(p,f);k.expression=a;let x=this.tsTryNextParseConstantContext();if(x)k.typeAnnotation=x;else k.typeAnnotation=this.tsNextThenParseType();return this.finishNode(k,S),this.reScan_lt_gt(),this.parseExprOp(k,p,f,m,E)}}return super.parseExprOp(a,p,f,m,E)}parseImportSpecifiers(){let a=[],p=!0;if(o.tokenIsIdentifier(this.type)){if(a.push(this.parseImportDefaultSpecifier()),!this.eat(s.comma))return a}if(this.type===s.star)return a.push(this.parseImportNamespaceSpecifier()),a;this.expect(s.braceL);while(!this.eat(s.braceR)){if(!p){if(this.expect(s.comma),this.afterTrailingComma(s.braceR))break}else p=!1;a.push(this.parseImportSpecifier())}return a}parseImport(a){let p=this.lookahead();if(a.importKind="value",this.importOrExportOuterKind="value",v(p.type)||this.match(s.star)||this.match(s.braceL)){let f=this.lookahead(2);if(f.type!==s.comma&&!this.isContextualWithState("from",f)&&f.type!==s.eq&&this.ts_eatContextualWithState("type",1,p))this.importOrExportOuterKind="type",a.importKind="type",p=this.lookahead(),f=this.lookahead(2);if(v(p.type)&&f.type===s.eq){this.next();let m=this.tsParseImportEqualsDeclaration(a);return this.importOrExportOuterKind="value",m}}if(this.next(),this.type===s.string)a.specifiers=[],a.source=this.parseExprAtom();else a.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),a.source=this.type===s.string?this.parseExprAtom():this.unexpected();if(this.parseMaybeImportAttributes(a),this.semicolon(),this.finishNode(a,"ImportDeclaration"),this.importOrExportOuterKind="value",a.importKind==="type"&&a.specifiers.length>1&&a.specifiers[0].type==="ImportDefaultSpecifier")this.raise(a.start,F.TypeImportCannotSpecifyDefaultAndNamed);return a}parseExportDefaultDeclaration(){if(this.isAbstractClass()){let a=this.startNode();return this.next(),a.abstract=!0,this.parseClass(a,!0)}if(this.match(b.interface)){let a=this.tsParseInterfaceDeclaration(this.startNode());if(a)return a}return super.parseExportDefaultDeclaration()}parseExportAllDeclaration(a,p){if(this.ecmaVersion>=11)if(this.eatContextual("as"))a.exported=this.parseModuleExportName(),this.checkExport(p,a.exported,this.lastTokStart);else a.exported=null;if(this.expectContextual("from"),this.type!==s.string)this.unexpected();return a.source=this.parseExprAtom(),this.parseMaybeImportAttributes(a),this.semicolon(),this.finishNode(a,"ExportAllDeclaration")}parseDynamicImport(a){if(this.next(),a.source=this.parseMaybeAssign(),this.eat(s.comma)){let p=this.parseExpression();a.arguments=[p]}if(!this.eat(s.parenR)){let p=this.start;if(this.eat(s.comma)&&this.eat(s.parenR))this.raiseRecoverable(p,"Trailing comma is not allowed in import()");else this.unexpected(p)}return this.finishNode(a,"ImportExpression")}parseExport(a,p){let f=this.lookahead();if(this.ts_eatWithState(s._import,2,f)){if(this.ts_isContextual(b.type)&&this.lookaheadCharCode()!==61)a.importKind="type",this.importOrExportOuterKind="type",this.next();else a.importKind="value",this.importOrExportOuterKind="value";let m=this.tsParseImportEqualsDeclaration(a,!0);return this.importOrExportOuterKind=void 0,m}else if(this.ts_eatWithState(s.eq,2,f)){let m=a;return m.expression=this.parseExpression(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(m,"TSExportAssignment")}else if(this.ts_eatContextualWithState("as",2,f)){let m=a;return this.expectContextual("namespace"),m.id=this.parseIdent(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(m,"TSNamespaceExportDeclaration")}else{let m=this.lookahead(2).type;if(this.ts_isContextualWithState(f,b.type)&&(m===s.braceL||m===s.star))this.next(),this.importOrExportOuterKind="type",a.exportKind="type";else this.importOrExportOuterKind="value",a.exportKind="value";if(this.next(),this.eat(s.star))return this.parseExportAllDeclaration(a,p);if(this.eat(s._default))return this.checkExport(p,"default",this.lastTokStart),a.declaration=this.parseExportDefaultDeclaration(),this.finishNode(a,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(a.declaration=this.parseExportDeclaration(a),a.declaration.type==="VariableDeclaration")this.checkVariableExport(p,a.declaration.declarations);else this.checkExport(p,a.declaration.id,a.declaration.id.start);a.specifiers=[],a.source=null}else{if(a.declaration=null,a.specifiers=this.parseExportSpecifiers(p),this.eatContextual("from")){if(this.type!==s.string)this.unexpected();a.source=this.parseExprAtom(),this.parseMaybeImportAttributes(a)}else{for(let E of a.specifiers)if(this.checkUnreserved(E.local),this.checkLocalExport(E.local),E.local.type==="Literal")this.raise(E.local.start,"A string literal cannot be used as an exported binding without `from`.");a.source=null}this.semicolon()}return this.finishNode(a,"ExportNamedDeclaration")}}checkExport(a,p,f){if(!a)return;if(typeof p!=="string")p=p.type==="Identifier"?p.name:p.value;a[p]=!0}parseMaybeDefault(a,p,f){let m=super.parseMaybeDefault(a,p,f);if(m.type==="AssignmentPattern"&&m.typeAnnotation&&m.right.start<m.typeAnnotation.start)this.raise(m.typeAnnotation.start,F.TypeAnnotationAfterAssign);return m}typeCastToParameter(a){return a.expression.typeAnnotation=a.typeAnnotation,this.resetEndLocation(a.expression,a.typeAnnotation.end,a.typeAnnotation.loc?.end),a.expression}toAssignableList(a,p){if(!a)a=[];for(let f=0;f<a.length;f++){let m=a[f];if(m?.type==="TSTypeCastExpression")a[f]=this.typeCastToParameter(m)}return super.toAssignableList(a,p)}reportReservedArrowTypeParam(a){if(a.params.length===1&&!a.extra?.trailingComma&&n)this.raise(a.start,F.ReservedArrowTypeParam)}parseExprAtom(a,p,f){if(this.type===b.jsxText)return this.jsx_parseText();else if(this.type===b.jsxTagStart)return this.jsx_parseElement();else if(this.type===b.at)return this.parseDecorators(),this.parseExprAtom();else if(v(this.type)){let m=this.potentialArrowAt===this.start,E=this.start,S=this.startLoc,k=this.containsEsc,x=this.parseIdent(!1);if(this.ecmaVersion>=8&&!k&&x.name==="async"&&!this.canInsertSemicolon()&&this.eat(s._function))return this.overrideContext(y.f_expr),this.parseFunction(this.startNodeAt(E,S),0,!1,!0,p);if(m&&!this.canInsertSemicolon()){if(this.eat(s.arrow))return this.parseArrowExpression(this.startNodeAt(E,S),[x],!1,p);if(this.ecmaVersion>=8&&x.name==="async"&&this.type===s.name&&!k&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(x=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(s.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(E,S),[x],!0,p)}}return x}else return super.parseExprAtom(a,p,f)}parseExprAtomDefault(){if(v(this.type)){let a=this.potentialArrowAt===this.start,p=this.containsEsc,f=this.parseIdent();if(!p&&f.name==="async"&&!this.canInsertSemicolon()){let{type:m}=this;if(m===s._function)return this.next(),this.parseFunction(this.startNodeAtNode(f),void 0,!0,!0);else if(v(m))if(this.lookaheadCharCode()===61){let E=this.parseIdent(!1);if(this.canInsertSemicolon()||!this.eat(s.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAtNode(f),[E],!0)}else return f}if(a&&this.match(s.arrow)&&!this.canInsertSemicolon())return this.next(),this.parseArrowExpression(this.startNodeAtNode(f),[f],!1);return f}else this.unexpected()}parseIdentNode(){let a=this.startNode();if(w(this.type)&&!((this.type.keyword==="class"||this.type.keyword==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)))a.name=this.value;else return super.parseIdentNode();return a}parseVarStatement(a,p,f=!1){let{isAmbientContext:m}=this;this.next(),super.parseVar(a,!1,p,f||m),this.semicolon();let E=this.finishNode(a,"VariableDeclaration");if(!m)return E;for(let{id:S,init:k}of E.declarations){if(!k)continue;if(p!=="const"||!!S.typeAnnotation)this.raise(k.start,F.InitializerNotAllowedInAmbientContext);else if(k.type!=="Literal"&&(k.type!=="TemplateLiteral"||k.expressions.length>0)&&!Jd(k)&&!zd(k))this.raise(k.start,F.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference)}return E}parseStatement(a,p,f){if(this.match(b.at))this.parseDecorators(!0);if(this.match(s._const)&&this.isLookaheadContextual("enum")){let m=this.startNode();return this.expect(s._const),this.tsParseEnumDeclaration(m,{const:!0})}if(this.ts_isContextual(b.enum))return this.tsParseEnumDeclaration(this.startNode());if(this.ts_isContextual(b.interface)){let m=this.tsParseInterfaceDeclaration(this.startNode());if(m)return m}return super.parseStatement(a,p,f)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}parsePostMemberNameModifiers(a){if(this.eat(s.question))a.optional=!0;if(a.readonly&&this.match(s.parenL))this.raise(a.start,F.ClassMethodHasReadonly);if(a.declare&&this.match(s.parenL))this.raise(a.start,F.ClassMethodHasDeclare)}parseExpressionStatement(a,p){return(p.type==="Identifier"?this.tsParseExpressionStatement(a,p):void 0)||super.parseExpressionStatement(a,p)}shouldParseExportStatement(){if(this.tsIsDeclarationStart())return!0;if(this.match(b.at))return!0;return super.shouldParseExportStatement()}parseConditional(a,p,f,m,E){if(this.eat(s.question)){let S=this.startNodeAt(p,f);return S.test=a,S.consequent=this.parseMaybeAssign(),this.expect(s.colon),S.alternate=this.parseMaybeAssign(m),this.finishNode(S,"ConditionalExpression")}return a}parseMaybeConditional(a,p){let f=this.start,m=this.startLoc,E=this.parseExprOps(a,p);if(this.checkExpressionErrors(p))return E;if(!this.maybeInArrowParameters||!this.match(s.question))return this.parseConditional(E,f,m,a,p);let S=this.tryParse(()=>this.parseConditional(E,f,m,a,p));if(!S.node){if(S.error)this.setOptionalParametersError(p,S.error);return E}return S.node}parseParenItem(a){let p=this.start,f=this.startLoc;if(a=super.parseParenItem(a),this.eat(s.question))a.optional=!0,this.resetEndLocation(a);if(this.match(s.colon)){let m=this.startNodeAt(p,f);return m.expression=a,m.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(m,"TSTypeCastExpression")}return a}parseExportDeclaration(a){if(!this.isAmbientContext&&this.ts_isContextual(b.declare))return this.tsInAmbientContext(()=>this.parseExportDeclaration(a));let p=this.start,f=this.startLoc,m=this.eatContextual("declare");if(m&&(this.ts_isContextual(b.declare)||!this.shouldParseExportStatement()))this.raise(this.start,F.ExpectedAmbientAfterExportDeclare);let S=v(this.type)&&this.tsTryParseExportDeclaration()||this.parseStatement(null);if(!S)return null;if(S.type==="TSInterfaceDeclaration"||S.type==="TSTypeAliasDeclaration"||m)a.exportKind="type";if(m)this.resetStartLocation(S,p,f),S.declare=!0;return S}parseClassId(a,p){if(!p&&this.isContextual("implements"))return;super.parseClassId(a,p);let f=this.tsTryParseTypeParameters(this.tsParseClassTypeParameterModifiers.bind(this));if(f)a.typeParameters=f}parseClassPropertyAnnotation(a){if(!a.optional){if(this.value==="!"&&this.eat(s.prefix))a.definite=!0;else if(this.eat(s.question))a.optional=!0}let p=this.tsTryParseTypeAnnotation();if(p)a.typeAnnotation=p}parseClassField(a){if(a.key.type==="PrivateIdentifier"){if(a.abstract)this.raise(a.start,F.PrivateElementHasAbstract);if(a.accessibility)this.raise(a.start,F.PrivateElementHasAccessibility({modifier:a.accessibility}));this.parseClassPropertyAnnotation(a)}else{if(this.parseClassPropertyAnnotation(a),this.isAmbientContext&&!(a.readonly&&!a.typeAnnotation)&&this.match(s.eq))this.raise(this.start,F.DeclareClassFieldHasInitializer);if(a.abstract&&this.match(s.eq)){let{key:f}=a;this.raise(this.start,F.AbstractPropertyHasInitializer({propertyName:f.type==="Identifier"&&!a.computed?f.name:`[${this.input.slice(f.start,f.end)}]`}))}}return super.parseClassField(a)}parseClassMethod(a,p,f,m){let E=a.kind==="constructor",S=a.key.type==="PrivateIdentifier",k=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(S){if(k)a.typeParameters=k;if(a.accessibility)this.raise(a.start,F.PrivateMethodsHasAccessibility({modifier:a.accessibility}))}else if(k&&E)this.raise(k.start,F.ConstructorHasTypeParameters);let{declare:x=!1,kind:C}=a;if(x&&(C==="get"||C==="set"))this.raise(a.start,F.DeclareAccessor({kind:C}));if(k)a.typeParameters=k;let T=a.key;if(a.kind==="constructor"){if(p)this.raise(T.start,"Constructor can't be a generator");if(f)this.raise(T.start,"Constructor can't be an async method")}else if(a.static&&Io(a,"prototype"))this.raise(T.start,"Classes may not have a static property named prototype");let L=a.value=this.parseMethod(p,f,m,!0,a);if(a.kind==="get"&&L.params.length!==0)this.raiseRecoverable(L.start,"getter should have no params");if(a.kind==="set"&&L.params.length!==1)this.raiseRecoverable(L.start,"setter should have exactly one param");if(a.kind==="set"&&L.params[0].type==="RestElement")this.raiseRecoverable(L.params[0].start,"Setter cannot use rest params");return this.finishNode(a,"MethodDefinition")}isClassMethod(){return this.match(s.relational)}parseClassElement(a){if(this.eat(s.semi))return null;let p=this.startNode(),f="",m=!1,E=!1,S="method",k=!1,x=["declare","private","public","protected","accessor","override","abstract","readonly","static"],C=this.tsParseModifiers({modified:p,allowedModifiers:x,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:F.InvalidModifierOnTypeParameterPositions});k=Boolean(C.static);let T=()=>{if(this.tsIsStartOfStaticBlocks()){if(this.next(),this.next(),this.tsHasSomeModifiers(p,x))this.raise(this.start,F.StaticBlockCannotHaveModifier);if(this.ecmaVersion>=13)return super.parseClassStaticBlock(p),p}else{let L=this.tsTryParseIndexSignature(p);if(L){if(p.abstract)this.raise(p.start,F.IndexSignatureHasAbstract);if(p.accessibility)this.raise(p.start,F.IndexSignatureHasAccessibility({modifier:p.accessibility}));if(p.declare)this.raise(p.start,F.IndexSignatureHasDeclare);if(p.override)this.raise(p.start,F.IndexSignatureHasOverride);return L}if(!this.inAbstractClass&&p.abstract)this.raise(p.start,F.NonAbstractClassHasAbstractMethod);if(p.override){if(!a)this.raise(p.start,F.OverrideNotInSubClass)}if(p.static=k,k){if(!(this.isClassElementNameStart()||this.type===s.star))f="static"}if(!f&&this.ecmaVersion>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===s.star)&&!this.canInsertSemicolon())E=!0;else f="async";if(!f&&(this.ecmaVersion>=9||!E)&&this.eat(s.star))m=!0;if(!f&&!E&&!m){let _=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())S=_;else f=_}if(f)p.computed=!1,p.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),p.key.name=f,this.finishNode(p.key,"Identifier");else this.parseClassElementName(p);if(this.parsePostMemberNameModifiers(p),this.isClassMethod()||this.ecmaVersion<13||this.type===s.parenL||S!=="method"||m||E){let _=!p.static&&Io(p,"constructor"),A=_&&a;if(_&&S!=="method")this.raise(p.key.start,"Constructor can't have get/set modifier");p.kind=_?"constructor":S,this.parseClassMethod(p,m,E,A)}else this.parseClassField(p);return p}};if(p.declare)this.tsInAmbientContext(T);else T();return p}isClassElementNameStart(){if(this.tsIsIdentifier())return!0;return super.isClassElementNameStart()}parseClassSuper(a){if(super.parseClassSuper(a),a.superClass&&(this.tsMatchLeftRelational()||this.match(s.bitShift)))a.superTypeParameters=this.tsParseTypeArgumentsInExpression();if(this.eatContextual("implements"))a.implements=this.tsParseHeritageClause("implements")}parseFunctionParams(a){let p=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(p)a.typeParameters=p;super.parseFunctionParams(a)}parseVarId(a,p){if(super.parseVarId(a,p),a.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.value==="!"&&this.eat(s.prefix))a.definite=!0;let f=this.tsTryParseTypeAnnotation();if(f)a.id.typeAnnotation=f,this.resetEndLocation(a.id)}parseArrowExpression(a,p,f,m){if(this.match(s.colon))a.returnType=this.tsParseTypeAnnotation();let E=this.yieldPos,S=this.awaitPos,k=this.awaitIdentPos;this.enterScope(Ni(f,!1)|ne.SCOPE_ARROW),this.initFunction(a);let x=this.maybeInArrowParameters;if(this.ecmaVersion>=8)a.async=!!f;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.maybeInArrowParameters=!0,a.params=this.toAssignableList(p,!0),this.maybeInArrowParameters=!1,this.parseFunctionBody(a,!0,!1,m),this.yieldPos=E,this.awaitPos=S,this.awaitIdentPos=k,this.maybeInArrowParameters=x,this.finishNode(a,"ArrowFunctionExpression")}parseYield(a){if(!this.yieldPos)this.yieldPos=this.start;let p=this.startNode();this.next();let f=this.tsMatchLeftRelational();if(!(!this.match(s.semi)&&!this.canInsertSemicolon()&&(this.match(s.star)||this.type.startsExpr||f)))return p.delegate=!1,p.argument=null,this.finishNode(p,"YieldExpression");return p.delegate=this.eat(s.star),p.argument=this.parseMaybeAssign(a),this.finishNode(p,"YieldExpression")}parseMaybeAssignOrigin(a,p,f){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(a);else this.exprAllowed=!1;let m=!1,E=-1,S=-1,k=-1;if(p)E=p.parenthesizedAssign,S=p.trailingComma,k=p.doubleProto,p.parenthesizedAssign=p.trailingComma=-1;else p=new Dn,m=!0;let x=this.start,C=this.startLoc;if(this.type===s.parenL||v(this.type))this.potentialArrowAt=this.start,this.potentialArrowInForAwait=a==="await";let T=this.parseMaybeConditional(a,p);if(f)T=f.call(this,T,x,C);if(this.type.isAssign){let L=this.startNodeAt(x,C);if(L.operator=this.value,this.type===s.eq)T=this.toAssignable(T,!0,p,!0);if(!m)p.parenthesizedAssign=p.trailingComma=p.doubleProto=-1;if(p.shorthandAssign>=T.start)p.shorthandAssign=-1;if(!this.maybeInArrowParameters)if(this.type===s.eq)this.checkLValPattern(T);else this.checkLValSimple(T);if(L.left=T,this.next(),L.right=this.parseMaybeAssign(a),k>-1)p.doubleProto=k;return this.finishNode(L,"AssignmentExpression")}else if(m)this.checkExpressionErrors(p,!0);if(E>-1)p.parenthesizedAssign=E;if(S>-1)p.trailingComma=S;return T}parseMaybeAssign(a,p,f){let m,E;if(e?.jsx&&(this.matchJsx("jsxTagStart")||this.tsMatchLeftRelational())){if(m=this.tryParse(()=>this.parseMaybeAssignOrigin(a,p,f)),!m.error)return m.node;let x=this.context,C=x[x.length-1],T=x[x.length-2];if(C===o.tokContexts.tc_oTag&&T===o.tokContexts.tc_expr)this.parseEffects.pop(x),this.parseEffects.pop(x);else if(C===o.tokContexts.tc_oTag||C===o.tokContexts.tc_expr)this.parseEffects.pop(x)}if(!m?.error&&!this.tsMatchLeftRelational())return this.parseMaybeAssignOrigin(a,p,f);let S,k=this.tryParse((x)=>{S=this.tsParseTypeParameters(this.tsParseConstModifier);let C=this.parseMaybeAssignOrigin(a,p,f);if(C.type!=="ArrowFunctionExpression"||C.extra?.parenthesized)x();if(S?.params.length!==0)this.resetStartLocationFromNode(C,S);return C.typeParameters=S,C});if(!k.error&&!k.aborted){if(S)this.reportReservedArrowTypeParam(S);return k.node}if(!m){if(Mo(!0),E=this.tryParse(()=>this.parseMaybeAssignOrigin(a,p,f)),!E.error)return E.node}if(m?.thrown)throw this.selectTryParseResult(m),m.error;if(k.thrown)throw this.selectTryParseResult(k),k.error;if(E?.thrown)throw this.selectTryParseResult(E),E.error;throw m?.error||k.error||E?.error}parseAssignableListItem(a){let p=[];while(this.match(b.at))p.push(this.parseDecorator());let f=this.start,m=this.startLoc,E,S=!1,k=!1;if(a!==void 0){let T={};if(this.tsParseModifiers({modified:T,allowedModifiers:["public","private","protected","override","readonly"]}),E=T.accessibility,k=T.override,S=T.readonly,a===!1&&(E||S||k))this.raise(m.column,F.UnexpectedParameterModifier)}let x=this.parseMaybeDefault(f,m);this.parseBindingListItem(x);let C=this.parseMaybeDefault(x.start,x.loc.start,x);if(p.length)C.decorators=p;if(E||S||k){let T=this.startNodeAt(f,m);if(E)T.accessibility=E;if(S)T.readonly=S;if(k)T.override=k;if(C.type!=="Identifier"&&C.type!=="AssignmentPattern")this.raise(T.start,F.UnsupportedParameterPropertyKind);return T.parameter=C,this.finishNode(T,"TSParameterProperty")}return C}checkLValInnerPattern(a,p=ne.BIND_NONE,f){switch(a.type){case"TSParameterProperty":this.checkLValInnerPattern(a.parameter,p,f);break;default:{super.checkLValInnerPattern(a,p,f);break}}}parseBindingListItem(a){if(this.eat(s.question)){if(a.type!=="Identifier"&&!this.isAmbientContext&&!this.inType)this.raise(a.start,F.PatternIsOptional);a.optional=!0}let p=this.tsTryParseTypeAnnotation();if(p)a.typeAnnotation=p;return this.resetEndLocation(a),a}isAssignable(a,p){switch(a.type){case"TSTypeCastExpression":return this.isAssignable(a.expression,p);case"TSParameterProperty":return!0;case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":{let f=a.properties.length-1;return a.properties.every((m,E)=>m.type!=="ObjectMethod"&&(E===f||m.type!=="SpreadElement")&&this.isAssignable(m))}case"Property":case"ObjectProperty":return this.isAssignable(a.value);case"SpreadElement":return this.isAssignable(a.argument);case"ArrayExpression":return a.elements.every((f)=>f===null||this.isAssignable(f));case"AssignmentExpression":return a.operator==="=";case"ParenthesizedExpression":return this.isAssignable(a.expression);case"MemberExpression":case"OptionalMemberExpression":return!p;default:return!1}}toAssignable(a,p=!1,f=new Dn,m=!1){switch(a.type){case"ParenthesizedExpression":return this.toAssignableParenthesizedExpression(a,p,f,m);case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":if(p);else this.raise(a.start,F.UnexpectedTypeCastInParameter);let E=this.toAssignable(a.expression,p,f,m);if(m)return a.expression=E,a;return E;case"MemberExpression":break;case"AssignmentExpression":if(!p&&a.left.type==="TSTypeCastExpression")a.left=this.typeCastToParameter(a.left);return super.toAssignable(a,p,f);case"TSTypeCastExpression":return this.typeCastToParameter(a);default:return super.toAssignable(a,p,f)}return a}toAssignableParenthesizedExpression(a,p,f,m=!1){switch(a.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":let E=this.toAssignable(a.expression,p,f,m);if(m)return a.expression=E,a;return E;default:return super.toAssignable(a,p,f)}}parseBindingAtom(){switch(this.type){case s._this:return this.parseIdent(!0);default:return super.parseBindingAtom()}}shouldParseArrow(a){let p;if(this.match(s.colon))p=a.every((f)=>this.isAssignable(f,!0));else p=!this.canInsertSemicolon();if(p){if(this.match(s.colon)){let f=this.tryParse((m)=>{let E=this.tsParseTypeOrTypePredicateAnnotation(s.colon);if(this.canInsertSemicolon()||!this.match(s.arrow))m();return E});if(f.aborted)return this.shouldParseArrowReturnType=void 0,!1;if(!f.thrown)this.shouldParseArrowReturnType=f.node}if(!this.match(s.arrow))return this.shouldParseArrowReturnType=void 0,!1;return!0}return this.shouldParseArrowReturnType=void 0,p}parseParenArrowList(a,p,f,m){let E=this.startNodeAt(a,p);return E.returnType=this.shouldParseArrowReturnType,this.shouldParseArrowReturnType=void 0,this.parseArrowExpression(E,f,!1,m)}parseParenAndDistinguishExpression(a,p){let f=this.start,m=this.startLoc,E,S=this.ecmaVersion>=8;if(this.ecmaVersion>=6){let k=this.maybeInArrowParameters;this.maybeInArrowParameters=!0,this.next();let x=this.start,C=this.startLoc,T=[],L=!0,_=!1,A=new Dn,I=this.yieldPos,O=this.awaitPos,H;this.yieldPos=0,this.awaitPos=0;while(this.type!==s.parenR)if(L?L=!1:this.expect(s.comma),S&&this.afterTrailingComma(s.parenR,!0)){_=!0;break}else if(this.type===s.ellipsis){if(H=this.start,T.push(this.parseParenItem(this.parseRestBinding())),this.type===s.comma)this.raise(this.start,"Comma is not permitted after the rest element");break}else T.push(this.parseMaybeAssign(!1,A,this.parseParenItem));let K=this.lastTokEnd,W=this.lastTokEndLoc;if(this.expect(s.parenR),this.maybeInArrowParameters=k,a&&this.shouldParseArrow(T)&&this.eat(s.arrow))return this.checkPatternErrors(A,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=I,this.awaitPos=O,this.parseParenArrowList(f,m,T,p);if(!T.length||_)this.unexpected(this.lastTokStart);if(H)this.unexpected(H);if(this.checkExpressionErrors(A,!0),this.yieldPos=I||this.yieldPos,this.awaitPos=O||this.awaitPos,T.length>1)E=this.startNodeAt(x,C),E.expressions=T,this.finishNodeAt(E,"SequenceExpression",K,W);else E=T[0]}else E=this.parseParenExpression();if(this.options.preserveParens){let k=this.startNodeAt(f,m);return k.expression=E,this.finishNode(k,"ParenthesizedExpression")}else return E}parseTaggedTemplateExpression(a,p,f,m){let E=this.startNodeAt(p,f);if(E.tag=a,E.quasi=this.parseTemplate({isTagged:!0}),m)this.raise(p,"Tagged Template Literals are not allowed in optionalChain.");return this.finishNode(E,"TaggedTemplateExpression")}shouldParseAsyncArrow(){if(this.match(s.colon)){let a=this.tryParse((p)=>{let f=this.tsParseTypeOrTypePredicateAnnotation(s.colon);if(this.canInsertSemicolon()||!this.match(s.arrow))p();return f});if(a.aborted)return this.shouldParseAsyncArrowReturnType=void 0,!1;if(!a.thrown)return this.shouldParseAsyncArrowReturnType=a.node,!this.canInsertSemicolon()&&this.eat(s.arrow)}else return!this.canInsertSemicolon()&&this.eat(s.arrow)}parseSubscriptAsyncArrow(a,p,f,m){let E=this.startNodeAt(a,p);return E.returnType=this.shouldParseAsyncArrowReturnType,this.shouldParseAsyncArrowReturnType=void 0,this.parseArrowExpression(E,f,!0,m)}parseExprList(a,p,f,m){let E=[],S=!0;while(!this.eat(a)){if(!S){if(this.expect(s.comma),p&&this.afterTrailingComma(a))break}else S=!1;let k;if(f&&this.type===s.comma)k=null;else if(this.type===s.ellipsis){if(k=this.parseSpread(m),this.maybeInArrowParameters&&this.match(s.colon))k.typeAnnotation=this.tsParseTypeAnnotation();if(m&&this.type===s.comma&&m.trailingComma<0)m.trailingComma=this.start}else k=this.parseMaybeAssign(!1,m,this.parseParenItem);E.push(k)}return E}parseMaybeDecoratorArguments(a){let p=this.tsMatchLeftRelational()||this.match(s.bitShift)?this.tsParseTypeArgumentsInExpression():void 0;if(this.eat(s.parenL)){let f=this.startNodeAtNode(a);if(f.callee=a,f.arguments=this.parseExprList(s.parenR,!1),p)f.typeArguments=p;return this.finishNode(f,"CallExpression")}if(p){let f=this.startNodeAtNode(a);return f.expression=a,f.typeArguments=p,this.finishNode(f,"TSInstantiationExpression")}return a}parseSubscript(a,p,f,m,E,S,k){let x=S;if(!this.hasPrecedingLineBreak()&&this.value==="!"&&this.match(s.prefix)){this.exprAllowed=!1,this.next();let A=this.startNodeAt(p,f);return A.expression=a,a=this.finishNode(A,"TSNonNullExpression"),a}let C=!1;if(this.match(s.questionDot)&&this.lookaheadCharCode()===60){if(m)return a;a.optional=!0,x=C=!0,this.next()}if(this.tsMatchLeftRelational()||this.match(s.bitShift)){let A,I=this.tsTryParseAndCatch(()=>{if(!m&&this.atPossibleAsyncArrow(a)){let W=this.tsTryParseGenericAsyncArrowFunction(p,f,k);if(W)return a=W,a}let O=this.tsParseTypeArgumentsInExpression();if(!O)return a;if(C&&!this.match(s.parenL))return A=this.curPosition(),a;if(j(this.type)||this.type===s.backQuote){let W=this.parseTaggedTemplateExpression(a,p,f,x);return W.typeArguments=O,W}if(!m&&this.eat(s.parenL)){let W=new Dn,J=this.startNodeAt(p,f);if(J.callee=a,J.arguments=this.parseExprList(s.parenR,this.ecmaVersion>=8,!1,W),this.tsCheckForInvalidTypeCasts(J.arguments),J.typeArguments=O,x)J.optional=C;return this.checkExpressionErrors(W,!0),a=this.finishNode(J,"CallExpression"),a}let H=this.type;if(this.tsMatchRightRelational()||H===s.bitShift||H!==s.parenL&&Xd(H)&&!this.hasPrecedingLineBreak())return;let K=this.startNodeAt(p,f);return K.expression=a,K.typeArguments=O,this.finishNode(K,"TSInstantiationExpression")});if(A)this.unexpected(A);if(I){if(I.type==="TSInstantiationExpression"&&(this.match(s.dot)||this.match(s.questionDot)&&this.lookaheadCharCode()!==40))this.raise(this.start,F.InvalidPropertyAccessAfterInstantiationExpression);return a=I,a}}let T=this.ecmaVersion>=11,L=T&&this.eat(s.questionDot);if(m&&L)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");let _=this.eat(s.bracketL);if(_||L&&this.type!==s.parenL&&this.type!==s.backQuote||this.eat(s.dot)){let A=this.startNodeAt(p,f);if(A.object=a,_)A.property=this.parseExpression(),this.expect(s.bracketR);else if(this.type===s.privateId&&a.type!=="Super")A.property=this.parsePrivateIdent();else A.property=this.parseIdent(this.options.allowReserved!=="never");if(A.computed=!!_,T)A.optional=L;a=this.finishNode(A,"MemberExpression")}else if(!m&&this.eat(s.parenL)){let A=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let I=new Dn,O=this.yieldPos,H=this.awaitPos,K=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;let W=this.parseExprList(s.parenR,this.ecmaVersion>=8,!1,I);if(E&&!L&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(I,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");this.yieldPos=O,this.awaitPos=H,this.awaitIdentPos=K,a=this.parseSubscriptAsyncArrow(p,f,W,k)}else{this.checkExpressionErrors(I,!0),this.yieldPos=O||this.yieldPos,this.awaitPos=H||this.awaitPos,this.awaitIdentPos=K||this.awaitIdentPos;let J=this.startNodeAt(p,f);if(J.callee=a,J.arguments=W,T)J.optional=L;a=this.finishNode(J,"CallExpression")}this.maybeInArrowParameters=A}else if(this.type===s.backQuote){if(L||x)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");let A=this.startNodeAt(p,f);A.tag=a,A.quasi=this.parseTemplate({isTagged:!0}),a=this.finishNode(A,"TaggedTemplateExpression")}return a}parseGetterSetter(a){a.kind=a.key.name,this.parsePropertyName(a);let p=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(a.value=this.parseMethod(!1),p)a.value.typeParameters=p;let f=a.kind==="get"?0:1,m=a.value.params[0];if(f=m&&this.isThisParam(m)?f+1:f,a.value.params.length!==f){let S=a.value.start;if(a.kind==="get")this.raiseRecoverable(S,"getter should have no params");else this.raiseRecoverable(S,"setter should have exactly one param")}else if(a.kind==="set"&&a.value.params[0].type==="RestElement")this.raiseRecoverable(a.value.params[0].start,"Setter cannot use rest params")}parsePropertyValue(a,p,f,m,E,S,k,x){if(this.tsMatchLeftRelational()){if(p)this.unexpected();a.kind="init",a.method=!0;let C=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(a.value=this.parseMethod(f,m),C)a.value.typeParameters=C;return}return super.parsePropertyValue(a,p,f,m,E,S,k,x)}parseProperty(a,p){if(!a){let f=[];if(this.match(b.at))while(this.match(b.at))f.push(this.parseDecorator());let m=super.parseProperty(a,p);if(m.type==="SpreadElement"){if(f.length)this.raise(m.start,ur.SpreadElementDecorator)}if(f.length)m.decorators=f,f=[];return m}return super.parseProperty(a,p)}parseCatchClauseParam(){let a=this.parseBindingAtom(),p=a.type==="Identifier";this.enterScope(p?ne.SCOPE_SIMPLE_CATCH:0),this.checkLValPattern(a,p?ne.BIND_SIMPLE_CATCH:ne.BIND_LEXICAL);let f=this.tsTryParseTypeAnnotation();if(f)a.typeAnnotation=f,this.resetEndLocation(a);return this.expect(s.parenR),a}parseClass(a,p){let f=this.inAbstractClass;this.inAbstractClass=!!a.abstract;try{this.next(),this.takeDecorators(a);let m=this.strict;this.strict=!0,this.parseClassId(a,p),this.parseClassSuper(a);let E=this.enterClassBody(),S=this.startNode(),k=!1;S.body=[];let x=[];this.expect(s.braceL);while(this.type!==s.braceR){if(this.match(b.at)){x.push(this.parseDecorator());continue}let C=this.parseClassElement(a.superClass!==null);if(x.length)C.decorators=x,this.resetStartLocationFromNode(C,x[0]),x=[];if(C){if(S.body.push(C),C.type==="MethodDefinition"&&C.kind==="constructor"&&C.value.type==="FunctionExpression"){if(k)this.raiseRecoverable(C.start,"Duplicate constructor in the same class");if(k=!0,C.decorators&&C.decorators.length>0)this.raise(C.start,ur.DecoratorConstructor)}else if(C.key&&C.key.type==="PrivateIdentifier"&&C.value?.type!=="TSDeclareMethod"){let T=C.key.name;if(this.parseEffects.modify(E,T,(_)=>Ld(_,C)))this.raiseRecoverable(C.key.start,`Identifier '#${T}' has already been declared`)}}}if(this.strict=m,this.next(),x.length)this.raise(this.start,ur.TrailingDecorator);return a.body=this.finishNode(S,"ClassBody"),this.exitClassBody(),this.finishNode(a,p?"ClassDeclaration":"ClassExpression")}finally{this.inAbstractClass=f}}parseClassFunctionParams(){let a=this.tsTryParseTypeParameters(),p=this.parseBindingList(s.parenR,!1,this.ecmaVersion>=8,!0);if(a)p.typeParameters=a;return p}parseMethod(a,p,f,m,E){let S=this.startNode(),k=this.yieldPos,x=this.awaitPos,C=this.awaitIdentPos;if(this.initFunction(S),this.ecmaVersion>=6)S.generator=a;if(this.ecmaVersion>=8)S.async=!!p;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ni(p,S.generator)|ne.SCOPE_SUPER|(f?ne.SCOPE_DIRECT_SUPER:0)),this.expect(s.parenL),S.params=this.parseClassFunctionParams(),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(S,!1,!0,!1,{isClassMethod:m}),this.yieldPos=k,this.awaitPos=x,this.awaitIdentPos=C,E&&E.abstract){if(!!S.body){let{key:L}=E;this.raise(E.start,F.AbstractMethodHasImplementation({methodName:L.type==="Identifier"&&!E.computed?L.name:`[${this.input.slice(L.start,L.end)}]`}))}}return this.finishNode(S,"FunctionExpression")}static parse(a,p){if(p.locations===!1)throw Error("You have to enable options.locations while using acorn-typescript");else p.locations=!0;let f=new this(p,a);if(t)f.isAmbientContext=!0;return f.parse()}static parseExpressionAt(a,p,f){if(f.locations===!1)throw Error("You have to enable options.locations while using acorn-typescript");else f.locations=!0;let m=new this(f,a,p);if(t)m.isAmbientContext=!0;return m.nextToken(),m.parseExpression()}parseImportSpecifier(){if(this.ts_isContextual(b.type)){let p=this.startNode();return p.imported=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(p,!0,this.importOrExportOuterKind==="type"),this.finishNode(p,"ImportSpecifier")}else{let p=super.parseImportSpecifier();return p.importKind="value",p}}parseExportSpecifier(a){let p=this.ts_isContextual(b.type);if(!this.match(s.string)&&p){let m=this.startNode();return m.local=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(m,!1,this.importOrExportOuterKind==="type"),this.finishNode(m,"ExportSpecifier"),this.checkExport(a,m.exported,m.exported.start),m}else{let m=super.parseExportSpecifier(a);return m.exportKind="value",m}}parseTypeOnlyImportExportSpecifier(a,p,f){let m=p?"imported":"local",E=p?"local":"exported",S=a[m],k,x=!1,C=!0,T=S.start;if(this.isContextual("as")){let _=this.parseIdent();if(this.isContextual("as")){let A=this.parseIdent();if(w(this.type))x=!0,S=_,k=p?this.parseIdent():this.parseModuleExportName(),C=!1;else k=A,C=!1}else if(w(this.type))C=!1,k=p?this.parseIdent():this.parseModuleExportName();else x=!0,S=_}else if(w(this.type))if(x=!0,p){if(S=super.parseIdent(!0),!this.isContextual("as"))this.checkUnreserved(S)}else S=this.parseModuleExportName();if(x&&f)this.raise(T,p?F.TypeModifierIsUsedInTypeImports:F.TypeModifierIsUsedInTypeExports);a[m]=S,a[E]=k;let L=p?"importKind":"exportKind";if(a[L]=x?"type":"value",C&&this.eatContextual("as"))a[E]=p?this.parseIdent():this.parseModuleExportName();if(!a[E])a[E]=this.copyNode(a[m]);if(p)this.checkLValSimple(a[E],ne.BIND_LEXICAL)}raiseCommonCheck(a,p,f){switch(p){case"Comma is not permitted after the rest element":if(this.isAmbientContext&&this.match(s.comma)&&this.lookaheadCharCode()===41){this.next();return}else return super.raise(a,p)}return f?super.raiseRecoverable(a,p):super.raise(a,p)}raiseRecoverable(a,p){return this.raiseCommonCheck(a,p,!0)}raise(a,p){return this.raiseCommonCheck(a,p,!0)}updateContext(a){let{type:p}=this;if(p==s.braceL){var f=this.curContext();if(f==P.tc_oTag)this.parseEffects.append(this.context,y.b_expr);else if(f==P.tc_expr)this.parseEffects.append(this.context,y.b_tmpl);else super.updateContext(a);this.exprAllowed=!0}else if(p===s.slash&&a===b.jsxTagStart)this.parseEffects.truncate(this.context,this.context.length-2),this.parseEffects.append(this.context,P.tc_cTag),this.exprAllowed=!1;else return super.updateContext(a)}jsx_parseOpeningElementAt(a,p){let f=this.startNodeAt(a,p),m=this.jsx_parseElementName();if(m)f.name=m;if(this.match(s.relational)||this.match(s.bitShift)){let E=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());if(E)f.typeArguments=E}f.attributes=[];while(this.type!==s.slash&&this.type!==b.jsxTagEnd)f.attributes.push(this.jsx_parseAttribute());return f.selfClosing=this.eat(s.slash),this.expect(b.jsxTagEnd),this.finishNode(f,m?"JSXOpeningElement":"JSXOpeningFragment")}enterScope(a){let p=a===Nn;if(p)this.parseEffects.append(this.importsStack,[]);let f=p?a|ne.SCOPE_CLASS_STATIC_BLOCK:a;super.enterScope(f);let m=super.currentScope();m.types=[],m.enums=[],m.constEnums=[],m.classes=[],m.exportOnlyBindings=[]}exitScope(){if(super.currentScope().flags&Nn)this.parseEffects.pop(this.importsStack);super.exitScope()}hasImport(a,p){let f=this.importsStack.length;if(this.importsStack[f-1].indexOf(a)>-1)return!0;if(!p&&f>1){for(let m=0;m<f-1;m++)if(this.importsStack[m].indexOf(a)>-1)return!0}return!1}maybeExportDefined(a,p){if(this.inModule&&a.flags&ne.SCOPE_TOP)this.parseEffects.remove(this.undefinedExports,p)}declareName(a,p,f){if(p&ne.BIND_FLAGS_TS_IMPORT){if(this.hasImport(a,!0))this.raise(f,`Identifier '${a}' has already been declared.`);this.parseEffects.append(this.importsStack[this.importsStack.length-1],a);return}let m=this.currentScope();if(p&ne.BIND_FLAGS_TS_EXPORT_ONLY){this.maybeExportDefined(m,a),this.parseEffects.append(m.exportOnlyBindings,a);return}if(p===ne.BIND_TS_TYPE||p===ne.BIND_TS_INTERFACE){if(p===ne.BIND_TS_TYPE&&m.types.includes(a))this.raise(f,`type '${a}' has already been declared.`);this.parseEffects.append(m.types,a)}else if(p&ne.BIND_FLAGS_TS_ENUM){if(m.enums.includes(a))return;super.declareName(a,ne.BIND_LEXICAL,f)}else super.declareName(a,p,f);if(p&ne.BIND_FLAGS_TS_ENUM)this.parseEffects.append(m.enums,a);if(p&ne.BIND_FLAGS_TS_CONST_ENUM)this.parseEffects.append(m.constEnums,a);if(p&ne.BIND_FLAGS_CLASS)this.parseEffects.append(m.classes,a)}checkLocalExport(a){let{name:p}=a;if(this.hasImport(p))return;let f=this.scopeStack.length;for(let m=f-1;m>=0;m--){let E=this.scopeStack[m];if(E.types.indexOf(p)>-1||E.exportOnlyBindings.indexOf(p)>-1)return}super.checkLocalExport(a)}}return be}}var Zd=/\n/,ef=/[ \t]/,tf=/^[,) \t]*$/,fr="",Ko=[];function hr(e,t){fr=e,Ko=t}function mr(e,t,n,r){let i=t;if(e&&Zd.test(i)){let o=n;while(o>0&&fr[o-1]!==`
39
- `)o-=1;let s=o;while(ef.test(fr[s]))s+=1;let c=fr.slice(o,s);i=nf(i,c)}Ko.push({type:e?"Block":"Line",value:i,start:n,end:r})}function nf(e,t){if(t==="")return e;return(e.startsWith(t)?e.slice(t.length):e).replaceAll(`
35
+ `;else x=String.fromCharCode(y);if(this.options.locations)++this.curLine,this.lineStart=this.pos;return x}jsx_readString(u){let y="",x=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");let g=this.input.charCodeAt(this.pos);if(g===u)break;if(g===38)y+=this.input.slice(x,this.pos),y+=this.jsx_readEntity(),x=this.pos;else if(s(g))y+=this.input.slice(x,this.pos),y+=this.jsx_readNewLine(!1),x=this.pos;else++this.pos}return y+=this.input.slice(x,this.pos++),this.finishToken(i.string,y)}jsx_readEntity(){let u="",y=0,x,g=this.input[this.pos];if(g!=="&")this.raise(this.pos,"Entity must start with an ampersand");let C=++this.pos;while(this.pos<this.input.length&&y++<10){if(g=this.input[this.pos++],g===";"){if(u[0]==="#"){let v;if(u[1]==="x"||u[1]==="X"){if(u=u.substr(2),zd.test(u))v=parseInt(u,16)}else if(u=u.substr(1),Kd.test(u))v=parseInt(u,10);if(v!==void 0&&v<=1114111)x=String.fromCodePoint(v)}else if(Object.prototype.hasOwnProperty.call(No,u))x=No[u];break}u+=g}if(x===void 0)return this.pos=C,"&";return x}jsx_readWord(){let u,y=this.pos;do u=this.input.charCodeAt(++this.pos);while(p(u)||u===45);return this.finishToken(a.jsxName,this.input.slice(y,this.pos))}jsx_parseIdentifier(){let u=this.startNode();if(this.type===a.jsxName)u.name=this.value;else if(this.type.keyword)u.name=this.type.keyword;else this.unexpected();return this.next(),this.finishNode(u,"JSXIdentifier")}jsx_parseNamespacedName(){let u=this.start,y=this.startLoc,x=this.jsx_parseIdentifier();if(!c.allowNamespaces||!this.eat(i.colon))return x;var g=this.startNodeAt(u,y);return g.namespace=x,g.name=this.jsx_parseIdentifier(),this.finishNode(g,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===a.jsxTagEnd)return"";let u=this.start,y=this.startLoc,x=this.jsx_parseNamespacedName();if(this.type===i.dot&&x.type==="JSXNamespacedName"&&!c.allowNamespacedObjects)this.unexpected();while(this.eat(i.dot)){let g=this.startNodeAt(u,y);g.object=x,g.property=this.jsx_parseIdentifier(),x=this.finishNode(g,"JSXMemberExpression")}return x}jsx_parseAttributeValue(){switch(this.type){case i.braceL:let u=this.jsx_parseExpressionContainer();if(u.expression.type==="JSXEmptyExpression")this.raise(u.start,"JSX attributes must only be assigned a non-empty expression");return u;case a.jsxTagStart:case i.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let u=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(u,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let u=this.startNode();if(this.next(),this.eat(i.ellipsis))return u.expression=this.parseExpression(),this.expect(i.braceR),this.finishNode(u,"JSXSpreadChild");return u.expression=this.type===i.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(i.braceR),this.finishNode(u,"JSXExpressionContainer")}jsx_parseAttribute(){let u=this.startNode();if(this.eat(i.braceL))return this.expect(i.ellipsis),u.argument=this.parseMaybeAssign(),this.expect(i.braceR),this.finishNode(u,"JSXSpreadAttribute");return u.name=this.jsx_parseNamespacedName(),u.value=this.eat(i.eq)?this.jsx_parseAttributeValue():null,this.finishNode(u,"JSXAttribute")}jsx_parseOpeningElementAt(u,y){let x=this.startNodeAt(u,y);x.attributes=[];let g=this.jsx_parseElementName();if(g)x.name=g;while(this.type!==i.slash&&this.type!==a.jsxTagEnd)x.attributes.push(this.jsx_parseAttribute());return x.selfClosing=this.eat(i.slash),this.expect(a.jsxTagEnd),this.finishNode(x,g?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(u,y){let x=this.startNodeAt(u,y),g=this.jsx_parseElementName();if(g)x.name=g;return this.expect(a.jsxTagEnd),this.finishNode(x,g?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(u,y){let x=this.startNodeAt(u,y),g=[],C=this.jsx_parseOpeningElementAt(u,y),v=null;if(!C.selfClosing){e:for(;;)switch(this.type){case a.jsxTagStart:if(u=this.start,y=this.startLoc,this.next(),this.eat(i.slash)){v=this.jsx_parseClosingElementAt(u,y);break e}g.push(this.jsx_parseElementAt(u,y));break;case a.jsxText:g.push(this.parseExprAtom());break;case i.braceL:g.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}if(an(v.name)!==an(C.name))this.raise(v.start,"Expected corresponding JSX closing tag for <"+an(C.name)+">")}let w=C.name?"Element":"Fragment";if(x["opening"+w]=C,x["closing"+w]=v,x.children=g,this.type===i.relational&&this.value==="<")this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag");return this.finishNode(x,"JSX"+w)}jsx_parseText(){let u=this.parseLiteral(this.value);return u.type="JSXText",u}jsx_parseElement(){let u=this.start,y=this.startLoc;return this.next(),this.jsx_parseElementAt(u,y)}}}function Xd(e,t,n){let{tokTypes:r}=t,{tokTypes:i}=n;return class extends e{parseMaybeImportAttributes(s){if(this.type===i._with||this.type===r.assert){this.next();let p=this.parseImportAttributes();if(p)s.attributes=p}}parseImportAttributes(){this.expect(i.braceL);let s=this.parseWithEntries();return this.expect(i.braceR),s}parseWithEntries(){let s=[],p=new Set;do{if(this.type===i.braceR)break;let c=this.startNode(),d;if(this.type===i.string)d=this.parseLiteral(this.value);else d=this.parseIdent(!0);if(this.next(),c.key=d,p.has(c.key.name))this.raise(this.pos,"Duplicated key in attributes");if(p.add(c.key.name),this.type!==i.string)this.raise(this.pos,"Only string is supported as an attribute value");c.value=this.parseLiteral(this.value),s.push(this.finishNode(c,"ImportAttribute"))}while(this.eat(i.comma));return s}}}var fi=["onToken","onComment","onInsertedSemicolon","onTrailingComma"];function Vo(){return{_tag:"BufferedParserEvents",segments:[]}}var Yd=Vo();function Do(e){return e.segments.length>0}var Qd=class{constructor(e,t){this.options=e,this.state=t,this.callbacks={},this.callbackWrappers={},this.frames=[],this.undoLog=[],this.hasCallbacks=this.captureCallbacks()}get active(){return this.frames.length>0}begin(){let e={_tag:"ParseEffectFrame",depth:this.frames.length,undoMark:this.undoLog.length,checkpoint:this.state?.capture()};if(this.frames.push(e),e.depth===0&&this.hasCallbacks)this.activateCallbacks();return e}commit(e){this.close(e);let t=this.currentFrame();if(t){if(e.output)this.appendOutput(this.outputFor(t),e.output);return}if(this.undoLog.length=e.undoMark,e.output)this.flush(e.output)}rollback(e){this.close(e),this.unwind(e.undoMark),this.restore(e)}rollbackWithEvents(e){return this.close(e),this.unwind(e.undoMark),this.restore(e),e.output??Yd}replay(e){if(!Do(e))return;let t=this.currentFrame();if(t){this.appendOutput(this.outputFor(t),e);return}this.flush(e)}set(e,t,n){this.willSet(e,t),e[t]=n}remove(e,t){this.willSet(e,t),delete e[t]}append(e,t){this.willAppend(e),e.push(t)}pop(e){return this.willMutateTail(e,1),e.pop()}truncate(e,t){if(t<e.length)this.willMutateTail(e,e.length-t);else this.willAppend(e);e.length=t}modify(e,t,n){let[r,i]=n(e[t]);return this.set(e,t,i),r}willAppend(e){if(!this.active)return;this.undoLog.push({_tag:"ArrayLength",target:e,length:e.length})}willMutateTail(e,t){if(!this.active)return;let n=Math.max(0,e.length-t);this.undoLog.push({_tag:"ArrayTail",target:e,start:n,values:e.slice(n)})}willSet(e,t){if(!this.active)return;let n=e;this.undoLog.push({_tag:"Property",target:n,key:t,had:Object.prototype.hasOwnProperty.call(n,t),value:n[t]})}captureCallbacks(){let e=!1;for(let t of fi){let n=this.options[t];if(!n)continue;e=!0,this.callbacks[t]=n,this.callbackWrappers[t]=(...r)=>{this.emit({name:t,args:r})}}return e}activateCallbacks(){for(let e of fi){let t=this.callbackWrappers[e];if(t)this.options[e]=t}}deactivateCallbacks(){for(let e of fi){let t=this.callbacks[e];if(t)this.options[e]=t}}emit(e){let t=this.currentFrame();if(!t){this.invoke(e);return}let n=this.outputFor(t).segments,r=n[n.length-1];if(Array.isArray(r))r.push(e);else n.push([e])}appendOutput(e,t){if(Do(t))e.segments.push(t)}outputFor(e){return e.output??=Vo()}flush(e){let t=[];for(let n=e.segments.length-1;n>=0;n--)t.push(e.segments[n]);while(t.length>0){let n=t.pop();if(Array.isArray(n)){for(let r of n)this.invoke(r);continue}for(let r=n.segments.length-1;r>=0;r--)t.push(n.segments[r])}}invoke(e){this.callbacks[e.name]?.apply(this.options,e.args)}currentFrame(){return this.frames[this.frames.length-1]}close(e){if(this.currentFrame()!==e||e.depth!==this.frames.length-1)throw Error("Parse effect scopes must be closed in order");if(this.frames.pop(),this.frames.length===0&&this.hasCallbacks)this.deactivateCallbacks()}restore(e){if(this.state)this.state.restore(e.checkpoint)}unwind(e){for(let t=this.undoLog.length-1;t>=e;t--){let n=this.undoLog[t];switch(n._tag){case"ArrayLength":if(n.target.length<n.length)throw Error("A parse effect shortened an append-only array");n.target.length=n.length;break;case"ArrayTail":n.target.length=n.start;for(let r of n.values)n.target.push(r);break;case"Property":if(n.had)n.target[n.key]=n.value;else delete n.target[n.key];break}}this.undoLog.length=e}};function wt(e,t,n){if(e.length===t)return e;if(e.length<t)throw Error(`A parse branch shortened the ${n} below its checkpoint`);return e.length=t,e}function Zd(e){return{lookahead:e.getCurLookaheadState(),context:e.context,contextLength:e.context.length,scopeStack:e.scopeStack,scopeStackLength:e.scopeStack.length,importsStack:e.importsStack,importsStackLength:e.importsStack.length,labels:e.labels,labelsLength:e.labels.length,privateNameStack:e.privateNameStack,privateNameStackLength:e.privateNameStack.length,decoratorStack:e.decoratorStack,decoratorStackLength:e.decoratorStack.length,strict:e.strict,potentialArrowAt:e.potentialArrowAt,potentialArrowInForAwait:e.potentialArrowInForAwait,yieldPos:e.yieldPos,awaitPos:e.awaitPos,awaitIdentPos:e.awaitIdentPos,preValue:e.preValue,preToken:e.preToken,isLookahead:e.isLookahead,isAmbientContext:e.isAmbientContext,inAbstractClass:e.inAbstractClass,inType:e.inType,inDisallowConditionalTypesContext:e.inDisallowConditionalTypesContext,maybeInArrowParameters:e.maybeInArrowParameters,shouldParseArrowReturnType:e.shouldParseArrowReturnType,shouldParseAsyncArrowReturnType:e.shouldParseAsyncArrowReturnType,importOrExportOuterKind:e.importOrExportOuterKind}}function ef(e,t){e.setLookaheadTokenState(t.lookahead),e.context=wt(t.context,t.contextLength,"token context stack"),e.scopeStack=wt(t.scopeStack,t.scopeStackLength,"scope stack"),e.importsStack=wt(t.importsStack,t.importsStackLength,"import stack"),e.labels=wt(t.labels,t.labelsLength,"label stack"),e.privateNameStack=wt(t.privateNameStack,t.privateNameStackLength,"private-name stack"),e.decoratorStack=wt(t.decoratorStack,t.decoratorStackLength,"decorator stack"),e.strict=t.strict,e.potentialArrowAt=t.potentialArrowAt,e.potentialArrowInForAwait=t.potentialArrowInForAwait,e.yieldPos=t.yieldPos,e.awaitPos=t.awaitPos,e.awaitIdentPos=t.awaitIdentPos,e.regexpState=null,e.preValue=t.preValue,e.preToken=t.preToken,e.isLookahead=t.isLookahead,e.isAmbientContext=t.isAmbientContext,e.inAbstractClass=t.inAbstractClass,e.inType=t.inType,e.inDisallowConditionalTypesContext=t.inDisallowConditionalTypesContext,e.maybeInArrowParameters=t.maybeInArrowParameters,e.shouldParseArrowReturnType=t.shouldParseArrowReturnType,e.shouldParseAsyncArrowReturnType=t.shouldParseAsyncArrowReturnType,e.importOrExportOuterKind=t.importOrExportOuterKind}function tf(e){return{capture:()=>Zd(e),restore:(t)=>ef(e,t)}}function nf(e,t){let{acornTokenTypes:n,typeScriptTokenTypes:r,scope:i}=t,a=i.SCOPE_TOP|i.SCOPE_FUNCTION|i.SCOPE_CLASS_STATIC_BLOCK;return class extends e{constructor(p,c,d){super(p,c,d);this.parseEffects=new Qd(this.options,tf(this))}overrideContext(p){if(this.curContext()!==p)this.parseEffects?.willMutateTail(this.context,1);return super.overrideContext(p)}takeDecorators(p){let c=this.decoratorStack.length-1;if(this.decoratorStack[c].length>0)this.parseEffects?.willSet(this.decoratorStack,String(c));return super.takeDecorators(p)}parseDecorators(p){let c=this.decoratorStack[this.decoratorStack.length-1];return this.parseEffects?.willAppend(c),super.parseDecorators(p)}parseDecorator(){return this.parseEffects?.willAppend(this.decoratorStack),super.parseDecorator()}parseIdentNode(){if((this.type.keyword==="class"||this.type.keyword==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.parseEffects?.willMutateTail(this.context,1);return super.parseIdentNode()}parseLabeledStatement(p,c,d,u){for(let y=this.labels.length-1;y>=0;y--){let x=this.labels[y];if(x.statementStart!==p.start)break;this.parseEffects?.willSet(x,"statementStart"),this.parseEffects?.willSet(x,"kind")}return this.parseEffects?.willAppend(this.labels),super.parseLabeledStatement(p,c,d,u)}enterClassBody(){return this.parseEffects?.willAppend(this.privateNameStack),super.enterClassBody()}exitClassBody(){let p=this.privateNameStack[this.privateNameStack.length-2];if(p)this.parseEffects?.willAppend(p.used);return this.parseEffects?.willMutateTail(this.privateNameStack,1),super.exitClassBody()}parsePrivateIdent(){if(this.options.checkPrivateFields&&this.privateNameStack.length>0){let p=this.privateNameStack[this.privateNameStack.length-1];this.parseEffects?.willAppend(p.used)}return super.parsePrivateIdent()}parseClassField(p){return this.parseEffects?.willSet(this.currentThisScope(),"inClassFieldInit"),super.parseClassField(p)}updateContext(p){let{type:c}=this;if(c===n.parenR||c===n.braceR||c===n.braceL||c===n.dollarBraceL||c===n.parenL||c===n._function||c===n._class||c===n.colon||c===n.backQuote||c===n.star||c===r.jsxTagStart||c===r.jsxTagEnd||c===n.slash&&p===r.jsxTagStart)this.parseEffects?.willMutateTail(this.context,2);return super.updateContext(p)}enterScope(p){return this.parseEffects?.willAppend(this.scopeStack),super.enterScope(p)}exitScope(){return this.parseEffects?.willMutateTail(this.scopeStack,1),super.exitScope()}declareName(p,c,d){let u=this.parseEffects;if(u?.active)if(c===i.BIND_LEXICAL){let y=this.currentScope();if(u.willAppend(y.lexical),this.inModule&&y.flags&i.SCOPE_TOP)u.willSet(this.undefinedExports,p)}else if(c===i.BIND_SIMPLE_CATCH)u.willAppend(this.currentScope().lexical);else if(c===i.BIND_FUNCTION)u.willAppend(this.currentScope().functions);else for(let y=this.scopeStack.length-1;y>=0;y--){let x=this.scopeStack[y];if(u.willAppend(x.var),this.inModule&&x.flags&i.SCOPE_TOP)u.willSet(this.undefinedExports,p);if(x.flags&a)break}return super.declareName(p,c,d)}checkLocalExport(p){return this.parseEffects?.willSet(this.undefinedExports,p.name),super.checkLocalExport(p)}}}var hi=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;function Io(e){if(!e)throw Error("Assert fail")}function rf(e){return e==="accessor"}function sf(e){return e==="in"||e==="out"}var Kn=1,_o=2,af=4,V={SCOPE_TOP:1,SCOPE_FUNCTION:2,SCOPE_ASYNC:4,SCOPE_GENERATOR:8,SCOPE_ARROW:16,SCOPE_SIMPLE_CATCH:32,SCOPE_SUPER:64,SCOPE_DIRECT_SUPER:128,SCOPE_CLASS_STATIC_BLOCK:256,SCOPE_VAR:256,BIND_NONE:0,BIND_VAR:1,BIND_LEXICAL:2,BIND_FUNCTION:3,BIND_SIMPLE_CATCH:4,BIND_OUTSIDE:5,BIND_TS_TYPE:6,BIND_TS_INTERFACE:7,BIND_TS_NAMESPACE:1032,BIND_FLAGS_TS_EXPORT_ONLY:1024,BIND_FLAGS_TS_IMPORT:4096,BIND_FLAGS_TS_ENUM:256,BIND_FLAGS_TS_CONST_ENUM:512,BIND_TS_ENUM:258,BIND_TS_CONST_ENUM:770,BIND_FLAGS_CLASS:128};function mi(e,t){return V.SCOPE_FUNCTION|(e?V.SCOPE_ASYNC:0)|(t?V.SCOPE_GENERATOR:0)}function of(e){if(e.type!=="MemberExpression")return!1;let{computed:t,property:n}=e;if(t&&(n.type!=="TemplateLiteral"||n.expressions.length>0))return!1;return jo(e.object)}function pf(e){return e.type==="UnaryExpression"&&(e.operator==="-"||e.operator==="+")&&e.argument.type==="Literal"&&(typeof e.argument.value==="number"||typeof e.argument.value==="bigint")}function jo(e){if(e.type==="Identifier")return!0;if(e.type!=="MemberExpression")return!1;if(e.computed)return!1;return jo(e.object)}function Lo(e){return e==="private"||e==="public"||e==="protected"}function cf(e){return Boolean(e.startsExpr)}function lf(e){if(e==null)throw Error(`Unexpected ${e} value.`);return e}function uf(e){switch(e){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function Ho(e){let{dts:t=!1}=e||{},n=!!e?.jsx;return function(r){let i=r.acorn||di,a=Bd(i),{tokTypes:s,keywordTypes:p,isIdentifierStart:c,lineBreak:d,isNewLine:u,tokContexts:y,isIdentifierChar:x}=i,{tokTypes:g,tokContexts:C,keywordsRegExp:v,tokenIsLiteralPropertyName:w,tokenIsTemplate:R,tokenIsTSDeclarationStart:B,tokenIsIdentifier:L,tokenIsKeywordOrIdentifier:k,tokenIsTSTypeOperator:_}=a;function j(o,l,f=o.length){for(let m=l;m<f;m++){let b=o.charCodeAt(m);if(u(b))return m<f-1&&b===13&&o.charCodeAt(m+1)===10?m+2:m+1}return-1}if(r=Wd(r,a,i),e?.jsx)r=Jd(i,a,r,typeof e.jsx==="boolean"?{}:e.jsx);r=Xd(r,a,i);let Fe=nf(r,{acornTokenTypes:s,typeScriptTokenTypes:g,scope:V});class ot extends Fe{constructor(o,l,f){super(o,l,f);this.preValue=null,this.preToken=null,this.isLookahead=!1,this.isAmbientContext=!1,this.inAbstractClass=!1,this.inType=!1,this.inDisallowConditionalTypesContext=!1,this.maybeInArrowParameters=!1,this.shouldParseArrowReturnType=void 0,this.shouldParseAsyncArrowReturnType=void 0,this.decoratorStack=[[]],this.importsStack=[[]],this.importOrExportOuterKind=void 0,this.tsParseConstModifier=(m)=>{this.tsParseModifiers({modified:m,allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:D.InvalidModifierOnTypeParameterPositions})},this.ecmaVersion=this.options.ecmaVersion}static get acornTypeScript(){return a}get acornTypeScript(){return a}getTokenFromCodeInType(o){if(o===62)return this.finishOp(s.relational,1);if(o===60)return this.finishOp(s.relational,1);return super.getTokenFromCode(o)}readToken(o){if(!this.inType){let l=this.curContext();if(l===C.tc_expr)return this.jsx_readToken();if(l===C.tc_oTag||l===C.tc_cTag){if(c(o))return this.jsx_readWord();if(o==62)return++this.pos,this.finishToken(g.jsxTagEnd);if((o===34||o===39)&&l==C.tc_oTag)return this.jsx_readString(o)}if(o===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33)if(++this.pos,e?.jsx)return this.finishToken(g.jsxTagStart);else return this.finishToken(s.relational,"<")}return super.readToken(o)}getTokenFromCode(o){if(this.inType)return this.getTokenFromCodeInType(o);if(o===64)return++this.pos,this.finishToken(g.at);return super.getTokenFromCode(o)}isAbstractClass(){return this.ts_isContextual(g.abstract)&&this.lookahead().type===s._class}isDeclareClass(){if(!this.ts_isContextual(g.declare))return!1;let o=this.nextTokenStart();if(this.isUnparsedContextual(o,"class"))return!0;if(!this.isUnparsedContextual(o,"abstract"))return!1;let l=this.nextTokenStartSince(o+8);return this.isUnparsedContextual(l,"class")}finishNode(o,l){if(o.type!==""&&o.end!==0)return o;return super.finishNode(o,l)}tryParse(o){let l={},f=this.beginParseEffectScope(),m;try{m=o(()=>{throw l})}catch(b){let T=b===l;if(!T&&!(b instanceof SyntaxError))throw this.parseEffects.rollback(f),b;let S={events:this.parseEffects.rollbackWithEvents(f),selected:!1};return T?{node:null,error:null,thrown:!1,aborted:!0,failState:S}:{node:null,error:b,thrown:!0,aborted:!1,failState:S}}return this.parseEffects.commit(f),{node:m,error:null,thrown:!1,aborted:!1,failState:null}}setOptionalParametersError(o,l){o.optionalParametersLoc=l?.loc??this.startLoc}reScan_lt_gt(){if(this.type===s.relational)this.pos-=1,this.readToken_lt_gt(this.fullCharCodeAtPos())}reScan_lt(){let{type:o}=this;if(o===s.bitShift)return this.pos-=2,this.finishOp(s.relational,1),s.relational;return o}resetEndLocation(o,l=this.lastTokEnd,f=this.lastTokEndLoc){if(o.end=l,o.loc.end=f,this.options.ranges)o.range[1]=l}startNodeAtNode(o){return super.startNodeAt(o.start,o.loc.start)}nextTokenStart(){return this.nextTokenStartSince(this.pos)}tsHasSomeModifiers(o,l){return l.some((f)=>{if(Lo(f))return o.accessibility===f;return!!o[f]})}tsIsStartOfStaticBlocks(){return this.isContextual("static")&&this.lookaheadCharCode()===123}tsCheckForInvalidTypeCasts(o){o.forEach((l)=>{if(l?.type==="TSTypeCastExpression")this.raise(l.typeAnnotation.start,D.UnexpectedTypeAnnotation)})}atPossibleAsyncArrow(o){return o.type==="Identifier"&&o.name==="async"&&this.lastTokEnd===o.end&&!this.canInsertSemicolon()&&o.end-o.start===5&&o.start===this.potentialArrowAt}tsIsIdentifier(){return L(this.type)}tsTryParseTypeOrTypePredicateAnnotation(){return this.match(s.colon)?this.tsParseTypeOrTypePredicateAnnotation(s.colon):void 0}tsTryParseGenericAsyncArrowFunction(o,l,f){if(!this.tsMatchLeftRelational())return;let m=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let b=this.tsTryParseAndCatch(()=>{let T=this.startNodeAt(o,l);return T.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(T),T.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(s.arrow),T});if(this.maybeInArrowParameters=m,!b)return;return this.parseArrowExpression(b,b.params,!0,f)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()!==s.relational)return;return this.tsParseTypeArguments(!0)}tsInNoContext(o){let l=this.context;this.context=[l[0]];try{return o()}finally{this.context=l}}tsTryParseTypeAnnotation(){return this.match(s.colon)?this.tsParseTypeAnnotation():void 0}isUnparsedContextual(o,l){let f=o+l.length;if(this.input.slice(o,f)===l){let m=this.input.charCodeAt(f);return!(x(m)||(m&64512)===55296)}return!1}isAbstractConstructorSignature(){return this.ts_isContextual(g.abstract)&&this.lookahead().type===s._new}nextTokenStartSince(o){return hi.lastIndex=o,hi.test(this.input)?hi.lastIndex:o}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}createLookaheadState(){this.value=null,this.context=[this.curContext()]}getCurLookaheadState(){return{endLoc:this.endLoc,lastTokEnd:this.lastTokEnd,lastTokStart:this.lastTokStart,lastTokStartLoc:this.lastTokStartLoc,pos:this.pos,value:this.value,type:this.type,exprAllowed:this.exprAllowed,start:this.start,end:this.end,context:this.context,startLoc:this.startLoc,lastTokEndLoc:this.lastTokEndLoc,curLine:this.curLine,lineStart:this.lineStart,containsEsc:this.containsEsc}}setLookaheadTokenState(o){this.pos=o.pos,this.value=o.value,this.exprAllowed=o.exprAllowed,this.endLoc=o.endLoc,this.lastTokEnd=o.lastTokEnd,this.lastTokStart=o.lastTokStart,this.lastTokStartLoc=o.lastTokStartLoc,this.type=o.type,this.start=o.start,this.end=o.end,this.startLoc=o.startLoc,this.lastTokEndLoc=o.lastTokEndLoc,this.curLine=o.curLine,this.lineStart=o.lineStart,this.containsEsc=o.containsEsc}setLookaheadState(o){this.setLookaheadTokenState(o),this.context=o.context&&o.context.slice()}beginParseEffectScope(){return this.parseEffects.begin()}selectTryParseResult(o){let l=o.failState;if(!l)return;if(l.selected)throw Error("A parse branch result can only be selected once");l.selected=!0,this.parseEffects.replay(l.events)}tsLookAhead(o){let l=this.beginParseEffectScope();try{return o()}finally{this.parseEffects.rollback(l)}}lookahead(o){let l=this.getCurLookaheadState(),f=this.context,m=this.preValue,b=this.preToken,T=this.isLookahead;try{if(this.createLookaheadState(),this.isLookahead=!0,o!==void 0)for(let S=0;S<o;S++)this.nextToken();else this.nextToken();return this.getCurLookaheadState()}finally{this.setLookaheadTokenState(l),this.context=f,this.preValue=m,this.preToken=b,this.isLookahead=T}}readWord(){let o=this.readWord1(),l=s.name;if(this.keywords.test(o))l=p[o];else if(new RegExp(v).test(o))l=g[o];return this.finishToken(l,o)}skipBlockComment(){let o;if(!this.isLookahead)o=this.options.onComment&&this.curPosition();let l=this.pos,f=this.input.indexOf("*/",this.pos+=2);if(f===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=f+2,this.options.locations)for(let m,b=l;(m=j(this.input,b,this.pos))>-1;)++this.curLine,b=this.lineStart=m;if(this.isLookahead)return;if(this.options.onComment)this.options.onComment(!0,this.input.slice(l+2,f),l,this.pos,o,this.curPosition())}skipLineComment(o){let l=this.pos,f;if(!this.isLookahead)f=this.options.onComment&&this.curPosition();let m=this.input.charCodeAt(this.pos+=o);while(this.pos<this.input.length&&!u(m))m=this.input.charCodeAt(++this.pos);if(this.isLookahead)return;if(this.options.onComment)this.options.onComment(!1,this.input.slice(l+o,this.pos),l,this.pos,f,this.curPosition())}finishToken(o,l){if(this.preValue=this.value,this.preToken=this.type,this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();let f=this.type;if(this.type=o,this.value=l,!this.isLookahead)this.updateContext(f)}resetStartLocation(o,l,f){if(o.start=l,o.loc.start=f,this.options.ranges)o.range[0]=l}isLineTerminator(){return this.eat(s.semi)||super.canInsertSemicolon()}hasFollowingLineBreak(){return ko.lastIndex=this.end,ko.test(this.input)}addExtra(o,l,f,m=!0){if(!o)return;let b=o.extra=o.extra||{};if(m)b[l]=f;else Object.defineProperty(b,l,{enumerable:m,value:f})}isLiteralPropertyName(){return w(this.type)}hasPrecedingLineBreak(){return d.test(this.input.slice(this.lastTokEnd,this.start))}createIdentifier(o,l){return o.name=l,this.finishNode(o,"Identifier")}resetStartLocationFromNode(o,l){this.resetStartLocation(o,l.start,l.loc.start)}isThisParam(o){return o.type==="Identifier"&&o.name==="this"}isLookaheadContextual(o){let l=this.nextTokenStart();return this.isUnparsedContextual(l,o)}ts_type_isContextual(o,l){return o===l&&!this.containsEsc}ts_isContextual(o){return this.type===o&&!this.containsEsc}ts_isContextualWithState(o,l){return o.type===l&&!o.containsEsc}isContextualWithState(o,l){return l.type===s.name&&l.value===o&&!l.containsEsc}tsIsStartOfMappedType(){if(this.next(),this.eat(s.plusMin))return this.ts_isContextual(g.readonly);if(this.ts_isContextual(g.readonly))this.next();if(!this.match(s.bracketL))return!1;if(this.next(),!this.tsIsIdentifier())return!1;return this.next(),this.match(s._in)}tsInDisallowConditionalTypesContext(o){let l=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!0;try{return o()}finally{this.inDisallowConditionalTypesContext=l}}tsTryParseType(){return this.tsEatThenParseType(s.colon)}match(o){return this.type===o}matchJsx(o){return this.type===a.tokTypes[o]}ts_eatWithState(o,l,f){let m=f.type;if(o===m){for(let b=0;b<l;b++)this.next();return!0}else return!1}ts_eatContextualWithState(o,l,f){if(v.test(o)){if(this.ts_isContextualWithState(f,g[o])){for(let m=0;m<l;m++)this.next();return!0}return!1}else{if(!this.isContextualWithState(o,f))return!1;for(let m=0;m<l;m++)this.next();return!0}}canHaveLeadingDecorator(){return this.match(s._class)||this.isAbstractClass()||this.isDeclareClass()}eatContextual(o){if(v.test(o)){if(this.ts_isContextual(g[o]))return this.next(),!0;return!1}else return super.eatContextual(o)}tsIsExternalModuleReference(){return this.isContextual("require")&&this.lookaheadCharCode()===40}tsParseExternalModuleReference(){let o=this.startNode();if(this.expectContextual("require"),this.expect(s.parenL),!this.match(s.string))this.unexpected();return o.expression=this.parseExprAtom(),this.expect(s.parenR),this.finishNode(o,"TSExternalModuleReference")}tsParseEntityName(o=!0){let l=this.parseIdent(o);while(this.eat(s.dot)){let f=this.startNodeAtNode(l);f.left=l,f.right=this.parseIdent(o),l=this.finishNode(f,"TSQualifiedName")}return l}tsParseEnumMember(){let o=this.startNode();if(o.id=this.match(s.string)?this.parseLiteral(this.value):this.parseIdent(!0),this.eat(s.eq))o.initializer=this.parseMaybeAssign();return this.finishNode(o,"TSEnumMember")}tsParseEnumDeclaration(o,l={}){if(l.const)o.const=!0;if(l.declare)o.declare=!0;this.expectContextual("enum"),o.id=this.parseIdent();let f=l.const?V.BIND_TS_CONST_ENUM:V.BIND_TS_ENUM;return this.checkLValSimple(o.id,f),this.expect(s.braceL),o.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(s.braceR),this.finishNode(o,"TSEnumDeclaration")}tsParseModuleBlock(){let o=this.startNode();this.enterScope(Fd),this.expect(s.braceL),o.body=[];while(this.type!==s.braceR){let l=this.parseStatement(null,!0);o.body.push(l)}return this.next(),super.exitScope(),this.finishNode(o,"TSModuleBlock")}tsParseAmbientExternalModuleDeclaration(o){if(this.ts_isContextual(g.global))o.global=!0,o.id=this.parseIdent();else if(this.match(s.string))o.id=this.parseLiteral(this.value);else this.unexpected();if(this.match(s.braceL))this.enterScope(rn),o.body=this.tsParseModuleBlock(),super.exitScope();else super.semicolon();return this.finishNode(o,"TSModuleDeclaration")}tsTryParseDeclare(o){if(this.isLineTerminator())return;let l=this.type,f;if(this.isContextual("let"))l=s._var,f="let";return this.tsInAmbientContext(()=>{if(l===s._function)return o.declare=!0,this.parseFunctionStatement(o,!1,!0);if(l===s._class)return o.declare=!0,this.parseClass(o,!0);if(l===g.enum)return this.tsParseEnumDeclaration(o,{declare:!0});if(l===g.global)return this.tsParseAmbientExternalModuleDeclaration(o);if(l===s._const||l===s._var){if(!this.match(s._const)||!this.isLookaheadContextual("enum"))return o.declare=!0,this.parseVarStatement(o,f||this.value,!0);return this.expect(s._const),this.tsParseEnumDeclaration(o,{const:!0,declare:!0})}if(l===g.interface){let m=this.tsParseInterfaceDeclaration(o,{declare:!0});if(m)return m}if(L(l))return this.tsParseDeclaration(o,this.value,!0)})}tsIsListTerminator(o){switch(o){case"EnumMembers":case"TypeMembers":return this.match(s.braceR);case"HeritageClauseElement":return this.match(s.braceL);case"TupleElementTypes":return this.match(s.bracketR);case"TypeParametersOrArguments":return this.tsMatchRightRelational()}}tsParseDelimitedListWorker(o,l,f,m){let b=[],T=-1;for(;;){if(this.tsIsListTerminator(o))break;T=-1;let S=l();if(S==null)return;if(b.push(S),this.eat(s.comma)){T=this.lastTokStart;continue}if(this.tsIsListTerminator(o))break;if(f)this.expect(s.comma);return}if(m)m.value=T;return b}tsParseDelimitedList(o,l,f){return lf(this.tsParseDelimitedListWorker(o,l,!0,f))}tsParseBracketedList(o,l,f,m,b){if(!m)if(f)this.expect(s.bracketL);else this.expect(s.relational);let T=this.tsParseDelimitedList(o,l,b);if(f)this.expect(s.bracketR);else this.expect(s.relational);return T}tsParseTypeParameterName(){return this.parseIdent().name}tsEatThenParseType(o){return!this.match(o)?void 0:this.tsNextThenParseType()}tsExpectThenParseType(o){return this.tsDoThenParseType(()=>this.expect(o))}tsNextThenParseType(){return this.tsDoThenParseType(()=>this.next())}tsDoThenParseType(o){return this.tsInType(()=>(o(),this.tsParseType()))}tsSkipParameterStart(){if(L(this.type)||this.match(s._this))return this.next(),!0;if(this.match(s.braceL))try{return this.parseObj(!0),!0}catch{return!1}if(this.match(s.bracketL)){this.next();try{return this.parseBindingList(s.bracketR,!0,!0),!0}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){if(this.next(),this.match(s.parenR)||this.match(s.ellipsis))return!0;if(this.tsSkipParameterStart()){if(this.match(s.colon)||this.match(s.comma)||this.match(s.question)||this.match(s.eq))return!0;if(this.match(s.parenR)){if(this.next(),this.match(s.arrow))return!0}}return!1}tsIsStartOfFunctionType(){if(this.tsMatchLeftRelational())return!0;return this.match(s.parenL)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsInAllowConditionalTypesContext(o){let l=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!1;try{return o()}finally{this.inDisallowConditionalTypesContext=l}}tsParseBindingListForSignature(){return super.parseBindingList(s.parenR,!0,!0).map((o)=>{if(o.type!=="Identifier"&&o.type!=="RestElement"&&o.type!=="ObjectPattern"&&o.type!=="ArrayPattern")this.raise(o.start,D.UnsupportedSignatureParameterKind({type:o.type}));return o})}tsParseTypePredicateAsserts(){if(this.type!==g.asserts)return!1;let o=this.containsEsc;if(this.next(),!L(this.type)&&!this.match(s._this))return!1;if(o)this.raise(this.lastTokStart,"Escape sequence in keyword asserts");return!0}tsParseThisTypeNode(){let o=this.startNode();return this.next(),this.finishNode(o,"TSThisType")}tsParseTypeAnnotation(o=!0,l=this.startNode()){return this.tsInType(()=>{if(o)this.expect(s.colon);l.typeAnnotation=this.tsParseType()}),this.finishNode(l,"TSTypeAnnotation")}tsParseThisTypePredicate(o){this.next();let l=this.startNodeAtNode(o);return l.parameterName=o,l.typeAnnotation=this.tsParseTypeAnnotation(!1),l.asserts=!1,this.finishNode(l,"TSTypePredicate")}tsParseThisTypeOrThisTypePredicate(){let o=this.tsParseThisTypeNode();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.tsParseThisTypePredicate(o);else return o}tsParseTypePredicatePrefix(){let o=this.parseIdent();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.next(),o}tsParseTypeOrTypePredicateAnnotation(o){return this.tsInType(()=>{let l=this.startNode();this.expect(o);let f=this.startNode(),m=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(m){let A=this.tsParseTypeAnnotation(!1);return f.parameterName=m,f.typeAnnotation=A,f.asserts=!1,l.typeAnnotation=this.finishNode(f,"TSTypePredicate"),this.finishNode(l,"TSTypeAnnotation")}let b=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(b&&this.match(s._this)){let A=this.tsParseThisTypeOrThisTypePredicate();if(A.type==="TSThisType")f.parameterName=A,f.asserts=!0,f.typeAnnotation=null,A=this.finishNode(f,"TSTypePredicate");else this.resetStartLocationFromNode(A,f),A.asserts=!0;return l.typeAnnotation=A,this.finishNode(l,"TSTypeAnnotation")}let T=b&&this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!T){if(!b)return this.tsParseTypeAnnotation(!1,l);return f.parameterName=this.parseIdent(),f.asserts=b,f.typeAnnotation=null,l.typeAnnotation=this.finishNode(f,"TSTypePredicate"),this.finishNode(l,"TSTypeAnnotation")}let S=this.tsParseTypeAnnotation(!1);return f.parameterName=T,f.typeAnnotation=S,f.asserts=b,l.typeAnnotation=this.finishNode(f,"TSTypePredicate"),this.finishNode(l,"TSTypeAnnotation")})}tsFillSignature(o,l){let f=o===s.arrow,m="parameters",b="typeAnnotation";if(l.typeParameters=this.tsTryParseTypeParameters(),this.expect(s.parenL),l.parameters=this.tsParseBindingListForSignature(),f)l.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(o);else if(this.match(o))l.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(o)}tsTryNextParseConstantContext(){if(this.lookahead().type!==s._const)return null;this.next();let o=this.tsParseTypeReference();if(o.typeParameters||o.typeArguments)this.raise(o.typeName.start,D.CannotFindName({name:"const"}));return o}tsParseFunctionOrConstructorType(o,l){let f=this.startNode();if(o==="TSConstructorType"){if(f.abstract=!!l,l)this.next();this.next()}return this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(s.arrow,f)),this.finishNode(f,o)}tsParseUnionOrIntersectionType(o,l,f){let m=this.startNode(),b=this.eat(f),T=[];do T.push(l());while(this.eat(f));if(T.length===1&&!b)return T[0];return m.types=T,this.finishNode(m,o)}tsCheckTypeAnnotationForReadOnly(o){switch(o.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(o.start,D.UnexpectedReadonly)}}tsParseTypeOperator(){let o=this.startNode(),l=this.value;if(this.next(),o.operator=l,o.typeAnnotation=this.tsParseTypeOperatorOrHigher(),l==="readonly")this.tsCheckTypeAnnotationForReadOnly(o);return this.finishNode(o,"TSTypeOperator")}tsParseConstraintForInferType(){if(this.eat(s._extends)){let o=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.inDisallowConditionalTypesContext||!this.match(s.question))return o}}tsParseInferType(){let o=this.startNode();this.expectContextual("infer");let l=this.startNode();return l.name=this.tsParseTypeParameterName(),l.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),o.typeParameter=this.finishNode(l,"TSTypeParameter"),this.finishNode(o,"TSInferType")}tsParseLiteralTypeNode(){let o=this.startNode();return o.literal=(()=>{switch(this.type){case s.num:case s.string:case s._true:case s._false:return this.parseExprAtom();default:this.unexpected()}})(),this.finishNode(o,"TSLiteralType")}tsParseImportType(){let o=this.startNode();if(this.expect(s._import),this.expect(s.parenL),!this.match(s.string))this.raise(this.start,D.UnsupportedImportTypeArgument);if(o.argument=this.parseExprAtom(),this.expect(s.parenR),this.eat(s.dot))o.qualifier=this.tsParseEntityName();if(this.tsMatchLeftRelational())o.typeArguments=this.tsParseTypeArguments();return this.finishNode(o,"TSImportType")}tsParseTypeQuery(){let o=this.startNode();if(this.expect(s._typeof),this.match(s._import))o.exprName=this.tsParseImportType();else o.exprName=this.tsParseEntityName();if(!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational())o.typeArguments=this.tsParseTypeArguments();return this.finishNode(o,"TSTypeQuery")}tsParseMappedTypeParameter(){let o=this.startNode();return o.name=this.tsParseTypeParameterName(),o.constraint=this.tsExpectThenParseType(s._in),this.finishNode(o,"TSTypeParameter")}tsParseMappedType(){let o=this.startNode();if(this.expect(s.braceL),this.match(s.plusMin))o.readonly=this.value,this.next(),this.expectContextual("readonly");else if(this.eatContextual("readonly"))o.readonly=!0;if(this.expect(s.bracketL),o.typeParameter=this.tsParseMappedTypeParameter(),o.nameType=this.eatContextual("as")?this.tsParseType():null,this.expect(s.bracketR),this.match(s.plusMin))o.optional=this.value,this.next(),this.expect(s.question);else if(this.eat(s.question))o.optional=!0;return o.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(s.braceR),this.finishNode(o,"TSMappedType")}tsParseTypeLiteral(){let o=this.startNode();return o.members=this.tsParseObjectTypeMembers(),this.finishNode(o,"TSTypeLiteral")}tsIsTupleElementLabel(){if(!k(this.type))return!1;let o=this.lookahead();if(o.type===s.colon)return!0;if(o.type!==s.question)return!1;return this.lookahead(2).type===s.colon}tsParseTupleElementType(){let o=this.startLoc,l=this.start,f=this.eat(s.ellipsis),m;if(this.tsIsTupleElementLabel()){let b=this.startNode();b.label=this.parseIdent(!0),b.optional=this.eat(s.question),this.expect(s.colon),b.elementType=this.tsParseType(),m=this.finishNode(b,"TSNamedTupleMember")}else{m=this.tsParseType();let b=this.eat(s.question);if(this.eat(s.colon))this.raise(m.start,D.InvalidTupleMemberLabel);if(b){let T=this.startNodeAtNode(m);T.typeAnnotation=m,m=this.finishNode(T,"TSOptionalType")}}if(f){let b=this.startNodeAt(l,o);b.typeAnnotation=m,m=this.finishNode(b,"TSRestType")}return m}tsParseTupleType(){let o=this.startNode();o.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let l=!1;return o.elementTypes.forEach((f)=>{let{type:m}=f;if(l&&m!=="TSRestType"&&m!=="TSOptionalType"&&!(m==="TSNamedTupleMember"&&f.optional))this.raise(f.start,D.OptionalTypeBeforeRequired);if(l||=m==="TSNamedTupleMember"&&f.optional||m==="TSOptionalType",m==="TSRestType")f=f.typeAnnotation}),this.finishNode(o,"TSTupleType")}tsParseTemplateLiteralType(){let o=this.startNode();return o.literal=this.parseTemplate({isTagged:!1}),this.finishNode(o,"TSLiteralType")}tsParseTypeReference(){let o=this.startNode();if(o.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational())o.typeArguments=this.tsParseTypeArguments();return this.finishNode(o,"TSTypeReference")}tsMatchLeftRelational(){return this.match(s.relational)&&this.value==="<"}tsMatchRightRelational(){return this.match(s.relational)&&this.value===">"}tsParseParenthesizedType(){let o=this.startNode();return this.expect(s.parenL),o.typeAnnotation=this.tsParseType(),this.expect(s.parenR),this.finishNode(o,"TSParenthesizedType")}tsParseNonArrayType(){switch(this.type){case s.string:case s.num:case s._true:case s._false:return this.tsParseLiteralTypeNode();case s.plusMin:if(this.value==="-"){let o=this.startNode();if(this.lookahead().type!==s.num)this.unexpected();return o.literal=this.parseMaybeUnary(),this.finishNode(o,"TSLiteralType")}break;case s._this:return this.tsParseThisTypeOrThisTypePredicate();case s._typeof:return this.tsParseTypeQuery();case s._import:return this.tsParseImportType();case s.braceL:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case s.bracketL:return this.tsParseTupleType();case s.parenL:return this.tsParseParenthesizedType();case s.backQuote:case s.dollarBraceL:return this.tsParseTemplateLiteralType();default:{let{type:o}=this;if(k(o)||o===s._void||o===s._null){let l=o===s._void?"TSVoidKeyword":o===s._null?"TSNullKeyword":uf(this.value);if(l!==void 0&&this.lookaheadCharCode()!==46){let f=this.startNode();return this.next(),this.finishNode(f,l)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let o=this.tsParseNonArrayType();while(!this.hasPrecedingLineBreak()&&this.eat(s.bracketL))if(this.match(s.bracketR)){let l=this.startNodeAtNode(o);l.elementType=o,this.expect(s.bracketR),o=this.finishNode(l,"TSArrayType")}else{let l=this.startNodeAtNode(o);l.objectType=o,l.indexType=this.tsParseType(),this.expect(s.bracketR),o=this.finishNode(l,"TSIndexedAccessType")}return o}tsParseTypeOperatorOrHigher(){return _(this.type)&&!this.containsEsc?this.tsParseTypeOperator():this.isContextual("infer")?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),s.bitwiseAND)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),s.bitwiseOR)}tsParseNonConditionalType(){if(this.tsIsStartOfFunctionType())return this.tsParseFunctionOrConstructorType("TSFunctionType");if(this.match(s._new))return this.tsParseFunctionOrConstructorType("TSConstructorType");else if(this.isAbstractConstructorSignature())return this.tsParseFunctionOrConstructorType("TSConstructorType",!0);return this.tsParseUnionTypeOrHigher()}tsParseType(){Io(this.inType);let o=this.tsParseNonConditionalType();if(this.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(s._extends))return o;let l=this.startNodeAtNode(o);return l.checkType=o,l.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(s.question),l.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(s.colon),l.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(l,"TSConditionalType")}tsIsUnambiguouslyIndexSignature(){if(this.next(),L(this.type))return this.next(),this.match(s.colon);return!1}tsInType(o){let l=this.inType;this.inType=!0;try{return o()}finally{this.inType=l}}tsTryParseIndexSignature(o){if(!(this.match(s.bracketL)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(s.bracketL);let l=this.parseIdent();l.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(l),this.expect(s.bracketR),o.parameters=[l];let f=this.tsTryParseTypeAnnotation();if(f)o.typeAnnotation=f;return this.tsParseTypeMemberSemicolon(),this.finishNode(o,"TSIndexSignature")}tsParseNoneModifiers(o){this.tsParseModifiers({modified:o,allowedModifiers:[],disallowedModifiers:["in","out"],errorTemplate:D.InvalidModifierOnTypeParameterPositions})}tsParseTypeParameter(o=this.tsParseNoneModifiers.bind(this)){let l=this.startNode();return o(l),l.name=this.tsParseTypeParameterName(),l.constraint=this.tsEatThenParseType(s._extends),l.default=this.tsEatThenParseType(s.eq),this.finishNode(l,"TSTypeParameter")}tsParseTypeParameters(o){let l=this.startNode();if(this.tsMatchLeftRelational()||this.matchJsx("jsxTagStart"))this.next();else this.unexpected();let f={value:-1};if(l.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,o),!1,!0,f),l.params.length===0)this.raise(this.start,D.EmptyTypeParameters);if(f.value!==-1)this.addExtra(l,"trailingComma",f.value);return this.finishNode(l,"TSTypeParameterDeclaration")}tsTryParseTypeParameters(o){if(this.tsMatchLeftRelational())return this.tsParseTypeParameters(o)}tsTryParse(o){let l=this.beginParseEffectScope(),f;try{f=o()}catch(m){throw this.parseEffects.rollback(l),m}if(f!==void 0&&f!==!1)return this.parseEffects.commit(l),f;this.parseEffects.rollback(l);return}tsTokenCanFollowModifier(){return(this.match(s.bracketL)||this.match(s.braceL)||this.match(s.star)||this.match(s.ellipsis)||this.match(s.privateId)||this.isLiteralPropertyName())&&!this.hasPrecedingLineBreak()}tsNextTokenCanFollowModifier(){return this.next(!0),this.tsTokenCanFollowModifier()}tsParseModifier(o,l){let f=this.value;if(o.indexOf(f)!==-1&&!this.containsEsc){if(l&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return f}return}tsParseModifiersByMap({modified:o,map:l}){for(let f of Object.keys(l))o[f]=l[f]}tsParseModifiers({modified:o,allowedModifiers:l,disallowedModifiers:f,stopOnStartOfClassStaticBlock:m,errorTemplate:b=D.InvalidModifierOnTypeMember}){let T={},S=(P,E,O,K)=>{if(E===O&&o[K])this.raise(P.column,D.InvalidModifiersOrder({orderedModifiers:[O,K]}))},A=(P,E,O,K)=>{if(o[O]&&E===K||o[K]&&E===O)this.raise(P.column,D.IncompatibleModifiers({modifiers:[O,K]}))};for(;;){let P=this.startLoc,E=this.tsParseModifier(l.concat(f??[]),m);if(!E)break;if(Lo(E))if(o.accessibility)this.raise(this.start,D.DuplicateAccessibilityModifier());else S(P,E,E,"override"),S(P,E,E,"static"),S(P,E,E,"readonly"),S(P,E,E,"accessor"),T.accessibility=E,o.accessibility=E;else if(sf(E))if(o[E])this.raise(this.start,D.DuplicateModifier({modifier:E}));else S(P,E,"in","out"),T[E]=E,o[E]=!0;else if(rf(E))if(o[E])this.raise(this.start,D.DuplicateModifier({modifier:E}));else A(P,E,"accessor","readonly"),A(P,E,"accessor","override"),T[E]=E,o[E]=!0;else if(E==="const")if(o[E])this.raise(this.start,D.DuplicateModifier({modifier:E}));else T[E]=E,o[E]=!0;else if(Object.hasOwnProperty.call(o,E))this.raise(this.start,D.DuplicateModifier({modifier:E}));else S(P,E,"static","readonly"),S(P,E,"static","override"),S(P,E,"override","readonly"),S(P,E,"abstract","override"),A(P,E,"declare","override"),A(P,E,"static","abstract"),T[E]=E,o[E]=!0;if(f?.includes(E))this.raise(this.start,b)}return T}tsParseInOutModifiers(o){this.tsParseModifiers({modified:o,allowedModifiers:["in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:D.InvalidModifierOnTypeParameter})}tsParseClassTypeParameterModifiers(o){this.tsParseModifiers({modified:o,allowedModifiers:["const","in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:D.InvalidModifierOnTypeParameter})}parseMaybeUnary(o,l,f,m){if(!e?.jsx&&this.tsMatchLeftRelational())return this.tsParseTypeAssertion();else return super.parseMaybeUnary(o,l,f,m)}tsParseTypeAssertion(){if(n)this.raise(this.start,D.ReservedTypeAssertion);let o=this.tryParse(()=>{let l=this.startNode(),f=this.tsTryNextParseConstantContext();return l.typeAnnotation=f||this.tsNextThenParseType(),this.expect(s.relational),l.expression=this.parseMaybeUnary(),this.finishNode(l,"TSTypeAssertion")});if(o.error)return this.tsParseTypeParameters(this.tsParseConstModifier);else return o.node}tsParseTypeArguments(o=!1){let l=this.startNode();if(l.params=this.tsInType(()=>this.tsInNoContext(()=>(this.expect(s.relational),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),l.params.length===0)this.raise(this.start,D.EmptyTypeArguments);if(o&&this.curContext()!==C.tc_oTag)this.reScan_lt_gt();if(!this.tsMatchRightRelational())this.unexpected();return this.exprAllowed=!1,this.next(),this.finishNode(l,"TSTypeParameterInstantiation")}tsParseHeritageClause(o){let l=this.start,f=this.tsParseDelimitedList("HeritageClauseElement",()=>{let m=this.startNode();if(m.expression=this.tsParseEntityName(),this.tsMatchLeftRelational())m.typeParameters=this.tsParseTypeArguments();return this.finishNode(m,"TSExpressionWithTypeArguments")});if(!f.length)this.raise(l,D.EmptyHeritageClauseType({token:o}));return f}tsParseTypeMemberSemicolon(){if(!this.eat(s.comma)&&!this.isLineTerminator())this.expect(s.semi)}tsTryParseAndCatch(o){let l=this.tryParse((f)=>o()||f());if(l.aborted||!l.node)return;return l.node}tsParseSignatureMember(o,l){return this.tsFillSignature(s.colon,l),this.tsParseTypeMemberSemicolon(),this.finishNode(l,o)}tsParsePropertyOrMethodSignature(o,l){if(this.eat(s.question))o.optional=!0;let f=o;if(this.match(s.parenL)||this.tsMatchLeftRelational()){if(l)this.raise(o.start,D.ReadonlyForMethodSignature);let m=f;if(m.kind&&this.tsMatchLeftRelational())this.raise(this.start,D.AccesorCannotHaveTypeParameters);this.tsFillSignature(s.colon,m),this.tsParseTypeMemberSemicolon();let b="parameters",T="typeAnnotation";if(m.kind==="get"){if(m[b].length>0){if(this.raise(this.start,"A 'get' accesor must not have any formal parameters."),this.isThisParam(m[b][0]))this.raise(this.start,D.AccesorCannotDeclareThisParameter)}}else if(m.kind==="set"){if(m[b].length!==1)this.raise(this.start,"A 'get' accesor must not have any formal parameters.");else{let S=m[b][0];if(this.isThisParam(S))this.raise(this.start,D.AccesorCannotDeclareThisParameter);if(S.type==="Identifier"&&S.optional)this.raise(this.start,D.SetAccesorCannotHaveOptionalParameter);if(S.type==="RestElement")this.raise(this.start,D.SetAccesorCannotHaveRestParameter)}if(m[T])this.raise(m[T].start,D.SetAccesorCannotHaveReturnType)}else m.kind="method";return this.finishNode(m,"TSMethodSignature")}else{let m=f;if(l)m.readonly=!0;let b=this.tsTryParseTypeAnnotation();if(b)m.typeAnnotation=b;return this.tsParseTypeMemberSemicolon(),this.finishNode(m,"TSPropertySignature")}}tsParseTypeMember(){let o=this.startNode();if(this.match(s.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSCallSignatureDeclaration",o);if(this.match(s._new)){let f=this.startNode();if(this.next(),this.match(s.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSConstructSignatureDeclaration",o);else return o.key=this.createIdentifier(f,"new"),this.tsParsePropertyOrMethodSignature(o,!1)}this.tsParseModifiers({modified:o,allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]});let l=this.tsTryParseIndexSignature(o);if(l)return l;if(this.parsePropertyName(o),!o.computed&&o.key.type==="Identifier"&&(o.key.name==="get"||o.key.name==="set")&&this.tsTokenCanFollowModifier())o.kind=o.key.name,this.parsePropertyName(o);return this.tsParsePropertyOrMethodSignature(o,!!o.readonly)}tsParseList(o,l){let f=[];while(!this.tsIsListTerminator(o))f.push(l());return f}tsParseObjectTypeMembers(){this.expect(s.braceL);let o=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(s.braceR),o}tsParseInterfaceDeclaration(o,l={}){if(this.hasFollowingLineBreak())return null;if(this.expectContextual("interface"),l.declare)o.declare=!0;if(L(this.type)){o.id=this.parseIdent(),this.checkLValSimple(o.id,V.BIND_TS_INTERFACE);let m=this.currentScope();this.maybeExportDefined(m,o.id.name)}else o.id=null,this.raise(this.start,D.MissingInterfaceName);if(o.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.eat(s._extends))o.extends=this.tsParseHeritageClause("extends");let f=this.startNode();return f.body=this.tsParseInterfaceBody(),o.body=this.finishNode(f,"TSInterfaceBody"),this.finishNode(o,"TSInterfaceDeclaration")}tsParseInterfaceBody(){this.expect(s.braceL);let o=this.inType;this.inType=!0;let l=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.inType=o,this.expect(s.braceR),l}tsParseAbstractDeclaration(o){if(this.match(s._class))return o.abstract=!0,this.parseClass(o,!0);else if(this.ts_isContextual(g.interface)){if(!this.hasFollowingLineBreak())return o.abstract=!0,this.tsParseInterfaceDeclaration(o)}else this.unexpected(o.start)}tsIsDeclarationStart(){return B(this.type)}tsParseExpressionStatement(o,l){switch(l.name){case"declare":{let f=this.tsTryParseDeclare(o);if(f)return f.declare=!0,f;break}case"global":if(this.match(s.braceL)){this.enterScope(rn);let f=o;return f.global=!0,f.id=l,f.body=this.tsParseModuleBlock(),super.exitScope(),this.finishNode(f,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(o,l.name,!1)}}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsIsExportDefaultSpecifier(){let{type:o}=this,l=this.isAsyncFunction(),f=this.isLet();if(L(o)){if(l&&!this.containsEsc||f)return!1;if((o===g.type||o===g.interface)&&!this.containsEsc){let T=this.lookahead();if(L(T.type)&&!this.isContextualWithState("from",T)||T.type===s.braceL)return!1}}else if(!this.match(s._default))return!1;let m=this.nextTokenStart(),b=this.isUnparsedContextual(m,"from");if(this.input.charCodeAt(m)===44||L(this.type)&&b)return!0;if(this.match(s._default)&&b){let T=this.input.charCodeAt(this.nextTokenStartSince(m+4));return T===34||T===39}return!1}tsInAmbientContext(o){let l=this.isAmbientContext;this.isAmbientContext=!0;try{return o()}finally{this.isAmbientContext=l}}tsCheckLineTerminator(o){if(o){if(this.hasFollowingLineBreak())return!1;return this.next(),!0}return!this.isLineTerminator()}tsParseModuleOrNamespaceDeclaration(o,l=!1){if(o.id=this.parseIdent(),!l)this.checkLValSimple(o.id,V.BIND_TS_NAMESPACE);if(this.eat(s.dot)){let f=this.startNode();this.tsParseModuleOrNamespaceDeclaration(f,!0),o.body=f}else this.enterScope(rn),o.body=this.tsParseModuleBlock(),super.exitScope();return this.finishNode(o,"TSModuleDeclaration")}checkLValSimple(o,l=V.BIND_NONE,f){while(o.type==="TSNonNullExpression"||o.type==="TSAsExpression"||o.type==="TSSatisfiesExpression"||o.type==="TSTypeAssertion")o=o.expression;return super.checkLValSimple(o,l,f)}isSimpleAssignTarget(o){while(o.type==="TSNonNullExpression"||o.type==="TSAsExpression"||o.type==="TSSatisfiesExpression"||o.type==="TSTypeAssertion")o=o.expression;return super.isSimpleAssignTarget(o)}tsParseTypeAliasDeclaration(o){o.id=this.parseIdent(),this.checkLValSimple(o.id,V.BIND_TS_TYPE);let l=this.currentScope();return this.maybeExportDefined(l,o.id.name),o.typeAnnotation=this.tsInType(()=>{if(o.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.expect(s.eq),this.ts_isContextual(g.interface)&&this.lookahead().type!==s.dot){let f=this.startNode();return this.next(),this.finishNode(f,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(o,"TSTypeAliasDeclaration")}tsParseDeclaration(o,l,f){switch(l){case"abstract":if(this.tsCheckLineTerminator(f)&&(this.match(s._class)||L(this.type)))return this.tsParseAbstractDeclaration(o);break;case"module":if(this.tsCheckLineTerminator(f)){if(this.match(s.string))return this.tsParseAmbientExternalModuleDeclaration(o);else if(L(this.type))return this.tsParseModuleOrNamespaceDeclaration(o)}break;case"namespace":if(this.tsCheckLineTerminator(f)&&L(this.type))return this.tsParseModuleOrNamespaceDeclaration(o);break;case"type":if(this.tsCheckLineTerminator(f)&&L(this.type))return this.tsParseTypeAliasDeclaration(o);break}}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.value,!0)}tsParseImportEqualsDeclaration(o,l){o.isExport=l||!1,o.id=this.parseIdent(),this.checkLValSimple(o.id,V.BIND_LEXICAL),super.expect(s.eq);let f=this.tsParseModuleReference();if(o.importKind==="type"&&f.type!=="TSExternalModuleReference")this.raise(f.start,D.ImportAliasHasImportType);return o.moduleReference=f,super.semicolon(),this.finishNode(o,"TSImportEqualsDeclaration")}isExportDefaultSpecifier(){if(this.tsIsDeclarationStart())return!1;let{type:o}=this;if(L(o)){if(this.isContextual("async")||this.isContextual("let"))return!1;if((o===g.type||o===g.interface)&&!this.containsEsc){let m=this.lookahead();if(L(m.type)&&!this.isContextualWithState("from",m)||m.type===s.braceL)return!1}}else if(!this.match(s._default))return!1;let l=this.nextTokenStart(),f=this.isUnparsedContextual(l,"from");if(this.input.charCodeAt(l)===44||L(this.type)&&f)return!0;if(this.match(s._default)&&f){let m=this.input.charCodeAt(this.nextTokenStartSince(l+4));return m===34||m===39}return!1}parseTemplate({isTagged:o=!1}={}){let l=this.startNode();this.next(),l.expressions=[];let f=this.parseTemplateElement({isTagged:o});l.quasis=[f];while(!f.tail){if(this.type===s.eof)this.raise(this.pos,"Unterminated template literal");this.expect(s.dollarBraceL),l.expressions.push(this.inType?this.tsParseType():this.parseExpression()),this.expect(s.braceR),l.quasis.push(f=this.parseTemplateElement({isTagged:o}))}return this.next(),this.finishNode(l,"TemplateLiteral")}parseFunction(o,l,f,m,b){if(this.initFunction(o),this.ecmaVersion>=9||this.ecmaVersion>=6&&!m){if(this.type===s.star&&l&_o)this.unexpected();o.generator=this.eat(s.star)}if(this.ecmaVersion>=8)o.async=!!m;if(l&Kn)o.id=l&af&&this.type!==s.name?null:this.parseIdent();let T=this.yieldPos,S=this.awaitPos,A=this.awaitIdentPos,P=this.maybeInArrowParameters;if(this.maybeInArrowParameters=!1,this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(mi(o.async,o.generator)),!(l&Kn))o.id=this.type===s.name?this.parseIdent():null;this.parseFunctionParams(o);let E=l&Kn;if(this.parseFunctionBody(o,f,!1,b,{isFunctionDeclaration:E}),E&&this.isAmbientContext&&o.id){if(this.currentScope().flags&V.SCOPE_TOP)this.declareName(o.id.name,V.BIND_FLAGS_TS_EXPORT_ONLY,o.id.start)}if(this.yieldPos=T,this.awaitPos=S,this.awaitIdentPos=A,l&Kn&&o.id&&!(l&_o))if(o.body)this.checkLValSimple(o.id,this.strict||o.generator||o.async?this.treatFunctionsAsVar?V.BIND_VAR:V.BIND_LEXICAL:V.BIND_FUNCTION);else this.checkLValSimple(o.id,V.BIND_NONE);return this.maybeInArrowParameters=P,this.finishNode(o,E?"FunctionDeclaration":"FunctionExpression")}parseFunctionBody(o,l=!1,f=!1,m=!1,b){if(this.match(s.colon))o.returnType=this.tsParseTypeOrTypePredicateAnnotation(s.colon);let T=b?.isFunctionDeclaration?"TSDeclareFunction":b?.isClassMethod?"TSDeclareMethod":void 0;if(T&&!this.match(s.braceL)&&this.isLineTerminator())return this.exitScope(),this.finishNode(o,T);if(T==="TSDeclareFunction"&&this.isAmbientContext){if(this.raise(o.start,D.DeclareFunctionHasImplementation),o.declare)return super.parseFunctionBody(o,l,f,!1),this.finishNode(o,T)}return super.parseFunctionBody(o,l,f,m),o}parseNew(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");let o=this.startNode(),l=this.parseIdent(!0);if(this.ecmaVersion>=6&&this.eat(s.dot)){o.meta=l;let S=this.containsEsc;if(o.property=this.parseIdent(!0),o.property.name!=="target")this.raiseRecoverable(o.property.start,"The only valid meta property for new is 'new.target'");if(S)this.raiseRecoverable(o.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(o.start,"'new.target' can only be used in functions and class static block");return this.finishNode(o,"MetaProperty")}let f=this.start,m=this.startLoc,b=this.type===s._import;if(o.callee=this.parseSubscripts(this.parseExprAtom(),f,m,!0,!1),b&&o.callee.type==="ImportExpression")this.raise(f,"Cannot use new with import()");let{callee:T}=o;if(T.type==="TSInstantiationExpression"&&!T.extra?.parenthesized)o.typeArguments=T.typeArguments,o.callee=T.expression;if(this.eat(s.parenL))o.arguments=this.parseExprList(s.parenR,this.ecmaVersion>=8,!1);else o.arguments=[];return this.finishNode(o,"NewExpression")}parseExprOp(o,l,f,m,b){if(s._in.binop>m&&!this.hasPrecedingLineBreak()){let T;if(this.isContextual("as"))T="TSAsExpression";if(this.isContextual("satisfies"))T="TSSatisfiesExpression";if(T){let S=this.startNodeAt(l,f);S.expression=o;let A=this.tsTryNextParseConstantContext();if(A)S.typeAnnotation=A;else S.typeAnnotation=this.tsNextThenParseType();return this.finishNode(S,T),this.reScan_lt_gt(),this.parseExprOp(S,l,f,m,b)}}return super.parseExprOp(o,l,f,m,b)}parseImportSpecifiers(){let o=[],l=!0;if(a.tokenIsIdentifier(this.type)){if(o.push(this.parseImportDefaultSpecifier()),!this.eat(s.comma))return o}if(this.type===s.star)return o.push(this.parseImportNamespaceSpecifier()),o;this.expect(s.braceL);while(!this.eat(s.braceR)){if(!l){if(this.expect(s.comma),this.afterTrailingComma(s.braceR))break}else l=!1;o.push(this.parseImportSpecifier())}return o}parseImport(o){let l=this.lookahead();if(o.importKind="value",this.importOrExportOuterKind="value",L(l.type)||this.match(s.star)||this.match(s.braceL)){let f=this.lookahead(2);if(f.type!==s.comma&&!this.isContextualWithState("from",f)&&f.type!==s.eq&&this.ts_eatContextualWithState("type",1,l))this.importOrExportOuterKind="type",o.importKind="type",l=this.lookahead(),f=this.lookahead(2);if(L(l.type)&&f.type===s.eq){this.next();let m=this.tsParseImportEqualsDeclaration(o);return this.importOrExportOuterKind="value",m}}if(this.next(),this.type===s.string)o.specifiers=[],o.source=this.parseExprAtom();else o.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),o.source=this.type===s.string?this.parseExprAtom():this.unexpected();if(this.parseMaybeImportAttributes(o),this.semicolon(),this.finishNode(o,"ImportDeclaration"),this.importOrExportOuterKind="value",o.importKind==="type"&&o.specifiers.length>1&&o.specifiers[0].type==="ImportDefaultSpecifier")this.raise(o.start,D.TypeImportCannotSpecifyDefaultAndNamed);return o}parseExportDefaultDeclaration(){if(this.isAbstractClass()){let o=this.startNode();return this.next(),o.abstract=!0,this.parseClass(o,!0)}if(this.match(g.interface)){let o=this.tsParseInterfaceDeclaration(this.startNode());if(o)return o}return super.parseExportDefaultDeclaration()}parseExportAllDeclaration(o,l){if(this.ecmaVersion>=11)if(this.eatContextual("as"))o.exported=this.parseModuleExportName(),this.checkExport(l,o.exported,this.lastTokStart);else o.exported=null;if(this.expectContextual("from"),this.type!==s.string)this.unexpected();return o.source=this.parseExprAtom(),this.parseMaybeImportAttributes(o),this.semicolon(),this.finishNode(o,"ExportAllDeclaration")}parseDynamicImport(o){if(this.next(),o.source=this.parseMaybeAssign(),this.eat(s.comma)){let l=this.parseExpression();o.arguments=[l]}if(!this.eat(s.parenR)){let l=this.start;if(this.eat(s.comma)&&this.eat(s.parenR))this.raiseRecoverable(l,"Trailing comma is not allowed in import()");else this.unexpected(l)}return this.finishNode(o,"ImportExpression")}parseExport(o,l){let f=this.lookahead();if(this.ts_eatWithState(s._import,2,f)){if(this.ts_isContextual(g.type)&&this.lookaheadCharCode()!==61)o.importKind="type",this.importOrExportOuterKind="type",this.next();else o.importKind="value",this.importOrExportOuterKind="value";let m=this.tsParseImportEqualsDeclaration(o,!0);return this.importOrExportOuterKind=void 0,m}else if(this.ts_eatWithState(s.eq,2,f)){let m=o;return m.expression=this.parseExpression(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(m,"TSExportAssignment")}else if(this.ts_eatContextualWithState("as",2,f)){let m=o;return this.expectContextual("namespace"),m.id=this.parseIdent(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(m,"TSNamespaceExportDeclaration")}else{let m=this.lookahead(2).type;if(this.ts_isContextualWithState(f,g.type)&&(m===s.braceL||m===s.star))this.next(),this.importOrExportOuterKind="type",o.exportKind="type";else this.importOrExportOuterKind="value",o.exportKind="value";if(this.next(),this.eat(s.star))return this.parseExportAllDeclaration(o,l);if(this.eat(s._default))return this.checkExport(l,"default",this.lastTokStart),o.declaration=this.parseExportDefaultDeclaration(),this.finishNode(o,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(o.declaration=this.parseExportDeclaration(o),o.declaration.type==="VariableDeclaration")this.checkVariableExport(l,o.declaration.declarations);else this.checkExport(l,o.declaration.id,o.declaration.id.start);o.specifiers=[],o.source=null}else{if(o.declaration=null,o.specifiers=this.parseExportSpecifiers(l),this.eatContextual("from")){if(this.type!==s.string)this.unexpected();o.source=this.parseExprAtom(),this.parseMaybeImportAttributes(o)}else{for(let b of o.specifiers)if(this.checkUnreserved(b.local),this.checkLocalExport(b.local),b.local.type==="Literal")this.raise(b.local.start,"A string literal cannot be used as an exported binding without `from`.");o.source=null}this.semicolon()}return this.finishNode(o,"ExportNamedDeclaration")}}checkExport(o,l,f){if(!o)return;if(typeof l!=="string")l=l.type==="Identifier"?l.name:l.value;o[l]=!0}parseMaybeDefault(o,l,f){let m=super.parseMaybeDefault(o,l,f);if(m.type==="AssignmentPattern"&&m.typeAnnotation&&m.right.start<m.typeAnnotation.start)this.raise(m.typeAnnotation.start,D.TypeAnnotationAfterAssign);return m}typeCastToParameter(o){return o.expression.typeAnnotation=o.typeAnnotation,this.resetEndLocation(o.expression,o.typeAnnotation.end,o.typeAnnotation.loc?.end),o.expression}toAssignableList(o,l){if(!o)o=[];for(let f=0;f<o.length;f++){let m=o[f];if(m?.type==="TSTypeCastExpression")o[f]=this.typeCastToParameter(m)}return super.toAssignableList(o,l)}reportReservedArrowTypeParam(o){if(o.params.length===1&&!o.extra?.trailingComma&&n)this.raise(o.start,D.ReservedArrowTypeParam)}parseExprAtom(o,l,f){if(this.type===g.jsxText)return this.jsx_parseText();else if(this.type===g.jsxTagStart)return this.jsx_parseElement();else if(this.type===g.at)return this.parseDecorators(),this.parseExprAtom();else if(L(this.type)){let m=this.potentialArrowAt===this.start,b=this.start,T=this.startLoc,S=this.containsEsc,A=this.parseIdent(!1);if(this.ecmaVersion>=8&&!S&&A.name==="async"&&!this.canInsertSemicolon()&&this.eat(s._function))return this.overrideContext(y.f_expr),this.parseFunction(this.startNodeAt(b,T),0,!1,!0,l);if(m&&!this.canInsertSemicolon()){if(this.eat(s.arrow))return this.parseArrowExpression(this.startNodeAt(b,T),[A],!1,l);if(this.ecmaVersion>=8&&A.name==="async"&&this.type===s.name&&!S&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(A=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(s.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(b,T),[A],!0,l)}}return A}else return super.parseExprAtom(o,l,f)}parseExprAtomDefault(){if(L(this.type)){let o=this.potentialArrowAt===this.start,l=this.containsEsc,f=this.parseIdent();if(!l&&f.name==="async"&&!this.canInsertSemicolon()){let{type:m}=this;if(m===s._function)return this.next(),this.parseFunction(this.startNodeAtNode(f),void 0,!0,!0);else if(L(m))if(this.lookaheadCharCode()===61){let b=this.parseIdent(!1);if(this.canInsertSemicolon()||!this.eat(s.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAtNode(f),[b],!0)}else return f}if(o&&this.match(s.arrow)&&!this.canInsertSemicolon())return this.next(),this.parseArrowExpression(this.startNodeAtNode(f),[f],!1);return f}else this.unexpected()}parseIdentNode(){let o=this.startNode();if(k(this.type)&&!((this.type.keyword==="class"||this.type.keyword==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)))o.name=this.value;else return super.parseIdentNode();return o}parseVarStatement(o,l,f=!1){let{isAmbientContext:m}=this;this.next(),super.parseVar(o,!1,l,f||m),this.semicolon();let b=this.finishNode(o,"VariableDeclaration");if(!m)return b;for(let{id:T,init:S}of b.declarations){if(!S)continue;if(l!=="const"||!!T.typeAnnotation)this.raise(S.start,D.InitializerNotAllowedInAmbientContext);else if(S.type!=="Literal"&&(S.type!=="TemplateLiteral"||S.expressions.length>0)&&!pf(S)&&!of(S))this.raise(S.start,D.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference)}return b}parseStatement(o,l,f){if(this.match(g.at))this.parseDecorators(!0);if(this.match(s._const)&&this.isLookaheadContextual("enum")){let m=this.startNode();return this.expect(s._const),this.tsParseEnumDeclaration(m,{const:!0})}if(this.ts_isContextual(g.enum))return this.tsParseEnumDeclaration(this.startNode());if(this.ts_isContextual(g.interface)){let m=this.tsParseInterfaceDeclaration(this.startNode());if(m)return m}return super.parseStatement(o,l,f)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}parsePostMemberNameModifiers(o){if(this.eat(s.question))o.optional=!0;if(o.readonly&&this.match(s.parenL))this.raise(o.start,D.ClassMethodHasReadonly);if(o.declare&&this.match(s.parenL))this.raise(o.start,D.ClassMethodHasDeclare)}parseExpressionStatement(o,l){return(l.type==="Identifier"?this.tsParseExpressionStatement(o,l):void 0)||super.parseExpressionStatement(o,l)}shouldParseExportStatement(){if(this.tsIsDeclarationStart())return!0;if(this.match(g.at))return!0;return super.shouldParseExportStatement()}parseConditional(o,l,f,m,b){if(this.eat(s.question)){let T=this.startNodeAt(l,f);return T.test=o,T.consequent=this.parseMaybeAssign(),this.expect(s.colon),T.alternate=this.parseMaybeAssign(m),this.finishNode(T,"ConditionalExpression")}return o}parseMaybeConditional(o,l){let f=this.start,m=this.startLoc,b=this.parseExprOps(o,l);if(this.checkExpressionErrors(l))return b;if(!this.maybeInArrowParameters||!this.match(s.question))return this.parseConditional(b,f,m,o,l);let T=this.tryParse(()=>this.parseConditional(b,f,m,o,l));if(!T.node){if(T.error)this.setOptionalParametersError(l,T.error);return b}return T.node}parseParenItem(o){let l=this.start,f=this.startLoc;if(o=super.parseParenItem(o),this.eat(s.question))o.optional=!0,this.resetEndLocation(o);if(this.match(s.colon)){let m=this.startNodeAt(l,f);return m.expression=o,m.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(m,"TSTypeCastExpression")}return o}parseExportDeclaration(o){if(!this.isAmbientContext&&this.ts_isContextual(g.declare))return this.tsInAmbientContext(()=>this.parseExportDeclaration(o));let l=this.start,f=this.startLoc,m=this.eatContextual("declare");if(m&&(this.ts_isContextual(g.declare)||!this.shouldParseExportStatement()))this.raise(this.start,D.ExpectedAmbientAfterExportDeclare);let T=L(this.type)&&this.tsTryParseExportDeclaration()||this.parseStatement(null);if(!T)return null;if(T.type==="TSInterfaceDeclaration"||T.type==="TSTypeAliasDeclaration"||m)o.exportKind="type";if(m)this.resetStartLocation(T,l,f),T.declare=!0;return T}parseClassId(o,l){if(!l&&this.isContextual("implements"))return;super.parseClassId(o,l);let f=this.tsTryParseTypeParameters(this.tsParseClassTypeParameterModifiers.bind(this));if(f)o.typeParameters=f}parseClassPropertyAnnotation(o){if(!o.optional){if(this.value==="!"&&this.eat(s.prefix))o.definite=!0;else if(this.eat(s.question))o.optional=!0}let l=this.tsTryParseTypeAnnotation();if(l)o.typeAnnotation=l}parseClassField(o){if(o.key.type==="PrivateIdentifier"){if(o.abstract)this.raise(o.start,D.PrivateElementHasAbstract);if(o.accessibility)this.raise(o.start,D.PrivateElementHasAccessibility({modifier:o.accessibility}));this.parseClassPropertyAnnotation(o)}else{if(this.parseClassPropertyAnnotation(o),this.isAmbientContext&&!(o.readonly&&!o.typeAnnotation)&&this.match(s.eq))this.raise(this.start,D.DeclareClassFieldHasInitializer);if(o.abstract&&this.match(s.eq)){let{key:f}=o;this.raise(this.start,D.AbstractPropertyHasInitializer({propertyName:f.type==="Identifier"&&!o.computed?f.name:`[${this.input.slice(f.start,f.end)}]`}))}}return super.parseClassField(o)}parseClassMethod(o,l,f,m){let b=o.kind==="constructor",T=o.key.type==="PrivateIdentifier",S=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(T){if(S)o.typeParameters=S;if(o.accessibility)this.raise(o.start,D.PrivateMethodsHasAccessibility({modifier:o.accessibility}))}else if(S&&b)this.raise(S.start,D.ConstructorHasTypeParameters);let{declare:A=!1,kind:P}=o;if(A&&(P==="get"||P==="set"))this.raise(o.start,D.DeclareAccessor({kind:P}));if(S)o.typeParameters=S;let E=o.key;if(o.kind==="constructor"){if(l)this.raise(E.start,"Constructor can't be a generator");if(f)this.raise(E.start,"Constructor can't be an async method")}else if(o.static&&wo(o,"prototype"))this.raise(E.start,"Classes may not have a static property named prototype");let O=o.value=this.parseMethod(l,f,m,!0,o);if(o.kind==="get"&&O.params.length!==0)this.raiseRecoverable(O.start,"getter should have no params");if(o.kind==="set"&&O.params.length!==1)this.raiseRecoverable(O.start,"setter should have exactly one param");if(o.kind==="set"&&O.params[0].type==="RestElement")this.raiseRecoverable(O.params[0].start,"Setter cannot use rest params");return this.finishNode(o,"MethodDefinition")}isClassMethod(){return this.match(s.relational)}parseClassElement(o){if(this.eat(s.semi))return null;let l=this.startNode(),f="",m=!1,b=!1,T="method",S=!1,A=["declare","private","public","protected","accessor","override","abstract","readonly","static"],P=this.tsParseModifiers({modified:l,allowedModifiers:A,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:D.InvalidModifierOnTypeParameterPositions});S=Boolean(P.static);let E=()=>{if(this.tsIsStartOfStaticBlocks()){if(this.next(),this.next(),this.tsHasSomeModifiers(l,A))this.raise(this.start,D.StaticBlockCannotHaveModifier);if(this.ecmaVersion>=13)return super.parseClassStaticBlock(l),l}else{let O=this.tsTryParseIndexSignature(l);if(O){if(l.abstract)this.raise(l.start,D.IndexSignatureHasAbstract);if(l.accessibility)this.raise(l.start,D.IndexSignatureHasAccessibility({modifier:l.accessibility}));if(l.declare)this.raise(l.start,D.IndexSignatureHasDeclare);if(l.override)this.raise(l.start,D.IndexSignatureHasOverride);return O}if(!this.inAbstractClass&&l.abstract)this.raise(l.start,D.NonAbstractClassHasAbstractMethod);if(l.override){if(!o)this.raise(l.start,D.OverrideNotInSubClass)}if(l.static=S,S){if(!(this.isClassElementNameStart()||this.type===s.star))f="static"}if(!f&&this.ecmaVersion>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===s.star)&&!this.canInsertSemicolon())b=!0;else f="async";if(!f&&(this.ecmaVersion>=9||!b)&&this.eat(s.star))m=!0;if(!f&&!b&&!m){let K=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())T=K;else f=K}if(f)l.computed=!1,l.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),l.key.name=f,this.finishNode(l.key,"Identifier");else this.parseClassElementName(l);if(this.parsePostMemberNameModifiers(l),this.isClassMethod()||this.ecmaVersion<13||this.type===s.parenL||T!=="method"||m||b){let K=!l.static&&wo(l,"constructor"),W=K&&o;if(K&&T!=="method")this.raise(l.key.start,"Constructor can't have get/set modifier");l.kind=K?"constructor":T,this.parseClassMethod(l,m,b,W)}else this.parseClassField(l);return l}};if(l.declare)this.tsInAmbientContext(E);else E();return l}isClassElementNameStart(){if(this.tsIsIdentifier())return!0;return super.isClassElementNameStart()}parseClassSuper(o){if(super.parseClassSuper(o),o.superClass&&(this.tsMatchLeftRelational()||this.match(s.bitShift)))o.superTypeParameters=this.tsParseTypeArgumentsInExpression();if(this.eatContextual("implements"))o.implements=this.tsParseHeritageClause("implements")}parseFunctionParams(o){let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(l)o.typeParameters=l;super.parseFunctionParams(o)}parseVarId(o,l){if(super.parseVarId(o,l),o.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.value==="!"&&this.eat(s.prefix))o.definite=!0;let f=this.tsTryParseTypeAnnotation();if(f)o.id.typeAnnotation=f,this.resetEndLocation(o.id)}parseArrowExpression(o,l,f,m){if(this.match(s.colon))o.returnType=this.tsParseTypeAnnotation();let b=this.yieldPos,T=this.awaitPos,S=this.awaitIdentPos;this.enterScope(mi(f,!1)|V.SCOPE_ARROW),this.initFunction(o);let A=this.maybeInArrowParameters;if(this.ecmaVersion>=8)o.async=!!f;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.maybeInArrowParameters=!0,o.params=this.toAssignableList(l,!0),this.maybeInArrowParameters=!1,this.parseFunctionBody(o,!0,!1,m),this.yieldPos=b,this.awaitPos=T,this.awaitIdentPos=S,this.maybeInArrowParameters=A,this.finishNode(o,"ArrowFunctionExpression")}parseYield(o){if(!this.yieldPos)this.yieldPos=this.start;let l=this.startNode();this.next();let f=this.tsMatchLeftRelational();if(!(!this.match(s.semi)&&!this.canInsertSemicolon()&&(this.match(s.star)||this.type.startsExpr||f)))return l.delegate=!1,l.argument=null,this.finishNode(l,"YieldExpression");return l.delegate=this.eat(s.star),l.argument=this.parseMaybeAssign(o),this.finishNode(l,"YieldExpression")}parseMaybeAssignOrigin(o,l,f){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(o);else this.exprAllowed=!1;let m=!1,b=-1,T=-1,S=-1;if(l)b=l.parenthesizedAssign,T=l.trailingComma,S=l.doubleProto,l.parenthesizedAssign=l.trailingComma=-1;else l=new sn,m=!0;let A=this.start,P=this.startLoc;if(this.type===s.parenL||L(this.type))this.potentialArrowAt=this.start,this.potentialArrowInForAwait=o==="await";let E=this.parseMaybeConditional(o,l);if(f)E=f.call(this,E,A,P);if(this.type.isAssign){let O=this.startNodeAt(A,P);if(O.operator=this.value,this.type===s.eq)E=this.toAssignable(E,!0,l,!0);if(!m)l.parenthesizedAssign=l.trailingComma=l.doubleProto=-1;if(l.shorthandAssign>=E.start)l.shorthandAssign=-1;if(!this.maybeInArrowParameters)if(this.type===s.eq)this.checkLValPattern(E);else this.checkLValSimple(E);if(O.left=E,this.next(),O.right=this.parseMaybeAssign(o),S>-1)l.doubleProto=S;return this.finishNode(O,"AssignmentExpression")}else if(m)this.checkExpressionErrors(l,!0);if(b>-1)l.parenthesizedAssign=b;if(T>-1)l.trailingComma=T;return E}parseMaybeAssign(o,l,f){let m,b;if(e?.jsx&&(this.matchJsx("jsxTagStart")||this.tsMatchLeftRelational())){if(m=this.tryParse(()=>this.parseMaybeAssignOrigin(o,l,f)),!m.error)return m.node;let A=this.context,P=A[A.length-1],E=A[A.length-2];if(P===a.tokContexts.tc_oTag&&E===a.tokContexts.tc_expr)this.parseEffects.pop(A),this.parseEffects.pop(A);else if(P===a.tokContexts.tc_oTag||P===a.tokContexts.tc_expr)this.parseEffects.pop(A)}if(!m?.error&&!this.tsMatchLeftRelational())return this.parseMaybeAssignOrigin(o,l,f);let T,S=this.tryParse((A)=>{T=this.tsParseTypeParameters(this.tsParseConstModifier);let P=this.parseMaybeAssignOrigin(o,l,f);if(P.type!=="ArrowFunctionExpression"||P.extra?.parenthesized)A();if(T?.params.length!==0)this.resetStartLocationFromNode(P,T);return P.typeParameters=T,P});if(!S.error&&!S.aborted){if(T)this.reportReservedArrowTypeParam(T);return S.node}if(!m){if(Io(!0),b=this.tryParse(()=>this.parseMaybeAssignOrigin(o,l,f)),!b.error)return b.node}if(m?.thrown)throw this.selectTryParseResult(m),m.error;if(S.thrown)throw this.selectTryParseResult(S),S.error;if(b?.thrown)throw this.selectTryParseResult(b),b.error;throw m?.error||S.error||b?.error}parseAssignableListItem(o){let l=[];while(this.match(g.at))l.push(this.parseDecorator());let f=this.start,m=this.startLoc,b,T=!1,S=!1;if(o!==void 0){let E={};if(this.tsParseModifiers({modified:E,allowedModifiers:["public","private","protected","override","readonly"]}),b=E.accessibility,S=E.override,T=E.readonly,o===!1&&(b||T||S))this.raise(m.column,D.UnexpectedParameterModifier)}let A=this.parseMaybeDefault(f,m);this.parseBindingListItem(A);let P=this.parseMaybeDefault(A.start,A.loc.start,A);if(l.length)P.decorators=l;if(b||T||S){let E=this.startNodeAt(f,m);if(b)E.accessibility=b;if(T)E.readonly=T;if(S)E.override=S;if(P.type!=="Identifier"&&P.type!=="AssignmentPattern")this.raise(E.start,D.UnsupportedParameterPropertyKind);return E.parameter=P,this.finishNode(E,"TSParameterProperty")}return P}checkLValInnerPattern(o,l=V.BIND_NONE,f){switch(o.type){case"TSParameterProperty":this.checkLValInnerPattern(o.parameter,l,f);break;default:{super.checkLValInnerPattern(o,l,f);break}}}parseBindingListItem(o){if(this.eat(s.question)){if(o.type!=="Identifier"&&!this.isAmbientContext&&!this.inType)this.raise(o.start,D.PatternIsOptional);o.optional=!0}let l=this.tsTryParseTypeAnnotation();if(l)o.typeAnnotation=l;return this.resetEndLocation(o),o}isAssignable(o,l){switch(o.type){case"TSTypeCastExpression":return this.isAssignable(o.expression,l);case"TSParameterProperty":return!0;case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":{let f=o.properties.length-1;return o.properties.every((m,b)=>m.type!=="ObjectMethod"&&(b===f||m.type!=="SpreadElement")&&this.isAssignable(m))}case"Property":case"ObjectProperty":return this.isAssignable(o.value);case"SpreadElement":return this.isAssignable(o.argument);case"ArrayExpression":return o.elements.every((f)=>f===null||this.isAssignable(f));case"AssignmentExpression":return o.operator==="=";case"ParenthesizedExpression":return this.isAssignable(o.expression);case"MemberExpression":case"OptionalMemberExpression":return!l;default:return!1}}toAssignable(o,l=!1,f=new sn,m=!1){switch(o.type){case"ParenthesizedExpression":return this.toAssignableParenthesizedExpression(o,l,f,m);case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":if(l);else this.raise(o.start,D.UnexpectedTypeCastInParameter);let b=this.toAssignable(o.expression,l,f,m);if(m)return o.expression=b,o;return b;case"MemberExpression":break;case"AssignmentExpression":if(!l&&o.left.type==="TSTypeCastExpression")o.left=this.typeCastToParameter(o.left);return super.toAssignable(o,l,f);case"TSTypeCastExpression":return this.typeCastToParameter(o);default:return super.toAssignable(o,l,f)}return o}toAssignableParenthesizedExpression(o,l,f,m=!1){switch(o.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":let b=this.toAssignable(o.expression,l,f,m);if(m)return o.expression=b,o;return b;default:return super.toAssignable(o,l,f)}}parseBindingAtom(){switch(this.type){case s._this:return this.parseIdent(!0);default:return super.parseBindingAtom()}}shouldParseArrow(o){let l;if(this.match(s.colon))l=o.every((f)=>this.isAssignable(f,!0));else l=!this.canInsertSemicolon();if(l){if(this.match(s.colon)){let f=this.tryParse((m)=>{let b=this.tsParseTypeOrTypePredicateAnnotation(s.colon);if(this.canInsertSemicolon()||!this.match(s.arrow))m();return b});if(f.aborted)return this.shouldParseArrowReturnType=void 0,!1;if(!f.thrown)this.shouldParseArrowReturnType=f.node}if(!this.match(s.arrow))return this.shouldParseArrowReturnType=void 0,!1;return!0}return this.shouldParseArrowReturnType=void 0,l}parseParenArrowList(o,l,f,m){let b=this.startNodeAt(o,l);return b.returnType=this.shouldParseArrowReturnType,this.shouldParseArrowReturnType=void 0,this.parseArrowExpression(b,f,!1,m)}parseParenAndDistinguishExpression(o,l){let f=this.start,m=this.startLoc,b,T=this.ecmaVersion>=8;if(this.ecmaVersion>=6){let S=this.maybeInArrowParameters;this.maybeInArrowParameters=!0,this.next();let A=this.start,P=this.startLoc,E=[],O=!0,K=!1,W=new sn,xe=this.yieldPos,Le=this.awaitPos,Re;this.yieldPos=0,this.awaitPos=0;while(this.type!==s.parenR)if(O?O=!1:this.expect(s.comma),T&&this.afterTrailingComma(s.parenR,!0)){K=!0;break}else if(this.type===s.ellipsis){if(Re=this.start,E.push(this.parseParenItem(this.parseRestBinding())),this.type===s.comma)this.raise(this.start,"Comma is not permitted after the rest element");break}else E.push(this.parseMaybeAssign(!1,W,this.parseParenItem));let Je=this.lastTokEnd,fe=this.lastTokEndLoc;if(this.expect(s.parenR),this.maybeInArrowParameters=S,o&&this.shouldParseArrow(E)&&this.eat(s.arrow))return this.checkPatternErrors(W,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=xe,this.awaitPos=Le,this.parseParenArrowList(f,m,E,l);if(!E.length||K)this.unexpected(this.lastTokStart);if(Re)this.unexpected(Re);if(this.checkExpressionErrors(W,!0),this.yieldPos=xe||this.yieldPos,this.awaitPos=Le||this.awaitPos,E.length>1)b=this.startNodeAt(A,P),b.expressions=E,this.finishNodeAt(b,"SequenceExpression",Je,fe);else b=E[0]}else b=this.parseParenExpression();if(this.options.preserveParens){let S=this.startNodeAt(f,m);return S.expression=b,this.finishNode(S,"ParenthesizedExpression")}else return b}parseTaggedTemplateExpression(o,l,f,m){let b=this.startNodeAt(l,f);if(b.tag=o,b.quasi=this.parseTemplate({isTagged:!0}),m)this.raise(l,"Tagged Template Literals are not allowed in optionalChain.");return this.finishNode(b,"TaggedTemplateExpression")}shouldParseAsyncArrow(){if(this.match(s.colon)){let o=this.tryParse((l)=>{let f=this.tsParseTypeOrTypePredicateAnnotation(s.colon);if(this.canInsertSemicolon()||!this.match(s.arrow))l();return f});if(o.aborted)return this.shouldParseAsyncArrowReturnType=void 0,!1;if(!o.thrown)return this.shouldParseAsyncArrowReturnType=o.node,!this.canInsertSemicolon()&&this.eat(s.arrow)}else return!this.canInsertSemicolon()&&this.eat(s.arrow)}parseSubscriptAsyncArrow(o,l,f,m){let b=this.startNodeAt(o,l);return b.returnType=this.shouldParseAsyncArrowReturnType,this.shouldParseAsyncArrowReturnType=void 0,this.parseArrowExpression(b,f,!0,m)}parseExprList(o,l,f,m){let b=[],T=!0;while(!this.eat(o)){if(!T){if(this.expect(s.comma),l&&this.afterTrailingComma(o))break}else T=!1;let S;if(f&&this.type===s.comma)S=null;else if(this.type===s.ellipsis){if(S=this.parseSpread(m),this.maybeInArrowParameters&&this.match(s.colon))S.typeAnnotation=this.tsParseTypeAnnotation();if(m&&this.type===s.comma&&m.trailingComma<0)m.trailingComma=this.start}else S=this.parseMaybeAssign(!1,m,this.parseParenItem);b.push(S)}return b}parseMaybeDecoratorArguments(o){let l=this.tsMatchLeftRelational()||this.match(s.bitShift)?this.tsParseTypeArgumentsInExpression():void 0;if(this.eat(s.parenL)){let f=this.startNodeAtNode(o);if(f.callee=o,f.arguments=this.parseExprList(s.parenR,!1),l)f.typeArguments=l;return this.finishNode(f,"CallExpression")}if(l){let f=this.startNodeAtNode(o);return f.expression=o,f.typeArguments=l,this.finishNode(f,"TSInstantiationExpression")}return o}parseSubscript(o,l,f,m,b,T,S){let A=T;if(!this.hasPrecedingLineBreak()&&this.value==="!"&&this.match(s.prefix)){this.exprAllowed=!1,this.next();let W=this.startNodeAt(l,f);return W.expression=o,o=this.finishNode(W,"TSNonNullExpression"),o}let P=!1;if(this.match(s.questionDot)&&this.lookaheadCharCode()===60){if(m)return o;o.optional=!0,A=P=!0,this.next()}if(this.tsMatchLeftRelational()||this.match(s.bitShift)){let W,xe=this.tsTryParseAndCatch(()=>{if(!m&&this.atPossibleAsyncArrow(o)){let fe=this.tsTryParseGenericAsyncArrowFunction(l,f,S);if(fe)return o=fe,o}let Le=this.tsParseTypeArgumentsInExpression();if(!Le)return o;if(P&&!this.match(s.parenL))return W=this.curPosition(),o;if(R(this.type)||this.type===s.backQuote){let fe=this.parseTaggedTemplateExpression(o,l,f,A);return fe.typeArguments=Le,fe}if(!m&&this.eat(s.parenL)){let fe=new sn,De=this.startNodeAt(l,f);if(De.callee=o,De.arguments=this.parseExprList(s.parenR,this.ecmaVersion>=8,!1,fe),this.tsCheckForInvalidTypeCasts(De.arguments),De.typeArguments=Le,A)De.optional=P;return this.checkExpressionErrors(fe,!0),o=this.finishNode(De,"CallExpression"),o}let Re=this.type;if(this.tsMatchRightRelational()||Re===s.bitShift||Re!==s.parenL&&cf(Re)&&!this.hasPrecedingLineBreak())return;let Je=this.startNodeAt(l,f);return Je.expression=o,Je.typeArguments=Le,this.finishNode(Je,"TSInstantiationExpression")});if(W)this.unexpected(W);if(xe){if(xe.type==="TSInstantiationExpression"&&(this.match(s.dot)||this.match(s.questionDot)&&this.lookaheadCharCode()!==40))this.raise(this.start,D.InvalidPropertyAccessAfterInstantiationExpression);return o=xe,o}}let E=this.ecmaVersion>=11,O=E&&this.eat(s.questionDot);if(m&&O)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");let K=this.eat(s.bracketL);if(K||O&&this.type!==s.parenL&&this.type!==s.backQuote||this.eat(s.dot)){let W=this.startNodeAt(l,f);if(W.object=o,K)W.property=this.parseExpression(),this.expect(s.bracketR);else if(this.type===s.privateId&&o.type!=="Super")W.property=this.parsePrivateIdent();else W.property=this.parseIdent(this.options.allowReserved!=="never");if(W.computed=!!K,E)W.optional=O;o=this.finishNode(W,"MemberExpression")}else if(!m&&this.eat(s.parenL)){let W=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let xe=new sn,Le=this.yieldPos,Re=this.awaitPos,Je=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;let fe=this.parseExprList(s.parenR,this.ecmaVersion>=8,!1,xe);if(b&&!O&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(xe,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");this.yieldPos=Le,this.awaitPos=Re,this.awaitIdentPos=Je,o=this.parseSubscriptAsyncArrow(l,f,fe,S)}else{this.checkExpressionErrors(xe,!0),this.yieldPos=Le||this.yieldPos,this.awaitPos=Re||this.awaitPos,this.awaitIdentPos=Je||this.awaitIdentPos;let De=this.startNodeAt(l,f);if(De.callee=o,De.arguments=fe,E)De.optional=O;o=this.finishNode(De,"CallExpression")}this.maybeInArrowParameters=W}else if(this.type===s.backQuote){if(O||A)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");let W=this.startNodeAt(l,f);W.tag=o,W.quasi=this.parseTemplate({isTagged:!0}),o=this.finishNode(W,"TaggedTemplateExpression")}return o}parseGetterSetter(o){o.kind=o.key.name,this.parsePropertyName(o);let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(o.value=this.parseMethod(!1),l)o.value.typeParameters=l;let f=o.kind==="get"?0:1,m=o.value.params[0];if(f=m&&this.isThisParam(m)?f+1:f,o.value.params.length!==f){let T=o.value.start;if(o.kind==="get")this.raiseRecoverable(T,"getter should have no params");else this.raiseRecoverable(T,"setter should have exactly one param")}else if(o.kind==="set"&&o.value.params[0].type==="RestElement")this.raiseRecoverable(o.value.params[0].start,"Setter cannot use rest params")}parsePropertyValue(o,l,f,m,b,T,S,A){if(this.tsMatchLeftRelational()){if(l)this.unexpected();o.kind="init",o.method=!0;let P=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(o.value=this.parseMethod(f,m),P)o.value.typeParameters=P;return}return super.parsePropertyValue(o,l,f,m,b,T,S,A)}parseProperty(o,l){if(!o){let f=[];if(this.match(g.at))while(this.match(g.at))f.push(this.parseDecorator());let m=super.parseProperty(o,l);if(m.type==="SpreadElement"){if(f.length)this.raise(m.start,Jn.SpreadElementDecorator)}if(f.length)m.decorators=f,f=[];return m}return super.parseProperty(o,l)}parseCatchClauseParam(){let o=this.parseBindingAtom(),l=o.type==="Identifier";this.enterScope(l?V.SCOPE_SIMPLE_CATCH:0),this.checkLValPattern(o,l?V.BIND_SIMPLE_CATCH:V.BIND_LEXICAL);let f=this.tsTryParseTypeAnnotation();if(f)o.typeAnnotation=f,this.resetEndLocation(o);return this.expect(s.parenR),o}parseClass(o,l){let f=this.inAbstractClass;this.inAbstractClass=!!o.abstract;try{this.next(),this.takeDecorators(o);let m=this.strict;this.strict=!0,this.parseClassId(o,l),this.parseClassSuper(o);let b=this.enterClassBody(),T=this.startNode(),S=!1;T.body=[];let A=[];this.expect(s.braceL);while(this.type!==s.braceR){if(this.match(g.at)){A.push(this.parseDecorator());continue}let P=this.parseClassElement(o.superClass!==null);if(A.length)P.decorators=A,this.resetStartLocationFromNode(P,A[0]),A=[];if(P){if(T.body.push(P),P.type==="MethodDefinition"&&P.kind==="constructor"&&P.value.type==="FunctionExpression"){if(S)this.raiseRecoverable(P.start,"Duplicate constructor in the same class");if(S=!0,P.decorators&&P.decorators.length>0)this.raise(P.start,Jn.DecoratorConstructor)}else if(P.key&&P.key.type==="PrivateIdentifier"&&P.value?.type!=="TSDeclareMethod"){let E=P.key.name;if(this.parseEffects.modify(b,E,(K)=>Gd(K,P)))this.raiseRecoverable(P.key.start,`Identifier '#${E}' has already been declared`)}}}if(this.strict=m,this.next(),A.length)this.raise(this.start,Jn.TrailingDecorator);return o.body=this.finishNode(T,"ClassBody"),this.exitClassBody(),this.finishNode(o,l?"ClassDeclaration":"ClassExpression")}finally{this.inAbstractClass=f}}parseClassFunctionParams(){let o=this.tsTryParseTypeParameters(),l=this.parseBindingList(s.parenR,!1,this.ecmaVersion>=8,!0);if(o)l.typeParameters=o;return l}parseMethod(o,l,f,m,b){let T=this.startNode(),S=this.yieldPos,A=this.awaitPos,P=this.awaitIdentPos;if(this.initFunction(T),this.ecmaVersion>=6)T.generator=o;if(this.ecmaVersion>=8)T.async=!!l;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(mi(l,T.generator)|V.SCOPE_SUPER|(f?V.SCOPE_DIRECT_SUPER:0)),this.expect(s.parenL),T.params=this.parseClassFunctionParams(),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(T,!1,!0,!1,{isClassMethod:m}),this.yieldPos=S,this.awaitPos=A,this.awaitIdentPos=P,b&&b.abstract){if(!!T.body){let{key:O}=b;this.raise(b.start,D.AbstractMethodHasImplementation({methodName:O.type==="Identifier"&&!b.computed?O.name:`[${this.input.slice(O.start,O.end)}]`}))}}return this.finishNode(T,"FunctionExpression")}static parse(o,l){if(l.locations===!1)throw Error("You have to enable options.locations while using acorn-typescript");else l.locations=!0;let f=new this(l,o);if(t)f.isAmbientContext=!0;return f.parse()}static parseExpressionAt(o,l,f){if(f.locations===!1)throw Error("You have to enable options.locations while using acorn-typescript");else f.locations=!0;let m=new this(f,o,l);if(t)m.isAmbientContext=!0;return m.nextToken(),m.parseExpression()}parseImportSpecifier(){if(this.ts_isContextual(g.type)){let l=this.startNode();return l.imported=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(l,!0,this.importOrExportOuterKind==="type"),this.finishNode(l,"ImportSpecifier")}else{let l=super.parseImportSpecifier();return l.importKind="value",l}}parseExportSpecifier(o){let l=this.ts_isContextual(g.type);if(!this.match(s.string)&&l){let m=this.startNode();return m.local=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(m,!1,this.importOrExportOuterKind==="type"),this.finishNode(m,"ExportSpecifier"),this.checkExport(o,m.exported,m.exported.start),m}else{let m=super.parseExportSpecifier(o);return m.exportKind="value",m}}parseTypeOnlyImportExportSpecifier(o,l,f){let m=l?"imported":"local",b=l?"local":"exported",T=o[m],S,A=!1,P=!0,E=T.start;if(this.isContextual("as")){let K=this.parseIdent();if(this.isContextual("as")){let W=this.parseIdent();if(k(this.type))A=!0,T=K,S=l?this.parseIdent():this.parseModuleExportName(),P=!1;else S=W,P=!1}else if(k(this.type))P=!1,S=l?this.parseIdent():this.parseModuleExportName();else A=!0,T=K}else if(k(this.type))if(A=!0,l){if(T=super.parseIdent(!0),!this.isContextual("as"))this.checkUnreserved(T)}else T=this.parseModuleExportName();if(A&&f)this.raise(E,l?D.TypeModifierIsUsedInTypeImports:D.TypeModifierIsUsedInTypeExports);o[m]=T,o[b]=S;let O=l?"importKind":"exportKind";if(o[O]=A?"type":"value",P&&this.eatContextual("as"))o[b]=l?this.parseIdent():this.parseModuleExportName();if(!o[b])o[b]=this.copyNode(o[m]);if(l)this.checkLValSimple(o[b],V.BIND_LEXICAL)}raiseCommonCheck(o,l,f){switch(l){case"Comma is not permitted after the rest element":if(this.isAmbientContext&&this.match(s.comma)&&this.lookaheadCharCode()===41){this.next();return}else return super.raise(o,l)}return f?super.raiseRecoverable(o,l):super.raise(o,l)}raiseRecoverable(o,l){return this.raiseCommonCheck(o,l,!0)}raise(o,l){return this.raiseCommonCheck(o,l,!0)}updateContext(o){let{type:l}=this;if(l==s.braceL){var f=this.curContext();if(f==C.tc_oTag)this.parseEffects.append(this.context,y.b_expr);else if(f==C.tc_expr)this.parseEffects.append(this.context,y.b_tmpl);else super.updateContext(o);this.exprAllowed=!0}else if(l===s.slash&&o===g.jsxTagStart)this.parseEffects.truncate(this.context,this.context.length-2),this.parseEffects.append(this.context,C.tc_cTag),this.exprAllowed=!1;else return super.updateContext(o)}jsx_parseOpeningElementAt(o,l){let f=this.startNodeAt(o,l),m=this.jsx_parseElementName();if(m)f.name=m;if(this.match(s.relational)||this.match(s.bitShift)){let b=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());if(b)f.typeArguments=b}f.attributes=[];while(this.type!==s.slash&&this.type!==g.jsxTagEnd)f.attributes.push(this.jsx_parseAttribute());return f.selfClosing=this.eat(s.slash),this.expect(g.jsxTagEnd),this.finishNode(f,m?"JSXOpeningElement":"JSXOpeningFragment")}enterScope(o){let l=o===rn;if(l)this.parseEffects.append(this.importsStack,[]);let f=l?o|V.SCOPE_CLASS_STATIC_BLOCK:o;super.enterScope(f);let m=super.currentScope();m.types=[],m.enums=[],m.constEnums=[],m.classes=[],m.exportOnlyBindings=[]}exitScope(){if(super.currentScope().flags&rn)this.parseEffects.pop(this.importsStack);super.exitScope()}hasImport(o,l){let f=this.importsStack.length;if(this.importsStack[f-1].indexOf(o)>-1)return!0;if(!l&&f>1){for(let m=0;m<f-1;m++)if(this.importsStack[m].indexOf(o)>-1)return!0}return!1}maybeExportDefined(o,l){if(this.inModule&&o.flags&V.SCOPE_TOP)this.parseEffects.remove(this.undefinedExports,l)}declareName(o,l,f){if(l&V.BIND_FLAGS_TS_IMPORT){if(this.hasImport(o,!0))this.raise(f,`Identifier '${o}' has already been declared.`);this.parseEffects.append(this.importsStack[this.importsStack.length-1],o);return}let m=this.currentScope();if(l&V.BIND_FLAGS_TS_EXPORT_ONLY){this.maybeExportDefined(m,o),this.parseEffects.append(m.exportOnlyBindings,o);return}if(l===V.BIND_TS_TYPE||l===V.BIND_TS_INTERFACE){if(l===V.BIND_TS_TYPE&&m.types.includes(o))this.raise(f,`type '${o}' has already been declared.`);this.parseEffects.append(m.types,o)}else if(l&V.BIND_FLAGS_TS_ENUM){if(m.enums.includes(o))return;super.declareName(o,V.BIND_LEXICAL,f)}else super.declareName(o,l,f);if(l&V.BIND_FLAGS_TS_ENUM)this.parseEffects.append(m.enums,o);if(l&V.BIND_FLAGS_TS_CONST_ENUM)this.parseEffects.append(m.constEnums,o);if(l&V.BIND_FLAGS_CLASS)this.parseEffects.append(m.classes,o)}checkLocalExport(o){let{name:l}=o;if(this.hasImport(l))return;let f=this.scopeStack.length;for(let m=f-1;m>=0;m--){let b=this.scopeStack[m];if(b.types.indexOf(l)>-1||b.exportOnlyBindings.indexOf(l)>-1)return}super.checkLocalExport(o)}}return ot}}var df=/\n/,ff=/[ \t]/,hf=/^[,) \t]*$/,Yn="",qo=[];function Qn(e,t){Yn=e,qo=t}function Zn(e,t,n,r){let i=t;if(e&&df.test(i)){let a=n;while(a>0&&Yn[a-1]!==`
36
+ `)a-=1;let s=a;while(ff.test(Yn[s]))s+=1;let p=Yn.slice(a,s);i=mf(i,p)}qo.push({type:e?"Block":"Line",value:i,start:n,end:r})}function mf(e,t){if(t==="")return e;return(e.startsWith(t)?e.slice(t.length):e).replaceAll(`
40
37
  ${t}`,`
41
- `)}function Li(e,t,n,r){let i=rf(n,r);if(i>=n.length)return;Ii(e,void 0,n,{index:i},t)}function rf(e,t){let n=0,r=e.length;while(n<r){let i=n+r>>>1;if(e[i].start<t)n=i+1;else r=i}return n}function Ii(e,t,n,r,i){while(r.index<n.length&&n[r.index].start<(e.start??0))e.leadingComments??=[],e.leadingComments.push(n[r.index]),r.index++;if(r.index>=n.length)return;let o=n[r.index].start,s=e.end,l=s===void 0||s>o?Object.keys(e):[];for(let d=0;d<l.length;d++){let u=l[d];if(u==="type"||u==="leadingComments")continue;let y=e[u];if(!y||typeof y!=="object")continue;if(Array.isArray(y)){for(let g of y)if(g&&typeof g==="object"&&typeof g.type==="string"){if(Ii(g,e,n,r,i),r.index>=n.length)return}}else if(typeof y.type==="string"){if(Ii(y,e,n,r,i),r.index>=n.length)return}}if(r.index<n.length){let d=n[r.index];if(t===void 0||e.end!==t.end){let u=i.slice(e.end??0,d.start);if((t?.type==="BlockStatement"||t?.type==="Program")&&_i(t.body,e)||t?.type==="ArrayExpression"&&_i(t.elements,e)||t?.type==="ObjectExpression"&&_i(t.properties,e))while(r.index<n.length){if(t&&n[r.index].start>=(t.end??Number.POSITIVE_INFINITY))break;r.index++}else if((e.end??0)<=d.start&&tf.test(u))r.index++}}}function _i(e,t){return!!e&&e.indexOf(t)===e.length-1}var yr={sawParenthesized:!1},Xo=(e)=>class extends e{parseParenAndDistinguishExpression(t,n){let r=super.parseParenAndDistinguishExpression(t,n);if(r.type==="ParenthesizedExpression")yr.sawParenthesized=!0;return r}parseDecorator(){return yr.sawParenthesized=!0,super.parseDecorator()}},Yo=(e)=>class extends e{checkLocalExport(){}},sf=me.extend(Xo,Yo),af=me.extend(Wo(),Xo,Yo);function Bi(e){return e?af:sf}var of={onComment:mr,sourceType:"module",ecmaVersion:16},Qo={onComment:mr,sourceType:"module",ecmaVersion:16,preserveParens:!0},cf={onComment:mr,sourceType:"module",ecmaVersion:16},zo={...Qo,startLocation:null},Ri=/\r\n?|\n|\u2028|\u2029/g;function pf(e,t){if(t?.breakEnds)return t.breakEnds;let n=[];Ri.lastIndex=0;while(Ri.test(e))n.push(Ri.lastIndex);if(t)t.breakEnds=n;return n}function lf(e,t,n){let r=e.lastIndexOf(`
42
- `,t-1)+1,i=pf(e,n),o=0,s=i.length;while(o<s){let c=o+s>>>1;if(i[c]<=r)o=c+1;else s=c}return{line:o+1,column:t-r}}function Zo(e,t,n,r,i){if(n.length===i)return;Li(e,t,n,r)}function ec(e,t,n){let r=n.length;hr(e,n);let i=Bi(t).parse(e,of);if(n.length>0)Li(i,e,n,r);return i}var uf={count:0};function tn(e,t,n,r,i){uf.count+=1;let o=r.length;hr(e,r),yr.sawParenthesized=!1;let s=Qo;if(n)zo.startLocation=lf(e,t,i),s=zo;let c=Bi(n).parseExpressionAt(e,t,s);Zo(c,e,r,t,o);let l=r.length>o?r.at(-1):void 0,d=l&&l.end>(c.end??0)?l.end:c.end??0;return{node:yr.sawParenthesized?df(c):c,end:d}}function tc(e,t,n,r){let i=r.length,o=Bi(n);hr(e,r);let s=new o(cf,e,t);s.nextToken();let c=s.parseStatement(null,!0,Object.create(null));return Zo(c,e,r,t,i),c}function Jo(e){return e!==null&&typeof e==="object"&&typeof e.type==="string"}function Mi(e){let t=e;while(t.type==="ParenthesizedExpression"&&t.expression)t=t.expression;return t}function df(e){let t=Mi(e);return Oi(t),t}function Oi(e){for(let t in e){let n=e[t];if(!n||typeof n!=="object")continue;if(Array.isArray(n))for(let r=0;r<n.length;r++){let i=n[r];if(!Jo(i))continue;let o=Mi(i);if(o!==i)n[r]=o;Oi(o)}else if(Jo(n)){let r=Mi(n);if(r!==n)e[t]=r;Oi(r)}}}function Ft(e){if(e===32||e<=13&&e>=9)return!0;if(e<160)return!1;return e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288||e===65279}class Fi{source;index=0;constructor(e){this.source=e}match(e){if(e.length===1)return this.source.charCodeAt(this.index)===e.charCodeAt(0);return this.source.startsWith(e,this.index)}matchRegex(e){e.lastIndex=this.index;let t=e.exec(this.source);if(!t||t.index!==this.index)return null;return t[0]}eat(e,t=!1){if(this.match(e))return this.index+=e.length,!0;if(t)throw new wt(`Expected token ${JSON.stringify(e)}`,this.index);return!1}read(e){let t=this.matchRegex(e);if(t)this.index+=t.length;return t}readUntil(e){if(this.index>=this.source.length)throw new wt("Unexpected end of input",this.source.length);let t=this.index;e.lastIndex=t;let n=e.exec(this.source);if(n)return this.index=n.index,this.source.slice(t,this.index);return this.index=this.source.length,this.source.slice(t)}readUntilString(e){if(this.index>=this.source.length)throw new wt("Unexpected end of input",this.source.length);let t=this.source.indexOf(e,this.index),n=t===-1?this.source.length:t,r=this.source.slice(this.index,n);return this.index=n,r}allowWhitespace(){while(this.index<this.source.length&&Ft(this.source.charCodeAt(this.index)))this.index++}requireWhitespace(){if(!Ft(this.source.charCodeAt(this.index)))throw new wt("Expected whitespace",this.index);this.allowWhitespace()}readIdentifierName(){let e=this.index,t=e,n="",r=this.source.codePointAt(this.index);if(r!==void 0&&Le(r,!0)){t+=r<=65535?1:2;while(t<this.source.length){let i=this.source.codePointAt(t);if(i===void 0||!Fe(i,!0))break;t+=i<=65535?1:2}n=this.source.slice(e,t),this.index=t}return{type:"Identifier",name:n,start:e,end:t}}}class wt extends Error{position;constructor(e,t){super(`${e} (at index ${t})`);this.name="TemplateSyntaxError",this.position=t}}function Me(){return{type:"Fragment",nodes:[]}}var ff=new Set(["await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","finally","for","function","if","implements","import","in","instanceof","interface","let","new","package","private","protected","public","return","static","super","switch","this","throw","try","typeof","var","void","while","with","yield"]),hf=["&&","||","??"],mf=["===","!==","==","!="];function nc(e,t){let n=e.codePointAt(t);if(n===void 0||!Le(n,!0))return t;let r=t+(n<=65535?1:2);while(r<e.length){let i=e.codePointAt(r);if(!Fe(i,!0))break;r+=i<=65535?1:2}return r}function yf(e,t){let n=t;while(n<e.length){let r=e.charCodeAt(n);if(r<48||r>57)break;n++}return n}function gr(e,t){let n=t;while(n<e.length&&Ft(e.charCodeAt(n)))n++;return n}function rc(e,t){let n=yf(e,t);if(n===t)return null;if(e.charCodeAt(t)===48&&n-t>1)return null;if(n<e.length){let i=e.codePointAt(n);if(i===46||Fe(i,!0))return null}let r=e.slice(t,n);return{type:"Literal",start:t,end:n,value:Number(r),raw:r}}function ic(e,t){let n=e.charCodeAt(t),r=t+1;while(r<e.length){let i=e.charCodeAt(r);if(i===n){let o=e.slice(t,r+1);return{type:"Literal",start:t,end:r+1,value:e.slice(t+1,r),raw:o}}if(i===92||i===10||i===13)return null;r++}return null}function gf(e,t){let n=e.charCodeAt(t);if(n===34||n===39)return ic(e,t);let r=nc(e,t);if(r===t)return rc(e,t);let i=e.slice(t,r);if(i==="true"||i==="false")return{type:"Literal",start:t,end:r,value:i==="true",raw:i};if(i==="null")return{type:"Literal",start:t,end:r,value:null,raw:i};if(ff.has(i))return null;let o={type:"Identifier",start:t,end:r,name:i},s=r;while(s<e.length){let c=e.charCodeAt(s);if(c===46){let l=s+1,d=nc(e,l);if(d===l)return null;let u={type:"Identifier",start:l,end:d,name:e.slice(l,d)};o={type:"MemberExpression",start:t,end:d,object:o,property:u,computed:!1,optional:!1},s=d}else if(c===91){let l=s+1,d=e.charCodeAt(l),u=d===34||d===39?ic(e,l):rc(e,l);if(!u||e.charCodeAt(u.end)!==93)return null;o={type:"MemberExpression",start:t,end:u.end+1,object:o,property:u,computed:!0,optional:!1},s=u.end+1}else break}return o}function $i(e,t){if(e.charCodeAt(t)!==33||e.charCodeAt(t+1)===61)return gf(e,t);let n=$i(e,gr(e,t+1));if(!n)return null;return{type:"UnaryExpression",start:t,end:n.end,operator:"!",prefix:!0,argument:n}}function xf(e,t){for(let n of mf)if(e.startsWith(n,t))return{operator:n,logical:!1};for(let n of hf)if(e.startsWith(n,t))return{operator:n,logical:!0};return null}function sc(e,t){let n=gr(e,t);if(n>=e.length)return!1;let r=e.charCodeAt(n);return r===125||r===41}function bf(e){let t=e.source,n=$i(t,e.index);if(!n)return null;if(sc(t,n.end))return e.index=n.end,n;let r=gr(t,n.end),i=xf(t,r);if(!i)return null;let o=$i(t,gr(t,r+i.operator.length));if(!o||!sc(t,o.end))return null;return e.index=o.end,{type:i.logical?"LogicalExpression":"BinaryExpression",start:n.start,end:o.end,left:n,operator:i.operator,right:o}}function Ce(e){let t=bf(e);if(t)return t;let{node:n,end:r}=tn(e.source,e.index,e.isTypeScript,e.root.comments,e.lineTable);return e.index=r,n}var Tf={"CounterClockwiseContourIntegral;":8755,"ClockwiseContourIntegral;":8754,"DoubleLongLeftRightArrow;":10234,"NotNestedGreaterGreater;":10914,"DiacriticalDoubleAcute;":733,"NotSquareSupersetEqual;":8931,"CloseCurlyDoubleQuote;":8221,"DoubleContourIntegral;":8751,"FilledVerySmallSquare;":9642,"NegativeVeryThinSpace;":8203,"NotPrecedesSlantEqual;":8928,"NotRightTriangleEqual;":8941,"NotSucceedsSlantEqual;":8929,"CapitalDifferentialD;":8517,"DoubleLeftRightArrow;":8660,"DoubleLongRightArrow;":10233,"EmptyVerySmallSquare;":9643,"NestedGreaterGreater;":8811,"NotDoubleVerticalBar;":8742,"NotGreaterSlantEqual;":10878,"NotLeftTriangleEqual;":8940,"NotSquareSubsetEqual;":8930,"OpenCurlyDoubleQuote;":8220,"ReverseUpEquilibrium;":10607,"DoubleLongLeftArrow;":10232,"DownLeftRightVector;":10576,"LeftArrowRightArrow;":8646,"NegativeMediumSpace;":8203,"NotGreaterFullEqual;":8807,"NotRightTriangleBar;":10704,"RightArrowLeftArrow;":8644,"SquareSupersetEqual;":8850,"leftrightsquigarrow;":8621,"DownRightTeeVector;":10591,"DownRightVectorBar;":10583,"LongLeftRightArrow;":10231,"Longleftrightarrow;":10234,"NegativeThickSpace;":8203,"NotLeftTriangleBar;":10703,"PrecedesSlantEqual;":8828,"ReverseEquilibrium;":8651,"RightDoubleBracket;":10215,"RightDownTeeVector;":10589,"RightDownVectorBar;":10581,"RightTriangleEqual;":8885,"SquareIntersection;":8851,"SucceedsSlantEqual;":8829,"blacktriangleright;":9656,"longleftrightarrow;":10231,"DoubleUpDownArrow;":8661,"DoubleVerticalBar;":8741,"DownLeftTeeVector;":10590,"DownLeftVectorBar;":10582,"FilledSmallSquare;":9724,"GreaterSlantEqual;":10878,"LeftDoubleBracket;":10214,"LeftDownTeeVector;":10593,"LeftDownVectorBar;":10585,"LeftTriangleEqual;":8884,"NegativeThinSpace;":8203,"NotGreaterGreater;":8811,"NotLessSlantEqual;":10877,"NotNestedLessLess;":10913,"NotReverseElement;":8716,"NotSquareSuperset;":8848,"NotTildeFullEqual;":8775,"RightAngleBracket;":10217,"RightUpDownVector;":10575,"SquareSubsetEqual;":8849,"VerticalSeparator;":10072,"blacktriangledown;":9662,"blacktriangleleft;":9666,"leftrightharpoons;":8651,"rightleftharpoons;":8652,"twoheadrightarrow;":8608,"DiacriticalAcute;":180,"DiacriticalGrave;":96,"DiacriticalTilde;":732,"DoubleRightArrow;":8658,"DownArrowUpArrow;":8693,"EmptySmallSquare;":9723,"GreaterEqualLess;":8923,"GreaterFullEqual;":8807,"LeftAngleBracket;":10216,"LeftUpDownVector;":10577,"LessEqualGreater;":8922,"NonBreakingSpace;":160,"NotPrecedesEqual;":10927,"NotRightTriangle;":8939,"NotSucceedsEqual;":10928,"NotSucceedsTilde;":8831,"NotSupersetEqual;":8841,"RightTriangleBar;":10704,"RightUpTeeVector;":10588,"RightUpVectorBar;":10580,"UnderParenthesis;":9181,"UpArrowDownArrow;":8645,"circlearrowright;":8635,"downharpoonright;":8642,"ntrianglerighteq;":8941,"rightharpoondown;":8641,"rightrightarrows;":8649,"twoheadleftarrow;":8606,"vartriangleright;":8883,"CloseCurlyQuote;":8217,"ContourIntegral;":8750,"DoubleDownArrow;":8659,"DoubleLeftArrow;":8656,"DownRightVector;":8641,"LeftRightVector;":10574,"LeftTriangleBar;":10703,"LeftUpTeeVector;":10592,"LeftUpVectorBar;":10584,"LowerRightArrow;":8600,"NotGreaterEqual;":8817,"NotGreaterTilde;":8821,"NotHumpDownHump;":8782,"NotLeftTriangle;":8938,"NotSquareSubset;":8847,"OverParenthesis;":9180,"RightDownVector;":8642,"ShortRightArrow;":8594,"UpperRightArrow;":8599,"bigtriangledown;":9661,"circlearrowleft;":8634,"curvearrowright;":8631,"downharpoonleft;":8643,"leftharpoondown;":8637,"leftrightarrows;":8646,"nLeftrightarrow;":8654,"nleftrightarrow;":8622,"ntrianglelefteq;":8940,"rightleftarrows;":8644,"rightsquigarrow;":8605,"rightthreetimes;":8908,"straightepsilon;":1013,"trianglerighteq;":8885,"vartriangleleft;":8882,"DiacriticalDot;":729,"DoubleRightTee;":8872,"DownLeftVector;":8637,"GreaterGreater;":10914,"HorizontalLine;":9472,"InvisibleComma;":8291,"InvisibleTimes;":8290,"LeftDownVector;":8643,"LeftRightArrow;":8596,"Leftrightarrow;":8660,"LessSlantEqual;":10877,"LongRightArrow;":10230,"Longrightarrow;":10233,"LowerLeftArrow;":8601,"NestedLessLess;":8810,"NotGreaterLess;":8825,"NotLessGreater;":8824,"NotSubsetEqual;":8840,"NotVerticalBar;":8740,"OpenCurlyQuote;":8216,"ReverseElement;":8715,"RightTeeVector;":10587,"RightVectorBar;":10579,"ShortDownArrow;":8595,"ShortLeftArrow;":8592,"SquareSuperset;":8848,"TildeFullEqual;":8773,"UpperLeftArrow;":8598,"ZeroWidthSpace;":8203,"curvearrowleft;":8630,"doublebarwedge;":8966,"downdownarrows;":8650,"hookrightarrow;":8618,"leftleftarrows;":8647,"leftrightarrow;":8596,"leftthreetimes;":8907,"longrightarrow;":10230,"looparrowright;":8620,"nshortparallel;":8742,"ntriangleright;":8939,"rightarrowtail;":8611,"rightharpoonup;":8640,"trianglelefteq;":8884,"upharpoonright;":8638,"ApplyFunction;":8289,"DifferentialD;":8518,"DoubleLeftTee;":10980,"DoubleUpArrow;":8657,"LeftTeeVector;":10586,"LeftVectorBar;":10578,"LessFullEqual;":8806,"LongLeftArrow;":10229,"Longleftarrow;":10232,"NotEqualTilde;":8770,"NotTildeEqual;":8772,"NotTildeTilde;":8777,"Poincareplane;":8460,"PrecedesEqual;":10927,"PrecedesTilde;":8830,"RightArrowBar;":8677,"RightTeeArrow;":8614,"RightTriangle;":8883,"RightUpVector;":8638,"SucceedsEqual;":10928,"SucceedsTilde;":8831,"SupersetEqual;":8839,"UpEquilibrium;":10606,"VerticalTilde;":8768,"VeryThinSpace;":8202,"bigtriangleup;":9651,"blacktriangle;":9652,"divideontimes;":8903,"fallingdotseq;":8786,"hookleftarrow;":8617,"leftarrowtail;":8610,"leftharpoonup;":8636,"longleftarrow;":10229,"looparrowleft;":8619,"measuredangle;":8737,"ntriangleleft;":8938,"shortparallel;":8741,"smallsetminus;":8726,"triangleright;":9657,"upharpoonleft;":8639,"varsubsetneqq;":10955,"varsupsetneqq;":10956,"DownArrowBar;":10515,"DownTeeArrow;":8615,"ExponentialE;":8519,"GreaterEqual;":8805,"GreaterTilde;":8819,"HilbertSpace;":8459,"HumpDownHump;":8782,"Intersection;":8898,"LeftArrowBar;":8676,"LeftTeeArrow;":8612,"LeftTriangle;":8882,"LeftUpVector;":8639,"NotCongruent;":8802,"NotHumpEqual;":8783,"NotLessEqual;":8816,"NotLessTilde;":8820,"Proportional;":8733,"RightCeiling;":8969,"RoundImplies;":10608,"ShortUpArrow;":8593,"SquareSubset;":8847,"UnderBracket;":9141,"VerticalLine;":124,"blacklozenge;":10731,"exponentiale;":8519,"risingdotseq;":8787,"triangledown;":9663,"triangleleft;":9667,"varsubsetneq;":8842,"varsupsetneq;":8843,"CircleMinus;":8854,"CircleTimes;":8855,"Equilibrium;":8652,"GreaterLess;":8823,"LeftCeiling;":8968,"LessGreater;":8822,"MediumSpace;":8287,"NotLessLess;":8810,"NotPrecedes;":8832,"NotSucceeds;":8833,"NotSuperset;":8835,"OverBracket;":9140,"RightVector;":8640,"Rrightarrow;":8667,"RuleDelayed;":10740,"SmallCircle;":8728,"SquareUnion;":8852,"SubsetEqual;":8838,"UpDownArrow;":8597,"Updownarrow;":8661,"VerticalBar;":8739,"backepsilon;":1014,"blacksquare;":9642,"circledcirc;":8858,"circleddash;":8861,"curlyeqprec;":8926,"curlyeqsucc;":8927,"diamondsuit;":9830,"eqslantless;":10901,"expectation;":8496,"nRightarrow;":8655,"nrightarrow;":8603,"preccurlyeq;":8828,"precnapprox;":10937,"quaternions;":8461,"straightphi;":981,"succcurlyeq;":8829,"succnapprox;":10938,"thickapprox;":8776,"updownarrow;":8597,"Bernoullis;":8492,"CirclePlus;":8853,"EqualTilde;":8770,"Fouriertrf;":8497,"ImaginaryI;":8520,"Laplacetrf;":8466,"LeftVector;":8636,"Lleftarrow;":8666,"NotElement;":8713,"NotGreater;":8815,"Proportion;":8759,"RightArrow;":8594,"RightFloor;":8971,"Rightarrow;":8658,"ThickSpace;":8287,"TildeEqual;":8771,"TildeTilde;":8776,"UnderBrace;":9183,"UpArrowBar;":10514,"UpTeeArrow;":8613,"circledast;":8859,"complement;":8705,"curlywedge;":8911,"eqslantgtr;":10902,"gtreqqless;":10892,"lessapprox;":10885,"lesseqqgtr;":10891,"lmoustache;":9136,"longmapsto;":10236,"mapstodown;":8615,"mapstoleft;":8612,"nLeftarrow;":8653,"nleftarrow;":8602,"nsubseteqq;":10949,"nsupseteqq;":10950,"precapprox;":10935,"rightarrow;":8594,"rmoustache;":9137,"sqsubseteq;":8849,"sqsupseteq;":8850,"subsetneqq;":10955,"succapprox;":10936,"supsetneqq;":10956,"upuparrows;":8648,"varepsilon;":1013,"varnothing;":8709,"Backslash;":8726,"CenterDot;":183,"CircleDot;":8857,"Congruent;":8801,"Coproduct;":8720,"DoubleDot;":168,"DownArrow;":8595,"DownBreve;":785,"Downarrow;":8659,"HumpEqual;":8783,"LeftArrow;":8592,"LeftFloor;":8970,"Leftarrow;":8656,"LessTilde;":8818,"Mellintrf;":8499,"MinusPlus;":8723,"NotCupCap;":8813,"NotExists;":8708,"NotSubset;":8834,"OverBrace;":9182,"PlusMinus;":177,"Therefore;":8756,"ThinSpace;":8201,"TripleDot;":8411,"UnionPlus;":8846,"backprime;":8245,"backsimeq;":8909,"bigotimes;":10754,"centerdot;":183,"checkmark;":10003,"complexes;":8450,"dotsquare;":8865,"downarrow;":8595,"gtrapprox;":10886,"gtreqless;":8923,"gvertneqq;":8809,"heartsuit;":9829,"leftarrow;":8592,"lesseqgtr;":8922,"lvertneqq;":8808,"ngeqslant;":10878,"nleqslant;":10877,"nparallel;":8742,"nshortmid;":8740,"nsubseteq;":8840,"nsupseteq;":8841,"pitchfork;":8916,"rationals;":8474,"spadesuit;":9824,"subseteqq;":10949,"subsetneq;":8842,"supseteqq;":10950,"supsetneq;":8843,"therefore;":8756,"triangleq;":8796,"varpropto;":8733,"DDotrahd;":10513,"DotEqual;":8784,"Integral;":8747,"LessLess;":10913,"NotEqual;":8800,"NotTilde;":8769,"PartialD;":8706,"Precedes;":8826,"RightTee;":8866,"Succeeds;":8827,"SuchThat;":8715,"Superset;":8835,"Uarrocir;":10569,"UnderBar;":95,"andslope;":10840,"angmsdaa;":10664,"angmsdab;":10665,"angmsdac;":10666,"angmsdad;":10667,"angmsdae;":10668,"angmsdaf;":10669,"angmsdag;":10670,"angmsdah;":10671,"angrtvbd;":10653,"approxeq;":8778,"awconint;":8755,"backcong;":8780,"barwedge;":8965,"bbrktbrk;":9142,"bigoplus;":10753,"bigsqcup;":10758,"biguplus;":10756,"bigwedge;":8896,"boxminus;":8863,"boxtimes;":8864,"bsolhsub;":10184,"capbrcup;":10825,"circledR;":174,"circledS;":9416,"cirfnint;":10768,"clubsuit;":9827,"cupbrcap;":10824,"curlyvee;":8910,"cwconint;":8754,"doteqdot;":8785,"dotminus;":8760,"drbkarow;":10512,"dzigrarr;":10239,"elinters;":9191,"emptyset;":8709,"eqvparsl;":10725,"fpartint;":10765,"geqslant;":10878,"gesdotol;":10884,"gnapprox;":10890,"hksearow;":10533,"hkswarow;":10534,"imagline;":8464,"imagpart;":8465,"infintie;":10717,"integers;":8484,"intercal;":8890,"intlarhk;":10775,"laemptyv;":10676,"ldrushar;":10571,"leqslant;":10877,"lesdotor;":10883,"llcorner;":8990,"lnapprox;":10889,"lrcorner;":8991,"lurdshar;":10570,"mapstoup;":8613,"multimap;":8888,"naturals;":8469,"ncongdot;":10861,"notindot;":8949,"otimesas;":10806,"parallel;":8741,"plusacir;":10787,"pointint;":10773,"precneqq;":10933,"precnsim;":8936,"profalar;":9006,"profline;":8978,"profsurf;":8979,"raemptyv;":10675,"realpart;":8476,"rppolint;":10770,"rtriltri;":10702,"scpolint;":10771,"setminus;":8726,"shortmid;":8739,"smeparsl;":10724,"sqsubset;":8847,"sqsupset;":8848,"subseteq;":8838,"succneqq;":10934,"succnsim;":8937,"supseteq;":8839,"thetasym;":977,"thicksim;":8764,"timesbar;":10801,"triangle;":9653,"triminus;":10810,"trpezium;":9186,"ulcorner;":8988,"urcorner;":8989,"varkappa;":1008,"varsigma;":962,"vartheta;":977,"Because;":8757,"Cayleys;":8493,"Cconint;":8752,"Cedilla;":184,"Diamond;":8900,"DownTee;":8868,"Element;":8712,"Epsilon;":917,"Implies;":8658,"LeftTee;":8867,"NewLine;":10,"NoBreak;":8288,"NotLess;":8814,"Omicron;":927,"OverBar;":8254,"Product;":8719,"UpArrow;":8593,"Uparrow;":8657,"Upsilon;":933,"alefsym;":8501,"angrtvb;":8894,"angzarr;":9084,"asympeq;":8781,"backsim;":8765,"because;":8757,"bemptyv;":10672,"between;":8812,"bigcirc;":9711,"bigodot;":10752,"bigstar;":9733,"bnequiv;":8801,"boxplus;":8862,"ccupssm;":10832,"cemptyv;":10674,"cirscir;":10690,"coloneq;":8788,"congdot;":10861,"cudarrl;":10552,"cudarrr;":10549,"cularrp;":10557,"curarrm;":10556,"dbkarow;":10511,"ddagger;":8225,"ddotseq;":10871,"demptyv;":10673,"diamond;":8900,"digamma;":989,"dotplus;":8724,"dwangle;":10662,"epsilon;":949,"eqcolon;":8789,"equivDD;":10872,"gesdoto;":10882,"gtquest;":10876,"gtrless;":8823,"harrcir;":10568,"intprod;":10812,"isindot;":8949,"larrbfs;":10527,"larrsim;":10611,"lbrksld;":10639,"lbrkslu;":10637,"ldrdhar;":10599,"lesdoto;":10881,"lessdot;":8918,"lessgtr;":8822,"lesssim;":8818,"lotimes;":10804,"lozenge;":9674,"ltquest;":10875,"luruhar;":10598,"maltese;":10016,"minusdu;":10794,"napprox;":8777,"natural;":9838,"nearrow;":8599,"nexists;":8708,"notinva;":8713,"notinvb;":8951,"notinvc;":8950,"notniva;":8716,"notnivb;":8958,"notnivc;":8957,"npolint;":10772,"npreceq;":10927,"nsqsube;":8930,"nsqsupe;":8931,"nsubset;":8834,"nsucceq;":10928,"nsupset;":8835,"nvinfin;":10718,"nvltrie;":8884,"nvrtrie;":8885,"nwarrow;":8598,"olcross;":10683,"omicron;":959,"orderof;":8500,"orslope;":10839,"pertenk;":8241,"planckh;":8462,"pluscir;":10786,"plussim;":10790,"plustwo;":10791,"precsim;":8830,"quatint;":10774,"questeq;":8799,"rarrbfs;":10528,"rarrsim;":10612,"rbrksld;":10638,"rbrkslu;":10640,"rdldhar;":10601,"realine;":8475,"rotimes;":10805,"ruluhar;":10600,"searrow;":8600,"simplus;":10788,"simrarr;":10610,"subedot;":10947,"submult;":10945,"subplus;":10943,"subrarr;":10617,"succsim;":8831,"supdsub;":10968,"supedot;":10948,"suphsol;":10185,"suphsub;":10967,"suplarr;":10619,"supmult;":10946,"supplus;":10944,"swarrow;":8601,"topfork;":10970,"triplus;":10809,"tritime;":10811,"uparrow;":8593,"upsilon;":965,"uwangle;":10663,"vzigzag;":10650,"zigrarr;":8669,"Aacute;":193,"Abreve;":258,"Agrave;":192,"Assign;":8788,"Atilde;":195,"Barwed;":8966,"Bumpeq;":8782,"Cacute;":262,"Ccaron;":268,"Ccedil;":199,"Colone;":10868,"Conint;":8751,"CupCap;":8781,"Dagger;":8225,"Dcaron;":270,"DotDot;":8412,"Dstrok;":272,"Eacute;":201,"Ecaron;":282,"Egrave;":200,"Exists;":8707,"ForAll;":8704,"Gammad;":988,"Gbreve;":286,"Gcedil;":290,"HARDcy;":1066,"Hstrok;":294,"Iacute;":205,"Igrave;":204,"Itilde;":296,"Jsercy;":1032,"Kcedil;":310,"Lacute;":313,"Lambda;":923,"Lcaron;":317,"Lcedil;":315,"Lmidot;":319,"Lstrok;":321,"Nacute;":323,"Ncaron;":327,"Ncedil;":325,"Ntilde;":209,"Oacute;":211,"Odblac;":336,"Ograve;":210,"Oslash;":216,"Otilde;":213,"Otimes;":10807,"Racute;":340,"Rarrtl;":10518,"Rcaron;":344,"Rcedil;":342,"SHCHcy;":1065,"SOFTcy;":1068,"Sacute;":346,"Scaron;":352,"Scedil;":350,"Square;":9633,"Subset;":8912,"Supset;":8913,"Tcaron;":356,"Tcedil;":354,"Tstrok;":358,"Uacute;":218,"Ubreve;":364,"Udblac;":368,"Ugrave;":217,"Utilde;":360,"Vdashl;":10982,"Verbar;":8214,"Vvdash;":8874,"Yacute;":221,"Zacute;":377,"Zcaron;":381,"aacute;":225,"abreve;":259,"agrave;":224,"andand;":10837,"angmsd;":8737,"angsph;":8738,"apacir;":10863,"approx;":8776,"atilde;":227,"barvee;":8893,"barwed;":8965,"becaus;":8757,"bernou;":8492,"bigcap;":8898,"bigcup;":8899,"bigvee;":8897,"bkarow;":10509,"bottom;":8869,"bowtie;":8904,"boxbox;":10697,"bprime;":8245,"brvbar;":166,"bullet;":8226,"bumpeq;":8783,"cacute;":263,"capand;":10820,"capcap;":10827,"capcup;":10823,"capdot;":10816,"ccaron;":269,"ccedil;":231,"circeq;":8791,"cirmid;":10991,"colone;":8788,"commat;":64,"compfn;":8728,"conint;":8750,"coprod;":8720,"copysr;":8471,"cularr;":8630,"cupcap;":10822,"cupcup;":10826,"cupdot;":8845,"curarr;":8631,"curren;":164,"cylcty;":9005,"dagger;":8224,"daleth;":8504,"dcaron;":271,"dfisht;":10623,"divide;":247,"divonx;":8903,"dlcorn;":8990,"dlcrop;":8973,"dollar;":36,"drcorn;":8991,"drcrop;":8972,"dstrok;":273,"eacute;":233,"easter;":10862,"ecaron;":283,"ecolon;":8789,"egrave;":232,"egsdot;":10904,"elsdot;":10903,"emptyv;":8709,"emsp13;":8196,"emsp14;":8197,"eparsl;":10723,"eqcirc;":8790,"equals;":61,"equest;":8799,"female;":9792,"ffilig;":64259,"ffllig;":64260,"forall;":8704,"frac12;":189,"frac13;":8531,"frac14;":188,"frac15;":8533,"frac16;":8537,"frac18;":8539,"frac23;":8532,"frac25;":8534,"frac34;":190,"frac35;":8535,"frac38;":8540,"frac45;":8536,"frac56;":8538,"frac58;":8541,"frac78;":8542,"gacute;":501,"gammad;":989,"gbreve;":287,"gesdot;":10880,"gesles;":10900,"gtlPar;":10645,"gtrarr;":10616,"gtrdot;":8919,"gtrsim;":8819,"hairsp;":8202,"hamilt;":8459,"hardcy;":1098,"hearts;":9829,"hellip;":8230,"hercon;":8889,"homtht;":8763,"horbar;":8213,"hslash;":8463,"hstrok;":295,"hybull;":8259,"hyphen;":8208,"iacute;":237,"igrave;":236,"iiiint;":10764,"iinfin;":10716,"incare;":8453,"inodot;":305,"intcal;":8890,"iquest;":191,"isinsv;":8947,"itilde;":297,"jsercy;":1112,"kappav;":1008,"kcedil;":311,"kgreen;":312,"lAtail;":10523,"lacute;":314,"lagran;":8466,"lambda;":955,"langle;":10216,"larrfs;":10525,"larrhk;":8617,"larrlp;":8619,"larrpl;":10553,"larrtl;":8610,"latail;":10521,"lbrace;":123,"lbrack;":91,"lcaron;":318,"lcedil;":316,"ldquor;":8222,"lesdot;":10879,"lesges;":10899,"lfisht;":10620,"lfloor;":8970,"lharul;":10602,"llhard;":10603,"lmidot;":320,"lmoust;":9136,"loplus;":10797,"lowast;":8727,"lowbar;":95,"lparlt;":10643,"lrhard;":10605,"lsaquo;":8249,"lsquor;":8218,"lstrok;":322,"lthree;":8907,"ltimes;":8905,"ltlarr;":10614,"ltrPar;":10646,"mapsto;":8614,"marker;":9646,"mcomma;":10793,"midast;":42,"midcir;":10992,"middot;":183,"minusb;":8863,"minusd;":8760,"mnplus;":8723,"models;":8871,"mstpos;":8766,"nVDash;":8879,"nVdash;":8878,"nacute;":324,"nbumpe;":8783,"ncaron;":328,"ncedil;":326,"nearhk;":10532,"nequiv;":8802,"nesear;":10536,"nexist;":8708,"nltrie;":8940,"notinE;":8953,"nparsl;":11005,"nprcue;":8928,"nrarrc;":10547,"nrarrw;":8605,"nrtrie;":8941,"nsccue;":8929,"nsimeq;":8772,"ntilde;":241,"numero;":8470,"nvDash;":8877,"nvHarr;":10500,"nvdash;":8876,"nvlArr;":10498,"nvrArr;":10499,"nwarhk;":10531,"nwnear;":10535,"oacute;":243,"odblac;":337,"odsold;":10684,"ograve;":242,"ominus;":8854,"origof;":8886,"oslash;":248,"otilde;":245,"otimes;":8855,"parsim;":10995,"percnt;":37,"period;":46,"permil;":8240,"phmmat;":8499,"planck;":8463,"plankv;":8463,"plusdo;":8724,"plusdu;":10789,"plusmn;":177,"preceq;":10927,"primes;":8473,"prnsim;":8936,"propto;":8733,"prurel;":8880,"puncsp;":8200,"qprime;":8279,"rAtail;":10524,"racute;":341,"rangle;":10217,"rarrap;":10613,"rarrfs;":10526,"rarrhk;":8618,"rarrlp;":8620,"rarrpl;":10565,"rarrtl;":8611,"ratail;":10522,"rbrace;":125,"rbrack;":93,"rcaron;":345,"rcedil;":343,"rdquor;":8221,"rfisht;":10621,"rfloor;":8971,"rharul;":10604,"rmoust;":9137,"roplus;":10798,"rpargt;":10644,"rsaquo;":8250,"rsquor;":8217,"rthree;":8908,"rtimes;":8906,"sacute;":347,"scaron;":353,"scedil;":351,"scnsim;":8937,"searhk;":10533,"seswar;":10537,"sfrown;":8994,"shchcy;":1097,"sigmaf;":962,"sigmav;":962,"simdot;":10858,"smashp;":10803,"softcy;":1100,"solbar;":9023,"spades;":9824,"sqcaps;":8851,"sqcups;":8852,"sqsube;":8849,"sqsupe;":8850,"square;":9633,"squarf;":9642,"ssetmn;":8726,"ssmile;":8995,"sstarf;":8902,"subdot;":10941,"subset;":8834,"subsim;":10951,"subsub;":10965,"subsup;":10963,"succeq;":10928,"supdot;":10942,"supset;":8835,"supsim;":10952,"supsub;":10964,"supsup;":10966,"swarhk;":10534,"swnwar;":10538,"target;":8982,"tcaron;":357,"tcedil;":355,"telrec;":8981,"there4;":8756,"thetav;":977,"thinsp;":8201,"thksim;":8764,"timesb;":8864,"timesd;":10800,"topbot;":9014,"topcir;":10993,"tprime;":8244,"tridot;":9708,"tstrok;":359,"uacute;":250,"ubreve;":365,"udblac;":369,"ufisht;":10622,"ugrave;":249,"ulcorn;":8988,"ulcrop;":8975,"urcorn;":8989,"urcrop;":8974,"utilde;":361,"vangrt;":10652,"varphi;":981,"varrho;":1009,"veebar;":8891,"vellip;":8942,"verbar;":124,"vsubnE;":10955,"vsubne;":8842,"vsupnE;":10956,"vsupne;":8843,"wedbar;":10847,"wedgeq;":8793,"weierp;":8472,"wreath;":8768,"xoplus;":10753,"xotime;":10754,"xsqcup;":10758,"xuplus;":10756,"xwedge;":8896,"yacute;":253,"zacute;":378,"zcaron;":382,"zeetrf;":8488,"AElig;":198,Aacute:193,"Acirc;":194,Agrave:192,"Alpha;":913,"Amacr;":256,"Aogon;":260,"Aring;":197,Atilde:195,"Breve;":728,Ccedil:199,"Ccirc;":264,"Colon;":8759,"Cross;":10799,"Dashv;":10980,"Delta;":916,Eacute:201,"Ecirc;":202,Egrave:200,"Emacr;":274,"Eogon;":280,"Equal;":10869,"Gamma;":915,"Gcirc;":284,"Hacek;":711,"Hcirc;":292,"IJlig;":306,Iacute:205,"Icirc;":206,Igrave:204,"Imacr;":298,"Iogon;":302,"Iukcy;":1030,"Jcirc;":308,"Jukcy;":1028,"Kappa;":922,Ntilde:209,"OElig;":338,Oacute:211,"Ocirc;":212,Ograve:210,"Omacr;":332,"Omega;":937,Oslash:216,Otilde:213,"Prime;":8243,"RBarr;":10512,"Scirc;":348,"Sigma;":931,"THORN;":222,"TRADE;":8482,"TSHcy;":1035,"Theta;":920,"Tilde;":8764,Uacute:218,"Ubrcy;":1038,"Ucirc;":219,Ugrave:217,"Umacr;":362,"Union;":8899,"Uogon;":370,"UpTee;":8869,"Uring;":366,"VDash;":8875,"Vdash;":8873,"Wcirc;":372,"Wedge;":8896,Yacute:221,"Ycirc;":374,aacute:225,"acirc;":226,"acute;":180,"aelig;":230,agrave:224,"aleph;":8501,"alpha;":945,"amacr;":257,"amalg;":10815,"angle;":8736,"angrt;":8735,"angst;":197,"aogon;":261,"aring;":229,"asymp;":8776,atilde:227,"awint;":10769,"bcong;":8780,"bdquo;":8222,"bepsi;":1014,"blank;":9251,"blk12;":9618,"blk14;":9617,"blk34;":9619,"block;":9608,"boxDL;":9559,"boxDR;":9556,"boxDl;":9558,"boxDr;":9555,"boxHD;":9574,"boxHU;":9577,"boxHd;":9572,"boxHu;":9575,"boxUL;":9565,"boxUR;":9562,"boxUl;":9564,"boxUr;":9561,"boxVH;":9580,"boxVL;":9571,"boxVR;":9568,"boxVh;":9579,"boxVl;":9570,"boxVr;":9567,"boxdL;":9557,"boxdR;":9554,"boxdl;":9488,"boxdr;":9484,"boxhD;":9573,"boxhU;":9576,"boxhd;":9516,"boxhu;":9524,"boxuL;":9563,"boxuR;":9560,"boxul;":9496,"boxur;":9492,"boxvH;":9578,"boxvL;":9569,"boxvR;":9566,"boxvh;":9532,"boxvl;":9508,"boxvr;":9500,"breve;":728,brvbar:166,"bsemi;":8271,"bsime;":8909,"bsolb;":10693,"bumpE;":10926,"bumpe;":8783,"caret;":8257,"caron;":711,"ccaps;":10829,ccedil:231,"ccirc;":265,"ccups;":10828,"cedil;":184,"check;":10003,"clubs;":9827,"colon;":58,"comma;":44,"crarr;":8629,"cross;":10007,"csube;":10961,"csupe;":10962,"ctdot;":8943,"cuepr;":8926,"cuesc;":8927,"cupor;":10821,curren:164,"cuvee;":8910,"cuwed;":8911,"cwint;":8753,"dashv;":8867,"dblac;":733,"ddarr;":8650,"delta;":948,"dharl;":8643,"dharr;":8642,"diams;":9830,"disin;":8946,divide:247,"doteq;":8784,"dtdot;":8945,"dtrif;":9662,"duarr;":8693,"duhar;":10607,"eDDot;":10871,eacute:233,"ecirc;":234,"efDot;":8786,egrave:232,"emacr;":275,"empty;":8709,"eogon;":281,"eplus;":10865,"epsiv;":1013,"eqsim;":8770,"equiv;":8801,"erDot;":8787,"erarr;":10609,"esdot;":8784,"exist;":8707,"fflig;":64256,"filig;":64257,"fjlig;":102,"fllig;":64258,"fltns;":9649,"forkv;":10969,frac12:189,frac14:188,frac34:190,"frasl;":8260,"frown;":8994,"gamma;":947,"gcirc;":285,"gescc;":10921,"gimel;":8503,"gneqq;":8809,"gnsim;":8935,"grave;":96,"gsime;":10894,"gsiml;":10896,"gtcir;":10874,"gtdot;":8919,"harrw;":8621,"hcirc;":293,"hoarr;":8703,iacute:237,"icirc;":238,"iexcl;":161,igrave:236,"iiint;":8749,"iiota;":8489,"ijlig;":307,"imacr;":299,"image;":8465,"imath;":305,"imped;":437,"infin;":8734,"iogon;":303,"iprod;":10812,iquest:191,"isinE;":8953,"isins;":8948,"isinv;":8712,"iukcy;":1110,"jcirc;":309,"jmath;":567,"jukcy;":1108,"kappa;":954,"lAarr;":8666,"lBarr;":10510,"langd;":10641,"laquo;":171,"larrb;":8676,"lates;":10925,"lbarr;":10508,"lbbrk;":10098,"lbrke;":10635,"lceil;":8968,"ldquo;":8220,"lescc;":10920,"lhard;":8637,"lharu;":8636,"lhblk;":9604,"llarr;":8647,"lltri;":9722,"lneqq;":8808,"lnsim;":8934,"loang;":10220,"loarr;":8701,"lobrk;":10214,"lopar;":10629,"lrarr;":8646,"lrhar;":8651,"lrtri;":8895,"lsime;":10893,"lsimg;":10895,"lsquo;":8216,"ltcir;":10873,"ltdot;":8918,"ltrie;":8884,"ltrif;":9666,"mDDot;":8762,"mdash;":8212,"micro;":181,middot:183,"minus;":8722,"mumap;":8888,"nabla;":8711,"napid;":8779,"napos;":329,"natur;":9838,"nbump;":8782,"ncong;":8775,"ndash;":8211,"neArr;":8663,"nearr;":8599,"nedot;":8784,"nesim;":8770,"ngeqq;":8807,"ngsim;":8821,"nhArr;":8654,"nharr;":8622,"nhpar;":10994,"nlArr;":8653,"nlarr;":8602,"nleqq;":8806,"nless;":8814,"nlsim;":8820,"nltri;":8938,"notin;":8713,"notni;":8716,"npart;":8706,"nprec;":8832,"nrArr;":8655,"nrarr;":8603,"nrtri;":8939,"nsime;":8772,"nsmid;":8740,"nspar;":8742,"nsubE;":10949,"nsube;":8840,"nsucc;":8833,"nsupE;":10950,"nsupe;":8841,ntilde:241,"numsp;":8199,"nvsim;":8764,"nwArr;":8662,"nwarr;":8598,oacute:243,"ocirc;":244,"odash;":8861,"oelig;":339,"ofcir;":10687,ograve:242,"ohbar;":10677,"olarr;":8634,"olcir;":10686,"oline;":8254,"omacr;":333,"omega;":969,"operp;":10681,"oplus;":8853,"orarr;":8635,"order;":8500,oslash:248,otilde:245,"ovbar;":9021,"parsl;":11005,"phone;":9742,"plusb;":8862,"pluse;":10866,plusmn:177,"pound;":163,"prcue;":8828,"prime;":8242,"prnap;":10937,"prsim;":8830,"quest;":63,"rAarr;":8667,"rBarr;":10511,"radic;":8730,"rangd;":10642,"range;":10661,"raquo;":187,"rarrb;":8677,"rarrc;":10547,"rarrw;":8605,"ratio;":8758,"rbarr;":10509,"rbbrk;":10099,"rbrke;":10636,"rceil;":8969,"rdquo;":8221,"reals;":8477,"rhard;":8641,"rharu;":8640,"rlarr;":8644,"rlhar;":8652,"rnmid;":10990,"roang;":10221,"roarr;":8702,"robrk;":10215,"ropar;":10630,"rrarr;":8649,"rsquo;":8217,"rtrie;":8885,"rtrif;":9656,"sbquo;":8218,"sccue;":8829,"scirc;":349,"scnap;":10938,"scsim;":8831,"sdotb;":8865,"sdote;":10854,"seArr;":8664,"searr;":8600,"setmn;":8726,"sharp;":9839,"sigma;":963,"simeq;":8771,"simgE;":10912,"simlE;":10911,"simne;":8774,"slarr;":8592,"smile;":8995,"smtes;":10924,"sqcap;":8851,"sqcup;":8852,"sqsub;":8847,"sqsup;":8848,"srarr;":8594,"starf;":9733,"strns;":175,"subnE;":10955,"subne;":8842,"supnE;":10956,"supne;":8843,"swArr;":8665,"swarr;":8601,"szlig;":223,"theta;":952,"thkap;":8776,"thorn;":254,"tilde;":732,"times;":215,"trade;":8482,"trisb;":10701,"tshcy;":1115,"twixt;":8812,uacute:250,"ubrcy;":1118,"ucirc;":251,"udarr;":8645,"udhar;":10606,ugrave:249,"uharl;":8639,"uharr;":8638,"uhblk;":9600,"ultri;":9720,"umacr;":363,"uogon;":371,"uplus;":8846,"upsih;":978,"uring;":367,"urtri;":9721,"utdot;":8944,"utrif;":9652,"uuarr;":8648,"vBarv;":10985,"vDash;":8872,"varpi;":982,"vdash;":8866,"veeeq;":8794,"vltri;":8882,"vnsub;":8834,"vnsup;":8835,"vprop;":8733,"vrtri;":8883,"wcirc;":373,"wedge;":8743,"xcirc;":9711,"xdtri;":9661,"xhArr;":10234,"xharr;":10231,"xlArr;":10232,"xlarr;":10229,"xodot;":10752,"xrArr;":10233,"xrarr;":10230,"xutri;":9651,yacute:253,"ycirc;":375,AElig:198,Acirc:194,"Aopf;":120120,Aring:197,"Ascr;":119964,"Auml;":196,"Barv;":10983,"Beta;":914,"Bopf;":120121,"Bscr;":8492,"CHcy;":1063,"COPY;":169,"Cdot;":266,"Copf;":8450,"Cscr;":119966,"DJcy;":1026,"DScy;":1029,"DZcy;":1039,"Darr;":8609,"Dopf;":120123,"Dscr;":119967,Ecirc:202,"Edot;":278,"Eopf;":120124,"Escr;":8496,"Esim;":10867,"Euml;":203,"Fopf;":120125,"Fscr;":8497,"GJcy;":1027,"Gdot;":288,"Gopf;":120126,"Gscr;":119970,"Hopf;":8461,"Hscr;":8459,"IEcy;":1045,"IOcy;":1025,Icirc:206,"Idot;":304,"Iopf;":120128,"Iota;":921,"Iscr;":8464,"Iuml;":207,"Jopf;":120129,"Jscr;":119973,"KHcy;":1061,"KJcy;":1036,"Kopf;":120130,"Kscr;":119974,"LJcy;":1033,"Lang;":10218,"Larr;":8606,"Lopf;":120131,"Lscr;":8466,"Mopf;":120132,"Mscr;":8499,"NJcy;":1034,"Nopf;":8469,"Nscr;":119977,Ocirc:212,"Oopf;":120134,"Oscr;":119978,"Ouml;":214,"Popf;":8473,"Pscr;":119979,"QUOT;":34,"Qopf;":8474,"Qscr;":119980,"Rang;":10219,"Rarr;":8608,"Ropf;":8477,"Rscr;":8475,"SHcy;":1064,"Sopf;":120138,"Sqrt;":8730,"Sscr;":119982,"Star;":8902,THORN:222,"TScy;":1062,"Topf;":120139,"Tscr;":119983,"Uarr;":8607,Ucirc:219,"Uopf;":120140,"Upsi;":978,"Uscr;":119984,"Uuml;":220,"Vbar;":10987,"Vert;":8214,"Vopf;":120141,"Vscr;":119985,"Wopf;":120142,"Wscr;":119986,"Xopf;":120143,"Xscr;":119987,"YAcy;":1071,"YIcy;":1031,"YUcy;":1070,"Yopf;":120144,"Yscr;":119988,"Yuml;":376,"ZHcy;":1046,"Zdot;":379,"Zeta;":918,"Zopf;":8484,"Zscr;":119989,acirc:226,acute:180,aelig:230,"andd;":10844,"andv;":10842,"ange;":10660,"aopf;":120146,"apid;":8779,"apos;":39,aring:229,"ascr;":119990,"auml;":228,"bNot;":10989,"bbrk;":9141,"beta;":946,"beth;":8502,"bnot;":8976,"bopf;":120147,"boxH;":9552,"boxV;":9553,"boxh;":9472,"boxv;":9474,"bscr;":119991,"bsim;":8765,"bsol;":92,"bull;":8226,"bump;":8782,"caps;":8745,"cdot;":267,cedil:184,"cent;":162,"chcy;":1095,"cirE;":10691,"circ;":710,"cire;":8791,"comp;":8705,"cong;":8773,"copf;":120148,"copy;":169,"cscr;":119992,"csub;":10959,"csup;":10960,"cups;":8746,"dArr;":8659,"dHar;":10597,"darr;":8595,"dash;":8208,"diam;":8900,"djcy;":1106,"dopf;":120149,"dscr;":119993,"dscy;":1109,"dsol;":10742,"dtri;":9663,"dzcy;":1119,"eDot;":8785,"ecir;":8790,ecirc:234,"edot;":279,"emsp;":8195,"ensp;":8194,"eopf;":120150,"epar;":8917,"epsi;":949,"escr;":8495,"esim;":8770,"euml;":235,"euro;":8364,"excl;":33,"flat;":9837,"fnof;":402,"fopf;":120151,"fork;":8916,"fscr;":119995,"gdot;":289,"geqq;":8807,"gesl;":8923,"gjcy;":1107,"gnap;":10890,"gneq;":10888,"gopf;":120152,"gscr;":8458,"gsim;":8819,"gtcc;":10919,"gvnE;":8809,"hArr;":8660,"half;":189,"harr;":8596,"hbar;":8463,"hopf;":120153,"hscr;":119997,icirc:238,"iecy;":1077,iexcl:161,"imof;":8887,"iocy;":1105,"iopf;":120154,"iota;":953,"iscr;":119998,"isin;":8712,"iuml;":239,"jopf;":120155,"jscr;":119999,"khcy;":1093,"kjcy;":1116,"kopf;":120156,"kscr;":120000,"lArr;":8656,"lHar;":10594,"lang;":10216,laquo:171,"larr;":8592,"late;":10925,"lcub;":123,"ldca;":10550,"ldsh;":8626,"leqq;":8806,"lesg;":8922,"ljcy;":1113,"lnap;":10889,"lneq;":10887,"lopf;":120157,"lozf;":10731,"lpar;":40,"lscr;":120001,"lsim;":8818,"lsqb;":91,"ltcc;":10918,"ltri;":9667,"lvnE;":8808,"macr;":175,"male;":9794,"malt;":10016,micro:181,"mlcp;":10971,"mldr;":8230,"mopf;":120158,"mscr;":120002,"nGtv;":8811,"nLtv;":8810,"nang;":8736,"napE;":10864,"nbsp;":160,"ncap;":10819,"ncup;":10818,"ngeq;":8817,"nges;":10878,"ngtr;":8815,"nisd;":8954,"njcy;":1114,"nldr;":8229,"nleq;":8816,"nles;":10877,"nmid;":8740,"nopf;":120159,"npar;":8742,"npre;":10927,"nsce;":10928,"nscr;":120003,"nsim;":8769,"nsub;":8836,"nsup;":8837,"ntgl;":8825,"ntlg;":8824,"nvap;":8781,"nvge;":8805,"nvgt;":62,"nvle;":8804,"nvlt;":60,"oast;":8859,"ocir;":8858,ocirc:244,"odiv;":10808,"odot;":8857,"ogon;":731,"oint;":8750,"omid;":10678,"oopf;":120160,"opar;":10679,"ordf;":170,"ordm;":186,"oror;":10838,"oscr;":8500,"osol;":8856,"ouml;":246,"para;":182,"part;":8706,"perp;":8869,"phiv;":981,"plus;":43,"popf;":120161,pound:163,"prap;":10935,"prec;":8826,"prnE;":10933,"prod;":8719,"prop;":8733,"pscr;":120005,"qint;":10764,"qopf;":120162,"qscr;":120006,"quot;":34,"rArr;":8658,"rHar;":10596,"race;":8765,"rang;":10217,raquo:187,"rarr;":8594,"rcub;":125,"rdca;":10551,"rdsh;":8627,"real;":8476,"rect;":9645,"rhov;":1009,"ring;":730,"ropf;":120163,"rpar;":41,"rscr;":120007,"rsqb;":93,"rtri;":9657,"scap;":10936,"scnE;":10934,"sdot;":8901,"sect;":167,"semi;":59,"sext;":10038,"shcy;":1096,"sime;":8771,"simg;":10910,"siml;":10909,"smid;":8739,"smte;":10924,"solb;":10692,"sopf;":120164,"spar;":8741,"squf;":9642,"sscr;":120008,"star;":9734,"subE;":10949,"sube;":8838,"succ;":8827,"sung;":9834,"sup1;":185,"sup2;":178,"sup3;":179,"supE;":10950,"supe;":8839,szlig:223,"tbrk;":9140,"tdot;":8411,thorn:254,times:215,"tint;":8749,"toea;":10536,"topf;":120165,"tosa;":10537,"trie;":8796,"tscr;":120009,"tscy;":1094,"uArr;":8657,"uHar;":10595,"uarr;":8593,ucirc:251,"uopf;":120166,"upsi;":965,"uscr;":120010,"utri;":9653,"uuml;":252,"vArr;":8661,"vBar;":10984,"varr;":8597,"vert;":124,"vopf;":120167,"vscr;":120011,"wopf;":120168,"wscr;":120012,"xcap;":8898,"xcup;":8899,"xmap;":10236,"xnis;":8955,"xopf;":120169,"xscr;":120013,"xvee;":8897,"yacy;":1103,"yicy;":1111,"yopf;":120170,"yscr;":120014,"yucy;":1102,"yuml;":255,"zdot;":380,"zeta;":950,"zhcy;":1078,"zopf;":120171,"zscr;":120015,"zwnj;":8204,"AMP;":38,"Acy;":1040,"Afr;":120068,"And;":10835,Auml:196,"Bcy;":1041,"Bfr;":120069,COPY:169,"Cap;":8914,"Cfr;":8493,"Chi;":935,"Cup;":8915,"Dcy;":1044,"Del;":8711,"Dfr;":120071,"Dot;":168,"ENG;":330,"ETH;":208,"Ecy;":1069,"Efr;":120072,"Eta;":919,Euml:203,"Fcy;":1060,"Ffr;":120073,"Gcy;":1043,"Gfr;":120074,"Hat;":94,"Hfr;":8460,"Icy;":1048,"Ifr;":8465,"Int;":8748,Iuml:207,"Jcy;":1049,"Jfr;":120077,"Kcy;":1050,"Kfr;":120078,"Lcy;":1051,"Lfr;":120079,"Lsh;":8624,"Map;":10501,"Mcy;":1052,"Mfr;":120080,"Ncy;":1053,"Nfr;":120081,"Not;":10988,"Ocy;":1054,"Ofr;":120082,Ouml:214,"Pcy;":1055,"Pfr;":120083,"Phi;":934,"Psi;":936,QUOT:34,"Qfr;":120084,"REG;":174,"Rcy;":1056,"Rfr;":8476,"Rho;":929,"Rsh;":8625,"Scy;":1057,"Sfr;":120086,"Sub;":8912,"Sum;":8721,"Sup;":8913,"Tab;":9,"Tau;":932,"Tcy;":1058,"Tfr;":120087,"Ucy;":1059,"Ufr;":120088,Uuml:220,"Vcy;":1042,"Vee;":8897,"Vfr;":120089,"Wfr;":120090,"Xfr;":120091,"Ycy;":1067,"Yfr;":120092,"Zcy;":1047,"Zfr;":8488,"acE;":8766,"acd;":8767,"acy;":1072,"afr;":120094,"amp;":38,"and;":8743,"ang;":8736,"apE;":10864,"ape;":8778,"ast;":42,auml:228,"bcy;":1073,"bfr;":120095,"bne;":61,"bot;":8869,"cap;":8745,cent:162,"cfr;":120096,"chi;":967,"cir;":9675,copy:169,"cup;":8746,"dcy;":1076,"deg;":176,"dfr;":120097,"die;":168,"div;":247,"dot;":729,"ecy;":1101,"efr;":120098,"egs;":10902,"ell;":8467,"els;":10901,"eng;":331,"eta;":951,"eth;":240,euml:235,"fcy;":1092,"ffr;":120099,"gEl;":10892,"gap;":10886,"gcy;":1075,"gel;":8923,"geq;":8805,"ges;":10878,"gfr;":120100,"ggg;":8921,"glE;":10898,"gla;":10917,"glj;":10916,"gnE;":8809,"gne;":10888,"hfr;":120101,"icy;":1080,"iff;":8660,"ifr;":120102,"int;":8747,iuml:239,"jcy;":1081,"jfr;":120103,"kcy;":1082,"kfr;":120104,"lEg;":10891,"lap;":10885,"lat;":10923,"lcy;":1083,"leg;":8922,"leq;":8804,"les;":10877,"lfr;":120105,"lgE;":10897,"lnE;":8808,"lne;":10887,"loz;":9674,"lrm;":8206,"lsh;":8624,macr:175,"map;":8614,"mcy;":1084,"mfr;":120106,"mho;":8487,"mid;":8739,"nGg;":8921,"nGt;":8811,"nLl;":8920,"nLt;":8810,"nap;":8777,nbsp:160,"ncy;":1085,"nfr;":120107,"ngE;":8807,"nge;":8817,"ngt;":8815,"nis;":8956,"niv;":8715,"nlE;":8806,"nle;":8816,"nlt;":8814,"not;":172,"npr;":8832,"nsc;":8833,"num;":35,"ocy;":1086,"ofr;":120108,"ogt;":10689,"ohm;":937,"olt;":10688,"ord;":10845,ordf:170,ordm:186,"orv;":10843,ouml:246,"par;":8741,para:182,"pcy;":1087,"pfr;":120109,"phi;":966,"piv;":982,"prE;":10931,"pre;":10927,"psi;":968,"qfr;":120110,quot:34,"rcy;":1088,"reg;":174,"rfr;":120111,"rho;":961,"rlm;":8207,"rsh;":8625,"scE;":10932,"sce;":10928,"scy;":1089,sect:167,"sfr;":120112,"shy;":173,"sim;":8764,"smt;":10922,"sol;":47,"squ;":9633,"sub;":8834,"sum;":8721,sup1:185,sup2:178,sup3:179,"sup;":8835,"tau;":964,"tcy;":1090,"tfr;":120113,"top;":8868,"ucy;":1091,"ufr;":120114,"uml;":168,uuml:252,"vcy;":1074,"vee;":8744,"vfr;":120115,"wfr;":120116,"xfr;":120117,"ycy;":1099,"yen;":165,"yfr;":120118,yuml:255,"zcy;":1079,"zfr;":120119,"zwj;":8205,AMP:38,"DD;":8517,ETH:208,"GT;":62,"Gg;":8921,"Gt;":8811,"Im;":8465,"LT;":60,"Ll;":8920,"Lt;":8810,"Mu;":924,"Nu;":925,"Or;":10836,"Pi;":928,"Pr;":10939,REG:174,"Re;":8476,"Sc;":10940,"Xi;":926,"ac;":8766,"af;":8289,amp:38,"ap;":8776,"dd;":8518,deg:176,"ee;":8519,"eg;":10906,"el;":10905,eth:240,"gE;":8807,"ge;":8805,"gg;":8811,"gl;":8823,"gt;":62,"ic;":8291,"ii;":8520,"in;":8712,"it;":8290,"lE;":8806,"le;":8804,"lg;":8822,"ll;":8810,"lt;":60,"mp;":8723,"mu;":956,"ne;":8800,"ni;":8715,not:172,"nu;":957,"oS;":9416,"or;":8744,"pi;":960,"pm;":177,"pr;":8826,reg:174,"rx;":8478,"sc;":8827,shy:173,uml:168,"wp;":8472,"wr;":8768,"xi;":958,yen:165,GT:62,LT:60,gt:62,lt:60},Vi=Tf;var Ef=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376];function Cf(e,t){if(t&&!e.endsWith(";"))return`${e}\\b(?!=)`;return e}function ac(e){let n=Object.keys(Vi).map((r)=>Cf(r,e));return new RegExp(`&(#(?:x[a-fA-F\\d]+|\\d+)(?:;)?|${n.join("|")})`,"g")}var ji,Hi;function Sf(e){if(e){if(!Hi)Hi=ac(!0);return Hi}if(!ji)ji=ac(!1);return ji}var oc=0;function vf(e){if(e===10)return 32;if(e<128)return e;if(e<=159)return Ef[e-128];if(e<55296)return e;if(e<=57343)return oc;if(e<=65535)return e;if(e>=65536&&e<=131071)return e;if(e>=131072&&e<=196607)return e;if(e>=917504&&e<=917631||e>=917760&&e<=917999)return e;return oc}function qi(e,t){if(e.indexOf("&")===-1)return e;return e.replace(Sf(t),(n,r)=>{let i;if(r[0]!=="#")i=Vi[r];else if(r[1]==="x")i=Number.parseInt(r.substring(2),16);else i=Number.parseInt(r.substring(1),10);if(!i)return n;return String.fromCodePoint(vf(i))})}class In extends Error{constructor(e){super(`sveld's template parser doesn't support ${e} yet.`);this.name="TemplateParseNotImplementedError"}}var Pf=/<\/script\s*>/g,Af=/<\/script\s*>/y,kf=/[^\n]/g,wf=new Set(["server","client","worker","test","default"]);function cc(e,t,n){let r=e.index,i=e.readUntil(Pf);if(e.index>=e.source.length)throw Error("sveld: unclosed <script> tag");let o=e.source.slice(0,r).replace(kf," ")+i;e.read(Af);let s=ec(o,e.isTypeScript,e.root.comments);s.start=r;let c="default";for(let l of n){if(wf.has(l.name))throw Error(`sveld: "${l.name}" is a reserved <script> attribute name.`);if(l.name==="module"){if(l.value!==!0)throw Error("sveld: <script module> does not take a value.");c="module"}if(l.name==="context"){let d=l.value;if(d===!0||!Array.isArray(d)||d.length!==1||d[0].type!=="Text")throw Error("sveld: context attribute must be a plain string.");if(d[0].data!=="module")throw Error('sveld: only context="module" is valid.');c="module"}}return{type:"Script",start:t,end:e.index,context:c,content:s,attributes:n}}function pc(e,t,n){let r=e.index,i=e.source.indexOf("</style",e.index),o=i===-1?e.source.length:i;return e.index=o,e.eat("</style",!0),e.read(/\s*>/y),{type:"StyleSheet",start:t,end:e.index,attributes:n,children:[],comments:[],content:{start:r,end:o,styles:e.source.slice(r,o),comment:null}}}var Nf=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]);function Ui(e){return Nf.has(e)||e.charCodeAt(0)===33&&e.toLowerCase()==="!doctype"}var Df="^[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}]*)?$",_f=new RegExp(Df,"u");function lc(e){return _f.test(e)}var If=/(?:"([^"]*)"|'([^'])*'|([^>\s]+))/y,mc=/["']/y,Lf=/(\/>|[\s"'=<>`])/y,Gi=/<\/textarea(\s[^>]*)?>/iy,Rf=/^![a-zA-Z]+$/,Mf=/^[a-zA-Z][a-zA-Z0-9]*:[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$/,Of=/^(?:\p{Lu}[$\u200c\u200d\p{ID_Continue}.]*|\p{ID_Start}[$\u200c\u200d\p{ID_Continue}]*(?:\.[$\u200c\u200d\p{ID_Continue}]+)+)$/u,yc={"svelte:head":"SvelteHead","svelte:options":"SvelteOptions","svelte:window":"SvelteWindow","svelte:document":"SvelteDocument","svelte:body":"SvelteBody"},uc={...yc,"svelte:element":"SvelteElement","svelte:component":"SvelteComponent","svelte:self":"SvelteSelf","svelte:fragment":"SvelteFragment","svelte:boundary":"SvelteBoundary"};function Bf(e){let t=e.charCodeAt(0);if(t<97||t>122)return!1;for(let n=1;n<e.length;n++){let r=e.charCodeAt(n);if((r<97||r>122)&&(r<48||r>57))return!1}return!0}function Ff(e){if(Bf(e))return!0;if(Rf.test(e))return!0;if(Mf.test(e))return!0;return lc(e)}function $f(e){let t=e.charCodeAt(0);if(t>=97&&t<=122&&!e.includes("."))return!1;return!0}function Vf(e){return`Svelte${e.slice(7).split("-").map((n)=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}`}function jf(e){for(let t=e.length-1;t>=0;t--){let n=e[t].type;if(n==="SvelteHead")return!0;if(n==="RegularElement"||n==="Component")return!1}return!1}function Hf(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.type==="RegularElement"&&n.attributes?.some((r)=>r.type==="Attribute"&&r.name==="shadowrootmode"))return!0}return!1}function dc(e){let{source:t,index:n}=e;if(n>=t.length)throw new wt("Unexpected end of input",t.length);let r=n;while(r<t.length){let i=t.charCodeAt(r);if(i===47||i===62||Ft(i))break;r++}return e.index=r,{name:t.slice(n,r),start:n,end:r}}function gc(e){let{source:t,index:n}=e;if(n>=t.length)throw new wt("Unexpected end of input",t.length);let r=n;while(r<t.length){let i=t.charCodeAt(r);if(i===61||i===47||i===62||i===34||i===39||Ft(i))break;r++}return e.index=r,{name:t.slice(n,r),start:n,end:r}}function qf(e){let t=e.index;if(e.eat("//")){let n=e.readUntilString(`
43
- `),r=e.index;e.root.comments.push({type:"Line",value:n,start:t,end:r});return}if(e.eat("/*")){let n=e.readUntilString("*/");e.eat("*/");let r=e.index;e.root.comments.push({type:"Block",value:n,start:t,end:r})}}function Uf(e){if(e==="use")return"UseDirective";if(e==="animate")return"AnimateDirective";if(e==="bind")return"BindDirective";if(e==="class")return"ClassDirective";if(e==="style")return"StyleDirective";if(e==="on")return"OnDirective";if(e==="let")return"LetDirective";if(e==="in"||e==="out"||e==="transition")return"TransitionDirective";return!1}function xc(e,t,n){let r={start:e.index,end:-1,type:"Text",raw:"",data:""},i=[],o=(s)=>{if(s>r.start)r.raw=e.source.slice(r.start,s),r.data=qi(r.raw,!0),r.end=s,i.push(r)};while(e.index<e.source.length){if(t())return o(e.index),i;if(e.eat("{")){if(e.match("#")||e.match("@"))throw new In("blocks/tags inside attribute value sequences");let s=e.index-1;o(s),e.allowWhitespace();let c=Ce(e);e.allowWhitespace(),e.eat("}",!0),i.push({type:"ExpressionTag",start:s,end:e.index,expression:c}),r={start:e.index,end:-1,type:"Text",raw:"",data:""}}else{let s=e.index+1;if(n!==void 0){let c=e.source;while(s<c.length){let l=c.charCodeAt(s);if(l===123||l===n)break;s++}}e.index=s}}throw new In("unterminated attribute value / sequence (loose mode)")}function Gf(e){let t=e.eat("'")?"'":e.eat('"')?'"':null;if(t&&e.eat(t))return[{start:e.index-1,end:e.index-1,type:"Text",raw:"",data:""}];let n=xc(e,()=>{if(t)return e.match(t);return!!e.matchRegex(Lf)},t===null?void 0:t.charCodeAt(0));if(n.length===0&&!t)throw Error("sveld: expected attribute value");if(t)e.index+=1;if(t||n.length>1||n[0].type==="Text")return n;return n[0]}function Wi(e,t,n,r){return{type:"Attribute",start:t,end:n,name:e,value:r}}function Wf(e){let t=e.index,n=gc(e);if(!n.name)return null;let r=!0;if(e.eat("=")){e.allowWhitespace();let i=e.matchRegex(If);if(!i)throw Error("sveld: expected attribute value");e.index+=i.length;let o=i[0]==='"'||i[0]==="'";if(o)i=i.slice(1,-1);r=[{start:e.index-i.length-(o?1:0),end:o?e.index-1:e.index,type:"Text",raw:i,data:qi(i,!0)}]}if(e.matchRegex(mc))throw Error("sveld: expected '='");return Wi(n.name,t,e.index,r)}function Kf(e){while(!0){let c=e.index;if(qf(e),e.index===c)break;e.allowWhitespace()}let t=e.index;if(e.eat("{")){if(e.allowWhitespace(),e.eat("@attach")){e.requireWhitespace();let d=Ce(e);return e.allowWhitespace(),e.eat("}",!0),{type:"AttachTag",start:t,end:e.index,expression:d}}if(e.eat("...")){let d=Ce(e);return e.allowWhitespace(),e.eat("}",!0),{type:"SpreadAttribute",start:t,end:e.index,expression:d}}let c=e.readIdentifierName();if(c.name==="")throw Error("sveld: empty attribute shorthand");e.allowWhitespace(),e.eat("}",!0);let l={type:"ExpressionTag",start:c.start,end:c.end,expression:c};return Wi(c.name,t,e.index,l)}let n=gc(e);if(!n.name)return null;let r=e.index;e.allowWhitespace();let i=n.name.indexOf(":"),o=i!==-1&&Uf(n.name.slice(0,i)),s=!0;if(e.eat("="))if(e.allowWhitespace(),e.source[e.index]==="/"&&e.source[e.index+1]===">"){let c=e.index;e.index++,s=[{start:c,end:c+1,type:"Text",raw:"/",data:"/"}],r=e.index}else s=Gf(e),r=e.index;else if(e.matchRegex(mc))throw Error("sveld: expected '='");if(o){let c=n.name.slice(i+1).split("|",1)[0];if(c==="")throw Error("sveld: directive missing a name");if(o==="StyleDirective")return{start:t,end:r,type:o,name:c,value:s};let l=s===!0?void 0:Array.isArray(s)?s[0]:s,d=null;if(l){if((Array.isArray(s)?s.length>1:!1)||l.type==="Text")throw Error("sveld: directive value must be a single expression");d=l.expression}let u={start:t,end:r,type:o,name:c,expression:d};if((u.type==="BindDirective"||u.type==="ClassDirective")&&!u.expression)u.expression={start:t+i+1,end:r,type:"Identifier",name:u.name};return u}return Wi(n.name,t,r,s)}function bc(e){let t=e.index++,n=e.current();if(e.eat("!--")){let g=e.readUntilString("-->");e.eat("-->",!0),e.append({type:"Comment",start:t,end:e.index,data:g});return}if(e.eat("/")){let{name:g}=dc(e);if(e.allowWhitespace(),e.eat(">",!0),Ui(g))throw Error(`sveld: <${g}> is a void element and cannot have a closing tag`);while(n.name!==g){if(n.type==="RegularElement");else throw Error(`sveld: invalid closing tag </${g}>`);n.end=t,e.pop(),n=e.current()}if(n.end=e.index,e.pop(),e.lastAutoClosedTag&&e.stack.length<e.lastAutoClosedTag.depth)e.lastAutoClosedTag=void 0;return}let r=dc(e),i=$f(r.name)&&Of.test(r.name);if(!Ff(r.name)&&!i)throw Error(`sveld: "${r.name}" is not a valid element or component name`);if(r.name in yc&&n.type!=="Root")throw Error(`sveld: <${r.name}> must be a top-level element`);let o;if(r.name in uc)o=uc[r.name];else if(r.name.startsWith("svelte:"))o=Vf(r.name);else if(i)o="Component";else if(r.name==="title"&&jf(e.stack))o="TitleElement";else if(r.name==="slot"&&!Hf(e.stack))o="SlotElement";else o="RegularElement";let s={type:o,start:t,end:-1,name:r.name,attributes:[],fragment:{type:"Fragment",nodes:[]}};if(e.allowWhitespace(),n.type==="RegularElement"&&Ha(n.name,r.name))n.end=t,e.pop(),e.lastAutoClosedTag={tag:n.name,reason:r.name,depth:e.stack.length},n=e.current();let c=e.current(),l=(r.name==="script"||r.name==="style")&&c.type==="Root",d=l?Wf:Kf,u;while(u=d(e))s.attributes.push(u),e.allowWhitespace();if(s.type==="SvelteComponent")s.expression=hc(fc(s));if(s.type==="SvelteElement"){let g=fc(s);if(g.value===!0)throw Error("sveld: <svelte:element> `this` attribute needs a value");if(Jf(g))s.tag=hc(g);else{let b=g.value[0];s.tag=b.type==="Text"?{type:"Literal",value:b.data,raw:`'${b.raw}'`,start:b.start,end:b.end}:b.expression}}if(l){e.eat(">",!0);let g=zf(c.fragment.nodes,t);if(r.name==="script"){let b=cc(e,t,s.attributes);if(g)b.content.leadingComments=[{type:"Line",value:g.data}];if(b.context==="module"){if(e.root.module)throw Error("sveld: duplicate <script module>");e.root.module=b}else{if(e.root.instance)throw Error("sveld: duplicate <script>");e.root.instance=b}}else{if(e.root.css)throw Error("sveld: duplicate <style>");let b=pc(e,t,s.attributes);b.content.comment=g,e.root.css=b}return}e.append(s);let y=e.eat("/")||Ui(r.name);if(e.eat(">",!0),y)s.end=e.index;else if(r.name==="textarea")s.fragment.nodes=xc(e,()=>(Gi.lastIndex=e.index,Gi.test(e.source))),e.read(Gi),s.end=e.index;else e.push(s,s.fragment)}function zf(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(n===e.length-1&&r.end!==t)break;if(r.type==="Comment")return r;if(r.type!=="Text"||r.data.trim())break}return null}function fc(e){let t=e.attributes,n=t.findIndex((r)=>r.type==="Attribute"&&r.name==="this");if(n===-1)throw Error(`sveld: <${e.name}> requires a \`this\` attribute`);return t.splice(n,1)[0]}function hc(e){return Array.isArray(e.value)?e.value[0].expression:e.value.expression}function Jf(e){return e.value!==!0&&!Array.isArray(e.value)||Array.isArray(e.value)&&e.value.length===1&&e.value[0].type==="ExpressionTag"}function Tc(e){let t={start:e.start,end:e.end,attributes:e.attributes};for(let n of e.attributes){if(n.type!=="Attribute")continue;if(n.name==="runes"){let r=Ec(n);if(typeof r==="boolean")t.runes=r}if(n.name==="customElement"){let r=Qf(n);if(r!==void 0)t.customElement=r}}return t}function Ec(e){let{value:t}=e;if(t===!0)return!0;let n=Array.isArray(t)?t[0]:t;if(!n)return!0;if(Array.isArray(t)&&t.length>1)return null;if(n.type==="Text")return n.data;if(n.expression.type!=="Literal")return null;return n.expression.value}var Xf=new Set(["String","Boolean","Number","Array","Object"]);function Ki(e){let t=[];for(let n of e.properties){if(!n||typeof n!=="object"||n.type!=="Property"||n.computed||n.key?.type!=="Identifier")continue;let{key:r,value:i}=n;t.push([r.name,i])}return t}function Yf(e){let t={};if(!e||typeof e!=="object"||e.type!=="ObjectExpression")return t;for(let[n,r]of Ki(e)){if(!r||typeof r!=="object"||r.type!=="Literal")continue;let i=r.value;if(n==="attribute"&&typeof i==="string")t.attribute=i;else if(n==="reflect"&&typeof i==="boolean")t.reflect=i;else if(n==="type"&&typeof i==="string"&&Xf.has(i))t.type=i}return t}function Qf(e){let{value:t}=e;if(t===!0)return;let n=Array.isArray(t)?t[0]:t;if(!n)return;if(n.type==="Text"){let u=Ec(e);return typeof u==="string"?{tag:u}:void 0}let r=n.expression;if(r.type==="Literal"&&r.value===null)return;if(r.type!=="ObjectExpression")return;let i=Ki(r),o={},s=i.find(([u])=>u==="tag")?.[1];if(s&&typeof s==="object"&&s.type==="Literal"&&typeof s.value==="string")o.tag=s.value;let c=i.find(([u])=>u==="props")?.[1];if(c&&typeof c==="object"&&c.type==="ObjectExpression"){o.props={};for(let[u,y]of Ki(c))o.props[u]=Yf(y)}let l=i.find(([u])=>u==="shadow")?.[1];if(l&&typeof l==="object"){let u=l;if(u.type==="Literal"&&(u.value==="open"||u.value==="none"))o.shadow=u.value;else if(u.type==="ObjectExpression")o.shadow=l}let d=i.find(([u])=>u==="extend")?.[1];if(d!==void 0)o.extend=d;return o}var Zf=/<script\s+(?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?ts\1[^>]*>/;class zi extends Fi{root;stack=[];fragments=[];isTypeScript;lineTable={};lastAutoClosedTag;constructor(e,t){super(e);this.isTypeScript=Zf.test(e);let n=Me();this.root={type:"Root",start:0,end:t,css:null,js:[],options:null,fragment:n,comments:[]},this.stack.push(this.root),this.fragments.push(n)}current(){return this.stack[this.stack.length-1]}currentFragment(){return this.fragments[this.fragments.length-1]}push(e,t){this.stack.push(e),this.fragments.push(t)}pop(){return this.fragments.pop(),this.stack.pop()}append(e){return this.currentFragment().nodes.push(e),e}}var Ji={"{":"}","(":")","[":"]"},eh=new Set(Object.values(Ji));function Ln(e,t,n=Ji){let r=n===Ji?eh:new Set(Object.values(n)),i=[],o=t;while(o<e.source.length){let s=e.source[o++];if(s==="'"||s==='"'||s==="`"){o=th(e,o,s);continue}if(Object.hasOwn(n,s))i.push(s);else if(r.has(s)){let c=i.pop(),l=c?n[c]:void 0;if(s!==l)throw Error(`sveld: expected "${l}"`);if(i.length===0)return o}}throw Error("sveld: unexpected end of input")}function th(e,t,n){let r=!1,i=t;while(i<e.source.length){let o=e.source[i++];if(r){r=!1;continue}if(o===n)return i;if(o==="\\")r=!0;if(n==="`"&&o==="$"&&e.source[i]==="{")i=Ln(e,i)}throw Error("sveld: unterminated string constant")}var Sc=/[^\n]/g,nh=/\?\s*:/g;function Nt(e){let t=e.index,n=e.readIdentifierName();if(n.name!==""){let g=Cc(e);return{...n,typeAnnotation:g}}let r=e.source[e.index];if(r!=="{"&&r!=="[")throw Error("sveld: expected a binding pattern");let i=Ln(e,t);e.index=i;let o=e.source.slice(t,i),s=e.source.slice(0,t).replace(Sc," "),c=s.indexOf(" ");s=s.slice(0,c)+s.slice(c+1);let l=`${s}(${o} = 1)`,{node:d}=tn(l,t-1,e.isTypeScript,e.root.comments),u=d.left,y=Cc(e);if(y)u.typeAnnotation=y,u.end=y.end;return u}function Cc(e){let t=e.index;if(e.allowWhitespace(),!e.eat(":")){e.index=t;return}let n="_ as ",r=e.index-n.length,i=e.source.slice(0,r).replace(Sc," ")+n+e.source.slice(e.index).replace(nh,":"),{node:o}=tn(i,r,e.isTypeScript,e.root.comments),s=o;if(s.type==="AssignmentExpression"){let c=s.right.start;while(i[c]!=="=")c-=1;({node:o}=tn(i.slice(0,c),r,e.isTypeScript,e.root.comments)),s=o}if(s.type==="SequenceExpression"&&s.expressions)s=s.expressions[0];return e.index=s.end,{type:"TSTypeAnnotation",start:t,end:e.index,typeAnnotation:s.typeAnnotation}}var vc=/\s*}/y,rh={"<":">"};function Pc(e){let t=e.index-2;while(e.source[t]!=="{")t-=1;if(e.eat("if")){e.requireWhitespace();let n={type:"IfBlock",elseif:!1,start:t,end:-1,test:Ce(e),consequent:Me(),alternate:null};e.append(n),e.allowWhitespace(),e.eat("}",!0),e.push(n,n.consequent);return}if(e.eat("each")){e.requireWhitespace();let n=Ce(e);if(e.allowWhitespace(),!e.match("as")){let c=n;if(c.type==="SequenceExpression"&&c.expressions)c=c.expressions[0];if(c.type==="TSAsExpression"){let l=c;n=l.expression;let d=l.typeAnnotation.start-2;while(d>=0&&!(e.source[d]==="a"&&e.source[d+1]==="s"))d-=1;e.index=d}}let r=null,i,o;if(e.eat("as"))e.requireWhitespace(),r=Nt(e);if(e.allowWhitespace(),e.eat(",")){e.allowWhitespace();let c=e.readIdentifierName();if(!c.name)throw Error("sveld: expected an identifier");i=c.name,e.allowWhitespace()}if(e.eat("("))e.allowWhitespace(),o=Ce(e),e.allowWhitespace(),e.eat(")",!0),e.allowWhitespace();e.eat("}",!0);let s={type:"EachBlock",start:t,end:-1,expression:n,body:Me(),context:r,index:i,key:o};e.append(s),e.push(s,s.body);return}if(e.eat("await")){e.requireWhitespace();let n=Ce(e);e.allowWhitespace();let r={type:"AwaitBlock",start:t,end:-1,expression:n,value:null,error:null,pending:null,then:null,catch:null};if(e.eat("then")){if(!e.matchRegex(vc))e.requireWhitespace(),r.value=Nt(e),e.allowWhitespace();r.then=Me()}else if(e.eat("catch")){if(!e.matchRegex(vc))e.requireWhitespace(),r.error=Nt(e),e.allowWhitespace();r.catch=Me()}else r.pending=Me();e.eat("}",!0),e.append(r),e.push(r,r.then??r.catch??r.pending);return}if(e.eat("key")){e.requireWhitespace();let n=Ce(e);e.allowWhitespace(),e.eat("}",!0);let r={type:"KeyBlock",start:t,end:-1,expression:n,fragment:Me()};e.append(r),e.push(r,r.fragment);return}if(e.eat("snippet")){e.requireWhitespace();let n=e.readIdentifierName();if(n.name==="")throw Error("sveld: expected a snippet name");e.allowWhitespace();let r;if(e.isTypeScript&&e.match("<")){let o=e.index,s=Ln(e,o,rh);r=e.source.slice(o+1,s-1),e.index=s}if(e.allowWhitespace(),e.eat("(")){let o=1;while(e.index<e.source.length&&(!e.match(")")||o!==1)){if(e.match("("))o++;if(e.match(")"))o--;e.index+=1}e.eat(")",!0)}e.allowWhitespace(),e.eat("}",!0);let i={type:"SnippetBlock",start:t,end:-1,expression:n,typeParams:r,parameters:[],body:Me()};e.append(i),e.push(i,i.body);return}throw Error("sveld: expected if/each/await/key/snippet")}function Ac(e){let t=e.index-1,n=e.current();if(n.type==="IfBlock"){if(!e.eat("else"))throw Error("sveld: expected {:else} or {:else if}");if(e.eat("if"))throw Error("sveld: {:else if} cannot follow {:else if} directly");if(e.allowWhitespace(),e.fragments.pop(),n.alternate=Me(),e.fragments.push(n.alternate),e.eat("if")){e.requireWhitespace();let r=Ce(e);e.allowWhitespace(),e.eat("}",!0);let i=t-1;while(e.source[i]!=="{")i-=1;let o={type:"IfBlock",start:i,end:-1,elseif:!0,test:r,consequent:Me(),alternate:null};e.append(o),e.stack.push(o),e.fragments.pop(),e.fragments.push(o.consequent)}else e.allowWhitespace(),e.eat("}",!0);return}if(n.type==="EachBlock"){if(!e.eat("else"))throw Error("sveld: expected {:else}");e.allowWhitespace(),e.eat("}",!0),n.fallback=Me(),e.fragments.pop(),e.fragments.push(n.fallback);return}if(n.type==="AwaitBlock"){if(e.eat("then")){if(n.then)throw Error("sveld: duplicate {:then}");if(!e.eat("}"))e.requireWhitespace(),n.value=Nt(e),e.allowWhitespace(),e.eat("}",!0);n.then=Me(),e.fragments.pop(),e.fragments.push(n.then);return}if(e.eat("catch")){if(n.catch)throw Error("sveld: duplicate {:catch}");if(!e.eat("}"))e.requireWhitespace(),n.error=Nt(e),e.allowWhitespace(),e.eat("}",!0);n.catch=Me(),e.fragments.pop(),e.fragments.push(n.catch);return}throw Error("sveld: expected {:then ...} or {:catch ...}")}throw Error("sveld: {:...} not valid here")}function kc(e){let t=e.current();switch(t.type){case"IfBlock":{e.eat("if",!0),e.allowWhitespace(),e.eat("}",!0);while(t.type==="IfBlock"&&t.elseif)t.end=e.index,e.stack.pop(),t=e.current();t.end=e.index,e.pop();return}case"EachBlock":e.eat("each",!0);break;case"KeyBlock":e.eat("key",!0);break;case"AwaitBlock":e.eat("await",!0);break;case"SnippetBlock":e.eat("snippet",!0);break;default:throw Error("sveld: unexpected closing block tag")}e.allowWhitespace(),e.eat("}",!0),t.end=e.index,e.pop()}var ih=/(?:let|const)\b/y,sh=/(?:var|interface|enum)\b/y,ah=/type\b/y;function wc(e){let t=e.index;if(e.matchRegex(sh))throw Error("sveld: `var`/`interface`/`enum` are not valid here");if(!e.matchRegex(ih)&&!e.matchRegex(ah))return null;let n=e.root.comments.length,r=tc(e.source,t,e.isTypeScript,e.root.comments);if(r.type!=="VariableDeclaration"){if(r.type==="ExpressionStatement")return e.root.comments.length=n,null;throw Error("sveld: expected a `let`/`const` declaration")}if(r.kind!=="let"&&r.kind!=="const")throw Error("sveld: expected a `let`/`const` declaration");return e.index=r.end,e.allowWhitespace(),e.eat("}",!0),r}var oh=/\s*}/y;function Nc(e){let t=e.index;while(e.source[t]!=="{")t-=1;if(e.eat("html")){e.requireWhitespace();let n=Ce(e);e.allowWhitespace(),e.eat("}",!0);let r={type:"HtmlTag",start:t,end:e.index,expression:n};e.append(r);return}if(e.eat("debug")){let n;if(e.read(oh))n=[];else{let i=Ce(e);n=i.type==="SequenceExpression"?i.expressions:[i];for(let o of n)if(o.type!=="Identifier")throw Error("sveld: {@debug} arguments must be identifiers");e.allowWhitespace(),e.eat("}",!0)}let r={type:"DebugTag",start:t,end:e.index,identifiers:n};e.append(r);return}if(e.eat("const")){e.requireWhitespace();let n=Nt(e);e.allowWhitespace(),e.eat("=",!0),e.allowWhitespace();let r=Ce(e),i=e.index;e.allowWhitespace(),e.eat("}",!0);let o={type:"VariableDeclarator",id:n,init:r,start:n.start,end:i},s={type:"ConstTag",start:t,end:e.index,declaration:{type:"VariableDeclaration",kind:"const",declarations:[o],start:t+2,end:e.index-1}};e.append(s);return}if(e.eat("render")){e.requireWhitespace();let n=Ce(e);if(!(n.type==="CallExpression"||n.type==="ChainExpression"&&n.expression.type==="CallExpression"))throw Error("sveld: {@render ...} must be a function call");e.allowWhitespace(),e.eat("}",!0);let i={type:"RenderTag",start:t,end:e.index,expression:n};e.append(i);return}throw Error("sveld: expected html/debug/const/render")}function Dc(e){let t=e.index;if(e.index+=1,e.allowWhitespace(),e.eat("#")){Pc(e);return}if(e.eat(":")){Ac(e);return}if(e.eat("@")){Nc(e);return}if(e.match("/")&&!e.match("/*")&&!e.match("//")){e.eat("/"),kc(e);return}let n=wc(e);if(n){let o={type:"DeclarationTag",start:t,end:e.index,declaration:n};e.append(o);return}let r=Ce(e);e.allowWhitespace(),e.eat("}",!0);let i={type:"ExpressionTag",start:t,end:e.index,expression:r};e.append(i)}function _c(e){let{index:t,source:n}=e,r=n.indexOf("<",t),i=n.indexOf("{",t),o;if(r===-1)o=i===-1?n.length:i;else o=i===-1?r:Math.min(r,i);e.index=o;let s=n.slice(t,o),c={type:"Text",start:t,end:e.index,raw:s,data:s};e.append(c)}function Xi(e){let t=e.trimEnd(),n=new zi(t,e.length);while(n.index<n.source.length)if(n.match("<"))bc(n);else if(n.match("{"))Dc(n);else _c(n);let r=n.root.fragment.nodes.findIndex((i)=>i.type==="SvelteOptions");if(r!==-1){let[i]=n.root.fragment.nodes.splice(r,1);n.root.options=Tc(i)}return n.root}function Yi(e){if(e?.type==="Identifier")return e.name;return typeof e?.value==="string"?e.value:void 0}function Ic(e,t){for(let n of(e&&St(e))??[]){let r=n,i=r.type==="ExportNamedDeclaration"&&r.declaration?r.declaration:r;if(i.type==="VariableDeclaration"){let o=i.declarations.find((s)=>s.id.type==="Identifier"?s.id.name===t:ge(s.id).has(t));if(o)return{declaration:i,declarator:o,statement:r}}else if((i.type==="FunctionDeclaration"||i.type==="ClassDeclaration")&&i.id?.name===t)return{declaration:i,statement:r}}return}function ch(e,t){for(let n of(e&&St(e))??[]){let r=n;if(r.type!=="LabeledStatement"||r.label.name!=="$")continue;if(r.body.type!=="ExpressionStatement")continue;let i=r.body.expression;if(i.type!=="AssignmentExpression"||i.operator!=="=")continue;if(!ge(i.left).has(t))continue;let o={type:"VariableDeclarator",id:i.left,init:i.right};return{declaration:{type:"VariableDeclaration",kind:"let",declarations:[o]},declarator:o,statement:r}}return}function Lc(e){if(e==="var")return"let";if(e==="using"||e==="await using")return"const";return e}var ph=null,Rc=/^@component/,lh=/^[A-Za-z_$][\w$]*(?=\s*(?:<|$))/,uh=/\r/g,dh=/^\{\s*\}$/,fh=new Set(["AssignmentExpression","UpdateExpression","CallExpression","SpreadAttribute","FunctionDeclaration","ImportDeclaration","VariableDeclaration","ExportNamedDeclaration","Comment","SlotElement","RenderTag","OnDirective","BindDirective"]);class ke{ctx=ii();static mapToArray(e){return Array.from(e,([t,n])=>n)}static getStaticAttributeValue(e){if(!Array.isArray(e.value))return;return e.value.map((t)=>t.data??t.raw??"").join("").trim()}resolveScriptLanguage(e){let t=[e.instance,e.module].filter((r)=>r!==void 0),n=!1;for(let r of t){let i=r.attributes?.find((s)=>s.name==="lang");if(!i){n=!0;continue}if(ke.getStaticAttributeValue(i)?.toLowerCase()==="ts")return"ts"}return n?"js":void 0}resolveScriptGenericsAttribute(e){let t=e.instance?.attributes?.find((s)=>s.name==="generics");if(!t)return;let n=oe(this.ctx,t),r=e.instance?.attributes?.find((s)=>s.name==="lang");if((r?ke.getStaticAttributeValue(r)?.toLowerCase():void 0)!=="ts"){pe(this.ctx,"syntax-skipped","generics",'<script generics="..."> requires lang="ts"; the generics attribute was ignored because the script is not TypeScript.',n);return}let o=ke.getStaticAttributeValue(t);if(!o)return;return{value:o,source:n}}resolvePublicPropName(e){return this.ctx.propLocalToPublicName.get(e)??e}trackPropLocalName(e,t=e){this.ctx.propLocalToPublicName.set(t,e)}getPropByLocalOrPublic(e){return this.ctx.props.get(this.resolvePublicPropName(e))}getPropTypeByLocalOrPublic(e){return this.getPropByLocalOrPublic(e)?.type}getExplicitPropType(e){return this.ctx.explicitPropTypesByName.get(e)}getPropertyName(e){if(!e||typeof e!=="object"||!("type"in e))return;if(ye(e))return e.name;if(Tt(e))return e.value==null?void 0:String(e.value);return}isNumericConstant(e){if(!e||typeof e!=="object"||!("type"in e))return!1;if(e.type!=="MemberExpression")return!1;let t=e,n=t.object&&"name"in t.object?t.object.name:void 0,r=t.property&&"name"in t.property?t.property.name:void 0;if(!n||!r)return!1;if(n==="Number")return["POSITIVE_INFINITY","NEGATIVE_INFINITY","MAX_VALUE","MIN_VALUE","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","EPSILON","NaN"].includes(r);if(n==="Math")return["PI","E","LN2","LN10","LOG2E","LOG10E","SQRT2","SQRT1_2"].includes(r);return!1}resolveLocalVarJSDoc(e){for(let n of this.ctx.vars)if(n.declarations.some((i)=>i.id&&typeof i.id==="object"&&("type"in i.id)&&i.id.type==="Identifier"&&("name"in i.id)&&i.id.name===e))return Ue(this.ctx,this,n);let t=this.ctx.funcDecls.get(e);if(t)return Ue(this.ctx,this,t);return}addModuleExport(e,t){if(ze(e)===void 0)return;if(this.ctx.moduleExports.has(e)){let n=this.ctx.moduleExports.get(e);this.ctx.moduleExports.set(e,{...n,...t})}else this.ctx.moduleExports.set(e,t)}resolveExportSpecifier(e,t,n,r){let i=Yi(t.local),o=Yi(t.exported);if(!i||!o)return;if(e.source!=null)return{localName:i,exportedName:o};let s=Ic(n,i);if(!s&&r==="instance"){let c=this.ctx.parsed?.module;s=Ic(c,i)??ch(n,i)}return{localName:i,exportedName:o,...s}}recordUnresolvedExportSpecifier(e,t,n){let r=e.source?.value,i=typeof r==="string"?`it re-exports from "${r}"`:this.ctx.valueImportBindingsByLocalName.has(t)?"it re-exports an imported binding":"no matching local declaration was found";pe(this.ctx,"export-unresolved",n,`export "${n}" was skipped because ${i}; sveld only resolves exports of a local declaration.`,oe(this.ctx,e))}exportJSDoc(e,t){if(!t)return Ue(this.ctx,this,e);let n=e.specifiers.length===1?Ue(this.ctx,this,e):void 0,r=Ue(this.ctx,this,t.statement);if(!n||!r)return n??r;let i=Object.fromEntries(Object.entries(n).filter(([,o])=>o!==void 0));return{...r,...i,internal:n.internal||r.internal}}recordClassExport(e,t){pe(this.ctx,"export-unresolved",t,`export "${t}" was skipped because a class can't be a prop; export it from the module script instead.`,oe(this.ctx,e))}dropUndeclaredClassBases(){let e=Array.from(this.ctx.moduleExports.values()).filter((n)=>n.kind==="class"),t=new Set(e.map((n)=>n.localName??n.name));for(let n of e){if(!n.extends)continue;let r=lh.exec(n.extends)?.[0];if(r&&(t.has(r)||this.ctx.valueImportBindingsByLocalName.has(r)||this.ctx.typeImportBindingsByLocalName.has(r)))continue;pe(this.ctx,"export-unresolved",n.name,`class "${n.name}" extends \`${n.extends}\`, which isn't imported or an exported class, so the .d.ts declares it without \`extends\` and its inherited members are missing. Export the base class from the module script.`,n.source),n.extends=void 0}}addModuleClassExport(e,t,n){let r=t.id?.name;if(!r)return;let i=n?.exportedName??r,o=this.exportJSDoc(e,n),{members:s,typeParameters:c,extends:l,implements:d}=ka(this.ctx,this,t),u=c??o?.typeParameters;this.addModuleExport(i,{name:i,...r===i?{}:{localName:r},kind:"class",description:o?.description,deprecated:o?.deprecated,tags:o?.tags,...o?.internal?{internal:!0}:{},type:`typeof ${r}`,...u?{typeParameters:u}:{},members:s,...t.abstract?{abstract:!0}:{},...l?{extends:l}:{},...d?{implements:d}:{},isFunction:!1,isFunctionDeclaration:!1,isRequired:!1,constant:!1,reactive:!1,source:oe(this.ctx,e)})}aliasType(e){if(e==="*")return"any";return e.trim()}findVariableTypeAndDescription(e){let t=this.getPropByLocalOrPublic(e);if(t?.type)return{type:t.type,description:t.description,internal:t.internal};let n=this.variableJsDocEntry(e),r=this.ctx.explicitVariableTypesByName.get(e);if(r)return{type:r,description:n?.description,internal:n?.internal};if(!n?.type)return null;return{type:n.type,description:n.description,internal:n.internal}}findVariableJsDoc(e){let t=this.variableJsDocEntry(e);return{...t?.description?{description:t.description}:{},...t?.internal?{internal:!0}:{}}}variableJsDocEntry(e){if(!this.ctx.variableInfoCacheBuilt)this.ctx.variableInfoCache=ja(this.ctx,this),this.ctx.variableInfoCacheBuilt=!0;return this.ctx.variableInfoCache.get(e)}accumulateGeneric(e,t){if(this.ctx.generics)this.ctx.generics=[`${this.ctx.generics[0]}, ${e}`,`${this.ctx.generics[1]}, ${t}`];else this.ctx.generics=[e,t]}cleanup(){this.ctx=ii()}static SCRIPT_BLOCK_REGEX=/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi;static TS_DIRECTIVE_REGEX=/\/\/(?<!^[ \t]*\*.*\/\/)\s*@ts-[^\n\r]*/gm;static stripTypeScriptDirectivesFromScripts(e){if(!e.includes("@ts-"))return e;return ke.SCRIPT_BLOCK_REGEX.lastIndex=0,e.replace(ke.SCRIPT_BLOCK_REGEX,(t,n,r,i)=>{ke.TS_DIRECTIVE_REGEX.lastIndex=0;let o=r.replace(ke.TS_DIRECTIVE_REGEX,"");return n+o+i})}parseSvelteComponent(e,t){this.cleanup(),this.ctx.componentFilePath=t.filePath;let n=ke.stripTypeScriptDirectivesFromScripts(e);this.ctx.source=n;let r=Xi(n);if(La(this,this.ctx,r),this.ctx.parsed=r,this.ctx.scriptLanguage==="ts")Yn(this.ctx.parsed.module),Yn(this.ctx.parsed.instance),Yn(this.ctx.parsed.fragment);this.ctx.syntaxMode=Ia(this.ctx);let i=this.ctx.parsed.css,o=i?.start!==void 0&&i?.end!==void 0?n.slice(0,i.start)+" ".repeat(i.end-i.start)+n.slice(i.end):n;Fr(this.ctx,this.ctx.parsed?.module),Fr(this.ctx,this.ctx.parsed?.instance),Sa(this.ctx,this,o);let s={type:"ComponentRoot",instance:this.ctx.parsed.instance,fragment:this.ctx.parsed.fragment};if(this.ctx.parsed?.module){let x=Os(this.ctx.parsed.module),C=(_,A,I)=>{let O=Ue(this.ctx,this,_);this.addModuleExport(A==="*"?`* from ${I.from}`:A,{name:A,kind:"re-export",description:O?.description,deprecated:O?.deprecated,tags:O?.tags,...O?.internal?{internal:!0}:{},isFunction:!1,isFunctionDeclaration:!1,isRequired:!1,constant:!1,reactive:!1,reExport:I,source:oe(this.ctx,_)})},T=(_)=>{pe(this.ctx,"module-export-conflict","default",`export "default" was skipped because it collides with the component's own default export.`,oe(this.ctx,_))},L=(_,A,I)=>{let O=[];if(A.type==="FunctionDeclaration"){let K=A;if(!K.id?.name)return;let W=this.ctx.scriptLanguage==="ts"?Or(this.ctx,K):void 0;O.push({prop_name:I?.exportedName??K.id.name,kind:"function",isFunctionDeclaration:!0,value:void 0,typeSeed:W?.hasAnnotations?void 0:"() => any",explicitType:W?.hasAnnotations?W.signature:void 0,initializerIsFunction:!0,defaultValue:void 0,inferredTypeForSource:void 0,resolvedJSDoc:void 0})}else if(A.type==="VariableDeclaration"){let K=A,W=Lc(K.kind),J=I?.declarator?[I.declarator]:K.declarations;for(let ae of J){if(!ae||typeof ae!=="object"||!("id"in ae))continue;let{id:Y,init:ce}=ae;if(!Y||typeof Y!=="object")continue;if(Y.type!=="Identifier"){for(let at of ge(Y)){if(I&&I.localName!==at)continue;O.push({prop_name:I?.exportedName??at,kind:W,isFunctionDeclaration:!1,value:void 0,typeSeed:void 0,explicitType:void 0,initializerIsFunction:!1,defaultValue:void 0,inferredTypeForSource:void 0,resolvedJSDoc:void 0})}continue}let we=Y.name,Z=I?.exportedName??we,Se=ce==null?{isFunction:!1}:pt(this,this.ctx,ce),{value:Ne,type:ve,isFunction:Pe,defaultValue:Ve}=Se,bt=Se;dn(this.ctx,Se,Z,"moduleExports"),O.push({prop_name:Z,kind:W,isFunctionDeclaration:!1,value:Ne,typeSeed:ve,explicitType:this.getExplicitPropType(we),initializerIsFunction:Pe,defaultValue:Ve,inferredTypeForSource:ve,resolvedJSDoc:bt})}if(O.length===0)return}else{if(A.type==="ClassDeclaration")this.addModuleClassExport(_,A,I);return}let H=this.exportJSDoc(_,I);for(let{prop_name:K,kind:W,isFunctionDeclaration:J,value:ae,typeSeed:Y,explicitType:ce,initializerIsFunction:we,defaultValue:Z,inferredTypeForSource:Se,resolvedJSDoc:Ne}of O){let{type:ve,typeSource:Pe,description:Ve,params:bt,returnType:at,isFunction:qt,typeParameters:sn}=Cn({explicitType:ce,typeSeed:Y,inferredTypeForSource:Se,jsdocType:H?.type,jsdocDescription:H?.description,jsdocParams:H?.params,jsdocReturnType:H?.returnType,jsdocTypeParameters:H?.typeParameters,resolvedType:Ne?.resolvedType,resolvedDescription:Ne?.resolvedDescription,resolvedParams:Ne?.resolvedParams,resolvedReturnType:Ne?.resolvedReturnType,initializerIsFunction:we,isFunctionDeclaration:J,typedefs:this.ctx.typedefs});this.addModuleExport(K,{name:K,kind:W,description:Ve,deprecated:H?.deprecated,tags:H?.tags,...H?.internal?{internal:!0}:{},type:ve,typeSource:Pe,value:ae,defaultValue:Z,params:bt,returnType:at,typeParameters:sn,isFunction:qt,isFunctionDeclaration:J,isRequired:!1,constant:W==="const",reactive:!1,source:oe(this.ctx,_)})}};oi(this.ctx.parsed?.module,(_,A)=>{if(_.type==="ImportDeclaration")qn(this.ctx,_);if(_.type==="FunctionDeclaration"){let I=_;if(I.id?.name)this.ctx.funcDecls.set(I.id.name,I)}if(_.type==="VariableDeclaration")this.ctx.vars.add(_);if(_.type==="ExportNamedDeclaration"){if(_.declaration!=null){L(_,_.declaration);return}let I=_.source?.value;for(let O of _.specifiers){let H=this.resolveExportSpecifier(_,O,A,"module");if(!H)continue;if(H.exportedName==="default"){T(_);continue}let K=typeof I==="string"?{from:I,imported:H.localName}:x.get(H.localName);if(H.declaration)L(_,H.declaration,H);else if(K)C(_,H.exportedName,K);else if(!this.ctx.localTypeDeclarationsByName.get(H.localName)?.exported)this.recordUnresolvedExportSpecifier(_,H.localName,H.exportedName)}}if(_.type==="ExportAllDeclaration"&&typeof _.source.value==="string"){let I=(_.exported&&Yi(_.exported))??"*";if(I==="default"){T(_);return}C(_,I,{from:_.source.value,imported:"*"})}}),this.dropUndeclaredClassBases()}let c,l,d,u=new Set,y=new Set,g=[],b=[],P=[],N=new Set;Gs(this,this.ctx),this.ctx.activeScopes.push(this.ctx.componentScope);let D=Ws(this.ctx),j=(x,C,T)=>{let L=[];if(C.type==="FunctionDeclaration"){let A=C;if(!A.id?.name)return;let I=T?.exportedName??A.id.name,O=this.ctx.scriptLanguage==="ts"?Or(this.ctx,A):void 0;L.push({prop_name:I,kind:"function",isFunctionDeclaration:!0,value:void 0,typeSeed:O?.hasAnnotations?void 0:"() => any",explicitType:O?.hasAnnotations?O.signature:void 0,initializerIsFunction:!0,isRequired:!1,localName:A.id.name,defaultValue:void 0,inferredTypeForSource:void 0,resolvedJSDoc:void 0})}else if(C.type==="VariableDeclaration"){let A=C,I=Lc(A.kind),O=T?.declarator?[T.declarator]:A.declarations;for(let H of O){if(!H||typeof H!=="object"||!("id"in H))continue;let{id:K,init:W}=H;if(!K||typeof K!=="object")continue;if(K.type!=="Identifier"){for(let Pe of ge(K)){if(T&&T.localName!==Pe)continue;L.push({prop_name:T?.exportedName??Pe,kind:I,isFunctionDeclaration:!1,value:void 0,typeSeed:void 0,explicitType:void 0,initializerIsFunction:!1,isRequired:!1,localName:Pe,defaultValue:void 0,inferredTypeForSource:void 0,resolvedJSDoc:void 0})}continue}let J=K.name,ae=T?.exportedName??J,Y=I==="let"&&W==null,ce=W==null?{isFunction:!1}:pt(this,this.ctx,W),{value:we,type:Z,isFunction:Se,defaultValue:Ne}=ce,ve=ce;dn(this.ctx,ce,ae,"props"),L.push({prop_name:ae,kind:I,isFunctionDeclaration:!1,value:we,typeSeed:Z,explicitType:this.getExplicitPropType(J),initializerIsFunction:Se,isRequired:Y,localName:J,defaultValue:Ne,inferredTypeForSource:Z,resolvedJSDoc:ve})}if(L.length===0)return}else{if(C.type==="ClassDeclaration"&&C.id)this.recordClassExport(x,T?.exportedName??C.id.name);return}let _=this.exportJSDoc(x,T);for(let{prop_name:A,kind:I,isFunctionDeclaration:O,value:H,typeSeed:K,explicitType:W,initializerIsFunction:J,isRequired:ae,localName:Y,defaultValue:ce,inferredTypeForSource:we,resolvedJSDoc:Z}of L){let{type:Se,typeSource:Ne,description:ve,params:Pe,returnType:Ve,isFunction:bt,typeParameters:at}=Cn({explicitType:W,typeSeed:K,inferredTypeForSource:we,jsdocType:_?.type,jsdocDescription:_?.description,jsdocParams:_?.params,jsdocReturnType:_?.returnType,jsdocTypeParameters:_?.typeParameters,resolvedType:Z?.resolvedType,resolvedDescription:Z?.resolvedDescription,resolvedParams:Z?.resolvedParams,resolvedReturnType:Z?.resolvedReturnType,initializerIsFunction:J,isFunctionDeclaration:O,typedefs:this.ctx.typedefs});dt(this.ctx,"prop-unknown-type",A,_?.sveldIgnore),un(this,this.ctx,A,{name:A,...Y!==void 0&&Y!==A?{localName:Y}:{},kind:I,description:ve,binding:_?.binding,deprecated:_?.deprecated,tags:_?.tags,..._?.internal?{internal:!0}:{},type:Se,typeSource:Ne,value:H,defaultValue:ce,params:Pe,returnType:Ve,typeParameters:at,isFunction:bt,isFunctionDeclaration:O,isRequired:ae,constant:I==="const",reactive:this.ctx.reactive_vars.has(A),source:oe(this.ctx,x)})}};oi(s,(x,C,T)=>{let L=Ks(this,this.ctx,D,x);if(L)this.ctx.activeScopes.push(L);let _=x.type;if(!fh.has(_))return;if(x.type==="AssignmentExpression")qr(this.ctx,x.left);if(x.type==="UpdateExpression")qr(this.ctx,x.argument);if(x.type==="CallExpression"){let A=x,I=A.callee&&typeof A.callee==="object"&&"name"in A.callee?A.callee.name:void 0;if(I==="createEventDispatcher"){if(C&&typeof C==="object"&&"id"in C&&C.id&&typeof C.id==="object"&&"name"in C.id)c=C.id.name,l=C;d=A.typeArguments?.params?.[0]}if(I==="$host"){if(C&&typeof C==="object"&&"id"in C&&C.id&&typeof C.id==="object"&&"name"in C.id)u.add(C.id.name)}if(I==="setContext")ra(this.ctx,this,x,C??void 0);if(A.arguments.length>0){if(P.push(A),Kn(this.ctx,A.callee))N.add(A)}if(I)b.push({name:I,arguments:A.arguments,node:A,nestedBoundDetailNames:gn(this.ctx,A.arguments[1])});if(Wt(A.callee)&&ye(A.callee.property)&&A.callee.property.name==="dispatchEvent"&&(ct(A.callee.object,"$host")||ye(A.callee.object)&&u.has(A.callee.object.name))){let O=pa(this.ctx,A);if(O)y.add(O.name),g.push(O)}}if(_==="SpreadAttribute"){let A=x;if(A.expression?.name==="$$restProps"||this.ctx.restPropLocals.has(A.expression?.name??""))wa(this.ctx,C)}if(x.type==="FunctionDeclaration"){let A=x;if(A.id?.name)this.ctx.funcDecls.set(A.id.name,A)}if(x.type==="ImportDeclaration")qn(this.ctx,x);if(x.type==="VariableDeclaration"){if(this.ctx.vars.add(x),C&&typeof C==="object"&&"type"in C&&C.type==="Program"&&x.declarations.some((A)=>ct(Et(A.init),"$props")))Ra(this,this.ctx,x)}if(x.type==="ExportNamedDeclaration"){if(x.declaration!=null){j(x,x.declaration);return}for(let A of x.specifiers){let I=this.resolveExportSpecifier(x,A,C,"instance");if(!I)continue;if(I.declaration)j(x,I.declaration,I);else this.recordUnresolvedExportSpecifier(x,I.localName,I.exportedName)}}if(_==="Comment"){let I=x?.data?.trim()??"";if(Rc.test(I))this.ctx.componentComment=I.replace(Rc,"").replace(uh,""),this.ctx.componentCommentSource=oe(this.ctx,x)}if(_==="SlotElement"){let A=x,I=A.attributes?.find((W)=>W.name==="name")?.value,O=(Array.isArray(I)?I[0]:void 0)?.data,H=(A.attributes||[]).filter((W)=>W.name!=="name").reduce((W,J)=>{let ae={value:void 0,replace:!1},Y=J.value;if(Y===void 0||Y===!0)return W;let ce=Array.isArray(Y)?Y[0]:Y;if(ce){let{type:we,expression:Z,raw:Se,start:Ne,end:ve}=ce;if(we==="Text"&&Se!==void 0)ae.value=JSON.stringify(Se);else if(!Array.isArray(Y)&&we==="ExpressionTag"&&Z&&typeof Z==="object"&&"type"in Z&&Z.type==="Identifier"&&"name"in Z&&Z.name===J.name)ae.value=Z.name,ae.replace=!0;if(Z&&typeof Z==="object"&&"type"in Z){if(Z.type==="Literal"&&"value"in Z){let Pe=Z.value;ae.value=typeof Pe==="string"?JSON.stringify(Pe):String(Pe)}else if(Z.type==="MemberExpression")ae.value=Fn(this.ctx,this,Z);else if(Z.type!=="Identifier"){if(Ne!==void 0&&ve!==void 0){if(Z.type==="ObjectExpression"||Z.type==="TemplateLiteral")ae.value=le(this.ctx,Ne+1,ve-1)}}}}if(J.name)W[J.name]=ae;return W},{}),K=A.fragment?.nodes?.map(({start:W,end:J})=>{if(W===void 0||J===void 0)return"";return le(this.ctx,W,J)??""}).join("").trim();bn(this.ctx,{slot_name:O,slot_props:H,slot_fallback:K,source:oe(this.ctx,x)})}if(_==="RenderTag"){let A=x,I=ha(this.ctx,A.expression);if(I){let O,H=!1;if(I.arguments.length===0)O={};else if(I.arguments.length===1&&typeof I.arguments[0]==="object"&&I.arguments[0]&&"type"in I.arguments[0]&&I.arguments[0].type==="ObjectExpression"){let J=Jr(this.ctx,this,I.arguments[0]);O=J.slot_props,H=J.hasUnresolvedSpread}else if(I.arguments.length===1)pe(this.ctx,"syntax-skipped",I.publicName,`{@render ${I.publicName}(...)} argument is not a plain object literal; the render call was not mapped to slot metadata.`,oe(this.ctx,x));let K=I.publicName==="children"?void 0:I.publicName,W=K===void 0?ph:K;if(O!==void 0)bn(this.ctx,{slot_name:K,slot_props:O,slot_props_unresolved_spread:H||void 0,source:oe(this.ctx,x)});if(O!==void 0||this.ctx.slots.has(W))this.ctx.snippetPropLocals.add(I.trackingName)}}if(_==="OnDirective"){let A=x;if(A.expression==null&&A.name){if(C!=null&&typeof C==="object"&&"name"in C){let I=typeof C.name==="string"?C.name:void 0,O="type"in C?String(C.type):void 0;if(I&&O){let H=Tn(O)?{type:"InlineComponent",name:I}:{type:"Element",name:I};this.ctx.forwardedEvents.set(A.name,H);let K=this.ctx.events.get(A.name),W=this.ctx.eventDescriptions.get(A.name),J=K?.deprecated,ae=K?.internal;if(!K)this.ctx.events.set(A.name,{type:"forwarded",name:A.name,element:H,description:W,deprecated:J,...ae?{internal:!0}:{},source:oe(this.ctx,x)});else if(K.type==="forwarded"&&W&&!K.description)this.ctx.events.set(A.name,{...K,description:W,deprecated:K.deprecated??J,...K.internal||ae?{internal:!0}:{},source:K.source||oe(this.ctx,x)})}}}}if(_==="BindDirective"&&C&&typeof C==="object"&&"type"in C&&(En(String(C.type))||Tn(String(C.type)))){let A=x;if(A.expression?.name){let I=hn(this.ctx,A.expression.name);if(I)this.ctx.reactive_vars.add(I)}if(En(String(C.type))&&A.name==="this"&&A.expression?.name&&"name"in C&&typeof C.name==="string"){let I=hn(this.ctx,A.expression.name);if(!I)return;let O=C.name;if(this.ctx.bindings.has(I)){let H=this.ctx.bindings.get(I);if(H&&!H.elements.includes(O))this.ctx.bindings.set(I,{...H,elements:[...H.elements,O]})}else this.ctx.bindings.set(I,{elements:[O]})}}},(x)=>{if(yn(x))this.ctx.activeScopes.pop(),zs(D,x)},{skipTypeOnlySubtrees:!0});for(let x of g)la(this,this.ctx,x);if(c!==void 0){Oa(this,this.ctx,d,c,oe(this.ctx,l));for(let x of b)if(x.name===c){let C=x.arguments[0],T=C&&typeof C==="object"&&"value"in C?C.value:void 0,L=x.arguments[1],_=Kr(Wr(this,this.ctx,x.nestedBoundDetailNames),L),A=_===void 0&&L&&typeof L==="object"&&"value"in L?L.value:void 0,I=A===null&&L.raw==="null";if(T!=null)vt(this.ctx,{name:String(T),detail:_??(I?"null":A==null?"":zr(A)),has_argument:Boolean(L),source:oe(this.ctx,x.node)})}}let U=new Set(y);if(c!==void 0){for(let x of b)if(x.name===c){let C=x.arguments[0],T=C&&typeof C==="object"&&"value"in C?C.value:void 0;if(T!=null)U.add(String(T))}}this.ctx.forwardedEvents.forEach((x,C)=>{let T=this.ctx.events.get(C);if(T&&T.type==="dispatched"&&!U.has(C)){let L=this.ctx.eventDescriptions.get(C),_={type:"forwarded",name:C,element:x,description:L,deprecated:T.deprecated,tags:T.tags,source:T.source};if(T.internal)_.internal=!0;if(T.detail!==void 0&&T.detail!=="undefined")_.detail=T.detail;this.ctx.events.set(C,_)}}),Ba(this.ctx,U);let v=this.ctx.syntaxMode==="runes"?new Set(Array.from(this.ctx.snippetPropLocals,(x)=>this.resolvePublicPropName(x))):new Set,w=ke.mapToArray(this.ctx.props).filter((x)=>!v.has(x.name)).map((x)=>{if(this.ctx.bindings.has(x.name)){let C=this.ctx.bindings.get(x.name)?.elements.sort().map((T)=>As(T)).join(" | ");return{...x,type:`null | ${C}`,typeSource:"inferred",reactive:x.reactive||this.ctx.reactive_vars.has(x.name)}}return{...x,reactive:x.reactive||this.ctx.reactive_vars.has(x.name)}});this.ctx.activeScopes.length=0;let M=ke.mapToArray(this.ctx.slots).map((x)=>{let{slot_props_unresolved_spread:C,...T}=x;if(!x.slot_props)return T;if(typeof x.slot_props==="string")return dh.test(x.slot_props)?{...T,slot_props:"Record<string, never>"}:T;let L=x.slot_props,_=[];for(let O of Object.keys(L)){if(L[O].replace&&L[O].value!==void 0)L[O].value=this.getPropTypeByLocalOrPublic(L[O].value);if(L[O].value===void 0)L[O].value="any";_.push(`${O}: ${L[O].value}`)}let A=C?" & Record<string, any>":"",I=_.length===0?C?"Record<string, any>":"Record<string, never>":_.length===1?`{ ${_[0]} }${A}`:`{
44
- ${_.join(`;
38
+ `)}function bi(e,t,n,r){let i=yf(n,r);if(i>=n.length)return;xi(e,void 0,n,{index:i},t)}function yf(e,t){let n=0,r=e.length;while(n<r){let i=n+r>>>1;if(e[i].start<t)n=i+1;else r=i}return n}function xi(e,t,n,r,i){while(r.index<n.length&&n[r.index].start<(e.start??0))e.leadingComments??=[],e.leadingComments.push(n[r.index]),r.index++;if(r.index>=n.length)return;let a=n[r.index].start,s=e.end,c=s===void 0||s>a?Object.keys(e):[];for(let d=0;d<c.length;d++){let u=c[d];if(u==="type"||u==="leadingComments")continue;let y=e[u];if(!y||typeof y!=="object")continue;if(Array.isArray(y)){for(let x of y)if(x&&typeof x==="object"&&typeof x.type==="string"){if(xi(x,e,n,r,i),r.index>=n.length)return}}else if(typeof y.type==="string"){if(xi(y,e,n,r,i),r.index>=n.length)return}}if(r.index<n.length){let d=n[r.index];if(t===void 0||e.end!==t.end){let u=i.slice(e.end??0,d.start);if((t?.type==="BlockStatement"||t?.type==="Program")&&gi(t.body,e)||t?.type==="ArrayExpression"&&gi(t.elements,e)||t?.type==="ObjectExpression"&&gi(t.properties,e))while(r.index<n.length){if(t&&n[r.index].start>=(t.end??Number.POSITIVE_INFINITY))break;r.index++}else if((e.end??0)<=d.start&&hf.test(u))r.index++}}}function gi(e,t){return!!e&&e.indexOf(t)===e.length-1}var on=new Set(["abstract","accessor","arguments","as","asserts","async","await","break","case","catch","class","const","continue","debugger","declare","default","delete","do","else","enum","eval","export","extends","false","finally","for","function","get","global","if","implements","import","in","infer","instanceof","interface","intrinsic","is","keyof","let","module","namespace","new","null","of","out","override","package","private","protected","public","readonly","return","satisfies","set","static","super","switch","this","throw","true","try","type","typeof","unique","var","void","while","with","yield"]),gf=new Set(["any","bigint","boolean","false","never","null","number","object","string","symbol","true","undefined","unknown","void"]),xf=new Set(["get","set","new","readonly","static","public","private","protected"]);function Go(e){return e>=97&&e<=122||e>=65&&e<=90||e===95||e===36}function Uo(e){return Go(e)||e>=48&&e<=57}function Ti(e){return e>=48&&e<=57}class Wo{pos=0;text;constructor(e){this.text=e}recognize(){if(this.skipSpaces(),!this.type())return!1;return this.skipSpaces(),this.pos===this.text.length}skipSpaces(){while(this.pos<this.text.length){let e=this.text.charCodeAt(this.pos);if(e!==32&&e!==9)break;this.pos++}}peek(){return this.skipSpaces(),this.text.charCodeAt(this.pos)}eat(e){if(this.peek()!==e.charCodeAt(0))return!1;return this.pos++,!0}identifier(){this.skipSpaces();let e=this.pos;if(!Go(this.text.charCodeAt(e)))return;let t=e+1;while(t<this.text.length&&Uo(this.text.charCodeAt(t)))t++;return this.pos=t,this.text.slice(e,t)}stringLiteral(){let e=this.peek();if(e!==34&&e!==39)return!1;for(let t=this.pos+1;t<this.text.length;t++){let n=this.text.charCodeAt(t);if(n===e)return this.pos=t+1,!0;if(n===92||n===10||n===13||n===8232||n===8233)return!1}return!1}numberLiteral(){let e=this.pos;if(this.text.charCodeAt(e)===45)e++;let t=e;while(Ti(this.text.charCodeAt(e)))e++;if(e===t||e-t>1&&this.text.charCodeAt(t)===48)return!1;if(this.text.charCodeAt(e)===46){let n=++e;while(Ti(this.text.charCodeAt(e)))e++;if(e===n)return!1}if(Uo(this.text.charCodeAt(e))||this.text.charCodeAt(e)===46)return!1;return this.pos=e,!0}type(){if(this.peek()===40){let e=this.pos;if(this.functionType())return!0;this.pos=e}do if(!this.intersection())return!1;while(this.eat("|"));return!0}intersection(){do if(!this.operatorType())return!1;while(this.eat("&"));return!0}operatorType(){let e=this.pos;if(this.identifier()==="keyof")return this.operatorType();if(this.pos=e,!this.primary())return!1;while(this.eat("[")){if(this.eat("]"))continue;if(!this.type()||!this.eat("]"))return!1}return!0}primary(){let e=this.peek();if(e===40)return this.pos++,this.type()&&this.eat(")");if(e===123)return this.objectType();if(e===91)return this.tupleType();if(e===34||e===39)return this.stringLiteral();if(e===45||Ti(e))return this.numberLiteral();let t=this.identifier();if(t===void 0)return!1;if(t==="typeof")return this.typeofOperand();if(t==="import")return this.importType(!0);if(gf.has(t))return this.peek()!==46&&this.peek()!==60;if(on.has(t))return!1;while(this.eat("."))if(this.identifier()===void 0)return!1;if(this.eat("<")){do if(!this.type())return!1;while(this.eat(","));return this.eat(">")}return!0}typeofOperand(){let e=this.pos;if(this.identifier()==="import")return this.importType(!1);return this.pos=e,this.entityName()}importType(e){if(!this.eat("(")||!this.stringLiteral()||!this.eat(")"))return!1;while(this.eat(".")){let t=this.identifier();if(t===void 0||on.has(t))return!1}if(e&&this.eat("<")){do if(!this.type())return!1;while(this.eat(","));return this.eat(">")}return!0}entityName(){do{let e=this.identifier();if(e===void 0||on.has(e))return!1}while(this.eat("."));return!0}objectType(){this.pos++;while(!this.eat("}")){if(!this.typeMember())return!1;if(!this.eat(";")&&!this.eat(",")&&this.peek()!==125)return!1}return!0}typeMember(){if(this.eat("["))if(this.peek()===34||this.peek()===39){if(!this.stringLiteral()||!this.eat("]"))return!1}else{let e=this.identifier();if(e===void 0||on.has(e))return!1;if(!this.eat(":")||!this.type()||!this.eat("]"))return!1;return this.eat(":")&&this.type()}else if(this.peek()===34||this.peek()===39){if(!this.stringLiteral())return!1}else{let e=this.identifier();if(e===void 0||xf.has(e))return!1}return this.eat("?"),this.eat(":")&&this.type()}tupleType(){if(this.pos++,this.eat("]"))return!0;do if(!this.type())return!1;while(this.eat(","));return this.eat("]")}functionType(){this.pos++;let e=new Set;if(!this.eat(")")){do{this.skipSpaces();let t=this.text.startsWith("...",this.pos);if(t)this.pos+=3;let n=this.identifier();if(n===void 0||on.has(n)||e.has(n))return!1;if(e.add(n),!t)this.eat("?");if(!this.eat(":")||!this.type())return!1;if(t)break}while(this.eat(","));if(!this.eat(")"))return!1}if(this.skipSpaces(),!this.text.startsWith("=>",this.pos))return!1;return this.pos+=2,this.type()}}function zo(e){return new Wo(e).recognize()}var er={sawParenthesized:!1},Yo=(e)=>class extends e{parseParenAndDistinguishExpression(t,n){let r=super.parseParenAndDistinguishExpression(t,n);if(r.type==="ParenthesizedExpression")er.sawParenthesized=!0;return r}parseDecorator(){return er.sawParenthesized=!0,super.parseDecorator()}},Qo=(e)=>class extends e{checkLocalExport(){}},bf=X.extend(Yo,Qo),Zo=X.extend(Ho(),Yo,Qo);function Ci(e){return e?Zo:bf}var Tf={onComment:Zn,sourceType:"module",ecmaVersion:16},ep={onComment:Zn,sourceType:"module",ecmaVersion:16,preserveParens:!0},vf={sourceType:"module",ecmaVersion:16},Sf={onComment:Zn,sourceType:"module",ecmaVersion:16},Ko={...ep,startLocation:null},vi=/\r\n?|\n|\u2028|\u2029/g;function Ef(e,t){if(t?.breakEnds)return t.breakEnds;let n=[];vi.lastIndex=0;while(vi.test(e))n.push(vi.lastIndex);if(t)t.breakEnds=n;return n}function Cf(e,t,n){let r=e.lastIndexOf(`
39
+ `,t-1)+1,i=Ef(e,n),a=0,s=i.length;while(a<s){let p=a+s>>>1;if(i[p]<=r)a=p+1;else s=p}return{line:a+1,column:t-r}}function tp(e,t,n,r,i){if(n.length===i)return;bi(e,t,n,r)}function np(e,t,n){let r=n.length;Qn(e,n);let i=Ci(t).parse(e,Tf);if(n.length>0)bi(i,e,n,r);return i}var Jo=new Map;function rp(e){if(zo(e))return!0;let t=Jo.get(e);if(t!==void 0)return t;let n;try{n=Zo.parse(`type T = ${e}
40
+ ;`,vf).body.length===1}catch{n=!1}return Jo.set(e,n),n}var Pf={count:0};function Dt(e,t,n,r,i){Pf.count+=1;let a=r.length;Qn(e,r),er.sawParenthesized=!1;let s=ep;if(n)Ko.startLocation=Cf(e,t,i),s=Ko;let p=Ci(n).parseExpressionAt(e,t,s);tp(p,e,r,t,a);let c=r.length>a?r.at(-1):void 0,d=c&&c.end>(p.end??0)?c.end:p.end??0;return{node:er.sawParenthesized?Af(p):p,end:d}}function ip(e,t,n,r){let i=r.length,a=Ci(n);Qn(e,r);let s=new a(Sf,e,t);s.nextToken();let p=s.parseStatement(null,!0,Object.create(null));return tp(p,e,r,t,i),p}function Xo(e){return e!==null&&typeof e==="object"&&typeof e.type==="string"}function Si(e){let t=e;while(t.type==="ParenthesizedExpression"&&t.expression)t=t.expression;return t}function Af(e){let t=Si(e);return Ei(t),t}function Ei(e){for(let t in e){let n=e[t];if(!n||typeof n!=="object")continue;if(Array.isArray(n))for(let r=0;r<n.length;r++){let i=n[r];if(!Xo(i))continue;let a=Si(i);if(a!==i)n[r]=a;Ei(a)}else if(Xo(n)){let r=Si(n);if(r!==n)e[t]=r;Ei(r)}}}function sp(e,t){let n=je(e.name,t.name);if(n!==0)return n;let r=je(e.type,t.type);if(r!==0)return r;if(e.type==="forwarded"&&t.type==="forwarded"){let i=je(e.element,t.element);if(i!==0)return i}return je(e.detail??"",t.detail??"")}var kf=/^\{\s*\}$/;function It(e){return Array.from(e,([t,n])=>n)}function wf(e,t){let{dispatcherName:n,callees:r}=t;for(let a of t.hostDispatches)ga(e,a);if(n!==void 0){Ia(e,t.dispatcherTypeArgument,n,H(e,t.dispatcherDeclaratorNode));for(let a of r)if(a.name===n){let s=a.arguments[0],p=s&&typeof s==="object"&&"value"in s?s.value:void 0,c=a.arguments[1],d=Hr(jr(e,a.nestedBoundDetailNames),c),u=d===void 0&&c&&typeof c==="object"&&"value"in c?c.value:void 0,y=u===null&&c.raw==="null";if(p!=null)tt(e,{name:String(p),detail:d??(y?"null":u==null?"":qr(u)),has_argument:Boolean(c),source:H(e,a.node)})}}let i=new Set(t.hostDispatchedEventNames);if(n!==void 0){for(let a of r)if(a.name===n){let s=a.arguments[0],p=s&&typeof s==="object"&&"value"in s?s.value:void 0;if(p!=null)i.add(String(p))}}return e.forwardedEvents.forEach((a,s)=>{let p=e.events.get(s);if(p&&p.type==="dispatched"&&!i.has(s)){let c=e.eventDescriptions.get(s),d={type:"forwarded",name:s,element:a,description:c,deprecated:p.deprecated,tags:p.tags,source:p.source};if(p.internal)d.internal=!0;if(p.detail!==void 0&&p.detail!=="undefined")d.detail=p.detail;e.events.set(s,d)}}),i}function Nf(e){let t=e.syntaxMode==="runes"?new Set(Array.from(e.snippetPropLocals,(n)=>xr(e,n))):new Set;return It(e.props).filter((n)=>!(t.has(n.name)&&e.slots.has(n.name==="children"?Jt:n.name))).map((n)=>{if(e.bindings.has(n.name)){let r=e.bindings.get(n.name)?.elements.sort().map((i)=>Fa(i)).join(" | ");return{...n,type:`null | ${r}`,typeSource:"inferred",reactive:n.reactive||e.reactive_vars.has(n.name)}}return{...n,reactive:n.reactive||e.reactive_vars.has(n.name)}})}function Df(e){return It(e.slots).map((t)=>{let{slot_props_unresolved_spread:n,...r}=t;if(!t.slot_props)return r;if(typeof t.slot_props==="string")return kf.test(t.slot_props)?{...r,slot_props:"Record<string, never>"}:r;let i=t.slot_props,a=[];for(let c of Object.keys(i)){if(i[c].replace&&i[c].value!==void 0)i[c].value=Ot(e,i[c].value);if(i[c].value===void 0)i[c].value="any";a.push(`${c}: ${i[c].value}`)}let s=n?" & Record<string, any>":"",p=a.length===0?n?"Record<string, any>":"Record<string, never>":a.length===1?`{ ${a[0]} }${s}`:`{
41
+ ${a.join(`;
45
42
  `)};
46
- }${A}`;return{...T,slot_props:I}}).sort((x,C)=>{let T=x.name??"",L=C.name??"";if(T<L)return-1;if(T>L)return 1;return 0});if(this.ctx.deferredSlotBlockGenerics.length>0){let x=[...w.map((C)=>C.type??""),...M.map((C)=>C.slot_props??"")].join(`
47
- `);for(let{name:C,constraint:T}of this.ctx.deferredSlotBlockGenerics){let L=C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(!new RegExp(`\\b${L}\\b`).test(x))continue;this.accumulateGeneric(C,T)}}if(this.ctx.scriptGenericsAttribute){if(this.ctx.generics)pe(this.ctx,"syntax-skipped","generics",'Both the "generics" script attribute and @generics/@template JSDoc tags declare component generics; the script attribute takes precedence and the JSDoc declaration was ignored.',this.ctx.scriptGenericsAttribute.source);this.ctx.generics=da(this.ctx.scriptGenericsAttribute.value)}let G=ke.mapToArray(this.ctx.moduleExports),X=ke.mapToArray(this.ctx.events).map((x)=>{switch(x.type){case"forwarded":return{...x,element:x.element.name};case"dispatched":return x;default:return x}}).sort(ca),be=ke.mapToArray(this.ctx.typedefs),a=ke.mapToArray(this.ctx.contexts),p={props:new Map(this.ctx.pendingCallDefaultCandidates.filter((x)=>x.location==="props").map((x)=>[x.propName,x])),moduleExports:new Map(this.ctx.pendingCallDefaultCandidates.filter((x)=>x.location==="moduleExports").map((x)=>[x.propName,x]))};for(let x of w)if(x.typeSource==="unknown"){let C=p.props.get(x.name);if(C)x.type="any";let T=C?C.importSource?`Prop "${x.name}" default calls "${C.calleeName}()" imported from "${C.importSource}"; falling back to "any" pending cross-file resolution.`:`Prop "${x.name}" default calls "${C.calleeName}()", but its return type could not be inferred; falling back to "any".`:`Prop "${x.name}" type could not be inferred; falling back to "${x.type??"any"}".`;pe(this.ctx,"prop-unknown-type",x.name,T,x.source)}for(let x of G)if(x.typeSource==="unknown"&&p.moduleExports.has(x.name))x.type="any";let f=c,m=[];if(f!==void 0){let x=[];for(let T of P){let L=oa(T,f);if(L)x.push({call:T,...L})}if(x.length>0)dt(this.ctx,"dispatch-escapes",f,this.resolveLocalVarJSDoc(f)?.sveldIgnore);let C=Lr(this.ctx,"dispatch-escapes",f);for(let{call:T,argumentIndex:L,property:_}of x){let A=N.has(T)?void 0:Br(this.ctx,T.callee);if(!A){m.push(T);continue}let I=oe(this.ctx,T);this.ctx.pendingDispatchEscapeCandidates.push({importSource:A.source,importedName:A.importedName,...A.members?{members:A.members}:{},calleeText:qe(this.ctx,T.callee)??A.importedName,dispatcherName:f,argumentIndex:L,..._===void 0?{}:{property:_},...I?{source:I}:{},...C?{ignored:C}:{}})}}for(let x of this.ctx.jsDocEventNames){if(U.has(x))continue;if(this.ctx.forwardedEvents.has(x))continue;if(this.ctx.props.has(`on${x}`))continue;if(m.length>0)continue;let C=Ir(this.ctx,"event-no-source",x,`@event "${x}" has no matching dispatch or callback prop.`,this.ctx.jsDocEventSources.get(x));if(this.ctx.pendingDispatchEscapeCandidates.length>0)this.ctx.deferredEventNoSourceDiagnostics.push(C);else this.ctx.diagnosticRecords.push(C)}for(let x of m){let C=qe(this.ctx,x.callee)??"";pe(this.ctx,"dispatch-escapes",f??"",`\`${f}\` is passed to \`${C}\`, which sveld can't follow: it only reads a function imported from another module, by name, as its default export, or through a namespace import. Document the events dispatched there with @event tags.`,oe(this.ctx,x))}if(this.ctx.rest_props?.type==="InlineComponent")pe(this.ctx,"rest-props-unresolved","$$restProps",`$$restProps is only spread onto component "${this.ctx.rest_props.name}"; sveld cannot infer its rest-prop type. Spread onto a plain element or add an @restProps tag.`);let E=be.filter((x)=>x.internal).map((x)=>x.name.split("<")[0]);if(E.length>0){let x=E.map((T)=>({name:T,regex:new RegExp(`\\b${T}\\b`)})),C=(T,L,_)=>{if(!L)return;for(let{name:A,regex:I}of x){if(!I.test(L))continue;pe(this.ctx,"internal-typedef-referenced",T,`"${T}" references "${A}", which is @internal and excluded from output; the generated .d.ts will contain a dangling reference to it.`,_)}};for(let T of w){if(T.internal)continue;C(T.name,T.type,T.source)}for(let T of G){if(T.internal)continue;C(T.name,T.type,T.source)}for(let T of be){if(T.internal)continue;C(T.name,T.ts)}for(let T of X){if(T.internal||T.type!=="dispatched")continue;C(T.name,T.detail,T.source)}for(let T of M){if(T.internal)continue;C(T.name??"default",T.slot_props,T.source)}for(let T of a){if(T.internal)continue;if(T.type!==void 0)C(T.typeName,T.type,T.source);for(let L of T.properties)C(L.name,L.type)}}let S={source:Hn(this.ctx,0,this.ctx.source?.length),syntaxMode:this.ctx.syntaxMode,...this.ctx.scriptLanguage?{scriptLanguage:this.ctx.scriptLanguage}:{},props:w,moduleExports:G,slots:M,events:X,typedefs:be,generics:this.ctx.generics,rest_props:this.ctx.rest_props,extends:this.ctx.extends,componentComment:this.ctx.componentComment,componentCommentSource:this.ctx.componentCommentSource,contexts:a,customElementTag:this.ctx.customElementTag,customElement:this.ctx.customElement,...this.ctx.cssParts.length>0?{cssParts:this.ctx.cssParts.slice()}:{},...this.ctx.cssProperties.length>0?{cssProperties:this.ctx.cssProperties.slice()}:{},diagnostics:this.ctx.diagnosticRecords.slice()},k=Ms(this.ctx);if(k)S[It]=k;return S}}var hh=/\.$/,Qi="resolving it needs file access (generateBundle or the CLI)";function mh(e,t={}){let n=e[It];if(!n)return e;let{pendingCallDefaultCandidates:r,pendingConstDefaultCandidates:i,pendingContextKeyCandidates:o,pendingDispatchEscapeCandidates:s,deferredEventNoSourceDiagnostics:c,untypedJsDocEventNames:l,...d}=n,u=(r??[]).filter((w)=>w.importSource!==void 0);if(u.length===0&&!i&&!o&&!s&&!c)return e;let y=e.filePath,g=t.filePath??(typeof y==="string"?y:""),b=[],P=(w,M,G,X)=>{b.push(Vn({component:g,kind:"cross-file-unresolved",name:w,message:M,...G?{source:G}:{},...X?{ignored:X}:{}}))},N=(w,M)=>(w==="props"?e.props:e.moduleExports).find((G)=>G.name===M)?.source,D=(w)=>w==="props"?"Prop":"Module export";for(let w of o??[]){let M=ln(w);P(M,`setContext key \`${M}\` is imported from "${w.importSource}"; ${Qi}, so the context is omitted.`,w.source)}for(let w of i??[])P(w.propName,`${D(w.location)} "${w.propName}" defaults to \`${ln(w)}\` imported from "${w.importSource}"; ${Qi}, so the default shows the identifier and its type isn't read.`,N(w.location,w.propName));for(let w of u)P(w.propName,`${D(w.location)} "${w.propName}" defaults to \`${w.calleeName}()\` imported from "${w.importSource}"; ${Qi}, so its return type isn't read and the prop falls back to "any".`,N(w.location,w.propName));for(let w of s??[])P(w.calleeText,`\`${w.dispatcherName}\` is passed to \`${w.calleeText}\`, imported from "${w.importSource}"; reading the events it dispatches needs file access (generateBundle or the CLI), so they're omitted.`,w.source,w.ignored);let j=Array.from(new Set((s??[]).map((w)=>`\`${w.calleeText}\``))).join(", "),U=(c??[]).map((w)=>j?{...w,message:`${w.message.replace(hh,"")} in this file; ${j} may dispatch it, but imported helpers aren't read without file access.`}:w),v={...e,diagnostics:[...e.diagnostics??[],...U,...b]};return v[It]=d,v}var Oc="sveld",Bc="0.37.8";var Zi="5.57.0";var $c=1,Fc=new WeakMap;function Dt(e){return e.some((t)=>t.internal)?e.filter((t)=>!t.internal):e}function gh(e){return{...e,props:Dt(e.props),moduleExports:Dt(e.moduleExports),slots:Dt(e.slots),events:Dt(e.events),typedefs:Dt(e.typedefs),...e.contexts?{contexts:Dt(e.contexts).map((t)=>({...t,properties:Dt(t.properties)}))}:{}}}function Rn(e,t={}){let n=Fc.get(e),r=n?.get(t.entryExports);if(r)return r;let i=Array.from(e,([,c])=>{let{diagnostics:l,...d}=c;return gh(d)}).sort((c,l)=>ht(c.moduleName,l.moduleName)),o={schemaVersion:$c,generator:{name:Oc,version:Bc,svelteVersion:Zi},total:i.length,components:i},s=t.entryExports?Dt(t.entryExports):void 0;if(s&&s.length>0)o.totalExports=s.length,o.exports=s;if(!n)n=new Map,Fc.set(e,n);return n.set(t.entryExports,o),o}var xh=/\binterface\s+[A-Za-z_$][\w$]*(\s*<[^{};]*>)?\s*$/;var Hc=/\s/,bh=/\s{2}|[^\S ]/,Th=/["'`{}/]/g,Eh=/["'`{};/]/g;function Ch(e){return xh.test(e.slice(-200))}var Vc=[""];function Sh(e){let t=Vc[e];if(t===void 0)t=" ".repeat(e),Vc[e]=t;return t}function vh(e,t){let n="";for(let r=e.length-1;r>=0&&n.length<t;r--)n=e[r]+n;return n.length>t?n.slice(-t):n}function Ph(e){if(e.length===0)return!1;let t=e[e.length-1];return t.charCodeAt(t.length-1)===10}function Ah(e){while(e.length>0){let t=e[e.length-1],n=t.length;while(n>0){let r=t.charCodeAt(n-1);if(r!==32&&r!==9)break;n--}if(n===t.length)return;if(n===0){e.pop();continue}e[e.length-1]=t.slice(0,n);return}}function kh(e){while(e.length>0){let t=e[e.length-1];if(!Hc.test(t[t.length-1]))return;let n=t.trimEnd();if(n.length===t.length)return;if(n.length===0){e.pop();continue}e[e.length-1]=n;return}}function wh(e){if(e.includes("{"))return!1;let t=0,n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(t!==0){if(i===t&&e.charCodeAt(r-1)!==92)t=0;continue}if(i===34||i===39||i===96){t=i;continue}if(i===59&&++n>=2)return!0}return!1}function Nh(e){if(!bh.test(e))return e.trimEnd();let t="",n=null,r=!1;for(let i=0;i<e.length;i++){let o=e[i],s=e[i-1];if(n){if(t+=o,n==="double"&&o==='"'&&s!=="\\"||n==="single"&&o==="'"&&s!=="\\"||n==="template"&&o==="`"&&s!=="\\")n=null;r=!1;continue}if(o==='"'||o==="'"||o==="`"){n=o==='"'?"double":o==="'"?"single":"template",t+=o,r=!1;continue}if(Hc.test(o)){if(!r&&t.length>0)t+=" ",r=!0;continue}t+=o,r=!1}return t.trimEnd()}function qc(e,t){let n=e[t],r=e.indexOf(n,t+1);while(r!==-1&&e.charCodeAt(r-1)===92)r=e.indexOf(n,r+1);return r}function Uc(e,t){let n=e.indexOf("*/",t+1);return n===-1?-1:n+1}function Dh(e){let t=new Map,n=[],r=Th,i=0;while(i<e.length){if(r.lastIndex=i,!r.test(e))break;i=r.lastIndex-1;let o=e.charCodeAt(i);if(o===47){if(e.charCodeAt(i+1)===42){let s=Uc(e,i);if(s===-1)break;i=s}}else if(o===34||o===39||o===96){let s=qc(e,i);if(s===-1)break;i=s}else if(o===123)n.push(i);else if(o===125&&n.length>0)t.set(n.pop(),i);i++}return t}function _h(e,t,n){for(let r=t;r<n;r++)if(!es(e.charCodeAt(r)))return!1;return!0}function es(e){if(e<=32)return e===32||e>=9&&e<=13;if(e<160)return!1;return e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288||e===65279}function Gc(e,t,n,r){let i=[],o=Eh,s=t,c=t;while(c<n){if(o.lastIndex=c,!o.test(e))break;if(c=o.lastIndex-1,c>=n)break;let l=e.charCodeAt(c);if(l===47){if(e.charCodeAt(c+1)===42){let d=Uc(e,c);if(d===-1)break;c=d}c++;continue}if(l===34||l===39||l===96){let d=qc(e,c);if(d===-1)break;c=d+1;continue}if(l===123){let d=r.get(c);if(d===void 0||d>=n){c++;continue}if(s<c)i.push(e.slice(s,c));let u=c+1;if(_h(e,u,d)){i.push("{}"),c=d+1,s=c;continue}let y=e.slice(u,d),g=e.charCodeAt(u)===10;if(!g&&!y.includes("/*")&&!wh(y)&&!Ch(vh(i,200))){let b=Gc(e,u,d,r),P=b.trim();if(!P.includes(`
48
- `)){let N=P.endsWith(";")?P.slice(0,-1):P,D=`{ ${Nh(N)} }`;if(D.length<=120){i.push(D),c=d+1,s=c;continue}}if(i.push("{"),b.charCodeAt(0)!==59)i.push(`
49
- `);if(b.length>0)i.push(b);c=d,s=d;continue}if(i.push("{"),!g)i.push(`
50
- `);c=u,s=u;continue}if(l===125){if(s<c)i.push(e.slice(s,c));if(Ah(i),!Ph(i))i.push(`
51
- `);i.push("}"),c++,s=c;continue}if(s<c)i.push(e.slice(s,c));if(kh(i),i.push(";"),e.charCodeAt(c+1)!==10)i.push(`
52
- `);c++,s=c}if(s<n)i.push(e.slice(s,n));return i.join("")}function Ih(e){return Gc(e,0,e.length,Dh(e))}function Lh(e){if(!e.includes(" "))return e;let t="",n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(n!==0){if(t+=e[r],i===n&&e.charCodeAt(r-1)!==92)n=0;continue}if(i===34||i===39||i===96){n=i,t+=e[r];continue}if(i===32&&t.charCodeAt(t.length-1)===32)continue;t+=e[r]}return t}function Rh(e){return e===125||e===93||e===41||e===62}function Mh(e,t,n){return n-t>=3&&e.charCodeAt(t)===47&&e.charCodeAt(t+1)===42&&e.charCodeAt(t+2)===42}function jc(e,t,n){let r=e.indexOf("*/",t);return r!==-1&&r+2<=n}function Oh(e,t,n){let r=e.charCodeAt(t);if(r===124||r===38)return!0;return r===46&&t+1<n&&e.charCodeAt(t+1)!==46}function Bh(e){let t=[],n=[],r=e.length,i=0,o=!1,s=0,c=0;while(c<=r){let u=e.indexOf(`
53
- `,c);if(u===-1)u=r;let y=u+1,g=c,b=u;while(g<b&&es(e.charCodeAt(g)))g++;while(b>g&&es(e.charCodeAt(b-1)))b--;if(g===b){let v=n.length>0?n[n.length-1]:void 0;if(v!==void 0&&v!==""){let w=v.charCodeAt(v.length-1);if(w!==123&&w!==40&&w!==91)t.push(0),n.push("")}c=y;continue}if(o){if(t.push(s),n.push(` ${e.slice(g,b)}`),jc(e,g,b))o=!1;c=y;continue}let P=Mh(e,g,b),N=P&&jc(e,g,b);if(P&&!N){t.push(i),n.push(e.slice(g,b)),o=!0,s=i,c=y;continue}let D=Rh(e.charCodeAt(g)),j=Math.max(0,i-(D?1:0))+(Oh(e,g,b)?1:0);if(D&&j===0&&n.length>0&&n[n.length-1]==="")t.pop(),n.pop();if(t.push(j),n.push(Lh(e.slice(g,b))),c=y,N)continue;let U=0;for(let v=g;v<b;v++){let w=e.charCodeAt(v);if(U!==0){if(w===U&&e.charCodeAt(v-1)!==92)U=0;continue}if(w===34||w===39||w===96)U=w;else if(w===123||w===40||w===91||w===60)i++;else if(w===125||w===41||w===93)i=Math.max(0,i-1);else if(w===62&&e.charCodeAt(v-1)!==61)i=Math.max(0,i-1)}}let l=n.length;while(l>0&&n[l-1]==="")l--;let d=[];for(let u=0;u<l;u++){if(u>0)d.push(`
54
- `);let y=t[u];if(y>0)d.push(Sh(y));d.push(n[u])}return d.join("")}function Wc(e){return`${Bh(Ih(e))}
55
- `}var it="any",$e="",Fh="Record<string, any>",rs="Record<string, never>",xr=/^[A-Za-z_$][A-Za-z0-9_$]*$/,$h=/CustomEvent/,Vh=/^[A-Z]/,jh=/\n/,Yc=/=>/,Hh=/(?:^|\n)@default\b/,is=/\n/g,qh=/^([ \t]*\*) +$/gm,Uh=/\s+/g,nn=/(^|[^.\w])Snippet(?:\s*<|\b)/,Gh=/import\s+type\s+[^;]*\bSnippet\b[^;]*from\s+"svelte";/,Wh=/[.*+?^${}()|[\]\\]/g,Kh=/^const\s+/,zh=/\{name\}/g,Jh=/^export /,Xh=/[^\w$]/g;function ss(e){return e.replace(Kh,"")}function Yh(e){if(!e)return;return e.replace(is,`
56
- * `)}function br(e){if(!e)return"";return`/** ${ft(e)} */`}function Tr(e){if(!e)return"";return`/**
57
- * ${ft(e).replace(is,`
43
+ }${s}`;return{...r,slot_props:p}}).sort((t,n)=>{let r=t.name??"",i=n.name??"";if(r<i)return-1;if(r>i)return 1;return 0})}function If(e,t,n){if(e.deferredSlotBlockGenerics.length>0){let r=[...t.map((i)=>i.type??""),...n.map((i)=>i.slot_props??"")].join(`
44
+ `);for(let{name:i,constraint:a}of e.deferredSlotBlockGenerics){let s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(!new RegExp(`\\b${s}\\b`).test(r))continue;Rn(e,i,a)}}if(e.scriptGenericsAttribute){if(e.generics)G(e,"syntax-skipped","generics",'Both the "generics" script attribute and @generics/@template JSDoc tags declare component generics; the script attribute takes precedence and the JSDoc declaration was ignored.',e.scriptGenericsAttribute.source);e.generics=Ea(e.scriptGenericsAttribute.value)}}function _f(e){return It(e.events).map((t)=>{switch(t.type){case"forwarded":return{...t,element:t.element.name};case"dispatched":return t;default:return t}}).sort(sp)}function Lf(e,t,n){let r={props:new Map(e.pendingCallDefaultCandidates.filter((i)=>i.location==="props").map((i)=>[i.propName,i])),moduleExports:new Map(e.pendingCallDefaultCandidates.filter((i)=>i.location==="moduleExports").map((i)=>[i.propName,i]))};for(let i of t)if(i.typeSource==="unknown"){let a=r.props.get(i.name);if(a)i.type="any";let s=a?a.importSource?`Prop "${i.name}" default calls "${a.calleeName}()" imported from "${a.importSource}"; falling back to "any" pending cross-file resolution.`:`Prop "${i.name}" default calls "${a.calleeName}()", but its return type could not be inferred; falling back to "any".`:`Prop "${i.name}" type could not be inferred; falling back to "${i.type??"any"}".`;G(e,"prop-unknown-type",i.name,s,i.source)}for(let i of n)if(i.typeSource==="unknown"&&r.moduleExports.has(i.name))i.type="any"}function tr(e,t,n,r){if(t===void 0||rp(t))return!0;return G(e,"type-syntax-error",n,`Type \`${t}\` of "${n}" is not valid TypeScript; falling back to "any".`,r),!1}function Rf(e,t,n,r,i){for(let a of t)if(a.typeSource==="jsdoc"&&!tr(e,a.type,a.name,a.source))a.type="any";for(let a of n)if(a.type==="dispatched"&&!tr(e,a.detail,a.name,a.source))a.detail="any";for(let a of r)if(!tr(e,a.slot_props,a.name??"default",a.source))a.slot_props="any";for(let a of i)if(!tr(e,a.type,a.name,a.source))a.type="any",a.ts=`type ${a.name} = any;`}function Mf(e,t){let{dispatcherName:n}=t,r=[];if(n===void 0)return r;let i=[];for(let s of t.callsWithArguments){let p=ma(s,n);if(p)i.push({call:s,...p})}if(i.length>0)Oe(e,"dispatch-escapes",n,et(e,n)?.sveldIgnore);let a=Sr(e,"dispatch-escapes",n);for(let{call:s,argumentIndex:p,property:c}of i){let d=t.locallyBoundCalls.has(s)?void 0:Lr(e,s.callee);if(!d){r.push(s);continue}let u=H(e,s);e.pendingDispatchEscapeCandidates.push({importSource:d.source,importedName:d.importedName,...d.members?{members:d.members}:{},calleeText:ye(e,s.callee)??d.importedName,dispatcherName:n,argumentIndex:p,...c===void 0?{}:{property:c},...u?{source:u}:{},...a?{ignored:a}:{}})}return r}function Of(e,t,n){for(let r of e.jsDocEventNames){if(t.has(r))continue;if(e.forwardedEvents.has(r))continue;if(e.props.has(`on${r}`))continue;if(n.length>0)continue;let i=vr(e,"event-no-source",r,`@event "${r}" has no matching dispatch or callback prop.`,e.jsDocEventSources.get(r));if(e.pendingDispatchEscapeCandidates.length>0)e.deferredEventNoSourceDiagnostics.push(i);else e.diagnosticRecords.push(i)}}function Bf(e,t){let n=t.typedefs.filter((a)=>a.internal).map((a)=>a.name.split("<")[0]);if(n.length===0)return;let r=n.map((a)=>({name:a,regex:new RegExp(`\\b${a}\\b`)})),i=(a,s,p)=>{if(!s)return;for(let{name:c,regex:d}of r){if(!d.test(s))continue;G(e,"internal-typedef-referenced",a,`"${a}" references "${c}", which is @internal and excluded from output; the generated .d.ts will contain a dangling reference to it.`,p)}};for(let a of t.props){if(a.internal)continue;i(a.name,a.type,a.source)}for(let a of t.moduleExports){if(a.internal)continue;i(a.name,a.type,a.source)}for(let a of t.typedefs){if(a.internal)continue;i(a.name,a.ts)}for(let a of t.events){if(a.internal||a.type!=="dispatched")continue;i(a.name,a.detail,a.source)}for(let a of t.slots){if(a.internal)continue;i(a.name??"default",a.slot_props,a.source)}for(let a of t.contexts){if(a.internal)continue;if(a.type!==void 0)i(a.typeName,a.type,a.source);for(let s of a.properties)i(s.name,s.type)}}function ap(e,t){let n=wf(e,t);_a(e,n);let r=Nf(e);e.activeScopes.length=0;let i=Df(e);If(e,r,i);let a=It(e.moduleExports),s=_f(e),p=It(e.typedefs),c=It(e.contexts);Lf(e,r,a),Rf(e,r,s,i,p);let d=Mf(e,t);Of(e,n,d);let{dispatcherName:u}=t;for(let C of d){let v=ye(e,C.callee)??"";G(e,"dispatch-escapes",u??"",`\`${u}\` is passed to \`${v}\`, which sveld can't follow: it only reads a function imported from another module, by name, as its default export, or through a namespace import. Document the events dispatched there with @event tags.`,H(e,C))}if(e.rest_props?.type==="InlineComponent")G(e,"rest-props-unresolved","$$restProps",`$$restProps is only spread onto component "${e.rest_props.name}"; sveld cannot infer its rest-prop type. Spread onto a plain element or add an @restProps tag.`);Bf(e,{props:r,moduleExports:a,typedefs:p,events:s,slots:i,contexts:c});let y={source:En(e,0,e.source?.length),syntaxMode:e.syntaxMode,...e.scriptLanguage?{scriptLanguage:e.scriptLanguage}:{},props:r,moduleExports:a,slots:i,events:s,typedefs:p,generics:e.generics,rest_props:e.rest_props,extends:e.extends,componentComment:e.componentComment,componentCommentSource:e.componentCommentSource,contexts:c,customElementTag:e.customElementTag,customElement:e.customElement,...e.cssParts.length>0?{cssParts:e.cssParts.slice()}:{},...e.cssProperties.length>0?{cssProperties:e.cssProperties.slice()}:{},diagnostics:e.diagnosticRecords.slice()},x=qs(e);if(x)y[$e]=x;let g=Hs(e);return g?{component:y,pending:g}:{component:y}}var Ff=new Set(["MethodDefinition","PropertyDefinition","AccessorProperty"]);function $f(e){if(e.computed||!e.key)return;if(e.key.type==="Identifier")return e.key.name;if(e.key.type==="Literal"&&(typeof e.key.value==="string"||typeof e.key.value==="number"))return String(e.key.value);return}function op(e){return e==="private"||e==="protected"}function _t(e){return{...e?.description?{description:e.description}:{},...e?.deprecated===void 0?{}:{deprecated:e.deprecated},...e?.tags?{tags:e.tags}:{}}}function cp(e){return e?.slice(1,-1).trim()||void 0}function Pi(e,t,n){let r=_r(e,t),i=new Map((n?.params??[]).map((c)=>[c.name,c])),a=r.params.map(({name:c,type:d,optional:u,rest:y})=>{let x=i.get(c);return{name:y?`...${c}`:c,type:d??x?.type??(y?"any[]":"any"),...x?.description?{description:x.description}:{},...!y&&(u||x?.optional)?{optional:!0}:{}}}),s=r.returnType??n?.returnType??(t.async?"Promise<any>":void 0),p=cp(r.typeParameters)??n?.typeParameters;return{...a.length>0?{params:a}:{},...s?{returnType:s}:{},...p?{typeParameters:p}:{}}}function lp(e,t){let n=[],r=new Map,i=new Set,a=new Set,s,p=-1;for(let u of t.body?.body??[]){let y=u;if(!Ff.has(y.type)||op(y.accessibility))continue;let x=$f(y);if(x===void 0)continue;let g=ne(e,y);if(g?.internal)continue;let C=`${y.static?"static ":""}${x}`,v={...y.static?{static:!0}:{},...y.optional?{optional:!0}:{},...y.abstract?{abstract:!0}:{}};if(y.type!=="MethodDefinition"){if(te(e,y.typeAnnotation?.typeAnnotation),!y.static)a.add(x);n.push({kind:"property",name:x,type:Ue(e,y.typeAnnotation)??g?.type??"any",...v,...y.readonly?{readonly:!0}:{},..._t(g)});continue}let w=y.value,R=y.typeParameters?{...w,typeParameters:y.typeParameters}:w;if(y.kind==="constructor"){let B=Pi(e,R,g);n.push({kind:"constructor",name:"constructor",params:B.params,..._t(g)}),p=n.length,s=R.body?.body,(R.params??[]).forEach((k,_)=>{if(k.type!=="TSParameterProperty"||op(k.accessibility))return;let j=B.params?.[_];if(!j)return;a.add(j.name),n.push({kind:"property",name:j.name,type:j.type,...k.readonly?{readonly:!0}:{},...j.description?{description:j.description}:{}})});continue}if(y.kind==="get"||y.kind==="set"){let B=Pi(e,R,g),L=y.kind==="get"?B.returnType??g?.type:B.params?.[0]?.type??g?.type,k=r.get(C);if(k){if(y.kind==="set")k.readonly=void 0;if(L&&L!=="any"&&(k.type==="any"||y.kind==="get"))k.type=L;if(!k.description&&!k.deprecated)Object.assign(k,_t(g));continue}let _={kind:"property",name:x,type:L??"any",...v,...y.kind==="get"?{readonly:!0}:{},..._t(g)};r.set(C,_),n.push(_);continue}if(R.type==="TSDeclareMethod"&&!y.abstract)i.add(C);else if(R.type!=="TSDeclareMethod"&&i.has(C))continue;n.push({kind:"method",name:x,...v,...Pi(e,R,g),..._t(g)})}if(e.scriptLanguage!=="ts"&&s)n.splice(p,0,...jf(e,s,a));for(let u of t.typeParameters?.params??[])te(e,u.constraint),te(e,u.default);let c=cp(ct(e,t.typeParameters)),d=Vf(e,t);return{members:n,...c?{typeParameters:c}:{},...d}}function Vf(e,t){let n={},r=t.superClass;if(r){if(n.extends=ct(e,{start:r.start,end:t.superTypeParameters?.end??r.end}),r.type==="Identifier")pp(e,r,t.superTypeParameters)}let i=(t.implements??[]).map((a)=>(pp(e,a.expression,a.typeParameters),ct(e,a))).filter((a)=>Boolean(a));if(i.length>0)n.implements=i;return n}function pp(e,t,n){te(e,{type:"TSTypeReference",typeName:t,...n?{typeParameters:n}:{}})}function jf(e,t,n){let r=[];for(let i of t){let a=i.type==="ExpressionStatement"?i.expression:void 0;if(a?.type!=="AssignmentExpression"||a.operator!=="=")continue;let s=a.left;if(s?.type!=="MemberExpression"||s.computed||s.object?.type!=="ThisExpression")continue;let p=s.property?.type==="Identifier"?s.property.name:void 0;if(!p||n.has(p))continue;n.add(p);let c=ne(e,i);if(c?.internal)continue;r.push({kind:"property",name:p,type:c?.type??"any",..._t(c)})}return r}var Hf=/^[A-Za-z_$][\w$]*(?=\s*(?:<|$))/;function Ai(e,t,n){if(he(t)===void 0)return;if(e.moduleExports.has(t)){let r=e.moduleExports.get(t);e.moduleExports.set(t,{...r,...n})}else e.moduleExports.set(t,n)}function up(e,t,n,r){let i=ne(e,t);Ai(e,n==="*"?`* from ${r.from}`:n,{name:n,kind:"re-export",description:i?.description,deprecated:i?.deprecated,tags:i?.tags,...i?.internal?{internal:!0}:{},isFunction:!1,isFunctionDeclaration:!1,isRequired:!1,constant:!1,reactive:!1,reExport:r,source:H(e,t)})}function dp(e,t){G(e,"module-export-conflict","default",`export "default" was skipped because it collides with the component's own default export.`,H(e,t))}function qf(e,t,n,r){let i=n.id?.name;if(!i)return;let a=r?.exportedName??i,s=Ln(e,t,r),{members:p,typeParameters:c,extends:d,implements:u}=lp(e,n),y=c??s?.typeParameters;Ai(e,a,{name:a,...i===a?{}:{localName:i},kind:"class",description:s?.description,deprecated:s?.deprecated,tags:s?.tags,...s?.internal?{internal:!0}:{},type:`typeof ${i}`,...y?{typeParameters:y}:{},members:p,...n.abstract?{abstract:!0}:{},...d?{extends:d}:{},...u?{implements:u}:{},isFunction:!1,isFunctionDeclaration:!1,isRequired:!1,constant:!1,reactive:!1,source:H(e,t)})}function fp(e,t,n,r){if(n.type==="ClassDeclaration"){qf(e,t,n,r);return}let i=Wr(e,n,r,"moduleExports");if(i.length===0)return;let a=Ln(e,t,r);for(let s of i){let{prop_name:p,kind:c}=s,{type:d,typeSource:u,description:y,params:x,returnType:g,isFunction:C,typeParameters:v}=zr(e,s,a);Ai(e,p,{name:p,kind:c,description:y,deprecated:a?.deprecated,tags:a?.tags,...a?.internal?{internal:!0}:{},type:d,typeSource:u,value:s.value,defaultValue:s.defaultValue,params:x,returnType:g,typeParameters:v,isFunction:C,isFunctionDeclaration:s.isFunctionDeclaration,isRequired:!1,constant:c==="const",reactive:!1,source:H(e,t)})}}function Uf(e){let t=Array.from(e.moduleExports.values()).filter((r)=>r.kind==="class"),n=new Set(t.map((r)=>r.localName??r.name));for(let r of t){if(!r.extends)continue;let i=Hf.exec(r.extends)?.[0];if(i&&(n.has(i)||e.valueImportBindingsByLocalName.has(i)||e.typeImportBindingsByLocalName.has(i)))continue;G(e,"export-unresolved",r.name,`class "${r.name}" extends \`${r.extends}\`, which isn't imported or an exported class, so the .d.ts declares it without \`extends\` and its inherited members are missing. Export the base class from the module script.`,r.source),r.extends=void 0}}function hp(e){let t=e.parsed?.module;if(!t)return;let n=Us(t);Mn(t,(r,i)=>{if(r.type==="ImportDeclaration")$t(e,r);if(r.type==="FunctionDeclaration"&&r.id?.name)e.funcDecls.set(r.id.name,r);if(r.type==="VariableDeclaration")e.vars.add(r);if(r.type==="ExportNamedDeclaration"){if(r.declaration!=null){fp(e,r,r.declaration);return}let a=r.source?.value,s=i?.type==="Program"?i:null;for(let p of r.specifiers){let c=Ur(e,r,p,s,"module");if(!c)continue;if(c.exportedName==="default"){dp(e,r);continue}let d=typeof a==="string"?{from:a,imported:c.localName}:n.get(c.localName);if(c.declaration)fp(e,r,c.declaration,c);else if(d)up(e,r,c.exportedName,d);else if(!e.localTypeDeclarationsByName.get(c.localName)?.exported)Gr(e,r,c.localName,c.exportedName)}}if(r.type==="ExportAllDeclaration"&&typeof r.source.value==="string"){let a=(r.exported&&_n(r.exported))??"*";if(a==="default"){dp(e,r);return}up(e,r,a,{from:r.source.value,imported:"*"})}}),Uf(e)}var Gf={li:{direct:["li"]},dt:{descendant:["dt","dd"]},dd:{descendant:["dt","dd"]},p:{descendant:["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"]},rt:{descendant:["rt","rp"]},rp:{descendant:["rt","rp"]},optgroup:{descendant:["optgroup"]},option:{descendant:["option","optgroup"]},thead:{direct:["tbody","tfoot"]},tbody:{direct:["tbody","tfoot"]},tfoot:{direct:["tbody"]},tr:{direct:["tr","tbody"]},td:{direct:["td","th","tr"]},th:{direct:["td","th","tr"]}};function mp(e,t){let n=Gf[e];if(!n)return!1;if(!t)return!0;return(n.direct??n.descendant??[]).includes(t)}function ht(e){if(e===32||e<=13&&e>=9)return!0;if(e<160)return!1;return e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288||e===65279}class ki{source;index=0;constructor(e){this.source=e}match(e){if(e.length===1)return this.source.charCodeAt(this.index)===e.charCodeAt(0);return this.source.startsWith(e,this.index)}matchRegex(e){e.lastIndex=this.index;let t=e.exec(this.source);if(!t||t.index!==this.index)return null;return t[0]}eat(e,t=!1){if(this.match(e))return this.index+=e.length,!0;if(t)throw new it(`Expected token ${JSON.stringify(e)}`,this.index);return!1}read(e){let t=this.matchRegex(e);if(t)this.index+=t.length;return t}readUntil(e){if(this.index>=this.source.length)throw new it("Unexpected end of input",this.source.length);let t=this.index;e.lastIndex=t;let n=e.exec(this.source);if(n)return this.index=n.index,this.source.slice(t,this.index);return this.index=this.source.length,this.source.slice(t)}readUntilString(e){if(this.index>=this.source.length)throw new it("Unexpected end of input",this.source.length);let t=this.source.indexOf(e,this.index),n=t===-1?this.source.length:t,r=this.source.slice(this.index,n);return this.index=n,r}allowWhitespace(){while(this.index<this.source.length&&ht(this.source.charCodeAt(this.index)))this.index++}requireWhitespace(){if(!ht(this.source.charCodeAt(this.index)))throw new it("Expected whitespace",this.index);this.allowWhitespace()}readIdentifierName(){let e=this.index,t=e,n="",r=this.source.codePointAt(this.index);if(r!==void 0&&pe(r,!0)){t+=r<=65535?1:2;while(t<this.source.length){let i=this.source.codePointAt(t);if(i===void 0||!de(i,!0))break;t+=i<=65535?1:2}n=this.source.slice(e,t),this.index=t}return{type:"Identifier",name:n,start:e,end:t}}}class it extends Error{position;constructor(e,t){super(`${e} (at index ${t})`);this.name="TemplateSyntaxError",this.position=t}}function le(){return{type:"Fragment",nodes:[]}}var Wf=new Set(["await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","finally","for","function","if","implements","import","in","instanceof","interface","let","new","package","private","protected","public","return","static","super","switch","this","throw","try","typeof","var","void","while","with","yield"]),zf=["&&","||","??"],Kf=["===","!==","==","!="];function yp(e,t){let n=e.codePointAt(t);if(n===void 0||!pe(n,!0))return t;let r=t+(n<=65535?1:2);while(r<e.length){let i=e.codePointAt(r);if(!de(i,!0))break;r+=i<=65535?1:2}return r}function Jf(e,t){let n=t;while(n<e.length){let r=e.charCodeAt(n);if(r<48||r>57)break;n++}return n}function nr(e,t){let n=t;while(n<e.length&&ht(e.charCodeAt(n)))n++;return n}function gp(e,t){let n=Jf(e,t);if(n===t)return null;if(e.charCodeAt(t)===48&&n-t>1)return null;if(n<e.length){let i=e.codePointAt(n);if(i===46||de(i,!0))return null}let r=e.slice(t,n);return{type:"Literal",start:t,end:n,value:Number(r),raw:r}}function xp(e,t){let n=e.charCodeAt(t),r=t+1;while(r<e.length){let i=e.charCodeAt(r);if(i===n){let a=e.slice(t,r+1);return{type:"Literal",start:t,end:r+1,value:e.slice(t+1,r),raw:a}}if(i===92||i===10||i===13)return null;r++}return null}function Xf(e,t){let n=e.charCodeAt(t);if(n===34||n===39)return xp(e,t);let r=yp(e,t);if(r===t)return gp(e,t);let i=e.slice(t,r);if(i==="true"||i==="false")return{type:"Literal",start:t,end:r,value:i==="true",raw:i};if(i==="null")return{type:"Literal",start:t,end:r,value:null,raw:i};if(Wf.has(i))return null;let a={type:"Identifier",start:t,end:r,name:i},s=r;while(s<e.length){let p=e.charCodeAt(s);if(p===46){let c=s+1,d=yp(e,c);if(d===c)return null;let u={type:"Identifier",start:c,end:d,name:e.slice(c,d)};a={type:"MemberExpression",start:t,end:d,object:a,property:u,computed:!1,optional:!1},s=d}else if(p===91){let c=s+1,d=e.charCodeAt(c),u=d===34||d===39?xp(e,c):gp(e,c);if(!u||e.charCodeAt(u.end)!==93)return null;a={type:"MemberExpression",start:t,end:u.end+1,object:a,property:u,computed:!0,optional:!1},s=u.end+1}else break}return a}function wi(e,t){if(e.charCodeAt(t)!==33||e.charCodeAt(t+1)===61)return Xf(e,t);let n=wi(e,nr(e,t+1));if(!n)return null;return{type:"UnaryExpression",start:t,end:n.end,operator:"!",prefix:!0,argument:n}}function Yf(e,t){for(let n of Kf)if(e.startsWith(n,t))return{operator:n,logical:!1};for(let n of zf)if(e.startsWith(n,t))return{operator:n,logical:!0};return null}function bp(e,t){let n=nr(e,t);if(n>=e.length)return!1;let r=e.charCodeAt(n);return r===125||r===41}function Qf(e){let t=e.source,n=wi(t,e.index);if(!n)return null;if(bp(t,n.end))return e.index=n.end,n;let r=nr(t,n.end),i=Yf(t,r);if(!i)return null;let a=wi(t,nr(t,r+i.operator.length));if(!a||!bp(t,a.end))return null;return e.index=a.end,{type:i.logical?"LogicalExpression":"BinaryExpression",start:n.start,end:a.end,left:n,operator:i.operator,right:a}}function ee(e){let t=Qf(e);if(t)return t;let{node:n,end:r}=Dt(e.source,e.index,e.isTypeScript,e.root.comments,e.lineTable);return e.index=r,n}var Zf={"CounterClockwiseContourIntegral;":8755,"ClockwiseContourIntegral;":8754,"DoubleLongLeftRightArrow;":10234,"NotNestedGreaterGreater;":10914,"DiacriticalDoubleAcute;":733,"NotSquareSupersetEqual;":8931,"CloseCurlyDoubleQuote;":8221,"DoubleContourIntegral;":8751,"FilledVerySmallSquare;":9642,"NegativeVeryThinSpace;":8203,"NotPrecedesSlantEqual;":8928,"NotRightTriangleEqual;":8941,"NotSucceedsSlantEqual;":8929,"CapitalDifferentialD;":8517,"DoubleLeftRightArrow;":8660,"DoubleLongRightArrow;":10233,"EmptyVerySmallSquare;":9643,"NestedGreaterGreater;":8811,"NotDoubleVerticalBar;":8742,"NotGreaterSlantEqual;":10878,"NotLeftTriangleEqual;":8940,"NotSquareSubsetEqual;":8930,"OpenCurlyDoubleQuote;":8220,"ReverseUpEquilibrium;":10607,"DoubleLongLeftArrow;":10232,"DownLeftRightVector;":10576,"LeftArrowRightArrow;":8646,"NegativeMediumSpace;":8203,"NotGreaterFullEqual;":8807,"NotRightTriangleBar;":10704,"RightArrowLeftArrow;":8644,"SquareSupersetEqual;":8850,"leftrightsquigarrow;":8621,"DownRightTeeVector;":10591,"DownRightVectorBar;":10583,"LongLeftRightArrow;":10231,"Longleftrightarrow;":10234,"NegativeThickSpace;":8203,"NotLeftTriangleBar;":10703,"PrecedesSlantEqual;":8828,"ReverseEquilibrium;":8651,"RightDoubleBracket;":10215,"RightDownTeeVector;":10589,"RightDownVectorBar;":10581,"RightTriangleEqual;":8885,"SquareIntersection;":8851,"SucceedsSlantEqual;":8829,"blacktriangleright;":9656,"longleftrightarrow;":10231,"DoubleUpDownArrow;":8661,"DoubleVerticalBar;":8741,"DownLeftTeeVector;":10590,"DownLeftVectorBar;":10582,"FilledSmallSquare;":9724,"GreaterSlantEqual;":10878,"LeftDoubleBracket;":10214,"LeftDownTeeVector;":10593,"LeftDownVectorBar;":10585,"LeftTriangleEqual;":8884,"NegativeThinSpace;":8203,"NotGreaterGreater;":8811,"NotLessSlantEqual;":10877,"NotNestedLessLess;":10913,"NotReverseElement;":8716,"NotSquareSuperset;":8848,"NotTildeFullEqual;":8775,"RightAngleBracket;":10217,"RightUpDownVector;":10575,"SquareSubsetEqual;":8849,"VerticalSeparator;":10072,"blacktriangledown;":9662,"blacktriangleleft;":9666,"leftrightharpoons;":8651,"rightleftharpoons;":8652,"twoheadrightarrow;":8608,"DiacriticalAcute;":180,"DiacriticalGrave;":96,"DiacriticalTilde;":732,"DoubleRightArrow;":8658,"DownArrowUpArrow;":8693,"EmptySmallSquare;":9723,"GreaterEqualLess;":8923,"GreaterFullEqual;":8807,"LeftAngleBracket;":10216,"LeftUpDownVector;":10577,"LessEqualGreater;":8922,"NonBreakingSpace;":160,"NotPrecedesEqual;":10927,"NotRightTriangle;":8939,"NotSucceedsEqual;":10928,"NotSucceedsTilde;":8831,"NotSupersetEqual;":8841,"RightTriangleBar;":10704,"RightUpTeeVector;":10588,"RightUpVectorBar;":10580,"UnderParenthesis;":9181,"UpArrowDownArrow;":8645,"circlearrowright;":8635,"downharpoonright;":8642,"ntrianglerighteq;":8941,"rightharpoondown;":8641,"rightrightarrows;":8649,"twoheadleftarrow;":8606,"vartriangleright;":8883,"CloseCurlyQuote;":8217,"ContourIntegral;":8750,"DoubleDownArrow;":8659,"DoubleLeftArrow;":8656,"DownRightVector;":8641,"LeftRightVector;":10574,"LeftTriangleBar;":10703,"LeftUpTeeVector;":10592,"LeftUpVectorBar;":10584,"LowerRightArrow;":8600,"NotGreaterEqual;":8817,"NotGreaterTilde;":8821,"NotHumpDownHump;":8782,"NotLeftTriangle;":8938,"NotSquareSubset;":8847,"OverParenthesis;":9180,"RightDownVector;":8642,"ShortRightArrow;":8594,"UpperRightArrow;":8599,"bigtriangledown;":9661,"circlearrowleft;":8634,"curvearrowright;":8631,"downharpoonleft;":8643,"leftharpoondown;":8637,"leftrightarrows;":8646,"nLeftrightarrow;":8654,"nleftrightarrow;":8622,"ntrianglelefteq;":8940,"rightleftarrows;":8644,"rightsquigarrow;":8605,"rightthreetimes;":8908,"straightepsilon;":1013,"trianglerighteq;":8885,"vartriangleleft;":8882,"DiacriticalDot;":729,"DoubleRightTee;":8872,"DownLeftVector;":8637,"GreaterGreater;":10914,"HorizontalLine;":9472,"InvisibleComma;":8291,"InvisibleTimes;":8290,"LeftDownVector;":8643,"LeftRightArrow;":8596,"Leftrightarrow;":8660,"LessSlantEqual;":10877,"LongRightArrow;":10230,"Longrightarrow;":10233,"LowerLeftArrow;":8601,"NestedLessLess;":8810,"NotGreaterLess;":8825,"NotLessGreater;":8824,"NotSubsetEqual;":8840,"NotVerticalBar;":8740,"OpenCurlyQuote;":8216,"ReverseElement;":8715,"RightTeeVector;":10587,"RightVectorBar;":10579,"ShortDownArrow;":8595,"ShortLeftArrow;":8592,"SquareSuperset;":8848,"TildeFullEqual;":8773,"UpperLeftArrow;":8598,"ZeroWidthSpace;":8203,"curvearrowleft;":8630,"doublebarwedge;":8966,"downdownarrows;":8650,"hookrightarrow;":8618,"leftleftarrows;":8647,"leftrightarrow;":8596,"leftthreetimes;":8907,"longrightarrow;":10230,"looparrowright;":8620,"nshortparallel;":8742,"ntriangleright;":8939,"rightarrowtail;":8611,"rightharpoonup;":8640,"trianglelefteq;":8884,"upharpoonright;":8638,"ApplyFunction;":8289,"DifferentialD;":8518,"DoubleLeftTee;":10980,"DoubleUpArrow;":8657,"LeftTeeVector;":10586,"LeftVectorBar;":10578,"LessFullEqual;":8806,"LongLeftArrow;":10229,"Longleftarrow;":10232,"NotEqualTilde;":8770,"NotTildeEqual;":8772,"NotTildeTilde;":8777,"Poincareplane;":8460,"PrecedesEqual;":10927,"PrecedesTilde;":8830,"RightArrowBar;":8677,"RightTeeArrow;":8614,"RightTriangle;":8883,"RightUpVector;":8638,"SucceedsEqual;":10928,"SucceedsTilde;":8831,"SupersetEqual;":8839,"UpEquilibrium;":10606,"VerticalTilde;":8768,"VeryThinSpace;":8202,"bigtriangleup;":9651,"blacktriangle;":9652,"divideontimes;":8903,"fallingdotseq;":8786,"hookleftarrow;":8617,"leftarrowtail;":8610,"leftharpoonup;":8636,"longleftarrow;":10229,"looparrowleft;":8619,"measuredangle;":8737,"ntriangleleft;":8938,"shortparallel;":8741,"smallsetminus;":8726,"triangleright;":9657,"upharpoonleft;":8639,"varsubsetneqq;":10955,"varsupsetneqq;":10956,"DownArrowBar;":10515,"DownTeeArrow;":8615,"ExponentialE;":8519,"GreaterEqual;":8805,"GreaterTilde;":8819,"HilbertSpace;":8459,"HumpDownHump;":8782,"Intersection;":8898,"LeftArrowBar;":8676,"LeftTeeArrow;":8612,"LeftTriangle;":8882,"LeftUpVector;":8639,"NotCongruent;":8802,"NotHumpEqual;":8783,"NotLessEqual;":8816,"NotLessTilde;":8820,"Proportional;":8733,"RightCeiling;":8969,"RoundImplies;":10608,"ShortUpArrow;":8593,"SquareSubset;":8847,"UnderBracket;":9141,"VerticalLine;":124,"blacklozenge;":10731,"exponentiale;":8519,"risingdotseq;":8787,"triangledown;":9663,"triangleleft;":9667,"varsubsetneq;":8842,"varsupsetneq;":8843,"CircleMinus;":8854,"CircleTimes;":8855,"Equilibrium;":8652,"GreaterLess;":8823,"LeftCeiling;":8968,"LessGreater;":8822,"MediumSpace;":8287,"NotLessLess;":8810,"NotPrecedes;":8832,"NotSucceeds;":8833,"NotSuperset;":8835,"OverBracket;":9140,"RightVector;":8640,"Rrightarrow;":8667,"RuleDelayed;":10740,"SmallCircle;":8728,"SquareUnion;":8852,"SubsetEqual;":8838,"UpDownArrow;":8597,"Updownarrow;":8661,"VerticalBar;":8739,"backepsilon;":1014,"blacksquare;":9642,"circledcirc;":8858,"circleddash;":8861,"curlyeqprec;":8926,"curlyeqsucc;":8927,"diamondsuit;":9830,"eqslantless;":10901,"expectation;":8496,"nRightarrow;":8655,"nrightarrow;":8603,"preccurlyeq;":8828,"precnapprox;":10937,"quaternions;":8461,"straightphi;":981,"succcurlyeq;":8829,"succnapprox;":10938,"thickapprox;":8776,"updownarrow;":8597,"Bernoullis;":8492,"CirclePlus;":8853,"EqualTilde;":8770,"Fouriertrf;":8497,"ImaginaryI;":8520,"Laplacetrf;":8466,"LeftVector;":8636,"Lleftarrow;":8666,"NotElement;":8713,"NotGreater;":8815,"Proportion;":8759,"RightArrow;":8594,"RightFloor;":8971,"Rightarrow;":8658,"ThickSpace;":8287,"TildeEqual;":8771,"TildeTilde;":8776,"UnderBrace;":9183,"UpArrowBar;":10514,"UpTeeArrow;":8613,"circledast;":8859,"complement;":8705,"curlywedge;":8911,"eqslantgtr;":10902,"gtreqqless;":10892,"lessapprox;":10885,"lesseqqgtr;":10891,"lmoustache;":9136,"longmapsto;":10236,"mapstodown;":8615,"mapstoleft;":8612,"nLeftarrow;":8653,"nleftarrow;":8602,"nsubseteqq;":10949,"nsupseteqq;":10950,"precapprox;":10935,"rightarrow;":8594,"rmoustache;":9137,"sqsubseteq;":8849,"sqsupseteq;":8850,"subsetneqq;":10955,"succapprox;":10936,"supsetneqq;":10956,"upuparrows;":8648,"varepsilon;":1013,"varnothing;":8709,"Backslash;":8726,"CenterDot;":183,"CircleDot;":8857,"Congruent;":8801,"Coproduct;":8720,"DoubleDot;":168,"DownArrow;":8595,"DownBreve;":785,"Downarrow;":8659,"HumpEqual;":8783,"LeftArrow;":8592,"LeftFloor;":8970,"Leftarrow;":8656,"LessTilde;":8818,"Mellintrf;":8499,"MinusPlus;":8723,"NotCupCap;":8813,"NotExists;":8708,"NotSubset;":8834,"OverBrace;":9182,"PlusMinus;":177,"Therefore;":8756,"ThinSpace;":8201,"TripleDot;":8411,"UnionPlus;":8846,"backprime;":8245,"backsimeq;":8909,"bigotimes;":10754,"centerdot;":183,"checkmark;":10003,"complexes;":8450,"dotsquare;":8865,"downarrow;":8595,"gtrapprox;":10886,"gtreqless;":8923,"gvertneqq;":8809,"heartsuit;":9829,"leftarrow;":8592,"lesseqgtr;":8922,"lvertneqq;":8808,"ngeqslant;":10878,"nleqslant;":10877,"nparallel;":8742,"nshortmid;":8740,"nsubseteq;":8840,"nsupseteq;":8841,"pitchfork;":8916,"rationals;":8474,"spadesuit;":9824,"subseteqq;":10949,"subsetneq;":8842,"supseteqq;":10950,"supsetneq;":8843,"therefore;":8756,"triangleq;":8796,"varpropto;":8733,"DDotrahd;":10513,"DotEqual;":8784,"Integral;":8747,"LessLess;":10913,"NotEqual;":8800,"NotTilde;":8769,"PartialD;":8706,"Precedes;":8826,"RightTee;":8866,"Succeeds;":8827,"SuchThat;":8715,"Superset;":8835,"Uarrocir;":10569,"UnderBar;":95,"andslope;":10840,"angmsdaa;":10664,"angmsdab;":10665,"angmsdac;":10666,"angmsdad;":10667,"angmsdae;":10668,"angmsdaf;":10669,"angmsdag;":10670,"angmsdah;":10671,"angrtvbd;":10653,"approxeq;":8778,"awconint;":8755,"backcong;":8780,"barwedge;":8965,"bbrktbrk;":9142,"bigoplus;":10753,"bigsqcup;":10758,"biguplus;":10756,"bigwedge;":8896,"boxminus;":8863,"boxtimes;":8864,"bsolhsub;":10184,"capbrcup;":10825,"circledR;":174,"circledS;":9416,"cirfnint;":10768,"clubsuit;":9827,"cupbrcap;":10824,"curlyvee;":8910,"cwconint;":8754,"doteqdot;":8785,"dotminus;":8760,"drbkarow;":10512,"dzigrarr;":10239,"elinters;":9191,"emptyset;":8709,"eqvparsl;":10725,"fpartint;":10765,"geqslant;":10878,"gesdotol;":10884,"gnapprox;":10890,"hksearow;":10533,"hkswarow;":10534,"imagline;":8464,"imagpart;":8465,"infintie;":10717,"integers;":8484,"intercal;":8890,"intlarhk;":10775,"laemptyv;":10676,"ldrushar;":10571,"leqslant;":10877,"lesdotor;":10883,"llcorner;":8990,"lnapprox;":10889,"lrcorner;":8991,"lurdshar;":10570,"mapstoup;":8613,"multimap;":8888,"naturals;":8469,"ncongdot;":10861,"notindot;":8949,"otimesas;":10806,"parallel;":8741,"plusacir;":10787,"pointint;":10773,"precneqq;":10933,"precnsim;":8936,"profalar;":9006,"profline;":8978,"profsurf;":8979,"raemptyv;":10675,"realpart;":8476,"rppolint;":10770,"rtriltri;":10702,"scpolint;":10771,"setminus;":8726,"shortmid;":8739,"smeparsl;":10724,"sqsubset;":8847,"sqsupset;":8848,"subseteq;":8838,"succneqq;":10934,"succnsim;":8937,"supseteq;":8839,"thetasym;":977,"thicksim;":8764,"timesbar;":10801,"triangle;":9653,"triminus;":10810,"trpezium;":9186,"ulcorner;":8988,"urcorner;":8989,"varkappa;":1008,"varsigma;":962,"vartheta;":977,"Because;":8757,"Cayleys;":8493,"Cconint;":8752,"Cedilla;":184,"Diamond;":8900,"DownTee;":8868,"Element;":8712,"Epsilon;":917,"Implies;":8658,"LeftTee;":8867,"NewLine;":10,"NoBreak;":8288,"NotLess;":8814,"Omicron;":927,"OverBar;":8254,"Product;":8719,"UpArrow;":8593,"Uparrow;":8657,"Upsilon;":933,"alefsym;":8501,"angrtvb;":8894,"angzarr;":9084,"asympeq;":8781,"backsim;":8765,"because;":8757,"bemptyv;":10672,"between;":8812,"bigcirc;":9711,"bigodot;":10752,"bigstar;":9733,"bnequiv;":8801,"boxplus;":8862,"ccupssm;":10832,"cemptyv;":10674,"cirscir;":10690,"coloneq;":8788,"congdot;":10861,"cudarrl;":10552,"cudarrr;":10549,"cularrp;":10557,"curarrm;":10556,"dbkarow;":10511,"ddagger;":8225,"ddotseq;":10871,"demptyv;":10673,"diamond;":8900,"digamma;":989,"dotplus;":8724,"dwangle;":10662,"epsilon;":949,"eqcolon;":8789,"equivDD;":10872,"gesdoto;":10882,"gtquest;":10876,"gtrless;":8823,"harrcir;":10568,"intprod;":10812,"isindot;":8949,"larrbfs;":10527,"larrsim;":10611,"lbrksld;":10639,"lbrkslu;":10637,"ldrdhar;":10599,"lesdoto;":10881,"lessdot;":8918,"lessgtr;":8822,"lesssim;":8818,"lotimes;":10804,"lozenge;":9674,"ltquest;":10875,"luruhar;":10598,"maltese;":10016,"minusdu;":10794,"napprox;":8777,"natural;":9838,"nearrow;":8599,"nexists;":8708,"notinva;":8713,"notinvb;":8951,"notinvc;":8950,"notniva;":8716,"notnivb;":8958,"notnivc;":8957,"npolint;":10772,"npreceq;":10927,"nsqsube;":8930,"nsqsupe;":8931,"nsubset;":8834,"nsucceq;":10928,"nsupset;":8835,"nvinfin;":10718,"nvltrie;":8884,"nvrtrie;":8885,"nwarrow;":8598,"olcross;":10683,"omicron;":959,"orderof;":8500,"orslope;":10839,"pertenk;":8241,"planckh;":8462,"pluscir;":10786,"plussim;":10790,"plustwo;":10791,"precsim;":8830,"quatint;":10774,"questeq;":8799,"rarrbfs;":10528,"rarrsim;":10612,"rbrksld;":10638,"rbrkslu;":10640,"rdldhar;":10601,"realine;":8475,"rotimes;":10805,"ruluhar;":10600,"searrow;":8600,"simplus;":10788,"simrarr;":10610,"subedot;":10947,"submult;":10945,"subplus;":10943,"subrarr;":10617,"succsim;":8831,"supdsub;":10968,"supedot;":10948,"suphsol;":10185,"suphsub;":10967,"suplarr;":10619,"supmult;":10946,"supplus;":10944,"swarrow;":8601,"topfork;":10970,"triplus;":10809,"tritime;":10811,"uparrow;":8593,"upsilon;":965,"uwangle;":10663,"vzigzag;":10650,"zigrarr;":8669,"Aacute;":193,"Abreve;":258,"Agrave;":192,"Assign;":8788,"Atilde;":195,"Barwed;":8966,"Bumpeq;":8782,"Cacute;":262,"Ccaron;":268,"Ccedil;":199,"Colone;":10868,"Conint;":8751,"CupCap;":8781,"Dagger;":8225,"Dcaron;":270,"DotDot;":8412,"Dstrok;":272,"Eacute;":201,"Ecaron;":282,"Egrave;":200,"Exists;":8707,"ForAll;":8704,"Gammad;":988,"Gbreve;":286,"Gcedil;":290,"HARDcy;":1066,"Hstrok;":294,"Iacute;":205,"Igrave;":204,"Itilde;":296,"Jsercy;":1032,"Kcedil;":310,"Lacute;":313,"Lambda;":923,"Lcaron;":317,"Lcedil;":315,"Lmidot;":319,"Lstrok;":321,"Nacute;":323,"Ncaron;":327,"Ncedil;":325,"Ntilde;":209,"Oacute;":211,"Odblac;":336,"Ograve;":210,"Oslash;":216,"Otilde;":213,"Otimes;":10807,"Racute;":340,"Rarrtl;":10518,"Rcaron;":344,"Rcedil;":342,"SHCHcy;":1065,"SOFTcy;":1068,"Sacute;":346,"Scaron;":352,"Scedil;":350,"Square;":9633,"Subset;":8912,"Supset;":8913,"Tcaron;":356,"Tcedil;":354,"Tstrok;":358,"Uacute;":218,"Ubreve;":364,"Udblac;":368,"Ugrave;":217,"Utilde;":360,"Vdashl;":10982,"Verbar;":8214,"Vvdash;":8874,"Yacute;":221,"Zacute;":377,"Zcaron;":381,"aacute;":225,"abreve;":259,"agrave;":224,"andand;":10837,"angmsd;":8737,"angsph;":8738,"apacir;":10863,"approx;":8776,"atilde;":227,"barvee;":8893,"barwed;":8965,"becaus;":8757,"bernou;":8492,"bigcap;":8898,"bigcup;":8899,"bigvee;":8897,"bkarow;":10509,"bottom;":8869,"bowtie;":8904,"boxbox;":10697,"bprime;":8245,"brvbar;":166,"bullet;":8226,"bumpeq;":8783,"cacute;":263,"capand;":10820,"capcap;":10827,"capcup;":10823,"capdot;":10816,"ccaron;":269,"ccedil;":231,"circeq;":8791,"cirmid;":10991,"colone;":8788,"commat;":64,"compfn;":8728,"conint;":8750,"coprod;":8720,"copysr;":8471,"cularr;":8630,"cupcap;":10822,"cupcup;":10826,"cupdot;":8845,"curarr;":8631,"curren;":164,"cylcty;":9005,"dagger;":8224,"daleth;":8504,"dcaron;":271,"dfisht;":10623,"divide;":247,"divonx;":8903,"dlcorn;":8990,"dlcrop;":8973,"dollar;":36,"drcorn;":8991,"drcrop;":8972,"dstrok;":273,"eacute;":233,"easter;":10862,"ecaron;":283,"ecolon;":8789,"egrave;":232,"egsdot;":10904,"elsdot;":10903,"emptyv;":8709,"emsp13;":8196,"emsp14;":8197,"eparsl;":10723,"eqcirc;":8790,"equals;":61,"equest;":8799,"female;":9792,"ffilig;":64259,"ffllig;":64260,"forall;":8704,"frac12;":189,"frac13;":8531,"frac14;":188,"frac15;":8533,"frac16;":8537,"frac18;":8539,"frac23;":8532,"frac25;":8534,"frac34;":190,"frac35;":8535,"frac38;":8540,"frac45;":8536,"frac56;":8538,"frac58;":8541,"frac78;":8542,"gacute;":501,"gammad;":989,"gbreve;":287,"gesdot;":10880,"gesles;":10900,"gtlPar;":10645,"gtrarr;":10616,"gtrdot;":8919,"gtrsim;":8819,"hairsp;":8202,"hamilt;":8459,"hardcy;":1098,"hearts;":9829,"hellip;":8230,"hercon;":8889,"homtht;":8763,"horbar;":8213,"hslash;":8463,"hstrok;":295,"hybull;":8259,"hyphen;":8208,"iacute;":237,"igrave;":236,"iiiint;":10764,"iinfin;":10716,"incare;":8453,"inodot;":305,"intcal;":8890,"iquest;":191,"isinsv;":8947,"itilde;":297,"jsercy;":1112,"kappav;":1008,"kcedil;":311,"kgreen;":312,"lAtail;":10523,"lacute;":314,"lagran;":8466,"lambda;":955,"langle;":10216,"larrfs;":10525,"larrhk;":8617,"larrlp;":8619,"larrpl;":10553,"larrtl;":8610,"latail;":10521,"lbrace;":123,"lbrack;":91,"lcaron;":318,"lcedil;":316,"ldquor;":8222,"lesdot;":10879,"lesges;":10899,"lfisht;":10620,"lfloor;":8970,"lharul;":10602,"llhard;":10603,"lmidot;":320,"lmoust;":9136,"loplus;":10797,"lowast;":8727,"lowbar;":95,"lparlt;":10643,"lrhard;":10605,"lsaquo;":8249,"lsquor;":8218,"lstrok;":322,"lthree;":8907,"ltimes;":8905,"ltlarr;":10614,"ltrPar;":10646,"mapsto;":8614,"marker;":9646,"mcomma;":10793,"midast;":42,"midcir;":10992,"middot;":183,"minusb;":8863,"minusd;":8760,"mnplus;":8723,"models;":8871,"mstpos;":8766,"nVDash;":8879,"nVdash;":8878,"nacute;":324,"nbumpe;":8783,"ncaron;":328,"ncedil;":326,"nearhk;":10532,"nequiv;":8802,"nesear;":10536,"nexist;":8708,"nltrie;":8940,"notinE;":8953,"nparsl;":11005,"nprcue;":8928,"nrarrc;":10547,"nrarrw;":8605,"nrtrie;":8941,"nsccue;":8929,"nsimeq;":8772,"ntilde;":241,"numero;":8470,"nvDash;":8877,"nvHarr;":10500,"nvdash;":8876,"nvlArr;":10498,"nvrArr;":10499,"nwarhk;":10531,"nwnear;":10535,"oacute;":243,"odblac;":337,"odsold;":10684,"ograve;":242,"ominus;":8854,"origof;":8886,"oslash;":248,"otilde;":245,"otimes;":8855,"parsim;":10995,"percnt;":37,"period;":46,"permil;":8240,"phmmat;":8499,"planck;":8463,"plankv;":8463,"plusdo;":8724,"plusdu;":10789,"plusmn;":177,"preceq;":10927,"primes;":8473,"prnsim;":8936,"propto;":8733,"prurel;":8880,"puncsp;":8200,"qprime;":8279,"rAtail;":10524,"racute;":341,"rangle;":10217,"rarrap;":10613,"rarrfs;":10526,"rarrhk;":8618,"rarrlp;":8620,"rarrpl;":10565,"rarrtl;":8611,"ratail;":10522,"rbrace;":125,"rbrack;":93,"rcaron;":345,"rcedil;":343,"rdquor;":8221,"rfisht;":10621,"rfloor;":8971,"rharul;":10604,"rmoust;":9137,"roplus;":10798,"rpargt;":10644,"rsaquo;":8250,"rsquor;":8217,"rthree;":8908,"rtimes;":8906,"sacute;":347,"scaron;":353,"scedil;":351,"scnsim;":8937,"searhk;":10533,"seswar;":10537,"sfrown;":8994,"shchcy;":1097,"sigmaf;":962,"sigmav;":962,"simdot;":10858,"smashp;":10803,"softcy;":1100,"solbar;":9023,"spades;":9824,"sqcaps;":8851,"sqcups;":8852,"sqsube;":8849,"sqsupe;":8850,"square;":9633,"squarf;":9642,"ssetmn;":8726,"ssmile;":8995,"sstarf;":8902,"subdot;":10941,"subset;":8834,"subsim;":10951,"subsub;":10965,"subsup;":10963,"succeq;":10928,"supdot;":10942,"supset;":8835,"supsim;":10952,"supsub;":10964,"supsup;":10966,"swarhk;":10534,"swnwar;":10538,"target;":8982,"tcaron;":357,"tcedil;":355,"telrec;":8981,"there4;":8756,"thetav;":977,"thinsp;":8201,"thksim;":8764,"timesb;":8864,"timesd;":10800,"topbot;":9014,"topcir;":10993,"tprime;":8244,"tridot;":9708,"tstrok;":359,"uacute;":250,"ubreve;":365,"udblac;":369,"ufisht;":10622,"ugrave;":249,"ulcorn;":8988,"ulcrop;":8975,"urcorn;":8989,"urcrop;":8974,"utilde;":361,"vangrt;":10652,"varphi;":981,"varrho;":1009,"veebar;":8891,"vellip;":8942,"verbar;":124,"vsubnE;":10955,"vsubne;":8842,"vsupnE;":10956,"vsupne;":8843,"wedbar;":10847,"wedgeq;":8793,"weierp;":8472,"wreath;":8768,"xoplus;":10753,"xotime;":10754,"xsqcup;":10758,"xuplus;":10756,"xwedge;":8896,"yacute;":253,"zacute;":378,"zcaron;":382,"zeetrf;":8488,"AElig;":198,Aacute:193,"Acirc;":194,Agrave:192,"Alpha;":913,"Amacr;":256,"Aogon;":260,"Aring;":197,Atilde:195,"Breve;":728,Ccedil:199,"Ccirc;":264,"Colon;":8759,"Cross;":10799,"Dashv;":10980,"Delta;":916,Eacute:201,"Ecirc;":202,Egrave:200,"Emacr;":274,"Eogon;":280,"Equal;":10869,"Gamma;":915,"Gcirc;":284,"Hacek;":711,"Hcirc;":292,"IJlig;":306,Iacute:205,"Icirc;":206,Igrave:204,"Imacr;":298,"Iogon;":302,"Iukcy;":1030,"Jcirc;":308,"Jukcy;":1028,"Kappa;":922,Ntilde:209,"OElig;":338,Oacute:211,"Ocirc;":212,Ograve:210,"Omacr;":332,"Omega;":937,Oslash:216,Otilde:213,"Prime;":8243,"RBarr;":10512,"Scirc;":348,"Sigma;":931,"THORN;":222,"TRADE;":8482,"TSHcy;":1035,"Theta;":920,"Tilde;":8764,Uacute:218,"Ubrcy;":1038,"Ucirc;":219,Ugrave:217,"Umacr;":362,"Union;":8899,"Uogon;":370,"UpTee;":8869,"Uring;":366,"VDash;":8875,"Vdash;":8873,"Wcirc;":372,"Wedge;":8896,Yacute:221,"Ycirc;":374,aacute:225,"acirc;":226,"acute;":180,"aelig;":230,agrave:224,"aleph;":8501,"alpha;":945,"amacr;":257,"amalg;":10815,"angle;":8736,"angrt;":8735,"angst;":197,"aogon;":261,"aring;":229,"asymp;":8776,atilde:227,"awint;":10769,"bcong;":8780,"bdquo;":8222,"bepsi;":1014,"blank;":9251,"blk12;":9618,"blk14;":9617,"blk34;":9619,"block;":9608,"boxDL;":9559,"boxDR;":9556,"boxDl;":9558,"boxDr;":9555,"boxHD;":9574,"boxHU;":9577,"boxHd;":9572,"boxHu;":9575,"boxUL;":9565,"boxUR;":9562,"boxUl;":9564,"boxUr;":9561,"boxVH;":9580,"boxVL;":9571,"boxVR;":9568,"boxVh;":9579,"boxVl;":9570,"boxVr;":9567,"boxdL;":9557,"boxdR;":9554,"boxdl;":9488,"boxdr;":9484,"boxhD;":9573,"boxhU;":9576,"boxhd;":9516,"boxhu;":9524,"boxuL;":9563,"boxuR;":9560,"boxul;":9496,"boxur;":9492,"boxvH;":9578,"boxvL;":9569,"boxvR;":9566,"boxvh;":9532,"boxvl;":9508,"boxvr;":9500,"breve;":728,brvbar:166,"bsemi;":8271,"bsime;":8909,"bsolb;":10693,"bumpE;":10926,"bumpe;":8783,"caret;":8257,"caron;":711,"ccaps;":10829,ccedil:231,"ccirc;":265,"ccups;":10828,"cedil;":184,"check;":10003,"clubs;":9827,"colon;":58,"comma;":44,"crarr;":8629,"cross;":10007,"csube;":10961,"csupe;":10962,"ctdot;":8943,"cuepr;":8926,"cuesc;":8927,"cupor;":10821,curren:164,"cuvee;":8910,"cuwed;":8911,"cwint;":8753,"dashv;":8867,"dblac;":733,"ddarr;":8650,"delta;":948,"dharl;":8643,"dharr;":8642,"diams;":9830,"disin;":8946,divide:247,"doteq;":8784,"dtdot;":8945,"dtrif;":9662,"duarr;":8693,"duhar;":10607,"eDDot;":10871,eacute:233,"ecirc;":234,"efDot;":8786,egrave:232,"emacr;":275,"empty;":8709,"eogon;":281,"eplus;":10865,"epsiv;":1013,"eqsim;":8770,"equiv;":8801,"erDot;":8787,"erarr;":10609,"esdot;":8784,"exist;":8707,"fflig;":64256,"filig;":64257,"fjlig;":102,"fllig;":64258,"fltns;":9649,"forkv;":10969,frac12:189,frac14:188,frac34:190,"frasl;":8260,"frown;":8994,"gamma;":947,"gcirc;":285,"gescc;":10921,"gimel;":8503,"gneqq;":8809,"gnsim;":8935,"grave;":96,"gsime;":10894,"gsiml;":10896,"gtcir;":10874,"gtdot;":8919,"harrw;":8621,"hcirc;":293,"hoarr;":8703,iacute:237,"icirc;":238,"iexcl;":161,igrave:236,"iiint;":8749,"iiota;":8489,"ijlig;":307,"imacr;":299,"image;":8465,"imath;":305,"imped;":437,"infin;":8734,"iogon;":303,"iprod;":10812,iquest:191,"isinE;":8953,"isins;":8948,"isinv;":8712,"iukcy;":1110,"jcirc;":309,"jmath;":567,"jukcy;":1108,"kappa;":954,"lAarr;":8666,"lBarr;":10510,"langd;":10641,"laquo;":171,"larrb;":8676,"lates;":10925,"lbarr;":10508,"lbbrk;":10098,"lbrke;":10635,"lceil;":8968,"ldquo;":8220,"lescc;":10920,"lhard;":8637,"lharu;":8636,"lhblk;":9604,"llarr;":8647,"lltri;":9722,"lneqq;":8808,"lnsim;":8934,"loang;":10220,"loarr;":8701,"lobrk;":10214,"lopar;":10629,"lrarr;":8646,"lrhar;":8651,"lrtri;":8895,"lsime;":10893,"lsimg;":10895,"lsquo;":8216,"ltcir;":10873,"ltdot;":8918,"ltrie;":8884,"ltrif;":9666,"mDDot;":8762,"mdash;":8212,"micro;":181,middot:183,"minus;":8722,"mumap;":8888,"nabla;":8711,"napid;":8779,"napos;":329,"natur;":9838,"nbump;":8782,"ncong;":8775,"ndash;":8211,"neArr;":8663,"nearr;":8599,"nedot;":8784,"nesim;":8770,"ngeqq;":8807,"ngsim;":8821,"nhArr;":8654,"nharr;":8622,"nhpar;":10994,"nlArr;":8653,"nlarr;":8602,"nleqq;":8806,"nless;":8814,"nlsim;":8820,"nltri;":8938,"notin;":8713,"notni;":8716,"npart;":8706,"nprec;":8832,"nrArr;":8655,"nrarr;":8603,"nrtri;":8939,"nsime;":8772,"nsmid;":8740,"nspar;":8742,"nsubE;":10949,"nsube;":8840,"nsucc;":8833,"nsupE;":10950,"nsupe;":8841,ntilde:241,"numsp;":8199,"nvsim;":8764,"nwArr;":8662,"nwarr;":8598,oacute:243,"ocirc;":244,"odash;":8861,"oelig;":339,"ofcir;":10687,ograve:242,"ohbar;":10677,"olarr;":8634,"olcir;":10686,"oline;":8254,"omacr;":333,"omega;":969,"operp;":10681,"oplus;":8853,"orarr;":8635,"order;":8500,oslash:248,otilde:245,"ovbar;":9021,"parsl;":11005,"phone;":9742,"plusb;":8862,"pluse;":10866,plusmn:177,"pound;":163,"prcue;":8828,"prime;":8242,"prnap;":10937,"prsim;":8830,"quest;":63,"rAarr;":8667,"rBarr;":10511,"radic;":8730,"rangd;":10642,"range;":10661,"raquo;":187,"rarrb;":8677,"rarrc;":10547,"rarrw;":8605,"ratio;":8758,"rbarr;":10509,"rbbrk;":10099,"rbrke;":10636,"rceil;":8969,"rdquo;":8221,"reals;":8477,"rhard;":8641,"rharu;":8640,"rlarr;":8644,"rlhar;":8652,"rnmid;":10990,"roang;":10221,"roarr;":8702,"robrk;":10215,"ropar;":10630,"rrarr;":8649,"rsquo;":8217,"rtrie;":8885,"rtrif;":9656,"sbquo;":8218,"sccue;":8829,"scirc;":349,"scnap;":10938,"scsim;":8831,"sdotb;":8865,"sdote;":10854,"seArr;":8664,"searr;":8600,"setmn;":8726,"sharp;":9839,"sigma;":963,"simeq;":8771,"simgE;":10912,"simlE;":10911,"simne;":8774,"slarr;":8592,"smile;":8995,"smtes;":10924,"sqcap;":8851,"sqcup;":8852,"sqsub;":8847,"sqsup;":8848,"srarr;":8594,"starf;":9733,"strns;":175,"subnE;":10955,"subne;":8842,"supnE;":10956,"supne;":8843,"swArr;":8665,"swarr;":8601,"szlig;":223,"theta;":952,"thkap;":8776,"thorn;":254,"tilde;":732,"times;":215,"trade;":8482,"trisb;":10701,"tshcy;":1115,"twixt;":8812,uacute:250,"ubrcy;":1118,"ucirc;":251,"udarr;":8645,"udhar;":10606,ugrave:249,"uharl;":8639,"uharr;":8638,"uhblk;":9600,"ultri;":9720,"umacr;":363,"uogon;":371,"uplus;":8846,"upsih;":978,"uring;":367,"urtri;":9721,"utdot;":8944,"utrif;":9652,"uuarr;":8648,"vBarv;":10985,"vDash;":8872,"varpi;":982,"vdash;":8866,"veeeq;":8794,"vltri;":8882,"vnsub;":8834,"vnsup;":8835,"vprop;":8733,"vrtri;":8883,"wcirc;":373,"wedge;":8743,"xcirc;":9711,"xdtri;":9661,"xhArr;":10234,"xharr;":10231,"xlArr;":10232,"xlarr;":10229,"xodot;":10752,"xrArr;":10233,"xrarr;":10230,"xutri;":9651,yacute:253,"ycirc;":375,AElig:198,Acirc:194,"Aopf;":120120,Aring:197,"Ascr;":119964,"Auml;":196,"Barv;":10983,"Beta;":914,"Bopf;":120121,"Bscr;":8492,"CHcy;":1063,"COPY;":169,"Cdot;":266,"Copf;":8450,"Cscr;":119966,"DJcy;":1026,"DScy;":1029,"DZcy;":1039,"Darr;":8609,"Dopf;":120123,"Dscr;":119967,Ecirc:202,"Edot;":278,"Eopf;":120124,"Escr;":8496,"Esim;":10867,"Euml;":203,"Fopf;":120125,"Fscr;":8497,"GJcy;":1027,"Gdot;":288,"Gopf;":120126,"Gscr;":119970,"Hopf;":8461,"Hscr;":8459,"IEcy;":1045,"IOcy;":1025,Icirc:206,"Idot;":304,"Iopf;":120128,"Iota;":921,"Iscr;":8464,"Iuml;":207,"Jopf;":120129,"Jscr;":119973,"KHcy;":1061,"KJcy;":1036,"Kopf;":120130,"Kscr;":119974,"LJcy;":1033,"Lang;":10218,"Larr;":8606,"Lopf;":120131,"Lscr;":8466,"Mopf;":120132,"Mscr;":8499,"NJcy;":1034,"Nopf;":8469,"Nscr;":119977,Ocirc:212,"Oopf;":120134,"Oscr;":119978,"Ouml;":214,"Popf;":8473,"Pscr;":119979,"QUOT;":34,"Qopf;":8474,"Qscr;":119980,"Rang;":10219,"Rarr;":8608,"Ropf;":8477,"Rscr;":8475,"SHcy;":1064,"Sopf;":120138,"Sqrt;":8730,"Sscr;":119982,"Star;":8902,THORN:222,"TScy;":1062,"Topf;":120139,"Tscr;":119983,"Uarr;":8607,Ucirc:219,"Uopf;":120140,"Upsi;":978,"Uscr;":119984,"Uuml;":220,"Vbar;":10987,"Vert;":8214,"Vopf;":120141,"Vscr;":119985,"Wopf;":120142,"Wscr;":119986,"Xopf;":120143,"Xscr;":119987,"YAcy;":1071,"YIcy;":1031,"YUcy;":1070,"Yopf;":120144,"Yscr;":119988,"Yuml;":376,"ZHcy;":1046,"Zdot;":379,"Zeta;":918,"Zopf;":8484,"Zscr;":119989,acirc:226,acute:180,aelig:230,"andd;":10844,"andv;":10842,"ange;":10660,"aopf;":120146,"apid;":8779,"apos;":39,aring:229,"ascr;":119990,"auml;":228,"bNot;":10989,"bbrk;":9141,"beta;":946,"beth;":8502,"bnot;":8976,"bopf;":120147,"boxH;":9552,"boxV;":9553,"boxh;":9472,"boxv;":9474,"bscr;":119991,"bsim;":8765,"bsol;":92,"bull;":8226,"bump;":8782,"caps;":8745,"cdot;":267,cedil:184,"cent;":162,"chcy;":1095,"cirE;":10691,"circ;":710,"cire;":8791,"comp;":8705,"cong;":8773,"copf;":120148,"copy;":169,"cscr;":119992,"csub;":10959,"csup;":10960,"cups;":8746,"dArr;":8659,"dHar;":10597,"darr;":8595,"dash;":8208,"diam;":8900,"djcy;":1106,"dopf;":120149,"dscr;":119993,"dscy;":1109,"dsol;":10742,"dtri;":9663,"dzcy;":1119,"eDot;":8785,"ecir;":8790,ecirc:234,"edot;":279,"emsp;":8195,"ensp;":8194,"eopf;":120150,"epar;":8917,"epsi;":949,"escr;":8495,"esim;":8770,"euml;":235,"euro;":8364,"excl;":33,"flat;":9837,"fnof;":402,"fopf;":120151,"fork;":8916,"fscr;":119995,"gdot;":289,"geqq;":8807,"gesl;":8923,"gjcy;":1107,"gnap;":10890,"gneq;":10888,"gopf;":120152,"gscr;":8458,"gsim;":8819,"gtcc;":10919,"gvnE;":8809,"hArr;":8660,"half;":189,"harr;":8596,"hbar;":8463,"hopf;":120153,"hscr;":119997,icirc:238,"iecy;":1077,iexcl:161,"imof;":8887,"iocy;":1105,"iopf;":120154,"iota;":953,"iscr;":119998,"isin;":8712,"iuml;":239,"jopf;":120155,"jscr;":119999,"khcy;":1093,"kjcy;":1116,"kopf;":120156,"kscr;":120000,"lArr;":8656,"lHar;":10594,"lang;":10216,laquo:171,"larr;":8592,"late;":10925,"lcub;":123,"ldca;":10550,"ldsh;":8626,"leqq;":8806,"lesg;":8922,"ljcy;":1113,"lnap;":10889,"lneq;":10887,"lopf;":120157,"lozf;":10731,"lpar;":40,"lscr;":120001,"lsim;":8818,"lsqb;":91,"ltcc;":10918,"ltri;":9667,"lvnE;":8808,"macr;":175,"male;":9794,"malt;":10016,micro:181,"mlcp;":10971,"mldr;":8230,"mopf;":120158,"mscr;":120002,"nGtv;":8811,"nLtv;":8810,"nang;":8736,"napE;":10864,"nbsp;":160,"ncap;":10819,"ncup;":10818,"ngeq;":8817,"nges;":10878,"ngtr;":8815,"nisd;":8954,"njcy;":1114,"nldr;":8229,"nleq;":8816,"nles;":10877,"nmid;":8740,"nopf;":120159,"npar;":8742,"npre;":10927,"nsce;":10928,"nscr;":120003,"nsim;":8769,"nsub;":8836,"nsup;":8837,"ntgl;":8825,"ntlg;":8824,"nvap;":8781,"nvge;":8805,"nvgt;":62,"nvle;":8804,"nvlt;":60,"oast;":8859,"ocir;":8858,ocirc:244,"odiv;":10808,"odot;":8857,"ogon;":731,"oint;":8750,"omid;":10678,"oopf;":120160,"opar;":10679,"ordf;":170,"ordm;":186,"oror;":10838,"oscr;":8500,"osol;":8856,"ouml;":246,"para;":182,"part;":8706,"perp;":8869,"phiv;":981,"plus;":43,"popf;":120161,pound:163,"prap;":10935,"prec;":8826,"prnE;":10933,"prod;":8719,"prop;":8733,"pscr;":120005,"qint;":10764,"qopf;":120162,"qscr;":120006,"quot;":34,"rArr;":8658,"rHar;":10596,"race;":8765,"rang;":10217,raquo:187,"rarr;":8594,"rcub;":125,"rdca;":10551,"rdsh;":8627,"real;":8476,"rect;":9645,"rhov;":1009,"ring;":730,"ropf;":120163,"rpar;":41,"rscr;":120007,"rsqb;":93,"rtri;":9657,"scap;":10936,"scnE;":10934,"sdot;":8901,"sect;":167,"semi;":59,"sext;":10038,"shcy;":1096,"sime;":8771,"simg;":10910,"siml;":10909,"smid;":8739,"smte;":10924,"solb;":10692,"sopf;":120164,"spar;":8741,"squf;":9642,"sscr;":120008,"star;":9734,"subE;":10949,"sube;":8838,"succ;":8827,"sung;":9834,"sup1;":185,"sup2;":178,"sup3;":179,"supE;":10950,"supe;":8839,szlig:223,"tbrk;":9140,"tdot;":8411,thorn:254,times:215,"tint;":8749,"toea;":10536,"topf;":120165,"tosa;":10537,"trie;":8796,"tscr;":120009,"tscy;":1094,"uArr;":8657,"uHar;":10595,"uarr;":8593,ucirc:251,"uopf;":120166,"upsi;":965,"uscr;":120010,"utri;":9653,"uuml;":252,"vArr;":8661,"vBar;":10984,"varr;":8597,"vert;":124,"vopf;":120167,"vscr;":120011,"wopf;":120168,"wscr;":120012,"xcap;":8898,"xcup;":8899,"xmap;":10236,"xnis;":8955,"xopf;":120169,"xscr;":120013,"xvee;":8897,"yacy;":1103,"yicy;":1111,"yopf;":120170,"yscr;":120014,"yucy;":1102,"yuml;":255,"zdot;":380,"zeta;":950,"zhcy;":1078,"zopf;":120171,"zscr;":120015,"zwnj;":8204,"AMP;":38,"Acy;":1040,"Afr;":120068,"And;":10835,Auml:196,"Bcy;":1041,"Bfr;":120069,COPY:169,"Cap;":8914,"Cfr;":8493,"Chi;":935,"Cup;":8915,"Dcy;":1044,"Del;":8711,"Dfr;":120071,"Dot;":168,"ENG;":330,"ETH;":208,"Ecy;":1069,"Efr;":120072,"Eta;":919,Euml:203,"Fcy;":1060,"Ffr;":120073,"Gcy;":1043,"Gfr;":120074,"Hat;":94,"Hfr;":8460,"Icy;":1048,"Ifr;":8465,"Int;":8748,Iuml:207,"Jcy;":1049,"Jfr;":120077,"Kcy;":1050,"Kfr;":120078,"Lcy;":1051,"Lfr;":120079,"Lsh;":8624,"Map;":10501,"Mcy;":1052,"Mfr;":120080,"Ncy;":1053,"Nfr;":120081,"Not;":10988,"Ocy;":1054,"Ofr;":120082,Ouml:214,"Pcy;":1055,"Pfr;":120083,"Phi;":934,"Psi;":936,QUOT:34,"Qfr;":120084,"REG;":174,"Rcy;":1056,"Rfr;":8476,"Rho;":929,"Rsh;":8625,"Scy;":1057,"Sfr;":120086,"Sub;":8912,"Sum;":8721,"Sup;":8913,"Tab;":9,"Tau;":932,"Tcy;":1058,"Tfr;":120087,"Ucy;":1059,"Ufr;":120088,Uuml:220,"Vcy;":1042,"Vee;":8897,"Vfr;":120089,"Wfr;":120090,"Xfr;":120091,"Ycy;":1067,"Yfr;":120092,"Zcy;":1047,"Zfr;":8488,"acE;":8766,"acd;":8767,"acy;":1072,"afr;":120094,"amp;":38,"and;":8743,"ang;":8736,"apE;":10864,"ape;":8778,"ast;":42,auml:228,"bcy;":1073,"bfr;":120095,"bne;":61,"bot;":8869,"cap;":8745,cent:162,"cfr;":120096,"chi;":967,"cir;":9675,copy:169,"cup;":8746,"dcy;":1076,"deg;":176,"dfr;":120097,"die;":168,"div;":247,"dot;":729,"ecy;":1101,"efr;":120098,"egs;":10902,"ell;":8467,"els;":10901,"eng;":331,"eta;":951,"eth;":240,euml:235,"fcy;":1092,"ffr;":120099,"gEl;":10892,"gap;":10886,"gcy;":1075,"gel;":8923,"geq;":8805,"ges;":10878,"gfr;":120100,"ggg;":8921,"glE;":10898,"gla;":10917,"glj;":10916,"gnE;":8809,"gne;":10888,"hfr;":120101,"icy;":1080,"iff;":8660,"ifr;":120102,"int;":8747,iuml:239,"jcy;":1081,"jfr;":120103,"kcy;":1082,"kfr;":120104,"lEg;":10891,"lap;":10885,"lat;":10923,"lcy;":1083,"leg;":8922,"leq;":8804,"les;":10877,"lfr;":120105,"lgE;":10897,"lnE;":8808,"lne;":10887,"loz;":9674,"lrm;":8206,"lsh;":8624,macr:175,"map;":8614,"mcy;":1084,"mfr;":120106,"mho;":8487,"mid;":8739,"nGg;":8921,"nGt;":8811,"nLl;":8920,"nLt;":8810,"nap;":8777,nbsp:160,"ncy;":1085,"nfr;":120107,"ngE;":8807,"nge;":8817,"ngt;":8815,"nis;":8956,"niv;":8715,"nlE;":8806,"nle;":8816,"nlt;":8814,"not;":172,"npr;":8832,"nsc;":8833,"num;":35,"ocy;":1086,"ofr;":120108,"ogt;":10689,"ohm;":937,"olt;":10688,"ord;":10845,ordf:170,ordm:186,"orv;":10843,ouml:246,"par;":8741,para:182,"pcy;":1087,"pfr;":120109,"phi;":966,"piv;":982,"prE;":10931,"pre;":10927,"psi;":968,"qfr;":120110,quot:34,"rcy;":1088,"reg;":174,"rfr;":120111,"rho;":961,"rlm;":8207,"rsh;":8625,"scE;":10932,"sce;":10928,"scy;":1089,sect:167,"sfr;":120112,"shy;":173,"sim;":8764,"smt;":10922,"sol;":47,"squ;":9633,"sub;":8834,"sum;":8721,sup1:185,sup2:178,sup3:179,"sup;":8835,"tau;":964,"tcy;":1090,"tfr;":120113,"top;":8868,"ucy;":1091,"ufr;":120114,"uml;":168,uuml:252,"vcy;":1074,"vee;":8744,"vfr;":120115,"wfr;":120116,"xfr;":120117,"ycy;":1099,"yen;":165,"yfr;":120118,yuml:255,"zcy;":1079,"zfr;":120119,"zwj;":8205,AMP:38,"DD;":8517,ETH:208,"GT;":62,"Gg;":8921,"Gt;":8811,"Im;":8465,"LT;":60,"Ll;":8920,"Lt;":8810,"Mu;":924,"Nu;":925,"Or;":10836,"Pi;":928,"Pr;":10939,REG:174,"Re;":8476,"Sc;":10940,"Xi;":926,"ac;":8766,"af;":8289,amp:38,"ap;":8776,"dd;":8518,deg:176,"ee;":8519,"eg;":10906,"el;":10905,eth:240,"gE;":8807,"ge;":8805,"gg;":8811,"gl;":8823,"gt;":62,"ic;":8291,"ii;":8520,"in;":8712,"it;":8290,"lE;":8806,"le;":8804,"lg;":8822,"ll;":8810,"lt;":60,"mp;":8723,"mu;":956,"ne;":8800,"ni;":8715,not:172,"nu;":957,"oS;":9416,"or;":8744,"pi;":960,"pm;":177,"pr;":8826,reg:174,"rx;":8478,"sc;":8827,shy:173,uml:168,"wp;":8472,"wr;":8768,"xi;":958,yen:165,GT:62,LT:60,gt:62,lt:60},Ni=Zf;var eh=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376];function th(e,t){if(t&&!e.endsWith(";"))return`${e}\\b(?!=)`;return e}function Tp(e){let n=Object.keys(Ni).map((r)=>th(r,e));return new RegExp(`&(#(?:x[a-fA-F\\d]+|\\d+)(?:;)?|${n.join("|")})`,"g")}var Di,Ii;function nh(e){if(e){if(!Ii)Ii=Tp(!0);return Ii}if(!Di)Di=Tp(!1);return Di}var vp=0;function rh(e){if(e===10)return 32;if(e<128)return e;if(e<=159)return eh[e-128];if(e<55296)return e;if(e<=57343)return vp;if(e<=65535)return e;if(e>=65536&&e<=131071)return e;if(e>=131072&&e<=196607)return e;if(e>=917504&&e<=917631||e>=917760&&e<=917999)return e;return vp}function _i(e,t){if(e.indexOf("&")===-1)return e;return e.replace(nh(t),(n,r)=>{let i;if(r[0]!=="#")i=Ni[r];else if(r[1]==="x")i=Number.parseInt(r.substring(2),16);else i=Number.parseInt(r.substring(1),10);if(!i)return n;return String.fromCodePoint(rh(i))})}class pn extends Error{constructor(e){super(`sveld's template parser doesn't support ${e} yet.`);this.name="TemplateParseNotImplementedError"}}var ih=/<\/script\s*>/g,sh=/<\/script\s*>/y,ah=/[^\n]/g,oh=new Set(["server","client","worker","test","default"]);function Sp(e,t,n){let r=e.index,i=e.readUntil(ih);if(e.index>=e.source.length)throw Error("sveld: unclosed <script> tag");let a=e.source.slice(0,r).replace(ah," ")+i;e.read(sh);let s=np(a,e.isTypeScript,e.root.comments);s.start=r;let p="default";for(let c of n){if(oh.has(c.name))throw Error(`sveld: "${c.name}" is a reserved <script> attribute name.`);if(c.name==="module"){if(c.value!==!0)throw Error("sveld: <script module> does not take a value.");p="module"}if(c.name==="context"){let d=c.value;if(d===!0||!Array.isArray(d)||d.length!==1||d[0].type!=="Text")throw Error("sveld: context attribute must be a plain string.");if(d[0].data!=="module")throw Error('sveld: only context="module" is valid.');p="module"}}return{type:"Script",start:t,end:e.index,context:p,content:s,attributes:n}}function Ep(e,t,n){let r=e.index,i=e.source.indexOf("</style",e.index),a=i===-1?e.source.length:i;return e.index=a,e.eat("</style",!0),e.read(/\s*>/y),{type:"StyleSheet",start:t,end:e.index,attributes:n,children:[],comments:[],content:{start:r,end:a,styles:e.source.slice(r,a),comment:null}}}var ph=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]);function Li(e){return ph.has(e)||e.charCodeAt(0)===33&&e.toLowerCase()==="!doctype"}var ch="^[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}]*)?$",lh=new RegExp(ch,"u");function Cp(e){return lh.test(e)}var uh=/(?:"([^"]*)"|'([^'])*'|([^>\s]+))/y,Np=/["']/y,dh=/(\/>|[\s"'=<>`])/y,Ri=/<\/textarea(\s[^>]*)?>/iy,fh=/^![a-zA-Z]+$/,hh=/^[a-zA-Z][a-zA-Z0-9]*:[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$/,mh=/^(?:\p{Lu}[$\u200c\u200d\p{ID_Continue}.]*|\p{ID_Start}[$\u200c\u200d\p{ID_Continue}]*(?:\.[$\u200c\u200d\p{ID_Continue}]+)+)$/u,Dp={"svelte:head":"SvelteHead","svelte:options":"SvelteOptions","svelte:window":"SvelteWindow","svelte:document":"SvelteDocument","svelte:body":"SvelteBody"},Pp={...Dp,"svelte:element":"SvelteElement","svelte:component":"SvelteComponent","svelte:self":"SvelteSelf","svelte:fragment":"SvelteFragment","svelte:boundary":"SvelteBoundary"};function yh(e){let t=e.charCodeAt(0);if(t<97||t>122)return!1;for(let n=1;n<e.length;n++){let r=e.charCodeAt(n);if((r<97||r>122)&&(r<48||r>57))return!1}return!0}function gh(e){if(yh(e))return!0;if(fh.test(e))return!0;if(hh.test(e))return!0;return Cp(e)}function xh(e){let t=e.charCodeAt(0);if(t>=97&&t<=122&&!e.includes("."))return!1;return!0}function bh(e){return`Svelte${e.slice(7).split("-").map((n)=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}`}function Th(e){for(let t=e.length-1;t>=0;t--){let n=e[t].type;if(n==="SvelteHead")return!0;if(n==="RegularElement"||n==="Component")return!1}return!1}function vh(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.type==="RegularElement"&&n.attributes?.some((r)=>r.type==="Attribute"&&r.name==="shadowrootmode"))return!0}return!1}function Ap(e){let{source:t,index:n}=e;if(n>=t.length)throw new it("Unexpected end of input",t.length);let r=n;while(r<t.length){let i=t.charCodeAt(r);if(i===47||i===62||ht(i))break;r++}return e.index=r,{name:t.slice(n,r),start:n,end:r}}function Ip(e){let{source:t,index:n}=e;if(n>=t.length)throw new it("Unexpected end of input",t.length);let r=n;while(r<t.length){let i=t.charCodeAt(r);if(i===61||i===47||i===62||i===34||i===39||ht(i))break;r++}return e.index=r,{name:t.slice(n,r),start:n,end:r}}function Sh(e){let t=e.index;if(e.eat("//")){let n=e.readUntilString(`
45
+ `),r=e.index;e.root.comments.push({type:"Line",value:n,start:t,end:r});return}if(e.eat("/*")){let n=e.readUntilString("*/");e.eat("*/");let r=e.index;e.root.comments.push({type:"Block",value:n,start:t,end:r})}}function Eh(e){if(e==="use")return"UseDirective";if(e==="animate")return"AnimateDirective";if(e==="bind")return"BindDirective";if(e==="class")return"ClassDirective";if(e==="style")return"StyleDirective";if(e==="on")return"OnDirective";if(e==="let")return"LetDirective";if(e==="in"||e==="out"||e==="transition")return"TransitionDirective";return!1}function _p(e,t,n){let r={start:e.index,end:-1,type:"Text",raw:"",data:""},i=[],a=(s)=>{if(s>r.start)r.raw=e.source.slice(r.start,s),r.data=_i(r.raw,!0),r.end=s,i.push(r)};while(e.index<e.source.length){if(t())return a(e.index),i;if(e.eat("{")){if(e.match("#")||e.match("@"))throw new pn("blocks/tags inside attribute value sequences");let s=e.index-1;a(s),e.allowWhitespace();let p=ee(e);e.allowWhitespace(),e.eat("}",!0),i.push({type:"ExpressionTag",start:s,end:e.index,expression:p}),r={start:e.index,end:-1,type:"Text",raw:"",data:""}}else{let s=e.index+1;if(n!==void 0){let p=e.source;while(s<p.length){let c=p.charCodeAt(s);if(c===123||c===n)break;s++}}e.index=s}}throw new pn("unterminated attribute value / sequence (loose mode)")}function Ch(e){let t=e.eat("'")?"'":e.eat('"')?'"':null;if(t&&e.eat(t))return[{start:e.index-1,end:e.index-1,type:"Text",raw:"",data:""}];let n=_p(e,()=>{if(t)return e.match(t);return!!e.matchRegex(dh)},t===null?void 0:t.charCodeAt(0));if(n.length===0&&!t)throw Error("sveld: expected attribute value");if(t)e.index+=1;if(t||n.length>1||n[0].type==="Text")return n;return n[0]}function Mi(e,t,n,r){return{type:"Attribute",start:t,end:n,name:e,value:r}}function Ph(e){let t=e.index,n=Ip(e);if(!n.name)return null;let r=!0;if(e.eat("=")){e.allowWhitespace();let i=e.matchRegex(uh);if(!i)throw Error("sveld: expected attribute value");e.index+=i.length;let a=i[0]==='"'||i[0]==="'";if(a)i=i.slice(1,-1);r=[{start:e.index-i.length-(a?1:0),end:a?e.index-1:e.index,type:"Text",raw:i,data:_i(i,!0)}]}if(e.matchRegex(Np))throw Error("sveld: expected '='");return Mi(n.name,t,e.index,r)}function Ah(e){while(!0){let p=e.index;if(Sh(e),e.index===p)break;e.allowWhitespace()}let t=e.index;if(e.eat("{")){if(e.allowWhitespace(),e.eat("@attach")){e.requireWhitespace();let d=ee(e);return e.allowWhitespace(),e.eat("}",!0),{type:"AttachTag",start:t,end:e.index,expression:d}}if(e.eat("...")){let d=ee(e);return e.allowWhitespace(),e.eat("}",!0),{type:"SpreadAttribute",start:t,end:e.index,expression:d}}let p=e.readIdentifierName();if(p.name==="")throw Error("sveld: empty attribute shorthand");e.allowWhitespace(),e.eat("}",!0);let c={type:"ExpressionTag",start:p.start,end:p.end,expression:p};return Mi(p.name,t,e.index,c)}let n=Ip(e);if(!n.name)return null;let r=e.index;e.allowWhitespace();let i=n.name.indexOf(":"),a=i!==-1&&Eh(n.name.slice(0,i)),s=!0;if(e.eat("="))if(e.allowWhitespace(),e.source[e.index]==="/"&&e.source[e.index+1]===">"){let p=e.index;e.index++,s=[{start:p,end:p+1,type:"Text",raw:"/",data:"/"}],r=e.index}else s=Ch(e),r=e.index;else if(e.matchRegex(Np))throw Error("sveld: expected '='");if(a){let p=n.name.slice(i+1).split("|",1)[0];if(p==="")throw Error("sveld: directive missing a name");if(a==="StyleDirective")return{start:t,end:r,type:a,name:p,value:s};let c=s===!0?void 0:Array.isArray(s)?s[0]:s,d=null;if(c){if((Array.isArray(s)?s.length>1:!1)||c.type==="Text")throw Error("sveld: directive value must be a single expression");d=c.expression}let u={start:t,end:r,type:a,name:p,expression:d};if((u.type==="BindDirective"||u.type==="ClassDirective")&&!u.expression)u.expression={start:t+i+1,end:r,type:"Identifier",name:u.name};return u}return Mi(n.name,t,r,s)}function Lp(e){let t=e.index++,n=e.current();if(e.eat("!--")){let x=e.readUntilString("-->");e.eat("-->",!0),e.append({type:"Comment",start:t,end:e.index,data:x});return}if(e.eat("/")){let{name:x}=Ap(e);if(e.allowWhitespace(),e.eat(">",!0),Li(x))throw Error(`sveld: <${x}> is a void element and cannot have a closing tag`);while(n.name!==x){if(n.type==="RegularElement");else throw Error(`sveld: invalid closing tag </${x}>`);n.end=t,e.pop(),n=e.current()}if(n.end=e.index,e.pop(),e.lastAutoClosedTag&&e.stack.length<e.lastAutoClosedTag.depth)e.lastAutoClosedTag=void 0;return}let r=Ap(e),i=xh(r.name)&&mh.test(r.name);if(!gh(r.name)&&!i)throw Error(`sveld: "${r.name}" is not a valid element or component name`);if(r.name in Dp&&n.type!=="Root")throw Error(`sveld: <${r.name}> must be a top-level element`);let a;if(r.name in Pp)a=Pp[r.name];else if(r.name.startsWith("svelte:"))a=bh(r.name);else if(i)a="Component";else if(r.name==="title"&&Th(e.stack))a="TitleElement";else if(r.name==="slot"&&!vh(e.stack))a="SlotElement";else a="RegularElement";let s={type:a,start:t,end:-1,name:r.name,attributes:[],fragment:{type:"Fragment",nodes:[]}};if(e.allowWhitespace(),n.type==="RegularElement"&&mp(n.name,r.name))n.end=t,e.pop(),e.lastAutoClosedTag={tag:n.name,reason:r.name,depth:e.stack.length},n=e.current();let p=e.current(),c=(r.name==="script"||r.name==="style")&&p.type==="Root",d=c?Ph:Ah,u;while(u=d(e))s.attributes.push(u),e.allowWhitespace();if(s.type==="SvelteComponent")s.expression=wp(kp(s));if(s.type==="SvelteElement"){let x=kp(s);if(x.value===!0)throw Error("sveld: <svelte:element> `this` attribute needs a value");if(wh(x))s.tag=wp(x);else{let g=x.value[0];s.tag=g.type==="Text"?{type:"Literal",value:g.data,raw:`'${g.raw}'`,start:g.start,end:g.end}:g.expression}}if(c){e.eat(">",!0);let x=kh(e.root.fragment.nodes,t);if(r.name==="script"){let g=Sp(e,t,s.attributes);if(x)g.content.leadingComments=[{type:"Line",value:x.data}];if(g.context==="module"){if(e.root.module)throw Error("sveld: duplicate <script module>");e.root.module=g}else{if(e.root.instance)throw Error("sveld: duplicate <script>");e.root.instance=g}}else{if(e.root.css)throw Error("sveld: duplicate <style>");let g=Ep(e,t,s.attributes);g.content.comment=x,e.root.css=g}return}e.append(s);let y=e.eat("/")||Li(r.name);if(e.eat(">",!0),y)s.end=e.index;else if(r.name==="textarea")s.fragment.nodes=_p(e,()=>(Ri.lastIndex=e.index,Ri.test(e.source))),e.read(Ri),s.end=e.index;else e.push(s,s.fragment)}function kh(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(n===e.length-1&&r.end!==t)break;if(r.type==="Comment")return r;if(r.type!=="Text"||r.data.trim())break}return null}function kp(e){let t=e.attributes,n=t.findIndex((r)=>r.type==="Attribute"&&r.name==="this");if(n===-1)throw Error(`sveld: <${e.name}> requires a \`this\` attribute`);return t.splice(n,1)[0]}function wp(e){return Array.isArray(e.value)?e.value[0].expression:e.value.expression}function wh(e){return e.value!==!0&&!Array.isArray(e.value)||Array.isArray(e.value)&&e.value.length===1&&e.value[0].type==="ExpressionTag"}function Rp(e){let t={start:e.start,end:e.end,attributes:e.attributes};for(let n of e.attributes){if(n.type!=="Attribute")continue;if(n.name==="runes"){let r=Mp(n);if(typeof r==="boolean")t.runes=r}if(n.name==="customElement"){let r=Ih(n);if(r!==void 0)t.customElement=r}}return t}function Mp(e){let{value:t}=e;if(t===!0)return!0;let n=Array.isArray(t)?t[0]:t;if(!n)return!0;if(Array.isArray(t)&&t.length>1)return null;if(n.type==="Text")return n.data;if(n.expression.type!=="Literal")return null;return n.expression.value}var Nh=new Set(["String","Boolean","Number","Array","Object"]);function Oi(e){let t=[];for(let n of e.properties){if(!n||typeof n!=="object"||n.type!=="Property"||n.computed||n.key?.type!=="Identifier")continue;let{key:r,value:i}=n;t.push([r.name,i])}return t}function Dh(e){let t={};if(!e||typeof e!=="object"||e.type!=="ObjectExpression")return t;for(let[n,r]of Oi(e)){if(!r||typeof r!=="object"||r.type!=="Literal")continue;let i=r.value;if(n==="attribute"&&typeof i==="string")t.attribute=i;else if(n==="reflect"&&typeof i==="boolean")t.reflect=i;else if(n==="type"&&typeof i==="string"&&Nh.has(i))t.type=i}return t}function Ih(e){let{value:t}=e;if(t===!0)return;let n=Array.isArray(t)?t[0]:t;if(!n)return;if(n.type==="Text"){let u=Mp(e);return typeof u==="string"?{tag:u}:void 0}let r=n.expression;if(r.type==="Literal"&&r.value===null)return;if(r.type!=="ObjectExpression")return;let i=Oi(r),a={},s=i.find(([u])=>u==="tag")?.[1];if(s&&typeof s==="object"&&s.type==="Literal"&&typeof s.value==="string")a.tag=s.value;let p=i.find(([u])=>u==="props")?.[1];if(p&&typeof p==="object"&&p.type==="ObjectExpression"){a.props={};for(let[u,y]of Oi(p))a.props[u]=Dh(y)}let c=i.find(([u])=>u==="shadow")?.[1];if(c&&typeof c==="object"){let u=c;if(u.type==="Literal"&&(u.value==="open"||u.value==="none"))a.shadow=u.value;else if(u.type==="ObjectExpression")a.shadow=c}let d=i.find(([u])=>u==="extend")?.[1];if(d!==void 0)a.extend=d;return a}var _h=/<script\s+(?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?ts\1[^>]*>/;class Bi extends ki{root;stack=[];fragments=[];isTypeScript;lineTable={};lastAutoClosedTag;constructor(e,t){super(e);this.isTypeScript=_h.test(e);let n=le();this.root={type:"Root",start:0,end:t,css:null,js:[],options:null,fragment:n,comments:[]},this.stack.push(this.root),this.fragments.push(n)}current(){return this.stack[this.stack.length-1]}currentFragment(){return this.fragments[this.fragments.length-1]}push(e,t){this.stack.push(e),this.fragments.push(t)}pop(){return this.fragments.pop(),this.stack.pop()}append(e){return this.currentFragment().nodes.push(e),e}}var Fi={"{":"}","(":")","[":"]"},Lh=new Set(Object.values(Fi));function cn(e,t,n=Fi){let r=n===Fi?Lh:new Set(Object.values(n)),i=[],a=t;while(a<e.source.length){let s=e.source[a++];if(s==="'"||s==='"'||s==="`"){a=Rh(e,a,s);continue}if(Object.hasOwn(n,s))i.push(s);else if(r.has(s)){let p=i.pop(),c=p?n[p]:void 0;if(s!==c)throw Error(`sveld: expected "${c}"`);if(i.length===0)return a}}throw Error("sveld: unexpected end of input")}function Rh(e,t,n){let r=!1,i=t;while(i<e.source.length){let a=e.source[i++];if(r){r=!1;continue}if(a===n)return i;if(a==="\\")r=!0;if(n==="`"&&a==="$"&&e.source[i]==="{")i=cn(e,i)}throw Error("sveld: unterminated string constant")}var Bp=/[^\n]/g,Mh=/\?\s*:/g;function st(e){let t=e.index,n=e.readIdentifierName();if(n.name!==""){let x=Op(e);return{...n,typeAnnotation:x}}let r=e.source[e.index];if(r!=="{"&&r!=="[")throw Error("sveld: expected a binding pattern");let i=cn(e,t);e.index=i;let a=e.source.slice(t,i),s=e.source.slice(0,t).replace(Bp," "),p=s.indexOf(" ");s=s.slice(0,p)+s.slice(p+1);let c=`${s}(${a} = 1)`,{node:d}=Dt(c,t-1,e.isTypeScript,e.root.comments),u=d.left,y=Op(e);if(y)u.typeAnnotation=y,u.end=y.end;return u}function Op(e){let t=e.index;if(e.allowWhitespace(),!e.eat(":")){e.index=t;return}let n="_ as ",r=e.index-n.length,i=e.source.slice(0,r).replace(Bp," ")+n+e.source.slice(e.index).replace(Mh,":"),{node:a}=Dt(i,r,e.isTypeScript,e.root.comments),s=a;if(s.type==="AssignmentExpression"){let p=s.right.start;while(i[p]!=="=")p-=1;({node:a}=Dt(i.slice(0,p),r,e.isTypeScript,e.root.comments)),s=a}if(s.type==="SequenceExpression"&&s.expressions)s=s.expressions[0];return e.index=s.end,{type:"TSTypeAnnotation",start:t,end:e.index,typeAnnotation:s.typeAnnotation}}var Fp=/\s*}/y,Oh={"<":">"};function $p(e){let t=e.index-2;while(e.source[t]!=="{")t-=1;if(e.eat("if")){e.requireWhitespace();let n={type:"IfBlock",elseif:!1,start:t,end:-1,test:ee(e),consequent:le(),alternate:null};e.append(n),e.allowWhitespace(),e.eat("}",!0),e.push(n,n.consequent);return}if(e.eat("each")){e.requireWhitespace();let n=ee(e);if(e.allowWhitespace(),!e.match("as")){let p=n;if(p.type==="SequenceExpression"&&p.expressions)p=p.expressions[0];if(p.type==="TSAsExpression"){let c=p;n=c.expression;let d=c.typeAnnotation.start-2;while(d>=0&&!(e.source[d]==="a"&&e.source[d+1]==="s"))d-=1;e.index=d}}let r=null,i,a;if(e.eat("as"))e.requireWhitespace(),r=st(e);if(e.allowWhitespace(),e.eat(",")){e.allowWhitespace();let p=e.readIdentifierName();if(!p.name)throw Error("sveld: expected an identifier");i=p.name,e.allowWhitespace()}if(e.eat("("))e.allowWhitespace(),a=ee(e),e.allowWhitespace(),e.eat(")",!0),e.allowWhitespace();e.eat("}",!0);let s={type:"EachBlock",start:t,end:-1,expression:n,body:le(),context:r,index:i,key:a};e.append(s),e.push(s,s.body);return}if(e.eat("await")){e.requireWhitespace();let n=ee(e);e.allowWhitespace();let r={type:"AwaitBlock",start:t,end:-1,expression:n,value:null,error:null,pending:null,then:null,catch:null};if(e.eat("then")){if(!e.matchRegex(Fp))e.requireWhitespace(),r.value=st(e),e.allowWhitespace();r.then=le()}else if(e.eat("catch")){if(!e.matchRegex(Fp))e.requireWhitespace(),r.error=st(e),e.allowWhitespace();r.catch=le()}else r.pending=le();e.eat("}",!0),e.append(r),e.push(r,r.then??r.catch??r.pending);return}if(e.eat("key")){e.requireWhitespace();let n=ee(e);e.allowWhitespace(),e.eat("}",!0);let r={type:"KeyBlock",start:t,end:-1,expression:n,fragment:le()};e.append(r),e.push(r,r.fragment);return}if(e.eat("snippet")){e.requireWhitespace();let n=e.readIdentifierName();if(n.name==="")throw Error("sveld: expected a snippet name");e.allowWhitespace();let r;if(e.isTypeScript&&e.match("<")){let a=e.index,s=cn(e,a,Oh);r=e.source.slice(a+1,s-1),e.index=s}if(e.allowWhitespace(),e.eat("(")){let a=1;while(e.index<e.source.length&&(!e.match(")")||a!==1)){if(e.match("("))a++;if(e.match(")"))a--;e.index+=1}e.eat(")",!0)}e.allowWhitespace(),e.eat("}",!0);let i={type:"SnippetBlock",start:t,end:-1,expression:n,typeParams:r,parameters:[],body:le()};e.append(i),e.push(i,i.body);return}throw Error("sveld: expected if/each/await/key/snippet")}function Vp(e){let t=e.index-1,n=e.current();if(n.type==="IfBlock"){if(!e.eat("else"))throw Error("sveld: expected {:else} or {:else if}");if(e.eat("if"))throw Error("sveld: {:else if} cannot follow {:else if} directly");if(e.allowWhitespace(),e.fragments.pop(),n.alternate=le(),e.fragments.push(n.alternate),e.eat("if")){e.requireWhitespace();let r=ee(e);e.allowWhitespace(),e.eat("}",!0);let i=t-1;while(e.source[i]!=="{")i-=1;let a={type:"IfBlock",start:i,end:-1,elseif:!0,test:r,consequent:le(),alternate:null};e.append(a),e.stack.push(a),e.fragments.pop(),e.fragments.push(a.consequent)}else e.allowWhitespace(),e.eat("}",!0);return}if(n.type==="EachBlock"){if(!e.eat("else"))throw Error("sveld: expected {:else}");e.allowWhitespace(),e.eat("}",!0),n.fallback=le(),e.fragments.pop(),e.fragments.push(n.fallback);return}if(n.type==="AwaitBlock"){if(e.eat("then")){if(n.then)throw Error("sveld: duplicate {:then}");if(!e.eat("}"))e.requireWhitespace(),n.value=st(e),e.allowWhitespace(),e.eat("}",!0);n.then=le(),e.fragments.pop(),e.fragments.push(n.then);return}if(e.eat("catch")){if(n.catch)throw Error("sveld: duplicate {:catch}");if(!e.eat("}"))e.requireWhitespace(),n.error=st(e),e.allowWhitespace(),e.eat("}",!0);n.catch=le(),e.fragments.pop(),e.fragments.push(n.catch);return}throw Error("sveld: expected {:then ...} or {:catch ...}")}throw Error("sveld: {:...} not valid here")}function jp(e){let t=e.current();switch(t.type){case"IfBlock":{e.eat("if",!0),e.allowWhitespace(),e.eat("}",!0);while(t.type==="IfBlock"&&t.elseif)t.end=e.index,e.stack.pop(),t=e.current();t.end=e.index,e.pop();return}case"EachBlock":e.eat("each",!0);break;case"KeyBlock":e.eat("key",!0);break;case"AwaitBlock":e.eat("await",!0);break;case"SnippetBlock":e.eat("snippet",!0);break;default:throw Error("sveld: unexpected closing block tag")}e.allowWhitespace(),e.eat("}",!0),t.end=e.index,e.pop()}var Bh=/(?:let|const)\b/y,Fh=/(?:var|interface|enum)\b/y,$h=/type\b/y;function Hp(e){let t=e.index;if(e.matchRegex(Fh))throw Error("sveld: `var`/`interface`/`enum` are not valid here");if(!e.matchRegex(Bh)&&!e.matchRegex($h))return null;let n=e.root.comments.length,r=ip(e.source,t,e.isTypeScript,e.root.comments);if(r.type!=="VariableDeclaration"){if(r.type==="ExpressionStatement")return e.root.comments.length=n,null;throw Error("sveld: expected a `let`/`const` declaration")}if(r.kind!=="let"&&r.kind!=="const")throw Error("sveld: expected a `let`/`const` declaration");return e.index=r.end,e.allowWhitespace(),e.eat("}",!0),r}var Vh=/\s*}/y;function qp(e){let t=e.index;while(e.source[t]!=="{")t-=1;if(e.eat("html")){e.requireWhitespace();let n=ee(e);e.allowWhitespace(),e.eat("}",!0);let r={type:"HtmlTag",start:t,end:e.index,expression:n};e.append(r);return}if(e.eat("debug")){let n;if(e.read(Vh))n=[];else{let i=ee(e);n=i.type==="SequenceExpression"?i.expressions:[i];for(let a of n)if(a.type!=="Identifier")throw Error("sveld: {@debug} arguments must be identifiers");e.allowWhitespace(),e.eat("}",!0)}let r={type:"DebugTag",start:t,end:e.index,identifiers:n};e.append(r);return}if(e.eat("const")){e.requireWhitespace();let n=st(e);e.allowWhitespace(),e.eat("=",!0),e.allowWhitespace();let r=ee(e),i=e.index;e.allowWhitespace(),e.eat("}",!0);let a={type:"VariableDeclarator",id:n,init:r,start:n.start,end:i},s={type:"ConstTag",start:t,end:e.index,declaration:{type:"VariableDeclaration",kind:"const",declarations:[a],start:t+2,end:e.index-1}};e.append(s);return}if(e.eat("render")){e.requireWhitespace();let n=ee(e);if(!(n.type==="CallExpression"||n.type==="ChainExpression"&&n.expression.type==="CallExpression"))throw Error("sveld: {@render ...} must be a function call");e.allowWhitespace(),e.eat("}",!0);let i={type:"RenderTag",start:t,end:e.index,expression:n};e.append(i);return}throw Error("sveld: expected html/debug/const/render")}function Up(e){let t=e.index;if(e.index+=1,e.allowWhitespace(),e.eat("#")){$p(e);return}if(e.eat(":")){Vp(e);return}if(e.eat("@")){qp(e);return}if(e.match("/")&&!e.match("/*")&&!e.match("//")){e.eat("/"),jp(e);return}let n=Hp(e);if(n){let a={type:"DeclarationTag",start:t,end:e.index,declaration:n};e.append(a);return}let r=ee(e);e.allowWhitespace(),e.eat("}",!0);let i={type:"ExpressionTag",start:t,end:e.index,expression:r};e.append(i)}function Gp(e){let{index:t,source:n}=e,r=n.indexOf("<",t),i=n.indexOf("{",t),a;if(r===-1)a=i===-1?n.length:i;else a=i===-1?r:Math.min(r,i);e.index=a;let s=n.slice(t,a),p={type:"Text",start:t,end:e.index,raw:s,data:s};e.append(p)}function $i(e){let t=e.trimEnd(),n=new Bi(t,e.length);while(n.index<n.source.length)if(n.match("<"))Lp(n);else if(n.match("{"))Up(n);else Gp(n);let r=n.root.fragment.nodes.findIndex((i)=>i.type==="SvelteOptions");if(r!==-1){let[i]=n.root.fragment.nodes.splice(r,1);n.root.options=Rp(i)}return n.root}function jh(e,t){let n=e.length+1,r=t.length+1,i=Array.from({length:n},()=>Array(r).fill(0));for(let a=0;a<n;a++)i[a][0]=a;for(let a=0;a<r;a++)i[0][a]=a;for(let a=1;a<n;a++)for(let s=1;s<r;s++){let p=e[a-1]===t[s-1]?0:1;if(i[a][s]=Math.min(i[a-1][s]+1,i[a][s-1]+1,i[a-1][s-1]+p),a>1&&s>1&&e[a-1]===t[s-2]&&e[a-2]===t[s-1])i[a][s]=Math.min(i[a][s],i[a-2][s-2]+1)}return i[n-1][r-1]}function Wp(e,t,n=3){let r,i=Number.POSITIVE_INFINITY;for(let a of t){let s=jh(e,a);if(s<i)r=a,i=s}if(r===void 0||i>n)return;return r}var Hh=/\s*=\s*/;function qh(e){let t=e.indexOf("<");if(t===-1||!e.endsWith(">"))return e;let n=e.slice(0,t),r=e.slice(t+1,-1),i=se(r,",").map((a)=>a.trim().replace(Hh," = ")).join(", ");return`${n}<${i}>`}var Uh=new Set(["restProps","slot","snippet","event","typedef","callback"]),Vi=new Set(["property","type"]),Gh=new Set(["slot","snippet","typedef","callback"]);function rr(e){if(!e||e.length===0)return;return e[Ar(e)].content}function zp(e){return!e||!e.tag&&!e.continuesType&&e.content.trim()===""}function Wh(e){return e.text.split(`
46
+ `).length===e.lines.length}function ji(e,t){if(t<=0)return e;return e.split(`
47
+ `).slice(0,-t).join(`
48
+ `).trimEnd()}var zh=new Set(["abstract","access","alias","alpha","arg","argument","async","augments","author","beta","borrows","const","constructs","copyright","defaultValue","description","emits","experimental","exports","external","fires","function","global","import","inner","instance","kind","lends","license","link","listens","member","name","override","package","private","prop","protected","public","readonly","remarks","requires","satisfies","sealed","static","summary","throws","todo","tutorial","typeParam","version","virtual","yields"]),Kh=[...xn,...kr,"type","param","returns","typedef","property","callback","template","generics","slot","snippet","event","restProps","extends","extendProps","deprecated","ignore","internal","sveld-ignore","csspart","cssprop"],Jh=/;$/;function Xh(e){let t=e.trim().replace(Jh,"").trimEnd();if(!t.startsWith("{")||!t.endsWith("}"))return!1;return vt(t,0)===t.length-1}var Yh=/[\w$]+/g,Qh=new Set(["property","param","returns","return"]);function Zh(e,t,n){let r=[e[t].type];for(let a=t+1;Qh.has(e[a]?.tag);a++)r.push(e[a].type);let i=new Set(r.join(" ").match(Yh));return n.some(({name:a})=>i.has(a))}function em(e){let t=e?.trim();return!t||t==="object"||t==="Object"}function Kp(e,t){if(t.usedGenericsTag&&t.usedTemplateTag&&!t.warnedMixedGenericsTags){t.warnedMixedGenericsTags=!0;let n=e.componentFilePath?` in ${e.componentFilePath}`:"";console.warn(`Warning: Both @generics and @template tags are used to declare component generics${n}; their declarations are combined in the order encountered.`)}}function Jp(e,t,n,r){if(t.seenGenericNames.has(n))G(e,"generics-conflict",n,`Duplicate generic name "${n}".`,r);else t.seenGenericNames.add(n)}function Xp(e,t,n){if(e.generics){let i=se(e.generics[0],",").map((a)=>a.trim()).indexOf(t.trim());if(i!==-1){let a=se(e.generics[1],",").map((s)=>s.trim());a[i]=n,e.generics=[e.generics[0],a.join(", ")];return}}Rn(e,t,n)}function Yp(e,t,n){if(e.typedefs.has(t))G(e,"typedef-duplicate",t,`Duplicate typedef/callback name "${t}"; the later declaration overwrites the earlier one.`,n)}function Qp(e,t,n,r,i){let a=t.findIndex((s)=>s.name===n.name);if(a===-1)t.push(n);else{let s=r?` of "${r}"`:"";G(e,"property-duplicate",n.name,`Duplicate property "${n.name}"${s}; the later declaration overwrites the earlier one.`,i),t[a]=n}}class Zp{tags;lines;commentDescription;commentDescriptionUsed=!1;isFirstTag=!0;eventName;eventType;eventDescription;eventDeprecated;eventInternal=!1;eventSource;eventTagLine;eventTags=[];eventIgnores=[];eventProperties=[];typedefName;typedefType;typedefDescription;typedefSource;typedefTags=[];typedefInternal=!1;typedefProperties=[];callbackName;callbackDescription;callbackSource;callbackTags=[];callbackInternal=!1;callbackParams=[];callbackReturnType;attachTrailingTag;pendingTags=[];pendingDeprecated;pendingInternal=!1;pendingTypeParameters=[];lineDescriptions=new Map;tagLineNumbers=new Set;consumedDescriptionLines=new Set;indentedContinuationLines=new Set;trimBodyAbove;trimThisBody;hasSlotOrSnippetTag;hasExtendsTag;ctx;generics;documentsFunction;constructor(e,t,n,r){this.ctx=e,this.generics=t,this.documentsFunction=r;let{tags:i,lines:a}=n;this.tags=i,this.lines=a,this.commentDescription=n.description,this.hasSlotOrSnippetTag=i.some((c)=>c.tag==="slot"||c.tag==="snippet"),this.hasExtendsTag=i.some((c)=>c.tag==="extends"||c.tag==="extendProps");for(let c of i)if(c.lines.length>0)this.tagLineNumbers.add(c.lines[0].number);for(let c of a)if(c.continuesType)this.tagLineNumbers.add(c.number);let s=!1,p=!1;for(let c of a){if(!c.tag&&!c.continuesType&&c.content&&(p||c.content.trim()!=="}"))this.lineDescriptions.set(c.number,c.content);if(c.tag!==void 0||c.continuesType)s=!0;else if(!c.content.trim());else if(s&&(c.indent||p))this.indentedContinuationLines.add(c.number);else s=!1;if(Ft(c.content))p=!p}}orCommentDescription(e){if(e||!this.isFirstTag||this.commentDescriptionUsed||!this.commentDescription)return e;return this.commentDescriptionUsed=!0,this.commentDescription}typeDeclarationName(e){if(this.pendingTypeParameters.length===0)return qh(e);let t=`${e}<${this.pendingTypeParameters.join(", ")}>`;return this.pendingTypeParameters.length=0,t}joinBlockLines(e,t){let n=t?t.text.split(`
49
+ `):[],r=t?.line;for(let i of e){if(r!==void 0&&i-r>1){let s=r+1;while(s<i&&zp(this.lines[s]))s++;if(s===i)for(let p=r+1;p<i;p++)n.push("")}let a=this.lines[i];n.push(a.indent+a.content),r=i}return gn(n)}getPrecedingDescription(e){if(e.length===0)return;let t=e[0].number,n=[],r=!1;for(let i=t-1;i>=0;i--){if(this.tagLineNumbers.has(i)||this.indentedContinuationLines.has(i)||this.consumedDescriptionLines.has(i))break;if(this.lineDescriptions.has(i))n.unshift(i),r=!0;else if(r&&!zp(this.lines[i]))break}if(n.length===0)return;for(let i of n)this.consumedDescriptionLines.add(i);return this.trimBodyAbove?.(n[0]),this.joinBlockLines(n)}claimBodyLines(e,t){if(!Wh(e)){for(let r=1;r<e.lines.length;r++)this.consumedDescriptionLines.add(e.lines[r].number);return}let n=e.lines[e.lines.length-1].number;this.trimThisBody=(r)=>t(n-r+1)}getTagDescription(e,t,n=!1){let r=He(rr(e)),i=t!==void 0&&Uh.has(t.tag)&&!He(rr(t.lines)),a=n&&(t===void 0||!Vi.has(t.tag)),s=[];for(let p=1;p<e.length;p++){let c=e[p];if((i||a)&&!this.indentedContinuationLines.has(c.number))continue;if(!this.lineDescriptions.get(c.number)?.trim()||this.consumedDescriptionLines.has(c.number))continue;s.push(c.number),this.consumedDescriptionLines.add(c.number)}if(s.length===0)return r;return this.joinBlockLines(s,{text:r??"",line:e[Ar(e)].number})}flagDescriptionAfterEvent(e,t,n,r){if(this.eventName===void 0||this.eventDescription)return;if(this.eventTagLine!==void 0&&this.indentedContinuationLines.has(this.eventTagLine+1))return;if(r?.tag!=="event"&&!Vi.has(r?.tag??""))return;if(He(rr(n)))return;let i=t?`@${e} "${t}"`:`@${e}`;G(this.ctx,"event-description-ambiguous",this.eventName,`Text after @event "${this.eventName}" was used as the description of ${i}. Move it above the tag it describes, indent it as a continuation line, or give each event its own comment block.`,me(this.ctx,n))}takePrecedingDescription(e){let{tag:t,name:n,lines:r}=this.tags[e],i=this.getPrecedingDescription(r);if(i)this.flagDescriptionAfterEvent(t,n,r,this.tags[e-1]);return i}finalizeEvent(){if(this.eventName===void 0)return;let{ctx:e}=this,t=this.eventType&&this.eventType!=="object"&&this.eventType!=="Object"?this.eventType:void 0,n;if(t)n=t;else if(this.eventProperties.length>0)n=Kt(this.eventProperties,this.eventName,!0);else n=this.eventType||"";if(this.eventTagLine!==void 0){let i;for(let p of this.tags){let c=p.lines[0]?.number;if(typeof c!=="number")continue;if(c<=this.eventTagLine)continue;if(Vi.has(p.tag))continue;i=c;break}let a=[],s=Array.from(this.lineDescriptions.keys()).sort((p,c)=>p-c);for(let p of s){if(p<=this.eventTagLine)continue;if(i!==void 0&&p>=i)continue;if(this.consumedDescriptionLines.has(p))continue;if(this.lineDescriptions.get(p)?.trim())a.push(p),this.consumedDescriptionLines.add(p)}if(a.length>0)this.eventDescription=this.joinBlockLines(a,this.eventDescription?{text:this.eventDescription,line:this.eventTagLine}:void 0)}let r=n===""&&(!e.events.has(this.eventName)||e.untypedJsDocEventNames.has(this.eventName));if(tt(e,{name:this.eventName,detail:n,has_argument:!1,description:this.eventDescription,deprecated:this.eventDeprecated,tags:this.eventTags.length>0?this.eventTags:void 0,internal:this.eventInternal||void 0,source:this.eventSource}),r)e.untypedJsDocEventNames.add(this.eventName);e.eventDescriptions.set(this.eventName,this.eventDescription),e.jsDocEventNames.add(this.eventName),e.jsDocEventSources.set(this.eventName,this.eventSource),Oe(e,"event-no-source",this.eventName,this.eventIgnores),this.eventProperties.length=0,this.eventName=void 0,this.eventType=void 0,this.eventDescription=void 0,this.eventDeprecated=void 0,this.eventInternal=!1,this.eventSource=void 0,this.eventTagLine=void 0,this.eventTags=[],this.eventIgnores=[]}finalizeTypedef(){if(this.typedefName===void 0)return;let{ctx:e}=this,t,n;if(this.typedefProperties.length>0)t=Kt(this.typedefProperties,void 0,!0),n=`type ${this.typedefName} = ${t};`;else if(this.typedefType)t=this.typedefType,n=Xh(t)?`interface ${this.typedefName} ${t}`:`type ${this.typedefName} = ${t};`;else t="{}",n=`type ${this.typedefName} = ${t};`;let r=this.typedefProperties.length>0?this.typedefProperties.filter(({name:i})=>!i.includes(".")&&!i.startsWith("[")).map(({name:i,type:a,optional:s,description:p})=>({name:i,type:a,optional:s===!0,...p?{description:p}:{}})):qe(t);if(r)e.typedefMembersByName.set(this.typedefName,r);Yp(e,this.typedefName,this.typedefSource),e.typedefs.set(this.typedefName,{type:t,name:this.typedefName,description:he(this.typedefDescription),ts:n,tags:this.typedefTags.length>0?this.typedefTags:void 0,...this.typedefInternal?{internal:!0}:{},source:this.typedefSource}),this.typedefProperties.length=0,this.typedefName=void 0,this.typedefType=void 0,this.typedefDescription=void 0,this.typedefSource=void 0,this.typedefTags=[],this.typedefInternal=!1}finalizeCallback(){if(this.callbackName===void 0)return;let e=this.callbackParams.map(({name:i,type:a,optional:s})=>`${i}${s?"?":""}: ${a}`).join(", "),t=this.callbackReturnType||"void",n=`(${e}) => ${t}`,r=`type ${this.callbackName} = ${n};`;Yp(this.ctx,this.callbackName,this.callbackSource),this.ctx.typedefs.set(this.callbackName,{type:n,name:this.callbackName,description:he(this.callbackDescription),ts:r,tags:this.callbackTags.length>0?this.callbackTags:void 0,...this.callbackInternal?{internal:!0}:{},source:this.callbackSource}),this.callbackParams.length=0,this.callbackReturnType=void 0,this.callbackName=void 0,this.callbackDescription=void 0,this.callbackSource=void 0,this.callbackTags=[],this.callbackInternal=!1}readExtends(e,t){let{name:n,lines:r}=this.tags[e];if(this.ctx.extends!==void 0)G(this.ctx,"extend-props-duplicate",n,`A second @extends/@extendProps tag ("${n}") overwrote the first ("${this.ctx.extends.interface}"); only one is used.`,me(this.ctx,r));this.ctx.extends={interface:n,import:t},this.isFirstTag=!1}readRestProps(e,t){let{name:n,description:r}=this.tags[e],i=n?r?`${n} ${r}`:n:r,a=He(i),s=this.orCommentDescription(a||this.takePrecedingDescription(e)),p={type:"Element",name:t,description:s||void 0};if(this.ctx.rest_props=p,a)this.claimBodyLines(this.tags[e],(c)=>{p.description=He(ji(i,c))||void 0});this.isFirstTag=!1}readSlot(e,t){let{tag:n,name:r,lines:i}=this.tags[e],a=this.orCommentDescription(this.getTagDescription(i,this.tags[e+1]));if(!a&&this.pendingTags.length===0)a=this.takePrecedingDescription(e);this.isFirstTag=!1;let s=t;if(!s)s="Record<string, never>",G(this.ctx,"slot-missing-type",r||"default",`@${n}${r?` "${r}"`:""} is missing a required {Type} annotation; falling back to "${s}".`,me(this.ctx,i));Xt(this.ctx,{slot_name:r,slot_props:s,slot_description:a||void 0,slot_deprecated:this.pendingDeprecated,slot_tags:this.pendingTags.length>0?[...this.pendingTags]:void 0,slot_internal:this.pendingInternal||void 0,source:me(this.ctx,i)}),this.pendingTags.length=0,this.pendingDeprecated=void 0,this.pendingInternal=!1;let p=r===void 0||r===""?null:r;this.attachTrailingTag=(c)=>{let d=this.ctx.slots.get(p);if(d)d.tags=[...d.tags??[],c]}}readEvent(e,t){let{name:n,lines:r}=this.tags[e],i=He(rr(r))||this.takePrecedingDescription(e);if(this.finalizeEvent(),this.eventName=n,this.eventType=t,this.eventTagLine=r.length>0?r[0].number:void 0,this.eventDescription=this.orCommentDescription(i),this.eventSource=me(this.ctx,r),this.pendingTags.length>0)this.eventTags.push(...this.pendingTags),this.pendingTags.length=0;this.attachTrailingTag=(a)=>this.eventTags.push(a),this.isFirstTag=!1}readProperty(e,t){let{name:n,optional:r,default:i,lines:a}=this.tags[e],s={name:n,type:t,description:this.getTagDescription(a,this.tags[e+1],this.eventName!==void 0),optional:r||!1,default:i};if(this.eventName!==void 0)Qp(this.ctx,this.eventProperties,s,this.eventName,me(this.ctx,a));else if(this.typedefName!==void 0&&em(this.typedefType))Qp(this.ctx,this.typedefProperties,s,this.typedefName,me(this.ctx,a))}readTypedef(e,t){let{name:n,lines:r}=this.tags[e];if(this.finalizeTypedef(),this.typedefName=this.typeDeclarationName(n),this.typedefType=t,this.typedefSource=me(this.ctx,r),this.typedefDescription=this.orCommentDescription(this.getTagDescription(r,this.tags[e+1])||this.takePrecedingDescription(e)),this.pendingTags.length>0)this.typedefTags.push(...this.pendingTags),this.pendingTags.length=0;this.typedefInternal=this.pendingInternal,this.pendingInternal=!1,this.attachTrailingTag=(i)=>this.typedefTags.push(i),this.isFirstTag=!1}readCallback(e){let{name:t,lines:n}=this.tags[e];if(this.finalizeCallback(),this.callbackName=this.typeDeclarationName(t),this.callbackSource=me(this.ctx,n),this.callbackDescription=this.orCommentDescription(this.getTagDescription(n,this.tags[e+1])||this.takePrecedingDescription(e)),this.pendingTags.length>0)this.callbackTags.push(...this.pendingTags),this.pendingTags.length=0;this.callbackInternal=this.pendingInternal,this.pendingInternal=!1,this.attachTrailingTag=(r)=>this.callbackTags.push(r),this.isFirstTag=!1}readGenerics(e,t){let{name:n,lines:r}=this.tags[e],i=t||n;for(let a of se(n,","))Jp(this.ctx,this.generics,a.trim(),me(this.ctx,r));this.generics.usedGenericsTag=!0,Kp(this.ctx,this.generics),Xp(this.ctx,n,i),this.isFirstTag=!1}readTemplate(e,t){let{tags:n}=this,r=Ir(n[e],t),i=e+1;while(n[i]?.tag==="template")i++;let a=n[i];if((a?.tag==="typedef"||a?.tag==="callback")&&!a.name.includes("<")&&Zh(n,i,r)){this.pendingTypeParameters.push(...r.map(({constraint:s})=>s));return}if(this.hasSlotOrSnippetTag&&!this.hasExtendsTag){this.ctx.deferredSlotBlockGenerics.push(...r);return}if(this.documentsFunction)return;for(let s of r)Jp(this.ctx,this.generics,s.name,me(this.ctx,n[e].lines)),Xp(this.ctx,s.name,s.constraint);this.generics.usedTemplateTag=!0,Kp(this.ctx,this.generics),this.isFirstTag=!1}readDeprecated(e){let{text:t}=this.tags[e],n=this.eventName!==void 0;if(n?this.eventDeprecated!==void 0:this.pendingDeprecated!==void 0)return;let r=(i)=>{if(n)this.eventDeprecated=i;else this.pendingDeprecated=i};r(bn(t)),this.claimBodyLines(this.tags[e],(i)=>{r(bn(ji(t,i)))})}readPassthrough(e){let{tag:t,text:n,lines:r}=this.tags[e],i={name:t,body:n};if(this.claimBodyLines(this.tags[e],(a)=>{i.body=ji(n,a)}),!xn.has(t)&&!kr.has(t)){let a=zh.has(t)?void 0:Wp(t,Kh,t.length<=4?1:2);G(this.ctx,"jsdoc-unknown-tag",t,a?`Unknown JSDoc tag "@${t}"; did you mean "@${a}"? Passed through unchanged.`:`Unknown JSDoc tag "@${t}"; passed through unchanged. If this is a typo, fix the tag name.`,me(this.ctx,r))}if(this.attachTrailingTag)this.attachTrailingTag(i);else this.pendingTags.push(i)}read(){let{tags:e}=this;for(let n=0;n<e.length;n++){let{tag:r,type:i,name:a,optional:s}=e[n],p=Qe(i);switch(this.trimBodyAbove=this.trimThisBody,this.trimThisBody=void 0,r){case"extends":case"extendProps":this.readExtends(n,p);break;case"restProps":this.readRestProps(n,p);break;case"slot":case"snippet":this.readSlot(n,p);break;case"csspart":{let c=this.getTagDescription(e[n].lines,e[n+1]);this.ctx.cssParts.push({name:a,...c?{description:c}:{}});break}case"cssprop":case"cssproperty":{let c=this.getTagDescription(e[n].lines,e[n+1]),d=e[n].default;this.ctx.cssProperties.push({name:a,...p?{type:p}:{},...d===void 0?{}:{default:d},...c?{description:c}:{}});break}case"event":this.readEvent(n,p);break;case"type":if(this.eventName!==void 0)this.eventType=p;break;case"param":if(this.callbackName!==void 0)this.callbackParams.push({name:a,type:p,optional:s||!1});break;case"returns":case"return":if(this.callbackName!==void 0)this.callbackReturnType=p;break;case"property":this.readProperty(n,p);break;case"typedef":this.readTypedef(n,p);break;case"callback":this.readCallback(n);break;case"generics":this.readGenerics(n,p);break;case"template":this.readTemplate(n,p);break;case"deprecated":this.readDeprecated(n);break;case"ignore":case"internal":if(this.eventName===void 0)this.pendingInternal=!0;else this.eventInternal=!0;break;case"sveld-ignore":if(this.eventName!==void 0)this.eventIgnores.push(a);break;case"enum":case"class":case"implements":case"this":case"namespace":case"memberof":case"module":case"file":case"overview":break;default:this.readPassthrough(n);break}if(Gh.has(r))this.finalizeEvent()}if(this.finalizeEvent(),this.finalizeTypedef(),this.finalizeCallback(),e.some((n)=>n.tag==="slot"||n.tag==="snippet"||n.tag==="event"||n.tag==="typedef"||n.tag==="callback")&&this.pendingTags.length>0){for(let n of this.pendingTags)G(this.ctx,"jsdoc-tag-dropped",n.name,`@${n.name} could not attach to a @slot/@snippet/@event/@typedef/@callback tag in the same comment block and was dropped.`);this.pendingTags.length=0}}}function ec(e,t=e.source){if(!t)return;let n={usedGenericsTag:!1,usedTemplateTag:!1,warnedMixedGenericsTags:!1,seenGenericNames:new Set},r=t.includes("@template")?_s(e):new Set;e.functionDocCommentStarts=r;let i=yn(t);for(let a of i)e.jsDocBlocksByStart.set(a.start,a);for(let a of i)new Zp(e,n,a,r.has(a.start)).read()}var nc=new Set(["$state","$derived","$effect","$props","$bindable","$inspect","$host"]);function tm(e,t){switch(t?.type){case"MemberExpression":return t.computed||e===t.object;case"MethodDefinition":return!!t.computed;case"MetaProperty":return e===t.meta;case"PropertyDefinition":return t.computed||e===t.value;case"Property":return t.computed||e===t.value;case"ExportSpecifier":case"ImportSpecifier":return e===t.local;case"LabeledStatement":case"BreakStatement":case"ContinueStatement":return!1;default:return!0}}var nm=Array.from(nc);function tc(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===95||e===36}function rm(e){if(e.includes("\\u"))return!0;for(let t of nm){let n=e.indexOf(t);while(n!==-1){if(!tc(e.charCodeAt(n-1))&&!tc(e.charCodeAt(n+t.length)))return!0;n=e.indexOf(t,n+1)}}return!1}function im(e,t){for(let n=t.length-1;n>=0;n-=1)if(t[n]?.has(e))return!0;return!1}function sm(e){let t=new Set;if(!e||typeof e!=="object"||!("type"in e))return t;switch(String(e.type)){case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":{let n=e;if(n.id?.name)t.add(n.id.name);for(let r of n.params??[])Q(r,t);break}case"BlockStatement":ir(e.body,t);break;case"CatchClause":Q(e.param,t);break;case"EachBlock":{let n=e;if(Q(n.context,t),typeof n.index==="string")t.add(n.index);else if(n.index?.name)t.add(n.index.name);break}case"AwaitBlock":{let n=e;Q(n.value,t),Q(n.error,t);break}}return t}function ir(e,t){if(!Array.isArray(e))return;for(let n of e){if(!n||typeof n!=="object"||!("type"in n))continue;switch(String(n.type)){case"ImportDeclaration":for(let r of n.specifiers??[])if(r.local?.name)t.add(r.local.name);break;case"VariableDeclaration":for(let r of n.declarations??[])Q(r.id,t);break;case"FunctionDeclaration":case"ClassDeclaration":{let r=n.id?.name;if(r)t.add(r);break}case"ExportNamedDeclaration":{let r=n.declaration;if(r&&typeof r==="object"&&"type"in r)ir([r],t);break}}}}function Hi(e,t){if(!e||typeof e!=="object")return!1;return qi(e,void 0,[...t])}function qi(e,t,n){if(Qr(e.type))return!1;let r=Ut(e);if(r)n.push(sm(e));let i=!1;if(t&&e.type==="Identifier"&&e.name!==void 0&&nc.has(e.name)&&!t.type.startsWith("TS")&&tm(e,t)&&!im(e.name,n))i=!0;else for(let a in e){if(a==="leadingComments")continue;let s=e[a];if(!s||typeof s!=="object")continue;if(Array.isArray(s)){for(let p=0;p<s.length;p++){let c=s[p];if(c&&typeof c==="object"&&typeof c.type==="string"){if(qi(c,e,n)){i=!0;break}}}if(i)break}else if(typeof s.type==="string"){if(qi(s,e,n)){i=!0;break}}}if(r)n.pop();return i}function rc(e){if(e.runesOptionOverride!==void 0)return e.runesOptionOverride?"runes":"legacy";let t=e.parsed;if(!t)return"legacy";if(e.source!==void 0&&!rm(e.source))return"legacy";let n=new Set;ir(t.module?.content.body,n);let r=new Set;return ir(t.instance?.content.body,r),Hi(t.module,[n])||Hi(t.instance,[n,r])||Hi(t.fragment,[n,r])?"runes":"legacy"}var ic=new Set(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion","TSInstantiationExpression"]);function Ui(e){return e!==null&&typeof e==="object"&&typeof e.type==="string"}function sc(e){if(!ic.has(e.type))return e;let t=e.expression;while(t&&ic.has(t.type))t=t.expression;return t??e}function sr(e){if(!Ui(e))return;Gi(e)}function Gi(e){for(let t in e){if(t==="leadingComments")continue;let n=e[t];if(!n||typeof n!=="object")continue;if(Array.isArray(n))for(let r=0;r<n.length;r++){let i=n[r];if(!Ui(i))continue;let a=sc(i);if(a!==i)n[r]=a;Gi(a)}else if(Ui(n)){let r=sc(n);if(r!==n)e[t]=r;Gi(r)}}}var ac=/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi,oc=/\/\/(?<!^[ \t]*\*.*\/\/)\s*@ts-[^\n\r]*/gm;function am(e){if(!e.includes("@ts-"))return e;return ac.lastIndex=0,e.replace(ac,(t,n,r,i)=>{oc.lastIndex=0;let a=r.replace(oc,"");return n+a+i})}function pc(e,t,n){e.componentFilePath=n;let r=am(t);e.source=r;let i=$i(r);if(Na(e,i),e.parsed=i,e.scriptLanguage==="ts")sr(i.module),sr(i.instance),sr(i.fragment);e.syntaxMode=rc(e);let a=i.css,s=a?r.slice(0,a.start)+" ".repeat(a.end-a.start)+r.slice(a.end):r;Rr(e,i.module),Rr(e,i.instance),ec(e,s)}class Wi{ctx=gr();cleanup(){this.ctx=gr()}parseSvelteComponent(e,t){let{component:n,pending:r}=this.parse(e,t);if(r)n[$e]={...n[$e]??{canonicalPropNames:[],localTypeDeclarations:[],typeImportStatements:[]},...r};return n}parse(e,t){this.cleanup();let n=this.ctx;pc(n,e,t.filePath),hp(n);let r=Oa(n);return ap(n,r)}}var om=/\.$/,zi="resolving it needs file access (generateBundle or the CLI)";function pm(e,t={}){let n=e[$e];if(!n)return e;let{pendingCallDefaultCandidates:r,pendingConstDefaultCandidates:i,pendingContextKeyCandidates:a,pendingDispatchEscapeCandidates:s,deferredEventNoSourceDiagnostics:p,untypedJsDocEventNames:c,...d}=n,u=(r??[]).filter((k)=>k.importSource!==void 0);if(u.length===0&&!i&&!a&&!s&&!p)return e;let y=e.filePath,x=t.filePath??(typeof y==="string"?y:""),g=[],C=(k,_,j,Fe)=>{g.push(hn({component:x,kind:"cross-file-unresolved",name:k,message:_,...j?{source:j}:{},...Fe?{ignored:Fe}:{}}))},v=(k,_)=>(k==="props"?e.props:e.moduleExports).find((j)=>j.name===_)?.source,w=(k)=>k==="props"?"Prop":"Module export";for(let k of a??[]){let _=Vt(k);C(_,`setContext key \`${_}\` is imported from "${k.importSource}"; ${zi}, so the context is omitted.`,k.source)}for(let k of i??[])C(k.propName,`${w(k.location)} "${k.propName}" defaults to \`${Vt(k)}\` imported from "${k.importSource}"; ${zi}, so the default shows the identifier and its type isn't read.`,v(k.location,k.propName));for(let k of u)C(k.propName,`${w(k.location)} "${k.propName}" defaults to \`${k.calleeName}()\` imported from "${k.importSource}"; ${zi}, so its return type isn't read and the prop falls back to "any".`,v(k.location,k.propName));for(let k of s??[])C(k.calleeText,`\`${k.dispatcherName}\` is passed to \`${k.calleeText}\`, imported from "${k.importSource}"; reading the events it dispatches needs file access (generateBundle or the CLI), so they're omitted.`,k.source,k.ignored);let R=Array.from(new Set((s??[]).map((k)=>`\`${k.calleeText}\``))).join(", "),B=(p??[]).map((k)=>R?{...k,message:`${k.message.replace(om,"")} in this file; ${R} may dispatch it, but imported helpers aren't read without file access.`}:k),L={...e,diagnostics:[...e.diagnostics??[],...B,...g]};return L[$e]=d,L}var lc="sveld",uc="0.38.0";var Ki="5.57.1";var dc=1;function at(e){return e.some((t)=>t.internal)?e.filter((t)=>!t.internal):e}function lm(e){return{...e,props:at(e.props),moduleExports:at(e.moduleExports),slots:at(e.slots),events:at(e.events),typedefs:at(e.typedefs),...e.contexts?{contexts:at(e.contexts).map((t)=>({...t,properties:at(t.properties)}))}:{}}}function Ji(e,t={}){let n=Array.from(e,([,a])=>{let{diagnostics:s,...p}=a;return lm(p)}).sort((a,s)=>je(a.moduleName,s.moduleName)),r={schemaVersion:dc,generator:{name:lc,version:uc,svelteVersion:Ki},total:n.length,components:n},i=t.entryExports?at(t.entryExports):void 0;if(i&&i.length>0)r.totalExports=i.length,r.exports=i;return r}var um=" ",dm=120,fm=/\binterface\s+[A-Za-z_$][\w$]*(\s*<[^{};]*>)?\s*$/,hm=200,yc=/\s/,mm=/\s{2}|[^\S ]/,ym=/["'`{}/]/g,gm=/["'`{};/]/g,gc=9,Xi=10,xm=13,ln=32,or=34,bm=38,pr=39,Tm=40,vm=41,ar=42,fc=46,Qi=47,xc=59,Sm=62,Em=91,Zi=92,Cm=93,cr=96,es=123,Pm=124,ts=125;function Am(e){return fm.test(e.slice(-200))}var hc=[""];function km(e){let t=hc[e];if(t===void 0)t=um.repeat(e),hc[e]=t;return t}function wm(e,t){let n="";for(let r=e.length-1;r>=0&&n.length<t;r--)n=e[r]+n;return n.length>t?n.slice(-t):n}function Nm(e){if(e.length===0)return!1;let t=e[e.length-1];return t.charCodeAt(t.length-1)===Xi}function Dm(e){while(e.length>0){let t=e[e.length-1],n=t.length;while(n>0){let r=t.charCodeAt(n-1);if(r!==ln&&r!==gc)break;n--}if(n===t.length)return;if(n===0){e.pop();continue}e[e.length-1]=t.slice(0,n);return}}function Im(e){while(e.length>0){let t=e[e.length-1];if(!yc.test(t[t.length-1]))return;let n=t.trimEnd();if(n.length===t.length)return;if(n.length===0){e.pop();continue}e[e.length-1]=n;return}}function _m(e){if(e.includes("{"))return!1;let t=0,n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(t!==0){if(i===t&&e.charCodeAt(r-1)!==Zi)t=0;continue}if(i===or||i===pr||i===cr){t=i;continue}if(i===xc&&++n>=2)return!0}return!1}function Lm(e){if(!mm.test(e))return e.trimEnd();let t="",n=null,r=!1;for(let i=0;i<e.length;i++){let a=e[i],s=e[i-1];if(n){if(t+=a,n==="double"&&a==='"'&&s!=="\\"||n==="single"&&a==="'"&&s!=="\\"||n==="template"&&a==="`"&&s!=="\\")n=null;r=!1;continue}if(a==='"'||a==="'"||a==="`"){n=a==='"'?"double":a==="'"?"single":"template",t+=a,r=!1;continue}if(yc.test(a)){if(!r&&t.length>0)t+=" ",r=!0;continue}t+=a,r=!1}return t.trimEnd()}function bc(e,t){let n=e[t],r=e.indexOf(n,t+1);while(r!==-1&&e.charCodeAt(r-1)===Zi)r=e.indexOf(n,r+1);return r}function Tc(e,t){let n=e.indexOf("*/",t+1);return n===-1?-1:n+1}function Rm(e){let t=new Map,n=[],r=ym,i=0;while(i<e.length){if(r.lastIndex=i,!r.test(e))break;i=r.lastIndex-1;let a=e.charCodeAt(i);if(a===Qi){if(e.charCodeAt(i+1)===ar){let s=Tc(e,i);if(s===-1)break;i=s}}else if(a===or||a===pr||a===cr){let s=bc(e,i);if(s===-1)break;i=s}else if(a===es)n.push(i);else if(a===ts&&n.length>0)t.set(n.pop(),i);i++}return t}function Mm(e,t,n){for(let r=t;r<n;r++)if(!Yi(e.charCodeAt(r)))return!1;return!0}function Yi(e){if(e<=ln)return e===ln||e>=gc&&e<=xm;if(e<160)return!1;return e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288||e===65279}function vc(e,t,n,r){let i=[],a=gm,s=t,p=t;while(p<n){if(a.lastIndex=p,!a.test(e))break;if(p=a.lastIndex-1,p>=n)break;let c=e.charCodeAt(p);if(c===Qi){if(e.charCodeAt(p+1)===ar){let d=Tc(e,p);if(d===-1)break;p=d}p++;continue}if(c===or||c===pr||c===cr){let d=bc(e,p);if(d===-1)break;p=d+1;continue}if(c===es){let d=r.get(p);if(d===void 0||d>=n){p++;continue}if(s<p)i.push(e.slice(s,p));let u=p+1;if(Mm(e,u,d)){i.push("{}"),p=d+1,s=p;continue}let y=e.slice(u,d),x=e.charCodeAt(u)===Xi;if(!x&&!y.includes("/*")&&!_m(y)&&!Am(wm(i,hm))){let g=vc(e,u,d,r),C=g.trim();if(!C.includes(`
50
+ `)){let v=C.endsWith(";")?C.slice(0,-1):C,w=`{ ${Lm(v)} }`;if(w.length<=dm){i.push(w),p=d+1,s=p;continue}}if(i.push("{"),g.charCodeAt(0)!==xc)i.push(`
51
+ `);if(g.length>0)i.push(g);p=d,s=d;continue}if(i.push("{"),!x)i.push(`
52
+ `);p=u,s=u;continue}if(c===ts){if(s<p)i.push(e.slice(s,p));if(Dm(i),!Nm(i))i.push(`
53
+ `);i.push("}"),p++,s=p;continue}if(s<p)i.push(e.slice(s,p));if(Im(i),i.push(";"),e.charCodeAt(p+1)!==Xi)i.push(`
54
+ `);p++,s=p}if(s<n)i.push(e.slice(s,n));return i.join("")}function Om(e){return vc(e,0,e.length,Rm(e))}function Bm(e){if(!e.includes(" "))return e;let t="",n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(n!==0){if(t+=e[r],i===n&&e.charCodeAt(r-1)!==Zi)n=0;continue}if(i===or||i===pr||i===cr){n=i,t+=e[r];continue}if(i===ln&&t.charCodeAt(t.length-1)===ln)continue;t+=e[r]}return t}function Fm(e){return e===ts||e===Cm||e===vm||e===Sm}function $m(e,t,n){return n-t>=3&&e.charCodeAt(t)===Qi&&e.charCodeAt(t+1)===ar&&e.charCodeAt(t+2)===ar}function mc(e,t,n){let r=e.indexOf("*/",t);return r!==-1&&r+2<=n}function Vm(e,t,n){let r=e.charCodeAt(t);if(r===Pm||r===bm)return!0;return r===fc&&t+1<n&&e.charCodeAt(t+1)!==fc}function jm(e){let t=[],n=[],r=e.length,i=0,a=!1,s=0,p=0;while(p<=r){let u=e.indexOf(`
55
+ `,p);if(u===-1)u=r;let y=u+1,x=p,g=u;while(x<g&&Yi(e.charCodeAt(x)))x++;while(g>x&&Yi(e.charCodeAt(g-1)))g--;if(x===g){let B=n.length>0?n[n.length-1]:void 0;if(B!==void 0&&B!==""){let L=B.charCodeAt(B.length-1);if(L!==es&&L!==Tm&&L!==Em)t.push(0),n.push("")}p=y;continue}if(a){if(t.push(s),n.push(` ${e.slice(x,g)}`),mc(e,x,g))a=!1;p=y;continue}let C=$m(e,x,g),v=C&&mc(e,x,g);if(C&&!v){t.push(i),n.push(e.slice(x,g)),a=!0,s=i,p=y;continue}let w=Fm(e.charCodeAt(x)),R=Math.max(0,i-(w?1:0))+(Vm(e,x,g)?1:0);if(w&&R===0&&n.length>0&&n[n.length-1]==="")t.pop(),n.pop();if(t.push(R),n.push(Bm(e.slice(x,g))),p=y,v)continue;i=Tt(e,void 0,x,g,i)}let c=n.length;while(c>0&&n[c-1]==="")c--;let d=[];for(let u=0;u<c;u++){if(u>0)d.push(`
56
+ `);let y=t[u];if(y>0)d.push(km(y));d.push(n[u])}return d.join("")}function Sc(e){return`${jm(Om(e))}
57
+ `}var Ie="any",we="",Hm="Record<string, any>",ss="Record<string, never>",as=/^[A-Za-z_$][A-Za-z0-9_$]*$/,qm=/CustomEvent/,Um=/^[A-Z]/,Gm=/\n/,kc=/=>/,Wm=/(?:^|\n)@default\b/,os=/\n/g,zm=/^([ \t]*\*) +$/gm,Km=/\s+/g,Lt=/(^|[^.\w])Snippet(?:\s*<|\b)/,Jm=/import\s+type\s+[^;]*\bSnippet\b[^;]*from\s+"svelte";/,Xm=/[.*+?^${}()|[\]\\]/g,Ym=/^const\s+/,Qm=/^export /,Zm=/[^\w$]/g;function ps(e){return e.replace(Ym,"")}function ey(e){if(!e)return;return e.replace(os,`
58
+ * `)}function ur(e){if(!e)return"";return`/** ${Ve(e)} */`}function dr(e){if(!e)return"";return`/**
59
+ * ${Ve(e).replace(os,`
58
60
  * `)}
59
- */`}function Qc(e){if(e===void 0)return;return e===!0?"@deprecated":`@deprecated ${e}`}function Qh(e){let t=Qc(e);if(t===void 0)return;return`* ${t.replace(is,`
61
+ */`}function wc(e){if(e===void 0)return;return e===!0?"@deprecated":`@deprecated ${e}`}function ty(e){let t=wc(e);if(t===void 0)return;return`* ${t.replace(os,`
60
62
  * `)}
61
- `}function Zh(e,t){if(!t)return[`@${e}`];if(!t.includes(`
63
+ `}function ny(e,t){if(!t)return[`@${e}`];if(!t.includes(`
62
64
  `))return[`@${e} ${t}`];return[`@${e}`,...t.split(`
63
- `)]}function as(e){let t=[];for(let{name:n,body:r}of e??[])t.push(...Zh(n,r));return t}function On(e,t,n,r){if(r==="none")return"";let i=Qc(n),o=r==="all"?as(t):[],s=o.length>0;if(!e&&!s&&!i)return"";if(!s&&!i)return e?.includes(`
64
- `)?Tr(e):br(e);let c=[];if(e)c.push(...e.split(`
65
- `));if(c.push(...o),i)c.push(...i.split(`
65
+ `)]}function cs(e){let t=[];for(let{name:n,body:r}of e??[])t.push(...ny(n,r));return t}function lr(e,t,n){let r=wc(n),i=cs(t),a=i.length>0;if(!e&&!a&&!r)return"";if(!a&&!r)return e?.includes(`
66
+ `)?dr(e):ur(e);let s=[];if(e)s.push(...e.split(`
67
+ `));if(s.push(...i),r)s.push(...r.split(`
66
68
  `));return`/**
67
- * ${ft(c.join(`
69
+ * ${Ve(s.join(`
68
70
  * `))}
69
- */`}function em(e){let t=as(e);if(t.length===0)return"";return t.map((n)=>`* ${n}
70
- `).join("")}function Er(e){if(e===void 0)return it;return`${e}
71
- `}function Cr(e,t={export:!0},n="all"){if(e.typedefs.length===0)return $e;let r=t.export?"export ":"";return e.typedefs.map((i)=>{let o=$e;if(n!=="none"){let s=n==="all"?as(i.tags):[];if(s.length===0)o=i.description?`${Tr(i.description)}
72
- `:"";else{let c=i.description?[...i.description.split(`
73
- `),...s]:s;o=`/**
74
- * ${ft(c.join(`
71
+ */`}function ry(e){let t=cs(e);if(t.length===0)return"";return t.map((n)=>`* ${n}
72
+ `).join("")}function fr(e){if(e===void 0)return Ie;return`${e}
73
+ `}function hr(e){if(e.typedefs.length===0)return we;return e.typedefs.map((t)=>{let n,r=cs(t.tags);if(r.length===0)n=t.description?`${dr(t.description)}
74
+ `:"";else{let i=t.description?[...t.description.split(`
75
+ `),...r]:r;n=`/**
76
+ * ${Ve(i.join(`
75
77
  * `))}
76
78
  */
77
- `}}return`${o}${r}${i.ts}`.replace(qh,"$1")}).join(`
79
+ `}return`${n}export ${t.ts}`.replace(zm,"$1")}).join(`
78
80
 
79
- `)}var Kc=new Map;function ts(e,t){let n=Kc.get(t);if(n===void 0){let r=t.replace(Wh,"\\$&");n=new RegExp(`\\b${r}\\b`),Kc.set(t,n)}return n.test(e)}var zc,Jc=[];function os(e){if(e!==zc)zc=e,Jc=lt(e);return Jc}function tm(e){if(e===null)return[];return e[0].split(",").map((t,n)=>({name:t.trim(),constraint:(os(e[1]??"")[n]??t).trim()}))}function nm(e,t){let n=tm(e).filter(({name:r})=>ts(t,r));if(n.length===0)return{declSuffix:$e,refSuffix:$e};return{declSuffix:`<${n.map(({constraint:r})=>ss(r)).join(", ")}>`,refSuffix:`<${n.map(({name:r})=>r).join(", ")}>`}}function Zc(e,t={export:!0},n="all"){if(!e.contexts||e.contexts.length===0)return $e;let r=t.export?"export ":"",i=e.generics===null?[]:e.generics[0].split(",").map((o,s)=>({name:o.trim(),constraint:(os(e.generics?.[1]??"")[s]??o).trim()}));return e.contexts.map((o)=>{let s=o.properties.map((y)=>{let g=n!=="none"&&y.description?`${br(y.description)}
80
- `:"",b=y.optional?"?":"";return`${g}${y.name}${b}: ${y.type};`}).join(`
81
- `),c=n!=="none"&&o.description?`${Tr(o.description)}
82
- `:"",l=i.filter(({name:y})=>o.type!==void 0&&ts(o.type,y)||o.properties.some((g)=>ts(g.type,y))).map(({constraint:y})=>y),d=l.length>0?`<${l.map(ss).join(", ")}>`:"";if(o.type!==void 0)return`${c}${r}type ${o.typeName}${d} = ${o.type};`;if(o.properties.length===0)return o.hasUnresolvedSpread?`${c}${r}type ${o.typeName} = Record<string, any>;`:`${c}${r}type ${o.typeName} = Record<string, never>;`;let u=o.hasUnresolvedSpread?" & Record<string, any>":"";return`${c}${r}type ${o.typeName}${d} = {
83
- ${s}
84
- }${u};`}).join(`
81
+ `)}var Ec=new Map;function rs(e,t){let n=Ec.get(t);if(n===void 0){let r=t.replace(Xm,"\\$&");n=new RegExp(`\\b${r}\\b`),Ec.set(t,n)}return n.test(e)}var Cc,Pc=[];function ls(e){if(e!==Cc)Cc=e,Pc=se(e,",");return Pc}function iy(e){if(e===null)return[];return e[0].split(",").map((t,n)=>({name:t.trim(),constraint:(ls(e[1]??"")[n]??t).trim()}))}function sy(e,t){let n=iy(e).filter(({name:r})=>rs(t,r));if(n.length===0)return{declSuffix:we,refSuffix:we};return{declSuffix:`<${n.map(({constraint:r})=>ps(r)).join(", ")}>`,refSuffix:`<${n.map(({name:r})=>r).join(", ")}>`}}function Nc(e){if(!e.contexts||e.contexts.length===0)return we;let t=e.generics===null?[]:e.generics[0].split(",").map((n,r)=>({name:n.trim(),constraint:(ls(e.generics?.[1]??"")[r]??n).trim()}));return e.contexts.map((n)=>{let r=n.properties.map((c)=>{let d=c.description?`${ur(c.description)}
82
+ `:"",u=c.optional?"?":"";return`${d}${c.name}${u}: ${c.type};`}).join(`
83
+ `),i=n.description?`${dr(n.description)}
84
+ `:"",a=t.filter(({name:c})=>n.type!==void 0&&rs(n.type,c)||n.properties.some((d)=>rs(d.type,c))).map(({constraint:c})=>c),s=a.length>0?`<${a.map(ps).join(", ")}>`:"";if(n.type!==void 0)return`${i}export type ${n.typeName}${s} = ${n.type};`;if(n.properties.length===0)return n.hasUnresolvedSpread?`${i}export type ${n.typeName} = Record<string, any>;`:`${i}export type ${n.typeName} = Record<string, never>;`;let p=n.hasUnresolvedSpread?" & Record<string, any>":"";return`${i}export type ${n.typeName}${s} = {
85
+ ${r}
86
+ }${p};`}).join(`
85
87
 
86
- `)}function _t(e){return xr.test(e)?e:JSON.stringify(e)}function ep(e,t){if(!e)return;return`* ${t||e}
87
- `}function rn(e,t,n,r="all"){if(r==="none")return $e;return[ep(Yh(e)),Qh(t),r==="all"?em(n):void 0].filter(Boolean).join("")}function $t(e){return e.length>0?`/**
88
- ${ft(e)}*/`:$e}function rm(e,t={export:!0},n="all"){let r=t.export?"export ":"",i=e.props.filter((v)=>!v.isFunctionDeclaration&&v.kind!=="const"),o=new Set([...i.map((v)=>v.name),...Array.from(e.canonicalPropNames??[])]),s=i.map((v)=>{let w=typeof v.value==="string"?v.value.replace(Uh," "):v.value,G=Hh.test(v.description??"")||v.value===void 0,X=[rn(v.description,v.deprecated,v.tags,n),n==="all"?ep(v.constant,"@constant"):null,n==="all"&&!G?`* @default ${w}
89
- `:null].filter(Boolean).join(""),be=v.constant&&!v.isFunction?v.value:v.type||it;return`
90
- ${$t(X)}
91
- ${_t(v.name)}${v.isRequired?"":"?"}: ${be};`}),c=e.canonicalPropsType?s.filter((v,w)=>{let M=i[w];return M?!(e.canonicalPropNames?.has(M.name)??!1):!0}):s,l=(e.slots||[]).filter((v)=>!v.default&&v.name!=null&&!o.has(v.name)).map((v)=>{let w=v.name,M=_t(w),G=On(v.description,v.tags,v.deprecated,n),X=G?`${G}
92
- `:"",a=v.slot_props&&v.slot_props!=="Record<string, never>"?`(this: void, ...args: [${v.slot_props}]) => void`:"(this: void) => void";return`
93
- ${X}${M}?: ${a};`}),d=(e.slots||[]).find((v)=>v.default||v.name===null),u=d&&!o.has("children")?(()=>{let v=On(d.description,d.tags,d.deprecated,n),w=v?`${v}
94
- `:"",G=d.slot_props&&d.slot_props!=="Record<string, never>"?`(this: void, ...args: [${d.slot_props}]) => void`:"(this: void) => void";return`
95
- ${w}children?: ${G};`})():"",y=e.events?pm({events:e.events},o,n):[],g=[...l,u,...y].filter(Boolean),b=[...c,...g].join(`
96
- `),P=Sm(e.moduleName,t.typeNames),N=$e,D=e.generics?`<${os(e.generics[1]).map((v)=>ss(v.trim())).join(", ")}>`:"",j=e.generics?`<${e.generics[0]}>`:"",U=e.canonicalPropsType?`
97
- type $Props${D} = ${e.canonicalPropsType}${b.trim()===""?"":` & {${b}
88
+ `)}function mt(e){return as.test(e)?e:JSON.stringify(e)}function Dc(e,t){if(!e)return;return`* ${t||e}
89
+ `}function Rt(e,t,n){return[Dc(ey(e)),ty(t),ry(n)].filter(Boolean).join("")}function yt(e){return e.length>0?`/**
90
+ ${Ve(e)}*/`:we}function ay(e){let t=e.props.filter((v)=>!v.isFunctionDeclaration&&v.kind!=="const"),n=new Set([...t.map((v)=>v.name),...Array.from(e.canonicalPropNames??[])]),r=t.map((v)=>{let w=typeof v.value==="string"?v.value.replace(Km," "):v.value,B=Wm.test(v.description??"")||v.value===void 0||v.value==="undefined",L=[Rt(v.description,v.deprecated,v.tags),Dc(v.constant,"@constant"),B?null:`* @default ${w}
91
+ `].filter(Boolean).join(""),k=v.constant&&!v.isFunction?v.value:v.type||Ie;return`
92
+ ${yt(L)}
93
+ ${mt(v.name)}${v.isRequired?"":"?"}: ${k};`}),i=e.canonicalPropsType?r.filter((v,w)=>{let R=t[w];return R?!(e.canonicalPropNames?.has(R.name)??!1):!0}):r,a=(e.slots||[]).filter((v)=>!v.default&&v.name!=null&&!n.has(v.name)).map((v)=>{let w=v.name,R=mt(w),B=lr(v.description,v.tags,v.deprecated),L=B?`${B}
94
+ `:"",_=v.slot_props&&v.slot_props!=="Record<string, never>"?`(this: void, ...args: [${v.slot_props}]) => void`:"(this: void) => void";return`
95
+ ${L}${R}?: ${_};`}),s=(e.slots||[]).find((v)=>v.default||v.name===null),p=s&&!n.has("children")?(()=>{let v=lr(s.description,s.tags,s.deprecated),w=v?`${v}
96
+ `:"",B=s.slot_props&&s.slot_props!=="Record<string, never>"?`(this: void, ...args: [${s.slot_props}]) => void`:"(this: void) => void";return`
97
+ ${w}children?: ${B};`})():"",c=[...a,p].filter(Boolean),d=[...i,...c].join(`
98
+ `),u=Py(e.moduleName),y=we,x=e.generics?`<${ls(e.generics[1]).map((v)=>ps(v.trim())).join(", ")}>`:"",g=e.generics?`<${e.generics[0]}>`:"",C=e.canonicalPropsType?`
99
+ type $Props${x} = ${e.canonicalPropsType}${d.trim()===""?"":` & {${d}
98
100
  }`};
99
101
  `:`
100
- type $Props${D} = {
101
- ${b}
102
+ type $Props${x} = {
103
+ ${d}
102
104
  };
103
- `;if(e.rest_props?.type==="Element"){let v;if(e.rest_props.name==="svelte:element")if(e.rest_props.thisValue)v=`SvelteHTMLElements["${e.rest_props.thisValue}"]`;else v="HTMLAttributes<HTMLElement>";else v=e.rest_props.name.split("|").map((G)=>`SvelteHTMLElements["${G.trim()}"]`).join(" & ");let w="[key: `data-${string}`]: unknown;",M=n!=="none"&&e.rest_props.description?e.rest_props.description.includes(`
104
- `)?`${Tr(e.rest_props.description)}
105
- `:`${br(e.rest_props.description)}
106
- `:"";if(e.extends===void 0)N=`
107
- ${M}${v?`type $RestProps = ${v};
105
+ `;if(e.rest_props?.type==="Element"){let v;if(e.rest_props.name==="svelte:element")if(e.rest_props.thisValue)v=`SvelteHTMLElements["${e.rest_props.thisValue}"]`;else v="HTMLAttributes<HTMLElement>";else v=e.rest_props.name.split("|").map((B)=>`SvelteHTMLElements["${B.trim()}"]`).join(" & ");let w="[key: `data-${string}`]: unknown;",R=e.rest_props.description?e.rest_props.description.includes(`
106
+ `)?`${dr(e.rest_props.description)}
107
+ `:`${ur(e.rest_props.description)}
108
+ `:"";if(e.extends===void 0)y=`
109
+ ${R}${v?`type $RestProps = ${v};
108
110
  `:""}
109
- ${e.canonicalPropsType?`type $Props${D} = (${e.canonicalPropsType}) & {${b}
111
+ ${e.canonicalPropsType?`type $Props${x} = (${e.canonicalPropsType}) & {${d}
110
112
 
111
113
  ${w}
112
- };`:`type $Props${D} = {
113
- ${b}
114
+ };`:`type $Props${x} = {
115
+ ${d}
114
116
 
115
117
  ${w}
116
118
  };`}
117
119
 
118
- ${r}type ${P}${D} = Omit<$RestProps, keyof $Props${j}> & $Props${j};
119
- `;else N=`
120
- ${M}${v?`type $RestProps = ${v};
120
+ export type ${u}${x} = Omit<$RestProps, keyof $Props${g}> & $Props${g};
121
+ `;else y=`
122
+ ${R}${v?`type $RestProps = ${v};
121
123
  `:""}
122
- ${e.canonicalPropsType?`type $Props${D} = (${e.canonicalPropsType}) & {${b}
124
+ ${e.canonicalPropsType?`type $Props${x} = (${e.canonicalPropsType}) & {${d}
123
125
 
124
126
  ${w}
125
- };`:`type $Props${D} = {
126
- ${b}
127
+ };`:`type $Props${x} = {
128
+ ${d}
127
129
 
128
130
  ${w}
129
131
  };`}
130
132
 
131
- ${r}type ${P}${D} = Omit<$RestProps, keyof ($Props${j} & ${e.extends.interface})> & Omit<${e.extends.interface}, keyof $Props${j}> & $Props${j};
132
- `}else if(b.trim()===""&&e.extends===void 0&&!e.canonicalPropsType)N=`
133
- ${r}type ${P}${D} = ${rs};
134
- `;else if(e.canonicalPropsType)N=`
135
- ${U}
136
- ${r}type ${P}${D} = ${e.extends===void 0?"":`Omit<${e.extends.interface}, keyof $Props${j}> & `}$Props${j};
137
- `;else if(e.extends===void 0)N=t.propsDeclaration==="interface"&&b.trim()!==""?`
138
- ${r}interface ${P}${D} {
139
- ${b}
140
- }
141
- `:`
142
- ${r}type ${P}${D} = {
143
- ${b}
133
+ export type ${u}${x} = Omit<$RestProps, keyof ($Props${g} & ${e.extends.interface})> & Omit<${e.extends.interface}, keyof $Props${g}> & $Props${g};
134
+ `}else if(d.trim()===""&&e.extends===void 0&&!e.canonicalPropsType)y=`
135
+ export type ${u}${x} = ${ss};
136
+ `;else if(e.canonicalPropsType)y=`
137
+ ${C}
138
+ export type ${u}${x} = ${e.extends===void 0?"":`Omit<${e.extends.interface}, keyof $Props${g}> & `}$Props${g};
139
+ `;else if(e.extends===void 0)y=`
140
+ export type ${u}${x} = {
141
+ ${d}
144
142
  };
145
- `;else N=`
146
- type $Props${D} = {
147
- ${b}
143
+ `;else y=`
144
+ type $Props${x} = {
145
+ ${d}
148
146
  };
149
147
 
150
- ${r}type ${P}${D} = Omit<${e.extends.interface}, keyof $Props${j}> & $Props${j};
151
- `;return{props_name:P,prop_def:N}}function im(e,t="all"){if(e.slots.length===0)return rs;let n=e.slots.map(({name:r,slot_props:i,...o})=>{let s=o.default||r===null?"default":_t(r??""),c=On(o.description,o.tags,o.deprecated,t);return`${c?`${c}
152
- `:""}${s}: ${Er(i)};`}).join(`
153
- `);return e.slots.length===1?`{${n}}`:`{
154
- ${n}
155
- }`}var sm=()=>"WindowEventMap",am=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave","contextmenu","wheel","keydown","keyup","keypress","submit","change","input","focus","blur","focusin","focusout","reset","select","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragover","dragenter","dragleave","drop","pointerdown","pointerup","pointermove","pointerover","pointerout","pointerenter","pointerleave","pointercancel","gotpointercapture","lostpointercapture","play","pause","ended","volumechange","timeupdate","loadeddata","loadedmetadata","canplay","canplaythrough","seeking","seeked","playing","waiting","stalled","suspend","abort","error","emptied","ratechange","durationchange","loadstart","progress","loadend","animationstart","animationend","animationiteration","animationcancel","transitionstart","transitionend","transitionrun","transitioncancel","scroll","resize","load","unload","beforeunload","cut","copy","paste","compositionstart","compositionupdate","compositionend"]);function Mn(e=it){if($h.test(e))return e;return`CustomEvent<${e}>`}function om(e){return am.has(e)}function tp(e){switch(e.type){case"dispatched":return Mn(e.detail);case"forwarded":{let t=e.element,r=!(t&&Vh.test(t))||om(e.name),i=e.detail!==void 0&&e.detail!=="undefined"&&!(e.detail==="null"&&r),o=e.detail==="null"&&!r;if(i||o)return Mn(e.detail);else if(r)return`${sm()}["${e.name}"]`;else return Mn()}default:return e}}function cm(e,t="all"){if(e.events.length===0)return Fh;let n=e.events.map((r)=>{let i="",o=On(r.description,r.tags,r.deprecated,t);if(o)i=`${o}
156
- `;return`${i}${_t(r.name)}: ${tp(r)};
157
- `}).join("");return e.events.length===1?`{${n}}`:`{
158
- ${n}}`}function pm(e,t,n="all"){return e.events.map((r)=>{let i=`on${r.name}`;if(t.has(i))return;let o="",s=On(r.description,r.tags,r.deprecated,n);if(s)o=`${s}
159
- `;return`
160
- ${o}${_t(i)}?: (event: ${tp(r)}) => void;`}).filter((r)=>r!==void 0)}function lm(e){let t=e.type==="() => any";if(e.type&&Yc.test(e.type)&&!t)return e.type;else if(e.params&&e.params.length>0)return`(${Ct(e.params)}) => ${e.returnType||it}`;else if(e.returnType)return`() => ${e.returnType}`;else return e.type||it}function np(e,t="all"){return e.props.filter((n)=>n.isFunctionDeclaration||n.kind==="const").map((n)=>{let r=rn(n.description,n.deprecated,n.tags,t),i=lm(n);return`
161
- ${$t(r)}
162
- ${_t(n.name)}: ${i};`}).join(`
163
- `)}function um(e,t={export:!0},n="all"){let r=t.export?"export ":"",i=vm(e.moduleName,t.typeNames),o=np({props:e.props},n);if(o.trim()==="")return{exports_name:i,exports_ref:i,exports_def:`${r}type ${i} = ${rs};`};let{declSuffix:s,refSuffix:c}=nm(e.generics,o);return{exports_name:i,exports_ref:`${i}${c}`,exports_def:`${r}type ${i}${s} = {${o}
164
- };`}}function dm(e){let t=e.props.filter((n)=>n.bindable===!0||n.binding==="writable").map((n)=>JSON.stringify(n.name));return t.length===0?$e:t.join(" | ")}function cs(e){return e==="default"?"$$Component":e}function fm(e){let t=cs(e.moduleName),n=e.bindings===$e?'""':e.bindings;return`declare const ${t}: Component<
148
+ export type ${u}${x} = Omit<${e.extends.interface}, keyof $Props${g}> & $Props${g};
149
+ `;return{props_name:u,prop_def:y}}function oy(e){if(e.slots.length===0)return ss;let t=e.slots.map(({name:n,slot_props:r,...i})=>{let a=i.default||n===null?"default":mt(n??""),s=lr(i.description,i.tags,i.deprecated);return`${s?`${s}
150
+ `:""}${a}: ${fr(r)};`}).join(`
151
+ `);return e.slots.length===1?`{${t}}`:`{
152
+ ${t}
153
+ }`}var py=()=>"WindowEventMap",cy=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave","contextmenu","wheel","keydown","keyup","keypress","submit","change","input","focus","blur","focusin","focusout","reset","select","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragover","dragenter","dragleave","drop","pointerdown","pointerup","pointermove","pointerover","pointerout","pointerenter","pointerleave","pointercancel","gotpointercapture","lostpointercapture","play","pause","ended","volumechange","timeupdate","loadeddata","loadedmetadata","canplay","canplaythrough","seeking","seeked","playing","waiting","stalled","suspend","abort","error","emptied","ratechange","durationchange","loadstart","progress","loadend","animationstart","animationend","animationiteration","animationcancel","transitionstart","transitionend","transitionrun","transitioncancel","scroll","resize","load","unload","beforeunload","cut","copy","paste","compositionstart","compositionupdate","compositionend"]);function ns(e=Ie){if(qm.test(e))return e;return`CustomEvent<${e}>`}function ly(e){return cy.has(e)}function uy(e){switch(e.type){case"dispatched":return ns(e.detail);case"forwarded":{let t=e.element,r=!(t&&Um.test(t))||ly(e.name),i=e.detail!==void 0&&e.detail!=="undefined"&&!(e.detail==="null"&&r),a=e.detail==="null"&&!r;if(i||a)return ns(e.detail);else if(r)return`${py()}["${e.name}"]`;else return ns()}default:return e}}function Ac(e){if(e.events.length===0)return Hm;let t=e.events.map((n)=>{let r="",i=lr(n.description,n.tags,n.deprecated);if(i)r=`${i}
154
+ `;return`${r}${mt(n.name)}: ${uy(n)};
155
+ `}).join("");return e.events.length===1?`{${t}}`:`{
156
+ ${t}}`}function dy(e){let t=e.type==="() => any";if(e.type&&kc.test(e.type)&&!t)return e.type;else if(e.params&&e.params.length>0)return`(${Ye(e.params)}) => ${e.returnType||Ie}`;else if(e.returnType)return`() => ${e.returnType}`;else return e.type||Ie}function Ic(e){return e.props.filter((t)=>t.isFunctionDeclaration||t.kind==="const").map((t)=>{let n=Rt(t.description,t.deprecated,t.tags),r=dy(t);return`
157
+ ${yt(n)}
158
+ ${mt(t.name)}: ${r};`}).join(`
159
+ `)}function fy(e){let t=Ay(e.moduleName),n=Ic({props:e.props});if(n.trim()==="")return{exports_name:t,exports_ref:t,exports_def:`export type ${t} = ${ss};`};let{declSuffix:r,refSuffix:i}=sy(e.generics,n);return{exports_name:t,exports_ref:`${t}${i}`,exports_def:`export type ${t}${r} = {${n}
160
+ };`}}function hy(e){let t=e.props.filter((n)=>n.bindable===!0||n.binding==="writable").map((n)=>JSON.stringify(n.name));return t.length===0?we:t.join(" | ")}function _c(e){return e==="default"?"$$Component":e}function my(e){let t=_c(e.moduleName),n=e.bindings===we?'""':e.bindings;return`declare const ${t}: Component<
165
161
  ${e.propsRef},
166
162
  ${e.exportsRef},
167
163
  ${n}
168
164
  >;
169
- export default ${t};`}function hm(e){let t=cs(e.moduleName),n=`${t}Component`,r=e.bindings===$e?'""':e.bindings;return`interface ${n} {
165
+ export default ${t};`}function yy(e){let t=_c(e.moduleName),n=`${t}Component`,r=e.bindings===we?'""':e.bindings,i=e.eventsRef?`$on?<K extends keyof ${e.eventsRef} & string>(type: K, callback: (e: ${e.eventsRef}[K]) => void): () => void;`:"$on?(type: string, callback: (e: any) => void): () => void;";return`interface ${n} {
170
166
  new ${e.generic}(
171
167
  options: ComponentConstructorOptions<${e.propsRef}>
172
- ): SvelteComponent<${e.propsRef}> & ${e.exportsRef};
168
+ ): SvelteComponent<${e.propsRef}${e.eventsRef?`, ${e.eventsRef}`:""}> & ${e.exportsRef};
173
169
  ${e.generic}(
174
170
  this: void,
175
171
  internals: ComponentInternals,
176
172
  props: ${e.propsRef}
177
173
  ): {
178
- $on?(type: string, callback: (e: any) => void): () => void;
174
+ ${i}
179
175
  $set?(props: Partial<${e.propsRef}>): void;
180
176
  } & ${e.exportsRef};
181
177
  element?: typeof HTMLElement;
182
178
  z_$$bindings?: ${r};
183
179
  }
184
180
  declare const ${t}: ${n};
185
- export default ${t};`}function mm(e){if(e.extends===void 0)return"";return`import type { ${e.extends.interface} } from ${e.extends.import};`}function ym(e,t="all"){if(t==="none"||!e.componentComment)return"";if(!jh.test(e.componentComment))return br(e.componentComment.trim());return`/*${ft(e.componentComment).split(`
186
- `).map((n)=>`* ${n}`).join(`
181
+ export default ${t};`}function gy(e){if(e.extends===void 0)return"";return`import type { ${e.extends.interface} } from ${e.extends.import};`}function xy(e){if(!e.componentComment)return"";if(!Gm.test(e.componentComment))return ur(e.componentComment.trim());return`/*${Ve(e.componentComment).split(`
182
+ `).map((t)=>`* ${t}`).join(`
187
183
  `)}
188
- */`}function ns(e){return xr.test(e)?e:JSON.stringify(e)}function gm(e,t){let n=[],r=new Map;for(let i of e.moduleExports){if(i.kind!=="re-export"||!i.reExport)continue;let{from:o,imported:s}=i.reExport,c=rn(i.description,i.deprecated,i.tags,t),l=ns(i.name);if(s==="*"){let y=i.name==="*"?"*":`* as ${l}`;n.push(`${$t(c)}
189
- export ${y} from ${JSON.stringify(o)};`);continue}let d=`${o}\x00${c}`,u=r.get(d);if(!u)u={comments:c,from:o,specifiers:[]},r.set(d,u),n.push(d);u.specifiers.push(s===i.name?l:`${ns(s)} as ${l}`)}return n.map((i)=>{let o=r.get(i);if(!o)return i;return`${$t(o.comments)}
190
- export { ${o.specifiers.join(", ")} } from ${JSON.stringify(o.from)};`}).join(`
184
+ */`}function is(e){return as.test(e)?e:JSON.stringify(e)}function by(e){let t=[],n=new Map;for(let r of e.moduleExports){if(r.kind!=="re-export"||!r.reExport)continue;let{from:i,imported:a}=r.reExport,s=Rt(r.description,r.deprecated,r.tags),p=is(r.name);if(a==="*"){let u=r.name==="*"?"*":`* as ${p}`;t.push(`${yt(s)}
185
+ export ${u} from ${JSON.stringify(i)};`);continue}let c=`${i}\x00${s}`,d=n.get(c);if(!d)d={comments:s,from:i,specifiers:[]},n.set(c,d),t.push(c);d.specifiers.push(a===r.name?p:`${is(a)} as ${p}`)}return t.map((r)=>{let i=n.get(r);if(!i)return r;return`${yt(i.comments)}
186
+ export { ${i.specifiers.join(", ")} } from ${JSON.stringify(i.from)};`}).join(`
191
187
 
192
- `)}function ps(e){let t=[e.static?"static ":"",e.abstract?"abstract ":"",e.readonly?"readonly ":""].join(""),n=e.optional?"?":"";if(e.kind==="property")return`${t}${_t(e.name)}${n}: ${e.type??it}`;let r=Ct(e.params??[]);if(e.kind==="constructor")return`constructor(${r})`;let i=e.typeParameters?`<${e.typeParameters}>`:"";return`${t}${_t(e.name)}${n}${i}(${r}): ${e.returnType??it}`}function xm(e,t,n){let r=e.localName??e.name,i=r!==e.name,o=`export { ${r}${i?` as ${ns(e.name)}`:""} };`;if(n.has(r))return o;n.add(r);let s=e.typeParameters?`<${e.typeParameters}>`:"",c=(e.members??[]).map((y)=>[$t(rn(y.description,y.deprecated,y.tags,t)),`${ps(y)};`].filter(Boolean).join(`
188
+ `)}function us(e){let t=[e.static?"static ":"",e.abstract?"abstract ":"",e.readonly?"readonly ":""].join(""),n=e.optional?"?":"";if(e.kind==="property")return`${t}${mt(e.name)}${n}: ${e.type??Ie}`;let r=Ye(e.params??[]);if(e.kind==="constructor")return`constructor(${r})`;let i=e.typeParameters?`<${e.typeParameters}>`:"";return`${t}${mt(e.name)}${n}${i}(${r}): ${e.returnType??Ie}`}function Ty(e,t){let n=e.localName??e.name,r=n!==e.name,i=`export { ${n}${r?` as ${is(e.name)}`:""} };`;if(t.has(n))return i;t.add(n);let a=e.typeParameters?`<${e.typeParameters}>`:"",s=(e.members??[]).map((u)=>[yt(Rt(u.description,u.deprecated,u.tags)),`${us(u)};`].filter(Boolean).join(`
193
189
  `)).join(`
194
190
 
195
- `),l=`${e.extends?` extends ${e.extends}`:""}${e.implements?.length?` implements ${e.implements.join(", ")}`:""}`,d=`${i?"":"export "}declare ${e.abstract?"abstract ":""}class ${r}${s}${l}`;return`
196
- ${[$t(rn(e.description,e.deprecated,e.tags,t)),c?`${d} {
197
- ${c}
198
- }`:`${d} {}`,i?o:""].filter(Boolean).join(`
199
- `)}`}function bm(e,t="all"){let n=gm(e,t),r=new Set,i=e.moduleExports.filter((o)=>o.kind!=="re-export").map((o)=>{if(o.kind==="class")return xm(o,t,r);let s=!xr.test(o.name),c=s?{...o,name:Tm(o.name)}:o,l=rn(c.description,c.deprecated,c.tags,t),d,u=c.type&&Yc.test(c.type),y=c.type==="() => any",g=c.typeParameters?`<${c.typeParameters}>`:"";if(c.kind==="const"&&!u)d=`export declare const ${c.name}: ${c.type||it};
200
- `;else if(c.params&&c.params.length>0)d=`export declare function ${c.name}${g}(${Ct(c.params)}): ${c.returnType||it};`;else if(c.returnType)d=`export declare function ${c.name}${g}(): ${c.returnType};`;else if(u&&c.type&&!y){let[b,P,...N]=c.type.split("=>"),D=N.map((j)=>` => ${j.trim()}`).join("");d=`export declare function ${c.name}${b.trimEnd()}: ${P.trim()}${D};`}else if(u&&c.type){let[b,P,...N]=c.type.split("=>"),D=N.map((j)=>` => ${j.trim()}`).join("");d=`export declare function ${c.name}${b.trimEnd()}: ${P.trim()}${D};`}else if(c.kind==="const")d=`export declare const ${c.name}: ${c.type||it};
201
- `;else d=`export declare let ${c.name}: ${c.type||it};`;if(s)d=`${d.replace(Jh,"").trimEnd()}
202
- export { ${c.name} as ${JSON.stringify(o.name)} };`;return`
203
- ${$t(l)}
204
- ${d}`}).join(`
205
- `);return[n,i].filter(Boolean).join(`
191
+ `),p=`${e.extends?` extends ${e.extends}`:""}${e.implements?.length?` implements ${e.implements.join(", ")}`:""}`,c=`${r?"":"export "}declare ${e.abstract?"abstract ":""}class ${n}${a}${p}`;return`
192
+ ${[yt(Rt(e.description,e.deprecated,e.tags)),s?`${c} {
193
+ ${s}
194
+ }`:`${c} {}`,r?i:""].filter(Boolean).join(`
195
+ `)}`}function vy(e){let t=by(e),n=new Set,r=e.moduleExports.filter((i)=>i.kind!=="re-export").map((i)=>{if(i.kind==="class")return Ty(i,n);let a=!as.test(i.name),s=a?{...i,name:Sy(i.name)}:i,p=Rt(s.description,s.deprecated,s.tags),c,d=s.type&&kc.test(s.type),u=s.type==="() => any",y=s.typeParameters?`<${s.typeParameters}>`:"";if(s.kind==="const"&&!d)c=`export declare const ${s.name}: ${s.type||Ie};
196
+ `;else if(s.params&&s.params.length>0)c=`export declare function ${s.name}${y}(${Ye(s.params)}): ${s.returnType||Ie};`;else if(s.returnType)c=`export declare function ${s.name}${y}(): ${s.returnType};`;else if(d&&s.type&&!u){let[x,g,...C]=s.type.split("=>"),v=C.map((w)=>` => ${w.trim()}`).join("");c=`export declare function ${s.name}${x.trimEnd()}: ${g.trim()}${v};`}else if(d&&s.type){let[x,g,...C]=s.type.split("=>"),v=C.map((w)=>` => ${w.trim()}`).join("");c=`export declare function ${s.name}${x.trimEnd()}: ${g.trim()}${v};`}else if(s.kind==="const")c=`export declare const ${s.name}: ${s.type||Ie};
197
+ `;else c=`export declare let ${s.name}: ${s.type||Ie};`;if(a)c=`${c.replace(Qm,"").trimEnd()}
198
+ export { ${s.name} as ${JSON.stringify(i.name)} };`;return`
199
+ ${yt(p)}
200
+ ${c}`}).join(`
201
+ `);return[t,r].filter(Boolean).join(`
206
202
 
207
- `)}function Tm(e){return`__export_${e.replace(Xh,"_")}`}var Em=120;function Cm(e){let n=`export default class ${e.moduleName==="default"?"":e.moduleName}${e.generic} extends SvelteComponentTyped<`,r=[e.genericProps,e.events,e.slots];if(e.accessors.trim()===""&&r.every((i)=>!i.includes(`
208
- `))){let i=`${n}${r.join(", ")}> {}`;if(i.length<=Em)return i}return`${n}
203
+ `)}function Sy(e){return`__export_${e.replace(Zm,"_")}`}var Ey=120;function Cy(e){let n=`export default class ${e.moduleName==="default"?"":e.moduleName}${e.generic} extends SvelteComponentTyped<`,r=[e.genericProps,e.events,e.slots];if(e.accessors.trim()===""&&r.every((i)=>!i.includes(`
204
+ `))){let i=`${n}${r.join(", ")}> {}`;if(i.length<=Ey)return i}return`${n}
209
205
  ${e.genericProps},
210
206
  ${e.events},
211
207
  ${e.slots}
212
208
  > {
213
209
  ${e.accessors}
214
- }`}function Xc(e,t,n){let r=n.replace(zh,t);if(!n.includes("{name}")||!xr.test(r))throw Error(`sveld: typesOptions.typeNames.${e} must contain "{name}" and produce a valid identifier; got "${n}".`);return r}function rp(e,t){let n=Xc("props",e,t?.props??"{name}Props"),r=Xc("exports",e,t?.exports??"{name}Exports");if(n===r)throw Error(`sveld: typesOptions.typeNames.props and typesOptions.typeNames.exports both produce "${n}" for component "${e}"; they must differ.`);let i=cs(e);for(let[o,s]of[["props",n],["exports",r]])if(s===i||s===`${i}Component`)throw Error(`sveld: typesOptions.typeNames.${o} produces "${s}" for component "${e}", which the .d.ts already declares for the component itself; use a different template.`);return{props:n,exports:r}}function Sm(e,t){return rp(e,t).props}function vm(e,t){return rp(e,t).exports}function Pm(e,t,n){if(e===void 0||e===!0)return{...t};if(e===!1)return{props:!1,exports:!1,typedefs:!1,contexts:!1};return{props:e.props??n,exports:e.exports??n,typedefs:e.typedefs??n,contexts:e.contexts??n}}var Am={props:!0,exports:!0,typedefs:!0,contexts:!0};function km(e){let t=Pm(e?.exportTypes,Am,!0);if(e?.forceExportProps===!0)t.props=!0;return t}function wm(e,t){let n=wr(e),{moduleName:r,typedefs:i,generics:o,props:s,moduleExports:c,slots:l,events:d,rest_props:u,extends:y,componentComment:g,contexts:b,syntaxMode:P}=e,N=t?.format==="component",D=o!==null,j=km(t),U=t?.comments??"all",{props_name:v,prop_def:w}=rm({moduleName:r,props:s,rest_props:u,extends:y,generics:o,slots:l,canonicalPropNames:new Set(n?.canonicalPropNames??[]),canonicalPropsType:n?.canonicalPropsType,events:N&&P==="legacy"?d:void 0},{export:j.props,typeNames:t?.typeNames,propsDeclaration:t?.propsDeclaration},U),M=o?`<${o[1]}>`:"",G=o?`${v}<${o[0]}>`:v,X=bm({moduleExports:c},U),be=Cr({typedefs:i},{export:j.typedefs},U),a=Zc({contexts:b,generics:o},{export:j.contexts},U),p=new Set(t?.inlined?.droppedImportStatements??[]),f=(n?.typeImportStatements??[]).filter((O)=>!p.has(O)).join(`
215
- `),m=[...t?.inlined?.declarations??[],...n?.localTypeDeclarations??[],...n?.moduleTypeDeclarations??[]].join(`
210
+ }`}function Py(e){return`${e}Props`}function Ay(e){return`${e}Exports`}function ky(e,t){let n=Ts(e),{moduleName:r,typedefs:i,generics:a,props:s,moduleExports:p,slots:c,events:d,rest_props:u,extends:y,componentComment:x,contexts:g}=e,C=t?.format==="component",v=a!==null,{props_name:w,prop_def:R}=ay({moduleName:r,props:s,rest_props:u,extends:y,generics:a,slots:c,canonicalPropNames:new Set(n?.canonicalPropNames??[]),canonicalPropsType:n?.canonicalPropsType}),B=a?`<${a[1]}>`:"",L=a?`${w}<${a[0]}>`:w,k=C&&d.length>0?`type $Events${B} = ${Ac({events:d})};`:"",_=a?`$Events<${a[0]}>`:"$Events",j=C&&(v||k!==""),Fe=vy({moduleExports:p}),ot=hr({typedefs:i}),o=Nc({contexts:g,generics:a}),l=(n?.typeImportStatements??[]).join(`
211
+ `),f=[...n?.localTypeDeclarations??[],...n?.moduleTypeDeclarations??[]].join(`
216
212
 
217
- `),{exports_ref:E,exports_def:S}=N?um({props:s,moduleName:r,generics:o},{export:j.exports,typeNames:t?.typeNames},U):{exports_ref:$e,exports_def:$e},k=N?dm({props:s}):$e,x=!Gh.test(f)&&(nn.test(w)||nn.test(X)||nn.test(be)||nn.test(a)||nn.test(m)||nn.test(S)),C=u?.type==="Element"&&(u.name!=="svelte:element"||u.name==="svelte:element"&&u.thisValue),T=u?.type==="Element"&&u.name==="svelte:element"&&!u.thisValue,_=[N?D?`import type { SvelteComponent, ComponentConstructorOptions, ComponentInternals${x?", Snippet":""} } from "svelte";`:`import type { Component${x?", Snippet":""} } from "svelte";`:`import { SvelteComponentTyped${x?", type Snippet":""} } from "svelte";`,C?'import type { SvelteHTMLElements } from "svelte/elements";':"",T?'import type { HTMLAttributes } from "svelte/elements";':"",f,mm({extends:y})].filter(Boolean).join(`
218
- `),A=N?D?hm({moduleName:r,generic:M,propsRef:G,exportsRef:E,bindings:k}):fm({moduleName:r,propsRef:G,exportsRef:E,bindings:k}):Cm({moduleName:r,generic:M,genericProps:G,events:cm({events:d},U),slots:im({slots:l},U),accessors:np({props:s},U)}),I=[X,be,m,a,w,S,[ym({componentComment:g},U),A].filter(Boolean).join(`
219
- `)].map((O)=>O.trim()).filter(Boolean).join(`
213
+ `),{exports_ref:m,exports_def:b}=C?fy({props:s,moduleName:r,generics:a}):{exports_ref:we,exports_def:we},T=C?hy({props:s}):we,S=!Jm.test(l)&&(Lt.test(R)||Lt.test(Fe)||Lt.test(ot)||Lt.test(o)||Lt.test(f)||Lt.test(b)),A=u?.type==="Element"&&(u.name!=="svelte:element"||u.name==="svelte:element"&&u.thisValue),P=u?.type==="Element"&&u.name==="svelte:element"&&!u.thisValue,O=[C?j?`import type { SvelteComponent, ComponentConstructorOptions, ComponentInternals${S?", Snippet":""} } from "svelte";`:`import type { Component${S?", Snippet":""} } from "svelte";`:`import { SvelteComponentTyped${S?", type Snippet":""} } from "svelte";`,A?'import type { SvelteHTMLElements } from "svelte/elements";':"",P?'import type { HTMLAttributes } from "svelte/elements";':"",l,gy({extends:y})].filter(Boolean).join(`
214
+ `),K=C?j?yy({moduleName:r,generic:B,propsRef:L,exportsRef:m,bindings:T,...k?{eventsRef:_}:{}}):my({moduleName:r,propsRef:L,exportsRef:m,bindings:T}):Cy({moduleName:r,generic:B,genericProps:L,events:Ac({events:d}),slots:oy({slots:c}),accessors:Ic({props:s})}),W=[Fe,ot,f,o,R,b,k,[xy({componentComment:x}),K].filter(Boolean).join(`
215
+ `)].map((xe)=>xe.trim()).filter(Boolean).join(`
220
216
 
221
- `);return Wc([_,I].filter(Boolean).join(`
217
+ `);return Sc([O,W].filter(Boolean).join(`
222
218
 
223
- `))}var ip=/`/g,sp=/\s+/g,st="--",ap=`| Prop name | Required | Kind | Reactive | Binding | Type | Default value | Description |
219
+ `))}var Lc=/`/g,Rc=/\s+/g,_e="--",Mc=`| Prop name | Required | Kind | Reactive | Binding | Type | Default value | Description |
224
220
  | :- | :- | :- | :- | :- | :- | :- | :- |
225
- `,op=`| Slot name | Default | Props | Fallback | Description |
221
+ `,Oc=`| Slot name | Default | Props | Fallback | Description |
226
222
  | :- | :- | :- | :- | :- |
227
- `,cp=`| Event name | Type | Detail | Description |
223
+ `,Bc=`| Event name | Type | Detail | Description |
228
224
  | :- | :- | :- | :- |
229
- `,ds=`| Name | Kind | Type | Description |
225
+ `,hs=`| Name | Kind | Type | Description |
230
226
  | :- | :- | :- | :- |
231
- `,Nm=`| Member | Signature | Description |
227
+ `,wy=`| Member | Signature | Description |
232
228
  | :- | :- | :- |
233
- `,pp=`| Part name | Description |
229
+ `,Fc=`| Part name | Description |
234
230
  | :- | :- |
235
- `,lp=`| Property name | Type | Default value | Description |
231
+ `,$c=`| Property name | Type | Default value | Description |
236
232
  | :- | :- | :- | :- |
237
- `,fs=/\|/g,Dm=/</g,_m=/>/g,Vt=/\n/g,Im=/^[A-Za-z_$][\w$]*$/,Lm=/\s*\n\s*/g,Rm=/&(?=#?\w+;)|<(?=[A-Za-z/!?])|[|`*]|\\(?=[!-/:-@[-`{-~])|(?<![A-Za-z0-9])_|_(?![A-Za-z0-9])/g,Mm=/[&<|`*\\_]/;function hs(e){if(!Mm.test(e))return e;return e.replace(Rm,(t)=>t==="&"?"&amp;":t==="<"?"&lt;":t==="_"?"&#95;":`&#${t.charCodeAt(0)};`)}function up(e){return`<code>${hs(e.includes(`
238
- `)?e.replace(Lm," "):e)}</code>`}var Om=/\{@link\s+([^{}\s|]+)(?:\|([^{}]+))?\}/g;function Bm(e){if(!e.includes("{@link"))return e;return e.replace(Om,(t,n,r)=>`[${r===void 0?n:r.trim()}](${n})`)}function ls(e){return e.includes("```")||e.includes("~~~")}function us(e){return mp(Bm(e))}var Fm=/^([ \t]*)(`{3,}|~{3,})(.*)$/,$m=/^\n/,Vm=/\n$/;function dp(e){let t=(o)=>({kind:"prose",text:us(o.join(`
239
- `))});if(!ls(e))return[t([e])];let n=e.split(`
240
- `),r=[],i=[];for(let o=0;o<n.length;o++){let s=Fm.exec(n[o]),[,c="",l="",d=""]=s??[];if(!s||l[0]==="`"&&d.includes("`")){i.push(n[o]);continue}if(i.push(""),i.length>1)r.push(t(i));let u=[],y=new RegExp(`^[ \\t]*${l[0]}{${l.length},}[ \\t]*$`);for(o++;o<n.length&&!y.test(n[o]);o++){let g=n[o],b=0;while(b<c.length&&(g[b]===" "||g[b]==="\t"))b++;u.push(g.slice(b))}r.push({kind:"code",block:{fence:l,info:d.trim(),code:u.join(`
241
- `)}}),i=[""]}if(i.length>1||r.length===0)r.push(t(i));return r}function fp(e,t){let n="";for(let r=0;r<e.length;r++){let i=e[r];if(i.kind==="code"){if(t)t.push(i.block),n+="(code below)";else n+=`<pre><code>${hs(i.block.code).replace(Vt,"<br />")}</code></pre>`;continue}let o=i.text;if(!t){if(e[r-1]?.kind==="code")o=o.replace($m,"");if(e[r+1]?.kind==="code")o=o.replace(Vm,"")}n+=o.replace(fs,"&#124;").replace(Vt,"<br />")}return n}function jm(e,t,n,r){let i=[],o=Ht(n,r,i);if(i.length>0)e.push({label:t,blocks:i});return o}function Hm(e,t){if(e.append("raw",`
242
- `),t.length===0)return;let n="";for(let{label:r,blocks:i}of t){n+=`Code for \`${r}\`:
243
-
244
- `;for(let{fence:o,info:s,code:c}of i)n+=`${o}${s}
245
- ${c}${c?`
246
- `:""}${o}
233
+ `,ms=/\|/g,Ny=/</g,Dy=/>/g,gt=/\n/g,Iy=/^[A-Za-z_$][\w$]*$/,_y=/\s*\n\s*/g,Ly=/&(?=#?\w+;)|<(?=[A-Za-z/!?])|[|`*]|\\(?=[!-/:-@[-`{-~])|(?<![A-Za-z0-9])_|_(?![A-Za-z0-9])/g,Ry=/[&<|`*\\_]/;function ys(e){if(!Ry.test(e))return e;return e.replace(Ly,(t)=>t==="&"?"&amp;":t==="<"?"&lt;":t==="_"?"&#95;":`&#${t.charCodeAt(0)};`)}function Vc(e){return`<code>${ys(e.includes(`
234
+ `)?e.replace(_y," "):e)}</code>`}var My=/\{@link\s+([^{}\s|]+)(?:\|([^{}]+))?\}/g;function Oy(e){if(!e.includes("{@link"))return e;return e.replace(My,(t,n,r)=>`[${r===void 0?n:r.trim()}](${n})`)}function ds(e){return e.includes("```")||e.includes("~~~")}function fs(e){return Uc(Oy(e))}var By=/^([ \t]*)(`{3,}|~{3,})(.*)$/,Fy=/^\n/,$y=/\n$/;function jc(e){let t=(a)=>({kind:"prose",text:fs(a.join(`
235
+ `))});if(!ds(e))return[t([e])];let n=e.split(`
236
+ `),r=[],i=[];for(let a=0;a<n.length;a++){let s=By.exec(n[a]),[,p="",c="",d=""]=s??[];if(!s||c[0]==="`"&&d.includes("`")){i.push(n[a]);continue}if(i.push(""),i.length>1)r.push(t(i));let u=[],y=new RegExp(`^[ \\t]*${c[0]}{${c.length},}[ \\t]*$`);for(a++;a<n.length&&!y.test(n[a]);a++){let x=n[a],g=0;while(g<p.length&&(x[g]===" "||x[g]==="\t"))g++;u.push(x.slice(g))}r.push({kind:"code",code:u.join(`
237
+ `)}),i=[""]}if(i.length>1||r.length===0)r.push(t(i));return r}function Hc(e){let t="";for(let n=0;n<e.length;n++){let r=e[n];if(r.kind==="code"){t+=`<pre><code>${ys(r.code).replace(gt,"<br />")}</code></pre>`;continue}let i=r.text;if(e[n-1]?.kind==="code")i=i.replace(Fy,"");if(e[n+1]?.kind==="code")i=i.replace($y,"");t+=i.replace(ms,"&#124;").replace(gt,"<br />")}return t}function Ne(e){if(e===void 0)return _e;return Vc(e)}function qc(e){if(!e.reExport)return Ne(e.type);let{from:t,imported:n}=e.reExport,r=n==="*"?"":Iy.test(n)?`.${n}`:`[${JSON.stringify(n)}]`;return Ne(`typeof import(${JSON.stringify(t)})${r}`)}function Uc(e){if(!e.includes("<")&&!e.includes(">"))return e;return e.replace(Ny,"&lt;").replace(Dy,"&gt;")}function gs(e){if(e===void 0)return _e;return Vc(e)}function xt(e,t){if(t===void 0)return e;let n=typeof t==="string"&&t.trim().length>0?`: ${Uc(t).replace(gt," ").replace(ms,"&#124;")}`:"";return`<s>${e}</s><br />**Deprecated**${n}`}function mr(e){if(e===void 0||e.trim().length===0)return _e;return Hc(jc(e))}function Gc(e){if(e===void 0||e==="{}")return _e;return Ne(fr(e).replace(gt," "))}function Wc(e){if(e===void 0)return _e;return`<code>${ys(e).replace(gt,"<br />")}</code>`}function Mt(e,t){let n=e!==void 0&&e.trim().length>0;if(!(n&&ds(e))&&!t?.some(({body:s})=>s&&ds(s))){let s=n?[fs(e)]:[];for(let{name:p,body:c}of t??[]){let d=c?.trim();s.push(d?`@${p} ${fs(d)}`:`@${p}`)}if(s.length===0)return _e;return s.join(`
238
+ `).replace(ms,"&#124;").replace(gt,"<br />")}let r=[],i=(s)=>{let p=r.at(-1);if(p?.kind==="prose")p.text+=s;else r.push({kind:"prose",text:s})},a=(s,p)=>{if(r.length>0)i(`
239
+ `);if(s)i(s);for(let c of jc(p))if(c.kind==="prose")i(c.text);else r.push(c)};if(n)a("",e);for(let{name:s,body:p}of t??[]){let c=p?.trim();a(c?`@${s} `:`@${s}`,c??"")}if(r.length===0)return _e;return Hc(r)}function zc(e){if(e===void 0)return _e;return Ne(e.replace(gt," "))}function Vy(e){let t=[e.extends?`Extends ${Ne(e.extends)}.`:"",e.implements?.length?`Implements ${e.implements.map((n)=>Ne(n)).join(", ")}.`:""].filter(Boolean);return t.length>0?t.join(" "):void 0}function Kc(e,t){let n=new Set;for(let r of t){if(r.kind!=="class")continue;let i=Vy(r);if(!r.members?.length&&!i)continue;let a=r.localName??r.name;if(n.has(a))continue;if(n.add(a),e.append("h4",`\`${a}\` members`),i)e.append("raw",`${i}
247
240
 
248
- `}e.append("raw",n)}function nt(e){if(e===void 0)return st;return up(e)}function hp(e){if(!e.reExport)return nt(e.type);let{from:t,imported:n}=e.reExport,r=n==="*"?"":Im.test(n)?`.${n}`:`[${JSON.stringify(n)}]`;return nt(`typeof import(${JSON.stringify(t)})${r}`)}function mp(e){if(!e.includes("<")&&!e.includes(">"))return e;return e.replace(Dm,"&lt;").replace(_m,"&gt;")}function ms(e){if(e===void 0)return st;return up(e)}function jt(e,t){if(t===void 0)return e;let n=typeof t==="string"&&t.trim().length>0?`: ${mp(t).replace(Vt," ").replace(fs,"&#124;")}`:"";return`<s>${e}</s><br />**Deprecated**${n}`}function Sr(e){if(e===void 0||e.trim().length===0)return st;return fp(dp(e),void 0)}function yp(e){if(e===void 0||e==="{}")return st;return nt(Er(e).replace(Vt," "))}function gp(e){if(e===void 0)return st;return`<code>${hs(e).replace(Vt,"<br />")}</code>`}function Ht(e,t,n){let r=e!==void 0&&e.trim().length>0;if(!(r&&ls(e))&&!t?.some(({body:c})=>c&&ls(c))){let c=r?[us(e)]:[];for(let{name:l,body:d}of t??[]){let u=d?.trim();c.push(u?`@${l} ${us(u)}`:`@${l}`)}if(c.length===0)return st;return c.join(`
249
- `).replace(fs,"&#124;").replace(Vt,"<br />")}let i=[],o=(c)=>{let l=i.at(-1);if(l?.kind==="prose")l.text+=c;else i.push({kind:"prose",text:c})},s=(c,l)=>{if(i.length>0)o(`
250
- `);if(c)o(c);for(let d of dp(l))if(d.kind==="prose")o(d.text);else i.push(d)};if(r)s("",e);for(let{name:c,body:l}of t??[]){let d=l?.trim();s(d?`@${c} `:`@${c}`,d??"")}if(i.length===0)return st;return fp(i,n)}function xp(e){if(e===void 0)return st;return nt(e.replace(Vt," "))}function qm(e){let t=[e.extends?`Extends ${nt(e.extends)}.`:"",e.implements?.length?`Implements ${e.implements.map((n)=>nt(n)).join(", ")}.`:""].filter(Boolean);return t.length>0?t.join(" "):void 0}function bp(e,t,n){let r=new Set;for(let i of t){if(i.kind!=="class")continue;let o=qm(i);if(!i.members?.length&&!o)continue;let s=i.localName??i.name;if(r.has(s))continue;if(r.add(s),e.append("h4",`\`${s}\` members`),o)e.append("raw",`${o}
241
+ `);if(!r.members?.length)continue;e.append("raw",wy);for(let s of r.members)e.append("raw",`| ${xt(s.name,s.deprecated)} | ${Ne(us(s))} | ${Mt(s.description,s.tags)} |
242
+ `);e.append("raw",`
243
+ `)}}var jy=/[^\w\- ]+/g,Hy=/\s+/g;function qy(e,t){let n=e.toLowerCase().replace(Lc,"").replace(jy,"").replace(Hy,"-"),r=t.get(n)??0;return t.set(n,r+1),r===0?n:`${n}-${r}`}class un{sourceParts=[];hasToC=!1;toc=[];onAppend;constructor(e={}){this.onAppend=e.onAppend}get source(){return this.sourceParts.join("")}appendLineBreaks(){return this.sourceParts.push(`
251
244
 
252
- `);if(!i.members?.length)continue;e.append("raw",Nm);let c=[];for(let l of i.members){let d=n?.codeBelow?jm(c,l.name,l.description,l.tags):Ht(l.description,l.tags);e.append("raw",`| ${jt(l.name,l.deprecated)} | ${nt(ps(l))} | ${d} |
253
- `)}Hm(e,c)}}function gs(e,t,n){if(e.append("h1","Component Index"),e.append("h2","Components").tableOfContents(),e.append("divider"),n&&n.length>0)Um(e,n);let r=Rn(t);for(let i of r.components)Km(e,i)}function Um(e,t){e.append("h2","Exports"),e.append("raw",ds);for(let n of t){let r=(n.type??n.value)?.replace(sp," ").trim();e.append("raw",`| ${jt(n.name,n.deprecated)} | ${`<code>${n.kind}</code>`} | ${nt(r)} | ${Sr(n.description)} |
245
+ `),this}append(e,t){switch(e){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":{let n=Number(e.slice(-1));if(this.sourceParts.push(`${"#".repeat(n)} ${t}`),this.hasToC&&e==="h2")this.toc.push({indent:0,raw:t??""});break}case"quote":this.sourceParts.push(`> ${t}`);break;case"p":this.sourceParts.push(t??"");break;case"divider":this.sourceParts.push("---");break;case"raw":this.sourceParts.push(t??"");break}if(e!=="raw")this.appendLineBreaks();return this.onAppend?.call(this,e,this),this}tableOfContents(){return this.sourceParts.push("<!-- __TOC__ -->"),this.hasToC=!0,this.appendLineBreaks(),this}end(){let e=this.sourceParts.join("");if(!this.hasToC)return e;let t="<!-- __TOC__ -->",n=e.indexOf(t);if(n===-1)return e;let r=new Map,i=this.toc.map(({indent:a,raw:s})=>`${" ".repeat(a)}- [${s}](#${qy(s,r)})`).join(`
246
+ `);return e.slice(0,n)+i+e.slice(n+t.length)}}class Jc extends un{}function bs(e,t,n){if(e.append("h1","Component Index"),e.append("h2","Components").tableOfContents(),e.append("divider"),n&&n.length>0)Uy(e,n);let r=Ji(t);for(let i of r.components)zy(e,i)}function Uy(e,t){e.append("h2","Exports"),e.append("raw",hs);for(let n of t){let r=(n.type??n.value)?.replace(Rc," ").trim();e.append("raw",`| ${xt(n.name,n.deprecated)} | ${`<code>${n.kind}</code>`} | ${Ne(r)} | ${mr(n.description)} |
254
247
  `)}e.append("raw",`
255
- `),e.append("divider")}function Gm(e){return e.kind==="const"||e.isFunctionDeclaration}function Wm(e,t){e.append("h3","Module exports"),e.append("raw",ds);for(let n of t)e.append("raw",`| ${jt(n.name,n.deprecated)} | ${`<code>${n.kind}</code>`} | ${hp(n)} | ${Ht(n.description,n.tags)} |
248
+ `),e.append("divider")}function Gy(e){return e.kind==="const"||e.isFunctionDeclaration}function Wy(e,t){e.append("h3","Module exports"),e.append("raw",hs);for(let n of t)e.append("raw",`| ${xt(n.name,n.deprecated)} | ${`<code>${n.kind}</code>`} | ${qc(n)} | ${Mt(n.description,n.tags)} |
256
249
  `);e.append("raw",`
257
- `),bp(e,t)}function ys(e,t,n,r){if(t.length>0)n(),e.append("raw",`
258
- `);else e.append("p",r??"None.")}function Km(e,t){if(e.append("h2",`\`${t.moduleName}\``),t.generics)e.append("p",`**Type parameters:** ${nt(`<${t.generics[1]}>`)}`);if(t.typedefs.length>0)e.append("h3","Types").append("raw",`\`\`\`ts
259
- ${Cr({typedefs:t.typedefs})}
250
+ `),Kc(e,t)}function xs(e,t,n,r){if(t.length>0)n(),e.append("raw",`
251
+ `);else e.append("p",r??"None.")}function zy(e,t){if(e.append("h2",`\`${t.moduleName}\``),t.generics)e.append("p",`**Type parameters:** ${Ne(`<${t.generics[1]}>`)}`);if(t.typedefs.length>0)e.append("h3","Types").append("raw",`\`\`\`ts
252
+ ${hr({typedefs:t.typedefs})}
260
253
  \`\`\`
261
254
 
262
- `);if(e.append("h3","Props"),ys(e,t.props,()=>{e.append("raw",ap);let n=(i)=>i.reactive?0:i.constant?2:1,r=t.props.map((i,o)=>({prop:i,index:o})).sort((i,o)=>n(i.prop)-n(o.prop)||i.index-o.index).map(({prop:i})=>i);for(let i of r){let o=Gm(i)?"accessor":i.kind;e.append("raw",`| ${jt(i.name,i.deprecated)} | ${i.isRequired?"Yes":"No"} | ${`<code>${o}</code>`} | ${i.reactive?"Yes":"No"} | ${i.binding??"--"} | ${nt(i.type)} | ${ms(i.value)} | ${Ht(i.description,i.tags)} |
263
- `)}}),t.moduleExports.length>0)Wm(e,t.moduleExports);if(e.append("h3","Slots"),ys(e,t.slots,()=>{e.append("raw",op);for(let n of t.slots)e.append("raw",`| ${jt(n.default?st:n.name??st,n.deprecated)} | ${n.default?"Yes":"No"} | ${yp(n.slot_props)} | ${gp(n.fallback)} | ${Ht(n.description,n.tags)} |
264
- `)}),e.append("h3","Events"),ys(e,t.events,()=>{e.append("raw",cp);for(let n of t.events)e.append("raw",`| ${jt(n.name,n.deprecated)} | ${n.type} | ${xp(n.detail)} | ${Ht(n.description,n.tags)} |
265
- `)}),t.cssParts&&t.cssParts.length>0){e.append("h3","CSS Parts"),e.append("raw",pp);for(let n of t.cssParts)e.append("raw",`| ${n.name} | ${Sr(n.description)} |
255
+ `);if(e.append("h3","Props"),xs(e,t.props,()=>{e.append("raw",Mc);let n=(i)=>i.reactive?0:i.constant?2:1,r=t.props.map((i,a)=>({prop:i,index:a})).sort((i,a)=>n(i.prop)-n(a.prop)||i.index-a.index).map(({prop:i})=>i);for(let i of r){let a=Gy(i)?"accessor":i.kind;e.append("raw",`| ${xt(i.name,i.deprecated)} | ${i.isRequired?"Yes":"No"} | ${`<code>${a}</code>`} | ${i.reactive?"Yes":"No"} | ${i.binding??"--"} | ${Ne(i.type)} | ${gs(i.value)} | ${Mt(i.description,i.tags)} |
256
+ `)}}),t.moduleExports.length>0)Wy(e,t.moduleExports);if(e.append("h3","Slots"),xs(e,t.slots,()=>{e.append("raw",Oc);for(let n of t.slots)e.append("raw",`| ${xt(n.default?_e:n.name??_e,n.deprecated)} | ${n.default?"Yes":"No"} | ${Gc(n.slot_props)} | ${Wc(n.fallback)} | ${Mt(n.description,n.tags)} |
257
+ `)}),e.append("h3","Events"),xs(e,t.events,()=>{e.append("raw",Bc);for(let n of t.events)e.append("raw",`| ${xt(n.name,n.deprecated)} | ${n.type} | ${zc(n.detail)} | ${Mt(n.description,n.tags)} |
258
+ `)}),t.cssParts&&t.cssParts.length>0){e.append("h3","CSS Parts"),e.append("raw",Fc);for(let n of t.cssParts)e.append("raw",`| ${n.name} | ${mr(n.description)} |
266
259
  `);e.append("raw",`
267
- `)}if(t.cssProperties&&t.cssProperties.length>0){e.append("h3","CSS Custom Properties"),e.append("raw",lp);for(let n of t.cssProperties)e.append("raw",`| ${n.name} | ${nt(n.type)} | ${ms(n.default)} | ${Sr(n.description)} |
260
+ `)}if(t.cssProperties&&t.cssProperties.length>0){e.append("h3","CSS Custom Properties"),e.append("raw",$c);for(let n of t.cssProperties)e.append("raw",`| ${n.name} | ${Ne(n.type)} | ${gs(n.default)} | ${mr(n.description)} |
268
261
  `);e.append("raw",`
269
- `)}}var zm=/^=>\s*/;function Jm(e){let t=e.trim();if(!t.startsWith("("))return{parameters:[],returnTypeText:t||"any"};let n=0,r=-1;for(let c=0;c<t.length;c++)if(t[c]==="(")n++;else if(t[c]===")"){if(n--,n===0){r=c;break}}if(r===-1)return{parameters:[],returnTypeText:"any"};let i=t.slice(1,r).trim(),o=t.slice(r+1).trim().replace(zm,"");return{parameters:i===""?[]:lt(i).map((c)=>{let l=c.trim(),d=l.startsWith("..."),u=d?l.slice(3):l,y=u.indexOf(":"),g=(y===-1?u:u.slice(0,y)).trim(),b=y===-1?void 0:u.slice(y+1).trim(),P=g.endsWith("?"),N={name:P?g.slice(0,-1):g};if(b)N.type={text:b};if(P)N.optional=!0;if(d)N.rest=!0;return N}),returnTypeText:o||"any"}}function Xm(e){if(e.params!==void 0||e.returnType!==void 0)return{parameters:(e.params??[]).map((n)=>{let r={name:n.name};if(n.type)r.type={text:n.type};if(n.optional)r.optional=!0;return r}),returnTypeText:e.returnType??"any"};return e.type?Jm(e.type):{parameters:[],returnTypeText:"any"}}function Ym(e){return e.map((t)=>{if(t.isFunctionDeclaration){let{parameters:r,returnTypeText:i}=Xm(t),o={kind:"method",name:t.name,static:!1};if(r.length>0)o.parameters=r;if(o.return={type:{text:i}},t.description)o.description=t.description;if(t.deprecated!==void 0)o.deprecated=t.deprecated;return o}let n={kind:"field",name:t.name};if(t.type)n.type={text:t.type};if(t.value!==void 0)n.default=t.value;if(t.description)n.description=t.description;if(t.deprecated!==void 0)n.deprecated=t.deprecated;if(t.kind==="const")n.readonly=!0;return n})}function Qm(e){let t=e.customElement?.props,n=new Map,r=[];for(let i of e.props){if(i.isFunctionDeclaration)continue;let o=t?.[i.name];if(o?.attribute===!1)continue;let s=o?.attribute||i.name.toLowerCase(),c=n.get(s);if(c!==void 0){console.warn(`sveld: props "${c}" and "${i.name}" of component "${e.moduleName}" both map to the custom-element attribute "${s}"; only "${c}" is included.`);continue}n.set(s,i.name);let d=o?.type==="Array"||o?.type==="Object"?[i.description,"Serialized to/from JSON for the attribute."].filter(Boolean).join(" "):i.description,u={name:s,fieldName:i.name};if(i.type)u.type={text:i.type};if(i.value!==void 0)u.default=i.value;if(d)u.description=d;if(o?.reflect)u.reflects=!0;r.push(u)}return r}function Zm(e){if(!e||e.length===0)return;return e.map((t)=>{let n={name:t.name};if(t.description)n.description=t.description;return n})}function ey(e){if(!e||e.length===0)return;return e.map((t)=>{let n={name:t.name};if(t.type)n.type={text:t.type};if(t.default!==void 0)n.default=t.default;if(t.description)n.description=t.description;return n})}function ty(e){return e.filter((t)=>t.type==="dispatched").map((t)=>{let n={name:t.name,type:{text:Mn(t.detail??"unknown")}};if(t.description)n.description=t.description;if(t.deprecated!==void 0)n.deprecated=t.deprecated;return n})}function ny(e){return e.map((t)=>{let n={name:t.default?"":t.name??""};if(t.description)n.description=t.description;if(t.deprecated!==void 0)n.deprecated=t.deprecated;return n})}function ry(e){let t=Zm(e.cssParts),n=ey(e.cssProperties),r=Ym(e.props),i=Qm(e),o=ty(e.events),s=ny(e.slots),c=e.moduleName,l=e.componentComment?{kind:"class",name:c,description:e.componentComment,members:r,attributes:i,events:o,slots:s}:{kind:"class",name:c,members:r,attributes:i,events:o,slots:s};if(t)l.cssParts=t;if(n)l.cssProperties=n;if(e.customElementTag)l.tagName=e.customElementTag,l.customElement=!0;return l}function iy(e,t){let n=[{kind:"js",name:e.moduleName,declaration:{name:e.moduleName,module:t}}];if(e.customElementTag)n.push({kind:"custom-element-definition",name:e.customElementTag,declaration:{name:e.moduleName,module:t}});return n}function sy(e,t={}){let n=Rn(e),r=t.resolveModulePath??((o)=>o.filePath);return{schemaVersion:"1.0.0",modules:n.components.map((o)=>{let s=r(o);return{kind:"javascript-module",path:s,declarations:[ry(o)],exports:iy(o,s)}})}}var ay=/[^\w\- ]+/g,oy=/\s+/g;function cy(e,t){let n=e.toLowerCase().replace(ip,"").replace(ay,"").replace(oy,"-"),r=t.get(n)??0;return t.set(n,r+1),r===0?n:`${n}-${r}`}class xs{sourceParts=[];hasToC=!1;toc=[];get source(){return this.sourceParts.join("")}appendLineBreaks(){return this.sourceParts.push(`
270
-
271
- `),this}append(e,t){switch(e){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":{let n=Number(e.slice(-1));if(this.sourceParts.push(`${"#".repeat(n)} ${t}`),this.hasToC&&e==="h2")this.toc.push({indent:0,raw:t??""});break}case"quote":this.sourceParts.push(`> ${t}`);break;case"p":this.sourceParts.push(t??"");break;case"divider":this.sourceParts.push("---");break;case"raw":this.sourceParts.push(t??"");break}if(e!=="raw")this.appendLineBreaks();return this}tableOfContents(){return this.sourceParts.push("<!-- __TOC__ -->"),this.hasToC=!0,this.appendLineBreaks(),this}end(){let e=this.sourceParts.join("");if(!this.hasToC)return e;let t="<!-- __TOC__ -->",n=e.indexOf(t);if(n===-1)return e;let r=new Map,i=this.toc.map(({indent:o,raw:s})=>`${" ".repeat(o)}- [${s}](#${cy(s,r)})`).join(`
272
- `);return e.slice(0,n)+i+e.slice(n+t.length)}}class bs extends xs{onAppend;constructor(e){super();this.onAppend=e.onAppend}append(e,t){return super.append(e,t),this.onAppend?.call(this,e,this),this}}function py(e,t){let n=new bs({onAppend:(r,i)=>{t?.onAppend?.call(null,r,i,e)}});return gs(n,e),n.end()}export{bs as BrowserWriterMarkdown,$c as COMPONENT_API_SCHEMA_VERSION,ke as ComponentParser,Np as asNormalizedPath,Rn as buildComponentApiDocument,sy as buildCustomElementsManifest,mh as finalizeWithoutCrossFileResolution,Er as formatTsProps,Zc as getContextDefs,Cr as getTypeDefs,gs as renderComponentsToMarkdown,py as writeMarkdownCore,wm as writeTsDefinition};
262
+ `)}}function Ky(e,t){let n=new un({onAppend:(r,i)=>{t?.onAppend?.call(null,r,i,e)}});return bs(n,e),n.end()}export{Jc as BrowserWriterMarkdown,dc as COMPONENT_API_SCHEMA_VERSION,Wi as ComponentParser,un as MarkdownDocument,el as asNormalizedPath,Ji as buildComponentApiDocument,pm as finalizeWithoutCrossFileResolution,fr as formatTsProps,Nc as getContextDefs,hr as getTypeDefs,bs as renderComponentsToMarkdown,Ky as writeMarkdownCore,ky as writeTsDefinition};