sveld 0.40.1 → 0.40.2

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/chunk-ypb35mtk.js DELETED
@@ -1,191 +0,0 @@
1
- var x=Symbol("sveld.parsedComponentTypeScriptMetadata"),I=Symbol("sveld.parsedComponentPropIgnores");function fo(Z){return Z[I]}function mo(Z){return Z[x]}var Bs=Array(2048).fill(void 0);function Rc(){Bs.fill(void 0)}function go(Z,ee,Le,Ot){let Bt=Ot&2047,jt=Bs[Bt];if(jt!==void 0&&jt.length===Le-ee&&Z.startsWith(jt,ee))return jt;let Gt=Z.slice(ee,Le);return Bs[Bt]=Gt,Gt}var oi="",Dn=[0],Vn=0,ri=0,jn;function te(Z){Rc(),oi=Z,Dn=[0],Vn=0,ri=0,jn=void 0}function js(Z){while(Vn<=Z){let ee=oi.indexOf(`
2
- `,Vn);if(ee===-1){Vn=Number.POSITIVE_INFINITY;return}Vn=ee+1,Dn.push(Vn)}}function yo(Z){let ee=[0],Le=Z.indexOf(`
3
- `);while(Le!==-1)ee.push(Le+1),Le=Z.indexOf(`
4
- `,Le+1);return ee}function qi(Z,ee,Le){let Ot=0,Bt=Z.length-1;if(ee>=Z[Le])Ot=Le;else Bt=Le-1;if(Ot<Bt&&ee<Z[Ot+1])Bt=Ot;while(Ot<Bt){let jt=Ot+Bt+1>>>1;if(Z[jt]<=ee)Ot=jt;else Bt=jt-1}return Ot}function y(Z){return js(Z),ri=qi(Dn,Z,ri),{line:ri+1,column:Z-Dn[ri],character:Z}}var Fs=/\r\n?|\n|\u2028|\u2029/g,Ic=/[\r\u2028\u2029]/;function xo(Z){if(jn===void 0){jn=Ic.test(oi)?[]:null,Fs.lastIndex=0;while(jn!==null&&Fs.exec(oi)!==null)jn.push(Fs.lastIndex)}if(jn===null)return js(Z),qi(Dn,Z,ri);let ee=0,Le=jn.length;while(ee<Le){let Ot=ee+Le>>>1;if(jn[Ot]<=Z)ee=Ot+1;else Le=Ot}return ee}function A(Z){let{line:ee,column:Le}=y(Z);return{line:ee,column:Le}}function vo(Z){while(Dn.length<=Z+1&&Vn!==Number.POSITIVE_INFINITY)js(Vn);if(Z>=Dn.length)return;let ee=Z+1<Dn.length?Dn[Z+1]-1:oi.length;return oi.slice(Dn[Z],ee)}function Ee(Z){let ee,Le=0;return(Ot)=>(ee??=yo(Z),Le=qi(ee,Ot,Le),{line:Le+1,column:Ot-ee[Le]})}function Ln(Z){return typeof Z==="object"&&Z!==null&&typeof Xn(Z).type==="string"}function Xn(Z){return Z}function W(Z,ee){let Le=Xn(Z);for(let Ot in Le){let Bt=Le[Ot];if(Array.isArray(Bt)){for(let jt=0;jt<Bt.length;jt++)if(Ln(Bt[jt]))Bt[jt]=ee(Bt[jt])}else if(Ln(Bt))Le[Ot]=ee(Bt)}}function ne(Z,...ee){if(!ee.some((Le)=>Le===Z.type))throw Error(`expected ${ee.join(" or ")}, got ${Z.type}`)}function ve(Z){let ee=[];return Jn(Z,ee),ee}function Jn(Z,ee){switch(Z.type){case"Identifier":ee.push(Z);return;case"ObjectPattern":for(let Le of Z.properties)Jn(Le.type==="RestElement"?Le.argument:Le.value,ee);return;case"ArrayPattern":for(let Le of Z.elements)if(Le!==null)Jn(Le,ee);return;case"RestElement":Jn(Z.argument,ee);return;case"AssignmentPattern":Jn(Z.left,ee);return;case"TSParameterProperty":Jn(Z.parameter,ee);return;case"TSAsExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":Jn(Z.expression,ee)}}function H(Z,ee){if(Z.type!=="Identifier")return!1;if(ee===null)return!0;switch(ee.type){case"MemberExpression":return ee.computed||Z===ee.object;case"MethodDefinition":return ee.computed;case"Property":case"PropertyDefinition":return ee.computed||Z===ee.value;case"ExportSpecifier":case"ImportSpecifier":return Z===ee.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 Z===ee.expression;case"TSEnumMember":return Z===ee.initializer;case"TSParameterProperty":case"TSEnumDeclaration":case"TSImportEqualsDeclaration":return!0;default:return!ee.type.startsWith("TS")}}var Yn={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 rn=[],ai={...Yn,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:rn,TSTypeParameterDeclaration:rn,TSTypeParameterInstantiation:rn,TSTypeParameter:rn,TSArrayType:rn,TSTupleType:rn,TSNamedTupleMember:rn,TSOptionalType:rn,TSRestType:rn,TSUnionType:rn,TSIntersectionType:rn,TSConditionalType:rn,TSInferType:rn,TSParenthesizedType:rn,TSTypeOperator:rn,TSIndexedAccessType:rn,TSMappedType:rn,TSLiteralType:rn,TSTypeReference:rn,TSTypeQuery:rn,TSImportType:rn,TSTypeLiteral:rn,TSPropertySignature:rn,TSMethodSignature:rn,TSCallSignatureDeclaration:rn,TSConstructSignatureDeclaration:rn,TSFunctionType:rn,TSConstructorType:rn,TSIndexSignature:rn,TSTypePredicate:rn,TSInterfaceDeclaration:rn,TSInterfaceBody:rn,TSExpressionWithTypeArguments:rn,TSTypeAliasDeclaration:rn,TSNamespaceExportDeclaration:rn,TSDeclareFunction:["id"],TSDeclareMethod:rn,TSAsExpression:["expression"],TSSatisfiesExpression:["expression"],TSTypeAssertion:["expression"],TSInstantiationExpression:["expression"]},Oc=Object.assign(Object.create(null),Yn),Lc=Object.assign(Object.create(null),ai),Eo=[],E=Symbol("sveast.walk.stop"),p=Symbol("sveast.walk.skip");function o(Z,ee,Le){zi(Z,null,null,null,ee,Mc(Le))}function Mc(Z){if(Z===void 0||Z===Yn)return Bc;if(Z===ai)return jc;return(ee)=>Fc(Z,ee.type)}function Fc(Z,ee){return Object.hasOwn(Z,ee)?Z[ee]:void 0}var Am=Object.freeze([]);function zi(Z,ee,Le,Ot,Bt,jt){let Gt=jt(Z);if(Gt===void 0)throw Error(`unknown node type: ${Z.type}`);let Lt=Bt.enter?.(Z,ee,Le,Ot);if(Lt===E)return!0;if(Lt!==p){if(Lt!==Z&&Ln(Lt))return Vc(Lt,ee,Le,Ot,Bt,jt);let Vt=Xn(Z);for(let Wt=0;Wt<Gt.length;Wt++){let Ut=Gt[Wt],Kt=Vt[Ut];if(Array.isArray(Kt))for(let qt=0;qt<Kt.length;qt++){let zt=Kt[qt];if(Ln(zt)&&zi(zt,Z,Ut,qt,Bt,jt))return!0}else if(Ln(Kt)&&zi(Kt,Z,Ut,null,Bt,jt))return!0}}return Bt.leave?.(Z,ee,Le,Ot)===E}function Bc(Z){let ee=Z.type;if(ee==="Identifier")return Z.typeAnnotation===void 0&&Z.decorators===void 0?Eo:Yn.Identifier;if(ee==="Literal")return Yn.Literal;if(ee==="Text")return Yn.Text;return Oc[ee]}function jc(Z){let ee=Z.type;if(ee==="Identifier")return Z.decorators===void 0?Eo:ai.Identifier;if(ee==="Literal")return ai.Literal;if(ee==="Text")return ai.Text;return Lc[ee]}function Vc(Z,ee,Le,Ot,Bt,jt){if(ee===null||Le===null)throw Error("walk can't replace the node it was called with");let Gt=Xn(ee),Lt=Gt[Le];if(Ot===null)Gt[Le]=Z;else if(Array.isArray(Lt))Lt[Ot]=Z;return zi(Z,ee,Le,Ot,Bt,jt)}function r(Z){return typeof Z==="object"&&Z!==null}function S(Z){return r(Z)&&Z.type==="Literal"}function t(Z){return r(Z)&&Z.type==="Identifier"&&typeof Z.name==="string"}function b(Z){return r(Z)&&Z.type==="MemberExpression"}function c(Z){return r(Z)&&Z.type==="ObjectExpression"&&Array.isArray(Z.properties)}function Gc(Z){return r(Z)&&Z.type==="CallExpression"}function f(Z,ee){return Gc(Z)&&t(Z.callee)&&Z.callee.name===ee}function T(Z){return Z?.type==="TSAsExpression"||Z?.type==="TSSatisfiesExpression"?T(Z.expression):Z}function Oe(Z){return Z?.type==="TSAsExpression"||Z?.type==="TSSatisfiesExpression"?Z.typeAnnotation:void 0}function Wc(Z){return r(Z)&&Z.type==="NewExpression"}function Se(Z,ee){return Wc(Z)&&t(Z.callee)&&Z.callee.name===ee}function C(Z){if(!r(Z))return null;if(Z.type==="Literal")return Z.value==null?null:String(Z.value);if(Z.type==="TemplateLiteral"){let ee=Z.quasis;if(ee?.length===1)return ee[0]?.value?.cooked??null}return null}function l(Z){if(t(Z))return Z.name;if(S(Z))return Z.value==null?void 0:String(Z.value);return}var Uc=new Set(["Component","SvelteComponent","SvelteSelf"]),Hc=new Set(["RegularElement","SvelteElement"]);function L(Z){return Uc.has(Z)}function D(Z){return Hc.has(Z)}function Xi(Z,ee,Le=0,Ot=Z.length,Bt=0){let jt=Bt;for(let Gt=Le;Gt<Ot;Gt++){let Lt=Z.charCodeAt(Gt);if(Lt===34||Lt===39||Lt===96){Gt=Kc(Z,Gt,Ot);continue}if(Lt===123||Lt===40||Lt===91||Lt===60)jt++;else if(Lt===125||Lt===41||Lt===93||Lt===62&&Z.charCodeAt(Gt-1)!==61){if(jt>0)jt--}if(ee?.(Gt,jt)===!0)break}return jt}function Kc(Z,ee,Le){let Ot=Z.charCodeAt(ee);for(let Bt=ee+1;Bt<Le;Bt++){let jt=Z.charCodeAt(Bt);if(jt===92)Bt++;else if(jt===Ot)return Bt}return Le-1}function i(Z,ee){let Le=[],Ot=0;return Xi(Z,(Bt,jt)=>{if(jt===0&&ee.includes(Z[Bt]))Le.push(Z.slice(Ot,Bt)),Ot=Bt+1;return!1}),Le.push(Z.slice(Ot)),Le}function Vs(Z,ee,Le=0){let Ot=-1;return Xi(Z,(Bt,jt)=>{if(ee(Bt,jt))Ot=Bt;return Ot!==-1},Le),Ot}function U(Z,ee){return Vs(Z,(Le,Ot)=>Ot===0&&ee.includes(Z[Le]))}function k(Z){return Vs(Z,(ee,Le)=>Le===0&&Z[ee]==="="&&Z[ee+1]===">")}function w(Z,ee){return Vs(Z,(Le,Ot)=>Ot===0,ee)}function Gs(Z){let ee=Z.trim();return ee.startsWith("[")&&w(ee,0)===ee.length-1}function re(Z){if(!Z)return;let ee=k(Z);if(ee===-1)return;return Z.slice(ee+2).trim()||void 0}var qc=new Set(["null","undefined"]);function ie(Z){if(!Z)return!1;let ee=i(Z,"|").map((Ot)=>Ot.trim()).filter((Ot)=>Ot&&!qc.has(Ot));if(ee.length!==1)return!1;let[Le]=ee;while(Le.startsWith("(")&&w(Le,0)===Le.length-1)Le=Le.slice(1,-1).trim();return(Le.startsWith("(")||Le.startsWith("<"))&&k(Le)!==-1}function zc(Z){let ee="";for(let Le=0;Le<Z.length;Le++){let Ot=Z[Le];if(Ot==="*"&&Z[Le+1]==="*"){if(Le++,Z[Le+1]==="/")ee+="(?:.*/)?",Le++;else ee+=".*";continue}if(Ot==="*"){ee+="[^/]*";continue}if(Ot==="?"){ee+="[^/]";continue}ee+=".+^$()[]{}|\\".includes(Ot)?`\\${Ot}`:Ot}return ee}function So(Z,ee){return new RegExp(`^${zc(Z)}$`).test(ee)}var Ws={"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 a(Z){return{...Z,code:z[Z.kind],severity:Ws[Z.kind].severity}}function Co(Z,ee){if(ee)return Z;return Z.filter((Le)=>Le.kind!=="jsdoc-unknown-tag")}function bo(Z,ee){if(!ee)return[];return Z.filter((Le)=>!Le.ignored&&(ee!=="errors"||Le.severity==="error"))}function Xc(Z,ee){if(ee.code!==void 0&&ee.code!==Z.code)return!1;if(ee.name!==void 0&&ee.name!==Z.name)return!1;if(ee.component!==void 0&&!So(ee.component,Z.component))return!1;return!0}function wo(Z,ee){if(!ee||ee.length===0)return Z;return Z.map((Le)=>Le.ignored||ee.some((Ot)=>Xc(Le,Ot))?{...Le,ignored:!0}:Le)}var To=Object.keys(Ws),z=Object.fromEntries(To.map((Z)=>[Z,`sveld/${Z}`]));function ko(Z){let ee=new Set,Le=[];for(let Ot of Z){let Bt=`${Ot.component}:${Ot.kind}:${Ot.name}`;if(ee.has(Bt))continue;ee.add(Bt),Le.push(Ot)}return Le}function Ao(Z){let ee=Z.filter((Vt)=>!Vt.ignored),Le=Z.length-ee.length,Ot=Le>0?` (${Le} ignored)`:"";if(ee.length===0)return`sveld: no diagnostics${Ot}.`;let Bt=[],jt=(Vt,Wt)=>`${Vt} ${Wt}${Vt===1?"":"s"}`,Gt=ee.filter((Vt)=>Vt.severity==="error").length,Lt=`${jt(Gt,"error")}, ${jt(ee.length-Gt,"warning")}`;Bt.push(`sveld: ${jt(ee.length,"diagnostic")} (${Lt})${Ot}.`);for(let Vt of To){let Wt=ee.filter((Kt)=>Kt.kind===Vt);if(Wt.length===0)continue;Bt.push(""),Bt.push(`${Ws[Vt].label} (${Wt.length}):`);let Ut=new Map;for(let Kt of Wt){let qt=Ut.get(Kt.component)??[];qt.push(Kt),Ut.set(Kt.component,qt)}for(let[Kt,qt]of Ut){Bt.push(` ${Kt}`);for(let zt of qt){let Xt=zt.source?` (${Kt}:${zt.source.start.line}:${zt.source.start.column})`:"";Bt.push(` - ${zt.message}${Xt} [${zt.code}]`)}}}return Bt.join(`
5
- `)}function Po(Z){return Z.replaceAll("%","%25").replaceAll("\r","%0D").replaceAll(`
6
- `,"%0A")}function Jc(Z){return Po(Z).replaceAll(":","%3A").replaceAll(",","%2C")}function Yc(Z){let Le=[["file",Z.file],["line",Z.line],["col",Z.column],["endLine",Z.endLine],["endColumn",Z.endColumn],["title",Z.title]].filter((Ot)=>Ot[1]!==void 0).map(([Ot,Bt])=>`${Ot}=${Jc(String(Bt))}`).join(",");return`::${Z.severity} ${Le}::${Po(Z.message)}`}function _o(Z,ee){let Le=Z.filter((Bt)=>!Bt.ignored);return[...Le.filter((Bt)=>Bt.severity==="error"),...Le.filter((Bt)=>Bt.severity!=="error")].map(({source:Bt,...jt})=>{let Gt=Bt!==void 0&&Bt.start.line===Bt.end.line;return Yc({severity:jt.severity,title:jt.code,message:jt.message,file:ee(jt.component),line:Bt?.start.line,column:Gt?Bt.start.column+1:void 0,endLine:Bt?.end.line,endColumn:Gt?Bt.end.column+1:void 0})}).join(`
7
- `)}var Me=1;function $o(Z){return`${JSON.stringify({kind:"diagnostics",schemaVersion:Me,diagnostics:Z},null,2)}
8
- `}function pi(Z,ee){if(ee.length===0)return;Z.diagnostics=[...Z.diagnostics??[],...ee]}var Qc=/\*\//g,Zc=/[.*+?^${}()|[\]\\]/g;function N(Z){return Z.replace(Zc,"\\$&")}function O(Z){return Z.replace(Qc,"*\\/")}function m(Z){return Z.map((ee)=>`${ee.name}${ee.optional?"?":""}: ${ee.type}`).join(", ")}var el=new Intl.Collator("en");function u(Z,ee){return el.compare(Z,ee)}var tl=/(?:_|[^\p{ID_Continue}$])+/u,nl=/^[\p{ID_Start}$]/u;function J(Z){let Ot=`${Z.split(tl).map((Bt)=>Bt.charAt(0).toUpperCase()+Bt.slice(1)).join("")}Context`;return nl.test(Ot)?Ot:`_${Ot}`}function se({imported:Z}){return Z.type==="Identifier"?Z.name:Z.value}function K(Z,ee){let Le=ee.source.value;if(typeof Le!=="string"||ee.importKind==="type")return;for(let Ot of ee.specifiers){if(Ot.type!=="ImportSpecifier"||Ot.importKind==="type")continue;let Bt=Ot.local.name,jt=se(Ot);Z.valueImportBindingsByLocalName.set(Bt,{localName:Bt,importedName:jt,source:Le})}}function oe(Z){return[Z.importedName,...Z.members??[]].join(".")}function be(Z,ee){let Le=[],Ot=ee;while(b(Ot)){if(Ot.computed||!t(Ot.property))return;Le.unshift(Ot.property.name),Ot=Ot.object}if(!t(Ot))return;return X(Z,Ot.name,Le)}function X(Z,ee,Le=[]){let Ot=(jt,Gt,Lt)=>Lt.length>0?{source:jt,importedName:Gt,members:Lt}:{source:jt,importedName:Gt},Bt=Z.valueImportBindingsByLocalName.get(ee);if(Bt)return Ot(Bt.source,Bt.importedName,Le);for(let jt of[Z.parsed?.instance,Z.parsed?.module])for(let Gt of jt?.content.body??[]){if(Gt.type!=="ImportDeclaration")continue;let Lt=Gt.source.value;if(Gt.importKind==="type"||typeof Lt!=="string")continue;let Vt=Gt.specifiers.find((Wt)=>Wt.local.name===ee);if(Vt?.type==="ImportDefaultSpecifier")return Ot(Lt,"default",Le);if(Vt?.type==="ImportNamespaceSpecifier"&&Le.length>0)return Ot(Lt,Le[0],Le.slice(1))}return}function ae(Z,ee){if(!b(ee))return;return be(Z,ee)}function Fe(Z){let ee=new Map;for(let Le of Z.content.body){if(Le.type!=="ImportDeclaration"||Le.importKind==="type")continue;let Ot=Le.source.value;if(typeof Ot!=="string")continue;for(let Bt of Le.specifiers){if(Bt.type==="ImportSpecifier"&&Bt.importKind==="type")continue;let jt=Bt.local.name,Gt;if(Bt.type==="ImportDefaultSpecifier")Gt="default";else if(Bt.type==="ImportNamespaceSpecifier")Gt="*";else Gt=se(Bt);ee.set(jt,{from:Ot,imported:Gt})}}return ee}function Te(Z,ee){for(let Le of ee?.content.body??[]){if(Le.type==="ImportDeclaration"){K(Z,Le);continue}let Ot=Le.type==="ExportNamedDeclaration"&&Le.declaration?Le.declaration:Le;if(Ot.type==="FunctionDeclaration"&&Ot.id?.name)Z.funcDecls.set(Ot.id.name,Ot)}}function le(Z){return Z==="TSTypeAnnotation"||Z==="TSTypeAliasDeclaration"||Z==="TSInterfaceDeclaration"||Z==="TSTypeParameterDeclaration"||Z==="TSTypeParameterInstantiation"}function Y(Z){let ee=[];return o(Z,{enter(Le){if(Le.type==="FunctionDeclaration"||Le.type==="FunctionExpression"||Le.type==="ArrowFunctionExpression")return p;if(Le.type==="ReturnStatement")ee.push(Le.argument??null)}}),ee}var Us={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"},Hs="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",il={5:Hs,"5module":Hs+" export import",6:Hs+" const class extends export import super"},Oo=/^in(stanceof)?$/,sl=/\p{ID_Start}/u,rl=/[\p{ID_Continue}\u200c\u200d]/u;function h(Z,ee){if(Z<65)return Z===36;if(Z<91)return!0;if(Z<97)return Z===95;if(Z<123)return!0;if(Z>65535&&ee===!1)return!1;return Z>=170&&sl.test(String.fromCodePoint(Z))}function v(Z,ee){if(Z<48)return Z===36;if(Z<58)return!0;if(Z<65)return!1;if(Z<91)return!0;if(Z<97)return Z===95;if(Z<123)return!0;if(Z>65535&&ee===!1)return!1;return Z>=170&&rl.test(String.fromCodePoint(Z))}var an=function(Z,ee){if(ee===void 0)ee={};this.label=Z,this.keyword=ee.keyword,this.beforeExpr=!!ee.beforeExpr,this.startsExpr=!!ee.startsExpr,this.isLoop=!!ee.isLoop,this.isAssign=!!ee.isAssign,this.prefix=!!ee.prefix,this.postfix=!!ee.postfix,this.binop=ee.binop||null,this.updateContext=null};function Cn(Z,ee){return new an(Z,{beforeExpr:!0,binop:ee})}var bn={beforeExpr:!0},xn={startsExpr:!0},Xs={};function on(Z,ee){if(ee===void 0)ee={};return ee.keyword=Z,Xs[Z]=new an(Z,ee)}var Ht={num:new an("num",xn),regexp:new an("regexp",xn),string:new an("string",xn),name:new an("name",xn),privateId:new an("privateId",xn),eof:new an("eof"),bracketL:new an("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new an("]"),braceL:new an("{",{beforeExpr:!0,startsExpr:!0}),braceR:new an("}"),parenL:new an("(",{beforeExpr:!0,startsExpr:!0}),parenR:new an(")"),comma:new an(",",bn),semi:new an(";",bn),colon:new an(":",bn),dot:new an("."),question:new an("?",bn),questionDot:new an("?."),arrow:new an("=>",bn),template:new an("template"),invalidTemplate:new an("invalidTemplate"),ellipsis:new an("...",bn),backQuote:new an("`",xn),dollarBraceL:new an("${",{beforeExpr:!0,startsExpr:!0}),eq:new an("=",{beforeExpr:!0,isAssign:!0}),assign:new an("_=",{beforeExpr:!0,isAssign:!0}),incDec:new an("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new an("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:Cn("||",1),logicalAND:Cn("&&",2),bitwiseOR:Cn("|",3),bitwiseXOR:Cn("^",4),bitwiseAND:Cn("&",5),equality:Cn("==/!=/===/!==",6),relational:Cn("</>/<=/>=",7),bitShift:Cn("<</>>/>>>",8),plusMin:new an("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:Cn("%",10),star:Cn("*",10),slash:Cn("/",10),starstar:new an("**",{beforeExpr:!0}),coalesce:Cn("??",1),_break:on("break"),_case:on("case",bn),_catch:on("catch"),_continue:on("continue"),_debugger:on("debugger"),_default:on("default",bn),_do:on("do",{isLoop:!0,beforeExpr:!0}),_else:on("else",bn),_finally:on("finally"),_for:on("for",{isLoop:!0}),_function:on("function",xn),_if:on("if"),_return:on("return",bn),_switch:on("switch"),_throw:on("throw",bn),_try:on("try"),_var:on("var"),_const:on("const"),_while:on("while",{isLoop:!0}),_with:on("with"),_new:on("new",{beforeExpr:!0,startsExpr:!0}),_this:on("this",xn),_super:on("super",xn),_class:on("class",xn),_extends:on("extends",bn),_export:on("export"),_import:on("import",xn),_null:on("null",xn),_true:on("true",xn),_false:on("false",xn),_in:on("in",{beforeExpr:!0,binop:7}),_instanceof:on("instanceof",{beforeExpr:!0,binop:7}),_typeof:on("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:on("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:on("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},vn=/\r\n?|\n|\u2028|\u2029/,ol=new RegExp(vn.source,"g");function ci(Z){return Z===10||Z===13||Z===8232||Z===8233}function Lo(Z,ee,Le){if(Le===void 0)Le=Z.length;for(var Ot=ee;Ot<Le;Ot++){var Bt=Z.charCodeAt(Ot);if(ci(Bt))return Ot<Le-1&&Bt===13&&Z.charCodeAt(Ot+1)===10?Ot+2:Ot+1}return-1}var Mo=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,hn=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,al=Object.prototype,{hasOwnProperty:pl,toString:cl}=al,Si=Object.hasOwn||function(Z,ee){return pl.call(Z,ee)},No=Array.isArray||function(Z){return cl.call(Z)==="[object Array]"},Do=Object.create(null);function Ji(Z){return Do[Z]||(Do[Z]=new RegExp("^(?:"+Z.replace(/ /g,"|")+")$"))}function es(Z){if(Z<=65535)return String.fromCharCode(Z);return Z-=65536,String.fromCharCode((Z>>10)+55296,(Z&1023)+56320)}var ll=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Ei=function(Z,ee){this.line=Z,this.column=ee};Ei.prototype.offset=function(Z){return new Ei(this.line,this.column+Z)};var ts=function(Z,ee,Le){if(this.start=ee,this.end=Le,Z.sourceFile!==null)this.source=Z.sourceFile};function Fo(Z,ee){for(var Le=1,Ot=0;;){var Bt=Lo(Z,Ot,ee);if(Bt<0)return new Ei(Le,ee-Ot);++Le,Ot=Bt}}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},Ro=!1;function ul(Z){var ee={};for(var Le in Ks)ee[Le]=Z&&Si(Z,Le)?Z[Le]:Ks[Le];if(ee.ecmaVersion==="latest")ee.ecmaVersion=1e8;else if(ee.ecmaVersion==null){if(!Ro&&typeof console==="object"&&console.warn)Ro=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
9
- Defaulting to 2020, but this will stop working in the future.`);ee.ecmaVersion=11}else if(ee.ecmaVersion>=2015)ee.ecmaVersion-=2009;if(ee.allowReserved==null)ee.allowReserved=ee.ecmaVersion<5;if(!Z||Z.allowHashBang==null)ee.allowHashBang=ee.ecmaVersion>=14;if(No(ee.onToken)){var Ot=ee.onToken;ee.onToken=function(Bt){return Ot.push(Bt)}}if(No(ee.onComment))ee.onComment=hl(ee,ee.onComment);if(ee.sourceType==="commonjs"&&ee.allowAwaitOutsideFunction)throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return ee}function hl(Z,ee){return function(Le,Ot,Bt,jt,Gt,Lt){var Vt={type:Le?"Block":"Line",value:Ot,start:Bt,end:jt};if(Z.locations)Vt.loc=new ts(this,Gt,Lt);if(Z.ranges)Vt.range=[Bt,jt];ee.push(Vt)}}var Qn=1,Zn=2,Js=4,Bo=8,Ys=16,jo=32,ns=64,Vo=128,ei=256,Ci=512,Go=1024,is=Qn|Zn|ei;function Qs(Z,ee){return Zn|(Z?Js:0)|(ee?Bo:0)}var Yi=0,Zs=1,Mn=2,Wo=3,Uo=4,Ho=5,s=function(Z,ee,Le){this.options=Z=ul(Z),this.sourceFile=Z.sourceFile,this.keywords=Ji(il[Z.ecmaVersion>=6?6:Z.sourceType==="module"?"5module":5]);var Ot="";if(Z.allowReserved!==!0){if(Ot=Us[Z.ecmaVersion>=6?6:Z.ecmaVersion===5?5:3],Z.sourceType==="module")Ot+=" await"}this.reservedWords=Ji(Ot);var Bt=(Ot?Ot+" ":"")+Us.strict;if(this.reservedWordsStrict=Ji(Bt),this.reservedWordsStrictBind=Ji(Bt+" "+Us.strictBind),this.input=String(ee),this.containsEsc=!1,this.pos=Le||0,this.curLine=1,Z.startLocation)this.lineStart=this.pos-Z.startLocation.column,this.curLine=Z.startLocation.line;else if(Le){if(this.lineStart=this.input.lastIndexOf(`
10
- `,Le-1)+1,this.options.locations)this.curLine=this.input.slice(0,this.lineStart).split(vn).length}else this.lineStart=0;if(this.type=Ht.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=Z.sourceType==="module",this.strict=this.inModule||Z.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&&Z.allowHashBang&&this.input.slice(0,2)==="#!")this.skipLineComment(2);this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?Zn:Qn),this.regexpState=null,this.privateNameStack=[]},wn={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}};s.prototype.parse=function(){var Z=this,ee=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return Z.parseTopLevel(ee)})};wn.inFunction.get=function(){return(this.currentVarScope().flags&Zn)>0};wn.inGenerator.get=function(){return(this.currentVarScope().flags&Bo)>0};wn.inAsync.get=function(){return(this.currentVarScope().flags&Js)>0};wn.canAwait.get=function(){for(var Z=this.scopeStack.length-1;Z>=0;Z--){var ee=this.scopeStack[Z],Le=ee.flags;if(Le&(ei|Ci))return!1;if(Le&Zn)return(Le&Js)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};wn.allowReturn.get=function(){if(this.inFunction)return!0;if(this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&Qn)return!0;return!1};wn.allowSuper.get=function(){var Z=this.currentThisScope(),ee=Z.flags;return(ee&ns)>0||this.options.allowSuperOutsideMethod};wn.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Vo)>0};wn.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};wn.allowNewDotTarget.get=function(){for(var Z=this.scopeStack.length-1;Z>=0;Z--){var ee=this.scopeStack[Z],Le=ee.flags;if(Le&(ei|Ci)||Le&Zn&&!(Le&Ys))return!0}return!1};wn.allowUsing.get=function(){var Z=this.currentScope(),ee=Z.flags;if(ee&Go)return!1;if(!this.inModule&&ee&Qn)return!1;return!0};wn.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&ei)>0};s.extend=function(){var Z=[],ee=arguments.length;while(ee--)Z[ee]=arguments[ee];var Le=this;for(var Ot=0;Ot<Z.length;Ot++)Le=Z[Ot](Le);return Le};s.parse=function(Z,ee){return new this(ee,Z).parse()};s.parseExpressionAt=function(Z,ee,Le){var Ot=new this(Le,Z,ee);return Ot.nextToken(),Ot.parseExpression()};s.tokenizer=function(Z,ee){return new this(ee,Z)};Object.defineProperties(s.prototype,wn);var mn=s.prototype,dl=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;mn.strictDirective=function(Z){if(this.options.ecmaVersion<5)return!1;for(;;){hn.lastIndex=Z,Z+=hn.exec(this.input)[0].length;var ee=dl.exec(this.input.slice(Z));if(!ee)return!1;if((ee[1]||ee[2])==="use strict"){hn.lastIndex=Z+ee[0].length;var Le=hn.exec(this.input),Ot=Le.index+Le[0].length,Bt=this.input.charAt(Ot);return Bt===";"||Bt==="}"||vn.test(Le[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(Bt)||Bt==="!"&&this.input.charAt(Ot+1)==="=")}if(Z+=ee[0].length,hn.lastIndex=Z,Z+=hn.exec(this.input)[0].length,this.input[Z]===";")Z++}};mn.eat=function(Z){if(this.type===Z)return this.next(),!0;else return!1};mn.isContextual=function(Z){return this.type===Ht.name&&this.value===Z&&!this.containsEsc};mn.eatContextual=function(Z){if(!this.isContextual(Z))return!1;return this.next(),!0};mn.catchStackOverflow=function(Z){try{return Z()}catch(ee){if(ee instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(ee.message)||/\btoo much recursion\b/i.test(ee.message)))this.raise(this.start,"Not enough stack space to parse input");else throw ee}};mn.expectContextual=function(Z){if(!this.eatContextual(Z))this.unexpected()};mn.canInsertSemicolon=function(){return this.type===Ht.eof||this.type===Ht.braceR||vn.test(this.input.slice(this.lastTokEnd,this.start))};mn.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return!0}};mn.semicolon=function(){if(!this.eat(Ht.semi)&&!this.insertSemicolon())this.unexpected()};mn.afterTrailingComma=function(Z,ee){if(this.type===Z){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);if(!ee)this.next();return!0}};mn.expect=function(Z){this.eat(Z)||this.unexpected()};mn.unexpected=function(Z){this.raise(Z!=null?Z:this.start,"Unexpected token")};var ss=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};mn.checkPatternErrors=function(Z,ee){if(!Z)return;if(Z.trailingComma>-1)this.raiseRecoverable(Z.trailingComma,"Comma is not permitted after the rest element");var Le=ee?Z.parenthesizedAssign:Z.parenthesizedBind;if(Le>-1)this.raiseRecoverable(Le,ee?"Assigning to rvalue":"Parenthesized pattern")};mn.checkExpressionErrors=function(Z,ee){if(!Z)return!1;var{shorthandAssign:Le,doubleProto:Ot}=Z;if(!ee)return Le>=0||Ot>=0;if(Le>=0)this.raise(Le,"Shorthand property assignments are valid only in destructuring patterns");if(Ot>=0)this.raiseRecoverable(Ot,"Redefinition of __proto__ property")};mn.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")};mn.isSimpleAssignTarget=function(Z){if(Z.type==="ParenthesizedExpression")return this.isSimpleAssignTarget(Z.expression);return Z.type==="Identifier"||Z.type==="MemberExpression"};var Qt=s.prototype;Qt.parseTopLevel=function(Z){var ee=Object.create(null);if(!Z.body)Z.body=[];while(this.type!==Ht.eof){var Le=this.parseStatement(null,!0,ee);Z.body.push(Le)}if(this.inModule)for(var Ot=0,Bt=Object.keys(this.undefinedExports);Ot<Bt.length;Ot+=1){var jt=Bt[Ot];this.raiseRecoverable(this.undefinedExports[jt].start,"Export '"+jt+"' is not defined")}return this.adaptDirectivePrologue(Z.body),this.next(),Z.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(Z,"Program")};var er={kind:"loop"},fl={kind:"switch"};Qt.isLet=function(Z){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;hn.lastIndex=this.pos;var ee=hn.exec(this.input),Le=this.pos+ee[0].length,Ot=this.fullCharCodeAt(Le);if(Ot===91||Ot===92)return!0;if(Z)return!1;if(Ot===123)return!0;if(h(Ot)){var Bt=Le;do Le+=Ot<=65535?1:2;while(v(Ot=this.fullCharCodeAt(Le)));if(Ot===92)return!0;var jt=this.input.slice(Bt,Le);if(!Oo.test(jt))return!0}return!1};Qt.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;hn.lastIndex=this.pos;var Z=hn.exec(this.input),ee=this.pos+Z[0].length,Le;return!vn.test(this.input.slice(this.pos,ee))&&this.input.slice(ee,ee+8)==="function"&&(ee+8===this.input.length||!(v(Le=this.fullCharCodeAt(ee+8))||Le===92))};Qt.isUsingKeyword=function(Z,ee){if(this.options.ecmaVersion<17||!this.isContextual(Z?"await":"using"))return!1;hn.lastIndex=this.pos;var Le=hn.exec(this.input),Ot=this.pos+Le[0].length;if(vn.test(this.input.slice(this.pos,Ot)))return!1;if(Z){var Bt=Ot+5,jt;if(this.input.slice(Ot,Bt)!=="using"||Bt===this.input.length||v(jt=this.fullCharCodeAt(Bt))||jt===92)return!1;hn.lastIndex=Bt;var Gt=hn.exec(this.input);if(Ot=Bt+Gt[0].length,Gt&&vn.test(this.input.slice(Bt,Ot)))return!1}var Lt=this.fullCharCodeAt(Ot);if(!h(Lt)&&Lt!==92)return!1;var Vt=Ot;do Ot+=Lt<=65535?1:2;while(v(Lt=this.fullCharCodeAt(Ot)));if(Lt===92)return!0;var Wt=this.input.slice(Vt,Ot);if(Oo.test(Wt))return!1;if(ee&&!Z&&Wt==="of"){hn.lastIndex=Ot;var Ut=hn.exec(this.input);if(Ot=Ot+Ut[0].length,this.input.charCodeAt(Ot)!==61||(Lt=this.input.charCodeAt(Ot+1))===61||Lt===62)return!1}return!0};Qt.isAwaitUsing=function(Z){return this.isUsingKeyword(!0,Z)};Qt.isUsing=function(Z){return this.isUsingKeyword(!1,Z)};Qt.parseStatement=function(Z,ee,Le){var Ot=this.type,Bt=this.startNode(),jt;if(this.isLet(Z))Ot=Ht._var,jt="let";switch(Ot){case Ht._break:case Ht._continue:return this.parseBreakContinueStatement(Bt,Ot.keyword);case Ht._debugger:return this.parseDebuggerStatement(Bt);case Ht._do:return this.parseDoStatement(Bt);case Ht._for:return this.parseForStatement(Bt);case Ht._function:if(Z&&(this.strict||Z!=="if"&&Z!=="label")&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(Bt,!1,!Z);case Ht._class:if(Z)this.unexpected();return this.parseClass(Bt,!0);case Ht._if:return this.parseIfStatement(Bt);case Ht._return:return this.parseReturnStatement(Bt);case Ht._switch:return this.parseSwitchStatement(Bt);case Ht._throw:return this.parseThrowStatement(Bt);case Ht._try:return this.parseTryStatement(Bt);case Ht._const:case Ht._var:if(jt=jt||this.value,Z&&jt!=="var")this.unexpected();return this.parseVarStatement(Bt,jt);case Ht._while:return this.parseWhileStatement(Bt);case Ht._with:return this.parseWithStatement(Bt);case Ht.braceL:return this.parseBlock(!0,Bt);case Ht.semi:return this.parseEmptyStatement(Bt);case Ht._export:case Ht._import:if(this.options.ecmaVersion>10&&Ot===Ht._import){hn.lastIndex=this.pos;var Gt=hn.exec(this.input),Lt=this.pos+Gt[0].length,Vt=this.input.charCodeAt(Lt);if(Vt===40||Vt===46)return this.parseExpressionStatement(Bt,this.parseExpression())}if(!this.options.allowImportExportEverywhere){if(!ee)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 Ot===Ht._import?this.parseImport(Bt):this.parseExport(Bt,Le);default:if(this.isAsyncFunction()){if(Z)this.unexpected();return this.next(),this.parseFunctionStatement(Bt,!0,!Z)}var Wt=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(Wt){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(Z)this.raise(this.start,"Using declaration is not allowed in single-statement positions");if(Wt==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.next(),this.parseVar(Bt,!1,Wt),this.semicolon(),this.finishNode(Bt,"VariableDeclaration")}var Ut=this.value,Kt=this.parseExpression();if(Ot===Ht.name&&Kt.type==="Identifier"&&this.eat(Ht.colon))return this.parseLabeledStatement(Bt,Ut,Kt,Z);else return this.parseExpressionStatement(Bt,Kt)}};Qt.parseBreakContinueStatement=function(Z,ee){var Le=ee==="break";if(this.next(),this.eat(Ht.semi)||this.insertSemicolon())Z.label=null;else if(this.type!==Ht.name)this.unexpected();else Z.label=this.parseIdent(),this.semicolon();var Ot=0;for(;Ot<this.labels.length;++Ot){var Bt=this.labels[Ot];if(Z.label==null||Bt.name===Z.label.name){if(Bt.kind!=null&&(Le||Bt.kind==="loop"))break;if(Z.label&&Le)break}}if(Ot===this.labels.length)this.raise(Z.start,"Unsyntactic "+ee);return this.finishNode(Z,Le?"BreakStatement":"ContinueStatement")};Qt.parseDebuggerStatement=function(Z){return this.next(),this.semicolon(),this.finishNode(Z,"DebuggerStatement")};Qt.parseDoStatement=function(Z){if(this.next(),this.labels.push(er),Z.body=this.parseStatement("do"),this.labels.pop(),this.expect(Ht._while),Z.test=this.parseParenExpression(),this.options.ecmaVersion>=6)this.eat(Ht.semi);else this.semicolon();return this.finishNode(Z,"DoWhileStatement")};Qt.parseForStatement=function(Z){this.next();var ee=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(er),this.enterScope(0),this.expect(Ht.parenL),this.type===Ht.semi){if(ee>-1)this.unexpected(ee);return this.parseFor(Z,null)}var Le=this.isLet();if(this.type===Ht._var||this.type===Ht._const||Le){var Ot=this.startNode(),Bt=Le?"let":this.value;return this.next(),this.parseVar(Ot,!0,Bt),this.finishNode(Ot,"VariableDeclaration"),this.parseForAfterInit(Z,Ot,ee)}var jt=this.isContextual("let"),Gt=!1,Lt=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(Lt){var Vt=this.startNode();if(this.next(),Lt==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.parseVar(Vt,!0,Lt),this.finishNode(Vt,"VariableDeclaration"),this.parseForAfterInit(Z,Vt,ee)}var Wt=this.containsEsc,Ut=new ss,Kt=this.start,qt=ee>-1?this.parseExprSubscripts(Ut,"await"):this.parseExpression(!0,Ut);if(this.type===Ht._in||(Gt=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(ee>-1){if(this.type===Ht._in)this.unexpected(ee);Z.await=!0}else if(Gt&&this.options.ecmaVersion>=8){if(qt.start===Kt&&!Wt&&qt.type==="Identifier"&&qt.name==="async")this.unexpected();else if(this.options.ecmaVersion>=9)Z.await=!1}if(jt&&Gt)this.raise(qt.start,"The left-hand side of a for-of loop may not start with 'let'.");return this.toAssignable(qt,!1,Ut),this.checkLValPattern(qt),this.parseForIn(Z,qt)}else this.checkExpressionErrors(Ut,!0);if(ee>-1)this.unexpected(ee);return this.parseFor(Z,qt)};Qt.parseForAfterInit=function(Z,ee,Le){if((this.type===Ht._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&ee.declarations.length===1){if(this.type===Ht._in){if((ee.kind==="using"||ee.kind==="await using")&&!ee.declarations[0].init)this.raise(this.start,"Using declaration is not allowed in for-in loops");if(this.options.ecmaVersion>=9&&Le>-1)this.unexpected(Le)}else if(this.options.ecmaVersion>=9)Z.await=Le>-1;return this.parseForIn(Z,ee)}if(Le>-1)this.unexpected(Le);return this.parseFor(Z,ee)};Qt.parseFunctionStatement=function(Z,ee,Le){return this.next(),this.parseFunction(Z,vi|(Le?0:qs),!1,ee)};Qt.parseIfStatement=function(Z){return this.next(),Z.test=this.parseParenExpression(),Z.consequent=this.parseStatement("if"),Z.alternate=this.eat(Ht._else)?this.parseStatement("if"):null,this.finishNode(Z,"IfStatement")};Qt.parseReturnStatement=function(Z){if(!this.allowReturn)this.raise(this.start,"'return' outside of function");if(this.next(),this.eat(Ht.semi)||this.insertSemicolon())Z.argument=null;else Z.argument=this.parseExpression(),this.semicolon();return this.finishNode(Z,"ReturnStatement")};Qt.parseSwitchStatement=function(Z){this.next(),Z.discriminant=this.parseParenExpression(),Z.cases=[],this.expect(Ht.braceL),this.labels.push(fl),this.enterScope(Go);var ee;for(var Le=!1;this.type!==Ht.braceR;)if(this.type===Ht._case||this.type===Ht._default){var Ot=this.type===Ht._case;if(ee)this.finishNode(ee,"SwitchCase");if(Z.cases.push(ee=this.startNode()),ee.consequent=[],this.next(),Ot)ee.test=this.parseExpression();else{if(Le)this.raiseRecoverable(this.lastTokStart,"Multiple default clauses");Le=!0,ee.test=null}this.expect(Ht.colon)}else{if(!ee)this.unexpected();ee.consequent.push(this.parseStatement(null))}if(this.exitScope(),ee)this.finishNode(ee,"SwitchCase");return this.next(),this.labels.pop(),this.finishNode(Z,"SwitchStatement")};Qt.parseThrowStatement=function(Z){if(this.next(),vn.test(this.input.slice(this.lastTokEnd,this.start)))this.raise(this.lastTokEnd,"Illegal newline after throw");return Z.argument=this.parseExpression(),this.semicolon(),this.finishNode(Z,"ThrowStatement")};var ml=[];Qt.parseCatchClauseParam=function(){var Z=this.parseBindingAtom(),ee=Z.type==="Identifier";return this.enterScope(ee?jo:0),this.checkLValPattern(Z,ee?Uo:Mn),this.expect(Ht.parenR),Z};Qt.parseTryStatement=function(Z){if(this.next(),Z.block=this.parseBlock(),Z.handler=null,this.type===Ht._catch){var ee=this.startNode();if(this.next(),this.eat(Ht.parenL))ee.param=this.parseCatchClauseParam();else{if(this.options.ecmaVersion<10)this.unexpected();ee.param=null,this.enterScope(0)}ee.body=this.parseBlock(!1),this.exitScope(),Z.handler=this.finishNode(ee,"CatchClause")}if(Z.finalizer=this.eat(Ht._finally)?this.parseBlock():null,!Z.handler&&!Z.finalizer)this.raise(Z.start,"Missing catch or finally clause");return this.finishNode(Z,"TryStatement")};Qt.parseVarStatement=function(Z,ee,Le){return this.next(),this.parseVar(Z,!1,ee,Le),this.semicolon(),this.finishNode(Z,"VariableDeclaration")};Qt.parseWhileStatement=function(Z){return this.next(),Z.test=this.parseParenExpression(),this.labels.push(er),Z.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(Z,"WhileStatement")};Qt.parseWithStatement=function(Z){if(this.strict)this.raise(this.start,"'with' in strict mode");return this.next(),Z.object=this.parseParenExpression(),Z.body=this.parseStatement("with"),this.finishNode(Z,"WithStatement")};Qt.parseEmptyStatement=function(Z){return this.next(),this.finishNode(Z,"EmptyStatement")};Qt.parseLabeledStatement=function(Z,ee,Le,Ot){for(var Bt=0,jt=this.labels;Bt<jt.length;Bt+=1){var Gt=jt[Bt];if(Gt.name===ee)this.raise(Le.start,"Label '"+ee+"' is already declared")}var Lt=this.type.isLoop?"loop":this.type===Ht._switch?"switch":null;for(var Vt=this.labels.length-1;Vt>=0;Vt--){var Wt=this.labels[Vt];if(Wt.statementStart===Z.start)Wt.statementStart=this.start,Wt.kind=Lt;else break}return this.labels.push({name:ee,kind:Lt,statementStart:this.start}),Z.body=this.parseStatement(Ot?Ot.indexOf("label")===-1?Ot+"label":Ot:"label"),this.labels.pop(),Z.label=Le,this.finishNode(Z,"LabeledStatement")};Qt.parseExpressionStatement=function(Z,ee){return Z.expression=ee,this.semicolon(),this.finishNode(Z,"ExpressionStatement")};Qt.parseBlock=function(Z,ee,Le){if(Z===void 0)Z=!0;if(ee===void 0)ee=this.startNode();if(ee.body=[],this.expect(Ht.braceL),Z)this.enterScope(0);while(this.type!==Ht.braceR){var Ot=this.parseStatement(null);ee.body.push(Ot)}if(Le)this.strict=!1;if(this.next(),Z)this.exitScope();return this.finishNode(ee,"BlockStatement")};Qt.parseFor=function(Z,ee){return Z.init=ee,this.expect(Ht.semi),Z.test=this.type===Ht.semi?null:this.parseExpression(),this.expect(Ht.semi),Z.update=this.type===Ht.parenR?null:this.parseExpression(),this.expect(Ht.parenR),Z.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(Z,"ForStatement")};Qt.parseForIn=function(Z,ee){var Le=this.type===Ht._in;if(this.next(),ee.type==="VariableDeclaration"&&ee.declarations[0].init!=null&&(!Le||this.options.ecmaVersion<8||this.strict||ee.kind!=="var"||ee.declarations[0].id.type!=="Identifier"))this.raise(ee.start,(Le?"for-in":"for-of")+" loop variable declaration may not have an initializer");return Z.left=ee,Z.right=Le?this.parseExpression():this.parseMaybeAssign(),this.expect(Ht.parenR),Z.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(Z,Le?"ForInStatement":"ForOfStatement")};Qt.parseVar=function(Z,ee,Le,Ot){Z.declarations=[],Z.kind=Le;for(;;){var Bt=this.startNode();if(this.parseVarId(Bt,Le),this.eat(Ht.eq))Bt.init=this.parseMaybeAssign(ee);else if(!Ot&&Le==="const"&&!(this.type===Ht._in||this.options.ecmaVersion>=6&&this.isContextual("of")))this.unexpected();else if(!Ot&&(Le==="using"||Le==="await using")&&this.options.ecmaVersion>=17&&this.type!==Ht._in&&!this.isContextual("of"))this.raise(this.lastTokEnd,"Missing initializer in "+Le+" declaration");else if(!Ot&&Bt.id.type!=="Identifier"&&!(ee&&(this.type===Ht._in||this.isContextual("of"))))this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value");else Bt.init=null;if(Z.declarations.push(this.finishNode(Bt,"VariableDeclarator")),!this.eat(Ht.comma))break}return Z};Qt.parseVarId=function(Z,ee){Z.id=ee==="using"||ee==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(Z.id,ee==="var"?Zs:Mn,!1)};var vi=1,qs=2,Ko=4;Qt.parseFunction=function(Z,ee,Le,Ot,Bt){if(this.initFunction(Z),this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!Ot){if(this.type===Ht.star&&ee&qs)this.unexpected();Z.generator=this.eat(Ht.star)}if(this.options.ecmaVersion>=8)Z.async=!!Ot;if(ee&vi){if(Z.id=ee&Ko&&this.type!==Ht.name?null:this.parseIdent(),Z.id&&!(ee&qs))this.checkLValSimple(Z.id,this.strict||Z.generator||Z.async?this.treatFunctionsAsVar?Zs:Mn:Wo)}var jt=this.yieldPos,Gt=this.awaitPos,Lt=this.awaitIdentPos;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Qs(Z.async,Z.generator)),!(ee&vi))Z.id=this.type===Ht.name?this.parseIdent():null;return this.parseFunctionParams(Z),this.parseFunctionBody(Z,Le,!1,Bt),this.yieldPos=jt,this.awaitPos=Gt,this.awaitIdentPos=Lt,this.finishNode(Z,ee&vi?"FunctionDeclaration":"FunctionExpression")};Qt.parseFunctionParams=function(Z){this.expect(Ht.parenL),Z.params=this.parseBindingList(Ht.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};Qt.parseClass=function(Z,ee){this.next();var Le=this.strict;this.strict=!0,this.parseClassId(Z,ee),this.parseClassSuper(Z);var Ot=this.enterClassBody(),Bt=this.startNode(),jt=!1;Bt.body=[],this.expect(Ht.braceL);while(this.type!==Ht.braceR){var Gt=this.parseClassElement(Z.superClass!==null);if(Gt){if(Bt.body.push(Gt),Gt.type==="MethodDefinition"&&Gt.kind==="constructor"){if(jt)this.raiseRecoverable(Gt.start,"Duplicate constructor in the same class");jt=!0}else if(Gt.key&&Gt.key.type==="PrivateIdentifier"&&gl(Ot,Gt))this.raiseRecoverable(Gt.key.start,"Identifier '#"+Gt.key.name+"' has already been declared")}}return this.strict=Le,this.next(),Z.body=this.finishNode(Bt,"ClassBody"),this.exitClassBody(),this.finishNode(Z,ee?"ClassDeclaration":"ClassExpression")};Qt.parseClassElement=function(Z){if(this.eat(Ht.semi))return null;var ee=this.options.ecmaVersion,Le=this.startNode(),Ot="",Bt=!1,jt=!1,Gt="method",Lt=!1;if(this.eatContextual("static")){if(ee>=13&&this.eat(Ht.braceL))return this.parseClassStaticBlock(Le),Le;if(this.isClassElementNameStart()||this.type===Ht.star)Lt=!0;else Ot="static"}if(Le.static=Lt,!Ot&&ee>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===Ht.star)&&!this.canInsertSemicolon())jt=!0;else Ot="async";if(!Ot&&(ee>=9||!jt)&&this.eat(Ht.star))Bt=!0;if(!Ot&&!jt&&!Bt){var Vt=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())Gt=Vt;else Ot=Vt}if(Ot)Le.computed=!1,Le.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),Le.key.name=Ot,this.finishNode(Le.key,"Identifier");else this.parseClassElementName(Le);if(ee<13||this.type===Ht.parenL||Gt!=="method"||Bt||jt){var Wt=!Le.static&&Qi(Le,"constructor"),Ut=Wt&&Z;if(Wt&&Gt!=="method")this.raise(Le.key.start,"Constructor can't have get/set modifier");Le.kind=Wt?"constructor":Gt,this.parseClassMethod(Le,Bt,jt,Ut)}else this.parseClassField(Le);return Le};Qt.isClassElementNameStart=function(){return this.type===Ht.name||this.type===Ht.privateId||this.type===Ht.num||this.type===Ht.string||this.type===Ht.bracketL||this.type.keyword};Qt.parseClassElementName=function(Z){if(this.type===Ht.privateId){if(this.value==="constructor")this.raise(this.start,"Classes can't have an element named '#constructor'");Z.computed=!1,Z.key=this.parsePrivateIdent()}else this.parsePropertyName(Z)};Qt.parseClassMethod=function(Z,ee,Le,Ot){var Bt=Z.key;if(Z.kind==="constructor"){if(ee)this.raise(Bt.start,"Constructor can't be a generator");if(Le)this.raise(Bt.start,"Constructor can't be an async method")}else if(Z.static&&Qi(Z,"prototype"))this.raise(Bt.start,"Classes may not have a static property named prototype");var jt=Z.value=this.parseMethod(ee,Le,Ot);if(Z.kind==="get"&&jt.params.length!==0)this.raiseRecoverable(jt.start,"getter should have no params");if(Z.kind==="set"&&jt.params.length!==1)this.raiseRecoverable(jt.start,"setter should have exactly one param");if(Z.kind==="set"&&jt.params[0].type==="RestElement")this.raiseRecoverable(jt.params[0].start,"Setter cannot use rest params");return this.finishNode(Z,"MethodDefinition")};Qt.parseClassField=function(Z){if(Qi(Z,"constructor"))this.raise(Z.key.start,"Classes can't have a field named 'constructor'");else if(Z.static&&Qi(Z,"prototype"))this.raise(Z.key.start,"Classes can't have a static field named 'prototype'");if(this.eat(Ht.eq))this.enterScope(Ci|ns),Z.value=this.parseMaybeAssign(),this.exitScope();else Z.value=null;return this.semicolon(),this.finishNode(Z,"PropertyDefinition")};Qt.parseClassStaticBlock=function(Z){Z.body=[];var ee=this.labels;this.labels=[],this.enterScope(ei|ns);while(this.type!==Ht.braceR){var Le=this.parseStatement(null);Z.body.push(Le)}return this.next(),this.exitScope(),this.labels=ee,this.finishNode(Z,"StaticBlock")};Qt.parseClassId=function(Z,ee){if(this.type===Ht.name){if(Z.id=this.parseIdent(),ee)this.checkLValSimple(Z.id,Mn,!1)}else{if(ee===!0)this.unexpected();Z.id=null}};Qt.parseClassSuper=function(Z){Z.superClass=this.eat(Ht._extends)?this.parseExprSubscripts(null,!1):null};Qt.enterClassBody=function(){var Z={declared:Object.create(null),used:[]};return this.privateNameStack.push(Z),Z.declared};Qt.exitClassBody=function(){var Z=this.privateNameStack.pop(),{declared:ee,used:Le}=Z;if(!this.options.checkPrivateFields)return;var Ot=this.privateNameStack.length,Bt=Ot===0?null:this.privateNameStack[Ot-1];for(var jt=0;jt<Le.length;++jt){var Gt=Le[jt];if(!Si(ee,Gt.name))if(Bt)Bt.used.push(Gt);else this.raiseRecoverable(Gt.start,"Private field '#"+Gt.name+"' must be declared in an enclosing class")}};function gl(Z,ee){var Le=ee.key.name,Ot=Z[Le],Bt="true";if(ee.type==="MethodDefinition"&&(ee.kind==="get"||ee.kind==="set"))Bt=(ee.static?"s":"i")+ee.kind;if(Ot==="iget"&&Bt==="iset"||Ot==="iset"&&Bt==="iget"||Ot==="sget"&&Bt==="sset"||Ot==="sset"&&Bt==="sget")return Z[Le]="true",!1;else if(!Ot)return Z[Le]=Bt,!1;else return!0}function Qi(Z,ee){var{computed:Le,key:Ot}=Z;return!Le&&(Ot.type==="Identifier"&&Ot.name===ee||Ot.type==="Literal"&&Ot.value===ee)}Qt.parseExportAllDeclaration=function(Z,ee){if(this.options.ecmaVersion>=11)if(this.eatContextual("as"))Z.exported=this.parseModuleExportName(),this.checkExport(ee,Z.exported,this.lastTokStart);else Z.exported=null;if(this.expectContextual("from"),this.type!==Ht.string)this.unexpected();if(Z.source=this.parseExprAtom(),this.options.ecmaVersion>=16)Z.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(Z,"ExportAllDeclaration")};Qt.parseExport=function(Z,ee){if(this.next(),this.eat(Ht.star))return this.parseExportAllDeclaration(Z,ee);if(this.eat(Ht._default))return this.checkExport(ee,"default",this.lastTokStart),Z.declaration=this.parseExportDefaultDeclaration(),this.finishNode(Z,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(Z.declaration=this.parseExportDeclaration(Z),Z.declaration.type==="VariableDeclaration")this.checkVariableExport(ee,Z.declaration.declarations);else this.checkExport(ee,Z.declaration.id,Z.declaration.id.start);if(Z.specifiers=[],Z.source=null,this.options.ecmaVersion>=16)Z.attributes=[]}else{if(Z.declaration=null,Z.specifiers=this.parseExportSpecifiers(ee),this.eatContextual("from")){if(this.type!==Ht.string)this.unexpected();if(Z.source=this.parseExprAtom(),this.options.ecmaVersion>=16)Z.attributes=this.parseWithClause()}else{for(var Le=0,Ot=Z.specifiers;Le<Ot.length;Le+=1){var Bt=Ot[Le];if(this.checkUnreserved(Bt.local),this.checkLocalExport(Bt.local),Bt.local.type==="Literal")this.raise(Bt.local.start,"A string literal cannot be used as an exported binding without `from`.")}if(Z.source=null,this.options.ecmaVersion>=16)Z.attributes=[]}this.semicolon()}return this.finishNode(Z,"ExportNamedDeclaration")};Qt.parseExportDeclaration=function(Z){return this.parseStatement(null)};Qt.parseExportDefaultDeclaration=function(){var Z;if(this.type===Ht._function||(Z=this.isAsyncFunction())){var ee=this.startNode();if(this.next(),Z)this.next();return this.parseFunction(ee,vi|Ko,!1,Z)}else if(this.type===Ht._class){var Le=this.startNode();return this.parseClass(Le,"nullableID")}else{var Ot=this.parseMaybeAssign();return this.semicolon(),Ot}};Qt.checkExport=function(Z,ee,Le){if(!Z)return;if(typeof ee!=="string")ee=ee.type==="Identifier"?ee.name:ee.value;if(Si(Z,ee))this.raiseRecoverable(Le,"Duplicate export '"+ee+"'");Z[ee]=!0};Qt.checkPatternExport=function(Z,ee){var Le=ee.type;if(Le==="Identifier")this.checkExport(Z,ee,ee.start);else if(Le==="ObjectPattern")for(var Ot=0,Bt=ee.properties;Ot<Bt.length;Ot+=1){var jt=Bt[Ot];this.checkPatternExport(Z,jt)}else if(Le==="ArrayPattern")for(var Gt=0,Lt=ee.elements;Gt<Lt.length;Gt+=1){var Vt=Lt[Gt];if(Vt)this.checkPatternExport(Z,Vt)}else if(Le==="Property")this.checkPatternExport(Z,ee.value);else if(Le==="AssignmentPattern")this.checkPatternExport(Z,ee.left);else if(Le==="RestElement")this.checkPatternExport(Z,ee.argument)};Qt.checkVariableExport=function(Z,ee){if(!Z)return;for(var Le=0,Ot=ee;Le<Ot.length;Le+=1){var Bt=Ot[Le];this.checkPatternExport(Z,Bt.id)}};Qt.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};Qt.parseExportSpecifier=function(Z){var ee=this.startNode();return ee.local=this.parseModuleExportName(),ee.exported=this.eatContextual("as")?this.parseModuleExportName():ee.local,this.checkExport(Z,ee.exported,ee.exported.start),this.finishNode(ee,"ExportSpecifier")};Qt.parseExportSpecifiers=function(Z){var ee=[],Le=!0;this.expect(Ht.braceL);while(!this.eat(Ht.braceR)){if(!Le){if(this.expect(Ht.comma),this.afterTrailingComma(Ht.braceR))break}else Le=!1;ee.push(this.parseExportSpecifier(Z))}return ee};Qt.parseImport=function(Z){if(this.next(),this.type===Ht.string)Z.specifiers=ml,Z.source=this.parseExprAtom();else Z.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),Z.source=this.type===Ht.string?this.parseExprAtom():this.unexpected();if(this.options.ecmaVersion>=16)Z.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(Z,"ImportDeclaration")};Qt.parseImportSpecifier=function(){var Z=this.startNode();if(Z.imported=this.parseModuleExportName(),this.eatContextual("as"))Z.local=this.parseIdent();else this.checkUnreserved(Z.imported),Z.local=Z.imported;return this.checkLValSimple(Z.local,Mn),this.finishNode(Z,"ImportSpecifier")};Qt.parseImportDefaultSpecifier=function(){var Z=this.startNode();return Z.local=this.parseIdent(),this.checkLValSimple(Z.local,Mn),this.finishNode(Z,"ImportDefaultSpecifier")};Qt.parseImportNamespaceSpecifier=function(){var Z=this.startNode();return this.next(),this.expectContextual("as"),Z.local=this.parseIdent(),this.checkLValSimple(Z.local,Mn),this.finishNode(Z,"ImportNamespaceSpecifier")};Qt.parseImportSpecifiers=function(){var Z=[],ee=!0;if(this.type===Ht.name){if(Z.push(this.parseImportDefaultSpecifier()),!this.eat(Ht.comma))return Z}if(this.type===Ht.star)return Z.push(this.parseImportNamespaceSpecifier()),Z;this.expect(Ht.braceL);while(!this.eat(Ht.braceR)){if(!ee){if(this.expect(Ht.comma),this.afterTrailingComma(Ht.braceR))break}else ee=!1;Z.push(this.parseImportSpecifier())}return Z};Qt.parseWithClause=function(){var Z=[];if(!this.eat(Ht._with))return Z;this.expect(Ht.braceL);var ee={},Le=!0;while(!this.eat(Ht.braceR)){if(!Le){if(this.expect(Ht.comma),this.afterTrailingComma(Ht.braceR))break}else Le=!1;var Ot=this.parseImportAttribute(),Bt=Ot.key.type==="Identifier"?Ot.key.name:Ot.key.value;if(Si(ee,Bt))this.raiseRecoverable(Ot.key.start,"Duplicate attribute key '"+Bt+"'");ee[Bt]=!0,Z.push(Ot)}return Z};Qt.parseImportAttribute=function(){var Z=this.startNode();if(Z.key=this.type===Ht.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(Ht.colon),this.type!==Ht.string)this.unexpected();return Z.value=this.parseExprAtom(),this.finishNode(Z,"ImportAttribute")};Qt.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===Ht.string){var Z=this.parseLiteral(this.value);if(ll.test(Z.value))this.raise(Z.start,"An export name cannot include a lone surrogate.");return Z}return this.parseIdent(!0)};Qt.adaptDirectivePrologue=function(Z){for(var ee=0;ee<Z.length&&this.isDirectiveCandidate(Z[ee]);++ee)Z[ee].directive=Z[ee].expression.raw.slice(1,-1)};Qt.isDirectiveCandidate=function(Z){return this.options.ecmaVersion>=5&&Z.type==="ExpressionStatement"&&Z.expression.type==="Literal"&&typeof Z.expression.value==="string"&&(this.input[Z.start]==='"'||this.input[Z.start]==="'")};var Tn=s.prototype;Tn.toAssignable=function(Z,ee,Le){if(this.options.ecmaVersion>=6&&Z)switch(Z.type){case"Identifier":if(this.inAsync&&Z.name==="await")this.raise(Z.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":if(Z.type="ObjectPattern",Le)this.checkPatternErrors(Le,!0);for(var Ot=0,Bt=Z.properties;Ot<Bt.length;Ot+=1){var jt=Bt[Ot];if(this.toAssignable(jt,ee),jt.type==="RestElement"&&(jt.argument.type==="ArrayPattern"||jt.argument.type==="ObjectPattern"))this.raise(jt.argument.start,"Unexpected token")}break;case"Property":if(Z.kind!=="init")this.raise(Z.key.start,"Object pattern can't contain getter or setter");this.toAssignable(Z.value,ee);break;case"ArrayExpression":if(Z.type="ArrayPattern",Le)this.checkPatternErrors(Le,!0);this.toAssignableList(Z.elements,ee);break;case"SpreadElement":if(Z.type="RestElement",this.toAssignable(Z.argument,ee),Z.argument.type==="AssignmentPattern")this.raise(Z.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":if(Z.operator!=="=")this.raise(Z.left.end,"Only '=' operator can be used for specifying default value.");Z.type="AssignmentPattern",delete Z.operator,this.toAssignable(Z.left,ee);break;case"ParenthesizedExpression":this.toAssignable(Z.expression,ee,Le);break;case"ChainExpression":this.raiseRecoverable(Z.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!ee)break;default:this.raise(Z.start,"Assigning to rvalue")}else if(Le)this.checkPatternErrors(Le,!0);return Z};Tn.toAssignableList=function(Z,ee){var Le=Z.length;for(var Ot=0;Ot<Le;Ot++){var Bt=Z[Ot];if(Bt)this.toAssignable(Bt,ee)}if(Le){var jt=Z[Le-1];if(this.options.ecmaVersion===6&&ee&&jt&&jt.type==="RestElement"&&jt.argument.type!=="Identifier")this.unexpected(jt.argument.start)}return Z};Tn.parseSpread=function(Z){var ee=this.startNode();return this.next(),ee.argument=this.parseMaybeAssign(!1,Z),this.finishNode(ee,"SpreadElement")};Tn.parseRestBinding=function(){var Z=this.startNode();if(this.next(),this.options.ecmaVersion===6&&this.type!==Ht.name)this.unexpected();return Z.argument=this.parseBindingAtom(),this.finishNode(Z,"RestElement")};Tn.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case Ht.bracketL:var Z=this.startNode();return this.next(),Z.elements=this.parseBindingList(Ht.bracketR,!0,!0),this.finishNode(Z,"ArrayPattern");case Ht.braceL:return this.parseObj(!0)}return this.parseIdent()};Tn.parseBindingList=function(Z,ee,Le,Ot){var Bt=[],jt=!0;while(!this.eat(Z)){if(jt)jt=!1;else this.expect(Ht.comma);if(ee&&this.type===Ht.comma)Bt.push(null);else if(Le&&this.afterTrailingComma(Z))break;else if(this.type===Ht.ellipsis){var Gt=this.parseRestBinding();if(this.parseBindingListItem(Gt),Bt.push(Gt),this.type===Ht.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");this.expect(Z);break}else Bt.push(this.parseAssignableListItem(Ot))}return Bt};Tn.parseAssignableListItem=function(Z){var ee=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(ee),ee};Tn.parseBindingListItem=function(Z){return Z};Tn.parseMaybeDefault=function(Z,ee,Le){if(Le=Le||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(Ht.eq))return Le;var Ot=this.startNodeAt(Z,ee);return Ot.left=Le,Ot.right=this.parseMaybeAssign(),this.finishNode(Ot,"AssignmentPattern")};Tn.checkLValSimple=function(Z,ee,Le){if(ee===void 0)ee=Yi;var Ot=ee!==Yi;switch(Z.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(Z.name))this.raiseRecoverable(Z.start,(Ot?"Binding ":"Assigning to ")+Z.name+" in strict mode");if(Ot){if(ee===Mn&&Z.name==="let")this.raiseRecoverable(Z.start,"let is disallowed as a lexically bound name");if(Le){if(Si(Le,Z.name))this.raiseRecoverable(Z.start,"Argument name clash");Le[Z.name]=!0}if(ee!==Ho)this.declareName(Z.name,ee,Z.start)}break;case"ChainExpression":this.raiseRecoverable(Z.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(Ot)this.raiseRecoverable(Z.start,"Binding member expression");break;case"ParenthesizedExpression":if(Ot)this.raiseRecoverable(Z.start,"Binding parenthesized expression");return this.checkLValSimple(Z.expression,ee,Le);default:this.raise(Z.start,(Ot?"Binding":"Assigning to")+" rvalue")}};Tn.checkLValPattern=function(Z,ee,Le){if(ee===void 0)ee=Yi;switch(Z.type){case"ObjectPattern":for(var Ot=0,Bt=Z.properties;Ot<Bt.length;Ot+=1){var jt=Bt[Ot];this.checkLValInnerPattern(jt,ee,Le)}break;case"ArrayPattern":for(var Gt=0,Lt=Z.elements;Gt<Lt.length;Gt+=1){var Vt=Lt[Gt];if(Vt)this.checkLValInnerPattern(Vt,ee,Le)}break;default:this.checkLValSimple(Z,ee,Le)}};Tn.checkLValInnerPattern=function(Z,ee,Le){if(ee===void 0)ee=Yi;switch(Z.type){case"Property":this.checkLValInnerPattern(Z.value,ee,Le);break;case"AssignmentPattern":this.checkLValPattern(Z.left,ee,Le);break;case"RestElement":this.checkLValPattern(Z.argument,ee,Le);break;default:this.checkLValPattern(Z,ee,Le)}};var An=function(Z,ee,Le,Ot,Bt){this.token=Z,this.isExpr=!!ee,this.preserveSpace=!!Le,this.override=Ot,this.generator=!!Bt},pn={b_stat:new An("{",!1),b_expr:new An("{",!0),b_tmpl:new An("${",!1),p_stat:new An("(",!1),p_expr:new An("(",!0),q_tmpl:new An("`",!0,!0,function(Z){return Z.tryReadTemplateToken()}),f_stat:new An("function",!1),f_expr:new An("function",!0),f_expr_gen:new An("function",!0,!1,null,!0),f_gen:new An("function",!1,!1,null,!0)},li=s.prototype;li.initialContext=function(){return[pn.b_stat]};li.curContext=function(){return this.context[this.context.length-1]};li.braceIsBlock=function(Z){var ee=this.curContext();if(ee===pn.f_expr||ee===pn.f_stat)return!0;if(Z===Ht.colon&&(ee===pn.b_stat||ee===pn.b_expr))return!ee.isExpr;if(Z===Ht._return||Z===Ht.name&&this.exprAllowed)return vn.test(this.input.slice(this.lastTokEnd,this.start));if(Z===Ht._else||Z===Ht.semi||Z===Ht.eof||Z===Ht.parenR||Z===Ht.arrow)return!0;if(Z===Ht.braceL)return ee===pn.b_stat;if(Z===Ht._var||Z===Ht._const||Z===Ht.name)return!1;return!this.exprAllowed};li.inGeneratorContext=function(){for(var Z=this.context.length-1;Z>=1;Z--){var ee=this.context[Z];if(ee.token==="function")return ee.generator}return!1};li.updateContext=function(Z){var ee,Le=this.type;if(Le.keyword&&Z===Ht.dot)this.exprAllowed=!1;else if(ee=Le.updateContext)ee.call(this,Z);else this.exprAllowed=Le.beforeExpr};li.overrideContext=function(Z){if(this.curContext()!==Z)this.context[this.context.length-1]=Z};Ht.parenR.updateContext=Ht.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var Z=this.context.pop();if(Z===pn.b_stat&&this.curContext().token==="function")Z=this.context.pop();this.exprAllowed=!Z.isExpr};Ht.braceL.updateContext=function(Z){this.context.push(this.braceIsBlock(Z)?pn.b_stat:pn.b_expr),this.exprAllowed=!0};Ht.dollarBraceL.updateContext=function(){this.context.push(pn.b_tmpl),this.exprAllowed=!0};Ht.parenL.updateContext=function(Z){var ee=Z===Ht._if||Z===Ht._for||Z===Ht._with||Z===Ht._while;this.context.push(ee?pn.p_stat:pn.p_expr),this.exprAllowed=!0};Ht.incDec.updateContext=function(){};Ht._function.updateContext=Ht._class.updateContext=function(Z){if(Z.beforeExpr&&Z!==Ht._else&&!(Z===Ht.semi&&this.curContext()!==pn.p_stat)&&!(Z===Ht._return&&vn.test(this.input.slice(this.lastTokEnd,this.start)))&&!((Z===Ht.colon||Z===Ht.braceL)&&this.curContext()===pn.b_stat))this.context.push(pn.f_expr);else this.context.push(pn.f_stat);this.exprAllowed=!1};Ht.colon.updateContext=function(){if(this.curContext().token==="function")this.context.pop();this.exprAllowed=!0};Ht.backQuote.updateContext=function(){if(this.curContext()===pn.q_tmpl)this.context.pop();else this.context.push(pn.q_tmpl);this.exprAllowed=!1};Ht.star.updateContext=function(Z){if(Z===Ht._function){var ee=this.context.length-1;if(this.context[ee]===pn.f_expr)this.context[ee]=pn.f_expr_gen;else this.context[ee]=pn.f_gen}this.exprAllowed=!0};Ht.name.updateContext=function(Z){var ee=!1;if(this.options.ecmaVersion>=6&&Z!==Ht.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())ee=!0}this.exprAllowed=ee};var en=s.prototype;en.checkPropClash=function(Z,ee,Le){if(this.options.ecmaVersion>=9&&Z.type==="SpreadElement")return;if(this.options.ecmaVersion>=6&&(Z.computed||Z.method||Z.shorthand))return;var Ot=Z.key,Bt;switch(Ot.type){case"Identifier":Bt=Ot.name;break;case"Literal":Bt=String(Ot.value);break;default:return}var jt=Z.kind;if(this.options.ecmaVersion>=6){if(Bt==="__proto__"&&jt==="init"){if(ee.proto)if(Le){if(Le.doubleProto<0)Le.doubleProto=Ot.start}else this.raiseRecoverable(Ot.start,"Redefinition of __proto__ property");ee.proto=!0}return}Bt="$"+Bt;var Gt=ee[Bt];if(Gt){var Lt;if(jt==="init")Lt=this.strict&&Gt.init||Gt.get||Gt.set;else Lt=Gt.init||Gt[jt];if(Lt)this.raiseRecoverable(Ot.start,"Redefinition of property")}else Gt=ee[Bt]={init:!1,get:!1,set:!1};Gt[jt]=!0};en.parseExpression=function(Z,ee){var Le=this;return this.catchStackOverflow(function(){var{start:Ot,startLoc:Bt}=Le,jt=Le.parseMaybeAssign(Z,ee);if(Le.type===Ht.comma){var Gt=Le.startNodeAt(Ot,Bt);Gt.expressions=[jt];while(Le.eat(Ht.comma))Gt.expressions.push(Le.parseMaybeAssign(Z,ee));return Le.finishNode(Gt,"SequenceExpression")}return jt})};en.parseMaybeAssign=function(Z,ee,Le){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(Z);else this.exprAllowed=!1;var Ot=!1,Bt=-1,jt=-1,Gt=-1;if(ee)Bt=ee.parenthesizedAssign,jt=ee.trailingComma,Gt=ee.doubleProto,ee.parenthesizedAssign=ee.trailingComma=-1;else ee=new ss,Ot=!0;var Lt=this.start,Vt=this.startLoc;if(this.type===Ht.parenL||this.type===Ht.name)this.potentialArrowAt=this.start,this.potentialArrowInForAwait=Z==="await";var Wt=this.parseMaybeConditional(Z,ee);if(Le)Wt=Le.call(this,Wt,Lt,Vt);if(this.type.isAssign){var Ut=this.startNodeAt(Lt,Vt);if(Ut.operator=this.value,this.type===Ht.eq)Wt=this.toAssignable(Wt,!1,ee);if(!Ot)ee.parenthesizedAssign=ee.trailingComma=ee.doubleProto=-1;if(ee.shorthandAssign>=Wt.start)ee.shorthandAssign=-1;if(this.type===Ht.eq)this.checkLValPattern(Wt);else this.checkLValSimple(Wt);if(Ut.left=Wt,this.next(),Ut.right=this.parseMaybeAssign(Z),Gt>-1)ee.doubleProto=Gt;return this.finishNode(Ut,"AssignmentExpression")}else if(Ot)this.checkExpressionErrors(ee,!0);if(Bt>-1)ee.parenthesizedAssign=Bt;if(jt>-1)ee.trailingComma=jt;return Wt};en.parseMaybeConditional=function(Z,ee){var Le=this.start,Ot=this.startLoc,Bt=this.parseExprOps(Z,ee);if(this.checkExpressionErrors(ee))return Bt;if(!(Bt.type==="ArrowFunctionExpression"&&Bt.start===Le)&&this.eat(Ht.question)){var jt=this.startNodeAt(Le,Ot);return jt.test=Bt,jt.consequent=this.parseMaybeAssign(),this.expect(Ht.colon),jt.alternate=this.parseMaybeAssign(Z),this.finishNode(jt,"ConditionalExpression")}return Bt};en.parseExprOps=function(Z,ee){var Le=this.start,Ot=this.startLoc,Bt=this.parseMaybeUnary(ee,!1,!1,Z);if(this.checkExpressionErrors(ee))return Bt;return Bt.start===Le&&Bt.type==="ArrowFunctionExpression"?Bt:this.parseExprOp(Bt,Le,Ot,-1,Z)};en.parseExprOp=function(Z,ee,Le,Ot,Bt){var jt=this.type.binop;if(jt!=null&&(!Bt||this.type!==Ht._in)){if(jt>Ot){var Gt=this.type===Ht.logicalOR||this.type===Ht.logicalAND,Lt=this.type===Ht.coalesce;if(Lt)jt=Ht.logicalAND.binop;var Vt=this.value;this.next();var Wt=this.start,Ut=this.startLoc,Kt=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,Bt),Wt,Ut,jt,Bt),qt=this.buildBinary(ee,Le,Z,Kt,Vt,Gt||Lt);if(Gt&&this.type===Ht.coalesce||Lt&&(this.type===Ht.logicalOR||this.type===Ht.logicalAND))this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");return this.parseExprOp(qt,ee,Le,Ot,Bt)}}return Z};en.buildBinary=function(Z,ee,Le,Ot,Bt,jt){if(Ot.type==="PrivateIdentifier")this.raise(Ot.start,"Private identifier can only be left side of binary expression");var Gt=this.startNodeAt(Z,ee);return Gt.left=Le,Gt.operator=Bt,Gt.right=Ot,this.finishNode(Gt,jt?"LogicalExpression":"BinaryExpression")};en.parseMaybeUnary=function(Z,ee,Le,Ot){var Bt=this.start,jt=this.startLoc,Gt;if(this.isContextual("await")&&this.canAwait)Gt=this.parseAwait(Ot),ee=!0;else if(this.type.prefix){var Lt=this.startNode(),Vt=this.type===Ht.incDec;if(Lt.operator=this.value,Lt.prefix=!0,this.next(),Lt.argument=this.parseMaybeUnary(null,!0,Vt,Ot),this.checkExpressionErrors(Z,!0),Vt)this.checkLValSimple(Lt.argument);else if(this.strict&&Lt.operator==="delete"&&qo(Lt.argument))this.raiseRecoverable(Lt.start,"Deleting local variable in strict mode");else if(Lt.operator==="delete"&&zs(Lt.argument))this.raiseRecoverable(Lt.start,"Private fields can not be deleted");else ee=!0;Gt=this.finishNode(Lt,Vt?"UpdateExpression":"UnaryExpression")}else if(!ee&&this.type===Ht.privateId){if((Ot||this.privateNameStack.length===0)&&this.options.checkPrivateFields)this.unexpected();if(Gt=this.parsePrivateIdent(),this.type!==Ht._in)this.unexpected()}else{if(Gt=this.parseExprSubscripts(Z,Ot),this.checkExpressionErrors(Z))return Gt;while(this.type.postfix&&!this.canInsertSemicolon()){var Wt=this.startNodeAt(Bt,jt);Wt.operator=this.value,Wt.prefix=!1,Wt.argument=Gt,this.checkLValSimple(Gt),this.next(),Gt=this.finishNode(Wt,"UpdateExpression")}}if(!Le&&!(Gt.type==="ArrowFunctionExpression"&&Gt.start===Bt)&&this.eat(Ht.starstar))if(ee)this.unexpected(this.lastTokStart);else return this.buildBinary(Bt,jt,Gt,this.parseMaybeUnary(null,!1,!1,Ot),"**",!1);else return Gt};function qo(Z){return Z.type==="Identifier"||Z.type==="ParenthesizedExpression"&&qo(Z.expression)}function zs(Z){return Z.type==="MemberExpression"&&Z.property.type==="PrivateIdentifier"||Z.type==="ChainExpression"&&zs(Z.expression)||Z.type==="ParenthesizedExpression"&&zs(Z.expression)}en.parseExprSubscripts=function(Z,ee){var Le=this.start,Ot=this.startLoc,Bt=this.parseExprAtom(Z,ee);if(Bt.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return Bt;var jt=this.parseSubscripts(Bt,Le,Ot,!1,ee);if(Z&&jt.type==="MemberExpression"){if(Z.parenthesizedAssign>=jt.start)Z.parenthesizedAssign=-1;if(Z.parenthesizedBind>=jt.start)Z.parenthesizedBind=-1;if(Z.trailingComma>=jt.start)Z.trailingComma=-1}return jt};en.parseSubscripts=function(Z,ee,Le,Ot,Bt){var jt=this.options.ecmaVersion>=8&&Z.type==="Identifier"&&Z.name==="async"&&this.lastTokEnd===Z.end&&!this.canInsertSemicolon()&&Z.end-Z.start===5&&this.potentialArrowAt===Z.start,Gt=!1;while(!0){var Lt=this.parseSubscript(Z,ee,Le,Ot,jt,Gt,Bt);if(Lt.optional)Gt=!0;if(Lt===Z||Lt.type==="ArrowFunctionExpression"){if(Gt){var Vt=this.startNodeAt(ee,Le);Vt.expression=Lt,Lt=this.finishNode(Vt,"ChainExpression")}return Lt}Z=Lt}};en.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(Ht.arrow)};en.parseSubscriptAsyncArrow=function(Z,ee,Le,Ot){return this.parseArrowExpression(this.startNodeAt(Z,ee),Le,!0,Ot)};en.parseSubscript=function(Z,ee,Le,Ot,Bt,jt,Gt){var Lt=this.options.ecmaVersion>=11,Vt=Lt&&this.eat(Ht.questionDot);if(Ot&&Vt)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var Wt=this.eat(Ht.bracketL);if(Wt||Vt&&this.type!==Ht.parenL&&this.type!==Ht.backQuote||this.eat(Ht.dot)){var Ut=this.startNodeAt(ee,Le);if(Ut.object=Z,Wt)Ut.property=this.parseExpression(),this.expect(Ht.bracketR);else if(this.type===Ht.privateId&&Z.type!=="Super")Ut.property=this.parsePrivateIdent();else Ut.property=this.parseIdent(this.options.allowReserved!=="never");if(Ut.computed=!!Wt,Lt)Ut.optional=Vt;Z=this.finishNode(Ut,"MemberExpression")}else if(!Ot&&this.eat(Ht.parenL)){var Kt=new ss,qt=this.yieldPos,zt=this.awaitPos,Xt=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var Yt=this.parseExprList(Ht.parenR,this.options.ecmaVersion>=8,!1,Kt);if(Bt&&!Vt&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(Kt,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");return this.yieldPos=qt,this.awaitPos=zt,this.awaitIdentPos=Xt,this.parseSubscriptAsyncArrow(ee,Le,Yt,Gt)}this.checkExpressionErrors(Kt,!0),this.yieldPos=qt||this.yieldPos,this.awaitPos=zt||this.awaitPos,this.awaitIdentPos=Xt||this.awaitIdentPos;var Jt=this.startNodeAt(ee,Le);if(Jt.callee=Z,Jt.arguments=Yt,Lt)Jt.optional=Vt;Z=this.finishNode(Jt,"CallExpression")}else if(this.type===Ht.backQuote){if(Vt||jt)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var tn=this.startNodeAt(ee,Le);tn.tag=Z,tn.quasi=this.parseTemplate({isTagged:!0}),Z=this.finishNode(tn,"TaggedTemplateExpression")}return Z};en.parseExprAtom=function(Z,ee,Le){if(this.type===Ht.slash)this.readRegexp();var Ot,Bt=this.potentialArrowAt===this.start;switch(this.type){case Ht._super:if(!this.allowSuper)this.raise(this.start,"'super' keyword outside a method");if(Ot=this.startNode(),this.next(),this.type===Ht.parenL&&!this.allowDirectSuper)this.raise(Ot.start,"super() call outside constructor of a subclass");if(this.type!==Ht.dot&&this.type!==Ht.bracketL&&this.type!==Ht.parenL)this.unexpected();return this.finishNode(Ot,"Super");case Ht._this:return Ot=this.startNode(),this.next(),this.finishNode(Ot,"ThisExpression");case Ht.name:var jt=this.start,Gt=this.startLoc,Lt=this.containsEsc,Vt=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!Lt&&Vt.name==="async"&&!this.canInsertSemicolon()&&this.eat(Ht._function))return this.overrideContext(pn.f_expr),this.parseFunction(this.startNodeAt(jt,Gt),0,!1,!0,ee);if(Bt&&!this.canInsertSemicolon()){if(this.eat(Ht.arrow))return this.parseArrowExpression(this.startNodeAt(jt,Gt),[Vt],!1,ee);if(this.options.ecmaVersion>=8&&Vt.name==="async"&&this.type===Ht.name&&!Lt&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(Vt=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(Ht.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(jt,Gt),[Vt],!0,ee)}}return Vt;case Ht.regexp:var Wt=this.value;return Ot=this.parseLiteral(Wt.value),Ot.regex={pattern:Wt.pattern,flags:Wt.flags},Ot;case Ht.num:case Ht.string:return this.parseLiteral(this.value);case Ht._null:case Ht._true:case Ht._false:return Ot=this.startNode(),Ot.value=this.type===Ht._null?null:this.type===Ht._true,Ot.raw=this.type.keyword,this.next(),this.finishNode(Ot,"Literal");case Ht.parenL:var Ut=this.start,Kt=this.parseParenAndDistinguishExpression(Bt,ee);if(Z){if(Z.parenthesizedAssign<0&&!this.isSimpleAssignTarget(Kt))Z.parenthesizedAssign=Ut;if(Z.parenthesizedBind<0)Z.parenthesizedBind=Ut}return Kt;case Ht.bracketL:return Ot=this.startNode(),this.next(),Ot.elements=this.parseExprList(Ht.bracketR,!0,!0,Z),this.finishNode(Ot,"ArrayExpression");case Ht.braceL:return this.overrideContext(pn.b_expr),this.parseObj(!1,Z);case Ht._function:return Ot=this.startNode(),this.next(),this.parseFunction(Ot,0);case Ht._class:return this.parseClass(this.startNode(),!1);case Ht._new:return this.parseNew();case Ht.backQuote:return this.parseTemplate();case Ht._import:if(this.options.ecmaVersion>=11)return this.parseExprImport(Le);else return this.unexpected();default:return this.parseExprAtomDefault()}};en.parseExprAtomDefault=function(){this.unexpected()};en.parseExprImport=function(Z){var ee=this.startNode();if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword import");if(this.next(),this.type===Ht.parenL&&!Z)return this.parseDynamicImport(ee);else if(this.type===Ht.dot){var Le=this.startNodeAt(ee.start,ee.loc&&ee.loc.start);return Le.name="import",ee.meta=this.finishNode(Le,"Identifier"),this.parseImportMeta(ee)}else this.unexpected()};en.parseDynamicImport=function(Z){if(this.next(),Z.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)if(!this.eat(Ht.parenR))if(this.expect(Ht.comma),!this.afterTrailingComma(Ht.parenR)){if(Z.options=this.parseMaybeAssign(),!this.eat(Ht.parenR)){if(this.expect(Ht.comma),!this.afterTrailingComma(Ht.parenR))this.unexpected()}}else Z.options=null;else Z.options=null;else if(!this.eat(Ht.parenR)){var ee=this.start;if(this.eat(Ht.comma)&&this.eat(Ht.parenR))this.raiseRecoverable(ee,"Trailing comma is not allowed in import()");else this.unexpected(ee)}return this.finishNode(Z,"ImportExpression")};en.parseImportMeta=function(Z){this.next();var ee=this.containsEsc;if(Z.property=this.parseIdent(!0),Z.property.name!=="meta")this.raiseRecoverable(Z.property.start,"The only valid meta property for import is 'import.meta'");if(ee)this.raiseRecoverable(Z.start,"'import.meta' must not contain escaped characters");if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere)this.raiseRecoverable(Z.start,"Cannot use 'import.meta' outside a module");return this.finishNode(Z,"MetaProperty")};en.parseLiteral=function(Z){var ee=this.startNode();if(ee.value=Z,ee.raw=this.input.slice(this.start,this.end),ee.raw.charCodeAt(ee.raw.length-1)===110)ee.bigint=ee.value!=null?ee.value.toString():ee.raw.slice(0,-1).replace(/_/g,"");return this.next(),this.finishNode(ee,"Literal")};en.parseParenExpression=function(){this.expect(Ht.parenL);var Z=this.parseExpression();return this.expect(Ht.parenR),Z};en.shouldParseArrow=function(Z){return!this.canInsertSemicolon()};en.parseParenAndDistinguishExpression=function(Z,ee){var Le=this.start,Ot=this.startLoc,Bt,jt=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var Gt=this.start,Lt=this.startLoc,Vt=[],Wt=!0,Ut=!1,Kt=new ss,qt=this.yieldPos,zt=this.awaitPos,Xt;this.yieldPos=0,this.awaitPos=0;while(this.type!==Ht.parenR)if(Wt?Wt=!1:this.expect(Ht.comma),jt&&this.afterTrailingComma(Ht.parenR,!0)){Ut=!0;break}else if(this.type===Ht.ellipsis){if(Xt=this.start,Vt.push(this.parseParenItem(this.parseRestBinding())),this.type===Ht.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else Vt.push(this.parseMaybeAssign(!1,Kt,this.parseParenItem));var Yt=this.lastTokEnd,Jt=this.lastTokEndLoc;if(this.expect(Ht.parenR),Z&&this.shouldParseArrow(Vt)&&this.eat(Ht.arrow))return this.checkPatternErrors(Kt,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=qt,this.awaitPos=zt,this.parseParenArrowList(Le,Ot,Vt,ee);if(!Vt.length||Ut)this.unexpected(this.lastTokStart);if(Xt)this.unexpected(Xt);if(this.checkExpressionErrors(Kt,!0),this.yieldPos=qt||this.yieldPos,this.awaitPos=zt||this.awaitPos,Vt.length>1)Bt=this.startNodeAt(Gt,Lt),Bt.expressions=Vt,this.finishNodeAt(Bt,"SequenceExpression",Yt,Jt);else Bt=Vt[0]}else Bt=this.parseParenExpression();if(this.options.preserveParens){var tn=this.startNodeAt(Le,Ot);return tn.expression=Bt,this.finishNode(tn,"ParenthesizedExpression")}else return Bt};en.parseParenItem=function(Z){return Z};en.parseParenArrowList=function(Z,ee,Le,Ot){return this.parseArrowExpression(this.startNodeAt(Z,ee),Le,!1,Ot)};var yl=[];en.parseNew=function(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");var Z=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===Ht.dot){var ee=this.startNodeAt(Z.start,Z.loc&&Z.loc.start);ee.name="new",Z.meta=this.finishNode(ee,"Identifier"),this.next();var Le=this.containsEsc;if(Z.property=this.parseIdent(!0),Z.property.name!=="target")this.raiseRecoverable(Z.property.start,"The only valid meta property for new is 'new.target'");if(Le)this.raiseRecoverable(Z.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(Z.start,"'new.target' can only be used in functions and class static block");return this.finishNode(Z,"MetaProperty")}var Ot=this.start,Bt=this.startLoc;if(Z.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),Ot,Bt,!0,!1),Z.callee.type==="Super")this.raiseRecoverable(Ot,"Invalid use of 'super'");if(this.eat(Ht.parenL))Z.arguments=this.parseExprList(Ht.parenR,this.options.ecmaVersion>=8,!1);else Z.arguments=yl;return this.finishNode(Z,"NewExpression")};en.parseTemplateElement=function(Z){var ee=Z.isTagged,Le=this.startNode();if(this.type===Ht.invalidTemplate){if(!ee)this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal");Le.value={raw:this.value.replace(/\r\n?/g,`
11
- `),cooked:null}}else Le.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
12
- `),cooked:this.value};return this.next(),Le.tail=this.type===Ht.backQuote,this.finishNode(Le,"TemplateElement")};en.parseTemplate=function(Z){if(Z===void 0)Z={};var ee=Z.isTagged;if(ee===void 0)ee=!1;var Le=this.startNode();this.next(),Le.expressions=[];var Ot=this.parseTemplateElement({isTagged:ee});Le.quasis=[Ot];while(!Ot.tail){if(this.type===Ht.eof)this.raise(this.pos,"Unterminated template literal");this.expect(Ht.dollarBraceL),Le.expressions.push(this.parseExpression()),this.expect(Ht.braceR),Le.quasis.push(Ot=this.parseTemplateElement({isTagged:ee}))}return this.next(),this.finishNode(Le,"TemplateLiteral")};en.isAsyncProp=function(Z){return!Z.computed&&Z.key.type==="Identifier"&&Z.key.name==="async"&&(this.type===Ht.name||this.type===Ht.num||this.type===Ht.string||this.type===Ht.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===Ht.star)&&!vn.test(this.input.slice(this.lastTokEnd,this.start))};en.parseObj=function(Z,ee){var Le=this.startNode(),Ot=!0,Bt={};Le.properties=[],this.next();while(!this.eat(Ht.braceR)){if(!Ot){if(this.expect(Ht.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(Ht.braceR))break}else Ot=!1;var jt=this.parseProperty(Z,ee);if(!Z)this.checkPropClash(jt,Bt,ee);Le.properties.push(jt)}return this.finishNode(Le,Z?"ObjectPattern":"ObjectExpression")};en.parseProperty=function(Z,ee){var Le=this.startNode(),Ot,Bt,jt,Gt;if(this.options.ecmaVersion>=9&&this.eat(Ht.ellipsis)){if(Z){if(Le.argument=this.parseIdent(!1),this.type===Ht.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");return this.finishNode(Le,"RestElement")}if(Le.argument=this.parseMaybeAssign(!1,ee),this.type===Ht.comma&&ee&&ee.trailingComma<0)ee.trailingComma=this.start;return this.finishNode(Le,"SpreadElement")}if(this.options.ecmaVersion>=6){if(Le.method=!1,Le.shorthand=!1,Z||ee)jt=this.start,Gt=this.startLoc;if(!Z)Ot=this.eat(Ht.star)}var Lt=this.containsEsc;if(this.parsePropertyName(Le),!Z&&!Lt&&this.options.ecmaVersion>=8&&!Ot&&this.isAsyncProp(Le))Bt=!0,Ot=this.options.ecmaVersion>=9&&this.eat(Ht.star),this.parsePropertyName(Le);else Bt=!1;return this.parsePropertyValue(Le,Z,Ot,Bt,jt,Gt,ee,Lt),this.finishNode(Le,"Property")};en.parseGetterSetter=function(Z){var ee=Z.key.name;this.parsePropertyName(Z),Z.value=this.parseMethod(!1),Z.kind=ee;var Le=Z.kind==="get"?0:1;if(Z.value.params.length!==Le){var Ot=Z.value.start;if(Z.kind==="get")this.raiseRecoverable(Ot,"getter should have no params");else this.raiseRecoverable(Ot,"setter should have exactly one param")}else if(Z.kind==="set"&&Z.value.params[0].type==="RestElement")this.raiseRecoverable(Z.value.params[0].start,"Setter cannot use rest params")};en.parsePropertyValue=function(Z,ee,Le,Ot,Bt,jt,Gt,Lt){if((Le||Ot)&&this.type===Ht.colon)this.unexpected();if(this.eat(Ht.colon))Z.value=ee?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,Gt),Z.kind="init";else if(this.options.ecmaVersion>=6&&this.type===Ht.parenL){if(ee)this.unexpected();Z.method=!0,Z.value=this.parseMethod(Le,Ot),Z.kind="init"}else if(!ee&&!Lt&&this.options.ecmaVersion>=5&&!Z.computed&&Z.key.type==="Identifier"&&(Z.key.name==="get"||Z.key.name==="set")&&(this.type!==Ht.comma&&this.type!==Ht.braceR&&this.type!==Ht.eq)){if(Le||Ot)this.unexpected();this.parseGetterSetter(Z)}else if(this.options.ecmaVersion>=6&&!Z.computed&&Z.key.type==="Identifier"){if(Le||Ot)this.unexpected();if(this.checkUnreserved(Z.key),Z.key.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=Bt;if(ee)Z.value=this.parseMaybeDefault(Bt,jt,this.copyNode(Z.key));else if(this.type===Ht.eq&&Gt){if(Gt.shorthandAssign<0)Gt.shorthandAssign=this.start;Z.value=this.parseMaybeDefault(Bt,jt,this.copyNode(Z.key))}else Z.value=this.copyNode(Z.key);Z.kind="init",Z.shorthand=!0}else this.unexpected()};en.parsePropertyName=function(Z){if(this.options.ecmaVersion>=6)if(this.eat(Ht.bracketL))return Z.computed=!0,Z.key=this.parseMaybeAssign(),this.expect(Ht.bracketR),Z.key;else Z.computed=!1;return Z.key=this.type===Ht.num||this.type===Ht.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};en.initFunction=function(Z){if(Z.id=null,this.options.ecmaVersion>=6)Z.generator=Z.expression=!1;if(this.options.ecmaVersion>=8)Z.async=!1};en.parseMethod=function(Z,ee,Le){var Ot=this.startNode(),Bt=this.yieldPos,jt=this.awaitPos,Gt=this.awaitIdentPos;if(this.initFunction(Ot),this.options.ecmaVersion>=6)Ot.generator=Z;if(this.options.ecmaVersion>=8)Ot.async=!!ee;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Qs(ee,Ot.generator)|ns|(Le?Vo:0)),this.expect(Ht.parenL),Ot.params=this.parseBindingList(Ht.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(Ot,!1,!0,!1),this.yieldPos=Bt,this.awaitPos=jt,this.awaitIdentPos=Gt,this.finishNode(Ot,"FunctionExpression")};en.parseArrowExpression=function(Z,ee,Le,Ot){var Bt=this.yieldPos,jt=this.awaitPos,Gt=this.awaitIdentPos;if(this.enterScope(Qs(Le,!1)|Ys),this.initFunction(Z),this.options.ecmaVersion>=8)Z.async=!!Le;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,Z.params=this.toAssignableList(ee,!0),this.parseFunctionBody(Z,!0,!1,Ot),this.yieldPos=Bt,this.awaitPos=jt,this.awaitIdentPos=Gt,this.finishNode(Z,"ArrowFunctionExpression")};en.parseFunctionBody=function(Z,ee,Le,Ot){var Bt=ee&&this.type!==Ht.braceL,jt=this.strict,Gt=!1;if(Bt)Z.body=this.parseMaybeAssign(Ot),Z.expression=!0,this.checkParams(Z,!1);else{var Lt=this.options.ecmaVersion>=7&&!this.isSimpleParamList(Z.params);if(!jt||Lt){if(Gt=this.strictDirective(this.end),Gt&&Lt)this.raiseRecoverable(Z.start,"Illegal 'use strict' directive in function with non-simple parameter list")}var Vt=this.labels;if(this.labels=[],Gt)this.strict=!0;if(this.checkParams(Z,!jt&&!Gt&&!ee&&!Le&&this.isSimpleParamList(Z.params)),this.strict&&Z.id)this.checkLValSimple(Z.id,Ho);Z.body=this.parseBlock(!1,void 0,Gt&&!jt),Z.expression=!1,this.adaptDirectivePrologue(Z.body.body),this.labels=Vt}this.exitScope()};en.isSimpleParamList=function(Z){for(var ee=0,Le=Z;ee<Le.length;ee+=1){var Ot=Le[ee];if(Ot.type!=="Identifier")return!1}return!0};en.checkParams=function(Z,ee){var Le=Object.create(null);for(var Ot=0,Bt=Z.params;Ot<Bt.length;Ot+=1){var jt=Bt[Ot];this.checkLValInnerPattern(jt,Zs,ee?null:Le)}};en.parseExprList=function(Z,ee,Le,Ot){var Bt=[],jt=!0;while(!this.eat(Z)){if(!jt){if(this.expect(Ht.comma),ee&&this.afterTrailingComma(Z))break}else jt=!1;var Gt=void 0;if(Le&&this.type===Ht.comma)Gt=null;else if(this.type===Ht.ellipsis){if(Gt=this.parseSpread(Ot),Ot&&this.type===Ht.comma&&Ot.trailingComma<0)Ot.trailingComma=this.start}else Gt=this.parseMaybeAssign(!1,Ot);Bt.push(Gt)}return Bt};en.checkUnreserved=function(Z){var{start:ee,end:Le,name:Ot}=Z;if(this.inGenerator&&Ot==="yield")this.raiseRecoverable(ee,"Cannot use 'yield' as identifier inside a generator");if(this.inAsync&&Ot==="await")this.raiseRecoverable(ee,"Cannot use 'await' as identifier inside an async function");if(!(this.currentThisScope().flags&is)&&Ot==="arguments")this.raiseRecoverable(ee,"Cannot use 'arguments' in class field initializer");if(this.inClassStaticBlock&&(Ot==="arguments"||Ot==="await"))this.raise(ee,"Cannot use "+Ot+" in class static initialization block");if(this.keywords.test(Ot))this.raise(ee,"Unexpected keyword '"+Ot+"'");if(this.options.ecmaVersion<6&&this.input.slice(ee,Le).indexOf("\\")!==-1)return;var Bt=this.strict?this.reservedWordsStrict:this.reservedWords;if(Bt.test(Ot)){if(!this.inAsync&&Ot==="await")this.raiseRecoverable(ee,"Cannot use keyword 'await' outside an async function");this.raiseRecoverable(ee,"The keyword '"+Ot+"' is reserved")}};en.parseIdent=function(Z){var ee=this.parseIdentNode();if(this.next(!!Z),this.finishNode(ee,"Identifier"),!Z){if(this.checkUnreserved(ee),ee.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=ee.start}return ee};en.parseIdentNode=function(){var Z=this.startNode();if(this.type===Ht.name)Z.name=this.value;else if(this.type.keyword){if(Z.name=this.type.keyword,(Z.name==="class"||Z.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.context.pop();this.type=Ht.name}else this.unexpected();return Z};en.parsePrivateIdent=function(){var Z=this.startNode();if(this.type===Ht.privateId)Z.name=this.value;else this.unexpected();if(this.next(),this.finishNode(Z,"PrivateIdentifier"),this.options.checkPrivateFields)if(this.privateNameStack.length===0)this.raise(Z.start,"Private field '#"+Z.name+"' must be declared in an enclosing class");else this.privateNameStack[this.privateNameStack.length-1].used.push(Z);return Z};en.parseYield=function(Z){if(!this.yieldPos)this.yieldPos=this.start;var ee=this.startNode();if(this.next(),this.type===Ht.semi||this.canInsertSemicolon()||this.type!==Ht.star&&!this.type.startsExpr)ee.delegate=!1,ee.argument=null;else ee.delegate=this.eat(Ht.star),ee.argument=this.parseMaybeAssign(Z);return this.finishNode(ee,"YieldExpression")};en.parseAwait=function(Z){if(!this.awaitPos)this.awaitPos=this.start;var ee=this.startNode();return this.next(),ee.argument=this.parseMaybeUnary(null,!0,!1,Z),this.finishNode(ee,"AwaitExpression")};var Zi=s.prototype;Zi.raise=function(Z,ee){var Le=Fo(this.input,Z);if(ee+=" ("+Le.line+":"+Le.column+")",this.sourceFile)ee+=" in "+this.sourceFile;var Ot=SyntaxError(ee);throw Ot.pos=Z,Ot.loc=Le,Ot.raisedAt=this.pos,Ot};Zi.raiseRecoverable=Zi.raise;Zi.curPosition=function(){if(this.options.locations)return new Ei(this.curLine,this.pos-this.lineStart)};var Gn=s.prototype,xl=function(Z){this.flags=Z,this.var=[],this.lexical=[],this.functions=[]};Gn.enterScope=function(Z){this.scopeStack.push(new xl(Z))};Gn.exitScope=function(){this.scopeStack.pop()};Gn.treatFunctionsAsVarInScope=function(Z){return Z.flags&Zn||!this.inModule&&Z.flags&Qn};Gn.declareName=function(Z,ee,Le){var Ot=!1;if(ee===Mn){var Bt=this.currentScope();if(Ot=Bt.lexical.indexOf(Z)>-1||Bt.functions.indexOf(Z)>-1||Bt.var.indexOf(Z)>-1,Bt.lexical.push(Z),this.inModule&&Bt.flags&Qn)delete this.undefinedExports[Z]}else if(ee===Uo){var jt=this.currentScope();jt.lexical.push(Z)}else if(ee===Wo){var Gt=this.currentScope();if(this.treatFunctionsAsVar)Ot=Gt.lexical.indexOf(Z)>-1;else Ot=Gt.lexical.indexOf(Z)>-1||Gt.var.indexOf(Z)>-1;Gt.functions.push(Z)}else for(var Lt=this.scopeStack.length-1;Lt>=0;--Lt){var Vt=this.scopeStack[Lt];if(Vt.lexical.indexOf(Z)>-1&&!(Vt.flags&jo&&Vt.lexical[0]===Z)||!this.treatFunctionsAsVarInScope(Vt)&&Vt.functions.indexOf(Z)>-1){Ot=!0;break}if(Vt.var.push(Z),this.inModule&&Vt.flags&Qn)delete this.undefinedExports[Z];if(Vt.flags&is)break}if(Ot)this.raiseRecoverable(Le,"Identifier '"+Z+"' has already been declared")};Gn.checkLocalExport=function(Z){if(this.scopeStack[0].lexical.indexOf(Z.name)===-1&&this.scopeStack[0].var.indexOf(Z.name)===-1)this.undefinedExports[Z.name]=Z};Gn.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Gn.currentVarScope=function(){for(var Z=this.scopeStack.length-1;;Z--){var ee=this.scopeStack[Z];if(ee.flags&(is|Ci|ei))return ee}};Gn.currentThisScope=function(){for(var Z=this.scopeStack.length-1;;Z--){var ee=this.scopeStack[Z];if(ee.flags&(is|Ci|ei)&&!(ee.flags&Ys))return ee}};var rs=function(Z,ee,Le){if(this.type="",this.start=ee,this.end=0,Z.options.locations)this.loc=new ts(Z,Le);if(Z.options.directSourceFile)this.sourceFile=Z.options.directSourceFile;if(Z.options.ranges)this.range=[ee,0]},bi=s.prototype;bi.startNode=function(){return new rs(this,this.start,this.startLoc)};bi.startNodeAt=function(Z,ee){return new rs(this,Z,ee)};function zo(Z,ee,Le,Ot){if(Z.type=ee,Z.end=Le,this.options.locations)Z.loc.end=Ot;if(this.options.ranges)Z.range[1]=Le;return Z}bi.finishNode=function(Z,ee){return zo.call(this,Z,ee,this.lastTokEnd,this.lastTokEndLoc)};bi.finishNodeAt=function(Z,ee,Le,Ot){return zo.call(this,Z,ee,Le,Ot)};bi.copyNode=function(Z){var ee=new rs(this,Z.start,this.startLoc);for(var Le in Z)ee[Le]=Z[Le];return ee};var Xo=function(){};Xo.prototype.reset=function(){};s.prototype.validateRegExpFlags=function(){};s.prototype.validateRegExpPattern=function(){};var tr=function(Z){if(this.type=Z.type,this.value=Z.value,this.start=Z.start,this.end=Z.end,Z.options.locations)this.loc=new ts(Z,Z.startLoc,Z.endLoc);if(Z.options.ranges)this.range=[Z.start,Z.end]},nn=s.prototype;nn.next=function(Z){if(!Z&&this.type.keyword&&this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword);if(this.options.onToken)this.options.onToken(new tr(this));this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};nn.getToken=function(){return this.next(),new tr(this)};if(typeof Symbol<"u")nn[Symbol.iterator]=function(){var Z=this;return{next:function(){var ee=Z.getToken();return{done:ee.type===Ht.eof,value:ee}}}};nn.nextToken=function(){var Z=this.curContext();if(!Z||!Z.preserveSpace)this.skipSpace();if(this.start=this.pos,this.options.locations)this.startLoc=this.curPosition();if(this.pos>=this.input.length)return this.finishToken(Ht.eof);if(Z.override)return Z.override(this);else this.readToken(this.fullCharCodeAtPos())};nn.readToken=function(Z){if(h(Z,this.options.ecmaVersion>=6)||Z===92)return this.readWord();return this.getTokenFromCode(Z)};nn.fullCharCodeAt=function(Z){var ee=this.input.charCodeAt(Z);if(ee<=55295||ee>=56320)return ee;var Le=this.input.charCodeAt(Z+1);return Le<=56319||Le>=57344?ee:(ee<<10)+Le-56613888};nn.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};nn.skipBlockComment=function(){var Z=this.options.onComment&&this.curPosition(),ee=this.pos,Le=this.input.indexOf("*/",this.pos+=2);if(Le===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=Le+2,this.options.locations)for(var Ot=void 0,Bt=ee;(Ot=Lo(this.input,Bt,this.pos))>-1;)++this.curLine,Bt=this.lineStart=Ot;if(this.options.onComment)this.options.onComment(!0,this.input.slice(ee+2,Le),ee,this.pos,Z,this.curPosition())};nn.skipLineComment=function(Z){var ee=this.pos,Le=this.options.onComment&&this.curPosition(),Ot=this.input.charCodeAt(this.pos+=Z);while(this.pos<this.input.length&&!ci(Ot))Ot=this.input.charCodeAt(++this.pos);if(this.options.onComment)this.options.onComment(!1,this.input.slice(ee+Z,this.pos),ee,this.pos,Le,this.curPosition())};nn.skipSpace=function(){e:while(this.pos<this.input.length){var Z=this.input.charCodeAt(this.pos);switch(Z){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(Z>8&&Z<14||Z>=5760&&Mo.test(String.fromCharCode(Z)))++this.pos;else break e}}};nn.finishToken=function(Z,ee){if(this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();var Le=this.type;this.type=Z,this.value=ee,this.updateContext(Le)};nn.readToken_dot=function(){var Z=this.input.charCodeAt(this.pos+1);if(Z>=48&&Z<=57)return this.readNumber(!0);var ee=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&Z===46&&ee===46)return this.pos+=3,this.finishToken(Ht.ellipsis);else return++this.pos,this.finishToken(Ht.dot)};nn.readToken_slash=function(){var Z=this.input.charCodeAt(this.pos+1);if(this.exprAllowed)return++this.pos,this.readRegexp();if(Z===61)return this.finishOp(Ht.assign,2);return this.finishOp(Ht.slash,1)};nn.readToken_mult_modulo_exp=function(Z){var ee=this.input.charCodeAt(this.pos+1),Le=1,Ot=Z===42?Ht.star:Ht.modulo;if(this.options.ecmaVersion>=7&&Z===42&&ee===42)++Le,Ot=Ht.starstar,ee=this.input.charCodeAt(this.pos+2);if(ee===61)return this.finishOp(Ht.assign,Le+1);return this.finishOp(Ot,Le)};nn.readToken_pipe_amp=function(Z){var ee=this.input.charCodeAt(this.pos+1);if(ee===Z){if(this.options.ecmaVersion>=12){var Le=this.input.charCodeAt(this.pos+2);if(Le===61)return this.finishOp(Ht.assign,3)}return this.finishOp(Z===124?Ht.logicalOR:Ht.logicalAND,2)}if(ee===61)return this.finishOp(Ht.assign,2);return this.finishOp(Z===124?Ht.bitwiseOR:Ht.bitwiseAND,1)};nn.readToken_caret=function(){var Z=this.input.charCodeAt(this.pos+1);if(Z===61)return this.finishOp(Ht.assign,2);return this.finishOp(Ht.bitwiseXOR,1)};nn.readToken_plus_min=function(Z){var ee=this.input.charCodeAt(this.pos+1);if(ee===Z){if(ee===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||vn.test(this.input.slice(this.lastTokEnd,this.pos))))return this.skipLineComment(3),this.skipSpace(),this.nextToken();return this.finishOp(Ht.incDec,2)}if(ee===61)return this.finishOp(Ht.assign,2);return this.finishOp(Ht.plusMin,1)};nn.readToken_lt_gt=function(Z){var ee=this.input.charCodeAt(this.pos+1),Le=1;if(ee===Z){if(Le=Z===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+Le)===61)return this.finishOp(Ht.assign,Le+1);return this.finishOp(Ht.bitShift,Le)}if(ee===33&&Z===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(ee===61)Le=2;return this.finishOp(Ht.relational,Le)};nn.readToken_eq_excl=function(Z){var ee=this.input.charCodeAt(this.pos+1);if(ee===61)return this.finishOp(Ht.equality,this.input.charCodeAt(this.pos+2)===61?3:2);if(Z===61&&ee===62&&this.options.ecmaVersion>=6)return this.pos+=2,this.finishToken(Ht.arrow);return this.finishOp(Z===61?Ht.eq:Ht.prefix,1)};nn.readToken_question=function(){var Z=this.options.ecmaVersion;if(Z>=11){var ee=this.input.charCodeAt(this.pos+1);if(ee===46){var Le=this.input.charCodeAt(this.pos+2);if(Le<48||Le>57)return this.finishOp(Ht.questionDot,2)}if(ee===63){if(Z>=12){var Ot=this.input.charCodeAt(this.pos+2);if(Ot===61)return this.finishOp(Ht.assign,3)}return this.finishOp(Ht.coalesce,2)}}return this.finishOp(Ht.question,1)};nn.readToken_numberSign=function(){var Z=this.options.ecmaVersion,ee=35;if(Z>=13){if(++this.pos,ee=this.fullCharCodeAtPos(),h(ee,!0)||ee===92)return this.finishToken(Ht.privateId,this.readWord1())}this.raise(this.pos,"Unexpected character '"+es(ee)+"'")};nn.getTokenFromCode=function(Z){switch(Z){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(Ht.parenL);case 41:return++this.pos,this.finishToken(Ht.parenR);case 59:return++this.pos,this.finishToken(Ht.semi);case 44:return++this.pos,this.finishToken(Ht.comma);case 91:return++this.pos,this.finishToken(Ht.bracketL);case 93:return++this.pos,this.finishToken(Ht.bracketR);case 123:return++this.pos,this.finishToken(Ht.braceL);case 125:return++this.pos,this.finishToken(Ht.braceR);case 58:return++this.pos,this.finishToken(Ht.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(Ht.backQuote);case 48:var ee=this.input.charCodeAt(this.pos+1);if(ee===120||ee===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(ee===111||ee===79)return this.readRadixNumber(8);if(ee===98||ee===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(Z);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(Z);case 124:case 38:return this.readToken_pipe_amp(Z);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(Z);case 60:case 62:return this.readToken_lt_gt(Z);case 61:case 33:return this.readToken_eq_excl(Z);case 63:return this.readToken_question();case 126:return this.finishOp(Ht.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+es(Z)+"'")};nn.finishOp=function(Z,ee){var Le=this.input.slice(this.pos,this.pos+ee);return this.pos+=ee,this.finishToken(Z,Le)};nn.readRegexp=function(){var Z,ee,Le=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(Le,"Unterminated regular expression");var Ot=this.input.charAt(this.pos);if(vn.test(Ot))this.raise(Le,"Unterminated regular expression");if(!Z){if(Ot==="[")ee=!0;else if(Ot==="]"&&ee)ee=!1;else if(Ot==="/"&&!ee)break;Z=Ot==="\\"}else Z=!1;++this.pos}var Bt=this.input.slice(Le,this.pos);++this.pos;var jt=this.pos,Gt=this.readWord1();if(this.containsEsc)this.unexpected(jt);var Lt=this.regexpState||(this.regexpState=new Xo(this));Lt.reset(Le,Bt,Gt),this.validateRegExpFlags(Lt),this.validateRegExpPattern(Lt);var Vt=null;try{Vt=new RegExp(Bt,Gt)}catch(Wt){}return this.finishToken(Ht.regexp,{pattern:Bt,flags:Gt,value:Vt})};nn.readInt=function(Z,ee,Le){var Ot=this.options.ecmaVersion>=12&&ee===void 0,Bt=Le&&this.input.charCodeAt(this.pos)===48,jt=this.pos,Gt=0,Lt=0;for(var Vt=0,Wt=ee==null?1/0:ee;Vt<Wt;++Vt,++this.pos){var Ut=this.input.charCodeAt(this.pos),Kt=void 0;if(Ot&&Ut===95){if(Bt)this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals");if(Lt===95)this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore");if(Vt===0)this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits");Lt=Ut;continue}if(Ut>=97)Kt=Ut-97+10;else if(Ut>=65)Kt=Ut-65+10;else if(Ut>=48&&Ut<=57)Kt=Ut-48;else Kt=1/0;if(Kt>=Z)break;Lt=Ut,Gt=Gt*Z+Kt}if(Ot&&Lt===95)this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits");if(this.pos===jt||ee!=null&&this.pos-jt!==ee)return null;return Gt};function vl(Z,ee){if(ee)return parseInt(Z,8);return parseFloat(Z.replace(/_/g,""))}function Jo(Z){if(typeof BigInt!=="function")return null;return BigInt(Z.replace(/_/g,""))}nn.readRadixNumber=function(Z){var ee=this.pos;this.pos+=2;var Le=this.readInt(Z);if(Le==null)this.raise(this.start+2,"Expected number in radix "+Z);if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110)Le=Jo(this.input.slice(ee,this.pos)),++this.pos;else if(h(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(Ht.num,Le)};nn.readNumber=function(Z){var ee=this.pos;if(!Z&&this.readInt(10,void 0,!0)===null)this.raise(ee,"Invalid number");var Le=this.pos-ee>=2&&this.input.charCodeAt(ee)===48;if(Le&&this.strict)this.raise(ee,"Invalid number");var Ot=this.input.charCodeAt(this.pos);if(!Le&&!Z&&this.options.ecmaVersion>=11&&Ot===110){var Bt=Jo(this.input.slice(ee,this.pos));if(++this.pos,h(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(Ht.num,Bt)}if(Le&&/[89]/.test(this.input.slice(ee,this.pos)))Le=!1;if(Ot===46&&!Le)++this.pos,this.readInt(10),Ot=this.input.charCodeAt(this.pos);if((Ot===69||Ot===101)&&!Le){if(Ot=this.input.charCodeAt(++this.pos),Ot===43||Ot===45)++this.pos;if(this.readInt(10)===null)this.raise(ee,"Invalid number")}if(h(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");var jt=vl(this.input.slice(ee,this.pos),Le);return this.finishToken(Ht.num,jt)};nn.readCodePoint=function(){var Z=this.input.charCodeAt(this.pos),ee;if(Z===123){if(this.options.ecmaVersion<6)this.unexpected();var Le=++this.pos;if(ee=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,ee>1114111)this.invalidStringToken(Le,"Code point out of bounds")}else ee=this.readHexChar(4);return ee};nn.readString=function(Z){var ee="",Le=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");var Ot=this.input.charCodeAt(this.pos);if(Ot===Z)break;if(Ot===92)ee+=this.input.slice(Le,this.pos),ee+=this.readEscapedChar(!1),Le=this.pos;else if(Ot===8232||Ot===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(ci(Ot))this.raise(this.start,"Unterminated string constant");++this.pos}}return ee+=this.input.slice(Le,this.pos++),this.finishToken(Ht.string,ee)};var Yo={};nn.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(Z){if(Z===Yo)this.readInvalidTemplateToken();else throw Z}this.inTemplateElement=!1};nn.invalidStringToken=function(Z,ee){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Yo;else this.raise(Z,ee)};nn.readTmplToken=function(){var Z="",ee=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated template");var Le=this.input.charCodeAt(this.pos);if(Le===96||Le===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&(this.type===Ht.template||this.type===Ht.invalidTemplate))if(Le===36)return this.pos+=2,this.finishToken(Ht.dollarBraceL);else return++this.pos,this.finishToken(Ht.backQuote);return Z+=this.input.slice(ee,this.pos),this.finishToken(Ht.template,Z)}if(Le===92)Z+=this.input.slice(ee,this.pos),Z+=this.readEscapedChar(!0),ee=this.pos;else if(ci(Le)){switch(Z+=this.input.slice(ee,this.pos),++this.pos,Le){case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:Z+=`
13
- `;break;default:Z+=String.fromCharCode(Le);break}if(this.options.locations)++this.curLine,this.lineStart=this.pos;ee=this.pos}else++this.pos}};nn.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(Ht.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":if(this.input[this.pos+1]===`
14
- `)++this.pos;case`
15
- `:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};nn.readEscapedChar=function(Z){var ee=this.input.charCodeAt(++this.pos);switch(++this.pos,ee){case 110:return`
16
- `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return es(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(Z){var Le=this.pos-1;this.invalidStringToken(Le,"Invalid escape sequence in template string")}default:if(ee>=48&&ee<=55){var Ot=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],Bt=parseInt(Ot,8);if(Bt>255)Ot=Ot.slice(0,-1),Bt=parseInt(Ot,8);if(this.pos+=Ot.length-1,ee=this.input.charCodeAt(this.pos),(Ot!=="0"||ee===56||ee===57)&&(this.strict||Z))this.invalidStringToken(this.pos-1-Ot.length,Z?"Octal literal in template string":"Octal literal in strict mode");return String.fromCharCode(Bt)}if(ci(ee)){if(this.options.locations)this.lineStart=this.pos,++this.curLine;return""}return String.fromCharCode(ee)}};nn.readHexChar=function(Z){var ee=this.pos,Le=this.readInt(16,Z);if(Le===null)this.invalidStringToken(ee,"Bad character escape sequence");return Le};nn.readWord1=function(){this.containsEsc=!1;var Z="",ee=!0,Le=this.pos,Ot=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var Bt=this.fullCharCodeAtPos();if(v(Bt,Ot))this.pos+=Bt<=65535?1:2;else if(Bt===92){this.containsEsc=!0,Z+=this.input.slice(Le,this.pos);var jt=this.pos;if(this.input.charCodeAt(++this.pos)!==117)this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX");++this.pos;var Gt=this.readCodePoint();if(!(ee?h:v)(Gt,Ot))this.invalidStringToken(jt,"Invalid Unicode escape");Z+=es(Gt),Le=this.pos}else break;ee=!1}return Z+this.input.slice(Le,this.pos)};nn.readWord=function(){var Z=this.readWord1(),ee=Ht.name;if(this.keywords.test(Z))ee=Xs[Z];return this.finishToken(ee,Z)};var El="8.18.0";s.acorn={Parser:s,version:El,defaultOptions:Ks,Position:Ei,SourceLocation:ts,getLineInfo:Fo,Node:rs,TokenType:an,tokTypes:Ht,keywordTypes:Xs,TokContext:An,tokContexts:pn,isIdentifierChar:v,isIdentifierStart:h,Token:tr,isNewLine:ci,lineBreak:vn,lineBreakG:ol,nonASCIIwhitespace:Mo};function wi(Z){return(ee)=>Z(ee)}function os(...Z){return s.extend(...Z)}function Ti(Z,ee,Le){for(let Ot=ee;Ot<Le;Ot++){let Bt=Z.charCodeAt(Ot);if(Bt===10||Bt===13||Bt===8232||Bt===8233)return!0}return!1}var Io=new WeakMap;function En(Z,ee){if(Z===void 0)return!1;if(Z.length<16)return Z.includes(ee);let Le=Io.get(Z);if(Le===void 0||Le.length>Z.length)Le={names:new Set,length:0},Io.set(Z,Le);while(Le.length<Z.length)Le.names.add(Z[Le.length++]);return Le.names.has(ee)}var nr=/(?:\s|\/\/.*|\/\*[\s\S]*?\*\/)*/g,Sl=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"]]),Cl=new Set("public private protected readonly declare abstract override static accessor".split(" ")),bl=new Set("public private protected readonly override".split(" ")),wl=new Set("var let const function class abstract enum interface type namespace module global".split(" ")),Tl=new Set("var let const function class interface enum".split(" ")),Qo=new Set(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"]),Zo=1,kl=32,Al=256,Pl=0,_l=1,ki=2,$l=3,Nl=4,ir=6,ea=7,oa=256,ar=1024,Dl=8|ar,Rl=ki|oa,ta=1,Il=2,na=40,Ol=41,Ll=44,ia=46,sa=58,as=61,ra=60,ps=123,Ml=91,sr=42,Fl=35,rr=34,or=39,Bl=SyntaxError("speculative parse failed"),pe=wi((Z)=>{let{tokTypes:ee,keywordTypes:Le,isIdentifierChar:Ot,isIdentifierStart:Bt}=Z.acorn,jt=new Z.acorn.TokenType("@");class Gt extends Z{inType=!1;$4=!1;$5=!1;$7=null;$k=null;$l=!1;$m=!1;$f=null;$9=[[]];$n=0;$t=0;$o=-1;constructor(Lt,Vt,Wt){super(Lt,Vt,Wt);let Ut=this.options.onComment;if(typeof Ut==="function")this.options.onComment=(Kt,qt,zt,Xt,Yt,Jt)=>{if(zt<this.$t)return;this.$t=Xt,Ut.call(this,Kt,qt,zt,Xt,Yt,Jt)}}reset(){this.inType=!1,this.$4=!1,this.$5=!1,this.$7=null,this.$k=null,this.$l=!1,this.$m=!1,this.$f=null,this.$9=[[]],this.$n=0,this.$t=0,this.$o=-1}getTokenFromCode(Lt){if(Lt===64)return++this.pos,this.finishToken(jt);return super.getTokenFromCode(Lt)}readToken_lt_gt(Lt){if(this.inType)return this.finishOp(ee.relational,1);return super.readToken_lt_gt(Lt)}$a(Lt){let Vt=this.inType;this.inType=!0;let Wt=Lt();if(this.inType=Vt,!Vt&&this.type===ee.relational)this.pos=this.start,this.nextToken();return Wt}$1(){return this.type===ee.relational&&this.value==="<"}$p(){if(this.type===ee.bitShift&&this.value==="<<")this.pos=this.start+1,this.finishToken(ee.relational,"<");return this.$1()}$c(){return this.type===ee.relational&&this.value===">"}$u(){return this.type===ee.prefix&&this.value==="!"}hasPrecedingLineBreak(){return Ti(this.input,this.lastTokEnd,this.start)}$d(Lt=this.pos){return nr.lastIndex=Lt,nr.exec(this.input),nr.lastIndex}$2(){return this.input.charCodeAt(this.$d())}$3(){let Lt=this.$d(),Vt=Lt;while(Vt<this.input.length&&Ot(this.input.charCodeAt(Vt)))Vt++;return this.input.slice(Lt,Vt)}$b(){return!Ti(this.input,this.pos,this.$d())}$14(){return this.$b()&&Bt(this.$2())&&!Object.hasOwn(Le,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(Lt){this.pos=Lt.pos,this.type=Lt.type,this.value=Lt.value,this.start=Lt.start,this.end=Lt.end,this.startLoc=Lt.startLoc,this.endLoc=Lt.endLoc,this.lastTokStart=Lt.lastTokStart,this.lastTokEnd=Lt.lastTokEnd,this.lastTokStartLoc=Lt.lastTokStartLoc,this.lastTokEndLoc=Lt.lastTokEndLoc,this.curLine=Lt.curLine,this.lineStart=Lt.lineStart,this.context=Lt.context,this.exprAllowed=Lt.exprAllowed,this.containsEsc=Lt.containsEsc,this.inType=Lt.inType,this.$4=Lt.$4,this.$5=Lt.$5,this.$7=Lt.$7,this.scopeStack.length=Lt.scopes,this.privateNameStack.length=Lt.privateNames,this.labels=Lt.labels,this.labels.length=Lt.labelCount,this.strict=Lt.strict,this.yieldPos=Lt.yieldPos,this.awaitPos=Lt.awaitPos,this.awaitIdentPos=Lt.awaitIdentPos,this.potentialArrowAt=Lt.potentialArrowAt,this.potentialArrowInForAwait=Lt.potentialArrowInForAwait}raise(Lt,Vt){if(this.$n>0)throw Bl;return super.raise(Lt,Vt)}$1y(Lt,Vt){try{super.raise(Lt,Vt)}catch(Wt){if(Wt instanceof SyntaxError)Wt.$1z=!0;throw Wt}throw Error("unreachable")}$g(Lt,Vt=!1){let Wt=this.$15();this.$n++;try{let Ut=Lt();if(Vt||Ut===void 0)this.$16(Wt);return Ut}catch(Ut){if(!(Ut instanceof SyntaxError)||!Vt&&Ut.$1z)throw Ut;this.$16(Wt);return}finally{this.$n--}}$v(Lt){return this.$g(Lt,!0)===!0}$17(Lt){if(Lt.end=this.lastTokEnd,this.options.locations)Lt.loc.end=this.lastTokEndLoc}$q(Lt,Vt){if(Lt.start=Vt.start,this.options.locations)Lt.loc.start=Vt.loc.start}$6(Lt=!1){let Vt=this.startNode();return Vt.typeAnnotation=this.$a(()=>(this.next(),Lt?this.$20():this.$0())),this.finishNode(Vt,"TSTypeAnnotation")}$h(Lt,Vt){if(Vt&&this.eat(ee.question))Lt.optional=!0,this.$17(Lt);if(this.type===ee.colon)Lt.typeAnnotation=this.$6(),this.$17(Lt);return Lt}$20(){if(this.type!==ee.name&&this.type!==ee._this)return this.$0();if(this.isContextual("asserts")&&this.$b()&&Bt(this.$2())){let Lt=this.startNode();if(this.next(),Lt.parameterName=this.type===ee._this?this.$w():this.parseIdent(),this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.$x(Lt,!0);return Lt.asserts=!0,Lt.typeAnnotation=null,this.finishNode(Lt,"TSTypePredicate")}if(this.$3()==="is"&&this.$b()){let Lt=this.startNode();return Lt.parameterName=this.type===ee._this?this.$w():this.parseIdent(!0),this.$x(Lt,!1)}return this.$0()}$x(Lt,Vt){this.next();let Wt=this.startNode();return Wt.typeAnnotation=this.$0(),Lt.typeAnnotation=this.finishNode(Wt,"TSTypeAnnotation"),Lt.asserts=Vt,this.finishNode(Lt,"TSTypePredicate")}$w(){let Lt=this.startNode();return this.next(),this.finishNode(Lt,"TSThisType")}parseWholeType(){this.inType=!0,this.nextToken();let Lt=this.$0();if(this.type!==ee.eof)this.unexpected();return Lt}$0(){let Lt=this.$18();if(this.$4||this.type!==ee._extends||this.hasPrecedingLineBreak())return Lt;let Vt=this.startNodeAt(Lt.start,Lt.loc?.start);return this.next(),Vt.checkType=Lt,Vt.extendsType=this.$i(!0,()=>this.$18()),this.expect(ee.question),Vt.trueType=this.$i(!1,()=>this.$0()),this.expect(ee.colon),Vt.falseType=this.$i(!1,()=>this.$0()),this.finishNode(Vt,"TSConditionalType")}$i(Lt,Vt){let Wt=this.$4;this.$4=Lt;let Ut=Vt();return this.$4=Wt,Ut}$18(){if(this.$21())return this.$19("TSFunctionType");if(this.type===ee._new||this.isContextual("abstract")&&this.$3()==="new")return this.$19("TSConstructorType");return this.$1a("TSUnionType",ee.bitwiseOR,()=>this.$1a("TSIntersectionType",ee.bitwiseAND,()=>this.$1b()))}$19(Lt){let Vt=this.startNode();if(Lt==="TSConstructorType"){if(Vt.abstract=this.isContextual("abstract"),Vt.abstract)this.next();this.next()}return this.$i(!1,()=>this.$r(Vt,ee.arrow)),this.finishNode(Vt,Lt)}$r(Lt,Vt){if(this.$1())Lt.typeParameters=this.$8();if(this.expect(ee.parenL),Lt.parameters=this.parseBindingList(ee.parenR,!1,!0),this.type===Vt)Lt.typeAnnotation=this.$6(!0);else if(Vt===ee.arrow)this.unexpected()}$21(){if(this.$1())return!0;if(this.type!==ee.parenL)return!1;return this.$v(()=>{if(this.next(),this.type===ee.parenR||this.type===ee.ellipsis)return!0;if(this.type===ee.name||this.type===ee._this)this.next();else if(this.type===ee.braceL||this.type===ee.bracketL)this.parseBindingAtom();else return!1;let Lt=this.type;if(Lt===ee.colon||Lt===ee.comma||Lt===ee.question||Lt===ee.eq)return!0;if(Lt!==ee.parenR)return!1;return this.next(),this.type===ee.arrow})}$1a(Lt,Vt,Wt){let Ut=this.startNode(),Kt=this.eat(Vt),qt=[];do qt.push(Wt());while(this.eat(Vt));if(qt.length===1&&!Kt)return qt[0];return Ut.types=qt,this.finishNode(Ut,Lt)}$1b(){if(this.type===ee.name&&!this.containsEsc){let Lt=this.value;if(Lt==="keyof"||Lt==="unique"||Lt==="readonly"){let Vt=this.startNode();return this.next(),Vt.operator=Lt,Vt.typeAnnotation=this.$1b(),this.finishNode(Vt,"TSTypeOperator")}if(Lt==="infer"){let Vt=this.startNode();this.next();let Wt=this.startNode();Wt.name=this.$y();let Ut=this.$g(()=>this.$22());if(Ut)Wt.constraint=Ut;return Vt.typeParameter=this.finishNode(Wt,"TSTypeParameter"),this.finishNode(Vt,"TSInferType")}}return this.$i(!1,()=>this.$23())}$22(){if(!this.eat(ee._extends))return;let Lt=this.$i(!0,()=>this.$0());return this.$4||this.type!==ee.question?Lt:void 0}$y(){if(this.type!==ee.name&&!this.type.keyword)this.unexpected();let Lt=this.type===ee.name?this.value:this.type.keyword;return this.next(),Lt}$23(){let Lt=this.$24();while(!this.hasPrecedingLineBreak()&&this.eat(ee.bracketL)){let Vt=this.startNodeAt(Lt.start,Lt.loc?.start);if(this.eat(ee.bracketR))Vt.elementType=Lt,Lt=this.finishNode(Vt,"TSArrayType");else Vt.objectType=Lt,Vt.indexType=this.$0(),this.expect(ee.bracketR),Lt=this.finishNode(Vt,"TSIndexedAccessType")}return Lt}$24(){switch(this.type){case ee.name:case ee._void:case ee._null:{let Lt=Sl.get(this.value);if(Lt&&(this.type!==ee.name||!this.containsEsc&&this.$2()!==ia)){let Vt=this.startNode();return this.next(),this.finishNode(Vt,Lt)}return this.$1c()}case ee.string:case ee.num:case ee._true:case ee._false:{let Lt=this.startNode();return Lt.literal=this.parseExprAtom(),this.finishNode(Lt,"TSLiteralType")}case ee.plusMin:{if(this.value!=="-")break;let Lt=this.startNode(),Vt=this.startNode();if(this.next(),this.type!==ee.num)this.unexpected();return Vt.operator="-",Vt.prefix=!0,Vt.argument=this.parseExprAtom(),Lt.literal=this.finishNode(Vt,"UnaryExpression"),this.finishNode(Lt,"TSLiteralType")}case ee.backQuote:return this.$25();case ee._this:{let Lt=this.$w();if(this.isContextual("is")&&!this.hasPrecedingLineBreak()){let Vt=this.startNodeAt(Lt.start,Lt.loc?.start);return Vt.parameterName=Lt,this.$x(Vt,!1)}return Lt}case ee._typeof:return this.$26();case ee._import:return this.$1d();case ee.braceL:return this.$27()?this.$28():this.$29();case ee.bracketL:return this.$2a();case ee.parenL:{let Lt=this.startNode();return this.next(),Lt.typeAnnotation=this.$0(),this.expect(ee.parenR),this.finishNode(Lt,"TSParenthesizedType")}default:if(this.type.keyword)return this.$1c()}return this.unexpected()}$1c(){let Lt=this.startNode();if(Lt.typeName=this.$j(),!this.hasPrecedingLineBreak()&&this.$1())Lt.typeArguments=this.$e();return this.finishNode(Lt,"TSTypeReference")}$j(){let Lt=this.parseIdent(!0);while(this.eat(ee.dot)){let Vt=this.startNodeAt(Lt.start,Lt.loc?.start);Vt.left=Lt,Vt.right=this.parseIdent(!0),Lt=this.finishNode(Vt,"TSQualifiedName")}return Lt}$26(){let Lt=this.startNode();if(this.next(),Lt.exprName=this.type===ee._import?this.$1d():this.$j(),!this.hasPrecedingLineBreak()&&this.$1())Lt.typeArguments=this.$e();return this.finishNode(Lt,"TSTypeQuery")}$1d(){let Lt=this.startNode();if(this.next(),Lt.argument=this.$1e(),this.eat(ee.dot))Lt.qualifier=this.$j();if(this.$1())Lt.typeArguments=this.$e();return this.finishNode(Lt,"TSImportType")}$z(){if(this.type!==ee.string)this.unexpected();return this.parseExprAtom()}$1e(){this.expect(ee.parenL);let Lt=this.$z();return this.expect(ee.parenR),Lt}$25(){let Lt=this.startNode(),Vt=this.startNode();this.next(),Vt.expressions=[];let Wt=this.parseTemplateElement({isTagged:!1});Vt.quasis=[Wt];while(!Wt.tail){if(this.type===ee.eof)this.raise(this.pos,"Unterminated template literal");this.expect(ee.dollarBraceL),Vt.expressions.push(this.$0()),this.expect(ee.braceR),Wt=this.parseTemplateElement({isTagged:!1}),Vt.quasis.push(Wt)}return this.next(),Lt.literal=this.finishNode(Vt,"TemplateLiteral"),this.finishNode(Lt,"TSLiteralType")}$27(){return this.$v(()=>{if(this.next(),this.type===ee.plusMin)return this.next(),this.isContextual("readonly");if(this.isContextual("readonly"))this.next();if(this.type!==ee.bracketL)return!1;if(this.next(),this.type!==ee.name)return!1;return this.next(),this.type===ee._in})}$28(){let Lt=this.startNode();if(this.expect(ee.braceL),this.type===ee.plusMin)Lt.readonly=this.value,this.next(),this.expectContextual("readonly");else if(this.eatContextual("readonly"))Lt.readonly=!0;this.expect(ee.bracketL);let Vt=this.startNode();if(Vt.name=this.$y(),this.expect(ee._in),Vt.constraint=this.$0(),Lt.typeParameter=this.finishNode(Vt,"TSTypeParameter"),Lt.nameType=this.eatContextual("as")?this.$0():null,this.expect(ee.bracketR),this.type===ee.plusMin)Lt.optional=this.value,this.next(),this.expect(ee.question);else if(this.eat(ee.question))Lt.optional=!0;if(this.eat(ee.colon))Lt.typeAnnotation=this.$0();return this.semicolon(),this.expect(ee.braceR),this.finishNode(Lt,"TSMappedType")}$29(){let Lt=this.startNode();return Lt.members=this.$1f(),this.finishNode(Lt,"TSTypeLiteral")}$1f(){this.expect(ee.braceL);let Lt=[];while(!this.eat(ee.braceR))Lt.push(this.$2b());return Lt}$2b(){let Lt=this.startNode(),Vt="TSPropertySignature",Wt=this.type===ee._new?this.$2():-1;if(this.type===ee.parenL||this.$1())Vt="TSCallSignatureDeclaration",this.$r(Lt,ee.colon);else if(Wt===na||Wt===ra)Vt="TSConstructSignatureDeclaration",this.next(),this.$r(Lt,ee.colon);else{let Ut=this.type===ee._new?this.parseIdent(!0):null;if(this.isContextual("readonly")&&this.$s(!0))this.next(),Lt.readonly=!0;if(this.type===ee.bracketL&&this.$1g())return this.$1h(Lt);let Kt="method";if(Ut)Lt.key=Ut;else{if((this.isContextual("get")||this.isContextual("set"))&&this.$s(!1))Kt=this.value,this.next();this.parsePropertyName(Lt)}if(this.eat(ee.question))Lt.optional=!0;if(this.type===ee.parenL||this.$1()){if(Vt="TSMethodSignature",Kt!=="method")Lt.kind=Kt;this.$r(Lt,ee.colon),Lt.kind=Kt}else if(this.type===ee.colon)Lt.typeAnnotation=this.$6()}return this.$1i(),this.finishNode(Lt,Vt)}$1i(){if(!this.eat(ee.comma))this.semicolon()}$1g(){return this.$v(()=>{if(this.next(),this.type!==ee.name)return!1;return this.next(),this.type===ee.colon})}$1h(Lt){if(this.expect(ee.bracketL),Lt.parameters=[this.$h(this.parseIdent(),!1)],this.expect(ee.bracketR),this.type===ee.colon)Lt.typeAnnotation=this.$6();return this.$1i(),this.finishNode(Lt,"TSIndexSignature")}$2a(){let Lt=this.startNode();this.expect(ee.bracketL),Lt.elementTypes=[];while(!this.eat(ee.bracketR))if(Lt.elementTypes.push(this.$2c()),this.type!==ee.bracketR)this.expect(ee.comma);return this.finishNode(Lt,"TSTupleType")}$2c(){let Lt=this.start,Vt=this.startLoc,Wt=this.eat(ee.ellipsis),Ut;if((this.type===ee.name||this.type.keyword)&&this.$2d()){let Kt=this.startNode();Kt.label=this.parseIdent(!0),Kt.optional=this.eat(ee.question),this.expect(ee.colon),Kt.elementType=this.$0(),Ut=this.finishNode(Kt,"TSNamedTupleMember")}else if(Ut=this.$0(),this.eat(ee.question)){let Kt=this.startNodeAt(Ut.start,Ut.loc?.start);Kt.typeAnnotation=Ut,Ut=this.finishNode(Kt,"TSOptionalType")}if(Wt){let Kt=this.startNodeAt(Lt,Vt);Kt.typeAnnotation=Ut,Ut=this.finishNode(Kt,"TSRestType")}return Ut}$2d(){let Lt=this.$d();if(this.input.charCodeAt(Lt)===63)Lt=this.$d(Lt+1);return this.input.charCodeAt(Lt)===sa}$8(){return this.$a(()=>{let Lt=this.startNode();this.next(),Lt.params=[];while(!this.$c()){let Vt=this.startNode();while((this.type===ee._const||this.type===ee._in||this.isContextual("out"))&&Bt(this.$2()))Vt[this.value]=!0,this.next();if(Vt.name=this.$y(),this.eat(ee._extends))Vt.constraint=this.$0();if(this.eat(ee.eq))Vt.default=this.$0();if(Lt.params.push(this.finishNode(Vt,"TSTypeParameter")),!this.$c()){if(this.expect(ee.comma),this.$c())Lt.extra={trailingComma:this.lastTokStart}}}if(this.next(),Lt.params.length===0)this.$1y(this.start,"Type parameter list cannot be empty.");return this.finishNode(Lt,"TSTypeParameterDeclaration")})}$e(){return this.$a(()=>{let Lt=this.startNode();this.next(),Lt.params=[];while(!this.$c())if(Lt.params.push(this.$0()),!this.$c())this.expect(ee.comma);if(Lt.params.length===0)this.unexpected();return this.next(),this.finishNode(Lt,"TSTypeParameterInstantiation")})}$1j(){let Lt=[];do{let Vt=this.startNode();if(Vt.expression=this.$j(),this.$1())Vt.typeParameters=this.$e();Lt.push(this.finishNode(Vt,"TSExpressionWithTypeArguments"))}while(this.eat(ee.comma));return Lt}$1k(Lt=!1){if(this.type!==ee.name||this.containsEsc){if(this.type===ee._const&&this.$3()==="enum")return this.$10(this.startNode());return}if(!this.$2e(this.value))return;if(this.value==="declare")return this.$2f(Lt);return this.$1l(this.startNode(),this.value)}$2e(Lt){switch(Lt){case"interface":case"type":case"namespace":return this.$14();case"enum":return Bt(this.$2());case"abstract":return this.$b()&&this.$3()==="class";case"module":{let Vt=this.$2();return this.$b()&&(Vt===rr||Vt===or||Bt(Vt))}case"declare":return this.$b()&&wl.has(this.$3());case"global":return this.$b()&&this.$2()===ps}return!1}$1l(Lt,Vt){switch(Vt){case"interface":return this.$1m(Lt);case"type":return this.$2g(Lt);case"enum":return this.$10(Lt);case"abstract":return this.$1n(Lt,!0);case"global":return Lt.global=!0,Lt.id=this.parseIdent(),Lt.body=this.$11(),this.finishNode(Lt,"TSModuleDeclaration")}return this.$2h(Lt)}$2f(Lt){let Vt=this.$5;this.$5=!0;let Wt=this.startNode();this.next();let Ut=this.value;if(Ut==="const"&&this.$3()==="enum")Wt.const=!0;if(!Lt&&Tl.has(Ut))Wt.declare=!0;let Kt;if(Wt.const)Kt=this.$10(Wt);else if(Ut==="var"||Ut==="let"||Ut==="const")Kt=this.parseVarStatement(Wt,Ut,!0);else if(Ut==="function")this.next(),Kt=this.parseFunction(Wt,ta,!1,!1);else if(Ut==="class")Kt=this.parseClass(Wt,!0);else Kt=this.$1l(Wt,Ut);return Kt.declare=!0,this.$5=Vt,Kt}$1n(Lt,Vt){return this.next(),Lt.abstract=!0,this.parseClass(Lt,Vt)}$1m(Lt){if(this.next(),Lt.id=this.parseIdent(),this.checkLValSimple(Lt.id,ea),this.$1())Lt.typeParameters=this.$8();return this.$a(()=>{if(this.eat(ee._extends))Lt.extends=this.$1j();let Vt=this.startNode();Vt.body=this.$1f(),Lt.body=this.finishNode(Vt,"TSInterfaceBody")}),this.finishNode(Lt,"TSInterfaceDeclaration")}$2g(Lt){if(this.next(),Lt.id=this.parseIdent(),this.checkLValSimple(Lt.id,ir),this.$1())Lt.typeParameters=this.$8();return Lt.typeAnnotation=this.$a(()=>(this.expect(ee.eq),this.$0())),this.semicolon(),this.finishNode(Lt,"TSTypeAliasDeclaration")}$10(Lt){if(this.type===ee._const)Lt.const=!0,this.next();this.next(),Lt.id=this.parseIdent(),this.checkLValSimple(Lt.id,Rl),this.expect(ee.braceL),Lt.members=[];while(!this.eat(ee.braceR)){let Vt=this.startNode();if(Vt.id=this.type===ee.string?this.parseExprAtom():this.parseIdent(!0),this.eat(ee.eq))Vt.initializer=this.parseMaybeAssign();if(Lt.members.push(this.finishNode(Vt,"TSEnumMember")),this.type!==ee.braceR)this.expect(ee.comma)}return this.finishNode(Lt,"TSEnumDeclaration")}$2h(Lt){if(this.next(),this.type===ee.string){if(Lt.id=this.parseExprAtom(),this.type===ee.braceL)Lt.body=this.$11();else this.semicolon();return this.finishNode(Lt,"TSModuleDeclaration")}return Lt.id=this.parseIdent(),this.checkLValSimple(Lt.id,Dl),this.$1o(Lt)}$1o(Lt){if(this.eat(ee.dot)){let Vt=this.startNode();Vt.id=this.parseIdent(),Lt.body=this.$1o(Vt)}else Lt.body=this.$11();return this.finishNode(Lt,"TSModuleDeclaration")}$11(){this.enterScope(Al);let Lt=this.startNode();this.enterScope(0),this.expect(ee.braceL),Lt.body=[];while(!this.eat(ee.braceR))Lt.body.push(this.parseStatement(null,!0));return this.exitScope(),this.exitScope(),this.finishNode(Lt,"TSModuleBlock")}$1p(Lt,Vt){if(Lt.isExport=Vt,Lt.id=this.parseIdent(),this.checkLValSimple(Lt.id,ki),this.expect(ee.eq),this.isContextual("require")&&this.$2()===na){let Wt=this.startNode();this.next(),Wt.expression=this.$1e(),Lt.moduleReference=this.finishNode(Wt,"TSExternalModuleReference")}else Lt.moduleReference=this.$j();return this.semicolon(),this.finishNode(Lt,"TSImportEqualsDeclaration")}$2i(){let Lt=this.$d();if(this.input.charCodeAt(Lt)!==as)return!1;let Vt=this.input.charCodeAt(Lt+1);return Vt!==as&&Vt!==62}parseStatement(Lt,Vt,Wt){if(this.type===jt)this.$1q(!0);let Ut=this.$1k();if(Ut)return Ut;return super.parseStatement(Lt,Vt,Wt)}parseVarStatement(Lt,Vt,Wt){return super.parseVarStatement(Lt,Vt,Wt||this.$5)}parseVarId(Lt,Vt){if(super.parseVarId(Lt,Vt),Lt.id.type==="Identifier"&&this.$u()&&!this.hasPrecedingLineBreak())this.next(),Lt.definite=!0;this.$h(Lt.id,!1)}parseCatchClauseParam(){let Lt=this.$h(this.parseBindingAtom(),!1),Vt=Lt.type==="Identifier";return this.enterScope(Vt?kl:0),this.checkLValPattern(Lt,Vt?Nl:ki),this.expect(ee.parenR),Lt}parseImport(Lt){if(this.next(),Lt.importKind="value",this.type===ee.string)Lt.specifiers=[],Lt.source=this.parseExprAtom();else{if(this.isContextual("type")){let Vt=this.$2();if(Vt===ps||Vt===sr||Bt(Vt)&&this.$3()!=="from")Lt.importKind="type",this.next()}if(this.type===ee.name&&this.$2i())return this.$1p(Lt,!1);Lt.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),Lt.source=this.$z()}return this.$1r(Lt),this.semicolon(),this.finishNode(Lt,"ImportDeclaration")}parseWithClause(){if(this.isContextual("assert")&&!this.hasPrecedingLineBreak())this.type=ee._with;return this.type===ee._with?super.parseWithClause():void 0}$1r(Lt){let Vt=this.parseWithClause();if(Vt)Lt.attributes=Vt}parseImportSpecifier(){return this.$1s("importKind",()=>super.parseImportSpecifier())}parseExportSpecifier(Lt){return this.$1s("exportKind",()=>super.parseExportSpecifier(Lt))}$1s(Lt,Vt){let Wt=this.isContextual("type")?this.$2():-1;if(Wt===rr||Wt===or||Bt(Wt)&&this.$3()!=="as"){let Kt=this.startNode();this.next();let qt=Vt();return this.$q(qt,Kt),qt[Lt]="type",qt}let Ut=Vt();return Ut[Lt]="value",Ut}parseExport(Lt,Vt){if(this.next(),this.eat(ee._import)){if(Lt.importKind="value",this.isContextual("type")&&Bt(this.$2())&&this.$3()!=="from")Lt.importKind="type",this.next();return this.$1p(Lt,!0)}if(this.eat(ee.eq))return Lt.expression=this.parseExpression(),this.semicolon(),this.finishNode(Lt,"TSExportAssignment");if(this.eatContextual("as"))return this.expectContextual("namespace"),Lt.id=this.parseIdent(),this.semicolon(),this.finishNode(Lt,"TSNamespaceExportDeclaration");if(Lt.exportKind="value",this.isContextual("type")){let Kt=this.$2();if(Kt===ps||Kt===sr)Lt.exportKind="type",this.next()}if(this.eat(ee.star))return this.parseExportAllDeclaration(Lt,Vt);if(this.eat(ee._default)){if(this.isContextual("interface")&&this.$14())Lt.declaration=this.$1m(this.startNode());else if(this.isContextual("abstract")&&this.$3()==="class")Lt.declaration=this.$1n(this.startNode(),"nullableID");else Lt.declaration=this.parseExportDefaultDeclaration();return this.finishNode(Lt,"ExportDefaultDeclaration")}let Wt=this.isContextual("declare"),Ut=this.$1k(!0);if(Ut||this.shouldParseExportStatement()){if(Lt.declaration=Ut??this.parseStatement(null),Wt||Lt.declaration.type==="TSInterfaceDeclaration"||Lt.declaration.type==="TSTypeAliasDeclaration")Lt.exportKind="type";return Lt.specifiers=[],Lt.source=null,this.finishNode(Lt,"ExportNamedDeclaration")}if(Lt.declaration=null,Lt.specifiers=this.parseExportSpecifiers(Vt),this.eatContextual("from"))Lt.source=this.$z(),this.$1r(Lt);else{for(let Kt of Lt.specifiers)if(this.checkUnreserved(Kt.local),this.checkLocalExport(Kt.local),Kt.local.type==="Literal")this.raise(Kt.local.start,"A string literal cannot be used as an exported binding without `from`.");Lt.source=null}return this.semicolon(),this.finishNode(Lt,"ExportNamedDeclaration")}parseFunction(Lt,Vt,Wt,Ut,Kt){let qt=Vt&ta;if(qt)this.$f=Lt,this.$o=Lt.start;super.parseFunction(Lt,Vt,Wt,Ut,Kt),this.$f=null;let zt=!Lt.body;if(zt)Lt.type="TSDeclareFunction";if(qt&&Lt.id){if(zt){if(this.$5&&this.currentScope().flags&Zo)this.declareName(Lt.id.name,ar,Lt.id.start);this.checkLValSimple(Lt.id,Pl)}else if(!(Vt&Il)){let Xt=$l;if(this.strict||Lt.generator||Lt.async)Xt=this.treatFunctionsAsVar?_l:ki;this.checkLValSimple(Lt.id,Xt)}}return Lt}parseFunctionParams(Lt){if(this.$1())Lt.typeParameters=this.$8();if(super.parseFunctionParams(Lt),this.type===ee.colon)Lt.returnType=this.$6(!0)}parseFunctionBody(Lt,Vt,Wt,Ut){if(Wt&&this.type===ee.colon)Lt.returnType=this.$6(!0);if(Vt||this.type===ee.braceL||Lt.start!==this.$o){super.parseFunctionBody(Lt,Vt,Wt,Ut);return}this.semicolon(),this.exitScope()}parseMethod(Lt,Vt,Wt){let Ut=this.$k;this.$k=null;let Kt=super.parseMethod(Lt,Vt,Wt);if(!Kt.body)Kt.type="TSDeclareMethod";if(Ut)Kt.typeParameters=Ut;return Kt}parseBindingList(Lt,Vt,Wt,Ut){let Kt=Ut===!0||this.$l;return this.$l=!1,super.parseBindingList(Lt,Vt,Wt,Kt)}$s(Lt){if(!Lt&&!this.$b())return!1;let Vt=this.$2();return Vt===Ml||Vt===ps||Vt===sr||Vt===ia||Vt===Fl||Vt===rr||Vt===or||Vt>=48&&Vt<=57||Bt(Vt)}parseAssignableListItem(Lt){let Vt=this.$12(),Wt=this.start,Ut=this.startLoc,Kt,qt=!1,zt=!1;if(Lt)while(this.type===ee.name&&bl.has(this.value)&&!this.containsEsc&&this.$s(!1)){if(this.value==="readonly")qt=!0;else if(this.value==="override")zt=!0;else Kt=this.value;this.next()}let Xt;if(this.type===ee._this)Xt=this.startNode(),Xt.name="this",this.next(),this.finishNode(Xt,"Identifier");else Xt=this.parseBindingAtom();let Yt=this.type===ee.eq?this.parseMaybeDefault(Wt,Ut,Xt):this.parseMaybeDefault(Xt.start,Xt.loc?.start,this.$h(Xt,!0));if(Vt.length>0)Yt.decorators=Vt;if(!Kt&&!qt&&!zt)return Yt;let Jt=this.startNodeAt(Wt,Ut);if(Kt)Jt.accessibility=Kt;if(qt)Jt.readonly=!0;if(zt)Jt.override=!0;return Jt.parameter=Yt,this.finishNode(Jt,"TSParameterProperty")}parseBindingListItem(Lt){if(Lt.type==="RestElement")this.$h(Lt,!0);return Lt}checkLValSimple(Lt,Vt,Wt){if(this.$f&&Lt===this.$f.id){this.$f=null;return}if(!Vt&&Qo.has(Lt.type)){this.checkLValSimple(Lt.expression,Vt,Wt);return}switch(Lt.type){case"TSParameterProperty":this.checkLValInnerPattern(Lt.parameter,Vt,Wt);return;case"Identifier":if(Lt.name==="this")return}super.checkLValSimple(Lt,Vt,Wt)}toAssignable(Lt,Vt,Wt){if(Lt&&!Vt&&Qo.has(Lt.type))return Lt;return super.toAssignable(Lt,Vt,Wt)}declareName(Lt,Vt,Wt){let Ut=this.currentScope();if(Vt&ar){this.$1t(Ut,Lt),Ut.$1u??=[],Ut.$1u.push(Lt);return}if(Vt===ir||Vt===ea){if(Ut.$13??=[],Vt===ir&&En(Ut.$13,Lt))this.raise(Wt,`type '${Lt}' has already been declared.`);Ut.$13.push(Lt),this.$1t(Ut,Lt);return}if(Vt&oa){if(Ut.$1v??=[],En(Ut.$1v,Lt))return;super.declareName(Lt,ki,Wt),Ut.$1v.push(Lt);return}super.declareName(Lt,Vt,Wt)}$1t(Lt,Vt){if(this.inModule&&Lt.flags&Zo)delete this.undefinedExports[Vt]}checkLocalExport(Lt){for(let Vt=this.scopeStack.length-1;Vt>=0;Vt--){let Wt=this.scopeStack[Vt];if(En(Wt.$13,Lt.name)||En(Wt.$1u,Lt.name))return}super.checkLocalExport(Lt)}checkExport(){}raiseRecoverable(Lt,Vt){if(Vt==="Duplicate constructor in the same class")return;super.raiseRecoverable(Lt,Vt)}$12(){let Lt=[];while(this.type===jt)Lt.push(this.$1w());return Lt}$1q(Lt){let Vt=this.$9[this.$9.length-1];while(this.type===jt)Vt.push(this.$1w());if(this.type===ee._export){if(!Lt)this.unexpected()}else if(this.type!==ee._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 Lt=this.startNode();this.next(),this.$9.push([]);let Vt=this.start,Wt=this.startLoc,Ut;if(this.type===ee.parenL){if(this.next(),Ut=this.parseExpression(),this.expect(ee.parenR),this.options.preserveParens){let qt=this.startNodeAt(Vt,Wt);qt.expression=Ut,Ut=this.finishNode(qt,"ParenthesizedExpression")}}else{Ut=this.parseIdent(!1);while(this.eat(ee.dot)){let qt=this.startNodeAt(Vt,Wt);qt.object=Ut,qt.property=this.parseIdent(!0),qt.computed=!1,Ut=this.finishNode(qt,"MemberExpression")}}let Kt=this.$p()?this.$e():void 0;if(this.eat(ee.parenL)){let qt=this.startNodeAt(Ut.start,Ut.loc?.start);if(qt.callee=Ut,qt.arguments=this.parseExprList(ee.parenR,!1,!1),Kt)qt.typeArguments=Kt;Ut=this.finishNode(qt,"CallExpression")}else if(Kt){let qt=this.startNodeAt(Ut.start,Ut.loc?.start);qt.expression=Ut,qt.typeArguments=Kt,Ut=this.finishNode(qt,"TSInstantiationExpression")}return Lt.expression=Ut,this.$9.pop(),this.finishNode(Lt,"Decorator")}shouldParseExportStatement(){return this.type===jt||super.shouldParseExportStatement()}parseExprAtom(Lt,Vt,Wt){if(this.type===jt)this.$1q(!1);return super.parseExprAtom(Lt,Vt,Wt)}parseProperty(Lt,Vt){if(Lt||this.type!==jt)return super.parseProperty(Lt,Vt);let Wt=this.$12(),Ut=super.parseProperty(Lt,Vt);if(Ut.type==="SpreadElement")this.raise(Ut.start,"Decorators can't be used with SpreadElement");return Ut.decorators=Wt,Ut}parseClassId(Lt,Vt){let Wt=this.$9.length-1,Ut=this.$9[Wt];if(Ut.length>0)Lt.decorators=Ut,this.$q(Lt,Ut[0]),this.$9[Wt]=[];if(!this.isContextual("implements")||Vt===!0)super.parseClassId(Lt,Vt);if(this.$1())Lt.typeParameters=this.$8()}parseClassSuper(Lt){if(super.parseClassSuper(Lt),Lt.superClass&&this.$1())Lt.superTypeParameters=this.$e();if(this.eatContextual("implements"))Lt.implements=this.$a(()=>this.$1j())}parseClassElement(Lt){if(this.type===jt){let zt=this.$12();if(this.type===ee.braceR)this.raise(this.start,"Decorators must be attached to a class element.");let Xt=this.parseClassElement(Lt);return Xt.decorators=zt,this.$q(Xt,zt[0]),Xt}if(this.eat(ee.semi))return null;let Vt=this.startNode();while(this.type===ee.name&&Cl.has(this.value)&&!this.containsEsc&&this.$s(this.value==="static")){let zt=this.value;if(this.next(),zt==="static"&&this.type===ee.braceL)return this.next(),this.parseClassStaticBlock(Vt),Vt;if(zt==="public"||zt==="private"||zt==="protected")Vt.accessibility=zt;else Vt[zt]=!0}if(this.type===ee.bracketL&&this.$1g())return this.$1h(Vt);Vt.static??=!1;let Wt="",Ut=!1,Kt=!1,qt="method";if(this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===ee.star)&&!this.canInsertSemicolon())Kt=!0;else Wt="async";if(!Wt&&this.eat(ee.star))Ut=!0;if(!Wt&&!Kt&&!Ut){let zt=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())qt=zt;else Wt=zt}if(Wt)Vt.computed=!1,Vt.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),Vt.key.name=Wt,this.finishNode(Vt.key,"Identifier");else this.parseClassElementName(Vt);if(this.eat(ee.question))Vt.optional=!0;if(this.type===ee.parenL||this.$1()||qt!=="method"||Ut||Kt){let zt=Vt.key,Xt=!Vt.static&&!Vt.computed&&(zt.type==="Identifier"&&zt.name==="constructor"||zt.type==="Literal"&&zt.value==="constructor");if(Vt.kind=Xt?"constructor":qt,this.$1())Vt.typeParameters=this.$8();this.$l=Xt,this.$o=this.start,this.parseClassMethod(Vt,Ut,Kt,Xt&&Lt)}else{if(!Vt.optional&&this.$u())this.next(),Vt.definite=!0;if(this.type===ee.colon)Vt.typeAnnotation=this.$6();this.parseClassField(Vt)}return Vt}parseMaybeAssign(Lt,Vt,Wt){if(this.$p()){let Ut=this.$g(()=>{let Kt=this.$8(),qt=super.parseMaybeAssign(Lt,Vt,Wt);if(qt.type!=="ArrowFunctionExpression")return;return qt.typeParameters=Kt,this.$q(qt,Kt),qt});if(Ut)return Ut}return super.parseMaybeAssign(Lt,Vt,Wt)}parseMaybeUnary(Lt,Vt,Wt,Ut){if(this.$p()){let Kt=this.startNode();return Kt.typeAnnotation=this.$a(()=>{this.next();let qt=this.$0();if(!this.$c())this.unexpected();return this.next(),qt}),Kt.expression=this.parseMaybeUnary(null,!1,!1,Ut),this.finishNode(Kt,"TSTypeAssertion")}return super.parseMaybeUnary(Lt,Vt,Wt,Ut)}parseMaybeConditional(Lt,Vt){let Wt=this.start,Ut=this.startLoc,Kt=this.parseExprOps(Lt,Vt);if(this.checkExpressionErrors(Vt))return Kt;if(this.type===ee.question&&!(Kt.type==="ArrowFunctionExpression"&&Kt.start===Wt)&&!this.$2j()){this.next();let qt=this.startNodeAt(Wt,Ut);return qt.test=Kt,qt.consequent=this.parseMaybeAssign(),this.expect(ee.colon),qt.alternate=this.parseMaybeAssign(Lt),this.finishNode(qt,"ConditionalExpression")}return Kt}$2j(){let Lt=this.$d(),Vt=this.input.charCodeAt(Lt);if(Vt===sa||Vt===Ll||Vt===Ol)return!0;return Vt===as&&this.input.charCodeAt(Lt+1)!==as}parseParenItem(Lt){return this.$h(Lt,!0)}$1x(){if(this.type!==ee.colon)return!0;let Lt=this.$g(()=>{let Vt=this.$6(!0);return this.type===ee.arrow&&!this.canInsertSemicolon()?Vt:void 0});if(!Lt)return!1;return this.$7=Lt,!0}shouldParseArrow(Lt){return this.$1x()&&super.shouldParseArrow(Lt)}shouldParseAsyncArrow(){return this.$1x()&&super.shouldParseAsyncArrow()}parseArrowExpression(Lt,Vt,Wt,Ut){if(this.$7)Lt.returnType=this.$7,this.$7=null;return super.parseArrowExpression(Lt,Vt,Wt,Ut)}parseExprList(Lt,Vt,Wt,Ut){if(!this.$m)return super.parseExprList(Lt,Vt,Wt,Ut);this.$m=!1;let Kt=[],qt=!0;while(!this.eat(Lt)){if(qt)qt=!1;else if(this.expect(ee.comma),Vt&&this.afterTrailingComma(Lt))break;if(this.type===ee.ellipsis){let zt=this.parseSpread(Ut);if(this.eat(ee.question))zt.optional=!0;if(this.type===ee.colon)zt.typeAnnotation=this.$6();Kt.push(zt)}else Kt.push(this.parseMaybeAssign(!1,Ut,this.parseParenItem))}return Kt}parseSubscript(Lt,Vt,Wt,Ut,Kt,qt,zt){if(this.$u()&&!this.hasPrecedingLineBreak()){let Yt=this.startNodeAt(Vt,Wt);return this.exprAllowed=!1,this.next(),Yt.expression=Lt,this.finishNode(Yt,"TSNonNullExpression")}if(Kt&&this.$1()){let Yt=this.$g(()=>this.$2k(Vt,Wt,zt));if(Yt)return Yt}let Xt=this.type===ee.questionDot&&this.$2()===ra;if(this.$1()||Xt||this.type===ee.bitShift&&this.value==="<<"){let Yt=this.$g(()=>{if(Xt)this.next();this.$p();let Jt=this.$e();if(this.type===ee.parenL&&!Ut)return Jt;if(this.type===ee.backQuote)return Xt?void 0:Jt;if(Xt)return;if(this.$c()||this.type===ee.bitShift||this.type.startsExpr&&this.type!==ee.parenL&&!this.hasPrecedingLineBreak())return;return Jt});if(Yt){let Jt=this.startNodeAt(Vt,Wt);if(this.type===ee.parenL&&!Ut){if(this.next(),Jt.callee=Lt,Jt.arguments=this.parseExprList(ee.parenR,!0,!1),Jt.typeArguments=Yt,Xt)Lt.optional=!0;if(Xt||qt)Jt.optional=Xt;return this.finishNode(Jt,"CallExpression")}if(this.type===ee.backQuote)return Jt.tag=Lt,Jt.quasi=this.parseTemplate({isTagged:!0}),Jt.typeArguments=Yt,this.finishNode(Jt,"TaggedTemplateExpression");return Jt.expression=Lt,Jt.typeArguments=Yt,this.finishNode(Jt,"TSInstantiationExpression")}}if(Kt&&this.type===ee.parenL)this.$m=!0;return super.parseSubscript(Lt,Vt,Wt,Ut,Kt,qt,zt)}$2k(Lt,Vt,Wt){let Ut=this.startNodeAt(Lt,Vt);if(Ut.typeParameters=this.$8(),this.expect(ee.parenL),Ut.params=this.parseBindingList(ee.parenR,!1,!0),this.type===ee.colon)Ut.returnType=this.$6(!0);if(this.type!==ee.arrow||this.canInsertSemicolon())return;return this.next(),this.parseArrowExpression(Ut,Ut.params,!0,Wt)}parseDynamicImport(Lt){if(this.next(),Lt.source=this.parseMaybeAssign(),this.eat(ee.comma)&&this.type!==ee.parenR)Lt.arguments=[this.parseExpression()];return this.expect(ee.parenR),this.finishNode(Lt,"ImportExpression")}parseNew(){let Lt=super.parseNew();if(Lt.callee?.type!=="TSInstantiationExpression")return Lt;let Vt=this.startNodeAt(Lt.start,Lt.loc?.start);return Vt.callee=Lt.callee.expression,Vt.typeArguments=Lt.callee.typeArguments,Vt.arguments=Lt.arguments,this.finishNodeAt(Vt,"NewExpression",Lt.end,Lt.loc?.end)}parseExprOp(Lt,Vt,Wt,Ut,Kt){if(ee._in.binop>Ut&&this.type===ee.name&&(this.value==="as"||this.value==="satisfies")&&!this.containsEsc&&!this.hasPrecedingLineBreak()){let qt=this.value==="satisfies",zt=this.startNodeAt(Vt,Wt);return zt.expression=Lt,zt.typeAnnotation=this.$a(()=>{if(this.next(),!qt&&this.type===ee._const){let Xt=this.startNode();return Xt.typeName=this.parseIdent(!0),this.finishNode(Xt,"TSTypeReference")}return this.$0()}),this.finishNode(zt,qt?"TSSatisfiesExpression":"TSAsExpression"),this.parseExprOp(zt,Vt,Wt,Ut,Kt)}return super.parseExprOp(Lt,Vt,Wt,Ut,Kt)}parseGetterSetter(Lt){Lt.kind=Lt.key.name,super.parseGetterSetter(Lt)}parsePropertyValue(Lt,Vt,Wt,Ut,Kt,qt,zt,Xt){if(!Vt&&this.$1()){if(this.$k=this.$8(),this.type!==ee.parenL)this.unexpected();Lt.kind="init"}return super.parsePropertyValue(Lt,Vt,Wt,Ut,Kt,qt,zt,Xt)}}return Gt});function ce(){throw Error('sveast: parsing TypeScript needs `typescript` from "sveast/typescript": createParser({ typescript }) or createModuleParser({ typescript })')}var jl=/^\t+/;class e extends Error{name="ParseError";code;reason;position;start;end;frame;constructor(Z,ee,Le){super(`${Le}
17
- https://svelte.dev/e/${ee}`);this.code=ee,this.reason=Le;let Ot=typeof Z==="number"?Z:Z?.start,Bt=typeof Z==="number"?Z:Z?.end;if(Ot!==void 0)this.position=[Ot,Bt??Ot],this.start=y(this.position[0]),this.end=y(this.position[1]),this.frame=Vl(this.start.line-1,this.end.column)}}var aa=(Z)=>Z.replace(jl,(ee)=>" ".repeat(ee.length));function Vl(Z,ee){let Le=Math.max(0,Z-2),Ot=[];for(let jt=Le;jt<Z+3;jt++){let Gt=vo(jt);if(Gt===void 0)break;Ot.push(Gt)}let Bt=String(Le+Ot.length+1).length;return Ot.map((jt,Gt)=>{let Lt=`${String(Le+Gt+1).padStart(Bt," ")}: ${aa(jt)}`;if(Le+Gt!==Z)return Lt;return`${Lt}
18
- ${" ".repeat(Bt+2+aa(jt.slice(0,ee)).length)}^`}).join(`
19
- `)}function Be(Z){throw new e(Z,"attribute_duplicate","Attributes need to be unique")}function je(Z){throw new e(Z,"attribute_empty_shorthand","Attribute shorthand cannot be empty")}function Ve(Z,ee){throw new e(Z,"block_duplicate_clause",`${ee} cannot appear more than once within a block`)}function qe(Z){throw new e(Z,"block_invalid_continuation_placement","{:...} block is invalid at this position (did you forget to close the preceding element or block?)")}function Ge(Z){throw new e(Z,"block_invalid_elseif","'elseif' should be 'else if'")}function We(Z,ee,Le){throw new e(Z,"block_invalid_placement",`{#${ee} ...} block cannot be ${Le}`)}function He(Z){throw new e(Z,"block_unclosed","Block was left open")}function Ue(Z){throw new e(Z,"block_unexpected_close","Unexpected block closing tag")}function ze(Z){throw new e(Z,"const_tag_invalid_expression","{@const ...} must consist of a single variable declaration")}function Je(Z){throw new e(Z,"css_empty_declaration","Declaration cannot be empty")}function Ce(Z){throw new e(Z,"css_expected_identifier","Expected a valid CSS identifier")}function Ke(Z){throw new e(Z,"css_selector_invalid","Invalid selector")}function Xe(Z){throw new e(Z,"debug_tag_invalid_arguments","{@debug ...} arguments must be identifiers, not arbitrary expressions")}function ke(Z){throw new e(Z,"declaration_tag_invalid_type","Declaration tags must be `let` or `const` declarations")}function Ye(Z){throw new e(Z,"directive_invalid_value","Directive value must be a JavaScript expression enclosed in curly braces")}function Qe(Z,ee){throw new e(Z,"directive_missing_name",`\`${ee}\` name cannot be empty`)}function Ze(Z,ee){throw new e(Z,"element_invalid_closing_tag",`\`</${ee}>\` attempted to close an element that was not open`)}function et(Z,ee,Le){throw new e(Z,"element_invalid_closing_tag_autoclosed",`\`</${ee}>\` attempted to close element that was already automatically closed by \`<${Le}>\` (cannot nest \`<${Le}>\` inside \`<${ee}>\`)`)}function we(Z,ee){throw new e(Z,"element_unclosed",`\`<${ee}>\` was left open`)}function Pe(Z){throw new e(Z,"expected_attribute_value","Expected attribute value")}function tt(Z){throw new e(Z,"expected_block_type","Expected 'if', 'each', 'await', 'key' or 'snippet'")}function Ae(Z){throw new e(Z,"expected_identifier","Expected an identifier")}function nt(Z){throw new e(Z,"expected_pattern","Expected identifier or destructure pattern")}function rt(Z){throw new e(Z,"expected_tag","Expected 'html', 'render', 'attach', 'const', or 'debug'")}function P(Z,ee){throw new e(Z,"expected_token",`Expected token ${ee}`)}function it(Z){throw new e(Z,"expected_whitespace","Expected whitespace")}function Gl(Z,ee){throw new e(Z,"js_parse_error",`${ee}`)}function st(Z){throw new e(Z,"render_tag_invalid_expression","`{@render ...}` tags can only contain call expressions")}function ot(Z){throw new e(Z,"script_duplicate","A component can have a single top-level `<script>` element and/or a single top-level `<script module>` element")}function at(Z,ee){throw new e(Z,"script_invalid_attribute_value",`If the \`${ee}\` attribute is supplied, it must be a boolean attribute`)}function lt(Z){throw new e(Z,"script_invalid_context",'If the context attribute is supplied, its value must be "module"')}function pt(Z,ee){throw new e(Z,"script_reserved_attribute",`The \`${ee}\` attribute is reserved and cannot be used`)}function ct(Z){throw new e(Z,"style_duplicate","A component can have a single top-level `<style>` element")}function ut(Z){throw new e(Z,"svelte_component_invalid_this","Invalid component definition — must be an `{expression}`")}function dt(Z){throw new e(Z,"svelte_component_missing_this","`<svelte:component>` must have a 'this' attribute")}function De(Z){throw new e(Z,"svelte_element_missing_this","`<svelte:element>` must have a 'this' attribute with a value")}function ft(Z,ee){throw new e(Z,"svelte_meta_duplicate",`A component can only have one \`<${ee}>\` element`)}function mt(Z,ee){throw new e(Z,"svelte_meta_invalid_content",`<${ee}> cannot have children`)}function ht(Z,ee){throw new e(Z,"svelte_meta_invalid_placement",`\`<${ee}>\` tags cannot be inside elements or blocks`)}function gt(Z,ee){throw new e(Z,"svelte_meta_invalid_tag",`Valid \`<svelte:...>\` tag names are ${ee}`)}function yt(Z){throw new e(Z,"svelte_options_deprecated_tag",'"tag" option is deprecated — use "customElement" instead')}function xt(Z){throw new e(Z,"svelte_options_invalid_attribute","`<svelte:options>` can only receive static attributes")}function ue(Z,ee){throw new e(Z,"svelte_options_invalid_attribute_value",`Value must be ${ee}, if specified`)}function Et(Z){throw new e(Z,"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 vt(Z){throw new e(Z,"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 St(Z){throw new e(Z,"svelte_options_invalid_customelement_shadow",'"shadow" must be either "open", "none" or `ShadowRootInit` object.')}function Ne(Z){throw new e(Z,"svelte_options_invalid_tagname","Tag name must be lowercase and hyphenated")}function bt(Z){throw new e(Z,"svelte_options_reserved_tagname","Tag name is reserved")}function Tt(Z,ee){throw new e(Z,"svelte_options_unknown_attribute",`\`<svelte:options>\` unknown attribute '${ee}'`)}function Ct(Z){throw new e(Z,"tag_invalid_name","Expected a valid element or component name. Components must have a valid variable name or dot notation expression")}function kt(Z,ee,Le){throw new e(Z,"tag_invalid_placement",`{@${ee} ...} tag cannot be ${Le}`)}function d(Z){throw new e(Z,"unexpected_eof","Unexpected end of input")}function wt(Z,ee){throw new e(Z,"unexpected_reserved_word",`'${ee}' is a reserved word in JavaScript and cannot be used here`)}function Pt(Z){throw new e(Z,"unterminated_string_constant","Unterminated string constant")}function At(Z){throw new e(Z,"void_element_invalid_content","Void elements cannot have children or closing tags")}var ui="",la=[],ls=0,dn=[],fn=0;function Wl(Z,ee){ui=Z,la=ee,ls=0}function Ul(){return ls}function Hl(Z,ee,Le,Ot){ls=Ot}function Kl(Z,ee,Le,Ot,Bt,jt){ls=Ot;let Gt=ee;if(Z&&Gt.includes(`
20
- `)){let Vt=ui.lastIndexOf(`
21
- `,Le-1)+1,Wt=Vt,Ut=ui.charCodeAt(Wt);while(Ut===32||Ut===9)Ut=ui.charCodeAt(++Wt);if(Wt>Vt)Gt=ql(Gt,ui.slice(Vt,Wt))}let Lt={type:Z?"Block":"Line",value:Gt,start:Le,end:Ot};if(Bt&&jt)Lt.loc={start:Bt,end:jt};la.push(Lt)}function ql(Z,ee){let Le=Z.startsWith(ee)?ee.length:0,Ot="",Bt=Z.indexOf(`
22
- `,Le);while(Bt!==-1){if(Ot+=Z.slice(Le,Bt+1),Le=Bt+1,Z.startsWith(ee,Le))Le+=ee.length;Bt=Z.indexOf(`
23
- `,Le)}return Ot+Z.slice(Le)}function zl(Z,ee,Le){let Ot=0,Bt=ee.length;while(Ot<Bt){let jt=Ot+Bt>>>1;if(ee[jt].start<Le)Ot=jt+1;else Bt=jt}if(Ot>=ee.length)return;if(dn=ee.slice(Ot).map(({type:jt,value:Gt,start:Lt,end:Vt})=>({type:jt,value:Gt,start:Lt,end:Vt})),fn=0,cr(Z,void 0,!1),fn<dn.length&&(dn[fn].start>=Z.end||Z.type==="Program")){Z.trailingComments??=[];while(fn<dn.length)Z.trailingComments.push(dn[fn++])}}var Xl=new Map([["BlockStatement","body"],["Program","body"],["ArrayExpression","elements"],["ObjectExpression","properties"]]);function pa(Z,ee){for(let Le=Z;Le<ee;Le++){let Ot=ui.charCodeAt(Le);if(Ot!==44&&Ot!==41&&Ot!==32&&Ot!==9)return!0}return!1}function cr(Z,ee,Le){while(fn<dn.length&&dn[fn].start<Z.start)Z.leadingComments??=[],Z.leadingComments.push(dn[fn++]);if(fn>=dn.length)return;let Ot=dn[fn].start;if(Ot<Z.end||!pa(Z.end,Ot)){let Bt=Xn(Z),jt=Xl.get(Z.type),Gt=jt===void 0?void 0:Bt[jt],Lt=Array.isArray(Gt)&&Gt.length===0;for(let Vt in Bt){if(fn>=dn.length)return;if(Vt==="type")continue;let Wt=Bt[Vt];if(Array.isArray(Wt)){let Ut=Vt===jt;for(let Kt=0;Kt<Wt.length;Kt++){let qt=Wt[Kt];if(Ln(qt))cr(qt,Z,Ut?Kt===Wt.length-1:Lt)}}else if(Ln(Wt))cr(Wt,Z,Lt)}if(fn>=dn.length)return}if(ee!==void 0&&Z.end===ee.end)return;if(Le)while(fn<dn.length){if(ee&&dn[fn].start>=ee.end)break;Z.trailingComments??=[],Z.trailingComments.push(dn[fn++])}else if(Z.end<=dn[fn].start&&!pa(Z.end,dn[fn].start))Z.trailingComments=[dn[fn++]]}var de=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(" ")),us=!1,Ai=1,Jl=2,Yl=32,Ql=256,Zl=Ai|Jl|Ql,eu=2,tu=3,nu=4,iu=/\r\n?|\n|\u2028|\u2029/,ca=new Map;function cs(Z){if(!(Z instanceof RegExp))return Z;let ee=ca.get(Z);if(!ee){let Le=new Set(Z.source.slice(4,-2).split("|"));ee={test:(Ot)=>Le.has(Ot)},ca.set(Z,ee)}return ee}var lr=wi((Z)=>class extends Z{declareName(ee,Le,Ot){let Bt=!1;if(Le===eu){let jt=this.currentScope();if(Bt=En(jt.lexical,ee)||En(jt.functions,ee)||En(jt.var,ee),jt.lexical.push(ee),this.inModule&&jt.flags&Ai)delete this.undefinedExports[ee]}else if(Le===nu)this.currentScope().lexical.push(ee);else if(Le===tu){let jt=this.currentScope();Bt=this.treatFunctionsAsVar?En(jt.lexical,ee):En(jt.lexical,ee)||En(jt.var,ee),jt.functions.push(ee)}else for(let jt=this.scopeStack.length-1;jt>=0;--jt){let Gt=this.scopeStack[jt];if(En(Gt.lexical,ee)&&!(Gt.flags&Yl&&Gt.lexical[0]===ee)||!this.treatFunctionsAsVarInScope(Gt)&&En(Gt.functions,ee)){Bt=!0;break}if(Gt.var.push(ee),this.inModule&&Gt.flags&Ai)delete this.undefinedExports[ee];if(Gt.flags&Zl)break}if(Bt)this.raiseRecoverable(Ot,`Identifier '${ee}' has already been declared`)}}),ur=wi((Z)=>{let{keywordTypes:ee,tokTypes:Le}=Z.acorn,Ot=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((jt)=>[jt,ee[jt]])),Bt;return class extends Z{constructor(jt,Gt,Lt){super(jt,Gt,Lt);this.keywords=cs(this.keywords),this.reservedWords=cs(this.reservedWords),this.reservedWordsStrict=cs(this.reservedWordsStrict),this.reservedWordsStrictBind=cs(this.reservedWordsStrictBind),Bt??=this.context[0]}reset(jt,Gt,Lt){if(super.reset?.(jt,Gt,Lt),this.input=jt,this.containsEsc=!1,this.pos=Gt,Lt)this.lineStart=Gt-Lt.column,this.curLine=Lt.line;else this.lineStart=jt.lastIndexOf(`
24
- `,Gt-1)+1,this.curLine=this.options.locations?jt.slice(0,this.lineStart).split(iu).length:1;this.type=Le.eof,this.value=null,this.start=this.end=Gt,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=Gt;let Vt=this.context;if(Vt.length!==1||Vt[0]!==Bt)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 Kt in this.undefinedExports){this.undefinedExports=Object.create(null);break}let Wt=this.scopeStack,Ut=Wt[0];if(Wt.length!==1||Ut.flags!==Ai||Ut.var.length>0||Ut.lexical.length>0||Ut.functions.length>0||Ut.tsTypes!==void 0||Ut.tsExportOnly!==void 0||Ut.tsEnums!==void 0)this.scopeStack=[],this.enterScope(Ai);if(this.regexpState=null,this.privateNameStack.length>0)this.privateNameStack=[];this.inTemplateElement=!1}parseParenAndDistinguishExpression(jt,Gt){let Lt=super.parseParenAndDistinguishExpression(jt,Gt);if(Lt.type==="ParenthesizedExpression")us=!0;return Lt}checkUnreserved(jt){if(de.has(jt.name))super.checkUnreserved(jt)}canInsertSemicolon(){let jt=this.type;return jt===Le.eof||jt===Le.braceR||Ti(this.input,this.lastTokEnd,this.start)}checkLocalExport(){}skipSpace(){let jt=this.input,Gt=this.options.locations,Lt=this.pos,Vt=jt.charCodeAt(Lt);for(;;)if(Vt===32||Vt===9)Vt=jt.charCodeAt(++Lt);else if(Vt===10){if(Vt=jt.charCodeAt(++Lt),Gt)this.curLine++,this.lineStart=Lt}else break;if(this.pos=Lt,Vt===47||Vt<33||Vt>=128)super.skipSpace()}readWord1(){let jt=this.input,Gt=this.pos,Lt=Gt,Vt=jt.charCodeAt(Lt),Wt=0;while(Vt>=97&&Vt<=122||Vt>=65&&Vt<=90||Vt>=48&&Vt<=57||Vt===95||Vt===36)Wt=Math.imul(Wt,31)+Vt|0,Vt=jt.charCodeAt(++Lt);if(Vt>=128||Vt===92)return super.readWord1();return this.containsEsc=!1,this.pos=Lt,go(jt,Gt,Lt,Wt)}readWord(){let jt=this.readWord1();return this.finishToken(Ot.get(jt)??Le.name,jt)}}}),ua=os(lr,ur),su=/ \(\d+:\d+\)$/;function Pi(Z){return Z}function ha(Z){return Z instanceof SyntaxError&&"pos"in Z&&typeof Z.pos==="number"}function hr(Z,ee,Le,Ot,Bt,jt=Z.root.comments.length){let Gt=Z.root.comments;Wl(ee,Gt);let Lt={onComment:Z.comments?Kl:Hl,sourceType:"module",ecmaVersion:16,locations:Z.loc,preserveParens:Ot};if(Z.lfOnly)Lt.startLocation=y(Le);let Vt=Z.isTypeScript?Z.typescript:ua;if(!Vt)ce();let Wt;try{Wt=Bt(Vt,Lt)}catch(Ut){if(!ha(Ut))throw Ut;Gl(Ut.pos,Ut.message.replace(su,""))}if(Gt.length>jt)zl(Pi(Wt),Gt,Le);return Wt}function fe(Z,ee,Le=0){return Pi(hr(Z,ee,0,!1,(Ot,Bt)=>{if(Le>0&&Bt.locations)Bt.startLocation=y(Le);let jt=new Ot(Bt,ee,Le).parse();return jt.start=0,jt},0))}function ru(Z,ee){if(!ee)return{line:1,column:0};let{column:Le}=y(Z);return{line:xo(Z-Le)+1,column:Le}}var ou={count:0},pr,au=(Z)=>Z.parseExpression();function pu(Z,ee,Le,Ot,Bt){let jt=pr;if(pr=void 0,jt?.ParserClass===Z&&jt.onComment===ee.onComment&&jt.locations===ee.locations&&jt.parser.reset)jt.parser.reset(Le,Ot,ee.startLocation);else jt={ParserClass:Z,onComment:ee.onComment,locations:ee.locations,parser:new Z(ee,Le,Ot)};let Gt=jt.parser;Gt.nextToken();let Lt=Bt(Gt);return Gt.input="",pr=jt,Lt}function da(Z,ee,Le,Ot){return ou.count+=1,us=!1,hr(Z,ee,Le,!0,(Bt,jt)=>(jt.startLocation??=ru(Le,jt.locations),pu(Bt,jt,ee,Le,Ot)))}function M(Z,ee,Le,Ot=!1){let Bt=Pi(da(Z,ee,Le,au)),jt=Math.max(Bt.end,Ul());return{node:us&&!Ot?dr(Bt):Bt,end:jt}}function Dt(Z,ee,Le){let Ot=Z.root.comments.length,Bt=!0,jt=da(Z,ee,Le,(Lt)=>{let Vt={shorthandAssign:-1,trailingComma:-1,parenthesizedAssign:-1,parenthesizedBind:-1,doubleProto:-1},Wt=Lt.parseMaybeConditional(void 0,Vt);if(Lt.type!==ua.acorn.tokTypes.eof)return Bt=!1,Wt;let Ut=Lt.toAssignable(Wt,!1,Vt);return Lt.checkLValPattern(Ut),Ut});if(!Bt){Z.root.comments.length=Ot;return}let Gt=Pi(jt);return us?dr(Gt):Gt}function Nt(Z,ee,Le){return Pi(hr(Z,ee,Le,!1,(Ot,Bt)=>{let jt=new Ot(Bt,ee,Le);try{return jt.nextToken(),jt.parseStatement(null,!0,Object.create(null))}catch(Gt){if(ha(Gt)&&Gt.pos===ee.length)d(ee.length);throw Gt}}))}function dr(Z){let ee=Z;while(ee.type==="ParenthesizedExpression")ee=ee.expression;return W(ee,dr),ee}var F=os(lr,pe,ur);function fa(Z,ee,Le){return te(Z),fe({isTypeScript:ee.typescript??!1,typescript:Le,loc:ee.loc??!1,comments:ee.comments??!0,root:{comments:[]}},Z)}function me(Z,ee={}){return fa(Z,ee,F)}function he(Z,ee){let Le=u(Z.name,ee.name);if(Le!==0)return Le;let Ot=u(Z.type,ee.type);if(Ot!==0)return Ot;if(Z.type==="forwarded"&&ee.type==="forwarded"){let Bt=u(Z.element,ee.element);if(Bt!==0)return Bt}return u(Z.detail??"",ee.detail??"")}function cu(Z,ee){let Le=Z.length+1,Ot=ee.length+1,Bt=Array.from({length:Le},()=>Array(Ot).fill(0));for(let jt=0;jt<Le;jt++)Bt[jt][0]=jt;for(let jt=0;jt<Ot;jt++)Bt[0][jt]=jt;for(let jt=1;jt<Le;jt++)for(let Gt=1;Gt<Ot;Gt++){let Lt=Z[jt-1]===ee[Gt-1]?0:1;if(Bt[jt][Gt]=Math.min(Bt[jt-1][Gt]+1,Bt[jt][Gt-1]+1,Bt[jt-1][Gt-1]+Lt),jt>1&&Gt>1&&Z[jt-1]===ee[Gt-2]&&Z[jt-2]===ee[Gt-1])Bt[jt][Gt]=Math.min(Bt[jt][Gt],Bt[jt-2][Gt-2]+1)}return Bt[Le-1][Ot-1]}function _(Z,ee,Le=3){let Ot,Bt=Number.POSITIVE_INFINITY;for(let jt of ee){let Gt=cu(Z,jt);if(Gt<Bt)Ot=jt,Bt=Gt}return Bt<=Le?Ot:void 0}import{readFile as hu}from"node:fs/promises";import gr from"node:path";import ma,{sep as fr}from"node:path";var Pn=/\.svelte$/,hi=[".ts",".mts",".cts",".tsx",".js",".mjs",".cjs",".jsx",".d.ts"],ga=/\.(?:svelte|[mc]?ts|[mc]?js|tsx|jsx)$/;function di(Z){if(!Z.endsWith(".svelte"))return!1;let ee=Z.length-7;if(ee===0)return!1;let Le=Z.charCodeAt(ee-1);return Le!==47&&(fr==="/"||Le!==92)}function n(Z){return fr==="/"?Z:Z.split(fr).join("/")}function ya(Z,ee){return n(ma.join(ee,ma.normalize(Z)))}function _i(Z){return`${JSON.stringify(Z,null,2)}
25
- `}var xa="sveld",hs="0.40.1";var _t={name:xa,version:hs,license:"Apache-2.0",description:"Generate TypeScript definitions and component documentation for your Svelte components.",type:"module",main:"./dist/index.js",types:"./dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",default:"./dist/index.js"},"./browser":{types:"./dist/browser.d.ts",import:"./dist/browser.js",default:"./dist/browser.js"},"./schema/component-api.schema.json":"./schema/component-api.schema.json"},scripts:{test:"bun test --parallel","test:changed":"bivium run --suite unit","test:update":"SVELD_UPDATE_FIXTURES=1 bun test tests/fixtures.test.ts","test:fixtures-types":"bun check --project tsconfig.fixtures.json","test:types-matrix":"bun scripts/typecheck-option-matrix.ts","test:svelte-versions":"bun scripts/typecheck-svelte-versions.ts","test:e2e":"bun tests/test-e2e.ts","test:inferred-types":"bun scripts/check-inferred-types.ts",format:"biome format --write .",lint:"biome check --error-on-warnings .","lint:fix":"biome check --write --unsafe .","lint:fix:changed":"biome check --write --unsafe --changed --no-errors-on-unmatched",knip:"knip-bun",build:"bun scripts/build.ts",bench:"bun scripts/bench.ts","bench:cache":"bun scripts/bench.ts --cache","bench:ostia":"ostia bench scripts/bench-ostia.ts",typecheck:"bun check && bun check --project tsconfig.excluded.json"},devDependencies:{"@biomejs/biome":"2.6.3","@types/bun":"^1.4.4","@types/jest":"^30.0.0","@typescript/typescript6":"^6.0.2",ajv:"^8.20.0",bivium:"^0.3.1",knip:"^6.43.0",ostia:"^0.2.11",sveast:"^0.9.6",svelte:"^5.57.2",typescript:"^7.0.2"},bin:{sveld:"dist/cli.js"},repository:{type:"git",url:"git+https://github.com/carbon-design-system/sveld.git"},homepage:"https://github.com/carbon-design-system/sveld",bugs:"https://github.com/carbon-design-system/sveld/issues",keywords:["svelte","svelte component","documentation","docgen","typescript","definitions","JSDocs","vite","vite-plugin"],maintainers:["Eric Liu (https://github.com/metonym)"]};var $i="5.57.2";var ds=1;function Wn(Z){return Z.some((ee)=>ee.internal)?Z.filter((ee)=>!ee.internal):Z}function uu(Z){return{...Z,props:Wn(Z.props),moduleExports:Wn(Z.moduleExports),slots:Wn(Z.slots),events:Wn(Z.events),typedefs:Wn(Z.typedefs),...Z.contexts?{contexts:Wn(Z.contexts).map((ee)=>({...ee,properties:Wn(ee.properties)}))}:{}}}function g(Z,ee={}){let Le=Array.from(Z.values(),(jt)=>{let{diagnostics:Gt,...Lt}=jt;return uu(Lt)}).sort((jt,Gt)=>u(jt.moduleName,Gt.moduleName)),Ot={schemaVersion:ds,generator:{name:xa,version:hs,svelteVersion:$i},total:Le.length,components:Le},Bt=ee.entryExports?Wn(ee.entryExports):void 0;if(Bt&&Bt.length>0)Ot.totalExports=Bt.length,Ot.exports=Bt;return Ot}var du=/[:=]/,va=/^HTML\w+Element$|^HTMLElementTagNameMap\[[\w$]+\]$/,Ea=/^SVG\w+Element$/,yr="COMPONENT_API.json",fs={none:0,patch:1,minor:2,major:3};function fu(Z,ee){return fs[ee]>fs[Z]?ee:Z}function mu(Z){return Z.reduce((ee,Le)=>fu(ee,Le.bump),"none")}function Aa(Z,ee){return fs[Z]>=fs[ee]}function Sa(Z){return new Set(i(Z,"|").map((ee)=>ee.trim()).filter((ee)=>ee.length>0))}function gu(Z,ee){if(Z===ee)return!1;if(ee==="HTMLElement")return va.test(Z);if(ee==="SVGElement")return Ea.test(Z);if(ee==="Element")return Z==="HTMLElement"||Z==="SVGElement"||Z==="MathMLElement"||va.test(Z)||Ea.test(Z);return!1}function Ca(Z,ee){for(let Le of ee)if(gu(Z,Le))return!0;return!1}function ba(Z){let ee=k(Z);if(ee===-1)return;let Le=Z.slice(0,ee).trim(),Ot=Z.slice(ee+2).trim();if(!Le.startsWith("(")||!Le.endsWith(")"))return;let Bt=Le.slice(1,-1).trim();return{params:Bt.length===0?[]:i(Bt,",").map((Gt)=>Gt.trim()),returnType:Ot}}function yu(Z){return(Z.split(du,1)[0]??"").trimEnd().endsWith("?")}function xu(Z,ee){if(Z.returnType!==ee.returnType)return"major";if(ee.params.length<Z.params.length)return"major";for(let Ot=0;Ot<Z.params.length;Ot++)if(Z.params[Ot]!==ee.params[Ot])return"major";if(ee.params.length===Z.params.length)return"none";return ee.params.slice(Z.params.length).every(yu)?"minor":"major"}function Ni(Z,ee){if(Z===ee)return"none";if(Z===void 0||ee===void 0)return"major";let Le=ba(Z),Ot=ba(ee);if(Le&&Ot)return xu(Le,Ot);let Bt=Sa(Z),jt=Sa(ee),Gt=[...jt].some((Vt)=>!Bt.has(Vt)&&!Ca(Vt,Bt));if(![...Bt].some((Vt)=>!jt.has(Vt)&&!Ca(Vt,jt)))return Gt?"minor":"none";return"major"}function wa(Z){return Z.bindable===!0||Z.binding==="writable"}function fi(Z,ee,Le){let Ot=new Map(Z.map((Vt)=>[Le(Vt),Vt])),Bt=new Map(ee.map((Vt)=>[Le(Vt),Vt])),jt=[...Bt].filter(([Vt])=>!Ot.has(Vt)),Gt=[...Ot.keys()].filter((Vt)=>!Bt.has(Vt)),Lt=[];for(let[Vt,Wt]of Ot){let Ut=Bt.get(Vt);if(Ut)Lt.push([Vt,Wt,Ut])}return{added:jt,removed:Gt,common:Lt}}function xr(Z,ee,Le,Ot){return(Bt,jt,Gt)=>Z.push({component:ee,kind:Le,name:Bt,bump:jt,message:`${Ot} "${Bt}" ${Gt}`})}function Ta(Z,ee,Le,Ot){let Bt=[],jt=xr(Bt,Z,ee,ee==="prop"?"prop":"export"),{added:Gt,removed:Lt,common:Vt}=fi(Le,Ot,(Wt)=>Wt.name);for(let[Wt,Ut]of Gt)jt(Wt,Ut.isRequired?"major":"minor",`added${Ut.isRequired?" (required)":""}`);for(let Wt of Lt)jt(Wt,"major","removed");for(let[Wt,Ut,Kt]of Vt){if(Ut.isRequired!==Kt.isRequired)jt(Wt,Kt.isRequired?"major":"minor",`became ${Kt.isRequired?"required":"optional"}`);let qt=Ni(Ut.type,Kt.type);if(qt!=="none")jt(Wt,qt,`type changed from \`${Ut.type??"unknown"}\` to \`${Kt.type??"unknown"}\``);let zt=wa(Kt);if(wa(Ut)!==zt)jt(Wt,zt?"minor":"major",zt?"gained a writable binding":"lost its writable binding");if(Ut.value!==Kt.value&&qt==="none")jt(Wt,"patch",`default changed from \`${Ut.value??"none"}\` to \`${Kt.value??"none"}\``);let Xt=Kt.deprecated!==void 0;if(Ut.deprecated!==void 0!==Xt)jt(Wt,Xt?"minor":"patch",Xt?"marked as deprecated":"no longer deprecated");if(Ut.constant!==Kt.constant)jt(Wt,"minor",Kt.constant?"became constant":"became mutable");if(Ut.reactive!==Kt.reactive)jt(Wt,"minor",Kt.reactive?"became reactive":"stopped being reactive")}return Bt}function vu(Z,ee,Le){let Ot=[],Bt=xr(Ot,Z,"event","event"),{added:jt,removed:Gt,common:Lt}=fi(ee,Le,(Vt)=>Vt.name);for(let[Vt]of jt)Bt(Vt,"minor","added");for(let Vt of Gt)Bt(Vt,"major","removed");for(let[Vt,Wt,Ut]of Lt){if(Wt.type!==Ut.type){Bt(Vt,"major",`changed from ${Wt.type} to ${Ut.type}`);continue}let Kt=Wt.type==="dispatched"?Wt.detail:void 0,qt=Ut.type==="dispatched"?Ut.detail:void 0,zt=Ni(Kt,qt);if(zt!=="none")Bt(Vt,zt,`detail changed from \`${Kt??"unknown"}\` to \`${qt??"unknown"}\``)}return Ot}function Eu(Z,ee,Le){let Ot=[],Bt=xr(Ot,Z,"slot","slot"),{added:jt,removed:Gt,common:Lt}=fi(ee,Le,(Vt)=>Vt.name??"default");for(let[Vt]of jt)Bt(Vt,"minor","added");for(let Vt of Gt)Bt(Vt,"major","removed");for(let[Vt,Wt,Ut]of Lt){let Kt=Ni(Wt.slot_props,Ut.slot_props);if(Kt!=="none")Bt(Vt,Kt,`props changed from \`${Wt.slot_props??"none"}\` to \`${Ut.slot_props??"none"}\``)}return Ot}function ka(Z){return Z.type===void 0?"an object of properties":`\`${Z.type}\``}function Su(Z,ee=[],Le=[]){let Ot=[],{added:Bt,removed:jt,common:Gt}=fi(ee,Le,(Lt)=>Lt.key);for(let[Lt]of Bt)Ot.push({component:Z,kind:"context",name:Lt,bump:"minor",message:`context "${Lt}" added`});for(let Lt of jt)Ot.push({component:Z,kind:"context",name:Lt,bump:"major",message:`context "${Lt}" removed`});for(let[Lt,Vt,Wt]of Gt){let Ut=(qt,zt,Xt)=>Ot.push({component:Z,kind:"context",name:Lt,...Xt===void 0?{}:{property:Xt},bump:qt,message:`context "${Lt}" ${Xt===void 0?"":`property "${Xt}" `}${zt}`});if(Vt.typeName!==Wt.typeName)Ut("major",`type name changed from \`${Vt.typeName}\` to \`${Wt.typeName}\``);if(Boolean(Vt.hasUnresolvedSpread)!==Boolean(Wt.hasUnresolvedSpread))Ut("major",`${Wt.hasUnresolvedSpread?"gained":"lost"} an unresolved spread`);if(Vt.type!==void 0||Wt.type!==void 0){if(Vt.type!==Wt.type){let qt=Vt.type!==void 0&&Wt.type!==void 0?Ni(Vt.type,Wt.type):"major";Ut(qt,`type changed from ${ka(Vt)} to ${ka(Wt)}`)}continue}let Kt=fi(Vt.properties,Wt.properties,(qt)=>qt.name);for(let[qt]of Kt.added)Ut("minor","added",qt);for(let qt of Kt.removed)Ut("major","removed",qt);for(let[qt,zt,Xt]of Kt.common){if(zt.optional!==Xt.optional)Ut(Xt.optional?"major":"minor",`became ${Xt.optional?"optional":"required"}`,qt);let Yt=Ni(zt.type,Xt.type);if(Yt!=="none")Ut(Yt,`type changed from \`${zt.type}\` to \`${Xt.type}\``,qt)}}return Ot}var Cu=new Set(["description","source","componentCommentSource","tags"]);function ms(Z){if(Array.isArray(Z))return Z.map(ms);if(r(Z)){let ee={};for(let[Le,Ot]of Object.entries(Z)){if(Cu.has(Le))continue;ee[Le]=ms(Ot)}return ee}return Z}var bu=["generics","rest_props","extends","typedefs"];function wu(Z,ee,Le){let Ot=[];for(let Bt of bu){let jt=JSON.stringify(ms(ee[Bt])),Gt=JSON.stringify(ms(Le[Bt]));if(jt!==Gt)Ot.push({component:Z,kind:"shape",name:Bt,bump:"major",message:`"${Bt}" changed (breaking)`})}return Ot}function Tu(Z,ee){let Le=ee.moduleName;return[...Ta(Le,"prop",Z.props,ee.props),...Ta(Le,"moduleExport",Z.moduleExports,ee.moduleExports),...vu(Le,Z.events,ee.events),...Eu(Le,Z.slots,ee.slots),...Su(Le,Z.contexts,ee.contexts),...wu(Le,Z,ee)]}function Rt(Z,ee){let Le=[],{added:Ot,removed:Bt,common:jt}=fi(Z.components,ee.components,(Gt)=>Gt.moduleName);for(let[Gt]of Ot)Le.push({component:Gt,kind:"component",bump:"minor",message:`component "${Gt}" added`});for(let Gt of Bt)Le.push({component:Gt,kind:"component",bump:"major",message:`component "${Gt}" removed`});for(let[,Gt,Lt]of jt)Le.push(...Tu(Gt,Lt));return Le}async function ku(Z){let ee;try{ee=await hu(gr.resolve(Z),"utf-8")}catch(Le){if(Le.code==="ENOENT")return null;throw Le}try{return JSON.parse(ee)}catch{throw Error(`sveld: could not parse "${Z}" as JSON. Is it a sveld COMPONENT_API.json snapshot?`)}}function Pa(Z){if(typeof Z.check==="string")return Z.check;return Z.jsonOptions?.outFile??yr}function _a(Z,ee){if(!Z.json||Z.stdout||Z.jsonOptions?.outDir)return!1;return gr.resolve(Z.jsonOptions?.outFile??yr)===gr.resolve(ee)}async function _e(Z,ee,Le={}){let Ot=await ku(ee);if(Ot===null)return{snapshotExists:!1,snapshotFile:ee,changes:[],bump:"none"};if(Ot.schemaVersion!==ds)return{snapshotExists:!0,snapshotFile:ee,changes:[{component:"*",kind:"schema",bump:"none",message:`snapshot schemaVersion ${Ot.schemaVersion} differs from ${ds}; regenerate the snapshot`}],bump:"none"};let Bt=g(Z,{entryExports:Le.entryExports}),jt=Rt(Ot,Bt);return{snapshotExists:!0,snapshotFile:ee,changes:jt,bump:mu(jt)}}var Au={major:"BREAKING",minor:"additive",patch:"patch",none:"no change"};function ge(Z){if(!Z.snapshotExists){let Bt=Z.snapshotFile===yr?"`sveld --json`":`\`sveld --json\` with \`jsonOptions.outFile: "${Z.snapshotFile}"\``;return`sveld --check: no snapshot found at "${Z.snapshotFile}". Generate it with ${Bt} and commit it.`}if(Z.changes.length===0)return`sveld --check: no API changes detected against "${Z.snapshotFile}".`;let ee=Z.changes.length,Le=[`sveld --check: ${ee} API change${ee===1?"":"s"} detected against "${Z.snapshotFile}".`,`Suggested semver bump: ${Z.bump}.`],Ot=new Map;for(let Bt of Z.changes){let jt=Ot.get(Bt.component)??[];jt.push(Bt),Ot.set(Bt.component,jt)}for(let[Bt,jt]of Ot){Le.push("",` ${Bt}`);for(let Gt of jt){let Lt=Gt.kind==="schema"?"schema":Au[Gt.bump];Le.push(` [${Lt}] ${Gt.message}`)}}return Le.join(`
26
- `)}var $t=1;function ye(Z){let ee={kind:"check-report",schemaVersion:$t,...Z};return _i(ee)}import{existsSync as Da}from"node:fs";import{join as Pu,resolve as _u}from"node:path";import{pathToFileURL as $u}from"node:url";var Nu=["sveld.config.js","sveld.config.mjs","sveld.config.ts"];function Mt(Z){return Z}function Du(Z=process.cwd()){for(let ee of Nu){let Le=Pu(Z,ee);if(Da(Le))return Le}return null}async function Ra(Z){let ee;try{ee=await import(`${$u(Z).href}?t=${Date.now()}`)}catch(Ot){let Bt=Ot instanceof Error?Ot.message:String(Ot);throw Error(`sveld: failed to load config file "${Z}".
27
- ${Bt}`)}let Le=ee.default;if(!r(Le)||Array.isArray(Le))throw Error(`sveld: config file "${Z}" must export a configuration object as its default export. Did you forget \`export default defineConfig({ ... })\`?`);return Le}async function Ru(Z=process.cwd()){let ee=Du(Z);return ee===null?{}:Ra(ee)}async function B(Z,ee,Le){if(typeof Z==="string"){let Ot=_u(ee,Z);if(!Da(Ot))throw Error(`sveld: config file "${Z}" does not exist.`);return Ra(Ot)}return Z??Le?Ru(ee):{}}function R(...Z){let ee={};for(let Le of Z){if(!Le)continue;for(let[Ot,Bt]of Object.entries(Le)){let jt=ee[Ot];ee[Ot]=r(jt)&&!Array.isArray(jt)&&r(Bt)&&!Array.isArray(Bt)?{...jt,...Bt}:Bt}}return ee}var $a=["entry","glob","quiet","documentExports","types","typesOptions","json","jsonOptions","markdown","markdownOptions","failFast","watch","config","cache","checkExamples","reportDiagnostics","strict","check","checkLevel","stdout","format","diagnostics"],Iu={typesOptions:["outDir","preamble","format","transform","indexTypes"],jsonOptions:["outFile","outDir","source"],markdownOptions:["outFile","outDir","onAppend"],diagnostics:["ignore"]};function Na(Z,ee,Le){let Ot=Z===null?ee:`${Z}.${ee}`,Bt=_(ee,Le),jt=Bt===void 0?void 0:Z===null?Bt:`${Z}.${Bt}`;console.warn(`sveld: unknown option "${Ot}".${jt?` Did you mean "${jt}"?`:""}`)}function j(Z){for(let ee of Object.keys(Z))if(!$a.includes(ee))Na(null,ee,$a);for(let[ee,Le]of Object.entries(Iu)){let Ot=Z[ee];if(!r(Ot))continue;for(let Bt of Object.keys(Ot))if(!Le.includes(Bt))Na(ee,Bt,Le)}}import{dirname as kc}from"node:path";import{lstatSync as Df}from"node:fs";import{readFile as Rf}from"node:fs/promises";import{resolve as Yp}from"node:path";import{dirname as Kh}from"node:path";var Ou=" ",Lu=120,Mu=/\binterface\s+[A-Za-z_$][\w$]*(\s*<[^{};]*>)?\s*$/,Fu=200,Ma=/\s/,Bu=/\s{2}|[^\S ]/,ju=/["'`{}/]/g,Vu=/["'`{};/]/g,Fa=9,vr=10,Gu=13,Di=32,ys=34,Wu=38,xs=39,Uu=40,Hu=41,gs=42,Ia=46,Sr=47,Ba=59,Ku=62,qu=91,Cr=92,zu=93,vs=96,br=123,Xu=124,wr=125;function Ju(Z){return Mu.test(Qu(Z,Fu))}var Oa=[""];function Yu(Z){let ee=Oa[Z];if(ee===void 0)ee=Ou.repeat(Z),Oa[Z]=ee;return ee}function Qu(Z,ee){let Le="";for(let Ot=Z.length-1;Ot>=0&&Le.length<ee;Ot--)Le=Z[Ot]+Le;return Le.length>ee?Le.slice(-ee):Le}function Zu(Z){if(Z.length===0)return!1;let ee=Z[Z.length-1];return ee.charCodeAt(ee.length-1)===vr}function eh(Z){while(Z.length>0){let ee=Z[Z.length-1],Le=ee.length;while(Le>0){let Ot=ee.charCodeAt(Le-1);if(Ot!==Di&&Ot!==Fa)break;Le--}if(Le===ee.length)return;if(Le===0){Z.pop();continue}Z[Z.length-1]=ee.slice(0,Le);return}}function th(Z){while(Z.length>0){let ee=Z[Z.length-1];if(!Ma.test(ee[ee.length-1]))return;let Le=ee.trimEnd();if(Le.length===ee.length)return;if(Le.length===0){Z.pop();continue}Z[Z.length-1]=Le;return}}function nh(Z){if(Z.includes("{"))return!1;let ee=0,Le=0;for(let Ot=0;Ot<Z.length;Ot++){let Bt=Z.charCodeAt(Ot);if(ee!==0){if(Bt===ee&&Z.charCodeAt(Ot-1)!==Cr)ee=0;continue}if(Bt===ys||Bt===xs||Bt===vs){ee=Bt;continue}if(Bt===Ba&&++Le>=2)return!0}return!1}function ih(Z){if(!Bu.test(Z))return Z.trimEnd();let ee="",Le=null,Ot=!1;for(let Bt=0;Bt<Z.length;Bt++){let jt=Z[Bt],Gt=Z[Bt-1];if(Le){if(ee+=jt,Le==="double"&&jt==='"'&&Gt!=="\\"||Le==="single"&&jt==="'"&&Gt!=="\\"||Le==="template"&&jt==="`"&&Gt!=="\\")Le=null;Ot=!1;continue}if(jt==='"'||jt==="'"||jt==="`"){Le=jt==='"'?"double":jt==="'"?"single":"template",ee+=jt,Ot=!1;continue}if(Ma.test(jt)){if(!Ot&&ee.length>0)ee+=" ",Ot=!0;continue}ee+=jt,Ot=!1}return ee.trimEnd()}function ja(Z,ee){let Le=Z[ee],Ot=Z.indexOf(Le,ee+1);while(Ot!==-1&&Z.charCodeAt(Ot-1)===Cr)Ot=Z.indexOf(Le,Ot+1);return Ot}function Va(Z,ee){let Le=Z.indexOf("*/",ee+1);return Le===-1?-1:Le+1}function sh(Z){let ee=new Map,Le=[],Ot=ju,Bt=0;while(Bt<Z.length){if(Ot.lastIndex=Bt,!Ot.test(Z))break;Bt=Ot.lastIndex-1;let jt=Z.charCodeAt(Bt);if(jt===Sr){if(Z.charCodeAt(Bt+1)===gs){let Gt=Va(Z,Bt);if(Gt===-1)break;Bt=Gt}}else if(jt===ys||jt===xs||jt===vs){let Gt=ja(Z,Bt);if(Gt===-1)break;Bt=Gt}else if(jt===br)Le.push(Bt);else if(jt===wr&&Le.length>0)ee.set(Le.pop(),Bt);Bt++}return ee}function rh(Z,ee,Le){for(let Ot=ee;Ot<Le;Ot++)if(!Er(Z.charCodeAt(Ot)))return!1;return!0}function Er(Z){if(Z<=Di)return Z===Di||Z>=Fa&&Z<=Gu;if(Z<160)return!1;return Z===160||Z===5760||Z>=8192&&Z<=8202||Z===8232||Z===8233||Z===8239||Z===8287||Z===12288||Z===65279}function Ga(Z,ee,Le,Ot){let Bt=[],jt=Vu,Gt=ee,Lt=ee;while(Lt<Le){if(jt.lastIndex=Lt,!jt.test(Z))break;if(Lt=jt.lastIndex-1,Lt>=Le)break;let Vt=Z.charCodeAt(Lt);if(Vt===Sr){if(Z.charCodeAt(Lt+1)===gs){let Wt=Va(Z,Lt);if(Wt===-1)break;Lt=Wt}Lt++;continue}if(Vt===ys||Vt===xs||Vt===vs){let Wt=ja(Z,Lt);if(Wt===-1)break;Lt=Wt+1;continue}if(Vt===br){let Wt=Ot.get(Lt);if(Wt===void 0||Wt>=Le){Lt++;continue}if(Gt<Lt)Bt.push(Z.slice(Gt,Lt));let Ut=Lt+1;if(rh(Z,Ut,Wt)){Bt.push("{}"),Lt=Wt+1,Gt=Lt;continue}let Kt=Z.slice(Ut,Wt),qt=Z.charCodeAt(Ut)===vr;if(!qt&&!Kt.includes("/*")&&!nh(Kt)&&!Ju(Bt)){let zt=Ga(Z,Ut,Wt,Ot),Xt=zt.trim();if(!Xt.includes(`
28
- `)){let Yt=Xt.endsWith(";")?Xt.slice(0,-1):Xt,Jt=`{ ${ih(Yt)} }`;if(Jt.length<=Lu){Bt.push(Jt),Lt=Wt+1,Gt=Lt;continue}}if(Bt.push("{"),zt.charCodeAt(0)!==Ba)Bt.push(`
29
- `);if(zt.length>0)Bt.push(zt);Lt=Wt,Gt=Wt;continue}if(Bt.push("{"),!qt)Bt.push(`
30
- `);Lt=Ut,Gt=Ut;continue}if(Vt===wr){if(Gt<Lt)Bt.push(Z.slice(Gt,Lt));if(eh(Bt),!Zu(Bt))Bt.push(`
31
- `);Bt.push("}"),Lt++,Gt=Lt;continue}if(Gt<Lt)Bt.push(Z.slice(Gt,Lt));if(th(Bt),Bt.push(";"),Z.charCodeAt(Lt+1)!==vr)Bt.push(`
32
- `);Lt++,Gt=Lt}if(Gt<Le)Bt.push(Z.slice(Gt,Le));return Bt.join("")}function oh(Z){if(!Z.includes(" "))return Z;let ee="",Le=0;for(let Ot=0;Ot<Z.length;Ot++){let Bt=Z.charCodeAt(Ot);if(Le!==0){if(ee+=Z[Ot],Bt===Le&&Z.charCodeAt(Ot-1)!==Cr)Le=0;continue}if(Bt===ys||Bt===xs||Bt===vs){Le=Bt,ee+=Z[Ot];continue}if(Bt===Di&&ee.charCodeAt(ee.length-1)===Di)continue;ee+=Z[Ot]}return ee}function ah(Z){return Z===wr||Z===zu||Z===Hu||Z===Ku}function ph(Z,ee,Le){return Le-ee>=3&&Z.charCodeAt(ee)===Sr&&Z.charCodeAt(ee+1)===gs&&Z.charCodeAt(ee+2)===gs}function La(Z,ee,Le){let Ot=Z.indexOf("*/",ee);return Ot!==-1&&Ot+2<=Le}function ch(Z,ee,Le){let Ot=Z.charCodeAt(ee);if(Ot===Xu||Ot===Wu)return!0;return Ot===Ia&&ee+1<Le&&Z.charCodeAt(ee+1)!==Ia}function lh(Z){let ee=[],Le=[],Ot=Z.length,Bt=0,jt=!1,Gt=0,Lt=0;while(Lt<=Ot){let Ut=Z.indexOf(`
33
- `,Lt);if(Ut===-1)Ut=Ot;let Kt=Ut+1,qt=Lt,zt=Ut;while(qt<zt&&Er(Z.charCodeAt(qt)))qt++;while(zt>qt&&Er(Z.charCodeAt(zt-1)))zt--;if(qt===zt){let sn=Le.length>0?Le[Le.length-1]:void 0;if(sn!==void 0&&sn!==""){let ln=sn.charCodeAt(sn.length-1);if(ln!==br&&ln!==Uu&&ln!==qu)ee.push(0),Le.push("")}Lt=Kt;continue}if(jt){if(ee.push(Gt),Le.push(` ${Z.slice(qt,zt)}`),La(Z,qt,zt))jt=!1;Lt=Kt;continue}let Xt=ph(Z,qt,zt),Yt=Xt&&La(Z,qt,zt);if(Xt&&!Yt){ee.push(Bt),Le.push(Z.slice(qt,zt)),jt=!0,Gt=Bt,Lt=Kt;continue}let Jt=ah(Z.charCodeAt(qt)),tn=Math.max(0,Bt-(Jt?1:0))+(ch(Z,qt,zt)?1:0);if(Jt&&tn===0&&Le.length>0&&Le[Le.length-1]==="")ee.pop(),Le.pop();if(ee.push(tn),Le.push(oh(Z.slice(qt,zt))),Lt=Kt,Yt)continue;Bt=Xi(Z,void 0,qt,zt,Bt)}let Vt=Le.length;while(Vt>0&&Le[Vt-1]==="")Vt--;let Wt=[];for(let Ut=0;Ut<Vt;Ut++){if(Ut>0)Wt.push(`
34
- `);let Kt=ee[Ut];if(Kt>0)Wt.push(Yu(Kt));Wt.push(Le[Ut])}return Wt.join("")}function Wa(Z){return`${lh(Ga(Z,0,Z.length,sh(Z)))}
35
- `}var kn="any",uh="Record<string, any>",Ri="Record<string, never>",Xa=/^[A-Za-z_$][A-Za-z0-9_$]*$/,hh=/CustomEvent/,dh=/^[A-Z]/,fh=/\n/,mh=/=>/,gh=/^\s*[(<]/,yh=/(?:^|\n)@default\b/,xh=/^([ \t]*\*) +$/gm,vh=/[^\S\r\n]*[\r\n]\s*/g,Eh=/(^|[^.\w])Snippet(?:\s*<|\b)/,Sh=/import\s+type\s+[^;]*\bSnippet\b[^;]*from\s+"svelte";/,Ch=/^const\s+/,bh=/^export /,wh=/[^\w$]/g;function Ja(Z){return Z.replace(Ch,"")}function Rn(Z){if(Z.length===0)return"";return`/**
36
- * ${O(Z.join(`
37
- * `))}
38
- */`}function Ii(Z){return Z?Z.split(`
39
- `):[]}function Ya(Z){if(Z===void 0)return[];return(Z===!0?"@deprecated":`@deprecated ${Z}`).split(`
40
- `)}function kr(Z){let ee=[];for(let{name:Le,body:Ot}of Z??[])if(!Ot)ee.push(`@${Le}`);else if(Ot.includes(`
41
- `))ee.push(`@${Le}`,...Ot.split(`
42
- `));else ee.push(`@${Le} ${Ot}`);return ee}function mi(Z,ee,Le){return[...Ii(Z),...Ya(ee),...kr(Le)]}function Qa(Z){if(!Z)return"";return`/** ${O(Z)} */`}function Ar(Z){return Z?.includes(`
43
- `)?Rn(Ii(Z)):Qa(Z)}function Pr(Z,ee,Le){let Ot=[...kr(ee),...Ya(Le)];if(Ot.length===0)return Ar(Z);return Rn([...Ii(Z),...Ot])}function Za(Z){if(Z===void 0)return kn;return`${Z}
44
- `}function Es(Z){if(Z.typedefs.length===0)return"";return Z.typedefs.map((ee)=>{let Le=Rn([...Ii(ee.description),...kr(ee.tags)]);return`${Le?`${Le}
45
- `:""}export ${ee.ts}`.replace(xh,"$1")}).join(`
46
-
47
- `)}var Ua=new Map;function Th(Z,ee){let Le=Ua.get(ee);if(Le===void 0)Le=new RegExp(`\\b${N(ee)}\\b`),Ua.set(ee,Le);return Le.test(Z)}var Ha,Ka=[];function ep(Z){if(Z!==Ha)Ha=Z,Ka=i(Z,",");return Ka}function kh(Z){if(Z===null)return[];return Z[0].split(",").map((ee,Le)=>({name:ee.trim(),constraint:(ep(Z[1]??"")[Le]??ee).trim()}))}function tp(Z,ee){let Le=kh(Z).filter(({name:Ot})=>Th(ee,Ot));if(Le.length===0)return{declSuffix:"",refSuffix:""};return{declSuffix:`<${Le.map(({constraint:Ot})=>Ja(Ot)).join(", ")}>`,refSuffix:`<${Le.map(({name:Ot})=>Ot).join(", ")}>`}}function np(Z){if(!Z.contexts||Z.contexts.length===0)return"";return Z.contexts.map((ee)=>{let Le=ee.properties.map((Gt)=>{let Lt=Gt.description?`${Ar(Gt.description)}
48
- `:"",Vt=Gt.optional?"?":"";return`${Lt}${_n(Gt.name)}${Vt}: ${Gt.type};`}).join(`
49
- `),Ot=ee.description?`${Rn(Ii(ee.description))}
50
- `:"",{declSuffix:Bt}=tp(Z.generics,[ee.type??"",...ee.properties.map((Gt)=>Gt.type)].join(`
51
- `));if(ee.type!==void 0)return`${Ot}export type ${ee.typeName}${Bt} = ${ee.type};`;if(ee.properties.length===0)return`${Ot}export type ${ee.typeName} = ${ee.hasUnresolvedSpread?"Record<string, any>":Ri};`;let jt=ee.hasUnresolvedSpread?" & Record<string, any>":"";return`${Ot}export type ${ee.typeName}${Bt} = {
52
- ${Le}
53
- }${jt};`}).join(`
54
-
55
- `)}function _n(Z){return Xa.test(Z)?Z:JSON.stringify(Z)}function qa(Z,ee){let Le=Pr(ee.description,ee.tags,ee.deprecated),Ot=Le?`${Le}
56
- `:"",Bt=!ee.slot_props||ee.slot_props===Ri?"[]":Ph(ee.slot_props),jt=Bt==="[]"?"(this: void) => void":`(this: void, ...args: ${Bt}) => void`;return`
57
- ${Ot}${Z}?: ${jt};`}function Ah(Z){let ee=Z.props.filter((Zt)=>!Ss(Zt)),Le=new Set([...ee.map((Zt)=>Zt.name),...Array.from(Z.canonicalPropNames??[])]),Bt=(Z.canonicalPropsType?ee.filter((Zt)=>!Z.canonicalPropNames?.has(Zt.name)):ee).map((Zt)=>{let si=typeof Zt.value==="string"?Zt.value.replace(vh," "):Zt.value,Ui=yh.test(Zt.description??"")||Zt.value===void 0||Zt.value==="undefined",Hi=Rn([...mi(Zt.description,Zt.deprecated,Zt.tags),...Zt.constant?["@constant"]:[],...Ui?[]:[`@default ${si}`]]),Ki=Zt.constant&&!Zt.isFunction?Zt.value:Zt.type||kn;return`
58
- ${Hi}
59
- ${_n(Zt.name)}${Zt.isRequired?"":"?"}: ${Ki};`});for(let Zt of Z.slots)if(!Zt.default&&Zt.name!=null&&!Le.has(Zt.name))Bt.push(qa(_n(Zt.name),Zt));let jt=Z.slots.find((Zt)=>Zt.default||Zt.name===null);if(jt&&!Le.has("children"))Bt.push(qa("children",jt));let Gt=Bt.join(`
60
- `),Lt=gi(Z.moduleName),Vt=Z.generics?`<${ep(Z.generics[1]).map((Zt)=>Ja(Zt.trim())).join(", ")}>`:"",Wt=Z.generics?`<${Z.generics[0]}>`:"",Kt=`${Z.extends===void 0?"":`Omit<${Z.extends.interface}, keyof $Props${Wt}> & `}$Props${Wt}`,qt=(Zt)=>`export type ${Lt}${Vt} = ${Zt};`,zt=`{${Gt}
61
- }`;if(Z.rest_props?.type!=="Element"){let Zt;if(Z.canonicalPropsType){let si=Gt.trim()===""?"":` & ${zt}`;Zt=[`type $Props${Vt} = ${Z.canonicalPropsType}${si};`,qt(Kt)]}else if(Gt.trim()==="")Zt=[qt(Z.extends?.interface??Ri)];else if(Z.extends===void 0)Zt=[qt(zt)];else Zt=[`type $Props${Vt} = ${zt};`,qt(Kt)];return{props_name:Lt,prop_def:Zt.join(`
62
-
63
- `),elementsImport:void 0}}let{name:Xt,thisValue:Yt,thisType:Jt,description:tn}=Z.rest_props,sn;if(Xt!=="svelte:element")sn=Xt.split("|").map((Zt)=>`SvelteHTMLElements["${Zt.trim()}"]`).join(" & ");else if(Yt)sn=`SvelteHTMLElements["${Yt}"]`;else if(Jt)sn=`NoInfer<SvelteHTMLElements[${Jt}]>`;else sn="HTMLAttributes<HTMLElement>";let ln="[key: `data-${string}`]: unknown;",cn=tn?`${Ar(tn)}
64
- `:"",un=Z.canonicalPropsType?`(${Z.canonicalPropsType}) & `:"",On=Jt?{name:Vt,ref:Wt}:{name:"",ref:""},zn=Z.extends===void 0?`keyof $Props${Wt}`:`keyof ($Props${Wt} & ${Z.extends.interface})`,Bn=`Omit<$RestProps${On.ref}, ${zn}>`,yn=Jt?`(${Jt} extends any ? ${Bn} : never)`:Bn;return{props_name:Lt,prop_def:[`${cn}type $RestProps${On.name} = ${sn};`,`type $Props${Vt} = ${un}{${Gt}
65
-
66
- ${ln}
67
- };`,qt(`${yn} & ${Kt}`)].join(`
68
-
69
- `),elementsImport:sn.startsWith("HTMLAttributes")?"HTMLAttributes":"SvelteHTMLElements"}}function Ph(Z){return Gs(Z)?Z:`[${Z}]`}function _h(Z){let ee=Z.slots.filter((Ot)=>!Gs(Ot.slot_props??""));if(ee.length===0)return Ri;let Le=ee.map(({name:Ot,slot_props:Bt,...jt})=>{let Gt=jt.default||Ot===null?"default":_n(Ot??""),Lt=Pr(jt.description,jt.tags,jt.deprecated);return`${Lt?`${Lt}
70
- `:""}${Gt}: ${Za(Bt)};`}).join(`
71
- `);return ee.length===1?`{${Le}}`:`{
72
- ${Le}
73
- }`}var $h=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 Tr(Z=kn){if(hh.test(Z))return Z;return`CustomEvent<${Z}>`}function Nh(Z){switch(Z.type){case"dispatched":return Tr(Z.detail);case"forwarded":{let ee=Z.element,Le=ee&&dh.test(ee),Ot=!Le||$h.has(Z.name);if(Z.detail!==void 0&&Z.detail!=="undefined"&&!(Z.detail==="null"&&Ot&&!Le))return Tr(Z.detail);if(!Ot)return Tr();return`${ee==="svelte:document"?"DocumentEventMap":"WindowEventMap"}["${Z.name}"]`}default:return Z}}function za(Z){if(Z.events.length===0)return uh;let ee=Z.events.map((Le)=>{let Ot=Pr(Le.description,Le.tags,Le.deprecated);return`${Ot?`${Ot}
74
- `:""}${_n(Le.name)}: ${Nh(Le)};
75
- `}).join("");return Z.events.length===1?`{${ee}}`:`{
76
- ${ee}}`}function Dh(Z){let ee=Z.type==="() => any";if(Z.type&&mh.test(Z.type)&&!ee)return Z.type;if(Z.params&&Z.params.length>0)return`(${m(Z.params)}) => ${Z.returnType||kn}`;if(Z.returnType)return`() => ${Z.returnType}`;return Z.type||kn}function Ss(Z){return Z.isFunctionDeclaration===!0||Z.kind==="const"}function ip(Z){return Z.props.filter(Ss).map((ee)=>`
77
- ${Rn(mi(ee.description,ee.deprecated,ee.tags))}
78
- ${_n(ee.name)}: ${Dh(ee)};`).join(`
79
- `)}function Rh(Z){let ee=Oi(Z.moduleName),Le=ip({props:Z.props});if(Le.trim()==="")return{exports_ref:ee,exports_def:`export type ${ee} = ${Ri};`};let{declSuffix:Ot,refSuffix:Bt}=tp(Z.generics,Le);return{exports_ref:`${ee}${Bt}`,exports_def:`export type ${ee}${Ot} = {${Le}
80
- };`}}function Ih(Z){let ee=Z.props.filter((Le)=>Le.bindable===!0||Le.binding==="writable").map((Le)=>JSON.stringify(Le.name));return ee.length>0?ee.join(" | "):'""'}function sp(Z){return Z==="default"?"$$Component":Z}function Oh(Z){let ee=sp(Z.moduleName);return`declare const ${ee}: Component<
81
- ${Z.propsRef},
82
- ${Z.exportsRef},
83
- ${Z.bindings}
84
- >;
85
- export default ${ee};`}function Lh(Z){let ee=sp(Z.moduleName),Le=`${ee}Component`,Ot=Z.eventsRef?`$on?<K extends keyof ${Z.eventsRef} & string>(type: K, callback: (e: ${Z.eventsRef}[K]) => void): () => void;`:"$on?(type: string, callback: (e: any) => void): () => void;";return`interface ${Le} {
86
- new ${Z.generic}(
87
- options: ComponentConstructorOptions<${Z.propsRef}>
88
- ): SvelteComponent<${Z.propsRef}${Z.eventsRef?`, ${Z.eventsRef}`:""}> & ${Z.exportsRef};
89
- ${Z.generic}(
90
- this: void,
91
- internals: ComponentInternals,
92
- props: ${Z.propsRef}
93
- ): {
94
- ${Ot}
95
- $set?(props: Partial<${Z.propsRef}>): void;
96
- } & ${Z.exportsRef};
97
- element?: typeof HTMLElement;
98
- z_$$bindings?: ${Z.bindings};
99
- }
100
- declare const ${ee}: ${Le};
101
- export default ${ee};`}function Mh(Z){if(Z.extends===void 0)return"";return`import type { ${_r(Z.extends.interface)} } from ${Z.extends.import};`}function _r(Z){let ee=Z.indexOf("<");return(ee===-1?Z:Z.slice(0,ee)).trim()}function Fh(Z){if(!Z.componentComment)return"";if(!fh.test(Z.componentComment))return Qa(Z.componentComment.trim());return`/*${O(Z.componentComment).split(`
102
- `).map((ee)=>`* ${ee}`).join(`
103
- `)}
104
- */`}function Bh(Z){let ee=[],Le=new Map;for(let Ot of Z.moduleExports){if(Ot.kind!=="re-export"||!Ot.reExport)continue;let{from:Bt,imported:jt}=Ot.reExport,Gt=Rn(mi(Ot.description,Ot.deprecated,Ot.tags)),Lt=_n(Ot.name);if(jt==="*"){let Ut=Ot.name==="*"?"*":`* as ${Lt}`;ee.push(`${Gt}
105
- export ${Ut} from ${JSON.stringify(Bt)};`);continue}let Vt=`${Bt}\x00${Gt}`,Wt=Le.get(Vt);if(!Wt)Wt={comment:Gt,from:Bt,specifiers:[]},Le.set(Vt,Wt),ee.push(Vt);Wt.specifiers.push(jt===Ot.name?Lt:`${_n(jt)} as ${Lt}`)}return ee.map((Ot)=>{let Bt=Le.get(Ot);if(!Bt)return Ot;return`${Bt.comment}
106
- export { ${Bt.specifiers.join(", ")} } from ${JSON.stringify(Bt.from)};`}).join(`
107
-
108
- `)}function $r(Z){let ee=[Z.static?"static ":"",Z.abstract?"abstract ":"",Z.readonly?"readonly ":""].join(""),Le=Z.optional?"?":"";if(Z.kind==="property")return`${ee}${_n(Z.name)}${Le}: ${Z.type??kn}`;if(Z.kind==="index")return`${ee}${Z.name}: ${Z.type??kn}`;let Ot=m(Z.params??[]);if(Z.kind==="constructor")return`constructor(${Ot})`;let Bt=Z.typeParameters?`<${Z.typeParameters}>`:"";return`${ee}${_n(Z.name)}${Le}${Bt}(${Ot}): ${Z.returnType??kn}`}function jh(Z,ee){let Le=Z.localName??Z.name,Ot=Le!==Z.name,Bt=`export { ${Le}${Ot?` as ${_n(Z.name)}`:""} };`;if(ee.has(Le))return Bt;ee.add(Le);let jt=Z.typeParameters?`<${Z.typeParameters}>`:"",Gt=(Z.members??[]).map((Ut)=>[Rn(mi(Ut.description,Ut.deprecated,Ut.tags)),`${$r(Ut)};`].filter(Boolean).join(`
109
- `)).join(`
110
-
111
- `),Lt=`${Z.extends?` extends ${Z.extends}`:""}${Z.implements?.length?` implements ${Z.implements.join(", ")}`:""}`,Vt=`${Ot?"":"export "}declare ${Z.abstract?"abstract ":""}class ${Le}${jt}${Lt}`;return`
112
- ${[Rn(mi(Z.description,Z.deprecated,Z.tags)),Gt?`${Vt} {
113
- ${Gt}
114
- }`:`${Vt} {}`,Ot?Bt:""].filter(Boolean).join(`
115
- `)}`}function Vh(Z){let ee=Bh(Z),Le=new Set,Ot=Z.moduleExports.filter((Bt)=>Bt.kind!=="re-export").map((Bt)=>{if(Bt.kind==="class")return jh(Bt,Le);let jt=!Xa.test(Bt.name),Gt=jt?{...Bt,name:Gh(Bt.name)}:Bt,Lt,Vt=Gt.type&&gh.test(Gt.type)?k(Gt.type):-1,Wt=Gt.typeParameters?`<${Gt.typeParameters}>`:"";if(Gt.kind==="const"&&Vt===-1)Lt=`export declare const ${Gt.name}: ${Gt.type||kn};
116
- `;else if(Gt.kind==="let")Lt=`export declare let ${Gt.name}: ${Gt.type||kn};`;else if(Gt.params&&Gt.params.length>0)Lt=`export declare function ${Gt.name}${Wt}(${m(Gt.params)}): ${Gt.returnType||kn};`;else if(Gt.returnType)Lt=`export declare function ${Gt.name}${Wt}(): ${Gt.returnType};`;else if(Gt.type&&Vt!==-1){let Ut=Gt.type.slice(0,Vt).trimEnd(),Kt=Gt.type.slice(Vt+2).trim();Lt=`export declare function ${Gt.name}${Ut}: ${Kt};`}else Lt=`export declare let ${Gt.name}: ${Gt.type||kn};`;if(jt)Lt=`${Lt.replace(bh,"").trimEnd()}
117
- export { ${Gt.name} as ${JSON.stringify(Bt.name)} };`;return`
118
- ${Rn(mi(Gt.description,Gt.deprecated,Gt.tags))}
119
- ${Lt}`}).join(`
120
- `);return[ee,Ot].filter(Boolean).join(`
121
-
122
- `)}function Gh(Z){return`__export_${Z.replace(wh,"_")}`}var Wh=120;function Uh(Z){let Le=`export default class ${Z.moduleName==="default"?"":Z.moduleName}${Z.generic} extends SvelteComponentTyped<`,Ot=[Z.genericProps,Z.events,Z.slots];if(Z.accessors.trim()===""&&Ot.every((Bt)=>!Bt.includes(`
123
- `))){let Bt=`${Le}${Ot.join(", ")}> {}`;if(Bt.length<=Wh)return Bt}return`${Le}
124
- ${Z.genericProps},
125
- ${Z.events},
126
- ${Z.slots}
127
- > {
128
- ${Z.accessors}
129
- }`}function gi(Z){return`${Z}Props`}function Oi(Z){return`${Z}Exports`}function Nr(Z){return{format:Z.format}}var Hh={format:"class"};function rp(Z){let ee=Nr(Z??{}),Le={};for(let[Ot,Bt]of Object.entries(ee))Le[Ot]=Bt??Hh[Ot];return JSON.stringify(Le)}function Dr(Z,ee){let Le=mo(Z),{moduleName:Ot,typedefs:Bt,generics:jt,props:Gt,moduleExports:Lt,slots:Vt,events:Wt,rest_props:Ut,extends:Kt,componentComment:qt,contexts:zt}=Z,Xt=ee?.format==="component",Yt=jt!==null,{props_name:Jt,prop_def:tn,elementsImport:sn}=Ah({moduleName:Ot,props:Gt,rest_props:Ut,extends:Kt,generics:jt,slots:Vt,canonicalPropNames:new Set(Le?.canonicalPropNames??[]),canonicalPropsType:Le?.canonicalPropsType}),ln=jt?`<${jt[1]}>`:"",cn=jt?`${Jt}<${jt[0]}>`:Jt,un=Xt&&Wt.length>0?`type $Events${ln} = ${za({events:Wt})};`:"",On=jt?`$Events<${jt[0]}>`:"$Events",zn=Xt&&(Yt||un!==""),Bn=Vh({moduleExports:Lt}),yn=Es({typedefs:Bt}),Zt=np({contexts:zt,generics:jt}),si=(Le?.typeImportStatements??[]).join(`
130
- `),Ui=[...Le?.localTypeDeclarations??[],...Le?.moduleTypeDeclarations??[]].join(`
131
-
132
- `),{exports_ref:Hi,exports_def:Ki}=Xt?Rh({props:Gt,moduleName:Ot,generics:jt}):{exports_ref:"",exports_def:""},ho=Xt?Ih({props:Gt}):"",Ls=!Sh.test(si)&&[tn,Bn,yn,Zt,Ui,Ki].some((Ms)=>Eh.test(Ms)),$c=[Xt?zn?`import type { SvelteComponent, ComponentConstructorOptions, ComponentInternals${Ls?", Snippet":""} } from "svelte";`:`import type { Component${Ls?", Snippet":""} } from "svelte";`:`import { SvelteComponentTyped${Ls?", type Snippet":""} } from "svelte";`,sn?`import type { ${sn} } from "svelte/elements";`:"",si,Mh({extends:Kt})].filter(Boolean).join(`
133
- `),Nc=Xt?zn?Lh({moduleName:Ot,generic:ln,propsRef:cn,exportsRef:Hi,bindings:ho,...un?{eventsRef:On}:{}}):Oh({moduleName:Ot,propsRef:cn,exportsRef:Hi,bindings:ho}):Uh({moduleName:Ot,generic:ln,genericProps:cn,events:za({events:Wt}),slots:_h({slots:Vt}),accessors:ip({props:Gt})}),Dc=[Bn,yn,Ui,Zt,tn,Ki,un,[Fh({componentComment:qt}),Nc].filter(Boolean).join(`
134
- `)].map((Ms)=>Ms.trim()).filter(Boolean).join(`
135
-
136
- `);return Wa([$c,Dc].filter(Boolean).join(`
137
-
138
- `))}var qh=[...hi,".svelte"];function zh(Z){let ee=Z.trim();if(ee.length<2)return;let Le=ee[0],Ot=ee[ee.length-1];if((Le==='"'||Le==="'"||Le==="`")&&Le===Ot)return ee.slice(1,-1);return}function op(Z){let ee=[],Le=Z.moduleExports.filter((Bt)=>Bt.kind==="re-export");if(Le.length===0)return ee;let Ot=new Set([gi(Z.moduleName),Oi(Z.moduleName)]);for(let Bt of Le){if(!Ot.has(Bt.name))continue;ee.push(a({component:Z.filePath,kind:"module-export-conflict",name:Bt.name,message:`Re-export "${Bt.name}" has the same name as the generated "${Bt.name}" type; the .d.ts won't type-check if "${Bt.reExport?.from}" exports a type by that name.`,source:Bt.source}))}return ee}function ap(Z,ee,Le){let Ot=new Map(Array.from(Z.values()).map((Bt)=>[ee(Bt.filePath),Bt]));return(Bt)=>{let jt=Bt.extends;if(!jt)return[];let Gt=zh(jt.import);if(Gt===void 0||!Gt.startsWith(".")&&!Gt.startsWith("/"))return[];let Lt=ee(Bt.filePath),Vt=Le.resolve(Gt,Kh(Lt),qh);if(Vt===null)return[a({component:Bt.filePath,kind:"extend-props-target-missing",name:jt.interface,message:`@extends/@extendProps target "${Gt}" was not found on disk.`})];let Wt=Ot.get(Vt);if(!Wt)return[];let Ut=gi(Wt.moduleName);if(_r(jt.interface)!==Ut)return[a({component:Bt.filePath,kind:"extend-props-target-missing",name:jt.interface,message:`@extends/@extendProps names "${jt.interface}", but "${Gt}" generates "${Ut}".`})];let Kt=[];for(let qt of Bt.props){let zt=Wt.props.find((Xt)=>Xt.name===qt.name);if(zt&&zt.type!==qt.type){let Xt=a({component:Bt.filePath,kind:"extend-props-override",name:qt.name,message:`Own prop "${qt.name}" (${qt.type}) overrides "${Ut}"'s "${qt.name}" (${zt.type}).`,source:qt.source}),Jt=fo(Bt)?.[qt.name]?.some((tn)=>tn===""||tn===Xt.code);Kt.push(Jt?{...Xt,ignored:!0}:Xt)}}return Kt}}import{lstatSync as md,readFileSync as gd,realpathSync as yd,statSync as xd}from"node:fs";import{dirname as vd,isAbsolute as Ed,join as Tp,parse as Sd,relative as Gr,resolve as Mi}from"node:path";function Q(Z){return Z}function $n(Z){if(Z==="")return Z;return Z==="."||Z===".."||Z.startsWith("./")||Z.startsWith("../")?Z:`./${Z}`}import{readFileSync as bp}from"node:fs";import{dirname as jr,join as dd,relative as Ep,resolve as Sp}from"node:path";import{readFileSync as sd,statSync as rd}from"node:fs";import{basename as Br,dirname as Cs,isAbsolute as od,join as ad,resolve as pd}from"node:path";import{existsSync as lp,readdirSync as Xh}from"node:fs";import{dirname as pp,join as up,resolve as Jh}from"node:path";function V(Z,ee){for(let Le=Jh(Z);;Le=pp(Le)){for(let Ot of ee){let Bt=up(Le,Ot);if(lp(Bt))return Bt}if(pp(Le)===Le)return null}}function cp(Z){return Z.normalize("NFC").toLowerCase()}class Rr{listings=new Map;clear(){this.listings.clear()}entries(Z){return this.read(Z)?.entries??null}entry(Z,ee){let Le=this.read(Z);if(Le===null)return;if(Le.byName===void 0){Le.byName=new Map;for(let Ot of Le.entries)Le.byName.set(Ot.name,Ot)}return Le.byName.get(ee)}has(Z,ee){let Le=this.read(Z);if(Le===null)return!1;if(Le.names.has(ee))return!0;if(Le.folded===void 0){Le.folded=new Map;for(let Bt of Le.names)Le.folded.set(cp(Bt),Bt)}let Ot=Le.folded.get(cp(ee));return Ot!==void 0&&Ot!==ee&&lp(up(Z,ee))}read(Z){let ee=this.listings.get(Z);if(ee!==void 0)return ee;try{let Le=Xh(Z,{withFileTypes:!0}),Ot=new Set;for(let Bt of Le)Ot.add(Bt.name);ee={entries:Le,names:Ot}}catch{ee=null}return this.listings.set(Z,ee),ee}}var Ir=!1;function q(Z){Ir=Z}function Fn(Z){if(!Ir)console.error(Z)}function hp(Z){if(!Ir)console.error(Z)}function xe(Z){if(Z instanceof e)return Z.start?`${Z.reason} (${Z.start.line}:${Z.start.column})`:Z.reason;return Z instanceof Error?Z.message:String(Z)}var Li=null,Or=null;function Un(){if(Li)return Promise.resolve(Li);if(!Or)Or=import("./chunk-y7x842z1.js").then((Z)=>(Li=Z,Z));return Or}function Nn(){if(!Li)throw Error("sveld: internal error, parser stack read before loadParserStack() resolved.");return Li}import{existsSync as Lr,readFileSync as Yh}from"node:fs";import{dirname as yp,isAbsolute as xp,relative as Qh,resolve as Mr}from"node:path";function dp(Z){if(!r(Z))return{};let ee={};if(typeof Z.svelte==="string")ee.svelte=Z.svelte;if(typeof Z.name==="string")ee.name=Z.name;if(typeof Z.description==="string")ee.description=Z.description;return ee}function fp(Z){if(!r(Z))return{};let ee={};if(typeof Z.extends==="string")ee.extends=Z.extends;if(r(Z.compilerOptions)){let Le={};if(typeof Z.compilerOptions.baseUrl==="string")Le.baseUrl=Z.compilerOptions.baseUrl;if(r(Z.compilerOptions.paths)){let Ot={};for(let[Bt,jt]of Object.entries(Z.compilerOptions.paths))if(Array.isArray(jt)&&jt.every((Gt)=>typeof Gt==="string"))Ot[Bt]=jt;if(Object.keys(Ot).length>0)Le.paths=Ot}if(Object.keys(Le).length>0)ee.compilerOptions=Le}return ee}var Zh=["tsconfig.json","jsconfig.json"],mp=new Map,ed=/\/\*[\s\S]*?\*\/|\/\/.*/g,td=[".svelte",...hi];class G extends Error{specifier;fromFile;searched;constructor(Z,ee,Le){super(`cannot resolve "${Z}" from ${ee||"."} (${Le})`);this.name="UnresolvedModuleError",this.specifier=Z,this.fromFile=ee,this.searched=Le}}function nd(Z){if(Lr(Z))return!0;return td.some((ee)=>Lr(Z+ee))}function gp(Z){let ee=Z.indexOf("*");return ee===-1?Z.length:ee}function vp(Z,ee){if(ee.has(Z))return ee.get(Z)??null;try{let Le=Yh(Z,"utf-8"),Ot;try{Ot=JSON.parse(Le)}catch{let jt=Le.replace(ed,"");Ot=JSON.parse(jt)}let Bt=fp(Ot);if(Bt.extends){let jt=xp(Bt.extends)?Bt.extends:Mr(yp(Z),Bt.extends),Gt=jt.endsWith(".json")?jt:`${jt}.json`;if(Lr(Gt)){let Lt=vp(Gt,ee);if(Lt)Bt.compilerOptions={...Lt.compilerOptions,...Bt.compilerOptions,paths:{...Lt.compilerOptions?.paths,...Bt.compilerOptions?.paths}}}}return ee.set(Z,Bt),Bt}catch{return ee.set(Z,null),null}}function id(Z){let ee=mp.get(Z);if(!ee){let Le=Z.split("*").map(N).join("(.*)");ee=new RegExp(`^${Le}$`),mp.set(Z,ee)}return ee}class Fr{configs=new Map;lookup(Z,ee){if(Z.startsWith(".")||xp(Z))return{resolved:Z,unresolved:!1,searched:""};let Le=V(ee,Zh),Ot=Le?vp(Le,this.configs)?.compilerOptions:void 0,Bt=Ot?.paths;if(!Le||!Ot||!Bt)return{resolved:Z,unresolved:!0,searched:"no tsconfig/jsconfig paths found"};let jt=Mr(yp(Le),Ot.baseUrl??"."),Gt=Object.entries(Bt).sort(([Lt],[Vt])=>gp(Vt)-gp(Lt));for(let[Lt,Vt]of Gt){let Wt=Z.match(id(Lt));if(!Wt)continue;let Ut;for(let Kt of Vt){let qt=Kt;for(let Xt=1;Xt<Wt.length;Xt++)qt=qt.replace("*",Wt[Xt]);let zt=Mr(jt,qt);if(Ut??=zt,nd(zt))return{resolved:zt,unresolved:!1,searched:Le}}return{resolved:Ut??Z,unresolved:!1,searched:Le}}return{resolved:Z,unresolved:!0,searched:`tsconfig paths (${Le})`}}absolute(Z,ee){return this.lookup(Z,ee).resolved}relative(Z,ee){let Le=this.absolute(Z,ee);if(Le===Z)return Z;return $n(n(Qh(ee,Le)))}}var cd=/\.[mc]?jsx?$/,ld={".js":[".ts",".tsx",".d.ts"],".jsx":[".tsx",".d.ts"],".mjs":[".mts",".d.mts"],".cjs":[".cts",".d.cts"]};function ud(Z){return Z==="."||Z===".."||Z.startsWith("./")||Z.startsWith("../")||od(Z)}class Hn{aliases=new Fr;listings=new Rr;modules=new Map;programs=new Map;listDirectory(Z){return this.listings.entries(Z)}exists(Z){return this.listings.has(Cs(Z),Br(Z))}resolve(Z,ee,Le=hi){let Ot=this.aliases.absolute(Z,ee);if(Ot===Z&&!ud(Z))return null;let Bt=pd(ee,Ot),jt=Cs(Bt),Gt=Br(Bt),Lt=this.listings.has(jt,Gt),Vt;if(Lt){let Wt=this.listings.entry(jt,Gt);if(Vt=Wt&&!Wt.isSymbolicLink()?Wt:rd(Bt,{throwIfNoEntry:!1}),Vt?.isFile())return Bt}for(let Wt of Le)if(this.listings.has(jt,Gt+Wt))return Bt+Wt;if(!Lt)return this.typeScriptCounterpart(Bt)??null;if(Vt?.isDirectory()){for(let Wt of Le)if(this.listings.has(Bt,`index${Wt}`))return ad(Bt,`index${Wt}`)}return null}parse(Z){let ee=this.modules.get(Z);if(ee===void 0)ee=hd(Z),this.modules.set(Z,ee);return ee}parseJavaScript(Z,ee){let Le=this.programs.get(Z);if(Le?.source===ee)return Le.ast;let Ot;try{Ot=me(ee)}catch(Bt){throw Error(xe(Bt))}return this.programs.set(Z,{source:ee,ast:Ot}),Ot}invalidate(...Z){this.listings.clear();for(let ee of Z)this.modules.delete(ee),this.programs.delete(ee)}typeScriptCounterpart(Z){let ee=cd.exec(Z)?.[0];if(ee===void 0)return;let Le=Z.slice(0,-ee.length),Ot=Cs(Le),Bt=Br(Le);for(let jt of ld[ee]??[])if(this.listings.has(Ot,Bt+jt))return Le+jt;return}}function hd(Z){let ee;try{ee=sd(Z,"utf-8")}catch{return null}try{let Le=Z.endsWith(".svelte")?Nn().parseSvelteScripts(ee).module?.content.body??[]:Nn().parseModule(ee,{typescript:!0}).body;return{source:{text:ee,filePath:Z,dir:Cs(Z)},body:Le}}catch(Le){return hp(`Warning: sveld couldn't parse ${Z} to read its exports (${xe(Le)}); skipping it.`),null}}function Cp(Z){return Z.type==="Identifier"?Z.name:Z.value}function fd(Z,ee,Le,Ot){let Bt=Z.resolve(ee,Le);if(!Bt)return null;let jt=jr(Bt);if(Ot.has(Bt))return{dir:jt,exports:{}};Ot.add(Bt);try{return{dir:jt,exports:Vr(Z,bp(Bt,"utf-8"),jt,Ot,Bt)}}catch{return{dir:jt,exports:{}}}finally{Ot.delete(Bt)}}function wp(Z,ee,Le=new Hn,Ot=new Set,Bt=ee){return Vr(Le,Z,ee,Ot,Bt)}function Vr(Z,ee,Le,Ot,Bt){let jt=Z.parseJavaScript(Bt,ee),Gt={};for(let Lt of jt.body)if(Lt.type==="ExportDefaultDeclaration"){if(Lt.declaration.type!=="Identifier")continue;let Vt=Lt.declaration.name;if(Vt in Gt)Gt[Vt].default=!0;else Gt[Vt]={source:$n(""),default:!0}}else if(Lt.type==="ExportAllDeclaration"){let Vt=Lt.source.value,Wt=Z.resolve(Vt,Le);if(!Wt){let zt=Z.aliases.lookup(Vt,Le);throw new G(Vt,Bt,zt.unresolved?zt.searched:"no matching file or index found")}if(Ot.has(Wt))continue;Ot.add(Wt);let Ut=bp(Wt,"utf-8"),Kt=Vr(Z,Ut,jr(Wt),Ot,Wt);Ot.delete(Wt);let qt=Object.entries(Kt);if(qt.length===0&&!Pn.test(Vt)){let zt=$n(n(Vt));Gt[`*:${Vt}`]={source:zt,default:!1,star:!0}}for(let[zt,Xt]of qt){let Yt=$n(n(Xt.source.startsWith(".")?`./${Ep(Le,Sp(jr(Wt),Xt.source))}`:`./${dd(Vt,Xt.source)}`));Gt[zt]={...Xt,source:Yt}}}else if(Lt.type==="ExportNamedDeclaration"){let Vt=Lt.source?.value,Wt=Vt!==void 0&&Pn.test(Vt);if(Wt){let qt=Z.aliases.lookup(Vt,Le);if(qt.unresolved)throw new G(Vt,Bt,qt.searched)}let Kt=Vt!==void 0&&!Wt?fd(Z,Vt,Le,Ot):void 0;if(Kt===null){console.warn(`sveld: could not resolve re-exported module "${Vt}" from barrel "${Le||"."}"; skipping.`);continue}for(let qt of Lt.specifiers){let zt=Cp(qt.exported),Xt=Cp(qt.local),Yt=zt||Xt,Jt=Kt?.exports[Xt],tn=Jt?$n(n(`./${Ep(Le,Sp(Kt.dir,Jt.source))}`)):$n(Z.aliases.relative(Vt??"",Le)),sn=Jt?Jt.default:Xt==="default";if(Yt in Gt){if(Gt[Yt].mixed=!0,!Gt[Yt].source)Gt[Yt].source=tn}else Gt[Yt]={source:tn,default:sn}}}else if(Lt.type==="ImportDeclaration"){let Vt=Lt.specifiers[0];if(!Vt)continue;let Wt=Vt.local.name,Ut=$n(Z.aliases.relative(Lt.source.value,Le));if(Wt in Gt){if(!Gt[Wt].source)Gt[Wt].source=Ut}else Gt[Wt]={source:Ut,default:Wt==="default"}}return Gt}var Cd=/-/g,bd=/[^A-Za-z0-9_$]/g,wd=/^[0-9]/;function Td(Z,ee){let Le=Z.replace(bd,""),Ot=wd.test(Le)?`_${Le}`:Le;if(Ot!==Z&&!ee?.has(Z))ee?.add(Z),console.warn(`Warning: "${Z}" is not a valid identifier; using "${Ot}" instead.`);return Ot}function kp(Z,ee){return Td(Sd(Z).name.replace(Cd,""),ee)}function Ap(Z,ee,Le=[],Ot=new Set,Bt){let jt;try{jt=Bt??yd(ee)}catch{return Le}if(Ot.has(jt))return Le;Ot.add(jt);let Gt=Z.listDirectory(ee);if(Gt===null)return Le;for(let Lt of Gt){if(Lt.name.startsWith("."))continue;let Vt=Tp(ee,Lt.name),Wt=Lt.isSymbolicLink(),Ut=Wt?xd(Vt,{throwIfNoEntry:!1}):Lt;if(!Ut)continue;if(Ut.isDirectory())Ap(Z,Vt,Le,Ot,Wt?void 0:Tp(jt,Lt.name));else if(Ut.isFile()&&Lt.name.endsWith(".svelte"))Le.push(Vt)}return Le}function kd(Z,ee){return Ap(Z,ee).map((Le)=>({moduleName:kp(Le),source:$n(n(`./${Gr(ee,Le)}`))})).sort((Le,Ot)=>u(Le.source,Ot.source))}function Ad(Z){return!di(Z)}function Pd(Z,ee){let Le=Z.endsWith("/")?Z:`${Z}/`;return ee.startsWith(Le)}function bs(Z,ee){return{seenPaths:new Set(Z.map(([,Le])=>ee(Le.source))),seenModuleNamePaths:new Map(Z.map(([Le,Ot])=>[Le,ee(Ot.source)])),warnedModuleNames:new Set}}function Wr(Z,ee,Le,Ot,Bt,jt){for(let{moduleName:Gt,source:Lt}of kd(Z,ee)){let Vt=Bt(Lt),Wt=Le[Gt];if(Wt&&Ad(Wt.source)&&Pd(Wt.source,Lt)){jt.seenPaths.delete(Bt(Wt.source)),Wt.source=Lt,jt.seenPaths.add(Vt),jt.seenModuleNamePaths.set(Gt,Vt);continue}if(jt.seenPaths.has(Vt))continue;jt.seenPaths.add(Vt);let Ut=jt.seenModuleNamePaths.get(Gt);if(Ut===void 0)jt.seenModuleNamePaths.set(Gt,Vt);else if(Ut!==Vt&&!jt.warnedModuleNames.has(Gt))jt.warnedModuleNames.add(Gt),console.warn(`Warning: multiple components named "${Gt}" found (${n(Gr(ee,Ut))} and ${n(Gr(ee,Vt))}). Both are included in TypeScript definitions, but only one can be the named export.`);Ot.push([Gt,{source:Lt,default:!1}])}}function Ur(Z,ee,Le,Ot){let Bt=md(Z).isFile(),jt=Bt?vd(Z):Z,Gt=Mi(jt),Lt=new Map,Vt=(Kt)=>{let qt=Lt.get(Kt);if(qt===void 0)qt=Ed(Kt)?Mi(Kt):Mi(Gt,Kt),Lt.set(Kt,qt);return qt},Wt={};if(Bt){let Kt=gd(Z,"utf-8");try{Wt=wp(Kt,Gt,Ot,new Set([Mi(Z)]),Mi(Z))}catch(qt){if(!Le)throw qt;let zt=qt instanceof Error?qt.message:String(qt);console.warn(`Warning: Failed to parse component exports from ${Z}: ${zt}`)}}let Ut=Object.entries(Wt);if(ee){let Kt=bs(Ut,Vt);if(Wr(Ot,Gt,Wt,Ut,Vt,Kt),!Bt)Wt=Object.fromEntries(Ut.map(([qt,zt])=>[qt,{...zt,default:!0}]))}return{exports:Wt,allComponentEntries:Ut,rootDir:Gt,resolveComponentFilePath:Vt}}function Pp(Z,ee,Le,Ot){if(Le!==1||Z!=="default")return Z;return kp(ee,Ot)}import{dirname as lf}from"node:path";import{resolve as _d}from"node:path";var $d=/\r?\n/,Nd=/^\s*\*+/;function ws(Z){return{graph:Z,cache:new Map,computing:new Set}}function gn(Z){return Z?.type==="Identifier"?Z.name:void 0}function Dd(Z){let ee=Z.trimEnd();for(;;){let Le=ee.lastIndexOf(`
139
- `)+1;if(ee.slice(Le).trimStart().startsWith("//")){ee=ee.slice(0,Le).trimEnd();continue}let Ot=ee.endsWith("*/")?ee.lastIndexOf("/*",ee.length-3):-1;if(Ot!==-1&&ee[Ot+2]!=="*"){ee=ee.slice(0,Ot).trimEnd();continue}return ee}}function Rd(Z,ee){let Le=Dd(Z.slice(0,ee));if(!Le.endsWith("*/"))return;let Ot=Le.length-2,Bt=Le.lastIndexOf("/**",Ot);if(Bt===-1)return;return Le.slice(Bt,Ot+2)}function Id(Z){let ee=[];for(let Le of Z.slice(3,-2).split($d)){let Ot=Le.replace(Nd,"").trim();if(Ot.startsWith("@"))break;if(Ot)ee.push(Ot)}return ee.join(" ")||void 0}function ti(Z,ee){if(!ee)return;return Z.text.slice(ee.start,ee.end)}function Od(Z,ee){return"typeAnnotation"in ee?ti(Z,ee.typeAnnotation?.typeAnnotation):void 0}function $p(Z,ee){return ti(Z,ee.returnType?.typeAnnotation)}function Hr(Z,ee,Le){return`(${ee.params.map((Bt)=>ti(Z,Bt)??"").join(", ")}) => ${$p(Z,ee)??Le??"any"}`}function Np(Z){if(Z.type==="Literal"){let ee=Z.value;if(typeof ee==="string")return"string";if(typeof ee==="number")return"number";if(typeof ee==="boolean")return"boolean"}if(Z.type==="TemplateLiteral")return"string";if(Z.type==="UnaryExpression"&&(Z.operator==="-"||Z.operator==="+"))return Z.argument.type==="Literal"&&typeof Z.argument.value==="number"?"number":void 0;if(Z.type==="CallExpression"&&Z.callee.type==="Identifier")return Ld[Z.callee.name];return}var Ld={String:"string",Number:"number",Boolean:"boolean"};function Dp(Z){if(Z.type==="Literal"){let ee=Z.value;return typeof ee==="string"||typeof ee==="number"||typeof ee==="boolean"?ee:void 0}if(Z.type==="UnaryExpression"&&Z.operator==="-"){let ee=Z.argument;return ee.type==="Literal"&&typeof ee.value==="number"?-ee.value:void 0}return Z.type==="TemplateLiteral"?C(Z)??void 0:void 0}function Md(Z,ee){let Le=ti(Z,ee),Ot=Dp(ee);if(Le===void 0||Ot===void 0)return;return{raw:Le,value:Ot,type:typeof Ot}}function Fd(Z,ee){if(Z.type!=="CallExpression"&&Z.type!=="NewExpression")return;let Le=Z.callee;if(!(gn(Le)==="Symbol"||Le.type==="MemberExpression"&&!Le.computed&&gn(Le.object)==="Symbol"&&gn(Le.property)==="for"))return;let[Bt]=Z.arguments;return(Bt?.type==="Literal"&&typeof Bt.value!=="string"?null:C(Bt))||ee}var Bd=new Set(["any","bigint","boolean","false","never","null","number","object","readonly","string","symbol","true","undefined","unknown","void"]),jd=/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/g,Vd=/(?<![\w$.])[A-Za-z_$][\w$]*(?![\w$]|\s*\??:)/g;function Gd(Z,ee){let Le=ee?Nn().extractJsDocType(ee):void 0,Ot=Z?{type:Z,source:"typescript"}:Le?{type:Le,source:"jsdoc"}:void 0;if(!Ot||Ot.type.includes("`"))return;return(Ot.type.replace(jd,'""').match(Vd)??[]).every((jt)=>Bd.has(jt))?Ot:void 0}function Rp(Z){if(Z.async||Z.generator||Z.type==="TSDeclareFunction")return;let ee=Z.body,Le=ee.type==="BlockStatement"?Y(ee):[ee];if(Le.length===0)return;let Ot;for(let Bt of Le){if(!Bt)return;let jt=Np(Bt);if(!jt)return;if(Ot===void 0)Ot=jt;else if(Ot!==jt)return}return Ot}function Wd(Z){if(Z.type==="TemplateLiteral")return;let ee=Dp(Z);return typeof ee==="boolean"?void 0:ee}function Ud(Z){let ee=Z.members;if(ee.length===0)return;let Le=[],Ot=0;for(let Bt of ee){if(!Bt.initializer){Le.push(String(Ot)),Ot+=1;continue}let jt=Wd(Bt.initializer);if(jt===void 0)return;Le.push(typeof jt==="string"?JSON.stringify(jt):String(jt)),Ot=typeof jt==="number"?jt+1:Ot}return Le.join(" | ")}function Kr(Z,ee,Le,Ot){let Bt=Rd(Z.text,Le),jt=Bt?Id(Bt):void 0,Gt=Bt?Nn().extractJsDocReturnType(Bt):void 0,{deprecated:Lt,tags:Vt,internal:Wt}=Bt?Nn().extractJsDocDeprecatedAndTags(Bt):{deprecated:void 0,tags:void 0,internal:!1},Ut={description:jt,deprecated:Lt,tags:Vt,...Wt?{internal:!0}:{},declFile:Z.filePath},Kt=(zt,Xt,Yt=!1)=>zt?[{name:zt,...Xt,...Ut,isTypeOnly:Yt}]:[],qt=(zt,Xt)=>$p(Z,zt)??Gt??re(Xt)??Rp(zt);if(ee.type==="VariableDeclaration"){let zt=ee.kind==="let"||ee.kind==="var"?ee.kind:"const";return ee.declarations.flatMap((Xt)=>{let Yt=Xt.id,Jt=gn(Yt);if(!Jt)return[];let tn=Od(Z,Yt),sn=tn,ln,cn,un,On,zn,Bn,yn=Xt.init;if(yn)if(yn.type==="ArrowFunctionExpression"||yn.type==="FunctionExpression"){if(Bn=yn,cn=qt(yn,sn),!sn)sn=Hr(Z,yn,cn)}else{if(ln=ti(Z,yn),!sn)sn=Np(yn);let Zt=T(yn);if(un=C(Zt)??Fd(Zt,Jt),zt==="const")On=Md(Z,Zt),zn=Gd(tn,Bt)}return Kt(Jt,{kind:zt,type:sn,value:ln,returnType:cn,literalValue:un,primitiveLiteral:On,declaredType:zn,functionNode:Bn})})}if(ee.type==="FunctionDeclaration"||ee.type==="TSDeclareFunction"){let zt=qt(ee);return Kt(gn(ee.id)??Ot,{kind:"function",type:Hr(Z,ee,zt),returnType:zt,...ee.type==="FunctionDeclaration"?{functionNode:ee}:{}})}if(ee.type==="ClassDeclaration"){let zt=gn(ee.id);return Kt(zt??Ot,{kind:"class",...zt?{type:zt}:{}})}if(ee.type==="TSTypeAliasDeclaration")return Kt(gn(ee.id),{kind:"type",type:ti(Z,ee.typeAnnotation)},!0);if(ee.type==="TSInterfaceDeclaration")return Kt(gn(ee.id),{kind:"interface",type:ti(Z,ee.body)},!0);if(ee.type==="TSEnumDeclaration"){let zt=gn(ee.id);return Kt(zt,{kind:"enum",type:Ud(ee)??zt})}return[]}function Hd(Z,ee,Le){let Ot=ee.declaration;if(Ot.type==="FunctionDeclaration"||Ot.type==="TSDeclareFunction"||Ot.type==="ClassDeclaration"){let[Gt]=Kr(Z,Ot,ee.start,"default");return Gt?{...Gt,name:"default"}:void 0}if(Ot.type==="FunctionExpression"||Ot.type==="ArrowFunctionExpression")return{name:"default",kind:"function",type:Hr(Z,Ot,Rp(Ot)),functionNode:Ot,declFile:Z.filePath,isTypeOnly:!1};let Bt=gn(Ot),jt=Bt?Le(Bt):null;return jt?{...jt,name:"default"}:void 0}function Kd(Z,ee){for(let Le of Z){if(Le.type!=="ImportDeclaration")continue;let Ot=Le.source.value;for(let Bt of Le.specifiers){if(Bt.local.name!==ee)continue;let jt=Le.importKind==="type"||Bt.type==="ImportSpecifier"&&Bt.importKind==="type";if(Bt.type==="ImportDefaultSpecifier")return{specifier:Ot,importedName:"default",isTypeOnly:jt};if(Bt.type==="ImportNamespaceSpecifier")return{specifier:Ot,importedName:"*",isTypeOnly:jt};if(Bt.type==="ImportSpecifier"){let Gt=gn(Bt.imported)??ee;return{specifier:Ot,importedName:Gt,isTypeOnly:jt}}}}return null}function _p(Z,ee,Le){return{name:Z,kind:"const",declFile:ee,namespaceFile:ee,isTypeOnly:Le}}function Ts(Z,ee){let Le=ee.cache.get(Z);if(Le)return Le;if(ee.computing.has(Z))return[];ee.computing.add(Z);let Ot=ee.graph.parse(Z);if(!Ot)return ee.computing.delete(Z),ee.cache.set(Z,[]),[];let{source:Bt,body:jt}=Ot,Gt=[],Lt=new Map;for(let qt of jt){let zt=qt.type==="ExportNamedDeclaration"?qt.declaration:qt;if(!zt)continue;for(let Xt of Kr(Bt,zt,zt.start))Lt.set(Xt.name,Xt)}let Vt=(qt,zt)=>({name:qt,kind:"const",declFile:_d(Bt.dir,zt),isTypeOnly:!1}),Wt=(qt)=>{let zt=Lt.get(qt);if(zt)return zt;let Xt=Kd(jt,qt);if(!Xt)return null;if(Xt.specifier.endsWith(".svelte"))return Vt(qt,Xt.specifier);let Yt=ee.graph.resolve(Xt.specifier,Bt.dir);if(!Yt)return null;if(Xt.importedName==="*")return _p(qt,Yt,Xt.isTypeOnly);return ni(Yt,Xt.importedName,ee)??null},Ut=new Map;for(let qt of jt){if(qt.type==="ExportAllDeclaration"){let Jt=qt.source.value;if(Jt.endsWith(".svelte"))continue;let tn=ee.graph.resolve(Jt,Bt.dir);if(!tn)continue;let sn=qt.exportKind==="type",ln=gn(qt.exported);if(ln){Gt.push(_p(ln,tn,sn));continue}for(let cn of Ts(tn,ee)){let un=Ut.get(cn.name)??[];un.push(sn?{...cn,isTypeOnly:!0}:cn),Ut.set(cn.name,un)}continue}if(qt.type==="ExportDefaultDeclaration"){let Jt=Hd(Bt,qt,Wt);if(Jt)Gt.push(Jt);continue}if(qt.type!=="ExportNamedDeclaration")continue;let zt=qt.declaration;if(zt){Gt.push(...Kr(Bt,zt,qt.start));continue}let Xt=qt.source?.value;if(Xt?.endsWith(".svelte")){for(let Jt of qt.specifiers){let tn=gn(Jt.exported);if(tn)Gt.push(Vt(tn,Xt))}continue}let Yt=qt.exportKind==="type";for(let Jt of qt.specifiers){let tn=gn(Jt.exported),sn=gn(Jt.local);if(!tn||!sn)continue;let ln=Yt||Jt.exportKind==="type",cn=null;if(Xt){let un=ee.graph.resolve(Xt,Bt.dir);if(un)cn=ni(un,sn,ee)??null}else cn=Wt(sn);if(cn)Gt.push({...cn,name:tn,isTypeOnly:cn.isTypeOnly||ln});else if(sn!=="default")Gt.push({name:tn,kind:ln?"type":"const",declFile:Z,isTypeOnly:ln})}}let Kt=new Set(Gt.map((qt)=>qt.name));for(let[qt,zt]of Ut){if(Kt.has(qt)||qt==="default")continue;if(zt.every((Xt)=>Xt.declFile===zt[0].declFile))Gt.push(...zt);else ee.onAmbiguousStarExport?.(Z,qt,zt)}return ee.computing.delete(Z),ee.cache.set(Z,Gt),Gt}function ni(Z,ee,Le){return Ts(Z,Le).findLast((Ot)=>Ot.name===ee)}function yi(Z,{importedName:ee,members:Le=[]},Ot){let Bt=ni(Z,ee,Ot);for(let jt of Le){if(Bt?.namespaceFile===void 0)return;Bt=ni(Bt.namespaceFile,jt,Ot)}return Bt}function Kn(Z,ee,Le){if(Z[ee]===void 0)delete Z[ee];Z[ee]=Le}function ks(Z,ee){return(ee.location==="props"?Z.props:Z.moduleExports).find((Ot)=>Ot.name===ee.propName)}function As(Z,ee){if(ee.location!=="props")return;Z.diagnostics=(Z.diagnostics??[]).filter((Le)=>!(Le.kind==="prop-unknown-type"&&Le.name===ee.propName))}var qd=/\.[^./\\]+$/;function zd(Z,ee){if(Z.endsWith(".d.ts"))return null;let Le=Z.replace(qd,".d.ts");return ee.exists(Le)?Le:null}function Xd(Z,ee,Le){return ee.map((Ot)=>{if(!Ot.importSource||!Ot.importedName)return{candidate:Ot};let Bt=Le.graph.resolve(Ot.importSource,Z);if(!Bt)return{candidate:Ot,failureReason:"module-not-found"};let jt=ni(Bt,Ot.importedName,Le);if(!jt)return{candidate:Ot,failureReason:"export-not-found"};if(jt.returnType)return{candidate:Ot,type:jt.returnType};let Gt=zd(Bt,Le.graph);if(Gt){let Lt=ni(Gt,Ot.importedName,Le);if(Lt?.returnType)return{candidate:Ot,type:Lt.returnType}}return{candidate:Ot,failureReason:"return-type-unresolved"}})}function Jd(Z,ee){switch(ee){case"module-not-found":return`Prop "${Z.propName}" default calls "${Z.calleeName}()", but "${Z.importSource}" could not be resolved; falling back to "any".`;case"export-not-found":return`Prop "${Z.propName}" default calls "${Z.calleeName}()", but "${Z.importedName}" is not exported from "${Z.importSource}"; falling back to "any".`;case"return-type-unresolved":return`Prop "${Z.propName}" default calls "${Z.calleeName}()" imported from "${Z.importSource}", but its return type could not be resolved; falling back to "any".`}}function Yd(Z,ee){for(let{candidate:Le,type:Ot,failureReason:Bt}of ee){let jt=ks(Z,Le);if(jt?.typeSource!=="unknown")continue;if(Ot){Kn(jt,"type",Ot),Kn(jt,"typeSource","typescript"),As(Z,Le);continue}if(Le.location==="props"&&Bt){let Gt=Z.diagnostics?.find((Lt)=>Lt.kind==="prop-unknown-type"&&Lt.name===Le.propName);if(Gt)Gt.message=Jd(Le,Bt)}}}var Ip={collect:(Z)=>Z.pendingCallDefaultCandidates?.filter((ee)=>ee.importSource!==void 0)??[],resolve:Xd,apply:Yd};function Qd(Z,ee,Le){return ee.map((Ot)=>{let Bt=Le.graph.resolve(Ot.importSource,Z);if(!Bt)return{candidate:Ot};let jt=yi(Bt,Ot,Le);if(!jt?.primitiveLiteral)return{candidate:Ot};return{candidate:Ot,literal:jt.primitiveLiteral,declaredType:jt.declaredType}})}function Zd(Z,ee){for(let{candidate:Le,literal:Ot,declaredType:Bt}of ee){if(!Ot)continue;let jt=ks(Z,Le);if(!jt)continue;if(Kn(jt,"value",Ot.raw),Kn(jt,"defaultValue",{raw:Ot.raw,kind:"literal",value:Ot.value}),jt.typeSource!=="unknown")continue;Kn(jt,"type",Bt?.type??Ot.type),Kn(jt,"typeSource",Bt?.source??"default"),As(Z,Le)}}var Op={collect:(Z)=>Z.pendingConstDefaultCandidates??[],resolve:Qd,apply:Zd};function ef(Z,ee,Le){return ee.map((Ot)=>{let Bt=Le.graph.resolve(Ot.importSource,Z);if(!Bt)return{candidate:Ot};let jt=yi(Bt,Ot,Le);if(jt?.kind!=="const"||jt.literalValue===void 0)return{candidate:Ot};return{candidate:Ot,key:jt.literalValue}})}function tf(Z,ee){for(let{candidate:Le,key:Ot}of ee){if(!Ot){let Lt=oe(Le);pi(Z,[a({component:Z.filePath,kind:"context-key-unresolved",name:Lt,message:`setContext key \`${Lt}\` from "${Le.importSource}" isn't an \`export const\` string or Symbol() sveld can read; the context is skipped.`,...Le.source?{source:Le.source}:{}})]);continue}let Bt=[...Z.contexts??[]],jt=Bt.findIndex((Lt)=>Lt.key===Ot);if(jt!==-1){let Lt=Bt[jt],Vt=Lp(Lt.source,Le.source),Wt=Vt?Lt.source:Le.source;if(pi(Z,[a({component:Z.filePath,kind:"context-duplicate-key",name:Ot,message:`setContext("${Ot}", ...) was called more than once; only the first call's shape is used.`,...Wt?{source:Wt}:{}})]),!Vt)continue;Bt.splice(jt,1)}let Gt=Bt.findIndex((Lt)=>Lp(Lt.source,Le.source));Bt.splice(Gt===-1?Bt.length:Gt,0,{key:Ot,typeName:J(Ot),...Le.type===void 0?{}:{type:Le.type},description:Le.description,properties:Le.properties,...Le.hasUnresolvedSpread?{hasUnresolvedSpread:!0}:{},...Le.internal?{internal:!0}:{},source:Le.source}),Z.contexts=Bt}}function Lp(Z,ee){if(!Z||!ee)return!1;let{line:Le,column:Ot}=Z.start;return Le>ee.start.line||Le===ee.start.line&&Ot>ee.start.column}var Mp={collect:(Z)=>Z.pendingContextKeyCandidates??[],resolve:ef,apply:tf};function nf(Z,ee,Le){return ee.map((Ot)=>{let Bt=Le.graph.resolve(Ot.importSource,Z);if(!Bt)return{candidate:Ot,failureReason:"module-not-found"};let jt=yi(Bt,Ot,Le)?.functionNode;if(!jt)return{candidate:Ot,failureReason:"not-a-function"};let Gt=sf(jt,Ot);if(!Gt)return{candidate:Ot,failureReason:"parameter-not-found"};return af(jt,Gt,Ot)})}function Fp(Z){return Z?.type==="AssignmentPattern"?Z.left:Z}function sf(Z,ee){let Le=Fp(Z.params[ee.argumentIndex]);if(ee.property===void 0)return Le?.type==="Identifier"?{name:Le.name}:void 0;if(!ee.property)return;if(Le?.type==="Identifier")return{object:Le.name,property:ee.property};if(Le?.type!=="ObjectPattern")return;for(let Ot of Le.properties){if(Ot.type!=="Property"||Ot.computed)continue;if(Ot.key.type!=="Identifier"||Ot.key.name!==ee.property)continue;let Bt=Fp(Ot.value);return Bt?.type==="Identifier"?{name:Bt.name}:void 0}return}function qr(Z){if(!Z)return null;if(Z.type==="ConditionalExpression"){let Le=qr(Z.consequent),Ot=qr(Z.alternate);return Le&&Ot?[...Le,...Ot]:null}let ee=C(Z);return ee?[ee]:null}var rf={variableType:()=>{return}};function of(Z){if(!Z)return"null";let{deriveLiteralDetailType:ee,literalDetailToTypeText:Le}=Nn();if(Z.type==="Literal")return Le(Z.value);return ee(rf,Z)??"any"}function Bp(Z,ee){if("name"in ee)return Z.type==="Identifier"&&Z.name===ee.name;if(Z.type!=="MemberExpression"||Z.computed)return!1;return Z.object.type==="Identifier"&&Z.object.name===ee.object&&Z.property.type==="Identifier"&&Z.property.name===ee.property}function af(Z,ee,Le){let Ot=new Map,Bt="name"in ee?ee.name:ee.object,jt;if(o(Z.body,{enter(Lt,Vt,Wt){if(Lt.type==="CallExpression"){if(!Bp(Lt.callee,ee))return;let Kt=Lt.arguments,qt=qr(Kt[0]);if(!qt)return jt="dynamic-event-name",E;for(let zt of qt){let Xt=Ot.get(zt)??new Set;Xt.add(of(Kt[1])),Ot.set(zt,Xt)}return}let Ut=Vt?.type==="CallExpression"&&Wt==="callee";if(Lt.type==="MemberExpression"&&Bp(Lt,ee)&&!Ut)return jt="passed-on",E;if(Lt.type!=="Identifier"||Lt.name!==Bt)return;if(Ut)return;if(!("name"in ee)&&Vt?.type==="MemberExpression"&&Wt==="object")return;if(!H(Lt,Vt))return;return jt="passed-on",E}}),jt)return{candidate:Le,failureReason:jt};let Gt=Array.from(Ot,([Lt,Vt])=>{let Wt=Array.from(Vt);return{name:Lt,detail:Wt.includes("any")?"any":Wt.join(" | ")}});return{candidate:Le,events:Gt}}function pf(Z,ee){let Le=Z.members?`"${Z.calleeText}"`:Z.importedName==="default"?"the default export":`"${Z.importedName}"`;switch(ee){case"module-not-found":return`"${Z.importSource}" isn't a local module sveld can read`;case"not-a-function":return`${Le} isn't a function declared in "${Z.importSource}"`;case"parameter-not-found":return`no parameter of ${Le} receives it`;case"dynamic-event-name":return"an event name isn't a string literal";case"passed-on":return`${Le} passes it on`}}function cf(Z,ee,{deferredEventNoSourceDiagnostics:Le=[],untypedJsDocEventNames:Ot=[]}){let Bt=new Map,jt=[...Z.diagnostics??[]],Gt=!0;for(let{candidate:zt,events:Xt,failureReason:Yt}of ee){if(Yt){Gt=!1,jt.push(a({component:Z.filePath,kind:"dispatch-escapes",name:zt.dispatcherName,message:`\`${zt.dispatcherName}\` is passed to \`${zt.calleeText}\`, but sveld couldn't read the events it dispatches: ${pf(zt,Yt)}. Document them with @event tags.`,...zt.source?{source:zt.source}:{},...zt.ignored?{ignored:!0}:{}}));continue}for(let Jt of Xt??[]){if(Bt.has(Jt.name))continue;Bt.set(Jt.name,{type:"dispatched",name:Jt.name,detail:Jt.detail,...zt.source?{source:zt.source}:{}})}}if(Gt){for(let zt of Le)if(!Bt.has(zt.name))jt.push(zt)}if(Z.diagnostics=jt,Bt.size===0)return;let Lt=new Map,Vt=new Set;for(let zt of Z.events)if(zt.type==="dispatched")Vt.add(zt.name);else if(!Lt.has(zt.name))Lt.set(zt.name,zt);let Wt=new Set(Ot),Ut=new Map,Kt=[];for(let zt of Bt.values()){if(Vt.has(zt.name)){if(Wt.has(zt.name)&&zt.detail!==void 0)Ut.set(zt.name,zt.detail);continue}let Xt=Lt.get(zt.name);if(!Xt){Kt.push(zt);continue}let Yt=zt.source??Xt.source;Kt.push({type:"dispatched",name:zt.name,detail:Xt.detail??zt.detail,...Xt.description?{description:Xt.description}:{},...Xt.deprecated===void 0?{}:{deprecated:Xt.deprecated},...Xt.tags?{tags:Xt.tags}:{},...Xt.internal?{internal:!0}:{},...Yt?{source:Yt}:{}})}if(Kt.length===0&&Ut.size===0)return;let qt=new Set(Kt.map((zt)=>zt.name));Z.events=[...Z.events.filter((zt)=>zt.type==="dispatched"||!qt.has(zt.name)).map((zt)=>{let Xt=zt.type==="dispatched"?Ut.get(zt.name):void 0;return Xt===void 0?zt:{...zt,detail:Xt}}),...Kt].sort(he)}var jp={collect:(Z)=>Z.pendingDispatchEscapeCandidates??[],resolve:nf,apply:cf};function Ps(Z){return(ee)=>{let Le=Z.collect(ee);if(Le.length===0)return;return(Ot,Bt,jt)=>Z.apply(Ot,Z.resolve(Bt,Le,jt),ee)}}var uf=[Ps(Ip),Ps(Op),Ps(Mp),Ps(jp)];async function Vp(Z,ee,Le,Ot){let Bt=[];for(let Gt of Z){let Lt=Le(Gt);if(Lt===void 0)continue;let Vt=uf.flatMap((Wt)=>Wt(Lt)??[]);if(Vt.length>0)Bt.push({component:Gt,passes:Vt})}let jt=new Map;if(Bt.length===0)return jt;await Un();for(let{component:Gt,passes:Lt}of Bt){let Vt=ws(Ot),Wt=lf(ee(Gt.filePath));for(let Ut of Lt)Ut(Gt,Wt,Vt);jt.set(Gt.filePath,Array.from(Vt.cache.keys()))}return jt}var hf=/^```([\w-]*)\r?\n([\s\S]*?)\r?\n?```$/,df=new Set(["","js","jsx","ts","tsx","javascript","typescript"]),ff=new Set(["svelte","html"]);function mf(Z){let ee=Z.trim();if(ee==="")return null;let Le=ee.match(hf);if(Le){let Ot=Le[1].toLowerCase(),Bt=Le[2].trim();if(Bt==="")return null;if(df.has(Ot))return{kind:"compile",code:Bt};if(ff.has(Ot))return{kind:"syntax",code:Bt};return null}if(ee.startsWith("<"))return null;return{kind:"compile",code:ee}}function Gp(Z){if(!Z.isFunction)return"any";return`(${(Z.params??[]).map((Le)=>`${Le.name}${Le.optional?"?":""}: any`).join(", ")}) => any`}function _s(Z,ee,Le,Ot,Bt){let jt=(Z??[]).filter((Lt)=>Lt.name==="example"),Gt=jt.length>1;return jt.flatMap((Lt,Vt)=>{let Wt=mf(Lt.body);if(Wt===null)return[];return[{id:Gt?`${ee}#${Vt}`:ee,name:Gt?`${Le} (example ${Vt+1})`:Le,type:Ot,code:Wt.code,kind:Wt.kind,...Bt?{source:Bt}:{}}]})}function gf(Z){let ee=[];for(let Le of Z.props)ee.push(..._s(Le.tags,`prop:${Le.name}`,Le.name,Gp(Le),Le.source));for(let Le of Z.moduleExports)ee.push(..._s(Le.tags,`export:${Le.name}`,Le.name,Gp(Le),Le.source));for(let Le of Z.slots){let Ot=Le.name??"default";ee.push(..._s(Le.tags,`slot:${Ot}`,Ot,"any",Le.source))}for(let Le of Z.events)ee.push(..._s(Le.tags,`event:${Le.name}`,Le.name,"any",Le.source));return ee}function Wp(Z,ee){return Z.flatMap(({component:Le,sources:Ot})=>{let Bt=Ot.filter((jt)=>jt.kind===ee);return Bt.length===0?[]:[{component:Le,sources:Bt}]})}async function yf(Z){let{formatParseError:ee,parseSvelte:Le}=await Un(),Ot=new Map;for(let{component:Bt,sources:jt}of Z){let Gt=[];for(let Lt of jt)try{Le(Lt.code)}catch(Vt){Gt.push(a({component:Bt.filePath,kind:"example-syntax-error",name:Lt.name,message:ee(Vt),...Lt.source?{source:Lt.source}:{}}))}Ot.set(Bt,Gt)}return Ot}async function xf(Z,ee,Le){let Ot=await ee.checkExamples(Z.map(({component:jt,sources:Gt})=>({moduleName:jt.moduleName,filePath:Le(jt.filePath),sources:Gt}))),Bt=new Map;for(let{component:jt,sources:Gt}of Z){let Lt=Ot.get(Le(jt.filePath));if(!Lt||Lt.length===0)continue;let Vt=new Map(Gt.map((Wt)=>[Wt.id,Wt.source]));Bt.set(jt,Lt.map((Wt)=>{let Ut=Vt.get(Wt.id);return a({component:jt.filePath,kind:"example-compile-error",name:Wt.name,message:Wt.message,...Ut?{source:Ut}:{}})}))}return Bt}async function Up(Z,ee,Le,Ot){let Bt=Array.from(Z,(Wt)=>({component:Wt,sources:gf(Wt)})),jt=ee===!0?Wp(Bt,"compile"):[],Gt=Wp(Bt,"syntax"),Lt=new Map,Vt=(Wt)=>{for(let[Ut,Kt]of Wt)Lt.set(Ut,[...Lt.get(Ut)??[],...Kt])};if(Gt.length>0)Vt(await yf(Gt));if(jt.length>0){let{TypeResolver:Wt}=await import("./chunk-qb2pq69t.js"),Ut=await Wt.create(Le);if(!Ut.ok)throw Error(`sveld: \`checkExamples\` ${Ut.message}.`);let Kt=Ut.resolver;try{Vt(await xf(jt,Kt,Ot))}finally{await Kt.dispose()}}return Lt}import{hash as vf}from"node:crypto";import{mkdirSync as Ef,readFileSync as Sf,renameSync as Cf,writeFileSync as Hp}from"node:fs";import{dirname as Kp,isAbsolute as bf,join as wf,resolve as zr}from"node:path";var qp=11,Tf=wf("node_modules",".cache","sveld","parse-cache.json"),kf="8a8771408449b599";function zp(){return`${hs}+${kf}+svelte@${$i}`}function Af(Z){let ee=V(Z,["package.json"]);return ee===null?zr(Z):Kp(ee)}function Xp(Z,ee){let Le=Af(Z);if(typeof ee==="string")return bf(ee)?ee:zr(Le,ee);return zr(Le,Tf)}function $s(Z){return vf("sha256",Z,"hex")}function Xr(){return{formatVersion:qp,toolchainVersion:zp(),entries:{}}}function Pf(Z){try{let ee=JSON.parse(Sf(Z,"utf-8"));if(ee.formatVersion!==qp||ee.toolchainVersion!==zp())return Xr();return ee}catch{return Xr()}}class Jr{cacheFilePath;file;next=new Map;dirty=!1;savedEntryCount;constructor(Z){this.cacheFilePath=Z,this.file=Pf(Z),this.savedEntryCount=Object.keys(this.file.entries).length}has(Z,ee){return this.lookup(Z,ee)!==void 0}lookup(Z,ee){let Le=this.next.get(Z);if(Le?.hash===ee)return Le;let Ot=this.file.entries[Z];return Ot?.hash===ee?Ot:void 0}get(Z,ee){let Le=this.lookup(Z,ee);if(Le===void 0)return null;this.next.set(Z,Le);let{component:Ot,typeScriptMetadata:Bt,propIgnores:jt,pending:Gt}=structuredClone({component:Le.component,typeScriptMetadata:Le.typeScriptMetadata,propIgnores:Le.propIgnores,pending:Le.pending});if(Bt!==void 0)Ot[x]=Bt;if(jt!==void 0)Ot[I]=jt;return Gt===void 0?{component:Ot}:{component:Ot,pending:Gt}}set(Z,ee,{component:Le,pending:Ot}){this.dirty=!0,this.next.set(Z,{hash:ee,...structuredClone({component:Le,typeScriptMetadata:Le[x],propIgnores:Le[I],pending:Ot})})}getGeneratedText(Z,ee){let Le=this.next.get(Z);if(Le?.generatedText===void 0||Le.generatedText.key!==ee)return;return Le.generatedText.text}setGeneratedText(Z,ee,Le){let Ot=this.next.get(Z);if(Ot===void 0)return;if(Ot.generatedText?.key===ee&&Ot.generatedText.text===Le)return;Ot.generatedText={key:ee,text:Le},this.dirty=!0}save(){if(!this.dirty&&this.next.size===this.savedEntryCount)return;this.dirty=!1,this.savedEntryCount=this.next.size,Ef(Kp(this.cacheFilePath),{recursive:!0});let Z={...Xr(),entries:Object.fromEntries(this.next)},ee=JSON.stringify(Z),Le=`${this.cacheFilePath}.${process.pid}.tmp`;try{Hp(Le,ee),Cf(Le,this.cacheFilePath)}catch{try{Hp(this.cacheFilePath,ee)}catch{}}}}import{dirname as _f,relative as $f,resolve as Nf}from"node:path";async function Jp(Z,ee={}){await Un();let Le=Nf(Z),Ot=_f(Le),Bt=(Lt)=>n(`./${$f(Ot,Lt)}`),jt=Ts(Le,{...ws(ee.graph??new Hn),onAmbiguousStarExport:(Lt,Vt,Wt)=>{if(Lt!==Le||!ee.diagnostics)return;if(Wt.every((zt)=>zt.declFile.endsWith(".svelte")))return;let Ut=Array.from(new Set(Wt.map((zt)=>Bt(zt.declFile)))),Kt=Ut.map((zt)=>`"${zt}"`),qt=`${Kt.slice(0,-1).join(", ")} and ${Kt[Kt.length-1]}`;ee.diagnostics.push(a({component:Bt(Le),kind:"export-ambiguous",name:Vt,message:`"${Vt}" is exported by ${qt} through \`export *\`, so the barrel doesn't export it and the docs leave it out; export it explicitly from the barrel (e.g. \`export { ${Vt} } from "${Ut[0]}"\`).`}))}}),Gt=new Map;for(let Lt of jt){if(Lt.name==="default"||Lt.declFile.endsWith(".svelte"))continue;let{declFile:Vt,returnType:Wt,literalValue:Ut,primitiveLiteral:Kt,declaredType:qt,functionNode:zt,namespaceFile:Xt,...Yt}=Lt,Jt=Bt(Vt);if(Xt!==void 0)Yt.type=`typeof import(${JSON.stringify(Bt(Xt))})`;Gt.set(Lt.name,{...Yt,source:Jt})}return Array.from(Gt.values()).sort((Lt,Vt)=>u(Lt.name,Vt.name))}async function If(Z){let ee=await Promise.all(Array.from(Z,async(Le)=>{try{return[Le,await Rf(Le,"utf-8")]}catch(Ot){return console.warn(`Warning: Failed to read file ${Le}:`,Ot),[Le,null]}}));return new Map(ee)}function Qp(Z){if(Z.length===0)return;console.error(`sveld: failed to parse ${Z.length} component(s):`);for(let{filePath:ee,message:Le}of Z)console.error(` - ${ee}: ${Le}`)}class Fi{input;glob;options;graph=new Hn;collected;entryFile=null;globMergeState;cache;entryExports=[];entryDiagnostics=[];records=new Map;parseErrors=new Map;canonicalEntries=new Map;warnedModuleNames=new Set;constructor(Z,ee,Le={}){this.input=Z,this.glob=ee,this.options=Le}get documentExports(){return this.options.documentExports===!0}async build(){return this.graph=new Hn,this.collected=Ur(this.input,this.glob,this.documentExports,this.graph),this.globMergeState=bs(this.collected.allComponentEntries,this.collected.resolveComponentFilePath),this.entryFile=Df(this.input).isFile()?Yp(this.input):null,this.cache=this.options.cache===!1?void 0:new Jr(Xp(this.collected.rootDir,this.options.cache??!0)),await this.readEntryExports(),this.records.clear(),this.parseErrors.clear(),this.indexEntries(),await this.process(this.componentPaths()),Qp(Array.from(this.parseErrors.values())),this.assemble()}async update(Z){let ee=Z.map((Wt)=>Yp(Wt));if(this.graph.invalidate(...ee),ee.length===0)return{result:this.assemble(),reparsed:[]};let Le=this.entryFile!==null&&ee.includes(this.entryFile)?await this.recollect():[];if(this.glob){let{rootDir:Wt,exports:Ut,allComponentEntries:Kt,resolveComponentFilePath:qt}=this.collected;Wr(this.graph,Wt,Ut,Kt,qt,this.globMergeState)}this.indexEntries();let Ot=this.componentPaths();for(let Wt of this.records.keys())if(!Ot.has(Wt))this.records.delete(Wt);for(let Wt of this.parseErrors.keys())if(!Ot.has(Wt))this.parseErrors.delete(Wt);let Bt=Array.from(this.records).flatMap(([Wt,{crossFileReads:Ut}])=>Ut?.some((Kt)=>ee.includes(Kt))?[Wt]:[]),jt=new Set([...ee.filter((Wt)=>Pn.test(Wt)),...Le,...Bt]),Gt=new Set(Array.from(Ot).filter((Wt)=>jt.has(Wt))),Lt=await this.process(Gt),Vt=this.assemble();return Qp(Vt.errors),{result:Vt,reparsed:Lt}}async recollect(){let Z=this.collected,ee=Ur(this.input,this.glob,this.documentExports,this.graph),Le=[];for(let[Ot,Bt]of Object.entries(ee.exports)){let jt=ee.resolveComponentFilePath(Bt.source),Gt=Object.hasOwn(Z.exports,Ot)?Z.exports[Ot]:void 0;if(Gt===void 0||Z.resolveComponentFilePath(Gt.source)!==jt)Le.push(jt)}return this.collected=ee,this.globMergeState=bs(ee.allComponentEntries,ee.resolveComponentFilePath),await this.readEntryExports(),Le}async readEntryExports(){this.entryDiagnostics=[],this.entryExports=this.documentExports&&this.entryFile!==null?await Jp(this.entryFile,{diagnostics:this.entryDiagnostics,graph:this.graph}):[]}componentPaths(){let{exports:Z,allComponentEntries:ee,resolveComponentFilePath:Le}=this.collected,Ot=new Set;for(let[,Bt]of[...Object.entries(Z),...ee])if(di(Bt.source))Ot.add(Le(Bt.source));return Ot}indexEntries(){let{exports:Z,allComponentEntries:ee,resolveComponentFilePath:Le}=this.collected;this.canonicalEntries=new Map;for(let Ot of[Object.entries(Z),ee])for(let Bt of Ot){if(!di(Bt[1].source))continue;this.canonicalEntries.set(Le(Bt[1].source),this.entryIdentity(Ot,Bt))}}entryIdentity(Z,[ee,{source:Le}]){return{moduleName:Pp(ee,Le,Z.length,this.warnedModuleNames),filePath:n(Le)}}canonicalEntry(Z){let ee=this.canonicalEntries.get(Z);if(ee===void 0)throw Error(`sveld: no entry lists ${Z}.`);return ee}async process(Z){let ee=new Map,Le=await this.parse(Z,ee);this.cache?.save();let Ot=await this.settle(Le);for(let Bt of Z)this.records.delete(Bt),this.parseErrors.delete(Bt);for(let[Bt,jt]of Ot)this.records.set(Bt,jt);for(let[Bt,jt]of ee)this.parseErrors.set(Bt,jt);return Array.from(Ot.keys())}async parse(Z,ee){let Le=await If(Z),Ot=this.cache,Bt=new Map,jt=new Set;if(Ot)for(let[Lt,Vt]of Le){if(Vt===null)continue;let Wt=$s(Vt);if(Bt.set(Lt,Wt),!Ot.has(Lt,Wt))jt.add(Lt)}if(Z.size>0&&(!Ot||jt.size>0))await Un();let Gt=new Map;for(let Lt of Z){let Vt=Le.get(Lt);if(Vt===null||Vt===void 0)continue;let Wt=this.parseOne(Lt,Vt,Bt.get(Lt),ee);if(Wt)Gt.set(Lt,Wt)}return Gt}parseOne(Z,ee,Le,Ot){let Bt=Le===void 0?null:this.cache?.get(Z,Le);if(Bt)return Bt;let{moduleName:jt,filePath:Gt}=this.canonicalEntry(Z),Lt;try{Lt=new(Nn()).ComponentParser().parse(ee,{moduleName:jt,filePath:Gt})}catch(Vt){if(this.options.failFast)throw Vt;Ot.set(Z,{filePath:Gt,moduleName:jt,message:Vt instanceof Error?Vt.message:String(Vt),stack:Vt instanceof Error?Vt.stack:void 0});return}if(Le!==void 0)this.cache?.set(Z,Le,Lt);return Lt}async settle(Z){let{rootDir:ee,resolveComponentFilePath:Le}=this.collected,Ot=new Map,Bt=new Map;for(let[Vt,{component:Wt,pending:Ut}]of Z){let Kt={...this.canonicalEntry(Vt),...Wt};Ot.set(Vt,Kt),Bt.set(Kt,Ut)}let{checkExamples:jt}=this.options;if(jt){let Vt=await Up(Ot.values(),jt,ee,Le);for(let[Wt,Ut]of Vt)pi(Wt,Ut)}let Gt=await Vp(Ot.values(),Le,(Vt)=>Bt.get(Vt),this.graph),Lt=new Map;for(let[Vt,Wt]of Ot){let{moduleName:Ut,filePath:Kt,...qt}=Wt,zt=Gt.get(Kt);Lt.set(Vt,zt===void 0?{component:qt}:{component:qt,crossFileReads:zt})}return Lt}assemble(){let{exports:Z,allComponentEntries:ee,resolveComponentFilePath:Le}=this.collected,Ot=this.cache,Bt=(Kt,qt)=>{let{source:zt}=qt[1];if(!di(zt))return;let Xt=this.records.get(Le(zt));if(Xt===void 0)return;return{component:{...this.entryIdentity(Kt,qt),...Xt.component},record:Xt}},jt=new Map,Gt=Ot?new Map:void 0,Lt=Ot?new Map:void 0;for(let Kt of ee){let qt=Bt(ee,Kt);if(qt===void 0)continue;let{filePath:zt}=qt.component;jt.set(zt,qt.component),(qt.record.crossFileReads===void 0?Gt:Lt)?.set(zt,Le(Kt[1].source))}let Vt=ap(jt,Le,this.graph);for(let Kt of jt.values())pi(Kt,[...Vt(Kt),...op(Kt)]);let Wt=new Map,Ut=Object.entries(Z);for(let Kt of Ut){let qt=Bt(Ut,Kt);if(qt===void 0)continue;let zt=jt.get(qt.component.filePath);if(zt)qt.component.diagnostics=zt.diagnostics;Wt.set(qt.component.moduleName,qt.component)}return{exports:Z,entryExports:this.entryExports,components:Wt,allComponentsForTypes:jt,errors:Array.from(this.parseErrors.values()),diagnostics:wo(ko([...Array.from(jt.values()).flatMap((Kt)=>Kt.diagnostics??[]),...this.entryDiagnostics]),this.options.diagnostics?.ignore),cache:Ot,resolvedPathByFilePath:Gt,crossFileResolvedPathByFilePath:Lt}}}function Bi(Z){return{failFast:Z?.failFast,documentExports:Z?.documentExports===!0,cache:Z?.cache,checkExamples:Z?.checkExamples==="syntax"?"syntax":Z?.checkExamples===!0,diagnostics:Z?.diagnostics}}async function ji(Z,ee,Le={}){return new Fi(Z,ee,Le).build()}import{existsSync as Yr,readFileSync as Of}from"node:fs";import{isAbsolute as Lf,join as ec}from"node:path";var Vi='sveld: could not resolve a Svelte entry point. Set package.json#svelte, or pass the "entry" option.';function Zp(Z){return Lf(Z)?Z:ec(process.cwd(),Z)}function Re(Z){if(Z){let Bt=Zp(Z);if(Yr(Bt))return{entry:Q(Z)};return{entry:null,configured:!0,message:`Invalid entry point: ${Bt}. Pass a valid --entry (or "entry" option), or unset it and set the "svelte" field in your package.json instead.`}}let ee=ec(process.cwd(),"package.json");if(!Yr(ee))return{entry:null,configured:!1,message:'Could not locate a package.json file. Specify an entry point with --entry (or the "entry" option).'};let Le;try{Le=dp(JSON.parse(Of(ee,"utf-8")))}catch(Bt){throw console.error("Error reading package.json:",Bt),Bt}let Ot=Le.svelte?.trim();if(!Ot)return{entry:null,configured:!1,message:'Could not determine an entry point. Set the "svelte" field in your package.json, or pass --entry (or the "entry" option).'};if(!Yr(Zp(Ot)))return{entry:null,configured:!0,message:`The "svelte" field in package.json points to "${Ot}", which does not exist.`};return{entry:Q(Ot)}}function Ns(Z){let ee=Re(Z);if(ee.entry===null)console.error(ee.message);return ee.entry}async function tc(Z,ee,Le={}){let Ot=new Fi(Z,ee,{...Le,failFast:!1}),Bt=await Ot.build();return{get result(){return Promise.resolve(Bt)},async update(jt){let Gt=await Ot.update(jt);return Bt=Gt.result,Gt}}}import Zr from"node:path";function nc(Z){let ee=new Map,Le=[];for(let[Ot,Bt]of Object.entries(Z)){if(Bt.star){Le.push(`export * from "${Bt.source}";`);continue}let jt=ee.get(Bt.source)??[];jt.push({id:Ot,exportee:Bt}),ee.set(Bt.source,jt)}for(let[Ot,Bt]of ee){let jt=Pn.test(Ot),Gt=Bt.some(({id:qt,exportee:zt})=>qt!=="default"&&zt.default),Lt=Bt.some(({exportee:qt})=>!qt.default),Vt=jt&&Gt&&Lt,Wt=[],Ut=[],Kt=[];for(let{id:qt,exportee:zt}of Bt){if(qt==="default"){Ut.push(`export { default } from "${Ot}";`);continue}if(zt.default)if(zt.mixed)Ut.push(`export { default as ${qt} } from "${Ot}";`),Ut.push(`export { default } from "${Ot}";`);else Kt.push(`default as ${qt}`);else if(jt&&!Vt)Kt.push(`default as ${qt}`);else Wt.push(qt)}if(Kt.length>0&&Wt.length>0)Le.push(`export { ${[...Kt,...Wt].join(", ")} } from "${Ot}";`);else{if(Wt.length>0)Le.push(`export { ${Wt.join(", ")} } from "${Ot}";`);if(Kt.length>0)Le.push(`export { ${Kt.join(", ")} } from "${Ot}";`)}Le.push(...Ut)}return Le.join(`
140
- `)}function ic(Z){return Z.filter((ee)=>ee.names.length>0).map((ee)=>`export type { ${ee.names.join(", ")} } from "${ee.source}";`).join(`
141
- `)}function sc(Z){return Z.replace(Pn,"")}function Qr(Z){return Z.replace(Pn,".svelte.d.ts")}import{mkdir as Mf,readFile as Ff,writeFile as Bf}from"node:fs/promises";import{parse as jf}from"node:path";class In{ensuredDirs=new Set;async write(Z,ee){try{if(await Ff(Z,"utf-8")===ee)return!1}catch{}let Le=jf(Z).dir;if(!this.ensuredDirs.has(Le))await Mf(Le,{recursive:!0}),this.ensuredDirs.add(Le);return await Bf(Z,ee),!0}}function Vf(Z){return r(Z)&&!Array.isArray(Z)&&"start"in Z&&"end"in Z}function eo(Z){if(Array.isArray(Z))return Z.map((ee)=>eo(ee));if(r(Z)){let ee={};for(let[Le,Ot]of Object.entries(Z)){if((Le==="source"||Le==="componentCommentSource")&&Vf(Ot))continue;ee[Le]=eo(Ot)}return ee}return Z}function Gf(Z,ee,Le){if(!ee)return`${Z.moduleName}.api.json`;if(!Le.has(Z.moduleName))Le.add(Z.moduleName),console.warn(`Warning: multiple components named "${Z.moduleName}" found. Their JSON files are keyed by source path instead of name to avoid overwriting each other.`);return`${sc(Z.filePath)}.api.json`}async function Wf(Z,ee,Le){let Ot=Ds(Z,{inputDir:ee.inputDir,source:ee.source}).components,Bt=new Map;for(let Lt of Ot)Bt.set(Lt.moduleName,(Bt.get(Lt.moduleName)??0)+1);let jt=new Set,Gt=new In;await Promise.all(Ot.map(async(Lt)=>{let Vt=(Bt.get(Lt.moduleName)??0)>1,Wt=Gf(Lt,Vt,jt),Ut=Zr.resolve(Zr.join(Le,Wt)),Kt=await Gt.write(Ut,_i(Lt));Fn(`${Kt?"created":"unchanged"} "${Ut}".`)}))}function Ds(Z,ee){let Le=g(Z,{entryExports:ee.entryExports}),Ot={...Le,components:Le.components.map((Bt)=>({...Bt,filePath:ya(Bt.filePath,ee.inputDir)}))};return ee.source===!1?eo(Ot):Ot}function to(Z,ee){return _i(Ds(Z,ee))}async function no(Z,ee){if(ee.outDir){await Wf(Z,ee,ee.outDir);return}let Le=await new In().write(Zr.resolve(ee.outFile),to(Z,ee));Fn(`${Le?"created":"unchanged"} "${ee.outFile}".`)}import{join as wc,resolve as co}from"node:path";var rc=/`/g,oc=/\s+/g,qn="--",ac=`| Prop name | Required | Kind | Reactive | Binding | Type | Default value | Description |
142
- | :- | :- | :- | :- | :- | :- | :- | :- |
143
- `,pc=`| Slot name | Default | Props | Fallback | Description |
144
- | :- | :- | :- | :- | :- |
145
- `,cc=`| Event name | Type | Detail | Description |
146
- | :- | :- | :- | :- |
147
- `,io=`| Name | Kind | Type | Description |
148
- | :- | :- | :- | :- |
149
- `,Uf=`| Member | Signature | Description |
150
- | :- | :- | :- |
151
- `,lc=`| Part name | Description |
152
- | :- | :- |
153
- `,uc=`| Property name | Type | Default value | Description |
154
- | :- | :- | :- | :- |
155
- `,hc=/\|/g,Hf=/</g,Kf=/>/g,Rs=/\n/g,qf=/^[A-Za-z_$][\w$]*$/,zf=/\s*\n\s*/g,Xf=/&(?=#?\w+;)|<(?=[A-Za-z/!?])|[|`*]|\\(?=[!-/:-@[-`{-~])|(?<![A-Za-z0-9])_|_(?![A-Za-z0-9])/g,Jf=/[&<|`*\\_]/;function so(Z){if(!Jf.test(Z))return Z;return Z.replace(Xf,(ee)=>ee==="&"?"&amp;":ee==="<"?"&lt;":ee==="_"?"&#95;":`&#${ee.charCodeAt(0)};`)}function Yf(Z){return`<code>${so(Z.includes(`
156
- `)?Z.replace(zf," "):Z)}</code>`}var Qf=/\{@link\s+([^{}\s|]+)(?:\|([^{}]+))?\}/g;function Zf(Z){if(!Z.includes("{@link"))return Z;return Z.replace(Qf,(ee,Le,Ot)=>`[${Ot===void 0?Le:Ot.trim()}](${Le})`)}function em(Z){return Z.includes("```")||Z.includes("~~~")}function tm(Z){return gc(Zf(Z))}var nm=/^([ \t]*)(`{3,}|~{3,})(.*)$/,im=/^\n/,sm=/\n$/;function dc(Z){let ee=(jt)=>({kind:"prose",text:tm(jt.join(`
157
- `))});if(!em(Z))return[ee([Z])];let Le=Z.split(`
158
- `),Ot=[],Bt=[];for(let jt=0;jt<Le.length;jt++){let Gt=nm.exec(Le[jt]),[,Lt="",Vt="",Wt=""]=Gt??[];if(!Gt||Vt[0]==="`"&&Wt.includes("`")){Bt.push(Le[jt]);continue}if(Bt.push(""),Bt.length>1)Ot.push(ee(Bt));let Ut=[],Kt=new RegExp(`^[ \\t]*${Vt[0]}{${Vt.length},}[ \\t]*$`);for(jt++;jt<Le.length&&!Kt.test(Le[jt]);jt++){let qt=Le[jt],zt=0;while(zt<Lt.length&&(qt[zt]===" "||qt[zt]==="\t"))zt++;Ut.push(qt.slice(zt))}Ot.push({kind:"code",code:Ut.join(`
159
- `)}),Bt=[""]}if(Bt.length>1||Ot.length===0)Ot.push(ee(Bt));return Ot}function fc(Z){let ee="";for(let Le=0;Le<Z.length;Le++){let Ot=Z[Le];if(Ot.kind==="code"){ee+=`<pre><code>${so(Ot.code).replace(Rs,"<br />")}</code></pre>`;continue}let Bt=Ot.text;if(Z[Le-1]?.kind==="code")Bt=Bt.replace(im,"");if(Z[Le+1]?.kind==="code")Bt=Bt.replace(sm,"");ee+=Bt.replace(hc,"&#124;").replace(Rs,"<br />")}return ee}function Sn(Z){if(Z===void 0)return qn;return Yf(Z)}function mc(Z){if(!Z.reExport)return Sn(Z.type);let{from:ee,imported:Le}=Z.reExport,Ot=Le==="*"?"":qf.test(Le)?`.${Le}`:`[${JSON.stringify(Le)}]`;return Sn(`typeof import(${JSON.stringify(ee)})${Ot}`)}function gc(Z){if(!Z.includes("<")&&!Z.includes(">"))return Z;return Z.replace(Hf,"&lt;").replace(Kf,"&gt;")}function ii(Z,ee){if(ee===void 0)return Z;let Le=typeof ee==="string"&&ee.trim().length>0?`: ${gc(ee).replace(Rs," ").replace(hc,"&#124;")}`:"";return`<s>${Z}</s><br />**Deprecated**${Le}`}function Is(Z){if(Z===void 0||Z.trim().length===0)return qn;return fc(dc(Z))}function yc(Z){if(Z===void 0||Z==="{}"||Z==="Record<string, never>")return qn;return Sn(Z.trim())}function xc(Z){if(Z===void 0)return qn;return`<code>${so(Z).replace(Rs,"<br />")}</code>`}function xi(Z,ee){let Le=[],Ot=(jt)=>{let Gt=Le.at(-1);if(Gt?.kind==="prose")Gt.text+=jt;else Le.push({kind:"prose",text:jt})},Bt=(jt,Gt)=>{if(Le.length>0)Ot(`
160
- `);if(jt)Ot(jt);for(let Lt of dc(Gt))if(Lt.kind==="prose")Ot(Lt.text);else Le.push(Lt)};if(Z?.trim())Bt("",Z);for(let{name:jt,body:Gt}of ee??[]){let Lt=Gt?.trim();Bt(Lt?`@${jt} `:`@${jt}`,Lt??"")}if(Le.length===0)return qn;return fc(Le)}function vc(Z){return Sn(Z)}function rm(Z){let ee=[Z.extends?`Extends ${Sn(Z.extends)}.`:"",Z.implements?.length?`Implements ${Z.implements.map((Le)=>Sn(Le)).join(", ")}.`:""].filter(Boolean);return ee.length>0?ee.join(" "):void 0}function Ec(Z,ee){let Le=new Set;for(let Ot of ee){if(Ot.kind!=="class")continue;let Bt=rm(Ot);if(!Ot.members?.length&&!Bt)continue;let jt=Ot.localName??Ot.name;if(Le.has(jt))continue;if(Le.add(jt),Z.append("h4",`\`${jt}\` members`),Bt)Z.append("raw",`${Bt}
161
-
162
- `);if(!Ot.members?.length)continue;Z.append("raw",Uf);for(let Gt of Ot.members)Z.append("raw",`| ${ii(Gt.name,Gt.deprecated)} | ${Sn($r(Gt))} | ${xi(Gt.description,Gt.tags)} |
163
- `);Z.append("raw",`
164
- `)}}function Sc(Z,ee,Le){if(Z.append("h1","Component Index"),Z.append("h2","Components").tableOfContents(),Z.append("divider"),Le&&Le.length>0)bc(Z,Le);for(let Ot of g(ee).components)oo(Z,Ot)}function Cc(Z,ee,Le){Z.append("h1","Component Index"),Z.append("h2","Components");for(let Ot of ee)Z.append("raw",`- [${Ot.moduleName}](./${Ot.moduleName}.md)
165
- `);if(Z.append("raw",`
166
- `),Z.append("divider"),Le&&Le.length>0)bc(Z,Le)}function bc(Z,ee){Z.append("h2","Exports"),Z.append("raw",io);for(let Le of ee){let Ot=(Le.type??Le.value)?.replace(oc," ").trim();Z.append("raw",`| ${ii(Le.name,Le.deprecated)} | <code>${Le.kind}</code> | ${Sn(Ot)} | ${Is(Le.description)} |
167
- `)}Z.append("raw",`
168
- `),Z.append("divider")}function om(Z,ee){Z.append("h3","Module exports"),Z.append("raw",io);for(let Le of ee)Z.append("raw",`| ${ii(Le.name,Le.deprecated)} | <code>${Le.kind}</code> | ${mc(Le)} | ${xi(Le.description,Le.tags)} |
169
- `);Z.append("raw",`
170
- `),Ec(Z,ee)}function ro(Z,ee,Le){if(ee.length>0)Le(),Z.append("raw",`
171
- `);else Z.append("p","None.")}function oo(Z,ee){if(Z.append("h2",`\`${ee.moduleName}\``),ee.generics)Z.append("p",`**Type parameters:** ${Sn(`<${ee.generics[1]}>`)}`);if(ee.typedefs.length>0)Z.append("h3","Types").append("raw",`\`\`\`ts
172
- ${Es({typedefs:ee.typedefs})}
173
- \`\`\`
174
-
175
- `);if(Z.append("h3","Props"),ro(Z,ee.props,()=>{Z.append("raw",ac);let Le=(Bt)=>Bt.reactive?0:Bt.constant?2:1,Ot=ee.props.map((Bt,jt)=>({prop:Bt,index:jt})).sort((Bt,jt)=>Le(Bt.prop)-Le(jt.prop)||Bt.index-jt.index).map(({prop:Bt})=>Bt);for(let Bt of Ot){let jt=Ss(Bt)?"accessor":Bt.kind;Z.append("raw",`| ${ii(Bt.name,Bt.deprecated)} | ${Bt.isRequired?"Yes":"No"} | <code>${jt}</code> | ${Bt.reactive?"Yes":"No"} | ${Bt.binding??"--"} | ${Sn(Bt.type)} | ${Sn(Bt.value)} | ${xi(Bt.description,Bt.tags)} |
176
- `)}}),ee.moduleExports.length>0)om(Z,ee.moduleExports);if(Z.append("h3","Slots"),ro(Z,ee.slots,()=>{Z.append("raw",pc);for(let Le of ee.slots)Z.append("raw",`| ${ii(Le.default?qn:Le.name??qn,Le.deprecated)} | ${Le.default?"Yes":"No"} | ${yc(Le.slot_props)} | ${xc(Le.fallback)} | ${xi(Le.description,Le.tags)} |
177
- `)}),Z.append("h3","Events"),ro(Z,ee.events,()=>{Z.append("raw",cc);for(let Le of ee.events)Z.append("raw",`| ${ii(Le.name,Le.deprecated)} | ${Le.type} | ${vc(Le.detail)} | ${xi(Le.description,Le.tags)} |
178
- `)}),ee.cssParts&&ee.cssParts.length>0){Z.append("h3","CSS Parts"),Z.append("raw",lc);for(let Le of ee.cssParts)Z.append("raw",`| ${Le.name} | ${Is(Le.description)} |
179
- `);Z.append("raw",`
180
- `)}if(ee.cssProperties&&ee.cssProperties.length>0){Z.append("h3","CSS Custom Properties"),Z.append("raw",uc);for(let Le of ee.cssProperties)Z.append("raw",`| ${Le.name} | ${Sn(Le.type)} | ${Sn(Le.default)} | ${Is(Le.description)} |
181
- `);Z.append("raw",`
182
- `)}}var am=/[^\w\- ]+/g,pm=/\s+/g,ao="<!-- __TOC__ -->";function cm(Z,ee){let Le=Z.toLowerCase().replace(rc,"").replace(am,"").replace(pm,"-"),Ot=ee.get(Le)??0;return ee.set(Le,Ot+1),Ot===0?Le:`${Le}-${Ot}`}class po{sourceParts=[];hasToC=!1;toc=[];onAppend;constructor(Z={}){this.onAppend=Z.onAppend}get source(){return this.sourceParts.join("")}appendLineBreaks(){return this.sourceParts.push(`
183
-
184
- `),this}append(Z,ee){switch(Z){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":{if(this.sourceParts.push(`${"#".repeat(Number(Z.slice(-1)))} ${ee}`),this.hasToC&&Z==="h2")this.toc.push({indent:0,raw:ee??""});break}case"quote":this.sourceParts.push(`> ${ee}`);break;case"p":this.sourceParts.push(ee??"");break;case"divider":this.sourceParts.push("---");break;case"raw":this.sourceParts.push(ee??"");break}if(Z!=="raw")this.appendLineBreaks();return this.onAppend?.call(this,Z,this),this}tableOfContents(){return this.sourceParts.push(ao),this.hasToC=!0,this.appendLineBreaks(),this}end(){let Z=this.sourceParts.join("");if(!this.hasToC)return Z;let ee=Z.indexOf(ao);if(ee===-1)return Z;let Le=new Map,Ot=this.toc.map(({indent:Bt,raw:jt})=>`${" ".repeat(Bt)}- [${jt}](#${cm(jt,Le)})`).join(`
185
- `);return Z.slice(0,ee)+Ot+Z.slice(ee+ao.length)}}function Os(Z,ee){return new po({onAppend:(Le,Ot)=>{ee?.onAppend?.call(null,Le,Ot,Z)}})}function Gi(Z,ee){let Le=Os(Z,ee);return Sc(Le,Z,ee.entryExports),Le.end()}async function lm(Z,ee,Le){let Ot=g(Z,{entryExports:ee.entryExports}),Bt=new In,jt=Os(Z,ee);Cc(jt,Ot.components,ee.entryExports);let Gt=co(wc(Le,"README.md")),Lt=await Bt.write(Gt,jt.end());Fn(`${Lt?"created":"unchanged"} "${Gt}".`),await Promise.all(Ot.components.map(async(Vt)=>{let Wt=Os(Z,ee);oo(Wt,Vt);let Ut=co(wc(Le,`${Vt.moduleName}.md`)),Kt=await Bt.write(Ut,Wt.end());Fn(`${Kt?"created":"unchanged"} "${Ut}".`)}))}async function lo(Z,ee){if(ee.outDir){await lm(Z,ee,ee.outDir);return}let Le=co(ee.outFile),Ot=await new In().write(Le,Gi(Z,ee));Fn(`${Ot?"created":"unchanged"} "${ee.outFile}".`)}import{join as um,resolve as hm}from"node:path";function dm(Z,ee){if(!ee.indexTypes)return[];let Le=ee.format==="component",Ot=new Set,Bt=[];for(let jt of Object.values(ee.exports)){if(!jt.default||!Pn.test(jt.source))continue;let Gt=n(jt.source);if(Ot.has(Gt))continue;Ot.add(Gt);let Lt=Z.components.find((Wt)=>Wt.filePath===Gt);if(!Lt)continue;let Vt=[gi(Lt.moduleName)];if(Le)Vt.push(Oi(Lt.moduleName));Bt.push({source:jt.source,names:Vt})}return Bt}async function Tc(Z,ee,Le){if(!Z)return ee;try{let Ot=await Z(ee,Le);if(typeof Ot!=="string")throw TypeError(`must return a string, got ${typeof Ot}`);return Ot}catch(Ot){let Bt=Ot instanceof Error?Ot.message:String(Ot);throw Error(`sveld: typesOptions.transform failed for "${Le.filePath}": ${Bt}`,{cause:Ot})}}function fm(Z,ee){return`${Z}
186
- ${rp(ee)}`}async function uo(Z,ee){let Le=hm(ee.outDir,"index.d.ts"),Ot=new In,Bt=g(Z),jt=ic(dm(Bt,ee)),Gt=ee.preamble+[nc(ee.exports),jt].filter((zt)=>zt!=="").join(`
187
-
188
- `),Lt=Nr(ee),Vt=Bt.components.map(async(zt)=>{let Xt=Qr(um(ee.outDir,zt.filePath)),Yt=n(Qr(zt.filePath)),Jt=ee.resolvedPathByFilePath?.get(zt.filePath),tn=Jt?void 0:ee.crossFileResolvedPathByFilePath?.get(zt.filePath),sn=Jt??tn,ln=fm(zt.moduleName,Lt),cn=tn?`${ln}
189
- ${$s(JSON.stringify(zt))}`:ln,un=sn?ee.cache?.getGeneratedText(sn,cn):void 0;if(un===void 0){if(un=Dr(zt,Lt),sn)ee.cache?.setGeneratedText(sn,cn,un)}let On=await Tc(ee.transform,un,{kind:"component",component:zt,filePath:Yt});return Ot.write(Xt,On)}),Wt=(async()=>{let zt=await Tc(ee.transform,Gt,{kind:"index",filePath:"index.d.ts"});return Ot.write(Le,`${zt}
190
- `)})(),Ut=(await Promise.all([...Vt,Wt])).filter(Boolean).length,Kt=Vt.length+1,qt=Ut===0?`unchanged ${Kt}`:`created ${Ut} of ${Kt}`;Fn(`${qt} TypeScript definitions in "${ee.outDir}".`)}var mm=["reportDiagnostics","strict","check","checkLevel","stdout","format"],gm=50;function ym(Z){let ee=Promise.resolve();return()=>{ee=ee.then(Z,Z)}}function It(Z){let ee=Z?.watch===!0,Le,Ot,Bt=Z??{},jt,Gt=null,Lt,Vt=new Set,Ut=ym(async()=>{if(Gt==null||Ot==null||Vt.size===0)return;let qt=Array.from(Vt);Vt.clear();try{let{result:zt}=await Gt.update(qt);await Wi(zt,Bt,Ot)}catch(zt){console.error("sveld: failed to regenerate types in watch mode:",zt)}}),Kt=(qt)=>{if(!ee||Gt==null||!ga.test(qt))return;Vt.add(qt),clearTimeout(Lt),Lt=setTimeout(Ut,gm)};return{name:"vite-plugin-sveld",apply:ee?void 0:"build",enforce:"post",configResolved(qt){jt=qt.root},async buildStart(){if(Z?.config){let zt=await B(Z.config,jt??process.cwd(),!1);Bt=R(zt,Z)}j(Bt);let qt=mm.filter((zt)=>(zt in Bt));if(qt.length>0)console.warn(`sveld: the Vite plugin ignores ${qt.map((zt)=>`"${zt}"`).join(", ")}; run the sveld CLI or sveld() for them.`);if(q(Bt.quiet===!0),Ot=Ns(Bt.entry),ee&&Ot!=null)try{Gt=await tc(Ot,Bt.glob===!0,Bi(Bt)),await Wi(await Gt.result,Bt,Ot)}catch(zt){console.error("sveld: failed to generate initial types in watch mode:",zt)}},async generateBundle(){if(ee)return;if(Ot==null)this.error(Vi);Le=await ji(Ot,Bt.glob===!0,Bi(Bt))},async writeBundle(){if(ee)return;if(Ot==null)this.error(Vi);await Wi(Le,Bt,Ot)},handleHotUpdate(qt){Kt(qt.file)},watchChange(qt){Kt(qt)}}}async function Wi(Z,ee,Le){let Ot=kc(Le);if(ee.types!==!1)await uo(Z.allComponentsForTypes,{outDir:"types",preamble:"",...ee.typesOptions,exports:Z.exports,inputDir:Ot,cache:Z.cache,resolvedPathByFilePath:Z.resolvedPathByFilePath,crossFileResolvedPathByFilePath:Z.crossFileResolvedPathByFilePath});if(ee.json)await no(Z.components,{outFile:"COMPONENT_API.json",...ee.jsonOptions,inputDir:Ot,entryExports:Z.entryExports});if(ee.markdown)await lo(Z.components,{outFile:"COMPONENT_INDEX.md",...ee.markdownOptions,entryExports:Z.entryExports});Z.cache?.save()}async function Ac(Z,ee,Le){if(ee.json){let Ot=to(Z.components,{...ee.jsonOptions,inputDir:kc(Le),entryExports:Z.entryExports});process.stdout.write(Ot);return}if(ee.markdown){let Ot=Gi(Z.components,{...ee.markdownOptions,entryExports:Z.entryExports});process.stdout.write(Ot)}}import{realpathSync as Pc,statSync as xm}from"node:fs";import{dirname as _c,relative as vm,resolve as Em}from"node:path";function Sm(Z){if(Z.check&&!Z.check.snapshotExists&&!Z.writesSnapshot)return 1;if(Z.check?.changes.some((ee)=>ee.kind==="schema"))return 1;if(Z.errors.length>0)return 2;if(Z.check&&Aa(Z.check.bump,Z.checkLevel??"major"))return 3;if(bo(Z.diagnostics,Z.strict).length>0)return 4;return 0}async function $e(Z,ee,Le=!1){let Ot=await ji(Z,ee.glob===!0,Bi(ee)),Bt=ee.check?await _e(Ot.components,Pa(ee),{entryExports:Ot.entryExports}):void 0;return await(Le?Ac:Wi)(Ot,ee,Z),{result:Ot,check:Bt}}function Cm(Z){let ee=Pc(xm(Z).isFile()?_c(Z):Z),Le=Pc(process.env.GITHUB_WORKSPACE||process.cwd());return(Ot)=>n(vm(Le,Em(ee,Ot)))}function Ie(Z,ee,Le,Ot){let Bt=Le.reportDiagnostics||Le.strict,jt=Co(Z.diagnostics,Bt);if(Bt&&jt.length>0)if(Le.format==="json")process.stderr.write($o(jt));else{if(Le.format==="github"){let Lt=_o(jt,Cm(Ot));if(Lt)console.error(Lt)}console.error(Ao(jt))}let Gt=Sm({errors:Z.errors,check:ee,writesSnapshot:ee?_a(Le,ee.snapshotFile):!1,checkLevel:Le.checkLevel,diagnostics:jt,strict:Le.strict});return{diagnostics:jt,exitCode:Gt}}async function Ft(Z){if(Z&&"input"in Z)throw Error("sveld: the `input` option was renamed to `entry`.");if(typeof Z?.config==="string")throw Error("sveld: `config` takes `true` or `false`; import another config file and pass its options instead.");let{entry:ee,...Le}=Z??{},Ot=await B(Le.config,process.cwd(),!0),Bt=Ns(ee??Ot.entry);if(Bt===null)throw Error(Vi);let jt=R(Ot,Le,{entry:Bt});j(jt),q(jt.quiet===!0);let{result:Gt,check:Lt}=await $e(Bt,jt),{diagnostics:Vt,exitCode:Wt}=Ie(Gt,Lt,jt,Bt),Ut=Ds(Gt.components,{inputDir:_c(Bt),entryExports:Gt.entryExports,source:jt.jsonOptions?.source});return{diagnostics:Vt,check:Lt,errors:Gt.errors,document:Ut,exitCode:Wt}}
191
- export{x,I,te,y,A,Ee,W,ne,ve,H,E,p,o,r,S,t,b,c,f,T,Oe,Se,C,l,L,D,i,U,k,w,re,ie,a,z,Me,N,O,m,u,J,se,K,oe,be,X,ae,Fe,Te,le,Y,h,v,s,pe,ce,e,Be,je,Ve,qe,Ge,We,He,Ue,ze,Je,Ce,Ke,Xe,ke,Ye,Qe,Ze,et,we,Pe,tt,Ae,nt,rt,P,it,st,ot,at,lt,pt,ct,ut,dt,De,ft,mt,ht,gt,yt,xt,ue,Et,vt,St,Ne,bt,Tt,Ct,kt,d,wt,Pt,At,de,fe,M,Dt,Nt,F,me,he,_,n,_t,g,Rt,_e,ge,$t,ye,Mt,B,R,j,Q,V,q,xe,G,Re,It,$e,Ie,Ft};