sveld 0.37.8 → 0.37.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,325 @@
1
+ import{createRequire as $c}from"node:module";var Pc=Object.create;var{getPrototypeOf:_c,defineProperty:zr,getOwnPropertyNames:Ac}=Object;var ws=Object.prototype.hasOwnProperty;function Tc(s){return this[s]}var Nc,Dc,_e=(s,k,W)=>{var H=s!=null&&typeof s==="object";if(H){var le=k?Nc??=new WeakMap:Dc??=new WeakMap,fe=le.get(s);if(fe)return fe}W=s!=null?Pc(_c(s)):{};let Ae=k||!s||!s.__esModule||!ws.call(s,"default")?zr(W,"default",{value:s,enumerable:!0}):W;if(s&&typeof s==="object"||typeof s==="function"){for(let De of Ac(s))if(!ws.call(Ae,De))zr(Ae,De,{get:Tc.bind(s,De),enumerable:!0})}if(H)le.set(s,Ae);return Ae};var a=(s,k)=>()=>(k||s((k={exports:{}}).exports,k),k.exports);var Rc=(s)=>s;function Ic(s,k){this[s]=Rc.bind(null,k)}var Oc=(s,k)=>{for(var W in k)zr(s,W,{get:k[W],enumerable:!0,configurable:!0,set:Ic.bind(k,W)})};var O=$c(import.meta.url);function r(s){return typeof s==="object"&&s!==null}function be(s){return r(s)&&s.type==="VariableDeclaration"&&Array.isArray(s.declarations)}function y(s){return r(s)&&s.type==="Literal"}function e(s){return r(s)&&s.type==="Identifier"&&typeof s.name==="string"}function M(s){return r(s)&&s.type==="MemberExpression"}function l(s){return r(s)&&s.type==="ObjectExpression"&&Array.isArray(s.properties)}function Lc(s){return r(s)&&s.type==="CallExpression"}function g(s,k){if(!Lc(s))return!1;return!!s.callee&&r(s.callee)&&s.callee.type==="Identifier"&&s.callee.name===k}function x(s){if(r(s)&&(s.type==="TSAsExpression"||s.type==="TSSatisfiesExpression")&&"expression"in s)return x(s.expression);return s}function Se(s){if(r(s)&&(s.type==="TSAsExpression"||s.type==="TSSatisfiesExpression")&&"typeAnnotation"in s)return s.typeAnnotation;return}function Mc(s){return r(s)&&s.type==="NewExpression"}function de(s,k){if(!Mc(s))return!1;return!!s.callee&&r(s.callee)&&s.callee.type==="Identifier"&&s.callee.name===k}function f(s){if(!r(s)||typeof s.type!=="string")return null;if(s.type==="Literal"){let k=s.value;if(typeof k==="string")return k;return k==null?null:String(k)}if(s.type==="TemplateLiteral"){let k=s.quasis;if(k?.length===1){let W=k[0]?.value?.cooked;return W==null?null:W}}return null}var P=Symbol("sveld.parsedComponentTypeScriptMetadata");function T(s){return s[P]}function Ps(s,k){if(k.length===0)return;let W=new Set(s.props.map((H)=>H.name));for(let H of k){if(W.has(H.name))continue;W.add(H.name),s.props.push({name:H.name,kind:"let",constant:!1,type:H.type,typeSource:"typescript",...H.description?{description:H.description}:{},isFunction:H.type.includes("=>"),isFunctionDeclaration:!1,isRequired:H.isRequired,reactive:!1})}}function Fc(s){let k="";for(let W=0;W<s.length;W++){let H=s[W];if(H==="*"&&s[W+1]==="*"){if(k+=".*",W++,s[W+1]==="/")W++;continue}if(H==="*"){k+="[^/]*";continue}if(H==="?"){k+="[^/]";continue}k+=".+^$()[]{}|\\".includes(H)?`\\${H}`:H}return k}function _s(s,k){return new RegExp(`^${Fc(s)}$`).test(k)}var z={"prop-unknown-type":"sveld/prop-unknown-type","context-any-type":"sveld/context-any-type","slot-missing-type":"sveld/slot-missing-type","event-no-source":"sveld/event-no-source","dispatch-escapes":"sveld/dispatch-escapes","example-compile-error":"sveld/example-compile-error","example-syntax-error":"sveld/example-syntax-error","syntax-skipped":"sveld/syntax-skipped","rest-props-unresolved":"sveld/rest-props-unresolved","context-duplicate-key":"sveld/context-duplicate-key","context-key-unresolved":"sveld/context-key-unresolved","context-value-unresolved":"sveld/context-value-unresolved","spread-unresolved":"sveld/spread-unresolved","export-unresolved":"sveld/export-unresolved","module-export-conflict":"sveld/module-export-conflict","extend-props-target-missing":"sveld/extend-props-target-missing","extend-props-duplicate":"sveld/extend-props-duplicate","extend-props-override":"sveld/extend-props-override","jsdoc-unknown-tag":"sveld/jsdoc-unknown-tag","typedef-duplicate":"sveld/typedef-duplicate","property-duplicate":"sveld/property-duplicate","generics-conflict":"sveld/generics-conflict","event-description-ambiguous":"sveld/event-description-ambiguous","jsdoc-tag-dropped":"sveld/jsdoc-tag-dropped","internal-typedef-referenced":"sveld/internal-typedef-referenced","types-inline-unresolved":"sveld/types-inline-unresolved","cross-file-unresolved":"sveld/cross-file-unresolved","export-ambiguous":"sveld/export-ambiguous"},Bc={"prop-unknown-type":"warning","context-any-type":"warning","slot-missing-type":"warning","event-no-source":"warning","dispatch-escapes":"warning","example-compile-error":"error","example-syntax-error":"error","syntax-skipped":"error","rest-props-unresolved":"warning","context-duplicate-key":"warning","context-key-unresolved":"warning","context-value-unresolved":"warning","spread-unresolved":"warning","export-unresolved":"warning","module-export-conflict":"warning","extend-props-target-missing":"error","extend-props-duplicate":"warning","extend-props-override":"warning","jsdoc-unknown-tag":"warning","typedef-duplicate":"warning","property-duplicate":"warning","generics-conflict":"warning","event-description-ambiguous":"warning","jsdoc-tag-dropped":"warning","internal-typedef-referenced":"error","types-inline-unresolved":"warning","cross-file-unresolved":"warning","export-ambiguous":"warning"};function i(s){return{...s,code:z[s.kind],severity:Bc[s.kind]}}function Z(s,k){if(k)return s;return s.filter((W)=>W.kind!=="jsdoc-unknown-tag")}function K(s,k){if(!k)return[];return s.filter((W)=>!W.ignored&&(k!=="errors"||W.severity==="error"))}function jc(s,k){if(k.code!==void 0&&k.code!==s.code)return!1;if(k.name!==void 0&&k.name!==s.name)return!1;if(k.component!==void 0&&!_s(k.component,s.component))return!1;return!0}function As(s,k){if(!k||k.length===0)return s;return s.map((W)=>W.ignored||k.some((H)=>jc(W,H))?{...W,ignored:!0}:W)}var Vc={"prop-unknown-type":"Props without inferred types","context-any-type":"Context values typed as `any`","slot-missing-type":"@slot/@snippet tags missing a {Type} annotation","event-no-source":"@event tags with no dispatch or callback","dispatch-escapes":"Dispatchers passed to functions sveld can't follow","example-compile-error":"@example blocks that failed to compile","example-syntax-error":"@example blocks that failed to parse","syntax-skipped":"Component syntax sveld skipped","rest-props-unresolved":"$$restProps spread only onto components","context-duplicate-key":"Duplicate setContext keys","context-key-unresolved":"setContext keys sveld couldn't resolve","context-value-unresolved":"setContext values sveld couldn't describe","spread-unresolved":"Unresolved spreads widened to Record<string, any>","export-unresolved":"Unresolved named export specifiers","module-export-conflict":"Module-script exports colliding with generated names","extend-props-target-missing":"@extends/@extendProps targets that couldn't be verified","extend-props-duplicate":"Duplicate @extends/@extendProps tags","extend-props-override":"Own props overriding an @extends target's prop","jsdoc-unknown-tag":"Unknown JSDoc tags","typedef-duplicate":"Duplicate @typedef/@callback names","property-duplicate":"Duplicate @property names","generics-conflict":"Duplicate @generics/@template names","event-description-ambiguous":"Text after an @event read as the next tag's description","jsdoc-tag-dropped":"Passthrough JSDoc tags that couldn't attach","internal-typedef-referenced":"Public types referencing an @internal typedef","types-inline-unresolved":"typesOptions.inline could not safely copy an imported type","cross-file-unresolved":"Imports a standalone parse couldn't read","export-ambiguous":"Ambiguous `export *` names left out of the entry exports"},Wc=["prop-unknown-type","context-any-type","slot-missing-type","event-no-source","dispatch-escapes","example-compile-error","example-syntax-error","syntax-skipped","rest-props-unresolved","context-duplicate-key","context-key-unresolved","context-value-unresolved","spread-unresolved","export-unresolved","module-export-conflict","extend-props-target-missing","extend-props-duplicate","extend-props-override","jsdoc-unknown-tag","typedef-duplicate","property-duplicate","generics-conflict","event-description-ambiguous","jsdoc-tag-dropped","internal-typedef-referenced","types-inline-unresolved","cross-file-unresolved","export-ambiguous"];function qn(s){let k=new Set,W=[];for(let H of s){let le=`${H.component}:${H.kind}:${H.name}`;if(k.has(le))continue;k.add(le),W.push(H)}return W}function ee(s){let k=s.filter((Re)=>!Re.ignored),W=s.length-k.length,H=W>0?` (${W} ignored)`:"";if(k.length===0)return`sveld: no diagnostics${H}.`;let le=[],fe=(Re,$e)=>`${Re} ${$e}${Re===1?"":"s"}`,Ae=k.filter((Re)=>Re.severity==="error").length,De=`${fe(Ae,"error")}, ${fe(k.length-Ae,"warning")}`;le.push(`sveld: ${fe(k.length,"diagnostic")} (${De})${H}.`);for(let Re of Wc){let $e=k.filter((Be)=>Be.kind===Re);if($e.length===0)continue;le.push(""),le.push(`${Vc[Re]} (${$e.length}):`);let Le=new Map;for(let Be of $e){let Fe=Le.get(Be.component)??[];Fe.push(Be),Le.set(Be.component,Fe)}for(let[Be,Fe]of Le){le.push(` ${Be}`);for(let Me of Fe){let je=Me.source?` (${Be}:${Me.source.start.line}:${Me.source.start.column})`:"";le.push(` - ${Me.message}${je} [${Me.code}]`)}}}return le.join(`
2
+ `)}var ke=1;function te(s){return`${JSON.stringify({kind:"diagnostics",schemaVersion:ke,diagnostics:s},null,2)}
3
+ `}var Gc=/\*\//g;function E(s){return s.replace(Gc,"*\\/")}function C(s){return s.map((k)=>`${k.name}${k.optional?"?":""}: ${k.type}`).join(", ")}function d(s){return s===void 0||s===""?void 0:s}var Hc=new Intl.Collator("en");function c(s,k){return Hc.compare(s,k)}function ye(s){return s==="TSTypeAnnotation"||s==="TSTypeAliasDeclaration"||s==="TSInterfaceDeclaration"||s==="TSTypeParameterDeclaration"||s==="TSTypeParameterInstantiation"}function b(s,k,W,H){Xr(s,null,null,k,W,H?.skipTypeOnlySubtrees===!0)}function Xr(s,k,W,H,le,fe){H(s,k,W);let Ae=s.type;if((Ae==="Identifier"||Ae==="Literal"||Ae==="Text")&&s.typeAnnotation===void 0){if(le)le(s);return}if(fe&&Ae.charCodeAt(0)===84&&ye(Ae)){if(le)le(s);return}for(let De in s){if(De==="leadingComments")continue;let Re=s[De];if(!Re||typeof Re!=="object")continue;if(Array.isArray(Re))for(let $e=0;$e<Re.length;$e++){let Le=Re[$e];if(Le&&typeof Le==="object"&&typeof Le.type==="string")Xr(Le,s,De,H,le,fe)}else if(typeof Re.type==="string")Xr(Re,s,De,H,le,fe)}if(le)le(s)}import Ts,{sep as Jr}from"node:path";var Vt=/\.svelte$/,Ns=/\.(?:svelte|[mc]?ts|[mc]?js)$/;function zn(s){if(!s.endsWith(".svelte"))return!1;let k=s.length-7;if(k===0)return!1;let W=s.charCodeAt(k-1);return W!==47&&(Jr==="/"||W!==92)}function t(s){return Jr==="/"?s:s.split(Jr).join("/")}function Xn(s,k){return t(Ts.join(k,Ts.normalize(s)))}function on(s){return`${JSON.stringify(s,null,2)}
4
+ `}var Ds="sveld",Jn="0.37.9";var Rs={name:Ds,version:Jn,license:"Apache-2.0",description:"Generate TypeScript definitions and component documentation for your Svelte components.",type:"module",main:"./lib/index.js",types:"./lib/index.d.ts",exports:{".":{types:"./lib/index.d.ts",import:"./lib/index.js",default:"./lib/index.js"},"./browser":{types:"./lib/browser.d.ts",import:"./lib/browser.js",default:"./lib/browser.js"},"./schema/component-api.schema.json":"./schema/component-api.schema.json"},scripts:{test:"bun test --parallel","test:update":"SVELD_UPDATE_FIXTURES=1 bun test tests/fixtures.test.ts","test:fixtures-types":"tsc --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",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",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",fuzz:"bun scripts/fuzz-parser.ts",typecheck:"tsc --noEmit"},devDependencies:{"@biomejs/biome":"2.5.14","@sveltejs/acorn-typescript":"1.0.13","@types/bun":"^1.4.2","@types/jest":"^30.0.0","@typescript/typescript6":"^6.0.2",acorn:"^8.18.0",ajv:"^8.20.0",culls:"^0.2.0","custom-elements-manifest":"^2.1.0",ostia:"^0.2.7",svelte:"^5.57.1",typescript:"^7.0.2"},bin:{sveld:"cli.js"},files:["lib","cli.js","schema"],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 An="5.57.1";var Yn=1;function Zt(s){return s.some((k)=>k.internal)?s.filter((k)=>!k.internal):s}function Kc(s){return{...s,props:Zt(s.props),moduleExports:Zt(s.moduleExports),slots:Zt(s.slots),events:Zt(s.events),typedefs:Zt(s.typedefs),...s.contexts?{contexts:Zt(s.contexts).map((k)=>({...k,properties:Zt(k.properties)}))}:{}}}function o(s,k={}){let W=Array.from(s,([,fe])=>{let{diagnostics:Ae,...De}=fe;return Kc(De)}).sort((fe,Ae)=>c(fe.moduleName,Ae.moduleName)),H={schemaVersion:Yn,generator:{name:Ds,version:Jn,svelteVersion:An},total:W.length,components:W},le=k.entryExports?Zt(k.entryExports):void 0;if(le&&le.length>0)H.totalExports=le.length,H.exports=le;return H}import{readFile as qc}from"node:fs/promises";import zc from"node:path";var Xc=/[:=]/,Qn={none:0,patch:1,minor:2,major:3};function Jc(s,k){return Qn[k]>Qn[s]?k:s}function Yc(s){return s.reduce((k,W)=>Jc(k,W.bump),"none")}function er(s,k){return Qn[s]>=Qn[k]}function Fs(s,k){let W=[],H=0,le="",fe=null;for(let Ae=0;Ae<s.length;Ae++){let De=s[Ae];if(fe){if(le+=De,De==="\\")Ae++,le+=s[Ae]??"";else if(De===fe)fe=null;continue}if(De==='"'||De==="'"||De==="`"){fe=De,le+=De;continue}if(De==="<"||De==="("||De==="{"||De==="[")H++;if(De===">"||De===")"||De==="}"||De==="]")H--;if(De===k&&H===0){W.push(le.trim()),le="";continue}le+=De}return W.push(le.trim()),W}function Is(s){return new Set(Fs(s,"|").filter((k)=>k.length>0))}function Qc(s){let k=0,W=null;for(let H=0;H<s.length;H++){let le=s[H];if(W){if(le==="\\")H++;else if(le===W)W=null;continue}if(le==='"'||le==="'"||le==="`"){W=le;continue}if(le==="<"||le==="("||le==="{"||le==="[")k++;if(le===">"||le===")"||le==="}"||le==="]")k--;if(k===0&&le==="="&&s[H+1]===">")return H}return-1}function Os(s){let k=Qc(s);if(k===-1)return;let W=s.slice(0,k).trim(),H=s.slice(k+2).trim();if(!W.startsWith("(")||!W.endsWith(")"))return;let le=W.slice(1,-1).trim();return{params:le.length===0?[]:Fs(le,","),returnType:H}}function Zc(s){return(s.split(Xc,1)[0]??"").trimEnd().endsWith("?")}function ep(s,k){if(s.returnType!==k.returnType)return"major";if(k.params.length<s.params.length)return"major";for(let H=0;H<s.params.length;H++)if(s.params[H]!==k.params[H])return"major";if(k.params.length===s.params.length)return"none";return k.params.slice(s.params.length).every(Zc)?"minor":"major"}function Qr(s,k){if(s===k)return"none";if(s===void 0||k===void 0)return"major";let W=Os(s),H=Os(k);if(W&&H)return ep(W,H);let le=Is(s),fe=Is(k),Ae=[...fe].some((Re)=>!le.has(Re)),De=[...le].some((Re)=>!fe.has(Re));if(!Ae&&!De)return"none";if(Ae&&!De)return"minor";if(De&&!Ae)return"major";return"major"}function $s(s){return s.bindable===!0||s.binding==="writable"}function Ls(s,k,W,H){let le=k==="prop"?"prop":"export",fe=[],Ae=new Map(W.map((Re)=>[Re.name,Re])),De=new Map(H.map((Re)=>[Re.name,Re]));for(let[Re,$e]of De){if(Ae.has(Re))continue;fe.push({component:s,kind:k,name:Re,bump:$e.isRequired?"major":"minor",message:`${le} "${Re}" added${$e.isRequired?" (required)":""}`})}for(let[Re]of Ae){if(De.has(Re))continue;fe.push({component:s,kind:k,name:Re,bump:"major",message:`${le} "${Re}" removed`})}for(let[Re,$e]of Ae){let Le=De.get(Re);if(!Le)continue;if($e.isRequired!==Le.isRequired)fe.push({component:s,kind:k,name:Re,bump:Le.isRequired?"major":"minor",message:`${le} "${Re}" became ${Le.isRequired?"required":"optional"}`});let Be=Qr($e.type,Le.type);if(Be!=="none")fe.push({component:s,kind:k,name:Re,bump:Be,message:`${le} "${Re}" type changed from \`${$e.type??"unknown"}\` to \`${Le.type??"unknown"}\``});let Fe=$s($e),Me=$s(Le);if(Fe!==Me)fe.push({component:s,kind:k,name:Re,bump:Me?"minor":"major",message:`${le} "${Re}" ${Me?"gained a writable binding":"lost its writable binding"}`});if($e.value!==Le.value&&Be==="none")fe.push({component:s,kind:k,name:Re,bump:"patch",message:`${le} "${Re}" default changed from \`${$e.value??"none"}\` to \`${Le.value??"none"}\``});let je=$e.deprecated!==void 0,Ve=Le.deprecated!==void 0;if(je!==Ve)fe.push({component:s,kind:k,name:Re,bump:Ve?"minor":"patch",message:`${le} "${Re}" ${Ve?"marked as deprecated":"no longer deprecated"}`});if($e.constant!==Le.constant)fe.push({component:s,kind:k,name:Re,bump:"minor",message:`${le} "${Re}" ${Le.constant?"became constant":"became mutable"}`});if($e.reactive!==Le.reactive)fe.push({component:s,kind:k,name:Re,bump:"minor",message:`${le} "${Re}" ${Le.reactive?"became reactive":"stopped being reactive"}`})}return fe}function tp(s,k,W){let H=[],le=new Map(k.map((Ae)=>[Ae.name,Ae])),fe=new Map(W.map((Ae)=>[Ae.name,Ae]));for(let[Ae]of fe){if(le.has(Ae))continue;H.push({component:s,kind:"event",name:Ae,bump:"minor",message:`event "${Ae}" added`})}for(let[Ae]of le){if(fe.has(Ae))continue;H.push({component:s,kind:"event",name:Ae,bump:"major",message:`event "${Ae}" removed`})}for(let[Ae,De]of le){let Re=fe.get(Ae);if(!Re)continue;if(De.type!==Re.type){H.push({component:s,kind:"event",name:Ae,bump:"major",message:`event "${Ae}" changed from ${De.type} to ${Re.type}`});continue}let $e=De.type==="dispatched"?De.detail:void 0,Le=Re.type==="dispatched"?Re.detail:void 0,Be=Qr($e,Le);if(Be!=="none")H.push({component:s,kind:"event",name:Ae,bump:Be,message:`event "${Ae}" detail changed from \`${$e??"unknown"}\` to \`${Le??"unknown"}\``})}return H}function Ms(s){return s.name??"default"}function np(s,k,W){let H=[],le=new Map(k.map((Ae)=>[Ms(Ae),Ae])),fe=new Map(W.map((Ae)=>[Ms(Ae),Ae]));for(let[Ae]of fe){if(le.has(Ae))continue;H.push({component:s,kind:"slot",name:Ae,bump:"minor",message:`slot "${Ae}" added`})}for(let[Ae]of le){if(fe.has(Ae))continue;H.push({component:s,kind:"slot",name:Ae,bump:"major",message:`slot "${Ae}" removed`})}for(let[Ae,De]of le){let Re=fe.get(Ae);if(!Re)continue;let $e=Qr(De.slot_props,Re.slot_props);if($e!=="none")H.push({component:s,kind:"slot",name:Ae,bump:$e,message:`slot "${Ae}" props changed from \`${De.slot_props??"none"}\` to \`${Re.slot_props??"none"}\``})}return H}var rp=new Set(["description","source","componentCommentSource","tags"]);function Zn(s){if(Array.isArray(s))return s.map(Zn);if(s!==null&&typeof s==="object"){let k={};for(let[W,H]of Object.entries(s)){if(rp.has(W))continue;k[W]=Zn(H)}return k}return s}var ip=["generics","rest_props","extends","contexts","typedefs"];function sp(s,k,W){let H=[];for(let le of ip){let fe=JSON.stringify(Zn(k[le])),Ae=JSON.stringify(Zn(W[le]));if(fe!==Ae)H.push({component:s,kind:"shape",name:le,bump:"major",message:`"${le}" changed (breaking)`})}return H}function op(s,k){let W=k.moduleName;return[...Ls(W,"prop",s.props,k.props),...Ls(W,"moduleExport",s.moduleExports,k.moduleExports),...tp(W,s.events,k.events),...np(W,s.slots,k.slots),...sp(W,s,k)]}function we(s,k){let W=[],H=new Map(s.components.map((fe)=>[fe.moduleName,fe])),le=new Map(k.components.map((fe)=>[fe.moduleName,fe]));for(let[fe]of le){if(H.has(fe))continue;W.push({component:fe,kind:"component",bump:"minor",message:`component "${fe}" added`})}for(let[fe]of H){if(le.has(fe))continue;W.push({component:fe,kind:"component",bump:"major",message:`component "${fe}" removed`})}for(let[fe,Ae]of H){let De=le.get(fe);if(!De)continue;W.push(...op(Ae,De))}return W}async function ap(s){let k;try{k=await qc(zc.resolve(s),"utf-8")}catch(W){if(W.code==="ENOENT")return null;throw W}try{return JSON.parse(k)}catch{throw Error(`sveld: could not parse "${s}" as JSON. Is it a sveld COMPONENT_API.json snapshot?`)}}function oe(s){if(typeof s.check==="string")return s.check;return s.jsonOptions?.outFile??"COMPONENT_API.json"}async function X(s,k,W={}){let H=await ap(k);if(H===null)return{snapshotExists:!1,snapshotFile:k,changes:[],bump:"none"};if(H.schemaVersion!==Yn)return{snapshotExists:!0,snapshotFile:k,changes:[{component:"*",kind:"schema",bump:"none",message:`snapshot schemaVersion ${H.schemaVersion} differs from ${Yn}; regenerate the snapshot`}],bump:"none"};let le=o(s,{entryExports:W.entryExports}),fe=we(H,le);return{snapshotExists:!0,snapshotFile:k,changes:fe,bump:Yc(fe)}}var cp={major:"BREAKING",minor:"additive",patch:"patch",none:"no change"};function xe(s){if(!s.snapshotExists)return`sveld --check: no snapshot found at "${s.snapshotFile}". Run \`sveld --json\` and commit the output first.`;if(s.changes.length===0)return`sveld --check: no API changes detected against "${s.snapshotFile}".`;let k=[],W=s.changes.length;k.push(`sveld --check: ${W} API change${W===1?"":"s"} detected against "${s.snapshotFile}".`),k.push(`Suggested semver bump: ${s.bump}.`);let H=new Map;for(let le of s.changes){let fe=H.get(le.component)??[];fe.push(le),H.set(le.component,fe)}for(let[le,fe]of H){k.push(""),k.push(` ${le}`);for(let Ae of fe){let De=Ae.kind==="schema"?"schema":cp[Ae.bump];k.push(` [${De}] ${Ae.message}`)}}return k.join(`
5
+ `)}var Pe=1;function Te(s){let k={kind:"check-report",schemaVersion:Pe,...s};return on(k)}import{existsSync as up}from"node:fs";import{join as lp}from"node:path";import{pathToFileURL as fp}from"node:url";function pp(s,k){let W=s.length+1,H=k.length+1,le=Array.from({length:W},()=>Array(H).fill(0));for(let fe=0;fe<W;fe++)le[fe][0]=fe;for(let fe=0;fe<H;fe++)le[0][fe]=fe;for(let fe=1;fe<W;fe++)for(let Ae=1;Ae<H;Ae++){let De=s[fe-1]===k[Ae-1]?0:1;if(le[fe][Ae]=Math.min(le[fe-1][Ae]+1,le[fe][Ae-1]+1,le[fe-1][Ae-1]+De),fe>1&&Ae>1&&s[fe-1]===k[Ae-2]&&s[fe-2]===k[Ae-1])le[fe][Ae]=Math.min(le[fe][Ae],le[fe-2][Ae-2]+1)}return le[W-1][H-1]}function B(s,k,W=3){let H,le=Number.POSITIVE_INFINITY;for(let fe of k){let Ae=pp(s,fe);if(Ae<le)H=fe,le=Ae}if(H===void 0||le>W)return;return H}var dp=["sveld.config.js","sveld.config.mjs","sveld.config.ts"];function Ne(s){return s}function hp(s=process.cwd()){for(let k of dp){let W=lp(s,k);if(up(W))return W}return null}async function Zr(s){let k;try{k=await import(`${fp(s).href}?t=${Date.now()}`)}catch(H){let le=H instanceof Error?H.message:String(H);throw Error(`sveld: failed to load config file "${s}".
6
+ ${le}`)}let W=k.default;if(!r(W)||Array.isArray(W))throw Error(`sveld: config file "${s}" must export a configuration object as its default export. Did you forget \`export default defineConfig({ ... })\`?`);return W}async function J(s=process.cwd()){let k=hp(s);if(k===null)return{};return Zr(k)}function D(...s){let k={};for(let W of s){if(!W)continue;for(let[H,le]of Object.entries(W)){let fe=k[H];k[H]=r(fe)&&!Array.isArray(fe)&&r(le)&&!Array.isArray(le)?{...fe,...le}:le}}return k}var mp={ci:{strict:!0,reportDiagnostics:!0,check:!0,checkExamples:!0},local:{reportDiagnostics:!0}};function ae(s){let{strict:k,...W}=s;if(k!=="ci"&&k!=="local")return s;return{...mp[k],...W}}var Bs=["entry","glob","quiet","documentExports","types","typesOptions","json","jsonOptions","markdown","markdownOptions","customElements","customElementsOptions","llms","llmsOptions","additionalWriters","failFast","watch","config","resolveTypes","cache","checkExamples","reportDiagnostics","strict","check","checkLevel","stdout","format","dryRun","diagnostics"],gp={typesOptions:["outDir","preamble","format","exportTypes","typeNames","comments","propsDeclaration","transform","indexTypes","inline","exports","dryRun","cache","resolvedPathByFilePath","crossFileResolvedPathByFilePath"],jsonOptions:["input","outFile","outDir","entryExports","dryRun","source"],markdownOptions:["write","outFile","outDir","entryExports","onAppend","dryRun"],customElementsOptions:["outFile","dryRun"],llmsOptions:["outDir","linkBase","title","summary","entryExports","dryRun"],diagnostics:["ignore"]};function js(s,k,W){let H=s===null?k:`${s}.${k}`,le=B(k,W),fe=le===void 0?void 0:s===null?le:`${s}.${le}`;console.warn(`sveld: unknown option "${H}".${fe?` Did you mean "${fe}"?`:""}`)}function q(s){for(let k of Object.keys(s))if(!Bs.includes(k))js(null,k,Bs);for(let[k,W]of Object.entries(gp)){let H=s[k];if(!r(H))continue;for(let le of Object.keys(H))if(!W.includes(le))js(k,le,W)}}import{existsSync as yp,readdirSync as xp}from"node:fs";import{basename as vp,dirname as Cp,join as Ep}from"node:path";var ei=new Map;function tr(){ei.clear()}function nr(s){let k=ei.get(s);if(k!==void 0)return k;try{let W=xp(s,{withFileTypes:!0}),H=new Set;for(let le of W)H.add(le.name);k={entries:W,names:H}}catch{k=null}return ei.set(s,k),k}function ce(s,k){let W=nr(s);if(W===null)return;if(W.byName===void 0){W.byName=new Map;for(let H of W.entries)W.byName.set(H.name,H)}return W.byName.get(k)}function Vs(s){return s.normalize("NFC").toLowerCase()}function h(s,k){let W=nr(s);if(W===null)return!1;if(W.names.has(k))return!0;if(W.folded===void 0){W.folded=new Map;for(let le of W.names)W.folded.set(Vs(le),le)}let H=W.folded.get(Vs(k));return H!==void 0&&H!==k&&yp(Ep(s,k))}var bp=/\.[mc]?jsx?$/,Sp={".js":[".ts",".tsx",".d.ts"],".jsx":[".tsx",".d.ts"],".mjs":[".mts",".d.mts"],".cjs":[".cts",".d.cts"]};function pe(s){let k=bp.exec(s)?.[0];if(k===void 0)return;let W=s.slice(0,-k.length),H=Cp(W),le=vp(W);for(let fe of Sp[k]??[])if(h(H,le+fe))return W+fe;return}import{existsSync as sr,readFileSync as kp}from"node:fs";import{dirname as ti,isAbsolute as wp,join as Pp,relative as _p,resolve as or}from"node:path";function rr(s){if(!r(s))return{};let k={};if(typeof s.svelte==="string")k.svelte=s.svelte;if(typeof s.name==="string")k.name=s.name;if(typeof s.description==="string")k.description=s.description;return k}function Ws(s){if(!r(s))return{};let k={};if(typeof s.extends==="string")k.extends=s.extends;if(r(s.compilerOptions)){let W={};if(typeof s.compilerOptions.baseUrl==="string")W.baseUrl=s.compilerOptions.baseUrl;if(r(s.compilerOptions.paths)){let H={};for(let[le,fe]of Object.entries(s.compilerOptions.paths))if(Array.isArray(fe)&&fe.every((Ae)=>typeof Ae==="string"))H[le]=fe;if(Object.keys(H).length>0)W.paths=H}if(Object.keys(W).length>0)k.compilerOptions=W}return k}var ir=new Map,Gs=new Map,Ap=/\/\*[\s\S]*?\*\/|\/\/.*/g,Tp=/[.+?^${}()|[\]\\]/g,Np=[".svelte",".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".d.ts"];class gn extends Error{specifier;fromFile;searched;constructor(s,k,W){super(`cannot resolve "${s}" from ${k||"."} (${W})`);this.name="UnresolvedModuleError",this.specifier=s,this.fromFile=k,this.searched=W}}function Dp(s){if(sr(s))return!0;return Np.some((k)=>sr(s+k))}function Hs(s){let k=s.indexOf("*");return k===-1?s.length:k}function Rp(s){let k=s,W=or(k,"/");while(k!==W){for(let H of["tsconfig.json","jsconfig.json"]){let le=Pp(k,H);if(sr(le))return le}k=ti(k)}return null}function Us(s){if(ir.has(s))return ir.get(s)??null;try{let k=kp(s,"utf-8"),W;try{W=JSON.parse(k)}catch{let le=k.replace(Ap,"");W=JSON.parse(le)}let H=Ws(W);if(H.extends){let le=wp(H.extends)?H.extends:or(ti(s),H.extends),fe=le.endsWith(".json")?le:`${le}.json`;if(sr(fe)){let Ae=Us(fe);if(Ae)H.compilerOptions={...Ae.compilerOptions,...H.compilerOptions,paths:{...Ae.compilerOptions?.paths,...H.compilerOptions?.paths}}}}return ir.set(s,H),H}catch{return ir.set(s,null),null}}function Ip(s){let k=Gs.get(s);if(!k){let W=s.split("*").map((H)=>H.replace(Tp,"\\$&")).join("(.*)");k=new RegExp(`^${W}$`),Gs.set(s,k)}return k}function U(s,k){if(s.startsWith(".")||s.startsWith("/"))return{resolved:s,unresolved:!1,searched:""};let W=Rp(k);if(!W)return{resolved:s,unresolved:!0,searched:"no tsconfig/jsconfig paths found"};let H=Us(W);if(!H?.compilerOptions?.paths)return{resolved:s,unresolved:!0,searched:"no tsconfig/jsconfig paths found"};let{baseUrl:le=".",paths:fe}=H.compilerOptions,Ae=ti(W),De=or(Ae,le),Re=Object.entries(fe).sort(([$e],[Le])=>Hs(Le)-Hs($e));for(let[$e,Le]of Re){let Be=s.match(Ip($e));if(!Be)continue;let Fe;for(let Me of Le){let je=Me;for(let We=1;We<Be.length;We++)je=je.replace("*",Be[We]);let Ve=or(De,je);if(Fe===void 0)Fe=Ve;if(Dp(Ve))return{resolved:Ve,unresolved:!1,searched:W}}return{resolved:Fe??s,unresolved:!1,searched:W}}return{resolved:s,unresolved:!0,searched:`tsconfig paths (${W})`}}function ni(s,k){return U(s,k).resolved}function ar(s,k){if(s.startsWith(".")||s.startsWith("/"))return s;let W=ni(s,k);if(W===s)return s;let H=_p(k,W);return H=t(H),H.startsWith(".")?H:`./${H}`}function m(s){let k=[],W=0,H=0;for(let le=0;le<s.length;le++){let fe=s[le];if(fe==='"'||fe==="'"||fe==="`")le=Op(s,le);else if(fe==="<"||fe==="("||fe==="["||fe==="{")W++;else if(fe===">"&&s[le-1]==="=")continue;else if(fe===">"||fe===")"||fe==="]"||fe==="}")W=Math.max(W-1,0);else if(fe===","&&W===0)k.push(s.slice(H,le)),H=le+1}return k.push(s.slice(H)),k}function Op(s,k){let W=s[k];for(let H=k+1;H<s.length;H++)if(s[H]==="\\")H++;else if(s[H]===W)return H;return s.length-1}var $p=/\binterface\s+[A-Za-z_$][\w$]*(\s*<[^{};]*>)?\s*$/;var zs=/\s/,Lp=/\s{2}|[^\S ]/,Mp=/["'`{}/]/g,Fp=/["'`{};/]/g;function Bp(s){return $p.test(s.slice(-200))}var Ks=[""];function jp(s){let k=Ks[s];if(k===void 0)k=" ".repeat(s),Ks[s]=k;return k}function Vp(s,k){let W="";for(let H=s.length-1;H>=0&&W.length<k;H--)W=s[H]+W;return W.length>k?W.slice(-k):W}function Wp(s){if(s.length===0)return!1;let k=s[s.length-1];return k.charCodeAt(k.length-1)===10}function Gp(s){while(s.length>0){let k=s[s.length-1],W=k.length;while(W>0){let H=k.charCodeAt(W-1);if(H!==32&&H!==9)break;W--}if(W===k.length)return;if(W===0){s.pop();continue}s[s.length-1]=k.slice(0,W);return}}function Hp(s){while(s.length>0){let k=s[s.length-1];if(!zs.test(k[k.length-1]))return;let W=k.trimEnd();if(W.length===k.length)return;if(W.length===0){s.pop();continue}s[s.length-1]=W;return}}function Up(s){if(s.includes("{"))return!1;let k=0,W=0;for(let H=0;H<s.length;H++){let le=s.charCodeAt(H);if(k!==0){if(le===k&&s.charCodeAt(H-1)!==92)k=0;continue}if(le===34||le===39||le===96){k=le;continue}if(le===59&&++W>=2)return!0}return!1}function Kp(s){if(!Lp.test(s))return s.trimEnd();let k="",W=null,H=!1;for(let le=0;le<s.length;le++){let fe=s[le],Ae=s[le-1];if(W){if(k+=fe,W==="double"&&fe==='"'&&Ae!=="\\"||W==="single"&&fe==="'"&&Ae!=="\\"||W==="template"&&fe==="`"&&Ae!=="\\")W=null;H=!1;continue}if(fe==='"'||fe==="'"||fe==="`"){W=fe==='"'?"double":fe==="'"?"single":"template",k+=fe,H=!1;continue}if(zs.test(fe)){if(!H&&k.length>0)k+=" ",H=!0;continue}k+=fe,H=!1}return k.trimEnd()}function Xs(s,k){let W=s[k],H=s.indexOf(W,k+1);while(H!==-1&&s.charCodeAt(H-1)===92)H=s.indexOf(W,H+1);return H}function Js(s,k){let W=s.indexOf("*/",k+1);return W===-1?-1:W+1}function qp(s){let k=new Map,W=[],H=Mp,le=0;while(le<s.length){if(H.lastIndex=le,!H.test(s))break;le=H.lastIndex-1;let fe=s.charCodeAt(le);if(fe===47){if(s.charCodeAt(le+1)===42){let Ae=Js(s,le);if(Ae===-1)break;le=Ae}}else if(fe===34||fe===39||fe===96){let Ae=Xs(s,le);if(Ae===-1)break;le=Ae}else if(fe===123)W.push(le);else if(fe===125&&W.length>0)k.set(W.pop(),le);le++}return k}function zp(s,k,W){for(let H=k;H<W;H++)if(!ri(s.charCodeAt(H)))return!1;return!0}function ri(s){if(s<=32)return s===32||s>=9&&s<=13;if(s<160)return!1;return s===160||s===5760||s>=8192&&s<=8202||s===8232||s===8233||s===8239||s===8287||s===12288||s===65279}function Ys(s,k,W,H){let le=[],fe=Fp,Ae=k,De=k;while(De<W){if(fe.lastIndex=De,!fe.test(s))break;if(De=fe.lastIndex-1,De>=W)break;let Re=s.charCodeAt(De);if(Re===47){if(s.charCodeAt(De+1)===42){let $e=Js(s,De);if($e===-1)break;De=$e}De++;continue}if(Re===34||Re===39||Re===96){let $e=Xs(s,De);if($e===-1)break;De=$e+1;continue}if(Re===123){let $e=H.get(De);if($e===void 0||$e>=W){De++;continue}if(Ae<De)le.push(s.slice(Ae,De));let Le=De+1;if(zp(s,Le,$e)){le.push("{}"),De=$e+1,Ae=De;continue}let Be=s.slice(Le,$e),Fe=s.charCodeAt(Le)===10;if(!Fe&&!Be.includes("/*")&&!Up(Be)&&!Bp(Vp(le,200))){let Me=Ys(s,Le,$e,H),je=Me.trim();if(!je.includes(`
7
+ `)){let Ve=je.endsWith(";")?je.slice(0,-1):je,We=`{ ${Kp(Ve)} }`;if(We.length<=120){le.push(We),De=$e+1,Ae=De;continue}}if(le.push("{"),Me.charCodeAt(0)!==59)le.push(`
8
+ `);if(Me.length>0)le.push(Me);De=$e,Ae=$e;continue}if(le.push("{"),!Fe)le.push(`
9
+ `);De=Le,Ae=Le;continue}if(Re===125){if(Ae<De)le.push(s.slice(Ae,De));if(Gp(le),!Wp(le))le.push(`
10
+ `);le.push("}"),De++,Ae=De;continue}if(Ae<De)le.push(s.slice(Ae,De));if(Hp(le),le.push(";"),s.charCodeAt(De+1)!==10)le.push(`
11
+ `);De++,Ae=De}if(Ae<W)le.push(s.slice(Ae,W));return le.join("")}function Xp(s){return Ys(s,0,s.length,qp(s))}function Jp(s){if(!s.includes(" "))return s;let k="",W=0;for(let H=0;H<s.length;H++){let le=s.charCodeAt(H);if(W!==0){if(k+=s[H],le===W&&s.charCodeAt(H-1)!==92)W=0;continue}if(le===34||le===39||le===96){W=le,k+=s[H];continue}if(le===32&&k.charCodeAt(k.length-1)===32)continue;k+=s[H]}return k}function Yp(s){return s===125||s===93||s===41||s===62}function Qp(s,k,W){return W-k>=3&&s.charCodeAt(k)===47&&s.charCodeAt(k+1)===42&&s.charCodeAt(k+2)===42}function qs(s,k,W){let H=s.indexOf("*/",k);return H!==-1&&H+2<=W}function Zp(s,k,W){let H=s.charCodeAt(k);if(H===124||H===38)return!0;return H===46&&k+1<W&&s.charCodeAt(k+1)!==46}function eu(s){let k=[],W=[],H=s.length,le=0,fe=!1,Ae=0,De=0;while(De<=H){let Le=s.indexOf(`
12
+ `,De);if(Le===-1)Le=H;let Be=Le+1,Fe=De,Me=Le;while(Fe<Me&&ri(s.charCodeAt(Fe)))Fe++;while(Me>Fe&&ri(s.charCodeAt(Me-1)))Me--;if(Fe===Me){let Ge=W.length>0?W[W.length-1]:void 0;if(Ge!==void 0&&Ge!==""){let ze=Ge.charCodeAt(Ge.length-1);if(ze!==123&&ze!==40&&ze!==91)k.push(0),W.push("")}De=Be;continue}if(fe){if(k.push(Ae),W.push(` ${s.slice(Fe,Me)}`),qs(s,Fe,Me))fe=!1;De=Be;continue}let je=Qp(s,Fe,Me),Ve=je&&qs(s,Fe,Me);if(je&&!Ve){k.push(le),W.push(s.slice(Fe,Me)),fe=!0,Ae=le,De=Be;continue}let We=Yp(s.charCodeAt(Fe)),He=Math.max(0,le-(We?1:0))+(Zp(s,Fe,Me)?1:0);if(We&&He===0&&W.length>0&&W[W.length-1]==="")k.pop(),W.pop();if(k.push(He),W.push(Jp(s.slice(Fe,Me))),De=Be,Ve)continue;let qe=0;for(let Ge=Fe;Ge<Me;Ge++){let ze=s.charCodeAt(Ge);if(qe!==0){if(ze===qe&&s.charCodeAt(Ge-1)!==92)qe=0;continue}if(ze===34||ze===39||ze===96)qe=ze;else if(ze===123||ze===40||ze===91||ze===60)le++;else if(ze===125||ze===41||ze===93)le=Math.max(0,le-1);else if(ze===62&&s.charCodeAt(Ge-1)!==61)le=Math.max(0,le-1)}}let Re=W.length;while(Re>0&&W[Re-1]==="")Re--;let $e=[];for(let Le=0;Le<Re;Le++){if(Le>0)$e.push(`
13
+ `);let Be=k[Le];if(Be>0)$e.push(jp(Be));$e.push(W[Le])}return $e.join("")}function Qs(s){return`${eu(Xp(s))}
14
+ `}var Ft="any",St="",tu="Record<string, any>",oi="Record<string, never>",cr=/^[A-Za-z_$][A-Za-z0-9_$]*$/,nu=/CustomEvent/,ru=/^[A-Z]/,iu=/\n/,ro=/=>/,su=/(?:^|\n)@default\b/,ai=/\n/g,ou=/^([ \t]*\*) +$/gm,au=/\s+/g,yn=/(^|[^.\w])Snippet(?:\s*<|\b)/,cu=/import\s+type\s+[^;]*\bSnippet\b[^;]*from\s+"svelte";/,pu=/[.*+?^${}()|[\]\\]/g,uu=/^const\s+/,lu=/\{name\}/g,fu=/^export /,du=/[^\w$]/g;function ci(s){return s.replace(uu,"")}function hu(s){if(!s)return;return s.replace(ai,`
15
+ * `)}function pr(s){if(!s)return"";return`/** ${E(s)} */`}function ur(s){if(!s)return"";return`/**
16
+ * ${E(s).replace(ai,`
17
+ * `)}
18
+ */`}function io(s){if(s===void 0)return;return s===!0?"@deprecated":`@deprecated ${s}`}function mu(s){let k=io(s);if(k===void 0)return;return`* ${k.replace(ai,`
19
+ * `)}
20
+ `}function gu(s,k){if(!k)return[`@${s}`];if(!k.includes(`
21
+ `))return[`@${s} ${k}`];return[`@${s}`,...k.split(`
22
+ `)]}function pi(s){let k=[];for(let{name:W,body:H}of s??[])k.push(...gu(W,H));return k}function Nn(s,k,W,H){if(H==="none")return"";let le=io(W),fe=H==="all"?pi(k):[],Ae=fe.length>0;if(!s&&!Ae&&!le)return"";if(!Ae&&!le)return s?.includes(`
23
+ `)?ur(s):pr(s);let De=[];if(s)De.push(...s.split(`
24
+ `));if(De.push(...fe),le)De.push(...le.split(`
25
+ `));return`/**
26
+ * ${E(De.join(`
27
+ * `))}
28
+ */`}function yu(s){let k=pi(s);if(k.length===0)return"";return k.map((W)=>`* ${W}
29
+ `).join("")}function lr(s){if(s===void 0)return Ft;return`${s}
30
+ `}function vn(s,k={export:!0},W="all"){if(s.typedefs.length===0)return St;let H=k.export?"export ":"";return s.typedefs.map((le)=>{let fe=St;if(W!=="none"){let Ae=W==="all"?pi(le.tags):[];if(Ae.length===0)fe=le.description?`${ur(le.description)}
31
+ `:"";else{let De=le.description?[...le.description.split(`
32
+ `),...Ae]:Ae;fe=`/**
33
+ * ${E(De.join(`
34
+ * `))}
35
+ */
36
+ `}}return`${fe}${H}${le.ts}`.replace(ou,"$1")}).join(`
37
+
38
+ `)}var Zs=new Map;function ii(s,k){let W=Zs.get(k);if(W===void 0){let H=k.replace(pu,"\\$&");W=new RegExp(`\\b${H}\\b`),Zs.set(k,W)}return W.test(s)}var eo,to=[];function ui(s){if(s!==eo)eo=s,to=m(s);return to}function xu(s){if(s===null)return[];return s[0].split(",").map((k,W)=>({name:k.trim(),constraint:(ui(s[1]??"")[W]??k).trim()}))}function vu(s,k){let W=xu(s).filter(({name:H})=>ii(k,H));if(W.length===0)return{declSuffix:St,refSuffix:St};return{declSuffix:`<${W.map(({constraint:H})=>ci(H)).join(", ")}>`,refSuffix:`<${W.map(({name:H})=>H).join(", ")}>`}}function so(s,k={export:!0},W="all"){if(!s.contexts||s.contexts.length===0)return St;let H=k.export?"export ":"",le=s.generics===null?[]:s.generics[0].split(",").map((fe,Ae)=>({name:fe.trim(),constraint:(ui(s.generics?.[1]??"")[Ae]??fe).trim()}));return s.contexts.map((fe)=>{let Ae=fe.properties.map((Be)=>{let Fe=W!=="none"&&Be.description?`${pr(Be.description)}
39
+ `:"",Me=Be.optional?"?":"";return`${Fe}${Be.name}${Me}: ${Be.type};`}).join(`
40
+ `),De=W!=="none"&&fe.description?`${ur(fe.description)}
41
+ `:"",Re=le.filter(({name:Be})=>fe.type!==void 0&&ii(fe.type,Be)||fe.properties.some((Fe)=>ii(Fe.type,Be))).map(({constraint:Be})=>Be),$e=Re.length>0?`<${Re.map(ci).join(", ")}>`:"";if(fe.type!==void 0)return`${De}${H}type ${fe.typeName}${$e} = ${fe.type};`;if(fe.properties.length===0)return fe.hasUnresolvedSpread?`${De}${H}type ${fe.typeName} = Record<string, any>;`:`${De}${H}type ${fe.typeName} = Record<string, never>;`;let Le=fe.hasUnresolvedSpread?" & Record<string, any>":"";return`${De}${H}type ${fe.typeName}${$e} = {
42
+ ${Ae}
43
+ }${Le};`}).join(`
44
+
45
+ `)}function en(s){return cr.test(s)?s:JSON.stringify(s)}function oo(s,k){if(!s)return;return`* ${k||s}
46
+ `}function xn(s,k,W,H="all"){if(H==="none")return St;return[oo(hu(s)),mu(k),H==="all"?yu(W):void 0].filter(Boolean).join("")}function an(s){return s.length>0?`/**
47
+ ${E(s)}*/`:St}function Cu(s,k={export:!0},W="all"){let H=k.export?"export ":"",le=s.props.filter((Ge)=>!Ge.isFunctionDeclaration&&Ge.kind!=="const"),fe=new Set([...le.map((Ge)=>Ge.name),...Array.from(s.canonicalPropNames??[])]),Ae=le.map((Ge)=>{let ze=typeof Ge.value==="string"?Ge.value.replace(au," "):Ge.value,st=su.test(Ge.description??"")||Ge.value===void 0,dt=[xn(Ge.description,Ge.deprecated,Ge.tags,W),W==="all"?oo(Ge.constant,"@constant"):null,W==="all"&&!st?`* @default ${ze}
48
+ `:null].filter(Boolean).join(""),mt=Ge.constant&&!Ge.isFunction?Ge.value:Ge.type||Ft;return`
49
+ ${an(dt)}
50
+ ${en(Ge.name)}${Ge.isRequired?"":"?"}: ${mt};`}),De=s.canonicalPropsType?Ae.filter((Ge,ze)=>{let Ze=le[ze];return Ze?!(s.canonicalPropNames?.has(Ze.name)??!1):!0}):Ae,Re=(s.slots||[]).filter((Ge)=>!Ge.default&&Ge.name!=null&&!fe.has(Ge.name)).map((Ge)=>{let ze=Ge.name,Ze=en(ze),st=Nn(Ge.description,Ge.tags,Ge.deprecated,W),dt=st?`${st}
51
+ `:"",at=Ge.slot_props&&Ge.slot_props!=="Record<string, never>"?`(this: void, ...args: [${Ge.slot_props}]) => void`:"(this: void) => void";return`
52
+ ${dt}${Ze}?: ${at};`}),$e=(s.slots||[]).find((Ge)=>Ge.default||Ge.name===null),Le=$e&&!fe.has("children")?(()=>{let Ge=Nn($e.description,$e.tags,$e.deprecated,W),ze=Ge?`${Ge}
53
+ `:"",st=$e.slot_props&&$e.slot_props!=="Record<string, never>"?`(this: void, ...args: [${$e.slot_props}]) => void`:"(this: void) => void";return`
54
+ ${ze}children?: ${st};`})():"",Be=s.events?Pu({events:s.events},fe,W):[],Fe=[...Re,Le,...Be].filter(Boolean),Me=[...De,...Fe].join(`
55
+ `),je=S(s.moduleName,k.typeNames),Ve=St,We=s.generics?`<${ui(s.generics[1]).map((Ge)=>ci(Ge.trim())).join(", ")}>`:"",He=s.generics?`<${s.generics[0]}>`:"",qe=s.canonicalPropsType?`
56
+ type $Props${We} = ${s.canonicalPropsType}${Me.trim()===""?"":` & {${Me}
57
+ }`};
58
+ `:`
59
+ type $Props${We} = {
60
+ ${Me}
61
+ };
62
+ `;if(s.rest_props?.type==="Element"){let Ge;if(s.rest_props.name==="svelte:element")if(s.rest_props.thisValue)Ge=`SvelteHTMLElements["${s.rest_props.thisValue}"]`;else Ge="HTMLAttributes<HTMLElement>";else Ge=s.rest_props.name.split("|").map((st)=>`SvelteHTMLElements["${st.trim()}"]`).join(" & ");let ze="[key: `data-${string}`]: unknown;",Ze=W!=="none"&&s.rest_props.description?s.rest_props.description.includes(`
63
+ `)?`${ur(s.rest_props.description)}
64
+ `:`${pr(s.rest_props.description)}
65
+ `:"";if(s.extends===void 0)Ve=`
66
+ ${Ze}${Ge?`type $RestProps = ${Ge};
67
+ `:""}
68
+ ${s.canonicalPropsType?`type $Props${We} = (${s.canonicalPropsType}) & {${Me}
69
+
70
+ ${ze}
71
+ };`:`type $Props${We} = {
72
+ ${Me}
73
+
74
+ ${ze}
75
+ };`}
76
+
77
+ ${H}type ${je}${We} = Omit<$RestProps, keyof $Props${He}> & $Props${He};
78
+ `;else Ve=`
79
+ ${Ze}${Ge?`type $RestProps = ${Ge};
80
+ `:""}
81
+ ${s.canonicalPropsType?`type $Props${We} = (${s.canonicalPropsType}) & {${Me}
82
+
83
+ ${ze}
84
+ };`:`type $Props${We} = {
85
+ ${Me}
86
+
87
+ ${ze}
88
+ };`}
89
+
90
+ ${H}type ${je}${We} = Omit<$RestProps, keyof ($Props${He} & ${s.extends.interface})> & Omit<${s.extends.interface}, keyof $Props${He}> & $Props${He};
91
+ `}else if(Me.trim()===""&&s.extends===void 0&&!s.canonicalPropsType)Ve=`
92
+ ${H}type ${je}${We} = ${oi};
93
+ `;else if(s.canonicalPropsType)Ve=`
94
+ ${qe}
95
+ ${H}type ${je}${We} = ${s.extends===void 0?"":`Omit<${s.extends.interface}, keyof $Props${He}> & `}$Props${He};
96
+ `;else if(s.extends===void 0)Ve=k.propsDeclaration==="interface"&&Me.trim()!==""?`
97
+ ${H}interface ${je}${We} {
98
+ ${Me}
99
+ }
100
+ `:`
101
+ ${H}type ${je}${We} = {
102
+ ${Me}
103
+ };
104
+ `;else Ve=`
105
+ type $Props${We} = {
106
+ ${Me}
107
+ };
108
+
109
+ ${H}type ${je}${We} = Omit<${s.extends.interface}, keyof $Props${He}> & $Props${He};
110
+ `;return{props_name:je,prop_def:Ve}}function Eu(s,k="all"){if(s.slots.length===0)return oi;let W=s.slots.map(({name:H,slot_props:le,...fe})=>{let Ae=fe.default||H===null?"default":en(H??""),De=Nn(fe.description,fe.tags,fe.deprecated,k);return`${De?`${De}
111
+ `:""}${Ae}: ${lr(le)};`}).join(`
112
+ `);return s.slots.length===1?`{${W}}`:`{
113
+ ${W}
114
+ }`}var bu=()=>"WindowEventMap",Su=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 Tn(s=Ft){if(nu.test(s))return s;return`CustomEvent<${s}>`}function ku(s){return Su.has(s)}function ao(s){switch(s.type){case"dispatched":return Tn(s.detail);case"forwarded":{let k=s.element,H=!(k&&ru.test(k))||ku(s.name),le=s.detail!==void 0&&s.detail!=="undefined"&&!(s.detail==="null"&&H),fe=s.detail==="null"&&!H;if(le||fe)return Tn(s.detail);else if(H)return`${bu()}["${s.name}"]`;else return Tn()}default:return s}}function wu(s,k="all"){if(s.events.length===0)return tu;let W=s.events.map((H)=>{let le="",fe=Nn(H.description,H.tags,H.deprecated,k);if(fe)le=`${fe}
115
+ `;return`${le}${en(H.name)}: ${ao(H)};
116
+ `}).join("");return s.events.length===1?`{${W}}`:`{
117
+ ${W}}`}function Pu(s,k,W="all"){return s.events.map((H)=>{let le=`on${H.name}`;if(k.has(le))return;let fe="",Ae=Nn(H.description,H.tags,H.deprecated,W);if(Ae)fe=`${Ae}
118
+ `;return`
119
+ ${fe}${en(le)}?: (event: ${ao(H)}) => void;`}).filter((H)=>H!==void 0)}function _u(s){let k=s.type==="() => any";if(s.type&&ro.test(s.type)&&!k)return s.type;else if(s.params&&s.params.length>0)return`(${C(s.params)}) => ${s.returnType||Ft}`;else if(s.returnType)return`() => ${s.returnType}`;else return s.type||Ft}function co(s,k="all"){return s.props.filter((W)=>W.isFunctionDeclaration||W.kind==="const").map((W)=>{let H=xn(W.description,W.deprecated,W.tags,k),le=_u(W);return`
120
+ ${an(H)}
121
+ ${en(W.name)}: ${le};`}).join(`
122
+ `)}function Au(s,k={export:!0},W="all"){let H=k.export?"export ":"",le=_(s.moduleName,k.typeNames),fe=co({props:s.props},W);if(fe.trim()==="")return{exports_name:le,exports_ref:le,exports_def:`${H}type ${le} = ${oi};`};let{declSuffix:Ae,refSuffix:De}=vu(s.generics,fe);return{exports_name:le,exports_ref:`${le}${De}`,exports_def:`${H}type ${le}${Ae} = {${fe}
123
+ };`}}function Tu(s){let k=s.props.filter((W)=>W.bindable===!0||W.binding==="writable").map((W)=>JSON.stringify(W.name));return k.length===0?St:k.join(" | ")}function Q(s){return s==="default"?"$$Component":s}function Nu(s){let k=Q(s.moduleName),W=s.bindings===St?'""':s.bindings;return`declare const ${k}: Component<
124
+ ${s.propsRef},
125
+ ${s.exportsRef},
126
+ ${W}
127
+ >;
128
+ export default ${k};`}function Du(s){let k=Q(s.moduleName),W=`${k}Component`,H=s.bindings===St?'""':s.bindings;return`interface ${W} {
129
+ new ${s.generic}(
130
+ options: ComponentConstructorOptions<${s.propsRef}>
131
+ ): SvelteComponent<${s.propsRef}> & ${s.exportsRef};
132
+ ${s.generic}(
133
+ this: void,
134
+ internals: ComponentInternals,
135
+ props: ${s.propsRef}
136
+ ): {
137
+ $on?(type: string, callback: (e: any) => void): () => void;
138
+ $set?(props: Partial<${s.propsRef}>): void;
139
+ } & ${s.exportsRef};
140
+ element?: typeof HTMLElement;
141
+ z_$$bindings?: ${H};
142
+ }
143
+ declare const ${k}: ${W};
144
+ export default ${k};`}function Ru(s){if(s.extends===void 0)return"";return`import type { ${s.extends.interface} } from ${s.extends.import};`}function Iu(s,k="all"){if(k==="none"||!s.componentComment)return"";if(!iu.test(s.componentComment))return pr(s.componentComment.trim());return`/*${E(s.componentComment).split(`
145
+ `).map((W)=>`* ${W}`).join(`
146
+ `)}
147
+ */`}function si(s){return cr.test(s)?s:JSON.stringify(s)}function Ou(s,k){let W=[],H=new Map;for(let le of s.moduleExports){if(le.kind!=="re-export"||!le.reExport)continue;let{from:fe,imported:Ae}=le.reExport,De=xn(le.description,le.deprecated,le.tags,k),Re=si(le.name);if(Ae==="*"){let Be=le.name==="*"?"*":`* as ${Re}`;W.push(`${an(De)}
148
+ export ${Be} from ${JSON.stringify(fe)};`);continue}let $e=`${fe}\x00${De}`,Le=H.get($e);if(!Le)Le={comments:De,from:fe,specifiers:[]},H.set($e,Le),W.push($e);Le.specifiers.push(Ae===le.name?Re:`${si(Ae)} as ${Re}`)}return W.map((le)=>{let fe=H.get(le);if(!fe)return le;return`${an(fe.comments)}
149
+ export { ${fe.specifiers.join(", ")} } from ${JSON.stringify(fe.from)};`}).join(`
150
+
151
+ `)}function li(s){let k=[s.static?"static ":"",s.abstract?"abstract ":"",s.readonly?"readonly ":""].join(""),W=s.optional?"?":"";if(s.kind==="property")return`${k}${en(s.name)}${W}: ${s.type??Ft}`;let H=C(s.params??[]);if(s.kind==="constructor")return`constructor(${H})`;let le=s.typeParameters?`<${s.typeParameters}>`:"";return`${k}${en(s.name)}${W}${le}(${H}): ${s.returnType??Ft}`}function $u(s,k,W){let H=s.localName??s.name,le=H!==s.name,fe=`export { ${H}${le?` as ${si(s.name)}`:""} };`;if(W.has(H))return fe;W.add(H);let Ae=s.typeParameters?`<${s.typeParameters}>`:"",De=(s.members??[]).map((Be)=>[an(xn(Be.description,Be.deprecated,Be.tags,k)),`${li(Be)};`].filter(Boolean).join(`
152
+ `)).join(`
153
+
154
+ `),Re=`${s.extends?` extends ${s.extends}`:""}${s.implements?.length?` implements ${s.implements.join(", ")}`:""}`,$e=`${le?"":"export "}declare ${s.abstract?"abstract ":""}class ${H}${Ae}${Re}`;return`
155
+ ${[an(xn(s.description,s.deprecated,s.tags,k)),De?`${$e} {
156
+ ${De}
157
+ }`:`${$e} {}`,le?fe:""].filter(Boolean).join(`
158
+ `)}`}function Lu(s,k="all"){let W=Ou(s,k),H=new Set,le=s.moduleExports.filter((fe)=>fe.kind!=="re-export").map((fe)=>{if(fe.kind==="class")return $u(fe,k,H);let Ae=!cr.test(fe.name),De=Ae?{...fe,name:Mu(fe.name)}:fe,Re=xn(De.description,De.deprecated,De.tags,k),$e,Le=De.type&&ro.test(De.type),Be=De.type==="() => any",Fe=De.typeParameters?`<${De.typeParameters}>`:"";if(De.kind==="const"&&!Le)$e=`export declare const ${De.name}: ${De.type||Ft};
159
+ `;else if(De.params&&De.params.length>0)$e=`export declare function ${De.name}${Fe}(${C(De.params)}): ${De.returnType||Ft};`;else if(De.returnType)$e=`export declare function ${De.name}${Fe}(): ${De.returnType};`;else if(Le&&De.type&&!Be){let[Me,je,...Ve]=De.type.split("=>"),We=Ve.map((He)=>` => ${He.trim()}`).join("");$e=`export declare function ${De.name}${Me.trimEnd()}: ${je.trim()}${We};`}else if(Le&&De.type){let[Me,je,...Ve]=De.type.split("=>"),We=Ve.map((He)=>` => ${He.trim()}`).join("");$e=`export declare function ${De.name}${Me.trimEnd()}: ${je.trim()}${We};`}else if(De.kind==="const")$e=`export declare const ${De.name}: ${De.type||Ft};
160
+ `;else $e=`export declare let ${De.name}: ${De.type||Ft};`;if(Ae)$e=`${$e.replace(fu,"").trimEnd()}
161
+ export { ${De.name} as ${JSON.stringify(fe.name)} };`;return`
162
+ ${an(Re)}
163
+ ${$e}`}).join(`
164
+ `);return[W,le].filter(Boolean).join(`
165
+
166
+ `)}function Mu(s){return`__export_${s.replace(du,"_")}`}var Fu=120;function Bu(s){let W=`export default class ${s.moduleName==="default"?"":s.moduleName}${s.generic} extends SvelteComponentTyped<`,H=[s.genericProps,s.events,s.slots];if(s.accessors.trim()===""&&H.every((le)=>!le.includes(`
167
+ `))){let le=`${W}${H.join(", ")}> {}`;if(le.length<=Fu)return le}return`${W}
168
+ ${s.genericProps},
169
+ ${s.events},
170
+ ${s.slots}
171
+ > {
172
+ ${s.accessors}
173
+ }`}function no(s,k,W){let H=W.replace(lu,k);if(!W.includes("{name}")||!cr.test(H))throw Error(`sveld: typesOptions.typeNames.${s} must contain "{name}" and produce a valid identifier; got "${W}".`);return H}function po(s,k){let W=no("props",s,k?.props??"{name}Props"),H=no("exports",s,k?.exports??"{name}Exports");if(W===H)throw Error(`sveld: typesOptions.typeNames.props and typesOptions.typeNames.exports both produce "${W}" for component "${s}"; they must differ.`);let le=Q(s);for(let[fe,Ae]of[["props",W],["exports",H]])if(Ae===le||Ae===`${le}Component`)throw Error(`sveld: typesOptions.typeNames.${fe} produces "${Ae}" for component "${s}", which the .d.ts already declares for the component itself; use a different template.`);return{props:W,exports:H}}function S(s,k){return po(s,k).props}function _(s,k){return po(s,k).exports}function fr(s,k,W){if(s===void 0||s===!0)return{...k};if(s===!1)return{props:!1,exports:!1,typedefs:!1,contexts:!1};return{props:s.props??W,exports:s.exports??W,typedefs:s.typedefs??W,contexts:s.contexts??W}}var fi={props:!0,exports:!0,typedefs:!0,contexts:!0};function di(s){let k=fr(s?.exportTypes,fi,!0);if(s?.forceExportProps===!0)k.props=!0;return k}function hi(s){return{format:s.format,exportTypes:s.exportTypes,forceExportProps:s.forceExportProps,typeNames:s.typeNames,comments:s.comments,propsDeclaration:s.propsDeclaration,inline:s.inline}}var ju={format:"class",exportTypes:!0,forceExportProps:!1,typeNames:null,comments:"all",propsDeclaration:"type",inline:!1};function uo(s){let k=hi(s??{}),W={};for(let[H,le]of Object.entries(k))W[H]=le??ju[H];return JSON.stringify(W)}function mi(s,k){let W=T(s),{moduleName:H,typedefs:le,generics:fe,props:Ae,moduleExports:De,slots:Re,events:$e,rest_props:Le,extends:Be,componentComment:Fe,contexts:Me,syntaxMode:je}=s,Ve=k?.format==="component",We=fe!==null,He=di(k),qe=k?.comments??"all",{props_name:Ge,prop_def:ze}=Cu({moduleName:H,props:Ae,rest_props:Le,extends:Be,generics:fe,slots:Re,canonicalPropNames:new Set(W?.canonicalPropNames??[]),canonicalPropsType:W?.canonicalPropsType,events:Ve&&je==="legacy"?$e:void 0},{export:He.props,typeNames:k?.typeNames,propsDeclaration:k?.propsDeclaration},qe),Ze=fe?`<${fe[1]}>`:"",st=fe?`${Ge}<${fe[0]}>`:Ge,dt=Lu({moduleExports:De},qe),mt=vn({typedefs:le},{export:He.typedefs},qe),at=so({contexts:Me,generics:fe},{export:He.contexts},qe),bt=new Set(k?.inlined?.droppedImportStatements??[]),jt=(W?.typeImportStatements??[]).filter((pt)=>!bt.has(pt)).join(`
174
+ `),Tt=[...k?.inlined?.declarations??[],...W?.localTypeDeclarations??[],...W?.moduleTypeDeclarations??[]].join(`
175
+
176
+ `),{exports_ref:Lt,exports_def:Ut}=Ve?Au({props:Ae,moduleName:H,generics:fe},{export:He.exports,typeNames:k?.typeNames},qe):{exports_ref:St,exports_def:St},_n=Ve?Tu({props:Ae}):St,nt=!cu.test(jt)&&(yn.test(ze)||yn.test(dt)||yn.test(mt)||yn.test(at)||yn.test(Tt)||yn.test(Ut)),lt=Le?.type==="Element"&&(Le.name!=="svelte:element"||Le.name==="svelte:element"&&Le.thisValue),gt=Le?.type==="Element"&&Le.name==="svelte:element"&&!Le.thisValue,Ye=[Ve?We?`import type { SvelteComponent, ComponentConstructorOptions, ComponentInternals${nt?", Snippet":""} } from "svelte";`:`import type { Component${nt?", Snippet":""} } from "svelte";`:`import { SvelteComponentTyped${nt?", type Snippet":""} } from "svelte";`,lt?'import type { SvelteHTMLElements } from "svelte/elements";':"",gt?'import type { HTMLAttributes } from "svelte/elements";':"",jt,Ru({extends:Be})].filter(Boolean).join(`
177
+ `),et=Ve?We?Du({moduleName:H,generic:Ze,propsRef:st,exportsRef:Lt,bindings:_n}):Nu({moduleName:H,propsRef:st,exportsRef:Lt,bindings:_n}):Bu({moduleName:H,generic:Ze,genericProps:st,events:wu({events:$e},qe),slots:Eu({slots:Re},qe),accessors:co({props:Ae},qe)}),ct=[dt,mt,Tt,at,ze,Ut,[Iu({componentComment:Fe},qe),et].filter(Boolean).join(`
178
+ `)].map((pt)=>pt.trim()).filter(Boolean).join(`
179
+
180
+ `);return Qs([Ye,ct].filter(Boolean).join(`
181
+
182
+ `))}var dr=new Map;function R(s,k){if(!k?.replace&&dr.has(s.name))throw Error(`sveld: a writer named "${s.name}" is already registered. Pass { replace: true } to overwrite it.`);dr.set(s.name,s)}function ue(s){return dr.get(s)}function Ie(){return Array.from(dr.values())}import{dirname as dc,isAbsolute as Eh,resolve as bh}from"node:path";import{existsSync as _a,lstatSync as Da,readFileSync as Gf,realpathSync as Hf,statSync as Ra}from"node:fs";import{readFile as Uf}from"node:fs/promises";import{basename as Kf,dirname as Ia,extname as qf,isAbsolute as zf,join as Aa,parse as Xf,relative as qi,resolve as kn}from"node:path";function Dn(s){return s}function zt(s){if(s==="")return s;return s.startsWith(".")?s:`./${s}`}import{dirname as fo,resolve as ho}from"node:path";var Vu=/^(['"])(.*)\1$/,mo=/^[./]/,Wu=/import\(\s*(['"])((?:(?!\1).)+)\1\s*\)/g;function Gu(s,k){let W=s.extends?.import;if(W===void 0)return null;let H=W.replace(Vu,"$2");if(!mo.test(H))return null;return ho(fo(k),H)}function lo(s,k){let W=[];for(let H of s.matchAll(Wu)){let le=H[2];if(!mo.test(le))continue;W.push(ho(fo(k),le))}return W}function Hu(s,k){let W=[],H=Gu(s,k);if(H!==null)W.push(H);for(let le of s.typedefs??[])W.push(...lo(le.type,k));for(let le of s.props)if(le.type)W.push(...lo(le.type,k));return W}function Rn(s,k){let W=new Map;for(let H of s.values()){let le=k(H.filePath);for(let fe of Hu(H,le)){let Ae=W.get(fe);if(Ae===void 0)Ae=new Set,W.set(fe,Ae);Ae.add(le)}}return W}function hr(s,k){let W=new Set,H=[];for(let le of s)if(!W.has(le))W.add(le),H.push(le);while(H.length>0){let le=H.shift(),fe=k.get(le);if(fe===void 0)continue;for(let Ae of fe)if(!W.has(Ae))W.add(Ae),H.push(Ae)}return W}var Uu=/^```([\w-]*)\r?\n([\s\S]*?)\r?\n?```$/,Ku=new Set(["","js","jsx","ts","tsx","javascript","typescript"]),qu=new Set(["svelte","html"]);function zu(s){let k=s.trim();if(k==="")return null;let W=k.match(Uu);if(W){let H=W[1].toLowerCase(),le=W[2].trim();if(le==="")return null;if(Ku.has(H))return{kind:"compile",code:le};if(qu.has(H))return{kind:"syntax",code:le};return null}if(k.startsWith("<"))return null;return{kind:"compile",code:k}}function go(s){if(!s.isFunction)return"any";return`(${(s.params??[]).map((W)=>`${W.name}${W.optional?"?":""}: any`).join(", ")}) => any`}function mr(s,k,W,H,le){let fe=(s??[]).filter((De)=>De.name==="example"),Ae=[];return fe.forEach((De,Re)=>{let $e=zu(De.body);if($e===null)return;let Le=fe.length>1;Ae.push({id:Le?`${k}#${Re}`:k,name:Le?`${W} (example ${Re+1})`:W,type:H,code:$e.code,kind:$e.kind,...le?{source:le}:{}})}),Ae}function yo(s){return s.name??"default"}function xo(s){let k=[];for(let W of s.props)k.push(...mr(W.tags,`prop:${W.name}`,W.name,go(W),W.source));for(let W of s.moduleExports)k.push(...mr(W.tags,`export:${W.name}`,W.name,go(W),W.source));for(let W of s.slots)k.push(...mr(W.tags,`slot:${yo(W)}`,yo(W),"any",W.source));for(let W of s.events)k.push(...mr(W.tags,`event:${W.name}`,W.name,"any",W.source));return k}import{hash as Xu}from"node:crypto";import{existsSync as Ju,mkdirSync as Yu,readFileSync as Qu,renameSync as Zu,writeFileSync as vo}from"node:fs";import{dirname as gi,isAbsolute as el,join as Eo,resolve as gr}from"node:path";var yi=9,tl=Eo("node_modules",".cache","sveld","parse-cache.json"),nl="deafd80674da371e";function xi(){return`${Jn}+${nl}+svelte@${An}`}function rl(s){for(let k=gr(s);;k=gi(k)){if(Ju(Eo(k,"package.json")))return k;if(gi(k)===k)return gr(s)}}function bo(s,k){let W=rl(s);if(typeof k==="string")return el(k)?k:gr(W,k);return gr(W,tl)}function yr(s){return Xu("sha256",s,"hex")}function Co(){return{formatVersion:yi,toolchainVersion:xi(),entries:{}}}function il(s){try{let k=Qu(s,"utf-8"),W=JSON.parse(k);if(W.formatVersion!==yi||W.toolchainVersion!==xi())return Co();return W}catch{return Co()}}class vi{cacheFilePath;file;next=new Map;blocked=new Set;dirty=!1;savedEntryCount;constructor(s){this.cacheFilePath=s,this.file=il(s),this.savedEntryCount=Object.keys(this.file.entries).length}has(s,k){if(this.blocked.has(s))return!1;let W=this.file.entries[s];return W!==void 0&&W.hash===k}get(s,k){if(this.blocked.has(s))return null;let W=this.file.entries[s];if(W===void 0||W.hash!==k)return null;this.next.set(s,W);let H=structuredClone(W.parsed);if(W.typeScriptMetadata!==void 0)H[P]=structuredClone(W.typeScriptMetadata);return H}set(s,k,W){this.dirty=!0,this.next.set(s,{hash:k,parsed:structuredClone(W),typeScriptMetadata:structuredClone(W[P])})}invalidate(s){this.blocked.add(s)}getGeneratedText(s,k){let W=this.next.get(s);if(W?.generatedText===void 0||W.generatedText.key!==k)return;return W.generatedText.text}setGeneratedText(s,k,W){let H=this.next.get(s);if(H===void 0)return;if(H.generatedText?.key===k&&H.generatedText.text===W)return;H.generatedText={key:k,text:W},this.dirty=!0}save(){if(!this.dirty&&this.next.size===this.savedEntryCount)return;this.dirty=!1,this.savedEntryCount=this.next.size,Yu(gi(this.cacheFilePath),{recursive:!0});let s={formatVersion:yi,toolchainVersion:xi(),entries:Object.fromEntries(this.next)},k=JSON.stringify(s),W=`${this.cacheFilePath}.${process.pid}.tmp`;try{vo(W,k),Zu(W,this.cacheFilePath)}catch{try{vo(this.cacheFilePath,k)}catch{}}}}import{readFileSync as xl,statSync as vl}from"node:fs";import{basename as Cl,dirname as _i,isAbsolute as El,join as bl,relative as Sl,resolve as Ai}from"node:path";var Ci=!1;function V(s){Ci=s}function kt(s){if(!Ci)console.error(s)}function xr(s){if(!Ci)console.error(s)}var Ei=/^\s+/,So=/\s/,sl=/^@[^\s/]+(?=\s|$)/,ol=/^@(\S+)\s*/,al=new Set(["extends","extendProps","generics","template","typedef"]);function G(s){let k=0;while(k<s.length){let W=s.charCodeAt(k);if(W!==32&&W!==9&&W!==13&&W!==10&&!So.test(s[k]))break;k++}return k}function cl(s,k){let W=s.slice(G(s)),H=!1;if(k)W=W.slice(3),H=!0;else if(W.startsWith("*")&&!W.startsWith("*/"))W=W.slice(1),H=!0;let le=W.slice(0,G(W));W=W.slice(le.length);let fe=W.trimEnd(),Ae=fe.endsWith("*/")?fe.slice(0,-2).trimEnd():W;return{indent:H?le.slice(1):le,content:Ae}}function pl(s,k,W){let H=W>k&&s.charCodeAt(W-1)===13?W-1:W;return s.slice(k,H)}function ul(s){let k=[],W=0;while(!0){let H=s.indexOf("/**",W);if(H===-1)break;let le=s.lastIndexOf(`
183
+ `,H-1)+1;if(s.charCodeAt(H+3)===42||s.slice(le,H).trim()!==""){W=H+1;continue}let fe=[],Ae=le,De=!1,Re=0;while(Ae<=s.length){let $e=s.indexOf(`
184
+ `,Ae),Le=$e===-1?s.length:$e,Be=pl(s,Ae,Le),{indent:Fe,content:Me}=cl(Be,fe.length===0);fe.push({raw:Be,start:Ae,number:fe.length,indent:Fe,content:Me});let je=Be.trimEnd();if(je.endsWith("*/")){De=!0,Re=Ae+je.length,W=Le;break}if($e===-1)break;Ae=$e+1}if(!De)break;k.push({start:H,end:Re,lines:fe})}return k}function ll(s){let k=s;if(k.length>0&&k[0].content==="")k=k.slice(1);if(k.length>0&&k[k.length-1].content==="")k=k.slice(0,-1);return k}function fl(s){let k=[[]],W=!1;for(let H of s){if(sl.test(H.content)&&!W)k.push([H]);else k[k.length-1].push(H);if(Y(H.content))W=!W}return k}function Y(s){return dl(s,"```")%2===1}function dl(s,k){let W=0,H=s.indexOf(k);while(H!==-1)W++,H=s.indexOf(k,H+k.length);return W}function ko(s){return s.map((k)=>k.indent+k.content).join(`
185
+ `)}function hl(s,k){let W=k;while(W<s.length-1&&s[W].content.trim()==="")W++;if(s[W].content[0]!=="{")return null;let H=0,le,fe=!1,Ae=[],De=W;for(;De<s.length;De++){let Le=s[De].content,Be=0;for(let Fe of Le){if(Be++,le!==void 0){if(fe)fe=!1;else if(Fe==="\\")fe=!0;else if(Fe===le)le=void 0;continue}if(Fe==='"'||Fe==="'"||Fe==="`")le=Fe;else if(Fe==="{")H++;else if(Fe==="}")H--;if(H===0)break}if(Ae.push(Be),H===0)break}if(H!==0)return null;let Re=De;return{type:Ae.map((Le,Be)=>{let Fe=W+Be,Me=s[Fe].content.slice(0,Le);if(s[Fe].content=s[Fe].content.slice(Le).replace(Ei,""),Fe>0)s[Fe].continuesType=!0;return Be===0?Me:s[Fe].indent+Me}).join(`
186
+ `).slice(1,-1),endIndex:Re}}function ml(s){let k=s.content.match(Ei)?.[0]??"",W=s.content.slice(k.length),H=0,le=0;for(let $e of W){if(H===0&&So.test($e))break;if($e==="[")H++;if($e==="]")H--;le++}let fe=H===0?W.slice(0,le):"";if(!fe)return null;let Ae=fe,De=!1,Re;if(fe.startsWith("[")&&fe.endsWith("]")){De=!0;let Le=fe.slice(1,-1).split("=");if(Ae=Le[0].trim(),Le.length>1)Re=Le.slice(1).join("=").trim();if(!Ae)return null}if(Ae.length>1&&(Ae[0]==='"'||Ae[0]==="'")&&Ae[Ae.length-1]===Ae[0])Ae=Ae.slice(1,-1);return s.content=W.slice(le).replace(Ei,""),{name:Ae,optional:De,default:Re}}function gl(s){let k=s[0],W=k.content.match(ol),H=W?W[1]:"",le=W?k.content.slice(W[0].length):k.content,fe=le.trimEnd(),Ae=s.slice(1).map((Me)=>Me.indent+Me.content),De=(fe?[fe,...Ae]:Ae).join(`
187
+ `);k.content=le,k.tag=H;let Re=hl(s,0),$e=Re?.type??"",Le=Re?.endIndex??0;if(al.has(H))while(Le<s.length-1&&s[Le].content.trim()==="")Le++;let Be=ml(s[Le]),Fe=ko(s.slice(Le));return{tag:H,name:Be?.name??"",type:$e,optional:Be?.optional??!1,default:Be?.default,description:Fe,text:De,lines:s}}function yl(s,k,W){let H=ll(s);H.forEach((Ae,De)=>{Ae.number=De});let le=fl(H),fe=le.slice(1).map(gl);return{description:ko(le[0]),tags:fe,start:k,end:W,lines:H}}function v(s){return ul(s).map(({start:k,end:W,lines:H})=>yl(H,k,W))}var In=null,bi=null;function Xt(){if(In)return Promise.resolve(In);if(!bi)bi=import("./chunk-r92p6t72.js").then((s)=>(In=s,s));return bi}function Wt(){if(!In)throw Error("sveld: internal error, parser stack read before loadParserStack() resolved.");return In}var Si=[".ts",".mts",".cts",".tsx",".js",".mjs",".cjs",".jsx",".d.ts"],kl=/\r?\n/,wl=/^\s*\*+/;function Ti(s=new Map){return{cache:new Map,computing:new Set,modules:s}}function Xe(s){return s&&typeof s==="object"?s:void 0}function Gt(s){return Array.isArray(s)?s:[]}function xt(s){return e(s)?s.name:void 0}function Pl(s){return s==="."||s===".."||s.startsWith("./")||s.startsWith("../")||El(s)}function wt(s,k){let W=ni(s,k);if(W===s&&!Pl(s))return null;let H=Ai(k,W),le=_i(H),fe=Cl(H);if(h(le,fe)){let Ae=ce(le,fe),De=Ae&&!Ae.isSymbolicLink()?Ae:vl(H,{throwIfNoEntry:!1});if(De?.isFile())return H;for(let Re of Si)if(h(le,fe+Re))return H+Re;if(De?.isDirectory()){for(let Re of Si)if(h(H,`index${Re}`))return bl(H,`index${Re}`)}return null}for(let Ae of Si)if(h(le,fe+Ae))return H+Ae;return pe(H)??null}function _l(s){let k=s.trimEnd();for(;;){let W=k.lastIndexOf(`
188
+ `)+1;if(k.slice(W).trimStart().startsWith("//")){k=k.slice(0,W).trimEnd();continue}let H=k.endsWith("*/")?k.lastIndexOf("/*",k.length-3):-1;if(H!==-1&&k[H+2]!=="*"){k=k.slice(0,H).trimEnd();continue}return k}}function Al(s,k){let W=_l(s.slice(0,k));if(!W.endsWith("*/"))return;let H=W.length-2,le=W.lastIndexOf("/**",H);if(le===-1)return;return W.slice(le,H+2)}function Tl(s){let k=[];for(let W of s.slice(3,-2).split(kl)){let H=W.replace(wl,"").trim();if(H.startsWith("@"))break;if(H)k.push(H)}return k.join(" ")||void 0}function cn(s,k){if(!k)return;return s.text.slice(k.start,k.end)}function Nl(s,k){let W=Xe(k?.typeAnnotation);if(W?.type!=="TSTypeAnnotation")return;return cn(s,Xe(W.typeAnnotation))}function ki(s,k){let W=Xe(k.returnType);return W?.type==="TSTypeAnnotation"?cn(s,Xe(W.typeAnnotation)):void 0}function wi(s,k){let W=Gt(k.params).map((le)=>cn(s,le)??"").join(", "),H=ki(s,k);return`(${W})${H?` => ${H}`:""}`}function _o(s){if(s.type==="Literal"){let k=s.value;if(typeof k==="string")return"string";if(typeof k==="number")return"number";if(typeof k==="boolean")return"boolean"}if(s.type==="TemplateLiteral")return"string";return}function Dl(s,k){let W=cn(s,k);if(W===void 0)return;if(k.type==="Literal"){let le=k.value;if(typeof le==="string"||typeof le==="number"||typeof le==="boolean")return{raw:W,value:le,type:typeof le};return}if(k.type==="UnaryExpression"&&k.operator==="-"){let le=Xe(k.argument);if(le?.type==="Literal"&&typeof le.value==="number")return{raw:W,value:-le.value,type:"number"};return}let H=k.type==="TemplateLiteral"?f(k):null;return H===null?void 0:{raw:W,value:H,type:"string"}}function Rl(s,k){if(s.type!=="CallExpression"&&s.type!=="NewExpression")return;let W=Xe(s.callee);if(!(xt(W)==="Symbol"||W?.type==="MemberExpression"&&!W.computed&&xt(Xe(W.object))==="Symbol"&&xt(Xe(W.property))==="for"))return;return f(Gt(s.arguments)[0])||k}var Il=new Set(["any","bigint","boolean","false","never","null","number","object","readonly","string","symbol","true","undefined","unknown","void"]),Ol=/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/g,$l=/(?<![\w$.])[A-Za-z_$][\w$]*(?![\w$]|\s*\??:)/g;function Ll(s,k){let W=k?Wt().getCommentTags(v(k)).type?.type.trim():void 0,H=s?{type:s,source:"typescript"}:W?{type:W,source:"jsdoc"}:void 0;if(!H||H.type.includes("`"))return;return(H.type.replace(Ol,'""').match($l)??[]).every((fe)=>Il.has(fe))?H:void 0}function Ml(s){if(!s)return;let k=s.lastIndexOf("=>");if(k===-1)return;return s.slice(k+2).trim()||void 0}function wo(s){if(s.async||s.generator)return;let k=Xe(s.body);if(!k)return;let W=[];if(k.type==="BlockStatement"){if(On(k,W),W.length===0)return}else W.push(k);let H;for(let le of W){if(!le)return;let fe=_o(le);if(!fe)return;if(H===void 0)H=fe;else if(H!==fe)return}return H}function On(s,k){for(let W of Gt(s.body)){if(W.type==="FunctionDeclaration"||W.type==="FunctionExpression"||W.type==="ArrowFunctionExpression")continue;if(W.type==="ReturnStatement"){k.push(Xe(W.argument)??null);continue}if(W.type==="BlockStatement"){On(W,k);continue}let H=Xe(W.consequent);if(H?.type==="BlockStatement")On(H,k);else if(H?.type==="ReturnStatement")k.push(Xe(H.argument)??null);let le=Xe(W.alternate);if(le?.type==="BlockStatement")On(le,k);else if(le?.type==="ReturnStatement")k.push(Xe(le.argument)??null);let fe=Xe(W.body);if(fe?.type==="BlockStatement")On(fe,k)}}function Fl(s){let k=Xe(s.initializer);if(!k)return;if(k.type==="Literal"){let W=k.value;return typeof W==="string"||typeof W==="number"?W:void 0}if(k.type==="UnaryExpression"){let W=Xe(k.argument);if(k.operator==="-"&&W?.type==="Literal"){let le=W.value;if(typeof le==="number")return-le}}return}function Bl(s){let k=Gt(s.members);if(k.length===0)return;let W=[],H=0;for(let le of k){if(!Xe(le.initializer)){W.push(String(H)),H+=1;continue}let Ae=Fl(le);if(Ae===void 0)return;W.push(typeof Ae==="string"?JSON.stringify(Ae):String(Ae)),H=typeof Ae==="number"?Ae+1:H}return W.join(" | ")}function Pi(s,k,W,H){let le=s.filePath,fe=Al(s.text,W),Ae=fe?Tl(fe):void 0,De=fe?Wt().extractJsDocReturnType(fe):void 0,{deprecated:Re,tags:$e,internal:Le}=fe?Wt().extractJsDocDeprecatedAndTags(fe):{deprecated:void 0,tags:void 0,internal:!1},Be=Le?{internal:!0}:{};if(k.type==="VariableDeclaration"){let Fe=k.kind??"const",Me=[];for(let je of Gt(k.declarations)){let Ve=Xe(je.id),We=xt(Ve);if(!We)continue;let He=Nl(s,Ve),qe=He,Ge,ze,Ze,st,dt,mt,at=Xe(je.init);if(at)if(at.type==="ArrowFunctionExpression"||at.type==="FunctionExpression"){if(mt=at,!qe)qe=wi(s,at);ze=ki(s,at)??De??Ml(qe)??wo(at)}else{if(Ge=cn(s,at),!qe)qe=_o(at);let bt=Xe(x(at))??at;if(Ze=f(bt)??Rl(bt,We),Fe==="const")st=Dl(s,bt),dt=Ll(He,fe)}Me.push({name:We,kind:Fe,type:qe,value:Ge,returnType:ze,literalValue:Ze,primitiveLiteral:st,declaredType:dt,functionNode:mt,description:Ae,deprecated:Re,tags:$e,...Be,declFile:le,isTypeOnly:!1})}return Me}if(k.type==="FunctionDeclaration"||k.type==="TSDeclareFunction"){let Fe=xt(Xe(k.id))??H;if(!Fe)return[];return[{name:Fe,kind:"function",type:wi(s,k),returnType:ki(s,k)??De??wo(k),...k.type==="FunctionDeclaration"?{functionNode:k}:{},description:Ae,deprecated:Re,tags:$e,...Be,declFile:le,isTypeOnly:!1}]}if(k.type==="ClassDeclaration"){let Fe=xt(Xe(k.id)),Me=Fe??H;if(!Me)return[];return[{name:Me,kind:"class",...Fe?{type:Fe}:{},description:Ae,deprecated:Re,tags:$e,...Be,declFile:le,isTypeOnly:!1}]}if(k.type==="TSTypeAliasDeclaration"){let Fe=xt(Xe(k.id));if(!Fe)return[];return[{name:Fe,kind:"type",type:cn(s,Xe(k.typeAnnotation)),description:Ae,deprecated:Re,tags:$e,...Be,declFile:le,isTypeOnly:!0}]}if(k.type==="TSInterfaceDeclaration"){let Fe=xt(Xe(k.id));if(!Fe)return[];return[{name:Fe,kind:"interface",type:cn(s,Xe(k.body)),description:Ae,deprecated:Re,tags:$e,...Be,declFile:le,isTypeOnly:!0}]}if(k.type==="TSEnumDeclaration"){let Fe=xt(Xe(k.id));if(!Fe)return[];return[{name:Fe,kind:"enum",type:Bl(k)??Fe,description:Ae,deprecated:Re,tags:$e,...Be,declFile:le,isTypeOnly:!1}]}return[]}function jl(s,k,W){let H=Xe(k.declaration);if(!H)return;if(H.type==="FunctionDeclaration"||H.type==="TSDeclareFunction"||H.type==="ClassDeclaration"){let[Ae]=Pi(s,H,k.start,"default");return Ae?{...Ae,name:"default"}:void 0}if(H.type==="FunctionExpression"||H.type==="ArrowFunctionExpression")return{name:"default",kind:"function",type:wi(s,H),functionNode:H,declFile:s.filePath,isTypeOnly:!1};let le=xt(H),fe=le?W(le):null;return fe?{...fe,name:"default"}:void 0}function Vl(s){let k;try{k=xl(s,"utf-8")}catch{return null}try{let W;if(s.endsWith(".svelte")){let H=Wt().parseSvelte(k);W=Gt(H.module?.content?.body)}else W=Gt(Wt().parseProgram(k,!0,[]).body);return{source:{text:k,filePath:s,dir:_i(s)},body:W}}catch(W){let H=W instanceof Error?W.message:String(W);return xr(`Warning: sveld couldn't parse ${s} to read its exports (${H}); skipping it.`),null}}function Wl(s,k){for(let W of s){if(W.type!=="ImportDeclaration")continue;let H=Xe(W.source)?.value;if(typeof H!=="string")continue;for(let le of Gt(W.specifiers)){if(xt(Xe(le.local))!==k)continue;let fe=W.importKind==="type"||le.importKind==="type";if(le.type==="ImportDefaultSpecifier")return{specifier:H,importedName:"default",isTypeOnly:fe};if(le.type==="ImportNamespaceSpecifier")return{specifier:H,importedName:"*",isTypeOnly:fe};if(le.type==="ImportSpecifier"){let Ae=xt(Xe(le.imported))??k;return{specifier:H,importedName:Ae,isTypeOnly:fe}}}}return null}function Po(s,k,W){return{name:s,kind:"const",declFile:k,namespaceFile:k,isTypeOnly:W}}function Ni(s,k){let W=k.cache.get(s);if(W)return W;if(k.computing.has(s))return[];k.computing.add(s);let H=k.modules.get(s);if(H===void 0)H=Vl(s),k.modules.set(s,H);if(!H)return k.computing.delete(s),k.cache.set(s,[]),[];let{source:le,body:fe}=H,Ae=[],De=new Map;for(let Fe of fe){let Me=Fe.type==="ExportNamedDeclaration"?Xe(Fe.declaration):Fe;if(!Me)continue;for(let je of Pi(le,Me,Me.start))De.set(je.name,je)}let Re=(Fe,Me)=>({name:Fe,kind:"const",declFile:Ai(le.dir,Me),isTypeOnly:!1}),$e=(Fe)=>{let Me=De.get(Fe);if(Me)return Me;let je=Wl(fe,Fe);if(!je)return null;if(je.specifier.endsWith(".svelte"))return Re(Fe,je.specifier);let Ve=wt(je.specifier,le.dir);if(!Ve)return null;if(je.importedName==="*")return Po(Fe,Ve,je.isTypeOnly);return pn(Ve,je.importedName,k)??null},Le=new Map;for(let Fe of fe){if(Fe.type==="ExportAllDeclaration"){let He=Xe(Fe.source)?.value;if(typeof He!=="string"||He.endsWith(".svelte"))continue;let qe=wt(He,le.dir);if(!qe)continue;let Ge=Fe.exportKind==="type",ze=xt(Xe(Fe.exported));if(ze){Ae.push(Po(ze,qe,Ge));continue}for(let Ze of Ni(qe,k)){let st=Le.get(Ze.name)??[];st.push(Ge?{...Ze,isTypeOnly:!0}:Ze),Le.set(Ze.name,st)}continue}if(Fe.type==="ExportDefaultDeclaration"){let He=jl(le,Fe,$e);if(He)Ae.push(He);continue}if(Fe.type!=="ExportNamedDeclaration")continue;let Me=Xe(Fe.declaration);if(Me){Ae.push(...Pi(le,Me,Fe.start));continue}let je=Xe(Fe.source)?.value,Ve=typeof je==="string"?je:void 0;if(Ve?.endsWith(".svelte")){for(let He of Gt(Fe.specifiers)){let qe=xt(Xe(He.exported));if(qe)Ae.push(Re(qe,Ve))}continue}let We=Fe.exportKind==="type";for(let He of Gt(Fe.specifiers)){if(He.type!=="ExportSpecifier")continue;let qe=xt(Xe(He.exported)),Ge=xt(Xe(He.local));if(!qe||!Ge)continue;let ze=We||He.exportKind==="type",Ze=null;if(Ve){let st=wt(Ve,le.dir);if(st)Ze=pn(st,Ge,k)??null}else Ze=$e(Ge);if(Ze)Ae.push({...Ze,name:qe,isTypeOnly:Ze.isTypeOnly||ze});else if(Ge!=="default")Ae.push({name:qe,kind:ze?"type":"const",declFile:s,isTypeOnly:ze})}}let Be=new Set(Ae.map((Fe)=>Fe.name));for(let[Fe,Me]of Le){if(Be.has(Fe)||Fe==="default")continue;if(Me.every((je)=>je.declFile===Me[0].declFile))Ae.push(...Me);else k.onAmbiguousStarExport?.(s,Fe,Me)}return k.computing.delete(s),k.cache.set(s,Ae),Ae}function pn(s,k,W){return Ni(s,W).findLast((H)=>H.name===k)}function Cn(s,{importedName:k,members:W=[]},H){let le=pn(s,k,H);for(let fe of W){if(le?.namespaceFile===void 0)return;le=pn(le.namespaceFile,fe,H)}return le}async function vr(s,k={}){await Xt();let W=Ai(s),H=_i(W),le=(De)=>t(`./${Sl(H,De)}`),fe=Ni(W,{...Ti(),onAmbiguousStarExport:(De,Re,$e)=>{if(De!==W||!k.diagnostics)return;if($e.every((Me)=>Me.declFile.endsWith(".svelte")))return;let Le=Array.from(new Set($e.map((Me)=>le(Me.declFile)))),Be=Le.map((Me)=>`"${Me}"`),Fe=`${Be.slice(0,-1).join(", ")} and ${Be[Be.length-1]}`;k.diagnostics.push(i({component:le(W),kind:"export-ambiguous",name:Re,message:`"${Re}" is exported by ${Fe} through \`export *\`, so the barrel doesn't export it and the docs leave it out; export it explicitly from the barrel (e.g. \`export { ${Re} } from "${Le[0]}"\`).`}))}}),Ae=new Map;for(let De of fe){if(De.name==="default"||De.declFile.endsWith(".svelte"))continue;let{declFile:Re,returnType:$e,literalValue:Le,primitiveLiteral:Be,declaredType:Fe,functionNode:Me,namespaceFile:je,...Ve}=De,We=le(Re);if(je!==void 0)Ve.type=`typeof import(${JSON.stringify(le(je))})`;Ae.set(De.name,{...Ve,source:We})}return Array.from(Ae.values()).sort((De,Re)=>c(De.name,Re.name))}import{readFileSync as xa}from"node:fs";import{dirname as Ui,join as _f,relative as ma,resolve as ga}from"node:path";var ge={};Oc(ge,{Node:()=>Bn,Parser:()=>n,Position:()=>En,SourceLocation:()=>Mn,TokContext:()=>Rt,Token:()=>Dr,TokenType:()=>it,defaultOptions:()=>Er,getLineInfo:()=>Fi,isIdentifierChar:()=>u,isIdentifierStart:()=>p,isNewLine:()=>ln,keywordTypes:()=>Pr,lineBreak:()=>Et,lineBreakG:()=>$o,nonASCIIwhitespace:()=>Mi,parse:()=>Hi,parseExpressionAt:()=>wf,tokContexts:()=>ut,tokTypes:()=>Oe,tokenizer:()=>Pf,version:()=>ha});var Gl=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],Ro=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],Hl="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",Io="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Di={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"},Ri="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",Ul={5:Ri,"5module":Ri+" export import",6:Ri+" const class extends export import super"},Oo=/^in(stanceof)?$/,Kl=new RegExp("["+Io+"]"),ql=new RegExp("["+Io+Hl+"]");function Ii(s,k){var W=65536;for(var H=0;H<k.length;H+=2){if(W+=k[H],W>s)return!1;if(W+=k[H+1],W>=s)return!0}return!1}function p(s,k){if(s<65)return s===36;if(s<91)return!0;if(s<97)return s===95;if(s<123)return!0;if(s<=65535)return s>=170&&Kl.test(String.fromCharCode(s));if(k===!1)return!1;return Ii(s,Ro)}function u(s,k){if(s<48)return s===36;if(s<58)return!0;if(s<65)return!1;if(s<91)return!0;if(s<97)return s===95;if(s<123)return!0;if(s<=65535)return s>=170&&ql.test(String.fromCharCode(s));if(k===!1)return!1;return Ii(s,Ro)||Ii(s,Gl)}var it=function(k,W){if(W===void 0)W={};this.label=k,this.keyword=W.keyword,this.beforeExpr=!!W.beforeExpr,this.startsExpr=!!W.startsExpr,this.isLoop=!!W.isLoop,this.isAssign=!!W.isAssign,this.prefix=!!W.prefix,this.postfix=!!W.postfix,this.binop=W.binop||null,this.updateContext=null};function Nt(s,k){return new it(s,{beforeExpr:!0,binop:k})}var Dt={beforeExpr:!0},Pt={startsExpr:!0},Pr={};function rt(s,k){if(k===void 0)k={};return k.keyword=s,Pr[s]=new it(s,k)}var Oe={num:new it("num",Pt),regexp:new it("regexp",Pt),string:new it("string",Pt),name:new it("name",Pt),privateId:new it("privateId",Pt),eof:new it("eof"),bracketL:new it("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new it("]"),braceL:new it("{",{beforeExpr:!0,startsExpr:!0}),braceR:new it("}"),parenL:new it("(",{beforeExpr:!0,startsExpr:!0}),parenR:new it(")"),comma:new it(",",Dt),semi:new it(";",Dt),colon:new it(":",Dt),dot:new it("."),question:new it("?",Dt),questionDot:new it("?."),arrow:new it("=>",Dt),template:new it("template"),invalidTemplate:new it("invalidTemplate"),ellipsis:new it("...",Dt),backQuote:new it("`",Pt),dollarBraceL:new it("${",{beforeExpr:!0,startsExpr:!0}),eq:new it("=",{beforeExpr:!0,isAssign:!0}),assign:new it("_=",{beforeExpr:!0,isAssign:!0}),incDec:new it("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new it("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:Nt("||",1),logicalAND:Nt("&&",2),bitwiseOR:Nt("|",3),bitwiseXOR:Nt("^",4),bitwiseAND:Nt("&",5),equality:Nt("==/!=/===/!==",6),relational:Nt("</>/<=/>=",7),bitShift:Nt("<</>>/>>>",8),plusMin:new it("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:Nt("%",10),star:Nt("*",10),slash:Nt("/",10),starstar:new it("**",{beforeExpr:!0}),coalesce:Nt("??",1),_break:rt("break"),_case:rt("case",Dt),_catch:rt("catch"),_continue:rt("continue"),_debugger:rt("debugger"),_default:rt("default",Dt),_do:rt("do",{isLoop:!0,beforeExpr:!0}),_else:rt("else",Dt),_finally:rt("finally"),_for:rt("for",{isLoop:!0}),_function:rt("function",Pt),_if:rt("if"),_return:rt("return",Dt),_switch:rt("switch"),_throw:rt("throw",Dt),_try:rt("try"),_var:rt("var"),_const:rt("const"),_while:rt("while",{isLoop:!0}),_with:rt("with"),_new:rt("new",{beforeExpr:!0,startsExpr:!0}),_this:rt("this",Pt),_super:rt("super",Pt),_class:rt("class",Pt),_extends:rt("extends",Dt),_export:rt("export"),_import:rt("import",Pt),_null:rt("null",Pt),_true:rt("true",Pt),_false:rt("false",Pt),_in:rt("in",{beforeExpr:!0,binop:7}),_instanceof:rt("instanceof",{beforeExpr:!0,binop:7}),_typeof:rt("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:rt("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:rt("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Et=/\r\n?|\n|\u2028|\u2029/,$o=new RegExp(Et.source,"g");function ln(s){return s===10||s===13||s===8232||s===8233}function Lo(s,k,W){if(W===void 0)W=s.length;for(var H=k;H<W;H++){var le=s.charCodeAt(H);if(ln(le))return H<W-1&&le===13&&s.charCodeAt(H+1)===10?H+2:H+1}return-1}var Mi=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,yt=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Mo=Object.prototype,{hasOwnProperty:zl,toString:Xl}=Mo,bn=Object.hasOwn||function(s,k){return zl.call(s,k)},Ao=Array.isArray||function(s){return Xl.call(s)==="[object Array]"},To=Object.create(null);function tn(s){return To[s]||(To[s]=new RegExp("^(?:"+s.replace(/ /g,"|")+")$"))}function Jt(s){if(s<=65535)return String.fromCharCode(s);return s-=65536,String.fromCharCode((s>>10)+55296,(s&1023)+56320)}var Jl=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,En=function(k,W){this.line=k,this.column=W};En.prototype.offset=function(k){return new En(this.line,this.column+k)};var Mn=function(k,W,H){if(this.start=W,this.end=H,k.sourceFile!==null)this.source=k.sourceFile};function Fi(s,k){for(var W=1,H=0;;){var le=Lo(s,H,k);if(le<0)return new En(W,k-H);++W,H=le}}var Er={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},No=!1;function Yl(s){var k={};for(var W in Er)k[W]=s&&bn(s,W)?s[W]:Er[W];if(k.ecmaVersion==="latest")k.ecmaVersion=1e8;else if(k.ecmaVersion==null){if(!No&&typeof console==="object"&&console.warn)No=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
189
+ Defaulting to 2020, but this will stop working in the future.`);k.ecmaVersion=11}else if(k.ecmaVersion>=2015)k.ecmaVersion-=2009;if(k.allowReserved==null)k.allowReserved=k.ecmaVersion<5;if(!s||s.allowHashBang==null)k.allowHashBang=k.ecmaVersion>=14;if(Ao(k.onToken)){var H=k.onToken;k.onToken=function(le){return H.push(le)}}if(Ao(k.onComment))k.onComment=Ql(k,k.onComment);if(k.sourceType==="commonjs"&&k.allowAwaitOutsideFunction)throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return k}function Ql(s,k){return function(W,H,le,fe,Ae,De){var Re={type:W?"Block":"Line",value:H,start:le,end:fe};if(s.locations)Re.loc=new Mn(this,Ae,De);if(s.ranges)Re.range=[le,fe];k.push(Re)}}var un=1,fn=2,Bi=4,Fo=8,ji=16,Bo=32,_r=64,jo=128,dn=256,Fn=512,Vo=1024,Ar=un|fn|dn;function Vi(s,k){return fn|(s?Bi:0)|(k?Fo:0)}var br=0,Wi=1,Qt=2,Wo=3,Go=4,Ho=5,n=function(k,W,H){this.options=k=Yl(k),this.sourceFile=k.sourceFile,this.keywords=tn(Ul[k.ecmaVersion>=6?6:k.sourceType==="module"?"5module":5]);var le="";if(k.allowReserved!==!0){if(le=Di[k.ecmaVersion>=6?6:k.ecmaVersion===5?5:3],k.sourceType==="module")le+=" await"}this.reservedWords=tn(le);var fe=(le?le+" ":"")+Di.strict;if(this.reservedWordsStrict=tn(fe),this.reservedWordsStrictBind=tn(fe+" "+Di.strictBind),this.input=String(W),this.containsEsc=!1,this.pos=H||0,this.curLine=1,k.startLocation)this.lineStart=this.pos-k.startLocation.column,this.curLine=k.startLocation.line;else if(H){if(this.lineStart=this.input.lastIndexOf(`
190
+ `,H-1)+1,this.options.locations)this.curLine=this.input.slice(0,this.lineStart).split(Et).length}else this.lineStart=0;if(this.type=Oe.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=k.sourceType==="module",this.strict=this.inModule||k.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&&k.allowHashBang&&this.input.slice(0,2)==="#!")this.skipLineComment(2);this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?fn:un),this.regexpState=null,this.privateNameStack=[]},Ot={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}};n.prototype.parse=function(){var k=this,W=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return k.parseTopLevel(W)})};Ot.inFunction.get=function(){return(this.currentVarScope().flags&fn)>0};Ot.inGenerator.get=function(){return(this.currentVarScope().flags&Fo)>0};Ot.inAsync.get=function(){return(this.currentVarScope().flags&Bi)>0};Ot.canAwait.get=function(){for(var s=this.scopeStack.length-1;s>=0;s--){var k=this.scopeStack[s],W=k.flags;if(W&(dn|Fn))return!1;if(W&fn)return(W&Bi)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Ot.allowReturn.get=function(){if(this.inFunction)return!0;if(this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&un)return!0;return!1};Ot.allowSuper.get=function(){var s=this.currentThisScope(),k=s.flags;return(k&_r)>0||this.options.allowSuperOutsideMethod};Ot.allowDirectSuper.get=function(){return(this.currentThisScope().flags&jo)>0};Ot.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Ot.allowNewDotTarget.get=function(){for(var s=this.scopeStack.length-1;s>=0;s--){var k=this.scopeStack[s],W=k.flags;if(W&(dn|Fn)||W&fn&&!(W&ji))return!0}return!1};Ot.allowUsing.get=function(){var s=this.currentScope(),k=s.flags;if(k&Vo)return!1;if(!this.inModule&&k&un)return!1;return!0};Ot.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&dn)>0};n.extend=function(){var k=[],W=arguments.length;while(W--)k[W]=arguments[W];var H=this;for(var le=0;le<k.length;le++)H=k[le](H);return H};n.parse=function(k,W){return new this(W,k).parse()};n.parseExpressionAt=function(k,W,H){var le=new this(H,k,W);return le.nextToken(),le.parseExpression()};n.tokenizer=function(k,W){return new this(W,k)};Object.defineProperties(n.prototype,Ot);var vt=n.prototype,Zl=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;vt.strictDirective=function(s){if(this.options.ecmaVersion<5)return!1;for(;;){yt.lastIndex=s,s+=yt.exec(this.input)[0].length;var k=Zl.exec(this.input.slice(s));if(!k)return!1;if((k[1]||k[2])==="use strict"){yt.lastIndex=s+k[0].length;var W=yt.exec(this.input),H=W.index+W[0].length,le=this.input.charAt(H);return le===";"||le==="}"||Et.test(W[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(le)||le==="!"&&this.input.charAt(H+1)==="=")}if(s+=k[0].length,yt.lastIndex=s,s+=yt.exec(this.input)[0].length,this.input[s]===";")s++}};vt.eat=function(s){if(this.type===s)return this.next(),!0;else return!1};vt.isContextual=function(s){return this.type===Oe.name&&this.value===s&&!this.containsEsc};vt.eatContextual=function(s){if(!this.isContextual(s))return!1;return this.next(),!0};vt.catchStackOverflow=function(s){try{return s()}catch(k){if(k instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(k.message)||/\btoo much recursion\b/i.test(k.message)))this.raise(this.start,"Not enough stack space to parse input");else throw k}};vt.expectContextual=function(s){if(!this.eatContextual(s))this.unexpected()};vt.canInsertSemicolon=function(){return this.type===Oe.eof||this.type===Oe.braceR||Et.test(this.input.slice(this.lastTokEnd,this.start))};vt.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return!0}};vt.semicolon=function(){if(!this.eat(Oe.semi)&&!this.insertSemicolon())this.unexpected()};vt.afterTrailingComma=function(s,k){if(this.type===s){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);if(!k)this.next();return!0}};vt.expect=function(s){this.eat(s)||this.unexpected()};vt.unexpected=function(s){this.raise(s!=null?s:this.start,"Unexpected token")};var Tr=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};vt.checkPatternErrors=function(s,k){if(!s)return;if(s.trailingComma>-1)this.raiseRecoverable(s.trailingComma,"Comma is not permitted after the rest element");var W=k?s.parenthesizedAssign:s.parenthesizedBind;if(W>-1)this.raiseRecoverable(W,k?"Assigning to rvalue":"Parenthesized pattern")};vt.checkExpressionErrors=function(s,k){if(!s)return!1;var{shorthandAssign:W,doubleProto:H}=s;if(!k)return W>=0||H>=0;if(W>=0)this.raise(W,"Shorthand property assignments are valid only in destructuring patterns");if(H>=0)this.raiseRecoverable(H,"Redefinition of __proto__ property")};vt.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")};vt.isSimpleAssignTarget=function(s){if(s.type==="ParenthesizedExpression")return this.isSimpleAssignTarget(s.expression);return s.type==="Identifier"||s.type==="MemberExpression"};var Ke=n.prototype;Ke.parseTopLevel=function(s){var k=Object.create(null);if(!s.body)s.body=[];while(this.type!==Oe.eof){var W=this.parseStatement(null,!0,k);s.body.push(W)}if(this.inModule)for(var H=0,le=Object.keys(this.undefinedExports);H<le.length;H+=1){var fe=le[H];this.raiseRecoverable(this.undefinedExports[fe].start,"Export '"+fe+"' is not defined")}return this.adaptDirectivePrologue(s.body),this.next(),s.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(s,"Program")};var Gi={kind:"loop"},ef={kind:"switch"};Ke.isLet=function(s){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;yt.lastIndex=this.pos;var k=yt.exec(this.input),W=this.pos+k[0].length,H=this.fullCharCodeAt(W);if(H===91||H===92)return!0;if(s)return!1;if(H===123)return!0;if(p(H)){var le=W;do W+=H<=65535?1:2;while(u(H=this.fullCharCodeAt(W)));if(H===92)return!0;var fe=this.input.slice(le,W);if(!Oo.test(fe))return!0}return!1};Ke.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;yt.lastIndex=this.pos;var s=yt.exec(this.input),k=this.pos+s[0].length,W;return!Et.test(this.input.slice(this.pos,k))&&this.input.slice(k,k+8)==="function"&&(k+8===this.input.length||!(u(W=this.fullCharCodeAt(k+8))||W===92))};Ke.isUsingKeyword=function(s,k){if(this.options.ecmaVersion<17||!this.isContextual(s?"await":"using"))return!1;yt.lastIndex=this.pos;var W=yt.exec(this.input),H=this.pos+W[0].length;if(Et.test(this.input.slice(this.pos,H)))return!1;if(s){var le=H+5,fe;if(this.input.slice(H,le)!=="using"||le===this.input.length||u(fe=this.fullCharCodeAt(le))||fe===92)return!1;yt.lastIndex=le;var Ae=yt.exec(this.input);if(H=le+Ae[0].length,Ae&&Et.test(this.input.slice(le,H)))return!1}var De=this.fullCharCodeAt(H);if(!p(De)&&De!==92)return!1;var Re=H;do H+=De<=65535?1:2;while(u(De=this.fullCharCodeAt(H)));if(De===92)return!0;var $e=this.input.slice(Re,H);if(Oo.test($e))return!1;if(k&&!s&&$e==="of"){yt.lastIndex=H;var Le=yt.exec(this.input);if(H=H+Le[0].length,this.input.charCodeAt(H)!==61||(De=this.input.charCodeAt(H+1))===61||De===62)return!1}return!0};Ke.isAwaitUsing=function(s){return this.isUsingKeyword(!0,s)};Ke.isUsing=function(s){return this.isUsingKeyword(!1,s)};Ke.parseStatement=function(s,k,W){var H=this.type,le=this.startNode(),fe;if(this.isLet(s))H=Oe._var,fe="let";switch(H){case Oe._break:case Oe._continue:return this.parseBreakContinueStatement(le,H.keyword);case Oe._debugger:return this.parseDebuggerStatement(le);case Oe._do:return this.parseDoStatement(le);case Oe._for:return this.parseForStatement(le);case Oe._function:if(s&&(this.strict||s!=="if"&&s!=="label")&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(le,!1,!s);case Oe._class:if(s)this.unexpected();return this.parseClass(le,!0);case Oe._if:return this.parseIfStatement(le);case Oe._return:return this.parseReturnStatement(le);case Oe._switch:return this.parseSwitchStatement(le);case Oe._throw:return this.parseThrowStatement(le);case Oe._try:return this.parseTryStatement(le);case Oe._const:case Oe._var:if(fe=fe||this.value,s&&fe!=="var")this.unexpected();return this.parseVarStatement(le,fe);case Oe._while:return this.parseWhileStatement(le);case Oe._with:return this.parseWithStatement(le);case Oe.braceL:return this.parseBlock(!0,le);case Oe.semi:return this.parseEmptyStatement(le);case Oe._export:case Oe._import:if(this.options.ecmaVersion>10&&H===Oe._import){yt.lastIndex=this.pos;var Ae=yt.exec(this.input),De=this.pos+Ae[0].length,Re=this.input.charCodeAt(De);if(Re===40||Re===46)return this.parseExpressionStatement(le,this.parseExpression())}if(!this.options.allowImportExportEverywhere){if(!k)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 H===Oe._import?this.parseImport(le):this.parseExport(le,W);default:if(this.isAsyncFunction()){if(s)this.unexpected();return this.next(),this.parseFunctionStatement(le,!0,!s)}var $e=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if($e){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(s)this.raise(this.start,"Using declaration is not allowed in single-statement positions");if($e==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.next(),this.parseVar(le,!1,$e),this.semicolon(),this.finishNode(le,"VariableDeclaration")}var Le=this.value,Be=this.parseExpression();if(H===Oe.name&&Be.type==="Identifier"&&this.eat(Oe.colon))return this.parseLabeledStatement(le,Le,Be,s);else return this.parseExpressionStatement(le,Be)}};Ke.parseBreakContinueStatement=function(s,k){var W=k==="break";if(this.next(),this.eat(Oe.semi)||this.insertSemicolon())s.label=null;else if(this.type!==Oe.name)this.unexpected();else s.label=this.parseIdent(),this.semicolon();var H=0;for(;H<this.labels.length;++H){var le=this.labels[H];if(s.label==null||le.name===s.label.name){if(le.kind!=null&&(W||le.kind==="loop"))break;if(s.label&&W)break}}if(H===this.labels.length)this.raise(s.start,"Unsyntactic "+k);return this.finishNode(s,W?"BreakStatement":"ContinueStatement")};Ke.parseDebuggerStatement=function(s){return this.next(),this.semicolon(),this.finishNode(s,"DebuggerStatement")};Ke.parseDoStatement=function(s){if(this.next(),this.labels.push(Gi),s.body=this.parseStatement("do"),this.labels.pop(),this.expect(Oe._while),s.test=this.parseParenExpression(),this.options.ecmaVersion>=6)this.eat(Oe.semi);else this.semicolon();return this.finishNode(s,"DoWhileStatement")};Ke.parseForStatement=function(s){this.next();var k=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Gi),this.enterScope(0),this.expect(Oe.parenL),this.type===Oe.semi){if(k>-1)this.unexpected(k);return this.parseFor(s,null)}var W=this.isLet();if(this.type===Oe._var||this.type===Oe._const||W){var H=this.startNode(),le=W?"let":this.value;return this.next(),this.parseVar(H,!0,le),this.finishNode(H,"VariableDeclaration"),this.parseForAfterInit(s,H,k)}var fe=this.isContextual("let"),Ae=!1,De=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(De){var Re=this.startNode();if(this.next(),De==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.parseVar(Re,!0,De),this.finishNode(Re,"VariableDeclaration"),this.parseForAfterInit(s,Re,k)}var $e=this.containsEsc,Le=new Tr,Be=this.start,Fe=k>-1?this.parseExprSubscripts(Le,"await"):this.parseExpression(!0,Le);if(this.type===Oe._in||(Ae=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(k>-1){if(this.type===Oe._in)this.unexpected(k);s.await=!0}else if(Ae&&this.options.ecmaVersion>=8){if(Fe.start===Be&&!$e&&Fe.type==="Identifier"&&Fe.name==="async")this.unexpected();else if(this.options.ecmaVersion>=9)s.await=!1}if(fe&&Ae)this.raise(Fe.start,"The left-hand side of a for-of loop may not start with 'let'.");return this.toAssignable(Fe,!1,Le),this.checkLValPattern(Fe),this.parseForIn(s,Fe)}else this.checkExpressionErrors(Le,!0);if(k>-1)this.unexpected(k);return this.parseFor(s,Fe)};Ke.parseForAfterInit=function(s,k,W){if((this.type===Oe._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&k.declarations.length===1){if(this.type===Oe._in){if((k.kind==="using"||k.kind==="await using")&&!k.declarations[0].init)this.raise(this.start,"Using declaration is not allowed in for-in loops");if(this.options.ecmaVersion>=9&&W>-1)this.unexpected(W)}else if(this.options.ecmaVersion>=9)s.await=W>-1;return this.parseForIn(s,k)}if(W>-1)this.unexpected(W);return this.parseFor(s,k)};Ke.parseFunctionStatement=function(s,k,W){return this.next(),this.parseFunction(s,Ln|(W?0:Oi),!1,k)};Ke.parseIfStatement=function(s){return this.next(),s.test=this.parseParenExpression(),s.consequent=this.parseStatement("if"),s.alternate=this.eat(Oe._else)?this.parseStatement("if"):null,this.finishNode(s,"IfStatement")};Ke.parseReturnStatement=function(s){if(!this.allowReturn)this.raise(this.start,"'return' outside of function");if(this.next(),this.eat(Oe.semi)||this.insertSemicolon())s.argument=null;else s.argument=this.parseExpression(),this.semicolon();return this.finishNode(s,"ReturnStatement")};Ke.parseSwitchStatement=function(s){this.next(),s.discriminant=this.parseParenExpression(),s.cases=[],this.expect(Oe.braceL),this.labels.push(ef),this.enterScope(Vo);var k;for(var W=!1;this.type!==Oe.braceR;)if(this.type===Oe._case||this.type===Oe._default){var H=this.type===Oe._case;if(k)this.finishNode(k,"SwitchCase");if(s.cases.push(k=this.startNode()),k.consequent=[],this.next(),H)k.test=this.parseExpression();else{if(W)this.raiseRecoverable(this.lastTokStart,"Multiple default clauses");W=!0,k.test=null}this.expect(Oe.colon)}else{if(!k)this.unexpected();k.consequent.push(this.parseStatement(null))}if(this.exitScope(),k)this.finishNode(k,"SwitchCase");return this.next(),this.labels.pop(),this.finishNode(s,"SwitchStatement")};Ke.parseThrowStatement=function(s){if(this.next(),Et.test(this.input.slice(this.lastTokEnd,this.start)))this.raise(this.lastTokEnd,"Illegal newline after throw");return s.argument=this.parseExpression(),this.semicolon(),this.finishNode(s,"ThrowStatement")};var tf=[];Ke.parseCatchClauseParam=function(){var s=this.parseBindingAtom(),k=s.type==="Identifier";return this.enterScope(k?Bo:0),this.checkLValPattern(s,k?Go:Qt),this.expect(Oe.parenR),s};Ke.parseTryStatement=function(s){if(this.next(),s.block=this.parseBlock(),s.handler=null,this.type===Oe._catch){var k=this.startNode();if(this.next(),this.eat(Oe.parenL))k.param=this.parseCatchClauseParam();else{if(this.options.ecmaVersion<10)this.unexpected();k.param=null,this.enterScope(0)}k.body=this.parseBlock(!1),this.exitScope(),s.handler=this.finishNode(k,"CatchClause")}if(s.finalizer=this.eat(Oe._finally)?this.parseBlock():null,!s.handler&&!s.finalizer)this.raise(s.start,"Missing catch or finally clause");return this.finishNode(s,"TryStatement")};Ke.parseVarStatement=function(s,k,W){return this.next(),this.parseVar(s,!1,k,W),this.semicolon(),this.finishNode(s,"VariableDeclaration")};Ke.parseWhileStatement=function(s){return this.next(),s.test=this.parseParenExpression(),this.labels.push(Gi),s.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(s,"WhileStatement")};Ke.parseWithStatement=function(s){if(this.strict)this.raise(this.start,"'with' in strict mode");return this.next(),s.object=this.parseParenExpression(),s.body=this.parseStatement("with"),this.finishNode(s,"WithStatement")};Ke.parseEmptyStatement=function(s){return this.next(),this.finishNode(s,"EmptyStatement")};Ke.parseLabeledStatement=function(s,k,W,H){for(var le=0,fe=this.labels;le<fe.length;le+=1){var Ae=fe[le];if(Ae.name===k)this.raise(W.start,"Label '"+k+"' is already declared")}var De=this.type.isLoop?"loop":this.type===Oe._switch?"switch":null;for(var Re=this.labels.length-1;Re>=0;Re--){var $e=this.labels[Re];if($e.statementStart===s.start)$e.statementStart=this.start,$e.kind=De;else break}return this.labels.push({name:k,kind:De,statementStart:this.start}),s.body=this.parseStatement(H?H.indexOf("label")===-1?H+"label":H:"label"),this.labels.pop(),s.label=W,this.finishNode(s,"LabeledStatement")};Ke.parseExpressionStatement=function(s,k){return s.expression=k,this.semicolon(),this.finishNode(s,"ExpressionStatement")};Ke.parseBlock=function(s,k,W){if(s===void 0)s=!0;if(k===void 0)k=this.startNode();if(k.body=[],this.expect(Oe.braceL),s)this.enterScope(0);while(this.type!==Oe.braceR){var H=this.parseStatement(null);k.body.push(H)}if(W)this.strict=!1;if(this.next(),s)this.exitScope();return this.finishNode(k,"BlockStatement")};Ke.parseFor=function(s,k){return s.init=k,this.expect(Oe.semi),s.test=this.type===Oe.semi?null:this.parseExpression(),this.expect(Oe.semi),s.update=this.type===Oe.parenR?null:this.parseExpression(),this.expect(Oe.parenR),s.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(s,"ForStatement")};Ke.parseForIn=function(s,k){var W=this.type===Oe._in;if(this.next(),k.type==="VariableDeclaration"&&k.declarations[0].init!=null&&(!W||this.options.ecmaVersion<8||this.strict||k.kind!=="var"||k.declarations[0].id.type!=="Identifier"))this.raise(k.start,(W?"for-in":"for-of")+" loop variable declaration may not have an initializer");return s.left=k,s.right=W?this.parseExpression():this.parseMaybeAssign(),this.expect(Oe.parenR),s.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(s,W?"ForInStatement":"ForOfStatement")};Ke.parseVar=function(s,k,W,H){s.declarations=[],s.kind=W;for(;;){var le=this.startNode();if(this.parseVarId(le,W),this.eat(Oe.eq))le.init=this.parseMaybeAssign(k);else if(!H&&W==="const"&&!(this.type===Oe._in||this.options.ecmaVersion>=6&&this.isContextual("of")))this.unexpected();else if(!H&&(W==="using"||W==="await using")&&this.options.ecmaVersion>=17&&this.type!==Oe._in&&!this.isContextual("of"))this.raise(this.lastTokEnd,"Missing initializer in "+W+" declaration");else if(!H&&le.id.type!=="Identifier"&&!(k&&(this.type===Oe._in||this.isContextual("of"))))this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value");else le.init=null;if(s.declarations.push(this.finishNode(le,"VariableDeclarator")),!this.eat(Oe.comma))break}return s};Ke.parseVarId=function(s,k){s.id=k==="using"||k==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(s.id,k==="var"?Wi:Qt,!1)};var Ln=1,Oi=2,Uo=4;Ke.parseFunction=function(s,k,W,H,le){if(this.initFunction(s),this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!H){if(this.type===Oe.star&&k&Oi)this.unexpected();s.generator=this.eat(Oe.star)}if(this.options.ecmaVersion>=8)s.async=!!H;if(k&Ln){if(s.id=k&Uo&&this.type!==Oe.name?null:this.parseIdent(),s.id&&!(k&Oi))this.checkLValSimple(s.id,this.strict||s.generator||s.async?this.treatFunctionsAsVar?Wi:Qt:Wo)}var fe=this.yieldPos,Ae=this.awaitPos,De=this.awaitIdentPos;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Vi(s.async,s.generator)),!(k&Ln))s.id=this.type===Oe.name?this.parseIdent():null;return this.parseFunctionParams(s),this.parseFunctionBody(s,W,!1,le),this.yieldPos=fe,this.awaitPos=Ae,this.awaitIdentPos=De,this.finishNode(s,k&Ln?"FunctionDeclaration":"FunctionExpression")};Ke.parseFunctionParams=function(s){this.expect(Oe.parenL),s.params=this.parseBindingList(Oe.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};Ke.parseClass=function(s,k){this.next();var W=this.strict;this.strict=!0,this.parseClassId(s,k),this.parseClassSuper(s);var H=this.enterClassBody(),le=this.startNode(),fe=!1;le.body=[],this.expect(Oe.braceL);while(this.type!==Oe.braceR){var Ae=this.parseClassElement(s.superClass!==null);if(Ae){if(le.body.push(Ae),Ae.type==="MethodDefinition"&&Ae.kind==="constructor"){if(fe)this.raiseRecoverable(Ae.start,"Duplicate constructor in the same class");fe=!0}else if(Ae.key&&Ae.key.type==="PrivateIdentifier"&&nf(H,Ae))this.raiseRecoverable(Ae.key.start,"Identifier '#"+Ae.key.name+"' has already been declared")}}return this.strict=W,this.next(),s.body=this.finishNode(le,"ClassBody"),this.exitClassBody(),this.finishNode(s,k?"ClassDeclaration":"ClassExpression")};Ke.parseClassElement=function(s){if(this.eat(Oe.semi))return null;var k=this.options.ecmaVersion,W=this.startNode(),H="",le=!1,fe=!1,Ae="method",De=!1;if(this.eatContextual("static")){if(k>=13&&this.eat(Oe.braceL))return this.parseClassStaticBlock(W),W;if(this.isClassElementNameStart()||this.type===Oe.star)De=!0;else H="static"}if(W.static=De,!H&&k>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===Oe.star)&&!this.canInsertSemicolon())fe=!0;else H="async";if(!H&&(k>=9||!fe)&&this.eat(Oe.star))le=!0;if(!H&&!fe&&!le){var Re=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())Ae=Re;else H=Re}if(H)W.computed=!1,W.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),W.key.name=H,this.finishNode(W.key,"Identifier");else this.parseClassElementName(W);if(k<13||this.type===Oe.parenL||Ae!=="method"||le||fe){var $e=!W.static&&Sr(W,"constructor"),Le=$e&&s;if($e&&Ae!=="method")this.raise(W.key.start,"Constructor can't have get/set modifier");W.kind=$e?"constructor":Ae,this.parseClassMethod(W,le,fe,Le)}else this.parseClassField(W);return W};Ke.isClassElementNameStart=function(){return this.type===Oe.name||this.type===Oe.privateId||this.type===Oe.num||this.type===Oe.string||this.type===Oe.bracketL||this.type.keyword};Ke.parseClassElementName=function(s){if(this.type===Oe.privateId){if(this.value==="constructor")this.raise(this.start,"Classes can't have an element named '#constructor'");s.computed=!1,s.key=this.parsePrivateIdent()}else this.parsePropertyName(s)};Ke.parseClassMethod=function(s,k,W,H){var le=s.key;if(s.kind==="constructor"){if(k)this.raise(le.start,"Constructor can't be a generator");if(W)this.raise(le.start,"Constructor can't be an async method")}else if(s.static&&Sr(s,"prototype"))this.raise(le.start,"Classes may not have a static property named prototype");var fe=s.value=this.parseMethod(k,W,H);if(s.kind==="get"&&fe.params.length!==0)this.raiseRecoverable(fe.start,"getter should have no params");if(s.kind==="set"&&fe.params.length!==1)this.raiseRecoverable(fe.start,"setter should have exactly one param");if(s.kind==="set"&&fe.params[0].type==="RestElement")this.raiseRecoverable(fe.params[0].start,"Setter cannot use rest params");return this.finishNode(s,"MethodDefinition")};Ke.parseClassField=function(s){if(Sr(s,"constructor"))this.raise(s.key.start,"Classes can't have a field named 'constructor'");else if(s.static&&Sr(s,"prototype"))this.raise(s.key.start,"Classes can't have a static field named 'prototype'");if(this.eat(Oe.eq))this.enterScope(Fn|_r),s.value=this.parseMaybeAssign(),this.exitScope();else s.value=null;return this.semicolon(),this.finishNode(s,"PropertyDefinition")};Ke.parseClassStaticBlock=function(s){s.body=[];var k=this.labels;this.labels=[],this.enterScope(dn|_r);while(this.type!==Oe.braceR){var W=this.parseStatement(null);s.body.push(W)}return this.next(),this.exitScope(),this.labels=k,this.finishNode(s,"StaticBlock")};Ke.parseClassId=function(s,k){if(this.type===Oe.name){if(s.id=this.parseIdent(),k)this.checkLValSimple(s.id,Qt,!1)}else{if(k===!0)this.unexpected();s.id=null}};Ke.parseClassSuper=function(s){s.superClass=this.eat(Oe._extends)?this.parseExprSubscripts(null,!1):null};Ke.enterClassBody=function(){var s={declared:Object.create(null),used:[]};return this.privateNameStack.push(s),s.declared};Ke.exitClassBody=function(){var s=this.privateNameStack.pop(),{declared:k,used:W}=s;if(!this.options.checkPrivateFields)return;var H=this.privateNameStack.length,le=H===0?null:this.privateNameStack[H-1];for(var fe=0;fe<W.length;++fe){var Ae=W[fe];if(!bn(k,Ae.name))if(le)le.used.push(Ae);else this.raiseRecoverable(Ae.start,"Private field '#"+Ae.name+"' must be declared in an enclosing class")}};function nf(s,k){var W=k.key.name,H=s[W],le="true";if(k.type==="MethodDefinition"&&(k.kind==="get"||k.kind==="set"))le=(k.static?"s":"i")+k.kind;if(H==="iget"&&le==="iset"||H==="iset"&&le==="iget"||H==="sget"&&le==="sset"||H==="sset"&&le==="sget")return s[W]="true",!1;else if(!H)return s[W]=le,!1;else return!0}function Sr(s,k){var{computed:W,key:H}=s;return!W&&(H.type==="Identifier"&&H.name===k||H.type==="Literal"&&H.value===k)}Ke.parseExportAllDeclaration=function(s,k){if(this.options.ecmaVersion>=11)if(this.eatContextual("as"))s.exported=this.parseModuleExportName(),this.checkExport(k,s.exported,this.lastTokStart);else s.exported=null;if(this.expectContextual("from"),this.type!==Oe.string)this.unexpected();if(s.source=this.parseExprAtom(),this.options.ecmaVersion>=16)s.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(s,"ExportAllDeclaration")};Ke.parseExport=function(s,k){if(this.next(),this.eat(Oe.star))return this.parseExportAllDeclaration(s,k);if(this.eat(Oe._default))return this.checkExport(k,"default",this.lastTokStart),s.declaration=this.parseExportDefaultDeclaration(),this.finishNode(s,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(s.declaration=this.parseExportDeclaration(s),s.declaration.type==="VariableDeclaration")this.checkVariableExport(k,s.declaration.declarations);else this.checkExport(k,s.declaration.id,s.declaration.id.start);if(s.specifiers=[],s.source=null,this.options.ecmaVersion>=16)s.attributes=[]}else{if(s.declaration=null,s.specifiers=this.parseExportSpecifiers(k),this.eatContextual("from")){if(this.type!==Oe.string)this.unexpected();if(s.source=this.parseExprAtom(),this.options.ecmaVersion>=16)s.attributes=this.parseWithClause()}else{for(var W=0,H=s.specifiers;W<H.length;W+=1){var le=H[W];if(this.checkUnreserved(le.local),this.checkLocalExport(le.local),le.local.type==="Literal")this.raise(le.local.start,"A string literal cannot be used as an exported binding without `from`.")}if(s.source=null,this.options.ecmaVersion>=16)s.attributes=[]}this.semicolon()}return this.finishNode(s,"ExportNamedDeclaration")};Ke.parseExportDeclaration=function(s){return this.parseStatement(null)};Ke.parseExportDefaultDeclaration=function(){var s;if(this.type===Oe._function||(s=this.isAsyncFunction())){var k=this.startNode();if(this.next(),s)this.next();return this.parseFunction(k,Ln|Uo,!1,s)}else if(this.type===Oe._class){var W=this.startNode();return this.parseClass(W,"nullableID")}else{var H=this.parseMaybeAssign();return this.semicolon(),H}};Ke.checkExport=function(s,k,W){if(!s)return;if(typeof k!=="string")k=k.type==="Identifier"?k.name:k.value;if(bn(s,k))this.raiseRecoverable(W,"Duplicate export '"+k+"'");s[k]=!0};Ke.checkPatternExport=function(s,k){var W=k.type;if(W==="Identifier")this.checkExport(s,k,k.start);else if(W==="ObjectPattern")for(var H=0,le=k.properties;H<le.length;H+=1){var fe=le[H];this.checkPatternExport(s,fe)}else if(W==="ArrayPattern")for(var Ae=0,De=k.elements;Ae<De.length;Ae+=1){var Re=De[Ae];if(Re)this.checkPatternExport(s,Re)}else if(W==="Property")this.checkPatternExport(s,k.value);else if(W==="AssignmentPattern")this.checkPatternExport(s,k.left);else if(W==="RestElement")this.checkPatternExport(s,k.argument)};Ke.checkVariableExport=function(s,k){if(!s)return;for(var W=0,H=k;W<H.length;W+=1){var le=H[W];this.checkPatternExport(s,le.id)}};Ke.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};Ke.parseExportSpecifier=function(s){var k=this.startNode();return k.local=this.parseModuleExportName(),k.exported=this.eatContextual("as")?this.parseModuleExportName():k.local,this.checkExport(s,k.exported,k.exported.start),this.finishNode(k,"ExportSpecifier")};Ke.parseExportSpecifiers=function(s){var k=[],W=!0;this.expect(Oe.braceL);while(!this.eat(Oe.braceR)){if(!W){if(this.expect(Oe.comma),this.afterTrailingComma(Oe.braceR))break}else W=!1;k.push(this.parseExportSpecifier(s))}return k};Ke.parseImport=function(s){if(this.next(),this.type===Oe.string)s.specifiers=tf,s.source=this.parseExprAtom();else s.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),s.source=this.type===Oe.string?this.parseExprAtom():this.unexpected();if(this.options.ecmaVersion>=16)s.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(s,"ImportDeclaration")};Ke.parseImportSpecifier=function(){var s=this.startNode();if(s.imported=this.parseModuleExportName(),this.eatContextual("as"))s.local=this.parseIdent();else this.checkUnreserved(s.imported),s.local=s.imported;return this.checkLValSimple(s.local,Qt),this.finishNode(s,"ImportSpecifier")};Ke.parseImportDefaultSpecifier=function(){var s=this.startNode();return s.local=this.parseIdent(),this.checkLValSimple(s.local,Qt),this.finishNode(s,"ImportDefaultSpecifier")};Ke.parseImportNamespaceSpecifier=function(){var s=this.startNode();return this.next(),this.expectContextual("as"),s.local=this.parseIdent(),this.checkLValSimple(s.local,Qt),this.finishNode(s,"ImportNamespaceSpecifier")};Ke.parseImportSpecifiers=function(){var s=[],k=!0;if(this.type===Oe.name){if(s.push(this.parseImportDefaultSpecifier()),!this.eat(Oe.comma))return s}if(this.type===Oe.star)return s.push(this.parseImportNamespaceSpecifier()),s;this.expect(Oe.braceL);while(!this.eat(Oe.braceR)){if(!k){if(this.expect(Oe.comma),this.afterTrailingComma(Oe.braceR))break}else k=!1;s.push(this.parseImportSpecifier())}return s};Ke.parseWithClause=function(){var s=[];if(!this.eat(Oe._with))return s;this.expect(Oe.braceL);var k={},W=!0;while(!this.eat(Oe.braceR)){if(!W){if(this.expect(Oe.comma),this.afterTrailingComma(Oe.braceR))break}else W=!1;var H=this.parseImportAttribute(),le=H.key.type==="Identifier"?H.key.name:H.key.value;if(bn(k,le))this.raiseRecoverable(H.key.start,"Duplicate attribute key '"+le+"'");k[le]=!0,s.push(H)}return s};Ke.parseImportAttribute=function(){var s=this.startNode();if(s.key=this.type===Oe.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(Oe.colon),this.type!==Oe.string)this.unexpected();return s.value=this.parseExprAtom(),this.finishNode(s,"ImportAttribute")};Ke.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===Oe.string){var s=this.parseLiteral(this.value);if(Jl.test(s.value))this.raise(s.start,"An export name cannot include a lone surrogate.");return s}return this.parseIdent(!0)};Ke.adaptDirectivePrologue=function(s){for(var k=0;k<s.length&&this.isDirectiveCandidate(s[k]);++k)s[k].directive=s[k].expression.raw.slice(1,-1)};Ke.isDirectiveCandidate=function(s){return this.options.ecmaVersion>=5&&s.type==="ExpressionStatement"&&s.expression.type==="Literal"&&typeof s.expression.value==="string"&&(this.input[s.start]==='"'||this.input[s.start]==="'")};var $t=n.prototype;$t.toAssignable=function(s,k,W){if(this.options.ecmaVersion>=6&&s)switch(s.type){case"Identifier":if(this.inAsync&&s.name==="await")this.raise(s.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":if(s.type="ObjectPattern",W)this.checkPatternErrors(W,!0);for(var H=0,le=s.properties;H<le.length;H+=1){var fe=le[H];if(this.toAssignable(fe,k),fe.type==="RestElement"&&(fe.argument.type==="ArrayPattern"||fe.argument.type==="ObjectPattern"))this.raise(fe.argument.start,"Unexpected token")}break;case"Property":if(s.kind!=="init")this.raise(s.key.start,"Object pattern can't contain getter or setter");this.toAssignable(s.value,k);break;case"ArrayExpression":if(s.type="ArrayPattern",W)this.checkPatternErrors(W,!0);this.toAssignableList(s.elements,k);break;case"SpreadElement":if(s.type="RestElement",this.toAssignable(s.argument,k),s.argument.type==="AssignmentPattern")this.raise(s.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":if(s.operator!=="=")this.raise(s.left.end,"Only '=' operator can be used for specifying default value.");s.type="AssignmentPattern",delete s.operator,this.toAssignable(s.left,k);break;case"ParenthesizedExpression":this.toAssignable(s.expression,k,W);break;case"ChainExpression":this.raiseRecoverable(s.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!k)break;default:this.raise(s.start,"Assigning to rvalue")}else if(W)this.checkPatternErrors(W,!0);return s};$t.toAssignableList=function(s,k){var W=s.length;for(var H=0;H<W;H++){var le=s[H];if(le)this.toAssignable(le,k)}if(W){var fe=s[W-1];if(this.options.ecmaVersion===6&&k&&fe&&fe.type==="RestElement"&&fe.argument.type!=="Identifier")this.unexpected(fe.argument.start)}return s};$t.parseSpread=function(s){var k=this.startNode();return this.next(),k.argument=this.parseMaybeAssign(!1,s),this.finishNode(k,"SpreadElement")};$t.parseRestBinding=function(){var s=this.startNode();if(this.next(),this.options.ecmaVersion===6&&this.type!==Oe.name)this.unexpected();return s.argument=this.parseBindingAtom(),this.finishNode(s,"RestElement")};$t.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case Oe.bracketL:var s=this.startNode();return this.next(),s.elements=this.parseBindingList(Oe.bracketR,!0,!0),this.finishNode(s,"ArrayPattern");case Oe.braceL:return this.parseObj(!0)}return this.parseIdent()};$t.parseBindingList=function(s,k,W,H){var le=[],fe=!0;while(!this.eat(s)){if(fe)fe=!1;else this.expect(Oe.comma);if(k&&this.type===Oe.comma)le.push(null);else if(W&&this.afterTrailingComma(s))break;else if(this.type===Oe.ellipsis){var Ae=this.parseRestBinding();if(this.parseBindingListItem(Ae),le.push(Ae),this.type===Oe.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");this.expect(s);break}else le.push(this.parseAssignableListItem(H))}return le};$t.parseAssignableListItem=function(s){var k=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(k),k};$t.parseBindingListItem=function(s){return s};$t.parseMaybeDefault=function(s,k,W){if(W=W||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(Oe.eq))return W;var H=this.startNodeAt(s,k);return H.left=W,H.right=this.parseMaybeAssign(),this.finishNode(H,"AssignmentPattern")};$t.checkLValSimple=function(s,k,W){if(k===void 0)k=br;var H=k!==br;switch(s.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(s.name))this.raiseRecoverable(s.start,(H?"Binding ":"Assigning to ")+s.name+" in strict mode");if(H){if(k===Qt&&s.name==="let")this.raiseRecoverable(s.start,"let is disallowed as a lexically bound name");if(W){if(bn(W,s.name))this.raiseRecoverable(s.start,"Argument name clash");W[s.name]=!0}if(k!==Ho)this.declareName(s.name,k,s.start)}break;case"ChainExpression":this.raiseRecoverable(s.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(H)this.raiseRecoverable(s.start,"Binding member expression");break;case"ParenthesizedExpression":if(H)this.raiseRecoverable(s.start,"Binding parenthesized expression");return this.checkLValSimple(s.expression,k,W);default:this.raise(s.start,(H?"Binding":"Assigning to")+" rvalue")}};$t.checkLValPattern=function(s,k,W){if(k===void 0)k=br;switch(s.type){case"ObjectPattern":for(var H=0,le=s.properties;H<le.length;H+=1){var fe=le[H];this.checkLValInnerPattern(fe,k,W)}break;case"ArrayPattern":for(var Ae=0,De=s.elements;Ae<De.length;Ae+=1){var Re=De[Ae];if(Re)this.checkLValInnerPattern(Re,k,W)}break;default:this.checkLValSimple(s,k,W)}};$t.checkLValInnerPattern=function(s,k,W){if(k===void 0)k=br;switch(s.type){case"Property":this.checkLValInnerPattern(s.value,k,W);break;case"AssignmentPattern":this.checkLValPattern(s.left,k,W);break;case"RestElement":this.checkLValPattern(s.argument,k,W);break;default:this.checkLValPattern(s,k,W)}};var Rt=function(k,W,H,le,fe){this.token=k,this.isExpr=!!W,this.preserveSpace=!!H,this.override=le,this.generator=!!fe},ut={b_stat:new Rt("{",!1),b_expr:new Rt("{",!0),b_tmpl:new Rt("${",!1),p_stat:new Rt("(",!1),p_expr:new Rt("(",!0),q_tmpl:new Rt("`",!0,!0,function(s){return s.tryReadTemplateToken()}),f_stat:new Rt("function",!1),f_expr:new Rt("function",!0),f_expr_gen:new Rt("function",!0,!1,null,!0),f_gen:new Rt("function",!1,!1,null,!0)},Sn=n.prototype;Sn.initialContext=function(){return[ut.b_stat]};Sn.curContext=function(){return this.context[this.context.length-1]};Sn.braceIsBlock=function(s){var k=this.curContext();if(k===ut.f_expr||k===ut.f_stat)return!0;if(s===Oe.colon&&(k===ut.b_stat||k===ut.b_expr))return!k.isExpr;if(s===Oe._return||s===Oe.name&&this.exprAllowed)return Et.test(this.input.slice(this.lastTokEnd,this.start));if(s===Oe._else||s===Oe.semi||s===Oe.eof||s===Oe.parenR||s===Oe.arrow)return!0;if(s===Oe.braceL)return k===ut.b_stat;if(s===Oe._var||s===Oe._const||s===Oe.name)return!1;return!this.exprAllowed};Sn.inGeneratorContext=function(){for(var s=this.context.length-1;s>=1;s--){var k=this.context[s];if(k.token==="function")return k.generator}return!1};Sn.updateContext=function(s){var k,W=this.type;if(W.keyword&&s===Oe.dot)this.exprAllowed=!1;else if(k=W.updateContext)k.call(this,s);else this.exprAllowed=W.beforeExpr};Sn.overrideContext=function(s){if(this.curContext()!==s)this.context[this.context.length-1]=s};Oe.parenR.updateContext=Oe.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var s=this.context.pop();if(s===ut.b_stat&&this.curContext().token==="function")s=this.context.pop();this.exprAllowed=!s.isExpr};Oe.braceL.updateContext=function(s){this.context.push(this.braceIsBlock(s)?ut.b_stat:ut.b_expr),this.exprAllowed=!0};Oe.dollarBraceL.updateContext=function(){this.context.push(ut.b_tmpl),this.exprAllowed=!0};Oe.parenL.updateContext=function(s){var k=s===Oe._if||s===Oe._for||s===Oe._with||s===Oe._while;this.context.push(k?ut.p_stat:ut.p_expr),this.exprAllowed=!0};Oe.incDec.updateContext=function(){};Oe._function.updateContext=Oe._class.updateContext=function(s){if(s.beforeExpr&&s!==Oe._else&&!(s===Oe.semi&&this.curContext()!==ut.p_stat)&&!(s===Oe._return&&Et.test(this.input.slice(this.lastTokEnd,this.start)))&&!((s===Oe.colon||s===Oe.braceL)&&this.curContext()===ut.b_stat))this.context.push(ut.f_expr);else this.context.push(ut.f_stat);this.exprAllowed=!1};Oe.colon.updateContext=function(){if(this.curContext().token==="function")this.context.pop();this.exprAllowed=!0};Oe.backQuote.updateContext=function(){if(this.curContext()===ut.q_tmpl)this.context.pop();else this.context.push(ut.q_tmpl);this.exprAllowed=!1};Oe.star.updateContext=function(s){if(s===Oe._function){var k=this.context.length-1;if(this.context[k]===ut.f_expr)this.context[k]=ut.f_expr_gen;else this.context[k]=ut.f_gen}this.exprAllowed=!0};Oe.name.updateContext=function(s){var k=!1;if(this.options.ecmaVersion>=6&&s!==Oe.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())k=!0}this.exprAllowed=k};var Je=n.prototype;Je.checkPropClash=function(s,k,W){if(this.options.ecmaVersion>=9&&s.type==="SpreadElement")return;if(this.options.ecmaVersion>=6&&(s.computed||s.method||s.shorthand))return;var H=s.key,le;switch(H.type){case"Identifier":le=H.name;break;case"Literal":le=String(H.value);break;default:return}var fe=s.kind;if(this.options.ecmaVersion>=6){if(le==="__proto__"&&fe==="init"){if(k.proto)if(W){if(W.doubleProto<0)W.doubleProto=H.start}else this.raiseRecoverable(H.start,"Redefinition of __proto__ property");k.proto=!0}return}le="$"+le;var Ae=k[le];if(Ae){var De;if(fe==="init")De=this.strict&&Ae.init||Ae.get||Ae.set;else De=Ae.init||Ae[fe];if(De)this.raiseRecoverable(H.start,"Redefinition of property")}else Ae=k[le]={init:!1,get:!1,set:!1};Ae[fe]=!0};Je.parseExpression=function(s,k){var W=this;return this.catchStackOverflow(function(){var{start:H,startLoc:le}=W,fe=W.parseMaybeAssign(s,k);if(W.type===Oe.comma){var Ae=W.startNodeAt(H,le);Ae.expressions=[fe];while(W.eat(Oe.comma))Ae.expressions.push(W.parseMaybeAssign(s,k));return W.finishNode(Ae,"SequenceExpression")}return fe})};Je.parseMaybeAssign=function(s,k,W){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(s);else this.exprAllowed=!1;var H=!1,le=-1,fe=-1,Ae=-1;if(k)le=k.parenthesizedAssign,fe=k.trailingComma,Ae=k.doubleProto,k.parenthesizedAssign=k.trailingComma=-1;else k=new Tr,H=!0;var De=this.start,Re=this.startLoc;if(this.type===Oe.parenL||this.type===Oe.name)this.potentialArrowAt=this.start,this.potentialArrowInForAwait=s==="await";var $e=this.parseMaybeConditional(s,k);if(W)$e=W.call(this,$e,De,Re);if(this.type.isAssign){var Le=this.startNodeAt(De,Re);if(Le.operator=this.value,this.type===Oe.eq)$e=this.toAssignable($e,!1,k);if(!H)k.parenthesizedAssign=k.trailingComma=k.doubleProto=-1;if(k.shorthandAssign>=$e.start)k.shorthandAssign=-1;if(this.type===Oe.eq)this.checkLValPattern($e);else this.checkLValSimple($e);if(Le.left=$e,this.next(),Le.right=this.parseMaybeAssign(s),Ae>-1)k.doubleProto=Ae;return this.finishNode(Le,"AssignmentExpression")}else if(H)this.checkExpressionErrors(k,!0);if(le>-1)k.parenthesizedAssign=le;if(fe>-1)k.trailingComma=fe;return $e};Je.parseMaybeConditional=function(s,k){var W=this.start,H=this.startLoc,le=this.parseExprOps(s,k);if(this.checkExpressionErrors(k))return le;if(!(le.type==="ArrowFunctionExpression"&&le.start===W)&&this.eat(Oe.question)){var fe=this.startNodeAt(W,H);return fe.test=le,fe.consequent=this.parseMaybeAssign(),this.expect(Oe.colon),fe.alternate=this.parseMaybeAssign(s),this.finishNode(fe,"ConditionalExpression")}return le};Je.parseExprOps=function(s,k){var W=this.start,H=this.startLoc,le=this.parseMaybeUnary(k,!1,!1,s);if(this.checkExpressionErrors(k))return le;return le.start===W&&le.type==="ArrowFunctionExpression"?le:this.parseExprOp(le,W,H,-1,s)};Je.parseExprOp=function(s,k,W,H,le){var fe=this.type.binop;if(fe!=null&&(!le||this.type!==Oe._in)){if(fe>H){var Ae=this.type===Oe.logicalOR||this.type===Oe.logicalAND,De=this.type===Oe.coalesce;if(De)fe=Oe.logicalAND.binop;var Re=this.value;this.next();var $e=this.start,Le=this.startLoc,Be=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,le),$e,Le,fe,le),Fe=this.buildBinary(k,W,s,Be,Re,Ae||De);if(Ae&&this.type===Oe.coalesce||De&&(this.type===Oe.logicalOR||this.type===Oe.logicalAND))this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");return this.parseExprOp(Fe,k,W,H,le)}}return s};Je.buildBinary=function(s,k,W,H,le,fe){if(H.type==="PrivateIdentifier")this.raise(H.start,"Private identifier can only be left side of binary expression");var Ae=this.startNodeAt(s,k);return Ae.left=W,Ae.operator=le,Ae.right=H,this.finishNode(Ae,fe?"LogicalExpression":"BinaryExpression")};Je.parseMaybeUnary=function(s,k,W,H){var le=this.start,fe=this.startLoc,Ae;if(this.isContextual("await")&&this.canAwait)Ae=this.parseAwait(H),k=!0;else if(this.type.prefix){var De=this.startNode(),Re=this.type===Oe.incDec;if(De.operator=this.value,De.prefix=!0,this.next(),De.argument=this.parseMaybeUnary(null,!0,Re,H),this.checkExpressionErrors(s,!0),Re)this.checkLValSimple(De.argument);else if(this.strict&&De.operator==="delete"&&Ko(De.argument))this.raiseRecoverable(De.start,"Deleting local variable in strict mode");else if(De.operator==="delete"&&$i(De.argument))this.raiseRecoverable(De.start,"Private fields can not be deleted");else k=!0;Ae=this.finishNode(De,Re?"UpdateExpression":"UnaryExpression")}else if(!k&&this.type===Oe.privateId){if((H||this.privateNameStack.length===0)&&this.options.checkPrivateFields)this.unexpected();if(Ae=this.parsePrivateIdent(),this.type!==Oe._in)this.unexpected()}else{if(Ae=this.parseExprSubscripts(s,H),this.checkExpressionErrors(s))return Ae;while(this.type.postfix&&!this.canInsertSemicolon()){var $e=this.startNodeAt(le,fe);$e.operator=this.value,$e.prefix=!1,$e.argument=Ae,this.checkLValSimple(Ae),this.next(),Ae=this.finishNode($e,"UpdateExpression")}}if(!W&&!(Ae.type==="ArrowFunctionExpression"&&Ae.start===le)&&this.eat(Oe.starstar))if(k)this.unexpected(this.lastTokStart);else return this.buildBinary(le,fe,Ae,this.parseMaybeUnary(null,!1,!1,H),"**",!1);else return Ae};function Ko(s){return s.type==="Identifier"||s.type==="ParenthesizedExpression"&&Ko(s.expression)}function $i(s){return s.type==="MemberExpression"&&s.property.type==="PrivateIdentifier"||s.type==="ChainExpression"&&$i(s.expression)||s.type==="ParenthesizedExpression"&&$i(s.expression)}Je.parseExprSubscripts=function(s,k){var W=this.start,H=this.startLoc,le=this.parseExprAtom(s,k);if(le.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return le;var fe=this.parseSubscripts(le,W,H,!1,k);if(s&&fe.type==="MemberExpression"){if(s.parenthesizedAssign>=fe.start)s.parenthesizedAssign=-1;if(s.parenthesizedBind>=fe.start)s.parenthesizedBind=-1;if(s.trailingComma>=fe.start)s.trailingComma=-1}return fe};Je.parseSubscripts=function(s,k,W,H,le){var fe=this.options.ecmaVersion>=8&&s.type==="Identifier"&&s.name==="async"&&this.lastTokEnd===s.end&&!this.canInsertSemicolon()&&s.end-s.start===5&&this.potentialArrowAt===s.start,Ae=!1;while(!0){var De=this.parseSubscript(s,k,W,H,fe,Ae,le);if(De.optional)Ae=!0;if(De===s||De.type==="ArrowFunctionExpression"){if(Ae){var Re=this.startNodeAt(k,W);Re.expression=De,De=this.finishNode(Re,"ChainExpression")}return De}s=De}};Je.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(Oe.arrow)};Je.parseSubscriptAsyncArrow=function(s,k,W,H){return this.parseArrowExpression(this.startNodeAt(s,k),W,!0,H)};Je.parseSubscript=function(s,k,W,H,le,fe,Ae){var De=this.options.ecmaVersion>=11,Re=De&&this.eat(Oe.questionDot);if(H&&Re)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var $e=this.eat(Oe.bracketL);if($e||Re&&this.type!==Oe.parenL&&this.type!==Oe.backQuote||this.eat(Oe.dot)){var Le=this.startNodeAt(k,W);if(Le.object=s,$e)Le.property=this.parseExpression(),this.expect(Oe.bracketR);else if(this.type===Oe.privateId&&s.type!=="Super")Le.property=this.parsePrivateIdent();else Le.property=this.parseIdent(this.options.allowReserved!=="never");if(Le.computed=!!$e,De)Le.optional=Re;s=this.finishNode(Le,"MemberExpression")}else if(!H&&this.eat(Oe.parenL)){var Be=new Tr,Fe=this.yieldPos,Me=this.awaitPos,je=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var Ve=this.parseExprList(Oe.parenR,this.options.ecmaVersion>=8,!1,Be);if(le&&!Re&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(Be,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");return this.yieldPos=Fe,this.awaitPos=Me,this.awaitIdentPos=je,this.parseSubscriptAsyncArrow(k,W,Ve,Ae)}this.checkExpressionErrors(Be,!0),this.yieldPos=Fe||this.yieldPos,this.awaitPos=Me||this.awaitPos,this.awaitIdentPos=je||this.awaitIdentPos;var We=this.startNodeAt(k,W);if(We.callee=s,We.arguments=Ve,De)We.optional=Re;s=this.finishNode(We,"CallExpression")}else if(this.type===Oe.backQuote){if(Re||fe)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var He=this.startNodeAt(k,W);He.tag=s,He.quasi=this.parseTemplate({isTagged:!0}),s=this.finishNode(He,"TaggedTemplateExpression")}return s};Je.parseExprAtom=function(s,k,W){if(this.type===Oe.slash)this.readRegexp();var H,le=this.potentialArrowAt===this.start;switch(this.type){case Oe._super:if(!this.allowSuper)this.raise(this.start,"'super' keyword outside a method");if(H=this.startNode(),this.next(),this.type===Oe.parenL&&!this.allowDirectSuper)this.raise(H.start,"super() call outside constructor of a subclass");if(this.type!==Oe.dot&&this.type!==Oe.bracketL&&this.type!==Oe.parenL)this.unexpected();return this.finishNode(H,"Super");case Oe._this:return H=this.startNode(),this.next(),this.finishNode(H,"ThisExpression");case Oe.name:var fe=this.start,Ae=this.startLoc,De=this.containsEsc,Re=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!De&&Re.name==="async"&&!this.canInsertSemicolon()&&this.eat(Oe._function))return this.overrideContext(ut.f_expr),this.parseFunction(this.startNodeAt(fe,Ae),0,!1,!0,k);if(le&&!this.canInsertSemicolon()){if(this.eat(Oe.arrow))return this.parseArrowExpression(this.startNodeAt(fe,Ae),[Re],!1,k);if(this.options.ecmaVersion>=8&&Re.name==="async"&&this.type===Oe.name&&!De&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(Re=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(Oe.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(fe,Ae),[Re],!0,k)}}return Re;case Oe.regexp:var $e=this.value;return H=this.parseLiteral($e.value),H.regex={pattern:$e.pattern,flags:$e.flags},H;case Oe.num:case Oe.string:return this.parseLiteral(this.value);case Oe._null:case Oe._true:case Oe._false:return H=this.startNode(),H.value=this.type===Oe._null?null:this.type===Oe._true,H.raw=this.type.keyword,this.next(),this.finishNode(H,"Literal");case Oe.parenL:var Le=this.start,Be=this.parseParenAndDistinguishExpression(le,k);if(s){if(s.parenthesizedAssign<0&&!this.isSimpleAssignTarget(Be))s.parenthesizedAssign=Le;if(s.parenthesizedBind<0)s.parenthesizedBind=Le}return Be;case Oe.bracketL:return H=this.startNode(),this.next(),H.elements=this.parseExprList(Oe.bracketR,!0,!0,s),this.finishNode(H,"ArrayExpression");case Oe.braceL:return this.overrideContext(ut.b_expr),this.parseObj(!1,s);case Oe._function:return H=this.startNode(),this.next(),this.parseFunction(H,0);case Oe._class:return this.parseClass(this.startNode(),!1);case Oe._new:return this.parseNew();case Oe.backQuote:return this.parseTemplate();case Oe._import:if(this.options.ecmaVersion>=11)return this.parseExprImport(W);else return this.unexpected();default:return this.parseExprAtomDefault()}};Je.parseExprAtomDefault=function(){this.unexpected()};Je.parseExprImport=function(s){var k=this.startNode();if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword import");if(this.next(),this.type===Oe.parenL&&!s)return this.parseDynamicImport(k);else if(this.type===Oe.dot){var W=this.startNodeAt(k.start,k.loc&&k.loc.start);return W.name="import",k.meta=this.finishNode(W,"Identifier"),this.parseImportMeta(k)}else this.unexpected()};Je.parseDynamicImport=function(s){if(this.next(),s.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)if(!this.eat(Oe.parenR))if(this.expect(Oe.comma),!this.afterTrailingComma(Oe.parenR)){if(s.options=this.parseMaybeAssign(),!this.eat(Oe.parenR)){if(this.expect(Oe.comma),!this.afterTrailingComma(Oe.parenR))this.unexpected()}}else s.options=null;else s.options=null;else if(!this.eat(Oe.parenR)){var k=this.start;if(this.eat(Oe.comma)&&this.eat(Oe.parenR))this.raiseRecoverable(k,"Trailing comma is not allowed in import()");else this.unexpected(k)}return this.finishNode(s,"ImportExpression")};Je.parseImportMeta=function(s){this.next();var k=this.containsEsc;if(s.property=this.parseIdent(!0),s.property.name!=="meta")this.raiseRecoverable(s.property.start,"The only valid meta property for import is 'import.meta'");if(k)this.raiseRecoverable(s.start,"'import.meta' must not contain escaped characters");if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere)this.raiseRecoverable(s.start,"Cannot use 'import.meta' outside a module");return this.finishNode(s,"MetaProperty")};Je.parseLiteral=function(s){var k=this.startNode();if(k.value=s,k.raw=this.input.slice(this.start,this.end),k.raw.charCodeAt(k.raw.length-1)===110)k.bigint=k.value!=null?k.value.toString():k.raw.slice(0,-1).replace(/_/g,"");return this.next(),this.finishNode(k,"Literal")};Je.parseParenExpression=function(){this.expect(Oe.parenL);var s=this.parseExpression();return this.expect(Oe.parenR),s};Je.shouldParseArrow=function(s){return!this.canInsertSemicolon()};Je.parseParenAndDistinguishExpression=function(s,k){var W=this.start,H=this.startLoc,le,fe=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var Ae=this.start,De=this.startLoc,Re=[],$e=!0,Le=!1,Be=new Tr,Fe=this.yieldPos,Me=this.awaitPos,je;this.yieldPos=0,this.awaitPos=0;while(this.type!==Oe.parenR)if($e?$e=!1:this.expect(Oe.comma),fe&&this.afterTrailingComma(Oe.parenR,!0)){Le=!0;break}else if(this.type===Oe.ellipsis){if(je=this.start,Re.push(this.parseParenItem(this.parseRestBinding())),this.type===Oe.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else Re.push(this.parseMaybeAssign(!1,Be,this.parseParenItem));var Ve=this.lastTokEnd,We=this.lastTokEndLoc;if(this.expect(Oe.parenR),s&&this.shouldParseArrow(Re)&&this.eat(Oe.arrow))return this.checkPatternErrors(Be,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=Fe,this.awaitPos=Me,this.parseParenArrowList(W,H,Re,k);if(!Re.length||Le)this.unexpected(this.lastTokStart);if(je)this.unexpected(je);if(this.checkExpressionErrors(Be,!0),this.yieldPos=Fe||this.yieldPos,this.awaitPos=Me||this.awaitPos,Re.length>1)le=this.startNodeAt(Ae,De),le.expressions=Re,this.finishNodeAt(le,"SequenceExpression",Ve,We);else le=Re[0]}else le=this.parseParenExpression();if(this.options.preserveParens){var He=this.startNodeAt(W,H);return He.expression=le,this.finishNode(He,"ParenthesizedExpression")}else return le};Je.parseParenItem=function(s){return s};Je.parseParenArrowList=function(s,k,W,H){return this.parseArrowExpression(this.startNodeAt(s,k),W,!1,H)};var rf=[];Je.parseNew=function(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");var s=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===Oe.dot){var k=this.startNodeAt(s.start,s.loc&&s.loc.start);k.name="new",s.meta=this.finishNode(k,"Identifier"),this.next();var W=this.containsEsc;if(s.property=this.parseIdent(!0),s.property.name!=="target")this.raiseRecoverable(s.property.start,"The only valid meta property for new is 'new.target'");if(W)this.raiseRecoverable(s.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(s.start,"'new.target' can only be used in functions and class static block");return this.finishNode(s,"MetaProperty")}var H=this.start,le=this.startLoc;if(s.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),H,le,!0,!1),s.callee.type==="Super")this.raiseRecoverable(H,"Invalid use of 'super'");if(this.eat(Oe.parenL))s.arguments=this.parseExprList(Oe.parenR,this.options.ecmaVersion>=8,!1);else s.arguments=rf;return this.finishNode(s,"NewExpression")};Je.parseTemplateElement=function(s){var k=s.isTagged,W=this.startNode();if(this.type===Oe.invalidTemplate){if(!k)this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal");W.value={raw:this.value.replace(/\r\n?/g,`
191
+ `),cooked:null}}else W.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
192
+ `),cooked:this.value};return this.next(),W.tail=this.type===Oe.backQuote,this.finishNode(W,"TemplateElement")};Je.parseTemplate=function(s){if(s===void 0)s={};var k=s.isTagged;if(k===void 0)k=!1;var W=this.startNode();this.next(),W.expressions=[];var H=this.parseTemplateElement({isTagged:k});W.quasis=[H];while(!H.tail){if(this.type===Oe.eof)this.raise(this.pos,"Unterminated template literal");this.expect(Oe.dollarBraceL),W.expressions.push(this.parseExpression()),this.expect(Oe.braceR),W.quasis.push(H=this.parseTemplateElement({isTagged:k}))}return this.next(),this.finishNode(W,"TemplateLiteral")};Je.isAsyncProp=function(s){return!s.computed&&s.key.type==="Identifier"&&s.key.name==="async"&&(this.type===Oe.name||this.type===Oe.num||this.type===Oe.string||this.type===Oe.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===Oe.star)&&!Et.test(this.input.slice(this.lastTokEnd,this.start))};Je.parseObj=function(s,k){var W=this.startNode(),H=!0,le={};W.properties=[],this.next();while(!this.eat(Oe.braceR)){if(!H){if(this.expect(Oe.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(Oe.braceR))break}else H=!1;var fe=this.parseProperty(s,k);if(!s)this.checkPropClash(fe,le,k);W.properties.push(fe)}return this.finishNode(W,s?"ObjectPattern":"ObjectExpression")};Je.parseProperty=function(s,k){var W=this.startNode(),H,le,fe,Ae;if(this.options.ecmaVersion>=9&&this.eat(Oe.ellipsis)){if(s){if(W.argument=this.parseIdent(!1),this.type===Oe.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");return this.finishNode(W,"RestElement")}if(W.argument=this.parseMaybeAssign(!1,k),this.type===Oe.comma&&k&&k.trailingComma<0)k.trailingComma=this.start;return this.finishNode(W,"SpreadElement")}if(this.options.ecmaVersion>=6){if(W.method=!1,W.shorthand=!1,s||k)fe=this.start,Ae=this.startLoc;if(!s)H=this.eat(Oe.star)}var De=this.containsEsc;if(this.parsePropertyName(W),!s&&!De&&this.options.ecmaVersion>=8&&!H&&this.isAsyncProp(W))le=!0,H=this.options.ecmaVersion>=9&&this.eat(Oe.star),this.parsePropertyName(W);else le=!1;return this.parsePropertyValue(W,s,H,le,fe,Ae,k,De),this.finishNode(W,"Property")};Je.parseGetterSetter=function(s){var k=s.key.name;this.parsePropertyName(s),s.value=this.parseMethod(!1),s.kind=k;var W=s.kind==="get"?0:1;if(s.value.params.length!==W){var H=s.value.start;if(s.kind==="get")this.raiseRecoverable(H,"getter should have no params");else this.raiseRecoverable(H,"setter should have exactly one param")}else if(s.kind==="set"&&s.value.params[0].type==="RestElement")this.raiseRecoverable(s.value.params[0].start,"Setter cannot use rest params")};Je.parsePropertyValue=function(s,k,W,H,le,fe,Ae,De){if((W||H)&&this.type===Oe.colon)this.unexpected();if(this.eat(Oe.colon))s.value=k?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,Ae),s.kind="init";else if(this.options.ecmaVersion>=6&&this.type===Oe.parenL){if(k)this.unexpected();s.method=!0,s.value=this.parseMethod(W,H),s.kind="init"}else if(!k&&!De&&this.options.ecmaVersion>=5&&!s.computed&&s.key.type==="Identifier"&&(s.key.name==="get"||s.key.name==="set")&&(this.type!==Oe.comma&&this.type!==Oe.braceR&&this.type!==Oe.eq)){if(W||H)this.unexpected();this.parseGetterSetter(s)}else if(this.options.ecmaVersion>=6&&!s.computed&&s.key.type==="Identifier"){if(W||H)this.unexpected();if(this.checkUnreserved(s.key),s.key.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=le;if(k)s.value=this.parseMaybeDefault(le,fe,this.copyNode(s.key));else if(this.type===Oe.eq&&Ae){if(Ae.shorthandAssign<0)Ae.shorthandAssign=this.start;s.value=this.parseMaybeDefault(le,fe,this.copyNode(s.key))}else s.value=this.copyNode(s.key);s.kind="init",s.shorthand=!0}else this.unexpected()};Je.parsePropertyName=function(s){if(this.options.ecmaVersion>=6)if(this.eat(Oe.bracketL))return s.computed=!0,s.key=this.parseMaybeAssign(),this.expect(Oe.bracketR),s.key;else s.computed=!1;return s.key=this.type===Oe.num||this.type===Oe.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};Je.initFunction=function(s){if(s.id=null,this.options.ecmaVersion>=6)s.generator=s.expression=!1;if(this.options.ecmaVersion>=8)s.async=!1};Je.parseMethod=function(s,k,W){var H=this.startNode(),le=this.yieldPos,fe=this.awaitPos,Ae=this.awaitIdentPos;if(this.initFunction(H),this.options.ecmaVersion>=6)H.generator=s;if(this.options.ecmaVersion>=8)H.async=!!k;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Vi(k,H.generator)|_r|(W?jo:0)),this.expect(Oe.parenL),H.params=this.parseBindingList(Oe.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(H,!1,!0,!1),this.yieldPos=le,this.awaitPos=fe,this.awaitIdentPos=Ae,this.finishNode(H,"FunctionExpression")};Je.parseArrowExpression=function(s,k,W,H){var le=this.yieldPos,fe=this.awaitPos,Ae=this.awaitIdentPos;if(this.enterScope(Vi(W,!1)|ji),this.initFunction(s),this.options.ecmaVersion>=8)s.async=!!W;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,s.params=this.toAssignableList(k,!0),this.parseFunctionBody(s,!0,!1,H),this.yieldPos=le,this.awaitPos=fe,this.awaitIdentPos=Ae,this.finishNode(s,"ArrowFunctionExpression")};Je.parseFunctionBody=function(s,k,W,H){var le=k&&this.type!==Oe.braceL,fe=this.strict,Ae=!1;if(le)s.body=this.parseMaybeAssign(H),s.expression=!0,this.checkParams(s,!1);else{var De=this.options.ecmaVersion>=7&&!this.isSimpleParamList(s.params);if(!fe||De){if(Ae=this.strictDirective(this.end),Ae&&De)this.raiseRecoverable(s.start,"Illegal 'use strict' directive in function with non-simple parameter list")}var Re=this.labels;if(this.labels=[],Ae)this.strict=!0;if(this.checkParams(s,!fe&&!Ae&&!k&&!W&&this.isSimpleParamList(s.params)),this.strict&&s.id)this.checkLValSimple(s.id,Ho);s.body=this.parseBlock(!1,void 0,Ae&&!fe),s.expression=!1,this.adaptDirectivePrologue(s.body.body),this.labels=Re}this.exitScope()};Je.isSimpleParamList=function(s){for(var k=0,W=s;k<W.length;k+=1){var H=W[k];if(H.type!=="Identifier")return!1}return!0};Je.checkParams=function(s,k){var W=Object.create(null);for(var H=0,le=s.params;H<le.length;H+=1){var fe=le[H];this.checkLValInnerPattern(fe,Wi,k?null:W)}};Je.parseExprList=function(s,k,W,H){var le=[],fe=!0;while(!this.eat(s)){if(!fe){if(this.expect(Oe.comma),k&&this.afterTrailingComma(s))break}else fe=!1;var Ae=void 0;if(W&&this.type===Oe.comma)Ae=null;else if(this.type===Oe.ellipsis){if(Ae=this.parseSpread(H),H&&this.type===Oe.comma&&H.trailingComma<0)H.trailingComma=this.start}else Ae=this.parseMaybeAssign(!1,H);le.push(Ae)}return le};Je.checkUnreserved=function(s){var{start:k,end:W,name:H}=s;if(this.inGenerator&&H==="yield")this.raiseRecoverable(k,"Cannot use 'yield' as identifier inside a generator");if(this.inAsync&&H==="await")this.raiseRecoverable(k,"Cannot use 'await' as identifier inside an async function");if(!(this.currentThisScope().flags&Ar)&&H==="arguments")this.raiseRecoverable(k,"Cannot use 'arguments' in class field initializer");if(this.inClassStaticBlock&&(H==="arguments"||H==="await"))this.raise(k,"Cannot use "+H+" in class static initialization block");if(this.keywords.test(H))this.raise(k,"Unexpected keyword '"+H+"'");if(this.options.ecmaVersion<6&&this.input.slice(k,W).indexOf("\\")!==-1)return;var le=this.strict?this.reservedWordsStrict:this.reservedWords;if(le.test(H)){if(!this.inAsync&&H==="await")this.raiseRecoverable(k,"Cannot use keyword 'await' outside an async function");this.raiseRecoverable(k,"The keyword '"+H+"' is reserved")}};Je.parseIdent=function(s){var k=this.parseIdentNode();if(this.next(!!s),this.finishNode(k,"Identifier"),!s){if(this.checkUnreserved(k),k.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=k.start}return k};Je.parseIdentNode=function(){var s=this.startNode();if(this.type===Oe.name)s.name=this.value;else if(this.type.keyword){if(s.name=this.type.keyword,(s.name==="class"||s.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.context.pop();this.type=Oe.name}else this.unexpected();return s};Je.parsePrivateIdent=function(){var s=this.startNode();if(this.type===Oe.privateId)s.name=this.value;else this.unexpected();if(this.next(),this.finishNode(s,"PrivateIdentifier"),this.options.checkPrivateFields)if(this.privateNameStack.length===0)this.raise(s.start,"Private field '#"+s.name+"' must be declared in an enclosing class");else this.privateNameStack[this.privateNameStack.length-1].used.push(s);return s};Je.parseYield=function(s){if(!this.yieldPos)this.yieldPos=this.start;var k=this.startNode();if(this.next(),this.type===Oe.semi||this.canInsertSemicolon()||this.type!==Oe.star&&!this.type.startsExpr)k.delegate=!1,k.argument=null;else k.delegate=this.eat(Oe.star),k.argument=this.parseMaybeAssign(s);return this.finishNode(k,"YieldExpression")};Je.parseAwait=function(s){if(!this.awaitPos)this.awaitPos=this.start;var k=this.startNode();return this.next(),k.argument=this.parseMaybeUnary(null,!0,!1,s),this.finishNode(k,"AwaitExpression")};var kr=n.prototype;kr.raise=function(s,k){var W=Fi(this.input,s);if(k+=" ("+W.line+":"+W.column+")",this.sourceFile)k+=" in "+this.sourceFile;var H=SyntaxError(k);throw H.pos=s,H.loc=W,H.raisedAt=this.pos,H};kr.raiseRecoverable=kr.raise;kr.curPosition=function(){if(this.options.locations)return new En(this.curLine,this.pos-this.lineStart)};var nn=n.prototype,sf=function(k){this.flags=k,this.var=[],this.lexical=[],this.functions=[]};nn.enterScope=function(s){this.scopeStack.push(new sf(s))};nn.exitScope=function(){this.scopeStack.pop()};nn.treatFunctionsAsVarInScope=function(s){return s.flags&fn||!this.inModule&&s.flags&un};nn.declareName=function(s,k,W){var H=!1;if(k===Qt){var le=this.currentScope();if(H=le.lexical.indexOf(s)>-1||le.functions.indexOf(s)>-1||le.var.indexOf(s)>-1,le.lexical.push(s),this.inModule&&le.flags&un)delete this.undefinedExports[s]}else if(k===Go){var fe=this.currentScope();fe.lexical.push(s)}else if(k===Wo){var Ae=this.currentScope();if(this.treatFunctionsAsVar)H=Ae.lexical.indexOf(s)>-1;else H=Ae.lexical.indexOf(s)>-1||Ae.var.indexOf(s)>-1;Ae.functions.push(s)}else for(var De=this.scopeStack.length-1;De>=0;--De){var Re=this.scopeStack[De];if(Re.lexical.indexOf(s)>-1&&!(Re.flags&Bo&&Re.lexical[0]===s)||!this.treatFunctionsAsVarInScope(Re)&&Re.functions.indexOf(s)>-1){H=!0;break}if(Re.var.push(s),this.inModule&&Re.flags&un)delete this.undefinedExports[s];if(Re.flags&Ar)break}if(H)this.raiseRecoverable(W,"Identifier '"+s+"' has already been declared")};nn.checkLocalExport=function(s){if(this.scopeStack[0].lexical.indexOf(s.name)===-1&&this.scopeStack[0].var.indexOf(s.name)===-1)this.undefinedExports[s.name]=s};nn.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};nn.currentVarScope=function(){for(var s=this.scopeStack.length-1;;s--){var k=this.scopeStack[s];if(k.flags&(Ar|Fn|dn))return k}};nn.currentThisScope=function(){for(var s=this.scopeStack.length-1;;s--){var k=this.scopeStack[s];if(k.flags&(Ar|Fn|dn)&&!(k.flags&ji))return k}};var Bn=function(k,W,H){if(this.type="",this.start=W,this.end=0,k.options.locations)this.loc=new Mn(k,H);if(k.options.directSourceFile)this.sourceFile=k.options.directSourceFile;if(k.options.ranges)this.range=[W,0]},jn=n.prototype;jn.startNode=function(){return new Bn(this,this.start,this.startLoc)};jn.startNodeAt=function(s,k){return new Bn(this,s,k)};function qo(s,k,W,H){if(s.type=k,s.end=W,this.options.locations)s.loc.end=H;if(this.options.ranges)s.range[1]=W;return s}jn.finishNode=function(s,k){return qo.call(this,s,k,this.lastTokEnd,this.lastTokEndLoc)};jn.finishNodeAt=function(s,k,W,H){return qo.call(this,s,k,W,H)};jn.copyNode=function(s){var k=new Bn(this,s.start,this.startLoc);for(var W in s)k[W]=s[W];return k};var of="Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz",zo="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Xo=zo+" Extended_Pictographic",Jo=Xo,Yo=Jo+" EBase EComp EMod EPres ExtPict",Qo=Yo,af=Qo,cf={9:zo,10:Xo,11:Jo,12:Yo,13:Qo,14:af},pf="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",uf={9:"",10:"",11:"",12:"",13:"",14:pf},Do="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Zo="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",ea=Zo+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ta=ea+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",na=ta+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",ra=na+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",lf=ra+" "+of,ff={9:Zo,10:ea,11:ta,12:na,13:ra,14:lf},ia={};function df(s){var k=ia[s]={binary:tn(cf[s]+" "+Do),binaryOfStrings:tn(uf[s]),nonBinary:{General_Category:tn(Do),Script:tn(ff[s])}};k.nonBinary.Script_Extensions=k.nonBinary.Script,k.nonBinary.gc=k.nonBinary.General_Category,k.nonBinary.sc=k.nonBinary.Script,k.nonBinary.scx=k.nonBinary.Script_Extensions}for($n=0,Cr=[9,10,11,12,13,14];$n<Cr.length;$n+=1)Li=Cr[$n],df(Li);var Li,$n,Cr,Ue=n.prototype,wr=function(k,W){this.parent=k,this.base=W||this};wr.prototype.separatedFrom=function(k){for(var W=this;W;W=W.parent)for(var H=k;H;H=H.parent)if(W.base===H.base&&W!==H)return!0;return!1};wr.prototype.sibling=function(){return new wr(this.parent,this.base)};var Ht=function(k){this.parser=k,this.validFlags="gim"+(k.options.ecmaVersion>=6?"uy":"")+(k.options.ecmaVersion>=9?"s":"")+(k.options.ecmaVersion>=13?"d":"")+(k.options.ecmaVersion>=15?"v":""),this.unicodeProperties=ia[k.options.ecmaVersion>=14?14:k.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};Ht.prototype.reset=function(k,W,H){var le=H.indexOf("v")!==-1,fe=H.indexOf("u")!==-1;if(this.start=k|0,this.source=W+"",this.flags=H,le&&this.parser.options.ecmaVersion>=15)this.switchU=!0,this.switchV=!0,this.switchN=!0;else this.switchU=fe&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=fe&&this.parser.options.ecmaVersion>=9};Ht.prototype.raise=function(k){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+k)};Ht.prototype.at=function(k,W){if(W===void 0)W=!1;var H=this.source,le=H.length;if(k>=le)return-1;var fe=H.charCodeAt(k);if(!(W||this.switchU)||fe<=55295||fe>=57344||k+1>=le)return fe;var Ae=H.charCodeAt(k+1);return Ae>=56320&&Ae<=57343?(fe<<10)+Ae-56613888:fe};Ht.prototype.nextIndex=function(k,W){if(W===void 0)W=!1;var H=this.source,le=H.length;if(k>=le)return le;var fe=H.charCodeAt(k),Ae;if(!(W||this.switchU)||fe<=55295||fe>=57344||k+1>=le||(Ae=H.charCodeAt(k+1))<56320||Ae>57343)return k+1;return k+2};Ht.prototype.current=function(k){if(k===void 0)k=!1;return this.at(this.pos,k)};Ht.prototype.lookahead=function(k){if(k===void 0)k=!1;return this.at(this.nextIndex(this.pos,k),k)};Ht.prototype.advance=function(k){if(k===void 0)k=!1;this.pos=this.nextIndex(this.pos,k)};Ht.prototype.eat=function(k,W){if(W===void 0)W=!1;if(this.current(W)===k)return this.advance(W),!0;return!1};Ht.prototype.eatChars=function(k,W){if(W===void 0)W=!1;var H=this.pos;for(var le=0,fe=k;le<fe.length;le+=1){var Ae=fe[le],De=this.at(H,W);if(De===-1||De!==Ae)return!1;H=this.nextIndex(H,W)}return this.pos=H,!0};Ue.validateRegExpFlags=function(s){var{validFlags:k,flags:W}=s,H=!1,le=!1;for(var fe=0;fe<W.length;fe++){var Ae=W.charAt(fe);if(k.indexOf(Ae)===-1)this.raise(s.start,"Invalid regular expression flag");if(W.indexOf(Ae,fe+1)>-1)this.raise(s.start,"Duplicate regular expression flag");if(Ae==="u")H=!0;if(Ae==="v")le=!0}if(this.options.ecmaVersion>=15&&H&&le)this.raise(s.start,"Invalid regular expression flag")};function hf(s){for(var k in s)return!0;return!1}Ue.validateRegExpPattern=function(s){if(this.regexp_pattern(s),!s.switchN&&this.options.ecmaVersion>=9&&hf(s.groupNames))s.switchN=!0,this.regexp_pattern(s)};Ue.regexp_pattern=function(s){if(s.pos=0,s.lastIntValue=0,s.lastStringValue="",s.lastAssertionIsQuantifiable=!1,s.numCapturingParens=0,s.maxBackReference=0,s.groupNames=Object.create(null),s.backReferenceNames.length=0,s.branchID=null,this.regexp_disjunction(s),s.pos!==s.source.length){if(s.eat(41))s.raise("Unmatched ')'");if(s.eat(93)||s.eat(125))s.raise("Lone quantifier brackets")}if(s.maxBackReference>s.numCapturingParens)s.raise("Invalid escape");for(var k=0,W=s.backReferenceNames;k<W.length;k+=1){var H=W[k];if(!s.groupNames[H])s.raise("Invalid named capture referenced")}};Ue.regexp_disjunction=function(s){var k=this.options.ecmaVersion>=16;if(k)s.branchID=new wr(s.branchID,null);this.regexp_alternative(s);while(s.eat(124)){if(k)s.branchID=s.branchID.sibling();this.regexp_alternative(s)}if(k)s.branchID=s.branchID.parent;if(this.regexp_eatQuantifier(s,!0))s.raise("Nothing to repeat");if(s.eat(123))s.raise("Lone quantifier brackets")};Ue.regexp_alternative=function(s){while(s.pos<s.source.length&&this.regexp_eatTerm(s));};Ue.regexp_eatTerm=function(s){if(this.regexp_eatAssertion(s)){if(s.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(s)){if(s.switchU)s.raise("Invalid quantifier")}return!0}if(s.switchU?this.regexp_eatAtom(s):this.regexp_eatExtendedAtom(s))return this.regexp_eatQuantifier(s),!0;return!1};Ue.regexp_eatAssertion=function(s){var k=s.pos;if(s.lastAssertionIsQuantifiable=!1,s.eat(94)||s.eat(36))return!0;if(s.eat(92)){if(s.eat(66)||s.eat(98))return!0;s.pos=k}if(s.eat(40)&&s.eat(63)){var W=!1;if(this.options.ecmaVersion>=9)W=s.eat(60);if(s.eat(61)||s.eat(33)){if(this.regexp_disjunction(s),!s.eat(41))s.raise("Unterminated group");return s.lastAssertionIsQuantifiable=!W,!0}}return s.pos=k,!1};Ue.regexp_eatQuantifier=function(s,k){if(k===void 0)k=!1;if(this.regexp_eatQuantifierPrefix(s,k))return s.eat(63),!0;return!1};Ue.regexp_eatQuantifierPrefix=function(s,k){return s.eat(42)||s.eat(43)||s.eat(63)||this.regexp_eatBracedQuantifier(s,k)};Ue.regexp_eatBracedQuantifier=function(s,k){var W=s.pos;if(s.eat(123)){var H=0,le=-1;if(this.regexp_eatDecimalDigits(s)){if(H=s.lastIntValue,s.eat(44)&&this.regexp_eatDecimalDigits(s))le=s.lastIntValue;if(s.eat(125)){if(le!==-1&&le<H&&!k)s.raise("numbers out of order in {} quantifier");return!0}}if(s.switchU&&!k)s.raise("Incomplete quantifier");s.pos=W}return!1};Ue.regexp_eatAtom=function(s){return this.regexp_eatPatternCharacters(s)||s.eat(46)||this.regexp_eatReverseSolidusAtomEscape(s)||this.regexp_eatCharacterClass(s)||this.regexp_eatUncapturingGroup(s)||this.regexp_eatCapturingGroup(s)};Ue.regexp_eatReverseSolidusAtomEscape=function(s){var k=s.pos;if(s.eat(92)){if(this.regexp_eatAtomEscape(s))return!0;s.pos=k}return!1};Ue.regexp_eatUncapturingGroup=function(s){var k=s.pos;if(s.eat(40)){if(s.eat(63)){if(this.options.ecmaVersion>=16){var W=this.regexp_eatModifiers(s),H=s.eat(45);if(W||H){for(var le=0;le<W.length;le++){var fe=W.charAt(le);if(W.indexOf(fe,le+1)>-1)s.raise("Duplicate regular expression modifiers")}if(H){var Ae=this.regexp_eatModifiers(s);if(!W&&!Ae&&s.current()===58)s.raise("Invalid regular expression modifiers");for(var De=0;De<Ae.length;De++){var Re=Ae.charAt(De);if(Ae.indexOf(Re,De+1)>-1||W.indexOf(Re)>-1)s.raise("Duplicate regular expression modifiers")}}}}if(s.eat(58)){if(this.regexp_disjunction(s),s.eat(41))return!0;s.raise("Unterminated group")}}s.pos=k}return!1};Ue.regexp_eatCapturingGroup=function(s){if(s.eat(40)){if(this.options.ecmaVersion>=9)this.regexp_groupSpecifier(s);else if(s.current()===63)s.raise("Invalid group");if(this.regexp_disjunction(s),s.eat(41))return s.numCapturingParens+=1,!0;s.raise("Unterminated group")}return!1};Ue.regexp_eatModifiers=function(s){var k="",W=0;while((W=s.current())!==-1&&mf(W))k+=Jt(W),s.advance();return k};function mf(s){return s===105||s===109||s===115}Ue.regexp_eatExtendedAtom=function(s){return s.eat(46)||this.regexp_eatReverseSolidusAtomEscape(s)||this.regexp_eatCharacterClass(s)||this.regexp_eatUncapturingGroup(s)||this.regexp_eatCapturingGroup(s)||this.regexp_eatInvalidBracedQuantifier(s)||this.regexp_eatExtendedPatternCharacter(s)};Ue.regexp_eatInvalidBracedQuantifier=function(s){if(this.regexp_eatBracedQuantifier(s,!0))s.raise("Nothing to repeat");return!1};Ue.regexp_eatSyntaxCharacter=function(s){var k=s.current();if(sa(k))return s.lastIntValue=k,s.advance(),!0;return!1};function sa(s){return s===36||s>=40&&s<=43||s===46||s===63||s>=91&&s<=94||s>=123&&s<=125}Ue.regexp_eatPatternCharacters=function(s){var k=s.pos,W=0;while((W=s.current())!==-1&&!sa(W))s.advance();return s.pos!==k};Ue.regexp_eatExtendedPatternCharacter=function(s){var k=s.current();if(k!==-1&&k!==36&&!(k>=40&&k<=43)&&k!==46&&k!==63&&k!==91&&k!==94&&k!==124)return s.advance(),!0;return!1};Ue.regexp_groupSpecifier=function(s){if(s.eat(63)){if(!this.regexp_eatGroupName(s))s.raise("Invalid group");var k=this.options.ecmaVersion>=16,W=s.groupNames[s.lastStringValue];if(W)if(k)for(var H=0,le=W;H<le.length;H+=1){var fe=le[H];if(!fe.separatedFrom(s.branchID))s.raise("Duplicate capture group name")}else s.raise("Duplicate capture group name");if(k)(W||(s.groupNames[s.lastStringValue]=[])).push(s.branchID);else s.groupNames[s.lastStringValue]=!0}};Ue.regexp_eatGroupName=function(s){if(s.lastStringValue="",s.eat(60)){if(this.regexp_eatRegExpIdentifierName(s)&&s.eat(62))return!0;s.raise("Invalid capture group name")}return!1};Ue.regexp_eatRegExpIdentifierName=function(s){if(s.lastStringValue="",this.regexp_eatRegExpIdentifierStart(s)){s.lastStringValue+=Jt(s.lastIntValue);while(this.regexp_eatRegExpIdentifierPart(s))s.lastStringValue+=Jt(s.lastIntValue);return!0}return!1};Ue.regexp_eatRegExpIdentifierStart=function(s){var k=s.pos,W=this.options.ecmaVersion>=11,H=s.current(W);if(s.advance(W),H===92&&this.regexp_eatRegExpUnicodeEscapeSequence(s,W))H=s.lastIntValue;if(gf(H))return s.lastIntValue=H,!0;return s.pos=k,!1};function gf(s){return p(s,!0)||s===36||s===95}Ue.regexp_eatRegExpIdentifierPart=function(s){var k=s.pos,W=this.options.ecmaVersion>=11,H=s.current(W);if(s.advance(W),H===92&&this.regexp_eatRegExpUnicodeEscapeSequence(s,W))H=s.lastIntValue;if(yf(H))return s.lastIntValue=H,!0;return s.pos=k,!1};function yf(s){return u(s,!0)||s===36||s===95||s===8204||s===8205}Ue.regexp_eatAtomEscape=function(s){if(this.regexp_eatBackReference(s)||this.regexp_eatCharacterClassEscape(s)||this.regexp_eatCharacterEscape(s)||s.switchN&&this.regexp_eatKGroupName(s))return!0;if(s.switchU){if(s.current()===99)s.raise("Invalid unicode escape");s.raise("Invalid escape")}return!1};Ue.regexp_eatBackReference=function(s){var k=s.pos;if(this.regexp_eatDecimalEscape(s)){var W=s.lastIntValue;if(s.switchU){if(W>s.maxBackReference)s.maxBackReference=W;return!0}if(W<=s.numCapturingParens)return!0;s.pos=k}return!1};Ue.regexp_eatKGroupName=function(s){if(s.eat(107)){if(this.regexp_eatGroupName(s))return s.backReferenceNames.push(s.lastStringValue),!0;s.raise("Invalid named reference")}return!1};Ue.regexp_eatCharacterEscape=function(s){return this.regexp_eatControlEscape(s)||this.regexp_eatCControlLetter(s)||this.regexp_eatZero(s)||this.regexp_eatHexEscapeSequence(s)||this.regexp_eatRegExpUnicodeEscapeSequence(s,!1)||!s.switchU&&this.regexp_eatLegacyOctalEscapeSequence(s)||this.regexp_eatIdentityEscape(s)};Ue.regexp_eatCControlLetter=function(s){var k=s.pos;if(s.eat(99)){if(this.regexp_eatControlLetter(s))return!0;s.pos=k}return!1};Ue.regexp_eatZero=function(s){if(s.current()===48&&!Nr(s.lookahead()))return s.lastIntValue=0,s.advance(),!0;return!1};Ue.regexp_eatControlEscape=function(s){var k=s.current();if(k===116)return s.lastIntValue=9,s.advance(),!0;if(k===110)return s.lastIntValue=10,s.advance(),!0;if(k===118)return s.lastIntValue=11,s.advance(),!0;if(k===102)return s.lastIntValue=12,s.advance(),!0;if(k===114)return s.lastIntValue=13,s.advance(),!0;return!1};Ue.regexp_eatControlLetter=function(s){var k=s.current();if(oa(k))return s.lastIntValue=k%32,s.advance(),!0;return!1};function oa(s){return s>=65&&s<=90||s>=97&&s<=122}Ue.regexp_eatRegExpUnicodeEscapeSequence=function(s,k){if(k===void 0)k=!1;var W=s.pos,H=k||s.switchU;if(s.eat(117)){if(this.regexp_eatFixedHexDigits(s,4)){var le=s.lastIntValue;if(H&&le>=55296&&le<=56319){var fe=s.pos;if(s.eat(92)&&s.eat(117)&&this.regexp_eatFixedHexDigits(s,4)){var Ae=s.lastIntValue;if(Ae>=56320&&Ae<=57343)return s.lastIntValue=(le-55296)*1024+(Ae-56320)+65536,!0}s.pos=fe,s.lastIntValue=le}return!0}if(H&&s.eat(123)&&this.regexp_eatHexDigits(s)&&s.eat(125)&&xf(s.lastIntValue))return!0;if(H)s.raise("Invalid unicode escape");s.pos=W}return!1};function xf(s){return s>=0&&s<=1114111}Ue.regexp_eatIdentityEscape=function(s){if(s.switchU){if(this.regexp_eatSyntaxCharacter(s))return!0;if(s.eat(47))return s.lastIntValue=47,!0;return!1}var k=s.current();if(k!==99&&(!s.switchN||k!==107))return s.lastIntValue=k,s.advance(),!0;return!1};Ue.regexp_eatDecimalEscape=function(s){s.lastIntValue=0;var k=s.current();if(k>=49&&k<=57){do s.lastIntValue=10*s.lastIntValue+(k-48),s.advance();while((k=s.current())>=48&&k<=57);return!0}return!1};var aa=0,Yt=1,It=2;Ue.regexp_eatCharacterClassEscape=function(s){var k=s.current();if(vf(k))return s.lastIntValue=-1,s.advance(),Yt;var W=!1;if(s.switchU&&this.options.ecmaVersion>=9&&((W=k===80)||k===112)){s.lastIntValue=-1,s.advance();var H;if(s.eat(123)&&(H=this.regexp_eatUnicodePropertyValueExpression(s))&&s.eat(125)){if(W&&H===It)s.raise("Invalid property name");return H}s.raise("Invalid property name")}return aa};function vf(s){return s===100||s===68||s===115||s===83||s===119||s===87}Ue.regexp_eatUnicodePropertyValueExpression=function(s){var k=s.pos;if(this.regexp_eatUnicodePropertyName(s)&&s.eat(61)){var W=s.lastStringValue;if(this.regexp_eatUnicodePropertyValue(s)){var H=s.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(s,W,H),Yt}}if(s.pos=k,this.regexp_eatLoneUnicodePropertyNameOrValue(s)){var le=s.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(s,le)}return aa};Ue.regexp_validateUnicodePropertyNameAndValue=function(s,k,W){if(!bn(s.unicodeProperties.nonBinary,k))s.raise("Invalid property name");if(!s.unicodeProperties.nonBinary[k].test(W))s.raise("Invalid property value")};Ue.regexp_validateUnicodePropertyNameOrValue=function(s,k){if(s.unicodeProperties.binary.test(k))return Yt;if(s.switchV&&s.unicodeProperties.binaryOfStrings.test(k))return It;s.raise("Invalid property name")};Ue.regexp_eatUnicodePropertyName=function(s){var k=0;s.lastStringValue="";while(ca(k=s.current()))s.lastStringValue+=Jt(k),s.advance();return s.lastStringValue!==""};function ca(s){return oa(s)||s===95}Ue.regexp_eatUnicodePropertyValue=function(s){var k=0;s.lastStringValue="";while(Cf(k=s.current()))s.lastStringValue+=Jt(k),s.advance();return s.lastStringValue!==""};function Cf(s){return ca(s)||Nr(s)}Ue.regexp_eatLoneUnicodePropertyNameOrValue=function(s){return this.regexp_eatUnicodePropertyValue(s)};Ue.regexp_eatCharacterClass=function(s){if(s.eat(91)){var k=s.eat(94),W=this.regexp_classContents(s);if(!s.eat(93))s.raise("Unterminated character class");if(k&&W===It)s.raise("Negated character class may contain strings");return!0}return!1};Ue.regexp_classContents=function(s){if(s.current()===93)return Yt;if(s.switchV)return this.regexp_classSetExpression(s);return this.regexp_nonEmptyClassRanges(s),Yt};Ue.regexp_nonEmptyClassRanges=function(s){while(this.regexp_eatClassAtom(s)){var k=s.lastIntValue;if(s.eat(45)&&this.regexp_eatClassAtom(s)){var W=s.lastIntValue;if(s.switchU&&(k===-1||W===-1))s.raise("Invalid character class");if(k!==-1&&W!==-1&&k>W)s.raise("Range out of order in character class")}}};Ue.regexp_eatClassAtom=function(s){var k=s.pos;if(s.eat(92)){if(this.regexp_eatClassEscape(s))return!0;if(s.switchU){var W=s.current();if(W===99||la(W))s.raise("Invalid class escape");s.raise("Invalid escape")}s.pos=k}var H=s.current();if(H!==93)return s.lastIntValue=H,s.advance(),!0;return!1};Ue.regexp_eatClassEscape=function(s){var k=s.pos;if(s.eat(98))return s.lastIntValue=8,!0;if(s.switchU&&s.eat(45))return s.lastIntValue=45,!0;if(!s.switchU&&s.eat(99)){if(this.regexp_eatClassControlLetter(s))return!0;s.pos=k}return this.regexp_eatCharacterClassEscape(s)||this.regexp_eatCharacterEscape(s)};Ue.regexp_classSetExpression=function(s){var k=Yt,W;if(this.regexp_eatClassSetRange(s));else if(W=this.regexp_eatClassSetOperand(s)){if(W===It)k=It;var H=s.pos;while(s.eatChars([38,38])){if(s.current()!==38&&(W=this.regexp_eatClassSetOperand(s))){if(W!==It)k=Yt;continue}s.raise("Invalid character in character class")}if(H!==s.pos)return k;while(s.eatChars([45,45])){if(this.regexp_eatClassSetOperand(s))continue;s.raise("Invalid character in character class")}if(H!==s.pos)return k}else s.raise("Invalid character in character class");for(;;){if(this.regexp_eatClassSetRange(s))continue;if(W=this.regexp_eatClassSetOperand(s),!W)return k;if(W===It)k=It}};Ue.regexp_eatClassSetRange=function(s){var k=s.pos;if(this.regexp_eatClassSetCharacter(s)){var W=s.lastIntValue;if(s.eat(45)&&this.regexp_eatClassSetCharacter(s)){var H=s.lastIntValue;if(W!==-1&&H!==-1&&W>H)s.raise("Range out of order in character class");return!0}s.pos=k}return!1};Ue.regexp_eatClassSetOperand=function(s){if(this.regexp_eatClassSetCharacter(s))return Yt;return this.regexp_eatClassStringDisjunction(s)||this.regexp_eatNestedClass(s)};Ue.regexp_eatNestedClass=function(s){var k=s.pos;if(s.eat(91)){var W=s.eat(94),H=this.regexp_classContents(s);if(s.eat(93)){if(W&&H===It)s.raise("Negated character class may contain strings");return H}s.pos=k}if(s.eat(92)){var le=this.regexp_eatCharacterClassEscape(s);if(le)return le;s.pos=k}return null};Ue.regexp_eatClassStringDisjunction=function(s){var k=s.pos;if(s.eatChars([92,113])){if(s.eat(123)){var W=this.regexp_classStringDisjunctionContents(s);if(s.eat(125))return W}else s.raise("Invalid escape");s.pos=k}return null};Ue.regexp_classStringDisjunctionContents=function(s){var k=this.regexp_classString(s);while(s.eat(124))if(this.regexp_classString(s)===It)k=It;return k};Ue.regexp_classString=function(s){var k=0;while(this.regexp_eatClassSetCharacter(s))k++;return k===1?Yt:It};Ue.regexp_eatClassSetCharacter=function(s){var k=s.pos;if(s.eat(92)){if(this.regexp_eatCharacterEscape(s)||this.regexp_eatClassSetReservedPunctuator(s))return!0;if(s.eat(98))return s.lastIntValue=8,!0;return s.pos=k,!1}var W=s.current();if(W<0||W===s.lookahead()&&Ef(W))return!1;if(bf(W))return!1;return s.advance(),s.lastIntValue=W,!0};function Ef(s){return s===33||s>=35&&s<=38||s>=42&&s<=44||s===46||s>=58&&s<=64||s===94||s===96||s===126}function bf(s){return s===40||s===41||s===45||s===47||s>=91&&s<=93||s>=123&&s<=125}Ue.regexp_eatClassSetReservedPunctuator=function(s){var k=s.current();if(Sf(k))return s.lastIntValue=k,s.advance(),!0;return!1};function Sf(s){return s===33||s===35||s===37||s===38||s===44||s===45||s>=58&&s<=62||s===64||s===96||s===126}Ue.regexp_eatClassControlLetter=function(s){var k=s.current();if(Nr(k)||k===95)return s.lastIntValue=k%32,s.advance(),!0;return!1};Ue.regexp_eatHexEscapeSequence=function(s){var k=s.pos;if(s.eat(120)){if(this.regexp_eatFixedHexDigits(s,2))return!0;if(s.switchU)s.raise("Invalid escape");s.pos=k}return!1};Ue.regexp_eatDecimalDigits=function(s){var k=s.pos,W=0;s.lastIntValue=0;while(Nr(W=s.current()))s.lastIntValue=10*s.lastIntValue+(W-48),s.advance();return s.pos!==k};function Nr(s){return s>=48&&s<=57}Ue.regexp_eatHexDigits=function(s){var k=s.pos,W=0;s.lastIntValue=0;while(pa(W=s.current()))s.lastIntValue=16*s.lastIntValue+ua(W),s.advance();return s.pos!==k};function pa(s){return s>=48&&s<=57||s>=65&&s<=70||s>=97&&s<=102}function ua(s){if(s>=65&&s<=70)return 10+(s-65);if(s>=97&&s<=102)return 10+(s-97);return s-48}Ue.regexp_eatLegacyOctalEscapeSequence=function(s){if(this.regexp_eatOctalDigit(s)){var k=s.lastIntValue;if(this.regexp_eatOctalDigit(s)){var W=s.lastIntValue;if(k<=3&&this.regexp_eatOctalDigit(s))s.lastIntValue=k*64+W*8+s.lastIntValue;else s.lastIntValue=k*8+W}else s.lastIntValue=k;return!0}return!1};Ue.regexp_eatOctalDigit=function(s){var k=s.current();if(la(k))return s.lastIntValue=k-48,s.advance(),!0;return s.lastIntValue=0,!1};function la(s){return s>=48&&s<=55}Ue.regexp_eatFixedHexDigits=function(s,k){var W=s.pos;s.lastIntValue=0;for(var H=0;H<k;++H){var le=s.current();if(!pa(le))return s.pos=W,!1;s.lastIntValue=16*s.lastIntValue+ua(le),s.advance()}return!0};var Dr=function(k){if(this.type=k.type,this.value=k.value,this.start=k.start,this.end=k.end,k.options.locations)this.loc=new Mn(k,k.startLoc,k.endLoc);if(k.options.ranges)this.range=[k.start,k.end]},tt=n.prototype;tt.next=function(s){if(!s&&this.type.keyword&&this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword);if(this.options.onToken)this.options.onToken(new Dr(this));this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};tt.getToken=function(){return this.next(),new Dr(this)};if(typeof Symbol<"u")tt[Symbol.iterator]=function(){var s=this;return{next:function(){var k=s.getToken();return{done:k.type===Oe.eof,value:k}}}};tt.nextToken=function(){var s=this.curContext();if(!s||!s.preserveSpace)this.skipSpace();if(this.start=this.pos,this.options.locations)this.startLoc=this.curPosition();if(this.pos>=this.input.length)return this.finishToken(Oe.eof);if(s.override)return s.override(this);else this.readToken(this.fullCharCodeAtPos())};tt.readToken=function(s){if(p(s,this.options.ecmaVersion>=6)||s===92)return this.readWord();return this.getTokenFromCode(s)};tt.fullCharCodeAt=function(s){var k=this.input.charCodeAt(s);if(k<=55295||k>=56320)return k;var W=this.input.charCodeAt(s+1);return W<=56319||W>=57344?k:(k<<10)+W-56613888};tt.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};tt.skipBlockComment=function(){var s=this.options.onComment&&this.curPosition(),k=this.pos,W=this.input.indexOf("*/",this.pos+=2);if(W===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=W+2,this.options.locations)for(var H=void 0,le=k;(H=Lo(this.input,le,this.pos))>-1;)++this.curLine,le=this.lineStart=H;if(this.options.onComment)this.options.onComment(!0,this.input.slice(k+2,W),k,this.pos,s,this.curPosition())};tt.skipLineComment=function(s){var k=this.pos,W=this.options.onComment&&this.curPosition(),H=this.input.charCodeAt(this.pos+=s);while(this.pos<this.input.length&&!ln(H))H=this.input.charCodeAt(++this.pos);if(this.options.onComment)this.options.onComment(!1,this.input.slice(k+s,this.pos),k,this.pos,W,this.curPosition())};tt.skipSpace=function(){e:while(this.pos<this.input.length){var s=this.input.charCodeAt(this.pos);switch(s){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(s>8&&s<14||s>=5760&&Mi.test(String.fromCharCode(s)))++this.pos;else break e}}};tt.finishToken=function(s,k){if(this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();var W=this.type;this.type=s,this.value=k,this.updateContext(W)};tt.readToken_dot=function(){var s=this.input.charCodeAt(this.pos+1);if(s>=48&&s<=57)return this.readNumber(!0);var k=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&s===46&&k===46)return this.pos+=3,this.finishToken(Oe.ellipsis);else return++this.pos,this.finishToken(Oe.dot)};tt.readToken_slash=function(){var s=this.input.charCodeAt(this.pos+1);if(this.exprAllowed)return++this.pos,this.readRegexp();if(s===61)return this.finishOp(Oe.assign,2);return this.finishOp(Oe.slash,1)};tt.readToken_mult_modulo_exp=function(s){var k=this.input.charCodeAt(this.pos+1),W=1,H=s===42?Oe.star:Oe.modulo;if(this.options.ecmaVersion>=7&&s===42&&k===42)++W,H=Oe.starstar,k=this.input.charCodeAt(this.pos+2);if(k===61)return this.finishOp(Oe.assign,W+1);return this.finishOp(H,W)};tt.readToken_pipe_amp=function(s){var k=this.input.charCodeAt(this.pos+1);if(k===s){if(this.options.ecmaVersion>=12){var W=this.input.charCodeAt(this.pos+2);if(W===61)return this.finishOp(Oe.assign,3)}return this.finishOp(s===124?Oe.logicalOR:Oe.logicalAND,2)}if(k===61)return this.finishOp(Oe.assign,2);return this.finishOp(s===124?Oe.bitwiseOR:Oe.bitwiseAND,1)};tt.readToken_caret=function(){var s=this.input.charCodeAt(this.pos+1);if(s===61)return this.finishOp(Oe.assign,2);return this.finishOp(Oe.bitwiseXOR,1)};tt.readToken_plus_min=function(s){var k=this.input.charCodeAt(this.pos+1);if(k===s){if(k===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||Et.test(this.input.slice(this.lastTokEnd,this.pos))))return this.skipLineComment(3),this.skipSpace(),this.nextToken();return this.finishOp(Oe.incDec,2)}if(k===61)return this.finishOp(Oe.assign,2);return this.finishOp(Oe.plusMin,1)};tt.readToken_lt_gt=function(s){var k=this.input.charCodeAt(this.pos+1),W=1;if(k===s){if(W=s===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+W)===61)return this.finishOp(Oe.assign,W+1);return this.finishOp(Oe.bitShift,W)}if(k===33&&s===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(k===61)W=2;return this.finishOp(Oe.relational,W)};tt.readToken_eq_excl=function(s){var k=this.input.charCodeAt(this.pos+1);if(k===61)return this.finishOp(Oe.equality,this.input.charCodeAt(this.pos+2)===61?3:2);if(s===61&&k===62&&this.options.ecmaVersion>=6)return this.pos+=2,this.finishToken(Oe.arrow);return this.finishOp(s===61?Oe.eq:Oe.prefix,1)};tt.readToken_question=function(){var s=this.options.ecmaVersion;if(s>=11){var k=this.input.charCodeAt(this.pos+1);if(k===46){var W=this.input.charCodeAt(this.pos+2);if(W<48||W>57)return this.finishOp(Oe.questionDot,2)}if(k===63){if(s>=12){var H=this.input.charCodeAt(this.pos+2);if(H===61)return this.finishOp(Oe.assign,3)}return this.finishOp(Oe.coalesce,2)}}return this.finishOp(Oe.question,1)};tt.readToken_numberSign=function(){var s=this.options.ecmaVersion,k=35;if(s>=13){if(++this.pos,k=this.fullCharCodeAtPos(),p(k,!0)||k===92)return this.finishToken(Oe.privateId,this.readWord1())}this.raise(this.pos,"Unexpected character '"+Jt(k)+"'")};tt.getTokenFromCode=function(s){switch(s){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(Oe.parenL);case 41:return++this.pos,this.finishToken(Oe.parenR);case 59:return++this.pos,this.finishToken(Oe.semi);case 44:return++this.pos,this.finishToken(Oe.comma);case 91:return++this.pos,this.finishToken(Oe.bracketL);case 93:return++this.pos,this.finishToken(Oe.bracketR);case 123:return++this.pos,this.finishToken(Oe.braceL);case 125:return++this.pos,this.finishToken(Oe.braceR);case 58:return++this.pos,this.finishToken(Oe.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(Oe.backQuote);case 48:var k=this.input.charCodeAt(this.pos+1);if(k===120||k===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(k===111||k===79)return this.readRadixNumber(8);if(k===98||k===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(s);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(s);case 124:case 38:return this.readToken_pipe_amp(s);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(s);case 60:case 62:return this.readToken_lt_gt(s);case 61:case 33:return this.readToken_eq_excl(s);case 63:return this.readToken_question();case 126:return this.finishOp(Oe.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Jt(s)+"'")};tt.finishOp=function(s,k){var W=this.input.slice(this.pos,this.pos+k);return this.pos+=k,this.finishToken(s,W)};tt.readRegexp=function(){var s,k,W=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(W,"Unterminated regular expression");var H=this.input.charAt(this.pos);if(Et.test(H))this.raise(W,"Unterminated regular expression");if(!s){if(H==="[")k=!0;else if(H==="]"&&k)k=!1;else if(H==="/"&&!k)break;s=H==="\\"}else s=!1;++this.pos}var le=this.input.slice(W,this.pos);++this.pos;var fe=this.pos,Ae=this.readWord1();if(this.containsEsc)this.unexpected(fe);var De=this.regexpState||(this.regexpState=new Ht(this));De.reset(W,le,Ae),this.validateRegExpFlags(De),this.validateRegExpPattern(De);var Re=null;try{Re=new RegExp(le,Ae)}catch($e){}return this.finishToken(Oe.regexp,{pattern:le,flags:Ae,value:Re})};tt.readInt=function(s,k,W){var H=this.options.ecmaVersion>=12&&k===void 0,le=W&&this.input.charCodeAt(this.pos)===48,fe=this.pos,Ae=0,De=0;for(var Re=0,$e=k==null?1/0:k;Re<$e;++Re,++this.pos){var Le=this.input.charCodeAt(this.pos),Be=void 0;if(H&&Le===95){if(le)this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals");if(De===95)this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore");if(Re===0)this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits");De=Le;continue}if(Le>=97)Be=Le-97+10;else if(Le>=65)Be=Le-65+10;else if(Le>=48&&Le<=57)Be=Le-48;else Be=1/0;if(Be>=s)break;De=Le,Ae=Ae*s+Be}if(H&&De===95)this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits");if(this.pos===fe||k!=null&&this.pos-fe!==k)return null;return Ae};function kf(s,k){if(k)return parseInt(s,8);return parseFloat(s.replace(/_/g,""))}function fa(s){if(typeof BigInt!=="function")return null;return BigInt(s.replace(/_/g,""))}tt.readRadixNumber=function(s){var k=this.pos;this.pos+=2;var W=this.readInt(s);if(W==null)this.raise(this.start+2,"Expected number in radix "+s);if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110)W=fa(this.input.slice(k,this.pos)),++this.pos;else if(p(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(Oe.num,W)};tt.readNumber=function(s){var k=this.pos;if(!s&&this.readInt(10,void 0,!0)===null)this.raise(k,"Invalid number");var W=this.pos-k>=2&&this.input.charCodeAt(k)===48;if(W&&this.strict)this.raise(k,"Invalid number");var H=this.input.charCodeAt(this.pos);if(!W&&!s&&this.options.ecmaVersion>=11&&H===110){var le=fa(this.input.slice(k,this.pos));if(++this.pos,p(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(Oe.num,le)}if(W&&/[89]/.test(this.input.slice(k,this.pos)))W=!1;if(H===46&&!W)++this.pos,this.readInt(10),H=this.input.charCodeAt(this.pos);if((H===69||H===101)&&!W){if(H=this.input.charCodeAt(++this.pos),H===43||H===45)++this.pos;if(this.readInt(10)===null)this.raise(k,"Invalid number")}if(p(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");var fe=kf(this.input.slice(k,this.pos),W);return this.finishToken(Oe.num,fe)};tt.readCodePoint=function(){var s=this.input.charCodeAt(this.pos),k;if(s===123){if(this.options.ecmaVersion<6)this.unexpected();var W=++this.pos;if(k=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,k>1114111)this.invalidStringToken(W,"Code point out of bounds")}else k=this.readHexChar(4);return k};tt.readString=function(s){var k="",W=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");var H=this.input.charCodeAt(this.pos);if(H===s)break;if(H===92)k+=this.input.slice(W,this.pos),k+=this.readEscapedChar(!1),W=this.pos;else if(H===8232||H===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(ln(H))this.raise(this.start,"Unterminated string constant");++this.pos}}return k+=this.input.slice(W,this.pos++),this.finishToken(Oe.string,k)};var da={};tt.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(s){if(s===da)this.readInvalidTemplateToken();else throw s}this.inTemplateElement=!1};tt.invalidStringToken=function(s,k){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw da;else this.raise(s,k)};tt.readTmplToken=function(){var s="",k=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated template");var W=this.input.charCodeAt(this.pos);if(W===96||W===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&(this.type===Oe.template||this.type===Oe.invalidTemplate))if(W===36)return this.pos+=2,this.finishToken(Oe.dollarBraceL);else return++this.pos,this.finishToken(Oe.backQuote);return s+=this.input.slice(k,this.pos),this.finishToken(Oe.template,s)}if(W===92)s+=this.input.slice(k,this.pos),s+=this.readEscapedChar(!0),k=this.pos;else if(ln(W)){switch(s+=this.input.slice(k,this.pos),++this.pos,W){case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:s+=`
193
+ `;break;default:s+=String.fromCharCode(W);break}if(this.options.locations)++this.curLine,this.lineStart=this.pos;k=this.pos}else++this.pos}};tt.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(Oe.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":if(this.input[this.pos+1]===`
194
+ `)++this.pos;case`
195
+ `:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};tt.readEscapedChar=function(s){var k=this.input.charCodeAt(++this.pos);switch(++this.pos,k){case 110:return`
196
+ `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Jt(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(s){var W=this.pos-1;this.invalidStringToken(W,"Invalid escape sequence in template string")}default:if(k>=48&&k<=55){var H=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],le=parseInt(H,8);if(le>255)H=H.slice(0,-1),le=parseInt(H,8);if(this.pos+=H.length-1,k=this.input.charCodeAt(this.pos),(H!=="0"||k===56||k===57)&&(this.strict||s))this.invalidStringToken(this.pos-1-H.length,s?"Octal literal in template string":"Octal literal in strict mode");return String.fromCharCode(le)}if(ln(k)){if(this.options.locations)this.lineStart=this.pos,++this.curLine;return""}return String.fromCharCode(k)}};tt.readHexChar=function(s){var k=this.pos,W=this.readInt(16,s);if(W===null)this.invalidStringToken(k,"Bad character escape sequence");return W};tt.readWord1=function(){this.containsEsc=!1;var s="",k=!0,W=this.pos,H=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var le=this.fullCharCodeAtPos();if(u(le,H))this.pos+=le<=65535?1:2;else if(le===92){this.containsEsc=!0,s+=this.input.slice(W,this.pos);var fe=this.pos;if(this.input.charCodeAt(++this.pos)!==117)this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX");++this.pos;var Ae=this.readCodePoint();if(!(k?p:u)(Ae,H))this.invalidStringToken(fe,"Invalid Unicode escape");s+=Jt(Ae),W=this.pos}else break;k=!1}return s+this.input.slice(W,this.pos)};tt.readWord=function(){var s=this.readWord1(),k=Oe.name;if(this.keywords.test(s))k=Pr[s];return this.finishToken(k,s)};var ha="8.18.0";n.acorn={Parser:n,version:ha,defaultOptions:Er,Position:En,SourceLocation:Mn,getLineInfo:Fi,Node:Bn,TokenType:it,tokTypes:Oe,keywordTypes:Pr,TokContext:Rt,tokContexts:ut,isIdentifierChar:u,isIdentifierStart:p,Token:Dr,isNewLine:ln,lineBreak:Et,lineBreakG:$o,nonASCIIwhitespace:Mi};function Hi(s,k){return n.parse(s,k)}function wf(s,k,W){return n.parseExpressionAt(s,k,W)}function Pf(s,k){return n.tokenizer(s,k)}var ya=new Map;function Af(s){return Hi(s,{ecmaVersion:"latest",sourceType:"module"})}function Tf(s,k,W){let H=wt(s,k);if(!H)return null;let le=Ui(H);if(W.has(H))return{dir:le,exports:{}};W.add(H);try{return{dir:le,exports:Rr(xa(H,"utf-8"),le,W,H)}}catch{return{dir:le,exports:{}}}finally{W.delete(H)}}function Rr(s,k,W=new Set,H=k){let le=ya.get(H),fe=le?.source===s?le.ast:void 0;if(!fe)fe=Af(s),ya.set(H,{source:s,ast:fe});let Ae={};for(let De of fe.body)if(De.type==="ExportDefaultDeclaration"){let Re=De.declaration.name;if(Re in Ae)Ae[Re].default=!0;else Ae[Re]={source:zt(""),default:!0}}else if(De.type==="ExportAllDeclaration"){if(!De.source)continue;let Re=De.source.value,$e=wt(Re,k);if(!$e){let Fe=U(Re,k);throw new gn(Re,H,Fe.unresolved?Fe.searched:"no matching file or index found")}if(W.has($e))continue;W.add($e);let Le=xa($e,"utf-8"),Be=Rr(Le,Ui($e),W,$e);W.delete($e);for(let[Fe,Me]of Object.entries(Be)){let je=zt(t(Me.source.startsWith(".")?`./${ma(k,ga(Ui($e),Me.source))}`:`./${_f(Re,Me.source)}`));Ae[Fe]={...Me,source:je}}}else if(De.type==="ExportNamedDeclaration"){let Re=De.source?.value,$e=Re!==void 0&&Vt.test(Re);if($e){let Fe=U(Re,k);if(Fe.unresolved)throw new gn(Re,H,Fe.searched)}let Be=Re!==void 0&&!$e?Tf(Re,k,W):void 0;if(Be===null)console.warn(`sveld: could not resolve re-exported module "${Re}" from barrel "${k||"."}"; skipping.`);for(let Fe of De.specifiers){let Me=Fe.exported.name,je=Fe.local.name,Ve=Me||je;if(Be===null)continue;let We=Be?.exports[je],He=We?zt(t(`./${ma(k,ga(Be.dir,We.source))}`)):zt(ar(Re??"",k)),qe=We?We.default:je==="default";if(Ve in Ae){if(Ae[Ve].mixed=!0,!Ae[Ve].source)Ae[Ve].source=He}else Ae[Ve]={source:He,default:qe}}}else if(De.type==="ImportDeclaration"){let Re=De.specifiers[0].local.name;if(Re in Ae){if(!Ae[Re].source)Ae[Re].source=zt(ar(De.source?.value??"",k))}else Ae[Re]={source:zt(ar(De.source?.value??"",k)),default:Re==="default"}}return Ae}var Nf=/(?:_|[^\p{ID_Continue}$])+/u,Df=/^[\p{ID_Start}$]/u;function j(s){let H=`${s.split(Nf).map((le)=>le.charAt(0).toUpperCase()+le.slice(1)).join("")}Context`;return Df.test(H)?H:`_${H}`}function ie(s,k){let W=c(s.name,k.name);if(W!==0)return W;let H=c(s.type,k.type);if(H!==0)return H;if(s.type==="forwarded"&&k.type==="forwarded"){let le=c(s.element,k.element);if(le!==0)return le}return c(s.detail??"",k.detail??"")}function ne(s,k){let W=k.source?.value;if(typeof W!=="string"||k.importKind==="type")return;for(let H of k.specifiers??[]){if(H.type!=="ImportSpecifier"||H.importKind==="type")continue;let le=H.local?.name;if(!le)continue;let fe=H.imported?.name??(typeof H.imported?.value==="string"?H.imported.value:le);s.valueImportBindingsByLocalName.set(le,{localName:le,importedName:fe,source:W})}}function re(s){return[s.importedName,...s.members??[]].join(".")}function me(s,k){let W=[],H=k;while(H.type==="MemberExpression"){if(H.computed||!e(H.property))return;W.unshift(H.property.name),H=H.object}if(!e(H))return;let le=H.name,fe=(De,Re,$e)=>$e.length>0?{source:De,importedName:Re,members:$e}:{source:De,importedName:Re},Ae=s.valueImportBindingsByLocalName.get(le);if(Ae)return fe(Ae.source,Ae.importedName,W);for(let De of[s.parsed?.instance,s.parsed?.module])for(let Re of(De?w(De):void 0)??[]){let $e=Re,Le=$e.source?.value;if($e.type!=="ImportDeclaration"||$e.importKind==="type"||typeof Le!=="string")continue;let Be=$e.specifiers?.find((Fe)=>Fe.local?.name===le);if(Be?.type==="ImportDefaultSpecifier")return fe(Le,"default",W);if(Be?.type==="ImportNamespaceSpecifier"&&W.length>0)return fe(Le,W[0],W.slice(1))}return}function se(s,k){if(!M(k))return;return me(s,k)}function w(s){let k=s,W=k.type==="Program"?k.body:k.content?.body??k.body;return Array.isArray(W)?W:void 0}function Ce(s){let k=new Map,W=s?w(s):void 0;if(!W)return k;for(let H of W){let le=H;if(le.type!=="ImportDeclaration"||le.importKind==="type")continue;let fe=le.source?.value;if(typeof fe!=="string")continue;for(let Ae of le.specifiers??[]){let De=Ae.local?.name;if(!De||Ae.importKind==="type")continue;let Re;if(Ae.type==="ImportDefaultSpecifier")Re="default";else if(Ae.type==="ImportNamespaceSpecifier")Re="*";else Re=Ae.imported?.name??String(Ae.imported?.value??De);k.set(De,{from:fe,imported:Re})}}return k}function he(s,k){if(!k)return;let W=w(k);if(!W)return;for(let H of W){let le=H;if(le.type==="ImportDeclaration"){ne(s,le);continue}let fe=le.type==="ExportNamedDeclaration"&&le.declaration?le.declaration:le;if(fe.type==="FunctionDeclaration"){let Ae=fe;if(Ae.id?.name)s.funcDecls.set(Ae.id.name,Ae)}}}import{existsSync as Rf}from"node:fs";import{dirname as If}from"node:path";var Of=/\.[^./\\]+$/;function $f(s){if(s.endsWith(".d.ts"))return null;let k=s.replace(Of,".d.ts");return Rf(k)?k:null}function va(s,k,W){let H=If(s);return k.map((le)=>{if(!le.importSource||!le.importedName)return{candidate:le};let fe=wt(le.importSource,H);if(!fe)return{candidate:le,failureReason:"module-not-found"};let Ae=pn(fe,le.importedName,W);if(!Ae)return{candidate:le,failureReason:"export-not-found"};if(Ae.returnType)return{candidate:le,type:Ae.returnType};let De=$f(fe);if(De){let Re=pn(De,le.importedName,W);if(Re?.returnType)return{candidate:le,type:Re.returnType}}return{candidate:le,failureReason:"return-type-unresolved"}})}function Ca(s,k){switch(k){case"module-not-found":return`Prop "${s.propName}" default calls "${s.calleeName}()", but "${s.importSource}" could not be resolved; falling back to "any".`;case"export-not-found":return`Prop "${s.propName}" default calls "${s.calleeName}()", but "${s.importedName}" is not exported from "${s.importSource}"; falling back to "any".`;case"return-type-unresolved":return`Prop "${s.propName}" default calls "${s.calleeName}()" imported from "${s.importSource}", but its return type could not be resolved; falling back to "any".`}}import{dirname as Lf}from"node:path";function Ea(s,k,W){let H=Lf(s);return k.map((le)=>{let fe=wt(le.importSource,H);if(!fe)return{candidate:le};let Ae=Cn(fe,le,W);if(!Ae?.primitiveLiteral)return{candidate:le};return{candidate:le,literal:Ae.primitiveLiteral,declaredType:Ae.declaredType}})}import{dirname as Mf}from"node:path";function ba(s,k,W){let H=Mf(s);return k.map((le)=>{let fe=wt(le.importSource,H);if(!fe)return{candidate:le};let Ae=Cn(fe,le,W);if(Ae?.kind!=="const"||Ae.literalValue===void 0)return{candidate:le};return{candidate:le,key:Ae.literalValue}})}import{dirname as Ff}from"node:path";function wa(s,k,W){let H=Ff(s);return k.map((le)=>{let fe=wt(le.importSource,H);if(!fe)return{candidate:le,failureReason:"module-not-found"};let Ae=Cn(fe,le,W)?.functionNode;if(!Ae)return{candidate:le,failureReason:"not-a-function"};let De=Bf(Ae,le);if(!De)return{candidate:le,failureReason:"parameter-not-found"};return Wf(Ae,De,le)})}function Sa(s){return s?.type==="AssignmentPattern"?Xe(s.left):s}function Bf(s,k){let W=Array.isArray(s.params)?s.params:[],H=Sa(Xe(W[k.argumentIndex]));if(k.property===void 0)return e(H)?{name:H.name}:void 0;if(!k.property)return;if(e(H))return{object:H.name,property:k.property};if(H?.type!=="ObjectPattern"||!Array.isArray(H.properties))return;for(let le of H.properties){if(le.type!=="Property"||le.computed)continue;let fe=Xe(le.key);if(!e(fe)||fe.name!==k.property)continue;let Ae=Sa(Xe(le.value));return e(Ae)?{name:Ae.name}:void 0}return}function Ki(s){if(!s)return null;if(s.type==="ConditionalExpression"){let W=Ki(Xe(s.consequent)),H=Ki(Xe(s.alternate));return W&&H?[...W,...H]:null}let k=f(s);return k?[k]:null}var jf={variableType:()=>{return},getPropertyName:(s)=>{if(e(s))return s.name;return y(s)&&s.value!=null?String(s.value):void 0}};function Vf(s){if(!s)return"null";let{deriveLiteralDetailType:k,literalDetailToTypeText:W}=Wt();if(s.type==="Literal")return W(s.value);return k(jf,s)??"any"}function ka(s,k){if("name"in k)return s.type==="Identifier"&&s.name===k.name;if(s.type!=="MemberExpression"||s.computed)return!1;let W=Xe(s.object),H=Xe(s.property);return e(W)&&W.name===k.object&&e(H)&&H.name===k.property}function Wf(s,k,W){let H=Xe(s.body);if(!H)return{candidate:W,events:[]};let le=new Map,fe="name"in k?k.name:k.object,Ae;if(b(H,(Re,$e,Le)=>{if(Ae)return;if(Re.type==="CallExpression"){let Fe=Xe(Re.callee);if(!Fe||!ka(Fe,k))return;let Me=Array.isArray(Re.arguments)?Re.arguments:[],je=Ki(Me[0]);if(!je){Ae="dynamic-event-name";return}for(let Ve of je){let We=le.get(Ve)??new Set;We.add(Vf(Me[1])),le.set(Ve,We)}return}let Be=$e?.type==="CallExpression"&&Le==="callee";if(Re.type==="MemberExpression"&&ka(Re,k)&&!Be){Ae="passed-on";return}if(Re.type!=="Identifier"||Re.name!==fe)return;if(Be)return;if(!("name"in k)&&$e?.type==="MemberExpression"&&Le==="object")return;if($e?.type==="MemberExpression"&&Le==="property"&&!$e.computed)return;if($e?.type==="Property"&&Le==="key"&&!$e.computed)return;Ae="passed-on"}),Ae)return{candidate:W,failureReason:Ae};let De=Array.from(le,([Re,$e])=>{let Le=Array.from($e);return{name:Re,detail:Le.includes("any")?"any":Le.join(" | ")}});return{candidate:W,events:De}}function Pa(s,k){let W=s.members?`"${s.calleeText}"`:s.importedName==="default"?"the default export":`"${s.importedName}"`;switch(k){case"module-not-found":return`"${s.importSource}" isn't a local module sveld can read`;case"not-a-function":return`${W} isn't a function declared in "${s.importSource}"`;case"parameter-not-found":return`no parameter of ${W} receives it`;case"dynamic-event-name":return"an event name isn't a string literal";case"passed-on":return`${W} passes it on`}}class A extends Error{constructor(s){super(`sveld's template parser doesn't support ${s} yet.`);this.name="TemplateParseNotImplementedError"}}function N(s){return{failFast:s?.failFast,resolveTypes:s?.resolveTypes===!0,documentExports:s?.documentExports===!0,cache:s?.cache,checkExamples:s?.checkExamples==="syntax"?"syntax":s?.checkExamples===!0,dryRun:s?.dryRun===!0,diagnostics:s?.diagnostics,typesTypeNames:s?.typesOptions?.typeNames,typesInline:s?.typesOptions?.inline}}var Oa=/-/g,Jf=/[^A-Za-z0-9_$]/g,Yf=/^[0-9]/;function $a(s){let k=s.replace(Jf,""),W=Yf.test(k)?`_${k}`:k;if(W!==s)console.warn(`Warning: "${s}" is not a valid identifier; using "${W}" instead.`);return W}function La(s,k=[],W=new Set,H){let le;try{le=H??Hf(s)}catch{return k}if(W.has(le))return k;W.add(le);let fe=nr(s);if(fe===null)return k;let Ae=fe.entries;for(let De of Ae){if(De.name.startsWith("."))continue;let Re=Aa(s,De.name),$e=De.isSymbolicLink(),Le=$e?Ra(Re,{throwIfNoEntry:!1}):De;if(!Le)continue;if(Le.isDirectory())La(Re,k,W,$e?void 0:Aa(le,De.name));else if(Le.isFile()&&De.name.endsWith(".svelte"))k.push(Re)}return k}function Qf(s){return La(s).map((k)=>{let W=$a(Kf(k,".svelte").replace(Oa,"")),H=zt(t(`./${qi(s,k)}`));return{moduleName:W,source:H}}).sort((k,W)=>c(k.source,W.source))}function Zf(s){return!zn(s)}function ed(s,k){let W=s.endsWith("/")?s:`${s}/`;return k.startsWith(W)}function Ir(s,k){return{seenPaths:new Set(s.map(([,W])=>k(W.source))),seenModuleNamePaths:new Map(s.map(([W,H])=>[W,k(H.source)])),warnedModuleNames:new Set}}function zi(s,k,W,H,le){for(let{moduleName:fe,source:Ae}of Qf(s)){let De=H(Ae),Re=k[fe];if(Re&&Zf(Re.source)&&ed(Re.source,Ae)){le.seenPaths.delete(H(Re.source)),Re.source=Ae,le.seenPaths.add(De),le.seenModuleNamePaths.set(fe,De);continue}if(le.seenPaths.has(De))continue;le.seenPaths.add(De);let $e=le.seenModuleNamePaths.get(fe);if($e===void 0)le.seenModuleNamePaths.set(fe,De);else if($e!==De&&!le.warnedModuleNames.has(fe))le.warnedModuleNames.add(fe),console.warn(`Warning: multiple components named "${fe}" found (${t(qi(s,$e))} and ${t(qi(s,De))}). Both are included in TypeScript definitions, but only one can be the named export.`);W.push([fe,{source:Ae,default:!1}])}}function Or(s,k,W=!1){tr();let H=Da(s).isFile(),le=H?Ia(s):s,fe=kn(le),Ae=new Map,De=(Le)=>{let Be=Ae.get(Le);if(Be===void 0)Be=zf(Le)?kn(Le):kn(fe,Le),Ae.set(Le,Be);return Be},Re={};if(H){let Le=Gf(s,"utf-8");try{Re=Rr(Le,fe,new Set([kn(s)]))}catch(Be){if(!W)throw Be;let Fe=Be instanceof Error?Be.message:String(Be);console.warn(`Warning: Failed to parse component exports from ${s}: ${Fe}`)}}let $e=Object.entries(Re);if(k){let Le=Ir($e,De);if(zi(fe,Re,$e,De,Le),!H)Re=Object.fromEntries($e.map(([Be,Fe])=>[Be,{...Fe,default:!0}]))}return{exports:Re,allComponentEntries:$e,rootDir:fe,resolveComponentFilePath:De}}async function $r(s){let k=await Promise.all(Array.from(s).map(async(W)=>{try{let H=await Uf(W,"utf-8");return{path:W,content:H}}catch(H){return console.warn(`Warning: Failed to read file ${W}:`,H),{path:W,content:null}}}));return new Map(k.map(({path:W,content:H})=>[W,H]))}function rn([s,k],W,H,le,fe={}){let Ae=k.source,De=s;if(W.length===1&&s==="default")De=$a(Xf(Ae).name.replace(Oa,""));if(zn(Ae)){let Re=le(Ae),$e=H.get(Re);if($e===null||$e===void 0)return null;let Le=t(Ae),Be=fe.memo?.get(Re),Fe=fe.hashes?.get(Re),Me=Be===void 0?Fe===void 0?null:fe.cache?.get(Re,Fe):null,je;if(Be!==void 0)je=Be;else if(Me)je=Me;else{let Ve=new(Wt()).ComponentParser;try{je=Ve.parseSvelteComponent($e,{moduleName:De,filePath:Le})}catch(We){if(fe.failFast)throw We;let He=We instanceof Error?We.message:String(We),qe=We instanceof Error?We.stack:void 0;return fe.onParseError?.({filePath:Le,moduleName:De,message:He,stack:qe}),null}if(Fe!==void 0)fe.cache?.set(Re,Fe,je)}return fe.memo?.set(Re,je),{moduleName:De,filePath:Le,...je}}return null}function Xi(s,k){let W=new Set;for(let H of s)for(let[,le]of H)if(zn(le.source))W.add(k(le.source));return W}function Lr(s){if(s.length===0)return;console.error(`sveld: failed to parse ${s.length} component(s):`);for(let{filePath:k,message:W}of s)console.error(` - ${k}: ${W}`)}async function I(s,k,W={}){let H=W.documentExports===!0,{exports:le,allComponentEntries:fe,rootDir:Ae,resolveComponentFilePath:De}=Or(s,k,H),Re=[],$e=H&&Da(s).isFile()?await vr(kn(s),{diagnostics:Re}):[],Le=Object.entries(le),Be=Xi([Le,fe],De),Fe=await $r(Be),Me=new Map,je=new Map,Ve=W.cache===!1?void 0:new vi(bo(Ae,W.cache??!0)),We=Ve?new Map:void 0,He=new Set,qe=new Map;if(Ve)for(let Qe of Be){let Ye=Fe.get(Qe);if(Ye===null||Ye===void 0)continue;let et=yr(Ye);if(qe.set(Qe,et),!Ve.has(Qe,et))He.add(Qe)}if(Be.size>0&&(!Ve||He.size>0))await Xt();let Ge=new Map,ze=new Map,Ze={failFast:W.failFast===!0,onParseError:(Qe)=>Ge.set(Qe.filePath,Qe),cache:Ve,hashes:qe,memo:ze};for(let Qe of Le){let Ye=rn(Qe,Le,Fe,De,Ze);if(Ye)Me.set(Ye.moduleName,Ye)}for(let Qe of fe){let Ye=rn(Qe,fe,Fe,De,Ze);if(Ye)je.set(Ye.filePath,Ye),We?.set(Ye.filePath,De(Qe[1].source))}if(Ve&&He.size>0){let Qe=Rn(je,De),Ye=hr(He,Qe);for(let et of Ye){if(He.has(et))continue;Ve.invalidate(et),ze.delete(et)}for(let et of Le){let ct=De(et[1].source);if(!Ye.has(ct)||He.has(ct))continue;let pt=rn(et,Le,Fe,De,Ze);if(pt)Me.set(pt.moduleName,pt)}for(let et of fe){let ct=De(et[1].source);if(!Ye.has(ct)||He.has(ct))continue;let pt=rn(et,fe,Fe,De,Ze);if(pt)je.set(pt.filePath,pt),We?.set(pt.filePath,ct)}}let st=Array.from(Ge.values());if(Lr(st),!W.dryRun)Ve?.save();let dt=W.resolveTypes?sd(Me):[],mt=W.checkExamples?ad(je):[],at=W.checkExamples===!0?Na(mt,"compile"):[],bt=W.checkExamples?Na(mt,"syntax"):[];if(bt.length>0)await cd(bt);let jt=W.typesInline?await Qi():void 0,Tt=W.typesInline==="all"&&jt?jt.collectBareImportOverlay(je,De):new Map,Lt,Ut;if(dt.length>0||at.length>0||Tt.size>0){let{TypeResolver:Qe}=await import("./chunk-yp6p39jn.js"),Ye=await Qe.create(Ae);if(!Ye.ok){let ct=[dt.length>0?"resolveTypes":null,at.length>0?"checkExamples":null,Tt.size>0?'typesOptions.inline: "all"':null].filter((pt)=>pt!==null).join(" and ");throw Error(`sveld: \`${ct}\` ${Ye.message}.`)}let et=Ye.resolver;try{if(dt.length>0)await od(dt,et,De);if(at.length>0)await pd(at,et,De);if(Tt.size>0)Lt=await et.openBareTypeSession(Tt),Ut=et;else await et.dispose()}catch(ct){throw await et.dispose(),ct}}let _n=await Ji(je.values(),De);Yi(Me,je);let nt=We?new Map:void 0;if(We&&nt){let Qe=[..._n.keys(),...dt.map(({component:Ye})=>Ye.filePath)];for(let Ye of Qe){let et=We.get(Ye);if(et===void 0)continue;We.delete(Ye),nt.set(Ye,et)}}es(je,De,W.typesTypeNames),Zi(je.values(),W.typesTypeNames);let lt;try{lt=jt&&(W.typesInline==="local"||W.typesInline==="all")?await jt.inlineLocalTypeImports(je,De,W.typesTypeNames,Lt):void 0}finally{if(Lt)await Lt.dispose();if(Ut)await Ut.dispose()}let gt=As(qn([...Array.from(je.values()).flatMap((Qe)=>Qe.diagnostics??[]),...Re]),W.diagnostics?.ignore);return{exports:le,entryExports:$e,components:Me,allComponentsForTypes:je,errors:st,diagnostics:gt,cache:Ve,resolvedPathByFilePath:We,crossFileResolvedPathByFilePath:nt,inlinedTypesByFilePath:lt}}async function Ji(s,k){let W=Array.from(s,(fe)=>{let Ae=T(fe);return{component:fe,callDefaults:Ae?.pendingCallDefaultCandidates?.filter((De)=>De.importSource!==void 0)??[],constDefaults:Ae?.pendingConstDefaultCandidates??[],contextKeys:Ae?.pendingContextKeyCandidates??[],dispatchEscapes:Ae?.pendingDispatchEscapeCandidates??[],deferredEventNoSource:Ae?.deferredEventNoSourceDiagnostics??[],untypedEventNames:Ae?.untypedJsDocEventNames??[]}}).filter((fe)=>fe.callDefaults.length>0||fe.constDefaults.length>0||fe.contextKeys.length>0||fe.dispatchEscapes.length>0),H=new Map;if(W.length===0)return H;await Xt();let le=new Map;for(let{component:fe,callDefaults:Ae,constDefaults:De,contextKeys:Re,dispatchEscapes:$e,deferredEventNoSource:Le,untypedEventNames:Be}of W){let Fe=Ti(le),Me=k(fe.filePath);if(Ae.length>0)td(fe,va(Me,Ae,Fe));if(De.length>0)nd(fe,Ea(Me,De,Fe));if(Re.length>0)rd(fe,ba(Me,Re,Fe));if($e.length>0)id(fe,wa(Me,$e,Fe),Le,Be);H.set(fe.filePath,Array.from(Fe.cache.keys()))}return H}function td(s,k){for(let{candidate:W,type:H,failureReason:le}of k){let fe=Ma(s,W);if(fe?.typeSource!=="unknown")continue;if(H){wn(fe,"type",H),wn(fe,"typeSource","typescript"),Fa(s,W);continue}if(W.location==="props"&&le){let Ae=s.diagnostics?.find((De)=>De.kind==="prop-unknown-type"&&De.name===W.propName);if(Ae)Ae.message=Ca(W,le)}}}function nd(s,k){for(let{candidate:W,literal:H,declaredType:le}of k){if(!H)continue;let fe=Ma(s,W);if(!fe)continue;if(wn(fe,"value",H.raw),wn(fe,"defaultValue",{raw:H.raw,kind:"literal",value:H.value}),fe.typeSource!=="unknown")continue;wn(fe,"type",le?.type??H.type),wn(fe,"typeSource",le?.source??"default"),Fa(s,W)}}function wn(s,k,W){if(s[k]===void 0)delete s[k];s[k]=W}function Ma(s,k){return(k.location==="props"?s.props:s.moduleExports).find((H)=>H.name===k.propName)}function Fa(s,k){if(k.location!=="props")return;s.diagnostics=(s.diagnostics??[]).filter((W)=>!(W.kind==="prop-unknown-type"&&W.name===k.propName))}function rd(s,k){for(let{candidate:W,key:H}of k){if(!H){let De=re(W);s.diagnostics=[...s.diagnostics??[],i({component:s.filePath,kind:"context-key-unresolved",name:De,message:`setContext key \`${De}\` from "${W.importSource}" isn't an \`export const\` string or Symbol() sveld can read; the context is skipped.`,...W.source?{source:W.source}:{}})];continue}let le=[...s.contexts??[]],fe=le.findIndex((De)=>De.key===H);if(fe!==-1){let De=le[fe],Re=Ta(De.source,W.source),$e=Re?De.source:W.source;if(s.diagnostics=[...s.diagnostics??[],i({component:s.filePath,kind:"context-duplicate-key",name:H,message:`setContext("${H}", ...) was called more than once; only the first call's shape is used.`,...$e?{source:$e}:{}})],!Re)continue;le.splice(fe,1)}let Ae=le.findIndex((De)=>Ta(De.source,W.source));le.splice(Ae===-1?le.length:Ae,0,{key:H,typeName:j(H),...W.type===void 0?{}:{type:W.type},description:W.description,properties:W.properties,...W.hasUnresolvedSpread?{hasUnresolvedSpread:!0}:{},...W.internal?{internal:!0}:{},source:W.source}),s.contexts=le}}function Ta(s,k){if(!s||!k)return!1;let{line:W,column:H}=s.start;return W>k.start.line||W===k.start.line&&H>k.start.column}function id(s,k,W,H){let le=new Map,fe=[...s.diagnostics??[]],Ae=!0;for(let{candidate:Me,events:je,failureReason:Ve}of k){if(Ve){Ae=!1,fe.push(i({component:s.filePath,kind:"dispatch-escapes",name:Me.dispatcherName,message:`\`${Me.dispatcherName}\` is passed to \`${Me.calleeText}\`, but sveld couldn't read the events it dispatches: ${Pa(Me,Ve)}. Document them with @event tags.`,...Me.source?{source:Me.source}:{},...Me.ignored?{ignored:!0}:{}}));continue}for(let We of je??[]){if(le.has(We.name))continue;le.set(We.name,{type:"dispatched",name:We.name,detail:We.detail,...Me.source?{source:Me.source}:{}})}}if(Ae){for(let Me of W)if(!le.has(Me.name))fe.push(Me)}if(s.diagnostics=fe,le.size===0)return;let De=new Map,Re=new Set;for(let Me of s.events)if(Me.type==="dispatched")Re.add(Me.name);else if(!De.has(Me.name))De.set(Me.name,Me);let $e=new Set(H),Le=new Map,Be=[];for(let Me of le.values()){if(Re.has(Me.name)){if($e.has(Me.name)&&Me.detail!==void 0)Le.set(Me.name,Me.detail);continue}let je=De.get(Me.name);if(!je){Be.push(Me);continue}let Ve=Me.source??je.source;Be.push({type:"dispatched",name:Me.name,detail:je.detail??Me.detail,...je.description?{description:je.description}:{},...je.deprecated===void 0?{}:{deprecated:je.deprecated},...je.tags?{tags:je.tags}:{},...je.internal?{internal:!0}:{},...Ve?{source:Ve}:{}})}if(Be.length===0&&Le.size===0)return;let Fe=new Set(Be.map((Me)=>Me.name));s.events=[...s.events.filter((Me)=>Me.type==="dispatched"||!Fe.has(Me.name)).map((Me)=>{let je=Me.type==="dispatched"?Le.get(Me.name):void 0;return je===void 0?Me:{...Me,detail:je}}),...Be].sort(ie)}function Yi(s,k){for(let W of s.values()){let H=k.get(W.filePath);if(!H||H===W)continue;W.contexts=H.contexts,W.events=H.events,W.diagnostics=H.diagnostics}}function sd(s){let k=[];for(let W of s.values()){let H=T(W);if(!H?.canonicalPropsType||W.props.length>0)continue;k.push({component:W,metadata:H})}return k}async function od(s,k,W){let H=await k.expandAll(s.map(({component:le,metadata:fe})=>({moduleName:le.moduleName,metadata:fe,filePath:W(le.filePath)})));for(let{component:le}of s){let fe=H.get(W(le.filePath));if(fe)Ps(le,fe)}}function ad(s){let k=[];for(let W of s.values()){let H=xo(W);if(H.length===0)continue;k.push({component:W,sources:H})}return k}function Na(s,k){let W=[];for(let{component:H,sources:le}of s){let fe=le.filter((Ae)=>Ae.kind===k);if(fe.length===0)continue;W.push({component:H,sources:fe})}return W}async function Qi(){return await Xt(),import("./chunk-fz6nj0w3.js")}async function cd(s){let{parseSvelte:k}=await Xt();for(let{component:W,sources:H}of s){let le=W.diagnostics??[];for(let fe of H)try{k(fe.code)}catch(Ae){if(Ae instanceof A)continue;le.push(i({component:W.filePath,kind:"example-syntax-error",name:fe.name,message:Ae instanceof Error?Ae.message:String(Ae),...fe.source?{source:fe.source}:{}}))}W.diagnostics=le}}async function pd(s,k,W){let H=await k.checkExamples(s.map(({component:le,sources:fe})=>({moduleName:le.moduleName,filePath:W(le.filePath),sources:fe})));for(let{component:le,sources:fe}of s){let Ae=H.get(W(le.filePath));if(!Ae||Ae.length===0)continue;let De=new Map(fe.map(($e)=>[$e.id,$e.source])),Re=le.diagnostics??[];for(let $e of Ae){let Le=De.get($e.id);Re.push(i({component:le.filePath,kind:"example-compile-error",name:$e.name,message:$e.message,...Le?{source:Le}:{}}))}le.diagnostics=Re}}var ud=[".ts",".tsx",".d.ts",".svelte"];function ld(s){let k=s.trim();if(k.length<2)return;let W=k[0],H=k[k.length-1];if((W==='"'||W==="'"||W==="`")&&W===H)return k.slice(1,-1);return}function fd(s,k){let W=kn(Ia(s),k);if(_a(W)&&Ra(W).isFile())return W;if(qf(k)!=="")return;for(let H of ud){let le=`${W}${H}`;if(_a(le))return le}return}function Zi(s,k){for(let W of s){let H=W.moduleExports.filter((Ae)=>Ae.kind==="re-export");if(H.length===0)continue;let le=new Set([S(W.moduleName,k),_(W.moduleName,k)]),fe=W.diagnostics??[];for(let Ae of H){if(!le.has(Ae.name))continue;fe.push(i({component:W.filePath,kind:"module-export-conflict",name:Ae.name,message:`Re-export "${Ae.name}" has the same name as the generated "${Ae.name}" type; the .d.ts won't type-check if "${Ae.reExport?.from}" exports a type by that name.`,source:Ae.source}))}W.diagnostics=fe}}function es(s,k,W,H=s.values()){let le=new Map(Array.from(s.values()).map((fe)=>[k(fe.filePath),fe]));for(let fe of H){let Ae=fe.extends;if(!Ae)continue;let De=ld(Ae.import);if(De===void 0||!De.startsWith(".")&&!De.startsWith("/"))continue;let Re=k(fe.filePath),$e=fd(Re,De),Le=fe.diagnostics??[];if($e===void 0){Le.push(i({component:fe.filePath,kind:"extend-props-target-missing",name:Ae.interface,message:`@extends/@extendProps target "${De}" was not found on disk.`})),fe.diagnostics=Le;continue}let Be=le.get($e);if(!Be)continue;let Fe=S(Be.moduleName,W);if(Ae.interface!==Fe){Le.push(i({component:fe.filePath,kind:"extend-props-target-missing",name:Ae.interface,message:`@extends/@extendProps names "${Ae.interface}", but "${De}" generates "${Fe}".`})),fe.diagnostics=Le;continue}for(let Me of fe.props){let je=Be.props.find((Ve)=>Ve.name===Me.name);if(je&&je.type!==Me.type)Le.push(i({component:fe.filePath,kind:"extend-props-override",name:Me.name,message:`Own prop "${Me.name}" (${Me.type}) overrides "${Fe}"'s "${Me.name}" (${je.type}).`}))}fe.diagnostics=Le}}import{existsSync as Ba,readFileSync as dd}from"node:fs";import{join as ja}from"node:path";function F(s){if(s){let W=ja(process.cwd(),s);if(Ba(W))return Dn(s);return console.error(`Invalid entry point: ${W}. Pass a valid --entry (or "entry" option), or unset it and`),console.error('set the "svelte" field in your package.json instead.'),null}let k=ja(process.cwd(),"package.json");if(!Ba(k))return console.error("Could not locate a package.json file."),console.error(`Specify an entry point with --entry (or the "entry" option) instead.
197
+ `),null;try{let W=rr(JSON.parse(dd(k,"utf-8")));if(W.svelte?.trim())return Dn(W.svelte);return console.error(`Could not determine an entry point.
198
+ `),console.error(`Specify an entry point to your Svelte code in the "svelte" field of your package.json, or pass --entry (or the "entry" option).
199
+ `),null}catch(W){throw console.error("Error reading package.json:",W),W}}import{lstatSync as hd}from"node:fs";import{resolve as ts}from"node:path";function Va(s,k,W){let H=s.get(k);if(!H)H=new Set,s.set(k,H);H.add(W)}async function Wa(s,k,W=!1,H,le){let fe=hd(s).isFile(),Ae=fe?ts(s):null,De=Or(s,k,W),{rootDir:Re,exports:$e,allComponentEntries:Le,resolveComponentFilePath:Be}=De,Fe;if(H==="all"){let{TypeResolver:nt}=await import("./chunk-yp6p39jn.js"),lt=await nt.create(Re);if(!lt.ok)throw Error(`sveld: \`typesOptions.inline: "all"\` ${lt.message}.`);Fe=lt.resolver}let Me=[],je=async()=>(Me=[],W&&fe?vr(ts(s),{diagnostics:Me}):[]),Ve=await je(),We=Object.entries($e),He=Ir(Le,Be),qe=new Map,Ge=new Map;await Xt();let ze=new Map,Ze={onParseError:(nt)=>ze.set(nt.filePath,nt),memo:new Map},st=new Map,dt=async(nt)=>{let lt=new Set(nt.map((Qe)=>Be(Qe.filePath)));for(let Qe of st.values())for(let Ye of lt)Qe.delete(Ye);let gt=await Ji(nt,Be);for(let[Qe,Ye]of gt){let et=Be(Qe);for(let ct of Ye)Va(st,ct,et)}es(Ge,Be,le,nt),Zi(nt,le),Yi(qe,Ge)},mt=new Map,at=new Map,bt=async(nt)=>{if(H!=="local"&&H!=="all")return;let{bareOverlayVirtualFilePath:lt,collectBareImportOverlay:gt,inlineLocalTypeImports:Qe}=await Qi();for(let ct of nt.values()){mt.delete(ct.filePath);for(let pt of at.values())pt.delete(ct.filePath)}let Ye=new Map;if(H==="all"&&Fe)Fe.forgetOverlayFiles(Array.from(nt.values(),(ct)=>lt(Be(ct.filePath),ct.moduleName))),Ye=gt(nt,Be);let et;try{if(Fe&&Ye.size>0)et=await Fe.openBareTypeSession(Ye);let ct=await Qe(nt,Be,le,et);for(let[pt,Kt]of ct){mt.set(pt,Kt);for(let qt of Kt.dependencies)Va(at,qt,pt)}}finally{if(et)await et.dispose()}},jt=()=>{for(let nt of mt.keys())if(!Ge.has(nt))mt.delete(nt)},Tt=()=>({exports:$e,entryExports:Ve,components:qe,allComponentsForTypes:Ge,errors:Array.from(ze.values()),diagnostics:qn([...Array.from(Ge.values()).flatMap((nt)=>nt.diagnostics??[]),...Me]),inlinedTypesByFilePath:H==="local"||H==="all"?mt:void 0});{let nt=Xi([We,Le],Be),lt=await $r(nt);for(let gt of We){let Qe=rn(gt,We,lt,Be,Ze);if(Qe)qe.set(Qe.moduleName,Qe)}for(let gt of Le){let Qe=rn(gt,Le,lt,Be,Ze);if(Qe)Ge.set(Qe.filePath,Qe)}await dt(Array.from(Ge.values())),await bt(Ge),Lr(Array.from(ze.values()))}let Lt=Rn(Ge,Be),Ut=(nt,lt,gt,Qe,Ye)=>{let et=new Set;for(let ct of gt){let pt=Be(ct[1].source);if(!Qe.has(pt))continue;let Kt=rn(ct,gt,Ye,Be,Ze);if(Kt)nt.set(lt(Kt),Kt),et.add(pt);else for(let[qt,Kn]of nt)if(Be(Kn.filePath)===pt)nt.delete(qt)}return et};return{get result(){return Promise.resolve(Tt())},update:async(nt)=>{let lt=nt.map((ot)=>ts(ot));if(tr(),lt.length===0)return{result:Tt(),reparsed:[]};let gt=new Set;for(let ot of lt){let ft=at.get(ot);if(ft)for(let Mt of ft)gt.add(Mt)}let Qe=Ae!==null&&lt.includes(Ae),Ye=[];if(Qe){let ot=Or(s,k,W),ft=new Set(Object.keys($e)),Mt=new Set(Object.keys(ot.exports));for(let sn of ft)if(!Mt.has(sn))qe.delete(sn);for(let sn of Mt){let qr=ot.resolveComponentFilePath(ot.exports[sn].source);if(!ft.has(sn))Ye.push(qr);else if(Be($e[sn].source)!==qr)qe.delete(sn),Ye.push(qr)}$e=ot.exports,Le=ot.allComponentEntries,Be=ot.resolveComponentFilePath,We=Object.entries($e),He=Ir(Le,Be),Ve=await je()}if(k)zi(Re,$e,Le,Be,He);if(Qe){let ot=new Set([...We,...Le].map(([,ft])=>Be(ft.source)));for(let[ft,Mt]of Ge)if(!ot.has(Be(Mt.filePath)))Ge.delete(ft);for(let[ft,Mt]of ze)if(!ot.has(Be(Mt.filePath)))ze.delete(ft);jt()}let et=lt.filter((ot)=>Vt.test(ot)||Lt.has(ot)),ct=lt.flatMap((ot)=>Array.from(st.get(ot)??[]));if(et.length===0&&Ye.length===0&&ct.length===0){if(gt.size>0){let ot=new Map;for(let[ft,Mt]of Ge)if(gt.has(Mt.filePath))ot.set(ft,Mt);await bt(ot)}return{result:Tt(),reparsed:[]}}let pt=hr([...et,...Ye,...ct],Lt);for(let[ot,ft]of ze)if(pt.has(Be(ft.filePath)))ze.delete(ot);let Kt=await $r(pt);Ze.memo=new Map;let qt=new Set;for(let ot of Ut(qe,(ft)=>ft.moduleName,We,pt,Kt))qt.add(ot);for(let ot of Ut(Ge,(ft)=>ft.filePath,Le,pt,Kt))qt.add(ot);Lt=Rn(Ge,Be),await dt(Array.from(Ge.values()).filter((ot)=>qt.has(Be(ot.filePath))));let Kn=new Map;for(let[ot,ft]of Ge)if(qt.has(Be(ft.filePath))||gt.has(ft.filePath))Kn.set(ot,ft);await bt(Kn),jt();let ks=Tt();return Lr(ks.errors),{result:ks,reparsed:Array.from(qt)}}}}import Nd from"node:path";import{mkdir as md,readFile as gd,writeFile as yd}from"node:fs/promises";import{parse as xd}from"node:path";class Ct{dryRun;ensuredDirs=new Set;constructor(s){this.dryRun=s?.dryRun===!0}async write(s,k){if(this.dryRun)return console.log(`would write "${t(s)}"`),!0;try{if(await gd(s,"utf-8")===k)return!1}catch{}let W=xd(s).dir;if(!this.ensuredDirs.has(W))await md(W,{recursive:!0}),this.ensuredDirs.add(W);return await yd(s,k),!0}}var vd=/^=>\s*/;function Cd(s){let k=s.trim();if(!k.startsWith("("))return{parameters:[],returnTypeText:k||"any"};let W=0,H=-1;for(let De=0;De<k.length;De++)if(k[De]==="(")W++;else if(k[De]===")"){if(W--,W===0){H=De;break}}if(H===-1)return{parameters:[],returnTypeText:"any"};let le=k.slice(1,H).trim(),fe=k.slice(H+1).trim().replace(vd,"");return{parameters:le===""?[]:m(le).map((De)=>{let Re=De.trim(),$e=Re.startsWith("..."),Le=$e?Re.slice(3):Re,Be=Le.indexOf(":"),Fe=(Be===-1?Le:Le.slice(0,Be)).trim(),Me=Be===-1?void 0:Le.slice(Be+1).trim(),je=Fe.endsWith("?"),Ve={name:je?Fe.slice(0,-1):Fe};if(Me)Ve.type={text:Me};if(je)Ve.optional=!0;if($e)Ve.rest=!0;return Ve}),returnTypeText:fe||"any"}}function Ed(s){if(s.params!==void 0||s.returnType!==void 0)return{parameters:(s.params??[]).map((W)=>{let H={name:W.name};if(W.type)H.type={text:W.type};if(W.optional)H.optional=!0;return H}),returnTypeText:s.returnType??"any"};return s.type?Cd(s.type):{parameters:[],returnTypeText:"any"}}function bd(s){return s.map((k)=>{if(k.isFunctionDeclaration){let{parameters:H,returnTypeText:le}=Ed(k),fe={kind:"method",name:k.name,static:!1};if(H.length>0)fe.parameters=H;if(fe.return={type:{text:le}},k.description)fe.description=k.description;if(k.deprecated!==void 0)fe.deprecated=k.deprecated;return fe}let W={kind:"field",name:k.name};if(k.type)W.type={text:k.type};if(k.value!==void 0)W.default=k.value;if(k.description)W.description=k.description;if(k.deprecated!==void 0)W.deprecated=k.deprecated;if(k.kind==="const")W.readonly=!0;return W})}function Sd(s){let k=s.customElement?.props,W=new Map,H=[];for(let le of s.props){if(le.isFunctionDeclaration)continue;let fe=k?.[le.name];if(fe?.attribute===!1)continue;let Ae=fe?.attribute||le.name.toLowerCase(),De=W.get(Ae);if(De!==void 0){console.warn(`sveld: props "${De}" and "${le.name}" of component "${s.moduleName}" both map to the custom-element attribute "${Ae}"; only "${De}" is included.`);continue}W.set(Ae,le.name);let $e=fe?.type==="Array"||fe?.type==="Object"?[le.description,"Serialized to/from JSON for the attribute."].filter(Boolean).join(" "):le.description,Le={name:Ae,fieldName:le.name};if(le.type)Le.type={text:le.type};if(le.value!==void 0)Le.default=le.value;if($e)Le.description=$e;if(fe?.reflect)Le.reflects=!0;H.push(Le)}return H}function kd(s){if(!s||s.length===0)return;return s.map((k)=>{let W={name:k.name};if(k.description)W.description=k.description;return W})}function wd(s){if(!s||s.length===0)return;return s.map((k)=>{let W={name:k.name};if(k.type)W.type={text:k.type};if(k.default!==void 0)W.default=k.default;if(k.description)W.description=k.description;return W})}function Pd(s){return s.filter((k)=>k.type==="dispatched").map((k)=>{let W={name:k.name,type:{text:Tn(k.detail??"unknown")}};if(k.description)W.description=k.description;if(k.deprecated!==void 0)W.deprecated=k.deprecated;return W})}function _d(s){return s.map((k)=>{let W={name:k.default?"":k.name??""};if(k.description)W.description=k.description;if(k.deprecated!==void 0)W.deprecated=k.deprecated;return W})}function Ad(s){let k=kd(s.cssParts),W=wd(s.cssProperties),H=bd(s.props),le=Sd(s),fe=Pd(s.events),Ae=_d(s.slots),De=s.moduleName,Re=s.componentComment?{kind:"class",name:De,description:s.componentComment,members:H,attributes:le,events:fe,slots:Ae}:{kind:"class",name:De,members:H,attributes:le,events:fe,slots:Ae};if(k)Re.cssParts=k;if(W)Re.cssProperties=W;if(s.customElementTag)Re.tagName=s.customElementTag,Re.customElement=!0;return Re}function Td(s,k){let W=[{kind:"js",name:s.moduleName,declaration:{name:s.moduleName,module:k}}];if(s.customElementTag)W.push({kind:"custom-element-definition",name:s.customElementTag,declaration:{name:s.moduleName,module:k}});return W}function Ga(s,k={}){let W=o(s),H=k.resolveModulePath??((fe)=>fe.filePath);return{schemaVersion:"1.0.0",modules:W.components.map((fe)=>{let Ae=H(fe);return{kind:"javascript-module",path:Ae,declarations:[Ad(fe)],exports:Td(fe,Ae)}})}}function ns(s,k){let W=Ga(s,{resolveModulePath:(H)=>Xn(H.filePath,k.inputDir)});return on(W)}async function rs(s,k){let W=ns(s,k),H=Nd.resolve(k.outFile),fe=await new Ct({dryRun:k.dryRun}).write(H,W);if(!k.dryRun)kt(`${fe?"created":"unchanged"} "${k.outFile}".`)}import ss from"node:path";function Ha(s){let k=new Map;for(let[H,le]of Object.entries(s)){let fe=k.get(le.source)||[];fe.push({id:H,exportee:le}),k.set(le.source,fe)}let W=[];for(let[H,le]of k){let fe=Vt.test(H),Ae=le.some(({id:Fe,exportee:Me})=>Fe!=="default"&&Me.default),De=le.some(({exportee:Fe})=>!Fe.default),Re=fe&&Ae&&De,$e=[],Le=[],Be=[];for(let{id:Fe,exportee:Me}of le){if(Fe==="default"){Le.push(`export { default } from "${H}";`);continue}if(Me.default)if(Me.mixed)Le.push(`export { default as ${Fe} } from "${H}";`),Le.push(`export { default } from "${H}";`);else Be.push(`default as ${Fe}`);else if(fe&&!Re)Be.push(`default as ${Fe}`);else $e.push(Fe)}if(Be.length>0&&$e.length>0)W.push(`export { ${[...Be,...$e].join(", ")} } from "${H}";`);else{if($e.length>0)W.push(`export { ${$e.join(", ")} } from "${H}";`);if(Be.length>0)W.push(`export { ${Be.join(", ")} } from "${H}";`)}W.push(...Le)}return W.join(`
200
+ `)}function Ua(s){return s.filter((k)=>k.names.length>0).map((k)=>`export type { ${k.names.join(", ")} } from "${k.source}";`).join(`
201
+ `)}function Ka(s){return s.replace(Vt,"")}function is(s){return s.replace(Vt,".svelte.d.ts")}function Dd(s){return typeof s==="object"&&s!==null&&!Array.isArray(s)&&"start"in s&&"end"in s}function Vn(s){if(Array.isArray(s))return s.map((k)=>Vn(k));if(s!==null&&typeof s==="object"){let k={};for(let[W,H]of Object.entries(s)){if((W==="source"||W==="componentCommentSource")&&Dd(H))continue;k[W]=Vn(H)}return k}return s}function os(s,k){return s.map((W)=>({...W,filePath:Xn(W.filePath,k)}))}function Rd(s,k,W){if(!k)return`${s.moduleName}.api.json`;if(!W.has(s.moduleName))W.add(s.moduleName),console.warn(`Warning: multiple components named "${s.moduleName}" found. Their JSON files are keyed by source path instead of name to avoid overwriting each other.`);return`${Ka(s.filePath)}.api.json`}async function Id(s,k){let W=o(s),H=os(W.components,k.inputDir);if(k.source===!1)H=Vn(H);let le=new Map;for(let Ae of H)le.set(Ae.moduleName,(le.get(Ae.moduleName)??0)+1);let fe=new Set;await Promise.all(H.map(async(Ae)=>{let De=(le.get(Ae.moduleName)??0)>1,Re=Rd(Ae,De,fe),$e=ss.resolve(ss.join(k.outDir||"",Re)),Be=await new Ct({dryRun:k.dryRun}).write($e,on(Ae));if(!k.dryRun)kt(`${Be?"created":"unchanged"} "${$e}".`)}))}function as(s,k){let W=o(s,{entryExports:k.entryExports}),H={...W,components:os(W.components,k.inputDir)};if(k.source===!1)H=Vn(H);return on(H)}function qa(s,k){let W=o(s,{entryExports:k.entryExports}),H=os(W.components,k.inputDir);if(k.source===!1)H=Vn(H);return`${H.map((le)=>JSON.stringify(le)).join(`
202
+ `)}
203
+ `}async function Od(s,k){let W=as(s,k),H=ss.resolve(k.outFile),fe=await new Ct({dryRun:k.dryRun}).write(H,W);if(!k.dryRun)kt(`${fe?"created":"unchanged"} "${k.outFile}".`)}async function cs(s,k){if(k.outDir)await Id(s,k);else await Od(s,k)}import Ur from"node:path";import{readFileSync as $d}from"node:fs";import{join as Ld}from"node:path";function za(){try{let{name:s,description:k}=rr(JSON.parse($d(Ld(process.cwd(),"package.json"),"utf-8")));return{name:s,description:k}}catch{return{}}}var Xa=/`/g,Ja=/\s+/g,_t="--",Ya=`| Prop name | Required | Kind | Reactive | Binding | Type | Default value | Description |
204
+ | :- | :- | :- | :- | :- | :- | :- | :- |
205
+ `,Mr=`| Slot name | Default | Props | Fallback | Description |
206
+ | :- | :- | :- | :- | :- |
207
+ `,Fr=`| Event name | Type | Detail | Description |
208
+ | :- | :- | :- | :- |
209
+ `,ls=`| Name | Kind | Type | Description |
210
+ | :- | :- | :- | :- |
211
+ `,Md=`| Member | Signature | Description |
212
+ | :- | :- | :- |
213
+ `,Qa=`| Part name | Description |
214
+ | :- | :- |
215
+ `,Za=`| Property name | Type | Default value | Description |
216
+ | :- | :- | :- | :- |
217
+ `,fs=/\|/g,Fd=/</g,Bd=/>/g,hn=/\n/g,jd=/^[A-Za-z_$][\w$]*$/,Vd=/\s*\n\s*/g,Wd=/&(?=#?\w+;)|<(?=[A-Za-z/!?])|[|`*]|\\(?=[!-/:-@[-`{-~])|(?<![A-Za-z0-9])_|_(?![A-Za-z0-9])/g,Gd=/[&<|`*\\_]/;function ds(s){if(!Gd.test(s))return s;return s.replace(Wd,(k)=>k==="&"?"&amp;":k==="<"?"&lt;":k==="_"?"&#95;":`&#${k.charCodeAt(0)};`)}function ec(s){return`<code>${ds(s.includes(`
218
+ `)?s.replace(Vd," "):s)}</code>`}var Hd=/\{@link\s+([^{}\s|]+)(?:\|([^{}]+))?\}/g;function Ud(s){if(!s.includes("{@link"))return s;return s.replace(Hd,(k,W,H)=>`[${H===void 0?W:H.trim()}](${W})`)}function ps(s){return s.includes("```")||s.includes("~~~")}function us(s){return rc(Ud(s))}var Kd=/^([ \t]*)(`{3,}|~{3,})(.*)$/,qd=/^\n/,zd=/\n$/;function tc(s){let k=(fe)=>({kind:"prose",text:us(fe.join(`
219
+ `))});if(!ps(s))return[k([s])];let W=s.split(`
220
+ `),H=[],le=[];for(let fe=0;fe<W.length;fe++){let Ae=Kd.exec(W[fe]),[,De="",Re="",$e=""]=Ae??[];if(!Ae||Re[0]==="`"&&$e.includes("`")){le.push(W[fe]);continue}if(le.push(""),le.length>1)H.push(k(le));let Le=[],Be=new RegExp(`^[ \\t]*${Re[0]}{${Re.length},}[ \\t]*$`);for(fe++;fe<W.length&&!Be.test(W[fe]);fe++){let Fe=W[fe],Me=0;while(Me<De.length&&(Fe[Me]===" "||Fe[Me]==="\t"))Me++;Le.push(Fe.slice(Me))}H.push({kind:"code",block:{fence:Re,info:$e.trim(),code:Le.join(`
221
+ `)}}),le=[""]}if(le.length>1||H.length===0)H.push(k(le));return H}function nc(s,k){let W="";for(let H=0;H<s.length;H++){let le=s[H];if(le.kind==="code"){if(k)k.push(le.block),W+="(code below)";else W+=`<pre><code>${ds(le.block.code).replace(hn,"<br />")}</code></pre>`;continue}let fe=le.text;if(!k){if(s[H-1]?.kind==="code")fe=fe.replace(qd,"");if(s[H+1]?.kind==="code")fe=fe.replace(zd,"")}W+=fe.replace(fs,"&#124;").replace(hn,"<br />")}return W}function Wn(s,k,W,H){let le=[],fe=mn(W,H,le);if(le.length>0)s.push({label:k,blocks:le});return fe}function Gn(s,k){if(s.append("raw",`
222
+ `),k.length===0)return;let W="";for(let{label:H,blocks:le}of k){W+=`Code for \`${H}\`:
223
+
224
+ `;for(let{fence:fe,info:Ae,code:De}of le)W+=`${fe}${Ae}
225
+ ${De}${De?`
226
+ `:""}${fe}
227
+
228
+ `}s.append("raw",W)}function At(s){if(s===void 0)return _t;return ec(s)}function Br(s){if(!s.reExport)return At(s.type);let{from:k,imported:W}=s.reExport,H=W==="*"?"":jd.test(W)?`.${W}`:`[${JSON.stringify(W)}]`;return At(`typeof import(${JSON.stringify(k)})${H}`)}function rc(s){if(!s.includes("<")&&!s.includes(">"))return s;return s.replace(Fd,"&lt;").replace(Bd,"&gt;")}function Hn(s){if(s===void 0)return _t;return ec(s)}function Bt(s,k){if(k===void 0)return s;let W=typeof k==="string"&&k.trim().length>0?`: ${rc(k).replace(hn," ").replace(fs,"&#124;")}`:"";return`<s>${s}</s><br />**Deprecated**${W}`}function jr(s){if(s===void 0||s.trim().length===0)return _t;return nc(tc(s),void 0)}function Vr(s){if(s===void 0||s==="{}")return _t;return At(lr(s).replace(hn," "))}function Wr(s){if(s===void 0)return _t;return`<code>${ds(s).replace(hn,"<br />")}</code>`}function mn(s,k,W){let H=s!==void 0&&s.trim().length>0;if(!(H&&ps(s))&&!k?.some(({body:De})=>De&&ps(De))){let De=H?[us(s)]:[];for(let{name:Re,body:$e}of k??[]){let Le=$e?.trim();De.push(Le?`@${Re} ${us(Le)}`:`@${Re}`)}if(De.length===0)return _t;return De.join(`
229
+ `).replace(fs,"&#124;").replace(hn,"<br />")}let le=[],fe=(De)=>{let Re=le.at(-1);if(Re?.kind==="prose")Re.text+=De;else le.push({kind:"prose",text:De})},Ae=(De,Re)=>{if(le.length>0)fe(`
230
+ `);if(De)fe(De);for(let $e of tc(Re))if($e.kind==="prose")fe($e.text);else le.push($e)};if(H)Ae("",s);for(let{name:De,body:Re}of k??[]){let $e=Re?.trim();Ae($e?`@${De} `:`@${De}`,$e??"")}if(le.length===0)return _t;return nc(le,W)}function Gr(s){if(s===void 0)return _t;return At(s.replace(hn," "))}function Xd(s){let k=[s.extends?`Extends ${At(s.extends)}.`:"",s.implements?.length?`Implements ${s.implements.map((W)=>At(W)).join(", ")}.`:""].filter(Boolean);return k.length>0?k.join(" "):void 0}function Hr(s,k,W){let H=new Set;for(let le of k){if(le.kind!=="class")continue;let fe=Xd(le);if(!le.members?.length&&!fe)continue;let Ae=le.localName??le.name;if(H.has(Ae))continue;if(H.add(Ae),s.append("h4",`\`${Ae}\` members`),fe)s.append("raw",`${fe}
231
+
232
+ `);if(!le.members?.length)continue;s.append("raw",Md);let De=[];for(let Re of le.members){let $e=W?.codeBelow?Wn(De,Re.name,Re.description,Re.tags):mn(Re.description,Re.tags);s.append("raw",`| ${Bt(Re.name,Re.deprecated)} | ${At(li(Re))} | ${$e} |
233
+ `)}Gn(s,De)}}var Jd=/[^\w\- ]+/g,Yd=/\s+/g;function Qd(s,k){let W=s.toLowerCase().replace(Xa,"").replace(Jd,"").replace(Yd,"-"),H=k.get(W)??0;return k.set(W,H+1),H===0?W:`${W}-${H}`}class Pn{sourceParts=[];hasToC=!1;toc=[];get source(){return this.sourceParts.join("")}appendLineBreaks(){return this.sourceParts.push(`
234
+
235
+ `),this}append(s,k){switch(s){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":{let W=Number(s.slice(-1));if(this.sourceParts.push(`${"#".repeat(W)} ${k}`),this.hasToC&&s==="h2")this.toc.push({indent:0,raw:k??""});break}case"quote":this.sourceParts.push(`> ${k}`);break;case"p":this.sourceParts.push(k??"");break;case"divider":this.sourceParts.push("---");break;case"raw":this.sourceParts.push(k??"");break}if(s!=="raw")this.appendLineBreaks();return this}tableOfContents(){return this.sourceParts.push("<!-- __TOC__ -->"),this.hasToC=!0,this.appendLineBreaks(),this}end(){let s=this.sourceParts.join("");if(!this.hasToC)return s;let k="<!-- __TOC__ -->",W=s.indexOf(k);if(W===-1)return s;let H=new Map,le=this.toc.map(({indent:fe,raw:Ae})=>`${" ".repeat(fe)}- [${Ae}](#${Qd(Ae,H)})`).join(`
236
+ `);return s.slice(0,W)+le+s.slice(W+k.length)}}var Zd=`| Name | Type | Default | Required | Description |
237
+ | :- | :- | :- | :- | :- |
238
+ `,eh=/[.!?](?:\s|$)/,th=/\r?\n[ \t]*\r?\n/,nh=/\s+/g;function ic(s,k){if(!s)return k;let W=s.trim().split(th)[0]?.replace(nh," ").trim();if(!W)return k;let H=eh.exec(W);return H?W.slice(0,H.index+1):W}function hs(s,k,W){if(W.length===0)return;s.append("h3",k),s.append("raw",Zd);let H=[];for(let le of W)s.append("raw",`| ${Bt(le.name,le.deprecated)} | ${Br(le)} | ${Hn(le.value)} | ${le.isRequired?"Yes":"No"} | ${Wn(H,le.name,le.description,le.tags)} |
239
+ `);Gn(s,H)}function rh(s,k){if(k.length===0)return;s.append("h3","Events"),s.append("raw",Fr);let W=[];for(let H of k)s.append("raw",`| ${Bt(H.name,H.deprecated)} | ${H.type} | ${Gr(H.detail)} | ${Wn(W,H.name,H.description,H.tags)} |
240
+ `);Gn(s,W)}function ih(s,k,W){if(W.length===0)return;s.append("h3",k),s.append("raw",Mr);let H=[];for(let le of W)s.append("raw",`| ${Bt(le.default?_t:le.name??_t,le.deprecated)} | ${le.default?"Yes":"No"} | ${Vr(le.slot_props)} | ${Wr(le.fallback)} | ${Wn(H,le.default?"default":le.name??"default",le.description,le.tags)} |
241
+ `);Gn(s,H)}function sh(s,k){if(k.typedefs.length===0)return;s.append("h3","Typedefs"),s.append("raw",`\`\`\`ts
242
+ ${vn({typedefs:k.typedefs})}
243
+ \`\`\`
244
+
245
+ `)}function oh(s,k){if(s.append("h2",k.moduleName),k.generics)s.append("p",`Type parameters: ${At(`<${k.generics[1]}>`)}`);if(k.componentComment?.trim())s.append("p",k.componentComment.trim());hs(s,"Props",k.props),hs(s,"Bindings",k.props.filter((W)=>W.reactive)),rh(s,k.events),ih(s,k.syntaxMode==="runes"?"Snippets":"Slots",k.slots),sh(s,k),hs(s,"Module exports",k.moduleExports),Hr(s,k.moduleExports,{codeBelow:!0})}function ah(s,k,W,H){let le=new Pn,fe=H.linkBase??"";if(le.append("h1",k),W)le.append("quote",W);le.append("h2","Components");for(let Ae of s)le.append("raw",`- [${Ae.moduleName}](${fe}/${Ae.moduleName}): ${ic(Ae.componentComment,"Component")}
246
+ `);if(le.append("raw",`
247
+ `),H.entryExports&&H.entryExports.length>0){le.append("h2","Exports");for(let Ae of H.entryExports)le.append("raw",`- \`${Ae.name}\`: ${ic(Ae.description,Ae.kind)}
248
+ `);le.append("raw",`
249
+ `)}return le.end()}function ch(s,k,W){let H=new Pn;if(H.append("h1",k),W)H.append("quote",W);for(let le of s)oh(H,le);return H.end()}function ph(s,k){let W=o(s,{entryExports:k.entryExports}),H=za(),le=k.title??H.name??"Components",fe=k.summary??H.description;return{llmsTxt:ah(W.components,le,fe,k),llmsFullTxt:ch(W.components,le,fe)}}async function ms(s,k){let{llmsTxt:W,llmsFullTxt:H}=ph(s,k),le=new Ct({dryRun:k.dryRun}),fe=t(Ur.join(k.outDir??"","llms.txt")),Ae=t(Ur.join(k.outDir??"","llms-full.txt")),[De,Re]=await Promise.all([le.write(Ur.resolve(fe),W),le.write(Ur.resolve(Ae),H)]);if(!k.dryRun)kt(`${De?"created":"unchanged"} "${fe}".`),kt(`${Re?"created":"unchanged"} "${Ae}".`)}import{join as uc,resolve as ys}from"node:path";function sc(s,k,W){if(s.append("h1","Component Index"),s.append("h2","Components").tableOfContents(),s.append("divider"),W&&W.length>0)ac(s,W);let H=o(k);for(let le of H.components)pc(s,le)}function oc(s,k,W){s.append("h1","Component Index"),s.append("h2","Components");for(let H of k)s.append("raw",`- [${H.moduleName}](./${H.moduleName}.md)
250
+ `);if(s.append("raw",`
251
+ `),s.append("divider"),W&&W.length>0)ac(s,W)}function ac(s,k){s.append("h2","Exports"),s.append("raw",ls);for(let W of k){let H=(W.type??W.value)?.replace(Ja," ").trim();s.append("raw",`| ${Bt(W.name,W.deprecated)} | ${`<code>${W.kind}</code>`} | ${At(H)} | ${jr(W.description)} |
252
+ `)}s.append("raw",`
253
+ `),s.append("divider")}function uh(s){return s.kind==="const"||s.isFunctionDeclaration}function lh(s,k){s.append("h3","Module exports"),s.append("raw",ls);for(let W of k)s.append("raw",`| ${Bt(W.name,W.deprecated)} | ${`<code>${W.kind}</code>`} | ${Br(W)} | ${mn(W.description,W.tags)} |
254
+ `);s.append("raw",`
255
+ `),Hr(s,k)}function gs(s,k,W,H){if(k.length>0)W(),s.append("raw",`
256
+ `);else s.append("p",H??"None.")}function cc(s,k){pc(s,k)}function pc(s,k){if(s.append("h2",`\`${k.moduleName}\``),k.generics)s.append("p",`**Type parameters:** ${At(`<${k.generics[1]}>`)}`);if(k.typedefs.length>0)s.append("h3","Types").append("raw",`\`\`\`ts
257
+ ${vn({typedefs:k.typedefs})}
258
+ \`\`\`
259
+
260
+ `);if(s.append("h3","Props"),gs(s,k.props,()=>{s.append("raw",Ya);let W=(le)=>le.reactive?0:le.constant?2:1,H=k.props.map((le,fe)=>({prop:le,index:fe})).sort((le,fe)=>W(le.prop)-W(fe.prop)||le.index-fe.index).map(({prop:le})=>le);for(let le of H){let fe=uh(le)?"accessor":le.kind;s.append("raw",`| ${Bt(le.name,le.deprecated)} | ${le.isRequired?"Yes":"No"} | ${`<code>${fe}</code>`} | ${le.reactive?"Yes":"No"} | ${le.binding??"--"} | ${At(le.type)} | ${Hn(le.value)} | ${mn(le.description,le.tags)} |
261
+ `)}}),k.moduleExports.length>0)lh(s,k.moduleExports);if(s.append("h3","Slots"),gs(s,k.slots,()=>{s.append("raw",Mr);for(let W of k.slots)s.append("raw",`| ${Bt(W.default?_t:W.name??_t,W.deprecated)} | ${W.default?"Yes":"No"} | ${Vr(W.slot_props)} | ${Wr(W.fallback)} | ${mn(W.description,W.tags)} |
262
+ `)}),s.append("h3","Events"),gs(s,k.events,()=>{s.append("raw",Fr);for(let W of k.events)s.append("raw",`| ${Bt(W.name,W.deprecated)} | ${W.type} | ${Gr(W.detail)} | ${mn(W.description,W.tags)} |
263
+ `)}),k.cssParts&&k.cssParts.length>0){s.append("h3","CSS Parts"),s.append("raw",Qa);for(let W of k.cssParts)s.append("raw",`| ${W.name} | ${jr(W.description)} |
264
+ `);s.append("raw",`
265
+ `)}if(k.cssProperties&&k.cssProperties.length>0){s.append("h3","CSS Custom Properties"),s.append("raw",Za);for(let W of k.cssProperties)s.append("raw",`| ${W.name} | ${At(W.type)} | ${Hn(W.default)} | ${jr(W.description)} |
266
+ `);s.append("raw",`
267
+ `)}}class Kr extends Ct{onAppend;markdownBase;constructor(s){super();this.onAppend=s.onAppend,this.markdownBase=new Pn}get source(){return this.markdownBase.source}get hasToC(){return this.markdownBase.hasToC}get toc(){return this.markdownBase.toc}appendLineBreaks(){return this.markdownBase.appendLineBreaks(),this}append(s,k){return this.markdownBase.append(s,k),this.onAppend?.call(this,s,this),this}tableOfContents(){return this.markdownBase.tableOfContents(),this}end(){return this.markdownBase.end()}}function xs(s,k){return new Kr({onAppend:(W,H)=>{s.onAppend?.call(null,W,H,k)}})}async function fh(s,k){let W=k.outDir,H=o(s,{entryExports:k.entryExports}),le=new Ct({dryRun:k.dryRun}),fe=xs(k,s);oc(fe,H.components,k.entryExports);let Ae=ys(uc(W,"README.md")),De=await le.write(Ae,fe.end());if(!k.dryRun)kt(`${De?"created":"unchanged"} "${Ae}".`);await Promise.all(H.components.map(async(Re)=>{let $e=xs(k,s);cc($e,Re);let Le=ys(uc(W,`${Re.moduleName}.md`)),Be=await le.write(Le,$e.end());if(!k.dryRun)kt(`${Be?"created":"unchanged"} "${Le}".`)}))}function vs(s,k){let W=xs(k,s);return sc(W,s,k.entryExports),W.end()}async function Cs(s,k){if(k.outDir){if(k.write!==!1)await fh(s,k);return}let W=k?.write!==!1,H=vs(s,k);if(W){let le=ys(k.outFile),fe=await new Ct({dryRun:k.dryRun}).write(le,H);if(!k.dryRun)kt(`${fe?"created":"unchanged"} "${k.outFile}".`)}return H}import{join as dh,resolve as hh}from"node:path";function mh(s){let k=new Set;for(let W of s)if(W.extends)k.add(W.extends.interface);return k}function gh(s){return fr(s,fi,!0).props}var yh={props:!0,exports:!0,typedefs:!1,contexts:!1};function xh(s){if(!s)return;return fr(s,yh,!1)}function vh(s,k,W){let H=xh(k.indexTypes);if(!H)return[];let le=di(k),fe=k.format==="component",Ae=new Map,De=new Set,Re=[];for(let[,$e]of Object.entries(k.exports)){if(!$e.default||!Vt.test($e.source))continue;let Le=t($e.source);if(De.has(Le))continue;De.add(Le);let Be=s.components.find((We)=>We.filePath===Le);if(!Be)continue;let Fe=S(Be.moduleName,k.typeNames),Me=W.has(Fe),je=[];if(H.props&&(le.props||Me))je.push(Fe);if(H.exports&&fe&&le.exports)je.push(_(Be.moduleName,k.typeNames));if(H.typedefs&&le.typedefs)for(let We of Be.typedefs)je.push(We.name);if(H.contexts&&le.contexts)for(let We of Be.contexts??[])je.push(We.typeName);let Ve=[];for(let We of je){let He=Ae.get(We);if(He!==void 0){xr(`sveld: index.d.ts skips duplicate type export "${We}" from "${$e.source}" (already exported from "${He}").`);continue}Ae.set(We,$e.source),Ve.push(We)}if(Ve.length>0)Re.push({source:$e.source,names:Ve})}return Re}async function lc(s,k,W){if(!s)return k;try{let H=await s(k,W);if(typeof H!=="string")throw TypeError(`must return a string, got ${typeof H}`);return H}catch(H){let le=H instanceof Error?H.message:String(H);throw Error(`sveld: typesOptions.transform failed for "${W.filePath}": ${le}`,{cause:H})}}function Ch(s,k){return`${s}
268
+ ${uo(k)}`}async function Es(s,k){let W=hh(k.outDir,"index.d.ts"),H=new Ct({dryRun:k.dryRun}),le=o(s),fe=mh(le.components),Ae=Ua(vh(le,k,fe)),De=k.preamble+[Ha(k.exports),Ae].filter((Me)=>Me!=="").join(`
269
+
270
+ `),Re=hi(k),$e=le.components.map(async(Me)=>{let je=is(dh(k.outDir,Me.filePath)),Ve=t(is(Me.filePath)),We=k.resolvedPathByFilePath?.get(Me.filePath),He=We?void 0:k.crossFileResolvedPathByFilePath?.get(Me.filePath),qe=We??He,Ge=k.inlinedTypesByFilePath?.get(Me.filePath),ze=fe.has(S(Me.moduleName,k.typeNames))&&!gh(Re.exportTypes)?{...Re,forceExportProps:!0}:Re,Ze=Ge?{...ze,inlined:Ge}:ze,st=(Ge?.declarations.length??0)>0,dt=Ch(Me.moduleName,Ze),mt=!st&&He?`${dt}
271
+ ${yr(JSON.stringify(Me))}`:dt,at=!st&&qe?k.cache?.getGeneratedText(qe,mt):void 0;if(at===void 0){if(at=mi(Me,Ze),!st&&qe)k.cache?.setGeneratedText(qe,mt,at)}let bt=await lc(k.transform,at,{kind:"component",component:Me,filePath:Ve});return H.write(je,bt)}),Le=(async()=>{let Me=await lc(k.transform,De,{kind:"index",filePath:"index.d.ts"});return H.write(W,`${Me}
272
+ `)})(),Be=(await Promise.all([...$e,Le])).filter(Boolean).length,Fe=$e.length+1;if(!k.dryRun){let Me=Be===0?`unchanged ${Fe}`:`created ${Be} of ${Fe}`;kt(`${Me} TypeScript definitions in "${k.outDir}".`)}}R({name:"json",componentSet:"exported",write:cs});R({name:"markdown",componentSet:"exported",write:Cs});R({name:"types",componentSet:"all",write:Es});R({name:"custom-elements",componentSet:"exported",write:rs});R({name:"llms",componentSet:"exported",write:ms});var fc='sveld: could not resolve a Svelte entry point. Set package.json#svelte, or pass the "entry" option.',Sh=["reportDiagnostics","strict","check","checkLevel","stdout","format","dryRun"],kh=50;function wh(s){let k=Promise.resolve();return()=>{k=k.then(s,s)}}function ve(s){let k=s?.watch===!0,W,H,le=s??{},fe,Ae=null,De,Re=new Set,Le=wh(async()=>{if(Ae==null||H==null||Re.size===0)return;let Fe=Array.from(Re);Re.clear();try{let{result:Me}=await Ae.update(Fe);await L(Me,le,H)}catch(Me){console.error("sveld: failed to regenerate types in watch mode:",Me)}}),Be=(Fe)=>{if(!k||Ae==null||!Ns.test(Fe))return;Re.add(Fe),clearTimeout(De),De=setTimeout(Le,kh)};return{name:"vite-plugin-sveld",apply:k?void 0:"build",enforce:"post",configResolved(Fe){fe=Fe.root},async buildStart(){if(s?.config){let Me=fe??process.cwd(),je=typeof s.config==="string"?await Zr(Eh(s.config)?s.config:bh(Me,s.config)):await J(Me);le=D(je,s)}q(le);let Fe=Sh.filter((Me)=>(Me in le));if(Fe.length>0)console.warn(`sveld: the Vite plugin ignores ${Fe.map((Me)=>`"${Me}"`).join(", ")}; run the sveld CLI or sveld() for them.`);if(V(le.quiet===!0),H=F(le.entry),k&&H!=null)try{Ae=await Wa(H,le.glob===!0,le.documentExports===!0,le.typesOptions?.inline,le.typesOptions?.typeNames),await L(await Ae.result,le,H)}catch(Me){console.error("sveld: failed to generate initial types in watch mode:",Me)}},async generateBundle(){if(k)return;if(H==null)this.error(fc);W=await I(H,le.glob===!0,N(le))},async writeBundle(){if(k)return;if(H==null)this.error(fc);await L(W,le,H),W.cache?.save()},handleHotUpdate(Fe){Be(Fe.file)},watchChange(Fe){Be(Fe)}}}function Un(s,k,W){let H=ue(s);if(!H)throw Error(`sveld: built-in writer "${s}" is not registered.`);return H.write(k,W)}async function L(s,k,W){let H=dc(W),le=k?.dryRun===!0;if(k?.types!==!1)await Un("types",s.allComponentsForTypes,{outDir:"types",preamble:"",...k?.typesOptions,exports:s.exports,inputDir:H,dryRun:le,cache:s.cache,resolvedPathByFilePath:s.resolvedPathByFilePath,crossFileResolvedPathByFilePath:s.crossFileResolvedPathByFilePath,inlinedTypesByFilePath:s.inlinedTypesByFilePath});if(k?.json)await Un("json",s.components,{outFile:"COMPONENT_API.json",...k?.jsonOptions,input:W,inputDir:H,entryExports:s.entryExports,dryRun:le});if(k?.markdown)await Un("markdown",s.components,{outFile:"COMPONENT_INDEX.md",...k?.markdownOptions,entryExports:s.entryExports,dryRun:le});if(k?.customElements)await Un("custom-elements",s.components,{outFile:"custom-elements.json",...k?.customElementsOptions,inputDir:H,dryRun:le});if(k?.llms)await Un("llms",s.components,{...k?.llmsOptions,entryExports:s.entryExports,dryRun:le});let fe=Object.entries(k?.additionalWriters??{}).map(([Ae,De])=>{let Re=ue(Ae);if(!Re){console.warn(`sveld: no writer registered with name "${Ae}"; skipping.`);return}let $e=Re.componentSet==="all"?s.allComponentsForTypes:s.components,Le={...De,dryRun:le};return Ph(Ae,Re,$e,Le)});await Promise.all(fe)}async function Ph(s,k,W,H){try{return await k.write(W,H)}catch(le){let fe=le instanceof Error?le.message:String(le);throw Error(`sveld: writer "${s}" failed: ${fe}`,{cause:le})}}async function hc(s,k,W){let H=dc(W);if(k?.json){let le={...k?.jsonOptions,inputDir:H,entryExports:s.entryExports},fe=k.stdout==="ndjson"?qa(s.components,le):as(s.components,le);process.stdout.write(fe);return}if(k?.markdown){let le=vs(s.components,{...k?.markdownOptions,entryExports:s.entryExports});process.stdout.write(le);return}if(k?.customElements){let le=ns(s.components,{...k?.customElementsOptions,inputDir:H});process.stdout.write(le)}}import{appendFileSync as Nh,existsSync as Dh}from"node:fs";import{join as Rh}from"node:path";var gc=/%/g,yc=/\r/g,xc=/\n/g,_h=/,/g,Ah=/:/g,vc=/\|/g;function mc(s){return s.replace(gc,"%25").replace(yc,"%0D").replace(xc,"%0A").replace(_h,"%2C").replace(Ah,"%3A")}function Th(s){return s.replace(gc,"%25").replace(yc,"%0D").replace(xc,"%0A")}function Cc(s,k,W,H,le,fe){let Ae=s==="error"?"error":"warning",De=[];if(H!==void 0)De.push(`file=${mc(H)}`);if(le!==void 0)De.push(`line=${le}`);if(fe!==void 0)De.push(`col=${fe}`);return De.push(`title=${mc(k)}`),`::${Ae} ${De.join(",")}::${Th(W)}`}function Ec(s){return s.filter((k)=>!k.ignored).map((k)=>Cc(k.severity,`sveld ${k.code}`,k.message,k.component,k.source?.start.line,k.source?.start.column)).join(`
273
+ `)}function bc(s){let k=s.filter((H)=>!H.ignored);if(k.length===0)return"";return["### sveld diagnostics","","| Severity | Code | Location | Message |","| --- | --- | --- | --- |",...k.map((H)=>{let le=H.source?`${H.component}:${H.source.start.line}`:H.component;return`| ${H.severity} | ${H.code} | ${le} | ${H.message.replace(vc,"\\|")} |`})].join(`
274
+ `)}function Sc(s,k){return s.changes.filter((W)=>er(W.bump,k))}function kc(s,k){return Sc(s,k).map((W)=>Cc("error","sveld breaking change",W.message,W.component==="*"?void 0:W.component)).join(`
275
+ `)}function wc(s,k){let W=Sc(s,k);if(W.length===0)return"";return["### sveld breaking changes","","| Component | Kind | Message |","| --- | --- | --- |",...W.map((le)=>`| ${le.component} | ${le.kind} | ${le.message.replace(vc,"\\|")} |`)].join(`
276
+ `)}var bs="src/index.js",ht={SUCCESS:0,USAGE_ERROR:1,GENERATION_FAILURE:2,BREAKING_CHANGE:3,DIAGNOSTICS:4},Ih=`Usage: sveld [options]
277
+
278
+ Generate TypeScript definitions and component documentation for a Svelte
279
+ library. With no flags, only TypeScript definitions are generated for the
280
+ entry resolved from package.json#svelte.
281
+
282
+ --entry, --cache, --check, --types-format, --types-export,
283
+ --types-comments, --types-inline, and --types-props-declaration accept
284
+ their value as --flag=value or as a separate --flag value argument.
285
+
286
+ Options:
287
+ --entry=<path> Entry point to uncompiled Svelte source (default: package.json "svelte" field)
288
+ --glob Analyze all *.svelte files instead of the entry barrel
289
+ --types Generate TypeScript definitions (default: true)
290
+ --json Generate component documentation in JSON format
291
+ --markdown Generate component documentation in Markdown format
292
+ --custom-elements Generate a Custom Elements Manifest (custom-elements.json)
293
+ --llms Generate an llms.txt / llms-full.txt pair (https://llmstxt.org)
294
+ --fail-fast Abort the run when a single component fails to parse
295
+ --dry-run Resolve, parse, and print "would write" lines for each output file instead of writing anything (including the parse cache)
296
+ --quiet Suppress progress logs (errors, the diagnostics summary, and the --check report are unaffected)
297
+ --stdout[=json|ndjson] Print the document from exactly one of --json, --markdown, or --custom-elements to stdout and write nothing to disk (rejects --types and --check); --stdout=ndjson prints one JSON object per component per line and requires --json
298
+ --cache[=<path>] Persist parsed output and skip re-parsing unchanged files (on by default, default path: node_modules/.cache/sveld/parse-cache.json; pass --cache=false to disable)
299
+ --resolve-types Expand opaque imported $props() types into JSON (alias: --resolveTypes, deprecated)
300
+ --check-examples[=syntax] Check @example blocks: TS/JS against the TypeScript program, svelte/html markup against sveld's own parser (alias: --checkExamples, deprecated); --check-examples=syntax runs only the markup path and never loads TypeScript
301
+ --report-diagnostics Print unresolved-type diagnostics to stderr
302
+ --strict[=errors|ci|local] Exit with code 4 when diagnostics exist (implies --report-diagnostics); --strict=errors only fails on error-severity diagnostics; --strict=ci expands to {strict:true, reportDiagnostics:true, check:true, checkExamples:true}, --strict=local to {reportDiagnostics:true}
303
+ --types-format=<format> ".d.ts" output format: "class" (default) or "component" (Svelte 5 Component<...>)
304
+ --types-export=<all|none> Sets typesOptions.exportTypes; "all" exports every generated type (default), "none" keeps them all local
305
+ --types-comments=<all|descriptions|none> Sets typesOptions.comments; how much JSDoc lands in the generated .d.ts (default: all)
306
+ --types-inline=<local|all> Sets typesOptions.inline; copies imported types into the .d.ts instead of importing them (default: false; pass --types-inline=false to reset)
307
+ --types-index-types Sets typesOptions.indexTypes; also re-exports generated types from index.d.ts (pass --types-index-types=false to disable)
308
+ --types-props-declaration=<type|interface> Sets typesOptions.propsDeclaration; emits the props type as a type alias (default) or an interface
309
+ --check[=<path>] Diff the parsed API against a committed snapshot; exit 3 on a breaking change (default path: COMPONENT_API.json)
310
+ --check-level=<major|minor|patch> Minimum bump --check fails the run on (default: major)
311
+ --format=<text|json|github> Output format for the --check report and the diagnostics summary (default: text); "github" prints GitHub Actions ::error/::warning lines and appends a GITHUB_STEP_SUMMARY table when that env var is set
312
+ --help Print this help message and exit
313
+ --version Print the installed sveld version and exit
314
+
315
+ Exit codes:
316
+ 0 success
317
+ 1 usage or configuration error
318
+ 2 generation failure
319
+ 3 breaking API change detected by --check
320
+ 4 diagnostics present under --strict
321
+ `,Ss={resolveTypes:"resolve-types",checkExamples:"check-examples"},Oh=["help","version","glob","types","json","markdown","quiet","stdout","custom-elements","llms","strict","report-diagnostics","resolve-types","check-examples","fail-fast","dry-run","entry","cache","check","check-level","types-format","types-export","types-comments","types-inline","types-index-types","types-props-declaration","format"],$h=[...Oh,...Object.keys(Ss)],Lh=new Set(["glob","types","json","markdown","quiet","custom-elements","llms","strict","report-diagnostics","resolve-types","check-examples","fail-fast","dry-run","types-index-types"]),Mh=new Set(["entry","cache","check","types-format","types-export","types-comments","types-inline","types-props-declaration"]),Fh=new Set(["entry","types-format","types-export","types-comments","types-inline","types-props-declaration"]);function Bh(s){let k=B(s,$h);return k===void 0?void 0:Ss[k]??k}function jh(s,k){let W=s.indexOf("="),H=W===-1?s.slice(2):s.slice(2,W),le=Ss[H]??H,fe=W===-1?!0:s.slice(W+1),Ae=!1;if(W===-1&&Mh.has(le)){if(k!==void 0&&!k.startsWith("--"))fe=k,Ae=!0;else if(Fh.has(le))return{result:{kind:"usage-error",message:`sveld: --${le} requires a value (pass --${le}=<value> or --${le} <value>).`},consumedNext:!1,flag:le}}return{result:Vh(le,fe,s,H),consumedNext:Ae,flag:le}}function Vh(s,k,W,H){switch(s){case"help":return{kind:"help"};case"version":return{kind:"version"};case"glob":case"types":case"json":case"markdown":case"quiet":return{kind:"option",option:{[s]:k===!0||k==="true"}};case"stdout":if(k===!0||k==="true")return{kind:"option",option:{stdout:!0}};if(k==="false")return{kind:"option",option:{stdout:!1}};return{kind:"option",option:{stdout:k}};case"custom-elements":return{kind:"option",option:{customElements:k===!0||k==="true"}};case"llms":return{kind:"option",option:{llms:k===!0||k==="true"}};case"strict":if(k===!0||k==="true")return{kind:"option",option:{strict:!0}};if(k==="false")return{kind:"option",option:{strict:!1}};return{kind:"option",option:{strict:k}};case"report-diagnostics":return{kind:"option",option:{reportDiagnostics:k===!0||k==="true"}};case"resolve-types":return{kind:"option",option:{resolveTypes:k===!0||k==="true"}};case"check-examples":if(k===!0||k==="true")return{kind:"option",option:{checkExamples:!0}};if(k==="false")return{kind:"option",option:{checkExamples:!1}};return{kind:"option",option:{checkExamples:k}};case"fail-fast":return{kind:"option",option:{failFast:k===!0||k==="true"}};case"dry-run":return{kind:"option",option:{dryRun:k===!0||k==="true"}};case"entry":return typeof k==="string"?{kind:"option",option:{entry:k}}:{kind:"option",option:{}};case"cache":if(k==="false")return{kind:"option",option:{cache:!1}};return{kind:"option",option:{cache:typeof k==="string"?k:!0}};case"check":if(k==="false")return{kind:"option",option:{check:!1}};return{kind:"option",option:{check:typeof k==="string"?k:!0}};case"types-format":return typeof k==="string"?{kind:"option",option:{typesOptions:{format:k}}}:{kind:"option",option:{}};case"types-export":return typeof k==="string"?{kind:"option",option:{typesOptions:{exportTypes:k}}}:{kind:"option",option:{}};case"types-comments":return typeof k==="string"?{kind:"option",option:{typesOptions:{comments:k}}}:{kind:"option",option:{}};case"types-inline":if(k==="false")return{kind:"option",option:{typesOptions:{inline:!1}}};return typeof k==="string"?{kind:"option",option:{typesOptions:{inline:k}}}:{kind:"option",option:{}};case"types-index-types":return{kind:"option",option:{typesOptions:{indexTypes:k===!0||k==="true"}}};case"types-props-declaration":return typeof k==="string"?{kind:"option",option:{typesOptions:{propsDeclaration:k}}}:{kind:"option",option:{}};case"format":return typeof k==="string"?{kind:"option",option:{format:k}}:{kind:"option",option:{}};case"check-level":return typeof k==="string"?{kind:"option",option:{checkLevel:k}}:{kind:"option",option:{}};default:return{kind:"unknown",arg:W,suggestion:Bh(H)}}}function Wh(s){let k={},W=!1;for(let H=0;H<s.length;H++){let le=s[H];if(!le.startsWith("--"))return{kind:"unknown",arg:le,positionalHint:W?!0:void 0};let{result:fe,consumedNext:Ae,flag:De}=jh(le,s[H+1]);if(fe.kind!=="option")return fe;if(k=D(k,fe.option),W=Lh.has(De),Ae)H++}return{kind:"options",options:k}}var Gh=[{flagName:"types-format",key:"format",values:["class","component"]},{flagName:"types-comments",key:"comments",values:["all","descriptions","none"]},{flagName:"types-inline",key:"inline",values:["local","all"]},{flagName:"types-props-declaration",key:"propsDeclaration",values:["type","interface"]}];function Hh(s){let k=s.map((W)=>`"${W}"`);return k.length<=2?k.join(" or "):`${k.slice(0,-1).join(", ")}, or ${k.at(-1)}`}async function Ee(s){let k=Wh(s.argv.slice(2));if(k.kind==="help"){console.log(Ih);return}if(k.kind==="version"){console.log(Rs.version);return}if(k.kind==="usage-error"){console.error(k.message),s.exitCode=ht.USAGE_ERROR;return}if(k.kind==="unknown"){let Ve=`sveld: unknown flag "${k.arg}".`;if(k.suggestion)Ve+=` Did you mean "--${k.suggestion}"?`;if(k.positionalHint)Ve+=" Values are passed as --flag=value or --flag value.";console.error(Ve),console.error("Run sveld --help for a list of available flags."),s.exitCode=ht.USAGE_ERROR;return}let W=k.options,H;try{H=await J()}catch(Ve){console.error(Ve instanceof Error?Ve.message:String(Ve)),s.exitCode=ht.USAGE_ERROR;return}let le=ae(D(H,W));if(q(le),le.stdout){if(le.stdout!==!0&&le.stdout!=="json"&&le.stdout!=="ndjson"){console.error(`sveld: --stdout must be "json" or "ndjson"; got "${le.stdout}".`),s.exitCode=ht.USAGE_ERROR;return}if([le.json,le.markdown,le.customElements].filter(Boolean).length!==1){console.error("sveld: --stdout requires exactly one of --json, --markdown, or --custom-elements."),s.exitCode=ht.USAGE_ERROR;return}if(le.stdout==="ndjson"&&!le.json){console.error("sveld: --stdout=ndjson is only valid with --json."),s.exitCode=ht.USAGE_ERROR;return}if(le.types===!0){console.error("sveld: --stdout cannot be combined with --types; type definitions span multiple files."),s.exitCode=ht.USAGE_ERROR;return}if(le.check){console.error("sveld: --stdout cannot be combined with --check; both write their document to stdout."),s.exitCode=ht.USAGE_ERROR;return}}if(le.format!==void 0&&le.format!=="text"&&le.format!=="json"&&le.format!=="github"){console.error(`sveld: --format must be "text", "json", or "github"; got "${le.format}".`),s.exitCode=ht.USAGE_ERROR;return}if(le.strict!==void 0&&le.strict!==!0&&le.strict!==!1&&le.strict!=="errors"){console.error(`sveld: --strict must be "errors", "ci", or "local" when given a value; got "${le.strict}".`),s.exitCode=ht.USAGE_ERROR;return}if(le.checkLevel!==void 0&&le.checkLevel!=="major"&&le.checkLevel!=="minor"&&le.checkLevel!=="patch"){console.error(`sveld: --check-level must be "major", "minor", or "patch"; got "${le.checkLevel}".`),s.exitCode=ht.USAGE_ERROR;return}if(le.checkExamples!==void 0&&le.checkExamples!==!0&&le.checkExamples!==!1&&le.checkExamples!=="syntax"){console.error(`sveld: --check-examples must be "syntax" when given a value; got "${le.checkExamples}".`),s.exitCode=ht.USAGE_ERROR;return}let fe=le.typesOptions?.exportTypes;if(typeof fe==="string"){if(fe!=="all"&&fe!=="none"){console.error(`sveld: --types-export must be "all" or "none"; got "${fe}".`),s.exitCode=ht.USAGE_ERROR;return}le.typesOptions={...le.typesOptions,exportTypes:fe==="all"}}for(let{flagName:Ve,key:We,values:He}of Gh){let qe=le.typesOptions?.[We];if(qe===void 0||qe===!1)continue;if(!He.includes(qe)){console.error(`sveld: --${Ve} must be ${Hh(He)}; got "${qe}".`),s.exitCode=ht.USAGE_ERROR;return}}V(le.quiet===!0);let Ae=F(le.entry),De;if(Ae!==null)De=Ae;else if(Dh(Rh(s.cwd(),bs)))console.error(`sveld: could not resolve an entry point; falling back to "${bs}". Set package.json#svelte (or pass --entry) to avoid relying on this fallback.`),De=Dn(t(bs));else{s.exitCode=ht.USAGE_ERROR;return}let Re,$e;try{if(Re=await I(De,le.glob===!0,N(le)),le.check)$e=await X(Re.components,oe(le),{entryExports:Re.entryExports});if(le.stdout)await hc(Re,le,De);else if(await L(Re,le,De),!le.dryRun)Re.cache?.save()}catch(Ve){if(Ve instanceof gn){console.error(`sveld: ${Ve.message}`),s.exitCode=ht.USAGE_ERROR;return}console.error(Ve instanceof Error?Ve.message:String(Ve)),s.exitCode=ht.GENERATION_FAILURE;return}let Le=le.reportDiagnostics||le.strict,Be=Z(Re.diagnostics,Le),Fe=[];if(Le&&Be.length>0)if(le.format==="json")s.stderr.write(te(Be));else if(le.format==="github"){let Ve=Ec(Be);if(Ve)console.error(Ve);let We=bc(Be);if(We)Fe.push(We)}else console.error(ee(Be));if($e)if(le.format==="json")s.stdout.write(Te($e));else if(le.format==="github"){let Ve=kc($e,le.checkLevel??"major");if(Ve)console.log(Ve);let We=wc($e,le.checkLevel??"major");if(We)Fe.push(We)}else console.log(xe($e));if(le.format==="github"&&Fe.length>0&&s.env.GITHUB_STEP_SUMMARY)Nh(s.env.GITHUB_STEP_SUMMARY,`${Fe.join(`
322
+
323
+ `)}
324
+ `);let Me;if($e?.changes.some((Ve)=>Ve.kind==="schema")??!1)Me=ht.USAGE_ERROR;else if($e&&er($e.bump,le.checkLevel??"major"))Me=ht.BREAKING_CHANGE;if(K(Be,le.strict).length>0)Me=Me===void 0?ht.DIAGNOSTICS:Math.min(Me,ht.DIAGNOSTICS);if(Me!==void 0)s.exitCode=Me}
325
+ export{_e,a,O,r,be,y,e,M,l,g,x,Se,de,f,P,T,B,G,Y,v,z,i,Z,K,ee,ke,te,j,E,C,d,c,ne,re,me,se,w,Ce,he,m,ie,ye,b,p,u,n,ge,A,t,o,we,oe,X,xe,Pe,Te,F,Ne,J,D,ae,q,V,ce,h,pe,U,Q,S,_,N,I,R,ue,Ie,ve,L,Ee};