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.
@@ -0,0 +1,36 @@
1
+ import{h,me,b,e,A,l,d,m,he,oe,y,o,n,H,D,W,j,i,J,F,x,g,T,p,u,_,q,Y,ae,Z,ye,ce,pe,N,a,c,r,ue,K,S,k}from"./chunk-12m2j9sx.js";var ua=/\s/;function hn(t,s,f){let E=s;while(E<f){let C=t[E];if(C==="/"&&t[E+1]==="/"){let w=t.indexOf(`
2
+ `,E+2);if(w===-1||w>=f)return!0;E=w+1}else if(C==="/"&&t[E+1]==="*"&&t[E+2]!=="*"){let w=t.indexOf("*/",E+2);if(w===-1||w+2>f)return!1;E=w+2}else if(C===" "||C===`
3
+ `||C==="\t"||C==="\r"||ua.test(C))E++;else return!1}return!0}var da=/^-\s*/;function Ft(t){let s=[],f,E=!1;for(let C of t){let w=F(C);if(f!==void 0){if(w)s.push(C.trim()),f=void 0;else s.push(C.slice(Math.min(f,J(C))).trimEnd());continue}let v=C.trim();if(v===""){E=s.length>0;continue}if(E)s.push("");if(E=!1,s.push(v),w)f=J(C)}return s.join(`
4
+ `).trimEnd()}function tt(t){if(t===void 0)return;let s=t.replace(da,"").trim();return s===""?"":s}function Er(t){let s=t.name?`${t.name} ${t.description}`:t.description;return tt(Ft(s.split(`
5
+ `)))}function yn(t){let s=0;while(t[s+1]?.continuesType)s++;return s}var jt=new Set(["since","example","see"]),gn=new Set(["bindable","default","required"]);function Pr(t){return t.length>0?t.map((s)=>({name:s.tag,body:s.text})):void 0}function qt(t){let s=t.trim();return s===""?!0:s}function Tn(t){let s=t;if(!s.startsWith("/*"))s=`/*${s}`;if(!s.endsWith("*/"))s+="*/";return s}function et(t){if(t==="*")return"any";return t.trim()}function Pe(t){let s=x(Tn(t)),{returns:f}=B(s);return f?et(f.type):void 0}function Ae(t){let s=x(Tn(t)),{deprecated:f,passthrough:E,internal:C}=B(s);return{deprecated:f,tags:Pr(E),internal:C}}var fa=new Set(["type","param","returns","return","extends","extendProps","restProps","slot","snippet","event","typedef","callback","bindable","deprecated","ignore","internal","csspart","cssprop","cssproperty"]);function bn(t,s){let f=t.parsedJsDocByText.get(s);if(f===void 0)f=x(s),t.parsedJsDocByText.set(s,f);return f}function B(t){let s=t[0]?.tags??[],f,E=[],C,w,v,I=!1,M=[],U=[],V=[];for(let z of s)if(z.tag==="type")f=z;else if(z.tag==="param")E.push(z);else if(z.tag==="returns"||z.tag==="return")C=z;else if(z.tag==="deprecated")v??=qt(z.text);else if(z.tag==="ignore"||z.tag==="internal")I=!0;else if(z.tag==="sveld-ignore")V.push(z.name);else if(jt.has(z.tag))U.push(z);else if(z.tag==="bindable"){if(z.type)continue;let te=`${z.name}${z.description?` ${z.description}`:""}`.trim();if(te==="readonly"||te==="writable")w??=te}else if(!fa.has(z.tag))M.push(z);return{type:f,param:E,returns:C,binding:w,deprecated:v,internal:I,additional:M,passthrough:U,ignore:V,description:t[0]?.description}}function ma(t,s){if(typeof s.start!=="number"||typeof s.end!=="number")return;let f=t.jsDocBlocksByStart.get(s.start);if(f===void 0||f.end!==s.end)return;return[f]}function ha(t){if(!t||t.length===0)return;let s=t[t.length-1];return s&&typeof s==="object"&&"value"in s?s:void 0}function Ar(t,s,f){if(!s||s.length===0||f===void 0||!t.source)return;for(let E=s.length-1;E>=0;E--){let C=s[E];if(!C||typeof C!=="object"||!("value"in C)||!("end"in C))continue;if(typeof C.end!=="number"||!("start"in C)||typeof C.start!=="number")continue;if("type"in C&&C.type==="Line"||!String(C.value).startsWith("*"))continue;if(hn(t.source,C.end,f))return C}return}function Cr(t){let s=new Set,f=(C)=>{let{leadingComments:w,start:v}=C,I=Ar(t,w,v);if(I)s.add(I.start)};for(let C of t.funcDecls.values())f(C);let E=[{root:t.parsed?.module,isModule:!0},{root:t.parsed?.instance,isModule:!1}];for(let{root:C,isModule:w}of E)for(let v of C?.content.body??[]){let I=v.type==="ExportNamedDeclaration",M=v.type==="ExportNamedDeclaration"?v.declaration:v;if(M?.type==="FunctionDeclaration"){if(I)f(v)}else if(M?.type==="ClassDeclaration"&&w){f(I?v:M);for(let U of M.body.body)if(U.type==="MethodDefinition")f(U)}else if(M?.type==="VariableDeclaration"&&(w||!I||M.kind==="const")&&M.declarations.length===1&&ya.has(M.declarations[0].init?.type??""))f(v)}return s}var ya=new Set(["ArrowFunctionExpression","FunctionExpression"]);function qe(t,s){if(!s?.leadingComments)return;let f=Ar(t,s.leadingComments,s.start);if(!f)return;return ba(t,[f])}function xn(t,s){if(!s?.leadingComments)return;return qe(t,s)}function ga(t,s,f){let E=t;if(s)E=`${t} extends ${s}`;if(f)E+=` = ${f}`;return E}var Ta=/^[^\s,]+/,Sr=/^\s*,\s*([^\s,]+)/;function Sn(t,s){let f=t.optional?t.name:Ta.exec(t.name)?.[0];if(!f)return[];let E=[{name:f,constraint:ga(f,s,t.default)}],C=`${t.optional?"":t.name.slice(f.length)} ${t.description}`;for(let w=Sr.exec(C);w;w=Sr.exec(C))E.push({name:w[1],constraint:w[1]}),C=C.slice(w[0].length);return E}function ba(t,s){if(!s)return;let f=ha(s);if(!f)return;let E=ma(t,f)??bn(t,Tn(f.value)),{type:C,param:w,returns:v,binding:I,deprecated:M,internal:U,additional:V,passthrough:z,ignore:te,description:Q}=B(E),be,Te,we,Re;if(C)be=et(C.type);if(w.length>0)Te=w.filter((xe)=>!xe.name.includes(".")).map((xe)=>({name:xe.name,type:et(xe.type),description:tt(Ft(xe.description.split(`
6
+ `))),optional:xe.optional||!1}));if(v)we=et(v.type);let Be,Se=V;if(typeof f.start==="number"&&t.functionDocCommentStarts.has(f.start)){let xe=V.filter((Ie)=>Ie.tag==="template"&&Ie.name);if(xe.length>0)Be=xe.flatMap((Ie)=>Sn(Ie,et(Ie.type))).map(({constraint:Ie})=>Ie).join(", "),Se=V.filter((Ie)=>Ie.tag!=="template")}let Me=p(Q?.trim());if(Me||Se.length>0){let xe=[];if(Me)xe.push(Me);for(let Ie of Se)xe.push(`@${Ie.tag}${Ie.text?` ${Ie.text}`:""}`);Re=xe.join(`
7
+ `)}return{type:be,params:Te,returnType:we,description:Re,binding:I,deprecated:M,tags:Pr(z),sveldIgnore:te.length>0?te:void 0,internal:U,typeParameters:Be}}function Ne(t,s,f,E,C){t.diagnosticRecords.push(En(t,s,f,E,C))}function En(t,s,f,E,C){return i({component:t.componentFilePath,kind:s,name:f,message:E,...C?{source:C}:{},...Pn(t,s,f)?{ignored:!0}:{}})}function vr(t,s){return`${t}:${s}`}function Ze(t,s,f,E){if(!E||E.length===0)return;let C=vr(s,f),w=t.sveldIgnoreDirectives.get(C)??new Set;for(let v of E)w.add(v);t.sveldIgnoreDirectives.set(C,w)}function Pn(t,s,f){let E=t.sveldIgnoreDirectives.get(vr(s,f));if(!E)return!1;return E.has("")||E.has(j[s])}var xa=/^\{([\s\S]*)\}$/,Sa=/^[A-Za-z_$][\w$]*$/;function nt(t){let s=t.trim(),f=xa.exec(s);if(!f)return null;let E=f[1].trim();if(E==="")return[];let C=[];for(let w of n(E,";,")){let v=w.trim();if(!v)continue;let I=H(v,":");if(I===-1)return null;let M=v.slice(0,I).trim(),U=v.slice(I+1).trim();if(!U)return null;let V=!1;if(M.endsWith("?"))V=!0,M=M.slice(0,-1).trim();if(!Sa.test(M))return null;C.push({name:M,type:U,optional:V})}return C}function An(){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 Cn(t,s){return t.propLocalToPublicName.get(s)??s}function Vt(t,s,f=s){t.propLocalToPublicName.set(f,s)}function vn(t,s){return t.props.get(Cn(t,s))}function St(t,s){return vn(t,s)?.type}var Ht=/[\r\n]+/g;function Ea(t){if(t.sourceLineStartOffsetsCache)return t.sourceLineStartOffsetsCache;let s=[0];if(t.source){let f=t.source.indexOf(`
8
+ `);while(f!==-1)s.push(f+1),f=t.source.indexOf(`
9
+ `,f+1)}return t.sourceLineStartOffsetsCache=s,s}function kr(t,s){if(!t.source||s<0||s>t.source.length)return;let f=Ea(t),E=t.sourceLineHint;if(E!==void 0)for(let v=E;v<=E+1&&v<f.length;v++){let I=f[v],M=f[v+1]??Number.POSITIVE_INFINITY;if(s>=I&&s<M)return t.sourceLineHint=v,{line:v+1,column:s-I}}let C=0,w=f.length-1;while(C<=w){let v=C+w>>>1,I=f[v],M=f[v+1]??Number.POSITIVE_INFINITY;if(s<I)w=v-1;else if(s>=M)C=v+1;else return t.sourceLineHint=v,{line:v+1,column:s-I}}return}function $t(t,s,f){if(s===void 0||f===void 0||f<s)return;let E=kr(t,s),C=kr(t,f);if(!E||!C)return;return{start:E,end:C}}function ve(t,s){if(!s||typeof s!=="object")return;let f="start"in s&&typeof s.start==="number"?s.start:void 0,E="end"in s&&typeof s.end==="number"?s.end:void 0;return $t(t,f,E)}function Ge(t,s){if(!s||s.length===0)return;let f=[...s];while(f.length>1){let M=f[f.length-1];if(M.tag!==void 0||!M.raw.trim().endsWith("*/"))break;f.pop()}let E=f[0],C=E.raw.indexOf(`@${E.tag??""}`),w=E.start+Math.max(C,0),v=f[f.length-1],I=v.start+v.raw.length;return $t(t,w,I)}function De(t,s,f){return t.source?.slice(s,f)}function We(t,s){if(!s||typeof s!=="object")return;let f="start"in s&&typeof s.start==="number"?s.start:void 0,E="end"in s&&typeof s.end==="number"?s.end:void 0;if(f===void 0||E===void 0)return;return De(t,f,E)?.replace(Ht," ")}function Ut(t,s){if(s===void 0)return;return t.runesPropsDeclarationMetadataByDeclaratorStart.get(s)}function wr(t,s,f){return Ut(t,s)?.props.get(f)}function Nr(t){if(!t||typeof t!=="object"||!("type"in t))return;if(t.type==="Identifier"&&"name"in t&&typeof t.name==="string")return t.name;if(t.type==="TSQualifiedName"&&"right"in t&&t.right&&typeof t.right==="object"&&"name"in t.right&&typeof t.right.name==="string")return t.right.name;return}function Dr(t){if(!t||typeof t!=="object"||!("type"in t))return;if(t.type==="Identifier"&&"name"in t&&typeof t.name==="string")return t.name;if(t.type==="TSQualifiedName"&&"left"in t&&t.left&&typeof t.left==="object")return Dr(t.left);return}function rt(t,s){let f=s?.start,E=s?.end;if(f===void 0||E===void 0)return;return De(t,f+1,E)?.trim()}function ut(t,s){let f=s?.start,E=s?.end;if(f===void 0||E===void 0)return;return De(t,f,E)?.trim()}function Ve(t,s,f,E,C=new Set){if(!s?.type)return;switch(s.type){case"TSInterfaceDeclaration":for(let w of s.extends??[])Ve(t,{type:"TSTypeReference",typeName:w.expression,typeParameters:w.typeParameters},f,E,C);Ve(t,{type:"TSTypeLiteral",members:s.body?.body},f,E,C);return;case"TSTypeAliasDeclaration":case"TSParenthesizedType":case"TSTypeAnnotation":Ve(t,s.typeAnnotation,f,E,C);return;case"TSIntersectionType":case"TSUnionType":for(let w of s.types??[])Ve(t,w,f,E,C);return;case"TSTypeLiteral":for(let w of s.members??[]){if(w?.type!=="TSPropertySignature")continue;Ve(t,w.typeAnnotation?.typeAnnotation,f,E,C)}return;case"TSTypeReference":{let w=Dr(s.typeName);if(w){if(t.typeImportBindingsByLocalName.has(w)||t.valueImportBindingsByLocalName.has(w))f.add(w);let I=t.localTypeDeclarationsByName.get(w);if(I&&!C.has(w))E.add(w),C.add(w),Ve(t,I.node,f,E,C),C.delete(w)}let v=s.typeArguments??s.typeParameters;if(v&&typeof v==="object"){let I=v;for(let M of I.params??[])Ve(t,M,f,E,C)}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 w in s){let v=s[w];if(!v||typeof v!=="object")continue;if(Array.isArray(v)){for(let I of v){if(!I||typeof I!=="object"||!("type"in I))continue;Ve(t,I,f,E,C)}continue}if("type"in v)Ve(t,v,f,E,C)}}function Pa(t,s){let f=new Map;for(let E of Array.from(s).sort()){let C=t.typeImportBindingsByLocalName.get(E),w=C?void 0:t.valueImportBindingsByLocalName.get(E),v=C??(w?{importedName:w.importedName,localName:w.localName,source:w.source,specifierType:"named"}:void 0);if(!v)continue;let I=f.get(v.source)??{default:[],named:[],namespace:[]};if(v.specifierType==="default")I.default.push(v.localName);else if(v.specifierType==="namespace")I.namespace.push(v.localName);else I.named.push({imported:v.importedName,local:v.localName});f.set(v.source,I)}return Array.from(f.entries()).sort(([E],[C])=>u(E,C)).map(([E,C])=>{if(C.namespace.length>0)return C.namespace.map((M)=>`import type * as ${M} from "${E}";`).join(`
10
+ `);let w=C.named.map(({imported:M,local:U})=>{if(!M||M===U)return U;return`${M} as ${U}`}),v=C.default[0],I=w.length>0?`{ ${w.join(", ")} }`:"";if(v&&I)return`import type ${v}, ${I} from "${E}";`;if(v)return`import type ${v} from "${E}";`;return`import type ${I} from "${E}";`})}function je(t,s){if(s)t.additionalTypeDependencyNodes.push(s)}function Aa(t){if(!t.const)return;let s=t.id?.name;if(!s)return;let f=[];for(let E of t.members??[]){let C=E.initializer;if(C?.type!=="Literal")return;let w=C.value;if(typeof w==="string")f.push(JSON.stringify(w));else if(typeof w==="number")f.push(String(w));else return}if(f.length===0)return;return`type ${s} = ${f.join(" | ")};`}function Lr(t,s){let f=Aa(s);if(f)return f;if(s.start===void 0||s.end===void 0)return;let E=De(t,s.start,s.end)?.trim();return E?`declare ${E}`:void 0}function kn(t,s){let f=[];for(let E of s.params??[]){let C=E.type==="TSParameterProperty"&&E.parameter?E.parameter:E;if(C.type==="RestElement"){je(t,C.typeAnnotation?.typeAnnotation),f.push({name:C.argument?.name??"rest",type:rt(t,C.typeAnnotation),optional:!1,rest:!0});continue}let w=C.type==="AssignmentPattern",v=w?C.left:C;je(t,v?.typeAnnotation?.typeAnnotation),f.push({name:v?.name??"arg",type:rt(t,v?.typeAnnotation),optional:w||C.optional===!0,rest:!1})}je(t,s.returnType?.typeAnnotation);for(let E of s.typeParameters?.params??[])je(t,E.constraint),je(t,E.default);return{params:f,returnType:rt(t,s.returnType),typeParameters:ut(t,s.typeParameters)||void 0}}function Ir(t,s){let{params:f,returnType:E,typeParameters:C}=kn(t,s),w=f.map(({name:I,type:M,optional:U,rest:V})=>V?`...${I}: ${M??"any[]"}`:`${I}${U?"?":""}: ${M??"any"}`),v=E!==void 0||C!==void 0||f.some((I)=>I.type!==void 0);return{signature:`${C??""}(${w.join(", ")}) => ${E??"any"}`,hasAnnotations:v}}function Mr(t){let s=t.pendingCallDefaultCandidates.length>0?t.pendingCallDefaultCandidates.slice():void 0,f=t.pendingConstDefaultCandidates.length>0?t.pendingConstDefaultCandidates.slice():void 0,E=t.pendingContextKeyCandidates.length>0?t.pendingContextKeyCandidates.slice():void 0,C=t.pendingDispatchEscapeCandidates.length>0?t.pendingDispatchEscapeCandidates.slice():void 0;if(!s&&!f&&!E&&!C)return;let w=t.deferredEventNoSourceDiagnostics.length>0?t.deferredEventNoSourceDiagnostics.slice():void 0,v=C&&t.untypedJsDocEventNames.size>0?Array.from(t.untypedJsDocEventNames):void 0;return{...s?{pendingCallDefaultCandidates:s}:{},...f?{pendingConstDefaultCandidates:f}:{},...E?{pendingContextKeyCandidates:E}:{},...C?{pendingDispatchEscapeCandidates:C}:{},...w?{deferredEventNoSourceDiagnostics:w}:{},...v?{untypedJsDocEventNames:v}:{}}}function Rr(t){let s=new Set,f=new Set;for(let M of t.additionalTypeDependencyNodes)Ve(t,M,s,f);let E=Array.from(t.localTypeDeclarationsByName.values()).filter((M)=>M.exported).sort((M,U)=>M.start-U.start);for(let M of E)Ve(t,M.node,s,f);let C=E.map((M)=>`export ${M.code}`),w=t.typedRunesPropsDeclarations.length===1?t.typedRunesPropsDeclarations[0]:void 0,v=w?.canonicalType;if(w&&v){for(let M of w.referencedImportedTypes)s.add(M);for(let M of w.referencedLocalTypes)f.add(M)}if(!v&&s.size===0&&f.size===0&&C.length===0)return;let I=Array.from(f).map((M)=>t.localTypeDeclarationsByName.get(M)).filter((M)=>M!==void 0&&!M.exported).sort((M,U)=>M.start-U.start).map((M)=>M.code);return{...v?{canonicalPropsType:v}:{},canonicalPropNames:w&&v?Array.from(w.props.keys()).sort():[],localTypeDeclarations:I,...C.length>0?{moduleTypeDeclarations:C}:{},typeImportStatements:Pa(t,s)}}function Ca(t,s,f,E,C){for(let w of t){if(w.type!=="Block"||w.start<f||w.end>E)continue;C.push({start:w.start,end:w.end,isJsDoc:w.end-w.start>4&&s.startsWith("/**",w.start)})}}function _r(t,s,f){if(!t||typeof t!=="object"||!("type"in t))return;let E=t;if(E.type==="FunctionDeclaration"){if(E.id?.type==="Identifier"&&E.id.name)f.push({name:E.id.name,start:s});return}if(E.type==="VariableDeclaration"){for(let C of E.declarations??[])if(C?.id?.type==="Identifier"&&C.id.name)f.push({name:C.id.name,start:s})}}function va(t){let s=[];for(let f of t){if(!f||typeof f!=="object"||!("type"in f))continue;let E=f;if(E.start===void 0)continue;if(E.type==="ExportNamedDeclaration"&&E.declaration)_r(E.declaration,E.start,s);else _r(E,E.start,s)}return s}function ka(t,s,f){let E=0,C=t.length;while(E<C){let w=E+C>>>1;if(t[w].end<=s)E=w+1;else C=w}for(let w=E-1;w>=0;w--){let v=t[w];if(!v.isJsDoc)continue;return hn(f,v.end,s)?v:void 0}return}function wa(t){let s=new Map;if(!t.source)return s;let f=[t.parsed?.module,t.parsed?.instance],E=[],C=[],w=t.parsed?.comments??[];for(let v of f){let I=v?.content;if(!I)continue;Ca(w,t.source,I.start,I.end,E),C.push(...va(I.body))}E.sort((v,I)=>v.end-I.end);for(let v of C){let I=ka(E,v.start,t.source);if(!I)continue;let M=bn(t,t.source.slice(I.start,I.end)),{type:U,description:V,ignore:z,internal:te}=B(M);if(z.length>0)Ze(t,"context-any-type",v.name,z);if(!U&&!V&&!te)continue;s.set(v.name,{type:U?et(U.type):void 0,description:V||U&&Er(U),internal:te||void 0})}return s}function Or(t,s){if(!t.variableInfoCacheBuilt)t.variableInfoCache=wa(t),t.variableInfoCacheBuilt=!0;return t.variableInfoCache.get(s)}function at(t,s){let f=vn(t,s);if(f?.type)return{type:f.type,description:f.description,internal:f.internal};let E=Or(t,s),C=t.explicitVariableTypesByName.get(s);if(C)return{type:C,description:E?.description,internal:E?.internal};if(!E?.type)return null;return{type:E.type,description:E.description,internal:E.internal}}function Br(t,s){let f=Or(t,s);return{...f?.description?{description:f.description}:{},...f?.internal?{internal:!0}:{}}}function ot(t,s){for(let E of t.vars)if(E.declarations.some((w)=>w.id&&typeof w.id==="object"&&("type"in w.id)&&w.id.type==="Identifier"&&("name"in w.id)&&w.id.name===s))return qe(t,E);let f=t.funcDecls.get(s);if(f)return qe(t,f);return}function ft(t,s,f){if(p(s)===void 0)return;if(Vt(t,s),t.props.has(s)){let E=t.props.get(s);t.props.set(s,{...E,...f})}else t.props.set(s,f)}function Gt(t,s,f,E){if(s.pendingCallDefault)t.pendingCallDefaultCandidates.push({propName:f,location:E,...s.pendingCallDefault});if(s.pendingConstDefault)t.pendingConstDefaultCandidates.push({propName:f,location:E,...s.pendingConstDefault})}var Na=/[^\S\r\n]*[\r\n]\s*/g;function st(t,s,f=0){let E,C,w=!1;if(!s||typeof s!=="object"||!("type"in s))return{value:E,type:C,isFunction:w};let v=qr(t,s);if(s.type==="ObjectExpression"||s.type==="BinaryExpression"||s.type==="ArrayExpression"||s.type==="ArrowFunctionExpression"||s.type==="FunctionExpression"){let I=s;if("start"in I&&"end"in I&&typeof I.start==="number"&&typeof I.end==="number")E=De(t,I.start,I.end)?.replace(Ht," ");if(w=s.type==="ArrowFunctionExpression"||s.type==="FunctionExpression",s.type==="BinaryExpression")C=ze(t,s,f);else if(s.type==="ObjectExpression"||s.type==="ArrayExpression"){let{start:M,end:U}=I;C=wn(s)?Ia(t,M,U,E):void 0}if(s.type==="ArrowFunctionExpression"||s.type==="FunctionExpression")C=Hr(s),E=jr(t,s)}else if(s.type==="UnaryExpression"){let I=s;if("start"in I&&"end"in I&&typeof I.start==="number"&&typeof I.end==="number")E=De(t,I.start,I.end);C=ze(t,I,f)}else if(s.type==="LogicalExpression"||s.type==="ConditionalExpression"||s.type==="SequenceExpression"){let{start:I,end:M}=s,U=I===void 0||M===void 0?void 0:De(t,I,M)?.replace(Na," ");E=U!==void 0&&s.type==="SequenceExpression"?`(${U})`:U,C=ze(t,s,f)}else if(s.type==="NewExpression"){let I=s;if("start"in I&&"end"in I&&typeof I.start==="number"&&typeof I.end==="number")E=De(t,I.start,I.end);if(I.callee&&typeof I.callee==="object"&&"type"in I.callee&&I.callee.type==="Identifier"){let M=I.callee.name;if(M==="Date")C="Date";else if(M==="Map")C="Map<any, any>";else if(M==="Set")C="Set<any>";else if(M==="WeakMap")C="WeakMap<object, any>";else if(M==="WeakSet")C="WeakSet<object>";else if(M==="Array")C="any[]";else if(M==="RegExp"||M==="Regexp")C="RegExp";else if(M==="Error")C="Error";else C=M}}else if(s.type==="CallExpression"){let I=s;if("start"in I&&"end"in I&&typeof I.start==="number"&&typeof I.end==="number")E=De(t,I.start,I.end);let M=I.callee,U=M&&typeof M==="object"&&"type"in M&&M.type==="Identifier"?M.name:void 0;if((U==="$derived"||U==="$state")&&I.arguments.length===1&&f<5)return{...st(t,I.arguments[0],f+1),value:E,defaultValue:v};if(U){let V=Ra(t,U);if(V)return{value:E,type:void 0,isFunction:!1,defaultValue:v,resolvedType:V};if(t.funcDecls.has(U)||_a(t,U))return{value:E,type:void 0,isFunction:!1,defaultValue:v,pendingCallDefault:{calleeName:U}};let z=t.valueImportBindingsByLocalName.get(U);if(z)return{value:E,type:void 0,isFunction:!1,defaultValue:v,pendingCallDefault:{calleeName:U,importSource:z.source,importedName:z.importedName}}}return{value:E,type:void 0,isFunction:!1,defaultValue:v,pendingCallDefault:{calleeName:U??Ma(t,M)}}}else if(s.type==="Identifier"){let I=s;if(f<5){let U=Jt(t,I.name);if(U){let V=st(t,U,f+1),z=ot(t,I.name);return{...V,resolvedType:z?.type??V.resolvedType,resolvedDescription:z?.description??V.resolvedDescription,resolvedParams:z?.params??V.resolvedParams,resolvedReturnType:z?.returnType??V.resolvedReturnType}}if(t.funcDecls.has(I.name)){let V=ot(t,I.name),z=t.funcDecls.get(I.name);return{value:z?jr(t,z):void 0,type:void 0,isFunction:!0,defaultValue:z?qr(t,z):void 0,resolvedType:V?.type??Fa(V,z),resolvedDescription:V?.description,resolvedParams:V?.params,resolvedReturnType:V?.returnType}}}if("start"in I&&"end"in I&&typeof I.start==="number"&&typeof I.end==="number")E=De(t,I.start,I.end);let M=t.valueImportBindingsByLocalName.get(I.name);if(M)return{value:E,type:C,isFunction:w,defaultValue:v,pendingConstDefault:{importSource:M.source,importedName:M.importedName}}}else if(s.type==="MemberExpression"){let I=s;if("start"in I&&"end"in I&&typeof I.start==="number"&&typeof I.end==="number")E=De(t,I.start,I.end);if(Ga(s))C="number";let M=Z(t,s);if(M)return{value:E,type:C,isFunction:w,defaultValue:v,pendingConstDefault:{importSource:M.source,importedName:M.importedName,...M.members?{members:M.members}:{}}}}else if(s.type==="TemplateLiteral"){let I=s;if("start"in I&&"end"in I&&typeof I.start==="number"&&typeof I.end==="number")E=De(t,I.start,I.end);C="string"}else if("raw"in s&&typeof s.raw==="string")E=s.raw,C=Et(s);return{value:E,type:C,isFunction:w,defaultValue:v}}function Et(t){if("regex"in t&&t.regex)return"RegExp";if("bigint"in t&&t.bigint)return"bigint";return t.value==null?void 0:typeof t.value}var Da=new Set(["-","*","/","%","**","<<",">>",">>>","&","|","^"]),La=new Set(["==","!=","===","!==","<","<=",">",">=","in","instanceof"]);function ze(t,s,f){if(!s||typeof s!=="object"||!("type"in s))return;switch(s.type){case"UnaryExpression":{let E=s;if(E.operator==="!"||E.operator==="delete")return"boolean";if(E.operator==="typeof")return"string";if(E.operator==="void")return;if(E.operator==="+")return"number";return ze(t,E.argument,f)==="bigint"?"bigint":"number"}case"BinaryExpression":{let E=s;if(La.has(E.operator))return"boolean";let C=ze(t,E.left,f),w=ze(t,E.right,f);if(C==="bigint"&&w==="bigint")return"bigint";if(Da.has(E.operator))return"number";if(E.operator!=="+")return;if(C==="string"||w==="string")return"string";if(C==="number"&&w==="number")return"number";return}case"LogicalExpression":{let E=s;return Fr([ze(t,E.left,f),ze(t,E.right,f)])}case"ConditionalExpression":{let E=s;return Fr([ze(t,E.consequent,f),ze(t,E.alternate,f)])}case"SequenceExpression":{let E=s.expressions;return ze(t,E[E.length-1],f)}case"Identifier":{let E=s.name;if(E==="NaN"||E==="Infinity")return"number";if(E==="undefined")return;let C=at(t,E)?.type;if(C)return C;if(f>=5)return;return ze(t,Jt(t,E),f+1)}default:{if(f>=5)return;let E=st(t,s,f+1);return E.type??E.resolvedType}}}function Fr(t){let s=new Set;for(let f of t){if(f===void 0)return;s.add(f.includes("=>")?`(${f})`:f)}return s.size===1?t[0]:[...s].join(" | ")}function Ia(t,s,f,E){if(E===void 0||s===void 0||f===void 0)return E;let C=t.parsed?.comments??[],w="",v=s;for(let I of C){if(I.start<s||I.end>f)continue;w+=De(t,v,I.start)??"",v=I.end}if(v===s)return E;return w+=De(t,v,f)??"",w.replace(Ht," ")}function wn(t){if(!t||typeof t!=="object"||!("type"in t))return!1;switch(t.type){case"Literal":return!(("regex"in t)&&t.regex);case"TemplateLiteral":return t.expressions.length===0;case"Identifier":return t.name==="undefined";case"UnaryExpression":{let s=t,f=s.argument;return s.operator==="-"&&f?.type==="Literal"&&(typeof f.value==="number"||typeof f.value==="bigint")}case"ArrayExpression":return t.elements.every((s)=>s!==null&&wn(s));case"ObjectExpression":return t.properties.every((s)=>s.type==="Property"&&s.kind==="init"&&!s.computed&&!s.method&&!s.shorthand&&(s.key.type==="Identifier"||s.key.type==="Literal")&&wn(s.value));default:return!1}}function Wt(t,s){let f=Jt(t,s);if(!f||typeof f!=="object"||!("type"in f))return;if(f.type==="CallExpression"){let E=f,C=We(t,E.callee);if(C==="$state"||C==="$state.raw"||C==="$derived"){let w=E.typeArguments?.params?.[0];if(w)return je(t,w),We(t,w);if(C==="$state.raw")return st(t,E.arguments[0],1).type}}return st(t,f).type}function Jt(t,s){for(let f of t.vars)for(let E of f.declarations)if(E.id&&typeof E.id==="object"&&"type"in E.id&&E.id.type==="Identifier"&&"name"in E.id&&E.id.name===s&&E.init)return E.init;return}function mt(t,s){for(let f of t.vars){if(f.kind!=="const")continue;for(let E of f.declarations)if(E.id&&typeof E.id==="object"&&"type"in E.id&&E.id.type==="Identifier"&&"name"in E.id&&E.id.name===s&&E.init)return E.init}return}function Ma(t,s){if(s&&typeof s==="object"&&"start"in s&&"end"in s&&typeof s.start==="number"&&typeof s.end==="number")return De(t,s.start,s.end)??"call";return"call"}function Ra(t,s){let f=ot(t,s);if(f?.returnType)return f.returnType;let E=t.funcDecls.get(s)??Vr(t,s);if(!E)return;let C=Ba(t,E);if(C)return C;let w=Oa(t,s);if(w)return w;let v=$r(E);return v==="any"?void 0:v}function _a(t,s){return Vr(t,s)!==void 0}function Vr(t,s){let f=Jt(t,s);if(!f||typeof f!=="object"||!("type"in f))return;if(f.type==="ArrowFunctionExpression"||f.type==="FunctionExpression")return f;return}function Oa(t,s){for(let f of t.vars)for(let E of f.declarations){let C=E.id;if(!C||typeof C!=="object"||!("type"in C)||C.type!=="Identifier"||!("name"in C)||C.name!==s)continue;let v=C.typeAnnotation;if(v?.type!=="TSTypeAnnotation")return;let I=v.typeAnnotation;if(!I||typeof I.start!=="number"||typeof I.end!=="number")return;return W(De(t,I.start,I.end))}return}function Ba(t,s){let f=s.returnType;if(f?.type!=="TSTypeAnnotation")return;let E=f.typeAnnotation;if(!E||typeof E.start!=="number"||typeof E.end!=="number")return;return De(t,E.start,E.end)}function Fa(t,s){let f=t?.returnType??"any",E=t?.params;if(E&&E.length>0)return`(${T(E)}) => ${f}`;if(t?.returnType)return`() => ${f}`;if(s)return Hr(s);return"(...args: any[]) => any"}function Hr(t){return`(${ja(t)}) => ${$r(t)}`}function ja(t){let s=t.params;if(!Array.isArray(s)||s.length===0)return"...args: any[]";let f=[];for(let E of s)if(E&&typeof E==="object"&&"type"in E&&E.type==="Identifier"&&"name"in E&&typeof E.name==="string")f.push(`${E.name}: any`);else return"...args: any[]";return f.join(", ")}function $r(t){if(t.async||t.generator)return"any";let s=t.body,f;if(s&&typeof s==="object"&&"type"in s&&s.type==="BlockStatement"){if(f=qa(s),f.length===0)return"any"}else f=[s];let E=null;for(let C of f){let w=Va(C);if(!w)return"any";if(E===null)E=w;else if(E!==w)return"any"}return E??"any"}function qa(t){let s=[];return Nn(t,s),s}function Nn(t,s){if(!t||typeof t!=="object")return;let f=t;if(typeof f.type!=="string")return;if(f.type==="FunctionDeclaration"||f.type==="FunctionExpression"||f.type==="ArrowFunctionExpression")return;if(f.type==="ReturnStatement")s.push(f.argument??null);for(let E in f){if(E==="leadingComments")continue;let C=f[E];if(!C||typeof C!=="object")continue;if(Array.isArray(C))for(let w=0;w<C.length;w++)Nn(C[w],s);else Nn(C,s)}}function Va(t){if(!t||typeof t!=="object"||!("type"in t))return null;switch(t.type){case"Literal":{let s=t.value;if(typeof s==="string")return"string";if(typeof s==="number")return"number";if(typeof s==="boolean")return"boolean";return null}case"TemplateLiteral":return"string";case"CallExpression":{let s=t.callee;if(s&&typeof s==="object"&&"type"in s&&s.type==="Identifier"){let f=s.name;if(f==="String")return"string";if(f==="Number")return"number";if(f==="Boolean")return"boolean"}return null}default:return null}}function Ur(t){if(d(t,"$bindable"))return{init:t.arguments[0],bindable:!0};return{init:t,bindable:!1}}function Ha(t,s){let f=s.params;if(!Array.isArray(f)||f.length===0)return"";let E=f[0],C=f[f.length-1];if(typeof E.start!=="number"||typeof C.end!=="number")return"";return De(t,E.start,C.end)??""}function jr(t,s){if(s.generator)return;let f=s.body;if(!f||typeof f!=="object"||!("type"in f))return;let E=Ha(t,s),C=s.async?"async ":"",w=(I,M)=>I&&typeof I==="object"&&("type"in I)&&I.type==="ObjectExpression"?`(${M})`:M;if(f.type!=="BlockStatement"){let I=We(t,f);return I===void 0?void 0:`${C}(${E}) => ${w(f,I)}`}let v=f.body;if(v.length===0)return`${C}(${E}) => {}`;if(v.length===1){let I=v[0];if(I&&typeof I==="object"&&"type"in I&&I.type==="ReturnStatement"){let M=I.argument;if(M){let U=We(t,M);if(U!==void 0)return`${C}(${E}) => ${w(M,U)}`}}}return}function qr(t,s){let f=We(t,s);if(!f||!s||typeof s!=="object"||!("type"in s))return;let E="expression";if(s.type==="Literal"||s.type==="UnaryExpression")E="literal";else if(s.type==="TemplateLiteral")E=s.expressions.length===0?"literal":"expression";else if(s.type==="ArrayExpression")E="array";else if(s.type==="ObjectExpression")E="object";else if(s.type==="ArrowFunctionExpression"||s.type==="FunctionExpression"||s.type==="FunctionDeclaration")E="function";let C={raw:f,kind:E};if(E==="literal"||E==="array"||E==="object"){let w=Dn(s);if(w.ok)C.value=w.value}return C}function Dn(t){if(!t||typeof t!=="object"||!("type"in t))return{ok:!1};if(t.type==="Literal"){let s=t.value;return typeof s==="bigint"||"regex"in t?{ok:!1}:{ok:!0,value:s}}if(t.type==="UnaryExpression"){let s=t,f=s.argument;if(!f||typeof f!=="object"||!("type"in f)||f.type!=="Literal")return{ok:!1};let E=f.value;if(typeof E==="number"){if(s.operator==="-")return{ok:!0,value:-E};if(s.operator==="+")return{ok:!0,value:E}}if(typeof E==="boolean"&&s.operator==="!")return{ok:!0,value:!E};return{ok:!1}}if(t.type==="TemplateLiteral"){let s=t;if(s.expressions.length>0||s.quasis.length!==1)return{ok:!1};return{ok:!0,value:s.quasis[0].value.cooked??s.quasis[0].value.raw}}if(t.type==="ArrayExpression"){let s=t,f=[];for(let E of s.elements){if(!E)return{ok:!1};let C=Dn(E);if(!C.ok)return{ok:!1};f.push(C.value)}return{ok:!0,value:f}}if(t.type==="ObjectExpression"){let s=t,f={};for(let E of s.properties){if(E.type!=="Property"||E.computed)return{ok:!1};let C=o(E.key);if(!C)return{ok:!1};let w=Dn(E.value);if(!w.ok)return{ok:!1};f[C]=w.value}return{ok:!0,value:f}}return{ok:!1}}var $a=new Set(["POSITIVE_INFINITY","NEGATIVE_INFINITY","MAX_VALUE","MIN_VALUE","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","EPSILON","NaN"]),Ua=new Set(["PI","E","LN2","LN10","LOG2E","LOG10E","SQRT2","SQRT1_2"]);function Ga(t){if(!t||typeof t!=="object"||!("type"in t))return!1;if(t.type!=="MemberExpression")return!1;let s=t,f=s.object&&"name"in s.object?s.object.name:void 0,E=s.property&&"name"in s.property?s.property.name:void 0;if(!f||!E)return!1;if(f==="Number")return $a.has(E);if(f==="Math")return Ua.has(E);return!1}function He(t,s,f){if(!s||t.has(s))return;t.set(s,f)}function Pt(t,s){for(let f=t.activeScopes.length-1;f>=0;f-=1){let E=t.activeScopes[f]?.get(s);if(!E)continue;return E.kind==="prop"?E.publicPropName:void 0}return}function At(t,s){for(let f=t.activeScopes.length-1;f>=0;f-=1){let E=t.activeScopes[f];if(E===t.componentScope)return!1;if(E?.has(s))return!0}return!1}function zt(t,s){let f=s;while(A(f))f=f.object;return e(f)&&At(t,f.name)}function Oe(t,s=new Set){if(!t||typeof t!=="object"||!("type"in t))return s;switch(t.type){case"Identifier":s.add(t.name);break;case"AssignmentPattern":Oe(t.left,s);break;case"ArrayPattern":for(let f of t.elements)Oe(f??void 0,s);break;case"ObjectPattern":for(let f of t.properties)if(f.type==="Property")Oe(f.value,s);else if(f.type==="RestElement")Oe(f.argument,s);break;case"RestElement":Oe(t.argument,s);break}return s}function In(t,s){if(!s||typeof s!=="object"||!("type"in s))return;if(s.type==="Identifier"){let E=Pt(t,s.name);if(E)t.reactive_vars.add(E);return}let f=Oe(s);for(let E of f){let C=Pt(t,E);if(C)t.reactive_vars.add(C)}}function Ct(t){if(!t||typeof t!=="object"||!("type"in t))return!1;switch(String(t.type)){case"BlockStatement":case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"CatchClause":case"EachBlock":case"AwaitBlock":return!0;default:return!1}}function Gr(t){if(!t||typeof t!=="object"||!("type"in t))return!1;let s=String(t.type);return s==="FunctionDeclaration"||s==="FunctionExpression"||s==="ArrowFunctionExpression"}function Wa(t,s){let f=t.scopeDeclarations.get(s);if(!f)f=new Map,t.scopeDeclarations.set(s,f);return f}function Ja(t){let s=[];if(t.id.type==="Identifier")return s.push({kind:"local",name:t.id.name}),s;if(t.id.type!=="ObjectPattern")return s;for(let f of t.id.properties){if(f.type==="RestElement"){if(f.argument.type==="Identifier")s.push({kind:"local",name:f.argument.name});continue}if(f.computed)continue;let E=o(f.key);if(!E)continue;let C;if(f.value.type==="Identifier")C=f.value.name;else if(f.value.type==="AssignmentPattern"&&f.value.left.type==="Identifier")C=f.value.left.name;if(!C)continue;s.push({kind:"prop",name:C,publicPropName:E})}return s}function Ln(t,s,f,E){if(!me(t))return;let C=E?.allowRunesProps??!1,w=E?.forceProp??!1,v=t;for(let I of v.declarations){if(C&&d(m(I.init),"$props")){for(let V of Ja(I))He(V.kind==="prop"?s:f,V.name,V.kind==="prop"?{kind:"prop",publicPropName:V.publicPropName}:{kind:"local"});continue}let M=v.kind==="var"?f:s,U=w?"prop":"local";for(let V of Oe(I.id))He(M,V,U==="prop"?{kind:"prop",publicPropName:V}:{kind:"local"})}}function za(t,s){if("id"in t&&t.id&&typeof t.id==="object"&&"name"in t.id&&typeof t.id.name==="string")He(s,t.id.name,{kind:"local"});for(let f of t.params)for(let E of Oe(f))He(s,E,{kind:"local"})}function Ka(t,s,f){if(!Array.isArray(t))return;for(let E of t){if(!E||typeof E!=="object"||!("type"in E))continue;switch(E.type){case"VariableDeclaration":Ln(E,s,f);break;case"FunctionDeclaration":if(E.id?.name)He(s,E.id.name,{kind:"local"});break;case"ClassDeclaration":if(E.id?.name)He(s,E.id.name,{kind:"local"});break}}}function Xa(t,s){for(let{local:f,exported:E}of s){if(f.type!=="Identifier")continue;let C=E.type==="Identifier"?E.name:String(E.value);if(t.componentScope.get(f.name)?.kind==="prop")continue;t.componentScope.set(f.name,{kind:"prop",publicPropName:C})}}function Ya(t,s){for(let f of s?.content.body??[])switch(f.type){case"ImportDeclaration":for(let E of f.specifiers)if(E.local.name)He(t.componentScope,E.local.name,{kind:"local"});break;case"VariableDeclaration":Ln(f,t.componentScope,t.componentScope,{allowRunesProps:!0});break;case"FunctionDeclaration":if(f.id?.name)He(t.componentScope,f.id.name,{kind:"local"});break;case"ClassDeclaration":if(f.id?.name)He(t.componentScope,f.id.name,{kind:"local"});break;case"ExportNamedDeclaration":if(!f.declaration){if(f.source==null)Xa(t,f.specifiers);break}if(f.declaration.type==="VariableDeclaration")Ln(f.declaration,t.componentScope,t.componentScope,{forceProp:!0});else if(f.declaration.type==="FunctionDeclaration"&&f.declaration.id?.name)He(t.componentScope,f.declaration.id.name,{kind:"prop",publicPropName:f.declaration.id.name});break}}function Wr(t){t.componentScope.clear(),t.scopeDeclarations=new Map,t.activeScopes.length=0,Ya(t,t.parsed?.instance)}function Jr(t){return{varScopeStack:[t.componentScope]}}function zr(t,s,f){if(!Ct(f))return;let E=Wa(t,f),C=s.varScopeStack[s.varScopeStack.length-1]??t.componentScope;switch(f.type){case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":za(f,E);break;case"BlockStatement":Ka(f.body,E,C);break;case"CatchClause":for(let w of Oe(f.param))He(E,w,{kind:"local"});break;case"EachBlock":for(let w of Oe(f.context))He(E,w,{kind:"local"});if(typeof f.index==="string")He(E,f.index,{kind:"local"});break;case"AwaitBlock":for(let w of Oe(f.value))He(E,w,{kind:"local"});for(let w of Oe(f.error))He(E,w,{kind:"local"});break}if(Gr(f))s.varScopeStack.push(E);return E}function Kr(t,s){if(Gr(s))t.varScopeStack.pop()}function Mn(t,s){let f=at(t,s);if(f&&f.type===t.explicitVariableTypesByName.get(s))je(t,t.explicitVariableTypeNodesByName.get(s));return f}function Kt(t,s,f=!0){let E=Mn(t,s);if(E||!f)return E;let C=Wt(t,s);return C?{type:C,...Br(t,s)}:null}function Qa(t,s,f){if(!e(s))return null;let E=mt(t,s.name);if(l(E))return ns(t,E,f).properties;let C=Kt(t,s.name);return C?nt(C.type):null}function Za(t,s){return t.properties.some((f)=>f.type==="Property"&&f.kind==="get"&&o(f.key)===s)}function Xr(t,s,f){if(!s||typeof s!=="object"||!(f in s))return;let E=s[f];if(!E||typeof E!=="object"||!("typeAnnotation"in E))return;return We(t,E.typeAnnotation)}function eo(t){let s=t?.body.body;if(s?.length!==1||s[0].type!=="ReturnStatement")return;return s[0].argument??void 0}function to(t,s,f,E,C){if(e(C)){let w=Kt(t,C.name);if(w)return w;return Ne(t,"context-any-type",f,`Context "${s}" property "${f}" has no type annotation; defaulted to "any".`,ve(t,E)),{type:"any"}}if(C?.type==="ArrowFunctionExpression"||C?.type==="FunctionExpression")return{type:`(${C.params.map((v)=>`${e(v)?v.name||"arg":"arg"}: any`).join(", ")}) => any`};if(b(C))return{type:Et(C)??"null"};return{type:"any"}}function ns(t,s,f){let E=[],C=!1;for(let w of s.properties){if(w.type==="SpreadElement"){let V=Qa(t,w.argument,f);if(V)E.push(...V);else C=!0,Ne(t,"spread-unresolved",f,`Context "${f}" spreads a value sveld can't resolve; its shape is widened to "Record<string, any>".`,ve(t,w));continue}if(w.type!=="Property")continue;let v=o(w.key);if(!v)continue;if(w.kind==="set"&&Za(s,v))continue;let I=w.kind==="get"||w.kind==="set"?w.value:void 0,M=I?w.kind==="get"?Xr(t,I,"returnType"):Xr(t,I.params[0],"typeAnnotation"):void 0,U=M?{type:M}:to(t,f,v,w,w.kind==="get"?eo(I):w.kind==="set"?void 0:w.value);E.push({name:v,type:U.type,description:U.description,optional:!1,...U.internal?{internal:!0}:{}})}return{properties:E,hasUnresolvedSpread:C}}function Yr(t,s,f){let{properties:E,hasUnresolvedSpread:C}=ns(t,s,f);return{key:f,typeName:_(f),properties:E,description:void 0,...C?{hasUnresolvedSpread:C}:{}}}function Qr(t,s,f){if(l(s))return Yr(t,s,f);else if(e(s)){let E=s.name,C=Kt(t,E,!1),w=C?void 0:mt(t,E);if(l(w))return Yr(t,w,f);let v=C??Kt(t,E);if(v){let I=nt(v.type);return{key:f,typeName:_(f),...I?{}:{type:v.type},properties:I??[],description:v.description,...v.internal?{internal:!0}:{}}}return Ne(t,"context-any-type",E,`Context "${f}" variable "${E}" has no type annotation; defaulted to "any".`,ve(t,s)),{key:f,typeName:_(f),type:"any",properties:[]}}return null}function Zr(t){let s=t.callee;if(!s||typeof s!=="object"||!("type"in s))return null;let f=s.type==="Identifier"&&s.name==="Symbol",E=s.type==="MemberExpression"&&!s.computed&&s.object.type==="Identifier"&&s.object.name==="Symbol"&&s.property.type==="Identifier"&&s.property.name==="for";if(!f&&!E)return null;let C=t.arguments[0];if(!C||typeof C!=="object"||!("type"in C))return"";if(C.type==="Literal"&&typeof C.value==="string")return C.value;if(C.type==="TemplateLiteral"&&C.quasis?.length===1)return C.quasis[0].value.cooked??"";return""}function es(t){return{kind:"pending",importSource:t.source,importedName:t.importedName,...t.members?{members:t.members}:{}}}function rs(t,s,f=0){if(!s||typeof s!=="object"||!("type"in s))return{kind:"unresolved"};let E=s;if(E.type==="Literal"||E.type==="TemplateLiteral"){let C=y(E);return C==null?{kind:"unresolved"}:{kind:"resolved",key:C}}if(E.type==="CallExpression"||E.type==="NewExpression"){let C=Zr(E);return C==null?{kind:"unresolved"}:{kind:"resolved",key:C}}if(E.type==="Identifier"){if(f>=5)return{kind:"unresolved"};let C=mt(t,E.name);if(C&&typeof C==="object"&&"type"in C){let v=C;if((v.type==="CallExpression"||v.type==="NewExpression")&&Zr(v)==="")return{kind:"resolved",key:E.name};return rs(t,v,f+1)}let w=f===0&&At(t,E.name)?void 0:t.valueImportBindingsByLocalName.get(E.name);return w?es(w):{kind:"unresolved"}}if(E.type==="MemberExpression"){let C=f===0&&zt(t,E)?void 0:Z(t,E);if(C)return es(C)}return{kind:"unresolved"}}function ts(t,s,f,E,C){let w=We(t,E)??"";Ne(t,"context-value-unresolved",s,`setContext(${f}, ${w}): the value isn't an object literal or a variable, so sveld can't describe its shape; the context is skipped.`,C)}function ss(t,s){if(!s||typeof s!=="object"||!("type"in s)||s.type!=="CallExpression")return;let f=s,E=f.arguments[0];if(!E)return;let C=rs(t,E);if(C.kind==="unresolved"||C.kind==="resolved"&&!C.key){let U=We(t,E)??"";Ne(t,"context-key-unresolved",U,`setContext key \`${U}\` isn't a string literal, const-bound string, Symbol(), or imported \`export const\` string; the context is skipped.`,ve(t,s));return}let w=f.arguments[1];if(!w)return;let v=ve(t,s);if(C.kind==="pending"){let U=Y(C),V=Qr(t,w,U);if(V)t.pendingContextKeyCandidates.push({importSource:C.importSource,importedName:C.importedName,...C.members?{members:C.members}:{},...V.type===void 0?{}:{type:V.type},properties:V.properties,description:V.description,...V.hasUnresolvedSpread?{hasUnresolvedSpread:!0}:{},...V.internal?{internal:!0}:{},source:v});else ts(t,U,U,w,v);return}let I=C.key,M=Qr(t,w,I);if(!M){ts(t,I,JSON.stringify(I),w,v);return}if(t.contexts.has(I)){Ne(t,"context-duplicate-key",I,`setContext("${I}", ...) was called more than once; only the first call's shape is used.`,v);return}t.contexts.set(I,{...M,source:v})}var no=/\n/g,ro=/^[A-Za-z_$][\w$]*$/;function Rn(t,s){return{variableType:(f)=>{if(s?.has(f))return;return Mn(t,f)?.type??Wt(t,f)}}}function vt(t,s,f){if(!s||typeof s!=="object"||!("type"in s))return f;if(e(s)){if(!At(t,s.name))return f;let C=f??new Set;return C.add(s.name),C}let E=f;if(l(s)){for(let C of s.properties)if(C.type==="Property")E=vt(t,C.value,E)}else if(s.type==="ArrayExpression")for(let C of s.elements)E=vt(t,C,E);return E}function _n(t,s){if(e(s))return t.variableType(s.name);return ke(t,s)}function ke(t,s){if(!s||typeof s!=="object"||!("type"in s))return;if(l(s))return as(t,s);if(s.type==="ArrayExpression")return os(t,s);return}function is(t,s){if(!s||typeof s!=="object"||!("type"in s))return"any";if(e(s))return t.variableType(s.name)??"any";if(b(s))return Et(s)??"null";if(l(s))return as(t,s);if(s.type==="ArrayExpression")return os(t,s);return"any"}function as(t,s){if(s.properties.length===0)return"Record<string, never>";let f=[],E=!1;for(let C of s.properties){let w=C.type==="Property"&&!C.computed?o(C.key):void 0;if(C.type!=="Property"||!w){E=!0;continue}f.push({name:w,type:is(t,C.value)})}if(!E)return kt(f);if(f.length===0)return"Record<string, any>";return kt([...f,{name:"[key: string]",type:"any"}])}function os(t,s){let f=new Set(s.elements.filter((E)=>E!=null).map((E)=>is(t,E)));if(f.size===0)return"any[]";if(f.size===1)return`${[...f][0]}[]`;return`(${[...f].join(" | ")})[]`}function ps(t,s){for(let[f,E]of t.arguments.entries()){if(e(E)&&E.name===s)return{argumentIndex:f};if(!l(E))continue;for(let C of E.properties){if(C.type!=="Property"||!e(C.value))continue;if(C.value.name!==s)continue;let w=!C.computed&&e(C.key)?C.key.name:void 0;return{argumentIndex:f,property:w??""}}}return}function ie(t){return typeof t==="string"?JSON.stringify(t):String(t)}function pt(t,{name:s,detail:f,has_argument:E,description:C,deprecated:w,tags:v,internal:I,source:M}){if(s===void 0)return;let U=!E&&!f?"null":p(f),V=C,z=t.events.get(s);if(z?.type==="forwarded")t.events.set(s,{type:"dispatched",name:s,detail:U,description:V||z.description,deprecated:w??z.deprecated,tags:v??z.tags,...I||z.internal?{internal:!0}:{},source:M||z.source});else if(z){let te=z.tags??v,Q=t.untypedJsDocEventNames.delete(s);t.events.set(s,{...z,detail:z.detail===void 0||Q?U:z.detail,description:z.description||V,deprecated:z.deprecated??w,tags:te,...z.internal||I?{internal:!0}:{},source:M||z.source})}else t.events.set(s,{type:"dispatched",name:s,detail:U,description:V,deprecated:w,tags:v,...I?{internal:!0}:{},source:M})}function ls(t,s){let f=s.arguments[0],E=oe(f,"CustomEvent");if(!E&&!oe(f,"Event"))return;let C=f.arguments[0],w=b(C)?C.value:void 0;if(w==null)return;let v=E?f.arguments[1]:void 0,I=!1,M;if(l(v)){let U=v.properties.find((V)=>V.type==="Property"&&e(V.key)&&V.key.name==="detail");if(U?.type==="Property")I=!0,M=U.value}return{name:String(w),detail:M,hasArgument:I,nestedBoundNames:vt(t,M),source:ve(t,s)}}function cs(t,s){let f=_n(Rn(t,s.nestedBoundNames),s.detail),E=f===void 0&&b(s.detail)?s.detail.value:void 0;pt(t,{name:s.name,detail:f??(E==null?"":ie(E)),has_argument:s.hasArgument,source:s.source})}function kt(t,s,f=!1){if(t.length===0)return"null";let E=t.map(({name:C,type:w,description:v,optional:I,default:M})=>{let U=I?"?":"",V=ro.test(C)||C.startsWith("[")?C:JSON.stringify(C),z=v||"";if(M&&z)z=`${z} @default ${M}`;else if(M)z=`@default ${M}`;if(z=g(z),z){if(f)return`${z.includes(`
11
+ `)?`/**
12
+ ${z.split(`
13
+ `).map((Q)=>Q?` * ${Q}`:" *").join(`
14
+ `)}
15
+ */`:`/** ${z} */`}
16
+ ${V}${U}: ${w};`;return`/** ${z.replace(no," ")} */ ${V}${U}: ${w};`}return`${V}${U}: ${w};`}).join(f?`
17
+ `:" ");return f?`{
18
+ ${E}
19
+ }`:`{ ${E} }`}var Je=!0,so=new WeakMap;function io(t){let s=t.Parser.acorn||t,f=so.get(s);if(!f){let I=function(xe){return xe===Q.name||xe===Q.string||xe===Q.num||Te.includes(xe)||Re.includes(xe)},M=function(xe){return xe===Q.name||Te.includes(xe)||Re.includes(xe)},U=function(xe){return xe===Q.name||Re.includes(xe)},V=function(xe){return xe===we.abstract||xe===we.declare||xe===we.enum||xe===we.module||xe===we.namespace||xe===we.interface||xe===we.type},z=function(xe){return xe===we.keyof||xe===we.readonly||xe===we.unique},te=function(xe){return xe===Q.invalidTemplate},{tokTypes:Q,keywordTypes:be}=s,Te=Object.values(be),we=v(),Re=Object.values(we),Be=w(),Se=C(),Me=new RegExp(`^(?:${Object.keys(we).join("|")})$`);Be.jsxTagStart.updateContext=function(){this.context.push(Se.tc_expr),this.context.push(Se.tc_oTag),this.exprAllowed=!1},Be.jsxTagEnd.updateContext=function(xe){let Ie=this.context.pop();if(Ie===Se.tc_oTag&&xe===Q.slash||Ie===Se.tc_cTag)this.context.pop(),this.exprAllowed=this.curContext()===Se.tc_expr;else this.exprAllowed=!0},f={tokTypes:{...we,...Be},tokContexts:{...Se},keywordsRegExp:Me,tokenIsLiteralPropertyName:I,tokenIsKeywordOrIdentifier:M,tokenIsIdentifier:U,tokenIsTSDeclarationStart:V,tokenIsTSTypeOperator:z,tokenIsTemplate:te}}return f;function E(I,M={}){return new s.TokenType("name",M)}function C(){return{tc_oTag:new s.TokContext("<tag",!1,!1),tc_cTag:new s.TokContext("</tag",!1,!1),tc_expr:new s.TokContext("<tag>...</tag>",!0,!0)}}function w(){return{at:new s.TokenType("@"),jsxName:new s.TokenType("jsxName"),jsxText:new s.TokenType("jsxText",{beforeExpr:!0}),jsxTagStart:new s.TokenType("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new s.TokenType("jsxTagEnd")}}function v(){return{assert:E("assert",{startsExpr:Je}),asserts:E("asserts",{startsExpr:Je}),global:E("global",{startsExpr:Je}),keyof:E("keyof",{startsExpr:Je}),readonly:E("readonly",{startsExpr:Je}),unique:E("unique",{startsExpr:Je}),abstract:E("abstract",{startsExpr:Je}),declare:E("declare",{startsExpr:Je}),enum:E("enum",{startsExpr:Je}),module:E("module",{startsExpr:Je}),namespace:E("namespace",{startsExpr:Je}),interface:E("interface",{startsExpr:Je}),type:E("type",{startsExpr:Je})}}}var ao=1048576,wt=2097152,yt=1,Qt=2,oo=4,jn=8,po=16,Ts=64,bs=128,lo=256,co=512,xs=1024,Yc=yt|Qt|jn|bs,Qc=yt|0|jn|0,Zc=yt|0|oo|0,eu=yt|0|po|0,tu=0|Qt|0|bs,nu=0|Qt|0|0,uo=yt|Qt|jn|lo,ru=0|xs,su=0|Ts,iu=yt|0|0|Ts,au=uo|co,ou=0|xs,Ss=4,Es=2,Ps=1,pu=Es|Ps,lu=Es|Ss,cu=Ps|Ss,fo=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/y,us=new RegExp("(?=("+fo.source+"))\\1"+/(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source,"y"),Nt=class{constructor(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}};function mo(t,s){let f="true";if(s.type==="MethodDefinition"&&(s.kind==="get"||s.kind==="set"))f=(s.static?"s":"i")+s.kind;if(t==="iget"&&f==="iset"||t==="iset"&&f==="iget"||t==="sget"&&f==="sset"||t==="sset"&&f==="sget")return[!1,"true"];if(!t)return[!1,f];return[!0,t]}function ds(t,s){let{computed:f,key:E}=t;return!f&&(E.type==="Identifier"&&E.name===s||E.type==="Literal"&&E.value===s)}var ge={AbstractMethodHasImplementation:({methodName:t})=>`Method '${t}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:t})=>`Property '${t}' 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:t})=>`Cannot find name '${t}'.`,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:t})=>`'declare' is not allowed in ${t}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:t})=>`Duplicate modifier: '${t}'.`,EmptyHeritageClauseType:({token:t})=>`'${t}' 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:t})=>`'${t[0]}' modifier cannot be used with '${t[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:t})=>`Index signatures cannot have an accessibility modifier ('${t}').`,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:t})=>`'${t}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:t})=>`'${t}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:t})=>`'${t}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:t})=>`'${t[0]}' modifier must precede '${t[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:t})=>`Private elements cannot have an accessibility modifier ('${t}').`,PrivateMethodsHasAccessibility:({modifier:t})=>`Private methods cannot have an accessibility modifier ('${t}').`,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:t})=>`Single type parameter ${t} should have a trailing comma. Example usage: <${t},>.`,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:t})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${t}.`,LetInLexicalBinding:"'let' is not allowed to be used as a name in 'let' or 'const' declarations."},Yt={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 ho(t,s,f){let{tokTypes:E}=f,{tokTypes:C}=s;return class extends t{takeDecorators(v){let I=this.decoratorStack[this.decoratorStack.length-1];if(I.length)v.decorators=I,this.resetStartLocationFromNode(v,I[0]),this.decoratorStack[this.decoratorStack.length-1]=[]}parseDecorators(v){let I=this.decoratorStack[this.decoratorStack.length-1];while(this.match(C.at)){let M=this.parseDecorator();I.push(M)}if(this.match(E._export)){if(!v)this.unexpected()}else if(!this.canHaveLeadingDecorator())this.raise(this.start,Yt.UnexpectedLeadingDecorator)}parseDecorator(){let v=this.startNode();this.next(),this.decoratorStack.push([]);let I=this.start,M=this.startLoc,U;if(this.match(E.parenL)){let V=this.start,z=this.startLoc;if(this.next(),U=this.parseExpression(),this.expect(E.parenR),this.options.preserveParens){let te=this.startNodeAt(V,z);te.expression=U,U=this.finishNode(te,"ParenthesizedExpression")}}else{U=this.parseIdent(!1);while(this.eat(E.dot)){let V=this.startNodeAt(I,M);V.object=U,V.property=this.parseIdent(!0),V.computed=!1,U=this.finishNode(V,"MemberExpression")}}return v.expression=this.parseMaybeDecoratorArguments(U),this.decoratorStack.pop(),this.finishNode(v,"Decorator")}parseMaybeDecoratorArguments(v){if(this.eat(E.parenL)){let I=this.startNodeAtNode(v);return I.callee=v,I.arguments=this.parseExprList(E.parenR,!1),this.finishNode(I,"CallExpression")}return v}}}var fs={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:"♦"},yo=/^[\da-fA-F]+$/,go=/^\d+$/;function Dt(t){if(!t)return t;if(t.type==="JSXIdentifier")return t.name;if(t.type==="JSXNamespacedName")return t.namespace.name+":"+t.name.name;if(t.type==="JSXMemberExpression")return Dt(t.object)+"."+Dt(t.property)}function To(t,s,f,E){let C=t.tokTypes,w=s.tokTypes,{isNewLine:v,isIdentifierChar:I}=t,M=Object.assign({allowNamespaces:!0,allowNamespacedObjects:!0},E||{});return class extends f{jsx_readToken(){let V="",z=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated JSX contents");let te=this.input.charCodeAt(this.pos);switch(te){case 60:case 123:if(this.pos===this.start){if(te===60&&this.exprAllowed)return++this.pos,this.finishToken(w.jsxTagStart);return this.getTokenFromCode(te)}return V+=this.input.slice(z,this.pos),this.finishToken(w.jsxText,V);case 38:V+=this.input.slice(z,this.pos),V+=this.jsx_readEntity(),z=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(te===62?"&gt;":"&rbrace;")+'` or `{"'+this.input[this.pos]+'"}`?');default:if(v(te))V+=this.input.slice(z,this.pos),V+=this.jsx_readNewLine(!0),z=this.pos;else++this.pos}}}jsx_readNewLine(V){let z=this.input.charCodeAt(this.pos),te;if(++this.pos,z===13&&this.input.charCodeAt(this.pos)===10)++this.pos,te=V?`
20
+ `:`\r
21
+ `;else te=String.fromCharCode(z);if(this.options.locations)++this.curLine,this.lineStart=this.pos;return te}jsx_readString(V){let z="",te=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");let Q=this.input.charCodeAt(this.pos);if(Q===V)break;if(Q===38)z+=this.input.slice(te,this.pos),z+=this.jsx_readEntity(),te=this.pos;else if(v(Q))z+=this.input.slice(te,this.pos),z+=this.jsx_readNewLine(!1),te=this.pos;else++this.pos}return z+=this.input.slice(te,this.pos++),this.finishToken(C.string,z)}jsx_readEntity(){let V="",z=0,te,Q=this.input[this.pos];if(Q!=="&")this.raise(this.pos,"Entity must start with an ampersand");let be=++this.pos;while(this.pos<this.input.length&&z++<10){if(Q=this.input[this.pos++],Q===";"){if(V[0]==="#"){let Te;if(V[1]==="x"||V[1]==="X"){if(V=V.substr(2),yo.test(V))Te=parseInt(V,16)}else if(V=V.substr(1),go.test(V))Te=parseInt(V,10);if(Te!==void 0&&Te<=1114111)te=String.fromCodePoint(Te)}else if(Object.prototype.hasOwnProperty.call(fs,V))te=fs[V];break}V+=Q}if(te===void 0)return this.pos=be,"&";return te}jsx_readWord(){let V,z=this.pos;do V=this.input.charCodeAt(++this.pos);while(I(V)||V===45);return this.finishToken(w.jsxName,this.input.slice(z,this.pos))}jsx_parseIdentifier(){let V=this.startNode();if(this.type===w.jsxName)V.name=this.value;else if(this.type.keyword)V.name=this.type.keyword;else this.unexpected();return this.next(),this.finishNode(V,"JSXIdentifier")}jsx_parseNamespacedName(){let V=this.start,z=this.startLoc,te=this.jsx_parseIdentifier();if(!M.allowNamespaces||!this.eat(C.colon))return te;var Q=this.startNodeAt(V,z);return Q.namespace=te,Q.name=this.jsx_parseIdentifier(),this.finishNode(Q,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===w.jsxTagEnd)return"";let V=this.start,z=this.startLoc,te=this.jsx_parseNamespacedName();if(this.type===C.dot&&te.type==="JSXNamespacedName"&&!M.allowNamespacedObjects)this.unexpected();while(this.eat(C.dot)){let Q=this.startNodeAt(V,z);Q.object=te,Q.property=this.jsx_parseIdentifier(),te=this.finishNode(Q,"JSXMemberExpression")}return te}jsx_parseAttributeValue(){switch(this.type){case C.braceL:let V=this.jsx_parseExpressionContainer();if(V.expression.type==="JSXEmptyExpression")this.raise(V.start,"JSX attributes must only be assigned a non-empty expression");return V;case w.jsxTagStart:case C.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let V=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(V,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let V=this.startNode();if(this.next(),this.eat(C.ellipsis))return V.expression=this.parseExpression(),this.expect(C.braceR),this.finishNode(V,"JSXSpreadChild");return V.expression=this.type===C.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(C.braceR),this.finishNode(V,"JSXExpressionContainer")}jsx_parseAttribute(){let V=this.startNode();if(this.eat(C.braceL))return this.expect(C.ellipsis),V.argument=this.parseMaybeAssign(),this.expect(C.braceR),this.finishNode(V,"JSXSpreadAttribute");return V.name=this.jsx_parseNamespacedName(),V.value=this.eat(C.eq)?this.jsx_parseAttributeValue():null,this.finishNode(V,"JSXAttribute")}jsx_parseOpeningElementAt(V,z){let te=this.startNodeAt(V,z);te.attributes=[];let Q=this.jsx_parseElementName();if(Q)te.name=Q;while(this.type!==C.slash&&this.type!==w.jsxTagEnd)te.attributes.push(this.jsx_parseAttribute());return te.selfClosing=this.eat(C.slash),this.expect(w.jsxTagEnd),this.finishNode(te,Q?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(V,z){let te=this.startNodeAt(V,z),Q=this.jsx_parseElementName();if(Q)te.name=Q;return this.expect(w.jsxTagEnd),this.finishNode(te,Q?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(V,z){let te=this.startNodeAt(V,z),Q=[],be=this.jsx_parseOpeningElementAt(V,z),Te=null;if(!be.selfClosing){e:for(;;)switch(this.type){case w.jsxTagStart:if(V=this.start,z=this.startLoc,this.next(),this.eat(C.slash)){Te=this.jsx_parseClosingElementAt(V,z);break e}Q.push(this.jsx_parseElementAt(V,z));break;case w.jsxText:Q.push(this.parseExprAtom());break;case C.braceL:Q.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}if(Dt(Te.name)!==Dt(be.name))this.raise(Te.start,"Expected corresponding JSX closing tag for <"+Dt(be.name)+">")}let we=be.name?"Element":"Fragment";if(te["opening"+we]=be,te["closing"+we]=Te,te.children=Q,this.type===C.relational&&this.value==="<")this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag");return this.finishNode(te,"JSX"+we)}jsx_parseText(){let V=this.parseLiteral(this.value);return V.type="JSXText",V}jsx_parseElement(){let V=this.start,z=this.startLoc;return this.next(),this.jsx_parseElementAt(V,z)}}}function bo(t,s,f){let{tokTypes:E}=s,{tokTypes:C}=f;return class extends t{parseMaybeImportAttributes(v){if(this.type===C._with||this.type===E.assert){this.next();let I=this.parseImportAttributes();if(I)v.attributes=I}}parseImportAttributes(){this.expect(C.braceL);let v=this.parseWithEntries();return this.expect(C.braceR),v}parseWithEntries(){let v=[],I=new Set;do{if(this.type===C.braceR)break;let M=this.startNode(),U;if(this.type===C.string)U=this.parseLiteral(this.value);else U=this.parseIdent(!0);if(this.next(),M.key=U,I.has(M.key.name))this.raise(this.pos,"Duplicated key in attributes");if(I.add(M.key.name),this.type!==C.string)this.raise(this.pos,"Only string is supported as an attribute value");M.value=this.parseLiteral(this.value),v.push(this.finishNode(M,"ImportAttribute"))}while(this.eat(C.comma));return v}}}var On=["onToken","onComment","onInsertedSemicolon","onTrailingComma"];function As(){return{_tag:"BufferedParserEvents",segments:[]}}var xo=As();function ms(t){return t.segments.length>0}var So=class{constructor(t,s){this.options=t,this.state=s,this.callbacks={},this.callbackWrappers={},this.frames=[],this.undoLog=[],this.hasCallbacks=this.captureCallbacks()}get active(){return this.frames.length>0}begin(){let t={_tag:"ParseEffectFrame",depth:this.frames.length,undoMark:this.undoLog.length,checkpoint:this.state?.capture()};if(this.frames.push(t),t.depth===0&&this.hasCallbacks)this.activateCallbacks();return t}commit(t){this.close(t);let s=this.currentFrame();if(s){if(t.output)this.appendOutput(this.outputFor(s),t.output);return}if(this.undoLog.length=t.undoMark,t.output)this.flush(t.output)}rollback(t){this.close(t),this.unwind(t.undoMark),this.restore(t)}rollbackWithEvents(t){return this.close(t),this.unwind(t.undoMark),this.restore(t),t.output??xo}replay(t){if(!ms(t))return;let s=this.currentFrame();if(s){this.appendOutput(this.outputFor(s),t);return}this.flush(t)}set(t,s,f){this.willSet(t,s),t[s]=f}remove(t,s){this.willSet(t,s),delete t[s]}append(t,s){this.willAppend(t),t.push(s)}pop(t){return this.willMutateTail(t,1),t.pop()}truncate(t,s){if(s<t.length)this.willMutateTail(t,t.length-s);else this.willAppend(t);t.length=s}modify(t,s,f){let[E,C]=f(t[s]);return this.set(t,s,C),E}willAppend(t){if(!this.active)return;this.undoLog.push({_tag:"ArrayLength",target:t,length:t.length})}willMutateTail(t,s){if(!this.active)return;let f=Math.max(0,t.length-s);this.undoLog.push({_tag:"ArrayTail",target:t,start:f,values:t.slice(f)})}willSet(t,s){if(!this.active)return;let f=t;this.undoLog.push({_tag:"Property",target:f,key:s,had:Object.prototype.hasOwnProperty.call(f,s),value:f[s]})}captureCallbacks(){let t=!1;for(let s of On){let f=this.options[s];if(!f)continue;t=!0,this.callbacks[s]=f,this.callbackWrappers[s]=(...E)=>{this.emit({name:s,args:E})}}return t}activateCallbacks(){for(let t of On){let s=this.callbackWrappers[t];if(s)this.options[t]=s}}deactivateCallbacks(){for(let t of On){let s=this.callbacks[t];if(s)this.options[t]=s}}emit(t){let s=this.currentFrame();if(!s){this.invoke(t);return}let f=this.outputFor(s).segments,E=f[f.length-1];if(Array.isArray(E))E.push(t);else f.push([t])}appendOutput(t,s){if(ms(s))t.segments.push(s)}outputFor(t){return t.output??=As()}flush(t){let s=[];for(let f=t.segments.length-1;f>=0;f--)s.push(t.segments[f]);while(s.length>0){let f=s.pop();if(Array.isArray(f)){for(let E of f)this.invoke(E);continue}for(let E=f.segments.length-1;E>=0;E--)s.push(f.segments[E])}}invoke(t){this.callbacks[t.name]?.apply(this.options,t.args)}currentFrame(){return this.frames[this.frames.length-1]}close(t){if(this.currentFrame()!==t||t.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(t){if(this.state)this.state.restore(t.checkpoint)}unwind(t){for(let s=this.undoLog.length-1;s>=t;s--){let f=this.undoLog[s];switch(f._tag){case"ArrayLength":if(f.target.length<f.length)throw Error("A parse effect shortened an append-only array");f.target.length=f.length;break;case"ArrayTail":f.target.length=f.start;for(let E of f.values)f.target.push(E);break;case"Property":if(f.had)f.target[f.key]=f.value;else delete f.target[f.key];break}}this.undoLog.length=t}};function ht(t,s,f){if(t.length===s)return t;if(t.length<s)throw Error(`A parse branch shortened the ${f} below its checkpoint`);return t.length=s,t}function Eo(t){return{lookahead:t.getCurLookaheadState(),context:t.context,contextLength:t.context.length,scopeStack:t.scopeStack,scopeStackLength:t.scopeStack.length,importsStack:t.importsStack,importsStackLength:t.importsStack.length,labels:t.labels,labelsLength:t.labels.length,privateNameStack:t.privateNameStack,privateNameStackLength:t.privateNameStack.length,decoratorStack:t.decoratorStack,decoratorStackLength:t.decoratorStack.length,strict:t.strict,potentialArrowAt:t.potentialArrowAt,potentialArrowInForAwait:t.potentialArrowInForAwait,yieldPos:t.yieldPos,awaitPos:t.awaitPos,awaitIdentPos:t.awaitIdentPos,preValue:t.preValue,preToken:t.preToken,isLookahead:t.isLookahead,isAmbientContext:t.isAmbientContext,inAbstractClass:t.inAbstractClass,inType:t.inType,inDisallowConditionalTypesContext:t.inDisallowConditionalTypesContext,maybeInArrowParameters:t.maybeInArrowParameters,shouldParseArrowReturnType:t.shouldParseArrowReturnType,shouldParseAsyncArrowReturnType:t.shouldParseAsyncArrowReturnType,importOrExportOuterKind:t.importOrExportOuterKind}}function Po(t,s){t.setLookaheadTokenState(s.lookahead),t.context=ht(s.context,s.contextLength,"token context stack"),t.scopeStack=ht(s.scopeStack,s.scopeStackLength,"scope stack"),t.importsStack=ht(s.importsStack,s.importsStackLength,"import stack"),t.labels=ht(s.labels,s.labelsLength,"label stack"),t.privateNameStack=ht(s.privateNameStack,s.privateNameStackLength,"private-name stack"),t.decoratorStack=ht(s.decoratorStack,s.decoratorStackLength,"decorator stack"),t.strict=s.strict,t.potentialArrowAt=s.potentialArrowAt,t.potentialArrowInForAwait=s.potentialArrowInForAwait,t.yieldPos=s.yieldPos,t.awaitPos=s.awaitPos,t.awaitIdentPos=s.awaitIdentPos,t.regexpState=null,t.preValue=s.preValue,t.preToken=s.preToken,t.isLookahead=s.isLookahead,t.isAmbientContext=s.isAmbientContext,t.inAbstractClass=s.inAbstractClass,t.inType=s.inType,t.inDisallowConditionalTypesContext=s.inDisallowConditionalTypesContext,t.maybeInArrowParameters=s.maybeInArrowParameters,t.shouldParseArrowReturnType=s.shouldParseArrowReturnType,t.shouldParseAsyncArrowReturnType=s.shouldParseAsyncArrowReturnType,t.importOrExportOuterKind=s.importOrExportOuterKind}function Ao(t){return{capture:()=>Eo(t),restore:(s)=>Po(t,s)}}function Co(t,s){let{acornTokenTypes:f,typeScriptTokenTypes:E,scope:C}=s,w=C.SCOPE_TOP|C.SCOPE_FUNCTION|C.SCOPE_CLASS_STATIC_BLOCK;return class extends t{constructor(I,M,U){super(I,M,U);this.parseEffects=new So(this.options,Ao(this))}overrideContext(I){if(this.curContext()!==I)this.parseEffects?.willMutateTail(this.context,1);return super.overrideContext(I)}takeDecorators(I){let M=this.decoratorStack.length-1;if(this.decoratorStack[M].length>0)this.parseEffects?.willSet(this.decoratorStack,String(M));return super.takeDecorators(I)}parseDecorators(I){let M=this.decoratorStack[this.decoratorStack.length-1];return this.parseEffects?.willAppend(M),super.parseDecorators(I)}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(I,M,U,V){for(let z=this.labels.length-1;z>=0;z--){let te=this.labels[z];if(te.statementStart!==I.start)break;this.parseEffects?.willSet(te,"statementStart"),this.parseEffects?.willSet(te,"kind")}return this.parseEffects?.willAppend(this.labels),super.parseLabeledStatement(I,M,U,V)}enterClassBody(){return this.parseEffects?.willAppend(this.privateNameStack),super.enterClassBody()}exitClassBody(){let I=this.privateNameStack[this.privateNameStack.length-2];if(I)this.parseEffects?.willAppend(I.used);return this.parseEffects?.willMutateTail(this.privateNameStack,1),super.exitClassBody()}parsePrivateIdent(){if(this.options.checkPrivateFields&&this.privateNameStack.length>0){let I=this.privateNameStack[this.privateNameStack.length-1];this.parseEffects?.willAppend(I.used)}return super.parsePrivateIdent()}parseClassField(I){return this.parseEffects?.willSet(this.currentThisScope(),"inClassFieldInit"),super.parseClassField(I)}updateContext(I){let{type:M}=this;if(M===f.parenR||M===f.braceR||M===f.braceL||M===f.dollarBraceL||M===f.parenL||M===f._function||M===f._class||M===f.colon||M===f.backQuote||M===f.star||M===E.jsxTagStart||M===E.jsxTagEnd||M===f.slash&&I===E.jsxTagStart)this.parseEffects?.willMutateTail(this.context,2);return super.updateContext(I)}enterScope(I){return this.parseEffects?.willAppend(this.scopeStack),super.enterScope(I)}exitScope(){return this.parseEffects?.willMutateTail(this.scopeStack,1),super.exitScope()}declareName(I,M,U){let V=this.parseEffects;if(V?.active)if(M===C.BIND_LEXICAL){let z=this.currentScope();if(V.willAppend(z.lexical),this.inModule&&z.flags&C.SCOPE_TOP)V.willSet(this.undefinedExports,I)}else if(M===C.BIND_SIMPLE_CATCH)V.willAppend(this.currentScope().lexical);else if(M===C.BIND_FUNCTION)V.willAppend(this.currentScope().functions);else for(let z=this.scopeStack.length-1;z>=0;z--){let te=this.scopeStack[z];if(V.willAppend(te.var),this.inModule&&te.flags&C.SCOPE_TOP)V.willSet(this.undefinedExports,I);if(te.flags&w)break}return super.declareName(I,M,U)}checkLocalExport(I){return this.parseEffects?.willSet(this.undefinedExports,I.name),super.checkLocalExport(I)}}}var Bn=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;function hs(t){if(!t)throw Error("Assert fail")}function vo(t){return t==="accessor"}function ko(t){return t==="in"||t==="out"}var Xt=1,ys=2,wo=4,Ce={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 Fn(t,s){return Ce.SCOPE_FUNCTION|(t?Ce.SCOPE_ASYNC:0)|(s?Ce.SCOPE_GENERATOR:0)}function No(t){if(t.type!=="MemberExpression")return!1;let{computed:s,property:f}=t;if(s&&(f.type!=="TemplateLiteral"||f.expressions.length>0))return!1;return Cs(t.object)}function Do(t){return t.type==="UnaryExpression"&&(t.operator==="-"||t.operator==="+")&&t.argument.type==="Literal"&&(typeof t.argument.value==="number"||typeof t.argument.value==="bigint")}function Cs(t){if(t.type==="Identifier")return!0;if(t.type!=="MemberExpression")return!1;if(t.computed)return!1;return Cs(t.object)}function gs(t){return t==="private"||t==="public"||t==="protected"}function Lo(t){return Boolean(t.startsExpr)}function Io(t){if(t==null)throw Error(`Unexpected ${t} value.`);return t}function Mo(t){switch(t){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 vs(t){let{dts:s=!1}=t||{},f=!!t?.jsx;return function(E){let C=E.acorn||ue,w=io(C),{tokTypes:v,keywordTypes:I,isIdentifierStart:M,lineBreak:U,isNewLine:V,tokContexts:z,isIdentifierChar:te}=C,{tokTypes:Q,tokContexts:be,keywordsRegExp:Te,tokenIsLiteralPropertyName:we,tokenIsTemplate:Re,tokenIsTSDeclarationStart:Be,tokenIsIdentifier:Se,tokenIsKeywordOrIdentifier:Me,tokenIsTSTypeOperator:xe}=w;function Ie(P,L,R=P.length){for(let O=L;O<R;O++){let X=P.charCodeAt(O);if(V(X))return O<R-1&&X===13&&P.charCodeAt(O+1)===10?O+2:O+1}return-1}if(E=ho(E,w,C),t?.jsx)E=To(C,w,E,typeof t.jsx==="boolean"?{}:t.jsx);E=bo(E,w,C);let mn=Co(E,{acornTokenTypes:v,typeScriptTokenTypes:Q,scope:Ce});class Bt extends mn{constructor(P,L,R){super(P,L,R);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=(O)=>{this.tsParseModifiers({modified:O,allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:ge.InvalidModifierOnTypeParameterPositions})},this.ecmaVersion=this.options.ecmaVersion}static get acornTypeScript(){return w}get acornTypeScript(){return w}getTokenFromCodeInType(P){if(P===62)return this.finishOp(v.relational,1);if(P===60)return this.finishOp(v.relational,1);return super.getTokenFromCode(P)}readToken(P){if(!this.inType){let L=this.curContext();if(L===be.tc_expr)return this.jsx_readToken();if(L===be.tc_oTag||L===be.tc_cTag){if(M(P))return this.jsx_readWord();if(P==62)return++this.pos,this.finishToken(Q.jsxTagEnd);if((P===34||P===39)&&L==be.tc_oTag)return this.jsx_readString(P)}if(P===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33)if(++this.pos,t?.jsx)return this.finishToken(Q.jsxTagStart);else return this.finishToken(v.relational,"<")}return super.readToken(P)}getTokenFromCode(P){if(this.inType)return this.getTokenFromCodeInType(P);if(P===64)return++this.pos,this.finishToken(Q.at);return super.getTokenFromCode(P)}isAbstractClass(){return this.ts_isContextual(Q.abstract)&&this.lookahead().type===v._class}isDeclareClass(){if(!this.ts_isContextual(Q.declare))return!1;let P=this.nextTokenStart();if(this.isUnparsedContextual(P,"class"))return!0;if(!this.isUnparsedContextual(P,"abstract"))return!1;let L=this.nextTokenStartSince(P+8);return this.isUnparsedContextual(L,"class")}finishNode(P,L){if(P.type!==""&&P.end!==0)return P;return super.finishNode(P,L)}tryParse(P){let L={},R=this.beginParseEffectScope(),O;try{O=P(()=>{throw L})}catch(X){let ee=X===L;if(!ee&&!(X instanceof SyntaxError))throw this.parseEffects.rollback(R),X;let ne={events:this.parseEffects.rollbackWithEvents(R),selected:!1};return ee?{node:null,error:null,thrown:!1,aborted:!0,failState:ne}:{node:null,error:X,thrown:!0,aborted:!1,failState:ne}}return this.parseEffects.commit(R),{node:O,error:null,thrown:!1,aborted:!1,failState:null}}setOptionalParametersError(P,L){P.optionalParametersLoc=L?.loc??this.startLoc}reScan_lt_gt(){if(this.type===v.relational)this.pos-=1,this.readToken_lt_gt(this.fullCharCodeAtPos())}reScan_lt(){let{type:P}=this;if(P===v.bitShift)return this.pos-=2,this.finishOp(v.relational,1),v.relational;return P}resetEndLocation(P,L=this.lastTokEnd,R=this.lastTokEndLoc){if(P.end=L,P.loc.end=R,this.options.ranges)P.range[1]=L}startNodeAtNode(P){return super.startNodeAt(P.start,P.loc.start)}nextTokenStart(){return this.nextTokenStartSince(this.pos)}tsHasSomeModifiers(P,L){return L.some((R)=>{if(gs(R))return P.accessibility===R;return!!P[R]})}tsIsStartOfStaticBlocks(){return this.isContextual("static")&&this.lookaheadCharCode()===123}tsCheckForInvalidTypeCasts(P){P.forEach((L)=>{if(L?.type==="TSTypeCastExpression")this.raise(L.typeAnnotation.start,ge.UnexpectedTypeAnnotation)})}atPossibleAsyncArrow(P){return P.type==="Identifier"&&P.name==="async"&&this.lastTokEnd===P.end&&!this.canInsertSemicolon()&&P.end-P.start===5&&P.start===this.potentialArrowAt}tsIsIdentifier(){return Se(this.type)}tsTryParseTypeOrTypePredicateAnnotation(){return this.match(v.colon)?this.tsParseTypeOrTypePredicateAnnotation(v.colon):void 0}tsTryParseGenericAsyncArrowFunction(P,L,R){if(!this.tsMatchLeftRelational())return;let O=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let X=this.tsTryParseAndCatch(()=>{let ee=this.startNodeAt(P,L);return ee.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(ee),ee.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(v.arrow),ee});if(this.maybeInArrowParameters=O,!X)return;return this.parseArrowExpression(X,X.params,!0,R)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()!==v.relational)return;return this.tsParseTypeArguments(!0)}tsInNoContext(P){let L=this.context;this.context=[L[0]];try{return P()}finally{this.context=L}}tsTryParseTypeAnnotation(){return this.match(v.colon)?this.tsParseTypeAnnotation():void 0}isUnparsedContextual(P,L){let R=P+L.length;if(this.input.slice(P,R)===L){let O=this.input.charCodeAt(R);return!(te(O)||(O&64512)===55296)}return!1}isAbstractConstructorSignature(){return this.ts_isContextual(Q.abstract)&&this.lookahead().type===v._new}nextTokenStartSince(P){return Bn.lastIndex=P,Bn.test(this.input)?Bn.lastIndex:P}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(P){this.pos=P.pos,this.value=P.value,this.exprAllowed=P.exprAllowed,this.endLoc=P.endLoc,this.lastTokEnd=P.lastTokEnd,this.lastTokStart=P.lastTokStart,this.lastTokStartLoc=P.lastTokStartLoc,this.type=P.type,this.start=P.start,this.end=P.end,this.startLoc=P.startLoc,this.lastTokEndLoc=P.lastTokEndLoc,this.curLine=P.curLine,this.lineStart=P.lineStart,this.containsEsc=P.containsEsc}setLookaheadState(P){this.setLookaheadTokenState(P),this.context=P.context&&P.context.slice()}beginParseEffectScope(){return this.parseEffects.begin()}selectTryParseResult(P){let L=P.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(P){let L=this.beginParseEffectScope();try{return P()}finally{this.parseEffects.rollback(L)}}lookahead(P){let L=this.getCurLookaheadState(),R=this.context,O=this.preValue,X=this.preToken,ee=this.isLookahead;try{if(this.createLookaheadState(),this.isLookahead=!0,P!==void 0)for(let ne=0;ne<P;ne++)this.nextToken();else this.nextToken();return this.getCurLookaheadState()}finally{this.setLookaheadTokenState(L),this.context=R,this.preValue=O,this.preToken=X,this.isLookahead=ee}}readWord(){let P=this.readWord1(),L=v.name;if(this.keywords.test(P))L=I[P];else if(new RegExp(Te).test(P))L=Q[P];return this.finishToken(L,P)}skipBlockComment(){let P;if(!this.isLookahead)P=this.options.onComment&&this.curPosition();let L=this.pos,R=this.input.indexOf("*/",this.pos+=2);if(R===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=R+2,this.options.locations)for(let O,X=L;(O=Ie(this.input,X,this.pos))>-1;)++this.curLine,X=this.lineStart=O;if(this.isLookahead)return;if(this.options.onComment)this.options.onComment(!0,this.input.slice(L+2,R),L,this.pos,P,this.curPosition())}skipLineComment(P){let L=this.pos,R;if(!this.isLookahead)R=this.options.onComment&&this.curPosition();let O=this.input.charCodeAt(this.pos+=P);while(this.pos<this.input.length&&!V(O))O=this.input.charCodeAt(++this.pos);if(this.isLookahead)return;if(this.options.onComment)this.options.onComment(!1,this.input.slice(L+P,this.pos),L,this.pos,R,this.curPosition())}finishToken(P,L){if(this.preValue=this.value,this.preToken=this.type,this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();let R=this.type;if(this.type=P,this.value=L,!this.isLookahead)this.updateContext(R)}resetStartLocation(P,L,R){if(P.start=L,P.loc.start=R,this.options.ranges)P.range[0]=L}isLineTerminator(){return this.eat(v.semi)||super.canInsertSemicolon()}hasFollowingLineBreak(){return us.lastIndex=this.end,us.test(this.input)}addExtra(P,L,R,O=!0){if(!P)return;let X=P.extra=P.extra||{};if(O)X[L]=R;else Object.defineProperty(X,L,{enumerable:O,value:R})}isLiteralPropertyName(){return we(this.type)}hasPrecedingLineBreak(){return U.test(this.input.slice(this.lastTokEnd,this.start))}createIdentifier(P,L){return P.name=L,this.finishNode(P,"Identifier")}resetStartLocationFromNode(P,L){this.resetStartLocation(P,L.start,L.loc.start)}isThisParam(P){return P.type==="Identifier"&&P.name==="this"}isLookaheadContextual(P){let L=this.nextTokenStart();return this.isUnparsedContextual(L,P)}ts_type_isContextual(P,L){return P===L&&!this.containsEsc}ts_isContextual(P){return this.type===P&&!this.containsEsc}ts_isContextualWithState(P,L){return P.type===L&&!P.containsEsc}isContextualWithState(P,L){return L.type===v.name&&L.value===P&&!L.containsEsc}tsIsStartOfMappedType(){if(this.next(),this.eat(v.plusMin))return this.ts_isContextual(Q.readonly);if(this.ts_isContextual(Q.readonly))this.next();if(!this.match(v.bracketL))return!1;if(this.next(),!this.tsIsIdentifier())return!1;return this.next(),this.match(v._in)}tsInDisallowConditionalTypesContext(P){let L=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!0;try{return P()}finally{this.inDisallowConditionalTypesContext=L}}tsTryParseType(){return this.tsEatThenParseType(v.colon)}match(P){return this.type===P}matchJsx(P){return this.type===w.tokTypes[P]}ts_eatWithState(P,L,R){let O=R.type;if(P===O){for(let X=0;X<L;X++)this.next();return!0}else return!1}ts_eatContextualWithState(P,L,R){if(Te.test(P)){if(this.ts_isContextualWithState(R,Q[P])){for(let O=0;O<L;O++)this.next();return!0}return!1}else{if(!this.isContextualWithState(P,R))return!1;for(let O=0;O<L;O++)this.next();return!0}}canHaveLeadingDecorator(){return this.match(v._class)||this.isAbstractClass()||this.isDeclareClass()}eatContextual(P){if(Te.test(P)){if(this.ts_isContextual(Q[P]))return this.next(),!0;return!1}else return super.eatContextual(P)}tsIsExternalModuleReference(){return this.isContextual("require")&&this.lookaheadCharCode()===40}tsParseExternalModuleReference(){let P=this.startNode();if(this.expectContextual("require"),this.expect(v.parenL),!this.match(v.string))this.unexpected();return P.expression=this.parseExprAtom(),this.expect(v.parenR),this.finishNode(P,"TSExternalModuleReference")}tsParseEntityName(P=!0){let L=this.parseIdent(P);while(this.eat(v.dot)){let R=this.startNodeAtNode(L);R.left=L,R.right=this.parseIdent(P),L=this.finishNode(R,"TSQualifiedName")}return L}tsParseEnumMember(){let P=this.startNode();if(P.id=this.match(v.string)?this.parseLiteral(this.value):this.parseIdent(!0),this.eat(v.eq))P.initializer=this.parseMaybeAssign();return this.finishNode(P,"TSEnumMember")}tsParseEnumDeclaration(P,L={}){if(L.const)P.const=!0;if(L.declare)P.declare=!0;this.expectContextual("enum"),P.id=this.parseIdent();let R=L.const?Ce.BIND_TS_CONST_ENUM:Ce.BIND_TS_ENUM;return this.checkLValSimple(P.id,R),this.expect(v.braceL),P.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(v.braceR),this.finishNode(P,"TSEnumDeclaration")}tsParseModuleBlock(){let P=this.startNode();this.enterScope(ao),this.expect(v.braceL),P.body=[];while(this.type!==v.braceR){let L=this.parseStatement(null,!0);P.body.push(L)}return this.next(),super.exitScope(),this.finishNode(P,"TSModuleBlock")}tsParseAmbientExternalModuleDeclaration(P){if(this.ts_isContextual(Q.global))P.global=!0,P.id=this.parseIdent();else if(this.match(v.string))P.id=this.parseLiteral(this.value);else this.unexpected();if(this.match(v.braceL))this.enterScope(wt),P.body=this.tsParseModuleBlock(),super.exitScope();else super.semicolon();return this.finishNode(P,"TSModuleDeclaration")}tsTryParseDeclare(P){if(this.isLineTerminator())return;let L=this.type,R;if(this.isContextual("let"))L=v._var,R="let";return this.tsInAmbientContext(()=>{if(L===v._function)return P.declare=!0,this.parseFunctionStatement(P,!1,!0);if(L===v._class)return P.declare=!0,this.parseClass(P,!0);if(L===Q.enum)return this.tsParseEnumDeclaration(P,{declare:!0});if(L===Q.global)return this.tsParseAmbientExternalModuleDeclaration(P);if(L===v._const||L===v._var){if(!this.match(v._const)||!this.isLookaheadContextual("enum"))return P.declare=!0,this.parseVarStatement(P,R||this.value,!0);return this.expect(v._const),this.tsParseEnumDeclaration(P,{const:!0,declare:!0})}if(L===Q.interface){let O=this.tsParseInterfaceDeclaration(P,{declare:!0});if(O)return O}if(Se(L))return this.tsParseDeclaration(P,this.value,!0)})}tsIsListTerminator(P){switch(P){case"EnumMembers":case"TypeMembers":return this.match(v.braceR);case"HeritageClauseElement":return this.match(v.braceL);case"TupleElementTypes":return this.match(v.bracketR);case"TypeParametersOrArguments":return this.tsMatchRightRelational()}}tsParseDelimitedListWorker(P,L,R,O){let X=[],ee=-1;for(;;){if(this.tsIsListTerminator(P))break;ee=-1;let ne=L();if(ne==null)return;if(X.push(ne),this.eat(v.comma)){ee=this.lastTokStart;continue}if(this.tsIsListTerminator(P))break;if(R)this.expect(v.comma);return}if(O)O.value=ee;return X}tsParseDelimitedList(P,L,R){return Io(this.tsParseDelimitedListWorker(P,L,!0,R))}tsParseBracketedList(P,L,R,O,X){if(!O)if(R)this.expect(v.bracketL);else this.expect(v.relational);let ee=this.tsParseDelimitedList(P,L,X);if(R)this.expect(v.bracketR);else this.expect(v.relational);return ee}tsParseTypeParameterName(){return this.parseIdent().name}tsEatThenParseType(P){return!this.match(P)?void 0:this.tsNextThenParseType()}tsExpectThenParseType(P){return this.tsDoThenParseType(()=>this.expect(P))}tsNextThenParseType(){return this.tsDoThenParseType(()=>this.next())}tsDoThenParseType(P){return this.tsInType(()=>(P(),this.tsParseType()))}tsSkipParameterStart(){if(Se(this.type)||this.match(v._this))return this.next(),!0;if(this.match(v.braceL))try{return this.parseObj(!0),!0}catch{return!1}if(this.match(v.bracketL)){this.next();try{return this.parseBindingList(v.bracketR,!0,!0),!0}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){if(this.next(),this.match(v.parenR)||this.match(v.ellipsis))return!0;if(this.tsSkipParameterStart()){if(this.match(v.colon)||this.match(v.comma)||this.match(v.question)||this.match(v.eq))return!0;if(this.match(v.parenR)){if(this.next(),this.match(v.arrow))return!0}}return!1}tsIsStartOfFunctionType(){if(this.tsMatchLeftRelational())return!0;return this.match(v.parenL)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsInAllowConditionalTypesContext(P){let L=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!1;try{return P()}finally{this.inDisallowConditionalTypesContext=L}}tsParseBindingListForSignature(){return super.parseBindingList(v.parenR,!0,!0).map((P)=>{if(P.type!=="Identifier"&&P.type!=="RestElement"&&P.type!=="ObjectPattern"&&P.type!=="ArrayPattern")this.raise(P.start,ge.UnsupportedSignatureParameterKind({type:P.type}));return P})}tsParseTypePredicateAsserts(){if(this.type!==Q.asserts)return!1;let P=this.containsEsc;if(this.next(),!Se(this.type)&&!this.match(v._this))return!1;if(P)this.raise(this.lastTokStart,"Escape sequence in keyword asserts");return!0}tsParseThisTypeNode(){let P=this.startNode();return this.next(),this.finishNode(P,"TSThisType")}tsParseTypeAnnotation(P=!0,L=this.startNode()){return this.tsInType(()=>{if(P)this.expect(v.colon);L.typeAnnotation=this.tsParseType()}),this.finishNode(L,"TSTypeAnnotation")}tsParseThisTypePredicate(P){this.next();let L=this.startNodeAtNode(P);return L.parameterName=P,L.typeAnnotation=this.tsParseTypeAnnotation(!1),L.asserts=!1,this.finishNode(L,"TSTypePredicate")}tsParseThisTypeOrThisTypePredicate(){let P=this.tsParseThisTypeNode();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.tsParseThisTypePredicate(P);else return P}tsParseTypePredicatePrefix(){let P=this.parseIdent();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.next(),P}tsParseTypeOrTypePredicateAnnotation(P){return this.tsInType(()=>{let L=this.startNode();this.expect(P);let R=this.startNode(),O=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(O){let fe=this.tsParseTypeAnnotation(!1);return R.parameterName=O,R.typeAnnotation=fe,R.asserts=!1,L.typeAnnotation=this.finishNode(R,"TSTypePredicate"),this.finishNode(L,"TSTypeAnnotation")}let X=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(X&&this.match(v._this)){let fe=this.tsParseThisTypeOrThisTypePredicate();if(fe.type==="TSThisType")R.parameterName=fe,R.asserts=!0,R.typeAnnotation=null,fe=this.finishNode(R,"TSTypePredicate");else this.resetStartLocationFromNode(fe,R),fe.asserts=!0;return L.typeAnnotation=fe,this.finishNode(L,"TSTypeAnnotation")}let ee=X&&this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!ee){if(!X)return this.tsParseTypeAnnotation(!1,L);return R.parameterName=this.parseIdent(),R.asserts=X,R.typeAnnotation=null,L.typeAnnotation=this.finishNode(R,"TSTypePredicate"),this.finishNode(L,"TSTypeAnnotation")}let ne=this.tsParseTypeAnnotation(!1);return R.parameterName=ee,R.typeAnnotation=ne,R.asserts=X,L.typeAnnotation=this.finishNode(R,"TSTypePredicate"),this.finishNode(L,"TSTypeAnnotation")})}tsFillSignature(P,L){let R=P===v.arrow,O="parameters",X="typeAnnotation";if(L.typeParameters=this.tsTryParseTypeParameters(),this.expect(v.parenL),L.parameters=this.tsParseBindingListForSignature(),R)L.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(P);else if(this.match(P))L.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(P)}tsTryNextParseConstantContext(){if(this.lookahead().type!==v._const)return null;this.next();let P=this.tsParseTypeReference();if(P.typeParameters||P.typeArguments)this.raise(P.typeName.start,ge.CannotFindName({name:"const"}));return P}tsParseFunctionOrConstructorType(P,L){let R=this.startNode();if(P==="TSConstructorType"){if(R.abstract=!!L,L)this.next();this.next()}return this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(v.arrow,R)),this.finishNode(R,P)}tsParseUnionOrIntersectionType(P,L,R){let O=this.startNode(),X=this.eat(R),ee=[];do ee.push(L());while(this.eat(R));if(ee.length===1&&!X)return ee[0];return O.types=ee,this.finishNode(O,P)}tsCheckTypeAnnotationForReadOnly(P){switch(P.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(P.start,ge.UnexpectedReadonly)}}tsParseTypeOperator(){let P=this.startNode(),L=this.value;if(this.next(),P.operator=L,P.typeAnnotation=this.tsParseTypeOperatorOrHigher(),L==="readonly")this.tsCheckTypeAnnotationForReadOnly(P);return this.finishNode(P,"TSTypeOperator")}tsParseConstraintForInferType(){if(this.eat(v._extends)){let P=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.inDisallowConditionalTypesContext||!this.match(v.question))return P}}tsParseInferType(){let P=this.startNode();this.expectContextual("infer");let L=this.startNode();return L.name=this.tsParseTypeParameterName(),L.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),P.typeParameter=this.finishNode(L,"TSTypeParameter"),this.finishNode(P,"TSInferType")}tsParseLiteralTypeNode(){let P=this.startNode();return P.literal=(()=>{switch(this.type){case v.num:case v.string:case v._true:case v._false:return this.parseExprAtom();default:this.unexpected()}})(),this.finishNode(P,"TSLiteralType")}tsParseImportType(){let P=this.startNode();if(this.expect(v._import),this.expect(v.parenL),!this.match(v.string))this.raise(this.start,ge.UnsupportedImportTypeArgument);if(P.argument=this.parseExprAtom(),this.expect(v.parenR),this.eat(v.dot))P.qualifier=this.tsParseEntityName();if(this.tsMatchLeftRelational())P.typeArguments=this.tsParseTypeArguments();return this.finishNode(P,"TSImportType")}tsParseTypeQuery(){let P=this.startNode();if(this.expect(v._typeof),this.match(v._import))P.exprName=this.tsParseImportType();else P.exprName=this.tsParseEntityName();if(!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational())P.typeArguments=this.tsParseTypeArguments();return this.finishNode(P,"TSTypeQuery")}tsParseMappedTypeParameter(){let P=this.startNode();return P.name=this.tsParseTypeParameterName(),P.constraint=this.tsExpectThenParseType(v._in),this.finishNode(P,"TSTypeParameter")}tsParseMappedType(){let P=this.startNode();if(this.expect(v.braceL),this.match(v.plusMin))P.readonly=this.value,this.next(),this.expectContextual("readonly");else if(this.eatContextual("readonly"))P.readonly=!0;if(this.expect(v.bracketL),P.typeParameter=this.tsParseMappedTypeParameter(),P.nameType=this.eatContextual("as")?this.tsParseType():null,this.expect(v.bracketR),this.match(v.plusMin))P.optional=this.value,this.next(),this.expect(v.question);else if(this.eat(v.question))P.optional=!0;return P.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(v.braceR),this.finishNode(P,"TSMappedType")}tsParseTypeLiteral(){let P=this.startNode();return P.members=this.tsParseObjectTypeMembers(),this.finishNode(P,"TSTypeLiteral")}tsIsTupleElementLabel(){if(!Me(this.type))return!1;let P=this.lookahead();if(P.type===v.colon)return!0;if(P.type!==v.question)return!1;return this.lookahead(2).type===v.colon}tsParseTupleElementType(){let P=this.startLoc,L=this.start,R=this.eat(v.ellipsis),O;if(this.tsIsTupleElementLabel()){let X=this.startNode();X.label=this.parseIdent(!0),X.optional=this.eat(v.question),this.expect(v.colon),X.elementType=this.tsParseType(),O=this.finishNode(X,"TSNamedTupleMember")}else{O=this.tsParseType();let X=this.eat(v.question);if(this.eat(v.colon))this.raise(O.start,ge.InvalidTupleMemberLabel);if(X){let ee=this.startNodeAtNode(O);ee.typeAnnotation=O,O=this.finishNode(ee,"TSOptionalType")}}if(R){let X=this.startNodeAt(L,P);X.typeAnnotation=O,O=this.finishNode(X,"TSRestType")}return O}tsParseTupleType(){let P=this.startNode();P.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let L=!1;return P.elementTypes.forEach((R)=>{let{type:O}=R;if(L&&O!=="TSRestType"&&O!=="TSOptionalType"&&!(O==="TSNamedTupleMember"&&R.optional))this.raise(R.start,ge.OptionalTypeBeforeRequired);if(L||=O==="TSNamedTupleMember"&&R.optional||O==="TSOptionalType",O==="TSRestType")R=R.typeAnnotation}),this.finishNode(P,"TSTupleType")}tsParseTemplateLiteralType(){let P=this.startNode();return P.literal=this.parseTemplate({isTagged:!1}),this.finishNode(P,"TSLiteralType")}tsParseTypeReference(){let P=this.startNode();if(P.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational())P.typeArguments=this.tsParseTypeArguments();return this.finishNode(P,"TSTypeReference")}tsMatchLeftRelational(){return this.match(v.relational)&&this.value==="<"}tsMatchRightRelational(){return this.match(v.relational)&&this.value===">"}tsParseParenthesizedType(){let P=this.startNode();return this.expect(v.parenL),P.typeAnnotation=this.tsParseType(),this.expect(v.parenR),this.finishNode(P,"TSParenthesizedType")}tsParseNonArrayType(){switch(this.type){case v.string:case v.num:case v._true:case v._false:return this.tsParseLiteralTypeNode();case v.plusMin:if(this.value==="-"){let P=this.startNode();if(this.lookahead().type!==v.num)this.unexpected();return P.literal=this.parseMaybeUnary(),this.finishNode(P,"TSLiteralType")}break;case v._this:return this.tsParseThisTypeOrThisTypePredicate();case v._typeof:return this.tsParseTypeQuery();case v._import:return this.tsParseImportType();case v.braceL:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case v.bracketL:return this.tsParseTupleType();case v.parenL:return this.tsParseParenthesizedType();case v.backQuote:case v.dollarBraceL:return this.tsParseTemplateLiteralType();default:{let{type:P}=this;if(Me(P)||P===v._void||P===v._null){let L=P===v._void?"TSVoidKeyword":P===v._null?"TSNullKeyword":Mo(this.value);if(L!==void 0&&this.lookaheadCharCode()!==46){let R=this.startNode();return this.next(),this.finishNode(R,L)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let P=this.tsParseNonArrayType();while(!this.hasPrecedingLineBreak()&&this.eat(v.bracketL))if(this.match(v.bracketR)){let L=this.startNodeAtNode(P);L.elementType=P,this.expect(v.bracketR),P=this.finishNode(L,"TSArrayType")}else{let L=this.startNodeAtNode(P);L.objectType=P,L.indexType=this.tsParseType(),this.expect(v.bracketR),P=this.finishNode(L,"TSIndexedAccessType")}return P}tsParseTypeOperatorOrHigher(){return xe(this.type)&&!this.containsEsc?this.tsParseTypeOperator():this.isContextual("infer")?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),v.bitwiseAND)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),v.bitwiseOR)}tsParseNonConditionalType(){if(this.tsIsStartOfFunctionType())return this.tsParseFunctionOrConstructorType("TSFunctionType");if(this.match(v._new))return this.tsParseFunctionOrConstructorType("TSConstructorType");else if(this.isAbstractConstructorSignature())return this.tsParseFunctionOrConstructorType("TSConstructorType",!0);return this.tsParseUnionTypeOrHigher()}tsParseType(){hs(this.inType);let P=this.tsParseNonConditionalType();if(this.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(v._extends))return P;let L=this.startNodeAtNode(P);return L.checkType=P,L.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(v.question),L.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(v.colon),L.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(L,"TSConditionalType")}tsIsUnambiguouslyIndexSignature(){if(this.next(),Se(this.type))return this.next(),this.match(v.colon);return!1}tsInType(P){let L=this.inType;this.inType=!0;try{return P()}finally{this.inType=L}}tsTryParseIndexSignature(P){if(!(this.match(v.bracketL)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(v.bracketL);let L=this.parseIdent();L.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(L),this.expect(v.bracketR),P.parameters=[L];let R=this.tsTryParseTypeAnnotation();if(R)P.typeAnnotation=R;return this.tsParseTypeMemberSemicolon(),this.finishNode(P,"TSIndexSignature")}tsParseNoneModifiers(P){this.tsParseModifiers({modified:P,allowedModifiers:[],disallowedModifiers:["in","out"],errorTemplate:ge.InvalidModifierOnTypeParameterPositions})}tsParseTypeParameter(P=this.tsParseNoneModifiers.bind(this)){let L=this.startNode();return P(L),L.name=this.tsParseTypeParameterName(),L.constraint=this.tsEatThenParseType(v._extends),L.default=this.tsEatThenParseType(v.eq),this.finishNode(L,"TSTypeParameter")}tsParseTypeParameters(P){let L=this.startNode();if(this.tsMatchLeftRelational()||this.matchJsx("jsxTagStart"))this.next();else this.unexpected();let R={value:-1};if(L.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,P),!1,!0,R),L.params.length===0)this.raise(this.start,ge.EmptyTypeParameters);if(R.value!==-1)this.addExtra(L,"trailingComma",R.value);return this.finishNode(L,"TSTypeParameterDeclaration")}tsTryParseTypeParameters(P){if(this.tsMatchLeftRelational())return this.tsParseTypeParameters(P)}tsTryParse(P){let L=this.beginParseEffectScope(),R;try{R=P()}catch(O){throw this.parseEffects.rollback(L),O}if(R!==void 0&&R!==!1)return this.parseEffects.commit(L),R;this.parseEffects.rollback(L);return}tsTokenCanFollowModifier(){return(this.match(v.bracketL)||this.match(v.braceL)||this.match(v.star)||this.match(v.ellipsis)||this.match(v.privateId)||this.isLiteralPropertyName())&&!this.hasPrecedingLineBreak()}tsNextTokenCanFollowModifier(){return this.next(!0),this.tsTokenCanFollowModifier()}tsParseModifier(P,L){let R=this.value;if(P.indexOf(R)!==-1&&!this.containsEsc){if(L&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return R}return}tsParseModifiersByMap({modified:P,map:L}){for(let R of Object.keys(L))P[R]=L[R]}tsParseModifiers({modified:P,allowedModifiers:L,disallowedModifiers:R,stopOnStartOfClassStaticBlock:O,errorTemplate:X=ge.InvalidModifierOnTypeMember}){let ee={},ne=(le,re,Ee,_e)=>{if(re===Ee&&P[_e])this.raise(le.column,ge.InvalidModifiersOrder({orderedModifiers:[Ee,_e]}))},fe=(le,re,Ee,_e)=>{if(P[Ee]&&re===_e||P[_e]&&re===Ee)this.raise(le.column,ge.IncompatibleModifiers({modifiers:[Ee,_e]}))};for(;;){let le=this.startLoc,re=this.tsParseModifier(L.concat(R??[]),O);if(!re)break;if(gs(re))if(P.accessibility)this.raise(this.start,ge.DuplicateAccessibilityModifier());else ne(le,re,re,"override"),ne(le,re,re,"static"),ne(le,re,re,"readonly"),ne(le,re,re,"accessor"),ee.accessibility=re,P.accessibility=re;else if(ko(re))if(P[re])this.raise(this.start,ge.DuplicateModifier({modifier:re}));else ne(le,re,"in","out"),ee[re]=re,P[re]=!0;else if(vo(re))if(P[re])this.raise(this.start,ge.DuplicateModifier({modifier:re}));else fe(le,re,"accessor","readonly"),fe(le,re,"accessor","override"),ee[re]=re,P[re]=!0;else if(re==="const")if(P[re])this.raise(this.start,ge.DuplicateModifier({modifier:re}));else ee[re]=re,P[re]=!0;else if(Object.hasOwnProperty.call(P,re))this.raise(this.start,ge.DuplicateModifier({modifier:re}));else ne(le,re,"static","readonly"),ne(le,re,"static","override"),ne(le,re,"override","readonly"),ne(le,re,"abstract","override"),fe(le,re,"declare","override"),fe(le,re,"static","abstract"),ee[re]=re,P[re]=!0;if(R?.includes(re))this.raise(this.start,X)}return ee}tsParseInOutModifiers(P){this.tsParseModifiers({modified:P,allowedModifiers:["in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:ge.InvalidModifierOnTypeParameter})}tsParseClassTypeParameterModifiers(P){this.tsParseModifiers({modified:P,allowedModifiers:["const","in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:ge.InvalidModifierOnTypeParameter})}parseMaybeUnary(P,L,R,O){if(!t?.jsx&&this.tsMatchLeftRelational())return this.tsParseTypeAssertion();else return super.parseMaybeUnary(P,L,R,O)}tsParseTypeAssertion(){if(f)this.raise(this.start,ge.ReservedTypeAssertion);let P=this.tryParse(()=>{let L=this.startNode(),R=this.tsTryNextParseConstantContext();return L.typeAnnotation=R||this.tsNextThenParseType(),this.expect(v.relational),L.expression=this.parseMaybeUnary(),this.finishNode(L,"TSTypeAssertion")});if(P.error)return this.tsParseTypeParameters(this.tsParseConstModifier);else return P.node}tsParseTypeArguments(P=!1){let L=this.startNode();if(L.params=this.tsInType(()=>this.tsInNoContext(()=>(this.expect(v.relational),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),L.params.length===0)this.raise(this.start,ge.EmptyTypeArguments);if(P&&this.curContext()!==be.tc_oTag)this.reScan_lt_gt();if(!this.tsMatchRightRelational())this.unexpected();return this.exprAllowed=!1,this.next(),this.finishNode(L,"TSTypeParameterInstantiation")}tsParseHeritageClause(P){let L=this.start,R=this.tsParseDelimitedList("HeritageClauseElement",()=>{let O=this.startNode();if(O.expression=this.tsParseEntityName(),this.tsMatchLeftRelational())O.typeParameters=this.tsParseTypeArguments();return this.finishNode(O,"TSExpressionWithTypeArguments")});if(!R.length)this.raise(L,ge.EmptyHeritageClauseType({token:P}));return R}tsParseTypeMemberSemicolon(){if(!this.eat(v.comma)&&!this.isLineTerminator())this.expect(v.semi)}tsTryParseAndCatch(P){let L=this.tryParse((R)=>P()||R());if(L.aborted||!L.node)return;return L.node}tsParseSignatureMember(P,L){return this.tsFillSignature(v.colon,L),this.tsParseTypeMemberSemicolon(),this.finishNode(L,P)}tsParsePropertyOrMethodSignature(P,L){if(this.eat(v.question))P.optional=!0;let R=P;if(this.match(v.parenL)||this.tsMatchLeftRelational()){if(L)this.raise(P.start,ge.ReadonlyForMethodSignature);let O=R;if(O.kind&&this.tsMatchLeftRelational())this.raise(this.start,ge.AccesorCannotHaveTypeParameters);this.tsFillSignature(v.colon,O),this.tsParseTypeMemberSemicolon();let X="parameters",ee="typeAnnotation";if(O.kind==="get"){if(O[X].length>0){if(this.raise(this.start,"A 'get' accesor must not have any formal parameters."),this.isThisParam(O[X][0]))this.raise(this.start,ge.AccesorCannotDeclareThisParameter)}}else if(O.kind==="set"){if(O[X].length!==1)this.raise(this.start,"A 'get' accesor must not have any formal parameters.");else{let ne=O[X][0];if(this.isThisParam(ne))this.raise(this.start,ge.AccesorCannotDeclareThisParameter);if(ne.type==="Identifier"&&ne.optional)this.raise(this.start,ge.SetAccesorCannotHaveOptionalParameter);if(ne.type==="RestElement")this.raise(this.start,ge.SetAccesorCannotHaveRestParameter)}if(O[ee])this.raise(O[ee].start,ge.SetAccesorCannotHaveReturnType)}else O.kind="method";return this.finishNode(O,"TSMethodSignature")}else{let O=R;if(L)O.readonly=!0;let X=this.tsTryParseTypeAnnotation();if(X)O.typeAnnotation=X;return this.tsParseTypeMemberSemicolon(),this.finishNode(O,"TSPropertySignature")}}tsParseTypeMember(){let P=this.startNode();if(this.match(v.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSCallSignatureDeclaration",P);if(this.match(v._new)){let R=this.startNode();if(this.next(),this.match(v.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSConstructSignatureDeclaration",P);else return P.key=this.createIdentifier(R,"new"),this.tsParsePropertyOrMethodSignature(P,!1)}this.tsParseModifiers({modified:P,allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]});let L=this.tsTryParseIndexSignature(P);if(L)return L;if(this.parsePropertyName(P),!P.computed&&P.key.type==="Identifier"&&(P.key.name==="get"||P.key.name==="set")&&this.tsTokenCanFollowModifier())P.kind=P.key.name,this.parsePropertyName(P);return this.tsParsePropertyOrMethodSignature(P,!!P.readonly)}tsParseList(P,L){let R=[];while(!this.tsIsListTerminator(P))R.push(L());return R}tsParseObjectTypeMembers(){this.expect(v.braceL);let P=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(v.braceR),P}tsParseInterfaceDeclaration(P,L={}){if(this.hasFollowingLineBreak())return null;if(this.expectContextual("interface"),L.declare)P.declare=!0;if(Se(this.type)){P.id=this.parseIdent(),this.checkLValSimple(P.id,Ce.BIND_TS_INTERFACE);let O=this.currentScope();this.maybeExportDefined(O,P.id.name)}else P.id=null,this.raise(this.start,ge.MissingInterfaceName);if(P.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.eat(v._extends))P.extends=this.tsParseHeritageClause("extends");let R=this.startNode();return R.body=this.tsParseInterfaceBody(),P.body=this.finishNode(R,"TSInterfaceBody"),this.finishNode(P,"TSInterfaceDeclaration")}tsParseInterfaceBody(){this.expect(v.braceL);let P=this.inType;this.inType=!0;let L=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.inType=P,this.expect(v.braceR),L}tsParseAbstractDeclaration(P){if(this.match(v._class))return P.abstract=!0,this.parseClass(P,!0);else if(this.ts_isContextual(Q.interface)){if(!this.hasFollowingLineBreak())return P.abstract=!0,this.tsParseInterfaceDeclaration(P)}else this.unexpected(P.start)}tsIsDeclarationStart(){return Be(this.type)}tsParseExpressionStatement(P,L){switch(L.name){case"declare":{let R=this.tsTryParseDeclare(P);if(R)return R.declare=!0,R;break}case"global":if(this.match(v.braceL)){this.enterScope(wt);let R=P;return R.global=!0,R.id=L,R.body=this.tsParseModuleBlock(),super.exitScope(),this.finishNode(R,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(P,L.name,!1)}}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsIsExportDefaultSpecifier(){let{type:P}=this,L=this.isAsyncFunction(),R=this.isLet();if(Se(P)){if(L&&!this.containsEsc||R)return!1;if((P===Q.type||P===Q.interface)&&!this.containsEsc){let ee=this.lookahead();if(Se(ee.type)&&!this.isContextualWithState("from",ee)||ee.type===v.braceL)return!1}}else if(!this.match(v._default))return!1;let O=this.nextTokenStart(),X=this.isUnparsedContextual(O,"from");if(this.input.charCodeAt(O)===44||Se(this.type)&&X)return!0;if(this.match(v._default)&&X){let ee=this.input.charCodeAt(this.nextTokenStartSince(O+4));return ee===34||ee===39}return!1}tsInAmbientContext(P){let L=this.isAmbientContext;this.isAmbientContext=!0;try{return P()}finally{this.isAmbientContext=L}}tsCheckLineTerminator(P){if(P){if(this.hasFollowingLineBreak())return!1;return this.next(),!0}return!this.isLineTerminator()}tsParseModuleOrNamespaceDeclaration(P,L=!1){if(P.id=this.parseIdent(),!L)this.checkLValSimple(P.id,Ce.BIND_TS_NAMESPACE);if(this.eat(v.dot)){let R=this.startNode();this.tsParseModuleOrNamespaceDeclaration(R,!0),P.body=R}else this.enterScope(wt),P.body=this.tsParseModuleBlock(),super.exitScope();return this.finishNode(P,"TSModuleDeclaration")}checkLValSimple(P,L=Ce.BIND_NONE,R){while(P.type==="TSNonNullExpression"||P.type==="TSAsExpression"||P.type==="TSSatisfiesExpression"||P.type==="TSTypeAssertion")P=P.expression;return super.checkLValSimple(P,L,R)}isSimpleAssignTarget(P){while(P.type==="TSNonNullExpression"||P.type==="TSAsExpression"||P.type==="TSSatisfiesExpression"||P.type==="TSTypeAssertion")P=P.expression;return super.isSimpleAssignTarget(P)}tsParseTypeAliasDeclaration(P){P.id=this.parseIdent(),this.checkLValSimple(P.id,Ce.BIND_TS_TYPE);let L=this.currentScope();return this.maybeExportDefined(L,P.id.name),P.typeAnnotation=this.tsInType(()=>{if(P.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.expect(v.eq),this.ts_isContextual(Q.interface)&&this.lookahead().type!==v.dot){let R=this.startNode();return this.next(),this.finishNode(R,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(P,"TSTypeAliasDeclaration")}tsParseDeclaration(P,L,R){switch(L){case"abstract":if(this.tsCheckLineTerminator(R)&&(this.match(v._class)||Se(this.type)))return this.tsParseAbstractDeclaration(P);break;case"module":if(this.tsCheckLineTerminator(R)){if(this.match(v.string))return this.tsParseAmbientExternalModuleDeclaration(P);else if(Se(this.type))return this.tsParseModuleOrNamespaceDeclaration(P)}break;case"namespace":if(this.tsCheckLineTerminator(R)&&Se(this.type))return this.tsParseModuleOrNamespaceDeclaration(P);break;case"type":if(this.tsCheckLineTerminator(R)&&Se(this.type))return this.tsParseTypeAliasDeclaration(P);break}}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.value,!0)}tsParseImportEqualsDeclaration(P,L){P.isExport=L||!1,P.id=this.parseIdent(),this.checkLValSimple(P.id,Ce.BIND_LEXICAL),super.expect(v.eq);let R=this.tsParseModuleReference();if(P.importKind==="type"&&R.type!=="TSExternalModuleReference")this.raise(R.start,ge.ImportAliasHasImportType);return P.moduleReference=R,super.semicolon(),this.finishNode(P,"TSImportEqualsDeclaration")}isExportDefaultSpecifier(){if(this.tsIsDeclarationStart())return!1;let{type:P}=this;if(Se(P)){if(this.isContextual("async")||this.isContextual("let"))return!1;if((P===Q.type||P===Q.interface)&&!this.containsEsc){let O=this.lookahead();if(Se(O.type)&&!this.isContextualWithState("from",O)||O.type===v.braceL)return!1}}else if(!this.match(v._default))return!1;let L=this.nextTokenStart(),R=this.isUnparsedContextual(L,"from");if(this.input.charCodeAt(L)===44||Se(this.type)&&R)return!0;if(this.match(v._default)&&R){let O=this.input.charCodeAt(this.nextTokenStartSince(L+4));return O===34||O===39}return!1}parseTemplate({isTagged:P=!1}={}){let L=this.startNode();this.next(),L.expressions=[];let R=this.parseTemplateElement({isTagged:P});L.quasis=[R];while(!R.tail){if(this.type===v.eof)this.raise(this.pos,"Unterminated template literal");this.expect(v.dollarBraceL),L.expressions.push(this.inType?this.tsParseType():this.parseExpression()),this.expect(v.braceR),L.quasis.push(R=this.parseTemplateElement({isTagged:P}))}return this.next(),this.finishNode(L,"TemplateLiteral")}parseFunction(P,L,R,O,X){if(this.initFunction(P),this.ecmaVersion>=9||this.ecmaVersion>=6&&!O){if(this.type===v.star&&L&ys)this.unexpected();P.generator=this.eat(v.star)}if(this.ecmaVersion>=8)P.async=!!O;if(L&Xt)P.id=L&wo&&this.type!==v.name?null:this.parseIdent();let ee=this.yieldPos,ne=this.awaitPos,fe=this.awaitIdentPos,le=this.maybeInArrowParameters;if(this.maybeInArrowParameters=!1,this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Fn(P.async,P.generator)),!(L&Xt))P.id=this.type===v.name?this.parseIdent():null;this.parseFunctionParams(P);let re=L&Xt;if(this.parseFunctionBody(P,R,!1,X,{isFunctionDeclaration:re}),re&&this.isAmbientContext&&P.id){if(this.currentScope().flags&Ce.SCOPE_TOP)this.declareName(P.id.name,Ce.BIND_FLAGS_TS_EXPORT_ONLY,P.id.start)}if(this.yieldPos=ee,this.awaitPos=ne,this.awaitIdentPos=fe,L&Xt&&P.id&&!(L&ys))if(P.body)this.checkLValSimple(P.id,this.strict||P.generator||P.async?this.treatFunctionsAsVar?Ce.BIND_VAR:Ce.BIND_LEXICAL:Ce.BIND_FUNCTION);else this.checkLValSimple(P.id,Ce.BIND_NONE);return this.maybeInArrowParameters=le,this.finishNode(P,re?"FunctionDeclaration":"FunctionExpression")}parseFunctionBody(P,L=!1,R=!1,O=!1,X){if(this.match(v.colon))P.returnType=this.tsParseTypeOrTypePredicateAnnotation(v.colon);let ee=X?.isFunctionDeclaration?"TSDeclareFunction":X?.isClassMethod?"TSDeclareMethod":void 0;if(ee&&!this.match(v.braceL)&&this.isLineTerminator())return this.exitScope(),this.finishNode(P,ee);if(ee==="TSDeclareFunction"&&this.isAmbientContext){if(this.raise(P.start,ge.DeclareFunctionHasImplementation),P.declare)return super.parseFunctionBody(P,L,R,!1),this.finishNode(P,ee)}return super.parseFunctionBody(P,L,R,O),P}parseNew(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");let P=this.startNode(),L=this.parseIdent(!0);if(this.ecmaVersion>=6&&this.eat(v.dot)){P.meta=L;let ne=this.containsEsc;if(P.property=this.parseIdent(!0),P.property.name!=="target")this.raiseRecoverable(P.property.start,"The only valid meta property for new is 'new.target'");if(ne)this.raiseRecoverable(P.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(P.start,"'new.target' can only be used in functions and class static block");return this.finishNode(P,"MetaProperty")}let R=this.start,O=this.startLoc,X=this.type===v._import;if(P.callee=this.parseSubscripts(this.parseExprAtom(),R,O,!0,!1),X&&P.callee.type==="ImportExpression")this.raise(R,"Cannot use new with import()");let{callee:ee}=P;if(ee.type==="TSInstantiationExpression"&&!ee.extra?.parenthesized)P.typeArguments=ee.typeArguments,P.callee=ee.expression;if(this.eat(v.parenL))P.arguments=this.parseExprList(v.parenR,this.ecmaVersion>=8,!1);else P.arguments=[];return this.finishNode(P,"NewExpression")}parseExprOp(P,L,R,O,X){if(v._in.binop>O&&!this.hasPrecedingLineBreak()){let ee;if(this.isContextual("as"))ee="TSAsExpression";if(this.isContextual("satisfies"))ee="TSSatisfiesExpression";if(ee){let ne=this.startNodeAt(L,R);ne.expression=P;let fe=this.tsTryNextParseConstantContext();if(fe)ne.typeAnnotation=fe;else ne.typeAnnotation=this.tsNextThenParseType();return this.finishNode(ne,ee),this.reScan_lt_gt(),this.parseExprOp(ne,L,R,O,X)}}return super.parseExprOp(P,L,R,O,X)}parseImportSpecifiers(){let P=[],L=!0;if(w.tokenIsIdentifier(this.type)){if(P.push(this.parseImportDefaultSpecifier()),!this.eat(v.comma))return P}if(this.type===v.star)return P.push(this.parseImportNamespaceSpecifier()),P;this.expect(v.braceL);while(!this.eat(v.braceR)){if(!L){if(this.expect(v.comma),this.afterTrailingComma(v.braceR))break}else L=!1;P.push(this.parseImportSpecifier())}return P}parseImport(P){let L=this.lookahead();if(P.importKind="value",this.importOrExportOuterKind="value",Se(L.type)||this.match(v.star)||this.match(v.braceL)){let R=this.lookahead(2);if(R.type!==v.comma&&!this.isContextualWithState("from",R)&&R.type!==v.eq&&this.ts_eatContextualWithState("type",1,L))this.importOrExportOuterKind="type",P.importKind="type",L=this.lookahead(),R=this.lookahead(2);if(Se(L.type)&&R.type===v.eq){this.next();let O=this.tsParseImportEqualsDeclaration(P);return this.importOrExportOuterKind="value",O}}if(this.next(),this.type===v.string)P.specifiers=[],P.source=this.parseExprAtom();else P.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),P.source=this.type===v.string?this.parseExprAtom():this.unexpected();if(this.parseMaybeImportAttributes(P),this.semicolon(),this.finishNode(P,"ImportDeclaration"),this.importOrExportOuterKind="value",P.importKind==="type"&&P.specifiers.length>1&&P.specifiers[0].type==="ImportDefaultSpecifier")this.raise(P.start,ge.TypeImportCannotSpecifyDefaultAndNamed);return P}parseExportDefaultDeclaration(){if(this.isAbstractClass()){let P=this.startNode();return this.next(),P.abstract=!0,this.parseClass(P,!0)}if(this.match(Q.interface)){let P=this.tsParseInterfaceDeclaration(this.startNode());if(P)return P}return super.parseExportDefaultDeclaration()}parseExportAllDeclaration(P,L){if(this.ecmaVersion>=11)if(this.eatContextual("as"))P.exported=this.parseModuleExportName(),this.checkExport(L,P.exported,this.lastTokStart);else P.exported=null;if(this.expectContextual("from"),this.type!==v.string)this.unexpected();return P.source=this.parseExprAtom(),this.parseMaybeImportAttributes(P),this.semicolon(),this.finishNode(P,"ExportAllDeclaration")}parseDynamicImport(P){if(this.next(),P.source=this.parseMaybeAssign(),this.eat(v.comma)){let L=this.parseExpression();P.arguments=[L]}if(!this.eat(v.parenR)){let L=this.start;if(this.eat(v.comma)&&this.eat(v.parenR))this.raiseRecoverable(L,"Trailing comma is not allowed in import()");else this.unexpected(L)}return this.finishNode(P,"ImportExpression")}parseExport(P,L){let R=this.lookahead();if(this.ts_eatWithState(v._import,2,R)){if(this.ts_isContextual(Q.type)&&this.lookaheadCharCode()!==61)P.importKind="type",this.importOrExportOuterKind="type",this.next();else P.importKind="value",this.importOrExportOuterKind="value";let O=this.tsParseImportEqualsDeclaration(P,!0);return this.importOrExportOuterKind=void 0,O}else if(this.ts_eatWithState(v.eq,2,R)){let O=P;return O.expression=this.parseExpression(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(O,"TSExportAssignment")}else if(this.ts_eatContextualWithState("as",2,R)){let O=P;return this.expectContextual("namespace"),O.id=this.parseIdent(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(O,"TSNamespaceExportDeclaration")}else{let O=this.lookahead(2).type;if(this.ts_isContextualWithState(R,Q.type)&&(O===v.braceL||O===v.star))this.next(),this.importOrExportOuterKind="type",P.exportKind="type";else this.importOrExportOuterKind="value",P.exportKind="value";if(this.next(),this.eat(v.star))return this.parseExportAllDeclaration(P,L);if(this.eat(v._default))return this.checkExport(L,"default",this.lastTokStart),P.declaration=this.parseExportDefaultDeclaration(),this.finishNode(P,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(P.declaration=this.parseExportDeclaration(P),P.declaration.type==="VariableDeclaration")this.checkVariableExport(L,P.declaration.declarations);else this.checkExport(L,P.declaration.id,P.declaration.id.start);P.specifiers=[],P.source=null}else{if(P.declaration=null,P.specifiers=this.parseExportSpecifiers(L),this.eatContextual("from")){if(this.type!==v.string)this.unexpected();P.source=this.parseExprAtom(),this.parseMaybeImportAttributes(P)}else{for(let X of P.specifiers)if(this.checkUnreserved(X.local),this.checkLocalExport(X.local),X.local.type==="Literal")this.raise(X.local.start,"A string literal cannot be used as an exported binding without `from`.");P.source=null}this.semicolon()}return this.finishNode(P,"ExportNamedDeclaration")}}checkExport(P,L,R){if(!P)return;if(typeof L!=="string")L=L.type==="Identifier"?L.name:L.value;P[L]=!0}parseMaybeDefault(P,L,R){let O=super.parseMaybeDefault(P,L,R);if(O.type==="AssignmentPattern"&&O.typeAnnotation&&O.right.start<O.typeAnnotation.start)this.raise(O.typeAnnotation.start,ge.TypeAnnotationAfterAssign);return O}typeCastToParameter(P){return P.expression.typeAnnotation=P.typeAnnotation,this.resetEndLocation(P.expression,P.typeAnnotation.end,P.typeAnnotation.loc?.end),P.expression}toAssignableList(P,L){if(!P)P=[];for(let R=0;R<P.length;R++){let O=P[R];if(O?.type==="TSTypeCastExpression")P[R]=this.typeCastToParameter(O)}return super.toAssignableList(P,L)}reportReservedArrowTypeParam(P){if(P.params.length===1&&!P.extra?.trailingComma&&f)this.raise(P.start,ge.ReservedArrowTypeParam)}parseExprAtom(P,L,R){if(this.type===Q.jsxText)return this.jsx_parseText();else if(this.type===Q.jsxTagStart)return this.jsx_parseElement();else if(this.type===Q.at)return this.parseDecorators(),this.parseExprAtom();else if(Se(this.type)){let O=this.potentialArrowAt===this.start,X=this.start,ee=this.startLoc,ne=this.containsEsc,fe=this.parseIdent(!1);if(this.ecmaVersion>=8&&!ne&&fe.name==="async"&&!this.canInsertSemicolon()&&this.eat(v._function))return this.overrideContext(z.f_expr),this.parseFunction(this.startNodeAt(X,ee),0,!1,!0,L);if(O&&!this.canInsertSemicolon()){if(this.eat(v.arrow))return this.parseArrowExpression(this.startNodeAt(X,ee),[fe],!1,L);if(this.ecmaVersion>=8&&fe.name==="async"&&this.type===v.name&&!ne&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(fe=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(v.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(X,ee),[fe],!0,L)}}return fe}else return super.parseExprAtom(P,L,R)}parseExprAtomDefault(){if(Se(this.type)){let P=this.potentialArrowAt===this.start,L=this.containsEsc,R=this.parseIdent();if(!L&&R.name==="async"&&!this.canInsertSemicolon()){let{type:O}=this;if(O===v._function)return this.next(),this.parseFunction(this.startNodeAtNode(R),void 0,!0,!0);else if(Se(O))if(this.lookaheadCharCode()===61){let X=this.parseIdent(!1);if(this.canInsertSemicolon()||!this.eat(v.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAtNode(R),[X],!0)}else return R}if(P&&this.match(v.arrow)&&!this.canInsertSemicolon())return this.next(),this.parseArrowExpression(this.startNodeAtNode(R),[R],!1);return R}else this.unexpected()}parseIdentNode(){let P=this.startNode();if(Me(this.type)&&!((this.type.keyword==="class"||this.type.keyword==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)))P.name=this.value;else return super.parseIdentNode();return P}parseVarStatement(P,L,R=!1){let{isAmbientContext:O}=this;this.next(),super.parseVar(P,!1,L,R||O),this.semicolon();let X=this.finishNode(P,"VariableDeclaration");if(!O)return X;for(let{id:ee,init:ne}of X.declarations){if(!ne)continue;if(L!=="const"||!!ee.typeAnnotation)this.raise(ne.start,ge.InitializerNotAllowedInAmbientContext);else if(ne.type!=="Literal"&&(ne.type!=="TemplateLiteral"||ne.expressions.length>0)&&!Do(ne)&&!No(ne))this.raise(ne.start,ge.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference)}return X}parseStatement(P,L,R){if(this.match(Q.at))this.parseDecorators(!0);if(this.match(v._const)&&this.isLookaheadContextual("enum")){let O=this.startNode();return this.expect(v._const),this.tsParseEnumDeclaration(O,{const:!0})}if(this.ts_isContextual(Q.enum))return this.tsParseEnumDeclaration(this.startNode());if(this.ts_isContextual(Q.interface)){let O=this.tsParseInterfaceDeclaration(this.startNode());if(O)return O}return super.parseStatement(P,L,R)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}parsePostMemberNameModifiers(P){if(this.eat(v.question))P.optional=!0;if(P.readonly&&this.match(v.parenL))this.raise(P.start,ge.ClassMethodHasReadonly);if(P.declare&&this.match(v.parenL))this.raise(P.start,ge.ClassMethodHasDeclare)}parseExpressionStatement(P,L){return(L.type==="Identifier"?this.tsParseExpressionStatement(P,L):void 0)||super.parseExpressionStatement(P,L)}shouldParseExportStatement(){if(this.tsIsDeclarationStart())return!0;if(this.match(Q.at))return!0;return super.shouldParseExportStatement()}parseConditional(P,L,R,O,X){if(this.eat(v.question)){let ee=this.startNodeAt(L,R);return ee.test=P,ee.consequent=this.parseMaybeAssign(),this.expect(v.colon),ee.alternate=this.parseMaybeAssign(O),this.finishNode(ee,"ConditionalExpression")}return P}parseMaybeConditional(P,L){let R=this.start,O=this.startLoc,X=this.parseExprOps(P,L);if(this.checkExpressionErrors(L))return X;if(!this.maybeInArrowParameters||!this.match(v.question))return this.parseConditional(X,R,O,P,L);let ee=this.tryParse(()=>this.parseConditional(X,R,O,P,L));if(!ee.node){if(ee.error)this.setOptionalParametersError(L,ee.error);return X}return ee.node}parseParenItem(P){let L=this.start,R=this.startLoc;if(P=super.parseParenItem(P),this.eat(v.question))P.optional=!0,this.resetEndLocation(P);if(this.match(v.colon)){let O=this.startNodeAt(L,R);return O.expression=P,O.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(O,"TSTypeCastExpression")}return P}parseExportDeclaration(P){if(!this.isAmbientContext&&this.ts_isContextual(Q.declare))return this.tsInAmbientContext(()=>this.parseExportDeclaration(P));let L=this.start,R=this.startLoc,O=this.eatContextual("declare");if(O&&(this.ts_isContextual(Q.declare)||!this.shouldParseExportStatement()))this.raise(this.start,ge.ExpectedAmbientAfterExportDeclare);let ee=Se(this.type)&&this.tsTryParseExportDeclaration()||this.parseStatement(null);if(!ee)return null;if(ee.type==="TSInterfaceDeclaration"||ee.type==="TSTypeAliasDeclaration"||O)P.exportKind="type";if(O)this.resetStartLocation(ee,L,R),ee.declare=!0;return ee}parseClassId(P,L){if(!L&&this.isContextual("implements"))return;super.parseClassId(P,L);let R=this.tsTryParseTypeParameters(this.tsParseClassTypeParameterModifiers.bind(this));if(R)P.typeParameters=R}parseClassPropertyAnnotation(P){if(!P.optional){if(this.value==="!"&&this.eat(v.prefix))P.definite=!0;else if(this.eat(v.question))P.optional=!0}let L=this.tsTryParseTypeAnnotation();if(L)P.typeAnnotation=L}parseClassField(P){if(P.key.type==="PrivateIdentifier"){if(P.abstract)this.raise(P.start,ge.PrivateElementHasAbstract);if(P.accessibility)this.raise(P.start,ge.PrivateElementHasAccessibility({modifier:P.accessibility}));this.parseClassPropertyAnnotation(P)}else{if(this.parseClassPropertyAnnotation(P),this.isAmbientContext&&!(P.readonly&&!P.typeAnnotation)&&this.match(v.eq))this.raise(this.start,ge.DeclareClassFieldHasInitializer);if(P.abstract&&this.match(v.eq)){let{key:R}=P;this.raise(this.start,ge.AbstractPropertyHasInitializer({propertyName:R.type==="Identifier"&&!P.computed?R.name:`[${this.input.slice(R.start,R.end)}]`}))}}return super.parseClassField(P)}parseClassMethod(P,L,R,O){let X=P.kind==="constructor",ee=P.key.type==="PrivateIdentifier",ne=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(ee){if(ne)P.typeParameters=ne;if(P.accessibility)this.raise(P.start,ge.PrivateMethodsHasAccessibility({modifier:P.accessibility}))}else if(ne&&X)this.raise(ne.start,ge.ConstructorHasTypeParameters);let{declare:fe=!1,kind:le}=P;if(fe&&(le==="get"||le==="set"))this.raise(P.start,ge.DeclareAccessor({kind:le}));if(ne)P.typeParameters=ne;let re=P.key;if(P.kind==="constructor"){if(L)this.raise(re.start,"Constructor can't be a generator");if(R)this.raise(re.start,"Constructor can't be an async method")}else if(P.static&&ds(P,"prototype"))this.raise(re.start,"Classes may not have a static property named prototype");let Ee=P.value=this.parseMethod(L,R,O,!0,P);if(P.kind==="get"&&Ee.params.length!==0)this.raiseRecoverable(Ee.start,"getter should have no params");if(P.kind==="set"&&Ee.params.length!==1)this.raiseRecoverable(Ee.start,"setter should have exactly one param");if(P.kind==="set"&&Ee.params[0].type==="RestElement")this.raiseRecoverable(Ee.params[0].start,"Setter cannot use rest params");return this.finishNode(P,"MethodDefinition")}isClassMethod(){return this.match(v.relational)}parseClassElement(P){if(this.eat(v.semi))return null;let L=this.startNode(),R="",O=!1,X=!1,ee="method",ne=!1,fe=["declare","private","public","protected","accessor","override","abstract","readonly","static"],le=this.tsParseModifiers({modified:L,allowedModifiers:fe,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:ge.InvalidModifierOnTypeParameterPositions});ne=Boolean(le.static);let re=()=>{if(this.tsIsStartOfStaticBlocks()){if(this.next(),this.next(),this.tsHasSomeModifiers(L,fe))this.raise(this.start,ge.StaticBlockCannotHaveModifier);if(this.ecmaVersion>=13)return super.parseClassStaticBlock(L),L}else{let Ee=this.tsTryParseIndexSignature(L);if(Ee){if(L.abstract)this.raise(L.start,ge.IndexSignatureHasAbstract);if(L.accessibility)this.raise(L.start,ge.IndexSignatureHasAccessibility({modifier:L.accessibility}));if(L.declare)this.raise(L.start,ge.IndexSignatureHasDeclare);if(L.override)this.raise(L.start,ge.IndexSignatureHasOverride);return Ee}if(!this.inAbstractClass&&L.abstract)this.raise(L.start,ge.NonAbstractClassHasAbstractMethod);if(L.override){if(!P)this.raise(L.start,ge.OverrideNotInSubClass)}if(L.static=ne,ne){if(!(this.isClassElementNameStart()||this.type===v.star))R="static"}if(!R&&this.ecmaVersion>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===v.star)&&!this.canInsertSemicolon())X=!0;else R="async";if(!R&&(this.ecmaVersion>=9||!X)&&this.eat(v.star))O=!0;if(!R&&!X&&!O){let _e=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())ee=_e;else R=_e}if(R)L.computed=!1,L.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),L.key.name=R,this.finishNode(L.key,"Identifier");else this.parseClassElementName(L);if(this.parsePostMemberNameModifiers(L),this.isClassMethod()||this.ecmaVersion<13||this.type===v.parenL||ee!=="method"||O||X){let _e=!L.static&&ds(L,"constructor"),Le=_e&&P;if(_e&&ee!=="method")this.raise(L.key.start,"Constructor can't have get/set modifier");L.kind=_e?"constructor":ee,this.parseClassMethod(L,O,X,Le)}else this.parseClassField(L);return L}};if(L.declare)this.tsInAmbientContext(re);else re();return L}isClassElementNameStart(){if(this.tsIsIdentifier())return!0;return super.isClassElementNameStart()}parseClassSuper(P){if(super.parseClassSuper(P),P.superClass&&(this.tsMatchLeftRelational()||this.match(v.bitShift)))P.superTypeParameters=this.tsParseTypeArgumentsInExpression();if(this.eatContextual("implements"))P.implements=this.tsParseHeritageClause("implements")}parseFunctionParams(P){let L=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(L)P.typeParameters=L;super.parseFunctionParams(P)}parseVarId(P,L){if(super.parseVarId(P,L),P.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.value==="!"&&this.eat(v.prefix))P.definite=!0;let R=this.tsTryParseTypeAnnotation();if(R)P.id.typeAnnotation=R,this.resetEndLocation(P.id)}parseArrowExpression(P,L,R,O){if(this.match(v.colon))P.returnType=this.tsParseTypeAnnotation();let X=this.yieldPos,ee=this.awaitPos,ne=this.awaitIdentPos;this.enterScope(Fn(R,!1)|Ce.SCOPE_ARROW),this.initFunction(P);let fe=this.maybeInArrowParameters;if(this.ecmaVersion>=8)P.async=!!R;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.maybeInArrowParameters=!0,P.params=this.toAssignableList(L,!0),this.maybeInArrowParameters=!1,this.parseFunctionBody(P,!0,!1,O),this.yieldPos=X,this.awaitPos=ee,this.awaitIdentPos=ne,this.maybeInArrowParameters=fe,this.finishNode(P,"ArrowFunctionExpression")}parseYield(P){if(!this.yieldPos)this.yieldPos=this.start;let L=this.startNode();this.next();let R=this.tsMatchLeftRelational();if(!(!this.match(v.semi)&&!this.canInsertSemicolon()&&(this.match(v.star)||this.type.startsExpr||R)))return L.delegate=!1,L.argument=null,this.finishNode(L,"YieldExpression");return L.delegate=this.eat(v.star),L.argument=this.parseMaybeAssign(P),this.finishNode(L,"YieldExpression")}parseMaybeAssignOrigin(P,L,R){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(P);else this.exprAllowed=!1;let O=!1,X=-1,ee=-1,ne=-1;if(L)X=L.parenthesizedAssign,ee=L.trailingComma,ne=L.doubleProto,L.parenthesizedAssign=L.trailingComma=-1;else L=new Nt,O=!0;let fe=this.start,le=this.startLoc;if(this.type===v.parenL||Se(this.type))this.potentialArrowAt=this.start,this.potentialArrowInForAwait=P==="await";let re=this.parseMaybeConditional(P,L);if(R)re=R.call(this,re,fe,le);if(this.type.isAssign){let Ee=this.startNodeAt(fe,le);if(Ee.operator=this.value,this.type===v.eq)re=this.toAssignable(re,!0,L,!0);if(!O)L.parenthesizedAssign=L.trailingComma=L.doubleProto=-1;if(L.shorthandAssign>=re.start)L.shorthandAssign=-1;if(!this.maybeInArrowParameters)if(this.type===v.eq)this.checkLValPattern(re);else this.checkLValSimple(re);if(Ee.left=re,this.next(),Ee.right=this.parseMaybeAssign(P),ne>-1)L.doubleProto=ne;return this.finishNode(Ee,"AssignmentExpression")}else if(O)this.checkExpressionErrors(L,!0);if(X>-1)L.parenthesizedAssign=X;if(ee>-1)L.trailingComma=ee;return re}parseMaybeAssign(P,L,R){let O,X;if(t?.jsx&&(this.matchJsx("jsxTagStart")||this.tsMatchLeftRelational())){if(O=this.tryParse(()=>this.parseMaybeAssignOrigin(P,L,R)),!O.error)return O.node;let fe=this.context,le=fe[fe.length-1],re=fe[fe.length-2];if(le===w.tokContexts.tc_oTag&&re===w.tokContexts.tc_expr)this.parseEffects.pop(fe),this.parseEffects.pop(fe);else if(le===w.tokContexts.tc_oTag||le===w.tokContexts.tc_expr)this.parseEffects.pop(fe)}if(!O?.error&&!this.tsMatchLeftRelational())return this.parseMaybeAssignOrigin(P,L,R);let ee,ne=this.tryParse((fe)=>{ee=this.tsParseTypeParameters(this.tsParseConstModifier);let le=this.parseMaybeAssignOrigin(P,L,R);if(le.type!=="ArrowFunctionExpression"||le.extra?.parenthesized)fe();if(ee?.params.length!==0)this.resetStartLocationFromNode(le,ee);return le.typeParameters=ee,le});if(!ne.error&&!ne.aborted){if(ee)this.reportReservedArrowTypeParam(ee);return ne.node}if(!O){if(hs(!0),X=this.tryParse(()=>this.parseMaybeAssignOrigin(P,L,R)),!X.error)return X.node}if(O?.thrown)throw this.selectTryParseResult(O),O.error;if(ne.thrown)throw this.selectTryParseResult(ne),ne.error;if(X?.thrown)throw this.selectTryParseResult(X),X.error;throw O?.error||ne.error||X?.error}parseAssignableListItem(P){let L=[];while(this.match(Q.at))L.push(this.parseDecorator());let R=this.start,O=this.startLoc,X,ee=!1,ne=!1;if(P!==void 0){let re={};if(this.tsParseModifiers({modified:re,allowedModifiers:["public","private","protected","override","readonly"]}),X=re.accessibility,ne=re.override,ee=re.readonly,P===!1&&(X||ee||ne))this.raise(O.column,ge.UnexpectedParameterModifier)}let fe=this.parseMaybeDefault(R,O);this.parseBindingListItem(fe);let le=this.parseMaybeDefault(fe.start,fe.loc.start,fe);if(L.length)le.decorators=L;if(X||ee||ne){let re=this.startNodeAt(R,O);if(X)re.accessibility=X;if(ee)re.readonly=ee;if(ne)re.override=ne;if(le.type!=="Identifier"&&le.type!=="AssignmentPattern")this.raise(re.start,ge.UnsupportedParameterPropertyKind);return re.parameter=le,this.finishNode(re,"TSParameterProperty")}return le}checkLValInnerPattern(P,L=Ce.BIND_NONE,R){switch(P.type){case"TSParameterProperty":this.checkLValInnerPattern(P.parameter,L,R);break;default:{super.checkLValInnerPattern(P,L,R);break}}}parseBindingListItem(P){if(this.eat(v.question)){if(P.type!=="Identifier"&&!this.isAmbientContext&&!this.inType)this.raise(P.start,ge.PatternIsOptional);P.optional=!0}let L=this.tsTryParseTypeAnnotation();if(L)P.typeAnnotation=L;return this.resetEndLocation(P),P}isAssignable(P,L){switch(P.type){case"TSTypeCastExpression":return this.isAssignable(P.expression,L);case"TSParameterProperty":return!0;case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":{let R=P.properties.length-1;return P.properties.every((O,X)=>O.type!=="ObjectMethod"&&(X===R||O.type!=="SpreadElement")&&this.isAssignable(O))}case"Property":case"ObjectProperty":return this.isAssignable(P.value);case"SpreadElement":return this.isAssignable(P.argument);case"ArrayExpression":return P.elements.every((R)=>R===null||this.isAssignable(R));case"AssignmentExpression":return P.operator==="=";case"ParenthesizedExpression":return this.isAssignable(P.expression);case"MemberExpression":case"OptionalMemberExpression":return!L;default:return!1}}toAssignable(P,L=!1,R=new Nt,O=!1){switch(P.type){case"ParenthesizedExpression":return this.toAssignableParenthesizedExpression(P,L,R,O);case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":if(L);else this.raise(P.start,ge.UnexpectedTypeCastInParameter);let X=this.toAssignable(P.expression,L,R,O);if(O)return P.expression=X,P;return X;case"MemberExpression":break;case"AssignmentExpression":if(!L&&P.left.type==="TSTypeCastExpression")P.left=this.typeCastToParameter(P.left);return super.toAssignable(P,L,R);case"TSTypeCastExpression":return this.typeCastToParameter(P);default:return super.toAssignable(P,L,R)}return P}toAssignableParenthesizedExpression(P,L,R,O=!1){switch(P.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":let X=this.toAssignable(P.expression,L,R,O);if(O)return P.expression=X,P;return X;default:return super.toAssignable(P,L,R)}}parseBindingAtom(){switch(this.type){case v._this:return this.parseIdent(!0);default:return super.parseBindingAtom()}}shouldParseArrow(P){let L;if(this.match(v.colon))L=P.every((R)=>this.isAssignable(R,!0));else L=!this.canInsertSemicolon();if(L){if(this.match(v.colon)){let R=this.tryParse((O)=>{let X=this.tsParseTypeOrTypePredicateAnnotation(v.colon);if(this.canInsertSemicolon()||!this.match(v.arrow))O();return X});if(R.aborted)return this.shouldParseArrowReturnType=void 0,!1;if(!R.thrown)this.shouldParseArrowReturnType=R.node}if(!this.match(v.arrow))return this.shouldParseArrowReturnType=void 0,!1;return!0}return this.shouldParseArrowReturnType=void 0,L}parseParenArrowList(P,L,R,O){let X=this.startNodeAt(P,L);return X.returnType=this.shouldParseArrowReturnType,this.shouldParseArrowReturnType=void 0,this.parseArrowExpression(X,R,!1,O)}parseParenAndDistinguishExpression(P,L){let R=this.start,O=this.startLoc,X,ee=this.ecmaVersion>=8;if(this.ecmaVersion>=6){let ne=this.maybeInArrowParameters;this.maybeInArrowParameters=!0,this.next();let fe=this.start,le=this.startLoc,re=[],Ee=!0,_e=!1,Le=new Nt,Xe=this.yieldPos,Ye=this.awaitPos,Qe;this.yieldPos=0,this.awaitPos=0;while(this.type!==v.parenR)if(Ee?Ee=!1:this.expect(v.comma),ee&&this.afterTrailingComma(v.parenR,!0)){_e=!0;break}else if(this.type===v.ellipsis){if(Qe=this.start,re.push(this.parseParenItem(this.parseRestBinding())),this.type===v.comma)this.raise(this.start,"Comma is not permitted after the rest element");break}else re.push(this.parseMaybeAssign(!1,Le,this.parseParenItem));let it=this.lastTokEnd,Ue=this.lastTokEndLoc;if(this.expect(v.parenR),this.maybeInArrowParameters=ne,P&&this.shouldParseArrow(re)&&this.eat(v.arrow))return this.checkPatternErrors(Le,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=Xe,this.awaitPos=Ye,this.parseParenArrowList(R,O,re,L);if(!re.length||_e)this.unexpected(this.lastTokStart);if(Qe)this.unexpected(Qe);if(this.checkExpressionErrors(Le,!0),this.yieldPos=Xe||this.yieldPos,this.awaitPos=Ye||this.awaitPos,re.length>1)X=this.startNodeAt(fe,le),X.expressions=re,this.finishNodeAt(X,"SequenceExpression",it,Ue);else X=re[0]}else X=this.parseParenExpression();if(this.options.preserveParens){let ne=this.startNodeAt(R,O);return ne.expression=X,this.finishNode(ne,"ParenthesizedExpression")}else return X}parseTaggedTemplateExpression(P,L,R,O){let X=this.startNodeAt(L,R);if(X.tag=P,X.quasi=this.parseTemplate({isTagged:!0}),O)this.raise(L,"Tagged Template Literals are not allowed in optionalChain.");return this.finishNode(X,"TaggedTemplateExpression")}shouldParseAsyncArrow(){if(this.match(v.colon)){let P=this.tryParse((L)=>{let R=this.tsParseTypeOrTypePredicateAnnotation(v.colon);if(this.canInsertSemicolon()||!this.match(v.arrow))L();return R});if(P.aborted)return this.shouldParseAsyncArrowReturnType=void 0,!1;if(!P.thrown)return this.shouldParseAsyncArrowReturnType=P.node,!this.canInsertSemicolon()&&this.eat(v.arrow)}else return!this.canInsertSemicolon()&&this.eat(v.arrow)}parseSubscriptAsyncArrow(P,L,R,O){let X=this.startNodeAt(P,L);return X.returnType=this.shouldParseAsyncArrowReturnType,this.shouldParseAsyncArrowReturnType=void 0,this.parseArrowExpression(X,R,!0,O)}parseExprList(P,L,R,O){let X=[],ee=!0;while(!this.eat(P)){if(!ee){if(this.expect(v.comma),L&&this.afterTrailingComma(P))break}else ee=!1;let ne;if(R&&this.type===v.comma)ne=null;else if(this.type===v.ellipsis){if(ne=this.parseSpread(O),this.maybeInArrowParameters&&this.match(v.colon))ne.typeAnnotation=this.tsParseTypeAnnotation();if(O&&this.type===v.comma&&O.trailingComma<0)O.trailingComma=this.start}else ne=this.parseMaybeAssign(!1,O,this.parseParenItem);X.push(ne)}return X}parseMaybeDecoratorArguments(P){let L=this.tsMatchLeftRelational()||this.match(v.bitShift)?this.tsParseTypeArgumentsInExpression():void 0;if(this.eat(v.parenL)){let R=this.startNodeAtNode(P);if(R.callee=P,R.arguments=this.parseExprList(v.parenR,!1),L)R.typeArguments=L;return this.finishNode(R,"CallExpression")}if(L){let R=this.startNodeAtNode(P);return R.expression=P,R.typeArguments=L,this.finishNode(R,"TSInstantiationExpression")}return P}parseSubscript(P,L,R,O,X,ee,ne){let fe=ee;if(!this.hasPrecedingLineBreak()&&this.value==="!"&&this.match(v.prefix)){this.exprAllowed=!1,this.next();let Le=this.startNodeAt(L,R);return Le.expression=P,P=this.finishNode(Le,"TSNonNullExpression"),P}let le=!1;if(this.match(v.questionDot)&&this.lookaheadCharCode()===60){if(O)return P;P.optional=!0,fe=le=!0,this.next()}if(this.tsMatchLeftRelational()||this.match(v.bitShift)){let Le,Xe=this.tsTryParseAndCatch(()=>{if(!O&&this.atPossibleAsyncArrow(P)){let Ue=this.tsTryParseGenericAsyncArrowFunction(L,R,ne);if(Ue)return P=Ue,P}let Ye=this.tsParseTypeArgumentsInExpression();if(!Ye)return P;if(le&&!this.match(v.parenL))return Le=this.curPosition(),P;if(Re(this.type)||this.type===v.backQuote){let Ue=this.parseTaggedTemplateExpression(P,L,R,fe);return Ue.typeArguments=Ye,Ue}if(!O&&this.eat(v.parenL)){let Ue=new Nt,Ke=this.startNodeAt(L,R);if(Ke.callee=P,Ke.arguments=this.parseExprList(v.parenR,this.ecmaVersion>=8,!1,Ue),this.tsCheckForInvalidTypeCasts(Ke.arguments),Ke.typeArguments=Ye,fe)Ke.optional=le;return this.checkExpressionErrors(Ue,!0),P=this.finishNode(Ke,"CallExpression"),P}let Qe=this.type;if(this.tsMatchRightRelational()||Qe===v.bitShift||Qe!==v.parenL&&Lo(Qe)&&!this.hasPrecedingLineBreak())return;let it=this.startNodeAt(L,R);return it.expression=P,it.typeArguments=Ye,this.finishNode(it,"TSInstantiationExpression")});if(Le)this.unexpected(Le);if(Xe){if(Xe.type==="TSInstantiationExpression"&&(this.match(v.dot)||this.match(v.questionDot)&&this.lookaheadCharCode()!==40))this.raise(this.start,ge.InvalidPropertyAccessAfterInstantiationExpression);return P=Xe,P}}let re=this.ecmaVersion>=11,Ee=re&&this.eat(v.questionDot);if(O&&Ee)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");let _e=this.eat(v.bracketL);if(_e||Ee&&this.type!==v.parenL&&this.type!==v.backQuote||this.eat(v.dot)){let Le=this.startNodeAt(L,R);if(Le.object=P,_e)Le.property=this.parseExpression(),this.expect(v.bracketR);else if(this.type===v.privateId&&P.type!=="Super")Le.property=this.parsePrivateIdent();else Le.property=this.parseIdent(this.options.allowReserved!=="never");if(Le.computed=!!_e,re)Le.optional=Ee;P=this.finishNode(Le,"MemberExpression")}else if(!O&&this.eat(v.parenL)){let Le=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let Xe=new Nt,Ye=this.yieldPos,Qe=this.awaitPos,it=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;let Ue=this.parseExprList(v.parenR,this.ecmaVersion>=8,!1,Xe);if(X&&!Ee&&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=Ye,this.awaitPos=Qe,this.awaitIdentPos=it,P=this.parseSubscriptAsyncArrow(L,R,Ue,ne)}else{this.checkExpressionErrors(Xe,!0),this.yieldPos=Ye||this.yieldPos,this.awaitPos=Qe||this.awaitPos,this.awaitIdentPos=it||this.awaitIdentPos;let Ke=this.startNodeAt(L,R);if(Ke.callee=P,Ke.arguments=Ue,re)Ke.optional=Ee;P=this.finishNode(Ke,"CallExpression")}this.maybeInArrowParameters=Le}else if(this.type===v.backQuote){if(Ee||fe)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");let Le=this.startNodeAt(L,R);Le.tag=P,Le.quasi=this.parseTemplate({isTagged:!0}),P=this.finishNode(Le,"TaggedTemplateExpression")}return P}parseGetterSetter(P){P.kind=P.key.name,this.parsePropertyName(P);let L=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(P.value=this.parseMethod(!1),L)P.value.typeParameters=L;let R=P.kind==="get"?0:1,O=P.value.params[0];if(R=O&&this.isThisParam(O)?R+1:R,P.value.params.length!==R){let ee=P.value.start;if(P.kind==="get")this.raiseRecoverable(ee,"getter should have no params");else this.raiseRecoverable(ee,"setter should have exactly one param")}else if(P.kind==="set"&&P.value.params[0].type==="RestElement")this.raiseRecoverable(P.value.params[0].start,"Setter cannot use rest params")}parsePropertyValue(P,L,R,O,X,ee,ne,fe){if(this.tsMatchLeftRelational()){if(L)this.unexpected();P.kind="init",P.method=!0;let le=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(P.value=this.parseMethod(R,O),le)P.value.typeParameters=le;return}return super.parsePropertyValue(P,L,R,O,X,ee,ne,fe)}parseProperty(P,L){if(!P){let R=[];if(this.match(Q.at))while(this.match(Q.at))R.push(this.parseDecorator());let O=super.parseProperty(P,L);if(O.type==="SpreadElement"){if(R.length)this.raise(O.start,Yt.SpreadElementDecorator)}if(R.length)O.decorators=R,R=[];return O}return super.parseProperty(P,L)}parseCatchClauseParam(){let P=this.parseBindingAtom(),L=P.type==="Identifier";this.enterScope(L?Ce.SCOPE_SIMPLE_CATCH:0),this.checkLValPattern(P,L?Ce.BIND_SIMPLE_CATCH:Ce.BIND_LEXICAL);let R=this.tsTryParseTypeAnnotation();if(R)P.typeAnnotation=R,this.resetEndLocation(P);return this.expect(v.parenR),P}parseClass(P,L){let R=this.inAbstractClass;this.inAbstractClass=!!P.abstract;try{this.next(),this.takeDecorators(P);let O=this.strict;this.strict=!0,this.parseClassId(P,L),this.parseClassSuper(P);let X=this.enterClassBody(),ee=this.startNode(),ne=!1;ee.body=[];let fe=[];this.expect(v.braceL);while(this.type!==v.braceR){if(this.match(Q.at)){fe.push(this.parseDecorator());continue}let le=this.parseClassElement(P.superClass!==null);if(fe.length)le.decorators=fe,this.resetStartLocationFromNode(le,fe[0]),fe=[];if(le){if(ee.body.push(le),le.type==="MethodDefinition"&&le.kind==="constructor"&&le.value.type==="FunctionExpression"){if(ne)this.raiseRecoverable(le.start,"Duplicate constructor in the same class");if(ne=!0,le.decorators&&le.decorators.length>0)this.raise(le.start,Yt.DecoratorConstructor)}else if(le.key&&le.key.type==="PrivateIdentifier"&&le.value?.type!=="TSDeclareMethod"){let re=le.key.name;if(this.parseEffects.modify(X,re,(_e)=>mo(_e,le)))this.raiseRecoverable(le.key.start,`Identifier '#${re}' has already been declared`)}}}if(this.strict=O,this.next(),fe.length)this.raise(this.start,Yt.TrailingDecorator);return P.body=this.finishNode(ee,"ClassBody"),this.exitClassBody(),this.finishNode(P,L?"ClassDeclaration":"ClassExpression")}finally{this.inAbstractClass=R}}parseClassFunctionParams(){let P=this.tsTryParseTypeParameters(),L=this.parseBindingList(v.parenR,!1,this.ecmaVersion>=8,!0);if(P)L.typeParameters=P;return L}parseMethod(P,L,R,O,X){let ee=this.startNode(),ne=this.yieldPos,fe=this.awaitPos,le=this.awaitIdentPos;if(this.initFunction(ee),this.ecmaVersion>=6)ee.generator=P;if(this.ecmaVersion>=8)ee.async=!!L;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Fn(L,ee.generator)|Ce.SCOPE_SUPER|(R?Ce.SCOPE_DIRECT_SUPER:0)),this.expect(v.parenL),ee.params=this.parseClassFunctionParams(),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(ee,!1,!0,!1,{isClassMethod:O}),this.yieldPos=ne,this.awaitPos=fe,this.awaitIdentPos=le,X&&X.abstract){if(!!ee.body){let{key:Ee}=X;this.raise(X.start,ge.AbstractMethodHasImplementation({methodName:Ee.type==="Identifier"&&!X.computed?Ee.name:`[${this.input.slice(Ee.start,Ee.end)}]`}))}}return this.finishNode(ee,"FunctionExpression")}static parse(P,L){if(L.locations===!1)throw Error("You have to enable options.locations while using acorn-typescript");else L.locations=!0;let R=new this(L,P);if(s)R.isAmbientContext=!0;return R.parse()}static parseExpressionAt(P,L,R){if(R.locations===!1)throw Error("You have to enable options.locations while using acorn-typescript");else R.locations=!0;let O=new this(R,P,L);if(s)O.isAmbientContext=!0;return O.nextToken(),O.parseExpression()}parseImportSpecifier(){if(this.ts_isContextual(Q.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(P){let L=this.ts_isContextual(Q.type);if(!this.match(v.string)&&L){let O=this.startNode();return O.local=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(O,!1,this.importOrExportOuterKind==="type"),this.finishNode(O,"ExportSpecifier"),this.checkExport(P,O.exported,O.exported.start),O}else{let O=super.parseExportSpecifier(P);return O.exportKind="value",O}}parseTypeOnlyImportExportSpecifier(P,L,R){let O=L?"imported":"local",X=L?"local":"exported",ee=P[O],ne,fe=!1,le=!0,re=ee.start;if(this.isContextual("as")){let _e=this.parseIdent();if(this.isContextual("as")){let Le=this.parseIdent();if(Me(this.type))fe=!0,ee=_e,ne=L?this.parseIdent():this.parseModuleExportName(),le=!1;else ne=Le,le=!1}else if(Me(this.type))le=!1,ne=L?this.parseIdent():this.parseModuleExportName();else fe=!0,ee=_e}else if(Me(this.type))if(fe=!0,L){if(ee=super.parseIdent(!0),!this.isContextual("as"))this.checkUnreserved(ee)}else ee=this.parseModuleExportName();if(fe&&R)this.raise(re,L?ge.TypeModifierIsUsedInTypeImports:ge.TypeModifierIsUsedInTypeExports);P[O]=ee,P[X]=ne;let Ee=L?"importKind":"exportKind";if(P[Ee]=fe?"type":"value",le&&this.eatContextual("as"))P[X]=L?this.parseIdent():this.parseModuleExportName();if(!P[X])P[X]=this.copyNode(P[O]);if(L)this.checkLValSimple(P[X],Ce.BIND_LEXICAL)}raiseCommonCheck(P,L,R){switch(L){case"Comma is not permitted after the rest element":if(this.isAmbientContext&&this.match(v.comma)&&this.lookaheadCharCode()===41){this.next();return}else return super.raise(P,L)}return R?super.raiseRecoverable(P,L):super.raise(P,L)}raiseRecoverable(P,L){return this.raiseCommonCheck(P,L,!0)}raise(P,L){return this.raiseCommonCheck(P,L,!0)}updateContext(P){let{type:L}=this;if(L==v.braceL){var R=this.curContext();if(R==be.tc_oTag)this.parseEffects.append(this.context,z.b_expr);else if(R==be.tc_expr)this.parseEffects.append(this.context,z.b_tmpl);else super.updateContext(P);this.exprAllowed=!0}else if(L===v.slash&&P===Q.jsxTagStart)this.parseEffects.truncate(this.context,this.context.length-2),this.parseEffects.append(this.context,be.tc_cTag),this.exprAllowed=!1;else return super.updateContext(P)}jsx_parseOpeningElementAt(P,L){let R=this.startNodeAt(P,L),O=this.jsx_parseElementName();if(O)R.name=O;if(this.match(v.relational)||this.match(v.bitShift)){let X=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());if(X)R.typeArguments=X}R.attributes=[];while(this.type!==v.slash&&this.type!==Q.jsxTagEnd)R.attributes.push(this.jsx_parseAttribute());return R.selfClosing=this.eat(v.slash),this.expect(Q.jsxTagEnd),this.finishNode(R,O?"JSXOpeningElement":"JSXOpeningFragment")}enterScope(P){let L=P===wt;if(L)this.parseEffects.append(this.importsStack,[]);let R=L?P|Ce.SCOPE_CLASS_STATIC_BLOCK:P;super.enterScope(R);let O=super.currentScope();O.types=[],O.enums=[],O.constEnums=[],O.classes=[],O.exportOnlyBindings=[]}exitScope(){if(super.currentScope().flags&wt)this.parseEffects.pop(this.importsStack);super.exitScope()}hasImport(P,L){let R=this.importsStack.length;if(this.importsStack[R-1].indexOf(P)>-1)return!0;if(!L&&R>1){for(let O=0;O<R-1;O++)if(this.importsStack[O].indexOf(P)>-1)return!0}return!1}maybeExportDefined(P,L){if(this.inModule&&P.flags&Ce.SCOPE_TOP)this.parseEffects.remove(this.undefinedExports,L)}declareName(P,L,R){if(L&Ce.BIND_FLAGS_TS_IMPORT){if(this.hasImport(P,!0))this.raise(R,`Identifier '${P}' has already been declared.`);this.parseEffects.append(this.importsStack[this.importsStack.length-1],P);return}let O=this.currentScope();if(L&Ce.BIND_FLAGS_TS_EXPORT_ONLY){this.maybeExportDefined(O,P),this.parseEffects.append(O.exportOnlyBindings,P);return}if(L===Ce.BIND_TS_TYPE||L===Ce.BIND_TS_INTERFACE){if(L===Ce.BIND_TS_TYPE&&O.types.includes(P))this.raise(R,`type '${P}' has already been declared.`);this.parseEffects.append(O.types,P)}else if(L&Ce.BIND_FLAGS_TS_ENUM){if(O.enums.includes(P))return;super.declareName(P,Ce.BIND_LEXICAL,R)}else super.declareName(P,L,R);if(L&Ce.BIND_FLAGS_TS_ENUM)this.parseEffects.append(O.enums,P);if(L&Ce.BIND_FLAGS_TS_CONST_ENUM)this.parseEffects.append(O.constEnums,P);if(L&Ce.BIND_FLAGS_CLASS)this.parseEffects.append(O.classes,P)}checkLocalExport(P){let{name:L}=P;if(this.hasImport(L))return;let R=this.scopeStack.length;for(let O=R-1;O>=0;O--){let X=this.scopeStack[O];if(X.types.indexOf(L)>-1||X.exportOnlyBindings.indexOf(L)>-1)return}super.checkLocalExport(P)}}return Bt}}var Ro=/\n/,_o=/[ \t]/,Oo=/^[,) \t]*$/,Zt="",ks=[];function en(t,s){Zt=t,ks=s}function tn(t,s,f,E){let C=s;if(t&&Ro.test(C)){let w=f;while(w>0&&Zt[w-1]!==`
22
+ `)w-=1;let v=w;while(_o.test(Zt[v]))v+=1;let I=Zt.slice(w,v);C=Bo(C,I)}ks.push({type:t?"Block":"Line",value:C,start:f,end:E})}function Bo(t,s){if(s==="")return t;return(t.startsWith(s)?t.slice(s.length):t).replaceAll(`
23
+ ${s}`,`
24
+ `)}function Hn(t,s,f,E){let C=Fo(f,E);if(C>=f.length)return;Vn(t,void 0,f,{index:C},s)}function Fo(t,s){let f=0,E=t.length;while(f<E){let C=f+E>>>1;if(t[C].start<s)f=C+1;else E=C}return f}function Vn(t,s,f,E,C){while(E.index<f.length&&f[E.index].start<(t.start??0))t.leadingComments??=[],t.leadingComments.push(f[E.index]),E.index++;if(E.index>=f.length)return;let w=f[E.index].start,v=t.end,M=v===void 0||v>w?Object.keys(t):[];for(let U=0;U<M.length;U++){let V=M[U];if(V==="type"||V==="leadingComments")continue;let z=t[V];if(!z||typeof z!=="object")continue;if(Array.isArray(z)){for(let te of z)if(te&&typeof te==="object"&&typeof te.type==="string"){if(Vn(te,t,f,E,C),E.index>=f.length)return}}else if(typeof z.type==="string"){if(Vn(z,t,f,E,C),E.index>=f.length)return}}if(E.index<f.length){let U=f[E.index];if(s===void 0||t.end!==s.end){let V=C.slice(t.end??0,U.start);if((s?.type==="BlockStatement"||s?.type==="Program")&&qn(s.body,t)||s?.type==="ArrayExpression"&&qn(s.elements,t)||s?.type==="ObjectExpression"&&qn(s.properties,t))while(E.index<f.length){if(s&&f[E.index].start>=(s.end??Number.POSITIVE_INFINITY))break;E.index++}else if((t.end??0)<=U.start&&Oo.test(V))E.index++}}}function qn(t,s){return!!t&&t.indexOf(s)===t.length-1}var Lt=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"]),jo=new Set(["any","bigint","boolean","false","never","null","number","object","string","symbol","true","undefined","unknown","void"]),qo=new Set(["get","set","new","readonly","static","public","private","protected"]);function Ns(t){return t>=97&&t<=122||t>=65&&t<=90||t===95||t===36}function ws(t){return Ns(t)||t>=48&&t<=57}function $n(t){return t>=48&&t<=57}class Ds{pos=0;text;constructor(t){this.text=t}recognize(){if(this.skipSpaces(),!this.type())return!1;return this.skipSpaces(),this.pos===this.text.length}skipSpaces(){while(this.pos<this.text.length){let t=this.text.charCodeAt(this.pos);if(t!==32&&t!==9)break;this.pos++}}peek(){return this.skipSpaces(),this.text.charCodeAt(this.pos)}eat(t){if(this.peek()!==t.charCodeAt(0))return!1;return this.pos++,!0}identifier(){this.skipSpaces();let t=this.pos;if(!Ns(this.text.charCodeAt(t)))return;let s=t+1;while(s<this.text.length&&ws(this.text.charCodeAt(s)))s++;return this.pos=s,this.text.slice(t,s)}stringLiteral(){let t=this.peek();if(t!==34&&t!==39)return!1;for(let s=this.pos+1;s<this.text.length;s++){let f=this.text.charCodeAt(s);if(f===t)return this.pos=s+1,!0;if(f===92||f===10||f===13||f===8232||f===8233)return!1}return!1}numberLiteral(){let t=this.pos;if(this.text.charCodeAt(t)===45)t++;let s=t;while($n(this.text.charCodeAt(t)))t++;if(t===s||t-s>1&&this.text.charCodeAt(s)===48)return!1;if(this.text.charCodeAt(t)===46){let f=++t;while($n(this.text.charCodeAt(t)))t++;if(t===f)return!1}if(ws(this.text.charCodeAt(t))||this.text.charCodeAt(t)===46)return!1;return this.pos=t,!0}type(){if(this.peek()===40){let t=this.pos;if(this.functionType())return!0;this.pos=t}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 t=this.pos;if(this.identifier()==="keyof")return this.operatorType();if(this.pos=t,!this.primary())return!1;while(this.eat("[")){if(this.eat("]"))continue;if(!this.type()||!this.eat("]"))return!1}return!0}primary(){let t=this.peek();if(t===40)return this.pos++,this.type()&&this.eat(")");if(t===123)return this.objectType();if(t===91)return this.tupleType();if(t===34||t===39)return this.stringLiteral();if(t===45||$n(t))return this.numberLiteral();let s=this.identifier();if(s===void 0)return!1;if(s==="typeof")return this.typeofOperand();if(s==="import")return this.importType(!0);if(jo.has(s))return this.peek()!==46&&this.peek()!==60;if(Lt.has(s))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 t=this.pos;if(this.identifier()==="import")return this.importType(!1);return this.pos=t,this.entityName()}importType(t){if(!this.eat("(")||!this.stringLiteral()||!this.eat(")"))return!1;while(this.eat(".")){let s=this.identifier();if(s===void 0||Lt.has(s))return!1}if(t&&this.eat("<")){do if(!this.type())return!1;while(this.eat(","));return this.eat(">")}return!0}entityName(){do{let t=this.identifier();if(t===void 0||Lt.has(t))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 t=this.identifier();if(t===void 0||Lt.has(t))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 t=this.identifier();if(t===void 0||qo.has(t))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 t=new Set;if(!this.eat(")")){do{this.skipSpaces();let s=this.text.startsWith("...",this.pos);if(s)this.pos+=3;let f=this.identifier();if(f===void 0||Lt.has(f)||t.has(f))return!1;if(t.add(f),!s)this.eat("?");if(!this.eat(":")||!this.type())return!1;if(s)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 Ls(t){return new Ds(t).recognize()}var nn={sawParenthesized:!1},_s=(t)=>class extends t{parseParenAndDistinguishExpression(s,f){let E=super.parseParenAndDistinguishExpression(s,f);if(E.type==="ParenthesizedExpression")nn.sawParenthesized=!0;return E}parseDecorator(){return nn.sawParenthesized=!0,super.parseDecorator()}},Os=(t)=>class extends t{checkLocalExport(){}},Vo=r.extend(_s,Os),Bs=r.extend(vs(),_s,Os);function Jn(t){return t?Bs:Vo}var Ho={onComment:tn,sourceType:"module",ecmaVersion:16},Fs={onComment:tn,sourceType:"module",ecmaVersion:16,preserveParens:!0},$o={sourceType:"module",ecmaVersion:16},Uo={onComment:tn,sourceType:"module",ecmaVersion:16},Is={...Fs,startLocation:null},Un=/\r\n?|\n|\u2028|\u2029/g;function Go(t,s){if(s?.breakEnds)return s.breakEnds;let f=[];Un.lastIndex=0;while(Un.test(t))f.push(Un.lastIndex);if(s)s.breakEnds=f;return f}function Wo(t,s,f){let E=t.lastIndexOf(`
25
+ `,s-1)+1,C=Go(t,f),w=0,v=C.length;while(w<v){let I=w+v>>>1;if(C[I]<=E)w=I+1;else v=I}return{line:w+1,column:s-E}}function js(t,s,f,E,C){if(f.length===C)return;Hn(t,s,f,E)}function de(t,s,f){let E=f.length;en(t,f);let C=Jn(s).parse(t,Ho);if(f.length>0)Hn(C,t,f,E);return C}var Ms=new Map;function qs(t){if(Ls(t))return!0;let s=Ms.get(t);if(s!==void 0)return s;let f;try{f=Bs.parse(`type T = ${t}
26
+ ;`,$o).body.length===1}catch{f=!1}return Ms.set(t,f),f}var Jo={count:0};function gt(t,s,f,E,C){Jo.count+=1;let w=E.length;en(t,E),nn.sawParenthesized=!1;let v=Fs;if(f)Is.startLocation=Wo(t,s,C),v=Is;let I=Jn(f).parseExpressionAt(t,s,v);js(I,t,E,s,w);let M=E.length>w?E.at(-1):void 0,U=M&&M.end>(I.end??0)?M.end:I.end??0;return{node:nn.sawParenthesized?zo(I):I,end:U}}function Vs(t,s,f,E){let C=E.length,w=Jn(f);en(t,E);let v=new w(Uo,t,s);v.nextToken();let I=v.parseStatement(null,!0,Object.create(null));return js(I,t,E,s,C),I}function Rs(t){return t!==null&&typeof t==="object"&&typeof t.type==="string"}function Gn(t){let s=t;while(s.type==="ParenthesizedExpression"&&s.expression)s=s.expression;return s}function zo(t){let s=Gn(t);return Wn(s),s}function Wn(t){for(let s in t){let f=t[s];if(!f||typeof f!=="object")continue;if(Array.isArray(f))for(let E=0;E<f.length;E++){let C=f[E];if(!Rs(C))continue;let w=Gn(C);if(w!==C)f[E]=w;Wn(w)}else if(Rs(f)){let E=Gn(f);if(E!==f)t[s]=E;Wn(E)}}}var Ko={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 Hs(t,s){let f=Ko[t];if(!f)return!1;if(!s)return!0;return(f.direct??f.descendant??[]).includes(s)}function dt(t){if(t===32||t<=13&&t>=9)return!0;if(t<160)return!1;return t===160||t===5760||t>=8192&&t<=8202||t===8232||t===8233||t===8239||t===8287||t===12288||t===65279}class zn{source;index=0;constructor(t){this.source=t}match(t){if(t.length===1)return this.source.charCodeAt(this.index)===t.charCodeAt(0);return this.source.startsWith(t,this.index)}matchRegex(t){t.lastIndex=this.index;let s=t.exec(this.source);if(!s||s.index!==this.index)return null;return s[0]}eat(t,s=!1){if(this.match(t))return this.index+=t.length,!0;if(s)throw new lt(`Expected token ${JSON.stringify(t)}`,this.index);return!1}read(t){let s=this.matchRegex(t);if(s)this.index+=s.length;return s}readUntil(t){if(this.index>=this.source.length)throw new lt("Unexpected end of input",this.source.length);let s=this.index;t.lastIndex=s;let f=t.exec(this.source);if(f)return this.index=f.index,this.source.slice(s,this.index);return this.index=this.source.length,this.source.slice(s)}readUntilString(t){if(this.index>=this.source.length)throw new lt("Unexpected end of input",this.source.length);let s=this.source.indexOf(t,this.index),f=s===-1?this.source.length:s,E=this.source.slice(this.index,f);return this.index=f,E}allowWhitespace(){while(this.index<this.source.length&&dt(this.source.charCodeAt(this.index)))this.index++}requireWhitespace(){if(!dt(this.source.charCodeAt(this.index)))throw new lt("Expected whitespace",this.index);this.allowWhitespace()}readIdentifierName(){let t=this.index,s=t,f="",E=this.source.codePointAt(this.index);if(E!==void 0&&a(E,!0)){s+=E<=65535?1:2;while(s<this.source.length){let C=this.source.codePointAt(s);if(C===void 0||!c(C,!0))break;s+=C<=65535?1:2}f=this.source.slice(t,s),this.index=s}return{type:"Identifier",name:f,start:t,end:s}}}class lt extends Error{position;constructor(t,s){super(`${t} (at index ${s})`);this.name="TemplateSyntaxError",this.position=s}}function $e(){return{type:"Fragment",nodes:[]}}var Xo=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"]),Yo=["&&","||","??"],Qo=["===","!==","==","!="];function $s(t,s){let f=t.codePointAt(s);if(f===void 0||!a(f,!0))return s;let E=s+(f<=65535?1:2);while(E<t.length){let C=t.codePointAt(E);if(!c(C,!0))break;E+=C<=65535?1:2}return E}function Zo(t,s){let f=s;while(f<t.length){let E=t.charCodeAt(f);if(E<48||E>57)break;f++}return f}function rn(t,s){let f=s;while(f<t.length&&dt(t.charCodeAt(f)))f++;return f}function Us(t,s){let f=Zo(t,s);if(f===s)return null;if(t.charCodeAt(s)===48&&f-s>1)return null;if(f<t.length){let C=t.codePointAt(f);if(C===46||c(C,!0))return null}let E=t.slice(s,f);return{type:"Literal",start:s,end:f,value:Number(E),raw:E}}function Gs(t,s){let f=t.charCodeAt(s),E=s+1;while(E<t.length){let C=t.charCodeAt(E);if(C===f){let w=t.slice(s,E+1);return{type:"Literal",start:s,end:E+1,value:t.slice(s+1,E),raw:w}}if(C===92||C===10||C===13)return null;E++}return null}function ep(t,s){let f=t.charCodeAt(s);if(f===34||f===39)return Gs(t,s);let E=$s(t,s);if(E===s)return Us(t,s);let C=t.slice(s,E);if(C==="true"||C==="false")return{type:"Literal",start:s,end:E,value:C==="true",raw:C};if(C==="null")return{type:"Literal",start:s,end:E,value:null,raw:C};if(Xo.has(C))return null;let w={type:"Identifier",start:s,end:E,name:C},v=E;while(v<t.length){let I=t.charCodeAt(v);if(I===46){let M=v+1,U=$s(t,M);if(U===M)return null;let V={type:"Identifier",start:M,end:U,name:t.slice(M,U)};w={type:"MemberExpression",start:s,end:U,object:w,property:V,computed:!1,optional:!1},v=U}else if(I===91){let M=v+1,U=t.charCodeAt(M),V=U===34||U===39?Gs(t,M):Us(t,M);if(!V||t.charCodeAt(V.end)!==93)return null;w={type:"MemberExpression",start:s,end:V.end+1,object:w,property:V,computed:!0,optional:!1},v=V.end+1}else break}return w}function Kn(t,s){if(t.charCodeAt(s)!==33||t.charCodeAt(s+1)===61)return ep(t,s);let f=Kn(t,rn(t,s+1));if(!f)return null;return{type:"UnaryExpression",start:s,end:f.end,operator:"!",prefix:!0,argument:f}}function tp(t,s){for(let f of Qo)if(t.startsWith(f,s))return{operator:f,logical:!1};for(let f of Yo)if(t.startsWith(f,s))return{operator:f,logical:!0};return null}function Ws(t,s){let f=rn(t,s);if(f>=t.length)return!1;let E=t.charCodeAt(f);return E===125||E===41}function np(t){let s=t.source,f=Kn(s,t.index);if(!f)return null;if(Ws(s,f.end))return t.index=f.end,f;let E=rn(s,f.end),C=tp(s,E);if(!C)return null;let w=Kn(s,rn(s,E+C.operator.length));if(!w||!Ws(s,w.end))return null;return t.index=w.end,{type:C.logical?"LogicalExpression":"BinaryExpression",start:f.start,end:w.end,left:f,operator:C.operator,right:w}}function Fe(t){let s=np(t);if(s)return s;let{node:f,end:E}=gt(t.source,t.index,t.isTypeScript,t.root.comments,t.lineTable);return t.index=E,f}var rp={"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},Xn=rp;var sp=[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 ip(t,s){if(s&&!t.endsWith(";"))return`${t}\\b(?!=)`;return t}function Js(t){let f=Object.keys(Xn).map((E)=>ip(E,t));return new RegExp(`&(#(?:x[a-fA-F\\d]+|\\d+)(?:;)?|${f.join("|")})`,"g")}var Yn,Qn;function ap(t){if(t){if(!Qn)Qn=Js(!0);return Qn}if(!Yn)Yn=Js(!1);return Yn}var zs=0;function op(t){if(t===10)return 32;if(t<128)return t;if(t<=159)return sp[t-128];if(t<55296)return t;if(t<=57343)return zs;if(t<=65535)return t;if(t>=65536&&t<=131071)return t;if(t>=131072&&t<=196607)return t;if(t>=917504&&t<=917631||t>=917760&&t<=917999)return t;return zs}function Zn(t,s){if(t.indexOf("&")===-1)return t;return t.replace(ap(s),(f,E)=>{let C;if(E[0]!=="#")C=Xn[E];else if(E[1]==="x")C=Number.parseInt(E.substring(2),16);else C=Number.parseInt(E.substring(1),10);if(!C)return f;return String.fromCodePoint(op(C))})}var pp=/<\/script\s*>/g,lp=/<\/script\s*>/y,cp=/[^\n]/g,up=new Set(["server","client","worker","test","default"]);function Ks(t,s,f){let E=t.index,C=t.readUntil(pp);if(t.index>=t.source.length)throw Error("sveld: unclosed <script> tag");let w=t.source.slice(0,E).replace(cp," ")+C;t.read(lp);let v=de(w,t.isTypeScript,t.root.comments);v.start=E;let I="default";for(let M of f){if(up.has(M.name))throw Error(`sveld: "${M.name}" is a reserved <script> attribute name.`);if(M.name==="module"){if(M.value!==!0)throw Error("sveld: <script module> does not take a value.");I="module"}if(M.name==="context"){let U=M.value;if(U===!0||!Array.isArray(U)||U.length!==1||U[0].type!=="Text")throw Error("sveld: context attribute must be a plain string.");if(U[0].data!=="module")throw Error('sveld: only context="module" is valid.');I="module"}}return{type:"Script",start:s,end:t.index,context:I,content:v,attributes:f}}function Xs(t,s,f){let E=t.index,C=t.source.indexOf("</style",t.index),w=C===-1?t.source.length:C;return t.index=w,t.eat("</style",!0),t.read(/\s*>/y),{type:"StyleSheet",start:s,end:t.index,attributes:f,children:[],comments:[],content:{start:E,end:w,styles:t.source.slice(E,w),comment:null}}}var dp=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]);function er(t){return dp.has(t)||t.charCodeAt(0)===33&&t.toLowerCase()==="!doctype"}var fp="^[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}]*)?$",mp=new RegExp(fp,"u");function Ys(t){return mp.test(t)}var hp=/(?:"([^"]*)"|'([^'])*'|([^>\s]+))/y,ni=/["']/y,yp=/(\/>|[\s"'=<>`])/y,tr=/<\/textarea(\s[^>]*)?>/iy,gp=/^![a-zA-Z]+$/,Tp=/^[a-zA-Z][a-zA-Z0-9]*:[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$/,bp=/^(?:\p{Lu}[$\u200c\u200d\p{ID_Continue}.]*|\p{ID_Start}[$\u200c\u200d\p{ID_Continue}]*(?:\.[$\u200c\u200d\p{ID_Continue}]+)+)$/u,ri={"svelte:head":"SvelteHead","svelte:options":"SvelteOptions","svelte:window":"SvelteWindow","svelte:document":"SvelteDocument","svelte:body":"SvelteBody"},Qs={...ri,"svelte:element":"SvelteElement","svelte:component":"SvelteComponent","svelte:self":"SvelteSelf","svelte:fragment":"SvelteFragment","svelte:boundary":"SvelteBoundary"};function xp(t){let s=t.charCodeAt(0);if(s<97||s>122)return!1;for(let f=1;f<t.length;f++){let E=t.charCodeAt(f);if((E<97||E>122)&&(E<48||E>57))return!1}return!0}function Sp(t){if(xp(t))return!0;if(gp.test(t))return!0;if(Tp.test(t))return!0;return Ys(t)}function Ep(t){let s=t.charCodeAt(0);if(s>=97&&s<=122&&!t.includes("."))return!1;return!0}function Pp(t){return`Svelte${t.slice(7).split("-").map((f)=>f.charAt(0).toUpperCase()+f.slice(1)).join("")}`}function Ap(t){for(let s=t.length-1;s>=0;s--){let f=t[s].type;if(f==="SvelteHead")return!0;if(f==="RegularElement"||f==="Component")return!1}return!1}function Cp(t){for(let s=t.length-1;s>=0;s--){let f=t[s];if(f.type==="RegularElement"&&f.attributes?.some((E)=>E.type==="Attribute"&&E.name==="shadowrootmode"))return!0}return!1}function Zs(t){let{source:s,index:f}=t;if(f>=s.length)throw new lt("Unexpected end of input",s.length);let E=f;while(E<s.length){let C=s.charCodeAt(E);if(C===47||C===62||dt(C))break;E++}return t.index=E,{name:s.slice(f,E),start:f,end:E}}function si(t){let{source:s,index:f}=t;if(f>=s.length)throw new lt("Unexpected end of input",s.length);let E=f;while(E<s.length){let C=s.charCodeAt(E);if(C===61||C===47||C===62||C===34||C===39||dt(C))break;E++}return t.index=E,{name:s.slice(f,E),start:f,end:E}}function vp(t){let s=t.index;if(t.eat("//")){let f=t.readUntilString(`
27
+ `),E=t.index;t.root.comments.push({type:"Line",value:f,start:s,end:E});return}if(t.eat("/*")){let f=t.readUntilString("*/");t.eat("*/");let E=t.index;t.root.comments.push({type:"Block",value:f,start:s,end:E})}}function kp(t){if(t==="use")return"UseDirective";if(t==="animate")return"AnimateDirective";if(t==="bind")return"BindDirective";if(t==="class")return"ClassDirective";if(t==="style")return"StyleDirective";if(t==="on")return"OnDirective";if(t==="let")return"LetDirective";if(t==="in"||t==="out"||t==="transition")return"TransitionDirective";return!1}function ii(t,s,f){let E={start:t.index,end:-1,type:"Text",raw:"",data:""},C=[],w=(v)=>{if(v>E.start)E.raw=t.source.slice(E.start,v),E.data=Zn(E.raw,!0),E.end=v,C.push(E)};while(t.index<t.source.length){if(s())return w(t.index),C;if(t.eat("{")){if(t.match("#")||t.match("@"))throw new S("blocks/tags inside attribute value sequences");let v=t.index-1;w(v),t.allowWhitespace();let I=Fe(t);t.allowWhitespace(),t.eat("}",!0),C.push({type:"ExpressionTag",start:v,end:t.index,expression:I}),E={start:t.index,end:-1,type:"Text",raw:"",data:""}}else{let v=t.index+1;if(f!==void 0){let I=t.source;while(v<I.length){let M=I.charCodeAt(v);if(M===123||M===f)break;v++}}t.index=v}}throw new S("unterminated attribute value / sequence (loose mode)")}function wp(t){let s=t.eat("'")?"'":t.eat('"')?'"':null;if(s&&t.eat(s))return[{start:t.index-1,end:t.index-1,type:"Text",raw:"",data:""}];let f=ii(t,()=>{if(s)return t.match(s);return!!t.matchRegex(yp)},s===null?void 0:s.charCodeAt(0));if(f.length===0&&!s)throw Error("sveld: expected attribute value");if(s)t.index+=1;if(s||f.length>1||f[0].type==="Text")return f;return f[0]}function nr(t,s,f,E){return{type:"Attribute",start:s,end:f,name:t,value:E}}function Np(t){let s=t.index,f=si(t);if(!f.name)return null;let E=!0;if(t.eat("=")){t.allowWhitespace();let C=t.matchRegex(hp);if(!C)throw Error("sveld: expected attribute value");t.index+=C.length;let w=C[0]==='"'||C[0]==="'";if(w)C=C.slice(1,-1);E=[{start:t.index-C.length-(w?1:0),end:w?t.index-1:t.index,type:"Text",raw:C,data:Zn(C,!0)}]}if(t.matchRegex(ni))throw Error("sveld: expected '='");return nr(f.name,s,t.index,E)}function Dp(t){while(!0){let I=t.index;if(vp(t),t.index===I)break;t.allowWhitespace()}let s=t.index;if(t.eat("{")){if(t.allowWhitespace(),t.eat("@attach")){t.requireWhitespace();let U=Fe(t);return t.allowWhitespace(),t.eat("}",!0),{type:"AttachTag",start:s,end:t.index,expression:U}}if(t.eat("...")){let U=Fe(t);return t.allowWhitespace(),t.eat("}",!0),{type:"SpreadAttribute",start:s,end:t.index,expression:U}}let I=t.readIdentifierName();if(I.name==="")throw Error("sveld: empty attribute shorthand");t.allowWhitespace(),t.eat("}",!0);let M={type:"ExpressionTag",start:I.start,end:I.end,expression:I};return nr(I.name,s,t.index,M)}let f=si(t);if(!f.name)return null;let E=t.index;t.allowWhitespace();let C=f.name.indexOf(":"),w=C!==-1&&kp(f.name.slice(0,C)),v=!0;if(t.eat("="))if(t.allowWhitespace(),t.source[t.index]==="/"&&t.source[t.index+1]===">"){let I=t.index;t.index++,v=[{start:I,end:I+1,type:"Text",raw:"/",data:"/"}],E=t.index}else v=wp(t),E=t.index;else if(t.matchRegex(ni))throw Error("sveld: expected '='");if(w){let I=f.name.slice(C+1).split("|",1)[0];if(I==="")throw Error("sveld: directive missing a name");if(w==="StyleDirective")return{start:s,end:E,type:w,name:I,value:v};let M=v===!0?void 0:Array.isArray(v)?v[0]:v,U=null;if(M){if((Array.isArray(v)?v.length>1:!1)||M.type==="Text")throw Error("sveld: directive value must be a single expression");U=M.expression}let V={start:s,end:E,type:w,name:I,expression:U};if((V.type==="BindDirective"||V.type==="ClassDirective")&&!V.expression)V.expression={start:s+C+1,end:E,type:"Identifier",name:V.name};return V}return nr(f.name,s,E,v)}function ai(t){let s=t.index++,f=t.current();if(t.eat("!--")){let te=t.readUntilString("-->");t.eat("-->",!0),t.append({type:"Comment",start:s,end:t.index,data:te});return}if(t.eat("/")){let{name:te}=Zs(t);if(t.allowWhitespace(),t.eat(">",!0),er(te))throw Error(`sveld: <${te}> is a void element and cannot have a closing tag`);while(f.name!==te){if(f.type==="RegularElement");else throw Error(`sveld: invalid closing tag </${te}>`);f.end=s,t.pop(),f=t.current()}if(f.end=t.index,t.pop(),t.lastAutoClosedTag&&t.stack.length<t.lastAutoClosedTag.depth)t.lastAutoClosedTag=void 0;return}let E=Zs(t),C=Ep(E.name)&&bp.test(E.name);if(!Sp(E.name)&&!C)throw Error(`sveld: "${E.name}" is not a valid element or component name`);if(E.name in ri&&f.type!=="Root")throw Error(`sveld: <${E.name}> must be a top-level element`);let w;if(E.name in Qs)w=Qs[E.name];else if(E.name.startsWith("svelte:"))w=Pp(E.name);else if(C)w="Component";else if(E.name==="title"&&Ap(t.stack))w="TitleElement";else if(E.name==="slot"&&!Cp(t.stack))w="SlotElement";else w="RegularElement";let v={type:w,start:s,end:-1,name:E.name,attributes:[],fragment:{type:"Fragment",nodes:[]}};if(t.allowWhitespace(),f.type==="RegularElement"&&Hs(f.name,E.name))f.end=s,t.pop(),t.lastAutoClosedTag={tag:f.name,reason:E.name,depth:t.stack.length},f=t.current();let I=t.current(),M=(E.name==="script"||E.name==="style")&&I.type==="Root",U=M?Np:Dp,V;while(V=U(t))v.attributes.push(V),t.allowWhitespace();if(v.type==="SvelteComponent")v.expression=ti(ei(v));if(v.type==="SvelteElement"){let te=ei(v);if(te.value===!0)throw Error("sveld: <svelte:element> `this` attribute needs a value");if(Ip(te))v.tag=ti(te);else{let Q=te.value[0];v.tag=Q.type==="Text"?{type:"Literal",value:Q.data,raw:`'${Q.raw}'`,start:Q.start,end:Q.end}:Q.expression}}if(M){t.eat(">",!0);let te=Lp(t.root.fragment.nodes,s);if(E.name==="script"){let Q=Ks(t,s,v.attributes);if(te)Q.content.leadingComments=[{type:"Line",value:te.data}];if(Q.context==="module"){if(t.root.module)throw Error("sveld: duplicate <script module>");t.root.module=Q}else{if(t.root.instance)throw Error("sveld: duplicate <script>");t.root.instance=Q}}else{if(t.root.css)throw Error("sveld: duplicate <style>");let Q=Xs(t,s,v.attributes);Q.content.comment=te,t.root.css=Q}return}t.append(v);let z=t.eat("/")||er(E.name);if(t.eat(">",!0),z)v.end=t.index;else if(E.name==="textarea")v.fragment.nodes=ii(t,()=>(tr.lastIndex=t.index,tr.test(t.source))),t.read(tr),v.end=t.index;else t.push(v,v.fragment)}function Lp(t,s){for(let f=t.length-1;f>=0;f--){let E=t[f];if(f===t.length-1&&E.end!==s)break;if(E.type==="Comment")return E;if(E.type!=="Text"||E.data.trim())break}return null}function ei(t){let s=t.attributes,f=s.findIndex((E)=>E.type==="Attribute"&&E.name==="this");if(f===-1)throw Error(`sveld: <${t.name}> requires a \`this\` attribute`);return s.splice(f,1)[0]}function ti(t){return Array.isArray(t.value)?t.value[0].expression:t.value.expression}function Ip(t){return t.value!==!0&&!Array.isArray(t.value)||Array.isArray(t.value)&&t.value.length===1&&t.value[0].type==="ExpressionTag"}function oi(t){let s={start:t.start,end:t.end,attributes:t.attributes};for(let f of t.attributes){if(f.type!=="Attribute")continue;if(f.name==="runes"){let E=pi(f);if(typeof E==="boolean")s.runes=E}if(f.name==="customElement"){let E=_p(f);if(E!==void 0)s.customElement=E}}return s}function pi(t){let{value:s}=t;if(s===!0)return!0;let f=Array.isArray(s)?s[0]:s;if(!f)return!0;if(Array.isArray(s)&&s.length>1)return null;if(f.type==="Text")return f.data;if(f.expression.type!=="Literal")return null;return f.expression.value}var Mp=new Set(["String","Boolean","Number","Array","Object"]);function rr(t){let s=[];for(let f of t.properties){if(!f||typeof f!=="object"||f.type!=="Property"||f.computed||f.key?.type!=="Identifier")continue;let{key:E,value:C}=f;s.push([E.name,C])}return s}function Rp(t){let s={};if(!t||typeof t!=="object"||t.type!=="ObjectExpression")return s;for(let[f,E]of rr(t)){if(!E||typeof E!=="object"||E.type!=="Literal")continue;let C=E.value;if(f==="attribute"&&typeof C==="string")s.attribute=C;else if(f==="reflect"&&typeof C==="boolean")s.reflect=C;else if(f==="type"&&typeof C==="string"&&Mp.has(C))s.type=C}return s}function _p(t){let{value:s}=t;if(s===!0)return;let f=Array.isArray(s)?s[0]:s;if(!f)return;if(f.type==="Text"){let V=pi(t);return typeof V==="string"?{tag:V}:void 0}let E=f.expression;if(E.type==="Literal"&&E.value===null)return;if(E.type!=="ObjectExpression")return;let C=rr(E),w={},v=C.find(([V])=>V==="tag")?.[1];if(v&&typeof v==="object"&&v.type==="Literal"&&typeof v.value==="string")w.tag=v.value;let I=C.find(([V])=>V==="props")?.[1];if(I&&typeof I==="object"&&I.type==="ObjectExpression"){w.props={};for(let[V,z]of rr(I))w.props[V]=Rp(z)}let M=C.find(([V])=>V==="shadow")?.[1];if(M&&typeof M==="object"){let V=M;if(V.type==="Literal"&&(V.value==="open"||V.value==="none"))w.shadow=V.value;else if(V.type==="ObjectExpression")w.shadow=M}let U=C.find(([V])=>V==="extend")?.[1];if(U!==void 0)w.extend=U;return w}var Op=/<script\s+(?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?ts\1[^>]*>/;class sr extends zn{root;stack=[];fragments=[];isTypeScript;lineTable={};lastAutoClosedTag;constructor(t,s){super(t);this.isTypeScript=Op.test(t);let f=$e();this.root={type:"Root",start:0,end:s,css:null,js:[],options:null,fragment:f,comments:[]},this.stack.push(this.root),this.fragments.push(f)}current(){return this.stack[this.stack.length-1]}currentFragment(){return this.fragments[this.fragments.length-1]}push(t,s){this.stack.push(t),this.fragments.push(s)}pop(){return this.fragments.pop(),this.stack.pop()}append(t){return this.currentFragment().nodes.push(t),t}}var ir={"{":"}","(":")","[":"]"},Bp=new Set(Object.values(ir));function It(t,s,f=ir){let E=f===ir?Bp:new Set(Object.values(f)),C=[],w=s;while(w<t.source.length){let v=t.source[w++];if(v==="'"||v==='"'||v==="`"){w=Fp(t,w,v);continue}if(Object.hasOwn(f,v))C.push(v);else if(E.has(v)){let I=C.pop(),M=I?f[I]:void 0;if(v!==M)throw Error(`sveld: expected "${M}"`);if(C.length===0)return w}}throw Error("sveld: unexpected end of input")}function Fp(t,s,f){let E=!1,C=s;while(C<t.source.length){let w=t.source[C++];if(E){E=!1;continue}if(w===f)return C;if(w==="\\")E=!0;if(f==="`"&&w==="$"&&t.source[C]==="{")C=It(t,C)}throw Error("sveld: unterminated string constant")}var ci=/[^\n]/g,jp=/\?\s*:/g;function ct(t){let s=t.index,f=t.readIdentifierName();if(f.name!==""){let te=li(t);return{...f,typeAnnotation:te}}let E=t.source[t.index];if(E!=="{"&&E!=="[")throw Error("sveld: expected a binding pattern");let C=It(t,s);t.index=C;let w=t.source.slice(s,C),v=t.source.slice(0,s).replace(ci," "),I=v.indexOf(" ");v=v.slice(0,I)+v.slice(I+1);let M=`${v}(${w} = 1)`,{node:U}=gt(M,s-1,t.isTypeScript,t.root.comments),V=U.left,z=li(t);if(z)V.typeAnnotation=z,V.end=z.end;return V}function li(t){let s=t.index;if(t.allowWhitespace(),!t.eat(":")){t.index=s;return}let f="_ as ",E=t.index-f.length,C=t.source.slice(0,E).replace(ci," ")+f+t.source.slice(t.index).replace(jp,":"),{node:w}=gt(C,E,t.isTypeScript,t.root.comments),v=w;if(v.type==="AssignmentExpression"){let I=v.right.start;while(C[I]!=="=")I-=1;({node:w}=gt(C.slice(0,I),E,t.isTypeScript,t.root.comments)),v=w}if(v.type==="SequenceExpression"&&v.expressions)v=v.expressions[0];return t.index=v.end,{type:"TSTypeAnnotation",start:s,end:t.index,typeAnnotation:v.typeAnnotation}}var ui=/\s*}/y,qp={"<":">"};function di(t){let s=t.index-2;while(t.source[s]!=="{")s-=1;if(t.eat("if")){t.requireWhitespace();let f={type:"IfBlock",elseif:!1,start:s,end:-1,test:Fe(t),consequent:$e(),alternate:null};t.append(f),t.allowWhitespace(),t.eat("}",!0),t.push(f,f.consequent);return}if(t.eat("each")){t.requireWhitespace();let f=Fe(t);if(t.allowWhitespace(),!t.match("as")){let I=f;if(I.type==="SequenceExpression"&&I.expressions)I=I.expressions[0];if(I.type==="TSAsExpression"){let M=I;f=M.expression;let U=M.typeAnnotation.start-2;while(U>=0&&!(t.source[U]==="a"&&t.source[U+1]==="s"))U-=1;t.index=U}}let E=null,C,w;if(t.eat("as"))t.requireWhitespace(),E=ct(t);if(t.allowWhitespace(),t.eat(",")){t.allowWhitespace();let I=t.readIdentifierName();if(!I.name)throw Error("sveld: expected an identifier");C=I.name,t.allowWhitespace()}if(t.eat("("))t.allowWhitespace(),w=Fe(t),t.allowWhitespace(),t.eat(")",!0),t.allowWhitespace();t.eat("}",!0);let v={type:"EachBlock",start:s,end:-1,expression:f,body:$e(),context:E,index:C,key:w};t.append(v),t.push(v,v.body);return}if(t.eat("await")){t.requireWhitespace();let f=Fe(t);t.allowWhitespace();let E={type:"AwaitBlock",start:s,end:-1,expression:f,value:null,error:null,pending:null,then:null,catch:null};if(t.eat("then")){if(!t.matchRegex(ui))t.requireWhitespace(),E.value=ct(t),t.allowWhitespace();E.then=$e()}else if(t.eat("catch")){if(!t.matchRegex(ui))t.requireWhitespace(),E.error=ct(t),t.allowWhitespace();E.catch=$e()}else E.pending=$e();t.eat("}",!0),t.append(E),t.push(E,E.then??E.catch??E.pending);return}if(t.eat("key")){t.requireWhitespace();let f=Fe(t);t.allowWhitespace(),t.eat("}",!0);let E={type:"KeyBlock",start:s,end:-1,expression:f,fragment:$e()};t.append(E),t.push(E,E.fragment);return}if(t.eat("snippet")){t.requireWhitespace();let f=t.readIdentifierName();if(f.name==="")throw Error("sveld: expected a snippet name");t.allowWhitespace();let E;if(t.isTypeScript&&t.match("<")){let w=t.index,v=It(t,w,qp);E=t.source.slice(w+1,v-1),t.index=v}if(t.allowWhitespace(),t.eat("(")){let w=1;while(t.index<t.source.length&&(!t.match(")")||w!==1)){if(t.match("("))w++;if(t.match(")"))w--;t.index+=1}t.eat(")",!0)}t.allowWhitespace(),t.eat("}",!0);let C={type:"SnippetBlock",start:s,end:-1,expression:f,typeParams:E,parameters:[],body:$e()};t.append(C),t.push(C,C.body);return}throw Error("sveld: expected if/each/await/key/snippet")}function fi(t){let s=t.index-1,f=t.current();if(f.type==="IfBlock"){if(!t.eat("else"))throw Error("sveld: expected {:else} or {:else if}");if(t.eat("if"))throw Error("sveld: {:else if} cannot follow {:else if} directly");if(t.allowWhitespace(),t.fragments.pop(),f.alternate=$e(),t.fragments.push(f.alternate),t.eat("if")){t.requireWhitespace();let E=Fe(t);t.allowWhitespace(),t.eat("}",!0);let C=s-1;while(t.source[C]!=="{")C-=1;let w={type:"IfBlock",start:C,end:-1,elseif:!0,test:E,consequent:$e(),alternate:null};t.append(w),t.stack.push(w),t.fragments.pop(),t.fragments.push(w.consequent)}else t.allowWhitespace(),t.eat("}",!0);return}if(f.type==="EachBlock"){if(!t.eat("else"))throw Error("sveld: expected {:else}");t.allowWhitespace(),t.eat("}",!0),f.fallback=$e(),t.fragments.pop(),t.fragments.push(f.fallback);return}if(f.type==="AwaitBlock"){if(t.eat("then")){if(f.then)throw Error("sveld: duplicate {:then}");if(!t.eat("}"))t.requireWhitespace(),f.value=ct(t),t.allowWhitespace(),t.eat("}",!0);f.then=$e(),t.fragments.pop(),t.fragments.push(f.then);return}if(t.eat("catch")){if(f.catch)throw Error("sveld: duplicate {:catch}");if(!t.eat("}"))t.requireWhitespace(),f.error=ct(t),t.allowWhitespace(),t.eat("}",!0);f.catch=$e(),t.fragments.pop(),t.fragments.push(f.catch);return}throw Error("sveld: expected {:then ...} or {:catch ...}")}throw Error("sveld: {:...} not valid here")}function mi(t){let s=t.current();switch(s.type){case"IfBlock":{t.eat("if",!0),t.allowWhitespace(),t.eat("}",!0);while(s.type==="IfBlock"&&s.elseif)s.end=t.index,t.stack.pop(),s=t.current();s.end=t.index,t.pop();return}case"EachBlock":t.eat("each",!0);break;case"KeyBlock":t.eat("key",!0);break;case"AwaitBlock":t.eat("await",!0);break;case"SnippetBlock":t.eat("snippet",!0);break;default:throw Error("sveld: unexpected closing block tag")}t.allowWhitespace(),t.eat("}",!0),s.end=t.index,t.pop()}var Vp=/(?:let|const)\b/y,Hp=/(?:var|interface|enum)\b/y,$p=/type\b/y;function hi(t){let s=t.index;if(t.matchRegex(Hp))throw Error("sveld: `var`/`interface`/`enum` are not valid here");if(!t.matchRegex(Vp)&&!t.matchRegex($p))return null;let f=t.root.comments.length,E=Vs(t.source,s,t.isTypeScript,t.root.comments);if(E.type!=="VariableDeclaration"){if(E.type==="ExpressionStatement")return t.root.comments.length=f,null;throw Error("sveld: expected a `let`/`const` declaration")}if(E.kind!=="let"&&E.kind!=="const")throw Error("sveld: expected a `let`/`const` declaration");return t.index=E.end,t.allowWhitespace(),t.eat("}",!0),E}var Up=/\s*}/y;function yi(t){let s=t.index;while(t.source[s]!=="{")s-=1;if(t.eat("html")){t.requireWhitespace();let f=Fe(t);t.allowWhitespace(),t.eat("}",!0);let E={type:"HtmlTag",start:s,end:t.index,expression:f};t.append(E);return}if(t.eat("debug")){let f;if(t.read(Up))f=[];else{let C=Fe(t);f=C.type==="SequenceExpression"?C.expressions:[C];for(let w of f)if(w.type!=="Identifier")throw Error("sveld: {@debug} arguments must be identifiers");t.allowWhitespace(),t.eat("}",!0)}let E={type:"DebugTag",start:s,end:t.index,identifiers:f};t.append(E);return}if(t.eat("const")){t.requireWhitespace();let f=ct(t);t.allowWhitespace(),t.eat("=",!0),t.allowWhitespace();let E=Fe(t),C=t.index;t.allowWhitespace(),t.eat("}",!0);let w={type:"VariableDeclarator",id:f,init:E,start:f.start,end:C},v={type:"ConstTag",start:s,end:t.index,declaration:{type:"VariableDeclaration",kind:"const",declarations:[w],start:s+2,end:t.index-1}};t.append(v);return}if(t.eat("render")){t.requireWhitespace();let f=Fe(t);if(!(f.type==="CallExpression"||f.type==="ChainExpression"&&f.expression.type==="CallExpression"))throw Error("sveld: {@render ...} must be a function call");t.allowWhitespace(),t.eat("}",!0);let C={type:"RenderTag",start:s,end:t.index,expression:f};t.append(C);return}throw Error("sveld: expected html/debug/const/render")}function gi(t){let s=t.index;if(t.index+=1,t.allowWhitespace(),t.eat("#")){di(t);return}if(t.eat(":")){fi(t);return}if(t.eat("@")){yi(t);return}if(t.match("/")&&!t.match("/*")&&!t.match("//")){t.eat("/"),mi(t);return}let f=hi(t);if(f){let w={type:"DeclarationTag",start:s,end:t.index,declaration:f};t.append(w);return}let E=Fe(t);t.allowWhitespace(),t.eat("}",!0);let C={type:"ExpressionTag",start:s,end:t.index,expression:E};t.append(C)}function Ti(t){let{index:s,source:f}=t,E=f.indexOf("<",s),C=f.indexOf("{",s),w;if(E===-1)w=C===-1?f.length:C;else w=C===-1?E:Math.min(E,C);t.index=w;let v=f.slice(s,w),I={type:"Text",start:s,end:t.index,raw:v,data:v};t.append(I)}function se(t){let s=t.trimEnd(),f=new sr(s,t.length);while(f.index<f.source.length)if(f.match("<"))ai(f);else if(f.match("{"))gi(f);else Ti(f);let E=f.root.fragment.nodes.findIndex((C)=>C.type==="SvelteOptions");if(E!==-1){let[C]=f.root.fragment.nodes.splice(E,1);f.root.options=oi(C)}return f.root}var Gp=/\w/;function Wp(t,s){let f=t.trim();if(!f.startsWith("{")||!f.endsWith("}"))return;let E=n(f.slice(1,-1),";,").map((C)=>C.trim());for(let C of E){if(!C.startsWith(s))continue;let w=C.slice(s.length);if(w.length>0&&Gp.test(w[0]))continue;let v=w.trimStart();if(v.startsWith("?"))v=v.slice(1).trimStart();if(v.startsWith(":"))return v.slice(1).trim()}return}function sn(t,s){let f=s;if(f.computed||f.object?.type!=="Identifier"||f.property?.type!=="Identifier")return;let E=f.object.name,C=f.property.name;if(!E||!C)return;if(t.wholePropsLocals.has(E))return St(t,C);let w=St(t,E)??at(t,E)?.type;if(!w)return;return Wp(w,C)}var Jp=new Set(["Component","SvelteComponent","SvelteSelf"]),zp=new Set(["RegularElement","SvelteElement"]);function Mt(t){return Jp.has(t)}function Rt(t){return zp.has(t)}function Kp({hasTypeScriptType:t,hasJSDocType:s,inferredType:f,finalType:E}){if(t)return"typescript";if(s)return"jsdoc";if(f!==void 0)return"default";if(E!==void 0)return"inferred";return"unknown"}function an(t){let s=t.explicitType??t.jsdocType??t.resolvedType??t.typeSeed,f=t.jsdocParams??t.resolvedParams,E=t.jsdocReturnType??t.resolvedReturnType;if((t.isFunctionDeclaration?s==="() => any":t.initializerIsFunction&&s===t.typeSeed)&&E){let U=t.jsdocTypeParameters?`<${t.jsdocTypeParameters}>`:"";s=f&&f.length>0?`${U}(${T(f)}) => ${E}`:`${U}() => ${E}`}let w=t.jsdocDescription??t.resolvedDescription;if(w===void 0&&s!==void 0)w=t.typedefs?.get(s)?.description;let v=Kp({hasTypeScriptType:t.explicitType!==void 0,hasJSDocType:t.jsdocType!==void 0||t.jsdocParams!==void 0||t.jsdocReturnType!==void 0||t.resolvedType!==void 0,inferredType:t.inferredTypeForSource,finalType:s}),I=t.initializerIsFunction||t.isFunctionDeclaration||t.inferIsFunctionFromTypeSignature===!0&&(!!t.jsdocParams?.length||t.jsdocReturnType!==void 0||!!t.jsdocType?.includes("=>")||!!t.resolvedType?.includes("=>")||!!t.explicitType?.includes("=>")),M=I?t.jsdocTypeParameters:void 0;return{type:s,typeSource:v,description:w,params:f,returnType:E,isFunction:I,typeParameters:M}}function on(t){if(t?.type==="Identifier")return t.name;return typeof t?.value==="string"?t.value:void 0}function bi(t,s){for(let f of t?.body??[]){let E=f.type==="ExportNamedDeclaration"&&f.declaration?f.declaration:f;if(E.type==="VariableDeclaration"){let C=E.declarations.find((w)=>w.id.type==="Identifier"?w.id.name===s:Oe(w.id).has(s));if(C)return{declaration:E,declarator:C,statement:f}}else if((E.type==="FunctionDeclaration"||E.type==="ClassDeclaration")&&E.id?.name===s)return{declaration:E,statement:f}}return}function Xp(t,s){for(let f of t?.body??[]){if(f.type!=="LabeledStatement"||f.label.name!=="$")continue;if(f.body.type!=="ExpressionStatement")continue;let E=f.body.expression;if(E.type!=="AssignmentExpression"||E.operator!=="=")continue;if(!Oe(E.left).has(s))continue;let C={type:"VariableDeclarator",id:E.left,init:E.right};return{declaration:{type:"VariableDeclaration",kind:"let",declarations:[C]},declarator:C,statement:f}}return}function Yp(t){if(t==="var")return"let";if(t==="using"||t==="await using")return"const";return t}function ar(t,s,f,E,C){let w=on(f.local),v=on(f.exported);if(!w||!v)return;if(s.source!=null)return{localName:w,exportedName:v};let I=bi(E,w);if(!I&&C==="instance")I=bi(t.parsed?.module?.content,w)??Xp(E,w);return{localName:w,exportedName:v,...I}}function or(t,s,f,E){let C=s.source?.value,w=typeof C==="string"?`it re-exports from "${C}"`:t.valueImportBindingsByLocalName.has(f)?"it re-exports an imported binding":"no matching local declaration was found";Ne(t,"export-unresolved",E,`export "${E}" was skipped because ${w}; sveld only resolves exports of a local declaration.`,ve(t,s))}function pn(t,s,f){if(!f)return qe(t,s);let E=s.specifiers.length===1?qe(t,s):void 0,C=qe(t,f.statement);if(!E||!C)return E??C;let w=Object.fromEntries(Object.entries(E).filter(([,v])=>v!==void 0));return{...C,...w,internal:E.internal||C.internal}}function pr(t,s,f,E){let C=[];if(s.type==="FunctionDeclaration"){let M=s;if(!M.id?.name)return C;let U=t.scriptLanguage==="ts"?Ir(t,M):void 0;return C.push({prop_name:f?.exportedName??M.id.name,kind:"function",isFunctionDeclaration:!0,value:void 0,typeSeed:U?.hasAnnotations?void 0:"() => any",explicitType:U?.hasAnnotations?U.signature:void 0,initializerIsFunction:!0,isRequired:!1,localName:M.id.name,defaultValue:void 0,inferredTypeForSource:void 0,resolvedJSDoc:void 0}),C}if(s.type!=="VariableDeclaration")return C;let w=s,v=Yp(w.kind),I=f?.declarator?[f.declarator]:w.declarations;for(let M of I){if(!M||typeof M!=="object"||!("id"in M))continue;let{id:U,init:V}=M;if(!U||typeof U!=="object")continue;if(U.type!=="Identifier"){for(let Be of Oe(U)){if(f&&f.localName!==Be)continue;C.push({prop_name:f?.exportedName??Be,kind:v,isFunctionDeclaration:!1,value:void 0,typeSeed:void 0,explicitType:void 0,initializerIsFunction:!1,isRequired:!1,localName:Be,defaultValue:void 0,inferredTypeForSource:void 0,resolvedJSDoc:void 0})}continue}let z=U.name,te=f?.exportedName??z,Q=V==null?{isFunction:!1}:st(t,V),{value:be,type:Te,isFunction:we,defaultValue:Re}=Q;Gt(t,Q,te,E),C.push({prop_name:te,kind:v,isFunctionDeclaration:!1,value:be,typeSeed:Te,explicitType:t.explicitPropTypesByName.get(z),initializerIsFunction:we,isRequired:v==="let"&&V==null,localName:z,defaultValue:Re,inferredTypeForSource:Te,resolvedJSDoc:Q})}return C}function lr(t,s,f){let{resolvedJSDoc:E}=s;return an({explicitType:s.explicitType,typeSeed:s.typeSeed,inferredTypeForSource:s.inferredTypeForSource,jsdocType:f?.type,jsdocDescription:f?.description,jsdocParams:f?.params,jsdocReturnType:f?.returnType,jsdocTypeParameters:f?.typeParameters,resolvedType:E?.resolvedType,resolvedDescription:E?.resolvedDescription,resolvedParams:E?.resolvedParams,resolvedReturnType:E?.resolvedReturnType,initializerIsFunction:s.initializerIsFunction,isFunctionDeclaration:s.isFunctionDeclaration,typedefs:t.typedefs})}function Qp(t,s,f){Ne(t,"export-unresolved",f,`export "${f}" was skipped because a class can't be a prop; export it from the module script instead.`,ve(t,s))}function xi(t,s,f,E){if(f.type==="ClassDeclaration"){if(f.id)Qp(t,s,E?.exportedName??f.id.name);return}let C=pr(t,f,E,"props");if(C.length===0)return;let w=pn(t,s,E);for(let v of C){let{prop_name:I,kind:M,localName:U}=v,{type:V,typeSource:z,description:te,params:Q,returnType:be,isFunction:Te,typeParameters:we}=lr(t,v,w);Ze(t,"prop-unknown-type",I,w?.sveldIgnore),ft(t,I,{name:I,...U!==void 0&&U!==I?{localName:U}:{},kind:M,description:te,binding:w?.binding,deprecated:w?.deprecated,tags:w?.tags,...w?.internal?{internal:!0}:{},type:V,typeSource:z,value:v.value,defaultValue:v.defaultValue,params:Q,returnType:be,typeParameters:we,isFunction:Te,isFunctionDeclaration:v.isFunctionDeclaration,isRequired:v.isRequired,constant:M==="const",reactive:t.reactive_vars.has(I),source:ve(t,s)})}}function Si(t,s,f){if(s.declaration!=null){xi(t,s,s.declaration);return}for(let E of s.specifiers){let C=ar(t,s,E,f,"instance");if(!C)continue;if(C.declaration)xi(t,s,C.declaration,C);else or(t,s,C.localName,C.exportedName)}}function Zp(t){if(!t||typeof t!=="object"||!("type"in t))return;let s=String(t.type),f=Mt(s);if(!f&&!Rt(s))return;let E="name"in t&&typeof t.name==="string"?t.name:void 0;if(!E)return;let C=f?{type:"InlineComponent",name:E}:{type:"Element",name:E};if(E==="svelte:element"&&"tag"in t&&t.tag&&typeof t.tag==="object"){let w=t.tag;if(w.type==="Literal"&&typeof w.value==="string")C.thisValue=w.value}return C}function Ei(t,s){let f=Zp(s);if(!f)return;if(t.rest_props===void 0){t.rest_props=f;return}if(t.rest_props.type==="InlineComponent"&&f.type==="Element")t.rest_props=f}var el=/^[A-Za-z_$][\w$]*/,tl=/[A-Za-z_$][\w$]*/g,Pi=/^(?:const|in|out)\s+/;function Ai(t){let s=n(t,",").map((E)=>E.trim()).filter((E)=>E.length>0);if(s.length===0)return null;return[s.map((E)=>{let C=E;while(Pi.test(C))C=C.replace(Pi,"");return C.match(el)?.[0]??E}).join(", "),s.join(", ")]}function Ci(t,s,f){let E=t.scriptGenericsAttribute?.value;if(!E)return;for(let[C]of E.matchAll(tl)){if(t.typeImportBindingsByLocalName.has(C))s.add(C);if(f.has(C))continue;let w=t.localTypeDeclarationsByName.get(C);if(!w)continue;f.add(C),Ve(t,w.node,s,f)}}function ln(t,s,f){if(t.generics)t.generics=[`${t.generics[0]}, ${s}`,`${t.generics[1]}, ${f}`];else t.generics=[s,f]}function cr(t){if(!Array.isArray(t.value))return;return t.value.map((s)=>s.type==="Text"?s.data:"").join("").trim()}function vi(t){let s=[t.instance,t.module].filter((E)=>E!==void 0),f=!1;for(let E of s){let C=E.attributes.find((v)=>v.name==="lang");if(!C){f=!0;continue}if(cr(C)?.toLowerCase()==="ts")return"ts"}return f?"js":void 0}function ki(t,s){let f=s.instance?.attributes.find((I)=>I.name==="generics");if(!f)return;let E=ve(t,f),C=s.instance?.attributes.find((I)=>I.name==="lang");if((C?cr(C)?.toLowerCase():void 0)!=="ts"){Ne(t,"syntax-skipped","generics",'<script generics="..."> requires lang="ts"; the generics attribute was ignored because the script is not TypeScript.',E);return}let v=cr(f);if(!v)return;return{value:v,source:E}}var nl=/[A-Za-z_$][\w$]*/g;function rl(t,s,f){let E=new Map,C=s.typeParameters?.params,w=f.typeArguments?.params;if(!C?.length||!w?.length)return E;for(let v=0;v<C.length;v++){let I=C[v]?.name,M=w[v];if(!I||M?.start===void 0||M?.end===void 0)continue;let U=De(t,M.start,M.end)?.trim();if(U)E.set(I,U)}return E}function sl(t,s){if(s.size===0)return t;return t.replace(nl,(f)=>s.get(f)??f)}function Tt(t,s,f,E=new Set){let C=new Map;if(!s?.type)return C;let w=(v)=>{for(let I of v){if(I?.type!=="TSPropertySignature"||I.computed)continue;if(!I.key)continue;let M=o(I.key);if(!M)continue;let U=I.typeAnnotation?.start,V=I.typeAnnotation?.end;if(U===void 0||V===void 0)continue;let z=De(t,U+1,V)?.trim();if(!z)continue;je(t,I.typeAnnotation?.typeAnnotation);let te=xn(t,I);C.set(M,{type:z,optional:I.optional===!0,source:ve(t,I),...te?{jsdoc:te}:{}})}};switch(s.type){case"TSTypeLiteral":w(s.members??[]);break;case"TSInterfaceDeclaration":w(s.body?.body??[]);break;case"TSTypeAliasDeclaration":{let v=Tt(t,s.typeAnnotation,f,E);for(let[I,M]of v)C.set(I,M);break}case"TSTypeReference":{let v=Nr(s.typeName);if(!v||E.has(v))break;let I=f.get(v);if(!I)break;E.add(v);let M=Tt(t,I,f,E);E.delete(v);let U=rl(t,I,s);for(let[V,z]of M)C.set(V,U.size===0?z:{...z,type:sl(z.type,U)});break}case"TSIntersectionType":for(let v of s.types??[]){let I=Tt(t,v,f,E);for(let[M,U]of I)C.set(M,U)}break;case"TSParenthesizedType":{let v=Tt(t,s.typeAnnotation,f,E);for(let[I,M]of v)C.set(I,M);break}}return C}function wi(t){return t?.content.body??[]}function il(t){let s={};for(let[f,E]of Object.entries(t))s[f]={...E.attribute===void 0?{}:{attribute:E.attribute},...E.reflect===void 0?{}:{reflect:E.reflect},...E.type===void 0?{}:{type:E.type}};return s}function ur(t,s,f){if(s.type==="ImportDeclaration"&&s.source?.value)for(let C of s.specifiers??[]){let w=C.local?.name;if(!w)continue;if(!(s.importKind==="type"||C.importKind==="type"))continue;let I,M;if(C.type==="ImportSpecifier")I="named",M=C.imported?.type==="Identifier"?C.imported.name:typeof C.imported?.value==="string"?C.imported.value:void 0;else if(C.type==="ImportDefaultSpecifier")I="default";else if(C.type==="ImportNamespaceSpecifier")I="namespace";if(!I)continue;t.typeImportBindingsByLocalName.set(w,{importedName:M,localName:w,source:String(s.source.value),specifierType:I})}let E=s.type==="TSEnumDeclaration";if((E||s.type==="TSInterfaceDeclaration"||s.type==="TSTypeAliasDeclaration")&&s.id?.name&&s.start!==void 0&&s.end!==void 0){let C=E?Lr(t,s):De(t,s.start,s.end)?.trim();t.localTypeDeclarationsByName.set(s.id.name,{code:C??"",node:s,start:s.start,...f?{exported:f}:{}})}}function Di(t,s){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;t.scriptLanguage=vi(s);let f=s.options?.customElement;t.customElementTag=f?.tag,t.customElement=f?{...f.tag===void 0?{}:{tag:f.tag},...f.shadow==="open"||f.shadow==="none"?{shadow:f.shadow}:{},...f.props?{props:il(f.props)}:{},...f.extend===void 0?{}:{extend:!0}}:void 0,t.runesOptionOverride=s.options?.runes,t.scriptGenericsAttribute=ki(t,s);let E=wi(s.module),C=new Set;for(let v of E){if(!v?.type)continue;if(v.type==="ExportNamedDeclaration"&&v.declaration)ur(t,v.declaration,!0);else if(v.type==="ExportNamedDeclaration"&&!v.source)for(let I of v.specifiers??[]){let M=I.local?.name;if(M&&M===I.exported?.name)C.add(M)}else ur(t,v,!1)}for(let v of C){let I=t.localTypeDeclarationsByName.get(v);if(I)I.exported=!0}let w=wi(s.instance);for(let v of w){if(!v?.type)continue;if(ur(t,v,!1),v.type==="ExportNamedDeclaration"&&v.declaration?.type==="VariableDeclaration")for(let I of v.declaration.declarations??[]){if(I.id?.type!=="Identifier"||!I.id.name)continue;let M=rt(t,I.id.typeAnnotation);if(M)t.explicitPropTypesByName.set(I.id.name,M),je(t,I.id.typeAnnotation?.typeAnnotation)}else if(v.type==="VariableDeclaration")for(let I of v.declarations??[]){if(I.id?.type!=="Identifier"||!I.id.name)continue;let M=rt(t,I.id.typeAnnotation);if(M){t.explicitVariableTypesByName.set(I.id.name,M);let U=I.id.typeAnnotation?.typeAnnotation;if(U)t.explicitVariableTypeNodesByName.set(I.id.name,U)}}}for(let v of w){if(!v||typeof v!=="object"||!("declarations"in v))continue;for(let I of v.declarations??[]){if(!d(m(I.init),"$props"))continue;let M=I.id?.typeAnnotation?void 0:he(I.init),U=I.id?.typeAnnotation?.typeAnnotation??M,V=I.id?.typeAnnotation?rt(t,I.id.typeAnnotation):ut(t,M),z=Tt(t,U,new Map(Array.from(t.localTypeDeclarationsByName.entries(),([be,Te])=>[be,Te.node]))),te=new Set,Q=new Set;if(Ve(t,U,te,Q),Ci(t,te,Q),I.start!==void 0){let be={canonicalType:V,props:z,referencedImportedTypes:te,referencedLocalTypes:Q};if(t.runesPropsDeclarationMetadataByDeclaratorStart.set(I.start,be),V)t.typedRunesPropsDeclarations.push(be)}}}}function Ni(t,s){let f=s?.trim();if(!f)return;let E=t.typedefMembersByName.get(f)??nt(f);return E?new Map(E.map((C)=>[C.name,C])):void 0}function Li(t,s){for(let f of s.declarations){if(!d(m(f.init),"$props"))continue;if(f.id.type==="Identifier"){t.wholePropsLocals.add(f.id.name),t.restPropLocals.add(f.id.name);let v=Ut(t,f.start),I=v?.props.size?void 0:Ni(t,qe(t,s)?.type);for(let M of I?.values()??[])ft(t,M.name,{name:M.name,kind:"let",description:M.description,type:M.type,typeSource:"jsdoc",isFunction:M.type.includes("=>"),isFunctionDeclaration:!1,isRequired:!M.optional,constant:!1,reactive:!1});if(v)for(let[M,U]of v.props)ft(t,M,{name:M,kind:"let",description:U.jsdoc?.description,deprecated:U.jsdoc?.deprecated,tags:U.jsdoc?.tags,type:U.type,typeSource:"typescript",isFunction:!1,isFunctionDeclaration:!1,isRequired:!U.optional,constant:!1,reactive:!1,source:U.source});continue}if(f.id.type!=="ObjectPattern")continue;let E=qe(t,s),C=Ut(t,f.start)?.props.size?void 0:Ni(t,E?.type),w=f.id.properties.filter((v)=>{if(v.type!=="Property"||v.computed)return!1;if(!o(v.key))return!1;if(v.value.type==="Identifier")return!0;return v.value.type==="AssignmentPattern"&&v.value.left.type==="Identifier"}).length;for(let v of f.id.properties){if(v.type==="RestElement"){if(v.argument.type==="Identifier")t.restPropLocals.add(v.argument.name);continue}let I=o(v.key);if(!I)continue;let M,U;if(v.value.type==="Identifier")M=v.value.name;else{let R=v.value;M=R.left.name,U=R.right}if(!M)continue;if(Vt(t,I,M),I==="children")t.snippetPropLocals.add(M);let V=C?.get(I),z=wr(t,f.start,I),te=xn(t,v)??z?.jsdoc??(w===1&&!C?E:void 0),{init:Q,bindable:be}=Ur(U),Te=Q==null?{isFunction:!1}:st(t,Q),{value:we,type:Re,isFunction:Be,defaultValue:Se}=Te,Me=z?.type===void 0&&te?.type===void 0?Te.resolvedType:void 0;Gt(t,Te,I,"props");let{type:xe,typeSource:Ie,description:mn,params:Bt,returnType:P,isFunction:L}=an({explicitType:z?.type,typeSeed:Re,inferredTypeForSource:Re,jsdocType:te?.type??V?.type,jsdocDescription:te?.description??V?.description,jsdocParams:te?.params,jsdocReturnType:te?.returnType,resolvedType:Me,resolvedDescription:Te.resolvedDescription,resolvedParams:Te.resolvedParams,resolvedReturnType:Te.resolvedReturnType,initializerIsFunction:Be,isFunctionDeclaration:!1,inferIsFunctionFromTypeSignature:!0});if(be)t.reactive_vars.add(I);Ze(t,"prop-unknown-type",I,te?.sveldIgnore),ft(t,I,{name:I,...M===I?{}:{localName:M},kind:"let",description:mn,binding:te?.binding,deprecated:te?.deprecated,tags:te?.tags,...te?.internal?{internal:!0}:{},...be?{bindable:!0}:{},type:xe,typeSource:Ie,value:we,defaultValue:Se,params:Bt,returnType:P,isFunction:L,isFunctionDeclaration:!1,isRequired:!be&&Q==null&&z?.optional!==!0&&V?.optional!==!0,constant:!1,reactive:be,source:ve(t,v)})}}}function al(t){let f=t.indexOf("EventDispatcher");if(f===-1)return;let E=f+15;while(t[E]===" ")E++;if(t[E]!=="<")return;let C=D(t,E);return C===-1?void 0:t.slice(E+1,C)}var ol=/^["']|["']$/g,pl=/\?$/,ll=/^\{/,cl=/\}$/;function ul(t){let s=H(t,":");if(s===-1)return;let f=t.slice(0,s).trim().replace(pl,"").replace(ol,""),E=t.slice(s+1).trim();if(!f||!E)return;return{name:f,type:E}}function Ii(t,s,f,E){if(s){let I=new Map(Array.from(t.localTypeDeclarationsByName.entries(),([U,V])=>[U,V.node])),M=Tt(t,s,I);for(let[U,V]of M)pt(t,{name:U,detail:V.type,has_argument:!0,source:V.source});return}let C=ot(t,f)?.type,w=C?al(C):void 0;if(!w)return;let v=w.trim().replace(ll,"").replace(cl,"");for(let I of n(v,";,")){let M=ul(I.trim());if(!M)continue;pt(t,{name:M.name,detail:M.type,has_argument:!0,source:E})}}function Mi(t,s){if(t.syntaxMode!=="runes")return;for(let[f,E]of Array.from(t.events.entries())){if(E.type!=="dispatched")continue;if(s.has(f)||t.forwardedEvents.has(f))continue;let C=`on${f}`,w=t.props.get(C);if(!w)continue;let v=w.type!==void 0||w.params!==void 0||w.returnType!==void 0,I=E.detail===void 0||E.detail==="undefined"||E.detail==="null"?"() => void":`(detail: ${E.detail}) => void`;t.props.set(C,{...w,description:w.description??E.description,type:v?w.type:I,typeSource:v?w.typeSource:"inferred",isFunction:!0}),t.events.delete(f)}}var _t=null;function dl(t,s){let f={value:void 0,replace:!1};if(!s||typeof s!=="object"||!("type"in s))return f;if(s.type==="Identifier")f.value=s.name,f.replace=!0;else if(s.type==="Literal")f.value=String(s.value);else if(s.type==="MemberExpression")f.value=sn(t,s);else if((s.type==="ObjectExpression"||s.type==="TemplateLiteral")&&"start"in s&&"end"in s&&typeof s.start==="number"&&typeof s.end==="number")f.value=De(t,s.start,s.end);return f}function fl(t,s){if(!e(s))return null;let f=mt(t,s.name);if(l(f))return dr(t,f).slot_props;let E=at(t,s.name);if(!E)return null;let C=nt(E.type);if(!C)return null;let w={};for(let v of C)w[v.name]={value:v.type,replace:!1};return w}function dr(t,s){let f={},E=!1;for(let C of s.properties){if(C.type==="SpreadElement"){let v=fl(t,C.argument);if(v)Object.assign(f,v);else E=!0,Ne(t,"spread-unresolved","slot_props",`Slot props spread a value sveld can't resolve; its shape is widened to "Record<string, any>".`,ve(t,C));continue}if(C.type!=="Property"||C.computed)continue;let w=o(C.key);if(!w)continue;f[w]=dl(t,C.value)}return{slot_props:f,hasUnresolvedSpread:E}}function ml(t,s){if(!s||typeof s!=="object"||!("type"in s))return null;if(s.type==="Identifier"){let w=s,v=t.propLocalToPublicName.get(w.name);if(!v)return null;return{publicName:v,trackingName:w.name}}if(s.type!=="MemberExpression")return null;let f=s,E=f.object&&typeof f.object==="object"&&"type"in f.object&&f.object.type==="Identifier"?f.object.name:void 0;if(!E||!t.wholePropsLocals.has(E))return null;let C;if(!f.computed&&f.property&&typeof f.property==="object"&&"type"in f.property){if(f.property.type==="Identifier")C=f.property.name;else if(f.property.type==="Literal"&&f.property.value!=null)C=String(f.property.value)}else if(f.computed&&f.property&&typeof f.property==="object"&&"type"in f.property&&f.property.type==="Literal"&&"value"in f.property&&f.property.value!=null)C=String(f.property.value);if(!C)return null;return{publicName:C,trackingName:C}}function Ri(t,s){let f=s;if(f&&typeof f==="object"&&"type"in f&&f.type==="ChainExpression")f=f.expression;if(!f||typeof f!=="object"||!("type"in f)||f.type!=="CallExpression")return null;let E=f;if(!E.callee||typeof E.callee!=="object"||!("type"in E.callee))return null;let C=ml(t,E.callee);if(!C)return null;return{...C,arguments:E.arguments}}function Ot(t,{slot_name:s,slot_props:f,slot_props_unresolved_spread:E,slot_fallback:C,slot_description:w,slot_deprecated:v,slot_tags:I,slot_internal:M,source:U}){let V=s===void 0||s==="",z=V?_t:s??"",te=p(C),Q=f===void 0||f===""?void 0:f,be=w?.trim()||void 0;if(t.slots.has(z)){let Te=t.slots.get(z);if(Te)t.slots.set(z,{...Te,default:Te.default??V,fallback:te,slot_props:Te.slot_props===void 0?Q:Te.slot_props,slot_props_unresolved_spread:Te.slot_props_unresolved_spread||E,description:Te.description||be,deprecated:Te.deprecated??v,tags:Te.tags||I,...Te.internal||M?{internal:!0}:{},source:U||Te.source})}else t.slots.set(z,{name:z,default:V,fallback:te,slot_props:Q,slot_props_unresolved_spread:E,description:be,deprecated:v,tags:I,...M?{internal:!0}:{},source:U})}var _i=/^@component/,hl=/\r/g,yl=new Set(["AssignmentExpression","UpdateExpression","CallExpression","SpreadAttribute","FunctionDeclaration","ImportDeclaration","VariableDeclaration","ExportNamedDeclaration","Comment","SlotElement","RenderTag","OnDirective","BindDirective"]);function Oi(t){return t&&"id"in t&&t.id&&"name"in t.id?t.id.name:void 0}function gl(t,s,f,E){let C=f.callee.type==="Identifier"?f.callee.name:void 0;if(C==="createEventDispatcher"){let w=Oi(E);if(w!==void 0)s.dispatcherName=w,s.dispatcherDeclaratorNode=E;s.dispatcherTypeArgument=f.typeArguments?.params?.[0]}if(C==="$host"){let w=Oi(E);if(w!==void 0)s.hostLocalNames.add(w)}if(C==="setContext")ss(t,f);if(f.arguments.length>0){if(s.callsWithArguments.push(f),zt(t,f.callee))s.locallyBoundCalls.add(f)}if(C)s.callees.push({name:C,arguments:f.arguments,node:f,nestedBoundDetailNames:vt(t,f.arguments[1])});if(A(f.callee)&&e(f.callee.property)&&f.callee.property.name==="dispatchEvent"&&(d(f.callee.object,"$host")||e(f.callee.object)&&s.hostLocalNames.has(f.callee.object.name))){let w=ls(t,f);if(w)s.hostDispatchedEventNames.add(w.name),s.hostDispatches.push(w)}}function Tl(t,s){let f=s,E=f.attributes?.find((I)=>I.name==="name")?.value,C=(Array.isArray(E)?E[0]:void 0)?.data,w=(f.attributes||[]).filter((I)=>I.name!=="name").reduce((I,M)=>{let U={value:void 0,replace:!1},V=M.value;if(V===void 0||V===!0)return I;let z=Array.isArray(V)?V[0]:V;if(z){let{type:te,expression:Q,raw:be,start:Te,end:we}=z;if(te==="Text"&&be!==void 0)U.value=JSON.stringify(be);else if(!Array.isArray(V)&&te==="ExpressionTag"&&Q&&typeof Q==="object"&&"type"in Q&&Q.type==="Identifier"&&"name"in Q&&Q.name===M.name)U.value=Q.name,U.replace=!0;if(Q&&typeof Q==="object"&&"type"in Q){if(Q.type==="Literal"&&"value"in Q){let Re=Q.value;U.value=typeof Re==="string"?JSON.stringify(Re):String(Re)}else if(Q.type==="MemberExpression")U.value=sn(t,Q);else if(Q.type!=="Identifier"){if(Te!==void 0&&we!==void 0){if(Q.type==="ObjectExpression"||Q.type==="TemplateLiteral")U.value=De(t,Te+1,we-1)}}}}if(M.name)I[M.name]=U;return I},{}),v=s.fragment.nodes.map(({start:I,end:M})=>De(t,I,M)??"").join("").trim();Ot(t,{slot_name:C,slot_props:w,slot_fallback:v,source:ve(t,s)})}function bl(t,s){let f=Ri(t,s.expression);if(!f)return;let E,C=!1;if(f.arguments.length===0)E={};else if(f.arguments.length===1&&typeof f.arguments[0]==="object"&&f.arguments[0]&&"type"in f.arguments[0]&&f.arguments[0].type==="ObjectExpression"){let I=dr(t,f.arguments[0]);E=I.slot_props,C=I.hasUnresolvedSpread}let w=f.publicName==="children"?void 0:f.publicName,v=w===void 0?_t:w;if(E!==void 0)Ot(t,{slot_name:w,slot_props:E,slot_props_unresolved_spread:C||void 0,source:ve(t,s)});if(E!==void 0||t.slots.has(v))t.snippetPropLocals.add(f.trackingName)}function xl(t,s,f){let E=s.name;if(s.expression!=null||!E)return;if(f==null||!("name"in f))return;let C=typeof f.name==="string"?f.name:void 0,w=f.type;if(!C||!w)return;let v=Mt(w)?{type:"InlineComponent",name:C}:{type:"Element",name:C};t.forwardedEvents.set(E,v);let I=t.events.get(E),M=t.eventDescriptions.get(E),U=I?.deprecated,V=I?.internal;if(!I)t.events.set(E,{type:"forwarded",name:E,element:v,description:M,deprecated:U,...V?{internal:!0}:{},source:ve(t,s)});else if(I.type==="forwarded"&&M&&!I.description)t.events.set(E,{...I,description:M,deprecated:I.deprecated??U,...I.internal||V?{internal:!0}:{},source:I.source||ve(t,s)})}function Sl(t,s,f){if(!(f&&(Rt(f.type)||Mt(f.type))))return;let E=s.expression.type==="Identifier"?s.expression.name:void 0;if(E){let C=Pt(t,E);if(C)t.reactive_vars.add(C)}if(Rt(f.type)&&s.name==="this"&&E&&"name"in f&&typeof f.name==="string"){let C=Pt(t,E);if(!C)return;let w=f.name;if(t.bindings.has(C)){let v=t.bindings.get(C);if(v&&!v.elements.includes(w))t.bindings.set(C,{...v,elements:[...v.elements,w]})}else t.bindings.set(C,{elements:[w]})}}function Bi(t){let s={dispatcherName:void 0,dispatcherDeclaratorNode:void 0,dispatcherTypeArgument:void 0,hostLocalNames:new Set,hostDispatchedEventNames:new Set,hostDispatches:[],callees:[],callsWithArguments:[],locallyBoundCalls:new Set},f={type:"ComponentRoot",instance:t.parsed?.instance,fragment:t.parsed?.fragment};Wr(t),t.activeScopes.push(t.componentScope);let E=Jr(t);return N(f,(C,w)=>{let v=zr(t,E,C);if(v)t.activeScopes.push(v);if(!yl.has(C.type))return;switch(C.type){case"AssignmentExpression":In(t,C.left);break;case"UpdateExpression":In(t,C.argument);break;case"CallExpression":gl(t,s,C,w);break;case"SpreadAttribute":{let I=C.expression.type==="Identifier"?C.expression.name:void 0;if(I==="$$restProps"||t.restPropLocals.has(I??""))Ei(t,w);break}case"FunctionDeclaration":if(C.id?.name)t.funcDecls.set(C.id.name,C);break;case"ImportDeclaration":q(t,C);break;case"VariableDeclaration":if(t.vars.add(C),w?.type==="Program"&&C.declarations.some((I)=>d(m(I.init),"$props")))Li(t,C);break;case"ExportNamedDeclaration":Si(t,C,w?.type==="Program"?w:null);break;case"Comment":{let I=C.data.trim();if(_i.test(I))t.componentComment=I.replace(_i,"").replace(hl,""),t.componentCommentSource=ve(t,C);break}case"SlotElement":Tl(t,C);break;case"RenderTag":bl(t,C);break;case"OnDirective":xl(t,C,w);break;case"BindDirective":Sl(t,C,w);break}},(C)=>{if(Ct(C))t.activeScopes.pop(),Kr(E,C)},{skipTypeOnlySubtrees:!0}),s}var Fi={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 El(t){return t in Fi}function ji(t){if(El(t))return Fi[t];return"HTMLElement"}var Pl=/^\{\s*\}$/;function bt(t){return Array.from(t,([s,f])=>f)}function Al(t,s){let{dispatcherName:f,callees:E}=s;for(let w of s.hostDispatches)cs(t,w);if(f!==void 0){Ii(t,s.dispatcherTypeArgument,f,ve(t,s.dispatcherDeclaratorNode));for(let w of E)if(w.name===f){let v=w.arguments[0],I=v&&typeof v==="object"&&"value"in v?v.value:void 0,M=w.arguments[1],U=_n(Rn(t,w.nestedBoundDetailNames),M),V=U===void 0&&M&&typeof M==="object"&&"value"in M?M.value:void 0,z=V===null&&M.raw==="null";if(I!=null)pt(t,{name:String(I),detail:U??(z?"null":V==null?"":ie(V)),has_argument:Boolean(M),source:ve(t,w.node)})}}let C=new Set(s.hostDispatchedEventNames);if(f!==void 0){for(let w of E)if(w.name===f){let v=w.arguments[0],I=v&&typeof v==="object"&&"value"in v?v.value:void 0;if(I!=null)C.add(String(I))}}return t.forwardedEvents.forEach((w,v)=>{let I=t.events.get(v);if(I&&I.type==="dispatched"&&!C.has(v)){let M=t.eventDescriptions.get(v),U={type:"forwarded",name:v,element:w,description:M,deprecated:I.deprecated,tags:I.tags,source:I.source};if(I.internal)U.internal=!0;if(I.detail!==void 0&&I.detail!=="undefined")U.detail=I.detail;t.events.set(v,U)}}),C}function Cl(t){let s=t.syntaxMode==="runes"?new Set(Array.from(t.snippetPropLocals,(f)=>Cn(t,f))):new Set;return bt(t.props).filter((f)=>!(s.has(f.name)&&t.slots.has(f.name==="children"?_t:f.name))).map((f)=>{if(t.bindings.has(f.name)){let E=t.bindings.get(f.name)?.elements.sort().map((C)=>ji(C)).join(" | ");return{...f,type:`null | ${E}`,typeSource:"inferred",reactive:f.reactive||t.reactive_vars.has(f.name)}}return{...f,reactive:f.reactive||t.reactive_vars.has(f.name)}})}function vl(t){return bt(t.slots).map((s)=>{let{slot_props_unresolved_spread:f,...E}=s;if(!s.slot_props)return E;if(typeof s.slot_props==="string")return Pl.test(s.slot_props)?{...E,slot_props:"Record<string, never>"}:E;let C=s.slot_props,w=[];for(let M of Object.keys(C)){if(C[M].replace&&C[M].value!==void 0)C[M].value=St(t,C[M].value);if(C[M].value===void 0)C[M].value="any";w.push(`${M}: ${C[M].value}`)}let v=f?" & Record<string, any>":"",I=w.length===0?f?"Record<string, any>":"Record<string, never>":w.length===1?`{ ${w[0]} }${v}`:`{
28
+ ${w.join(`;
29
+ `)};
30
+ }${v}`;return{...E,slot_props:I}}).sort((s,f)=>{let E=s.name??"",C=f.name??"";if(E<C)return-1;if(E>C)return 1;return 0})}function kl(t,s,f){if(t.deferredSlotBlockGenerics.length>0){let E=[...s.map((C)=>C.type??""),...f.map((C)=>C.slot_props??"")].join(`
31
+ `);for(let{name:C,constraint:w}of t.deferredSlotBlockGenerics){let v=C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(!new RegExp(`\\b${v}\\b`).test(E))continue;ln(t,C,w)}}if(t.scriptGenericsAttribute){if(t.generics)Ne(t,"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.',t.scriptGenericsAttribute.source);t.generics=Ai(t.scriptGenericsAttribute.value)}}function wl(t){return bt(t.events).map((s)=>{switch(s.type){case"forwarded":return{...s,element:s.element.name};case"dispatched":return s;default:return s}}).sort(K)}function Nl(t,s,f){let E={props:new Map(t.pendingCallDefaultCandidates.filter((C)=>C.location==="props").map((C)=>[C.propName,C])),moduleExports:new Map(t.pendingCallDefaultCandidates.filter((C)=>C.location==="moduleExports").map((C)=>[C.propName,C]))};for(let C of s)if(C.typeSource==="unknown"){let w=E.props.get(C.name);if(w)C.type="any";let v=w?w.importSource?`Prop "${C.name}" default calls "${w.calleeName}()" imported from "${w.importSource}"; falling back to "any" pending cross-file resolution.`:`Prop "${C.name}" default calls "${w.calleeName}()", but its return type could not be inferred; falling back to "any".`:`Prop "${C.name}" type could not be inferred; falling back to "${C.type??"any"}".`;Ne(t,"prop-unknown-type",C.name,v,C.source)}for(let C of f)if(C.typeSource==="unknown"&&E.moduleExports.has(C.name))C.type="any"}function cn(t,s,f,E){if(s===void 0||qs(s))return!0;return Ne(t,"type-syntax-error",f,`Type \`${s}\` of "${f}" is not valid TypeScript; falling back to "any".`,E),!1}function Dl(t,s,f,E,C){for(let w of s)if(w.typeSource==="jsdoc"&&!cn(t,w.type,w.name,w.source))w.type="any";for(let w of f)if(w.type==="dispatched"&&!cn(t,w.detail,w.name,w.source))w.detail="any";for(let w of E)if(!cn(t,w.slot_props,w.name??"default",w.source))w.slot_props="any";for(let w of C)if(!cn(t,w.type,w.name,w.source))w.type="any",w.ts=`type ${w.name} = any;`}function Ll(t,s){let{dispatcherName:f}=s,E=[];if(f===void 0)return E;let C=[];for(let v of s.callsWithArguments){let I=ps(v,f);if(I)C.push({call:v,...I})}if(C.length>0)Ze(t,"dispatch-escapes",f,ot(t,f)?.sveldIgnore);let w=Pn(t,"dispatch-escapes",f);for(let{call:v,argumentIndex:I,property:M}of C){let U=s.locallyBoundCalls.has(v)?void 0:ae(t,v.callee);if(!U){E.push(v);continue}let V=ve(t,v);t.pendingDispatchEscapeCandidates.push({importSource:U.source,importedName:U.importedName,...U.members?{members:U.members}:{},calleeText:We(t,v.callee)??U.importedName,dispatcherName:f,argumentIndex:I,...M===void 0?{}:{property:M},...V?{source:V}:{},...w?{ignored:w}:{}})}return E}function Il(t,s,f){for(let E of t.jsDocEventNames){if(s.has(E))continue;if(t.forwardedEvents.has(E))continue;if(t.props.has(`on${E}`))continue;if(f.length>0)continue;let C=En(t,"event-no-source",E,`@event "${E}" has no matching dispatch or callback prop.`,t.jsDocEventSources.get(E));if(t.pendingDispatchEscapeCandidates.length>0)t.deferredEventNoSourceDiagnostics.push(C);else t.diagnosticRecords.push(C)}}function Ml(t,s){let f=s.typedefs.filter((w)=>w.internal).map((w)=>w.name.split("<")[0]);if(f.length===0)return;let E=f.map((w)=>({name:w,regex:new RegExp(`\\b${w}\\b`)})),C=(w,v,I)=>{if(!v)return;for(let{name:M,regex:U}of E){if(!U.test(v))continue;Ne(t,"internal-typedef-referenced",w,`"${w}" references "${M}", which is @internal and excluded from output; the generated .d.ts will contain a dangling reference to it.`,I)}};for(let w of s.props){if(w.internal)continue;C(w.name,w.type,w.source)}for(let w of s.moduleExports){if(w.internal)continue;C(w.name,w.type,w.source)}for(let w of s.typedefs){if(w.internal)continue;C(w.name,w.ts)}for(let w of s.events){if(w.internal||w.type!=="dispatched")continue;C(w.name,w.detail,w.source)}for(let w of s.slots){if(w.internal)continue;C(w.name??"default",w.slot_props,w.source)}for(let w of s.contexts){if(w.internal)continue;if(w.type!==void 0)C(w.typeName,w.type,w.source);for(let v of w.properties)C(v.name,v.type)}}function qi(t,s){let f=Al(t,s);Mi(t,f);let E=Cl(t);t.activeScopes.length=0;let C=vl(t);kl(t,E,C);let w=bt(t.moduleExports),v=wl(t),I=bt(t.typedefs),M=bt(t.contexts);Nl(t,E,w),Dl(t,E,v,C,I);let U=Ll(t,s);Il(t,f,U);let{dispatcherName:V}=s;for(let be of U){let Te=We(t,be.callee)??"";Ne(t,"dispatch-escapes",V??"",`\`${V}\` is passed to \`${Te}\`, 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.`,ve(t,be))}if(t.rest_props?.type==="InlineComponent")Ne(t,"rest-props-unresolved","$$restProps",`$$restProps is only spread onto component "${t.rest_props.name}"; sveld cannot infer its rest-prop type. Spread onto a plain element or add an @restProps tag.`);Ml(t,{props:E,moduleExports:w,typedefs:I,events:v,slots:C,contexts:M});let z={source:$t(t,0,t.source?.length),syntaxMode:t.syntaxMode,...t.scriptLanguage?{scriptLanguage:t.scriptLanguage}:{},props:E,moduleExports:w,slots:C,events:v,typedefs:I,generics:t.generics,rest_props:t.rest_props,extends:t.extends,componentComment:t.componentComment,componentCommentSource:t.componentCommentSource,contexts:M,customElementTag:t.customElementTag,customElement:t.customElement,...t.cssParts.length>0?{cssParts:t.cssParts.slice()}:{},...t.cssProperties.length>0?{cssProperties:t.cssProperties.slice()}:{},diagnostics:t.diagnosticRecords.slice()},te=Rr(t);if(te)z[h]=te;let Q=Mr(t);return Q?{component:z,pending:Q}:{component:z}}var Rl=new Set(["MethodDefinition","PropertyDefinition","AccessorProperty"]);function _l(t){if(t.computed||!t.key)return;if(t.key.type==="Identifier")return t.key.name;if(t.key.type==="Literal"&&(typeof t.key.value==="string"||typeof t.key.value==="number"))return String(t.key.value);return}function Vi(t){return t==="private"||t==="protected"}function xt(t){return{...t?.description?{description:t.description}:{},...t?.deprecated===void 0?{}:{deprecated:t.deprecated},...t?.tags?{tags:t.tags}:{}}}function $i(t){return t?.slice(1,-1).trim()||void 0}function fr(t,s,f){let E=kn(t,s),C=new Map((f?.params??[]).map((M)=>[M.name,M])),w=E.params.map(({name:M,type:U,optional:V,rest:z})=>{let te=C.get(M);return{name:z?`...${M}`:M,type:U??te?.type??(z?"any[]":"any"),...te?.description?{description:te.description}:{},...!z&&(V||te?.optional)?{optional:!0}:{}}}),v=E.returnType??f?.returnType??(s.async?"Promise<any>":void 0),I=$i(E.typeParameters)??f?.typeParameters;return{...w.length>0?{params:w}:{},...v?{returnType:v}:{},...I?{typeParameters:I}:{}}}function Ui(t,s){let f=[],E=new Map,C=new Set,w=new Set,v,I=-1;for(let V of s.body?.body??[]){let z=V;if(!Rl.has(z.type)||Vi(z.accessibility))continue;let te=_l(z);if(te===void 0)continue;let Q=qe(t,z);if(Q?.internal)continue;let be=`${z.static?"static ":""}${te}`,Te={...z.static?{static:!0}:{},...z.optional?{optional:!0}:{},...z.abstract?{abstract:!0}:{}};if(z.type!=="MethodDefinition"){if(je(t,z.typeAnnotation?.typeAnnotation),!z.static)w.add(te);f.push({kind:"property",name:te,type:rt(t,z.typeAnnotation)??Q?.type??"any",...Te,...z.readonly?{readonly:!0}:{},...xt(Q)});continue}let we=z.value,Re=z.typeParameters?{...we,typeParameters:z.typeParameters}:we;if(z.kind==="constructor"){let Be=fr(t,Re,Q);f.push({kind:"constructor",name:"constructor",params:Be.params,...xt(Q)}),I=f.length,v=Re.body?.body,(Re.params??[]).forEach((Me,xe)=>{if(Me.type!=="TSParameterProperty"||Vi(Me.accessibility))return;let Ie=Be.params?.[xe];if(!Ie)return;w.add(Ie.name),f.push({kind:"property",name:Ie.name,type:Ie.type,...Me.readonly?{readonly:!0}:{},...Ie.description?{description:Ie.description}:{}})});continue}if(z.kind==="get"||z.kind==="set"){let Be=fr(t,Re,Q),Se=z.kind==="get"?Be.returnType??Q?.type:Be.params?.[0]?.type??Q?.type,Me=E.get(be);if(Me){if(z.kind==="set")Me.readonly=void 0;if(Se&&Se!=="any"&&(Me.type==="any"||z.kind==="get"))Me.type=Se;if(!Me.description&&!Me.deprecated)Object.assign(Me,xt(Q));continue}let xe={kind:"property",name:te,type:Se??"any",...Te,...z.kind==="get"?{readonly:!0}:{},...xt(Q)};E.set(be,xe),f.push(xe);continue}if(Re.type==="TSDeclareMethod"&&!z.abstract)C.add(be);else if(Re.type!=="TSDeclareMethod"&&C.has(be))continue;f.push({kind:"method",name:te,...Te,...fr(t,Re,Q),...xt(Q)})}if(t.scriptLanguage!=="ts"&&v)f.splice(I,0,...Bl(t,v,w));for(let V of s.typeParameters?.params??[])je(t,V.constraint),je(t,V.default);let M=$i(ut(t,s.typeParameters)),U=Ol(t,s);return{members:f,...M?{typeParameters:M}:{},...U}}function Ol(t,s){let f={},E=s.superClass;if(E){if(f.extends=ut(t,{start:E.start,end:s.superTypeParameters?.end??E.end}),E.type==="Identifier")Hi(t,E,s.superTypeParameters)}let C=(s.implements??[]).map((w)=>(Hi(t,w.expression,w.typeParameters),ut(t,w))).filter((w)=>Boolean(w));if(C.length>0)f.implements=C;return f}function Hi(t,s,f){je(t,{type:"TSTypeReference",typeName:s,...f?{typeParameters:f}:{}})}function Bl(t,s,f){let E=[];for(let C of s){let w=C.type==="ExpressionStatement"?C.expression:void 0;if(w?.type!=="AssignmentExpression"||w.operator!=="=")continue;let v=w.left;if(v?.type!=="MemberExpression"||v.computed||v.object?.type!=="ThisExpression")continue;let I=v.property?.type==="Identifier"?v.property.name:void 0;if(!I||f.has(I))continue;f.add(I);let M=qe(t,C);if(M?.internal)continue;E.push({kind:"property",name:I,type:M?.type??"any",...xt(M)})}return E}var Fl=/^[A-Za-z_$][\w$]*(?=\s*(?:<|$))/;function mr(t,s,f){if(p(s)===void 0)return;if(t.moduleExports.has(s)){let E=t.moduleExports.get(s);t.moduleExports.set(s,{...E,...f})}else t.moduleExports.set(s,f)}function Gi(t,s,f,E){let C=qe(t,s);mr(t,f==="*"?`* from ${E.from}`:f,{name:f,kind:"re-export",description:C?.description,deprecated:C?.deprecated,tags:C?.tags,...C?.internal?{internal:!0}:{},isFunction:!1,isFunctionDeclaration:!1,isRequired:!1,constant:!1,reactive:!1,reExport:E,source:ve(t,s)})}function Wi(t,s){Ne(t,"module-export-conflict","default",`export "default" was skipped because it collides with the component's own default export.`,ve(t,s))}function jl(t,s,f,E){let C=f.id?.name;if(!C)return;let w=E?.exportedName??C,v=pn(t,s,E),{members:I,typeParameters:M,extends:U,implements:V}=Ui(t,f),z=M??v?.typeParameters;mr(t,w,{name:w,...C===w?{}:{localName:C},kind:"class",description:v?.description,deprecated:v?.deprecated,tags:v?.tags,...v?.internal?{internal:!0}:{},type:`typeof ${C}`,...z?{typeParameters:z}:{},members:I,...f.abstract?{abstract:!0}:{},...U?{extends:U}:{},...V?{implements:V}:{},isFunction:!1,isFunctionDeclaration:!1,isRequired:!1,constant:!1,reactive:!1,source:ve(t,s)})}function Ji(t,s,f,E){if(f.type==="ClassDeclaration"){jl(t,s,f,E);return}let C=pr(t,f,E,"moduleExports");if(C.length===0)return;let w=pn(t,s,E);for(let v of C){let{prop_name:I,kind:M}=v,{type:U,typeSource:V,description:z,params:te,returnType:Q,isFunction:be,typeParameters:Te}=lr(t,v,w);mr(t,I,{name:I,kind:M,description:z,deprecated:w?.deprecated,tags:w?.tags,...w?.internal?{internal:!0}:{},type:U,typeSource:V,value:v.value,defaultValue:v.defaultValue,params:te,returnType:Q,typeParameters:Te,isFunction:be,isFunctionDeclaration:v.isFunctionDeclaration,isRequired:!1,constant:M==="const",reactive:!1,source:ve(t,s)})}}function ql(t){let s=Array.from(t.moduleExports.values()).filter((E)=>E.kind==="class"),f=new Set(s.map((E)=>E.localName??E.name));for(let E of s){if(!E.extends)continue;let C=Fl.exec(E.extends)?.[0];if(C&&(f.has(C)||t.valueImportBindingsByLocalName.has(C)||t.typeImportBindingsByLocalName.has(C)))continue;Ne(t,"export-unresolved",E.name,`class "${E.name}" extends \`${E.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.`,E.source),E.extends=void 0}}function zi(t){let s=t.parsed?.module;if(!s)return;let f=ye(s);N(s,(E,C)=>{if(E.type==="ImportDeclaration")q(t,E);if(E.type==="FunctionDeclaration"&&E.id?.name)t.funcDecls.set(E.id.name,E);if(E.type==="VariableDeclaration")t.vars.add(E);if(E.type==="ExportNamedDeclaration"){if(E.declaration!=null){Ji(t,E,E.declaration);return}let w=E.source?.value,v=C?.type==="Program"?C:null;for(let I of E.specifiers){let M=ar(t,E,I,v,"module");if(!M)continue;if(M.exportedName==="default"){Wi(t,E);continue}let U=typeof w==="string"?{from:w,imported:M.localName}:f.get(M.localName);if(M.declaration)Ji(t,E,M.declaration,M);else if(U)Gi(t,E,M.exportedName,U);else if(!t.localTypeDeclarationsByName.get(M.localName)?.exported)or(t,E,M.localName,M.exportedName)}}if(E.type==="ExportAllDeclaration"&&typeof E.source.value==="string"){let w=(E.exported&&on(E.exported))??"*";if(w==="default"){Wi(t,E);return}Gi(t,E,w,{from:E.source.value,imported:"*"})}}),ql(t)}var Vl=/\s*=\s*/;function Hl(t){let s=t.indexOf("<");if(s===-1||!t.endsWith(">"))return t;let f=t.slice(0,s),E=t.slice(s+1,-1),C=n(E,",").map((w)=>w.trim().replace(Vl," = ")).join(", ");return`${f}<${C}>`}var $l=new Set(["restProps","slot","snippet","event","typedef","callback"]),hr=new Set(["property","type"]),Ul=new Set(["slot","snippet","typedef","callback"]);function un(t){if(!t||t.length===0)return;return t[yn(t)].content}function Ki(t){return!t||!t.tag&&!t.continuesType&&t.content.trim()===""}function Gl(t){return t.text.split(`
32
+ `).length===t.lines.length}function yr(t,s){if(s<=0)return t;return t.split(`
33
+ `).slice(0,-s).join(`
34
+ `).trimEnd()}var Wl=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"]),Jl=[...jt,...gn,"type","param","returns","typedef","property","callback","template","generics","slot","snippet","event","restProps","extends","extendProps","deprecated","ignore","internal","sveld-ignore","csspart","cssprop"],zl=/;$/;function Kl(t){let s=t.trim().replace(zl,"").trimEnd();if(!s.startsWith("{")||!s.endsWith("}"))return!1;return D(s,0)===s.length-1}var Xl=/[\w$]+/g,Yl=new Set(["property","param","returns","return"]);function Ql(t,s,f){let E=[t[s].type];for(let w=s+1;Yl.has(t[w]?.tag);w++)E.push(t[w].type);let C=new Set(E.join(" ").match(Xl));return f.some(({name:w})=>C.has(w))}function Zl(t){let s=t?.trim();return!s||s==="object"||s==="Object"}function Xi(t,s){if(s.usedGenericsTag&&s.usedTemplateTag&&!s.warnedMixedGenericsTags){s.warnedMixedGenericsTags=!0;let f=t.componentFilePath?` in ${t.componentFilePath}`:"";console.warn(`Warning: Both @generics and @template tags are used to declare component generics${f}; their declarations are combined in the order encountered.`)}}function Yi(t,s,f,E){if(s.seenGenericNames.has(f))Ne(t,"generics-conflict",f,`Duplicate generic name "${f}".`,E);else s.seenGenericNames.add(f)}function Qi(t,s,f){if(t.generics){let C=n(t.generics[0],",").map((w)=>w.trim()).indexOf(s.trim());if(C!==-1){let w=n(t.generics[1],",").map((v)=>v.trim());w[C]=f,t.generics=[t.generics[0],w.join(", ")];return}}ln(t,s,f)}function Zi(t,s,f){if(t.typedefs.has(s))Ne(t,"typedef-duplicate",s,`Duplicate typedef/callback name "${s}"; the later declaration overwrites the earlier one.`,f)}function ea(t,s,f,E,C){let w=s.findIndex((v)=>v.name===f.name);if(w===-1)s.push(f);else{let v=E?` of "${E}"`:"";Ne(t,"property-duplicate",f.name,`Duplicate property "${f.name}"${v}; the later declaration overwrites the earlier one.`,C),s[w]=f}}class ta{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(t,s,f,E){this.ctx=t,this.generics=s,this.documentsFunction=E;let{tags:C,lines:w}=f;this.tags=C,this.lines=w,this.commentDescription=f.description,this.hasSlotOrSnippetTag=C.some((M)=>M.tag==="slot"||M.tag==="snippet"),this.hasExtendsTag=C.some((M)=>M.tag==="extends"||M.tag==="extendProps");for(let M of C)if(M.lines.length>0)this.tagLineNumbers.add(M.lines[0].number);for(let M of w)if(M.continuesType)this.tagLineNumbers.add(M.number);let v=!1,I=!1;for(let M of w){if(!M.tag&&!M.continuesType&&M.content&&(I||M.content.trim()!=="}"))this.lineDescriptions.set(M.number,M.content);if(M.tag!==void 0||M.continuesType)v=!0;else if(!M.content.trim());else if(v&&(M.indent||I))this.indentedContinuationLines.add(M.number);else v=!1;if(F(M.content))I=!I}}orCommentDescription(t){if(t||!this.isFirstTag||this.commentDescriptionUsed||!this.commentDescription)return t;return this.commentDescriptionUsed=!0,this.commentDescription}typeDeclarationName(t){if(this.pendingTypeParameters.length===0)return Hl(t);let s=`${t}<${this.pendingTypeParameters.join(", ")}>`;return this.pendingTypeParameters.length=0,s}joinBlockLines(t,s){let f=s?s.text.split(`
35
+ `):[],E=s?.line;for(let C of t){if(E!==void 0&&C-E>1){let v=E+1;while(v<C&&Ki(this.lines[v]))v++;if(v===C)for(let I=E+1;I<C;I++)f.push("")}let w=this.lines[C];f.push(w.indent+w.content),E=C}return Ft(f)}getPrecedingDescription(t){if(t.length===0)return;let s=t[0].number,f=[],E=!1;for(let C=s-1;C>=0;C--){if(this.tagLineNumbers.has(C)||this.indentedContinuationLines.has(C)||this.consumedDescriptionLines.has(C))break;if(this.lineDescriptions.has(C))f.unshift(C),E=!0;else if(E&&!Ki(this.lines[C]))break}if(f.length===0)return;for(let C of f)this.consumedDescriptionLines.add(C);return this.trimBodyAbove?.(f[0]),this.joinBlockLines(f)}claimBodyLines(t,s){if(!Gl(t)){for(let E=1;E<t.lines.length;E++)this.consumedDescriptionLines.add(t.lines[E].number);return}let f=t.lines[t.lines.length-1].number;this.trimThisBody=(E)=>s(f-E+1)}getTagDescription(t,s,f=!1){let E=tt(un(t)),C=s!==void 0&&$l.has(s.tag)&&!tt(un(s.lines)),w=f&&(s===void 0||!hr.has(s.tag)),v=[];for(let I=1;I<t.length;I++){let M=t[I];if((C||w)&&!this.indentedContinuationLines.has(M.number))continue;if(!this.lineDescriptions.get(M.number)?.trim()||this.consumedDescriptionLines.has(M.number))continue;v.push(M.number),this.consumedDescriptionLines.add(M.number)}if(v.length===0)return E;return this.joinBlockLines(v,{text:E??"",line:t[yn(t)].number})}flagDescriptionAfterEvent(t,s,f,E){if(this.eventName===void 0||this.eventDescription)return;if(this.eventTagLine!==void 0&&this.indentedContinuationLines.has(this.eventTagLine+1))return;if(E?.tag!=="event"&&!hr.has(E?.tag??""))return;if(tt(un(f)))return;let C=s?`@${t} "${s}"`:`@${t}`;Ne(this.ctx,"event-description-ambiguous",this.eventName,`Text after @event "${this.eventName}" was used as the description of ${C}. Move it above the tag it describes, indent it as a continuation line, or give each event its own comment block.`,Ge(this.ctx,f))}takePrecedingDescription(t){let{tag:s,name:f,lines:E}=this.tags[t],C=this.getPrecedingDescription(E);if(C)this.flagDescriptionAfterEvent(s,f,E,this.tags[t-1]);return C}finalizeEvent(){if(this.eventName===void 0)return;let{ctx:t}=this,s=this.eventType&&this.eventType!=="object"&&this.eventType!=="Object"?this.eventType:void 0,f;if(s)f=s;else if(this.eventProperties.length>0)f=kt(this.eventProperties,this.eventName,!0);else f=this.eventType||"";if(this.eventTagLine!==void 0){let C;for(let I of this.tags){let M=I.lines[0]?.number;if(typeof M!=="number")continue;if(M<=this.eventTagLine)continue;if(hr.has(I.tag))continue;C=M;break}let w=[],v=Array.from(this.lineDescriptions.keys()).sort((I,M)=>I-M);for(let I of v){if(I<=this.eventTagLine)continue;if(C!==void 0&&I>=C)continue;if(this.consumedDescriptionLines.has(I))continue;if(this.lineDescriptions.get(I)?.trim())w.push(I),this.consumedDescriptionLines.add(I)}if(w.length>0)this.eventDescription=this.joinBlockLines(w,this.eventDescription?{text:this.eventDescription,line:this.eventTagLine}:void 0)}let E=f===""&&(!t.events.has(this.eventName)||t.untypedJsDocEventNames.has(this.eventName));if(pt(t,{name:this.eventName,detail:f,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}),E)t.untypedJsDocEventNames.add(this.eventName);t.eventDescriptions.set(this.eventName,this.eventDescription),t.jsDocEventNames.add(this.eventName),t.jsDocEventSources.set(this.eventName,this.eventSource),Ze(t,"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:t}=this,s,f;if(this.typedefProperties.length>0)s=kt(this.typedefProperties,void 0,!0),f=`type ${this.typedefName} = ${s};`;else if(this.typedefType)s=this.typedefType,f=Kl(s)?`interface ${this.typedefName} ${s}`:`type ${this.typedefName} = ${s};`;else s="{}",f=`type ${this.typedefName} = ${s};`;let E=this.typedefProperties.length>0?this.typedefProperties.filter(({name:C})=>!C.includes(".")&&!C.startsWith("[")).map(({name:C,type:w,optional:v,description:I})=>({name:C,type:w,optional:v===!0,...I?{description:I}:{}})):nt(s);if(E)t.typedefMembersByName.set(this.typedefName,E);Zi(t,this.typedefName,this.typedefSource),t.typedefs.set(this.typedefName,{type:s,name:this.typedefName,description:p(this.typedefDescription),ts:f,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 t=this.callbackParams.map(({name:C,type:w,optional:v})=>`${C}${v?"?":""}: ${w}`).join(", "),s=this.callbackReturnType||"void",f=`(${t}) => ${s}`,E=`type ${this.callbackName} = ${f};`;Zi(this.ctx,this.callbackName,this.callbackSource),this.ctx.typedefs.set(this.callbackName,{type:f,name:this.callbackName,description:p(this.callbackDescription),ts:E,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(t,s){let{name:f,lines:E}=this.tags[t];if(this.ctx.extends!==void 0)Ne(this.ctx,"extend-props-duplicate",f,`A second @extends/@extendProps tag ("${f}") overwrote the first ("${this.ctx.extends.interface}"); only one is used.`,Ge(this.ctx,E));this.ctx.extends={interface:f,import:s},this.isFirstTag=!1}readRestProps(t,s){let{name:f,description:E}=this.tags[t],C=f?E?`${f} ${E}`:f:E,w=tt(C),v=this.orCommentDescription(w||this.takePrecedingDescription(t)),I={type:"Element",name:s,description:v||void 0};if(this.ctx.rest_props=I,w)this.claimBodyLines(this.tags[t],(M)=>{I.description=tt(yr(C,M))||void 0});this.isFirstTag=!1}readSlot(t,s){let{tag:f,name:E,lines:C}=this.tags[t],w=this.orCommentDescription(this.getTagDescription(C,this.tags[t+1]));if(!w&&this.pendingTags.length===0)w=this.takePrecedingDescription(t);this.isFirstTag=!1;let v=s;if(!v)v="Record<string, never>",Ne(this.ctx,"slot-missing-type",E||"default",`@${f}${E?` "${E}"`:""} is missing a required {Type} annotation; falling back to "${v}".`,Ge(this.ctx,C));Ot(this.ctx,{slot_name:E,slot_props:v,slot_description:w||void 0,slot_deprecated:this.pendingDeprecated,slot_tags:this.pendingTags.length>0?[...this.pendingTags]:void 0,slot_internal:this.pendingInternal||void 0,source:Ge(this.ctx,C)}),this.pendingTags.length=0,this.pendingDeprecated=void 0,this.pendingInternal=!1;let I=E===void 0||E===""?null:E;this.attachTrailingTag=(M)=>{let U=this.ctx.slots.get(I);if(U)U.tags=[...U.tags??[],M]}}readEvent(t,s){let{name:f,lines:E}=this.tags[t],C=tt(un(E))||this.takePrecedingDescription(t);if(this.finalizeEvent(),this.eventName=f,this.eventType=s,this.eventTagLine=E.length>0?E[0].number:void 0,this.eventDescription=this.orCommentDescription(C),this.eventSource=Ge(this.ctx,E),this.pendingTags.length>0)this.eventTags.push(...this.pendingTags),this.pendingTags.length=0;this.attachTrailingTag=(w)=>this.eventTags.push(w),this.isFirstTag=!1}readProperty(t,s){let{name:f,optional:E,default:C,lines:w}=this.tags[t],v={name:f,type:s,description:this.getTagDescription(w,this.tags[t+1],this.eventName!==void 0),optional:E||!1,default:C};if(this.eventName!==void 0)ea(this.ctx,this.eventProperties,v,this.eventName,Ge(this.ctx,w));else if(this.typedefName!==void 0&&Zl(this.typedefType))ea(this.ctx,this.typedefProperties,v,this.typedefName,Ge(this.ctx,w))}readTypedef(t,s){let{name:f,lines:E}=this.tags[t];if(this.finalizeTypedef(),this.typedefName=this.typeDeclarationName(f),this.typedefType=s,this.typedefSource=Ge(this.ctx,E),this.typedefDescription=this.orCommentDescription(this.getTagDescription(E,this.tags[t+1])||this.takePrecedingDescription(t)),this.pendingTags.length>0)this.typedefTags.push(...this.pendingTags),this.pendingTags.length=0;this.typedefInternal=this.pendingInternal,this.pendingInternal=!1,this.attachTrailingTag=(C)=>this.typedefTags.push(C),this.isFirstTag=!1}readCallback(t){let{name:s,lines:f}=this.tags[t];if(this.finalizeCallback(),this.callbackName=this.typeDeclarationName(s),this.callbackSource=Ge(this.ctx,f),this.callbackDescription=this.orCommentDescription(this.getTagDescription(f,this.tags[t+1])||this.takePrecedingDescription(t)),this.pendingTags.length>0)this.callbackTags.push(...this.pendingTags),this.pendingTags.length=0;this.callbackInternal=this.pendingInternal,this.pendingInternal=!1,this.attachTrailingTag=(E)=>this.callbackTags.push(E),this.isFirstTag=!1}readGenerics(t,s){let{name:f,lines:E}=this.tags[t],C=s||f;for(let w of n(f,","))Yi(this.ctx,this.generics,w.trim(),Ge(this.ctx,E));this.generics.usedGenericsTag=!0,Xi(this.ctx,this.generics),Qi(this.ctx,f,C),this.isFirstTag=!1}readTemplate(t,s){let{tags:f}=this,E=Sn(f[t],s),C=t+1;while(f[C]?.tag==="template")C++;let w=f[C];if((w?.tag==="typedef"||w?.tag==="callback")&&!w.name.includes("<")&&Ql(f,C,E)){this.pendingTypeParameters.push(...E.map(({constraint:v})=>v));return}if(this.hasSlotOrSnippetTag&&!this.hasExtendsTag){this.ctx.deferredSlotBlockGenerics.push(...E);return}if(this.documentsFunction)return;for(let v of E)Yi(this.ctx,this.generics,v.name,Ge(this.ctx,f[t].lines)),Qi(this.ctx,v.name,v.constraint);this.generics.usedTemplateTag=!0,Xi(this.ctx,this.generics),this.isFirstTag=!1}readDeprecated(t){let{text:s}=this.tags[t],f=this.eventName!==void 0;if(f?this.eventDeprecated!==void 0:this.pendingDeprecated!==void 0)return;let E=(C)=>{if(f)this.eventDeprecated=C;else this.pendingDeprecated=C};E(qt(s)),this.claimBodyLines(this.tags[t],(C)=>{E(qt(yr(s,C)))})}readPassthrough(t){let{tag:s,text:f,lines:E}=this.tags[t],C={name:s,body:f};if(this.claimBodyLines(this.tags[t],(w)=>{C.body=yr(f,w)}),!jt.has(s)&&!gn.has(s)){let w=Wl.has(s)?void 0:k(s,Jl,s.length<=4?1:2);Ne(this.ctx,"jsdoc-unknown-tag",s,w?`Unknown JSDoc tag "@${s}"; did you mean "@${w}"? Passed through unchanged.`:`Unknown JSDoc tag "@${s}"; passed through unchanged. If this is a typo, fix the tag name.`,Ge(this.ctx,E))}if(this.attachTrailingTag)this.attachTrailingTag(C);else this.pendingTags.push(C)}read(){let{tags:t}=this;for(let f=0;f<t.length;f++){let{tag:E,type:C,name:w,optional:v}=t[f],I=et(C);switch(this.trimBodyAbove=this.trimThisBody,this.trimThisBody=void 0,E){case"extends":case"extendProps":this.readExtends(f,I);break;case"restProps":this.readRestProps(f,I);break;case"slot":case"snippet":this.readSlot(f,I);break;case"csspart":{let M=this.getTagDescription(t[f].lines,t[f+1]);this.ctx.cssParts.push({name:w,...M?{description:M}:{}});break}case"cssprop":case"cssproperty":{let M=this.getTagDescription(t[f].lines,t[f+1]),U=t[f].default;this.ctx.cssProperties.push({name:w,...I?{type:I}:{},...U===void 0?{}:{default:U},...M?{description:M}:{}});break}case"event":this.readEvent(f,I);break;case"type":if(this.eventName!==void 0)this.eventType=I;break;case"param":if(this.callbackName!==void 0)this.callbackParams.push({name:w,type:I,optional:v||!1});break;case"returns":case"return":if(this.callbackName!==void 0)this.callbackReturnType=I;break;case"property":this.readProperty(f,I);break;case"typedef":this.readTypedef(f,I);break;case"callback":this.readCallback(f);break;case"generics":this.readGenerics(f,I);break;case"template":this.readTemplate(f,I);break;case"deprecated":this.readDeprecated(f);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(w);break;case"enum":case"class":case"implements":case"this":case"namespace":case"memberof":case"module":case"file":case"overview":break;default:this.readPassthrough(f);break}if(Ul.has(E))this.finalizeEvent()}if(this.finalizeEvent(),this.finalizeTypedef(),this.finalizeCallback(),t.some((f)=>f.tag==="slot"||f.tag==="snippet"||f.tag==="event"||f.tag==="typedef"||f.tag==="callback")&&this.pendingTags.length>0){for(let f of this.pendingTags)Ne(this.ctx,"jsdoc-tag-dropped",f.name,`@${f.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 na(t,s=t.source){if(!s)return;let f={usedGenericsTag:!1,usedTemplateTag:!1,warnedMixedGenericsTags:!1,seenGenericNames:new Set},E=s.includes("@template")?Cr(t):new Set;t.functionDocCommentStarts=E;let C=x(s);for(let w of C)t.jsDocBlocksByStart.set(w.start,w);for(let w of C)new ta(t,f,w,E.has(w.start)).read()}var sa=new Set(["$state","$derived","$effect","$props","$bindable","$inspect","$host"]);function ec(t,s){switch(s?.type){case"MemberExpression":return s.computed||t===s.object;case"MethodDefinition":return!!s.computed;case"MetaProperty":return t===s.meta;case"PropertyDefinition":return s.computed||t===s.value;case"Property":return s.computed||t===s.value;case"ExportSpecifier":case"ImportSpecifier":return t===s.local;case"LabeledStatement":case"BreakStatement":case"ContinueStatement":return!1;default:return!0}}var tc=Array.from(sa);function ra(t){return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95||t===36}function nc(t){if(t.includes("\\u"))return!0;for(let s of tc){let f=t.indexOf(s);while(f!==-1){if(!ra(t.charCodeAt(f-1))&&!ra(t.charCodeAt(f+s.length)))return!0;f=t.indexOf(s,f+1)}}return!1}function rc(t,s){for(let f=s.length-1;f>=0;f-=1)if(s[f]?.has(t))return!0;return!1}function sc(t){let s=new Set;if(!t||typeof t!=="object"||!("type"in t))return s;switch(String(t.type)){case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":{let f=t;if(f.id?.name)s.add(f.id.name);for(let E of f.params??[])Oe(E,s);break}case"BlockStatement":dn(t.body,s);break;case"CatchClause":Oe(t.param,s);break;case"EachBlock":{let f=t;if(Oe(f.context,s),typeof f.index==="string")s.add(f.index);else if(f.index?.name)s.add(f.index.name);break}case"AwaitBlock":{let f=t;Oe(f.value,s),Oe(f.error,s);break}}return s}function dn(t,s){if(!Array.isArray(t))return;for(let f of t){if(!f||typeof f!=="object"||!("type"in f))continue;switch(String(f.type)){case"ImportDeclaration":for(let E of f.specifiers??[])if(E.local?.name)s.add(E.local.name);break;case"VariableDeclaration":for(let E of f.declarations??[])Oe(E.id,s);break;case"FunctionDeclaration":case"ClassDeclaration":{let E=f.id?.name;if(E)s.add(E);break}case"ExportNamedDeclaration":{let E=f.declaration;if(E&&typeof E==="object"&&"type"in E)dn([E],s);break}}}}function gr(t,s){if(!t||typeof t!=="object")return!1;return Tr(t,void 0,[...s])}function Tr(t,s,f){if(pe(t.type))return!1;let E=Ct(t);if(E)f.push(sc(t));let C=!1;if(s&&t.type==="Identifier"&&t.name!==void 0&&sa.has(t.name)&&!s.type.startsWith("TS")&&ec(t,s)&&!rc(t.name,f))C=!0;else for(let w in t){if(w==="leadingComments")continue;let v=t[w];if(!v||typeof v!=="object")continue;if(Array.isArray(v)){for(let I=0;I<v.length;I++){let M=v[I];if(M&&typeof M==="object"&&typeof M.type==="string"){if(Tr(M,t,f)){C=!0;break}}}if(C)break}else if(typeof v.type==="string"){if(Tr(v,t,f)){C=!0;break}}}if(E)f.pop();return C}function ia(t){if(t.runesOptionOverride!==void 0)return t.runesOptionOverride?"runes":"legacy";let s=t.parsed;if(!s)return"legacy";if(t.source!==void 0&&!nc(t.source))return"legacy";let f=new Set;dn(s.module?.content.body,f);let E=new Set;return dn(s.instance?.content.body,E),gr(s.module,[f])||gr(s.instance,[f,E])||gr(s.fragment,[f,E])?"runes":"legacy"}var aa=new Set(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion","TSInstantiationExpression"]);function br(t){return t!==null&&typeof t==="object"&&typeof t.type==="string"}function oa(t){if(!aa.has(t.type))return t;let s=t.expression;while(s&&aa.has(s.type))s=s.expression;return s??t}function fn(t){if(!br(t))return;xr(t)}function xr(t){for(let s in t){if(s==="leadingComments")continue;let f=t[s];if(!f||typeof f!=="object")continue;if(Array.isArray(f))for(let E=0;E<f.length;E++){let C=f[E];if(!br(C))continue;let w=oa(C);if(w!==C)f[E]=w;xr(w)}else if(br(f)){let E=oa(f);if(E!==f)t[s]=E;xr(E)}}}var pa=/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi,la=/\/\/(?<!^[ \t]*\*.*\/\/)\s*@ts-[^\n\r]*/gm;function ic(t){if(!t.includes("@ts-"))return t;return pa.lastIndex=0,t.replace(pa,(s,f,E,C)=>{la.lastIndex=0;let w=E.replace(la,"");return f+w+C})}function ca(t,s,f){t.componentFilePath=f;let E=ic(s);t.source=E;let C=se(E);if(Di(t,C),t.parsed=C,t.scriptLanguage==="ts")fn(C.module),fn(C.instance),fn(C.fragment);t.syntaxMode=ia(t);let w=C.css,v=w?E.slice(0,w.start)+" ".repeat(w.end-w.start)+E.slice(w.end):E;ce(t,C.module),ce(t,C.instance),na(t,v)}class G{ctx=An();cleanup(){this.ctx=An()}parseSvelteComponent(t,s){let{component:f,pending:E}=this.parse(t,s);if(E)f[h]={...f[h]??{canonicalPropNames:[],localTypeDeclarations:[],typeImportStatements:[]},...E};return f}parse(t,s){this.cleanup();let f=this.ctx;ca(f,t,s.filePath),zi(f);let E=Bi(f);return qi(f,E)}}
36
+ export{Pe,Ae,B,ke,ie,de,se,G};