sveld 0.40.5 → 0.40.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser.d.ts +166 -52
- package/browser.js +121 -121
- package/chunk-0e70e5s3.js +40 -0
- package/chunk-9fmhgf46.js +193 -0
- package/chunk-a5y3ysxx.js +1 -0
- package/chunk-jw5zhqjv.js +5 -0
- package/cli-entry.js +2 -2
- package/index.d.ts +213 -79
- package/index.js +1 -1
- package/package.json +1 -1
- package/chunk-ep5n8z9k.js +0 -193
- package/chunk-j58p3sv3.js +0 -1
- package/chunk-x82fq7xs.js +0 -5
- package/chunk-xv4tka7y.js +0 -40
package/browser.js
CHANGED
|
@@ -1,119 +1,119 @@
|
|
|
1
|
-
function
|
|
2
|
-
`,
|
|
1
|
+
function sf(e){return e}function of(e){return sf(e)}var Oe=Symbol("sveld.parsedComponentTypeScriptMetadata"),oa=Symbol("sveld.parsedComponentPropIgnores");function aa(e){return e[Oe]}var Rr=Array(2048).fill(void 0);function af(){Rr.fill(void 0)}function la(e,t,n,i){let r=i&2047,s=Rr[r];if(s!==void 0&&s.length===n-t&&e.startsWith(s,t))return s;let l=e.slice(t,n);return Rr[r]=l,l}var kt="",we=[0],qe=0,Pt=0,Ue;function _t(e){af(),kt=e,we=[0],qe=0,Pt=0,Ue=void 0}function Mr(e){while(qe<=e){let t=kt.indexOf(`
|
|
2
|
+
`,qe);if(t===-1){qe=Number.POSITIVE_INFINITY;return}qe=t+1,we.push(qe)}}function pa(e){let t=[0],n=e.indexOf(`
|
|
3
3
|
`);while(n!==-1)t.push(n+1),n=e.indexOf(`
|
|
4
|
-
`,n+1);return t}function ei(e,t,n){let i=0,r=e.length-1;if(t>=e[n])i=n;else r=n-1;if(i<r&&t<e[i+1])r=i;while(i<r){let s=i+r+1>>>1;if(e[s]<=t)i=s;else r=s-1}return i}function Pe(e){return Lr(e),wt=ei(Ae,e,wt),{line:wt+1,column:e-Ae[wt],character:e}}var $r=/\r\n?|\n|\u2028|\u2029/g,ef=/[\r\u2028\u2029]/;function aa(e){if(He===void 0){He=ef.test(kt)?[]:null,$r.lastIndex=0;while(He!==null&&$r.exec(kt)!==null)He.push($r.lastIndex)}if(He===null)return Lr(e),ei(Ae,e,wt);let t=0,n=He.length;while(t<n){let i=t+n>>>1;if(He[i]<=e)t=i+1;else n=i}return t}function ot(e){let{line:t,column:n}=Pe(e);return{line:t,column:n}}function la(e){while(Ae.length<=e+1&&Ue!==Number.POSITIVE_INFINITY)Lr(Ue);if(e>=Ae.length)return;let t=e+1<Ae.length?Ae[e+1]-1:kt.length;return kt.slice(Ae[e],t)}function Rr(e){let t,n=0;return(i)=>(t??=oa(e),n=ei(t,i,n),{line:n+1,column:i-t[n]})}function Oe(e){return typeof e==="object"&&e!==null&&typeof at(e).type==="string"}function at(e){return e}function Qt(e,t){let n=at(e);for(let i in n){let r=n[i];if(Array.isArray(r)){for(let s=0;s<r.length;s++)if(Oe(r[s]))r[s]=t(r[s])}else if(Oe(r))n[i]=t(r)}}function Mr(e,...t){if(!t.some((n)=>n===e.type))throw Error(`expected ${t.join(" or ")}, got ${e.type}`)}function Or(e){let t=[];return lt(e,t),t}function lt(e,t){switch(e.type){case"Identifier":t.push(e);return;case"ObjectPattern":for(let n of e.properties)lt(n.type==="RestElement"?n.argument:n.value,t);return;case"ArrayPattern":for(let n of e.elements)if(n!==null)lt(n,t);return;case"RestElement":lt(e.argument,t);return;case"AssignmentPattern":lt(e.left,t);return;case"TSParameterProperty":lt(e.parameter,t);return;case"TSAsExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":lt(e.expression,t)}}function Br(e,t){if(e.type!=="Identifier")return!1;if(t===null)return!0;switch(t.type){case"MemberExpression":return t.computed||e===t.object;case"MethodDefinition":return t.computed;case"Property":case"PropertyDefinition":return t.computed||e===t.value;case"ExportSpecifier":case"ImportSpecifier":return e===t.local;case"MetaProperty":case"ImportAttribute":case"ExportAllDeclaration":case"LabeledStatement":case"BreakStatement":case"ContinueStatement":return!1;case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":case"TSInstantiationExpression":case"TSExportAssignment":return e===t.expression;case"TSEnumMember":return e===t.initializer;case"TSParameterProperty":case"TSEnumDeclaration":case"TSImportEqualsDeclaration":return!0;default:return!t.type.startsWith("TS")}}var pt={Root:["module","instance","fragment","css"],Script:["attributes","content"],Fragment:["nodes"],Text:[],Comment:[],ExpressionTag:["expression"],HtmlTag:["expression"],ConstTag:["declaration"],DeclarationTag:["declaration"],DebugTag:["identifiers"],RenderTag:["expression"],AttachTag:["expression"],Attribute:["value"],SpreadAttribute:["expression"],AnimateDirective:["expression"],BindDirective:["expression"],ClassDirective:["expression"],LetDirective:["expression"],OnDirective:["expression"],StyleDirective:["value"],TransitionDirective:["expression"],UseDirective:["expression"],Component:["attributes","fragment"],TitleElement:["attributes","fragment"],SlotElement:["attributes","fragment"],RegularElement:["attributes","fragment"],SvelteBody:["attributes","fragment"],SvelteBoundary:["attributes","fragment"],SvelteComponent:["expression","attributes","fragment"],SvelteDocument:["attributes","fragment"],SvelteElement:["tag","attributes","fragment"],SvelteFragment:["attributes","fragment"],SvelteHead:["attributes","fragment"],SvelteOptions:["attributes","fragment"],SvelteSelf:["attributes","fragment"],SvelteWindow:["attributes","fragment"],IfBlock:["test","consequent","alternate"],EachBlock:["expression","context","key","body","fallback"],AwaitBlock:["expression","pending","value","then","error","catch"],KeyBlock:["expression","fragment"],SnippetBlock:["expression","parameters","body"],StyleSheet:["attributes","children"],Rule:["prelude","block"],Atrule:["block"],SelectorList:["children"],ComplexSelector:["children"],RelativeSelector:["combinator","selectors"],Combinator:[],TypeSelector:[],IdSelector:[],ClassSelector:[],AttributeSelector:[],PseudoElementSelector:["args"],PseudoClassSelector:["args"],Percentage:[],Nth:[],NestingSelector:[],Block:["children"],Declaration:[],Program:["body"],ExpressionStatement:["expression"],BlockStatement:["body"],StaticBlock:["body"],EmptyStatement:[],DebuggerStatement:[],WithStatement:["object","body"],ReturnStatement:["argument"],LabeledStatement:["label","body"],BreakStatement:["label"],ContinueStatement:["label"],IfStatement:["test","consequent","alternate"],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],CatchClause:["param","body"],WhileStatement:["test","body"],DoWhileStatement:["body","test"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","typeParameters","params","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],ArrowFunctionExpression:["typeParameters","params","returnType","body"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","implements","body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","implements","body"],ClassBody:["body"],MethodDefinition:["decorators","key","typeParameters","value"],PropertyDefinition:["decorators","key","typeAnnotation","value"],Property:["decorators","key","value"],ThisExpression:[],Super:[],Literal:[],Identifier:["decorators","typeAnnotation"],PrivateIdentifier:[],ArrayExpression:["elements"],ObjectExpression:["properties"],UnaryExpression:["argument"],UpdateExpression:["argument"],BinaryExpression:["left","right"],LogicalExpression:["left","right"],AssignmentExpression:["left","right"],MemberExpression:["object","property"],ConditionalExpression:["test","consequent","alternate"],CallExpression:["callee","typeArguments","arguments"],NewExpression:["callee","typeArguments","arguments"],SequenceExpression:["expressions"],TemplateLiteral:["quasis","expressions"],TaggedTemplateExpression:["tag","typeArguments","quasi"],TemplateElement:[],SpreadElement:["argument"],RestElement:["decorators","argument","typeAnnotation"],YieldExpression:["argument"],AwaitExpression:["argument"],ImportExpression:["source","options","arguments"],ChainExpression:["expression"],ParenthesizedExpression:["expression"],MetaProperty:["meta","property"],ObjectPattern:["decorators","properties","typeAnnotation"],ArrayPattern:["decorators","elements","typeAnnotation"],AssignmentPattern:["decorators","left","right"],ImportDeclaration:["specifiers","source","attributes"],ImportSpecifier:["imported","local"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportAttribute:["key","value"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ExportDefaultDeclaration:["declaration"],ExportAllDeclaration:["exported","source","attributes"],Decorator:["expression"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterDeclaration:["params"],TSTypeParameterInstantiation:["params"],TSTypeParameter:["constraint","default"],TSAnyKeyword:[],TSBigIntKeyword:[],TSBooleanKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSNamedTupleMember:["label","elementType"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","nameType","typeAnnotation"],TSLiteralType:["literal"],TSTypeReference:["typeName","typeArguments"],TSQualifiedName:["left","right"],TSTypeQuery:["exprName","typeArguments"],TSImportType:["argument","qualifier","typeArguments"],TSTypeLiteral:["members"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation"],TSFunctionType:["typeParameters","parameters","typeAnnotation"],TSConstructorType:["typeParameters","parameters","typeAnnotation"],TSIndexSignature:["decorators","parameters","typeAnnotation"],TSTypePredicate:["parameterName","typeAnnotation"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSDeclareFunction:["id","typeParameters","params","returnType"],TSDeclareMethod:["typeParameters","params","returnType"],TSParameterProperty:["parameter"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSNonNullExpression:["expression"],TSInstantiationExpression:["expression","typeArguments"]};var _=[],Nt={...pt,FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],ArrowFunctionExpression:["params","body"],ClassDeclaration:["decorators","id","superClass","body"],ClassExpression:["decorators","id","superClass","body"],MethodDefinition:["decorators","key","value"],PropertyDefinition:["decorators","key","value"],Identifier:["decorators"],CallExpression:["callee","arguments"],NewExpression:["callee","arguments"],TaggedTemplateExpression:["tag","quasi"],RestElement:["decorators","argument"],ObjectPattern:["decorators","properties"],ArrayPattern:["decorators","elements"],TSTypeAnnotation:_,TSTypeParameterDeclaration:_,TSTypeParameterInstantiation:_,TSTypeParameter:_,TSArrayType:_,TSTupleType:_,TSNamedTupleMember:_,TSOptionalType:_,TSRestType:_,TSUnionType:_,TSIntersectionType:_,TSConditionalType:_,TSInferType:_,TSParenthesizedType:_,TSTypeOperator:_,TSIndexedAccessType:_,TSMappedType:_,TSLiteralType:_,TSTypeReference:_,TSTypeQuery:_,TSImportType:_,TSTypeLiteral:_,TSPropertySignature:_,TSMethodSignature:_,TSCallSignatureDeclaration:_,TSConstructSignatureDeclaration:_,TSFunctionType:_,TSConstructorType:_,TSIndexSignature:_,TSTypePredicate:_,TSInterfaceDeclaration:_,TSInterfaceBody:_,TSExpressionWithTypeArguments:_,TSTypeAliasDeclaration:_,TSNamespaceExportDeclaration:_,TSDeclareFunction:["id"],TSDeclareMethod:_,TSAsExpression:["expression"],TSSatisfiesExpression:["expression"],TSTypeAssertion:["expression"],TSInstantiationExpression:["expression"]},tf=Object.assign(Object.create(null),pt),nf=Object.assign(Object.create(null),Nt),pa=[],Zt=Symbol("svelte-ast.walk.stop"),ie=Symbol("svelte-ast.walk.skip");function z(e,t,n){ti(e,null,null,null,t,rf(n))}function rf(e){if(e===void 0||e===pt)return of;if(e===Nt)return af;return(t)=>sf(e,t.type)}function sf(e,t){return Object.hasOwn(e,t)?e[t]:void 0}var ov=Object.freeze([]);function ti(e,t,n,i,r,s){let l=s(e);if(l===void 0)throw Error(`unknown node type: ${e.type}`);let o=r.enter?.(e,t,n,i);if(o===Zt)return!0;if(o!==ie){if(o!==e&&Oe(o))return lf(o,t,n,i,r,s);let a=at(e);for(let p=0;p<l.length;p++){let c=l[p],u=a[c];if(Array.isArray(u))for(let f=0;f<u.length;f++){let h=u[f];if(Oe(h)&&ti(h,e,c,f,r,s))return!0}else if(Oe(u)&&ti(u,e,c,null,r,s))return!0}}return r.leave?.(e,t,n,i)===Zt}function of(e){let t=e.type;if(t==="Identifier")return e.typeAnnotation===void 0&&e.decorators===void 0?pa:pt.Identifier;if(t==="Literal")return pt.Literal;if(t==="Text")return pt.Text;return tf[t]}function af(e){let t=e.type;if(t==="Identifier")return e.decorators===void 0?pa:Nt.Identifier;if(t==="Literal")return Nt.Literal;if(t==="Text")return Nt.Text;return nf[t]}function lf(e,t,n,i,r,s){if(t===null||n===null)throw Error("walk can't replace the node it was called with");let l=at(t),o=l[n];if(i===null)l[n]=e;else if(Array.isArray(o))o[i]=e;return ti(e,t,n,i,r,s)}function Be(e){return typeof e==="object"&&e!==null}function qe(e){return Be(e)&&e.type==="Literal"}function T(e){return Be(e)&&e.type==="Identifier"&&typeof e.name==="string"}function ze(e){return Be(e)&&e.type==="MemberExpression"}function re(e){return Be(e)&&e.type==="ObjectExpression"&&Array.isArray(e.properties)}function pf(e){return Be(e)&&e.type==="CallExpression"}function me(e,t){return pf(e)&&T(e.callee)&&e.callee.name===t}function Dt(e){return e?.type==="TSAsExpression"||e?.type==="TSSatisfiesExpression"?Dt(e.expression):e}function ca(e){return e?.type==="TSAsExpression"||e?.type==="TSSatisfiesExpression"?e.typeAnnotation:void 0}function cf(e){return Be(e)&&e.type==="NewExpression"}function Fr(e,t){return cf(e)&&T(e.callee)&&e.callee.name===t}function ua(e){if(!Be(e))return null;if(e.type==="Literal")return e.value==null?null:String(e.value);if(e.type==="TemplateLiteral"){let t=e.quasis;if(t?.length===1)return t[0]?.value?.cooked??null}return null}function J(e){if(T(e))return e.name;if(qe(e))return e.value==null?void 0:String(e.value);return}var uf=new Set(["Component","SvelteComponent","SvelteSelf"]),df=new Set(["RegularElement","SvelteElement"]);function $t(e){return uf.has(e)}function ct(e){return df.has(e)}function ni(e,t,n=0,i=e.length,r=0){let s=r;for(let l=n;l<i;l++){let o=e.charCodeAt(l);if(o===34||o===39||o===96){l=ff(e,l,i);continue}if(o===123||o===40||o===91||o===60)s++;else if(o===125||o===41||o===93||o===62&&e.charCodeAt(l-1)!==61){if(s>0)s--}if(t?.(l,s)===!0)break}return s}function ff(e,t,n){let i=e.charCodeAt(t);for(let r=t+1;r<n;r++){let s=e.charCodeAt(r);if(s===92)r++;else if(s===i)return r}return n-1}function F(e,t){let n=[],i=0;return ni(e,(r,s)=>{if(s===0&&t.includes(e[r]))n.push(e.slice(i,r)),i=r+1;return!1}),n.push(e.slice(i)),n}function Vr(e,t,n=0){let i=-1;return ni(e,(r,s)=>{if(t(r,s))i=r;return i!==-1},n),i}function en(e,t){return Vr(e,(n,i)=>i===0&&t.includes(e[n]))}function It(e){return Vr(e,(t,n)=>n===0&&e[t]==="="&&e[t+1]===">")}function Ke(e,t){return Vr(e,(n,i)=>i===0,t)}function jr(e){let t=e.trim();return t.startsWith("[")&&Ke(t,0)===t.length-1}function da(e){if(!e)return;let t=It(e);if(t===-1)return;return e.slice(t+2).trim()||void 0}var hf=new Set(["null","undefined"]);function ii(e){if(!e)return!1;let t=F(e,"|").map((i)=>i.trim()).filter((i)=>i&&!hf.has(i));if(t.length!==1)return!1;let n=mf(t[0]);return(n.startsWith("(")||n.startsWith("<"))&&It(n)!==-1}function mf(e){let t=e.trim();while(t.startsWith("(")&&Ke(t,0)===t.length-1)t=t.slice(1,-1).trim();return t}function Gr(){return{syntaxMode:"legacy",scriptLanguage:void 0,source:void 0,parsed:void 0,runesOptionOverride:void 0,sourceLocator: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:[],explicitVariableTypesByName:new Map,explicitVariableTypeNodesByName:new Map,typeImportBindingsByLocalName:new Map,localTypeDeclarationsByName:new Map,additionalTypeDependencyNodes:[],additionalImportedTypes:new Map,wholePropsLocals:new Set,restPropLocals:new Set,componentScope:new Map,activeScopes:[],slots:new Map,snippetPropLocals:new Set,jsDocSlots:new Map,renderedSlots:new Set,slotsUntracked:!1,cssParts:[],cssProperties:[],deferredSlotBlockGenerics:[],events:new Map,eventDescriptions:new Map,forwardedEvents:new Map,jsDocEventNames:new Set,typedDispatcherEventNames:new Set,explicitDefaultPropNames:new Set,untypedJsDocEventNames:new Set,jsDocEventSources:new Map,bindings:new Map,typeCasts:{constAssertions:new WeakSet,typeAssertions:new WeakMap},contexts:new Map,typedefs:new Map,typedefMembersByName:new Map,variableInfoCache:void 0,sveldIgnoreDirectives:new Map,propIgnoreCodes:new Map}}function Wr(e,t){return e.propLocalToPublicName.get(t)??t}function ri(e,t,n=t){e.propLocalToPublicName.set(n,t)}function Hr(e,t){return e.props.get(Wr(e,t))}function tn(e,t){return Hr(e,t)?.type}var fa={"prop-unknown-type":{severity:"warning",label:"Props without inferred types"},"context-any-type":{severity:"warning",label:"Context values typed as `any`"},"bind-this-type-mismatch":{severity:"warning",label:"bind:this props declared with an element type they're never bound to"},"slot-missing-type":{severity:"warning",label:"@slot/@snippet tags missing a {Type} annotation"},"slot-not-rendered":{severity:"warning",label:"@slot/@snippet tags for slots the component doesn't render"},"event-no-source":{severity:"warning",label:"@event tags with no dispatch or callback"},"dispatch-escapes":{severity:"warning",label:"Dispatchers passed to functions sveld can't follow"},"example-compile-error":{severity:"error",label:"@example blocks that failed to compile"},"example-syntax-error":{severity:"error",label:"@example blocks that failed to parse"},"syntax-skipped":{severity:"error",label:"Component syntax sveld skipped"},"type-syntax-error":{severity:"error",label:"JSDoc types that aren't valid TypeScript"},"rest-props-unresolved":{severity:"warning",label:"$$restProps spread only onto components"},"context-duplicate-key":{severity:"warning",label:"Duplicate setContext keys"},"context-key-unresolved":{severity:"warning",label:"setContext keys sveld couldn't resolve"},"context-value-unresolved":{severity:"warning",label:"setContext values sveld couldn't describe"},"spread-unresolved":{severity:"warning",label:"Unresolved spreads widened to Record<string, any>"},"export-unresolved":{severity:"warning",label:"Unresolved named export specifiers"},"module-export-conflict":{severity:"warning",label:"Module-script exports colliding with generated names"},"extend-props-target-missing":{severity:"error",label:"@extends/@extendProps targets that couldn't be verified"},"extend-props-duplicate":{severity:"warning",label:"Duplicate @extends/@extendProps tags"},"extend-props-override":{severity:"warning",label:"Own props overriding an @extends target's prop"},"jsdoc-unknown-tag":{severity:"warning",label:"Unknown JSDoc tags"},"typedef-duplicate":{severity:"warning",label:"Duplicate @typedef/@callback names"},"property-duplicate":{severity:"warning",label:"Duplicate @property names"},"generics-conflict":{severity:"warning",label:"Duplicate @generics/@template names"},"event-description-ambiguous":{severity:"warning",label:"Text after an @event read as the next tag's description"},"jsdoc-tag-dropped":{severity:"warning",label:"Passthrough JSDoc tags that couldn't attach"},"internal-typedef-referenced":{severity:"error",label:"Public types referencing an @internal typedef"},"cross-file-unresolved":{severity:"warning",label:"Imports a standalone parse couldn't read"},"export-ambiguous":{severity:"warning",label:"Ambiguous `export *` names left out of the entry exports"}};function si(e){return{...e,code:Ur[e.kind],severity:fa[e.kind].severity}}var yf=Object.keys(fa),Ur=Object.fromEntries(yf.map((e)=>[e,`sveld/${e}`]));function D(e,t,n,i,r){e.diagnosticRecords.push(qr(e,t,n,i,r))}function qr(e,t,n,i,r){return si({component:e.componentFilePath,kind:t,name:n,message:i,...r?{source:r}:{},...zr(e,t,n)?{ignored:!0}:{}})}function ha(e,t){return`${e}:${t}`}function Je(e,t,n,i){if(!i||i.length===0)return;let r=ha(t,n),s=e.sveldIgnoreDirectives.get(r)??new Set;for(let l of i)s.add(l);e.sveldIgnoreDirectives.set(r,s)}function nn(e,t,n){if(Je(e,"prop-unknown-type",t,n),Je(e,"bind-this-type-mismatch",t,n),n&&n.length>0)e.propIgnoreCodes.set(t,n)}function zr(e,t,n){let i=e.sveldIgnoreDirectives.get(ha(t,n));if(!i)return!1;return i.has("")||i.has(Ur[t])}var Kr="/**",ma="*",oi="*/",gf="```",Jr=/^\s+/,ya=/\s/,xf=/^@[^\s/]+(?=\s|$)/,Sf=/^@(\S+)\s*/,Ef=new Set(["extends","extendProps","generics","template","typedef"]);function rn(e){let t=0;while(t<e.length){let n=e.charCodeAt(t);if(n!==32&&n!==9&&n!==13&&n!==10&&!ya.test(e[t]))break;t++}return t}function Tf(e,t){let n=e.slice(rn(e)),i=!1;if(t)n=n.slice(Kr.length),i=!0;else if(n.startsWith(ma)&&!n.startsWith(oi))n=n.slice(ma.length),i=!0;let r=n.slice(0,rn(n));n=n.slice(r.length);let s=n.trimEnd(),l=s.endsWith(oi)?s.slice(0,-oi.length).trimEnd():n;return{indent:i?r.slice(1):r,content:l}}function vf(e,t,n){let i=n>t&&e.charCodeAt(n-1)===13?n-1:n;return e.slice(t,i)}function bf(e){let t=[],n=0;while(!0){let i=e.indexOf(Kr,n);if(i===-1)break;let r=e.lastIndexOf(`
|
|
5
|
-
`,i-1)+1;if(e.charCodeAt(i+
|
|
6
|
-
`,l),c=p===-1?e.length:p,u=
|
|
7
|
-
`)}function
|
|
8
|
-
`),i=Ke(n,0);if(i===-1)return null;let r=[],s=i+1;for(let a=t;s>0;a++){let p=e[a].content.length;r.push(Math.min(s,p)),s-=p+1}let l=t+r.length-1;return{type:r.map((a,p)=>{let c=t+p,u=e[c].content.slice(0,a);if(e[c].content=e[c].content.slice(a).replace(
|
|
9
|
-
`).slice(1,-1),endIndex:l}}function
|
|
10
|
-
`);t.content=r,t.tag=i;let a=
|
|
4
|
+
`,n+1);return t}function ti(e,t,n){let i=0,r=e.length-1;if(t>=e[n])i=n;else r=n-1;if(i<r&&t<e[i+1])r=i;while(i<r){let s=i+r+1>>>1;if(e[s]<=t)i=s;else r=s-1}return i}function Pe(e){return Mr(e),Pt=ti(we,e,Pt),{line:Pt+1,column:e-we[Pt],character:e}}var Lr=/\r\n?|\n|\u2028|\u2029/g,lf=/[\r\u2028\u2029]/;function ca(e){if(Ue===void 0){Ue=lf.test(kt)?[]:null,Lr.lastIndex=0;while(Ue!==null&&Lr.exec(kt)!==null)Ue.push(Lr.lastIndex)}if(Ue===null)return Mr(e),ti(we,e,Pt);let t=0,n=Ue.length;while(t<n){let i=t+n>>>1;if(Ue[i]<=e)t=i+1;else n=i}return t}function ot(e){let{line:t,column:n}=Pe(e);return{line:t,column:n}}function ua(e){while(we.length<=e+1&&qe!==Number.POSITIVE_INFINITY)Mr(qe);if(e>=we.length)return;let t=e+1<we.length?we[e+1]-1:kt.length;return kt.slice(we[e],t)}function Or(e){let t,n=0;return(i)=>(t??=pa(e),n=ti(t,i,n),{line:n+1,column:i-t[n]})}function Be(e){return typeof e==="object"&&e!==null&&typeof at(e).type==="string"}function at(e){return e}function Zt(e,t){let n=at(e);for(let i in n){let r=n[i];if(Array.isArray(r)){for(let s=0;s<r.length;s++)if(Be(r[s]))r[s]=t(r[s])}else if(Be(r))n[i]=t(r)}}function Br(e,...t){if(!t.some((n)=>n===e.type))throw Error(`expected ${t.join(" or ")}, got ${e.type}`)}function Fr(e){let t=[];return lt(e,t),t}function lt(e,t){switch(e.type){case"Identifier":t.push(e);return;case"ObjectPattern":for(let n of e.properties)lt(n.type==="RestElement"?n.argument:n.value,t);return;case"ArrayPattern":for(let n of e.elements)if(n!==null)lt(n,t);return;case"RestElement":lt(e.argument,t);return;case"AssignmentPattern":lt(e.left,t);return;case"TSParameterProperty":lt(e.parameter,t);return;case"TSAsExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":lt(e.expression,t)}}function Vr(e,t){if(e.type!=="Identifier")return!1;if(t===null)return!0;switch(t.type){case"MemberExpression":return t.computed||e===t.object;case"MethodDefinition":return t.computed;case"Property":case"PropertyDefinition":return t.computed||e===t.value;case"ExportSpecifier":case"ImportSpecifier":return e===t.local;case"MetaProperty":case"ImportAttribute":case"ExportAllDeclaration":case"LabeledStatement":case"BreakStatement":case"ContinueStatement":return!1;case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":case"TSInstantiationExpression":case"TSExportAssignment":return e===t.expression;case"TSEnumMember":return e===t.initializer;case"TSParameterProperty":case"TSEnumDeclaration":case"TSImportEqualsDeclaration":return!0;default:return!t.type.startsWith("TS")}}var pt={Root:["module","instance","fragment","css"],Script:["attributes","content"],Fragment:["nodes"],Text:[],Comment:[],ExpressionTag:["expression"],HtmlTag:["expression"],ConstTag:["declaration"],DeclarationTag:["declaration"],DebugTag:["identifiers"],RenderTag:["expression"],AttachTag:["expression"],Attribute:["value"],SpreadAttribute:["expression"],AnimateDirective:["expression"],BindDirective:["expression"],ClassDirective:["expression"],LetDirective:["expression"],OnDirective:["expression"],StyleDirective:["value"],TransitionDirective:["expression"],UseDirective:["expression"],Component:["attributes","fragment"],TitleElement:["attributes","fragment"],SlotElement:["attributes","fragment"],RegularElement:["attributes","fragment"],SvelteBody:["attributes","fragment"],SvelteBoundary:["attributes","fragment"],SvelteComponent:["expression","attributes","fragment"],SvelteDocument:["attributes","fragment"],SvelteElement:["tag","attributes","fragment"],SvelteFragment:["attributes","fragment"],SvelteHead:["attributes","fragment"],SvelteOptions:["attributes","fragment"],SvelteSelf:["attributes","fragment"],SvelteWindow:["attributes","fragment"],IfBlock:["test","consequent","alternate"],EachBlock:["expression","context","key","body","fallback"],AwaitBlock:["expression","pending","value","then","error","catch"],KeyBlock:["expression","fragment"],SnippetBlock:["expression","parameters","body"],StyleSheet:["attributes","children"],Rule:["prelude","block"],Atrule:["block"],SelectorList:["children"],ComplexSelector:["children"],RelativeSelector:["combinator","selectors"],Combinator:[],TypeSelector:[],IdSelector:[],ClassSelector:[],AttributeSelector:[],PseudoElementSelector:["args"],PseudoClassSelector:["args"],Percentage:[],Nth:[],NestingSelector:[],Block:["children"],Declaration:[],Program:["body"],ExpressionStatement:["expression"],BlockStatement:["body"],StaticBlock:["body"],EmptyStatement:[],DebuggerStatement:[],WithStatement:["object","body"],ReturnStatement:["argument"],LabeledStatement:["label","body"],BreakStatement:["label"],ContinueStatement:["label"],IfStatement:["test","consequent","alternate"],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],CatchClause:["param","body"],WhileStatement:["test","body"],DoWhileStatement:["body","test"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","typeParameters","params","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],ArrowFunctionExpression:["typeParameters","params","returnType","body"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","implements","body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","implements","body"],ClassBody:["body"],MethodDefinition:["decorators","key","typeParameters","value"],PropertyDefinition:["decorators","key","typeAnnotation","value"],Property:["decorators","key","value"],ThisExpression:[],Super:[],Literal:[],Identifier:["decorators","typeAnnotation"],PrivateIdentifier:[],ArrayExpression:["elements"],ObjectExpression:["properties"],UnaryExpression:["argument"],UpdateExpression:["argument"],BinaryExpression:["left","right"],LogicalExpression:["left","right"],AssignmentExpression:["left","right"],MemberExpression:["object","property"],ConditionalExpression:["test","consequent","alternate"],CallExpression:["callee","typeArguments","arguments"],NewExpression:["callee","typeArguments","arguments"],SequenceExpression:["expressions"],TemplateLiteral:["quasis","expressions"],TaggedTemplateExpression:["tag","typeArguments","quasi"],TemplateElement:[],SpreadElement:["argument"],RestElement:["decorators","argument","typeAnnotation"],YieldExpression:["argument"],AwaitExpression:["argument"],ImportExpression:["source","options","arguments"],ChainExpression:["expression"],ParenthesizedExpression:["expression"],MetaProperty:["meta","property"],ObjectPattern:["decorators","properties","typeAnnotation"],ArrayPattern:["decorators","elements","typeAnnotation"],AssignmentPattern:["decorators","left","right"],ImportDeclaration:["specifiers","source","attributes"],ImportSpecifier:["imported","local"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportAttribute:["key","value"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ExportDefaultDeclaration:["declaration"],ExportAllDeclaration:["exported","source","attributes"],Decorator:["expression"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterDeclaration:["params"],TSTypeParameterInstantiation:["params"],TSTypeParameter:["constraint","default"],TSAnyKeyword:[],TSBigIntKeyword:[],TSBooleanKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSNamedTupleMember:["label","elementType"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","nameType","typeAnnotation"],TSLiteralType:["literal"],TSTypeReference:["typeName","typeArguments"],TSQualifiedName:["left","right"],TSTypeQuery:["exprName","typeArguments"],TSImportType:["argument","qualifier","typeArguments"],TSTypeLiteral:["members"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation"],TSFunctionType:["typeParameters","parameters","typeAnnotation"],TSConstructorType:["typeParameters","parameters","typeAnnotation"],TSIndexSignature:["decorators","parameters","typeAnnotation"],TSTypePredicate:["parameterName","typeAnnotation"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSDeclareFunction:["id","typeParameters","params","returnType"],TSDeclareMethod:["typeParameters","params","returnType"],TSParameterProperty:["parameter"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSNonNullExpression:["expression"],TSInstantiationExpression:["expression","typeArguments"]};var _=[],Nt={...pt,FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],ArrowFunctionExpression:["params","body"],ClassDeclaration:["decorators","id","superClass","body"],ClassExpression:["decorators","id","superClass","body"],MethodDefinition:["decorators","key","value"],PropertyDefinition:["decorators","key","value"],Identifier:["decorators"],CallExpression:["callee","arguments"],NewExpression:["callee","arguments"],TaggedTemplateExpression:["tag","quasi"],RestElement:["decorators","argument"],ObjectPattern:["decorators","properties"],ArrayPattern:["decorators","elements"],TSTypeAnnotation:_,TSTypeParameterDeclaration:_,TSTypeParameterInstantiation:_,TSTypeParameter:_,TSArrayType:_,TSTupleType:_,TSNamedTupleMember:_,TSOptionalType:_,TSRestType:_,TSUnionType:_,TSIntersectionType:_,TSConditionalType:_,TSInferType:_,TSParenthesizedType:_,TSTypeOperator:_,TSIndexedAccessType:_,TSMappedType:_,TSLiteralType:_,TSTypeReference:_,TSTypeQuery:_,TSImportType:_,TSTypeLiteral:_,TSPropertySignature:_,TSMethodSignature:_,TSCallSignatureDeclaration:_,TSConstructSignatureDeclaration:_,TSFunctionType:_,TSConstructorType:_,TSIndexSignature:_,TSTypePredicate:_,TSInterfaceDeclaration:_,TSInterfaceBody:_,TSExpressionWithTypeArguments:_,TSTypeAliasDeclaration:_,TSNamespaceExportDeclaration:_,TSDeclareFunction:["id"],TSDeclareMethod:_,TSAsExpression:["expression"],TSSatisfiesExpression:["expression"],TSTypeAssertion:["expression"],TSInstantiationExpression:["expression"]},pf=Object.assign(Object.create(null),pt),cf=Object.assign(Object.create(null),Nt),da=[],en=Symbol("svelte-ast.walk.stop"),re=Symbol("svelte-ast.walk.skip");function K(e,t,n){ni(e,null,null,null,t,uf(n))}function uf(e){if(e===void 0||e===pt)return ff;if(e===Nt)return hf;return(t)=>df(e,t.type)}function df(e,t){return Object.hasOwn(e,t)?e[t]:void 0}var Eb=Object.freeze([]);function ni(e,t,n,i,r,s){let l=s(e);if(l===void 0)throw Error(`unknown node type: ${e.type}`);let o=r.enter?.(e,t,n,i);if(o===en)return!0;if(o!==re){if(o!==e&&Be(o))return mf(o,t,n,i,r,s);let a=at(e);for(let p=0;p<l.length;p++){let c=l[p],u=a[c];if(Array.isArray(u))for(let f=0;f<u.length;f++){let h=u[f];if(Be(h)&&ni(h,e,c,f,r,s))return!0}else if(Be(u)&&ni(u,e,c,null,r,s))return!0}}return r.leave?.(e,t,n,i)===en}function ff(e){let t=e.type;if(t==="Identifier")return e.typeAnnotation===void 0&&e.decorators===void 0?da:pt.Identifier;if(t==="Literal")return pt.Literal;if(t==="Text")return pt.Text;return pf[t]}function hf(e){let t=e.type;if(t==="Identifier")return e.decorators===void 0?da:Nt.Identifier;if(t==="Literal")return Nt.Literal;if(t==="Text")return Nt.Text;return cf[t]}function mf(e,t,n,i,r,s){if(t===null||n===null)throw Error("walk can't replace the node it was called with");let l=at(t),o=l[n];if(i===null)l[n]=e;else if(Array.isArray(o))o[i]=e;return ni(e,t,n,i,r,s)}function j(e){return typeof e==="object"&&e!==null}function Fe(e){return j(e)&&e.type==="Literal"}function T(e){return j(e)&&e.type==="Identifier"&&typeof e.name==="string"}function ze(e){return j(e)&&e.type==="MemberExpression"}function se(e){return j(e)&&e.type==="ObjectExpression"&&Array.isArray(e.properties)}function yf(e){return j(e)&&e.type==="CallExpression"}function ye(e,t){return yf(e)&&T(e.callee)&&e.callee.name===t}function Dt(e){return e?.type==="TSAsExpression"||e?.type==="TSSatisfiesExpression"?Dt(e.expression):e}function fa(e){return e?.type==="TSAsExpression"||e?.type==="TSSatisfiesExpression"?e.typeAnnotation:void 0}function gf(e){return j(e)&&e.type==="NewExpression"}function jr(e,t){return gf(e)&&T(e.callee)&&e.callee.name===t}function ha(e){if(Fe(e))return e.value==null?null:String(e.value);if(!j(e)||e.type!=="TemplateLiteral"||!Array.isArray(e.quasis))return null;if(e.quasis.length!==1)return null;let t=e.quasis[0];if(!j(t)||!j(t.value))return null;return typeof t.value.cooked==="string"?t.value.cooked:null}function X(e){if(T(e))return e.name;if(Fe(e))return e.value==null?void 0:String(e.value);return}var xf=new Set(["Component","SvelteComponent","SvelteSelf"]),Ef=new Set(["RegularElement","SvelteElement"]);function $t(e){return xf.has(e)}function ct(e){return Ef.has(e)}function ii(e,t,n=0,i=e.length,r=0){let s=r;for(let l=n;l<i;l++){let o=e.charCodeAt(l);if(o===34||o===39||o===96){l=Sf(e,l,i);continue}if(o===123||o===40||o===91||o===60)s++;else if(o===125||o===41||o===93||o===62&&e.charCodeAt(l-1)!==61){if(s>0)s--}if(t?.(l,s)===!0)break}return s}function Sf(e,t,n){let i=e.charCodeAt(t);for(let r=t+1;r<n;r++){let s=e.charCodeAt(r);if(s===92)r++;else if(s===i)return r}return n-1}function F(e,t){let n=[],i=0;return ii(e,(r,s)=>{if(s===0&&t.includes(e[r]))n.push(e.slice(i,r)),i=r+1;return!1}),n.push(e.slice(i)),n}function Gr(e,t,n=0){let i=-1;return ii(e,(r,s)=>{if(t(r,s))i=r;return i!==-1},n),i}function tn(e,t){return Gr(e,(n,i)=>i===0&&t.includes(e[n]))}function It(e){return Gr(e,(t,n)=>n===0&&e[t]==="="&&e[t+1]===">")}function Ke(e,t){return Gr(e,(n,i)=>i===0,t)}function Wr(e){let t=e.trim();return t.startsWith("[")&&Ke(t,0)===t.length-1}function ma(e){if(!e)return;let t=It(e);if(t===-1)return;return e.slice(t+2).trim()||void 0}var Tf=new Set(["null","undefined"]);function ri(e){if(!e)return!1;let t=F(e,"|").map((i)=>i.trim()).filter((i)=>i&&!Tf.has(i));if(t.length!==1)return!1;let n=bf(t[0]);return(n.startsWith("(")||n.startsWith("<"))&&It(n)!==-1}function bf(e){let t=e.trim();while(t.startsWith("(")&&Ke(t,0)===t.length-1)t=t.slice(1,-1).trim();return t}function Hr(){return{syntaxMode:"legacy",scriptLanguage:void 0,source:void 0,parsed:void 0,runesOptionOverride:void 0,sourceLocator: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:[],explicitVariableTypesByName:new Map,explicitVariableTypeNodesByName:new Map,typeImportBindingsByLocalName:new Map,localTypeDeclarationsByName:new Map,additionalTypeDependencyNodes:[],additionalImportedTypes:new Map,wholePropsLocals:new Set,restPropLocals:new Set,componentScope:new Map,activeScopes:[],slots:new Map,snippetPropLocals:new Set,jsDocSlots:new Map,renderedSlots:new Set,slotsUntracked:!1,cssParts:[],cssProperties:[],deferredSlotBlockGenerics:[],events:new Map,eventDescriptions:new Map,forwardedEvents:new Map,jsDocEventNames:new Set,typedDispatcherEventNames:new Set,explicitDefaultPropNames:new Set,untypedJsDocEventNames:new Set,jsDocEventSources:new Map,bindings:new Map,typeCasts:{constAssertions:new WeakSet,typeAssertions:new WeakMap},contexts:new Map,typedefs:new Map,typedefMembersByName:new Map,variableInfoCache:void 0,sveldIgnoreDirectives:new Map,propIgnoreCodes:new Map}}function Ur(e,t){return e.propLocalToPublicName.get(t)??t}function si(e,t,n=t){e.propLocalToPublicName.set(n,t)}function qr(e,t){return e.props.get(Ur(e,t))}function nn(e,t){return qr(e,t)?.type}var zr={"prop-unknown-type":{severity:"warning",label:"Props without inferred types"},"context-any-type":{severity:"warning",label:"Context values typed as `any`"},"bind-this-type-mismatch":{severity:"warning",label:"bind:this props declared with an element type they're never bound to"},"slot-missing-type":{severity:"warning",label:"@slot/@snippet tags missing a {Type} annotation"},"slot-not-rendered":{severity:"warning",label:"@slot/@snippet tags for slots the component doesn't render"},"event-no-source":{severity:"warning",label:"@event tags with no dispatch or callback"},"dispatch-escapes":{severity:"warning",label:"Dispatchers passed to functions sveld can't follow"},"example-compile-error":{severity:"error",label:"@example blocks that failed to compile"},"example-syntax-error":{severity:"error",label:"@example blocks that failed to parse"},"syntax-skipped":{severity:"error",label:"Component syntax sveld skipped"},"type-syntax-error":{severity:"error",label:"JSDoc types that aren't valid TypeScript"},"rest-props-unresolved":{severity:"warning",label:"$$restProps spread only onto components"},"context-duplicate-key":{severity:"warning",label:"Duplicate setContext keys"},"context-key-unresolved":{severity:"warning",label:"setContext keys sveld couldn't resolve"},"context-value-unresolved":{severity:"warning",label:"setContext values sveld couldn't describe"},"spread-unresolved":{severity:"warning",label:"Unresolved spreads widened to Record<string, any>"},"export-unresolved":{severity:"warning",label:"Unresolved named export specifiers"},"module-export-conflict":{severity:"warning",label:"Module-script exports colliding with generated names"},"extend-props-target-missing":{severity:"error",label:"@extends/@extendProps targets that couldn't be verified"},"extend-props-duplicate":{severity:"warning",label:"Duplicate @extends/@extendProps tags"},"extend-props-override":{severity:"warning",label:"Own props overriding an @extends target's prop"},"jsdoc-unknown-tag":{severity:"warning",label:"Unknown JSDoc tags"},"typedef-duplicate":{severity:"warning",label:"Duplicate @typedef/@callback names"},"property-duplicate":{severity:"warning",label:"Duplicate @property names"},"generics-conflict":{severity:"warning",label:"Duplicate @generics/@template names"},"event-description-ambiguous":{severity:"warning",label:"Text after an @event read as the next tag's description"},"jsdoc-tag-dropped":{severity:"warning",label:"Passthrough JSDoc tags that couldn't attach"},"internal-typedef-referenced":{severity:"error",label:"Public types referencing an @internal typedef"},"cross-file-unresolved":{severity:"warning",label:"Imports a standalone parse couldn't read"},"export-ambiguous":{severity:"warning",label:"Ambiguous `export *` names left out of the entry exports"}};function oi(e){return{...e,code:Kr[e.kind],severity:zr[e.kind].severity}}function vf(e){return Object.hasOwn(zr,e)}var ya=Object.keys(zr).filter(vf),ga=Object.fromEntries(ya.map((e)=>[e,`sveld/${e}`]));function Cf(e){for(let t of ya)if(!Object.hasOwn(e,t))throw Error(`sveld: no diagnostic code for "${t}"`)}Cf(ga);var Kr=ga;function D(e,t,n,i,r){e.diagnosticRecords.push(Jr(e,t,n,i,r))}function Jr(e,t,n,i,r){return oi({component:e.componentFilePath,kind:t,name:n,message:i,...r?{source:r}:{},...Xr(e,t,n)?{ignored:!0}:{}})}function xa(e,t){return`${e}:${t}`}function Je(e,t,n,i){if(!i||i.length===0)return;let r=xa(t,n),s=e.sveldIgnoreDirectives.get(r)??new Set;for(let l of i)s.add(l);e.sveldIgnoreDirectives.set(r,s)}function rn(e,t,n){if(Je(e,"prop-unknown-type",t,n),Je(e,"bind-this-type-mismatch",t,n),n&&n.length>0)e.propIgnoreCodes.set(t,n)}function Xr(e,t,n){let i=e.sveldIgnoreDirectives.get(xa(t,n));if(!i)return!1;return i.has("")||i.has(Kr[t])}var Yr="/**",Ea="*",ai="*/",Af="```",Qr=/^\s+/,Sa=/\s/,wf=/^@[^\s/]+(?=\s|$)/,Pf=/^@(\S+)\s*/,kf=new Set(["extends","extendProps","generics","template","typedef"]);function sn(e){let t=0;while(t<e.length){let n=e.charCodeAt(t);if(n!==32&&n!==9&&n!==13&&n!==10&&!Sa.test(e[t]))break;t++}return t}function _f(e,t){let n=e.slice(sn(e)),i=!1;if(t)n=n.slice(Yr.length),i=!0;else if(n.startsWith(Ea)&&!n.startsWith(ai))n=n.slice(Ea.length),i=!0;let r=n.slice(0,sn(n));n=n.slice(r.length);let s=n.trimEnd(),l=s.endsWith(ai)?s.slice(0,-ai.length).trimEnd():n;return{indent:i?r.slice(1):r,content:l}}function Nf(e,t,n){let i=n>t&&e.charCodeAt(n-1)===13?n-1:n;return e.slice(t,i)}function Df(e){let t=[],n=0;while(!0){let i=e.indexOf(Yr,n);if(i===-1)break;let r=e.lastIndexOf(`
|
|
5
|
+
`,i-1)+1;if(e.charCodeAt(i+Yr.length)===42||e.slice(r,i).trim()!==""){n=i+1;continue}let s=[],l=r,o=!1,a=0;while(l<=e.length){let p=e.indexOf(`
|
|
6
|
+
`,l),c=p===-1?e.length:p,u=Nf(e,l,c),{indent:f,content:h}=_f(u,s.length===0);s.push({raw:u,start:l,number:s.length,indent:f,content:h});let m=u.trimEnd();if(m.endsWith(ai)){o=!0,a=l+m.length,n=c;break}if(p===-1)break;l=p+1}if(!o)break;t.push({start:i,end:a,lines:s})}return t}function $f(e){let t=e;if(t.length>0&&t[0].content==="")t=t.slice(1);if(t.length>0&&t[t.length-1].content==="")t=t.slice(0,-1);return t}function If(e){let t=[[]],n=!1;for(let i of e){if(wf.test(i.content)&&!n)t.push([i]);else t[t.length-1].push(i);if(on(i.content))n=!n}return t}function on(e){return Lf(e,Af)%2===1}function Lf(e,t){let n=0,i=e.indexOf(t);while(i!==-1)n++,i=e.indexOf(t,i+t.length);return n}function Ta(e){return e.map((t)=>t.indent+t.content).join(`
|
|
7
|
+
`)}function Rf(e){let t=0;while(t<e.length-1&&e[t].content.trim()==="")t++;if(e[t].content[0]!=="{")return null;let n=e.slice(t).map((a)=>a.content).join(`
|
|
8
|
+
`),i=Ke(n,0);if(i===-1)return null;let r=[],s=i+1;for(let a=t;s>0;a++){let p=e[a].content.length;r.push(Math.min(s,p)),s-=p+1}let l=t+r.length-1;return{type:r.map((a,p)=>{let c=t+p,u=e[c].content.slice(0,a);if(e[c].content=e[c].content.slice(a).replace(Qr,""),c>0)e[c].continuesType=!0;return p===0?u:e[c].indent+u}).join(`
|
|
9
|
+
`).slice(1,-1),endIndex:l}}function Mf(e){let t=e.content.match(Qr)?.[0]??"",n=e.content.slice(t.length),i=0,r=0,s=n[0]==='"'||n[0]==="'"?n.indexOf(n[0],1):-1;if(s===-1)for(let c of n){if(i===0&&Sa.test(c))break;if(c==="[")i++;if(c==="]")i--;r++}else r=s+1;let l=i===0?n.slice(0,r):"";if(!l)return null;let o=l,a=!1,p;if(l.startsWith("[")&&l.endsWith("]")){a=!0;let u=l.slice(1,-1).split("=");if(o=u[0].trim(),u.length>1)p=u.slice(1).join("=").trim();if(!o)return null}if(o.length>1&&(o[0]==='"'||o[0]==="'")&&o[o.length-1]===o[0])o=o.slice(1,-1);return e.content=n.slice(r).replace(Qr,""),{name:o,optional:a,default:p}}function Of(e){let t=e[0],n=t.content.match(Pf),i=n?n[1]:"",r=n?t.content.slice(n[0].length):t.content,s=r.trimEnd(),l=e.slice(1).map((h)=>h.indent+h.content),o=(s?[s,...l]:l).join(`
|
|
10
|
+
`);t.content=r,t.tag=i;let a=Rf(e),p=a?.type??"",c=a?.endIndex??0;if(kf.has(i))while(c<e.length-1&&e[c].content.trim()==="")c++;let u=Mf(e[c]),f=Ta(e.slice(c));return{tag:i,name:u?.name??"",type:p,optional:u?.optional??!1,default:u?.default,description:f,text:o,lines:e}}function Bf(e,t,n){let i=$f(e);for(let[l,o]of i.entries())o.number=l;let r=If(i),s=r.slice(1).map(Of);return{description:Ta(r[0]),tags:s,start:t,end:n,lines:i}}function an(e){return Df(e).map(({start:t,end:n,lines:i})=>Bf(i,t,n))}var Ff=/\s/;function Zr(e,t,n){let i=t;while(i<n){let r=e[i];if(r==="/"&&e[i+1]==="/"){let s=e.indexOf(`
|
|
11
11
|
`,i+2);if(s===-1||s>=n)return!0;i=s+1}else if(r==="/"&&e[i+1]==="*"&&e[i+2]!=="*"){let s=e.indexOf("*/",i+2);if(s===-1||s+2>n)return!1;i=s+2}else if(r===" "||r===`
|
|
12
|
-
`||r==="\t"||r==="\r"||
|
|
13
|
-
`).trimEnd()}function Lt(e){return e?.replace(
|
|
14
|
-
`)))}function
|
|
15
|
-
`)));return{name:n.name,type:i&&
|
|
16
|
-
`):void 0},p=l.find((c)=>c.tag==="default"&&c.text.trim());return{type:i.type?
|
|
12
|
+
`||r==="\t"||r==="\r"||Ff.test(r))i++;else return!1}return!0}var Vf=/^-\s*/;function li(e){let t=[],n,i=!1;for(let r of e){let s=on(r);if(n!==void 0){if(s)t.push(r.trim()),n=void 0;else t.push(r.slice(Math.min(n,sn(r))).trimEnd());continue}let l=r.trim();if(l===""){i=t.length>0;continue}if(i)t.push("");if(i=!1,t.push(l),s)n=sn(r)}return t.join(`
|
|
13
|
+
`).trimEnd()}function Lt(e){return e?.replace(Vf,"").trim()}function va(e){let t=e.name?`${e.name} ${e.description}`:e.description;return Lt(li(t.split(`
|
|
14
|
+
`)))}function es(e){let t=0;while(e[t+1]?.continuesType)t++;return t}var pi=new Set(["since","example","see"]),ts=new Set(["bindable","default","required"]);function jf(e){return e.length>0?e.map((t)=>({name:t.tag,body:t.text})):void 0}function ci(e){let t=e.trim();return t===""?!0:t}function Ca(e){let t=e.startsWith("/*")?e:`/*${e}`;return t.endsWith("*/")?t:`${t}*/`}function ke(e){return e==="*"?"any":e.trim()}function Gf(e){return di(an(Ca(e)))}function ui(e){let{type:t}=Gf(e);return t?ke(t.type):void 0}var Wf=new Set(["type","param","returns","return","extends","extendProps","restProps","slot","snippet","event","typedef","callback","bindable","deprecated","ignore","internal","csspart","cssprop","cssproperty"]);function ns(e,t){let n=e.parsedJsDocByText.get(t);if(n===void 0)n=an(t),e.parsedJsDocByText.set(t,n);return n}function di(e){let t=e[0]?.tags??[],n,i=[],r,s,l,o=!1,a=[],p=[],c=[];for(let u of t)if(u.tag==="type")n=u;else if(u.tag==="param")i.push(u);else if(u.tag==="returns"||u.tag==="return")r=u;else if(u.tag==="deprecated")l??=ci(u.text);else if(u.tag==="ignore"||u.tag==="internal")o=!0;else if(u.tag==="sveld-ignore")c.push(u.name);else if(pi.has(u.tag))p.push(u);else if(u.tag==="bindable"){if(u.type)continue;let f=`${u.name}${u.description?` ${u.description}`:""}`.trim();if(f==="readonly"||f==="writable")s??=f}else if(!Wf.has(u.tag))a.push(u);return{type:n,param:i,returns:r,binding:s,deprecated:l,internal:o,additional:a,passthrough:p,ignore:c,description:e[0]?.description}}function Hf(e,t){let n=e.jsDocBlocksByStart.get(t.start);return n?.end===t.end?[n]:void 0}function Aa(e,t,n){if(!t||t.length===0||n===void 0||!e.source)return;for(let i=t.length-1;i>=0;i--){let r=t[i];if(!j(r)||typeof r.value!=="string")continue;let{value:s,start:l,end:o}=r;if(typeof l!=="number"||typeof o!=="number")continue;if(r.type==="Line"||!s.startsWith("*"))continue;if(Zr(e.source,o,n))return{value:s,start:l,end:o}}return}var Uf=new Set(["ArrowFunctionExpression","FunctionExpression"]);function wa(e){let t=new Set,n=({leadingComments:r,start:s})=>{let l=Aa(e,r,s);if(l)t.add(l.start)};for(let r of e.funcDecls.values())n(r);let i=[{root:e.parsed?.module,isModule:!0},{root:e.parsed?.instance,isModule:!1}];for(let{root:r,isModule:s}of i)for(let l of r?.content.body??[]){let o=l.type==="ExportNamedDeclaration",a=l.type==="ExportNamedDeclaration"?l.declaration:l;if(a?.type==="FunctionDeclaration"){if(o)n(l)}else if(a?.type==="ClassDeclaration"&&s){n(o?l:a);for(let p of a.body.body)if(p.type==="MethodDefinition")n(p)}else if(a?.type==="VariableDeclaration"&&(s||!o||a.kind==="const")&&a.declarations.length===1&&Uf.has(a.declarations[0].init?.type??""))n(l)}return t}var qf=new Set(["slot","snippet","event","typedef","callback","restProps","extends","extendProps","csspart","cssprop","cssproperty"]);function G(e,t){let n=Aa(e,t?.leadingComments,t?.start);return n&&Qf(e,n)}function zf(e,t,n){let i=e;if(t)i=`${e} extends ${t}`;if(n)i+=` = ${n}`;return i}var Kf=/^[^\s,]+/,ba=/^\s*,\s*([^\s,]+)/;function is(e,t){let n=e.optional?e.name:Kf.exec(e.name)?.[0];if(!n)return[];let i=[{name:n,constraint:zf(n,t,e.default)}],r=`${e.optional?"":e.name.slice(n.length)} ${e.description}`;for(let s=ba.exec(r);s;s=ba.exec(r))i.push({name:s[1],constraint:s[1]}),r=r.slice(s[0].length);return i}var Jf=new Set(["","any","object","Object"]),Xf=/^[A-Za-z_$][\w$]*$/;function Yf(e){let t=new Map;for(let{name:n,type:i,optional:r}of e){let[s,l,...o]=n.split(".");if(!l||o.length>0)continue;let a=t.get(s)??[],p=Xf.test(l)?l:JSON.stringify(l);a.push(`${p}${r?"?":""}: ${ke(i)||"any"}`),t.set(s,a)}return e.filter((n)=>!n.name.includes(".")).map((n)=>{let i=t.get(n.name),r=ke(n.type),s=Lt(li(n.description.split(`
|
|
15
|
+
`)));return{name:n.name,type:i&&Jf.has(r)?`{ ${i.join("; ")} }`:r,...s?{description:s}:{},optional:n.optional}})}function Qf(e,t){let n=Hf(e,t)??ns(e,Ca(t.value));if(n[0]?.tags.some(({tag:c})=>qf.has(c)))return;let i=di(n),r=i.param.length>0?Yf(i.param):void 0,s;if(e.functionDocCommentStarts.has(t.start)){let c=i.additional.filter((u)=>u.tag==="template"&&u.name);if(c.length>0)s=c.flatMap((u)=>is(u,ke(u.type))).map(({constraint:u})=>u).join(", ")}let l=i.additional.filter((c)=>c.tag!=="template"&&c.tag!=="generics"),o=i.description?.trim(),a=(c)=>{let u=[...o?[o]:[],...c.map((f)=>`@${f.tag}${f.text?` ${f.text}`:""}`)];return u.length>0?u.join(`
|
|
16
|
+
`):void 0},p=l.find((c)=>c.tag==="default"&&c.text.trim());return{type:i.type?ke(i.type.type):void 0,params:r,returnType:i.returns?ke(i.returns.type):void 0,description:a(l),binding:i.binding,deprecated:i.deprecated,tags:jf(i.passthrough),sveldIgnore:i.ignore.length>0?i.ignore:void 0,internal:i.internal,typeParameters:s,...p?{explicitDefault:p.text.trim(),descriptionWithoutDefault:a(l.filter((c)=>c!==p))}:{}}}var Zf=/[^\S\r\n]*[\r\n]+\s*/g;function Pa(e,t){if(!e.source||t<0||t>e.source.length)return;return e.sourceLocator??=Or(e.source),e.sourceLocator(t)}function fi(e,t,n){if(t===void 0||n===void 0||n<t)return;let i=Pa(e,t),r=Pa(e,n);if(!i||!r)return;return{start:i,end:r}}function rs(e){if(!j(e))return{};return{start:typeof e.start==="number"?e.start:void 0,end:typeof e.end==="number"?e.end:void 0}}function P(e,t){let{start:n,end:i}=rs(t);return fi(e,n,i)}function _e(e,t){if(!t||t.length===0)return;let n=[...t];while(n.length>1){let a=n[n.length-1];if(a.tag!==void 0||!a.raw.trim().endsWith("*/"))break;n.pop()}let i=n[0],r=i.raw.indexOf(`@${i.tag??""}`),s=i.start+Math.max(r,0),l=n[n.length-1],o=l.start+l.raw.length;return fi(e,s,o)}function W(e,t,n){return e.source?.slice(t,n)}function Xe(e,t){let{start:n,end:i}=rs(t);if(n===void 0||i===void 0)return;return W(e,n,i)}var eh=/\s+/g;function ae(e,t){return Xe(e,t)?.replace(Zf," ")}var th=/^[ \t]*/,nh=/\r?\n/g;function Ye(e,t){let{source:n}=e,{start:i,end:r}=rs(t);if(n===void 0||i===void 0||r===void 0)return;let s=[];for(let f of e.parsed?.comments??[])if(f.start>=i&&f.end<=r)s.push({start:f.start,end:f.end});K(t,{enter(f){if(f.type==="TemplateElement"){let h=n.slice(f.start,f.end).replace(nh,"\\n");s.push({start:f.start,end:f.end,text:h})}else if(f.type==="Literal"&&(typeof f.value==="string"||("regex"in f)))s.push({start:f.start,end:f.end,text:n.slice(f.start,f.end)})}}),s.sort((f,h)=>f.start-h.start);let l=(f)=>f.replace(eh,(h)=>h.includes(`
|
|
17
17
|
`)?h.slice(h.lastIndexOf(`
|
|
18
18
|
`)):" "),o="",a="",p=i;for(let f of s){if(a+=n.slice(p,f.start),p=f.end,f.text===void 0){a+=" ";continue}o+=l(a)+f.text,a=""}o+=l(a+n.slice(p,r));let c=n.lastIndexOf(`
|
|
19
|
-
`,i-1)+1,u=
|
|
19
|
+
`,i-1)+1,u=th.exec(n.slice(c,i))?.[0]??"";return o.split(`
|
|
20
20
|
`).map((f,h)=>(h>0&&f.startsWith(u)?f.slice(u.length):f).trimEnd()).filter((f,h)=>h===0||f!=="").join(`
|
|
21
|
-
`).trim()}var
|
|
22
|
-
`);let s=r.named.map(({imported:a,local:p})=>{if(!a||a===p)return p;return`${a} as ${p}`}),l=r.default[0],o=s.length>0?`{ ${s.join(", ")} }`:"";if(l&&o)return`import type ${l}, ${o} from "${i}";`;if(l)return`import type ${l} from "${i}";`;return`import type ${o} from "${i}";`})}function Aa(e,t,n,i,r,s){let l=ka(t);if(e.typeImportBindingsByLocalName.has(l)||e.valueImportBindingsByLocalName.has(l))i.add(l);let o=e.localTypeDeclarationsByName.get(l);if(o&&!s.has(l))r.add(l),s.add(l),Ve(e,o.node,i,r,s),s.delete(l);for(let a of n??[])Ve(e,a,i,r,s)}function Pa(e,t){for(let n of e)if(n.type==="TSPropertySignature")t(n.typeAnnotation?.typeAnnotation)}function O(e,t){if(t)e.additionalTypeDependencyNodes.push(t)}function Qf(e){if(!e.const)return;let t=e.id.name,n=[];for(let i of e.members){let r=i.initializer;if(r?.type!=="Literal")return;let s=r.value;if(typeof s==="string")n.push(JSON.stringify(s));else if(typeof s==="number")n.push(String(s));else return}if(n.length===0)return;return`type ${t} = ${n.join(" | ")};`}function Na(e,t){let n=Qf(t);if(n)return n;let i=G(e,t.start,t.end)?.trim();return i?`declare ${i}`:void 0}var Zf=/\/\*\*((?:(?!\*\/)[\s\S])*)\*\/\s*$/;function eh(e,t,n){if(t===void 0)return;let i=G(e,t,n),r=i&&Zf.exec(i);return r?ci(r[0]):void 0}function pn(e,t){let n=[],i="start"in t&&typeof t.start==="number"?t.start:void 0,r=(s)=>t.params.length===1?"arg":`arg${s}`;for(let[s,l]of t.params.entries()){let o=eh(e,i,l.start);i=l.end;let a=l.type==="TSParameterProperty"?l.parameter:l;if(a.type==="RestElement"){O(e,a.typeAnnotation?.typeAnnotation),n.push({name:a.argument.type==="Identifier"?a.argument.name:"rest",type:ae(e,a.typeAnnotation)??o,optional:!1,rest:!0});continue}let p=a.type==="AssignmentPattern",c=p?a.left:a,u="typeAnnotation"in c?c.typeAnnotation:void 0;O(e,u?.typeAnnotation),n.push({name:c.type==="Identifier"?c.name:r(s),type:ae(e,u)??o,optional:p||"optional"in a&&a.optional===!0,rest:!1})}O(e,t.returnType?.typeAnnotation);for(let s of t.typeParameters?.params??[])O(e,s.constraint),O(e,s.default);return{params:n,returnType:ae(e,t.returnType),typeParameters:ut(e,t.typeParameters)||void 0}}function Mt(e,t,n="any"){let{params:i,returnType:r,typeParameters:s}=pn(e,t),l=i.map(({name:a,type:p,optional:c,rest:u})=>u?`...${a}: ${p??"any[]"}`:`${a}${c?"?":""}: ${p??"any"}`),o=r!==void 0||s!==void 0||i.some((a)=>a.type!==void 0);return{signature:`${s??""}(${l.join(", ")}) => ${r??n}`,hasAnnotations:o}}function ln(e){return e.length>0?e.slice():void 0}function Da(e){let t=ln(e.pendingCallDefaultCandidates),n=ln(e.pendingConstDefaultCandidates.filter((o)=>o.location!=="props"||!e.explicitDefaultPropNames.has(o.propName))),i=ln(e.pendingContextKeyCandidates),r=ln(e.pendingDispatchEscapeCandidates);if(!t&&!n&&!i&&!r)return;let s=ln(e.deferredEventNoSourceDiagnostics),l=r&&e.untypedJsDocEventNames.size>0?Array.from(e.untypedJsDocEventNames):void 0;return{...t?{pendingCallDefaultCandidates:t}:{},...n?{pendingConstDefaultCandidates:n}:{},...i?{pendingContextKeyCandidates:i}:{},...r?{pendingDispatchEscapeCandidates:r}:{},...s?{deferredEventNoSourceDiagnostics:s}:{},...l?{untypedJsDocEventNames:l}:{}}}function $a(e){let t=new Set,n=new Set;for(let a of e.additionalTypeDependencyNodes)Ve(e,a,t,n);for(let a of e.additionalImportedTypes.keys())t.add(a);let i=Array.from(e.localTypeDeclarationsByName.values()).filter((a)=>a.exported).sort((a,p)=>a.start-p.start);for(let a of i)Ve(e,a.node,t,n);let r=i.map((a)=>`export ${a.code}`),s=e.typedRunesPropsDeclarations.length===1?e.typedRunesPropsDeclarations[0]:void 0,l=s?.canonicalType;if(s&&l){for(let a of s.referencedImportedTypes)t.add(a);for(let a of s.referencedLocalTypes)n.add(a)}if(!l&&t.size===0&&n.size===0&&r.length===0)return;let o=Array.from(n).map((a)=>e.localTypeDeclarationsByName.get(a)).filter((a)=>a!==void 0&&!a.exported).sort((a,p)=>a.start-p.start).map((a)=>a.code);return{...l?{canonicalPropsType:l}:{},canonicalPropNames:s&&l?Array.from(s.props.keys()).sort():[],localTypeDeclarations:o,...r.length>0?{moduleTypeDeclarations:r}:{},typeImportStatements:Yf(e,t)}}function th(e,t,n,i,r){for(let s of e){if(s.type!=="Block"||s.start<n||s.end>i)continue;r.push({start:s.start,end:s.end,isJsDoc:s.end-s.start>4&&t.startsWith("/**",s.start)})}}function nh(e,t){for(let n of e){let{start:i}=n,r=n.type==="ExportNamedDeclaration"?n.declaration:n;if(r?.type==="FunctionDeclaration"){if(r.id?.name)t.push({name:r.id.name,start:i})}else if(r?.type==="VariableDeclaration"){for(let s of r.declarations)if(s.id.type==="Identifier"&&s.id.name)t.push({name:s.id.name,start:i})}}}function ih(e,t,n){let i=0,r=e.length;while(i<r){let s=i+r>>>1;if(e[s].end<=t)i=s+1;else r=s}for(let s=i-1;s>=0;s--){let l=e[s];if(!l.isJsDoc)continue;return Xr(n,l.end,t)?l:void 0}return}function rh(e){let t=new Map;if(!e.source)return t;let n=[],i=[],r=e.parsed?.comments??[];for(let s of[e.parsed?.module,e.parsed?.instance]){let l=s?.content;if(!l)continue;th(r,e.source,l.start,l.end,n),nh(l.body,i)}n.sort((s,l)=>s.end-l.end);for(let s of i){let l=ih(n,s.start,e.source);if(!l)continue;let o=Zr(e,e.source.slice(l.start,l.end)),{type:a,description:p,ignore:c,internal:u}=ui(o);if(c.length>0)Je(e,"context-any-type",s.name,c);if(!a&&!p&&!u)continue;t.set(s.name,{type:a?we(a.type):void 0,description:p||a&&Sa(a),internal:u||void 0})}return t}function La(e,t){return e.variableInfoCache??=rh(e),e.variableInfoCache.get(t)}function dt(e,t){let n=Hr(e,t);if(n?.type)return{type:n.type,description:n.description,internal:n.internal};let i=La(e,t),r=e.explicitVariableTypesByName.get(t);if(r)return{type:r,description:i?.description,internal:i?.internal};if(!i?.type)return null;return{type:i.type,description:i.description,internal:i.internal}}function ft(e,t){let n=dt(e,t);if(n&&n.type===e.explicitVariableTypesByName.get(t))O(e,e.explicitVariableTypeNodesByName.get(t));return n}function ns(e,t){let n=La(e,t);return{...n?.description?{description:n.description}:{},...n?.internal?{internal:!0}:{}}}function ge(e,t){for(let i of e.vars)if(i.declarations.some((r)=>r.id.type==="Identifier"&&r.id.name===t))return Ia(e,i);let n=e.funcDecls.get(t);return n&&Ia(e,n)}function Ia(e,t){let n=j(e,t);if(n)return n;for(let i of[e.parsed?.instance,e.parsed?.module])for(let r of i?.content.body??[])if(r.type==="ExportNamedDeclaration"&&r.declaration===t)return j(e,r);return}var sh=/\w/,oh=/^readonly\s+/;function is(e,t){let n=e.trim();if(!n.startsWith("{")||!n.endsWith("}"))return;let i=F(n.slice(1,-1),";,").map((r)=>r.trim().replace(oh,""));for(let r of i){if(!r.startsWith(t))continue;let s=r.slice(t.length);if(sh.test(s.charAt(0)))continue;let l=s.trimStart(),o=l.startsWith("?");if(o)l=l.slice(1).trimStart();if(!l.startsWith(":"))continue;let a=l.slice(1).trim();return o?`${a} | undefined`:a}return}function Ra(e,t){if(t.computed||t.object.type!=="Identifier"||t.property.type!=="Identifier")return;let n=t.object.name,i=t.property.name;if(e.wholePropsLocals.has(n))return tn(e,i);let r=tn(e,n)??dt(e,n)?.type;if(!r)return;return is(r,i)}var ah=/(?:_|[^\p{ID_Continue}$])+/u,lh=/^[\p{ID_Start}$]/u;function rs(e){let i=`${e.split(ah).map((r)=>r.charAt(0).toUpperCase()+r.slice(1)).join("")}Context`;return lh.test(i)?i:`_${i}`}var ph=/^\{([\s\S]*)\}$/,ch=/^[A-Za-z_$][\w$]*$/,uh=/^readonly\s+/,dh=/^\[[\w$]+\s*:[^\]]+\]$/;function je(e,{skipIndexSignatures:t=!1,withReadonly:n=!1}={}){let i=e.trim(),r=ph.exec(i);if(!r)return null;let s=r[1].trim();if(s==="")return[];let l=[];for(let o of F(s,";,")){let a=o.trim();if(!a)continue;let p=en(a,":");if(p===-1)return null;let c=a.slice(0,p).trim(),u=c.replace(uh,""),f=a.slice(p+1).trim();if(!f)return null;if(t&&dh.test(u))continue;let h=!1;if(u.endsWith("?"))h=!0,u=u.slice(0,-1).trim();if(!ch.test(u))return null;l.push(n?{name:u,type:f,optional:h,readonly:c!==u}:{name:u,type:f,optional:h})}return l}function fi({imported:e}){return e.type==="Identifier"?e.name:e.value}function cn(e,t){let n=t.source.value;if(typeof n!=="string"||t.importKind==="type")return;for(let i of t.specifiers){if(i.type!=="ImportSpecifier"||i.importKind==="type")continue;let r=i.local.name,s=fi(i);e.valueImportBindingsByLocalName.set(r,{localName:r,importedName:s,source:n})}}function un(e){return[e.importedName,...e.members??[]].join(".")}function ss(e,t){let n=[],i=t;while(ze(i)){if(i.computed||!T(i.property))return;n.unshift(i.property.name),i=i.object}if(!T(i))return;return dn(e,i.name,n)}function dn(e,t,n=[]){let i=(s,l,o)=>o.length>0?{source:s,importedName:l,members:o}:{source:s,importedName:l},r=e.valueImportBindingsByLocalName.get(t);if(r)return i(r.source,r.importedName,n);for(let s of[e.parsed?.instance,e.parsed?.module])for(let l of s?.content.body??[]){if(l.type!=="ImportDeclaration")continue;let o=l.source.value;if(l.importKind==="type"||typeof o!=="string")continue;let a=l.specifiers.find((p)=>p.local.name===t);if(a?.type==="ImportDefaultSpecifier")return i(o,"default",n);if(a?.type==="ImportNamespaceSpecifier"&&n.length>0)return i(o,n[0],n.slice(1))}return}function hi(e,t){if(!ze(t))return;return ss(e,t)}function Ma(e){let t=new Map;for(let n of e.content.body){if(n.type!=="ImportDeclaration"||n.importKind==="type")continue;let i=n.source.value;if(typeof i!=="string")continue;for(let r of n.specifiers){if(r.type==="ImportSpecifier"&&r.importKind==="type")continue;let s=r.local.name,l;if(r.type==="ImportDefaultSpecifier")l="default";else if(r.type==="ImportNamespaceSpecifier")l="*";else l=fi(r);t.set(s,{from:i,imported:l})}}return t}function os(e,t){for(let n of t?.content.body??[]){if(n.type==="ImportDeclaration"){cn(e,n);continue}let i=n.type==="ExportNamedDeclaration"&&n.declaration?n.declaration:n;if(i.type==="FunctionDeclaration"&&i.id?.name)e.funcDecls.set(i.id.name,i)}}function mi(e){return e==="TSTypeAnnotation"||e==="TSTypeAliasDeclaration"||e==="TSInterfaceDeclaration"||e==="TSTypeParameterDeclaration"||e==="TSTypeParameterInstantiation"}function as(e){let t=[];return z(e,{enter(n){if(n.type==="FunctionDeclaration"||n.type==="FunctionExpression"||n.type==="ArrowFunctionExpression")return ie;if(n.type==="ReturnStatement")t.push(n.argument??null)}}),t}function fn(e,t,n){if(!t)return;ri(e,t);let i=e.props.get(t);e.props.set(t,i?{...i,...n}:n)}function yi(e,t,n,i){if(t.pendingCallDefault)e.pendingCallDefaultCandidates.push({propName:n,location:i,...t.pendingCallDefault});if(t.pendingConstDefault)e.pendingConstDefaultCandidates.push({propName:n,location:i,...t.pendingConstDefault})}var fh=new Map([["Date","Date"],["Map","Map<any, any>"],["Set","Set<any>"],["WeakMap","WeakMap<object, any>"],["WeakSet","WeakSet<object>"],["Array","any[]"],["RegExp","RegExp"],["Regexp","RegExp"],["Error","Error"]]);function xe(e,t,n=0){let i=yh(e,t,n),r=t&&typeof t==="object"?Ga(e,t):void 0;return r===void 0?i:{...i,type:r}}var hh=/^\s*\(\s*$/;function Ga(e,t){let{constAssertions:n,typeAssertions:i}=e.typeCasts;if(n.has(t))return Se(t,"const");let r=i.get(t);if(r)return O(e,r),oe(e,r);return mh(e,t)}function mh(e,t){let n="start"in t&&typeof t.start==="number"?t.start:void 0;if(n===void 0)return;let i=e.parsed?.comments.findLast((r)=>r.end<=n);if(i?.type!=="Block"||!i.value.startsWith("*"))return;if(!hh.test(G(e,i.end,n)??""))return;return ci(i.value)}function hn(e){return e&&typeof e==="object"&&"type"in e?e:void 0}function yh(e,t,n){let i=hn(t);if(!i)return{value:void 0,type:void 0,isFunction:!1};let r=ja(e,i),s=(l,o)=>({value:l,type:o,isFunction:!1,defaultValue:r});switch(i.type){case"ObjectExpression":case"ArrayExpression":return s(Ye(e,i),Se(i,"widen"));case"BinaryExpression":return s(Ye(e,i),se(e,i,n));case"ArrowFunctionExpression":case"FunctionExpression":return{...s(Va(e,i),Ua(e,i)),isFunction:!0};case"UnaryExpression":return s(Ye(e,i),se(e,i,n));case"LogicalExpression":case"ConditionalExpression":case"SequenceExpression":{let l=Ye(e,i),o=l!==void 0&&i.type==="SequenceExpression"?`(${l})`:l;return s(o,se(e,i,n))}case"NewExpression":{let{callee:l}=i,o=T(l)?fh.get(l.name)??l.name:void 0;return s(Xe(e,i),o)}case"CallExpression":return gh(e,i,r,n);case"Identifier":{let{name:l}=i;if(n<5){let o=gn(e,l);if(o){let p=xe(e,vh(o),n+1),c=ge(e,l);return{...p,resolvedType:c?.type??p.resolvedType,resolvedDescription:c?.description??p.resolvedDescription,resolvedParams:c?.params??p.resolvedParams,resolvedReturnType:c?.returnType??p.resolvedReturnType}}let a=e.funcDecls.get(l);if(a){let p=ge(e,l);return{value:Va(e,a),type:void 0,isFunction:!0,defaultValue:ja(e,a),resolvedType:p?.type??Ha(e,p,a),resolvedDescription:p?.description,resolvedParams:p?.params,resolvedReturnType:p?.returnType}}}return Oa(s(Xe(e,i)),e.valueImportBindingsByLocalName.get(l))}case"MemberExpression":return Oa(s(Xe(e,i),Ih(i)?"number":void 0),hi(e,i));case"TemplateLiteral":return s(Xe(e,i),"string");case"Literal":return typeof i.raw==="string"?s(i.raw,ht(i)):s(void 0);default:return s(void 0)}}function Oa(e,t){if(!t)return e;let{source:n,importedName:i,members:r}=t;return{...e,pendingConstDefault:{importSource:n,importedName:i,...r?{members:r}:{}}}}function gh(e,t,n,i){let r=Xe(e,t),{callee:s}=t,l=T(s)?s.name:void 0;if((l==="$derived"||l==="$state")&&t.arguments.length===1&&i<5)return{...xe(e,t.arguments[0],i+1),value:r,defaultValue:n};let o={value:r,type:void 0,isFunction:!1,defaultValue:n};if(l){let a=bh(e,l);if(a?.declared)return{...o,resolvedType:a.type};if(a)return{...o,type:a.type};if(e.funcDecls.has(l)||Wa(e,l))return{...o,pendingCallDefault:{calleeName:l}};let p=e.valueImportBindingsByLocalName.get(l);if(p)return{...o,pendingCallDefault:{calleeName:l,importSource:p.source,importedName:p.importedName}}}return{...o,pendingCallDefault:{calleeName:l??Xe(e,s)??"call"}}}function ht(e){if("regex"in e&&e.regex)return"RegExp";if("bigint"in e&&e.bigint)return"bigint";return e.value==null?void 0:typeof e.value}var xh=new Set(["-","*","/","%","**","<<",">>",">>>","&","|","^"]),Sh=new Set(["==","!=","===","!==","<","<=",">",">=","in","instanceof"]);function se(e,t,n){let i=hn(t);if(!i)return;switch(i.type){case"UnaryExpression":{let{operator:r,argument:s}=i;if(r==="!"||r==="delete")return"boolean";if(r==="typeof")return"string";if(r==="void")return;if(r==="+")return"number";return se(e,s,n)==="bigint"?"bigint":"number"}case"BinaryExpression":{let{operator:r}=i;if(Sh.has(r))return"boolean";let s=se(e,i.left,n),l=se(e,i.right,n);if(s==="bigint"&&l==="bigint")return"bigint";if(xh.has(r))return"number";if(r!=="+")return;if(s==="string"||l==="string")return"string";if(s==="number"&&l==="number")return"number";return}case"LogicalExpression":return Ba([se(e,i.left,n),se(e,i.right,n)]);case"ConditionalExpression":return Ba([se(e,i.consequent,n),se(e,i.alternate,n)]);case"SequenceExpression":return se(e,i.expressions[i.expressions.length-1],n);case"Identifier":{let{name:r}=i;if(r==="NaN"||r==="Infinity")return"number";if(r==="undefined")return;let s=dt(e,r)?.type;if(s)return s;if(n>=5)return;return se(e,gn(e,r),n+1)}default:{if(n>=5)return;let r=xe(e,i,n+1);return r.type??r.resolvedType}}}function Ba(e){let t=new Set;for(let n of e){if(n===void 0)return;t.add(n.includes("=>")?`(${n})`:n)}return t.size===1?e[0]:[...t].join(" | ")}function Se(e,t){let n=hn(e),i=t==="widen";switch(n?.type){case"Literal":if("regex"in n&&n.regex)return"RegExp";if(n.value===null)return"null";return i?ht(n):n.raw??void 0;case"TemplateLiteral":if(n.expressions.length>0)return;return i?"string":`\`${n.quasis[0]?.value.raw??""}\``;case"Identifier":return n.name==="undefined"?"undefined":void 0;case"UnaryExpression":{let{operator:r,argument:s}=n;if(r!=="-"||s.type!=="Literal")return;let l=ht(s);if(l!=="number"&&l!=="bigint")return;return i?l:`-${s.raw}`}case"ArrayExpression":{let r=[];for(let o of n.elements){let a=o===null?void 0:Se(o,t);if(a===void 0)return;r.push(a)}if(t==="literal")return`[${r.join(", ")}]`;if(t==="const")return`readonly [${r.join(", ")}]`;let s=new Set(r);if(s.size===0)return"any[]";let l=[...s].join(" | ");return s.size===1?`${l}[]`:`(${l})[]`}case"ObjectExpression":{let r=new Map;for(let l of n.properties){if(l.type!=="Property"||l.kind!=="init"||l.computed||l.method||l.shorthand)return;let{key:o}=l,a=o.type==="Identifier"?o.name:o.type==="Literal"?o.raw:void 0,p=Se(l.value,t);if(a===void 0||p===void 0)return;r.delete(a),r.set(a,p)}if(r.size===0)return"{}";let s=t==="const"?"readonly ":"";return`{ ${[...r].map(([l,o])=>`${s}${l}: ${o}`).join("; ")} }`}default:return}}function mn(e,t,n=!1){let i=gn(e,t);if(i===void 0){let s=e.funcDecls.get(t);return s&&Fa(e,t,s,n)}if(i.type==="ArrowFunctionExpression"||i.type==="FunctionExpression")return Ga(e,i)??Fa(e,t,i,n);if(i.type==="CallExpression"){let s=yn(e,i);if(s)return s;let l=oe(e,i.callee);if(l==="$state"||l==="$state.raw"||l==="$derived"){let o=i.typeArguments?.params[0];if(o)return O(e,o),oe(e,o);if(l==="$state.raw")return xe(e,i.arguments[0],1).type}}let r=xe(e,i);return r.type??r.resolvedType}function Fa(e,t,n,i){let r=i?xn(n):Sn(n),s=Mt(e,n,r);if(s.hasAnnotations)return s.signature;let l=ge(e,t);if(l?.type)return l.type;return i?ps(l,n)??Bt(e,n):Ha(e,l,n)}var Eh=new Map([["writable","Writable"],["readable","Readable"],["derived","Readable"],["readonly","Readable"]]),Th=/^(?:import\("svelte\/store"\)\.)?(?:Writable|Readable)<([\s\S]*)>$/;function yn(e,t){let n=T(t.callee)?e.valueImportBindingsByLocalName.get(t.callee.name):void 0,i=n?.source==="svelte/store"?Eh.get(n.importedName):void 0;if(!i)return;let r=n?.importedName==="derived",s=t.typeArguments?.params[r?1:0],l;if(s)O(e,s),l=oe(e,s);else if(n?.importedName==="readonly"){let[o]=t.arguments;l=(T(o)?ft(e,o.name)?.type??mn(e,o.name):o?.type==="CallExpression"?yn(e,o):void 0)?.trim().match(Th)?.[1]}else if(r){let o=t.arguments[1];l=(o?.type==="ArrowFunctionExpression"||o?.type==="FunctionExpression")&&o.params.length<2?Sn(o):void 0}else{let[o]=t.arguments;l=(T(o)?ft(e,o.name)?.type:void 0)??se(e,o,0)}return`import("svelte/store").${i}<${l??"any"}>`}function vh(e){if(e.type!=="CallExpression"||e.arguments.length!==1)return e;let[t]=e.arguments;if(t.type==="SpreadElement")return e;let{callee:n}=e;return n.type==="Identifier"&&(n.name==="$state"||n.name==="$derived")||n.type==="MemberExpression"&&T(n.object)&&n.object.name==="$state"&&T(n.property)&&n.property.name==="raw"?t:e}function gn(e,t,n=!1){for(let i of e.vars){if(n&&i.kind!=="const")continue;for(let r of i.declarations)if(T(r.id)&&r.id.name===t&&r.init)return r.init}return}function Ot(e,t){return gn(e,t,!0)}function bh(e,t){let n=ge(e,t);if(n?.returnType)return{type:n.returnType,declared:!0};let i=e.funcDecls.get(t)??Wa(e,t);if(!i)return;let r=Ah(e,i)??Ch(e,t);if(r)return{type:r,declared:!0};let s=Sn(i);return s==="any"?void 0:{type:s,declared:!1}}function Wa(e,t){let n=gn(e,t);return n?.type==="ArrowFunctionExpression"||n?.type==="FunctionExpression"?n:void 0}function Ch(e,t){for(let n of e.vars)for(let i of n.declarations){let r=i.id;if(!T(r)||r.name!==t)continue;let s=r.typeAnnotation?.typeAnnotation;if(!s)return;return da(G(e,s.start,s.end))}return}function Ah(e,t){let n=t.returnType?.typeAnnotation;return n&&G(e,n.start,n.end)}function Ha(e,t,n){let i=t?.returnType??"any",r=t?.params;if(r&&r.length>0)return`(${ye(r)}) => ${i}`;if(t?.returnType)return`() => ${i}`;return Ua(e,n)}function Ua(e,t){let n=Sn(t),i=Mt(e,t,n);if(i.hasAnnotations)return i.signature;return`(${Ph(t)}) => ${n}`}function Ph({params:e}){let t=[];for(let n of e){if(!T(n))return"...args: any[]";t.push(`${n.name}: any`)}return t.length>0?t.join(", "):"...args: any[]"}function Bt(e,t){let n=xn(t),i=Mt(e,t,n);if(i.hasAnnotations)return i.signature;return`(${qa(t)}) => ${n}`}function qa(e){let t=(i)=>e.params.length===1?"arg":`arg${i}`;return e.params.map((i,r)=>{if(i.type==="RestElement")return`...${T(i.argument)?i.argument.name:"args"}: any[]`;if(i.type==="AssignmentPattern")return`${T(i.left)?i.left.name:t(r)}?: any`;return`${T(i)?i.name:t(r)}: any`}).join(", ")}function ps(e,t){if(!e?.params?.length&&!e?.returnType)return;return`(${e.params?.length?ye(e.params):qa(t)}) => ${e.returnType??xn(t)}`}function xn(e){return wh(e)?e.async?"Promise<void>":"void":Sn(e)}function wh(e){return!e.generator&&e.body.type==="BlockStatement"&&as(e.body).every((t)=>t===null)}function Sn(e){if(e.async||e.generator)return"any";let{body:t}=e,n=t.type==="BlockStatement"?as(t):[t],i=new Set(n.map(kh)),[r]=i;return i.size===1&&r?r:"any"}function kh(e){let t=hn(e);switch(t?.type){case"Literal":{let{value:n}=t;if(typeof n==="string")return"string";if(typeof n==="number")return"number";if(typeof n==="boolean")return"boolean";return null}case"TemplateLiteral":return"string";case"CallExpression":{let{callee:n}=t;if(!T(n))return null;if(n.name==="String")return"string";if(n.name==="Number")return"number";if(n.name==="Boolean")return"boolean";return null}default:return null}}function _h(e,{params:t}){if(t.length===0)return"";return G(e,t[0].start,t[t.length-1].end)??""}function Va(e,t){if(t.generator)return;let{body:n}=t,i=_h(e,t),r=t.async?"async ":"",s=(a,p)=>a.type==="ObjectExpression"?`(${p})`:p;if(n.type!=="BlockStatement"){let a=Ye(e,n);return a===void 0?void 0:`${r}(${i}) => ${s(n,a)}`}let l=n.body;if(l.length===0)return`${r}(${i}) => {}`;let[o]=l;if(l.length===1&&o.type==="ReturnStatement"&&o.argument){let a=Ye(e,o.argument);if(a!==void 0)return`${r}(${i}) => ${s(o.argument,a)}`}return}function Nh(e){switch(e.type){case"Literal":case"UnaryExpression":return"literal";case"TemplateLiteral":return e.expressions.length===0?"literal":"expression";case"ArrayExpression":return"array";case"ObjectExpression":return"object";case"ArrowFunctionExpression":case"FunctionExpression":case"FunctionDeclaration":return"function";default:return"expression"}}function ja(e,t){let n=Ye(e,t);if(!n)return;let i=Nh(t);if(i!=="literal"&&i!=="array"&&i!=="object")return{raw:n,kind:i};let r=ls(t);if(r.ok)return{raw:n,kind:i,value:r.value};return{raw:n,kind:t.type==="UnaryExpression"?"expression":i}}function ls(e){let t=hn(e);switch(t?.type){case"Literal":return typeof t.value==="bigint"||"regex"in t?{ok:!1}:{ok:!0,value:t.value};case"UnaryExpression":{let{operator:n,argument:i}=t;if(i.type!=="Literal")return{ok:!1};let{value:r}=i;if(typeof r==="number"){if(n==="-")return{ok:!0,value:-r};if(n==="+")return{ok:!0,value:r}}if(typeof r==="boolean"&&n==="!")return{ok:!0,value:!r};return{ok:!1}}case"TemplateLiteral":{let{expressions:n,quasis:i}=t;if(n.length>0||i.length!==1)return{ok:!1};return{ok:!0,value:i[0].value.cooked??i[0].value.raw}}case"ArrayExpression":{let n=[];for(let i of t.elements){if(!i)return{ok:!1};let r=ls(i);if(!r.ok)return{ok:!1};n.push(r.value)}return{ok:!0,value:n}}case"ObjectExpression":{let n={};for(let i of t.properties){if(i.type!=="Property"||i.computed)return{ok:!1};let r=J(i.key);if(!r)return{ok:!1};let s=ls(i.value);if(!s.ok)return{ok:!1};n[r]=s.value}return{ok:!0,value:n}}default:return{ok:!1}}}var Dh=new Set(["POSITIVE_INFINITY","NEGATIVE_INFINITY","MAX_VALUE","MIN_VALUE","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","EPSILON","NaN"]),$h=new Set(["PI","E","LN2","LN10","LOG2E","LOG10E","SQRT2","SQRT1_2"]);function Ih({object:e,property:t}){if(!T(e)||!T(t))return!1;if(e.name==="Number")return Dh.has(t.name);if(e.name==="Math")return $h.has(t.name);return!1}function En(e,t,n){if(!t||e.has(t))return;e.set(t,n)}function gi(e,t){for(let n=e.activeScopes.length-1;n>=0;n-=1){let i=e.activeScopes[n]?.get(t);if(!i)continue;return i.kind==="prop"?i.publicPropName:void 0}return}function mt(e,t){for(let n=e.activeScopes.length-1;n>=0;n-=1){let i=e.activeScopes[n];if(i===e.componentScope)return!1;if(i?.has(t))return!0}return!1}function xi(e,t){let n=t;while(ze(n))n=n.object;return T(n)&&mt(e,n.name)}function Y(e,t=new Set){if(e)for(let n of Or(e))t.add(n.name);return t}function cs(e,t){if(!t||typeof t!=="object"||!("type"in t))return;if(t.type==="Identifier"){let n=gi(e,t.name);if(n)e.reactive_vars.add(n);return}if(t.type!=="ObjectPattern"&&t.type!=="ArrayPattern")return;for(let n of Y(t)){let i=gi(e,n);if(i)e.reactive_vars.add(i)}}function Vt(e){if(!e||typeof e!=="object"||!("type"in e))return!1;switch(String(e.type)){case"BlockStatement":case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"CatchClause":case"EachBlock":case"AwaitBlock":return!0;default:return!1}}function za(e){if(!e||typeof e!=="object"||!("type"in e))return!1;let t=String(e.type);return t==="FunctionDeclaration"||t==="FunctionExpression"||t==="ArrowFunctionExpression"}function Lh(e){let t=[];if(e.id.type==="Identifier")return t.push({kind:"local",name:e.id.name}),t;if(e.id.type!=="ObjectPattern")return t;for(let n of e.id.properties){if(n.type==="RestElement"){if(n.argument.type==="Identifier")t.push({kind:"local",name:n.argument.name});continue}if(n.computed)continue;let i=J(n.key);if(!i)continue;let r=n.value.type==="AssignmentPattern"?n.value.left:n.value;if(r.type!=="Identifier"||!r.name)continue;t.push({kind:"prop",name:r.name,publicPropName:i})}return t}function Ka(e,t,n,i){let r=e.kind==="var"?n:t;for(let s of e.declarations){if(i?.allowRunesProps&&me(s.init,"$props")){for(let l of Lh(s))En(l.kind==="prop"?t:n,l.name,l.kind==="prop"?{kind:"prop",publicPropName:l.publicPropName}:{kind:"local"});continue}for(let l of Y(s.id))En(r,l,i?.forceProp?{kind:"prop",publicPropName:l}:{kind:"local"})}}function Ft(e,...t){for(let n of t)for(let i of Y(n))En(e,i,{kind:"local"})}function Ja(e,t,n,i){switch(e.type){case"VariableDeclaration":Ka(e,t,n,i);break;case"FunctionDeclaration":case"ClassDeclaration":Ft(t,e.id);break}}function Rh(e,t){for(let{local:n,exported:i}of t){if(n.type!=="Identifier")continue;let r=i.type==="Identifier"?i.name:String(i.value);if(e.componentScope.get(n.name)?.kind==="prop")continue;e.componentScope.set(n.name,{kind:"prop",publicPropName:r})}}function Mh(e,t){let n=e.componentScope;for(let i of t?.content.body??[])if(i.type==="ImportDeclaration")Ft(n,...i.specifiers.map((r)=>r.local));else if(i.type!=="ExportNamedDeclaration")Ja(i,n,n,{allowRunesProps:!0});else if(!i.declaration){if(i.source==null)Rh(e,i.specifiers)}else if(i.declaration.type==="VariableDeclaration")Ka(i.declaration,n,n,{forceProp:!0});else if(i.declaration.type==="FunctionDeclaration"&&i.declaration.id?.name){let{name:r}=i.declaration.id;En(n,r,{kind:"prop",publicPropName:r})}}function Xa(e){e.componentScope.clear(),e.activeScopes.length=0,Mh(e,e.parsed?.instance)}function Ya(e){return{varScopeStack:[e.componentScope]}}function Qa(e,t,n){if(!Vt(n))return;let i=new Map,r=t.varScopeStack[t.varScopeStack.length-1]??e.componentScope;switch(n.type){case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":Ft(i,n.id,...n.params.map((s)=>s.type==="TSParameterProperty"?s.parameter:s));break;case"BlockStatement":for(let s of n.body)Ja(s,i,r);break;case"CatchClause":Ft(i,n.param);break;case"EachBlock":if(Ft(i,n.context),typeof n.index==="string")En(i,n.index,{kind:"local"});break;case"AwaitBlock":Ft(i,n.value,n.error);break}if(za(n))t.varScopeStack.push(i);return i}function Za(e,t){if(za(t))e.varScopeStack.pop()}function Tn(e,t,n=!0){let i=ft(e,t);if(i||!n)return i;let r=mn(e,t,!0);if(!r)return null;let s=!ge(e,t)?.params?.length;return{type:r,...ns(e,t),inferred:s}}var Oh=/\bany\b/;function us(e,t,n,i,r,s){if(r==="any"||!Oh.test(r))return;D(e,"context-any-type",n,`Context "${t}" ${i} is inferred as "${r}"; annotate it to replace "any".`,w(e,s))}function Bh(e,t,n){if(!T(t))return null;let i=Ot(e,t.name);if(re(i))return ol(e,i,n).properties;let r=Tn(e,t.name);return r?je(r.type):null}function Fh(e,t){return e.properties.some((n)=>n.type==="Property"&&n.kind==="get"&&J(n.key)===t)}function el(e,t,n){if(!t||typeof t!=="object"||!(n in t))return;let i=t[n];if(!i||typeof i!=="object"||!("typeAnnotation"in i))return;return oe(e,i.typeAnnotation)}function Vh(e){let t=e?.body.body;if(t?.length!==1||t[0].type!=="ReturnStatement")return;return t[0].argument??void 0}function jh(e,t,n,i,r){let s=()=>(D(e,"context-any-type",n,`Context "${t}" property "${n}" has no type annotation; defaulted to "any".`,w(e,i)),{type:"any"});if(T(r))return Tn(e,r.name)??s();if(r?.type==="ArrowFunctionExpression"||r?.type==="FunctionExpression")return{type:Bt(e,r),inferred:!0};if(qe(r))return{type:ht(r)??"null"};if(r?.type==="MemberExpression"&&!r.computed&&T(r.object)&&T(r.property)){let p=Tn(e,r.object.name)?.type,c=p&&is(p,r.property.name);if(c)return{type:c}}if(r===void 0)return{type:"any"};let l=r.type==="CallExpression"?yn(e,r):void 0;if(l)return{type:l,inferred:!0};let o=xe(e,r),a=o.type??o.resolvedType;return a?{type:a,inferred:!0}:s()}function ol(e,t,n){let i=[],r=!1;for(let s of t.properties){if(s.type==="SpreadElement"){let h=Bh(e,s.argument,n);if(h)i.push(...h);else r=!0,D(e,"spread-unresolved",n,`Context "${n}" spreads a value sveld can't resolve; its shape is widened to "Record<string, any>".`,w(e,s));continue}if(s.type!=="Property")continue;let l=J(s.key);if(!l)continue;if(s.kind==="set"&&Fh(t,l))continue;let o=s.kind==="get"||s.kind==="set"?s.value:void 0,a=j(e,s),p=!o&&(s.value.type==="ArrowFunctionExpression"||s.value.type==="FunctionExpression")?s.value:void 0,c=!a?.type&&p?ps(a,p):void 0,u=o?s.kind==="get"?el(e,o,"returnType"):el(e,o.params[0],"typeAnnotation"):a?.type??c,f=u?{type:u,description:a?.description,inferred:c!==void 0&&!a?.params?.length}:jh(e,n,l,s,s.kind==="get"?Vh(o):s.kind==="set"?void 0:s.value);if(f.inferred)us(e,n,l,`property "${l}"`,f.type,s);i.push({name:l,type:f.type,description:f.description||a?.description||void 0,optional:!1,...f.internal?{internal:!0}:{}})}return{properties:i,hasUnresolvedSpread:r}}function tl(e,t,n){let{properties:i,hasUnresolvedSpread:r}=ol(e,t,n);return{key:n,typeName:rs(n),properties:i,description:void 0,...r?{hasUnresolvedSpread:r}:{}}}function nl(e,t,n){if(re(t))return tl(e,t,n);let i=rs(n),r=(p)=>({key:n,typeName:i,type:p,properties:[]});if(t.type==="CallExpression"){let p=yn(e,t);if(p)us(e,n,n,"value",p,t);return p?r(p):null}if(t.type==="Literal"&&t.value===null&&t.raw==="null")return r("null");if(T(t)&&t.name==="undefined")return r("undefined");if(!T(t))return null;let s=t.name,l=Tn(e,s,!1),o=l?void 0:Ot(e,s);if(re(o)){let{internal:p}=ns(e,s);return{...tl(e,o,n),...p?{internal:p}:{}}}let a=l??Tn(e,s);if(a){if(a.inferred)us(e,n,s,`variable "${s}"`,a.type,t);let p=je(a.type);return{key:n,typeName:i,...p?{}:{type:a.type},properties:p??[],description:a.description||void 0,...a.internal?{internal:!0}:{}}}return D(e,"context-any-type",s,`Context "${n}" variable "${s}" has no type annotation; defaulted to "any".`,w(e,t)),r("any")}function il(e){let t=e.callee,n=t.type==="Identifier"&&t.name==="Symbol",i=t.type==="MemberExpression"&&!t.computed&&t.object.type==="Identifier"&&t.object.name==="Symbol"&&t.property.type==="Identifier"&&t.property.name==="for";if(!n&&!i)return null;let r=e.arguments[0];if(r?.type==="Literal"&&typeof r.value==="string")return r.value;if(r?.type==="TemplateLiteral"&&r.quasis.length===1)return r.quasis[0].value.cooked??"";return""}function rl(e){return{kind:"pending",importSource:e.source,importedName:e.importedName,...e.members?{members:e.members}:{}}}function al(e,t,n=0){if(!t||typeof t!=="object"||!("type"in t))return{kind:"unresolved"};let i=t;if(i.type==="Literal"||i.type==="TemplateLiteral"){let r=ua(i);return r==null?{kind:"unresolved"}:{kind:"resolved",key:r}}if(i.type==="CallExpression"||i.type==="NewExpression"){let r=il(i);return r==null?{kind:"unresolved"}:{kind:"resolved",key:r}}if(i.type==="Identifier"){if(n>=5)return{kind:"unresolved"};let r=Ot(e,i.name);if(r&&typeof r==="object"&&"type"in r){let l=r;if((l.type==="CallExpression"||l.type==="NewExpression")&&il(l)==="")return{kind:"resolved",key:i.name};return al(e,l,n+1)}let s=n===0&&mt(e,i.name)?void 0:e.valueImportBindingsByLocalName.get(i.name);return s?rl(s):{kind:"unresolved"}}if(i.type==="MemberExpression"){let r=n===0&&xi(e,i)?void 0:hi(e,i);if(r)return rl(r)}return{kind:"unresolved"}}function sl(e,t,n,i,r){let s=oe(e,i)??"";D(e,"context-value-unresolved",t,`setContext(${n}, ${s}): the value isn't an object literal or a variable, so sveld can't describe its shape; the context is skipped.`,r)}function ll(e,t,n){let i=t.arguments[0];if(!i)return;let r=al(e,i);if(r.kind==="unresolved"||r.kind==="resolved"&&!r.key){let c=oe(e,i)??"";D(e,"context-key-unresolved",c,`setContext key \`${c}\` isn't a string literal, const-bound string, Symbol(), or imported \`export const\` string; the context is skipped.`,w(e,t));return}let s=t.arguments[1];if(!s)return;let l=w(e,t),o=j(e,n)?.internal===!0;if(r.kind==="pending"){let c=un(r),u=nl(e,s,c);if(u)e.pendingContextKeyCandidates.push({importSource:r.importSource,importedName:r.importedName,...r.members?{members:r.members}:{},...u.type===void 0?{}:{type:u.type},properties:u.properties,description:u.description,...u.hasUnresolvedSpread?{hasUnresolvedSpread:!0}:{},...u.internal||o?{internal:!0}:{},source:l});else sl(e,c,c,s,l);return}let a=r.key,p=nl(e,s,a);if(!p){sl(e,a,JSON.stringify(a),s,l);return}if(e.contexts.has(a)){D(e,"context-duplicate-key",a,`setContext("${a}", ...) was called more than once; only the first call's shape is used.`,l);return}e.contexts.set(a,{...p,...o?{internal:!0}:{},source:l})}var Gh=/\n/g,Wh=/^[A-Za-z_$][\w$]*$/;function ds(e,t){return{variableType:(n)=>{if(t?.has(n))return;return ft(e,n)?.type??mn(e,n)}}}function vn(e,t,n){if(!t||typeof t!=="object"||!("type"in t))return n;if(T(t)){if(!mt(e,t.name))return n;let r=n??new Set;return r.add(t.name),r}let i=n;if(re(t)){for(let r of t.properties)if(r.type==="Property")i=vn(e,r.value,i)}else if(t.type==="ArrayExpression")for(let r of t.elements)i=vn(e,r,i);return i}function pl(e,t){if(T(t))return e.variableType(t.name);return Hh(e,t)}function Hh(e,t){if(!t||typeof t!=="object"||!("type"in t))return;if(re(t))return Uh(e,t);if(t.type==="ArrayExpression")return qh(e,t);return}function cl(e,t){return pl(e,t)??(qe(t)?ht(t)??"null":"any")}function fs(e,t){if(qe(t)&&t.raw==="null")return"null";let n=pl(e,t);if(n!==void 0)return n;let i=qe(t)?t.value:void 0;return i==null?"":zh(i)}function Uh(e,t){if(t.properties.length===0)return"Record<string, never>";let n=[],i=!1;for(let r of t.properties){let s=r.type==="Property"&&!r.computed?J(r.key):void 0;if(r.type!=="Property"||!s){i=!0;continue}n.push({name:s,type:cl(e,r.value)})}if(!i)return bn(n);if(n.length===0)return"Record<string, any>";return bn([...n,{name:"[key: string]",type:"any"}])}function qh(e,t){let n=new Set(t.elements.filter((i)=>i!=null).map((i)=>cl(e,i)));if(n.size===0)return"any[]";if(n.size===1)return`${[...n][0]}[]`;return`(${[...n].join(" | ")})[]`}function ul(e,t){for(let[n,i]of e.arguments.entries()){if(T(i)&&i.name===t)return{argumentIndex:n};if(!re(i))continue;for(let r of i.properties){if(r.type!=="Property"||!T(r.value))continue;if(r.value.name!==t)continue;let s=!r.computed&&T(r.key)?r.key.name:void 0;return{argumentIndex:n,property:s??""}}}return}function zh(e){return typeof e==="string"?JSON.stringify(e):String(e)}function Qe(e,{name:t,detail:n,has_argument:i,description:r,deprecated:s,tags:l,internal:o,source:a}){let p=!i&&!n?"null":n||void 0,c=e.events.get(t);if(c?.type==="forwarded")e.events.set(t,{type:"dispatched",name:t,detail:p,description:r||c.description,deprecated:s??c.deprecated,tags:l??c.tags,...o||c.internal?{internal:!0}:{},source:a||c.source});else if(c){let u=e.untypedJsDocEventNames.delete(t);e.events.set(t,{...c,detail:c.detail===void 0||u?p:c.detail,description:c.description||r,deprecated:c.deprecated??s,tags:c.tags??l,...c.internal||o?{internal:!0}:{},source:a||c.source})}else e.events.set(t,{type:"dispatched",name:t,detail:p,description:r,deprecated:s,tags:l,...o?{internal:!0}:{},source:a})}function dl(e,t){let n=t.arguments[0],i=Fr(n,"CustomEvent");if(!i&&!Fr(n,"Event"))return;let r=n.arguments[0],s=qe(r)?r.value:void 0;if(s==null)return;let l=i?n.arguments[1]:void 0,o=!1,a;if(re(l)){let p=l.properties.find((c)=>c.type==="Property"&&T(c.key)&&c.key.name==="detail");if(p?.type==="Property")o=!0,a=p.value}return{name:String(s),detail:a,hasArgument:o,nestedBoundNames:vn(e,a),source:w(e,t)}}function fl(e,t){Qe(e,{name:t.name,detail:fs(ds(e,t.nestedBoundNames),t.detail),has_argument:t.hasArgument,source:t.source})}function bn(e,t=!1){if(e.length===0)return"null";let n=e.map(({name:i,type:r,description:s,optional:l,default:o})=>{let a=l?"?":"",p=Wh.test(i)||i.startsWith("[")?i:JSON.stringify(i),c=o?`@default ${o}`:"",u=Rt(s&&c?`${s} ${c}`:s||c);if(u){if(t)return`${u.includes(`
|
|
21
|
+
`).trim()}var ih=/\*\//g,rh=/[.*+?^${}()|[\]\\]/g;function hi(e){return e.replace(rh,"\\$&")}function Rt(e){return e.replace(ih,"*\\/")}function ge(e){return e.map((t)=>`${t.name}${t.optional?"?":""}: ${t.type}`).join(", ")}var ka;function Ve(e,t){return ka??=new Intl.Collator("en"),ka.compare(e,t)}function ln(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===95}function _a(e,t){if(t===""){for(let r=0;r<e.length;r++)if(ln(e.charCodeAt(r)))return!0;return!1}let n=ln(t.charCodeAt(0)),i=ln(t.charCodeAt(t.length-1));for(let r=e.indexOf(t);r!==-1;r=e.indexOf(t,r+1)){let s=r>0&&ln(e.charCodeAt(r-1)),l=r+t.length<e.length&&ln(e.charCodeAt(r+t.length));if(s!==n&&l!==i)return!0}return!1}function mi(e){return e==="TSTypeAnnotation"||e==="TSTypeAliasDeclaration"||e==="TSInterfaceDeclaration"||e==="TSTypeParameterDeclaration"||e==="TSTypeParameterInstantiation"}function Mt(e){let t=new Set(e);return(n)=>t.has(n.type)}function ss(e){let t=[];return K(e,{enter(n){if(n.type==="FunctionDeclaration"||n.type==="FunctionExpression"||n.type==="ArrowFunctionExpression")return re;if(n.type==="ReturnStatement")t.push(n.argument??null)}}),t}var sh=Mt(["TSInterfaceDeclaration","TSTypeAliasDeclaration","TSTypeAnnotation","TSTypeLiteral","TSTypeReference"]);function $a(e){return e.type==="Identifier"?e.name:e.right.name}function Ia(e){return e.type==="Identifier"?e.name:Ia(e.left)}function La(e,t,n){let i=t?.start,r=t?.end;if(i===void 0||r===void 0)return;return W(e,i+n,r)?.trim()}function le(e,t){return La(e,t,1)}function ut(e,t){return La(e,t,0)}function je(e,t,n,i,r=new Set){if(!t)return;let s=(l)=>je(e,l,n,i,r);K(t,{enter(l){if(!sh(l))return;switch(l.type){case"TSInterfaceDeclaration":for(let o of l.extends??[])Na(e,o.expression,o.typeParameters?.params,n,i,r);return Da(l.body.body,s),re;case"TSTypeAliasDeclaration":case"TSTypeAnnotation":return s(l.typeAnnotation),re;case"TSTypeLiteral":return Da(l.members,s),re;case"TSTypeReference":return Na(e,l.typeName,l.typeArguments?.params,n,i,r),re}}})}function oh(e,t){let n=new Map;for(let i of Array.from(t).sort()){let r=e.valueImportBindingsByLocalName.get(i)??e.additionalImportedTypes.get(i),s=e.typeImportBindingsByLocalName.get(i)??(r?{...r,specifierType:"named"}:void 0);if(!s)continue;let l=n.get(s.source)??{default:[],named:[],namespace:[]};if(s.specifierType==="default")l.default.push(s.localName);else if(s.specifierType==="namespace")l.namespace.push(s.localName);else l.named.push({imported:s.importedName,local:s.localName});n.set(s.source,l)}return Array.from(n.entries()).sort(([i],[r])=>Ve(i,r)).map(([i,r])=>{if(r.namespace.length>0)return r.namespace.map((a)=>`import type * as ${a} from "${i}";`).join(`
|
|
22
|
+
`);let s=r.named.map(({imported:a,local:p})=>{if(!a||a===p)return p;return`${a} as ${p}`}),l=r.default[0],o=s.length>0?`{ ${s.join(", ")} }`:"";if(l&&o)return`import type ${l}, ${o} from "${i}";`;if(l)return`import type ${l} from "${i}";`;return`import type ${o} from "${i}";`})}function Na(e,t,n,i,r,s){let l=Ia(t);if(e.typeImportBindingsByLocalName.has(l)||e.valueImportBindingsByLocalName.has(l))i.add(l);let o=e.localTypeDeclarationsByName.get(l);if(o&&!s.has(l))r.add(l),s.add(l),je(e,o.node,i,r,s),s.delete(l);for(let a of n??[])je(e,a,i,r,s)}function Da(e,t){for(let n of e)if(n.type==="TSPropertySignature")t(n.typeAnnotation?.typeAnnotation)}function O(e,t){if(t)e.additionalTypeDependencyNodes.push(t)}function ah(e){if(!e.const)return;let t=e.id.name,n=[];for(let i of e.members){let r=i.initializer;if(r?.type!=="Literal")return;let s=r.value;if(typeof s==="string")n.push(JSON.stringify(s));else if(typeof s==="number")n.push(String(s));else return}if(n.length===0)return;return`type ${t} = ${n.join(" | ")};`}function Ra(e,t){let n=ah(t);if(n)return n;let i=W(e,t.start,t.end)?.trim();return i?`declare ${i}`:void 0}var lh=/\/\*\*((?:(?!\*\/)[\s\S])*)\*\/\s*$/;function ph(e,t,n){if(t===void 0)return;let i=W(e,t,n),r=i&&lh.exec(i);return r?ui(r[0]):void 0}function cn(e,t){let n=[],i="start"in t&&typeof t.start==="number"?t.start:void 0,r=(s)=>t.params.length===1?"arg":`arg${s}`;for(let[s,l]of t.params.entries()){let o=ph(e,i,l.start);i=l.end;let a=l.type==="TSParameterProperty"?l.parameter:l;if(a.type==="RestElement"){O(e,a.typeAnnotation?.typeAnnotation),n.push({name:a.argument.type==="Identifier"?a.argument.name:"rest",type:le(e,a.typeAnnotation)??o,optional:!1,rest:!0});continue}let p=a.type==="AssignmentPattern",c=p?a.left:a,u="typeAnnotation"in c?c.typeAnnotation:void 0;O(e,u?.typeAnnotation),n.push({name:c.type==="Identifier"?c.name:r(s),type:le(e,u)??o,optional:p||"optional"in a&&a.optional===!0,rest:!1})}O(e,t.returnType?.typeAnnotation);for(let s of t.typeParameters?.params??[])O(e,s.constraint),O(e,s.default);return{params:n,returnType:le(e,t.returnType),typeParameters:ut(e,t.typeParameters)||void 0}}function Ot(e,t,n="any"){let{params:i,returnType:r,typeParameters:s}=cn(e,t),l=i.map(({name:a,type:p,optional:c,rest:u})=>u?`...${a}: ${p??"any[]"}`:`${a}${c?"?":""}: ${p??"any"}`),o=r!==void 0||s!==void 0||i.some((a)=>a.type!==void 0);return{signature:`${s??""}(${l.join(", ")}) => ${r??n}`,hasAnnotations:o}}function pn(e){return e.length>0?e.slice():void 0}function Ma(e){let t=pn(e.pendingCallDefaultCandidates),n=pn(e.pendingConstDefaultCandidates.filter((o)=>o.location!=="props"||!e.explicitDefaultPropNames.has(o.propName))),i=pn(e.pendingContextKeyCandidates),r=pn(e.pendingDispatchEscapeCandidates);if(!t&&!n&&!i&&!r)return;let s=pn(e.deferredEventNoSourceDiagnostics),l=r&&e.untypedJsDocEventNames.size>0?Array.from(e.untypedJsDocEventNames):void 0;return{...t?{pendingCallDefaultCandidates:t}:{},...n?{pendingConstDefaultCandidates:n}:{},...i?{pendingContextKeyCandidates:i}:{},...r?{pendingDispatchEscapeCandidates:r}:{},...s?{deferredEventNoSourceDiagnostics:s}:{},...l?{untypedJsDocEventNames:l}:{}}}function Oa(e){let t=new Set,n=new Set;for(let a of e.additionalTypeDependencyNodes)je(e,a,t,n);for(let a of e.additionalImportedTypes.keys())t.add(a);let i=Array.from(e.localTypeDeclarationsByName.values()).filter((a)=>a.exported).sort((a,p)=>a.start-p.start);for(let a of i)je(e,a.node,t,n);let r=i.map((a)=>`export ${a.code}`),s=e.typedRunesPropsDeclarations.length===1?e.typedRunesPropsDeclarations[0]:void 0,l=s?.canonicalType;if(s&&l){for(let a of s.referencedImportedTypes)t.add(a);for(let a of s.referencedLocalTypes)n.add(a)}if(!l&&t.size===0&&n.size===0&&r.length===0)return;let o=Array.from(n).map((a)=>e.localTypeDeclarationsByName.get(a)).filter((a)=>a!==void 0&&!a.exported).sort((a,p)=>a.start-p.start).map((a)=>a.code);return{...l?{canonicalPropsType:l}:{},canonicalPropNames:s&&l?Array.from(s.props.keys()).sort():[],localTypeDeclarations:o,...r.length>0?{moduleTypeDeclarations:r}:{},typeImportStatements:oh(e,t)}}function ch(e,t,n,i,r){for(let s of e){if(s.type!=="Block"||s.start<n||s.end>i)continue;r.push({start:s.start,end:s.end,isJsDoc:s.end-s.start>4&&t.startsWith("/**",s.start)})}}function uh(e,t){for(let n of e){let{start:i}=n,r=n.type==="ExportNamedDeclaration"?n.declaration:n;if(r?.type==="FunctionDeclaration"){if(r.id?.name)t.push({name:r.id.name,start:i})}else if(r?.type==="VariableDeclaration"){for(let s of r.declarations)if(s.id.type==="Identifier"&&s.id.name)t.push({name:s.id.name,start:i})}}}function dh(e,t,n){let i=0,r=e.length;while(i<r){let s=i+r>>>1;if(e[s].end<=t)i=s+1;else r=s}for(let s=i-1;s>=0;s--){let l=e[s];if(!l.isJsDoc)continue;return Zr(n,l.end,t)?l:void 0}return}function fh(e){let t=new Map;if(!e.source)return t;let n=[],i=[],r=e.parsed?.comments??[];for(let s of[e.parsed?.module,e.parsed?.instance]){let l=s?.content;if(!l)continue;ch(r,e.source,l.start,l.end,n),uh(l.body,i)}n.sort((s,l)=>s.end-l.end);for(let s of i){let l=dh(n,s.start,e.source);if(!l)continue;let o=ns(e,e.source.slice(l.start,l.end)),{type:a,description:p,ignore:c,internal:u}=di(o);if(c.length>0)Je(e,"context-any-type",s.name,c);if(!a&&!p&&!u)continue;t.set(s.name,{type:a?ke(a.type):void 0,description:p||a&&va(a),internal:u||void 0})}return t}function Fa(e,t){return e.variableInfoCache??=fh(e),e.variableInfoCache.get(t)}function dt(e,t){let n=qr(e,t);if(n?.type)return{type:n.type,description:n.description,internal:n.internal};let i=Fa(e,t),r=e.explicitVariableTypesByName.get(t);if(r)return{type:r,description:i?.description,internal:i?.internal};if(!i?.type)return null;return{type:i.type,description:i.description,internal:i.internal}}function ft(e,t){let n=dt(e,t);if(n&&n.type===e.explicitVariableTypesByName.get(t))O(e,e.explicitVariableTypeNodesByName.get(t));return n}function os(e,t){let n=Fa(e,t);return{...n?.description?{description:n.description}:{},...n?.internal?{internal:!0}:{}}}function xe(e,t){for(let i of e.vars)if(i.declarations.some((r)=>r.id.type==="Identifier"&&r.id.name===t))return Ba(e,i);let n=e.funcDecls.get(t);return n&&Ba(e,n)}function Ba(e,t){let n=G(e,t);if(n)return n;for(let i of[e.parsed?.instance,e.parsed?.module])for(let r of i?.content.body??[])if(r.type==="ExportNamedDeclaration"&&r.declaration===t)return G(e,r);return}var hh=/\w/,mh=/^readonly\s+/;function as(e,t){let n=e.trim();if(!n.startsWith("{")||!n.endsWith("}"))return;let i=F(n.slice(1,-1),";,").map((r)=>r.trim().replace(mh,""));for(let r of i){if(!r.startsWith(t))continue;let s=r.slice(t.length);if(hh.test(s.charAt(0)))continue;let l=s.trimStart(),o=l.startsWith("?");if(o)l=l.slice(1).trimStart();if(!l.startsWith(":"))continue;let a=l.slice(1).trim();return o?`${a} | undefined`:a}return}function Va(e,t){if(t.computed||t.object.type!=="Identifier"||t.property.type!=="Identifier")return;let n=t.object.name,i=t.property.name;if(e.wholePropsLocals.has(n))return nn(e,i);let r=nn(e,n)??dt(e,n)?.type;if(!r)return;return as(r,i)}var yh=/(?:_|[^\p{ID_Continue}$])+/u,gh=/^[\p{ID_Start}$]/u;function ls(e){let i=`${e.split(yh).map((r)=>r.charAt(0).toUpperCase()+r.slice(1)).join("")}Context`;return gh.test(i)?i:`_${i}`}var xh=/^\{([\s\S]*)\}$/,Eh=/^[A-Za-z_$][\w$]*$/,Sh=/^readonly\s+/,Th=/^\[[\w$]+\s*:[^\]]+\]$/;function Ge(e,{skipIndexSignatures:t=!1,withReadonly:n=!1}={}){let i=e.trim(),r=xh.exec(i);if(!r)return null;let s=r[1].trim();if(s==="")return[];let l=[];for(let o of F(s,";,")){let a=o.trim();if(!a)continue;let p=tn(a,":");if(p===-1)return null;let c=a.slice(0,p).trim(),u=c.replace(Sh,""),f=a.slice(p+1).trim();if(!f)return null;if(t&&Th.test(u))continue;let h=!1;if(u.endsWith("?"))h=!0,u=u.slice(0,-1).trim();if(!Eh.test(u))return null;l.push(n?{name:u,type:f,optional:h,readonly:c!==u}:{name:u,type:f,optional:h})}return l}function yi({imported:e}){return e.type==="Identifier"?e.name:e.value}function un(e,t){let n=t.source.value;if(typeof n!=="string"||t.importKind==="type")return;for(let i of t.specifiers){if(i.type!=="ImportSpecifier"||i.importKind==="type")continue;let r=i.local.name,s=yi(i);e.valueImportBindingsByLocalName.set(r,{localName:r,importedName:s,source:n})}}function dn(e){return[e.importedName,...e.members??[]].join(".")}function ps(e,t){let n=[],i=t;while(ze(i)){if(i.computed||!T(i.property))return;n.unshift(i.property.name),i=i.object}if(!T(i))return;return fn(e,i.name,n)}function fn(e,t,n=[]){let i=(s,l,o)=>o.length>0?{source:s,importedName:l,members:o}:{source:s,importedName:l},r=e.valueImportBindingsByLocalName.get(t);if(r)return i(r.source,r.importedName,n);for(let s of[e.parsed?.instance,e.parsed?.module])for(let l of s?.content.body??[]){if(l.type!=="ImportDeclaration")continue;let o=l.source.value;if(l.importKind==="type"||typeof o!=="string")continue;let a=l.specifiers.find((p)=>p.local.name===t);if(a?.type==="ImportDefaultSpecifier")return i(o,"default",n);if(a?.type==="ImportNamespaceSpecifier"&&n.length>0)return i(o,n[0],n.slice(1))}return}function gi(e,t){if(!ze(t))return;return ps(e,t)}function ja(e){let t=new Map;for(let n of e.content.body){if(n.type!=="ImportDeclaration"||n.importKind==="type")continue;let i=n.source.value;if(typeof i!=="string")continue;for(let r of n.specifiers){if(r.type==="ImportSpecifier"&&r.importKind==="type")continue;let s=r.local.name,l;if(r.type==="ImportDefaultSpecifier")l="default";else if(r.type==="ImportNamespaceSpecifier")l="*";else l=yi(r);t.set(s,{from:i,imported:l})}}return t}function cs(e,t){for(let n of t?.content.body??[]){if(n.type==="ImportDeclaration"){un(e,n);continue}let i=n.type==="ExportNamedDeclaration"&&n.declaration?n.declaration:n;if(i.type==="FunctionDeclaration"&&i.id?.name)e.funcDecls.set(i.id.name,i)}}function hn(e,t,n){if(!t)return;si(e,t);let i=e.props.get(t);e.props.set(t,i?{...i,...n}:n)}function xi(e,t,n,i){if(t.pendingCallDefault)e.pendingCallDefaultCandidates.push({propName:n,location:i,...t.pendingCallDefault});if(t.pendingConstDefault)e.pendingConstDefaultCandidates.push({propName:n,location:i,...t.pendingConstDefault})}var bh=new Map([["Date","Date"],["Map","Map<any, any>"],["Set","Set<any>"],["WeakMap","WeakMap<object, any>"],["WeakSet","WeakSet<object>"],["Array","any[]"],["RegExp","RegExp"],["Regexp","RegExp"],["Error","Error"]]);function Ee(e,t,n=0){let i=wh(e,t,n),r=t&&typeof t==="object"?za(e,t):void 0;return r===void 0?i:{...i,type:r}}var vh=/^\s*\(\s*$/;function za(e,t){let{constAssertions:n,typeAssertions:i}=e.typeCasts;if(n.has(t))return Se(t,"const");let r=i.get(t);if(r)return O(e,r),ae(e,r);return Ch(e,t)}function Ch(e,t){let n="start"in t&&typeof t.start==="number"?t.start:void 0;if(n===void 0)return;let i=e.parsed?.comments.findLast((r)=>r.end<=n);if(i?.type!=="Block"||!i.value.startsWith("*"))return;if(!vh.test(W(e,i.end,n)??""))return;return ui(i.value)}function Ah(e){return j(e)&&"type"in e}function mn(e){return Ah(e)?e:void 0}function wh(e,t,n){let i=mn(t);if(!i)return{value:void 0,type:void 0,isFunction:!1};let r=qa(e,i),s=(l,o)=>({value:l,type:o,isFunction:!1,defaultValue:r});switch(i.type){case"ObjectExpression":case"ArrayExpression":return s(Ye(e,i),Se(i,"widen"));case"BinaryExpression":return s(Ye(e,i),oe(e,i,n));case"ArrowFunctionExpression":case"FunctionExpression":return{...s(Ua(e,i),Xa(e,i)),isFunction:!0};case"UnaryExpression":return s(Ye(e,i),oe(e,i,n));case"LogicalExpression":case"ConditionalExpression":case"SequenceExpression":{let l=Ye(e,i),o=l!==void 0&&i.type==="SequenceExpression"?`(${l})`:l;return s(o,oe(e,i,n))}case"NewExpression":{let{callee:l}=i,o=T(l)?bh.get(l.name)??l.name:void 0;return s(Xe(e,i),o)}case"CallExpression":return Ph(e,i,r,n);case"Identifier":{let{name:l}=i;if(n<5){let o=xn(e,l);if(o){let p=Ee(e,$h(o),n+1),c=xe(e,l);return{...p,resolvedType:c?.type??p.resolvedType,resolvedDescription:c?.description??p.resolvedDescription,resolvedParams:c?.params??p.resolvedParams,resolvedReturnType:c?.returnType??p.resolvedReturnType}}let a=e.funcDecls.get(l);if(a){let p=xe(e,l);return{value:Ua(e,a),type:void 0,isFunction:!0,defaultValue:qa(e,a),resolvedType:p?.type??Ja(e,p,a),resolvedDescription:p?.description,resolvedParams:p?.params,resolvedReturnType:p?.returnType}}}return Ga(s(Xe(e,i)),e.valueImportBindingsByLocalName.get(l))}case"MemberExpression":return Ga(s(Xe(e,i),Wh(i)?"number":void 0),gi(e,i));case"TemplateLiteral":return s(Xe(e,i),"string");case"Literal":return typeof i.raw==="string"?s(i.raw,ht(i)):s(void 0);case"AssignmentExpression":case"AwaitExpression":case"ChainExpression":case"ClassExpression":case"ImportExpression":case"MetaProperty":case"TaggedTemplateExpression":case"ThisExpression":case"TSAsExpression":case"TSInstantiationExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"UpdateExpression":case"YieldExpression":break}return s(void 0)}function Ga(e,t){if(!t)return e;let{source:n,importedName:i,members:r}=t;return{...e,pendingConstDefault:{importSource:n,importedName:i,...r?{members:r}:{}}}}function Ph(e,t,n,i){let r=Xe(e,t),{callee:s}=t,l=T(s)?s.name:void 0;if((l==="$derived"||l==="$state")&&t.arguments.length===1&&i<5)return{...Ee(e,t.arguments[0],i+1),value:r,defaultValue:n};let o={value:r,type:void 0,isFunction:!1,defaultValue:n};if(l){let a=Ih(e,l);if(a?.declared)return{...o,resolvedType:a.type};if(a)return{...o,type:a.type};if(e.funcDecls.has(l)||Ka(e,l))return{...o,pendingCallDefault:{calleeName:l}};let p=e.valueImportBindingsByLocalName.get(l);if(p)return{...o,pendingCallDefault:{calleeName:l,importSource:p.source,importedName:p.importedName}}}return{...o,pendingCallDefault:{calleeName:l??Xe(e,s)??"call"}}}function ht(e){if("regex"in e&&e.regex)return"RegExp";if("bigint"in e&&e.bigint)return"bigint";return e.value==null?void 0:typeof e.value}var kh=new Set(["-","*","/","%","**","<<",">>",">>>","&","|","^"]),_h=new Set(["==","!=","===","!==","<","<=",">",">=","in","instanceof"]);function oe(e,t,n){let i=mn(t);if(!i)return;switch(i.type){case"UnaryExpression":{let{operator:s,argument:l}=i;if(s==="!"||s==="delete")return"boolean";if(s==="typeof")return"string";if(s==="void")return;if(s==="+")return"number";return oe(e,l,n)==="bigint"?"bigint":"number"}case"BinaryExpression":{let{operator:s}=i;if(_h.has(s))return"boolean";let l=oe(e,i.left,n),o=oe(e,i.right,n);if(l==="bigint"&&o==="bigint")return"bigint";if(kh.has(s))return"number";if(s!=="+")return;if(l==="string"||o==="string")return"string";if(l==="number"&&o==="number")return"number";return}case"LogicalExpression":return Wa([oe(e,i.left,n),oe(e,i.right,n)]);case"ConditionalExpression":return Wa([oe(e,i.consequent,n),oe(e,i.alternate,n)]);case"SequenceExpression":return oe(e,i.expressions[i.expressions.length-1],n);case"Identifier":{let{name:s}=i;if(s==="NaN"||s==="Infinity")return"number";if(s==="undefined")return;let l=dt(e,s)?.type;if(l)return l;if(n>=5)return;return oe(e,xn(e,s),n+1)}case"ArrayExpression":case"ArrowFunctionExpression":case"AssignmentExpression":case"AwaitExpression":case"CallExpression":case"ChainExpression":case"ClassExpression":case"FunctionExpression":case"ImportExpression":case"Literal":case"MemberExpression":case"MetaProperty":case"NewExpression":case"ObjectExpression":case"TaggedTemplateExpression":case"TemplateLiteral":case"ThisExpression":case"TSAsExpression":case"TSInstantiationExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"UpdateExpression":case"YieldExpression":break}if(n>=5)return;let r=Ee(e,i,n+1);return r.type??r.resolvedType}function Wa(e){let t=new Set;for(let n of e){if(n===void 0)return;t.add(n.includes("=>")?`(${n})`:n)}return t.size===1?e[0]:[...t].join(" | ")}function Se(e,t){let n=mn(e),i=t==="widen";switch(n?.type){case"Literal":if("regex"in n&&n.regex)return"RegExp";if(n.value===null)return"null";return i?ht(n):n.raw??void 0;case"TemplateLiteral":if(n.expressions.length>0)return;return i?"string":`\`${n.quasis[0]?.value.raw??""}\``;case"Identifier":return n.name==="undefined"?"undefined":void 0;case"UnaryExpression":{let{operator:r,argument:s}=n;if(r!=="-"||s.type!=="Literal")return;let l=ht(s);if(l!=="number"&&l!=="bigint")return;return i?l:`-${s.raw}`}case"ArrayExpression":{let r=[];for(let o of n.elements){let a=o===null?void 0:Se(o,t);if(a===void 0)return;r.push(a)}if(t==="literal")return`[${r.join(", ")}]`;if(t==="const")return`readonly [${r.join(", ")}]`;let s=new Set(r);if(s.size===0)return"any[]";let l=[...s].join(" | ");return s.size===1?`${l}[]`:`(${l})[]`}case"ObjectExpression":{let r=new Map;for(let l of n.properties){if(l.type!=="Property"||l.kind!=="init"||l.computed||l.method||l.shorthand)return;let{key:o}=l,a=o.type==="Identifier"?o.name:o.type==="Literal"?o.raw:void 0,p=Se(l.value,t);if(a===void 0||p===void 0)return;r.delete(a),r.set(a,p)}if(r.size===0)return"{}";let s=t==="const"?"readonly ":"";return`{ ${[...r].map(([l,o])=>`${s}${l}: ${o}`).join("; ")} }`}case"ArrowFunctionExpression":case"AssignmentExpression":case"AwaitExpression":case"BinaryExpression":case"CallExpression":case"ChainExpression":case"ClassExpression":case"ConditionalExpression":case"FunctionExpression":case"ImportExpression":case"LogicalExpression":case"MemberExpression":case"MetaProperty":case"NewExpression":case"SequenceExpression":case"TaggedTemplateExpression":case"ThisExpression":case"TSAsExpression":case"TSInstantiationExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"UpdateExpression":case"YieldExpression":case void 0:break}return}function yn(e,t,n=!1){let i=xn(e,t);if(i===void 0){let s=e.funcDecls.get(t);return s&&Ha(e,t,s,n)}if(i.type==="ArrowFunctionExpression"||i.type==="FunctionExpression")return za(e,i)??Ha(e,t,i,n);if(i.type==="CallExpression"){let s=gn(e,i);if(s)return s;let l=ae(e,i.callee);if(l==="$state"||l==="$state.raw"||l==="$derived"){let o=i.typeArguments?.params[0];if(o)return O(e,o),ae(e,o);if(l==="$state.raw")return Ee(e,i.arguments[0],1).type}}let r=Ee(e,i);return r.type??r.resolvedType}function Ha(e,t,n,i){let r=i?En(n):Sn(n),s=Ot(e,n,r);if(s.hasAnnotations)return s.signature;let l=xe(e,t);if(l?.type)return l.type;return i?ds(l,n)??Ft(e,n):Ja(e,l,n)}var Nh=new Map([["writable","Writable"],["readable","Readable"],["derived","Readable"],["readonly","Readable"]]),Dh=/^(?:import\("svelte\/store"\)\.)?(?:Writable|Readable)<([\s\S]*)>$/;function gn(e,t){let n=T(t.callee)?e.valueImportBindingsByLocalName.get(t.callee.name):void 0,i=n?.source==="svelte/store"?Nh.get(n.importedName):void 0;if(!i)return;let r=n?.importedName==="derived",s=t.typeArguments?.params[r?1:0],l;if(s)O(e,s),l=ae(e,s);else if(n?.importedName==="readonly"){let[o]=t.arguments;l=(T(o)?ft(e,o.name)?.type??yn(e,o.name):o?.type==="CallExpression"?gn(e,o):void 0)?.trim().match(Dh)?.[1]}else if(r){let o=t.arguments[1];l=(o?.type==="ArrowFunctionExpression"||o?.type==="FunctionExpression")&&o.params.length<2?Sn(o):void 0}else{let[o]=t.arguments;l=(T(o)?ft(e,o.name)?.type:void 0)??oe(e,o,0)}return`import("svelte/store").${i}<${l??"any"}>`}function $h(e){if(e.type!=="CallExpression"||e.arguments.length!==1)return e;let[t]=e.arguments;if(t.type==="SpreadElement")return e;let{callee:n}=e;return n.type==="Identifier"&&(n.name==="$state"||n.name==="$derived")||n.type==="MemberExpression"&&T(n.object)&&n.object.name==="$state"&&T(n.property)&&n.property.name==="raw"?t:e}function xn(e,t,n=!1){for(let i of e.vars){if(n&&i.kind!=="const")continue;for(let r of i.declarations)if(T(r.id)&&r.id.name===t&&r.init)return r.init}return}function Bt(e,t){return xn(e,t,!0)}function Ih(e,t){let n=xe(e,t);if(n?.returnType)return{type:n.returnType,declared:!0};let i=e.funcDecls.get(t)??Ka(e,t);if(!i)return;let r=Rh(e,i)??Lh(e,t);if(r)return{type:r,declared:!0};let s=Sn(i);return s==="any"?void 0:{type:s,declared:!1}}function Ka(e,t){let n=xn(e,t);return n?.type==="ArrowFunctionExpression"||n?.type==="FunctionExpression"?n:void 0}function Lh(e,t){for(let n of e.vars)for(let i of n.declarations){let r=i.id;if(!T(r)||r.name!==t)continue;let s=r.typeAnnotation?.typeAnnotation;if(!s)return;return ma(W(e,s.start,s.end))}return}function Rh(e,t){let n=t.returnType?.typeAnnotation;return n&&W(e,n.start,n.end)}function Ja(e,t,n){let i=t?.returnType??"any",r=t?.params;if(r&&r.length>0)return`(${ge(r)}) => ${i}`;if(t?.returnType)return`() => ${i}`;return Xa(e,n)}function Xa(e,t){let n=Sn(t),i=Ot(e,t,n);if(i.hasAnnotations)return i.signature;return`(${Mh(t)}) => ${n}`}function Mh({params:e}){let t=[];for(let n of e){if(!T(n))return"...args: any[]";t.push(`${n.name}: any`)}return t.length>0?t.join(", "):"...args: any[]"}function Ft(e,t){let n=En(t),i=Ot(e,t,n);if(i.hasAnnotations)return i.signature;return`(${Ya(t)}) => ${n}`}function Ya(e){let t=(i)=>e.params.length===1?"arg":`arg${i}`;return e.params.map((i,r)=>{if(i.type==="RestElement")return`...${T(i.argument)?i.argument.name:"args"}: any[]`;if(i.type==="AssignmentPattern")return`${T(i.left)?i.left.name:t(r)}?: any`;return`${T(i)?i.name:t(r)}: any`}).join(", ")}function ds(e,t){if(!e?.params?.length&&!e?.returnType)return;return`(${e.params?.length?ge(e.params):Ya(t)}) => ${e.returnType??En(t)}`}function En(e){return Oh(e)?e.async?"Promise<void>":"void":Sn(e)}function Oh(e){return!e.generator&&e.body.type==="BlockStatement"&&ss(e.body).every((t)=>t===null)}function Sn(e){if(e.async||e.generator)return"any";let{body:t}=e,n=t.type==="BlockStatement"?ss(t):[t],i=new Set(n.map(Bh)),[r]=i;return i.size===1&&r?r:"any"}function Bh(e){let t=mn(e);switch(t?.type){case"Literal":{let{value:n}=t;if(typeof n==="string")return"string";if(typeof n==="number")return"number";if(typeof n==="boolean")return"boolean";return null}case"TemplateLiteral":return"string";case"CallExpression":{let{callee:n}=t;if(!T(n))return null;if(n.name==="String")return"string";if(n.name==="Number")return"number";if(n.name==="Boolean")return"boolean";return null}case"ArrayExpression":case"ArrowFunctionExpression":case"AssignmentExpression":case"AwaitExpression":case"BinaryExpression":case"ChainExpression":case"ClassExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"ImportExpression":case"LogicalExpression":case"MemberExpression":case"MetaProperty":case"NewExpression":case"ObjectExpression":case"SequenceExpression":case"TaggedTemplateExpression":case"ThisExpression":case"TSAsExpression":case"TSInstantiationExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"UnaryExpression":case"UpdateExpression":case"YieldExpression":case void 0:break}return null}function Fh(e,{params:t}){if(t.length===0)return"";return W(e,t[0].start,t[t.length-1].end)??""}function Ua(e,t){if(t.generator)return;let{body:n}=t,i=Fh(e,t),r=t.async?"async ":"",s=(a,p)=>a.type==="ObjectExpression"?`(${p})`:p;if(n.type!=="BlockStatement"){let a=Ye(e,n);return a===void 0?void 0:`${r}(${i}) => ${s(n,a)}`}let l=n.body;if(l.length===0)return`${r}(${i}) => {}`;let[o]=l;if(l.length===1&&o.type==="ReturnStatement"&&o.argument){let a=Ye(e,o.argument);if(a!==void 0)return`${r}(${i}) => ${s(o.argument,a)}`}return}function Vh(e){switch(e.type){case"Literal":case"UnaryExpression":return"literal";case"TemplateLiteral":return e.expressions.length===0?"literal":"expression";case"ArrayExpression":return"array";case"ObjectExpression":return"object";case"ArrowFunctionExpression":case"FunctionExpression":case"FunctionDeclaration":return"function";case"AssignmentExpression":case"AwaitExpression":case"BinaryExpression":case"CallExpression":case"ChainExpression":case"ClassExpression":case"ConditionalExpression":case"Identifier":case"ImportExpression":case"LogicalExpression":case"MemberExpression":case"MetaProperty":case"NewExpression":case"SequenceExpression":case"TaggedTemplateExpression":case"ThisExpression":case"TSAsExpression":case"TSInstantiationExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"UpdateExpression":case"YieldExpression":break}return"expression"}function qa(e,t){let n=Ye(e,t);if(!n)return;let i=Vh(t);if(i!=="literal"&&i!=="array"&&i!=="object")return{raw:n,kind:i};let r=us(t);if(r.ok)return{raw:n,kind:i,value:r.value};return{raw:n,kind:t.type==="UnaryExpression"?"expression":i}}function us(e){let t=mn(e);switch(t?.type){case"Literal":return typeof t.value==="bigint"||"regex"in t?{ok:!1}:{ok:!0,value:t.value};case"UnaryExpression":{let{operator:n,argument:i}=t;if(i.type!=="Literal")return{ok:!1};let{value:r}=i;if(typeof r==="number"){if(n==="-")return{ok:!0,value:-r};if(n==="+")return{ok:!0,value:r}}if(typeof r==="boolean"&&n==="!")return{ok:!0,value:!r};return{ok:!1}}case"TemplateLiteral":{let{expressions:n,quasis:i}=t;if(n.length>0||i.length!==1)return{ok:!1};return{ok:!0,value:i[0].value.cooked??i[0].value.raw}}case"ArrayExpression":{let n=[];for(let i of t.elements){if(!i)return{ok:!1};let r=us(i);if(!r.ok)return{ok:!1};n.push(r.value)}return{ok:!0,value:n}}case"ObjectExpression":{let n={};for(let i of t.properties){if(i.type!=="Property"||i.computed)return{ok:!1};let r=X(i.key);if(!r)return{ok:!1};let s=us(i.value);if(!s.ok)return{ok:!1};n[r]=s.value}return{ok:!0,value:n}}case"ArrowFunctionExpression":case"AssignmentExpression":case"AwaitExpression":case"BinaryExpression":case"CallExpression":case"ChainExpression":case"ClassExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"ImportExpression":case"LogicalExpression":case"MemberExpression":case"MetaProperty":case"NewExpression":case"SequenceExpression":case"TaggedTemplateExpression":case"ThisExpression":case"TSAsExpression":case"TSInstantiationExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"UpdateExpression":case"YieldExpression":case void 0:break}return{ok:!1}}var jh=new Set(["POSITIVE_INFINITY","NEGATIVE_INFINITY","MAX_VALUE","MIN_VALUE","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","EPSILON","NaN"]),Gh=new Set(["PI","E","LN2","LN10","LOG2E","LOG10E","SQRT2","SQRT1_2"]);function Wh({object:e,property:t}){if(!T(e)||!T(t))return!1;if(e.name==="Number")return jh.has(t.name);if(e.name==="Math")return Gh.has(t.name);return!1}function Tn(e,t,n){if(!t||e.has(t))return;e.set(t,n)}function Ei(e,t){for(let n=e.activeScopes.length-1;n>=0;n-=1){let i=e.activeScopes[n]?.get(t);if(!i)continue;return i.kind==="prop"?i.publicPropName:void 0}return}function mt(e,t){for(let n=e.activeScopes.length-1;n>=0;n-=1){let i=e.activeScopes[n];if(i===e.componentScope)return!1;if(i?.has(t))return!0}return!1}function Si(e,t){let n=t;while(ze(n))n=n.object;return T(n)&&mt(e,n.name)}function Q(e,t=new Set){if(e)for(let n of Fr(e))t.add(n.name);return t}function fs(e,t){if(!t||typeof t!=="object"||!("type"in t))return;if(t.type==="Identifier"){let n=Ei(e,t.name);if(n)e.reactive_vars.add(n);return}if(t.type!=="ObjectPattern"&&t.type!=="ArrayPattern")return;for(let n of Q(t)){let i=Ei(e,n);if(i)e.reactive_vars.add(i)}}function jt(e){if(!e||typeof e!=="object"||!("type"in e))return!1;switch(String(e.type)){case"BlockStatement":case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"CatchClause":case"EachBlock":case"AwaitBlock":return!0;default:return!1}}function Qa(e){if(!e||typeof e!=="object"||!("type"in e))return!1;let t=String(e.type);return t==="FunctionDeclaration"||t==="FunctionExpression"||t==="ArrowFunctionExpression"}function Hh(e){let t=[];if(e.id.type==="Identifier")return t.push({kind:"local",name:e.id.name}),t;if(e.id.type!=="ObjectPattern")return t;for(let n of e.id.properties){if(n.type==="RestElement"){if(n.argument.type==="Identifier")t.push({kind:"local",name:n.argument.name});continue}if(n.computed)continue;let i=X(n.key);if(!i)continue;let r=n.value.type==="AssignmentPattern"?n.value.left:n.value;if(r.type!=="Identifier"||!r.name)continue;t.push({kind:"prop",name:r.name,publicPropName:i})}return t}function Za(e,t,n,i){let r=e.kind==="var"?n:t;for(let s of e.declarations){if(i?.allowRunesProps&&ye(s.init,"$props")){for(let l of Hh(s))Tn(l.kind==="prop"?t:n,l.name,l.kind==="prop"?{kind:"prop",publicPropName:l.publicPropName}:{kind:"local"});continue}for(let l of Q(s.id))Tn(r,l,i?.forceProp?{kind:"prop",publicPropName:l}:{kind:"local"})}}function Vt(e,...t){for(let n of t)for(let i of Q(n))Tn(e,i,{kind:"local"})}function el(e,t,n,i){switch(e.type){case"VariableDeclaration":Za(e,t,n,i);break;case"FunctionDeclaration":case"ClassDeclaration":Vt(t,e.id);break;case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExportAllDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":case"ExpressionStatement":case"ForInStatement":case"ForOfStatement":case"ForStatement":case"IfStatement":case"ImportDeclaration":case"LabeledStatement":case"ReturnStatement":case"StaticBlock":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"TSDeclareFunction":case"TSEnumDeclaration":case"TSExportAssignment":case"TSImportEqualsDeclaration":case"TSInterfaceDeclaration":case"TSModuleDeclaration":case"TSNamespaceExportDeclaration":case"TSTypeAliasDeclaration":case"WhileStatement":case"WithStatement":break}}function Uh(e,t){for(let{local:n,exported:i}of t){if(n.type!=="Identifier")continue;let r=i.type==="Identifier"?i.name:String(i.value);if(e.componentScope.get(n.name)?.kind==="prop")continue;e.componentScope.set(n.name,{kind:"prop",publicPropName:r})}}function qh(e,t){let n=e.componentScope;for(let i of t?.content.body??[])if(i.type==="ImportDeclaration")Vt(n,...i.specifiers.map((r)=>r.local));else if(i.type!=="ExportNamedDeclaration")el(i,n,n,{allowRunesProps:!0});else if(!i.declaration){if(i.source==null)Uh(e,i.specifiers)}else if(i.declaration.type==="VariableDeclaration")Za(i.declaration,n,n,{forceProp:!0});else if(i.declaration.type==="FunctionDeclaration"&&i.declaration.id?.name){let{name:r}=i.declaration.id;Tn(n,r,{kind:"prop",publicPropName:r})}}function tl(e){e.componentScope.clear(),e.activeScopes.length=0,qh(e,e.parsed?.instance)}function nl(e){return{varScopeStack:[e.componentScope]}}function il(e,t,n){if(!jt(n))return;let i=new Map,r=t.varScopeStack[t.varScopeStack.length-1]??e.componentScope;switch(n.type){case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":Vt(i,n.id,...n.params.map((s)=>s.type==="TSParameterProperty"?s.parameter:s));break;case"BlockStatement":for(let s of n.body)el(s,i,r);break;case"CatchClause":Vt(i,n.param);break;case"EachBlock":if(Vt(i,n.context),typeof n.index==="string")Tn(i,n.index,{kind:"local"});break;case"AwaitBlock":Vt(i,n.value,n.error);break}if(Qa(n))t.varScopeStack.push(i);return i}function rl(e,t){if(Qa(t))e.varScopeStack.pop()}function bn(e,t,n=!0){let i=ft(e,t);if(i||!n)return i;let r=yn(e,t,!0);if(!r)return null;let s=!xe(e,t)?.params?.length;return{type:r,...os(e,t),inferred:s}}var zh=/\bany\b/;function hs(e,t,n,i,r,s){if(r==="any"||!zh.test(r))return;D(e,"context-any-type",n,`Context "${t}" ${i} is inferred as "${r}"; annotate it to replace "any".`,P(e,s))}function Kh(e,t,n){if(!T(t))return null;let i=Bt(e,t.name);if(se(i))return ul(e,i,n).properties;let r=bn(e,t.name);return r?Ge(r.type):null}function Jh(e,t){return e.properties.some((n)=>n.type==="Property"&&n.kind==="get"&&X(n.key)===t)}function sl(e,t,n){if(!j(t)||!(n in t))return;let i=t[n];if(!i||typeof i!=="object"||!("typeAnnotation"in i))return;return ae(e,i.typeAnnotation)}function Xh(e){let t=e?.body.body;if(t?.length!==1||t[0].type!=="ReturnStatement")return;return t[0].argument??void 0}function Yh(e,t,n,i,r){let s=()=>(D(e,"context-any-type",n,`Context "${t}" property "${n}" has no type annotation; defaulted to "any".`,P(e,i)),{type:"any"});if(T(r))return bn(e,r.name)??s();if(r?.type==="ArrowFunctionExpression"||r?.type==="FunctionExpression")return{type:Ft(e,r),inferred:!0};if(Fe(r))return{type:ht(r)??"null"};if(r?.type==="MemberExpression"&&!r.computed&&T(r.object)&&T(r.property)){let p=bn(e,r.object.name)?.type,c=p&&as(p,r.property.name);if(c)return{type:c}}if(r===void 0)return{type:"any"};let l=r.type==="CallExpression"?gn(e,r):void 0;if(l)return{type:l,inferred:!0};let o=Ee(e,r),a=o.type??o.resolvedType;return a?{type:a,inferred:!0}:s()}function ul(e,t,n){let i=[],r=!1;for(let s of t.properties){if(s.type==="SpreadElement"){let h=Kh(e,s.argument,n);if(h)i.push(...h);else r=!0,D(e,"spread-unresolved",n,`Context "${n}" spreads a value sveld can't resolve; its shape is widened to "Record<string, any>".`,P(e,s));continue}if(s.type!=="Property")continue;let l=X(s.key);if(!l)continue;if(s.kind==="set"&&Jh(t,l))continue;let o=(s.kind==="get"||s.kind==="set")&&s.value.type==="FunctionExpression"?s.value:void 0,a=G(e,s),p=!o&&(s.value.type==="ArrowFunctionExpression"||s.value.type==="FunctionExpression")?s.value:void 0,c=!a?.type&&p?ds(a,p):void 0,u=o?s.kind==="get"?sl(e,o,"returnType"):sl(e,o.params[0],"typeAnnotation"):a?.type??c,f=u?{type:u,description:a?.description,inferred:c!==void 0&&!a?.params?.length}:Yh(e,n,l,s,s.kind==="get"?Xh(o):s.kind==="set"?void 0:s.value);if(f.inferred)hs(e,n,l,`property "${l}"`,f.type,s);i.push({name:l,type:f.type,description:f.description||a?.description||void 0,optional:!1,...f.internal?{internal:!0}:{}})}return{properties:i,hasUnresolvedSpread:r}}function ol(e,t,n){let{properties:i,hasUnresolvedSpread:r}=ul(e,t,n);return{key:n,typeName:ls(n),properties:i,description:void 0,...r?{hasUnresolvedSpread:r}:{}}}function al(e,t,n){if(se(t))return ol(e,t,n);let i=ls(n),r=(p)=>({key:n,typeName:i,type:p,properties:[]});if(t.type==="CallExpression"){let p=gn(e,t);if(p)hs(e,n,n,"value",p,t);return p?r(p):null}if(t.type==="Literal"&&t.value===null&&t.raw==="null")return r("null");if(T(t)&&t.name==="undefined")return r("undefined");if(!T(t))return null;let s=t.name,l=bn(e,s,!1),o=l?void 0:Bt(e,s);if(se(o)){let{internal:p}=os(e,s);return{...ol(e,o,n),...p?{internal:p}:{}}}let a=l??bn(e,s);if(a){if(a.inferred)hs(e,n,s,`variable "${s}"`,a.type,t);let p=Ge(a.type);return{key:n,typeName:i,...p?{}:{type:a.type},properties:p??[],description:a.description||void 0,...a.internal?{internal:!0}:{}}}return D(e,"context-any-type",s,`Context "${n}" variable "${s}" has no type annotation; defaulted to "any".`,P(e,t)),r("any")}function ll(e){let t=e.callee,n=t.type==="Identifier"&&t.name==="Symbol",i=t.type==="MemberExpression"&&!t.computed&&t.object.type==="Identifier"&&t.object.name==="Symbol"&&t.property.type==="Identifier"&&t.property.name==="for";if(!n&&!i)return null;let r=e.arguments[0];if(r?.type==="Literal"&&typeof r.value==="string")return r.value;if(r?.type==="TemplateLiteral"&&r.quasis.length===1)return r.quasis[0].value.cooked??"";return""}function pl(e){return{kind:"pending",importSource:e.source,importedName:e.importedName,...e.members?{members:e.members}:{}}}function dl(e,t,n=0){if(!t)return{kind:"unresolved"};if(t.type==="Literal"||t.type==="TemplateLiteral"){let i=ha(t);return i==null?{kind:"unresolved"}:{kind:"resolved",key:i}}if(t.type==="CallExpression"||t.type==="NewExpression"){let i=ll(t);return i==null?{kind:"unresolved"}:{kind:"resolved",key:i}}if(t.type==="Identifier"){if(n>=5)return{kind:"unresolved"};let i=Bt(e,t.name);if(i){if((i.type==="CallExpression"||i.type==="NewExpression")&&ll(i)==="")return{kind:"resolved",key:t.name};return dl(e,i,n+1)}let r=n===0&&mt(e,t.name)?void 0:e.valueImportBindingsByLocalName.get(t.name);return r?pl(r):{kind:"unresolved"}}if(t.type==="MemberExpression"){let i=n===0&&Si(e,t)?void 0:gi(e,t);if(i)return pl(i)}return{kind:"unresolved"}}function cl(e,t,n,i,r){let s=ae(e,i)??"";D(e,"context-value-unresolved",t,`setContext(${n}, ${s}): the value isn't an object literal or a variable, so sveld can't describe its shape; the context is skipped.`,r)}function fl(e,t,n){let i=t.arguments[0];if(!i)return;let r=dl(e,i);if(r.kind==="unresolved"||r.kind==="resolved"&&!r.key){let c=ae(e,i)??"";D(e,"context-key-unresolved",c,`setContext key \`${c}\` isn't a string literal, const-bound string, Symbol(), or imported \`export const\` string; the context is skipped.`,P(e,t));return}let s=t.arguments[1];if(!s)return;let l=P(e,t),o=G(e,n)?.internal===!0;if(r.kind==="pending"){let c=dn(r),u=al(e,s,c);if(u)e.pendingContextKeyCandidates.push({importSource:r.importSource,importedName:r.importedName,...r.members?{members:r.members}:{},...u.type===void 0?{}:{type:u.type},properties:u.properties,description:u.description,...u.hasUnresolvedSpread?{hasUnresolvedSpread:!0}:{},...u.internal||o?{internal:!0}:{},source:l});else cl(e,c,c,s,l);return}let a=r.key,p=al(e,s,a);if(!p){cl(e,a,JSON.stringify(a),s,l);return}if(e.contexts.has(a)){D(e,"context-duplicate-key",a,`setContext("${a}", ...) was called more than once; only the first call's shape is used.`,l);return}e.contexts.set(a,{...p,...o?{internal:!0}:{},source:l})}var Qh=/\n/g,Zh=/^[A-Za-z_$][\w$]*$/;function hl(e){return j(e)&&e.type==="ArrayExpression"&&Array.isArray(e.elements)}function ms(e,t){return{variableType:(n)=>{if(t?.has(n))return;return ft(e,n)?.type??yn(e,n)}}}function vn(e,t,n){if(!t||typeof t!=="object"||!("type"in t))return n;if(T(t)){if(!mt(e,t.name))return n;let r=n??new Set;return r.add(t.name),r}let i=n;if(se(t)){for(let r of t.properties)if(r.type==="Property")i=vn(e,r.value,i)}else if(hl(t))for(let r of t.elements)i=vn(e,r,i);return i}function ml(e,t){if(T(t))return e.variableType(t.name);return em(e,t)}function em(e,t){if(!t||typeof t!=="object"||!("type"in t))return;if(se(t))return tm(e,t);if(hl(t))return nm(e,t);return}function yl(e,t){return ml(e,t)??(Fe(t)?ht(t)??"null":"any")}function ys(e,t){if(Fe(t)&&t.raw==="null")return"null";let n=ml(e,t);if(n!==void 0)return n;let i=Fe(t)?t.value:void 0;return i==null?"":im(i)}function tm(e,t){if(t.properties.length===0)return"Record<string, never>";let n=[],i=!1;for(let r of t.properties){let s=r.type==="Property"&&!r.computed?X(r.key):void 0;if(r.type!=="Property"||!s){i=!0;continue}n.push({name:s,type:yl(e,r.value)})}if(!i)return Cn(n);if(n.length===0)return"Record<string, any>";return Cn([...n,{name:"[key: string]",type:"any"}])}function nm(e,t){let n=new Set(t.elements.filter((i)=>i!=null).map((i)=>yl(e,i)));if(n.size===0)return"any[]";if(n.size===1)return`${[...n][0]}[]`;return`(${[...n].join(" | ")})[]`}function gl(e,t){for(let[n,i]of e.arguments.entries()){if(T(i)&&i.name===t)return{argumentIndex:n};if(!se(i))continue;for(let r of i.properties){if(r.type!=="Property"||!T(r.value))continue;if(r.value.name!==t)continue;let s=!r.computed&&T(r.key)?r.key.name:void 0;return{argumentIndex:n,property:s??""}}}return}function im(e){return typeof e==="string"?JSON.stringify(e):String(e)}function Qe(e,{name:t,detail:n,has_argument:i,description:r,deprecated:s,tags:l,internal:o,source:a}){let p=!i&&!n?"null":n||void 0,c=e.events.get(t);if(c?.type==="forwarded")e.events.set(t,{type:"dispatched",name:t,detail:p,description:r||c.description,deprecated:s??c.deprecated,tags:l??c.tags,...o||c.internal?{internal:!0}:{},source:a||c.source});else if(c){let u=e.untypedJsDocEventNames.delete(t);e.events.set(t,{...c,detail:c.detail===void 0||u?p:c.detail,description:c.description||r,deprecated:c.deprecated??s,tags:c.tags??l,...c.internal||o?{internal:!0}:{},source:a||c.source})}else e.events.set(t,{type:"dispatched",name:t,detail:p,description:r,deprecated:s,tags:l,...o?{internal:!0}:{},source:a})}function xl(e,t){let n=t.arguments[0],i=jr(n,"CustomEvent");if(!i&&!jr(n,"Event"))return;let r=n.arguments[0],s=Fe(r)?r.value:void 0;if(s==null)return;let l=i?n.arguments[1]:void 0,o=!1,a;if(se(l)){let p=l.properties.find((c)=>c.type==="Property"&&T(c.key)&&c.key.name==="detail");if(p?.type==="Property")o=!0,a=p.value}return{name:String(s),detail:a,hasArgument:o,nestedBoundNames:vn(e,a),source:P(e,t)}}function El(e,t){Qe(e,{name:t.name,detail:ys(ms(e,t.nestedBoundNames),t.detail),has_argument:t.hasArgument,source:t.source})}function Cn(e,t=!1){if(e.length===0)return"null";let n=e.map(({name:i,type:r,description:s,optional:l,default:o})=>{let a=l?"?":"",p=Zh.test(i)||i.startsWith("[")?i:JSON.stringify(i),c=o?`@default ${o}`:"",u=Rt(s&&c?`${s} ${c}`:s||c);if(u){if(t)return`${u.includes(`
|
|
23
23
|
`)?`/**
|
|
24
24
|
${u.split(`
|
|
25
25
|
`).map((h)=>h?` * ${h}`:" *").join(`
|
|
26
26
|
`)}
|
|
27
27
|
*/`:`/** ${u} */`}
|
|
28
|
-
${p}${a}: ${r};`;return`/** ${u.replace(
|
|
28
|
+
${p}${a}: ${r};`;return`/** ${u.replace(Qh," ")} */ ${p}${a}: ${r};`}return`${p}${a}: ${r};`}).join(t?`
|
|
29
29
|
`:" ");return t?`{
|
|
30
30
|
${n}
|
|
31
|
-
}`:`{ ${n} }`}function Kh({hasTypeScriptType:e,hasJSDocType:t,inferredType:n,finalType:i}){if(e)return"typescript";if(t)return"jsdoc";if(n!==void 0)return"default";if(i!==void 0)return"inferred";return"unknown"}function Cn(e){let t=e.explicitType??e.jsdocType??e.resolvedType??e.typeSeed,n=e.jsdocParams??e.resolvedParams,i=e.jsdocReturnType??e.resolvedReturnType;if((e.isFunctionDeclaration||e.initializerIsFunction)&&t===e.typeSeed&&(i||e.isFunctionDeclaration&&n?.length))t=`${e.jsdocTypeParameters?`<${e.jsdocTypeParameters}>`:""}(${ye(n??[])}) => ${i??"any"}`;let s=e.jsdocDescription??e.resolvedDescription;if(s===void 0&&t!==void 0)s=e.typedefs?.get(t)?.description;let l=Kh({hasTypeScriptType:e.explicitType!==void 0,hasJSDocType:e.jsdocType!==void 0||e.jsdocParams!==void 0||e.jsdocReturnType!==void 0||e.resolvedType!==void 0,inferredType:e.inferredTypeForSource,finalType:t}),o=e.initializerIsFunction||e.isFunctionDeclaration||!!e.jsdocParams?.length||e.jsdocReturnType!==void 0||ii(e.jsdocType)||ii(e.resolvedType)||ii(e.explicitType),a=o?e.jsdocTypeParameters:void 0;return{type:t,typeSource:l,description:s,params:n,returnType:i,isFunction:o,typeParameters:a}}function An(e,t,n){if(n?.explicitDefault===void 0)return n;return e.explicitDefaultPropNames.add(t),{...n,description:n.descriptionWithoutDefault}}function Pn(e){return{binding:e?.binding,deprecated:e?.deprecated,tags:e?.tags,...e?.internal?{internal:!0}:{}}}function Si(e){if(e?.type==="Identifier")return e.name;return typeof e?.value==="string"?e.value:void 0}function hl(e,t){for(let n of e?.body??[]){let i=n.type==="ExportNamedDeclaration"&&n.declaration?n.declaration:n;if(i.type==="VariableDeclaration"){let r=i.declarations.find((s)=>s.id.type==="Identifier"?s.id.name===t:Y(s.id).has(t));if(r)return{declaration:i,declarator:r,statement:n}}else if((i.type==="FunctionDeclaration"||i.type==="ClassDeclaration")&&i.id?.name===t)return{declaration:i,statement:n}}return}function Jh(e,t){for(let n of e?.body??[]){if(n.type!=="LabeledStatement"||n.label.name!=="$")continue;if(n.body.type!=="ExpressionStatement")continue;let i=n.body.expression;if(i.type!=="AssignmentExpression"||i.operator!=="=")continue;if(i.left.type.startsWith("TS"))continue;if(!Y(i.left).has(t))continue;let r={type:"VariableDeclarator",id:i.left,init:i.right,start:i.start,end:i.end};return{declaration:{type:"VariableDeclaration",kind:"let",declarations:[r],start:n.start,end:n.end},declarator:r,statement:n}}return}function Xh(e){if(e==="var")return"let";if(e==="using"||e==="await using")return"const";return e}function hs(e,t,n,i,r){let s=Si(n.local),l=Si(n.exported);if(!s||!l)return;if(t.source!=null)return{localName:s,exportedName:l};let o=hl(i,s);if(!o&&r==="instance")o=hl(e.parsed?.module?.content,s)??Jh(i,s);return{localName:s,exportedName:l,...o}}function ms(e,t,n,i){let r=t.source?.value,s=typeof r==="string"?`it re-exports from "${r}"`:e.valueImportBindingsByLocalName.has(n)?"it re-exports an imported binding":"no matching local declaration was found";D(e,"export-unresolved",i,`export "${i}" was skipped because ${s}; sveld only resolves exports of a local declaration.`,w(e,t))}function wn(e,t,n){if(!n)return j(e,t);let i=t.specifiers.length===1?j(e,t):void 0,r=j(e,n.statement);if(!i||!r)return i??r;let s=Object.fromEntries(Object.entries(i).filter(([,l])=>l!==void 0));return{...r,...s,internal:i.internal||r.internal}}function ys(e,t,n,i){let r=[];if(t.type==="FunctionDeclaration"){if(!t.id)return r;let o=e.scriptLanguage==="ts"?Mt(e,t,xn(t)):void 0;return r.push({prop_name:n?.exportedName??t.id.name,kind:"function",isFunctionDeclaration:!0,value:void 0,typeSeed:o?.hasAnnotations?void 0:Bt(e,t),explicitType:o?.hasAnnotations?o.signature:void 0,initializerIsFunction:!0,isRequired:!1,localName:t.id.name,defaultValue:void 0,inferredTypeForSource:void 0,resolvedJSDoc:void 0}),r}if(t.type!=="VariableDeclaration")return r;let s=Xh(t.kind),l=n?.declarator?[n.declarator]:t.declarations;for(let{id:o,init:a}of l){if(o.type!=="Identifier"){for(let v of Y(o)){if(n&&n.localName!==v)continue;r.push({prop_name:n?.exportedName??v,kind:s,isFunctionDeclaration:!1,value:void 0,typeSeed:void 0,explicitType:void 0,initializerIsFunction:!1,isRequired:!1,localName:v,defaultValue:void 0,inferredTypeForSource:void 0,resolvedJSDoc:void 0})}continue}let p=o.name,c=n?.exportedName??p,u=a==null?{isFunction:!1}:xe(e,a),{value:f,isFunction:h,defaultValue:m}=u,g=s==="const"&&(a?.type==="ObjectExpression"||a?.type==="ArrayExpression")&&!e.typeCasts.constAssertions.has(a),E=(s==="const"&&(a?.type==="ArrowFunctionExpression"||a?.type==="FunctionExpression")?Bt(e,a):void 0)??(g?Se(a,"literal"):void 0)??u.type;yi(e,u,c,i),r.push({prop_name:c,kind:s,isFunctionDeclaration:!1,value:f,typeSeed:E,explicitType:Yh(e,o),initializerIsFunction:h,isRequired:s==="let"&&a==null,localName:p,defaultValue:m,inferredTypeForSource:E,resolvedJSDoc:u})}return r}function Yh(e,t){return O(e,t.typeAnnotation?.typeAnnotation),ae(e,t.typeAnnotation)}function gs(e,t,n){let{resolvedJSDoc:i}=t;return Cn({explicitType:t.explicitType,typeSeed:t.typeSeed,inferredTypeForSource:t.inferredTypeForSource,jsdocType:n?.type,jsdocDescription:n?.description,jsdocParams:n?.params,jsdocReturnType:n?.returnType,jsdocTypeParameters:n?.typeParameters,resolvedType:i?.resolvedType,resolvedDescription:i?.resolvedDescription,resolvedParams:i?.resolvedParams,resolvedReturnType:i?.resolvedReturnType,initializerIsFunction:t.initializerIsFunction,isFunctionDeclaration:t.isFunctionDeclaration,typedefs:e.typedefs})}function Qh(e,t,n){D(e,"export-unresolved",n,`export "${n}" was skipped because a class can't be a prop; export it from the module script instead.`,w(e,t))}function ml(e,t,n,i){if(n.type==="ClassDeclaration"){if(n.id)Qh(e,t,i?.exportedName??n.id.name);return}let r=ys(e,n,i,"props");if(r.length===0)return;let s=wn(e,t,i);for(let l of r){let{prop_name:o,kind:a,localName:p}=l,c=An(e,o,s),{type:u,typeSource:f,description:h,params:m,returnType:g,isFunction:y,typeParameters:E}=gs(e,l,c);nn(e,o,s?.sveldIgnore),fn(e,o,{name:o,...p!==void 0&&p!==o?{localName:p}:{},kind:a,description:h,...Pn(s),type:u,typeSource:f,value:c?.explicitDefault??l.value,defaultValue:l.defaultValue,params:m,returnType:g,typeParameters:E,isFunction:y,isFunctionDeclaration:l.isFunctionDeclaration,isRequired:l.isRequired,constant:a==="const",reactive:e.reactive_vars.has(o),source:w(e,t)})}}function yl(e,t,n){if(t.declaration!=null){ml(e,t,t.declaration);return}for(let i of t.specifiers){let r=hs(e,t,i,n,"instance");if(!r)continue;if(r.declaration)ml(e,t,r.declaration,r);else ms(e,t,r.localName,r.exportedName)}}function Zh(e){if(!e||typeof e!=="object"||!("type"in e))return;let t=String(e.type),n=$t(t);if(!n&&!ct(t))return;let i="name"in e&&typeof e.name==="string"?e.name:void 0;if(!i)return;if(n)return{type:"InlineComponent",name:i};let r={type:"Element",name:i};if(i==="svelte:element"&&"tag"in e&&e.tag&&typeof e.tag==="object"){let s=e.tag;if(s.type==="Literal"&&typeof s.value==="string")r.thisValue=s.value}return r}function xl(e,t,n){let i=Zh(t);if(!i)return;if(e.rest_props!==void 0&&!(e.rest_props.type==="InlineComponent"&&i.type==="Element"))return;e.rest_props=i;let r=t&&typeof t==="object"&&"tag"in t?t.tag:void 0;e.restPropsTagLocal=i.name==="svelte:element"&&T(r)?r.name:void 0,e.restPropsSource=w(e,n)}function gl(e,t){let n=Dt(t);if(me(n,"$derived"))n=Dt(n.arguments[0]);if(!re(n))return;for(let i of n.properties){if(i.type!=="SpreadElement"||!T(i.argument))continue;let{name:r}=i.argument;if(r==="$$restProps"||e.restPropLocals.has(r))return r}return}function Sl(e,t){let n=new Map;for(let i of t?.content.body??[]){if(i.type==="VariableDeclaration"){for(let{id:l,init:o}of i.declarations){let a=T(l)?gl(e,o):void 0;if(a&&T(l))n.set(l.name,a)}continue}if(i.type!=="LabeledStatement"||i.label.name!=="$")continue;if(i.body.type!=="ExpressionStatement")continue;let r=i.body.expression;if(r.type!=="AssignmentExpression"||r.operator!=="="||!T(r.left))continue;let s=gl(e,r.right);if(s)n.set(r.left.name,s)}return n}var em=/^[A-Za-z_$][\w$]*/,tm=/[A-Za-z_$][\w$]*/g,nm=/^(?:(?:const|in|out)\s+)+/;function El(e){let t=F(e,",").map((i)=>i.trim()).filter((i)=>i.length>0);if(t.length===0)return null;return[t.map((i)=>i.replace(nm,"").match(em)?.[0]??i).join(", "),t.join(", ")]}function Tl(e,t,n){let i=e.scriptGenericsAttribute?.value;if(!i)return;for(let[r]of i.matchAll(tm)){if(e.typeImportBindingsByLocalName.has(r))t.add(r);if(n.has(r))continue;let s=e.localTypeDeclarationsByName.get(r);if(!s)continue;n.add(r),Ve(e,s.node,t,n)}}function Ei(e,t,n){if(e.generics)e.generics=[`${e.generics[0]}, ${t}`,`${e.generics[1]}, ${n}`];else e.generics=[t,n]}function vl(e){if(!Array.isArray(e.value))return;return e.value.map((t)=>t.type==="Text"?t.data:"").join("").trim()}function bl(e){let t=[e.instance,e.module].filter((i)=>i!==void 0),n=!1;for(let i of t){let r=i.attributes.find((s)=>s.name==="lang");if(!r){n=!0;continue}if(vl(r)?.toLowerCase()==="ts")return"ts"}return n?"js":void 0}function Cl(e,t){let n=t.instance?.attributes.find((s)=>s.name==="generics");if(!n)return;let i=w(e,n),r=vl(n);if(!r)return;return{value:r,source:i}}var Al=/[A-Za-z_$][\w$]*/y,im=/[\w$]/,rm=/^\s*\??\s*:/,sm=/(?:^|[{;,(\n]|\breadonly)\s*$/,om=/^\s*\[/,am=/\b(?:keyof|readonly|unique)\s+$/,lm=/&\s*$/,pm=/^\s*&/,cm=/(?:\||\bextends)\s*$/,um=/^\s*(?:\||extends\b)/,dm=/^(?:keyof|readonly|unique|typeof|infer)\s/,fm=/^(?:abstract\s+)?new\b/;function hm(e){let t=e.trim();if(It(t)!==-1||en(t,"?")!==-1||fm.test(t))return 4;if(F(t,"|").length>1)return 3;if(F(t,"&").length>1)return 2;return dm.test(t)?1:0}function mm(e,t){if(om.test(t))return 0;if(am.test(e))return 1;if(lm.test(e)||pm.test(t))return 2;if(cm.test(e)||um.test(t))return 3;return 4}function ym(e,t){for(let n=t+1;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===e[t])return n+1;return e.length}function gm(e,t){for(let n=t;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]==="`")return{end:n+1,opensExpression:!1};else if(e[n]==="$"&&e[n+1]==="{")return{end:n+2,opensExpression:!0};return{end:e.length,opensExpression:!1}}function xm(e,t){if(t.size===0)return e;let n="",i=[],r=0;while(r<e.length){let s=e[r],l=i.length-1;if(s==='"'||s==="'"){let f=ym(e,r);n+=e.slice(r,f),r=f;continue}if(s==="`"||s==="}"&&i[l]===0){if(s==="}")i.pop();let{end:f,opensExpression:h}=gm(e,r+1);if(h)i.push(0);n+=e.slice(r,f),r=f;continue}if(l>=0&&s==="{")i[l]++;if(l>=0&&s==="}")i[l]--;Al.lastIndex=r;let o=im.test(e[r-1]??"")?void 0:Al.exec(e)?.[0];if(!o){n+=s,r++;continue}r+=o.length;let a=t.get(o),p=e.slice(0,r-o.length),c=e.slice(r),u=p.trimEnd();if(a===void 0||u.endsWith(".")&&!u.endsWith("...")||sm.test(p)&&rm.test(c))n+=o;else n+=hm(a)>mm(p,c)?`(${a})`:a}return n}function Sm(e,t,n){let i=new Map,r=t.type==="TSInterfaceDeclaration"||t.type==="TSTypeAliasDeclaration"?t.typeParameters?.params:void 0,s=n.typeArguments?.params;if(!r?.length||!s?.length)return i;for(let l=0;l<r.length;l++){let o=r[l]?.name,a=s[l];if(!o||a?.start===void 0||a?.end===void 0)continue;let p=G(e,a.start,a.end)?.trim();if(p)i.set(o,p)}return i}function Ti(e,t,n,i=new Set){let r=new Map;if(!t?.type)return r;let s=(o)=>{for(let a of o){if(a?.type!=="TSPropertySignature"||a.computed||!a.key)continue;let p=J(a.key);if(!p)continue;let c=a.typeAnnotation?.start,u=a.typeAnnotation?.end;if(c===void 0||u===void 0)continue;let f=G(e,c+1,u)?.trim();if(!f)continue;O(e,a.typeAnnotation?.typeAnnotation);let h=j(e,a);r.set(p,{type:f,optional:a.optional===!0,source:w(e,a),...h?{jsdoc:h}:{}})}},l=(o)=>{let a=Ti(e,o,n,i);for(let[p,c]of a)r.set(p,c)};switch(t.type){case"TSTypeLiteral":s(t.members??[]);break;case"TSInterfaceDeclaration":for(let o of t.extends??[]){let a={type:"TSTypeReference",typeName:o.expression,typeArguments:o.typeParameters,start:o.start,end:o.end};l(a)}s(t.body?.body??[]);break;case"TSTypeAliasDeclaration":case"TSParenthesizedType":l(t.typeAnnotation);break;case"TSTypeReference":{let o=wa(t.typeName);if(!o||i.has(o))break;let a=n.get(o);if(!a)break;i.add(o);let p=Ti(e,a,n,i);i.delete(o);let c=Sm(e,a,t);for(let[u,f]of p)r.set(u,c.size===0?f:{...f,type:xm(f.type,c)});break}case"TSIntersectionType":for(let o of t.types??[])l(o);break}return r}function Pl(e){return new Map(Array.from(e.localTypeDeclarationsByName,([t,n])=>[t,n.node]))}function Em(e){let t={};for(let[n,i]of Object.entries(e))t[n]={...i.attribute===void 0?{}:{attribute:i.attribute},...i.reflect===void 0?{}:{reflect:i.reflect},...i.type===void 0?{}:{type:i.type}};return t}function xs(e,t,n){if(t.type==="ImportDeclaration"&&t.source?.value)for(let i of t.specifiers){let r=i.type==="ImportSpecifier";if(t.importKind!=="type"&&!(r&&i.importKind==="type"))continue;let s=i.local.name;e.typeImportBindingsByLocalName.set(s,{importedName:r?fi(i):void 0,localName:s,source:String(t.source.value),specifierType:r?"named":i.type==="ImportDefaultSpecifier"?"default":"namespace"})}if(t.type==="TSEnumDeclaration"||t.type==="TSInterfaceDeclaration"||t.type==="TSTypeAliasDeclaration"){let i=t.type==="TSEnumDeclaration"?Na(e,t):G(e,t.start,t.end)?.trim();e.localTypeDeclarationsByName.set(t.id.name,{code:i??"",node:t,start:t.start,...n?{exported:n}:{}})}}function wl(e,t){if(e.runesPropsDeclarationMetadataByDeclaratorStart.clear(),e.explicitVariableTypesByName.clear(),e.explicitVariableTypeNodesByName.clear(),e.typeImportBindingsByLocalName.clear(),e.localTypeDeclarationsByName.clear(),e.additionalTypeDependencyNodes.length=0,e.typedRunesPropsDeclarations.length=0,!e.source)return;e.scriptLanguage=bl(t);let n=t.options?.customElement;e.customElementTag=n?.tag,e.customElement=n?{...n.tag===void 0?{}:{tag:n.tag},...n.shadow==="open"||n.shadow==="none"?{shadow:n.shadow}:{},...n.props?{props:Em(n.props)}:{},...n.extend===void 0?{}:{extend:!0}}:void 0,e.runesOptionOverride=t.options?.runes,e.scriptGenericsAttribute=Cl(e,t);let i=new Set;for(let s of t.module?.content.body??[]){if(!s?.type)continue;if(s.type==="ExportNamedDeclaration"&&s.declaration)xs(e,s.declaration,!0);else if(s.type==="ExportNamedDeclaration"&&!s.source)for(let l of s.specifiers){if(l.local.type!=="Identifier"||l.exported.type!=="Identifier")continue;if(l.local.name===l.exported.name)i.add(l.local.name)}else xs(e,s,!1)}for(let s of i){let l=e.localTypeDeclarationsByName.get(s);if(l)l.exported=!0}let r=t.instance?.content.body??[];for(let s of r){if(xs(e,s,!1),s.type!=="VariableDeclaration")continue;for(let{id:l}of s.declarations){if(l.type!=="Identifier")continue;let o=ae(e,l.typeAnnotation);if(!o)continue;let a=l.typeAnnotation?.typeAnnotation;if(e.explicitVariableTypesByName.set(l.name,o),a)e.explicitVariableTypeNodesByName.set(l.name,a)}}for(let s of r){if(s.type!=="VariableDeclaration")continue;for(let l of s.declarations){if(!me(Dt(l.init),"$props"))continue;let o="typeAnnotation"in l.id?l.id.typeAnnotation:void 0,a=o?void 0:ca(l.init),p=o?.typeAnnotation??a,c=o?ae(e,o):ut(e,a),u=Ti(e,p,Pl(e)),f=new Set,h=new Set;Ve(e,p,f,h),Tl(e,f,h);let m={canonicalType:c,props:u,referencedImportedTypes:f,referencedLocalTypes:h};if(e.runesPropsDeclarationMetadataByDeclaratorStart.set(l.start,m),c)e.typedRunesPropsDeclarations.push(m)}}}function Tm(e,t){let n=t?.trim();if(!n)return;let i=e.typedefMembersByName.get(n)??je(n,{skipIndexSignatures:!0});return i?new Map(i.map((r)=>[r.name,r])):void 0}function vm(e){return me(e,"$bindable")?{init:e.arguments[0],bindable:!0}:{init:e,bindable:!1}}function kl(e,t){for(let n of t.declarations){if(!me(n.init,"$props"))continue;let i=e.runesPropsDeclarationMetadataByDeclaratorStart.get(n.start),r=j(e,t),s=i?.props.size?void 0:Tm(e,r?.type);if(n.id.type==="Identifier"){e.wholePropsLocals.add(n.id.name),e.restPropLocals.add(n.id.name);let o=[...Array.from(s?.values()??[],(a)=>({name:a.name,member:a,typeMetadata:void 0})),...Array.from(i?.props??[],([a,p])=>({name:a,member:void 0,typeMetadata:p}))];for(let{name:a,member:p,typeMetadata:c}of o){let u=An(e,a,c?.jsdoc),{type:f,typeSource:h,description:m,params:g,returnType:y,isFunction:E}=Cn({explicitType:c?.type,jsdocType:u?.type??p?.type,jsdocDescription:u?.description??p?.description,jsdocParams:u?.params,jsdocReturnType:u?.returnType,initializerIsFunction:!1,isFunctionDeclaration:!1,typedefs:e.typedefs});nn(e,a,u?.sveldIgnore),fn(e,a,{name:a,kind:"let",description:m,...Pn(u),type:f,typeSource:h,value:u?.explicitDefault,params:g,returnType:y,isFunction:E,isFunctionDeclaration:!1,isRequired:!(c?.optional??p?.optional),constant:!1,reactive:!1,source:c?.source})}continue}if(n.id.type!=="ObjectPattern")continue;let l=n.id.properties.filter((o)=>{if(o.type!=="Property"||o.computed)return!1;if(!J(o.key))return!1;if(o.value.type==="Identifier")return!0;return o.value.type==="AssignmentPattern"&&o.value.left.type==="Identifier"}).length;for(let o of n.id.properties){if(o.type==="RestElement"){if(o.argument.type==="Identifier")e.restPropLocals.add(o.argument.name);continue}let a=J(o.key);if(!a)continue;let p,c;if(o.value.type==="Identifier")p=o.value.name;else{let Re=o.value;p=Re.left.name,c=Re.right}if(!p)continue;if(ri(e,a,p),a==="children")e.snippetPropLocals.add(p);let u=s?.get(a),f=i?.props.get(a),h=An(e,a,j(e,o)??f?.jsdoc??(l===1&&!s?r:void 0)),{init:m,bindable:g}=vm(c),y=m==null?{isFunction:!1}:xe(e,m),{value:E,type:v,isFunction:M,defaultValue:b}=y,X=f?.type===void 0&&h?.type===void 0?y.resolvedType:void 0;yi(e,y,a,"props");let{type:he,typeSource:Ie,description:At,params:Le,returnType:Pt,isFunction:C}=Cn({explicitType:f?.type,typeSeed:v,inferredTypeForSource:v,jsdocType:h?.type??u?.type,jsdocDescription:h?.description??u?.description,jsdocParams:h?.params,jsdocReturnType:h?.returnType,resolvedType:X,resolvedDescription:y.resolvedDescription,resolvedParams:y.resolvedParams,resolvedReturnType:y.resolvedReturnType,initializerIsFunction:M,isFunctionDeclaration:!1,typedefs:e.typedefs});if(g)e.reactive_vars.add(a);nn(e,a,h?.sveldIgnore),fn(e,a,{name:a,...p===a?{}:{localName:p},kind:"let",description:At,...Pn(h),...g?{bindable:!0}:{},type:he,typeSource:Ie,value:h?.explicitDefault??E,defaultValue:b,params:Le,returnType:Pt,isFunction:C,isFunctionDeclaration:!1,isRequired:!g&&m==null&&f?.optional!==!0&&u?.optional!==!0,constant:!1,reactive:g,source:w(e,o)})}}}function bm(e){let n=e.indexOf("EventDispatcher");if(n===-1)return;let i=n+15;while(e[i]===" ")i++;if(e[i]!=="<")return;let r=Ke(e,i);return r===-1?void 0:e.slice(i+1,r)}var Cm=/^["']|["']$/g,Am=/\?$/,Pm=/^\{/,wm=/\}$/;function km(e){let t=en(e,":");if(t===-1)return;let n=e.slice(0,t).trim().replace(Am,"").replace(Cm,""),i=e.slice(t+1).trim();if(!n||!i)return;return{name:n,type:i}}function _l(e,t,n,i){if(t){for(let[o,a]of Ti(e,t,Pl(e)))e.typedDispatcherEventNames.add(o),Qe(e,{name:o,detail:a.type,has_argument:!0,source:a.source});return}let r=ge(e,n)?.type,s=r?bm(r):void 0;if(!s)return;let l=s.trim().replace(Pm,"").replace(wm,"");for(let o of F(l,";,")){let a=km(o.trim());if(!a)continue;e.typedDispatcherEventNames.add(a.name),Qe(e,{name:a.name,detail:a.type,has_argument:!0,source:i})}}function Nl(e,t){if(e.syntaxMode!=="runes")return;for(let[n,i]of Array.from(e.events.entries())){if(i.type!=="dispatched")continue;if(t.has(n)||e.forwardedEvents.has(n))continue;let r=`on${n}`,s=e.props.get(r);if(!s)continue;let l=s.type!==void 0||s.params!==void 0||s.returnType!==void 0,o=i.detail===void 0||i.detail==="undefined"||i.detail==="null"?"() => void":`(detail: ${i.detail}) => void`;e.props.set(r,{...s,description:s.description??i.description,type:l?s.type:o,typeSource:l?s.typeSource:"inferred",isFunction:!0}),e.events.delete(n)}}var Ze=null;function et(e){return!e||e==="default"?Ze:e}function Ss(e,t){switch(t.type){case"Identifier":return{value:t.name,replace:!0};case"Literal":return{value:typeof t.value==="string"?JSON.stringify(t.value):String(t.value),replace:!1};case"MemberExpression":return{value:Ra(e,t),replace:!1};case"ObjectExpression":case"TemplateLiteral":return{value:G(e,t.start,t.end),replace:!1};default:return{value:void 0,replace:!1}}}function _m(e,t,n){if(!T(t))return null;let i=Ot(e,t.name);if(re(i))return Ts(e,i,n).slot_props;let r=dt(e,t.name);if(!r)return null;let s=je(r.type);if(!s)return null;let l={};for(let o of s)l[o.name]={value:o.type,replace:!1};return l}function Es(e,t,n,i,r){let s=_m(e,n,r);if(s)return Object.assign(t,s),!0;if(r)return!1;return D(e,"spread-unresolved","slot_props",`Slot props spread a value sveld can't resolve; its shape is widened to "Record<string, any>".`,w(e,i)),!1}function Ts(e,t,n){let i={},r=!1;for(let s of t.properties){if(s.type==="SpreadElement"){if(!Es(e,i,s.argument,s,n))r=!0;continue}if(s.type!=="Property"||s.computed)continue;let l=J(s.key);if(!l)continue;i[l]=Ss(e,s.value)}return{slot_props:i,hasUnresolvedSpread:r}}function Nm(e,t){if(t.type==="Identifier"){let r=e.propLocalToPublicName.get(t.name);return r?{publicName:r,trackingName:t.name}:null}if(t.type!=="MemberExpression")return null;if(t.object.type!=="Identifier"||!e.wholePropsLocals.has(t.object.name))return null;let{property:n}=t,i;if(!t.computed&&n.type==="Identifier")i=n.name;else if(n.type==="Literal"&&n.value!=null)i=String(n.value);return i?{publicName:i,trackingName:i}:null}function vs(e){return e.type==="ChainExpression"?e.expression:e}function Dl(e,t){let n=vs(t),i=Nm(e,n.callee);return i&&{...i,arguments:n.arguments}}function kn(e,{slot_name:t,slot_props:n,slot_props_unresolved_spread:i,slot_fallback:r,slot_description:s,slot_deprecated:l,slot_tags:o,slot_internal:a,source:p}){let c=et(t),u=e.slots.get(c);e.slots.set(c,{name:c,default:u?.default??c===Ze,fallback:r||void 0,slot_props:u?.slot_props??(n===""?void 0:n),slot_props_unresolved_spread:u?.slot_props_unresolved_spread||i,description:u?.description||s?.trim()||void 0,deprecated:u?.deprecated??l,tags:u?.tags||o,...u?.internal||a?{internal:!0}:{},source:p||u?.source})}var $l=/^@component/,Dm=/\r/g,$m=new Set(["AssignmentExpression","UpdateExpression","CallExpression","SpreadAttribute","FunctionDeclaration","ImportDeclaration","VariableDeclaration","ExportNamedDeclaration","Comment","SlotElement","RenderTag","OnDirective","BindDirective"]);function Il(e){return e&&"id"in e&&e.id&&"name"in e.id?e.id.name:void 0}function Im(e,t,n,i){let r=n.callee.type==="Identifier"?n.callee.name:void 0;if(r==="createEventDispatcher"){let s=Il(i);if(s!==void 0)t.dispatcherName=s,t.dispatcherDeclaratorNode=i;t.dispatcherTypeArgument=n.typeArguments?.params?.[0]}if(r==="$host"){let s=Il(i);if(s!==void 0)t.hostLocalNames.add(s)}if(r==="setContext")ll(e,n,i?.type==="ExpressionStatement"?i:null);if(n.arguments.length>0){if(t.callsWithArguments.push(n),xi(e,n.callee))t.locallyBoundCalls.add(n)}if(r)t.callees.push({name:r,arguments:n.arguments,node:n,nestedBoundDetailNames:vn(e,n.arguments[1])});if(ze(n.callee)&&T(n.callee.property)&&n.callee.property.name==="dispatchEvent"&&(me(n.callee.object,"$host")||T(n.callee.object)&&t.hostLocalNames.has(n.callee.object.name))){let s=dl(e,n);if(s)t.hostDispatchedEventNames.add(s.name),t.hostDispatches.push(s)}}function Lm(e,t){let n=Array.isArray(t)?t[0]:t;if(n?.type==="Text")return{value:JSON.stringify(n.raw),replace:!1};if(n?.type==="ExpressionTag")return Ss(e,n.expression);return{value:void 0,replace:!1}}function Rm(e,t){let n=t.attributes.find((p)=>("name"in p)&&p.name==="name"),i=n&&"value"in n?n.value:void 0,r=Array.isArray(i)?i[0]:void 0,s=r?.type==="Text"?r.data:void 0,l={},o=!1;for(let p of t.attributes){if(p.type==="SpreadAttribute"){let c=e.jsDocSlots.has(et(s));if(!Es(e,l,p.expression,p,c))o=!0;continue}if(!("value"in p)||p.name==="name"||p.value===!0)continue;l[p.name]=Lm(e,p.value)}let a=t.fragment.nodes.map(({start:p,end:c})=>G(e,p,c)??"").join("").trim();e.renderedSlots.add(et(s)),kn(e,{slot_name:s,slot_props:l,slot_props_unresolved_spread:o||void 0,slot_fallback:a,source:w(e,t)})}function Mm(e,t){let n=Dl(e,t.expression);if(!n){let{callee:a}=vs(t.expression);if(ze(a)&&T(a.object)&&e.wholePropsLocals.has(a.object.name))e.slotsUntracked=!0;return}let i=n.publicName==="children"?void 0:n.publicName,[r,...s]=n.arguments,l,o=!1;if(r===void 0)l={};else if(s.length===0&&r.type==="ObjectExpression"){let a=Ts(e,r,e.jsDocSlots.has(et(i)));l=a.slot_props,o=a.hasUnresolvedSpread}if(e.renderedSlots.add(et(i)),l!==void 0)kn(e,{slot_name:i,slot_props:l,slot_props_unresolved_spread:o||void 0,source:w(e,t)});if(l!==void 0||e.slots.has(i??Ze))e.snippetPropLocals.add(n.trackingName)}function Om(e,t,n){let i=t.name;if(t.expression!=null||!i)return;if(n==null||!("name"in n)||typeof n.name!=="string"||!n.name)return;let r=$t(n.type)?{type:"InlineComponent",name:n.name}:{type:"Element",name:n.name};e.forwardedEvents.set(i,r);let s=e.events.get(i),l=e.eventDescriptions.get(i);if(!s)e.events.set(i,{type:"forwarded",name:i,element:r,description:l,deprecated:void 0,source:w(e,t)});else if(s.type==="forwarded"&&l&&!s.description)e.events.set(i,{...s,description:l,source:s.source||w(e,t)})}function Bm(e){let{expression:t}=e;if(t.type==="Identifier")return{name:t.name,indexed:!1};if(t.type!=="MemberExpression")return;let n=t;while(n.type==="MemberExpression")n=n.object;if(n.type!=="Identifier")return;let i=e.name==="this"&&t.computed&&t.object.type==="Identifier";return{name:n.name,indexed:i}}function Fm(e,t,n,i){if(!n||!(ct(n.type)||$t(n.type)))return;let r=Bm(t);if(!r)return;let s=gi(e,r.name);if(!s)return;e.reactive_vars.add(s);let l=t.expression.type==="MemberExpression";if(t.name!=="this"||l&&!r.indexed)return;if(!("name"in n)||typeof n.name!=="string")return;let o=r.indexed?"indexed":"direct",a=e.bindings.get(s)??{elements:[],components:[],target:o};if(a.target!==o)a.target="mixed";if(ct(n.type)){let p=n.name,c="tag"in n&&T(n.tag)?n.tag.name:void 0;if(!a.elements.some((f)=>f.tag===p&&f.namespace===i&&f.tagLocal===c))a.elements.push({tag:p,namespace:i,...c?{tagLocal:c}:{}})}else{let p=n.type==="Component"?dn(e,n.name):void 0;if(!p)return;if(!a.components.includes(n.name))a.components.push(n.name);e.additionalImportedTypes.set(n.name,{localName:n.name,...p})}e.bindings.set(s,a)}function Ll(e){let t={dispatcherName:void 0,dispatcherDeclaratorNode:void 0,dispatcherTypeArgument:void 0,hostLocalNames:new Set,hostDispatchedEventNames:new Set,hostDispatches:[],callees:[],callsWithArguments:[],locallyBoundCalls:new Set};Xa(e),e.activeScopes.push(e.componentScope);let n=Ya(e),i=new WeakMap,r=e.parsed?.options?.namespace,s=[r==="svg"||r==="mathml"?r:"html"],l=new Map,o={enter(a,p){if(mi(a.type))return ie;let c=Qa(e,n,a);if(c)e.activeScopes.push(c);if(ct(a.type)){let u="name"in a?a.name:void 0,f=u==="svg"?"svg":u==="math"?"mathml":s[s.length-1];i.set(a,f),s.push(u==="foreignObject"?"html":f)}if(!$m.has(a.type))return;switch(a.type){case"AssignmentExpression":cs(e,a.left);break;case"UpdateExpression":cs(e,a.argument);break;case"CallExpression":Im(e,t,a,p);break;case"SpreadAttribute":{let u=a.expression.type==="Identifier"?a.expression.name:void 0,f=(u!==void 0&&!mt(e,u)?l.get(u):void 0)??u,h=e.restPropLocals.has(f??"");if(f==="$$restProps"||h)xl(e,p,a);if((f==="$$props"||h)&&p&&$t(p.type))e.slotsUntracked=!0;break}case"FunctionDeclaration":if(a.id?.name)e.funcDecls.set(a.id.name,a);break;case"ImportDeclaration":cn(e,a);break;case"VariableDeclaration":if(e.vars.add(a),p?.type==="Program"&&a.declarations.some((u)=>me(u.init,"$props")))kl(e,a);break;case"ExportNamedDeclaration":yl(e,a,p?.type==="Program"?p:null);break;case"Comment":{let u=a.data.trim();if($l.test(u))e.componentComment=u.replace($l,"").replace(Dm,""),e.componentCommentSource=w(e,a);break}case"SlotElement":Rm(e,a);break;case"RenderTag":Mm(e,a);break;case"OnDirective":Om(e,a,p);break;case"BindDirective":Fm(e,a,p,(p&&i.get(p))??"html");break}},leave(a){if(ct(a.type))s.pop();if(Vt(a))e.activeScopes.pop(),Za(n,a)}};if(e.parsed?.instance)z(e.parsed.instance,o);if(l=Sl(e,e.parsed?.instance),e.parsed?.fragment)z(e.parsed.fragment,o);return t}var bs={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Cs="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",Vm={5:Cs,"5module":Cs+" export import",6:Cs+" const class extends export import super"},Fl=/^in(stanceof)?$/,jm=/\p{ID_Start}/u,Gm=/[\p{ID_Continue}\u200c\u200d]/u;function Te(e,t){if(e<65)return e===36;if(e<91)return!0;if(e<97)return e===95;if(e<123)return!0;if(e>65535&&t===!1)return!1;return e>=170&&jm.test(String.fromCodePoint(e))}function _e(e,t){if(e<48)return e===36;if(e<58)return!0;if(e<65)return!1;if(e<91)return!0;if(e<97)return e===95;if(e<123)return!0;if(e>65535&&t===!1)return!1;return e>=170&&Gm.test(String.fromCodePoint(e))}var I=function(e,t){if(t===void 0)t={};this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function le(e,t){return new I(e,{beforeExpr:!0,binop:t})}var pe={beforeExpr:!0},Q={startsExpr:!0},ks={};function N(e,t){if(t===void 0)t={};return t.keyword=e,ks[e]=new I(e,t)}var d={num:new I("num",Q),regexp:new I("regexp",Q),string:new I("string",Q),name:new I("name",Q),privateId:new I("privateId",Q),eof:new I("eof"),bracketL:new I("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new I("]"),braceL:new I("{",{beforeExpr:!0,startsExpr:!0}),braceR:new I("}"),parenL:new I("(",{beforeExpr:!0,startsExpr:!0}),parenR:new I(")"),comma:new I(",",pe),semi:new I(";",pe),colon:new I(":",pe),dot:new I("."),question:new I("?",pe),questionDot:new I("?."),arrow:new I("=>",pe),template:new I("template"),invalidTemplate:new I("invalidTemplate"),ellipsis:new I("...",pe),backQuote:new I("`",Q),dollarBraceL:new I("${",{beforeExpr:!0,startsExpr:!0}),eq:new I("=",{beforeExpr:!0,isAssign:!0}),assign:new I("_=",{beforeExpr:!0,isAssign:!0}),incDec:new I("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new I("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:le("||",1),logicalAND:le("&&",2),bitwiseOR:le("|",3),bitwiseXOR:le("^",4),bitwiseAND:le("&",5),equality:le("==/!=/===/!==",6),relational:le("</>/<=/>=",7),bitShift:le("<</>>/>>>",8),plusMin:new I("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:le("%",10),star:le("*",10),slash:le("/",10),starstar:new I("**",{beforeExpr:!0}),coalesce:le("??",1),_break:N("break"),_case:N("case",pe),_catch:N("catch"),_continue:N("continue"),_debugger:N("debugger"),_default:N("default",pe),_do:N("do",{isLoop:!0,beforeExpr:!0}),_else:N("else",pe),_finally:N("finally"),_for:N("for",{isLoop:!0}),_function:N("function",Q),_if:N("if"),_return:N("return",pe),_switch:N("switch"),_throw:N("throw",pe),_try:N("try"),_var:N("var"),_const:N("const"),_while:N("while",{isLoop:!0}),_with:N("with"),_new:N("new",{beforeExpr:!0,startsExpr:!0}),_this:N("this",Q),_super:N("super",Q),_class:N("class",Q),_extends:N("extends",pe),_export:N("export"),_import:N("import",Q),_null:N("null",Q),_true:N("true",Q),_false:N("false",Q),_in:N("in",{beforeExpr:!0,binop:7}),_instanceof:N("instanceof",{beforeExpr:!0,binop:7}),_typeof:N("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:N("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:N("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Z=/\r\n?|\n|\u2028|\u2029/,Wm=new RegExp(Z.source,"g");function jt(e){return e===10||e===13||e===8232||e===8233}function Vl(e,t,n){if(n===void 0)n=e.length;for(var i=t;i<n;i++){var r=e.charCodeAt(i);if(jt(r))return i<n-1&&r===13&&e.charCodeAt(i+1)===10?i+2:i+1}return-1}var jl=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,W=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Hm=Object.prototype,{hasOwnProperty:Um,toString:qm}=Hm,Dn=Object.hasOwn||function(e,t){return Um.call(e,t)},Rl=Array.isArray||function(e){return qm.call(e)==="[object Array]"},Ml=Object.create(null);function vi(e){return Ml[e]||(Ml[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function Pi(e){if(e<=65535)return String.fromCharCode(e);return e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320)}var zm=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Nn=function(e,t){this.line=e,this.column=t};Nn.prototype.offset=function(e){return new Nn(this.line,this.column+e)};var wi=function(e,t,n){if(this.start=t,this.end=n,e.sourceFile!==null)this.source=e.sourceFile};function Gl(e,t){for(var n=1,i=0;;){var r=Vl(e,i,t);if(r<0)return new Nn(n,t-i);++n,i=r}}var As={ecmaVersion:null,sourceType:"script",strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Ol=!1;function Km(e){var t={};for(var n in As)t[n]=e&&Dn(e,n)?e[n]:As[n];if(t.ecmaVersion==="latest")t.ecmaVersion=1e8;else if(t.ecmaVersion==null){if(!Ol&&typeof console==="object"&&console.warn)Ol=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
32
|
-
Defaulting to 2020, but this will stop working in the future.`);t.ecmaVersion=11}else if(t.ecmaVersion>=2015)t.ecmaVersion-=2009;if(t.allowReserved==null)t.allowReserved=t.ecmaVersion<5;if(!e||e.allowHashBang==null)t.allowHashBang=t.ecmaVersion>=14;if(
|
|
33
|
-
`,n-1)+1,this.options.locations)this.curLine=this.input.slice(0,this.lineStart).split(Z).length}else this.lineStart=0;if(this.type=d.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType==="module",this.strict=this.inModule||e.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)==="#!")this.skipLineComment(2);this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?gt:yt),this.regexpState=null,this.privateNameStack=[]},ce={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};V.prototype.parse=function(){var e=this,t=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return e.parseTopLevel(t)})};ce.inFunction.get=function(){return(this.currentVarScope().flags>)>0};ce.inGenerator.get=function(){return(this.currentVarScope().flags&Wl)>0};ce.inAsync.get=function(){return(this.currentVarScope().flags&_s)>0};ce.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],n=t.flags;if(n&(xt|$n))return!1;if(n>)return(n&_s)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};ce.allowReturn.get=function(){if(this.inFunction)return!0;if(this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&yt)return!0;return!1};ce.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags;return(t&ki)>0||this.options.allowSuperOutsideMethod};ce.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Ul)>0};ce.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};ce.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],n=t.flags;if(n&(xt|$n)||n>&&!(n&Ns))return!0}return!1};ce.allowUsing.get=function(){var e=this.currentScope(),t=e.flags;if(t&ql)return!1;if(!this.inModule&&t&yt)return!1;return!0};ce.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&xt)>0};V.extend=function(){var e=[],t=arguments.length;while(t--)e[t]=arguments[t];var n=this;for(var i=0;i<e.length;i++)n=e[i](n);return n};V.parse=function(e,t){return new this(t,e).parse()};V.parseExpressionAt=function(e,t,n){var i=new this(n,e,t);return i.nextToken(),i.parseExpression()};V.tokenizer=function(e,t){return new this(t,e)};Object.defineProperties(V.prototype,ce);var K=V.prototype,Xm=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;K.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){W.lastIndex=e,e+=W.exec(this.input)[0].length;var t=Xm.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){W.lastIndex=e+t[0].length;var n=W.exec(this.input),i=n.index+n[0].length,r=this.input.charAt(i);return r===";"||r==="}"||Z.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(r)||r==="!"&&this.input.charAt(i+1)==="="||r==="i"&&Ym(this,i))}if(e+=t[0].length,W.lastIndex=e,e+=W.exec(this.input)[0].length,this.input[e]===";")e++}};function Ym(e,t){var n=t+1,i=Math.min(e.input.length,t+11);while(n<i){var r=e.fullCharCodeAt(n);if(!_e(r,!0))break;n+=r<=65535?1:2}return n===t+2&&e.input.slice(t,n)==="in"||n===t+10&&e.input.slice(t,n)==="instanceof"}K.eat=function(e){if(this.type===e)return this.next(),!0;else return!1};K.isContextual=function(e){return this.type===d.name&&this.value===e&&!this.containsEsc};K.eatContextual=function(e){if(!this.isContextual(e))return!1;return this.next(),!0};K.catchStackOverflow=function(e){try{return e()}catch(t){if(t instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(t.message)||/\btoo much recursion\b/i.test(t.message)))this.raise(this.start,"Not enough stack space to parse input");else throw t}};K.expectContextual=function(e){if(!this.eatContextual(e))this.unexpected()};K.canInsertSemicolon=function(){return this.type===d.eof||this.type===d.braceR||Z.test(this.input.slice(this.lastTokEnd,this.start))};K.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return!0}};K.semicolon=function(){if(!this.eat(d.semi)&&!this.insertSemicolon())this.unexpected()};K.afterTrailingComma=function(e,t){if(this.type===e){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);if(!t)this.next();return!0}};K.expect=function(e){this.eat(e)||this.unexpected()};K.unexpected=function(e){this.raise(e!=null?e:this.start,"Unexpected token")};var Ni=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};K.checkPatternErrors=function(e,t){if(!e)return;if(e.trailingComma>-1)this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var n=t?e.parenthesizedAssign:e.parenthesizedBind;if(n>-1)this.raiseRecoverable(n,t?"Assigning to rvalue":"Parenthesized pattern")};K.checkExpressionErrors=function(e,t){if(!e)return!1;var{shorthandAssign:n,doubleProto:i}=e;if(!t)return n>=0||i>=0;if(n>=0)this.raise(n,"Shorthand property assignments are valid only in destructuring patterns");if(i>=0)this.raiseRecoverable(i,"Redefinition of __proto__ property")};K.checkYieldAwaitInDefaultParams=function(){if(this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos))this.raise(this.yieldPos,"Yield expression cannot be a default value");if(this.awaitPos)this.raise(this.awaitPos,"Await expression cannot be a default value")};K.isSimpleAssignTarget=function(e){if(e.type==="ParenthesizedExpression")return this.isSimpleAssignTarget(e.expression);return e.type==="Identifier"||e.type==="MemberExpression"};var x=V.prototype;x.parseTopLevel=function(e){var t=Object.create(null);if(!e.body)e.body=[];while(this.type!==d.eof){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var i=0,r=Object.keys(this.undefinedExports);i<r.length;i+=1){var s=r[i];this.raiseRecoverable(this.undefinedExports[s].start,"Export '"+s+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(e,"Program")};var Is={kind:"loop"},Qm={kind:"switch"};x.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;W.lastIndex=this.pos;var t=W.exec(this.input),n=this.pos+t[0].length,i=this.fullCharCodeAt(n);if(i===91||i===92)return!0;if(e)return!1;if(i===123)return!0;if(Te(i)){var r=n;do n+=i<=65535?1:2;while(_e(i=this.fullCharCodeAt(n)));if(i===92)return!0;var s=this.input.slice(r,n);if(!Fl.test(s))return!0}return!1};x.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;W.lastIndex=this.pos;var e=W.exec(this.input),t=this.pos+e[0].length,n;return!Z.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(_e(n=this.fullCharCodeAt(t+8))||n===92))};x.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;W.lastIndex=this.pos;var n=W.exec(this.input),i=this.pos+n[0].length;if(Z.test(this.input.slice(this.pos,i)))return!1;if(e){var r=i+5,s;if(this.input.slice(i,r)!=="using"||r===this.input.length||_e(s=this.fullCharCodeAt(r))||s===92)return!1;W.lastIndex=r;var l=W.exec(this.input);if(i=r+l[0].length,l&&Z.test(this.input.slice(r,i)))return!1}var o=this.fullCharCodeAt(i);if(!Te(o)&&o!==92)return!1;var a=i;do i+=o<=65535?1:2;while(_e(o=this.fullCharCodeAt(i)));if(o===92)return!0;var p=this.input.slice(a,i);if(Fl.test(p))return!1;if(t&&!e&&p==="of"){W.lastIndex=i;var c=W.exec(this.input);if(i=i+c[0].length,this.input.charCodeAt(i)!==61||(o=this.input.charCodeAt(i+1))===61||o===62)return!1}return!0};x.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)};x.isUsing=function(e){return this.isUsingKeyword(!1,e)};x.parseStatement=function(e,t,n){var i=this.type,r=this.startNode(),s;if(this.isLet(e))i=d._var,s="let";switch(i){case d._break:case d._continue:return this.parseBreakContinueStatement(r,i.keyword);case d._debugger:return this.parseDebuggerStatement(r);case d._do:return this.parseDoStatement(r);case d._for:return this.parseForStatement(r);case d._function:if(e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(r,!1,!e);case d._class:if(e)this.unexpected();return this.parseClass(r,!0);case d._if:return this.parseIfStatement(r);case d._return:return this.parseReturnStatement(r);case d._switch:return this.parseSwitchStatement(r);case d._throw:return this.parseThrowStatement(r);case d._try:return this.parseTryStatement(r);case d._const:case d._var:if(s=s||this.value,e&&s!=="var")this.unexpected();return this.parseVarStatement(r,s);case d._while:return this.parseWhileStatement(r);case d._with:return this.parseWithStatement(r);case d.braceL:return this.parseBlock(!0,r);case d.semi:return this.parseEmptyStatement(r);case d._export:case d._import:if(this.options.ecmaVersion>10&&i===d._import){W.lastIndex=this.pos;var l=W.exec(this.input),o=this.pos+l[0].length,a=this.input.charCodeAt(o);if(a===40||a===46)return this.parseExpressionStatement(r,this.parseExpression())}if(!this.options.allowImportExportEverywhere){if(!t)this.raise(this.start,"'import' and 'export' may only appear at the top level");if(!this.inModule)this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")}return i===d._import?this.parseImport(r):this.parseExport(r,n);default:if(this.isAsyncFunction()){if(e)this.unexpected();return this.next(),this.parseFunctionStatement(r,!0,!e)}var p=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(p){if(!this.allowUsing)this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");if(e)this.raise(this.start,"Using declaration is not allowed in single-statement positions");if(p==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.next(),this.parseVar(r,!1,p),this.semicolon(),this.finishNode(r,"VariableDeclaration")}var c=this.value,u=this.parseExpression();if(i===d.name&&u.type==="Identifier"&&this.eat(d.colon))return this.parseLabeledStatement(r,c,u,e);else return this.parseExpressionStatement(r,u)}};x.parseBreakContinueStatement=function(e,t){var n=t==="break";if(this.next(),this.eat(d.semi)||this.insertSemicolon())e.label=null;else if(this.type!==d.name)this.unexpected();else e.label=this.parseIdent(),this.semicolon();var i=0;for(;i<this.labels.length;++i){var r=this.labels[i];if(e.label==null||r.name===e.label.name){if(r.kind!=null&&(n||r.kind==="loop"))break;if(e.label&&n)break}}if(i===this.labels.length)this.raise(e.start,"Unsyntactic "+t);return this.finishNode(e,n?"BreakStatement":"ContinueStatement")};x.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};x.parseDoStatement=function(e){if(this.next(),this.labels.push(Is),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(d._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6)this.eat(d.semi);else this.semicolon();return this.finishNode(e,"DoWhileStatement")};x.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Is),this.enterScope(0),this.expect(d.parenL),this.type===d.semi){if(t>-1)this.unexpected(t);return this.parseFor(e,null)}var n=this.isLet();if(this.type===d._var||this.type===d._const||n){var i=this.startNode(),r=n?"let":this.value;return this.next(),this.parseVar(i,!0,r),this.finishNode(i,"VariableDeclaration"),this.parseForAfterInit(e,i,t)}var s=this.isContextual("let"),l=!1,o=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(o){var a=this.startNode();if(this.next(),o==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.parseVar(a,!0,o),this.finishNode(a,"VariableDeclaration"),this.parseForAfterInit(e,a,t)}var p=this.containsEsc,c=new Ni,u=this.start,f=t>-1?this.parseExprSubscripts(c,"await"):this.parseExpression(!0,c);if(this.type===d._in||(l=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(t>-1){if(this.type===d._in)this.unexpected(t);e.await=!0}else if(l&&this.options.ecmaVersion>=8){if(f.start===u&&!p&&f.type==="Identifier"&&f.name==="async")this.unexpected();else if(this.options.ecmaVersion>=9)e.await=!1}if(s&&l)this.raise(f.start,"The left-hand side of a for-of loop may not start with 'let'.");return this.toAssignable(f,!1,c),this.checkLValPattern(f),this.parseForIn(e,f)}else this.checkExpressionErrors(c,!0);if(t>-1)this.unexpected(t);return this.parseFor(e,f)};x.parseForAfterInit=function(e,t,n){if((this.type===d._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&t.declarations.length===1){if(this.type===d._in){if((t.kind==="using"||t.kind==="await using")&&!t.declarations[0].init)this.raise(this.start,"Using declaration is not allowed in for-in loops");if(this.options.ecmaVersion>=9&&n>-1)this.unexpected(n)}else if(this.options.ecmaVersion>=9)e.await=n>-1;return this.parseForIn(e,t)}if(n>-1)this.unexpected(n);return this.parseFor(e,t)};x.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,_n|(n?0:Ps),!1,t)};x.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(d._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};x.parseReturnStatement=function(e){if(!this.allowReturn)this.raise(this.start,"'return' outside of function");if(this.next(),this.eat(d.semi)||this.insertSemicolon())e.argument=null;else e.argument=this.parseExpression(),this.semicolon();return this.finishNode(e,"ReturnStatement")};x.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(d.braceL),this.labels.push(Qm),this.enterScope(ql);var t;for(var n=!1;this.type!==d.braceR;)if(this.type===d._case||this.type===d._default){var i=this.type===d._case;if(t)this.finishNode(t,"SwitchCase");if(e.cases.push(t=this.startNode()),t.consequent=[],this.next(),i)t.test=this.parseExpression();else{if(n)this.raiseRecoverable(this.lastTokStart,"Multiple default clauses");n=!0,t.test=null}this.expect(d.colon)}else{if(!t)this.unexpected();t.consequent.push(this.parseStatement(null))}if(this.exitScope(),t)this.finishNode(t,"SwitchCase");return this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};x.parseThrowStatement=function(e){if(this.next(),Z.test(this.input.slice(this.lastTokEnd,this.start)))this.raise(this.lastTokEnd,"Illegal newline after throw");return e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Zm=[];x.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?Hl:0),this.checkLValPattern(e,t?Kl:Ge),this.expect(d.parenR),e};x.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===d._catch){var t=this.startNode();if(this.next(),this.eat(d.parenL))t.param=this.parseCatchClauseParam();else{if(this.options.ecmaVersion<10)this.unexpected();t.param=null,this.enterScope(0)}t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}if(e.finalizer=this.eat(d._finally)?this.parseBlock():null,!e.handler&&!e.finalizer)this.raise(e.start,"Missing catch or finally clause");return this.finishNode(e,"TryStatement")};x.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,"VariableDeclaration")};x.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Is),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};x.parseWithStatement=function(e){if(this.strict)this.raise(this.start,"'with' in strict mode");return this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};x.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};x.parseLabeledStatement=function(e,t,n,i){for(var r=0,s=this.labels;r<s.length;r+=1){var l=s[r];if(l.name===t)this.raise(n.start,"Label '"+t+"' is already declared")}var o=this.type.isLoop?"loop":this.type===d._switch?"switch":null;for(var a=this.labels.length-1;a>=0;a--){var p=this.labels[a];if(p.statementStart===e.start)p.statementStart=this.start,p.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(i?i.indexOf("label")===-1?i+"label":i:"label"),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")};x.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};x.parseBlock=function(e,t,n){if(e===void 0)e=!0;if(t===void 0)t=this.startNode();if(t.body=[],this.expect(d.braceL),e)this.enterScope(0);while(this.type!==d.braceR){var i=this.parseStatement(null);t.body.push(i)}if(n)this.strict=!1;if(this.next(),e)this.exitScope();return this.finishNode(t,"BlockStatement")};x.parseFor=function(e,t){return e.init=t,this.expect(d.semi),e.test=this.type===d.semi?null:this.parseExpression(),this.expect(d.semi),e.update=this.type===d.parenR?null:this.parseExpression(),this.expect(d.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};x.parseForIn=function(e,t){var n=this.type===d._in;if(this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier"))this.raise(t.start,(n?"for-in":"for-of")+" loop variable declaration may not have an initializer");return e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(d.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,n?"ForInStatement":"ForOfStatement")};x.parseVar=function(e,t,n,i){e.declarations=[],e.kind=n;for(;;){var r=this.startNode();if(this.parseVarId(r,n),this.eat(d.eq))r.init=this.parseMaybeAssign(t);else if(!i&&n==="const"&&!(this.type===d._in||this.options.ecmaVersion>=6&&this.isContextual("of")))this.unexpected();else if(!i&&(n==="using"||n==="await using")&&this.options.ecmaVersion>=17&&this.type!==d._in&&!this.isContextual("of"))this.raise(this.lastTokEnd,"Missing initializer in "+n+" declaration");else if(!i&&r.id.type!=="Identifier"&&!(t&&(this.type===d._in||this.isContextual("of"))))this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value");else r.init=null;if(e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(d.comma))break}return e};x.parseVarId=function(e,t){e.id=t==="using"||t==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?$s:Ge,!1)};var _n=1,Ps=2,Xl=4;x.parseFunction=function(e,t,n,i,r){if(this.initFunction(e),this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!i){if(this.type===d.star&&t&Ps)this.unexpected();e.generator=this.eat(d.star)}if(this.options.ecmaVersion>=8)e.async=!!i;if(t&_n){if(e.id=t&Xl&&this.type!==d.name?null:this.parseIdent(),e.id&&!(t&Ps))this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?$s:Ge:zl)}var s=this.yieldPos,l=this.awaitPos,o=this.awaitIdentPos;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ds(e.async,e.generator)),!(t&_n))e.id=this.type===d.name?this.parseIdent():null;return this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,r),this.yieldPos=s,this.awaitPos=l,this.awaitIdentPos=o,this.finishNode(e,t&_n?"FunctionDeclaration":"FunctionExpression")};x.parseFunctionParams=function(e){this.expect(d.parenL),e.params=this.parseBindingList(d.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};x.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var i=this.enterClassBody(),r=this.startNode(),s=!1;r.body=[],this.expect(d.braceL);while(this.type!==d.braceR){var l=this.parseClassElement(e.superClass!==null);if(l){if(r.body.push(l),l.type==="MethodDefinition"&&l.kind==="constructor"){if(s)this.raiseRecoverable(l.start,"Duplicate constructor in the same class");s=!0}else if(l.key&&l.key.type==="PrivateIdentifier"&&ey(i,l))this.raiseRecoverable(l.key.start,"Identifier '#"+l.key.name+"' has already been declared")}}return this.strict=n,this.next(),e.body=this.finishNode(r,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};x.parseClassElement=function(e){if(this.eat(d.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),i="",r=!1,s=!1,l="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(d.braceL))return this.parseClassStaticBlock(n),n;if(this.isClassElementNameStart()||this.type===d.star)o=!0;else i="static"}if(n.static=o,!i&&t>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===d.star)&&!this.canInsertSemicolon())s=!0;else i="async";if(!i&&(t>=9||!s)&&this.eat(d.star))r=!0;if(!i&&!s&&!r){var a=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())l=a;else i=a}if(i)n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=i,this.finishNode(n.key,"Identifier");else this.parseClassElementName(n);if(t<13||this.type===d.parenL||l!=="method"||r||s){var p=!n.static&&Ci(n,"constructor"),c=p&&e;if(p&&l!=="method")this.raise(n.key.start,"Constructor can't have get/set modifier");n.kind=p?"constructor":l,this.parseClassMethod(n,r,s,c)}else this.parseClassField(n);return n};x.isClassElementNameStart=function(){return this.type===d.name||this.type===d.privateId||this.type===d.num||this.type===d.string||this.type===d.bracketL||this.type.keyword};x.parseClassElementName=function(e){if(this.type===d.privateId){if(this.value==="constructor")this.raise(this.start,"Classes can't have an element named '#constructor'");e.computed=!1,e.key=this.parsePrivateIdent()}else this.parsePropertyName(e)};x.parseClassMethod=function(e,t,n,i){var r=e.key;if(e.kind==="constructor"){if(t)this.raise(r.start,"Constructor can't be a generator");if(n)this.raise(r.start,"Constructor can't be an async method")}else if(e.static&&Ci(e,"prototype"))this.raise(r.start,"Classes may not have a static property named prototype");var s=e.value=this.parseMethod(t,n,i);if(e.kind==="get"&&s.params.length!==0)this.raiseRecoverable(s.start,"getter should have no params");if(e.kind==="set"&&s.params.length!==1)this.raiseRecoverable(s.start,"setter should have exactly one param");if(e.kind==="set"&&s.params[0].type==="RestElement")this.raiseRecoverable(s.params[0].start,"Setter cannot use rest params");return this.finishNode(e,"MethodDefinition")};x.parseClassField=function(e){if(Ci(e,"constructor"))this.raise(e.key.start,"Classes can't have a field named 'constructor'");else if(e.static&&Ci(e,"prototype"))this.raise(e.key.start,"Classes can't have a static field named 'prototype'");if(this.eat(d.eq))this.enterScope($n|ki),e.value=this.parseMaybeAssign(),this.exitScope();else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};x.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;this.labels=[],this.enterScope(xt|ki);while(this.type!==d.braceR){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};x.parseClassId=function(e,t){if(this.type===d.name){if(e.id=this.parseIdent(),t)this.checkLValSimple(e.id,Ge,!1)}else{if(t===!0)this.unexpected();e.id=null}};x.parseClassSuper=function(e){e.superClass=this.eat(d._extends)?this.parseExprSubscripts(null,!1):null};x.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};x.exitClassBody=function(){var e=this.privateNameStack.pop(),{declared:t,used:n}=e;if(!this.options.checkPrivateFields)return;var i=this.privateNameStack.length,r=i===0?null:this.privateNameStack[i-1];for(var s=0;s<n.length;++s){var l=n[s];if(!Dn(t,l.name))if(r)r.used.push(l);else this.raiseRecoverable(l.start,"Private field '#"+l.name+"' must be declared in an enclosing class")}};function ey(e,t){var n=t.key.name,i=e[n],r="true";if(t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set"))r=(t.static?"s":"i")+t.kind;if(i==="iget"&&r==="iset"||i==="iset"&&r==="iget"||i==="sget"&&r==="sset"||i==="sset"&&r==="sget")return e[n]="true",!1;else if(!i)return e[n]=r,!1;else return!0}function Ci(e,t){var{computed:n,key:i}=e;return!n&&(i.type==="Identifier"&&i.name===t||i.type==="Literal"&&i.value===t)}x.parseExportAllDeclaration=function(e,t){if(this.options.ecmaVersion>=11)if(this.eatContextual("as"))e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart);else e.exported=null;if(this.expectContextual("from"),this.type!==d.string)this.unexpected();if(e.source=this.parseExprAtom(),this.options.ecmaVersion>=16)e.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};x.parseExport=function(e,t){if(this.next(),this.eat(d.star))return this.parseExportAllDeclaration(e,t);if(this.eat(d._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration")this.checkVariableExport(t,e.declaration.declarations);else this.checkExport(t,e.declaration.id,e.declaration.id.start);if(e.specifiers=[],e.source=null,this.options.ecmaVersion>=16)e.attributes=[]}else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from")){if(this.type!==d.string)this.unexpected();if(e.source=this.parseExprAtom(),this.options.ecmaVersion>=16)e.attributes=this.parseWithClause()}else{for(var n=0,i=e.specifiers;n<i.length;n+=1){var r=i[n];if(this.checkUnreserved(r.local),this.checkLocalExport(r.local),r.local.type==="Literal")this.raise(r.local.start,"A string literal cannot be used as an exported binding without `from`.")}if(e.source=null,this.options.ecmaVersion>=16)e.attributes=[]}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};x.parseExportDeclaration=function(e){return this.parseStatement(null)};x.parseExportDefaultDeclaration=function(){var e;if(this.type===d._function||(e=this.isAsyncFunction())){var t=this.startNode();if(this.next(),e)this.next();return this.parseFunction(t,_n|Xl,!1,e)}else if(this.type===d._class){var n=this.startNode();return this.parseClass(n,"nullableID")}else{var i=this.parseMaybeAssign();return this.semicolon(),i}};x.checkExport=function(e,t,n){if(!e)return;if(typeof t!=="string")t=t.type==="Identifier"?t.name:t.value;if(Dn(e,t))this.raiseRecoverable(n,"Duplicate export '"+t+"'");e[t]=!0};x.checkPatternExport=function(e,t){var n=t.type;if(n==="Identifier")this.checkExport(e,t,t.start);else if(n==="ObjectPattern")for(var i=0,r=t.properties;i<r.length;i+=1){var s=r[i];this.checkPatternExport(e,s)}else if(n==="ArrayPattern")for(var l=0,o=t.elements;l<o.length;l+=1){var a=o[l];if(a)this.checkPatternExport(e,a)}else if(n==="Property")this.checkPatternExport(e,t.value);else if(n==="AssignmentPattern")this.checkPatternExport(e,t.left);else if(n==="RestElement")this.checkPatternExport(e,t.argument)};x.checkVariableExport=function(e,t){if(!e)return;for(var n=0,i=t;n<i.length;n+=1){var r=i[n];this.checkPatternExport(e,r.id)}};x.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};x.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")};x.parseExportSpecifiers=function(e){var t=[],n=!0;this.expect(d.braceL);while(!this.eat(d.braceR)){if(!n){if(this.expect(d.comma),this.afterTrailingComma(d.braceR))break}else n=!1;t.push(this.parseExportSpecifier(e))}return t};x.parseImport=function(e){if(this.next(),this.type===d.string)e.specifiers=Zm,e.source=this.parseExprAtom();else e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===d.string?this.parseExprAtom():this.unexpected();if(this.options.ecmaVersion>=16)e.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(e,"ImportDeclaration")};x.parseImportSpecifier=function(){var e=this.startNode();if(e.imported=this.parseModuleExportName(),this.eatContextual("as"))e.local=this.parseIdent();else this.checkUnreserved(e.imported),e.local=e.imported;return this.checkLValSimple(e.local,Ge),this.finishNode(e,"ImportSpecifier")};x.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,Ge),this.finishNode(e,"ImportDefaultSpecifier")};x.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,Ge),this.finishNode(e,"ImportNamespaceSpecifier")};x.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===d.name){if(e.push(this.parseImportDefaultSpecifier()),!this.eat(d.comma))return e}if(this.type===d.star)return e.push(this.parseImportNamespaceSpecifier()),e;this.expect(d.braceL);while(!this.eat(d.braceR)){if(!t){if(this.expect(d.comma),this.afterTrailingComma(d.braceR))break}else t=!1;e.push(this.parseImportSpecifier())}return e};x.parseWithClause=function(){var e=[];if(!this.eat(d._with))return e;this.expect(d.braceL);var t={},n=!0;while(!this.eat(d.braceR)){if(!n){if(this.expect(d.comma),this.afterTrailingComma(d.braceR))break}else n=!1;var i=this.parseImportAttribute(),r=i.key.type==="Identifier"?i.key.name:i.key.value;if(Dn(t,r))this.raiseRecoverable(i.key.start,"Duplicate attribute key '"+r+"'");t[r]=!0,e.push(i)}return e};x.parseImportAttribute=function(){var e=this.startNode();if(e.key=this.type===d.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(d.colon),this.type!==d.string)this.unexpected();return e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")};x.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===d.string){var e=this.parseLiteral(this.value);if(zm.test(e.value))this.raise(e.start,"An export name cannot include a lone surrogate.");return e}return this.parseIdent(!0)};x.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)};x.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value==="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var ue=V.prototype;ue.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":if(this.inAsync&&e.name==="await")this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":if(e.type="ObjectPattern",n)this.checkPatternErrors(n,!0);for(var i=0,r=e.properties;i<r.length;i+=1){var s=r[i];if(this.toAssignable(s,t),s.type==="RestElement"&&(s.argument.type==="ArrayPattern"||s.argument.type==="ObjectPattern"))this.raise(s.argument.start,"Unexpected token")}break;case"Property":if(e.kind!=="init")this.raise(e.key.start,"Object pattern can't contain getter or setter");this.toAssignable(e.value,t);break;case"ArrayExpression":if(e.type="ArrayPattern",n)this.checkPatternErrors(n,!0);this.toAssignableList(e.elements,t);break;case"SpreadElement":if(e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern")this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":if(e.operator!=="=")this.raise(e.left.end,"Only '=' operator can be used for specifying default value.");e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,n);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else if(n)this.checkPatternErrors(n,!0);return e};ue.toAssignableList=function(e,t){var n=e.length;for(var i=0;i<n;i++){var r=e[i];if(r)this.toAssignable(r,t)}if(n){var s=e[n-1];if(this.options.ecmaVersion===6&&t&&s&&s.type==="RestElement"&&s.argument.type!=="Identifier")this.unexpected(s.argument.start)}return e};ue.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")};ue.parseRestBinding=function(){var e=this.startNode();if(this.next(),this.options.ecmaVersion===6&&this.type!==d.name)this.unexpected();return e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};ue.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case d.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(d.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case d.braceL:return this.parseObj(!0)}return this.parseIdent()};ue.parseBindingList=function(e,t,n,i){var r=[],s=!0;while(!this.eat(e)){if(s)s=!1;else this.expect(d.comma);if(t&&this.type===d.comma)r.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===d.ellipsis){var l=this.parseRestBinding();if(this.parseBindingListItem(l),r.push(l),this.type===d.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");this.expect(e);break}else r.push(this.parseAssignableListItem(i))}return r};ue.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t};ue.parseBindingListItem=function(e){return e};ue.parseMaybeDefault=function(e,t,n){if(n=n||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(d.eq))return n;var i=this.startNodeAt(e,t);return i.left=n,i.right=this.parseMaybeAssign(),this.finishNode(i,"AssignmentPattern")};ue.checkLValSimple=function(e,t,n){if(t===void 0)t=bi;var i=t!==bi;switch(e.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(e.name))this.raiseRecoverable(e.start,(i?"Binding ":"Assigning to ")+e.name+" in strict mode");if(i){if(t===Ge&&e.name==="let")this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name");if(n){if(Dn(n,e.name))this.raiseRecoverable(e.start,"Argument name clash");n[e.name]=!0}if(t!==Jl)this.declareName(e.name,t,e.start)}break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(i)this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":if(i)this.raiseRecoverable(e.start,"Binding parenthesized expression");return this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(i?"Binding":"Assigning to")+" rvalue")}};ue.checkLValPattern=function(e,t,n){if(t===void 0)t=bi;switch(e.type){case"ObjectPattern":for(var i=0,r=e.properties;i<r.length;i+=1){var s=r[i];this.checkLValInnerPattern(s,t,n)}break;case"ArrayPattern":for(var l=0,o=e.elements;l<o.length;l+=1){var a=o[l];if(a)this.checkLValInnerPattern(a,t,n)}break;default:this.checkLValSimple(e,t,n)}};ue.checkLValInnerPattern=function(e,t,n){if(t===void 0)t=bi;switch(e.type){case"Property":this.checkLValInnerPattern(e.value,t,n);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,n);break;case"RestElement":this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var Ee=function(e,t,n,i,r){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=i,this.generator=!!r},B={b_stat:new Ee("{",!1),b_expr:new Ee("{",!0),b_tmpl:new Ee("${",!1),p_stat:new Ee("(",!1),p_expr:new Ee("(",!0),q_tmpl:new Ee("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new Ee("function",!1),f_expr:new Ee("function",!0),f_expr_gen:new Ee("function",!0,!1,null,!0),f_gen:new Ee("function",!1,!1,null,!0)},Gt=V.prototype;Gt.initialContext=function(){return[B.b_stat]};Gt.curContext=function(){return this.context[this.context.length-1]};Gt.braceIsBlock=function(e){var t=this.curContext();if(t===B.f_expr||t===B.f_stat)return!0;if(e===d.colon&&(t===B.b_stat||t===B.b_expr))return!t.isExpr;if(e===d._return||e===d.name&&this.exprAllowed)return Z.test(this.input.slice(this.lastTokEnd,this.start));if(e===d._else||e===d.semi||e===d.eof||e===d.parenR||e===d.arrow)return!0;if(e===d.braceL)return t===B.b_stat;if(e===d._var||e===d._const||e===d.name)return!1;return!this.exprAllowed};Gt.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return!1};Gt.updateContext=function(e){var t,n=this.type;if(n.keyword&&e===d.dot)this.exprAllowed=!1;else if(t=n.updateContext)t.call(this,e);else this.exprAllowed=n.beforeExpr};Gt.overrideContext=function(e){if(this.curContext()!==e)this.context[this.context.length-1]=e};d.parenR.updateContext=d.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();if(e===B.b_stat&&this.curContext().token==="function")e=this.context.pop();this.exprAllowed=!e.isExpr};d.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?B.b_stat:B.b_expr),this.exprAllowed=!0};d.dollarBraceL.updateContext=function(){this.context.push(B.b_tmpl),this.exprAllowed=!0};d.parenL.updateContext=function(e){var t=e===d._if||e===d._for||e===d._with||e===d._while;this.context.push(t?B.p_stat:B.p_expr),this.exprAllowed=!0};d.incDec.updateContext=function(){};d._function.updateContext=d._class.updateContext=function(e){if(e.beforeExpr&&e!==d._else&&!(e===d.semi&&this.curContext()!==B.p_stat)&&!(e===d._return&&Z.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===d.colon||e===d.braceL)&&this.curContext()===B.b_stat))this.context.push(B.f_expr);else this.context.push(B.f_stat);this.exprAllowed=!1};d.colon.updateContext=function(){if(this.curContext().token==="function")this.context.pop();this.exprAllowed=!0};d.backQuote.updateContext=function(){if(this.curContext()===B.q_tmpl)this.context.pop();else this.context.push(B.q_tmpl);this.exprAllowed=!1};d.star.updateContext=function(e){if(e===d._function){var t=this.context.length-1;if(this.context[t]===B.f_expr)this.context[t]=B.f_expr_gen;else this.context[t]=B.f_gen}this.exprAllowed=!0};d.name.updateContext=function(e){var t=!1;if(this.options.ecmaVersion>=6&&e!==d.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())t=!0}this.exprAllowed=t};var A=V.prototype;A.checkPropClash=function(e,t,n){if(this.options.ecmaVersion>=9&&e.type==="SpreadElement")return;if(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))return;var i=e.key,r;switch(i.type){case"Identifier":r=i.name;break;case"Literal":r=String(i.value);break;default:return}var s=e.kind;if(this.options.ecmaVersion>=6){if(r==="__proto__"&&s==="init"){if(t.proto)if(n){if(n.doubleProto<0)n.doubleProto=i.start}else this.raiseRecoverable(i.start,"Redefinition of __proto__ property");t.proto=!0}return}r="$"+r;var l=t[r];if(l){var o;if(s==="init")o=this.strict&&l.init||l.get||l.set;else o=l.init||l[s];if(o)this.raiseRecoverable(i.start,"Redefinition of property")}else l=t[r]={init:!1,get:!1,set:!1};l[s]=!0};A.parseExpression=function(e,t){var n=this;return this.catchStackOverflow(function(){var{start:i,startLoc:r}=n,s=n.parseMaybeAssign(e,t);if(n.type===d.comma){var l=n.startNodeAt(i,r);l.expressions=[s];while(n.eat(d.comma))l.expressions.push(n.parseMaybeAssign(e,t));return n.finishNode(l,"SequenceExpression")}return s})};A.parseMaybeAssign=function(e,t,n){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(e);else this.exprAllowed=!1;var i=!1,r=-1,s=-1,l=-1;if(t)r=t.parenthesizedAssign,s=t.trailingComma,l=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1;else t=new Ni,i=!0;var o=this.start,a=this.startLoc;if(this.type===d.parenL||this.type===d.name)this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await";var p=this.parseMaybeConditional(e,t);if(n)p=n.call(this,p,o,a);if(this.type.isAssign){var c=this.startNodeAt(o,a);if(c.operator=this.value,this.type===d.eq)p=this.toAssignable(p,!1,t);if(!i){if(t.parenthesizedAssign=t.trailingComma=-1,t.shorthandAssign>=p.start)t.shorthandAssign=-1;if(t.doubleProto>=p.start)t.doubleProto=-1}if(this.type===d.eq)this.checkLValPattern(p);else this.checkLValSimple(p);if(c.left=p,this.next(),c.right=this.parseMaybeAssign(e),l>-1)t.doubleProto=l;return this.finishNode(c,"AssignmentExpression")}else if(i)this.checkExpressionErrors(t,!0);if(r>-1)t.parenthesizedAssign=r;if(s>-1)t.trailingComma=s;return p};A.parseMaybeConditional=function(e,t){var n=this.start,i=this.startLoc,r=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return r;if(!(r.type==="ArrowFunctionExpression"&&r.start===n)&&this.eat(d.question)){var s=this.startNodeAt(n,i);return s.test=r,s.consequent=this.parseMaybeAssign(),this.expect(d.colon),s.alternate=this.parseMaybeAssign(e),this.finishNode(s,"ConditionalExpression")}return r};A.parseExprOps=function(e,t){var n=this.start,i=this.startLoc,r=this.parseMaybeUnary(t,!1,!1,e);if(this.checkExpressionErrors(t))return r;return r.start===n&&r.type==="ArrowFunctionExpression"?r:this.parseExprOp(r,n,i,-1,e)};A.parseExprOp=function(e,t,n,i,r){var s=this.type.binop;if(s!=null&&(!r||this.type!==d._in)){if(s>i){var l=this.type===d.logicalOR||this.type===d.logicalAND,o=this.type===d.coalesce;if(o)s=d.logicalAND.binop;var a=this.value;this.next();var p=this.start,c=this.startLoc,u=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,r),p,c,s,r),f=this.buildBinary(t,n,e,u,a,l||o);if(l&&this.type===d.coalesce||o&&(this.type===d.logicalOR||this.type===d.logicalAND))this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");return this.parseExprOp(f,t,n,i,r)}}return e};A.buildBinary=function(e,t,n,i,r,s){if(i.type==="PrivateIdentifier")this.raise(i.start,"Private identifier can only be left side of binary expression");var l=this.startNodeAt(e,t);return l.left=n,l.operator=r,l.right=i,this.finishNode(l,s?"LogicalExpression":"BinaryExpression")};A.parseMaybeUnary=function(e,t,n,i){var r=this.start,s=this.startLoc,l;if(this.isContextual("await")&&this.canAwait)l=this.parseAwait(i),t=!0;else if(this.type.prefix){var o=this.startNode(),a=this.type===d.incDec;if(o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0,a,i),this.checkExpressionErrors(e,!0),a)this.checkLValSimple(o.argument);else if(this.strict&&o.operator==="delete"&&Yl(o.argument))this.raiseRecoverable(o.start,"Deleting local variable in strict mode");else if(o.operator==="delete"&&ws(o.argument))this.raiseRecoverable(o.start,"Private fields can not be deleted");else t=!0;l=this.finishNode(o,a?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===d.privateId){if((i||this.privateNameStack.length===0)&&this.options.checkPrivateFields)this.unexpected();if(l=this.parsePrivateIdent(),this.type!==d._in)this.unexpected()}else{if(l=this.parseExprSubscripts(e,i),this.checkExpressionErrors(e))return l;while(this.type.postfix&&!this.canInsertSemicolon()){var p=this.startNodeAt(r,s);p.operator=this.value,p.prefix=!1,p.argument=l,this.checkLValSimple(l),this.next(),l=this.finishNode(p,"UpdateExpression")}}if(!n&&!(l.type==="ArrowFunctionExpression"&&l.start===r)&&this.eat(d.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(r,s,l,this.parseMaybeUnary(null,!1,!1,i),"**",!1);else return l};function Yl(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&Yl(e.expression)}function ws(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&ws(e.expression)||e.type==="ParenthesizedExpression"&&ws(e.expression)}A.parseExprSubscripts=function(e,t){var n=this.start,i=this.startLoc,r=-1,s=-1;if(e)r=e.doubleProto,s=e.shorthandAssign,e.doubleProto=e.shorthandAssign=-1;var l=this.parseExprAtom(e,t);if(l.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return l;var o=this.parseSubscripts(l,n,i,!1,t);if(e){if(o.end>l.end){if(this.checkExpressionErrors(e,!0),e.parenthesizedAssign>=o.start)e.parenthesizedAssign=-1;if(e.parenthesizedBind>=o.start)e.parenthesizedBind=-1;if(e.trailingComma>=o.start)e.trailingComma=-1}if(r>-1)e.doubleProto=r;if(s>-1)e.shorthandAssign=s}return o};A.parseSubscripts=function(e,t,n,i,r){var s=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,l=!1;while(!0){var o=this.parseSubscript(e,t,n,i,s,l,r);if(o.optional)l=!0;if(o.end===e.end||o.type==="ArrowFunctionExpression"){if(l){var a=this.startNodeAt(t,n);a.expression=o,o=this.finishNode(a,"ChainExpression")}return o}e=o,s=!1}};A.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(d.arrow)};A.parseSubscriptAsyncArrow=function(e,t,n,i){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,i)};A.parseSubscript=function(e,t,n,i,r,s,l){var o=this.options.ecmaVersion>=11,a=o&&this.eat(d.questionDot);if(i&&a)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var p=this.eat(d.bracketL);if(p||a&&this.type!==d.parenL&&this.type!==d.backQuote||this.eat(d.dot)){var c=this.startNodeAt(t,n);if(c.object=e,p)c.property=this.parseExpression(),this.expect(d.bracketR);else if(this.type===d.privateId&&e.type!=="Super")c.property=this.parsePrivateIdent();else c.property=this.parseIdent(this.options.allowReserved!=="never");if(c.computed=!!p,o)c.optional=a;e=this.finishNode(c,"MemberExpression")}else if(!i&&this.eat(d.parenL)){var u=new Ni,f=this.yieldPos,h=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var g=this.parseExprList(d.parenR,this.options.ecmaVersion>=8,!1,u);if(r&&!a&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");return this.yieldPos=f,this.awaitPos=h,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(t,n,g,l)}this.checkExpressionErrors(u,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=h||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var y=this.startNodeAt(t,n);if(y.callee=e,y.arguments=g,o)y.optional=a;e=this.finishNode(y,"CallExpression")}else if(this.type===d.backQuote){if(a||s)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var E=this.startNodeAt(t,n);E.tag=e,E.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(E,"TaggedTemplateExpression")}return e};A.parseExprAtom=function(e,t,n){if(this.type===d.slash)this.readRegexp();var i,r=this.potentialArrowAt===this.start;switch(this.type){case d._super:if(!this.allowSuper)this.raise(this.start,"'super' keyword outside a method");if(i=this.startNode(),this.next(),this.type===d.parenL&&!this.allowDirectSuper)this.raise(i.start,"super() call outside constructor of a subclass");if(this.type!==d.dot&&this.type!==d.bracketL&&this.type!==d.parenL)this.unexpected();return this.finishNode(i,"Super");case d._this:return i=this.startNode(),this.next(),this.finishNode(i,"ThisExpression");case d.name:var s=this.start,l=this.startLoc,o=this.containsEsc,a=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&a.name==="async"&&!this.canInsertSemicolon()&&this.eat(d._function))return this.overrideContext(B.f_expr),this.parseFunction(this.startNodeAt(s,l),0,!1,!0,t);if(r&&!this.canInsertSemicolon()){if(this.eat(d.arrow))return this.parseArrowExpression(this.startNodeAt(s,l),[a],!1,t);if(this.options.ecmaVersion>=8&&a.name==="async"&&this.type===d.name&&!o&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(a=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(d.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(s,l),[a],!0,t)}}return a;case d.regexp:var p=this.value;return i=this.parseLiteral(p.value),i.regex={pattern:p.pattern,flags:p.flags},i;case d.num:case d.string:return this.parseLiteral(this.value);case d._null:case d._true:case d._false:return i=this.startNode(),i.value=this.type===d._null?null:this.type===d._true,i.raw=this.type.keyword,this.next(),this.finishNode(i,"Literal");case d.parenL:var c=this.start,u=this.parseParenAndDistinguishExpression(r,t);if(e){if(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(u))e.parenthesizedAssign=c;if(e.parenthesizedBind<0)e.parenthesizedBind=c}return u;case d.bracketL:return i=this.startNode(),this.next(),i.elements=this.parseExprList(d.bracketR,!0,!0,e),this.finishNode(i,"ArrayExpression");case d.braceL:return this.overrideContext(B.b_expr),this.parseObj(!1,e);case d._function:return i=this.startNode(),this.next(),this.parseFunction(i,0);case d._class:return this.parseClass(this.startNode(),!1);case d._new:return this.parseNew();case d.backQuote:return this.parseTemplate();case d._import:if(this.options.ecmaVersion>=11)return this.parseExprImport(n);else return this.unexpected();default:return this.parseExprAtomDefault()}};A.parseExprAtomDefault=function(){this.unexpected()};A.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword import");if(this.next(),this.type===d.parenL&&!e)return this.parseDynamicImport(t);else if(this.type===d.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name="import",t.meta=this.finishNode(n,"Identifier"),this.parseImportMeta(t)}else this.unexpected()};A.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)if(!this.eat(d.parenR))if(this.expect(d.comma),!this.afterTrailingComma(d.parenR)){if(e.options=this.parseMaybeAssign(),!this.eat(d.parenR)){if(this.expect(d.comma),!this.afterTrailingComma(d.parenR))this.unexpected()}}else e.options=null;else e.options=null;else if(!this.eat(d.parenR)){var t=this.start;if(this.eat(d.comma)&&this.eat(d.parenR))this.raiseRecoverable(t,"Trailing comma is not allowed in import()");else this.unexpected(t)}return this.finishNode(e,"ImportExpression")};A.parseImportMeta=function(e){this.next();var t=this.containsEsc;if(e.property=this.parseIdent(!0),e.property.name!=="meta")this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'");if(t)this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters");if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere)this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module");return this.finishNode(e,"MetaProperty")};A.parseLiteral=function(e){var t=this.startNode();if(t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110)t.bigint=t.value!=null?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"");return this.next(),this.finishNode(t,"Literal")};A.parseParenExpression=function(){this.expect(d.parenL);var e=this.parseExpression();return this.expect(d.parenR),e};A.shouldParseArrow=function(e){return!this.canInsertSemicolon()};A.parseParenAndDistinguishExpression=function(e,t){var n=this.start,i=this.startLoc,r,s=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var l=this.start,o=this.startLoc,a=[],p=!0,c=!1,u=new Ni,f=this.yieldPos,h=this.awaitPos,m;this.yieldPos=0,this.awaitPos=0;while(this.type!==d.parenR)if(p?p=!1:this.expect(d.comma),s&&this.afterTrailingComma(d.parenR,!0)){c=!0;break}else if(this.type===d.ellipsis){if(m=this.start,a.push(this.parseParenItem(this.parseRestBinding())),this.type===d.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else a.push(this.parseMaybeAssign(!1,u,this.parseParenItem));var g=this.lastTokEnd,y=this.lastTokEndLoc;if(this.expect(d.parenR),e&&this.shouldParseArrow(a)&&this.eat(d.arrow))return this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=h,this.parseParenArrowList(n,i,a,t);if(!a.length||c)this.unexpected(this.lastTokStart);if(m)this.unexpected(m);if(this.checkExpressionErrors(u,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=h||this.awaitPos,a.length>1)r=this.startNodeAt(l,o),r.expressions=a,this.finishNodeAt(r,"SequenceExpression",g,y);else r=a[0]}else r=this.parseParenExpression();if(this.options.preserveParens){var E=this.startNodeAt(n,i);return E.expression=r,this.finishNode(E,"ParenthesizedExpression")}else return r};A.parseParenItem=function(e){return e};A.parseParenArrowList=function(e,t,n,i){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,i)};var ty=[];A.parseNew=function(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===d.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var n=this.containsEsc;if(e.property=this.parseIdent(!0),e.property.name!=="target")this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'");if(n)this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block");return this.finishNode(e,"MetaProperty")}var i=this.start,r=this.startLoc;if(e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),i,r,!0,!1),e.callee.type==="Super")this.raiseRecoverable(i,"Invalid use of 'super'");if(this.eat(d.parenL))e.arguments=this.parseExprList(d.parenR,this.options.ecmaVersion>=8,!1);else e.arguments=ty;return this.finishNode(e,"NewExpression")};A.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();if(this.type===d.invalidTemplate){if(!t)this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal");n.value={raw:this.value.replace(/\r\n?/g,`
|
|
31
|
+
}`:`{ ${n} }`}function rm({hasTypeScriptType:e,hasJSDocType:t,inferredType:n,finalType:i}){if(e)return"typescript";if(t)return"jsdoc";if(n!==void 0)return"default";if(i!==void 0)return"inferred";return"unknown"}function An(e){let t=e.explicitType??e.jsdocType??e.resolvedType??e.typeSeed,n=e.jsdocParams??e.resolvedParams,i=e.jsdocReturnType??e.resolvedReturnType;if((e.isFunctionDeclaration||e.initializerIsFunction)&&t===e.typeSeed&&(i||e.isFunctionDeclaration&&n?.length))t=`${e.jsdocTypeParameters?`<${e.jsdocTypeParameters}>`:""}(${ge(n??[])}) => ${i??"any"}`;let s=e.jsdocDescription??e.resolvedDescription;if(s===void 0&&t!==void 0)s=e.typedefs?.get(t)?.description;let l=rm({hasTypeScriptType:e.explicitType!==void 0,hasJSDocType:e.jsdocType!==void 0||e.jsdocParams!==void 0||e.jsdocReturnType!==void 0||e.resolvedType!==void 0,inferredType:e.inferredTypeForSource,finalType:t}),o=e.initializerIsFunction||e.isFunctionDeclaration||!!e.jsdocParams?.length||e.jsdocReturnType!==void 0||ri(e.jsdocType)||ri(e.resolvedType)||ri(e.explicitType),a=o?e.jsdocTypeParameters:void 0;return{type:t,typeSource:l,description:s,params:n,returnType:i,isFunction:o,typeParameters:a}}function wn(e,t,n){if(n?.explicitDefault===void 0)return n;return e.explicitDefaultPropNames.add(t),{...n,description:n.descriptionWithoutDefault}}function Pn(e){return{binding:e?.binding,deprecated:e?.deprecated,tags:e?.tags,...e?.internal?{internal:!0}:{}}}function Ti(e){if(e?.type==="Identifier")return e.name;return typeof e?.value==="string"?e.value:void 0}function Sl(e,t){for(let n of e?.body??[]){let i=n.type==="ExportNamedDeclaration"&&n.declaration?n.declaration:n;if(i.type==="VariableDeclaration"){let r=i.declarations.find((s)=>s.id.type==="Identifier"?s.id.name===t:Q(s.id).has(t));if(r)return{declaration:i,declarator:r,statement:n}}else if((i.type==="FunctionDeclaration"||i.type==="ClassDeclaration")&&i.id?.name===t)return{declaration:i,statement:n}}return}function sm(e){return!e.type.startsWith("TS")}function om(e,t){for(let n of e?.body??[]){if(n.type!=="LabeledStatement"||n.label.name!=="$")continue;if(n.body.type!=="ExpressionStatement")continue;let i=n.body.expression;if(i.type!=="AssignmentExpression"||i.operator!=="=")continue;let{left:r}=i;if(!sm(r))continue;if(!Q(r).has(t))continue;let s={type:"VariableDeclarator",id:r,init:i.right,start:i.start,end:i.end};return{declaration:{type:"VariableDeclaration",kind:"let",declarations:[s],start:n.start,end:n.end},declarator:s,statement:n}}return}function am(e){if(e==="var")return"let";if(e==="using"||e==="await using")return"const";return e}function gs(e,t,n,i,r){let s=Ti(n.local),l=Ti(n.exported);if(!s||!l)return;if(t.source!=null)return{localName:s,exportedName:l};let o=Sl(i,s);if(!o&&r==="instance")o=Sl(e.parsed?.module?.content,s)??om(i,s);return{localName:s,exportedName:l,...o}}function xs(e,t,n,i){let r=t.source?.value,s=typeof r==="string"?`it re-exports from "${r}"`:e.valueImportBindingsByLocalName.has(n)?"it re-exports an imported binding":"no matching local declaration was found";D(e,"export-unresolved",i,`export "${i}" was skipped because ${s}; sveld only resolves exports of a local declaration.`,P(e,t))}function kn(e,t,n){if(!n)return G(e,t);let i=t.specifiers.length===1?G(e,t):void 0,r=G(e,n.statement);if(!i||!r)return i??r;let s=Object.fromEntries(Object.entries(i).filter(([,l])=>l!==void 0));return{...r,...s,internal:i.internal||r.internal}}function Es(e,t,n,i){let r=[];if(t.type==="FunctionDeclaration"){if(!t.id)return r;let o=e.scriptLanguage==="ts"?Ot(e,t,En(t)):void 0;return r.push({prop_name:n?.exportedName??t.id.name,kind:"function",isFunctionDeclaration:!0,value:void 0,typeSeed:o?.hasAnnotations?void 0:Ft(e,t),explicitType:o?.hasAnnotations?o.signature:void 0,initializerIsFunction:!0,isRequired:!1,localName:t.id.name,defaultValue:void 0,inferredTypeForSource:void 0,resolvedJSDoc:void 0}),r}if(t.type!=="VariableDeclaration")return r;let s=am(t.kind),l=n?.declarator?[n.declarator]:t.declarations;for(let{id:o,init:a}of l){if(o.type!=="Identifier"){for(let b of Q(o)){if(n&&n.localName!==b)continue;r.push({prop_name:n?.exportedName??b,kind:s,isFunctionDeclaration:!1,value:void 0,typeSeed:void 0,explicitType:void 0,initializerIsFunction:!1,isRequired:!1,localName:b,defaultValue:void 0,inferredTypeForSource:void 0,resolvedJSDoc:void 0})}continue}let p=o.name,c=n?.exportedName??p,u=a==null?{isFunction:!1}:Ee(e,a),{value:f,isFunction:h,defaultValue:m}=u,g=s==="const"&&(a?.type==="ObjectExpression"||a?.type==="ArrayExpression")&&!e.typeCasts.constAssertions.has(a),S=(s==="const"&&(a?.type==="ArrowFunctionExpression"||a?.type==="FunctionExpression")?Ft(e,a):void 0)??(g?Se(a,"literal"):void 0)??u.type;xi(e,u,c,i),r.push({prop_name:c,kind:s,isFunctionDeclaration:!1,value:f,typeSeed:S,explicitType:lm(e,o),initializerIsFunction:h,isRequired:s==="let"&&a==null,localName:p,defaultValue:m,inferredTypeForSource:S,resolvedJSDoc:u})}return r}function lm(e,t){return O(e,t.typeAnnotation?.typeAnnotation),le(e,t.typeAnnotation)}function Ss(e,t,n){let{resolvedJSDoc:i}=t;return An({explicitType:t.explicitType,typeSeed:t.typeSeed,inferredTypeForSource:t.inferredTypeForSource,jsdocType:n?.type,jsdocDescription:n?.description,jsdocParams:n?.params,jsdocReturnType:n?.returnType,jsdocTypeParameters:n?.typeParameters,resolvedType:i?.resolvedType,resolvedDescription:i?.resolvedDescription,resolvedParams:i?.resolvedParams,resolvedReturnType:i?.resolvedReturnType,initializerIsFunction:t.initializerIsFunction,isFunctionDeclaration:t.isFunctionDeclaration,typedefs:e.typedefs})}function pm(e,t,n){D(e,"export-unresolved",n,`export "${n}" was skipped because a class can't be a prop; export it from the module script instead.`,P(e,t))}function Tl(e,t,n,i){if(n.type==="ClassDeclaration"){if(n.id)pm(e,t,i?.exportedName??n.id.name);return}let r=Es(e,n,i,"props");if(r.length===0)return;let s=kn(e,t,i);for(let l of r){let{prop_name:o,kind:a,localName:p}=l,c=wn(e,o,s),{type:u,typeSource:f,description:h,params:m,returnType:g,isFunction:y,typeParameters:S}=Ss(e,l,c);rn(e,o,s?.sveldIgnore),hn(e,o,{name:o,...p!==void 0&&p!==o?{localName:p}:{},kind:a,description:h,...Pn(s),type:u,typeSource:f,value:c?.explicitDefault??l.value,defaultValue:l.defaultValue,params:m,returnType:g,typeParameters:S,isFunction:y,isFunctionDeclaration:l.isFunctionDeclaration,isRequired:l.isRequired,constant:a==="const",reactive:e.reactive_vars.has(o),source:P(e,t)})}}function bl(e,t,n){if(t.declaration!=null){Tl(e,t,t.declaration);return}for(let i of t.specifiers){let r=gs(e,t,i,n,"instance");if(!r)continue;if(r.declaration)Tl(e,t,r.declaration,r);else xs(e,t,r.localName,r.exportedName)}}function cm(e){if(!e||typeof e!=="object"||!("type"in e))return;let t=String(e.type),n=$t(t);if(!n&&!ct(t))return;let i="name"in e&&typeof e.name==="string"?e.name:void 0;if(!i)return;if(n)return{type:"InlineComponent",name:i};let r={type:"Element",name:i};if(i==="svelte:element"&&"tag"in e&&j(e.tag)){let{tag:s}=e;if(s.type==="Literal"&&typeof s.value==="string")r.thisValue=s.value}return r}function Cl(e,t,n){let i=cm(t);if(!i)return;if(e.rest_props!==void 0&&!(e.rest_props.type==="InlineComponent"&&i.type==="Element"))return;e.rest_props=i;let r=t&&typeof t==="object"&&"tag"in t?t.tag:void 0;e.restPropsTagLocal=i.name==="svelte:element"&&T(r)?r.name:void 0,e.restPropsSource=P(e,n)}function vl(e,t){let n=Dt(t);if(ye(n,"$derived")){let[i]=n.arguments;n=i?.type==="SpreadElement"?void 0:Dt(i)}if(!se(n))return;for(let i of n.properties){if(i.type!=="SpreadElement"||!T(i.argument))continue;let{name:r}=i.argument;if(r==="$$restProps"||e.restPropLocals.has(r))return r}return}function Al(e,t){let n=new Map;for(let i of t?.content.body??[]){if(i.type==="VariableDeclaration"){for(let{id:l,init:o}of i.declarations){let a=T(l)?vl(e,o):void 0;if(a&&T(l))n.set(l.name,a)}continue}if(i.type!=="LabeledStatement"||i.label.name!=="$")continue;if(i.body.type!=="ExpressionStatement")continue;let r=i.body.expression;if(r.type!=="AssignmentExpression"||r.operator!=="="||!T(r.left))continue;let s=vl(e,r.right);if(s)n.set(r.left.name,s)}return n}var um=/^[A-Za-z_$][\w$]*/,dm=/[A-Za-z_$][\w$]*/g,fm=/^(?:(?:const|in|out)\s+)+/;function wl(e){let t=F(e,",").map((i)=>i.trim()).filter((i)=>i.length>0);if(t.length===0)return null;return[t.map((i)=>i.replace(fm,"").match(um)?.[0]??i).join(", "),t.join(", ")]}function Pl(e,t,n){let i=e.scriptGenericsAttribute?.value;if(!i)return;for(let[r]of i.matchAll(dm)){if(e.typeImportBindingsByLocalName.has(r))t.add(r);if(n.has(r))continue;let s=e.localTypeDeclarationsByName.get(r);if(!s)continue;n.add(r),je(e,s.node,t,n)}}function bi(e,t,n){if(e.generics)e.generics=[`${e.generics[0]}, ${t}`,`${e.generics[1]}, ${n}`];else e.generics=[t,n]}function kl(e){if(!Array.isArray(e.value))return;return e.value.map((t)=>t.type==="Text"?t.data:"").join("").trim()}function _l(e){let t=[e.instance,e.module].filter((i)=>i!==void 0),n=!1;for(let i of t){let r=i.attributes.find((s)=>s.name==="lang");if(!r){n=!0;continue}if(kl(r)?.toLowerCase()==="ts")return"ts"}return n?"js":void 0}function Nl(e,t){let n=t.instance?.attributes.find((s)=>s.name==="generics");if(!n)return;let i=P(e,n),r=kl(n);if(!r)return;return{value:r,source:i}}var Dl=/[A-Za-z_$][\w$]*/y,hm=/[\w$]/,mm=/^\s*\??\s*:/,ym=/(?:^|[{;,(\n]|\breadonly)\s*$/,gm=/^\s*\[/,xm=/\b(?:keyof|readonly|unique)\s+$/,Em=/&\s*$/,Sm=/^\s*&/,Tm=/(?:\||\bextends)\s*$/,bm=/^\s*(?:\||extends\b)/,vm=/^(?:keyof|readonly|unique|typeof|infer)\s/,Cm=/^(?:abstract\s+)?new\b/,Am=Mt(["TSTypeLiteral","TSInterfaceDeclaration","TSTypeAliasDeclaration","TSParenthesizedType","TSTypeReference","TSIntersectionType"]);function wm(e){let t=e.trim();if(It(t)!==-1||tn(t,"?")!==-1||Cm.test(t))return 4;if(F(t,"|").length>1)return 3;if(F(t,"&").length>1)return 2;return vm.test(t)?1:0}function Pm(e,t){if(gm.test(t))return 0;if(xm.test(e))return 1;if(Em.test(e)||Sm.test(t))return 2;if(Tm.test(e)||bm.test(t))return 3;return 4}function km(e,t){for(let n=t+1;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===e[t])return n+1;return e.length}function _m(e,t){for(let n=t;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]==="`")return{end:n+1,opensExpression:!1};else if(e[n]==="$"&&e[n+1]==="{")return{end:n+2,opensExpression:!0};return{end:e.length,opensExpression:!1}}function Nm(e,t){if(t.size===0)return e;let n="",i=[],r=0;while(r<e.length){let s=e[r],l=i.length-1;if(s==='"'||s==="'"){let f=km(e,r);n+=e.slice(r,f),r=f;continue}if(s==="`"||s==="}"&&i[l]===0){if(s==="}")i.pop();let{end:f,opensExpression:h}=_m(e,r+1);if(h)i.push(0);n+=e.slice(r,f),r=f;continue}if(l>=0&&s==="{")i[l]++;if(l>=0&&s==="}")i[l]--;Dl.lastIndex=r;let o=hm.test(e[r-1]??"")?void 0:Dl.exec(e)?.[0];if(!o){n+=s,r++;continue}r+=o.length;let a=t.get(o),p=e.slice(0,r-o.length),c=e.slice(r),u=p.trimEnd();if(a===void 0||u.endsWith(".")&&!u.endsWith("...")||ym.test(p)&&mm.test(c))n+=o;else n+=wm(a)>Pm(p,c)?`(${a})`:a}return n}function Dm(e,t,n){let i=new Map,r=t.type==="TSInterfaceDeclaration"||t.type==="TSTypeAliasDeclaration"?t.typeParameters?.params:void 0,s=n.typeArguments?.params;if(!r?.length||!s?.length)return i;for(let l=0;l<r.length;l++){let o=r[l]?.name,a=s[l];if(!o||a?.start===void 0||a?.end===void 0)continue;let p=W(e,a.start,a.end)?.trim();if(p)i.set(o,p)}return i}function vi(e,t,n,i=new Set){let r=new Map;if(!t?.type)return r;let s=(o)=>{for(let a of o){if(a?.type!=="TSPropertySignature"||a.computed||!a.key)continue;let p=X(a.key);if(!p)continue;let c=a.typeAnnotation?.start,u=a.typeAnnotation?.end;if(c===void 0||u===void 0)continue;let f=W(e,c+1,u)?.trim();if(!f)continue;O(e,a.typeAnnotation?.typeAnnotation);let h=G(e,a);r.set(p,{type:f,optional:a.optional===!0,source:P(e,a),...h?{jsdoc:h}:{}})}},l=(o)=>{let a=vi(e,o,n,i);for(let[p,c]of a)r.set(p,c)};if(!Am(t))return r;switch(t.type){case"TSTypeLiteral":s(t.members??[]);break;case"TSInterfaceDeclaration":for(let o of t.extends??[]){let a={type:"TSTypeReference",typeName:o.expression,typeArguments:o.typeParameters,start:o.start,end:o.end};l(a)}s(t.body?.body??[]);break;case"TSTypeAliasDeclaration":case"TSParenthesizedType":l(t.typeAnnotation);break;case"TSTypeReference":{let o=$a(t.typeName);if(!o||i.has(o))break;let a=n.get(o);if(!a)break;i.add(o);let p=vi(e,a,n,i);i.delete(o);let c=Dm(e,a,t);for(let[u,f]of p)r.set(u,c.size===0?f:{...f,type:Nm(f.type,c)});break}case"TSIntersectionType":for(let o of t.types??[])l(o);break}return r}function $l(e){return new Map(Array.from(e.localTypeDeclarationsByName,([t,n])=>[t,n.node]))}function $m(e){let t={};for(let[n,i]of Object.entries(e))t[n]={...i.attribute===void 0?{}:{attribute:i.attribute},...i.reflect===void 0?{}:{reflect:i.reflect},...i.type===void 0?{}:{type:i.type}};return t}function Ts(e,t,n){if(t.type==="ImportDeclaration"&&t.source?.value)for(let i of t.specifiers){let r=i.type==="ImportSpecifier";if(t.importKind!=="type"&&!(r&&i.importKind==="type"))continue;let s=i.local.name;e.typeImportBindingsByLocalName.set(s,{importedName:r?yi(i):void 0,localName:s,source:String(t.source.value),specifierType:r?"named":i.type==="ImportDefaultSpecifier"?"default":"namespace"})}if(t.type==="TSEnumDeclaration"||t.type==="TSInterfaceDeclaration"||t.type==="TSTypeAliasDeclaration"){let i=t.type==="TSEnumDeclaration"?Ra(e,t):W(e,t.start,t.end)?.trim();e.localTypeDeclarationsByName.set(t.id.name,{code:i??"",node:t,start:t.start,...n?{exported:n}:{}})}}function Il(e,t){if(e.runesPropsDeclarationMetadataByDeclaratorStart.clear(),e.explicitVariableTypesByName.clear(),e.explicitVariableTypeNodesByName.clear(),e.typeImportBindingsByLocalName.clear(),e.localTypeDeclarationsByName.clear(),e.additionalTypeDependencyNodes.length=0,e.typedRunesPropsDeclarations.length=0,!e.source)return;e.scriptLanguage=_l(t);let n=t.options?.customElement;e.customElementTag=n?.tag,e.customElement=n?{...n.tag===void 0?{}:{tag:n.tag},...n.shadow==="open"||n.shadow==="none"?{shadow:n.shadow}:{},...n.props?{props:$m(n.props)}:{},...n.extend===void 0?{}:{extend:!0}}:void 0,e.runesOptionOverride=t.options?.runes,e.scriptGenericsAttribute=Nl(e,t);let i=new Set;for(let s of t.module?.content.body??[]){if(!s?.type)continue;if(s.type==="ExportNamedDeclaration"&&s.declaration)Ts(e,s.declaration,!0);else if(s.type==="ExportNamedDeclaration"&&!s.source)for(let l of s.specifiers){if(l.local.type!=="Identifier"||l.exported.type!=="Identifier")continue;if(l.local.name===l.exported.name)i.add(l.local.name)}else Ts(e,s,!1)}for(let s of i){let l=e.localTypeDeclarationsByName.get(s);if(l)l.exported=!0}let r=t.instance?.content.body??[];for(let s of r){if(Ts(e,s,!1),s.type!=="VariableDeclaration")continue;for(let{id:l}of s.declarations){if(l.type!=="Identifier")continue;let o=le(e,l.typeAnnotation);if(!o)continue;let a=l.typeAnnotation?.typeAnnotation;if(e.explicitVariableTypesByName.set(l.name,o),a)e.explicitVariableTypeNodesByName.set(l.name,a)}}for(let s of r){if(s.type!=="VariableDeclaration")continue;for(let l of s.declarations){if(!ye(Dt(l.init),"$props"))continue;let o="typeAnnotation"in l.id?l.id.typeAnnotation:void 0,a=o?void 0:fa(l.init),p=o?.typeAnnotation??a,c=o?le(e,o):ut(e,a),u=vi(e,p,$l(e)),f=new Set,h=new Set;je(e,p,f,h),Pl(e,f,h);let m={canonicalType:c,props:u,referencedImportedTypes:f,referencedLocalTypes:h};if(e.runesPropsDeclarationMetadataByDeclaratorStart.set(l.start,m),c)e.typedRunesPropsDeclarations.push(m)}}}function Im(e,t){let n=t?.trim();if(!n)return;let i=e.typedefMembersByName.get(n)??Ge(n,{skipIndexSignatures:!0});return i?new Map(i.map((r)=>[r.name,r])):void 0}function Lm(e){return ye(e,"$bindable")?{init:e.arguments[0],bindable:!0}:{init:e,bindable:!1}}function Ll(e,t){for(let n of t.declarations){if(!ye(n.init,"$props"))continue;let i=e.runesPropsDeclarationMetadataByDeclaratorStart.get(n.start),r=G(e,t),s=i?.props.size?void 0:Im(e,r?.type);if(n.id.type==="Identifier"){e.wholePropsLocals.add(n.id.name),e.restPropLocals.add(n.id.name);let o=[...Array.from(s?.values()??[],(a)=>({name:a.name,member:a,typeMetadata:void 0})),...Array.from(i?.props??[],([a,p])=>({name:a,member:void 0,typeMetadata:p}))];for(let{name:a,member:p,typeMetadata:c}of o){let u=wn(e,a,c?.jsdoc),{type:f,typeSource:h,description:m,params:g,returnType:y,isFunction:S}=An({explicitType:c?.type,jsdocType:u?.type??p?.type,jsdocDescription:u?.description??p?.description,jsdocParams:u?.params,jsdocReturnType:u?.returnType,initializerIsFunction:!1,isFunctionDeclaration:!1,typedefs:e.typedefs});rn(e,a,u?.sveldIgnore),hn(e,a,{name:a,kind:"let",description:m,...Pn(u),type:f,typeSource:h,value:u?.explicitDefault,params:g,returnType:y,isFunction:S,isFunctionDeclaration:!1,isRequired:!(c?.optional??p?.optional),constant:!1,reactive:!1,source:c?.source})}continue}if(n.id.type!=="ObjectPattern")continue;let l=n.id.properties.filter((o)=>{if(o.type!=="Property"||o.computed)return!1;if(!X(o.key))return!1;if(o.value.type==="Identifier")return!0;return o.value.type==="AssignmentPattern"&&o.value.left.type==="Identifier"}).length;for(let o of n.id.properties){if(o.type==="RestElement"){if(o.argument.type==="Identifier")e.restPropLocals.add(o.argument.name);continue}let a=X(o.key);if(!a)continue;let p,c;if(o.value.type==="Identifier")p=o.value.name;else{let Me=o.value;p=Me.left.name,c=Me.right}if(!p)continue;if(si(e,a,p),a==="children")e.snippetPropLocals.add(p);let u=s?.get(a),f=i?.props.get(a),h=wn(e,a,G(e,o)??f?.jsdoc??(l===1&&!s?r:void 0)),{init:m,bindable:g}=Lm(c),y=m==null?{isFunction:!1}:Ee(e,m),{value:S,type:b,isFunction:M,defaultValue:v}=y,Y=f?.type===void 0&&h?.type===void 0?y.resolvedType:void 0;xi(e,y,a,"props");let{type:me,typeSource:Le,description:At,params:Re,returnType:wt,isFunction:C}=An({explicitType:f?.type,typeSeed:b,inferredTypeForSource:b,jsdocType:h?.type??u?.type,jsdocDescription:h?.description??u?.description,jsdocParams:h?.params,jsdocReturnType:h?.returnType,resolvedType:Y,resolvedDescription:y.resolvedDescription,resolvedParams:y.resolvedParams,resolvedReturnType:y.resolvedReturnType,initializerIsFunction:M,isFunctionDeclaration:!1,typedefs:e.typedefs});if(g)e.reactive_vars.add(a);rn(e,a,h?.sveldIgnore),hn(e,a,{name:a,...p===a?{}:{localName:p},kind:"let",description:At,...Pn(h),...g?{bindable:!0}:{},type:me,typeSource:Le,value:h?.explicitDefault??S,defaultValue:v,params:Re,returnType:wt,isFunction:C,isFunctionDeclaration:!1,isRequired:!g&&m==null&&f?.optional!==!0&&u?.optional!==!0,constant:!1,reactive:g,source:P(e,o)})}}}function Rm(e){let n=e.indexOf("EventDispatcher");if(n===-1)return;let i=n+15;while(e[i]===" ")i++;if(e[i]!=="<")return;let r=Ke(e,i);return r===-1?void 0:e.slice(i+1,r)}var Mm=/^["']|["']$/g,Om=/\?$/,Bm=/^\{/,Fm=/\}$/;function Vm(e){let t=tn(e,":");if(t===-1)return;let n=e.slice(0,t).trim().replace(Om,"").replace(Mm,""),i=e.slice(t+1).trim();if(!n||!i)return;return{name:n,type:i}}function Rl(e,t,n,i){if(t){for(let[o,a]of vi(e,t,$l(e)))e.typedDispatcherEventNames.add(o),Qe(e,{name:o,detail:a.type,has_argument:!0,source:a.source});return}let r=xe(e,n)?.type,s=r?Rm(r):void 0;if(!s)return;let l=s.trim().replace(Bm,"").replace(Fm,"");for(let o of F(l,";,")){let a=Vm(o.trim());if(!a)continue;e.typedDispatcherEventNames.add(a.name),Qe(e,{name:a.name,detail:a.type,has_argument:!0,source:i})}}function Ml(e,t){if(e.syntaxMode!=="runes")return;for(let[n,i]of Array.from(e.events.entries())){if(i.type!=="dispatched")continue;if(t.has(n)||e.forwardedEvents.has(n))continue;let r=`on${n}`,s=e.props.get(r);if(!s)continue;let l=s.type!==void 0||s.params!==void 0||s.returnType!==void 0,o=i.detail===void 0||i.detail==="undefined"||i.detail==="null"?"() => void":`(detail: ${i.detail}) => void`;e.props.set(r,{...s,description:s.description??i.description,type:l?s.type:o,typeSource:l?s.typeSource:"inferred",isFunction:!0}),e.events.delete(n)}}var Ze=null;function et(e){return!e||e==="default"?Ze:e}function bs(e,t){switch(t.type){case"Identifier":return{value:t.name,replace:!0};case"Literal":return{value:typeof t.value==="string"?JSON.stringify(t.value):String(t.value),replace:!1};case"MemberExpression":return{value:Va(e,t),replace:!1};case"ObjectExpression":case"TemplateLiteral":return{value:W(e,t.start,t.end),replace:!1};case"ArrayExpression":case"ArrayPattern":case"ArrowFunctionExpression":case"AssignmentExpression":case"AssignmentPattern":case"AwaitExpression":case"BinaryExpression":case"CallExpression":case"ChainExpression":case"ClassExpression":case"ConditionalExpression":case"FunctionExpression":case"ImportExpression":case"LogicalExpression":case"MetaProperty":case"NewExpression":case"ObjectPattern":case"RestElement":case"SequenceExpression":case"TaggedTemplateExpression":case"ThisExpression":case"TSAsExpression":case"TSInstantiationExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"UnaryExpression":case"UpdateExpression":case"YieldExpression":break}return{value:void 0,replace:!1}}function jm(e,t,n){if(!T(t))return null;let i=Bt(e,t.name);if(se(i))return Cs(e,i,n).slot_props;let r=dt(e,t.name);if(!r)return null;let s=Ge(r.type);if(!s)return null;let l={};for(let o of s)l[o.name]={value:o.type,replace:!1};return l}function vs(e,t,n,i,r){let s=jm(e,n,r);if(s)return Object.assign(t,s),!0;if(r)return!1;return D(e,"spread-unresolved","slot_props",`Slot props spread a value sveld can't resolve; its shape is widened to "Record<string, any>".`,P(e,i)),!1}function Cs(e,t,n){let i={},r=!1;for(let s of t.properties){if(s.type==="SpreadElement"){if(!vs(e,i,s.argument,s,n))r=!0;continue}if(s.type!=="Property"||s.computed)continue;let l=X(s.key);if(!l)continue;i[l]=bs(e,s.value)}return{slot_props:i,hasUnresolvedSpread:r}}function Gm(e,t){if(t.type==="Identifier"){let r=e.propLocalToPublicName.get(t.name);return r?{publicName:r,trackingName:t.name}:null}if(t.type!=="MemberExpression")return null;if(t.object.type!=="Identifier"||!e.wholePropsLocals.has(t.object.name))return null;let{property:n}=t,i;if(!t.computed&&n.type==="Identifier")i=n.name;else if(n.type==="Literal"&&n.value!=null)i=String(n.value);return i?{publicName:i,trackingName:i}:null}function As(e){return e.type==="ChainExpression"?e.expression:e}function Ol(e,t){let n=As(t),i=Gm(e,n.callee);return i&&{...i,arguments:n.arguments}}function _n(e,{slot_name:t,slot_props:n,slot_props_unresolved_spread:i,slot_fallback:r,slot_description:s,slot_deprecated:l,slot_tags:o,slot_internal:a,source:p}){let c=et(t),u=e.slots.get(c);e.slots.set(c,{name:c,default:u?.default??c===Ze,fallback:r||void 0,slot_props:u?.slot_props??(n===""?void 0:n),slot_props_unresolved_spread:u?.slot_props_unresolved_spread||i,description:u?.description||s?.trim()||void 0,deprecated:u?.deprecated??l,tags:u?.tags||o,...u?.internal||a?{internal:!0}:{},source:p||u?.source})}var Bl=/^@component/,Wm=/\r/g,Hm=Mt(["AssignmentExpression","UpdateExpression","CallExpression","SpreadAttribute","FunctionDeclaration","ImportDeclaration","VariableDeclaration","ExportNamedDeclaration","Comment","SlotElement","RenderTag","OnDirective","BindDirective"]);function Fl(e){return e&&"id"in e&&e.id&&"name"in e.id?e.id.name:void 0}function Um(e,t,n,i){let r=n.callee.type==="Identifier"?n.callee.name:void 0;if(r==="createEventDispatcher"){let s=Fl(i);if(s!==void 0)t.dispatcherName=s,t.dispatcherDeclaratorNode=i;t.dispatcherTypeArgument=n.typeArguments?.params?.[0]}if(r==="$host"){let s=Fl(i);if(s!==void 0)t.hostLocalNames.add(s)}if(r==="setContext")fl(e,n,i?.type==="ExpressionStatement"?i:null);if(n.arguments.length>0){if(t.callsWithArguments.push(n),Si(e,n.callee))t.locallyBoundCalls.add(n)}if(r)t.callees.push({name:r,arguments:n.arguments,node:n,nestedBoundDetailNames:vn(e,n.arguments[1])});if(ze(n.callee)&&T(n.callee.property)&&n.callee.property.name==="dispatchEvent"&&(ye(n.callee.object,"$host")||T(n.callee.object)&&t.hostLocalNames.has(n.callee.object.name))){let s=xl(e,n);if(s)t.hostDispatchedEventNames.add(s.name),t.hostDispatches.push(s)}}function qm(e,t){let n=Array.isArray(t)?t[0]:t;if(n?.type==="Text")return{value:JSON.stringify(n.raw),replace:!1};if(n?.type==="ExpressionTag")return bs(e,n.expression);return{value:void 0,replace:!1}}function zm(e,t){let n=t.attributes.find((p)=>("name"in p)&&p.name==="name"),i=n&&"value"in n?n.value:void 0,r=Array.isArray(i)?i[0]:void 0,s=r?.type==="Text"?r.data:void 0,l={},o=!1;for(let p of t.attributes){if(p.type==="SpreadAttribute"){let c=e.jsDocSlots.has(et(s));if(!vs(e,l,p.expression,p,c))o=!0;continue}if(!("value"in p)||p.name==="name"||p.value===!0)continue;l[p.name]=qm(e,p.value)}let a=t.fragment.nodes.map(({start:p,end:c})=>W(e,p,c)??"").join("").trim();e.renderedSlots.add(et(s)),_n(e,{slot_name:s,slot_props:l,slot_props_unresolved_spread:o||void 0,slot_fallback:a,source:P(e,t)})}function Km(e,t){let n=Ol(e,t.expression);if(!n){let{callee:a}=As(t.expression);if(ze(a)&&T(a.object)&&e.wholePropsLocals.has(a.object.name))e.slotsUntracked=!0;return}let i=n.publicName==="children"?void 0:n.publicName,[r,...s]=n.arguments,l,o=!1;if(r===void 0)l={};else if(s.length===0&&r.type==="ObjectExpression"){let a=Cs(e,r,e.jsDocSlots.has(et(i)));l=a.slot_props,o=a.hasUnresolvedSpread}if(e.renderedSlots.add(et(i)),l!==void 0)_n(e,{slot_name:i,slot_props:l,slot_props_unresolved_spread:o||void 0,source:P(e,t)});if(l!==void 0||e.slots.has(i??Ze))e.snippetPropLocals.add(n.trackingName)}function Jm(e,t,n){let i=t.name;if(t.expression!=null||!i)return;if(n==null||!("name"in n)||typeof n.name!=="string"||!n.name)return;let r=$t(n.type)?{type:"InlineComponent",name:n.name}:{type:"Element",name:n.name};e.forwardedEvents.set(i,r);let s=e.events.get(i),l=e.eventDescriptions.get(i);if(!s)e.events.set(i,{type:"forwarded",name:i,element:r,description:l,deprecated:void 0,source:P(e,t)});else if(s.type==="forwarded"&&l&&!s.description)e.events.set(i,{...s,description:l,source:s.source||P(e,t)})}function Xm(e){let{expression:t}=e;if(t.type==="Identifier")return{name:t.name,indexed:!1};if(t.type!=="MemberExpression")return;let n=t;while(n.type==="MemberExpression")n=n.object;if(n.type!=="Identifier")return;let i=e.name==="this"&&t.computed&&t.object.type==="Identifier";return{name:n.name,indexed:i}}function Ym(e,t,n,i){if(!n||!(ct(n.type)||$t(n.type)))return;let r=Xm(t);if(!r)return;let s=Ei(e,r.name);if(!s)return;e.reactive_vars.add(s);let l=t.expression.type==="MemberExpression";if(t.name!=="this"||l&&!r.indexed)return;if(!("name"in n)||typeof n.name!=="string")return;let o=r.indexed?"indexed":"direct",a=e.bindings.get(s)??{elements:[],components:[],target:o};if(a.target!==o)a.target="mixed";if(ct(n.type)){let p=n.name,c="tag"in n&&T(n.tag)?n.tag.name:void 0;if(!a.elements.some((f)=>f.tag===p&&f.namespace===i&&f.tagLocal===c))a.elements.push({tag:p,namespace:i,...c?{tagLocal:c}:{}})}else{let p=n.type==="Component"?fn(e,n.name):void 0;if(!p)return;if(!a.components.includes(n.name))a.components.push(n.name);e.additionalImportedTypes.set(n.name,{localName:n.name,...p})}e.bindings.set(s,a)}function Vl(e){let t={dispatcherName:void 0,dispatcherDeclaratorNode:void 0,dispatcherTypeArgument:void 0,hostLocalNames:new Set,hostDispatchedEventNames:new Set,hostDispatches:[],callees:[],callsWithArguments:[],locallyBoundCalls:new Set};tl(e),e.activeScopes.push(e.componentScope);let n=nl(e),i=new WeakMap,r=e.parsed?.options?.namespace,s=[r==="svg"||r==="mathml"?r:"html"],l=new Map,o={enter(a,p){if(mi(a.type))return re;let c=il(e,n,a);if(c)e.activeScopes.push(c);if(ct(a.type)){let u="name"in a?a.name:void 0,f=u==="svg"?"svg":u==="math"?"mathml":s[s.length-1];i.set(a,f),s.push(u==="foreignObject"?"html":f)}if(!Hm(a))return;switch(a.type){case"AssignmentExpression":fs(e,a.left);break;case"UpdateExpression":fs(e,a.argument);break;case"CallExpression":Um(e,t,a,p);break;case"SpreadAttribute":{let u=a.expression.type==="Identifier"?a.expression.name:void 0,f=(u!==void 0&&!mt(e,u)?l.get(u):void 0)??u,h=e.restPropLocals.has(f??"");if(f==="$$restProps"||h)Cl(e,p,a);if((f==="$$props"||h)&&p&&$t(p.type))e.slotsUntracked=!0;break}case"FunctionDeclaration":if(a.id?.name)e.funcDecls.set(a.id.name,a);break;case"ImportDeclaration":un(e,a);break;case"VariableDeclaration":if(e.vars.add(a),p?.type==="Program"&&a.declarations.some((u)=>ye(u.init,"$props")))Ll(e,a);break;case"ExportNamedDeclaration":bl(e,a,p?.type==="Program"?p:null);break;case"Comment":{let u=a.data.trim();if(Bl.test(u))e.componentComment=u.replace(Bl,"").replace(Wm,""),e.componentCommentSource=P(e,a);break}case"SlotElement":zm(e,a);break;case"RenderTag":Km(e,a);break;case"OnDirective":Jm(e,a,p);break;case"BindDirective":Ym(e,a,p,(p&&i.get(p))??"html");break}},leave(a){if(ct(a.type))s.pop();if(jt(a))e.activeScopes.pop(),rl(n,a)}};if(e.parsed?.instance)K(e.parsed.instance,o);if(l=Al(e,e.parsed?.instance),e.parsed?.fragment)K(e.parsed.fragment,o);return t}var ws={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Ps="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",Qm={5:Ps,"5module":Ps+" export import",6:Ps+" const class extends export import super"},Ul=/^in(stanceof)?$/,Zm=/\p{ID_Start}/u,ey=/[\p{ID_Continue}\u200c\u200d]/u;function be(e,t){if(e<65)return e===36;if(e<91)return!0;if(e<97)return e===95;if(e<123)return!0;if(e>65535&&t===!1)return!1;return e>=170&&Zm.test(String.fromCodePoint(e))}function Ne(e,t){if(e<48)return e===36;if(e<58)return!0;if(e<65)return!1;if(e<91)return!0;if(e<97)return e===95;if(e<123)return!0;if(e>65535&&t===!1)return!1;return e>=170&&ey.test(String.fromCodePoint(e))}var I=function(e,t){if(t===void 0)t={};this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function pe(e,t){return new I(e,{beforeExpr:!0,binop:t})}var ce={beforeExpr:!0},Z={startsExpr:!0},Ds={};function N(e,t){if(t===void 0)t={};return t.keyword=e,Ds[e]=new I(e,t)}var d={num:new I("num",Z),regexp:new I("regexp",Z),string:new I("string",Z),name:new I("name",Z),privateId:new I("privateId",Z),eof:new I("eof"),bracketL:new I("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new I("]"),braceL:new I("{",{beforeExpr:!0,startsExpr:!0}),braceR:new I("}"),parenL:new I("(",{beforeExpr:!0,startsExpr:!0}),parenR:new I(")"),comma:new I(",",ce),semi:new I(";",ce),colon:new I(":",ce),dot:new I("."),question:new I("?",ce),questionDot:new I("?."),arrow:new I("=>",ce),template:new I("template"),invalidTemplate:new I("invalidTemplate"),ellipsis:new I("...",ce),backQuote:new I("`",Z),dollarBraceL:new I("${",{beforeExpr:!0,startsExpr:!0}),eq:new I("=",{beforeExpr:!0,isAssign:!0}),assign:new I("_=",{beforeExpr:!0,isAssign:!0}),incDec:new I("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new I("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:pe("||",1),logicalAND:pe("&&",2),bitwiseOR:pe("|",3),bitwiseXOR:pe("^",4),bitwiseAND:pe("&",5),equality:pe("==/!=/===/!==",6),relational:pe("</>/<=/>=",7),bitShift:pe("<</>>/>>>",8),plusMin:new I("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:pe("%",10),star:pe("*",10),slash:pe("/",10),starstar:new I("**",{beforeExpr:!0}),coalesce:pe("??",1),_break:N("break"),_case:N("case",ce),_catch:N("catch"),_continue:N("continue"),_debugger:N("debugger"),_default:N("default",ce),_do:N("do",{isLoop:!0,beforeExpr:!0}),_else:N("else",ce),_finally:N("finally"),_for:N("for",{isLoop:!0}),_function:N("function",Z),_if:N("if"),_return:N("return",ce),_switch:N("switch"),_throw:N("throw",ce),_try:N("try"),_var:N("var"),_const:N("const"),_while:N("while",{isLoop:!0}),_with:N("with"),_new:N("new",{beforeExpr:!0,startsExpr:!0}),_this:N("this",Z),_super:N("super",Z),_class:N("class",Z),_extends:N("extends",ce),_export:N("export"),_import:N("import",Z),_null:N("null",Z),_true:N("true",Z),_false:N("false",Z),_in:N("in",{beforeExpr:!0,binop:7}),_instanceof:N("instanceof",{beforeExpr:!0,binop:7}),_typeof:N("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:N("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:N("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},ee=/\r\n?|\n|\u2028|\u2029/,ty=new RegExp(ee.source,"g");function Gt(e){return e===10||e===13||e===8232||e===8233}function ql(e,t,n){if(n===void 0)n=e.length;for(var i=t;i<n;i++){var r=e.charCodeAt(i);if(Gt(r))return i<n-1&&r===13&&e.charCodeAt(i+1)===10?i+2:i+1}return-1}var zl=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,H=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ny=Object.prototype,{hasOwnProperty:iy,toString:ry}=ny,$n=Object.hasOwn||function(e,t){return iy.call(e,t)},jl=Array.isArray||function(e){return ry.call(e)==="[object Array]"},Gl=Object.create(null);function Ci(e){return Gl[e]||(Gl[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function ki(e){if(e<=65535)return String.fromCharCode(e);return e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320)}var sy=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Dn=function(e,t){this.line=e,this.column=t};Dn.prototype.offset=function(e){return new Dn(this.line,this.column+e)};var _i=function(e,t,n){if(this.start=t,this.end=n,e.sourceFile!==null)this.source=e.sourceFile};function Kl(e,t){for(var n=1,i=0;;){var r=ql(e,i,t);if(r<0)return new Dn(n,t-i);++n,i=r}}var ks={ecmaVersion:null,sourceType:"script",strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Wl=!1;function oy(e){var t={};for(var n in ks)t[n]=e&&$n(e,n)?e[n]:ks[n];if(t.ecmaVersion==="latest")t.ecmaVersion=1e8;else if(t.ecmaVersion==null){if(!Wl&&typeof console==="object"&&console.warn)Wl=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
32
|
+
Defaulting to 2020, but this will stop working in the future.`);t.ecmaVersion=11}else if(t.ecmaVersion>=2015)t.ecmaVersion-=2009;if(t.allowReserved==null)t.allowReserved=t.ecmaVersion<5;if(!e||e.allowHashBang==null)t.allowHashBang=t.ecmaVersion>=14;if(jl(t.onToken)){var i=t.onToken;t.onToken=function(r){return i.push(r)}}if(jl(t.onComment))t.onComment=ay(t,t.onComment);if(t.sourceType==="commonjs"&&t.allowAwaitOutsideFunction)throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return t}function ay(e,t){return function(n,i,r,s,l,o){var a={type:n?"Block":"Line",value:i,start:r,end:s};if(e.locations)a.loc=new _i(this,l,o);if(e.ranges)a.range=[r,s];t.push(a)}}var yt=1,gt=2,$s=4,Jl=8,Is=16,Xl=32,Ni=64,Yl=128,xt=256,In=512,Ql=1024,Di=yt|gt|xt;function Ls(e,t){return gt|(e?$s:0)|(t?Jl:0)}var Ai=0,Rs=1,We=2,Zl=3,ep=4,tp=5,V=function(e,t,n){this.options=e=oy(e),this.sourceFile=e.sourceFile,this.keywords=Ci(Qm[e.ecmaVersion>=6?6:e.sourceType==="module"?"5module":5]);var i="";if(e.allowReserved!==!0){if(i=ws[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType==="module")i+=" await"}this.reservedWords=Ci(i);var r=(i?i+" ":"")+ws.strict;if(this.reservedWordsStrict=Ci(r),this.reservedWordsStrictBind=Ci(r+" "+ws.strictBind),this.input=String(t),this.containsEsc=!1,this.pos=n||0,this.curLine=1,e.startLocation)this.lineStart=this.pos-e.startLocation.column,this.curLine=e.startLocation.line;else if(n){if(this.lineStart=this.input.lastIndexOf(`
|
|
33
|
+
`,n-1)+1,this.options.locations)this.curLine=this.input.slice(0,this.lineStart).split(ee).length}else this.lineStart=0;if(this.type=d.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType==="module",this.strict=this.inModule||e.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)==="#!")this.skipLineComment(2);this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?gt:yt),this.regexpState=null,this.privateNameStack=[]},ue={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};V.prototype.parse=function(){var e=this,t=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return e.parseTopLevel(t)})};ue.inFunction.get=function(){return(this.currentVarScope().flags>)>0};ue.inGenerator.get=function(){return(this.currentVarScope().flags&Jl)>0};ue.inAsync.get=function(){return(this.currentVarScope().flags&$s)>0};ue.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],n=t.flags;if(n&(xt|In))return!1;if(n>)return(n&$s)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};ue.allowReturn.get=function(){if(this.inFunction)return!0;if(this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&yt)return!0;return!1};ue.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags;return(t&Ni)>0||this.options.allowSuperOutsideMethod};ue.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Yl)>0};ue.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};ue.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],n=t.flags;if(n&(xt|In)||n>&&!(n&Is))return!0}return!1};ue.allowUsing.get=function(){var e=this.currentScope(),t=e.flags;if(t&Ql)return!1;if(!this.inModule&&t&yt)return!1;return!0};ue.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&xt)>0};V.extend=function(){var e=[],t=arguments.length;while(t--)e[t]=arguments[t];var n=this;for(var i=0;i<e.length;i++)n=e[i](n);return n};V.parse=function(e,t){return new this(t,e).parse()};V.parseExpressionAt=function(e,t,n){var i=new this(n,e,t);return i.nextToken(),i.parseExpression()};V.tokenizer=function(e,t){return new this(t,e)};Object.defineProperties(V.prototype,ue);var J=V.prototype,ly=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;J.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){H.lastIndex=e,e+=H.exec(this.input)[0].length;var t=ly.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){H.lastIndex=e+t[0].length;var n=H.exec(this.input),i=n.index+n[0].length,r=this.input.charAt(i);return r===";"||r==="}"||ee.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(r)||r==="!"&&this.input.charAt(i+1)==="="||r==="i"&&py(this,i))}if(e+=t[0].length,H.lastIndex=e,e+=H.exec(this.input)[0].length,this.input[e]===";")e++}};function py(e,t){var n=t+1,i=Math.min(e.input.length,t+11);while(n<i){var r=e.fullCharCodeAt(n);if(!Ne(r,!0))break;n+=r<=65535?1:2}return n===t+2&&e.input.slice(t,n)==="in"||n===t+10&&e.input.slice(t,n)==="instanceof"}J.eat=function(e){if(this.type===e)return this.next(),!0;else return!1};J.isContextual=function(e){return this.type===d.name&&this.value===e&&!this.containsEsc};J.eatContextual=function(e){if(!this.isContextual(e))return!1;return this.next(),!0};J.catchStackOverflow=function(e){try{return e()}catch(t){if(t instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(t.message)||/\btoo much recursion\b/i.test(t.message)))this.raise(this.start,"Not enough stack space to parse input");else throw t}};J.expectContextual=function(e){if(!this.eatContextual(e))this.unexpected()};J.canInsertSemicolon=function(){return this.type===d.eof||this.type===d.braceR||ee.test(this.input.slice(this.lastTokEnd,this.start))};J.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return!0}};J.semicolon=function(){if(!this.eat(d.semi)&&!this.insertSemicolon())this.unexpected()};J.afterTrailingComma=function(e,t){if(this.type===e){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);if(!t)this.next();return!0}};J.expect=function(e){this.eat(e)||this.unexpected()};J.unexpected=function(e){this.raise(e!=null?e:this.start,"Unexpected token")};var $i=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};J.checkPatternErrors=function(e,t){if(!e)return;if(e.trailingComma>-1)this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var n=t?e.parenthesizedAssign:e.parenthesizedBind;if(n>-1)this.raiseRecoverable(n,t?"Assigning to rvalue":"Parenthesized pattern")};J.checkExpressionErrors=function(e,t){if(!e)return!1;var{shorthandAssign:n,doubleProto:i}=e;if(!t)return n>=0||i>=0;if(n>=0)this.raise(n,"Shorthand property assignments are valid only in destructuring patterns");if(i>=0)this.raiseRecoverable(i,"Redefinition of __proto__ property")};J.checkYieldAwaitInDefaultParams=function(){if(this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos))this.raise(this.yieldPos,"Yield expression cannot be a default value");if(this.awaitPos)this.raise(this.awaitPos,"Await expression cannot be a default value")};J.isSimpleAssignTarget=function(e){if(e.type==="ParenthesizedExpression")return this.isSimpleAssignTarget(e.expression);return e.type==="Identifier"||e.type==="MemberExpression"};var x=V.prototype;x.parseTopLevel=function(e){var t=Object.create(null);if(!e.body)e.body=[];while(this.type!==d.eof){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var i=0,r=Object.keys(this.undefinedExports);i<r.length;i+=1){var s=r[i];this.raiseRecoverable(this.undefinedExports[s].start,"Export '"+s+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(e,"Program")};var Ms={kind:"loop"},cy={kind:"switch"};x.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;H.lastIndex=this.pos;var t=H.exec(this.input),n=this.pos+t[0].length,i=this.fullCharCodeAt(n);if(i===91||i===92)return!0;if(e)return!1;if(i===123)return!0;if(be(i)){var r=n;do n+=i<=65535?1:2;while(Ne(i=this.fullCharCodeAt(n)));if(i===92)return!0;var s=this.input.slice(r,n);if(!Ul.test(s))return!0}return!1};x.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;H.lastIndex=this.pos;var e=H.exec(this.input),t=this.pos+e[0].length,n;return!ee.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(Ne(n=this.fullCharCodeAt(t+8))||n===92))};x.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;H.lastIndex=this.pos;var n=H.exec(this.input),i=this.pos+n[0].length;if(ee.test(this.input.slice(this.pos,i)))return!1;if(e){var r=i+5,s;if(this.input.slice(i,r)!=="using"||r===this.input.length||Ne(s=this.fullCharCodeAt(r))||s===92)return!1;H.lastIndex=r;var l=H.exec(this.input);if(i=r+l[0].length,l&&ee.test(this.input.slice(r,i)))return!1}var o=this.fullCharCodeAt(i);if(!be(o)&&o!==92)return!1;var a=i;do i+=o<=65535?1:2;while(Ne(o=this.fullCharCodeAt(i)));if(o===92)return!0;var p=this.input.slice(a,i);if(Ul.test(p))return!1;if(t&&!e&&p==="of"){H.lastIndex=i;var c=H.exec(this.input);if(i=i+c[0].length,this.input.charCodeAt(i)!==61||(o=this.input.charCodeAt(i+1))===61||o===62)return!1}return!0};x.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)};x.isUsing=function(e){return this.isUsingKeyword(!1,e)};x.parseStatement=function(e,t,n){var i=this.type,r=this.startNode(),s;if(this.isLet(e))i=d._var,s="let";switch(i){case d._break:case d._continue:return this.parseBreakContinueStatement(r,i.keyword);case d._debugger:return this.parseDebuggerStatement(r);case d._do:return this.parseDoStatement(r);case d._for:return this.parseForStatement(r);case d._function:if(e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(r,!1,!e);case d._class:if(e)this.unexpected();return this.parseClass(r,!0);case d._if:return this.parseIfStatement(r);case d._return:return this.parseReturnStatement(r);case d._switch:return this.parseSwitchStatement(r);case d._throw:return this.parseThrowStatement(r);case d._try:return this.parseTryStatement(r);case d._const:case d._var:if(s=s||this.value,e&&s!=="var")this.unexpected();return this.parseVarStatement(r,s);case d._while:return this.parseWhileStatement(r);case d._with:return this.parseWithStatement(r);case d.braceL:return this.parseBlock(!0,r);case d.semi:return this.parseEmptyStatement(r);case d._export:case d._import:if(this.options.ecmaVersion>10&&i===d._import){H.lastIndex=this.pos;var l=H.exec(this.input),o=this.pos+l[0].length,a=this.input.charCodeAt(o);if(a===40||a===46)return this.parseExpressionStatement(r,this.parseExpression())}if(!this.options.allowImportExportEverywhere){if(!t)this.raise(this.start,"'import' and 'export' may only appear at the top level");if(!this.inModule)this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")}return i===d._import?this.parseImport(r):this.parseExport(r,n);default:if(this.isAsyncFunction()){if(e)this.unexpected();return this.next(),this.parseFunctionStatement(r,!0,!e)}var p=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(p){if(!this.allowUsing)this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");if(e)this.raise(this.start,"Using declaration is not allowed in single-statement positions");if(p==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.next(),this.parseVar(r,!1,p),this.semicolon(),this.finishNode(r,"VariableDeclaration")}var c=this.value,u=this.parseExpression();if(i===d.name&&u.type==="Identifier"&&this.eat(d.colon))return this.parseLabeledStatement(r,c,u,e);else return this.parseExpressionStatement(r,u)}};x.parseBreakContinueStatement=function(e,t){var n=t==="break";if(this.next(),this.eat(d.semi)||this.insertSemicolon())e.label=null;else if(this.type!==d.name)this.unexpected();else e.label=this.parseIdent(),this.semicolon();var i=0;for(;i<this.labels.length;++i){var r=this.labels[i];if(e.label==null||r.name===e.label.name){if(r.kind!=null&&(n||r.kind==="loop"))break;if(e.label&&n)break}}if(i===this.labels.length)this.raise(e.start,"Unsyntactic "+t);return this.finishNode(e,n?"BreakStatement":"ContinueStatement")};x.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};x.parseDoStatement=function(e){if(this.next(),this.labels.push(Ms),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(d._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6)this.eat(d.semi);else this.semicolon();return this.finishNode(e,"DoWhileStatement")};x.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Ms),this.enterScope(0),this.expect(d.parenL),this.type===d.semi){if(t>-1)this.unexpected(t);return this.parseFor(e,null)}var n=this.isLet();if(this.type===d._var||this.type===d._const||n){var i=this.startNode(),r=n?"let":this.value;return this.next(),this.parseVar(i,!0,r),this.finishNode(i,"VariableDeclaration"),this.parseForAfterInit(e,i,t)}var s=this.isContextual("let"),l=!1,o=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(o){var a=this.startNode();if(this.next(),o==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.parseVar(a,!0,o),this.finishNode(a,"VariableDeclaration"),this.parseForAfterInit(e,a,t)}var p=this.containsEsc,c=new $i,u=this.start,f=t>-1?this.parseExprSubscripts(c,"await"):this.parseExpression(!0,c);if(this.type===d._in||(l=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(t>-1){if(this.type===d._in)this.unexpected(t);e.await=!0}else if(l&&this.options.ecmaVersion>=8){if(f.start===u&&!p&&f.type==="Identifier"&&f.name==="async")this.unexpected();else if(this.options.ecmaVersion>=9)e.await=!1}if(s&&l)this.raise(f.start,"The left-hand side of a for-of loop may not start with 'let'.");return this.toAssignable(f,!1,c),this.checkLValPattern(f),this.parseForIn(e,f)}else this.checkExpressionErrors(c,!0);if(t>-1)this.unexpected(t);return this.parseFor(e,f)};x.parseForAfterInit=function(e,t,n){if((this.type===d._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&t.declarations.length===1){if(this.type===d._in){if((t.kind==="using"||t.kind==="await using")&&!t.declarations[0].init)this.raise(this.start,"Using declaration is not allowed in for-in loops");if(this.options.ecmaVersion>=9&&n>-1)this.unexpected(n)}else if(this.options.ecmaVersion>=9)e.await=n>-1;return this.parseForIn(e,t)}if(n>-1)this.unexpected(n);return this.parseFor(e,t)};x.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,Nn|(n?0:_s),!1,t)};x.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(d._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};x.parseReturnStatement=function(e){if(!this.allowReturn)this.raise(this.start,"'return' outside of function");if(this.next(),this.eat(d.semi)||this.insertSemicolon())e.argument=null;else e.argument=this.parseExpression(),this.semicolon();return this.finishNode(e,"ReturnStatement")};x.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(d.braceL),this.labels.push(cy),this.enterScope(Ql);var t;for(var n=!1;this.type!==d.braceR;)if(this.type===d._case||this.type===d._default){var i=this.type===d._case;if(t)this.finishNode(t,"SwitchCase");if(e.cases.push(t=this.startNode()),t.consequent=[],this.next(),i)t.test=this.parseExpression();else{if(n)this.raiseRecoverable(this.lastTokStart,"Multiple default clauses");n=!0,t.test=null}this.expect(d.colon)}else{if(!t)this.unexpected();t.consequent.push(this.parseStatement(null))}if(this.exitScope(),t)this.finishNode(t,"SwitchCase");return this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};x.parseThrowStatement=function(e){if(this.next(),ee.test(this.input.slice(this.lastTokEnd,this.start)))this.raise(this.lastTokEnd,"Illegal newline after throw");return e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var uy=[];x.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?Xl:0),this.checkLValPattern(e,t?ep:We),this.expect(d.parenR),e};x.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===d._catch){var t=this.startNode();if(this.next(),this.eat(d.parenL))t.param=this.parseCatchClauseParam();else{if(this.options.ecmaVersion<10)this.unexpected();t.param=null,this.enterScope(0)}t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}if(e.finalizer=this.eat(d._finally)?this.parseBlock():null,!e.handler&&!e.finalizer)this.raise(e.start,"Missing catch or finally clause");return this.finishNode(e,"TryStatement")};x.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,"VariableDeclaration")};x.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Ms),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};x.parseWithStatement=function(e){if(this.strict)this.raise(this.start,"'with' in strict mode");return this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};x.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};x.parseLabeledStatement=function(e,t,n,i){for(var r=0,s=this.labels;r<s.length;r+=1){var l=s[r];if(l.name===t)this.raise(n.start,"Label '"+t+"' is already declared")}var o=this.type.isLoop?"loop":this.type===d._switch?"switch":null;for(var a=this.labels.length-1;a>=0;a--){var p=this.labels[a];if(p.statementStart===e.start)p.statementStart=this.start,p.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(i?i.indexOf("label")===-1?i+"label":i:"label"),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")};x.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};x.parseBlock=function(e,t,n){if(e===void 0)e=!0;if(t===void 0)t=this.startNode();if(t.body=[],this.expect(d.braceL),e)this.enterScope(0);while(this.type!==d.braceR){var i=this.parseStatement(null);t.body.push(i)}if(n)this.strict=!1;if(this.next(),e)this.exitScope();return this.finishNode(t,"BlockStatement")};x.parseFor=function(e,t){return e.init=t,this.expect(d.semi),e.test=this.type===d.semi?null:this.parseExpression(),this.expect(d.semi),e.update=this.type===d.parenR?null:this.parseExpression(),this.expect(d.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};x.parseForIn=function(e,t){var n=this.type===d._in;if(this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier"))this.raise(t.start,(n?"for-in":"for-of")+" loop variable declaration may not have an initializer");return e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(d.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,n?"ForInStatement":"ForOfStatement")};x.parseVar=function(e,t,n,i){e.declarations=[],e.kind=n;for(;;){var r=this.startNode();if(this.parseVarId(r,n),this.eat(d.eq))r.init=this.parseMaybeAssign(t);else if(!i&&n==="const"&&!(this.type===d._in||this.options.ecmaVersion>=6&&this.isContextual("of")))this.unexpected();else if(!i&&(n==="using"||n==="await using")&&this.options.ecmaVersion>=17&&this.type!==d._in&&!this.isContextual("of"))this.raise(this.lastTokEnd,"Missing initializer in "+n+" declaration");else if(!i&&r.id.type!=="Identifier"&&!(t&&(this.type===d._in||this.isContextual("of"))))this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value");else r.init=null;if(e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(d.comma))break}return e};x.parseVarId=function(e,t){e.id=t==="using"||t==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?Rs:We,!1)};var Nn=1,_s=2,np=4;x.parseFunction=function(e,t,n,i,r){if(this.initFunction(e),this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!i){if(this.type===d.star&&t&_s)this.unexpected();e.generator=this.eat(d.star)}if(this.options.ecmaVersion>=8)e.async=!!i;if(t&Nn){if(e.id=t&np&&this.type!==d.name?null:this.parseIdent(),e.id&&!(t&_s))this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Rs:We:Zl)}var s=this.yieldPos,l=this.awaitPos,o=this.awaitIdentPos;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ls(e.async,e.generator)),!(t&Nn))e.id=this.type===d.name?this.parseIdent():null;return this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,r),this.yieldPos=s,this.awaitPos=l,this.awaitIdentPos=o,this.finishNode(e,t&Nn?"FunctionDeclaration":"FunctionExpression")};x.parseFunctionParams=function(e){this.expect(d.parenL),e.params=this.parseBindingList(d.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};x.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var i=this.enterClassBody(),r=this.startNode(),s=!1;r.body=[],this.expect(d.braceL);while(this.type!==d.braceR){var l=this.parseClassElement(e.superClass!==null);if(l){if(r.body.push(l),l.type==="MethodDefinition"&&l.kind==="constructor"){if(s)this.raiseRecoverable(l.start,"Duplicate constructor in the same class");s=!0}else if(l.key&&l.key.type==="PrivateIdentifier"&&dy(i,l))this.raiseRecoverable(l.key.start,"Identifier '#"+l.key.name+"' has already been declared")}}return this.strict=n,this.next(),e.body=this.finishNode(r,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};x.parseClassElement=function(e){if(this.eat(d.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),i="",r=!1,s=!1,l="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(d.braceL))return this.parseClassStaticBlock(n),n;if(this.isClassElementNameStart()||this.type===d.star)o=!0;else i="static"}if(n.static=o,!i&&t>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===d.star)&&!this.canInsertSemicolon())s=!0;else i="async";if(!i&&(t>=9||!s)&&this.eat(d.star))r=!0;if(!i&&!s&&!r){var a=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())l=a;else i=a}if(i)n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=i,this.finishNode(n.key,"Identifier");else this.parseClassElementName(n);if(t<13||this.type===d.parenL||l!=="method"||r||s){var p=!n.static&&wi(n,"constructor"),c=p&&e;if(p&&l!=="method")this.raise(n.key.start,"Constructor can't have get/set modifier");n.kind=p?"constructor":l,this.parseClassMethod(n,r,s,c)}else this.parseClassField(n);return n};x.isClassElementNameStart=function(){return this.type===d.name||this.type===d.privateId||this.type===d.num||this.type===d.string||this.type===d.bracketL||this.type.keyword};x.parseClassElementName=function(e){if(this.type===d.privateId){if(this.value==="constructor")this.raise(this.start,"Classes can't have an element named '#constructor'");e.computed=!1,e.key=this.parsePrivateIdent()}else this.parsePropertyName(e)};x.parseClassMethod=function(e,t,n,i){var r=e.key;if(e.kind==="constructor"){if(t)this.raise(r.start,"Constructor can't be a generator");if(n)this.raise(r.start,"Constructor can't be an async method")}else if(e.static&&wi(e,"prototype"))this.raise(r.start,"Classes may not have a static property named prototype");var s=e.value=this.parseMethod(t,n,i);if(e.kind==="get"&&s.params.length!==0)this.raiseRecoverable(s.start,"getter should have no params");if(e.kind==="set"&&s.params.length!==1)this.raiseRecoverable(s.start,"setter should have exactly one param");if(e.kind==="set"&&s.params[0].type==="RestElement")this.raiseRecoverable(s.params[0].start,"Setter cannot use rest params");return this.finishNode(e,"MethodDefinition")};x.parseClassField=function(e){if(wi(e,"constructor"))this.raise(e.key.start,"Classes can't have a field named 'constructor'");else if(e.static&&wi(e,"prototype"))this.raise(e.key.start,"Classes can't have a static field named 'prototype'");if(this.eat(d.eq))this.enterScope(In|Ni),e.value=this.parseMaybeAssign(),this.exitScope();else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};x.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;this.labels=[],this.enterScope(xt|Ni);while(this.type!==d.braceR){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};x.parseClassId=function(e,t){if(this.type===d.name){if(e.id=this.parseIdent(),t)this.checkLValSimple(e.id,We,!1)}else{if(t===!0)this.unexpected();e.id=null}};x.parseClassSuper=function(e){e.superClass=this.eat(d._extends)?this.parseExprSubscripts(null,!1):null};x.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};x.exitClassBody=function(){var e=this.privateNameStack.pop(),{declared:t,used:n}=e;if(!this.options.checkPrivateFields)return;var i=this.privateNameStack.length,r=i===0?null:this.privateNameStack[i-1];for(var s=0;s<n.length;++s){var l=n[s];if(!$n(t,l.name))if(r)r.used.push(l);else this.raiseRecoverable(l.start,"Private field '#"+l.name+"' must be declared in an enclosing class")}};function dy(e,t){var n=t.key.name,i=e[n],r="true";if(t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set"))r=(t.static?"s":"i")+t.kind;if(i==="iget"&&r==="iset"||i==="iset"&&r==="iget"||i==="sget"&&r==="sset"||i==="sset"&&r==="sget")return e[n]="true",!1;else if(!i)return e[n]=r,!1;else return!0}function wi(e,t){var{computed:n,key:i}=e;return!n&&(i.type==="Identifier"&&i.name===t||i.type==="Literal"&&i.value===t)}x.parseExportAllDeclaration=function(e,t){if(this.options.ecmaVersion>=11)if(this.eatContextual("as"))e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart);else e.exported=null;if(this.expectContextual("from"),this.type!==d.string)this.unexpected();if(e.source=this.parseExprAtom(),this.options.ecmaVersion>=16)e.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};x.parseExport=function(e,t){if(this.next(),this.eat(d.star))return this.parseExportAllDeclaration(e,t);if(this.eat(d._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration")this.checkVariableExport(t,e.declaration.declarations);else this.checkExport(t,e.declaration.id,e.declaration.id.start);if(e.specifiers=[],e.source=null,this.options.ecmaVersion>=16)e.attributes=[]}else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from")){if(this.type!==d.string)this.unexpected();if(e.source=this.parseExprAtom(),this.options.ecmaVersion>=16)e.attributes=this.parseWithClause()}else{for(var n=0,i=e.specifiers;n<i.length;n+=1){var r=i[n];if(this.checkUnreserved(r.local),this.checkLocalExport(r.local),r.local.type==="Literal")this.raise(r.local.start,"A string literal cannot be used as an exported binding without `from`.")}if(e.source=null,this.options.ecmaVersion>=16)e.attributes=[]}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};x.parseExportDeclaration=function(e){return this.parseStatement(null)};x.parseExportDefaultDeclaration=function(){var e;if(this.type===d._function||(e=this.isAsyncFunction())){var t=this.startNode();if(this.next(),e)this.next();return this.parseFunction(t,Nn|np,!1,e)}else if(this.type===d._class){var n=this.startNode();return this.parseClass(n,"nullableID")}else{var i=this.parseMaybeAssign();return this.semicolon(),i}};x.checkExport=function(e,t,n){if(!e)return;if(typeof t!=="string")t=t.type==="Identifier"?t.name:t.value;if($n(e,t))this.raiseRecoverable(n,"Duplicate export '"+t+"'");e[t]=!0};x.checkPatternExport=function(e,t){var n=t.type;if(n==="Identifier")this.checkExport(e,t,t.start);else if(n==="ObjectPattern")for(var i=0,r=t.properties;i<r.length;i+=1){var s=r[i];this.checkPatternExport(e,s)}else if(n==="ArrayPattern")for(var l=0,o=t.elements;l<o.length;l+=1){var a=o[l];if(a)this.checkPatternExport(e,a)}else if(n==="Property")this.checkPatternExport(e,t.value);else if(n==="AssignmentPattern")this.checkPatternExport(e,t.left);else if(n==="RestElement")this.checkPatternExport(e,t.argument)};x.checkVariableExport=function(e,t){if(!e)return;for(var n=0,i=t;n<i.length;n+=1){var r=i[n];this.checkPatternExport(e,r.id)}};x.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};x.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")};x.parseExportSpecifiers=function(e){var t=[],n=!0;this.expect(d.braceL);while(!this.eat(d.braceR)){if(!n){if(this.expect(d.comma),this.afterTrailingComma(d.braceR))break}else n=!1;t.push(this.parseExportSpecifier(e))}return t};x.parseImport=function(e){if(this.next(),this.type===d.string)e.specifiers=uy,e.source=this.parseExprAtom();else e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===d.string?this.parseExprAtom():this.unexpected();if(this.options.ecmaVersion>=16)e.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(e,"ImportDeclaration")};x.parseImportSpecifier=function(){var e=this.startNode();if(e.imported=this.parseModuleExportName(),this.eatContextual("as"))e.local=this.parseIdent();else this.checkUnreserved(e.imported),e.local=e.imported;return this.checkLValSimple(e.local,We),this.finishNode(e,"ImportSpecifier")};x.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,We),this.finishNode(e,"ImportDefaultSpecifier")};x.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,We),this.finishNode(e,"ImportNamespaceSpecifier")};x.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===d.name){if(e.push(this.parseImportDefaultSpecifier()),!this.eat(d.comma))return e}if(this.type===d.star)return e.push(this.parseImportNamespaceSpecifier()),e;this.expect(d.braceL);while(!this.eat(d.braceR)){if(!t){if(this.expect(d.comma),this.afterTrailingComma(d.braceR))break}else t=!1;e.push(this.parseImportSpecifier())}return e};x.parseWithClause=function(){var e=[];if(!this.eat(d._with))return e;this.expect(d.braceL);var t={},n=!0;while(!this.eat(d.braceR)){if(!n){if(this.expect(d.comma),this.afterTrailingComma(d.braceR))break}else n=!1;var i=this.parseImportAttribute(),r=i.key.type==="Identifier"?i.key.name:i.key.value;if($n(t,r))this.raiseRecoverable(i.key.start,"Duplicate attribute key '"+r+"'");t[r]=!0,e.push(i)}return e};x.parseImportAttribute=function(){var e=this.startNode();if(e.key=this.type===d.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(d.colon),this.type!==d.string)this.unexpected();return e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")};x.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===d.string){var e=this.parseLiteral(this.value);if(sy.test(e.value))this.raise(e.start,"An export name cannot include a lone surrogate.");return e}return this.parseIdent(!0)};x.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)};x.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value==="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var de=V.prototype;de.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":if(this.inAsync&&e.name==="await")this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":if(e.type="ObjectPattern",n)this.checkPatternErrors(n,!0);for(var i=0,r=e.properties;i<r.length;i+=1){var s=r[i];if(this.toAssignable(s,t),s.type==="RestElement"&&(s.argument.type==="ArrayPattern"||s.argument.type==="ObjectPattern"))this.raise(s.argument.start,"Unexpected token")}break;case"Property":if(e.kind!=="init")this.raise(e.key.start,"Object pattern can't contain getter or setter");this.toAssignable(e.value,t);break;case"ArrayExpression":if(e.type="ArrayPattern",n)this.checkPatternErrors(n,!0);this.toAssignableList(e.elements,t);break;case"SpreadElement":if(e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern")this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":if(e.operator!=="=")this.raise(e.left.end,"Only '=' operator can be used for specifying default value.");e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,n);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else if(n)this.checkPatternErrors(n,!0);return e};de.toAssignableList=function(e,t){var n=e.length;for(var i=0;i<n;i++){var r=e[i];if(r)this.toAssignable(r,t)}if(n){var s=e[n-1];if(this.options.ecmaVersion===6&&t&&s&&s.type==="RestElement"&&s.argument.type!=="Identifier")this.unexpected(s.argument.start)}return e};de.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")};de.parseRestBinding=function(){var e=this.startNode();if(this.next(),this.options.ecmaVersion===6&&this.type!==d.name)this.unexpected();return e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};de.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case d.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(d.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case d.braceL:return this.parseObj(!0)}return this.parseIdent()};de.parseBindingList=function(e,t,n,i){var r=[],s=!0;while(!this.eat(e)){if(s)s=!1;else this.expect(d.comma);if(t&&this.type===d.comma)r.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===d.ellipsis){var l=this.parseRestBinding();if(this.parseBindingListItem(l),r.push(l),this.type===d.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");this.expect(e);break}else r.push(this.parseAssignableListItem(i))}return r};de.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t};de.parseBindingListItem=function(e){return e};de.parseMaybeDefault=function(e,t,n){if(n=n||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(d.eq))return n;var i=this.startNodeAt(e,t);return i.left=n,i.right=this.parseMaybeAssign(),this.finishNode(i,"AssignmentPattern")};de.checkLValSimple=function(e,t,n){if(t===void 0)t=Ai;var i=t!==Ai;switch(e.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(e.name))this.raiseRecoverable(e.start,(i?"Binding ":"Assigning to ")+e.name+" in strict mode");if(i){if(t===We&&e.name==="let")this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name");if(n){if($n(n,e.name))this.raiseRecoverable(e.start,"Argument name clash");n[e.name]=!0}if(t!==tp)this.declareName(e.name,t,e.start)}break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(i)this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":if(i)this.raiseRecoverable(e.start,"Binding parenthesized expression");return this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(i?"Binding":"Assigning to")+" rvalue")}};de.checkLValPattern=function(e,t,n){if(t===void 0)t=Ai;switch(e.type){case"ObjectPattern":for(var i=0,r=e.properties;i<r.length;i+=1){var s=r[i];this.checkLValInnerPattern(s,t,n)}break;case"ArrayPattern":for(var l=0,o=e.elements;l<o.length;l+=1){var a=o[l];if(a)this.checkLValInnerPattern(a,t,n)}break;default:this.checkLValSimple(e,t,n)}};de.checkLValInnerPattern=function(e,t,n){if(t===void 0)t=Ai;switch(e.type){case"Property":this.checkLValInnerPattern(e.value,t,n);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,n);break;case"RestElement":this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var Te=function(e,t,n,i,r){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=i,this.generator=!!r},B={b_stat:new Te("{",!1),b_expr:new Te("{",!0),b_tmpl:new Te("${",!1),p_stat:new Te("(",!1),p_expr:new Te("(",!0),q_tmpl:new Te("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new Te("function",!1),f_expr:new Te("function",!0),f_expr_gen:new Te("function",!0,!1,null,!0),f_gen:new Te("function",!1,!1,null,!0)},Wt=V.prototype;Wt.initialContext=function(){return[B.b_stat]};Wt.curContext=function(){return this.context[this.context.length-1]};Wt.braceIsBlock=function(e){var t=this.curContext();if(t===B.f_expr||t===B.f_stat)return!0;if(e===d.colon&&(t===B.b_stat||t===B.b_expr))return!t.isExpr;if(e===d._return||e===d.name&&this.exprAllowed)return ee.test(this.input.slice(this.lastTokEnd,this.start));if(e===d._else||e===d.semi||e===d.eof||e===d.parenR||e===d.arrow)return!0;if(e===d.braceL)return t===B.b_stat;if(e===d._var||e===d._const||e===d.name)return!1;return!this.exprAllowed};Wt.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return!1};Wt.updateContext=function(e){var t,n=this.type;if(n.keyword&&e===d.dot)this.exprAllowed=!1;else if(t=n.updateContext)t.call(this,e);else this.exprAllowed=n.beforeExpr};Wt.overrideContext=function(e){if(this.curContext()!==e)this.context[this.context.length-1]=e};d.parenR.updateContext=d.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();if(e===B.b_stat&&this.curContext().token==="function")e=this.context.pop();this.exprAllowed=!e.isExpr};d.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?B.b_stat:B.b_expr),this.exprAllowed=!0};d.dollarBraceL.updateContext=function(){this.context.push(B.b_tmpl),this.exprAllowed=!0};d.parenL.updateContext=function(e){var t=e===d._if||e===d._for||e===d._with||e===d._while;this.context.push(t?B.p_stat:B.p_expr),this.exprAllowed=!0};d.incDec.updateContext=function(){};d._function.updateContext=d._class.updateContext=function(e){if(e.beforeExpr&&e!==d._else&&!(e===d.semi&&this.curContext()!==B.p_stat)&&!(e===d._return&&ee.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===d.colon||e===d.braceL)&&this.curContext()===B.b_stat))this.context.push(B.f_expr);else this.context.push(B.f_stat);this.exprAllowed=!1};d.colon.updateContext=function(){if(this.curContext().token==="function")this.context.pop();this.exprAllowed=!0};d.backQuote.updateContext=function(){if(this.curContext()===B.q_tmpl)this.context.pop();else this.context.push(B.q_tmpl);this.exprAllowed=!1};d.star.updateContext=function(e){if(e===d._function){var t=this.context.length-1;if(this.context[t]===B.f_expr)this.context[t]=B.f_expr_gen;else this.context[t]=B.f_gen}this.exprAllowed=!0};d.name.updateContext=function(e){var t=!1;if(this.options.ecmaVersion>=6&&e!==d.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())t=!0}this.exprAllowed=t};var A=V.prototype;A.checkPropClash=function(e,t,n){if(this.options.ecmaVersion>=9&&e.type==="SpreadElement")return;if(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))return;var i=e.key,r;switch(i.type){case"Identifier":r=i.name;break;case"Literal":r=String(i.value);break;default:return}var s=e.kind;if(this.options.ecmaVersion>=6){if(r==="__proto__"&&s==="init"){if(t.proto)if(n){if(n.doubleProto<0)n.doubleProto=i.start}else this.raiseRecoverable(i.start,"Redefinition of __proto__ property");t.proto=!0}return}r="$"+r;var l=t[r];if(l){var o;if(s==="init")o=this.strict&&l.init||l.get||l.set;else o=l.init||l[s];if(o)this.raiseRecoverable(i.start,"Redefinition of property")}else l=t[r]={init:!1,get:!1,set:!1};l[s]=!0};A.parseExpression=function(e,t){var n=this;return this.catchStackOverflow(function(){var{start:i,startLoc:r}=n,s=n.parseMaybeAssign(e,t);if(n.type===d.comma){var l=n.startNodeAt(i,r);l.expressions=[s];while(n.eat(d.comma))l.expressions.push(n.parseMaybeAssign(e,t));return n.finishNode(l,"SequenceExpression")}return s})};A.parseMaybeAssign=function(e,t,n){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(e);else this.exprAllowed=!1;var i=!1,r=-1,s=-1,l=-1;if(t)r=t.parenthesizedAssign,s=t.trailingComma,l=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1;else t=new $i,i=!0;var o=this.start,a=this.startLoc;if(this.type===d.parenL||this.type===d.name)this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await";var p=this.parseMaybeConditional(e,t);if(n)p=n.call(this,p,o,a);if(this.type.isAssign){var c=this.startNodeAt(o,a);if(c.operator=this.value,this.type===d.eq)p=this.toAssignable(p,!1,t);if(!i){if(t.parenthesizedAssign=t.trailingComma=-1,t.shorthandAssign>=p.start)t.shorthandAssign=-1;if(t.doubleProto>=p.start)t.doubleProto=-1}if(this.type===d.eq)this.checkLValPattern(p);else this.checkLValSimple(p);if(c.left=p,this.next(),c.right=this.parseMaybeAssign(e),l>-1)t.doubleProto=l;return this.finishNode(c,"AssignmentExpression")}else if(i)this.checkExpressionErrors(t,!0);if(r>-1)t.parenthesizedAssign=r;if(s>-1)t.trailingComma=s;return p};A.parseMaybeConditional=function(e,t){var n=this.start,i=this.startLoc,r=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return r;if(!(r.type==="ArrowFunctionExpression"&&r.start===n)&&this.eat(d.question)){var s=this.startNodeAt(n,i);return s.test=r,s.consequent=this.parseMaybeAssign(),this.expect(d.colon),s.alternate=this.parseMaybeAssign(e),this.finishNode(s,"ConditionalExpression")}return r};A.parseExprOps=function(e,t){var n=this.start,i=this.startLoc,r=this.parseMaybeUnary(t,!1,!1,e);if(this.checkExpressionErrors(t))return r;return r.start===n&&r.type==="ArrowFunctionExpression"?r:this.parseExprOp(r,n,i,-1,e)};A.parseExprOp=function(e,t,n,i,r){var s=this.type.binop;if(s!=null&&(!r||this.type!==d._in)){if(s>i){var l=this.type===d.logicalOR||this.type===d.logicalAND,o=this.type===d.coalesce;if(o)s=d.logicalAND.binop;var a=this.value;this.next();var p=this.start,c=this.startLoc,u=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,r),p,c,s,r),f=this.buildBinary(t,n,e,u,a,l||o);if(l&&this.type===d.coalesce||o&&(this.type===d.logicalOR||this.type===d.logicalAND))this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");return this.parseExprOp(f,t,n,i,r)}}return e};A.buildBinary=function(e,t,n,i,r,s){if(i.type==="PrivateIdentifier")this.raise(i.start,"Private identifier can only be left side of binary expression");var l=this.startNodeAt(e,t);return l.left=n,l.operator=r,l.right=i,this.finishNode(l,s?"LogicalExpression":"BinaryExpression")};A.parseMaybeUnary=function(e,t,n,i){var r=this.start,s=this.startLoc,l;if(this.isContextual("await")&&this.canAwait)l=this.parseAwait(i),t=!0;else if(this.type.prefix){var o=this.startNode(),a=this.type===d.incDec;if(o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0,a,i),this.checkExpressionErrors(e,!0),a)this.checkLValSimple(o.argument);else if(this.strict&&o.operator==="delete"&&ip(o.argument))this.raiseRecoverable(o.start,"Deleting local variable in strict mode");else if(o.operator==="delete"&&Ns(o.argument))this.raiseRecoverable(o.start,"Private fields can not be deleted");else t=!0;l=this.finishNode(o,a?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===d.privateId){if((i||this.privateNameStack.length===0)&&this.options.checkPrivateFields)this.unexpected();if(l=this.parsePrivateIdent(),this.type!==d._in)this.unexpected()}else{if(l=this.parseExprSubscripts(e,i),this.checkExpressionErrors(e))return l;while(this.type.postfix&&!this.canInsertSemicolon()){var p=this.startNodeAt(r,s);p.operator=this.value,p.prefix=!1,p.argument=l,this.checkLValSimple(l),this.next(),l=this.finishNode(p,"UpdateExpression")}}if(!n&&!(l.type==="ArrowFunctionExpression"&&l.start===r)&&this.eat(d.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(r,s,l,this.parseMaybeUnary(null,!1,!1,i),"**",!1);else return l};function ip(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&ip(e.expression)}function Ns(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&Ns(e.expression)||e.type==="ParenthesizedExpression"&&Ns(e.expression)}A.parseExprSubscripts=function(e,t){var n=this.start,i=this.startLoc,r=-1,s=-1;if(e)r=e.doubleProto,s=e.shorthandAssign,e.doubleProto=e.shorthandAssign=-1;var l=this.parseExprAtom(e,t);if(l.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return l;var o=this.parseSubscripts(l,n,i,!1,t);if(e){if(o.end>l.end){if(this.checkExpressionErrors(e,!0),e.parenthesizedAssign>=o.start)e.parenthesizedAssign=-1;if(e.parenthesizedBind>=o.start)e.parenthesizedBind=-1;if(e.trailingComma>=o.start)e.trailingComma=-1}if(r>-1)e.doubleProto=r;if(s>-1)e.shorthandAssign=s}return o};A.parseSubscripts=function(e,t,n,i,r){var s=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,l=!1;while(!0){var o=this.parseSubscript(e,t,n,i,s,l,r);if(o.optional)l=!0;if(o.end===e.end||o.type==="ArrowFunctionExpression"){if(l){var a=this.startNodeAt(t,n);a.expression=o,o=this.finishNode(a,"ChainExpression")}return o}e=o,s=!1}};A.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(d.arrow)};A.parseSubscriptAsyncArrow=function(e,t,n,i){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,i)};A.parseSubscript=function(e,t,n,i,r,s,l){var o=this.options.ecmaVersion>=11,a=o&&this.eat(d.questionDot);if(i&&a)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var p=this.eat(d.bracketL);if(p||a&&this.type!==d.parenL&&this.type!==d.backQuote||this.eat(d.dot)){var c=this.startNodeAt(t,n);if(c.object=e,p)c.property=this.parseExpression(),this.expect(d.bracketR);else if(this.type===d.privateId&&e.type!=="Super")c.property=this.parsePrivateIdent();else c.property=this.parseIdent(this.options.allowReserved!=="never");if(c.computed=!!p,o)c.optional=a;e=this.finishNode(c,"MemberExpression")}else if(!i&&this.eat(d.parenL)){var u=new $i,f=this.yieldPos,h=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var g=this.parseExprList(d.parenR,this.options.ecmaVersion>=8,!1,u);if(r&&!a&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");return this.yieldPos=f,this.awaitPos=h,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(t,n,g,l)}this.checkExpressionErrors(u,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=h||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var y=this.startNodeAt(t,n);if(y.callee=e,y.arguments=g,o)y.optional=a;e=this.finishNode(y,"CallExpression")}else if(this.type===d.backQuote){if(a||s)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var S=this.startNodeAt(t,n);S.tag=e,S.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(S,"TaggedTemplateExpression")}return e};A.parseExprAtom=function(e,t,n){if(this.type===d.slash)this.readRegexp();var i,r=this.potentialArrowAt===this.start;switch(this.type){case d._super:if(!this.allowSuper)this.raise(this.start,"'super' keyword outside a method");if(i=this.startNode(),this.next(),this.type===d.parenL&&!this.allowDirectSuper)this.raise(i.start,"super() call outside constructor of a subclass");if(this.type!==d.dot&&this.type!==d.bracketL&&this.type!==d.parenL)this.unexpected();return this.finishNode(i,"Super");case d._this:return i=this.startNode(),this.next(),this.finishNode(i,"ThisExpression");case d.name:var s=this.start,l=this.startLoc,o=this.containsEsc,a=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&a.name==="async"&&!this.canInsertSemicolon()&&this.eat(d._function))return this.overrideContext(B.f_expr),this.parseFunction(this.startNodeAt(s,l),0,!1,!0,t);if(r&&!this.canInsertSemicolon()){if(this.eat(d.arrow))return this.parseArrowExpression(this.startNodeAt(s,l),[a],!1,t);if(this.options.ecmaVersion>=8&&a.name==="async"&&this.type===d.name&&!o&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(a=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(d.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(s,l),[a],!0,t)}}return a;case d.regexp:var p=this.value;return i=this.parseLiteral(p.value),i.regex={pattern:p.pattern,flags:p.flags},i;case d.num:case d.string:return this.parseLiteral(this.value);case d._null:case d._true:case d._false:return i=this.startNode(),i.value=this.type===d._null?null:this.type===d._true,i.raw=this.type.keyword,this.next(),this.finishNode(i,"Literal");case d.parenL:var c=this.start,u=this.parseParenAndDistinguishExpression(r,t);if(e){if(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(u))e.parenthesizedAssign=c;if(e.parenthesizedBind<0)e.parenthesizedBind=c}return u;case d.bracketL:return i=this.startNode(),this.next(),i.elements=this.parseExprList(d.bracketR,!0,!0,e),this.finishNode(i,"ArrayExpression");case d.braceL:return this.overrideContext(B.b_expr),this.parseObj(!1,e);case d._function:return i=this.startNode(),this.next(),this.parseFunction(i,0);case d._class:return this.parseClass(this.startNode(),!1);case d._new:return this.parseNew();case d.backQuote:return this.parseTemplate();case d._import:if(this.options.ecmaVersion>=11)return this.parseExprImport(n);else return this.unexpected();default:return this.parseExprAtomDefault()}};A.parseExprAtomDefault=function(){this.unexpected()};A.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword import");if(this.next(),this.type===d.parenL&&!e)return this.parseDynamicImport(t);else if(this.type===d.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name="import",t.meta=this.finishNode(n,"Identifier"),this.parseImportMeta(t)}else this.unexpected()};A.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)if(!this.eat(d.parenR))if(this.expect(d.comma),!this.afterTrailingComma(d.parenR)){if(e.options=this.parseMaybeAssign(),!this.eat(d.parenR)){if(this.expect(d.comma),!this.afterTrailingComma(d.parenR))this.unexpected()}}else e.options=null;else e.options=null;else if(!this.eat(d.parenR)){var t=this.start;if(this.eat(d.comma)&&this.eat(d.parenR))this.raiseRecoverable(t,"Trailing comma is not allowed in import()");else this.unexpected(t)}return this.finishNode(e,"ImportExpression")};A.parseImportMeta=function(e){this.next();var t=this.containsEsc;if(e.property=this.parseIdent(!0),e.property.name!=="meta")this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'");if(t)this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters");if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere)this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module");return this.finishNode(e,"MetaProperty")};A.parseLiteral=function(e){var t=this.startNode();if(t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110)t.bigint=t.value!=null?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"");return this.next(),this.finishNode(t,"Literal")};A.parseParenExpression=function(){this.expect(d.parenL);var e=this.parseExpression();return this.expect(d.parenR),e};A.shouldParseArrow=function(e){return!this.canInsertSemicolon()};A.parseParenAndDistinguishExpression=function(e,t){var n=this.start,i=this.startLoc,r,s=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var l=this.start,o=this.startLoc,a=[],p=!0,c=!1,u=new $i,f=this.yieldPos,h=this.awaitPos,m;this.yieldPos=0,this.awaitPos=0;while(this.type!==d.parenR)if(p?p=!1:this.expect(d.comma),s&&this.afterTrailingComma(d.parenR,!0)){c=!0;break}else if(this.type===d.ellipsis){if(m=this.start,a.push(this.parseParenItem(this.parseRestBinding())),this.type===d.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else a.push(this.parseMaybeAssign(!1,u,this.parseParenItem));var g=this.lastTokEnd,y=this.lastTokEndLoc;if(this.expect(d.parenR),e&&this.shouldParseArrow(a)&&this.eat(d.arrow))return this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=h,this.parseParenArrowList(n,i,a,t);if(!a.length||c)this.unexpected(this.lastTokStart);if(m)this.unexpected(m);if(this.checkExpressionErrors(u,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=h||this.awaitPos,a.length>1)r=this.startNodeAt(l,o),r.expressions=a,this.finishNodeAt(r,"SequenceExpression",g,y);else r=a[0]}else r=this.parseParenExpression();if(this.options.preserveParens){var S=this.startNodeAt(n,i);return S.expression=r,this.finishNode(S,"ParenthesizedExpression")}else return r};A.parseParenItem=function(e){return e};A.parseParenArrowList=function(e,t,n,i){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,i)};var fy=[];A.parseNew=function(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===d.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var n=this.containsEsc;if(e.property=this.parseIdent(!0),e.property.name!=="target")this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'");if(n)this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block");return this.finishNode(e,"MetaProperty")}var i=this.start,r=this.startLoc;if(e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),i,r,!0,!1),e.callee.type==="Super")this.raiseRecoverable(i,"Invalid use of 'super'");if(this.eat(d.parenL))e.arguments=this.parseExprList(d.parenR,this.options.ecmaVersion>=8,!1);else e.arguments=fy;return this.finishNode(e,"NewExpression")};A.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();if(this.type===d.invalidTemplate){if(!t)this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal");n.value={raw:this.value.replace(/\r\n?/g,`
|
|
34
34
|
`),cooked:null}}else n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
35
|
-
`),cooked:this.value};return this.next(),n.tail=this.type===d.backQuote,this.finishNode(n,"TemplateElement")};A.parseTemplate=function(e){if(e===void 0)e={};var t=e.isTagged;if(t===void 0)t=!1;var n=this.startNode();this.next(),n.expressions=[];var i=this.parseTemplateElement({isTagged:t});n.quasis=[i];while(!i.tail){if(this.type===d.eof)this.raise(this.pos,"Unterminated template literal");this.expect(d.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(d.braceR),n.quasis.push(i=this.parseTemplateElement({isTagged:t}))}return this.next(),this.finishNode(n,"TemplateLiteral")};A.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===d.name||this.type===d.num||this.type===d.string||this.type===d.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===d.star)&&!Z.test(this.input.slice(this.lastTokEnd,this.start))};A.parseObj=function(e,t){var n=this.startNode(),i=!0,r={};n.properties=[],this.next();while(!this.eat(d.braceR)){if(!i){if(this.expect(d.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(d.braceR))break}else i=!1;var s=this.parseProperty(e,t);if(!e)this.checkPropClash(s,r,t);n.properties.push(s)}return this.finishNode(n,e?"ObjectPattern":"ObjectExpression")};A.parseProperty=function(e,t){var n=this.startNode(),i,r,s,l;if(this.options.ecmaVersion>=9&&this.eat(d.ellipsis)){if(e){if(n.argument=this.parseIdent(!1),this.type===d.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");return this.finishNode(n,"RestElement")}if(n.argument=this.parseMaybeAssign(!1,t),this.type===d.comma&&t&&t.trailingComma<0)t.trailingComma=this.start;return this.finishNode(n,"SpreadElement")}if(this.options.ecmaVersion>=6){if(n.method=!1,n.shorthand=!1,e||t)s=this.start,l=this.startLoc;if(!e)i=this.eat(d.star)}var o=this.containsEsc;if(this.parsePropertyName(n),!e&&!o&&this.options.ecmaVersion>=8&&!i&&this.isAsyncProp(n))r=!0,i=this.options.ecmaVersion>=9&&this.eat(d.star),this.parsePropertyName(n);else r=!1;return this.parsePropertyValue(n,e,i,r,s,l,t,o),this.finishNode(n,"Property")};A.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var n=e.kind==="get"?0:1;if(e.value.params.length!==n){var i=e.value.start;if(e.kind==="get")this.raiseRecoverable(i,"getter should have no params");else this.raiseRecoverable(i,"setter should have exactly one param")}else if(e.kind==="set"&&e.value.params[0].type==="RestElement")this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};A.parsePropertyValue=function(e,t,n,i,r,s,l,o){if((n||i)&&this.type===d.colon)this.unexpected();if(this.eat(d.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,l),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===d.parenL){if(t)this.unexpected();e.method=!0,e.value=this.parseMethod(n,i),e.kind="init"}else if(!t&&!o&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&(this.type!==d.comma&&this.type!==d.braceR&&this.type!==d.eq)){if(n||i)this.unexpected();this.parseGetterSetter(e)}else if(this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"){if(n||i)this.unexpected();if(this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=r;if(t)e.value=this.parseMaybeDefault(r,s,this.copyNode(e.key));else if(this.type===d.eq&&l){if(l.shorthandAssign<0)l.shorthandAssign=this.start;e.value=this.parseMaybeDefault(r,s,this.copyNode(e.key))}else e.value=this.copyNode(e.key);e.kind="init",e.shorthand=!0}else this.unexpected()};A.parsePropertyName=function(e){if(this.options.ecmaVersion>=6)if(this.eat(d.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(d.bracketR),e.key;else e.computed=!1;return e.key=this.type===d.num||this.type===d.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};A.initFunction=function(e){if(e.id=null,this.options.ecmaVersion>=6)e.generator=e.expression=!1;if(this.options.ecmaVersion>=8)e.async=!1};A.parseMethod=function(e,t,n){var i=this.startNode(),r=this.yieldPos,s=this.awaitPos,l=this.awaitIdentPos;if(this.initFunction(i),this.options.ecmaVersion>=6)i.generator=e;if(this.options.ecmaVersion>=8)i.async=!!t;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ds(t,i.generator)|ki|(n?Ul:0)),this.expect(d.parenL),i.params=this.parseBindingList(d.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(i,!1,!0,!1),this.yieldPos=r,this.awaitPos=s,this.awaitIdentPos=l,this.finishNode(i,"FunctionExpression")};A.parseArrowExpression=function(e,t,n,i){var r=this.yieldPos,s=this.awaitPos,l=this.awaitIdentPos;if(this.enterScope(Ds(n,!1)|Ns),this.initFunction(e),this.options.ecmaVersion>=8)e.async=!!n;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,i),this.yieldPos=r,this.awaitPos=s,this.awaitIdentPos=l,this.finishNode(e,"ArrowFunctionExpression")};A.parseFunctionBody=function(e,t,n,i){var r=t&&this.type!==d.braceL,s=this.strict,l=!1;if(r)e.body=this.parseMaybeAssign(i),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);if(!s||o){if(l=this.strictDirective(this.end),l&&o)this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list")}var a=this.labels;if(this.labels=[],l)this.strict=!0;if(this.checkParams(e,!s&&!l&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id)this.checkLValSimple(e.id,Jl);e.body=this.parseBlock(!1,void 0,l&&!s),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=a}this.exitScope()};A.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1){var i=n[t];if(i.type!=="Identifier")return!1}return!0};A.checkParams=function(e,t){var n=Object.create(null);for(var i=0,r=e.params;i<r.length;i+=1){var s=r[i];this.checkLValInnerPattern(s,$s,t?null:n)}};A.parseExprList=function(e,t,n,i){var r=[],s=!0;while(!this.eat(e)){if(!s){if(this.expect(d.comma),t&&this.afterTrailingComma(e))break}else s=!1;var l=void 0;if(n&&this.type===d.comma)l=null;else if(this.type===d.ellipsis){if(l=this.parseSpread(i),i&&this.type===d.comma&&i.trailingComma<0)i.trailingComma=this.start}else l=this.parseMaybeAssign(!1,i);r.push(l)}return r};A.checkUnreserved=function(e){var{start:t,end:n,name:i}=e;if(this.inGenerator&&i==="yield")this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator");if(this.inAsync&&i==="await")this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function");if(!(this.currentThisScope().flags&_i)&&i==="arguments")this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer");if(this.inClassStaticBlock&&(i==="arguments"||i==="await"))this.raise(t,"Cannot use "+i+" in class static initialization block");if(this.keywords.test(i))this.raise(t,"Unexpected keyword '"+i+"'");if(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf("\\")!==-1)return;var r=this.strict?this.reservedWordsStrict:this.reservedWords;if(r.test(i)){if(!this.inAsync&&i==="await")this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function");this.raiseRecoverable(t,"The keyword '"+i+"' is reserved")}};A.parseIdent=function(e){var t=this.parseIdentNode();if(this.next(!!e),this.finishNode(t,"Identifier"),!e){if(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=t.start}return t};A.parseIdentNode=function(){var e=this.startNode();if(this.type===d.name)e.name=this.value;else if(this.type.keyword){if(e.name=this.type.keyword,(e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.context.pop();this.type=d.name}else this.unexpected();return e};A.parsePrivateIdent=function(){var e=this.startNode();if(this.type===d.privateId)e.name=this.value;else this.unexpected();if(this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields)if(this.privateNameStack.length===0)this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class");else this.privateNameStack[this.privateNameStack.length-1].used.push(e);return e};A.parseYield=function(e){if(!this.yieldPos)this.yieldPos=this.start;var t=this.startNode();if(this.next(),this.type===d.semi||this.canInsertSemicolon()||this.type!==d.star&&!this.type.startsExpr)t.delegate=!1,t.argument=null;else t.delegate=this.eat(d.star),t.argument=this.parseMaybeAssign(e);return this.finishNode(t,"YieldExpression")};A.parseAwait=function(e){if(!this.awaitPos)this.awaitPos=this.start;var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var Ai=V.prototype;Ai.raise=function(e,t){var n=Gl(this.input,e);if(t+=" ("+n.line+":"+n.column+")",this.sourceFile)t+=" in "+this.sourceFile;var i=SyntaxError(t);throw i.pos=e,i.loc=n,i.raisedAt=this.pos,i};Ai.raiseRecoverable=Ai.raise;Ai.curPosition=function(){if(this.options.locations)return new Nn(this.curLine,this.pos-this.lineStart)};var tt=V.prototype,ny=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};tt.enterScope=function(e){this.scopeStack.push(new ny(e))};tt.exitScope=function(){this.scopeStack.pop()};tt.treatFunctionsAsVarInScope=function(e){return e.flags>||!this.inModule&&e.flags&yt};tt.declareName=function(e,t,n){var i=!1;if(t===Ge){var r=this.currentScope();if(i=r.lexical.indexOf(e)>-1||r.functions.indexOf(e)>-1||r.var.indexOf(e)>-1,r.lexical.push(e),this.inModule&&r.flags&yt)delete this.undefinedExports[e]}else if(t===Kl){var s=this.currentScope();s.lexical.push(e)}else if(t===zl){var l=this.currentScope();if(this.treatFunctionsAsVar)i=l.lexical.indexOf(e)>-1;else i=l.lexical.indexOf(e)>-1||l.var.indexOf(e)>-1;l.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var a=this.scopeStack[o];if(a.lexical.indexOf(e)>-1&&!(a.flags&Hl&&a.lexical[0]===e)||!this.treatFunctionsAsVarInScope(a)&&a.functions.indexOf(e)>-1){i=!0;break}if(a.var.push(e),this.inModule&&a.flags&yt)delete this.undefinedExports[e];if(a.flags&_i)break}if(i)this.raiseRecoverable(n,"Identifier '"+e+"' has already been declared")};tt.checkLocalExport=function(e){if(this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1)this.undefinedExports[e.name]=e};tt.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};tt.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(_i|$n|xt))return t}};tt.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(_i|$n|xt)&&!(t.flags&Ns))return t}};var Di=function(e,t,n){if(this.type="",this.start=t,this.end=0,e.options.locations)this.loc=new wi(e,n);if(e.options.directSourceFile)this.sourceFile=e.options.directSourceFile;if(e.options.ranges)this.range=[t,0]},In=V.prototype;In.startNode=function(){return new Di(this,this.start,this.startLoc)};In.startNodeAt=function(e,t){return new Di(this,e,t)};function Ql(e,t,n,i){if(e.type=t,e.end=n,this.options.locations)e.loc.end=i;if(this.options.ranges)e.range[1]=n;return e}In.finishNode=function(e,t){return Ql.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};In.finishNodeAt=function(e,t,n,i){return Ql.call(this,e,t,n,i)};In.copyNode=function(e){var t=new Di(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var Zl=function(){};Zl.prototype.reset=function(){};V.prototype.validateRegExpFlags=function(){};V.prototype.validateRegExpPattern=function(){};var Ls=function(e){if(this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations)this.loc=new wi(e,e.startLoc,e.endLoc);if(e.options.ranges)this.range=[e.start,e.end]},k=V.prototype;k.next=function(e){if(!e&&this.type.keyword&&this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword);if(this.options.onToken)this.options.onToken(new Ls(this));this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};k.getToken=function(){return this.next(),new Ls(this)};if(typeof Symbol<"u")k[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===d.eof,value:t}}}};k.nextToken=function(){var e=this.curContext();if(!e||!e.preserveSpace)this.skipSpace();if(this.start=this.pos,this.options.locations)this.startLoc=this.curPosition();if(this.pos>=this.input.length)return this.finishToken(d.eof);if(e.override)return e.override(this);else this.readToken(this.fullCharCodeAtPos())};k.readToken=function(e){if(Te(e,this.options.ecmaVersion>=6)||e===92)return this.readWord();return this.getTokenFromCode(e)};k.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var n=this.input.charCodeAt(e+1);return n<=56319||n>=57344?t:(t<<10)+n-56613888};k.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};k.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(n===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=n+2,this.options.locations)for(var i=void 0,r=t;(i=Vl(this.input,r,this.pos))>-1;)++this.curLine,r=this.lineStart=i;if(this.options.onComment)this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())};k.skipLineComment=function(e){var t=this.pos,n=this.options.onComment&&this.curPosition(),i=this.input.charCodeAt(this.pos+=e);while(this.pos<this.input.length&&!jt(i))i=this.input.charCodeAt(++this.pos);if(this.options.onComment)this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())};k.skipSpace=function(){e:while(this.pos<this.input.length){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:if(this.input.charCodeAt(this.pos+1)===10)++this.pos;case 10:case 8232:case 8233:if(++this.pos,this.options.locations)++this.curLine,this.lineStart=this.pos;break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(e>8&&e<14||e>=5760&&jl.test(String.fromCharCode(e)))++this.pos;else break e}}};k.finishToken=function(e,t){if(this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();var n=this.type;this.type=e,this.value=t,this.updateContext(n)};k.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&e===46&&t===46)return this.pos+=3,this.finishToken(d.ellipsis);else return++this.pos,this.finishToken(d.dot)};k.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);if(this.exprAllowed)return++this.pos,this.readRegexp();if(e===61)return this.finishOp(d.assign,2);return this.finishOp(d.slash,1)};k.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,i=e===42?d.star:d.modulo;if(this.options.ecmaVersion>=7&&e===42&&t===42)++n,i=d.starstar,t=this.input.charCodeAt(this.pos+2);if(t===61)return this.finishOp(d.assign,n+1);return this.finishOp(i,n)};k.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var n=this.input.charCodeAt(this.pos+2);if(n===61)return this.finishOp(d.assign,3)}return this.finishOp(e===124?d.logicalOR:d.logicalAND,2)}if(t===61)return this.finishOp(d.assign,2);return this.finishOp(e===124?d.bitwiseOR:d.bitwiseAND,1)};k.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);if(e===61)return this.finishOp(d.assign,2);return this.finishOp(d.bitwiseXOR,1)};k.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||Z.test(this.input.slice(this.lastTokEnd,this.pos))))return this.skipLineComment(3),this.skipSpace(),this.nextToken();return this.finishOp(d.incDec,2)}if(t===61)return this.finishOp(d.assign,2);return this.finishOp(d.plusMin,1)};k.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;if(t===e){if(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61)return this.finishOp(d.assign,n+1);return this.finishOp(d.bitShift,n)}if(t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45)return this.skipLineComment(4),this.skipSpace(),this.nextToken();if(t===61)n=2;return this.finishOp(d.relational,n)};k.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===61)return this.finishOp(d.equality,this.input.charCodeAt(this.pos+2)===61?3:2);if(e===61&&t===62&&this.options.ecmaVersion>=6)return this.pos+=2,this.finishToken(d.arrow);return this.finishOp(e===61?d.eq:d.prefix,1)};k.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(d.questionDot,2)}if(t===63){if(e>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(d.assign,3)}return this.finishOp(d.coalesce,2)}}return this.finishOp(d.question,1)};k.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13){if(++this.pos,t=this.fullCharCodeAtPos(),Te(t,!0)||t===92)return this.finishToken(d.privateId,this.readWord1())}this.raise(this.pos,"Unexpected character '"+Pi(t)+"'")};k.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(d.parenL);case 41:return++this.pos,this.finishToken(d.parenR);case 59:return++this.pos,this.finishToken(d.semi);case 44:return++this.pos,this.finishToken(d.comma);case 91:return++this.pos,this.finishToken(d.bracketL);case 93:return++this.pos,this.finishToken(d.bracketR);case 123:return++this.pos,this.finishToken(d.braceL);case 125:return++this.pos,this.finishToken(d.braceR);case 58:return++this.pos,this.finishToken(d.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(d.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(d.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Pi(e)+"'")};k.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)};k.readRegexp=function(){var e,t,n=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(n,"Unterminated regular expression");var i=this.input.charAt(this.pos);if(Z.test(i))this.raise(n,"Unterminated regular expression");if(!e){if(i==="[")t=!0;else if(i==="]"&&t)t=!1;else if(i==="/"&&!t)break;e=i==="\\"}else e=!1;++this.pos}var r=this.input.slice(n,this.pos);++this.pos;var s=this.pos,l=this.readWord1();if(this.containsEsc)this.unexpected(s);var o=this.regexpState||(this.regexpState=new Zl(this));o.reset(n,r,l),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var a=null;try{a=new RegExp(r,l)}catch(p){}return this.finishToken(d.regexp,{pattern:r,flags:l,value:a})};k.readInt=function(e,t,n){var i=this.options.ecmaVersion>=12&&t===void 0,r=n&&this.input.charCodeAt(this.pos)===48,s=this.pos,l=0,o=0;for(var a=0,p=t==null?1/0:t;a<p;++a,++this.pos){var c=this.input.charCodeAt(this.pos),u=void 0;if(i&&c===95){if(r)this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals");if(o===95)this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore");if(a===0)this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits");o=c;continue}if(c>=97)u=c-97+10;else if(c>=65)u=c-65+10;else if(c>=48&&c<=57)u=c-48;else u=1/0;if(u>=e)break;o=c,l=l*e+u}if(i&&o===95)this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits");if(this.pos===s||t!=null&&this.pos-s!==t)return null;return l};function iy(e,t){if(t)return parseInt(e,8);return parseFloat(e.replace(/_/g,""))}function ep(e){if(typeof BigInt!=="function")return null;return BigInt(e.replace(/_/g,""))}k.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);if(n==null)this.raise(this.start+2,"Expected number in radix "+e);if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110)n=ep(this.input.slice(t,this.pos)),++this.pos;else if(Te(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(d.num,n)};k.readNumber=function(e){var t=this.pos;if(!e&&this.readInt(10,void 0,!0)===null)this.raise(t,"Invalid number");var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;if(n&&this.strict)this.raise(t,"Invalid number");var i=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&i===110){var r=ep(this.input.slice(t,this.pos));if(++this.pos,Te(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(d.num,r)}if(n&&/[89]/.test(this.input.slice(t,this.pos)))n=!1;if(i===46&&!n)++this.pos,this.readInt(10),i=this.input.charCodeAt(this.pos);if((i===69||i===101)&&!n){if(i=this.input.charCodeAt(++this.pos),i===43||i===45)++this.pos;if(this.readInt(10)===null)this.raise(t,"Invalid number")}if(Te(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");var s=iy(this.input.slice(t,this.pos),n);return this.finishToken(d.num,s)};k.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){if(this.options.ecmaVersion<6)this.unexpected();var n=++this.pos;if(t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111)this.invalidStringToken(n,"Code point out of bounds")}else t=this.readHexChar(4);return t};k.readString=function(e){var t="",n=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");var i=this.input.charCodeAt(this.pos);if(i===e)break;if(i===92)t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos;else if(i===8232||i===8233){if(this.options.ecmaVersion<10)this.raise(this.start,"Unterminated string constant");if(++this.pos,this.options.locations)this.curLine++,this.lineStart=this.pos}else{if(jt(i))this.raise(this.start,"Unterminated string constant");++this.pos}}return t+=this.input.slice(n,this.pos++),this.finishToken(d.string,t)};var tp={};k.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===tp)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};k.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw tp;else this.raise(e,t)};k.readTmplToken=function(){var e="",t=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated template");var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&(this.type===d.template||this.type===d.invalidTemplate))if(n===36)return this.pos+=2,this.finishToken(d.dollarBraceL);else return++this.pos,this.finishToken(d.backQuote);return e+=this.input.slice(t,this.pos),this.finishToken(d.template,e)}if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(jt(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:e+=`
|
|
35
|
+
`),cooked:this.value};return this.next(),n.tail=this.type===d.backQuote,this.finishNode(n,"TemplateElement")};A.parseTemplate=function(e){if(e===void 0)e={};var t=e.isTagged;if(t===void 0)t=!1;var n=this.startNode();this.next(),n.expressions=[];var i=this.parseTemplateElement({isTagged:t});n.quasis=[i];while(!i.tail){if(this.type===d.eof)this.raise(this.pos,"Unterminated template literal");this.expect(d.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(d.braceR),n.quasis.push(i=this.parseTemplateElement({isTagged:t}))}return this.next(),this.finishNode(n,"TemplateLiteral")};A.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===d.name||this.type===d.num||this.type===d.string||this.type===d.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===d.star)&&!ee.test(this.input.slice(this.lastTokEnd,this.start))};A.parseObj=function(e,t){var n=this.startNode(),i=!0,r={};n.properties=[],this.next();while(!this.eat(d.braceR)){if(!i){if(this.expect(d.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(d.braceR))break}else i=!1;var s=this.parseProperty(e,t);if(!e)this.checkPropClash(s,r,t);n.properties.push(s)}return this.finishNode(n,e?"ObjectPattern":"ObjectExpression")};A.parseProperty=function(e,t){var n=this.startNode(),i,r,s,l;if(this.options.ecmaVersion>=9&&this.eat(d.ellipsis)){if(e){if(n.argument=this.parseIdent(!1),this.type===d.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");return this.finishNode(n,"RestElement")}if(n.argument=this.parseMaybeAssign(!1,t),this.type===d.comma&&t&&t.trailingComma<0)t.trailingComma=this.start;return this.finishNode(n,"SpreadElement")}if(this.options.ecmaVersion>=6){if(n.method=!1,n.shorthand=!1,e||t)s=this.start,l=this.startLoc;if(!e)i=this.eat(d.star)}var o=this.containsEsc;if(this.parsePropertyName(n),!e&&!o&&this.options.ecmaVersion>=8&&!i&&this.isAsyncProp(n))r=!0,i=this.options.ecmaVersion>=9&&this.eat(d.star),this.parsePropertyName(n);else r=!1;return this.parsePropertyValue(n,e,i,r,s,l,t,o),this.finishNode(n,"Property")};A.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var n=e.kind==="get"?0:1;if(e.value.params.length!==n){var i=e.value.start;if(e.kind==="get")this.raiseRecoverable(i,"getter should have no params");else this.raiseRecoverable(i,"setter should have exactly one param")}else if(e.kind==="set"&&e.value.params[0].type==="RestElement")this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};A.parsePropertyValue=function(e,t,n,i,r,s,l,o){if((n||i)&&this.type===d.colon)this.unexpected();if(this.eat(d.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,l),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===d.parenL){if(t)this.unexpected();e.method=!0,e.value=this.parseMethod(n,i),e.kind="init"}else if(!t&&!o&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&(this.type!==d.comma&&this.type!==d.braceR&&this.type!==d.eq)){if(n||i)this.unexpected();this.parseGetterSetter(e)}else if(this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"){if(n||i)this.unexpected();if(this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=r;if(t)e.value=this.parseMaybeDefault(r,s,this.copyNode(e.key));else if(this.type===d.eq&&l){if(l.shorthandAssign<0)l.shorthandAssign=this.start;e.value=this.parseMaybeDefault(r,s,this.copyNode(e.key))}else e.value=this.copyNode(e.key);e.kind="init",e.shorthand=!0}else this.unexpected()};A.parsePropertyName=function(e){if(this.options.ecmaVersion>=6)if(this.eat(d.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(d.bracketR),e.key;else e.computed=!1;return e.key=this.type===d.num||this.type===d.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};A.initFunction=function(e){if(e.id=null,this.options.ecmaVersion>=6)e.generator=e.expression=!1;if(this.options.ecmaVersion>=8)e.async=!1};A.parseMethod=function(e,t,n){var i=this.startNode(),r=this.yieldPos,s=this.awaitPos,l=this.awaitIdentPos;if(this.initFunction(i),this.options.ecmaVersion>=6)i.generator=e;if(this.options.ecmaVersion>=8)i.async=!!t;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ls(t,i.generator)|Ni|(n?Yl:0)),this.expect(d.parenL),i.params=this.parseBindingList(d.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(i,!1,!0,!1),this.yieldPos=r,this.awaitPos=s,this.awaitIdentPos=l,this.finishNode(i,"FunctionExpression")};A.parseArrowExpression=function(e,t,n,i){var r=this.yieldPos,s=this.awaitPos,l=this.awaitIdentPos;if(this.enterScope(Ls(n,!1)|Is),this.initFunction(e),this.options.ecmaVersion>=8)e.async=!!n;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,i),this.yieldPos=r,this.awaitPos=s,this.awaitIdentPos=l,this.finishNode(e,"ArrowFunctionExpression")};A.parseFunctionBody=function(e,t,n,i){var r=t&&this.type!==d.braceL,s=this.strict,l=!1;if(r)e.body=this.parseMaybeAssign(i),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);if(!s||o){if(l=this.strictDirective(this.end),l&&o)this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list")}var a=this.labels;if(this.labels=[],l)this.strict=!0;if(this.checkParams(e,!s&&!l&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id)this.checkLValSimple(e.id,tp);e.body=this.parseBlock(!1,void 0,l&&!s),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=a}this.exitScope()};A.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1){var i=n[t];if(i.type!=="Identifier")return!1}return!0};A.checkParams=function(e,t){var n=Object.create(null);for(var i=0,r=e.params;i<r.length;i+=1){var s=r[i];this.checkLValInnerPattern(s,Rs,t?null:n)}};A.parseExprList=function(e,t,n,i){var r=[],s=!0;while(!this.eat(e)){if(!s){if(this.expect(d.comma),t&&this.afterTrailingComma(e))break}else s=!1;var l=void 0;if(n&&this.type===d.comma)l=null;else if(this.type===d.ellipsis){if(l=this.parseSpread(i),i&&this.type===d.comma&&i.trailingComma<0)i.trailingComma=this.start}else l=this.parseMaybeAssign(!1,i);r.push(l)}return r};A.checkUnreserved=function(e){var{start:t,end:n,name:i}=e;if(this.inGenerator&&i==="yield")this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator");if(this.inAsync&&i==="await")this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function");if(!(this.currentThisScope().flags&Di)&&i==="arguments")this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer");if(this.inClassStaticBlock&&(i==="arguments"||i==="await"))this.raise(t,"Cannot use "+i+" in class static initialization block");if(this.keywords.test(i))this.raise(t,"Unexpected keyword '"+i+"'");if(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf("\\")!==-1)return;var r=this.strict?this.reservedWordsStrict:this.reservedWords;if(r.test(i)){if(!this.inAsync&&i==="await")this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function");this.raiseRecoverable(t,"The keyword '"+i+"' is reserved")}};A.parseIdent=function(e){var t=this.parseIdentNode();if(this.next(!!e),this.finishNode(t,"Identifier"),!e){if(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=t.start}return t};A.parseIdentNode=function(){var e=this.startNode();if(this.type===d.name)e.name=this.value;else if(this.type.keyword){if(e.name=this.type.keyword,(e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.context.pop();this.type=d.name}else this.unexpected();return e};A.parsePrivateIdent=function(){var e=this.startNode();if(this.type===d.privateId)e.name=this.value;else this.unexpected();if(this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields)if(this.privateNameStack.length===0)this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class");else this.privateNameStack[this.privateNameStack.length-1].used.push(e);return e};A.parseYield=function(e){if(!this.yieldPos)this.yieldPos=this.start;var t=this.startNode();if(this.next(),this.type===d.semi||this.canInsertSemicolon()||this.type!==d.star&&!this.type.startsExpr)t.delegate=!1,t.argument=null;else t.delegate=this.eat(d.star),t.argument=this.parseMaybeAssign(e);return this.finishNode(t,"YieldExpression")};A.parseAwait=function(e){if(!this.awaitPos)this.awaitPos=this.start;var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var Pi=V.prototype;Pi.raise=function(e,t){var n=Kl(this.input,e);if(t+=" ("+n.line+":"+n.column+")",this.sourceFile)t+=" in "+this.sourceFile;var i=SyntaxError(t);throw i.pos=e,i.loc=n,i.raisedAt=this.pos,i};Pi.raiseRecoverable=Pi.raise;Pi.curPosition=function(){if(this.options.locations)return new Dn(this.curLine,this.pos-this.lineStart)};var tt=V.prototype,hy=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};tt.enterScope=function(e){this.scopeStack.push(new hy(e))};tt.exitScope=function(){this.scopeStack.pop()};tt.treatFunctionsAsVarInScope=function(e){return e.flags>||!this.inModule&&e.flags&yt};tt.declareName=function(e,t,n){var i=!1;if(t===We){var r=this.currentScope();if(i=r.lexical.indexOf(e)>-1||r.functions.indexOf(e)>-1||r.var.indexOf(e)>-1,r.lexical.push(e),this.inModule&&r.flags&yt)delete this.undefinedExports[e]}else if(t===ep){var s=this.currentScope();s.lexical.push(e)}else if(t===Zl){var l=this.currentScope();if(this.treatFunctionsAsVar)i=l.lexical.indexOf(e)>-1;else i=l.lexical.indexOf(e)>-1||l.var.indexOf(e)>-1;l.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var a=this.scopeStack[o];if(a.lexical.indexOf(e)>-1&&!(a.flags&Xl&&a.lexical[0]===e)||!this.treatFunctionsAsVarInScope(a)&&a.functions.indexOf(e)>-1){i=!0;break}if(a.var.push(e),this.inModule&&a.flags&yt)delete this.undefinedExports[e];if(a.flags&Di)break}if(i)this.raiseRecoverable(n,"Identifier '"+e+"' has already been declared")};tt.checkLocalExport=function(e){if(this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1)this.undefinedExports[e.name]=e};tt.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};tt.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(Di|In|xt))return t}};tt.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(Di|In|xt)&&!(t.flags&Is))return t}};var Ii=function(e,t,n){if(this.type="",this.start=t,this.end=0,e.options.locations)this.loc=new _i(e,n);if(e.options.directSourceFile)this.sourceFile=e.options.directSourceFile;if(e.options.ranges)this.range=[t,0]},Ln=V.prototype;Ln.startNode=function(){return new Ii(this,this.start,this.startLoc)};Ln.startNodeAt=function(e,t){return new Ii(this,e,t)};function rp(e,t,n,i){if(e.type=t,e.end=n,this.options.locations)e.loc.end=i;if(this.options.ranges)e.range[1]=n;return e}Ln.finishNode=function(e,t){return rp.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};Ln.finishNodeAt=function(e,t,n,i){return rp.call(this,e,t,n,i)};Ln.copyNode=function(e){var t=new Ii(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var sp=function(){};sp.prototype.reset=function(){};V.prototype.validateRegExpFlags=function(){};V.prototype.validateRegExpPattern=function(){};var Os=function(e){if(this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations)this.loc=new _i(e,e.startLoc,e.endLoc);if(e.options.ranges)this.range=[e.start,e.end]},k=V.prototype;k.next=function(e){if(!e&&this.type.keyword&&this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword);if(this.options.onToken)this.options.onToken(new Os(this));this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};k.getToken=function(){return this.next(),new Os(this)};if(typeof Symbol<"u")k[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===d.eof,value:t}}}};k.nextToken=function(){var e=this.curContext();if(!e||!e.preserveSpace)this.skipSpace();if(this.start=this.pos,this.options.locations)this.startLoc=this.curPosition();if(this.pos>=this.input.length)return this.finishToken(d.eof);if(e.override)return e.override(this);else this.readToken(this.fullCharCodeAtPos())};k.readToken=function(e){if(be(e,this.options.ecmaVersion>=6)||e===92)return this.readWord();return this.getTokenFromCode(e)};k.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var n=this.input.charCodeAt(e+1);return n<=56319||n>=57344?t:(t<<10)+n-56613888};k.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};k.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(n===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=n+2,this.options.locations)for(var i=void 0,r=t;(i=ql(this.input,r,this.pos))>-1;)++this.curLine,r=this.lineStart=i;if(this.options.onComment)this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())};k.skipLineComment=function(e){var t=this.pos,n=this.options.onComment&&this.curPosition(),i=this.input.charCodeAt(this.pos+=e);while(this.pos<this.input.length&&!Gt(i))i=this.input.charCodeAt(++this.pos);if(this.options.onComment)this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())};k.skipSpace=function(){e:while(this.pos<this.input.length){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:if(this.input.charCodeAt(this.pos+1)===10)++this.pos;case 10:case 8232:case 8233:if(++this.pos,this.options.locations)++this.curLine,this.lineStart=this.pos;break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(e>8&&e<14||e>=5760&&zl.test(String.fromCharCode(e)))++this.pos;else break e}}};k.finishToken=function(e,t){if(this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();var n=this.type;this.type=e,this.value=t,this.updateContext(n)};k.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&e===46&&t===46)return this.pos+=3,this.finishToken(d.ellipsis);else return++this.pos,this.finishToken(d.dot)};k.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);if(this.exprAllowed)return++this.pos,this.readRegexp();if(e===61)return this.finishOp(d.assign,2);return this.finishOp(d.slash,1)};k.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,i=e===42?d.star:d.modulo;if(this.options.ecmaVersion>=7&&e===42&&t===42)++n,i=d.starstar,t=this.input.charCodeAt(this.pos+2);if(t===61)return this.finishOp(d.assign,n+1);return this.finishOp(i,n)};k.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var n=this.input.charCodeAt(this.pos+2);if(n===61)return this.finishOp(d.assign,3)}return this.finishOp(e===124?d.logicalOR:d.logicalAND,2)}if(t===61)return this.finishOp(d.assign,2);return this.finishOp(e===124?d.bitwiseOR:d.bitwiseAND,1)};k.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);if(e===61)return this.finishOp(d.assign,2);return this.finishOp(d.bitwiseXOR,1)};k.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||ee.test(this.input.slice(this.lastTokEnd,this.pos))))return this.skipLineComment(3),this.skipSpace(),this.nextToken();return this.finishOp(d.incDec,2)}if(t===61)return this.finishOp(d.assign,2);return this.finishOp(d.plusMin,1)};k.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;if(t===e){if(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61)return this.finishOp(d.assign,n+1);return this.finishOp(d.bitShift,n)}if(t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45)return this.skipLineComment(4),this.skipSpace(),this.nextToken();if(t===61)n=2;return this.finishOp(d.relational,n)};k.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===61)return this.finishOp(d.equality,this.input.charCodeAt(this.pos+2)===61?3:2);if(e===61&&t===62&&this.options.ecmaVersion>=6)return this.pos+=2,this.finishToken(d.arrow);return this.finishOp(e===61?d.eq:d.prefix,1)};k.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(d.questionDot,2)}if(t===63){if(e>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(d.assign,3)}return this.finishOp(d.coalesce,2)}}return this.finishOp(d.question,1)};k.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13){if(++this.pos,t=this.fullCharCodeAtPos(),be(t,!0)||t===92)return this.finishToken(d.privateId,this.readWord1())}this.raise(this.pos,"Unexpected character '"+ki(t)+"'")};k.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(d.parenL);case 41:return++this.pos,this.finishToken(d.parenR);case 59:return++this.pos,this.finishToken(d.semi);case 44:return++this.pos,this.finishToken(d.comma);case 91:return++this.pos,this.finishToken(d.bracketL);case 93:return++this.pos,this.finishToken(d.bracketR);case 123:return++this.pos,this.finishToken(d.braceL);case 125:return++this.pos,this.finishToken(d.braceR);case 58:return++this.pos,this.finishToken(d.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(d.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(d.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+ki(e)+"'")};k.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)};k.readRegexp=function(){var e,t,n=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(n,"Unterminated regular expression");var i=this.input.charAt(this.pos);if(ee.test(i))this.raise(n,"Unterminated regular expression");if(!e){if(i==="[")t=!0;else if(i==="]"&&t)t=!1;else if(i==="/"&&!t)break;e=i==="\\"}else e=!1;++this.pos}var r=this.input.slice(n,this.pos);++this.pos;var s=this.pos,l=this.readWord1();if(this.containsEsc)this.unexpected(s);var o=this.regexpState||(this.regexpState=new sp(this));o.reset(n,r,l),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var a=null;try{a=new RegExp(r,l)}catch(p){}return this.finishToken(d.regexp,{pattern:r,flags:l,value:a})};k.readInt=function(e,t,n){var i=this.options.ecmaVersion>=12&&t===void 0,r=n&&this.input.charCodeAt(this.pos)===48,s=this.pos,l=0,o=0;for(var a=0,p=t==null?1/0:t;a<p;++a,++this.pos){var c=this.input.charCodeAt(this.pos),u=void 0;if(i&&c===95){if(r)this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals");if(o===95)this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore");if(a===0)this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits");o=c;continue}if(c>=97)u=c-97+10;else if(c>=65)u=c-65+10;else if(c>=48&&c<=57)u=c-48;else u=1/0;if(u>=e)break;o=c,l=l*e+u}if(i&&o===95)this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits");if(this.pos===s||t!=null&&this.pos-s!==t)return null;return l};function my(e,t){if(t)return parseInt(e,8);return parseFloat(e.replace(/_/g,""))}function op(e){if(typeof BigInt!=="function")return null;return BigInt(e.replace(/_/g,""))}k.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);if(n==null)this.raise(this.start+2,"Expected number in radix "+e);if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110)n=op(this.input.slice(t,this.pos)),++this.pos;else if(be(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(d.num,n)};k.readNumber=function(e){var t=this.pos;if(!e&&this.readInt(10,void 0,!0)===null)this.raise(t,"Invalid number");var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;if(n&&this.strict)this.raise(t,"Invalid number");var i=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&i===110){var r=op(this.input.slice(t,this.pos));if(++this.pos,be(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(d.num,r)}if(n&&/[89]/.test(this.input.slice(t,this.pos)))n=!1;if(i===46&&!n)++this.pos,this.readInt(10),i=this.input.charCodeAt(this.pos);if((i===69||i===101)&&!n){if(i=this.input.charCodeAt(++this.pos),i===43||i===45)++this.pos;if(this.readInt(10)===null)this.raise(t,"Invalid number")}if(be(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");var s=my(this.input.slice(t,this.pos),n);return this.finishToken(d.num,s)};k.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){if(this.options.ecmaVersion<6)this.unexpected();var n=++this.pos;if(t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111)this.invalidStringToken(n,"Code point out of bounds")}else t=this.readHexChar(4);return t};k.readString=function(e){var t="",n=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");var i=this.input.charCodeAt(this.pos);if(i===e)break;if(i===92)t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos;else if(i===8232||i===8233){if(this.options.ecmaVersion<10)this.raise(this.start,"Unterminated string constant");if(++this.pos,this.options.locations)this.curLine++,this.lineStart=this.pos}else{if(Gt(i))this.raise(this.start,"Unterminated string constant");++this.pos}}return t+=this.input.slice(n,this.pos++),this.finishToken(d.string,t)};var ap={};k.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===ap)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};k.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw ap;else this.raise(e,t)};k.readTmplToken=function(){var e="",t=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated template");var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&(this.type===d.template||this.type===d.invalidTemplate))if(n===36)return this.pos+=2,this.finishToken(d.dollarBraceL);else return++this.pos,this.finishToken(d.backQuote);return e+=this.input.slice(t,this.pos),this.finishToken(d.template,e)}if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Gt(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:e+=`
|
|
36
36
|
`;break;default:e+=String.fromCharCode(n);break}if(this.options.locations)++this.curLine,this.lineStart=this.pos;t=this.pos}else++this.pos}};k.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(d.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":if(this.input[this.pos+1]===`
|
|
37
37
|
`)++this.pos;case`
|
|
38
38
|
`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};k.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
|
|
39
|
-
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Pi(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:if(this.options.locations)this.lineStart=this.pos,++this.curLine;return"";case 56:case 57:if(this.strict)this.invalidStringToken(this.pos-1,"Invalid escape sequence");if(e){var n=this.pos-1;this.invalidStringToken(n,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(i,8);if(r>255)i=i.slice(0,-1),r=parseInt(i,8);if(this.pos+=i.length-1,t=this.input.charCodeAt(this.pos),(i!=="0"||t===56||t===57)&&(this.strict||e))this.invalidStringToken(this.pos-1-i.length,e?"Octal literal in template string":"Octal literal in strict mode");return String.fromCharCode(r)}if(jt(t)){if(this.options.locations)this.lineStart=this.pos,++this.curLine;return""}return String.fromCharCode(t)}};k.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);if(n===null)this.invalidStringToken(t,"Bad character escape sequence");return n};k.readWord1=function(){this.containsEsc=!1;var e="",t=!0,n=this.pos,i=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var r=this.fullCharCodeAtPos();if(_e(r,i))this.pos+=r<=65535?1:2;else if(r===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var s=this.pos;if(this.input.charCodeAt(++this.pos)!==117)this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX");++this.pos;var l=this.readCodePoint();if(!(t?Te:_e)(l,i))this.invalidStringToken(s,"Invalid Unicode escape");e+=Pi(l),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)};k.readWord=function(){var e=this.readWord1(),t=d.name;if(this.keywords.test(e))t=ks[e];return this.finishToken(t,e)};var ry="8.19.0";V.acorn={Parser:V,version:ry,defaultOptions:As,Position:Nn,SourceLocation:wi,getLineInfo:Gl,Node:Di,TokenType:I,tokTypes:d,keywordTypes:ks,TokContext:Ee,tokContexts:B,isIdentifierChar:_e,isIdentifierStart:Te,Token:Ls,isNewLine:jt,lineBreak:Z,lineBreakG:Wm,nonASCIIwhitespace:jl};function Ln(e){return(t)=>e(t)}function $i(...e){return V.extend(...e)}function Rn(e,t,n){for(let i=t;i<n;i++){let r=e.charCodeAt(i);if(r===10||r===13||r===8232||r===8233)return!0}return!1}var Bl=new WeakMap;function ee(e,t){if(e===void 0)return!1;if(e.length<16)return e.includes(t);let n=Bl.get(e);if(n===void 0||n.length>e.length)n={names:new Set,length:0},Bl.set(e,n);while(n.length<e.length)n.names.add(e[n.length++]);return n.names.has(t)}var Rs=/(?:\s|\/\/.*|\/\*[\s\S]*?\*\/)*/g,sy=new Map([["any","TSAnyKeyword"],["bigint","TSBigIntKeyword"],["boolean","TSBooleanKeyword"],["never","TSNeverKeyword"],["null","TSNullKeyword"],["number","TSNumberKeyword"],["object","TSObjectKeyword"],["string","TSStringKeyword"],["symbol","TSSymbolKeyword"],["undefined","TSUndefinedKeyword"],["unknown","TSUnknownKeyword"],["void","TSVoidKeyword"]]),oy=new Set("public private protected readonly declare abstract override static accessor".split(" ")),ay=new Set("public private protected readonly override".split(" ")),ly=new Set("var let const function class abstract enum interface type namespace module global".split(" ")),py=new Set("var let const function class interface enum".split(" ")),np=new Set(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"]),ip=1,cy=32,uy=256,dy=0,fy=1,On=2,hy=3,my=4,Ms=6,rp=7,cp=256,Vs=1024,yy=8|Vs,gy=On|cp,sp=1,xy=2,op=40,Sy=41,Ey=44,ap=46,lp=58,Mn=61,pp=60,Ty=62,Ii=123,vy=91,Os=42,by=35,Bs=34,Fs=39,Cy=SyntaxError("speculative parse failed"),Li=Ln((e)=>{let{tokTypes:t,keywordTypes:n,isIdentifierChar:i,isIdentifierStart:r}=e.acorn,s=new e.acorn.TokenType("@");class l extends e{inType=!1;$4=!1;$5=!1;$7=null;$l=null;$j=!1;$m=!1;$f=null;$9=[[]];$n=0;$t=0;$o=-1;constructor(o,a,p){super(o,a,p);let c=this.options.onComment;if(typeof c==="function")this.options.onComment=(u,f,h,m,g,y)=>{if(h<this.$t)return;this.$t=m,c.call(this,u,f,h,m,g,y)}}reset(){this.inType=!1,this.$4=!1,this.$5=!1,this.$7=null,this.$l=null,this.$j=!1,this.$m=!1,this.$f=null,this.$9=[[]],this.$n=0,this.$t=0,this.$o=-1}getTokenFromCode(o){if(o===64)return++this.pos,this.finishToken(s);return super.getTokenFromCode(o)}readToken_lt_gt(o){if(this.inType)return this.finishOp(t.relational,1);return super.readToken_lt_gt(o)}$a(o){let a=this.inType;this.inType=!0;let p=o();if(this.inType=a,!a&&this.type===t.relational)this.pos=this.start,this.nextToken();return p}$1(){return this.type===t.relational&&this.value==="<"}$p(){if(this.type===t.bitShift&&this.value==="<<")this.pos=this.start+1,this.finishToken(t.relational,"<");return this.$1()}$c(){return this.type===t.relational&&this.value===">"}$u(){return this.type===t.prefix&&this.value==="!"}hasPrecedingLineBreak(){return Rn(this.input,this.lastTokEnd,this.start)}$d(o=this.pos){return Rs.lastIndex=o,Rs.exec(this.input),Rs.lastIndex}$2(){return this.input.charCodeAt(this.$d())}$3(){let o=this.$d(),a=o;while(a<this.input.length&&i(this.input.charCodeAt(a)))a++;return this.input.slice(o,a)}$b(){return!Rn(this.input,this.pos,this.$d())}$14(){return this.$b()&&r(this.$2())&&!Object.hasOwn(n,this.$3())}$15(){return{pos:this.pos,type:this.type,value:this.value,start:this.start,end:this.end,startLoc:this.startLoc,endLoc:this.endLoc,lastTokStart:this.lastTokStart,lastTokEnd:this.lastTokEnd,lastTokStartLoc:this.lastTokStartLoc,lastTokEndLoc:this.lastTokEndLoc,curLine:this.curLine,lineStart:this.lineStart,context:this.context.slice(),exprAllowed:this.exprAllowed,containsEsc:this.containsEsc,inType:this.inType,$4:this.$4,$5:this.$5,$7:this.$7,scopes:this.scopeStack.length,privateNames:this.privateNameStack.length,labels:this.labels,labelCount:this.labels.length,strict:this.strict,yieldPos:this.yieldPos,awaitPos:this.awaitPos,awaitIdentPos:this.awaitIdentPos,potentialArrowAt:this.potentialArrowAt,potentialArrowInForAwait:this.potentialArrowInForAwait}}$16(o){this.pos=o.pos,this.type=o.type,this.value=o.value,this.start=o.start,this.end=o.end,this.startLoc=o.startLoc,this.endLoc=o.endLoc,this.lastTokStart=o.lastTokStart,this.lastTokEnd=o.lastTokEnd,this.lastTokStartLoc=o.lastTokStartLoc,this.lastTokEndLoc=o.lastTokEndLoc,this.curLine=o.curLine,this.lineStart=o.lineStart,this.context=o.context,this.exprAllowed=o.exprAllowed,this.containsEsc=o.containsEsc,this.inType=o.inType,this.$4=o.$4,this.$5=o.$5,this.$7=o.$7,this.$j=!1,this.scopeStack.length=o.scopes,this.privateNameStack.length=o.privateNames,this.labels=o.labels,this.labels.length=o.labelCount,this.strict=o.strict,this.yieldPos=o.yieldPos,this.awaitPos=o.awaitPos,this.awaitIdentPos=o.awaitIdentPos,this.potentialArrowAt=o.potentialArrowAt,this.potentialArrowInForAwait=o.potentialArrowInForAwait}raise(o,a){if(this.$n>0)throw Cy;return super.raise(o,a)}$1y(o,a){try{super.raise(o,a)}catch(p){if(p instanceof SyntaxError)p.$1z=!0;throw p}throw Error("unreachable")}$g(o,a=!1){let p=this.$15();this.$n++;try{let c=o();if(a||c===void 0)this.$16(p);return c}catch(c){if(!(c instanceof SyntaxError)||!a&&c.$1z)throw c;this.$16(p);return}finally{this.$n--}}$v(o){return this.$g(o,!0)===!0}$17(o){if(o.end=this.lastTokEnd,this.options.locations)o.loc.end=this.lastTokEndLoc}$q(o,a){if(o.start=a.start,this.options.locations)o.loc.start=a.loc.start}$6(o=!1){let a=this.startNode();return a.typeAnnotation=this.$a(()=>(this.next(),o?this.$20():this.$0())),this.finishNode(a,"TSTypeAnnotation")}$h(o,a){if(a&&this.eat(t.question))o.optional=!0,this.$17(o);if(this.type===t.colon)o.typeAnnotation=this.$6(),this.$17(o);return o}$20(){if(this.type!==t.name&&this.type!==t._this)return this.$0();if(this.isContextual("asserts")&&this.$b()&&r(this.$2())){let o=this.startNode();if(this.next(),o.parameterName=this.type===t._this?this.$w():this.parseIdent(),this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.$x(o,!0);return o.asserts=!0,o.typeAnnotation=null,this.finishNode(o,"TSTypePredicate")}if(this.$3()==="is"&&this.$b()){let o=this.startNode();return o.parameterName=this.type===t._this?this.$w():this.parseIdent(!0),this.$x(o,!1)}return this.$0()}$x(o,a){this.next();let p=this.startNode();return p.typeAnnotation=this.$0(),o.typeAnnotation=this.finishNode(p,"TSTypeAnnotation"),o.asserts=a,this.finishNode(o,"TSTypePredicate")}$w(){let o=this.startNode();return this.next(),this.finishNode(o,"TSThisType")}parseWholeType(){this.inType=!0,this.nextToken();let o=this.$0();if(this.type!==t.eof)this.unexpected();return o}$0(){let o=this.$18();if(this.$4||this.type!==t._extends||this.hasPrecedingLineBreak())return o;let a=this.startNodeAt(o.start,o.loc?.start);return this.next(),a.checkType=o,a.extendsType=this.$i(!0,()=>this.$18()),this.expect(t.question),a.trueType=this.$i(!1,()=>this.$0()),this.expect(t.colon),a.falseType=this.$i(!1,()=>this.$0()),this.finishNode(a,"TSConditionalType")}$i(o,a){let p=this.$4;this.$4=o;let c=a();return this.$4=p,c}$18(){if(this.$21())return this.$19("TSFunctionType");if(this.type===t._new||this.isContextual("abstract")&&this.$3()==="new")return this.$19("TSConstructorType");return this.$1a("TSUnionType",t.bitwiseOR,()=>this.$1a("TSIntersectionType",t.bitwiseAND,()=>this.$1b()))}$19(o){let a=this.startNode();if(o==="TSConstructorType"){if(a.abstract=this.isContextual("abstract"),a.abstract)this.next();this.next()}return this.$i(!1,()=>this.$r(a,t.arrow)),this.finishNode(a,o)}$r(o,a){if(this.$1())o.typeParameters=this.$8();if(this.expect(t.parenL),o.parameters=this.parseBindingList(t.parenR,!1,!0),this.type===a)o.typeAnnotation=this.$6(!0);else if(a===t.arrow)this.unexpected()}$21(){if(this.$1())return!0;if(this.type!==t.parenL)return!1;return this.$v(()=>{if(this.next(),this.type===t.parenR||this.type===t.ellipsis)return!0;if(this.type===t.name||this.type===t._this)this.next();else if(this.type===t.braceL||this.type===t.bracketL)this.parseBindingAtom();else return!1;let o=this.type;if(o===t.colon||o===t.comma||o===t.question||o===t.eq)return!0;if(o!==t.parenR)return!1;return this.next(),this.type===t.arrow})}$1a(o,a,p){let c=this.startNode(),u=this.eat(a),f=[];do f.push(p());while(this.eat(a));if(f.length===1&&!u)return f[0];return c.types=f,this.finishNode(c,o)}$1b(){if(this.type===t.name&&!this.containsEsc){let o=this.value;if(o==="keyof"||o==="unique"||o==="readonly"){let a=this.startNode();return this.next(),a.operator=o,a.typeAnnotation=this.$1b(),this.finishNode(a,"TSTypeOperator")}if(o==="infer"){let a=this.startNode();this.next();let p=this.startNode();p.name=this.$y();let c=this.$g(()=>this.$22());if(c)p.constraint=c;return a.typeParameter=this.finishNode(p,"TSTypeParameter"),this.finishNode(a,"TSInferType")}}return this.$i(!1,()=>this.$23())}$22(){if(!this.eat(t._extends))return;let o=this.$i(!0,()=>this.$0());return this.$4||this.type!==t.question?o:void 0}$y(){if(this.type!==t.name&&!this.type.keyword)this.unexpected();let o=this.type===t.name?this.value:this.type.keyword;return this.next(),o}$23(){let o=this.$24();while(!this.hasPrecedingLineBreak()&&this.eat(t.bracketL)){let a=this.startNodeAt(o.start,o.loc?.start);if(this.eat(t.bracketR))a.elementType=o,o=this.finishNode(a,"TSArrayType");else a.objectType=o,a.indexType=this.$0(),this.expect(t.bracketR),o=this.finishNode(a,"TSIndexedAccessType")}return o}$24(){switch(this.type){case t.name:case t._void:case t._null:{let o=sy.get(this.value);if(o&&(this.type!==t.name||!this.containsEsc&&this.$2()!==ap)){let a=this.startNode();return this.next(),this.finishNode(a,o)}return this.$1c()}case t.string:case t.num:case t._true:case t._false:{let o=this.startNode();return o.literal=this.parseExprAtom(),this.finishNode(o,"TSLiteralType")}case t.plusMin:{if(this.value!=="-")break;let o=this.startNode(),a=this.startNode();if(this.next(),this.type!==t.num)this.unexpected();return a.operator="-",a.prefix=!0,a.argument=this.parseExprAtom(),o.literal=this.finishNode(a,"UnaryExpression"),this.finishNode(o,"TSLiteralType")}case t.backQuote:return this.$25();case t._this:{let o=this.$w();if(this.isContextual("is")&&!this.hasPrecedingLineBreak()){let a=this.startNodeAt(o.start,o.loc?.start);return a.parameterName=o,this.$x(a,!1)}return o}case t._typeof:return this.$26();case t._import:return this.$1d();case t.braceL:return this.$27()?this.$28():this.$29();case t.bracketL:return this.$2a();case t.parenL:{let o=this.startNode();return this.next(),o.typeAnnotation=this.$0(),this.expect(t.parenR),this.finishNode(o,"TSParenthesizedType")}default:if(this.type.keyword)return this.$1c()}return this.unexpected()}$1c(){let o=this.startNode();if(o.typeName=this.$k(),!this.hasPrecedingLineBreak()&&this.$1())o.typeArguments=this.$e();return this.finishNode(o,"TSTypeReference")}$k(){let o=this.parseIdent(!0);while(this.eat(t.dot)){let a=this.startNodeAt(o.start,o.loc?.start);a.left=o,a.right=this.parseIdent(!0),o=this.finishNode(a,"TSQualifiedName")}return o}$26(){let o=this.startNode();if(this.next(),o.exprName=this.type===t._import?this.$1d():this.$k(),!this.hasPrecedingLineBreak()&&this.$1())o.typeArguments=this.$e();return this.finishNode(o,"TSTypeQuery")}$1d(){let o=this.startNode();if(this.next(),o.argument=this.$1e(),this.eat(t.dot))o.qualifier=this.$k();if(this.$1())o.typeArguments=this.$e();return this.finishNode(o,"TSImportType")}$z(){if(this.type!==t.string)this.unexpected();return this.parseExprAtom()}$1e(){this.expect(t.parenL);let o=this.$z();return this.expect(t.parenR),o}$25(){let o=this.startNode(),a=this.startNode();this.next(),a.expressions=[];let p=this.parseTemplateElement({isTagged:!1});a.quasis=[p];while(!p.tail){if(this.type===t.eof)this.raise(this.pos,"Unterminated template literal");this.expect(t.dollarBraceL),a.expressions.push(this.$0()),this.expect(t.braceR),p=this.parseTemplateElement({isTagged:!1}),a.quasis.push(p)}return this.next(),o.literal=this.finishNode(a,"TemplateLiteral"),this.finishNode(o,"TSLiteralType")}$27(){return this.$v(()=>{if(this.next(),this.type===t.plusMin)return this.next(),this.isContextual("readonly");if(this.isContextual("readonly"))this.next();if(this.type!==t.bracketL)return!1;if(this.next(),this.type!==t.name)return!1;return this.next(),this.type===t._in})}$28(){let o=this.startNode();if(this.expect(t.braceL),this.type===t.plusMin)o.readonly=this.value,this.next(),this.expectContextual("readonly");else if(this.eatContextual("readonly"))o.readonly=!0;this.expect(t.bracketL);let a=this.startNode();if(a.name=this.$y(),this.expect(t._in),a.constraint=this.$0(),o.typeParameter=this.finishNode(a,"TSTypeParameter"),o.nameType=this.eatContextual("as")?this.$0():null,this.expect(t.bracketR),this.type===t.plusMin)o.optional=this.value,this.next(),this.expect(t.question);else if(this.eat(t.question))o.optional=!0;if(this.eat(t.colon))o.typeAnnotation=this.$0();return this.semicolon(),this.expect(t.braceR),this.finishNode(o,"TSMappedType")}$29(){let o=this.startNode();return o.members=this.$1f(),this.finishNode(o,"TSTypeLiteral")}$1f(){this.expect(t.braceL);let o=[];while(!this.eat(t.braceR))o.push(this.$2b());return o}$2b(){let o=this.startNode(),a="TSPropertySignature",p=this.type===t._new?this.$2():-1;if(this.type===t.parenL||this.$1())a="TSCallSignatureDeclaration",this.$r(o,t.colon);else if(p===op||p===pp)a="TSConstructSignatureDeclaration",this.next(),this.$r(o,t.colon);else{let c=this.type===t._new?this.parseIdent(!0):null;if(this.isContextual("readonly")&&this.$s(!0))this.next(),o.readonly=!0;if(this.type===t.bracketL&&this.$1g())return this.$1h(o);let u="method";if(c)o.key=c;else{if((this.isContextual("get")||this.isContextual("set"))&&this.$s(!1))u=this.value,this.next();this.parsePropertyName(o)}if(this.eat(t.question))o.optional=!0;if(this.type===t.parenL||this.$1()){if(a="TSMethodSignature",u!=="method")o.kind=u;this.$r(o,t.colon),o.kind=u}else if(this.type===t.colon)o.typeAnnotation=this.$6()}return this.$1i(),this.finishNode(o,a)}$1i(){if(!this.eat(t.comma))this.semicolon()}$1g(){return this.$v(()=>{if(this.next(),this.type!==t.name)return!1;return this.next(),this.type===t.colon})}$1h(o){if(this.expect(t.bracketL),o.parameters=[this.$h(this.parseIdent(),!1)],this.expect(t.bracketR),this.type===t.colon)o.typeAnnotation=this.$6();return this.$1i(),this.finishNode(o,"TSIndexSignature")}$2a(){let o=this.startNode();this.expect(t.bracketL),o.elementTypes=[];while(!this.eat(t.bracketR))if(o.elementTypes.push(this.$2c()),this.type!==t.bracketR)this.expect(t.comma);return this.finishNode(o,"TSTupleType")}$2c(){let o=this.start,a=this.startLoc,p=this.eat(t.ellipsis),c;if((this.type===t.name||this.type.keyword)&&this.$2d()){let u=this.startNode();u.label=this.parseIdent(!0),u.optional=this.eat(t.question),this.expect(t.colon),u.elementType=this.$0(),c=this.finishNode(u,"TSNamedTupleMember")}else if(c=this.$0(),this.eat(t.question)){let u=this.startNodeAt(c.start,c.loc?.start);u.typeAnnotation=c,c=this.finishNode(u,"TSOptionalType")}if(p){let u=this.startNodeAt(o,a);u.typeAnnotation=c,c=this.finishNode(u,"TSRestType")}return c}$2d(){let o=this.$d();if(this.input.charCodeAt(o)===63)o=this.$d(o+1);return this.input.charCodeAt(o)===lp}$8(){return this.$a(()=>{let o=this.startNode();this.next(),o.params=[];while(!this.$c()){let a=this.startNode();while((this.type===t._const||this.type===t._in||this.isContextual("out"))&&r(this.$2()))a[this.value]=!0,this.next();if(a.name=this.$y(),this.eat(t._extends))a.constraint=this.$0();if(this.eat(t.eq))a.default=this.$0();if(o.params.push(this.finishNode(a,"TSTypeParameter")),!this.$c()){if(this.expect(t.comma),this.$c())o.extra={trailingComma:this.lastTokStart}}}if(this.next(),o.params.length===0)this.$1y(this.start,"Type parameter list cannot be empty.");return this.finishNode(o,"TSTypeParameterDeclaration")})}$e(o=!1){return this.$a(()=>{let a=this.startNode();this.next(),a.params=[];while(!this.$c())if(a.params.push(this.$0()),!this.$c())this.expect(t.comma);if(a.params.length===0)this.unexpected();if(o){let p=this.input.charCodeAt(this.start+1);if(p===Mn||p===Ty)this.unexpected()}return this.next(),this.finishNode(a,"TSTypeParameterInstantiation")})}$1j(){let o=[];do{let a=this.startNode();if(a.expression=this.$k(),this.$1())a.typeParameters=this.$e();o.push(this.finishNode(a,"TSExpressionWithTypeArguments"))}while(this.eat(t.comma));return o}$1k(o=!1){if(this.type!==t.name||this.containsEsc){if(this.type===t._const&&this.$3()==="enum")return this.$10(this.startNode());return}if(!this.$2e(this.value))return;if(this.value==="declare")return this.$2f(o);return this.$1l(this.startNode(),this.value)}$2e(o){switch(o){case"interface":case"type":case"namespace":return this.$14();case"enum":return r(this.$2());case"abstract":return this.$b()&&this.$3()==="class";case"module":{let a=this.$2();return this.$b()&&(a===Bs||a===Fs||r(a))}case"declare":return this.$b()&&ly.has(this.$3());case"global":return this.$b()&&this.$2()===Ii}return!1}$1l(o,a){switch(a){case"interface":return this.$1m(o);case"type":return this.$2g(o);case"enum":return this.$10(o);case"abstract":return this.$1n(o,!0);case"global":return o.global=!0,o.id=this.parseIdent(),o.body=this.$11(),this.finishNode(o,"TSModuleDeclaration")}return this.$2h(o)}$2f(o){let a=this.$5;this.$5=!0;let p=this.startNode();this.next();let c=this.value;if(c==="const"&&this.$3()==="enum")p.const=!0;if(!o&&py.has(c))p.declare=!0;let u;if(p.const)u=this.$10(p);else if(c==="var"||c==="let"||c==="const")u=this.parseVarStatement(p,c,!0);else if(c==="function")this.next(),u=this.parseFunction(p,sp,!1,!1);else if(c==="class")u=this.parseClass(p,!0);else u=this.$1l(p,c);return u.declare=!0,this.$5=a,u}$1n(o,a){return this.next(),o.abstract=!0,this.parseClass(o,a)}$1m(o){if(this.next(),o.id=this.parseIdent(),this.checkLValSimple(o.id,rp),this.$1())o.typeParameters=this.$8();return this.$a(()=>{if(this.eat(t._extends))o.extends=this.$1j();let a=this.startNode();a.body=this.$1f(),o.body=this.finishNode(a,"TSInterfaceBody")}),this.finishNode(o,"TSInterfaceDeclaration")}$2g(o){if(this.next(),o.id=this.parseIdent(),this.checkLValSimple(o.id,Ms),this.$1())o.typeParameters=this.$8();return o.typeAnnotation=this.$a(()=>(this.expect(t.eq),this.$0())),this.semicolon(),this.finishNode(o,"TSTypeAliasDeclaration")}$10(o){if(this.type===t._const)o.const=!0,this.next();this.next(),o.id=this.parseIdent(),this.checkLValSimple(o.id,gy),this.expect(t.braceL),o.members=[];while(!this.eat(t.braceR)){let a=this.startNode();if(a.id=this.type===t.string?this.parseExprAtom():this.parseIdent(!0),this.eat(t.eq))a.initializer=this.parseMaybeAssign();if(o.members.push(this.finishNode(a,"TSEnumMember")),this.type!==t.braceR)this.expect(t.comma)}return this.finishNode(o,"TSEnumDeclaration")}$2h(o){if(this.next(),this.type===t.string){if(o.id=this.parseExprAtom(),this.type===t.braceL)o.body=this.$11();else this.semicolon();return this.finishNode(o,"TSModuleDeclaration")}return o.id=this.parseIdent(),this.checkLValSimple(o.id,yy),this.$1o(o)}$1o(o){if(this.eat(t.dot)){let a=this.startNode();a.id=this.parseIdent(),o.body=this.$1o(a)}else o.body=this.$11();return this.finishNode(o,"TSModuleDeclaration")}$11(){this.enterScope(uy);let o=this.startNode();this.enterScope(0),this.expect(t.braceL),o.body=[];while(!this.eat(t.braceR))o.body.push(this.parseStatement(null,!0));return this.exitScope(),this.exitScope(),this.finishNode(o,"TSModuleBlock")}$1p(o,a){if(o.isExport=a,o.id=this.parseIdent(),this.checkLValSimple(o.id,On),this.expect(t.eq),this.isContextual("require")&&this.$2()===op){let p=this.startNode();this.next(),p.expression=this.$1e(),o.moduleReference=this.finishNode(p,"TSExternalModuleReference")}else o.moduleReference=this.$k();return this.semicolon(),this.finishNode(o,"TSImportEqualsDeclaration")}$2i(){let o=this.$d();if(this.input.charCodeAt(o)!==Mn)return!1;let a=this.input.charCodeAt(o+1);return a!==Mn&&a!==62}parseStatement(o,a,p){if(this.type===s)this.$1q(!0);let c=this.$1k();if(c)return c;return super.parseStatement(o,a,p)}parseVarStatement(o,a,p){return super.parseVarStatement(o,a,p||this.$5)}parseVarId(o,a){if(super.parseVarId(o,a),o.id.type==="Identifier"&&this.$u()&&!this.hasPrecedingLineBreak())this.next(),o.definite=!0;this.$h(o.id,!1)}parseCatchClauseParam(){let o=this.$h(this.parseBindingAtom(),!1),a=o.type==="Identifier";return this.enterScope(a?cy:0),this.checkLValPattern(o,a?my:On),this.expect(t.parenR),o}parseImport(o){if(this.next(),o.importKind="value",this.type===t.string)o.specifiers=[],o.source=this.parseExprAtom();else{if(this.isContextual("type")){let a=this.$2();if(a===Ii||a===Os||r(a)&&this.$3()!=="from")o.importKind="type",this.next()}if(this.type===t.name&&this.$2i())return this.$1p(o,!1);o.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),o.source=this.$z()}return this.$1r(o),this.semicolon(),this.finishNode(o,"ImportDeclaration")}parseWithClause(){if(this.isContextual("assert")&&!this.hasPrecedingLineBreak())this.type=t._with;return this.type===t._with?super.parseWithClause():void 0}$1r(o){let a=this.parseWithClause();if(a)o.attributes=a}parseImportSpecifier(){return this.$1s("importKind",()=>super.parseImportSpecifier())}parseExportSpecifier(o){return this.$1s("exportKind",()=>super.parseExportSpecifier(o))}$1s(o,a){let p=this.isContextual("type")?this.$2():-1;if(p===Bs||p===Fs||r(p)&&this.$3()!=="as"){let u=this.startNode();this.next();let f=a();return this.$q(f,u),f[o]="type",f}let c=a();return c[o]="value",c}parseExport(o,a){if(this.next(),this.eat(t._import)){if(o.importKind="value",this.isContextual("type")&&r(this.$2())&&this.$3()!=="from")o.importKind="type",this.next();return this.$1p(o,!0)}if(this.eat(t.eq))return o.expression=this.parseExpression(),this.semicolon(),this.finishNode(o,"TSExportAssignment");if(this.eatContextual("as"))return this.expectContextual("namespace"),o.id=this.parseIdent(),this.semicolon(),this.finishNode(o,"TSNamespaceExportDeclaration");if(o.exportKind="value",this.isContextual("type")){let u=this.$2();if(u===Ii||u===Os)o.exportKind="type",this.next()}if(this.eat(t.star))return this.parseExportAllDeclaration(o,a);if(this.eat(t._default)){if(this.isContextual("interface")&&this.$14())o.declaration=this.$1m(this.startNode());else if(this.isContextual("abstract")&&this.$3()==="class")o.declaration=this.$1n(this.startNode(),"nullableID");else o.declaration=this.parseExportDefaultDeclaration();return this.finishNode(o,"ExportDefaultDeclaration")}let p=this.isContextual("declare"),c=this.$1k(!0);if(c||this.shouldParseExportStatement()){if(o.declaration=c??this.parseStatement(null),p||o.declaration.type==="TSInterfaceDeclaration"||o.declaration.type==="TSTypeAliasDeclaration")o.exportKind="type";return o.specifiers=[],o.source=null,this.finishNode(o,"ExportNamedDeclaration")}if(o.declaration=null,o.specifiers=this.parseExportSpecifiers(a),this.eatContextual("from"))o.source=this.$z(),this.$1r(o);else{for(let u of o.specifiers)if(this.checkUnreserved(u.local),this.checkLocalExport(u.local),u.local.type==="Literal")this.raise(u.local.start,"A string literal cannot be used as an exported binding without `from`.");o.source=null}return this.semicolon(),this.finishNode(o,"ExportNamedDeclaration")}parseFunction(o,a,p,c,u){let f=a&sp;if(f)this.$f=o,this.$o=o.start;super.parseFunction(o,a,p,c,u),this.$f=null;let h=!o.body;if(h)o.type="TSDeclareFunction";if(f&&o.id){if(h){if(this.$5&&this.currentScope().flags&ip)this.declareName(o.id.name,Vs,o.id.start);this.checkLValSimple(o.id,dy)}else if(!(a&xy)){let m=hy;if(this.strict||o.generator||o.async)m=this.treatFunctionsAsVar?fy:On;this.checkLValSimple(o.id,m)}}return o}parseFunctionParams(o){if(this.$1())o.typeParameters=this.$8();if(super.parseFunctionParams(o),this.type===t.colon)o.returnType=this.$6(!0)}parseFunctionBody(o,a,p,c){if(p&&this.type===t.colon)o.returnType=this.$6(!0);if(a||this.type===t.braceL||o.start!==this.$o){super.parseFunctionBody(o,a,p,c);return}this.semicolon(),this.exitScope()}parseMethod(o,a,p){let c=this.$l;this.$l=null,this.$j=!0;let u=super.parseMethod(o,a,p);if(!u.body)u.type="TSDeclareMethod";if(c)u.typeParameters=c;return u}parseBindingList(o,a,p,c){let u=c===!0||this.$j;return this.$j=!1,super.parseBindingList(o,a,p,u)}$s(o){if(!o&&!this.$b())return!1;let a=this.$2();return a===vy||a===Ii||a===Os||a===ap||a===by||a===Bs||a===Fs||a>=48&&a<=57||r(a)}parseAssignableListItem(o){let a=this.$12(),p=this.start,c=this.startLoc,u,f=!1,h=!1;if(o)while(this.type===t.name&&ay.has(this.value)&&!this.containsEsc&&this.$s(!1)){if(this.value==="readonly")f=!0;else if(this.value==="override")h=!0;else u=this.value;this.next()}let m;if(this.type===t._this)m=this.startNode(),m.name="this",this.next(),this.finishNode(m,"Identifier");else m=this.parseBindingAtom();let g=this.type===t.eq?this.parseMaybeDefault(p,c,m):this.parseMaybeDefault(m.start,m.loc?.start,this.$h(m,!0));if(a.length>0)g.decorators=a;if(!u&&!f&&!h)return g;if(g.type!=="Identifier"&&g.type!=="AssignmentPattern")this.raise(p,"A parameter property may not be declared using a binding pattern.");let y=this.startNodeAt(p,c);if(u)y.accessibility=u;if(f)y.readonly=!0;if(h)y.override=!0;return y.parameter=g,this.finishNode(y,"TSParameterProperty")}parseBindingListItem(o){if(o.type==="RestElement")this.$h(o,!0);return o}checkLValSimple(o,a,p){if(this.$f&&o===this.$f.id){this.$f=null;return}if(!a&&np.has(o.type)){this.checkLValSimple(o.expression,a,p);return}switch(o.type){case"TSParameterProperty":this.checkLValInnerPattern(o.parameter,a,p);return;case"Identifier":if(o.name==="this")return}super.checkLValSimple(o,a,p)}toAssignable(o,a,p){if(o&&!a&&np.has(o.type))return o;return super.toAssignable(o,a,p)}declareName(o,a,p){let c=this.currentScope();if(a&Vs){this.$1t(c,o),c.$1u??=[],c.$1u.push(o);return}if(a===Ms||a===rp){if(c.$13??=[],a===Ms&&ee(c.$13,o))this.raise(p,`type '${o}' has already been declared.`);c.$13.push(o),this.$1t(c,o);return}if(a&cp){if(c.$1v??=[],ee(c.$1v,o))return;super.declareName(o,On,p),c.$1v.push(o);return}super.declareName(o,a,p)}$1t(o,a){if(this.inModule&&o.flags&ip)delete this.undefinedExports[a]}checkLocalExport(o){for(let a=this.scopeStack.length-1;a>=0;a--){let p=this.scopeStack[a];if(ee(p.$13,o.name)||ee(p.$1u,o.name))return}super.checkLocalExport(o)}checkExport(){}raiseRecoverable(o,a){if(a==="Duplicate constructor in the same class")return;super.raiseRecoverable(o,a)}$12(){let o=[];while(this.type===s)o.push(this.$1w());return o}$1q(o){let a=this.$9[this.$9.length-1];while(this.type===s)a.push(this.$1w());if(this.type===t._export){if(!o)this.unexpected()}else if(this.type!==t._class&&!((this.isContextual("abstract")||this.isContextual("declare"))&&this.$3()==="class"))this.raise(this.start,"Leading decorators must be attached to a class declaration.")}$1w(){let o=this.startNode();this.next(),this.$9.push([]);let a=this.start,p=this.startLoc,c;if(this.type===t.parenL){if(this.next(),c=this.parseExpression(),this.expect(t.parenR),this.options.preserveParens){let f=this.startNodeAt(a,p);f.expression=c,c=this.finishNode(f,"ParenthesizedExpression")}}else{c=this.parseIdent(!1);while(this.eat(t.dot)){let f=this.startNodeAt(a,p);f.object=c,f.property=this.parseIdent(!0),f.computed=!1,c=this.finishNode(f,"MemberExpression")}}let u=this.$p()?this.$e(!0):void 0;if(this.eat(t.parenL)){let f=this.startNodeAt(c.start,c.loc?.start);if(f.callee=c,f.arguments=this.parseExprList(t.parenR,!1,!1),u)f.typeArguments=u;c=this.finishNode(f,"CallExpression")}else if(u){let f=this.startNodeAt(c.start,c.loc?.start);f.expression=c,f.typeArguments=u,c=this.finishNode(f,"TSInstantiationExpression")}return o.expression=c,this.$9.pop(),this.finishNode(o,"Decorator")}shouldParseExportStatement(){return this.type===s||super.shouldParseExportStatement()}parseExprAtom(o,a,p){if(this.type===s)this.$1q(!1);return super.parseExprAtom(o,a,p)}parseProperty(o,a){if(o||this.type!==s)return super.parseProperty(o,a);let p=this.$12(),c=super.parseProperty(o,a);if(c.type==="SpreadElement")this.raise(c.start,"Decorators can't be used with SpreadElement");return c.decorators=p,c}parseClassId(o,a){let p=this.$9.length-1,c=this.$9[p];if(c.length>0)o.decorators=c,this.$q(o,c[0]),this.$9[p]=[];if(!this.isContextual("implements")||a===!0)super.parseClassId(o,a);if(this.$1())o.typeParameters=this.$8()}parseClassSuper(o){if(super.parseClassSuper(o),o.superClass&&this.$1())o.superTypeParameters=this.$e(!0);if(this.eatContextual("implements"))o.implements=this.$a(()=>this.$1j())}parseClassElement(o){if(this.type===s){let h=this.$12();if(this.type===t.braceR)this.raise(this.start,"Decorators must be attached to a class element.");let m=this.parseClassElement(o);return m.decorators=h,this.$q(m,h[0]),m}if(this.eat(t.semi))return null;let a=this.startNode();while(this.type===t.name&&oy.has(this.value)&&!this.containsEsc&&this.$s(this.value==="static")){let h=this.value;if(this.next(),h==="static"&&this.type===t.braceL)return this.next(),this.parseClassStaticBlock(a),a;if(h==="public"||h==="private"||h==="protected")a.accessibility=h;else a[h]=!0}if(this.type===t.bracketL&&this.$1g())return this.$1h(a);a.static??=!1;let p="",c=!1,u=!1,f="method";if(this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===t.star)&&!this.canInsertSemicolon())u=!0;else p="async";if(!p&&this.eat(t.star))c=!0;if(!p&&!u&&!c){let h=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())f=h;else p=h}if(p)a.computed=!1,a.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),a.key.name=p,this.finishNode(a.key,"Identifier");else this.parseClassElementName(a);if(this.eat(t.question))a.optional=!0;if(this.type===t.parenL||this.$1()||f!=="method"||c||u){let h=a.key,m=!a.static&&!a.computed&&(h.type==="Identifier"&&h.name==="constructor"||h.type==="Literal"&&h.value==="constructor");if(a.kind=m?"constructor":f,this.$1())a.typeParameters=this.$8();this.$o=this.start,this.parseClassMethod(a,c,u,m&&o)}else{if(!a.optional&&this.$u())this.next(),a.definite=!0;if(this.type===t.colon)a.typeAnnotation=this.$6();this.parseClassField(a)}return a}parseMaybeAssign(o,a,p){if(this.$p()){let c=this.$g(()=>{let u=this.$8(),f=super.parseMaybeAssign(o,a,p);if(f.type!=="ArrowFunctionExpression")return;return f.typeParameters=u,this.$q(f,u),f});if(c)return c}return super.parseMaybeAssign(o,a,p)}parseMaybeUnary(o,a,p,c){if(this.$p()){let u=this.startNode();return u.typeAnnotation=this.$a(()=>{this.next();let f=this.$0();if(!this.$c())this.unexpected();return this.next(),f}),u.expression=this.parseMaybeUnary(null,!1,!1,c),this.finishNode(u,"TSTypeAssertion")}return super.parseMaybeUnary(o,a,p,c)}parseMaybeConditional(o,a){let p=this.start,c=this.startLoc,u=this.parseExprOps(o,a);if(this.checkExpressionErrors(a))return u;if(this.type===t.question&&!(u.type==="ArrowFunctionExpression"&&u.start===p)&&!this.$2j()){this.next();let f=this.startNodeAt(p,c);return f.test=u,f.consequent=this.parseMaybeAssign(),this.expect(t.colon),f.alternate=this.parseMaybeAssign(o),this.finishNode(f,"ConditionalExpression")}return u}$2j(){let o=this.$d(),a=this.input.charCodeAt(o);if(a===lp||a===Ey||a===Sy)return!0;return a===Mn&&this.input.charCodeAt(o+1)!==Mn}parseParenItem(o){return this.$h(o,!0)}$1x(){if(this.type!==t.colon)return!0;let o=this.$g(()=>{let a=this.$6(!0);return this.type===t.arrow&&!this.canInsertSemicolon()?a:void 0});if(!o)return!1;return this.$7=o,!0}shouldParseArrow(o){return this.$1x()&&super.shouldParseArrow(o)}shouldParseAsyncArrow(){return this.$1x()&&super.shouldParseAsyncArrow()}parseArrowExpression(o,a,p,c){if(this.$7)o.returnType=this.$7,this.$7=null;return super.parseArrowExpression(o,a,p,c)}parseExprList(o,a,p,c){if(!this.$m)return super.parseExprList(o,a,p,c);this.$m=!1;let u=[],f=!0;while(!this.eat(o)){if(f)f=!1;else if(this.expect(t.comma),a&&this.afterTrailingComma(o))break;if(this.type===t.ellipsis){let h=this.parseSpread(c);if(this.eat(t.question))h.optional=!0;if(this.type===t.colon)h.typeAnnotation=this.$6();u.push(h)}else u.push(this.parseMaybeAssign(!1,c,this.parseParenItem))}return u}parseSubscript(o,a,p,c,u,f,h){if(this.$u()&&!this.hasPrecedingLineBreak()){let g=this.startNodeAt(a,p);return this.exprAllowed=!1,this.next(),g.expression=o,this.finishNode(g,"TSNonNullExpression")}if(u&&this.$1()){let g=this.$g(()=>this.$2k(a,p,h));if(g)return g}let m=this.type===t.questionDot&&this.$2()===pp;if(this.$1()||m||this.type===t.bitShift&&this.value==="<<"){let g=this.$g(()=>{if(m)this.next();this.$p();let y=this.$e(!0);if(this.type===t.parenL&&!c)return y;if(this.type===t.backQuote)return m?void 0:y;if(m)return;if(this.$c()||this.type===t.bitShift||this.type.startsExpr&&this.type!==t.parenL&&!this.hasPrecedingLineBreak())return;return y});if(g){let y=this.startNodeAt(a,p);if(this.type===t.parenL&&!c){if(this.next(),y.callee=o,y.arguments=this.parseExprList(t.parenR,!0,!1),y.typeArguments=g,m)o.optional=!0;if(m||f)y.optional=m;return this.finishNode(y,"CallExpression")}if(this.type===t.backQuote)return y.tag=o,y.quasi=this.parseTemplate({isTagged:!0}),y.typeArguments=g,this.finishNode(y,"TaggedTemplateExpression");return y.expression=o,y.typeArguments=g,this.finishNode(y,"TSInstantiationExpression")}}if(u&&this.type===t.parenL)this.$m=!0;return super.parseSubscript(o,a,p,c,u,f,h)}$2k(o,a,p){let c=this.startNodeAt(o,a);if(c.typeParameters=this.$8(),this.expect(t.parenL),c.params=this.parseBindingList(t.parenR,!1,!0),this.type===t.colon)c.returnType=this.$6(!0);if(this.type!==t.arrow||this.canInsertSemicolon())return;return this.next(),this.parseArrowExpression(c,c.params,!0,p)}parseDynamicImport(o){if(this.next(),o.source=this.parseMaybeAssign(),this.eat(t.comma)&&this.type!==t.parenR)o.arguments=[this.parseExpression()];return this.expect(t.parenR),this.finishNode(o,"ImportExpression")}parseNew(){let o=super.parseNew();if(o.callee?.type!=="TSInstantiationExpression")return o;let a=this.startNodeAt(o.start,o.loc?.start);return a.callee=o.callee.expression,a.typeArguments=o.callee.typeArguments,a.arguments=o.arguments,this.finishNodeAt(a,"NewExpression",o.end,o.loc?.end)}parseExprOp(o,a,p,c,u){if(t._in.binop>c&&this.type===t.name&&(this.value==="as"||this.value==="satisfies")&&!this.containsEsc&&!this.hasPrecedingLineBreak()){let f=this.value==="satisfies",h=this.startNodeAt(a,p);return h.expression=o,h.typeAnnotation=this.$a(()=>{if(this.next(),!f&&this.type===t._const){let m=this.startNode();return m.typeName=this.parseIdent(!0),this.finishNode(m,"TSTypeReference")}return this.$0()}),this.finishNode(h,f?"TSSatisfiesExpression":"TSAsExpression"),this.parseExprOp(h,a,p,c,u)}return super.parseExprOp(o,a,p,c,u)}parseGetterSetter(o){o.kind=o.key.name,super.parseGetterSetter(o)}parsePropertyValue(o,a,p,c,u,f,h,m){if(!a&&this.$1()){if(this.$l=this.$8(),this.type!==t.parenL)this.unexpected();o.kind="init"}return super.parsePropertyValue(o,a,p,c,u,f,h,m)}}return l});var js=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".split(" ")),Ay=new Set("any bigint boolean false never null number object string symbol true undefined unknown void".split(" ")),Py=new Set("get set new readonly static public private protected".split(" "));function up(e){return e>=97&&e<=122||e>=65&&e<=90||e===95||e===36}function Ri(e){return e>=48&&e<=57}function Gs(e){return up(e)||Ri(e)}class dp{text;pos=0;constructor(e){this.text=e}readAll(){if(!this.type())return!1;return this.peek(),this.pos===this.text.length}peek(){let e=this.text,t=this.pos,n=e.charCodeAt(t);while(n===32||n===9)n=e.charCodeAt(++t);return this.pos=t,n}eat(e){if(this.peek()!==e.charCodeAt(0))return!1;return this.pos++,!0}word(){let e=this.pos;return this.skipWord()?this.text.slice(e,this.pos):void 0}skipWord(){if(!up(this.peek()))return!1;let e=this.pos+1;while(Gs(this.text.charCodeAt(e)))e++;return this.pos=e,!0}keyword(e){this.peek();let t=this.pos+e.length;if(!this.text.startsWith(e,this.pos)||Gs(this.text.charCodeAt(t)))return!1;return this.pos=t,!0}name(){let e=this.word();return e!==void 0&&!js.has(e)}string(){let e=this.peek();if(e!==34&&e!==39)return!1;let t=this.text;for(let n=this.pos+1;n<t.length;n++){let i=t.charCodeAt(n);if(i===e)return this.pos=n+1,!0;if(i===92||i===10||i===13||i===8232||i===8233)return!1}return!1}number(){let e=this.text,t=this.pos;if(e.charCodeAt(t)===45)t++;let n=t;while(Ri(e.charCodeAt(t)))t++;if(t===n||t-n>1&&e.charCodeAt(n)===48)return!1;if(e.charCodeAt(t)===46){let r=++t;while(Ri(e.charCodeAt(t)))t++;if(t===r)return!1}let i=e.charCodeAt(t);if(Gs(i)||i===46)return!1;return this.pos=t,!0}type(){if(this.peek()===40){let e=this.pos;if(this.functionType())return!0;this.pos=e}do do if(!this.operatorType())return!1;while(this.eat("&"));while(this.eat("|"));return!0}operatorType(){if(this.keyword("keyof"))return this.operatorType();if(!this.primaryType())return!1;while(this.eat("[")){if(this.eat("]"))continue;if(!this.type()||!this.eat("]"))return!1}return!0}primaryType(){let e=this.peek();if(e===40)return this.pos++,this.type()&&this.eat(")");if(e===123)return this.objectType();if(e===91)return this.tupleType();if(e===34||e===39)return this.string();if(e===45||Ri(e))return this.number();let t=this.word();if(t===void 0)return!1;if(t==="typeof")return this.typeQuery();if(t==="import")return this.importType(!0);if(Ay.has(t)){let n=this.peek();return n!==46&&n!==60}if(js.has(t))return!1;while(this.eat("."))if(!this.skipWord())return!1;return!this.eat("<")||this.typeArguments()}typeArguments(){do if(!this.type())return!1;while(this.eat(","));return this.eat(">")}typeQuery(){if(this.keyword("import"))return this.importType(!1);do if(!this.name())return!1;while(this.eat("."));return!0}importType(e){if(!this.eat("(")||!this.string()||!this.eat(")"))return!1;while(this.eat("."))if(!this.name())return!1;return!e||!this.eat("<")||this.typeArguments()}objectType(){this.pos++;while(!this.eat("}")){if(!this.typeMember())return!1;if(!this.eat(";")&&!this.eat(",")&&this.peek()!==125)return!1}return!0}typeMember(){let e=this.peek();if(this.eat("[")){let t=this.peek();if(t===34||t===39){if(!this.string()||!this.eat("]"))return!1}else return this.name()&&this.eat(":")&&this.type()&&this.eat("]")&&this.eat(":")&&this.type()}else if(e===34||e===39){if(!this.string())return!1}else{let t=this.word();if(t===void 0||Py.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(){if(this.pos++,!this.eat(")")){let e=new Set;for(;;){this.peek();let t=this.text.startsWith("...",this.pos);if(t)this.pos+=3;let n=this.word();if(n===void 0||js.has(n)||e.has(n))return!1;if(e.add(n),!t)this.eat("?");if(!this.eat(":")||!this.type())return!1;if(t||!this.eat(","))break}if(!this.eat(")"))return!1}if(this.peek(),!this.text.startsWith("=>",this.pos))return!1;return this.pos+=2,this.type()}}function wy(e){return new dp(e).readAll()}var ky=V.extend(Li);function Bn(e,t={}){return wy(e)||_y(e,t.inline??!1)}function _y(e,t){let n=!1,i=new ky(t?{ecmaVersion:16,sourceType:"module",onComment:(r,s,l,o)=>{if(!r&&o===e.length)n=!0}}:{ecmaVersion:16,sourceType:"module"},e);try{return i.parseWholeType(),!n}catch(r){if(r instanceof SyntaxError)return!1;throw r}}var Ws=/<!--[\s\S]*?-->|<script\s+(?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?([^"' >]+)\1[^>]*>/y;function Oi(e){return e.charCodeAt(0)===65279?e.slice(1):e}function Ne(e){return e>=48&&e<=57}function H(e){if(e===32||e<=13&&e>=9)return!0;if(e<160)return!1;return e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288||e===65279}function R(e,t){let n=t;while(n<e.length&&H(e.charCodeAt(n)))n++;return n}function Bi(e){let t=e.indexOf("<");while(t!==-1){let n=e.charCodeAt(t+1);if(n===33||n===115){Ws.lastIndex=t;let i=Ws.exec(e);if(i){if(n===115)return i[2]==="ts";t=e.indexOf("<",Ws.lastIndex);continue}}t=e.indexOf("<",t+1)}return!1}function Fi(e,t){let n=e.indexOf("</script",t);while(n!==-1){if(e.charCodeAt(R(e,n+8))===Mi)return n;n=e.indexOf("</script",n+8)}return-1}function Vi(e,t){return R(e,t+8)+1}var Ny=new Set("area base br col command embed hr img input keygen link meta param source track wbr".split(" "));function Fn(e){return Ny.has(e)||e.charCodeAt(0)===33&&e.toLowerCase()==="!doctype"}function ji(e,t){let n=t;while(n<e.length){let i=e.charCodeAt(n);if(i===47&&e.charCodeAt(n+1)===42){let r=e.indexOf("*/",n+2);n=r===-1?e.length:r+2}else if(i===34||i===39){n++;while(n<e.length){let r=e.charCodeAt(n);if(r===i||r===10)break;n+=r===92?2:1}n++}else if(i===60&&e.startsWith("</style",n))break;else n++}return Math.min(n,e.length)}var Dy=34,$y=39,fp=47,hp=61,Mi=62,ve=(e)=>e===Dy||e===$y;function St(e,t,n){let i=t;for(;i<e.length;i++){let r=e.charCodeAt(i);if(H(r)||r===fp||r===Mi)break;if(n&&(ve(r)||r===hp))break}return i}function Gi(e,t){let n=e.charCodeAt(t);return H(n)||ve(n)||n===hp||n===60||n===Mi||n===96||n===fp&&e.charCodeAt(t+1)===Mi}var Et=0,P=1,De=2,L=3,gp=0,mp=1,xp=2,jn=3,Ks=4,Wt=4,qs=5,Wi=6,Sp=7,Iy={await:P,case:P,default:P,delete:P,extends:P,in:P,instanceof:P,new:P,of:P,return:P,throw:P,typeof:P,void:P,yield:P,do:De,else:De,finally:De,try:De,for:Wt,if:Wt,while:Wt,with:Wt,import:qs,export:Wi,require:Sp},Ep=10,zs=Array(Js(128,0)).fill(null);for(let e of Object.entries(Iy)){let t=Js(e[0].charCodeAt(0),e[0].length),n=zs[t]??[];n.push(e),zs[t]=n}function Js(e,t){return e*(Ep+1)+t}function Tp(e,t,n){let i=e.charCodeAt(t);if(i>=128||n-t>Ep)return L;let r=Js(i,n-t),s=zs[r];if(s===null)return L;for(let l=0;l<s.length;l++)if(e.startsWith(s[l][0],t))return s[l][1];return L}var vp=new Uint8Array(128);for(let e of["az","AZ","09","__","$$","\\\\"])for(let t=e.charCodeAt(0);t<=e.charCodeAt(1);t++)vp[t]=1;function Tt(e){return e>=128?!H(e):vp[e]===1}function bp(e,t,n,i=!1){Ly(e,Ry(e,t,i),t,i,n,void 0,void 0)}function Ly(e,t,n,i,r,s,l){let o=[],a=e.startsWith("#!")?Pp(e,2):0,p=Et,c=!1,u=!1,f=-1,h=()=>{if(p=Et,o.length===0)f=-1};while(a<=t){let m=e.charCodeAt(a);if(m===32||m===10||H(m)){a++;continue}if(m===47){let E=Xs(e,a);if(E!==-1){a=E;continue}}let g=c,y=u;if(c=!1,u=!1,Tt(m)||m===35){let E=a;a=wp(e,a+1);let v=g?L:Tp(e,E,a);if(l!==void 0&&(v===qs||v===Sp))l(E,p===Et||p===L);if(r!==void 0&&o.length===0&&(v===Wi?n||Np(e,a,i):v===qs&&_p(e,a)))a=Math.max(a,r(f!==-1&&v===Wi?f:E,E)),h();else if(v===Wi)p=De;else if(v===Wt)u=!0,p=L;else p=v===P||v===De?v:L;continue}switch(a++,m){case 34:case 39:{let E=a-1;a=Ys(e,a,m),s?.(E,a,!1),p=L;break}case 96:{let E=a;a=Ui(e,a,o),s?.(E,yp(e,a),!0),p=e.charCodeAt(a-1)===123?P:L;break}case 47:{let E=p===L?-1:kp(e,a);if(E===-1)p=P;else a=Hi(e,E),p=L;break}case 40:o.push(y?mp:gp),p=P;break;case 41:p=o.pop()===mp?De:L;break;case 123:o.push(p===P?jn:xp),p=Et;break;case 125:{let E=o.pop();if(E===Ks){let v=a;a=Ui(e,a,o),s?.(v,yp(e,a),!0),p=e.charCodeAt(a-1)===123?P:L}else if(E===jn)p=L;else h();break}case 59:h();break;case 44:p=o[o.length-1]===jn?Et:P;break;case 93:p=L;break;case 46:if(Ne(e.charCodeAt(a)))a=Hi(e,a),p=L;else if(e.startsWith("..",a))a+=2,p=P;else c=!0,p=P;break;case 63:if(e.charCodeAt(a)===46&&!Ne(e.charCodeAt(a+1)))a++,c=!0;p=P;break;case 33:p=p===L&&!H(e.charCodeAt(a-2))?L:P;break;case 43:case 45:if(e.charCodeAt(a)===m&&p===L)a++;else p=P;break;case 61:if(p=e.charCodeAt(a)===62?De:P,p===De)a++;break;case 64:if(o.length===0&&f===-1)f=a-1;p=P;break;default:p=P}}}function Cp(e,t,n){let i=e.length,r=[],s=t,l=P,o=!1;while(s<i){let a=e.charCodeAt(s);if(a===32||a===10||H(a)){s++;continue}if(a===47){let c=Xs(e,s);if(c!==-1){s=c;continue}}let p=o;if(o=!1,Tt(a)||a===35){let c=s;if(s=wp(e,s+1),!p&&n?.(c,s))return-1;let u=p?L:Tp(e,c,s);l=u===P||u===De||u===Wt?P:L;continue}switch(s++,a){case 34:case 39:s=Ys(e,s,a),l=L;break;case 96:s=Ui(e,s,r),l=e.charCodeAt(s-1)===123?P:L;break;case 47:{let c=l===L?-1:kp(e,s);if(c===-1)l=P;else s=Hi(e,c),l=L;break}case 40:r.push(gp),l=P;break;case 41:if(r.length===0)return s-1;r.pop(),l=L;break;case 123:r.push(l===P?jn:xp),l=Et;break;case 125:{if(r.length===0)return s-1;let c=r.pop();if(c===Ks)s=Ui(e,s,r),l=e.charCodeAt(s-1)===123?P:L;else l=c===jn?L:Et;break}case 93:l=L;break;case 46:if(Ne(e.charCodeAt(s)))s=Hi(e,s),l=L;else if(e.startsWith("..",s))s+=2,l=P;else o=!0,l=P;break;case 63:if(e.charCodeAt(s)===46&&!Ne(e.charCodeAt(s+1)))s++,o=!0;l=P;break;case 33:l=l===L&&!H(e.charCodeAt(s-2))?L:P;break;case 43:case 45:if(e.charCodeAt(s)===a&&l===L)s++;else l=P;break;case 61:if(e.charCodeAt(s)===62)s++;l=P;break;default:l=P}}return i}function Ap(e){return e===10||e===13||e===8232||e===8233}function Pp(e,t){for(let n=t;n<e.length;n++)if(Ap(e.charCodeAt(n)))return n;return e.length}function Xs(e,t){let n=e.charCodeAt(t+1);if(n===47)return Pp(e,t+2);if(n!==42)return-1;let i=e.indexOf("*/",t+2);return i===-1?e.length:i+2}function wp(e,t){let n=t;while(n<e.length){let i=e.charCodeAt(n);if(i===92)n+=2;else if(Tt(i))n++;else break}return n}function Hi(e,t){let n=t;while(n<e.length&&Tt(e.charCodeAt(n)))n++;return n}function Ys(e,t,n){for(let i=t;i<e.length;i++){let r=e.charCodeAt(i);if(r===n)return i+1;if(r===92)i+=e.startsWith(`\r
|
|
40
|
-
`,i+1)?2:1;else if(r===10||r===13)return i}return e.length}function
|
|
41
|
-
`,i+2);i=a===-1?e.length:a}else break;i=R(e,i)}let r=i;if(e.charCodeAt(i)===
|
|
42
|
-
https://svelte.dev/e/${t}`);this.code=t,this.reason=n;let i=typeof e==="number"?e:e?.start,r=typeof e==="number"?e:e?.end;if(i!==void 0)this.position=[i,r??i],this.start=Pe(this.position[0]),this.end=Pe(this.position[1]),this.frame=
|
|
43
|
-
${" ".repeat(r+2+
|
|
44
|
-
`)}function
|
|
45
|
-
`)){let a=
|
|
46
|
-
`,n-1)+1,p=a,c=
|
|
39
|
+
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return ki(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:if(this.options.locations)this.lineStart=this.pos,++this.curLine;return"";case 56:case 57:if(this.strict)this.invalidStringToken(this.pos-1,"Invalid escape sequence");if(e){var n=this.pos-1;this.invalidStringToken(n,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(i,8);if(r>255)i=i.slice(0,-1),r=parseInt(i,8);if(this.pos+=i.length-1,t=this.input.charCodeAt(this.pos),(i!=="0"||t===56||t===57)&&(this.strict||e))this.invalidStringToken(this.pos-1-i.length,e?"Octal literal in template string":"Octal literal in strict mode");return String.fromCharCode(r)}if(Gt(t)){if(this.options.locations)this.lineStart=this.pos,++this.curLine;return""}return String.fromCharCode(t)}};k.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);if(n===null)this.invalidStringToken(t,"Bad character escape sequence");return n};k.readWord1=function(){this.containsEsc=!1;var e="",t=!0,n=this.pos,i=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var r=this.fullCharCodeAtPos();if(Ne(r,i))this.pos+=r<=65535?1:2;else if(r===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var s=this.pos;if(this.input.charCodeAt(++this.pos)!==117)this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX");++this.pos;var l=this.readCodePoint();if(!(t?be:Ne)(l,i))this.invalidStringToken(s,"Invalid Unicode escape");e+=ki(l),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)};k.readWord=function(){var e=this.readWord1(),t=d.name;if(this.keywords.test(e))t=Ds[e];return this.finishToken(t,e)};var yy="8.19.0";V.acorn={Parser:V,version:yy,defaultOptions:ks,Position:Dn,SourceLocation:_i,getLineInfo:Kl,Node:Ii,TokenType:I,tokTypes:d,keywordTypes:Ds,TokContext:Te,tokContexts:B,isIdentifierChar:Ne,isIdentifierStart:be,Token:Os,isNewLine:Gt,lineBreak:ee,lineBreakG:ty,nonASCIIwhitespace:zl};function Rn(e){return(t)=>e(t)}function Li(...e){return V.extend(...e)}function Mn(e,t,n){for(let i=t;i<n;i++){let r=e.charCodeAt(i);if(r===10||r===13||r===8232||r===8233)return!0}return!1}var Hl=new WeakMap;function te(e,t){if(e===void 0)return!1;if(e.length<16)return e.includes(t);let n=Hl.get(e);if(n===void 0||n.length>e.length)n={names:new Set,length:0},Hl.set(e,n);while(n.length<e.length)n.names.add(e[n.length++]);return n.names.has(t)}var Bs=/(?:\s|\/\/.*|\/\*[\s\S]*?\*\/)*/g,gy=new Map([["any","TSAnyKeyword"],["bigint","TSBigIntKeyword"],["boolean","TSBooleanKeyword"],["never","TSNeverKeyword"],["null","TSNullKeyword"],["number","TSNumberKeyword"],["object","TSObjectKeyword"],["string","TSStringKeyword"],["symbol","TSSymbolKeyword"],["undefined","TSUndefinedKeyword"],["unknown","TSUnknownKeyword"],["void","TSVoidKeyword"]]),xy=new Set("public private protected readonly declare abstract override static accessor".split(" ")),Ey=new Set("public private protected readonly override".split(" ")),Sy=new Set("var let const function class abstract enum interface type namespace module global".split(" ")),Ty=new Set("var let const function class interface enum".split(" ")),lp=new Set(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"]),pp=1,by=32,vy=256,Cy=0,Ay=1,Bn=2,wy=3,Py=4,Fs=6,cp=7,yp=256,Ws=1024,ky=8|Ws,_y=Bn|yp,up=1,Ny=2,dp=40,Dy=41,$y=44,fp=46,hp=58,On=61,mp=60,Iy=62,Ri=123,Ly=91,Vs=42,Ry=35,js=34,Gs=39,My=SyntaxError("speculative parse failed"),Mi=Rn((e)=>{let{tokTypes:t,keywordTypes:n,isIdentifierChar:i,isIdentifierStart:r}=e.acorn,s=new e.acorn.TokenType("@");class l extends e{inType=!1;$4=!1;$5=!1;$7=null;$l=null;$j=!1;$m=!1;$f=null;$9=[[]];$n=0;$t=0;$o=-1;constructor(o,a,p){super(o,a,p);let c=this.options.onComment;if(typeof c==="function")this.options.onComment=(u,f,h,m,g,y)=>{if(h<this.$t)return;this.$t=m,c.call(this,u,f,h,m,g,y)}}reset(){this.inType=!1,this.$4=!1,this.$5=!1,this.$7=null,this.$l=null,this.$j=!1,this.$m=!1,this.$f=null,this.$9=[[]],this.$n=0,this.$t=0,this.$o=-1}getTokenFromCode(o){if(o===64)return++this.pos,this.finishToken(s);return super.getTokenFromCode(o)}readToken_lt_gt(o){if(this.inType)return this.finishOp(t.relational,1);return super.readToken_lt_gt(o)}$a(o){let a=this.inType;this.inType=!0;let p=o();if(this.inType=a,!a&&this.type===t.relational)this.pos=this.start,this.nextToken();return p}$1(){return this.type===t.relational&&this.value==="<"}$p(){if(this.type===t.bitShift&&this.value==="<<")this.pos=this.start+1,this.finishToken(t.relational,"<");return this.$1()}$c(){return this.type===t.relational&&this.value===">"}$u(){return this.type===t.prefix&&this.value==="!"}hasPrecedingLineBreak(){return Mn(this.input,this.lastTokEnd,this.start)}$d(o=this.pos){return Bs.lastIndex=o,Bs.exec(this.input),Bs.lastIndex}$2(){return this.input.charCodeAt(this.$d())}$3(){let o=this.$d(),a=o;while(a<this.input.length&&i(this.input.charCodeAt(a)))a++;return this.input.slice(o,a)}$b(){return!Mn(this.input,this.pos,this.$d())}$14(){return this.$b()&&r(this.$2())&&!Object.hasOwn(n,this.$3())}$15(){return{pos:this.pos,type:this.type,value:this.value,start:this.start,end:this.end,startLoc:this.startLoc,endLoc:this.endLoc,lastTokStart:this.lastTokStart,lastTokEnd:this.lastTokEnd,lastTokStartLoc:this.lastTokStartLoc,lastTokEndLoc:this.lastTokEndLoc,curLine:this.curLine,lineStart:this.lineStart,context:this.context.slice(),exprAllowed:this.exprAllowed,containsEsc:this.containsEsc,inType:this.inType,$4:this.$4,$5:this.$5,$7:this.$7,scopes:this.scopeStack.length,privateNames:this.privateNameStack.length,labels:this.labels,labelCount:this.labels.length,strict:this.strict,yieldPos:this.yieldPos,awaitPos:this.awaitPos,awaitIdentPos:this.awaitIdentPos,potentialArrowAt:this.potentialArrowAt,potentialArrowInForAwait:this.potentialArrowInForAwait}}$16(o){this.pos=o.pos,this.type=o.type,this.value=o.value,this.start=o.start,this.end=o.end,this.startLoc=o.startLoc,this.endLoc=o.endLoc,this.lastTokStart=o.lastTokStart,this.lastTokEnd=o.lastTokEnd,this.lastTokStartLoc=o.lastTokStartLoc,this.lastTokEndLoc=o.lastTokEndLoc,this.curLine=o.curLine,this.lineStart=o.lineStart,this.context=o.context,this.exprAllowed=o.exprAllowed,this.containsEsc=o.containsEsc,this.inType=o.inType,this.$4=o.$4,this.$5=o.$5,this.$7=o.$7,this.$j=!1,this.scopeStack.length=o.scopes,this.privateNameStack.length=o.privateNames,this.labels=o.labels,this.labels.length=o.labelCount,this.strict=o.strict,this.yieldPos=o.yieldPos,this.awaitPos=o.awaitPos,this.awaitIdentPos=o.awaitIdentPos,this.potentialArrowAt=o.potentialArrowAt,this.potentialArrowInForAwait=o.potentialArrowInForAwait}raise(o,a){if(this.$n>0)throw My;return super.raise(o,a)}$1y(o,a){try{super.raise(o,a)}catch(p){if(p instanceof SyntaxError)p.$1z=!0;throw p}throw Error("unreachable")}$g(o,a=!1){let p=this.$15();this.$n++;try{let c=o();if(a||c===void 0)this.$16(p);return c}catch(c){if(!(c instanceof SyntaxError)||!a&&c.$1z)throw c;this.$16(p);return}finally{this.$n--}}$v(o){return this.$g(o,!0)===!0}$17(o){if(o.end=this.lastTokEnd,this.options.locations)o.loc.end=this.lastTokEndLoc}$q(o,a){if(o.start=a.start,this.options.locations)o.loc.start=a.loc.start}$6(o=!1){let a=this.startNode();return a.typeAnnotation=this.$a(()=>(this.next(),o?this.$20():this.$0())),this.finishNode(a,"TSTypeAnnotation")}$h(o,a){if(a&&this.eat(t.question))o.optional=!0,this.$17(o);if(this.type===t.colon)o.typeAnnotation=this.$6(),this.$17(o);return o}$20(){if(this.type!==t.name&&this.type!==t._this)return this.$0();if(this.isContextual("asserts")&&this.$b()&&r(this.$2())){let o=this.startNode();if(this.next(),o.parameterName=this.type===t._this?this.$w():this.parseIdent(),this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.$x(o,!0);return o.asserts=!0,o.typeAnnotation=null,this.finishNode(o,"TSTypePredicate")}if(this.$3()==="is"&&this.$b()){let o=this.startNode();return o.parameterName=this.type===t._this?this.$w():this.parseIdent(!0),this.$x(o,!1)}return this.$0()}$x(o,a){this.next();let p=this.startNode();return p.typeAnnotation=this.$0(),o.typeAnnotation=this.finishNode(p,"TSTypeAnnotation"),o.asserts=a,this.finishNode(o,"TSTypePredicate")}$w(){let o=this.startNode();return this.next(),this.finishNode(o,"TSThisType")}parseWholeType(){this.inType=!0,this.nextToken();let o=this.$0();if(this.type!==t.eof)this.unexpected();return o}$0(){let o=this.$18();if(this.$4||this.type!==t._extends||this.hasPrecedingLineBreak())return o;let a=this.startNodeAt(o.start,o.loc?.start);return this.next(),a.checkType=o,a.extendsType=this.$i(!0,()=>this.$18()),this.expect(t.question),a.trueType=this.$i(!1,()=>this.$0()),this.expect(t.colon),a.falseType=this.$i(!1,()=>this.$0()),this.finishNode(a,"TSConditionalType")}$i(o,a){let p=this.$4;this.$4=o;let c=a();return this.$4=p,c}$18(){if(this.$21())return this.$19("TSFunctionType");if(this.type===t._new||this.isContextual("abstract")&&this.$3()==="new")return this.$19("TSConstructorType");return this.$1a("TSUnionType",t.bitwiseOR,()=>this.$1a("TSIntersectionType",t.bitwiseAND,()=>this.$1b()))}$19(o){let a=this.startNode();if(o==="TSConstructorType"){if(a.abstract=this.isContextual("abstract"),a.abstract)this.next();this.next()}return this.$i(!1,()=>this.$r(a,t.arrow)),this.finishNode(a,o)}$r(o,a){if(this.$1())o.typeParameters=this.$8();if(this.expect(t.parenL),o.parameters=this.parseBindingList(t.parenR,!1,!0),this.type===a)o.typeAnnotation=this.$6(!0);else if(a===t.arrow)this.unexpected()}$21(){if(this.$1())return!0;if(this.type!==t.parenL)return!1;return this.$v(()=>{if(this.next(),this.type===t.parenR||this.type===t.ellipsis)return!0;if(this.type===t.name||this.type===t._this)this.next();else if(this.type===t.braceL||this.type===t.bracketL)this.parseBindingAtom();else return!1;let o=this.type;if(o===t.colon||o===t.comma||o===t.question||o===t.eq)return!0;if(o!==t.parenR)return!1;return this.next(),this.type===t.arrow})}$1a(o,a,p){let c=this.startNode(),u=this.eat(a),f=[];do f.push(p());while(this.eat(a));if(f.length===1&&!u)return f[0];return c.types=f,this.finishNode(c,o)}$1b(){if(this.type===t.name&&!this.containsEsc){let o=this.value;if(o==="keyof"||o==="unique"||o==="readonly"){let a=this.startNode();return this.next(),a.operator=o,a.typeAnnotation=this.$1b(),this.finishNode(a,"TSTypeOperator")}if(o==="infer"){let a=this.startNode();this.next();let p=this.startNode();p.name=this.$y();let c=this.$g(()=>this.$22());if(c)p.constraint=c;return a.typeParameter=this.finishNode(p,"TSTypeParameter"),this.finishNode(a,"TSInferType")}}return this.$i(!1,()=>this.$23())}$22(){if(!this.eat(t._extends))return;let o=this.$i(!0,()=>this.$0());return this.$4||this.type!==t.question?o:void 0}$y(){if(this.type!==t.name&&!this.type.keyword)this.unexpected();let o=this.type===t.name?this.value:this.type.keyword;return this.next(),o}$23(){let o=this.$24();while(!this.hasPrecedingLineBreak()&&this.eat(t.bracketL)){let a=this.startNodeAt(o.start,o.loc?.start);if(this.eat(t.bracketR))a.elementType=o,o=this.finishNode(a,"TSArrayType");else a.objectType=o,a.indexType=this.$0(),this.expect(t.bracketR),o=this.finishNode(a,"TSIndexedAccessType")}return o}$24(){switch(this.type){case t.name:case t._void:case t._null:{let o=gy.get(this.value);if(o&&(this.type!==t.name||!this.containsEsc&&this.$2()!==fp)){let a=this.startNode();return this.next(),this.finishNode(a,o)}return this.$1c()}case t.string:case t.num:case t._true:case t._false:{let o=this.startNode();return o.literal=this.parseExprAtom(),this.finishNode(o,"TSLiteralType")}case t.plusMin:{if(this.value!=="-")break;let o=this.startNode(),a=this.startNode();if(this.next(),this.type!==t.num)this.unexpected();return a.operator="-",a.prefix=!0,a.argument=this.parseExprAtom(),o.literal=this.finishNode(a,"UnaryExpression"),this.finishNode(o,"TSLiteralType")}case t.backQuote:return this.$25();case t._this:{let o=this.$w();if(this.isContextual("is")&&!this.hasPrecedingLineBreak()){let a=this.startNodeAt(o.start,o.loc?.start);return a.parameterName=o,this.$x(a,!1)}return o}case t._typeof:return this.$26();case t._import:return this.$1d();case t.braceL:return this.$27()?this.$28():this.$29();case t.bracketL:return this.$2a();case t.parenL:{let o=this.startNode();return this.next(),o.typeAnnotation=this.$0(),this.expect(t.parenR),this.finishNode(o,"TSParenthesizedType")}default:if(this.type.keyword)return this.$1c()}return this.unexpected()}$1c(){let o=this.startNode();if(o.typeName=this.$k(),!this.hasPrecedingLineBreak()&&this.$1())o.typeArguments=this.$e();return this.finishNode(o,"TSTypeReference")}$k(){let o=this.parseIdent(!0);while(this.eat(t.dot)){let a=this.startNodeAt(o.start,o.loc?.start);a.left=o,a.right=this.parseIdent(!0),o=this.finishNode(a,"TSQualifiedName")}return o}$26(){let o=this.startNode();if(this.next(),o.exprName=this.type===t._import?this.$1d():this.$k(),!this.hasPrecedingLineBreak()&&this.$1())o.typeArguments=this.$e();return this.finishNode(o,"TSTypeQuery")}$1d(){let o=this.startNode();if(this.next(),o.argument=this.$1e(),this.eat(t.dot))o.qualifier=this.$k();if(this.$1())o.typeArguments=this.$e();return this.finishNode(o,"TSImportType")}$z(){if(this.type!==t.string)this.unexpected();return this.parseExprAtom()}$1e(){this.expect(t.parenL);let o=this.$z();return this.expect(t.parenR),o}$25(){let o=this.startNode(),a=this.startNode();this.next(),a.expressions=[];let p=this.parseTemplateElement({isTagged:!1});a.quasis=[p];while(!p.tail){if(this.type===t.eof)this.raise(this.pos,"Unterminated template literal");this.expect(t.dollarBraceL),a.expressions.push(this.$0()),this.expect(t.braceR),p=this.parseTemplateElement({isTagged:!1}),a.quasis.push(p)}return this.next(),o.literal=this.finishNode(a,"TemplateLiteral"),this.finishNode(o,"TSLiteralType")}$27(){return this.$v(()=>{if(this.next(),this.type===t.plusMin)return this.next(),this.isContextual("readonly");if(this.isContextual("readonly"))this.next();if(this.type!==t.bracketL)return!1;if(this.next(),this.type!==t.name)return!1;return this.next(),this.type===t._in})}$28(){let o=this.startNode();if(this.expect(t.braceL),this.type===t.plusMin)o.readonly=this.value,this.next(),this.expectContextual("readonly");else if(this.eatContextual("readonly"))o.readonly=!0;this.expect(t.bracketL);let a=this.startNode();if(a.name=this.$y(),this.expect(t._in),a.constraint=this.$0(),o.typeParameter=this.finishNode(a,"TSTypeParameter"),o.nameType=this.eatContextual("as")?this.$0():null,this.expect(t.bracketR),this.type===t.plusMin)o.optional=this.value,this.next(),this.expect(t.question);else if(this.eat(t.question))o.optional=!0;if(this.eat(t.colon))o.typeAnnotation=this.$0();return this.semicolon(),this.expect(t.braceR),this.finishNode(o,"TSMappedType")}$29(){let o=this.startNode();return o.members=this.$1f(),this.finishNode(o,"TSTypeLiteral")}$1f(){this.expect(t.braceL);let o=[];while(!this.eat(t.braceR))o.push(this.$2b());return o}$2b(){let o=this.startNode(),a="TSPropertySignature",p=this.type===t._new?this.$2():-1;if(this.type===t.parenL||this.$1())a="TSCallSignatureDeclaration",this.$r(o,t.colon);else if(p===dp||p===mp)a="TSConstructSignatureDeclaration",this.next(),this.$r(o,t.colon);else{let c=this.type===t._new?this.parseIdent(!0):null;if(this.isContextual("readonly")&&this.$s(!0))this.next(),o.readonly=!0;if(this.type===t.bracketL&&this.$1g())return this.$1h(o);let u="method";if(c)o.key=c;else{if((this.isContextual("get")||this.isContextual("set"))&&this.$s(!1))u=this.value,this.next();this.parsePropertyName(o)}if(this.eat(t.question))o.optional=!0;if(this.type===t.parenL||this.$1()){if(a="TSMethodSignature",u!=="method")o.kind=u;this.$r(o,t.colon),o.kind=u}else if(this.type===t.colon)o.typeAnnotation=this.$6()}return this.$1i(),this.finishNode(o,a)}$1i(){if(!this.eat(t.comma))this.semicolon()}$1g(){return this.$v(()=>{if(this.next(),this.type!==t.name)return!1;return this.next(),this.type===t.colon})}$1h(o){if(this.expect(t.bracketL),o.parameters=[this.$h(this.parseIdent(),!1)],this.expect(t.bracketR),this.type===t.colon)o.typeAnnotation=this.$6();return this.$1i(),this.finishNode(o,"TSIndexSignature")}$2a(){let o=this.startNode();this.expect(t.bracketL),o.elementTypes=[];while(!this.eat(t.bracketR))if(o.elementTypes.push(this.$2c()),this.type!==t.bracketR)this.expect(t.comma);return this.finishNode(o,"TSTupleType")}$2c(){let o=this.start,a=this.startLoc,p=this.eat(t.ellipsis),c;if((this.type===t.name||this.type.keyword)&&this.$2d()){let u=this.startNode();u.label=this.parseIdent(!0),u.optional=this.eat(t.question),this.expect(t.colon),u.elementType=this.$0(),c=this.finishNode(u,"TSNamedTupleMember")}else if(c=this.$0(),this.eat(t.question)){let u=this.startNodeAt(c.start,c.loc?.start);u.typeAnnotation=c,c=this.finishNode(u,"TSOptionalType")}if(p){let u=this.startNodeAt(o,a);u.typeAnnotation=c,c=this.finishNode(u,"TSRestType")}return c}$2d(){let o=this.$d();if(this.input.charCodeAt(o)===63)o=this.$d(o+1);return this.input.charCodeAt(o)===hp}$8(){return this.$a(()=>{let o=this.startNode();this.next(),o.params=[];while(!this.$c()){let a=this.startNode();while((this.type===t._const||this.type===t._in||this.isContextual("out"))&&r(this.$2()))a[this.value]=!0,this.next();if(a.name=this.$y(),this.eat(t._extends))a.constraint=this.$0();if(this.eat(t.eq))a.default=this.$0();if(o.params.push(this.finishNode(a,"TSTypeParameter")),!this.$c()){if(this.expect(t.comma),this.$c())o.extra={trailingComma:this.lastTokStart}}}if(this.next(),o.params.length===0)this.$1y(this.start,"Type parameter list cannot be empty.");return this.finishNode(o,"TSTypeParameterDeclaration")})}$e(o=!1){return this.$a(()=>{let a=this.startNode();this.next(),a.params=[];while(!this.$c())if(a.params.push(this.$0()),!this.$c())this.expect(t.comma);if(a.params.length===0)this.unexpected();if(o){let p=this.input.charCodeAt(this.start+1);if(p===On||p===Iy)this.unexpected()}return this.next(),this.finishNode(a,"TSTypeParameterInstantiation")})}$1j(){let o=[];do{let a=this.startNode();if(a.expression=this.$k(),this.$1())a.typeParameters=this.$e();o.push(this.finishNode(a,"TSExpressionWithTypeArguments"))}while(this.eat(t.comma));return o}$1k(o=!1){if(this.type!==t.name||this.containsEsc){if(this.type===t._const&&this.$3()==="enum")return this.$10(this.startNode());return}if(!this.$2e(this.value))return;if(this.value==="declare")return this.$2f(o);return this.$1l(this.startNode(),this.value)}$2e(o){switch(o){case"interface":case"type":case"namespace":return this.$14();case"enum":return r(this.$2());case"abstract":return this.$b()&&this.$3()==="class";case"module":{let a=this.$2();return this.$b()&&(a===js||a===Gs||r(a))}case"declare":return this.$b()&&Sy.has(this.$3());case"global":return this.$b()&&this.$2()===Ri}return!1}$1l(o,a){switch(a){case"interface":return this.$1m(o);case"type":return this.$2g(o);case"enum":return this.$10(o);case"abstract":return this.$1n(o,!0);case"global":return o.global=!0,o.id=this.parseIdent(),o.body=this.$11(),this.finishNode(o,"TSModuleDeclaration")}return this.$2h(o)}$2f(o){let a=this.$5;this.$5=!0;let p=this.startNode();this.next();let c=this.value;if(c==="const"&&this.$3()==="enum")p.const=!0;if(!o&&Ty.has(c))p.declare=!0;let u;if(p.const)u=this.$10(p);else if(c==="var"||c==="let"||c==="const")u=this.parseVarStatement(p,c,!0);else if(c==="function")this.next(),u=this.parseFunction(p,up,!1,!1);else if(c==="class")u=this.parseClass(p,!0);else u=this.$1l(p,c);return u.declare=!0,this.$5=a,u}$1n(o,a){return this.next(),o.abstract=!0,this.parseClass(o,a)}$1m(o){if(this.next(),o.id=this.parseIdent(),this.checkLValSimple(o.id,cp),this.$1())o.typeParameters=this.$8();return this.$a(()=>{if(this.eat(t._extends))o.extends=this.$1j();let a=this.startNode();a.body=this.$1f(),o.body=this.finishNode(a,"TSInterfaceBody")}),this.finishNode(o,"TSInterfaceDeclaration")}$2g(o){if(this.next(),o.id=this.parseIdent(),this.checkLValSimple(o.id,Fs),this.$1())o.typeParameters=this.$8();return o.typeAnnotation=this.$a(()=>(this.expect(t.eq),this.$0())),this.semicolon(),this.finishNode(o,"TSTypeAliasDeclaration")}$10(o){if(this.type===t._const)o.const=!0,this.next();this.next(),o.id=this.parseIdent(),this.checkLValSimple(o.id,_y),this.expect(t.braceL),o.members=[];while(!this.eat(t.braceR)){let a=this.startNode();if(a.id=this.type===t.string?this.parseExprAtom():this.parseIdent(!0),this.eat(t.eq))a.initializer=this.parseMaybeAssign();if(o.members.push(this.finishNode(a,"TSEnumMember")),this.type!==t.braceR)this.expect(t.comma)}return this.finishNode(o,"TSEnumDeclaration")}$2h(o){if(this.next(),this.type===t.string){if(o.id=this.parseExprAtom(),this.type===t.braceL)o.body=this.$11();else this.semicolon();return this.finishNode(o,"TSModuleDeclaration")}return o.id=this.parseIdent(),this.checkLValSimple(o.id,ky),this.$1o(o)}$1o(o){if(this.eat(t.dot)){let a=this.startNode();a.id=this.parseIdent(),o.body=this.$1o(a)}else o.body=this.$11();return this.finishNode(o,"TSModuleDeclaration")}$11(){this.enterScope(vy);let o=this.startNode();this.enterScope(0),this.expect(t.braceL),o.body=[];while(!this.eat(t.braceR))o.body.push(this.parseStatement(null,!0));return this.exitScope(),this.exitScope(),this.finishNode(o,"TSModuleBlock")}$1p(o,a){if(o.isExport=a,o.id=this.parseIdent(),this.checkLValSimple(o.id,Bn),this.expect(t.eq),this.isContextual("require")&&this.$2()===dp){let p=this.startNode();this.next(),p.expression=this.$1e(),o.moduleReference=this.finishNode(p,"TSExternalModuleReference")}else o.moduleReference=this.$k();return this.semicolon(),this.finishNode(o,"TSImportEqualsDeclaration")}$2i(){let o=this.$d();if(this.input.charCodeAt(o)!==On)return!1;let a=this.input.charCodeAt(o+1);return a!==On&&a!==62}parseStatement(o,a,p){if(this.type===s)this.$1q(!0);let c=this.$1k();if(c)return c;return super.parseStatement(o,a,p)}parseVarStatement(o,a,p){return super.parseVarStatement(o,a,p||this.$5)}parseVarId(o,a){if(super.parseVarId(o,a),o.id.type==="Identifier"&&this.$u()&&!this.hasPrecedingLineBreak())this.next(),o.definite=!0;this.$h(o.id,!1)}parseCatchClauseParam(){let o=this.$h(this.parseBindingAtom(),!1),a=o.type==="Identifier";return this.enterScope(a?by:0),this.checkLValPattern(o,a?Py:Bn),this.expect(t.parenR),o}parseImport(o){if(this.next(),o.importKind="value",this.type===t.string)o.specifiers=[],o.source=this.parseExprAtom();else{if(this.isContextual("type")){let a=this.$2();if(a===Ri||a===Vs||r(a)&&this.$3()!=="from")o.importKind="type",this.next()}if(this.type===t.name&&this.$2i())return this.$1p(o,!1);o.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),o.source=this.$z()}return this.$1r(o),this.semicolon(),this.finishNode(o,"ImportDeclaration")}parseWithClause(){if(this.isContextual("assert")&&!this.hasPrecedingLineBreak())this.type=t._with;return this.type===t._with?super.parseWithClause():void 0}$1r(o){let a=this.parseWithClause();if(a)o.attributes=a}parseImportSpecifier(){return this.$1s("importKind",()=>super.parseImportSpecifier())}parseExportSpecifier(o){return this.$1s("exportKind",()=>super.parseExportSpecifier(o))}$1s(o,a){let p=this.isContextual("type")?this.$2():-1;if(p===js||p===Gs||r(p)&&this.$3()!=="as"){let u=this.startNode();this.next();let f=a();return this.$q(f,u),f[o]="type",f}let c=a();return c[o]="value",c}parseExport(o,a){if(this.next(),this.eat(t._import)){if(o.importKind="value",this.isContextual("type")&&r(this.$2())&&this.$3()!=="from")o.importKind="type",this.next();return this.$1p(o,!0)}if(this.eat(t.eq))return o.expression=this.parseExpression(),this.semicolon(),this.finishNode(o,"TSExportAssignment");if(this.eatContextual("as"))return this.expectContextual("namespace"),o.id=this.parseIdent(),this.semicolon(),this.finishNode(o,"TSNamespaceExportDeclaration");if(o.exportKind="value",this.isContextual("type")){let u=this.$2();if(u===Ri||u===Vs)o.exportKind="type",this.next()}if(this.eat(t.star))return this.parseExportAllDeclaration(o,a);if(this.eat(t._default)){if(this.isContextual("interface")&&this.$14())o.declaration=this.$1m(this.startNode());else if(this.isContextual("abstract")&&this.$3()==="class")o.declaration=this.$1n(this.startNode(),"nullableID");else o.declaration=this.parseExportDefaultDeclaration();return this.finishNode(o,"ExportDefaultDeclaration")}let p=this.isContextual("declare"),c=this.$1k(!0);if(c||this.shouldParseExportStatement()){if(o.declaration=c??this.parseStatement(null),p||o.declaration.type==="TSInterfaceDeclaration"||o.declaration.type==="TSTypeAliasDeclaration")o.exportKind="type";return o.specifiers=[],o.source=null,this.finishNode(o,"ExportNamedDeclaration")}if(o.declaration=null,o.specifiers=this.parseExportSpecifiers(a),this.eatContextual("from"))o.source=this.$z(),this.$1r(o);else{for(let u of o.specifiers)if(this.checkUnreserved(u.local),this.checkLocalExport(u.local),u.local.type==="Literal")this.raise(u.local.start,"A string literal cannot be used as an exported binding without `from`.");o.source=null}return this.semicolon(),this.finishNode(o,"ExportNamedDeclaration")}parseFunction(o,a,p,c,u){let f=a&up;if(f)this.$f=o,this.$o=o.start;super.parseFunction(o,a,p,c,u),this.$f=null;let h=!o.body;if(h)o.type="TSDeclareFunction";if(f&&o.id){if(h){if(this.$5&&this.currentScope().flags&pp)this.declareName(o.id.name,Ws,o.id.start);this.checkLValSimple(o.id,Cy)}else if(!(a&Ny)){let m=wy;if(this.strict||o.generator||o.async)m=this.treatFunctionsAsVar?Ay:Bn;this.checkLValSimple(o.id,m)}}return o}parseFunctionParams(o){if(this.$1())o.typeParameters=this.$8();if(super.parseFunctionParams(o),this.type===t.colon)o.returnType=this.$6(!0)}parseFunctionBody(o,a,p,c){if(p&&this.type===t.colon)o.returnType=this.$6(!0);if(a||this.type===t.braceL||o.start!==this.$o){super.parseFunctionBody(o,a,p,c);return}this.semicolon(),this.exitScope()}parseMethod(o,a,p){let c=this.$l;this.$l=null,this.$j=!0;let u=super.parseMethod(o,a,p);if(!u.body)u.type="TSDeclareMethod";if(c)u.typeParameters=c;return u}parseBindingList(o,a,p,c){let u=c===!0||this.$j;return this.$j=!1,super.parseBindingList(o,a,p,u)}$s(o){if(!o&&!this.$b())return!1;let a=this.$2();return a===Ly||a===Ri||a===Vs||a===fp||a===Ry||a===js||a===Gs||a>=48&&a<=57||r(a)}parseAssignableListItem(o){let a=this.$12(),p=this.start,c=this.startLoc,u,f=!1,h=!1;if(o)while(this.type===t.name&&Ey.has(this.value)&&!this.containsEsc&&this.$s(!1)){if(this.value==="readonly")f=!0;else if(this.value==="override")h=!0;else u=this.value;this.next()}let m;if(this.type===t._this)m=this.startNode(),m.name="this",this.next(),this.finishNode(m,"Identifier");else m=this.parseBindingAtom();let g=this.type===t.eq?this.parseMaybeDefault(p,c,m):this.parseMaybeDefault(m.start,m.loc?.start,this.$h(m,!0));if(a.length>0)g.decorators=a;if(!u&&!f&&!h)return g;if(g.type!=="Identifier"&&g.type!=="AssignmentPattern")this.raise(p,"A parameter property may not be declared using a binding pattern.");let y=this.startNodeAt(p,c);if(u)y.accessibility=u;if(f)y.readonly=!0;if(h)y.override=!0;return y.parameter=g,this.finishNode(y,"TSParameterProperty")}parseBindingListItem(o){if(o.type==="RestElement")this.$h(o,!0);return o}checkLValSimple(o,a,p){if(this.$f&&o===this.$f.id){this.$f=null;return}if(!a&&lp.has(o.type)){this.checkLValSimple(o.expression,a,p);return}switch(o.type){case"TSParameterProperty":this.checkLValInnerPattern(o.parameter,a,p);return;case"Identifier":if(o.name==="this")return}super.checkLValSimple(o,a,p)}toAssignable(o,a,p){if(o&&!a&&lp.has(o.type))return o;return super.toAssignable(o,a,p)}declareName(o,a,p){let c=this.currentScope();if(a&Ws){this.$1t(c,o),c.$1u??=[],c.$1u.push(o);return}if(a===Fs||a===cp){if(c.$13??=[],a===Fs&&te(c.$13,o))this.raise(p,`type '${o}' has already been declared.`);c.$13.push(o),this.$1t(c,o);return}if(a&yp){if(c.$1v??=[],te(c.$1v,o))return;super.declareName(o,Bn,p),c.$1v.push(o);return}super.declareName(o,a,p)}$1t(o,a){if(this.inModule&&o.flags&pp)delete this.undefinedExports[a]}checkLocalExport(o){for(let a=this.scopeStack.length-1;a>=0;a--){let p=this.scopeStack[a];if(te(p.$13,o.name)||te(p.$1u,o.name))return}super.checkLocalExport(o)}checkExport(){}raiseRecoverable(o,a){if(a==="Duplicate constructor in the same class")return;super.raiseRecoverable(o,a)}$12(){let o=[];while(this.type===s)o.push(this.$1w());return o}$1q(o){let a=this.$9[this.$9.length-1];while(this.type===s)a.push(this.$1w());if(this.type===t._export){if(!o)this.unexpected()}else if(this.type!==t._class&&!((this.isContextual("abstract")||this.isContextual("declare"))&&this.$3()==="class"))this.raise(this.start,"Leading decorators must be attached to a class declaration.")}$1w(){let o=this.startNode();this.next(),this.$9.push([]);let a=this.start,p=this.startLoc,c;if(this.type===t.parenL){if(this.next(),c=this.parseExpression(),this.expect(t.parenR),this.options.preserveParens){let f=this.startNodeAt(a,p);f.expression=c,c=this.finishNode(f,"ParenthesizedExpression")}}else{c=this.parseIdent(!1);while(this.eat(t.dot)){let f=this.startNodeAt(a,p);f.object=c,f.property=this.parseIdent(!0),f.computed=!1,c=this.finishNode(f,"MemberExpression")}}let u=this.$p()?this.$e(!0):void 0;if(this.eat(t.parenL)){let f=this.startNodeAt(c.start,c.loc?.start);if(f.callee=c,f.arguments=this.parseExprList(t.parenR,!1,!1),u)f.typeArguments=u;c=this.finishNode(f,"CallExpression")}else if(u){let f=this.startNodeAt(c.start,c.loc?.start);f.expression=c,f.typeArguments=u,c=this.finishNode(f,"TSInstantiationExpression")}return o.expression=c,this.$9.pop(),this.finishNode(o,"Decorator")}shouldParseExportStatement(){return this.type===s||super.shouldParseExportStatement()}parseExprAtom(o,a,p){if(this.type===s)this.$1q(!1);return super.parseExprAtom(o,a,p)}parseProperty(o,a){if(o||this.type!==s)return super.parseProperty(o,a);let p=this.$12(),c=super.parseProperty(o,a);if(c.type==="SpreadElement")this.raise(c.start,"Decorators can't be used with SpreadElement");return c.decorators=p,c}parseClassId(o,a){let p=this.$9.length-1,c=this.$9[p];if(c.length>0)o.decorators=c,this.$q(o,c[0]),this.$9[p]=[];if(!this.isContextual("implements")||a===!0)super.parseClassId(o,a);if(this.$1())o.typeParameters=this.$8()}parseClassSuper(o){if(super.parseClassSuper(o),o.superClass&&this.$1())o.superTypeParameters=this.$e(!0);if(this.eatContextual("implements"))o.implements=this.$a(()=>this.$1j())}parseClassElement(o){if(this.type===s){let h=this.$12();if(this.type===t.braceR)this.raise(this.start,"Decorators must be attached to a class element.");let m=this.parseClassElement(o);return m.decorators=h,this.$q(m,h[0]),m}if(this.eat(t.semi))return null;let a=this.startNode();while(this.type===t.name&&xy.has(this.value)&&!this.containsEsc&&this.$s(this.value==="static")){let h=this.value;if(this.next(),h==="static"&&this.type===t.braceL)return this.next(),this.parseClassStaticBlock(a),a;if(h==="public"||h==="private"||h==="protected")a.accessibility=h;else a[h]=!0}if(this.type===t.bracketL&&this.$1g())return this.$1h(a);a.static??=!1;let p="",c=!1,u=!1,f="method";if(this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===t.star)&&!this.canInsertSemicolon())u=!0;else p="async";if(!p&&this.eat(t.star))c=!0;if(!p&&!u&&!c){let h=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())f=h;else p=h}if(p)a.computed=!1,a.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),a.key.name=p,this.finishNode(a.key,"Identifier");else this.parseClassElementName(a);if(this.eat(t.question))a.optional=!0;if(this.type===t.parenL||this.$1()||f!=="method"||c||u){let h=a.key,m=!a.static&&!a.computed&&(h.type==="Identifier"&&h.name==="constructor"||h.type==="Literal"&&h.value==="constructor");if(a.kind=m?"constructor":f,this.$1())a.typeParameters=this.$8();this.$o=this.start,this.parseClassMethod(a,c,u,m&&o)}else{if(!a.optional&&this.$u())this.next(),a.definite=!0;if(this.type===t.colon)a.typeAnnotation=this.$6();this.parseClassField(a)}return a}parseMaybeAssign(o,a,p){if(this.$p()){let c=this.$g(()=>{let u=this.$8(),f=super.parseMaybeAssign(o,a,p);if(f.type!=="ArrowFunctionExpression")return;return f.typeParameters=u,this.$q(f,u),f});if(c)return c}return super.parseMaybeAssign(o,a,p)}parseMaybeUnary(o,a,p,c){if(this.$p()){let u=this.startNode();return u.typeAnnotation=this.$a(()=>{this.next();let f=this.$0();if(!this.$c())this.unexpected();return this.next(),f}),u.expression=this.parseMaybeUnary(null,!1,!1,c),this.finishNode(u,"TSTypeAssertion")}return super.parseMaybeUnary(o,a,p,c)}parseMaybeConditional(o,a){let p=this.start,c=this.startLoc,u=this.parseExprOps(o,a);if(this.checkExpressionErrors(a))return u;if(this.type===t.question&&!(u.type==="ArrowFunctionExpression"&&u.start===p)&&!this.$2j()){this.next();let f=this.startNodeAt(p,c);return f.test=u,f.consequent=this.parseMaybeAssign(),this.expect(t.colon),f.alternate=this.parseMaybeAssign(o),this.finishNode(f,"ConditionalExpression")}return u}$2j(){let o=this.$d(),a=this.input.charCodeAt(o);if(a===hp||a===$y||a===Dy)return!0;return a===On&&this.input.charCodeAt(o+1)!==On}parseParenItem(o){return this.$h(o,!0)}$1x(){if(this.type!==t.colon)return!0;let o=this.$g(()=>{let a=this.$6(!0);return this.type===t.arrow&&!this.canInsertSemicolon()?a:void 0});if(!o)return!1;return this.$7=o,!0}shouldParseArrow(o){return this.$1x()&&super.shouldParseArrow(o)}shouldParseAsyncArrow(){return this.$1x()&&super.shouldParseAsyncArrow()}parseArrowExpression(o,a,p,c){if(this.$7)o.returnType=this.$7,this.$7=null;return super.parseArrowExpression(o,a,p,c)}parseExprList(o,a,p,c){if(!this.$m)return super.parseExprList(o,a,p,c);this.$m=!1;let u=[],f=!0;while(!this.eat(o)){if(f)f=!1;else if(this.expect(t.comma),a&&this.afterTrailingComma(o))break;if(this.type===t.ellipsis){let h=this.parseSpread(c);if(this.eat(t.question))h.optional=!0;if(this.type===t.colon)h.typeAnnotation=this.$6();u.push(h)}else u.push(this.parseMaybeAssign(!1,c,this.parseParenItem))}return u}parseSubscript(o,a,p,c,u,f,h){if(this.$u()&&!this.hasPrecedingLineBreak()){let g=this.startNodeAt(a,p);return this.exprAllowed=!1,this.next(),g.expression=o,this.finishNode(g,"TSNonNullExpression")}if(u&&this.$1()){let g=this.$g(()=>this.$2k(a,p,h));if(g)return g}let m=this.type===t.questionDot&&this.$2()===mp;if(this.$1()||m||this.type===t.bitShift&&this.value==="<<"){let g=this.$g(()=>{if(m)this.next();this.$p();let y=this.$e(!0);if(this.type===t.parenL&&!c)return y;if(this.type===t.backQuote)return m?void 0:y;if(m)return;if(this.$c()||this.type===t.bitShift||this.type.startsExpr&&this.type!==t.parenL&&!this.hasPrecedingLineBreak())return;return y});if(g){let y=this.startNodeAt(a,p);if(this.type===t.parenL&&!c){if(this.next(),y.callee=o,y.arguments=this.parseExprList(t.parenR,!0,!1),y.typeArguments=g,m)o.optional=!0;if(m||f)y.optional=m;return this.finishNode(y,"CallExpression")}if(this.type===t.backQuote)return y.tag=o,y.quasi=this.parseTemplate({isTagged:!0}),y.typeArguments=g,this.finishNode(y,"TaggedTemplateExpression");return y.expression=o,y.typeArguments=g,this.finishNode(y,"TSInstantiationExpression")}}if(u&&this.type===t.parenL)this.$m=!0;return super.parseSubscript(o,a,p,c,u,f,h)}$2k(o,a,p){let c=this.startNodeAt(o,a);if(c.typeParameters=this.$8(),this.expect(t.parenL),c.params=this.parseBindingList(t.parenR,!1,!0),this.type===t.colon)c.returnType=this.$6(!0);if(this.type!==t.arrow||this.canInsertSemicolon())return;return this.next(),this.parseArrowExpression(c,c.params,!0,p)}parseDynamicImport(o){if(this.next(),o.source=this.parseMaybeAssign(),this.eat(t.comma)&&this.type!==t.parenR)o.arguments=[this.parseExpression()];return this.expect(t.parenR),this.finishNode(o,"ImportExpression")}parseNew(){let o=super.parseNew();if(o.callee?.type!=="TSInstantiationExpression")return o;let a=this.startNodeAt(o.start,o.loc?.start);return a.callee=o.callee.expression,a.typeArguments=o.callee.typeArguments,a.arguments=o.arguments,this.finishNodeAt(a,"NewExpression",o.end,o.loc?.end)}parseExprOp(o,a,p,c,u){if(t._in.binop>c&&this.type===t.name&&(this.value==="as"||this.value==="satisfies")&&!this.containsEsc&&!this.hasPrecedingLineBreak()){let f=this.value==="satisfies",h=this.startNodeAt(a,p);return h.expression=o,h.typeAnnotation=this.$a(()=>{if(this.next(),!f&&this.type===t._const){let m=this.startNode();return m.typeName=this.parseIdent(!0),this.finishNode(m,"TSTypeReference")}return this.$0()}),this.finishNode(h,f?"TSSatisfiesExpression":"TSAsExpression"),this.parseExprOp(h,a,p,c,u)}return super.parseExprOp(o,a,p,c,u)}parseGetterSetter(o){o.kind=o.key.name,super.parseGetterSetter(o)}parsePropertyValue(o,a,p,c,u,f,h,m){if(!a&&this.$1()){if(this.$l=this.$8(),this.type!==t.parenL)this.unexpected();o.kind="init"}return super.parsePropertyValue(o,a,p,c,u,f,h,m)}}return l});var Hs=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".split(" ")),Oy=new Set("any bigint boolean false never null number object string symbol true undefined unknown void".split(" ")),By=new Set("get set new readonly static public private protected".split(" "));function gp(e){return e>=97&&e<=122||e>=65&&e<=90||e===95||e===36}function Oi(e){return e>=48&&e<=57}function Us(e){return gp(e)||Oi(e)}class xp{text;pos=0;constructor(e){this.text=e}readAll(){if(!this.type())return!1;return this.peek(),this.pos===this.text.length}peek(){let e=this.text,t=this.pos,n=e.charCodeAt(t);while(n===32||n===9)n=e.charCodeAt(++t);return this.pos=t,n}eat(e){if(this.peek()!==e.charCodeAt(0))return!1;return this.pos++,!0}word(){let e=this.pos;return this.skipWord()?this.text.slice(e,this.pos):void 0}skipWord(){if(!gp(this.peek()))return!1;let e=this.pos+1;while(Us(this.text.charCodeAt(e)))e++;return this.pos=e,!0}keyword(e){this.peek();let t=this.pos+e.length;if(!this.text.startsWith(e,this.pos)||Us(this.text.charCodeAt(t)))return!1;return this.pos=t,!0}name(){let e=this.word();return e!==void 0&&!Hs.has(e)}string(){let e=this.peek();if(e!==34&&e!==39)return!1;let t=this.text;for(let n=this.pos+1;n<t.length;n++){let i=t.charCodeAt(n);if(i===e)return this.pos=n+1,!0;if(i===92||i===10||i===13||i===8232||i===8233)return!1}return!1}number(){let e=this.text,t=this.pos;if(e.charCodeAt(t)===45)t++;let n=t;while(Oi(e.charCodeAt(t)))t++;if(t===n||t-n>1&&e.charCodeAt(n)===48)return!1;if(e.charCodeAt(t)===46){let r=++t;while(Oi(e.charCodeAt(t)))t++;if(t===r)return!1}let i=e.charCodeAt(t);if(Us(i)||i===46)return!1;return this.pos=t,!0}type(){if(this.peek()===40){let e=this.pos;if(this.functionType())return!0;this.pos=e}do do if(!this.operatorType())return!1;while(this.eat("&"));while(this.eat("|"));return!0}operatorType(){if(this.keyword("keyof"))return this.operatorType();if(!this.primaryType())return!1;while(this.eat("[")){if(this.eat("]"))continue;if(!this.type()||!this.eat("]"))return!1}return!0}primaryType(){let e=this.peek();if(e===40)return this.pos++,this.type()&&this.eat(")");if(e===123)return this.objectType();if(e===91)return this.tupleType();if(e===34||e===39)return this.string();if(e===45||Oi(e))return this.number();let t=this.word();if(t===void 0)return!1;if(t==="typeof")return this.typeQuery();if(t==="import")return this.importType(!0);if(Oy.has(t)){let n=this.peek();return n!==46&&n!==60}if(Hs.has(t))return!1;while(this.eat("."))if(!this.skipWord())return!1;return!this.eat("<")||this.typeArguments()}typeArguments(){do if(!this.type())return!1;while(this.eat(","));return this.eat(">")}typeQuery(){if(this.keyword("import"))return this.importType(!1);do if(!this.name())return!1;while(this.eat("."));return!0}importType(e){if(!this.eat("(")||!this.string()||!this.eat(")"))return!1;while(this.eat("."))if(!this.name())return!1;return!e||!this.eat("<")||this.typeArguments()}objectType(){this.pos++;while(!this.eat("}")){if(!this.typeMember())return!1;if(!this.eat(";")&&!this.eat(",")&&this.peek()!==125)return!1}return!0}typeMember(){let e=this.peek();if(this.eat("[")){let t=this.peek();if(t===34||t===39){if(!this.string()||!this.eat("]"))return!1}else return this.name()&&this.eat(":")&&this.type()&&this.eat("]")&&this.eat(":")&&this.type()}else if(e===34||e===39){if(!this.string())return!1}else{let t=this.word();if(t===void 0||By.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(){if(this.pos++,!this.eat(")")){let e=new Set;for(;;){this.peek();let t=this.text.startsWith("...",this.pos);if(t)this.pos+=3;let n=this.word();if(n===void 0||Hs.has(n)||e.has(n))return!1;if(e.add(n),!t)this.eat("?");if(!this.eat(":")||!this.type())return!1;if(t||!this.eat(","))break}if(!this.eat(")"))return!1}if(this.peek(),!this.text.startsWith("=>",this.pos))return!1;return this.pos+=2,this.type()}}function Fy(e){return new xp(e).readAll()}var Vy=V.extend(Mi);function Fn(e,t={}){return Fy(e)||jy(e,t.inline??!1)}function jy(e,t){let n=!1,i=new Vy(t?{ecmaVersion:16,sourceType:"module",onComment:(r,s,l,o)=>{if(!r&&o===e.length)n=!0}}:{ecmaVersion:16,sourceType:"module"},e);try{return i.parseWholeType(),!n}catch(r){if(r instanceof SyntaxError)return!1;throw r}}var qs=/<!--[\s\S]*?-->|<script\s+(?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?([^"' >]+)\1[^>]*>/y;function Fi(e){return e.charCodeAt(0)===65279?e.slice(1):e}function De(e){return e>=48&&e<=57}function U(e){if(e===32||e<=13&&e>=9)return!0;if(e<160)return!1;return e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288||e===65279}function R(e,t){let n=t;while(n<e.length&&U(e.charCodeAt(n)))n++;return n}function Vi(e){let t=e.indexOf("<");while(t!==-1){let n=e.charCodeAt(t+1);if(n===33||n===115){qs.lastIndex=t;let i=qs.exec(e);if(i){if(n===115)return i[2]==="ts";t=e.indexOf("<",qs.lastIndex);continue}}t=e.indexOf("<",t+1)}return!1}function ji(e,t){let n=e.indexOf("</script",t);while(n!==-1){if(e.charCodeAt(R(e,n+8))===Bi)return n;n=e.indexOf("</script",n+8)}return-1}function Gi(e,t){return R(e,t+8)+1}var Gy=new Set("area base br col command embed hr img input keygen link meta param source track wbr".split(" "));function Vn(e){return Gy.has(e)||e.charCodeAt(0)===33&&e.toLowerCase()==="!doctype"}function Wi(e,t){let n=t;while(n<e.length){let i=e.charCodeAt(n);if(i===47&&e.charCodeAt(n+1)===42){let r=e.indexOf("*/",n+2);n=r===-1?e.length:r+2}else if(i===34||i===39){n++;while(n<e.length){let r=e.charCodeAt(n);if(r===i||r===10)break;n+=r===92?2:1}n++}else if(i===60&&e.startsWith("</style",n))break;else n++}return Math.min(n,e.length)}var Wy=34,Hy=39,Ep=47,Sp=61,Bi=62,ve=(e)=>e===Wy||e===Hy;function Et(e,t,n){let i=t;for(;i<e.length;i++){let r=e.charCodeAt(i);if(U(r)||r===Ep||r===Bi)break;if(n&&(ve(r)||r===Sp))break}return i}function Hi(e,t){let n=e.charCodeAt(t);return U(n)||ve(n)||n===Sp||n===60||n===Bi||n===96||n===Ep&&e.charCodeAt(t+1)===Bi}var St=0,w=1,$e=2,L=3,vp=0,Tp=1,Cp=2,Gn=3,Ys=4,Ht=4,Js=5,Ui=6,Ap=7,Uy={await:w,case:w,default:w,delete:w,extends:w,in:w,instanceof:w,new:w,of:w,return:w,throw:w,typeof:w,void:w,yield:w,do:$e,else:$e,finally:$e,try:$e,for:Ht,if:Ht,while:Ht,with:Ht,import:Js,export:Ui,require:Ap},wp=10,Xs=Array(Qs(128,0)).fill(null);for(let e of Object.entries(Uy)){let t=Qs(e[0].charCodeAt(0),e[0].length),n=Xs[t]??[];n.push(e),Xs[t]=n}function Qs(e,t){return e*(wp+1)+t}function Pp(e,t,n){let i=e.charCodeAt(t);if(i>=128||n-t>wp)return L;let r=Qs(i,n-t),s=Xs[r];if(s===null)return L;for(let l=0;l<s.length;l++)if(e.startsWith(s[l][0],t))return s[l][1];return L}var kp=new Uint8Array(128);for(let e of["az","AZ","09","__","$$","\\\\"])for(let t=e.charCodeAt(0);t<=e.charCodeAt(1);t++)kp[t]=1;function Tt(e){return e>=128?!U(e):kp[e]===1}function _p(e,t,n,i=!1){qy(e,zy(e,t,i),t,i,n,void 0,void 0)}function qy(e,t,n,i,r,s,l){let o=[],a=e.startsWith("#!")?$p(e,2):0,p=St,c=!1,u=!1,f=-1,h=()=>{if(p=St,o.length===0)f=-1};while(a<=t){let m=e.charCodeAt(a);if(m===32||m===10||U(m)){a++;continue}if(m===47){let S=Zs(e,a);if(S!==-1){a=S;continue}}let g=c,y=u;if(c=!1,u=!1,Tt(m)||m===35){let S=a;a=Ip(e,a+1);let b=g?L:Pp(e,S,a);if(l!==void 0&&(b===Js||b===Ap))l(S,p===St||p===L);if(r!==void 0&&o.length===0&&(b===Ui?n||Mp(e,a,i):b===Js&&Rp(e,a)))a=Math.max(a,r(f!==-1&&b===Ui?f:S,S)),h();else if(b===Ui)p=$e;else if(b===Ht)u=!0,p=L;else p=b===w||b===$e?b:L;continue}switch(a++,m){case 34:case 39:{let S=a-1;a=eo(e,a,m),s?.(S,a,!1),p=L;break}case 96:{let S=a;a=zi(e,a,o),s?.(S,bp(e,a),!0),p=e.charCodeAt(a-1)===123?w:L;break}case 47:{let S=p===L?-1:Lp(e,a);if(S===-1)p=w;else a=qi(e,S),p=L;break}case 40:o.push(y?Tp:vp),p=w;break;case 41:p=o.pop()===Tp?$e:L;break;case 123:o.push(p===w?Gn:Cp),p=St;break;case 125:{let S=o.pop();if(S===Ys){let b=a;a=zi(e,a,o),s?.(b,bp(e,a),!0),p=e.charCodeAt(a-1)===123?w:L}else if(S===Gn)p=L;else h();break}case 59:h();break;case 44:p=o[o.length-1]===Gn?St:w;break;case 93:p=L;break;case 46:if(De(e.charCodeAt(a)))a=qi(e,a),p=L;else if(e.startsWith("..",a))a+=2,p=w;else c=!0,p=w;break;case 63:if(e.charCodeAt(a)===46&&!De(e.charCodeAt(a+1)))a++,c=!0;p=w;break;case 33:p=p===L&&!U(e.charCodeAt(a-2))?L:w;break;case 43:case 45:if(e.charCodeAt(a)===m&&p===L)a++;else p=w;break;case 61:if(p=e.charCodeAt(a)===62?$e:w,p===$e)a++;break;case 64:if(o.length===0&&f===-1)f=a-1;p=w;break;default:p=w}}}function Np(e,t,n){let i=e.length,r=[],s=t,l=w,o=!1;while(s<i){let a=e.charCodeAt(s);if(a===32||a===10||U(a)){s++;continue}if(a===47){let c=Zs(e,s);if(c!==-1){s=c;continue}}let p=o;if(o=!1,Tt(a)||a===35){let c=s;if(s=Ip(e,s+1),!p&&n?.(c,s))return-1;let u=p?L:Pp(e,c,s);l=u===w||u===$e||u===Ht?w:L;continue}switch(s++,a){case 34:case 39:s=eo(e,s,a),l=L;break;case 96:s=zi(e,s,r),l=e.charCodeAt(s-1)===123?w:L;break;case 47:{let c=l===L?-1:Lp(e,s);if(c===-1)l=w;else s=qi(e,c),l=L;break}case 40:r.push(vp),l=w;break;case 41:if(r.length===0)return s-1;r.pop(),l=L;break;case 123:r.push(l===w?Gn:Cp),l=St;break;case 125:{if(r.length===0)return s-1;let c=r.pop();if(c===Ys)s=zi(e,s,r),l=e.charCodeAt(s-1)===123?w:L;else l=c===Gn?L:St;break}case 93:l=L;break;case 46:if(De(e.charCodeAt(s)))s=qi(e,s),l=L;else if(e.startsWith("..",s))s+=2,l=w;else o=!0,l=w;break;case 63:if(e.charCodeAt(s)===46&&!De(e.charCodeAt(s+1)))s++,o=!0;l=w;break;case 33:l=l===L&&!U(e.charCodeAt(s-2))?L:w;break;case 43:case 45:if(e.charCodeAt(s)===a&&l===L)s++;else l=w;break;case 61:if(e.charCodeAt(s)===62)s++;l=w;break;default:l=w}}return i}function Dp(e){return e===10||e===13||e===8232||e===8233}function $p(e,t){for(let n=t;n<e.length;n++)if(Dp(e.charCodeAt(n)))return n;return e.length}function Zs(e,t){let n=e.charCodeAt(t+1);if(n===47)return $p(e,t+2);if(n!==42)return-1;let i=e.indexOf("*/",t+2);return i===-1?e.length:i+2}function Ip(e,t){let n=t;while(n<e.length){let i=e.charCodeAt(n);if(i===92)n+=2;else if(Tt(i))n++;else break}return n}function qi(e,t){let n=t;while(n<e.length&&Tt(e.charCodeAt(n)))n++;return n}function eo(e,t,n){for(let i=t;i<e.length;i++){let r=e.charCodeAt(i);if(r===n)return i+1;if(r===92)i+=e.startsWith(`\r
|
|
40
|
+
`,i+1)?2:1;else if(r===10||r===13)return i}return e.length}function zi(e,t,n){for(let i=t;i<e.length;i++){let r=e.charCodeAt(i);if(r===96)return i+1;if(r===92)i++;else if(r===36&&e.charCodeAt(i+1)===123)return n.push(Ys),i+2}return e.length}function bp(e,t){let n=e.charCodeAt(t-1);if(n===96)return t-1;if(n===123&&e.charCodeAt(t-2)===36)return t-2;return t}function Lp(e,t){let n=!1;for(let i=t;i<e.length;i++){let r=e.charCodeAt(i);if(Dp(r))return-1;if(r===92)i++;else if(r===91)n=!0;else if(r===93)n=!1;else if(r===47&&!n)return i+1}return-1}function jn(e,t){let n=t;while(n<e.length){let i=e.charCodeAt(n);if(U(i)){n++;continue}let r=i===47?Zs(e,n):-1;if(r===-1)return n;n=r}return e.length}function zs(e,t,n){return e.charCodeAt(t)===n.charCodeAt(0)&&e.startsWith(n,t)&&!Tt(e.charCodeAt(t+n.length))}function Rp(e,t){let n=e.charCodeAt(jn(e,t));return n!==40&&n!==46}function Mp(e,t,n){let i=jn(e,t);if(zs(e,i,"import"))return!0;if(zs(e,i,"type"))i=jn(e,i+4);let r=e.charCodeAt(i);if(r===42)return!0;if(r!==123)return!1;if(n)return!0;for(i++;i<e.length;i++){let s=e.charCodeAt(i);if(s===125)break;if(s===34||s===39)i=eo(e,i+1,s)-1;else if(s===47)i=Math.max(i,jn(e,i)-1)}return zs(e,jn(e,i+1),"from")}var Ks=/import|export/g;function zy(e,t,n){let i=-1;Ks.lastIndex=0;for(let r=Ks.exec(e);r!==null;r=Ks.exec(e)){let s=r.index,l=s+6;if(!Tt(e.charCodeAt(s-1))&&!Tt(e.charCodeAt(l))&&(e.charCodeAt(s)===105?Rp(e,l):t||Mp(e,l,n)))i=s}return i}var Op={li:["li"],dt:["dt","dd"],dd:["dt","dd"],p:"address article aside blockquote div dl fieldset footer form h1 h2 h3 h4 h5 h6 header hgroup hr main menu nav ol p pre section table ul".split(" "),rt:["rt","rp"],rp:["rt","rp"],optgroup:["optgroup"],option:["option","optgroup"],thead:["tbody","tfoot"],tbody:["tbody","tfoot"],tfoot:["tbody"],tr:["tr","tbody"],td:["td","th","tr"],th:["td","th","tr"]};function Ki(e,t){return Object.hasOwn(Op,e)&&Op[e].includes(t)}var Bp="{",jp=60,no=62,bt=47,Gp=61,Hn=123,Fp=/\s*>/y,to=/<\/textarea(\s[^>]*)?>/iy,Ky=["cript","tyle","velte:options"],Vp="</svelte:options";function Ji(e){let t=Fi(e).trimEnd();return Jy(t,Vi(t),null)}function Jy(e,t,n){let i={typescript:t,instance:null,module:null,css:null,options:null},r=Xy(e),s=[],l=0;while(l<=r){let o=e.charCodeAt(l);if(o===jp)l=Zy(e,l,s,i,n);else if(o===Hn)l=Qy(e,l,s);else l++}return i}function Xy(e){let t=-1,n=e.indexOf("<s");while(n!==-1){let i=Yy(e,n+2);if(i!==-1){let r=e.charCodeAt(i);if(i===e.length||U(r)||r===bt||r===no)t=n}n=e.indexOf("<s",n+2)}return t}function Yy(e,t){for(let n of Ky)if(e.startsWith(n,t))return t+n.length;return-1}function Un(e,t){return Math.min(Np(e,t)+1,e.length)}function Qy(e,t,n){let i=R(e,t+1),r=e.charCodeAt(i),s=e.charCodeAt(i+1);if(r===35||r===58||r===64||r===bt&&s!==bt&&s!==42){i++;while(i<e.length){let l=e.charCodeAt(i);if(l<97||l>122)break;i++}if(r===35)n.push(Bp);else if(r===bt){let l=n.lastIndexOf(Bp);if(l!==-1)n.length=l}}return Un(e,i)}function Zy(e,t,n,i,r){if(e.startsWith("!--",t+1)){let c=e.indexOf("-->",t+4),u=c===-1?e.length:c+3;if(r&&n.length===0)r.comments.push(t,u);return u}if(e.charCodeAt(t+1)===bt){let c=t+2,u=e.slice(c,Et(e,c,!1)),f=n.lastIndexOf(u);if(f!==-1)n.length=f;return Wn(e,R(e,c+u.length))}let s=e.slice(t+1,Et(e,t+1,!1)),l=R(e,t+1+s.length),o=n[n.length-1];if(o!==void 0&&Ki(o,s))n.pop();let a=n.length===0;if(r&&a&&(s==="script"||s==="style"||s==="svelte:options"))r.tags.push(t);if(a&&(s==="script"||s==="style")){let c=[];if(l=Wn(e,ng(e,l,c)),s==="script"){let f=eg(e,t,l,c);if(f.context==="module")i.module??=f;else i.instance??=f;return f.end}let u=tg(e,t,l,c);return i.css??=u,u.end}let p=a&&s==="svelte:options"?[]:null;if(l=ig(e,l,p),e.charCodeAt(l)===bt||Vn(s)){if(e.charCodeAt(l)===bt)l++;l=Wn(e,l)}else{if(l=Wn(e,l),s==="textarea")return sg(e,l);if(s==="script"||s==="style"){let c=`</${s}>`,u=e.indexOf(c,l);return u===-1?e.length:u+c.length}if(p&&e.startsWith(Vp,l))l=Wn(e,R(e,l+Vp.length));else return n.push(s),l}if(p)i.options??={start:t,end:l,attributes:p};return l}function Wn(e,t){return e.charCodeAt(t)===no?t+1:t}function eg(e,t,n,i){let r=ji(e,n),s=r===-1?e.length:r,l=i.some((o)=>o.name==="module"||o.name==="context");return{start:t,end:r===-1?e.length:Gi(e,r),context:l?"module":"default",attributes:i,content:{start:n,end:s}}}function tg(e,t,n,i){let r=Wi(e,n),s=r;if(e.startsWith("</style",s)){s+=7,Fp.lastIndex=s;let l=Fp.exec(e);if(l)s+=l[0].length}return{start:t,end:s,attributes:i,content:{start:n,end:r}}}function ng(e,t,n){let i=t;for(;;){let r=i,s=Et(e,i,!0);if(s===r)return i;i=s;let l=!0;if(e.charCodeAt(i)===Gp){let o=R(e,i+1),a=e.charCodeAt(o),p=-1;if(ve(a)){let u=e.indexOf(e[o],o+1);if(u!==-1)p=u+1}if(p===-1){p=o;while(p<e.length&&e.charCodeAt(p)!==no&&!U(e.charCodeAt(p)))p++}let c=ve(a)?1:0;l=e.slice(o+c,p-c),i=p}n.push({name:e.slice(r,s),value:l,start:r,end:i}),i=R(e,i)}}function ig(e,t,n){let i=t;for(;;){for(;;){if(e.startsWith("/*",i)){let a=e.indexOf("*/",i+2);i=a===-1?e.length:a+2}else if(e.startsWith("//",i)){let a=e.indexOf(`
|
|
41
|
+
`,i+2);i=a===-1?e.length:a}else break;i=R(e,i)}let r=i;if(e.charCodeAt(i)===Hn){i=R(e,Un(e,i+1));continue}let s=Et(e,i,!0);if(s===r)return i;let l=s,o=!0;if(i=R(e,s),e.charCodeAt(i)===Gp){let a=R(e,i+1);l=e.startsWith("/>",a)?a+1:rg(e,a),o=ve(e.charCodeAt(a))?e.slice(a+1,Math.max(a+1,l-1)):e.slice(a,l),i=R(e,l)}n?.push({name:e.slice(r,s),value:o,start:r,end:l})}}function rg(e,t){let n=e.charCodeAt(t);if(ve(n)){let r=t+1;while(r<e.length){let s=e.charCodeAt(r);if(s===n)return r+1;r=s===Hn?Un(e,r+1):r+1}return e.length}let i=t;while(i<e.length&&!Hi(e,i))i=e.charCodeAt(i)===Hn?Un(e,i+1):i+1;return i}function sg(e,t){let n=t;while(n<e.length){let i=e.charCodeAt(n);if(i===jp){if(to.lastIndex=n,to.test(e))return to.lastIndex}n=i===Hn?Un(e,n+1):n+1}return e.length}function Wp(e){return{support:"typescript",parser:e}}function Hp(e){return e&&"parser"in e?e.parser:void 0}function Up(e){return e&&"names"in e?e.names:void 0}function Xi(){throw Error('svelte-ast: parsing TypeScript needs `typescript` from "svelte-ast/typescript": createParser({ typescript }) or createModuleParser({ typescript })')}var og=/^\t+/;class E extends Error{name="ParseError";code;reason;position;start;end;frame;constructor(e,t,n){super(`${n}
|
|
42
|
+
https://svelte.dev/e/${t}`);this.code=t,this.reason=n;let i=typeof e==="number"?e:e?.start,r=typeof e==="number"?e:e?.end;if(i!==void 0)this.position=[i,r??i],this.start=Pe(this.position[0]),this.end=Pe(this.position[1]),this.frame=ag(this.start.line-1,this.end.column)}}var qp=(e)=>e.replace(og,(t)=>" ".repeat(t.length));function ag(e,t){let n=Math.max(0,e-2),i=[];for(let s=n;s<e+3;s++){let l=ua(s);if(l===void 0)break;i.push(l)}let r=String(n+i.length+1).length;return i.map((s,l)=>{let o=`${String(n+l+1).padStart(r," ")}: ${qp(s)}`;if(n+l!==e)return o;return`${o}
|
|
43
|
+
${" ".repeat(r+2+qp(s.slice(0,t)).length)}^`}).join(`
|
|
44
|
+
`)}function Jp(e){throw new E(e,"attribute_duplicate","Attributes need to be unique")}function Xp(e){throw new E(e,"attribute_empty_shorthand","Attribute shorthand cannot be empty")}function Qi(e,t){throw new E(e,"block_duplicate_clause",`${t} cannot appear more than once within a block`)}function Yp(e){throw new E(e,"block_invalid_continuation_placement","{:...} block is invalid at this position (did you forget to close the preceding element or block?)")}function Qp(e){throw new E(e,"block_invalid_elseif","'elseif' should be 'else if'")}function Zp(e,t,n){throw new E(e,"block_invalid_placement",`{#${t} ...} block cannot be ${n}`)}function ec(e){throw new E(e,"block_unclosed","Block was left open")}function tc(e){throw new E(e,"block_unexpected_close","Unexpected block closing tag")}function nc(e){throw new E(e,"const_tag_invalid_expression","{@const ...} must consist of a single variable declaration")}function ic(e){throw new E(e,"css_empty_declaration","Declaration cannot be empty")}function so(e){throw new E(e,"css_expected_identifier","Expected a valid CSS identifier")}function rc(e){throw new E(e,"css_selector_invalid","Invalid selector")}function sc(e){throw new E(e,"debug_tag_invalid_arguments","{@debug ...} arguments must be identifiers, not arbitrary expressions")}function oo(e){throw new E(e,"declaration_tag_invalid_type","Declaration tags must be `let` or `const` declarations")}function oc(e){throw new E(e,"directive_invalid_value","Directive value must be a JavaScript expression enclosed in curly braces")}function ac(e,t){throw new E(e,"directive_missing_name",`\`${t}\` name cannot be empty`)}function lc(e,t){throw new E(e,"element_invalid_closing_tag",`\`</${t}>\` attempted to close an element that was not open`)}function pc(e,t,n){throw new E(e,"element_invalid_closing_tag_autoclosed",`\`</${t}>\` attempted to close element that was already automatically closed by \`<${n}>\` (cannot nest \`<${n}>\` inside \`<${t}>\`)`)}function ao(e,t){throw new E(e,"element_unclosed",`\`<${t}>\` was left open`)}function lo(e){throw new E(e,"expected_attribute_value","Expected attribute value")}function cc(e){throw new E(e,"expected_block_type","Expected 'if', 'each', 'await', 'key' or 'snippet'")}function po(e){throw new E(e,"expected_identifier","Expected an identifier")}function uc(e){throw new E(e,"expected_pattern","Expected identifier or destructure pattern")}function dc(e){throw new E(e,"expected_tag","Expected 'html', 'render', 'attach', 'const', or 'debug'")}function nt(e,t){throw new E(e,"expected_token",`Expected token ${t}`)}function fc(e){throw new E(e,"expected_whitespace","Expected whitespace")}function lg(e,t){throw new E(e,"js_parse_error",`${t}`)}function hc(e){throw new E(e,"render_tag_invalid_expression","`{@render ...}` tags can only contain call expressions")}function mc(e){throw new E(e,"script_duplicate","A component can have a single top-level `<script>` element and/or a single top-level `<script module>` element")}function yc(e,t){throw new E(e,"script_invalid_attribute_value",`If the \`${t}\` attribute is supplied, it must be a boolean attribute`)}function gc(e){throw new E(e,"script_invalid_context",'If the context attribute is supplied, its value must be "module"')}function xc(e,t){throw new E(e,"script_reserved_attribute",`The \`${t}\` attribute is reserved and cannot be used`)}function Ec(e){throw new E(e,"style_duplicate","A component can have a single top-level `<style>` element")}function Sc(e){throw new E(e,"svelte_component_invalid_this","Invalid component definition — must be an `{expression}`")}function Tc(e){throw new E(e,"svelte_component_missing_this","`<svelte:component>` must have a 'this' attribute")}function co(e){throw new E(e,"svelte_element_missing_this","`<svelte:element>` must have a 'this' attribute with a value")}function bc(e,t){throw new E(e,"svelte_meta_duplicate",`A component can only have one \`<${t}>\` element`)}function vc(e,t){throw new E(e,"svelte_meta_invalid_content",`<${t}> cannot have children`)}function Cc(e,t){throw new E(e,"svelte_meta_invalid_placement",`\`<${t}>\` tags cannot be inside elements or blocks`)}function Ac(e,t){throw new E(e,"svelte_meta_invalid_tag",`Valid \`<svelte:...>\` tag names are ${t}`)}function wc(e){throw new E(e,"svelte_options_deprecated_tag",'"tag" option is deprecated — use "customElement" instead')}function Pc(e){throw new E(e,"svelte_options_invalid_attribute","`<svelte:options>` can only receive static attributes")}function Zi(e,t){throw new E(e,"svelte_options_invalid_attribute_value",`Value must be ${t}, if specified`)}function kc(e){throw new E(e,"svelte_options_invalid_customelement",'"customElement" must be a string literal defining a valid custom element name or an object of the form { tag?: string; shadow?: "open" | "none" | `ShadowRootInit`; props?: { [key: string]: { attribute?: string; reflect?: boolean; type: .. } } }')}function _c(e){throw new E(e,"svelte_options_invalid_customelement_props",'"props" must be a statically analyzable object literal of the form "{ [key: string]: { attribute?: string; reflect?: boolean; type?: "String" | "Boolean" | "Number" | "Array" | "Object" }"')}function Nc(e){throw new E(e,"svelte_options_invalid_customelement_shadow",'"shadow" must be either "open", "none" or `ShadowRootInit` object.')}function uo(e){throw new E(e,"svelte_options_invalid_tagname","Tag name must be lowercase and hyphenated")}function Dc(e){throw new E(e,"svelte_options_reserved_tagname","Tag name is reserved")}function $c(e,t){throw new E(e,"svelte_options_unknown_attribute",`\`<svelte:options>\` unknown attribute '${t}'`)}function Ic(e){throw new E(e,"tag_invalid_name","Expected a valid element or component name. Components must have a valid variable name or dot notation expression")}function Lc(e,t,n){throw new E(e,"tag_invalid_placement",`{@${t} ...} tag cannot be ${n}`)}function fe(e){throw new E(e,"unexpected_eof","Unexpected end of input")}function Rc(e,t){throw new E(e,"unexpected_reserved_word",`'${t}' is a reserved word in JavaScript and cannot be used here`)}function Mc(e){throw new E(e,"unterminated_string_constant","Unterminated string constant")}function Oc(e){throw new E(e,"void_element_invalid_content","Void elements cannot have children or closing tags")}var Ut="",Bc=[],er=0,q=[],z=0;function pg(e,t){Ut=e,Bc=t,er=0}function cg(){return er}function ug(e,t,n,i){er=i}function dg(e,t,n,i,r,s){er=i;let l=t;if(e&&l.includes(`
|
|
45
|
+
`)){let a=Ut.lastIndexOf(`
|
|
46
|
+
`,n-1)+1,p=a,c=Ut.charCodeAt(p);while(c===32||c===9)c=Ut.charCodeAt(++p);if(p>a)l=fg(l,Ut.slice(a,p))}let o={type:e?"Block":"Line",value:l,start:n,end:i};if(r&&s)o.loc={start:r,end:s};Bc.push(o)}function fg(e,t){let n=e.startsWith(t)?t.length:0,i="",r=e.indexOf(`
|
|
47
47
|
`,n);while(r!==-1){if(i+=e.slice(n,r+1),n=r+1,e.startsWith(t,n))n+=t.length;r=e.indexOf(`
|
|
48
|
-
`,n)}return i+e.slice(n)}function
|
|
49
|
-
`,l-1)+1,this.curLine=this.options.locations?s.slice(0,this.lineStart).split(ug).length:1;this.type=n.eof,this.value=null,this.start=this.end=l,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=l;let a=this.context;if(a.length!==1||a[0]!==r)this.context=this.initialContext();if(this.exprAllowed=!0,this.strict=!0,this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels.length>0)this.labels=[];for(let u in this.undefinedExports){this.undefinedExports=Object.create(null);break}let p=this.scopeStack,c=p[0];if(p.length!==1||c.flags!==Un||c.var.length>0||c.lexical.length>0||c.functions.length>0||c.tsTypes!==void 0||c.tsExportOnly!==void 0||c.tsEnums!==void 0)this.scopeStack=[],this.enterScope(Un);if(this.regexpState=null,this.privateNameStack.length>0)this.privateNameStack=[];this.inTemplateElement=!1}parseParenAndDistinguishExpression(s,l){let o=super.parseParenAndDistinguishExpression(s,l);if(o.type==="ParenthesizedExpression")er=!0;return o}checkUnreserved(s){if(Zi.has(s.name))super.checkUnreserved(s)}canInsertSemicolon(){let s=this.type;return s===n.eof||s===n.braceR||Rn(this.input,this.lastTokEnd,this.start)}checkLocalExport(){}skipSpace(){let s=this.input,l=this.options.locations,o=this.pos,a=s.charCodeAt(o);for(;;)if(a===32||a===9)a=s.charCodeAt(++o);else if(a===10){if(a=s.charCodeAt(++o),l)this.curLine++,this.lineStart=o}else break;if(this.pos=o,a===47||a<33||a>=128)super.skipSpace()}readWord1(){let s=this.input,l=this.pos,o=l,a=s.charCodeAt(o),p=0;while(a>=97&&a<=122||a>=65&&a<=90||a>=48&&a<=57||a===95||a===36)p=Math.imul(p,31)+a|0,a=s.charCodeAt(++o);if(a>=128||a===92)return super.readWord1();return this.containsEsc=!1,this.pos=o,sa(s,l,o,p)}readWord(){let s=this.readWord1();return this.finishToken(i.get(s)??n.name,s)}}}),Ic=$i(po,co),dg=/ \(\d+:\d+\)$/;function Ut(e){return e}function Lc(e){return e instanceof SyntaxError&&"pos"in e&&typeof e.pos==="number"}function tr(e,t,n,i,r,s=e.root.comments.length){let l=e.root.comments;Yy(t,l);let o={onComment:e.comments?eg:Zy,sourceType:"module",ecmaVersion:16,locations:e.loc,preserveParens:i};if(e.lfOnly)o.startLocation=Pe(n);let a=e.isTypeScript?e.typescript:Ic;if(!a)Ki();let p;try{p=r(a,o)}catch(c){if(!Lc(c))throw c;Xy(c.pos,c.message.replace(dg,""))}if(l.length>s)ng(Ut(p),l,n);return p}function nr(e,t,n=0){return Ut(tr(e,t,0,!1,(i,r)=>{if(n>0&&r.locations)r.startLocation=Pe(n);let s=new i(r,t,n).parse();return s.start=0,s},0))}function fg(e,t){if(!t)return{line:1,column:0};let{column:n}=Pe(e);return{line:aa(e-n)+1,column:n}}var hg={count:0},eo,mg=(e)=>e.parseExpression();function yg(e,t,n,i,r){let s=eo;if(eo=void 0,s?.ParserClass===e&&s.onComment===t.onComment&&s.locations===t.locations&&s.parser.reset)s.parser.reset(n,i,t.startLocation);else s={ParserClass:e,onComment:t.onComment,locations:t.locations,parser:new e(t,n,i)};let l=s.parser;l.nextToken();let o=r(l);return l.input="",eo=s,o}function Rc(e,t,n,i){return hg.count+=1,er=!1,tr(e,t,n,!0,(r,s)=>(s.startLocation??=fg(n,s.locations),yg(r,s,t,n,i)))}function qt(e,t,n,i=!1){let r=Ut(Rc(e,t,n,mg)),s=Math.max(r.end,Qy());return{node:er&&!i?uo(r):r,end:s}}function Mc(e,t,n){let i=e.root.comments.length,r=!0,s=Rc(e,t,n,(o)=>{let a={shorthandAssign:-1,trailingComma:-1,parenthesizedAssign:-1,parenthesizedBind:-1,doubleProto:-1},p=o.parseMaybeConditional(void 0,a);if(o.type!==Ic.acorn.tokTypes.eof)return r=!1,p;let c=o.toAssignable(p,!1,a);return o.checkLValPattern(c),c});if(!r){e.root.comments.length=i;return}let l=Ut(s);return er?uo(l):l}function Oc(e,t,n){return Ut(tr(e,t,n,!1,(i,r)=>{let s=new i(r,t,n);try{return s.nextToken(),s.parseStatement(null,!0,Object.create(null))}catch(l){if(Lc(l)&&l.pos===t.length)de(t.length);throw l}}))}function Bc(e,t,n){let i=tr(e,t,0,!1,(r,s)=>{let l=new r(s,t,0),o=l.startNode(),a=[],p=Object.create(null);return n((c)=>{l.pos=c,l.context=l.initialContext(),l.exprAllowed=!0,l.nextToken();let u=l.parseStatement(null,!0,p);return a.push(u),u.end}),o.body=a,l.finishNode(o,"Program")});return Ut(i).body}function uo(e){let t=e;while(t.type==="ParenthesizedExpression")t=t.expression;return Qt(t,uo),t}var ir=$i(po,Li,co);function rr(e,t,n){return _t(e),nr({isTypeScript:t.typescript??!1,typescript:n,loc:t.loc??!1,comments:t.comments??!0,root:{comments:[]}},e)}function fo(e,t={}){return rr(e,t,ir)}var Fc={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",bgsound:"HTMLUnknownElement",blink:"HTMLUnknownElement",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",isindex:"HTMLUnknownElement",kbd:"HTMLElement",keygen:"HTMLUnknownElement",label:"HTMLLabelElement",legend:"HTMLLegendElement",li:"HTMLLIElement",link:"HTMLLinkElement",listing:"HTMLPreElement",main:"HTMLElement",map:"HTMLMapElement",mark:"HTMLElement",marquee:"HTMLMarqueeElement",menu:"HTMLMenuElement",meta:"HTMLMetaElement",meter:"HTMLMeterElement",multicol:"HTMLUnknownElement",nav:"HTMLElement",nextid:"HTMLUnknownElement",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",spacer:"HTMLUnknownElement",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",xmp:"HTMLPreElement"},Vc={a:"SVGAElement",animate:"SVGAnimateElement",animateMotion:"SVGAnimateMotionElement",animateTransform:"SVGAnimateTransformElement",circle:"SVGCircleElement",clipPath:"SVGClipPathElement",defs:"SVGDefsElement",desc:"SVGDescElement",ellipse:"SVGEllipseElement",feBlend:"SVGFEBlendElement",feColorMatrix:"SVGFEColorMatrixElement",feComponentTransfer:"SVGFEComponentTransferElement",feComposite:"SVGFECompositeElement",feConvolveMatrix:"SVGFEConvolveMatrixElement",feDiffuseLighting:"SVGFEDiffuseLightingElement",feDisplacementMap:"SVGFEDisplacementMapElement",feDistantLight:"SVGFEDistantLightElement",feDropShadow:"SVGFEDropShadowElement",feFlood:"SVGFEFloodElement",feFuncA:"SVGFEFuncAElement",feFuncB:"SVGFEFuncBElement",feFuncG:"SVGFEFuncGElement",feFuncR:"SVGFEFuncRElement",feGaussianBlur:"SVGFEGaussianBlurElement",feImage:"SVGFEImageElement",feMerge:"SVGFEMergeElement",feMergeNode:"SVGFEMergeNodeElement",feMorphology:"SVGFEMorphologyElement",feOffset:"SVGFEOffsetElement",fePointLight:"SVGFEPointLightElement",feSpecularLighting:"SVGFESpecularLightingElement",feSpotLight:"SVGFESpotLightElement",feTile:"SVGFETileElement",feTurbulence:"SVGFETurbulenceElement",filter:"SVGFilterElement",foreignObject:"SVGForeignObjectElement",g:"SVGGElement",image:"SVGImageElement",line:"SVGLineElement",linearGradient:"SVGLinearGradientElement",marker:"SVGMarkerElement",mask:"SVGMaskElement",metadata:"SVGMetadataElement",mpath:"SVGMPathElement",path:"SVGPathElement",pattern:"SVGPatternElement",polygon:"SVGPolygonElement",polyline:"SVGPolylineElement",radialGradient:"SVGRadialGradientElement",rect:"SVGRectElement",script:"SVGScriptElement",set:"SVGSetElement",stop:"SVGStopElement",style:"SVGStyleElement",svg:"SVGSVGElement",switch:"SVGSwitchElement",symbol:"SVGSymbolElement",text:"SVGTextElement",textPath:"SVGTextPathElement",title:"SVGTitleElement",tspan:"SVGTSpanElement",use:"SVGUseElement",view:"SVGViewElement"},jc=new Set(["a","annotation","annotation-xml","maction","math","merror","mfrac","mi","mmultiscripts","mn","mo","mover","mpadded","mphantom","mprescripts","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msubsup","msup","mtable","mtd","mtext","mtr","munder","munderover","semantics"]);function sr(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function Gc(e,t="html"){if(t==="svg")return sr(Vc,e)??"SVGElement";if(t==="mathml")return jc.has(e)?"MathMLElement":sr(Fc,e)??"MathMLElement";return sr(Fc,e)??sr(Vc,e)??(jc.has(e)?"MathMLElement":"HTMLElement")}var Wc=new Map;function Hc(e){let t=Wc.get(e);if(t!==void 0)return t;let n=Bn(e,{inline:!0});return Wc.set(e,n),n}function Uc(e,t){let n=Fe(e.name,t.name);if(n!==0)return n;let i=Fe(e.type,t.type);if(i!==0)return i;if(e.type==="forwarded"&&t.type==="forwarded"){let r=Fe(e.element,t.element);if(r!==0)return r}return Fe(e.detail??"",t.detail??"")}var gg=/^["']|["']$/g,xg=/^([\w$]+)\s+extends\s/,Sg=/^\{\s*\}$/;function zt(e){return Array.from(e.values())}function ho(e,t){if(!e||typeof e!=="object"||!("type"in e)){t.dynamic=!0;return}if(e.type==="Literal"){let{value:n}=e;if(typeof n==="string"||typeof n==="number")t.names.push(String(n));else t.dynamic=!0}else if(e.type==="ConditionalExpression"){let n=e;ho(n.consequent,t),ho(n.alternate,t)}else if(e.type==="TemplateLiteral"){let n=e.quasis.map((i)=>i.value.cooked??i.value.raw);if(n.length===1)t.names.push(n[0]);else t.patterns.push(new RegExp(`^${n.map(an).join("[^]*")}$`))}else t.dynamic=!0}function Eg(e,t){let{dispatcherName:n,callees:i}=t,r=new Set(t.hostDispatchedEventNames),s=[],l=!1;for(let o of t.hostDispatches)fl(e,o);if(n!==void 0){_l(e,t.dispatcherTypeArgument,n,w(e,t.dispatcherDeclaratorNode));for(let o of i){if(o.name!==n||o.arguments.length===0)continue;let a={names:[],patterns:[],dynamic:!1};if(ho(o.arguments[0],a),s.push(...a.patterns),l||=a.dynamic,a.names.length===0)continue;let p=o.arguments[1],c=fs(ds(e,o.nestedBoundDetailNames),p);for(let u of a.names)Qe(e,{name:u,detail:c,has_argument:Boolean(p),source:w(e,o.node)}),r.add(u)}}for(let[o,a]of e.forwardedEvents){let p=e.events.get(o);if(p&&p.type==="dispatched"&&!r.has(o)){let c=e.eventDescriptions.get(o),u={type:"forwarded",name:o,element:a,description:c,deprecated:p.deprecated,tags:p.tags,source:p.source};if(p.internal)u.internal=!0;if(p.detail!==void 0&&p.detail!=="undefined")u.detail=p.detail;e.events.set(o,u)}}return{names:r,mayDispatch:(o)=>l||s.some((a)=>a.test(o))}}function Tg(e){return`(typeof ${e} extends abstract new (...args: any) => infer I ? I : typeof ${e} extends (...args: any) => infer R ? R : never)`}function qc(e,t){let n=[...zc(e,t),...e.components.sort().map(Tg)].join(" | ");return e.target==="indexed"?`(null | ${n})[]`:`null | ${n}`}function zc(e,t){return e.elements.sort((n,i)=>n.tag<i.tag?-1:n.tag>i.tag?1:0).map(({tag:n,namespace:i,tagLocal:r})=>{let s=r&&t?.get(r);return s?`HTMLElementTagNameMap[${s}]`:Gc(n,i)})}function vg(e){let t=e.syntaxMode==="runes"?new Set(Array.from(e.snippetPropLocals,(n)=>Wr(e,n))):new Set;return zt(e.props).filter((n)=>!(t.has(n.name)&&e.slots.has(n.name==="children"?Ze:n.name))).map((n)=>{let i=n.reactive||e.reactive_vars.has(n.name),r=e.bindings.get(n.name),s=r?.target==="indexed"&&n.type!==void 0&&!n.type.endsWith("[]"),l=n.typeSource==="typescript"||n.typeSource==="jsdoc";if(!r||r.target==="mixed"||s||l)return{...n,reactive:i};return{...n,type:qc(r),typeSource:"inferred",reactive:i}})}function bg(e){return zt(e.slots).map((t)=>{let{slot_props_unresolved_spread:n,...i}=t;if(!t.slot_props)return i;if(typeof t.slot_props==="string")return Sg.test(t.slot_props)?{...i,slot_props:"Record<string, never>"}:i;let r=[];for(let[o,a]of Object.entries(t.slot_props)){if(a.replace&&a.value!==void 0)a.value=tn(e,a.value);a.value??="any",r.push(`${o}: ${a.value}`)}let s=n?" & Record<string, any>":"",l=r.length===0?n?"Record<string, any>":"Record<string, never>":r.length===1?`{ ${r[0]} }${s}`:`{
|
|
50
|
-
${
|
|
48
|
+
`,n)}return i+e.slice(n)}function hg(e,t,n){let i=0,r=t.length;while(i<r){let s=i+r>>>1;if(t[s].start<n)i=s+1;else r=s}if(i>=t.length)return;if(q=t.slice(i).map(({type:s,value:l,start:o,end:a})=>({type:s,value:l,start:o,end:a})),z=0,ro(e,void 0,!1),z<q.length&&(q[z].start>=e.end||e.type==="Program")){e.trailingComments??=[];while(z<q.length)e.trailingComments.push(q[z++])}}var mg=new Map([["BlockStatement","body"],["Program","body"],["ArrayExpression","elements"],["ObjectExpression","properties"]]);function zp(e,t){for(let n=e;n<t;n++){let i=Ut.charCodeAt(n);if(i!==44&&i!==41&&i!==32&&i!==9)return!0}return!1}function ro(e,t,n){while(z<q.length&&q[z].start<e.start)e.leadingComments??=[],e.leadingComments.push(q[z++]);if(z>=q.length)return;let i=q[z].start;if(i<e.end||!zp(e.end,i)){let r=at(e),s=mg.get(e.type),l=s===void 0?void 0:r[s],o=Array.isArray(l)&&l.length===0;for(let a in r){if(z>=q.length)return;if(a==="type")continue;let p=r[a];if(Array.isArray(p)){let c=a===s;for(let u=0;u<p.length;u++){let f=p[u];if(Be(f))ro(f,e,c?u===p.length-1:o)}}else if(Be(p))ro(p,e,o)}if(z>=q.length)return}if(t!==void 0&&e.end===t.end)return;if(n)while(z<q.length){if(t&&q[z].start>=t.end)break;e.trailingComments??=[],e.trailingComments.push(q[z++])}else if(e.end<=q[z].start&&!zp(e.end,q[z].start))e.trailingComments=[q[z++]]}var tr=new Set("arguments await break case catch class const continue debugger default delete do else enum eval export extends false finally for function if implements import in instanceof interface let new null package private protected public return static super switch this throw true try typeof var void while with yield".split(" ")),nr=!1,qn=1,yg=2,gg=32,xg=256,Eg=qn|yg|xg,Sg=2,Tg=3,bg=4,vg=/\r\n?|\n|\u2028|\u2029/,Kp=new Map;function Yi(e){if(!(e instanceof RegExp))return e;let t=Kp.get(e);if(!t){let n=new Set(e.source.slice(4,-2).split("|"));t={test:(i)=>n.has(i)},Kp.set(e,t)}return t}var fo=Rn((e)=>class extends e{declareName(t,n,i){let r=!1;if(n===Sg){let s=this.currentScope();if(r=te(s.lexical,t)||te(s.functions,t)||te(s.var,t),s.lexical.push(t),this.inModule&&s.flags&qn)delete this.undefinedExports[t]}else if(n===bg)this.currentScope().lexical.push(t);else if(n===Tg){let s=this.currentScope();r=this.treatFunctionsAsVar?te(s.lexical,t):te(s.lexical,t)||te(s.var,t),s.functions.push(t)}else for(let s=this.scopeStack.length-1;s>=0;--s){let l=this.scopeStack[s];if(te(l.lexical,t)&&!(l.flags&gg&&l.lexical[0]===t)||!this.treatFunctionsAsVarInScope(l)&&te(l.functions,t)){r=!0;break}if(l.var.push(t),this.inModule&&l.flags&qn)delete this.undefinedExports[t];if(l.flags&Eg)break}if(r)this.raiseRecoverable(i,`Identifier '${t}' has already been declared`)}}),ho=Rn((e)=>{let{keywordTypes:t,tokTypes:n}=e.acorn,i=new Map("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this const class extends export import super".split(" ").map((s)=>[s,t[s]])),r;return class extends e{constructor(s,l,o){super(s,l,o);this.keywords=Yi(this.keywords),this.reservedWords=Yi(this.reservedWords),this.reservedWordsStrict=Yi(this.reservedWordsStrict),this.reservedWordsStrictBind=Yi(this.reservedWordsStrictBind),r??=this.context[0]}reset(s,l,o){if(super.reset?.(s,l,o),this.input=s,this.containsEsc=!1,this.pos=l,o)this.lineStart=l-o.column,this.curLine=o.line;else this.lineStart=s.lastIndexOf(`
|
|
49
|
+
`,l-1)+1,this.curLine=this.options.locations?s.slice(0,this.lineStart).split(vg).length:1;this.type=n.eof,this.value=null,this.start=this.end=l,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=l;let a=this.context;if(a.length!==1||a[0]!==r)this.context=this.initialContext();if(this.exprAllowed=!0,this.strict=!0,this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels.length>0)this.labels=[];for(let u in this.undefinedExports){this.undefinedExports=Object.create(null);break}let p=this.scopeStack,c=p[0];if(p.length!==1||c.flags!==qn||c.var.length>0||c.lexical.length>0||c.functions.length>0||c.tsTypes!==void 0||c.tsExportOnly!==void 0||c.tsEnums!==void 0)this.scopeStack=[],this.enterScope(qn);if(this.regexpState=null,this.privateNameStack.length>0)this.privateNameStack=[];this.inTemplateElement=!1}parseParenAndDistinguishExpression(s,l){let o=super.parseParenAndDistinguishExpression(s,l);if(o.type==="ParenthesizedExpression")nr=!0;return o}checkUnreserved(s){if(tr.has(s.name))super.checkUnreserved(s)}canInsertSemicolon(){let s=this.type;return s===n.eof||s===n.braceR||Mn(this.input,this.lastTokEnd,this.start)}checkLocalExport(){}skipSpace(){let s=this.input,l=this.options.locations,o=this.pos,a=s.charCodeAt(o);for(;;)if(a===32||a===9)a=s.charCodeAt(++o);else if(a===10){if(a=s.charCodeAt(++o),l)this.curLine++,this.lineStart=o}else break;if(this.pos=o,a===47||a<33||a>=128)super.skipSpace()}readWord1(){let s=this.input,l=this.pos,o=l,a=s.charCodeAt(o),p=0;while(a>=97&&a<=122||a>=65&&a<=90||a>=48&&a<=57||a===95||a===36)p=Math.imul(p,31)+a|0,a=s.charCodeAt(++o);if(a>=128||a===92)return super.readWord1();return this.containsEsc=!1,this.pos=o,la(s,l,o,p)}readWord(){let s=this.readWord1();return this.finishToken(i.get(s)??n.name,s)}}}),Fc=Li(fo,ho),Cg=/ \(\d+:\d+\)$/;function qt(e){return e}function Vc(e){return e instanceof SyntaxError&&"pos"in e&&typeof e.pos==="number"}function ir(e,t,n,i,r,s=e.root.comments.length){let l=e.root.comments;pg(t,l);let o={onComment:e.comments?dg:ug,sourceType:"module",ecmaVersion:16,locations:e.loc,preserveParens:i};if(e.lfOnly)o.startLocation=Pe(n);let a=e.isTypeScript?e.typescript:Fc;if(!a)Xi();let p;try{p=r(a,o)}catch(c){if(!Vc(c))throw c;lg(c.pos,c.message.replace(Cg,""))}if(l.length>s)hg(qt(p),l,n);return p}function rr(e,t,n=0){return qt(ir(e,t,0,!1,(i,r)=>{if(n>0&&r.locations)r.startLocation=Pe(n);let s=new i(r,t,n).parse();return s.start=0,s},0))}function Ag(e,t){if(!t)return{line:1,column:0};let{column:n}=Pe(e);return{line:ca(e-n)+1,column:n}}var wg={count:0},io,Pg=(e)=>e.parseExpression();function kg(e,t,n,i,r){let s=io;if(io=void 0,s?.ParserClass===e&&s.onComment===t.onComment&&s.locations===t.locations&&s.parser.reset)s.parser.reset(n,i,t.startLocation);else s={ParserClass:e,onComment:t.onComment,locations:t.locations,parser:new e(t,n,i)};let l=s.parser;l.nextToken();let o=r(l);return l.input="",io=s,o}function jc(e,t,n,i){return wg.count+=1,nr=!1,ir(e,t,n,!0,(r,s)=>(s.startLocation??=Ag(n,s.locations),kg(r,s,t,n,i)))}function zt(e,t,n,i=!1){let r=qt(jc(e,t,n,Pg)),s=Math.max(r.end,cg());return{node:nr&&!i?mo(r):r,end:s}}function Gc(e,t,n){let i=e.root.comments.length,r=!0,s=jc(e,t,n,(o)=>{let a={shorthandAssign:-1,trailingComma:-1,parenthesizedAssign:-1,parenthesizedBind:-1,doubleProto:-1},p=o.parseMaybeConditional(void 0,a);if(o.type!==Fc.acorn.tokTypes.eof)return r=!1,p;let c=o.toAssignable(p,!1,a);return o.checkLValPattern(c),c});if(!r){e.root.comments.length=i;return}let l=qt(s);return nr?mo(l):l}function Wc(e,t,n){return qt(ir(e,t,n,!1,(i,r)=>{let s=new i(r,t,n);try{return s.nextToken(),s.parseStatement(null,!0,Object.create(null))}catch(l){if(Vc(l)&&l.pos===t.length)fe(t.length);throw l}}))}function Hc(e,t,n){let i=ir(e,t,0,!1,(r,s)=>{let l=new r(s,t,0),o=l.startNode(),a=[],p=Object.create(null);return n((c)=>{l.pos=c,l.context=l.initialContext(),l.exprAllowed=!0,l.nextToken();let u=l.parseStatement(null,!0,p);return a.push(u),u.end}),o.body=a,l.finishNode(o,"Program")});return qt(i).body}function mo(e){let t=e;while(t.type==="ParenthesizedExpression")t=t.expression;return Zt(t,mo),t}var sr=Li(fo,Mi,ho);function or(e,t,n){return _t(e),rr({isTypeScript:t.typescript??!1,typescript:n,loc:t.loc??!1,comments:t.comments??!0,root:{comments:[]}},e)}function yo(e,t={}){return or(e,t,sr)}var Uc={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",bgsound:"HTMLUnknownElement",blink:"HTMLUnknownElement",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",isindex:"HTMLUnknownElement",kbd:"HTMLElement",keygen:"HTMLUnknownElement",label:"HTMLLabelElement",legend:"HTMLLegendElement",li:"HTMLLIElement",link:"HTMLLinkElement",listing:"HTMLPreElement",main:"HTMLElement",map:"HTMLMapElement",mark:"HTMLElement",marquee:"HTMLMarqueeElement",menu:"HTMLMenuElement",meta:"HTMLMetaElement",meter:"HTMLMeterElement",multicol:"HTMLUnknownElement",nav:"HTMLElement",nextid:"HTMLUnknownElement",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",spacer:"HTMLUnknownElement",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",xmp:"HTMLPreElement"},qc={a:"SVGAElement",animate:"SVGAnimateElement",animateMotion:"SVGAnimateMotionElement",animateTransform:"SVGAnimateTransformElement",circle:"SVGCircleElement",clipPath:"SVGClipPathElement",defs:"SVGDefsElement",desc:"SVGDescElement",ellipse:"SVGEllipseElement",feBlend:"SVGFEBlendElement",feColorMatrix:"SVGFEColorMatrixElement",feComponentTransfer:"SVGFEComponentTransferElement",feComposite:"SVGFECompositeElement",feConvolveMatrix:"SVGFEConvolveMatrixElement",feDiffuseLighting:"SVGFEDiffuseLightingElement",feDisplacementMap:"SVGFEDisplacementMapElement",feDistantLight:"SVGFEDistantLightElement",feDropShadow:"SVGFEDropShadowElement",feFlood:"SVGFEFloodElement",feFuncA:"SVGFEFuncAElement",feFuncB:"SVGFEFuncBElement",feFuncG:"SVGFEFuncGElement",feFuncR:"SVGFEFuncRElement",feGaussianBlur:"SVGFEGaussianBlurElement",feImage:"SVGFEImageElement",feMerge:"SVGFEMergeElement",feMergeNode:"SVGFEMergeNodeElement",feMorphology:"SVGFEMorphologyElement",feOffset:"SVGFEOffsetElement",fePointLight:"SVGFEPointLightElement",feSpecularLighting:"SVGFESpecularLightingElement",feSpotLight:"SVGFESpotLightElement",feTile:"SVGFETileElement",feTurbulence:"SVGFETurbulenceElement",filter:"SVGFilterElement",foreignObject:"SVGForeignObjectElement",g:"SVGGElement",image:"SVGImageElement",line:"SVGLineElement",linearGradient:"SVGLinearGradientElement",marker:"SVGMarkerElement",mask:"SVGMaskElement",metadata:"SVGMetadataElement",mpath:"SVGMPathElement",path:"SVGPathElement",pattern:"SVGPatternElement",polygon:"SVGPolygonElement",polyline:"SVGPolylineElement",radialGradient:"SVGRadialGradientElement",rect:"SVGRectElement",script:"SVGScriptElement",set:"SVGSetElement",stop:"SVGStopElement",style:"SVGStyleElement",svg:"SVGSVGElement",switch:"SVGSwitchElement",symbol:"SVGSymbolElement",text:"SVGTextElement",textPath:"SVGTextPathElement",title:"SVGTitleElement",tspan:"SVGTSpanElement",use:"SVGUseElement",view:"SVGViewElement"},zc=new Set(["a","annotation","annotation-xml","maction","math","merror","mfrac","mi","mmultiscripts","mn","mo","mover","mpadded","mphantom","mprescripts","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msubsup","msup","mtable","mtd","mtext","mtr","munder","munderover","semantics"]);function ar(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function Kc(e,t="html"){if(t==="svg")return ar(qc,e)??"SVGElement";if(t==="mathml")return zc.has(e)?"MathMLElement":ar(Uc,e)??"MathMLElement";return ar(Uc,e)??ar(qc,e)??(zc.has(e)?"MathMLElement":"HTMLElement")}var Jc=new Map;function Xc(e){let t=Jc.get(e);if(t!==void 0)return t;let n=Fn(e,{inline:!0});return Jc.set(e,n),n}function Yc(e,t){let n=Ve(e.name,t.name);if(n!==0)return n;let i=Ve(e.type,t.type);if(i!==0)return i;if(e.type==="forwarded"&&t.type==="forwarded"){let r=Ve(e.element,t.element);if(r!==0)return r}return Ve(e.detail??"",t.detail??"")}var _g=/^["']|["']$/g,Ng=/^([\w$]+)\s+extends\s/,Dg=/^\{\s*\}$/;function Kt(e){return Array.from(e.values())}function go(e,t){if(!e){t.dynamic=!0;return}if(e.type==="Literal"){let{value:n}=e;if(typeof n==="string"||typeof n==="number")t.names.push(String(n));else t.dynamic=!0}else if(e.type==="ConditionalExpression")go(e.consequent,t),go(e.alternate,t);else if(e.type==="TemplateLiteral"){let n=e.quasis.map((i)=>i.value.cooked??i.value.raw);if(n.length===1)t.names.push(n[0]);else t.patterns.push(new RegExp(`^${n.map(hi).join("[^]*")}$`))}else t.dynamic=!0}function $g(e,t){let{dispatcherName:n,callees:i}=t,r=new Set(t.hostDispatchedEventNames),s=[],l=!1;for(let o of t.hostDispatches)El(e,o);if(n!==void 0){Rl(e,t.dispatcherTypeArgument,n,P(e,t.dispatcherDeclaratorNode));for(let o of i){if(o.name!==n||o.arguments.length===0)continue;let a={names:[],patterns:[],dynamic:!1};if(go(o.arguments[0],a),s.push(...a.patterns),l||=a.dynamic,a.names.length===0)continue;let p=o.arguments[1],c=ys(ms(e,o.nestedBoundDetailNames),p);for(let u of a.names)Qe(e,{name:u,detail:c,has_argument:Boolean(p),source:P(e,o.node)}),r.add(u)}}for(let[o,a]of e.forwardedEvents){let p=e.events.get(o);if(p&&p.type==="dispatched"&&!r.has(o)){let c=e.eventDescriptions.get(o),u={type:"forwarded",name:o,element:a,description:c,deprecated:p.deprecated,tags:p.tags,source:p.source};if(p.internal)u.internal=!0;if(p.detail!==void 0&&p.detail!=="undefined")u.detail=p.detail;e.events.set(o,u)}}return{names:r,mayDispatch:(o)=>l||s.some((a)=>a.test(o))}}function Ig(e){return`(typeof ${e} extends abstract new (...args: any) => infer I ? I : typeof ${e} extends (...args: any) => infer R ? R : never)`}function Qc(e,t){let n=[...Zc(e,t),...e.components.sort().map(Ig)].join(" | ");return e.target==="indexed"?`(null | ${n})[]`:`null | ${n}`}function Zc(e,t){return e.elements.sort((n,i)=>n.tag<i.tag?-1:n.tag>i.tag?1:0).map(({tag:n,namespace:i,tagLocal:r})=>{let s=r&&t?.get(r);return s?`HTMLElementTagNameMap[${s}]`:Kc(n,i)})}function Lg(e){let t=e.syntaxMode==="runes"?new Set(Array.from(e.snippetPropLocals,(n)=>Ur(e,n))):new Set;return Kt(e.props).filter((n)=>!(t.has(n.name)&&e.slots.has(n.name==="children"?Ze:n.name))).map((n)=>{let i=n.reactive||e.reactive_vars.has(n.name),r=e.bindings.get(n.name),s=r?.target==="indexed"&&n.type!==void 0&&!n.type.endsWith("[]"),l=n.typeSource==="typescript"||n.typeSource==="jsdoc";if(!r||r.target==="mixed"||s||l)return{...n,reactive:i};return{...n,type:Qc(r),typeSource:"inferred",reactive:i}})}function Rg(e){return Kt(e.slots).map((t)=>{let{slot_props_unresolved_spread:n,...i}=t,{slot_props:r}=t;if(!r)return{...i,slot_props:r};if(typeof r==="string")return{...i,slot_props:Dg.test(r)?"Record<string, never>":r};let s=[];for(let[a,p]of Object.entries(r)){if(p.replace&&p.value!==void 0)p.value=nn(e,p.value);p.value??="any",s.push(`${a}: ${p.value}`)}let l=n?" & Record<string, any>":"",o=s.length===0?n?"Record<string, any>":"Record<string, never>":s.length===1?`{ ${s[0]} }${l}`:`{
|
|
50
|
+
${s.join(`;
|
|
51
51
|
`)};
|
|
52
|
-
}${
|
|
53
|
-
`);for(let{name:r,constraint:s}of e.deferredSlotBlockGenerics){if(!new RegExp(`\\b${an(r)}\\b`).test(i))continue;Ei(e,r,s)}}if(e.scriptGenericsAttribute){if(e.generics)D(e,"syntax-skipped","generics",'Both the "generics" script attribute and @generics/@template JSDoc tags declare component generics; the script attribute takes precedence and the JSDoc declaration was ignored.',e.scriptGenericsAttribute.source);e.generics=El(e.scriptGenericsAttribute.value)}}function Ag(e){return zt(e.events).map((t)=>t.type==="forwarded"?{...t,element:t.element.name}:t).sort(Uc)}function Pg(e,t){let n=new Map(e.pendingCallDefaultCandidates.filter((i)=>i.location==="props").map((i)=>[i.propName,i]));for(let i of t)if(i.typeSource==="unknown"){let r=n.get(i.name),s=r?r.importSource?`Prop "${i.name}" default calls "${r.calleeName}()" imported from "${r.importSource}"; falling back to "any" pending cross-file resolution.`:`Prop "${i.name}" default calls "${r.calleeName}()", but its return type could not be inferred; falling back to "any".`:`Prop "${i.name}" type could not be inferred; falling back to "any".`;D(e,"prop-unknown-type",i.name,s,i.source)}}function or(e,t,n,i){if(t===void 0||Hc(t))return!0;let r=Bn(t)?"has a `//` comment, which would comment out the code after it in the .d.ts":"is not valid TypeScript";return D(e,"type-syntax-error",n,`Type \`${t}\` of "${n}" ${r}; falling back to "any".`,i),!1}function wg(e,t,n,i,r){for(let s of t)if(s.typeSource==="jsdoc"&&!or(e,s.type,s.name,s.source))s.type="any";for(let s of n)if(s.type==="dispatched"&&!or(e,s.detail,s.name,s.source))s.detail="any";for(let s of i)if(!or(e,s.slot_props,s.name??"default",s.source))s.slot_props="any";for(let s of r)if(!or(e,s.type,s.name,s.source))s.type="any",s.ts=`type ${s.name} = any;`}function kg(e,t){let{dispatcherName:n}=t,i=[];if(n===void 0)return i;let r=[];for(let l of t.callsWithArguments){let o=ul(l,n);if(o)r.push({call:l,...o})}if(r.length>0)Je(e,"dispatch-escapes",n,ge(e,n)?.sveldIgnore);let s=zr(e,"dispatch-escapes",n);for(let{call:l,argumentIndex:o,property:a}of r){let p=t.locallyBoundCalls.has(l)?void 0:ss(e,l.callee);if(!p){i.push(l);continue}let c=w(e,l);e.pendingDispatchEscapeCandidates.push({importSource:p.source,importedName:p.importedName,...p.members?{members:p.members}:{},calleeText:oe(e,l.callee)??p.importedName,dispatcherName:n,argumentIndex:o,...a===void 0?{}:{property:a},...c?{source:c}:{},...s?{ignored:s}:{}})}return i}function _g(e,t,n){for(let i of e.jsDocEventNames){if(t.names.has(i)||t.mayDispatch(i))continue;if(e.forwardedEvents.has(i)||e.typedDispatcherEventNames.has(i))continue;if(e.props.has(`on${i}`))continue;if(n.length>0)continue;let r=qr(e,"event-no-source",i,`@event "${i}" has no matching dispatch or callback prop.`,e.jsDocEventSources.get(i));if(e.pendingDispatchEscapeCandidates.length>0)e.deferredEventNoSourceDiagnostics.push(r);else e.diagnosticRecords.push(r)}}function Ng(e){if(e.slotsUntracked)return;let t=e.syntaxMode==="runes";for(let[n,{tag:i,source:r}]of e.jsDocSlots){let s=n??"children";if(e.renderedSlots.has(n)||t&&e.props.has(s))continue;let l=n===Ze?"default <slot>":`<slot name="${n}">`,o=t?`{@render ${s}()} or "${s}" prop`:l,a=n===Ze?`@${i} documents the default slot, but the component has no ${o}.`:`@${i} "${n}" has no matching ${o} in the component.`;D(e,"slot-not-rendered",n??"default",a,r)}}function Dg(e){let t=e.rest_props;if(t?.type!=="InlineComponent")return;let n=dn(e,t.name),i=e.extends?.import.replace(gg,"");if(n?.importedName==="default"&&n.source===i)return;D(e,"rest-props-unresolved","$$restProps",`$$restProps is only spread onto component "${t.name}"; sveld cannot infer its rest-prop type. Spread onto a plain element or add an @restProps tag.`,e.restPropsSource)}function $g(e,t){let n=t.typedefs.filter((r)=>r.internal).map((r)=>{let s=r.name.split("<")[0];return{name:s,regex:new RegExp(`\\b${s}\\b`)}});if(n.length===0)return;let i=(r,s,l)=>{if(!s)return;for(let{name:o,regex:a}of n){if(!a.test(s))continue;D(e,"internal-typedef-referenced",r,`"${r}" references "${o}", which is @internal and excluded from output; the generated .d.ts will contain a dangling reference to it.`,l)}};for(let r of[...t.props,...t.moduleExports]){if(r.internal)continue;i(r.name,r.type,r.source)}for(let r of t.typedefs){if(r.internal)continue;i(r.name,r.ts)}for(let r of t.events){if(r.internal||r.type!=="dispatched")continue;i(r.name,r.detail,r.source)}for(let r of t.slots){if(r.internal)continue;i(r.name??"default",r.slot_props,r.source)}for(let r of t.contexts){if(r.internal)continue;if(r.type!==void 0)i(r.typeName,r.type,r.source);for(let s of r.properties)i(s.name,s.type)}}function Ig(e){let t=new Set;for(let n of F(e?.[1]??"",",")){let i=n.trim().match(xg)?.[1];if(i)t.add(i)}return t}function Lg(e,t){let n=Ig(e.generics),i=new Map;for(let r of t){let s=r.type?.trim();if(s&&n.has(s))i.set(r.localName??r.name,s)}return i}function Rg(e,t,n){if(n.size===0)return;let i=e.rest_props,r=e.restPropsTagLocal===void 0?void 0:n.get(e.restPropsTagLocal);if(i?.type==="Element"&&i.name==="svelte:element"&&!i.thisValue&&r)e.rest_props={...i,thisType:r};for(let[s,l]of t.entries()){let o=e.bindings.get(l.name);if(l.typeSource!=="inferred"||!o?.elements.some(({tagLocal:a})=>a&&n.has(a)))continue;t[s]={...l,type:qc(o,n)}}}var Mg=/^(?:(?:HTML|SVG|MathML)\w*)?Element$|^HTMLElementTagNameMap\[[\w$]+\]$/;function Og(e,t,n){for(let i of t){if(i.typeSource!=="typescript"&&i.typeSource!=="jsdoc")continue;let r=e.bindings.get(i.name);if(r?.target!=="direct"||r.components.length>0||i.type===void 0)continue;let s=({tag:h,tagLocal:m})=>h==="svelte:element"&&!(m&&n.has(m));if(r.elements.some(s))continue;let l=(h)=>h==="null"||h==="undefined",o=F(i.type,"|").map((h)=>h.trim()).filter(Boolean),a=o.filter(l),p=o.filter((h)=>!l(h));if(!p.every((h)=>Mg.test(h)))continue;let c=[...new Set(zc(r,n))];if(p.every((h)=>c.includes(h)))continue;let u=r.elements.map(({tag:h,tagLocal:m})=>h==="svelte:element"?`<svelte:element this={${m}}>`:`<${h}>`),f=(l(o[0]??"")?[...a,...c]:[...c,...a]).join(" | ");D(e,"bind-this-type-mismatch",i.name,`Prop "${i.name}" is declared as "${i.type}", but \`bind:this\` only binds it to ${Bg(u)}. Declare "${f}" instead.`,i.source)}}function Bg(e){return e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}function Kc(e,t){let n=Eg(e,t);Nl(e,n.names);let i=vg(e);e.activeScopes.length=0;let r=bg(e);Cg(e,i,r);let s=Lg(e,i);Rg(e,i,s);let l=zt(e.moduleExports),o=Ag(e),a=zt(e.typedefs),p=zt(e.contexts);Pg(e,i),Og(e,i,s),wg(e,i,o,r,a);let c=kg(e,t);_g(e,n,c),Ng(e);let{dispatcherName:u}=t;for(let g of c){let y=oe(e,g.callee)??"";D(e,"dispatch-escapes",u??"",`\`${u}\` is passed to \`${y}\`, 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.`,w(e,g))}Dg(e),$g(e,{props:i,moduleExports:l,typedefs:a,events:o,slots:r,contexts:p});let f={source:di(e,0,e.source?.length),syntaxMode:e.syntaxMode,...e.scriptLanguage?{scriptLanguage:e.scriptLanguage}:{},props:i,moduleExports:l,slots:r,events:o,typedefs:a,generics:e.generics,rest_props:e.rest_props,extends:e.extends,componentComment:e.componentComment,componentCommentSource:e.componentCommentSource,contexts:p,customElementTag:e.customElementTag,customElement:e.customElement,...e.cssParts.length>0?{cssParts:e.cssParts.slice()}:{},...e.cssProperties.length>0?{cssProperties:e.cssProperties.slice()}:{},diagnostics:e.diagnosticRecords.slice()},h=$a(e);if(h)f[Me]=h;if(e.propIgnoreCodes.size>0)f[ia]=Object.fromEntries(e.propIgnoreCodes);let m=Da(e);return m?{component:f,pending:m}:{component:f}}function Fg(e){if(e.computed)return;if(e.key.type==="Identifier")return e.key.name;if(e.key.type==="Literal"&&(typeof e.key.value==="string"||typeof e.key.value==="number"))return String(e.key.value);return}function Jc(e){return e==="private"||e==="protected"}function Kt(e){return{...e?.description?{description:e.description}:{},...e?.deprecated===void 0?{}:{deprecated:e.deprecated},...e?.tags?{tags:e.tags}:{}}}function Yc(e){return e?.slice(1,-1).trim()||void 0}function Vg(e){let t=e?.type==="TSParameterProperty"?e.parameter:e;return t?.type==="AssignmentPattern"?Se(t.right,"widen"):void 0}function mo(e,t,n){let i=pn(e,t),r=new Map((n?.params??[]).map((a)=>[a.name,a])),s=i.params.map(({name:a,type:p,optional:c,rest:u},f)=>{let h=r.get(a);return{name:u?`...${a}`:a,type:p??h?.type??Vg(t.params[f])??(u?"any[]":"any"),...h?.description?{description:h.description}:{},...!u&&(c||h?.optional)?{optional:!0}:{}}}),l=i.returnType??n?.returnType??(t.async?"Promise<any>":void 0),o=Yc(i.typeParameters)??n?.typeParameters;return{...s.length>0?{params:s}:{},...l?{returnType:l}:{},...o?{typeParameters:o}:{}}}function Qc(e,t){let n=[],i=new Map,r=new Set,s=new Set,l,o=-1;for(let c of t.body.body){if(c.type==="TSIndexSignature"){let[y]=c.parameters;if(!y)continue;O(e,c.typeAnnotation?.typeAnnotation),n.push({kind:"index",name:`[${y.name}: ${ae(e,y.typeAnnotation)??"string"}]`,type:ae(e,c.typeAnnotation)??"any",...c.static?{static:!0}:{},...c.readonly?{readonly:!0}:{}});continue}if(c.type!=="MethodDefinition"&&c.type!=="PropertyDefinition")continue;if(Jc(c.accessibility))continue;let u=Fg(c);if(u===void 0)continue;let f=j(e,c);if(f?.internal)continue;let h=`${c.static?"static ":""}${u}`,m={...c.static?{static:!0}:{},...c.optional?{optional:!0}:{},...c.abstract?{abstract:!0}:{}};if(c.type!=="MethodDefinition"){if(O(e,c.typeAnnotation?.typeAnnotation),!c.static)s.add(u);n.push({kind:"property",name:u,type:ae(e,c.typeAnnotation)??f?.type??Se(c.value,"widen")??"any",...m,...c.readonly?{readonly:!0}:{},...Kt(f)});continue}let g=c.typeParameters?{...c.value,typeParameters:c.typeParameters}:c.value;if(c.kind==="constructor"){let y=mo(e,g,f);n.push({kind:"constructor",name:"constructor",params:y.params,...Kt(f)}),o=n.length,l=g.type==="FunctionExpression"?g.body.body:void 0;for(let[E,v]of g.params.entries()){if(v.type!=="TSParameterProperty"||Jc(v.accessibility))continue;let M=y.params?.[E];if(!M)continue;s.add(M.name),n.push({kind:"property",name:M.name,type:M.type,...v.readonly?{readonly:!0}:{},...M.description?{description:M.description}:{}})}continue}if(c.kind==="get"||c.kind==="set"){let y=mo(e,g,f),E=c.kind==="get"?y.returnType??f?.type:y.params?.[0]?.type??f?.type,v=i.get(h);if(v){if(c.kind==="set")v.readonly=void 0;if(E&&E!=="any"&&(v.type==="any"||c.kind==="get"))v.type=E;if(!v.description&&!v.deprecated)Object.assign(v,Kt(f));continue}let M={kind:"property",name:u,type:E??"any",...m,...c.kind==="get"?{readonly:!0}:{},...Kt(f)};i.set(h,M),n.push(M);continue}if(g.type==="TSDeclareMethod"&&!c.abstract)r.add(h);else if(g.type!=="TSDeclareMethod"&&r.has(h))continue;n.push({kind:"method",name:u,...m,...mo(e,g,f),...Kt(f)})}if(e.scriptLanguage!=="ts"&&l)n.splice(o,0,...Gg(e,l,s));for(let c of t.typeParameters?.params??[])O(e,c.constraint),O(e,c.default);let a=Yc(ut(e,t.typeParameters)),p=jg(e,t);return{members:n,...a?{typeParameters:a}:{},...p}}function jg(e,t){let n={},i=t.superClass;if(i){if(n.extends=ut(e,{start:i.start,end:t.superTypeParameters?.end??i.end}),i.type==="Identifier")Xc(e,i,t.superTypeParameters)}let r=(t.implements??[]).map((s)=>(Xc(e,s.expression,s.typeParameters),ut(e,s))).filter((s)=>Boolean(s));if(r.length>0)n.implements=r;return n}function Xc(e,t,n){O(e,{type:"TSTypeReference",typeName:t,start:t.start,end:n?.end??t.end,...n?{typeArguments:n}:{}})}function Gg(e,t,n){let i=[];for(let r of t){let s=r.type==="ExpressionStatement"?r.expression:void 0;if(s?.type!=="AssignmentExpression"||s.operator!=="=")continue;let l=s.left;if(l.type!=="MemberExpression"||l.computed||l.object.type!=="ThisExpression")continue;let o=l.property.type==="Identifier"?l.property.name:void 0;if(!o||n.has(o))continue;n.add(o);let a=j(e,r);if(a?.internal)continue;i.push({kind:"property",name:o,type:a?.type??"any",...Kt(a)})}return i}var Wg=/^[A-Za-z_$][\w$]*(?=\s*(?:<|$))/;function ar(e,t,n){if(!t)return;let i=e.moduleExports.get(t);e.moduleExports.set(t,i?{...i,...n}:n)}function Zc(e,t,n,i){let r=j(e,t);ar(e,n==="*"?`* from ${i.from}`:n,{name:n,kind:"re-export",description:r?.description,deprecated:r?.deprecated,tags:r?.tags,...r?.internal?{internal:!0}:{},isFunction:!1,isFunctionDeclaration:!1,isRequired:!1,constant:!1,reactive:!1,reExport:i,source:w(e,t)})}function eu(e,t){D(e,"module-export-conflict","default",`export "default" was skipped because it collides with the component's own default export.`,w(e,t))}function Hg(e,t,n,i){let r=n.id?.name;if(!r)return;let s=i?.exportedName??r,l=wn(e,t,i),{members:o,typeParameters:a,extends:p,implements:c}=Qc(e,n),u=a??l?.typeParameters;ar(e,s,{name:s,...r===s?{}:{localName:r},kind:"class",description:l?.description,deprecated:l?.deprecated,tags:l?.tags,...l?.internal?{internal:!0}:{},type:`typeof ${r}`,...u?{typeParameters:u}:{},members:o,...n.abstract?{abstract:!0}:{},...p?{extends:p}:{},...c?{implements:c}:{},isFunction:!1,isFunctionDeclaration:!1,isRequired:!1,constant:!1,reactive:!1,source:w(e,t)})}function tu(e,t,n,i){if(n.type==="ClassDeclaration"){Hg(e,t,n,i);return}let r=ys(e,n,i,"moduleExports");if(r.length===0)return;let s=wn(e,t,i);for(let l of r){let{prop_name:o,kind:a}=l,{type:p,typeSource:c,description:u,params:f,returnType:h,isFunction:m,typeParameters:g}=gs(e,l,s);ar(e,o,{name:o,kind:a,description:u,deprecated:s?.deprecated,tags:s?.tags,...s?.internal?{internal:!0}:{},type:p,typeSource:c,value:l.value,defaultValue:l.defaultValue,params:f,returnType:h,typeParameters:g,isFunction:m,isFunctionDeclaration:l.isFunctionDeclaration,isRequired:!1,constant:a==="const",reactive:!1,source:w(e,t)})}}function Ug(e,t){return e.parsed?.fragment.nodes.find((n)=>n.type==="SnippetBlock"&&n.expression.name===t)}function qg(e,t){let n;try{n=fo(`function f<${t}>() {}`,{typescript:!0})}catch{return}let i=n.body[0];if(i?.type!=="FunctionDeclaration")return;for(let r of i.typeParameters?.params??[])O(e,r.constraint),O(e,r.default)}function zg(e,t,n,i){let r=pn(e,{params:n.parameters}).params,l=r.map((c,u)=>{let f=n.parameters[u];if(c.type||f?.type!=="AssignmentPattern")return c;return{...c,type:Se(f.right,"widen")}}).map((c)=>`${c.name}${c.optional?"?":""}: ${c.type??"any"}`).join(", ");if(n.typeParams)qg(e,n.typeParams);let o=n.typeParams?`<${n.typeParams}>(${l}) => ReturnType<Snippet>`:l?`Snippet<[${l}]>`:"Snippet",a=wn(e,t,i),p=i.exportedName;ar(e,p,{name:p,...i.localName===p?{}:{localName:i.localName},kind:"const",description:a?.description,deprecated:a?.deprecated,tags:a?.tags,...a?.internal?{internal:!0}:{},type:o,typeSource:e.scriptLanguage==="ts"&&r.every((c)=>c.type)?"typescript":"inferred",isFunction:n.typeParams!==void 0,isFunctionDeclaration:!1,isRequired:!1,constant:!0,reactive:!1,source:w(e,t)})}function Kg(e){let t=Array.from(e.moduleExports.values()).filter((i)=>i.kind==="class"),n=new Set(t.map((i)=>i.localName??i.name));for(let i of t){if(!i.extends)continue;let r=Wg.exec(i.extends)?.[0];if(r&&(n.has(r)||e.valueImportBindingsByLocalName.has(r)||e.typeImportBindingsByLocalName.has(r)))continue;D(e,"export-unresolved",i.name,`class "${i.name}" extends \`${i.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.`,i.source),i.extends=void 0}}function nu(e){let t=e.parsed?.module;if(!t)return;let n=Ma(t);z(t,{enter(i,r){if(i.type==="ImportDeclaration")cn(e,i);if(i.type==="FunctionDeclaration"&&i.id?.name)e.funcDecls.set(i.id.name,i);if(i.type==="VariableDeclaration")e.vars.add(i);if(i.type==="ExportNamedDeclaration"){if(i.declaration!=null){tu(e,i,i.declaration);return}let s=i.source?.value,l=r?.type==="Program"?r:null;for(let o of i.specifiers){let a=hs(e,i,o,l,"module");if(!a)continue;if(a.exportedName==="default"){eu(e,i);continue}let p=typeof s==="string"?{from:s,imported:a.localName}:n.get(a.localName),c=a.declaration||p?void 0:Ug(e,a.localName);if(a.declaration)tu(e,i,a.declaration,a);else if(c)zg(e,i,c,a);else if(p)Zc(e,i,a.exportedName,p);else if(!e.localTypeDeclarationsByName.get(a.localName)?.exported)ms(e,i,a.localName,a.exportedName)}}if(i.type==="ExportAllDeclaration"&&typeof i.source.value==="string"){let s=(i.exported&&Si(i.exported))??"*";if(s==="default"){eu(e,i);return}Zc(e,i,s,{from:i.source.value,imported:"*"})}}}),Kg(e)}var Jg=[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],Xg=/[:!]/;function Yg(e){let t;return()=>(t??=Qg(e),t)}function Qg(e){let t=new Map,n=0,i="";for(let r of e.split(" ")){let s=r.search(Xg);i=i.slice(0,Number.parseInt(r[0],36))+r.slice(1,s);let l=Number.parseInt(r.slice(s+1),36);if(t.set(`${i};`,l),r[s]==="!")t.set(i,l);n=Math.max(n,i.length+1)}return{table:t,longest:n}}var ru=Yg("0amp!12 1pos:13 0gt!1q 0lt!1o 0quot!y"),yo=(e)=>e>=48&&e<=57,Zg=(e)=>yo(e)||e>=65&&e<=70||e>=97&&e<=102,iu=(e)=>yo(e)||e>=65&&e<=90||e>=97&&e<=122,lr=0;function ex(e,t,n,i){if(e.charCodeAt(t)===35){let o=(e.charCodeAt(t+1)|32)===120,a=t+(o?2:1),p=a;while(p<e.length&&(o?Zg:yo)(e.charCodeAt(p)))p++;if(p===a)return 0;return lr=e.charCodeAt(p)===59?p+1:p,Number.parseInt(e.slice(a,p),o?16:10)}let{table:r,longest:s}=i(),l=t;while(l-t<s&&iu(e.charCodeAt(l)))l++;if(e.charCodeAt(l)===59){let o=r.get(e.slice(t,l+1));if(o!==void 0)return lr=l+1,o}for(let o=l;o>t;o--){let a=r.get(e.slice(t,o));if(a===void 0)continue;if(n){let p=e.charCodeAt(o);if(iu(p)||p===95||p===61)continue}return lr=o,a}return 0}function tx(e,t){if(e===10&&!t)return 32;if(e<128)return e;if(e<=159)return Jg[e-128];if(e>=55296&&e<=57343)return 0;if(e<=196607)return e;if(e>=917504&&e<=917631||e>=917760&&e<=917999)return e;return 0}function pr(e,t,n){let i=e.indexOf("&");if(i===-1)return e;let r="",s=0;while(i!==-1){let l=ex(e,i+1,t,n);if(l)r+=e.slice(s,i)+String.fromCodePoint(tx(l,t)),s=lr;i=e.indexOf("&",l?s:i+1)}return r+e.slice(s)}var su=new WeakMap;function go(e,t){let n=su.get(e);if(n===void 0)su.set(e,[t]);else n.push(t)}var nx=/\r(?!\n)|[\u2028\u2029]/,vu=/\s*}/y;function To(e,t){let n=e.codePointAt(t);if(n===void 0||!Te(n,!0))return t;let i=t+(n<=65535?1:2),r=e.codePointAt(i);while(r!==void 0&&_e(r,!0))i+=r<=65535?1:2,r=e.codePointAt(i);return i}class bu{source;index=0;loc;lfOnly;isTypeScript;typescript;entityNames;css;script;comments;root;stack;fragments;metaTags=new Set;lastAutoClosedTag;nextAngle=-1;nextBrace=-1;constructor(e,t,n,i={}){if(this.source=e,this.loc=i.loc??!1,this.lfOnly=this.loc&&!nx.test(e),this.isTypeScript=Bi(e),this.typescript=n.typescript,this.isTypeScript&&!this.typescript)Ki();this.entityNames=n.entityNames,this.css=i.css??!0,this.script=i.script??!0,this.comments=i.comments??!0,this.root={type:"Root",start:0,end:t,css:null,js:[],options:null,fragment:{type:"Fragment",nodes:[]},comments:[]},this.stack=[this.root],this.fragments=[this.root.fragment]}match(e){if(e.length===1)return this.source.charCodeAt(this.index)===e.charCodeAt(0);return this.source.startsWith(e,this.index)}matchRegex(e){return e.lastIndex=this.index,e.exec(this.source)?.[0]??null}eat(e,t=!1){if(this.match(e))return this.index+=e.length,!0;if(t)nt(this.index,e);return!1}read(e){let t=this.matchRegex(e);if(t)this.index+=t.length;return t}readUntil(e){if(this.index>=this.source.length)de(this.source.length);let t=this.source.indexOf(e,this.index),n=t===-1?this.source.length:t,i=this.source.slice(this.index,n);return this.index=n,i}allowWhitespace(){this.index=R(this.source,this.index)}requireWhitespace(){if(!H(this.source.charCodeAt(this.index)))ac(this.index);this.allowWhitespace()}eatClosingBrace(){this.allowWhitespace(),this.eat("}",!0)}sourceLocation(e,t){return this.loc?{start:Pe(e),end:Pe(t)}:void 0}readIdentifierName(){let e=this.index,t=To(this.source,e),n=this.source.slice(e,t);if(this.index=t,Zi.has(n))_c(e,n);let i={type:"Identifier",name:n,start:e,end:t};if(this.loc)i.loc=this.sourceLocation(e,t);return i}current(){return this.stack[this.stack.length-1]}append(e){this.fragments[this.fragments.length-1].nodes.push(e)}open(e,t){this.append(e),this.stack.push(e),this.fragments.push(t)}setFragment(e){this.fragments[this.fragments.length-1]=e}close(){this.stack.pop(),this.fragments.pop()}}var ix={"||":1,"??":1,"&&":2,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"+":9,"-":9,"*":10,"/":10,"%":10};function vo(e,t,n,i){return{type:"Literal",start:t,end:n,value:i,raw:e.slice(t,n)}}function ou(e,t){let n=e.charCodeAt(t);if(n===34||n===39){for(let r=t+1;r<e.length;r++){let s=e.charCodeAt(r);if(s===n)return vo(e,t,r+1,e.slice(t+1,r));if(s===92||s===10||s===13)return null}return null}let i=t;for(;i<e.length;i++){let r=e.charCodeAt(i);if(r<48||r>57)break}if(i===t||n===48&&i-t>1)return null;return vo(e,t,i,Number(e.slice(t,i)))}function rx(e,t,n){let i=To(e,t);if(i===t)return ou(e,t);let r=e.slice(t,i);if(r==="true"||r==="false"||r==="null")return vo(e,t,i,r==="null"?null:r==="true");if(Zi.has(r))return null;let s={type:"Identifier",start:t,end:i,name:r};for(let l=i;;){let o=e.charCodeAt(l);if(o===40){let c=sx(e,l+1,n);if(!c)return null;s={type:"CallExpression",start:t,end:c.end,callee:s,arguments:c.arguments,optional:!1},l=c.end;continue}let a,p;if(o===46){if(p=To(e,l+1),p===l+1)return null;a={type:"Identifier",start:l+1,end:p,name:e.slice(l+1,p)}}else if(o===91){if(a=ou(e,l+1),!a||e.charCodeAt(a.end)!==93)return null;p=a.end+1}else return s;s={type:"MemberExpression",start:t,end:p,object:s,property:a,computed:o===91,optional:!1},l=p}}function sx(e,t,n){let i=[],r=R(e,t);if(e.charCodeAt(r)===41)return{arguments:i,end:r+1};for(;;){let s=ur(e,r,n);if(!s)return null;i.push(s),r=R(e,s.end);let l=e.charCodeAt(r);if(l===41)return{arguments:i,end:r+1};if(l!==44)return null;if(r=R(e,r+1),e.charCodeAt(r)===41)return null}}function wo(e,t,n){let i=e.charCodeAt(t),r=e.charCodeAt(t+1);if(!(i===33&&r!==61)&&!(i===45&&r!==45&&r!==61))return rx(e,t,n);let s=wo(e,R(e,t+1),n);if(!s)return null;return{type:"UnaryExpression",start:t,end:s.end,operator:i===33?"!":"-",prefix:!0,argument:s}}function au(e,t,n){let i=e.charCodeAt(t),r=e.charCodeAt(t+1);switch(i){case 124:return r===124&&e.charCodeAt(t+2)!==61?"||":null;case 38:return r===38&&e.charCodeAt(t+2)!==61?"&&":null;case 63:return r===63&&e.charCodeAt(t+2)!==61?"??":null;case 61:if(r!==61)return null;return e.charCodeAt(t+2)===61?"===":"==";case 33:if(r!==61)return null;return e.charCodeAt(t+2)===61?"!==":"!=";case 60:case 62:if(n||r===i)return null;if(r===61)return i===60?"<=":">=";return i===60?"<":">";case 43:return r===43||r===61?null:"+";case 45:return r===45||r===61?null:"-";case 42:return r===42||r===61?null:"*";case 47:return r===47||r===42||r===61?null:"/";case 37:return r===61?null:"%";default:return null}}function bo(e,t,n,i){if(Cu(e.charCodeAt(t.end)))return t;let r=R(e,t.end),s=au(e,r,i);if(s===null)return t;let l=ix[s];if(l<=n)return t;let o=wo(e,R(e,r+s.length),i);if(!o)return null;let a=bo(e,o,s==="??"?2:l,i);if(!a)return null;let p;if(s==="||"||s==="&&"||s==="??"){let c=au(e,R(e,a.end),i);if(s==="??"?c==="||"||c==="&&":c==="??")return null;p={type:"LogicalExpression",start:t.start,end:a.end,left:t,operator:s,right:a}}else p={type:"BinaryExpression",start:t.start,end:a.end,left:t,operator:s,right:a};return bo(e,p,n,i)}function ur(e,t,n){let i=wo(e,t,n);if(!i)return null;let r=bo(e,i,-1,n);if(!r||Cu(e.charCodeAt(r.end)))return r;let s=R(e,r.end);if(e.charCodeAt(s)!==63)return r;let l=e.charCodeAt(s+1);if(l===46||l===63)return null;let o=ur(e,R(e,s+1),n);if(!o)return null;let a=R(e,o.end);if(e.charCodeAt(a)!==58)return null;let p=ur(e,R(e,a+1),n);if(!p)return null;return{type:"ConditionalExpression",start:r.start,end:p.end,test:r,consequent:o,alternate:p}}function Cu(e){return e===125||e===41||e===44||e===58}function ox(e,t){let n=e.charCodeAt(R(e,t));return n===125||n===41}function ax(e,t,n){let i=ur(e,t,n);return i&&ox(e,i.end)?i:null}function be(e){switch(e.loc={start:ot(e.start),end:ot(e.end)},e.type){case"MemberExpression":be(e.object),be(e.property);break;case"CallExpression":be(e.callee);for(let t of e.arguments)be(t);break;case"UnaryExpression":be(e.argument);break;case"BinaryExpression":case"LogicalExpression":be(e.left),be(e.right);break;case"ConditionalExpression":be(e.test),be(e.consequent),be(e.alternate);break}}function te(e){let t=!e.loc||e.lfOnly?ax(e.source,e.index,e.isTypeScript):null;if(t){if(e.index=t.end,e.loc)be(t);return t}let{node:n,end:i}=qt(e,e.source,e.index);return e.index=i,n}var lx=new Set(["server","client","worker","test","default"]);function px(e,t,n){let{source:i,index:r}=e;if(r>=i.length)de(i.length);let s=Fi(i,r);if(s===-1)ro(i.length,"script");e.index=Vi(i,s);let l=e.script?nr(e,i.slice(0,s),r):{type:"Program",start:r,end:s,body:[],sourceType:"module"};if(l.start=r,l.loc)Object.assign(l.loc.start,ot(t)),Object.assign(l.loc.end,ot(e.index));else if(e.loc)l.loc={start:ot(t),end:ot(e.index)};let o="default";for(let a of n){if(lx.has(a.name))dc(a,a.name);if(a.name==="module"){if(a.value!==!0)cc(a,a.name);o="module"}if(a.name==="context"){let p=a.value;if(!Array.isArray(p)||p.length!==1||p[0].type!=="Text"||p[0].data!=="module")uc(a);o="module"}}return{type:"Script",start:t,end:e.index,context:o,content:l,attributes:n}}var cx=/(even|odd|\+?(\d+|\d*n(\s*[+-]\s*\d+)?)|-\d*n(\s*\+\s*\d+))((?=\s*[,)])|\s+of(\s+|(?=[.#[*:&])))/y,ux=/\d+(\.\d+)?%/y,dx=/\\[0-9a-fA-F]{1,6}(\r\n|\s)?/y,fx=/\s*>/y,it=-1,Au=34,hx=35,mx=36,yx=38,Pu=39,gx=40,xx=41,hr=42,Sx=43,Ex=45,Tx=46,wu=47,Co=58,vx=59,bx=60,lu=61,Cx=62,Ax=91,ko=92,Px=93,wx=94,ku=123,Ao=124,kx=125,_u=126,dr=[];function _x(e,t,n){let i=e.index;dr=[];let r=e.css?Dx(e):Nx(e),s=e.index;return e.eat("</style",!0),e.read(fx),{type:"StyleSheet",start:t,end:e.index,attributes:n,children:r,comments:dr,content:{start:i,end:s,styles:e.source.slice(i,s),comment:null}}}function Nx(e){return e.index=ji(e.source,e.index),[]}function Dx(e){let t=[];for(;;){if(Jt(e,!0),e.match("</style")||e.index>=e.source.length)break;t.push(e.match("@")?Nu(e):Du(e))}return t}function Nu(e){let t=e.index;e.eat("@",!0);let n=bt(e),i=_o(e,!0),r=null;if(e.match("{"))r=Lu(e);else e.eat(";",!0);return{type:"Atrule",start:t,end:e.index,name:n,prelude:i,block:r}}function Du(e){let t=e.index;return{type:"Rule",prelude:$u(e,!1),block:Lu(e),start:t,end:e.index}}function $u(e,t){let n=[];Jt(e,!0);let i=e.index;while(e.index<e.source.length){n.push($x(e,t));let r=e.index;if(Jt(e,!0),e.match(t?")":"{"))return{type:"SelectorList",start:i,end:r,children:n};e.eat(",",!0),Jt(e,!0)}return de(e.source.length)}function pu(e,t){return{type:"RelativeSelector",combinator:e,selectors:[],start:t,end:-1}}function $x(e,t){let{source:n,index:i}=e,r=[],s=pu(null,e.index);while(e.index<n.length){let l=e.index,o=n.charCodeAt(l),a=s.selectors;if(o===yx)e.index++,a.push({type:"NestingSelector",name:"&",start:l,end:e.index});else if(o===hr)e.index++,a.push(cu(e,l,"*"));else if(o===hx)e.index++,a.push({type:"IdSelector",name:bt(e),start:l,end:e.index});else if(o===Tx)e.index++,a.push({type:"ClassSelector",name:bt(e),start:l,end:e.index});else if(o===Co){let f=n.charCodeAt(l+1)===Co;e.index+=f?2:1;let h=bt(e),m=null;if(e.eat("("))m=$u(e,!0),e.eat(")",!0);if(f)a.push({type:"PseudoElementSelector",name:h,start:l,end:e.index,...m&&{args:m}});else a.push({type:"PseudoClassSelector",name:h,args:m,start:l,end:e.index})}else if(o===Ax)e.index++,a.push(Ix(e,l));else{let f=t?e.read(cx):null,h=!f&&Ne(o)?e.read(ux):null;if(f)a.push({type:"Nth",value:f,start:l,end:e.index});else if(h)a.push({type:"Percentage",value:h,start:l,end:e.index});else if(Iu(n,l)===0){let m=bt(e);a.push(cu(e,l,m))}}let p=e.index;Jt(e,!1);let c=e.match(",")||e.match(t?")":"{");if(e.index=p,c)return s.end=p,r.push(s),{type:"ComplexSelector",start:i,end:p,children:r};let u=Lx(e);if(u){if(s.selectors.length>0)s.end=p,r.push(s);if(s=pu(u,u.start),e.allowWhitespace(),e.match(",")||e.match(t?")":"{"))Qp(e.index)}}return de(n.length)}function cu(e,t,n){let i=n,r;if(e.eat("|"))r=i,i=e.eat("*")?"*":bt(e);return{type:"TypeSelector",name:i,...r!==void 0&&{namespace:r},start:t,end:e.index}}function Ix(e,t){let n=e.source;e.allowWhitespace();let i=bt(e);e.allowWhitespace();let r=null,s=null,l=n.charCodeAt(e.index);if(l===lu)s="=";else if((l===_u||l===wx||l===mx||l===hr||l===Ao)&&n.charCodeAt(e.index+1)===lu)s=n.slice(e.index,e.index+2);if(s)e.index+=s.length,e.allowWhitespace(),r=Bx(e);e.allowWhitespace();let o=e.index;while(Mu(n.charCodeAt(e.index)))e.index++;let a=e.index>o?n.slice(o,e.index):null;return e.allowWhitespace(),e.eat("]",!0),{type:"AttributeSelector",start:t,end:e.index,name:i,matcher:s,value:r,flags:a}}function Iu(e,t){let n=e.charCodeAt(t);if(n===Sx||n===_u||n===Cx)return 1;if(n===Ao&&e.charCodeAt(t+1)===Ao)return 2;return 0}function Lx(e){let t=e.index;e.allowWhitespace();let n=e.index,i=Iu(e.source,n);if(i>0){e.index+=i;let r=e.index;return e.allowWhitespace(),{type:"Combinator",name:e.source.slice(n,r),start:n,end:r}}if(e.index!==t)return{type:"Combinator",name:" ",start:t,end:e.index};return null}function Lu(e){let t=e.index;e.eat("{",!0);let n=[];while(e.index<e.source.length){if(Jt(e,!0),e.match("}"))break;n.push(Rx(e))}return e.eat("}",!0),{type:"Block",start:t,end:e.index,children:n}}function Rx(e){if(e.match("@"))return Nu(e);let t=e.index;_o(e,!1);let n=e.source.charCodeAt(e.index);return e.index=t,n===ku?Du(e):Mx(e)}function Mx(e){let{source:t,index:n}=e;if(n>=t.length)de(t.length);let i=n;while(i<t.length){let a=t.charCodeAt(i);if(a===Co||H(a))break;i++}let r=t.slice(n,i);e.index=i,e.allowWhitespace(),e.eat(":");let s=e.index;e.allowWhitespace();let l=_o(e,!0);if(!l&&!r.startsWith("--"))Yp({start:n,end:s});let o=e.index;if(!e.match("}"))e.eat(";",!0);return{type:"Declaration",start:n,end:o,property:r,value:l}}function _o(e,t){let n=e.source,i=n.length,r="",s=e.index,l=null,o=!1,a=!1,p=it,c=e.index;while(c<i){let u=n.charCodeAt(c);if(o){o=!1,c++;continue}if(u===ko){o=!0,c++;continue}if(u===p)p=it;else if(u===xx)a=!1;else if(p===it&&(u===Au||u===Pu))p=u;else if(u===gx){if(Ox(n,r,s,c))a=!0}else if((u===vx||u===ku||u===kx)&&!a&&p===it){if(e.index=c,!t)return"";if(r+=n.slice(s,c),l){let f=r.length-r.trimStart().length;for(let h of l)h.position=Math.max(0,(h.position??0)-f)}return r.trim()}else if(u===wu&&!a&&p===it&&n.charCodeAt(c+1)===hr){r+=n.slice(s,c),e.index=c;let f=Ru(e);if(t)f.position=r.length,dr.push(f),l??=[],l.push(f);c=e.index,s=c;continue}c++}return e.index=i,de(i)}function Ox(e,t,n,i){if(i-n>=3)return e.charCodeAt(i-3)===117&&e.charCodeAt(i-2)===114&&e.charCodeAt(i-1)===108;return(t+e.slice(n,i)).endsWith("url")}function Bx(e){let t=e.source,n=it;if(e.eat('"'))n=Au;else if(e.eat("'"))n=Pu;let i=e.index,r=!1,s=i;while(s<t.length){let l=t.charCodeAt(s);if(r)r=!1;else if(l===ko)r=!0;else if(n===it?l===Px||H(l):l===n)return e.index=n===it?s:s+1,t.slice(i,s).trim();s++}return e.index=s,de(t.length)}function bt(e){let{source:t,index:n}=e,i=t.charCodeAt(n);if(Ne(i)||i===Ex&&Ne(t.charCodeAt(n+1)))no(n);let r="",s=n,l=n;while(l<t.length){let o=t.charCodeAt(l);if(o===ko){r+=t.slice(s,l),e.index=l;let a=e.matchRegex(dx);if(a){let p=String.fromCodePoint(Number.parseInt(a.slice(1),16));r+=p==="\\"?"\\\\":p,l+=a.length}else r+=`\\${t[l+1]}`,l+=2;s=l}else if(o>=160||Fx(o))l++;else break}if(r+=t.slice(s,l),e.index=l,r==="")no(n);return r}function Jt(e,t){let n=e.source;e.allowWhitespace();for(;;){let i=n.charCodeAt(e.index);if(i===wu&&n.charCodeAt(e.index+1)===hr){let r=Ru(e);if(t)dr.push(r)}else if(i===bx&&e.eat("<!--"))e.readUntil("-->"),e.eat("-->",!0);else break;e.allowWhitespace()}}function Ru(e){let t=e.index;e.eat("/*",!0);let n=e.readUntil("*/");return e.eat("*/",!0),{type:"CSSComment",value:n,start:t,end:e.index}}function Mu(e){return e>=65&&e<=90||e>=97&&e<=122}function Fx(e){return Mu(e)||Ne(e)||e===95||e===45}var xo=/<\/textarea(\s[^>]*)?>/iy,Vx=/^![a-zA-Z]+$/,jx=/^[a-zA-Z][a-zA-Z0-9]*:[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$/,Gx=/^[a-zA-Z][a-zA-Z0-9]*(-[a-zA-Z0-9.\-_\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}]*)?$/u,So="\\u200C\\u200D",Wx=new RegExp(`^(?:\\p{Lu}[$${So}\\p{ID_Continue}.]*|\\p{ID_Start}[$${So}\\p{ID_Continue}]*(?:\\.[$${So}\\p{ID_Continue}]+)+)$`,"u"),Hx=new Map([["use","UseDirective"],["animate","AnimateDirective"],["bind","BindDirective"],["class","ClassDirective"],["style","StyleDirective"],["on","OnDirective"],["let","LetDirective"],["in","TransitionDirective"],["out","TransitionDirective"],["transition","TransitionDirective"]]),No=new Map([["svelte:head",["SvelteHead",!0]],["svelte:options",["SvelteOptions",!0]],["svelte:window",["SvelteWindow",!0]],["svelte:document",["SvelteDocument",!0]],["svelte:body",["SvelteBody",!0]],["svelte:element",["SvelteElement",!1]],["svelte:component",["SvelteComponent",!1]],["svelte:self",["SvelteSelf",!1]],["svelte:fragment",["SvelteFragment",!1]],["svelte:boundary",["SvelteBoundary",!1]]]),uu=[...No.keys()],Ux=`${uu.slice(0,-1).join(", ")} or ${uu.at(-1)}`,qx=62,du=123;function mr(e,t){let n=e.index;if(n>=e.source.length)de(e.source.length);let i=St(e.source,n,t);return e.index=i,{name:e.source.slice(n,i),start:n,end:i,loc:e.sourceLocation(n,i)}}var qn=(e,t,n,i=n)=>({start:e,end:t,type:"Text",raw:n,data:i});function zx(e){let t=e.charCodeAt(0);if(t>=97&&t<=122&&!e.includes("."))return!1;return Wx.test(e)}function Kx(e){let t=!0;for(let n=0;n<e.length&&t;n++){let i=e.charCodeAt(n);t=i>=97&&i<=122||n>0&&i>=48&&i<=57}return t&&e.length>0||Vx.test(e)||jx.test(e)||Gx.test(e)}function fu(e,t){for(let n=e.length-1;n>=0;n--){let i=t(e[n]);if(i!==void 0)return i}return!1}function Jx(e,t,n){let i=No.get(t);if(i)return i[0];if(n)return"Component";if(t==="title"){if(fu(e.stack,({type:r})=>{if(r==="SvelteHead")return!0;return r==="RegularElement"||r==="Component"?!1:void 0}))return"TitleElement"}if(t==="slot"){if(!fu(e.stack,(r)=>r.type==="RegularElement"&&r.attributes.some((s)=>s.type==="Attribute"&&s.name==="shadowrootmode")?!0:void 0))return"SlotElement"}return"RegularElement"}function Xx(e){let t=e.index++;if(e.eat("!--")){let n=e.readUntil("-->");e.eat("-->",!0),e.append({type:"Comment",start:t,end:e.index,data:n})}else if(e.eat("/"))Yx(e,t);else Zx(e,t)}function Yx(e,t){let{name:n}=mr(e,!1);if(e.allowWhitespace(),e.eat(">",!0),Fn(n))Dc(t);let i=e.current();while(!("name"in i)||i.name!==n){if(i.type==="RegularElement"){if(e.lastAutoClosedTag?.tag!==n)Ou(e,i,t,`</${n}>`)}else{let r=e.lastAutoClosedTag;if(r?.tag===n)ic(t,n,r.reason);nc(t,n)}i.end=t,e.close(),i=e.current()}if(i.end=e.index,e.close(),e.stack.length<(e.lastAutoClosedTag?.depth??0))e.lastAutoClosedTag=void 0}function Ou(e,t,n,i){go(e.root,{code:"element_implicitly_closed",start:t.start,end:t.fragment.nodes[0]?.start??n,by:i,closing:`</${t.name}>`})}function Qx(e,t,n){return{type:e,start:t,end:-1,name:n}}function Zx(e,t){let n=mr(e,!1),{name:i}=n,r=No.get(i);if(!r&&i.startsWith("svelte:"))Sc(n,Ux);let s=zx(i);if(!s&&!Kx(i))wc(n);if(r?.[1]){if(e.metaTags.has(i))yc(t,i);if(e.current().type!=="Root")xc(t,i);e.metaTags.add(i)}let l=Qx(Jx(e,i,s),t,i);if(e.loc)l.name_loc=n.loc;l.attributes=[],l.fragment={type:"Fragment",nodes:[]},e.allowWhitespace();let o=e.current();if(o.type==="RegularElement"&&qi(o.name,i))Ou(e,o,t,`<${i}>`),o.end=t,e.close(),e.lastAutoClosedTag={tag:o.name,reason:i,depth:e.stack.length};if((i==="script"||i==="style")&&e.current().type==="Root"){let a=[];l.attributes=a,yu(e,a,sS),tS(e,l,t,a);return}if(yu(e,l.attributes,aS),l.type==="SvelteComponent"){let a=hu(l);if(!a)mc(t);if(!Eo(a.value))hc(a.start);l.expression=mu(a.value)}else if(l.type==="SvelteElement"){let a=hu(l);if(!a)ao(t);if(a.value===!0)ao(a);if(!Eo(a.value))go(e.root,{code:"svelte_element_invalid_this",start:a.start,end:a.end});l.tag=Eo(a.value)?mu(a.value):rS(a.value[0])}if(!e.eat("/")&&!Fn(i))if(e.eat(">",!0),i==="textarea")l.fragment.nodes=Fu(e,(a,p)=>(xo.lastIndex=p,xo.test(a)),"inside <textarea>"),e.read(xo);else if(i==="script"||i==="style")l.fragment.nodes.push(eS(e,`</${i}>`));else{e.open(l,l.fragment);return}else e.eat(">",!0);l.end=e.index,e.append(l)}function eS(e,t){let n=e.index,i=e.source.indexOf(t,n);e.index=i===-1?e.source.length:i;let r=qn(n,e.index,e.source.slice(n,e.index));return e.eat(t,!0),r}function tS(e,t,n,i){e.eat(">",!0);let r=nS(e.root.fragment.nodes,n);if(t.name==="style"){let o=_x(e,n,i);if(o.content.comment=r,e.root.css)fc(n);e.root.css=o;return}let s=px(e,n,i);if(r&&e.comments)s.content.leadingComments=[{type:"Line",value:r.data}];let l=s.context==="module"?"module":"instance";if(e.root[l])pc(n);e.root[l]=s}function nS(e,t){let n=e.length-1;if(n<0||e[n].end!==t)return null;for(let i=n;i>=0;i--){let r=e[i];if(r.type==="Comment")return r;if(r.type!=="Text"||r.data.trim())return null}return null}var iS=(e)=>e.type==="Attribute"&&e.name==="this";function hu(e){let t=e.attributes.find(iS);if(t)e.attributes.splice(e.attributes.indexOf(t),1);return t}function Eo(e){if(e===!0)return!1;if(!Array.isArray(e))return!0;return e.length===1&&e[0].type==="ExpressionTag"}function mu(e){return(Array.isArray(e)?e[0]:e).expression}function rS(e){if(e.type!=="Text")return e.expression;return{type:"Literal",value:e.data,raw:`'${e.raw}'`,start:e.start,end:e.end}}function yu(e,t,n){let i=new Set;for(;;){let r=n(e);if(!r)return;let{type:s}=r;if(s==="Attribute"||s==="BindDirective"||s==="StyleDirective"||s==="ClassDirective"){let l=`${s==="BindDirective"?"Attribute":s}${r.name}`;if(i.has(l))Wp(r);if(r.name!=="this")i.add(l)}t.push(r),e.allowWhitespace()}}function Do(e,t,n,i,r){return e.loc?{type:"Attribute",start:n,end:i,name:t.name,name_loc:t.loc,value:r}:{type:"Attribute",start:n,end:i,name:t.name,value:r}}function Bu(e){if(ve(e.source.charCodeAt(e.index)))nt(e.index,"=")}function sS(e){let t=e.index,n=mr(e,!0);if(!n.name)return null;let i=!0;if(e.eat("=")){e.allowWhitespace();let{source:r}=e,s=e.index,l=ve(r.charCodeAt(s)),o=-1;if(l){let c=r.indexOf(r[s],s+1);if(c!==-1)o=c+1}if(o===-1){o=s;while(o<r.length&&r.charCodeAt(o)!==qx&&!H(r.charCodeAt(o)))o++;if(o===s)so(s)}e.index=o;let a=l?1:0,p=r.slice(s+a,o-a);i=[qn(o-p.length-a,o-a,p,pr(p,!0,e.entityNames))]}return Bu(e),Do(e,n,t,e.index,i)}function oS(e){let t=e.index,n=e.match("/*");if(!n&&!e.match("//"))return!1;e.index+=2;let i=e.readUntil(n?"*/":`
|
|
54
|
-
`);if(n)e.eat("*/");let r={type:n?"Block":"Line",start:t,end:e.index,value:i},s=e.sourceLocation(t,e.index);if(s)r.loc=s;if(e.comments)e.root.comments.push(r);return!0}function aS(e){while(oS(e))e.allowWhitespace();let t=e.index;if(e.eat("{"))return lS(e,t);let n=mr(e,!0);if(!n.name)return null;let i=e.index;e.allowWhitespace();let r=!0;if(e.eat("=")){if(e.allowWhitespace(),e.match("/>"))r=[qn(e.index,e.index+1,"/")],e.index++;else r=uS(e);i=e.index}else Bu(e);let s=n.name.indexOf(":"),l=s>0?Hx.get(n.name.slice(0,s)):void 0;return l?cS(e,l,n,s,t,i,r):Do(e,n,t,i,r)}function lS(e,t){if(e.allowWhitespace(),e.eat("@attach")){e.requireWhitespace();let r=te(e);return e.eatClosingBrace(),{type:"AttachTag",start:t,end:e.index,expression:r}}if(e.eat("...")){let r=te(e);return e.eatClosingBrace(),{type:"SpreadAttribute",start:t,end:e.index,expression:r}}let n=e.readIdentifierName();if(n.name==="")Hp(t);e.eatClosingBrace();let i={type:"ExpressionTag",start:n.start,end:n.end,expression:n};return Do(e,n,t,e.index,i)}function pS(e){if(e===!0)return;return Array.isArray(e)?e[0]:e}function cS(e,t,n,i,r,s,l){let[o,...a]=n.name.slice(i+1).split("|");if(o==="")tc({start:r,end:r+i+1},n.name);let p={start:r,end:s,type:t,name:o};if(e.loc)p.name_loc=n.loc;if(t==="StyleDirective")return p.modifiers=a,p.value=l,p;let c=pS(l);if(c&&(Array.isArray(l)&&l.length>1||c.type==="Text"))ec(c.start);if(p.expression=c?.expression??null,p.modifiers=a,t==="TransitionDirective"){let u=n.name.slice(0,i);p.intro=u!=="out",p.outro=u!=="in"}if((t==="BindDirective"||t==="ClassDirective")&&!p.expression)p.expression={start:r+i+1,end:s,type:"Identifier",name:o};return p}function uS(e){let t=e.source.charCodeAt(e.index),n=ve(t);if(n){if(e.index++,e.source.charCodeAt(e.index)===t)return e.index++,[qn(e.index-1,e.index-1,"")]}let i;try{i=Fu(e,n?(r,s)=>r.charCodeAt(s)===t:Gi,"in attribute value",n?t:void 0)}catch(r){let s=r instanceof S&&r.code==="js_parse_error"?r.position?.[0]:void 0;if(s!==void 0&&e.source.startsWith("/>",s-1))e.index=s,nt(s,n?String.fromCharCode(t):"}");throw r}if(n)e.index++;else if(i.length===0)so(e.index);return n||i.length>1||i[0].type==="Text"?i:i[0]}function Fu(e,t,n,i){let{source:r}=e,s=[],l=e.index,o=(a)=>{if(a<=l)return;let p=r.slice(l,a);s.push(qn(l,a,p,pr(p,!0,e.entityNames)))};while(e.index<r.length){let a=e.index;if(t(r,a))return o(a),s;if(r.charCodeAt(a)!==du){if(e.index++,i!==void 0)while(e.index<r.length&&r.charCodeAt(e.index)!==du&&r.charCodeAt(e.index)!==i)e.index++;continue}e.index++;let p=r.charCodeAt(e.index);if(p===35||p===64){e.index++;let u=e.index;while(e.index<r.length&&r.charCodeAt(e.index)>=97&&r.charCodeAt(e.index)<=122)e.index++;let f=r.slice(u,e.index);(p===35?zp:kc)(a,f,n)}o(a),e.allowWhitespace();let c=te(e);e.eatClosingBrace(),s.push({type:"ExpressionTag",start:a,end:e.index,expression:c}),l=e.index}de(r.length)}var dS=new Map([["html","html"],["svg","svg"],["mathml","mathml"],["http://www.w3.org/2000/svg","svg"],["http://www.w3.org/1998/Math/MathML","mathml"]]),fS=new Map([["type",(e,t)=>{if(t!=="String"&&t!=="Number"&&t!=="Boolean"&&t!=="Array"&&t!=="Object")return!1;return e.type=t,!0}],["reflect",(e,t)=>{if(typeof t!=="boolean")return!1;return e.reflect=t,!0}],["attribute",(e,t)=>{if(typeof t!=="string")return!1;return e.attribute=t,!0}]]),gu="[a-z0-9_.\\xB7\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u203F-\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u{10000}-\\u{EFFFF}-]",hS=new RegExp(`^[a-z]${gu}*-${gu}*$`,"u"),mS=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" ")),cr=(e)=>(t,n)=>{let i=fr(n);if(typeof i!=="boolean")Yi(n,"true or false");t[e]=i},yS=new Map([["runes",cr("runes")],["immutable",cr("immutable")],["preserveWhitespace",cr("preserveWhitespace")],["accessors",cr("accessors")],["namespace",(e,t)=>{let n=dS.get(fr(t));if(!n)Yi(t,'"html", "mathml" or "svg"');e.namespace=n}],["css",(e,t)=>{if(fr(t)!=="injected")Yi(t,'"injected"');e.css="injected"}],["tag",(e,t)=>Ec(t)],["customElement",(e,t)=>{let n=SS(t);if(n)e.customElement=n}]]);function gS(e){let t=[],n={start:e.start,end:e.end,attributes:t};for(let i of e.attributes){if(i.type!=="Attribute")Tc(i);t.push(i);let r=yS.get(i.name);if(!r)Pc(i,i.name);r(n,i)}return n}function fr({value:e}){if(e===!0)return!0;let t=Array.isArray(e)?e:[e];if(t.length===0)return!0;if(t.length>1)return null;let[n]=t;if(n.type==="Text")return n.data;return n.expression.type==="Literal"?n.expression.value:null}function xu(e,t){if(typeof t!=="string")lo(e);if(!t)return;if(!hS.test(t))lo(e);if(mS.has(t))Ac(e)}function Po(e){return e.type==="Property"&&!e.computed&&e.key.type==="Identifier"}function xS(e,t){let n=new Map;for(let i of e.properties){if(!Po(i))t();if(!n.has(i.key.name))n.set(i.key.name,i.value)}return n}function SS(e){let t=()=>vc(e);if(e.value===!0)t();let n=Array.isArray(e.value)?e.value[0]:e.value;if(n.type==="Text"){let c=fr(e);return xu(e,c),{tag:c}}let{expression:i}=n;if(i.type!=="ObjectExpression"){if(i.type==="Literal"&&i.value===null)return;t()}let r=xS(i,t),s={},l=r.get("tag");if(l){let c=l.type==="Literal"?l.value:void 0;xu(null,c),s.tag=c}let o=r.get("props");if(o){let c=()=>bc(e);if(o.type!=="ObjectExpression")c();s.props={};for(let u of o.properties){if(!Po(u)||u.value.type!=="ObjectExpression")c();let f={};s.props[u.key.name]=f;for(let h of u.value.properties){if(!Po(h)||h.value.type!=="Literal")c();if(!fS.get(h.key.name)?.(f,h.value.value))c()}}}let a=r.get("shadow");if(a)if(a.type==="ObjectExpression")s.shadow=a;else if(a.type==="Literal"&&(a.value==="open"||a.value==="none"))s.shadow=a.value;else Cc(e);let p=r.get("extend");if(p)s.extend=p;return s}var ES={"{":"}","(":")","[":"]"};function $o(e,t,n=ES){let i=Object.values(n),r=[],s=t;while(s<e.length){let l=e[s++];if(l==="'"||l==='"'||l==="`")s=TS(e,s,l);else if(l===">"&&e[s-2]==="="&&i.includes(">"));else if(Object.hasOwn(n,l))r.push(l);else if(i.includes(l)){let o=n[r.pop()??""];if(l!==o)nt(s-1,o);if(r.length===0)return s}}de(e.length)}function TS(e,t,n){let i=t;while(i<e.length){let r=e[i++];if(r===n)return i;if(r==="\\")i++;else if(n==="`"&&r==="$"&&e[i]==="{")i=$o(e,i)}Nc(t)}var vS=/\?(?=\s*:)/g;function yr(e){let t=e.index,n=e.readIdentifierName();if(n.name!=="")return{...n,typeAnnotation:Su(e)};let i=e.source[e.index];if(i!=="{"&&i!=="[")sc(e.index);e.index=$o(e.source,t);let r=Mc(e,e.source.slice(0,e.index),t)??bS(e,t);Mr(r,"ObjectPattern","ArrayPattern");let s=Su(e);if(r.typeAnnotation=s,s)r.end=s.end;return r}function bS(e,t){let{node:n}=qt(e,`${e.source.slice(0,e.index)} = 1`,t);return Mr(n,"AssignmentExpression"),n.left}function Su(e){let t=e.index;if(e.allowWhitespace(),!e.eat(":")){e.index=t;return}let n="_ as ",i=e.index-n.length,r=e.source.slice(0,i)+n+e.source.slice(e.index).replace(vS," "),s=qt(e,r,i).node;if(s.type==="AssignmentExpression"){let l=s.right.start;while(r[l]!=="=")l-=1;s=qt(e,r.slice(0,l),i).node}if(s.type==="SequenceExpression")s=s.expressions[0];return e.index=s.end,{type:"TSTypeAnnotation",start:t,end:e.index,typeAnnotation:s.type==="TSAsExpression"?s.typeAnnotation:void 0}}var CS={IfBlock:"if",EachBlock:"each",KeyBlock:"key",AwaitBlock:"await",SnippetBlock:"snippet"},We=()=>({type:"Fragment",nodes:[]});function AS(e,t){if(e.eat("if")){e.requireWhitespace();let n=te(e);e.eatClosingBrace();let i=We();e.open({type:"IfBlock",elseif:!1,start:t,end:-1,test:n,consequent:i,alternate:null},i)}else if(e.eat("each"))wS(e,t);else if(e.eat("await")){e.requireWhitespace();let n=te(e);e.allowWhitespace();let i={type:"AwaitBlock",start:t,end:-1,expression:n,value:null,error:null,pending:null,then:null,catch:null},r=We();if(e.eat("then"))i.value=Eu(e),i.then=r;else if(e.eat("catch"))i.error=Eu(e),i.catch=r;else i.pending=r;e.eat("}",!0),e.open(i,r)}else if(e.eat("key")){e.requireWhitespace();let n=te(e);e.eatClosingBrace();let i=We();e.open({type:"KeyBlock",start:t,end:-1,expression:n,fragment:i},i)}else if(e.eat("snippet"))kS(e,t);else rc(e.index)}function Eu(e){if(e.matchRegex(vu))return e.allowWhitespace(),null;e.requireWhitespace();let t=yr(e);return e.allowWhitespace(),t}function PS(e){let t={assertion:null},n=e.end,i=(s)=>{if(s.type==="TSAsExpression"&&s.end===e.end)return t.assertion=s,n=s.expression.end,s.expression;return Qt(s,i),s},r=e;if(e.type==="TSAsExpression")t.assertion=e,r=e.expression,n=r.end;else Qt(e,i);return r.end=n,{expression:r,assertion:t.assertion}}function wS(e,t){e.requireWhitespace();let n=e.source,i;while(!i)try{i=te(e)}catch(a){let p=((a instanceof S?a.position:void 0)?.[0]??t)-2;while(p>t&&e.source.slice(p,p+2)!=="as")p-=1;if(p<=t)throw e.source=n,a;e.source=n.slice(0,p)}if(e.source=n,e.allowWhitespace(),!e.match("as")){if(i.type==="SequenceExpression")i=i.expressions[0];let a=PS(i);if(i=a.expression,a.assertion){let p=a.assertion.typeAnnotation.start-2;while(e.source.slice(p,p+2)!=="as")p-=1;e.index=p}}let r=null,s,l;if(e.eat("as"))e.requireWhitespace(),r=yr(e);else e.index=i.end;if(e.allowWhitespace(),e.eat(",")){if(e.allowWhitespace(),s=e.readIdentifierName().name,!s)oo(e.index);e.allowWhitespace()}if(e.eat("("))e.allowWhitespace(),l=te(e),e.allowWhitespace(),e.eat(")",!0),e.allowWhitespace();e.eat("}",!0);let o=We();e.open({type:"EachBlock",start:t,end:-1,expression:i,body:o,context:r,index:s,key:l},o)}function kS(e,t){e.requireWhitespace();let n=e.readIdentifierName();if(n.name==="")oo(e.index);e.allowWhitespace();let i=e.index,r;if(e.isTypeScript&&e.match("<")){let a=$o(e.source,i,{"<":">"});r=e.source.slice(i+1,a-1),e.index=a}e.allowWhitespace(),e.eat("(",!0);let s=1;while(e.index<e.source.length&&(!e.match(")")||s!==1)){if(e.match("("))s++;if(e.match(")"))s--;e.index+=1}e.eat(")",!0);let{node:l}=qt(e,`${e.source.slice(0,e.index)} => {}`,i,!0);e.eatClosingBrace();let o=We();e.open({type:"SnippetBlock",start:t,end:-1,expression:n,typeParams:r,parameters:l.type==="ArrowFunctionExpression"?l.params:void 0,body:o},o)}function _S(e,t){let n=e.index-1,i=e.current();if(i.type==="IfBlock"){if(!e.eat("else"))nt(n,"{:else} or {:else if}");if(e.eat("if"))qp(n);if(i.alternate)Xi(n,"{:else}");if(e.allowWhitespace(),i.alternate=We(),e.setFragment(i.alternate),e.eat("if")){e.requireWhitespace();let r=te(e);e.eatClosingBrace();let s=We();e.open({start:t,end:-1,type:"IfBlock",elseif:!0,test:r,consequent:s,alternate:null},s)}else e.eatClosingBrace()}else if(i.type==="EachBlock"){if(!e.eat("else"))nt(n,"{:else}");if(i.fallback)Xi(n,"{:else}");e.eatClosingBrace(),i.fallback=We(),e.setFragment(i.fallback)}else if(i.type==="AwaitBlock"){let r;if(e.eat("then"))r="then";else if(e.eat("catch"))r="catch";else nt(n,"{:then ...} or {:catch ...}");if(i[r])Xi(n,`{:${r}}`);if(!e.eat("}")){e.requireWhitespace();let l=yr(e);if(r==="then")i.value=l;else i.error=l;e.eatClosingBrace()}let s=We();i[r]=s,e.setFragment(s)}else Up(n)}function NS(e){let t=e.current(),n=CS[t.type];if(!n)Jp(e.index-1);e.eat(n,!0),e.eatClosingBrace();while(t.type==="IfBlock"&&t.elseif)t.end=e.index,e.close(),t=e.current();t.end=e.index,e.close()}function DS(e){return e.type==="CallExpression"||e.type==="ChainExpression"&&e.expression.type==="CallExpression"}function $S(e,t){if(e.eat("html")){e.requireWhitespace();let n=te(e);e.eatClosingBrace(),e.append({type:"HtmlTag",start:t,end:e.index,expression:n})}else if(e.eat("debug")){let n=[];if(!e.read(vu)){let i=te(e),r=i.type==="SequenceExpression"?i.expressions:[i];for(let s of r){if(s.type!=="Identifier")Zp(s.start);n.push(s)}e.eatClosingBrace()}e.append({type:"DebugTag",start:t,end:e.index,identifiers:n})}else if(e.eat("const")){e.requireWhitespace();let n=yr(e);e.allowWhitespace(),e.eat("=",!0),e.allowWhitespace();let i=e.index,r=te(e),s=e.index;if(r.type==="SequenceExpression"&&!e.source.slice(i,r.start).includes("("))Xp(r);e.eatClosingBrace();let l={type:"VariableDeclarator",id:n,init:r,start:n.start,end:s};e.append({type:"ConstTag",start:t,end:e.index,declaration:{type:"VariableDeclaration",kind:"const",declarations:[l],start:t+2,end:e.index-1}})}else if(e.eat("render")){e.requireWhitespace();let n=te(e);if(!DS(n))lc(n);e.eatClosingBrace(),e.append({type:"RenderTag",start:t,end:e.index,expression:n})}else oc(e.index)}var IS=/(?:var|interface|enum)\b/y,LS=/(?:let|const|type)\b/y;function RS(e){let t=e.index;if(e.index+=1,e.allowWhitespace(),e.eat("#"))AS(e,t);else if(e.eat(":"))_S(e,t);else if(e.eat("@"))$S(e,t);else if(e.match("/")&&!e.match("/*")&&!e.match("//"))e.index+=1,NS(e);else if(!MS(e,t)){let n=te(e);e.eatClosingBrace(),e.append({type:"ExpressionTag",start:t,end:e.index,expression:n})}}function MS(e,t){let n=e.index,i=e.matchRegex(IS);if(i)io({start:n,end:n+i.length});if(!e.matchRegex(LS))return!1;let r=e.root.comments.length,s=Oc(e,e.source,n);if(s.type==="ExpressionStatement")return e.root.comments.length=r,!1;if(s.type!=="VariableDeclaration"||s.kind!=="let"&&s.kind!=="const")io(s);return e.index=s.end,e.eatClosingBrace(),e.append({type:"DeclarationTag",start:t,end:e.index,declaration:s}),!0}function OS(e){let{source:t,index:n}=e;if(e.nextAngle<n)e.nextAngle=Tu(t,"<",n);if(e.nextBrace<n)e.nextBrace=Tu(t,"{",n);let i=Math.min(e.nextAngle,e.nextBrace);e.index=i;let r=t.slice(n,i);e.append({type:"Text",start:n,end:i,raw:r,data:pr(r,!1,e.entityNames)})}function Tu(e,t,n){let i=e.indexOf(t,n);return i===-1?e.length:i}function Vu(e,t,n){let i=BS(e,t,n);while(i.index<i.source.length)VS(i);return FS(i)}function BS(e,t,n){let i=Oi(e);return _t(i),new bu(i.trimEnd(),i.length,n,t)}function FS(e){if(e.stack.length>1){let r=e.current();if(r.end=r.start+1,r.type==="RegularElement")ro(r,r.name);Kp(r)}let{nodes:t}=e.root.fragment,n=t.findIndex((r)=>r.type==="SvelteOptions"),i=t[n];if(i?.type==="SvelteOptions"){t.splice(n,1),e.root.options=gS(i);let{nodes:r}=i.fragment;if(r.length>0)gc({start:r[0].start,end:r[r.length-1].end},i.name)}return e.root}function VS(e){if(e.match("<"))Xx(e);else if(e.match("{"))RS(e);else OS(e)}function ju(e,t,n){_t(e);let i={isTypeScript:t.typescript??!1,typescript:n,loc:!1,comments:!1,root:{comments:[]}};return Bc(i,e,(r)=>bp(e,t.localExports??!0,r))}function Gu(e={}){let t=jS(e),{typescript:n}=t;return{parse:(i,r)=>Vu(i,r,t),parseModule:(i,r={})=>rr(i,r,n),parseImportsExports:(i,r={})=>ju(i,r,n)}}function jS(e){return{typescript:Bp(e.typescript),entityNames:Fp(e.entities)??ru}}var Wu=Op(ir);var Hu;function Uu(e){return Hu??=Gu({typescript:Wu}).parse,Hu(e,{css:!1})}function GS(e,t){let n=e.length+1,i=t.length+1,r=Array.from({length:n},()=>Array(i).fill(0));for(let s=0;s<n;s++)r[s][0]=s;for(let s=0;s<i;s++)r[0][s]=s;for(let s=1;s<n;s++)for(let l=1;l<i;l++){let o=e[s-1]===t[l-1]?0:1;if(r[s][l]=Math.min(r[s-1][l]+1,r[s][l-1]+1,r[s-1][l-1]+o),s>1&&l>1&&e[s-1]===t[l-2]&&e[s-2]===t[l-1])r[s][l]=Math.min(r[s][l],r[s-2][l-2]+1)}return r[n-1][i-1]}function qu(e,t,n=3){let i,r=Number.POSITIVE_INFINITY;for(let s of t){let l=GS(e,s);if(l<r)i=s,r=l}return r<=n?i:void 0}var WS=/\s*=\s*/,HS=/^[^"'`\s]\S*$/;function US(e){let t=e.indexOf("<");if(t===-1||!e.endsWith(">"))return e;let n=e.slice(0,t),i=e.slice(t+1,-1),r=F(i,",").map((s)=>s.trim().replace(WS," = ")).join(", ");return`${n}<${r}>`}var qS=new Set(["restProps","slot","snippet","event","typedef","callback"]),Io=new Set(["property","type"]),zu=new Set(["slot","snippet","typedef","callback"]);function gr(e){if(e.length===0)return;return Lt(e[Yr(e)].content)}function Ku(e){return!e||!e.tag&&!e.continuesType&&e.content.trim()===""}function zS(e){return e.text.split(`
|
|
55
|
-
`).length===e.lines.length}function
|
|
52
|
+
}${l}`;return{...i,slot_props:o}}).sort((t,n)=>{let i=t.name??"",r=n.name??"";if(i<r)return-1;if(i>r)return 1;return 0})}function Mg(e,t,n){if(e.deferredSlotBlockGenerics.length>0){let i=[...t.map((r)=>r.type??""),...n.map((r)=>r.slot_props??"")].join(`
|
|
53
|
+
`);for(let{name:r,constraint:s}of e.deferredSlotBlockGenerics){if(!_a(i,r))continue;bi(e,r,s)}}if(e.scriptGenericsAttribute){if(e.generics)D(e,"syntax-skipped","generics",'Both the "generics" script attribute and @generics/@template JSDoc tags declare component generics; the script attribute takes precedence and the JSDoc declaration was ignored.',e.scriptGenericsAttribute.source);e.generics=wl(e.scriptGenericsAttribute.value)}}function Og(e){return Kt(e.events).map((t)=>t.type==="forwarded"?{...t,element:t.element.name}:t).sort(Yc)}function Bg(e,t){let n=new Map(e.pendingCallDefaultCandidates.filter((i)=>i.location==="props").map((i)=>[i.propName,i]));for(let i of t)if(i.typeSource==="unknown"){let r=n.get(i.name),s=r?r.importSource?`Prop "${i.name}" default calls "${r.calleeName}()" imported from "${r.importSource}"; falling back to "any" pending cross-file resolution.`:`Prop "${i.name}" default calls "${r.calleeName}()", but its return type could not be inferred; falling back to "any".`:`Prop "${i.name}" type could not be inferred; falling back to "any".`;D(e,"prop-unknown-type",i.name,s,i.source)}}function lr(e,t,n,i){if(t===void 0||Xc(t))return!0;let r=Fn(t)?"has a `//` comment, which would comment out the code after it in the .d.ts":"is not valid TypeScript";return D(e,"type-syntax-error",n,`Type \`${t}\` of "${n}" ${r}; falling back to "any".`,i),!1}function Fg(e,t,n,i,r){for(let s of t)if(s.typeSource==="jsdoc"&&!lr(e,s.type,s.name,s.source))s.type="any";for(let s of n)if(s.type==="dispatched"&&!lr(e,s.detail,s.name,s.source))s.detail="any";for(let s of i)if(!lr(e,s.slot_props,s.name??"default",s.source))s.slot_props="any";for(let s of r)if(!lr(e,s.type,s.name,s.source))s.type="any",s.ts=`type ${s.name} = any;`}function Vg(e,t){let{dispatcherName:n}=t,i=[];if(n===void 0)return i;let r=[];for(let l of t.callsWithArguments){let o=gl(l,n);if(o)r.push({call:l,...o})}if(r.length>0)Je(e,"dispatch-escapes",n,xe(e,n)?.sveldIgnore);let s=Xr(e,"dispatch-escapes",n);for(let{call:l,argumentIndex:o,property:a}of r){let p=t.locallyBoundCalls.has(l)?void 0:ps(e,l.callee);if(!p){i.push(l);continue}let c=P(e,l);e.pendingDispatchEscapeCandidates.push({importSource:p.source,importedName:p.importedName,...p.members?{members:p.members}:{},calleeText:ae(e,l.callee)??p.importedName,dispatcherName:n,argumentIndex:o,...a===void 0?{}:{property:a},...c?{source:c}:{},...s?{ignored:s}:{}})}return i}function jg(e,t,n){for(let i of e.jsDocEventNames){if(t.names.has(i)||t.mayDispatch(i))continue;if(e.forwardedEvents.has(i)||e.typedDispatcherEventNames.has(i))continue;if(e.props.has(`on${i}`))continue;if(n.length>0)continue;let r=Jr(e,"event-no-source",i,`@event "${i}" has no matching dispatch or callback prop.`,e.jsDocEventSources.get(i));if(e.pendingDispatchEscapeCandidates.length>0)e.deferredEventNoSourceDiagnostics.push(r);else e.diagnosticRecords.push(r)}}function Gg(e){if(e.slotsUntracked)return;let t=e.syntaxMode==="runes";for(let[n,{tag:i,source:r}]of e.jsDocSlots){let s=n??"children";if(e.renderedSlots.has(n)||t&&e.props.has(s))continue;let l=n===Ze?"default <slot>":`<slot name="${n}">`,o=t?`{@render ${s}()} or "${s}" prop`:l,a=n===Ze?`@${i} documents the default slot, but the component has no ${o}.`:`@${i} "${n}" has no matching ${o} in the component.`;D(e,"slot-not-rendered",n??"default",a,r)}}function Wg(e){let t=e.rest_props;if(t?.type!=="InlineComponent")return;let n=fn(e,t.name),i=e.extends?.import.replace(_g,"");if(n?.importedName==="default"&&n.source===i)return;D(e,"rest-props-unresolved","$$restProps",`$$restProps is only spread onto component "${t.name}"; sveld cannot infer its rest-prop type. Spread onto a plain element or add an @restProps tag.`,e.restPropsSource)}function Hg(e,t){let n=t.typedefs.filter((r)=>r.internal).map((r)=>{let s=r.name.split("<")[0];return{name:s,regex:new RegExp(`\\b${s}\\b`)}});if(n.length===0)return;let i=(r,s,l)=>{if(!s)return;for(let{name:o,regex:a}of n){if(!a.test(s))continue;D(e,"internal-typedef-referenced",r,`"${r}" references "${o}", which is @internal and excluded from output; the generated .d.ts will contain a dangling reference to it.`,l)}};for(let r of[...t.props,...t.moduleExports]){if(r.internal)continue;i(r.name,r.type,r.source)}for(let r of t.typedefs){if(r.internal)continue;i(r.name,r.ts)}for(let r of t.events){if(r.internal||r.type!=="dispatched")continue;i(r.name,r.detail,r.source)}for(let r of t.slots){if(r.internal)continue;i(r.name??"default",r.slot_props,r.source)}for(let r of t.contexts){if(r.internal)continue;if(r.type!==void 0)i(r.typeName,r.type,r.source);for(let s of r.properties)i(s.name,s.type)}}function Ug(e){let t=new Set;for(let n of F(e?.[1]??"",",")){let i=n.trim().match(Ng)?.[1];if(i)t.add(i)}return t}function qg(e,t){let n=Ug(e.generics),i=new Map;for(let r of t){let s=r.type?.trim();if(s&&n.has(s))i.set(r.localName??r.name,s)}return i}function zg(e,t,n){if(n.size===0)return;let i=e.rest_props,r=e.restPropsTagLocal===void 0?void 0:n.get(e.restPropsTagLocal);if(i?.type==="Element"&&i.name==="svelte:element"&&!i.thisValue&&r)e.rest_props={...i,thisType:r};for(let[s,l]of t.entries()){let o=e.bindings.get(l.name);if(l.typeSource!=="inferred"||!o?.elements.some(({tagLocal:a})=>a&&n.has(a)))continue;t[s]={...l,type:Qc(o,n)}}}var Kg=/^(?:(?:HTML|SVG|MathML)\w*)?Element$|^HTMLElementTagNameMap\[[\w$]+\]$/;function Jg(e,t,n){for(let i of t){if(i.typeSource!=="typescript"&&i.typeSource!=="jsdoc")continue;let r=e.bindings.get(i.name);if(r?.target!=="direct"||r.components.length>0||i.type===void 0)continue;let s=({tag:h,tagLocal:m})=>h==="svelte:element"&&!(m&&n.has(m));if(r.elements.some(s))continue;let l=(h)=>h==="null"||h==="undefined",o=F(i.type,"|").map((h)=>h.trim()).filter(Boolean),a=o.filter(l),p=o.filter((h)=>!l(h));if(!p.every((h)=>Kg.test(h)))continue;let c=[...new Set(Zc(r,n))];if(p.every((h)=>c.includes(h)))continue;let u=r.elements.map(({tag:h,tagLocal:m})=>h==="svelte:element"?`<svelte:element this={${m}}>`:`<${h}>`),f=(l(o[0]??"")?[...a,...c]:[...c,...a]).join(" | ");D(e,"bind-this-type-mismatch",i.name,`Prop "${i.name}" is declared as "${i.type}", but \`bind:this\` only binds it to ${Xg(u)}. Declare "${f}" instead.`,i.source)}}function Xg(e){return e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}function eu(e,t){let n=$g(e,t);Ml(e,n.names);let i=Lg(e);e.activeScopes.length=0;let r=Rg(e);Mg(e,i,r);let s=qg(e,i);zg(e,i,s);let l=Kt(e.moduleExports),o=Og(e),a=Kt(e.typedefs),p=Kt(e.contexts);Bg(e,i),Jg(e,i,s),Fg(e,i,o,r,a);let c=Vg(e,t);jg(e,n,c),Gg(e);let{dispatcherName:u}=t;for(let g of c){let y=ae(e,g.callee)??"";D(e,"dispatch-escapes",u??"",`\`${u}\` is passed to \`${y}\`, 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.`,P(e,g))}Wg(e),Hg(e,{props:i,moduleExports:l,typedefs:a,events:o,slots:r,contexts:p});let f={source:fi(e,0,e.source?.length),syntaxMode:e.syntaxMode,...e.scriptLanguage?{scriptLanguage:e.scriptLanguage}:{},props:i,moduleExports:l,slots:r,events:o,typedefs:a,generics:e.generics,rest_props:e.rest_props,extends:e.extends,componentComment:e.componentComment,componentCommentSource:e.componentCommentSource,contexts:p,customElementTag:e.customElementTag,customElement:e.customElement,...e.cssParts.length>0?{cssParts:e.cssParts.slice()}:{},...e.cssProperties.length>0?{cssProperties:e.cssProperties.slice()}:{},diagnostics:e.diagnosticRecords.slice()},h=Oa(e);if(h)f[Oe]=h;if(e.propIgnoreCodes.size>0)f[oa]=Object.fromEntries(e.propIgnoreCodes);let m=Ma(e);return m?{component:f,pending:m}:{component:f}}function Yg(e){if(e.computed)return;if(e.key.type==="Identifier")return e.key.name;if(e.key.type==="Literal"&&(typeof e.key.value==="string"||typeof e.key.value==="number"))return String(e.key.value);return}function tu(e){return e==="private"||e==="protected"}function Jt(e){return{...e?.description?{description:e.description}:{},...e?.deprecated===void 0?{}:{deprecated:e.deprecated},...e?.tags?{tags:e.tags}:{}}}function iu(e){return e?.slice(1,-1).trim()||void 0}function Qg(e){let t=e?.type==="TSParameterProperty"?e.parameter:e;return t?.type==="AssignmentPattern"?Se(t.right,"widen"):void 0}function xo(e,t,n){let i=cn(e,t),r=new Map((n?.params??[]).map((a)=>[a.name,a])),s=i.params.map(({name:a,type:p,optional:c,rest:u},f)=>{let h=r.get(a);return{name:u?`...${a}`:a,type:p??h?.type??Qg(t.params[f])??(u?"any[]":"any"),...h?.description?{description:h.description}:{},...!u&&(c||h?.optional)?{optional:!0}:{}}}),l=i.returnType??n?.returnType??(t.async?"Promise<any>":void 0),o=iu(i.typeParameters)??n?.typeParameters;return{...s.length>0?{params:s}:{},...l?{returnType:l}:{},...o?{typeParameters:o}:{}}}function ru(e,t){let n=[],i=new Map,r=new Set,s=new Set,l,o=-1;for(let c of t.body.body){if(c.type==="TSIndexSignature"){let[y]=c.parameters;if(!y)continue;O(e,c.typeAnnotation?.typeAnnotation),n.push({kind:"index",name:`[${y.name}: ${le(e,y.typeAnnotation)??"string"}]`,type:le(e,c.typeAnnotation)??"any",...c.static?{static:!0}:{},...c.readonly?{readonly:!0}:{}});continue}if(c.type!=="MethodDefinition"&&c.type!=="PropertyDefinition")continue;if(tu(c.accessibility))continue;let u=Yg(c);if(u===void 0)continue;let f=G(e,c);if(f?.internal)continue;let h=`${c.static?"static ":""}${u}`,m={...c.static?{static:!0}:{},...c.optional?{optional:!0}:{},...c.abstract?{abstract:!0}:{}};if(c.type!=="MethodDefinition"){if(O(e,c.typeAnnotation?.typeAnnotation),!c.static)s.add(u);n.push({kind:"property",name:u,type:le(e,c.typeAnnotation)??f?.type??Se(c.value,"widen")??"any",...m,...c.readonly?{readonly:!0}:{},...Jt(f)});continue}let g=c.typeParameters?{...c.value,typeParameters:c.typeParameters}:c.value;if(c.kind==="constructor"){let y=xo(e,g,f);n.push({kind:"constructor",name:"constructor",params:y.params,...Jt(f)}),o=n.length,l=g.type==="FunctionExpression"?g.body.body:void 0;for(let[S,b]of g.params.entries()){if(b.type!=="TSParameterProperty"||tu(b.accessibility))continue;let M=y.params?.[S];if(!M)continue;s.add(M.name),n.push({kind:"property",name:M.name,type:M.type,...b.readonly?{readonly:!0}:{},...M.description?{description:M.description}:{}})}continue}if(c.kind==="get"||c.kind==="set"){let y=xo(e,g,f),S=c.kind==="get"?y.returnType??f?.type:y.params?.[0]?.type??f?.type,b=i.get(h);if(b){if(c.kind==="set")b.readonly=void 0;if(S&&S!=="any"&&(b.type==="any"||c.kind==="get"))b.type=S;if(!b.description&&!b.deprecated)Object.assign(b,Jt(f));continue}let M={kind:"property",name:u,type:S??"any",...m,...c.kind==="get"?{readonly:!0}:{},...Jt(f)};i.set(h,M),n.push(M);continue}if(g.type==="TSDeclareMethod"&&!c.abstract)r.add(h);else if(g.type!=="TSDeclareMethod"&&r.has(h))continue;n.push({kind:"method",name:u,...m,...xo(e,g,f),...Jt(f)})}if(e.scriptLanguage!=="ts"&&l)n.splice(o,0,...ex(e,l,s));for(let c of t.typeParameters?.params??[])O(e,c.constraint),O(e,c.default);let a=iu(ut(e,t.typeParameters)),p=Zg(e,t);return{members:n,...a?{typeParameters:a}:{},...p}}function Zg(e,t){let n={},i=t.superClass;if(i){if(n.extends=ut(e,{start:i.start,end:t.superTypeParameters?.end??i.end}),i.type==="Identifier")nu(e,i,t.superTypeParameters)}let r=(t.implements??[]).map((s)=>(nu(e,s.expression,s.typeParameters),ut(e,s))).filter((s)=>Boolean(s));if(r.length>0)n.implements=r;return n}function nu(e,t,n){O(e,{type:"TSTypeReference",typeName:t,start:t.start,end:n?.end??t.end,...n?{typeArguments:n}:{}})}function ex(e,t,n){let i=[];for(let r of t){let s=r.type==="ExpressionStatement"?r.expression:void 0;if(s?.type!=="AssignmentExpression"||s.operator!=="=")continue;let l=s.left;if(l.type!=="MemberExpression"||l.computed||l.object.type!=="ThisExpression")continue;let o=l.property.type==="Identifier"?l.property.name:void 0;if(!o||n.has(o))continue;n.add(o);let a=G(e,r);if(a?.internal)continue;i.push({kind:"property",name:o,type:a?.type??"any",...Jt(a)})}return i}var tx=/^[A-Za-z_$][\w$]*(?=\s*(?:<|$))/;function pr(e,t,n){if(!t)return;let i=e.moduleExports.get(t);e.moduleExports.set(t,i?{...i,...n}:n)}function su(e,t,n,i){let r=G(e,t);pr(e,n==="*"?`* from ${i.from}`:n,{name:n,kind:"re-export",description:r?.description,deprecated:r?.deprecated,tags:r?.tags,...r?.internal?{internal:!0}:{},isFunction:!1,isFunctionDeclaration:!1,isRequired:!1,constant:!1,reactive:!1,reExport:i,source:P(e,t)})}function ou(e,t){D(e,"module-export-conflict","default",`export "default" was skipped because it collides with the component's own default export.`,P(e,t))}function nx(e,t,n,i){let r=n.id?.name;if(!r)return;let s=i?.exportedName??r,l=kn(e,t,i),{members:o,typeParameters:a,extends:p,implements:c}=ru(e,n),u=a??l?.typeParameters;pr(e,s,{name:s,...r===s?{}:{localName:r},kind:"class",description:l?.description,deprecated:l?.deprecated,tags:l?.tags,...l?.internal?{internal:!0}:{},type:`typeof ${r}`,...u?{typeParameters:u}:{},members:o,...n.abstract?{abstract:!0}:{},...p?{extends:p}:{},...c?{implements:c}:{},isFunction:!1,isFunctionDeclaration:!1,isRequired:!1,constant:!1,reactive:!1,source:P(e,t)})}function au(e,t,n,i){if(n.type==="ClassDeclaration"){nx(e,t,n,i);return}let r=Es(e,n,i,"moduleExports");if(r.length===0)return;let s=kn(e,t,i);for(let l of r){let{prop_name:o,kind:a}=l,{type:p,typeSource:c,description:u,params:f,returnType:h,isFunction:m,typeParameters:g}=Ss(e,l,s);pr(e,o,{name:o,kind:a,description:u,deprecated:s?.deprecated,tags:s?.tags,...s?.internal?{internal:!0}:{},type:p,typeSource:c,value:l.value,defaultValue:l.defaultValue,params:f,returnType:h,typeParameters:g,isFunction:m,isFunctionDeclaration:l.isFunctionDeclaration,isRequired:!1,constant:a==="const",reactive:!1,source:P(e,t)})}}function ix(e,t){return e.parsed?.fragment.nodes.find((n)=>n.type==="SnippetBlock"&&n.expression.name===t)}function rx(e,t){let n;try{n=yo(`function f<${t}>() {}`,{typescript:!0})}catch{return}let i=n.body[0];if(i?.type!=="FunctionDeclaration")return;for(let r of i.typeParameters?.params??[])O(e,r.constraint),O(e,r.default)}function sx(e,t,n,i){let r=cn(e,{params:n.parameters}).params,l=r.map((c,u)=>{let f=n.parameters[u];if(c.type||f?.type!=="AssignmentPattern")return c;return{...c,type:Se(f.right,"widen")}}).map((c)=>`${c.name}${c.optional?"?":""}: ${c.type??"any"}`).join(", ");if(n.typeParams)rx(e,n.typeParams);let o=n.typeParams?`<${n.typeParams}>(${l}) => ReturnType<Snippet>`:l?`Snippet<[${l}]>`:"Snippet",a=kn(e,t,i),p=i.exportedName;pr(e,p,{name:p,...i.localName===p?{}:{localName:i.localName},kind:"const",description:a?.description,deprecated:a?.deprecated,tags:a?.tags,...a?.internal?{internal:!0}:{},type:o,typeSource:e.scriptLanguage==="ts"&&r.every((c)=>c.type)?"typescript":"inferred",isFunction:n.typeParams!==void 0,isFunctionDeclaration:!1,isRequired:!1,constant:!0,reactive:!1,source:P(e,t)})}function ox(e){let t=Array.from(e.moduleExports.values()).filter((i)=>i.kind==="class"),n=new Set(t.map((i)=>i.localName??i.name));for(let i of t){if(!i.extends)continue;let r=tx.exec(i.extends)?.[0];if(r&&(n.has(r)||e.valueImportBindingsByLocalName.has(r)||e.typeImportBindingsByLocalName.has(r)))continue;D(e,"export-unresolved",i.name,`class "${i.name}" extends \`${i.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.`,i.source),i.extends=void 0}}function lu(e){let t=e.parsed?.module;if(!t)return;let n=ja(t);K(t,{enter(i,r){if(i.type==="ImportDeclaration")un(e,i);if(i.type==="FunctionDeclaration"&&i.id?.name)e.funcDecls.set(i.id.name,i);if(i.type==="VariableDeclaration")e.vars.add(i);if(i.type==="ExportNamedDeclaration"){if(i.declaration!=null){au(e,i,i.declaration);return}let s=i.source?.value,l=r?.type==="Program"?r:null;for(let o of i.specifiers){let a=gs(e,i,o,l,"module");if(!a)continue;if(a.exportedName==="default"){ou(e,i);continue}let p=typeof s==="string"?{from:s,imported:a.localName}:n.get(a.localName),c=a.declaration||p?void 0:ix(e,a.localName);if(a.declaration)au(e,i,a.declaration,a);else if(c)sx(e,i,c,a);else if(p)su(e,i,a.exportedName,p);else if(!e.localTypeDeclarationsByName.get(a.localName)?.exported)xs(e,i,a.localName,a.exportedName)}}if(i.type==="ExportAllDeclaration"&&typeof i.source.value==="string"){let s=(i.exported&&Ti(i.exported))??"*";if(s==="default"){ou(e,i);return}su(e,i,s,{from:i.source.value,imported:"*"})}}}),ox(e)}var ax=[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],lx=/[:!]/;function px(e){let t;return()=>(t??=cx(e),t)}function cx(e){let t=new Map,n=0,i="";for(let r of e.split(" ")){let s=r.search(lx);i=i.slice(0,Number.parseInt(r[0],36))+r.slice(1,s);let l=Number.parseInt(r.slice(s+1),36);if(t.set(`${i};`,l),r[s]==="!")t.set(i,l);n=Math.max(n,i.length+1)}return{table:t,longest:n}}var cu=px("0amp!12 1pos:13 0gt!1q 0lt!1o 0quot!y"),Eo=(e)=>e>=48&&e<=57,ux=(e)=>Eo(e)||e>=65&&e<=70||e>=97&&e<=102,pu=(e)=>Eo(e)||e>=65&&e<=90||e>=97&&e<=122,cr=0;function dx(e,t,n,i){if(e.charCodeAt(t)===35){let o=(e.charCodeAt(t+1)|32)===120,a=t+(o?2:1),p=a;while(p<e.length&&(o?ux:Eo)(e.charCodeAt(p)))p++;if(p===a)return 0;return cr=e.charCodeAt(p)===59?p+1:p,Number.parseInt(e.slice(a,p),o?16:10)}let{table:r,longest:s}=i(),l=t;while(l-t<s&&pu(e.charCodeAt(l)))l++;if(e.charCodeAt(l)===59){let o=r.get(e.slice(t,l+1));if(o!==void 0)return cr=l+1,o}for(let o=l;o>t;o--){let a=r.get(e.slice(t,o));if(a===void 0)continue;if(n){let p=e.charCodeAt(o);if(pu(p)||p===95||p===61)continue}return cr=o,a}return 0}function fx(e,t){if(e===10&&!t)return 32;if(e<128)return e;if(e<=159)return ax[e-128];if(e>=55296&&e<=57343)return 0;if(e<=196607)return e;if(e>=917504&&e<=917631||e>=917760&&e<=917999)return e;return 0}function ur(e,t,n){let i=e.indexOf("&");if(i===-1)return e;let r="",s=0;while(i!==-1){let l=dx(e,i+1,t,n);if(l)r+=e.slice(s,i)+String.fromCodePoint(fx(l,t)),s=cr;i=e.indexOf("&",l?s:i+1)}return r+e.slice(s)}var uu=new WeakMap;function So(e,t){let n=uu.get(e);if(n===void 0)uu.set(e,[t]);else n.push(t)}var hx=/\r(?!\n)|[\u2028\u2029]/,ku=/\s*}/y;function Co(e,t){let n=e.codePointAt(t);if(n===void 0||!be(n,!0))return t;let i=t+(n<=65535?1:2),r=e.codePointAt(i);while(r!==void 0&&Ne(r,!0))i+=r<=65535?1:2,r=e.codePointAt(i);return i}class _u{source;index=0;loc;lfOnly;isTypeScript;typescript;entityNames;css;script;comments;root;stack;fragments;metaTags=new Set;lastAutoClosedTag;nextAngle=-1;nextBrace=-1;constructor(e,t,n,i={}){if(this.source=e,this.loc=i.loc??!1,this.lfOnly=this.loc&&!hx.test(e),this.isTypeScript=Vi(e),this.typescript=n.typescript,this.isTypeScript&&!this.typescript)Xi();this.entityNames=n.entityNames,this.css=i.css??!0,this.script=i.script??!0,this.comments=i.comments??!0,this.root={type:"Root",start:0,end:t,css:null,js:[],options:null,fragment:{type:"Fragment",nodes:[]},comments:[]},this.stack=[this.root],this.fragments=[this.root.fragment]}match(e){if(e.length===1)return this.source.charCodeAt(this.index)===e.charCodeAt(0);return this.source.startsWith(e,this.index)}matchRegex(e){return e.lastIndex=this.index,e.exec(this.source)?.[0]??null}eat(e,t=!1){if(this.match(e))return this.index+=e.length,!0;if(t)nt(this.index,e);return!1}read(e){let t=this.matchRegex(e);if(t)this.index+=t.length;return t}readUntil(e){if(this.index>=this.source.length)fe(this.source.length);let t=this.source.indexOf(e,this.index),n=t===-1?this.source.length:t,i=this.source.slice(this.index,n);return this.index=n,i}allowWhitespace(){this.index=R(this.source,this.index)}requireWhitespace(){if(!U(this.source.charCodeAt(this.index)))fc(this.index);this.allowWhitespace()}eatClosingBrace(){this.allowWhitespace(),this.eat("}",!0)}sourceLocation(e,t){return this.loc?{start:Pe(e),end:Pe(t)}:void 0}readIdentifierName(){let e=this.index,t=Co(this.source,e),n=this.source.slice(e,t);if(this.index=t,tr.has(n))Rc(e,n);let i={type:"Identifier",name:n,start:e,end:t};if(this.loc)i.loc=this.sourceLocation(e,t);return i}current(){return this.stack[this.stack.length-1]}append(e){this.fragments[this.fragments.length-1].nodes.push(e)}open(e,t){this.append(e),this.stack.push(e),this.fragments.push(t)}setFragment(e){this.fragments[this.fragments.length-1]=e}close(){this.stack.pop(),this.fragments.pop()}}var mx={"||":1,"??":1,"&&":2,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"+":9,"-":9,"*":10,"/":10,"%":10};function Ao(e,t,n,i){return{type:"Literal",start:t,end:n,value:i,raw:e.slice(t,n)}}function du(e,t){let n=e.charCodeAt(t);if(n===34||n===39){for(let r=t+1;r<e.length;r++){let s=e.charCodeAt(r);if(s===n)return Ao(e,t,r+1,e.slice(t+1,r));if(s===92||s===10||s===13)return null}return null}let i=t;for(;i<e.length;i++){let r=e.charCodeAt(i);if(r<48||r>57)break}if(i===t||n===48&&i-t>1)return null;return Ao(e,t,i,Number(e.slice(t,i)))}function yx(e,t,n){let i=Co(e,t);if(i===t)return du(e,t);let r=e.slice(t,i);if(r==="true"||r==="false"||r==="null")return Ao(e,t,i,r==="null"?null:r==="true");if(tr.has(r))return null;let s={type:"Identifier",start:t,end:i,name:r};for(let l=i;;){let o=e.charCodeAt(l);if(o===40){let c=gx(e,l+1,n);if(!c)return null;s={type:"CallExpression",start:t,end:c.end,callee:s,arguments:c.arguments,optional:!1},l=c.end;continue}let a,p;if(o===46){if(p=Co(e,l+1),p===l+1)return null;a={type:"Identifier",start:l+1,end:p,name:e.slice(l+1,p)}}else if(o===91){if(a=du(e,l+1),!a||e.charCodeAt(a.end)!==93)return null;p=a.end+1}else return s;s={type:"MemberExpression",start:t,end:p,object:s,property:a,computed:o===91,optional:!1},l=p}}function gx(e,t,n){let i=[],r=R(e,t);if(e.charCodeAt(r)===41)return{arguments:i,end:r+1};for(;;){let s=fr(e,r,n);if(!s)return null;i.push(s),r=R(e,s.end);let l=e.charCodeAt(r);if(l===41)return{arguments:i,end:r+1};if(l!==44)return null;if(r=R(e,r+1),e.charCodeAt(r)===41)return null}}function No(e,t,n){let i=e.charCodeAt(t),r=e.charCodeAt(t+1);if(!(i===33&&r!==61)&&!(i===45&&r!==45&&r!==61))return yx(e,t,n);let s=No(e,R(e,t+1),n);if(!s)return null;return{type:"UnaryExpression",start:t,end:s.end,operator:i===33?"!":"-",prefix:!0,argument:s}}function fu(e,t,n){let i=e.charCodeAt(t),r=e.charCodeAt(t+1);switch(i){case 124:return r===124&&e.charCodeAt(t+2)!==61?"||":null;case 38:return r===38&&e.charCodeAt(t+2)!==61?"&&":null;case 63:return r===63&&e.charCodeAt(t+2)!==61?"??":null;case 61:if(r!==61)return null;return e.charCodeAt(t+2)===61?"===":"==";case 33:if(r!==61)return null;return e.charCodeAt(t+2)===61?"!==":"!=";case 60:case 62:if(n||r===i)return null;if(r===61)return i===60?"<=":">=";return i===60?"<":">";case 43:return r===43||r===61?null:"+";case 45:return r===45||r===61?null:"-";case 42:return r===42||r===61?null:"*";case 47:return r===47||r===42||r===61?null:"/";case 37:return r===61?null:"%";default:return null}}function wo(e,t,n,i){if(Nu(e.charCodeAt(t.end)))return t;let r=R(e,t.end),s=fu(e,r,i);if(s===null)return t;let l=mx[s];if(l<=n)return t;let o=No(e,R(e,r+s.length),i);if(!o)return null;let a=wo(e,o,s==="??"?2:l,i);if(!a)return null;let p;if(s==="||"||s==="&&"||s==="??"){let c=fu(e,R(e,a.end),i);if(s==="??"?c==="||"||c==="&&":c==="??")return null;p={type:"LogicalExpression",start:t.start,end:a.end,left:t,operator:s,right:a}}else p={type:"BinaryExpression",start:t.start,end:a.end,left:t,operator:s,right:a};return wo(e,p,n,i)}function fr(e,t,n){let i=No(e,t,n);if(!i)return null;let r=wo(e,i,-1,n);if(!r||Nu(e.charCodeAt(r.end)))return r;let s=R(e,r.end);if(e.charCodeAt(s)!==63)return r;let l=e.charCodeAt(s+1);if(l===46||l===63)return null;let o=fr(e,R(e,s+1),n);if(!o)return null;let a=R(e,o.end);if(e.charCodeAt(a)!==58)return null;let p=fr(e,R(e,a+1),n);if(!p)return null;return{type:"ConditionalExpression",start:r.start,end:p.end,test:r,consequent:o,alternate:p}}function Nu(e){return e===125||e===41||e===44||e===58}function xx(e,t){let n=e.charCodeAt(R(e,t));return n===125||n===41}function Ex(e,t,n){let i=fr(e,t,n);return i&&xx(e,i.end)?i:null}function Ce(e){switch(e.loc={start:ot(e.start),end:ot(e.end)},e.type){case"MemberExpression":Ce(e.object),Ce(e.property);break;case"CallExpression":Ce(e.callee);for(let t of e.arguments)Ce(t);break;case"UnaryExpression":Ce(e.argument);break;case"BinaryExpression":case"LogicalExpression":Ce(e.left),Ce(e.right);break;case"ConditionalExpression":Ce(e.test),Ce(e.consequent),Ce(e.alternate);break}}function ne(e){let t=!e.loc||e.lfOnly?Ex(e.source,e.index,e.isTypeScript):null;if(t){if(e.index=t.end,e.loc)Ce(t);return t}let{node:n,end:i}=zt(e,e.source,e.index);return e.index=i,n}var Sx=new Set(["server","client","worker","test","default"]);function Tx(e,t,n){let{source:i,index:r}=e;if(r>=i.length)fe(i.length);let s=ji(i,r);if(s===-1)ao(i.length,"script");e.index=Gi(i,s);let l=e.script?rr(e,i.slice(0,s),r):{type:"Program",start:r,end:s,body:[],sourceType:"module"};if(l.start=r,l.loc)Object.assign(l.loc.start,ot(t)),Object.assign(l.loc.end,ot(e.index));else if(e.loc)l.loc={start:ot(t),end:ot(e.index)};let o="default";for(let a of n){if(Sx.has(a.name))xc(a,a.name);if(a.name==="module"){if(a.value!==!0)yc(a,a.name);o="module"}if(a.name==="context"){let p=a.value;if(!Array.isArray(p)||p.length!==1||p[0].type!=="Text"||p[0].data!=="module")gc(a);o="module"}}return{type:"Script",start:t,end:e.index,context:o,content:l,attributes:n}}var bx=/(even|odd|\+?(\d+|\d*n(\s*[+-]\s*\d+)?)|-\d*n(\s*\+\s*\d+))((?=\s*[,)])|\s+of(\s+|(?=[.#[*:&])))/y,vx=/\d+(\.\d+)?%/y,Cx=/\\[0-9a-fA-F]{1,6}(\r\n|\s)?/y,Ax=/\s*>/y,it=-1,Du=34,wx=35,Px=36,kx=38,$u=39,_x=40,Nx=41,yr=42,Dx=43,$x=45,Ix=46,Iu=47,Po=58,Lx=59,Rx=60,hu=61,Mx=62,Ox=91,Do=92,Bx=93,Fx=94,Lu=123,ko=124,Vx=125,Ru=126,hr=[];function jx(e,t,n){let i=e.index;hr=[];let r=e.css?Wx(e):Gx(e),s=e.index;return e.eat("</style",!0),e.read(Ax),{type:"StyleSheet",start:t,end:e.index,attributes:n,children:r,comments:hr,content:{start:i,end:s,styles:e.source.slice(i,s),comment:null}}}function Gx(e){return e.index=Wi(e.source,e.index),[]}function Wx(e){let t=[];for(;;){if(Xt(e,!0),e.match("</style")||e.index>=e.source.length)break;t.push(e.match("@")?Mu(e):Ou(e))}return t}function Mu(e){let t=e.index;e.eat("@",!0);let n=vt(e),i=$o(e,!0),r=null;if(e.match("{"))r=Vu(e);else e.eat(";",!0);return{type:"Atrule",start:t,end:e.index,name:n,prelude:i,block:r}}function Ou(e){let t=e.index;return{type:"Rule",prelude:Bu(e,!1),block:Vu(e),start:t,end:e.index}}function Bu(e,t){let n=[];Xt(e,!0);let i=e.index;while(e.index<e.source.length){n.push(Hx(e,t));let r=e.index;if(Xt(e,!0),e.match(t?")":"{"))return{type:"SelectorList",start:i,end:r,children:n};e.eat(",",!0),Xt(e,!0)}return fe(e.source.length)}function mu(e,t){return{type:"RelativeSelector",combinator:e,selectors:[],start:t,end:-1}}function Hx(e,t){let{source:n,index:i}=e,r=[],s=mu(null,e.index);while(e.index<n.length){let l=e.index,o=n.charCodeAt(l),a=s.selectors;if(o===kx)e.index++,a.push({type:"NestingSelector",name:"&",start:l,end:e.index});else if(o===yr)e.index++,a.push(yu(e,l,"*"));else if(o===wx)e.index++,a.push({type:"IdSelector",name:vt(e),start:l,end:e.index});else if(o===Ix)e.index++,a.push({type:"ClassSelector",name:vt(e),start:l,end:e.index});else if(o===Po){let f=n.charCodeAt(l+1)===Po;e.index+=f?2:1;let h=vt(e),m=null;if(e.eat("("))m=Bu(e,!0),e.eat(")",!0);if(f)a.push({type:"PseudoElementSelector",name:h,start:l,end:e.index,...m&&{args:m}});else a.push({type:"PseudoClassSelector",name:h,args:m,start:l,end:e.index})}else if(o===Ox)e.index++,a.push(Ux(e,l));else{let f=t?e.read(bx):null,h=!f&&De(o)?e.read(vx):null;if(f)a.push({type:"Nth",value:f,start:l,end:e.index});else if(h)a.push({type:"Percentage",value:h,start:l,end:e.index});else if(Fu(n,l)===0){let m=vt(e);a.push(yu(e,l,m))}}let p=e.index;Xt(e,!1);let c=e.match(",")||e.match(t?")":"{");if(e.index=p,c)return s.end=p,r.push(s),{type:"ComplexSelector",start:i,end:p,children:r};let u=qx(e);if(u){if(s.selectors.length>0)s.end=p,r.push(s);if(s=mu(u,u.start),e.allowWhitespace(),e.match(",")||e.match(t?")":"{"))rc(e.index)}}return fe(n.length)}function yu(e,t,n){let i=n,r;if(e.eat("|"))r=i,i=e.eat("*")?"*":vt(e);return{type:"TypeSelector",name:i,...r!==void 0&&{namespace:r},start:t,end:e.index}}function Ux(e,t){let n=e.source;e.allowWhitespace();let i=vt(e);e.allowWhitespace();let r=null,s=null,l=n.charCodeAt(e.index);if(l===hu)s="=";else if((l===Ru||l===Fx||l===Px||l===yr||l===ko)&&n.charCodeAt(e.index+1)===hu)s=n.slice(e.index,e.index+2);if(s)e.index+=s.length,e.allowWhitespace(),r=Xx(e);e.allowWhitespace();let o=e.index;while(Gu(n.charCodeAt(e.index)))e.index++;let a=e.index>o?n.slice(o,e.index):null;return e.allowWhitespace(),e.eat("]",!0),{type:"AttributeSelector",start:t,end:e.index,name:i,matcher:s,value:r,flags:a}}function Fu(e,t){let n=e.charCodeAt(t);if(n===Dx||n===Ru||n===Mx)return 1;if(n===ko&&e.charCodeAt(t+1)===ko)return 2;return 0}function qx(e){let t=e.index;e.allowWhitespace();let n=e.index,i=Fu(e.source,n);if(i>0){e.index+=i;let r=e.index;return e.allowWhitespace(),{type:"Combinator",name:e.source.slice(n,r),start:n,end:r}}if(e.index!==t)return{type:"Combinator",name:" ",start:t,end:e.index};return null}function Vu(e){let t=e.index;e.eat("{",!0);let n=[];while(e.index<e.source.length){if(Xt(e,!0),e.match("}"))break;n.push(zx(e))}return e.eat("}",!0),{type:"Block",start:t,end:e.index,children:n}}function zx(e){if(e.match("@"))return Mu(e);let t=e.index;$o(e,!1);let n=e.source.charCodeAt(e.index);return e.index=t,n===Lu?Ou(e):Kx(e)}function Kx(e){let{source:t,index:n}=e;if(n>=t.length)fe(t.length);let i=n;while(i<t.length){let a=t.charCodeAt(i);if(a===Po||U(a))break;i++}let r=t.slice(n,i);e.index=i,e.allowWhitespace(),e.eat(":");let s=e.index;e.allowWhitespace();let l=$o(e,!0);if(!l&&!r.startsWith("--"))ic({start:n,end:s});let o=e.index;if(!e.match("}"))e.eat(";",!0);return{type:"Declaration",start:n,end:o,property:r,value:l}}function $o(e,t){let n=e.source,i=n.length,r="",s=e.index,l=null,o=!1,a=!1,p=it,c=e.index;while(c<i){let u=n.charCodeAt(c);if(o){o=!1,c++;continue}if(u===Do){o=!0,c++;continue}if(u===p)p=it;else if(u===Nx)a=!1;else if(p===it&&(u===Du||u===$u))p=u;else if(u===_x){if(Jx(n,r,s,c))a=!0}else if((u===Lx||u===Lu||u===Vx)&&!a&&p===it){if(e.index=c,!t)return"";if(r+=n.slice(s,c),l){let f=r.length-r.trimStart().length;for(let h of l)h.position=Math.max(0,(h.position??0)-f)}return r.trim()}else if(u===Iu&&!a&&p===it&&n.charCodeAt(c+1)===yr){r+=n.slice(s,c),e.index=c;let f=ju(e);if(t)f.position=r.length,hr.push(f),l??=[],l.push(f);c=e.index,s=c;continue}c++}return e.index=i,fe(i)}function Jx(e,t,n,i){if(i-n>=3)return e.charCodeAt(i-3)===117&&e.charCodeAt(i-2)===114&&e.charCodeAt(i-1)===108;return(t+e.slice(n,i)).endsWith("url")}function Xx(e){let t=e.source,n=it;if(e.eat('"'))n=Du;else if(e.eat("'"))n=$u;let i=e.index,r=!1,s=i;while(s<t.length){let l=t.charCodeAt(s);if(r)r=!1;else if(l===Do)r=!0;else if(n===it?l===Bx||U(l):l===n)return e.index=n===it?s:s+1,t.slice(i,s).trim();s++}return e.index=s,fe(t.length)}function vt(e){let{source:t,index:n}=e,i=t.charCodeAt(n);if(De(i)||i===$x&&De(t.charCodeAt(n+1)))so(n);let r="",s=n,l=n;while(l<t.length){let o=t.charCodeAt(l);if(o===Do){r+=t.slice(s,l),e.index=l;let a=e.matchRegex(Cx);if(a){let p=String.fromCodePoint(Number.parseInt(a.slice(1),16));r+=p==="\\"?"\\\\":p,l+=a.length}else r+=`\\${t[l+1]}`,l+=2;s=l}else if(o>=160||Yx(o))l++;else break}if(r+=t.slice(s,l),e.index=l,r==="")so(n);return r}function Xt(e,t){let n=e.source;e.allowWhitespace();for(;;){let i=n.charCodeAt(e.index);if(i===Iu&&n.charCodeAt(e.index+1)===yr){let r=ju(e);if(t)hr.push(r)}else if(i===Rx&&e.eat("<!--"))e.readUntil("-->"),e.eat("-->",!0);else break;e.allowWhitespace()}}function ju(e){let t=e.index;e.eat("/*",!0);let n=e.readUntil("*/");return e.eat("*/",!0),{type:"CSSComment",value:n,start:t,end:e.index}}function Gu(e){return e>=65&&e<=90||e>=97&&e<=122}function Yx(e){return Gu(e)||De(e)||e===95||e===45}var To=/<\/textarea(\s[^>]*)?>/iy,Qx=/^![a-zA-Z]+$/,Zx=/^[a-zA-Z][a-zA-Z0-9]*:[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$/,eE=/^[a-zA-Z][a-zA-Z0-9]*(-[a-zA-Z0-9.\-_\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}]*)?$/u,bo="\\u200C\\u200D",tE=new RegExp(`^(?:\\p{Lu}[$${bo}\\p{ID_Continue}.]*|\\p{ID_Start}[$${bo}\\p{ID_Continue}]*(?:\\.[$${bo}\\p{ID_Continue}]+)+)$`,"u"),nE=new Map([["use","UseDirective"],["animate","AnimateDirective"],["bind","BindDirective"],["class","ClassDirective"],["style","StyleDirective"],["on","OnDirective"],["let","LetDirective"],["in","TransitionDirective"],["out","TransitionDirective"],["transition","TransitionDirective"]]),Io=new Map([["svelte:head",["SvelteHead",!0]],["svelte:options",["SvelteOptions",!0]],["svelte:window",["SvelteWindow",!0]],["svelte:document",["SvelteDocument",!0]],["svelte:body",["SvelteBody",!0]],["svelte:element",["SvelteElement",!1]],["svelte:component",["SvelteComponent",!1]],["svelte:self",["SvelteSelf",!1]],["svelte:fragment",["SvelteFragment",!1]],["svelte:boundary",["SvelteBoundary",!1]]]),gu=[...Io.keys()],iE=`${gu.slice(0,-1).join(", ")} or ${gu.at(-1)}`,rE=62,xu=123;function gr(e,t){let n=e.index;if(n>=e.source.length)fe(e.source.length);let i=Et(e.source,n,t);return e.index=i,{name:e.source.slice(n,i),start:n,end:i,loc:e.sourceLocation(n,i)}}var zn=(e,t,n,i=n)=>({start:e,end:t,type:"Text",raw:n,data:i});function sE(e){let t=e.charCodeAt(0);if(t>=97&&t<=122&&!e.includes("."))return!1;return tE.test(e)}function oE(e){let t=!0;for(let n=0;n<e.length&&t;n++){let i=e.charCodeAt(n);t=i>=97&&i<=122||n>0&&i>=48&&i<=57}return t&&e.length>0||Qx.test(e)||Zx.test(e)||eE.test(e)}function Eu(e,t){for(let n=e.length-1;n>=0;n--){let i=t(e[n]);if(i!==void 0)return i}return!1}function aE(e,t,n){let i=Io.get(t);if(i)return i[0];if(n)return"Component";if(t==="title"){if(Eu(e.stack,({type:r})=>{if(r==="SvelteHead")return!0;return r==="RegularElement"||r==="Component"?!1:void 0}))return"TitleElement"}if(t==="slot"){if(!Eu(e.stack,(r)=>r.type==="RegularElement"&&r.attributes.some((s)=>s.type==="Attribute"&&s.name==="shadowrootmode")?!0:void 0))return"SlotElement"}return"RegularElement"}function lE(e){let t=e.index++;if(e.eat("!--")){let n=e.readUntil("-->");e.eat("-->",!0),e.append({type:"Comment",start:t,end:e.index,data:n})}else if(e.eat("/"))pE(e,t);else uE(e,t)}function pE(e,t){let{name:n}=gr(e,!1);if(e.allowWhitespace(),e.eat(">",!0),Vn(n))Oc(t);let i=e.current();while(!("name"in i)||i.name!==n){if(i.type==="RegularElement"){if(e.lastAutoClosedTag?.tag!==n)Wu(e,i,t,`</${n}>`)}else{let r=e.lastAutoClosedTag;if(r?.tag===n)pc(t,n,r.reason);lc(t,n)}i.end=t,e.close(),i=e.current()}if(i.end=e.index,e.close(),e.stack.length<(e.lastAutoClosedTag?.depth??0))e.lastAutoClosedTag=void 0}function Wu(e,t,n,i){So(e.root,{code:"element_implicitly_closed",start:t.start,end:t.fragment.nodes[0]?.start??n,by:i,closing:`</${t.name}>`})}function cE(e,t,n){return{type:e,start:t,end:-1,name:n}}function uE(e,t){let n=gr(e,!1),{name:i}=n,r=Io.get(i);if(!r&&i.startsWith("svelte:"))Ac(n,iE);let s=sE(i);if(!s&&!oE(i))Ic(n);if(r?.[1]){if(e.metaTags.has(i))bc(t,i);if(e.current().type!=="Root")Cc(t,i);e.metaTags.add(i)}let l=cE(aE(e,i,s),t,i);if(e.loc)l.name_loc=n.loc;l.attributes=[],l.fragment={type:"Fragment",nodes:[]},e.allowWhitespace();let o=e.current();if(o.type==="RegularElement"&&Ki(o.name,i))Wu(e,o,t,`<${i}>`),o.end=t,e.close(),e.lastAutoClosedTag={tag:o.name,reason:i,depth:e.stack.length};if((i==="script"||i==="style")&&e.current().type==="Root"){let a=[];l.attributes=a,bu(e,a,gE),fE(e,l,t,a);return}if(bu(e,l.attributes,EE),l.type==="SvelteComponent"){let a=Su(l);if(!a)Tc(t);if(!vo(a.value))Sc(a.start);l.expression=Tu(a.value)}else if(l.type==="SvelteElement"){let a=Su(l);if(!a)co(t);if(a.value===!0)co(a);if(!vo(a.value))So(e.root,{code:"svelte_element_invalid_this",start:a.start,end:a.end});l.tag=vo(a.value)?Tu(a.value):yE(a.value[0])}if(!e.eat("/")&&!Vn(i))if(e.eat(">",!0),i==="textarea")l.fragment.nodes=Uu(e,(a,p)=>(To.lastIndex=p,To.test(a)),"inside <textarea>"),e.read(To);else if(i==="script"||i==="style")l.fragment.nodes.push(dE(e,`</${i}>`));else{e.open(l,l.fragment);return}else e.eat(">",!0);l.end=e.index,e.append(l)}function dE(e,t){let n=e.index,i=e.source.indexOf(t,n);e.index=i===-1?e.source.length:i;let r=zn(n,e.index,e.source.slice(n,e.index));return e.eat(t,!0),r}function fE(e,t,n,i){e.eat(">",!0);let r=hE(e.root.fragment.nodes,n);if(t.name==="style"){let o=jx(e,n,i);if(o.content.comment=r,e.root.css)Ec(n);e.root.css=o;return}let s=Tx(e,n,i);if(r&&e.comments)s.content.leadingComments=[{type:"Line",value:r.data}];let l=s.context==="module"?"module":"instance";if(e.root[l])mc(n);e.root[l]=s}function hE(e,t){let n=e.length-1;if(n<0||e[n].end!==t)return null;for(let i=n;i>=0;i--){let r=e[i];if(r.type==="Comment")return r;if(r.type!=="Text"||r.data.trim())return null}return null}var mE=(e)=>e.type==="Attribute"&&e.name==="this";function Su(e){let t=e.attributes.find(mE);if(t)e.attributes.splice(e.attributes.indexOf(t),1);return t}function vo(e){if(e===!0)return!1;if(!Array.isArray(e))return!0;return e.length===1&&e[0].type==="ExpressionTag"}function Tu(e){return(Array.isArray(e)?e[0]:e).expression}function yE(e){if(e.type!=="Text")return e.expression;return{type:"Literal",value:e.data,raw:`'${e.raw}'`,start:e.start,end:e.end}}function bu(e,t,n){let i=new Set;for(;;){let r=n(e);if(!r)return;let{type:s}=r;if(s==="Attribute"||s==="BindDirective"||s==="StyleDirective"||s==="ClassDirective"){let l=`${s==="BindDirective"?"Attribute":s}${r.name}`;if(i.has(l))Jp(r);if(r.name!=="this")i.add(l)}t.push(r),e.allowWhitespace()}}function Lo(e,t,n,i,r){return e.loc?{type:"Attribute",start:n,end:i,name:t.name,name_loc:t.loc,value:r}:{type:"Attribute",start:n,end:i,name:t.name,value:r}}function Hu(e){if(ve(e.source.charCodeAt(e.index)))nt(e.index,"=")}function gE(e){let t=e.index,n=gr(e,!0);if(!n.name)return null;let i=!0;if(e.eat("=")){e.allowWhitespace();let{source:r}=e,s=e.index,l=ve(r.charCodeAt(s)),o=-1;if(l){let c=r.indexOf(r[s],s+1);if(c!==-1)o=c+1}if(o===-1){o=s;while(o<r.length&&r.charCodeAt(o)!==rE&&!U(r.charCodeAt(o)))o++;if(o===s)lo(s)}e.index=o;let a=l?1:0,p=r.slice(s+a,o-a);i=[zn(o-p.length-a,o-a,p,ur(p,!0,e.entityNames))]}return Hu(e),Lo(e,n,t,e.index,i)}function xE(e){let t=e.index,n=e.match("/*");if(!n&&!e.match("//"))return!1;e.index+=2;let i=e.readUntil(n?"*/":`
|
|
54
|
+
`);if(n)e.eat("*/");let r={type:n?"Block":"Line",start:t,end:e.index,value:i},s=e.sourceLocation(t,e.index);if(s)r.loc=s;if(e.comments)e.root.comments.push(r);return!0}function EE(e){while(xE(e))e.allowWhitespace();let t=e.index;if(e.eat("{"))return SE(e,t);let n=gr(e,!0);if(!n.name)return null;let i=e.index;e.allowWhitespace();let r=!0;if(e.eat("=")){if(e.allowWhitespace(),e.match("/>"))r=[zn(e.index,e.index+1,"/")],e.index++;else r=vE(e);i=e.index}else Hu(e);let s=n.name.indexOf(":"),l=s>0?nE.get(n.name.slice(0,s)):void 0;return l?bE(e,l,n,s,t,i,r):Lo(e,n,t,i,r)}function SE(e,t){if(e.allowWhitespace(),e.eat("@attach")){e.requireWhitespace();let r=ne(e);return e.eatClosingBrace(),{type:"AttachTag",start:t,end:e.index,expression:r}}if(e.eat("...")){let r=ne(e);return e.eatClosingBrace(),{type:"SpreadAttribute",start:t,end:e.index,expression:r}}let n=e.readIdentifierName();if(n.name==="")Xp(t);e.eatClosingBrace();let i={type:"ExpressionTag",start:n.start,end:n.end,expression:n};return Lo(e,n,t,e.index,i)}function TE(e){if(e===!0)return;return Array.isArray(e)?e[0]:e}function bE(e,t,n,i,r,s,l){let[o,...a]=n.name.slice(i+1).split("|");if(o==="")ac({start:r,end:r+i+1},n.name);let p={start:r,end:s,type:t,name:o};if(e.loc)p.name_loc=n.loc;if(t==="StyleDirective")return p.modifiers=a,p.value=l,p;let c=TE(l);if(c&&(Array.isArray(l)&&l.length>1||c.type==="Text"))oc(c.start);if(p.expression=c?.expression??null,p.modifiers=a,t==="TransitionDirective"){let u=n.name.slice(0,i);p.intro=u!=="out",p.outro=u!=="in"}if((t==="BindDirective"||t==="ClassDirective")&&!p.expression)p.expression={start:r+i+1,end:s,type:"Identifier",name:o};return p}function vE(e){let t=e.source.charCodeAt(e.index),n=ve(t);if(n){if(e.index++,e.source.charCodeAt(e.index)===t)return e.index++,[zn(e.index-1,e.index-1,"")]}let i;try{i=Uu(e,n?(r,s)=>r.charCodeAt(s)===t:Hi,"in attribute value",n?t:void 0)}catch(r){let s=r instanceof E&&r.code==="js_parse_error"?r.position?.[0]:void 0;if(s!==void 0&&e.source.startsWith("/>",s-1))e.index=s,nt(s,n?String.fromCharCode(t):"}");throw r}if(n)e.index++;else if(i.length===0)lo(e.index);return n||i.length>1||i[0].type==="Text"?i:i[0]}function Uu(e,t,n,i){let{source:r}=e,s=[],l=e.index,o=(a)=>{if(a<=l)return;let p=r.slice(l,a);s.push(zn(l,a,p,ur(p,!0,e.entityNames)))};while(e.index<r.length){let a=e.index;if(t(r,a))return o(a),s;if(r.charCodeAt(a)!==xu){if(e.index++,i!==void 0)while(e.index<r.length&&r.charCodeAt(e.index)!==xu&&r.charCodeAt(e.index)!==i)e.index++;continue}e.index++;let p=r.charCodeAt(e.index);if(p===35||p===64){e.index++;let u=e.index;while(e.index<r.length&&r.charCodeAt(e.index)>=97&&r.charCodeAt(e.index)<=122)e.index++;let f=r.slice(u,e.index);(p===35?Zp:Lc)(a,f,n)}o(a),e.allowWhitespace();let c=ne(e);e.eatClosingBrace(),s.push({type:"ExpressionTag",start:a,end:e.index,expression:c}),l=e.index}fe(r.length)}var CE=new Map([["html","html"],["svg","svg"],["mathml","mathml"],["http://www.w3.org/2000/svg","svg"],["http://www.w3.org/1998/Math/MathML","mathml"]]),AE=new Map([["type",(e,t)=>{if(t!=="String"&&t!=="Number"&&t!=="Boolean"&&t!=="Array"&&t!=="Object")return!1;return e.type=t,!0}],["reflect",(e,t)=>{if(typeof t!=="boolean")return!1;return e.reflect=t,!0}],["attribute",(e,t)=>{if(typeof t!=="string")return!1;return e.attribute=t,!0}]]),vu="[a-z0-9_.\\xB7\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u203F-\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u{10000}-\\u{EFFFF}-]",wE=new RegExp(`^[a-z]${vu}*-${vu}*$`,"u"),PE=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" ")),dr=(e)=>(t,n)=>{let i=mr(n);if(typeof i!=="boolean")Zi(n,"true or false");t[e]=i},kE=new Map([["runes",dr("runes")],["immutable",dr("immutable")],["preserveWhitespace",dr("preserveWhitespace")],["accessors",dr("accessors")],["namespace",(e,t)=>{let n=CE.get(mr(t));if(!n)Zi(t,'"html", "mathml" or "svg"');e.namespace=n}],["css",(e,t)=>{if(mr(t)!=="injected")Zi(t,'"injected"');e.css="injected"}],["tag",(e,t)=>wc(t)],["customElement",(e,t)=>{let n=DE(t);if(n)e.customElement=n}]]);function _E(e){let t=[],n={start:e.start,end:e.end,attributes:t};for(let i of e.attributes){if(i.type!=="Attribute")Pc(i);t.push(i);let r=kE.get(i.name);if(!r)$c(i,i.name);r(n,i)}return n}function mr({value:e}){if(e===!0)return!0;let t=Array.isArray(e)?e:[e];if(t.length===0)return!0;if(t.length>1)return null;let[n]=t;if(n.type==="Text")return n.data;return n.expression.type==="Literal"?n.expression.value:null}function Cu(e,t){if(typeof t!=="string")uo(e);if(!t)return;if(!wE.test(t))uo(e);if(PE.has(t))Dc(e)}function _o(e){return e.type==="Property"&&!e.computed&&e.key.type==="Identifier"}function NE(e,t){let n=new Map;for(let i of e.properties){if(!_o(i))t();if(!n.has(i.key.name))n.set(i.key.name,i.value)}return n}function DE(e){let t=()=>kc(e);if(e.value===!0)t();let n=Array.isArray(e.value)?e.value[0]:e.value;if(n.type==="Text"){let c=mr(e);return Cu(e,c),{tag:c}}let{expression:i}=n;if(i.type!=="ObjectExpression"){if(i.type==="Literal"&&i.value===null)return;t()}let r=NE(i,t),s={},l=r.get("tag");if(l){let c=l.type==="Literal"?l.value:void 0;Cu(null,c),s.tag=c}let o=r.get("props");if(o){let c=()=>_c(e);if(o.type!=="ObjectExpression")c();s.props={};for(let u of o.properties){if(!_o(u)||u.value.type!=="ObjectExpression")c();let f={};s.props[u.key.name]=f;for(let h of u.value.properties){if(!_o(h)||h.value.type!=="Literal")c();if(!AE.get(h.key.name)?.(f,h.value.value))c()}}}let a=r.get("shadow");if(a)if(a.type==="ObjectExpression")s.shadow=a;else if(a.type==="Literal"&&(a.value==="open"||a.value==="none"))s.shadow=a.value;else Nc(e);let p=r.get("extend");if(p)s.extend=p;return s}var $E={"{":"}","(":")","[":"]"};function Ro(e,t,n=$E){let i=Object.values(n),r=[],s=t;while(s<e.length){let l=e[s++];if(l==="'"||l==='"'||l==="`")s=IE(e,s,l);else if(l===">"&&e[s-2]==="="&&i.includes(">"));else if(Object.hasOwn(n,l))r.push(l);else if(i.includes(l)){let o=n[r.pop()??""];if(l!==o)nt(s-1,o);if(r.length===0)return s}}fe(e.length)}function IE(e,t,n){let i=t;while(i<e.length){let r=e[i++];if(r===n)return i;if(r==="\\")i++;else if(n==="`"&&r==="$"&&e[i]==="{")i=Ro(e,i)}Mc(t)}var LE=/\?(?=\s*:)/g;function xr(e){let t=e.index,n=e.readIdentifierName();if(n.name!=="")return{...n,typeAnnotation:Au(e)};let i=e.source[e.index];if(i!=="{"&&i!=="[")uc(e.index);e.index=Ro(e.source,t);let r=Gc(e,e.source.slice(0,e.index),t)??RE(e,t);Br(r,"ObjectPattern","ArrayPattern");let s=Au(e);if(r.typeAnnotation=s,s)r.end=s.end;return r}function RE(e,t){let{node:n}=zt(e,`${e.source.slice(0,e.index)} = 1`,t);return Br(n,"AssignmentExpression"),n.left}function Au(e){let t=e.index;if(e.allowWhitespace(),!e.eat(":")){e.index=t;return}let n="_ as ",i=e.index-n.length,r=e.source.slice(0,i)+n+e.source.slice(e.index).replace(LE," "),s=zt(e,r,i).node;if(s.type==="AssignmentExpression"){let l=s.right.start;while(r[l]!=="=")l-=1;s=zt(e,r.slice(0,l),i).node}if(s.type==="SequenceExpression")s=s.expressions[0];return e.index=s.end,{type:"TSTypeAnnotation",start:t,end:e.index,typeAnnotation:s.type==="TSAsExpression"?s.typeAnnotation:void 0}}var ME={IfBlock:"if",EachBlock:"each",KeyBlock:"key",AwaitBlock:"await",SnippetBlock:"snippet"},He=()=>({type:"Fragment",nodes:[]});function OE(e,t){if(e.eat("if")){e.requireWhitespace();let n=ne(e);e.eatClosingBrace();let i=He();e.open({type:"IfBlock",elseif:!1,start:t,end:-1,test:n,consequent:i,alternate:null},i)}else if(e.eat("each"))FE(e,t);else if(e.eat("await")){e.requireWhitespace();let n=ne(e);e.allowWhitespace();let i={type:"AwaitBlock",start:t,end:-1,expression:n,value:null,error:null,pending:null,then:null,catch:null},r=He();if(e.eat("then"))i.value=wu(e),i.then=r;else if(e.eat("catch"))i.error=wu(e),i.catch=r;else i.pending=r;e.eat("}",!0),e.open(i,r)}else if(e.eat("key")){e.requireWhitespace();let n=ne(e);e.eatClosingBrace();let i=He();e.open({type:"KeyBlock",start:t,end:-1,expression:n,fragment:i},i)}else if(e.eat("snippet"))VE(e,t);else cc(e.index)}function wu(e){if(e.matchRegex(ku))return e.allowWhitespace(),null;e.requireWhitespace();let t=xr(e);return e.allowWhitespace(),t}function BE(e){let t={assertion:null},n=e.end,i=(s)=>{if(s.type==="TSAsExpression"&&s.end===e.end)return t.assertion=s,n=s.expression.end,s.expression;return Zt(s,i),s},r=e;if(e.type==="TSAsExpression")t.assertion=e,r=e.expression,n=r.end;else Zt(e,i);return r.end=n,{expression:r,assertion:t.assertion}}function FE(e,t){e.requireWhitespace();let n=e.source,i;while(!i)try{i=ne(e)}catch(a){let p=((a instanceof E?a.position:void 0)?.[0]??t)-2;while(p>t&&e.source.slice(p,p+2)!=="as")p-=1;if(p<=t)throw e.source=n,a;e.source=n.slice(0,p)}if(e.source=n,e.allowWhitespace(),!e.match("as")){if(i.type==="SequenceExpression")i=i.expressions[0];let a=BE(i);if(i=a.expression,a.assertion){let p=a.assertion.typeAnnotation.start-2;while(e.source.slice(p,p+2)!=="as")p-=1;e.index=p}}let r=null,s,l;if(e.eat("as"))e.requireWhitespace(),r=xr(e);else e.index=i.end;if(e.allowWhitespace(),e.eat(",")){if(e.allowWhitespace(),s=e.readIdentifierName().name,!s)po(e.index);e.allowWhitespace()}if(e.eat("("))e.allowWhitespace(),l=ne(e),e.allowWhitespace(),e.eat(")",!0),e.allowWhitespace();e.eat("}",!0);let o=He();e.open({type:"EachBlock",start:t,end:-1,expression:i,body:o,context:r,index:s,key:l},o)}function VE(e,t){e.requireWhitespace();let n=e.readIdentifierName();if(n.name==="")po(e.index);e.allowWhitespace();let i=e.index,r;if(e.isTypeScript&&e.match("<")){let a=Ro(e.source,i,{"<":">"});r=e.source.slice(i+1,a-1),e.index=a}e.allowWhitespace(),e.eat("(",!0);let s=1;while(e.index<e.source.length&&(!e.match(")")||s!==1)){if(e.match("("))s++;if(e.match(")"))s--;e.index+=1}e.eat(")",!0);let{node:l}=zt(e,`${e.source.slice(0,e.index)} => {}`,i,!0);e.eatClosingBrace();let o=He();e.open({type:"SnippetBlock",start:t,end:-1,expression:n,typeParams:r,parameters:l.type==="ArrowFunctionExpression"?l.params:void 0,body:o},o)}function jE(e,t){let n=e.index-1,i=e.current();if(i.type==="IfBlock"){if(!e.eat("else"))nt(n,"{:else} or {:else if}");if(e.eat("if"))Qp(n);if(i.alternate)Qi(n,"{:else}");if(e.allowWhitespace(),i.alternate=He(),e.setFragment(i.alternate),e.eat("if")){e.requireWhitespace();let r=ne(e);e.eatClosingBrace();let s=He();e.open({start:t,end:-1,type:"IfBlock",elseif:!0,test:r,consequent:s,alternate:null},s)}else e.eatClosingBrace()}else if(i.type==="EachBlock"){if(!e.eat("else"))nt(n,"{:else}");if(i.fallback)Qi(n,"{:else}");e.eatClosingBrace(),i.fallback=He(),e.setFragment(i.fallback)}else if(i.type==="AwaitBlock"){let r;if(e.eat("then"))r="then";else if(e.eat("catch"))r="catch";else nt(n,"{:then ...} or {:catch ...}");if(i[r])Qi(n,`{:${r}}`);if(!e.eat("}")){e.requireWhitespace();let l=xr(e);if(r==="then")i.value=l;else i.error=l;e.eatClosingBrace()}let s=He();i[r]=s,e.setFragment(s)}else Yp(n)}function GE(e){let t=e.current(),n=ME[t.type];if(!n)tc(e.index-1);e.eat(n,!0),e.eatClosingBrace();while(t.type==="IfBlock"&&t.elseif)t.end=e.index,e.close(),t=e.current();t.end=e.index,e.close()}function WE(e){return e.type==="CallExpression"||e.type==="ChainExpression"&&e.expression.type==="CallExpression"}function HE(e,t){if(e.eat("html")){e.requireWhitespace();let n=ne(e);e.eatClosingBrace(),e.append({type:"HtmlTag",start:t,end:e.index,expression:n})}else if(e.eat("debug")){let n=[];if(!e.read(ku)){let i=ne(e),r=i.type==="SequenceExpression"?i.expressions:[i];for(let s of r){if(s.type!=="Identifier")sc(s.start);n.push(s)}e.eatClosingBrace()}e.append({type:"DebugTag",start:t,end:e.index,identifiers:n})}else if(e.eat("const")){e.requireWhitespace();let n=xr(e);e.allowWhitespace(),e.eat("=",!0),e.allowWhitespace();let i=e.index,r=ne(e),s=e.index;if(r.type==="SequenceExpression"&&!e.source.slice(i,r.start).includes("("))nc(r);e.eatClosingBrace();let l={type:"VariableDeclarator",id:n,init:r,start:n.start,end:s};e.append({type:"ConstTag",start:t,end:e.index,declaration:{type:"VariableDeclaration",kind:"const",declarations:[l],start:t+2,end:e.index-1}})}else if(e.eat("render")){e.requireWhitespace();let n=ne(e);if(!WE(n))hc(n);e.eatClosingBrace(),e.append({type:"RenderTag",start:t,end:e.index,expression:n})}else dc(e.index)}var UE=/(?:var|interface|enum)\b/y,qE=/(?:let|const|type)\b/y;function zE(e){let t=e.index;if(e.index+=1,e.allowWhitespace(),e.eat("#"))OE(e,t);else if(e.eat(":"))jE(e,t);else if(e.eat("@"))HE(e,t);else if(e.match("/")&&!e.match("/*")&&!e.match("//"))e.index+=1,GE(e);else if(!KE(e,t)){let n=ne(e);e.eatClosingBrace(),e.append({type:"ExpressionTag",start:t,end:e.index,expression:n})}}function KE(e,t){let n=e.index,i=e.matchRegex(UE);if(i)oo({start:n,end:n+i.length});if(!e.matchRegex(qE))return!1;let r=e.root.comments.length,s=Wc(e,e.source,n);if(s.type==="ExpressionStatement")return e.root.comments.length=r,!1;if(s.type!=="VariableDeclaration"||s.kind!=="let"&&s.kind!=="const")oo(s);return e.index=s.end,e.eatClosingBrace(),e.append({type:"DeclarationTag",start:t,end:e.index,declaration:s}),!0}function JE(e){let{source:t,index:n}=e;if(e.nextAngle<n)e.nextAngle=Pu(t,"<",n);if(e.nextBrace<n)e.nextBrace=Pu(t,"{",n);let i=Math.min(e.nextAngle,e.nextBrace);e.index=i;let r=t.slice(n,i);e.append({type:"Text",start:n,end:i,raw:r,data:ur(r,!1,e.entityNames)})}function Pu(e,t,n){let i=e.indexOf(t,n);return i===-1?e.length:i}function qu(e,t,n){let i=XE(e,t,n);while(i.index<i.source.length)QE(i);return YE(i)}function XE(e,t,n){let i=Fi(e);return _t(i),new _u(i.trimEnd(),i.length,n,t)}function YE(e){if(e.stack.length>1){let r=e.current();if(r.end=r.start+1,r.type==="RegularElement")ao(r,r.name);ec(r)}let{nodes:t}=e.root.fragment,n=t.findIndex((r)=>r.type==="SvelteOptions"),i=t[n];if(i?.type==="SvelteOptions"){t.splice(n,1),e.root.options=_E(i);let{nodes:r}=i.fragment;if(r.length>0)vc({start:r[0].start,end:r[r.length-1].end},i.name)}return e.root}function QE(e){if(e.match("<"))lE(e);else if(e.match("{"))zE(e);else JE(e)}function zu(e,t,n){_t(e);let i={isTypeScript:t.typescript??!1,typescript:n,loc:!1,comments:!1,root:{comments:[]}};return Hc(i,e,(r)=>_p(e,t.localExports??!0,r))}function Ku(e={}){let t=ZE(e),{typescript:n}=t;return{parse:(i,r)=>qu(i,r,t),parseModule:(i,r={})=>or(i,r,n),parseImportsExports:(i,r={})=>zu(i,r,n)}}function ZE(e){return{typescript:Hp(e.typescript),entityNames:Up(e.entities)??cu}}var Ju=Wp(sr);var Xu;function Yu(e){return Xu??=Ku({typescript:Ju}),Xu.parse(e,{css:!1})}function eS(e,t){let n=e.length+1,i=t.length+1,r=Array.from({length:n},()=>Array(i).fill(0));for(let s=0;s<n;s++)r[s][0]=s;for(let s=0;s<i;s++)r[0][s]=s;for(let s=1;s<n;s++)for(let l=1;l<i;l++){let o=e[s-1]===t[l-1]?0:1;if(r[s][l]=Math.min(r[s-1][l]+1,r[s][l-1]+1,r[s-1][l-1]+o),s>1&&l>1&&e[s-1]===t[l-2]&&e[s-2]===t[l-1])r[s][l]=Math.min(r[s][l],r[s-2][l-2]+1)}return r[n-1][i-1]}function Qu(e,t,n=3){let i,r=Number.POSITIVE_INFINITY;for(let s of t){let l=eS(e,s);if(l<r)i=s,r=l}return r<=n?i:void 0}var tS=/\s*=\s*/,nS=/^[^"'`\s]\S*$/;function iS(e){let t=e.indexOf("<");if(t===-1||!e.endsWith(">"))return e;let n=e.slice(0,t),i=e.slice(t+1,-1),r=F(i,",").map((s)=>s.trim().replace(tS," = ")).join(", ");return`${n}<${r}>`}var rS=new Set(["restProps","slot","snippet","event","typedef","callback"]),Mo=new Set(["property","type"]),Zu=new Set(["slot","snippet","typedef","callback"]);function Er(e){if(e.length===0)return;return Lt(e[es(e)].content)}function ed(e){return!e||!e.tag&&!e.continuesType&&e.content.trim()===""}function sS(e){return e.text.split(`
|
|
55
|
+
`).length===e.lines.length}function Sr(e,t){if(t<=0)return e;return e.split(`
|
|
56
56
|
`).slice(0,-t).join(`
|
|
57
|
-
`).trimEnd()}var
|
|
58
|
-
`):[],i=t?.line;for(let r of e){if(i!==void 0&&r-i>1){let l=i+1;while(l<r&&Ku(this.lines[l]))l++;if(l===r)for(let o=i+1;o<r;o++)n.push("")}let s=this.lines[r];n.push(s.indent+s.content),i=r}return ai(n)}getPrecedingDescription(e){if(e.length===0)return;let t=e[0].number,n=[],i=!1;for(let r=t-1;r>=0;r--){if(this.tagLineNumbers.has(r)||this.indentedContinuationLines.has(r)||this.consumedDescriptionLines.has(r))break;if(this.lineDescriptions.has(r))n.unshift(r),i=!0;else if(i&&!Ku(this.lines[r]))break}if(n.length===0)return;for(let r of n)this.consumedDescriptionLines.add(r);return this.trimBodyAbove?.(n[0]),this.joinBlockLines(n)}claimBodyLines(e,t){if(!zS(e)){for(let i=1;i<e.lines.length;i++)this.consumedDescriptionLines.add(e.lines[i].number);return}let n=e.lines[e.lines.length-1].number;this.trimThisBody=(i)=>t(n-i+1)}getTagDescription(e,t,n=!1){let i=gr(e),r=t!==void 0&&qS.has(t.tag)&&!gr(t.lines),s=n&&(t===void 0||!Io.has(t.tag)),l=[];for(let o=1;o<e.length;o++){let a=e[o];if((r||s)&&!this.indentedContinuationLines.has(a.number))continue;if(!this.lineDescriptions.get(a.number)?.trim()||this.consumedDescriptionLines.has(a.number))continue;l.push(a.number),this.consumedDescriptionLines.add(a.number)}if(l.length===0)return i;return this.joinBlockLines(l,{text:i??"",line:e[Yr(e)].number})}flagDescriptionAfterEvent(e,t,n,i){let{event:r}=this;if(r===void 0||r.description)return;if(r.tagLine!==void 0&&this.indentedContinuationLines.has(r.tagLine+1))return;if(i?.tag!=="event"&&!Io.has(i?.tag??""))return;if(gr(n))return;let s=t?`@${e} "${t}"`:`@${e}`;D(this.ctx,"event-description-ambiguous",r.name,`Text after @event "${r.name}" was used as the description of ${s}. Move it above the tag it describes, indent it as a continuation line, or give each event its own comment block.`,ke(this.ctx,n))}takePrecedingDescription(e){let{tag:t,name:n,lines:i}=this.tags[e],r=this.getPrecedingDescription(i);if(r)this.flagDescriptionAfterEvent(t,n,i,this.tags[e-1]);return r}finalizeEvent(){let{ctx:e,event:t}=this;if(t===void 0)return;this.event=void 0;let i=(t.type&&t.type!=="object"&&t.type!=="Object"?t.type:void 0)??(t.properties.length>0?bn(t.properties,!0):t.type||""),{tagLine:r}=t;if(r!==void 0){let p=this.tags.find((u)=>{let f=u.lines[0]?.number;return f!==void 0&&f>r&&!Io.has(u.tag)})?.lines[0].number,c=Array.from(this.lineDescriptions.keys()).sort((u,f)=>u-f).filter((u)=>u>r&&(p===void 0||u<p)&&!this.consumedDescriptionLines.has(u)&&this.lineDescriptions.get(u)?.trim());for(let u of c)this.consumedDescriptionLines.add(u);if(c.length>0)t.description=this.joinBlockLines(c,t.description?{text:t.description,line:r}:void 0)}let{name:s,description:l,source:o}=t,a=i===""&&(!e.events.has(s)||e.untypedJsDocEventNames.has(s));if(Qe(e,{name:s,detail:i,has_argument:!1,description:l,deprecated:t.deprecated,tags:t.tags.length>0?t.tags:void 0,internal:t.internal||void 0,source:o}),a)e.untypedJsDocEventNames.add(s);e.eventDescriptions.set(s,l),e.jsDocEventNames.add(s),e.jsDocEventSources.set(s,o),Je(e,"event-no-source",s,t.ignores)}finalizeTypedef(){let{ctx:e,typedef:t}=this;if(t===void 0)return;this.typedef=void 0;let{properties:n}=t,i=n.length>0,r=i?bn(n,!0):t.type||"{}",s=!i&&t.type&&YS(r)?`interface ${t.name} ${r}`:`type ${t.name} = ${r};`,l=i?n.filter(({name:o})=>!o.includes(".")&&!o.startsWith("[")).map(({name:o,type:a,optional:p,description:c})=>({name:o,type:a,optional:p===!0,...c?{description:c}:{}})):je(r,{skipIndexSignatures:!0});if(l)e.typedefMembersByName.set(t.name,l);Qu(e,t,r,s)}finalizeCallback(){let{callback:e}=this;if(e===void 0)return;this.callback=void 0;let t=`(${ye(e.params)}) => ${e.returnType||"void"}`;Qu(this.ctx,e,t,`type ${e.name} = ${t};`)}openTypeDeclaration(e){let{name:t,lines:n}=this.tags[e],i={name:this.typeDeclarationName(t),source:ke(this.ctx,n),description:this.orCommentDescription(this.getTagDescription(n,this.tags[e+1])||this.takePrecedingDescription(e)),tags:this.pendingTags.splice(0),internal:this.pendingInternal},{tags:r}=i;if(this.pendingDeprecated!==void 0)r.push({name:"deprecated",body:this.pendingDeprecated===!0?"":this.pendingDeprecated}),this.pendingDeprecated=void 0;return this.pendingInternal=!1,this.attachTrailingTag=(s)=>r.push(s),this.isFirstTag=!1,i}readExtends(e,t){let{name:n,lines:i}=this.tags[e];if(this.ctx.extends!==void 0)D(this.ctx,"extend-props-duplicate",n,`A second @extends/@extendProps tag ("${n}") overwrote the first ("${this.ctx.extends.interface}"); only one is used.`,ke(this.ctx,i));this.ctx.extends={interface:n,import:HS.test(t)?JSON.stringify(t):t},this.isFirstTag=!1}readRestProps(e,t){let{name:n,description:i}=this.tags[e],r=n?i?`${n} ${i}`:n:i,s=Lt(r),l=this.orCommentDescription(s||this.takePrecedingDescription(e)),o={type:"Element",name:t,description:l||void 0};if(this.ctx.rest_props=o,s)this.claimBodyLines(this.tags[e],(a)=>{o.description=Lt(xr(r,a))||void 0});this.isFirstTag=!1}readSlot(e,t){let{tag:n,name:i,lines:r}=this.tags[e],s=i==="-"||n==="snippet"&&i==="children"?void 0:i,l=this.orCommentDescription(this.getTagDescription(r,this.tags[e+1]));if(!l&&this.pendingTags.length===0)l=this.takePrecedingDescription(e);this.isFirstTag=!1;let o=t||"Record<string, never>",a=ke(this.ctx,r);if(!t)D(this.ctx,"slot-missing-type",s||"default",`@${n}${s?` "${s}"`:""} is missing a required {Type} annotation; falling back to "${o}".`,a);let p=this.pendingTags.splice(0),c=et(s);this.ctx.jsDocSlots.set(c,{tag:n,source:a}),kn(this.ctx,{slot_name:s,slot_props:o,slot_description:l||void 0,slot_deprecated:this.pendingDeprecated,slot_tags:p.length>0?p:void 0,slot_internal:this.pendingInternal||void 0,source:a}),this.pendingDeprecated=void 0,this.pendingInternal=!1,this.typeDeclaration=void 0,this.attachTrailingTag=(u)=>{let f=this.ctx.slots.get(c);if(f)f.tags=[...f.tags??[],u]}}readEvent(e,t){let{name:n,lines:i}=this.tags[e],r=gr(i)||this.takePrecedingDescription(e);this.finalizeEvent();let s=this.pendingTags.splice(0);this.event={name:n,type:t,tagLine:i.length>0?i[0].number:void 0,description:this.orCommentDescription(r),source:ke(this.ctx,i),tags:s,internal:this.pendingInternal,deprecated:this.pendingDeprecated,ignores:[],properties:[]},this.pendingInternal=!1,this.pendingDeprecated=void 0,this.typeDeclaration=void 0,this.attachTrailingTag=(l)=>s.push(l),this.isFirstTag=!1}readProperty(e,t){let{name:n,optional:i,default:r,lines:s}=this.tags[e],l=this.getTagDescription(s,this.tags[e+1],this.event!==void 0),o=this.event??(this.typedef&&tE(this.typedef.type)?this.typedef:void 0);if(o===void 0)return;nE(this.ctx,o.properties,{name:n,type:t,description:l,optional:i||!1,default:r},o.name,ke(this.ctx,s))}readTypedef(e,t){this.finalizeTypedef(),this.typedef={...this.openTypeDeclaration(e),type:t,properties:[]},this.typeDeclaration=this.typedef}readCallback(e){this.finalizeCallback(),this.callback={...this.openTypeDeclaration(e),params:[],returnType:void 0},this.typeDeclaration=this.callback}readGenerics(e,t){let{name:n,lines:i}=this.tags[e],r=ke(this.ctx,i);for(let s of F(n,","))Xu(this.ctx,this.generics,s.trim(),r);this.generics.usedGenericsTag=!0,Ju(this.ctx,this.generics),Yu(this.ctx,n,t||n),this.isFirstTag=!1}readTemplate(e,t){let{tags:n}=this,i=es(n[e],t),r=e+1;while(n[r]?.tag==="template")r++;let s=n[r];if((s?.tag==="typedef"||s?.tag==="callback")&&!s.name.includes("<")&&eE(n,r,i)){this.pendingTypeParameters.push(...i.map(({constraint:o})=>o));return}if(this.hasSlotOrSnippetTag&&!this.hasExtendsTag){this.ctx.deferredSlotBlockGenerics.push(...i);return}if(this.documentsFunction)return;let l=ke(this.ctx,n[e].lines);for(let o of i)Xu(this.ctx,this.generics,o.name,l),Yu(this.ctx,o.name,o.constraint);this.generics.usedTemplateTag=!0,Ju(this.ctx,this.generics),this.isFirstTag=!1}readDeprecated(e){let{text:t}=this.tags[e],{event:n}=this;if(!n&&this.typeDeclaration){let r={name:"deprecated",body:t};this.typeDeclaration.tags.push(r),this.claimBodyLines(this.tags[e],(s)=>{r.body=xr(t,s)});return}if((n?n.deprecated:this.pendingDeprecated)!==void 0)return;let i=(r)=>{if(n)n.deprecated=r;else this.pendingDeprecated=r};i(pi(t)),this.claimBodyLines(this.tags[e],(r)=>{i(pi(xr(t,r)))})}readPassthrough(e){let{tag:t,text:n,lines:i}=this.tags[e],r={name:t,body:n};if(this.claimBodyLines(this.tags[e],(s)=>{r.body=xr(n,s)}),!li.has(t)&&!Qr.has(t)){let s=KS.has(t)?void 0:qu(t,JS,t.length<=4?1:2);D(this.ctx,"jsdoc-unknown-tag",t,s?`Unknown JSDoc tag "@${t}"; did you mean "@${s}"? Passed through unchanged.`:`Unknown JSDoc tag "@${t}"; passed through unchanged. If this is a typo, fix the tag name.`,ke(this.ctx,i))}if(this.attachTrailingTag)this.attachTrailingTag(r);else this.pendingTags.push(r)}read(){let{tags:e}=this;for(let i=0;i<e.length;i++){let{tag:r,type:s,name:l,optional:o}=e[i],a=we(s);switch(this.trimBodyAbove=this.trimThisBody,this.trimThisBody=void 0,r){case"extends":case"extendProps":this.readExtends(i,a);break;case"restProps":this.readRestProps(i,a);break;case"slot":case"snippet":this.readSlot(i,a);break;case"csspart":{let p=this.getTagDescription(e[i].lines,e[i+1]);this.ctx.cssParts.push({name:l,...p?{description:p}:{}});break}case"cssprop":case"cssproperty":{let p=this.getTagDescription(e[i].lines,e[i+1]),c=e[i].default;this.ctx.cssProperties.push({name:l,...a?{type:a}:{},...c===void 0?{}:{default:c},...p?{description:p}:{}});break}case"event":this.readEvent(i,a);break;case"type":if(this.event)this.event.type=a;break;case"param":this.callback?.params.push({name:l,type:a,optional:o||!1});break;case"returns":case"return":if(this.callback)this.callback.returnType=a;break;case"property":this.readProperty(i,a);break;case"typedef":this.readTypedef(i,a);break;case"callback":this.readCallback(i);break;case"generics":this.readGenerics(i,a);break;case"template":this.readTemplate(i,a);break;case"deprecated":this.readDeprecated(i);break;case"ignore":case"internal":if(this.event)this.event.internal=!0;else if(this.typeDeclaration)this.typeDeclaration.internal=!0;else this.pendingInternal=!0;break;case"sveld-ignore":this.event?.ignores.push(l);break;case"enum":case"class":case"implements":case"this":case"namespace":case"memberof":case"module":case"file":case"overview":break;default:this.readPassthrough(i);break}if(zu.has(r))this.finalizeEvent()}this.finalizeEvent(),this.finalizeTypedef(),this.finalizeCallback();let t=[...this.pendingTags,...this.pendingDeprecated===void 0?[]:[{name:"deprecated"}],...this.pendingInternal?[{name:"internal"}]:[]];if(t.length===0)return;if(!e.some((i)=>i.tag==="event"||zu.has(i.tag)))return;for(let i of t)D(this.ctx,"jsdoc-tag-dropped",i.name,`@${i.name} could not attach to a @slot/@snippet/@event/@typedef/@callback tag in the same comment block and was dropped.`)}}function ed(e,t=e.source){if(!t)return;let n={usedGenericsTag:!1,usedTemplateTag:!1,warnedMixedGenericsTags:!1,seenGenericNames:new Set},i=t.includes("@template")?va(e):new Set;e.functionDocCommentStarts=i;let r=on(t);for(let s of r)e.jsDocBlocksByStart.set(s.start,s);for(let s of r)new Zu(e,n,s,i.has(s.start)).read()}var nd=new Set(["$state","$derived","$effect","$props","$bindable","$inspect","$host"]),iE=Array.from(nd);function td(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===95||e===36}function rE(e){if(e.includes("\\u"))return!0;for(let t of iE){let n=e.indexOf(t);while(n!==-1){if(!td(e.charCodeAt(n-1))&&!td(e.charCodeAt(n+t.length)))return!0;n=e.indexOf(t,n+1)}}return!1}function sE(e,t){for(let n=t.length-1;n>=0;n-=1)if(t[n]?.has(e))return!0;return!1}function oE(e){let t=new Set;switch(e.type){case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":if(e.type!=="ArrowFunctionExpression"&&e.id)t.add(e.id.name);for(let n of e.params)Y(n,t);break;case"BlockStatement":Sr(e.body,t);break;case"CatchClause":Y(e.param,t);break;case"EachBlock":if(Y(e.context,t),e.index)t.add(e.index);break;case"AwaitBlock":Y(e.value,t),Y(e.error,t);break}return t}function Sr(e,t){for(let n of e??[])switch(n.type){case"ImportDeclaration":for(let i of n.specifiers)t.add(i.local.name);break;case"VariableDeclaration":for(let i of n.declarations)Y(i.id,t);break;case"FunctionDeclaration":case"ClassDeclaration":if(n.id?.name)t.add(n.id.name);break;case"ExportNamedDeclaration":if(n.declaration)Sr([n.declaration],t);break}}function Lo(e,t){if(!e)return!1;let n=[...t],i=!1;return z(e,{enter(r,s){if(mi(r.type))return ie;if(Vt(r))n.push(oE(r));if(r.type==="Identifier"&&nd.has(r.name)&&Br(r,s)&&!sE(r.name,n))return i=!0,Zt},leave(r){if(Vt(r))n.pop()}}),i}function id(e){if(e.runesOptionOverride!==void 0)return e.runesOptionOverride?"runes":"legacy";let t=e.parsed;if(!t)return"legacy";if(e.source!==void 0&&!rE(e.source))return"legacy";let n=new Set;Sr(t.module?.content.body,n);let i=new Set;return Sr(t.instance?.content.body,i),Lo(t.module,[n])||Lo(t.instance,[n,i])||Lo(t.fragment,[n,i])?"runes":"legacy"}var aE=new Set(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion","TSInstantiationExpression"]);function lE(e){if(e.type!=="TSAsExpression"&&e.type!=="TSTypeAssertion")return!1;let t="typeAnnotation"in e?e.typeAnnotation:void 0;return t?.type==="TSTypeReference"&&t.typeName.type==="Identifier"&&t.typeName.name==="const"}function Er(e,t){if(!e)return;z(e,{enter(n){if(!aE.has(n.type)||!("expression"in n)||!n.expression)return;let{expression:i}=n;if(typeof i!=="object")return i;let r=t.typeAssertions.get(n);if(t.constAssertions.has(n)||r===void 0&&lE(n))t.constAssertions.add(i);else if(r!==void 0)t.typeAssertions.set(i,r);else if((n.type==="TSAsExpression"||n.type==="TSTypeAssertion")&&"typeAnnotation"in n)t.typeAssertions.set(i,n.typeAnnotation);return i}})}var pE=/\/\/(?<!^[ \t]*\*.*\/\/)\s*@ts-[^\n\r]*/gm;function cE(e){if(!e.includes("@ts-"))return e;let t=e.charCodeAt(0)===65279?1:0,{instance:n,module:i}=zi(e),r=[n,i].flatMap((o)=>o?[o.content]:[]).sort((o,a)=>o.start-a.start),s="",l=0;for(let{start:o,end:a}of r)s+=e.slice(l,o+t),s+=e.slice(o+t,a+t).replace(pE,""),l=a+t;return s+e.slice(l)}function rd(e,t,n){e.componentFilePath=n;let i=cE(t);e.source=i;let r=Uu(i);if(wl(e,r),e.parsed=r,e.scriptLanguage==="ts")Er(r.module,e.typeCasts),Er(r.instance,e.typeCasts),Er(r.fragment,e.typeCasts);e.syntaxMode=id(e);let s=r.css,l=s?i.slice(0,s.start)+" ".repeat(s.end-s.start)+i.slice(s.end):i;os(e,r.module),os(e,r.instance),ed(e,l)}class Ro{ctx=Gr();cleanup(){this.ctx=Gr()}parseSvelteComponent(e,t){let{component:n,pending:i}=this.parse(e,t);if(i)n[Me]={...n[Me]??{canonicalPropNames:[],localTypeDeclarations:[],typeImportStatements:[]},...i};return n}parse(e,t){this.cleanup();let n=this.ctx;rd(n,e,t.filePath),nu(n);let i=Ll(n);return Kc(n,i)}}var uE=/\.$/,Mo="resolving it needs file access (generateBundle or the CLI)";function dE(e,t={}){let n=e[Me];if(!n)return e;let{pendingCallDefaultCandidates:i,pendingConstDefaultCandidates:r,pendingContextKeyCandidates:s,pendingDispatchEscapeCandidates:l,deferredEventNoSourceDiagnostics:o,untypedJsDocEventNames:a,...p}=n,c=(i??[]).filter((b)=>b.importSource!==void 0);if(c.length===0&&!r&&!s&&!l&&!o)return e;let u=e.filePath,f=t.filePath??(typeof u==="string"?u:""),h=[],m=(b,X,he,Ie)=>{h.push(si({component:f,kind:"cross-file-unresolved",name:b,message:X,...he?{source:he}:{},...Ie?{ignored:Ie}:{}}))},g=(b,X)=>(b==="props"?e.props:e.moduleExports).find((he)=>he.name===X)?.source,y=(b)=>b==="props"?"Prop":"Module export";for(let b of s??[]){let X=un(b);m(X,`setContext key \`${X}\` is imported from "${b.importSource}"; ${Mo}, so the context is omitted.`,b.source)}for(let b of r??[])m(b.propName,`${y(b.location)} "${b.propName}" defaults to \`${un(b)}\` imported from "${b.importSource}"; ${Mo}, so the default shows the identifier and its type isn't read.`,g(b.location,b.propName));for(let b of c)m(b.propName,`${y(b.location)} "${b.propName}" defaults to \`${b.calleeName}()\` imported from "${b.importSource}"; ${Mo}, so its return type isn't read and the prop falls back to "any".`,g(b.location,b.propName));for(let b of l??[])m(b.calleeText,`\`${b.dispatcherName}\` is passed to \`${b.calleeText}\`, imported from "${b.importSource}"; reading the events it dispatches needs file access (generateBundle or the CLI), so they're omitted.`,b.source,b.ignored);let E=Array.from(new Set((l??[]).map((b)=>`\`${b.calleeText}\``))).join(", "),v=(o??[]).map((b)=>E?{...b,message:`${b.message.replace(uE,"")} in this file; ${E} may dispatch it, but imported helpers aren't read without file access.`}:b),M={...e,diagnostics:[...e.diagnostics??[],...v,...h]};return M[Me]=p,M}var od="sveld",ad="0.40.5";var Oo="5.58.0";var ld=1;function rt(e){return e.some((t)=>t.internal)?e.filter((t)=>!t.internal):e}function hE(e){return{...e,props:rt(e.props),moduleExports:rt(e.moduleExports),slots:rt(e.slots),events:rt(e.events),typedefs:rt(e.typedefs),...e.contexts?{contexts:rt(e.contexts).map((t)=>({...t,properties:rt(t.properties)}))}:{}}}function Bo(e,t={}){let n=Array.from(e.values(),(s)=>{let{diagnostics:l,...o}=s;return hE(o)}).sort((s,l)=>Fe(s.moduleName,l.moduleName)),i={schemaVersion:ld,generator:{name:od,version:ad,svelteVersion:Oo},total:n.length,components:n},r=t.entryExports?rt(t.entryExports):void 0;if(r&&r.length>0)i.totalExports=r.length,i.exports=r;return i}var mE=" ",yE=120,gE=/\binterface\s+[A-Za-z_$][\w$]*(\s*<[^{};]*>)?\s*$/,xE=200,dd=/\s/,SE=/\s{2}|[^\S ]/,EE=/["'`{}/]/g,TE=/["'`{};/]/g,fd=9,Fo=10,vE=13,zn=32,vr=34,bE=38,br=39,CE=40,AE=41,Tr=42,pd=46,jo=47,hd=59,PE=62,wE=91,Go=92,kE=93,Cr=96,Wo=123,_E=124,Ho=125;function NE(e){return gE.test($E(e,xE))}var cd=[""];function DE(e){let t=cd[e];if(t===void 0)t=mE.repeat(e),cd[e]=t;return t}function $E(e,t){let n="";for(let i=e.length-1;i>=0&&n.length<t;i--)n=e[i]+n;return n.length>t?n.slice(-t):n}function IE(e){if(e.length===0)return!1;let t=e[e.length-1];return t.charCodeAt(t.length-1)===Fo}function LE(e){while(e.length>0){let t=e[e.length-1],n=t.length;while(n>0){let i=t.charCodeAt(n-1);if(i!==zn&&i!==fd)break;n--}if(n===t.length)return;if(n===0){e.pop();continue}e[e.length-1]=t.slice(0,n);return}}function RE(e){while(e.length>0){let t=e[e.length-1];if(!dd.test(t[t.length-1]))return;let n=t.trimEnd();if(n.length===t.length)return;if(n.length===0){e.pop();continue}e[e.length-1]=n;return}}function ME(e){if(e.includes("{"))return!1;let t=0,n=0;for(let i=0;i<e.length;i++){let r=e.charCodeAt(i);if(t!==0){if(r===t&&e.charCodeAt(i-1)!==Go)t=0;continue}if(r===vr||r===br||r===Cr){t=r;continue}if(r===hd&&++n>=2)return!0}return!1}function OE(e){if(!SE.test(e))return e.trimEnd();let t="",n=null,i=!1;for(let r=0;r<e.length;r++){let s=e[r],l=e[r-1];if(n){if(t+=s,n==="double"&&s==='"'&&l!=="\\"||n==="single"&&s==="'"&&l!=="\\"||n==="template"&&s==="`"&&l!=="\\")n=null;i=!1;continue}if(s==='"'||s==="'"||s==="`"){n=s==='"'?"double":s==="'"?"single":"template",t+=s,i=!1;continue}if(dd.test(s)){if(!i&&t.length>0)t+=" ",i=!0;continue}t+=s,i=!1}return t.trimEnd()}function md(e,t){let n=e[t],i=e.indexOf(n,t+1);while(i!==-1&&e.charCodeAt(i-1)===Go)i=e.indexOf(n,i+1);return i}function yd(e,t){let n=e.indexOf("*/",t+1);return n===-1?-1:n+1}function BE(e){let t=new Map,n=[],i=EE,r=0;while(r<e.length){if(i.lastIndex=r,!i.test(e))break;r=i.lastIndex-1;let s=e.charCodeAt(r);if(s===jo){if(e.charCodeAt(r+1)===Tr){let l=yd(e,r);if(l===-1)break;r=l}}else if(s===vr||s===br||s===Cr){let l=md(e,r);if(l===-1)break;r=l}else if(s===Wo)n.push(r);else if(s===Ho&&n.length>0)t.set(n.pop(),r);r++}return t}function FE(e,t,n){for(let i=t;i<n;i++)if(!Vo(e.charCodeAt(i)))return!1;return!0}function Vo(e){if(e<=zn)return e===zn||e>=fd&&e<=vE;if(e<160)return!1;return e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288||e===65279}function gd(e,t,n,i){let r=[],s=TE,l=t,o=t;while(o<n){if(s.lastIndex=o,!s.test(e))break;if(o=s.lastIndex-1,o>=n)break;let a=e.charCodeAt(o);if(a===jo){if(e.charCodeAt(o+1)===Tr){let p=yd(e,o);if(p===-1)break;o=p}o++;continue}if(a===vr||a===br||a===Cr){let p=md(e,o);if(p===-1)break;o=p+1;continue}if(a===Wo){let p=i.get(o);if(p===void 0||p>=n){o++;continue}if(l<o)r.push(e.slice(l,o));let c=o+1;if(FE(e,c,p)){r.push("{}"),o=p+1,l=o;continue}let u=e.slice(c,p),f=e.charCodeAt(c)===Fo;if(!f&&!u.includes("/*")&&!ME(u)&&!NE(r)){let h=gd(e,c,p,i),m=h.trim();if(!m.includes(`
|
|
59
|
-
`)){let g=m.endsWith(";")?m.slice(0,-1):m,y=`{ ${
|
|
57
|
+
`).trimEnd()}var oS=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"]),aS=[...pi,...ts,"type","param","returns","typedef","property","callback","template","generics","slot","snippet","event","restProps","extends","extendProps","deprecated","ignore","internal","sveld-ignore","csspart","cssprop"],lS=/;$/;function pS(e){let t=e.trim().replace(lS,"").trimEnd();if(!t.startsWith("{")||!t.endsWith("}"))return!1;return Ke(t,0)===t.length-1}var cS=/[\w$]+/g,uS=new Set(["property","param","returns","return"]);function dS(e,t,n){let i=[e[t].type];for(let s=t+1;uS.has(e[s]?.tag);s++)i.push(e[s].type);let r=new Set(i.join(" ").match(cS));return n.some(({name:s})=>r.has(s))}function fS(e){let t=e.trim();return!t||t==="object"||t==="Object"}function td(e,t){if(t.usedGenericsTag&&t.usedTemplateTag&&!t.warnedMixedGenericsTags){t.warnedMixedGenericsTags=!0;let n=e.componentFilePath?` in ${e.componentFilePath}`:"";console.warn(`Warning: Both @generics and @template tags are used to declare component generics${n}; their declarations are combined in the order encountered.`)}}function nd(e,t,n,i){if(t.seenGenericNames.has(n))D(e,"generics-conflict",n,`Duplicate generic name "${n}".`,i);else t.seenGenericNames.add(n)}function id(e,t,n){if(e.generics){let r=F(e.generics[0],",").map((s)=>s.trim()).indexOf(t.trim());if(r!==-1){let s=F(e.generics[1],",").map((l)=>l.trim());s[r]=n,e.generics=[e.generics[0],s.join(", ")];return}}bi(e,t,n)}function rd(e,{name:t,description:n,tags:i,internal:r,source:s},l,o){if(e.typedefs.has(t))D(e,"typedef-duplicate",t,`Duplicate typedef/callback name "${t}"; the later declaration overwrites the earlier one.`,s);e.typedefs.set(t,{type:l,name:t,description:n||void 0,ts:o,tags:i.length>0?i:void 0,...r?{internal:!0}:{},source:s})}function hS(e,t,n,i,r){let s=t.findIndex((l)=>l.name===n.name);if(s===-1)t.push(n);else{let l=i?` of "${i}"`:"";D(e,"property-duplicate",n.name,`Duplicate property "${n.name}"${l}; the later declaration overwrites the earlier one.`,r),t[s]=n}}class sd{tags;lines;commentDescription;commentDescriptionUsed=!1;isFirstTag=!0;event;typedef;callback;typeDeclaration;attachTrailingTag;pendingTags=[];pendingDeprecated;pendingInternal=!1;pendingTypeParameters=[];lineDescriptions=new Map;tagLineNumbers=new Set;consumedDescriptionLines=new Set;indentedContinuationLines=new Set;trimBodyAbove;trimThisBody;hasSlotOrSnippetTag;hasExtendsTag;ctx;generics;documentsFunction;constructor(e,t,n,i){this.ctx=e,this.generics=t,this.documentsFunction=i;let{tags:r,lines:s}=n;this.tags=r,this.lines=s,this.commentDescription=n.description,this.hasSlotOrSnippetTag=r.some((a)=>a.tag==="slot"||a.tag==="snippet"),this.hasExtendsTag=r.some((a)=>a.tag==="extends"||a.tag==="extendProps");for(let a of r)if(a.lines.length>0)this.tagLineNumbers.add(a.lines[0].number);for(let a of s)if(a.continuesType)this.tagLineNumbers.add(a.number);let l=!1,o=!1;for(let a of s){if(!a.tag&&!a.continuesType&&a.content&&(o||a.content.trim()!=="}"))this.lineDescriptions.set(a.number,a.content);if(a.tag!==void 0||a.continuesType)l=!0;else if(!a.content.trim());else if(l&&(a.indent||o))this.indentedContinuationLines.add(a.number);else l=!1;if(on(a.content))o=!o}}orCommentDescription(e){if(e||!this.isFirstTag||this.commentDescriptionUsed||!this.commentDescription)return e;return this.commentDescriptionUsed=!0,this.commentDescription}typeDeclarationName(e){if(this.pendingTypeParameters.length===0)return iS(e);let t=`${e}<${this.pendingTypeParameters.join(", ")}>`;return this.pendingTypeParameters.length=0,t}joinBlockLines(e,t){let n=t?t.text.split(`
|
|
58
|
+
`):[],i=t?.line;for(let r of e){if(i!==void 0&&r-i>1){let l=i+1;while(l<r&&ed(this.lines[l]))l++;if(l===r)for(let o=i+1;o<r;o++)n.push("")}let s=this.lines[r];n.push(s.indent+s.content),i=r}return li(n)}getPrecedingDescription(e){if(e.length===0)return;let t=e[0].number,n=[],i=!1;for(let r=t-1;r>=0;r--){if(this.tagLineNumbers.has(r)||this.indentedContinuationLines.has(r)||this.consumedDescriptionLines.has(r))break;if(this.lineDescriptions.has(r))n.unshift(r),i=!0;else if(i&&!ed(this.lines[r]))break}if(n.length===0)return;for(let r of n)this.consumedDescriptionLines.add(r);return this.trimBodyAbove?.(n[0]),this.joinBlockLines(n)}claimBodyLines(e,t){if(!sS(e)){for(let i=1;i<e.lines.length;i++)this.consumedDescriptionLines.add(e.lines[i].number);return}let n=e.lines[e.lines.length-1].number;this.trimThisBody=(i)=>t(n-i+1)}getTagDescription(e,t,n=!1){let i=Er(e),r=t!==void 0&&rS.has(t.tag)&&!Er(t.lines),s=n&&(t===void 0||!Mo.has(t.tag)),l=[];for(let o=1;o<e.length;o++){let a=e[o];if((r||s)&&!this.indentedContinuationLines.has(a.number))continue;if(!this.lineDescriptions.get(a.number)?.trim()||this.consumedDescriptionLines.has(a.number))continue;l.push(a.number),this.consumedDescriptionLines.add(a.number)}if(l.length===0)return i;return this.joinBlockLines(l,{text:i??"",line:e[es(e)].number})}flagDescriptionAfterEvent(e,t,n,i){let{event:r}=this;if(r===void 0||r.description)return;if(r.tagLine!==void 0&&this.indentedContinuationLines.has(r.tagLine+1))return;if(i?.tag!=="event"&&!Mo.has(i?.tag??""))return;if(Er(n))return;let s=t?`@${e} "${t}"`:`@${e}`;D(this.ctx,"event-description-ambiguous",r.name,`Text after @event "${r.name}" was used as the description of ${s}. Move it above the tag it describes, indent it as a continuation line, or give each event its own comment block.`,_e(this.ctx,n))}takePrecedingDescription(e){let{tag:t,name:n,lines:i}=this.tags[e],r=this.getPrecedingDescription(i);if(r)this.flagDescriptionAfterEvent(t,n,i,this.tags[e-1]);return r}finalizeEvent(){let{ctx:e,event:t}=this;if(t===void 0)return;this.event=void 0;let i=(t.type&&t.type!=="object"&&t.type!=="Object"?t.type:void 0)??(t.properties.length>0?Cn(t.properties,!0):t.type||""),{tagLine:r}=t;if(r!==void 0){let p=this.tags.find((u)=>{let f=u.lines[0]?.number;return f!==void 0&&f>r&&!Mo.has(u.tag)})?.lines[0].number,c=Array.from(this.lineDescriptions.keys()).sort((u,f)=>u-f).filter((u)=>u>r&&(p===void 0||u<p)&&!this.consumedDescriptionLines.has(u)&&this.lineDescriptions.get(u)?.trim());for(let u of c)this.consumedDescriptionLines.add(u);if(c.length>0)t.description=this.joinBlockLines(c,t.description?{text:t.description,line:r}:void 0)}let{name:s,description:l,source:o}=t,a=i===""&&(!e.events.has(s)||e.untypedJsDocEventNames.has(s));if(Qe(e,{name:s,detail:i,has_argument:!1,description:l,deprecated:t.deprecated,tags:t.tags.length>0?t.tags:void 0,internal:t.internal||void 0,source:o}),a)e.untypedJsDocEventNames.add(s);e.eventDescriptions.set(s,l),e.jsDocEventNames.add(s),e.jsDocEventSources.set(s,o),Je(e,"event-no-source",s,t.ignores)}finalizeTypedef(){let{ctx:e,typedef:t}=this;if(t===void 0)return;this.typedef=void 0;let{properties:n}=t,i=n.length>0,r=i?Cn(n,!0):t.type||"{}",s=!i&&t.type&&pS(r)?`interface ${t.name} ${r}`:`type ${t.name} = ${r};`,l=i?n.filter(({name:o})=>!o.includes(".")&&!o.startsWith("[")).map(({name:o,type:a,optional:p,description:c})=>({name:o,type:a,optional:p===!0,...c?{description:c}:{}})):Ge(r,{skipIndexSignatures:!0});if(l)e.typedefMembersByName.set(t.name,l);rd(e,t,r,s)}finalizeCallback(){let{callback:e}=this;if(e===void 0)return;this.callback=void 0;let t=`(${ge(e.params)}) => ${e.returnType||"void"}`;rd(this.ctx,e,t,`type ${e.name} = ${t};`)}openTypeDeclaration(e){let{name:t,lines:n}=this.tags[e],i={name:this.typeDeclarationName(t),source:_e(this.ctx,n),description:this.orCommentDescription(this.getTagDescription(n,this.tags[e+1])||this.takePrecedingDescription(e)),tags:this.pendingTags.splice(0),internal:this.pendingInternal},{tags:r}=i;if(this.pendingDeprecated!==void 0)r.push({name:"deprecated",body:this.pendingDeprecated===!0?"":this.pendingDeprecated}),this.pendingDeprecated=void 0;return this.pendingInternal=!1,this.attachTrailingTag=(s)=>r.push(s),this.isFirstTag=!1,i}readExtends(e,t){let{name:n,lines:i}=this.tags[e];if(this.ctx.extends!==void 0)D(this.ctx,"extend-props-duplicate",n,`A second @extends/@extendProps tag ("${n}") overwrote the first ("${this.ctx.extends.interface}"); only one is used.`,_e(this.ctx,i));this.ctx.extends={interface:n,import:nS.test(t)?JSON.stringify(t):t},this.isFirstTag=!1}readRestProps(e,t){let{name:n,description:i}=this.tags[e],r=n?i?`${n} ${i}`:n:i,s=Lt(r),l=this.orCommentDescription(s||this.takePrecedingDescription(e)),o={type:"Element",name:t,description:l||void 0};if(this.ctx.rest_props=o,s)this.claimBodyLines(this.tags[e],(a)=>{o.description=Lt(Sr(r,a))||void 0});this.isFirstTag=!1}readSlot(e,t){let{tag:n,name:i,lines:r}=this.tags[e],s=i==="-"||n==="snippet"&&i==="children"?void 0:i,l=this.orCommentDescription(this.getTagDescription(r,this.tags[e+1]));if(!l&&this.pendingTags.length===0)l=this.takePrecedingDescription(e);this.isFirstTag=!1;let o=t||"Record<string, never>",a=_e(this.ctx,r);if(!t)D(this.ctx,"slot-missing-type",s||"default",`@${n}${s?` "${s}"`:""} is missing a required {Type} annotation; falling back to "${o}".`,a);let p=this.pendingTags.splice(0),c=et(s);this.ctx.jsDocSlots.set(c,{tag:n,source:a}),_n(this.ctx,{slot_name:s,slot_props:o,slot_description:l||void 0,slot_deprecated:this.pendingDeprecated,slot_tags:p.length>0?p:void 0,slot_internal:this.pendingInternal||void 0,source:a}),this.pendingDeprecated=void 0,this.pendingInternal=!1,this.typeDeclaration=void 0,this.attachTrailingTag=(u)=>{let f=this.ctx.slots.get(c);if(f)f.tags=[...f.tags??[],u]}}readEvent(e,t){let{name:n,lines:i}=this.tags[e],r=Er(i)||this.takePrecedingDescription(e);this.finalizeEvent();let s=this.pendingTags.splice(0);this.event={name:n,type:t,tagLine:i.length>0?i[0].number:void 0,description:this.orCommentDescription(r),source:_e(this.ctx,i),tags:s,internal:this.pendingInternal,deprecated:this.pendingDeprecated,ignores:[],properties:[]},this.pendingInternal=!1,this.pendingDeprecated=void 0,this.typeDeclaration=void 0,this.attachTrailingTag=(l)=>s.push(l),this.isFirstTag=!1}readProperty(e,t){let{name:n,optional:i,default:r,lines:s}=this.tags[e],l=this.getTagDescription(s,this.tags[e+1],this.event!==void 0),o=this.event??(this.typedef&&fS(this.typedef.type)?this.typedef:void 0);if(o===void 0)return;hS(this.ctx,o.properties,{name:n,type:t,description:l,optional:i||!1,default:r},o.name,_e(this.ctx,s))}readTypedef(e,t){this.finalizeTypedef(),this.typedef={...this.openTypeDeclaration(e),type:t,properties:[]},this.typeDeclaration=this.typedef}readCallback(e){this.finalizeCallback(),this.callback={...this.openTypeDeclaration(e),params:[],returnType:void 0},this.typeDeclaration=this.callback}readGenerics(e,t){let{name:n,lines:i}=this.tags[e],r=_e(this.ctx,i);for(let s of F(n,","))nd(this.ctx,this.generics,s.trim(),r);this.generics.usedGenericsTag=!0,td(this.ctx,this.generics),id(this.ctx,n,t||n),this.isFirstTag=!1}readTemplate(e,t){let{tags:n}=this,i=is(n[e],t),r=e+1;while(n[r]?.tag==="template")r++;let s=n[r];if((s?.tag==="typedef"||s?.tag==="callback")&&!s.name.includes("<")&&dS(n,r,i)){this.pendingTypeParameters.push(...i.map(({constraint:o})=>o));return}if(this.hasSlotOrSnippetTag&&!this.hasExtendsTag){this.ctx.deferredSlotBlockGenerics.push(...i);return}if(this.documentsFunction)return;let l=_e(this.ctx,n[e].lines);for(let o of i)nd(this.ctx,this.generics,o.name,l),id(this.ctx,o.name,o.constraint);this.generics.usedTemplateTag=!0,td(this.ctx,this.generics),this.isFirstTag=!1}readDeprecated(e){let{text:t}=this.tags[e],{event:n}=this;if(!n&&this.typeDeclaration){let r={name:"deprecated",body:t};this.typeDeclaration.tags.push(r),this.claimBodyLines(this.tags[e],(s)=>{r.body=Sr(t,s)});return}if((n?n.deprecated:this.pendingDeprecated)!==void 0)return;let i=(r)=>{if(n)n.deprecated=r;else this.pendingDeprecated=r};i(ci(t)),this.claimBodyLines(this.tags[e],(r)=>{i(ci(Sr(t,r)))})}readPassthrough(e){let{tag:t,text:n,lines:i}=this.tags[e],r={name:t,body:n};if(this.claimBodyLines(this.tags[e],(s)=>{r.body=Sr(n,s)}),!pi.has(t)&&!ts.has(t)){let s=oS.has(t)?void 0:Qu(t,aS,t.length<=4?1:2);D(this.ctx,"jsdoc-unknown-tag",t,s?`Unknown JSDoc tag "@${t}"; did you mean "@${s}"? Passed through unchanged.`:`Unknown JSDoc tag "@${t}"; passed through unchanged. If this is a typo, fix the tag name.`,_e(this.ctx,i))}if(this.attachTrailingTag)this.attachTrailingTag(r);else this.pendingTags.push(r)}read(){let{tags:e}=this;for(let i=0;i<e.length;i++){let{tag:r,type:s,name:l,optional:o}=e[i],a=ke(s);switch(this.trimBodyAbove=this.trimThisBody,this.trimThisBody=void 0,r){case"extends":case"extendProps":this.readExtends(i,a);break;case"restProps":this.readRestProps(i,a);break;case"slot":case"snippet":this.readSlot(i,a);break;case"csspart":{let p=this.getTagDescription(e[i].lines,e[i+1]);this.ctx.cssParts.push({name:l,...p?{description:p}:{}});break}case"cssprop":case"cssproperty":{let p=this.getTagDescription(e[i].lines,e[i+1]),c=e[i].default;this.ctx.cssProperties.push({name:l,...a?{type:a}:{},...c===void 0?{}:{default:c},...p?{description:p}:{}});break}case"event":this.readEvent(i,a);break;case"type":if(this.event)this.event.type=a;break;case"param":this.callback?.params.push({name:l,type:a,optional:o||!1});break;case"returns":case"return":if(this.callback)this.callback.returnType=a;break;case"property":this.readProperty(i,a);break;case"typedef":this.readTypedef(i,a);break;case"callback":this.readCallback(i);break;case"generics":this.readGenerics(i,a);break;case"template":this.readTemplate(i,a);break;case"deprecated":this.readDeprecated(i);break;case"ignore":case"internal":if(this.event)this.event.internal=!0;else if(this.typeDeclaration)this.typeDeclaration.internal=!0;else this.pendingInternal=!0;break;case"sveld-ignore":this.event?.ignores.push(l);break;case"enum":case"class":case"implements":case"this":case"namespace":case"memberof":case"module":case"file":case"overview":break;default:this.readPassthrough(i);break}if(Zu.has(r))this.finalizeEvent()}this.finalizeEvent(),this.finalizeTypedef(),this.finalizeCallback();let t=[...this.pendingTags,...this.pendingDeprecated===void 0?[]:[{name:"deprecated"}],...this.pendingInternal?[{name:"internal"}]:[]];if(t.length===0)return;if(!e.some((i)=>i.tag==="event"||Zu.has(i.tag)))return;for(let i of t)D(this.ctx,"jsdoc-tag-dropped",i.name,`@${i.name} could not attach to a @slot/@snippet/@event/@typedef/@callback tag in the same comment block and was dropped.`)}}function od(e,t=e.source){if(!t)return;let n={usedGenericsTag:!1,usedTemplateTag:!1,warnedMixedGenericsTags:!1,seenGenericNames:new Set},i=t.includes("@template")?wa(e):new Set;e.functionDocCommentStarts=i;let r=an(t);for(let s of r)e.jsDocBlocksByStart.set(s.start,s);for(let s of r)new sd(e,n,s,i.has(s.start)).read()}var ld=new Set(["$state","$derived","$effect","$props","$bindable","$inspect","$host"]),mS=Array.from(ld);function ad(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===95||e===36}function yS(e){if(e.includes("\\u"))return!0;for(let t of mS){let n=e.indexOf(t);while(n!==-1){if(!ad(e.charCodeAt(n-1))&&!ad(e.charCodeAt(n+t.length)))return!0;n=e.indexOf(t,n+1)}}return!1}function gS(e,t){for(let n=t.length-1;n>=0;n-=1)if(t[n]?.has(e))return!0;return!1}function xS(e){let t=new Set;switch(e.type){case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":if(e.type!=="ArrowFunctionExpression"&&e.id)t.add(e.id.name);for(let n of e.params)Q(n,t);break;case"BlockStatement":Tr(e.body,t);break;case"CatchClause":Q(e.param,t);break;case"EachBlock":if(Q(e.context,t),e.index)t.add(e.index);break;case"AwaitBlock":Q(e.value,t),Q(e.error,t);break}return t}function Tr(e,t){for(let n of e??[])switch(n.type){case"ImportDeclaration":for(let i of n.specifiers)t.add(i.local.name);break;case"VariableDeclaration":for(let i of n.declarations)Q(i.id,t);break;case"FunctionDeclaration":case"ClassDeclaration":if(n.id?.name)t.add(n.id.name);break;case"ExportNamedDeclaration":if(n.declaration)Tr([n.declaration],t);break;case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExportAllDeclaration":case"ExportDefaultDeclaration":case"ExpressionStatement":case"ForInStatement":case"ForOfStatement":case"ForStatement":case"IfStatement":case"LabeledStatement":case"ReturnStatement":case"StaticBlock":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"TSDeclareFunction":case"TSEnumDeclaration":case"TSExportAssignment":case"TSImportEqualsDeclaration":case"TSInterfaceDeclaration":case"TSModuleDeclaration":case"TSNamespaceExportDeclaration":case"TSTypeAliasDeclaration":case"WhileStatement":case"WithStatement":break}}function Oo(e,t){if(!e)return!1;let n=[...t],i=!1;return K(e,{enter(r,s){if(mi(r.type))return re;if(jt(r))n.push(xS(r));if(r.type==="Identifier"&&ld.has(r.name)&&Vr(r,s)&&!gS(r.name,n))return i=!0,en},leave(r){if(jt(r))n.pop()}}),i}function pd(e){if(e.runesOptionOverride!==void 0)return e.runesOptionOverride?"runes":"legacy";let t=e.parsed;if(!t)return"legacy";if(e.source!==void 0&&!yS(e.source))return"legacy";let n=new Set;Tr(t.module?.content.body,n);let i=new Set;return Tr(t.instance?.content.body,i),Oo(t.module,[n])||Oo(t.instance,[n,i])||Oo(t.fragment,[n,i])?"runes":"legacy"}var ES=new Set(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion","TSInstantiationExpression"]);function SS(e){if(e.type!=="TSAsExpression"&&e.type!=="TSTypeAssertion")return!1;let t="typeAnnotation"in e?e.typeAnnotation:void 0;return t?.type==="TSTypeReference"&&t.typeName.type==="Identifier"&&t.typeName.name==="const"}function br(e,t){if(!e)return;K(e,{enter(n){if(!ES.has(n.type)||!("expression"in n)||!n.expression)return;let{expression:i}=n;if(typeof i!=="object")return i;let r=t.typeAssertions.get(n);if(t.constAssertions.has(n)||r===void 0&&SS(n))t.constAssertions.add(i);else if(r!==void 0)t.typeAssertions.set(i,r);else if((n.type==="TSAsExpression"||n.type==="TSTypeAssertion")&&"typeAnnotation"in n)t.typeAssertions.set(i,n.typeAnnotation);return i}})}var TS=/\/\/(?<!^[ \t]*\*.*\/\/)\s*@ts-[^\n\r]*/gm;function bS(e){if(!e.includes("@ts-"))return e;let t=e.charCodeAt(0)===65279?1:0,{instance:n,module:i}=Ji(e),r=[n,i].flatMap((o)=>o?[o.content]:[]).sort((o,a)=>o.start-a.start),s="",l=0;for(let{start:o,end:a}of r)s+=e.slice(l,o+t),s+=e.slice(o+t,a+t).replace(TS,""),l=a+t;return s+e.slice(l)}function cd(e,t,n){e.componentFilePath=n;let i=bS(t);e.source=i;let r=Yu(i);if(Il(e,r),e.parsed=r,e.scriptLanguage==="ts")br(r.module,e.typeCasts),br(r.instance,e.typeCasts),br(r.fragment,e.typeCasts);e.syntaxMode=pd(e);let s=r.css,l=s?i.slice(0,s.start)+" ".repeat(s.end-s.start)+i.slice(s.end):i;cs(e,r.module),cs(e,r.instance),od(e,l)}class Bo{ctx=Hr();cleanup(){this.ctx=Hr()}parseSvelteComponent(e,t){let{component:n,pending:i}=this.parse(e,t);if(i)n[Oe]={...n[Oe]??{canonicalPropNames:[],localTypeDeclarations:[],typeImportStatements:[]},...i};return n}parse(e,t){this.cleanup();let n=this.ctx;cd(n,e,t.filePath),lu(n);let i=Vl(n);return eu(n,i)}}var vS=/\.$/,Fo="resolving it needs file access (generateBundle or the CLI)";function CS(e,t={}){let n=e[Oe];if(!n)return e;let{pendingCallDefaultCandidates:i,pendingConstDefaultCandidates:r,pendingContextKeyCandidates:s,pendingDispatchEscapeCandidates:l,deferredEventNoSourceDiagnostics:o,untypedJsDocEventNames:a,...p}=n,c=(i??[]).filter((v)=>v.importSource!==void 0);if(c.length===0&&!r&&!s&&!l&&!o)return e;let u="filePath"in e?e.filePath:void 0,f=t.filePath??(typeof u==="string"?u:""),h=[],m=(v,Y,me,Le)=>{h.push(oi({component:f,kind:"cross-file-unresolved",name:v,message:Y,...me?{source:me}:{},...Le?{ignored:Le}:{}}))},g=(v,Y)=>(v==="props"?e.props:e.moduleExports).find((me)=>me.name===Y)?.source,y=(v)=>v==="props"?"Prop":"Module export";for(let v of s??[]){let Y=dn(v);m(Y,`setContext key \`${Y}\` is imported from "${v.importSource}"; ${Fo}, so the context is omitted.`,v.source)}for(let v of r??[])m(v.propName,`${y(v.location)} "${v.propName}" defaults to \`${dn(v)}\` imported from "${v.importSource}"; ${Fo}, so the default shows the identifier and its type isn't read.`,g(v.location,v.propName));for(let v of c)m(v.propName,`${y(v.location)} "${v.propName}" defaults to \`${v.calleeName}()\` imported from "${v.importSource}"; ${Fo}, so its return type isn't read and the prop falls back to "any".`,g(v.location,v.propName));for(let v of l??[])m(v.calleeText,`\`${v.dispatcherName}\` is passed to \`${v.calleeText}\`, imported from "${v.importSource}"; reading the events it dispatches needs file access (generateBundle or the CLI), so they're omitted.`,v.source,v.ignored);let S=Array.from(new Set((l??[]).map((v)=>`\`${v.calleeText}\``))).join(", "),b=(o??[]).map((v)=>S?{...v,message:`${v.message.replace(vS,"")} in this file; ${S} may dispatch it, but imported helpers aren't read without file access.`}:v),M={...e,diagnostics:[...e.diagnostics??[],...b,...h]};return M[Oe]=p,M}var dd="sveld",fd="0.40.6";var Vo="5.59.1";var hd=1;function rt(e){return e.some((t)=>t.internal)?e.filter((t)=>!t.internal):e}function wS(e){return{...e,props:rt(e.props),moduleExports:rt(e.moduleExports),slots:rt(e.slots),events:rt(e.events),typedefs:rt(e.typedefs),...e.contexts?{contexts:rt(e.contexts).map((t)=>({...t,properties:rt(t.properties)}))}:{}}}function jo(e,t={}){let n=Array.from(e.values(),(s)=>{let{diagnostics:l,...o}=s;return wS(o)}).sort((s,l)=>Ve(s.moduleName,l.moduleName)),i={schemaVersion:hd,generator:{name:dd,version:fd,svelteVersion:Vo},total:n.length,components:n},r=t.entryExports?rt(t.entryExports):void 0;if(r&&r.length>0)i.totalExports=r.length,i.exports=r;return i}var PS=" ",kS=120,_S=/\binterface\s+[A-Za-z_$][\w$]*(\s*<[^{};]*>)?\s*$/,NS=200,xd=/\s/,DS=/\s{2}|[^\S ]/,$S=/["'`{}/]/g,IS=/["'`{};/]/g,Ed=9,Go=10,LS=13,Kn=32,Cr=34,RS=38,Ar=39,MS=40,OS=41,vr=42,md=46,Ho=47,Sd=59,BS=62,FS=91,Uo=92,VS=93,wr=96,qo=123,jS=124,zo=125;function GS(e){return _S.test(HS(e,NS))}var yd=[""];function WS(e){let t=yd[e];if(t===void 0)t=PS.repeat(e),yd[e]=t;return t}function HS(e,t){let n="";for(let i=e.length-1;i>=0&&n.length<t;i--)n=e[i]+n;return n.length>t?n.slice(-t):n}function US(e){if(e.length===0)return!1;let t=e[e.length-1];return t.charCodeAt(t.length-1)===Go}function qS(e){while(e.length>0){let t=e[e.length-1],n=t.length;while(n>0){let i=t.charCodeAt(n-1);if(i!==Kn&&i!==Ed)break;n--}if(n===t.length)return;if(n===0){e.pop();continue}e[e.length-1]=t.slice(0,n);return}}function zS(e){while(e.length>0){let t=e[e.length-1];if(!xd.test(t[t.length-1]))return;let n=t.trimEnd();if(n.length===t.length)return;if(n.length===0){e.pop();continue}e[e.length-1]=n;return}}function KS(e){if(e.includes("{"))return!1;let t=0,n=0;for(let i=0;i<e.length;i++){let r=e.charCodeAt(i);if(t!==0){if(r===t&&e.charCodeAt(i-1)!==Uo)t=0;continue}if(r===Cr||r===Ar||r===wr){t=r;continue}if(r===Sd&&++n>=2)return!0}return!1}function JS(e){if(!DS.test(e))return e.trimEnd();let t="",n=null,i=!1;for(let r=0;r<e.length;r++){let s=e[r],l=e[r-1];if(n){if(t+=s,n==="double"&&s==='"'&&l!=="\\"||n==="single"&&s==="'"&&l!=="\\"||n==="template"&&s==="`"&&l!=="\\")n=null;i=!1;continue}if(s==='"'||s==="'"||s==="`"){n=s==='"'?"double":s==="'"?"single":"template",t+=s,i=!1;continue}if(xd.test(s)){if(!i&&t.length>0)t+=" ",i=!0;continue}t+=s,i=!1}return t.trimEnd()}function Td(e,t){let n=e[t],i=e.indexOf(n,t+1);while(i!==-1&&e.charCodeAt(i-1)===Uo)i=e.indexOf(n,i+1);return i}function bd(e,t){let n=e.indexOf("*/",t+1);return n===-1?-1:n+1}function XS(e){let t=new Map,n=[],i=$S,r=0;while(r<e.length){if(i.lastIndex=r,!i.test(e))break;r=i.lastIndex-1;let s=e.charCodeAt(r);if(s===Ho){if(e.charCodeAt(r+1)===vr){let l=bd(e,r);if(l===-1)break;r=l}}else if(s===Cr||s===Ar||s===wr){let l=Td(e,r);if(l===-1)break;r=l}else if(s===qo)n.push(r);else if(s===zo){let l=n.pop();if(l!==void 0)t.set(l,r)}r++}return t}function YS(e,t,n){for(let i=t;i<n;i++)if(!Wo(e.charCodeAt(i)))return!1;return!0}function Wo(e){if(e<=Kn)return e===Kn||e>=Ed&&e<=LS;if(e<160)return!1;return e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288||e===65279}function vd(e,t,n,i){let r=[],s=IS,l=t,o=t;while(o<n){if(s.lastIndex=o,!s.test(e))break;if(o=s.lastIndex-1,o>=n)break;let a=e.charCodeAt(o);if(a===Ho){if(e.charCodeAt(o+1)===vr){let p=bd(e,o);if(p===-1)break;o=p}o++;continue}if(a===Cr||a===Ar||a===wr){let p=Td(e,o);if(p===-1)break;o=p+1;continue}if(a===qo){let p=i.get(o);if(p===void 0||p>=n){o++;continue}if(l<o)r.push(e.slice(l,o));let c=o+1;if(YS(e,c,p)){r.push("{}"),o=p+1,l=o;continue}let u=e.slice(c,p),f=e.charCodeAt(c)===Go;if(!f&&!u.includes("/*")&&!KS(u)&&!GS(r)){let h=vd(e,c,p,i),m=h.trim();if(!m.includes(`
|
|
59
|
+
`)){let g=m.endsWith(";")?m.slice(0,-1):m,y=`{ ${JS(g)} }`;if(y.length<=kS){r.push(y),o=p+1,l=o;continue}}if(r.push("{"),h.charCodeAt(0)!==Sd)r.push(`
|
|
60
60
|
`);if(h.length>0)r.push(h);o=p,l=p;continue}if(r.push("{"),!f)r.push(`
|
|
61
|
-
`);o=c,l=c;continue}if(a===
|
|
62
|
-
`);r.push("}"),o++,l=o;continue}if(l<o)r.push(e.slice(l,o));if(
|
|
63
|
-
`);o++,l=o}if(l<n)r.push(e.slice(l,n));return r.join("")}function
|
|
64
|
-
`,o);if(c===-1)c=i;let u=c+1,f=o,h=c;while(f<h&&
|
|
65
|
-
`);let u=t[c];if(u>0)p.push(
|
|
66
|
-
`}var
|
|
61
|
+
`);o=c,l=c;continue}if(a===zo){if(l<o)r.push(e.slice(l,o));if(qS(r),!US(r))r.push(`
|
|
62
|
+
`);r.push("}"),o++,l=o;continue}if(l<o)r.push(e.slice(l,o));if(zS(r),r.push(";"),e.charCodeAt(o+1)!==Go)r.push(`
|
|
63
|
+
`);o++,l=o}if(l<n)r.push(e.slice(l,n));return r.join("")}function QS(e){if(!e.includes(" "))return e;let t="",n=0;for(let i=0;i<e.length;i++){let r=e.charCodeAt(i);if(n!==0){if(t+=e[i],r===n&&e.charCodeAt(i-1)!==Uo)n=0;continue}if(r===Cr||r===Ar||r===wr){n=r,t+=e[i];continue}if(r===Kn&&t.charCodeAt(t.length-1)===Kn)continue;t+=e[i]}return t}function ZS(e){return e===zo||e===VS||e===OS||e===BS}function eT(e,t,n){return n-t>=3&&e.charCodeAt(t)===Ho&&e.charCodeAt(t+1)===vr&&e.charCodeAt(t+2)===vr}function gd(e,t,n){let i=e.indexOf("*/",t);return i!==-1&&i+2<=n}function tT(e,t,n){let i=e.charCodeAt(t);if(i===jS||i===RS)return!0;return i===md&&t+1<n&&e.charCodeAt(t+1)!==md}function nT(e){let t=[],n=[],i=e.length,r=0,s=!1,l=0,o=0;while(o<=i){let c=e.indexOf(`
|
|
64
|
+
`,o);if(c===-1)c=i;let u=c+1,f=o,h=c;while(f<h&&Wo(e.charCodeAt(f)))f++;while(h>f&&Wo(e.charCodeAt(h-1)))h--;if(f===h){let b=n.length>0?n[n.length-1]:void 0;if(b!==void 0&&b!==""){let M=b.charCodeAt(b.length-1);if(M!==qo&&M!==MS&&M!==FS)t.push(0),n.push("")}o=u;continue}if(s){if(t.push(l),n.push(` ${e.slice(f,h)}`),gd(e,f,h))s=!1;o=u;continue}let m=eT(e,f,h),g=m&&gd(e,f,h);if(m&&!g){t.push(r),n.push(e.slice(f,h)),s=!0,l=r,o=u;continue}let y=ZS(e.charCodeAt(f)),S=Math.max(0,r-(y?1:0))+(tT(e,f,h)?1:0);if(y&&S===0&&n.length>0&&n[n.length-1]==="")t.pop(),n.pop();if(t.push(S),n.push(QS(e.slice(f,h))),o=u,g)continue;r=ii(e,void 0,f,h,r)}let a=n.length;while(a>0&&n[a-1]==="")a--;let p=[];for(let c=0;c<a;c++){if(c>0)p.push(`
|
|
65
|
+
`);let u=t[c];if(u>0)p.push(WS(u));p.push(n[c])}return p.join("")}function Cd(e){return`${nT(vd(e,0,e.length,XS(e)))}
|
|
66
|
+
`}var he="any",iT="Record<string, any>",Jn="Record<string, never>",Nd=/^[A-Za-z_$][A-Za-z0-9_$]*$/,rT=/CustomEvent/,sT=/^[A-Z]/,oT=/\n/,aT=/=>/,lT=/^\s*[(<]/,pT=/(?:^|\n)@default\b/,cT=/^([ \t]*\*) +$/gm,uT=/[^\S\r\n]*[\r\n]\s*/g,dT=/(^|[^.\w])Snippet(?:\s*<|\b)/,fT=/import\s+type\s+[^;]*\bSnippet\b[^;]*from\s+"svelte";/,hT=/^const\s+/,mT=/^export /,yT=/[^\w$]/g;function Jo(e){return e.replace(hT,"")}function Ie(e){if(e.length===0)return"";return`/**
|
|
67
67
|
* ${Rt(e.join(`
|
|
68
68
|
* `))}
|
|
69
|
-
*/`}function
|
|
70
|
-
`):[]}function
|
|
71
|
-
`)}function
|
|
69
|
+
*/`}function Xn(e){return e?e.split(`
|
|
70
|
+
`):[]}function Dd(e){if(e===void 0)return[];return(e===!0?"@deprecated":`@deprecated ${e}`).split(`
|
|
71
|
+
`)}function Xo(e){let t=[];for(let{name:n,body:i}of e??[])if(!i)t.push(`@${n}`);else if(i.includes(`
|
|
72
72
|
`))t.push(`@${n}`,...i.split(`
|
|
73
|
-
`));else t.push(`@${n} ${i}`);return t}function
|
|
74
|
-
`)
|
|
75
|
-
`}function
|
|
76
|
-
`:""}export ${t.ts}`.replace(
|
|
73
|
+
`));else t.push(`@${n} ${i}`);return t}function Yt(e,t,n){return[...Xn(e),...Dd(t),...Xo(n)]}function $d(e){if(!e)return"";return`/** ${Rt(e)} */`}function Yo(e){return e?.includes(`
|
|
74
|
+
`)?Ie(Xn(e)):$d(e)}function Qo(e,t,n){let i=[...Xo(t),...Dd(n)];if(i.length===0)return Yo(e);return Ie([...Xn(e),...i])}function Id(e){if(e===void 0)return he;return`${e}
|
|
75
|
+
`}function kr(e){if(e.typedefs.length===0)return"";return e.typedefs.map((t)=>{let n=Ie([...Xn(t.description),...Xo(t.tags)]);return`${n?`${n}
|
|
76
|
+
`:""}export ${t.ts}`.replace(cT,"$1")}).join(`
|
|
77
77
|
|
|
78
|
-
`)}var
|
|
79
|
-
`:"",a=l.optional?"?":"";return`${o}${
|
|
80
|
-
`),i=t.description?`${
|
|
81
|
-
`:"",{declSuffix:r}=
|
|
82
|
-
`));if(t.type!==void 0)return`${i}export type ${t.typeName}${r} = ${t.type};`;if(t.properties.length===0)return`${i}export type ${t.typeName} = ${t.hasUnresolvedSpread?"Record<string, any>":
|
|
78
|
+
`)}var Ad=new Map;function gT(e,t){let n=Ad.get(t);if(n===void 0)n=new RegExp(`\\b${hi(t)}\\b`),Ad.set(t,n);return n.test(e)}var wd,Pd=[];function Pr(e){if(e!==wd)wd=e,Pd=F(e,",");return Pd}function xT(e){if(e===null)return[];return e[0].split(",").map((t,n)=>({name:t.trim(),constraint:(Pr(e[1]??"")[n]??t).trim()}))}function Ld(e,t){let n=xT(e).filter(({name:i})=>gT(t,i));if(n.length===0)return{declSuffix:"",refSuffix:""};return{declSuffix:`<${n.map(({constraint:i})=>Jo(i)).join(", ")}>`,refSuffix:`<${n.map(({name:i})=>i).join(", ")}>`}}function Rd(e){if(!e.contexts||e.contexts.length===0)return"";return e.contexts.map((t)=>{let n=t.properties.map((l)=>{let o=l.description?`${Yo(l.description)}
|
|
79
|
+
`:"",a=l.optional?"?":"";return`${o}${Ae(l.name)}${a}: ${l.type};`}).join(`
|
|
80
|
+
`),i=t.description?`${Ie(Xn(t.description))}
|
|
81
|
+
`:"",{declSuffix:r}=Ld(e.generics,[t.type??"",...t.properties.map((l)=>l.type)].join(`
|
|
82
|
+
`));if(t.type!==void 0)return`${i}export type ${t.typeName}${r} = ${t.type};`;if(t.properties.length===0)return`${i}export type ${t.typeName} = ${t.hasUnresolvedSpread?"Record<string, any>":Jn};`;let s=t.hasUnresolvedSpread?" & Record<string, any>":"";return`${i}export type ${t.typeName}${r} = {
|
|
83
83
|
${n}
|
|
84
84
|
}${s};`}).join(`
|
|
85
85
|
|
|
86
|
-
`)}function
|
|
87
|
-
`:"",r=!t.slot_props||t.slot_props===
|
|
88
|
-
${i}${e}?: ${s};`}function
|
|
89
|
-
${
|
|
90
|
-
${
|
|
91
|
-
`),o=
|
|
92
|
-
}`;if(e.rest_props?.type!=="Element"){let C;if(e.canonicalPropsType){let
|
|
86
|
+
`)}function Ae(e){return Nd.test(e)?e:JSON.stringify(e)}function kd(e,t){let n=Qo(t.description,t.tags,t.deprecated),i=n?`${n}
|
|
87
|
+
`:"",r=!t.slot_props||t.slot_props===Jn?"[]":TT(t.slot_props),s=r==="[]"?"(this: void) => void":`(this: void, ...args: ${r}) => void`;return`
|
|
88
|
+
${i}${e}?: ${s};`}function ET(e){let t=e.props.filter((C)=>!_r(C)),n=new Set([...t.map((C)=>C.name),...Array.from(e.canonicalPropNames??[])]),r=(e.canonicalPropsType?t.filter((C)=>!e.canonicalPropNames?.has(C.name)):t).map((C)=>{let Me=typeof C.value==="string"?C.value.replace(uT," "):C.value,Qn=pT.test(C.description??"")||C.value===void 0||C.value==="undefined",Zn=Ie([...Yt(C.description,C.deprecated,C.tags),...C.constant?["@constant"]:[],...Qn?[]:[`@default ${Me}`]]),ei=C.constant&&!C.isFunction?C.value:C.type||he;return`
|
|
89
|
+
${Zn}
|
|
90
|
+
${Ae(C.name)}${C.isRequired?"":"?"}: ${ei};`});for(let C of e.slots)if(!C.default&&C.name!=null&&!n.has(C.name))r.push(kd(Ae(C.name),C));let s=e.slots.find((C)=>C.default||C.name===null);if(s&&!n.has("children"))r.push(kd("children",s));let l=r.join(`
|
|
91
|
+
`),o=FT(e.moduleName),a=e.generics?`<${Pr(e.generics[1]).map((C)=>Jo(C.trim())).join(", ")}>`:"",p=e.generics?`<${e.generics[0]}>`:"",u=`${e.extends===void 0?"":`Omit<${e.extends.interface}, keyof $Props${p}> & `}$Props${p}`,f=(C)=>`export type ${o}${a} = ${C};`,h=`{${l}
|
|
92
|
+
}`;if(e.rest_props?.type!=="Element"){let C;if(e.canonicalPropsType){let Me=l.trim()===""?"":` & ${h}`;C=[`type $Props${a} = ${e.canonicalPropsType}${Me};`,f(u)]}else if(l.trim()==="")C=[f(e.extends?.interface??Jn)];else if(e.extends===void 0)C=[f(h)];else C=[`type $Props${a} = ${h};`,f(u)];return{props_name:o,prop_def:C.join(`
|
|
93
93
|
|
|
94
|
-
`),elementsImport:void 0}}let{name:m,thisValue:g,thisType:y,description:
|
|
95
|
-
`:"",
|
|
94
|
+
`),elementsImport:void 0}}let{name:m,thisValue:g,thisType:y,description:S}=e.rest_props,b;if(m!=="svelte:element")b=m.split("|").map((C)=>`SvelteHTMLElements["${C.trim()}"]`).join(" & ");else if(g)b=`SvelteHTMLElements["${g}"]`;else if(y)b=`NoInfer<SvelteHTMLElements[${y}]>`;else b="HTMLAttributes<HTMLElement>";let M="[key: `data-${string}`]: unknown;",v=S?`${Yo(S)}
|
|
95
|
+
`:"",Y=e.canonicalPropsType?`(${e.canonicalPropsType}) & `:"",me=y?{name:a,ref:p}:{name:"",ref:""},Le=e.extends===void 0?`keyof $Props${p}`:`keyof ($Props${p} & ${e.extends.interface})`,At=`Omit<$RestProps${me.ref}, ${Le}>`,Re=y?ST(y,e.generics,e.extends?.interface):void 0,wt=Re?Re.ref:At;return{props_name:o,prop_def:[`${v}type $RestProps${me.name} = ${b};`,...Re?[Re.declaration]:[],`type $Props${a} = ${Y}{${l}
|
|
96
96
|
|
|
97
97
|
${M}
|
|
98
|
-
};`,f(`${
|
|
98
|
+
};`,f(`${wt} & ${u}`)].join(`
|
|
99
99
|
|
|
100
|
-
`),elementsImport:
|
|
101
|
-
`:""}${l}: ${
|
|
100
|
+
`),elementsImport:b.startsWith("HTMLAttributes")?"HTMLAttributes":"SvelteHTMLElements"}}function ST(e,t,n){if(!t)return;let i=Pr(t[0]).map((m)=>m.trim()),r=Pr(t[1]).map((m)=>Jo(m.trim())),s=i.indexOf(e),l=r[s];if(s===-1||!l?.startsWith(`${e} extends `))return;let o=F(l.slice(`${e} extends `.length),"=")[0]?.trim();if(!o)return;let a=i.filter((m,g)=>g!==s),p=r.filter((m,g)=>g!==s),c=p.length>0?`<${p.join(", ")}>`:"",u=a.length>0?`<${a.join(", ")}>`:"",f=`<${i.map((m)=>m===e?"$Tag":m).join(", ")}>`,h=n===void 0?`keyof $Props${f}`:`keyof ($Props${f} & ${n})`;return{declaration:`type $Elements${c} = { [$Tag in ${o}]: Omit<$RestProps${f}, ${h}> };`,ref:`$Elements${u}[${e}]`}}function TT(e){return Wr(e)?e:`[${e}]`}function bT(e){let t=e.slots.filter((i)=>!Wr(i.slot_props??""));if(t.length===0)return Jn;let n=t.map(({name:i,slot_props:r,...s})=>{let l=s.default||i===null?"default":Ae(i??""),o=Qo(s.description,s.tags,s.deprecated);return`${o?`${o}
|
|
101
|
+
`:""}${l}: ${Id(r)};`}).join(`
|
|
102
102
|
`);return t.length===1?`{${n}}`:`{
|
|
103
103
|
${n}
|
|
104
|
-
}`}var
|
|
105
|
-
`:""}${
|
|
104
|
+
}`}var vT=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave","contextmenu","wheel","keydown","keyup","keypress","submit","change","input","focus","blur","focusin","focusout","reset","select","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragover","dragenter","dragleave","drop","pointerdown","pointerup","pointermove","pointerover","pointerout","pointerenter","pointerleave","pointercancel","gotpointercapture","lostpointercapture","play","pause","ended","volumechange","timeupdate","loadeddata","loadedmetadata","canplay","canplaythrough","seeking","seeked","playing","waiting","stalled","suspend","abort","error","emptied","ratechange","durationchange","loadstart","progress","loadend","animationstart","animationend","animationiteration","animationcancel","transitionstart","transitionend","transitionrun","transitioncancel","scroll","resize","load","unload","beforeunload","cut","copy","paste","compositionstart","compositionupdate","compositionend"]);function Ko(e=he){if(rT.test(e))return e;return`CustomEvent<${e}>`}function CT(e){switch(e.type){case"dispatched":return Ko(e.detail);case"forwarded":{let t=e.element,n=t&&sT.test(t),i=!n||vT.has(e.name);if(e.detail!==void 0&&e.detail!=="undefined"&&!(e.detail==="null"&&i&&!n))return Ko(e.detail);if(!i)return Ko();return`${t==="svelte:document"?"DocumentEventMap":"WindowEventMap"}["${e.name}"]`}default:return e}}function _d(e){if(e.events.length===0)return iT;let t=e.events.map((n)=>{let i=Qo(n.description,n.tags,n.deprecated);return`${i?`${i}
|
|
105
|
+
`:""}${Ae(n.name)}: ${CT(n)};
|
|
106
106
|
`}).join("");return e.events.length===1?`{${t}}`:`{
|
|
107
|
-
${t}}`}function
|
|
108
|
-
${
|
|
109
|
-
${
|
|
110
|
-
`)}function
|
|
111
|
-
};`}}function
|
|
107
|
+
${t}}`}function AT(e){let t=e.type==="() => any";if(e.type&&aT.test(e.type)&&!t)return e.type;if(e.params&&e.params.length>0)return`(${ge(e.params)}) => ${e.returnType||he}`;if(e.returnType)return`() => ${e.returnType}`;return e.type||he}function _r(e){return e.isFunctionDeclaration===!0||e.kind==="const"}function Md(e){return e.props.filter(_r).map((t)=>`
|
|
108
|
+
${Ie(Yt(t.description,t.deprecated,t.tags))}
|
|
109
|
+
${Ae(t.name)}: ${AT(t)};`).join(`
|
|
110
|
+
`)}function wT(e){let t=VT(e.moduleName),n=Md({props:e.props});if(n.trim()==="")return{exports_ref:t,exports_def:`export type ${t} = ${Jn};`};let{declSuffix:i,refSuffix:r}=Ld(e.generics,n);return{exports_ref:`${t}${r}`,exports_def:`export type ${t}${i} = {${n}
|
|
111
|
+
};`}}function PT(e){let t=e.props.filter((n)=>n.bindable===!0||n.binding==="writable").map((n)=>JSON.stringify(n.name));return t.length>0?t.join(" | "):'""'}function Od(e){return e==="default"?"$$Component":e}function kT(e){let t=Od(e.moduleName);return`declare const ${t}: Component<
|
|
112
112
|
${e.propsRef},
|
|
113
113
|
${e.exportsRef},
|
|
114
114
|
${e.bindings}
|
|
115
115
|
>;
|
|
116
|
-
export default ${t};`}function
|
|
116
|
+
export default ${t};`}function _T(e){let t=Od(e.moduleName),n=`${t}Component`,i=e.eventsRef?`$on?<K extends keyof ${e.eventsRef} & string>(type: K, callback: (e: ${e.eventsRef}[K]) => void): () => void;`:"$on?(type: string, callback: (e: any) => void): () => void;";return`interface ${n} {
|
|
117
117
|
new ${e.generic}(
|
|
118
118
|
options: ComponentConstructorOptions<${e.propsRef}>
|
|
119
119
|
): SvelteComponent<${e.propsRef}${e.eventsRef?`, ${e.eventsRef}`:""}> & ${e.exportsRef};
|
|
@@ -129,84 +129,84 @@ ${t}}`}function fT(e){let t=e.type==="() => any";if(e.type&&JE.test(e.type)&&!t)
|
|
|
129
129
|
z_$$bindings?: ${e.bindings};
|
|
130
130
|
}
|
|
131
131
|
declare const ${t}: ${n};
|
|
132
|
-
export default ${t};`}function
|
|
132
|
+
export default ${t};`}function NT(e){if(e.extends===void 0)return"";return`import type { ${DT(e.extends.interface)} } from ${e.extends.import};`}function DT(e){let t=e.indexOf("<");return(t===-1?e:e.slice(0,t)).trim()}function $T(e){if(!e.componentComment)return"";if(!oT.test(e.componentComment))return $d(e.componentComment.trim());return`/*${Rt(e.componentComment).split(`
|
|
133
133
|
`).map((t)=>`* ${t}`).join(`
|
|
134
134
|
`)}
|
|
135
|
-
*/`}function
|
|
136
|
-
export ${c} from ${JSON.stringify(r)};`);continue}let a=`${r}\x00${l}`,p=n.get(a);if(!p)p={comment:l,from:r,specifiers:[]},n.set(a,p),t.push(a);p.specifiers.push(s===i.name?o:`${
|
|
135
|
+
*/`}function IT(e){let t=[],n=new Map;for(let i of e.moduleExports){if(i.kind!=="re-export"||!i.reExport)continue;let{from:r,imported:s}=i.reExport,l=Ie(Yt(i.description,i.deprecated,i.tags)),o=Ae(i.name);if(s==="*"){let c=i.name==="*"?"*":`* as ${o}`;t.push(`${l}
|
|
136
|
+
export ${c} from ${JSON.stringify(r)};`);continue}let a=`${r}\x00${l}`,p=n.get(a);if(!p)p={comment:l,from:r,specifiers:[]},n.set(a,p),t.push(a);p.specifiers.push(s===i.name?o:`${Ae(s)} as ${o}`)}return t.map((i)=>{let r=n.get(i);if(!r)return i;return`${r.comment}
|
|
137
137
|
export { ${r.specifiers.join(", ")} } from ${JSON.stringify(r.from)};`}).join(`
|
|
138
138
|
|
|
139
|
-
`)}function
|
|
139
|
+
`)}function Zo(e){let t=[e.static?"static ":"",e.abstract?"abstract ":"",e.readonly?"readonly ":""].join(""),n=e.optional?"?":"";if(e.kind==="property")return`${t}${Ae(e.name)}${n}: ${e.type??he}`;if(e.kind==="index")return`${t}${e.name}: ${e.type??he}`;let i=ge(e.params??[]);if(e.kind==="constructor")return`constructor(${i})`;let r=e.typeParameters?`<${e.typeParameters}>`:"";return`${t}${Ae(e.name)}${n}${r}(${i}): ${e.returnType??he}`}function LT(e,t){let n=e.localName??e.name,i=n!==e.name,r=`export { ${n}${i?` as ${Ae(e.name)}`:""} };`;if(t.has(n))return r;t.add(n);let s=e.typeParameters?`<${e.typeParameters}>`:"",l=(e.members??[]).map((c)=>[Ie(Yt(c.description,c.deprecated,c.tags)),`${Zo(c)};`].filter(Boolean).join(`
|
|
140
140
|
`)).join(`
|
|
141
141
|
|
|
142
142
|
`),o=`${e.extends?` extends ${e.extends}`:""}${e.implements?.length?` implements ${e.implements.join(", ")}`:""}`,a=`${i?"":"export "}declare ${e.abstract?"abstract ":""}class ${n}${s}${o}`;return`
|
|
143
|
-
${[
|
|
143
|
+
${[Ie(Yt(e.description,e.deprecated,e.tags)),l?`${a} {
|
|
144
144
|
${l}
|
|
145
145
|
}`:`${a} {}`,i?r:""].filter(Boolean).join(`
|
|
146
|
-
`)}`}function
|
|
147
|
-
`;else if(l.kind==="let")o=`export declare let ${l.name}: ${l.type||
|
|
146
|
+
`)}`}function RT(e){let t=IT(e),n=new Set,i=e.moduleExports.filter((r)=>r.kind!=="re-export").map((r)=>{if(r.kind==="class")return LT(r,n);let s=!Nd.test(r.name),l=s?{...r,name:MT(r.name)}:r,o,a=l.type&&lT.test(l.type)?It(l.type):-1,p=l.typeParameters?`<${l.typeParameters}>`:"";if(l.kind==="const"&&a===-1)o=`export declare const ${l.name}: ${l.type||he};
|
|
147
|
+
`;else if(l.kind==="let")o=`export declare let ${l.name}: ${l.type||he};`;else if(l.params&&l.params.length>0)o=`export declare function ${l.name}${p}(${ge(l.params)}): ${l.returnType||he};`;else if(l.returnType)o=`export declare function ${l.name}${p}(): ${l.returnType};`;else if(l.type&&a!==-1){let c=l.type.slice(0,a).trimEnd(),u=l.type.slice(a+2).trim();o=`export declare function ${l.name}${c}: ${u};`}else o=`export declare let ${l.name}: ${l.type||he};`;if(s)o=`${o.replace(mT,"").trimEnd()}
|
|
148
148
|
export { ${l.name} as ${JSON.stringify(r.name)} };`;return`
|
|
149
|
-
${
|
|
149
|
+
${Ie(Yt(l.description,l.deprecated,l.tags))}
|
|
150
150
|
${o}`}).join(`
|
|
151
151
|
`);return[t,i].filter(Boolean).join(`
|
|
152
152
|
|
|
153
|
-
`)}function
|
|
153
|
+
`)}function MT(e){return`__export_${e.replace(yT,"_")}`}var OT=120;function BT(e){let n=`export default class ${e.moduleName==="default"?"":e.moduleName}${e.generic} extends SvelteComponentTyped<`,i=[e.genericProps,e.events,e.slots],s=[e.ownConstructor?`constructor(options: ComponentConstructorOptions<${e.genericProps}>);`:"",e.accessors.trim()].filter(Boolean).join(`
|
|
154
154
|
`);if(s===""&&i.every((l)=>!l.includes(`
|
|
155
|
-
`))){let l=`${n}${i.join(", ")}> {}`;if(l.length<=
|
|
155
|
+
`))){let l=`${n}${i.join(", ")}> {}`;if(l.length<=OT)return l}return`${n}
|
|
156
156
|
${e.genericProps},
|
|
157
157
|
${e.events},
|
|
158
158
|
${e.slots}
|
|
159
159
|
> {
|
|
160
160
|
${s}
|
|
161
|
-
}`}function
|
|
162
|
-
`),
|
|
161
|
+
}`}function FT(e){return`${e}Props`}function VT(e){return`${e}Exports`}function jT(e,t){let n=aa(e),{moduleName:i,typedefs:r,generics:s,props:l,moduleExports:o,slots:a,events:p,rest_props:c,extends:u,componentComment:f,contexts:h}=e,m=t?.format==="component",g=s!==null,{props_name:y,prop_def:S,elementsImport:b}=ET({moduleName:i,props:l,rest_props:c,extends:u,generics:s,slots:a,canonicalPropNames:new Set(n?.canonicalPropNames??[]),canonicalPropsType:n?.canonicalPropsType}),M=s?`<${s[1]}>`:"",v=s?`${y}<${s[0]}>`:y,Y=m&&p.length>0?`type $Events${M} = ${_d({events:p})};`:"",me=s?`$Events<${s[0]}>`:"$Events",Le=m&&(g||Y!==""),At=RT({moduleExports:o}),Re=kr({typedefs:r}),wt=Rd({contexts:h,generics:s}),C=(n?.typeImportStatements??[]).join(`
|
|
162
|
+
`),Me=[...n?.localTypeDeclarations??[],...n?.moduleTypeDeclarations??[]].join(`
|
|
163
163
|
|
|
164
|
-
`),{exports_ref:
|
|
165
|
-
`),
|
|
166
|
-
`)].map((
|
|
164
|
+
`),{exports_ref:Qn,exports_def:Zn}=m?wT({props:l,moduleName:i,generics:s}):{exports_ref:"",exports_def:""},ei=m?PT({props:l}):"",sa=c?.type==="Element"&&c.thisType!==void 0,$r=!fT.test(C)&&[S,At,Re,wt,Me,Zn].some((Ir)=>dT.test(Ir)),tf=[m?Le?`import type { SvelteComponent, ComponentConstructorOptions, ComponentInternals${$r?", Snippet":""} } from "svelte";`:`import type { Component${$r?", Snippet":""} } from "svelte";`:`import { SvelteComponentTyped${sa?", type ComponentConstructorOptions":""}${$r?", type Snippet":""} } from "svelte";`,b?`import type { ${b} } from "svelte/elements";`:"",C,NT({extends:u})].filter(Boolean).join(`
|
|
165
|
+
`),nf=m?Le?_T({moduleName:i,generic:M,propsRef:v,exportsRef:Qn,bindings:ei,...Y?{eventsRef:me}:{}}):kT({moduleName:i,propsRef:v,exportsRef:Qn,bindings:ei}):BT({moduleName:i,generic:M,genericProps:v,events:_d({events:p}),slots:bT({slots:a}),accessors:Md({props:l}),ownConstructor:sa}),rf=[At,Re,Me,wt,S,Zn,Y,[$T({componentComment:f}),nf].filter(Boolean).join(`
|
|
166
|
+
`)].map((Ir)=>Ir.trim()).filter(Boolean).join(`
|
|
167
167
|
|
|
168
|
-
`);return
|
|
168
|
+
`);return Cd([tf,rf].filter(Boolean).join(`
|
|
169
169
|
|
|
170
|
-
`))}var
|
|
170
|
+
`))}var Bd=/`/g,Fd=/\s+/g,st="--",Vd=`| Prop name | Required | Kind | Reactive | Binding | Type | Default value | Description |
|
|
171
171
|
| :- | :- | :- | :- | :- | :- | :- | :- |
|
|
172
|
-
`,
|
|
172
|
+
`,jd=`| Slot name | Default | Props | Fallback | Description |
|
|
173
173
|
| :- | :- | :- | :- | :- |
|
|
174
|
-
`,
|
|
174
|
+
`,Gd=`| Event name | Type | Detail | Description |
|
|
175
175
|
| :- | :- | :- | :- |
|
|
176
|
-
`,
|
|
176
|
+
`,ea=`| Name | Kind | Type | Description |
|
|
177
177
|
| :- | :- | :- | :- |
|
|
178
|
-
`,
|
|
178
|
+
`,GT=`| Member | Signature | Description |
|
|
179
179
|
| :- | :- | :- |
|
|
180
|
-
`,
|
|
180
|
+
`,Wd=`| Part name | Description |
|
|
181
181
|
| :- | :- |
|
|
182
|
-
`,
|
|
182
|
+
`,Hd=`| Property name | Type | Default value | Description |
|
|
183
183
|
| :- | :- | :- | :- |
|
|
184
|
-
`,
|
|
185
|
-
`)?e.replace(
|
|
186
|
-
`))});if(!
|
|
187
|
-
`),i=[],r=[];for(let s=0;s<n.length;s++){let l=
|
|
188
|
-
`)}),r=[""]}if(r.length>1||i.length===0)i.push(t(r));return i}function
|
|
189
|
-
`);if(s)i(s);for(let o of
|
|
184
|
+
`,Ud=/\|/g,WT=/</g,HT=/>/g,Nr=/\n/g,UT=/^[A-Za-z_$][\w$]*$/,qT=/\s*\n\s*/g,zT=/&(?=#?\w+;)|<(?=[A-Za-z/!?])|[|`*]|\\(?=[!-/:-@[-`{-~])|(?<![A-Za-z0-9])_|_(?![A-Za-z0-9])/g,KT=/[&<|`*\\_]/;function ta(e){if(!KT.test(e))return e;return e.replace(zT,(t)=>t==="&"?"&":t==="<"?"<":t==="_"?"_":`&#${t.charCodeAt(0)};`)}function JT(e){return`<code>${ta(e.includes(`
|
|
185
|
+
`)?e.replace(qT," "):e)}</code>`}var XT=/\{@link\s+([^{}\s|]+)(?:\|([^{}]+))?\}/g;function YT(e){if(!e.includes("{@link"))return e;return e.replace(XT,(t,n,i)=>`[${i===void 0?n:i.trim()}](${n})`)}function QT(e){return e.includes("```")||e.includes("~~~")}function ZT(e){return Jd(YT(e))}var eb=/^([ \t]*)(`{3,}|~{3,})(.*)$/,tb=/^\n/,nb=/\n$/;function qd(e){let t=(s)=>({kind:"prose",text:ZT(s.join(`
|
|
186
|
+
`))});if(!QT(e))return[t([e])];let n=e.split(`
|
|
187
|
+
`),i=[],r=[];for(let s=0;s<n.length;s++){let l=eb.exec(n[s]),[,o="",a="",p=""]=l??[];if(!l||a[0]==="`"&&p.includes("`")){r.push(n[s]);continue}if(r.push(""),r.length>1)i.push(t(r));let c=[];for(s++;s<n.length&&!ib(n[s],a);s++){let u=n[s],f=0;while(f<o.length&&(u[f]===" "||u[f]==="\t"))f++;c.push(u.slice(f))}i.push({kind:"code",code:c.join(`
|
|
188
|
+
`)}),r=[""]}if(r.length>1||i.length===0)i.push(t(r));return i}function ib(e,t){let n=t[0],i=0,r=e.length;while(i<r&&(e[i]===" "||e[i]==="\t"))i++;while(r>i&&(e[r-1]===" "||e[r-1]==="\t"))r--;if(n===void 0||r-i<t.length)return!1;for(let s=i;s<r;s++)if(e[s]!==n)return!1;return!0}function zd(e){let t="";for(let n=0;n<e.length;n++){let i=e[n];if(i.kind==="code"){t+=`<pre><code>${ta(i.code).replace(Nr,"<br />")}</code></pre>`;continue}let r=i.text;if(e[n-1]?.kind==="code")r=r.replace(tb,"");if(e[n+1]?.kind==="code")r=r.replace(nb,"");t+=r.replace(Ud,"|").replace(Nr,"<br />")}return t}function ie(e){if(e===void 0)return st;return JT(e)}function Kd(e){if(!e.reExport)return ie(e.type);let{from:t,imported:n}=e.reExport,i=n==="*"?"":UT.test(n)?`.${n}`:`[${JSON.stringify(n)}]`;return ie(`typeof import(${JSON.stringify(t)})${i}`)}function Jd(e){if(!e.includes("<")&&!e.includes(">"))return e;return e.replace(WT,"<").replace(HT,">")}function Ct(e,t){if(t===void 0)return e;let n=typeof t==="string"&&t.trim().length>0?`: ${Jd(t).replace(Nr," ").replace(Ud,"|")}`:"";return`<s>${e}</s><br />**Deprecated**${n}`}function Dr(e){if(e===void 0||e.trim().length===0)return st;return zd(qd(e))}function Xd(e){if(e===void 0||e==="{}"||e==="Record<string, never>")return st;return ie(e.trim())}function Yd(e){if(e===void 0)return st;return`<code>${ta(e).replace(Nr,"<br />")}</code>`}function Qt(e,t){let n=[],i=(s)=>{let l=n.at(-1);if(l?.kind==="prose")l.text+=s;else n.push({kind:"prose",text:s})},r=(s,l)=>{if(n.length>0)i(`
|
|
189
|
+
`);if(s)i(s);for(let o of qd(l))if(o.kind==="prose")i(o.text);else n.push(o)};if(e?.trim())r("",e);for(let{name:s,body:l}of t??[]){let o=l?.trim();r(o?`@${s} `:`@${s}`,o??"")}if(n.length===0)return st;return zd(n)}function Qd(e){return ie(e)}function rb(e){let t=[e.extends?`Extends ${ie(e.extends)}.`:"",e.implements?.length?`Implements ${e.implements.map((n)=>ie(n)).join(", ")}.`:""].filter(Boolean);return t.length>0?t.join(" "):void 0}function Zd(e,t){let n=new Set;for(let i of t){if(i.kind!=="class")continue;let r=rb(i);if(!i.members?.length&&!r)continue;let s=i.localName??i.name;if(n.has(s))continue;if(n.add(s),e.append("h4",`\`${s}\` members`),r)e.append("raw",`${r}
|
|
190
190
|
|
|
191
|
-
`);if(!i.members?.length)continue;e.append("raw",
|
|
191
|
+
`);if(!i.members?.length)continue;e.append("raw",GT);for(let l of i.members)e.append("raw",`| ${Ct(l.name,l.deprecated)} | ${ie(Zo(l))} | ${Qt(l.description,l.tags)} |
|
|
192
192
|
`);e.append("raw",`
|
|
193
|
-
`)}}var
|
|
193
|
+
`)}}var sb=/[^\w\- ]+/g,ob=/\s+/g,na="<!-- __TOC__ -->";function ab(e,t){let n=e.toLowerCase().replace(Bd,"").replace(sb,"").replace(ob,"-"),i=t.get(n)??0;return t.set(n,i+1),i===0?n:`${n}-${i}`}class Yn{sourceParts=[];hasToC=!1;toc=[];onAppend;constructor(e={}){this.onAppend=e.onAppend}get source(){return this.sourceParts.join("")}appendLineBreaks(){return this.sourceParts.push(`
|
|
194
194
|
|
|
195
|
-
`),this}append(e,t){switch(e){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":{if(this.sourceParts.push(`${"#".repeat(Number(e.slice(-1)))} ${t}`),this.hasToC&&e==="h2")this.toc.push({indent:0,raw:t??""});break}case"quote":this.sourceParts.push(`> ${t}`);break;case"p":this.sourceParts.push(t??"");break;case"divider":this.sourceParts.push("---");break;case"raw":this.sourceParts.push(t??"");break}if(e!=="raw")this.appendLineBreaks();return this.onAppend?.call(this,e,this),this}tableOfContents(){return this.sourceParts.push(
|
|
196
|
-
`);return e.slice(0,t)+i+e.slice(t+
|
|
195
|
+
`),this}append(e,t){switch(e){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":{if(this.sourceParts.push(`${"#".repeat(Number(e.slice(-1)))} ${t}`),this.hasToC&&e==="h2")this.toc.push({indent:0,raw:t??""});break}case"quote":this.sourceParts.push(`> ${t}`);break;case"p":this.sourceParts.push(t??"");break;case"divider":this.sourceParts.push("---");break;case"raw":this.sourceParts.push(t??"");break}if(e!=="raw")this.appendLineBreaks();return this.onAppend?.call(this,e,this),this}tableOfContents(){return this.sourceParts.push(na),this.hasToC=!0,this.appendLineBreaks(),this}end(){let e=this.sourceParts.join("");if(!this.hasToC)return e;let t=e.indexOf(na);if(t===-1)return e;let n=new Map,i=this.toc.map(({indent:r,raw:s})=>`${" ".repeat(r)}- [${s}](#${ab(s,n)})`).join(`
|
|
196
|
+
`);return e.slice(0,t)+i+e.slice(t+na.length)}}class ef extends Yn{}function ra(e,t,n){if(e.append("h1","Component Index"),e.append("h2","Components").tableOfContents(),e.append("divider"),n&&n.length>0)lb(e,n);for(let i of jo(t).components)cb(e,i)}function lb(e,t){e.append("h2","Exports"),e.append("raw",ea);for(let n of t){let i=(n.type??n.value)?.replace(Fd," ").trim();e.append("raw",`| ${Ct(n.name,n.deprecated)} | <code>${n.kind}</code> | ${ie(i)} | ${Dr(n.description)} |
|
|
197
197
|
`)}e.append("raw",`
|
|
198
|
-
`),e.append("divider")}function
|
|
198
|
+
`),e.append("divider")}function pb(e,t){e.append("h3","Module exports"),e.append("raw",ea);for(let n of t)e.append("raw",`| ${Ct(n.name,n.deprecated)} | <code>${n.kind}</code> | ${Kd(n)} | ${Qt(n.description,n.tags)} |
|
|
199
199
|
`);e.append("raw",`
|
|
200
|
-
`),
|
|
201
|
-
`);else e.append("p","None.")}function
|
|
202
|
-
${
|
|
200
|
+
`),Zd(e,t)}function ia(e,t,n){if(t.length>0)n(),e.append("raw",`
|
|
201
|
+
`);else e.append("p","None.")}function cb(e,t){if(e.append("h2",`\`${t.moduleName}\``),t.generics)e.append("p",`**Type parameters:** ${ie(`<${t.generics[1]}>`)}`);if(t.typedefs.length>0)e.append("h3","Types").append("raw",`\`\`\`ts
|
|
202
|
+
${kr({typedefs:t.typedefs})}
|
|
203
203
|
\`\`\`
|
|
204
204
|
|
|
205
|
-
`);if(e.append("h3","Props"),
|
|
206
|
-
`)}}),t.moduleExports.length>0)
|
|
207
|
-
`)}),e.append("h3","Events"),
|
|
208
|
-
`)}),t.cssParts&&t.cssParts.length>0){e.append("h3","CSS Parts"),e.append("raw",
|
|
205
|
+
`);if(e.append("h3","Props"),ia(e,t.props,()=>{e.append("raw",Vd);let n=(r)=>r.reactive?0:r.constant?2:1,i=t.props.map((r,s)=>({prop:r,index:s})).sort((r,s)=>n(r.prop)-n(s.prop)||r.index-s.index).map(({prop:r})=>r);for(let r of i){let s=_r(r)?"accessor":r.kind;e.append("raw",`| ${Ct(r.name,r.deprecated)} | ${r.isRequired?"Yes":"No"} | <code>${s}</code> | ${r.reactive?"Yes":"No"} | ${r.binding??"--"} | ${ie(r.type)} | ${ie(r.value)} | ${Qt(r.description,r.tags)} |
|
|
206
|
+
`)}}),t.moduleExports.length>0)pb(e,t.moduleExports);if(e.append("h3","Slots"),ia(e,t.slots,()=>{e.append("raw",jd);for(let n of t.slots)e.append("raw",`| ${Ct(n.default?st:n.name??st,n.deprecated)} | ${n.default?"Yes":"No"} | ${Xd(n.slot_props)} | ${Yd(n.fallback)} | ${Qt(n.description,n.tags)} |
|
|
207
|
+
`)}),e.append("h3","Events"),ia(e,t.events,()=>{e.append("raw",Gd);for(let n of t.events)e.append("raw",`| ${Ct(n.name,n.deprecated)} | ${n.type} | ${Qd(n.detail)} | ${Qt(n.description,n.tags)} |
|
|
208
|
+
`)}),t.cssParts&&t.cssParts.length>0){e.append("h3","CSS Parts"),e.append("raw",Wd);for(let n of t.cssParts)e.append("raw",`| ${n.name} | ${Dr(n.description)} |
|
|
209
209
|
`);e.append("raw",`
|
|
210
|
-
`)}if(t.cssProperties&&t.cssProperties.length>0){e.append("h3","CSS Custom Properties"),e.append("raw",
|
|
210
|
+
`)}if(t.cssProperties&&t.cssProperties.length>0){e.append("h3","CSS Custom Properties"),e.append("raw",Hd);for(let n of t.cssProperties)e.append("raw",`| ${n.name} | ${ie(n.type)} | ${ie(n.default)} | ${Dr(n.description)} |
|
|
211
211
|
`);e.append("raw",`
|
|
212
|
-
`)}}function
|
|
212
|
+
`)}}function ub(e,t){return new Yn({onAppend:(n,i)=>{t?.onAppend?.call(null,n,i,e)}})}function db(e,t){let n=ub(e,t);return ra(n,e,t.entryExports),n.end()}function fb(e,t){return db(e,{onAppend:t?.onAppend})}export{ef as BrowserWriterMarkdown,hd as COMPONENT_API_SCHEMA_VERSION,Bo as ComponentParser,Yn as MarkdownDocument,of as asNormalizedPath,jo as buildComponentApiDocument,CS as finalizeWithoutCrossFileResolution,Id as formatTsProps,Rd as getContextDefs,kr as getTypeDefs,ra as renderComponentsToMarkdown,fb as writeMarkdownCore,jT as writeTsDefinition};
|